allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject allura git commit: [#7811] Diff lines coloring now equally long
Date Tue, 25 Apr 2017 14:27:31 GMT
Repository: allura
Updated Branches:
  refs/heads/master 2c2b2f19e -> 9c605a6d1


[#7811] Diff lines coloring now equally long


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/9c605a6d
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/9c605a6d
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/9c605a6d

Branch: refs/heads/master
Commit: 9c605a6d16be43b47231d459a66fd65e0d846bb5
Parents: 2c2b2f1
Author: huzaifafaruqui <huzaifafaruqui@outlook.com>
Authored: Mon Apr 10 21:46:37 2017 +0530
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Tue Apr 25 14:27:01 2017 +0000

----------------------------------------------------------------------
 Allura/allura/templates/repo/commit.html | 8 ++++++++
 Allura/allura/templates/repo/diff.html   | 9 +++++++++
 2 files changed, 17 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/9c605a6d/Allura/allura/templates/repo/commit.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/repo/commit.html b/Allura/allura/templates/repo/commit.html
index b0f3427..54f27a7 100644
--- a/Allura/allura/templates/repo/commit.html
+++ b/Allura/allura/templates/repo/commit.html
@@ -48,6 +48,12 @@ Commit <a href="{{commit.url()}}">{{commit.shorthand_id()}}</a>
{{commit_labels(
 {% block extra_js %}
 {{ super() }}
   <script type="text/javascript">
+    function color_diff(selector) {
+      var overflow = $(selector).find("pre").get(0);
+      var len = overflow.scrollWidth - 5;
+      $(selector).find(".gi, .gd, .gu").width(len);
+    }
+
     function ld(diff, callback) {
       $(diff.selector).load(encodeURI(diff.url), callback);
     }
@@ -78,6 +84,7 @@ Commit <a href="{{commit.url()}}">{{commit.shorthand_id()}}</a>
{{commit_labels(
         if (diff_queue.length == 0) {
           clearInterval(document.diff_queue_timer);
         }
+        color_diff(diff.selector);
       });
     }
     $(document).ready(function() {
@@ -93,6 +100,7 @@ Commit <a href="{{commit.url()}}">{{commit.shorthand_id()}}</a>
{{commit_labels(
           $('#' + diffid).load(href, function() {
             self.attr('data-diformat', 'regular');
             self.text('Switch to side-by-side view');
+            color_diff('#' + diffid);
           });
         } else {
           href = href + '&diformat=sidebyside';

http://git-wip-us.apache.org/repos/asf/allura/blob/9c605a6d/Allura/allura/templates/repo/diff.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/repo/diff.html b/Allura/allura/templates/repo/diff.html
index e39e072..0984889 100644
--- a/Allura/allura/templates/repo/diff.html
+++ b/Allura/allura/templates/repo/diff.html
@@ -71,6 +71,15 @@
   {% endif %}
 {% endblock %}
 
+{% block extra_js %}
+{{ super() }}
+<script type="text/javascript">
+  var overflow = $("pre").get(0);
+  var len = overflow.scrollWidth - 30;
+  $(".gi, .gd, .gu").width(len);
+</script>
+{% endblock %}
+
 {% block extra_css %}
   {{ super() }}
   <style type="text/css">


Mime
View raw message