Compare commits

...

21 Commits
v1.4 ... v1.5

Author SHA1 Message Date
Matt Pass
ef157d71f2 Version 1.5 2013-01-18 17:19:47 +00:00
Matt Pass
0b718e0fbf Styling of a elems for manual link 2013-01-18 17:09:42 +00:00
Matt Pass
809af86c16 Link to manual from Help screen
Passes through version number to be used by function in the URL that
shows the manual
2013-01-18 17:08:26 +00:00
Matt Pass
449e8e2c4a Function to show the ICEcoder manual
Shows the manual in the mediaContainer popup, also passing through the
version number so in the future we can show relevant info.
2013-01-18 17:07:09 +00:00
Matt Pass
01c8a10463 DOCTYPE must be set before anything else
By setting doctype before settings.php, the script elements etc are
loaded after defining the doctype to be html5. This issue only affects
IE9 and not Chrome or Firefox.
2013-01-18 12:59:41 +00:00
Matt Pass
27da7ed0fe Close all tabs function added
Close button added to left of tabs as close all button. Simple styling
added to match tabs. closeAllTabs function added to close all tabs from
last back to first.
2013-01-18 12:13:09 +00:00
Matt Pass
685116c555 Can now pass mode argument to switchMode()
Allows you to set a mode to use via the API
2013-01-18 11:50:16 +00:00
Matt Pass
0c4741c793 Disallow traversing to parent dir 2013-01-15 11:54:12 +00:00
Matt Pass
4da7024f91 Upload files function added
This function will get uploaded file details for each file uploaded and
when uploaded, move the file to the user selected folder. Also shows
error message if there is an issue. Either way, when finished it will
clear the selectedFiles, file menu and hide the loading mask to return
user to normal view.
2013-01-15 11:47:31 +00:00
Matt Pass
b49a2cc52d 2 new functions to select & submit uploaded files
Select function sets uploadedDir hidden form field and clicks the file
input button for user. Submit function is automatically triggered when
files value changes, which then shows the loading screen and submits the
form. preventDefault is also needed here.
2013-01-15 11:45:06 +00:00
Matt Pass
c0fe50cd2f Upload files option added
Clicking on new 'Upload File(s)' option triggers a function to click the
file input button. onChange of this value, the submit function is called
to post the form
2013-01-15 11:43:24 +00:00
Matt Pass
497efaabf0 Fixing multiple & path issies in delete function
Establish a fullPath to begin with and use that
Only show relative path in message re not being able to delete
2013-01-13 16:10:19 +00:00
Matt Pass
2ee777739f Paste same name files with postfixed next nos
$dest now has double slashes replaced with singles
Now also considers if a file exists before copying
If it does, next available number up to 1 billion postfixed to end of
filename
Copy with that new filename, next number postfixed
Slight adjust to filename shown in file manager to match
2013-01-13 15:13:34 +00:00
Matt Pass
deb3ad5359 Logout link added
Logout link added to left of version no, next to logo in top right
Clicking this triggers the logout function, which directs the browser to
the same window location with ?logout QS
The settings.php file is run again (via inclusion) and finding the QS
var, sets the loggedIn var set to false (as a double measure to the
session also being destroyed) and header location boots user back to
login screen
2013-01-13 14:37:36 +00:00
Matt Pass
3f1801ef2b Postfix comparison to check path
Establish a stringExtra value of a slash or nothing depending on wether
we are considering the root level or not
When comparing the folder against the selectedFile array value, postfix
both with a slash (could be any char though). This is to eliminate path
mismatches.
2013-01-13 13:46:59 +00:00
Matt Pass
ca8e92e443 Establish cM and consider in if statement
Avoids errors on content = cM.getValue line
2013-01-13 13:09:46 +00:00
Matt Pass
c514e4a1ad Replace pipes with slahes before opening URL 2013-01-13 12:53:59 +00:00
Matt Pass
ec28de40c9 Checkerboard BG behind image popups
Show checkerboard image behind image popups so you can see transparent
areas on images. Needed black BG as a fallback too.
2013-01-13 12:47:48 +00:00
Matt Pass
14053fbfdd Fixed banned & selected finding issues
Remove old echo test message
Added new $foundInSelFile var
Both this and bFile are false to begin with
Testing on not false of bannedFile in strpos
If we find our matching item is one of our selected files, set
$foundInSelFile to true
Only if we don't have a banned file and either we have no selected
files, or we do have some and have a match, push to array etc
PHP_EOL's to make source easier to read
2012-12-30 19:24:17 +00:00
Matt Pass
464030808c No need to preload the snippet display
Doesn't help with repainting issue
2012-12-30 19:20:43 +00:00
Matt Pass
d2377bff34 Close button for snippet-display 2012-12-30 19:20:09 +00:00
11 changed files with 838 additions and 723 deletions

View File

@@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 231 B

View File

@@ -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>';

View File

@@ -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);

View File

@@ -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}

View File

@@ -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>

View File

@@ -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}

View File

@@ -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;

View File

@@ -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++;
} }
} }

View File

@@ -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>

View File

@@ -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>