From df685b308e21f5e0c8fc1cd24985d527d335b88b Mon Sep 17 00:00:00 2001 From: Matt Pass Date: Fri, 14 Nov 2014 09:50:44 +0000 Subject: [PATCH] updateDiffOnSave available in JS Used in if statement to determine if we should do this or not --- index.php | 1 + lib/file-control-xhr.php | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/index.php b/index.php index 914b258..f122d97 100644 --- a/index.php +++ b/index.php @@ -89,6 +89,7 @@ $t = $text['index']; echo "top.ICEcoder.theme = '".($ICEcoder["theme"]=="default" ? 'icecoder' : $ICEcoder["theme"])."';". "top.ICEcoder.fontSize = '".$ICEcoder["fontSize"]."';". "top.ICEcoder.openLastFiles = ".($ICEcoder["openLastFiles"] ? 'true' : 'false').";". + "top.ICEcoder.updateDiffOnSave = ".($ICEcoder["updateDiffOnSave"] ? 'true' : 'false').";". "top.ICEcoder.codeAssist = ".($ICEcoder["codeAssist"] ? 'true' : 'false').";". "top.ICEcoder.lineWrapping = ".($ICEcoder["lineWrapping"] ? 'true' : 'false').";". "top.ICEcoder.indentWithTabs = ".($ICEcoder["indentWithTabs"] ? 'true' : 'false').";". diff --git a/lib/file-control-xhr.php b/lib/file-control-xhr.php index e3276bd..ce01f74 100644 --- a/lib/file-control-xhr.php +++ b/lib/file-control-xhr.php @@ -195,12 +195,19 @@ if (!$error && $_GET['action']=="save") { };'; + // Copy over content to diff pane if we have that setting on + $doNext .= ' + cM = top.ICEcoder.getcMInstance(); + cMdiff = top.ICEcoder.getcMdiffInstance(); + if (top.ICEcoder.updateDiffOnSave) { + cMdiff.setValue(cM.getValue()); + }; + '; // Finally, set previous files, indicate changes, set saved points and redo tabs $doNext .= ' top.ICEcoder.setPreviousFiles(); setTimeout(function(){top.ICEcoder.indicateChanges()},4); - cM = top.ICEcoder.getcMInstance(); top.ICEcoder.savedPoints[top.ICEcoder.selectedTab-1] = cM.changeGeneration(); top.ICEcoder.redoTabHighlight(top.ICEcoder.selectedTab);';