mirror of
https://github.com/icecoder/ICEcoder.git
synced 2026-03-23 00:37:14 +01:00
Compare commits
66 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a21772f3c2 | ||
|
|
cbd930a340 | ||
|
|
9f129c9781 | ||
|
|
18931e94b0 | ||
|
|
1520828dff | ||
|
|
43223d1677 | ||
|
|
3fb9836fc8 | ||
|
|
8cd5a10ea8 | ||
|
|
da1850896b | ||
|
|
336ef01dee | ||
|
|
246bf189b5 | ||
|
|
825effadd9 | ||
|
|
51f53855f8 | ||
|
|
65fa29fbb8 | ||
|
|
5bcfa06e19 | ||
|
|
b01218958f | ||
|
|
7887f0e7a1 | ||
|
|
f522502938 | ||
|
|
c7f533cf0a | ||
|
|
a3107de33e | ||
|
|
e69a3249e5 | ||
|
|
f3c24f05e0 | ||
|
|
20364bb1d7 | ||
|
|
3d1c92dae4 | ||
|
|
4048895c6b | ||
|
|
991908bd8d | ||
|
|
8ff559dbef | ||
|
|
d7d483ef9c | ||
|
|
b11064e3a8 | ||
|
|
409d35b29b | ||
|
|
811cf40cd7 | ||
|
|
3aa9d23ac6 | ||
|
|
9c8bb08454 | ||
|
|
2c28af0dd7 | ||
|
|
cc6bd40b15 | ||
|
|
5221ba0959 | ||
|
|
61f132327d | ||
|
|
826730e88b | ||
|
|
5cdb08c35f | ||
|
|
9806d3705a | ||
|
|
55e6e66df6 | ||
|
|
0d38b23a60 | ||
|
|
07fd0ab6bf | ||
|
|
6036b0635d | ||
|
|
74f678076a | ||
|
|
ef157d71f2 | ||
|
|
0b718e0fbf | ||
|
|
809af86c16 | ||
|
|
449e8e2c4a | ||
|
|
01c8a10463 | ||
|
|
27da7ed0fe | ||
|
|
685116c555 | ||
|
|
0c4741c793 | ||
|
|
4da7024f91 | ||
|
|
b49a2cc52d | ||
|
|
c0fe50cd2f | ||
|
|
497efaabf0 | ||
|
|
2ee777739f | ||
|
|
deb3ad5359 | ||
|
|
3f1801ef2b | ||
|
|
ca8e92e443 | ||
|
|
c514e4a1ad | ||
|
|
ec28de40c9 | ||
|
|
14053fbfdd | ||
|
|
464030808c | ||
|
|
d2377bff34 |
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
error-log.txt
|
||||||
|
backups/*.zip
|
||||||
File diff suppressed because one or more lines are too long
@@ -1,4 +1,4 @@
|
|||||||
Copyright (C) 2012 by Marijn Haverbeke <marijnh@gmail.com>
|
Copyright (C) 2013 by Marijn Haverbeke <marijnh@gmail.com>
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
16
CodeMirror-3.01/addon/hint/simple-hint.css
Normal file
16
CodeMirror-3.01/addon/hint/simple-hint.css
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
.CodeMirror-completions {
|
||||||
|
position: absolute;
|
||||||
|
z-index: 10;
|
||||||
|
overflow: hidden;
|
||||||
|
-webkit-box-shadow: 2px 3px 5px rgba(0,0,0,.2);
|
||||||
|
-moz-box-shadow: 2px 3px 5px rgba(0,0,0,.2);
|
||||||
|
box-shadow: 2px 3px 5px rgba(0,0,0,.2);
|
||||||
|
}
|
||||||
|
.CodeMirror-completions select {
|
||||||
|
background: #fafafa;
|
||||||
|
outline: none;
|
||||||
|
border: none;
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
font-family: monospace;
|
||||||
|
}
|
||||||
6
CodeMirror-3.01/lib/codemirror-compressed.js
Normal file
6
CodeMirror-3.01/lib/codemirror-compressed.js
Normal file
File diff suppressed because one or more lines are too long
@@ -39,14 +39,14 @@
|
|||||||
|
|
||||||
/* CURSOR */
|
/* CURSOR */
|
||||||
|
|
||||||
.CodeMirror pre.CodeMirror-cursor {
|
.CodeMirror div.CodeMirror-cursor {
|
||||||
border-left: 1px solid black;
|
border-left: 1px solid black;
|
||||||
}
|
}
|
||||||
/* Shown when moving in bi-directional text */
|
/* Shown when moving in bi-directional text */
|
||||||
.CodeMirror pre.CodeMirror-secondarycursor {
|
.CodeMirror div.CodeMirror-secondarycursor {
|
||||||
border-left: 1px solid silver;
|
border-left: 1px solid silver;
|
||||||
}
|
}
|
||||||
.cm-keymap-fat-cursor pre.CodeMirror-cursor {
|
.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor {
|
||||||
width: auto;
|
width: auto;
|
||||||
border: 0;
|
border: 0;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
@@ -54,11 +54,11 @@
|
|||||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#6600c800, endColorstr=#4c00c800);
|
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#6600c800, endColorstr=#4c00c800);
|
||||||
}
|
}
|
||||||
/* Kludge to turn off filter in ie9+, which also accepts rgba */
|
/* Kludge to turn off filter in ie9+, which also accepts rgba */
|
||||||
.cm-keymap-fat-cursor pre.CodeMirror-cursor:not(#nonsense_id) {
|
.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor:not(#nonsense_id) {
|
||||||
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
|
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
|
||||||
}
|
}
|
||||||
/* Can style cursor different in overwrite (non-insert) mode */
|
/* Can style cursor different in overwrite (non-insert) mode */
|
||||||
.CodeMirror pre.CodeMirror-cursor.CodeMirror-overwrite {}
|
.CodeMirror div.CodeMirror-cursor.CodeMirror-overwrite {}
|
||||||
|
|
||||||
/* DEFAULT THEME */
|
/* DEFAULT THEME */
|
||||||
|
|
||||||
@@ -196,6 +196,7 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
|
|||||||
.CodeMirror-linewidget {
|
.CodeMirror-linewidget {
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
|
overflow: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror-wrap .CodeMirror-scroll {
|
.CodeMirror-wrap .CodeMirror-scroll {
|
||||||
@@ -210,20 +211,20 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
|
|||||||
}
|
}
|
||||||
.CodeMirror-measure pre { position: static; }
|
.CodeMirror-measure pre { position: static; }
|
||||||
|
|
||||||
.CodeMirror pre.CodeMirror-cursor {
|
.CodeMirror div.CodeMirror-cursor {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
border-right: none;
|
border-right: none;
|
||||||
width: 0;
|
width: 0;
|
||||||
}
|
}
|
||||||
.CodeMirror-focused pre.CodeMirror-cursor {
|
.CodeMirror-focused div.CodeMirror-cursor {
|
||||||
visibility: visible;
|
visibility: visible;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror-selected { background: #d9d9d9; }
|
.CodeMirror-selected { background: #d9d9d9; }
|
||||||
.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }
|
.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }
|
||||||
|
|
||||||
.CodeMirror-searching {
|
.cm-searching {
|
||||||
background: #ffa;
|
background: #ffa;
|
||||||
background: rgba(255, 255, 0, .4);
|
background: rgba(255, 255, 0, .4);
|
||||||
}
|
}
|
||||||
@@ -233,7 +234,7 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
|
|||||||
|
|
||||||
@media print {
|
@media print {
|
||||||
/* Hide the cursor when printing */
|
/* Hide the cursor when printing */
|
||||||
.CodeMirror pre.CodeMirror-cursor {
|
.CodeMirror div.CodeMirror-cursor {
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
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. Uses the brilliant CodeMirror for code highlighting & editing, with a slick IDE wrapped around it to make the whole thing work.
|
||||||
|
|
||||||
<img src="http://icecoder.net/images/icecoder-v1pt4-web-ide.jpg" alt="ICEcoder web IDE">
|
<img src="http://icecoder.net/images/icecoder-v1pt6-web-ide.jpg" alt="ICEcoder web IDE">
|
||||||
|
|
||||||
###Features you'd expect
|
###Features you'd expect
|
||||||
* Context aware code highlighting
|
* Context aware code highlighting
|
||||||
@@ -41,6 +41,8 @@ Early version of the web based IDE which allows for creation of websites in the
|
|||||||
* Shell terminal
|
* Shell terminal
|
||||||
* JS Hint validation as you type
|
* JS Hint validation as you type
|
||||||
* Emmet snippet typing booster
|
* Emmet snippet typing booster
|
||||||
|
* JavaScript code hinting
|
||||||
|
* Alphanumeric tab sorting
|
||||||
|
|
||||||
###Installation
|
###Installation
|
||||||
|
|
||||||
|
|||||||
0
backups/.gitkeep
Normal file
0
backups/.gitkeep
Normal file
@@ -1 +0,0 @@
|
|||||||
Zip It! backups are stored in this folder
|
|
||||||
15
editor.php
15
editor.php
@@ -1,17 +1,18 @@
|
|||||||
<?php include("lib/settings.php");?>
|
<?php include("lib/settings.php");?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
|
|
||||||
<html style="margin: 0" onMouseDown="top.ICEcoder.mouseDown=true" onMouseUp="top.ICEcoder.mouseDown=false" onMouseMove="if(top.ICEcoder) {top.ICEcoder.getMouseXY(event,'editor');top.ICEcoder.canResizeFilesW()}">
|
<html style="margin: 0" onMouseDown="top.ICEcoder.mouseDown=true" onMouseUp="top.ICEcoder.mouseDown=false; top.ICEcoder.tabDragEnd()" onMouseMove="if(top.ICEcoder) {top.ICEcoder.getMouseXY(event,'editor');top.ICEcoder.canResizeFilesW()}">
|
||||||
<head>
|
<head>
|
||||||
<title>ICEcoder v <?php echo $ICEcoder["versionNo"];?> editor</title>
|
<title>ICEcoder v <?php echo $ICEcoder["versionNo"];?> editor</title>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<meta name="robots" content="noindex, nofollow">
|
<meta name="robots" content="noindex, nofollow">
|
||||||
<link rel="stylesheet" href="<?php echo $ICEcoder["codeMirrorDir"]; ?>/lib/codemirror.css">
|
<link rel="stylesheet" href="<?php echo $ICEcoder["codeMirrorDir"]; ?>/lib/codemirror.css">
|
||||||
|
<link rel="stylesheet" href="<?php echo $ICEcoder["codeMirrorDir"]; ?>/addon/hint/simple-hint.css">
|
||||||
<!--
|
<!--
|
||||||
codemirror-compressed.js
|
codemirror-compressed.js
|
||||||
incls: codemirror.js
|
incls: codemirror.js
|
||||||
modes: clike, coffeescript, css, javascript, less, php, ruby & xml
|
modes: clike, coffeescript, css, javascript, less, php, ruby & xml
|
||||||
utils: foldcode, searchcursor, match-highlighter
|
utils: foldcode, searchcursor, match-highlighter, simple-hint, javascript-hint
|
||||||
//-->
|
//-->
|
||||||
<script src="<?php echo $ICEcoder["codeMirrorDir"]; ?>/lib/codemirror-compressed.js"></script>
|
<script src="<?php echo $ICEcoder["codeMirrorDir"]; ?>/lib/codemirror-compressed.js"></script>
|
||||||
<?php
|
<?php
|
||||||
@@ -101,10 +102,14 @@ span.CodeMirror-matchhighlight {background: #555}
|
|||||||
CodeMirror.keyMap.ICEcoder = {
|
CodeMirror.keyMap.ICEcoder = {
|
||||||
"Tab": function(cm) {CodeMirror.commands[top.ICEcoder.tabsIndent ? "defaultTab" : "insertTab"](cm);},
|
"Tab": function(cm) {CodeMirror.commands[top.ICEcoder.tabsIndent ? "defaultTab" : "insertTab"](cm);},
|
||||||
"Shift-Tab": "indentLess",
|
"Shift-Tab": "indentLess",
|
||||||
"Ctrl-Up": function() {},
|
"Ctrl-Space": "autocomplete",
|
||||||
"Ctrl-Down": function() {},
|
|
||||||
fallthrough: ["default"]
|
fallthrough: ["default"]
|
||||||
};
|
};
|
||||||
|
CodeMirror.commands.autocomplete = function(cm) {
|
||||||
|
if (top.ICEcoder.caretLocType=="JavaScript") {
|
||||||
|
CodeMirror.simpleHint(cm, CodeMirror.javascriptHint);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function createNewCMInstance(num) {
|
function createNewCMInstance(num) {
|
||||||
var fileName = top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1];
|
var fileName = top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1];
|
||||||
@@ -223,8 +228,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>
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php include("lib/settings.php");?>
|
<?php include("lib/settings.php");?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
|
|
||||||
<html onMouseDown="top.ICEcoder.mouseDown=true" onMouseUp="top.ICEcoder.mouseDown=false" onMouseMove="if(top.ICEcoder) {top.ICEcoder.getMouseXY(event,'files');top.ICEcoder.canResizeFilesW()}" onContextMenu="top.ICEcoder.rightClickedFile=top.ICEcoder.thisFileFolderLink; return top.ICEcoder.showMenu()" onClick="top.ICEcoder.selectFileFolder()">
|
<html onMouseDown="top.ICEcoder.mouseDown=true" onMouseUp="top.ICEcoder.mouseDown=false; top.ICEcoder.tabDragEnd()" onMouseMove="if(top.ICEcoder) {top.ICEcoder.getMouseXY(event,'files');top.ICEcoder.canResizeFilesW()}" onContextMenu="top.ICEcoder.rightClickedFile=top.ICEcoder.thisFileFolderLink; return top.ICEcoder.showMenu()" onClick="top.ICEcoder.selectFileFolder()">
|
||||||
<head>
|
<head>
|
||||||
<title>ICEcoder v <?php echo $ICEcoder["versionNo"];?> file manager</title>
|
<title>ICEcoder v <?php echo $ICEcoder["versionNo"];?> file manager</title>
|
||||||
<meta name="robots" content="noindex, nofollow">
|
<meta name="robots" content="noindex, nofollow">
|
||||||
|
|||||||
BIN
images/checkerboard.png
Normal file
BIN
images/checkerboard.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 231 B |
Binary file not shown.
|
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 7.0 KiB |
BIN
images/nav-alpha.png
Normal file
BIN
images/nav-alpha.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 990 B |
21
index.php
21
index.php
@@ -16,8 +16,7 @@ if ($ICEcoder["checkUpdates"]) {
|
|||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
|
<html onMouseDown="top.ICEcoder.mouseDown=true" onMouseUp="top.ICEcoder.mouseDown=false;top.ICEcoder.tabDragEnd()" 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>
|
||||||
<title>ICEcoder v <?php echo $ICEcoder["versionNo"];?></title>
|
<title>ICEcoder v <?php echo $ICEcoder["versionNo"];?></title>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
@@ -83,12 +82,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 +105,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,11 +129,13 @@ 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" title="Close all tabs"></a>
|
||||||
|
<a nohref onClick="top.ICEcoder.alphaTabs()"><img src="images/nav-alpha.png" class="alphaTabs" title="Alphabetize tabs"></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" onMouseDown="ICEcoder.canSwitchTabs ? ICEcoder.switchTab(parseInt(this.id.slice(3),10)) : ICEcoder.canSwitchTabs=true; thisColor=\'#000\'; ICEcoder.tabDragStart(parseInt(this.id.slice(3),10))" onMouseOver="thisColor=this.style.color;this.style.color=\'#000\'" onMouseOut="this.style.color=thisColor"></div>';
|
||||||
}
|
}
|
||||||
?><div class="newTab" onClick="ICEcoder.newTab()"><img src="images/nav-new.png"></div>
|
?><div class="newTab" onClick="ICEcoder.newTab()" id="newTab"><img src="images/nav-new.png"></div>
|
||||||
</div>
|
</div>
|
||||||
<div id="findBar" class="findBar" onContextMenu="return false">
|
<div id="findBar" class="findBar" onContextMenu="return false">
|
||||||
<form name="findAndReplace" onSubmit="ICEcoder.findReplace('findReplace',false,true);return false">
|
<form name="findAndReplace" onSubmit="ICEcoder.findReplace('findReplace',false,true);return false">
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ $ICEcoder = array(
|
|||||||
array("ICErepo","plugins/ice-repo/icon.png","margin-top: 3px","plugins/ice-repo","_blank",""),
|
array("ICErepo","plugins/ice-repo/icon.png","margin-top: 3px","plugins/ice-repo","_blank",""),
|
||||||
array("Dochub","plugins/dochub/icon.png","margin-top: 3px","http://dochub.io","_blank",""),
|
array("Dochub","plugins/dochub/icon.png","margin-top: 3px","http://dochub.io","_blank",""),
|
||||||
array("JS Regex","plugins/jsregex/icon.png","margin-top: 3px","http://jsregex.herokuapp.com","_blank",""),
|
array("JS Regex","plugins/jsregex/icon.png","margin-top: 3px","http://jsregex.herokuapp.com","_blank",""),
|
||||||
|
array("wireframe|cc","plugins/wireframecc/icon.png","margin-top: 3px","http://wireframe.cc","_blank",""),
|
||||||
array("Zip It!","plugins/zip-it/icon.png","margin-top: 3px; margin-left: 3px","plugins/zip-it/?zip=|&exclude=*.doc*.gif*.jpg*.jpeg*.pdf*.png*.swf*.xml*.zip","fileControl:<b>Zipping Files</b>","30")
|
array("Zip It!","plugins/zip-it/icon.png","margin-top: 3px; margin-left: 3px","plugins/zip-it/?zip=|&exclude=*.doc*.gif*.jpg*.jpeg*.pdf*.png*.swf*.xml*.zip","fileControl:<b>Zipping Files</b>","30")
|
||||||
),
|
),
|
||||||
"theme" => "default",
|
"theme" => "default",
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ if ($_GET['action']=="load") {
|
|||||||
echo 'top.ICEcoder.shortURL = top.ICEcoder.rightClickedFile = top.ICEcoder.thisFileFolderLink = "'.$fileLoc."/".$fileName.'";';
|
echo 'top.ICEcoder.shortURL = top.ICEcoder.rightClickedFile = top.ICEcoder.thisFileFolderLink = "'.$fileLoc."/".$fileName.'";';
|
||||||
echo '</script>';
|
echo '</script>';
|
||||||
$loadedFile = file_get_contents($file);
|
$loadedFile = file_get_contents($file);
|
||||||
echo '<textarea name="loadedFile" id="loadedFile">'.str_replace("</textarea>","<ICEcoder:/:textarea>",htmlentities($loadedFile)).'</textarea>';
|
echo '<textarea name="loadedFile" id="loadedFile">'.str_replace("</textarea>","<ICEcoder:/:textarea>",str_replace("&","&",$loadedFile)).'</textarea>';
|
||||||
} else if (strpos(finfo_file($finfo, $file),"image")===0) {
|
} else if (strpos(finfo_file($finfo, $file),"image")===0) {
|
||||||
echo '<script>fileType="image";fileName=\''.$fileLoc."/".$fileName.'\'</script>';
|
echo '<script>fileType="image";fileName=\''.$fileLoc."/".$fileName.'\'</script>';
|
||||||
} else {
|
} else {
|
||||||
@@ -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,25 +72,88 @@ 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.'\',false,false,true); top.ICEcoder.serverMessage("Uploaded file(s) OK");setTimeout(function(){top.ICEcoder.serverMessage();},2000);</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.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'])))) {
|
||||||
rename($docRoot.$iceRoot.str_replace("|","/",strClean($_GET['oldFileName'])),$docRoot.$fileLoc."/".$fileName);
|
if(rename($docRoot.$iceRoot.str_replace("|","/",strClean($_GET['oldFileName'])),$docRoot.$fileLoc."/".$fileName)) {
|
||||||
// Reload file manager
|
// Reload file manager
|
||||||
echo '<script>top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'rename\',\''.$fileLoc.'\',\''.$fileName.'\',\'\',\''.str_replace($iceRoot,"",strClean($_GET['oldFileName'])).'\');';
|
echo '<script>top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'rename\',\''.$fileLoc.'\',\''.$fileName.'\',\'\',\''.str_replace($iceRoot,"",strClean($_GET['oldFileName'])).'\');';
|
||||||
echo 'action="rename";</script>';
|
echo 'action="rename";</script>';
|
||||||
|
$renamed=true;
|
||||||
|
} else {
|
||||||
|
$renamed=false;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
echo "<script>action='nothing'; top.ICEcoder.message('Sorry, cannot rename\\n".strClean($_GET['oldFileName'])."');</script>";
|
$renamed=false;
|
||||||
|
}
|
||||||
|
if (!$renamed) {
|
||||||
|
echo "<script>action='nothing'; top.ICEcoder.message('Sorry, cannot rename\\n".strClean($_GET['oldFileName'])."\\n\\nMaybe public write permissions needed on this or parent folder?');</script>";
|
||||||
}
|
}
|
||||||
echo '<script>top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);</script>';
|
echo '<script>top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);</script>';
|
||||||
}
|
}
|
||||||
@@ -128,15 +191,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 +325,7 @@ if (action=="load") {
|
|||||||
|
|
||||||
if (fileType=="image") {
|
if (fileType=="image") {
|
||||||
top.document.getElementById('blackMask').style.visibility = "visible";
|
top.document.getElementById('blackMask').style.visibility = "visible";
|
||||||
top.document.getElementById('mediaContainer').innerHTML = "<img src=\"<?php echo $fileLoc."/".$fileName;?>\" class=\"whiteGlow\" style=\"border: solid 10px #fff; max-width: 700px; max-height: 500px\" onClick=\"return false\"><br><span class=\"whiteGlow\" style=\"border: solid 10px #fff; color: #000; background-color: #fff\" onClick=\"return false\"><?php echo $fileLoc."/".$fileName;?></span>";
|
top.document.getElementById('mediaContainer').innerHTML = "<img src=\"<?php echo $fileLoc."/".$fileName;?>\" class=\"whiteGlow\" style=\"border: solid 10px #fff; max-width: 700px; max-height: 500px; background-color: #000; background-image: url('images/checkerboard.png')\" onClick=\"return false\"><br><span class=\"whiteGlow\" style=\"border: solid 10px #fff; color: #000; background-color: #fff\" onClick=\"return false\"><?php echo $fileLoc."/".$fileName;?></span>";
|
||||||
}
|
}
|
||||||
|
|
||||||
top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);
|
top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ body {overflow: hidden;
|
|||||||
}
|
}
|
||||||
|
|
||||||
h1 {font-size: 36px; font-weight: normal; color: #888; margin-bottom: 20px}
|
h1 {font-size: 36px; font-weight: normal; color: #888; margin-bottom: 20px}
|
||||||
|
a {color: #fff; text-decoration: none}
|
||||||
|
|
||||||
.help {font-family: arial, verdana, helvetica, sans-serif; background-color: #1c1c19; color: #fff; padding: 20px}
|
.help {font-family: arial, verdana, helvetica, sans-serif; background-color: #1c1c19; color: #fff; padding: 20px}
|
||||||
.help .key {display: inline-block; width: 175px; text-align: right; margin-right: 5px; float: left}
|
.help .key {display: inline-block; width: 175px; text-align: right; margin-right: 5px; float: left}
|
||||||
|
|||||||
@@ -13,6 +13,8 @@
|
|||||||
|
|
||||||
<h1 id="title">help</h1>
|
<h1 id="title">help</h1>
|
||||||
|
|
||||||
|
<a href="javascript:top.ICEcoder.showManual(<?php echo $ICEcoder["versionNo"];?>)" style="position: absolute; top: 26px; right: 20px"><div style="padding: 10px; background: #2187e7; color: #fff; font-size: 18px">ICEcoder manual</div></a>
|
||||||
|
|
||||||
<h2>In file manager</h2>
|
<h2>In file manager</h2>
|
||||||
<span class="key">Delete</span> <span class="shortcut">Delete file</span><br><br>
|
<span class="key">Delete</span> <span class="shortcut">Delete file</span><br><br>
|
||||||
|
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ h2 {font-size: 18px; font-weight: normal; color: #fff}
|
|||||||
.header .plugins img {position: relative; display: inline-block; margin-right: 15px}
|
.header .plugins img {position: relative; display: inline-block; margin-right: 15px}
|
||||||
.header .screenModeIcon {position: absolute; top: 5px; right: 178px; cursor: pointer}
|
.header .screenModeIcon {position: absolute; top: 5px; right: 178px; cursor: pointer}
|
||||||
.header .version {position: relative; display: inline-block; margin-top: 25px; font-size: 10px; color: #bbb}
|
.header .version {position: relative; display: inline-block; margin-top: 25px; font-size: 10px; color: #bbb}
|
||||||
|
.header .version a {font-size: 10px; color: #bbb; text-decoration: none}
|
||||||
.header .logo {position: relative; margin: 5px 10px 0 5px; cursor: pointer}
|
.header .logo {position: relative; margin: 5px 10px 0 5px; cursor: pointer}
|
||||||
|
|
||||||
.files {position: absolute; display: inline-block; top: 0; left: 0; height: 100%; width: 250px; background-color: #444; background-image: url('../images/files-arrow.png'); background-repeat: no-repeat; background-position: 100% 50%; overflow: hidden; z-index: 1;
|
.files {position: absolute; display: inline-block; top: 0; left: 0; height: 100%; width: 250px; background-color: #444; background-image: url('../images/files-arrow.png'); background-repeat: no-repeat; background-position: 100% 50%; overflow: hidden; z-index: 1;
|
||||||
@@ -99,13 +100,24 @@ h2 {font-size: 18px; font-weight: normal; color: #fff}
|
|||||||
|
|
||||||
.editor {position: absolute; display: inline-block; top: 0; left: 15px; width: 2400px}
|
.editor {position: absolute; display: inline-block; top: 0; left: 15px; width: 2400px}
|
||||||
.editor .tabsBar {display: inline-block; height: 22px; width: 2400px; margin-top: 40px; padding-left: 41px; background: #ddd}
|
.editor .tabsBar {display: inline-block; height: 22px; width: 2400px; margin-top: 40px; padding-left: 41px; background: #ddd}
|
||||||
.tabsBar .tab {display: none; background-image: url('../images/nav-bg.jpg'); background-repeat: repeat-x; background-position: 0 0; padding: 5px 8px 2px 8px; font-size: 10px; border-left: solid 1px #eee; border-right: solid 1px #777; border-radius: 4px 4px 0 0; color: #fff; direction: rtl; text-align: right; white-space: nowrap; overflow: hidden; cursor: pointer;
|
.tabsBar .tab {position: absolute; display: none; background: url('../images/nav-bg.jpg') repeat-x 0 0; padding: 5px 8px 2px 8px; font-size: 10px; border-left: solid 1px #eee; border-right: solid 1px #777; border-radius: 4px 4px 0 0; color: #fff; white-space: nowrap; overflow: hidden; cursor: pointer; z-index: 1}
|
||||||
-webkit-transition: all 0.15s;
|
.tabsBar .tabSlide {
|
||||||
-moz-transition: all 0.15s;
|
-webkit-transition: left 0.15s ease-in-out;
|
||||||
transition: all 0.15s;
|
-moz-transition: left 0.15s ease-in-out;
|
||||||
|
transition: left 0.15s ease-in-out;
|
||||||
}
|
}
|
||||||
.tabsBar .tab .closeTab {margin: 1px 0 0 5px; border-radius: 6px}
|
.tabsBar .tabDrag {
|
||||||
.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;}
|
-webkit-transition: left 0s ease-in-out;
|
||||||
|
-moz-transition: left 0s ease-in-out;
|
||||||
|
transition: left 0s ease-in-out;
|
||||||
|
}
|
||||||
|
.tabsBar .tab .closeTab, .tabsBar .closeAllTabs {margin: 1px 0 0 5px; border-radius: 6px; cursor: pointer}
|
||||||
|
.tabsBar .tab .closeTab {position: absolute; right: 7px}
|
||||||
|
.tabsBar .alphaTabs {position: absolute; margin: 6px 0 0 -17px; background: #bbb; border-radius: 6px; cursor: pointer}
|
||||||
|
.tabsBar .alphaTabs:hover {background: #000}
|
||||||
|
.tabsBar .closeAllTabs {position: absolute; margin: 6px 0 0 -33px; background: #bbb}
|
||||||
|
.tabsBar .closeAllTabs:hover {background: #000}
|
||||||
|
.tabsBar .newTab {position: absolute; 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; z-index: 1}
|
||||||
.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}
|
||||||
.findReplace select {position: relative; font-size: 10px; margin: 8px 2px 0 2px; top: -2px;}
|
.findReplace select {position: relative; font-size: 10px; margin: 8px 2px 0 2px; top: -2px;}
|
||||||
|
|||||||
343
lib/ice-coder.js
343
lib/ice-coder.js
@@ -26,10 +26,11 @@ var ICEcoder = {
|
|||||||
snippetLine: false, // Line no of snippet, if shown
|
snippetLine: false, // Line no of snippet, if shown
|
||||||
mouseDown: false, // If the mouse is down or not
|
mouseDown: false, // If the mouse is down or not
|
||||||
draggingFilesW: false, // If we're dragging the file manager width or not
|
draggingFilesW: false, // If we're dragging the file manager width or not
|
||||||
|
draggingTab: false, // If we're dragging a tab
|
||||||
|
tabLeftPos: [], // Left position of tabs inside content area
|
||||||
serverQueueItems: [], // Array of URLs to call in order
|
serverQueueItems: [], // Array of URLs to call in order
|
||||||
stickyTab: false, // Target variable for the sticky tab window
|
stickyTab: false, // Target variable for the sticky tab window
|
||||||
pluginIntervalRefs: [], // Array of plugin interval refs
|
pluginIntervalRefs: [], // Array of plugin interval refs
|
||||||
dragSrcEl: null, // Tab element being dragged
|
|
||||||
ready: false, // Indicates if ICEcoder is ready for action
|
ready: false, // Indicates if ICEcoder is ready for action
|
||||||
|
|
||||||
// Don't consider these tags as part of nesting as they're singles, JS, PHP or Ruby code blocks
|
// Don't consider these tags as part of nesting as they're singles, JS, PHP or Ruby code blocks
|
||||||
@@ -56,15 +57,6 @@ var ICEcoder = {
|
|||||||
top.ICEcoder.showHide('hide',top.document.getElementById('loadingMask'));
|
top.ICEcoder.showHide('hide',top.document.getElementById('loadingMask'));
|
||||||
if (top.ICEcoder.openLastFiles) {top.ICEcoder.autoOpenFiles()};
|
if (top.ICEcoder.openLastFiles) {top.ICEcoder.autoOpenFiles()};
|
||||||
|
|
||||||
// Add drag based events to our tabs
|
|
||||||
var tabs = document.querySelectorAll('.tab');
|
|
||||||
[].forEach.call(tabs, function(tab) {
|
|
||||||
// not used: dragenter, dragleave
|
|
||||||
tab.addEventListener('dragstart', ICEcoder.handleDragStart, false);
|
|
||||||
tab.addEventListener('dragover', ICEcoder.handleDragOver, false);
|
|
||||||
tab.addEventListener('drop', ICEcoder.handleDrop, false);
|
|
||||||
tab.addEventListener('dragend', ICEcoder.handleDragEnd, false);
|
|
||||||
});
|
|
||||||
setInterval(ICEcoder.updateNestingIndicator,30);
|
setInterval(ICEcoder.updateNestingIndicator,30);
|
||||||
|
|
||||||
// Setup fullscreen detection and change icon
|
// Setup fullscreen detection and change icon
|
||||||
@@ -217,12 +209,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")
|
||||||
@@ -552,7 +546,7 @@ var ICEcoder = {
|
|||||||
|
|
||||||
// Prompt a rename dialog on demand
|
// Prompt a rename dialog on demand
|
||||||
renameFile: function(oldName,newName) {
|
renameFile: function(oldName,newName) {
|
||||||
var shortURL, fileName;
|
var shortURL, fileName, i;
|
||||||
|
|
||||||
if (!oldName) {
|
if (!oldName) {
|
||||||
shortURL = top.ICEcoder.rightClickedFile.replace(/\|/g,"/");
|
shortURL = top.ICEcoder.rightClickedFile.replace(/\|/g,"/");
|
||||||
@@ -564,12 +558,14 @@ var ICEcoder = {
|
|||||||
newName = top.ICEcoder.getInput('Please enter the new name for',shortURL);
|
newName = top.ICEcoder.getInput('Please enter the new name for',shortURL);
|
||||||
}
|
}
|
||||||
if (newName) {
|
if (newName) {
|
||||||
if(top.ICEcoder.openFiles.indexOf(shortURL.replace(/\|/g,"/"))>-1) {
|
i = top.ICEcoder.openFiles.indexOf(shortURL.replace(/\|/g,"/"));
|
||||||
|
if(i>-1) {
|
||||||
// rename array item and the tab
|
// rename array item and the tab
|
||||||
top.ICEcoder.openFiles[i] = newName;
|
top.ICEcoder.openFiles[i] = newName;
|
||||||
closeTabLink = '<a nohref onClick="top.ICEcoder.files.contentWindow.closeTab('+(i+1)+')"><img src="images/nav-close.gif" id="closeTabButton'+(i+1)+'" class="closeTab" onMouseOver="prevBG=this.style.backgroundColor;this.style.backgroundColor=\'#333\'" onMouseOut="this.style.backgroundColor=prevBG"></a>';
|
closeTabLink = '<a nohref onClick="top.ICEcoder.closeTab(parseInt(this.parentNode.id.slice(3),10))"><img src="images/nav-close.gif" class="closeTab" onMouseOver="prevBG=this.style.backgroundColor;this.style.backgroundColor=\'#333\'" onMouseOut="this.style.backgroundColor=prevBG"></a>';
|
||||||
fileName = top.ICEcoder.openFiles[i];
|
fileName = top.ICEcoder.openFiles[i];
|
||||||
top.document.getElementById('tab'+(i+1)).innerHTML = closeTabLink + " " + fileName.slice(fileName.lastIndexOf("/")).replace(/\//,"");
|
top.document.getElementById('tab'+(i+1)).innerHTML = closeTabLink + " " + fileName.slice(fileName.lastIndexOf("/")).replace(/\//,"");
|
||||||
|
top.document.getElementById('tab'+(i+1)).title = newName;
|
||||||
}
|
}
|
||||||
top.ICEcoder.serverQueue("add","lib/file-control.php?action=rename&file="+newName+"&oldFileName="+oldName.replace(/\|/g,"/"));
|
top.ICEcoder.serverQueue("add","lib/file-control.php?action=rename&file="+newName+"&oldFileName="+oldName.replace(/\|/g,"/"));
|
||||||
top.ICEcoder.serverMessage('<b>Renaming to</b><br>'+newName);
|
top.ICEcoder.serverMessage('<b>Renaming to</b><br>'+newName);
|
||||||
@@ -607,6 +603,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,13 +640,13 @@ 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';
|
||||||
},
|
},
|
||||||
|
|
||||||
// Update the file manager tree list on demand
|
// Update the file manager tree list on demand
|
||||||
updateFileManagerList: function(action,location,file,perms,oldName) {
|
updateFileManagerList: function(action,location,file,perms,oldName,uploaded) {
|
||||||
var actionElemType, cssStyle, perms, targetElem, locNest, newText, innerLI, newUL, newLI, elemType, nameLI, shortURL, newMouseOver;
|
var actionElemType, cssStyle, perms, targetElem, locNest, newText, innerLI, newUL, newLI, elemType, nameLI, shortURL, newMouseOver;
|
||||||
|
|
||||||
// Adding files
|
// Adding files
|
||||||
@@ -701,7 +708,7 @@ var ICEcoder = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// If we added a new file, we've saved it under a new filename, so set that
|
// If we added a new file, we've saved it under a new filename, so set that
|
||||||
if (actionElemType=="file") {
|
if (actionElemType=="file" && !uploaded) {
|
||||||
top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1]=location+file;
|
top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1]=location+file;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -709,15 +716,16 @@ var ICEcoder = {
|
|||||||
// Renaming files
|
// Renaming files
|
||||||
if (action=="rename") {
|
if (action=="rename") {
|
||||||
// Get short URL of our right clicked file and get target elem based on this
|
// Get short URL of our right clicked file and get target elem based on this
|
||||||
shortURL = oldName;
|
shortURL = oldName.replace(/\//g,"|");
|
||||||
targetElem = document.getElementById('filesFrame').contentWindow.document.getElementById(shortURL.replace(/\//g,"|"));
|
targetElem = document.getElementById('filesFrame').contentWindow.document.getElementById(shortURL);
|
||||||
// Set the name to be as per our new file/folder name
|
// Set the name to be as per our new file/folder name
|
||||||
targetElem.innerHTML = file;
|
targetElem.innerHTML = file;
|
||||||
// Finally, update the ID of the target & set a new mouseover function for the parent too
|
// Finally, update the ID of the target & set a new mouseover function for the parent too
|
||||||
targetElem.id = location.replace(/\//g,"|") + "|" + file;
|
targetElem.id = location.replace(/\//g,"|") + "|" + file;
|
||||||
newMouseOver = targetElem.parentNode.onmouseover.toString().replace(shortURL.substring(shortURL.lastIndexOf("|")+1),file).split('\'');
|
newMouseOver = targetElem.parentNode.onmouseover.toString().replace(shortURL.substring(shortURL.lastIndexOf("|")+1),file).split('\'');
|
||||||
eval("targetElem.parentNode.onmouseover = function() { top.ICEcoder.overFileFolder('"+newMouseOver[1]+"','"+newMouseOver[3]+"');}");
|
eval("targetElem.parentNode.onmouseover = function() { top.ICEcoder.overFileFolder('"+newMouseOver[1]+"','"+newMouseOver[3]+"');}");
|
||||||
targetElemPerms = document.getElementById('filesFrame').contentWindow.document.getElementById(shortURL.replace(/\//g,"|")+"_perms");
|
eval("targetElem.parentNode.title = newMouseOver[3];");
|
||||||
|
targetElemPerms = document.getElementById('filesFrame').contentWindow.document.getElementById(shortURL+"_perms");
|
||||||
targetElemPerms.id = location.replace(/\//g,"|") + "|" + file + "_perms";
|
targetElemPerms.id = location.replace(/\//g,"|") + "|" + file + "_perms";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -808,8 +816,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?
|
||||||
@@ -1047,7 +1055,7 @@ var ICEcoder = {
|
|||||||
// Exclude a few keys...
|
// Exclude a few keys...
|
||||||
// Escape (27), Caps Lock (20), Shift, CTRL, Alt, Pause/Break (16-19), Left, Up, Right, Down (37-40), Num Lock, Scroll Lock (144-145),
|
// Escape (27), Caps Lock (20), Shift, CTRL, Alt, Pause/Break (16-19), Left, Up, Right, Down (37-40), Num Lock, Scroll Lock (144-145),
|
||||||
// Insert, Delete (45,46), Page Up, Page Down, End, Home (33-36), Left Win Key, Right Win Key (91-92), F1-F12 (112-123)
|
// Insert, Delete (45,46), Page Up, Page Down, End, Home (33-36), Left Win Key, Right Win Key (91-92), F1-F12 (112-123)
|
||||||
if (key!=27 && key!=20 && (key<16||key>19) && (key<37||key>40) && (key!=144||key!=145) && (key!=45||key!=46) && (key<33||key>36) && (key!=91||key!=92) && (key<112||key>123)) {
|
if (!top.ICEcoder.ctrlKeyDown && key!=27 && key!=20 && (key<16||key>19) && (key<37||key>40) && (key!=144||key!=145) && (key!=45||key!=46) && (key<33||key>36) && (key!=91||key!=92) && (key<112||key>123)) {
|
||||||
ICEcoder.changedContent[ICEcoder.selectedTab-1] = cM.historySize().undo > 0 ? 1 : 0;
|
ICEcoder.changedContent[ICEcoder.selectedTab-1] = cM.historySize().undo > 0 ? 1 : 0;
|
||||||
ICEcoder.redoTabHighlight(ICEcoder.selectedTab);
|
ICEcoder.redoTabHighlight(ICEcoder.selectedTab);
|
||||||
}
|
}
|
||||||
@@ -1086,13 +1094,21 @@ var ICEcoder = {
|
|||||||
|
|
||||||
// Test if we need to show a drag cursor or not
|
// Test if we need to show a drag cursor or not
|
||||||
dragCursorTest: function() {
|
dragCursorTest: function() {
|
||||||
var winH, cursorName;
|
var winH, cursorName, diffX;
|
||||||
|
|
||||||
|
diffX = top.ICEcoder.mouseX - top.ICEcoder.diffStartX;
|
||||||
|
if (top.ICEcoder.draggingTab!==false && top.ICEcoder.diffStartX && (diffX <= -10 || diffX >= 10)) {
|
||||||
|
if (top.ICEcoder.mouseX > parseInt(top.ICEcoder.files.style.width,10)) {
|
||||||
|
top.ICEcoder.tabDragMouseX = top.ICEcoder.mouseX - parseInt(top.ICEcoder.files.style.width,10) - top.ICEcoder.tabDragMouseXStart;
|
||||||
|
top.ICEcoder.tabDragMove();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (top.ICEcoder.ready) {
|
if (top.ICEcoder.ready) {
|
||||||
winH = window.innerWidth ? window.innerHeight : document.body.clientHeight;
|
winH = window.innerWidth ? window.innerHeight : document.body.clientHeight;
|
||||||
if (!top.ICEcoder.mouseDown) {top.ICEcoder.draggingFilesW = false};
|
if (!top.ICEcoder.mouseDown) {top.ICEcoder.draggingFilesW = false};
|
||||||
|
|
||||||
cursorName = ((top.ICEcoder.mouseX > top.ICEcoder.filesW-7 && top.ICEcoder.mouseX < top.ICEcoder.filesW+7 && top.ICEcoder.mouseY > 40 && top.ICEcoder.mouseY < (winH-30)) || top.ICEcoder.draggingFilesW)
|
cursorName = (!ICEcoder.draggingTab && ((top.ICEcoder.mouseX > top.ICEcoder.filesW-7 && top.ICEcoder.mouseX < top.ICEcoder.filesW+7 && top.ICEcoder.mouseY > 40 && top.ICEcoder.mouseY < (winH-30)) || top.ICEcoder.draggingFilesW))
|
||||||
? "w-resize"
|
? "w-resize"
|
||||||
: "auto";
|
: "auto";
|
||||||
if (top.ICEcoder.content.contentWindow.document && top.ICEcoder.filesFrame.contentWindow) {
|
if (top.ICEcoder.content.contentWindow.document && top.ICEcoder.filesFrame.contentWindow) {
|
||||||
@@ -1308,10 +1324,12 @@ var ICEcoder = {
|
|||||||
|
|
||||||
// Opens the last files we had open
|
// Opens the last files we had open
|
||||||
autoOpenFiles: function() {
|
autoOpenFiles: function() {
|
||||||
for (var i=0;i<top.ICEcoder.previousFiles.length;i++) {
|
if (top.ICEcoder.previousFiles.length>0 && top.ICEcoder.ask('Open previous files?\n\n'+top.ICEcoder.previousFiles.length+' files:\n'+top.ICEcoder.previousFiles.join('\n').replace(/\|/g,"/").replace(new RegExp(top.docRoot+top.iceRoot,'gi'),""))) {
|
||||||
top.ICEcoder.rightClickedFile=top.ICEcoder.thisFileFolderLink=top.ICEcoder.previousFiles[i].replace('|','/');
|
for (var i=0;i<top.ICEcoder.previousFiles.length;i++) {
|
||||||
top.ICEcoder.thisFileFolderType='file';
|
top.ICEcoder.rightClickedFile=top.ICEcoder.thisFileFolderLink=top.ICEcoder.previousFiles[i].replace('|','/');
|
||||||
top.ICEcoder.openFile();
|
top.ICEcoder.thisFileFolderType='file';
|
||||||
|
top.ICEcoder.openFile();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -1329,6 +1347,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>';
|
||||||
@@ -1427,51 +1451,6 @@ var ICEcoder = {
|
|||||||
top.ICEcoder.filesFrame.contentWindow.frames['fileControl'].location.href="plugins/zip-it/index.php?zip="+tgt;
|
top.ICEcoder.filesFrame.contentWindow.frames['fileControl'].location.href="plugins/zip-it/index.php?zip="+tgt;
|
||||||
},
|
},
|
||||||
|
|
||||||
// Tab dragging start
|
|
||||||
handleDragStart: function(e) {
|
|
||||||
this.style.opacity = '0.2';
|
|
||||||
ICEcoder.dragSrcEl = this;
|
|
||||||
e.dataTransfer.effectAllowed = 'move';
|
|
||||||
e.dataTransfer.setData('text/html', this.innerHTML);
|
|
||||||
},
|
|
||||||
|
|
||||||
// Tab dragging over tabs
|
|
||||||
handleDragOver: function(e) {
|
|
||||||
if (e.preventDefault) {e.preventDefault()}
|
|
||||||
e.dataTransfer.dropEffect = 'move';
|
|
||||||
return false;
|
|
||||||
},
|
|
||||||
|
|
||||||
// Tab dropping on target
|
|
||||||
handleDrop: function(e) {
|
|
||||||
if (e.stopPropagation) {e.stopPropagation()}
|
|
||||||
if (ICEcoder.dragSrcEl != this) {
|
|
||||||
ICEcoder.dragSrcEl.innerHTML = this.innerHTML.split(" ")[0] + ICEcoder.dragSrcEl.innerHTML.substr(ICEcoder.dragSrcEl.innerHTML.indexOf(" "));
|
|
||||||
this.innerHTML = e.dataTransfer.getData('text/html').split(" ")[0] + this.innerHTML.substr(this.innerHTML.indexOf(" "));
|
|
||||||
var dragID = ICEcoder.dragSrcEl.id.substr(3)*1;
|
|
||||||
var dropID = this.id.substr(3)*1;
|
|
||||||
if(dragID==top.ICEcoder.selectedTab) {
|
|
||||||
var a; // array value
|
|
||||||
var b = dragID-1;
|
|
||||||
var c = dropID-1;
|
|
||||||
|
|
||||||
// Swap values for switched tabs in these arrays
|
|
||||||
a = [ICEcoder.changedContent, ICEcoder.openFiles, ICEcoder.openFileMDTs, ICEcoder.cMInstances];
|
|
||||||
for (var i=0;i<a.length;i++) {
|
|
||||||
a[i][b]=[a[i][c],a[i][c]=a[i][b]][0];
|
|
||||||
}
|
|
||||||
|
|
||||||
top.ICEcoder.switchTab(dropID);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
},
|
|
||||||
|
|
||||||
// Tab drag ending
|
|
||||||
handleDragEnd: function(e) {
|
|
||||||
this.style.opacity = '1';
|
|
||||||
},
|
|
||||||
|
|
||||||
// Change permissions on a file/folder
|
// Change permissions on a file/folder
|
||||||
chmod: function(file,perms) {
|
chmod: function(file,perms) {
|
||||||
top.ICEcoder.showHide('hide',top.document.getElementById('blackMask'));
|
top.ICEcoder.showHide('hide',top.document.getElementById('blackMask'));
|
||||||
@@ -1479,6 +1458,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);
|
||||||
@@ -1567,11 +1551,11 @@ var ICEcoder = {
|
|||||||
top.ICEcoder.openFiles.push(top.ICEcoder.shortURL);
|
top.ICEcoder.openFiles.push(top.ICEcoder.shortURL);
|
||||||
|
|
||||||
// Setup a new tab
|
// Setup a new tab
|
||||||
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" onMouseOver="prevBG=this.style.backgroundColor;this.style.backgroundColor=\'#333\'" onMouseOut="this.style.backgroundColor=prevBG"></a>';
|
closeTabLink = '<a nohref onClick="top.ICEcoder.closeTab(parseInt(this.parentNode.id.slice(3),10))"><img src="images/nav-close.gif" class="closeTab" onMouseOver="prevBG=this.style.backgroundColor;this.style.backgroundColor=\'#333\'" onMouseOut="this.style.backgroundColor=prevBG"></a>';
|
||||||
top.document.getElementById('tab'+(top.ICEcoder.openFiles.length)).style.display = "inline-block";
|
top.document.getElementById('tab'+(top.ICEcoder.openFiles.length)).style.display = "inline-block";
|
||||||
fileName = top.ICEcoder.openFiles[top.ICEcoder.openFiles.length-1];
|
fileName = top.ICEcoder.openFiles[top.ICEcoder.openFiles.length-1];
|
||||||
top.document.getElementById('tab'+(top.ICEcoder.openFiles.length)).innerHTML = closeTabLink + " " + fileName.slice(fileName.lastIndexOf("/")).replace(/\//,"");
|
top.document.getElementById('tab'+(top.ICEcoder.openFiles.length)).innerHTML = closeTabLink + " " + fileName.slice(fileName.lastIndexOf("/")).replace(/\//,"");
|
||||||
top.document.getElementById('tab'+(top.ICEcoder.openFiles.length)).title = top.ICEcoder.openFiles[top.ICEcoder.openFiles.length-1].replace(/\//,"") + "/";
|
top.document.getElementById('tab'+(top.ICEcoder.openFiles.length)).title = "/" + top.ICEcoder.openFiles[top.ICEcoder.openFiles.length-1].replace(/\//,"");
|
||||||
|
|
||||||
// Set the widths
|
// Set the widths
|
||||||
top.ICEcoder.setTabWidths();
|
top.ICEcoder.setTabWidths();
|
||||||
@@ -1610,21 +1594,20 @@ var ICEcoder = {
|
|||||||
top.ICEcoder.openFiles[tabNum-1] = newName;
|
top.ICEcoder.openFiles[tabNum-1] = newName;
|
||||||
|
|
||||||
// Setup a new tab
|
// Setup a new tab
|
||||||
closeTabLink = '<a nohref onClick="parent.ICEcoder.closeTab('+tabNum+')"><img src="images/nav-close.gif" id="closeTabButton'+tabNum+'" class="closeTab" onMouseOver="prevBG=this.style.backgroundColor;this.style.backgroundColor=\'#333\'" onMouseOut="this.style.backgroundColor=prevBG"></a>';
|
closeTabLink = '<a nohref onClick="top.ICEcoder.closeTab(parseInt(this.parentNode.id.slice(3),10))"><img src="images/nav-close.gif" class="closeTab" onMouseOver="prevBG=this.style.backgroundColor;this.style.backgroundColor=\'#333\'" onMouseOut="this.style.backgroundColor=prevBG"></a>';
|
||||||
fileName = top.ICEcoder.openFiles[tabNum-1];
|
fileName = top.ICEcoder.openFiles[tabNum-1];
|
||||||
top.document.getElementById('tab'+tabNum).innerHTML = closeTabLink + " " + fileName.slice(fileName.lastIndexOf("/")).replace(/\//,"");
|
top.document.getElementById('tab'+tabNum).innerHTML = closeTabLink + " " + fileName.slice(fileName.lastIndexOf("/")).replace(/\//,"");
|
||||||
top.document.getElementById('tab'+tabNum).title = top.ICEcoder.openFiles[tabNum-1].replace(/\//,"") + "/";
|
top.document.getElementById('tab'+tabNum).title = "/" + top.ICEcoder.openFiles[tabNum-1].replace(/\//,"");
|
||||||
},
|
},
|
||||||
|
|
||||||
// Reset all tabs to be without a highlight and then highlight the selected
|
// Reset all tabs to be without a highlight and then highlight the selected
|
||||||
redoTabHighlight: function(selectedTab) {
|
redoTabHighlight: function(selectedTab) {
|
||||||
var cM, bgVPos, tColor, fileLink;
|
var bgVPos, tColor, fileLink;
|
||||||
|
|
||||||
cM = ICEcoder.getcMInstance();
|
|
||||||
for(var i=1;i<=ICEcoder.changedContent.length;i++) {
|
for(var i=1;i<=ICEcoder.changedContent.length;i++) {
|
||||||
if (document.getElementById('closeTabButton'+i)) {
|
if (document.getElementById('tab'+i).childNodes[0]) {
|
||||||
document.getElementById('closeTabButton'+i).style.backgroundColor = ICEcoder.changedContent[i-1]==1
|
document.getElementById('tab'+i).childNodes[0].childNodes[0].style.backgroundColor = ICEcoder.changedContent[i-1]==1
|
||||||
? "#b00" : "rgba(255,255,255,0.3)";
|
? "#b00" : "transparent";
|
||||||
}
|
}
|
||||||
tColor = i==selectedTab ? "#000" : "#fff";
|
tColor = i==selectedTab ? "#000" : "#fff";
|
||||||
if ("undefined" != typeof top.ICEcoder.openFiles[i-1] && top.ICEcoder.openFiles[i-1] != "/[NEW]") {
|
if ("undefined" != typeof top.ICEcoder.openFiles[i-1] && top.ICEcoder.openFiles[i-1] != "/[NEW]") {
|
||||||
@@ -1639,7 +1622,7 @@ var ICEcoder = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
// Close the tab upon request
|
// Close the tab upon request
|
||||||
closeTab: function(closeTabNum) {
|
closeTab: function(closeTabNum, dontSetPV) {
|
||||||
var cM, okToRemove, closeFileName;
|
var cM, okToRemove, closeFileName;
|
||||||
cM = ICEcoder.getcMInstance();
|
cM = ICEcoder.getcMInstance();
|
||||||
okToRemove = true;
|
okToRemove = true;
|
||||||
@@ -1657,9 +1640,6 @@ var ICEcoder = {
|
|||||||
top.document.getElementById('tab'+i).title = top.document.getElementById('tab'+(i+1)).title;
|
top.document.getElementById('tab'+i).title = top.document.getElementById('tab'+(i+1)).title;
|
||||||
ICEcoder.openFiles[i-1] = ICEcoder.openFiles[i];
|
ICEcoder.openFiles[i-1] = ICEcoder.openFiles[i];
|
||||||
ICEcoder.openFileMDTs[i-1] = ICEcoder.openFileMDTs[i];
|
ICEcoder.openFileMDTs[i-1] = ICEcoder.openFileMDTs[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+")").replace(("closeTabButton"+(i+1)),"closeTabButton"+i);
|
|
||||||
}
|
}
|
||||||
// hide the instance we're closing by setting the hide class and removing 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]].getWrapperElement().style.display = "none";
|
ICEcoder.content.contentWindow['cM'+top.ICEcoder.cMInstances[closeTabNum-1]].getWrapperElement().style.display = "none";
|
||||||
@@ -1691,7 +1671,9 @@ var ICEcoder = {
|
|||||||
// Remove any highlighting from the file manager
|
// Remove any highlighting from the file manager
|
||||||
top.ICEcoder.selectDeselectFile('deselect',top.ICEcoder.filesFrame.contentWindow.document.getElementById(closeFileName.replace(/\//g,"|")));
|
top.ICEcoder.selectDeselectFile('deselect',top.ICEcoder.filesFrame.contentWindow.document.getElementById(closeFileName.replace(/\//g,"|")));
|
||||||
|
|
||||||
top.ICEcoder.setPreviousFiles();
|
if (!dontSetPV) {
|
||||||
|
top.ICEcoder.setPreviousFiles();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// Lastly, stop it from trying to also switch tab
|
// Lastly, stop it from trying to also switch tab
|
||||||
top.ICEcoder.canSwitchTabs=false;
|
top.ICEcoder.canSwitchTabs=false;
|
||||||
@@ -1699,18 +1681,173 @@ var ICEcoder = {
|
|||||||
top.ICEcoder.setTabWidths();
|
top.ICEcoder.setTabWidths();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// Close all tabs
|
||||||
|
closeAllTabs: function() {
|
||||||
|
if (ICEcoder.ask("Close all tabs?")) {
|
||||||
|
for (var i=top.ICEcoder.cMInstances.length; i>0; i--) {
|
||||||
|
top.ICEcoder.closeTab(i, i>1? true:false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
// Set the tabs width
|
// Set the tabs width
|
||||||
setTabWidths: function() {
|
setTabWidths: function() {
|
||||||
var availWidth, tabWidth, thisWidth;
|
var availWidth, avgWidth, tabWidth, lastLeft, lastWidth;
|
||||||
|
|
||||||
availWidth = parseInt(top.ICEcoder.content.style.width,10)-41-24-10; // - left margin - new tab - right margin
|
availWidth = parseInt(top.ICEcoder.content.style.width,10)-41-24-10; // - left margin - new tab - right margin
|
||||||
avgWidth = (availWidth/top.ICEcoder.openFiles.length)-18;
|
avgWidth = (availWidth/top.ICEcoder.openFiles.length)-18;
|
||||||
|
tabWidth = -18; // Incl 18px offset
|
||||||
|
lastLeft = 41;
|
||||||
|
lastWidth = 0;
|
||||||
|
top.ICEcoder.tabLeftPos = [];
|
||||||
|
|
||||||
for (var i=0;i<top.ICEcoder.openFiles.length;i++) {
|
for (var i=0;i<top.ICEcoder.openFiles.length;i++) {
|
||||||
thisWidth = parseInt(avgWidth*i,10) - parseInt(avgWidth*(i-1),10);
|
tabWidth = top.ICEcoder.openFiles.length*(150+18) > availWidth ? parseInt(avgWidth*i,10) - parseInt(avgWidth*(i-1),10) : 150;
|
||||||
tabWidth = top.ICEcoder.openFiles.length*(150+18) > availWidth ? thisWidth : 150;
|
lastLeft = i==0 ? 41 : parseInt(top.document.getElementById('tab'+(i)).style.left,10);
|
||||||
|
lastWidth = i==0 ? 0 : parseInt(top.document.getElementById('tab'+(i)).style.width,10)+18;
|
||||||
|
top.document.getElementById('tab'+(i+1)).style.left = (lastLeft+lastWidth) + "px";
|
||||||
top.document.getElementById('tab'+(i+1)).style.width = tabWidth + "px";
|
top.document.getElementById('tab'+(i+1)).style.width = tabWidth + "px";
|
||||||
|
top.ICEcoder.tabLeftPos.push(lastLeft+lastWidth);
|
||||||
}
|
}
|
||||||
|
top.document.getElementById('newTab').style.left = (lastLeft+lastWidth+tabWidth+18) + "px";
|
||||||
|
},
|
||||||
|
|
||||||
|
// Tab dragging start
|
||||||
|
tabDragStart: function(tab) {
|
||||||
|
top.ICEcoder.draggingTab = tab;
|
||||||
|
top.ICEcoder.diffStartX = top.ICEcoder.mouseX;
|
||||||
|
top.ICEcoder.tabDragMouseXStart = (top.ICEcoder.mouseX - (parseInt(top.ICEcoder.files.style.width,10)+41+18)) % 150;
|
||||||
|
top.document.getElementById('tab'+tab).style.zIndex = 2;
|
||||||
|
for (var i=1; i<=top.ICEcoder.openFiles.length; i++) {
|
||||||
|
top.document.getElementById('tab'+i).className = i!==tab
|
||||||
|
? "tab tabSlide"
|
||||||
|
: "tab tabDrag";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// Tab dragging
|
||||||
|
tabDragMove: function() {
|
||||||
|
var lastTabWidth, thisLeft, dragTabNo, tabWidth;
|
||||||
|
|
||||||
|
lastTabWidth = parseInt(top.document.getElementById('tab'+top.ICEcoder.openFiles.length).style.width,10)+18;
|
||||||
|
|
||||||
|
top.ICEcoder.thisLeft = thisLeft = top.ICEcoder.tabDragMouseX >= 41
|
||||||
|
? top.ICEcoder.tabDragMouseX <= parseInt(top.document.getElementById('newTab').style.left,10) - lastTabWidth
|
||||||
|
? top.ICEcoder.tabDragMouseX : (parseInt(top.document.getElementById('newTab').style.left,10) - lastTabWidth) : 41;
|
||||||
|
|
||||||
|
top.document.getElementById('tab'+top.ICEcoder.draggingTab).style.left = thisLeft + "px";
|
||||||
|
|
||||||
|
top.ICEcoder.dragTabNo = dragTabNo = top.ICEcoder.draggingTab;
|
||||||
|
for (var i=1; i<=top.ICEcoder.openFiles.length; i++) {
|
||||||
|
top.document.getElementById('tab'+i).style.opacity = i == top.ICEcoder.draggingTab ? 1 : 0.5;
|
||||||
|
tabWidth = top.ICEcoder.tabLeftPos[i] ? top.ICEcoder.tabLeftPos[i] - top.ICEcoder.tabLeftPos[i-1] : tabWidth;
|
||||||
|
if (i!=top.ICEcoder.draggingTab) {
|
||||||
|
if (i < top.ICEcoder.draggingTab) {
|
||||||
|
top.document.getElementById('tab'+i).style.left = thisLeft <= top.ICEcoder.tabLeftPos[i-1]
|
||||||
|
? top.ICEcoder.tabLeftPos[i-1]+tabWidth
|
||||||
|
: top.ICEcoder.tabLeftPos[i-1];
|
||||||
|
} else {
|
||||||
|
top.document.getElementById('tab'+i).style.left = thisLeft >= top.ICEcoder.tabLeftPos[i-1]
|
||||||
|
? top.ICEcoder.tabLeftPos[i-1]-tabWidth
|
||||||
|
: top.ICEcoder.tabLeftPos[i-1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// Tab dragging end
|
||||||
|
tabDragEnd: function() {
|
||||||
|
var swapWith, tempArray;
|
||||||
|
|
||||||
|
top.ICEcoder.setTabWidths();
|
||||||
|
for (var i=1; i<=top.ICEcoder.openFiles.length; i++) {
|
||||||
|
if (top.ICEcoder.thisLeft >= top.ICEcoder.tabLeftPos[i-1]) {
|
||||||
|
swapWith = top.ICEcoder.thisLeft == top.ICEcoder.tabLeftPos[0] ? 1 : top.ICEcoder.dragTabNo > i ? i+1 : i;
|
||||||
|
}
|
||||||
|
top.document.getElementById('tab'+i).className = "tab";
|
||||||
|
top.document.getElementById('tab'+i).style.opacity = 1;
|
||||||
|
if (i!=top.ICEcoder.dragTabNo) {
|
||||||
|
top.document.getElementById('tab'+i).style.zIndex = 1;
|
||||||
|
} else {
|
||||||
|
setTimeout(function() {
|
||||||
|
top.document.getElementById('tab'+i).style.zIndex = 1;
|
||||||
|
},150);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (top.ICEcoder.thisLeft && top.ICEcoder.thisLeft!==false) {
|
||||||
|
tempArray = [];
|
||||||
|
for (var i=1;i<=top.ICEcoder.openFiles.length;i++) {
|
||||||
|
tempArray.push(i);
|
||||||
|
}
|
||||||
|
tempArray.splice(top.ICEcoder.dragTabNo-1,1);
|
||||||
|
tempArray.splice(swapWith-1,0,top.ICEcoder.dragTabNo);
|
||||||
|
ICEcoder.sortTabs(tempArray);
|
||||||
|
}
|
||||||
|
top.ICEcoder.setTabWidths();
|
||||||
|
top.ICEcoder.draggingTab = false;
|
||||||
|
top.ICEcoder.thisLeft = false;
|
||||||
|
},
|
||||||
|
|
||||||
|
// Sort tabs into new order
|
||||||
|
sortTabs: function(newOrder) {
|
||||||
|
var a, b, changedContent = [], openFiles = [], openFileMDTs = [], cMInstances = [], selectedTabWillBe;
|
||||||
|
|
||||||
|
a = [ICEcoder.changedContent, ICEcoder.openFiles, ICEcoder.openFileMDTs, ICEcoder.cMInstances];
|
||||||
|
b = [changedContent, openFiles, openFileMDTs, cMInstances];
|
||||||
|
for (var i=0;i<a.length;i++) {
|
||||||
|
for (var j=0;j<a[i].length;j++) {
|
||||||
|
b[i].push(a[i][newOrder[j]-1]);
|
||||||
|
}
|
||||||
|
a[i] = b[i];
|
||||||
|
}
|
||||||
|
for (var i=0;i<newOrder.length;i++) {
|
||||||
|
document.getElementById('tab'+newOrder[i]).id = "tab" + (i+1) + ".temp";
|
||||||
|
if (top.ICEcoder.selectedTab == newOrder[i]) {
|
||||||
|
selectedTabWillBe = (i+1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (var i=0;i<newOrder.length;i++) {
|
||||||
|
document.getElementById('tab'+(i+1)+'.temp').id = "tab"+(i+1);
|
||||||
|
}
|
||||||
|
if (top.document.getElementById('tab'+selectedTabWillBe)) {
|
||||||
|
top.document.getElementById('tab'+selectedTabWillBe).className = "tab tabSlide";
|
||||||
|
}
|
||||||
|
ICEcoder.changedContent = a[0];
|
||||||
|
ICEcoder.openFiles = a[1];
|
||||||
|
ICEcoder.openFileMDTs = a[2];
|
||||||
|
ICEcoder.cMInstances = a[3];
|
||||||
|
top.ICEcoder.setTabWidths();
|
||||||
|
top.ICEcoder.switchTab(selectedTabWillBe);
|
||||||
|
},
|
||||||
|
|
||||||
|
// Alphabetize tabs
|
||||||
|
alphaTabs: function() {
|
||||||
|
var currentArray, currentArrayFull, alphaArray, nextValue, nextPos;
|
||||||
|
|
||||||
|
currentArray = [];
|
||||||
|
currentArrayFull = [];
|
||||||
|
alphaArray = [];
|
||||||
|
for (var i=0;i<top.ICEcoder.openFiles.length;i++) {
|
||||||
|
currentArray.push(top.ICEcoder.openFiles[i].slice(top.ICEcoder.openFiles[i].lastIndexOf('/')+1));
|
||||||
|
currentArrayFull.push(top.ICEcoder.openFiles[i]);
|
||||||
|
top.document.getElementById('tab'+(i+1)).className = "tab tabSlide";
|
||||||
|
}
|
||||||
|
while (currentArray.length>0) {
|
||||||
|
nextValue = currentArray[0];
|
||||||
|
nextValueFull = currentArrayFull[0];
|
||||||
|
nextPos = 0;
|
||||||
|
for (var i=0;i<currentArray.length;i++) {
|
||||||
|
if (currentArray[i] < nextValue) {
|
||||||
|
nextValue = currentArray[i];
|
||||||
|
nextValueFull = top.ICEcoder.openFiles[top.ICEcoder.openFiles.indexOf(currentArrayFull[i])];
|
||||||
|
nextPos = i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
alphaArray.push((top.ICEcoder.openFiles.indexOf(nextValueFull)+1));
|
||||||
|
currentArray.splice(nextPos,1);
|
||||||
|
currentArrayFull.splice(nextPos,1);
|
||||||
|
}
|
||||||
|
top.ICEcoder.sortTabs(alphaArray);
|
||||||
},
|
},
|
||||||
|
|
||||||
// ==============
|
// ==============
|
||||||
@@ -1856,19 +1993,12 @@ var ICEcoder = {
|
|||||||
lineNo = cM.getCursor().line;
|
lineNo = cM.getCursor().line;
|
||||||
whiteSpace = cM.getLine(lineNo).length - cM.getLine(lineNo).replace(/^\s\s*/, '').length;
|
whiteSpace = cM.getLine(lineNo).length - cM.getLine(lineNo).replace(/^\s\s*/, '').length;
|
||||||
content = cM.getLine(lineNo).slice(whiteSpace);
|
content = cM.getLine(lineNo).slice(whiteSpace);
|
||||||
if (content.slice(0,2)=="f ") {
|
if (content.slice(0,8)=="function") {
|
||||||
top.ICEcoder.doSnippet('f ','function VAR() {\nINDENT\tCURSOR\nINDENT}');
|
top.ICEcoder.doSnippet('function','function VAR() {\nINDENT\tCURSOR\nINDENT}');
|
||||||
} else if (content.slice(0,2)=="if") {
|
} else if (content.slice(0,2)=="if") {
|
||||||
top.ICEcoder.doSnippet('if','if (CURSOR) {\nINDENT\t\nINDENT}');
|
top.ICEcoder.doSnippet('if','if (CURSOR) {\nINDENT\t\nINDENT}');
|
||||||
} else if (content.slice(0,3)=="for") {
|
} else if (content.slice(0,3)=="for") {
|
||||||
top.ICEcoder.doSnippet('for','for (var i=0; i<CURSOR; i++) {\nINDENT\t\nINDENT}');
|
top.ICEcoder.doSnippet('for','for (var i=0; i<CURSOR; i++) {\nINDENT\t\nINDENT}');
|
||||||
} else {
|
|
||||||
cM.operation(function(){
|
|
||||||
var msg = document.createElement("iframe");
|
|
||||||
msg.src = "lib/snippet-display.php";
|
|
||||||
msg.className = "snippetFrame";
|
|
||||||
top.ICEcoder.snippetLine = cM.addLineWidget(cM.getCursor().line, msg, {coverGutter: false, noHScroll: true});
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -1903,16 +2033,5 @@ var ICEcoder = {
|
|||||||
cM.focus();
|
cM.focus();
|
||||||
top.ICEcoder.removeSnippet();
|
top.ICEcoder.removeSnippet();
|
||||||
}
|
}
|
||||||
},
|
|
||||||
|
|
||||||
// Remove snippet panel
|
|
||||||
removeSnippet: function() {
|
|
||||||
var cM;
|
|
||||||
|
|
||||||
cM = ICEcoder.getcMInstance();
|
|
||||||
if (top.ICEcoder.snippetLine!==false) {
|
|
||||||
cM.removeLineWidget(top.ICEcoder.snippetLine);
|
|
||||||
}
|
|
||||||
top.ICEcoder.snippetLine = false;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -2,7 +2,6 @@
|
|||||||
<?php
|
<?php
|
||||||
if(isset($_GET['selectedFiles'])) {
|
if(isset($_GET['selectedFiles'])) {
|
||||||
$selectedFiles=explode(":",strClean($_GET['selectedFiles']));
|
$selectedFiles=explode(":",strClean($_GET['selectedFiles']));
|
||||||
echo $selectedFiles[0].".....".$selectedFiles[1];
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
@@ -124,23 +123,25 @@ if (startTab!=top.ICEcoder.selectedTab) {
|
|||||||
$ret .= phpGrep($q, $fullPath, $base);
|
$ret .= phpGrep($q, $fullPath, $base);
|
||||||
} else if(stristr(file_get_contents($fullPath), $q)) {
|
} else if(stristr(file_get_contents($fullPath), $q)) {
|
||||||
$bFile = false;
|
$bFile = false;
|
||||||
|
$foundInSelFile = false;
|
||||||
for ($i=0;$i<count($ICEcoder['bannedFiles']);$i++) {
|
for ($i=0;$i<count($ICEcoder['bannedFiles']);$i++) {
|
||||||
if (strpos($f,$ICEcoder['bannedFiles'][$i])>0) {$bFile = true;};
|
if (strpos($f,$ICEcoder['bannedFiles'][$i])!==false) {$bFile = true;};
|
||||||
}
|
}
|
||||||
$findPath = str_replace($base,"",$fullPath);
|
$findPath = str_replace($base,"",$fullPath);
|
||||||
for ($i=0;$i<count($selectedFiles);$i++) {
|
for ($i=0;$i<count($selectedFiles);$i++) {
|
||||||
if (strpos($findPath,str_replace("|","/",$selectedFiles[$i]))!==0) {
|
$stringExtra = $selectedFiles[$i] != "|" ? "/" : "";
|
||||||
$bFile = true;
|
if (strpos($findPath.$stringExtra,str_replace("|","/",$selectedFiles[$i]).$stringExtra)===0) {
|
||||||
|
$foundInSelFile = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!$bFile) {
|
if (!$bFile && (count($selectedFiles)==0 || count($selectedFiles)>0 && $foundInSelFile)) {
|
||||||
$ret .= "<a href=\\\"javascript:top.ICEcoder.openFile('".$fullPath."');top.ICEcoder.showHide('hide',top.document.getElementById('blackMask'))\\\">";
|
$ret .= "<a href=\\\"javascript:top.ICEcoder.openFile('".$fullPath."');top.ICEcoder.showHide('hide',top.document.getElementById('blackMask'))\\\">";
|
||||||
$ret .= str_replace($base,"",$fullPath)."</a><div id=\\\"foundCount".$r."\\\">Found ".substr_count(strtolower(file_get_contents($fullPath)),$q)." times</div>";
|
$ret .= str_replace($base,"",$fullPath)."</a><div id=\\\"foundCount".$r."\\\">Found ".substr_count(strtolower(file_get_contents($fullPath)),$q)." times</div>";
|
||||||
if (isset($_GET['replace'])) {
|
if (isset($_GET['replace'])) {
|
||||||
$ret .= "<div class=\\\"replace\\\" id=\\\"replace\\\" onClick=\\\"replaceInFileSingle('".$fullPath."');this.style.display=\'none\'\\\">replace</div>";
|
$ret .= "<div class=\\\"replace\\\" id=\\\"replace\\\" onClick=\\\"replaceInFileSingle('".$fullPath."');this.style.display=\'none\'\\\">replace</div>".PHP_EOL;
|
||||||
};
|
};
|
||||||
$ret .= '<hr>';
|
$ret .= '<hr>';
|
||||||
echo 'foundArray.push("'.$fullPath.'");';
|
echo 'foundArray.push("'.$fullPath.'");'.PHP_EOL;
|
||||||
$r++;
|
$r++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,13 @@ error_reporting(-1);
|
|||||||
// Start a session if we haven't already
|
// Start a session if we haven't already
|
||||||
if(!isset($_SESSION)) {session_start();}
|
if(!isset($_SESSION)) {session_start();}
|
||||||
|
|
||||||
|
// Logout if that's the action we're taking
|
||||||
|
if (isset($_GET['logout'])) {
|
||||||
|
$_SESSION['loggedIn']=false;
|
||||||
|
session_destroy();
|
||||||
|
header("Location: dirname(__FILE__)./?loggedOut");
|
||||||
|
}
|
||||||
|
|
||||||
// Function to handle salted hashing
|
// Function to handle salted hashing
|
||||||
define('SALT_LENGTH',9);
|
define('SALT_LENGTH',9);
|
||||||
function generateHash($plainText,$salt=null) {
|
function generateHash($plainText,$salt=null) {
|
||||||
@@ -38,8 +45,8 @@ 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.6",
|
||||||
"codeMirrorDir" => "CodeMirror-3.0",
|
"codeMirrorDir" => "CodeMirror-3.01",
|
||||||
"demoMode" => false
|
"demoMode" => false
|
||||||
)+$ICEcoder;
|
)+$ICEcoder;
|
||||||
|
|
||||||
@@ -140,15 +147,20 @@ if ($_SESSION['loggedIn'] && isset($_GET["saveFiles"]) && $_GET['saveFiles']) {
|
|||||||
// Replace our previousFiles var with the the current
|
// Replace our previousFiles var with the the current
|
||||||
$repPosStart = strpos($settingsContents,'previousFiles" => "')+20;
|
$repPosStart = strpos($settingsContents,'previousFiles" => "')+20;
|
||||||
$repPosEnd = strpos($settingsContents,'",',$repPosStart)-$repPosStart;
|
$repPosEnd = strpos($settingsContents,'",',$repPosStart)-$repPosStart;
|
||||||
if (!$demoMode && $_GET['saveFiles']!="CLEAR") {
|
if (!$demoMode) {
|
||||||
$saveFiles=strClean($_GET['saveFiles']);
|
if ($_GET['saveFiles']!="CLEAR") {
|
||||||
$saveFilesArray = explode(",",$saveFiles);
|
$saveFiles=strClean($_GET['saveFiles']);
|
||||||
$saveFiles="";
|
$saveFilesArray = explode(",",$saveFiles);
|
||||||
for ($i=0;$i<count($saveFilesArray);$i++) {
|
$saveFiles="";
|
||||||
$saveFilesArray[$i] = str_replace("/","|",$docRoot).$saveFilesArray[$i];
|
for ($i=0;$i<count($saveFilesArray);$i++) {
|
||||||
$saveFiles .= $saveFilesArray[$i].",";
|
$saveFilesArray[$i] = str_replace("/","|",$docRoot).$saveFilesArray[$i];
|
||||||
|
$saveFiles .= $saveFilesArray[$i].",";
|
||||||
|
}
|
||||||
|
$saveFiles = rtrim($saveFiles,",");
|
||||||
|
} else {
|
||||||
|
$saveFilesArray = array();
|
||||||
|
$saveFiles = "";
|
||||||
}
|
}
|
||||||
$saveFiles = rtrim($saveFiles,",");
|
|
||||||
$settingsContents = substr($settingsContents,0,$repPosStart).$saveFiles.substr($settingsContents,($repPosStart+$repPosEnd),strlen($settingsContents));
|
$settingsContents = substr($settingsContents,0,$repPosStart).$saveFiles.substr($settingsContents,($repPosStart+$repPosEnd),strlen($settingsContents));
|
||||||
// Now update the config file
|
// Now update the config file
|
||||||
$fh = fopen($settingsFile, 'w') or die("Can't update config file. Please set public write permissions on lib/".$settingsFile." and press refresh");
|
$fh = fopen($settingsFile, 'w') or die("Can't update config file. Please set public write permissions on lib/".$settingsFile." and press refresh");
|
||||||
@@ -220,8 +232,10 @@ if ($_SESSION['loggedIn']) {
|
|||||||
$onLoadExtras .= ";top.ICEcoder.content.style.visibility='visible'";
|
$onLoadExtras .= ";top.ICEcoder.content.style.visibility='visible'";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((!$_SESSION['loggedIn'] || $ICEcoder["accountPassword"] == "") && !strpos($_SERVER['SCRIPT_NAME'],"lib/settings.php")) {
|
||||||
|
header('Location: lib/settings.php');
|
||||||
// If we're due to show the settings screen
|
// If we're due to show the settings screen
|
||||||
if (!$_SESSION['loggedIn']) {
|
} elseif (!$_SESSION['loggedIn']) {
|
||||||
// If the password hasn't been set and we're setting it
|
// If the password hasn't been set and we're setting it
|
||||||
if ($ICEcoder["accountPassword"] == "" && isset($_POST['accountPassword'])) {
|
if ($ICEcoder["accountPassword"] == "" && isset($_POST['accountPassword'])) {
|
||||||
$password = generateHash(strClean($_POST['accountPassword']));
|
$password = generateHash(strClean($_POST['accountPassword']));
|
||||||
@@ -262,7 +276,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>
|
||||||
@@ -273,8 +287,4 @@ echo $ICEcoder["accountPassword"] == "" ? "Setup" : "Login";
|
|||||||
</html>
|
</html>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((!$_SESSION['loggedIn'] || $ICEcoder["accountPassword"] == "") && !strpos($_SERVER['SCRIPT_NAME'],"lib/settings.php")) {
|
|
||||||
header('Location: lib/settings.php');
|
|
||||||
}
|
|
||||||
?>
|
?>
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
<?php include("lib/settings.php");?>
|
|
||||||
<!DOCTYPE html>
|
|
||||||
|
|
||||||
<html style="margin: 0">
|
|
||||||
<head>
|
|
||||||
<title>ICEcoder v <?php echo $ICEcoder["versionNo"];?> snippet display</title>
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
||||||
<meta name="robots" content="noindex, nofollow">
|
|
||||||
<style type="text/css">
|
|
||||||
body {font-family: arial; font-size: 10px; background: #ccc}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body style="margin: 5px">
|
|
||||||
|
|
||||||
<table border="0" cellpadding="0" cellspacing="0" width="500">
|
|
||||||
<tr valign="top"><td style="padding-bottom: 5px; font-size: 11px"><b>abbreviation plus CTRL+space</td><td style="font-size: 11px"><b>produces</b></td></tr>
|
|
||||||
<tr valign="top"><td>f name</td><td style="padding-bottom: 5px">function name() {...}</td></tr>
|
|
||||||
<tr valign="top"><td>if</td><td style="padding-bottom: 5px">if () {...}</td></tr>
|
|
||||||
<tr valign="top"><td>for</td><td style="padding-bottom: 5px">for (var i=0; i<; i++) {...}</td></tr>
|
|
||||||
</table>
|
|
||||||
<br><br>
|
|
||||||
Tip: If you have Emmet installed, also try tab key after your abbreviation
|
|
||||||
</script>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
|
|
||||||
</html>
|
|
||||||
BIN
plugins/wireframecc/icon.png
Normal file
BIN
plugins/wireframecc/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
Reference in New Issue
Block a user