lib/patricia/app.rb in patricia-0.1.2 vs lib/patricia/app.rb in patricia-0.1.3
- old
+ new
@@ -37,10 +37,14 @@
set :app_css_path, '/patricia.css'
set :app_js_path, '/patricia.js'
set :app_public_folder, app_configs[:public_folder]
set :app_tooltips, app_configs[:tooltips]
set :app_editor, app_configs[:editor]
+ set :app_ace, app_configs[:ace]
+ set :app_ace_theme, app_configs[:ace_theme]
+ set :app_ace_keybinding, app_configs[:ace_keybinding]
+ set :app_ace_mode, app_configs[:ace_keybinding]
set :app_gfm, app_configs[:gfm]
# CSS
if app_configs[:css_dir] != nil
set :app_css_dir, app_configs[:css_dir]
css_paths = Dir[app_configs[:css_dir] + '/**/*.css']
@@ -252,10 +256,13 @@
'/assets/javascripts/jquery-1.11.0.min.js',
'/assets/javascripts/bootstrap.min.js',
'/assets/javascripts/app.js',
]
files << '/assets/javascripts/tooltips.js' if settings.app_tooltips
+ files << '/assets/javascripts/src-min-noconflict/ace.js' if
+ settings.app_ace
+ files << '/assets/javascripts/ace_editor.js' if settings.app_ace
files << '/assets/javascripts/editor.js' if settings.app_editor
files.each do |path|
js << File.read(pwd + path) + "\n\n"
end
content_type 'text/javascript'
@@ -293,9 +300,14 @@
end
@stylesheets = settings.app_css
@javascripts = settings.app_js
@page_title = capitalize_all(File.basename(path).gsub(/-/, ' '))
.split.join(' ')
+ @ace = settings.app_ace
+ @ace_theme = settings.app_ace_theme if settings.app_ace_theme
+ @ace_keybinding = settings.app_ace_keybinding if
+ settings.app_ace_keybinding
+ @ace_mode = settings.app_ace_mode if settings.app_ace_mode
haml 'wiki/page'.to_sym, :layout => :application
rescue
file_path = File.join(settings.app_markup_dir, path)
if File.exists?(file_path)
ext = File.extname(path).gsub(/\./, '')