diff options
Diffstat (limited to 'template/en/default/bug/comments.html.tmpl')
-rw-r--r-- | template/en/default/bug/comments.html.tmpl | 56 |
1 files changed, 7 insertions, 49 deletions
diff --git a/template/en/default/bug/comments.html.tmpl b/template/en/default/bug/comments.html.tmpl index 3895691d7..d040e651d 100644 --- a/template/en/default/bug/comments.html.tmpl +++ b/template/en/default/bug/comments.html.tmpl @@ -14,16 +14,13 @@ <script type="text/javascript"> <!-- /* Adds the reply text to the 'comment' textarea */ - function replyToComment(id, real_id, name, text) { + function replyToComment(id, real_id, name) { var prefix = "(In reply to " + name + " from comment #" + id + ")\n"; var replytext = ""; [% IF user.settings.quote_replies.value == 'quoted_reply' %] /* pre id="comment_name_N" */ - - if (text == null) { - var text_elem = document.getElementById('comment_text_'+id); - text = getText(text_elem); - } + var text_elem = document.getElementById('comment_text_'+id); + var text = getText(text_elem); replytext = prefix + wrapReplyText(text); [% ELSIF user.settings.quote_replies.value == 'simple_reply' %] replytext = prefix; @@ -44,39 +41,6 @@ textarea.focus(); } - - function replyToMarkdownComment(id, real_id, name) { - var textarea = document.getElementById('comment'); - var comment = textarea.value; - textarea.value += "Fetching comment..."; - YAHOO.util.Connect.setDefaultPostHeader('application/json', true); - YAHOO.util.Connect.asyncRequest('POST', 'jsonrpc.cgi', - { - success: function(res) { - var data = YAHOO.lang.JSON.parse(res.responseText); - if (!data.error) { - textarea.value = comment; - var text = data.result.comments[real_id].text; - replyToComment(id, real_id, name, text); - } else { - replyToComment(id, real_id, name, null); - } - }, - failure: function(res) { - /* On failure, quote the comment as plain-text */ - replyToComment(id, real_id, name, null); - } - }, - YAHOO.lang.JSON.stringify({ - version: "1.1", - method: "Bug.comments", - params: { - Bugzilla_api_token: BUGZILLA.api_token, - comment_ids: [real_id], - } - }) - ); - } //--> </script> @@ -162,13 +126,7 @@ [% END %] [<a class="bz_reply_link" href="#add_comment" [% IF user.settings.quote_replies.value != 'off' %] - onclick=" - [% IF feature_enabled('jsonrpc') && comment.is_markdown %] - replyToMarkdownComment('[% comment.count %]', '[% comment.id %]', '[% comment.author.name || comment.author.nick FILTER html FILTER js %]'); return false;" - [% ELSE %] - replyToComment('[% comment.count %]', '[% comment.id %]', '[% comment.author.name || comment.author.nick FILTER html FILTER js %]', null); return false;" - - [% END %] + onclick="replyToComment('[% comment.count %]', '[% comment.id %]', '[% comment.author.name || comment.author.nick FILTER html FILTER js %]'); return false;" [% END %] >reply</a>] [% END %] @@ -267,12 +225,12 @@ [%# Don't indent the <pre> block, since then the spaces are displayed in the # generated HTML #%] -<[% user.use_markdown(comment) ? "div" : "pre" %] class="bz_comment_text[% " collapsed" IF comment.collapsed %]" +<pre class="bz_comment_text[% " collapsed" IF comment.collapsed %]" [% IF mode == "edit" || comment.collapsed %] id="comment_text_[% comment.count FILTER none %]" [% END %]> - [%- comment_text FILTER markdown(bug, comment) -%] -</[% user.use_markdown(comment) ? "div" : "pre" %]> + [%- comment_text FILTER quoteUrls(bug, comment) -%] +</pre> [% Hook.process('a_comment-end', 'bug/comments.html.tmpl') %] </div> [% END %] |