mirror of
https://github.com/icecoder/ICEcoder.git
synced 2026-03-20 07:17:04 +01:00
Compare commits
21 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ef157d71f2 | ||
|
|
0b718e0fbf | ||
|
|
809af86c16 | ||
|
|
449e8e2c4a | ||
|
|
01c8a10463 | ||
|
|
27da7ed0fe | ||
|
|
685116c555 | ||
|
|
0c4741c793 | ||
|
|
4da7024f91 | ||
|
|
b49a2cc52d | ||
|
|
c0fe50cd2f | ||
|
|
497efaabf0 | ||
|
|
2ee777739f | ||
|
|
deb3ad5359 | ||
|
|
3f1801ef2b | ||
|
|
ca8e92e443 | ||
|
|
c514e4a1ad | ||
|
|
ec28de40c9 | ||
|
|
14053fbfdd | ||
|
|
464030808c | ||
|
|
d2377bff34 |
@@ -223,8 +223,6 @@ function createNewCMInstance(num) {
|
|||||||
var codeFoldBrace = CodeMirror.newFoldFunction(CodeMirror.braceRangeFinder);
|
var codeFoldBrace = CodeMirror.newFoldFunction(CodeMirror.braceRangeFinder);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<iframe name="snippetLoader" src="snippets/snippet-display.php" style="display: none"></iframe>
|
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
BIN
images/checkerboard.png
Normal file
BIN
images/checkerboard.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 231 B |
15
index.php
15
index.php
@@ -1,3 +1,4 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
<?php include("lib/settings.php");
|
<?php include("lib/settings.php");
|
||||||
|
|
||||||
// Check IP permissions
|
// Check IP permissions
|
||||||
@@ -15,7 +16,6 @@ if ($ICEcoder["checkUpdates"]) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
|
||||||
|
|
||||||
<html onMouseDown="top.ICEcoder.mouseDown=true" onMouseUp="top.ICEcoder.mouseDown=false" onMouseMove="if(top.ICEcoder) {top.ICEcoder.getMouseXY(event,'top');top.ICEcoder.canResizeFilesW()}">
|
<html onMouseDown="top.ICEcoder.mouseDown=true" onMouseUp="top.ICEcoder.mouseDown=false" onMouseMove="if(top.ICEcoder) {top.ICEcoder.getMouseXY(event,'top');top.ICEcoder.canResizeFilesW()}">
|
||||||
<head>
|
<head>
|
||||||
@@ -83,12 +83,20 @@ if (file_exists(dirname(__FILE__)."/plugins/jshint/jshint.js")) {
|
|||||||
<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>
|
<a href="javascript:top.ICEcoder.pasteFile(top.ICEcoder.rightClickedFile)" onMouseOver="ICEcoder.showFileMenu()">Paste</a>
|
||||||
|
<a href="javascript:top.ICEcoder.uploadFilesSelect(top.ICEcoder.rightClickedFile)" onMouseOver="ICEcoder.showFileMenu()">Upload File(s)</a>
|
||||||
|
<div style="display: none">
|
||||||
|
<form enctype="multipart/form-data" id="uploadFilesForm" action="lib/file-control.php?action=upload&file=/uploaded" method="POST" target="fileControl">
|
||||||
|
<input type="hidden" name="folder" id="uploadDir" value="/">
|
||||||
|
<input type="file" name="filesInput[]" id="fileInput" onchange="top.ICEcoder.uploadFilesSubmit(this)" multiple>
|
||||||
|
<input type="submit" value="Upload File">
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
</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.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.replace(/\|/g,'/'))" onMouseOver="ICEcoder.showFileMenu()">View Webpage</a>
|
||||||
</span>
|
</span>
|
||||||
<a href="javascript:top.ICEcoder.zipIt(top.ICEcoder.rightClickedFile)" onMouseOver="ICEcoder.showFileMenu()">Zip It!</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>
|
<a href="javascript:top.ICEcoder.propertiesScreen(top.ICEcoder.rightClickedFile)" onMouseOver="ICEcoder.showFileMenu()">Properties</a>
|
||||||
@@ -98,7 +106,7 @@ if (file_exists(dirname(__FILE__)."/plugins/jshint/jshint.js")) {
|
|||||||
<div class="plugins" id="pluginsContainer">
|
<div class="plugins" id="pluginsContainer">
|
||||||
<?php echo $pluginsDisplay; ?>
|
<?php echo $pluginsDisplay; ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="version">v <?php echo $ICEcoder["versionNo"];?></div><img src="images/full-screen.gif" id="screenMode" class="screenModeIcon" onClick="top.ICEcoder.fullScreenSwitcher()">
|
<div class="version"><a href="javascript:top:ICEcoder.logout()">logout</a> : 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()">
|
<img src="images/ice-coder.png" class="logo" onClick="ICEcoder.helpScreen()" onContextMenu="ICEcoder.settingsScreen()">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -122,6 +130,7 @@ if (file_exists(dirname(__FILE__)."/plugins/jshint/jshint.js")) {
|
|||||||
|
|
||||||
<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">
|
||||||
|
<a nohref onClick="top.ICEcoder.closeAllTabs()"><img src="images/nav-close.gif" class="closeAllTabs"></a>
|
||||||
<?php
|
<?php
|
||||||
for ($i=1;$i<=100;$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; thisColor=\'#000\'" onMouseOver="thisColor=this.style.color;this.style.color=\'#000\'" onMouseOut="this.style.color=thisColor"></div>';
|
echo '<div id="tab'.$i.'" class="tab" draggable="true" onClick="ICEcoder.canSwitchTabs ? ICEcoder.switchTab('.$i.') : ICEcoder.canSwitchTabs=true; thisColor=\'#000\'" onMouseOver="thisColor=this.style.color;this.style.color=\'#000\'" onMouseOut="this.style.color=thisColor"></div>';
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ if ($_GET['action']=="newFolder") {
|
|||||||
// If we're due to paste a new file...
|
// If we're due to paste a new file...
|
||||||
if ($_GET['action']=="paste") {
|
if ($_GET['action']=="paste") {
|
||||||
$source = $file;
|
$source = $file;
|
||||||
$dest = $docRoot.strClean(str_replace("|","/",$_GET['location']))."/".basename($source);
|
$dest = str_replace("//","/",$docRoot.strClean(str_replace("|","/",$_GET['location']))."/".basename($source));
|
||||||
if (!$demoMode && is_writable(dirname($dest))) {
|
if (!$demoMode && is_writable(dirname($dest))) {
|
||||||
if (is_dir($source)) {
|
if (is_dir($source)) {
|
||||||
if (!is_dir($dest)) {
|
if (!is_dir($dest)) {
|
||||||
@@ -72,16 +72,72 @@ if ($_GET['action']=="paste") {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
copy($source, $dest);
|
if (!file_exists($dest)) {
|
||||||
|
copy($source, $dest);
|
||||||
|
} else {
|
||||||
|
for ($i=2; $i<1000000000; $i++) {
|
||||||
|
if (!file_exists($dest." (".$i.")")) {
|
||||||
|
$dest = $dest." (".$i.")";
|
||||||
|
copy($source, $dest);
|
||||||
|
$i=1000000000;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// Reload file manager
|
// Reload file manager
|
||||||
echo '<script>top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'add\',\''.strClean(str_replace("|","/",$_GET['location'])).'\',\''.$fileName.'\');action="pasteFile";</script>';
|
echo '<script>top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'add\',\''.strClean(str_replace("|","/",$_GET['location'])).'\',\''.basename($dest).'\');action="pasteFile";</script>';
|
||||||
} else {
|
} 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>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>';
|
echo '<script>top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);</script>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If we're due to upload files...
|
||||||
|
if ($_GET['action']=="upload") {
|
||||||
|
if (!$demoMode) {
|
||||||
|
class fileUploader {
|
||||||
|
public function __construct($uploads) {
|
||||||
|
global $docRoot;
|
||||||
|
$uploadDir=$docRoot.$iceRoot.str_replace("..","",str_replace("|","/",strClean($_POST['folder'])."/"));
|
||||||
|
foreach($uploads as $current) {
|
||||||
|
$this->uploadFile=$uploadDir.$current->name;
|
||||||
|
$fileName = $current->name;
|
||||||
|
if ($this->upload($current,$this->uploadFile)) {
|
||||||
|
echo '<script>action="upload"; top.ICEcoder.updateFileManagerList(\'add\',top.ICEcoder.rightClickedFile.replace(/\|/g,\'/\'),\''.$fileName.'\');</script>';
|
||||||
|
} else {
|
||||||
|
echo "<script>action='nothing'; top.ICEcoder.message('Sorry, cannot upload \\n".$fileName."\\n into \\n'+top.ICEcoder.rightClickedFile.replace(/\|/g,'/'))</script>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function upload($current,$uploadFile){
|
||||||
|
if(move_uploaded_file($current->tmp_name,$uploadFile)){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function getDetails($fileArr) {
|
||||||
|
foreach($fileArr['name'] as $keyee => $info) {
|
||||||
|
$uploads[$keyee]->name=$fileArr['name'][$keyee];
|
||||||
|
$uploads[$keyee]->type=$fileArr['type'][$keyee];
|
||||||
|
$uploads[$keyee]->tmp_name=$fileArr['tmp_name'][$keyee];
|
||||||
|
$uploads[$keyee]->error=$fileArr['error'][$keyee];
|
||||||
|
}
|
||||||
|
return $uploads;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($_FILES['filesInput']){
|
||||||
|
$uploads = getDetails($_FILES['filesInput']);
|
||||||
|
$fileUploader=new fileUploader($uploads);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
echo "<script>action='nothing'; top.ICEcoder.message('Sorry, cannot upload whilst in demo mode');</script>";
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "<script>top.ICEcoder.selectedFiles=[];top.ICEcoder.hideFileMenu();top.ICEcoder.showHide('hide',top.document.getElementById('loadingMask'));</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 (!$demoMode && is_writable($docRoot.$iceRoot.str_replace("|","/",strClean($_GET['oldFileName'])))) {
|
if (!$demoMode && is_writable($docRoot.$iceRoot.str_replace("|","/",strClean($_GET['oldFileName'])))) {
|
||||||
@@ -128,15 +184,20 @@ 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 (!$demoMode && is_writable($iceRoot.$filesArray[$i])) {
|
$fullPath = str_replace($docRoot,"",$filesArray[$i]);
|
||||||
is_dir($iceRoot.$filesArray[$i])
|
$fullPath = str_replace($iceRoot,"",$fullPath);
|
||||||
? rrmdir($iceRoot.$filesArray[$i])
|
$fullPath = $docRoot.$iceRoot.$fullPath;
|
||||||
: unlink($iceRoot.$filesArray[$i]);
|
if (!$demoMode && is_writable($fullPath)) {
|
||||||
|
is_dir($fullPath)
|
||||||
|
? rrmdir($fullPath)
|
||||||
|
: unlink($fullPath);
|
||||||
|
$fileName = basename($fullPath);
|
||||||
|
$fileLoc = dirname(str_replace($docRoot,"",$fullPath));
|
||||||
// Reload file manager
|
// Reload file manager
|
||||||
echo '<script>top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'delete\',\''.$fileLoc.'\',\''.$fileName.'\');';
|
echo '<script>top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'delete\',\''.$fileLoc.'\',\''.$fileName.'\');';
|
||||||
echo 'action="delete";</script>';
|
echo 'action="delete";</script>';
|
||||||
} else {
|
} else {
|
||||||
echo "<script>top.ICEcoder.message('Sorry can\\'t delete\\n".$filesArray[$i]."');</script>";
|
echo "<script>top.ICEcoder.message('Sorry can\\'t delete\\n".str_replace($docRoot,"",$fullPath)."');</script>";
|
||||||
}
|
}
|
||||||
echo '<script>action="nothing";</script>';
|
echo '<script>action="nothing";</script>';
|
||||||
}
|
}
|
||||||
@@ -257,7 +318,7 @@ if (action=="load") {
|
|||||||
|
|
||||||
if (fileType=="image") {
|
if (fileType=="image") {
|
||||||
top.document.getElementById('blackMask').style.visibility = "visible";
|
top.document.getElementById('blackMask').style.visibility = "visible";
|
||||||
top.document.getElementById('mediaContainer').innerHTML = "<img src=\"<?php echo $fileLoc."/".$fileName;?>\" class=\"whiteGlow\" style=\"border: solid 10px #fff; max-width: 700px; max-height: 500px\" onClick=\"return false\"><br><span class=\"whiteGlow\" style=\"border: solid 10px #fff; color: #000; background-color: #fff\" onClick=\"return false\"><?php echo $fileLoc."/".$fileName;?></span>";
|
top.document.getElementById('mediaContainer').innerHTML = "<img src=\"<?php echo $fileLoc."/".$fileName;?>\" class=\"whiteGlow\" style=\"border: solid 10px #fff; max-width: 700px; max-height: 500px; background-color: #000; background-image: url('images/checkerboard.png')\" onClick=\"return false\"><br><span class=\"whiteGlow\" style=\"border: solid 10px #fff; color: #000; background-color: #fff\" onClick=\"return false\"><?php echo $fileLoc."/".$fileName;?></span>";
|
||||||
}
|
}
|
||||||
|
|
||||||
top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);
|
top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ body {overflow: hidden;
|
|||||||
}
|
}
|
||||||
|
|
||||||
h1 {font-size: 36px; font-weight: normal; color: #888; margin-bottom: 20px}
|
h1 {font-size: 36px; font-weight: normal; color: #888; margin-bottom: 20px}
|
||||||
|
a {color: #fff; text-decoration: none}
|
||||||
|
|
||||||
.help {font-family: arial, verdana, helvetica, sans-serif; background-color: #1c1c19; color: #fff; padding: 20px}
|
.help {font-family: arial, verdana, helvetica, sans-serif; background-color: #1c1c19; color: #fff; padding: 20px}
|
||||||
.help .key {display: inline-block; width: 175px; text-align: right; margin-right: 5px; float: left}
|
.help .key {display: inline-block; width: 175px; text-align: right; margin-right: 5px; float: left}
|
||||||
|
|||||||
@@ -13,6 +13,8 @@
|
|||||||
|
|
||||||
<h1 id="title">help</h1>
|
<h1 id="title">help</h1>
|
||||||
|
|
||||||
|
<a href="javascript:top.ICEcoder.showManual(<?php echo $ICEcoder["versionNo"];?>)" style="position: absolute; top: 26px; right: 20px"><div style="padding: 10px; background: #2187e7; color: #fff; font-size: 18px">ICEcoder manual</div></a>
|
||||||
|
|
||||||
<h2>In file manager</h2>
|
<h2>In file manager</h2>
|
||||||
<span class="key">Delete</span> <span class="shortcut">Delete file</span><br><br>
|
<span class="key">Delete</span> <span class="shortcut">Delete file</span><br><br>
|
||||||
|
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ h2 {font-size: 18px; font-weight: normal; color: #fff}
|
|||||||
.header .plugins img {position: relative; display: inline-block; margin-right: 15px}
|
.header .plugins img {position: relative; display: inline-block; margin-right: 15px}
|
||||||
.header .screenModeIcon {position: absolute; top: 5px; right: 178px; cursor: pointer}
|
.header .screenModeIcon {position: absolute; top: 5px; right: 178px; cursor: pointer}
|
||||||
.header .version {position: relative; display: inline-block; margin-top: 25px; font-size: 10px; color: #bbb}
|
.header .version {position: relative; display: inline-block; margin-top: 25px; font-size: 10px; color: #bbb}
|
||||||
|
.header .version a {font-size: 10px; color: #bbb; text-decoration: none}
|
||||||
.header .logo {position: relative; margin: 5px 10px 0 5px; cursor: pointer}
|
.header .logo {position: relative; margin: 5px 10px 0 5px; cursor: pointer}
|
||||||
|
|
||||||
.files {position: absolute; display: inline-block; top: 0; left: 0; height: 100%; width: 250px; background-color: #444; background-image: url('../images/files-arrow.png'); background-repeat: no-repeat; background-position: 100% 50%; overflow: hidden; z-index: 1;
|
.files {position: absolute; display: inline-block; top: 0; left: 0; height: 100%; width: 250px; background-color: #444; background-image: url('../images/files-arrow.png'); background-repeat: no-repeat; background-position: 100% 50%; overflow: hidden; z-index: 1;
|
||||||
@@ -104,7 +105,9 @@ h2 {font-size: 18px; font-weight: normal; color: #fff}
|
|||||||
-moz-transition: all 0.15s;
|
-moz-transition: all 0.15s;
|
||||||
transition: all 0.15s;
|
transition: all 0.15s;
|
||||||
}
|
}
|
||||||
.tabsBar .tab .closeTab {margin: 1px 0 0 5px; border-radius: 6px}
|
.tabsBar .tab .closeTab, .tabsBar .closeAllTabs {margin: 1px 0 0 5px; border-radius: 6px; cursor: pointer}
|
||||||
|
.tabsBar .closeAllTabs {position: absolute; margin: 6px 0 0 -25px; background: #bbb}
|
||||||
|
.tabsBar .closeAllTabs:hover {background: #000}
|
||||||
.tabsBar .newTab {display: inline-block; background-image: url('../images/nav-bg.jpg'); background-repeat: repeat-x; background-position: 0 0; padding: 6px 5px 5px 5px; border-left: solid 1px #eee; border-right: solid 1px #777; border-radius: 4px 4px 0 0; cursor: pointer;}
|
.tabsBar .newTab {display: inline-block; background-image: url('../images/nav-bg.jpg'); background-repeat: repeat-x; background-position: 0 0; padding: 6px 5px 5px 5px; border-left: solid 1px #eee; border-right: solid 1px #777; border-radius: 4px 4px 0 0; cursor: pointer;}
|
||||||
.editor .findBar {display: inline-block; height: 28px; width: 2400px; color: #fff; background-color: #141414}
|
.editor .findBar {display: inline-block; height: 28px; width: 2400px; color: #fff; background-color: #141414}
|
||||||
.findBar .findReplace {position: absolute; z-index: 1}
|
.findBar .findReplace {position: absolute; z-index: 1}
|
||||||
|
|||||||
@@ -217,12 +217,14 @@ var ICEcoder = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
// Switch the CodeMirror mode on demand
|
// Switch the CodeMirror mode on demand
|
||||||
switchMode: function() {
|
switchMode: function(mode) {
|
||||||
var cM, fileName;
|
var cM, fileName;
|
||||||
|
|
||||||
cM = ICEcoder.getcMInstance();
|
cM = ICEcoder.getcMInstance();
|
||||||
fileName = ICEcoder.openFiles[ICEcoder.selectedTab-1];
|
fileName = ICEcoder.openFiles[ICEcoder.selectedTab-1];
|
||||||
if (fileName) {
|
if (mode) {
|
||||||
|
cM.setOption("mode",mode);
|
||||||
|
} else if (fileName) {
|
||||||
fileName.indexOf('.js')>0 ? cM.setOption("mode","javascript")
|
fileName.indexOf('.js')>0 ? cM.setOption("mode","javascript")
|
||||||
: fileName.indexOf('.coffee')>0 ? cM.setOption("mode","coffeescript")
|
: fileName.indexOf('.coffee')>0 ? cM.setOption("mode","coffeescript")
|
||||||
: fileName.indexOf('.rb')>0 ? cM.setOption("mode","ruby")
|
: fileName.indexOf('.rb')>0 ? cM.setOption("mode","ruby")
|
||||||
@@ -607,6 +609,17 @@ var ICEcoder = {
|
|||||||
top.ICEcoder.serverMessage('<b>Pasting File</b><br>'+top.ICEcoder.copiedFile.toString().replace(/\|/g,"/").replace(/,/g,"\n"));
|
top.ICEcoder.serverMessage('<b>Pasting File</b><br>'+top.ICEcoder.copiedFile.toString().replace(/\|/g,"/").replace(/,/g,"\n"));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// Upload file(s) - select & submit
|
||||||
|
uploadFilesSelect: function(location) {
|
||||||
|
top.document.getElementById('uploadDir').value = location;
|
||||||
|
top.document.getElementById("fileInput").click();
|
||||||
|
},
|
||||||
|
uploadFilesSubmit: function(obj) {
|
||||||
|
top.ICEcoder.showHide('show',top.document.getElementById('loadingMask'));
|
||||||
|
document.getElementById('uploadFilesForm').submit();
|
||||||
|
event.preventDefault();
|
||||||
|
},
|
||||||
|
|
||||||
// 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;
|
||||||
@@ -633,7 +646,7 @@ var ICEcoder = {
|
|||||||
document.getElementById('fileMenu').style.display='inline-block';
|
document.getElementById('fileMenu').style.display='inline-block';
|
||||||
},
|
},
|
||||||
|
|
||||||
// Continue to show the file manager
|
// Hide the file manager
|
||||||
hideFileMenu: function() {
|
hideFileMenu: function() {
|
||||||
document.getElementById('fileMenu').style.display='none';
|
document.getElementById('fileMenu').style.display='none';
|
||||||
},
|
},
|
||||||
@@ -808,8 +821,8 @@ var ICEcoder = {
|
|||||||
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") {
|
cM = ICEcoder.getcMInstance();
|
||||||
cM = ICEcoder.getcMInstance();
|
if (cM && find.length>0 && document.findAndReplace.target.value=="this document") {
|
||||||
content = cM.getValue().toLowerCase();
|
content = cM.getValue().toLowerCase();
|
||||||
|
|
||||||
// Find & replace the next instance, or all?
|
// Find & replace the next instance, or all?
|
||||||
@@ -1329,6 +1342,12 @@ var ICEcoder = {
|
|||||||
top.ICEcoder.showHide('show',top.document.getElementById('blackMask'));
|
top.ICEcoder.showHide('show',top.document.getElementById('blackMask'));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// Show the ICEcoder manual, loaded remotely
|
||||||
|
showManual: function(version) {
|
||||||
|
top.document.getElementById('mediaContainer').innerHTML = '<iframe src="http://icecoder.net/manual?version='+version+'" class="whiteGlow" style="width: 500px; height: 500px"></iframe>';
|
||||||
|
top.ICEcoder.showHide('show',top.document.getElementById('blackMask'));
|
||||||
|
},
|
||||||
|
|
||||||
// Show the properties screen
|
// Show the properties screen
|
||||||
propertiesScreen: function(fileName) {
|
propertiesScreen: function(fileName) {
|
||||||
top.document.getElementById('mediaContainer').innerHTML = '<iframe src="lib/properties.php?fileName='+fileName.replace(/\//g,"|")+'" class="whiteGlow" style="width: 660px; height: 330px"></iframe>';
|
top.document.getElementById('mediaContainer').innerHTML = '<iframe src="lib/properties.php?fileName='+fileName.replace(/\//g,"|")+'" class="whiteGlow" style="width: 660px; height: 330px"></iframe>';
|
||||||
@@ -1479,6 +1498,11 @@ var ICEcoder = {
|
|||||||
top.ICEcoder.serverMessage('<b>chMod '+perms+' on </b><br>'+file.replace(top.iceRoot,""));
|
top.ICEcoder.serverMessage('<b>chMod '+perms+' on </b><br>'+file.replace(top.iceRoot,""));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// Logout of ICEcoder
|
||||||
|
logout: function() {
|
||||||
|
window.location = window.location + "?logout";
|
||||||
|
},
|
||||||
|
|
||||||
// Show a message
|
// Show a message
|
||||||
message: function(msg) {
|
message: function(msg) {
|
||||||
alert(msg);
|
alert(msg);
|
||||||
@@ -1699,6 +1723,13 @@ var ICEcoder = {
|
|||||||
top.ICEcoder.setTabWidths();
|
top.ICEcoder.setTabWidths();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// Close all tabs
|
||||||
|
closeAllTabs: function() {
|
||||||
|
for (var i=top.ICEcoder.cMInstances.length; i>0; i--) {
|
||||||
|
top.ICEcoder.closeTab(i);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
// Set the tabs width
|
// Set the tabs width
|
||||||
setTabWidths: function() {
|
setTabWidths: function() {
|
||||||
var availWidth, tabWidth, thisWidth;
|
var availWidth, tabWidth, thisWidth;
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
<?php
|
<?php
|
||||||
if(isset($_GET['selectedFiles'])) {
|
if(isset($_GET['selectedFiles'])) {
|
||||||
$selectedFiles=explode(":",strClean($_GET['selectedFiles']));
|
$selectedFiles=explode(":",strClean($_GET['selectedFiles']));
|
||||||
echo $selectedFiles[0].".....".$selectedFiles[1];
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
@@ -124,23 +123,25 @@ if (startTab!=top.ICEcoder.selectedTab) {
|
|||||||
$ret .= phpGrep($q, $fullPath, $base);
|
$ret .= phpGrep($q, $fullPath, $base);
|
||||||
} else if(stristr(file_get_contents($fullPath), $q)) {
|
} else if(stristr(file_get_contents($fullPath), $q)) {
|
||||||
$bFile = false;
|
$bFile = false;
|
||||||
|
$foundInSelFile = false;
|
||||||
for ($i=0;$i<count($ICEcoder['bannedFiles']);$i++) {
|
for ($i=0;$i<count($ICEcoder['bannedFiles']);$i++) {
|
||||||
if (strpos($f,$ICEcoder['bannedFiles'][$i])>0) {$bFile = true;};
|
if (strpos($f,$ICEcoder['bannedFiles'][$i])!==false) {$bFile = true;};
|
||||||
}
|
}
|
||||||
$findPath = str_replace($base,"",$fullPath);
|
$findPath = str_replace($base,"",$fullPath);
|
||||||
for ($i=0;$i<count($selectedFiles);$i++) {
|
for ($i=0;$i<count($selectedFiles);$i++) {
|
||||||
if (strpos($findPath,str_replace("|","/",$selectedFiles[$i]))!==0) {
|
$stringExtra = $selectedFiles[$i] != "|" ? "/" : "";
|
||||||
$bFile = true;
|
if (strpos($findPath.$stringExtra,str_replace("|","/",$selectedFiles[$i]).$stringExtra)===0) {
|
||||||
|
$foundInSelFile = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!$bFile) {
|
if (!$bFile && (count($selectedFiles)==0 || count($selectedFiles)>0 && $foundInSelFile)) {
|
||||||
$ret .= "<a href=\\\"javascript:top.ICEcoder.openFile('".$fullPath."');top.ICEcoder.showHide('hide',top.document.getElementById('blackMask'))\\\">";
|
$ret .= "<a href=\\\"javascript:top.ICEcoder.openFile('".$fullPath."');top.ICEcoder.showHide('hide',top.document.getElementById('blackMask'))\\\">";
|
||||||
$ret .= str_replace($base,"",$fullPath)."</a><div id=\\\"foundCount".$r."\\\">Found ".substr_count(strtolower(file_get_contents($fullPath)),$q)." times</div>";
|
$ret .= str_replace($base,"",$fullPath)."</a><div id=\\\"foundCount".$r."\\\">Found ".substr_count(strtolower(file_get_contents($fullPath)),$q)." times</div>";
|
||||||
if (isset($_GET['replace'])) {
|
if (isset($_GET['replace'])) {
|
||||||
$ret .= "<div class=\\\"replace\\\" id=\\\"replace\\\" onClick=\\\"replaceInFileSingle('".$fullPath."');this.style.display=\'none\'\\\">replace</div>";
|
$ret .= "<div class=\\\"replace\\\" id=\\\"replace\\\" onClick=\\\"replaceInFileSingle('".$fullPath."');this.style.display=\'none\'\\\">replace</div>".PHP_EOL;
|
||||||
};
|
};
|
||||||
$ret .= '<hr>';
|
$ret .= '<hr>';
|
||||||
echo 'foundArray.push("'.$fullPath.'");';
|
echo 'foundArray.push("'.$fullPath.'");'.PHP_EOL;
|
||||||
$r++;
|
$r++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,13 @@ error_reporting(-1);
|
|||||||
// 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();}
|
||||||
|
|
||||||
|
// Logout if that's the action we're taking
|
||||||
|
if (isset($_GET['logout'])) {
|
||||||
|
$_SESSION['loggedIn']=false;
|
||||||
|
session_destroy();
|
||||||
|
header("Location: dirname(__FILE__)./?loggedOut");
|
||||||
|
}
|
||||||
|
|
||||||
// Function to handle salted hashing
|
// Function to handle salted hashing
|
||||||
define('SALT_LENGTH',9);
|
define('SALT_LENGTH',9);
|
||||||
function generateHash($plainText,$salt=null) {
|
function generateHash($plainText,$salt=null) {
|
||||||
@@ -38,7 +45,7 @@ include($settingsFile);
|
|||||||
|
|
||||||
// Add ICEcoder settings to beginning of $ICEcoder array
|
// Add ICEcoder settings to beginning of $ICEcoder array
|
||||||
$ICEcoder = array(
|
$ICEcoder = array(
|
||||||
"versionNo" => "1.4",
|
"versionNo" => "1.5",
|
||||||
"codeMirrorDir" => "CodeMirror-3.0",
|
"codeMirrorDir" => "CodeMirror-3.0",
|
||||||
"demoMode" => false
|
"demoMode" => false
|
||||||
)+$ICEcoder;
|
)+$ICEcoder;
|
||||||
@@ -262,7 +269,7 @@ echo $ICEcoder["accountPassword"] == "" ? "Setup" : "Login";
|
|||||||
<div class="version">v <?php echo $ICEcoder["versionNo"];?></div>
|
<div class="version">v <?php echo $ICEcoder["versionNo"];?></div>
|
||||||
<form name="settingsUpdate" action="settings.php" method="POST">
|
<form name="settingsUpdate" action="settings.php" method="POST">
|
||||||
<input type="password" name="<?php echo $ICEcoder["accountPassword"] == "" ? "account" : "login"; ?>Password" class="accountPassword"><br><br>
|
<input type="password" name="<?php echo $ICEcoder["accountPassword"] == "" ? "account" : "login"; ?>Password" class="accountPassword"><br><br>
|
||||||
<input type="submit" name="submit" value="<?php echo $ICEcoder["accountPassword"] == "" ? "Set Password" : "Login"; ?>" class="button">
|
<input type="submit" name="submit" value="<?php echo $ICEcoder["accountPassword"] == "" ? "set password" : "login"; ?>" class="button">
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -23,6 +23,8 @@ body {font-family: arial; font-size: 10px; background: #ccc}
|
|||||||
Tip: If you have Emmet installed, also try tab key after your abbreviation
|
Tip: If you have Emmet installed, also try tab key after your abbreviation
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<span onClick="top.ICEcoder.removeSnippet()" style="position: absolute; top: 5px; right: 5px; height: 11px; background: #444; margin: 1px 0 0 5px; border-radius: 6px; cursor: pointer"><img src="../images/nav-close.gif"></span>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
Reference in New Issue
Block a user