summaryrefslogtreecommitdiffstats
path: root/lib/redmine/quote_reply.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/redmine/quote_reply.rb')
-rw-r--r--lib/redmine/quote_reply.rb25
1 files changed, 11 insertions, 14 deletions
diff --git a/lib/redmine/quote_reply.rb b/lib/redmine/quote_reply.rb
index 05737c079..f6d7821cd 100644
--- a/lib/redmine/quote_reply.rb
+++ b/lib/redmine/quote_reply.rb
@@ -20,21 +20,18 @@
module Redmine
module QuoteReply
module Helper
- def javascripts_for_quote_reply_include_tag
- javascript_include_tag 'turndown-7.2.0.min', 'quote_reply'
- end
-
- def quote_reply(url, selector_for_content, icon_only: false)
- quote_reply_function = "quoteReply('#{j url}', '#{j selector_for_content}', '#{j Setting.text_formatting}')"
+ def quote_reply_button(url:, icon_only: false)
+ button_params = {
+ data: {
+ action: 'quote-reply#quote',
+ quote_reply_url_param: url,
+ quote_reply_text_formatting_param: Setting.text_formatting
+ },
+ class: "#{icon_only ? "icon-only" : "icon"} icon-quote"
+ }
+ button_params[:title] = l(:button_quote) if icon_only
- html_options = { class: 'icon icon-comment' }
- html_options[:title] = l(:button_quote) if icon_only
-
- link_to_function(
- sprite_icon('comment', l(:button_quote), icon_only: icon_only),
- quote_reply_function,
- html_options
- )
+ link_to sprite_icon('quote-filled', l(:button_quote), icon_only: icon_only, style: :filled), '#', button_params
end
end