diff options
author | Jose Antonio Marquez | 2012-02-13 22:39:28 -0800 |
---|---|---|
committer | Jose Antonio Marquez | 2012-02-13 22:39:28 -0800 |
commit | 5b6c62b7164cbde2845a3f7af810568e5ba53a6a (patch) | |
tree | 48237b0fd7286359aa7e585a6c144cc7fed1a43b /js/io/document | |
parent | 64f54ffcebf09c570972b91ea5fdb7fe7654e622 (diff) | |
download | ninja-5b6c62b7164cbde2845a3f7af810568e5ba53a6a.tar.gz |
File IO UI tweaks
Making minor tweaks to the UI for file IO, will need to make much more at a later time.
Diffstat (limited to 'js/io/document')
-rwxr-xr-x | js/io/document/html-document.js | 38 | ||||
-rwxr-xr-x | js/io/document/text-document.js | 2 |
2 files changed, 12 insertions, 28 deletions
diff --git a/js/io/document/html-document.js b/js/io/document/html-document.js index 520906ab..ac556c2d 100755 --- a/js/io/document/html-document.js +++ b/js/io/document/html-document.js | |||
@@ -4,11 +4,14 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot | |||
4 | (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. | 4 | (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. |
5 | </copyright> */ | 5 | </copyright> */ |
6 | 6 | ||
7 | var Montage = require("montage/core/core").Montage, | 7 | //////////////////////////////////////////////////////////////////////// |
8 | baseDocumentModule = require("js/io/document/base-document"), | 8 | // |
9 | NJUtils = require("js/lib/NJUtils").NJUtils; | 9 | var Montage = require("montage/core/core").Montage, |
10 | 10 | BaseDocument = require("js/io/document/base-document").BaseDocument, | |
11 | var HTMLDocument = exports.HTMLDocument = Montage.create(baseDocumentModule.BaseDocument, { | 11 | NJUtils = require("js/lib/NJUtils").NJUtils; |
12 | //////////////////////////////////////////////////////////////////////// | ||
13 | // | ||
14 | exports.HTMLDocument = Montage.create(BaseDocument, { | ||
12 | // PRIVATE MEMBERS | 15 | // PRIVATE MEMBERS |
13 | _selectionExclude: { value: null, enumerable: false }, | 16 | _selectionExclude: { value: null, enumerable: false }, |
14 | _htmlTemplateUrl: { value: "user-document-templates/montage-application-cloud/index.html", enumerable: false}, | 17 | _htmlTemplateUrl: { value: "user-document-templates/montage-application-cloud/index.html", enumerable: false}, |
@@ -477,32 +480,13 @@ var HTMLDocument = exports.HTMLDocument = Montage.create(baseDocumentModule.Base | |||
477 | //TODO: Add code view logic and also styles for HTML | 480 | //TODO: Add code view logic and also styles for HTML |
478 | if (this.currentView === 'design') { | 481 | if (this.currentView === 'design') { |
479 | return {mode: 'html', document: this._userDocument, style: this._styles, head: this._templateDocument.head.innerHTML, body: this._templateDocument.body.innerHTML}; | 482 | return {mode: 'html', document: this._userDocument, style: this._styles, head: this._templateDocument.head.innerHTML, body: this._templateDocument.body.innerHTML}; |
480 | } else if(this.currentView === "code"){ | 483 | } else if (this.currentView === "code"){ |
481 | //TODO: Would this get call when we are in code of HTML? | 484 | //TODO: Would this get call when we are in code of HTML? |
485 | } else { | ||
486 | //Error | ||
482 | } | 487 | } |
483 | } | 488 | } |
484 | } | 489 | } |
485 | //////////////////////////////////////////////////////////////////// | 490 | //////////////////////////////////////////////////////////////////// |
486 | //////////////////////////////////////////////////////////////////// | 491 | //////////////////////////////////////////////////////////////////// |
487 | |||
488 | |||
489 | /* | ||
490 | save:{ | ||
491 | value:function(){ | ||
492 | try{ | ||
493 | if(this.currentView === "design"){ | ||
494 | //generate html and save | ||
495 | }else if((this.currentView === "code") && (this.codeViewDocument !== null)){ | ||
496 | this.codeViewDocument.editor.save(); | ||
497 | //persist to filesystem | ||
498 | } | ||
499 | this.dirtyFlag=false; | ||
500 | }catch(e){ | ||
501 | console.log("Error while saving "+this.uri); | ||
502 | console.log(e.stack); | ||
503 | } | ||
504 | } | ||
505 | } | ||
506 | */ | ||
507 | |||
508 | }); \ No newline at end of file | 492 | }); \ No newline at end of file |
diff --git a/js/io/document/text-document.js b/js/io/document/text-document.js index e149c479..87fcc551 100755 --- a/js/io/document/text-document.js +++ b/js/io/document/text-document.js | |||
@@ -10,7 +10,7 @@ var Montage = require("montage/core/core").Montage, | |||
10 | BaseDocument = require("js/io/document/base-document").BaseDocument; | 10 | BaseDocument = require("js/io/document/base-document").BaseDocument; |
11 | //////////////////////////////////////////////////////////////////////// | 11 | //////////////////////////////////////////////////////////////////////// |
12 | // | 12 | // |
13 | var TextDocument = exports.TextDocument = Montage.create(BaseDocument, { | 13 | exports.TextDocument = Montage.create(BaseDocument, { |
14 | // PRIVATE MEMBERS | 14 | // PRIVATE MEMBERS |
15 | _codeEditor: { | 15 | _codeEditor: { |
16 | value: { | 16 | value: { |