Module: Redmine::WikiFormatting::Textile::Helper

Defined in:
lib/redmine/wiki_formatting/textile/helper.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) heads_for_wiki_formatter



40
41
42
# File 'lib/redmine/wiki_formatting/textile/helper.rb', line 40

def heads_for_wiki_formatter
  stylesheet_link_tag 'jstoolbar'
end

- (Object) initial_page_content(page)



36
37
38
# File 'lib/redmine/wiki_formatting/textile/helper.rb', line 36

def initial_page_content(page)
  "h1. #{@page.pretty_title}"
end

- (Object) wikitoolbar_for(field_id)



22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/redmine/wiki_formatting/textile/helper.rb', line 22

def wikitoolbar_for(field_id)
  # Is there a simple way to link to a public resource?
  url = "#{Redmine::Utils.relative_url_root}/help/wiki_syntax.html"
  
  help_link = l(:setting_text_formatting) + ': ' +
    link_to(l(:label_help), url,
            :onclick => "window.open(\"#{ url }\", \"\", \"resizable=yes, location=no, width=300, height=640, menubar=no, status=no, scrollbars=yes\"); return false;")
      
  javascript_include_tag('jstoolbar/jstoolbar') +
    javascript_include_tag('jstoolbar/textile') +
    javascript_include_tag("jstoolbar/lang/jstoolbar-#{current_language}") +
  javascript_tag("var toolbar = new jsToolBar($('#{field_id}')); toolbar.setHelpLink('#{help_link}'); toolbar.draw();")
end