Compare commits
172 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b52f0cd112 | ||
|
|
4865f6c87b | ||
|
|
b2ceca3a8f | ||
|
|
2c4ee9370c | ||
|
|
1f10cad45b | ||
|
|
c2e92fa355 | ||
|
|
2f85371738 | ||
|
|
a48c9f5a77 | ||
|
|
61728cfa07 | ||
|
|
1643e74758 | ||
|
|
33a354688a | ||
|
|
7c2d6f6fb5 | ||
|
|
ea959248ca | ||
|
|
2665a3be40 | ||
|
|
d240cf0a53 | ||
|
|
c02e7cd0b5 | ||
|
|
6a3e15aabf | ||
|
|
e4bae8cdc5 | ||
|
|
e0e679d436 | ||
|
|
0f3050521d | ||
|
|
db5a10bb96 | ||
|
|
b05954eccd | ||
|
|
d2504dac64 | ||
|
|
a95e4124a8 | ||
|
|
c18630b0a5 | ||
|
|
f436aa835d | ||
|
|
7409c89a87 | ||
|
|
0de8405906 | ||
|
|
39d4bfe858 | ||
|
|
0677cb2a90 | ||
|
|
2dd2e64f43 | ||
|
|
3d45172991 | ||
|
|
979fb791ac | ||
|
|
1fcc2d996c | ||
|
|
e1d1891de8 | ||
|
|
fabfcbd742 | ||
|
|
3710fa9e79 | ||
|
|
b059261065 | ||
|
|
7b1b91ca14 | ||
|
|
098127c287 | ||
|
|
83c99f34a3 | ||
|
|
a9ae141838 | ||
|
|
c783416054 | ||
|
|
59e1bc3c56 | ||
|
|
f4cdff0c2c | ||
|
|
5bd99480f1 | ||
|
|
a86e7e4182 | ||
|
|
c3477264b3 | ||
|
|
9c4c33aa76 | ||
|
|
9b5aea5aec | ||
|
|
614ee50262 | ||
|
|
f1b7c973d3 | ||
|
|
0c7fad798c | ||
|
|
e4ed3cf978 | ||
|
|
63687b7f48 | ||
|
|
20454a21ed | ||
|
|
eb30cb0cb6 | ||
|
|
b211fae85c | ||
|
|
93b4774903 | ||
|
|
236b55fce6 | ||
|
|
c34bf50c39 | ||
|
|
b8f921dab2 | ||
|
|
fc79be3010 | ||
|
|
63d08eeed2 | ||
|
|
7fa39f645d | ||
|
|
535677fc8e | ||
|
|
2dfff50031 | ||
|
|
c335b6b7fb | ||
|
|
a81c4c7a75 | ||
|
|
e2ada5e6b2 | ||
|
|
43ae4ac317 | ||
|
|
5f0ee6d95e | ||
|
|
0947172391 | ||
|
|
0fb9680f72 | ||
|
|
ba94a3bba0 | ||
|
|
11963e263d | ||
|
|
3f15cb8fff | ||
|
|
eca4f8e06d | ||
|
|
358be2ee92 | ||
|
|
acd8f949e7 | ||
|
|
a1574af5e0 | ||
|
|
525e73e179 | ||
|
|
abe1745642 | ||
|
|
eda925e617 | ||
|
|
5ab3f7ba16 | ||
|
|
cb12bdad2d | ||
|
|
2a6c2fc273 | ||
|
|
216c04b3f1 | ||
|
|
0ecb6ea1aa | ||
|
|
f3fff8543d | ||
|
|
2d75b57195 | ||
|
|
7ebd73916e | ||
|
|
cafa9d521a | ||
|
|
a5b395d888 | ||
|
|
c214640bb1 | ||
|
|
d7a8b35ded | ||
|
|
bcc86e160f | ||
|
|
5b14389c6e | ||
|
|
0ba4803154 | ||
|
|
e58f9cae28 | ||
|
|
1d5c049c01 | ||
|
|
0d01b4a2ea | ||
|
|
d43a758a37 | ||
|
|
d886372f11 | ||
|
|
838d44bd5c | ||
|
|
8f997eb4f3 | ||
|
|
65b3fc56ef | ||
|
|
6e061cbc30 | ||
|
|
9e44b76214 | ||
|
|
d1e928e068 | ||
|
|
2c2249d96b | ||
|
|
d87e932030 | ||
|
|
44cac8a7e1 | ||
|
|
736d3c8744 | ||
|
|
3104065437 | ||
|
|
444695a908 | ||
|
|
eba6f4eaf2 | ||
|
|
e3b4f0b159 | ||
|
|
5c55939765 | ||
|
|
bd69d00182 | ||
|
|
7312789e12 | ||
|
|
4e765e64ca | ||
|
|
660f86018a | ||
|
|
b5050acba0 | ||
|
|
2fa780236b | ||
|
|
831770e7d8 | ||
|
|
c50102e153 | ||
|
|
54088daa67 | ||
|
|
169312f021 | ||
|
|
62ab717772 | ||
|
|
6273bcdd3f | ||
|
|
5b894794dd | ||
|
|
b31c41fdda | ||
|
|
2c6bcacb25 | ||
|
|
ed9b9881b6 | ||
|
|
2d2945cc5c | ||
|
|
3b1a1fbbe2 | ||
|
|
be2f15f77b | ||
|
|
3c4872c231 | ||
|
|
8c605674f3 | ||
|
|
c1549faca1 | ||
|
|
f4b98cd4ff | ||
|
|
cbeac572f5 | ||
|
|
f94371f16c | ||
|
|
7111a2aee3 | ||
|
|
cc82304996 | ||
|
|
3d91b8ab13 | ||
|
|
9a4ae52df0 | ||
|
|
466b6bb1dd | ||
|
|
facf511621 | ||
|
|
c4cada924e | ||
|
|
99b8a02c0e | ||
|
|
b74ed1490a | ||
|
|
02f64e318d | ||
|
|
2938014b33 | ||
|
|
45040555f0 | ||
|
|
591ec57c49 | ||
|
|
d5626ab7df | ||
|
|
2a25efba1a | ||
|
|
9197d24fff | ||
|
|
9fa87c5141 | ||
|
|
dddf2e9ea1 | ||
|
|
69ea8838cd | ||
|
|
33ea31f1fa | ||
|
|
e2adcabc5b | ||
|
|
a33ded4409 | ||
|
|
6161518d8b | ||
|
|
bf40cb2009 | ||
|
|
12f8315a84 | ||
|
|
0f460483f3 | ||
|
|
bf22cd1638 | ||
|
|
e656c89ba1 |
3
.gitignore
vendored
@@ -1,3 +1,4 @@
|
|||||||
error-log.txt
|
error-log.txt
|
||||||
backups/*.zip
|
backups/*.zip
|
||||||
lib/config.php
|
lib/config*.php
|
||||||
|
!lib/config-template.php
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
.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;
|
|
||||||
}
|
|
||||||
38
CodeMirror-3.13/addon/hint/show-hint.css
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
.CodeMirror-hints {
|
||||||
|
position: absolute;
|
||||||
|
z-index: 10;
|
||||||
|
overflow: hidden;
|
||||||
|
list-style: none;
|
||||||
|
|
||||||
|
margin: 0;
|
||||||
|
padding: 2px;
|
||||||
|
|
||||||
|
-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);
|
||||||
|
border-radius: 3px;
|
||||||
|
border: 1px solid silver;
|
||||||
|
|
||||||
|
background: white;
|
||||||
|
font-size: 90%;
|
||||||
|
font-family: monospace;
|
||||||
|
|
||||||
|
max-height: 20em;
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.CodeMirror-hint {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0 4px;
|
||||||
|
border-radius: 2px;
|
||||||
|
max-width: 19em;
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: pre;
|
||||||
|
color: black;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.CodeMirror-hint-active {
|
||||||
|
background: #08f;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
7
CodeMirror-3.13/lib/codemirror-compressed.js
Normal file
@@ -19,7 +19,7 @@
|
|||||||
padding: 0 4px; /* Horizontal padding of content */
|
padding: 0 4px; /* Horizontal padding of content */
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror-scrollbar-filler {
|
.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
|
||||||
background-color: white; /* The little square between H and V scrollbars */
|
background-color: white; /* The little square between H and V scrollbars */
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -28,6 +28,7 @@
|
|||||||
.CodeMirror-gutters {
|
.CodeMirror-gutters {
|
||||||
border-right: 1px solid #ddd;
|
border-right: 1px solid #ddd;
|
||||||
background-color: #f7f7f7;
|
background-color: #f7f7f7;
|
||||||
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
.CodeMirror-linenumbers {}
|
.CodeMirror-linenumbers {}
|
||||||
.CodeMirror-linenumber {
|
.CodeMirror-linenumber {
|
||||||
@@ -41,6 +42,7 @@
|
|||||||
|
|
||||||
.CodeMirror div.CodeMirror-cursor {
|
.CodeMirror div.CodeMirror-cursor {
|
||||||
border-left: 1px solid black;
|
border-left: 1px solid black;
|
||||||
|
z-index: 3;
|
||||||
}
|
}
|
||||||
/* Shown when moving in bi-directional text */
|
/* Shown when moving in bi-directional text */
|
||||||
.CodeMirror div.CodeMirror-secondarycursor {
|
.CodeMirror div.CodeMirror-secondarycursor {
|
||||||
@@ -49,17 +51,14 @@
|
|||||||
.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor {
|
.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor {
|
||||||
width: auto;
|
width: auto;
|
||||||
border: 0;
|
border: 0;
|
||||||
background: transparent;
|
background: #7e7;
|
||||||
background: rgba(0, 200, 0, .4);
|
z-index: 1;
|
||||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#6600c800, endColorstr=#4c00c800);
|
|
||||||
}
|
|
||||||
/* Kludge to turn off filter in ie9+, which also accepts rgba */
|
|
||||||
.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor:not(#nonsense_id) {
|
|
||||||
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 div.CodeMirror-cursor.CodeMirror-overwrite {}
|
.CodeMirror div.CodeMirror-cursor.CodeMirror-overwrite {}
|
||||||
|
|
||||||
|
.cm-tab { display: inline-block; }
|
||||||
|
|
||||||
/* DEFAULT THEME */
|
/* DEFAULT THEME */
|
||||||
|
|
||||||
.cm-s-default .cm-keyword {color: #708;}
|
.cm-s-default .cm-keyword {color: #708;}
|
||||||
@@ -90,7 +89,6 @@
|
|||||||
.cm-positive {color: #292;}
|
.cm-positive {color: #292;}
|
||||||
.cm-header, .cm-strong {font-weight: bold;}
|
.cm-header, .cm-strong {font-weight: bold;}
|
||||||
.cm-em {font-style: italic;}
|
.cm-em {font-style: italic;}
|
||||||
.cm-emstrong {font-style: italic; font-weight: bold;}
|
|
||||||
.cm-link {text-decoration: underline;}
|
.cm-link {text-decoration: underline;}
|
||||||
|
|
||||||
.cm-invalidchar {color: #f00;}
|
.cm-invalidchar {color: #f00;}
|
||||||
@@ -107,11 +105,13 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
|
|||||||
line-height: 1;
|
line-height: 1;
|
||||||
position: relative;
|
position: relative;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
background: white;
|
||||||
|
color: black;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror-scroll {
|
.CodeMirror-scroll {
|
||||||
/* 30px is the magic margin used to hide the element's real scrollbars */
|
/* 30px is the magic margin used to hide the element's real scrollbars */
|
||||||
/* See overflow: hidden in .CodeMirror, and the paddings in .CodeMirror-sizer */
|
/* See overflow: hidden in .CodeMirror */
|
||||||
margin-bottom: -30px; margin-right: -30px;
|
margin-bottom: -30px; margin-right: -30px;
|
||||||
padding-bottom: 30px; padding-right: 30px;
|
padding-bottom: 30px; padding-right: 30px;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
@@ -125,7 +125,7 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
|
|||||||
/* The fake, visible scrollbars. Used to force redraw during scrolling
|
/* The fake, visible scrollbars. Used to force redraw during scrolling
|
||||||
before actuall scrolling happens, thus preventing shaking and
|
before actuall scrolling happens, thus preventing shaking and
|
||||||
flickering artifacts. */
|
flickering artifacts. */
|
||||||
.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler {
|
.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: 6;
|
z-index: 6;
|
||||||
display: none;
|
display: none;
|
||||||
@@ -142,17 +142,21 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
|
|||||||
}
|
}
|
||||||
.CodeMirror-scrollbar-filler {
|
.CodeMirror-scrollbar-filler {
|
||||||
right: 0; bottom: 0;
|
right: 0; bottom: 0;
|
||||||
z-index: 6;
|
}
|
||||||
|
.CodeMirror-gutter-filler {
|
||||||
|
left: 0; bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror-gutters {
|
.CodeMirror-gutters {
|
||||||
position: absolute; left: 0; top: 0;
|
position: absolute; left: 0; top: 0;
|
||||||
height: 100%;
|
|
||||||
padding-bottom: 30px;
|
padding-bottom: 30px;
|
||||||
z-index: 3;
|
z-index: 3;
|
||||||
}
|
}
|
||||||
.CodeMirror-gutter {
|
.CodeMirror-gutter {
|
||||||
|
white-space: normal;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
padding-bottom: 30px;
|
||||||
|
margin-bottom: -32px;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
/* Hack to make IE7 behave */
|
/* Hack to make IE7 behave */
|
||||||
*zoom:1;
|
*zoom:1;
|
||||||
@@ -169,7 +173,7 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
|
|||||||
}
|
}
|
||||||
.CodeMirror pre {
|
.CodeMirror pre {
|
||||||
/* Reset some styles that the rest of the page might have set */
|
/* Reset some styles that the rest of the page might have set */
|
||||||
-moz-border-radius: 0; -webkit-border-radius: 0; -o-border-radius: 0; border-radius: 0;
|
-moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0;
|
||||||
border-width: 0;
|
border-width: 0;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
font-family: inherit;
|
font-family: inherit;
|
||||||
@@ -46,7 +46,6 @@
|
|||||||
background-color: #202020;
|
background-color: #202020;
|
||||||
-webkit-box-shadow: inset 0 0 10px black;
|
-webkit-box-shadow: inset 0 0 10px black;
|
||||||
-moz-box-shadow: inset 0 0 10px black;
|
-moz-box-shadow: inset 0 0 10px black;
|
||||||
-o-box-shadow: inset 0 0 10px black;
|
|
||||||
box-shadow: inset 0 0 10px black;
|
box-shadow: inset 0 0 10px black;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
.cm-s-eclipse.CodeMirror {background: #fff; color: #000;}
|
|
||||||
.cm-s-eclipse span.cm-meta {color: #FF1717;}
|
.cm-s-eclipse span.cm-meta {color: #FF1717;}
|
||||||
.cm-s-eclipse span.cm-keyword { line-height: 1em; font-weight: bold; color: #7F0055; }
|
.cm-s-eclipse span.cm-keyword { line-height: 1em; font-weight: bold; color: #7F0055; }
|
||||||
.cm-s-eclipse span.cm-atom {color: #219;}
|
.cm-s-eclipse span.cm-atom {color: #219;}
|
||||||
@@ -22,5 +21,5 @@
|
|||||||
|
|
||||||
.cm-s-eclipse .CodeMirror-matchingbracket {
|
.cm-s-eclipse .CodeMirror-matchingbracket {
|
||||||
outline:1px solid grey;
|
outline:1px solid grey;
|
||||||
color:black !important;;
|
color:black !important;
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
.cm-s-elegant.CodeMirror {background: #fff; color: #000;}
|
|
||||||
.cm-s-elegant span.cm-number, .cm-s-elegant span.cm-string, .cm-s-elegant span.cm-atom {color: #762;}
|
.cm-s-elegant span.cm-number, .cm-s-elegant span.cm-string, .cm-s-elegant span.cm-atom {color: #762;}
|
||||||
.cm-s-elegant span.cm-comment {color: #262; font-style: italic; line-height: 1em;}
|
.cm-s-elegant span.cm-comment {color: #262; font-style: italic; line-height: 1em;}
|
||||||
.cm-s-elegant span.cm-meta {color: #555; font-style: italic; line-height: 1em;}
|
.cm-s-elegant span.cm-meta {color: #555; font-style: italic; line-height: 1em;}
|
||||||
@@ -7,15 +7,15 @@
|
|||||||
.cm-s-erlang-dark span.cm-atom { color: #845dc4; }
|
.cm-s-erlang-dark span.cm-atom { color: #845dc4; }
|
||||||
.cm-s-erlang-dark span.cm-attribute { color: #ff80e1; }
|
.cm-s-erlang-dark span.cm-attribute { color: #ff80e1; }
|
||||||
.cm-s-erlang-dark span.cm-bracket { color: #ff9d00; }
|
.cm-s-erlang-dark span.cm-bracket { color: #ff9d00; }
|
||||||
.cm-s-erlang-dark span.cm-builtin { color: #eeaaaa; }
|
.cm-s-erlang-dark span.cm-builtin { color: #eaa; }
|
||||||
.cm-s-erlang-dark span.cm-comment { color: #7777ff; }
|
.cm-s-erlang-dark span.cm-comment { color: #77f; }
|
||||||
.cm-s-erlang-dark span.cm-def { color: #ee77aa; }
|
.cm-s-erlang-dark span.cm-def { color: #e7a; }
|
||||||
.cm-s-erlang-dark span.cm-error { color: #9d1e15; }
|
.cm-s-erlang-dark span.cm-error { color: #9d1e15; }
|
||||||
.cm-s-erlang-dark span.cm-keyword { color: #ffee80; }
|
.cm-s-erlang-dark span.cm-keyword { color: #ffee80; }
|
||||||
.cm-s-erlang-dark span.cm-meta { color: #50fefe; }
|
.cm-s-erlang-dark span.cm-meta { color: #50fefe; }
|
||||||
.cm-s-erlang-dark span.cm-number { color: #ffd0d0; }
|
.cm-s-erlang-dark span.cm-number { color: #ffd0d0; }
|
||||||
.cm-s-erlang-dark span.cm-operator { color: #dd1111; }
|
.cm-s-erlang-dark span.cm-operator { color: #d11; }
|
||||||
.cm-s-erlang-dark span.cm-string { color: #3ad900; }
|
.cm-s-erlang-dark span.cm-string { color: #3ad900; }
|
||||||
.cm-s-erlang-dark span.cm-tag { color: #9effff; }
|
.cm-s-erlang-dark span.cm-tag { color: #9effff; }
|
||||||
.cm-s-erlang-dark span.cm-variable { color: #50fe50; }
|
.cm-s-erlang-dark span.cm-variable { color: #50fe50; }
|
||||||
.cm-s-erlang-dark span.cm-variable-2 { color: #ee00ee; }
|
.cm-s-erlang-dark span.cm-variable-2 { color: #e0e; }
|
||||||
52
CodeMirror-3.13/theme/midnight.css
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
/* Based on the theme at http://bonsaiden.github.com/JavaScript-Garden */
|
||||||
|
|
||||||
|
/*<!--breakpoint-->*/
|
||||||
|
.breakpoints {width: .8em;}
|
||||||
|
.breakpoint { color: #822; }
|
||||||
|
|
||||||
|
/*<!--match-->*/
|
||||||
|
span.CodeMirror-matchhighlight { background: #494949 }
|
||||||
|
.CodeMirror-focused span.CodeMirror-matchhighlight { background: #314D67; !important }
|
||||||
|
|
||||||
|
/*<!--activeline-->*/
|
||||||
|
.activeline {background: #253540 !important;}
|
||||||
|
|
||||||
|
.cm-s-midnight.CodeMirror {
|
||||||
|
background: #0F192A;
|
||||||
|
color: #D1EDFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
|
||||||
|
|
||||||
|
.cm-s-midnight div.CodeMirror-selected {background: #314D67 !important;}
|
||||||
|
.cm-s-midnight .CodeMirror-gutters {background: #0F192A; border-right: 1px solid;}
|
||||||
|
.cm-s-midnight .CodeMirror-linenumber {color: #D0D0D0;}
|
||||||
|
.cm-s-midnight .CodeMirror-cursor {
|
||||||
|
border-left: 1px solid #F8F8F0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cm-s-midnight span.cm-comment {color: #428BDD;}
|
||||||
|
.cm-s-midnight span.cm-atom {color: #AE81FF;}
|
||||||
|
.cm-s-midnight span.cm-number {color: #D1EDFF;}
|
||||||
|
|
||||||
|
.cm-s-midnight span.cm-property, .cm-s-tropicaleve span.cm-attribute {color: #A6E22E;}
|
||||||
|
.cm-s-midnight span.cm-keyword {color: #E83737;}
|
||||||
|
.cm-s-midnight span.cm-string {color: #1DC116;}
|
||||||
|
|
||||||
|
.cm-s-midnight span.cm-variable {color: #FFAA3E;}
|
||||||
|
.cm-s-midnight span.cm-variable-2 {color: #FFAA3E;}
|
||||||
|
.cm-s-midnight span.cm-def {color: #4DD;}
|
||||||
|
.cm-s-midnight span.cm-error {background: #F92672; color: #F8F8F0;}
|
||||||
|
.cm-s-midnight span.cm-bracket {color: #D1EDFF;}
|
||||||
|
.cm-s-midnight span.cm-tag {color: #008;}
|
||||||
|
.cm-s-midnight span.cm-link {color: #AE81FF;}
|
||||||
|
|
||||||
|
.cm-s-midnight .CodeMirror-matchingbracket {
|
||||||
|
text-decoration: underline;
|
||||||
|
color: white !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.typ { color: #FFAA3E; }
|
||||||
|
.atn { color: #606; }
|
||||||
|
.atv { color: #080; }
|
||||||
|
.dec { color: #606; }
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
.cm-s-neat.CodeMirror { background: #fff; color: #000; }
|
|
||||||
.cm-s-neat span.cm-comment { color: #a86; }
|
.cm-s-neat span.cm-comment { color: #a86; }
|
||||||
.cm-s-neat span.cm-keyword { line-height: 1em; font-weight: bold; color: blue; }
|
.cm-s-neat span.cm-keyword { line-height: 1em; font-weight: bold; color: blue; }
|
||||||
.cm-s-neat span.cm-string { color: #a22; }
|
.cm-s-neat span.cm-string { color: #a22; }
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
.cm-s-rubyblue { font:13px/1.4em Trebuchet, Verdana, sans-serif; } /* - customized editor font - */
|
.cm-s-rubyblue { font-family: Trebuchet, Verdana, sans-serif; } /* - customized editor font - */
|
||||||
|
|
||||||
.cm-s-rubyblue.CodeMirror { background: #112435; color: white; }
|
.cm-s-rubyblue.CodeMirror { background: #112435; color: white; }
|
||||||
.cm-s-rubyblue div.CodeMirror-selected { background: #38566F !important; }
|
.cm-s-rubyblue div.CodeMirror-selected { background: #38566F !important; }
|
||||||
43
CodeMirror-3.13/theme/xq-light.css
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
/*
|
||||||
|
Copyright (C) 2011 by MarkLogic Corporation
|
||||||
|
Author: Mike Brevoort <mike@brevoort.com>
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
.cm-s-xq-light span.cm-keyword {line-height: 1em; font-weight: bold; color: #5A5CAD; }
|
||||||
|
.cm-s-xq-light span.cm-atom {color: #6C8CD5;}
|
||||||
|
.cm-s-xq-light span.cm-number {color: #164;}
|
||||||
|
.cm-s-xq-light span.cm-def {text-decoration:underline;}
|
||||||
|
.cm-s-xq-light span.cm-variable {color: black; }
|
||||||
|
.cm-s-xq-light span.cm-variable-2 {color:black;}
|
||||||
|
.cm-s-xq-light span.cm-variable-3 {color: black; }
|
||||||
|
.cm-s-xq-light span.cm-property {}
|
||||||
|
.cm-s-xq-light span.cm-operator {}
|
||||||
|
.cm-s-xq-light span.cm-comment {color: #0080FF; font-style: italic;}
|
||||||
|
.cm-s-xq-light span.cm-string {color: red;}
|
||||||
|
.cm-s-xq-light span.cm-meta {color: yellow;}
|
||||||
|
.cm-s-xq-light span.cm-error {color: #f00;}
|
||||||
|
.cm-s-xq-light span.cm-qualifier {color: grey}
|
||||||
|
.cm-s-xq-light span.cm-builtin {color: #7EA656;}
|
||||||
|
.cm-s-xq-light span.cm-bracket {color: #cc7;}
|
||||||
|
.cm-s-xq-light span.cm-tag {color: #3F7F7F;}
|
||||||
|
.cm-s-xq-light span.cm-attribute {color: #7F007F;}
|
||||||
|
|
||||||
|
.cm-s-xq-light .CodeMirror-activeline-background {background: #e8f2ff !important;}
|
||||||
|
.cm-s-xq-light .CodeMirror-matchingbracket {border:1px solid grey;color:black !important;background:yellow;}
|
||||||
13
README.md
@@ -3,14 +3,14 @@
|
|||||||
|
|
||||||
ICEcoder is a web IDE / browser based code editor, which allows you to develop websites directly within the web browser. It uses the brilliant CodeMirror for code highlighting & editing, with a slick IDE wrapped around it to make the whole thing work.
|
ICEcoder is a web IDE / browser based code editor, which allows you to develop websites directly within the web browser. It 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-v2-browser-code-editor.png" alt="ICEcoder web IDE">
|
<img src="http://icecoder.net/images/icecoder-v2-5-browser-code-editor.png" alt="ICEcoder web IDE">
|
||||||
|
|
||||||
###Requirements
|
###Requirements
|
||||||
You can run ICEcoder either online or locally, on Linux, Windows or Mac based platforms. The only requirement is to have PHP 5 available (5.3 recommended). You can have this either as a vanilla installation or via a program such as WAMP or XAMPP (for Windows) or MAMP (for Mac).
|
You can run ICEcoder either online or locally, on Linux, Windows or Mac based platforms. The only requirement is to have PHP 5 available (5.3 recommended). You can have this either as a vanilla installation or via a program such as WAMP or XAMPP (for Windows) or MAMP (for Mac).
|
||||||
|
|
||||||
###Features you'd expect
|
###Features you'd expect
|
||||||
* Context aware code highlighting
|
* Context aware code highlighting
|
||||||
* Supports HTML, CSS, LESS, JavaScript, CoffeeScript, PHP & Ruby
|
* Supports HTML, CSS, LESS, JavaScript, CoffeeScript, PHP, Python, Ruby, Markdown & more
|
||||||
* Smart tab key system (selected text indents line)
|
* Smart tab key system (selected text indents line)
|
||||||
* File manager
|
* File manager
|
||||||
* Find & replace/replace all
|
* Find & replace/replace all
|
||||||
@@ -34,20 +34,21 @@ You can run ICEcoder either online or locally, on Linux, Windows or Mac based pl
|
|||||||
* Adds end tags as you type and in a context aware way
|
* Adds end tags as you type and in a context aware way
|
||||||
* Can rename open files (whoaah!)
|
* Can rename open files (whoaah!)
|
||||||
* CTRL+Enter open current webpage in new tab
|
* CTRL+Enter open current webpage in new tab
|
||||||
* CTRL+S+Enter opens a sticky tab to show live edits
|
* Window to view live edits
|
||||||
* ESC = Comment/Uncomment line, incl partial lines
|
* ESC = Comment/Uncomment line, incl partial lines
|
||||||
* Image viewer
|
* Image viewer
|
||||||
* Colour preview block on CSS colours, ie red, #f00 or RGBA(255,0,0,0.5)
|
* Colour preview block on CSS colours, ie red, #f00 or RGBA(255,0,0,0.5)
|
||||||
* MySQL Database management via Adminer plugin
|
* MySQL Database management via Adminer plugin
|
||||||
* Backs up files every 30 mins or on click of backup plugin icon
|
* Backs up files every 30 mins or on click of backup plugin icon
|
||||||
* Github repo syncing with ICErepo plugin
|
* Github repo syncing with ICErepo plugin
|
||||||
* Shell terminal
|
* Linux terminal
|
||||||
* JS Hint validation as you type
|
* JS Hint validation as you type
|
||||||
* Emmet snippet typing booster
|
* Emmet snippet typing booster
|
||||||
* JavaScript code hinting
|
* HTML & JavaScript code hinting
|
||||||
* Alphanumeric tab sorting
|
* Alphanumeric tab sorting
|
||||||
* Tag wrappers
|
* Tag wrappers
|
||||||
* Config template
|
* Config template
|
||||||
|
* Farbtastic color picker integrated
|
||||||
|
|
||||||
###Installation
|
###Installation
|
||||||
|
|
||||||
@@ -60,7 +61,7 @@ $ git clone git@github:mattpass/ICEcoder
|
|||||||
####Step 2: Place in your document root (online or local)
|
####Step 2: Place in your document root (online or local)
|
||||||
```
|
```
|
||||||
Put in a new sub-dir URL such as yourdomain.com/_coder or localhost/_coder
|
Put in a new sub-dir URL such as yourdomain.com/_coder or localhost/_coder
|
||||||
Set public write permissions (757 recommended) on the 'backups' and 'lib' folders
|
Set write permissions (757 or 775 depending on your system) on the 'backups', 'lib' and 'test' folders plus 'test/test-file1.txt'
|
||||||
```
|
```
|
||||||
|
|
||||||
####Step 3: Start coding
|
####Step 3: Start coding
|
||||||
|
|||||||
107
editor.php
@@ -1,20 +1,22 @@
|
|||||||
<?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; top.ICEcoder.tabDragEnd()" 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; if (!top.ICEcoder.overCloseLink) {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">
|
<link rel="stylesheet" href="<?php echo $ICEcoder["codeMirrorDir"]; ?>/addon/hint/show-hint.css">
|
||||||
<!--
|
<!--
|
||||||
codemirror-compressed.js
|
codemirror-compressed.js
|
||||||
incls: codemirror
|
incls: codemirror
|
||||||
modes: clike, coffeescript, css, javascript, less, php, ruby & xml
|
modes: clike, coffeescript, css, htmlmixed, javascript, less, markdown, php, python, ruby & xml
|
||||||
utils: foldcode, searchcursor, match-highlighter, simple-hint, javascript-hint, closetag
|
utils: closetag, xml-fold, brace-fold, show-hint, javascript-hint, html-hint, searchcursor, match-highlighter
|
||||||
//-->
|
//-->
|
||||||
<script src="<?php echo $ICEcoder["codeMirrorDir"]; ?>/lib/codemirror-compressed.js"></script>
|
<script src="<?php echo $ICEcoder["codeMirrorDir"]; ?>/lib/codemirror-compressed.js"></script>
|
||||||
|
<script src="lib/mmd.js"></script>
|
||||||
|
<script src="lib/foldcode.js"></script>
|
||||||
<?php
|
<?php
|
||||||
if (file_exists(dirname(__FILE__)."/plugins/emmet/emmet.min.js")) {
|
if (file_exists(dirname(__FILE__)."/plugins/emmet/emmet.min.js")) {
|
||||||
echo '<script src="plugins/emmet/emmet.min.js"></script>';
|
echo '<script src="plugins/emmet/emmet.min.js"></script>';
|
||||||
@@ -23,8 +25,10 @@ if (file_exists(dirname(__FILE__)."/plugins/emmet/emmet.min.js")) {
|
|||||||
if ($ICEcoder["theme"]=="default") {echo 'lib/editor.css';} else {echo $ICEcoder["codeMirrorDir"].'/theme/'.$ICEcoder["theme"].'.css';};
|
if ($ICEcoder["theme"]=="default") {echo 'lib/editor.css';} else {echo $ICEcoder["codeMirrorDir"].'/theme/'.$ICEcoder["theme"].'.css';};
|
||||||
$activeLineBG = array_search($ICEcoder["theme"],array("eclipse","elegant","neat")) !== false ? "#ccc" : "#000";
|
$activeLineBG = array_search($ICEcoder["theme"],array("eclipse","elegant","neat")) !== false ? "#ccc" : "#000";
|
||||||
?>">
|
?>">
|
||||||
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
.CodeMirror {position: absolute; top: 0px; width: 100%; font-size: 13px; z-index: 1}
|
/* Make sure this next one remains the 1st item, updated with JS */
|
||||||
|
.CodeMirror {position: absolute; top: 0px; width: 100%; font-size: <?php echo $ICEcoder["fontSize"];?>; 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}
|
||||||
@@ -33,7 +37,16 @@ $activeLineBG = array_search($ICEcoder["theme"],array("eclipse","elegant","neat"
|
|||||||
.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: #b00; color: #fff; font-weight: bold; border-radius: 50%; padding: 0 3px; margin-right: 5px}
|
.lint-error-icon {background: #b00; color: #fff; font-weight: bold; border-radius: 50%; padding: 0 3px; margin-right: 5px}
|
||||||
|
.CodeMirror-foldmarker {font-family: arial; line-height: .3; color: #b00; cursor: pointer;
|
||||||
|
text-shadow: #fff 1px 1px 2px, #fff -1px -1px 2px, #fff 1px -1px 2px, #fff -1px 1px 2px;
|
||||||
|
}
|
||||||
|
.folds {display: inline-block; width: 13px}
|
||||||
|
.fold {position: absolute; display: inline-block; width: 13px; height: 13px; font-size: 14px; text-align: center; cursor: pointer}
|
||||||
|
.foldOn {background: #800; color: #ddd}
|
||||||
|
.foldOff {background: #383838; color: #666}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="lib/file-types.css">
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body style="color: #fff; margin: 0" onKeyDown="return top.ICEcoder.interceptKeys('content', event);" onKeyUp="top.ICEcoder.resetKeys(event);">
|
<body style="color: #fff; margin: 0" onKeyDown="return top.ICEcoder.interceptKeys('content', event);" onKeyUp="top.ICEcoder.resetKeys(event);">
|
||||||
@@ -62,19 +75,26 @@ $activeLineBG = array_search($ICEcoder["theme"],array("eclipse","elegant","neat"
|
|||||||
<div style="float: left">
|
<div style="float: left">
|
||||||
<h2 style="color: rgba(0,198,255,0.7)">files</h2>
|
<h2 style="color: rgba(0,198,255,0.7)">files</h2>
|
||||||
<span style="color:#888">Last 10 files opened:</span><br>
|
<span style="color:#888">Last 10 files opened:</span><br>
|
||||||
|
<ul class="fileManager" style="margin-left: 0; line-height: 20px">
|
||||||
<?php
|
<?php
|
||||||
$last10FilesArray = explode(",",$ICEcoder["last10Files"]);
|
$last10FilesArray = explode(",",$ICEcoder["last10Files"]);
|
||||||
for ($i=0;$i<count($last10FilesArray);$i++) {
|
for ($i=0;$i<count($last10FilesArray);$i++) {
|
||||||
if ($ICEcoder["last10Files"]=="") {
|
if ($ICEcoder["last10Files"]=="") {
|
||||||
echo '[none]<br><br>';
|
echo '[none]<br><br>';
|
||||||
} else {
|
} else {
|
||||||
|
$fileFolderName = str_replace("\\","/",$last10FilesArray[$i]);
|
||||||
|
// Get extension (prefix 'ext-' to prevent invalid classes from extensions that begin with numbers)
|
||||||
|
$ext = "ext-".pathinfo($docRoot.$iceRoot.$fileFolderName, PATHINFO_EXTENSION);
|
||||||
|
$class = 'pft-file '.strtolower($ext);
|
||||||
|
echo '<li class="'.$class.'" style="margin-left: -16px">';
|
||||||
echo '<a style="cursor:pointer" onClick="top.ICEcoder.openFile(\''.str_replace("|","/",$last10FilesArray[$i]).'\')">';
|
echo '<a style="cursor:pointer" onClick="top.ICEcoder.openFile(\''.str_replace("|","/",$last10FilesArray[$i]).'\')">';
|
||||||
echo str_replace($docRoot,"",str_replace("|","/",$last10FilesArray[$i]));
|
echo str_replace($docRoot,"",str_replace("|","/",$last10FilesArray[$i]));
|
||||||
echo '</a><br>'.PHP_EOL;
|
echo '</a></li>'.PHP_EOL;
|
||||||
if ($i==count($last10FilesArray)-1) {echo '<br>'.PHP_EOL;};
|
if ($i==count($last10FilesArray)-1) {echo '<br>'.PHP_EOL;};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
;?>
|
;?>
|
||||||
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style="clear: both">
|
<div style="clear: both">
|
||||||
@@ -98,14 +118,23 @@ $activeLineBG = array_search($ICEcoder["theme"],array("eclipse","elegant","neat"
|
|||||||
}
|
}
|
||||||
},1000);
|
},1000);
|
||||||
</script>
|
</script>
|
||||||
<?php if(is_dir('test')) {?>
|
<?php if(is_dir('test') && !$ICEcoder['demoMode']) {?>
|
||||||
<div style="clear: both">
|
<div style="float: left; margin-right: 50px">
|
||||||
<br><br>
|
<br><br>
|
||||||
<h2 style="color: rgba(0,198,255,0.7)">test suite</h2>
|
<h2 style="color: rgba(0,198,255,0.7)">test suite</h2>
|
||||||
<span style="color:#888">Run unit tests:</span><br>
|
<span style="color:#888">Run unit tests:</span><br>
|
||||||
<a href="javascript:top.ICEcoder.filesFrame.contentWindow.frames['testControl'].location.href = 'test'" style="color: #fff">Run unit tests</a><div id="unitTestResults"></div>
|
<a href="javascript:top.ICEcoder.filesFrame.contentWindow.frames['testControl'].location.href = 'test'" style="color: #fff">Run unit tests</a><div id="unitTestResults"></div>
|
||||||
</div>
|
</div>
|
||||||
<?php ;};?>
|
<?php ;};?>
|
||||||
|
<?php if($ICEcoder['devMode']) {?>
|
||||||
|
<div style="float: left">
|
||||||
|
<br><br>
|
||||||
|
<h2 style="color: rgba(0,198,255,0.7)">dev mode on</h2>
|
||||||
|
<span style="color:#888">Status:</span><br>
|
||||||
|
Using ice-coder.js
|
||||||
|
</div>
|
||||||
|
<?php ;};?>
|
||||||
|
<div style="clear: both"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -117,7 +146,9 @@ CodeMirror.keyMap.ICEcoder = {
|
|||||||
};
|
};
|
||||||
CodeMirror.commands.autocomplete = function(cm) {
|
CodeMirror.commands.autocomplete = function(cm) {
|
||||||
if (top.ICEcoder.caretLocType=="JavaScript") {
|
if (top.ICEcoder.caretLocType=="JavaScript") {
|
||||||
CodeMirror.simpleHint(cm, CodeMirror.javascriptHint);
|
CodeMirror.showHint(cm, CodeMirror.javascriptHint);
|
||||||
|
} else {
|
||||||
|
CodeMirror.showHint(cm, CodeMirror.htmlHint);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -129,19 +160,21 @@ function createNewCMInstance(num) {
|
|||||||
window['cM'+num] = CodeMirror(document.body, {
|
window['cM'+num] = CodeMirror(document.body, {
|
||||||
mode: "application/x-httpd-php",
|
mode: "application/x-httpd-php",
|
||||||
lineNumbers: true,
|
lineNumbers: true,
|
||||||
|
gutters: ["folds","CodeMirror-linenumbers"],
|
||||||
lineWrapping: top.ICEcoder.lineWrapping,
|
lineWrapping: top.ICEcoder.lineWrapping,
|
||||||
indentUnit: top.ICEcoder.tabWidth,
|
indentWithTabs: top.ICEcoder.indentWithTabs,
|
||||||
tabSize: top.ICEcoder.tabWidth,
|
indentUnit: top.ICEcoder.indentSize,
|
||||||
indentWithTabs: true,
|
tabSize: top.ICEcoder.indentSize,
|
||||||
electricChars: false,
|
electricChars: false,
|
||||||
autoCloseTags: true,
|
autoCloseTags: true,
|
||||||
highlightSelectionMatches: true,
|
highlightSelectionMatches: true,
|
||||||
keyMap: "ICEcoder",
|
keyMap: "ICEcoder",
|
||||||
onKeyEvent: function(thisCM, e) {
|
onKeyEvent: function(thisCM, e) {
|
||||||
top.ICEcoder.redoChangedContent(e);
|
top.ICEcoder.redoChangedContent(e);
|
||||||
top.ICEcoder.findReplace('find',true,false);
|
top.ICEcoder.findReplace(top.document.getElementById('find').value,true,false);
|
||||||
top.ICEcoder.getCaretPosition();
|
top.ICEcoder.getCaretPosition();
|
||||||
top.ICEcoder.updateCharDisplay();
|
top.ICEcoder.updateCharDisplay();
|
||||||
|
top.ICEcoder.updateByteDisplay();
|
||||||
tok = thisCM.getTokenAt(thisCM.getCursor());
|
tok = thisCM.getTokenAt(thisCM.getCursor());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -149,6 +182,7 @@ function createNewCMInstance(num) {
|
|||||||
window['cM'+num].on("cursorActivity", function(thisCM) {
|
window['cM'+num].on("cursorActivity", function(thisCM) {
|
||||||
top.ICEcoder.getCaretPosition();
|
top.ICEcoder.getCaretPosition();
|
||||||
top.ICEcoder.updateCharDisplay();
|
top.ICEcoder.updateCharDisplay();
|
||||||
|
top.ICEcoder.updateByteDisplay();
|
||||||
window['cM'+num].removeLineClass(top.ICEcoder['cMActiveLine'+num], "background");
|
window['cM'+num].removeLineClass(top.ICEcoder['cMActiveLine'+num], "background");
|
||||||
if(window['cM'+num].getCursor('start').line == window['cM'+num].getCursor().line) {
|
if(window['cM'+num].getCursor('start').line == window['cM'+num].getCursor().line) {
|
||||||
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");
|
||||||
@@ -166,6 +200,7 @@ function createNewCMInstance(num) {
|
|||||||
top.ICEcoder.getCaretPosition();
|
top.ICEcoder.getCaretPosition();
|
||||||
top.ICEcoder.dontUpdateNest = false;
|
top.ICEcoder.dontUpdateNest = false;
|
||||||
top.ICEcoder.updateCharDisplay();
|
top.ICEcoder.updateCharDisplay();
|
||||||
|
top.ICEcoder.updateByteDisplay();
|
||||||
top.ICEcoder.updateNestingIndicator();
|
top.ICEcoder.updateNestingIndicator();
|
||||||
if (top.ICEcoder.findMode) {
|
if (top.ICEcoder.findMode) {
|
||||||
top.ICEcoder.results.splice(top.ICEcoder.findResult,1);
|
top.ICEcoder.results.splice(top.ICEcoder.findResult,1);
|
||||||
@@ -176,6 +211,38 @@ function createNewCMInstance(num) {
|
|||||||
clearTimeout(window['cM'+num+'waiting']);
|
clearTimeout(window['cM'+num+'waiting']);
|
||||||
window['cM'+num+'waiting'] = setTimeout(top.ICEcoder.updateHints, 100);
|
window['cM'+num+'waiting'] = setTimeout(top.ICEcoder.updateHints, 100);
|
||||||
}
|
}
|
||||||
|
var filepath = top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1];
|
||||||
|
var filename = filepath.substr(filepath.lastIndexOf("/")+1);
|
||||||
|
var fileExt = filename.substr(filename.lastIndexOf(".")+1);
|
||||||
|
for (var i=changeObj.from.line; i<changeObj.from.line+changeObj.text.length; i++) {
|
||||||
|
top.ICEcoder.content.contentWindow.CodeMirror.newFoldFunction(top.ICEcoder.content.contentWindow.CodeMirror[["coffee","css","js","less","php","py","rb","ruby"].indexOf(fileExt) > -1 ? "braceRangeFinder" : "tagRangeFinder"],null,"+","-",true)(thisCM, i);
|
||||||
|
}
|
||||||
|
// Update HTML edited files live
|
||||||
|
if (top.ICEcoder.previewWindow.location) {
|
||||||
|
if (top.ICEcoder.previewWindow.location.pathname==filepath) {
|
||||||
|
if (["htm","html","txt"].indexOf(fileExt) > -1) {
|
||||||
|
top.ICEcoder.previewWindow.document.documentElement.innerHTML = window['cM'+num].getValue();
|
||||||
|
} else if (["md"].indexOf(fileExt) > -1) {
|
||||||
|
top.ICEcoder.previewWindow.document.documentElement.innerHTML = mmd(window['cM'+num].getValue());
|
||||||
|
}
|
||||||
|
} else if (["css"].indexOf(fileExt) > -1) {
|
||||||
|
if (top.ICEcoder.previewWindow.document.documentElement.innerHTML.indexOf(filename) > -1) {
|
||||||
|
var css = window['cM'+num].getValue();
|
||||||
|
var style = document.createElement('style');
|
||||||
|
style.type = 'text/css';
|
||||||
|
style.id = "ICEcoder"+filepath.replace(/\//g,"_");
|
||||||
|
if (style.styleSheet){
|
||||||
|
style.styleSheet.cssText = css;
|
||||||
|
} else {
|
||||||
|
style.appendChild(document.createTextNode(css));
|
||||||
|
}
|
||||||
|
if (top.ICEcoder.previewWindow.document.getElementById(style.id)) {
|
||||||
|
top.ICEcoder.previewWindow.document.documentElement.removeChild(top.ICEcoder.previewWindow.document.getElementById(style.id));
|
||||||
|
}
|
||||||
|
top.ICEcoder.previewWindow.document.documentElement.appendChild(style);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -185,12 +252,11 @@ function createNewCMInstance(num) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
window['cM'+num].on("gutterClick", function(thisCM, line, gutter, clickEvent) {
|
window['cM'+num].on("gutterClick", function(thisCM, line, gutter, clickEvent) {
|
||||||
["JavaScript","CoffeeScript","PHP","Ruby"].indexOf(top.ICEcoder.caretLocType) > -1
|
var filepath = top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1];
|
||||||
|
var filename = filepath.substr(filepath.lastIndexOf("/")+1);
|
||||||
|
var fileExt = filename.substr(filename.lastIndexOf(".")+1);
|
||||||
|
["coffee","css","js","less","php","py","rb","ruby"].indexOf(fileExt) > -1
|
||||||
? codeFoldBrace(window['cM'+num], line) : codeFoldTag(window['cM'+num], line);
|
? codeFoldBrace(window['cM'+num], line) : codeFoldTag(window['cM'+num], line);
|
||||||
window['cM'+num].setGutterMarker(line, "CodeMirror-linenumbers", document.createTextNode("+ "+(line+1)));
|
|
||||||
setTimeout(function() {
|
|
||||||
window['cM'+num].setGutterMarker(line, "CodeMirror-linenumbers", null);
|
|
||||||
},1000);
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -198,9 +264,8 @@ function createNewCMInstance(num) {
|
|||||||
top.ICEcoder['cMActiveLine'+num] = window['cM'+num].addLineClass(0, "background", "cm-s-activeLine");
|
top.ICEcoder['cMActiveLine'+num] = window['cM'+num].addLineClass(0, "background", "cm-s-activeLine");
|
||||||
};
|
};
|
||||||
|
|
||||||
// var top.ICEcoder.foldStyle = '<span style="position: absolute; display: inline-block; width: 13px; height: 13px; left: 0; background-color: #b00; color: #fff; text-align: center; cursor: pointer"><span style="position: relative; left: -1px">+</span></span> %N%';
|
var codeFoldTag = CodeMirror.newFoldFunction(CodeMirror.tagRangeFinder,null,"+","-",false);
|
||||||
var codeFoldTag = CodeMirror.newFoldFunction(CodeMirror.tagRangeFinder);
|
var codeFoldBrace = CodeMirror.newFoldFunction(CodeMirror.braceRangeFinder,null,"+","-",false);
|
||||||
var codeFoldBrace = CodeMirror.newFoldFunction(CodeMirror.braceRangeFinder);
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
341
farbtastic/LICENSE.txt
Normal file
@@ -0,0 +1,341 @@
|
|||||||
|
|
||||||
|
GNU GENERAL PUBLIC LICENSE
|
||||||
|
Version 2, June 1991
|
||||||
|
|
||||||
|
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||||
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
|
Preamble
|
||||||
|
|
||||||
|
The licenses for most software are designed to take away your
|
||||||
|
freedom to share and change it. By contrast, the GNU General Public
|
||||||
|
License is intended to guarantee your freedom to share and change free
|
||||||
|
software--to make sure the software is free for all its users. This
|
||||||
|
General Public License applies to most of the Free Software
|
||||||
|
Foundation's software and to any other program whose authors commit to
|
||||||
|
using it. (Some other Free Software Foundation software is covered by
|
||||||
|
the GNU Lesser General Public License instead.) You can apply it to
|
||||||
|
your programs, too.
|
||||||
|
|
||||||
|
When we speak of free software, we are referring to freedom, not
|
||||||
|
price. Our General Public Licenses are designed to make sure that you
|
||||||
|
have the freedom to distribute copies of free software (and charge for
|
||||||
|
this service if you wish), that you receive source code or can get it
|
||||||
|
if you want it, that you can change the software or use pieces of it
|
||||||
|
in new free programs; and that you know you can do these things.
|
||||||
|
|
||||||
|
To protect your rights, we need to make restrictions that forbid
|
||||||
|
anyone to deny you these rights or to ask you to surrender the rights.
|
||||||
|
These restrictions translate to certain responsibilities for you if you
|
||||||
|
distribute copies of the software, or if you modify it.
|
||||||
|
|
||||||
|
For example, if you distribute copies of such a program, whether
|
||||||
|
gratis or for a fee, you must give the recipients all the rights that
|
||||||
|
you have. You must make sure that they, too, receive or can get the
|
||||||
|
source code. And you must show them these terms so they know their
|
||||||
|
rights.
|
||||||
|
|
||||||
|
We protect your rights with two steps: (1) copyright the software, and
|
||||||
|
(2) offer you this license which gives you legal permission to copy,
|
||||||
|
distribute and/or modify the software.
|
||||||
|
|
||||||
|
Also, for each author's protection and ours, we want to make certain
|
||||||
|
that everyone understands that there is no warranty for this free
|
||||||
|
software. If the software is modified by someone else and passed on, we
|
||||||
|
want its recipients to know that what they have is not the original, so
|
||||||
|
that any problems introduced by others will not reflect on the original
|
||||||
|
authors' reputations.
|
||||||
|
|
||||||
|
Finally, any free program is threatened constantly by software
|
||||||
|
patents. We wish to avoid the danger that redistributors of a free
|
||||||
|
program will individually obtain patent licenses, in effect making the
|
||||||
|
program proprietary. To prevent this, we have made it clear that any
|
||||||
|
patent must be licensed for everyone's free use or not licensed at all.
|
||||||
|
|
||||||
|
The precise terms and conditions for copying, distribution and
|
||||||
|
modification follow.
|
||||||
|
|
||||||
|
GNU GENERAL PUBLIC LICENSE
|
||||||
|
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||||
|
|
||||||
|
0. This License applies to any program or other work which contains
|
||||||
|
a notice placed by the copyright holder saying it may be distributed
|
||||||
|
under the terms of this General Public License. The "Program", below,
|
||||||
|
refers to any such program or work, and a "work based on the Program"
|
||||||
|
means either the Program or any derivative work under copyright law:
|
||||||
|
that is to say, a work containing the Program or a portion of it,
|
||||||
|
either verbatim or with modifications and/or translated into another
|
||||||
|
language. (Hereinafter, translation is included without limitation in
|
||||||
|
the term "modification".) Each licensee is addressed as "you".
|
||||||
|
|
||||||
|
Activities other than copying, distribution and modification are not
|
||||||
|
covered by this License; they are outside its scope. The act of
|
||||||
|
running the Program is not restricted, and the output from the Program
|
||||||
|
is covered only if its contents constitute a work based on the
|
||||||
|
Program (independent of having been made by running the Program).
|
||||||
|
Whether that is true depends on what the Program does.
|
||||||
|
|
||||||
|
1. You may copy and distribute verbatim copies of the Program's
|
||||||
|
source code as you receive it, in any medium, provided that you
|
||||||
|
conspicuously and appropriately publish on each copy an appropriate
|
||||||
|
copyright notice and disclaimer of warranty; keep intact all the
|
||||||
|
notices that refer to this License and to the absence of any warranty;
|
||||||
|
and give any other recipients of the Program a copy of this License
|
||||||
|
along with the Program.
|
||||||
|
|
||||||
|
You may charge a fee for the physical act of transferring a copy, and
|
||||||
|
you may at your option offer warranty protection in exchange for a fee.
|
||||||
|
|
||||||
|
2. You may modify your copy or copies of the Program or any portion
|
||||||
|
of it, thus forming a work based on the Program, and copy and
|
||||||
|
distribute such modifications or work under the terms of Section 1
|
||||||
|
above, provided that you also meet all of these conditions:
|
||||||
|
|
||||||
|
a) You must cause the modified files to carry prominent notices
|
||||||
|
stating that you changed the files and the date of any change.
|
||||||
|
|
||||||
|
b) You must cause any work that you distribute or publish, that in
|
||||||
|
whole or in part contains or is derived from the Program or any
|
||||||
|
part thereof, to be licensed as a whole at no charge to all third
|
||||||
|
parties under the terms of this License.
|
||||||
|
|
||||||
|
c) If the modified program normally reads commands interactively
|
||||||
|
when run, you must cause it, when started running for such
|
||||||
|
interactive use in the most ordinary way, to print or display an
|
||||||
|
announcement including an appropriate copyright notice and a
|
||||||
|
notice that there is no warranty (or else, saying that you provide
|
||||||
|
a warranty) and that users may redistribute the program under
|
||||||
|
these conditions, and telling the user how to view a copy of this
|
||||||
|
License. (Exception: if the Program itself is interactive but
|
||||||
|
does not normally print such an announcement, your work based on
|
||||||
|
the Program is not required to print an announcement.)
|
||||||
|
|
||||||
|
These requirements apply to the modified work as a whole. If
|
||||||
|
identifiable sections of that work are not derived from the Program,
|
||||||
|
and can be reasonably considered independent and separate works in
|
||||||
|
themselves, then this License, and its terms, do not apply to those
|
||||||
|
sections when you distribute them as separate works. But when you
|
||||||
|
distribute the same sections as part of a whole which is a work based
|
||||||
|
on the Program, the distribution of the whole must be on the terms of
|
||||||
|
this License, whose permissions for other licensees extend to the
|
||||||
|
entire whole, and thus to each and every part regardless of who wrote it.
|
||||||
|
|
||||||
|
Thus, it is not the intent of this section to claim rights or contest
|
||||||
|
your rights to work written entirely by you; rather, the intent is to
|
||||||
|
exercise the right to control the distribution of derivative or
|
||||||
|
collective works based on the Program.
|
||||||
|
|
||||||
|
In addition, mere aggregation of another work not based on the Program
|
||||||
|
with the Program (or with a work based on the Program) on a volume of
|
||||||
|
a storage or distribution medium does not bring the other work under
|
||||||
|
the scope of this License.
|
||||||
|
|
||||||
|
3. You may copy and distribute the Program (or a work based on it,
|
||||||
|
under Section 2) in object code or executable form under the terms of
|
||||||
|
Sections 1 and 2 above provided that you also do one of the following:
|
||||||
|
|
||||||
|
a) Accompany it with the complete corresponding machine-readable
|
||||||
|
source code, which must be distributed under the terms of Sections
|
||||||
|
1 and 2 above on a medium customarily used for software interchange; or,
|
||||||
|
|
||||||
|
b) Accompany it with a written offer, valid for at least three
|
||||||
|
years, to give any third party, for a charge no more than your
|
||||||
|
cost of physically performing source distribution, a complete
|
||||||
|
machine-readable copy of the corresponding source code, to be
|
||||||
|
distributed under the terms of Sections 1 and 2 above on a medium
|
||||||
|
customarily used for software interchange; or,
|
||||||
|
|
||||||
|
c) Accompany it with the information you received as to the offer
|
||||||
|
to distribute corresponding source code. (This alternative is
|
||||||
|
allowed only for noncommercial distribution and only if you
|
||||||
|
received the program in object code or executable form with such
|
||||||
|
an offer, in accord with Subsection b above.)
|
||||||
|
|
||||||
|
The source code for a work means the preferred form of the work for
|
||||||
|
making modifications to it. For an executable work, complete source
|
||||||
|
code means all the source code for all modules it contains, plus any
|
||||||
|
associated interface definition files, plus the scripts used to
|
||||||
|
control compilation and installation of the executable. However, as a
|
||||||
|
special exception, the source code distributed need not include
|
||||||
|
anything that is normally distributed (in either source or binary
|
||||||
|
form) with the major components (compiler, kernel, and so on) of the
|
||||||
|
operating system on which the executable runs, unless that component
|
||||||
|
itself accompanies the executable.
|
||||||
|
|
||||||
|
If distribution of executable or object code is made by offering
|
||||||
|
access to copy from a designated place, then offering equivalent
|
||||||
|
access to copy the source code from the same place counts as
|
||||||
|
distribution of the source code, even though third parties are not
|
||||||
|
compelled to copy the source along with the object code.
|
||||||
|
|
||||||
|
4. You may not copy, modify, sublicense, or distribute the Program
|
||||||
|
except as expressly provided under this License. Any attempt
|
||||||
|
otherwise to copy, modify, sublicense or distribute the Program is
|
||||||
|
void, and will automatically terminate your rights under this License.
|
||||||
|
However, parties who have received copies, or rights, from you under
|
||||||
|
this License will not have their licenses terminated so long as such
|
||||||
|
parties remain in full compliance.
|
||||||
|
|
||||||
|
5. You are not required to accept this License, since you have not
|
||||||
|
signed it. However, nothing else grants you permission to modify or
|
||||||
|
distribute the Program or its derivative works. These actions are
|
||||||
|
prohibited by law if you do not accept this License. Therefore, by
|
||||||
|
modifying or distributing the Program (or any work based on the
|
||||||
|
Program), you indicate your acceptance of this License to do so, and
|
||||||
|
all its terms and conditions for copying, distributing or modifying
|
||||||
|
the Program or works based on it.
|
||||||
|
|
||||||
|
6. Each time you redistribute the Program (or any work based on the
|
||||||
|
Program), the recipient automatically receives a license from the
|
||||||
|
original licensor to copy, distribute or modify the Program subject to
|
||||||
|
these terms and conditions. You may not impose any further
|
||||||
|
restrictions on the recipients' exercise of the rights granted herein.
|
||||||
|
You are not responsible for enforcing compliance by third parties to
|
||||||
|
this License.
|
||||||
|
|
||||||
|
7. If, as a consequence of a court judgment or allegation of patent
|
||||||
|
infringement or for any other reason (not limited to patent issues),
|
||||||
|
conditions are imposed on you (whether by court order, agreement or
|
||||||
|
otherwise) that contradict the conditions of this License, they do not
|
||||||
|
excuse you from the conditions of this License. If you cannot
|
||||||
|
distribute so as to satisfy simultaneously your obligations under this
|
||||||
|
License and any other pertinent obligations, then as a consequence you
|
||||||
|
may not distribute the Program at all. For example, if a patent
|
||||||
|
license would not permit royalty-free redistribution of the Program by
|
||||||
|
all those who receive copies directly or indirectly through you, then
|
||||||
|
the only way you could satisfy both it and this License would be to
|
||||||
|
refrain entirely from distribution of the Program.
|
||||||
|
|
||||||
|
If any portion of this section is held invalid or unenforceable under
|
||||||
|
any particular circumstance, the balance of the section is intended to
|
||||||
|
apply and the section as a whole is intended to apply in other
|
||||||
|
circumstances.
|
||||||
|
|
||||||
|
It is not the purpose of this section to induce you to infringe any
|
||||||
|
patents or other property right claims or to contest validity of any
|
||||||
|
such claims; this section has the sole purpose of protecting the
|
||||||
|
integrity of the free software distribution system, which is
|
||||||
|
implemented by public license practices. Many people have made
|
||||||
|
generous contributions to the wide range of software distributed
|
||||||
|
through that system in reliance on consistent application of that
|
||||||
|
system; it is up to the author/donor to decide if he or she is willing
|
||||||
|
to distribute software through any other system and a licensee cannot
|
||||||
|
impose that choice.
|
||||||
|
|
||||||
|
This section is intended to make thoroughly clear what is believed to
|
||||||
|
be a consequence of the rest of this License.
|
||||||
|
|
||||||
|
8. If the distribution and/or use of the Program is restricted in
|
||||||
|
certain countries either by patents or by copyrighted interfaces, the
|
||||||
|
original copyright holder who places the Program under this License
|
||||||
|
may add an explicit geographical distribution limitation excluding
|
||||||
|
those countries, so that distribution is permitted only in or among
|
||||||
|
countries not thus excluded. In such case, this License incorporates
|
||||||
|
the limitation as if written in the body of this License.
|
||||||
|
|
||||||
|
9. The Free Software Foundation may publish revised and/or new versions
|
||||||
|
of the General Public License from time to time. Such new versions will
|
||||||
|
be similar in spirit to the present version, but may differ in detail to
|
||||||
|
address new problems or concerns.
|
||||||
|
|
||||||
|
Each version is given a distinguishing version number. If the Program
|
||||||
|
specifies a version number of this License which applies to it and "any
|
||||||
|
later version", you have the option of following the terms and conditions
|
||||||
|
either of that version or of any later version published by the Free
|
||||||
|
Software Foundation. If the Program does not specify a version number of
|
||||||
|
this License, you may choose any version ever published by the Free Software
|
||||||
|
Foundation.
|
||||||
|
|
||||||
|
10. If you wish to incorporate parts of the Program into other free
|
||||||
|
programs whose distribution conditions are different, write to the author
|
||||||
|
to ask for permission. For software which is copyrighted by the Free
|
||||||
|
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||||
|
make exceptions for this. Our decision will be guided by the two goals
|
||||||
|
of preserving the free status of all derivatives of our free software and
|
||||||
|
of promoting the sharing and reuse of software generally.
|
||||||
|
|
||||||
|
NO WARRANTY
|
||||||
|
|
||||||
|
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||||
|
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||||
|
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||||
|
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||||
|
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||||
|
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||||
|
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||||
|
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||||
|
REPAIR OR CORRECTION.
|
||||||
|
|
||||||
|
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||||
|
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||||
|
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||||
|
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||||
|
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||||
|
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||||
|
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||||
|
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||||
|
POSSIBILITY OF SUCH DAMAGES.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
How to Apply These Terms to Your New Programs
|
||||||
|
|
||||||
|
If you develop a new program, and you want it to be of the greatest
|
||||||
|
possible use to the public, the best way to achieve this is to make it
|
||||||
|
free software which everyone can redistribute and change under these terms.
|
||||||
|
|
||||||
|
To do so, attach the following notices to the program. It is safest
|
||||||
|
to attach them to the start of each source file to most effectively
|
||||||
|
convey the exclusion of warranty; and each file should have at least
|
||||||
|
the "copyright" line and a pointer to where the full notice is found.
|
||||||
|
|
||||||
|
<one line to give the program's name and a brief idea of what it does.>
|
||||||
|
Copyright (C) <year> <name of author>
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation; either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
|
|
||||||
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|
||||||
|
If the program is interactive, make it output a short notice like this
|
||||||
|
when it starts in an interactive mode:
|
||||||
|
|
||||||
|
Gnomovision version 69, Copyright (C) year name of author
|
||||||
|
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||||
|
This is free software, and you are welcome to redistribute it
|
||||||
|
under certain conditions; type `show c' for details.
|
||||||
|
|
||||||
|
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||||
|
parts of the General Public License. Of course, the commands you use may
|
||||||
|
be called something other than `show w' and `show c'; they could even be
|
||||||
|
mouse-clicks or menu items--whatever suits your program.
|
||||||
|
|
||||||
|
You should also get your employer (if you work as a programmer) or your
|
||||||
|
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||||
|
necessary. Here is a sample; alter the names:
|
||||||
|
|
||||||
|
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||||
|
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||||
|
|
||||||
|
<signature of Ty Coon>, 1 April 1989
|
||||||
|
Ty Coon, President of Vice
|
||||||
|
|
||||||
|
This General Public License does not permit incorporating your program into
|
||||||
|
proprietary programs. If your program is a subroutine library, you may
|
||||||
|
consider it more useful to permit linking proprietary applications with the
|
||||||
|
library. If this is what you want to do, use the GNU Lesser General
|
||||||
|
Public License instead of this License.
|
||||||
49
farbtastic/farbtastic.css
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
.picker {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
.farbtastic {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
.farbtastic * {
|
||||||
|
position: absolute;
|
||||||
|
cursor: crosshair;
|
||||||
|
}
|
||||||
|
.farbtastic, .farbtastic .wheel {
|
||||||
|
width: 195px;
|
||||||
|
height: 195px;
|
||||||
|
}
|
||||||
|
.farbtastic .color, .farbtastic .overlay {
|
||||||
|
top: 47px;
|
||||||
|
left: 47px;
|
||||||
|
width: 101px;
|
||||||
|
height: 101px;
|
||||||
|
}
|
||||||
|
.farbtastic .wheel {
|
||||||
|
background: url(wheel.png) no-repeat;
|
||||||
|
width: 195px;
|
||||||
|
height: 195px;
|
||||||
|
}
|
||||||
|
.farbtastic .overlay {
|
||||||
|
background: url(mask.png) no-repeat;
|
||||||
|
}
|
||||||
|
.farbtastic .marker {
|
||||||
|
width: 17px;
|
||||||
|
height: 17px;
|
||||||
|
margin: -8px 0 0 -8px;
|
||||||
|
overflow: hidden;
|
||||||
|
background: url(marker.png) no-repeat;
|
||||||
|
}
|
||||||
|
.colorValue {
|
||||||
|
border: 0;
|
||||||
|
width: 105px;
|
||||||
|
padding-left: 5px
|
||||||
|
}
|
||||||
|
.insertColorValue {
|
||||||
|
background: #888;
|
||||||
|
color: #fff;
|
||||||
|
height: 18px;
|
||||||
|
width: 60px;
|
||||||
|
border: 0;
|
||||||
|
margin-left: 5px;
|
||||||
|
cursor: pointer
|
||||||
|
}
|
||||||
253
farbtastic/farbtastic.js
Normal file
@@ -0,0 +1,253 @@
|
|||||||
|
/*!
|
||||||
|
* Farbtastic: NON jQuery color picker plug-in v1.4, based on v1.3u
|
||||||
|
*
|
||||||
|
* Licensed under the GPL license:
|
||||||
|
* http://www.gnu.org/licenses/gpl.html
|
||||||
|
*/
|
||||||
|
|
||||||
|
farbtasticFunc = function (options) {
|
||||||
|
farbtastic(this, options);
|
||||||
|
return this;
|
||||||
|
};
|
||||||
|
|
||||||
|
farbtastic = function (container, callback) {
|
||||||
|
var container = document.getElementById(container);
|
||||||
|
var callback = document.getElementById(callback);
|
||||||
|
return container.farbtastic || (container.farbtastic = new _farbtastic(container, callback));
|
||||||
|
};
|
||||||
|
|
||||||
|
_farbtastic = function (container, callback) {
|
||||||
|
// Store farbtastic object
|
||||||
|
var fb = this;
|
||||||
|
|
||||||
|
// Insert markup
|
||||||
|
container.innerHTML = '<div class="farbtastic"><div class="color"></div><div class="wheel"></div><div class="overlay"></div><div class="h-marker marker"></div><div class="sl-marker marker"></div></div>';
|
||||||
|
fb.wheel = document.getElementsByClassName('wheel')[0];
|
||||||
|
// Dimensions
|
||||||
|
fb.radius = 84;
|
||||||
|
fb.square = 100;
|
||||||
|
fb.width = 194;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Link to the given element(s) or callback.
|
||||||
|
*/
|
||||||
|
fb.linkTo = function (callback) {
|
||||||
|
// Unbind previous nodes
|
||||||
|
if (typeof fb.callback == 'object') {
|
||||||
|
console.log("Doesn't do anything?");
|
||||||
|
fb.callback.removeEventListener('keyup', fb.updateValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Reset color
|
||||||
|
fb.color = null;
|
||||||
|
|
||||||
|
// Bind callback or elements
|
||||||
|
if (typeof callback == 'function') {
|
||||||
|
fb.callback = callback;
|
||||||
|
}
|
||||||
|
else if (typeof callback == 'object' || typeof callback == 'string') {
|
||||||
|
fb.callback = callback;
|
||||||
|
fb.callback.addEventListener('keyup',fb.updateValue);
|
||||||
|
if (fb.callback.value) {
|
||||||
|
fb.setColor(fb.callback.value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return this;
|
||||||
|
};
|
||||||
|
fb.updateValue = function (event) {
|
||||||
|
if (this.value && this.value != fb.color) {
|
||||||
|
fb.setColor(this.value);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Change color with HTML syntax #123456
|
||||||
|
*/
|
||||||
|
fb.setColor = function (color) {
|
||||||
|
var unpack = fb.unpack(color);
|
||||||
|
if (fb.color != color && unpack) {
|
||||||
|
fb.color = color;
|
||||||
|
fb.rgb = unpack;
|
||||||
|
fb.hsl = fb.RGBToHSL(fb.rgb);
|
||||||
|
fb.updateDisplay();
|
||||||
|
}
|
||||||
|
return this;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Change color with HSL triplet [0..1, 0..1, 0..1]
|
||||||
|
*/
|
||||||
|
fb.setHSL = function (hsl) {
|
||||||
|
fb.hsl = hsl;
|
||||||
|
fb.rgb = fb.HSLToRGB(hsl);
|
||||||
|
fb.color = fb.pack(fb.rgb);
|
||||||
|
fb.updateDisplay();
|
||||||
|
return this;
|
||||||
|
};
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve the coordinates of the given event relative to the center
|
||||||
|
* of the widget.
|
||||||
|
*/
|
||||||
|
fb.widgetCoords = function (event) {
|
||||||
|
return { x: (event.pageX - fb.wheel.offsetParent.offsetLeft) - fb.width / 2, y: (event.pageY - fb.wheel.offsetParent.offsetTop) - fb.width / 2 };
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Mousedown handler
|
||||||
|
*/
|
||||||
|
fb.mousedown = function (event) {
|
||||||
|
// Capture mouse
|
||||||
|
if (!document.dragging) {
|
||||||
|
document.addEventListener('mousemove', fb.mousemove);
|
||||||
|
document.addEventListener('mouseup', fb.mouseup);
|
||||||
|
document.dragging = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check which area is being dragged
|
||||||
|
var pos = fb.widgetCoords(event);
|
||||||
|
fb.circleDrag = Math.max(Math.abs(pos.x), Math.abs(pos.y)) * 2 > fb.square;
|
||||||
|
|
||||||
|
// Process
|
||||||
|
fb.mousemove(event);
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Mousemove handler
|
||||||
|
*/
|
||||||
|
fb.mousemove = function (event) {
|
||||||
|
// Get coordinates relative to color picker center
|
||||||
|
var pos = fb.widgetCoords(event);
|
||||||
|
|
||||||
|
// Set new HSL parameters
|
||||||
|
if (fb.circleDrag) {
|
||||||
|
var hue = Math.atan2(pos.x, -pos.y) / 6.28;
|
||||||
|
if (hue < 0) hue += 1;
|
||||||
|
fb.setHSL([hue, fb.hsl[1], fb.hsl[2]]);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
var sat = Math.max(0, Math.min(1, -(pos.x / fb.square) + .5));
|
||||||
|
var lum = Math.max(0, Math.min(1, -(pos.y / fb.square) + .5));
|
||||||
|
fb.setHSL([fb.hsl[0], sat, lum]);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Mouseup handler
|
||||||
|
*/
|
||||||
|
fb.mouseup = function () {
|
||||||
|
// Uncapture mouse
|
||||||
|
document.removeEventListener('mousemove', fb.mousemove);
|
||||||
|
document.removeEventListener('mouseup', fb.mouseup);
|
||||||
|
document.dragging = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update the markers and styles
|
||||||
|
*/
|
||||||
|
fb.updateDisplay = function () {
|
||||||
|
// Markers
|
||||||
|
var angle = fb.hsl[0] * 6.28;
|
||||||
|
document.getElementsByClassName('h-marker')[0].style.left = Math.round(Math.sin(angle) * fb.radius + fb.width / 2) + 'px';
|
||||||
|
document.getElementsByClassName('h-marker')[0].style.top = Math.round(-Math.cos(angle) * fb.radius + fb.width / 2) + 'px';
|
||||||
|
|
||||||
|
document.getElementsByClassName('sl-marker')[0].style.left = Math.round(fb.square * (.5 - fb.hsl[1]) + fb.width / 2) + 'px';
|
||||||
|
document.getElementsByClassName('sl-marker')[0].style.top = Math.round(fb.square * (.5 - fb.hsl[2]) + fb.width / 2) + 'px';
|
||||||
|
|
||||||
|
// Saturation/Luminance gradient
|
||||||
|
document.getElementsByClassName('color')[0].style.backgroundColor = fb.pack(fb.HSLToRGB([fb.hsl[0], 1, 0.5]));
|
||||||
|
|
||||||
|
// Linked elements or callback
|
||||||
|
if (typeof fb.callback == 'object') {
|
||||||
|
// Set background/foreground color
|
||||||
|
document.getElementById(fb.callback.id).style.backgroundColor = document.getElementById(fb.callback.id + 'RGB').style.backgroundColor = fb.color;
|
||||||
|
document.getElementById(fb.callback.id).style.color = document.getElementById(fb.callback.id + 'RGB').style.color = fb.hsl[2] > 0.5 ? '#000' : '#fff';
|
||||||
|
document.getElementById('colorRGB').value = document.getElementById(fb.callback.id).style.backgroundColor.replace(/\s/g,'');
|
||||||
|
|
||||||
|
// Change linked value
|
||||||
|
if (callback.value && callback.value != fb.color) {
|
||||||
|
callback.value = fb.color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (typeof fb.callback == 'function') {
|
||||||
|
fb.callback.call(fb, fb.color);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Various color utility functions */
|
||||||
|
fb.pack = function (rgb) {
|
||||||
|
var r = Math.round(rgb[0] * 255);
|
||||||
|
var g = Math.round(rgb[1] * 255);
|
||||||
|
var b = Math.round(rgb[2] * 255);
|
||||||
|
return '#' + (r < 16 ? '0' : '') + r.toString(16) +
|
||||||
|
(g < 16 ? '0' : '') + g.toString(16) +
|
||||||
|
(b < 16 ? '0' : '') + b.toString(16);
|
||||||
|
};
|
||||||
|
|
||||||
|
fb.unpack = function (color) {
|
||||||
|
if (color.length == 7) {
|
||||||
|
return [parseInt('0x' + color.substring(1, 3)) / 255,
|
||||||
|
parseInt('0x' + color.substring(3, 5)) / 255,
|
||||||
|
parseInt('0x' + color.substring(5, 7)) / 255];
|
||||||
|
}
|
||||||
|
else if (color.length == 4) {
|
||||||
|
return [parseInt('0x' + color.substring(1, 2)) / 15,
|
||||||
|
parseInt('0x' + color.substring(2, 3)) / 15,
|
||||||
|
parseInt('0x' + color.substring(3, 4)) / 15];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
fb.HSLToRGB = function (hsl) {
|
||||||
|
var m1, m2, r, g, b;
|
||||||
|
var h = hsl[0], s = hsl[1], l = hsl[2];
|
||||||
|
m2 = (l <= 0.5) ? l * (s + 1) : l + s - l*s;
|
||||||
|
m1 = l * 2 - m2;
|
||||||
|
return [this.hueToRGB(m1, m2, h+0.33333),
|
||||||
|
this.hueToRGB(m1, m2, h),
|
||||||
|
this.hueToRGB(m1, m2, h-0.33333)];
|
||||||
|
};
|
||||||
|
|
||||||
|
fb.hueToRGB = function (m1, m2, h) {
|
||||||
|
h = (h < 0) ? h + 1 : ((h > 1) ? h - 1 : h);
|
||||||
|
if (h * 6 < 1) return m1 + (m2 - m1) * h * 6;
|
||||||
|
if (h * 2 < 1) return m2;
|
||||||
|
if (h * 3 < 2) return m1 + (m2 - m1) * (0.66666 - h) * 6;
|
||||||
|
return m1;
|
||||||
|
};
|
||||||
|
|
||||||
|
fb.RGBToHSL = function (rgb) {
|
||||||
|
var min, max, delta, h, s, l;
|
||||||
|
var r = rgb[0], g = rgb[1], b = rgb[2];
|
||||||
|
min = Math.min(r, Math.min(g, b));
|
||||||
|
max = Math.max(r, Math.max(g, b));
|
||||||
|
delta = max - min;
|
||||||
|
l = (min + max) / 2;
|
||||||
|
s = 0;
|
||||||
|
if (l > 0 && l < 1) {
|
||||||
|
s = delta / (l < 0.5 ? (2 * l) : (2 - 2 * l));
|
||||||
|
}
|
||||||
|
h = 0;
|
||||||
|
if (delta > 0) {
|
||||||
|
if (max == r && max != g) h += (g - b) / delta;
|
||||||
|
if (max == g && max != b) h += (2 + (b - r) / delta);
|
||||||
|
if (max == b && max != r) h += (4 + (r - g) / delta);
|
||||||
|
h /= 6;
|
||||||
|
}
|
||||||
|
return [h, s, l];
|
||||||
|
};
|
||||||
|
|
||||||
|
// Install mousedown handler (the others are set on the document on-demand)
|
||||||
|
document.getElementsByClassName('farbtastic')[0].onmousedown = fb.mousedown;
|
||||||
|
|
||||||
|
// Init color
|
||||||
|
fb.setColor('#000000');
|
||||||
|
|
||||||
|
// Set linked elements/callback
|
||||||
|
if (callback) {
|
||||||
|
fb.linkTo(callback);
|
||||||
|
}
|
||||||
|
};
|
||||||
BIN
farbtastic/marker.png
Normal file
|
After Width: | Height: | Size: 652 B |
BIN
farbtastic/mask.png
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
farbtastic/wheel.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
@@ -1,12 +1,13 @@
|
|||||||
<?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; 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()">
|
<html onMouseDown="top.ICEcoder.mouseDown=true" onMouseUp="top.ICEcoder.mouseDown=false; if (!top.ICEcoder.overCloseLink) {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(event)" onClick="top.ICEcoder.selectFileFolder(event)">
|
||||||
<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">
|
||||||
<link rel="stylesheet" type="text/css" href="lib/files.css">
|
<link rel="stylesheet" type="text/css" href="lib/files.css">
|
||||||
<script src="lib/ice-coder.js" type="text/javascript"></script>
|
<link rel="stylesheet" type="text/css" href="lib/file-types.css">
|
||||||
|
<script src="lib/ice-coder<?php if (!$ICEcoder['devMode']) {echo '.min';};?>.js" type="text/javascript"></script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body 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);">
|
||||||
|
|||||||
BIN
images/color-picker.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 7.1 KiB After Width: | Height: | Size: 8.0 KiB |
|
Before Width: | Height: | Size: 7.0 KiB After Width: | Height: | Size: 7.1 KiB |
|
Before Width: | Height: | Size: 158 B After Width: | Height: | Size: 164 B |
|
Before Width: | Height: | Size: 435 B After Width: | Height: | Size: 1.2 KiB |
63
index.php
@@ -8,15 +8,25 @@ 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 = explode("\n",file_get_contents("http://icecoder.net/latest-version?thisVersion=".$ICEcoder["versionNo"]));
|
$icv_url = "http://icecoder.net/latest-version?thisVersion=".$ICEcoder["versionNo"];
|
||||||
$icv = $icv[0];
|
if (ini_get('allow_url_fopen')) {
|
||||||
if ($ICEcoder["versionNo"]<$icv) {
|
$icvInfo = explode("\n",file_get_contents($icv_url,false,$context));
|
||||||
$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>');";
|
} elseif (function_exists('curl_init')) {
|
||||||
|
$ch = curl_init($icv_url);
|
||||||
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||||
|
$icvInfo = explode("\n", curl_exec($ch));
|
||||||
|
}
|
||||||
|
$icv = $icvInfo[0];
|
||||||
|
$icvI = str_replace('"','\\\'',$icvInfo[1]);
|
||||||
|
$thisV = $ICEcoder["versionNo"];
|
||||||
|
if (strpos($thisV,"beta")>-1 && !strpos($icv,"beta") && str_replace(" beta","",$thisV) == $icv) {$thisV-=0.1;};
|
||||||
|
if ($thisV<$icv) {
|
||||||
|
$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><br>".$icvI."');";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html onMouseDown="top.ICEcoder.mouseDown=true" onMouseUp="top.ICEcoder.mouseDown=false;top.ICEcoder.tabDragEnd()" onMouseMove="if(top.ICEcoder) {top.ICEcoder.getMouseXY(event,'top');top.ICEcoder.canResizeFilesW()}">
|
<html onMouseDown="top.ICEcoder.mouseDown=true" onMouseUp="top.ICEcoder.mouseDown=false; if (!top.ICEcoder.overCloseLink) {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">
|
||||||
@@ -32,12 +42,15 @@ window.onbeforeunload = function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<script language="JavaScript" src="lib/ice-coder.js"></script>
|
<script language="JavaScript" src="lib/ice-coder<?php if (!$ICEcoder['devMode']) {echo '.min';};?>.js"></script>
|
||||||
|
<script src="lib/mmd.js"></script>
|
||||||
<?php
|
<?php
|
||||||
if (file_exists(dirname(__FILE__)."/plugins/jshint/jshint.js")) {
|
if (file_exists(dirname(__FILE__)."/plugins/jshint/jshint.js")) {
|
||||||
echo '<script src="plugins/jshint/jshint.js"></script>';
|
echo '<script src="plugins/jshint/jshint.js"></script>';
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
<script src="farbtastic/farbtastic.js"></script>
|
||||||
|
<link rel="stylesheet" href="farbtastic/farbtastic.css" type="text/css">
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body onLoad="<?php
|
<body onLoad="<?php
|
||||||
@@ -49,15 +62,22 @@ if (file_exists(dirname(__FILE__)."/plugins/jshint/jshint.js")) {
|
|||||||
echo "];top.ICEcoder.theme = '";
|
echo "];top.ICEcoder.theme = '";
|
||||||
echo $ICEcoder["theme"]=="default" ? 'icecoder' : $ICEcoder["theme"];
|
echo $ICEcoder["theme"]=="default" ? 'icecoder' : $ICEcoder["theme"];
|
||||||
echo "'";
|
echo "'";
|
||||||
|
echo ";top.ICEcoder.fontSize = '";
|
||||||
|
echo $ICEcoder["fontSize"];
|
||||||
|
echo "'";
|
||||||
echo ';top.ICEcoder.openLastFiles = ';
|
echo ';top.ICEcoder.openLastFiles = ';
|
||||||
echo $ICEcoder["openLastFiles"] ? 'true' : 'false';
|
echo $ICEcoder["openLastFiles"] ? 'true' : 'false';
|
||||||
echo ';top.ICEcoder.lineWrapping = ';
|
echo ';top.ICEcoder.lineWrapping = ';
|
||||||
echo $ICEcoder["lineWrapping"] ? 'true' : 'false';
|
echo $ICEcoder["lineWrapping"] ? 'true' : 'false';
|
||||||
echo ';top.ICEcoder.tabWidth = ';
|
echo ';top.ICEcoder.indentWithTabs = ';
|
||||||
echo $ICEcoder["tabWidth"];
|
echo $ICEcoder["indentWithTabs"] ? 'true' : 'false';
|
||||||
|
echo ';top.ICEcoder.indentSize = ';
|
||||||
|
echo $ICEcoder["indentSize"];
|
||||||
|
echo ';top.ICEcoder.demoMode = ';
|
||||||
|
echo $ICEcoder["demoMode"] ? 'true' : 'false';
|
||||||
?>;ICEcoder.init()<?php echo $updateMsg.$onLoadExtras;?>" onResize="ICEcoder.setLayout()" onKeyDown="return ICEcoder.interceptKeys('coder',event);" onKeyUp="parent.ICEcoder.resetKeys(event);">
|
?>;ICEcoder.init()<?php echo $updateMsg.$onLoadExtras;?>" onResize="ICEcoder.setLayout()" onKeyDown="return ICEcoder.interceptKeys('coder',event);" onKeyUp="parent.ICEcoder.resetKeys(event);">
|
||||||
|
|
||||||
<div id="blackMask" class="blackMask" onClick="ICEcoder.showHide('hide',this)" onContextMenu="return false">
|
<div id="blackMask" class="blackMask" onClick="if (!ICEcoder.overPopup) {ICEcoder.showHide('hide',this)}" onContextMenu="return false">
|
||||||
<div class="popupVCenter">
|
<div class="popupVCenter">
|
||||||
<div class="popup" id="mediaContainer"></div>
|
<div class="popup" id="mediaContainer"></div>
|
||||||
</div>
|
</div>
|
||||||
@@ -78,7 +98,6 @@ 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()" 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">
|
||||||
@@ -87,10 +106,11 @@ if (file_exists(dirname(__FILE__)."/plugins/jshint/jshint.js")) {
|
|||||||
<input type="submit" value="Upload File">
|
<input type="submit" value="Upload File">
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
<a href="javascript:top.ICEcoder.pasteFile(top.ICEcoder.rightClickedFile)" onMouseOver="ICEcoder.showFileMenu()" id="fmMenuPasteOption" style="display: none">Paste</a>
|
||||||
</span>
|
</span>
|
||||||
|
<a href="javascript:top.ICEcoder.copyFile(top.ICEcoder.rightClickedFile)" onMouseOver="ICEcoder.showFileMenu()">Copy</a>
|
||||||
<a href="javascript:top.ICEcoder.deleteFile(top.ICEcoder.rightClickedFile)" onMouseOver="ICEcoder.showFileMenu()">Delete</a>
|
<a href="javascript:top.ICEcoder.deleteFile(top.ICEcoder.rightClickedFile)" onMouseOver="ICEcoder.showFileMenu()">Delete</a>
|
||||||
<span id="singleFileMenuItems">
|
<span id="singleFileMenuItems">
|
||||||
<a href="javascript:top.ICEcoder.copyFile(top.ICEcoder.rightClickedFile)" onMouseOver="ICEcoder.showFileMenu()">Copy</a>
|
|
||||||
<a href="javascript:top.ICEcoder.renameFile(top.ICEcoder.rightClickedFile)" onMouseOver="ICEcoder.showFileMenu()">Rename</a>
|
<a href="javascript:top.ICEcoder.renameFile(top.ICEcoder.rightClickedFile)" onMouseOver="ICEcoder.showFileMenu()">Rename</a>
|
||||||
<a href="javascript:window.open(top.ICEcoder.rightClickedFile.replace(/\|/g,'/'))" onMouseOver="ICEcoder.showFileMenu()">View Webpage</a>
|
<a href="javascript:window.open(top.ICEcoder.rightClickedFile.replace(/\|/g,'/'))" onMouseOver="ICEcoder.showFileMenu()">View Webpage</a>
|
||||||
</span>
|
</span>
|
||||||
@@ -99,6 +119,9 @@ if (file_exists(dirname(__FILE__)."/plugins/jshint/jshint.js")) {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="header" class="header" onContextMenu="return false">
|
<div id="header" class="header" onContextMenu="return false">
|
||||||
|
<div class="tools">
|
||||||
|
<a nohref onClick="top.ICEcoder.showColorPicker(top.document.getElementById('color') ? top.document.getElementById('color').value : '#123456')" title="Color Picker"><img src="images/color-picker.png" style="margin-top: 3px; cursor: pointer" alt="Color Picker"></a>
|
||||||
|
</div>
|
||||||
<div class="plugins" id="pluginsContainer">
|
<div class="plugins" id="pluginsContainer">
|
||||||
<?php echo $pluginsDisplay; ?>
|
<?php echo $pluginsDisplay; ?>
|
||||||
</div>
|
</div>
|
||||||
@@ -130,15 +153,15 @@ if (file_exists(dirname(__FILE__)."/plugins/jshint/jshint.js")) {
|
|||||||
<a nohref onClick="top.ICEcoder.alphaTabs()"><img src="images/nav-alpha.png" class="alphaTabs" title="Alphabetize 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" 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>';
|
echo '<div id="tab'.$i.'" class="tab" onMouseDown="ICEcoder.canSwitchTabs ? ICEcoder.switchTab(parseInt(this.id.slice(3),10)) : ICEcoder.canSwitchTabs=true; thisColor=top.ICEcoder.tabFGselected; if (!top.ICEcoder.overCloseLink) {ICEcoder.tabDragStart(parseInt(this.id.slice(3),10))}" onMouseOver="thisColor=this.style.color;this.style.color=top.ICEcoder.tabFGselected" onMouseOut="this.style.color=thisColor"></div>';
|
||||||
}
|
}
|
||||||
?><div class="newTab" onClick="ICEcoder.newTab()" id="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(top.document.getElementById('find').value,false,true);return false">
|
||||||
<div class="findReplace">
|
<div class="findReplace">
|
||||||
<div class="findText">Find</div>
|
<div class="findText">Find</div>
|
||||||
<input type="text" name="find" value="" id="find" class="textbox find" onKeyUp="ICEcoder.findReplace('find',true,false)">
|
<input type="text" name="find" value="" id="find" class="textbox find" onKeyUp="ICEcoder.findReplace(top.document.getElementById('find').value,true,false)">
|
||||||
|
|
||||||
<select name="connector" onChange="ICEcoder.findReplaceOptions()">
|
<select name="connector" onChange="ICEcoder.findReplaceOptions()">
|
||||||
<option>in</option>
|
<option>in</option>
|
||||||
@@ -164,7 +187,7 @@ if (file_exists(dirname(__FILE__)."/plugins/jshint/jshint.js")) {
|
|||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<form onSubmit="return ICEcoder.goToLine()">
|
<form onSubmit="return ICEcoder.goToLine()">
|
||||||
<div class="codeAssist"><input type="checkbox" name="codeAssist" id="codeAssist" checked onClick="top.ICEcoder.codeAssistToggle()">Code Assist</div>
|
<div class="codeAssist" title="Turn on/off JS Hint & CSS color previews"><input type="checkbox" name="codeAssist" id="codeAssist" checked onClick="top.ICEcoder.codeAssistToggle()">Code Assist</div>
|
||||||
<div class="goLine">Go to Line<input type="text" name="goToLine" value="" id="goToLineNo" class="textbox goToLine">
|
<div class="goLine">Go to Line<input type="text" name="goToLine" value="" id="goToLineNo" class="textbox goToLine">
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
@@ -172,10 +195,14 @@ if (file_exists(dirname(__FILE__)."/plugins/jshint/jshint.js")) {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="footer" id="footer" onContextMenu="return false">
|
<div class="footer" id="footer" onContextMenu="return false">
|
||||||
<div class="nesting" id="nestValid">Nesting OK</div>
|
<div class="system" id="system">
|
||||||
<div class="nestLoc">cursor nest location</div>
|
<div onClick="top.ICEcoder.openPreviewWindow()" class="preview" title="Preview Window"></div>
|
||||||
|
<div onClick="top.ICEcoder.openTerminal()" class="terminal" title="Terminal"></div>
|
||||||
|
</div>
|
||||||
|
<div class="nesting" id="nestValid"></div>
|
||||||
<div class="nestDisplay" id="nestDisplay"></div>
|
<div class="nestDisplay" id="nestDisplay"></div>
|
||||||
<div class="charDisplay" id="charDisplay"><span id="char"></span></div>
|
<div class="byteDisplay" id="byteDisplay" style="display: none" onClick="top.ICEcoder.showDisplay('char')"></div>
|
||||||
|
<div class="charDisplay" id="charDisplay" style="display: inline-block" onClick="top.ICEcoder.showDisplay('byte')"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
@@ -12,19 +12,22 @@ $ICEcoder = array(
|
|||||||
"bannedPaths" => array("/var/www/.git","/var/www/sites/all/modules","/var/www/sites/default/files"),
|
"bannedPaths" => array("/var/www/.git","/var/www/sites/all/modules","/var/www/sites/default/files"),
|
||||||
"allowedIPs" => array("*"),
|
"allowedIPs" => array("*"),
|
||||||
"plugins" => array(
|
"plugins" => array(
|
||||||
array("Terminal","plugins/terminal/icon.gif","margin-top: 3px","plugins/terminal","_blank",""),
|
|
||||||
array("Adminer","plugins/adminer/icon.png","margin-top: 3px","plugins/adminer/adminer-3.6.3-mysql-en.php","_blank",""),
|
array("Adminer","plugins/adminer/icon.png","margin-top: 3px","plugins/adminer/adminer-3.6.3-mysql-en.php","_blank",""),
|
||||||
array("JS Hint","plugins/jshint/icon.png","margin-top: 3px","http://www.jshint.com","_blank",""),
|
array("JS Hint","plugins/jshint/icon.png","margin-top: 3px","http://www.jshint.com","_blank",""),
|
||||||
array("Emmet","plugins/emmet/icon.png","margin-top: 3px","http://docs.emmet.io","_blank",""),
|
array("Emmet","plugins/emmet/icon.png","margin-top: 3px","http://docs.emmet.io","_blank",""),
|
||||||
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("Voke","plugins/voke/icon.png","margin-top: 3px","http://voke.fm","_blank",""),
|
||||||
|
array("Regexplained","plugins/regexplained/icon.png","margin-top: 3px","http://leaverou.github.io/regexplained","_blank",""),
|
||||||
array("wireframe|cc","plugins/wireframecc/icon.png","margin-top: 3px","http://wireframe.cc","_blank",""),
|
array("wireframe|cc","plugins/wireframecc/icon.png","margin-top: 3px","http://wireframe.cc","_blank",""),
|
||||||
|
array("TinyPNG","plugins/tinypng/icon.png","margin-top: 7px","http://tinypng.org","_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",
|
||||||
|
"fontSize" => "13px",
|
||||||
"lineWrapping" => true,
|
"lineWrapping" => true,
|
||||||
"tabWidth" => 4,
|
"indentWithTabs" => true,
|
||||||
|
"indentSize" => 4,
|
||||||
"previousFiles" => "",
|
"previousFiles" => "",
|
||||||
"last10Files" => ""
|
"last10Files" => ""
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -35,6 +35,6 @@
|
|||||||
|
|
||||||
.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 {color: #fff !important; 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; min-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}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
<?php include("settings.php");?>
|
<?php include("settings.php");?>
|
||||||
<?php
|
<?php
|
||||||
// Get the save type if any
|
// Get the save type if any
|
||||||
$saveType = isset($_GET['saveType']) ? strClean($_GET['saveType']) : "";
|
$saveType = isset($_GET['saveType']) ? strClean($_GET['saveType']) : "";
|
||||||
@@ -10,8 +10,11 @@ $file = str_replace("|","/",strClean(
|
|||||||
: $_GET['file']
|
: $_GET['file']
|
||||||
));
|
));
|
||||||
|
|
||||||
|
// Trim any +'s or spaces from the end of file
|
||||||
|
$file = rtrim(rtrim($file,'+'),' ');
|
||||||
|
|
||||||
// Make $file a full path and establish the $fileLoc and $fileName
|
// Make $file a full path and establish the $fileLoc and $fileName
|
||||||
if (strpos($file,$docRoot)===false) {$file=str_replace("|","/",$docRoot.$iceRoot.$file);};
|
if (strpos($file,$docRoot)===false && $_GET['action']!="getRemoteFile") {$file=str_replace("|","/",$docRoot.$iceRoot.$file);};
|
||||||
$fileLoc = substr(str_replace($docRoot,"",$file),0,strrpos(str_replace($docRoot,"",$file),"/"));
|
$fileLoc = substr(str_replace($docRoot,"",$file),0,strrpos(str_replace($docRoot,"",$file),"/"));
|
||||||
$fileName = basename($file);
|
$fileName = basename($file);
|
||||||
|
|
||||||
@@ -28,14 +31,14 @@ if ($_GET['action']=="load") {
|
|||||||
finfo_close($finfoMIME);
|
finfo_close($finfoMIME);
|
||||||
} else {
|
} else {
|
||||||
$fileExt = pathinfo($file, PATHINFO_EXTENSION);
|
$fileExt = pathinfo($file, PATHINFO_EXTENSION);
|
||||||
if (array_search($fileExt,array("coffee","css","htm","html","js","less","php","rb","ruby","txt","xml"))!==false) {$finfo = "text";};
|
if (array_search($fileExt,array("coffee","css","htm","html","js","less","md","php","py","rb","ruby","txt","xml"))!==false) {$finfo = "text";};
|
||||||
if (array_search($fileExt,array("gif","jpg","jpeg","png"))!==false) {$finfo = "image";};
|
if (array_search($fileExt,array("gif","jpg","jpeg","png"))!==false) {$finfo = "image";};
|
||||||
}
|
}
|
||||||
if (strpos($finfo,"text")===0 || strpos($finfo,"empty")!==false) {
|
if (strpos($finfo,"text")===0 || strpos($finfo,"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 = toUTF8noBOM(file_get_contents($file,false,$context),true);
|
||||||
echo '<textarea name="loadedFile" id="loadedFile">'.str_replace("</textarea>","<ICEcoder:/:textarea>",str_replace("&","&",$loadedFile)).'</textarea>';
|
echo '<textarea name="loadedFile" id="loadedFile">'.str_replace("</textarea>","<ICEcoder:/:textarea>",str_replace("&","&",$loadedFile)).'</textarea>';
|
||||||
} else if (strpos($finfo,"image")===0) {
|
} else if (strpos($finfo,"image")===0) {
|
||||||
echo '<script>fileType="image";fileName=\''.$fileLoc."/".$fileName.'\'</script>';
|
echo '<script>fileType="image";fileName=\''.$fileLoc."/".$fileName.'\'</script>';
|
||||||
@@ -48,6 +51,22 @@ if ($_GET['action']=="load") {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Get the contents of a remote URL
|
||||||
|
if ($_GET['action']=="getRemoteFile") {
|
||||||
|
if ($remoteFile = toUTF8noBOM(file_get_contents($file,false,$context),true)) {
|
||||||
|
// replace \r\n (Windows), \r (old Mac) and \n (Linux) line endings with whatever we chose to be lineEnding
|
||||||
|
$remoteFile = str_replace("\r\n", $ICEcoder["lineEnding"], $remoteFile);
|
||||||
|
$remoteFile = str_replace("\r", $ICEcoder["lineEnding"], $remoteFile);
|
||||||
|
$remoteFile = str_replace("\n", $ICEcoder["lineEnding"], $remoteFile);
|
||||||
|
echo '<script>top.ICEcoder.newTab();</script>';
|
||||||
|
echo '<textarea name="remoteFile" id="remoteFile">'.str_replace("</textarea>","<ICEcoder:/:textarea>",str_replace("&","&",$remoteFile)).'</textarea>';
|
||||||
|
echo '<script>top.ICEcoder.getcMInstance().setValue(document.getElementById("remoteFile").value);action="getRemoteFile";</script>';
|
||||||
|
} else {
|
||||||
|
echo '<script>action="nothing"; top.ICEcoder.message(\'Sorry, could\\\'t get contents of '.$file.'\');</script>';
|
||||||
|
}
|
||||||
|
echo '<script>top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);</script>';
|
||||||
|
}
|
||||||
|
|
||||||
// If we're due to add a new folder...
|
// If we're due to add a new folder...
|
||||||
if ($_GET['action']=="newFolder") {
|
if ($_GET['action']=="newFolder") {
|
||||||
if (!$demoMode && is_writable($docRoot.$fileLoc)) {
|
if (!$demoMode && is_writable($docRoot.$fileLoc)) {
|
||||||
@@ -178,7 +197,7 @@ if ($_GET['action']=="rename") {
|
|||||||
if ($_GET['action']=="replaceText") {
|
if ($_GET['action']=="replaceText") {
|
||||||
if (!$demoMode && is_writable(str_replace("|","/",strClean($_GET['fileRef'])))) {
|
if (!$demoMode && is_writable(str_replace("|","/",strClean($_GET['fileRef'])))) {
|
||||||
$file = str_replace("|","/",strClean($_GET['fileRef']));
|
$file = str_replace("|","/",strClean($_GET['fileRef']));
|
||||||
$loadedFile = file_get_contents($file);
|
$loadedFile = toUTF8noBOM(file_get_contents($file,false,$context),true);
|
||||||
$newContent = str_replace(strClean($_GET['find']),strClean($_GET['replace']),$loadedFile);
|
$newContent = str_replace(strClean($_GET['find']),strClean($_GET['replace']),$loadedFile);
|
||||||
$fh = fopen($file, 'w') or die("Sorry, cannot save");
|
$fh = fopen($file, 'w') or die("Sorry, cannot save");
|
||||||
fwrite($fh, $newContent);
|
fwrite($fh, $newContent);
|
||||||
@@ -252,20 +271,32 @@ if ($_GET['action']=="save") {
|
|||||||
$filemtime = $serverType=="Linux" ? filemtime($file) : "1000000";
|
$filemtime = $serverType=="Linux" ? filemtime($file) : "1000000";
|
||||||
if (!(isset($_GET['fileMDT']))||$filemtime==$_GET['fileMDT']) {
|
if (!(isset($_GET['fileMDT']))||$filemtime==$_GET['fileMDT']) {
|
||||||
$fh = fopen($file, 'w') or die("Sorry, cannot save");
|
$fh = fopen($file, 'w') or die("Sorry, cannot save");
|
||||||
fwrite($fh, $_POST['contents']);
|
// replace \r\n (Windows), \r (old Mac) and \n (Linux) line endings with whatever we chose to be lineEnding
|
||||||
|
$contents = $_POST['contents'];
|
||||||
|
$contents = str_replace("\r\n", $ICEcoder["lineEnding"], $contents);
|
||||||
|
$contents = str_replace("\r", $ICEcoder["lineEnding"], $contents);
|
||||||
|
$contents = str_replace("\n", $ICEcoder["lineEnding"], $contents);
|
||||||
|
// Now write that content, close the file and clear the statcache
|
||||||
|
fwrite($fh, $contents);
|
||||||
fclose($fh);
|
fclose($fh);
|
||||||
clearstatcache();
|
clearstatcache();
|
||||||
$filemtime = $serverType=="Linux" ? filemtime($file) : "1000000";
|
$filemtime = $serverType=="Linux" ? filemtime($file) : "1000000";
|
||||||
echo '<script>top.ICEcoder.openFileMDTs[top.ICEcoder.selectedTab-1]="'.$filemtime.'";</script>';
|
echo '<script>top.ICEcoder.openFileMDTs[top.ICEcoder.selectedTab-1]="'.$filemtime.'";</script>';
|
||||||
// Reload file manager & rename tab if it was a new file
|
// Reload file manager, rename tab & remove old file highlighting if it was a new file
|
||||||
if (isset($_POST['newFileName']) && $_POST['newFileName']!="") {
|
if (isset($_POST['newFileName']) && $_POST['newFileName']!="") {
|
||||||
echo '<script>top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'add\',\''.$fileLoc.'\',\''.$fileName.'\');';
|
echo '<script>top.ICEcoder.selectedFiles=[];top.ICEcoder.updateFileManagerList(\'add\',\''.$fileLoc.'\',\''.$fileName.'\');';
|
||||||
echo 'top.ICEcoder.renameTab(top.ICEcoder.selectedTab,\''.$fileLoc."/".$fileName.'\');</script>';
|
echo 'top.ICEcoder.renameTab(top.ICEcoder.selectedTab,\''.$fileLoc."/".$fileName.'\');</script>';
|
||||||
|
if (!strpos($_GET['file'],"[NEW]")) {
|
||||||
|
// We're saving as a new file, so unhighlight the old name in the file manager if visible
|
||||||
|
echo "<script>fileLink = top.ICEcoder.filesFrame.contentWindow.document.getElementById('".str_replace("/","|",$fileLoc)."|".basename($_GET['file'])."');</script>";
|
||||||
|
echo "<script>if (fileLink) {fileLink.style.backgroundColor = top.ICEcoder.tabBGnormal; fileLink.style.color = top.ICEcoder.tabFGnormalFile};</script>";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// Reload stickytab window
|
// Reload previewWindow window if not a Markdown file
|
||||||
echo '<script>if (top.ICEcoder.stickyTab.location) {top.ICEcoder.stickyTab.location.reload()};action="doneSave";</script>';
|
echo '<script>if (top.ICEcoder.previewWindow.location && top.ICEcoder.previewWindow.location.pathname.indexOf(".md")==-1) {top.ICEcoder.previewWindow.location.reload()};</script>';
|
||||||
|
echo '<script>top.ICEcoder.setPreviousFiles();action="doneSave";</script>';
|
||||||
} else {
|
} else {
|
||||||
$loadedFile = file_get_contents($file);
|
$loadedFile = toUTF8noBOM(file_get_contents($file,false,$context),true);
|
||||||
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>",htmlentities($loadedFile)).'</textarea>';
|
||||||
echo '<textarea name="userVersionFile" id="userVersionFile"></textarea>';
|
echo '<textarea name="userVersionFile" id="userVersionFile"></textarea>';
|
||||||
?>
|
?>
|
||||||
@@ -334,6 +365,9 @@ if (action=="load") {
|
|||||||
top.ICEcoder['cMActiveLine'+top.ICEcoder.selectedTab] = top.ICEcoder.content.contentWindow['cM'+top.ICEcoder.cMInstances[top.ICEcoder.selectedTab-1]].addLineClass(0, "background", "cm-s-activeLine");
|
top.ICEcoder['cMActiveLine'+top.ICEcoder.selectedTab] = top.ICEcoder.content.contentWindow['cM'+top.ICEcoder.cMInstances[top.ICEcoder.selectedTab-1]].addLineClass(0, "background", "cm-s-activeLine");
|
||||||
top.ICEcoder.nextcMInstance++;
|
top.ICEcoder.nextcMInstance++;
|
||||||
top.ICEcoder.openFileMDTs.push('<?php echo $serverType=="Linux" ? filemtime($file) : "1000000"; ?>');
|
top.ICEcoder.openFileMDTs.push('<?php echo $serverType=="Linux" ? filemtime($file) : "1000000"; ?>');
|
||||||
|
for (var i=0; i<cM.lineCount(); i++) {
|
||||||
|
top.ICEcoder.content.contentWindow.CodeMirror.newFoldFunction(top.ICEcoder.content.contentWindow.CodeMirror[["coffee","css","js","less","php","py","rb","ruby"].indexOf('<?php echo pathinfo($file, PATHINFO_EXTENSION);?>') > -1 ? "braceRangeFinder" : "tagRangeFinder"],null,"+","-",true)(cM, i);
|
||||||
|
}
|
||||||
top.ICEcoder.loadingFile = false;
|
top.ICEcoder.loadingFile = false;
|
||||||
<?php
|
<?php
|
||||||
;};
|
;};
|
||||||
@@ -344,7 +378,16 @@ if (action=="load") {
|
|||||||
|
|
||||||
if (fileType=="image") {
|
if (fileType=="image") {
|
||||||
top.document.getElementById('blackMask').style.visibility = "visible";
|
top.document.getElementById('blackMask').style.visibility = "visible";
|
||||||
top.document.getElementById('mediaContainer').innerHTML = "<img src=\"<?php echo $fileLoc."/".$fileName;?>\" class=\"whiteGlow\" style=\"border: solid 10px #fff; max-width: 700px; max-height: 500px; background-color: #000; background-image: url('images/checkerboard.png')\" onClick=\"return false\"><br><span class=\"whiteGlow\" style=\"border: solid 10px #fff; color: #000; background-color: #fff\" onClick=\"return false\"><?php echo $fileLoc."/".$fileName;?></span>";
|
top.document.getElementById('mediaContainer').innerHTML =
|
||||||
|
"<canvas id=\"canvasPicker\" width=\"1\" height=\"1\" style=\"position: absolute; margin: 10px 0 0 10px; cursor: crosshair\" onmouseover=\"top.ICEcoder.overPopup=true\" onmouseout=\"top.ICEcoder.overPopup=false\"></canvas>" +
|
||||||
|
"<img src=\"<?php echo $fileLoc."/".$fileName;?>\" class=\"whiteGlow\" style=\"border: solid 10px #fff; max-width: 700px; max-height: 500px; background-color: #000; background-image: url('images/checkerboard.png')\" onLoad=\"reducedImgMsg = (this.naturalWidth > 700 || this.naturalHeight > 500) ? ', displayed at ' + this.width + ' x ' + this.height : ''; document.getElementById('imgInfo').innerHTML += ' (' + this.naturalWidth + ' x ' + this.naturalHeight + reducedImgMsg + ')'; top.ICEcoder.drawCanvasImage(this)\"><br>" +
|
||||||
|
"<div class=\"whiteGlow\" style=\"display: inline-block; margin-top: -10px; border: solid 10px #fff; color: #000; background-color: #fff\" id=\"imgInfo\" onmouseover=\"top.ICEcoder.overPopup=true\" onmouseout=\"top.ICEcoder.overPopup=false\">" +
|
||||||
|
"<b><?php echo $fileLoc."/".$fileName;?></b>" +
|
||||||
|
"</div><br>" +
|
||||||
|
"<input type=\"text\" id=\"hexMouseXY\" style=\"border: 1px solid #888; border-right: 0; width: 70px\" onmouseover=\"top.ICEcoder.overPopup=true\" onmouseout=\"top.ICEcoder.overPopup=false\"></input>" +
|
||||||
|
"<input type=\"text\" id=\"rgbMouseXY\" style=\"border: 1px solid #888; margin-right: 10px; width: 70px\" onmouseover=\"top.ICEcoder.overPopup=true\" onmouseout=\"top.ICEcoder.overPopup=false\"></input>" +
|
||||||
|
"<input type=\"text\" id=\"hex\" style=\"border: 1px solid #888; border-right: 0; width: 70px\" onmouseover=\"top.ICEcoder.overPopup=true\" onmouseout=\"top.ICEcoder.overPopup=false\"></input>" +
|
||||||
|
"<input type=\"text\" id=\"rgb\" style=\"border: 1px solid #888; width: 70px\" onmouseover=\"top.ICEcoder.overPopup=true\" onmouseout=\"top.ICEcoder.overPopup=false\"></input>";
|
||||||
}
|
}
|
||||||
|
|
||||||
top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);
|
top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);
|
||||||
@@ -360,18 +403,15 @@ if (action=="load") {
|
|||||||
if (action=="save") {
|
if (action=="save") {
|
||||||
<?php
|
<?php
|
||||||
if (strpos($file,"[NEW]")>0||$saveType=="saveAs") {
|
if (strpos($file,"[NEW]")>0||$saveType=="saveAs") {
|
||||||
if (strpos($fileName,"[NEW]")>0) {echo "fileLoc = '".$fileLoc."';";} else {echo "fileLoc = '';";};
|
|
||||||
?>
|
?>
|
||||||
newFileName = top.ICEcoder.getInput(fileLoc != ""
|
fileLoc = '<?php echo $fileLoc;?>';
|
||||||
? 'Enter filename to save at '+fileLoc
|
newFileName = top.ICEcoder.getInput('Enter filename to save at '+fileLoc,'');
|
||||||
: 'Enter filename (including path, prefixed with /)'
|
|
||||||
,'');
|
|
||||||
if (newFileName && newFileName.substr(0,1)!="/") {newFileName = "/" + newFileName}
|
|
||||||
if (newFileName) {
|
if (newFileName) {
|
||||||
newFileName = fileLoc == "" ? newFileName : fileLoc + "/" + fileName;
|
if (newFileName.substr(0,1)!="/") {newFileName = "/" + newFileName}
|
||||||
}
|
newFileName = fileLoc + newFileName;
|
||||||
if (newFileName && top.document.getElementById('filesFrame').contentWindow.document.getElementById(newFileName.replace(/\//g,"|"))) {
|
if (top.document.getElementById('filesFrame').contentWindow.document.getElementById(newFileName.replace(/\//g,"|"))) {
|
||||||
overwriteOK = top.ICEcoder.ask('That file exists already, overwrite?');
|
overwriteOK = top.ICEcoder.ask('That file exists already, overwrite?');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
document.saveFile.newFileName.value = '<?php echo $docRoot; ?>' + newFileName;
|
document.saveFile.newFileName.value = '<?php echo $docRoot; ?>' + newFileName;
|
||||||
<?php ;};?>
|
<?php ;};?>
|
||||||
|
|||||||
41
lib/file-types.css
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
.fileManager {
|
||||||
|
margin: 15px 0 15px 22px;
|
||||||
|
-webkit-user-select: none;
|
||||||
|
-moz-user-select: none;
|
||||||
|
-o-user-select: none;
|
||||||
|
user-select: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fileManager span {font-family: helvetica, arial, swiss, verdana}
|
||||||
|
.fileManager a {color: #eee; text-decoration: none; cursor: pointer}
|
||||||
|
.fileManager .pft-directory, .fileManager .pft-file {list-style-image: url(../images/blank.gif)}
|
||||||
|
.fileManager ul, .fileManager li {margin-left: 15px}
|
||||||
|
|
||||||
|
/* Default file */
|
||||||
|
.fileManager LI.pft-directory:before, .fileManager LI.pft-file:before {
|
||||||
|
position: absolute; display: block; width: 16px; height: 16px; content: ""; margin-top: -2px; margin-left: -23px; background:url(../images/file-folder-icons.png) no-repeat 0 0;
|
||||||
|
}
|
||||||
|
.fileManager LI.dirOpen:before {background-position: -16px 0}
|
||||||
|
|
||||||
|
@media screen and (-webkit-min-device-pixel-ratio:0) { /* hacked for chrome and safari */
|
||||||
|
.fileManager LI.pft-directory:before, .fileManager LI.pft-file:before {
|
||||||
|
margin-top: -19px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.fileManager LI.pft-file:before {background-position: -32px 0}
|
||||||
|
|
||||||
|
/* Additional file types */
|
||||||
|
.fileManager LI.ext-coffee:before {background-position: -48px 0}
|
||||||
|
.fileManager LI.ext-css:before {background-position: -64px 0}
|
||||||
|
.fileManager LI.ext-gif:before {background-position: -80px 0}
|
||||||
|
.fileManager LI.ext-htm:before, .fileManager LI.ext-html:before {background-position: -96px 0}
|
||||||
|
.fileManager LI.ext-jpg:before, .fileManager LI.ext-jpeg:before {background-position: -112px 0}
|
||||||
|
.fileManager LI.ext-js:before {background-position: -128px 0}
|
||||||
|
.fileManager LI.ext-less:before {background-position: -144px 0}
|
||||||
|
.fileManager LI.ext-md:before {background-position: -160px 0}
|
||||||
|
.fileManager LI.ext-php:before {background-position: -176px 0}
|
||||||
|
.fileManager LI.ext-png:before {background-position: -192px 0}
|
||||||
|
.fileManager LI.ext-py:before {background-position: -208px 0}
|
||||||
|
.fileManager LI.ext-rb:before, .fileManager LI.ext-ruby:before {background-position: -224px 0}
|
||||||
|
.fileManager LI.ext-txt:before {background-position: -240px 0}
|
||||||
|
.fileManager LI.ext-zip:before {background-position: -256px 0}
|
||||||
@@ -20,43 +20,3 @@ table, caption, tbody, tfoot, thead, tr, th, td {
|
|||||||
body {margin: 0; overflow: auto}
|
body {margin: 0; overflow: auto}
|
||||||
|
|
||||||
.refresh {position: fixed; display: inline-block; width: 14px; height: 14px; background: url('../images/file-manager-icons.png') -100px -16px no-repeat; right: 0; margin-right: 15px; cursor: pointer}
|
.refresh {position: fixed; display: inline-block; width: 14px; height: 14px; background: url('../images/file-manager-icons.png') -100px -16px no-repeat; right: 0; margin-right: 15px; cursor: pointer}
|
||||||
|
|
||||||
.fileManager {
|
|
||||||
margin: 15px 0 15px 22px;
|
|
||||||
-webkit-user-select: none;
|
|
||||||
-moz-user-select: none;
|
|
||||||
-o-user-select: none;
|
|
||||||
user-select: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.fileManager span {font-family: helvetica, arial, swiss, verdana}
|
|
||||||
.fileManager a {color: #eee; text-decoration: none; cursor: pointer}
|
|
||||||
.fileManager .pft-directory, .fileManager .pft-file {list-style-image: url(../images/blank.gif)}
|
|
||||||
.fileManager ul, .fileManager li {margin-left: 15px}
|
|
||||||
|
|
||||||
/* Default file */
|
|
||||||
.fileManager LI.pft-directory:before, .fileManager LI.pft-file:before {
|
|
||||||
position: absolute; display: block; width: 16px; height: 16px; content: ""; margin-top: -2px; margin-left: -23px; background:url(../images/file-folder-icons.png) no-repeat 0 0;
|
|
||||||
}
|
|
||||||
.fileManager LI.dirOpen:before {background-position: -16px 0}
|
|
||||||
|
|
||||||
@media screen and (-webkit-min-device-pixel-ratio:0) { /* hacked for chrome and safari */
|
|
||||||
.fileManager LI.pft-directory:before, .fileManager LI.pft-file:before {
|
|
||||||
margin-top: -19px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.fileManager LI.pft-file:before {background-position: -32px 0}
|
|
||||||
|
|
||||||
/* Additional file types */
|
|
||||||
.fileManager LI.ext-coffee:before {background-position: -48px 0}
|
|
||||||
.fileManager LI.ext-css:before {background-position: -64px 0}
|
|
||||||
.fileManager LI.ext-gif:before {background-position: -80px 0}
|
|
||||||
.fileManager LI.ext-htm:before, .fileManager LI.ext-html:before {background-position: -96px 0}
|
|
||||||
.fileManager LI.ext-jpg:before, .fileManager LI.ext-jpeg:before {background-position: -112px 0}
|
|
||||||
.fileManager LI.ext-js:before {background-position: -128px 0}
|
|
||||||
.fileManager LI.ext-less:before {background-position: -144px 0}
|
|
||||||
.fileManager LI.ext-php:before {background-position: -160px 0}
|
|
||||||
.fileManager LI.ext-png:before {background-position: -176px 0}
|
|
||||||
.fileManager LI.ext-rb:before, .fileManager LI.ext-ruby:before {background-position: -192px 0}
|
|
||||||
.fileManager LI.ext-txt:before {background-position: -208px 0}
|
|
||||||
.fileManager LI.ext-zip:before {background-position: -224px 0}
|
|
||||||
54
lib/foldcode.js
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
// Modified version of CodeMirror's codefold.js to show guttermarkers
|
||||||
|
|
||||||
|
CodeMirror.newFoldFunction = function(rangeFinder, widget, markOn, markOff, dontCollapse) {
|
||||||
|
if (widget == null) widget = "\u2194";
|
||||||
|
if (typeof widget == "string") {
|
||||||
|
var text = document.createTextNode(widget);
|
||||||
|
widget = document.createElement("span");
|
||||||
|
widget.appendChild(text);
|
||||||
|
widget.className = "CodeMirror-foldmarker";
|
||||||
|
}
|
||||||
|
if (markOn == null) markOn = "+";
|
||||||
|
if (typeof markOn == "string") {
|
||||||
|
var text = document.createTextNode(markOn);
|
||||||
|
markOn = document.createElement("span");
|
||||||
|
markOn.appendChild(text);
|
||||||
|
markOn.className = "fold foldOn";
|
||||||
|
}
|
||||||
|
if (markOff == null) markOff = "-";
|
||||||
|
if (typeof markOff == "string") {
|
||||||
|
var text = document.createTextNode(markOff);
|
||||||
|
markOff = document.createElement("span");
|
||||||
|
markOff.appendChild(text);
|
||||||
|
markOff.className = "fold foldOff";
|
||||||
|
}
|
||||||
|
|
||||||
|
return function(cm, pos) {
|
||||||
|
if (typeof pos == "number") pos = CodeMirror.Pos(pos, 0);
|
||||||
|
var range = rangeFinder(cm, pos);
|
||||||
|
foldable = range && (range.from.line != range.to.line || range.from.ch != range.to.ch) ? true : false;
|
||||||
|
if (!foldable) cm.setGutterMarker(pos.line, "folds", null);
|
||||||
|
if (!range) return;
|
||||||
|
|
||||||
|
var present = cm.findMarksAt(range.from), cleared = 0;
|
||||||
|
for (var i = 0; i < present.length; ++i) {
|
||||||
|
if (present[i].__isFold) {
|
||||||
|
++cleared;
|
||||||
|
present[i].clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (foldable) {
|
||||||
|
cm.setGutterMarker(pos.line, "folds", cleared || dontCollapse ? markOff.cloneNode(true) : markOn.cloneNode(true));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cleared || dontCollapse) return;
|
||||||
|
var myWidget = widget.cloneNode(true);
|
||||||
|
CodeMirror.on(myWidget, "mousedown", function() {myRange.clear();cm.setGutterMarker(pos.line, "folds", markOff.cloneNode(true));});
|
||||||
|
var myRange = cm.markText(range.from, range.to, {
|
||||||
|
replacedWith: myWidget,
|
||||||
|
clearOnEnter: true,
|
||||||
|
__isFold: true
|
||||||
|
});
|
||||||
|
};
|
||||||
|
};
|
||||||
@@ -45,7 +45,7 @@ for ($i=0;$i<count($finalArray);$i++) {
|
|||||||
}
|
}
|
||||||
$type == "folder" ? $class = 'pft-directory' : $class = 'pft-file '.strtolower($ext);
|
$type == "folder" ? $class = 'pft-directory' : $class = 'pft-file '.strtolower($ext);
|
||||||
$loadParam = $type == "folder" ? "true" : "false";
|
$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> ";
|
echo "<li class=\"".$class."\"><a nohref title=\"$fileFolderName\" onMouseOver=\"top.ICEcoder.overFileFolder('$type',this.childNodes[1].id)\" onMouseOut=\"top.ICEcoder.overFileFolder('$type','')\" onClick=\"if(!event.ctrlKey) {top.ICEcoder.openCloseDir(this,$loadParam); if (/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)) {top.ICEcoder.openFile()}}\" style=\"position: relative; left:-22px\"> <span id=\"".str_replace($docRoot,"",str_replace("/","|",$fileFolderName))."\">".basename($fileFolderName)."</span> ";
|
||||||
echo '<span style="color: #888; font-size: 8px" id="'.str_replace($docRoot,"",str_replace("/","|",$fileFolderName)).'_perms">';
|
echo '<span style="color: #888; font-size: 8px" id="'.str_replace($docRoot,"",str_replace("/","|",$fileFolderName)).'_perms">';
|
||||||
echo $serverType=="Linux" ? substr(sprintf('%o', fileperms($docRoot.$iceRoot.$fileFolderName)), -3) : '';
|
echo $serverType=="Linux" ? substr(sprintf('%o', fileperms($docRoot.$iceRoot.$fileFolderName)), -3) : '';
|
||||||
echo "</span></a></li>\n";
|
echo "</span></a></li>\n";
|
||||||
@@ -65,6 +65,7 @@ if (isset($_GET['location'])) {
|
|||||||
}
|
}
|
||||||
newUL.innerHTML = document.getElementById('branch').innerHTML.slice(28).slice(0,-7);
|
newUL.innerHTML = document.getElementById('branch').innerHTML.slice(28).slice(0,-7);
|
||||||
locNest.parentNode.insertBefore(newUL,locNest.nextSibling);
|
locNest.parentNode.insertBefore(newUL,locNest.nextSibling);
|
||||||
|
top.ICEcoder.redoTabHighlight(top.ICEcoder.selectedTab);
|
||||||
</script>
|
</script>
|
||||||
<?php
|
<?php
|
||||||
;};
|
;};
|
||||||
|
|||||||
39
lib/help.php
@@ -16,17 +16,13 @@
|
|||||||
<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>
|
||||||
|
|
||||||
<div style="display: inline-block; width: 365px; margin-right: 20px">
|
<div style="display: inline-block; width: 365px; margin-right: 20px">
|
||||||
<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> +</span> <span class="shortcut">Duplicate line</span><br>
|
||||||
|
<span class="key">CTRL <span class="plus">+</span> -</span> <span class="shortcut">Remove line</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> j</span> <span class="shortcut">Jump to definition</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>
|
<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> d</span> <span class="shortcut">Wrap selected in <div></span><br>
|
||||||
@@ -42,22 +38,31 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style="display: inline-block; width: 365px">
|
<div style="display: inline-block; width: 365px">
|
||||||
|
<h2>On logo</h2>
|
||||||
|
<span class="key">Left click</span> <span class="shortcut">Help</span><br>
|
||||||
|
<span class="key">Right click</span> <span class="shortcut">Settings</span><br><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 / click (mobile)</span> <span class="shortcut">Open file</span><br>
|
||||||
|
<span class="key">CTRL <span class="plus">+</span> left 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>
|
||||||
|
|
||||||
<h2>Anywhere</h2>
|
<h2>Anywhere</h2>
|
||||||
<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">Next 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">Previous 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">New 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">Close current 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> o</span> <span class="shortcut">Open file prompt</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">Focus on Go to line input</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> Shift <span class="plus">+</span> s</span> <span class="shortcut">Save as...</span><br>
|
||||||
<span class="key">CTRL <span class="plus">+</span> Enter</span> <span class="shortcut">View webpage</span><br>
|
<span class="key">CTRL <span class="plus">+</span> Enter</span> <span class="shortcut">View webpage</span><br>
|
||||||
<span class="key">CTRL <span class="plus">+</span> S <span class="plus">+</span> Enter</span> <span class="shortcut">Save & create sticky tab</span><br>
|
<span class="key">Space</span> <span class="shortcut">Refocus on document</span><br>
|
||||||
<span class="key">Esc</span> <span class="shortcut">Cancel tasks</span><br><br><br>
|
<span class="key">Esc</span> <span class="shortcut">Cancel tasks</span><br>
|
||||||
|
|
||||||
<h2>On logo</h2>
|
|
||||||
<span class="key">Left click</span> <span class="shortcut">Help</span><br>
|
|
||||||
<span class="key">Right click</span> <span class="shortcut">Settings</span><br>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -66,7 +66,8 @@ h2 {font-size: 18px; font-weight: normal; color: #fff}
|
|||||||
}
|
}
|
||||||
|
|
||||||
.header {position: absolute; display: inline-block; top: 0; left: 0; width: 100%; height: 40px; background-color: #fff; text-align: right; z-index: 2}
|
.header {position: absolute; display: inline-block; top: 0; left: 0; width: 100%; height: 40px; background-color: #fff; text-align: right; z-index: 2}
|
||||||
.header .plugins {position: absolute; display: inline-block; left: 15px; top: 3px}
|
.header .tools {position: absolute; display: inline-block; left: 15px; top: 3px}
|
||||||
|
.header .plugins {position: absolute; display: inline-block; left: 55px; top: 3px}
|
||||||
.header .plugins img {position: relative; display: inline-block; margin-right: 15px}
|
.header .plugins img {position: relative; display: inline-block; margin-right: 15px}
|
||||||
.header .screenModeIcon {position: absolute; top: 5px; right: 178px; cursor: pointer}
|
.header .screenModeIcon {position: absolute; top: 5px; right: 178px; cursor: pointer}
|
||||||
.header .version {position: relative; display: inline-block; margin-top: 25px; font-size: 10px; color: #bbb}
|
.header .version {position: relative; display: inline-block; margin-top: 25px; font-size: 10px; color: #bbb}
|
||||||
@@ -100,7 +101,14 @@ 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 {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}
|
.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: width 0.15s ease-in-out;
|
||||||
|
-moz-transition: width 0.15s ease-in-out;
|
||||||
|
transition: width 0.15s ease-in-out;
|
||||||
|
-webkit-transition: left 0.15s ease-in-out;
|
||||||
|
-moz-transition: left 0.15s ease-in-out;
|
||||||
|
transition: left 0.15s ease-in-out;
|
||||||
|
}
|
||||||
.tabsBar .tabSlide {
|
.tabsBar .tabSlide {
|
||||||
-webkit-transition: left 0.15s ease-in-out;
|
-webkit-transition: left 0.15s ease-in-out;
|
||||||
-moz-transition: left 0.15s ease-in-out;
|
-moz-transition: left 0.15s ease-in-out;
|
||||||
@@ -117,7 +125,11 @@ h2 {font-size: 18px; font-weight: normal; color: #fff}
|
|||||||
.tabsBar .alphaTabs:hover {background: #000}
|
.tabsBar .alphaTabs:hover {background: #000}
|
||||||
.tabsBar .closeAllTabs {position: absolute; margin: 6px 0 0 -33px; background: #bbb}
|
.tabsBar .closeAllTabs {position: absolute; margin: 6px 0 0 -33px; background: #bbb}
|
||||||
.tabsBar .closeAllTabs:hover {background: #000}
|
.tabsBar .closeAllTabs:hover {background: #000}
|
||||||
.tabsBar .newTab {position: absolute; display: inline-block; background-image: url('../images/nav-bg.jpg'); background-repeat: repeat-x; background-position: 0 0; padding: 6px 5px 5px 5px; border-left: solid 1px #eee; border-right: solid 1px #777; border-radius: 4px 4px 0 0; cursor: pointer; z-index: 1}
|
.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;
|
||||||
|
-webkit-transition: left 0.15s ease-in-out;
|
||||||
|
-moz-transition: left 0.15s ease-in-out;
|
||||||
|
transition: left 0.15s ease-in-out;
|
||||||
|
}
|
||||||
.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;}
|
||||||
@@ -130,18 +142,21 @@ h2 {font-size: 18px; font-weight: normal; color: #fff}
|
|||||||
.findReplace .submit {position: relative; top: -2px; height: 17px; border: 0; background-color: #444; color: #eee; font-size: 10px; margin-left: 2px; cursor: pointer}
|
.findReplace .submit {position: relative; top: -2px; height: 17px; border: 0; background-color: #444; color: #eee; font-size: 10px; margin-left: 2px; cursor: pointer}
|
||||||
.findReplace .submit:hover {background-color: #2187e7; color: #eee}
|
.findReplace .submit:hover {background-color: #2187e7; color: #eee}
|
||||||
.findReplace .results {position: relative; display: inline-block; width: 200px; height: 20px; font-size: 10px; margin: 8px 0 0 20px}
|
.findReplace .results {position: relative; display: inline-block; width: 200px; height: 20px; font-size: 10px; margin: 8px 0 0 20px}
|
||||||
.findBar .codeAssist {position: fixed; display: inline-block; width: 100px; right: 74px; top: 70px; height: 21px; font-size: 10px; z-index: 1}
|
.findBar .codeAssist {position: fixed; display: inline-block; width: 100px; right: 74px; top: 70px; height: 21px; font-size: 10px; cursor: default; z-index: 1}
|
||||||
.findBar .codeAssist input {margin-top: -1px}
|
.findBar .codeAssist input {margin-top: -1px}
|
||||||
.findBar .goLine {position: fixed; display: inline-block; width: 100px; right: -10px; top: 70px; height: 21px; font-size: 10px; z-index: 1}
|
.findBar .goLine {position: fixed; display: inline-block; width: 100px; right: -10px; top: 70px; height: 21px; font-size: 10px; cursor: default; z-index: 1}
|
||||||
.goLine .goToLine {width: 25px; height: 16px; border: 0; font-size: 10px; margin: -3px 0 0 3px}
|
.goLine .goToLine {width: 25px; height: 16px; border: 0; font-size: 10px; margin: -3px 0 0 3px}
|
||||||
.goLine .goToLine:focus {outline: none; box-shadow: 0 0 10px 1px rgba(0,198,255,1)}
|
.goLine .goToLine:focus {outline: none; box-shadow: 0 0 10px 1px rgba(0,198,255,1)}
|
||||||
.editor .code {position: relative; display: inline-block; top: 28px; width: 600px; height: 600px; visibility: hidden}
|
.editor .code {position: relative; display: inline-block; top: 28px; width: 600px; height: 600px; visibility: hidden}
|
||||||
|
|
||||||
.footer {position: fixed; display: inline-block; width: 100%; height: 30px; bottom: 0; background-color: rgba(0,0,0,0.7); left: 0; z-index: 2}
|
.footer {position: fixed; display: inline-block; width: 100%; height: 30px; bottom: 0; background-color: rgba(0,0,0,0.7); left: 0; z-index: 2}
|
||||||
.footer .nesting {display: inline-block; padding: 5px 8px; margin: 4px 0 0 15px; font-weight: bold; font-size: 10px; color: #fff; background-color: #0b0}
|
.footer .system {position: absolute; display: inline-block; padding: 10px 0 0 15px}
|
||||||
.footer .nestLoc {position: absolute; display: inline-block; width: 120px; padding: 5px 0 0 8px; margin-top: 2px; left: 112px; font-weight: bold; font-size: 12px; color: #fff; text-align: right}
|
.footer .system div {position: relative; display: inline-block; margin-right: 10px; width: 11px; height: 11px; cursor: pointer}
|
||||||
.footer .nestDisplay {position: absolute; display: inline-block; padding: 5px 0 0 8px; margin-top: 0px; left: 255px; font-size: 12px; color: #fff; text-align: right}
|
.footer .system .preview {background: url('../images/file-manager-icons.png') no-repeat -116px -16px}
|
||||||
.footer .charDisplay {position: absolute; display: inline-block; padding: 5px 0 0 8px; margin-top: 3px; left: 100%; font-weight: bold; font-size: 12px; color: #fff; text-align: right; width: 200px; text-align: right; margin-left: -220px}
|
.footer .system .terminal {background: url('../images/file-manager-icons.png') no-repeat -132px -16px}
|
||||||
|
.footer .nesting {position: absolute; display: inline-block; padding: 5px; margin-top: 10px; left: 260px; border-radius: 5px; background-color: #0b0; cursor: default}
|
||||||
|
.footer .nestDisplay {position: absolute; display: inline-block; padding: 5px 0 0 8px; margin-top: 0px; left: 267px; font-size: 12px; color: #fff; text-align: right}
|
||||||
|
.footer .charDisplay, .footer .byteDisplay {position: absolute; display: inline-block; padding: 5px 0 0 8px; margin-top: 3px; margin-right: 10px; right: 0; font-weight: bold; font-size: 12px; color: #fff; text-align: right; text-align: right; cursor: pointer}
|
||||||
|
|
||||||
.textbox {box-shadow: inset 1px 1px 2px 0 rgba(0,0,0,0.4)}
|
.textbox {box-shadow: inset 1px 1px 2px 0 rgba(0,0,0,0.4)}
|
||||||
|
|
||||||
@@ -153,6 +168,9 @@ h2 {font-size: 18px; font-weight: normal; color: #fff}
|
|||||||
.screenContainer .screenVCenter {#position: absolute; display: table-cell; #top: 50%; vertical-align: middle; text-align: center}
|
.screenContainer .screenVCenter {#position: absolute; display: table-cell; #top: 50%; vertical-align: middle; text-align: center}
|
||||||
.screenVCenter .screenCenter {#position: relative; #top: -50%; text-align: center; display: inline}
|
.screenVCenter .screenCenter {#position: relative; #top: -50%; text-align: center; display: inline}
|
||||||
.screenCenter .version {position: relative; display: block; margin: 5px 0 15px 0; font-size: 10px; color: #bbb}
|
.screenCenter .version {position: relative; display: block; margin: 5px 0 15px 0; font-size: 10px; color: #bbb}
|
||||||
|
.screenCenter .text {position: relative; display: block; margin-top: 15px; font-size: 10px; color: #888}
|
||||||
|
.screenCenter .text input {margin-top: 1px}
|
||||||
|
.screenCenter .text a {position: relative; display: block; margin-top: 15px; font-size: 10px; color: #888; text-decoration: none}
|
||||||
.screenCenter .accountPassword {border: 0; background-color: #333; color: #fff; height: 20px}
|
.screenCenter .accountPassword {border: 0; background-color: #333; color: #fff; height: 20px}
|
||||||
.screenCenter .button {border: 0; background: #444; color: #eee; height: 22px; cursor: pointer}
|
.screenCenter .button {border: 0; background: #444; color: #eee; height: 22px; cursor: pointer}
|
||||||
.screenCenter .button:hover {background: #2187e7; color: #eee}
|
.screenCenter .button:hover {background: #2187e7; color: #eee}
|
||||||
630
lib/ice-coder.js
108
lib/ice-coder.min.js
vendored
Normal file
@@ -0,0 +1,108 @@
|
|||||||
|
var ICEcoder={filesW:250,minFilesW:14,maxFilesW:250,selectedTab:0,changedContent:[],canSwitchTabs:!0,openFiles:[],openFileMDTs:[],cMInstances:[],nextcMInstance:1,selectedFiles:[],findMode:!1,lockedNav:!0,htmlTagArray:[],codeAssist:!0,mouseDown:!1,draggingFilesW:!1,draggingTab:!1,tabLeftPos:[],tabBGcurrent:"#141414",tabBGselected:"#49d",tabBGopen:"#888",tabBGnormal:"transparent",tabFGselected:"#fff",tabFGnormalFile:"#eee",tabFGnormalTab:"#000",serverQueueItems:[],previewWindow:!1,pluginIntervalRefs:[],
|
||||||
|
overPopup:!1,ready:!1,initAliases:function(){for(var a="header files account fmLock filesFrame editor tabsBar findBar content footer system nestValid nestDisplay charDisplay byteDisplay".split(" "),b=0;b<a.length;b++)ICEcoder[a[b]]=top.document.getElementById(a[b])},init:function(){var a,b;ICEcoder.setLayout();top.ICEcoder.showHide("hide",top.document.getElementById("loadingMask"));top.ICEcoder.openLastFiles&&top.ICEcoder.autoOpenFiles();setInterval(ICEcoder.updateNestingIndicator,30);a=top.document.getElementById("screenMode");
|
||||||
|
b=["images/restored-screen.gif","images/full-screen.gif"];document.addEventListener("fullscreenchange",function(){a.src=document.fullscreen?b[0]:b[1]},!1);document.addEventListener("mozfullscreenchange",function(){a.src=document.mozFullScreen?b[0]:b[1]},!1);document.addEventListener("webkitfullscreenchange",function(){a.src=document.webkitIsFullScreen?b[0]:b[1]},!1);top.ICEcoder.ready=!0},setLayout:function(a){var b,c;b=window.innerWidth?window.innerWidth:document.body.clientWidth;c=window.innerHeight?
|
||||||
|
window.innerHeight:document.body.clientHeight;this.header.style.width=this.tabsBar.style.width=this.findBar.style.width=b+"px";this.files.style.width=this.editor.style.left=this.filesW+"px";this.account.style.height=this.accountH+"px";this.fmLock.style.marginLeft=this.filesW-42+"px";this.filesFrame.style.height=c-40-50-30+"px";this.nestValid.style.left=this.filesW+10+"px";this.nestDisplay.style.left=this.filesW+17+"px";top.ICEcoder.setTabWidths();a||(this.editor.style.width=ICEcoder.content.style.width=
|
||||||
|
b-this.filesW+"px",ICEcoder.content.style.height=c-40-30-21-28+"px",setTimeout(function(){for(var a=0;a<top.ICEcoder.openFiles.length;a++)top.ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[a]].setSize("100%",top.ICEcoder.content.style.height)},4))},changeFilesW:function(a){if(!ICEcoder.lockedNav||ICEcoder.lockedNav&&ICEcoder.filesW==ICEcoder.minFilesW)"undefined"!=typeof ICEcoder.changeFilesInt&&clearInterval(ICEcoder.changeFilesInt),ICEcoder.changeFilesInt=setInterval(function(){ICEcoder.changeFilesWStep(a)},
|
||||||
|
10)},changeFilesWStep:function(a){"expand"==a?ICEcoder.filesW<ICEcoder.maxFilesW-1?ICEcoder.filesW+=Math.ceil((ICEcoder.maxFilesW-ICEcoder.filesW)/2):ICEcoder.filesW=ICEcoder.maxFilesW:ICEcoder.filesW>ICEcoder.minFilesW+1?ICEcoder.filesW-=Math.ceil((ICEcoder.filesW-ICEcoder.minFilesW)/2):ICEcoder.filesW=ICEcoder.minFilesW;("expand"==a&&ICEcoder.filesW==ICEcoder.maxFilesW||"contract"==a&&ICEcoder.filesW==ICEcoder.minFilesW)&&clearInterval(ICEcoder.changeFilesInt);ICEcoder.setLayout()},canResizeFilesW:function(){"w-resize"==
|
||||||
|
top.document.body.style.cursor?top.ICEcoder.mouseDown&&(top.ICEcoder.filesW=top.ICEcoder.maxFilesW=250<=top.ICEcoder.mouseX&&400>=top.ICEcoder.mouseX?top.ICEcoder.mouseX:250>top.ICEcoder.mouseX?250:400,top.ICEcoder.files.style.width=top.ICEcoder.account.style.width=top.ICEcoder.filesFrame.style.width=top.ICEcoder.filesW+"px",top.ICEcoder.setLayout(),top.ICEcoder.draggingFilesW=!0):top.ICEcoder.draggingFilesW=!1},lockUnlockNav:function(){var a;a=top.document.getElementById("fmLock");ICEcoder.lockedNav=
|
||||||
|
ICEcoder.lockedNav?!1:!0;a.style.backgroundPosition=ICEcoder.lockedNav?"-64px -16px":"-80px -16px"},contentCleanUp:function(){var a,b;0>["js","coffee","css","less"].indexOf(ICEcoder.openFiles[ICEcoder.selectedTab-1].split(".")[1])&&(a=ICEcoder.getcMInstance(),b=a.getValue(),b=b.replace(/<ICEcoder:\/:textarea>/g,"</textarea>"),a.setValue(b),a.clearHistory())},moveLine:function(a){var b,c,d;b=top.ICEcoder.getcMInstance();c=b.getCursor().line;"up"==a&&0<c&&(d=c-1);"down"==a&&c<b.lineCount()-1&&(d=c+
|
||||||
|
1);isNaN(d)||(a=b.getLine(d),b.setLine(d,b.getLine(c)),b.setLine(c,a),ICEcoder.highlightLine(d))},highlightLine:function(a){var b;b=top.ICEcoder.getcMInstance();b.setSelection({line:a,ch:0},{line:a,ch:b.lineInfo(a).text.length})},goToLine:function(a){var b;b=ICEcoder.getcMInstance();b.setCursor(a?a-1:document.getElementById("goToLineNo").value-1);b.focus();return!1},switchMode:function(a){var b,c;b=ICEcoder.getcMInstance();c=ICEcoder.openFiles[ICEcoder.selectedTab-1];a?b.setOption("mode",a):c&&(0<
|
||||||
|
c.indexOf(".js")?b.setOption("mode","javascript"):0<c.indexOf(".coffee")?b.setOption("mode","coffeescript"):0<c.indexOf(".rb")?b.setOption("mode","ruby"):0<c.indexOf(".py")?b.setOption("mode","python"):0<c.indexOf(".css")?b.setOption("mode","css"):0<c.indexOf(".less")?b.setOption("mode","less"):0<c.indexOf(".md")?b.setOption("mode","markdown"):b.setOption("mode","application/x-httpd-php"))},lineCommentToggle:function(){var a,b,c,d,e,f;a=ICEcoder.getcMInstance();b=a.getCursor().ch;c=a.getCursor().line;
|
||||||
|
d=a.getLine(c);e=d.length;f=2;if(-1<"JavaScript CoffeeScript PHP Python Ruby CSS".split(" ").indexOf(ICEcoder.caretLocType))if(a.somethingSelected())if("Ruby"==ICEcoder.caretLocType||"Python"==ICEcoder.caretLocType){e=a.getCursor(!0).line;for(d=a.getCursor().line;e<=d;e++)a.setLine(e,"#"!=a.getLine(e).slice(0,1)?"#"+a.getLine(e):a.getLine(e).slice(1,a.getLine(e).length))}else a.replaceSelection("/*"!=a.getSelection().slice(0,2)?"/*"+a.getSelection()+"*/":a.getSelection().slice(2,a.getSelection().length-
|
||||||
|
2));else-1<["CoffeeScript","CSS"].indexOf(ICEcoder.caretLocType)?(a.setLine(c,"/*"!=d.slice(0,2)?"/*"+d+"*/":d.slice(2,e).slice(0,e-4)),"/*"==d.slice(0,2)&&(f=-f)):"Ruby"==ICEcoder.caretLocType?(a.setLine(c,"#"!=d.slice(0,1)?"#"+d:d.slice(1,e)),"#"==d.slice(0,1)&&(f=-f)):(a.setLine(c,"//"!=d.slice(0,2)?"//"+d:d.slice(2,e)),"//"==d.slice(0,2)&&(f=-f));else a.somethingSelected()?a.replaceSelection("\x3c!--"!=a.getSelection().slice(0,4)?"\x3c!--"+a.getSelection()+"//--\x3e":a.getSelection().slice(4,
|
||||||
|
a.getSelection().length-5)):(a.setLine(c,"\x3c!--"!=d.slice(0,4)?"\x3c!--"+d+"//--\x3e":d.slice(4,e).slice(0,e-9)),f="\x3c!--"==d.slice(0,4)?-4:4);a.somethingSelected()||a.setCursor(c,b+f)},highlightBlock:function(a,b){var c,d,e,f;c=top.ICEcoder.getcMInstance();if(b)top.ICEcoder.dontUpdateNest?c.setCursor(top.ICEcoder.cursorOrigLine,top.ICEcoder.cursorOrigCh):top.ICEcoder.getNestLocation("updateNestDisplay"),top.ICEcoder.dontUpdateNest=!1;else{top.ICEcoder.cursorOrigCh=c.getCursor().ch;top.ICEcoder.cursorOrigLine=
|
||||||
|
c.getCursor().line;top.ICEcoder.dontUpdateNest=!0;d={};d.ch=c.getCursor().ch;d.line=c.getCursor().line;for(var g=top.ICEcoder.htmlTagArray.length-1;g>=a;g--)e=c.getSearchCursor("<"+top.ICEcoder.htmlTagArray[g],d),e.findPrevious(),d.ch=e.from().ch,d.line=e.from().line,g==a&&(f=c.getSearchCursor(">",d),f.findNext(),c.setCursor(f.from().line,f.from().ch+1),top.ICEcoder.getNestLocation(),ICEcoder.htmlTagArray.length-1!=a&&g++);e.from()&&(d={},top.ICEcoder.startPosLine=d.line=e.from().line,top.ICEcoder.startPosCh=
|
||||||
|
d.ch=e.from().ch,e={},e.line=top.ICEcoder.content.contentWindow.CodeMirror.tagRangeFinder(c,d)||d.line,e.line=e.line.to?e.line.to.line:e.line,e.ch=c.getLine(e.line).indexOf("</"+top.ICEcoder.htmlTagArray[a]+">")+top.ICEcoder.htmlTagArray[a].length+3,!top.ICEcoder.dontSelect?c.setSelection(d,e):top.ICEcoder.dontSelect=!1,c.scrollIntoView(d))}},setPosition:function(a,b,c){var d;d=ICEcoder.getcMInstance();c=d.getLine(b).indexOf(">",d.getLine(b).indexOf("<"+c))+1;d.setCursor(b,c);d.focus();for(d=b=0;d<=
|
||||||
|
a;d++)b=ICEcoder.nestDisplay.innerHTML.indexOf(">",b+1);ICEcoder.nestDisplay.innerHTML=ICEcoder.nestDisplay.innerHTML.substr(0,b).replace(/<(?:.|\n)*?>/gm,"");top.ICEcoder.dontUpdateNest=!1;top.ICEcoder.dontSelect=!0},tagWrapper:function(a){var b,c,d,e;b=ICEcoder.getcMInstance();c=a;"div"==a?(d=b.getCursor("start").line,e=b.getCursor().line,b.operation(function(){b.replaceSelection("<div>\n"+b.getSelection()+"\n</div>");for(var a=d+1;a<=e+1;a++)b.indentLine(a);b.indentLine(e+2,"prev");b.indentLine(e+
|
||||||
|
2,"subtract")})):("a"==a&&(c='a href=""'),b.replaceSelection("<"+c+">"+b.getSelection()+"</"+a+">"));"a"==a&&b.setCursor({line:b.getCursor("start").line,ch:b.getCursor("start").ch+9})},addLineBreakAtEnd:function(a){var b;b=ICEcoder.getcMInstance();a||(a=b.getCursor().line);b.setLine(a,b.getLine(a)+"<br>")},duplicateLine:function(a){var b,c;b=ICEcoder.getcMInstance();a||(a=b.getCursor().line);c=b.getCursor().ch;b.setLine(a,b.getLine(a)+"\n"+b.getLine(a));b.setCursor(a+1,c)},removeLine:function(a){var b,
|
||||||
|
c;b=ICEcoder.getcMInstance();a||(a=b.getCursor().line);c=b.getCursor().ch;b.removeLine(a);b.setCursor(a-1,c)},jumpToDefinition:function(){var a,b;a=ICEcoder.getcMInstance();b=a.getTokenAt(a.getCursor()).string;if(a.somethingSelected()&&top.ICEcoder.origCurorPos)a.setCursor(top.ICEcoder.origCurorPos);else{top.ICEcoder.origCurorPos=a.getCursor();a=["var "+b,"function "+b,b+"=function",b+"= function",b+" =function",b+" = function",b+"=new function",b+"= new function",b+" =new function",b+" = new function",
|
||||||
|
"window['"+b+"']",'window["'+b+'"]',"this['"+b+"']",'this["'+b+'"]',b+":",b+" :","def "+b,"class "+b];for(b=0;b<a.length;b++)top.ICEcoder.findReplace(a[b],!1,!1)&&(b=a.length)}},openCloseDir:function(a,b){var c,d;a.onclick=function(a){a.ctrlKey||top.ICEcoder.openCloseDir(this,!1)};c=a.parentNode;c.nextSibling&&(c=c.nextSibling);c&&"UL"==c.tagName&&((d="none"==c.style.display)?b=!0:c.style.display="none",a.parentNode.className=a.className=d?"pft-directory dirOpen":"pft-directory");b&&(top.ICEcoder.filesFrame.contentWindow.frames.fileControl.location.href=
|
||||||
|
"lib/get-branch.php?location="+a.childNodes[1].id);return!1},overFileFolder:function(a,b){ICEcoder.thisFileFolderType=a;ICEcoder.thisFileFolderLink=b},selectFileFolder:function(a){var b,c;""==top.ICEcoder.thisFileFolderLink?a.ctrlKey||top.ICEcoder.deselectAllFiles():top.ICEcoder.thisFileFolderLink&&(c=top.ICEcoder.thisFileFolderLink.replace(/\//g,"|"),b=ICEcoder.filesFrame.contentWindow.document.getElementById(c),a.ctrlKey?-1<top.ICEcoder.selectedFiles.indexOf(c)?(ICEcoder.selectDeselectFile("deselect",
|
||||||
|
b),top.ICEcoder.selectedFiles.splice(top.ICEcoder.selectedFiles.indexOf(c),1)):(ICEcoder.selectDeselectFile("select",b),top.ICEcoder.selectedFiles.push(c)):(top.ICEcoder.deselectAllFiles(),ICEcoder.selectDeselectFile("select",b),top.ICEcoder.selectedFiles.push(c)));document.findAndReplace.target[2].innerHTML=!top.ICEcoder.selectedFiles[0]?"all files":"selected files";document.findAndReplace.target[3].innerHTML=!top.ICEcoder.selectedFiles[0]?"all filenames":"selected filenames";top.ICEcoder.fMIconVis("fMOpen",
|
||||||
|
1==top.ICEcoder.selectedFiles.length?1:0.3);top.ICEcoder.fMIconVis("fMNewFile",1==top.ICEcoder.selectedFiles.length&&"folder"==top.ICEcoder.thisFileFolderType?1:0.3);top.ICEcoder.fMIconVis("fMNewFolder",1==top.ICEcoder.selectedFiles.length&&"folder"==top.ICEcoder.thisFileFolderType?1:0.3);top.ICEcoder.fMIconVis("fMDelete",0<top.ICEcoder.selectedFiles.length?1:0.3);top.ICEcoder.fMIconVis("fMRename",1==top.ICEcoder.selectedFiles.length?1:0.3);top.document.getElementById("fileMenu").style.display="none"},
|
||||||
|
deselectAllFiles:function(){for(var a,b=0;b<top.ICEcoder.selectedFiles.length;b++)a=top.ICEcoder.filesFrame.contentWindow.document.getElementById(top.ICEcoder.selectedFiles[b]),ICEcoder.selectDeselectFile("deselect",a);top.ICEcoder.selectedFiles.length=0},selectDeselectFile:function(a,b){var c;b&&(c=-1<top.ICEcoder.openFiles.indexOf(b.id.replace(/\|/g,"/"))?!0:!1,b.style.backgroundColor=top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1]==b.id.replace(/\|/g,"/")?"select"==a?top.ICEcoder.tabBGselected:
|
||||||
|
top.ICEcoder.tabBGcurrent:"select"==a?top.ICEcoder.tabBGselected:b.style.backgroundColor=c?top.ICEcoder.tabBGopen:top.ICEcoder.tabBGnormal,b.style.color="select"==a?top.ICEcoder.tabFGselected:top.ICEcoder.tabFGnormalFile)},newFile:function(){top.ICEcoder.newTab();top.ICEcoder.saveFile()},newFolder:function(){var a,b;a=top.ICEcoder.rightClickedFile.replace(/\|/g,"/");if(b=top.ICEcoder.getInput("Enter New Folder Name at "+a,""))b=(a+"/"+b).replace(/\/\//,"/"),top.ICEcoder.serverQueue("add","lib/file-control.php?action=newFolder&file="+
|
||||||
|
b.replace(/\//g,"|")),top.ICEcoder.serverMessage("<b>Creating Folder</b><br>"+b)},openFile:function(a){var b;a&&(top.ICEcoder.thisFileFolderLink=a,top.ICEcoder.thisFileFolderType="file");!1!==top.ICEcoder.isOpen(top.ICEcoder.thisFileFolderLink)?top.ICEcoder.switchTab(top.ICEcoder.isOpen(top.ICEcoder.thisFileFolderLink)+1):""!=top.ICEcoder.thisFileFolderLink&&"file"==top.ICEcoder.thisFileFolderType&&(a=top.ICEcoder.thisFileFolderLink.replace(/\|/g,"/"),b=!0,100>top.ICEcoder.openFiles.length?-1<top.ICEcoder.openFiles.indexOf(a)&&
|
||||||
|
"/[NEW]"!=a&&(b=!1,top.ICEcoder.switchTab(i+1)):(top.ICEcoder.message("Sorry, you can only have 100 files open at a time!"),b=!1),b&&(top.ICEcoder.shortURL=a,"/[NEW]"!=a?(top.ICEcoder.thisFileFolderLink=top.ICEcoder.thisFileFolderLink.replace(/\//g,"|"),top.ICEcoder.serverQueue("add","lib/file-control.php?action=load&file="+top.ICEcoder.thisFileFolderLink),top.ICEcoder.serverMessage("<b>Opening File</b><br>"+top.ICEcoder.shortURL)):top.ICEcoder.createNewTab(),top.ICEcoder.fMIconVis("fMView",1)))},
|
||||||
|
openPrompt:function(){var a;if(a=top.ICEcoder.getInput("Enter relative file path (prefixed with /) or remote URL",""))-1<a.indexOf("://")?top.ICEcoder.getRemoteFile(a):top.ICEcoder.openFile(a)},getRemoteFile:function(a){top.ICEcoder.serverQueue("add","lib/file-control.php?action=getRemoteFile&file="+a);top.ICEcoder.serverMessage("<b>Getting</b><br>"+a)},saveFile:function(a){var b;a=a?"saveAs":"save";b=ICEcoder.openFiles[ICEcoder.selectedTab-1].replace(top.iceRoot,"").replace(/\//g,"|");"|[NEW]"==
|
||||||
|
b&&(b=top.ICEcoder.selectedFiles[0]+b);top.ICEcoder.serverQueue("add","lib/file-control.php?action=save&file="+b+"&fileMDT="+ICEcoder.openFileMDTs[ICEcoder.selectedTab-1]+"&saveType="+a);top.ICEcoder.serverMessage("<b>Saving</b><br>"+ICEcoder.openFiles[ICEcoder.selectedTab-1].replace(top.iceRoot,""))},renameFile:function(a,b){var c,d;a?c=a.replace(/\|/g,"/"):(c=top.ICEcoder.rightClickedFile.replace(/\|/g,"/"),a=top.ICEcoder.rightClickedFile.replace(/\|/g,"/"));b||(b=top.ICEcoder.getInput("Please enter the new name for",
|
||||||
|
c));b&&(d=top.ICEcoder.openFiles.indexOf(c.replace(/\|/g,"/")),-1<d&&(top.ICEcoder.openFiles[d]=b,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\'; top.ICEcoder.overCloseLink=true" onMouseOut="this.style.backgroundColor=prevBG; top.ICEcoder.overCloseLink=false"></a>',c=top.ICEcoder.openFiles[d],top.document.getElementById("tab"+
|
||||||
|
(d+1)).innerHTML=closeTabLink+" "+c.slice(c.lastIndexOf("/")).replace(/\//,""),top.document.getElementById("tab"+(d+1)).title=b),top.ICEcoder.serverQueue("add","lib/file-control.php?action=rename&file="+b+"&oldFileName="+a.replace(/\|/g,"/")),top.ICEcoder.serverMessage("<b>Renaming to</b><br>"+b),top.ICEcoder.setPreviousFiles())},deleteFile:function(){var a;0<top.ICEcoder.selectedFiles.length&&(a=top.ICEcoder.ask("Delete:\n\n"+top.ICEcoder.selectedFiles.toString().replace(/\|/g,"/").replace(/,/g,
|
||||||
|
"\n")+"?"));if(a){a="";for(var b=0;b<top.ICEcoder.selectedFiles.length;b++)a+=top.ICEcoder.selectedFiles[b],b<top.ICEcoder.selectedFiles.length-1&&(a+=";");top.ICEcoder.serverQueue("add","lib/file-control.php?action=delete&file="+a);top.ICEcoder.serverMessage("<b>Deleting File</b><br>"+top.ICEcoder.selectedFiles.toString().replace(/\|/g,"/").replace(/,/g,"\n"))}},copyFile:function(){top.ICEcoder.copiedFiles=[];for(var a=0;a<top.ICEcoder.selectedFiles.length;a++)top.ICEcoder.copiedFiles[a]=top.ICEcoder.selectedFiles[a];
|
||||||
|
top.document.getElementById("fmMenuPasteOption").style.display="block";top.ICEcoder.hideFileMenu()},pasteFile:function(a){if(top.ICEcoder.copiedFiles)for(var b=0;b<top.ICEcoder.copiedFiles.length;b++)top.ICEcoder.serverQueue("add","lib/file-control.php?action=paste&file="+top.ICEcoder.copiedFiles[b]+"&location="+a),top.ICEcoder.serverMessage("<b>Pasting File</b><br>"+top.ICEcoder.copiedFiles[b].toString().replace(/\|/g,"/").replace(/,/g,"\n"));else top.ICEcoder.message("Nothing to paste, copy a file/folder first!")},
|
||||||
|
uploadFilesSelect:function(a){top.document.getElementById("uploadDir").value=a;top.document.getElementById("fileInput").click()},uploadFilesSubmit:function(){""!=top.document.getElementById("fileInput").value&&(top.ICEcoder.showHide("show",top.document.getElementById("loadingMask")),document.getElementById("uploadFilesForm").submit(),event.preventDefault())},showMenu:function(a){var b;(0==top.ICEcoder.selectedFiles.length||-1==top.ICEcoder.selectedFiles.indexOf(top.ICEcoder.rightClickedFile.replace(/\//g,
|
||||||
|
"|")))&&top.ICEcoder.selectFileFolder(a);"undefined"!=typeof top.ICEcoder.thisFileFolderLink&&""!=top.ICEcoder.thisFileFolderLink&&(a=-1<top.ICEcoder.selectedFiles[0].indexOf(".")?"file":"folder",b=top.document.getElementById("folderMenuItems"),b.style.display="folder"==a&&1==top.ICEcoder.selectedFiles.length?"block":"none",singleFileMenuItems.style.display=1<top.ICEcoder.selectedFiles.length?"none":"block",document.getElementById("fileMenu").style.display="inline-block",document.getElementById("fileMenu").style.left=
|
||||||
|
top.ICEcoder.mouseX+20+"px",document.getElementById("fileMenu").style.top=top.ICEcoder.mouseY-top.ICEcoder.filesFrame.contentWindow.document.body.scrollTop-10+"px");return!1},showFileMenu:function(){document.getElementById("fileMenu").style.display="inline-block"},hideFileMenu:function(){document.getElementById("fileMenu").style.display="none"},updateFileManagerList:function(a,b,c,d,e,f){var g,l,h,j,m,n,k,p;if("add"==a&&!document.getElementById("filesFrame").contentWindow.document.getElementById(b.replace(/\/$/,
|
||||||
|
"").replace(/\//g,"|")+"|"+c)){g=-1<c.indexOf(".")?"file":"folder";l="file"==g?"pft-file ext-"+c.substr(c.indexOf(".")+1):"pft-directory";d="file"==g?664:705;b||(b="/");b=b.replace(top.iceRoot,"");h=document.getElementById("filesFrame").contentWindow.document.getElementById(b.replace(/\//g,"|"));j=h.parentNode.parentNode.nextSibling;m=document.createTextNode("\n");n='<a nohref title="'+b.replace(/\/$/,"")+"/"+c+'" onMouseOver="top.ICEcoder.overFileFolder(\''+g+"','"+b.replace(/\/$/,"").replace(/\//g,
|
||||||
|
"|")+"|"+c+"')\" onMouseOut=\"top.ICEcoder.overFileFolder('"+g+'\',\'\')" style="position: relative; left:-22px"> <span id="'+b.replace(/\/$/,"").replace(/\//g,"|")+"|"+c+'">'+c+'</span> <span style="color: #888; font-size: 8px" id="'+b.replace(/\/$/,"").replace(/\//g,"|")+"|"+c+'_perms">'+d+"</span></a>";if(3>j.childNodes.length)k=document.createElement("ul"),j=h.parentNode.parentNode,j.parentNode.insertBefore(k,j.nextSibling),k=document.createElement("li"),
|
||||||
|
k.className=l,k.innerHTML=n,j.nextSibling.appendChild(k),j.nextSibling.appendChild(m);else for(h=0;h<=j.childNodes.length-1;h++)if(j.childNodes[h].className&&(k=0<j.childNodes[h].className.indexOf("directory")?"folder":"file",p=j.childNodes[h].getElementsByTagName("span")[0].innerHTML,k==g&&p>c||"folder"==g&&"file"==k||h==j.childNodes.length-1)){k=document.createElement("li");k.className=l;k.innerHTML=n;h==j.childNodes.length-1?(j.appendChild(k),j.appendChild(m)):(j.insertBefore(k,j.childNodes[h]),
|
||||||
|
j.insertBefore(m,j.childNodes[h+1]));break}"file"==g&&!f&&(top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1]=b+c)}"rename"==a&&(e=e.replace(/\//g,"|"),h=document.getElementById("filesFrame").contentWindow.document.getElementById(e),h.innerHTML=c,h.id=b.replace(/\//g,"|")+"|"+c,h.parentNode.title=h.id.replace(/\|/g,"/"),targetElemPerms=document.getElementById("filesFrame").contentWindow.document.getElementById(e+"_perms"),targetElemPerms.id=b.replace(/\//g,"|")+"|"+c+"_perms");"chmod"==a&&(e=top.ICEcoder.rightClickedFile.replace(/\|/g,
|
||||||
|
"/"),h=document.getElementById("filesFrame").contentWindow.document.getElementById(e.replace(/\//g,"|")+"_perms"),h.innerHTML=d);"delete"==a&&(h=document.getElementById("filesFrame").contentWindow.document.getElementById(b.replace(/\/$/,"").replace(/\//g,"|")+"|"+c).parentNode.parentNode,h.parentNode.removeChild(h))},fMIcon:function(a){"save"==a&&0<ICEcoder.openFiles.length&&top.ICEcoder.saveFile();1==ICEcoder.selectedFiles.length&&(top.ICEcoder.rightClickedFile=top.ICEcoder.thisFileFolderLink=top.ICEcoder.selectedFiles[0].replace("|",
|
||||||
|
"/"),"open"==a&&-1<ICEcoder.selectedFiles[0].indexOf(".")?(top.ICEcoder.thisFileFolderType="file",top.ICEcoder.openFile()):"newFile"==a?top.ICEcoder.newFile():"newFolder"==a?top.ICEcoder.newFolder():"rename"==a&&top.ICEcoder.renameFile(top.ICEcoder.rightClickedFile));"delete"==a&&0<ICEcoder.selectedFiles.length&&top.ICEcoder.deleteFile();"view"==a&&0<ICEcoder.openFiles.length&&window.open(top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1])},refreshFileManager:function(){var a;a=top.document.getElementById("progressBar").style;
|
||||||
|
a.webkitAnimation=a.mozAnimation="";setTimeout(function(){a.webkitAnimation=a.mozAnimation="fullexpand 10s ease-out"},4);top.ICEcoder.showHide("show",top.document.getElementById("loadingMask"));top.ICEcoder.filesFrame.src="files.php";top.ICEcoder.filesFrame.style.opacity="0";top.ICEcoder.filesFrame.onload=function(){top.ICEcoder.filesFrame.style.opacity="1";top.ICEcoder.showHide("hide",top.document.getElementById("loadingMask"))}},findReplaceOptions:function(){top.document.getElementById("rText").style.display=
|
||||||
|
top.document.getElementById("replace").style.display=top.document.getElementById("rTarget").style.display="and"==document.findAndReplace.connector.value?"inline-block":"none"},findReplace:function(a,b,c){var d,e,f,g;a=a.toLowerCase();d=top.document.getElementById("replace").value;e=top.document.getElementById("results");if((f=ICEcoder.getcMInstance())&&0<a.length&&"this document"==document.findAndReplace.target.value){f.getValue().toLowerCase();"and"==document.findAndReplace.connector.value&&("replace"==
|
||||||
|
document.findAndReplace.replaceAction.value&&f.getSelection().toLowerCase()==a?f.replaceSelection(d):"replace all"==document.findAndReplace.replaceAction.value&&c&&(c=RegExp(a,"gi"),f.setValue(f.getValue().replace(c,d))));c=f.getValue().toLowerCase();if(!top.ICEcoder.findMode||a!=top.ICEcoder.lastsearch){ICEcoder.results=[];for(d=0;d<c.length;d++)c.substr(d,a.length)==a&&d!=ICEcoder.findResult&&ICEcoder.results.push(d);ICEcoder.lastsearch=a}if(0<ICEcoder.results.length){if(b)e.innerHTML=ICEcoder.results.length+
|
||||||
|
" results";else{b=1;for(d=g=0;d<c.length;d++)c.indexOf("\n",d)==d&&b<=f.getCursor().line&&(b++,g=d);b=g+f.getCursor().ch+1;for(d=ICEcoder.findResult=0;d<ICEcoder.results.length;d++)ICEcoder.results[d]<b&&ICEcoder.findResult++;ICEcoder.findResult>ICEcoder.results.length-1&&(ICEcoder.findResult=0);e.innerHTML="Highlighted result "+(ICEcoder.findResult+1)+" of "+ICEcoder.results.length+" results";for(d=b=0;d<ICEcoder.results[ICEcoder.findResult];d++)c.indexOf("\n",d)==d&&b++;f.lineInfo(0);e=f.getSearchCursor(a,
|
||||||
|
f.getCursor(),!0);e.findNext();e.from()||(e=f.getSearchCursor(a,{line:0,ch:0},!0),e.findNext());f.setSelection(e.from(),e.to());f.focus();top.ICEcoder.findMode=!0}return!0}e.innerHTML="No results";return!1}if(""!=a&&c){filesQS=e=f="";"and"==document.findAndReplace.connector.value&&(f="&replace="+d);0<=document.findAndReplace.target.value.indexOf("file")&&(e="&target="+document.findAndReplace.target.value.replace(/ /g,"-"));if("selected files"==document.findAndReplace.target.value){filesQS="&selectedFiles=";
|
||||||
|
for(d=0;d<top.ICEcoder.selectedFiles.length;d++)filesQS+=top.ICEcoder.selectedFiles[d]+":";filesQS=filesQS.replace(/\:$/,"")}a=a.replace(/\'/g,"'");a!=encodeURIComponent(a)?a="ICEcoder:"+encodeURIComponent(a):a;top.ICEcoder.showHide("show",top.document.getElementById("loadingMask"));top.document.getElementById("mediaContainer").innerHTML='<iframe src="lib/multiple-results.php?find='+a+f+e+filesQS+'" class="whiteGlow" style="width: 700px; height: 500px"></iframe>'}},replaceInFile:function(a,b,
|
||||||
|
c){top.ICEcoder.serverQueue("add","lib/file-control.php?action=replaceText&fileRef="+a.replace(/\//g,"|")+"&find="+b+"&replace="+c);top.ICEcoder.serverMessage("<b>Replacing text in</b><br>"+a)},getNestLocation:function(a){var b,c,d;if(b=ICEcoder.getcMInstance()){c=b.getValue();b=b.getTokenAt(b.getCursor()).state;if("undefined"!=typeof b.curState&&"undefined"!=typeof b.curState.htmlState){ICEcoder.htmlTagArray=[];for(d=b.curState.htmlState.context;d;d=d.prev)"undefined"!=typeof d.tagName&&ICEcoder.htmlTagArray.unshift(d.tagName)}ICEcoder.tagString=
|
||||||
|
ICEcoder.htmlTagArray[ICEcoder.htmlTagArray.length-1];"JavaScript"==ICEcoder.caretLocType&&(ICEcoder.tagString="script");if(a&&!top.ICEcoder.dontUpdateNest&&(ICEcoder.nestDisplay.innerHTML="","undefined"!=typeof ICEcoder.openFiles[ICEcoder.selectedTab-1]&&(a=ICEcoder.openFiles[ICEcoder.selectedTab-1],0>["js","coffee","css","less"].indexOf(a.split(".")[1])&&-1==c.indexOf("include(")&&-1==c.indexOf("include_once(")&&(-1<c.indexOf("<html")||-1<c.indexOf("<body"))))){for(a=0;a<ICEcoder.htmlTagArray.length;a++)c=
|
||||||
|
'onMouseover="top.ICEcoder.highlightBlock('+a+')" onMouseout="top.ICEcoder.highlightBlock('+a+",'hide')\" onClick=\"top.ICEcoder.setPosition("+a+",top.ICEcoder.startPosLine,'"+ICEcoder.htmlTagArray[a]+"')\"",0==a&&(ICEcoder.nestDisplay.innerHTML+="<div "+c+' style="display: inline-block; width: 7px; margin-top: -5px; height: 30px; background-image: url(images/nest-tag-bg.gif)"></div>'),ICEcoder.nestDisplay.innerHTML+="<a "+c+' style="display: inline-block; cursor: pointer; background: #333; padding: 7px 2px 7px 7px; margin-top: -5px; height: 30px">'+
|
||||||
|
ICEcoder.htmlTagArray[a]+"</a>",ICEcoder.nestDisplay.innerHTML+=a<ICEcoder.htmlTagArray.length-1?"<div "+c+' style="display: inline-block; width: 8px; margin-top: -5px; height: 30px; background-image: url(images/nest-tag-bg.gif); background-position: -7px 0; cursor: pointer"></div>':"<div "+c+' style="display: inline-block; width: 7px; margin-top: -5px; height: 30px; background-image: url(images/nest-tag-bg.gif); background-position: -15px 0; cursor: pointer"></div>';"undefined"!=typeof b.curState&&
|
||||||
|
0<ICEcoder.htmlTagArray.length&&(ICEcoder.nestDisplay.innerHTML+='<a style="display: inline-block; cursor: default; padding: 7px 2px 7px 7px; margin-top: -5px; height: 30px; color: #666">'+(b.curState.tagName?b.curState.tagName:"content")+"</a>")}}},updateNestingIndicator:function(){var a,b,c;a=ICEcoder.getcMInstance();b=!0;c=ICEcoder.openFiles[ICEcoder.selectedTab-1];a&&(c&&-1==["js","coffee","css","less"].indexOf(c.split(".")[1]))&&(b="error"!=a.getTokenAt({line:a.lineCount(),ch:a.lineInfo(a.lineCount()-
|
||||||
|
1).text.length}).className?!0:!1);ICEcoder.nestValid.style.background=b?"#0b0":"#f00";ICEcoder.nestValid.title=b?"Nesting OK":"Nesting Broken"},getCaretPosition:function(){var a,b,c,d;a=ICEcoder.getcMInstance();b=a.getValue();c=a.getCursor().line;a=a.getCursor().ch;for(var e=d=0;e<c;e++)d=b.indexOf("\n",d),d+=1;ICEcoder.caretPos=d+a-1;ICEcoder.getNestLocation("yes")},updateCharDisplay:function(){var a;a=ICEcoder.getcMInstance();ICEcoder.caretLocationType();ICEcoder.charDisplay.innerHTML=ICEcoder.caretLocType+
|
||||||
|
", Line: "+(a.getCursor().line+1)+", Char: "+a.getCursor().ch},updateByteDisplay:function(){ICEcoder.byteDisplay.innerHTML=ICEcoder.getcMInstance().getValue().length.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")+" bytes"},showDisplay:function(a){top.ICEcoder.byteDisplay.style.display="byte"==a?"inline-block":"none";top.ICEcoder.charDisplay.style.display="char"==a?"inline-block":"none"},caretLocationType:function(){var a,b;a=ICEcoder.getcMInstance();b="Unknown";a=a.getValue().substr(0,ICEcoder.caretPos+
|
||||||
|
1);a.lastIndexOf("<script")>a.lastIndexOf("\x3c/script>")&&"Unknown"==b?b="JavaScript":a.lastIndexOf("<?")>a.lastIndexOf("?>")&&"Unknown"==b?b="PHP":a.lastIndexOf("<%")>a.lastIndexOf("%>")&&"Unknown"==b?b="Ruby":a.lastIndexOf("<")>a.lastIndexOf(">")&&"Unknown"==b?b="HTML":"Unknown"==b&&(b="Content");a=ICEcoder.openFiles[ICEcoder.selectedTab-1];0<a.indexOf(".js")?b="JavaScript":0<a.indexOf(".coffee")?b="CoffeeScript":0<a.indexOf(".py")?b="Python":0<a.indexOf(".rb")?b="Ruby":0<a.indexOf(".css")?b="CSS":
|
||||||
|
0<a.indexOf(".less")?b="LESS":0<a.indexOf(".md")&&(b="Markdown");ICEcoder.caretLocType=b},redoChangedContent:function(a){var b,c;b=ICEcoder.getcMInstance();c=a.keyCode?a.keyCode:a.which?a.which:a.charCode;if(!a.ctrlKey&&27!=c&&20!=c&&(16>c||19<c)&&(37>c||40<c)&&(144!=c||145!=c)&&(45!=c||46!=c)&&(33>c||36<c)&&(91!=c||92!=c)&&(112>c||123<c))ICEcoder.changedContent[ICEcoder.selectedTab-1]=0<b.historySize().undo?1:0,ICEcoder.redoTabHighlight(ICEcoder.selectedTab)},showHide:function(a,b){b.style.visibility=
|
||||||
|
"show"==a?"visible":"hidden"},getcMInstance:function(a){return top.ICEcoder.content.contentWindow["new"==a||"new"!=a&&0<ICEcoder.openFiles.length?"cM"+ICEcoder.cMInstances[ICEcoder.selectedTab-1]:"cM1"]},getMouseXY:function(a,b){top.ICEcoder.mouseX=a.pageX?a.pageX:a.clientX+document.body.scrollLeft;top.ICEcoder.mouseY=a.pageY?a.pageY:a.clientY+document.body.scrollTop;"top"!=b&&(top.ICEcoder.mouseY+=90);"editor"==b&&(top.ICEcoder.mouseX+=top.ICEcoder.filesW);top.ICEcoder.dragCursorTest();62<top.ICEcoder.mouseY&&
|
||||||
|
top.ICEcoder.setTabWidths()},dragCursorTest:function(){var a,b;a=top.ICEcoder.mouseX-top.ICEcoder.diffStartX;if(!1!==top.ICEcoder.draggingTab&&(top.ICEcoder.diffStartX&&(-10>=a||10<=a))&&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&&(a=window.innerWidth?window.innerHeight:document.body.clientHeight,top.ICEcoder.mouseDown||
|
||||||
|
(top.ICEcoder.draggingFilesW=!1),a=!ICEcoder.draggingTab&&(top.ICEcoder.mouseX>top.ICEcoder.filesW-7&&top.ICEcoder.mouseX<top.ICEcoder.filesW+7&&40<top.ICEcoder.mouseY&&top.ICEcoder.mouseY<a-30||top.ICEcoder.draggingFilesW)?"w-resize":"auto",top.ICEcoder.content.contentWindow.document&&top.ICEcoder.filesFrame.contentWindow)){top.document.body.style.cursor=a;if(b=top.ICEcoder.content.contentWindow.document.body)b.style.cursor=a;if(b=top.ICEcoder.filesFrame.contentWindow.document.body)b.style.cursor=
|
||||||
|
a}},serverMessage:function(a){var b;b=document.getElementById("serverMessage");a?(b.innerHTML=a,b.style.display="inline-block"):setTimeout(function(){b.style.display="none"},200);b.style.opacity=a?1:0},cssColorPreview:function(){var a,b,c,d;a=ICEcoder.getcMInstance();b=a.getLine(a.getCursor().line);for(c=/(#[\da-f]{3}(?:[\da-f]{3})?\b|\b(?:rgb|hsl)a?\([\s\d%,.-]+\)|\b[a-z]+\b)/gi;(d=c.exec(b))&&a.getCursor().ch>d.index+d[0].length;);(b=top.document.getElementById("content").contentWindow.document.getElementById("cssColor"))&&
|
||||||
|
b.parentNode.removeChild(b);top.ICEcoder.codeAssist&&"CSS"==top.ICEcoder.caretLocType&&(b=top.document.createElement("div"),b.id="cssColor",b.style.position="absolute",b.style.display="block",b.style.width=b.style.height="20px",b.style.zIndex="1000",b.style.background=d?d[0]:"",b.style.cursor="pointer",b.onclick=function(){top.ICEcoder.showColorPicker(d[0])},""==b.style.backgroundColor&&(b.style.display="none"),top.document.getElementById("header").appendChild(b),a.addWidget(a.getCursor(),top.document.getElementById("cssColor"),
|
||||||
|
!0))},showColorPicker:function(a){top.document.getElementById("blackMask").style.visibility="visible";top.document.getElementById("mediaContainer").innerHTML='<div id="picker" class="picker"></div><br><br><input type="text" id="color" name="color" value="#000" class="colorValue"><input type="button" onClick="top.ICEcoder.insertColorValue(top.document.getElementById(\'color\').value)" value="insert >" class="insertColorValue"><br><input type="text" id="colorRGB" name="colorRGB" value="rgb(0,0,0)" class="colorValue"><input type="button" onClick="top.ICEcoder.insertColorValue(top.document.getElementById(\'colorRGB\').value)" value="insert >" class="insertColorValue">';
|
||||||
|
farbtastic("picker","color");a&&top.document.getElementById("picker").farbtastic.setColor(a)},drawCanvasImage:function(a){var b=document.getElementById("canvasPicker").getContext("2d"),c=new Image;c.src=a.src;c.onload=function(){document.getElementById("canvasPicker").width=a.width;document.getElementById("canvasPicker").height=a.height;b.drawImage(c,0,0,a.width,a.height)};document.getElementById("canvasPicker").onmousemove=function(a){var c=b.getImageData(a.pageX-this.offsetLeft,a.pageY-this.offsetTop,
|
||||||
|
1,1).data;a=c[0];var f=c[1],g=c[2],c=a+","+f+","+g;a=top.ICEcoder.rgbToHex(a,f,g);document.getElementById("rgbMouseXY").value=c;document.getElementById("hexMouseXY").value="#"+a;document.getElementById("hexMouseXY").style.backgroundColor=document.getElementById("rgbMouseXY").style.backgroundColor="#"+a};document.getElementById("canvasPicker").onclick=function(){document.getElementById("rgb").value=document.getElementById("rgbMouseXY").value;document.getElementById("hex").value=document.getElementById("hexMouseXY").value;
|
||||||
|
document.getElementById("hex").style.backgroundColor=document.getElementById("rgb").style.backgroundColor=document.getElementById("hex").value}},rgbToHex:function(a,b,c){return top.ICEcoder.toHex(a)+top.ICEcoder.toHex(b)+top.ICEcoder.toHex(c)},toHex:function(a){a=parseInt(a,10);if(isNaN(a))return"00";a=Math.max(0,Math.min(a,255));return"0123456789abcdef".charAt((a-a%16)/16)+"0123456789abcdef".charAt(a%16)},insertColorValue:function(a){var b,c;b=ICEcoder.getcMInstance();c=b.getTokenAt(b.getCursor());
|
||||||
|
b.replaceRange(a,{line:b.getCursor().line,ch:c.start},{line:b.getCursor().line,ch:c.end})},fMIconVis:function(a,b){var c;if(c=top.document.getElementById(a))c.style.opacity=b},isOpen:function(a){a=a.replace(/\|/g,"/").replace(top.docRoot+top.iceRoot,"");a=top.ICEcoder.openFiles.indexOf(a);return-1!=a?a:!1},updateHints:function(){var a;if("undefined"!=typeof JSHINT&&-1<top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1].indexOf(".js")){a=ICEcoder.getcMInstance();a.operation(function(){for(var b=top.ICEcoder["cM"+
|
||||||
|
top.ICEcoder.cMInstances[top.ICEcoder.selectedTab-1]+"widgets"],c=0;c<b.length;++c)a.removeLineWidget(b[c]);b.length=0;JSHINT(a.getValue());for(c=0;c<JSHINT.errors.length;++c){var f=JSHINT.errors[c];if(f){var g=document.createElement("div"),l=g.appendChild(document.createElement("span"));l.innerHTML="!!";l.className="lint-error-icon";g.appendChild(document.createTextNode(f.reason));g.className="lint-error";b.push(a.addLineWidget(f.line-1,g,{coverGutter:!1,noHScroll:!0}))}}});var b=a.getScrollInfo(),
|
||||||
|
c=a.charCoords({line:a.getCursor().line+1,ch:0},"local").top;b.top+b.clientHeight<c&&a.scrollTo(null,c-b.clientHeight+3)}},startPluginIntervals:function(a,b,c,d){top.ICEcoder["plugTimer"+a]=-1<["_parent","_top","_self",""].indexOf(c)?top.ICEcoder["plugTimer"+a]=setInterval("window.location='"+b+"'",6E4*d):0==c.indexOf("fileControl")?top.ICEcoder["plugTimer"+a]=setInterval(function(){top.ICEcoder.serverQueue("add",b);top.ICEcoder.serverMessage(c.split(":")[1])},6E4*d):top.ICEcoder["plugTimer"+a]=setInterval("window.open('"+
|
||||||
|
b+"','"+c+"')",6E4*d);top.ICEcoder.pluginIntervalRefs.push(a)},codeAssistToggle:function(){var a;a=ICEcoder.getcMInstance();top.ICEcoder.codeAssist=!top.ICEcoder.codeAssist;top.ICEcoder.cssColorPreview();a.focus();if(top.ICEcoder.codeAssist)top.ICEcoder.updateHints();else for(i=0;i<top.ICEcoder.cMInstances.length;i++)a=top.ICEcoder.content.contentWindow["cM"+top.ICEcoder.cMInstances[i]],a.operation(function(){for(var b=top.ICEcoder["cM"+top.ICEcoder.cMInstances[i]+"widgets"],c=0;c<b.length;++c)a.removeLineWidget(b[c]);
|
||||||
|
b.length=0})},serverQueue:function(a,b){var c,d,e;c=ICEcoder.getcMInstance();for(e=d=0;e<ICEcoder.serverQueueItems.length;e++)0<ICEcoder.serverQueueItems[e].indexOf("action=save")&&d++;d++;if("add"==a)ICEcoder.serverQueueItems.push(b),0<b.indexOf("action=save")&&(e=document.createElement("textarea"),e.setAttribute("id","saveTemp"+d),document.body.appendChild(e),document.getElementById("saveTemp"+d).value=c.getValue());else if("del"==a){if(ICEcoder.serverQueueItems[0]&&0<ICEcoder.serverQueueItems[0].indexOf("action=save")){c=
|
||||||
|
d-1;for(e=1;e<c;e++)document.getElementById("saveTemp"+e).value=document.getElementById("saveTemp"+(e+1)).value;c=document.getElementById("saveTemp"+c);c.parentNode.removeChild(c)}ICEcoder.serverQueueItems.splice(0,1)}("del"==a&&1<=ICEcoder.serverQueueItems.length||1==ICEcoder.serverQueueItems.length)&&setTimeout(function(){top.ICEcoder.filesFrame.contentWindow.frames.fileControl.location.href=ICEcoder.serverQueueItems[0]},1)},cancelAllActions:function(){window.stop();0<ICEcoder.serverQueueItems.length&&
|
||||||
|
ICEcoder.serverQueueItems.splice(1,ICEcoder.serverQueueItems.length);top.ICEcoder.showHide("hide",top.document.getElementById("loadingMask"));top.ICEcoder.serverMessage('<b style="color: #d00">Cancelled tasks</b>');setTimeout(function(){top.ICEcoder.serverMessage()},2E3)},setPreviousFiles:function(){var a;a=top.ICEcoder.openFiles.join(",").replace(/\//g,"|").replace(/(\|\[NEW\])|(,\|\[NEW\])/g,"").replace(/(^,)|(,$)/g,"");""==a&&(a="CLEAR");top.ICEcoder.serverQueue("add","lib/settings.php?saveFiles="+
|
||||||
|
a)},autoOpenFiles:function(){if(0<top.ICEcoder.previousFiles.length&&top.ICEcoder.ask("Open previous files?\n\n"+top.ICEcoder.previousFiles.length+" files:\n"+top.ICEcoder.previousFiles.join("\n").replace(/\|/g,"/").replace(RegExp(top.docRoot+top.iceRoot,"gi"),"")))for(var a=0;a<top.ICEcoder.previousFiles.length;a++)top.ICEcoder.rightClickedFile=top.ICEcoder.thisFileFolderLink=top.ICEcoder.previousFiles[a].replace("|","/"),top.ICEcoder.thisFileFolderType="file",top.ICEcoder.openFile()},settingsScreen:function(a){a||
|
||||||
|
(top.document.getElementById("mediaContainer").innerHTML='<iframe src="lib/settings-screen.php" class="whiteGlow" style="width: 970px; height: 600px"></iframe>');top.ICEcoder.showHide(a?"hide":"show",top.document.getElementById("blackMask"))},helpScreen:function(){top.document.getElementById("mediaContainer").innerHTML='<iframe src="lib/help.php" class="whiteGlow" style="width: 800px; height: 470px"></iframe>';top.ICEcoder.showHide("show",top.document.getElementById("blackMask"))},showManual:function(a){top.document.getElementById("mediaContainer").innerHTML=
|
||||||
|
'<iframe src="http://icecoder.net/manual?version='+a+'" class="whiteGlow" style="width: 500px; height: 500px"></iframe>';top.ICEcoder.showHide("show",top.document.getElementById("blackMask"))},propertiesScreen:function(a){top.document.getElementById("mediaContainer").innerHTML='<iframe src="lib/properties.php?fileName='+a.replace(/\//g,"|")+'" class="whiteGlow" style="width: 660px; height: 330px"></iframe>';top.ICEcoder.showHide("show",top.document.getElementById("blackMask"))},useNewSettings:function(a,
|
||||||
|
b,c,d,e,f,g,l,h){var j;top.ICEcoder.theme=a.slice(a.lastIndexOf("/")+1,a.lastIndexOf("."));"editor"==top.ICEcoder.theme&&(top.ICEcoder.theme="icecoder");j=document.createElement("link");j.setAttribute("rel","stylesheet");j.setAttribute("type","text/css");j.setAttribute("href",a);top.ICEcoder.content.contentWindow.document.getElementsByTagName("head")[0].appendChild(j);a=-1<["eclipse","elegant","neat"].indexOf(top.ICEcoder.theme)?"#ccc":"#000";top.ICEcoder.switchTab(top.ICEcoder.selectedTab);top.document.getElementById("codeAssist").checked=
|
||||||
|
b;c!=top.ICEcoder.lockedNav&&top.ICEcoder.lockUnlockNav();c||(ICEcoder.changeFilesW("contract"),top.document.getElementById("fileMenu").style.display="none");c=ICEcoder.content.contentWindow.document.styleSheets[3];b=c.rules?"rules":"cssRules";c[b][0].style.fontSize=e;c[b][5].style.content=d?'"\\21e5"':'" "';c[b][2].style.cssText="background: "+a+" !important";top.ICEcoder.lineWrapping=f;top.ICEcoder.indentWithTabs=g;top.ICEcoder.indentSize=l;for(d=0;d<ICEcoder.cMInstances.length;d++)ICEcoder.content.contentWindow["cM"+
|
||||||
|
ICEcoder.cMInstances[d]].setOption("lineWrapping",top.ICEcoder.lineWrapping),ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[d]].setOption("indentWithTabs",top.ICEcoder.indentWithTabs),ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[d]].setOption("indentUnit",top.ICEcoder.indentSize),ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[d]].setOption("tabSize",top.ICEcoder.indentSize);h&&top.ICEcoder.refreshFileManager()},updateResultsDisplay:function(a){ICEcoder.findReplace(top.document.getElementById("find").value,
|
||||||
|
!0,!1);document.getElementById("results").style.display="show"==a?"inline-block":"none"},fullScreenSwitcher:function(){"undefined"!=typeof document.cancelFullScreen?document.fullScreen?document.cancelFullScreen():document.body.requestFullScreen():"undefined"!=typeof document.mozCancelFullScreen?document.mozFullScreen?document.mozCancelFullScreen():document.body.mozRequestFullScreen():"undefined"!=typeof document.webkitCancelFullScreen&&(document.webkitIsFullScreen?document.webkitCancelFullScreen():
|
||||||
|
document.body.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT))},zipIt:function(a){a=a.replace(/\//g,"|");top.ICEcoder.filesFrame.contentWindow.frames.fileControl.location.href="plugins/zip-it/index.php?zip="+a},chmod:function(a,b){top.ICEcoder.showHide("hide",top.document.getElementById("blackMask"));top.ICEcoder.serverQueue("add","lib/file-control.php?action=perms&file="+a.replace(top.iceRoot,"")+"&perms="+b);top.ICEcoder.serverMessage("<b>chMod "+b+" on </b><br>"+a.replace(top.iceRoot,""))},
|
||||||
|
openPreviewWindow:function(){if(0<top.ICEcoder.openFiles.length){var a,b,c;b=top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1];c=b.substr(b.lastIndexOf("/")+1);c=c.substr(c.lastIndexOf(".")+1);a=ICEcoder.getcMInstance();top.ICEcoder.previewWindow=window.open(b,"previewWindow");-1<["md"].indexOf(c)&&(top.ICEcoder.previewWindow.onload=function(){top.ICEcoder.previewWindow.document.documentElement.innerHTML=mmd(a.getValue())})}},openTerminal:function(){top.ICEcoder.demoMode?top.ICEcoder.message("Sorry, you need to be logged in to use the terminal"):
|
||||||
|
window.open("terminal")},logout:function(){window.location+="?logout"},message:function(a){alert(a)},ask:function(a){return confirm(a)},getInput:function(a,b){return prompt(a,b)},dataMessage:function(a){var b;b=top.ICEcoder.content.contentWindow.document.getElementById("dataMessage");b.style.display="block";b.innerHTML=a},switchTab:function(a,b){var c;ICEcoder.selectedTab=a;if(c=ICEcoder.getcMInstance()){ICEcoder.switchMode();for(var d=0;d<ICEcoder.cMInstances.length;d++)ICEcoder.content.contentWindow["cM"+
|
||||||
|
ICEcoder.cMInstances[d]].getWrapperElement().style.display="none";c.setOption("theme",top.ICEcoder.theme);c.getWrapperElement().style.display="block";b||setTimeout(function(){c.focus()},4);c.refresh();ICEcoder.redoTabHighlight(ICEcoder.selectedTab);top.ICEcoder.findMode=!1;ICEcoder.findReplace(top.document.getElementById("find").value,!0,!1);top.ICEcoder.codeAssist&&top.ICEcoder.updateHints();top.ICEcoder.getCaretPosition();top.ICEcoder.updateCharDisplay();top.ICEcoder.updateByteDisplay()}},newTab:function(){var a;
|
||||||
|
ICEcoder.cMInstances.push(ICEcoder.nextcMInstance);ICEcoder.selectedTab=ICEcoder.cMInstances.length;ICEcoder.showHide("show",ICEcoder.content);ICEcoder.content.contentWindow.createNewCMInstance(ICEcoder.nextcMInstance);ICEcoder.setLayout();ICEcoder.thisFileFolderType="file";ICEcoder.thisFileFolderLink="/[NEW]";ICEcoder.openFile();a=ICEcoder.getcMInstance("new");ICEcoder.switchTab(ICEcoder.openFiles.length);a.removeLineClass(ICEcoder["cMActiveLine"+ICEcoder.selectedTab],"background");ICEcoder["cMActiveLine"+
|
||||||
|
ICEcoder.selectedTab]=a.addLineClass(0,"background","cm-s-activeLine");ICEcoder.nextcMInstance++},createNewTab:function(){var a;top.ICEcoder.openFiles.push(top.ICEcoder.shortURL);top.document.getElementById("tab"+top.ICEcoder.openFiles.length).style.display="inline-block";a=top.ICEcoder.openFiles[top.ICEcoder.openFiles.length-1];top.document.getElementById("tab"+top.ICEcoder.openFiles.length).innerHTML='<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\'; top.ICEcoder.overCloseLink=true" onMouseOut="this.style.backgroundColor=prevBG; top.ICEcoder.overCloseLink=false"></a> '+
|
||||||
|
a.slice(a.lastIndexOf("/")).replace(/\//,"");top.document.getElementById("tab"+top.ICEcoder.openFiles.length).title="/"+top.ICEcoder.openFiles[top.ICEcoder.openFiles.length-1].replace(/\//,"");top.ICEcoder.setTabWidths();top.ICEcoder.redoTabHighlight(top.ICEcoder.openFiles.length);top.ICEcoder.selectedTab=top.ICEcoder.openFiles.length;top.ICEcoder.changedContent.push(0);top.ICEcoder.setPreviousFiles()},nextTab:function(){top.ICEcoder.switchTab(top.ICEcoder.selectedTab+1<=top.ICEcoder.openFiles.length?
|
||||||
|
top.ICEcoder.selectedTab+1:1,"noFocus")},previousTab:function(){top.ICEcoder.switchTab(1<=top.ICEcoder.selectedTab-1?top.ICEcoder.selectedTab-1:top.ICEcoder.openFiles.length,"noFocus")},renameTab:function(a,b){var c;top.ICEcoder.openFiles[a-1]=b;c=top.ICEcoder.openFiles[a-1];top.document.getElementById("tab"+a).innerHTML='<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\'; top.ICEcoder.overCloseLink=true" onMouseOut="this.style.backgroundColor=prevBG; top.ICEcoder.overCloseLink=false"></a> '+
|
||||||
|
c.slice(c.lastIndexOf("/")).replace(/\//,"");top.document.getElementById("tab"+a).title="/"+top.ICEcoder.openFiles[a-1].replace(/\//,"")},redoTabHighlight:function(a){for(var b,c,d=1;d<=ICEcoder.changedContent.length;d++){document.getElementById("tab"+d).childNodes[0]&&(document.getElementById("tab"+d).childNodes[0].childNodes[0].style.backgroundColor=1==ICEcoder.changedContent[d-1]?"#b00":"transparent");b=d==a?top.ICEcoder.tabFGselected:top.ICEcoder.tabFGnormalTab;if("undefined"!=typeof top.ICEcoder.openFiles[d-
|
||||||
|
1]&&"/[NEW]"!=top.ICEcoder.openFiles[d-1]&&(c=top.ICEcoder.filesFrame.contentWindow.document.getElementById(top.ICEcoder.openFiles[d-1].replace(/\//g,"|"))))c.style.backgroundColor=d==a?top.ICEcoder.tabBGcurrent:top.ICEcoder.tabBGopen;document.getElementById("tab"+d).style.color=b;b=d==a?-22:0;document.getElementById("tab"+d).style.backgroundPosition="0 "+b+"px"}top.ICEcoder.fMIconVis("fMSave",1==ICEcoder.changedContent[a-1]?1:0.3)},closeTab:function(a,b){var c;ICEcoder.getcMInstance();c=!0;1==ICEcoder.changedContent[a-
|
||||||
|
1]&&(c=top.ICEcoder.ask("You have made changes.\n\nAre you sure you want to close without saving?"));if(c){c=top.ICEcoder.openFiles[a-1];for(var d=a;d<ICEcoder.openFiles.length;d++)top.document.getElementById("tab"+d).innerHTML=top.document.getElementById("tab"+(d+1)).innerHTML,top.document.getElementById("tab"+d).title=top.document.getElementById("tab"+(d+1)).title,ICEcoder.openFiles[d-1]=ICEcoder.openFiles[d],ICEcoder.openFileMDTs[d-1]=ICEcoder.openFileMDTs[d];ICEcoder.content.contentWindow["cM"+
|
||||||
|
top.ICEcoder.cMInstances[a-1]].getWrapperElement().style.display="none";top.ICEcoder.cMInstances.splice(a-1,1);top.document.getElementById("tab"+ICEcoder.openFiles.length).style.display="none";top.document.getElementById("tab"+ICEcoder.openFiles.length).innerHTML="";top.document.getElementById("tab"+ICEcoder.openFiles.length).title="";ICEcoder.openFiles.pop();ICEcoder.openFileMDTs.pop();ICEcoder.selectedTab==a&&(0<ICEcoder.openFiles.length?ICEcoder.selectedTab-=1:ICEcoder.selectedTab=0);0<ICEcoder.openFiles.length&&
|
||||||
|
0==ICEcoder.selectedTab&&(ICEcoder.selectedTab=1);0==ICEcoder.openFiles.length?top.ICEcoder.fMIconVis("fMView",0.3):(ICEcoder.switchMode(),ICEcoder.switchTab(ICEcoder.selectedTab));top.ICEcoder.changedContent.splice(a-1,1);top.ICEcoder.redoTabHighlight(ICEcoder.selectedTab);top.ICEcoder.getNestLocation("update");top.ICEcoder.selectDeselectFile("deselect",top.ICEcoder.filesFrame.contentWindow.document.getElementById(c.replace(/\//g,"|")));b||top.ICEcoder.setPreviousFiles()}top.ICEcoder.canSwitchTabs=
|
||||||
|
!1;top.ICEcoder.setTabWidths("posOnlyNewTab");setTimeout(function(){top.ICEcoder.canSwitchTabs=!0},100)},closeAllTabs:function(){if(0<top.ICEcoder.cMInstances.length&&ICEcoder.ask("Close all tabs?"))for(var a=top.ICEcoder.cMInstances.length;0<a;a--)top.ICEcoder.closeTab(a,1<a?!0:!1)},setTabWidths:function(a){var b,c,d,e,f;b=parseInt(top.ICEcoder.content.style.width,10)-41-24-10;c=b/top.ICEcoder.openFiles.length-18;d=-18;e=41;f=0;top.ICEcoder.tabLeftPos=[];for(var g=0;g<top.ICEcoder.openFiles.length;g++)a&&
|
||||||
|
(g=top.ICEcoder.openFiles.length),d=168*top.ICEcoder.openFiles.length>b?parseInt(c*g,10)-parseInt(c*(g-1),10):150,e=0==g?41:parseInt(top.document.getElementById("tab"+g).style.left,10),f=0==g?0:parseInt(top.document.getElementById("tab"+g).style.width,10)+18,a?d=-18:(top.document.getElementById("tab"+(g+1)).style.left=e+f+"px",top.document.getElementById("tab"+(g+1)).style.width=d+"px"),top.ICEcoder.tabLeftPos.push(e+f);top.document.getElementById("newTab").style.left=e+f+d+18+"px"},tabDragStart:function(a){top.ICEcoder.draggingTab=
|
||||||
|
a;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"+a).style.zIndex=2;for(var b=1;b<=top.ICEcoder.openFiles.length;b++)top.document.getElementById("tab"+b).className=b!==a?"tab tabSlide":"tab tabDrag"},tabDragMove:function(){var a,b;a=parseInt(top.document.getElementById("tab"+top.ICEcoder.openFiles.length).style.width,10)+18;top.ICEcoder.thisLeft=a=41<=top.ICEcoder.tabDragMouseX?
|
||||||
|
top.ICEcoder.tabDragMouseX<=parseInt(top.document.getElementById("newTab").style.left,10)-a?top.ICEcoder.tabDragMouseX:parseInt(top.document.getElementById("newTab").style.left,10)-a:41;top.document.getElementById("tab"+top.ICEcoder.draggingTab).style.left=a+"px";top.ICEcoder.dragTabNo=top.ICEcoder.draggingTab;for(var c=1;c<=top.ICEcoder.openFiles.length;c++)top.document.getElementById("tab"+c).style.opacity=c==top.ICEcoder.draggingTab?1:0.5,b=top.ICEcoder.tabLeftPos[c]?top.ICEcoder.tabLeftPos[c]-
|
||||||
|
top.ICEcoder.tabLeftPos[c-1]:b,c!=top.ICEcoder.draggingTab&&(c<top.ICEcoder.draggingTab?top.document.getElementById("tab"+c).style.left=a<=top.ICEcoder.tabLeftPos[c-1]?top.ICEcoder.tabLeftPos[c-1]+b:top.ICEcoder.tabLeftPos[c-1]:top.document.getElementById("tab"+c).style.left=a>=top.ICEcoder.tabLeftPos[c-1]?top.ICEcoder.tabLeftPos[c-1]-b:top.ICEcoder.tabLeftPos[c-1])},tabDragEnd:function(){var a,b;top.ICEcoder.setTabWidths();for(var c=1;c<=top.ICEcoder.openFiles.length;c++)top.ICEcoder.thisLeft>=top.ICEcoder.tabLeftPos[c-
|
||||||
|
1]&&(a=top.ICEcoder.thisLeft==top.ICEcoder.tabLeftPos[0]?1:top.ICEcoder.dragTabNo>c?c+1:c),top.document.getElementById("tab"+c).className="tab",top.document.getElementById("tab"+c).style.opacity=1,c!=top.ICEcoder.dragTabNo?top.document.getElementById("tab"+c).style.zIndex=1:setTimeout(function(){top.document.getElementById("tab"+c).style.zIndex=1},150);if(top.ICEcoder.thisLeft&&!1!==top.ICEcoder.thisLeft){b=[];for(c=1;c<=top.ICEcoder.openFiles.length;c++)b.push(c);b.splice(top.ICEcoder.dragTabNo-
|
||||||
|
1,1);b.splice(a-1,0,top.ICEcoder.dragTabNo);ICEcoder.sortTabs(b)}top.ICEcoder.setTabWidths();top.ICEcoder.draggingTab=!1;top.ICEcoder.thisLeft=!1},sortTabs:function(a){var b,c,d;b=[ICEcoder.changedContent,ICEcoder.openFiles,ICEcoder.openFileMDTs,ICEcoder.cMInstances];c=[[],[],[],[]];for(var e=0;e<b.length;e++){for(var f=0;f<b[e].length;f++)c[e].push(b[e][a[f]-1]);b[e]=c[e]}for(e=0;e<a.length;e++)document.getElementById("tab"+a[e]).id="tab"+(e+1)+".temp",top.ICEcoder.selectedTab==a[e]&&(d=e+1);for(e=
|
||||||
|
0;e<a.length;e++)document.getElementById("tab"+(e+1)+".temp").id="tab"+(e+1);top.document.getElementById("tab"+d)&&(top.document.getElementById("tab"+d).className="tab tabSlide");ICEcoder.changedContent=b[0];ICEcoder.openFiles=b[1];ICEcoder.openFileMDTs=b[2];ICEcoder.cMInstances=b[3];top.ICEcoder.setTabWidths();top.ICEcoder.switchTab(d)},alphaTabs:function(){if(0<top.ICEcoder.openFiles.length){var a,b,c,d,e;a=[];b=[];c=[];for(var f=0;f<top.ICEcoder.openFiles.length;f++)a.push(top.ICEcoder.openFiles[f].slice(top.ICEcoder.openFiles[f].lastIndexOf("/")+
|
||||||
|
1)),b.push(top.ICEcoder.openFiles[f]),top.document.getElementById("tab"+(f+1)).className="tab tabSlide";for(;0<a.length;){d=a[0];nextValueFull=b[0];for(f=e=0;f<a.length;f++)a[f]<d&&(d=a[f],nextValueFull=top.ICEcoder.openFiles[top.ICEcoder.openFiles.indexOf(b[f])],e=f);c.push(top.ICEcoder.openFiles.indexOf(nextValueFull)+1);a.splice(e,1);b.splice(e,1)}top.ICEcoder.sortTabs(c)}},interceptKeys:function(a,b){var c;c=b.keyCode?b.keyCode:b.which?b.which:b.charCode;if(46==c&&"files"==a)return top.ICEcoder.deleteFile(),
|
||||||
|
!1;if(b.altKey){if(b.ctrlKey&&"content"==a){if(68==c)return top.ICEcoder.tagWrapper("div"),!1;if(83==c)return top.ICEcoder.tagWrapper("span"),!1;if(80==c)return top.ICEcoder.tagWrapper("p"),!1;if(65==c)return top.ICEcoder.tagWrapper("a"),!1;if(66==c)return top.ICEcoder.tagWrapper("b"),!1;if(73==c)return top.ICEcoder.tagWrapper("i"),!1;if(71==c)return top.ICEcoder.tagWrapper("strong"),!1;if(69==c)return top.ICEcoder.tagWrapper("em"),!1;if(49==c)return top.ICEcoder.tagWrapper("h1"),!1;if(50==c)return top.ICEcoder.tagWrapper("h2"),
|
||||||
|
!1;if(51==c)return top.ICEcoder.tagWrapper("h3"),!1;if(52==c)return top.ICEcoder.tagWrapper("h4"),!1;if(53==c)return top.ICEcoder.tagWrapper("h5"),!1;if(54==c)return top.ICEcoder.tagWrapper("h6"),!1;if(55==c)return top.ICEcoder.tagWrapper("h7"),!1;if(13==c)return top.ICEcoder.addLineBreakAtEnd(),!1}return c}return 70==c&&b.ctrlKey?(top.document.getElementById("find").focus(),!1):71==c&&b.ctrlKey?(top.document.getElementById("goToLineNo").focus(),!1):73==c&&b.ctrlKey&&"content"==a?(c=top.ICEcoder.caretLocType.toLowerCase()+
|
||||||
|
" ","CSS"==top.ICEcoder.caretLocType||"PHP"==top.ICEcoder.caretLocType?window.open("http://voke.fm/"+c+top.ICEcoder.getcMInstance().getSelection()):("Content"==top.ICEcoder.caretLocType&&(c=""),window.open("http://www.google.com/#output=search&q="+c+top.ICEcoder.getcMInstance().getSelection())),!1):39==c&&b.ctrlKey&&"content"!=a?(top.ICEcoder.nextTab(),!1):37==c&&b.ctrlKey&&"content"!=a?(top.ICEcoder.previousTab(),!1):38==c&&b.ctrlKey&&"content"==a?(top.ICEcoder.moveLine("up"),!1):40==c&&b.ctrlKey&&
|
||||||
|
"content"==a?(top.ICEcoder.moveLine("down"),!1):107==c&&b.ctrlKey?("content"==a?top.ICEcoder.duplicateLine():top.ICEcoder.newTab(),!1):109==c&&b.ctrlKey?("content"==a?top.ICEcoder.removeLine():top.ICEcoder.closeTab(top.ICEcoder.selectedTab),!1):83==c&&b.ctrlKey?(b.shiftKey?top.ICEcoder.saveFile("saveAs"):top.ICEcoder.saveFile(),!1):13==c&&b.ctrlKey&&"/[NEW]"!=top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1]?(window.open(top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1]),!1):79==c&&b.ctrlKey?(top.ICEcoder.openPrompt(),
|
||||||
|
!1):32==c&&b.ctrlKey&&"content"==a?(top.ICEcoder.addSnippet(),!1):32==c&&"content"!=a?(top.ICEcoder.getcMInstance().focus(),!1):74==c&&b.ctrlKey&&"content"==a?(top.ICEcoder.jumpToDefinition(),!1):27==c&&"content"==a?(top.ICEcoder.lineCommentToggle(),!1):27==c&&"content"!=a?(top.ICEcoder.cancelAllActions(),!1):c},resetKeys:function(){},addSnippet:function(){var a,b,c;a=ICEcoder.getcMInstance();b=a.getCursor().line;c=a.getLine(b).length-a.getLine(b).replace(/^\s\s*/,"").length;a=a.getLine(b).slice(c);
|
||||||
|
"function"==a.slice(0,8)?top.ICEcoder.doSnippet("function","function VAR() {\nINDENT\tCURSOR\nINDENT}"):"if"==a.slice(0,2)?top.ICEcoder.doSnippet("if","if (CURSOR) {\nINDENT\t\nINDENT}"):"for"==a.slice(0,3)&&top.ICEcoder.doSnippet("for","for (var i=0; i<CURSOR; i++) {\nINDENT\t\nINDENT}")},doSnippet:function(a,b){var c,d,e,f,g,l;c=top.ICEcoder.getcMInstance();d=c.getCursor().line;if(-1<c.getLine(d).indexOf(a)){e=c.getLine(d);f=e.indexOf(a);e=e.slice(e.indexOf(a)+a.length);b=b.replace(/VAR/g,e);e=
|
||||||
|
c.getLine(d).slice(0,f);f=c.getLine(d).length-c.getLine(d).replace(/^\s\s*/,"").length;f=c.getLine(d).slice(0,f);b=b.replace(/INDENT/g,f);e+=b;f=e.indexOf("CURSOR");g=0;l=d;for(i=0;i<e.length;i++)e.indexOf("\n",g)<e.indexOf("CURSOR")&&(g=e.indexOf("\n",g)+1,l+=1);c.setLine(d,e.replace("CURSOR",""));c.setCursor(l,f);c.focus()}}};
|
||||||
44
lib/mmd.js
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
;function mmd(src)
|
||||||
|
{
|
||||||
|
var h='';
|
||||||
|
|
||||||
|
function escape(t)
|
||||||
|
{
|
||||||
|
return new Option(t).innerHTML;
|
||||||
|
}
|
||||||
|
function inlineEscape(s)
|
||||||
|
{
|
||||||
|
return escape(s)
|
||||||
|
.replace(/!\[([^\]]*)]\(([^(]+)\)/g, '<img alt="$1" src="$2">')
|
||||||
|
.replace(/\[([^\]]+)]\(([^(]+)\)/g, '$1'.link('$2'))
|
||||||
|
.replace(/`([^`]+)`/g, '<code>$1</code>')
|
||||||
|
.replace(/\*\*([^*]+)\*\*/g, '<strong>$1</strong>')
|
||||||
|
.replace(/\*([^*]+)\*/g, '<em>$1</em>');
|
||||||
|
}
|
||||||
|
|
||||||
|
src
|
||||||
|
.replace(/^\s+|\r|\s+$/g, '')
|
||||||
|
.replace(/\t/g, ' ')
|
||||||
|
.split(/\n\n+/)
|
||||||
|
.forEach(function(b, f, R)
|
||||||
|
{
|
||||||
|
f=b[0];
|
||||||
|
R=
|
||||||
|
{
|
||||||
|
'*':[/\n\* /,'<ul><li>','</li></ul>'],
|
||||||
|
'1':[/\n[1-9]\d*\.? /,'<ol><li>','</li></ol>'],
|
||||||
|
' ':[/\n /,'<pre><code>','</pre></code>','\n'],
|
||||||
|
'>':[/\n> /,'<blockquote>','</blockquote>','\n']
|
||||||
|
}[f];
|
||||||
|
h+=
|
||||||
|
R?R[1]+('\n'+b)
|
||||||
|
.split(R[0])
|
||||||
|
.slice(1)
|
||||||
|
.map(R[3]?escape:inlineEscape)
|
||||||
|
.join(R[3]||'</li>\n<li>')+R[2]:
|
||||||
|
f=='#'?'<h'+(f=b.indexOf(' '))+'>'+inlineEscape(b.slice(f+1))+'</h'+f+'>':
|
||||||
|
f=='<'?b:
|
||||||
|
'<p>'+inlineEscape(b)+'</p>';
|
||||||
|
});
|
||||||
|
return h;
|
||||||
|
};
|
||||||
@@ -113,7 +113,7 @@ if (startTab!=top.ICEcoder.selectedTab) {
|
|||||||
$r = 0;
|
$r = 0;
|
||||||
function phpGrep($q, $path, $base) {
|
function phpGrep($q, $path, $base) {
|
||||||
$fp = opendir($path);
|
$fp = opendir($path);
|
||||||
global $r, $ICEcoder, $serverType, $selectedFiles;
|
global $r, $ICEcoder, $serverType, $selectedFiles, $context;
|
||||||
if (!isset($ret)) {$ret="";};
|
if (!isset($ret)) {$ret="";};
|
||||||
$slash = $serverType == strpos($path,"\\")>-1 ? "\\" : "/";
|
$slash = $serverType == strpos($path,"\\")>-1 ? "\\" : "/";
|
||||||
while($f = readdir($fp)) {
|
while($f = readdir($fp)) {
|
||||||
@@ -121,7 +121,7 @@ if (startTab!=top.ICEcoder.selectedTab) {
|
|||||||
$fullPath = $path.$slash.$f;
|
$fullPath = $path.$slash.$f;
|
||||||
if(is_dir($fullPath)) {
|
if(is_dir($fullPath)) {
|
||||||
$ret .= phpGrep($q, $fullPath, $base);
|
$ret .= phpGrep($q, $fullPath, $base);
|
||||||
} else if(stristr(file_get_contents($fullPath), $q)) {
|
} else if(stristr(toUTF8noBOM(file_get_contents($fullPath,false,$context),false), $q)) {
|
||||||
$bFile = false;
|
$bFile = false;
|
||||||
$foundInSelFile = false;
|
$foundInSelFile = false;
|
||||||
for ($i=0;$i<count($ICEcoder['bannedFiles']);$i++) {
|
for ($i=0;$i<count($ICEcoder['bannedFiles']);$i++) {
|
||||||
@@ -136,7 +136,7 @@ if (startTab!=top.ICEcoder.selectedTab) {
|
|||||||
}
|
}
|
||||||
if (!$bFile && (count($selectedFiles)==0 || count($selectedFiles)>0 && $foundInSelFile)) {
|
if (!$bFile && (count($selectedFiles)==0 || count($selectedFiles)>0 && $foundInSelFile)) {
|
||||||
$ret .= "<a href=\\\"javascript:top.ICEcoder.openFile('".$fullPath."');top.ICEcoder.showHide('hide',top.document.getElementById('blackMask'))\\\">";
|
$ret .= "<a href=\\\"javascript:top.ICEcoder.openFile('".$fullPath."');top.ICEcoder.showHide('hide',top.document.getElementById('blackMask'))\\\">";
|
||||||
$ret .= str_replace($base,"",$fullPath)."</a><div id=\\\"foundCount".$r."\\\">Found ".substr_count(strtolower(file_get_contents($fullPath)),$q)." times</div>";
|
$ret .= str_replace($base,"",$fullPath)."</a><div id=\\\"foundCount".$r."\\\">Found ".substr_count(strtolower(toUTF8noBOM(file_get_contents($fullPath,false,$context),false)),$q)." times</div>";
|
||||||
if (isset($_GET['replace'])) {
|
if (isset($_GET['replace'])) {
|
||||||
$ret .= "<div class=\\\"replace\\\" id=\\\"replace\\\" onClick=\\\"replaceInFileSingle('".$fullPath."');this.style.display=\'none\'\\\">replace</div>";
|
$ret .= "<div class=\\\"replace\\\" id=\\\"replace\\\" onClick=\\\"replaceInFileSingle('".$fullPath."');this.style.display=\'none\'\\\">replace</div>";
|
||||||
};
|
};
|
||||||
|
|||||||
1
lib/php.ini
Normal file
@@ -0,0 +1 @@
|
|||||||
|
magic_quotes_gpc = Off
|
||||||
@@ -12,15 +12,16 @@ table, caption, tbody, tfoot, thead, tr, th, td {
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
outline: 0;
|
outline: 0;
|
||||||
font-size: 12px;
|
/*font-size: 12px;*/
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
}
|
}
|
||||||
|
|
||||||
body {overflow: hidden;
|
body {overflow: hidden;
|
||||||
-webkit-user-select: none;
|
-webkit-user-select: none;
|
||||||
-moz-user-select: none;
|
-moz-user-select: none;
|
||||||
-o-user-select:none;
|
-o-user-select:none;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
h1 {font-size: 36px; font-weight: normal; color: #888; margin-bottom: 20px}
|
h1 {font-size: 36px; font-weight: normal; color: #888; margin-bottom: 20px}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
<script src="../<?php echo $ICEcoder["codeMirrorDir"]; ?>/lib/codemirror-compressed.js"></script>
|
<script src="../<?php echo $ICEcoder["codeMirrorDir"]; ?>/lib/codemirror-compressed.js"></script>
|
||||||
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
.CodeMirror {position: absolute; width: 420px; height: 240px; font-size: 13px}
|
.CodeMirror {position: absolute; width: 409px; height: 240px; font-size: <?php echo $ICEcoder["fontSize"];?>}
|
||||||
.CodeMirror-scroll {overflow: hidden}
|
.CodeMirror-scroll {overflow: hidden}
|
||||||
/* 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-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';};?>";}
|
||||||
@@ -139,7 +139,7 @@ for ($i=0;$i<count($themeArray);$i++) {
|
|||||||
?>
|
?>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<span style="position: absolute; margin: -15px 0 0 20px">
|
<span style="position: absolute; margin: -15px 0 0 10px">
|
||||||
line wrapping<br>
|
line wrapping<br>
|
||||||
<select onchange="showButton()" name="lineWrapping">
|
<select onchange="showButton()" name="lineWrapping">
|
||||||
<option value="true"<?php if($ICEcoder["lineWrapping"]) {echo " selected";};?>>yes</option>
|
<option value="true"<?php if($ICEcoder["lineWrapping"]) {echo " selected";};?>>yes</option>
|
||||||
@@ -147,9 +147,22 @@ for ($i=0;$i<count($themeArray);$i++) {
|
|||||||
</select>
|
</select>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<span style="position: absolute; margin: -15px 0 0 120px">
|
<span style="position: absolute; margin: -15px 0 0 100px">
|
||||||
tab width <span style="font-size: 10px; color: #888">chars</span><br>
|
indent type<br>
|
||||||
<input type="text" name="tabWidth" id="tabWidth" style="width: 30px" onkeydown="showButton()" onkeyup="changeTabWidth()" value="<?php echo $ICEcoder["tabWidth"];?>">
|
<select onchange="showButton()" name="indentWithTabs">
|
||||||
|
<option value="true"<?php if($ICEcoder["indentWithTabs"]) {echo " selected";};?>>tabs</option>
|
||||||
|
<option value="false"<?php if(!$ICEcoder["indentWithTabs"]) {echo " selected";};?>>spaces</option>
|
||||||
|
</select>
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<span style="position: absolute; margin: -15px 0 0 190px">
|
||||||
|
indent size <br>
|
||||||
|
<input type="text" name="indentSize" id="indentSize" style="width: 30px" onkeydown="showButton()" onkeyup="changeIndentSize()" value="<?php echo $ICEcoder["indentSize"];?>">
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<span style="position: absolute; margin: -15px 0 0 267px">
|
||||||
|
font size <br>
|
||||||
|
<input type="text" name="fontSize" id="fontSize" style="width: 44px" onkeydown="showButton()" onkeyup="changeFontSize()" value="<?php echo $ICEcoder["fontSize"];?>">
|
||||||
</span>
|
</span>
|
||||||
<br><br>
|
<br><br>
|
||||||
|
|
||||||
@@ -178,8 +191,8 @@ function findSequence(goal) {
|
|||||||
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
||||||
lineNumbers: true,
|
lineNumbers: true,
|
||||||
readOnly: "nocursor",
|
readOnly: "nocursor",
|
||||||
indentUnit: top.ICEcoder.tabWidth,
|
indentUnit: top.ICEcoder.indentSize,
|
||||||
tabSize: top.ICEcoder.tabWidth,
|
tabSize: top.ICEcoder.indentSize,
|
||||||
mode: "javascript",
|
mode: "javascript",
|
||||||
theme: "<?php echo $ICEcoder["theme"]=="default" ? 'icecoder' : $ICEcoder["theme"];?>"
|
theme: "<?php echo $ICEcoder["theme"]=="default" ? 'icecoder' : $ICEcoder["theme"];?>"
|
||||||
});
|
});
|
||||||
@@ -191,10 +204,16 @@ function selectTheme() {
|
|||||||
editor.setOption("theme", theme);
|
editor.setOption("theme", theme);
|
||||||
}
|
}
|
||||||
|
|
||||||
function changeTabWidth() {
|
function changeIndentSize() {
|
||||||
var tabWidth = document.getElementById("tabWidth").value;
|
var indentSize = document.getElementById("indentSize").value;
|
||||||
editor.setOption("indentUnit", tabWidth);
|
editor.setOption("indentUnit", indentSize);
|
||||||
editor.setOption("tabSize", tabWidth);
|
editor.setOption("tabSize", indentSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
function changeFontSize() {
|
||||||
|
cMCSS = document.styleSheets[2];
|
||||||
|
cMCSS.rules ? strCSS = 'rules' : strCSS = 'cssRules';
|
||||||
|
cMCSS[strCSS][0].style['fontSize'] = document.getElementById("fontSize").value;
|
||||||
}
|
}
|
||||||
|
|
||||||
var showButton = function() {
|
var showButton = function() {
|
||||||
|
|||||||
@@ -8,16 +8,36 @@ error_reporting(-1);
|
|||||||
// Set our default timezone and supress warning with @
|
// Set our default timezone and supress warning with @
|
||||||
@date_default_timezone_set(date_default_timezone_get());
|
@date_default_timezone_set(date_default_timezone_get());
|
||||||
|
|
||||||
|
// Set a stream context timeout for file reading
|
||||||
|
$context = stream_context_create(array('http'=>
|
||||||
|
array(
|
||||||
|
'timeout' => 60 // secs
|
||||||
|
)
|
||||||
|
));
|
||||||
|
|
||||||
// Start a session if we haven't already
|
// Start a session if we haven't already
|
||||||
if(!isset($_SESSION)) {session_start();}
|
if(!isset($_SESSION)) {session_start();}
|
||||||
|
|
||||||
// Logout if that's the action we're taking
|
// Logout if that's the action we're taking
|
||||||
if (isset($_GET['logout'])) {
|
if (isset($_GET['logout'])) {
|
||||||
$_SESSION['loggedIn']=false;
|
$_SESSION['loggedIn']=false;
|
||||||
|
$_SESSION['accountUsername']=false;
|
||||||
session_destroy();
|
session_destroy();
|
||||||
header("Location: dirname(__FILE__)./?loggedOut");
|
header("Location: dirname(__FILE__)./?loggedOut");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If magic quotes are still on (attempted to switch off in php.ini)
|
||||||
|
if (get_magic_quotes_gpc ()) {
|
||||||
|
function stripslashes_deep($value) {
|
||||||
|
$value = is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value);
|
||||||
|
return $value;
|
||||||
|
}
|
||||||
|
$_POST = (isset($_POST) && !empty($_POST)) ? array_map('stripslashes_deep', $_POST) : array();
|
||||||
|
$_GET = (isset($_GET) && !empty($_GET)) ? array_map('stripslashes_deep', $_GET) : array();
|
||||||
|
$_COOKIE = (isset($_COOKIE) && !empty($_COOKIE)) ? array_map('stripslashes_deep', $_COOKIE) : array();
|
||||||
|
$_REQUEST = (isset($_REQUEST) && !empty($_REQUEST)) ? array_map('stripslashes_deep', $_REQUEST) : array();
|
||||||
|
}
|
||||||
|
|
||||||
// Function to handle salted hashing
|
// Function to handle salted hashing
|
||||||
define('SALT_LENGTH',9);
|
define('SALT_LENGTH',9);
|
||||||
function generateHash($plainText,$salt=null) {
|
function generateHash($plainText,$salt=null) {
|
||||||
@@ -39,9 +59,29 @@ function numClean($var) {
|
|||||||
return is_numeric($var) ? floatval($var) : false;
|
return is_numeric($var) ? floatval($var) : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// returns a UTF8 based string with any UFT8 BOM removed
|
||||||
|
function toUTF8noBOM($string,$message) {
|
||||||
|
// Attempt to detect encoding
|
||||||
|
$encType = mb_detect_encoding($string);
|
||||||
|
// Get rid of any UTF-8 BOM
|
||||||
|
$string = preg_replace('/\x{EF}\x{BB}\x{BF}/','',$string);
|
||||||
|
// Test for any bad characters
|
||||||
|
$teststring = $string;
|
||||||
|
$teststringBroken = utf8_decode($teststring);
|
||||||
|
$teststringConverted = iconv("UTF-8", "UTF-8//IGNORE", $teststringBroken);
|
||||||
|
// If we have a matching length, UTF8 encode it
|
||||||
|
if ($encType != "ASCII" && strlen($teststringConverted) == strlen($teststringBroken)) {
|
||||||
|
$string = utf8_encode($string);
|
||||||
|
if ($message) {
|
||||||
|
echo "<script>top.ICEcoder.message('Your document doesn\'t appear to be in UTF-8 encoding so has been converted.');</script>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $string;
|
||||||
|
}
|
||||||
|
|
||||||
// Settings are stored in this file
|
// Settings are stored in this file
|
||||||
$settingsTemplate = 'config-template.php';
|
$settingsTemplate = 'config-template.php';
|
||||||
$settingsFile = 'config.php';
|
$settingsFile = 'config-'.str_replace(".","_",$_SERVER['SERVER_NAME']).'.php';
|
||||||
if (!file_exists(dirname(__FILE__)."/".$settingsFile)) {
|
if (!file_exists(dirname(__FILE__)."/".$settingsFile)) {
|
||||||
if (!copy(dirname(__FILE__)."/".$settingsTemplate, 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?");
|
die("Couldn't create $settingsFile. Maybe you need write permissions on the lib folder?");
|
||||||
@@ -51,9 +91,12 @@ include(dirname(__FILE__)."/".$settingsFile);
|
|||||||
|
|
||||||
// Add ICEcoder settings to beginning of $ICEcoder array
|
// Add ICEcoder settings to beginning of $ICEcoder array
|
||||||
$ICEcoder = array(
|
$ICEcoder = array(
|
||||||
"versionNo" => "2.0",
|
"versionNo" => "2.5",
|
||||||
"codeMirrorDir" => "CodeMirror-3.1",
|
"codeMirrorDir" => "CodeMirror-3.13",
|
||||||
"demoMode" => false
|
"demoMode" => false,
|
||||||
|
"devMode" => false,
|
||||||
|
"multiUser" => false,
|
||||||
|
"lineEnding" => "\n"
|
||||||
)+$ICEcoder;
|
)+$ICEcoder;
|
||||||
|
|
||||||
$onLoadExtras = "";
|
$onLoadExtras = "";
|
||||||
@@ -64,7 +107,7 @@ $demoMode = $ICEcoder['demoMode'];
|
|||||||
|
|
||||||
// Update this config file?
|
// Update this config file?
|
||||||
if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && isset($_POST["theme"]) && $_POST["theme"]) {
|
if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && isset($_POST["theme"]) && $_POST["theme"]) {
|
||||||
$settingsContents = file_get_contents($settingsFile);
|
$settingsContents = file_get_contents($settingsFile,false,$context);
|
||||||
// Replace our settings vars
|
// Replace our settings vars
|
||||||
$repPosStart = strpos($settingsContents,'"root"');
|
$repPosStart = strpos($settingsContents,'"root"');
|
||||||
$repPosEnd = strpos($settingsContents,'"previousFiles"');
|
$repPosEnd = strpos($settingsContents,'"previousFiles"');
|
||||||
@@ -83,14 +126,16 @@ if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && isset
|
|||||||
$ICEcoder["allowedIPs"] = 'array("'.str_replace(',','","',str_replace(" ","",strClean($_POST['allowedIPs']))).'")';
|
$ICEcoder["allowedIPs"] = 'array("'.str_replace(',','","',str_replace(" ","",strClean($_POST['allowedIPs']))).'")';
|
||||||
$ICEcoder["plugins"] = 'array('.PHP_EOL.' array('.PHP_EOL.' '.str_replace('====================','),'.PHP_EOL.' array(',$_POST['plugins']).'))';
|
$ICEcoder["plugins"] = 'array('.PHP_EOL.' array('.PHP_EOL.' '.str_replace('====================','),'.PHP_EOL.' array(',$_POST['plugins']).'))';
|
||||||
$ICEcoder["theme"] = strClean($_POST['theme']);
|
$ICEcoder["theme"] = strClean($_POST['theme']);
|
||||||
|
$ICEcoder["fontSize"] = strClean($_POST['fontSize']);
|
||||||
$ICEcoder["lineWrapping"] = strClean($_POST['lineWrapping']);
|
$ICEcoder["lineWrapping"] = strClean($_POST['lineWrapping']);
|
||||||
$ICEcoder["tabWidth"] = numClean($_POST['tabWidth']);
|
$ICEcoder["indentWithTabs"] = strClean($_POST['indentWithTabs']);
|
||||||
|
$ICEcoder["indentSize"] = numClean($_POST['indentSize']);
|
||||||
|
|
||||||
$settingsArray = array("root","checkUpdates","openLastFiles","findFilesExclude","codeAssist","visibleTabs","lockedNav","accountPassword","bannedFiles","bannedPaths","allowedIPs","plugins","theme","lineWrapping","tabWidth");
|
$settingsArray = array("root","checkUpdates","openLastFiles","findFilesExclude","codeAssist","visibleTabs","lockedNav","accountPassword","bannedFiles","bannedPaths","allowedIPs","plugins","theme","fontSize","lineWrapping","indentWithTabs","indentSize");
|
||||||
$settingsNew = "";
|
$settingsNew = "";
|
||||||
for ($i=0;$i<count($settingsArray);$i++) {
|
for ($i=0;$i<count($settingsArray);$i++) {
|
||||||
$settingsNew .= '"'.$settingsArray[$i].'"'.PHP_EOL.' => ';
|
$settingsNew .= '"'.$settingsArray[$i].'"'.PHP_EOL.' => ';
|
||||||
$settingWrap = $settingsArray[$i]=="root"||$settingsArray[$i]=="accountPassword"||$settingsArray[$i]=="theme" ? '"' : '';
|
$settingWrap = $settingsArray[$i]=="root"||$settingsArray[$i]=="accountPassword"||$settingsArray[$i]=="theme"||$settingsArray[$i]=="fontSize" ? '"' : '';
|
||||||
$settingsNew .= $settingWrap.$ICEcoder[$settingsArray[$i]].$settingWrap.','.PHP_EOL.PHP_EOL;
|
$settingsNew .= $settingWrap.$ICEcoder[$settingsArray[$i]].$settingWrap.','.PHP_EOL.PHP_EOL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -115,7 +160,7 @@ if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && isset
|
|||||||
// Do we need a file manager refresh?
|
// Do we need a file manager refresh?
|
||||||
$refreshFM = $_POST['changedFileSettings']=="true" ? "true" : "false";
|
$refreshFM = $_POST['changedFileSettings']=="true" ? "true" : "false";
|
||||||
// With all that worked out, we can now hide the settings screen and apply the new settings
|
// With all that worked out, we can now hide the settings screen and apply the new settings
|
||||||
echo "<script>top.ICEcoder.settingsScreen('hide');top.ICEcoder.useNewSettings('".$themeURL."',".$ICEcoder["codeAssist"].",".$ICEcoder["lockedNav"].",".$ICEcoder["visibleTabs"].",".$ICEcoder["lineWrapping"].",".$ICEcoder["tabWidth"].",".$refreshFM.");</script>";
|
echo "<script>top.ICEcoder.settingsScreen('hide');top.ICEcoder.useNewSettings('".$themeURL."',".$ICEcoder["codeAssist"].",".$ICEcoder["lockedNav"].",".$ICEcoder["visibleTabs"].",'".$ICEcoder["fontSize"]."',".$ICEcoder["lineWrapping"].",".$ICEcoder["indentWithTabs"].",".$ICEcoder["indentSize"].",".$refreshFM.");</script>";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Establish our user level
|
// Establish our user level
|
||||||
@@ -151,7 +196,7 @@ if (!$allowedIP) {
|
|||||||
|
|
||||||
// Save the currently opened files for next time
|
// Save the currently opened files for next time
|
||||||
if ($_SESSION['loggedIn'] && isset($_GET["saveFiles"]) && $_GET['saveFiles']) {
|
if ($_SESSION['loggedIn'] && isset($_GET["saveFiles"]) && $_GET['saveFiles']) {
|
||||||
$settingsContents = file_get_contents($settingsFile);
|
$settingsContents = file_get_contents($settingsFile,false,$context);
|
||||||
|
|
||||||
// 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;
|
||||||
@@ -258,9 +303,14 @@ if ((!$_SESSION['loggedIn'] || $ICEcoder["accountPassword"] == "") && !strpos($_
|
|||||||
if ($ICEcoder["accountPassword"] == "" && isset($_POST['accountPassword'])) {
|
if ($ICEcoder["accountPassword"] == "" && isset($_POST['accountPassword'])) {
|
||||||
$password = generateHash(strClean($_POST['accountPassword']));
|
$password = generateHash(strClean($_POST['accountPassword']));
|
||||||
$settingsFile = $settingsFile;
|
$settingsFile = $settingsFile;
|
||||||
$settingsContents = file_get_contents($settingsFile);
|
$settingsContents = file_get_contents($settingsFile,false,$context);
|
||||||
// Replace our empty password with the one submitted by user
|
// Replace our empty password with the one submitted by user
|
||||||
$settingsContents = str_replace('"accountPassword" => "",','"accountPassword" => "'.$password.'",',$settingsContents);
|
$settingsContents = str_replace('"accountPassword" => "",','"accountPassword" => "'.$password.'",',$settingsContents);
|
||||||
|
// Also set the update checker preference
|
||||||
|
$checkUpdates = $_POST['checkUpdates']=="true" ? "true" : "false";
|
||||||
|
// once to cover the true setting, once to cover false
|
||||||
|
$settingsContents = str_replace('"checkUpdates" => true,','"checkUpdates" => '.$checkUpdates.',',$settingsContents);
|
||||||
|
$settingsContents = str_replace('"checkUpdates" => false,','"checkUpdates" => '.$checkUpdates.',',$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 ".$settingsFile." and press refresh");
|
$fh = fopen($settingsFile, 'w') or die("Can't update config file. Please set public write permissions on ".$settingsFile." and press refresh");
|
||||||
fwrite($fh, $settingsContents);
|
fwrite($fh, $settingsContents);
|
||||||
@@ -293,8 +343,15 @@ echo $ICEcoder["accountPassword"] == "" ? "Setup" : "Login";
|
|||||||
<img src="../images/ice-coder.png">
|
<img src="../images/ice-coder.png">
|
||||||
<div class="version">v <?php echo $ICEcoder["versionNo"];?></div>
|
<div class="version">v <?php echo $ICEcoder["versionNo"];?></div>
|
||||||
<form name="settingsUpdate" action="settings.php" method="POST">
|
<form name="settingsUpdate" action="settings.php" method="POST">
|
||||||
|
<?php if ($ICEcoder["multiUser"]) { echo '<input type="text" name="'.($ICEcoder["accountPassword"] == "" ? "account" : "login").'Username" class="accountPassword"><br><br>';};?>
|
||||||
<input type="password" name="<?php echo $ICEcoder["accountPassword"] == "" ? "account" : "login"; ?>Password" class="accountPassword"><br><br>
|
<input type="password" name="<?php echo $ICEcoder["accountPassword"] == "" ? "account" : "login"; ?>Password" class="accountPassword"><br><br>
|
||||||
<input type="submit" name="submit" value="<?php echo $ICEcoder["accountPassword"] == "" ? "set password" : "login"; ?>" class="button">
|
<input type="submit" name="submit" value="<?php echo $ICEcoder["accountPassword"] == "" ? "set password" : "login"; ?>" class="button">
|
||||||
|
<?php
|
||||||
|
if ($ICEcoder["accountPassword"] == "") {
|
||||||
|
echo '<div class="text"><input type="checkbox" name="checkUpdates" value="true" checked> auto-check for updates</div>';
|
||||||
|
}
|
||||||
|
if (!$ICEcoder["multiUser"] && 1==2) { echo '<div class="text"><a href="javascript:alert(\'To put into multi-user mode, open lib/settings.php and change multiUser to true then reload this page\')">multi-user?</a></div>';};
|
||||||
|
?>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 617 B |
BIN
plugins/regexplained/icon.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 164 B |
BIN
plugins/tinypng/icon.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
plugins/voke/icon.png
Normal file
|
After Width: | Height: | Size: 1002 B |
@@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
include("../../lib/settings.php");
|
include("../lib/settings.php");
|
||||||
if ($demoMode || !$_SESSION['loggedIn']) {
|
if ($demoMode || !$_SESSION['loggedIn']) {
|
||||||
die("You must be logged in to access Terminal");
|
die("You must be logged in to access Terminal");
|
||||||
}
|
}
|
||||||