Closed Bug 460799 Opened 16 years ago Closed 14 years ago

Move JS code out of bug/comments.html.tmpl

Categories

(Bugzilla :: Creating/Changing Bugs, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 4.0

People

(Reporter: LpSolit, Assigned: ewong)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 1 obsolete file)

The JS code in comments.html.tmpl doesn't depend on the data passed to it, so we can move it out of the template. It should go somewhere in js/.
Whiteboard: [Good Intro Bug]
Assignee: create-and-change → ewong
Status: NEW → ASSIGNED
Attached patch Moved js code to js/comments.js. (obsolete) — Splinter Review
Attachment #444074 - Flags: review?(LpSolit)
Comment on attachment 444074 [details] [diff] [review]
Moved js code to js/comments.js.

>=== added file 'js/comments.js'

>+ * Contributor(s): Gervase Markham <gerv@gerv.net>
>+  #                Max Kanat-Alexander <mkanat@bugzilla.org>
>+  #                Shane H. W. Travis <travis@sedsystems.ca>
>+  #                Edmund Wong <ewong@pw-wspx.org>
>+ */

Each line of the contributor list must start with *, not with #, in JS files.


>+function toggle_all_comments(action) {
>+    var num_comments = [% comments.size FILTER html %];

[% ... %] is TT code, not JS code. You have to pass this argument to toggle_all_comments() when calling it from the template.


Otherwise looks good.
Attachment #444074 - Flags: review?(LpSolit) → review-
Whiteboard: [Good Intro Bug]
Comment on attachment 444074 [details] [diff] [review]
Moved js code to js/comments.js.

>=== added file 'js/comments.js'

>+ * Contributor(s): Gervase Markham <gerv@gerv.net>
>+  #                Max Kanat-Alexander <mkanat@bugzilla.org>
>+  #                Shane H. W. Travis <travis@sedsystems.ca>
>+  #                Edmund Wong <ewong@pw-wspx.org>

Oh, and while you are on it, please remove Shane and Gervase names from the list of contributors for the JS script, as they didn't alter the JS part of the template at all, and add mine instead, as I forgot to do it when committing bug 262275. Thanks!
Attachment #444074 - Attachment is obsolete: true
Attachment #445707 - Flags: review?(LpSolit)
Comment on attachment 445707 [details] [diff] [review]
Moved js code to js/comments.js. (v2)

Works fine, thanks! r=LpSolit
Attachment #445707 - Flags: review?(LpSolit) → review+
Flags: approval+
Target Milestone: --- → Bugzilla 3.8
Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/trunk/
added js/comments.js
modified template/en/default/bug/comments.html.tmpl
Committed revision 7176.
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: