diff options
Diffstat (limited to 'js/io/document/html-document.js')
-rwxr-xr-x[-rw-r--r--] | js/io/document/html-document.js | 50 |
1 files changed, 48 insertions, 2 deletions
diff --git a/js/io/document/html-document.js b/js/io/document/html-document.js index c44dfe75..8e1eb614 100644..100755 --- a/js/io/document/html-document.js +++ b/js/io/document/html-document.js | |||
@@ -36,14 +36,33 @@ var HTMLDocument = exports.HTMLDocument = Montage.create(baseDocumentModule.Base | |||
36 | 36 | ||
37 | _zoomFactor: { value: 100, enumerable: false }, | 37 | _zoomFactor: { value: 100, enumerable: false }, |
38 | 38 | ||
39 | _codeEditor: { | ||
40 | value: { | ||
41 | "editor": { value: null, enumerable: false }, | ||
42 | "hline": { value: null, enumerable: false } | ||
43 | } | ||
44 | }, | ||
45 | |||
46 | |||
39 | // PUBLIC MEMBERS | 47 | // PUBLIC MEMBERS |
40 | cssLoadInterval: { value: null, enumerable: false }, | 48 | cssLoadInterval: { value: null, enumerable: false }, |
41 | 49 | ||
50 | codeViewDocument:{ | ||
51 | writable: true, | ||
52 | enumerable: true, | ||
53 | value:null | ||
54 | }, | ||
55 | |||
42 | /* | 56 | /* |
43 | * PUBLIC API | 57 | * PUBLIC API |
44 | */ | 58 | */ |
45 | 59 | ||
46 | // GETTERS / SETTERS | 60 | // GETTERS / SETTERS |
61 | editor: { | ||
62 | get: function() { return this._codeEditor.editor; }, | ||
63 | set: function(value) { this._codeEditor.editor = value} | ||
64 | }, | ||
65 | |||
47 | selectionExclude: { | 66 | selectionExclude: { |
48 | get: function() { return this._selectionExclude; }, | 67 | get: function() { return this._selectionExclude; }, |
49 | set: function(value) { this._selectionExclude = value; } | 68 | set: function(value) { this._selectionExclude = value; } |
@@ -197,8 +216,9 @@ var HTMLDocument = exports.HTMLDocument = Montage.create(baseDocumentModule.Base | |||
197 | value: function(doc, uuid, iframe, callback) { | 216 | value: function(doc, uuid, iframe, callback) { |
198 | // Shell mode is not used anymore | 217 | // Shell mode is not used anymore |
199 | //if(!window.IsInShellMode()) { | 218 | //if(!window.IsInShellMode()) { |
200 | 219 | if(!doc.name){doc.name = "index-cloud"}; | |
201 | this.init("index-cloud", this._cloudTemplateUri, doc.type, iframe, uuid, callback); | 220 | if(!doc.uri){doc.uri = this._cloudTemplateUri}; |
221 | this.init(doc.name, doc.uri, doc.type, iframe, uuid, callback); | ||
202 | /* | 222 | /* |
203 | } else { | 223 | } else { |
204 | var tmpurl = doc.uri.split('\\'); | 224 | var tmpurl = doc.uri.split('\\'); |
@@ -420,5 +440,31 @@ var HTMLDocument = exports.HTMLDocument = Montage.create(baseDocumentModule.Base | |||
420 | */ | 440 | */ |
421 | } | 441 | } |
422 | } | 442 | } |
443 | }, | ||
444 | |||
445 | /** | ||
446 | * public method | ||
447 | * parameter: | ||
448 | * removeCodeMirrorDivFlag - for code view, tell to remove the codemirror div after saving | ||
449 | */ | ||
450 | save:{ | ||
451 | value:function(removeCodeMirrorDivFlag){ | ||
452 | try{ | ||
453 | if(this.currentView === "design"){ | ||
454 | //generate html and save | ||
455 | }else if((this.currentView === "code") && (this.codeViewDocument !== null)){ | ||
456 | if(removeCodeMirrorDivFlag === true){ | ||
457 | this.codeViewDocument.save(true); | ||
458 | }else{ | ||
459 | this.codeViewDocument.save(); | ||
460 | } | ||
461 | //persist to filesystem | ||
462 | } | ||
463 | this.dirtyFlag=false; | ||
464 | }catch(e){ | ||
465 | console.log("Error while saving "+this.uri); | ||
466 | console.log(e.stack); | ||
467 | } | ||
468 | } | ||
423 | } | 469 | } |
424 | }); \ No newline at end of file | 470 | }); \ No newline at end of file |