The new AdBanner.
This commit is contained in:
1 parent
1451c3ac1d
commit
2747fc42f5
33 files changed
+1784
-250
No files matched your search
@@ -16,22 +16,33 @@ module ParserBackEnd
|
||||
c.define_tag 'ad_banner' do |tag|
|
||||
res = ''
|
||||
ad_banner = AdBanner.find(tag.attr["id"]) rescue nil
|
||||
if ad_banner
|
||||
res << "<script type='text/javascript'>
|
||||
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 }); });
|
||||
</script>"
|
||||
res << "<div id='slideshow-#{ad_banner.title.dehumanize}'>"
|
||||
ad_banner.ad_images.each do |ad_image|
|
||||
res << "<div id='slideshow-#{ad_banner.title.dehumanize}'>"
|
||||
printable_ad_images = []
|
||||
ad_banner.ad_images.each do |ad_image|
|
||||
if ad_image.display?
|
||||
ad_image.weight.times do
|
||||
printable_ad_images << ad_image
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
printable_ad_images.shuffle!
|
||||
printable_ad_images.each do |ad_image| #TODO Need Reflact
|
||||
res << "<img src='#{ad_image.file}' "
|
||||
res << "alt='#{ad_image.picture_intro || ' '}' "
|
||||
res << "time_to_next='#{ad_image.get_delay_time}' "
|
||||
res << "alt='#{ad_image.title || ' '}' "
|
||||
res << "time_to_next='#{ad_banner.transition_sec}' "
|
||||
res << "link_open='#{ad_image.link_open}' "
|
||||
res << "link_url='#{(ad_banner.direct_to_after_click?? ad_image.out_link : ad_banner.context) || ' '}' "
|
||||
res << "/>"
|
||||
# res << "link_url='#{(ad_image.direct_to_after_click?? ad_image.out_link : ad_banner.context) || ' '}' "
|
||||
res << "link_url='#{(ad_image.out_link || ad_banner.context || ' ')}' "
|
||||
res << "/>"
|
||||
end
|
||||
res << "</div>"
|
||||
res
|
||||
end
|
||||
end
|
||||
c.define_tag 'content' do |tag|
|
||||
ret = ''
|
||||
if (tag.attributes["main"] == "true" && !page.module_app.nil?)
|
||||
|
||||
@@ -7,21 +7,31 @@ module ParserFrontEnd
|
||||
c.define_tag 'ad_banner' do |tag|
|
||||
res = ''
|
||||
ad_banner = AdBanner.find(tag.attr["id"]) rescue nil
|
||||
if ad_banner && ad_banner.display?
|
||||
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 }); });
|
||||
</script>"
|
||||
res << "<div id='slideshow-#{ad_banner.title.dehumanize}'>"
|
||||
printable_ad_images = []
|
||||
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_open='#{ad_image.link_open}' "
|
||||
res << "link_url='#{(ad_banner.direct_to_after_click?? ad_image.out_link : ad_banner.context) || ' '}' "
|
||||
res << "/>"
|
||||
if ad_image.display?
|
||||
ad_image.weight.times do
|
||||
printable_ad_images << ad_image
|
||||
end
|
||||
end
|
||||
end
|
||||
res << "</div>"
|
||||
end
|
||||
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 << "time_to_next='#{ad_banner.transition_sec}' "
|
||||
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 || ad_banner.context || ' ')}' "
|
||||
res << "/>"
|
||||
end
|
||||
res << "</div>"
|
||||
res
|
||||
end
|
||||
c.define_tag 'content' do |tag|
|
||||
|
||||
Reference in new issue
Block a user