aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorJon Reid2012-03-06 18:08:11 -0800
committerJon Reid2012-03-06 18:08:11 -0800
commita12603cfcfe9d82def3b972dcbcc80f1e790ad85 (patch)
treef52c7dcc837dd98d28f505696b67b94db15e4c63 /js
parent60bba95eaffa8b5c741c6c85fb84b327cd75d6c3 (diff)
parentbb6a1d82b2884b410f5859cc0c2cafd380acbe6a (diff)
downloadninja-a12603cfcfe9d82def3b972dcbcc80f1e790ad85.tar.gz
Merge remote-tracking branch 'ninja-jduran/TimelineUber' into Timeline-uber
Diffstat (limited to 'js')
-rwxr-xr-xjs/controllers/document-controller.js9
-rwxr-xr-xjs/controllers/selection-controller.js12
-rwxr-xr-xjs/controllers/undo-controller.js17
-rw-r--r--js/data/panels-data.js25
-rwxr-xr-xjs/document/html-document.js181
-rw-r--r--js/io/ui/file-picker/picker-navigator.reel/picker-navigator.js6
-rw-r--r--js/mediators/io-mediator.js163
-rwxr-xr-xjs/ninja.reel/ninja.html2
-rwxr-xr-xjs/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js2
-rwxr-xr-xjs/panels/Panel.reel/Panel.js100
-rwxr-xr-xjs/panels/PanelContainer.reel/PanelContainer.html110
-rwxr-xr-xjs/panels/PanelContainer.reel/PanelContainer.js (renamed from js/panels/PanelContainer/PanelContainer.reel/PanelContainer.js)75
-rwxr-xr-xjs/panels/PanelContainer/PanelContainer.reel/PanelContainer.html146
-rw-r--r--js/panels/drag-drop-composer.js2
14 files changed, 526 insertions, 324 deletions
diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js
index 64ff2c7e..194496a6 100755
--- a/js/controllers/document-controller.js
+++ b/js/controllers/document-controller.js
@@ -76,11 +76,14 @@ var DocumentController = exports.DocumentController = Montage.create(Component,
76 // 76 //
77 handleWebRequest: { 77 handleWebRequest: {
78 value: function (request) { 78 value: function (request) {
79 if (this._hackRootFlag && request.url.indexOf('js/document/templates/montage-html') !== -1) { 79 //TODO: Check if frameId is proper
80 if (this._hackRootFlag && request.parentFrameId !== -1) {
80 //TODO: Optimize creating string 81 //TODO: Optimize creating string
81 return {redirectUrl: this.application.ninja.coreIoApi.rootUrl+this.application.ninja.documentController.documentHackReference.root.split(this.application.ninja.coreIoApi.cloudData.root)[1]+request.url.split('/')[request.url.split('/').length-1]}; 82 //console.log(this.application.ninja.coreIoApi.rootUrl+this.application.ninja.documentController.documentHackReference.root.split(this.application.ninja.coreIoApi.cloudData.root)[1], request.url);
82 } 83 //return {redirectUrl: this.application.ninja.coreIoApi.rootUrl+this.application.ninja.documentController.documentHackReference.root.split(this.application.ninja.coreIoApi.cloudData.root)[1]+request.url.split('/')[request.url.split('/').length-1]};
84 return {redirectUrl: this.application.ninja.coreIoApi.rootUrl+this.application.ninja.documentController.documentHackReference.root.split(this.application.ninja.coreIoApi.cloudData.root)[1]+request.url.split(chrome.extension.getURL('js/document/templates/montage-html/'))[1]};
83 } 85 }
86 }
84 }, 87 },
85 //////////////////////////////////////////////////////////////////// 88 ////////////////////////////////////////////////////////////////////
86 // 89 //
diff --git a/js/controllers/selection-controller.js b/js/controllers/selection-controller.js
index c4623d3f..75968d4a 100755
--- a/js/controllers/selection-controller.js
+++ b/js/controllers/selection-controller.js
@@ -76,7 +76,7 @@ exports.SelectionController = Montage.create(Component, {
76 76
77 77
78 this.application.ninja.selectedElements = currentSelectionArray; 78 this.application.ninja.selectedElements = currentSelectionArray;
79 NJevent("selectionChange", {"elements": this.application.ninja.selectedElements, "isDocument": this._isDocument} ); 79 NJevent("selectionChange", {"elements": this.application.ninja.selectedElements, "isDocument": this._isDocument});
80 80
81 81
82 82
@@ -92,12 +92,14 @@ exports.SelectionController = Montage.create(Component, {
92 handleSwitchDocument: { 92 handleSwitchDocument: {
93 value: function() { 93 value: function() {
94 this._selectedItems = this.application.ninja.selectedElements.slice(0); 94 this._selectedItems = this.application.ninja.selectedElements.slice(0);
95 if(this._selectedItems.length === 0 ){ 95 if(this._selectedItems.length === 0) {
96 this._isDocument = true; 96 this._isDocument = true;
97 }else{ 97 } else {
98 this._isDocument = false; 98 this._isDocument = false;
99 } 99 }
100 NJevent("selectionChange", {"elements": this.application.ninja.selectedElements, "isDocument": this._isDocument} ); 100 NJevent("selectionChange", {"elements": this.application.ninja.selectedElements, "isDocument": this._isDocument});
101
102 this._selectionContainer = this.application.ninja.currentSelectedContainer;
101 } 103 }
102 }, 104 },
103 105
@@ -137,7 +139,7 @@ exports.SelectionController = Montage.create(Component, {
137 value: function(event) { 139 value: function(event) {
138 this.application.ninja.selectedElements = []; 140 this.application.ninja.selectedElements = [];
139 this._isDocument = true; 141 this._isDocument = true;
140 NJevent("selectionChange", {"elements": this.application.ninja.selectedElements, "isDocument": this._isDocument} ); 142 NJevent("selectionChange", {"elements": this.application.ninja.selectedElements, "isDocument": this._isDocument});
141 } 143 }
142 }, 144 },
143 145
diff --git a/js/controllers/undo-controller.js b/js/controllers/undo-controller.js
index 926803d3..19cfb6e6 100755
--- a/js/controllers/undo-controller.js
+++ b/js/controllers/undo-controller.js
@@ -71,22 +71,28 @@ exports.UndoController = Montage.create( Component, {
71 /** 71 /**
72 * Undo Queue 72 * Undo Queue
73 */ 73 */
74 _undoQueue: { value: [] }, 74 _undoQueue: { value: []},
75 75
76 undoQueue: { 76 undoQueue: {
77 get: function() { 77 get: function() {
78 return this._undoQueue; 78 return this._undoQueue;
79 },
80 set: function(value){
81 this._undoQueue = value;
79 } 82 }
80 }, 83 },
81 84
82 /** 85 /**
83 * Redo Queue 86 * Redo Queue
84 */ 87 */
85 _redoQueue: { value: [], enumerable: false }, 88 _redoQueue: { value: [], enumerable: false},
86 89
87 redoQueue: { 90 redoQueue: {
88 get: function() { 91 get: function() {
89 return this._redoQueue; 92 return this._redoQueue;
93 },
94 set: function(value){
95 this._redoQueue = value;
90 } 96 }
91 }, 97 },
92 98
@@ -202,5 +208,12 @@ exports.UndoController = Montage.create( Component, {
202 this.redoQueue.splice(0, this.redoQueue.length); 208 this.redoQueue.splice(0, this.redoQueue.length);
203 //this.redoQueue = []; 209 //this.redoQueue = [];
204 } 210 }
211 },
212
213 clearHistory:{
214 value: function(){
215 this.undoQueue.length = 0;
216 this.redoQueue.length = 0;
217 }
205 } 218 }
206}); \ No newline at end of file 219}); \ No newline at end of file
diff --git a/js/data/panels-data.js b/js/data/panels-data.js
index aa5057a2..2422f5e7 100644
--- a/js/data/panels-data.js
+++ b/js/data/panels-data.js
@@ -19,7 +19,6 @@ exports.PanelsData = Montage.create(Montage, {
19 scrollable: false, 19 scrollable: false,
20 collapsed: false, 20 collapsed: false,
21 open: true, 21 open: true,
22 contentComponent: null,
23 modulePath: "js/panels/Color/colorpanelbase.reel", 22 modulePath: "js/panels/Color/colorpanelbase.reel",
24 moduleName: "ColorPanelBase" 23 moduleName: "ColorPanelBase"
25 }, 24 },
@@ -32,7 +31,6 @@ exports.PanelsData = Montage.create(Montage, {
32 scrollable: true, 31 scrollable: true,
33 collapsed: false, 32 collapsed: false,
34 open: true, 33 open: true,
35 contentComponent: null,
36 modulePath: "js/panels/properties.reel", 34 modulePath: "js/panels/properties.reel",
37 moduleName: "Properties" 35 moduleName: "Properties"
38 }, 36 },
@@ -45,7 +43,6 @@ exports.PanelsData = Montage.create(Montage, {
45 collapsed: true, 43 collapsed: true,
46 scrollable: true, 44 scrollable: true,
47 open: true, 45 open: true,
48 contentComponent: null,
49 modulePath: "js/panels/Materials/materials-library-panel.reel", 46 modulePath: "js/panels/Materials/materials-library-panel.reel",
50 moduleName: "MaterialsLibraryPanel" 47 moduleName: "MaterialsLibraryPanel"
51 }, 48 },
@@ -58,7 +55,6 @@ exports.PanelsData = Montage.create(Montage, {
58 scrollable: true, 55 scrollable: true,
59 collapsed: true, 56 collapsed: true,
60 open: true, 57 open: true,
61 contentComponent: null,
62 modulePath: "js/panels/Components/ComponentsPanelBase.reel", 58 modulePath: "js/panels/Components/ComponentsPanelBase.reel",
63 moduleName: "ComponentsPanelBase" 59 moduleName: "ComponentsPanelBase"
64 }, 60 },
@@ -71,7 +67,6 @@ exports.PanelsData = Montage.create(Montage, {
71// scrollable: true, 67// scrollable: true,
72// collapsed: false, 68// collapsed: false,
73// open: true, 69// open: true,
74// content: null,
75// modulePath: "js/panels/Project/projectpanelbase.reel", 70// modulePath: "js/panels/Project/projectpanelbase.reel",
76// moduleName: "ProjectPanelBase" 71// moduleName: "ProjectPanelBase"
77// }, 72// },
@@ -84,7 +79,6 @@ exports.PanelsData = Montage.create(Montage, {
84 scrollable: true, 79 scrollable: true,
85 collapsed: true, 80 collapsed: true,
86 open: true, 81 open: true,
87 contentComponent: null,
88 modulePath: "js/panels/CSSPanel/CSSPanelBase.reel", 82 modulePath: "js/panels/CSSPanel/CSSPanelBase.reel",
89 moduleName: "CSSPanelBase" 83 moduleName: "CSSPanelBase"
90 }, 84 },
@@ -97,7 +91,6 @@ exports.PanelsData = Montage.create(Montage, {
97 collapsed: true, 91 collapsed: true,
98 scrollable: true, 92 scrollable: true,
99 open: true, 93 open: true,
100 contentComponent: null,
101 modulePath: "js/panels/presets/content.reel", 94 modulePath: "js/panels/presets/content.reel",
102 moduleName: "content" 95 moduleName: "content"
103 } 96 }
@@ -118,24 +111,6 @@ exports.PanelsData = Montage.create(Montage, {
118 this._panelOrder = val; 111 this._panelOrder = val;
119 } 112 }
120 } 113 }
121
122
123 panels: {
124