Closed
Bug 1093924
Opened 11 years ago
Closed 11 years ago
Move replyToMarkdownComment() and replyToComment() out of templates
Categories
(Bugzilla :: Bugzilla-General, enhancement)
Tracking
()
RESOLVED
FIXED
Bugzilla 6.0
People
(Reporter: LpSolit, Assigned: dkl)
References
(Blocks 1 open bug)
Details
Attachments
(1 file, 1 obsolete file)
|
7.84 KB,
patch
|
LpSolit
:
review+
|
Details | Diff | Splinter Review |
The replyToMarkdownComment() JS function is not context dependent and so doesn't need to be in bug/comments.html.tmpl. It should be moved into js/comments.js.
| Assignee | ||
Comment 1•11 years ago
|
||
Also moved replyToComment to js/comments.js as well.
dkl
| Reporter | ||
Comment 2•11 years ago
|
||
Comment on attachment 8517585 [details] [diff] [review]
1093924_1.patch
>diff --git a/js/comments.js b/js/comments.js
>+function replyToComment(id, real_id, name, text) {
>+ var prefix = "(In reply to " + name + " from comment #" + id + ")\n";
This string is no longer localizable. It should still be defined in the template and then passed to this JS function.
>+ if (replyCommentConfig.is_insider) {
Below, you set: is_insider : [% user.is_insider ? "true" : "false" %]. Are you sure JS correctly understands "true" and "false" as booleans instead of strings? I didn't test your patch yet.
>+function replyToMarkdownComment(id, real_id, name) {
>+ textarea.value += "Fetching comment...";
Same problem here. The string is no longer localizable.
>+++ b/template/en/default/bug/comments.html.tmpl
>+ var replyCommentConfig = {
>+ quote_replies : "[% user.settings.quote_replies.value FILTER js %]",
>+ is_insider : [% user.is_insider ? "true" : "false" %]
>+ };
Wouldn't it be better to pass 1 or 0 instead of true/false?
Attachment #8517585 -
Flags: review?(LpSolit) → review-
| Assignee | ||
Comment 3•11 years ago
|
||
Attachment #8517585 -
Attachment is obsolete: true
Attachment #8523942 -
Flags: review?(LpSolit)
| Reporter | ||
Comment 4•11 years ago
|
||
Comment on attachment 8523942 [details] [diff] [review]
1093924_2.patch
>+++ b/js/comments.js
>+function replyToComment(id, real_id, replyto_header, text) {
>+ } else if (replyCommentConfig.quote_replies == 'simple_reply') {
>+ replytext = prefix;
>+ }
s/prefix/replyto_header/
>+function replyToMarkdownComment(id, real_id, replyto_header, name) {
The 4th argument 'name' is unused. Please remove it.
r=LpSolit with these fixes on checkin.
Attachment #8523942 -
Flags: review?(LpSolit) → review+
| Reporter | ||
Updated•11 years ago
|
Severity: normal → enhancement
Flags: approval?
Summary: Move replyToMarkdownComment() out of templates → Move replyToMarkdownComment() and replyToComment() out of templates
Target Milestone: --- → Bugzilla 6.0
| Assignee | ||
Comment 5•11 years ago
|
||
To ssh://gitolite3@git.mozilla.org/bugzilla/bugzilla.git
0bc389f..be26c11 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
•