tabWidth changable & Zip It! on Demand

useNewSettings now takes a tabWidth param
This changes the width of all open documents in CM instance
New function to call Zip It! plugin on demand with target
(This means you can zip anything up from the file manager menu)
This commit is contained in:
Matt Pass
2012-06-17 16:17:31 +01:00
parent 7c8c728ad4
commit 25b5af50c2

View File

@@ -1479,7 +1479,7 @@ var ICEcoder = {
},
// Update the settings used when we make a change to them
useNewSettings: function(themeURL,tabsIndent,codeAssist,lockedNav,visibleTabs,refreshFM) {
useNewSettings: function(themeURL,tabsIndent,codeAssist,lockedNav,visibleTabs,tabWidth,refreshFM) {
var styleNode, strCSS, cMCSS;
// Add new stylesheet for selected theme
@@ -1510,6 +1510,14 @@ var ICEcoder = {
cMCSS = ICEcoder.content.contentWindow.document;
visibleTabs ? cMCSS.styleSheets[2][strCSS][5].style['content'] = '"\\21e5"' : cMCSS.styleSheets[2][strCSS][5].style['content'] = '" "';
top.tabWidth = tabWidth;
for (i=0;i<top.ICEcoder.openFiles.length;i++) {
for (var i=0;i<ICEcoder.cMInstances.length;i++) {
ICEcoder.content.contentWindow['cM'+ICEcoder.cMInstances[i]].setOption("indentUnit", top.tabWidth);
ICEcoder.content.contentWindow['cM'+ICEcoder.cMInstances[i]].setOption("tabSize", top.tabWidth);
}
}
// Finally, refresh the file manager if we need to
if (refreshFM) {top.ICEcoder.refreshFileManager()};
},
@@ -1560,5 +1568,11 @@ var ICEcoder = {
screenIcon.src.indexOf("images/full-screen.gif") > -1 ? screenIcon.src = "images/restored-screen.gif" : screenIcon.src = "images/full-screen.gif";
},
// Pass target file/folder to Zip It!
zipIt: function(tgt) {
tgt=tgt.replace(top.fullPath+"/","").replace(/\//g,"|");
top.ICEcoder.filesFrame.contentWindow.frames['fileControl'].location.href="plugins/zip-it/index.php?zip="+tgt;
}
};