Fix "View Diff" buttons on edit attachment page
authorddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 16 Oct 2014 16:01:22 +0000 (16:01 +0000)
committerddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 16 Oct 2014 16:01:22 +0000 (16:01 +0000)
* js/attachment.js:
(viewPrettyPatch): Change code syntax from Perl to JavaScript.
When I moved this method from
template/en/custom/attachment/edit.html.tmpl into
js/attachment.js during the Bugzilla 4.2.1 merge, I wrote some
of the code using Perl syntax.
* template/en/custom/attachment/edit.html.tmpl:
- Fix 120-column truncation of code.  (That's what you get for
  copying and pasting code from 'git diff' in a terminal
  window.)
- Pass attachment_id into the viewPrettyPatch() method since
  the method expects it.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174774 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Websites/bugs.webkit.org/js/attachment.js
Websites/bugs.webkit.org/template/en/custom/attachment/edit.html.tmpl

index 63a102e..66c6b25 100644 (file)
@@ -265,7 +265,7 @@ function redoEditAsComment(patchviewerinstalled)
 function viewPrettyPatch(attachment_id)
 {
     viewing_formatted_diff = !viewing_formatted_diff;
-    var src = "attachment.cgi?id=" . $attachment_id;
+    var src = "attachment.cgi?id=" attachment_id;
     var buttonText = "View Formatted Diff";
     if (viewing_formatted_diff) {
       src += "&action=prettypatch"
index d6a4b7b..d744f36 100644 (file)
                 [% IF user.id %]
 [%# if WEBKIT_CHANGES %]
                   [% IF attachment.ispatch %]
-                  document.write('<button type="button" id="viewPrettyPatchButton" onclick="viewPrettyPatch();">View Formatt
+                  document.write('<button type="button" id="viewPrettyPatchButton" onclick="viewPrettyPatch(attachment_id);">View Formatted Diff<\/button>');
                   [% END %]
 [%# endif // WEBKIT_CHANGES %]
                   document.write('<button type="button" id="editButton" onclick="editAsComment(patchviewerinstalled);">Edit Attachment As Comment<\/button>');