Removes RJS from JournalsController.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10054 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -67,16 +67,8 @@ class JournalsController < ApplicationController
|
||||
end
|
||||
# Replaces pre blocks with [...]
|
||||
text = text.to_s.strip.gsub(%r{<pre>((.|\s)*?)</pre>}m, '[...]')
|
||||
content = "#{ll(Setting.default_language, :text_user_wrote, user)}\n> "
|
||||
content << text.gsub(/(\r?\n|\r\n?)/, "\n> ") + "\n\n"
|
||||
|
||||
render(:update) { |page|
|
||||
page.<< "$('notes').value = \"#{escape_javascript content}\";"
|
||||
page.show 'update'
|
||||
page << "Form.Element.focus('notes');"
|
||||
page << "Element.scrollTo('update');"
|
||||
page << "$('notes').scrollTop = $('notes').scrollHeight - $('notes').clientHeight;"
|
||||
}
|
||||
@content = "#{ll(Setting.default_language, :text_user_wrote, user)}\n> "
|
||||
@content << text.gsub(/(\r?\n|\r\n?)/, "\n> ") + "\n\n"
|
||||
end
|
||||
|
||||
def edit
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
Element.hide("journal-<%= @journal.id %>-notes");
|
||||
Element.insert("journal-<%= @journal.id %>-notes", {'after': '<%= escape_javascript(render :partial => 'notes_form') %>'});
|
||||
@@ -1,3 +0,0 @@
|
||||
page.hide "journal-#{@journal.id}-notes"
|
||||
page.insert_html :after, "journal-#{@journal.id}-notes",
|
||||
:partial => 'notes_form'
|
||||
@@ -0,0 +1,5 @@
|
||||
$('notes').value = "<%= raw escape_javascript(@content) %>";
|
||||
Element.show('update');
|
||||
Form.Element.focus('notes');
|
||||
Element.scrollTo('update');
|
||||
$('notes').scrollTop = $('notes').scrollHeight - $('notes').clientHeight;
|
||||
@@ -0,0 +1,9 @@
|
||||
<% if @journal.frozen? %>
|
||||
Element.remove("change-<%= @journal.id %>");
|
||||
<% else %>
|
||||
Element.replace("journal-<%= @journal.id %>-notes", '<%= escape_javascript(render_notes(@journal.issue, @journal, :reply_links => authorize_for('issues', 'edit'))) %>');
|
||||
Element.show("journal-<%= @journal.id %>-notes");
|
||||
Element.remove("journal-<%= @journal.id %>-form");
|
||||
<% end %>
|
||||
|
||||
<%= call_hook(:view_journals_update_js_bottom, { :journal => @journal }) %>
|
||||
@@ -1,10 +0,0 @@
|
||||
if @journal.frozen?
|
||||
# journal was destroyed
|
||||
page.remove "change-#{@journal.id}"
|
||||
else
|
||||
page.replace "journal-#{@journal.id}-notes", render_notes(@journal.issue, @journal, :reply_links => authorize_for('issues', 'edit'))
|
||||
page.show "journal-#{@journal.id}-notes"
|
||||
page.remove "journal-#{@journal.id}-form"
|
||||
end
|
||||
|
||||
call_hook(:view_journals_update_rjs_bottom, { :page => page, :journal => @journal })
|
||||
Reference in New Issue
Block a user