finishing up drag-n-drop code, use param for filename with site_file/text_editor

This commit is contained in:
Kyle Drake 2024-03-08 11:53:51 -06:00
parent 943271b509
commit f6af2cbbcf
7 changed files with 196 additions and 399 deletions

View file

@ -177,7 +177,16 @@ get %r{\/site_files\/text_editor\/(.+)} do
dont_browser_cache
@filename = params[:captures].first
redirect '/site_files/text_editor?filename=' + Rack::Utils.escape(@filename)
end
get '/site_files/text_editor' do
require_login
dont_browser_cache
@filename = params[:filename]
extname = File.extname @filename
@ace_mode = case extname
when /htm|html/ then 'html'
when /js/ then 'javascript'
@ -217,4 +226,4 @@ end
get '/site_files/mount_info' do
@title = 'Site Mount Information'
erb :'site_files/mount_info'
end
end