2008-10-27 14:08:29 +03:00
|
|
|
# Redmine - project management software
|
2013-01-12 13:29:31 +04:00
|
|
|
# Copyright (C) 2006-2013 Jean-Philippe Lang
|
2008-10-27 14:08:29 +03:00
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU General Public License
|
|
|
|
# as published by the Free Software Foundation; either version 2
|
|
|
|
# of the License, or (at your option) any later version.
|
2011-09-01 06:03:23 +04:00
|
|
|
#
|
2008-10-27 14:08:29 +03:00
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
2011-09-01 06:03:23 +04:00
|
|
|
#
|
2008-10-27 14:08:29 +03:00
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software
|
|
|
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
|
|
|
|
module Redmine
|
|
|
|
module WikiFormatting
|
|
|
|
module Textile
|
|
|
|
module Helper
|
|
|
|
def wikitoolbar_for(field_id)
|
2011-03-28 23:59:35 +04:00
|
|
|
heads_for_wiki_formatter
|
2009-01-04 15:50:45 +03:00
|
|
|
# Is there a simple way to link to a public resource?
|
2009-01-04 20:09:25 +03:00
|
|
|
url = "#{Redmine::Utils.relative_url_root}/help/wiki_syntax.html"
|
2013-01-02 11:47:12 +04:00
|
|
|
javascript_tag("var wikiToolbar = new jsToolBar(document.getElementById('#{field_id}')); wikiToolbar.setHelpLink('#{escape_javascript url}'); wikiToolbar.draw();")
|
2008-10-27 14:08:29 +03:00
|
|
|
end
|
2011-09-01 06:03:23 +04:00
|
|
|
|
2008-10-27 14:08:29 +03:00
|
|
|
def initial_page_content(page)
|
|
|
|
"h1. #{@page.pretty_title}"
|
|
|
|
end
|
2011-09-01 06:03:23 +04:00
|
|
|
|
2008-10-27 14:08:29 +03:00
|
|
|
def heads_for_wiki_formatter
|
2011-03-28 23:59:35 +04:00
|
|
|
unless @heads_for_wiki_formatter_included
|
|
|
|
content_for :header_tags do
|
2012-07-28 19:58:54 +04:00
|
|
|
javascript_include_tag('jstoolbar/jstoolbar-textile.min') +
|
2011-03-28 23:59:35 +04:00
|
|
|
javascript_include_tag("jstoolbar/lang/jstoolbar-#{current_language.to_s.downcase}") +
|
|
|
|
stylesheet_link_tag('jstoolbar')
|
|
|
|
end
|
|
|
|
@heads_for_wiki_formatter_included = true
|
|
|
|
end
|
2008-10-27 14:08:29 +03:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|