html, js, css inline processing in embedded controller
This commit is contained in:
parent
d3c0db11de
commit
259e23f747
|
@ -0,0 +1,7 @@
|
||||||
|
Fork of Embedded plugin (http://www.redmine.org/wiki/redmine/PluginEmbedded).
|
||||||
|
Correct style and search for all Doxygen versions.
|
||||||
|
Setup:
|
||||||
|
Index files: index.html
|
||||||
|
Valid extensions: html png gif js css
|
||||||
|
Default template: doxygen.
|
||||||
|
Menu caption: Doxygen
|
|
@ -47,6 +47,15 @@ class RedmineEmbeddedController < ApplicationController
|
||||||
|
|
||||||
if Redmine::MimeType.is_type?('image', path)
|
if Redmine::MimeType.is_type?('image', path)
|
||||||
send_file path, :disposition => 'inline', :type => Redmine::MimeType.of(path)
|
send_file path, :disposition => 'inline', :type => Redmine::MimeType.of(path)
|
||||||
|
elsif path.match('/search/.*\.html$')
|
||||||
|
raw=File.read(path)
|
||||||
|
send_data raw, :disposition => 'inline', :type => "text/html", :streaming => "true"
|
||||||
|
elsif path.match('\.css$')
|
||||||
|
raw=File.read(path)
|
||||||
|
send_data raw, :disposition => 'inline', :type => "text/css", :streaming => "true"
|
||||||
|
elsif path.match('\.js$')
|
||||||
|
raw=File.read(path)
|
||||||
|
send_data raw, :disposition => 'inline', :type => "text/javascript", :streaming => "true"
|
||||||
else
|
else
|
||||||
embed_file path
|
embed_file path
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue