mirror of
https://github.com/icecoder/ICEcoder.git
synced 2026-03-16 05:17:01 +01:00
Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4b274f959e | ||
|
|
e66811a4e2 | ||
|
|
139bfe775c | ||
|
|
feb26af4bf | ||
|
|
27d75f810a | ||
|
|
bc251d8c2b | ||
|
|
bde9010000 | ||
|
|
91314f423f | ||
|
|
2bb0a361aa | ||
|
|
5517bf80f9 | ||
|
|
f141e6f7a7 | ||
|
|
7220288460 | ||
|
|
d9f4955736 | ||
|
|
13255bc58b |
@@ -1,4 +1,4 @@
|
||||
#ICEcoder v0.9.1 beta
|
||||
#ICEcoder
|
||||
##Web based IDE for smart web development
|
||||
|
||||
Early version of the web based IDE which allows for creation of websites in the web browser. Uses the brilliant CodeMirror for code highlighting & editing, with a slick IDE wrapped around it to make the whole thing work.
|
||||
|
||||
14
editor.php
14
editor.php
@@ -3,7 +3,7 @@
|
||||
|
||||
<html style="margin: 0" onMouseDown="top.ICEcoder.mouseDown=true" onMouseUp="top.ICEcoder.mouseDown=false" onMouseMove="if(top.ICEcoder) {top.ICEcoder.getMouseXY(event,'editor');top.ICEcoder.canResizeFilesW()}">
|
||||
<head>
|
||||
<title>ICEcoder v <?php echo $ICEcoder["versionNo"];?> beta editor</title>
|
||||
<title>ICEcoder v <?php echo $ICEcoder["versionNo"];?> editor</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<link rel="stylesheet" href="<?php echo $ICEcoder["codeMirrorDir"]; ?>/lib/codemirror.css">
|
||||
<!--
|
||||
@@ -92,16 +92,16 @@ span.CodeMirror-matchhighlight {background: #555}
|
||||
<script>
|
||||
function createNewCMInstance(num) {
|
||||
var fileName = top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1];
|
||||
top.foldStyle = '<span style="position: absolute; display: inline-block; width: 13px; height: 13px; left: 0; background-color: #b00; color: #fff; text-align: center; cursor: pointer"><span style="position: relative; left: -1px">+</span></span> %N%';
|
||||
var codeFoldTag = CodeMirror.newFoldFunction(CodeMirror.tagRangeFinder,top.foldStyle);
|
||||
var codeFoldBrace = CodeMirror.newFoldFunction(CodeMirror.braceRangeFinder,top.foldStyle);
|
||||
top.ICEcoder.foldStyle = '<span style="position: absolute; display: inline-block; width: 13px; height: 13px; left: 0; background-color: #b00; color: #fff; text-align: center; cursor: pointer"><span style="position: relative; left: -1px">+</span></span> %N%';
|
||||
var codeFoldTag = CodeMirror.newFoldFunction(CodeMirror.tagRangeFinder,top.ICEcoder.foldStyle);
|
||||
var codeFoldBrace = CodeMirror.newFoldFunction(CodeMirror.braceRangeFinder,top.ICEcoder.foldStyle);
|
||||
|
||||
window['cM'+num] = CodeMirror(document.body, {
|
||||
mode: "application/x-httpd-php",
|
||||
lineNumbers: true,
|
||||
lineWrapping: true,
|
||||
indentUnit: top.tabWidth,
|
||||
tabSize: top.tabWidth,
|
||||
indentUnit: top.ICEcoder.tabWidth,
|
||||
tabSize: top.ICEcoder.tabWidth,
|
||||
indentWithTabs: true,
|
||||
electricChars: false,
|
||||
onCursorActivity: function(thisCM) {
|
||||
@@ -175,7 +175,7 @@ function createNewCMInstance(num) {
|
||||
},
|
||||
onGutterClick: !fileName || (fileName && fileName.indexOf(".js") == -1 && fileName.indexOf(".coffee") == -1 && fileName.indexOf(".php") && fileName.indexOf(".rb") == -1) ? codeFoldTag : codeFoldBrace,
|
||||
extraKeys: {
|
||||
"Tab": function(cm) {CodeMirror.commands[top.tabsIndent ? "defaultTab" : "insertTab"](cm);},
|
||||
"Tab": function(cm) {CodeMirror.commands[top.ICEcoder.tabsIndent ? "defaultTab" : "insertTab"](cm);},
|
||||
"Shift-Tab": "indentLess",
|
||||
"Ctrl-Up": function() {},
|
||||
"Ctrl-Down": function() {}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
<html onMouseDown="top.ICEcoder.mouseDown=true" onMouseUp="top.ICEcoder.mouseDown=false" onMouseMove="if(top.ICEcoder) {top.ICEcoder.getMouseXY(event,'files');top.ICEcoder.canResizeFilesW()}" onContextMenu="top.ICEcoder.rightClickedFile=top.ICEcoder.thisFileFolderLink; return top.ICEcoder.showMenu()" onClick="top.ICEcoder.selectFileFolder()">
|
||||
<head>
|
||||
<title>ICEcoder v <?php echo $ICEcoder["versionNo"];?> beta file manager</title>
|
||||
<title>ICEcoder v <?php echo $ICEcoder["versionNo"];?> file manager</title>
|
||||
<link rel="stylesheet" type="text/css" href="lib/files.css">
|
||||
<script src="lib/ice-coder.js" type="text/javascript"></script>
|
||||
</head>
|
||||
|
||||
58
index.php
58
index.php
@@ -1,23 +1,17 @@
|
||||
<?php
|
||||
include("lib/settings.php");
|
||||
<?php include("lib/settings.php");
|
||||
|
||||
// Check IP permissions
|
||||
if (!in_array($_SERVER["REMOTE_ADDR"], $_SESSION['allowedIPs']) && !in_array("*", $_SESSION['allowedIPs'])) {
|
||||
header('Location: /');
|
||||
};
|
||||
|
||||
$updateMsg = '';
|
||||
// Check for updates
|
||||
if ($ICEcoder["checkUpdates"]) {
|
||||
$icv = json_encode(file_get_contents("http://icecoder.net/latest-version.txt"));
|
||||
$icv = rtrim(ltrim($icv,'"'),'"\\n');
|
||||
if ($ICEcoder["versionNo"]<$icv) {
|
||||
$updateMsg = ';top.ICEcoder.message(\'ICEcoder '.$icv.' now released\n\nPlease upgrade\')';
|
||||
} else {
|
||||
$cmv = json_encode(file_get_contents("http://codemirror.net/latest-version.txt"));
|
||||
$cmv = rtrim(ltrim($cmv,'"'),'"\\n');
|
||||
if ($ICEcoder["cMThisVer"]<$cmv) {
|
||||
$updateMsg = ';top.ICEcoder.message(\'CodeMirror '.$cmv.' now released\n\nPlease upgrade\')';
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -25,16 +19,12 @@ if ($ICEcoder["checkUpdates"]) {
|
||||
|
||||
<html onMouseDown="top.ICEcoder.mouseDown=true" onMouseUp="top.ICEcoder.mouseDown=false" onMouseMove="if(top.ICEcoder) {top.ICEcoder.getMouseXY(event,'top');top.ICEcoder.canResizeFilesW()}">
|
||||
<head>
|
||||
<title>ICEcoder v <?php echo $ICEcoder["versionNo"];?> beta</title>
|
||||
<title>ICEcoder v <?php echo $ICEcoder["versionNo"];?></title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta name="robots" content="noindex, nofollow">
|
||||
<link rel="stylesheet" type="text/css" href="lib/ice-coder.css">
|
||||
<link rel="icon" type="image/png" href="favicon.png">
|
||||
<script>
|
||||
theme = "<?php echo $ICEcoder["theme"]=="default" ? 'icecoder' : $ICEcoder["theme"];?>";
|
||||
tabsIndent = <?php echo $ICEcoder["tabsIndent"] ? 'true' : 'false';?>;
|
||||
openLastFiles = <?php echo $ICEcoder["openLastFiles"] ? 'true' : 'false';?>;
|
||||
tabWidth = <?php echo $ICEcoder["tabWidth"]; ?>;
|
||||
iceRoot = "<?php echo $ICEcoder["root"]; ?>";
|
||||
|
||||
window.onbeforeunload = function() {
|
||||
@@ -43,20 +33,26 @@ window.onbeforeunload = function() {
|
||||
}
|
||||
}
|
||||
|
||||
previousFiles = [<?php
|
||||
if ($ICEcoder["previousFiles"]!="") {
|
||||
$openFilesArray = explode(",",$ICEcoder["previousFiles"]);
|
||||
echo "'".implode("','",$openFilesArray)."'";
|
||||
}
|
||||
?>];
|
||||
showFileMenu = function() {
|
||||
document.getElementById('fileMenu').style.display='inline-block';
|
||||
}
|
||||
</script>
|
||||
<script language="JavaScript" src="lib/ice-coder.js"></script>
|
||||
</head>
|
||||
|
||||
<body onLoad="ICEcoder.init()<?php echo $updateMsg.$onLoadExtras;?>" onResize="ICEcoder.setLayout()" onKeyDown="return ICEcoder.interceptKeys('coder',event);" onKeyUp="parent.ICEcoder.resetKeys(event);">
|
||||
<body onLoad="<?php
|
||||
echo 'top.ICEcoder.previousFiles = [';
|
||||
if ($ICEcoder["previousFiles"]!="") {
|
||||
$openFilesArray = explode(",",$ICEcoder["previousFiles"]);
|
||||
echo "'".implode("','",$openFilesArray)."'";
|
||||
}
|
||||
echo "];top.ICEcoder.theme = '";
|
||||
echo $ICEcoder["theme"]=="default" ? 'icecoder' : $ICEcoder["theme"];
|
||||
echo "'";
|
||||
echo ';top.ICEcoder.tabsIndent = ';
|
||||
echo $ICEcoder["tabsIndent"] ? 'true' : 'false';
|
||||
echo ';top.ICEcoder.openLastFiles = ';
|
||||
echo $ICEcoder["openLastFiles"] ? 'true' : 'false';
|
||||
echo ';top.ICEcoder.tabWidth = ';
|
||||
echo $ICEcoder["tabWidth"];
|
||||
?>;ICEcoder.init()<?php echo $updateMsg.$onLoadExtras;?>" onResize="ICEcoder.setLayout()" onKeyDown="return ICEcoder.interceptKeys('coder',event);" onKeyUp="parent.ICEcoder.resetKeys(event);">
|
||||
|
||||
<div id="blackMask" class="blackMask" onClick="ICEcoder.showHide('hide',this)" onContextMenu="return false">
|
||||
<div class="popupVCenter">
|
||||
@@ -77,23 +73,23 @@ showFileMenu = function() {
|
||||
|
||||
<div id="fileMenu" class="fileMenu" onMouseOver="ICEcoder.changeFilesW('expand')" onMouseOut="ICEcoder.changeFilesW('contract');this.style.display='none'" onContextMenu="return false">
|
||||
<span id="folderMenuItems">
|
||||
<a href="javascript:top.ICEcoder.newFile()" onMouseOver="showFileMenu()">New File</a>
|
||||
<a href="javascript:top.ICEcoder.newFolder()" onMouseOver="showFileMenu()">New Folder</a>
|
||||
<a href="javascript:top.ICEcoder.newFile()" onMouseOver="ICEcoder.showFileMenu()">New File</a>
|
||||
<a href="javascript:top.ICEcoder.newFolder()" onMouseOver="ICEcoder.showFileMenu()">New Folder</a>
|
||||
</span>
|
||||
<a href="javascript:top.ICEcoder.deleteFile(top.ICEcoder.rightClickedFile)" onMouseOver="showFileMenu()">Delete</a>
|
||||
<a href="javascript:top.ICEcoder.deleteFile(top.ICEcoder.rightClickedFile)" onMouseOver="ICEcoder.showFileMenu()">Delete</a>
|
||||
<span id="singleFileMenuItems">
|
||||
<a href="javascript:top.ICEcoder.renameFile(top.ICEcoder.rightClickedFile)" onMouseOver="showFileMenu()">Rename</a>
|
||||
<a href="javascript:window.open(top.ICEcoder.rightClickedFile)" onMouseOver="showFileMenu()">View Webpage</a>
|
||||
<a href="javascript:top.ICEcoder.renameFile(top.ICEcoder.rightClickedFile)" onMouseOver="ICEcoder.showFileMenu()">Rename</a>
|
||||
<a href="javascript:window.open(top.ICEcoder.rightClickedFile)" onMouseOver="ICEcoder.showFileMenu()">View Webpage</a>
|
||||
</span>
|
||||
<a href="javascript:top.ICEcoder.zipIt(top.ICEcoder.rightClickedFile)" onMouseOver="showFileMenu()">Zip It!</a>
|
||||
<a href="javascript:top.ICEcoder.propertiesScreen(top.ICEcoder.rightClickedFile)" onMouseOver="showFileMenu()">Properties</a>
|
||||
<a href="javascript:top.ICEcoder.zipIt(top.ICEcoder.rightClickedFile)" onMouseOver="ICEcoder.showFileMenu()">Zip It!</a>
|
||||
<a href="javascript:top.ICEcoder.propertiesScreen(top.ICEcoder.rightClickedFile)" onMouseOver="ICEcoder.showFileMenu()">Properties</a>
|
||||
</div>
|
||||
|
||||
<div id="header" class="header" onContextMenu="return false">
|
||||
<div class="plugins" id="pluginsContainer">
|
||||
<?php echo $pluginsDisplay; ?>
|
||||
</div>
|
||||
<div class="version">v <?php echo $ICEcoder["versionNo"];?> beta</div><img src="images/full-screen.gif" id="screenMode" class="screenModeIcon" onClick="top.ICEcoder.fullScreenSwitcher()">
|
||||
<div class="version">v <?php echo $ICEcoder["versionNo"];?></div><img src="images/full-screen.gif" id="screenMode" class="screenModeIcon" onClick="top.ICEcoder.fullScreenSwitcher()">
|
||||
<img src="images/ice-coder.png" class="logo" onClick="ICEcoder.helpScreen()" onContextMenu="ICEcoder.settingsScreen()">
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php include("settings.php");?>
|
||||
<?php
|
||||
// Get the save type if any
|
||||
$saveType = "";
|
||||
if (isset($_GET['saveType'])) {$saveType = strClean($_GET['saveType']);};
|
||||
|
||||
// Establish the filename/new filename
|
||||
@@ -97,7 +98,7 @@ if ($_GET['action']=="perms") {
|
||||
|
||||
// If we're due to delete a file...
|
||||
if ($_GET['action']=="delete") {
|
||||
$filesArray = split(";",$file); // May contain more than one file here
|
||||
$filesArray = explode(";",$file); // May contain more than one file here
|
||||
for ($i=0;$i<=count($filesArray)-1;$i++) {
|
||||
if (is_writable($iceRoot.$filesArray[$i])) {
|
||||
is_dir($iceRoot.$filesArray[$i])
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>ICE Coder <?php echo $ICEcoder["versionNo"];?> beta help</title>
|
||||
<title>ICEcoder <?php echo $ICEcoder["versionNo"];?> help</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<link rel="stylesheet" type="text/css" href="help.css">
|
||||
</head>
|
||||
|
||||
@@ -53,7 +53,7 @@ var ICEcoder = {
|
||||
|
||||
// Hide the loading screen & auto open last files?
|
||||
top.ICEcoder.showHide('hide',top.document.getElementById('loadingMask'));
|
||||
if (top.openLastFiles) {top.ICEcoder.autoOpenFiles()};
|
||||
if (top.ICEcoder.openLastFiles) {top.ICEcoder.autoOpenFiles()};
|
||||
|
||||
// Add drag based events to our tabs
|
||||
var tabs = document.querySelectorAll('.tab');
|
||||
@@ -103,7 +103,7 @@ var ICEcoder = {
|
||||
|
||||
// Resize the CodeMirror instances to match the window size
|
||||
setTimeout(function(){
|
||||
for (i=0;i<top.ICEcoder.openFiles.length;i++) {
|
||||
for (var i=0;i<top.ICEcoder.openFiles.length;i++) {
|
||||
top.ICEcoder.content.contentWindow['cM'+ICEcoder.cMInstances[i]].setSize("100%",top.ICEcoder.content.style.height);
|
||||
}},4);
|
||||
}
|
||||
@@ -216,7 +216,7 @@ var ICEcoder = {
|
||||
|
||||
// Switch the CodeMirror mode on demand
|
||||
switchMode: function() {
|
||||
var cM;
|
||||
var cM, fileName;
|
||||
|
||||
cM = ICEcoder.getcMInstance();
|
||||
fileName = ICEcoder.openFiles[ICEcoder.selectedTab-1];
|
||||
@@ -612,6 +612,11 @@ var ICEcoder = {
|
||||
return false;
|
||||
},
|
||||
|
||||
// Continue to show the file manager
|
||||
showFileMenu: function() {
|
||||
document.getElementById('fileMenu').style.display='inline-block';
|
||||
},
|
||||
|
||||
// Update the file manager tree list on demand
|
||||
updateFileManagerList: function(action,location,file,perms,oldName) {
|
||||
var actionElemType, cssStyle, perms, targetElem, locNest, newText, innerLI, newUL, newLI, elemType, nameLI, shortURL, newMouseOver;
|
||||
@@ -1006,14 +1011,11 @@ var ICEcoder = {
|
||||
|
||||
// Alter array indicating which files have changed
|
||||
redoChangedContent: function(evt) {
|
||||
var key;
|
||||
var cM;
|
||||
|
||||
key = evt.keyCode ? evt.keyCode : evt.which ? evt.which : evt.charCode;
|
||||
// Exclude a few keys such as Escape...
|
||||
if (top.ICEcoder.ctrlKeyDown==false && key!=27 && key!=20 && (key<16||key>19) && (key<37||key>40) && (key!=144||key!=145) && (key!=44||key!=45) && (key<33||key>36) && (key!=91||key!=92) && (key<112||key>123)) {
|
||||
ICEcoder.changedContent[ICEcoder.selectedTab-1] = 1;
|
||||
ICEcoder.redoTabHighlight(ICEcoder.selectedTab);
|
||||
}
|
||||
cM = ICEcoder.getcMInstance();
|
||||
ICEcoder.changedContent[ICEcoder.selectedTab-1] = cM.historySize().undo > 0 ? 1 : 0;
|
||||
ICEcoder.redoTabHighlight(ICEcoder.selectedTab);
|
||||
},
|
||||
|
||||
// Show & hide target element
|
||||
@@ -1033,7 +1035,7 @@ var ICEcoder = {
|
||||
|
||||
// Get the mouse position on demand
|
||||
getMouseXY: function(e,area) {
|
||||
var tempX, tempY, scrollTop;
|
||||
var tempX, tempY, scrollTop, winW;
|
||||
|
||||
top.ICEcoder.mouseX = e.pageX ? e.pageX : e.clientX + document.body.scrollLeft;
|
||||
top.ICEcoder.mouseY = e.pageY ? e.pageY : e.clientY + document.body.scrollTop;
|
||||
@@ -1044,6 +1046,8 @@ var ICEcoder = {
|
||||
if (area=="editor") {
|
||||
top.ICEcoder.mouseX += top.ICEcoder.filesW;
|
||||
}
|
||||
winW = window.innerWidth ? window.innerWidth : document.body.clientWidth;
|
||||
if (top.ICEcoder.mouseX > (winW-20)) {top.ICEcoder.mouseDown=false};
|
||||
top.ICEcoder.dragCursorTest();
|
||||
},
|
||||
|
||||
@@ -1157,7 +1161,7 @@ var ICEcoder = {
|
||||
cM = ICEcoder.getcMInstance();
|
||||
// Firstly, work out how many saves we have to carry out
|
||||
nextSaveID=0;
|
||||
for (i=0;i<ICEcoder.serverQueueItems.length;i++) {
|
||||
for (var i=0;i<ICEcoder.serverQueueItems.length;i++) {
|
||||
if (ICEcoder.serverQueueItems[i].indexOf('action=save')>0) {
|
||||
nextSaveID++;
|
||||
}
|
||||
@@ -1177,7 +1181,7 @@ var ICEcoder = {
|
||||
if (action=="del") {
|
||||
if (ICEcoder.serverQueueItems[0] && ICEcoder.serverQueueItems[0].indexOf('action=save')>0) {
|
||||
topSaveID = nextSaveID-1;
|
||||
for (i=1;i<topSaveID;i++) {
|
||||
for (var i=1;i<topSaveID;i++) {
|
||||
document.getElementById('saveTemp'+i).value = document.getElementById('saveTemp'+(i+1)).value;
|
||||
}
|
||||
element = document.getElementById('saveTemp'+topSaveID);
|
||||
@@ -1217,8 +1221,8 @@ var ICEcoder = {
|
||||
|
||||
// Opens the last files we had open
|
||||
autoOpenFiles: function() {
|
||||
for (var i=0;i<top.previousFiles.length;i++) {
|
||||
top.ICEcoder.rightClickedFile=top.ICEcoder.thisFileFolderLink=top.previousFiles[i].replace('|','/');
|
||||
for (var i=0;i<top.ICEcoder.previousFiles.length;i++) {
|
||||
top.ICEcoder.rightClickedFile=top.ICEcoder.thisFileFolderLink=top.ICEcoder.previousFiles[i].replace('|','/');
|
||||
top.ICEcoder.thisFileFolderType='file';
|
||||
top.ICEcoder.openFile();
|
||||
}
|
||||
@@ -1249,18 +1253,18 @@ var ICEcoder = {
|
||||
var styleNode, strCSS, cMCSS, activeLineBG;
|
||||
|
||||
// Add new stylesheet for selected theme
|
||||
top.theme = themeURL.slice(themeURL.lastIndexOf("/")+1,themeURL.lastIndexOf("."));
|
||||
if (top.theme=="editor") {top.theme="icecoder"};
|
||||
top.ICEcoder.theme = themeURL.slice(themeURL.lastIndexOf("/")+1,themeURL.lastIndexOf("."));
|
||||
if (top.ICEcoder.theme=="editor") {top.ICEcoder.theme="icecoder"};
|
||||
styleNode = document.createElement('link');
|
||||
styleNode.setAttribute('rel', 'stylesheet');
|
||||
styleNode.setAttribute('type', 'text/css');
|
||||
styleNode.setAttribute('href', themeURL);
|
||||
top.ICEcoder.content.contentWindow.document.getElementsByTagName('head')[0].appendChild(styleNode);
|
||||
activeLineBG = ["eclipse","elegant","neat"].indexOf(top.theme)>-1 ? "#ccc": "#000";
|
||||
activeLineBG = ["eclipse","elegant","neat"].indexOf(top.ICEcoder.theme)>-1 ? "#ccc": "#000";
|
||||
top.ICEcoder.switchTab(top.ICEcoder.selectedTab);
|
||||
|
||||
// Tabs indent setting
|
||||
top.tabsIndent = tabsIndent;
|
||||
top.ICEcoder.tabsIndent = tabsIndent;
|
||||
|
||||
// Check/uncheck Code Assist setting
|
||||
top.document.getElementById('codeAssist').checked = codeAssist;
|
||||
@@ -1277,10 +1281,10 @@ var ICEcoder = {
|
||||
cMCSS[strCSS][5].style['content'] = visibleTabs ? '"\\21e5"' : '" "';
|
||||
cMCSS[strCSS][2].style.cssText = "background: " + activeLineBG + " !important";
|
||||
|
||||
top.tabWidth = tabWidth;
|
||||
top.ICEcoder.tabWidth = tabWidth;
|
||||
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);
|
||||
ICEcoder.content.contentWindow['cM'+ICEcoder.cMInstances[i]].setOption("indentUnit", top.ICEcoder.tabWidth);
|
||||
ICEcoder.content.contentWindow['cM'+ICEcoder.cMInstances[i]].setOption("tabSize", top.ICEcoder.tabWidth);
|
||||
}
|
||||
|
||||
// Finally, refresh the file manager if we need to
|
||||
@@ -1421,7 +1425,7 @@ var ICEcoder = {
|
||||
for (var i=0;i<ICEcoder.cMInstances.length;i++) {
|
||||
ICEcoder.content.contentWindow['cM'+ICEcoder.cMInstances[i]].getWrapperElement().style.display = "none";
|
||||
}
|
||||
cM.setOption('theme',top.theme);
|
||||
cM.setOption('theme',top.ICEcoder.theme);
|
||||
cM.getWrapperElement().style.display = "block";
|
||||
|
||||
// Focus on & refresh our selected instance
|
||||
@@ -1520,7 +1524,7 @@ var ICEcoder = {
|
||||
cM = ICEcoder.getcMInstance();
|
||||
for(var i=1;i<=ICEcoder.changedContent.length;i++) {
|
||||
if (document.getElementById('closeTabButton'+i)) {
|
||||
document.getElementById('closeTabButton'+i).style.backgroundColor = ICEcoder.changedContent[i-1]==1 && cM.historySize().undo>0
|
||||
document.getElementById('closeTabButton'+i).style.backgroundColor = ICEcoder.changedContent[i-1]==1
|
||||
? "#b00" : "rgba(255,255,255,0.3)";
|
||||
}
|
||||
tColor = i==selectedTab ? "#000" : "#fff";
|
||||
@@ -1538,7 +1542,6 @@ var ICEcoder = {
|
||||
// Close the tab upon request
|
||||
closeTab: function(closeTabNum) {
|
||||
var cM, okToRemove, closeFileName;
|
||||
|
||||
cM = ICEcoder.getcMInstance();
|
||||
okToRemove = true;
|
||||
if (ICEcoder.changedContent[closeTabNum-1]==1) {
|
||||
@@ -1553,9 +1556,10 @@ var ICEcoder = {
|
||||
for (var i=closeTabNum;i<ICEcoder.openFiles.length;i++) {
|
||||
top.document.getElementById('tab'+i).innerHTML = top.document.getElementById('tab'+(i+1)).innerHTML;
|
||||
ICEcoder.openFiles[i-1] = ICEcoder.openFiles[i];
|
||||
ICEcoder.openFileMDTs[i-1] = ICEcoder.openFileMDTs[i];
|
||||
|
||||
// reduce the tab reference number on the closeTab link by 1
|
||||
top.document.getElementById('tab'+i).innerHTML = top.document.getElementById('tab'+i).innerHTML.replace(("closeTab("+(i+1)+")"),"closeTab("+i+")").replace(("closeTabButton("+(i+1)+")"),"closeTabButton("+i+")");
|
||||
top.document.getElementById('tab'+i).innerHTML = top.document.getElementById('tab'+i).innerHTML.replace(("closeTab("+(i+1)+")"),"closeTab("+i+")").replace(("closeTabButton"+(i+1)),"closeTabButton"+i);
|
||||
}
|
||||
// hide the instance we're closing by setting the hide class and removing from the array
|
||||
ICEcoder.content.contentWindow['cM'+top.ICEcoder.cMInstances[closeTabNum-1]].getWrapperElement().style.display = "none";
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>ICEcoder <?php echo $ICEcoder["versionNo"];?> beta multiple results screen</title>
|
||||
<title>ICEcoder <?php echo $ICEcoder["versionNo"];?> multiple results screen</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<link rel="stylesheet" type="text/css" href="multiple-results.css">
|
||||
</head>
|
||||
@@ -77,7 +77,7 @@ if (startTab!=top.ICEcoder.selectedTab) {
|
||||
}
|
||||
}
|
||||
if (userTarget.indexOf("all")>-1 || (userTarget.indexOf("selected")>-1 && foundInSelected)) {
|
||||
resultsDisplay += '<a href="javascript:top.ICEcoder.openFile(\'<?php echo $docRoot;?>'+targetURL.replace(/\|/g,"/").replace(/_perms/g,"")+'\');top.ICEcoder.showHide(\'hide\',top.document.getElementById(\'blackMask\'))">'+ targetURL.replace(/\|/g,"/").replace(/_perms/g,"").replace(/<?php echo str_replace("/","\/",$findText); ?>/g,"<b>"+findText+"</b>")+ '</a><br><div id="foundCount'+i+'">'+spansArray[i].innerHTML+', rename to '+targetURL.replace(/\|/g,"/").replace(/_perms/g,"").replace(/<?php echo str_replace("/","\/",$findText); ?>/g,"<b><?php echo strClean($_GET['replace']);?></b>")+'</div>';
|
||||
resultsDisplay += '<a href="javascript:top.ICEcoder.openFile(\'<?php echo $docRoot;?>'+targetURL.replace(/\|/g,"/").replace(/_perms/g,"")+'\');top.ICEcoder.showHide(\'hide\',top.document.getElementById(\'blackMask\'))">'+ targetURL.replace(/\|/g,"/").replace(/_perms/g,"").replace(/<?php echo str_replace("/","\/",$findText); ?>/g,"<b>"+findText+"</b>")+ '</a><br><div id="foundCount'+i+'">'+spansArray[i].innerHTML+', rename to '+targetURL.replace(/\|/g,"/").replace(/_perms/g,"").replace(/<?php echo str_replace("/","\/",$findText); ?>/g,"<b><?php if(isset($_GET['replace'])) {echo strClean($_GET['replace']);};?></b>")+'</div>';
|
||||
<?php if (isset($_GET['replace'])) { ?>
|
||||
resultsDisplay += '<div class="replace" id="replace" onClick="renameSingle('+i+');this.style.display=\'none\'">rename</div>';
|
||||
<?php ;}; ?>
|
||||
@@ -92,9 +92,11 @@ if (startTab!=top.ICEcoder.selectedTab) {
|
||||
$r = 0;
|
||||
function phpGrep($q, $path, $base) {
|
||||
$fp = opendir($path);
|
||||
$slash = $serverType == "Windows" ? "\\" : "/";
|
||||
global $r;
|
||||
global $ICEcoder;
|
||||
global $serverType;
|
||||
if (!isset($ret)) {$ret="";};
|
||||
$slash = $serverType == "Windows" ? "\\" : "/";
|
||||
while($f = readdir($fp)) {
|
||||
if(preg_match("#^\.+$#", $f)) continue;
|
||||
$fullPath = $path.$slash.$f;
|
||||
@@ -120,7 +122,7 @@ if (startTab!=top.ICEcoder.selectedTab) {
|
||||
return $ret;
|
||||
}
|
||||
|
||||
$results = phpGrep($findText, $docRoot.$ICEroot, $docRoot.$ICEroot);
|
||||
$results = phpGrep($findText, $docRoot.$iceRoot, $docRoot.$iceRoot);
|
||||
echo 'resultsDisplay += "'.$results.'";';
|
||||
?>
|
||||
<?php
|
||||
@@ -160,7 +162,7 @@ var replaceAll = function() {
|
||||
}
|
||||
|
||||
var replaceInFileSingle = function(fileRef) {
|
||||
top.ICEcoder.replaceInFile(fileRef,findText,'<?php echo strClean($_GET['replace']); ?>');
|
||||
top.ICEcoder.replaceInFile(fileRef,findText,'<?php if(isset($_GET['replace'])) {echo strClean($_GET['replace']);}; ?>');
|
||||
}
|
||||
|
||||
var replaceInFilesAll = function() {
|
||||
@@ -172,7 +174,7 @@ var replaceInFilesAll = function() {
|
||||
|
||||
var renameSingle = function(arrayRef) {
|
||||
fileRef = spansArray[arrayRef].id.replace(/\|/g,"/").replace(/_perms/g,"");
|
||||
newName = spansArray[arrayRef].id.replace(/\|/g,"/").replace(/_perms/g,"").replace(find,"<?php echo strClean($_GET['replace']); ?>");
|
||||
newName = spansArray[arrayRef].id.replace(/\|/g,"/").replace(/_perms/g,"").replace(find,"<?php if(isset($_GET['replace'])) {echo strClean($_GET['replace']);}; ?>");
|
||||
top.ICEcoder.renameFile(fileRef,newName);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
<html onContextMenu="return false">
|
||||
<head>
|
||||
<title>ICE Coder <?php echo $ICEcoder["versionNo"];?> beta file/folder properties</title>
|
||||
<title>ICEcoder <?php echo $ICEcoder["versionNo"];?> file/folder properties</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<link rel="stylesheet" type="text/css" href="properties.css">
|
||||
</head>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>ICEcoder <?php echo $ICEcoder["versionNo"];?> beta settings screen</title>
|
||||
<title>ICEcoder <?php echo $ICEcoder["versionNo"];?> settings screen</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<link rel="stylesheet" type="text/css" href="settings-screen.css">
|
||||
<link rel="stylesheet" href="../<?php echo $ICEcoder["codeMirrorDir"]; ?>/lib/codemirror.css">
|
||||
@@ -36,7 +36,7 @@ for ($i=0;$i<count($themeArray);$i++) {
|
||||
|
||||
<div class="infoPane">
|
||||
<img src="../images/ice-coder.png" class="logo">
|
||||
<div class="version">v <?php echo $ICEcoder["versionNo"];?> beta</div>
|
||||
<div class="version">v <?php echo $ICEcoder["versionNo"];?></div>
|
||||
|
||||
<p>
|
||||
git:<br>
|
||||
@@ -48,7 +48,9 @@ for ($i=0;$i<count($themeArray);$i++) {
|
||||
<br><br>
|
||||
|
||||
codemirror version:<br>
|
||||
<?php echo $ICEcoder["cMThisVer"]; ?>
|
||||
<script>
|
||||
document.write(CodeMirror.version);
|
||||
</script>
|
||||
<br><br>
|
||||
|
||||
file manager root:<br>
|
||||
@@ -162,8 +164,8 @@ function findSequence(goal) {
|
||||
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
||||
lineNumbers: true,
|
||||
readOnly: "nocursor",
|
||||
indentUnit: top.tabWidth,
|
||||
tabSize: top.tabWidth,
|
||||
indentUnit: top.ICEcoder.tabWidth,
|
||||
tabSize: top.ICEcoder.tabWidth,
|
||||
mode: "javascript",
|
||||
theme: "<?php echo $ICEcoder["theme"]=="default" ? 'icecoder' : $ICEcoder["theme"];?>"
|
||||
});
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
<?php
|
||||
ini_set('display_errors', 1);
|
||||
ini_set('log_errors', 1);
|
||||
ini_set('error_log', dirname(__FILE__).'/../error_log.txt');
|
||||
error_reporting(-1);
|
||||
// Start a session if we haven't already
|
||||
if(!isset($_SESSION)) {session_start();}
|
||||
|
||||
@@ -29,13 +33,15 @@ include($settingsFile);
|
||||
|
||||
// Add ICEcoder settings to beginning of $ICEcoder array
|
||||
$ICEcoder = array(
|
||||
"versionNo" => "0.9.1",
|
||||
"codeMirrorDir" => "CodeMirror-2.34",
|
||||
"cMThisVer" => 2.34
|
||||
"versionNo" => "1.0.0",
|
||||
"codeMirrorDir" => "CodeMirror-2.34"
|
||||
)+$ICEcoder;
|
||||
|
||||
$onLoadExtras = "";
|
||||
$pluginsDisplay = "";
|
||||
|
||||
// Update this config file?
|
||||
if ($_SESSION['loggedIn'] && isset($_POST["theme"]) && $_POST["theme"]) {
|
||||
if (isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && isset($_POST["theme"]) && $_POST["theme"]) {
|
||||
$settingsContents = file_get_contents($settingsFile);
|
||||
// Replace our settings vars
|
||||
$repPosStart = strpos($settingsContents,'"root"');
|
||||
@@ -43,13 +49,13 @@ if ($_SESSION['loggedIn'] && isset($_POST["theme"]) && $_POST["theme"]) {
|
||||
|
||||
// Prepare all our vars
|
||||
$ICEcoder["root"] = strClean($_POST['root']);
|
||||
$ICEcoder["tabsIndent"] = $_POST['tabsIndent'] ? "true" : "false";
|
||||
$ICEcoder["checkUpdates"] = $_POST['checkUpdates'] ? "true" : "false";
|
||||
$ICEcoder["openLastFiles"] = $_POST['openLastFiles'] ? "true" : "false";
|
||||
$ICEcoder["tabsIndent"] = isset($_POST['tabsIndent']) && $_POST['tabsIndent'] ? "true" : "false";
|
||||
$ICEcoder["checkUpdates"] = isset($_POST['checkUpdates']) && $_POST['checkUpdates'] ? "true" : "false";
|
||||
$ICEcoder["openLastFiles"] = isset($_POST['openLastFiles']) && $_POST['openLastFiles'] ? "true" : "false";
|
||||
$ICEcoder["findFilesExclude"] = 'array("'.str_replace(',','","',str_replace(" ","",strClean($_POST['findFilesExclude']))).'")';
|
||||
$ICEcoder["codeAssist"] = $_POST['codeAssist'] ? "true" : "false";
|
||||
$ICEcoder["visibleTabs"] = $_POST['visibleTabs'] ? "true" : "false";
|
||||
$ICEcoder["lockedNav"] = $_POST['lockedNav'] ? "true" : "false";
|
||||
$ICEcoder["codeAssist"] = isset($_POST['codeAssist']) && $_POST['codeAssist'] ? "true" : "false";
|
||||
$ICEcoder["visibleTabs"] = isset($_POST['visibleTabs']) && $_POST['visibleTabs'] ? "true" : "false";
|
||||
$ICEcoder["lockedNav"] = isset($_POST['lockedNav']) && $_POST['lockedNav'] ? "true" : "false";
|
||||
if ($_POST['accountPassword']!="") {$ICEcoder["accountPassword"] = generateHash(strClean($_POST['accountPassword']));};
|
||||
$ICEcoder["bannedFiles"] = 'array("'.str_replace(',','","',str_replace(" ","",strClean($_POST['bannedFiles']))).'")';
|
||||
$ICEcoder["allowedIPs"] = 'array("'.str_replace(',','","',str_replace(" ","",strClean($_POST['allowedIPs']))).'")';
|
||||
@@ -91,7 +97,7 @@ if(isset($_POST['loginPassword']) && generateHash(strClean($_POST['loginPassword
|
||||
$_SESSION['loggedIn'] = $_SESSION['loggedIn'];
|
||||
|
||||
// Define the serverType, docRoot & iceRoot
|
||||
$serverType = stristr($_SERVER[SERVER_SOFTWARE], "win") ? "Windows" : "Linux";
|
||||
$serverType = stristr($_SERVER['SERVER_SOFTWARE'], "win") ? "Windows" : "Linux";
|
||||
$docRoot = rtrim(str_replace("\\","/",$_SERVER['DOCUMENT_ROOT']));
|
||||
$iceRoot = rtrim(str_replace("\\","/",$ICEcoder["root"]));
|
||||
if ($_SESSION['loggedIn']) {
|
||||
@@ -227,7 +233,7 @@ if (!$_SESSION['loggedIn']) {
|
||||
<html>
|
||||
<head>
|
||||
<title>ICEcoder <?php
|
||||
echo $ICEcoder["versionNo"]." beta : ";
|
||||
echo $ICEcoder["versionNo"]." : ";
|
||||
echo $ICEcoder["accountPassword"] == "" ? "Setup" : "Login";
|
||||
?></title>
|
||||
<link rel="stylesheet" type="text/css" href="ice-coder.css">
|
||||
@@ -240,7 +246,7 @@ echo $ICEcoder["accountPassword"] == "" ? "Setup" : "Login";
|
||||
<div class="screenVCenter">
|
||||
<div class="screenCenter">
|
||||
<img src="../images/ice-coder.png">
|
||||
<div class="version">v <?php echo $ICEcoder["versionNo"];?> beta</div>
|
||||
<div class="version">v <?php echo $ICEcoder["versionNo"];?></div>
|
||||
<form name="settingsUpdate" action="settings.php" method="POST">
|
||||
<input type="password" name="<?php echo $ICEcoder["accountPassword"] == "" ? "account" : "login"; ?>Password" class="accountPassword">
|
||||
<input type="submit" name="submit" value="<?php echo $ICEcoder["accountPassword"] == "" ? "Set Password" : "Login"; ?>" class="button">
|
||||
|
||||
Reference in New Issue
Block a user