diff --git a/js/lattice/Lattice.js b/js/lattice/Lattice.js index 1d4890b6f7147a992bebc754472cd908f00ad7c9..01badda697ec0ebce42f1e60ae091bb96f06be15 100644 --- a/js/lattice/Lattice.js +++ b/js/lattice/Lattice.js @@ -29,11 +29,10 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre __initialize: function(){ - this.listenTo(this, "change:partType change:latticeType", this._updatePartType); - this.listenTo(this, "change:cellType change:connectionType", function(){ + this.listenTo(this, "change:partType", this._updatePartType); + this.listenTo(this, "change:cellType change:connectionType change:latticeType", function(){ this._updateLatticeConfig();//pass no params }); - this.listenTo(this, "change:latticeType", this._updateLatticeType); this.listenTo(appState, "change:currentNav", this._navChanged); this.listenTo(this, "change:cellsMin change:cellsMax", function(){ @@ -54,24 +53,18 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre _setToDefaultsSilently: function(){ var newCellType = this.get("cellType"); var newConnectionType = this.get("connectionType"); + var newLatticeType = this.get("latticeType"); - if (newConnectionType == this.previous("connectionType")){ + if (this.previous("cellType") !== undefined && newCellType != this.previous("cellType")){ newConnectionType = _.keys(plist.allLattices[newCellType].connection)[0]; this.set("connectionType", newConnectionType, {silent:true}); } - var newLatticeType = this.get("latticeType"); - if (newLatticeType === this.previous("latticeType")){ + if (this.previous("connectionType") !== undefined && newConnectionType != this.previous("connectionType")){ newLatticeType = _.keys(plist.allLattices[newCellType].connection[newConnectionType].type)[0]; this.set("latticeType", newLatticeType, {silent:true}); } - var latticeData = this._getLatticePlistData(); - - var newPartType = null; - if (latticeData.parts) newPartType = _.keys(latticeData.parts)[0]; - this.set("partType", newPartType, {silent:true}); - this._updateLatticeType(); }, @@ -79,6 +72,10 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre var latticeData = this._getLatticePlistData(); this.set("aspectRatio", latticeData.aspectRatio.clone(), {silent:true}); + var newPartType = null; + if (latticeData.parts) newPartType = _.keys(latticeData.parts)[0]; + this.set("partType", newPartType, {silent:true}); + var newMaterialClass = (latticeData.materialClasses || _.keys(plist.allMaterialClasses))[0]; appState.set("materialClass", newMaterialClass); diff --git a/js/menus/MenuWrapperView.js b/js/menus/MenuWrapperView.js index 033ff84d269e66ff09e468a6e41800f48417c1bc..2e2e0e6634df8a15701c65acdf57c33135e71ec0 100644 --- a/js/menus/MenuWrapperView.js +++ b/js/menus/MenuWrapperView.js @@ -56,8 +56,6 @@ define(['jquery', 'underscore', 'plist', 'backbone', 'lattice', 'appState', 'tex serialComm.openSerialMonitor(); }); } - console.log(e); - }, _updateString: function(e){ diff --git a/js/menus/NavViewMenu.js b/js/menus/NavViewMenu.js index 64383a6713fb2f525b16ed473db562bac9bc71d4..5a45e6b41f1f91e1fae1764c4f0db072cc5e73d9 100644 --- a/js/menus/NavViewMenu.js +++ b/js/menus/NavViewMenu.js @@ -12,7 +12,8 @@ define(['jquery', 'underscore', 'backbone', 'plist', 'lattice', 'text!navViewMen events: { "click a": "_makeSelection", - "click #reset3DView": "_reset3DNavigation" + "click #reset3DView": "_reset3DNavigation", + "click #videoRendering": "_videoRenderingSetup" }, initialize: function(){ @@ -23,8 +24,9 @@ define(['jquery', 'underscore', 'backbone', 'plist', 'lattice', 'text!navViewMen _makeSelection: function(e){ - e.preventDefault(); var $target = $(e.target); + if ($target.hasClass("customClick")) return; + e.preventDefault(); if ($target.prop("tagName") == "SPAN") $target = $target.parent(); var property = $target.data("property"); var value = $target.data("value"); @@ -47,6 +49,11 @@ define(['jquery', 'underscore', 'backbone', 'plist', 'lattice', 'text!navViewMen this.model.reset3DNavigation(); }, + _videoRenderingSetup: function(e){ + e.preventDefault(); + window.resizeTo(1000, 700); + }, + render: function(){ this.$el.html(this.template(_.extend(this.model.toJSON(), plist, lattice.toJSON()))); diff --git a/js/menus/templates/NavViewMenu.html b/js/menus/templates/NavViewMenu.html index b79aa5f2a2299ebc24d5faa170e1adbaf981d111..22906b5e5578226d8ebb561430caee40d925cf3b 100644 --- a/js/menus/templates/NavViewMenu.html +++ b/js/menus/templates/NavViewMenu.html @@ -34,4 +34,10 @@ <% }); %> </ul> </li> -<li><a class="" href="#">Keyboard Shortcuts</a></li> \ No newline at end of file +<li><a class="" href="#">Keyboard Shortcuts</a></li> +<li class="dropdown-submenu"> + <a tabindex="-1">Amanda's Stuff<span class="pull-right fui-arrow-right"></span></a> + <ul class="dropdown-menu"> + <li><a class="customClick" id="videoRendering" href="#">Video Rendering Setup</a></li> + </ul> +</li> \ No newline at end of file diff --git a/js/plists/PList.js b/js/plists/PList.js index 9b80dcb4a1a2a9d050572674aab30d95863ae783..8bd351010b0baf7411cd858b2f38a007aeaf6de7 100644 --- a/js/plists/PList.js +++ b/js/plists/PList.js @@ -216,12 +216,26 @@ define(['three'], function(THREE){ name: "Micro LEGO (low res)" } }, - aspectRatio: new THREE.Vector3(1,1,5),//1.28 + aspectRatio: new THREE.Vector3(1,1,1.28), materialClasses: ['electronic'], options: { gikLength: 4 } }, + lego: { + name: "LEGO", + parts: { + lego: { + name: "LEGO Bricks" + } + }, + aspectRatio: new THREE.Vector3(1,1,1.17), + materialClasses: ['mechanical'], + options: { + scale: 8.2, + units: "mm" + } + }, dnaBricks: { name: "DNA Bricks", parts: {