Ray's changes for front-end banner

This commit is contained in:
Christophe Vilayphiou committed 2012-05-08 17:21:26 +08:00
1 parent 2aaff21000
commit a3868cb785
8 files changed
+76 -18

No files matched your search

+13 -2
View File
@@ -41,8 +41,19 @@ module ParserCommon
ad_banner = AdBanner.find(banner["id"]) rescue nil
if ad_banner
res << "<script type='text/javascript'>
$(document).ready(function(){ $('#slideshow-#{ad_banner.title.dehumanize}').cycle({delay: -1000, fx: '#{ad_banner.ad_fx.nil?? 'fade': ad_banner.ad_fx}', timeoutFn: getTimeout }); });
$(document).ready(function(){
$('#slideshow-#{ad_banner.title.dehumanize}').cycle({
delay: -1000,
fx: '#{ad_banner.ad_fx.nil? ? 'fade': ad_banner.ad_fx}',
timeoutFn: getTimeout,
pager: '#banner_nav',
pagerAnchorBuilder: function(idx, slide) {
return \"<li><a href='#'>sfdsfsf</a></li>\";
}
});
});
</script>"
res << "<ul id='banner_nav' class='clear'></ul>"
res << "<div id='slideshow-#{ad_banner.title.dehumanize}'>"
printable_ad_images = []
ad_banner.ad_images.each do |ad_image|
@@ -55,7 +66,7 @@ module ParserCommon
printable_ad_images.shuffle!
printable_ad_images.each do |ad_image| #TODO Need Reflact
res << "<img src='#{ad_image.file}' "
res << "alt='#{ad_image.title || ' '}' "
res << "alt='#{ad_image.title[I18n.locale] || ' '}' "
res << "time_to_next='#{ad_banner.transition_msec}' "
res << "link_open='#{ad_image.link_open}' "
# res << "link_url='#{(ad_image.direct_to_after_click?? ad_image.out_link : ad_banner.context) || ' '}' "