aboutsummaryrefslogtreecommitdiff
path: root/js/document/text-document.js
diff options
context:
space:
mode:
authorJose Antonio Marquez2012-05-24 00:07:23 -0700
committerJose Antonio Marquez2012-05-24 00:07:23 -0700
commit5914c5b2209c4b8daac4249bb76cda5c9314c4e6 (patch)
treef0910e57f64d1638f00bf7f6449d479fb377bfac /js/document/text-document.js
parent16decc5726eafbb25675c61be6df85a378ac1fac (diff)
downloadninja-5914c5b2209c4b8daac4249bb76cda5c9314c4e6.tar.gz
Cleaning up referencing to 'documentRoot' and '_document'
Moved to reference new model in DOM architecture rework. This should not affect anything, just moving the references, and also the setting to the render methods in the design view.
Diffstat (limited to 'js/document/text-document.js')
-rwxr-xr-xjs/document/text-document.js198
1 files changed, 0 insertions, 198 deletions
diff --git a/js/document/text-document.js b/js/document/text-document.js
deleted file mode 100755
index 2574b67c..00000000
--- a/js/document/text-document.js
+++ /dev/null
@@ -1,198 +0,0 @@
1/* <copyright>
2This file contains proprietary software owned by Motorola Mobility, Inc.<br/>
3No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/>
4(c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved.
5</copyright> */
6
7//BaseDocument Object for all files types and base class for HTML documents.
8
9var Montage = require("montage/core/core").Montage,
10 Component = require("montage/ui/component").Component;
11
12var TextDocument = exports.TextDocument = Montage.create(Component, {
13
14
15 //TODO: Clean up, test
16
17
18
19
20
21 ////////////////////////////////////////////////////////////////////
22 ////////////////////////////////////////////////////////////////////
23 ////////////////////////////////////////////////////////////////////
24 ////////////////////////////////////////////////////////////////////
25 //Taken from text-document, which shouldn't be needed
26
27 // PRIVATE MEMBERS
28 _codeEditor: {
29 value: {
30 "editor": { value: null, enumerable: false }
31
32 }
33 },
34
35 _editor: { value: null, enumerable: false },
36 _hline: { value: null, enumerable: false },
37
38 _textArea: {value: null, enumerable: false },
39
40 _userDocument: {value: null, enumerable: false },
41
42 _source: { value: null, enumerable: false},
43
44 source: {
45 get: function() { return this._source;},
46 set: function(value) { this._source = value;}
47 },
48
49 // PUBLIC MEMBERS
50
51 _savedLeftScroll: {value:null},
52 _savedTopScroll: {value:null},
53
54 //****************************************//
55 //PUBLIC API
56
57
58 // GETTERS / SETTERS
59
60 savedLeftScroll:{
61 get: function() { return this._savedLeftScroll; },
62 set: function(value) { this._savedLeftScroll = value}
63 },
64
65 savedTopScroll:{
66 get: function() { return this._savedTopScroll; },
67 set: function(value) { this._savedTopScroll = value}
68 },
69
70 textArea: {
71 get: function() { return this._textArea; },
72 set: function(value) { this._textArea = value; }
73 },
74 editor: {
75 get: function() { return this._editor; },
76 set: function(value) { this._editor = value}
77 },
78
79 hline: {
80 get: function() { return this._hline; },
81 set: function(value) {this._hline = value; }
82 },
83
84
85 ////////////////////////////////////////////////////////////////////
86 //
87 initialize: {
88 value: function(file, uuid, textArea, container, callback) {
89 //
90 this._userDocument = file;
91 //
92 this.init(file.name, file.uri, file.extension, container, uuid, callback);
93 //
94 this.currentView = "code";
95 this.textArea = textArea;
96 }
97 },
98 ////////////////////////////////////////////////////////////////////
99 //
100 save: {
101 enumerable: false,
102 value: function () {
103 //TODO: Improve sequence
104 this.editor.save();
105 return {mode: this._userDocument.extension, document: this._userDocument, content: this.textArea.value};
106 }
107 },
108 ////////////////////////////////////////////////////////////////////
109 ////////////////////////////////////////////////////////////////////
110 ////////////////////////////////////////////////////////////////////
111 ////////////////////////////////////////////////////////////////////
112
113
114
115
116
117
118
119
120
121
122 /** Private Members **/
123 _name: { value: null, enumerable: false },
124 _uri: { value: null, enumerable: false },
125 _documentType: { value: null, enumerable: false },
126 _container: { value: null, enumerable: false },
127 _uuid: { value: null, enumerable: false },
128 _isActive: { value: true, enumerable: false },
129 _needsSave: { value: false, enumarable: false },
130 _callback: { value: null, enumerable: false },
131 _currentView: { value: null, enumerable: false},
132
133 /** Getters/Setters **/
134 name: {
135 get: function() { return this._name; },
136 set: function(value) { this._name = value; }
137 },
138
139 uri: {
140 get: function() { return this._uri; },
141 set: function(value) { this._uri = value; }
142 },
143
144 documentType: {
145 get: function() { return this._documentType; },
146 set: function(value) { this._documentType = value; }
147 },
148
149 container: {
150 get: function() { return this._container; },
151 set: function(value) { this._container = value; }
152 },
153
154 uuid: {
155 get: function() { return this._uuid; },
156 set: function(value) { this._uuid = value; }
157 },
158
159 isActive: {
160 get: function() { return this._isActive; },
161 set: function(value) { this._isActive = value; }
162 },
163
164 needsSave: {
165 get: function() { return this._needsSave; },
166 set: function(value) {
167 this._needsSave = value;
168 }
169 },
170
171 callback: {
172 get: function() { return this._callback; },
173 set: function(value) { this._callback = value; }
174 },
175
176 currentView: {
177 get: function() { return this._currentView; },
178 set: function(value) { this._currentView = value }
179 },
180
181 /** Base Methods **/
182 init: {
183 value: function(name, uri, type, container, uuid, callback) {
184 this.name = name;
185 this.uri = uri;
186 this.documentType = type;
187 this.container = container;
188 this.uuid = uuid;
189 this.callback = callback;
190 }
191 },
192
193 loadDocument: {
194 value: function() {
195 // Have the XHR here?
196 }
197 }
198}); \ No newline at end of file