Commit 70d21873 authored by Amanda Ghassaei's avatar Amanda Ghassaei
Browse files

script view working

parent f879aa8e
......@@ -105,7 +105,7 @@ nav .btn {
#menuWrapper, #scriptView {
height: 100%;
z-index: 1;
z-index: 2;
position: absolute;
display: block;
background-color: rgba(255,255,255,0.8);
......
......@@ -5,9 +5,9 @@
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
mod(require("../../lib/codemirror"));
mod(require("codeMirror"));
else if (typeof define == "function" && define.amd) // AMD
define(["../../lib/codemirror"], mod);
define(["codeMirror"], mod);
else // Plain browser env
mod(CodeMirror);
})(function(CodeMirror) {
......
......@@ -234,10 +234,6 @@ require.config({
},
'numeric': {
exports: 'numeric'
},
'codeMirror': {
deps: ['codeMirrorJS'],
exports: 'CodeMirror'
}
}
......@@ -250,7 +246,7 @@ require.config({
//};
//init stuff
require(['appState', 'lattice', 'navbar', 'threeModel', 'threeView', 'flatUI', 'bootstrapSlider', 'ribbon', 'menuWrapper'],
require(['appState', 'lattice', 'navbar', 'threeModel', 'threeView', 'flatUI', 'bootstrapSlider', 'ribbon', 'menuWrapper', 'scriptView'],
function(appState, lattice, Navbar, three, ThreeView){
new Navbar({model:appState});
......
......@@ -4,7 +4,8 @@
define(['jquery', 'underscore', 'backbone', 'appState', 'codeMirror'], function($, _, Backbone, appState, CodeMirror){
define(['jquery', 'underscore', 'backbone', 'appState', 'codeMirror', 'text!menus/templates/ScriptView.html', 'codeMirrorJS'],
function($, _, Backbone, appState, CodeMirror, template){
var ScriptView = Backbone.View.extend({
......@@ -19,7 +20,7 @@ define(['jquery', 'underscore', 'backbone', 'appState', 'codeMirror'], function(
initialize: function(){
_.bindAll(this, "render", "_handleKeyStroke");
_.bindAll(this, "render");
//bind events
// $(document).bind('keydown', {}, this._handleKeyStroke);
......@@ -83,12 +84,7 @@ define(['jquery', 'underscore', 'backbone', 'appState', 'codeMirror'], function(
this._setEditorHeight();
},
template: _.template('\
<div class="col-sm-4"><a href="#" id="loadScript" class=" btn btn-lg btn-block btn-default">Load Script</a></div>\
<div class="col-sm-4"><a href="#" id="runScript" class=" btn btn-lg btn-block btn-default">Run Script&nbsp&nbsp&nbsp(CTRL/&#8984; + R)</a></div>\
<div class="col-sm-4"><a href="#" id="saveScript" class=" btn btn-lg btn-block btn-default">Save Script</a></div><br/><br/>\
<textarea id="scriptEditor"><%= script %></textarea><br/>\
')
template: _.template(template)
});
......
<!--<div class="col-sm-4"><a href="#" id="loadScript" class=" btn btn-lg btn-block btn-default">Load Script</a></div>-->
<!--<div class="col-sm-4"><a href="#" id="runScript" class=" btn btn-lg btn-block btn-default">Run Script&nbsp&nbsp&nbsp(CTRL/&#8984; + R)</a></div>-->
Script Name<a href="#" id="saveScript" class=" btn btn-lg btn-default pull-right">Save Script</a><br/><br/>
<!--<br/><br/>-->
<textarea id="scriptEditor"><%= script %></textarea><br/>
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment