aboutsummaryrefslogtreecommitdiff
path: root/js/io
diff options
context:
space:
mode:
Diffstat (limited to 'js/io')
-rwxr-xr-xjs/io/document/base-document.js93
-rwxr-xr-xjs/io/document/html-document.js500
-rwxr-xr-xjs/io/document/text-document.js156
-rwxr-xr-xjs/io/system/coreioapi.js18
-rw-r--r--js/io/system/ninjalibrary.js25
-rw-r--r--js/io/system/ninjalibrary.json5
-rw-r--r--js/io/ui/save-as-dialog.reel/save-as-dialog.css57
-rw-r--r--js/io/ui/save-as-dialog.reel/save-as-dialog.html4
8 files changed, 64 insertions, 794 deletions
diff --git a/js/io/document/base-document.js b/js/io/document/base-document.js
deleted file mode 100755
index 918b51ad..00000000
--- a/js/io/document/base-document.js
+++ /dev/null
@@ -1,93 +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
11var BaseDocument = exports.BaseDocument = Montage.create(Montage, {
12 /** Private Members **/
13 _name: { value: null, enumerable: false },
14 _uri: { value: null, enumerable: false },
15 _documentType: { value: null, enumerable: false },
16 _container: {value: null, enumerable: false },
17 _uuid: { value: null, enumerable: false },
18 _isActive: { value: true, enumerable: false },
19 _dirtyFlag: { value: false, enumerable: false },
20 _callback: { value: null, enumerable: false },
21 _currentView: { value: null, enumerable: false},
22
23 /** Getters/Setters **/
24 name: {
25 get: function() { return this._name; },
26 set: function(value) { this._name = value; }
27 },
28
29 uri: {
30 get: function() { return this._uri; },
31 set: function(value) { this._uri = value; }
32 },
33
34 documentType: {
35 get: function() { return this._documentType; },
36 set: function(value) { this._documentType = value; }
37 },
38
39 container: {
40 get: function() { return this._container; },
41 set: function(value) { this._container = value; }
42 },
43
44 uuid: {
45 get: function() { return this._uuid; },
46 set: function(value) { this._uuid = value; }
47 },
48
49 isActive: {
50 get: function() { return this._isActive; },
51 set: function(value) { this._isActive = value; }
52 },
53
54 dirtyFlag: {
55 get: function() { return this._dirtyFlag; },
56 set: function(value) { this._dirtyFlag = value; }
57 },
58
59 callback: {
60 get: function() { return this._callback; },
61 set: function(value) { this._callback = value; }
62 },
63
64 currentView: {
65 get: function() { return this._currentView; },
66 set: function(value) { this._currentView = value }
67 },
68
69 /** Base Methods **/
70 init: {
71 value: function(name, uri, type, container, uuid, callback) {
72 this.name = name;
73 this.uri = uri;
74 this.documentType = type;
75 this.container = container;
76 this.uuid = uuid;
77 this.callback = callback;
78 }
79 },
80
81 loadDocument: {
82 value: function() {
83 // Have the XHR here?
84 }
85 },
86
87 save:{
88 value:function(){
89 //base function - to be overridden
90 }
91 }
92
93}); \ No newline at end of file
diff --git a/js/io/document/html-document.js b/js/io/document/html-document.js
deleted file mode 100755
index 88cfec67..00000000
--- a/js/io/document/html-document.js
+++ /dev/null
@@ -1,500 +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////////////////////////////////////////////////////////////////////////
8//
9var Montage = require("montage/core/core").Montage,
10 BaseDocument = require("js/io/document/base-document").BaseDocument,
11 NJUtils = require("js/lib/NJUtils").NJUtils;
12////////////////////////////////////////////////////////////////////////
13//
14exports.HTMLDocument = Montage.create(BaseDocument, {
15 // PRIVATE MEMBERS
16 _selectionExclude: { value: null, enumerable: false },
17 _htmlTemplateUrl: { value: "user-document-templates/montage-application-cloud/index.html", enumerable: false},
18 _iframe: { value: null, enumerable: false },
19 _server: { value: null, enumerable: false },
20 _templateDocument: { value: null, enumerable: false },
21 _selectionModel: { value: [], enumerable: false },
22 _undoModel: { value: { "queue" : [], "position" : 0 }, enumerable: false},
23
24 _document: { value: null, enumerable: false },
25 _documentRoot: { value: null, enumerable: false },
26 _stageBG: { value: null, enumerable: false },
27 _window: { value: null, enumerable: false },
28 _styles: { value: null, enumerable: false },
29 _stylesheets: { value: null, enumerable: false },
30 _stageStyleSheetId : { value: 'nj-stage-stylesheet', enumerable: false },
31 _userDocument: { value: null, enumerable: false },
32 _htmlSource: {value: "<html></html>", enumerable: false},
33 _glData: {value: null, enumerable: false },
34 _userComponents: { value: {}, enumarable: false},
35
36 _elementCounter: { value: 1, enumerable: false },
37 _snapping : { value: true, enumerable: false },
38 _layoutMode: { value: "all", enumerable: false },
39 _draw3DGrid: { value: false, writable: true },
40 _swfObject: { value: false, enumerable: false },
41
42 _zoomFactor: { value: 100, enumerable: false },
43
44 // PUBLIC MEMBERS
45 cssLoadInterval: { value: null, enumerable: false },
46
47 _savedLeftScroll: {value:null},
48 _savedTopScroll: {value:null},
49
50 _codeViewDocument:{
51 writable: true,
52 enumerable: true,
53 value:null
54 },
55
56 /*
57 * PUBLIC API
58 */
59
60 // GETTERS / SETTERS
61
62 codeViewDocument:{
63 get: function() { return this._codeViewDocument; },
64 set: function(value) { this._codeViewDocument = value}
65 },
66
67 savedLeftScroll:{
68 get: function() { return this._savedLeftScroll; },
69 set: function(value) { this._savedLeftScroll = value}
70 },
71
72 savedTopScroll:{
73 get: function() { return this._savedTopScroll; },
74 set: function(value) { this._savedTopScroll = value}
75 },
76
77 selectionExclude: {
78 get: function() { return this._selectionExclude; },
79 set: function(value) { this._selectionExclude = value; }
80 },
81
82 iframe: {
83 get: function() { return this._iframe; },
84 set: function(value) { this._iframe = value; }
85 },
86
87 server: {
88 get: function() { return this._server; },
89 set: function(value) { this._server = value; }
90 },
91
92 selectionModel: {
93 get: function() { return this._selectionModel; },
94 set: function(value) { this._selectionModel = value; }
95 },
96
97 undoModel: {
98 get: function() { return this._undoModel; },
99 set: function(value) { this._undoModel.queue = value.queue; this._undoModel.position = value.position; }
100 },
101
102 documentRoot: {
103 get: function() { return this._documentRoot; },
104 set: function(value) { this._documentRoot = value; }
105 },
106
107 stageBG: {
108 get: function() { return this._stageBG; },
109 set: function(value) { this._stageBG = value; }
110 },
111
112 elementCounter: {
113 set: function(value) { this._elementCounter = value; },
114 get: function() { return this._elementCounter; }
115 },
116
117 snapping: {
118 get: function() { return this._snapping; },
119 set: function(value) {
120 if(this._snapping !== value) {
121 this._snapping = value;
122 }
123 }
124 },
125
126 // TODO SEND THE EVENT --> Redraw the desired layout
127 layoutMode: {
128 get: function() { return this._layoutMode; },
129 set: function(mode) { this._layoutMode = mode; }
130 },
131
132 draw3DGrid: {
133 get: function() { return this._draw3DGrid; },
134 set: function(value) {
135 if(this._draw3DGrid !== value) {
136 this._draw3DGrid = value;
137 }
138 }