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