diff options
Diffstat (limited to 'app/assets/javascripts/lib/ace/ace_config_paths.js.erb')
-rw-r--r-- | app/assets/javascripts/lib/ace/ace_config_paths.js.erb | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/app/assets/javascripts/lib/ace/ace_config_paths.js.erb b/app/assets/javascripts/lib/ace/ace_config_paths.js.erb deleted file mode 100644 index 976769ba84a..00000000000 --- a/app/assets/javascripts/lib/ace/ace_config_paths.js.erb +++ /dev/null @@ -1,34 +0,0 @@ -<% -ace_gem_path = Bundler.rubygems.find_name('ace-rails-ap').first.full_gem_path -ace_workers = Dir[ace_gem_path + '/vendor/assets/javascripts/ace/worker-*.js'].sort.map do |file| - File.basename(file, '.js').sub(/^worker-/, '') -end -ace_modes = Dir[ace_gem_path + '/vendor/assets/javascripts/ace/mode-*.js'].sort.map do |file| - File.basename(file, '.js').sub(/^mode-/, '') -end -%> -// Lazy-load configuration when ace.edit is called -(function() { - var basePath; - var ace = window.ace; - var edit = ace.edit; - ace.edit = function() { - window.gon = window.gon || {}; - basePath = (window.gon.relative_url_root || '').replace(/\/$/, '') + '/assets/ace'; - ace.config.set('basePath', basePath); - - // configure paths for all worker modules -<% ace_workers.each do |worker| %> - ace.config.setModuleUrl('ace/mode/<%= worker %>_worker', basePath + '/<%= File.basename(asset_path("ace/worker-#{worker}.js")) %>'); -<% end %> - - // configure paths for all mode modules -<% ace_modes.each do |mode| %> - ace.config.setModuleUrl('ace/mode/<%= mode %>', basePath + '/<%= File.basename(asset_path("ace/mode-#{mode}.js")) %>'); -<% end %> - - // restore original method - ace.edit = edit; - return ace.edit.apply(ace, arguments); - }; -})(); |