From 5d981a126850adb570fcba5f1fd1e721c4992da9 Mon Sep 17 00:00:00 2001 From: Peter Cottle Date: Sat, 5 Jan 2013 13:22:14 -0800 Subject: [PATCH] level toolbar thing --- build/bundle.js | 76 +++++++++++++++++++++++++++++++++++- src/index.html | 9 +++++ src/js/views/commandViews.js | 1 - src/js/views/index.js | 37 ++++++++++++++++++ src/style/main.css | 13 +++++- 5 files changed, 132 insertions(+), 4 deletions(-) diff --git a/build/bundle.js b/build/bundle.js index cce6824c..0823647f 100644 --- a/build/bundle.js +++ b/build/bundle.js @@ -9648,6 +9648,42 @@ var ZoomAlertWindow = Backbone.View.extend({ } }); +var LevelToolbar = BaseView.extend({ + tagName: 'div', + template: _.template($('#level-toolbar-template').html()), + + initialize: function(options) { + options = options || {}; + this.JSON = { + levelName: options.levelName || 'Some level! (unknown name)' + }; + + this.beforeDestination = $($('#commandLineHistory div.toolbar')[0]); + this.render(); + + if (!options.wait) { + process.nextTick(_.bind(function() { + this.show(); + }, this)); + } + }, + + render: function() { + var HTML = this.template(this.JSON); + + this.$el.html(HTML); + this.beforeDestination.after(this.el); + }, + + hide: function() { + this.$('div.toolbar').toggleClass('hidden', true); + }, + + show: function() { + this.$('div.toolbar').toggleClass('hidden', false); + } +}); + var CanvasTerminalHolder = BaseView.extend({ tagName: 'div', className: 'canvasTerminalHolder box flex1', @@ -9700,6 +9736,7 @@ exports.ZoomAlertWindow = ZoomAlertWindow; exports.ConfirmCancelTerminal = ConfirmCancelTerminal; exports.CanvasTerminalHolder = CanvasTerminalHolder; +exports.LevelToolbar = LevelToolbar; }); @@ -15123,7 +15160,6 @@ var CommandLineHistoryView = Backbone.View.extend({ var toDestroy = []; this.collection.each(function(command) { - console.log('this command', command, command.get('status')); if (command.get('status') !== 'inqueue' && command.get('status') !== 'processing') { toDestroy.push(command); @@ -19332,7 +19368,6 @@ var CommandLineHistoryView = Backbone.View.extend({ var toDestroy = []; this.collection.each(function(command) { - console.log('this command', command, command.get('status')); if (command.get('status') !== 'inqueue' && command.get('status') !== 'processing') { toDestroy.push(command); @@ -19721,6 +19756,42 @@ var ZoomAlertWindow = Backbone.View.extend({ } }); +var LevelToolbar = BaseView.extend({ + tagName: 'div', + template: _.template($('#level-toolbar-template').html()), + + initialize: function(options) { + options = options || {}; + this.JSON = { + levelName: options.levelName || 'Some level! (unknown name)' + }; + + this.beforeDestination = $($('#commandLineHistory div.toolbar')[0]); + this.render(); + + if (!options.wait) { + process.nextTick(_.bind(function() { + this.show(); + }, this)); + } + }, + + render: function() { + var HTML = this.template(this.JSON); + + this.$el.html(HTML); + this.beforeDestination.after(this.el); + }, + + hide: function() { + this.$('div.toolbar').toggleClass('hidden', true); + }, + + show: function() { + this.$('div.toolbar').toggleClass('hidden', false); + } +}); + var CanvasTerminalHolder = BaseView.extend({ tagName: 'div', className: 'canvasTerminalHolder box flex1', @@ -19773,6 +19844,7 @@ exports.ZoomAlertWindow = ZoomAlertWindow; exports.ConfirmCancelTerminal = ConfirmCancelTerminal; exports.CanvasTerminalHolder = CanvasTerminalHolder; +exports.LevelToolbar = LevelToolbar; }); diff --git a/src/index.html b/src/index.html index 788b5b8e..95379b94 100644 --- a/src/index.html +++ b/src/index.html @@ -90,6 +90,15 @@ + +