incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject [17/17] git commit: [#5561] Added maximize button to file and file diff view
Date Thu, 03 Oct 2013 18:05:27 GMT
[#5561] Added maximize button to file and file diff view

Signed-off-by: Cory Johns <cjohns@slashdotmedia.com>


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

Branch: refs/heads/cj/5561
Commit: 06cd74fcabdcef9acf4a0c791096e8e0f34a2198
Parents: c67d79e
Author: Cory Johns <cjohns@slashdotmedia.com>
Authored: Thu Oct 3 18:04:49 2013 +0000
Committer: Cory Johns <cjohns@slashdotmedia.com>
Committed: Thu Oct 3 18:04:49 2013 +0000

----------------------------------------------------------------------
 Allura/allura/templates/repo/diff.html | 22 ++++++++++++++++++++++
 Allura/allura/templates/repo/file.html | 11 +++++++++++
 2 files changed, 33 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/06cd74fc/Allura/allura/templates/repo/diff.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/repo/diff.html b/Allura/allura/templates/repo/diff.html
index a724896..8024b0f 100644
--- a/Allura/allura/templates/repo/diff.html
+++ b/Allura/allura/templates/repo/diff.html
@@ -35,6 +35,15 @@
 <a href="{{b.url()}}">{{b.commit.shorthand_id()}}</a>
 {% endblock %}
 
+{% block actions %}
+<a id="maximize-content" href="#">
+  <b data-icon="{{g.icons.expand.char}}" class="ico {{g.icons.expand.css}}" title="Maximize">
</b> Maximize
+</a>
+<a id="restore-content" href="#">
+  <b data-icon="{{g.icons.restore.char}}" class="ico {{g.icons.restore.css}}" title="Restore">
</b> Restore
+</a>
+{% endblock %}
+
 {% block content %}
   {% if a.has_image_view and b.has_image_view %}
   <div class="grid-19">
@@ -74,3 +83,16 @@
     .clip h3 {margin-bottom: 0;}
   </style>
 {% endblock %}
+
+{% block extra_js %}
+{{ super() }}
+  <script type="text/javascript">
+    $(document).ready(function() {
+      $('#maximize-content, #restore-content').click(function(e) {
+          $('body').toggleClass('content-maximized');
+          e.preventDefault();
+          return false;
+      });
+    });
+  </script>
+{% endblock %}

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/06cd74fc/Allura/allura/templates/repo/file.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/repo/file.html b/Allura/allura/templates/repo/file.html
index 04f7205..975ca7f 100644
--- a/Allura/allura/templates/repo/file.html
+++ b/Allura/allura/templates/repo/file.html
@@ -31,6 +31,12 @@
 {% endblock %}
 
 {% block actions %}
+<a id="maximize-content" href="#">
+  <b data-icon="{{g.icons.expand.char}}" class="ico {{g.icons.expand.css}}" title="Maximize">
</b> Maximize
+</a>
+<a id="restore-content" href="#">
+  <b data-icon="{{g.icons.restore.char}}" class="ico {{g.icons.restore.css}}" title="Restore">
</b> Restore
+</a>
 <a href="{{blob.commit.url()}}log/?path={{ blob.path() }}">
   <b data-icon="{{g.icons.history.char}}" class="ico {{g.icons.history.css}}" title="History">
</b> History
 </a>
@@ -59,6 +65,11 @@
       window.location.href = '#' + $(element).attr('id');
     });
   });
+  $('#maximize-content, #restore-content').click(function(e) {
+      $('body').toggleClass('content-maximized');
+      e.preventDefault();
+      return false;
+  });
 }());
 </script>
 {% endblock %}


Mime
View raw message