From 7ef3b1496c5ffdb68cc756b80bb7c6a34cfeb829 Mon Sep 17 00:00:00 2001 From: Bohung Date: Mon, 3 Jan 2022 19:56:30 +0800 Subject: [PATCH] Fix css and js blocked by ad block! --- app/assets/images/{ad_banner => banner}/.keep | 0 .../{ad_banner => banner}/banner_preview.js | 0 .../{ad_banner => banner}/jplayer.playlist.js | 0 .../{ad_banner => banner}/jplayer.playlist.min.js | 0 .../{ad_banner => banner}/jplayer_front.js | 0 .../jquery.jplayer.inspector.js | 0 .../jquery.jplayer.inspector.min.js | 0 .../{ad_banner => banner}/jquery.jplayer.js | 0 .../{ad_banner => banner}/jquery.jplayer.min.js | 0 .../{ad_banner => banner}/jquery.jplayer.swf | Bin .../{ad_banner => banner}/popcorn.jplayer.js | 0 .../{ad_banner => banner}/popcorn.jplayer.min.js | 0 app/assets/stylesheets/{ad_banner => banner}/.keep | 0 .../{ad_banner => banner}/jplayer.blue.monday.css | 0 .../jplayer.blue.monday.min.css | 0 app/controllers/ad_banners_controller.rb | 4 ++-- app/models/ad_image.rb | 2 +- app/views/admin/ad_banners/_form.html.erb | 2 +- app/views/admin/ad_banners/_index.html.erb | 8 ++++---- app/views/admin/ad_banners/_index_table.html.erb | 4 ++-- app/views/admin/ad_banners/index.html.erb | 2 +- app/views/admin/ad_images/_form.html.erb | 4 ++-- app/views/admin/ad_images/_jplayer.html.erb | 4 ++-- 23 files changed, 15 insertions(+), 15 deletions(-) rename app/assets/images/{ad_banner => banner}/.keep (100%) rename app/assets/javascripts/{ad_banner => banner}/banner_preview.js (100%) rename app/assets/javascripts/{ad_banner => banner}/jplayer.playlist.js (100%) rename app/assets/javascripts/{ad_banner => banner}/jplayer.playlist.min.js (100%) rename app/assets/javascripts/{ad_banner => banner}/jplayer_front.js (100%) rename app/assets/javascripts/{ad_banner => banner}/jquery.jplayer.inspector.js (100%) rename app/assets/javascripts/{ad_banner => banner}/jquery.jplayer.inspector.min.js (100%) rename app/assets/javascripts/{ad_banner => banner}/jquery.jplayer.js (100%) rename app/assets/javascripts/{ad_banner => banner}/jquery.jplayer.min.js (100%) rename app/assets/javascripts/{ad_banner => banner}/jquery.jplayer.swf (100%) rename app/assets/javascripts/{ad_banner => banner}/popcorn.jplayer.js (100%) rename app/assets/javascripts/{ad_banner => banner}/popcorn.jplayer.min.js (100%) rename app/assets/stylesheets/{ad_banner => banner}/.keep (100%) rename app/assets/stylesheets/{ad_banner => banner}/jplayer.blue.monday.css (100%) rename app/assets/stylesheets/{ad_banner => banner}/jplayer.blue.monday.min.css (100%) diff --git a/app/assets/images/ad_banner/.keep b/app/assets/images/banner/.keep similarity index 100% rename from app/assets/images/ad_banner/.keep rename to app/assets/images/banner/.keep diff --git a/app/assets/javascripts/ad_banner/banner_preview.js b/app/assets/javascripts/banner/banner_preview.js similarity index 100% rename from app/assets/javascripts/ad_banner/banner_preview.js rename to app/assets/javascripts/banner/banner_preview.js diff --git a/app/assets/javascripts/ad_banner/jplayer.playlist.js b/app/assets/javascripts/banner/jplayer.playlist.js similarity index 100% rename from app/assets/javascripts/ad_banner/jplayer.playlist.js rename to app/assets/javascripts/banner/jplayer.playlist.js diff --git a/app/assets/javascripts/ad_banner/jplayer.playlist.min.js b/app/assets/javascripts/banner/jplayer.playlist.min.js similarity index 100% rename from app/assets/javascripts/ad_banner/jplayer.playlist.min.js rename to app/assets/javascripts/banner/jplayer.playlist.min.js diff --git a/app/assets/javascripts/ad_banner/jplayer_front.js b/app/assets/javascripts/banner/jplayer_front.js similarity index 100% rename from app/assets/javascripts/ad_banner/jplayer_front.js rename to app/assets/javascripts/banner/jplayer_front.js diff --git a/app/assets/javascripts/ad_banner/jquery.jplayer.inspector.js b/app/assets/javascripts/banner/jquery.jplayer.inspector.js similarity index 100% rename from app/assets/javascripts/ad_banner/jquery.jplayer.inspector.js rename to app/assets/javascripts/banner/jquery.jplayer.inspector.js diff --git a/app/assets/javascripts/ad_banner/jquery.jplayer.inspector.min.js b/app/assets/javascripts/banner/jquery.jplayer.inspector.min.js similarity index 100% rename from app/assets/javascripts/ad_banner/jquery.jplayer.inspector.min.js rename to app/assets/javascripts/banner/jquery.jplayer.inspector.min.js diff --git a/app/assets/javascripts/ad_banner/jquery.jplayer.js b/app/assets/javascripts/banner/jquery.jplayer.js similarity index 100% rename from app/assets/javascripts/ad_banner/jquery.jplayer.js rename to app/assets/javascripts/banner/jquery.jplayer.js diff --git a/app/assets/javascripts/ad_banner/jquery.jplayer.min.js b/app/assets/javascripts/banner/jquery.jplayer.min.js similarity index 100% rename from app/assets/javascripts/ad_banner/jquery.jplayer.min.js rename to app/assets/javascripts/banner/jquery.jplayer.min.js diff --git a/app/assets/javascripts/ad_banner/jquery.jplayer.swf b/app/assets/javascripts/banner/jquery.jplayer.swf similarity index 100% rename from app/assets/javascripts/ad_banner/jquery.jplayer.swf rename to app/assets/javascripts/banner/jquery.jplayer.swf diff --git a/app/assets/javascripts/ad_banner/popcorn.jplayer.js b/app/assets/javascripts/banner/popcorn.jplayer.js similarity index 100% rename from app/assets/javascripts/ad_banner/popcorn.jplayer.js rename to app/assets/javascripts/banner/popcorn.jplayer.js diff --git a/app/assets/javascripts/ad_banner/popcorn.jplayer.min.js b/app/assets/javascripts/banner/popcorn.jplayer.min.js similarity index 100% rename from app/assets/javascripts/ad_banner/popcorn.jplayer.min.js rename to app/assets/javascripts/banner/popcorn.jplayer.min.js diff --git a/app/assets/stylesheets/ad_banner/.keep b/app/assets/stylesheets/banner/.keep similarity index 100% rename from app/assets/stylesheets/ad_banner/.keep rename to app/assets/stylesheets/banner/.keep diff --git a/app/assets/stylesheets/ad_banner/jplayer.blue.monday.css b/app/assets/stylesheets/banner/jplayer.blue.monday.css similarity index 100% rename from app/assets/stylesheets/ad_banner/jplayer.blue.monday.css rename to app/assets/stylesheets/banner/jplayer.blue.monday.css diff --git a/app/assets/stylesheets/ad_banner/jplayer.blue.monday.min.css b/app/assets/stylesheets/banner/jplayer.blue.monday.min.css similarity index 100% rename from app/assets/stylesheets/ad_banner/jplayer.blue.monday.min.css rename to app/assets/stylesheets/banner/jplayer.blue.monday.min.css diff --git a/app/controllers/ad_banners_controller.rb b/app/controllers/ad_banners_controller.rb index 475d036..fd4417d 100644 --- a/app/controllers/ad_banners_controller.rb +++ b/app/controllers/ad_banners_controller.rb @@ -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" => { diff --git a/app/models/ad_image.rb b/app/models/ad_image.rb index f76c0c4..7d92fab 100644 --- a/app/models/ad_image.rb +++ b/app/models/ad_image.rb @@ -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 diff --git a/app/views/admin/ad_banners/_form.html.erb b/app/views/admin/ad_banners/_form.html.erb index b2d8e89..43a2074 100644 --- a/app/views/admin/ad_banners/_form.html.erb +++ b/app/views/admin/ad_banners/_form.html.erb @@ -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 %>