Compare commits

..

9 Commits

Author SHA1 Message Date
Matt Pass
579dc7d5d0 Version no update to v0.6.1 2012-04-05 07:58:09 +01:00
Matt Pass
bdb7433c4a Minor CSS adjustment to show pointer mouse cursor on file names 2012-04-05 07:54:28 +01:00
Matt Pass
2a2a631c99 Minor CSS adjustment to show default mouse cursor on gutter text 2012-04-05 07:53:56 +01:00
Matt Pass
a28213983b Hitting escape key outside of content area now cancels all actions
This stops parent from loading, hides the loading mask and clears server queue tasks other than one that is processing
Also displays message to inform you it's cancelled tasks
Function added to mediate file manager icon clicks to relevant functions
Icon visibility changes depending on actions you are taking and what is available to you right now
Simple function to handle icon visibility added
Code folding function added to allow collapsing and expanding of code blocks
(Its a bit slow & basic right now and only works for HTML, but improvements to come)
2012-04-05 07:52:57 +01:00
Matt Pass
0bcbc1a222 Account Options CSS added
New classes added to cover file manager icons
Also small adjustment to plugin icons position to line up with them
2012-04-05 07:46:48 +01:00
Matt Pass
978e2145e6 File Manager Icon Options Added
When you are logged in, in place of the login box there are now icons
These icons relate to tasks you can perform using key combos
Functions already established for these, though on click calls mediating function
Icons are mostly hidden by default, and light up/hide depending on functions available to you
2012-04-05 07:45:38 +01:00
Matt Pass
e4e75ccbef New file manager icons
Icons added to allow users option to click rather than press keys
Also means ICE coder now works with tablets as well as via mouse devices
These icons only show when you are logged in
2012-04-05 07:42:32 +01:00
Matt Pass
4a804e71df Interaction improvements via CSS and alternate functions
Pointing mouse over file manager icons now shows a CSS pointer cursor
On click of the HTML tag, selectFileFolder function is called, rather than just hide context menu
Calling this from HTML rather than body tag now
This in turn means the whole line for a file isn't clickable, just the name
2012-04-05 07:40:58 +01:00
Matt Pass
c758a2ff37 Gutter click now triggers code folding
Clicking gutter in CM editor triggers new code fold/expand function
2012-04-05 07:34:14 +01:00
15 changed files with 154 additions and 19 deletions

View File

@@ -106,11 +106,12 @@ function createNewCMInstance(num) {window['cM'+num] = CodeMirror(document.body,
};
lastKeyCode = e.keyCode;
},
onGutterClick: top.ICEcoder.foldCode,
extraKeys: {"Tab": "indentMore", "Shift-Tab": "indentLess"}
});
});
// Now create the active line for this CodeMirror object
top.ICEcoder['cMActiveLine'+top.ICEcoder.selectedTab] = window['cM'+top.ICEcoder.cMInstances[top.ICEcoder.selectedTab-1]].setLineClass(0, "cm-s-activeLine");
// Now create the active line for this CodeMirror object
top.ICEcoder['cMActiveLine'+top.ICEcoder.selectedTab] = window['cM'+top.ICEcoder.cMInstances[top.ICEcoder.selectedTab-1]].setLineClass(0, "cm-s-activeLine");
};
</script>

View File

