aboutsummaryrefslogtreecommitdiff
path: root/js/io/document/html-document.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/io/document/html-document.js')
-rwxr-xr-x[-rw-r--r--]js/io/document/html-document.js53
1 files changed, 51 insertions, 2 deletions
diff --git a/js/io/document/html-document.js b/js/io/document/html-document.js
index c44dfe75..d51cd279 100644..100755
--- a/js/io/document/html-document.js
+++ b/js/io/document/html-document.js
@@ -39,11 +39,36 @@ var HTMLDocument = exports.HTMLDocument = Montage.create(baseDocumentModule.Base
39 // PUBLIC MEMBERS 39 // PUBLIC MEMBERS
40 cssLoadInterval: { value: null, enumerable: false }, 40 cssLoadInterval: { value: null, enumerable: false },
41 41
42 _savedLeftScroll: {value:null},
43 _savedTopScroll: {value:null},
44
45 _codeViewDocument:{
46 writable: true,
47 enumerable: true,
48 value:null
49 },
50
42 /* 51 /*
43 * PUBLIC API 52 * PUBLIC API
44 */ 53 */
45 54
46 // GETTERS / SETTERS 55 // GETTERS / SETTERS
56
57 codeViewDocument:{
58 get: function() { return this._codeViewDocument; },
59 set: function(value) { this._codeViewDocument = value}
60 },
61
62 savedLeftScroll:{
63 get: function() { return this._savedLeftScroll; },
64 set: function(value) { this._savedLeftScroll = value}
65 },
66
67 savedTopScroll:{
68 get: function() { return this._savedTopScroll; },
69 set: function(value) { this._savedTopScroll = value}
70 },
71
47 selectionExclude: { 72 selectionExclude: {
48 get: function() { return this._selectionExclude; }, 73 get: function() { return this._selectionExclude; },
49 set: function(value) { this._selectionExclude = value; } 74 set: function(value) { this._selectionExclude = value; }
@@ -197,8 +222,9 @@ var HTMLDocument = exports.HTMLDocument = Montage.create(baseDocumentModule.Base
197 value: function(doc, uuid, iframe, callback) { 222 value: function(doc, uuid, iframe, callback) {
198 // Shell mode is not used anymore 223 // Shell mode is not used anymore
199 //if(!window.IsInShellMode()) { 224 //if(!window.IsInShellMode()) {
200 225 if(!doc.name){doc.name = "index-cloud"};
201 this.init("index-cloud", this._cloudTemplateUri, doc.type, iframe, uuid, callback); 226 if(!doc.uri){doc.uri = this._cloudTemplateUri};
227 this.init(doc.name, doc.uri, doc.type, iframe, uuid, callback);
202 /* 228 /*
203 } else { 229 } else {
204 var tmpurl = doc.uri.split('\\'); 230 var tmpurl = doc.uri.split('\\');
@@ -213,6 +239,7 @@ var HTMLDocument = exports.HTMLDocument = Montage.create(baseDocumentModule.Base
213 this.currentView = "design"; 239 this.currentView = "design";
214 240
215 this._loadDocument(this.uri); 241 this._loadDocument(this.uri);
242
216 } 243 }
217 }, 244 },
218 245
@@ -420,5 +447,27 @@ var HTMLDocument = exports.HTMLDocument = Montage.create(baseDocumentModule.Base
420 */ 447 */
421 } 448 }
422 } 449 }
450 },
451
452 /**
453 * public method
454 *
455 */
456 save:{
457 value:function(){
458 try{
459 if(this.currentView === "design"){
460 //generate html and save
461 }else if((this.currentView === "code") && (this.codeViewDocument !== null)){
462 this.codeViewDocument.editor.save();
463 //persist to filesystem
464 }
465 this.dirtyFlag=false;
466 }catch(e){
467 console.log("Error while saving "+this.uri);
468 console.log(e.stack);
469 }
470 }
423 } 471 }
472
424}); \ No newline at end of file 473}); \ No newline at end of file