mirror of
https://github.com/icecoder/ICEcoder.git
synced 2026-03-23 16:57:02 +01:00
Compare commits
104 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8dfad0aa5d | ||
|
|
b07f2e9633 | ||
|
|
6ecc435b85 | ||
|
|
a0a70495f0 | ||
|
|
29981dfd52 | ||
|
|
86735ac3b7 | ||
|
|
e5a1a10101 | ||
|
|
f362a83cfa | ||
|
|
df902fb08e | ||
|
|
29de36f348 | ||
|
|
92e7603aa5 | ||
|
|
e3431f201c | ||
|
|
5c7a6bbf8f | ||
|
|
d6a82d1962 | ||
|
|
a7a5ada4d9 | ||
|
|
6ff50cb42d | ||
|
|
7ffc89f41b | ||
|
|
8c1131442b | ||
|
|
c49acc9084 | ||
|
|
f03cfcb0e3 | ||
|
|
460d7c5aea | ||
|
|
50fd681420 | ||
|
|
70c8ca3a55 | ||
|
|
1234f789a4 | ||
|
|
25fd009be3 | ||
|
|
9ffab47f83 | ||
|
|
38c46f3d5c | ||
|
|
3a0c33c5cf | ||
|
|
5d6b057361 | ||
|
|
8fcbdc8ea0 | ||
|
|
a774f9052d | ||
|
|
2d79b5a988 | ||
|
|
86ae5e14b4 | ||
|
|
8153d4a139 | ||
|
|
3e80d86628 | ||
|
|
a097330772 | ||
|
|
5545743bd8 | ||
|
|
ccd212f839 | ||
|
|
5697625a7d | ||
|
|
3d54005332 | ||
|
|
a5894dfae8 | ||
|
|
b3aa6e37b9 | ||
|
|
e4e7661a3d | ||
|
|
9fe38ad649 | ||
|
|
a8a03a831a | ||
|
|
0df4db9286 | ||
|
|
e4599e3076 | ||
|
|
1a0d8933dc | ||
|
|
00af30281c | ||
|
|
8c85b3098d | ||
|
|
000607f8e0 | ||
|
|
82e3698dd2 | ||
|
|
0dd9535a5b | ||
|
|
088b3f60ea | ||
|
|
c118159121 | ||
|
|
5fad745220 | ||
|
|
02b41bfbdc | ||
|
|
82ab3faca3 | ||
|
|
df74757e83 | ||
|
|
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 |
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
error-log.txt
|
||||||
|
backups/*.zip
|
||||||
|
lib/config.php
|
||||||
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.1/addon/hint/simple-hint.css
Normal file
16
CodeMirror-3.1/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.1/lib/codemirror-compressed.js
Normal file
6
CodeMirror-3.1/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 */
|
||||||
|
|
||||||
@@ -148,6 +148,7 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
|
|||||||
.CodeMirror-gutters {
|
.CodeMirror-gutters {
|
||||||
position: absolute; left: 0; top: 0;
|
position: absolute; left: 0; top: 0;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
padding-bottom: 30px;
|
||||||
z-index: 3;
|
z-index: 3;
|
||||||
}
|
}
|
||||||
.CodeMirror-gutter {
|
.CodeMirror-gutter {
|
||||||
@@ -196,6 +197,11 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
|
|||||||
.CodeMirror-linewidget {
|
.CodeMirror-linewidget {
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.CodeMirror-widget {
|
||||||
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror-wrap .CodeMirror-scroll {
|
.CodeMirror-wrap .CodeMirror-scroll {
|
||||||
@@ -210,20 +216,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 +239,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,10 @@ 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
|
||||||
|
* Tag wrappers
|
||||||
|
* Config template
|
||||||
|
|
||||||
###Installation
|
###Installation
|
||||||
|
|
||||||
@@ -53,7 +57,7 @@ $ git clone git@github:mattpass/ICEcoder
|
|||||||
####Step 2: Upload the files (Linux or Windows hosting OK)
|
####Step 2: Upload the files (Linux or Windows hosting OK)
|
||||||
```
|
```
|
||||||
Upload to a new sub-dir URL such as yourdomain.com/_coder
|
Upload to a new sub-dir URL such as yourdomain.com/_coder
|
||||||
Set public write permissions on the backups folder and lib/config.php file
|
Set public write permissions (757 recommended) on the 'backups' and 'lib' folders
|
||||||
```
|
```
|
||||||
|
|
||||||
####Step 3: Start coding
|
####Step 3: Start coding
|
||||||
|
|||||||
0
backups/.gitkeep
Normal file
0
backups/.gitkeep
Normal file
@@ -1 +0,0 @@
|
|||||||
Zip It! backups are stored in this folder
|
|
||||||
68
editor.php
68
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, closetag
|
||||||
//-->
|
//-->
|
||||||
<script src="<?php echo $ICEcoder["codeMirrorDir"]; ?>/lib/codemirror-compressed.js"></script>
|
<script src="<?php echo $ICEcoder["codeMirrorDir"]; ?>/lib/codemirror-compressed.js"></script>
|
||||||
<?php
|
<?php
|
||||||
@@ -24,22 +25,26 @@ $activeLineBG = $ICEcoder["theme"]=="eclipse" || $ICEcoder["theme"]=="elegant" |
|
|||||||
?>">
|
?>">
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
.CodeMirror {position: absolute; top: 0px; width: 100%; font-size: 13px; z-index: 1}
|
.CodeMirror {position: absolute; top: 0px; width: 100%; font-size: 13px; z-index: 1}
|
||||||
.CodeMirror-scroll {} // was: height: auto; overflow: visible
|
.CodeMirror-scroll {} /* was: height: auto; overflow: visible */
|
||||||
/* Make sure this next one remains the 3rd item, updated with JS */
|
/* Make sure this next one remains the 3rd item, updated with JS */
|
||||||
.cm-s-activeLine {background: <?php echo $activeLineBG;?> !important}
|
.cm-s-activeLine {background: <?php echo $activeLineBG;?> !important}
|
||||||
span.CodeMirror-matchhighlight {background: #555}
|
.cm-matchhighlight, .CodeMirror-focused .cm-matchhighlight {color: #fff !important; background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAFklEQVQI12NgYGBgkKzc8x9CMDAwAAAmhwSbidEoSQAAAABJRU5ErkJggg==); background-position: bottom; background-repeat: repeat-x}
|
||||||
.CodeMirror-focused span.CodeMirror-matchhighlight {color: #000; background: #555; !important}
|
/* Make sure this next one remains the 5th item, updated with JS */
|
||||||
/* Make sure this next one remains the 6th item, updated with JS */
|
|
||||||
.cm-tab:after {position: relative; display: inline-block; width: 0; left: -1.4em; overflow: visible; color: #aaa; content: "<?php if($ICEcoder["visibleTabs"]) {echo '\\21e5';};?>";}
|
.cm-tab:after {position: relative; display: inline-block; width: 0; left: -1.4em; overflow: visible; color: #aaa; content: "<?php if($ICEcoder["visibleTabs"]) {echo '\\21e5';};?>";}
|
||||||
.lint-error {font-family: arial; font-size: 80%; background: #ccc; color: #b00; padding: 3px 5px}
|
.lint-error {font-family: arial; font-size: 80%; background: #ccc; color: #b00; padding: 3px 5px}
|
||||||
.lint-error-icon {background-color: #b00; color: #fff; font-weight: bold; border-radius: 50%; padding: 0 3px; margin-right: 5px}
|
.lint-error-icon {background-color: #b00; color: #fff; font-weight: bold; border-radius: 50%; padding: 0 3px; margin-right: 5px}
|
||||||
.snippetFrame {border: 1px; width: 100%}
|
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body onLoad="top.ICEcoder.updateFileFolderCount()" style="color: #fff; margin: 0" onKeyDown="return top.ICEcoder.interceptKeys('content', event);" onKeyUp="top.ICEcoder.resetKeys(event);">
|
<body onLoad="top.ICEcoder.updateFileFolderCount()" style="color: #fff; margin: 0" onKeyDown="return top.ICEcoder.interceptKeys('content', event);" onKeyUp="top.ICEcoder.resetKeys(event);">
|
||||||
|
|
||||||
<div style="margin: 32px 43px; font-family: arial; font-size: 10px; color: #ddd">
|
<?php if ($ICEcoder['demoMode']) {?>
|
||||||
|
<div style="position: absolute; display: inline-block; width: 99px; height: 50px; top: 0; right: 30px; background: url('images/big-arrow.gif') 0 -10px no-repeat; text-align: center; font-family: arial; font-size: 10px; padding-top: 60px"><b>Click logo<br>for help &<br>usage info</b></div>
|
||||||
|
<?php ;}; ?>
|
||||||
|
|
||||||
|
<div style="display: none; margin: 32px 43px 0 43px; padding: 10px; width: 500px; font-family: arial; font-size: 10px; color: #ddd; background: #333" id="dataMessage"></div>
|
||||||
|
|
||||||
|
<div style="margin: 20px 43px 32px 43px; font-family: arial; font-size: 10px; color: #ddd">
|
||||||
<div style="float: left; margin-right: 50px">
|
<div style="float: left; margin-right: 50px">
|
||||||
<h2 style="color: rgba(0,198,255,0.7)">server</h2>
|
<h2 style="color: rgba(0,198,255,0.7)">server</h2>
|
||||||
<span style="color:#888">Server name, OS & IP:</span><br>
|
<span style="color:#888">Server name, OS & IP:</span><br>
|
||||||
@@ -101,10 +106,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];
|
||||||
@@ -119,6 +128,8 @@ function createNewCMInstance(num) {
|
|||||||
tabSize: top.ICEcoder.tabWidth,
|
tabSize: top.ICEcoder.tabWidth,
|
||||||
indentWithTabs: true,
|
indentWithTabs: true,
|
||||||
electricChars: false,
|
electricChars: false,
|
||||||
|
autoCloseTags: true,
|
||||||
|
highlightSelectionMatches: true,
|
||||||
keyMap: "ICEcoder",
|
keyMap: "ICEcoder",
|
||||||
onKeyEvent: function(thisCM, e) {
|
onKeyEvent: function(thisCM, e) {
|
||||||
top.ICEcoder.redoChangedContent(e);
|
top.ICEcoder.redoChangedContent(e);
|
||||||
@@ -126,42 +137,6 @@ function createNewCMInstance(num) {
|
|||||||
top.ICEcoder.getCaretPosition();
|
top.ICEcoder.getCaretPosition();
|
||||||
top.ICEcoder.updateCharDisplay();
|
top.ICEcoder.updateCharDisplay();
|
||||||
tok = thisCM.getTokenAt(thisCM.getCursor());
|
tok = thisCM.getTokenAt(thisCM.getCursor());
|
||||||
if (tok.string!=">") {lastString=tok.string};
|
|
||||||
if (e.type=="keyup"&&e.keyCode=="16"&&lastKeyCode=="190") {
|
|
||||||
canDoEndTag=true;
|
|
||||||
if (top.ICEcoder.tagString!="script" && top.ICEcoder.tagNestExceptions.indexOf(top.ICEcoder.tagString)>-1) {
|
|
||||||
canDoEndTag=false;
|
|
||||||
}
|
|
||||||
if (
|
|
||||||
top.ICEcoder.tagString.slice(0,1)=="/"||
|
|
||||||
top.ICEcoder.tagString.slice(0,1)=="?"||
|
|
||||||
!top.ICEcoder.codeAssist||
|
|
||||||
fileName && (fileName.indexOf(".js")>0||fileName.indexOf(".css")>0||fileName.indexOf(".less")>0)
|
|
||||||
) {canDoEndTag=false}
|
|
||||||
|
|
||||||
contentType = top.ICEcoder.caretLocType;
|
|
||||||
if (canDoEndTag && (contentType!="JavaScript"||(contentType=="JavaScript"&&top.ICEcoder.tagString=="script"))) {
|
|
||||||
numTabs = top.ICEcoder.htmlTagArray.length;
|
|
||||||
if (top.ICEcoder.htmlTagArray[0]=="html") {numTabs--};
|
|
||||||
tabs = "";
|
|
||||||
for (i=0;i<numTabs-1;i++) {
|
|
||||||
tabs += "\t";
|
|
||||||
}
|
|
||||||
endTag = "</" + top.ICEcoder.tagString + ">";
|
|
||||||
if (top.ICEcoder.tagString=="script") {endTag="</"+"script>"};
|
|
||||||
if(top.ICEcoder.tagString=="title"||top.ICEcoder.tagString=="a"||top.ICEcoder.tagString=="li"||top.ICEcoder.tagString=="span"||(top.ICEcoder.tagString.slice(0,1)=="h"&&parseInt(top.ICEcoder.tagString.slice(1,2),10)>=1&&parseInt(top.ICEcoder.tagString.slice(1,2),10)<=7)) {
|
|
||||||
thisCM.replaceSelection(endTag);
|
|
||||||
thisCM.setCursor(thisCM.getCursor().line,thisCM.getCursor().ch-top.ICEcoder.tagString.length-3);
|
|
||||||
} else if(top.ICEcoder.tagString=="html"||top.ICEcoder.tagString=="head") {
|
|
||||||
thisCM.replaceSelection("\n\n"+endTag);
|
|
||||||
thisCM.setCursor(thisCM.getCursor().line-1,numTabs);
|
|
||||||
} else {
|
|
||||||
thisCM.replaceSelection("\n"+tabs+"\t\n"+tabs+endTag);
|
|
||||||
thisCM.setCursor(thisCM.getCursor().line-1,numTabs);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
lastKeyCode = e.keyCode;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -172,7 +147,6 @@ function createNewCMInstance(num) {
|
|||||||
if(!window['cM'+num].somethingSelected()) {
|
if(!window['cM'+num].somethingSelected()) {
|
||||||
top.ICEcoder['cMActiveLine'+num] = window['cM'+num].addLineClass(window['cM'+num].getCursor().line, "background","cm-s-activeLine");
|
top.ICEcoder['cMActiveLine'+num] = window['cM'+num].addLineClass(window['cM'+num].getCursor().line, "background","cm-s-activeLine");
|
||||||
}
|
}
|
||||||
thisCM.matchHighlight("CodeMirror-matchhighlight");
|
|
||||||
top.ICEcoder.cssColorPreview();
|
top.ICEcoder.cssColorPreview();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
137
files.php
137
files.php
@@ -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">
|
||||||
@@ -9,87 +9,11 @@
|
|||||||
<script src="lib/ice-coder.js" type="text/javascript"></script>
|
<script src="lib/ice-coder.js" type="text/javascript"></script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body onLoad="top.ICEcoder.fileManager()" onDblClick="top.ICEcoder.openFile()" onKeyDown="return top.ICEcoder.interceptKeys('files', event);" onKeyUp="top.ICEcoder.resetKeys(event);">
|
<body onDblClick="top.ICEcoder.openFile()" onKeyDown="return top.ICEcoder.interceptKeys('files', event);" onKeyUp="top.ICEcoder.resetKeys(event);">
|
||||||
|
|
||||||
<div title="Refresh" onClick="top.ICEcoder.refreshFileManager()" class="refresh"></div>
|
<div title="Refresh" onClick="top.ICEcoder.refreshFileManager()" class="refresh"></div>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
// Function to sort given values alphabetically
|
|
||||||
function alphasort($a, $b) {
|
|
||||||
return strcasecmp($a->getPathname(), $b->getPathname());
|
|
||||||
}
|
|
||||||
|
|
||||||
// Class to put forward the values for sorting
|
|
||||||
class SortingIterator implements IteratorAggregate {
|
|
||||||
private $iterator = null;
|
|
||||||
public function __construct(Traversable $iterator, $callback) {
|
|
||||||
$array = iterator_to_array($iterator);
|
|
||||||
usort($array, $callback);
|
|
||||||
$this->iterator = new ArrayIterator($array);
|
|
||||||
}
|
|
||||||
public function getIterator() {
|
|
||||||
return $this->iterator;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class IgnorantRecursiveDirectoryIterator extends RecursiveDirectoryIterator {
|
|
||||||
function getChildren() {
|
|
||||||
try {
|
|
||||||
if (!isset($GLOBALS['ICEcoder']['bannedPaths']) ||
|
|
||||||
!in_array($this->key(), $GLOBALS['ICEcoder']['bannedPaths'])) {
|
|
||||||
return parent::getChildren();
|
|
||||||
} else {
|
|
||||||
return new RecursiveArrayIterator(array());
|
|
||||||
}
|
|
||||||
} catch(UnexpectedValueException $e) {
|
|
||||||
return new RecursiveArrayIterator(array());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get a full list of dirs & files and begin sorting using above class & function
|
|
||||||
$objectList = new SortingIterator(new RecursiveIteratorIterator(new IgnorantRecursiveDirectoryIterator($docRoot.$iceRoot), RecursiveIteratorIterator::SELF_FIRST), 'alphasort');
|
|
||||||
|
|
||||||
// With that done, create arrays for out final ordered list and a temp container of files
|
|
||||||
$finalArray = $tempArray = array();
|
|
||||||
|
|
||||||
// To start, push folders from object into finalArray, files into tempArray
|
|
||||||
foreach ($objectList as $objectRef) {
|
|
||||||
$fileFolderName = substr($objectRef->getPathname(), strlen($docRoot.$iceRoot));
|
|
||||||
$canAdd = true;
|
|
||||||
for ($i=0;$i<count($_SESSION['bannedFiles']);$i++) {
|
|
||||||
if(strpos($fileFolderName,$_SESSION['bannedFiles'][$i])!==false) {$canAdd = false;}
|
|
||||||
}
|
|
||||||
if ($objectRef->getFilename()!="." && $objectRef->getFilename()!=".." && $fileFolderName[strlen($fileFolderName)-1]!="/" && $canAdd) {
|
|
||||||
$fileFolderName!="/" && is_dir($docRoot.$iceRoot.$fileFolderName)
|
|
||||||
? array_push($finalArray,$fileFolderName)
|
|
||||||
: array_push($tempArray,$fileFolderName);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Now push root files onto the end of finalArray and splice from the temp, leaving only files that reside in subdirs
|
|
||||||
for ($i=0;$i<count($tempArray);$i++) {
|
|
||||||
if (count(explode("/",$tempArray[$i]))==2) {
|
|
||||||
array_push($finalArray,$tempArray[$i]);
|
|
||||||
array_splice($tempArray,$i,1);
|
|
||||||
$i--;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Lastly we push remaining files into the right subdirs in finalArray
|
|
||||||
for ($i=0;$i<count($tempArray);$i++) {
|
|
||||||
$insertAt = array_search(dirname($tempArray[$i]),$finalArray)+1;
|
|
||||||
for ($j=$insertAt;$j<count($finalArray);$j++) {
|
|
||||||
if ( strcasecmp(dirname($finalArray[$j]), dirname($tempArray[$i]))==0 &&
|
|
||||||
strcasecmp(basename($finalArray[$j]), basename($tempArray[$i]))<0 ||
|
|
||||||
(strpos(dirname($finalArray[$j]),dirname($tempArray[$i]))===0 && substr($finalArray[$j],strlen(dirname($tempArray[$i])),1)=="/")) {
|
|
||||||
$insertAt++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
array_splice($finalArray, $insertAt, 0, $tempArray[$i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Finally, we have our ordered list, so display in a UL
|
|
||||||
$fileAtts = "";
|
$fileAtts = "";
|
||||||
if ($serverType=="Linux") {
|
if ($serverType=="Linux") {
|
||||||
$chmodInfo = substr(sprintf('%o', fileperms($docRoot.$iceRoot)), -3);
|
$chmodInfo = substr(sprintf('%o', fileperms($docRoot.$iceRoot)), -3);
|
||||||
@@ -97,8 +21,8 @@ if ($serverType=="Linux") {
|
|||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<ul class="fileManager">
|
<ul class="fileManager">
|
||||||
<li class="pft-directory">
|
<li class="pft-directory dirOpen">
|
||||||
<a nohref title="/" onMouseOver="top.ICEcoder.overFileFolder('folder','/')" onMouseOut="top.ICEcoder.overFileFolder('folder','')" style="position: relative; left:-22px">
|
<a nohref title="/" onMouseOver="top.ICEcoder.overFileFolder('folder','/')" onMouseOut="top.ICEcoder.overFileFolder('folder','')" onClick="top.ICEcoder.openCloseDir(this)" style="position: relative; left:-22px">
|
||||||
|
|
||||||
<span id="|">/
|
<span id="|">/
|
||||||
<?php echo $iceRoot == "" ? "[ROOT]" : trim($iceRoot,"/");?>
|
<?php echo $iceRoot == "" ? "[ROOT]" : trim($iceRoot,"/");?>
|
||||||
@@ -107,47 +31,20 @@ if ($serverType=="Linux") {
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<?php
|
<?php
|
||||||
$lastPath="";
|
include("lib/get-branch.php");
|
||||||
$fileCount=0;
|
?>
|
||||||
$fileBytes=0;
|
</ul>
|
||||||
$dirCount=0;
|
|
||||||
for ($i=0;$i<count($finalArray);$i++) {
|
|
||||||
$fileFolderName = str_replace("\\","/",$finalArray[$i]);
|
|
||||||
$type = is_dir($docRoot.$iceRoot.$fileFolderName) ? "folder" : "file";
|
|
||||||
$type=="folder" ? $dirCount++ : $fileCount++;
|
|
||||||
if ($type=="file") {
|
|
||||||
$fileBytes+=filesize($docRoot.$iceRoot.$fileFolderName);
|
|
||||||
// Get extension (prefix 'ext-' to prevent invalid classes from extensions that begin with numbers)
|
|
||||||
$ext = "ext-".pathinfo($docRoot.$iceRoot.$fileFolderName, PATHINFO_EXTENSION);
|
|
||||||
}
|
|
||||||
$thisDepth = count(explode("/",$fileFolderName));
|
|
||||||
$lastDepth = count(explode("/",$lastPath));
|
|
||||||
if ($thisDepth > $lastDepth) {echo "<ul>\n";}
|
|
||||||
if ($thisDepth < $lastDepth) {
|
|
||||||
for ($j=$lastDepth;$j>$thisDepth;$j--) {
|
|
||||||
echo "</ul>\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ($serverType=="Linux") {
|
|
||||||
$chmodInfo = substr(sprintf('%o', fileperms($docRoot.$iceRoot.$fileFolderName)), -3);
|
|
||||||
$fileAtts = '<span style="color: #888; font-size: 8px" id="'.str_replace($docRoot,"",str_replace("/","|",$fileFolderName)).'_perms">'.$chmodInfo.'</span>';
|
|
||||||
}
|
|
||||||
$type == "folder" ? $class = 'pft-directory' : $class = 'pft-file '.strtolower($ext);
|
|
||||||
echo "<li class=\"".$class."\"><a nohref title=\"$fileFolderName\" onMouseOver=\"top.ICEcoder.overFileFolder('$type','".str_replace($docRoot,"",str_replace("/","|",$fileFolderName))."')\" onMouseOut=\"top.ICEcoder.overFileFolder('$type','')\" style=\"position: relative; left:-22px\"> <span id=\"".str_replace($docRoot,"",str_replace("/","|",$fileFolderName))."\">".basename($fileFolderName)."</span> ".$fileAtts."</a>\n";
|
|
||||||
if ($i<count($finalArray)) {echo "</li>\n";}
|
|
||||||
$lastPath = $fileFolderName;
|
|
||||||
}
|
|
||||||
echo "</ul>\n</ul>\n";
|
|
||||||
|
|
||||||
// Output the JS vars
|
<?php
|
||||||
echo "<script>\n";
|
// Output the JS vars
|
||||||
echo "top.ICEcoder.dirCount=";
|
echo "<script>\n";
|
||||||
echo $dirCount ? $dirCount : "0";
|
echo "top.ICEcoder.dirCount=";
|
||||||
echo ";\ntop.ICEcoder.fileCount=";
|
echo $dirCount ? $dirCount : "0";
|
||||||
echo $fileCount ? $fileCount : "0";
|
echo ";\ntop.ICEcoder.fileCount=";
|
||||||
echo ";\ntop.ICEcoder.fileBytes=";
|
echo $fileCount ? $fileCount : "0";
|
||||||
echo $fileBytes ? $fileBytes : "0";
|
echo ";\ntop.ICEcoder.fileBytes=";
|
||||||
echo ";\n</script>";
|
echo $fileBytes ? $fileBytes : "0";
|
||||||
|
echo ";\n</script>";
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<iframe name="fileControl" style="display: none"></iframe>
|
<iframe name="fileControl" style="display: none"></iframe>
|
||||||
|
|||||||
BIN
images/big-arrow.gif
Normal file
BIN
images/big-arrow.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 430 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
@@ -1,4 +1,3 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<?php include("lib/settings.php");
|
<?php include("lib/settings.php");
|
||||||
|
|
||||||
// Check IP permissions
|
// Check IP permissions
|
||||||
@@ -9,15 +8,16 @@ if (!in_array($_SERVER["REMOTE_ADDR"], $_SESSION['allowedIPs']) && !in_array("*"
|
|||||||
$updateMsg = '';
|
$updateMsg = '';
|
||||||
// Check for updates
|
// Check for updates
|
||||||
if ($ICEcoder["checkUpdates"]) {
|
if ($ICEcoder["checkUpdates"]) {
|
||||||
$icv = json_encode(file_get_contents("http://icecoder.net/latest-version.txt"));
|
$icv = explode("\n",file_get_contents("http://icecoder.net/latest-version?thisVersion=".$ICEcoder["versionNo"]));
|
||||||
|
$icv = $icv[0];
|
||||||
$icv = rtrim(ltrim($icv,'"'),'"\\n');
|
$icv = rtrim(ltrim($icv,'"'),'"\\n');
|
||||||
if ($ICEcoder["versionNo"]<$icv) {
|
if ($ICEcoder["versionNo"]<$icv) {
|
||||||
$updateMsg = ';top.ICEcoder.message(\'ICEcoder '.$icv.' now released\n\nPlease upgrade\')';
|
$updateMsg = ";top.ICEcoder.dataMessage('<b>UPDATE INFO:</b> ICEcoder v ".$icv." now available. (Your version is v ".$ICEcoder["versionNo"]."). Get it free from <a href=\\'http://icecoder.net\\' target=\\'_blank\\' style=\\'color:#ddd\\'>icecoder.net</a>');";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
<!DOCTYPE html>
|
||||||
<html onMouseDown="top.ICEcoder.mouseDown=true" onMouseUp="top.ICEcoder.mouseDown=false" onMouseMove="if(top.ICEcoder) {top.ICEcoder.getMouseXY(event,'top');top.ICEcoder.canResizeFilesW()}">
|
<html onMouseDown="top.ICEcoder.mouseDown=true" onMouseUp="top.ICEcoder.mouseDown=false;top.ICEcoder.tabDragEnd()" 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">
|
||||||
@@ -25,7 +25,7 @@ if ($ICEcoder["checkUpdates"]) {
|
|||||||
<link rel="stylesheet" type="text/css" href="lib/ice-coder.css">
|
<link rel="stylesheet" type="text/css" href="lib/ice-coder.css">
|
||||||
<link rel="icon" type="image/png" href="favicon.png">
|
<link rel="icon" type="image/png" href="favicon.png">
|
||||||
<script>
|
<script>
|
||||||
iceRoot = "<?php echo $ICEcoder["root"]; ?>";
|
iceRoot = "<?php echo $ICEcoder['root']; ?>";
|
||||||
|
|
||||||
window.onbeforeunload = function() {
|
window.onbeforeunload = function() {
|
||||||
if (top.ICEcoder.changedContent.indexOf(1)>-1) {
|
if (top.ICEcoder.changedContent.indexOf(1)>-1) {
|
||||||
@@ -82,7 +82,7 @@ if (file_exists(dirname(__FILE__)."/plugins/jshint/jshint.js")) {
|
|||||||
<span id="folderMenuItems">
|
<span id="folderMenuItems">
|
||||||
<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()" id="fmMenuPasteOption" style="display: none">Paste</a>
|
||||||
<a href="javascript:top.ICEcoder.uploadFilesSelect(top.ICEcoder.rightClickedFile)" onMouseOver="ICEcoder.showFileMenu()">Upload File(s)</a>
|
<a href="javascript:top.ICEcoder.uploadFilesSelect(top.ICEcoder.rightClickedFile)" onMouseOver="ICEcoder.showFileMenu()">Upload File(s)</a>
|
||||||
<div style="display: none">
|
<div style="display: none">
|
||||||
<form enctype="multipart/form-data" id="uploadFilesForm" action="lib/file-control.php?action=upload&file=/uploaded" method="POST" target="fileControl">
|
<form enctype="multipart/form-data" id="uploadFilesForm" action="lib/file-control.php?action=upload&file=/uploaded" method="POST" target="fileControl">
|
||||||
@@ -130,12 +130,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"></a>
|
<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",
|
||||||
@@ -34,7 +34,7 @@
|
|||||||
.cm-s-icecoder span.cm-link {color: #ff0}
|
.cm-s-icecoder span.cm-link {color: #ff0}
|
||||||
|
|
||||||
.cm-s-icecoder .CodeMirror-cursor {border-left: 1px solid white !important}
|
.cm-s-icecoder .CodeMirror-cursor {border-left: 1px solid white !important}
|
||||||
.cm-s-icecoder .CodeMirror-selected {background: #037 !important}
|
.cm-s-icecoder .CodeMirror-selected {color: #fff !important; background: #037 !important}
|
||||||
.cm-s-icecoder .CodeMirror-gutters {background: #333; width: 41px; text-align: right; border-right: 1px solid #ccc}
|
.cm-s-icecoder .CodeMirror-gutters {background: #333; width: 41px; text-align: right; border-right: 1px solid #ccc}
|
||||||
.cm-s-icecoder .CodeMirror-linenumber {color: #999; cursor: default}
|
.cm-s-icecoder .CodeMirror-linenumber {color: #999; cursor: default}
|
||||||
.cm-s-icecoder .CodeMirror-matchingbracket {border: 1px solid grey; color: black !important}
|
.cm-s-icecoder .CodeMirror-matchingbracket {border: 1px solid grey; color: black !important}
|
||||||
@@ -23,12 +23,12 @@ if ($_GET['action']=="load") {
|
|||||||
if (file_exists($file)) {
|
if (file_exists($file)) {
|
||||||
// Determine what to do based on mime type
|
// Determine what to do based on mime type
|
||||||
$finfo = finfo_open(FILEINFO_MIME_TYPE);
|
$finfo = finfo_open(FILEINFO_MIME_TYPE);
|
||||||
if (strpos(finfo_file($finfo, $file),"text")===0) {
|
if (strpos(finfo_file($finfo, $file),"text")===0 || strpos(finfo_file($finfo, $file),"empty")!==false) {
|
||||||
echo '<script>fileType="text";';
|
echo '<script>fileType="text";';
|
||||||
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 {
|
||||||
@@ -103,7 +103,7 @@ if ($_GET['action']=="upload") {
|
|||||||
$this->uploadFile=$uploadDir.$current->name;
|
$this->uploadFile=$uploadDir.$current->name;
|
||||||
$fileName = $current->name;
|
$fileName = $current->name;
|
||||||
if ($this->upload($current,$this->uploadFile)) {
|
if ($this->upload($current,$this->uploadFile)) {
|
||||||
echo '<script>action="upload"; top.ICEcoder.updateFileManagerList(\'add\',top.ICEcoder.rightClickedFile.replace(/\|/g,\'/\'),\''.$fileName.'\');</script>';
|
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 {
|
} else {
|
||||||
echo "<script>action='nothing'; top.ICEcoder.message('Sorry, cannot upload \\n".$fileName."\\n into \\n'+top.ICEcoder.rightClickedFile.replace(/\|/g,'/'))</script>";
|
echo "<script>action='nothing'; top.ICEcoder.message('Sorry, cannot upload \\n".$fileName."\\n into \\n'+top.ICEcoder.rightClickedFile.replace(/\|/g,'/'))</script>";
|
||||||
}
|
}
|
||||||
@@ -135,18 +135,25 @@ if ($_GET['action']=="upload") {
|
|||||||
echo "<script>action='nothing'; top.ICEcoder.message('Sorry, cannot upload whilst in demo mode');</script>";
|
echo "<script>action='nothing'; top.ICEcoder.message('Sorry, cannot upload whilst in demo mode');</script>";
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "<script>top.ICEcoder.selectedFiles=[];top.ICEcoder.hideFileMenu();top.ICEcoder.showHide('hide',top.document.getElementById('loadingMask'));</script>";
|
echo "<script>top.ICEcoder.hideFileMenu();top.document.getElementById('fileInput').value='';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>';
|
||||||
}
|
}
|
||||||
|
|||||||
87
lib/get-branch.php
Normal file
87
lib/get-branch.php
Normal file
@@ -0,0 +1,87 @@
|
|||||||
|
<?php
|
||||||
|
if (!isset($ICEcoder['root'])) {
|
||||||
|
include("settings.php");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$_SESSION['loggedIn']) {
|
||||||
|
header("Location: ../");
|
||||||
|
}
|
||||||
|
$lastPath="";
|
||||||
|
$fileCount=0;
|
||||||
|
$fileBytes=0;
|
||||||
|
$dirCount=0;
|
||||||
|
?>
|
||||||
|
<div id="branch">
|
||||||
|
<?php
|
||||||
|
// If we're just getting a branch, get that and set as the finalArray
|
||||||
|
$scanDir = $docRoot.$iceRoot;
|
||||||
|
$location = "";
|
||||||
|
if (isset($_GET['location'])) {
|
||||||
|
$location = str_replace("|","/",$_GET['location']);
|
||||||
|
}
|
||||||
|
|
||||||
|
$dirArray = $filesArray = $finalArray = array();
|
||||||
|
$finalArray = scanDir($scanDir.$location);
|
||||||
|
foreach($finalArray as $entry) {
|
||||||
|
$canAdd = true;
|
||||||
|
for ($i=0;$i<count($_SESSION['bannedFiles']);$i++) {
|
||||||
|
if(strpos($entry,$_SESSION['bannedFiles'][$i])!==false) {$canAdd = false;}
|
||||||
|
}
|
||||||
|
if ($entry != "." && $entry != ".." && $canAdd) {
|
||||||
|
is_dir($docRoot.$iceRoot.$location."/".$entry)
|
||||||
|
? array_push($dirArray,$location."/".$entry)
|
||||||
|
: array_push($filesArray,$location."/".$entry);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
natcasesort($dirArray);
|
||||||
|
natcasesort($filesArray);
|
||||||
|
$finalArray = array_merge($dirArray,$filesArray);
|
||||||
|
|
||||||
|
for ($i=0;$i<count($finalArray);$i++) {
|
||||||
|
$fileFolderName = str_replace("\\","/",$finalArray[$i]);
|
||||||
|
$type = is_dir($docRoot.$iceRoot.$fileFolderName) ? "folder" : "file";
|
||||||
|
$type=="folder" ? $dirCount++ : $fileCount++;
|
||||||
|
if ($type=="file") {
|
||||||
|
$fileBytes+=filesize($docRoot.$iceRoot.$fileFolderName);
|
||||||
|
// Get extension (prefix 'ext-' to prevent invalid classes from extensions that begin with numbers)
|
||||||
|
$ext = "ext-".pathinfo($docRoot.$iceRoot.$fileFolderName, PATHINFO_EXTENSION);
|
||||||
|
}
|
||||||
|
$thisDepth = count(explode("/",$fileFolderName));
|
||||||
|
$lastDepth = count(explode("/",$lastPath));
|
||||||
|
$ulDisplay = $i==0 ? ' style="display: block"' : ' style="display: none"';
|
||||||
|
if ($thisDepth > $lastDepth) {echo "<ul".$ulDisplay.">\n";}
|
||||||
|
if ($thisDepth < $lastDepth) {
|
||||||
|
for ($j=$lastDepth;$j>$thisDepth;$j--) {
|
||||||
|
echo "</ul>\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($serverType=="Linux") {
|
||||||
|
$chmodInfo = substr(sprintf('%o', fileperms($docRoot.$iceRoot.$fileFolderName)), -3);
|
||||||
|
$fileAtts = '<span style="color: #888; font-size: 8px" id="'.str_replace($docRoot,"",str_replace("/","|",$fileFolderName)).'_perms">'.$chmodInfo.'</span>';
|
||||||
|
}
|
||||||
|
$type == "folder" ? $class = 'pft-directory' : $class = 'pft-file '.strtolower($ext);
|
||||||
|
$loadParam = $type == "folder" ? "true" : "false";
|
||||||
|
echo "<li class=\"".$class."\"><a nohref title=\"$fileFolderName\" onMouseOver=\"top.ICEcoder.overFileFolder('$type','".str_replace($docRoot,"",str_replace("/","|",$fileFolderName))."')\" onMouseOut=\"top.ICEcoder.overFileFolder('$type','')\" onClick=\"top.ICEcoder.openCloseDir(this,$loadParam)\" style=\"position: relative; left:-22px\"> <span id=\"".str_replace($docRoot,"",str_replace("/","|",$fileFolderName))."\">".basename($fileFolderName)."</span> ".$fileAtts."</a>\n";
|
||||||
|
if ($i<count($finalArray)) {echo "</li>\n";}
|
||||||
|
$lastPath = $fileFolderName;
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
<?php
|
||||||
|
if (isset($_GET['location'])) {
|
||||||
|
?>
|
||||||
|
<script>
|
||||||
|
targetElem = top.ICEcoder.filesFrame.contentWindow.document.getElementById('<?php echo $_GET['location'];?>');
|
||||||
|
newUL = document.createElement("ul");
|
||||||
|
newUL.style = "display: block";
|
||||||
|
locNest = targetElem.parentNode.parentNode;
|
||||||
|
if(locNest.nextSibling.tagName=="UL") {
|
||||||
|
x = locNest.nextSibling;
|
||||||
|
x.parentNode.removeChild(x);
|
||||||
|
}
|
||||||
|
newUL.innerHTML = document.getElementById('branch').innerHTML.slice(29).slice(0,-6);
|
||||||
|
locNest.parentNode.insertBefore(newUL,locNest.nextSibling);
|
||||||
|
</script>
|
||||||
|
<?php
|
||||||
|
;};
|
||||||
|
?>
|
||||||
@@ -27,6 +27,6 @@ h1 {font-size: 36px; font-weight: normal; color: #888; margin-bottom: 20px}
|
|||||||
a {color: #fff; text-decoration: none}
|
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}
|
.key {display: inline-block; width: 175px; text-align: right; margin-right: 5px; float: left}
|
||||||
.help .key .plus {color: #888}
|
.key .plus {color: #888}
|
||||||
.help .shortcut {display: inline-block; width: 175px; color: #888; margin-left: 5px; float: left}
|
.shortcut {display: inline-block; width: 175px; color: #888; margin-left: 5px; float: left}
|
||||||
62
lib/help.php
62
lib/help.php
@@ -15,32 +15,48 @@
|
|||||||
|
|
||||||
<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>
|
<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>
|
<div style="display: inline-block; width: 365px; margin-right: 20px">
|
||||||
<span class="key">Delete</span> <span class="shortcut">Delete file</span><br><br>
|
<h2>Within file manager</h2>
|
||||||
|
<span class="key">Left click</span> <span class="shortcut">Select file / folder</span><br>
|
||||||
|
<span class="key">Double click</span> <span class="shortcut">Open file</span><br>
|
||||||
|
<span class="key">CTRL <span class="plus">+</span> click</span> <span class="shortcut">Multiple select</span><br>
|
||||||
|
<span class="key">Right click</span> <span class="shortcut">Options for selected</span><br>
|
||||||
|
<span class="key">Delete</span> <span class="shortcut">Delete selected</span><br><br><br>
|
||||||
|
|
||||||
<h2>Within document</h2>
|
<h2>Within document</h2>
|
||||||
<span class="key">CTRL <span class="plus">+</span> ↑</span> <span class="shortcut">Move line up</span><br>
|
<span class="key">CTRL <span class="plus">+</span> ↑</span> <span class="shortcut">Move line up</span><br>
|
||||||
<span class="key">CTRL <span class="plus">+</span> ↓</span> <span class="shortcut">Move line down</span><br>
|
<span class="key">CTRL <span class="plus">+</span> ↓</span> <span class="shortcut">Move line down</span><br>
|
||||||
<span class="key">CTRL <span class="plus">+</span> I</span> <span class="shortcut">Search selected text</span><br>
|
<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">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>
|
<span class="key">Tab</span> <span class="shortcut">Insert tab / indent selected text</span><br>
|
||||||
|
<span class="key">CTRL <span class="plus">+</span> Alt <span class="plus">+</span> d</span> <span class="shortcut">Wrap selected in <div></span><br>
|
||||||
|
<span class="key">CTRL <span class="plus">+</span> Alt <span class="plus">+</span> s</span> <span class="shortcut">Wrap selected in <span></span><br>
|
||||||
|
<span class="key">CTRL <span class="plus">+</span> Alt <span class="plus">+</span> p</span> <span class="shortcut">Wrap selected in <p></span><br>
|
||||||
|
<span class="key">CTRL <span class="plus">+</span> Alt <span class="plus">+</span> a</span> <span class="shortcut">Wrap selected in <a></span><br>
|
||||||
|
<span class="key">CTRL <span class="plus">+</span> Alt <span class="plus">+</span> b</span> <span class="shortcut">Wrap selected in <b></span><br>
|
||||||
|
<span class="key">CTRL <span class="plus">+</span> Alt <span class="plus">+</span> i</span> <span class="shortcut">Wrap selected in <i></span><br>
|
||||||
|
<span class="key">CTRL <span class="plus">+</span> Alt <span class="plus">+</span> g</span> <span class="shortcut">Wrap selected in <strong></span><br>
|
||||||
|
<span class="key">CTRL <span class="plus">+</span> Alt <span class="plus">+</span> e</span> <span class="shortcut">Wrap selected in <em></span><br>
|
||||||
|
</div>
|
||||||
|
|
||||||
<h2>Anywhere</h2>
|
<div style="display: inline-block; width: 365px">
|
||||||
<span class="key">CTRL <span class="plus">+</span> →</span> <span class="shortcut">Next tab</span><br>
|
<h2>Anywhere</h2>
|
||||||
<span class="key">CTRL <span class="plus">+</span> ←</span> <span class="shortcut">Previous tab</span><br>
|
<span class="key">CTRL <span class="plus">+</span> →</span> <span class="shortcut">Next tab</span><br>
|
||||||
<span class="key">CTRL <span class="plus">+</span> +</span> <span class="shortcut">New tab</span><br>
|
<span class="key">CTRL <span class="plus">+</span> ←</span> <span class="shortcut">Previous tab</span><br>
|
||||||
<span class="key">CTRL <span class="plus">+</span> -</span> <span class="shortcut">Close current tab</span><br>
|
<span class="key">CTRL <span class="plus">+</span> +</span> <span class="shortcut">New tab</span><br>
|
||||||
<span class="key">CTRL <span class="plus">+</span> F</span> <span class="shortcut">Find</span><br>
|
<span class="key">CTRL <span class="plus">+</span> -</span> <span class="shortcut">Close current tab</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> F</span> <span class="shortcut">Find</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> G</span> <span class="shortcut">Go to line</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> S</span> <span class="shortcut">Save</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> Shift <span class="plus">+</span> S</span> <span class="shortcut">Save as...</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">CTRL <span class="plus">+</span> Enter</span> <span class="shortcut">View webpage</span><br>
|
||||||
<span class="key">Esc</span> <span class="shortcut">Cancel tasks</span><br><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><br>
|
||||||
|
|
||||||
<h2>Logo</h2>
|
<h2>On logo</b><h2>
|
||||||
<span class="key">Left click</span> <span class="shortcut">Help</span><br>
|
<span class="key">Left click</span> <span class="shortcut">Help</span><br>
|
||||||
<span class="key">Right click</span> <span class="shortcut">Settings</span><br>
|
<span class="key">Right click</span> <span class="shortcut">Settings</span><br>
|
||||||
|
</div>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
|||||||
@@ -100,15 +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 .tabDrag {
|
||||||
|
-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, .tabsBar .closeAllTabs {margin: 1px 0 0 5px; border-radius: 6px; cursor: pointer}
|
||||||
.tabsBar .closeAllTabs {position: absolute; margin: 6px 0 0 -25px; background: #bbb}
|
.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 .closeAllTabs:hover {background: #000}
|
||||||
.tabsBar .newTab {display: inline-block; background-image: url('../images/nav-bg.jpg'); background-repeat: repeat-x; background-position: 0 0; padding: 6px 5px 5px 5px; border-left: solid 1px #eee; border-right: solid 1px #777; border-radius: 4px 4px 0 0; cursor: pointer;}
|
.tabsBar .newTab {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;}
|
||||||
|
|||||||
619
lib/ice-coder.js
619
lib/ice-coder.js
@@ -11,6 +11,7 @@ var ICEcoder = {
|
|||||||
selectedTab: 0, // The tab that's currently selected
|
selectedTab: 0, // The tab that's currently selected
|
||||||
changedContent: [], // Binary array to indicate which tabs have changed
|
changedContent: [], // Binary array to indicate which tabs have changed
|
||||||
ctrlKeyDown: false, // Indicates if CTRL keydown
|
ctrlKeyDown: false, // Indicates if CTRL keydown
|
||||||
|
altKeyDown: false, // Indicates if Alt keydown
|
||||||
shiftKeyDown: false, // Indicates if Shift keydown
|
shiftKeyDown: false, // Indicates if Shift keydown
|
||||||
delKeyDown: false, // Indicates if DEL keydown
|
delKeyDown: false, // Indicates if DEL keydown
|
||||||
canSwitchTabs: true, // Stops switching of tabs when trying to close
|
canSwitchTabs: true, // Stops switching of tabs when trying to close
|
||||||
@@ -26,15 +27,13 @@ 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
|
|
||||||
tagNestExceptions: ["!DOCTYPE","meta","link","img","br","hr","input","script","?php","?","%"],
|
|
||||||
|
|
||||||
// Set our aliases
|
// Set our aliases
|
||||||
initAliases: function() {
|
initAliases: function() {
|
||||||
var aliasArray = ["header","files","account","fmLock","filesFrame","editor","tabsBar","findBar","content","footer","nestValid","nestDisplay","charDisplay"];
|
var aliasArray = ["header","files","account","fmLock","filesFrame","editor","tabsBar","findBar","content","footer","nestValid","nestDisplay","charDisplay"];
|
||||||
@@ -56,15 +55,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
|
||||||
@@ -358,41 +348,50 @@ var ICEcoder = {
|
|||||||
top.ICEcoder.dontSelect = true;
|
top.ICEcoder.dontSelect = true;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// Wrap our selected text/cursor with tags
|
||||||
|
tagWrapper: function(tag) {
|
||||||
|
var cM, tagStart, tagEnd, startLine, endLine;
|
||||||
|
|
||||||
|
cM = ICEcoder.getcMInstance();
|
||||||
|
tagStart = tag;
|
||||||
|
tagEnd = tag;
|
||||||
|
if (tag=='div') {
|
||||||
|
startLine = cM.getCursor('start').line;
|
||||||
|
endLine = cM.getCursor().line;
|
||||||
|
cM.operation(function() {
|
||||||
|
cM.replaceSelection("<div>\n"+cM.getSelection()+"\n</div>");
|
||||||
|
for (var i=startLine+1; i<=endLine+1; i++) {
|
||||||
|
cM.indentLine(i);
|
||||||
|
}
|
||||||
|
cM.indentLine(endLine+2,'prev');
|
||||||
|
cM.indentLine(endLine+2,'subtract');
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
if (tag=='a') {tagStart='a href=""';}
|
||||||
|
cM.replaceSelection("<"+tagStart+">"+cM.getSelection()+"</"+tagEnd+">");
|
||||||
|
}
|
||||||
|
if (tag=='a') {cM.setCursor({line:cM.getCursor('start').line,ch:cM.getCursor('start').ch+9})}
|
||||||
|
},
|
||||||
|
|
||||||
// ==============
|
// ==============
|
||||||
// FILES
|
// FILES
|
||||||
// ==============
|
// ==============
|
||||||
|
|
||||||
// Setup the file manager
|
// Open/close dirs on demand
|
||||||
fileManager: function() {
|
openCloseDir: function(dir,load) {
|
||||||
ICEcoder.filesFrame = top.document.getElementById('filesFrame');
|
dir.onclick = function() {top.ICEcoder.openCloseDir(this,false)};
|
||||||
if (!ICEcoder.filesFrame.contentWindow.document.getElementsByTagName) {return;};
|
var node = dir.parentNode;
|
||||||
|
if (node.nextSibling) {node = node.nextSibling};
|
||||||
var aMenus = ICEcoder.filesFrame.contentWindow.document.getElementsByTagName("LI");
|
if (load) {
|
||||||
for (var i=0; i<aMenus.length; i++) {
|
top.ICEcoder.filesFrame.contentWindow.frames['fileControl'].location.href = "lib/get-branch.php?location="+dir.childNodes[1].id;
|
||||||
var mclass = aMenus[i].className;
|
} else if (node && node.tagName=="UL") {
|
||||||
if (mclass.indexOf("pft-directory")>-1) {
|
var d = node.style.display=="none";
|
||||||
var submenu=aMenus[i].childNodes;
|
if (d) {
|
||||||
for (var j=0; j<submenu.length; j++) {
|
top.ICEcoder.filesFrame.contentWindow.frames['fileControl'].location.href = "lib/get-branch.php?location="+dir.childNodes[1].id;
|
||||||
if (submenu[j].tagName=="A") {
|
|
||||||
submenu[j].onclick = function() {
|
|
||||||
var node = this.parentNode.nextSibling.nextSibling;
|
|
||||||
if (node && node.tagName=="UL") {
|
|
||||||
var d = node.style.display=="none";
|
|
||||||
node.style.display = d ? "block" : "none";
|
|
||||||
this.parentNode.className=this.className = d ? "pft-directory dirOpen" : "pft-directory";
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
node.style.display = d ? "block" : "none";
|
||||||
|
dir.parentNode.className=dir.className = d ? "pft-directory dirOpen" : "pft-directory";
|
||||||
}
|
}
|
||||||
var ulElems = ICEcoder.filesFrame.contentWindow.document.getElementsByTagName("UL");
|
|
||||||
for (var i=2; i<ulElems.length; i++) {
|
|
||||||
ulElems[i].style.display = "none";
|
|
||||||
}
|
|
||||||
ulElems[0].childNodes[1].className = "pft-directory dirOpen";
|
|
||||||
ulElems[1].style.display = "block";
|
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -554,7 +553,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,"/");
|
||||||
@@ -566,12 +565,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);
|
||||||
@@ -600,13 +601,18 @@ var ICEcoder = {
|
|||||||
// Copy a file on demand
|
// Copy a file on demand
|
||||||
copyFile: function(selFile) {
|
copyFile: function(selFile) {
|
||||||
top.ICEcoder.copiedFile = selFile;
|
top.ICEcoder.copiedFile = selFile;
|
||||||
|
top.document.getElementById('fmMenuPasteOption').style.display = "block";
|
||||||
top.ICEcoder.hideFileMenu();
|
top.ICEcoder.hideFileMenu();
|
||||||
},
|
},
|
||||||
|
|
||||||
// Paste a file on demand
|
// Paste a file on demand
|
||||||
pasteFile: function(location) {
|
pasteFile: function(location) {
|
||||||
top.ICEcoder.serverQueue("add","lib/file-control.php?action=paste&file="+top.ICEcoder.copiedFile+"&location="+location);
|
if (top.ICEcoder.copiedFile) {
|
||||||
top.ICEcoder.serverMessage('<b>Pasting File</b><br>'+top.ICEcoder.copiedFile.toString().replace(/\|/g,"/").replace(/,/g,"\n"));
|
top.ICEcoder.serverQueue("add","lib/file-control.php?action=paste&file="+top.ICEcoder.copiedFile+"&location="+location);
|
||||||
|
top.ICEcoder.serverMessage('<b>Pasting File</b><br>'+top.ICEcoder.copiedFile.toString().replace(/\|/g,"/").replace(/,/g,"\n"));
|
||||||
|
} else {
|
||||||
|
top.ICEcoder.message("Nothing to paste, copy a file/folder first!");
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// Upload file(s) - select & submit
|
// Upload file(s) - select & submit
|
||||||
@@ -615,9 +621,11 @@ var ICEcoder = {
|
|||||||
top.document.getElementById("fileInput").click();
|
top.document.getElementById("fileInput").click();
|
||||||
},
|
},
|
||||||
uploadFilesSubmit: function(obj) {
|
uploadFilesSubmit: function(obj) {
|
||||||
top.ICEcoder.showHide('show',top.document.getElementById('loadingMask'));
|
if (top.document.getElementById('fileInput').value!="") {
|
||||||
document.getElementById('uploadFilesForm').submit();
|
top.ICEcoder.showHide('show',top.document.getElementById('loadingMask'));
|
||||||
event.preventDefault();
|
document.getElementById('uploadFilesForm').submit();
|
||||||
|
event.preventDefault();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// Show menu on right clicking in file manager
|
// Show menu on right clicking in file manager
|
||||||
@@ -652,7 +660,7 @@ var ICEcoder = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
// 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
|
||||||
@@ -672,7 +680,7 @@ var ICEcoder = {
|
|||||||
innerLI = '<a nohref title="'+location+"/"+file+'" onMouseOver="top.ICEcoder.overFileFolder(\''+actionElemType+'\',\''+location.replace(/\//g,"|")+"|"+file+'\')" onMouseOut="top.ICEcoder.overFileFolder(\''+actionElemType+'\',\'\')" style="position: relative; left:-22px"> <span id="'+location.replace(/\//g,"|")+"|"+file+'">'+file+'</span> <span style="color: #888; font-size: 8px" id="'+location.replace(/\//g,"|")+"|"+file+'_perms">'+perms+'</span></a>';
|
innerLI = '<a nohref title="'+location+"/"+file+'" onMouseOver="top.ICEcoder.overFileFolder(\''+actionElemType+'\',\''+location.replace(/\//g,"|")+"|"+file+'\')" onMouseOut="top.ICEcoder.overFileFolder(\''+actionElemType+'\',\'\')" style="position: relative; left:-22px"> <span id="'+location.replace(/\//g,"|")+"|"+file+'">'+file+'</span> <span style="color: #888; font-size: 8px" id="'+location.replace(/\//g,"|")+"|"+file+'_perms">'+perms+'</span></a>';
|
||||||
|
|
||||||
// If we don't have at least 3 DOM items in here, it's an empty folder
|
// If we don't have at least 3 DOM items in here, it's an empty folder
|
||||||
if(!locNest.childNodes.length<3) {
|
if(locNest.childNodes.length<3) {
|
||||||
// We now need to begin a new UL list
|
// We now need to begin a new UL list
|
||||||
newUL = document.createElement("ul");
|
newUL = document.createElement("ul");
|
||||||
locNest = targetElem.parentNode.parentNode;
|
locNest = targetElem.parentNode.parentNode;
|
||||||
@@ -714,7 +722,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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -722,15 +730,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";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -746,8 +755,8 @@ var ICEcoder = {
|
|||||||
// Deleting files
|
// Deleting files
|
||||||
if (action=="delete") {
|
if (action=="delete") {
|
||||||
// Simply get our target and make it dissapear
|
// Simply get our target and make it dissapear
|
||||||
targetElem = document.getElementById('filesFrame').contentWindow.document.getElementById(location.replace(/\//g,"|")+"|"+file);
|
targetElem = document.getElementById('filesFrame').contentWindow.document.getElementById(location.replace(/\//g,"|")+"|"+file).parentNode.parentNode;
|
||||||
targetElem.parentNode.parentNode.style.display = "none";
|
targetElem.parentNode.removeChild(targetElem);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -1060,7 +1069,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);
|
||||||
}
|
}
|
||||||
@@ -1099,13 +1108,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) {
|
||||||
@@ -1321,10 +1338,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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -1338,7 +1357,7 @@ var ICEcoder = {
|
|||||||
|
|
||||||
// Show the help screen
|
// Show the help screen
|
||||||
helpScreen: function() {
|
helpScreen: function() {
|
||||||
top.document.getElementById('mediaContainer').innerHTML = '<iframe src="lib/help.php" class="whiteGlow" style="width: 400px; height: 500px"></iframe>';
|
top.document.getElementById('mediaContainer').innerHTML = '<iframe src="lib/help.php" class="whiteGlow" style="width: 800px; height: 440px"></iframe>';
|
||||||
top.ICEcoder.showHide('show',top.document.getElementById('blackMask'));
|
top.ICEcoder.showHide('show',top.document.getElementById('blackMask'));
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -1382,9 +1401,9 @@ var ICEcoder = {
|
|||||||
top.document.getElementById('fileMenu').style.display='none';
|
top.document.getElementById('fileMenu').style.display='none';
|
||||||
}
|
}
|
||||||
|
|
||||||
cMCSS = ICEcoder.content.contentWindow.document.styleSheets[2];
|
cMCSS = ICEcoder.content.contentWindow.document.styleSheets[3];
|
||||||
strCSS = cMCSS.rules ? 'rules' : 'cssRules';
|
strCSS = cMCSS.rules ? 'rules' : 'cssRules';
|
||||||
cMCSS[strCSS][4].style['content'] = visibleTabs ? '"\\21e5"' : '" "';
|
cMCSS[strCSS][5].style['content'] = visibleTabs ? '"\\21e5"' : '" "';
|
||||||
cMCSS[strCSS][2].style.cssText = "background: " + activeLineBG + " !important";
|
cMCSS[strCSS][2].style.cssText = "background: " + activeLineBG + " !important";
|
||||||
|
|
||||||
top.ICEcoder.lineWrapping = lineWrapping;
|
top.ICEcoder.lineWrapping = lineWrapping;
|
||||||
@@ -1446,51 +1465,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'));
|
||||||
@@ -1518,6 +1492,15 @@ var ICEcoder = {
|
|||||||
return prompt(question,defaultValue);
|
return prompt(question,defaultValue);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// Show a data screen message
|
||||||
|
dataMessage: function(message) {
|
||||||
|
var dM;
|
||||||
|
|
||||||
|
dM = top.ICEcoder.content.contentWindow.document.getElementById('dataMessage');
|
||||||
|
dM.style.display = "block";
|
||||||
|
dM.innerHTML = message;
|
||||||
|
},
|
||||||
|
|
||||||
// ==============
|
// ==============
|
||||||
// TABS
|
// TABS
|
||||||
// ==============
|
// ==============
|
||||||
@@ -1542,7 +1525,7 @@ var ICEcoder = {
|
|||||||
cM.getWrapperElement().style.display = "block";
|
cM.getWrapperElement().style.display = "block";
|
||||||
|
|
||||||
// Focus on & refresh our selected instance
|
// Focus on & refresh our selected instance
|
||||||
if (!noFocus) {cM.focus();}
|
if (!noFocus) {setTimeout(function() {cM.focus();},4);}
|
||||||
cM.refresh();
|
cM.refresh();
|
||||||
|
|
||||||
// Highlight the selected tab
|
// Highlight the selected tab
|
||||||
@@ -1591,11 +1574,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();
|
||||||
@@ -1634,21 +1617,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]") {
|
||||||
@@ -1663,7 +1645,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;
|
||||||
@@ -1681,9 +1663,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";
|
||||||
@@ -1715,7 +1694,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;
|
||||||
@@ -1725,23 +1706,171 @@ var ICEcoder = {
|
|||||||
|
|
||||||
// Close all tabs
|
// Close all tabs
|
||||||
closeAllTabs: function() {
|
closeAllTabs: function() {
|
||||||
for (var i=top.ICEcoder.cMInstances.length; i>0; i--) {
|
if (ICEcoder.ask("Close all tabs?")) {
|
||||||
top.ICEcoder.closeTab(i);
|
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);
|
||||||
},
|
},
|
||||||
|
|
||||||
// ==============
|
// ==============
|
||||||
@@ -1765,102 +1894,127 @@ var ICEcoder = {
|
|||||||
top.ICEcoder.ctrlKeyDown = true;
|
top.ICEcoder.ctrlKeyDown = true;
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
// Alt key down
|
||||||
|
} else if(key==18) {
|
||||||
|
top.ICEcoder.altKeyDown = true;
|
||||||
|
return false;
|
||||||
|
|
||||||
// Shift key down
|
// Shift key down
|
||||||
} else if(key==16) {
|
} else if(key==16) {
|
||||||
top.ICEcoder.shiftKeyDown = true;
|
top.ICEcoder.shiftKeyDown = true;
|
||||||
return false;
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
// CTRL+F (Find)
|
// Alt key down?
|
||||||
} else if(key==70 && top.ICEcoder.ctrlKeyDown==true) {
|
if (top.ICEcoder.altKeyDown==true) {
|
||||||
top.document.getElementById('find').focus();
|
|
||||||
top.ICEcoder.ctrlKeyDown = false;
|
|
||||||
return false;
|
|
||||||
|
|
||||||
// CTRL+G (Go to line)
|
// + CTRL + key (tag wrapper)
|
||||||
} else if(key==71 && top.ICEcoder.ctrlKeyDown==true) {
|
if (ICEcoder.ctrlKeyDown==true && area == "content") {
|
||||||
top.document.getElementById('goToLineNo').focus();
|
if (key==68) {top.ICEcoder.tagWrapper('div'); return false;}
|
||||||
top.ICEcoder.ctrlKeyDown = false;
|
else if (key==83) {top.ICEcoder.tagWrapper('span'); return false;}
|
||||||
return false;
|
else if (key==80) {top.ICEcoder.tagWrapper('p'); return false;}
|
||||||
|
else if (key==65) {top.ICEcoder.tagWrapper('a'); return false;}
|
||||||
|
else if (key==66) {top.ICEcoder.tagWrapper('b'); return false;}
|
||||||
|
else if (key==73) {top.ICEcoder.tagWrapper('i'); return false;}
|
||||||
|
else if (key==71) {top.ICEcoder.tagWrapper('strong'); return false;}
|
||||||
|
else if (key==69) {top.ICEcoder.tagWrapper('em'); return false;}
|
||||||
|
else {return key;}
|
||||||
|
} else {return key;}
|
||||||
|
|
||||||
// CTRL+I (Get info)
|
|
||||||
} else if(key==73 && top.ICEcoder.ctrlKeyDown==true && area == "content") {
|
|
||||||
var searchPrefix = "";
|
|
||||||
if (top.ICEcoder.caretLocType!="Content") {
|
|
||||||
searchPrefix = top.ICEcoder.caretLocType.toLowerCase()+" ";
|
|
||||||
}
|
|
||||||
window.open("http://www.google.com/#output=search&q="+searchPrefix+top.ICEcoder.getcMInstance().getSelection());
|
|
||||||
top.ICEcoder.ctrlKeyDown = false;
|
|
||||||
return false;
|
|
||||||
|
|
||||||
// CTRL+right arrow (Next tab)
|
|
||||||
} else if(key==39 && top.ICEcoder.ctrlKeyDown==true && area!="content") {
|
|
||||||
top.ICEcoder.nextTab();
|
|
||||||
return false;
|
|
||||||
|
|
||||||
// CTRL+left arrow (Previous tab)
|
|
||||||
} else if(key==37 && top.ICEcoder.ctrlKeyDown==true && area!="content") {
|
|
||||||
top.ICEcoder.previousTab();
|
|
||||||
return false;
|
|
||||||
|
|
||||||
// CTRL+up arrow (Move line up)
|
|
||||||
} else if(key==38 && top.ICEcoder.ctrlKeyDown==true && area=="content") {
|
|
||||||
top.ICEcoder.moveLine('up');
|
|
||||||
return false;
|
|
||||||
|
|
||||||
// CTRL+down arrow (Move line down)
|
|
||||||
} else if(key==40 && top.ICEcoder.ctrlKeyDown==true && area=="content") {
|
|
||||||
top.ICEcoder.moveLine('down');
|
|
||||||
return false;
|
|
||||||
|
|
||||||
// CTRL+numeric plus (New tab)
|
|
||||||
} else if(key==107 && top.ICEcoder.ctrlKeyDown==true) {
|
|
||||||
top.ICEcoder.newTab();
|
|
||||||
return false;
|
|
||||||
|
|
||||||
// CTRL+numeric minus (Close tab)
|
|
||||||
} else if(key==109 && top.ICEcoder.ctrlKeyDown==true) {
|
|
||||||
top.ICEcoder.closeTab(top.ICEcoder.selectedTab);
|
|
||||||
return false;
|
|
||||||
|
|
||||||
// CTRL+S (Save), CTRL+Shift+S (Save As)
|
|
||||||
} else if(key==83 && top.ICEcoder.ctrlKeyDown==true) {
|
|
||||||
if(top.ICEcoder.shiftKeyDown==true) {
|
|
||||||
top.ICEcoder.saveFile('saveAs');
|
|
||||||
top.ICEcoder.shiftKeyDown = false;
|
|
||||||
} else {
|
|
||||||
top.ICEcoder.saveFile();
|
|
||||||
}
|
|
||||||
top.ICEcoder.stickyTabMaybe = true;
|
|
||||||
return false;
|
|
||||||
|
|
||||||
// CTRL+Enter (Open Webpage)
|
|
||||||
} else if(key==13 && top.ICEcoder.ctrlKeyDown==true && top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1] != "/[NEW]") {
|
|
||||||
if (top.ICEcoder.stickyTabMaybe) {
|
|
||||||
top.ICEcoder.stickyTab = window.open(top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1],"stickyTab");
|
|
||||||
} else {
|
|
||||||
window.open(top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1]);
|
|
||||||
}
|
|
||||||
top.ICEcoder.ctrlKeyDown = false;
|
|
||||||
return false;
|
|
||||||
|
|
||||||
// CTRL+Space (Show snippet)
|
|
||||||
} else if(key==32 && top.ICEcoder.ctrlKeyDown==true && area=="content") {
|
|
||||||
top.ICEcoder.addSnippet();
|
|
||||||
return false;
|
|
||||||
|
|
||||||
// ESC in content area (Comment/Uncomment line)
|
|
||||||
} else if(key==27 && area == "content") {
|
|
||||||
top.ICEcoder.lineCommentToggle();
|
|
||||||
return false;
|
|
||||||
|
|
||||||
// ESC not in content area (Cancel all actions)
|
|
||||||
} else if(key==27 && area != "content") {
|
|
||||||
top.ICEcoder.cancelAllActions();
|
|
||||||
return false;
|
|
||||||
|
|
||||||
// Any other key
|
|
||||||
} else {
|
} else {
|
||||||
return key;
|
|
||||||
|
// CTRL+F (Find)
|
||||||
|
if(key==70 && top.ICEcoder.ctrlKeyDown==true) {
|
||||||
|
top.document.getElementById('find').focus();
|
||||||
|
top.ICEcoder.ctrlKeyDown = false;
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// CTRL+G (Go to line)
|
||||||
|
} else if(key==71 && top.ICEcoder.ctrlKeyDown==true) {
|
||||||
|
top.document.getElementById('goToLineNo').focus();
|
||||||
|
top.ICEcoder.ctrlKeyDown = false;
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// CTRL+I (Get info)
|
||||||
|
} else if(key==73 && top.ICEcoder.ctrlKeyDown==true && area == "content") {
|
||||||
|
var searchPrefix = "";
|
||||||
|
if (top.ICEcoder.caretLocType!="Content") {
|
||||||
|
searchPrefix = top.ICEcoder.caretLocType.toLowerCase()+" ";
|
||||||
|
}
|
||||||
|
window.open("http://www.google.com/#output=search&q="+searchPrefix+top.ICEcoder.getcMInstance().getSelection());
|
||||||
|
top.ICEcoder.ctrlKeyDown = false;
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// CTRL+right arrow (Next tab)
|
||||||
|
} else if(key==39 && top.ICEcoder.ctrlKeyDown==true && area!="content") {
|
||||||
|
top.ICEcoder.nextTab();
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// CTRL+left arrow (Previous tab)
|
||||||
|
} else if(key==37 && top.ICEcoder.ctrlKeyDown==true && area!="content") {
|
||||||
|
top.ICEcoder.previousTab();
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// CTRL+up arrow (Move line up)
|
||||||
|
} else if(key==38 && top.ICEcoder.ctrlKeyDown==true && area=="content") {
|
||||||
|
top.ICEcoder.moveLine('up');
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// CTRL+down arrow (Move line down)
|
||||||
|
} else if(key==40 && top.ICEcoder.ctrlKeyDown==true && area=="content") {
|
||||||
|
top.ICEcoder.moveLine('down');
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// CTRL+numeric plus (New tab)
|
||||||
|
} else if(key==107 && top.ICEcoder.ctrlKeyDown==true) {
|
||||||
|
top.ICEcoder.newTab();
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// CTRL+numeric minus (Close tab)
|
||||||
|
} else if(key==109 && top.ICEcoder.ctrlKeyDown==true) {
|
||||||
|
top.ICEcoder.closeTab(top.ICEcoder.selectedTab);
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// CTRL+S (Save), CTRL+Shift+S (Save As)
|
||||||
|
} else if(key==83 && top.ICEcoder.ctrlKeyDown==true) {
|
||||||
|
if(top.ICEcoder.shiftKeyDown==true) {
|
||||||
|
top.ICEcoder.saveFile('saveAs');
|
||||||
|
top.ICEcoder.shiftKeyDown = false;
|
||||||
|
} else {
|
||||||
|
top.ICEcoder.saveFile();
|
||||||
|
}
|
||||||
|
top.ICEcoder.stickyTabMaybe = true;
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// CTRL+Enter (Open Webpage)
|
||||||
|
} else if(key==13 && top.ICEcoder.ctrlKeyDown==true && top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1] != "/[NEW]") {
|
||||||
|
if (top.ICEcoder.stickyTabMaybe) {
|
||||||
|
top.ICEcoder.stickyTab = window.open(top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1],"stickyTab");
|
||||||
|
} else {
|
||||||
|
window.open(top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1]);
|
||||||
|
}
|
||||||
|
top.ICEcoder.ctrlKeyDown = false;
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// CTRL+Space (Show snippet)
|
||||||
|
} else if(key==32 && top.ICEcoder.ctrlKeyDown==true && area=="content") {
|
||||||
|
top.ICEcoder.addSnippet();
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// ESC in content area (Comment/Uncomment line)
|
||||||
|
} else if(key==27 && area == "content") {
|
||||||
|
top.ICEcoder.lineCommentToggle();
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// ESC not in content area (Cancel all actions)
|
||||||
|
} else if(key==27 && area != "content") {
|
||||||
|
top.ICEcoder.cancelAllActions();
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// Any other key
|
||||||
|
} else {
|
||||||
|
return key;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -1872,6 +2026,7 @@ var ICEcoder = {
|
|||||||
|
|
||||||
if (key==17) {top.ICEcoder.ctrlKeyDown = false; top.ICEcoder.stickyTabMaybe = false}
|
if (key==17) {top.ICEcoder.ctrlKeyDown = false; top.ICEcoder.stickyTabMaybe = false}
|
||||||
else if (key==16) {top.ICEcoder.shiftKeyDown = false}
|
else if (key==16) {top.ICEcoder.shiftKeyDown = false}
|
||||||
|
else if (key==18) {top.ICEcoder.altKeyDown = false}
|
||||||
else if (key==46) {top.ICEcoder.delKeyDown = false}
|
else if (key==46) {top.ICEcoder.delKeyDown = false}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -1887,19 +2042,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});
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -1934,16 +2082,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;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -167,7 +167,7 @@ function findSequence(goal) {
|
|||||||
<span style="position: absolute; top: 510px">
|
<span style="position: absolute; top: 510px">
|
||||||
<h2>file manager</h2>
|
<h2>file manager</h2>
|
||||||
root <span style="font-size: 10px; color: #888">slash prefixed</span><br>
|
root <span style="font-size: 10px; color: #888">slash prefixed</span><br>
|
||||||
<input type="text" name="root" style="width: 250px" onkeydown="document.settings.changedFileSettings.value='true';showButton()" value="<?php echo $ICEcoder["root"];?>">
|
<input type="text" name="root" style="width: 200px" onkeydown="document.settings.changedFileSettings.value='true';showButton()" value="<?php echo $ICEcoder["root"];?>">
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
@@ -40,13 +40,19 @@ function numClean($var) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Settings are stored in this file
|
// Settings are stored in this file
|
||||||
|
$settingsTemplate = 'config-template.php';
|
||||||
$settingsFile = 'config.php';
|
$settingsFile = 'config.php';
|
||||||
|
if (!file_exists(dirname(__FILE__)."/".$settingsFile)) {
|
||||||
|
if (!copy(dirname(__FILE__)."/".$settingsTemplate, dirname(__FILE__)."/".$settingsFile)) {
|
||||||
|
die("Couldn't create $settingsFile. Maybe you need write permissions on the lib folder?");
|
||||||
|
}
|
||||||
|
}
|
||||||
include($settingsFile);
|
include($settingsFile);
|
||||||
|
|
||||||
// Add ICEcoder settings to beginning of $ICEcoder array
|
// Add ICEcoder settings to beginning of $ICEcoder array
|
||||||
$ICEcoder = array(
|
$ICEcoder = array(
|
||||||
"versionNo" => "1.5",
|
"versionNo" => "2.0 beta",
|
||||||
"codeMirrorDir" => "CodeMirror-3.0",
|
"codeMirrorDir" => "CodeMirror-3.1",
|
||||||
"demoMode" => false
|
"demoMode" => false
|
||||||
)+$ICEcoder;
|
)+$ICEcoder;
|
||||||
|
|
||||||
@@ -147,15 +153,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");
|
||||||
@@ -227,8 +238,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']));
|
||||||
@@ -280,8 +293,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,30 +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>
|
|
||||||
|
|
||||||
<span onClick="top.ICEcoder.removeSnippet()" style="position: absolute; top: 5px; right: 5px; height: 11px; background: #444; margin: 1px 0 0 5px; border-radius: 6px; cursor: pointer"><img src="../images/nav-close.gif"></span>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
|
|
||||||
</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