made 3d viewer a little cleaner
authorAeva Ntsc <aeva.ntsc@gmail.com>
Mon, 15 Oct 2012 15:10:32 +0000 (10:10 -0500)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Mon, 3 Dec 2012 20:40:47 +0000 (14:40 -0600)
mediagoblin/templates/mediagoblin/media_displays/stl.html

index 30e1a0bb0ba91ecee975d28d0ec3eed19b423c53..6fd2b04df1ae3558b381148721af1451944b1379 100644 (file)
@@ -33,20 +33,31 @@ test...
 
 <script>
   window.onload = function() {
-  thingiurlbase = "{{ request.staticdirect('/js/thingiview.js') }}";
-  thingiview = new Thingiview("viewer");
-  thingiview.setObjectColor('#821543');
-  thingiview.initScene();
-  thingiview.loadSTL("{{ display_media }}");
-
-  // note thingiview.setRotation(false) to turn off rotation...
+    thingiurlbase = "{{ request.staticdirect('/js/thingiview.js') }}";
+    thingiview = new Thingiview("viewer");
+    thingiview.setObjectColor('#821543');
+    thingiview.initScene();
+    thingiview.loadSTL("{{ display_media }}");
+    thingiview.setRotation(false);
   }
+  window.rotate = false;
+  window.toggle_rotate = function () {
+    rotate = ! rotate;
+    thingiview.setRotation(rotate);
+  };
 </script>
 
-<div id="viewer" style="width:640px;height:480px"></div>
-
-<a href="{{ display_media }}">stl model</a>
-
+<div id="viewer" style="width:640px;height:480px;padding-bottom:4px;"></div
+<p>
+  <a class="button_action" onclick="toggle_rotate()"
+     title="{%- trans %}Toggle Rotate{% endtrans -%}">
+    {%- trans %}Toggle Rotate{% endtrans -%}
+  </a>
+  <a class="button_action" href="{{ display_media }}"
+     title="{%- trans %}Download{% endtrans -%}">
+    {%- trans %}Download{% endtrans -%}
+  </a>
+</p>
 
 
 {% endblock %}