c1f94d2deb
* Replace editor's content editor with Ace Editor * Bundle ace 1.2.5 * Give the ace editor body a name * Changeing edit mode now changes Ace's editor mode * Move Ace interface into gollum.editor.js and implement drag and drop uploading * Make editor bottons work (mostly) * Fix edit mode mapping * Fix mode selection for empty editor * Make the ace editor vertically resizable * Add org-mode and reStructuredText mode mapping * Add missing jquery.resize.js * Change keybinding from vim to emacs * Makes ace resizable on Chrom * Fix accidental change of resize * Add keyboard selector and fix commit message updating * Add visual aid in editor to signal unavailable formats * Hide line number by default
15 lines
382 B
Ruby
15 lines
382 B
Ruby
module Precious
|
|
module Editable
|
|
def formats(selected = @page.format)
|
|
Gollum::Markup.formats.map do |key, val|
|
|
{ :name => val[:name],
|
|
:id => key.to_s,
|
|
:enabled => val.fetch(:enabled, true),
|
|
:selected => selected == key }
|
|
end.sort do |a, b|
|
|
a[:name].downcase <=> b[:name].downcase
|
|
end
|
|
end
|
|
end
|
|
end
|