[SCM] WebKit Debian packaging branch, webkit-1.3, updated. upstream/1.3.7-4207-g178b198

ojan at chromium.org ojan at chromium.org
Sun Feb 20 22:49:51 UTC 2011


The following commit has been merged in the webkit-1.3 branch:
commit 88148f3132557e323904bd299028ad3303daa6e0
Author: ojan at chromium.org <ojan at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Jan 11 23:56:50 2011 +0000

    2011-01-11  Ojan Vafai  <ojan at chromium.org>
    
            Reviewed by Adam Barth.
    
            remember diffstate for review tool
            https://bugs.webkit.org/show_bug.cgi?id=52253
    
            If you use the global sidebyside/unified links, store the diff type
            in localstorage. Then, onload, use that diff type. That way, people
            who prefer one diff type or the other can always get that by default.
    
            * code-review.js:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75565 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/Websites/bugs.webkit.org/ChangeLog b/Websites/bugs.webkit.org/ChangeLog
index 8e3b1dc..18f13d6 100644
--- a/Websites/bugs.webkit.org/ChangeLog
+++ b/Websites/bugs.webkit.org/ChangeLog
@@ -2,6 +2,19 @@
 
         Reviewed by Adam Barth.
 
+        remember diffstate for review tool
+        https://bugs.webkit.org/show_bug.cgi?id=52253
+
+        If you use the global sidebyside/unified links, store the diff type
+        in localstorage. Then, onload, use that diff type. That way, people
+        who prefer one diff type or the other can always get that by default.
+
+        * code-review.js:
+
+2011-01-11  Ojan Vafai  <ojan at chromium.org>
+
+        Reviewed by Adam Barth.
+
         allow sidebysideifying individual files in the code review tool
         https://bugs.webkit.org/show_bug.cgi?id=52226
 
diff --git a/Websites/bugs.webkit.org/code-review.js b/Websites/bugs.webkit.org/code-review.js
index 09727d9..b7f1973 100644
--- a/Websites/bugs.webkit.org/code-review.js
+++ b/Websites/bugs.webkit.org/code-review.js
@@ -396,12 +396,12 @@
 
   function convertDiff(difftype, convert_link) {
     var file_diffs = $(convert_link).parents('.FileDiff');
-    if (!file_diffs.size())
+    if (!file_diffs.size()) {
+      localStorage.setItem('code-review-diffstate', difftype);
       file_diffs = $('.FileDiff');
+    }
 
-    file_diffs.each(function() {
-      convertFileDiff(difftype, this);
-    });
+    convertAllFileDiffs(difftype, file_diffs);
   }
 
   function getWebKitSourceFile(file_name, onLoad, expand_bar) {
@@ -741,8 +741,17 @@
     $(resize_iframe[0].contentWindow).bind('resize', onBodyResize);
 
     updateToolbarAnchorState();
+    loadDiffState();
   });
 
+  function loadDiffState() {
+    var diffstate = localStorage.getItem('code-review-diffstate');
+    if (diffstate != 'sidebyside' && diffstate != 'unified')
+      return;
+
+    convertAllFileDiffs(diffstate, $('.FileDiff'));
+  }
+
   function isDiffSideBySide(file_diff) {
     return diffState(file_diff) == 'sidebyside';
   }
@@ -773,6 +782,12 @@
     }
   }
 
+  function convertAllFileDiffs(diff_type, file_diffs) {
+    file_diffs.each(function() {
+      convertFileDiff(diff_type, this);
+    });
+  }
+
   function convertFileDiff(diff_type, file_diff) {
     if (diffState(file_diff) == diff_type)
       return;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list