From d3391493b8c7cfa0613b1bcc314b235f66573664 Mon Sep 17 00:00:00 2001
From: amandaghassaei <amandaghassaei@gmail.com>
Date: Wed, 18 Mar 2015 13:05:14 -0400
Subject: [PATCH] script menu ui

---
 js/menus/AnimationMenuView.js | 13 ++----------
 js/menus/ImportMenuView.js    |  8 ++++----
 js/menus/ScriptMenuView.js    | 12 ++++++++++--
 js/models/AppState.js         | 37 ++++++-----------------------------
 4 files changed, 22 insertions(+), 48 deletions(-)

diff --git a/js/menus/AnimationMenuView.js b/js/menus/AnimationMenuView.js
index bbc52090..006cf83f 100644
--- a/js/menus/AnimationMenuView.js
+++ b/js/menus/AnimationMenuView.js
@@ -85,7 +85,8 @@ AnimationMenuView = Backbone.View.extend({
 
     _setEditorHeight: function(){
         var $editor = $('#gcodeEditor');
-        var height = this.$el.height()-$editor.position().top-50;
+        var height = this.$el.height()-$editor.position().top-50
+        height = Math.max(height, 250);
         $editor.css({height:height +"px"});
     },
 
@@ -127,13 +128,3 @@ AnimationMenuView = Backbone.View.extend({
         ')
 
 });
-
-//        Scene: &nbsp;&nbsp;\
-//        <div class="btn-group">\
-//            <button data-toggle="dropdown" class="btn dropdown-toggle" type="button"><%= allScenes[currentScene] %><span class="caret"></span></button>\
-//            <ul role="menu" class="dropdown-menu">\
-//                <% _.each(_.keys(allScenes), function(key){ %>\
-//                    <li><a class="sceneType" data-type="<%= key %>" href="#"><%= allScenes[key] %></a></li>\
-//                <% }); %>\
-//            </ul>\
-//        </div><br/><br/>\
diff --git a/js/menus/ImportMenuView.js b/js/menus/ImportMenuView.js
index a8ac6483..5ec07b0e 100644
--- a/js/menus/ImportMenuView.js
+++ b/js/menus/ImportMenuView.js
@@ -136,19 +136,19 @@ ImportMenuView = Backbone.View.extend({
         <a href="#" id="removeFillGeo" class=" btn btn-block btn-lg btn-default">Remove Mesh</a><br/>\
         <hr>\
         <% } %>\
-        <br/><span class="btn btn-default btn-file fullWidth">\
+        <br/><span class="btn btn-default btn-lg btn-file fullWidth">\
             Upload STL<input id="uploadMesh" type="file">\
        </span><br/>\
        <div class="text-center">OR</div>\
         <div class="btn-group fullWidth">\
-            <button data-toggle="dropdown" class="btn btn-default dropdown-toggle fullWidth" type="button">Select Model <span class="caret"></span></button>\
+            <button data-toggle="dropdown" class="btn btn-lg btn-default dropdown-toggle fullWidth" type="button">Select Model <span class="caret"></span></button>\
             <ul role="menu" class="dropdown-menu">\
               <!--<li><a class="selectMesh fillGeo" data-file="Airbus_A300-600.stl" href="#">Plane</a></li>-->\
               <li><a id="selectWall" href="#">Wall</a></li>\
               <li><a class="selectMesh cutTerrain" data-file="river.stl" href="#">Landscape 1</a></li>\
               <li><a class="selectMesh cutTerrain" data-file="terrain.stl" href="#">Landscape 2</a></li>\
             </ul>\
-        <br/><br/> todo: fill geometry - move/rotate/scale mesh\
-        </div><!-- /btn-group -->')
+        </div><!-- /btn-group -->\
+        <br/><br/> todo: fill geometry - move/rotate/scale mesh')
 
 });
\ No newline at end of file
diff --git a/js/menus/ScriptMenuView.js b/js/menus/ScriptMenuView.js
index 324e4b79..f7001135 100644
--- a/js/menus/ScriptMenuView.js
+++ b/js/menus/ScriptMenuView.js
@@ -16,11 +16,19 @@ ScriptMenuView = Backbone.View.extend({
 
     render: function(){
         if (this.model.get("currentTab") != "script") return;
-        this.$el.html(this.template());
+        this.$el.html(this.template(this.model.toJSON()));
     },
 
     template: _.template('\
-        some kind of scripting functionality?\
+        <div class="btn-group fullWidth">\
+            <button data-toggle="dropdown" class="btn btn-default btn-lg dropdown-toggle fullWidth" type="button">Load Script<span class="caret"></span></button>\
+            <ul role="menu" class="dropdown-menu">\
+                <% _.each(_.keys(allScripts), function(key){ %>\
+                    <li><a class="units" data-type="<%= key %>" href="#"><%= allScripts[key] %></a></li>\
+                <% }); %>\
+            </ul>\
+        </div><br/><br/><!-- /btn-group -->\
+        <a href="#" id="scriptClearCells" class=" btn btn-block btn-lg btn-default">Clear All Cells</a><br/>\
         ')
 
 });
\ No newline at end of file
diff --git a/js/models/AppState.js b/js/models/AppState.js
index a031a24b..78c8bf01 100644
--- a/js/models/AppState.js
+++ b/js/models/AppState.js
@@ -96,39 +96,10 @@ AppState = Backbone.Model.extend({
         },
 
         allMachineTypes:{
+            handOfGod: "Hand of God",
             shopbot: "Shopbot",
             oneBit: "One Bit Bot"
         },
-//        allAssemblyStrategies:{
-//            octa:{
-//                face: {},
-//                freeformFace: {},
-//                edge: {},
-//                edgeRot: {
-//                    xRaster: "X Raster",
-//                    yRaster: "Y Raster"
-//                },
-//                vertex: {
-//                    xRaster: "X Raster",
-//                    yRaster: "Y Raster"
-//                }
-//            },
-//            tetra: {
-//                vertex: {}
-//            },
-//            cube:{
-//                face: {
-//                    xRaster: "X Raster",
-//                    yRaster: "Y Raster"
-//                }
-//            },
-//            truncatedCube:{
-//                face: {}
-//            },
-//            kelvin:{
-//                face: {}
-//            }
-//        },
         allAssemblyStrategies: {
             raster: "Raster"
         },
@@ -137,10 +108,14 @@ AppState = Backbone.Model.extend({
             gcode: "G-Code"
         },
 
+        allScripts: {
+            loadFile: "Load From File..."
+        },
 
         allUnitTypes: {
+            inches: "Inches",
             mm: "mm",
-            inches: "Inches"
+            //um: "micron"
         },
 
         //key bindings
-- 
GitLab