@@ -95,7 +95,7 @@ function fileManager_dir($directory, $return_link, $first_call=true) {
$fileManager .= fileManager_dir("$directory/$this_file", $return_link , false);
$fileManager .= "</li>";
} else {
$fileManager .= "<li class=\"pft-directory\" style=\"cursor: default\"><span style=\"position: relative; left:-22px; color: #888888\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [HIDDEN] ".$fileAtts."</span></li>";
$fileManager .= "<li class=\"pft-directory\" style=\"cursor: pointer\"><span style=\"position: relative; left:-22px; color: #888888\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [HIDDEN] ".$fileAtts."</span></li>";
}
} else {
// File
@@ -117,7 +117,7 @@ function fileManager_dir($directory, $return_link, $first_call=true) {
$chmodInfo = substr(sprintf('%o', fileperms($link)), -4);
$fileAtts = '<span style="color: #888888; font-size: 8px">'.$chmodInfo.'</span>';
}
$fileManager .= "<li class=\"pft-file " . strtolower($ext) . "\"><a nohref onMouseOver=\"top.ICEcoder.overFileFolder('file','$link')\" onMouseOut=\"top.ICEcoder.overFileFolder('file','')\" style=\"position: relative; left:-22px\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span id=\"".str_replace("/","|",str_replace($docRoot,"",$link))."\">" . htmlspecialchars($this_file) . "</span> ".$fileAtts."</a></li>";
$fileManager .= "<li class=\"pft-file " . strtolower($ext) . "\"><a nohref onMouseOver=\"top.ICEcoder.overFileFolder('file','$link')\" onMouseOut=\"top.ICEcoder.overFileFolder('file','')\" style=\"position: relative; left:-22px; cursor: pointer\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span id=\"".str_replace("/","|",str_replace($docRoot,"",$link))."\">" . htmlspecialchars($this_file) . "</span> ".$fileAtts."</a></li>";
} else {
$fileAtts = "<img src=\"images/file-manager-icons/padlock.png\" style=\"cursor: pointer\" onClick=\"alert('Sorry, you need higher admin level rights to view.')\">";
$fileManager .= "<li class=\"pft-file " . strtolower($ext) . "\" style=\"cursor: default\"><span style=\"position: relative; left:-22px; color: #888888\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [HIDDEN] ".$fileAtts."</span></li>";
@@ -142,14 +142,14 @@ function php4_scandir($dir) {
?>
<!DOCTYPE html>
<html onMouseDown="top.ICEcoder.mouseDown=true" onMouseUp="top.ICEcoder.mouseDown=false" onMouseMove="top.ICEcoder.getMouseXY(event);top.ICEcoder.canResizeFilesW()" onContextMenu="top.ICEcoder.rightClickedFile=top.ICEcoder.thisFileFolderLink; top.ICEcoder.selectFileFolder(); return top.ICEcoder.showMenu()" onClick="top.document.getElementById('fileMenu').style.display='none'">
<html onMouseDown="top.ICEcoder.mouseDown=true" onMouseUp="top.ICEcoder.mouseDown=false" onMouseMove="top.ICEcoder.getMouseXY(event);top.ICEcoder.canResizeFilesW()" onContextMenu="top.ICEcoder.rightClickedFile=top.ICEcoder.thisFileFolderLink; top.ICEcoder.selectFileFolder(); return top.ICEcoder.showMenu()" onClick="top.ICEcoder.selectFileFolder()">
<head>
<title>ICE Coder File Manager</title>
<link rel="stylesheet" type="text/css" href="lib/files.css">
<script src="lib/coder.js" type="text/javascript"></script>
</head>
<body onLoad="top.ICEcoder.fileManager()" onClick="top.ICEcoder.selectFileFolder()" onDblClick="top.ICEcoder.openFile()" onKeyDown="return top.ICEcoder.interceptKeys('files', event);" onKeyUp="top.ICEcoder.resetKeys(event);">
<body onLoad="top.ICEcoder.fileManager()" onDblClick="top.ICEcoder.openFile()" onKeyDown="return top.ICEcoder.interceptKeys('files', event);" onKeyUp="top.ICEcoder.resetKeys(event);">
<?php
echo fileManager($_SERVER['DOCUMENT_ROOT'], "[link]");
?>

BIN
images/delete.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 739 B

BIN
images/new-file.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 512 B

BIN
images/new-folder.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 377 B

BIN
images/open.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
images/rename.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 253 B

BIN
images/save.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
images/view.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 982 B

View File

@@ -87,11 +87,25 @@ echo 'fullPath = "'.$docRoot.'";'.PHP_EOL;
<div id="files" class="files" onMouseOver="ICEcoder.changeFilesW('expand')" onMouseOut="ICEcoder.changeFilesW('contract'); top.document.getElementById('fileMenu').style.display='none';">
<div class="account" id="account">
<form name="login" action="index.php" method="POST">
<input type="password" name="loginPassword" class="accountPassword">
<input type="submit" name="submit" value="Login" class="button">
</form>
<a nohref style="cursor: pointer" onClick="ICEcoder.lockUnlockNav()"><img src="images/file-manager-icons/padlock.png" id="fmLock" class="lock"></a>
<?php if($_SESSION['userLevel']<10) {?>
<form name="login" action="index.php" method="POST">
<input type="password" name="loginPassword" class="accountPassword">
<input type="submit" name="submit" value="Login" class="button">
</form>
<?php } else {
$lockStyleExtra = ' style="margin-top: -22px"';
?>
<div class="accountOptions">
<a nohref title="Save" onClick="ICEcoder.fMIcon('save')"><img src="images/save.png" alt="Save" id="fMSave" style="opacity: 0.3"></a>
<a nohref title="Open" onClick="ICEcoder.fMIcon('open')"><img src="images/open.png" alt="Open" id="fMOpen" style="margin-left: 7px; opacity: 0.3"></a>
<a nohref title="New File" onClick="ICEcoder.fMIcon('newFile')"><img src="images/new-file.png" alt="New File" id="fMNewFile" style="margin: 8px 0px 0px 10px; opacity: 0.3"></a>
<a nohref title="New Folder" onClick="ICEcoder.fMIcon('newFolder')"><img src="images/new-folder.png" alt="New Folder" id="fMNewFolder" style="margin: 9px 0px 0px 5px; opacity: 0.3"></a>
<a nohref title="Delete" onClick="ICEcoder.fMIcon('delete')"><img src="images/delete.png" alt="Delete" id="fMDelete" style="margin: 9px 0px 0px 5px; opacity: 0.3"></a>
<a nohref title="Rename" onClick="ICEcoder.fMIcon('rename')"><img src="images/rename.png" alt="Rename" id="fMRename" style="margin: 9px 0px 0px 5px; opacity: 0.3"></a>
<a nohref title="View" onClick="ICEcoder.fMIcon('view')"><img src="images/view.png" alt="View" id="fMView" style="margin: 9px 0px 0px 5px; opacity: 0.3"></a>
</div>
<?php ;};?>
<a nohref style="cursor: pointer" onClick="ICEcoder.lockUnlockNav()"><img src="images/file-manager-icons/padlock.png" id="fmLock" class="lock"<?php echo $lockStyleExtra; ?>></a>
</div>
<iframe id="filesFrame" class="frame" name="ff" src="files.php" style="opacity: 0" onLoad="this.style.opacity='1'"></iframe>
<div class="serverMessage" id="serverMessage"></div>

View File

@@ -64,7 +64,7 @@ body {overflow: hidden;
}
.header {position: absolute; display: inline-block; width: 100%; height: 40px; background-color: #ffffff; text-align: right; z-index: 2}
.header .plugins {position: absolute; display: inline-block; left: 27px; top: 3px}
.header .plugins {position: absolute; display: inline-block; left: 15px; top: 3px}
.header .plugins img {position: relative; display: inline-block; margin-right: 15px}
.header .version {position: relative; display: inline-block; margin-top: 25px; font-size: 10px; color: #bbbbbb}
.header .logo {position: relative; margin: 5px 10px 0px 5px}
@@ -75,6 +75,8 @@ body {overflow: hidden;
box-shadow: 0px 0px 10px 4px rgba(0,0,0,0.4);
}
.files .account {display: inline-block; height: 50px; width: 250px; margin-top: 40px; background-color: #888888}
.files .accountOptions {position: relative; height: 31px; width: 200px; margin-left: 15px; margin-top: 8px}
.files .accountOptions img {cursor: pointer}
.files .accountPassword {position: relative; border: 1px solid #888888; background-color: #999999; height: 18px; width: 140px; margin-left: 14px; margin-top: 15px}
.files .button {position: absolute; border: 0px; background: #999999; color: #555555; height:20px; margin-top: 16px; margin-left: 5px; font-size: 11px; cursor: pointer}
.files .button:hover {background-color: #444444; color: #eeeeee}

View File

@@ -246,11 +246,16 @@ var ICEcoder = {
top.ICEcoder.ctrlKeyDown = false;
return false;
// ESC (Comment/Uncomment line)
// ESC in content area (Comment/Uncomment line)
} else if(key==27 && area == "content") {
top.ICEcoder.lineCommentToggle();
return false;
// ESC not in content area (Cancel all actions)
} else if(key==27 && area != "content") {
top.ICEcoder.cancelAllActions();
return false;
// Any other key
} else {
return key;
@@ -348,6 +353,7 @@ var ICEcoder = {
i==selectedTab ? ICEcoder.changedContent[selectedTab-1]==1 ? bgVPos = -33 : bgVPos = -22 : bgVPos = bgVPos;
document.getElementById('tab'+i).style.backgroundPosition = "0px "+bgVPos+"px";
}
ICEcoder.changedContent[selectedTab-1]==1 ? top.ICEcoder.fMIconVis('fMSave',1) : top.ICEcoder.fMIconVis('fMSave',0.3);
},
// Starts a new file by setting a few vars & creating a new cM instance
@@ -520,6 +526,7 @@ var ICEcoder = {
// hide the content area if we have no tabs open
if (ICEcoder.openFiles.length==0) {
top.document.getElementById('content').style.visibility = "hidden";
top.ICEcoder.fMIconVis('fMView',0.3);
} else {
// Switch the mode & the tab
ICEcoder.switchMode();
@@ -594,7 +601,7 @@ var ICEcoder = {
ICEcoder.selectDeselectFile('deselect',resetFile);
}
}
// Set our arrray to contain 0 items
// Set our array to contain 0 items
top.ICEcoder.selectedFiles.length = 0;
}
} else {
@@ -642,6 +649,13 @@ var ICEcoder = {
document.findAndReplace.target[2].innerHTML = "selected files";
document.findAndReplace.target[3].innerHTML = "selected filenames";
}
// Finally, show or grey out the relevant file manager icons
top.ICEcoder.selectedFiles.length == 1 ? top.ICEcoder.fMIconVis('fMOpen',1) : top.ICEcoder.fMIconVis('fMOpen',0.3);
top.ICEcoder.selectedFiles.length == 1 && top.ICEcoder.thisFileFolderType == "folder" ? top.ICEcoder.fMIconVis('fMNewFile',1) : top.ICEcoder.fMIconVis('fMNewFile',0.3);
top.ICEcoder.selectedFiles.length == 1 && top.ICEcoder.thisFileFolderType == "folder" ? top.ICEcoder.fMIconVis('fMNewFolder',1) : top.ICEcoder.fMIconVis('fMNewFolder',0.3);
top.ICEcoder.selectedFiles.length == 1 ? top.ICEcoder.fMIconVis('fMDelete',1) : top.ICEcoder.fMIconVis('fMDelete',0.3);
top.ICEcoder.selectedFiles.length == 1 ? top.ICEcoder.fMIconVis('fMRename',1) : top.ICEcoder.fMIconVis('fMRename',0.3);
},
// Select or deselect file
@@ -709,6 +723,7 @@ var ICEcoder = {
} else {
top.ICEcoder.createNewTab();
}
top.ICEcoder.fMIconVis('fMView',1);
}
}
},
@@ -1178,5 +1193,108 @@ var ICEcoder = {
top.document.getElementById('header').appendChild(newBlock);
cM.addWidget(cM.getCursor(), top.document.getElementById('cssColor'), true);
}
},
// Carry out actions when clicking icons above file manager
fMIcon: function(action) {
if (action=="save" && ICEcoder.openFiles.length>0) {
top.ICEcoder.saveFile();
}
if (ICEcoder.selectedFiles.length==1) {
top.ICEcoder.rightClickedFile=top.ICEcoder.thisFileFolderLink=top.fullPath+top.ICEcoder.selectedFiles[0].replace('|','/');
if (action=="open" && ICEcoder.selectedFiles[0].indexOf(".")>0) {
top.ICEcoder.thisFileFolderType='file';
top.ICEcoder.openFile();
}
if (action=="newFile") {top.ICEcoder.newFile();}
if (action=="newFolder") {top.ICEcoder.newFolder();}
if (action=="delete") {top.ICEcoder.deleteFile(top.ICEcoder.rightClickedFile);}
if (action=="rename") {top.ICEcoder.renameFile(top.ICEcoder.rightClickedFile);}
}
if (action=="view" && ICEcoder.openFiles.length>0) {
window.open(top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1]);
}
},
// Change opacity of the file manager icons on demand
fMIconVis: function(icon, vis) {
if (top.document.getElementById(icon)) {
top.document.getElementById(icon).style.opacity = vis;
}
},
// Cancel all actions on pressing Esc in non content areas
cancelAllActions: function() {
// Stop whatever the parent may be loading, plus clear any file manager tasks other than the current one
window.stop();
if (ICEcoder.serverQueueItems.length>0) {
ICEcoder.serverQueueItems.splice(1,ICEcoder.serverQueueItems.length);
}
top.document.getElementById('loadingMask').style.visibility = "hidden";
top.ICEcoder.serverMessage('<b style="color: #dd0000">Cancelled tasks</b>');
setTimeout(function() {top.ICEcoder.serverMessage();},2000);
},
// Fold or show code by clicking line nos in the gutter
foldCode: function(instance,lineNo,mouseEvt) {
var cM, string, origLine, origChar, collapseTag, nestDepth, cursor, lastLine;
cM = top.ICEcoder.getcMInstance();
setTimeout(function() {
// If the next line is hidden, unhide lines until we reach a line that isn't hidden
if (cM.lineInfo(lineNo+1).handle.hidden) {
for (var i=lineNo;i<=1000000;i++) {
cM.lineInfo(i+1).handle.hidden ? cM.showLine(i+1) : i=1000000;
if (!cM.lineInfo(i+1).handle.hidden) {
cM.clearMarker(i);
}
}
// Clear the gutter marker
cM.clearMarker(lineNo);
} else {
// Get the line of text, plus set our original (current) line & char position
string = cM.getLine(lineNo);
origLine = cM.getCursor().line;
origChar = cM.getCursor().ch;
// Then shoft the cursor to just after the first > char
cM.setCursor(lineNo,string.indexOf(">")+1);
setTimeout(function() {
// Get the tag we're collapsing on and it's nest depth
collapseTag = top.ICEcoder.htmlTagArray[top.ICEcoder.htmlTagArray.length-1];
nestDepth = top.ICEcoder.htmlTagArray.length;
setTimeout(function() {
// If we don't have the end tag on the same line
if (string.indexOf("</"+collapseTag+">",string.indexOf("<"+collapseTag+">"))==-1) {
// Find each matching end tag in turn and if it's the same nest depth, we have the correct one
cursor = cM.getSearchCursor("</"+collapseTag+">",cM.getCursor());
for (var i=0;i<=1000000;i++) {
lastLine = cursor.findNext();
lastLine = cursor.to().line;
cM.setCursor(cursor.to().line,cursor.to().ch);
if (top.ICEcoder.htmlTagArray.length==nestDepth-1) {
i=1000000;
}
}
// Now we can hide lines in that range
for (i=lineNo+1;i<lastLine;i++) {
cM.hideLine(i);
}
}
// Finally, set the marker in the gutter and return our cursor to the original position
cM.setMarker(lineNo, "<span style=\"color: #ffffff; cursor: pointer\">+</span> %N%")
cM.setCursor(origLine,origChar);
},1);
},1);
};
},1);
}
};

View File

@@ -36,8 +36,8 @@ html, body {margin: 0px}
.cm-s-icecoder span.cm-link {color: #ff0;}
.cm-s-icecoder .CodeMirror-selected {background: #037 !important;}
.cm-s-icecoder .CodeMirror-gutter {background: #333; border-right: 1px solid #e8e8e8;}
.cm-s-icecoder .CodeMirror-gutter-text {color: #999; width: 35px;}
.cm-s-icecoder .CodeMirror-gutter {background: #333; border-right: 1px solid #e8e8e8}
.cm-s-icecoder .CodeMirror-gutter-text {color: #999; width: 35px; cursor: default}
.cm-s-icecoder .CodeMirror-cursor {border-left: 1px solid white !important;}
.cm-s-icecoder .CodeMirror-matchingbracket{border: 1px solid grey; color: black !important;}

View File

@@ -35,7 +35,7 @@ body {margin: 0px; overflow: auto}
.fileManager li {margin-left: 15px;}
/* Default file */
.fileManager LI.pft-file { list-style-image: url(../images/file-manager-icons/file.png); cursor: pointer;}
.fileManager LI.pft-file { list-style-image: url(../images/file-manager-icons/file.png); }
/* Additional file types */
.fileManager LI.ext-3gp { list-style-image: url(../images/file-manager-icons/film.png); }

View File

@@ -1,5 +1,5 @@
<?php
$versionNo = "v 0.6.0";
$versionNo = "v 0.6.1";
$codeMirrorDir = "CodeMirror-2.23";
$cMThisVer = 2.23;
$testcMVersion = false; // test if we're using the latest CodeMirror version