Closed Bug 1059723 Opened 11 years ago Closed 11 years ago

Reply button should become AJAX-based

Categories

(Bugzilla :: User Interface, enhancement)

4.5.5
enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 6.0

People

(Reporter: koosha.khajeh, Assigned: koosha.khajeh)

References

Details

Attachments

(1 file, 3 obsolete files)

After markdown integration, the reply button on the comment box should become AJAX-based because the current one would destroy the HTML content of a comment if the comment has markdown structures. So, the reply button should load the raw markdown-based comment from DB via an AJAX call if the comment is markdown-based. The behavior of the button could be left intact for non-markdown comments.
oh, wait, i totally miss-read this bug; sorry about that koosha (drinks more morning coffee). this should block 5.0.
Whiteboard: dupeme → [roadmap: 5.0]
Target Milestone: --- → Bugzilla 5.0
To be clear in case anyone else had the same confusion glob and I initially did, this is for loading the existing comment to be quoted and placed into the comment edit box for the new comment, not for submitting the new comment.
Attached patch patch-v1.0 (obsolete) — Splinter Review
Assignee: ui → koosha.khajeh
Status: NEW → ASSIGNED
Attachment #8484921 - Flags: review?(glob)
Comment on attachment 8484921 [details] [diff] [review] patch-v1.0 as per irc, reassigning the review to sgreen. from a quick look at the code.. > sub _DoBlockQuotes it would probably be better to pass in an option to the code which adds the quote spans to skip them, instead of adding them and then removing them later.
Attachment #8484921 - Flags: review?(glob) → review?(sgreen)
Attached patch patch-v2.0 (obsolete) — Splinter Review
I added the code to skip the quote coloring in quoteUrls().
Attachment #8484921 - Attachment is obsolete: true
Attachment #8484921 - Flags: review?(sgreen)
Attachment #8485626 - Flags: review?(sgreen)
Attachment #8485626 - Flags: review?(sgreen) → review?(glob)
Whiteboard: [roadmap: 5.0]
Comment on attachment 8485626 [details] [diff] [review] patch-v2.0 Review of attachment 8485626 [details] [diff] [review]: ----------------------------------------------------------------- ::: Bugzilla/Markdown.pm @@ +414,5 @@ > + # These leading spaces screw with <pre> content, so we need to fix that: > + $bq =~ s{(\s*<pre>.+?</pre>)}{ > + my $pre = $1; > + $pre =~ s/^ //mg; > + $pre; we're switch from <pre> tags in bug 1059684, so this will need to be updated. ::: Bugzilla/Template.pm @@ +225,5 @@ > + unless (scalar caller eq 'Bugzilla::Markdown') { > + # Color quoted text > + $text =~ s~^(&gt;.+)$~<span class="quote">$1</span >~mg; > + $text =~ s~</span >\n<span class="quote">~\n~g; > + } using the call stack to control behaviour isn't the best approach here - it's prone to breaking, and means this behaviour can't be used by other code. add an optional parameter to quoteUrls() instead. ::: skins/standard/global.css @@ +250,5 @@ > + padding: 0; > + margin-left: 0.5em; > + margin-bottom: -1em; > + white-space: pre; > + } the white-space:pre will also need to be updated to accommodate changes in bug 1059684.
Attachment #8485626 - Flags: review?(glob) → review-
(In reply to Byron Jones ‹:glob› from comment #7) > Comment on attachment 8485626 [details] [diff] [review] > patch-v2.0 > > Review of attachment 8485626 [details] [diff] [review]: > ----------------------------------------------------------------- > > ::: Bugzilla/Markdown.pm > @@ +414,5 @@ > > + # These leading spaces screw with <pre> content, so we need to fix that: > > + $bq =~ s{(\s*<pre>.+?</pre>)}{ > > + my $pre = $1; > > + $pre =~ s/^ //mg; > > + $pre; > > we're switch from <pre> tags in bug 1059684, so this will need to be updated. The code comes from the original implementation and I don't think that it has anything to do with the way Bugzilla shows comments. Code blocks do have <pre> and this piece of code deals with them.
Attached patch patch-v3 (obsolete) — Splinter Review
Attachment #8485626 - Attachment is obsolete: true
Attachment #8495119 - Flags: review?(glob)
Comment on attachment 8495119 [details] [diff] [review] patch-v3 Will review this tomorrow.
Attachment #8495119 - Flags: review?(glob) → review?(dkl)
Comment on attachment 8495119 [details] [diff] [review] patch-v3 Review of attachment 8495119 [details] [diff] [review]: ----------------------------------------------------------------- These can be fixed on commit. r=dkl ::: skins/standard/global.css @@ +249,5 @@ > + color: #65379C; > + padding: 0; > + margin-left: 0.5em; > + margin-bottom: -1em; > + white-space: pre; Remove the white-space line and add: padding-left: 0.5em; ::: template/en/default/bug/comments.html.tmpl @@ +14,4 @@ > <script type="text/javascript"> > <!-- > /* Adds the reply text to the 'comment' textarea */ > + function replyToComment(id, real_id, name, comment_text) { s/comment_text/text/ @@ +25,5 @@ > + var text_elem = document.getElementById('comment_text_'+id); > + text = getText(text_elem); > + } else { > + text = comment_text; > + } Simplify: if (text == null) { var text_elem = document.getElementById('comment_text_'+id); text = getText(text_elem); }
Attachment #8495119 - Flags: review?(dkl) → review+
Flags: approval?
Given the number of changes required "on commit", I would prefer to see a new patch being reviewed before it is committed.
Flags: approval? → approval+
(In reply to David Lawrence [:dkl] from comment #11) > ::: skins/standard/global.css > @@ +249,5 @@ > > + color: #65379C; > > + padding: 0; > > + margin-left: 0.5em; > > + margin-bottom: -1em; > > + white-space: pre; > > Remove the white-space line and add: > > padding-left: 0.5em; > The white-space line is crucial to making lines wrap correctly. Try nested quoted lines with and without it, you will see the difference.
Attached patch patch-v4Splinter Review
New patch with the requested changes.
Attachment #8504707 - Flags: review?(dkl)
Attachment #8495119 - Attachment is obsolete: true
Comment on attachment 8504707 [details] [diff] [review] patch-v4 r=dkl
Attachment #8504707 - Flags: review?(dkl) → review+
To ssh://gitolite3@git.mozilla.org/bugzilla/bugzilla.git 847191a..42d5e45 master -> master
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: Bugzilla 5.0 → Bugzilla 6.0
Blocks: 1093924
Blocks: 1114411
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: