From 0e1a276f19ea70009c5a649e9667861d7c346a7e Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Wed, 6 Jun 2012 00:25:27 -0700 Subject: first iteration of adding serializable to ninja plus other changes to run the latest montage Signed-off-by: Valerio Virgillito --- js/ninja.reel/ninja.js | 160 +++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 155 insertions(+), 5 deletions(-) (limited to 'js/ninja.reel/ninja.js') diff --git a/js/ninja.reel/ninja.js b/js/ninja.reel/ninja.js index a12270a0..e4f447d2 100755 --- a/js/ninja.reel/ninja.js +++ b/js/ninja.reel/ninja.js @@ -14,22 +14,172 @@ var NjUtils = require("js/lib/NJUtils").NJUtils; exports.Ninja = Montage.create(Component, { - ninjaVersion: { - value: null + // SERIALIZABLE Properties + ////////////////////////////// + rulerTop: { + value: null, + serializable: true + }, + + rulerLeft: { + value: null, + serializable: true + }, + + appModel: { + value: null, + serializable: true }, toolsData: { - value: null + value: null, + serializable: true }, - appData: { - value: AppData + toolsList: { + value: null, + serializable: true + }, + + toolsProperties: { + value: null, + serializable: true + }, + + stage: { + value: null, + serializable: true + }, + + elementMediator: { + value: null, + serializable: true + }, + + dragDropMediator: { + value: null, + serializable: true + }, + + undocontroller: { + value: null, + serializable: true + }, + + selectionController: { + value: null, + serializable: true + }, + + documentController: { + value: null, + serializable: true + }, + + popupManager: { + value: null, + serializable: true + }, + + colorController: { + value: null, + serializable: true + }, + + stylesController: { + value: null, + serializable: true + }, + + presetsController: { + value: null, + serializable: true + }, + + filePickerController: { + value: null, + serializable: true + }, + + newFileController: { + value: null, + serializable: true + }, + + coreIoApi: { + value: null, + serializable: true + }, + + documentBar: { + value: null, + serializable: true + }, + + editorViewOptions: { + value: null, + serializable: true + }, + + ioMediator: { + value: null, + serializable: true + }, + + timeline: { + value: null, + serializable: true + }, + + mainMenuController: { + value: null, + serializable: true + }, + + codeEditorController: { + value: null, + serializable: true + }, + + rightPanelContainer: { + value: null, + serializable: true + }, + + panelSplitter: { + value: null, + serializable: true + }, + + timelineSplitter: { + value: null, + serializable: true + }, + + toolsSplitter: { + value: null, + serializable: true + }, + + optionsSplitter: { + value: null, + serializable: true }, documentList: { + value: null, + serializable: true + }, + ////////////////////////////// + + ninjaVersion: { value: null }, + appData: { + value: AppData + }, + currentDocument: { get: function() { if(this.documentList.selectedObjects) { -- cgit v1.2.3 From 806974142d44afdd23534bf2d18eff0a8e701e0c Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Fri, 8 Jun 2012 16:59:59 -0700 Subject: rewrite: currentSelectedContainer -> domContainer Fixed the currentSelectedContainer by removing bindings and using property change on the current document added the red outline back. Signed-off-by: Valerio Virgillito --- js/ninja.reel/ninja.js | 20 -------------------- 1 file changed, 20 deletions(-) (limited to 'js/ninja.reel/ninja.js') diff --git a/js/ninja.reel/ninja.js b/js/ninja.reel/ninja.js index 38f5efcf..b57aecd2 100755 --- a/js/ninja.reel/ninja.js +++ b/js/ninja.reel/ninja.js @@ -147,21 +147,6 @@ exports.Ninja = Montage.create(Component, { value: [] }, - _currentSelectedContainer: { - value: null - }, - - currentSelectedContainer: { - get: function() { - return this._currentSelectedContainer; - }, - set: function(value) { - if(value !== this._currentSelectedContainer) { - this._currentSelectedContainer = value; - } - } - }, - templateDidLoad: { value: function() { this.ninjaVersion = window.ninjaVersion.ninja.version; @@ -321,11 +306,6 @@ exports.Ninja = Montage.create(Component, { // TODO: Remove this when integrating the next montage this.documentList.selectedObjects = [doc]; - if(doc.currentView === "design") { - // TODO: Bind directly to the model of the document in components instead of this property - this._currentSelectedContainer = null; - this.currentSelectedContainer = doc.model.documentRoot; - } } }, -- cgit v1.2.3 From c629361d7182d5f4727caeab7c2b0822f33187c7 Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Mon, 11 Jun 2012 15:43:31 -0700 Subject: Adding close Ninja prompt Adding a prompt to the user to ensure all data is saved prior to closing the application. This will not let me check for documents to need saving, so it must be general and will appear at all times. --- js/ninja.reel/ninja.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'js/ninja.reel/ninja.js') diff --git a/js/ninja.reel/ninja.js b/js/ninja.reel/ninja.js index 38f5efcf..f0f8b46d 100755 --- a/js/ninja.reel/ninja.js +++ b/js/ninja.reel/ninja.js @@ -184,6 +184,10 @@ exports.Ninja = Montage.create(Component, { this.setupGlobalHelpers(); window.addEventListener("resize", this, false); + //Prompting the user to make sure data was saved before closing Ninja + window.onbeforeunload = function () { + return 'Are you sure you want to close Ninja? Any unsaved data will be lost.'; + }; this.eventManager.addEventListener("selectTool", this, false); this.eventManager.addEventListener("selectSubTool", this, false); -- cgit v1.2.3 From 16d859a284805cd8bf14187fd421b6a14e6d8912 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Tue, 12 Jun 2012 15:12:27 -0700 Subject: remove serializable from custom section Signed-off-by: Valerio Virgillito --- js/ninja.reel/ninja.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'js/ninja.reel/ninja.js') diff --git a/js/ninja.reel/ninja.js b/js/ninja.reel/ninja.js index 8b874a36..c7bdfc0e 100755 --- a/js/ninja.reel/ninja.js +++ b/js/ninja.reel/ninja.js @@ -452,8 +452,7 @@ exports.Ninja = Montage.create(Component, { openDocument: { value: function(doc) { this.documentList.content.push(doc); - // This is not needed with the latest 0.10 montage. - // TODO: Remove this when integrating the next montage + // TODO: Check why this is still needed this.documentList.selectedObjects = [doc]; } -- cgit v1.2.3