Compare commits
42 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f0d4ef75d3 | ||
|
|
ec27eb53bc | ||
|
|
6512d4895b | ||
|
|
de81341452 | ||
|
|
97e6906f17 | ||
|
|
feeb3907bf | ||
|
|
955d7714a2 | ||
|
|
e506d5a535 | ||
|
|
09ff2f279d | ||
|
|
e17a240661 | ||
|
|
a6e244a82f | ||
|
|
491fb4c243 | ||
|
|
ca46e36e5a | ||
|
|
09e3ece5a7 | ||
|
|
57e820501a | ||
|
|
1577118643 | ||
|
|
856a0c9f31 | ||
|
|
c621479709 | ||
|
|
b7769e6203 | ||
|
|
b1e27282a9 | ||
|
|
c19df45ec1 | ||
|
|
0ca29f9201 | ||
|
|
e208b45a88 | ||
|
|
b8f7be6376 | ||
|
|
5ae958e349 | ||
|
|
7237ef8c69 | ||
|
|
215a4ab362 | ||
|
|
8c83378b8b | ||
|
|
9d14ca1eb2 | ||
|
|
78067a8dec | ||
|
|
d12ea02c42 | ||
|
|
3ceb519b8a | ||
|
|
5508cd1074 | ||
|
|
d2bf52e5a3 | ||
|
|
f39b8e2a35 | ||
|
|
8c97be00dc | ||
|
|
83085c4c1f | ||
|
|
8adec9a48b | ||
|
|
c177374d23 | ||
|
|
334ced8627 | ||
|
|
d8229d79a5 | ||
|
|
c8665584e9 |
@@ -23,7 +23,7 @@
|
||||
function markDocument(cm, className, minChars) {
|
||||
clearMarks(cm);
|
||||
minChars = (typeof minChars !== 'undefined' ? minChars : DEFAULT_MIN_CHARS);
|
||||
if (cm.somethingSelected() && cm.getSelection().length >= minChars) {
|
||||
if (cm.somethingSelected() && cm.getSelection().replace(/^\s+|\s+$/g, "").length >= minChars) {
|
||||
var state = getMatchHighlightState(cm);
|
||||
var query = cm.getSelection();
|
||||
cm.operation(function() {
|
||||
|
||||
77
README.md
@@ -1,27 +1,66 @@
|
||||
ICE coder :: Matt Pass
|
||||
#ICEcoder
|
||||
##Web based IDE for smart web development
|
||||
|
||||
Demo: http://www.mattpass.com/_coder
|
||||
Early version of the web based IDE which allows for creation of websites in the web browser. Uses the brilliant CodeMirror for code highlighting & editing, with a slick IDE wrapped around it to make the whole thing work.
|
||||
|
||||
Early version of the web based IDE which allows for creation of websites in the web browser.
|
||||
###Features you'd expect
|
||||
* Context aware code highlighting
|
||||
* Supports HTML, CSS, JavaScript, PHP & Ruby
|
||||
* Smart tab key system (selected text indents line)
|
||||
* File manager
|
||||
* Find & replace/replace all
|
||||
* Document tabs indicate current doc & changes made
|
||||
* Code folding
|
||||
* Open last files on load
|
||||
* Web based, access from anywhere
|
||||
* Free, open source & customisable
|
||||
|
||||
Uses the brilliant CodeMirror plus some other PHP & JS code to deal with file handling and make the whole thing work. Also has the extra plugin 'Adminer' for DB management.
|
||||
###Cool features you wouldn't expect
|
||||
* Find & replace in current doc, open docs, files & filenames
|
||||
* Found match & current position counter
|
||||
* Indicates content type cursor is on
|
||||
* Account login to keep certain files secure
|
||||
* Restrict files, ban files and restrict by IP
|
||||
* Settings to change functionality & editor theme
|
||||
* Code Assist system
|
||||
* Displays nest position of text cursor, hover to select, click to set cursor
|
||||
* Nest structure OK/broken indicator
|
||||
* Highlight word and press CTRL+I to Google search that
|
||||
* Adds end tags as you type and in a context aware way
|
||||
* Can rename open files (whoaah!)
|
||||
* CTRL+Enter open current webpage in new tab
|
||||
* CTRL+S+Enter opens a sticky tab to show live edits
|
||||
* ESC = Comment/Uncomment line, incl partial lines
|
||||
* Image viewer
|
||||
* Colour preview block on CSS colours, ie red, #ff0000 or RGBA(255,0,0,0.5)
|
||||
* MySQL Database management via Adminer plugin
|
||||
* Backs up files every 10 mins or on click of backup plugin icon
|
||||
|
||||
###Installation
|
||||
|
||||
####Step 1: Clone the repo
|
||||
|
||||
```
|
||||
$ git clone git@github:mattpass/ICEcoder
|
||||
```
|
||||
|
||||
####Step 2: Upload all the files
|
||||
```
|
||||
Linux or Windows hosting OK
|
||||
Upload to a new sub-dir URL such as yourdomain.com/_coder
|
||||
Set public write permissions on the lib/settings.php file
|
||||
```
|
||||
|
||||
####Step 3: Start coding
|
||||
```
|
||||
Visit the sub-dir URL in your browser and enter a password
|
||||
Now you're setup, auto-logged in too and ready to code
|
||||
```
|
||||
|
||||
Suitable for commercial & non-commercial projects, just let me know if it's useful to you and any cool customisations you make to it. I take no responsibility for anything, your usage is all down to you.
|
||||
|
||||
Is fully open source and I'd encourage you to take it, make it your own and customise to your hearts content! :)
|
||||
|
||||
Suitable for commercial & non-commercial projects, just let me know if it's useful to you and any cool customisations you make to it.
|
||||
|
||||
Please feel free to assist with the development of this and maybe in time we can produce a fantastic web based IDE for web devs.
|
||||
|
||||
INSTALLATION
|
||||
|
||||
1.Open /lib/settings.php and adjust variables to suit
|
||||
|
||||
2.Upload all the files to a Linux or Windows host under a new sub-dir URL such as yourdomain.com/_coder. Set public write permissions on the settings.php file
|
||||
|
||||
3.Visit this URL in your browser and set a password
|
||||
|
||||
4.Now you have top level access and can save (CTRL+S), delete (DEL) etc
|
||||
|
||||
Plenty of comments included in the code to assist with understanding.
|
||||
Plenty of comments included in the code to assist with understanding, customising etc.
|
||||
|
||||
Comments, improvements & feedback welcomed!
|
||||
@@ -79,7 +79,7 @@ function createNewCMInstance(num) {
|
||||
},
|
||||
onKeyEvent: function(instance, e) {
|
||||
top.ICEcoder.redoChangedContent(event);
|
||||
top.ICEcoder.findReplace('find',true);
|
||||
top.ICEcoder.findReplace('find',true,false);
|
||||
top.ICEcoder.getCaretPosition();
|
||||
top.ICEcoder.updateCharDisplay();
|
||||
tok = window['cM'+top.ICEcoder.cMInstances[top.ICEcoder.selectedTab-1]].getTokenAt(window['cM'+top.ICEcoder.cMInstances[top.ICEcoder.selectedTab-1]].getCursor());
|
||||
|
||||
BIN
images/Thumbs.db
|
Before Width: | Height: | Size: 464 B |
|
Before Width: | Height: | Size: 603 B |
|
Before Width: | Height: | Size: 618 B After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 579 B |
|
Before Width: | Height: | Size: 537 B After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 651 B After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 653 B |
|
Before Width: | Height: | Size: 582 B |
BIN
images/file-manager-icons/gif.png
Normal file
|
After Width: | Height: | Size: 954 B |
|
Before Width: | Height: | Size: 734 B After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 633 B |
BIN
images/file-manager-icons/jpg.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
images/file-manager-icons/js.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 668 B |
|
Before Width: | Height: | Size: 385 B |
|
Before Width: | Height: | Size: 447 B After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 591 B |
|
Before Width: | Height: | Size: 538 B After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 606 B |
BIN
images/file-manager-icons/png.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 588 B |
|
Before Width: | Height: | Size: 856 B |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 626 B After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 859 B |
|
Before Width: | Height: | Size: 663 B |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 56 B After Width: | Height: | Size: 56 B |
|
Before Width: | Height: | Size: 377 B After Width: | Height: | Size: 1.2 KiB |
16
index.php
@@ -92,7 +92,7 @@ lastOpenFiles = [<?php
|
||||
<?php echo $pluginsDisplay; ?>
|
||||
</div>
|
||||
<div class="version"><?php echo $versionNo;?></div>
|
||||
<img src="images/ice-coder.gif" class="logo" onContextMenu="ICEcoder.settingsScreen('show')">
|
||||
<img src="images/ice-coder.gif" class="logo" onClick="ICEcoder.helpScreen('show')" onContextMenu="ICEcoder.settingsScreen('show')">
|
||||
</div>
|
||||
|
||||
<div id="files" class="files" onMouseOver="ICEcoder.changeFilesW('expand')" onMouseOut="ICEcoder.changeFilesW('contract'); top.document.getElementById('fileMenu').style.display='none';">
|
||||
@@ -132,22 +132,28 @@ lastOpenFiles = [<?php
|
||||
<form name="findAndReplace">
|
||||
<div class="findReplace">
|
||||
<div class="findText">Find</div>
|
||||
<input type="text" name="find" value="" id="find" class="textbox find" onKeyUp="ICEcoder.findReplace('find',true)">
|
||||
<input type="text" name="find" value="" id="find" class="textbox find" onKeyUp="ICEcoder.findReplace('find',true,false)">
|
||||
<div class="findTextPlural">'s</div>
|
||||
<select name="connector" onChange="ICEcoder.findReplaceOptions()">
|
||||
<option>in</option>
|
||||
<option>and</option>
|
||||
</select>
|
||||
<div class="replaceText" id="rText" style="display: none">replace with</div>
|
||||
<div class="replaceText" id="rText" style="display: none">
|
||||
<select name="replaceAction" class="replaceAction">
|
||||
<option>replace</option>
|
||||
<option>replace all</option>
|
||||
</select>
|
||||
with
|
||||
</div>
|
||||
<input type="text" name="replace" value="" id="replace" class="textbox replace" style="display: none">
|
||||
<div class="targetText" id="rTarget" style="display: none">in</div>
|
||||
<select name="target">
|
||||
<select name="target" onChange="ICEcoder.updateResultsDisplay(this.value=='this document' ? 'show' : 'hide')">
|
||||
<option>this document</option>
|
||||
<option>open documents</option>
|
||||
<option>all files</option>
|
||||
<option>all filenames</option>
|
||||
</select>
|
||||
<input type="button" name="submit" value=">>" class="submit" onClick="ICEcoder.findReplace('findReplace',false)">
|
||||
<input type="button" name="submit" value=">>" class="submit" onClick="ICEcoder.findReplace('findReplace',false,true)">
|
||||
<div class="results" id="results"></div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@@ -18,10 +18,11 @@ table, caption, tbody, tfoot, thead, tr, th, td {
|
||||
}
|
||||
|
||||
body {overflow: hidden;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-o-user-select:none;
|
||||
user-select: none;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-o-user-select:none;
|
||||
user-select: none;
|
||||
background-color: #222222;
|
||||
}
|
||||
|
||||
h1 {font-size: 36px; font-weight: normal; color: #888888; margin-bottom: 20px}
|
||||
@@ -77,7 +78,7 @@ h2 {font-size: 18px; font-weight: normal; color: #ffffff}
|
||||
.header .version {position: relative; display: inline-block; margin-top: 25px; font-size: 10px; color: #bbbbbb}
|
||||
.header .logo {position: relative; margin: 5px 10px 0px 5px; cursor: pointer}
|
||||
|
||||
.files {position: absolute; display: inline-block; height: 100%; width: 250px; background-color: #e0e0e0; background-image: url('../images/files-arrow.gif'); background-repeat: no-repeat; background-position: 100% 50%; overflow: hidden; z-index: 1;
|
||||
.files {position: absolute; display: inline-block; height: 100%; width: 250px; background-color: #444444; background-image: url('../images/files-arrow.gif'); background-repeat: no-repeat; background-position: 100% 50%; overflow: hidden; z-index: 1;
|
||||
-webkit-box-shadow: 0px 0px 10px 4px rgba(0,0,0,0.4);
|
||||
-moz-box-shadow: 0px 0px 10px 4px rgba(0,0,0,0.4);
|
||||
box-shadow: 0px 0px 10px 4px rgba(0,0,0,0.4);
|
||||
@@ -103,7 +104,7 @@ h2 {font-size: 18px; font-weight: normal; color: #ffffff}
|
||||
.files .button:hover {background-color: #444444; color: #eeeeee}
|
||||
.files .lock {position: relative; margin-left: 225px; margin-top: -20px; z-index: 1}
|
||||
.files .frame {display: inline-block; width: 250px}
|
||||
.files .serverMessage {position: absolute; display: inline-block; width: 180px; bottom: 0px; margin-bottom: 30px; background-color: rgba(255,255,255,0.8); font-size: 10px; padding: 7px 12px; opacity: 0;
|
||||
.files .serverMessage {position: absolute; display: inline-block; width: 450px; bottom: 0px; margin-bottom: 30px; background-color: rgba(255,255,255,0.8); font-size: 10px; padding: 7px 12px; opacity: 0;
|
||||
-webkit-transition: all 0.2s;
|
||||
-moz-transition: all 0.2s;
|
||||
-o-transition: all 0.2s;
|
||||
@@ -111,22 +112,23 @@ h2 {font-size: 18px; font-weight: normal; color: #ffffff}
|
||||
}
|
||||
.files .serverMessage b {font-size: 10px}
|
||||
|
||||
.editor {position: absolute; display: inline-block; top: 0px; left: 15px; width: 2400px; background-color: #fbfbfb;}
|
||||
.editor .tabsBar {display: inline-block; height: 21px; width: 2400px; margin-top: 40px; padding-left: 41px; border-bottom: solid 1px #888888; background-color: #eeeeee;}
|
||||
.tabsBar .tab {display: inline-block; display: none; background-image: url('../images/nav-bg.gif'); background-repeat: repeat-x; background-position: 0px 0px; padding: 4px 8px 2px 8px; font-size: 10px; border-left: solid 1px #ffffff; border-right: solid 1px #bbbbbb; color: #ffffff; cursor: pointer;
|
||||
-webkit-transition: all 0.2s;
|
||||
-moz-transition: all 0.2s;
|
||||
-o-transition: all 0.2s;
|
||||
transition: all 0.2s;
|
||||
.editor {position: absolute; display: inline-block; top: 0px; left: 15px; width: 2400px}
|
||||
.editor .tabsBar {display: inline-block; height: 22px; width: 2400px; margin-top: 40px; padding-left: 41px; background-color: #888888;}
|
||||
.tabsBar .tab {display: inline-block; display: none; background-image: url('../images/nav-bg.gif'); background-repeat: repeat-x; background-position: 0px 0px; padding: 5px 8px 2px 8px; font-size: 10px; border-left: solid 1px #ffffff; border-right: solid 1px #777777; color: #ffffff; cursor: pointer;
|
||||
-webkit-transition: all 0.15s;
|
||||
-moz-transition: all 0.15s;
|
||||
-o-transition: all 0.15s;
|
||||
transition: all 0.15s;
|
||||
}
|
||||
.tabsBar .tab img {margin: 1px 0px 0px 5px}
|
||||
.tabsBar .newTab {display: inline-block; background-image: url('../images/nav-bg.gif'); background-repeat: repeat-x; background-position: 0px 0px; padding: 5px 5px 1px 5px; border-left: solid 1px #ffffff; border-right: solid 1px #bbbbbb; cursor: pointer;}
|
||||
.editor .findBar {display: inline-block; height: 28px; width: 2400px; background-color: #eeeeee}
|
||||
.tabsBar .tab .closeTab {margin: 1px 0px 0px 5px; border-radius: 6px}
|
||||
.tabsBar .newTab {display: inline-block; background-image: url('../images/nav-bg.gif'); background-repeat: repeat-x; background-position: 0px 0px; padding: 6px 5px 1px 5px; border-left: solid 1px #ffffff; border-right: solid 1px #777777; cursor: pointer;}
|
||||
.editor .findBar {display: inline-block; height: 28px; width: 2400px; color: #ffffff; background-color: #141414}
|
||||
.findBar .findReplace {position: absolute; z-index: 1}
|
||||
.findReplace select {position: relative; font-size: 10px; margin: 8px 2px 0px 2px; top: -2px;}
|
||||
.findReplace .findText {display: inline-block; height: 21px; font-size: 10px; margin: 8px 2px 0px 2px; margin-left: 43px}
|
||||
.findReplace .find {position: relative; width: 120px; height: 16px; border: 0; top: -2px; font-size: 10px; padding-left: 5px}
|
||||
.findReplace .findTextPlural {display: inline-block; height: 21px; font-size: 10px; margin: 8px 2px 0px 0px}
|
||||
.findReplace .replaceAction {margin: 0px 2px 0px 0px; top: -2px}
|
||||
.findReplace .replaceText {height: 21px; font-size: 10px; margin: 8px 2px 0px 2px}
|
||||
.findReplace .replace {position: relative; width: 120px; height: 16px; border: 0; top: -2px; font-size: 10px; padding-left: 5px}
|
||||
.findReplace .targetText {height: 21px; font-size: 10px; margin: 8px 2px 0px 2px}
|
||||
|
||||
134
lib/coder.js
@@ -16,6 +16,7 @@ var ICEcoder = {
|
||||
delKeyDown: false, // Indicates if DEL keydown
|
||||
canSwitchTabs: true, // Stops switching of tabs when trying to close
|
||||
openFiles: [], // Array of open file URLs
|
||||
openFileMDTs: [], // Array of open file modification datetimes
|
||||
cMInstances: [], // List of CodeMirror instance no's
|
||||
nextcMInstance: 1, // Next available CodeMirror instance no
|
||||
selectedFiles: [], // Array of selected files
|
||||
@@ -93,7 +94,6 @@ var ICEcoder = {
|
||||
if (fileName.indexOf(".js")<0&&fileName.indexOf(".rb")&&fileName.indexOf(".css")<0) {
|
||||
cM = ICEcoder.getcMInstance();
|
||||
content = cM.getValue();
|
||||
if (top.ICEcoder.codeAssist) {content = content.replace(/ & /g,' & ');};
|
||||
content = content.replace(/<ICEcoder:\/:textarea>/g,'</textarea>');
|
||||
|
||||
// Then set the content in the editor & clear the history
|
||||
@@ -178,12 +178,13 @@ var ICEcoder = {
|
||||
|
||||
// Now we've built up our nest depth array, if we're due to show it in the display
|
||||
if (updateNestDisplay && !top.ICEcoder.dontUpdateNest) {
|
||||
|
||||
// Clear the display
|
||||
ICEcoder.nestDisplay.innerHTML = "";
|
||||
if ("undefined" != typeof ICEcoder.openFiles[ICEcoder.selectedTab-1]) {
|
||||
fileName = ICEcoder.openFiles[ICEcoder.selectedTab-1];
|
||||
if (fileName.indexOf(".js")<0&&fileName.indexOf(".rb")<0&&fileName.indexOf(".css")<0) {
|
||||
if (fileName.indexOf(".js")<0&&fileName.indexOf(".rb")<0&&fileName.indexOf(".css")<0&&
|
||||
(nestCheck.indexOf("include(")==-1)&&(nestCheck.indexOf("include_once(")==-1)&&
|
||||
(nestCheck.indexOf("<html")>-1||nestCheck.indexOf("<body")>-1)) {
|
||||
|
||||
// Then for all the array items, output as the nest display
|
||||
for (var i=0;i<ICEcoder.htmlTagArray.length;i++) {
|
||||
@@ -360,17 +361,22 @@ var ICEcoder = {
|
||||
ICEcoder.redoTabHighlight(ICEcoder.selectedTab);
|
||||
|
||||
// Redo our find display
|
||||
ICEcoder.findReplace('find',true);
|
||||
top.ICEcoder.findMode = false;
|
||||
ICEcoder.findReplace('find',true,false);
|
||||
}
|
||||
},
|
||||
|
||||
// Reset all tabs to be without a highlight and then highlight the selected
|
||||
redoTabHighlight: function(selectedTab) {
|
||||
var bgVPos;
|
||||
var bgVPos, tColor;
|
||||
|
||||
for(var i=1;i<=ICEcoder.changedContent.length;i++) {
|
||||
ICEcoder.changedContent[i-1]==1 ? bgVPos = -44 : bgVPos = 0;
|
||||
i==selectedTab ? ICEcoder.changedContent[selectedTab-1]==1 ? bgVPos = -33 : bgVPos = -22 : bgVPos = bgVPos;
|
||||
if (document.getElementById('closeTabButton'+i)) {
|
||||
ICEcoder.changedContent[i-1]==1 ? document.getElementById('closeTabButton'+i).style.backgroundColor = "#bb0000" : document.getElementById('closeTabButton'+i).style.backgroundColor = "rgba(255,255,255,0.3)";
|
||||
}
|
||||
i==selectedTab ? tColor = "#ffffff" : tColor = "#000000";
|
||||
document.getElementById('tab'+i).style.color = tColor;
|
||||
i==selectedTab ? bgVPos = -22 : bgVPos = 0;
|
||||
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);
|
||||
@@ -405,7 +411,7 @@ var ICEcoder = {
|
||||
top.ICEcoder.openFiles.push(top.ICEcoder.shortURL);
|
||||
|
||||
// Setup a new tab
|
||||
closeTabLink = '<a nohref onClick="parent.ICEcoder.closeTab('+(top.ICEcoder.openFiles.length)+')"><img src="images/nav-close.gif"></a>';
|
||||
closeTabLink = '<a nohref onClick="top.ICEcoder.closeTab('+(top.ICEcoder.openFiles.length)+')"><img src="images/nav-close.gif" id="closeTabButton'+(top.ICEcoder.openFiles.length)+'" class="closeTab"></a>';
|
||||
top.document.getElementById('tab'+(top.ICEcoder.openFiles.length)).style.display = "inline-block";
|
||||
top.document.getElementById('tab'+(top.ICEcoder.openFiles.length)).innerHTML = top.ICEcoder.openFiles[top.ICEcoder.openFiles.length-1] + " " + closeTabLink;
|
||||
|
||||
@@ -427,7 +433,7 @@ var ICEcoder = {
|
||||
top.ICEcoder.openFiles[tabNum] = newName;
|
||||
|
||||
// Setup a new tab
|
||||
closeTabLink = '<a nohref onClick="parent.ICEcoder.closeTab('+tabNum+')"><img src="images/nav-close.gif"></a>';
|
||||
closeTabLink = '<a nohref onClick="parent.ICEcoder.closeTab('+tabNum+')"><img src="images/nav-close.gif" id="closeTabButton'+tabNum+'" class="closeTab"></a>';
|
||||
top.document.getElementById('tab'+tabNum).innerHTML = top.ICEcoder.openFiles[tabNum] + " " + closeTabLink;
|
||||
},
|
||||
|
||||
@@ -504,7 +510,7 @@ var ICEcoder = {
|
||||
// Alter array indicating which files have changed
|
||||
redoChangedContent: function(evt) {
|
||||
var key;
|
||||
|
||||
|
||||
key = evt.keyCode ? evt.keyCode : evt.which ? evt.which : evt.charCode;
|
||||
// Exclude a few keys such as Escape...
|
||||
if (top.ICEcoder.ctrlKeyDown==false && key!=27 && key!=20 && (key<16||key>19) && (key<37||key>40) && (key!=144||key!=145) && (key!=44||key!=45) && (key<33||key>36) && (key!=91||key!=92) && (key<112||key>123)) {
|
||||
@@ -530,21 +536,20 @@ var ICEcoder = {
|
||||
ICEcoder.openFiles[i-1] = ICEcoder.openFiles[i];
|
||||
|
||||
// reduce the tab reference number on the closeTab link by 1
|
||||
top.document.getElementById('tab'+i).innerHTML = top.document.getElementById('tab'+i).innerHTML.replace(("closeTab("+(i+1)+")"),"closeTab("+i+")");
|
||||
top.document.getElementById('tab'+i).innerHTML = top.document.getElementById('tab'+i).innerHTML.replace(("closeTab("+(i+1)+")"),"closeTab("+i+")").replace(("closeTabButton("+(i+1)+")"),"closeTabButton("+i+")");
|
||||
}
|
||||
|
||||
// hide the instance we're closing by setting the hide class, clear the value & remove from the array
|
||||
// hide the instance we're closing by setting the hide class and removing from the array
|
||||
ICEcoder.content.contentWindow['cM'+top.ICEcoder.cMInstances[closeTabNum-1]].setOption('theme',top.theme+' hidden');
|
||||
ICEcoder.content.contentWindow['cM'+top.ICEcoder.cMInstances[closeTabNum-1]].setValue('');
|
||||
top.ICEcoder.cMInstances.splice(closeTabNum-1,1);
|
||||
|
||||
// clear the rightmost tab (or only one left in a 1 tab scenario) & remove from the array
|
||||
top.document.getElementById('tab'+ICEcoder.openFiles.length).style.display = "none";
|
||||
top.document.getElementById('tab'+ICEcoder.openFiles.length).innerHTML = "";
|
||||
ICEcoder.openFiles.pop();
|
||||
|
||||
// Determin the new selectedTab number, reduced by 1 if we have some tabs, 0 for a reset state
|
||||
ICEcoder.openFiles.length>0 ? ICEcoder.selectedTab-=1 : ICEcoder.selectedTab = 0;
|
||||
ICEcoder.openFileMDTs.pop();
|
||||
// If we're closing the selected tab, determin the new selectedTab number, reduced by 1 if we have some tabs, 0 for a reset state
|
||||
if (ICEcoder.selectedTab==closeTabNum) {
|
||||
ICEcoder.openFiles.length>0 ? ICEcoder.selectedTab-=1 : ICEcoder.selectedTab = 0;
|
||||
}
|
||||
if (ICEcoder.openFiles.length>0 && ICEcoder.selectedTab==0) {ICEcoder.selectedTab=1};
|
||||
|
||||
// hide the content area if we have no tabs open
|
||||
@@ -556,7 +561,6 @@ var ICEcoder = {
|
||||
ICEcoder.switchMode();
|
||||
ICEcoder.switchTab(ICEcoder.selectedTab);
|
||||
}
|
||||
|
||||
// Highlight the selected tab after splicing the change state out of the array
|
||||
top.ICEcoder.changedContent.splice(closeTabNum-1,1);
|
||||
top.parent.ICEcoder.redoTabHighlight(ICEcoder.selectedTab);
|
||||
@@ -687,8 +691,8 @@ var ICEcoder = {
|
||||
|
||||
// Select or deselect file
|
||||
selectDeselectFile: function(action,file) {
|
||||
action == "select" ? file.style.backgroundColor="#888888" : file.style.backgroundColor="#dddddd";
|
||||
action == "select" ? file.style.color="#f8f8f8" : file.style.color="#000000";
|
||||
action == "select" ? file.style.backgroundColor="#888888" : file.style.backgroundColor="transparent";
|
||||
action == "select" ? file.style.color="#ffffff" : file.style.color="#eeeeee";
|
||||
},
|
||||
|
||||
// Create a new file (start & instant save)
|
||||
@@ -760,8 +764,8 @@ var ICEcoder = {
|
||||
var saveType;
|
||||
|
||||
saveAs ? saveType = "saveAs" : saveType = "save";
|
||||
|
||||
top.ICEcoder.serverQueue("add","lib/file-control.php?action=save&file="+ICEcoder.openFiles[ICEcoder.selectedTab-1].replace(/\//g,"|")+"&saveType="+saveType);
|
||||
|
||||
top.ICEcoder.serverQueue("add","lib/file-control.php?action=save&file="+ICEcoder.openFiles[ICEcoder.selectedTab-1].replace(/\//g,"|")+"&fileMDT="+ICEcoder.openFileMDTs[ICEcoder.selectedTab-1]+"&saveType="+saveType);
|
||||
top.ICEcoder.serverMessage('<b>Saving</b><br>'+ICEcoder.openFiles[ICEcoder.selectedTab-1]);
|
||||
},
|
||||
|
||||
@@ -776,7 +780,7 @@ var ICEcoder = {
|
||||
if(top.ICEcoder.openFiles[i]==shortURL.replace(/\|/g,"/")) {
|
||||
// rename array item and the tab
|
||||
top.ICEcoder.openFiles[i] = renamedFile;
|
||||
closeTabLink = '<a nohref onClick="top.ICEcoder.files.contentWindow.closeTab('+(i+1)+')"><img src="images/nav-close.gif"></a>';
|
||||
closeTabLink = '<a nohref onClick="top.ICEcoder.files.contentWindow.closeTab('+(i+1)+')"><img src="images/nav-close.gif" id="closeTabButton'+(i+1)+'" class="closeTab"></a>';
|
||||
top.document.getElementById('tab'+(i+1)).innerHTML = top.ICEcoder.openFiles[i] + " " + closeTabLink;
|
||||
}
|
||||
}
|
||||
@@ -817,7 +821,7 @@ var ICEcoder = {
|
||||
if (!foundFile) {top.ICEcoder.selectFileFolder()};
|
||||
|
||||
if ("undefined" != typeof top.ICEcoder.thisFileFolderLink && top.ICEcoder.thisFileFolderLink!="") {
|
||||
top.ICEcoder.selectedFiles[0].indexOf(".")>0 ? menuType = "file" : menuType = "folder";
|
||||
top.ICEcoder.selectedFiles[0].indexOf(".")>-1 ? menuType = "file" : menuType = "folder";
|
||||
folderMenuItems = top.document.getElementById('folderMenuItems');
|
||||
menuType == "folder" && top.ICEcoder.selectedFiles.length == 1 ? folderMenuItems.style.display = "block" : folderMenuItems.style.display = "none";
|
||||
top.ICEcoder.selectedFiles.length > 1 ? singleFileMenuItems.style.display = "none" : singleFileMenuItems.style.display = "block";
|
||||
@@ -845,30 +849,42 @@ var ICEcoder = {
|
||||
},
|
||||
|
||||
// Find & replace text according to user selections
|
||||
findReplace: function(action,resultsOnly) {
|
||||
var find, findLen, cM, content, lineCount, numChars, charsToCursor, charCount, startPos, endPos;
|
||||
findReplace: function(action,resultsOnly,buttonClick) {
|
||||
var find, findLen, replaceLen, cM, content, lineCount, numChars, charsToCursor, charCount, startPos, endPos, replaceQS;
|
||||
|
||||
// Determine our find string, in lowercase and the length of that
|
||||
find = parent.parent.document.getElementById('find').value.toLowerCase();
|
||||
find = top.document.getElementById('find').value;
|
||||
findLen = find.length;
|
||||
replaceLen = top.document.getElementById('replace').value.length;
|
||||
|
||||
// If we have something to find
|
||||
if (findLen>0) {
|
||||
// If we have something to find in currrent document
|
||||
if (findLen>0 && document.findAndReplace.target.value=="this document") {
|
||||
cM = ICEcoder.getcMInstance();
|
||||
content = cM.getValue().toLowerCase();
|
||||
content = cM.getValue();
|
||||
|
||||
// Find & replace the next instance?
|
||||
if (document.findAndReplace.connector.value=="and" && cM.getSelection()==find) {
|
||||
cM.replaceSelection(document.getElementById('replace').value);
|
||||
// Find & replace the next instance, or all?
|
||||
if (document.findAndReplace.connector.value=="and") {
|
||||
if (document.findAndReplace.replaceAction.value=="replace" && cM.getSelection()==find) {
|
||||
cM.replaceSelection(document.getElementById('replace').value);
|
||||
}
|
||||
if (document.findAndReplace.replaceAction.value=="replace all" && buttonClick) {
|
||||
var rExp = new RegExp(find,"g");
|
||||
cM.setValue(cM.getValue().replace(rExp,document.getElementById('replace').value));
|
||||
}
|
||||
}
|
||||
|
||||
// Get the content again, as it might of changed
|
||||
content = cM.getValue();
|
||||
if (!top.ICEcoder.findMode||parent.parent.document.getElementById('find').value!=ICEcoder.lastsearch) {
|
||||
ICEcoder.results = [];
|
||||
|
||||
for (var i=0;i<content.length;i++) {
|
||||
if (content.substr(i,findLen)==find) {
|
||||
if (content.substr(i,findLen)==find && i!= ICEcoder.findResult) {
|
||||
ICEcoder.results.push(i);
|
||||
i+=findLen-1;
|
||||
}
|
||||
}
|
||||
|
||||
// Also remember the last search term made
|
||||
ICEcoder.lastsearch = find;
|
||||
}
|
||||
@@ -893,7 +909,7 @@ var ICEcoder = {
|
||||
charsToCursor = numChars+cM.getCursor().ch;
|
||||
ICEcoder.findResult = 0;
|
||||
for (var i=0;i<ICEcoder.results.length;i++) {
|
||||
if (ICEcoder.results[i]<=charsToCursor) {
|
||||
if (ICEcoder.results[i]<charsToCursor) {
|
||||
ICEcoder.findResult++;
|
||||
}
|
||||
}
|
||||
@@ -908,13 +924,17 @@ var ICEcoder = {
|
||||
}
|
||||
}
|
||||
|
||||
charCount = ICEcoder.results[ICEcoder.findResult]-content.lastIndexOf('\n',ICEcoder.results[ICEcoder.findResult])-1;
|
||||
charCount = ICEcoder.results[ICEcoder.findResult];
|
||||
startPos = new Object();
|
||||
startPos.line = lineCount;
|
||||
startPos.ch = charCount;
|
||||
endPos = new Object();
|
||||
endPos.line = lineCount;
|
||||
endPos.ch = charCount+findLen;
|
||||
if (document.findAndReplace.connector.value=="and" && document.findAndReplace.replaceAction.value=="replace all" && buttonClick) {
|
||||
endPos.ch = charCount+replaceLen;
|
||||
} else {
|
||||
endPos.ch = charCount+findLen;
|
||||
}
|
||||
|
||||
// Finally, highlight our selection
|
||||
cM = ICEcoder.getcMInstance();
|
||||
@@ -926,7 +946,14 @@ var ICEcoder = {
|
||||
parent.parent.document.getElementById('results').innerHTML = "No results";
|
||||
}
|
||||
} else {
|
||||
parent.parent.document.getElementById('results').innerHTML = "";
|
||||
// Show the relevant multiple results popup
|
||||
if (find != "" && buttonClick) {
|
||||
replaceQS = "";
|
||||
if (document.findAndReplace.connector.value=="and") {
|
||||
replaceQS = "&replace="+document.getElementById('replace').value;
|
||||
}
|
||||
top.document.getElementById('mediaContainer').innerHTML = '<iframe src="lib/multiple-results.php?find='+find+replaceQS+'" class="whiteGlow" style="width: 700px; height: 500px"></iframe>';
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1090,7 +1117,7 @@ var ICEcoder = {
|
||||
if (action=="add") {
|
||||
|
||||
// Determin if this is a file or folder and based on that, set the CSS styling & link
|
||||
file.indexOf(".")>0 ? actionElemType = "file" : actionElemType = "folder";
|
||||
file.indexOf(".")>-1 ? actionElemType = "file" : actionElemType = "folder";
|
||||
actionElemType=="file" ? cssStyle = "pft-file ext-" + file.substr(file.indexOf(".")+1,file.length) : cssStyle = "pft-directory";
|
||||
actionElemType=="file" ? hrefLink = "nohref" : hrefLink = "href=\"#\"";
|
||||
|
||||
@@ -1262,7 +1289,7 @@ var ICEcoder = {
|
||||
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) {
|
||||
if (action=="open" && ICEcoder.selectedFiles[0].indexOf(".")>-1) {
|
||||
top.ICEcoder.thisFileFolderType='file';
|
||||
top.ICEcoder.openFile();
|
||||
}
|
||||
@@ -1368,13 +1395,18 @@ var ICEcoder = {
|
||||
lastOpenedFiles = "";
|
||||
// Generate a comma seperated list
|
||||
for (var i=0;i<top.ICEcoder.openFiles.length;i++) {
|
||||
if (top.ICEcoder.openFiles[i]!="/[NEW]") {
|
||||
if (top.ICEcoder.openFiles[i]!="" && top.ICEcoder.openFiles[i].indexOf("[NEW]")==-1) {
|
||||
lastOpenedFiles += top.ICEcoder.openFiles[i].replace(/\//g,"|");
|
||||
if (i<top.ICEcoder.openFiles.length-1) {lastOpenedFiles += ","};
|
||||
}
|
||||
}
|
||||
// Then send through to the settings page to update setting
|
||||
top.ICEcoder.serverQueue("add","lib/settings.php?saveFiles="+lastOpenedFiles);
|
||||
if (lastOpenedFiles!="") {
|
||||
// Then send through to the settings page to update setting
|
||||
top.ICEcoder.serverQueue("add","lib/settings.php?saveFiles="+lastOpenedFiles);
|
||||
} else {
|
||||
top.ICEcoder.serverMessage();
|
||||
top.ICEcoder.serverQueue("del",0);
|
||||
}
|
||||
},
|
||||
|
||||
// Opens the last files we had open
|
||||
@@ -1413,6 +1445,14 @@ var ICEcoder = {
|
||||
top.ICEcoder.showHide(vis,top.document.getElementById('blackMask'));
|
||||
},
|
||||
|
||||
// Show the help screen
|
||||
helpScreen: function(vis) {
|
||||
if (vis=="show") {
|
||||
top.document.getElementById('mediaContainer').innerHTML = '<iframe src="lib/help.php" class="whiteGlow" style="width: 400px; height: 400px"></iframe>';
|
||||
}
|
||||
top.ICEcoder.showHide(vis,top.document.getElementById('blackMask'));
|
||||
},
|
||||
|
||||
// Update the settings used when we make a change to them
|
||||
useNewSettings: function(themeURL,tabsIndent,codeAssist,lockedNav,visibleTabs,refreshFM) {
|
||||
var styleNode, strCSS, cMCSS;
|
||||
@@ -1447,5 +1487,11 @@ var ICEcoder = {
|
||||
|
||||
// Finally, refresh the file manager if we need to
|
||||
if (refreshFM) {top.ICEcoder.refreshFileManager()};
|
||||
},
|
||||
|
||||
// Update and show/hide found results display?
|
||||
updateResultsDisplay: function(showHide) {
|
||||
ICEcoder.findReplace('find',true,false);
|
||||
document.getElementById('results').style.display = showHide == "show" ? 'inline-block' : 'none';
|
||||
}
|
||||
};
|
||||
@@ -138,21 +138,28 @@ if ($_GET['action']=="save") {
|
||||
$saveFile = str_replace("\\","/",$_SERVER['DOCUMENT_ROOT']).$file;
|
||||
$saveFile = str_replace("//","/",$saveFile);
|
||||
if ((file_exists($saveFile) && is_writable($saveFile)) || $_POST['newFileName']!="") {
|
||||
$fh = fopen($saveFile, 'w') or die("can't open file");
|
||||
fwrite($fh, $_POST['contents']);
|
||||
fclose($fh);
|
||||
if (filemtime($saveFile)==$_GET['fileMDT']||!(isset($_GET['fileMDT']))) {
|
||||
$fh = fopen($saveFile, 'w') or die("Sorry, cannot save");
|
||||
fwrite($fh, $_POST['contents']);
|
||||
fclose($fh);
|
||||
clearstatcache();
|
||||
echo '<script>top.ICEcoder.openFileMDTs[top.ICEcoder.selectedTab-1]="'.filemtime($saveFile).'";</script>';
|
||||
|
||||
if (isset($_POST['newFileName'])&&$_POST['newFileName']!="") {
|
||||
// Reload file manager & stop CTRL+s being sticky
|
||||
$fileName = substr($file,strrpos($file,"/")+1);
|
||||
$fileLoc = substr($file,0,strrpos($file,"/"));
|
||||
if ($fileLoc=="") {$fileLoc = "/";};
|
||||
echo '<script>top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'add\',\''.$fileLoc.'\',\''.$fileName.'\')</script>';
|
||||
if (isset($_POST['newFileName'])&&$_POST['newFileName']!="") {
|
||||
// Reload file manager & stop CTRL+s being sticky
|
||||
$fileName = substr($file,strrpos($file,"/")+1);
|
||||
$fileLoc = substr($file,0,strrpos($file,"/"));
|
||||
if ($fileLoc=="") {$fileLoc = "/";};
|
||||
echo '<script>top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'add\',\''.$fileLoc.'\',\''.$fileName.'\')</script>';
|
||||
}
|
||||
if (isset($_POST['newFileName'])&&$_POST['newFileName']!="") {
|
||||
echo '<script>top.ICEcoder.renameTab(top.ICEcoder.selectedTab,\''.$file.'\');</script>';
|
||||
}
|
||||
echo '<script>top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);if (top.ICEcoder.stickyTabWindow.location) {top.ICEcoder.stickyTabWindow.location.reload()};action="doneSave";</script>';
|
||||
} else {
|
||||
echo "<script>alert('Sorry, this file has changed, cannot save\\n".$file."');</script>";
|
||||
echo '<script>top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);action="nothing";</script>';
|
||||
}
|
||||
if (isset($_POST['newFileName'])&&$_POST['newFileName']!="") {
|
||||
echo '<script>top.ICEcoder.renameTab(top.ICEcoder.selectedTab,\''.$file.'\');</script>';
|
||||
}
|
||||
echo '<script>top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);if (top.ICEcoder.stickyTabWindow.location) {top.ICEcoder.stickyTabWindow.location.reload()};action="doneSave";</script>';
|
||||
} else {
|
||||
echo "<script>alert('Sorry, cannot write\\n".$file."');</script>";
|
||||
echo '<script>top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);action="nothing";</script>';
|
||||
@@ -193,6 +200,7 @@ if (action=="load") {
|
||||
top.ICEcoder.content.contentWindow['cM'+top.ICEcoder.cMInstances[top.ICEcoder.selectedTab-1]].setLineClass(top.ICEcoder['cMActiveLine'+top.ICEcoder.selectedTab], null);
|
||||
top.ICEcoder['cMActiveLine'+top.ICEcoder.selectedTab] = top.ICEcoder.content.contentWindow['cM'+top.ICEcoder.cMInstances[top.ICEcoder.selectedTab-1]].setLineClass(0, "cm-s-activeLine");
|
||||
top.ICEcoder.nextcMInstance++;
|
||||
top.ICEcoder.openFileMDTs.push('<?php echo filemtime($file); ?>');
|
||||
top.ICEcoder.loadingFile = false;
|
||||
}
|
||||
|
||||
@@ -206,7 +214,7 @@ if (action=="load") {
|
||||
}
|
||||
</script>
|
||||
|
||||
<form name="saveFile" action="file-control.php?action=save&file=<?php if (isset($file)) {echo $file;};?>" method="POST">
|
||||
<form name="saveFile" action="file-control.php?action=save&file=<?php if (isset($file)) {echo $file;}; if (isset($_GET['fileMDT']) && $_GET['fileMDT']!="undefined") {echo "&fileMDT=".$_GET['fileMDT'];};?>" method="POST">
|
||||
<textarea name="contents"></textarea>
|
||||
<input type="hidden" name="newFileName" value="">
|
||||
</form>
|
||||
|
||||
@@ -30,7 +30,7 @@ body {margin: 0px; overflow: auto}
|
||||
}
|
||||
|
||||
.fileManager span {font-family: helvetica, arial, swiss, verdana;}
|
||||
.fileManager a {color: #000000; text-decoration: none;}
|
||||
.fileManager a {color: #eeeeee; text-decoration: none;}
|
||||
.fileManager .open {font-style: italic;}
|
||||
.fileManager .closed {font-style: normal;}
|
||||
.fileManager .pft-directory {list-style-image: url(../images/file-manager-icons/directory.png);}
|
||||
@@ -40,61 +40,24 @@ body {margin: 0px; overflow: auto}
|
||||
.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); }
|
||||
.fileManager LI.ext-afp { list-style-image: url(../images/file-manager-icons/code.png); }
|
||||
.fileManager LI.ext-afpa { list-style-image: url(../images/file-manager-icons/code.png); }
|
||||
.fileManager LI.ext-asp { list-style-image: url(../images/file-manager-icons/code.png); }
|
||||
.fileManager LI.ext-aspx { list-style-image: url(../images/file-manager-icons/code.png); }
|
||||
.fileManager LI.ext-avi { list-style-image: url(../images/file-manager-icons/film.png); }
|
||||
.fileManager LI.ext-bat { list-style-image: url(../images/file-manager-icons/application.png); }
|
||||
.fileManager LI.ext-bmp { list-style-image: url(../images/file-manager-icons/picture.png); }
|
||||
.fileManager LI.ext-c { list-style-image: url(../images/file-manager-icons/code.png); }
|
||||
.fileManager LI.ext-cfm { list-style-image: url(../images/file-manager-icons/code.png); }
|
||||
.fileManager LI.ext-cgi { list-style-image: url(../images/file-manager-icons/code.png); }
|
||||
.fileManager LI.ext-com { list-style-image: url(../images/file-manager-icons/application.png); }
|
||||
.fileManager LI.ext-cpp { list-style-image: url(../images/file-manager-icons/code.png); }
|
||||
.fileManager LI.ext-css { list-style-image: url(../images/file-manager-icons/css.png); }
|
||||
.fileManager LI.ext-doc { list-style-image: url(../images/file-manager-icons/doc.png); }
|
||||
.fileManager LI.ext-exe { list-style-image: url(../images/file-manager-icons/application.png); }
|
||||
.fileManager LI.ext-gif { list-style-image: url(../images/file-manager-icons/picture.png); }
|
||||
.fileManager LI.ext-fla { list-style-image: url(../images/file-manager-icons/flash.png); }
|
||||
.fileManager LI.ext-h { list-style-image: url(../images/file-manager-icons/code.png); }
|
||||
.fileManager LI.ext-gif { list-style-image: url(../images/file-manager-icons/gif.png); }
|
||||
.fileManager LI.ext-htm { list-style-image: url(../images/file-manager-icons/html.png); }
|
||||
.fileManager LI.ext-html { list-style-image: url(../images/file-manager-icons/html.png); }
|
||||
.fileManager LI.ext-jar { list-style-image: url(../images/file-manager-icons/java.png); }
|
||||
.fileManager LI.ext-jpg { list-style-image: url(../images/file-manager-icons/picture.png); }
|
||||
.fileManager LI.ext-jpeg { list-style-image: url(../images/file-manager-icons/picture.png); }
|
||||
.fileManager LI.ext-js { list-style-image: url(../images/file-manager-icons/script.png); }
|
||||
.fileManager LI.ext-lasso { list-style-image: url(../images/file-manager-icons/code.png); }
|
||||
.fileManager LI.ext-log { list-style-image: url(../images/file-manager-icons/txt.png); }
|
||||
.fileManager LI.ext-m4p { list-style-image: url(../images/file-manager-icons/music.png); }
|
||||
.fileManager LI.ext-mov { list-style-image: url(../images/file-manager-icons/film.png); }
|
||||
.fileManager LI.ext-mp3 { list-style-image: url(../images/file-manager-icons/music.png); }
|
||||
.fileManager LI.ext-mp4 { list-style-image: url(../images/file-manager-icons/film.png); }
|
||||
.fileManager LI.ext-mpg { list-style-image: url(../images/file-manager-icons/film.png); }
|
||||
.fileManager LI.ext-mpeg { list-style-image: url(../images/file-manager-icons/film.png); }
|
||||
.fileManager LI.ext-ogg { list-style-image: url(../images/file-manager-icons/music.png); }
|
||||
.fileManager LI.ext-pcx { list-style-image: url(../images/file-manager-icons/picture.png); }
|
||||
.fileManager LI.ext-pdf { list-style-image: url(../images/file-manager-icons/pdf.png); }
|
||||
.fileManager LI.ext-jpg { list-style-image: url(../images/file-manager-icons/jpg.png); }
|
||||
.fileManager LI.ext-jpeg { list-style-image: url(../images/file-manager-icons/jpg.png); }
|
||||
.fileManager LI.ext-js { list-style-image: url(../images/file-manager-icons/js.png); }
|
||||
/*.fileManager LI.ext-pdf { list-style-image: url(../images/file-manager-icons/pdf.png); } */
|
||||
.fileManager LI.ext-php { list-style-image: url(../images/file-manager-icons/php.png); }
|
||||
.fileManager LI.ext-png { list-style-image: url(../images/file-manager-icons/picture.png); }
|
||||
.fileManager LI.ext-ppt { list-style-image: url(../images/file-manager-icons/ppt.png); }
|
||||
.fileManager LI.ext-psd { list-style-image: url(../images/file-manager-icons/psd.png); }
|
||||
.fileManager LI.ext-pl { list-style-image: url(../images/file-manager-icons/script.png); }
|
||||
.fileManager LI.ext-py { list-style-image: url(../images/file-manager-icons/script.png); }
|
||||
.fileManager LI.ext-png { list-style-image: url(../images/file-manager-icons/png.png); }
|
||||
.fileManager LI.ext-rb { list-style-image: url(../images/file-manager-icons/ruby.png); }
|
||||
.fileManager LI.ext-rbx { list-style-image: url(../images/file-manager-icons/ruby.png); }
|
||||
.fileManager LI.ext-rhtml { list-style-image: url(../images/file-manager-icons/ruby.png); }
|
||||
.fileManager LI.ext-rpm { list-style-image: url(../images/file-manager-icons/linux.png); }
|
||||
.fileManager LI.ext-ruby { list-style-image: url(../images/file-manager-icons/ruby.png); }
|
||||
.fileManager LI.ext-sql { list-style-image: url(../images/file-manager-icons/db.png); }
|
||||
.fileManager LI.ext-swf { list-style-image: url(../images/file-manager-icons/flash.png); }
|
||||
.fileManager LI.ext-tif { list-style-image: url(../images/file-manager-icons/picture.png); }
|
||||
.fileManager LI.ext-tiff { list-style-image: url(../images/file-manager-icons/picture.png); }
|
||||
/*.fileManager LI.ext-sql { list-style-image: url(../images/file-manager-icons/sql.png); } */
|
||||
/*.fileManager LI.ext-swf { list-style-image: url(../images/file-manager-icons/swf.png); } */
|
||||
.fileManager LI.ext-txt { list-style-image: url(../images/file-manager-icons/txt.png); }
|
||||
.fileManager LI.ext-vb { list-style-image: url(../images/file-manager-icons/code.png); }
|
||||
.fileManager LI.ext-wav { list-style-image: url(../images/file-manager-icons/music.png); }
|
||||
.fileManager LI.ext-wmv { list-style-image: url(../images/file-manager-icons/film.png); }
|
||||
.fileManager LI.ext-xls { list-style-image: url(../images/file-manager-icons/xls.png); }
|
||||
.fileManager LI.ext-xml { list-style-image: url(../images/file-manager-icons/code.png); }
|
||||
.fileManager LI.ext-zip { list-style-image: url(../images/file-manager-icons/zip.png); }
|
||||
/*.fileManager LI.ext-xls { list-style-image: url(../images/file-manager-icons/xls.png); } */
|
||||
/*.fileManager LI.ext-xml { list-style-image: url(../images/file-manager-icons/xml.png); } */
|
||||
/*.fileManager LI.ext-zip { list-style-image: url(../images/file-manager-icons/zip.png); } */
|
||||
31
lib/help.css
Normal file
@@ -0,0 +1,31 @@
|
||||
/* 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, label, legend,
|
||||
table, caption, tbody, tfoot, thead, tr, th, td {
|
||||
border: 0px;
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
outline: 0px;
|
||||
font-size: 12px;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
body {overflow: hidden;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-o-user-select:none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
h1 {font-size: 36px; font-weight: normal; color: #888888; margin-bottom: 20px}
|
||||
|
||||
.help {font-family: arial, verdana, helvetica, sans-serif; background-color: #1c1c19; color: #ffffff; padding: 20px}
|
||||
.help .key {display: inline-block; width: 175px; text-align: right; margin-right: 5px; float: left}
|
||||
.help .key .plus {color: #888888}
|
||||
.help .shortcut {display: inline-block; width: 175px; color: #888888; margin-left: 5px; float: left}
|
||||
38
lib/help.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php include("settings.php");?>
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>ICE Coder - <?php echo $versionNo;?> :: Help & Shortcuts</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<link rel="stylesheet" type="text/css" href="help.css">
|
||||
</head>
|
||||
|
||||
<body class="help">
|
||||
|
||||
<h1 id="title">help</h1>
|
||||
|
||||
<h2>In file manager</h2>
|
||||
<span class="key">Delete</span> <span class="shortcut">Delete file</span><br><br>
|
||||
|
||||
<h2>Within document</h2>
|
||||
<span class="key">CTRL <span class="plus">+</span> I</span> <span class="shortcut">Search selected text</span><br>
|
||||
<span class="key">Esc</span> <span class="shortcut">Comment / uncomment text</span><br>
|
||||
<span class="key">Tab</span> <span class="shortcut">Insert tab / indent selected text</span><br><br>
|
||||
|
||||
<h2>Anywhere</h2>
|
||||
<span class="key">CTRL <span class="plus">+</span> F</span> <span class="shortcut">Find</span><br>
|
||||
<span class="key">CTRL <span class="plus">+</span> G</span> <span class="shortcut">Go to line</span><br>
|
||||
<span class="key">CTRL <span class="plus">+</span> S</span> <span class="shortcut">Save</span><br>
|
||||
<span class="key">CTRL <span class="plus">+</span> Shift <span class="plus">+</span> S</span> <span class="shortcut">Save as...</span><br>
|
||||
<span class="key">CTRL <span class="plus">+</span> Enter</span> <span class="shortcut">View webpage</span><br>
|
||||
<span class="key">CTRL <span class="plus">+</span> S <span class="plus">+</span> Enter</span> <span class="shortcut">Save & create sticky tab</span><br>
|
||||
<span class="key">Esc</span> <span class="shortcut">Cancel tasks</span><br><br>
|
||||
|
||||
<h2>Clicking logo</h2>
|
||||
<span class="key">Left click</span> <span class="shortcut">Help</span><br>
|
||||
<span class="key">Right click</span> <span class="shortcut">Settings</span><br>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
35
lib/multiple-results.css
Normal file
@@ -0,0 +1,35 @@
|
||||
/* 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, label, legend,
|
||||
table, caption, tbody, tfoot, thead, tr, th, td {
|
||||
border: 0px;
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
outline: 0px;
|
||||
font-size: 12px;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
body {overflow: hidden;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-o-user-select:none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
h1 {font-size: 36px; font-weight: normal; color: #888888; margin-bottom: 20px}
|
||||
h2 {font-size: 18px; font-weight: normal; color: #ffffff}
|
||||
hr {border: 0; height: 1px; background-color: #888888}
|
||||
|
||||
.results {font-family: arial, verdana, helvetica, sans-serif; background-color: #1c1c19; color: #ffffff}
|
||||
.results .resultsPane {position: relative; width: 660px; height: 560px; font-size: 10px; padding: 20px; float: left}
|
||||
.results .resultsPane a {color: rgba(0,198,255,0.7); text-decoration: none}
|
||||
.results .resultsPane a:hover {text-decoration: underline}
|
||||
.replace {position: absolute; margin-top: -28px; right: 20px; padding: 5px 10px; font-size: 14px; background-color: rgba(0,198,255,0.7); cursor: pointer}
|
||||
.replaceAll {position: absolute; bottom: 0px; right: 20px; padding: 5px 10px; font-size: 18px; background-color: rgba(0,198,255,0.7); cursor: pointer}
|
||||
75
lib/multiple-results.php
Normal file
@@ -0,0 +1,75 @@
|
||||
<?php include("settings.php");?>
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>ICE Coder - <?php echo $versionNo;?> :: Multiple Results Screen</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<link rel="stylesheet" type="text/css" href="multiple-results.css">
|
||||
</head>
|
||||
|
||||
<body class="results">
|
||||
|
||||
<div class="resultsPane">
|
||||
<h1 id="title"></h1>
|
||||
<div id="results"></div>
|
||||
</div>
|
||||
<?php if (isset($_GET['replace'])) { ?>
|
||||
<div class="replaceAll" id="replaceAll" onClick="replaceAll()" style="opacity: 0.1">replace all</div>
|
||||
<?php ;}; ?>
|
||||
|
||||
<script>
|
||||
var resultsDisplay = "";
|
||||
var foundTabArray = [];
|
||||
var startTab = top.ICEcoder.selectedTab;
|
||||
var rExp = new RegExp("<?php echo $_GET['find']; ?>","g");
|
||||
for (var i=1;i<=top.ICEcoder.openFiles.length;i++) {
|
||||
top.ICEcoder.switchTab(i);
|
||||
var cM = top.ICEcoder.getcMInstance();
|
||||
var content = cM.getValue();
|
||||
if (content.match(rExp)) {
|
||||
resultsDisplay += '<a href="javascript:gotoTab('+i+')">'+ top.ICEcoder.openFiles[i-1]+ '</a><br><div id="foundCount'+i+'">Found '+content.match(rExp).length+' times</div>';
|
||||
<?php if (isset($_GET['replace'])) { ?>
|
||||
resultsDisplay += '<div class="replace" id="replace" onClick="replaceSingle('+i+');this.style.display=\'none\'">replace</div>';
|
||||
<?php ;}; ?>
|
||||
resultsDisplay += '<hr>';
|
||||
foundTabArray.push(i);
|
||||
}
|
||||
}
|
||||
if (startTab!=top.ICEcoder.selectedTab) {
|
||||
top.ICEcoder.switchTab(startTab);
|
||||
}
|
||||
foundTabArray.length==0 ? showHide = "hide" : showHide = "show";
|
||||
top.ICEcoder.showHide(showHide,top.document.getElementById('blackMask'));
|
||||
if (foundTabArray.length==0) {alert('No matches found')};
|
||||
<?php if (isset($_GET['replace'])) { ?>
|
||||
if (foundTabArray.length!=0) {document.getElementById('replaceAll').style.opacity = 1};
|
||||
<?php ;}; ?>
|
||||
foundTabArray.length >= 2 ? plural = "s" : plural = "";
|
||||
document.getElementById('title').innerHTML = "'<?php echo $_GET['find']; ?>' found in "+foundTabArray.length+" file"+plural;
|
||||
document.getElementById('results').innerHTML = resultsDisplay;
|
||||
|
||||
var gotoTab = function(tab) {
|
||||
top.ICEcoder.switchTab(tab);
|
||||
top.ICEcoder.showHide('hide',top.document.getElementById('blackMask'));
|
||||
}
|
||||
|
||||
var replaceSingle = function(tab) {
|
||||
top.ICEcoder.switchTab(tab);
|
||||
cM = top.ICEcoder.getcMInstance();
|
||||
content = cM.getValue();
|
||||
cM.setValue(cM.getValue().replace(rExp,top.document.getElementById('replace').value));
|
||||
document.getElementById('foundCount'+tab).innerHTML = document.getElementById('foundCount'+tab).innerHTML.replace('Found','Replaced');
|
||||
}
|
||||
|
||||
var replaceAll = function() {
|
||||
for (var i=0;i<=foundTabArray.length-1;i++) {
|
||||
replaceSingle(foundTabArray[i]);
|
||||
}
|
||||
top.ICEcoder.showHide('hide',top.document.getElementById('blackMask'));
|
||||
}
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -16,7 +16,7 @@ function generateHash($plainText,$salt=null) {
|
||||
// Start of settings
|
||||
// -----------------
|
||||
|
||||
$versionNo = "v 0.6.5";
|
||||
$versionNo = "v 0.6.7";
|
||||
$codeMirrorDir = "CodeMirror-2.24";
|
||||
$cMThisVer = 2.24;
|
||||
$tabsIndent = true;
|
||||
@@ -26,8 +26,8 @@ $codeAssist = true;
|
||||
$visibleTabs = false;
|
||||
$lockedNav = true;
|
||||
$accountPassword = "";
|
||||
$restrictedFiles = array("wp-",".php",".asp",".aspx");
|
||||
$bannedFiles = array("_coder","wp-",".exe",".sql");
|
||||
$restrictedFiles = array("wp-",".php",".rb",".sql");
|
||||
$bannedFiles = array("_coder","wp-",".exe");
|
||||
$allowedIPs = array("*");
|
||||
$plugins = array(
|
||||
array("Database Admin","images/database.png","margin-top: 3px","plugins/adminer/adminer-3.3.3-mysql-en.php","_blank",""),
|
||||
@@ -43,7 +43,7 @@ $lastOpenedFiles = "";
|
||||
|
||||
|
||||
// Update this settings file?
|
||||
if ($_POST["theme"] && $_SESSION['userLevel'] == 10) {
|
||||
if (isset($_POST["theme"]) && $_POST["theme"] && $_SESSION['userLevel'] == 10) {
|
||||
$settingsFile = 'settings.php';
|
||||
$settingsContents = file_get_contents($settingsFile);
|
||||
// Replace our lastOpenedFiles var with the the current
|
||||
@@ -97,7 +97,7 @@ if ($_POST["theme"] && $_SESSION['userLevel'] == 10) {
|
||||
}
|
||||
|
||||
// Save the currently opened files for next time
|
||||
if ($_GET['saveFiles']) {
|
||||
if (isset($_GET["saveFiles"]) && $_GET['saveFiles']) {
|
||||
if ($_SESSION['userLevel'] == 10) {
|
||||
$settingsFile = 'settings.php';
|
||||
$settingsContents = file_get_contents($settingsFile);
|
||||
@@ -110,7 +110,7 @@ if ($_GET['saveFiles']) {
|
||||
fwrite($fh, $settingsContents);
|
||||
fclose($fh);
|
||||
}
|
||||
echo '<script>top.ICEcoder.serverQueue("del",0);</script>';
|
||||
echo '<script>top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);</script>';
|
||||
}
|
||||
|
||||
// Establish our user level
|
||||
@@ -144,9 +144,9 @@ if ($shortURLStarts[count($shortURLStarts)-1]!="") {$trimArray=1;} else {$trimAr
|
||||
$shortURLStarts = $shortURLStarts[count($shortURLStarts)-$trimArray];
|
||||
|
||||
// If we're updating or calling from the index.php page, do/redo plugins & last opened files
|
||||
if (($_POST["theme"] && $_SESSION['userLevel'] == 10) || strpos($_SERVER['PHP_SELF'],"index.php")>0) {
|
||||
if ((isset($_POST["theme"]) && $_POST["theme"] && $_SESSION['userLevel'] == 10) || strpos($_SERVER['PHP_SELF'],"index.php")>0) {
|
||||
// If we're updating, we need to recreate the plugins array
|
||||
if ($_POST["theme"] && $_SESSION['userLevel'] == 10) {
|
||||
if (isset($_POST["theme"]) && $_POST["theme"] && $_SESSION['userLevel'] == 10) {
|
||||
$plugins = array();
|
||||
$pluginsArray = explode("====================",str_replace("\"","",str_replace("\r","",str_replace("\n","",$_POST['plugins']))));
|
||||
for ($i=0;$i<count($pluginsArray);$i++) {
|
||||
@@ -162,7 +162,7 @@ if (($_POST["theme"] && $_SESSION['userLevel'] == 10) || strpos($_SERVER['PHP_SE
|
||||
};
|
||||
|
||||
// If we're updating, replace the plugin display with our newly established one
|
||||
if ($_POST["theme"] && $_SESSION['userLevel'] == 10) {
|
||||
if (isset($_POST["theme"]) && $_POST["theme"] && $_SESSION['userLevel'] == 10) {
|
||||
echo "<script>top.document.getElementById('pluginsContainer').innerHTML = '".$pluginsDisplay."';</script>";
|
||||
}
|
||||
|
||||
@@ -175,7 +175,7 @@ if (($_POST["theme"] && $_SESSION['userLevel'] == 10) || strpos($_SERVER['PHP_SE
|
||||
};
|
||||
|
||||
// If we're updating our settings, clear existing setIntervals & the array refs, then start new ones
|
||||
if ($_POST["theme"] && $_SESSION['userLevel'] == 10) {
|
||||
if (isset($_POST["theme"]) && $_POST["theme"] && $_SESSION['userLevel'] == 10) {
|
||||
?>
|
||||
<script>
|
||||
for (i=0;i<=top.ICEcoder.pluginIntervalRefs.length-1;i++) {
|
||||
@@ -204,7 +204,7 @@ if ($accountPassword == "" && isset($_GET['settings'])) {
|
||||
<link rel="stylesheet" type="text/css" href="coder.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<body style="background-color: #ffffff">
|
||||
|
||||
<div class="screenContainer">
|
||||
<div class="screenVCenter">
|
||||
@@ -224,7 +224,7 @@ if ($accountPassword == "" && isset($_GET['settings'])) {
|
||||
</html>
|
||||
<?php
|
||||
} else {
|
||||
// If the password hasn't been set, set it, but only if we're including
|
||||
// If the password hasn't been set, set it, but only if we're including
|
||||
// from the index.php file (as this file is included from multiple places)
|
||||
if ($accountPassword == "" && strpos($_SERVER['PHP_SELF'],"index.php")>0) {
|
||||
// If we're setting a password
|
||||
|
||||
@@ -74,9 +74,14 @@ Class zipIt {
|
||||
// Trigger the class
|
||||
$zipItDoZip = new zipIt();
|
||||
$zipItAddToZip = $zipItDoZip->zipFilesUp($zipItSaveLocation.$zipItFileName);
|
||||
if ($zipItAddToZip) {echo '<script>top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);</script>';};
|
||||
if (!$zipItAddToZip) {echo '<script>alert("Could not zip files up!");</script>';};
|
||||
;};
|
||||
?>
|
||||
|
||||
<script>
|
||||
top.ICEcoder.serverMessage();
|
||||
top.ICEcoder.serverQueue("del",0);
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||