From 68ce64a5a2f4a71b54d33916aaf1d57161302425 Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Tue, 14 Feb 2012 20:48:40 -0800 Subject: Reverting text/html document classes and setting up MVC folder structure Setting up the folder structure for the proposed set up for documents in Ninja. Reverted to have a temp HTML/Text document class. Tweak some UI for file pickers. --- js/document/text-document.js | 204 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 204 insertions(+) create mode 100755 js/document/text-document.js (limited to 'js/document/text-document.js') diff --git a/js/document/text-document.js b/js/document/text-document.js new file mode 100755 index 00000000..f2b7b0d8 --- /dev/null +++ b/js/document/text-document.js @@ -0,0 +1,204 @@ +/* +This file contains proprietary software owned by Motorola Mobility, Inc.
+No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.
+(c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. +
*/ + +//BaseDocument Object for all files types and base class for HTML documents. + +var Montage = require("montage/core/core").Montage; + +var TextDocument = exports.TextDocument = Montage.create(Montage, { + + + //TODO: Clean up, test + + + + + + //////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////// + //Taken from text-document, which shouldn't be needed + + // PRIVATE MEMBERS + _codeEditor: { + value: { + "editor": { value: null, enumerable: false }, + + } + }, + + _editor: { value: null, enumerable: false }, + _hline: { value: null, enumerable: false }, + + _textArea: {value: null, enumerable: false }, + + _userDocument: {value: null, enumerable: false }, + + _source: { value: null, enumerable: false}, + + source: { + get: function() { return this._source;}, + set: function(value) { this._source = value;} + }, + + // PUBLIC MEMBERS + + _savedLeftScroll: {value:null}, + _savedTopScroll: {value:null}, + + //****************************************// + //PUBLIC API + + + // GETTERS / SETTERS + + savedLeftScroll:{ + get: function() { return this._savedLeftScroll; }, + set: function(value) { this._savedLeftScroll = value} + }, + + savedTopScroll:{ + get: function() { return this._savedTopScroll; }, + set: function(value) { this._savedTopScroll = value} + }, + + textArea: { + get: function() { return this._textArea; }, + set: function(value) { this._textArea = value; } + }, + editor: { + get: function() { return this._editor; }, + set: function(value) { this._editor = value} + }, + + hline: { + get: function() { return this._hline; }, + set: function(value) {this._hline = value; } + }, + + + //////////////////////////////////////////////////////////////////// + // + initialize: { + value: function(file, uuid, textArea, container, callback) { + // + this._userDocument = file; + // + this.init(file.name, file.uri, file.extension, container, uuid, callback); + // + this.currentView = "code"; + this.textArea = textArea; + } + }, + //////////////////////////////////////////////////////////////////// + // + save: { + enumerable: false, + value: function () { + //TODO: Improve sequence + this.editor.save(); + return {mode: this._userDocument.extension, document: this._userDocument, content: this.textArea.value}; + } + }, + //////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////// + + + + + + + + + + + /** Private Members **/ + _name: { value: null, enumerable: false }, + _uri: { value: null, enumerable: false }, + _documentType: { value: null, enumerable: false }, + _container: {value: null, enumerable: false }, + _uuid: { value: null, enumerable: false }, + _isActive: { value: true, enumerable: false }, + _dirtyFlag: { value: false, enumerable: false }, + _callback: { value: null, enumerable: false }, + _currentView: { value: null, enumerable: false}, + + /** Getters/Setters **/ + name: { + get: function() { return this._name; }, + set: function(value) { this._name = value; } + }, + + uri: { + get: function() { return this._uri; }, + set: function(value) { this._uri = value; } + }, + + documentType: { + get: function() { return this._documentType; }, + set: function(value) { this._documentType = value; } + }, + + container: { + get: function() { return this._container; }, + set: function(value) { this._container = value; } + }, + + uuid: { + get: function() { return this._uuid; }, + set: function(value) { this._uuid = value; } + }, + + isActive: { + get: function() { return this._isActive; }, + set: function(value) { this._isActive = value; } + }, + + dirtyFlag: { + get: function() { return this._dirtyFlag; }, + set: function(value) { this._dirtyFlag = value; } + }, + + callback: { + get: function() { return this._callback; }, + set: function(value) { this._callback = value; } + }, + + currentView: { + get: function() { return this._currentView; }, + set: function(value) { this._currentView = value } + }, + + /** Base Methods **/ + init: { + value: function(name, uri, type, container, uuid, callback) { + this.name = name; + this.uri = uri; + this.documentType = type; + this.container = container; + this.uuid = uuid; + this.callback = callback; + } + }, + + loadDocument: { + value: function() { + // Have the XHR here? + } + }/* +, + + save:{ + value:function(){ + //base function - to be overridden + } + } +*/ + +}); \ No newline at end of file -- cgit v1.2.3 From e327eccb93e2bc513fcbb7ab302783d6bce83884 Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Tue, 14 Feb 2012 22:30:51 -0800 Subject: Creating NinjaTemplate to HTML function This function will need to be cleaned up and possibly moved once the MVC structure is in-place for the document. --- js/document/text-document.js | 9 --------- 1 file changed, 9 deletions(-) (limited to 'js/document/text-document.js') diff --git a/js/document/text-document.js b/js/document/text-document.js index f2b7b0d8..6f8efaad 100755 --- a/js/document/text-document.js +++ b/js/document/text-document.js @@ -191,14 +191,5 @@ var TextDocument = exports.TextDocument = Montage.create(Montage, { value: function() { // Have the XHR here? } - }/* -, - - save:{ - value:function(){ - //base function - to be overridden - } } -*/ - }); \ No newline at end of file -- cgit v1.2.3 From 2e308be9bec5e06d81b2905b65005a232f0a190d Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Wed, 15 Feb 2012 09:50:20 -0800 Subject: Revert "Creating NinjaTemplate to HTML function" This reverts commit e327eccb93e2bc513fcbb7ab302783d6bce83884. Signed-off-by: Ananya Sen --- js/document/text-document.js | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'js/document/text-document.js') diff --git a/js/document/text-document.js b/js/document/text-document.js index 6f8efaad..f2b7b0d8 100755 --- a/js/document/text-document.js +++ b/js/document/text-document.js @@ -191,5 +191,14 @@ var TextDocument = exports.TextDocument = Montage.create(Montage, { value: function() { // Have the XHR here? } + }/* +, + + save:{ + value:function(){ + //base function - to be overridden + } } +*/ + }); \ No newline at end of file -- cgit v1.2.3 From 9048cd50bf5e0a418d1d95498bb593961f72db36 Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Wed, 15 Feb 2012 09:51:12 -0800 Subject: Revert "Reverting text/html document classes and setting up MVC folder structure" This reverts commit 68ce64a5a2f4a71b54d33916aaf1d57161302425. Signed-off-by: Ananya Sen --- js/document/text-document.js | 204 ------------------------------------------- 1 file changed, 204 deletions(-) delete mode 100755 js/document/text-document.js (limited to 'js/document/text-document.js') diff --git a/js/document/text-document.js b/js/document/text-document.js deleted file mode 100755 index f2b7b0d8..00000000 --- a/js/document/text-document.js +++ /dev/null @@ -1,204 +0,0 @@ -/* -This file contains proprietary software owned by Motorola Mobility, Inc.
-No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.
-(c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. -
*/ - -//BaseDocument Object for all files types and base class for HTML documents. - -var Montage = require("montage/core/core").Montage; - -var TextDocument = exports.TextDocument = Montage.create(Montage, { - - - //TODO: Clean up, test - - - - - - //////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////// - //Taken from text-document, which shouldn't be needed - - // PRIVATE MEMBERS - _codeEditor: { - value: { - "editor": { value: null, enumerable: false }, - - } - }, - - _editor: { value: null, enumerable: false }, - _hline: { value: null, enumerable: false }, - - _textArea: {value: null, enumerable: false }, - - _userDocument: {value: null, enumerable: false }, - - _source: { value: null, enumerable: false}, - - source: { - get: function() { return this._source;}, - set: function(value) { this._source = value;} - }, - - // PUBLIC MEMBERS - - _savedLeftScroll: {value:null}, - _savedTopScroll: {value:null}, - - //****************************************// - //PUBLIC API - - - // GETTERS / SETTERS - - savedLeftScroll:{ - get: function() { return this._savedLeftScroll; }, - set: function(value) { this._savedLeftScroll = value} - }, - - savedTopScroll:{ - get: function() { return this._savedTopScroll; }, - set: function(value) { this._savedTopScroll = value} - }, - - textArea: { - get: function() { return this._textArea; }, - set: function(value) { this._textArea = value; } - }, - editor: { - get: function() { return this._editor; }, - set: function(value) { this._editor = value} - }, - - hline: { - get: function() { return this._hline; }, - set: function(value) {this._hline = value; } - }, - - - //////////////////////////////////////////////////////////////////// - // - initialize: { - value: function(file, uuid, textArea, container, callback) { - // - this._userDocument = file; - // - this.init(file.name, file.uri, file.extension, container, uuid, callback); - // - this.currentView = "code"; - this.textArea = textArea; - } - }, - //////////////////////////////////////////////////////////////////// - // - save: { - enumerable: false, - value: function () { - //TODO: Improve sequence - this.editor.save(); - return {mode: this._userDocument.extension, document: this._userDocument, content: this.textArea.value}; - } - }, - //////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////// - - - - - - - - - - - /** Private Members **/ - _name: { value: null, enumerable: false }, - _uri: { value: null, enumerable: false }, - _documentType: { value: null, enumerable: false }, - _container: {value: null, enumerable: false }, - _uuid: { value: null, enumerable: false }, - _isActive: { value: true, enumerable: false }, - _dirtyFlag: { value: false, enumerable: false }, - _callback: { value: null, enumerable: false }, - _currentView: { value: null, enumerable: false}, - - /** Getters/Setters **/ - name: { - get: function() { return this._name; }, - set: function(value) { this._name = value; } - }, - - uri: { - get: function() { return this._uri; }, - set: function(value) { this._uri = value; } - }, - - documentType: { - get: function() { return this._documentType; }, - set: function(value) { this._documentType = value; } - }, - - container: { - get: function() { return this._container; }, - set: function(value) { this._container = value; } - }, - - uuid: { - get: function() { return this._uuid; }, - set: function(value) { this._uuid = value; } - }, - - isActive: { - get: function() { return this._isActive; }, - set: function(value) { this._isActive = value; } - }, - - dirtyFlag: { - get: function() { return this._dirtyFlag; }, - set: function(value) { this._dirtyFlag = value; } - }, - - callback: { - get: function() { return this._callback; }, - set: function(value) { this._callback = value; } - }, - - currentView: { - get: function() { return this._currentView; }, - set: function(value) { this._currentView = value } - }, - - /** Base Methods **/ - init: { - value: function(name, uri, type, container, uuid, callback) { - this.name = name; - this.uri = uri; - this.documentType = type; - this.container = container; - this.uuid = uuid; - this.callback = callback; - } - }, - - loadDocument: { - value: function() { - // Have the XHR here? - } - }/* -, - - save:{ - value:function(){ - //base function - to be overridden - } - } -*/ - -}); \ No newline at end of file -- cgit v1.2.3 From e2b97c951a9a5a0c4ff831d44fdd82177cbd82ad Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Wed, 15 Feb 2012 10:54:14 -0800 Subject: Revert "Revert "Reverting text/html document classes and setting up MVC folder structure"" This reverts commit 9048cd50bf5e0a418d1d95498bb593961f72db36. Signed-off-by: Ananya Sen --- js/document/text-document.js | 204 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 204 insertions(+) create mode 100755 js/document/text-document.js (limited to 'js/document/text-document.js') diff --git a/js/document/text-document.js b/js/document/text-document.js new file mode 100755 index 00000000..f2b7b0d8 --- /dev/null +++ b/js/document/text-document.js @@ -0,0 +1,204 @@ +/* +This file contains proprietary software owned by Motorola Mobility, Inc.
+No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.
+(c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. +
*/ + +//BaseDocument Object for all files types and base class for HTML documents. + +var Montage = require("montage/core/core").Montage; + +var TextDocument = exports.TextDocument = Montage.create(Montage, { + + + //TODO: Clean up, test + + + + + + //////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////// + //Taken from text-document, which shouldn't be needed + + // PRIVATE MEMBERS + _codeEditor: { + value: { + "editor": { value: null, enumerable: false }, + + } + }, + + _editor: { value: null, enumerable: false }, + _hline: { value: null, enumerable: false }, + + _textArea: {value: null, enumerable: false }, + + _userDocument: {value: null, enumerable: false }, + + _source: { value: null, enumerable: false}, + + source: { + get: function() { return this._source;}, + set: function(value) { this._source = value;} + }, + + // PUBLIC MEMBERS + + _savedLeftScroll: {value:null}, + _savedTopScroll: {value:null}, + + //****************************************// + //PUBLIC API + + + // GETTERS / SETTERS + + savedLeftScroll:{ + get: function() { return this._savedLeftScroll; }, + set: function(value) { this._savedLeftScroll = value} + }, + + savedTopScroll:{ + get: function() { return this._savedTopScroll; }, + set: function(value) { this._savedTopScroll = value} + }, + + textArea: { + get: function() { return this._textArea; }, + set: function(value) { this._textArea = value; } + }, + editor: { + get: function() { return this._editor; }, + set: function(value) { this._editor = value} + }, + + hline: { + get: function() { return this._hline; }, + set: function(value) {this._hline = value; } + }, + + + //////////////////////////////////////////////////////////////////// + // + initialize: { + value: function(file, uuid, textArea, container, callback) { + // + this._userDocument = file; + // + this.init(file.name, file.uri, file.extension, container, uuid, callback); + // + this.currentView = "code"; + this.textArea = textArea; + } + }, + //////////////////////////////////////////////////////////////////// + // + save: { + enumerable: false, + value: function () { + //TODO: Improve sequence + this.editor.save(); + return {mode: this._userDocument.extension, document: this._userDocument, content: this.textArea.value}; + } + }, + //////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////// + + + + + + + + + + + /** Private Members **/ + _name: { value: null, enumerable: false }, + _uri: { value: null, enumerable: false }, + _documentType: { value: null, enumerable: false }, + _container: {value: null, enumerable: false }, + _uuid: { value: null, enumerable: false }, + _isActive: { value: true, enumerable: false }, + _dirtyFlag: { value: false, enumerable: false }, + _callback: { value: null, enumerable: false }, + _currentView: { value: null, enumerable: false}, + + /** Getters/Setters **/ + name: { + get: function() { return this._name; }, + set: function(value) { this._name = value; } + }, + + uri: { + get: function() { return this._uri; }, + set: function(value) { this._uri = value; } + }, + + documentType: { + get: function() { return this._documentType; }, + set: function(value) { this._documentType = value; } + }, + + container: { + get: function() { return this._container; }, + set: function(value) { this._container = value; } + }, + + uuid: { + get: function() { return this._uuid; }, + set: function(value) { this._uuid = value; } + }, + + isActive: { + get: function() { return this._isActive; }, + set: function(value) { this._isActive = value; } + }, + + dirtyFlag: { + get: function() { return this._dirtyFlag; }, + set: function(value) { this._dirtyFlag = value; } + }, + + callback: { + get: function() { return this._callback; }, + set: function(value) { this._callback = value; } + }, + + currentView: { + get: function() { return this._currentView; }, + set: function(value) { this._currentView = value } + }, + + /** Base Methods **/ + init: { + value: function(name, uri, type, container, uuid, callback) { + this.name = name; + this.uri = uri; + this.documentType = type; + this.container = container; + this.uuid = uuid; + this.callback = callback; + } + }, + + loadDocument: { + value: function() { + // Have the XHR here? + } + }/* +, + + save:{ + value:function(){ + //base function - to be overridden + } + } +*/ + +}); \ No newline at end of file -- cgit v1.2.3 From 56d2a8d11a73cd04c7f1bc20d1ded52b9c1242f2 Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Wed, 15 Feb 2012 10:54:38 -0800 Subject: Revert "Revert "Creating NinjaTemplate to HTML function"" This reverts commit 2e308be9bec5e06d81b2905b65005a232f0a190d. Signed-off-by: Ananya Sen --- js/document/text-document.js | 9 --------- 1 file changed, 9 deletions(-) (limited to 'js/document/text-document.js') diff --git a/js/document/text-document.js b/js/document/text-document.js index f2b7b0d8..6f8efaad 100755 --- a/js/document/text-document.js +++ b/js/document/text-document.js @@ -191,14 +191,5 @@ var TextDocument = exports.TextDocument = Montage.create(Montage, { value: function() { // Have the XHR here? } - }/* -, - - save:{ - value:function(){ - //base function - to be overridden - } } -*/ - }); \ No newline at end of file -- cgit v1.2.3 From a7e3ef9f80d5e29515c9f8dd5374c89b9d2496de Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Fri, 17 Feb 2012 12:39:12 -0800 Subject: use method to update dirtyFlag Signed-off-by: Ananya Sen --- js/document/text-document.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'js/document/text-document.js') diff --git a/js/document/text-document.js b/js/document/text-document.js index 6f8efaad..f74742ad 100755 --- a/js/document/text-document.js +++ b/js/document/text-document.js @@ -191,5 +191,17 @@ var TextDocument = exports.TextDocument = Montage.create(Montage, { value: function() { // Have the XHR here? } + }, + + markDocumentEditted:{ + value: function() { + this.dirtyFlag = true; + } + }, + + markDocumentUneditted:{ + value: function() { + this.dirtyFlag = false; + } } }); \ No newline at end of file -- cgit v1.2.3 From 96178309ddcdb54c0c451b69ea6fb8cdf76fcf62 Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Fri, 17 Feb 2012 12:54:07 -0800 Subject: renamed methods to use better words Signed-off-by: Ananya Sen --- js/document/text-document.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'js/document/text-document.js') diff --git a/js/document/text-document.js b/js/document/text-document.js index f74742ad..5c731bcf 100755 --- a/js/document/text-document.js +++ b/js/document/text-document.js @@ -26,7 +26,7 @@ var TextDocument = exports.TextDocument = Montage.create(Montage, { // PRIVATE MEMBERS _codeEditor: { value: { - "editor": { value: null, enumerable: false }, + "editor": { value: null, enumerable: false } } }, @@ -193,13 +193,13 @@ var TextDocument = exports.TextDocument = Montage.create(Montage, { } }, - markDocumentEditted:{ + markEdited:{ value: function() { this.dirtyFlag = true; } }, - markDocumentUneditted:{ + markUnedited:{ value: function() { this.dirtyFlag = false; } -- cgit v1.2.3 From a42c536c2b3209afc058eabd31167bd0aa6f71c8 Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Fri, 17 Feb 2012 13:40:38 -0800 Subject: Adding webRequest redirects for iFrame templates --- js/document/text-document.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'js/document/text-document.js') diff --git a/js/document/text-document.js b/js/document/text-document.js index 6f8efaad..3e20e1f6 100755 --- a/js/document/text-document.js +++ b/js/document/text-document.js @@ -6,9 +6,10 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot //BaseDocument Object for all files types and base class for HTML documents. -var Montage = require("montage/core/core").Montage; +var Montage = require("montage/core/core").Montage, + Component = require("montage/ui/component").Component; -var TextDocument = exports.TextDocument = Montage.create(Montage, { +var TextDocument = exports.TextDocument = Montage.create(Component, { //TODO: Clean up, test -- cgit v1.2.3 From b1daf0b285a4a96bfd0086709c20e3682d75551a Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Tue, 21 Feb 2012 14:32:17 -0800 Subject: fixing the dirty flag and removing sass changes Signed-off-by: Valerio Virgillito --- js/document/text-document.js | 36 ++++++++++++------------------------ 1 file changed, 12 insertions(+), 24 deletions(-) (limited to 'js/document/text-document.js') diff --git a/js/document/text-document.js b/js/document/text-document.js index 1132ba65..88464d87 100755 --- a/js/document/text-document.js +++ b/js/document/text-document.js @@ -120,15 +120,15 @@ var TextDocument = exports.TextDocument = Montage.create(Component, { /** Private Members **/ - _name: { value: null, enumerable: false }, - _uri: { value: null, enumerable: false }, - _documentType: { value: null, enumerable: false }, - _container: {value: null, enumerable: false }, - _uuid: { value: null, enumerable: false }, - _isActive: { value: true, enumerable: false }, - _dirtyFlag: { value: false, enumerable: false }, - _callback: { value: null, enumerable: false }, - _currentView: { value: null, enumerable: false}, + _name: { value: null, enumerable: false }, + _uri: { value: null, enumerable: false }, + _documentType: { value: null, enumerable: false }, + _container: { value: null, enumerable: false }, + _uuid: { value: null, enumerable: false }, + _isActive: { value: true, enumerable: false }, + _needsSave: { value: false, enumarable: false }, + _callback: { value: null, enumerable: false }, + _currentView: { value: null, enumerable: false}, /** Getters/Setters **/ name: { @@ -161,9 +161,9 @@ var TextDocument = exports.TextDocument = Montage.create(Component, { set: function(value) { this._isActive = value; } }, - dirtyFlag: { - get: function() { return this._dirtyFlag; }, - set: function(value) { this._dirtyFlag = value; } + needsSave: { + get: function() { return this._needsSave; }, + set: function(value) { this._needsSave = value } }, callback: { @@ -192,17 +192,5 @@ var TextDocument = exports.TextDocument = Montage.create(Component, { value: function() { // Have the XHR here? } - }, - - markEdited:{ - value: function() { - this.dirtyFlag = true; - } - }, - - markUnedited:{ - value: function() { - this.dirtyFlag = false; - } } }); \ No newline at end of file -- cgit v1.2.3