mirror of
https://github.com/neocities/neocities.git
synced 2025-08-06 01:24:56 +02:00
set mode correctly for ace editor [#93:closed]
This commit is contained in:
parent
fe9b051c87
commit
781e85f908
2 changed files with 18 additions and 5 deletions
|
@ -110,6 +110,17 @@ end
|
|||
get %r{\/site_files\/text_editor\/(.+)} do
|
||||
require_login
|
||||
@filename = params[:captures].first
|
||||
extname = File.extname @filename
|
||||
|
||||
@ace_mode = case extname
|
||||
when /htm|html/ then 'html'
|
||||
when /js/ then 'javascript'
|
||||
when /md/ then 'markdown'
|
||||
when /css/ then 'css'
|
||||
else
|
||||
nil
|
||||
end
|
||||
|
||||
begin
|
||||
@file_data = current_site.get_file @filename
|
||||
rescue Errno::ENOENT
|
||||
|
@ -148,4 +159,4 @@ end
|
|||
|
||||
get '/site_files/mount_info' do
|
||||
erb :'site_files/mount_info'
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue