From 3a754133dbc138390503341fd2e9beba3e43aa4b Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Fri, 27 Jan 2012 12:05:17 -0800 Subject: Merged old FileIO --- js/stage/stage-view.reel/stage-view.js | 77 ++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100755 js/stage/stage-view.reel/stage-view.js (limited to 'js/stage/stage-view.reel/stage-view.js') diff --git a/js/stage/stage-view.reel/stage-view.js b/js/stage/stage-view.reel/stage-view.js new file mode 100755 index 00000000..63fe88ba --- /dev/null +++ b/js/stage/stage-view.reel/stage-view.js @@ -0,0 +1,77 @@ +/* +This file contains proprietary software owned by Motorola Mobility, Inc.
+No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.
+(c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. +
*/ + +/** +@requires montage/core/core +@requires montage/ui/component +*/ +var Montage = require("montage/core/core").Montage, + Component = require("montage/ui/component").Component; + +exports.StageView = Montage.create(Component, { + _documents: { + value : [] + }, + + docs: { + get: function() { + return this._documents; + }, + set: function(value) { + //console.log(value); + } + }, + + templateDidLoad: { + value: function() { + this.eventManager.addEventListener("appLoaded", this, false); + //console.log(this.application.ninja.documentController._documents); + } + }, + + handleAppLoaded: { + value: function() { + + // Don't bind for now + /* + Object.defineBinding(this, "docs", { + boundObject: this.application.ninja.documentController, + boundObjectPropertyPath: "_documents" + }); + */ + + } + }, + + // Temporary function to create a Codemirror text view + createTextView: { + value: function(doc) { +// DocumentManager._hideCurrentDocument(); + + this.application.ninja.currentDocument.container.parentNode.style["display"] = "none"; + +// stageManagerModule.stageManager._scrollFlag = false; // TODO HACK to prevent type error on Hide/Show Iframe +// DocumentManager.activeDocument = doc; + + this.element.appendChild(doc.textArea); + + + var codeM = CodeMirror.fromTextArea(doc.textArea, { + lineNumbers: true, + mode: "javascript" +// onCursorActivity: function() { +// DocumentManager._codeEditor.editor.setLineClass(DocumentManager._codeEditor.hline, null); +// DocumentManager._codeEditor.hline = DocumentManager._codeEditor.editor.setLineClass(DocumentManager._codeEditor.editor.getCursor().line, "activeline"); +// } + }); + +// DocumentManager._codeEditor.hline = DocumentManager._codeEditor.editor.setLineClass(0, "activeline"); + + this.application.ninja.stage.hideCanvas(true); + + } + } +}); \ No newline at end of file -- cgit v1.2.3 From 553fce7721cacfd13b6013fdcdd0243c90083b5e Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Wed, 1 Feb 2012 11:59:11 -0800 Subject: fixed reference to coreioapi cleaning up opening code view tabs Signed-off-by: Ananya Sen --- js/stage/stage-view.reel/stage-view.js | 72 +++++++++++++++++++++++++++++----- 1 file changed, 62 insertions(+), 10 deletions(-) (limited to 'js/stage/stage-view.reel/stage-view.js') diff --git a/js/stage/stage-view.reel/stage-view.js b/js/stage/stage-view.reel/stage-view.js index 63fe88ba..727c16eb 100755 --- a/js/stage/stage-view.reel/stage-view.js +++ b/js/stage/stage-view.reel/stage-view.js @@ -49,28 +49,80 @@ exports.StageView = Montage.create(Component, { // Temporary function to create a Codemirror text view createTextView: { value: function(doc) { -// DocumentManager._hideCurrentDocument(); + this.application.ninja.documentController._hideCurrentDocument(); this.application.ninja.currentDocument.container.parentNode.style["display"] = "none"; -// stageManagerModule.stageManager._scrollFlag = false; // TODO HACK to prevent type error on Hide/Show Iframe -// DocumentManager.activeDocument = doc; + this.application.ninja.stage._scrollFlag = false; // TODO HACK to prevent type error on Hide/Show Iframe + this.application.ninja.documentController.activeDocument = doc; this.element.appendChild(doc.textArea); + var type; + + switch(doc.documentType) { + case "css" : + type = "css"; + break; + case "js" : + type = "javascript"; + break; + } + + //remove any previous Codemirror div + var codemirrorDiv = this.element.querySelector(".CodeMirror"); + if(!!codemirrorDiv){ + codemirrorDiv.parentNode.removeChild(codemirrorDiv); + } var codeM = CodeMirror.fromTextArea(doc.textArea, { lineNumbers: true, - mode: "javascript" -// onCursorActivity: function() { -// DocumentManager._codeEditor.editor.setLineClass(DocumentManager._codeEditor.hline, null); -// DocumentManager._codeEditor.hline = DocumentManager._codeEditor.editor.setLineClass(DocumentManager._codeEditor.editor.getCursor().line, "activeline"); -// } + mode: type, + onCursorActivity: function() { + this.application.ninja.documentController._codeEditor.editor.setLineClass(this.application.ninja.documentController._codeEditor.hline, null); + this.application.ninja.documentController._codeEditor.hline = this.application.ninja.documentController._codeEditor.editor.setLineClass(this.application.ninja.documentController._codeEditor.editor.getCursor().line, "activeline"); + } }); -// DocumentManager._codeEditor.hline = DocumentManager._codeEditor.editor.setLineClass(0, "activeline"); + //this.application.ninja.documentController._codeEditor.hline = this.application.ninja.documentController._codeEditor.editor.setLineClass(0, "activeline"); + + this.application.ninja.stage.hideCanvas(true); + + } + }, + + switchCodeView:{ + value: function(doc){ + + this.application.ninja.documentController._hideCurrentDocument(); + + //remove any previous Codemirror div + var codemirrorDiv = this.element.querySelector(".CodeMirror"); + if(!!codemirrorDiv){ + codemirrorDiv.parentNode.removeChild(codemirrorDiv); + } + + var type; + + switch(doc.documentType) { + case "css" : + type = "css"; + break; + case "js" : + type = "javascript"; + break; + } + + var codeM = CodeMirror.fromTextArea(doc.textArea, { + lineNumbers: true, + mode: type, + onCursorActivity: function() { + this.application.ninja.documentController._codeEditor.editor.setLineClass(this.application.ninja.documentController._codeEditor.hline, null); + this.application.ninja.documentController._codeEditor.hline = this.application.ninja.documentController._codeEditor.editor.setLineClass(this.application.ninja.documentController._codeEditor.editor.getCursor().line, "activeline"); + } + }); - this.application.ninja.stage.hideCanvas(true); + //this.application.ninja.documentController._codeEditor.hline = this.application.ninja.documentController._codeEditor.editor.setLineClass(0, "activeline"); } } -- cgit v1.2.3 From 8504b61aefb25fdab931f02c4568916d2bf8345c Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Thu, 2 Feb 2012 00:52:44 -0800 Subject: changes to open multiple code view tabs and switch between the code views, added nj-skinned css class for the buttons in file picker, new file dialog and save as dialog Signed-off-by: Ananya Sen --- js/stage/stage-view.reel/stage-view.js | 54 ++++++++++++++++++++++++++++++---- 1 file changed, 49 insertions(+), 5 deletions(-) (limited to 'js/stage/stage-view.reel/stage-view.js') diff --git a/js/stage/stage-view.reel/stage-view.js b/js/stage/stage-view.reel/stage-view.js index 727c16eb..c0b0b83e 100755 --- a/js/stage/stage-view.reel/stage-view.js +++ b/js/stage/stage-view.reel/stage-view.js @@ -49,6 +49,8 @@ exports.StageView = Montage.create(Component, { // Temporary function to create a Codemirror text view createTextView: { value: function(doc) { + var documentController = this.application.ninja.documentController; + this.application.ninja.documentController._hideCurrentDocument(); this.application.ninja.currentDocument.container.parentNode.style["display"] = "none"; @@ -79,8 +81,8 @@ exports.StageView = Montage.create(Component, { lineNumbers: true, mode: type, onCursorActivity: function() { - this.application.ninja.documentController._codeEditor.editor.setLineClass(this.application.ninja.documentController._codeEditor.hline, null); - this.application.ninja.documentController._codeEditor.hline = this.application.ninja.documentController._codeEditor.editor.setLineClass(this.application.ninja.documentController._codeEditor.editor.getCursor().line, "activeline"); + //documentController._codeEditor.editor.setLineClass(documentController._codeEditor.hline, null); + //documentController._codeEditor.hline = documentController._codeEditor.editor.setLineClass(documentController._codeEditor.editor.getCursor().line, "activeline"); } }); @@ -93,9 +95,15 @@ exports.StageView = Montage.create(Component, { switchCodeView:{ value: function(doc){ - + var documentController = this.application.ninja.documentController; this.application.ninja.documentController._hideCurrentDocument(); + this.application.ninja.documentController.activeDocument = doc; + + this.application.ninja.stage._scrollFlag = false; // TODO HACK to prevent type error on Hide/Show Iframe + + + //remove any previous Codemirror div var codemirrorDiv = this.element.querySelector(".CodeMirror"); if(!!codemirrorDiv){ @@ -117,13 +125,49 @@ exports.StageView = Montage.create(Component, { lineNumbers: true, mode: type, onCursorActivity: function() { - this.application.ninja.documentController._codeEditor.editor.setLineClass(this.application.ninja.documentController._codeEditor.hline, null); - this.application.ninja.documentController._codeEditor.hline = this.application.ninja.documentController._codeEditor.editor.setLineClass(this.application.ninja.documentController._codeEditor.editor.getCursor().line, "activeline"); + //documentController._codeEditor.editor.setLineClass(documentController._codeEditor.hline, null); + //documentController._codeEditor.hline = documentController._codeEditor.editor.setLineClass(documentController._codeEditor.editor.getCursor().line, "activeline"); } }); //this.application.ninja.documentController._codeEditor.hline = this.application.ninja.documentController._codeEditor.editor.setLineClass(0, "activeline"); } + }, + refreshCodeDocument:{ + value:function(doc){ + + } + }, + addCodeDocument:{ + value:function(doc){ + var type; + switch(doc.documentType) { + case "css" : + type = "css"; + break; + case "js" : + type = "javascript"; + break; + } + + var codeM = CodeMirror.fromTextArea(doc.textArea, { + lineNumbers: true, + mode: type, + onCursorActivity: function() { + //documentController._codeEditor.editor.setLineClass(documentController._codeEditor.hline, null); + //documentController._codeEditor.hline = documentController._codeEditor.editor.setLineClass(documentController._codeEditor.editor.getCursor().line, "activeline"); + } + }); + } + }, + removeCodeDocument:{ + value:function(){ + //remove any previous Codemirror div + var codemirrorDiv = this.element.querySelector(".CodeMirror"); + if(!!codemirrorDiv){ + codemirrorDiv.parentNode.removeChild(codemirrorDiv); + } + } } }); \ No newline at end of file -- cgit v1.2.3 From 87e247e74040b5e80ff40003d233d5317881102a Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Thu, 2 Feb 2012 03:30:54 -0800 Subject: fixed code view container, and switching code view Signed-off-by: Ananya Sen --- js/stage/stage-view.reel/stage-view.js | 103 +++++++++++++++++++-------------- 1 file changed, 58 insertions(+), 45 deletions(-) (limited to 'js/stage/stage-view.reel/stage-view.js') diff --git a/js/stage/stage-view.reel/stage-view.js b/js/stage/stage-view.reel/stage-view.js index c0b0b83e..bb77b3de 100755 --- a/js/stage/stage-view.reel/stage-view.js +++ b/js/stage/stage-view.reel/stage-view.js @@ -28,7 +28,12 @@ exports.StageView = Montage.create(Component, { templateDidLoad: { value: function() { this.eventManager.addEventListener("appLoaded", this, false); - //console.log(this.application.ninja.documentController._documents); + } + }, + + didDraw:{ + value: function() { + if(!this.application.ninja.documentController._textHolder) this.application.ninja.documentController._textHolder = this.element; } }, @@ -46,6 +51,28 @@ exports.StageView = Montage.create(Component, { } }, + /** + * Creates a text area which will contain the content of the opened text document. + */ + createTextAreaElement: { + value: function(uuid) { + + + var codeMirrorDiv = document.createElement("div"); + codeMirrorDiv.id = "codeMirror_" + uuid; + codeMirrorDiv.style.display = "block"; + this.element.appendChild(codeMirrorDiv); + + var textArea = document.createElement("textarea"); + textArea.id = "code"; + textArea.name = "code"; + + codeMirrorDiv.appendChild(textArea); + + return textArea; + } + }, + // Temporary function to create a Codemirror text view createTextView: { value: function(doc) { @@ -58,8 +85,6 @@ exports.StageView = Montage.create(Component, { this.application.ninja.stage._scrollFlag = false; // TODO HACK to prevent type error on Hide/Show Iframe this.application.ninja.documentController.activeDocument = doc; - this.element.appendChild(doc.textArea); - var type; switch(doc.documentType) { @@ -71,13 +96,16 @@ exports.StageView = Montage.create(Component, { break; } - //remove any previous Codemirror div - var codemirrorDiv = this.element.querySelector(".CodeMirror"); - if(!!codemirrorDiv){ - codemirrorDiv.parentNode.removeChild(codemirrorDiv); - } + //hide other Codemirror divs + this.hideOtherCodeView(doc.uuid); - var codeM = CodeMirror.fromTextArea(doc.textArea, { + + //fix hack + document.getElementById("codeMirror_"+doc.uuid).style.display="block"; + + + + doc.editor = CodeMirror.fromTextArea(doc.textArea, { lineNumbers: true, mode: type, onCursorActivity: function() { @@ -95,6 +123,11 @@ exports.StageView = Montage.create(Component, { switchCodeView:{ value: function(doc){ + + //if dirty SAVE codemirror into textarea + //doc.editor.save(); + + var documentController = this.application.ninja.documentController; this.application.ninja.documentController._hideCurrentDocument(); @@ -102,36 +135,7 @@ exports.StageView = Montage.create(Component, { this.application.ninja.stage._scrollFlag = false; // TODO HACK to prevent type error on Hide/Show Iframe - - - //remove any previous Codemirror div - var codemirrorDiv = this.element.querySelector(".CodeMirror"); - if(!!codemirrorDiv){ - codemirrorDiv.parentNode.removeChild(codemirrorDiv); - } - - var type; - - switch(doc.documentType) { - case "css" : - type = "css"; - break; - case "js" : - type = "javascript"; - break; - } - - var codeM = CodeMirror.fromTextArea(doc.textArea, { - lineNumbers: true, - mode: type, - onCursorActivity: function() { - //documentController._codeEditor.editor.setLineClass(documentController._codeEditor.hline, null); - //documentController._codeEditor.hline = documentController._codeEditor.editor.setLineClass(documentController._codeEditor.editor.getCursor().line, "activeline"); - } - }); - - //this.application.ninja.documentController._codeEditor.hline = this.application.ninja.documentController._codeEditor.editor.setLineClass(0, "activeline"); - + this.application.ninja.documentController._showCurrentDocument(); } }, refreshCodeDocument:{ @@ -161,12 +165,21 @@ exports.StageView = Montage.create(Component, { }); } }, - removeCodeDocument:{ - value:function(){ - //remove any previous Codemirror div - var codemirrorDiv = this.element.querySelector(".CodeMirror"); - if(!!codemirrorDiv){ - codemirrorDiv.parentNode.removeChild(codemirrorDiv); + hideCodeDocument:{ + value:function(docUuid){ + //hide the previous Codemirror div + + } + }, + hideOtherCodeView:{ + value:function(docUuid){ + var i=0; + if(this.element.hasChildNodes()){ + for(i=0;i --- js/stage/stage-view.reel/stage-view.js | 36 +++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) (limited to 'js/stage/stage-view.reel/stage-view.js') diff --git a/js/stage/stage-view.reel/stage-view.js b/js/stage/stage-view.reel/stage-view.js index bb77b3de..d8e1e46b 100755 --- a/js/stage/stage-view.reel/stage-view.js +++ b/js/stage/stage-view.reel/stage-view.js @@ -121,21 +121,51 @@ exports.StageView = Montage.create(Component, { } }, + + switchCodeView:{ value: function(doc){ //if dirty SAVE codemirror into textarea - //doc.editor.save(); + //this.application.ninja.documentController.activeDocument.editor.save(); + //remove the codemirror div + var codemirrorDiv = this.application.ninja.documentController.activeDocument.container.querySelector(".CodeMirror"); + if(!!codemirrorDiv){ + codemirrorDiv.parentNode.removeChild(codemirrorDiv); + this.application.ninja.documentController.activeDocument.editor = null; + } - var documentController = this.application.ninja.documentController; this.application.ninja.documentController._hideCurrentDocument(); this.application.ninja.documentController.activeDocument = doc; this.application.ninja.stage._scrollFlag = false; // TODO HACK to prevent type error on Hide/Show Iframe - this.application.ninja.documentController._showCurrentDocument(); + + var type; + switch(doc.documentType) { + case "css" : + type = "css"; + break; + case "js" : + type = "javascript"; + break; + } + + //add the codemirror div again for editting + doc.editor = CodeMirror.fromTextArea(doc.textArea, { + lineNumbers: true, + mode: type, + onCursorActivity: function() { + //documentController._codeEditor.editor.setLineClass(documentController._codeEditor.hline, null); + //documentController._codeEditor.hline = documentController._codeEditor.editor.setLineClass(documentController._codeEditor.editor.getCursor().line, "activeline"); + } + }); + + //this.application.ninja.documentController._codeEditor.hline = this.application.ninja.documentController._codeEditor.editor.setLineClass(0, "activeline"); + + } }, refreshCodeDocument:{ -- cgit v1.2.3 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/stage/stage-view.reel/stage-view.js | 96 +++++++++++++++------------------- 1 file changed, 41 insertions(+), 55 deletions(-) (limited to 'js/stage/stage-view.reel/stage-view.js') diff --git a/js/stage/stage-view.reel/stage-view.js b/js/stage/stage-view.reel/stage-view.js index d8e1e46b..cf7748fc 100755 --- a/js/stage/stage-view.reel/stage-view.js +++ b/js/stage/stage-view.reel/stage-view.js @@ -76,17 +76,13 @@ exports.StageView = Montage.create(Component, { // Temporary function to create a Codemirror text view createTextView: { value: function(doc) { - var documentController = this.application.ninja.documentController; - + //save current document + if(this.application.ninja.documentController.activeDocument.currentView === "code"){ + this.application.ninja.documentController.activeDocument.save(true); + } this.application.ninja.documentController._hideCurrentDocument(); - - this.application.ninja.currentDocument.container.parentNode.style["display"] = "none"; - - this.application.ninja.stage._scrollFlag = false; // TODO HACK to prevent type error on Hide/Show Iframe - this.application.ninja.documentController.activeDocument = doc; - + this.hideOtherDocuments(doc.uuid); var type; - switch(doc.documentType) { case "css" : type = "css"; @@ -96,15 +92,9 @@ exports.StageView = Montage.create(Component, { break; } - //hide other Codemirror divs - this.hideOtherCodeView(doc.uuid); - - //fix hack document.getElementById("codeMirror_"+doc.uuid).style.display="block"; - - doc.editor = CodeMirror.fromTextArea(doc.textArea, { lineNumbers: true, mode: type, @@ -115,25 +105,20 @@ exports.StageView = Montage.create(Component, { }); //this.application.ninja.documentController._codeEditor.hline = this.application.ninja.documentController._codeEditor.editor.setLineClass(0, "activeline"); - - this.application.ninja.stage.hideCanvas(true); - + this.application.ninja.stage._scrollFlag = false; // TODO HACK to prevent type error on Hide/Show Iframe + this.application.ninja.documentController.activeDocument = doc; + this.application.ninja.stage.hideCanvas(true); } }, - switchCodeView:{ + switchDocument:{ value: function(doc){ //if dirty SAVE codemirror into textarea - //this.application.ninja.documentController.activeDocument.editor.save(); - - //remove the codemirror div - var codemirrorDiv = this.application.ninja.documentController.activeDocument.container.querySelector(".CodeMirror"); - if(!!codemirrorDiv){ - codemirrorDiv.parentNode.removeChild(codemirrorDiv); - this.application.ninja.documentController.activeDocument.editor = null; + if(this.application.ninja.documentController.activeDocument.currentView === "code"){ + this.application.ninja.documentController.activeDocument.save(true); } this.application.ninja.documentController._hideCurrentDocument(); @@ -143,28 +128,29 @@ exports.StageView = Montage.create(Component, { this.application.ninja.stage._scrollFlag = false; // TODO HACK to prevent type error on Hide/Show Iframe this.application.ninja.documentController._showCurrentDocument(); - var type; - switch(doc.documentType) { - case "css" : - type = "css"; - break; - case "js" : - type = "javascript"; - break; - } - - //add the codemirror div again for editting - doc.editor = CodeMirror.fromTextArea(doc.textArea, { - lineNumbers: true, - mode: type, - onCursorActivity: function() { - //documentController._codeEditor.editor.setLineClass(documentController._codeEditor.hline, null); - //documentController._codeEditor.hline = documentController._codeEditor.editor.setLineClass(documentController._codeEditor.editor.getCursor().line, "activeline"); - } - }); - - //this.application.ninja.documentController._codeEditor.hline = this.application.ninja.documentController._codeEditor.editor.setLineClass(0, "activeline"); + if(this.application.ninja.documentController.activeDocument.currentView === "code"){ + var type; + switch(doc.documentType) { + case "css" : + type = "css"; + break; + case "js" : + type = "javascript"; + break; + } + //add the codemirror div again for editting + doc.editor = CodeMirror.fromTextArea(doc.textArea, { + lineNumbers: true, + mode: type, + onCursorActivity: function() { + //documentController._codeEditor.editor.setLineClass(documentController._codeEditor.hline, null); + //documentController._codeEditor.hline = documentController._codeEditor.editor.setLineClass(documentController._codeEditor.editor.getCursor().line, "activeline"); + } + }); + + //this.application.ninja.documentController._codeEditor.hline = this.application.ninja.documentController._codeEditor.editor.setLineClass(0, "activeline"); + } } }, @@ -201,16 +187,16 @@ exports.StageView = Montage.create(Component, { } }, - hideOtherCodeView:{ + hideOtherDocuments:{ value:function(docUuid){ - var i=0; - if(this.element.hasChildNodes()){ - for(i=0;i --- js/stage/stage-view.reel/stage-view.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'js/stage/stage-view.reel/stage-view.js') diff --git a/js/stage/stage-view.reel/stage-view.js b/js/stage/stage-view.reel/stage-view.js index cf7748fc..6f20b87b 100755 --- a/js/stage/stage-view.reel/stage-view.js +++ b/js/stage/stage-view.reel/stage-view.js @@ -95,9 +95,12 @@ exports.StageView = Montage.create(Component, { //fix hack document.getElementById("codeMirror_"+doc.uuid).style.display="block"; + var documentController = this.application.ninja.documentController; + doc.editor = CodeMirror.fromTextArea(doc.textArea, { lineNumbers: true, mode: type, + onChange: function(){doc.dirtyFlag=true;}, onCursorActivity: function() { //documentController._codeEditor.editor.setLineClass(documentController._codeEditor.hline, null); //documentController._codeEditor.hline = documentController._codeEditor.editor.setLineClass(documentController._codeEditor.editor.getCursor().line, "activeline"); @@ -128,6 +131,8 @@ exports.StageView = Montage.create(Component, { this.application.ninja.stage._scrollFlag = false; // TODO HACK to prevent type error on Hide/Show Iframe this.application.ninja.documentController._showCurrentDocument(); + var documentController = this.application.ninja.documentController; + if(this.application.ninja.documentController.activeDocument.currentView === "code"){ var type; switch(doc.documentType) { @@ -143,6 +148,7 @@ exports.StageView = Montage.create(Component, { doc.editor = CodeMirror.fromTextArea(doc.textArea, { lineNumbers: true, mode: type, + onChange: function(){doc.dirtyFlag=true;}, onCursorActivity: function() { //documentController._codeEditor.editor.setLineClass(documentController._codeEditor.hline, null); //documentController._codeEditor.hline = documentController._codeEditor.editor.setLineClass(documentController._codeEditor.editor.getCursor().line, "activeline"); @@ -152,8 +158,15 @@ exports.StageView = Montage.create(Component, { //this.application.ninja.documentController._codeEditor.hline = this.application.ninja.documentController._codeEditor.editor.setLineClass(0, "activeline"); } + if(this.application.ninja.documentController.activeDocument.documentType === "htm" || this.application.ninja.documentController.activeDocument.documentType === "html") { + this.application.ninja.stage._scrollFlag = true; // TODO HACK to prevent type error on Hide/Show Iframe + // TODO dispatch event here + // appDelegateModule.MyAppDelegate.onSetActiveDocument(); + } + } }, + refreshCodeDocument:{ value:function(doc){ @@ -198,5 +211,17 @@ exports.StageView = Montage.create(Component, { } }, this); } + }, + showRulers:{ + value:function(){ + this.application.ninja.rulerTop.style.display = "block"; + this.application.ninja.rulerLeft.style.display = "block"; + } + }, + hideRulers:{ + value:function(){ + this.application.ninja.rulerTop.style.display = "none"; + this.application.ninja.rulerLeft.style.display = "none"; + } } }); \ No newline at end of file -- cgit v1.2.3 From 729bc48212d7244539c99ca206be673eed011115 Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Mon, 6 Feb 2012 16:07:46 -0800 Subject: integrated save for the document tabs, detect codemirror history to show document dirty indicator. Signed-off-by: Ananya Sen --- js/stage/stage-view.reel/stage-view.js | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) (limited to 'js/stage/stage-view.reel/stage-view.js') diff --git a/js/stage/stage-view.reel/stage-view.js b/js/stage/stage-view.reel/stage-view.js index 6f20b87b..f8817b13 100755 --- a/js/stage/stage-view.reel/stage-view.js +++ b/js/stage/stage-view.reel/stage-view.js @@ -76,10 +76,7 @@ exports.StageView = Montage.create(Component, { // Temporary function to create a Codemirror text view createTextView: { value: function(doc) { - //save current document - if(this.application.ninja.documentController.activeDocument.currentView === "code"){ - this.application.ninja.documentController.activeDocument.save(true); - } + this.application.ninja.documentController.activeDocument.save(true /*remove the codemirror div after saving*/); this.application.ninja.documentController._hideCurrentDocument(); this.hideOtherDocuments(doc.uuid); var type; @@ -100,7 +97,14 @@ exports.StageView = Montage.create(Component, { doc.editor = CodeMirror.fromTextArea(doc.textArea, { lineNumbers: true, mode: type, - onChange: function(){doc.dirtyFlag=true;}, + onChange: function(){ + var historySize = doc.editor.historySize(); + if((historySize.undo===0 && historySize.redo===0) || (historySize.undo>0)){ + doc.dirtyFlag=true; + }else if(historySize.undo===0 && historySize.redo>0){ + doc.dirtyFlag=false; + } + }, onCursorActivity: function() { //documentController._codeEditor.editor.setLineClass(documentController._codeEditor.hline, null); //documentController._codeEditor.hline = documentController._codeEditor.editor.setLineClass(documentController._codeEditor.editor.getCursor().line, "activeline"); @@ -118,13 +122,16 @@ exports.StageView = Montage.create(Component, { switchDocument:{ value: function(doc){ + this.application.ninja.documentController.activeDocument.save(true /*remove the codemirror div after saving*/); - //if dirty SAVE codemirror into textarea - if(this.application.ninja.documentController.activeDocument.currentView === "code"){ - this.application.ninja.documentController.activeDocument.save(true); + this.application.ninja.documentController._hideCurrentDocument(); + + + if(this.application.ninja.documentController.activeDocument.currentView === "design"){ + console.log("scrollLeft: "+ this.application.ninja.stage._iframeContainer.scrollLeft); + console.log("scrollTop: "+ this.application.ninja.stage._iframeContainer.scrollTop); } - this.application.ninja.documentController._hideCurrentDocument(); this.application.ninja.documentController.activeDocument = doc; @@ -148,7 +155,7 @@ exports.StageView = Montage.create(Component, { doc.editor = CodeMirror.fromTextArea(doc.textArea, { lineNumbers: true, mode: type, - onChange: function(){doc.dirtyFlag=true;}, + onChange: function(){doc.dirtyFlag=true;console.log("undo stack:",doc.editor.historySize());}, onCursorActivity: function() { //documentController._codeEditor.editor.setLineClass(documentController._codeEditor.hline, null); //documentController._codeEditor.hline = documentController._codeEditor.editor.setLineClass(documentController._codeEditor.editor.getCursor().line, "activeline"); @@ -160,6 +167,8 @@ exports.StageView = Montage.create(Component, { if(this.application.ninja.documentController.activeDocument.documentType === "htm" || this.application.ninja.documentController.activeDocument.documentType === "html") { this.application.ninja.stage._scrollFlag = true; // TODO HACK to prevent type error on Hide/Show Iframe + + // TODO dispatch event here // appDelegateModule.MyAppDelegate.onSetActiveDocument(); } -- cgit v1.2.3 From 36b2e540f06cef3887e7d0fea60527fee51e2a40 Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Wed, 8 Feb 2012 15:36:53 -0800 Subject: fixed undo/redo for each code view document, changed new file integration with io mediator Signed-off-by: Ananya Sen --- js/stage/stage-view.reel/stage-view.js | 83 +++++++++++++++++++--------------- 1 file changed, 46 insertions(+), 37 deletions(-) (limited to 'js/stage/stage-view.reel/stage-view.js') diff --git a/js/stage/stage-view.reel/stage-view.js b/js/stage/stage-view.reel/stage-view.js index f8817b13..1e85b4fd 100755 --- a/js/stage/stage-view.reel/stage-view.js +++ b/js/stage/stage-view.reel/stage-view.js @@ -76,7 +76,6 @@ exports.StageView = Montage.create(Component, { // Temporary function to create a Codemirror text view createTextView: { value: function(doc) { - this.application.ninja.documentController.activeDocument.save(true /*remove the codemirror div after saving*/); this.application.ninja.documentController._hideCurrentDocument(); this.hideOtherDocuments(doc.uuid); var type; @@ -93,13 +92,12 @@ exports.StageView = Montage.create(Component, { document.getElementById("codeMirror_"+doc.uuid).style.display="block"; var documentController = this.application.ninja.documentController; - doc.editor = CodeMirror.fromTextArea(doc.textArea, { lineNumbers: true, mode: type, onChange: function(){ var historySize = doc.editor.historySize(); - if((historySize.undo===0 && historySize.redo===0) || (historySize.undo>0)){ + if(historySize.undo>0){ doc.dirtyFlag=true; }else if(historySize.undo===0 && historySize.redo>0){ doc.dirtyFlag=false; @@ -122,16 +120,11 @@ exports.StageView = Montage.create(Component, { switchDocument:{ value: function(doc){ - this.application.ninja.documentController.activeDocument.save(true /*remove the codemirror div after saving*/); - - this.application.ninja.documentController._hideCurrentDocument(); - - - if(this.application.ninja.documentController.activeDocument.currentView === "design"){ - console.log("scrollLeft: "+ this.application.ninja.stage._iframeContainer.scrollLeft); - console.log("scrollTop: "+ this.application.ninja.stage._iframeContainer.scrollTop); + //save editor cursor position + if(!!this.application.ninja.documentController.activeDocument.editor){ + this.application.ninja.documentController.activeDocument.hline = this.application.ninja.documentController.activeDocument.editor.getCursor(true); } - + this.application.ninja.documentController._hideCurrentDocument(); this.application.ninja.documentController.activeDocument = doc; @@ -140,34 +133,15 @@ exports.StageView = Montage.create(Component, { var documentController = this.application.ninja.documentController; - if(this.application.ninja.documentController.activeDocument.currentView === "code"){ - var type; - switch(doc.documentType) { - case "css" : - type = "css"; - break; - case "js" : - type = "javascript"; - break; - } - - //add the codemirror div again for editting - doc.editor = CodeMirror.fromTextArea(doc.textArea, { - lineNumbers: true, - mode: type, - onChange: function(){doc.dirtyFlag=true;console.log("undo stack:",doc.editor.historySize());}, - onCursorActivity: function() { - //documentController._codeEditor.editor.setLineClass(documentController._codeEditor.hline, null); - //documentController._codeEditor.hline = documentController._codeEditor.editor.setLineClass(documentController._codeEditor.editor.getCursor().line, "activeline"); - } - }); - - //this.application.ninja.documentController._codeEditor.hline = this.application.ninja.documentController._codeEditor.editor.setLineClass(0, "activeline"); + //restore editor cursor position + if(!!this.application.ninja.documentController.activeDocument.editor){ + this.application.ninja.documentController.activeDocument.editor.setCursor(this.application.ninja.documentController.activeDocument.hline); + document.getElementById("codeMirror_"+this.application.ninja.documentController.activeDocument.uuid).getElementsByClassName("CodeMirror")[0].focus(); } - if(this.application.ninja.documentController.activeDocument.documentType === "htm" || this.application.ninja.documentController.activeDocument.documentType === "html") { + if(this.application.ninja.documentController.activeDocument.currentView === "design") { this.application.ninja.stage._scrollFlag = true; // TODO HACK to prevent type error on Hide/Show Iframe - + this.application.ninja.currentDocument = this.application.ninja.documentController.activeDocument; // TODO dispatch event here // appDelegateModule.MyAppDelegate.onSetActiveDocument(); @@ -232,5 +206,40 @@ exports.StageView = Montage.create(Component, { this.application.ninja.rulerTop.style.display = "none"; this.application.ninja.rulerLeft.style.display = "none"; } + }, + + switchViews: { + value: function() { + + //save file if dirty + + this.application.ninja.stage.saveStageScroll(); + this.application.ninja.documentController._hideCurrentDocument(); + + if(this.application.ninja.documentController.activeDocument.currentView === "design") { + this.application.ninja.documentController._textHolder.style.display = "none"; + this.application.ninja.documentController.activeDocument.container.style["display"] = "block"; + this.application.ninja.stage._scrollFlag = true; + //this._showCurrentDocument(); + this.application.ninja.stage.applySavedScroll(); + + } else { + this.application.ninja.stage._scrollFlag = false; // TODO HACK to prevent type error on Hide/Show Iframe + + var codeview = this.application.ninja.documentController.activeDocument.container; + //this._textHolder.style.display = "block"; + //codeview.firstChild.innerHTML = this.activeDocument.iframe.contentWindow.document.body.parentNode.innerHTML; + +// this._codeEditor.editor = CodeMirror.fromTextArea(codeview.firstChild, { +// lineNumbers: true, +// mode: "htmlmixed", +// onCursorActivity: function() { +// DocumentController._codeEditor.editor.setLineClass(DocumentController._codeEditor.hline, null); +// DocumentController._codeEditor.hline = DocumentController._codeEditor.editor.setLineClass(DocumentController._codeEditor.editor.getCursor().line, "activeline"); +// } +// }); +// this._codeEditor.hline = DocumentController._codeEditor.editor.setLineClass(0, "activeline"); + } + } } }); \ No newline at end of file -- cgit v1.2.3 From 8c40940f030adb74f534c3c5ad8d845e41f09b30 Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Fri, 10 Feb 2012 11:04:42 -0800 Subject: hide iframeContainer if we want to open code view as the first document after ninja launches Signed-off-by: Ananya Sen --- js/stage/stage-view.reel/stage-view.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'js/stage/stage-view.reel/stage-view.js') diff --git a/js/stage/stage-view.reel/stage-view.js b/js/stage/stage-view.reel/stage-view.js index 1e85b4fd..31ace49c 100755 --- a/js/stage/stage-view.reel/stage-view.js +++ b/js/stage/stage-view.reel/stage-view.js @@ -113,6 +113,8 @@ exports.StageView = Montage.create(Component, { this.application.ninja.stage._scrollFlag = false; // TODO HACK to prevent type error on Hide/Show Iframe this.application.ninja.documentController.activeDocument = doc; this.application.ninja.stage.hideCanvas(true); + + document.getElementById("iframeContainer").style.display="none";//hide the iframe when switching to code view } }, -- cgit v1.2.3 From 4937b39fb0cf542f57cdadc7d1e2ed9798f7ef87 Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Wed, 15 Feb 2012 16:09:14 -0800 Subject: fixes to document tabbing Signed-off-by: Ananya Sen --- js/stage/stage-view.reel/stage-view.js | 1 - 1 file changed, 1 deletion(-) (limited to 'js/stage/stage-view.reel/stage-view.js') diff --git a/js/stage/stage-view.reel/stage-view.js b/js/stage/stage-view.reel/stage-view.js index 31ace49c..2144af84 100755 --- a/js/stage/stage-view.reel/stage-view.js +++ b/js/stage/stage-view.reel/stage-view.js @@ -187,7 +187,6 @@ exports.StageView = Montage.create(Component, { }, hideOtherDocuments:{ value:function(docUuid){ - //use CodeMirror toTextArea() to remove editor and save content into textarea this.application.ninja.documentController._documents.forEach(function(aDoc){ if(aDoc.currentView === "design"){ aDoc.container.parentNode.style["display"] = "none"; -- cgit v1.2.3 From 302ae3c1812086d976eb67c9cf693c43205f3904 Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Thu, 16 Feb 2012 11:13:05 -0800 Subject: hide the rulers when no document is open Signed-off-by: Ananya Sen --- js/stage/stage-view.reel/stage-view.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'js/stage/stage-view.reel/stage-view.js') diff --git a/js/stage/stage-view.reel/stage-view.js b/js/stage/stage-view.reel/stage-view.js index 2144af84..cd19f361 100755 --- a/js/stage/stage-view.reel/stage-view.js +++ b/js/stage/stage-view.reel/stage-view.js @@ -123,7 +123,7 @@ exports.StageView = Montage.create(Component, { switchDocument:{ value: function(doc){ //save editor cursor position - if(!!this.application.ninja.documentController.activeDocument.editor){ + if(!!this.application.ninja.documentController.activeDocument && !!this.application.ninja.documentController.activeDocument.editor){ this.application.ninja.documentController.activeDocument.hline = this.application.ninja.documentController.activeDocument.editor.getCursor(true); } this.application.ninja.documentController._hideCurrentDocument(); @@ -136,7 +136,7 @@ exports.StageView = Montage.create(Component, { var documentController = this.application.ninja.documentController; //restore editor cursor position - if(!!this.application.ninja.documentController.activeDocument.editor){ + if(!!this.application.ninja.documentController.activeDocument && !!this.application.ninja.documentController.activeDocument.editor){ this.application.ninja.documentController.activeDocument.editor.setCursor(this.application.ninja.documentController.activeDocument.hline); document.getElementById("codeMirror_"+this.application.ninja.documentController.activeDocument.uuid).getElementsByClassName("CodeMirror")[0].focus(); } -- cgit v1.2.3 From 729e32ee70b0dd30a3b498ed7d1636b1b5b56a43 Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Thu, 16 Feb 2012 11:18:21 -0800 Subject: Squashed commit of the following: commit 302ae3c1812086d976eb67c9cf693c43205f3904 Author: Ananya Sen Date: Thu Feb 16 11:13:05 2012 -0800 hide the rulers when no document is open Signed-off-by: Ananya Sen commit 2e766c9eaa98fa20f311b3eb2f892a1a240e90cf Author: Ananya Sen Date: Thu Feb 16 06:43:33 2012 -0800 file picker: Enable ok if user double clicks folder and enter it. Validate path if user enter it manually in addressbar. Signed-off-by: Ananya Sen commit 4937b39fb0cf542f57cdadc7d1e2ed9798f7ef87 Author: Ananya Sen Date: Wed Feb 15 16:09:14 2012 -0800 fixes to document tabbing Signed-off-by: Ananya Sen commit 56d2a8d11a73cd04c7f1bc20d1ded52b9c1242f2 Author: Ananya Sen Date: Wed Feb 15 10:54:38 2012 -0800 Revert "Revert "Creating NinjaTemplate to HTML function"" This reverts commit 2e308be9bec5e06d81b2905b65005a232f0a190d. Signed-off-by: Ananya Sen commit e2b97c951a9a5a0c4ff831d44fdd82177cbd82ad Author: Ananya Sen Date: Wed Feb 15 10:54:14 2012 -0800 Revert "Revert "Reverting text/html document classes and setting up MVC folder structure"" This reverts commit 9048cd50bf5e0a418d1d95498bb593961f72db36. Signed-off-by: Ananya Sen commit aead95ce4b2571356701229567bfde73d54bed93 Author: Ananya Sen Date: Wed Feb 15 10:53:55 2012 -0800 Revert "Revert "Cleaning up"" This reverts commit a90e3be8850b64e8e370aa8ff8cadaa448dd0c82. Signed-off-by: Ananya Sen commit a8d1a2e1f4f4ab7b9298bfbd1b49731785c79c3a Author: Ananya Sen Date: Wed Feb 15 10:52:56 2012 -0800 Revert "Revert "Merging TextDocument into BaseDocument"" This reverts commit b8782f2e3dd106accbb0160a98e6b498f26752ea. Signed-off-by: Ananya Sen commit e864dc319805e259b7ae39a9d4d96fac552a1f87 Author: Ananya Sen Date: Wed Feb 15 10:52:38 2012 -0800 Revert "merging from github.com/joseeight/ninja-internal/tree/FileIO is breaking opening html files… to trying to fix local build" This reverts commit 3cf1d19c5cdc9534d9c87cbc7d1fcf48e68daa42. Signed-off-by: Ananya Sen commit 3cf1d19c5cdc9534d9c87cbc7d1fcf48e68daa42 Author: Ananya Sen Date: Wed Feb 15 10:06:42 2012 -0800 merging from github.com/joseeight/ninja-internal/tree/FileIO is breaking opening html files… to trying to fix local build Signed-off-by: Ananya Sen commit b8782f2e3dd106accbb0160a98e6b498f26752ea Author: Ananya Sen Date: Wed Feb 15 10:01:59 2012 -0800 Revert "Merging TextDocument into BaseDocument" This reverts commit 93c8f327d662a7693d1d6ca050a0efd15ebc18ed. Conflicts: js/controllers/document-controller.js Signed-off-by: Ananya Sen commit a90e3be8850b64e8e370aa8ff8cadaa448dd0c82 Author: Ananya Sen Date: Wed Feb 15 09:58:37 2012 -0800 Revert "Cleaning up" This reverts commit a7952c5a16e2cae3fd1a459b03b9f16bba1004da. Conflicts: js/controllers/document-controller.js js/io/document/text-document.js Signed-off-by: Ananya Sen commit 9048cd50bf5e0a418d1d95498bb593961f72db36 Author: Ananya Sen Date: Wed Feb 15 09:51:12 2012 -0800 Revert "Reverting text/html document classes and setting up MVC folder structure" This reverts commit 68ce64a5a2f4a71b54d33916aaf1d57161302425. Signed-off-by: Ananya Sen commit 2e308be9bec5e06d81b2905b65005a232f0a190d Author: Ananya Sen Date: Wed Feb 15 09:50:20 2012 -0800 Revert "Creating NinjaTemplate to HTML function" This reverts commit e327eccb93e2bc513fcbb7ab302783d6bce83884. Signed-off-by: Ananya Sen --- js/stage/stage-view.reel/stage-view.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'js/stage/stage-view.reel/stage-view.js') diff --git a/js/stage/stage-view.reel/stage-view.js b/js/stage/stage-view.reel/stage-view.js index 31ace49c..cd19f361 100755 --- a/js/stage/stage-view.reel/stage-view.js +++ b/js/stage/stage-view.reel/stage-view.js @@ -123,7 +123,7 @@ exports.StageView = Montage.create(Component, { switchDocument:{ value: function(doc){ //save editor cursor position - if(!!this.application.ninja.documentController.activeDocument.editor){ + if(!!this.application.ninja.documentController.activeDocument && !!this.application.ninja.documentController.activeDocument.editor){ this.application.ninja.documentController.activeDocument.hline = this.application.ninja.documentController.activeDocument.editor.getCursor(true); } this.application.ninja.documentController._hideCurrentDocument(); @@ -136,7 +136,7 @@ exports.StageView = Montage.create(Component, { var documentController = this.application.ninja.documentController; //restore editor cursor position - if(!!this.application.ninja.documentController.activeDocument.editor){ + if(!!this.application.ninja.documentController.activeDocument && !!this.application.ninja.documentController.activeDocument.editor){ this.application.ninja.documentController.activeDocument.editor.setCursor(this.application.ninja.documentController.activeDocument.hline); document.getElementById("codeMirror_"+this.application.ninja.documentController.activeDocument.uuid).getElementsByClassName("CodeMirror")[0].focus(); } @@ -187,7 +187,6 @@ exports.StageView = Montage.create(Component, { }, hideOtherDocuments:{ value:function(docUuid){ - //use CodeMirror toTextArea() to remove editor and save content into textarea this.application.ninja.documentController._documents.forEach(function(aDoc){ if(aDoc.currentView === "design"){ aDoc.container.parentNode.style["display"] = "none"; -- cgit v1.2.3 From 09a8bda18d6408547645d4d707a504a2fbbb5db9 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Thu, 16 Feb 2012 15:48:38 -0800 Subject: Fixed the stage scroll by hiding the rulers. Signed-off-by: Valerio Virgillito --- js/stage/stage-view.reel/stage-view.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'js/stage/stage-view.reel/stage-view.js') diff --git a/js/stage/stage-view.reel/stage-view.js b/js/stage/stage-view.reel/stage-view.js index cd19f361..46d74e13 100755 --- a/js/stage/stage-view.reel/stage-view.js +++ b/js/stage/stage-view.reel/stage-view.js @@ -198,14 +198,14 @@ exports.StageView = Montage.create(Component, { }, showRulers:{ value:function(){ - this.application.ninja.rulerTop.style.display = "block"; - this.application.ninja.rulerLeft.style.display = "block"; + this.application.ninja.rulerTop.style.background = "url('../images/temp/ruler-top.png')"; + this.application.ninja.rulerLeft.style.background = "url('../images/temp/ruler-left.png')"; } }, hideRulers:{ value:function(){ - this.application.ninja.rulerTop.style.display = "none"; - this.application.ninja.rulerLeft.style.display = "none"; + this.application.ninja.rulerTop.style.background = "rgb(128,128,128)"; + this.application.ninja.rulerLeft.style.background = "rgb(128,128,128)"; } }, -- cgit v1.2.3 From a7e3ef9f80d5e29515c9f8dd5374c89b9d2496de Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Fri, 17 Feb 2012 12:39:12 -0800 Subject: use method to update dirtyFlag Signed-off-by: Ananya Sen --- js/stage/stage-view.reel/stage-view.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'js/stage/stage-view.reel/stage-view.js') diff --git a/js/stage/stage-view.reel/stage-view.js b/js/stage/stage-view.reel/stage-view.js index cd19f361..7ee41fb4 100755 --- a/js/stage/stage-view.reel/stage-view.js +++ b/js/stage/stage-view.reel/stage-view.js @@ -98,9 +98,9 @@ exports.StageView = Montage.create(Component, { onChange: function(){ var historySize = doc.editor.historySize(); if(historySize.undo>0){ - doc.dirtyFlag=true; + doc.markDocumentEditted(); }else if(historySize.undo===0 && historySize.redo>0){ - doc.dirtyFlag=false; + doc.markDocumentUneditted(); } }, onCursorActivity: function() { -- cgit v1.2.3 From 96178309ddcdb54c0c451b69ea6fb8cdf76fcf62 Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Fri, 17 Feb 2012 12:54:07 -0800 Subject: renamed methods to use better words Signed-off-by: Ananya Sen --- js/stage/stage-view.reel/stage-view.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'js/stage/stage-view.reel/stage-view.js') diff --git a/js/stage/stage-view.reel/stage-view.js b/js/stage/stage-view.reel/stage-view.js index 7ee41fb4..0b74105c 100755 --- a/js/stage/stage-view.reel/stage-view.js +++ b/js/stage/stage-view.reel/stage-view.js @@ -98,9 +98,9 @@ exports.StageView = Montage.create(Component, { onChange: function(){ var historySize = doc.editor.historySize(); if(historySize.undo>0){ - doc.markDocumentEditted(); + doc.markEdited(); }else if(historySize.undo===0 && historySize.redo>0){ - doc.markDocumentUneditted(); + doc.markUnedited(); } }, onCursorActivity: function() { -- cgit v1.2.3 From b1daf0b285a4a96bfd0086709c20e3682d75551a Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Tue, 21 Feb 2012 14:32:17 -0800 Subject: fixing the dirty flag and removing sass changes Signed-off-by: Valerio Virgillito --- js/stage/stage-view.reel/stage-view.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'js/stage/stage-view.reel/stage-view.js') diff --git a/js/stage/stage-view.reel/stage-view.js b/js/stage/stage-view.reel/stage-view.js index 31f40d09..dc9980f0 100755 --- a/js/stage/stage-view.reel/stage-view.js +++ b/js/stage/stage-view.reel/stage-view.js @@ -98,9 +98,9 @@ exports.StageView = Montage.create(Component, { onChange: function(){ var historySize = doc.editor.historySize(); if(historySize.undo>0){ - doc.markEdited(); + doc.needsSave = true; }else if(historySize.undo===0 && historySize.redo>0){ - doc.markUnedited(); + doc.needsSave = false; } }, onCursorActivity: function() { -- cgit v1.2.3