From 1daf146c849a0a8dbd2b61b14218c9a39bdee3a7 Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Fri, 3 Feb 2012 17:22:48 -0800 Subject: added editor tab save while switching code view tabs, integrated new file dialog with io mediator to open the new file in a new tab Signed-off-by: Ananya Sen --- js/io/document/html-document.js | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'js/io/document/html-document.js') diff --git a/js/io/document/html-document.js b/js/io/document/html-document.js index fc7dd05b..24d4e7e4 100755 --- a/js/io/document/html-document.js +++ b/js/io/document/html-document.js @@ -43,9 +43,16 @@ var HTMLDocument = exports.HTMLDocument = Montage.create(baseDocumentModule.Base } }, + // PUBLIC MEMBERS cssLoadInterval: { value: null, enumerable: false }, + codeViewDocument:{ + writable: true, + enumerable: true, + value:null + }, + /* * PUBLIC API */ @@ -432,5 +439,26 @@ var HTMLDocument = exports.HTMLDocument = Montage.create(baseDocumentModule.Base */ } } + }, + + /** + * public method + * parameter: + * removeCodeMirrorDivFlag - for code view, tell to remove the codemirror div after saving + */ + save:{ + value:function(removeCodeMirrorDivFlag){ + if(this.currentView === "design"){ + //generate html and save + }else if((this.currentView === "code") && (this.codeViewDocument !== null)){ + if(removeCodeMirrorDivFlag === true){ + this.codeViewDocument.save(true); + }else{ + this.codeViewDocument.save(); + } + //persist to filesystem + } + + } } }); \ No newline at end of file -- cgit v1.2.3 From 45cfffd9261ab1aa714554c584f0d0d8fe627c91 Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Fri, 3 Feb 2012 18:04:26 -0800 Subject: allow to open html file in design view, integrated file open with io mediator Signed-off-by: Ananya Sen --- js/io/document/html-document.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'js/io/document/html-document.js') diff --git a/js/io/document/html-document.js b/js/io/document/html-document.js index 24d4e7e4..da1bbe4a 100755 --- a/js/io/document/html-document.js +++ b/js/io/document/html-document.js @@ -216,8 +216,9 @@ var HTMLDocument = exports.HTMLDocument = Montage.create(baseDocumentModule.Base value: function(doc, uuid, iframe, callback) { // Shell mode is not used anymore //if(!window.IsInShellMode()) { - - this.init("index-cloud", this._cloudTemplateUri, doc.type, iframe, uuid, callback); + if(!doc.name){doc.name = "index-cloud"}; + if(!doc.uri){doc.uri = this._cloudTemplateUri}; + this.init(doc.name, doc.uri, doc.type, iframe, uuid, callback); /* } else { var tmpurl = doc.uri.split('\\'); -- cgit v1.2.3