Title: [136578] trunk/Websites/bugs.webkit.org
Revision
136578
Author
[email protected]
Date
2012-12-04 14:47:59 -0800 (Tue, 04 Dec 2012)

Log Message

Properly create the header links in the code review tool
https://bugs.webkit.org/show_bug.cgi?id=104037

Reviewed by Adam Barth.

Right now, we just prepend "header" to the two existing links and change
the first link to point to the header. The problem is that jQuery's prepend
method just prepends to each item in the jQuery object instead of adding
the item to the beginning of the list as this code assumed.

* code-review-test.html:
* code-review.js:

Modified Paths

Diff

Modified: trunk/Websites/bugs.webkit.org/ChangeLog (136577 => 136578)


--- trunk/Websites/bugs.webkit.org/ChangeLog	2012-12-04 22:44:02 UTC (rev 136577)
+++ trunk/Websites/bugs.webkit.org/ChangeLog	2012-12-04 22:47:59 UTC (rev 136578)
@@ -1,5 +1,20 @@
 2012-12-04  Ojan Vafai  <[email protected]>
 
+        Properly create the header links in the code review tool
+        https://bugs.webkit.org/show_bug.cgi?id=104037
+
+        Reviewed by Adam Barth.
+
+        Right now, we just prepend "header" to the two existing links and change
+        the first link to point to the header. The problem is that jQuery's prepend
+        method just prepends to each item in the jQuery object instead of adding
+        the item to the beginning of the list as this code assumed.
+
+        * code-review-test.html:
+        * code-review.js:
+
+2012-12-04  Ojan Vafai  <[email protected]>
+
         Can't add followup comment to a previous comment
         https://bugs.webkit.org/show_bug.cgi?id=104025
 

Modified: trunk/Websites/bugs.webkit.org/code-review-test.html (136577 => 136578)


--- trunk/Websites/bugs.webkit.org/code-review-test.html	2012-12-04 22:44:02 UTC (rev 136577)
+++ trunk/Websites/bugs.webkit.org/code-review-test.html	2012-12-04 22:47:59 UTC (rev 136578)
@@ -22,7 +22,7 @@
 }
 
 function log(msg) {
-    document.getElementById('output').innerHTML += msg + '\n\n';
+    document.getElementById('output').textContent += msg + '\n\n';
 }
 
 function ASSERT(msg, assertion) {
@@ -41,10 +41,32 @@
 
 function testTracLinks() {
   var links = tracLinks('foo/bar/baz.cpp', '');
-  ASSERT_EQUAL($(links).attr('href'), 'http://trac.webkit.org/log/trunk/foo/bar/baz.h');
+  ASSERT_EQUAL($('<div>').append(links).html(),
+    '<a target="_blank" href="" +
+    '<a target="_blank" href="" +
+    '<a target="_blank" href="" log</a>');
 
   var links = tracLinks('foo/bar.cpp/qux.mm', '');
-  ASSERT_EQUAL($(links).attr('href'), 'http://trac.webkit.org/log/trunk/foo/bar.cpp/qux.h');
+  ASSERT_EQUAL($('<div>').append(links).html(),
+    '<a target="_blank" href="" +
+    '<a target="_blank" href="" +
+    '<a target="_blank" href="" log</a>
+');
+
+  var links = tracLinks('foo/bar.h', '');
+  ASSERT_EQUAL($('<div>').append(links).html(),
+    '<a target="_blank" href="" +
+    '<a target="_blank" href="" log</a>');
+
+  var links = tracLinks('foo/bar.gypi', '');
+  ASSERT_EQUAL($('<div>').append(links).html(),
+    '<a target="_blank" href="" +
+    '<a target="_blank" href="" log</a>');
+
+  var links = tracLinks('foo/ChangeLog', '');
+  ASSERT_EQUAL($('<div>').append(links).html(),
+    '<a target="_blank" href="" +
+    '<a target="_blank" href="" log</a>');
 }
 
 function testDraftCommentSaver() {

Modified: trunk/Websites/bugs.webkit.org/code-review.js (136577 => 136578)


--- trunk/Websites/bugs.webkit.org/code-review.js	2012-12-04 22:44:02 UTC (rev 136577)
+++ trunk/Websites/bugs.webkit.org/code-review.js	2012-12-04 22:47:59 UTC (rev 136578)
@@ -638,9 +638,10 @@
     for (var i = 0; i < implementation_suffix_list.length; ++i) {
       var suffix = implementation_suffix_list[i];
       if (file_name.lastIndexOf(suffix) == file_name.length - suffix.length) {
-        trac_links.prepend('<a target="_blank">header</a>');
+        var new_link = $('<a target="_blank">header</a>');
         var stem = file_name.substr(0, file_name.length - suffix.length);
-        trac_links[0].href= '' + stem + '.h';
+        new_link[0].href= '' + stem + '.h';
+        trac_links = $.merge(new_link, trac_links);
       }
     }
     return trac_links;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to