From efe9d07a43bdd500eae71f2b622641c3196f9639 Mon Sep 17 00:00:00 2001
From: Amanda Ghassaei <amandaghassaei@gmail.com>
Date: Tue, 16 Jun 2015 14:15:02 -0700
Subject: [PATCH] setting up comm menu

---
 index.html                                    |  1 +
 js/main.js                                    |  4 +-
 ...{CompositeMenu.js => CompositeMenuView.js} |  0
 js/menus/DiscoveryMenuView.js                 | 37 +++++++++++++++++++
 js/menus/Navbar.js                            |  2 +-
 js/menus/SendMenuView.js                      |  2 +-
 js/menus/SetupCommMenuView.js                 | 27 ++++++++++++++
 js/models/PList.js                            |  8 +++-
 8 files changed, 76 insertions(+), 5 deletions(-)
 rename js/menus/{CompositeMenu.js => CompositeMenuView.js} (100%)
 create mode 100644 js/menus/DiscoveryMenuView.js
 create mode 100644 js/menus/SetupCommMenuView.js

diff --git a/index.html b/index.html
index 2490d6e1..4cfa92dd 100644
--- a/index.html
+++ b/index.html
@@ -35,6 +35,7 @@
         <li><a data-menu-id="navDesign" class="menuHoverControls" href="#">Design</a></li>
         <li><a data-menu-id="navSim" class="menuHoverControls" href="#">Simulate</a></li>
         <li><a data-menu-id="navAssemble" class="menuHoverControls" href="#">Assemble</a></li>
+        <li><a data-menu-id="navComm" class="menuHoverControls" href="#">Comm</a></li>
         <li class="dropdown navDropdown">
           <a href="#" class="dropdown-toggle" data-toggle="dropdown">File <b class="caret"></b></a>
           <span class="dropdown-arrow"></span>
diff --git a/js/main.js b/js/main.js
index 054f1e37..c49a65d4 100644
--- a/js/main.js
+++ b/js/main.js
@@ -101,7 +101,9 @@ require.config({
         camMenu: 'menus/CamMenuView',
         animateMenu: 'menus/AnimationMenuView',
         sendMenu: 'menus/SendMenuView',
-        compositeMenu: 'menus/CompositeMenu',
+        compositeMenu: 'menus/CompositeMenuView',
+        setupCommMenu: 'menus/SetupCommMenuView',
+        discoveryMenu: 'menus/DiscoveryMenuView',
 
         //stls
         octaFaceTrianglePartSTL: '../assets/stls/parts/OctaFaceTrianglePart.stl',
diff --git a/js/menus/CompositeMenu.js b/js/menus/CompositeMenuView.js
similarity index 100%
rename from js/menus/CompositeMenu.js
rename to js/menus/CompositeMenuView.js
diff --git a/js/menus/DiscoveryMenuView.js b/js/menus/DiscoveryMenuView.js
new file mode 100644
index 00000000..d132627a
--- /dev/null
+++ b/js/menus/DiscoveryMenuView.js
@@ -0,0 +1,37 @@
+/**
+ * Created by aghassaei on 6/16/15.
+ */
+
+
+define(['jquery', 'underscore', 'menuParent', 'plist', 'lattice'], function($, _, MenuParentView, plist, lattice){
+
+    var log = "testing<br/>hello";
+
+    return MenuParentView.extend({
+
+        events: {
+            "click #discoveryLogClear":                              "_clearLog"
+        },
+
+
+        _initialize: function(){
+        },
+
+        _clearLog: function(e){
+            e.preventDefault();
+            log = "";
+            this.render();
+        },
+
+        _makeTemplateJSON: function(){
+            return _.extend({log: log}, this.model.toJSON(), plist);
+        },
+
+        template: _.template('\
+        Log:\
+        <div id="gcodeEditor"><%= log %></div><br/>\
+        <a id="discoveryLogClear" href="#" class="btn btn-block btn-lg btn-danger">Clear Log</a><br/>\
+            ')
+
+    });
+});
\ No newline at end of file
diff --git a/js/menus/Navbar.js b/js/menus/Navbar.js
index 9e90c18d..715544ae 100644
--- a/js/menus/Navbar.js
+++ b/js/menus/Navbar.js
@@ -50,7 +50,7 @@ define(['jquery', 'underscore', 'backbone', 'fileSaver', 'navViewMenu'], functio
 
         _setNavSelection: function(e){
             var navSelection = $(e.target).data("menuId");
-            if (navSelection == "about") {
+            if (navSelection == "about" || navSelection == "navAssemble") {
                 $(e.target).blur();
                 return;
             }
diff --git a/js/menus/SendMenuView.js b/js/menus/SendMenuView.js
index 4d59dabd..fa906faa 100644
--- a/js/menus/SendMenuView.js
+++ b/js/menus/SendMenuView.js
@@ -2,7 +2,7 @@
  * Created by aghassaei on 3/11/15.
  */
 
-define(['jquery', 'underscore', 'menuParent', 'plist', 'cam', 'lattice'], function($, _, MenuParentView, plist, cam, lattice){
+define(['jquery', 'underscore', 'menuParent', 'plist', 'lattice'], function($, _, MenuParentView, plist, lattice){
 
     return MenuParentView.extend({
 
diff --git a/js/menus/SetupCommMenuView.js b/js/menus/SetupCommMenuView.js
new file mode 100644
index 00000000..c9fbcdc2
--- /dev/null
+++ b/js/menus/SetupCommMenuView.js
@@ -0,0 +1,27 @@
+/**
+ * Created by aghassaei on 6/16/15.
+ */
+
+
+define(['jquery', 'underscore', 'menuParent', 'plist'], function($, _, MenuParentView, plist){
+
+    return MenuParentView.extend({
+
+        events: {
+        },
+
+
+        _initialize: function(){
+        },
+
+        _makeTemplateJSON: function(){
+            return _.extend(this.model.toJSON(), plist);
+        },
+
+        template: _.template('\
+        Setup<br/>\
+        Send Test Messages\
+            ')
+
+    });
+});
\ No newline at end of file
diff --git a/js/models/PList.js b/js/models/PList.js
index b67c7f75..56037f79 100644
--- a/js/models/PList.js
+++ b/js/models/PList.js
@@ -22,11 +22,15 @@ define(['three'], function(THREE){
             navAssemble:{
                 assembler:"Assembler",
                 cam: "Process",
-                animate:"Preview",
-                send: "Send"
+                animate:"Preview"
             },
             navComposite:{
                 composite:"Composite Editor"
+            },
+            navComm:{
+                setupComm: "Setup",
+                discovery: "Discovery",
+                send: "Send"
             }
         },
 
-- 
GitLab