Title: [97435] trunk/Websites/bugs.webkit.org
Revision
97435
Author
[email protected]
Date
2011-10-13 18:40:23 -0700 (Thu, 13 Oct 2011)

Log Message

Would be nice if the review-tool offered to show the corresponding header
https://bugs.webkit.org/show_bug.cgi?id=63963

Reviewed by Ojan Vafai.

This is a first cut at adding links to the header file in the review
tool.  If folks like this feature, we can cover more cases in the
future.

* code-review.js:

Modified Paths

Diff

Modified: trunk/Websites/bugs.webkit.org/ChangeLog (97434 => 97435)


--- trunk/Websites/bugs.webkit.org/ChangeLog	2011-10-14 01:22:42 UTC (rev 97434)
+++ trunk/Websites/bugs.webkit.org/ChangeLog	2011-10-14 01:40:23 UTC (rev 97435)
@@ -1,3 +1,16 @@
+2011-10-13  Adam Barth  <[email protected]>
+
+        Would be nice if the review-tool offered to show the corresponding header
+        https://bugs.webkit.org/show_bug.cgi?id=63963
+
+        Reviewed by Ojan Vafai.
+
+        This is a first cut at adding links to the header file in the review
+        tool.  If folks like this feature, we can cover more cases in the
+        future.
+
+        * code-review.js:
+
 2011-09-14  Ben Wells  <[email protected]>
 
         PrettyPatch should handle "delta" patch mechanism in git binary patches

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


--- trunk/Websites/bugs.webkit.org/code-review-test.html	2011-10-14 01:22:42 UTC (rev 97434)
+++ trunk/Websites/bugs.webkit.org/code-review-test.html	2011-10-14 01:40:23 UTC (rev 97435)
@@ -2,6 +2,7 @@
 <div>FIXME: Run these as part of the layout test suite?</div>
 
 <script>CODE_REVIEW_UNITTEST = true</script>
+<script src="" 
 <script src=""
 <pre id="output"></pre>
 <script>
@@ -75,6 +76,12 @@
         log('FAILED:\ngot:\n' + actual + '\nexpected:\n' + expected + '');
 }
 
+var links = tracLinks('foo/bar/baz.cpp', '');
+ASSERT_EQUAL($(links).attr('href'), 'http://trac.webkit.org/log/trunk/foo/bar/baz.h');
+
+var links = tracLinks('foo/bar.cpp/qux.mm', '');
+ASSERT_EQUAL($(links).attr('href'), 'http://trac.webkit.org/log/trunk/foo/bar.cpp/qux.h');
+
 // Basic setItem.
 var ls = new MockLocalStorage();
 new MockDraftCommentSaver('1234', ls).save();

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


--- trunk/Websites/bugs.webkit.org/code-review.js	2011-10-14 01:22:42 UTC (rev 97434)
+++ trunk/Websites/bugs.webkit.org/code-review.js	2011-10-14 01:40:23 UTC (rev 97435)
@@ -184,7 +184,7 @@
 
   if (CODE_REVIEW_UNITTEST)
     window['DraftCommentSaver'] = DraftCommentSaver;
-  
+
   DraftCommentSaver.prototype._json = function() {
     var comments = $('.comment');
     var comment_store = [];
@@ -623,9 +623,21 @@
     var trac_links = $('<a target="_blank">annotate</a><a target="_blank">revision log</a>');
     trac_links[0].href = '' + file_name + '?annotate=blame' + url_hash;
     trac_links[1].href = '' + file_name;
+    var implementation_suffix_list = ['.cpp', '.mm'];
+    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 stem = file_name.substr(0, file_name.length - suffix.length);
+        trac_links[0].href= '' + stem + '.h';
+      }
+    }
     return trac_links;
   }
 
+  if (CODE_REVIEW_UNITTEST)
+    window.tracLinks = tracLinks;
+
   function addExpandLinks(file_name) {
     if (file_name.indexOf('ChangeLog') != -1)
       return;
@@ -1059,6 +1071,8 @@
   }
 
   $(document).ready(function() {
+    if (CODE_REVIEW_UNITTEST)
+      return;
     crawlDiff();
     fetchHistory();
     $(document.body).prepend('<div id="message">' +
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to