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_after_html = ""
if has_jplayer
extra_before_html = ActionController::Base.helpers.stylesheet_link_tag("ad_banner/jplayer.blue.monday.min.css")
extra_after_html = ActionController::Base.helpers.javascript_include_tag("ad_banner/jquery.jplayer.min.js")
extra_before_html = ActionController::Base.helpers.stylesheet_link_tag("banner/jplayer.blue.monday.min.css")
extra_after_html = ActionController::Base.helpers.javascript_include_tag("banner/jquery.jplayer.min.js")
end
{
"extras" => {

View File

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

View File

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

View File

@ -226,12 +226,12 @@
<% if image.exchange_item == '1' %>
<div class="slide-img" style=" background: url('<%= image.file.thumb.url %>'); background-size: cover; background-position: center;"></div>
<% 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 %>
<% 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('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 %>/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 %>/666&text=B'); background-size: cover; background-position: center;"></div>
<% end %>
</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>
</div>
<% 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? %>
<div class="ad-image-expired"><%= t("ad_banner.expired") %></div>
<% 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>
<% end %>
<% 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('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 %>/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 %>/666&text=B'); background-size: cover; background-position: center;"></div>
<% end %>
</div>

View File

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

View File

@ -1,7 +1,7 @@
<% content_for :page_specific_css do %>
<%= stylesheet_link_tag "lib/main-forms" %>
<%= stylesheet_link_tag "lib/fileupload" %>
<%= stylesheet_link_tag "ad_banner/jplayer.blue.monday.min" %>
<%= stylesheet_link_tag "banner/jplayer.blue.monday.min" %>
<% end %>
<% content_for :page_specific_javascript do %>
<%= javascript_include_tag "lib/bootstrap-fileupload" %>
@ -9,7 +9,7 @@
<%= javascript_include_tag "lib/datetimepicker/datetimepicker.js" %>
<%= javascript_include_tag "lib/module-area" %>
<%= javascript_include_tag "validator" %>
<%= javascript_include_tag "ad_banner/jquery.jplayer.min" %>
<%= javascript_include_tag "banner/jquery.jplayer.min" %>
<% end %>
<style type="text/css">
.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">
@media screen and (max-width: 500px) {
@ -274,7 +274,7 @@
<% end %>
window.console.log("end");
},
swfPath: "/assets/ad_banner",
swfPath: "/assets/banner",
supplied: "webmv, ogv, m4v",
globalVolume: true,
useStateClassSkin: true,