Closed
Bug 1059723
Opened 11 years ago
Closed 11 years ago
Reply button should become AJAX-based
Categories
(Bugzilla :: User Interface, enhancement)
Tracking
()
RESOLVED
FIXED
Bugzilla 6.0
People
(Reporter: koosha.khajeh, Assigned: koosha.khajeh)
References
Details
Attachments
(1 file, 3 obsolete files)
|
6.49 KB,
patch
|
dkl
:
review+
|
Details | Diff | Splinter Review |
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.
| Comment hidden (obsolete) |
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
Comment 3•11 years ago
|
||
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.
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)
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)
Updated•11 years ago
|
Attachment #8485626 -
Flags: review?(sgreen) → review?(glob)
Updated•11 years ago
|
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~^(>.+)$~<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.
Attachment #8485626 -
Attachment is obsolete: true
Attachment #8495119 -
Flags: review?(glob)
Comment 10•11 years ago
|
||
Comment on attachment 8495119 [details] [diff] [review]
patch-v3
Will review this tomorrow.
Attachment #8495119 -
Flags: review?(glob) → review?(dkl)
Comment 11•11 years ago
|
||
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+
Updated•11 years ago
|
Flags: approval?
Comment 12•11 years ago
|
||
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+
| Assignee | ||
Comment 13•11 years ago
|
||
(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.
| Assignee | ||
Comment 14•11 years ago
|
||
New patch with the requested changes.
Attachment #8504707 -
Flags: review?(dkl)
Attachment #8495119 -
Attachment is obsolete: true
Comment 15•11 years ago
|
||
Comment on attachment 8504707 [details] [diff] [review]
patch-v4
r=dkl
Attachment #8504707 -
Flags: review?(dkl) → review+
Comment 16•11 years ago
|
||
To ssh://gitolite3@git.mozilla.org/bugzilla/bugzilla.git
847191a..42d5e45 master -> master
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•