mistake commit
This commit is contained in:
1 parent
dddd1f33fd
commit
2608b72d65
6 files changed
+49
-1
No files matched your search
@@ -82,6 +82,31 @@ module ParserFrontEnd
|
||||
end
|
||||
res
|
||||
end
|
||||
c.define_tag 'adbanner' do |tag|
|
||||
res = ''
|
||||
ad_banner = AdBanner.first(conditions:{title: tag.attr["name"]})
|
||||
if ad_banner.display?
|
||||
res << "<script type='text/javascript' src='http://cloud.github.com/downloads/malsup/cycle/jquery.cycle.all.latest.js'></script>"
|
||||
res << "<script type='text/javascript'>function onAfter(e) {
|
||||
var parent = $(this).parent();
|
||||
var time_to_next = $(this).attr('time_to_next');
|
||||
parent.cycle('pause');
|
||||
setTimeout(function(){parent.cycle('resume')},time_to_next);
|
||||
|
||||
} $(document).ready(function() { $('.slideshow').cycle({after: onAfter,timeout:1 ,fx: '#{ad_banner.ad_fx.nil?? 'fade': ad_banner.ad_fx}' }).children('img').click(function(){if($(this).attr('link_open')=='new_window'){window.open($(this).attr('link_url'));} else{document.location.href=$(this).attr('link_url');}});; }); </script>"
|
||||
|
||||
res << "<div class='slideshow'>"
|
||||
ad_banner.ad_images.each do |ad_image|
|
||||
res << "<img src='#{ad_image.file}' "
|
||||
res << "alt='#{ad_image.picture_intro || ' '}' "
|
||||
res << "time_to_next='#{ad_image.get_delay_time}' "
|
||||
res << "link_url='#{(ad_banner.direct_to_after_click?? ad_image.out_link : ad_banner.context) || ' '}' "
|
||||
res << "/>"
|
||||
end
|
||||
res << "</div>"
|
||||
end
|
||||
res
|
||||
end
|
||||
c.define_tag 'image' do |tag|
|
||||
image = page.custom_images.detect{|image| image.name.eql?(tag.attr['name']) }
|
||||
image = page.design.custom_images.detect{|image| image.name.eql?(tag.attr['name']) } unless image
|
||||
|
||||
Reference in new issue
Block a user