| 
									
										
										
										
											2008-10-27 11:08:29 +00:00
										 |  |  | # Redmine - project management software | 
					
						
							| 
									
										
										
										
											2013-01-12 09:29:31 +00:00
										 |  |  | # Copyright (C) 2006-2013  Jean-Philippe Lang | 
					
						
							| 
									
										
										
										
											2008-10-27 11:08:29 +00: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 02:03:23 +00:00
										 |  |  | # | 
					
						
							| 
									
										
										
										
											2008-10-27 11:08:29 +00: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 02:03:23 +00:00
										 |  |  | # | 
					
						
							| 
									
										
										
										
											2008-10-27 11:08:29 +00: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 19:59:35 +00:00
										 |  |  |           heads_for_wiki_formatter | 
					
						
							| 
									
										
										
										
											2009-01-04 12:50:45 +00:00
										 |  |  |           # Is there a simple way to link to a public resource? | 
					
						
							| 
									
										
										
										
											2013-08-08 03:46:39 +00:00
										 |  |  |           url = "#{Redmine::Utils.relative_url_root}/help/en/wiki_syntax.html" | 
					
						
							| 
									
										
										
										
											2013-01-02 07:47:12 +00:00
										 |  |  |           javascript_tag("var wikiToolbar = new jsToolBar(document.getElementById('#{field_id}')); wikiToolbar.setHelpLink('#{escape_javascript url}'); wikiToolbar.draw();") | 
					
						
							| 
									
										
										
										
											2008-10-27 11:08:29 +00:00
										 |  |  |         end | 
					
						
							| 
									
										
										
										
											2011-09-01 02:03:23 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-10-27 11:08:29 +00:00
										 |  |  |         def initial_page_content(page) | 
					
						
							|  |  |  |           "h1. #{@page.pretty_title}" | 
					
						
							|  |  |  |         end | 
					
						
							| 
									
										
										
										
											2011-09-01 02:03:23 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-10-27 11:08:29 +00:00
										 |  |  |         def heads_for_wiki_formatter | 
					
						
							| 
									
										
										
										
											2011-03-28 19:59:35 +00:00
										 |  |  |           unless @heads_for_wiki_formatter_included | 
					
						
							|  |  |  |             content_for :header_tags do | 
					
						
							| 
									
										
										
										
											2012-07-28 15:58:54 +00:00
										 |  |  |               javascript_include_tag('jstoolbar/jstoolbar-textile.min') + | 
					
						
							| 
									
										
										
										
											2011-03-28 19:59:35 +00: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 11:08:29 +00:00
										 |  |  |         end | 
					
						
							|  |  |  |       end | 
					
						
							|  |  |  |     end | 
					
						
							|  |  |  |   end | 
					
						
							|  |  |  | end |