comparison lib/redmine/wiki_formatting/markdown/helper.rb @ 1517:dffacf8a6908 redmine-2.5

Update to Redmine SVN revision 13367 on 2.5-stable branch
author Chris Cannam
date Tue, 09 Sep 2014 09:29:00 +0100
parents
children
comparison
equal deleted inserted replaced
1516:b450a9d58aed 1517:dffacf8a6908
1 # Redmine - project management software
2 # Copyright (C) 2006-2014 Jean-Philippe Lang
3 #
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
18 module Redmine
19 module WikiFormatting
20 module Markdown
21 module Helper
22 def wikitoolbar_for(field_id)
23 heads_for_wiki_formatter
24 javascript_tag("var wikiToolbar = new jsToolBar(document.getElementById('#{field_id}')); wikiToolbar.draw();")
25 end
26
27 def initial_page_content(page)
28 "# #{@page.pretty_title}"
29 end
30
31 def heads_for_wiki_formatter
32 unless @heads_for_wiki_formatter_included
33 content_for :header_tags do
34 javascript_include_tag('jstoolbar/jstoolbar') +
35 javascript_include_tag('jstoolbar/markdown') +
36 javascript_include_tag("jstoolbar/lang/jstoolbar-#{current_language.to_s.downcase}") +
37 stylesheet_link_tag('jstoolbar')
38 end
39 @heads_for_wiki_formatter_included = true
40 end
41 end
42 end
43 end
44 end
45 end