[ARVADOS] updated: 489595e9636f7a271774cc8188f691d49f514e43

git at public.curoverse.com git at public.curoverse.com
Mon Jan 27 16:01:25 EST 2014


Summary of changes:
 apps/workbench/app/views/collections/show.html.erb |   30 +++++++++++++++++++-
 1 files changed, 29 insertions(+), 1 deletions(-)

       via  489595e9636f7a271774cc8188f691d49f514e43 (commit)
      from  545282711fe66e35cc486243e41b70cc82551e21 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 489595e9636f7a271774cc8188f691d49f514e43
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Mon Jan 27 16:02:06 2014 -0500

    Use javascript to set the size of the svg box so that the horizontal scrollbar stays on screen.
    Use javascript to enlarge/shrink the svg image ("zoom in" and "zoom out" buttons).

diff --git a/apps/workbench/app/views/collections/show.html.erb b/apps/workbench/app/views/collections/show.html.erb
index 85fdeed..bbb7d20 100644
--- a/apps/workbench/app/views/collections/show.html.erb
+++ b/apps/workbench/app/views/collections/show.html.erb
@@ -17,6 +17,7 @@
 
 <%#= render :partial => 'nav' %>
 
+<div class="tabbable">
 <ul class="nav nav-tabs">
   <li class="active"><a href="#files" data-toggle="tab">Files (<%= @object.files ? @object.files.size : 0 %>)</a></li>
   <li><a href="#provenance" data-toggle="tab">Provenance (<%= @provenance.size %>)</a></li>
@@ -136,7 +137,33 @@
     </table>
   </div>
   <div id="provenance2" class="tab-pane fade">
-    <%= raw(@prov_svg) %>
+  <script>
+    function provenance_sizing_fixup() {
+      var a = document.getElementById("provenance_graph");
+      a.style.height = String(window.innerHeight - (a.getBoundingClientRect().top + window.scrollY)) + "px";
+    }
+    $(window).resize(provenance_sizing_fixup);
+    $(window).load(provenance_sizing_fixup);
+
+    function graph_zoom(scale) {
+      var pg = document.getElementById("provenance_graph");
+      var st = pg.scrollTop / pg.scrollTopMax;
+      var sl = pg.scrollLeft / pg.scrollLeftMax;
+      var g = document.getElementById("graph1").parentNode;
+      g.setAttribute("height", parseFloat(g.getAttribute("height")) * scale);
+      g.setAttribute("width", parseFloat(g.getAttribute("width")) * scale);
+      pg.scrollTop = st * pg.scrollTopMax;
+      pg.scrollLeft = sl * pg.scrollLeftMax;
+    }
+  </script>
+  <div style="text-align: right">
+  <a href="#"><span class="icon-zoom-out" onclick="graph_zoom(.9)"></span></a>
+  <a href="#"><span class="icon-zoom-in" onclick="graph_zoom(1./.9)"></span></a>
+  </div>
+  
+  <div id="provenance_graph" style="padding-left: 3px; overflow:auto; border:solid; border-width:1px; border-color: gray">
+      <%= raw(@prov_svg) %>
+  </div>
   </div>
   <div id="jobs" class="tab-pane fade">
     <table class="topalign table table-bordered">
@@ -254,3 +281,4 @@
     <%= render :partial => 'application/arvados_object' %>
   </div>
 </div>
+</div>

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list