Commit 2e1f37fd06dac25ce618756cc17537890df4039c
1 parent
3e3a14c9
change version, check pdf include css file
Showing
4 changed files
with
11 additions
and
7 deletions
| @@ -184,8 +184,8 @@ module Kanjai | @@ -184,8 +184,8 @@ module Kanjai | ||
| 184 | css_path = "#{$scheme}#{ADMIN_CONFIG['domain_name']}#{ActionController::Base.helpers.asset_path('kanjai/frontend_extend.css')}" | 184 | css_path = "#{$scheme}#{ADMIN_CONFIG['domain_name']}#{ActionController::Base.helpers.asset_path('kanjai/frontend_extend.css')}" |
| 185 | js_array << "<script type='text/javascript'>$('<link>', {rel: 'stylesheet',type: 'text/css',href: '#{css_path}'}).appendTo('head');</script>" | 185 | js_array << "<script type='text/javascript'>$('<link>', {rel: 'stylesheet',type: 'text/css',href: '#{css_path}'}).appendTo('head');</script>" |
| 186 | 186 | ||
| 187 | - css_path = "#{$scheme}#{ADMIN_CONFIG['domain_name']}#{ActionController::Base.helpers.asset_path('kanjai/pdf.css')}" | ||
| 188 | - js_array << "<script type='text/javascript'>$('<link>', {rel: 'stylesheet',type: 'text/css',href: '#{css_path}'}).appendTo('head');</script>" | 187 | + #css_path = "#{$scheme}#{ADMIN_CONFIG['domain_name']}#{ActionController::Base.helpers.asset_path('kanjai/pdf.css')}" |
| 188 | + #js_array << "<script type='text/javascript'>$('<link>', {rel: 'stylesheet',type: 'text/css',href: '#{css_path}'}).appendTo('head');</script>" | ||
| 189 | layer.gsub!(marker, js_array.join('')) | 189 | layer.gsub!(marker, js_array.join('')) |
| 190 | end | 190 | end |
| 191 | when '###INCLUDE_CSS_FILE###' | 191 | when '###INCLUDE_CSS_FILE###' |
| @@ -200,11 +200,11 @@ module Kanjai | @@ -200,11 +200,11 @@ module Kanjai | ||
| 200 | end | 200 | end |
| 201 | end | 201 | end |
| 202 | 202 | ||
| 203 | - #unless request.format.html? | 203 | + if params[:format].to_s == 'pdf' |
| 204 | css_path = "#{$scheme}#{ADMIN_CONFIG['domain_name']}#{ActionController::Base.helpers.asset_path('kanjai/pdf.css')}" | 204 | css_path = "#{$scheme}#{ADMIN_CONFIG['domain_name']}#{ActionController::Base.helpers.asset_path('kanjai/pdf.css')}" |
| 205 | layer.gsub!(/<\/head>/, '<link rel="stylesheet" href="'+ css_path +'"></head>') | 205 | layer.gsub!(/<\/head>/, '<link rel="stylesheet" href="'+ css_path +'"></head>') |
| 206 | - layer.gsub!(/<meta charset/, '<link rel="stylesheet" href="'+ css_path +'"><meta charset') | ||
| 207 | - #end | 206 | + #layer.gsub!(/<meta charset/, '<link rel="stylesheet" href="'+ css_path +'"><meta charset') |
| 207 | + end | ||
| 208 | 208 | ||
| 209 | 209 | ||
| 210 | return layer | 210 | return layer |
| @@ -14,7 +14,7 @@ module Kanjai | @@ -14,7 +14,7 @@ module Kanjai | ||
| 14 | end | 14 | end |
| 15 | 15 | ||
| 16 | initializer "kanjai.assets.precompile" do |app| | 16 | initializer "kanjai.assets.precompile" do |app| |
| 17 | - app.config.assets.precompile = %w(kanjai/general.css kanjai/general_admin.css kanjai/general_site.css kanjai/general_site_editor.css kanjai/frontend.css kanjai/frontend_extend.css kanjai/pdf.css kanjai/general.js kanjai/general_admin.js kanjai/general_site_editor.js kanjai/frontend.js kanjai/frontend_not_login.js kanjai/frontend_extend kanjai/frontend_pdf) | 17 | + app.config.assets.precompile = %w(kanjai/general.css kanjai/general_admin.css kanjai/general_site.css kanjai/general_site_editor.css kanjai/frontend.css kanjai/frontend_extend.css kanjai/pdf.css kanjai/general.js kanjai/general_admin.js kanjai/general_site_editor.js kanjai/frontend.js kanjai/frontend_not_login.js kanjai/frontend_extend) |
| 18 | end | 18 | end |
| 19 | 19 | ||
| 20 | 20 |