From 18e18a4add1d83f64e03a422ba779a836bbf5232 Mon Sep 17 00:00:00 2001 From: Christophe Vilayphiou Date: Mon, 13 Aug 2012 15:10:53 +0800 Subject: [PATCH] Fix for banner on ie --- .../javascripts/lib/jquery.preload-min.js | 9 ++++++ app/helpers/application_helper.rb | 1 + lib/parsers/parser_common.rb | 28 +++++++++++-------- 3 files changed, 27 insertions(+), 11 deletions(-) create mode 100755 app/assets/javascripts/lib/jquery.preload-min.js diff --git a/app/assets/javascripts/lib/jquery.preload-min.js b/app/assets/javascripts/lib/jquery.preload-min.js new file mode 100755 index 00000000..cf3a0f1f --- /dev/null +++ b/app/assets/javascripts/lib/jquery.preload-min.js @@ -0,0 +1,9 @@ +/** + * jQuery.Preload - Multifunctional preloader + * Copyright (c) 2008 Ariel Flesler - aflesler(at)gmail(dot)com + * Dual licensed under MIT and GPL. + * Date: 3/25/2009 + * @author Ariel Flesler + * @version 1.0.8 + */ +;(function($){var h=$.preload=function(c,d){if(c.split)c=$(c);d=$.extend({},h.defaults,d);var f=$.map(c,function(a){if(!a)return;if(a.split)return d.base+a+d.ext;var b=a.src||a.href;if(typeof d.placeholder=='string'&&a.src)a.src=d.placeholder;if(b&&d.find)b=b.replace(d.find,d.replace);return b||null}),data={loaded:0,failed:0,next:0,done:0,total:f.length};if(!data.total)return finish();var g=$(Array(d.threshold+1).join('')).load(handler).error(handler).bind('abort',handler).each(fetch);function handler(e){data.element=this;data.found=e.type=='load';data.image=this.src;data.index=this.index;var a=data.original=c[this.index];data[data.found?'loaded':'failed']++;data.done++;if(d.enforceCache)h.cache.push($('').attr('src',data.image)[0]);if(d.placeholder&&a.src)a.src=data.found?data.image:d.notFound||a.src;if(d.onComplete)d.onComplete(data);if(data.done\n" javascripts << "\n" end + javascripts << "\n" javascripts << "\n" javascripts << "\n" # javascripts << "\n" diff --git a/lib/parsers/parser_common.rb b/lib/parsers/parser_common.rb index 8bfedfe8..56dcd480 100644 --- a/lib/parsers/parser_common.rb +++ b/lib/parsers/parser_common.rb @@ -44,17 +44,23 @@ module ParserCommon ad_banner = AdBanner.find(banner["id"]) rescue nil if ad_banner res << "" res << "" res << "
" @@ -74,7 +80,7 @@ module ParserCommon res << "link_open='#{ad_image.link_open}' " # res << "link_url='#{(ad_image.direct_to_after_click?? ad_image.out_link : ad_banner.context) || ' '}' " res << "link_url='#{(ad_image.out_link)}' " - res << "style='cursor:pointer'" if !ad_image.out_link.blank? + res << "style='cursor:pointer; visibility='hidden'" if !ad_image.out_link.blank? res << "/>" end res << "
"