mirror of
https://github.com/icecoder/ICEcoder.git
synced 2026-03-18 06:17:06 +01:00
Compare commits
37 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
14fe45bda8 | ||
|
|
72ff461b45 | ||
|
|
96fe7d46ba | ||
|
|
d40cdeb65e | ||
|
|
4130df7bf9 | ||
|
|
6e176cdda7 | ||
|
|
bdb171dc6d | ||
|
|
801471a105 | ||
|
|
f86cb53bd9 | ||
|
|
435e1b3b4b | ||
|
|
4b17d76144 | ||
|
|
d96ebe4282 | ||
|
|
e5c5e7dc5e | ||
|
|
fe593dcb09 | ||
|
|
b1056a19a3 | ||
|
|
048c47f7f3 | ||
|
|
a4bb1605ce | ||
|
|
c4d24c0a4c | ||
|
|
99dedb61cb | ||
|
|
702c3d069f | ||
|
|
8ec8efe967 | ||
|
|
4aa0260399 | ||
|
|
f24aaf1396 | ||
|
|
00ddd056af | ||
|
|
2438fbb13d | ||
|
|
20832c3dcc | ||
|
|
725461f04e | ||
|
|
a3edd7bdf9 | ||
|
|
8d9d330678 | ||
|
|
d46fa3012b | ||
|
|
75e9f916ec | ||
|
|
f71277008f | ||
|
|
184a9d223b | ||
|
|
b4c45e33e9 | ||
|
|
eea960bcbd | ||
|
|
609e4397db | ||
|
|
b8bfbc5f6a |
File diff suppressed because one or more lines are too long
4
CodeMirror-2.36/lib/codemirror-compressed.js
Normal file
4
CodeMirror-2.36/lib/codemirror-compressed.js
Normal file
File diff suppressed because one or more lines are too long
@@ -80,6 +80,7 @@
|
|||||||
word-wrap: normal;
|
word-wrap: normal;
|
||||||
line-height: inherit;
|
line-height: inherit;
|
||||||
color: inherit;
|
color: inherit;
|
||||||
|
overflow: visible;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror-wrap pre {
|
.CodeMirror-wrap pre {
|
||||||
83
CodeMirror-2.36/theme/ambiance.css
Normal file
83
CodeMirror-2.36/theme/ambiance.css
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
/* ambiance theme for codemirror */
|
||||||
|
|
||||||
|
/* Color scheme */
|
||||||
|
|
||||||
|
.cm-s-ambiance .cm-keyword { color: #cda869; }
|
||||||
|
.cm-s-ambiance .cm-atom { color: #CF7EA9; }
|
||||||
|
.cm-s-ambiance .cm-number { color: #78CF8A; }
|
||||||
|
.cm-s-ambiance .cm-def { color: #aac6e3; }
|
||||||
|
.cm-s-ambiance .cm-variable { color: #ffb795; }
|
||||||
|
.cm-s-ambiance .cm-variable-2 { color: #eed1b3; }
|
||||||
|
.cm-s-ambiance .cm-variable-3 { color: #faded3; }
|
||||||
|
.cm-s-ambiance .cm-property { color: #eed1b3; }
|
||||||
|
.cm-s-ambiance .cm-operator {color: #fa8d6a;}
|
||||||
|
.cm-s-ambiance .cm-comment { color: #555; font-style:italic; }
|
||||||
|
.cm-s-ambiance .cm-string { color: #8f9d6a; }
|
||||||
|
.cm-s-ambiance .cm-string-2 { color: #9d937c; }
|
||||||
|
.cm-s-ambiance .cm-meta { color: #D2A8A1; }
|
||||||
|
.cm-s-ambiance .cm-error { color: #AF2018; }
|
||||||
|
.cm-s-ambiance .cm-qualifier { color: yellow; }
|
||||||
|
.cm-s-ambiance .cm-builtin { color: #9999cc; }
|
||||||
|
.cm-s-ambiance .cm-bracket { color: #24C2C7; }
|
||||||
|
.cm-s-ambiance .cm-tag { color: #fee4ff }
|
||||||
|
.cm-s-ambiance .cm-attribute { color: #9B859D; }
|
||||||
|
.cm-s-ambiance .cm-header {color: blue;}
|
||||||
|
.cm-s-ambiance .cm-quote { color: #24C2C7; }
|
||||||
|
.cm-s-ambiance .cm-hr { color: pink; }
|
||||||
|
.cm-s-ambiance .cm-link { color: #F4C20B; }
|
||||||
|
.cm-s-ambiance .cm-special { color: #FF9D00; }
|
||||||
|
|
||||||
|
.cm-s-ambiance .CodeMirror-matchingbracket { color: #0f0; }
|
||||||
|
.cm-s-ambiance .CodeMirror-nonmatchingbracket { color: #f22; }
|
||||||
|
|
||||||
|
.cm-s-ambiance .CodeMirror-selected {
|
||||||
|
background: rgba(255, 255, 255, 0.15);
|
||||||
|
}
|
||||||
|
.CodeMirror-focused .cm-s-ambiance .CodeMirror-selected {
|
||||||
|
background: rgba(255, 255, 255, 0.10);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Editor styling */
|
||||||
|
|
||||||
|
.cm-s-ambiance {
|
||||||
|
line-height: 1.40em;
|
||||||
|
font-family: Monaco, Menlo,"Andale Mono","lucida console","Courier New",monospace !important;
|
||||||
|
color: #E6E1DC;
|
||||||
|
background-color: #202020;
|
||||||
|
-webkit-box-shadow: inset 0 0 10px black;
|
||||||
|
-moz-box-shadow: inset 0 0 10px black;
|
||||||
|
-o-box-shadow: inset 0 0 10px black;
|
||||||
|
box-shadow: inset 0 0 10px black;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cm-s-ambiance .CodeMirror-gutter {
|
||||||
|
background: #3D3D3D;
|
||||||
|
padding: 0 5px;
|
||||||
|
text-shadow: #333 1px 1px;
|
||||||
|
border-right: 1px solid #4D4D4D;
|
||||||
|
box-shadow: 0 10px 20px black;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cm-s-ambiance .CodeMirror-gutter .CodeMirror-gutter-text {
|
||||||
|
text-shadow: 0px 1px 1px #4d4d4d;
|
||||||
|
color: #222;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cm-s-ambiance .CodeMirror-lines {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.cm-s-ambiance .CodeMirror-lines .CodeMirror-cursor {
|
||||||
|
border-left: 1px solid #7991E8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cm-s-ambiance .activeline {
|
||||||
|
background: none repeat scroll 0% 0% rgba(255, 255, 255, 0.031);
|
||||||
|
}
|
||||||
|
|
||||||
|
.cm-s-ambiance {
|
||||||
|
background: #202020;
|
||||||
|
}
|
||||||
|
.cm-s-ambiance .CodeMirror-gutter {
|
||||||
|
background: #3d3d3d;
|
||||||
|
}
|
||||||
26
CodeMirror-2.36/theme/twilight.css
Normal file
26
CodeMirror-2.36/theme/twilight.css
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
.cm-s-twilight { background: #141414; color: #f7f7f7; } /**/
|
||||||
|
.cm-s-twilight .CodeMirror-selected { background: #323232 !important; } /**/
|
||||||
|
|
||||||
|
.cm-s-twilight .CodeMirror-gutter { background: #222; border-right: 1px solid #aaa; }
|
||||||
|
.cm-s-twilight .CodeMirror-gutter-text { color: #aaa; }
|
||||||
|
.cm-s-twilight .CodeMirror-cursor { border-left: 1px solid white !important; }
|
||||||
|
|
||||||
|
.cm-s-twilight .cm-keyword { color: #f9ee98; } /**/
|
||||||
|
.cm-s-twilight .cm-atom { color: #FC0; }
|
||||||
|
.cm-s-twilight .cm-number { color: #ca7841; } /**/
|
||||||
|
.cm-s-twilight .cm-def { color: #8DA6CE; }
|
||||||
|
.cm-s-twilight span.cm-variable-2, .cm-s-twilight span.cm-tag { color: #607392; } /**/
|
||||||
|
.cm-s-twilight span.cm-variable-3, .cm-s-twilight span.cm-def { color: #607392; } /**/
|
||||||
|
.cm-s-twilight .cm-operator { color: #cda869; } /**/
|
||||||
|
.cm-s-twilight .cm-comment { color:#777; font-style:italic; font-weight:normal; } /**/
|
||||||
|
.cm-s-twilight .cm-string { color:#8f9d6a; font-style:italic; } /**/
|
||||||
|
.cm-s-twilight .cm-string-2 { color:#bd6b18 } /*?*/
|
||||||
|
.cm-s-twilight .cm-meta { background-color:#141414; color:#f7f7f7; } /*?*/
|
||||||
|
.cm-s-twilight .cm-error { border-bottom: 1px solid red; }
|
||||||
|
.cm-s-twilight .cm-builtin { color: #cda869; } /*?*/
|
||||||
|
.cm-s-twilight .cm-tag { color: #997643; } /**/
|
||||||
|
.cm-s-twilight .cm-attribute { color: #d6bb6d; } /*?*/
|
||||||
|
.cm-s-twilight .cm-header { color: #FF6400; }
|
||||||
|
.cm-s-twilight .cm-hr { color: #AEAEAE; }
|
||||||
|
.cm-s-twilight .cm-link { color:#ad9361; font-style:italic; font-underline:none; } /**/
|
||||||
|
|
||||||
46
CodeMirror-2.36/theme/xq-dark.css
Normal file
46
CodeMirror-2.36/theme/xq-dark.css
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
/*
|
||||||
|
Copyright (C) 2011 by MarkLogic Corporation
|
||||||
|
Author: Mike Brevoort <mike@brevoort.com>
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
.cm-s-xq-dark { background: #0a001f; color: #f8f8f8; }
|
||||||
|
.cm-s-xq-dark span.CodeMirror-selected { background: #a8f !important; }
|
||||||
|
.cm-s-xq-dark .CodeMirror-gutter { background: #0a001f; border-right: 1px solid #aaa; }
|
||||||
|
.cm-s-xq-dark .CodeMirror-gutter-text { color: #f8f8f8; }
|
||||||
|
.cm-s-xq-dark .CodeMirror-cursor { border-left: 1px solid white !important; }
|
||||||
|
|
||||||
|
.cm-s-xq-dark span.cm-keyword {color: #FFBD40;}
|
||||||
|
.cm-s-xq-dark span.cm-atom {color: #6C8CD5;}
|
||||||
|
.cm-s-xq-dark span.cm-number {color: #164;}
|
||||||
|
.cm-s-xq-dark span.cm-def {color: #FFF; text-decoration:underline;}
|
||||||
|
.cm-s-xq-dark span.cm-variable {color: #FFF;}
|
||||||
|
.cm-s-xq-dark span.cm-variable-2 {color: #EEE;}
|
||||||
|
.cm-s-xq-dark span.cm-variable-3 {color: #DDD;}
|
||||||
|
.cm-s-xq-dark span.cm-property {}
|
||||||
|
.cm-s-xq-dark span.cm-operator {}
|
||||||
|
.cm-s-xq-dark span.cm-comment {color: gray;}
|
||||||
|
.cm-s-xq-dark span.cm-string {color: #9FEE00;}
|
||||||
|
.cm-s-xq-dark span.cm-meta {color: yellow;}
|
||||||
|
.cm-s-xq-dark span.cm-error {color: #f00;}
|
||||||
|
.cm-s-xq-dark span.cm-qualifier {color: #FFF700;}
|
||||||
|
.cm-s-xq-dark span.cm-builtin {color: #30a;}
|
||||||
|
.cm-s-xq-dark span.cm-bracket {color: #cc7;}
|
||||||
|
.cm-s-xq-dark span.cm-tag {color: #FFBD40;}
|
||||||
|
.cm-s-xq-dark span.cm-attribute {color: #FFF700;}
|
||||||
@@ -18,7 +18,7 @@ if ($ICEcoder["theme"]=="default") {echo 'lib/editor.css';} else {echo $ICEcoder
|
|||||||
$activeLineBG = $ICEcoder["theme"]=="eclipse" || $ICEcoder["theme"]=="elegant" || $ICEcoder["theme"]=="neat" ? "#ccc" : "#000";
|
$activeLineBG = $ICEcoder["theme"]=="eclipse" || $ICEcoder["theme"]=="elegant" || $ICEcoder["theme"]=="neat" ? "#ccc" : "#000";
|
||||||
?>">
|
?>">
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
.CodeMirror {position: absolute; width: 0; background-color: #fff; color: #000; top: 0px; width: 100%; z-index: 1}
|
.CodeMirror {position: absolute; width: 0; background-color: #fff; color: #000; top: 0px; width: 100%; font-size: 13px; z-index: 1}
|
||||||
.CodeMirror-scroll {height: auto; overflow: visible}
|
.CodeMirror-scroll {height: auto; overflow: visible}
|
||||||
/* Make sure this next one remains the 3rd item, updated with JS */
|
/* Make sure this next one remains the 3rd item, updated with JS */
|
||||||
.cm-s-activeLine {background: <?php echo $activeLineBG;?> !important}
|
.cm-s-activeLine {background: <?php echo $activeLineBG;?> !important}
|
||||||
@@ -173,6 +173,9 @@ function createNewCMInstance(num) {
|
|||||||
};
|
};
|
||||||
lastKeyCode = e.keyCode;
|
lastKeyCode = e.keyCode;
|
||||||
},
|
},
|
||||||
|
onScroll: function() {
|
||||||
|
top.ICEcoder.mouseDown=false;
|
||||||
|
},
|
||||||
onGutterClick: !fileName || (fileName && fileName.indexOf(".js") == -1 && fileName.indexOf(".coffee") == -1 && fileName.indexOf(".php") && fileName.indexOf(".rb") == -1) ? codeFoldTag : codeFoldBrace,
|
onGutterClick: !fileName || (fileName && fileName.indexOf(".js") == -1 && fileName.indexOf(".coffee") == -1 && fileName.indexOf(".php") && fileName.indexOf(".rb") == -1) ? codeFoldTag : codeFoldBrace,
|
||||||
extraKeys: {
|
extraKeys: {
|
||||||
"Tab": function(cm) {CodeMirror.commands[top.ICEcoder.tabsIndent ? "defaultTab" : "insertTab"](cm);},
|
"Tab": function(cm) {CodeMirror.commands[top.ICEcoder.tabsIndent ? "defaultTab" : "insertTab"](cm);},
|
||||||
|
|||||||
19
files.php
19
files.php
@@ -31,8 +31,23 @@ class SortingIterator implements IteratorAggregate {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class IgnorantRecursiveDirectoryIterator extends RecursiveDirectoryIterator {
|
||||||
|
function getChildren() {
|
||||||
|
try {
|
||||||
|
if (!isset($GLOBALS['ICEcoder']['bannedPaths']) ||
|
||||||
|
!in_array($this->key(), $GLOBALS['ICEcoder']['bannedPaths'])) {
|
||||||
|
return parent::getChildren();
|
||||||
|
} else {
|
||||||
|
return new RecursiveArrayIterator(array());
|
||||||
|
}
|
||||||
|
} catch(UnexpectedValueException $e) {
|
||||||
|
return new RecursiveArrayIterator(array());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Get a full list of dirs & files and begin sorting using above class & function
|
// Get a full list of dirs & files and begin sorting using above class & function
|
||||||
$objectList = new SortingIterator(new RecursiveIteratorIterator(new RecursiveDirectoryIterator($docRoot.$iceRoot), RecursiveIteratorIterator::SELF_FIRST), 'alphasort');
|
$objectList = new SortingIterator(new RecursiveIteratorIterator(new IgnorantRecursiveDirectoryIterator($docRoot.$iceRoot), RecursiveIteratorIterator::SELF_FIRST), 'alphasort');
|
||||||
|
|
||||||
// With that done, create arrays for out final ordered list and a temp container of files
|
// With that done, create arrays for out final ordered list and a temp container of files
|
||||||
$finalArray = $tempArray = array();
|
$finalArray = $tempArray = array();
|
||||||
@@ -66,7 +81,7 @@ for ($i=0;$i<count($tempArray);$i++) {
|
|||||||
for ($j=$insertAt;$j<count($finalArray);$j++) {
|
for ($j=$insertAt;$j<count($finalArray);$j++) {
|
||||||
if ( strcasecmp(dirname($finalArray[$j]), dirname($tempArray[$i]))==0 &&
|
if ( strcasecmp(dirname($finalArray[$j]), dirname($tempArray[$i]))==0 &&
|
||||||
strcasecmp(basename($finalArray[$j]), basename($tempArray[$i]))<0 ||
|
strcasecmp(basename($finalArray[$j]), basename($tempArray[$i]))<0 ||
|
||||||
strpos(dirname($finalArray[$j]),dirname($tempArray[$i]))===0) {
|
(strpos(dirname($finalArray[$j]),dirname($tempArray[$i]))===0 && substr($finalArray[$j],strlen(dirname($tempArray[$i])),1)=="/")) {
|
||||||
$insertAt++;
|
$insertAt++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
images/nest-tag-bg.gif
Normal file
BIN
images/nest-tag-bg.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 120 B |
12
index.php
12
index.php
@@ -75,9 +75,11 @@ window.onbeforeunload = function() {
|
|||||||
<span id="folderMenuItems">
|
<span id="folderMenuItems">
|
||||||
<a href="javascript:top.ICEcoder.newFile()" onMouseOver="ICEcoder.showFileMenu()">New File</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>
|
<a href="javascript:top.ICEcoder.newFolder()" onMouseOver="ICEcoder.showFileMenu()">New Folder</a>
|
||||||
|
<a href="javascript:top.ICEcoder.pasteFile(top.ICEcoder.rightClickedFile)" onMouseOver="ICEcoder.showFileMenu()">Paste</a>
|
||||||
</span>
|
</span>
|
||||||
<a href="javascript:top.ICEcoder.deleteFile(top.ICEcoder.rightClickedFile)" onMouseOver="ICEcoder.showFileMenu()">Delete</a>
|
<a href="javascript:top.ICEcoder.deleteFile(top.ICEcoder.rightClickedFile)" onMouseOver="ICEcoder.showFileMenu()">Delete</a>
|
||||||
<span id="singleFileMenuItems">
|
<span id="singleFileMenuItems">
|
||||||
|
<a href="javascript:top.ICEcoder.copyFile(top.ICEcoder.rightClickedFile)" onMouseOver="ICEcoder.showFileMenu()">Copy</a>
|
||||||
<a href="javascript:top.ICEcoder.renameFile(top.ICEcoder.rightClickedFile)" onMouseOver="ICEcoder.showFileMenu()">Rename</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>
|
<a href="javascript:window.open(top.ICEcoder.rightClickedFile)" onMouseOver="ICEcoder.showFileMenu()">View Webpage</a>
|
||||||
</span>
|
</span>
|
||||||
@@ -107,20 +109,20 @@ window.onbeforeunload = function() {
|
|||||||
<div title="Lock" onClick="ICEcoder.lockUnlockNav()" id="fmLock" class="lock"></div>
|
<div title="Lock" onClick="ICEcoder.lockUnlockNav()" id="fmLock" class="lock"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<iframe id="filesFrame" class="frame" name="ff" src="files.php" style="opacity: 0" onLoad="this.style.opacity='1'"></iframe>
|
<iframe id="filesFrame" class="frame" name="ff" src="files.php" style="opacity: 0" onLoad="this.style.opacity='1';this.contentWindow.onscroll=function(){top.ICEcoder.mouseDown=false}"></iframe>
|
||||||
<div class="serverMessage" id="serverMessage"></div>
|
<div class="serverMessage" id="serverMessage"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="editor" class="editor">
|
<div id="editor" class="editor">
|
||||||
<div id="tabsBar" class="tabsBar" onContextMenu="return false">
|
<div id="tabsBar" class="tabsBar" onContextMenu="return false">
|
||||||
<?php
|
<?php
|
||||||
for ($i=1;$i<=10;$i++) {
|
for ($i=1;$i<=100;$i++) {
|
||||||
echo '<div id="tab'.$i.'" class="tab" draggable="true" onClick="ICEcoder.canSwitchTabs ? ICEcoder.switchTab('.$i.') : ICEcoder.canSwitchTabs=true"></div>';
|
echo '<div id="tab'.$i.'" class="tab" draggable="true" onClick="ICEcoder.canSwitchTabs ? ICEcoder.switchTab('.$i.') : ICEcoder.canSwitchTabs=true"></div>';
|
||||||
}
|
}
|
||||||
?><div class="newTab" onClick="ICEcoder.newTab()"><img src="images/nav-new.png"></div>
|
?><div class="newTab" onClick="ICEcoder.newTab()"><img src="images/nav-new.png"></div>
|
||||||
</div>
|
</div>
|
||||||
<div id="findBar" class="findBar" onContextMenu="return false">
|
<div id="findBar" class="findBar" onContextMenu="return false">
|
||||||
<form name="findAndReplace">
|
<form name="findAndReplace" onSubmit="ICEcoder.findReplace('findReplace',false,true);return false">
|
||||||
<div class="findReplace">
|
<div class="findReplace">
|
||||||
<div class="findText">Find</div>
|
<div class="findText">Find</div>
|
||||||
<input type="text" name="find" value="" id="find" class="textbox find" onKeyUp="ICEcoder.findReplace('find',true,false)">
|
<input type="text" name="find" value="" id="find" class="textbox find" onKeyUp="ICEcoder.findReplace('find',true,false)">
|
||||||
@@ -144,7 +146,7 @@ window.onbeforeunload = function() {
|
|||||||
<option>all files</option>
|
<option>all files</option>
|
||||||
<option>all filenames</option>
|
<option>all filenames</option>
|
||||||
</select>
|
</select>
|
||||||
<input type="button" name="submit" value=">>" class="submit" onClick="ICEcoder.findReplace('findReplace',false,true)">
|
<input type="submit" name="submit" value=">>" class="submit">
|
||||||
<div class="results" id="results"></div>
|
<div class="results" id="results"></div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
@@ -158,7 +160,7 @@ window.onbeforeunload = function() {
|
|||||||
|
|
||||||
<div class="footer" id="footer" onContextMenu="return false">
|
<div class="footer" id="footer" onContextMenu="return false">
|
||||||
<div class="nesting" id="nestValid">Nesting OK</div>
|
<div class="nesting" id="nestValid">Nesting OK</div>
|
||||||
<div class="nestLoc">Cursor nest location</div>
|
<div class="nestLoc">cursor nest location</div>
|
||||||
<div class="nestDisplay" id="nestDisplay"></div>
|
<div class="nestDisplay" id="nestDisplay"></div>
|
||||||
<div class="charDisplay" id="charDisplay"><span id="char"></span></div>
|
<div class="charDisplay" id="charDisplay"><span id="char"></span></div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -10,12 +10,14 @@ $ICEcoder = array(
|
|||||||
"lockedNav" => true,
|
"lockedNav" => true,
|
||||||
"accountPassword" => "",
|
"accountPassword" => "",
|
||||||
"bannedFiles" => array("_coder","ICEcoder"),
|
"bannedFiles" => array("_coder","ICEcoder"),
|
||||||
|
"bannedPaths" => array("/var/www/.git","/var/www/sites/all/modules","/var/www/sites/default/files"),
|
||||||
"allowedIPs" => array("*"),
|
"allowedIPs" => array("*"),
|
||||||
"plugins" => array(
|
"plugins" => array(
|
||||||
array("Adminer","plugins/adminer/icon.png","margin-top: 3px","plugins/adminer/adminer-3.4.0-mysql-en.php","_blank",""),
|
array("Adminer","plugins/adminer/icon.png","margin-top: 3px","plugins/adminer/adminer-3.4.0-mysql-en.php","_blank",""),
|
||||||
array("Zip It!","plugins/zip-it/icon.png","margin-top: 3px; margin-left: 3px","plugins/zip-it/?zip=|&exclude=*.doc*.gif*.jpg*.jpeg*.pdf*.png*.swf*.xml*.zip","fileControl:<b>Zipping Files</b>","30"),
|
array("Zip It!","plugins/zip-it/icon.png","margin-top: 3px; margin-left: 3px","plugins/zip-it/?zip=|&exclude=*.doc*.gif*.jpg*.jpeg*.pdf*.png*.swf*.xml*.zip","fileControl:<b>Zipping Files</b>","30"),
|
||||||
array("ICErepo","plugins/ice-repo/icon.png","margin-top: 3px","plugins/ice-repo","_blank",""),
|
array("ICErepo","plugins/ice-repo/icon.png","margin-top: 3px","plugins/ice-repo","_blank",""),
|
||||||
array("Dochub","plugins/dochub/icon.png","margin-top: 3px","http://dochub.io","_blank","")
|
array("Dochub","plugins/dochub/icon.png","margin-top: 3px","http://dochub.io","_blank",""),
|
||||||
|
array("Terminal","plugins/terminal/icon.gif","margin-top: 3px","plugins/terminal","_blank","")
|
||||||
),
|
),
|
||||||
"theme" => "default",
|
"theme" => "default",
|
||||||
"tabWidth" => 4,
|
"tabWidth" => 4,
|
||||||
|
|||||||
@@ -20,12 +20,9 @@ $fileName = basename($file);
|
|||||||
if ($_GET['action']=="load") {
|
if ($_GET['action']=="load") {
|
||||||
echo '<script>action="load";</script>';
|
echo '<script>action="load";</script>';
|
||||||
|
|
||||||
// Determine what to do based on filename
|
// Determine what to do based on mime type
|
||||||
// Everything is opened as text in the editor unless specified otherwise
|
$finfo = finfo_open(FILEINFO_MIME_TYPE);
|
||||||
$fileType="text";
|
if (strpos(finfo_file($finfo, $file),"text")===0) {
|
||||||
if (strpos($fileName,".jpg")>0||strpos($fileName,".jpeg")>0||strpos($fileName,".gif")>0||strpos($fileName,".png")>0) {$fileType="image";};
|
|
||||||
|
|
||||||
if ($fileType=="text") {
|
|
||||||
if (file_exists($file)) {
|
if (file_exists($file)) {
|
||||||
echo '<script>fileType="text";';
|
echo '<script>fileType="text";';
|
||||||
echo 'top.ICEcoder.shortURL = top.ICEcoder.rightClickedFile = top.ICEcoder.thisFileFolderLink = "'.$fileLoc."/".$fileName.'";';
|
echo 'top.ICEcoder.shortURL = top.ICEcoder.rightClickedFile = top.ICEcoder.thisFileFolderLink = "'.$fileLoc."/".$fileName.'";';
|
||||||
@@ -35,16 +32,17 @@ if ($_GET['action']=="load") {
|
|||||||
} else {
|
} else {
|
||||||
echo '<script>fileType="nothing"; top.ICEcoder.message(\'Sorry, '.$fileLoc."/".$fileName.' doesn\\\'t seem to exist on the server\');</script>';
|
echo '<script>fileType="nothing"; top.ICEcoder.message(\'Sorry, '.$fileLoc."/".$fileName.' doesn\\\'t seem to exist on the server\');</script>';
|
||||||
}
|
}
|
||||||
};
|
} else if (strpos(finfo_file($finfo, $file),"image")===0) {
|
||||||
|
|
||||||
if ($fileType=="image") {
|
|
||||||
echo '<script>fileType="image";fileName=\''.$fileLoc."/".$fileName.'\'</script>';
|
echo '<script>fileType="image";fileName=\''.$fileLoc."/".$fileName.'\'</script>';
|
||||||
|
} else {
|
||||||
|
echo '<script>fileType="other";window.open(\'http://'.$_SERVER['SERVER_NAME'].$fileLoc."/".$fileName.'\');</script>';
|
||||||
};
|
};
|
||||||
|
finfo_close($finfo);
|
||||||
};
|
};
|
||||||
|
|
||||||
// If we're due to add a new folder...
|
// If we're due to add a new folder...
|
||||||
if ($_GET['action']=="newFolder") {
|
if ($_GET['action']=="newFolder") {
|
||||||
if (is_writable($docRoot.$fileLoc)) {
|
if (!$demoMode && is_writable($docRoot.$fileLoc)) {
|
||||||
mkdir($file, 0705);
|
mkdir($file, 0705);
|
||||||
// Reload file manager
|
// Reload file manager
|
||||||
echo '<script>top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'add\',\''.$fileLoc.'\',\''.$fileName.'\');action="newFolder";</script>';
|
echo '<script>top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'add\',\''.$fileLoc.'\',\''.$fileName.'\');action="newFolder";</script>';
|
||||||
@@ -54,9 +52,39 @@ if ($_GET['action']=="newFolder") {
|
|||||||
echo '<script>top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);</script>';
|
echo '<script>top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);</script>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If we're due to paste a new file...
|
||||||
|
if ($_GET['action']=="paste") {
|
||||||
|
$source = $file;
|
||||||
|
$dest = $docRoot.strClean(str_replace("|","/",$_GET['location']))."/".basename($source);
|
||||||
|
if (!$demoMode && is_writable(dirname($dest))) {
|
||||||
|
if (is_dir($source)) {
|
||||||
|
if (!is_dir($dest)) {
|
||||||
|
mkdir($dest, 0705);
|
||||||
|
}
|
||||||
|
foreach ($iterator = new RecursiveIteratorIterator(
|
||||||
|
new RecursiveDirectoryIterator($source, RecursiveDirectoryIterator::SKIP_DOTS),
|
||||||
|
RecursiveIteratorIterator::SELF_FIRST) as $item
|
||||||
|
) {
|
||||||
|
if ($item->isDir()) {
|
||||||
|
mkdir($dest.DIRECTORY_SEPARATOR.$iterator->getSubPathName(), 0705);
|
||||||
|
} else {
|
||||||
|
copy($item, $dest.DIRECTORY_SEPARATOR.$iterator->getSubPathName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
copy($source, $dest);
|
||||||
|
}
|
||||||
|
// Reload file manager
|
||||||
|
echo '<script>top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'add\',\''.strClean(str_replace("|","/",$_GET['location'])).'\',\''.$fileName.'\');action="pasteFile";</script>';
|
||||||
|
} else {
|
||||||
|
echo "<script>action='nothing'; top.ICEcoder.message('Sorry, cannot copy \\n".str_replace($docRoot,"",$source)."\\n into \\n".str_replace($docRoot,"",$dest)."')</script>";
|
||||||
|
}
|
||||||
|
echo '<script>top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);</script>';
|
||||||
|
}
|
||||||
|
|
||||||
// If we're due to rename a file/folder...
|
// If we're due to rename a file/folder...
|
||||||
if ($_GET['action']=="rename") {
|
if ($_GET['action']=="rename") {
|
||||||
if (is_writable($docRoot.$iceRoot.str_replace("|","/",strClean($_GET['oldFileName'])))) {
|
if (!$demoMode && is_writable($docRoot.$iceRoot.str_replace("|","/",strClean($_GET['oldFileName'])))) {
|
||||||
rename($docRoot.$iceRoot.str_replace("|","/",strClean($_GET['oldFileName'])),$docRoot.$fileLoc."/".$fileName);
|
rename($docRoot.$iceRoot.str_replace("|","/",strClean($_GET['oldFileName'])),$docRoot.$fileLoc."/".$fileName);
|
||||||
// Reload file manager
|
// Reload file manager
|
||||||
echo '<script>top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'rename\',\''.$fileLoc.'\',\''.$fileName.'\',\'\',\''.str_replace($iceRoot,"",strClean($_GET['oldFileName'])).'\');';
|
echo '<script>top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'rename\',\''.$fileLoc.'\',\''.$fileName.'\',\'\',\''.str_replace($iceRoot,"",strClean($_GET['oldFileName'])).'\');';
|
||||||
@@ -69,7 +97,7 @@ if ($_GET['action']=="rename") {
|
|||||||
|
|
||||||
// If we're due to replace text in a file...
|
// If we're due to replace text in a file...
|
||||||
if ($_GET['action']=="replaceText") {
|
if ($_GET['action']=="replaceText") {
|
||||||
if (is_writable(str_replace("|","/",strClean($_GET['fileRef'])))) {
|
if (!$demoMode && is_writable(str_replace("|","/",strClean($_GET['fileRef'])))) {
|
||||||
$file = str_replace("|","/",strClean($_GET['fileRef']));
|
$file = str_replace("|","/",strClean($_GET['fileRef']));
|
||||||
$loadedFile = file_get_contents($file);
|
$loadedFile = file_get_contents($file);
|
||||||
$newContent = str_replace(strClean($_GET['find']),strClean($_GET['replace']),$loadedFile);
|
$newContent = str_replace(strClean($_GET['find']),strClean($_GET['replace']),$loadedFile);
|
||||||
@@ -85,7 +113,7 @@ if ($_GET['action']=="replaceText") {
|
|||||||
|
|
||||||
// If we're due to change permissions on a file/folder...
|
// If we're due to change permissions on a file/folder...
|
||||||
if ($_GET['action']=="perms") {
|
if ($_GET['action']=="perms") {
|
||||||
if (is_writable($file)) {
|
if (!$demoMode && is_writable($file)) {
|
||||||
chmod($file,octdec(numClean($_GET['perms'])));
|
chmod($file,octdec(numClean($_GET['perms'])));
|
||||||
// Reload file manager
|
// Reload file manager
|
||||||
echo '<script>top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'chmod\',\''.$fileLoc.'\',\''.$fileName.'\',\''.numClean($_GET['perms']).'\');';
|
echo '<script>top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'chmod\',\''.$fileLoc.'\',\''.$fileName.'\',\''.numClean($_GET['perms']).'\');';
|
||||||
@@ -100,7 +128,7 @@ if ($_GET['action']=="perms") {
|
|||||||
if ($_GET['action']=="delete") {
|
if ($_GET['action']=="delete") {
|
||||||
$filesArray = explode(";",$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++) {
|
for ($i=0;$i<=count($filesArray)-1;$i++) {
|
||||||
if (is_writable($iceRoot.$filesArray[$i])) {
|
if (!$demoMode && is_writable($iceRoot.$filesArray[$i])) {
|
||||||
is_dir($iceRoot.$filesArray[$i])
|
is_dir($iceRoot.$filesArray[$i])
|
||||||
? rrmdir($iceRoot.$filesArray[$i])
|
? rrmdir($iceRoot.$filesArray[$i])
|
||||||
: unlink($iceRoot.$filesArray[$i]);
|
: unlink($iceRoot.$filesArray[$i]);
|
||||||
@@ -135,7 +163,7 @@ if ($_GET['action']=="save") {
|
|||||||
echo '<script>action="save";</script>';
|
echo '<script>action="save";</script>';
|
||||||
// on the form posting via a reload, save the file
|
// on the form posting via a reload, save the file
|
||||||
if (isset($_POST['contents'])) {
|
if (isset($_POST['contents'])) {
|
||||||
if ((file_exists($file) && is_writable($file)) || isset($_POST['newFileName']) && $_POST['newFileName']!="") {
|
if (!$demoMode && ((file_exists($file) && is_writable($file)) || isset($_POST['newFileName']) && $_POST['newFileName']!="")) {
|
||||||
if (filemtime($file)==$_GET['fileMDT']||!(isset($_GET['fileMDT']))) {
|
if (filemtime($file)==$_GET['fileMDT']||!(isset($_GET['fileMDT']))) {
|
||||||
$fh = fopen($file, 'w') or die("Sorry, cannot save");
|
$fh = fopen($file, 'w') or die("Sorry, cannot save");
|
||||||
fwrite($fh, $_POST['contents']);
|
fwrite($fh, $_POST['contents']);
|
||||||
|
|||||||
@@ -90,16 +90,16 @@ h2 {font-size: 18px; font-weight: normal; color: #fff}
|
|||||||
.files .button {position: absolute; border: 0; background: #444; color: #eee; height:20px; margin-top: 16px; margin-left: 5px; font-size: 11px; cursor: pointer}
|
.files .button {position: absolute; border: 0; background: #444; color: #eee; height:20px; margin-top: 16px; margin-left: 5px; font-size: 11px; cursor: pointer}
|
||||||
.files .button:hover {background-color: #222; color: #eee}
|
.files .button:hover {background-color: #222; color: #eee}
|
||||||
.files .frame {display: inline-block; width: 250px}
|
.files .frame {display: inline-block; width: 250px}
|
||||||
.files .serverMessage {position: absolute; display: inline-block; width: 450px; bottom: 0; margin-bottom: 30px; background-color: rgba(255,255,255,0.8); font-size: 10px; padding: 7px 12px; opacity: 0;
|
.files .serverMessage {position: absolute; display: none; width: 450px; bottom: 0; margin-bottom: 30px; background-color: rgba(255,255,255,0.8); font-size: 10px; padding: 7px 12px; opacity: 0;
|
||||||
-webkit-transition: all 0.2s;
|
-webkit-transition: opacity 0.2s;
|
||||||
-moz-transition: all 0.2s;
|
-moz-transition: opacity 0.2s;
|
||||||
transition: all 0.2s;
|
transition: opacity 0.2s;
|
||||||
}
|
}
|
||||||
.files .serverMessage b {font-size: 10px}
|
.files .serverMessage b {font-size: 10px}
|
||||||
|
|
||||||
.editor {position: absolute; display: inline-block; top: 0; left: 15px; width: 2400px}
|
.editor {position: absolute; display: inline-block; top: 0; left: 15px; width: 2400px}
|
||||||
.editor .tabsBar {display: inline-block; height: 22px; width: 2400px; margin-top: 40px; padding-left: 41px; background-color: #888;}
|
.editor .tabsBar {display: inline-block; height: 22px; width: 2400px; margin-top: 40px; padding-left: 41px; background-color: #888;}
|
||||||
.tabsBar .tab {display: inline-block; display: none; background-image: url('../images/nav-bg.jpg'); background-repeat: repeat-x; background-position: 0 0; padding: 5px 8px 2px 8px; font-size: 10px; border-left: solid 1px #fff; border-right: solid 1px #777; color: #fff; cursor: pointer;
|
.tabsBar .tab {display: none; background-image: url('../images/nav-bg.jpg'); background-repeat: repeat-x; background-position: 0 0; padding: 5px 8px 2px 8px; font-size: 10px; border-left: solid 1px #fff; border-right: solid 1px #777; color: #fff; cursor: pointer;
|
||||||
-webkit-transition: all 0.15s;
|
-webkit-transition: all 0.15s;
|
||||||
-moz-transition: all 0.15s;
|
-moz-transition: all 0.15s;
|
||||||
transition: all 0.15s;
|
transition: all 0.15s;
|
||||||
@@ -110,12 +110,13 @@ h2 {font-size: 18px; font-weight: normal; color: #fff}
|
|||||||
.findBar .findReplace {position: absolute; z-index: 1}
|
.findBar .findReplace {position: absolute; z-index: 1}
|
||||||
.findReplace select {position: relative; font-size: 10px; margin: 8px 2px 0 2px; top: -2px;}
|
.findReplace select {position: relative; font-size: 10px; margin: 8px 2px 0 2px; top: -2px;}
|
||||||
.findReplace .findText {display: inline-block; height: 21px; font-size: 10px; margin: 8px 2px 0 2px; margin-left: 43px}
|
.findReplace .findText {display: inline-block; height: 21px; font-size: 10px; margin: 8px 2px 0 2px; margin-left: 43px}
|
||||||
.findReplace .find {position: relative; width: 120px; height: 14px; border: 0; top: -2px; font-size: 10px; padding-left: 5px; margin-right: 3px}
|
.findReplace .find {position: relative; width: 120px; height: 16px; border: 0; top: -3px; font-size: 10px; padding-left: 5px; margin-right: 3px}
|
||||||
.findReplace .replaceAction {margin: 0 2px 0 0; top: -2px}
|
.findReplace .replaceAction {margin: 0 2px 0 0; top: -2px}
|
||||||
.findReplace .replaceText {height: 21px; font-size: 10px; margin: 8px 2px 0 2px}
|
.findReplace .replaceText {height: 21px; font-size: 10px; margin: 8px 2px 0 2px}
|
||||||
.findReplace .replace {position: relative; width: 120px; height: 16px; border: 0; top: -2px; font-size: 10px; padding-left: 5px}
|
.findReplace .replace {position: relative; width: 120px; height: 16px; border: 0; top: -3px; font-size: 10px; padding-left: 5px}
|
||||||
.findReplace .targetText {height: 21px; font-size: 10px; margin: 8px 2px 0 2px}
|
.findReplace .targetText {height: 21px; font-size: 10px; margin: 8px 2px 0 2px}
|
||||||
.findReplace .submit {position: relative; top: -2px; height: 17px; border: 1px solid #bbb; background-color: #f8f8f8; font-size: 10px; cursor: pointer}
|
.findReplace .submit {position: relative; top: -2px; height: 17px; border: 0; background-color: #444; color: #eee; font-size: 10px; margin-left: 2px; cursor: pointer}
|
||||||
|
.findReplace .submit:hover {background-color: #2187e7; color: #eee}
|
||||||
.findReplace .results {position: relative; display: inline-block; width: 200px; height: 20px; font-size: 10px; margin: 8px 0 0 20px}
|
.findReplace .results {position: relative; display: inline-block; width: 200px; height: 20px; font-size: 10px; margin: 8px 0 0 20px}
|
||||||
.findBar .codeAssist {position: fixed; display: inline-block; width: 100px; right: 74px; top: 70px; height: 21px; font-size: 10px; z-index: 1}
|
.findBar .codeAssist {position: fixed; display: inline-block; width: 100px; right: 74px; top: 70px; height: 21px; font-size: 10px; z-index: 1}
|
||||||
.findBar .codeAssist input {margin-top: -1px}
|
.findBar .codeAssist input {margin-top: -1px}
|
||||||
@@ -126,8 +127,8 @@ h2 {font-size: 18px; font-weight: normal; color: #fff}
|
|||||||
|
|
||||||
.footer {position: fixed; display: inline-block; width: 100%; height: 30px; bottom: 0; background-color: rgba(0,0,0,0.7); left: 0; z-index: 2}
|
.footer {position: fixed; display: inline-block; width: 100%; height: 30px; bottom: 0; background-color: rgba(0,0,0,0.7); left: 0; z-index: 2}
|
||||||
.footer .nesting {display: inline-block; padding: 5px 8px; margin: 4px 0 0 15px; font-weight: bold; font-size: 10px; color: #fff; background-color: #0b0}
|
.footer .nesting {display: inline-block; padding: 5px 8px; margin: 4px 0 0 15px; font-weight: bold; font-size: 10px; color: #fff; background-color: #0b0}
|
||||||
.footer .nestLoc {position: absolute; display: inline-block; width: 120px; padding: 5px 0 0 8px; margin-top: 3px; left: 112px; font-weight: bold; font-size: 12px; color: #fff; text-align: right}
|
.footer .nestLoc {position: absolute; display: inline-block; width: 120px; padding: 5px 0 0 8px; margin-top: 2px; left: 112px; font-weight: bold; font-size: 12px; color: #fff; text-align: right}
|
||||||
.footer .nestDisplay {position: absolute; display: inline-block; padding: 5px 0 0 8px; margin-top: 3px; left: 255px; font-size: 12px; color: #fff; text-align: right}
|
.footer .nestDisplay {position: absolute; display: inline-block; padding: 5px 0 0 8px; margin-top: 0px; left: 255px; font-size: 12px; color: #fff; text-align: right}
|
||||||
.footer .charDisplay {position: absolute; display: inline-block; padding: 5px 0 0 8px; margin-top: 3px; left: 100%; font-weight: bold; font-size: 12px; color: #fff; text-align: right; width: 200px; text-align: right; margin-left: -220px}
|
.footer .charDisplay {position: absolute; display: inline-block; padding: 5px 0 0 8px; margin-top: 3px; left: 100%; font-weight: bold; font-size: 12px; color: #fff; text-align: right; width: 200px; text-align: right; margin-left: -220px}
|
||||||
|
|
||||||
.textbox {box-shadow: inset 1px 1px 2px 0 rgba(0,0,0,0.4)}
|
.textbox {box-shadow: inset 1px 1px 2px 0 rgba(0,0,0,0.4)}
|
||||||
|
|||||||
@@ -330,6 +330,7 @@ var ICEcoder = {
|
|||||||
endPos.ch = cM.getLine(endPos.line).indexOf("</"+top.ICEcoder.htmlTagArray[nestPos]+">")+top.ICEcoder.htmlTagArray[nestPos].length+3;
|
endPos.ch = cM.getLine(endPos.line).indexOf("</"+top.ICEcoder.htmlTagArray[nestPos]+">")+top.ICEcoder.htmlTagArray[nestPos].length+3;
|
||||||
// Set the selection or escape out of not selecting
|
// Set the selection or escape out of not selecting
|
||||||
!top.ICEcoder.dontSelect ? cM.setSelection(startPos,endPos) : top.ICEcoder.dontSelect = false;
|
!top.ICEcoder.dontSelect ? cM.setSelection(startPos,endPos) : top.ICEcoder.dontSelect = false;
|
||||||
|
cM.scrollIntoView(startPos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -508,8 +509,8 @@ var ICEcoder = {
|
|||||||
shortURL = top.ICEcoder.thisFileFolderLink.replace(/\|/g,"/");
|
shortURL = top.ICEcoder.thisFileFolderLink.replace(/\|/g,"/");
|
||||||
// No reason why we can't open a file (so far)
|
// No reason why we can't open a file (so far)
|
||||||
canOpenFile = true;
|
canOpenFile = true;
|
||||||
// Limit to 10 files open at a time
|
// Limit to 100 files open at a time
|
||||||
if (top.ICEcoder.openFiles.length<10) {
|
if (top.ICEcoder.openFiles.length<100) {
|
||||||
// check if we've already got it in our array
|
// check if we've already got it in our array
|
||||||
if (top.ICEcoder.openFiles.indexOf(shortURL)>-1 && shortURL!="/[NEW]") {
|
if (top.ICEcoder.openFiles.indexOf(shortURL)>-1 && shortURL!="/[NEW]") {
|
||||||
// we have, so instead, switch to that tab
|
// we have, so instead, switch to that tab
|
||||||
@@ -517,8 +518,8 @@ var ICEcoder = {
|
|||||||
top.ICEcoder.switchTab(i+1);
|
top.ICEcoder.switchTab(i+1);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// show a message because we have 10 files open
|
// show a message because we have 100 files open
|
||||||
top.ICEcoder.message('Sorry, you can only have 10 files open at a time!');
|
top.ICEcoder.message('Sorry, you can only have 100 files open at a time!');
|
||||||
canOpenFile = false;
|
canOpenFile = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -591,6 +592,18 @@ var ICEcoder = {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// Copy a file on demand
|
||||||
|
copyFile: function(selFile) {
|
||||||
|
top.ICEcoder.copiedFile = selFile;
|
||||||
|
top.ICEcoder.hideFileMenu();
|
||||||
|
},
|
||||||
|
|
||||||
|
// Paste a file on demand
|
||||||
|
pasteFile: function(location) {
|
||||||
|
top.ICEcoder.serverQueue("add","lib/file-control.php?action=paste&file="+top.ICEcoder.copiedFile+"&location="+location);
|
||||||
|
top.ICEcoder.serverMessage('<b>Pasting File</b><br>'+top.ICEcoder.copiedFile.toString().replace(/\|/g,"/").replace(/,/g,"\n"));
|
||||||
|
},
|
||||||
|
|
||||||
// Show menu on right clicking in file manager
|
// Show menu on right clicking in file manager
|
||||||
showMenu: function() {
|
showMenu: function() {
|
||||||
var menuType, folderMenuItems;
|
var menuType, folderMenuItems;
|
||||||
@@ -617,6 +630,11 @@ var ICEcoder = {
|
|||||||
document.getElementById('fileMenu').style.display='inline-block';
|
document.getElementById('fileMenu').style.display='inline-block';
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// Continue to show the file manager
|
||||||
|
hideFileMenu: function() {
|
||||||
|
document.getElementById('fileMenu').style.display='none';
|
||||||
|
},
|
||||||
|
|
||||||
// Update the file manager tree list on demand
|
// Update the file manager tree list on demand
|
||||||
updateFileManagerList: function(action,location,file,perms,oldName) {
|
updateFileManagerList: function(action,location,file,perms,oldName) {
|
||||||
var actionElemType, cssStyle, perms, targetElem, locNest, newText, innerLI, newUL, newLI, elemType, nameLI, shortURL, newMouseOver;
|
var actionElemType, cssStyle, perms, targetElem, locNest, newText, innerLI, newUL, newLI, elemType, nameLI, shortURL, newMouseOver;
|
||||||
@@ -782,27 +800,27 @@ var ICEcoder = {
|
|||||||
var find, replace, results, cM, content, lineCount, numChars, charsToCursor, charCount, cursor, replaceQS, targetQS;
|
var find, replace, results, cM, content, lineCount, numChars, charsToCursor, charCount, cursor, replaceQS, targetQS;
|
||||||
|
|
||||||
// Determine our find & replace strings and the length of them
|
// Determine our find & replace strings and the length of them
|
||||||
find = top.document.getElementById('find').value;
|
find = top.document.getElementById('find').value.toLowerCase();
|
||||||
replace = top.document.getElementById('replace').value;
|
replace = top.document.getElementById('replace').value.toLowerCase();
|
||||||
results = top.document.getElementById('results');
|
results = top.document.getElementById('results');
|
||||||
|
|
||||||
// If we have something to find in currrent document
|
// If we have something to find in currrent document
|
||||||
if (find.length>0 && document.findAndReplace.target.value=="this document") {
|
if (find.length>0 && document.findAndReplace.target.value=="this document") {
|
||||||
cM = ICEcoder.getcMInstance();
|
cM = ICEcoder.getcMInstance();
|
||||||
content = cM.getValue();
|
content = cM.getValue().toLowerCase();
|
||||||
|
|
||||||
// Find & replace the next instance, or all?
|
// Find & replace the next instance, or all?
|
||||||
if (document.findAndReplace.connector.value=="and") {
|
if (document.findAndReplace.connector.value=="and") {
|
||||||
if (document.findAndReplace.replaceAction.value=="replace" && cM.getSelection()==find) {
|
if (document.findAndReplace.replaceAction.value=="replace" && cM.getSelection().toLowerCase()==find) {
|
||||||
cM.replaceSelection(replace);
|
cM.replaceSelection(replace);
|
||||||
} else if (document.findAndReplace.replaceAction.value=="replace all" && buttonClick) {
|
} else if (document.findAndReplace.replaceAction.value=="replace all" && buttonClick) {
|
||||||
var rExp = new RegExp(find,"g");
|
var rExp = new RegExp(find,"gi");
|
||||||
cM.setValue(cM.getValue().replace(rExp,replace));
|
cM.setValue(cM.getValue().replace(rExp,replace));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the content again, as it might of changed
|
// Get the content again, as it might of changed
|
||||||
content = cM.getValue();
|
content = cM.getValue().toLowerCase();
|
||||||
if (!top.ICEcoder.findMode||find!=top.ICEcoder.lastsearch) {
|
if (!top.ICEcoder.findMode||find!=top.ICEcoder.lastsearch) {
|
||||||
ICEcoder.results = [];
|
ICEcoder.results = [];
|
||||||
|
|
||||||
@@ -858,10 +876,10 @@ var ICEcoder = {
|
|||||||
charCount++;
|
charCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
cursor = cM.getSearchCursor(find,cM.getCursor());
|
cursor = cM.getSearchCursor(find,cM.getCursor(),true);
|
||||||
cursor.findNext();
|
cursor.findNext();
|
||||||
if (!cursor.from()) {
|
if (!cursor.from()) {
|
||||||
cursor = cM.getSearchCursor(find,{line:0,ch:0});
|
cursor = cM.getSearchCursor(find,{line:0,ch:0},true);
|
||||||
cursor.findNext();
|
cursor.findNext();
|
||||||
}
|
}
|
||||||
// Finally, highlight our selection
|
// Finally, highlight our selection
|
||||||
@@ -933,8 +951,11 @@ var ICEcoder = {
|
|||||||
|
|
||||||
// Then for all the array items, output as the nest display
|
// Then for all the array items, output as the nest display
|
||||||
for (var i=0;i<ICEcoder.htmlTagArray.length;i++) {
|
for (var i=0;i<ICEcoder.htmlTagArray.length;i++) {
|
||||||
ICEcoder.nestDisplay.innerHTML += '<a onMouseover="top.ICEcoder.highlightBlock('+i+')" onMouseout="top.ICEcoder.highlightBlock('+i+',\'hide\')" onClick="top.ICEcoder.setPosition('+i+',top.ICEcoder.startPosLine,\''+ICEcoder.htmlTagArray[i]+'\')" style="cursor: pointer">'+ICEcoder.htmlTagArray[i]+'</a>';
|
if (i==0) {ICEcoder.nestDisplay.innerHTML += '<div style="display: inline-block; width: 7px; margin-top: -5px; height: 30px; background-image: url(images/nest-tag-bg.gif)"></div>'};
|
||||||
if(i<ICEcoder.htmlTagArray.length-1) {ICEcoder.nestDisplay.innerHTML += " > "};
|
ICEcoder.nestDisplay.innerHTML += '<a onMouseover="top.ICEcoder.highlightBlock('+i+')" onMouseout="top.ICEcoder.highlightBlock('+i+',\'hide\')" onClick="top.ICEcoder.setPosition('+i+',top.ICEcoder.startPosLine,\''+ICEcoder.htmlTagArray[i]+'\')" style="display: inline-block; cursor: pointer; background: #333; padding: 7px 2px 7px 7px; margin-top: -5px; height: 30px">'+ICEcoder.htmlTagArray[i]+'</a>';
|
||||||
|
ICEcoder.nestDisplay.innerHTML += i<ICEcoder.htmlTagArray.length-1
|
||||||
|
? '<div style="display: inline-block; width: 8px; margin-top: -5px; height: 30px; background-image: url(images/nest-tag-bg.gif); background-position: -7px 0"></div>'
|
||||||
|
: '<div style="display: inline-block; width: 7px; margin-top: -5px; height: 30px; background-image: url(images/nest-tag-bg.gif); background-position: -15px 0"></div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1011,11 +1032,17 @@ var ICEcoder = {
|
|||||||
|
|
||||||
// Alter array indicating which files have changed
|
// Alter array indicating which files have changed
|
||||||
redoChangedContent: function(evt) {
|
redoChangedContent: function(evt) {
|
||||||
var cM;
|
var cM, key;
|
||||||
|
|
||||||
cM = ICEcoder.getcMInstance();
|
cM = ICEcoder.getcMInstance();
|
||||||
ICEcoder.changedContent[ICEcoder.selectedTab-1] = cM.historySize().undo > 0 ? 1 : 0;
|
key = evt.keyCode ? evt.keyCode : evt.which ? evt.which : evt.charCode;
|
||||||
ICEcoder.redoTabHighlight(ICEcoder.selectedTab);
|
// Exclude a few keys...
|
||||||
|
// Escape (27), Caps Lock (20), Shift, CTRL, Alt, Pause/Break (16-19), Left, Up, Right, Down (37-40), Num Lock, Scroll Lock (144-145),
|
||||||
|
// Insert, Delete (45,46), Page Up, Page Down, End, Home (33-36), Left Win Key, Right Win Key (91-92), F1-F12 (112-123)
|
||||||
|
if (key!=27 && key!=20 && (key<16||key>19) && (key<37||key>40) && (key!=144||key!=145) && (key!=45||key!=46) && (key<33||key>36) && (key!=91||key!=92) && (key<112||key>123)) {
|
||||||
|
ICEcoder.changedContent[ICEcoder.selectedTab-1] = cM.historySize().undo > 0 ? 1 : 0;
|
||||||
|
ICEcoder.redoTabHighlight(ICEcoder.selectedTab);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// Show & hide target element
|
// Show & hide target element
|
||||||
@@ -1035,7 +1062,7 @@ var ICEcoder = {
|
|||||||
|
|
||||||
// Get the mouse position on demand
|
// Get the mouse position on demand
|
||||||
getMouseXY: function(e,area) {
|
getMouseXY: function(e,area) {
|
||||||
var tempX, tempY, scrollTop, winW;
|
var tempX, tempY, scrollTop;
|
||||||
|
|
||||||
top.ICEcoder.mouseX = e.pageX ? e.pageX : e.clientX + document.body.scrollLeft;
|
top.ICEcoder.mouseX = e.pageX ? e.pageX : e.clientX + document.body.scrollLeft;
|
||||||
top.ICEcoder.mouseY = e.pageY ? e.pageY : e.clientY + document.body.scrollTop;
|
top.ICEcoder.mouseY = e.pageY ? e.pageY : e.clientY + document.body.scrollTop;
|
||||||
@@ -1046,8 +1073,6 @@ var ICEcoder = {
|
|||||||
if (area=="editor") {
|
if (area=="editor") {
|
||||||
top.ICEcoder.mouseX += top.ICEcoder.filesW;
|
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();
|
top.ICEcoder.dragCursorTest();
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -1075,7 +1100,12 @@ var ICEcoder = {
|
|||||||
var serverMessage;
|
var serverMessage;
|
||||||
|
|
||||||
serverMessage = document.getElementById('serverMessage');
|
serverMessage = document.getElementById('serverMessage');
|
||||||
if (message) {serverMessage.innerHTML = message};
|
if (message) {
|
||||||
|
serverMessage.innerHTML = message;
|
||||||
|
serverMessage.style.display = "inline-block";
|
||||||
|
} else {
|
||||||
|
setTimeout(function() {serverMessage.style.display = "none"},200);
|
||||||
|
}
|
||||||
serverMessage.style.opacity = message ? 1 : 0;
|
serverMessage.style.opacity = message ? 1 : 0;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -16,14 +16,14 @@
|
|||||||
</div>
|
</div>
|
||||||
<?php if (isset($_GET['replace'])) { ?>
|
<?php if (isset($_GET['replace'])) { ?>
|
||||||
<div class="replaceAll" id="replaceAll" onClick="<?php
|
<div class="replaceAll" id="replaceAll" onClick="<?php
|
||||||
if (strpos($_GET['target'],"filenames")) {
|
if (isset($_GET['target']) && strpos($_GET['target'],"filenames")) {
|
||||||
echo 'renameAll()';
|
echo 'renameAll()';
|
||||||
} else if (strpos($_GET['target'],"files")) {
|
} else if (isset($_GET['target']) && strpos($_GET['target'],"files")) {
|
||||||
echo 'replaceInFilesAll()';
|
echo 'replaceInFilesAll()';
|
||||||
} else {
|
} else {
|
||||||
echo 'replaceAll()';
|
echo 'replaceAll()';
|
||||||
}
|
}
|
||||||
?>" style="opacity: 0.1"><?php echo strpos($_GET['target'],"filenames") ? 'rename all' : 'replace all';?></div>
|
?>" style="opacity: 0.1"><?php echo isset($_GET['target']) && strpos($_GET['target'],"filenames") ? 'rename all' : 'replace all';?></div>
|
||||||
<?php ;}; ?>
|
<?php ;}; ?>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -34,7 +34,7 @@ var resultsDisplay = "";
|
|||||||
var foundArray = [];
|
var foundArray = [];
|
||||||
foundInSelected = false;
|
foundInSelected = false;
|
||||||
userTarget = top.document.findAndReplace.target.value;
|
userTarget = top.document.findAndReplace.target.value;
|
||||||
findText = top.findAndReplace.find.value;
|
findText = top.findAndReplace.find.value.toLowerCase();
|
||||||
<?php
|
<?php
|
||||||
$findText = str_replace("ICEcoder:","",str_replace("'","\'",$_GET['find']));
|
$findText = str_replace("ICEcoder:","",str_replace("'","\'",$_GET['find']));
|
||||||
// Find in open docs?
|
// Find in open docs?
|
||||||
@@ -42,7 +42,7 @@ if (!isset($_GET['target'])) {
|
|||||||
$targetName = "document";
|
$targetName = "document";
|
||||||
?>
|
?>
|
||||||
var startTab = top.ICEcoder.selectedTab;
|
var startTab = top.ICEcoder.selectedTab;
|
||||||
var rExp = new RegExp(findText,"g");
|
var rExp = new RegExp(findText,"gi");
|
||||||
for (var i=1;i<=top.ICEcoder.openFiles.length;i++) {
|
for (var i=1;i<=top.ICEcoder.openFiles.length;i++) {
|
||||||
top.ICEcoder.switchTab(i);
|
top.ICEcoder.switchTab(i);
|
||||||
var cM = top.ICEcoder.getcMInstance();
|
var cM = top.ICEcoder.getcMInstance();
|
||||||
@@ -68,7 +68,7 @@ if (startTab!=top.ICEcoder.selectedTab) {
|
|||||||
var spansArray = top.ICEcoder.filesFrame.contentWindow.document.getElementsByTagName('span');
|
var spansArray = top.ICEcoder.filesFrame.contentWindow.document.getElementsByTagName('span');
|
||||||
for (var i=0;i<spansArray.length;i++) {
|
for (var i=0;i<spansArray.length;i++) {
|
||||||
targetURL = spansArray[i].id.replace(/\|/g,"/");
|
targetURL = spansArray[i].id.replace(/\|/g,"/");
|
||||||
if (targetURL.indexOf(findText)>-1 && targetURL.indexOf('_perms')>-1) {
|
if (targetURL.toLowerCase().indexOf(findText.toLowerCase())>-1 && targetURL.indexOf('_perms')>-1) {
|
||||||
if (userTarget.indexOf("selected")>-1) {
|
if (userTarget.indexOf("selected")>-1) {
|
||||||
for (var j=0;j<top.ICEcoder.selectedFiles.length;j++) {
|
for (var j=0;j<top.ICEcoder.selectedFiles.length;j++) {
|
||||||
if (top.ICEcoder.selectedFiles[j].indexOf(targetURL.replace(/\//g,"|").replace(/_perms/g,""))>-1) {
|
if (top.ICEcoder.selectedFiles[j].indexOf(targetURL.replace(/\//g,"|").replace(/_perms/g,""))>-1) {
|
||||||
@@ -77,8 +77,16 @@ if (startTab!=top.ICEcoder.selectedTab) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (userTarget.indexOf("all")>-1 || (userTarget.indexOf("selected")>-1 && foundInSelected)) {
|
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 if(isset($_GET['replace'])) {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\'))">';
|
||||||
<?php if (isset($_GET['replace'])) { ?>
|
resultsDisplay += targetURL.toLowerCase().replace(/\|/g,"/").replace(/_perms/g,"").replace(/<?php echo str_replace("/","\/",strtolower($findText)); ?>/g,"<b>"+findText.toLowerCase()+"</b>");
|
||||||
|
resultsDisplay += '</a><br>';
|
||||||
|
<?php if (!isset($_GET['replace'])) { ?>
|
||||||
|
resultsDisplay += '<div id="foundCount'+i+'">'+spansArray[i].innerHTML+'</div>';
|
||||||
|
<?php ;} else { ?>
|
||||||
|
resultsDisplay += '<div id="foundCount'+i+'">'+spansArray[i].innerHTML+', rename to '+targetURL.toLowerCase().replace(/\|/g,"/").replace(/_perms/g,"").replace(/<?php echo str_replace("/","\/",strtolower($findText)); ?>/g,"<b><?php if(isset($_GET['replace'])) {echo strtolower(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>';
|
resultsDisplay += '<div class="replace" id="replace" onClick="renameSingle('+i+');this.style.display=\'none\'">rename</div>';
|
||||||
<?php ;}; ?>
|
<?php ;}; ?>
|
||||||
resultsDisplay += '<hr>';
|
resultsDisplay += '<hr>';
|
||||||
|
|||||||
@@ -1,8 +1,13 @@
|
|||||||
<?php
|
<?php
|
||||||
|
// Display & log all errors
|
||||||
ini_set('display_errors', 1);
|
ini_set('display_errors', 1);
|
||||||
ini_set('log_errors', 1);
|
ini_set('log_errors', 1);
|
||||||
ini_set('error_log', dirname(__FILE__).'/../error_log.txt');
|
ini_set('error_log', dirname(__FILE__).'/../error-log.txt');
|
||||||
error_reporting(-1);
|
error_reporting(-1);
|
||||||
|
|
||||||
|
// Set our default timezone and supress warning with @
|
||||||
|
@date_default_timezone_set(date_default_timezone_get());
|
||||||
|
|
||||||
// Start a session if we haven't already
|
// Start a session if we haven't already
|
||||||
if(!isset($_SESSION)) {session_start();}
|
if(!isset($_SESSION)) {session_start();}
|
||||||
|
|
||||||
@@ -33,15 +38,19 @@ include($settingsFile);
|
|||||||
|
|
||||||
// Add ICEcoder settings to beginning of $ICEcoder array
|
// Add ICEcoder settings to beginning of $ICEcoder array
|
||||||
$ICEcoder = array(
|
$ICEcoder = array(
|
||||||
"versionNo" => "1.0.0",
|
"versionNo" => "1.2",
|
||||||
"codeMirrorDir" => "CodeMirror-2.34"
|
"codeMirrorDir" => "CodeMirror-2.36",
|
||||||
|
"demoMode" => false
|
||||||
)+$ICEcoder;
|
)+$ICEcoder;
|
||||||
|
|
||||||
$onLoadExtras = "";
|
$onLoadExtras = "";
|
||||||
$pluginsDisplay = "";
|
$pluginsDisplay = "";
|
||||||
|
|
||||||
|
if ($ICEcoder['demoMode'] && $ICEcoder['accountPassword']!="") {$_SESSION['loggedIn']=true;};
|
||||||
|
$demoMode = $ICEcoder['demoMode'];
|
||||||
|
|
||||||
// Update this config file?
|
// Update this config file?
|
||||||
if (isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && isset($_POST["theme"]) && $_POST["theme"]) {
|
if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && isset($_POST["theme"]) && $_POST["theme"]) {
|
||||||
$settingsContents = file_get_contents($settingsFile);
|
$settingsContents = file_get_contents($settingsFile);
|
||||||
// Replace our settings vars
|
// Replace our settings vars
|
||||||
$repPosStart = strpos($settingsContents,'"root"');
|
$repPosStart = strpos($settingsContents,'"root"');
|
||||||
@@ -129,7 +138,7 @@ if ($_SESSION['loggedIn'] && isset($_GET["saveFiles"]) && $_GET['saveFiles']) {
|
|||||||
// Replace our previousFiles var with the the current
|
// Replace our previousFiles var with the the current
|
||||||
$repPosStart = strpos($settingsContents,'previousFiles" => "')+20;
|
$repPosStart = strpos($settingsContents,'previousFiles" => "')+20;
|
||||||
$repPosEnd = strpos($settingsContents,'",',$repPosStart)-$repPosStart;
|
$repPosEnd = strpos($settingsContents,'",',$repPosStart)-$repPosStart;
|
||||||
if ($_GET['saveFiles']!="CLEAR") {
|
if (!$demoMode && $_GET['saveFiles']!="CLEAR") {
|
||||||
$saveFiles=strClean($_GET['saveFiles']);
|
$saveFiles=strClean($_GET['saveFiles']);
|
||||||
$saveFilesArray = explode(",",$saveFiles);
|
$saveFilesArray = explode(",",$saveFiles);
|
||||||
$saveFiles="";
|
$saveFiles="";
|
||||||
|
|||||||
BIN
plugins/terminal/icon.gif
Normal file
BIN
plugins/terminal/icon.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 164 B |
201
plugins/terminal/index.php
Normal file
201
plugins/terminal/index.php
Normal file
@@ -0,0 +1,201 @@
|
|||||||
|
<?php
|
||||||
|
include("../../lib/settings.php");
|
||||||
|
if ($demoMode || !$_SESSION['loggedIn']) {
|
||||||
|
die("You must be logged in to access Terminal");
|
||||||
|
}
|
||||||
|
|
||||||
|
error_reporting(E_ALL);
|
||||||
|
@session_start();
|
||||||
|
|
||||||
|
if (isset($_SERVER['PHP_AUTH_USER'])) {
|
||||||
|
$_SESSION['user'] = $_SERVER['PHP_AUTH_USER'];
|
||||||
|
$_SESSION['pass'] = generateHash(strClean($_SERVER['PHP_AUTH_PW']),$ICEcoder["accountPassword"]);
|
||||||
|
}
|
||||||
|
$passwd = array($_SESSION['user'] => $ICEcoder["accountPassword"]);
|
||||||
|
$aliases = array('la' => 'ls -la',
|
||||||
|
'll' => 'ls -lvhF',
|
||||||
|
'dir' => 'ls' );
|
||||||
|
|
||||||
|
class phpTerm {
|
||||||
|
function phpTerm() {} // constructor
|
||||||
|
|
||||||
|
function formatPrompt() {
|
||||||
|
$user=shell_exec("whoami");
|
||||||
|
$host=explode(".", shell_exec("uname -n"));
|
||||||
|
$_SESSION['prompt'] = "".rtrim($user).""."@"."".rtrim($host[0])."";
|
||||||
|
}
|
||||||
|
|
||||||
|
function checkPassword($passwd) {
|
||||||
|
if( !isset($_SERVER['PHP_AUTH_USER'])||
|
||||||
|
!isset($_SERVER['PHP_AUTH_PW']) ||
|
||||||
|
!isset($passwd[$_SERVER['PHP_AUTH_USER']]) ||
|
||||||
|
$passwd[$_SERVER['PHP_AUTH_USER']] != $_SESSION['pass']) {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function logout() {
|
||||||
|
header('WWW-Authenticate: Basic realm="Terminal"');
|
||||||
|
header('HTTP/1.0 401 Unauthorized');
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
function initVars() {
|
||||||
|
if (empty($_SESSION['cwd']) || @!empty($_GET['reset'])) {
|
||||||
|
$_SESSION['cwd'] = getcwd();
|
||||||
|
$_SESSION['history'] = array();
|
||||||
|
$_SESSION['output'] = '';
|
||||||
|
$_REQUEST['command'] ='';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function buildCommandHistory() {
|
||||||
|
if(!empty($_REQUEST['command'])) {
|
||||||
|
if(get_magic_quotes_gpc()) {
|
||||||
|
$_REQUEST['command'] = stripslashes($_REQUEST['command']);
|
||||||
|
}
|
||||||
|
|
||||||
|
// drop old commands from list if exists
|
||||||
|
if (($i = array_search($_REQUEST['command'], $_SESSION['history'])) !== false) {
|
||||||
|
unset($_SESSION['history'][$i]);
|
||||||
|
}
|
||||||
|
array_unshift($_SESSION['history'], $_REQUEST['command']);
|
||||||
|
|
||||||
|
// append commmand */
|
||||||
|
$_SESSION['output'] .= "{$_SESSION['prompt']}".":>"."{$_REQUEST['command']}"."\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function buildJavaHistory() {
|
||||||
|
// build command history for use in the JavaScript
|
||||||
|
if (empty($_SESSION['history'])) {
|
||||||
|
$_SESSION['js_command_hist'] = '""';
|
||||||
|
} else {
|
||||||
|
$escaped = array_map('addslashes', $_SESSION['history']);
|
||||||
|
$_SESSION['js_command_hist'] = '"", "' . implode('", "', $escaped) . '"';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function outputHandle($aliases) {
|
||||||
|
if (preg_match('/^[[:blank:]]*cd[[:blank:]]*$/', @$_REQUEST['command']))
|
||||||
|
{
|
||||||
|
$_SESSION['cwd'] = getcwd(); //dirname(__FILE__);
|
||||||
|
}
|
||||||
|
elseif(preg_match('/^[[:blank:]]*cd[[:blank:]]+([^;]+)$/', @$_REQUEST['command'], $regs)) {
|
||||||
|
// The current command is 'cd', which we have to handle as an internal shell command.
|
||||||
|
// absolute/relative path ?"
|
||||||
|
($regs[1][0] == '/') ? $new_dir = $regs[1] : $new_dir = $_SESSION['cwd'] . '/' . $regs[1];
|
||||||
|
|
||||||
|
// cosmetics
|
||||||
|
while (strpos($new_dir, '/./') !== false) {
|
||||||
|
$new_dir = str_replace('/./', '/', $new_dir);
|
||||||
|
}
|
||||||
|
while (strpos($new_dir, '//') !== false) {
|
||||||
|
$new_dir = str_replace('//', '/', $new_dir);
|
||||||
|
}
|
||||||
|
while (preg_match('|/\.\.(?!\.)|', $new_dir)) {
|
||||||
|
$new_dir = preg_replace('|/?[^/]+/\.\.(?!\.)|', '', $new_dir);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(empty($new_dir)): $new_dir = "/"; endif;
|
||||||
|
|
||||||
|
(@chdir($new_dir)) ? $_SESSION['cwd'] = $new_dir : $_SESSION['output'] .= "could not change to: $new_dir\n";
|
||||||
|
} else {
|
||||||
|
/* The command is not a 'cd' command, so we execute it after
|
||||||
|
changing the directory and save the output. */
|
||||||
|
chdir($_SESSION['cwd']);
|
||||||
|
|
||||||
|
/* Alias expansion. */
|
||||||
|
$length = strcspn(@$_REQUEST['command'], " \t");
|
||||||
|
$token = substr(@$_REQUEST['command'], 0, $length);
|
||||||
|
if (isset($aliases[$token]))
|
||||||
|
$_REQUEST['command'] = $aliases[$token] . substr($_REQUEST['command'], $length);
|
||||||
|
|
||||||
|
$p = proc_open(@$_REQUEST['command'],
|
||||||
|
array(1 => array('pipe', 'w'),
|
||||||
|
2 => array('pipe', 'w')), $io);
|
||||||
|
|
||||||
|
/* Read output sent to stdout. */
|
||||||
|
while (!feof($io[1])) {
|
||||||
|
$_SESSION['output'] .= htmlspecialchars(fgets($io[1]),ENT_COMPAT, 'UTF-8');
|
||||||
|
}
|
||||||
|
/* Read output sent to stderr. */
|
||||||
|
while (!feof($io[2])) {
|
||||||
|
$_SESSION['output'] .= htmlspecialchars(fgets($io[2]),ENT_COMPAT, 'UTF-8');
|
||||||
|
}
|
||||||
|
|
||||||
|
fclose($io[1]);
|
||||||
|
fclose($io[2]);
|
||||||
|
proc_close($p);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$terminal = new phpTerm;
|
||||||
|
|
||||||
|
if ($_REQUEST['command']=="logout") {
|
||||||
|
$terminal->logout();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!$terminal->checkPassword($passwd)) {
|
||||||
|
header('WWW-Authenticate: Basic realm="Terminal"');
|
||||||
|
header('HTTP/1.0 401 Unauthorized');
|
||||||
|
} else {
|
||||||
|
$terminal->initVars();
|
||||||
|
$terminal->buildCommandHistory();
|
||||||
|
$terminal->buildJavaHistory();
|
||||||
|
if(!isset($_SESSION['prompt'])):$terminal->formatPrompt(); endif;
|
||||||
|
$terminal->outputHandle($aliases);
|
||||||
|
?>
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<title>PHP Terminal</title>
|
||||||
|
<link rel="stylesheet" type="text/css" href="terminal.css" />
|
||||||
|
<script type="text/javascript" language="JavaScript">
|
||||||
|
var current_line = 0;
|
||||||
|
var command_hist = new Array(<?php echo $_SESSION['js_command_hist']; ?>);
|
||||||
|
var last = 0;
|
||||||
|
|
||||||
|
function key(e) {
|
||||||
|
if (!e) var e = window.event;
|
||||||
|
if (e.keyCode == 38 && current_line < command_hist.length-1) {
|
||||||
|
command_hist[current_line] = document.shell.command.value;
|
||||||
|
current_line++;
|
||||||
|
document.shell.command.value = command_hist[current_line];
|
||||||
|
}
|
||||||
|
if (e.keyCode == 40 && current_line > 0) {
|
||||||
|
command_hist[current_line] = document.shell.command.value;
|
||||||
|
current_line--;
|
||||||
|
document.shell.command.value = command_hist[current_line];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function init() {
|
||||||
|
document.shell.setAttribute("autocomplete", "off");
|
||||||
|
document.shell.output.scrollTop = document.shell.output.scrollHeight;
|
||||||
|
document.shell.command.focus();
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body onload="init()">
|
||||||
|
|
||||||
|
<div class="head"><?php echo $_SESSION['prompt'].":"."$_SESSION[cwd]"; ?></div>
|
||||||
|
|
||||||
|
<form name="shell" action="<?php echo $_SERVER['PHP_SELF'];?>" method="post">
|
||||||
|
<textarea name="output" readonly="readonly" rows="24"><?php
|
||||||
|
$lines = substr_count($_SESSION['output'], "\n");
|
||||||
|
$padding = str_repeat("\n", max(0, 25 - $lines));
|
||||||
|
echo "\n\n".trim($padding . $_SESSION['output'])."\n";
|
||||||
|
?>
|
||||||
|
</textarea>
|
||||||
|
<p class="commandLine">$> <input class="command" name="command" type="text" size='50' onkeyup="key(event)" tabindex="1"></p>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
<?php } ?>
|
||||||
28
plugins/terminal/terminal.css
Normal file
28
plugins/terminal/terminal.css
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
/* First, reset everything to a standard */
|
||||||
|
html, body, div, span, applet, object, iframe,
|
||||||
|
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
|
||||||
|
a, abbr, acronym, address, big, cite, code,
|
||||||
|
del, dfn, em, font, img, ins, kbd, q, s, samp,
|
||||||
|
small, strike, strong, sub, sup, tt, var,
|
||||||
|
b, u, i, center,
|
||||||
|
dl, dt, dd, ol, ul, li,
|
||||||
|
fieldset, form, input, label, legend,
|
||||||
|
table, caption, tbody, tfoot, thead, tr, th, td {
|
||||||
|
font-family: verdana, arial, monospace, sans-serif;
|
||||||
|
border: 0;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
outline: 0;
|
||||||
|
font-size: 12px;
|
||||||
|
vertical-align: top;
|
||||||
|
}
|
||||||
|
|
||||||
|
html, body {width: 100%; height: 100%; background: #000}
|
||||||
|
|
||||||
|
.head {position: fixed; top: 0; padding: 2px; background: rgba(124,124,124,0.8); color: #fff; font-weight: bold; z-index: 1}
|
||||||
|
textarea {position: absolute; display: block; top: 0; padding: 0; width: 100%; height: 100%; min-height: 100%; border: 0; background: #000; color: #0c0}
|
||||||
|
textarea:focus {outline: none}
|
||||||
|
p {color: #0c0}
|
||||||
|
.commandLine {position: fixed; width: 100%; bottom: 0; padding: 2px; background: rgba(32,32,32,0.9); z-index: 1}
|
||||||
|
.command {width: 95%; font-family: verdana, arial, monospace, sans-serif; border: none; background: transparent; color: #0c0}
|
||||||
|
.command:focus {outline: none}
|
||||||
@@ -62,7 +62,7 @@ Class zipIt {
|
|||||||
foreach($zipFiles as $file) {
|
foreach($zipFiles as $file) {
|
||||||
$canAdd=true;
|
$canAdd=true;
|
||||||
for ($i=0;$i<count($excludeFilesFolders);$i++) {
|
for ($i=0;$i<count($excludeFilesFolders);$i++) {
|
||||||
if(strpos($file,$excludeFilesFolders[$i])!==false) {$canAdd=false;};
|
if($excludeFilesFolders[$i] && strpos($file,$excludeFilesFolders[$i])!==false) {$canAdd=false;};
|
||||||
}
|
}
|
||||||
if ($canAdd==true) {
|
if ($canAdd==true) {
|
||||||
$zip->addFile($file,str_replace($docRoot."/","",$file));
|
$zip->addFile($file,str_replace($docRoot."/","",$file));
|
||||||
|
|||||||
Reference in New Issue
Block a user