diff options
Diffstat (limited to 'app/controllers/messages_controller.rb')
-rw-r--r-- | app/controllers/messages_controller.rb | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb index cc53c0d78..6b154a81c 100644 --- a/app/controllers/messages_controller.rb +++ b/app/controllers/messages_controller.rb @@ -105,20 +105,11 @@ class MessagesController < ApplicationController end def quote - user = @message.author - text = @message.content - subject = @message.subject.gsub('"', '\"') - subject = "RE: #{subject}" unless subject.starts_with?('RE:') - content = "#{ll(Setting.default_language, :text_user_wrote, user)}\\n> " - content << text.to_s.strip.gsub(%r{<pre>((.|\s)*?)</pre>}m, '[...]').gsub('"', '\"').gsub(/(\r?\n|\r\n?)/, "\\n> ") + "\\n\\n" - render(:update) { |page| - page << "$('message_subject').value = \"#{subject}\";" - page.<< "$('message_content').value = \"#{content}\";" - page.show 'reply' - page << "Form.Element.focus('message_content');" - page << "Element.scrollTo('reply');" - page << "$('message_content').scrollTop = $('message_content').scrollHeight - $('message_content').clientHeight;" - } + @subject = @message.subject + @subject = "RE: #{@subject}" unless @subject.starts_with?('RE:') + + @content = "#{ll(Setting.default_language, :text_user_wrote, @message.author)}\n> " + @content << @message.content.to_s.strip.gsub(%r{<pre>((.|\s)*?)</pre>}m, '[...]').gsub(/(\r?\n|\r\n?)/, "\n> ") + "\n\n" end def preview |