Extract the NullFormatter into its own files

This commit is contained in:
Holger Just 2011-10-16 20:02:55 +02:00
parent a8e997dbf6
commit 8ee8ef02fe
3 changed files with 62 additions and 29 deletions

View File

@ -94,34 +94,5 @@ module Redmine
end
end
end
# Default formatter module
module NullFormatter
class Formatter
include ActionView::Helpers::TagHelper
include ActionView::Helpers::TextHelper
include ActionView::Helpers::UrlHelper
def initialize(text)
@text = text
end
def to_html(*args)
simple_format(auto_link(CGI::escapeHTML(@text)))
end
end
module Helper
def wikitoolbar_for(field_id)
end
def heads_for_wiki_formatter
end
def initial_page_content(page)
page.pretty_title.to_s
end
end
end
end
end

View File

@ -0,0 +1,32 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2011 the ChiliProject Team
#
# 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.
#
# See doc/COPYRIGHT.rdoc for more details.
#++
module Redmine
module WikiFormatting
module NullFormatter
class Formatter
include ActionView::Helpers::TagHelper
include ActionView::Helpers::TextHelper
include ActionView::Helpers::UrlHelper
def initialize(text)
@text = text
end
def to_html(*args)
simple_format(auto_link(CGI::escapeHTML(@text)))
end
end
end
end
end

View File

@ -0,0 +1,30 @@
#-- copyright
# ChiliProject is a project management system.
#
# Copyright (C) 2010-2011 the ChiliProject Team
#
# 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.
#
# See doc/COPYRIGHT.rdoc for more details.
#++
module Redmine
module WikiFormatting
module NullFormatter
module Helper
def wikitoolbar_for(field_id)
end
def heads_for_wiki_formatter
end
def initial_page_content(page)
page.pretty_title.to_s
end
end
end
end
end