module Precious::Editable

Public Instance Methods

default_keybinding() click to toggle source
# File lib/gollum/views/editable.rb, line 7
def default_keybinding
  @default_keybinding
end
formats(selected = @page.format) click to toggle source
# File lib/gollum/views/editable.rb, line 19
def formats(selected = @page.format)
  Gollum::Markup.formats.map do |key, val|
    { :name     => val[:name],
      :id       => key.to_s,
      :enabled  => val.fetch(:enabled, true),
      :ext      => Gollum::Page.format_to_ext(key),
      :selected => selected == key }
  end.sort do |a, b|
    a[:name].downcase <=> b[:name].downcase
  end
end
has_editor() click to toggle source
# File lib/gollum/views/editable.rb, line 3
def has_editor
  true
end
keybindings() click to toggle source
# File lib/gollum/views/editable.rb, line 11
def keybindings
  Gollum::KEYBINDINGS.map do |kb|
    { :name => kb,
      :selected => default_keybinding == kb
    }
  end
end