Project

General

Profile

Patch #31302 » customizable-wiki-assets-fix.patch

Masato NODA, 2019-05-05 18:38

View differences:

lib/redmine/wiki_formatting/markdown/helper.rb
34 34
        def heads_for_wiki_formatter
35 35
          unless @heads_for_wiki_formatter_included
36 36
            content_for :header_tags do
37
              javascript_include_tag('jstoolbar/jstoolbar') +
38
              javascript_include_tag('jstoolbar/markdown') +
39
              javascript_include_tag("jstoolbar/lang/jstoolbar-#{current_language.to_s.downcase}") +
40
              javascript_tag("var wikiImageMimeTypes = #{Redmine::MimeType.by_type('image').to_json};") +
41
              stylesheet_link_tag('jstoolbar')
37
              asset_renderings_for_wiki_formatter.values.map(&:call).join.html_safe
42 38
            end
43 39
            @heads_for_wiki_formatter_included = true
44 40
          end
45 41
        end
42

  
43
        def asset_renderings_for_wiki_formatter
44
          {
45
            script_jstoolbar: Proc.new { javascript_include_tag('jstoolbar/jstoolbar') },
46
            script_format_adapter: Proc.new { javascript_include_tag('jstoolbar/markdown') },
47
            script_jstoolbar_lang: Proc.new { javascript_include_tag("jstoolbar/lang/jstoolbar-#{current_language.to_s.downcase}") },
48
            script_wiki_mime_types: Proc.new { javascript_tag("var wikiImageMimeTypes = #{Redmine::MimeType.by_type('image').to_json};") },
49
            style_jstoolbar: Proc.new { stylesheet_link_tag('jstoolbar') }
50
          }
51
        end
46 52
      end
47 53
    end
48 54
  end
lib/redmine/wiki_formatting/textile/helper.rb
35 35
        def heads_for_wiki_formatter
36 36
          unless @heads_for_wiki_formatter_included
37 37
            content_for :header_tags do
38
              javascript_include_tag('jstoolbar/jstoolbar') +
39
              javascript_include_tag('jstoolbar/textile') +
40
              javascript_include_tag("jstoolbar/lang/jstoolbar-#{current_language.to_s.downcase}") +
41
              javascript_tag("var wikiImageMimeTypes = #{Redmine::MimeType.by_type('image').to_json};") +
42
              stylesheet_link_tag('jstoolbar')
38
              asset_renderings_for_wiki_formatter.values.map(&:call).join.html_safe
43 39
            end
44 40
            @heads_for_wiki_formatter_included = true
45 41
          end
46 42
        end
43

  
44
        def asset_renderings_for_wiki_formatter
45
          {
46
            script_jstoolbar: Proc.new { javascript_include_tag('jstoolbar/jstoolbar') },
47
            script_format_adapter: Proc.new { javascript_include_tag('jstoolbar/textile') },
48
            script_jstoolbar_lang: Proc.new { javascript_include_tag("jstoolbar/lang/jstoolbar-#{current_language.to_s.downcase}") },
49
            script_wiki_mime_types: Proc.new { javascript_tag("var wikiImageMimeTypes = #{Redmine::MimeType.by_type('image').to_json};") },
50
            style_jstoolbar: Proc.new { stylesheet_link_tag('jstoolbar') }
51
          }
52
        end
47 53
      end
48 54
    end
49 55
  end
(2-2/2)