From 44cac8a7e15dc1f975651b6d36000c0d6c0e5ceb Mon Sep 17 00:00:00 2001 From: Matt Pass Date: Mon, 29 Apr 2013 08:32:49 +0100 Subject: [PATCH] Live editing of HTML files Now when you have a stickyTab open and edit HTML files, it shows the live edits as you type --- editor.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/editor.php b/editor.php index ea60662..ec873f3 100644 --- a/editor.php +++ b/editor.php @@ -179,6 +179,14 @@ function createNewCMInstance(num) { clearTimeout(window['cM'+num+'waiting']); window['cM'+num+'waiting'] = setTimeout(top.ICEcoder.updateHints, 100); } + // Update HTML edited files live + if (top.ICEcoder.stickyTab.location) { + var filename = top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1]; + var fileExt = filename.substr(filename.lastIndexOf(".")+1); + if (["htm","html"].indexOf(fileExt) > -1) { + top.ICEcoder.stickyTab.document.documentElement.innerHTML = window['cM'+num].getValue(); + } + }; } );