html, js, css inline processing in embedded controller

This commit is contained in:
Kolan Sh 2012-04-04 13:27:30 +04:00 committed by Kolan Sh
parent d3c0db11de
commit 259e23f747
2 changed files with 16 additions and 0 deletions

7
README Normal file
View File

@ -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

View File

@ -47,6 +47,15 @@ class RedmineEmbeddedController < ApplicationController
if Redmine::MimeType.is_type?('image', 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
embed_file path
end