Fix css and js blocked by ad block!

This commit is contained in:
BoHung Chiu 2022-01-03 19:56:30 +08:00
parent 24a5833593
commit 7ef3b1496c
23 changed files with 15 additions and 15 deletions

View File

@ -145,8 +145,8 @@ class AdBannersController < ApplicationController
extra_before_html = "" extra_before_html = ""
extra_after_html = "" extra_after_html = ""
if has_jplayer if has_jplayer
extra_before_html = ActionController::Base.helpers.stylesheet_link_tag("ad_banner/jplayer.blue.monday.min.css") extra_before_html = ActionController::Base.helpers.stylesheet_link_tag("banner/jplayer.blue.monday.min.css")
extra_after_html = ActionController::Base.helpers.javascript_include_tag("ad_banner/jquery.jplayer.min.js") extra_after_html = ActionController::Base.helpers.javascript_include_tag("banner/jquery.jplayer.min.js")
end end
{ {
"extras" => { "extras" => {

View File

@ -64,7 +64,7 @@ class AdImage
if !uri.nil? && uri.host == "www.youtube.com" if !uri.nil? && uri.host == "www.youtube.com"
params = CGI.parse(uri.query) params = CGI.parse(uri.query)
v = params['v'].first v = params['v'].first
return "http://www.youtube.com/embed/#{v}" return "//www.youtube.com/embed/#{v}"
else else
return "" return ""
end end

View File

@ -9,7 +9,7 @@
<%= javascript_include_tag "lib/module-area" %> <%= javascript_include_tag "lib/module-area" %>
<%= javascript_include_tag "validator" %> <%= javascript_include_tag "validator" %>
<%= javascript_include_tag "cycle2" %> <%= javascript_include_tag "cycle2" %>
<%= javascript_include_tag "ad_banner/banner_preview" %> <%= javascript_include_tag "banner/banner_preview" %>
<% end %> <% end %>
<style type="text/css"> <style type="text/css">

View File

@ -226,12 +226,12 @@
<% if image.exchange_item == '1' %> <% if image.exchange_item == '1' %>
<div class="slide-img" style=" background: url('<%= image.file.thumb.url %>'); background-size: cover; background-position: center;"></div> <div class="slide-img" style=" background: url('<%= image.file.thumb.url %>'); background-size: cover; background-position: center;"></div>
<% elsif image.exchange_item == '2' %> <% elsif image.exchange_item == '2' %>
<div class="slide-img" style=" background: url('http://img.youtube.com/vi/<%= image.youtube.to_s[-11,11] %>/hqdefault.jpg'); background-size: cover; background-position: center;"></div> <div class="slide-img" style=" background: url('https://img.youtube.com/vi/<%= image.youtube.to_s[-11,11] %>/hqdefault.jpg'); background-size: cover; background-position: center;"></div>
<% end %> <% end %>
<% end %> <% end %>
<% else %> <% else %>
<div class="slide-img" style="background: url('http://placehold.it/<%= banner.width %>x<%= banner.height %>/888&text=A'); background-size: cover; background-position: center;"></div> <div class="slide-img" style="background: url('/annc_url?url=http://placehold.it/<%= banner.width %>x<%= banner.height %>/888&text=A'); background-size: cover; background-position: center;"></div>
<div class="slide-img" style="background: url('http://placehold.it/<%= banner.width %>x<%= banner.height %>/666&text=B'); background-size: cover; background-position: center;"></div> <div class="slide-img" style="background: url('/annc_url?url=http://placehold.it/<%= banner.width %>x<%= banner.height %>/666&text=B'); background-size: cover; background-position: center;"></div>
<% end %> <% end %>
</div> </div>
@ -304,7 +304,7 @@
<a class="ad-image-btn pull-right delete text-error" href="#" class="delete text-error" rel="/admin/ad_images/<%= image.id.to_s %>"><i class="icons-trash"></i><%= t(:delete_) %></a> <a class="ad-image-btn pull-right delete text-error" href="#" class="delete text-error" rel="/admin/ad_images/<%= image.id.to_s %>"><i class="icons-trash"></i><%= t(:delete_) %></a>
</div> </div>
<% else %> <% else %>
<div class="ad-banner-image <%= image.expired? ? "grayscale" : "" %>" style="background: url('http://img.youtube.com/vi/<%= image.youtube.to_s[-11,11] %>/hqdefault.jpg'); background-size: cover; background-position: center;"> <div class="ad-banner-image <%= image.expired? ? "grayscale" : "" %>" style="background: url('https://img.youtube.com/vi/<%= image.youtube.to_s[-11,11] %>/hqdefault.jpg'); background-size: cover; background-position: center;">
<% if image.expired? %> <% if image.expired? %>
<div class="ad-image-expired"><%= t("ad_banner.expired") %></div> <div class="ad-image-expired"><%= t("ad_banner.expired") %></div>
<% end %> <% end %>

View File

@ -31,8 +31,8 @@
<div class="slide-img" style=" background: url('<%= image.exchange_item == "1" ? image.file.thumb.url : image.youtube_thumb %>'); background-size: cover; background-position: center;"></div> <div class="slide-img" style=" background: url('<%= image.exchange_item == "1" ? image.file.thumb.url : image.youtube_thumb %>'); background-size: cover; background-position: center;"></div>
<% end %> <% end %>
<% else %> <% else %>
<div class="slide-img" style="background: url('http://placehold.it/<%= banner.width %>x<%= banner.height %>/888&text=A'); background-size: cover; background-position: center;"></div> <div class="slide-img" style="background: url('/annc_url?url=http://placehold.it/<%= banner.width %>x<%= banner.height %>/888&text=A'); background-size: cover; background-position: center;"></div>
<div class="slide-img" style="background: url('http://placehold.it/<%= banner.width %>x<%= banner.height %>/666&text=B'); background-size: cover; background-position: center;"></div> <div class="slide-img" style="background: url('/annc_url?url=http://placehold.it/<%= banner.width %>x<%= banner.height %>/666&text=B'); background-size: cover; background-position: center;"></div>
<% end %> <% end %>
</div> </div>

View File

@ -1,6 +1,6 @@
<% content_for :page_specific_javascript do %> <% content_for :page_specific_javascript do %>
<%= javascript_include_tag "cycle2" %> <%= javascript_include_tag "cycle2" %>
<%= javascript_include_tag "ad_banner/banner_preview" %> <%= javascript_include_tag "banner/banner_preview" %>
<% end %> <% end %>
<%= render_filter @filter_fields, "index_table" %> <%= render_filter @filter_fields, "index_table" %>
<span id="index_table"> <span id="index_table">

View File

@ -1,7 +1,7 @@
<% content_for :page_specific_css do %> <% content_for :page_specific_css do %>
<%= stylesheet_link_tag "lib/main-forms" %> <%= stylesheet_link_tag "lib/main-forms" %>
<%= stylesheet_link_tag "lib/fileupload" %> <%= stylesheet_link_tag "lib/fileupload" %>
<%= stylesheet_link_tag "ad_banner/jplayer.blue.monday.min" %> <%= stylesheet_link_tag "banner/jplayer.blue.monday.min" %>
<% end %> <% end %>
<% content_for :page_specific_javascript do %> <% content_for :page_specific_javascript do %>
<%= javascript_include_tag "lib/bootstrap-fileupload" %> <%= javascript_include_tag "lib/bootstrap-fileupload" %>
@ -9,7 +9,7 @@
<%= javascript_include_tag "lib/datetimepicker/datetimepicker.js" %> <%= javascript_include_tag "lib/datetimepicker/datetimepicker.js" %>
<%= javascript_include_tag "lib/module-area" %> <%= javascript_include_tag "lib/module-area" %>
<%= javascript_include_tag "validator" %> <%= javascript_include_tag "validator" %>
<%= javascript_include_tag "ad_banner/jquery.jplayer.min" %> <%= javascript_include_tag "banner/jquery.jplayer.min" %>
<% end %> <% end %>
<style type="text/css"> <style type="text/css">
.fileupload .video-thumbnail{ .fileupload .video-thumbnail{

View File

@ -1,4 +1,4 @@
<%= javascript_include_tag "ad_banner/jplayer_front" %> <%= javascript_include_tag "banner/jplayer_front" %>
<style type="text/css"> <style type="text/css">
@media screen and (max-width: 500px) { @media screen and (max-width: 500px) {
@ -274,7 +274,7 @@
<% end %> <% end %>
window.console.log("end"); window.console.log("end");
}, },
swfPath: "/assets/ad_banner", swfPath: "/assets/banner",
supplied: "webmv, ogv, m4v", supplied: "webmv, ogv, m4v",
globalVolume: true, globalVolume: true,
useStateClassSkin: true, useStateClassSkin: true,