From 7a94696e19b14e15261df516e2ba75e693b1313d Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Fri, 18 May 2012 00:21:56 -0700 Subject: enabling basic document switching Signed-off-by: Valerio Virgillito --- js/stage/stage-view.reel/stage-view.js | 22 ---------------------- 1 file changed, 22 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 ba94fadf..757c5e51 100755 --- a/js/stage/stage-view.reel/stage-view.js +++ b/js/stage/stage-view.reel/stage-view.js @@ -112,28 +112,6 @@ exports.StageView = Montage.create(Component, { */ switchDocument:{ value: function(doc){ - this.application.ninja.documentController._hideCurrentDocument(); - this.application.ninja.documentController.activeDocument = doc; - - if(this.application.ninja.documentController.activeDocument.currentView === "design") { - this.application.ninja.currentDocument = this.application.ninja.documentController.activeDocument; - } - - this.application.ninja.stage._scrollFlag = false; // TODO HACK to prevent type error on Hide/Show Iframe - - -// this.application.ninja.documentController._showCurrentDocument(); - // Inline function below - if(this.activeDocument) { - this.activeDocument.container.style["display"] = "block"; - if(this.activeDocument.currentView === "design"){ - this.activeDocument.container.parentNode.style["display"] = "block"; - this.activeDocument.restoreAppState(); - } else { - //hide the iframe when switching to code view - document.getElementById("iframeContainer").style.display = "none"; - } - } //focus editor -- cgit v1.2.3 From 7a22f7b368ef549a5b30c58a0f3900685b764bdb Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Fri, 18 May 2012 16:56:16 -0700 Subject: integrated open code view document in new dom architecture Signed-off-by: Ananya Sen --- js/stage/stage-view.reel/stage-view.js | 120 +-------------------------------- 1 file changed, 1 insertion(+), 119 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 ba94fadf..e8f29306 100755 --- a/js/stage/stage-view.reel/stage-view.js +++ b/js/stage/stage-view.reel/stage-view.js @@ -31,81 +31,6 @@ exports.StageView = Montage.create(Component, { } }, - /** - * Public method - * Creates a textarea element 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; - } - }, - - /** - * Public method - * Creates a new instance of a code editor - */ - createTextView: { - value: function(doc) { - var type; - this.application.ninja.documentController._hideCurrentDocument(); - this.hideOtherDocuments(doc.uuid); - - switch(doc.documentType) { - case "css" : - type = "css"; - break; - case "js" : - type = "javascript"; - break; - case "html" : - type = "htmlmixed"; - break; - case "json" : - type = "javascript"; - break; - case "php" : - type = "php"; - break; - case "pl" : - type = "perl"; - break; - case "py" : - type = "python"; - break; - case "rb" : - type = "ruby"; - break; - case "xml" : - type = "xml"; - break; - } - document.getElementById("codeMirror_"+doc.uuid).style.display="block"; - - doc.editor = this.application.ninja.codeEditorController.createEditor(doc, type, doc.documentType); - doc.editor.hline = doc.editor.setLineClass(0, "activeline"); - - 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 - - this.showCodeViewBar(true); - this.application.ninja.codeEditorController.applySettings(); - this.collapseAllPanels(); - } - }, - /** * Public method * Switches between documents. Document state data is saved and restored whereever applicable @@ -157,16 +82,6 @@ exports.StageView = Montage.create(Component, { } }, - /** - * Public method - * Switches between different views of a design document, like HTML design view, HTML code view - */ - switchDesignDocViews: { - value: function() { - //TODO - } - }, - showRulers:{ value:function(){ this.application.ninja.rulerTop.style.display = "block"; @@ -178,39 +93,6 @@ exports.StageView = Montage.create(Component, { this.application.ninja.rulerTop.style.display = "none"; this.application.ninja.rulerLeft.style.display = "none"; } - }, - showCodeViewBar:{ - value:function(isCodeView){ - if(isCodeView === true) { - this.application.ninja.editorViewOptions.element.style.display = "block"; - this.application.ninja.documentBar.element.style.display = "none"; - } else { - this.application.ninja.documentBar.element.style.display = "block"; - this.application.ninja.editorViewOptions.element.style.display = "none"; - } - } - }, - - collapseAllPanels:{ - value:function(){ - this.application.ninja.panelSplitter.collapse(); - this.application.ninja.timelineSplitter.collapse(); - this.application.ninja.toolsSplitter.collapse(); - this.application.ninja.optionsSplitter.collapse(); - } - }, - restoreAllPanels:{ - value:function(){ - this.application.ninja.panelSplitter.restore(); - this.application.ninja.timelineSplitter.restore(); - this.application.ninja.toolsSplitter.restore(); - this.application.ninja.optionsSplitter.restore(); - } - }, - - applyTheme:{ - value:function(themeClass){ - this.element.className = "codeViewContainer "+themeClass; - } } + }); \ No newline at end of file -- cgit v1.2.3 From 2cc8e58f6bb9f64a7473e62aecd013fa55167231 Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Mon, 21 May 2012 16:42:26 -0700 Subject: - added opening multiple code and design view documents - switching between multiple code and design view documents - Note: closing of documents, when multiple documents are open, is not yet implemented Signed-off-by: Ananya Sen --- js/stage/stage-view.reel/stage-view.js | 14 -------------- 1 file changed, 14 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 139fa032..2c129ee2 100755 --- a/js/stage/stage-view.reel/stage-view.js +++ b/js/stage/stage-view.reel/stage-view.js @@ -58,19 +58,5 @@ exports.StageView = Montage.create(Component, { NJevent("switchDocument"); } - }, - - 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