diff options
author | Ananya Sen | 2012-02-10 02:04:42 -0800 |
---|---|---|
committer | Ananya Sen | 2012-02-10 02:04:42 -0800 |
commit | cc3d8f5dfa82cf0a3620653af7e974f7417650f9 (patch) | |
tree | 4afe69f30f364f2011d706faced7243fb0eb6256 /js/io | |
parent | ad0ee69be3512325ede94738f23597086a141a3e (diff) | |
parent | fbe830fabe497d01f4f2eaddb867161a8187c101 (diff) | |
download | ninja-cc3d8f5dfa82cf0a3620653af7e974f7417650f9.tar.gz |
Merge branch 'FileIO' of github.com:joseeight/ninja-internal into FileIO
Conflicts:
js/io/document/document-controller.js
Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com>
Diffstat (limited to 'js/io')
-rwxr-xr-x | js/io/document/document-controller.js | 47 | ||||
-rwxr-xr-x | js/io/system/coreioapi.js | 2 | ||||
-rwxr-xr-x | js/io/ui/cloudpopup.reel/cloudpopup.html | 12 | ||||
-rwxr-xr-x | js/io/ui/cloudpopup.reel/cloudpopup.js | 26 | ||||
-rw-r--r-- | js/io/ui/cloudpopup.reel/css/cloudpopup.css | 46 | ||||
-rwxr-xr-x | js/io/ui/cloudpopup.reel/css/cloudpopup.scss | 46 |
6 files changed, 153 insertions, 26 deletions
diff --git a/js/io/document/document-controller.js b/js/io/document/document-controller.js index 6f67b57c..16643a58 100755 --- a/js/io/document/document-controller.js +++ b/js/io/document/document-controller.js | |||
@@ -37,7 +37,7 @@ var DocumentController = exports.DocumentController = Montage.create(Component, | |||
37 | value: "function CodeMirror(place, givenOptions) {" + | 37 | value: "function CodeMirror(place, givenOptions) {" + |
38 | "// Determine effective options based on given values and defaults." + | 38 | "// Determine effective options based on given values and defaults." + |
39 | "var options = {}, defaults = CodeMirror.defaults; }" | 39 | "var options = {}, defaults = CodeMirror.defaults; }" |
40 | }, | 40 | }, |
41 | 41 | ||
42 | activeDocument: { | 42 | activeDocument: { |
43 | get: function() { | 43 | get: function() { |
@@ -45,7 +45,7 @@ var DocumentController = exports.DocumentController = Montage.create(Component, | |||
45 | }, | 45 | }, |
46 | set: function(doc) { | 46 | set: function(doc) { |
47 | if(this._activeDocument) this._activeDocument.isActive = false; | 47 | if(this._activeDocument) this._activeDocument.isActive = false; |
48 | 48 | ||
49 | if(this._documents.indexOf(doc) === -1) this._documents.push(doc); | 49 | if(this._documents.indexOf(doc) === -1) this._documents.push(doc); |
50 | 50 | ||
51 | this._activeDocument = doc; | 51 | this._activeDocument = doc; |
@@ -66,11 +66,20 @@ var DocumentController = exports.DocumentController = Montage.create(Component, | |||
66 | this.eventManager.addEventListener("executeSave", this, false); | 66 | this.eventManager.addEventListener("executeSave", this, false); |
67 | 67 | ||
68 | this.eventManager.addEventListener("recordStyleChanged", this, false); | 68 | this.eventManager.addEventListener("recordStyleChanged", this, false); |
69 | |||
70 | // Temporary testing opening a new file after Ninja has loaded | ||
71 | this.eventManager.addEventListener("executeNewProject", this, false); | ||
69 | } | 72 | } |
70 | }, | 73 | }, |
71 | 74 | ||
72 | handleAppLoaded: { | 75 | handleAppLoaded: { |
73 | value: function() { | 76 | value: function() { |
77 | //this.openDocument({"type": "html"}); | ||
78 | } | ||
79 | }, | ||
80 | |||
81 | handleExecuteNewProject: { | ||
82 | value: function() { | ||
74 | this.openDocument({"type": "html"}); | 83 | this.openDocument({"type": "html"}); |
75 | } | 84 | } |
76 | }, | 85 | }, |
@@ -107,9 +116,9 @@ var DocumentController = exports.DocumentController = Montage.create(Component, | |||
107 | 116 | ||
108 | if((newFileObj.fileExtension !== ".html") && (newFileObj.fileExtension !== ".htm")){//open code view | 117 | if((newFileObj.fileExtension !== ".html") && (newFileObj.fileExtension !== ".htm")){//open code view |
109 | 118 | ||
110 | }else{ | 119 | } else { |
111 | //open design view | 120 | //open design view |
112 | } | 121 | } |
113 | } | 122 | } |
114 | }, | 123 | }, |
115 | 124 | ||
@@ -145,11 +154,6 @@ var DocumentController = exports.DocumentController = Montage.create(Component, | |||
145 | 154 | ||
146 | /** | 155 | /** |
147 | * Public method | 156 | * Public method |
148 | * doc contains: | ||
149 | * type : file type, like js, css, etc | ||
150 | * name : file name | ||
151 | * source : file content | ||
152 | * uri : file uri | ||
153 | */ | 157 | */ |
154 | openFileCallback:{ | 158 | openFileCallback:{ |
155 | value:function(response){ | 159 | value:function(response){ |
@@ -193,7 +197,6 @@ var DocumentController = exports.DocumentController = Montage.create(Component, | |||
193 | } | 197 | } |
194 | }, | 198 | }, |
195 | 199 | ||
196 | |||
197 | openProjectWithURI: { | 200 | openProjectWithURI: { |
198 | value: function(uri) { | 201 | value: function(uri) { |
199 | console.log("URI is: ", uri); | 202 | console.log("URI is: ", uri); |
@@ -225,7 +228,7 @@ var DocumentController = exports.DocumentController = Montage.create(Component, | |||
225 | 228 | ||
226 | this.textDocumentOpened(newDoc); | 229 | this.textDocumentOpened(newDoc); |
227 | 230 | ||
228 | } | 231 | } |
229 | 232 | ||
230 | // } catch (err) { | 233 | // } catch (err) { |
231 | // console.log("Could not open Document ", err); | 234 | // console.log("Could not open Document ", err); |
@@ -257,24 +260,24 @@ var DocumentController = exports.DocumentController = Montage.create(Component, | |||
257 | } | 260 | } |
258 | 261 | ||
259 | DocumentManager._codeEditor.editor = CodeMirror.fromTextArea(doc.textArea, { | 262 | DocumentManager._codeEditor.editor = CodeMirror.fromTextArea(doc.textArea, { |
260 | lineNumbers: true, | 263 | lineNumbers: true, |
261 | mode: type, | 264 | mode: type, |
262 | onCursorActivity: function() { | 265 | onCursorActivity: function() { |
263 | DocumentManager._codeEditor.editor.setLineClass(DocumentManager._codeEditor.hline, null); | 266 | DocumentManager._codeEditor.editor.setLineClass(DocumentManager._codeEditor.hline, null); |
264 | DocumentManager._codeEditor.hline = DocumentManager._codeEditor.editor.setLineClass(DocumentManager._codeEditor.editor.getCursor().line, "activeline"); | 267 | DocumentManager._codeEditor.hline = DocumentManager._codeEditor.editor.setLineClass(DocumentManager._codeEditor.editor.getCursor().line, "activeline"); |
265 | } | 268 | } |
266 | }); | 269 | }); |
267 | DocumentManager._codeEditor.hline = DocumentManager._codeEditor.editor.setLineClass(0, "activeline"); | 270 | DocumentManager._codeEditor.hline = DocumentManager._codeEditor.editor.setLineClass(0, "activeline"); |
268 | */ | 271 | */ |
269 | 272 | ||
270 | } | 273 | } |
271 | }, | 274 | }, |
272 | 275 | ||
273 | closeDocument: { | 276 | closeDocument: { |
274 | value: function(id) { | 277 | value: function(id) { |
275 | if(this.activeDocument.dirtyFlag === true){ | 278 | if(this.activeDocument.dirtyFlag === true){ |
276 | //if file dirty then alert user to save | 279 | //if file dirty then alert user to save |
277 | } | 280 | } |
278 | 281 | ||
279 | var doc = this._findDocumentByUUID(id); | 282 | var doc = this._findDocumentByUUID(id); |
280 | this._removeDocumentView(doc.container); | 283 | this._removeDocumentView(doc.container); |
@@ -399,9 +402,9 @@ var DocumentController = exports.DocumentController = Montage.create(Component, | |||
399 | this.application.ninja.stage.restoreScroll(); | 402 | this.application.ninja.stage.restoreScroll(); |
400 | this.application.ninja.stage.hideCanvas(false); | 403 | this.application.ninja.stage.hideCanvas(false); |
401 | this.application.ninja.stage.stageView.showRulers(); | 404 | this.application.ninja.stage.stageView.showRulers(); |
402 | } | ||
403 | } | 405 | } |
404 | } | 406 | } |
407 | } | ||
405 | }, | 408 | }, |
406 | 409 | ||
407 | _removeDocumentView: { | 410 | _removeDocumentView: { |
@@ -442,5 +445,5 @@ var DocumentController = exports.DocumentController = Montage.create(Component, | |||
442 | value: function() { | 445 | value: function() { |
443 | return "userDocument_" + (this._iframeCounter++); | 446 | return "userDocument_" + (this._iframeCounter++); |
444 | } | 447 | } |
445 | } | 448 | } |
446 | }); \ No newline at end of file | 449 | }); |
diff --git a/js/io/system/coreioapi.js b/js/io/system/coreioapi.js index f62133ac..b19f1e70 100755 --- a/js/io/system/coreioapi.js +++ b/js/io/system/coreioapi.js | |||
@@ -323,7 +323,7 @@ window.hack = function (name, type) { | |||
323 | // | 323 | // |
324 | this._cloudDialogComponents.dialog.element.style.opacity = 1; | 324 | this._cloudDialogComponents.dialog.element.style.opacity = 1; |
325 | this._cloudDialogComponents.popup.element.style.opacity = 1; | 325 | this._cloudDialogComponents.popup.element.style.opacity = 1; |
326 | this._cloudDialogComponents.popup.element.style.margin = '-100px 0px 0px -190px'; | 326 | this._cloudDialogComponents.popup.element.style.margin = '-170px 0px 0px -190px'; |
327 | } | 327 | } |
328 | } | 328 | } |
329 | }, | 329 | }, |
diff --git a/js/io/ui/cloudpopup.reel/cloudpopup.html b/js/io/ui/cloudpopup.reel/cloudpopup.html index 1ab0892d..8e65a705 100755 --- a/js/io/ui/cloudpopup.reel/cloudpopup.html +++ b/js/io/ui/cloudpopup.reel/cloudpopup.html | |||
@@ -46,6 +46,18 @@ | |||
46 | 46 | ||
47 | <button class="btn_ok nj-skinned">Ok</button> | 47 | <button class="btn_ok nj-skinned">Ok</button> |
48 | 48 | ||
49 | <section> | ||
50 | |||
51 | <h4>Install Ninja Cloud App</h4> | ||
52 | |||
53 | <p>Donec congue lacinia dui, a porttitor lectus condimentum laoreet. Nunc eu ullamcorper orci. Quisque eget odio ac lectus.</p> | ||
54 | |||
55 | <div class="cloud_icon"></div> | ||
56 | |||
57 | <button class="btn_download nj-skinned">Download</button> | ||
58 | |||
59 | </section> | ||
60 | |||
49 | </div> | 61 | </div> |
50 | </div> | 62 | </div> |
51 | 63 | ||
diff --git a/js/io/ui/cloudpopup.reel/cloudpopup.js b/js/io/ui/cloudpopup.reel/cloudpopup.js index 7f494dcf..1344661b 100755 --- a/js/io/ui/cloudpopup.reel/cloudpopup.js +++ b/js/io/ui/cloudpopup.reel/cloudpopup.js | |||
@@ -17,10 +17,15 @@ exports.CloudPopup = Montage.create(Component, { | |||
17 | value: true | 17 | value: true |
18 | }, | 18 | }, |
19 | //////////////////////////////////////////////////////////////////// | 19 | //////////////////////////////////////////////////////////////////// |
20 | // | ||
21 | _os: { | ||
22 | value: null | ||
23 | }, | ||
24 | //////////////////////////////////////////////////////////////////// | ||
20 | // | 25 | // |
21 | components: { | 26 | components: { |
22 | enumerable: false, | 27 | enumerable: false, |
23 | value: {test_btn: null, ok_btn: null, cancel_btn: null, status: null, url: null} | 28 | value: {test_btn: null, ok_btn: null, cancel_btn: null, |