Compare commits
151 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ca5ef0d664 | ||
|
|
df8d2c3414 | ||
|
|
1300b02c77 | ||
|
|
b19835cafd | ||
|
|
9f0c83a62f | ||
|
|
745d47c13c | ||
|
|
608aa0b8ff | ||
|
|
c6f63c6b28 | ||
|
|
03a7155e64 | ||
|
|
cce9948c1c | ||
|
|
0d301aa001 | ||
|
|
0519cde4df | ||
|
|
f25b5f225e | ||
|
|
9a1ad5d369 | ||
|
|
8b8d626f05 | ||
|
|
542da8bc92 | ||
|
|
b8d145fd04 | ||
|
|
7a2bcf1d25 | ||
|
|
47d886d7b1 | ||
|
|
e2ce0a0f14 | ||
|
|
fcc33197fd | ||
|
|
e656082ef3 | ||
|
|
efb454cb2d | ||
|
|
883d4d20ef | ||
|
|
b01584d21f | ||
|
|
3ee07b979e | ||
|
|
ce4babfd1a | ||
|
|
e0ad9e8e85 | ||
|
|
75b557d10d | ||
|
|
cea206c5c7 | ||
|
|
7f63209404 | ||
|
|
032a62ca01 | ||
|
|
fcd032d263 | ||
|
|
a8932823b3 | ||
|
|
7243a21c61 | ||
|
|
5b529ee542 | ||
|
|
56738ab792 | ||
|
|
c94f3c532d | ||
|
|
12777521e0 | ||
|
|
cfb00073c1 | ||
|
|
f06bbcb3ba | ||
|
|
0aa3ff6b9d | ||
|
|
417edc710a | ||
|
|
9ffac766fd | ||
|
|
df8b5d43a5 | ||
|
|
e1b9788325 | ||
|
|
c193cf65a0 | ||
|
|
11d9681632 | ||
|
|
809b064abd | ||
|
|
e32a2498a3 | ||
|
|
d2c5d1a33b | ||
|
|
aa3df12e23 | ||
|
|
b6c4421dba | ||
|
|
60e3936d27 | ||
|
|
170bbafc12 | ||
|
|
8d9910d8d2 | ||
|
|
8e4d94418e | ||
|
|
841c68efb7 | ||
|
|
f8cfe1d2fc | ||
|
|
393d0b5523 | ||
|
|
523dbd6825 | ||
|
|
81b7b21885 | ||
|
|
4b5a2ff8ee | ||
|
|
295f68566b | ||
|
|
38bdbe0b3b | ||
|
|
e300f0c46e | ||
|
|
eba7364f45 | ||
|
|
ccd796e7f4 | ||
|
|
0a7aea5570 | ||
|
|
07055d97b6 | ||
|
|
bfba1418fb | ||
|
|
b6acd7f091 | ||
|
|
db30685723 | ||
|
|
f623303c0b | ||
|
|
0f10702cf9 | ||
|
|
69c2e86d1b | ||
|
|
37e7661729 | ||
|
|
2574a11203 | ||
|
|
6ef86718e7 | ||
|
|
697d6f1ef6 | ||
|
|
4dfe7e6711 | ||
|
|
2792b85036 | ||
|
|
a653be8e99 | ||
|
|
a3f78f78d9 | ||
|
|
e051562dac | ||
|
|
dc7d8de0c2 | ||
|
|
9b37444286 | ||
|
|
85c9f6aed9 | ||
|
|
f0f679c1fb | ||
|
|
a4591ce949 | ||
|
|
e390d2ce95 | ||
|
|
be8a4ebbec | ||
|
|
af6d80687c | ||
|
|
0c7d48d825 | ||
|
|
c46e6d60b3 | ||
|
|
aab8550250 | ||
|
|
5a7af34ca4 | ||
|
|
6c67116d53 | ||
|
|
45d58d90c3 | ||
|
|
ca60a88a54 | ||
|
|
f49cfced93 | ||
|
|
bc67286bb6 | ||
|
|
88b2108159 | ||
|
|
fda69a6d8c | ||
|
|
75fc4382b0 | ||
|
|
2f62574f9b | ||
|
|
9d8b695e35 | ||
|
|
07211b6ac3 | ||
|
|
8dac6feee6 | ||
|
|
b0f6705b4d | ||
|
|
0e463bf683 | ||
|
|
d61e263e0e | ||
|
|
6cd5f6198f | ||
|
|
f071b484fe | ||
|
|
281e0f5617 | ||
|
|
b2127dd88f | ||
|
|
92733b84a6 | ||
|
|
d27bae869c | ||
|
|
bf1fdf80f3 | ||
|
|
4e807b528c | ||
|
|
b488cabe71 | ||
|
|
ff5a7e7c9f | ||
|
|
36d7928834 | ||
|
|
1a3537311e | ||
|
|
4d66149dc2 | ||
|
|
219f8ab1e2 | ||
|
|
84e8714255 | ||
|
|
fd003c77f5 | ||
|
|
b187d34868 | ||
|
|
51ab472142 | ||
|
|
684277a3cc | ||
|
|
f689908848 | ||
|
|
d3df8621b8 | ||
|
|
00680d0869 | ||
|
|
153aa1f0d5 | ||
|
|
e4570d4530 | ||
|
|
a5432a6854 | ||
|
|
46dee99bba | ||
|
|
d703d9b31f | ||
|
|
e0101a3837 | ||
|
|
faa6950727 | ||
|
|
c6dc329ab6 | ||
|
|
1b19a77978 | ||
|
|
a9732eea7e | ||
|
|
63bde7b9da | ||
|
|
85e441390c | ||
|
|
c1cd34951c | ||
|
|
b38fee4bd0 | ||
|
|
4bf04b1c08 | ||
|
|
0f971b547e | ||
|
|
3292439a61 |
8
.gitignore
vendored
@@ -1,9 +1,7 @@
|
||||
error-log.txt
|
||||
backups/*
|
||||
!backups/index.php
|
||||
lib/config-*
|
||||
data/*
|
||||
!data/.gitkeep
|
||||
plugins/*
|
||||
!plugins/index.php
|
||||
test/test-file1.txt
|
||||
tmp/*
|
||||
!tmp/index.php
|
||||
!tmp/index.php
|
||||
|
||||
BIN
CodeMirror/.DS_Store
vendored
Normal file
47
CodeMirror/theme/2019-torres-digital-theme.css
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
/* Theme Name: 2019 Torres Digital® 🇧🇷
|
||||
|
||||
Author: Torres Digital® | Sites → Lojas Virtuais e e-Commerce
|
||||
Author URI: https://www.facebook.com/torresdigital/
|
||||
|
||||
Description: omos uma Agência Gaúcha que trabalha com Desenvolvimento Web voltado para todos os Nichos do Mercado tais como os de insumos, commodities, pequenos, médios e grandes Lojistas que desejam alcançar mais Clientes através do e-Commerce: Sites, Aplicativos, Lojas Virtuais, Marketplaces, WordPress e Woocommerce, integrados com os Principais Cartões e Soluções de Pagamentos do Brasil e do Mundo; tais como Cielo, CyberSource, PagSeguro, Stripe, Vindi, MasterCard, Visa, American Express, outros.
|
||||
|
||||
www.torresdigital.tk * Menos é mais.
|
||||
|
||||
Version: 2.0 *//* 15 de Junho de 2019 - 00h:04m:41s
|
||||
|
||||
License: GNU General Public License v2 or later
|
||||
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
This theme is licensed under the GPL. Use it to make something cool, have fun, and share what you’ve learned with others. */
|
||||
|
||||
/*All Begin*/
|
||||
.cm-s-2019-torres-digital-theme.CodeMirror { background:/* #2D223F*/ #251C36; color:#fff; }
|
||||
.cm-s-2019-torres-digital-theme div.CodeMirror-selected { background: #2D2D2D; }
|
||||
.cm-s-2019-torres-digital-theme .CodeMirror-line::selection, .cm-s-2019-torres-digital-theme .CodeMirror-line > span::selection, .cm-s-2019-torres-digital-theme .CodeMirror-line > span > span::selection { background: rgba(45, 45, 45, 0.99); }
|
||||
.cm-s-2019-torres-digital-theme .CodeMirror-line::-moz-selection, .cm-s-2019-torres-digital-theme .CodeMirror-line > span::-moz-selection, .cm-s-2019-torres-digital-theme .CodeMirror-line > span > span::-moz-selection { background: rgba(45, 45, 45, 0.99); }
|
||||
.cm-s-2019-torres-digital-theme .CodeMirror-gutters { background: #090412; border-right: 3px solid #442E46; }
|
||||
.cm-s-2019-torres-digital-theme .CodeMirror-guttermarker { color: #0f0; }
|
||||
.cm-s-2019-torres-digital-theme .CodeMirror-guttermarker-subtle { color: white; }
|
||||
.cm-s-2019-torres-digital-theme .CodeMirror-linenumber { color: #FFFFFF; }
|
||||
.cm-s-2019-torres-digital-theme .CodeMirror-cursor { border-left: 1px solid #00FF00; }
|
||||
|
||||
.cm-s-2019-torres-digital-theme span.cm-keyword { color: #ADFF2F; font-weight: bold; }
|
||||
.cm-s-2019-torres-digital-theme span.cm-atom { color: #49E6FF; }
|
||||
.cm-s-2019-torres-digital-theme span.cm-number { color: /*#FFB94F*/ /*#E7FB40*/ #FDE231; }
|
||||
.cm-s-2019-torres-digital-theme span.cm-def { color: #15E4D7;font-weight: bold; }
|
||||
.cm-s-2019-torres-digital-theme span.cm-variable { color: #FFF700; }
|
||||
.cm-s-2019-torres-digital-theme span.cm-variable-2 {color: #220060;background-color: #ffab00;padding: 0 8px;border-radius: 30px;margin: 0 2px;font-weight: 600;}
|
||||
.cm-s-2019-torres-digital-theme span.cm-variable-3 { color: #96F; }
|
||||
.cm-s-2019-torres-digital-theme span.cm-property { color: #F8019E; }
|
||||
.cm-s-2019-torres-digital-theme span.cm-operator { color: #999; }
|
||||
.cm-s-2019-torres-digital-theme span.cm-comment { color: #616163; }
|
||||
.cm-s-2019-torres-digital-theme span.cm-string { color: #F8019E; }
|
||||
.cm-s-2019-torres-digital-theme span.cm-meta { color: #F1FD31; font-weight: bold; }
|
||||
.cm-s-2019-torres-digital-theme span.cm-qualifier { color: #FFF700; }
|
||||
.cm-s-2019-torres-digital-theme span.cm-builtin { color: #F8A901; }
|
||||
.cm-s-2019-torres-digital-theme span.cm-bracket { color: #cc7; }
|
||||
.cm-s-2019-torres-digital-theme span.cm-tag { color: #FFBD40; }
|
||||
.cm-s-2019-torres-digital-theme span.cm-attribute { color: #FFF700; }
|
||||
.cm-s-2019-torres-digital-theme span.cm-error { color: #FF0000; }
|
||||
|
||||
.cm-s-2019-torres-digital-theme .CodeMirror-activeline-background { background: #040; }
|
||||
5
CodeMirror/theme/ambiance-mobile.css
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
.cm-s-ambiance.CodeMirror {
|
||||
-webkit-box-shadow: none;
|
||||
-moz-box-shadow: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
7
CodeMirror/theme/dracula.css
vendored
@@ -16,7 +16,7 @@
|
||||
.cm-s-dracula .CodeMirror-gutters { color: #282a36; }
|
||||
.cm-s-dracula .CodeMirror-cursor { border-left: solid thin #f8f8f0; }
|
||||
.cm-s-dracula .CodeMirror-linenumber { color: #6D8A88; }
|
||||
.cm-s-dracula.CodeMirror-focused div.CodeMirror-selected { background: rgba(255, 255, 255, 0.10); }
|
||||
.cm-s-dracula .CodeMirror-selected { background: rgba(255, 255, 255, 0.10); }
|
||||
.cm-s-dracula .CodeMirror-line::selection, .cm-s-dracula .CodeMirror-line > span::selection, .cm-s-dracula .CodeMirror-line > span > span::selection { background: rgba(255, 255, 255, 0.10); }
|
||||
.cm-s-dracula .CodeMirror-line::-moz-selection, .cm-s-dracula .CodeMirror-line > span::-moz-selection, .cm-s-dracula .CodeMirror-line > span > span::-moz-selection { background: rgba(255, 255, 255, 0.10); }
|
||||
.cm-s-dracula span.cm-comment { color: #6272a4; }
|
||||
@@ -24,8 +24,7 @@
|
||||
.cm-s-dracula span.cm-number { color: #bd93f9; }
|
||||
.cm-s-dracula span.cm-variable { color: #50fa7b; }
|
||||
.cm-s-dracula span.cm-variable-2 { color: white; }
|
||||
.cm-s-dracula span.cm-def { color: #ffb86c; }
|
||||
.cm-s-dracula span.cm-keyword { color: #ff79c6; }
|
||||
.cm-s-dracula span.cm-def { color: #50fa7b; }
|
||||
.cm-s-dracula span.cm-operator { color: #ff79c6; }
|
||||
.cm-s-dracula span.cm-keyword { color: #ff79c6; }
|
||||
.cm-s-dracula span.cm-atom { color: #bd93f9; }
|
||||
@@ -35,7 +34,7 @@
|
||||
.cm-s-dracula span.cm-qualifier { color: #50fa7b; }
|
||||
.cm-s-dracula span.cm-property { color: #66d9ef; }
|
||||
.cm-s-dracula span.cm-builtin { color: #50fa7b; }
|
||||
.cm-s-dracula span.cm-variable-3 { color: #50fa7b; }
|
||||
.cm-s-dracula span.cm-variable-3 { color: #ffb86c; }
|
||||
|
||||
.cm-s-dracula .CodeMirror-activeline-background { background: rgba(255,255,255,0.1); }
|
||||
.cm-s-dracula .CodeMirror-matchingbracket { text-decoration: underline; color: white !important; }
|
||||
|
||||
35
CodeMirror/theme/duotone-dark.css
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
Name: DuoTone-Dark
|
||||
Author: by Bram de Haan, adapted from DuoTone themes by Simurai (http://simurai.com/projects/2016/01/01/duotone-themes)
|
||||
|
||||
CodeMirror template by Jan T. Sott (https://github.com/idleberg), adapted by Bram de Haan (https://github.com/atelierbram/)
|
||||
*/
|
||||
|
||||
.cm-s-duotone-dark.CodeMirror { background: #2a2734; color: #6c6783; }
|
||||
.cm-s-duotone-dark div.CodeMirror-selected { background: #545167!important; }
|
||||
.cm-s-duotone-dark .CodeMirror-gutters { background: #2a2734; border-right: 0px; }
|
||||
.cm-s-duotone-dark .CodeMirror-linenumber { color: #545167; }
|
||||
|
||||
/* begin cursor */
|
||||
.cm-s-duotone-dark .CodeMirror-cursor { border-left: 1px solid #ffad5c; /* border-left: 1px solid #ffad5c80; */ border-right: .5em solid #ffad5c; /* border-right: .5em solid #ffad5c80; */ opacity: .5; }
|
||||
.cm-s-duotone-dark .CodeMirror-activeline-background { background: #363342; /* background: #36334280; */ opacity: .5;}
|
||||
.cm-s-duotone-dark .cm-fat-cursor .CodeMirror-cursor { background: #ffad5c; /* background: #ffad5c80; */ opacity: .5;}
|
||||
/* end cursor */
|
||||
|
||||
.cm-s-duotone-dark span.cm-atom, .cm-s-duotone-dark span.cm-number, .cm-s-duotone-dark span.cm-keyword, .cm-s-duotone-dark span.cm-variable, .cm-s-duotone-dark span.cm-attribute, .cm-s-duotone-dark span.cm-quote, .cm-s-duotone-dark span.cm-hr, .cm-s-duotone-dark span.cm-link { color: #ffcc99; }
|
||||
|
||||
.cm-s-duotone-dark span.cm-property { color: #9a86fd; }
|
||||
.cm-s-duotone-dark span.cm-punctuation, .cm-s-duotone-dark span.cm-unit, .cm-s-duotone-dark span.cm-negative { color: #e09142; }
|
||||
.cm-s-duotone-dark span.cm-string { color: #ffb870; }
|
||||
.cm-s-duotone-dark span.cm-operator { color: #ffad5c; }
|
||||
.cm-s-duotone-dark span.cm-positive { color: #6a51e6; }
|
||||
|
||||
.cm-s-duotone-dark span.cm-variable-2, .cm-s-duotone-dark span.cm-variable-3, .cm-s-duotone-dark span.cm-string-2, .cm-s-duotone-dark span.cm-url { color: #7a63ee; }
|
||||
.cm-s-duotone-dark span.cm-def, .cm-s-duotone-dark span.cm-tag, .cm-s-duotone-dark span.cm-builtin, .cm-s-duotone-dark span.cm-qualifier, .cm-s-duotone-dark span.cm-header, .cm-s-duotone-dark span.cm-em { color: #eeebff; }
|
||||
.cm-s-duotone-dark span.cm-bracket, .cm-s-duotone-dark span.cm-comment { color: #6c6783; }
|
||||
|
||||
/* using #f00 red for errors, don't think any of the colorscheme variables will stand out enough, ... maybe by giving it a background-color ... */
|
||||
.cm-s-duotone-dark span.cm-error, .cm-s-duotone-dark span.cm-invalidchar { color: #f00; }
|
||||
|
||||
.cm-s-duotone-dark span.cm-header { font-weight: normal; }
|
||||
.cm-s-duotone-dark .CodeMirror-matchingbracket { text-decoration: underline; color: #eeebff !important; }
|
||||
36
CodeMirror/theme/duotone-light.css
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
Name: DuoTone-Light
|
||||
Author: by Bram de Haan, adapted from DuoTone themes by Simurai (http://simurai.com/projects/2016/01/01/duotone-themes)
|
||||
|
||||
CodeMirror template by Jan T. Sott (https://github.com/idleberg), adapted by Bram de Haan (https://github.com/atelierbram/)
|
||||
*/
|
||||
|
||||
.cm-s-duotone-light.CodeMirror { background: #faf8f5; color: #b29762; }
|
||||
.cm-s-duotone-light div.CodeMirror-selected { background: #e3dcce !important; }
|
||||
.cm-s-duotone-light .CodeMirror-gutters { background: #faf8f5; border-right: 0px; }
|
||||
.cm-s-duotone-light .CodeMirror-linenumber { color: #cdc4b1; }
|
||||
|
||||
/* begin cursor */
|
||||
.cm-s-duotone-light .CodeMirror-cursor { border-left: 1px solid #93abdc; /* border-left: 1px solid #93abdc80; */ border-right: .5em solid #93abdc; /* border-right: .5em solid #93abdc80; */ opacity: .5; }
|
||||
.cm-s-duotone-light .CodeMirror-activeline-background { background: #e3dcce; /* background: #e3dcce80; */ opacity: .5; }
|
||||
.cm-s-duotone-light .cm-fat-cursor .CodeMirror-cursor { background: #93abdc; /* #93abdc80; */ opacity: .5; }
|
||||
/* end cursor */
|
||||
|
||||
.cm-s-duotone-light span.cm-atom, .cm-s-duotone-light span.cm-number, .cm-s-duotone-light span.cm-keyword, .cm-s-duotone-light span.cm-variable, .cm-s-duotone-light span.cm-attribute, .cm-s-duotone-light span.cm-quote, .cm-s-duotone-light-light span.cm-hr, .cm-s-duotone-light-light span.cm-link { color: #063289; }
|
||||
|
||||
.cm-s-duotone-light span.cm-property { color: #b29762; }
|
||||
.cm-s-duotone-light span.cm-punctuation, .cm-s-duotone-light span.cm-unit, .cm-s-duotone-light span.cm-negative { color: #063289; }
|
||||
.cm-s-duotone-light span.cm-string, .cm-s-duotone-light span.cm-operator { color: #1659df; }
|
||||
.cm-s-duotone-light span.cm-positive { color: #896724; }
|
||||
|
||||
.cm-s-duotone-light span.cm-variable-2, .cm-s-duotone-light span.cm-variable-3, .cm-s-duotone-light span.cm-string-2, .cm-s-duotone-light span.cm-url { color: #896724; }
|
||||
.cm-s-duotone-light span.cm-def, .cm-s-duotone-light span.cm-tag, .cm-s-duotone-light span.cm-builtin, .cm-s-duotone-light span.cm-qualifier, .cm-s-duotone-light span.cm-header, .cm-s-duotone-light span.cm-em { color: #2d2006; }
|
||||
.cm-s-duotone-light span.cm-bracket, .cm-s-duotone-light span.cm-comment { color: #b6ad9a; }
|
||||
|
||||
/* using #f00 red for errors, don't think any of the colorscheme variables will stand out enough, ... maybe by giving it a background-color ... */
|
||||
/* .cm-s-duotone-light span.cm-error { background: #896724; color: #728fcb; } */
|
||||
.cm-s-duotone-light span.cm-error, .cm-s-duotone-light span.cm-invalidchar { color: #f00; }
|
||||
|
||||
.cm-s-duotone-light span.cm-header { font-weight: normal; }
|
||||
.cm-s-duotone-light .CodeMirror-matchingbracket { text-decoration: underline; color: #faf8f5 !important; }
|
||||
|
||||
2
CodeMirror/theme/icecoder.css
vendored
@@ -40,4 +40,4 @@ ICEcoder default theme by Matt Pass, used in code editor available at https://ic
|
||||
.cm-s-icecoder .CodeMirror-gutters { background: #1d1d1b; min-width: 41px; border-right: 0; }
|
||||
.cm-s-icecoder .CodeMirror-linenumber { color: #555; cursor: default; }
|
||||
.cm-s-icecoder .CodeMirror-matchingbracket { color: #fff !important; background: #555 !important; }
|
||||
.cm-s-icecoder .CodeMirror-activeline-background { background: #000; }
|
||||
.cm-s-icecoder .CodeMirror-activeline-background { background: #000; }
|
||||
|
||||
2
CodeMirror/theme/material.css
vendored
@@ -7,7 +7,7 @@
|
||||
|
||||
*/
|
||||
|
||||
.cm-s-material {
|
||||
.cm-s-material.CodeMirror {
|
||||
background-color: #263238;
|
||||
color: rgba(233, 237, 237, 1);
|
||||
}
|
||||
|
||||
3
CodeMirror/theme/night.css
vendored
@@ -10,7 +10,7 @@
|
||||
.cm-s-night .CodeMirror-linenumber { color: #f8f8f8; }
|
||||
.cm-s-night .CodeMirror-cursor { border-left: 1px solid white; }
|
||||
|
||||
.cm-s-night span.cm-comment { color: #6900a1; }
|
||||
.cm-s-night span.cm-comment { color: #8900d1; }
|
||||
.cm-s-night span.cm-atom { color: #845dc4; }
|
||||
.cm-s-night span.cm-number, .cm-s-night span.cm-attribute { color: #ffd500; }
|
||||
.cm-s-night span.cm-keyword { color: #599eff; }
|
||||
@@ -19,7 +19,6 @@
|
||||
.cm-s-night span.cm-variable-2, .cm-s-night span.cm-tag { color: #99b2ff; }
|
||||
.cm-s-night span.cm-variable-3, .cm-s-night span.cm-def { color: white; }
|
||||
.cm-s-night span.cm-bracket { color: #8da6ce; }
|
||||
.cm-s-night span.cm-comment { color: #6900a1; }
|
||||
.cm-s-night span.cm-builtin, .cm-s-night span.cm-special { color: #ff9e59; }
|
||||
.cm-s-night span.cm-link { color: #845dc4; }
|
||||
.cm-s-night span.cm-error { color: #9d1e15; }
|
||||
|
||||
85
CodeMirror/theme/panda-syntax.css
vendored
Normal file
@@ -0,0 +1,85 @@
|
||||
/*
|
||||
Name: Panda Syntax
|
||||
Author: Siamak Mokhtari (http://github.com/siamak/)
|
||||
CodeMirror template by Siamak Mokhtari (https://github.com/siamak/atom-panda-syntax)
|
||||
*/
|
||||
.cm-s-panda-syntax {
|
||||
background: #292A2B;
|
||||
color: #E6E6E6;
|
||||
line-height: 1.5;
|
||||
font-family: 'Operator Mono', 'Source Sans Pro', Menlo, Monaco, Consolas, Courier New, monospace;
|
||||
}
|
||||
.cm-s-panda-syntax .CodeMirror-cursor { border-color: #ff2c6d; }
|
||||
.cm-s-panda-syntax .CodeMirror-activeline-background {
|
||||
background: rgba(99, 123, 156, 0.1);
|
||||
}
|
||||
.cm-s-panda-syntax .CodeMirror-selected {
|
||||
background: #FFF;
|
||||
}
|
||||
.cm-s-panda-syntax .cm-comment {
|
||||
font-style: italic;
|
||||
color: #676B79;
|
||||
}
|
||||
.cm-s-panda-syntax .cm-operator {
|
||||
color: #f3f3f3;
|
||||
}
|
||||
.cm-s-panda-syntax .cm-string {
|
||||
color: #19F9D8;
|
||||
}
|
||||
.cm-s-panda-syntax .cm-string-2 {
|
||||
color: #FFB86C;
|
||||
}
|
||||
|
||||
.cm-s-panda-syntax .cm-tag {
|
||||
color: #ff2c6d;
|
||||
}
|
||||
.cm-s-panda-syntax .cm-meta {
|
||||
color: #b084eb;
|
||||
}
|
||||
|
||||
.cm-s-panda-syntax .cm-number {
|
||||
color: #FFB86C;
|
||||
}
|
||||
.cm-s-panda-syntax .cm-atom {
|
||||
color: #ff2c6d;
|
||||
}
|
||||
.cm-s-panda-syntax .cm-keyword {
|
||||
color: #FF75B5;
|
||||
}
|
||||
.cm-s-panda-syntax .cm-variable {
|
||||
color: #ffb86c;
|
||||
}
|
||||
.cm-s-panda-syntax .cm-variable-2 {
|
||||
color: #ff9ac1;
|
||||
}
|
||||
.cm-s-panda-syntax .cm-variable-3 {
|
||||
color: #ff9ac1;
|
||||
}
|
||||
|
||||
.cm-s-panda-syntax .cm-def {
|
||||
color: #e6e6e6;
|
||||
}
|
||||
.cm-s-panda-syntax .cm-property {
|
||||
color: #f3f3f3;
|
||||
}
|
||||
.cm-s-panda-syntax .cm-unit {
|
||||
color: #ffb86c;
|
||||
}
|
||||
|
||||
.cm-s-panda-syntax .cm-attribute {
|
||||
color: #ffb86c;
|
||||
}
|
||||
|
||||
.cm-s-panda-syntax .CodeMirror-matchingbracket {
|
||||
border-bottom: 1px dotted #19F9D8;
|
||||
padding-bottom: 2px;
|
||||
color: #e6e6e6;
|
||||
}
|
||||
.cm-s-panda-syntax .CodeMirror-gutters {
|
||||
background: #292a2b;
|
||||
border-right-color: rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
.cm-s-panda-syntax .CodeMirror-linenumber {
|
||||
color: #e6e6e6;
|
||||
opacity: 0.6;
|
||||
}
|
||||
1
CodeMirror/theme/pastel-on-dark.css
vendored
@@ -11,7 +11,6 @@
|
||||
background: #2c2827;
|
||||
color: #8F938F;
|
||||
line-height: 1.5;
|
||||
font-size: 14px;
|
||||
}
|
||||
.cm-s-pastel-on-dark div.CodeMirror-selected { background: rgba(221,240,255,0.2); }
|
||||
.cm-s-pastel-on-dark .CodeMirror-line::selection, .cm-s-pastel-on-dark .CodeMirror-line > span::selection, .cm-s-pastel-on-dark .CodeMirror-line > span > span::selection { background: rgba(221,240,255,0.2); }
|
||||
|
||||
36
CodeMirror/theme/solarized.css
vendored
@@ -4,7 +4,7 @@ http://ethanschoonover.com/solarized
|
||||
*/
|
||||
|
||||
/*
|
||||
Solarized color pallet
|
||||
Solarized color palette
|
||||
http://ethanschoonover.com/solarized/img/solarized-palette.png
|
||||
*/
|
||||
|
||||
@@ -34,7 +34,7 @@ http://ethanschoonover.com/solarized/img/solarized-palette.png
|
||||
}
|
||||
.cm-s-solarized.cm-s-dark {
|
||||
color: #839496;
|
||||
background-color: #002b36;
|
||||
background-color: #002b36;
|
||||
text-shadow: #002b36 0 1px;
|
||||
}
|
||||
.cm-s-solarized.cm-s-light {
|
||||
@@ -113,32 +113,34 @@ http://ethanschoonover.com/solarized/img/solarized-palette.png
|
||||
box-shadow: inset 7px 0 12px -6px #000;
|
||||
}
|
||||
|
||||
/* Gutter border and some shadow from it */
|
||||
/* Remove gutter border */
|
||||
.cm-s-solarized .CodeMirror-gutters {
|
||||
border-right: 1px solid;
|
||||
border-right: 0;
|
||||
}
|
||||
|
||||
/* Gutter colors and line number styling based of color scheme (dark / light) */
|
||||
|
||||
/* Dark */
|
||||
.cm-s-solarized.cm-s-dark .CodeMirror-gutters {
|
||||
background-color: #002b36;
|
||||
border-color: #00232c;
|
||||
background-color: #073642;
|
||||
}
|
||||
|
||||
.cm-s-solarized.cm-s-dark .CodeMirror-linenumber {
|
||||
color: #586e75;
|
||||
text-shadow: #021014 0 -1px;
|
||||
}
|
||||
|
||||
/* Light */
|
||||
.cm-s-solarized.cm-s-light .CodeMirror-gutters {
|
||||
background-color: #fdf6e3;
|
||||
border-color: #eee8d5;
|
||||
background-color: #eee8d5;
|
||||
}
|
||||
|
||||
.cm-s-solarized.cm-s-light .CodeMirror-linenumber {
|
||||
color: #839496;
|
||||
}
|
||||
|
||||
/* Common */
|
||||
.cm-s-solarized .CodeMirror-linenumber {
|
||||
color: #586e75;
|
||||
padding: 0 5px;
|
||||
}
|
||||
.cm-s-solarized .CodeMirror-guttermarker-subtle { color: #586e75; }
|
||||
@@ -149,15 +151,19 @@ http://ethanschoonover.com/solarized/img/solarized-palette.png
|
||||
color: #586e75;
|
||||
}
|
||||
|
||||
/* Cursor */
|
||||
.cm-s-solarized .CodeMirror-cursor { border-left: 1px solid #819090; }
|
||||
|
||||
/*
|
||||
Active line. Negative margin compensates left padding of the text in the
|
||||
view-port
|
||||
*/
|
||||
/* Fat cursor */
|
||||
.cm-s-solarized.cm-s-light.cm-fat-cursor .CodeMirror-cursor { background: #77ee77; }
|
||||
.cm-s-solarized.cm-s-light .cm-animate-fat-cursor { background-color: #77ee77; }
|
||||
.cm-s-solarized.cm-s-dark.cm-fat-cursor .CodeMirror-cursor { background: #586e75; }
|
||||
.cm-s-solarized.cm-s-dark .cm-animate-fat-cursor { background-color: #586e75; }
|
||||
|
||||
/* Active line */
|
||||
.cm-s-solarized.cm-s-dark .CodeMirror-activeline-background {
|
||||
background: rgba(255, 255, 255, 0.10);
|
||||
background: rgba(255, 255, 255, 0.06);
|
||||
}
|
||||
.cm-s-solarized.cm-s-light .CodeMirror-activeline-background {
|
||||
background: rgba(0, 0, 0, 0.10);
|
||||
background: rgba(0, 0, 0, 0.06);
|
||||
}
|
||||
|
||||
10
LICENSE.md
@@ -1,10 +1,12 @@
|
||||
Copyright: © 2015 ICEcoder Ltd
|
||||
Copyright: © 2015 ICEcoder Ltd
|
||||
Website: icecoder.net
|
||||
Email: info@icecoder.net
|
||||
Twitter: @icecoder
|
||||
|
||||
#ICEcoder License
|
||||
##Standard Open Source Initiative MIT License
|
||||
# ICEcoder License
|
||||
|
||||
## Standard Open Source Initiative MIT License
|
||||
|
||||
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
|
||||
@@ -27,4 +29,4 @@ THE SOFTWARE.
|
||||
Please note that this LICENSE file covers the ICEcoder shell IDE only and 3rd
|
||||
party code, in subfolders such as CodeMirror and plugins, may contain their
|
||||
own LICENSE files, and may not also be an MIT licence.
|
||||
```
|
||||
```
|
||||
|
||||
79
README.md
@@ -1,37 +1,42 @@
|
||||
#ICEcoder
|
||||
##Web IDE / browser code editor awesomeness
|
||||
|
||||
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="https://icecoder.net/images/icecoder-v6-0-beta-browser-code-editor.png" alt="ICEcoder web IDE">
|
||||
|
||||
###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).
|
||||
|
||||
###Installation
|
||||
|
||||
####Step 1: Get ICEcoder
|
||||
Either download the zip or clone from Github using:
|
||||
|
||||
```
|
||||
$ git clone git://github.com/mattpass/ICEcoder
|
||||
```
|
||||
|
||||
####Step 2: Place in your document root (online or local)
|
||||
* Put in a new sub-dir URL such as yourdomain.com/ICEcoder or localhost/ICEcoder
|
||||
* Set write permissions (757 or 775 depending on your system) on the 'backups', 'lib', 'plugins', 'test' and 'tmp' folders
|
||||
|
||||
*(Note: A small number of web servers give an internal server error here, if you get this, try 755 instead)*
|
||||
|
||||
####Step 3: Start coding
|
||||
* Visit the sub-dir URL in your browser and enter a password
|
||||
|
||||
**Now you're setup, auto-logged in and ready to code!**
|
||||
|
||||
Suitable for commercial & non-commercial projects, just let me know if it's useful to you and any cool customisations you make to it. I take no responsibility for anything, your usage is all down to you.
|
||||
|
||||
It's fully open source and MIT licensed. I'm happy for you to take it, make it your own and customise to your hearts content and/or contribute to this main repo! :)
|
||||
|
||||
Plenty of comments included in the code to assist with understanding, customising etc.
|
||||
|
||||
Comments, improvements & feedback welcomed!
|
||||
# ICEcoder
|
||||
|
||||
## Web IDE / browser code editor awesomeness
|
||||
|
||||
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="https://icecoder.net/images/icecoder-v7-0-browser-code-editor.png" alt="ICEcoder web IDE">
|
||||
|
||||
### 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).
|
||||
|
||||
### Installation
|
||||
|
||||
#### Step 1: Get ICEcoder
|
||||
|
||||
Either download the zip or clone from Github using:
|
||||
|
||||
```
|
||||
$ git clone git://github.com/mattpass/ICEcoder
|
||||
```
|
||||
|
||||
#### Step 2: Place in your document root (online or local)
|
||||
|
||||
* Put in a new sub-dir URL such as yourdomain.com/ICEcoder or localhost/ICEcoder
|
||||
* Set write permissions (757 or 775 depending on your system) on the 'backups', 'lib', 'plugins', 'test' and 'tmp' folders
|
||||
|
||||
*(Note: A small number of web servers give an internal server error here, if you get this, try 755 instead)*
|
||||
|
||||
#### Step 3: Start coding
|
||||
|
||||
* Visit the sub-dir URL in your browser and enter a password
|
||||
|
||||
**Now you're setup, auto-logged in and ready to code!**
|
||||
|
||||
Suitable for commercial & non-commercial projects, just let me know if it's useful to you and any cool customisations you make to it. I take no responsibility for anything, your usage is all down to you.
|
||||
|
||||
It's fully open source and MIT licensed. I'm happy for you to take it, make it your own and customise to your hearts content and/or contribute to this main repo! :)
|
||||
|
||||
Plenty of comments included in the code to assist with understanding, customising etc.
|
||||
|
||||
Comments, improvements & feedback welcomed!
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
<?php
|
||||
header("Location: ../");
|
||||
die();
|
||||
?>
|
||||
1
data/.gitkeep
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
33
editor.php
@@ -5,7 +5,7 @@ $t = $text['editor'];
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html style="margin: 0" onMouseDown="top.ICEcoder.mouseDown=true; top.ICEcoder.resetAutoLogoutTimer()" onMouseUp="top.ICEcoder.mouseDown=false; top.ICEcoder.mouseDownInCM=false; top.ICEcoder.resetAutoLogoutTimer(); if (!top.ICEcoder.overCloseLink) {top.ICEcoder.tabDragEnd()}" onMouseMove="if(top.ICEcoder) {top.ICEcoder.getMouseXY(event,'editor'); top.ICEcoder.resetAutoLogoutTimer(); top.ICEcoder.canResizeFilesW()}" onDrop="if(top.ICEcoder) {top.ICEcoder.getMouseXY(event,'editor')}">
|
||||
<html style="margin: 0" onMouseDown="top.ICEcoder.mouseDown=true; top.ICEcoder.resetAutoLogoutTimer()" onMouseUp="top.ICEcoder.mouseDown=false; top.ICEcoder.mouseDownInCM=false; top.ICEcoder.resetAutoLogoutTimer(); if (!top.ICEcoder.overCloseLink) {top.ICEcoder.tabDragEnd()}" onMouseMove="if(top.ICEcoder) {top.ICEcoder.getMouseXY(event,'editor'); top.ICEcoder.functionClassParamsTooltip(event, 'editor'); top.ICEcoder.resetAutoLogoutTimer(); top.ICEcoder.canResizeFilesW()}" onDrop="if(top.ICEcoder) {top.ICEcoder.getMouseXY(event,'editor')}">
|
||||
<head>
|
||||
<title>ICEcoder v <?php echo $ICEcoder["versionNo"];?> editor</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
@@ -57,7 +57,7 @@ if (array_search($ICEcoder["theme"],array("3024-day","base16-light","eclipse","e
|
||||
|
||||
<style type="text/css">
|
||||
/* Make sure this next one remains the 1st item, updated with JS */
|
||||
.CodeMirror {position: absolute; top: 0; width: 100%; font-size: <?php echo $ICEcoder["fontSize"];?>; line-height: 1.3; z-index: 1}
|
||||
.CodeMirror {position: absolute; top: 0; width: 100%; font-size: <?php echo $ICEcoder["fontSize"];?>; transition: font-size 0.25s ease; line-height: 1.3; z-index: 1}
|
||||
.CodeMirror-scroll {} /* was: height: auto; overflow: visible */
|
||||
/* Make sure this next one remains the 3rd item, updated with JS */
|
||||
.cm-s-activeLine {background: <?php echo $activeLineBG;?> !important}
|
||||
@@ -69,6 +69,7 @@ if (array_search($ICEcoder["theme"],array("3024-day","base16-light","eclipse","e
|
||||
background-position: bottom left;
|
||||
background-repeat: repeat-x;
|
||||
}
|
||||
.code-zoomed-out { font-size: 2px }
|
||||
.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;
|
||||
}
|
||||
@@ -87,18 +88,12 @@ h2 {color: rgba(0,198,255,0.7)}
|
||||
.diffGreyLighter {background: #888 !important; color: #1d1d1b !important}
|
||||
.diffNone {}
|
||||
.info {font-size: 10px; color: rgba(0,198,255,0.7); cursor: help}
|
||||
.trialBarContainer {display: inline-block; width: 170px; height: 8px; background: #0b0b0b; margin-bottom: 40px}
|
||||
.trialBarRemaining {display: inline-block; width: 170px; height: 8px; background: rgba(0,198,255,0.7); box-shadow: 0 0 10px 1px rgba(0,198,255,0.5);
|
||||
transition: width 0.7s ease-in-out;
|
||||
}
|
||||
.trialBarText {margin-top: 6px; color: #888}
|
||||
.trialBarText a {color: #fff; text-decoration: none}
|
||||
</style>
|
||||
<link rel="stylesheet" href="lib/file-types.css?microtime=<?php echo microtime(true);?>">
|
||||
<link rel="stylesheet" href="lib/file-type-icons.css?microtime=<?php echo microtime(true);?>">
|
||||
</head>
|
||||
|
||||
<body style="color: #fff; margin: 0" onKeyDown="return top.ICEcoder.interceptKeys('content', event);" onKeyUp="top.ICEcoder.resetKeys(event);" onBlur="parent.ICEcoder.resetKeys(event);" onload="if (document.getElementById('trialBarRemaining')) {setTimeout(function(){document.getElementById('trialBarRemaining').style.width = '<?php echo $tRemainingPerc*170;?>px';},150)}">
|
||||
<body style="color: #fff; margin: 0" onKeyDown="return top.ICEcoder.interceptKeys('content', event);" onKeyUp="top.ICEcoder.resetKeys(event);" onBlur="parent.ICEcoder.resetKeys(event);" oncontextmenu="return false">
|
||||
|
||||
<div style="display: none; margin: 32px 43px 0 43px; padding: 10px; width: 500px; font-family: arial; font-size: 10px; color: #ddd; background: #333" id="dataMessage"></div>
|
||||
|
||||
@@ -123,15 +118,6 @@ h2 {color: rgba(0,198,255,0.7)}
|
||||
</div>
|
||||
|
||||
<div style="float: left">
|
||||
<?php
|
||||
// No valid license code - show the trial remaining bar
|
||||
if (generateHash(strClean($ICEcoder['licenseEmail']),$ICEcoder['licenseCode'])!=$ICEcoder['licenseCode']) {?>
|
||||
<h2><?php echo $t['trial remaining'];?></h2>
|
||||
<div class="trialBarContainer"><div class="trialBarRemaining" id="trialBarRemaining"></div><br>
|
||||
<div class="trialBarText"><?php echo $tDaysRemaining;?> <?php echo $t['days left'];?> - <a href="lib/login.php?get=code&csrf=<?php echo $_SESSION["csrf"];?>" target="_parent">Unlock now</a></div>
|
||||
</div>
|
||||
<?php ;}; ?>
|
||||
|
||||
<h2><?php echo $t['files'];?></h2>
|
||||
<span class="heading"><?php echo $t['Last 10 files...'];?></span><br>
|
||||
<ul class="fileManager" id="last10Files" style="margin-left: 0; line-height: 20px"><?php
|
||||
@@ -199,6 +185,7 @@ CodeMirror.keyMap.ICEcoder = {
|
||||
"Ctrl-Space": "autocomplete",
|
||||
"Ctrl-Up" : false,
|
||||
"Ctrl-Down" : false,
|
||||
"Ctrl-Backspace" : false,
|
||||
"Esc" : false,
|
||||
fallthrough: ["default"]
|
||||
};
|
||||
@@ -297,8 +284,12 @@ function createNewCMInstance(num) {
|
||||
window['cM'+num+'diff'] .on("gutterClick", function(thisCM,line,gutter,evt) {top.ICEcoder.cMonGutterClick(thisCM,line,gutter,evt,'cM'+num+'diff')});
|
||||
|
||||
// Mouse Down
|
||||
window['cM'+num] .on("mousedown", function(thisCM) {top.ICEcoder.cMonMouseDown(thisCM,'cM'+num)});
|
||||
window['cM'+num+'diff'] .on("mousedown", function(thisCM) {top.ICEcoder.cMonMouseDown(thisCM,'cM'+num+'diff')});
|
||||
window['cM'+num] .on("mousedown", function(thisCM,evt) {top.ICEcoder.cMonMouseDown(thisCM,'cM'+num,evt)});
|
||||
window['cM'+num+'diff'] .on("mousedown", function(thisCM,evt) {top.ICEcoder.cMonMouseDown(thisCM,'cM'+num+'diff',evt)});
|
||||
|
||||
// Context Menu
|
||||
window['cM'+num] .on("contextmenu", function(thisCM,evt) {top.ICEcoder.cMonContextMenu(thisCM,'cM'+num,evt)});
|
||||
window['cM'+num+'diff'] .on("contextmenu", function(thisCM,evt) {top.ICEcoder.cMonContextMenu(thisCM,'cM'+num+'diff',evt)});
|
||||
|
||||
// Drag Over
|
||||
window['cM'+num] .on("dragover", function(thisCM) {top.ICEcoder.cMonDragOver(thisCM,event,'cM'+num)});
|
||||
@@ -316,6 +307,8 @@ function createNewCMInstance(num) {
|
||||
|
||||
<div style="position: absolute; display: none; width: 5px; height: 100%; top: 0; right: 0; background: rgba(255,255,255,0.1); overflow: hidden; z-index: 2" id="resultsBar"></div>
|
||||
|
||||
<div style="position: absolute; display: none; height: 100%; width: 100%; top: 0; padding: 3px 0 0 60px; line-height: 16px; font-family: monospace; font-size: 13px; z-index: 2147483647" id="game"></div>
|
||||
|
||||
<?php include_once("processes/on-editor-load.php"); ?>
|
||||
|
||||
</body>
|
||||
|
||||
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 15 KiB |
BIN
images/snake.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 136 B |
23
index.php
@@ -304,28 +304,37 @@ $t = $text['index'];
|
||||
</div>
|
||||
<input type="hidden" name="csrf" value="<?php echo $_SESSION["csrf"]; ?>">
|
||||
</form>
|
||||
<form onSubmit="return ICEcoder.goToLine()">
|
||||
<form onSubmit="return ICEcoder.goToLine(top.get('goToLineNo').value, 0, false)">
|
||||
<div class="codeAssist" title="<?php echo $t['Turn on/off...'];?>">
|
||||
<input type="checkbox" name="codeAssist" id="codeAssist" class="codeAssistCheckbox" <?php if ($ICEcoder['codeAssist']) {echo 'checked ';};?>>
|
||||
<span class="codeAssistDisplay" id="codeAssistDisplay" style="background-position: <?php echo $ICEcoder['codeAssist'] ? "0" : "-16";?> 0" onClick="top.ICEcoder.codeAssistToggle()"></span> <?php echo $t['Code Assist'];?>
|
||||
</div>
|
||||
<div class="goLine"><?php echo $t['Go to Line'];?> <input type="text" name="goToLine" value="" id="goToLineNo" class="textbox goToLine">
|
||||
<div class="goLine"><?php echo $t['Go to Line'];?> <input type="text" name="goToLine" value="" id="goToLineNo" onkeyup="ICEcoder.goToLine(this.value, 0, true)" class="textbox goToLine">
|
||||
<div class="view" title="<?php echo $t['View'];?>" onClick="top.ICEcoder.openPreviewWindow()" id="fMView"></div>
|
||||
<div class="bug" title="<?php echo $t['Bug reporting not active'];?>" onClick="top.ICEcoder.openBugReport()" id="bugIcon"></div>
|
||||
<div class="minimapLink" onclick="top.ICEcoder.docExplorerShow('miniMap')"></div>
|
||||
<div class="functionClassListLink" onclick="top.ICEcoder.docExplorerShow('functionClassList')"></div>
|
||||
<div class="terminalLink" onclick="top.ICEcoder.docExplorerShow('terminal')"></div>
|
||||
<input type="hidden" name="csrf" value="<?php echo $_SESSION["csrf"]; ?>">
|
||||
</form>
|
||||
</div>
|
||||
<iframe name="terminalFrame" id="terminal" src="terminal.php" frameborder="0" style="position: fixed; display: none; top: 0; z-index: 2"></iframe>
|
||||
<iframe name="terminalFrame" id="terminal" src="terminal.php" class="terminal"></iframe>
|
||||
<pre id="output" class="output"><b>Output</b><br>via top.ICEcoder.output(message);<br><br></pre>
|
||||
<iframe name="databaseFrame" id="database" src="lib/database.php" class="database"></iframe>
|
||||
<div id="git" class="git">Git diff integration coming soon</div>
|
||||
<iframe name="contentFrame" id="content" src="editor.php" class="code" scrolling="no"></iframe>
|
||||
</div>
|
||||
|
||||
<div class="tools" id="tools">
|
||||
<div onclick="top.ICEcoder.toolShowHideToggle('terminal')">Terminal</div>
|
||||
<div onclick="top.ICEcoder.toolShowHideToggle('output')">Output</div>
|
||||
<div onclick="top.ICEcoder.toolShowHideToggle('database')">Database</div>
|
||||
<div onclick="top.ICEcoder.toolShowHideToggle('git')">Git</div>
|
||||
</div>
|
||||
|
||||
<div class="footer" id="footer" onContextMenu="return false">
|
||||
<div class="nesting" id="nestValid"></div>
|
||||
<div class="versionsDisplay" id="versionsDisplay" onclick="top.ICEcoder.versionsScreen(top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1].replace(/\//g,'|'))"></div>
|
||||
<div class="splitPaneControls" id="splitPaneControls"><div class="off" id="splitPaneControlsOff" title="<?php echo $t['Single pane'];?>" onclick="top.ICEcoder.setSplitPane('off')"></div><div class="on" id="splitPaneControlsOn" title="<?php echo $t['Diff pane also'];?>" onclick="top.ICEcoder.setSplitPane('on')" style="opacity: 0.5"></div></div>
|
||||
<div class="splitPaneControls" id="splitPaneControls"><div class="off" id="splitPaneControlsOff" title="<?php echo $t['Single pane'];?>" onclick="top.ICEcoder.setSplitPane('off')" style="opacity: 0.5"></div><div class="on" id="splitPaneControlsOn" title="<?php echo $t['Diff pane also'];?>" onclick="top.ICEcoder.setSplitPane('on')" style="opacity: 0.2"></div></div>
|
||||
<div class="splitPaneNames" id="splitPaneNamesMain">Main Pane</div>
|
||||
<div class="splitPaneNames" id="splitPaneNamesDiff">Diff Pane</div>
|
||||
<div class="byteDisplay" id="byteDisplay" style="display: none" onClick="top.ICEcoder.showDisplay('char')"></div>
|
||||
@@ -337,6 +346,8 @@ $t = $text['index'];
|
||||
<div class="functionClassList" id="functionClassList"></div>
|
||||
</div>
|
||||
|
||||
<div id="tooltip" style="position: absolute; display: none; top: 0; left: 0; padding: 5px; background: #444; color: #bbb"></div>
|
||||
|
||||
<script>
|
||||
ICEcoder.initAliases();
|
||||
ICEcoder.setLayout('dontSetEditor');
|
||||
@@ -344,4 +355,4 @@ ICEcoder.setLayout('dontSetEditor');
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
||||
|
||||
@@ -424,4 +424,3 @@ $text = array(
|
||||
)
|
||||
|
||||
);
|
||||
?>
|
||||
@@ -424,4 +424,3 @@ $text = array(
|
||||
)
|
||||
|
||||
);
|
||||
?>
|
||||
@@ -21,8 +21,6 @@ $text = array(
|
||||
"your device" => "Uw apparaat",
|
||||
"Browser" => "Browser:",
|
||||
"Your IP" => "Uw IP:",
|
||||
"trial remaining" => "Resterende demo tijd",
|
||||
"days left" => "dagen",
|
||||
"files" => "bestanden",
|
||||
"Last 10 files..." => "Laatste 10 geopende bestanden:",
|
||||
"none" => "[none]",
|
||||
@@ -489,4 +487,4 @@ $text = array(
|
||||
"Search" => "Zoek",
|
||||
)
|
||||
);
|
||||
?>
|
||||
|
||||
|
||||
1045
lang/english.php
@@ -243,6 +243,10 @@ dans lib/config__settings.php",
|
||||
"ice-coder" =>
|
||||
array(
|
||||
"No text selected..." => "Aucun texte sélectionné pour la recherche sur",
|
||||
"all files" => "tous les fichiers",
|
||||
"all filenames" => "tous les noms de fichiers",
|
||||
"selected files" => "fichiers sélectionnés",
|
||||
"selected filenames" => "les nomes de fichiers sélectionnés",
|
||||
"Creating Folder" => "réation de dossier",
|
||||
"Sorry you can..." => "Désolé, vous ne pouvez pas avoir plus de 100 fichiers ouverts en même temps !",
|
||||
"Opening File" => "Ouverture de fichier",
|
||||
@@ -255,6 +259,11 @@ dans lib/config__settings.php",
|
||||
"Pasting File" => "Collage fichier",
|
||||
"Sorry cannot paste..." => "Désolé, il n'est pas possible de coller une racine",
|
||||
"Nothing to paste..." => "Rien à coller, copiez un fichier/dossier en premier !",
|
||||
"and" => "et",
|
||||
"this document" => "ce document",
|
||||
"replace" => "remplacer",
|
||||
"replace all" => "tout remplacer",
|
||||
"file" => "fichier",
|
||||
"Replacing text in" => "Remplacement de texte dans",
|
||||
"Cancelled tasks" => "Tâches annulés",
|
||||
"Open previous files" => "Ouvrir les fichiers précédents ?",
|
||||
@@ -265,7 +274,8 @@ dans lib/config__settings.php",
|
||||
"Error cannot find..." => "Erreur : ne peut pas trouver / accéder aux chemins des fichiers d'erreur",
|
||||
"No new errors..." => "Aucune nouvelle erreur trouvée",
|
||||
"You have made..." => "Vous avez réalisé des modifications. Etes vous sûr(e) de désirer quitter sans sauvegarder ?",
|
||||
"Close all tabs" => "Fermer tous les onglets?"
|
||||
"Close all tabs" => "Fermer tous les onglets?",
|
||||
"results" => "résultats"
|
||||
),
|
||||
|
||||
"login" =>
|
||||
@@ -369,7 +379,7 @@ dans lib/config__settings.php",
|
||||
"visible tabs" => "onglets visibles",
|
||||
"locked nav" => "navigation vérouillée",
|
||||
"tag wrapper command" => "commande de tag",
|
||||
"auto-complete on" => "auto-complétion sur",
|
||||
"auto-complete on" => "auto-complétion sur",
|
||||
"security" => "sécurité",
|
||||
"new password" => "nouveau mot de passe",
|
||||
"8 chars min" => "8 caractères minimum",
|
||||
@@ -422,4 +432,3 @@ dans lib/config__settings.php",
|
||||
)
|
||||
|
||||
);
|
||||
?>
|
||||
@@ -395,4 +395,4 @@ $text = array(
|
||||
)
|
||||
|
||||
);
|
||||
?>
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php
|
||||
// Italian language translation
|
||||
// by: @pietrondo (GitHub)
|
||||
// @pietrobravo (Twitter)
|
||||
@@ -24,8 +24,6 @@ $text = array(
|
||||
"Last 10 files..." => "Ultimi 10 file aperti:",
|
||||
"none" => "[none]",
|
||||
"test suite" => "prova suite",
|
||||
"trial remaining" => "tempo rimanente alla fine del periodo di prova",
|
||||
"days left" => "giorni rimanenti",
|
||||
"Run unit tests" => "Esegui test di unità",
|
||||
"dev mode" => "modalità sviluppo",
|
||||
"Status" => "Stato",
|
||||
@@ -454,4 +452,4 @@ Inserisci maschere separate da punto e virgola i dei file da cercare (e.s. *.php
|
||||
)
|
||||
|
||||
);
|
||||
?>
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ $text = array(
|
||||
|
||||
"editor" =>
|
||||
array(
|
||||
"Click icons for..." => "<b>Klikk på ikoner<br>for hjelp &<br>bruk av info</b>",
|
||||
"Click icons for..." => "<b>Klikk på ikoner<br>for hjelp &<br>bruk av info</b>",
|
||||
"server" => "server",
|
||||
"Server name, OS..." => "Server navn, OS & IP:",
|
||||
"Root" => "Root:",
|
||||
@@ -22,14 +22,14 @@ $text = array(
|
||||
"Browser" => "Nettleser:",
|
||||
"Your IP" => "Din IP:",
|
||||
"files" => "filer",
|
||||
"Last 10 files..." => "Siste 10 åpne filer:",
|
||||
"Last 10 files..." => "Siste 10 åpne filer:",
|
||||
"none" => "[none]",
|
||||
"test suite" => "test suite",
|
||||
"Run unit tests" => "Kjør unit tests",
|
||||
"Run unit tests" => "Kjør unit tests",
|
||||
"dev mode" => "utvikler modus",
|
||||
"Status" => "Status",
|
||||
"Using" => "Brukes",
|
||||
"You can switch..." => "Du kan slå utvikler modus på/av i lib/config__settings.php",
|
||||
"You can switch..." => "Du kan slå utvikler modus på/av i lib/config__settings.php",
|
||||
"results" => "resultater"
|
||||
|
||||
),
|
||||
@@ -45,9 +45,9 @@ $text = array(
|
||||
"index" =>
|
||||
array(
|
||||
"UPDATE INFO" => "UPDATE INFO",
|
||||
"now available" => "Nå tilgjengelig",
|
||||
"now available" => "Nå tilgjengelig",
|
||||
"Your version is" => "Din versjon er",
|
||||
"Update now" => "Oppdater nå",
|
||||
"Update now" => "Oppdater nå",
|
||||
"You have some..." => "Du har noe ulagrede endringer",
|
||||
"Are you sure you want to close?" => "Are you sure you want to close?",
|
||||
"working" => "arbeider",
|
||||
@@ -56,7 +56,7 @@ $text = array(
|
||||
"New Folder" => "Ny Mappe",
|
||||
"Upload File(s)" => "Last opp Fil(er)",
|
||||
"Paste" => "Lim inn",
|
||||
"Open" => "Åpne",
|
||||
"Open" => "Åpne",
|
||||
"Copy" => "Kopier",
|
||||
"Duplicate" => "Duplikat",
|
||||
"Delete" => "Slett",
|
||||
@@ -70,7 +70,7 @@ $text = array(
|
||||
"Help" => "Hjelp",
|
||||
"Save" => "Lagre",
|
||||
"Save As" => "Lagre Som",
|
||||
"Live Preview" => "Direkte Forhåndsvisning",
|
||||
"Live Preview" => "Direkte Forhåndsvisning",
|
||||
"Upload" => "Last opp",
|
||||
"Zip" => "Zip",
|
||||
"Print" => "Skriv ut",
|
||||
@@ -78,7 +78,7 @@ $text = array(
|
||||
"Logout" => "Loggut",
|
||||
"Undo" => "Angre",
|
||||
"Redo" => "Gjenta",
|
||||
"Indent more" => "Større innrykk",
|
||||
"Indent more" => "Større innrykk",
|
||||
"Indent less" => "Mindre innrykk",
|
||||
"Autocomplete" => "Autokomplettere",
|
||||
"Comment/Uncomment" => "Kommentar/Fjern Kommentar",
|
||||
@@ -86,7 +86,7 @@ $text = array(
|
||||
"Manual" => "Manual",
|
||||
"Shortcuts" => "Snarveier",
|
||||
"Settings" => "Innstillinger",
|
||||
"Search for selected" => "Søk for utvalgte",
|
||||
"Search for selected" => "Søk for utvalgte",
|
||||
"website" => "webside",
|
||||
"Close all tabs" => "Lukk alle faner",
|
||||
"Alphabetize tabs" => "Ordne faner alfabetisk",
|
||||
@@ -96,12 +96,12 @@ $text = array(
|
||||
"replace" => "erstatt",
|
||||
"replace all" => "erstatt alt",
|
||||
"this document" => "dette dokumentet",
|
||||
"open documents" => "åpne dokumenter",
|
||||
"open documents" => "åpne dokumenter",
|
||||
"all files" => "alle filer",
|
||||
"all filenames" => "alle filenavn",
|
||||
"Turn on/off..." => "Svitsj på/av kode assistenten",
|
||||
"Turn on/off..." => "Svitsj på/av kode assistenten",
|
||||
"Code Assist" => "Kode Assistenten",
|
||||
"Go to Line" => "Gå til Linje",
|
||||
"Go to Line" => "Gå til Linje",
|
||||
"View" => "Vis",
|
||||
"Bug reporting not active" => "Bug rapportering ikke aktiv"
|
||||
),
|
||||
@@ -116,75 +116,75 @@ $text = array(
|
||||
"file-control" =>
|
||||
array(
|
||||
"Sorry" => "Beklager",
|
||||
"does not seem..." => "synes ikke å eksistere på serveren",
|
||||
"Sorry, could not..." => "Beklager, kunne ikke få innholdet i",
|
||||
"Sorry, cannot create..." => "Beklager, kan ikke opprette mappe på",
|
||||
"does not seem..." => "synes ikke å eksistere på serveren",
|
||||
"Sorry, could not..." => "Beklager, kunne ikke få innholdet i",
|
||||
"Sorry, cannot create..." => "Beklager, kan ikke opprette mappe på",
|
||||
"Sorry, cannot copy" => "Beklager, kan ikke kopiere",
|
||||
"into" => "inn",
|
||||
"Uploaded file(s) OK" => "Opplastete fil(er) OK",
|
||||
"Sorry, cannot upload" => "Beklager, kan ikke laste opp",
|
||||
"Sorry, cannot upload..." => "Beklager, kan ikke laste opp i demo-modus",
|
||||
"Sorry, cannot rename" => "Beklager, kan ikke endre navn",
|
||||
"Maybe public write..." => "Kanskje det trengs offentlige skriverettigheter på denne, eller overordnede mappen?",
|
||||
"Maybe public write..." => "Kanskje det trengs offentlige skriverettigheter på denne, eller overordnede mappen?",
|
||||
"Sorry, cannot move" => "Beklager, kan ikke flytte",
|
||||
"Sorry, cannot save" => "Beklager, kan ikke lagre",
|
||||
"Sorry, cannot replace..." => "Beklager, kan ikke erstatte tekst i",
|
||||
"Sorry, cannot change..." => "Beklager, kan ikke endre tillatelser på",
|
||||
"Sorry, cannot delete..." => "Beklager, kan ikke slette rotnivå",
|
||||
"Sorry, cannot change..." => "Beklager, kan ikke endre tillatelser på",
|
||||
"Sorry, cannot delete..." => "Beklager, kan ikke slette rotnivå",
|
||||
"Sorry, cannot delete" => "Beklager, kan ikke slette",
|
||||
"Sorry, this file..." => "Beklager, denne filen er endret, kan ikke lagre",
|
||||
"Reload this file..." => "Skal denne filen lastes igjen og kopieres denne versjon til et nytt dokument?",
|
||||
"There was a..." => "Dette var en teknisk hikke, sannsynligvis var noe ikke helt klar. Så ICEcoder laster sin kontrollfil på nytt.",
|
||||
"displayed at" => "vises på",
|
||||
"Enter filename to..." => "Skriv inn filnavnet for å lagre på",
|
||||
"There was a..." => "Dette var en teknisk hikke, sannsynligvis var noe ikke helt klar. Så ICEcoder laster sin kontrollfil på nytt.",
|
||||
"displayed at" => "vises på",
|
||||
"Enter filename to..." => "Skriv inn filnavnet for å lagre på",
|
||||
"That file exists..." => "Denne filen eksisterer allerede, skriv over?",
|
||||
"Saving" => "Lagring"
|
||||
),
|
||||
|
||||
"get-branch" =>
|
||||
array(
|
||||
"There are no..." => "Det er ingen forskjeller mellom det lokale og GitHub lagringssted. Gå tilbake til vanlig modus?",
|
||||
"There are no..." => "Det er ingen forskjeller mellom det lokale og GitHub lagringssted. Gå tilbake til vanlig modus?",
|
||||
"Sorry, there was..." => "Beklager, det var en feil, kode:",
|
||||
"Your local folder..." => "Din lokale mappe er tom, ønsker du å klone"
|
||||
"Your local folder..." => "Din lokale mappe er tom, ønsker du å klone"
|
||||
),
|
||||
|
||||
"github-manager" =>
|
||||
array(
|
||||
"Sorry, cannot create..." => "Beklager, kan ikke opprette mappe på",
|
||||
"Sorry, cannot create..." => "Beklager, kan ikke opprette mappe på",
|
||||
"Cannot update config..." => "Kan ikke oppdatere konfigurasjonsfilen. Vennligst sett offentlige skriverettigheter",
|
||||
"and try again" => "og prøv igjen",
|
||||
"and try again" => "og prøv igjen",
|
||||
"saving github paths" => "lagre GitHub stier...",
|
||||
"github paths" => "github stier",
|
||||
"Choose existing path" => "Velg eksisterende sti",
|
||||
"Local path" => "Lokal sti",
|
||||
"Remote GitHub path" => "Ekstern GitHub sti",
|
||||
"Choose" => "Velg",
|
||||
"Set local and..." => "Sett lokal og ekstern sti til tomt, for å fjerne",
|
||||
"Set local and..." => "Sett lokal og ekstern sti til tomt, for å fjerne",
|
||||
"Update" => "Oppdater",
|
||||
"Add new path" => "Legg til ny sti",
|
||||
"Add" => "Legg til",
|
||||
"Usage Info" => "Bruksinfo:",
|
||||
"Enter relative local..." => "Oppgi relative lokale stier (f.e. /server/myfiles) og absolutte GitHub stier (f.e. https://github.com/user/repo eller https://github.com/user/repo/tree/branch for grener), som eksemplene. Med dette har du etablert kildestier på begge steder, som et par.",
|
||||
"Enter relative local..." => "Oppgi relative lokale stier (f.e. /server/myfiles) og absolutte GitHub stier (f.e. https://github.com/user/repo eller https://github.com/user/repo/tree/branch for grener), som eksemplene. Med dette har du etablert kildestier på begge steder, som et par.",
|
||||
"You can then..." => "Du kan deretter velge en stipar og dette blir da den nye rot stien i ICEcoder.",
|
||||
"The file manager..." => "Filbehandleren viser deretter et nytt GitHub-ikon, som du kan klikke på, for å utføre en sjekk og vise forskjell mellom de 2 kildene. Disse forskjellene kan da være påkrevd, og flyttes til den eksterne stien på GitHub eller klones til din lokale sti, for å synkronisere filene dine.",
|
||||
"If you want..." => "Hvis du ønsker å velge en annen root sti, kan dette gjøres i skjermbildet Innstillinger."
|
||||
"The file manager..." => "Filbehandleren viser deretter et nytt GitHub-ikon, som du kan klikke på, for å utføre en sjekk og vise forskjell mellom de 2 kildene. Disse forskjellene kan da være påkrevd, og flyttes til den eksterne stien på GitHub eller klones til din lokale sti, for å synkronisere filene dine.",
|
||||
"If you want..." => "Hvis du ønsker å velge en annen root sti, kan dette gjøres i skjermbildet Innstillinger."
|
||||
),
|
||||
|
||||
"github" =>
|
||||
array(
|
||||
"Sorry, you do..." => "Beklager, det ser ikke ut til å ha lastet inn OpenSSL på PHP instans, så https er ikke tilgjengelig. Dette er nødvendig for GitHub dataoverføring, du kan endre php.ini innstillingene, start serveren på nytt og prøv igjen"
|
||||
"Sorry, you do..." => "Beklager, det ser ikke ut til å ha lastet inn OpenSSL på PHP instans, så https er ikke tilgjengelig. Dette er nødvendig for GitHub dataoverføring, du kan endre php.ini innstillingene, start serveren på nytt og prøv igjen"
|
||||
),
|
||||
|
||||
"headers" =>
|
||||
array(
|
||||
"Bad CSRF token..." => "Bad CSRF token. Vennligst rapporter feilinfoen på https://github.com/mattpass/ICEcoder slik at det kan fikses."
|
||||
"Bad CSRF token..." => "Bad CSRF token. Vennligst rapporter feilinfoen på https://github.com/mattpass/ICEcoder slik at det kan fikses."
|
||||
),
|
||||
|
||||
"help" =>
|
||||
array(
|
||||
"shortcuts" => "snarveier",
|
||||
"Within document" => "Innenfor dokument",
|
||||
"On Tabs" => "På faner",
|
||||
"On Tabs" => "På faner",
|
||||
"Within file manager" => "Innenfor filbehandler",
|
||||
"Anywhere" => "Hvor som helst",
|
||||
"Space" => "Mellomrom",
|
||||
@@ -193,18 +193,18 @@ $text = array(
|
||||
"Left click" => "Venstre klikk",
|
||||
"Middle click" => "Middel klikk",
|
||||
"Double click tap..." => "Dobbel klikk / tap (mobil)",
|
||||
"Right click" => "Høyre klikk",
|
||||
"Right click" => "Høyre klikk",
|
||||
"Middle scrollwheel" => "Middel rullehjul",
|
||||
"Drag" => "Dra",
|
||||
"Autocomplete add snippet" => "Autofullfør/legg til kodebiten",
|
||||
"Autocomplete add snippet" => "Autofullfør/legg til kodebiten",
|
||||
"Multiple select" => "Flere valg",
|
||||
"Move line up" => "Flytt linje opp",
|
||||
"Move line down" => "Flytt linje ned",
|
||||
"Duplicate lines" => "Dupliser linje(r)",
|
||||
"Remove lines" => "Slett linje(r)",
|
||||
"Insert line before" => "Sett inn linje før",
|
||||
"Insert line before" => "Sett inn linje før",
|
||||
"Insert line after" => "Sett inn linje etter",
|
||||
"Search for selected" => "Søk etter valgt",
|
||||
"Search for selected" => "Søk etter valgt",
|
||||
"Jump to definition" => "Hopp til definisjon/hopp tilbake",
|
||||
"Comment uncomment" => "Kommentar/fjern kommentar",
|
||||
"Insert tab indent" => "Sett inn innrykk/valgt innrykk",
|
||||
@@ -221,8 +221,8 @@ $text = array(
|
||||
"End line with..." => "Avslutt linje med <br>",
|
||||
"Close tab" => "Lukk fane",
|
||||
"Select file folder" => "Velg fil/mappe",
|
||||
"Open file" => "Åpne fil",
|
||||
"Range select" => "Velg område",
|
||||
"Open file" => "Åpne fil",
|
||||
"Range select" => "Velg område",
|
||||
"Options for selected" => "Egenskaper for valgt",
|
||||
"Delete selected" => "Slett valgt",
|
||||
"Next previous tab" => "Neste/forige fane",
|
||||
@@ -230,43 +230,43 @@ $text = array(
|
||||
"Previous tab" => "Forige fane",
|
||||
"New tab" => "Ny fane",
|
||||
"Close current tab" => "Lukk gjeldende fane",
|
||||
"Open file prompt" => "Åpne fil prompt",
|
||||
"Open file prompt" => "Åpne fil prompt",
|
||||
"Find" => "Finn",
|
||||
"Focus on Go..." => "Fokus på Gå til linje inndata",
|
||||
"Focus on Go..." => "Fokus på Gå til linje inndata",
|
||||
"Save" => "Lagre",
|
||||
"Save as" => "Lagre som...",
|
||||
"View webpage" => "Vis webside",
|
||||
"Contract expand file..." => "Trekk sammen/utvid filbehandler",
|
||||
"Fold unfold current..." => "Brett/utfold gjeldende linje",
|
||||
"Refocus on document" => "Refokusere på dokument",
|
||||
"Refocus on document" => "Refokusere på dokument",
|
||||
"Cancel tasks" => "Avbryt oppgaver"
|
||||
),
|
||||
|
||||
"ice-coder" =>
|
||||
array(
|
||||
"No text selected..." => "Ingen tekst valgt til å søke på",
|
||||
"No text selected..." => "Ingen tekst valgt til å søke på",
|
||||
"Creating Folder" => "Lage mappe",
|
||||
"Sorry you can..." => "Beklager, du kan bare ha 100 filer åpne samtidig!",
|
||||
"Opening File" => "Åpner Fil",
|
||||
"Sorry you can..." => "Beklager, du kan bare ha 100 filer åpne samtidig!",
|
||||
"Opening File" => "Åpner Fil",
|
||||
"Enter relative file..." => "Oppgi den relative filstien (med prefiks /) eller ekstern URL",
|
||||
"Getting" => "Får",
|
||||
"Please enter the..." => "Skriv inn det nye navnet på",
|
||||
"Getting" => "Får",
|
||||
"Please enter the..." => "Skriv inn det nye navnet på",
|
||||
"Renaming to" => "Endre navn til",
|
||||
"Moving to" => "Flytt til",
|
||||
"Deleting File" => "Slett Fil",
|
||||
"Pasting File" => "Lim inn Fil",
|
||||
"Sorry cannot paste..." => "Beklager, kan ikke lime inn en hel rot mappe",
|
||||
"Nothing to paste..." => "Ingenting å lime inn, kopiere en fil/mappe først!",
|
||||
"Nothing to paste..." => "Ingenting å lime inn, kopiere en fil/mappe først!",
|
||||
"Replacing text in" => "Erstatte tekst i",
|
||||
"Cancelled tasks" => "Kansellerte oppgaver",
|
||||
"Open previous files" => "Åpne siste filer?",
|
||||
"Please enter your..." => "Skriv inn GitHub token (enten personlig tilgang token eller kunde/hemmelig par token). Se verktøytips ved siden av Github Auth Token på Hjelp-skjermbildet > Innstillinger for mer info",
|
||||
"Open previous files" => "Åpne siste filer?",
|
||||
"Please enter your..." => "Skriv inn GitHub token (enten personlig tilgang token eller kunde/hemmelig par token). Se verktøytips ved siden av Github Auth Token på Hjelp-skjermbildet > Innstillinger for mer info",
|
||||
"This will compare..." => "Det vil sammenlignes og vise en forskjell mellom din lokale mappe og lagringsstedet. OK?",
|
||||
"Please note for..." => "Vennligst merk: for at oppdatering skal fungere skikkelig, må du ha skrive/slette tilgang til alle ICEcoder kataloger og filer. Hvis du trenger å gjenopprette denne versjonen av ICEcoder av en eller annen grunn, vil du finne den i /tmp mappen. Klikk OK for å fortsette med en auto-oppdatering eller avbryt for å besøke ICEcoder området slik at du kan ta tak i zip-filen og oppdatere manuelt.",
|
||||
"Please note for..." => "Vennligst merk: for at oppdatering skal fungere skikkelig, må du ha skrive/slette tilgang til alle ICEcoder kataloger og filer. Hvis du trenger å gjenopprette denne versjonen av ICEcoder av en eller annen grunn, vil du finne den i /tmp mappen. Klikk OK for å fortsette med en auto-oppdatering eller avbryt for å besøke ICEcoder området slik at du kan ta tak i zip-filen og oppdatere manuelt.",
|
||||
"You can start..." => "Du kan starte feilrapportering i Hjelp > Innstillinger",
|
||||
"Error cannot find..." => "Feil: kan ikke finne/få tilgang til feil filstier",
|
||||
"Error cannot find..." => "Feil: kan ikke finne/få tilgang til feil filstier",
|
||||
"No new errors..." => "Ingen feil funnet",
|
||||
"You have made..." => "Du har gjort endringer. Er du sikker på, at du vil lukke uten å lagre?",
|
||||
"You have made..." => "Du har gjort endringer. Er du sikker på, at du vil lukke uten å lagre?",
|
||||
"Close all tabs" => "Lukk alle faner?"
|
||||
),
|
||||
|
||||
@@ -274,16 +274,16 @@ $text = array(
|
||||
array(
|
||||
"set password" => "sett passord",
|
||||
"login" => "logginn",
|
||||
"To disable registration..." => "Hvis du vil deaktivere registreringsmodus, åpne innstillingsmenyen eller åpne lib/config ___ settings.php og endre/aktiver Påmelding til 'false', deretter laste siden om igjen",
|
||||
"To disable registration..." => "Hvis du vil deaktivere registreringsmodus, åpne innstillingsmenyen eller åpne lib/config ___ settings.php og endre/aktiver Påmelding til 'false', deretter laste siden om igjen",
|
||||
"Registration mode enabled" => "Registreringsmodus aktivert",
|
||||
"auto-check for updates" => "auto-sjekk for oppdateringer",
|
||||
"To put into..." => "Å sette til flerbrukermodus, åpne innstillingsmenyen eller åpne lib/config ___ settings.php og endre flerbruker til 'true', deretter laste siden om igjen",
|
||||
"To put into..." => "Å sette til flerbrukermodus, åpne innstillingsmenyen eller åpne lib/config ___ settings.php og endre flerbruker til 'true', deretter laste siden om igjen",
|
||||
"multi-user" => "flerbruker"
|
||||
),
|
||||
|
||||
"multiple-results" =>
|
||||
array(
|
||||
"rename all" => "endre navn på alle",
|
||||
"rename all" => "endre navn på alle",
|
||||
"replace all" => "erstatte alle",
|
||||
"document" => "dokument",
|
||||
"Found" => "Funnet",
|
||||
@@ -301,28 +301,28 @@ $text = array(
|
||||
|
||||
"plugins-manager" =>
|
||||
array(
|
||||
"ICEcoder needs to..." => "ICEcoder må startes om igjen, for å gjøre programtillegget kjørbar. Start om igjen nå?",
|
||||
"ICEcoder needs to..." => "ICEcoder må startes om igjen, for å gjøre programtillegget kjørbar. Start om igjen nå?",
|
||||
"saving plugins" => "lagre programtillegg...",
|
||||
"Cannot update config..." => "Kan ikke oppdatere konfigurasjonsfilen. Vennligst sett offentlige skriverettigheter",
|
||||
"and try again" => "og prøv igjen",
|
||||
"and try again" => "og prøv igjen",
|
||||
"couldnt delete dir" => "kan ikke slette mappe",
|
||||
"couldnt delete file" => "kan ikke slette fil",
|
||||
"plugins" => "programtillegg",
|
||||
"Guide to writing..." => "Guide til skriving av programtillegg",
|
||||
"Manage Installed" => "Administrer installerte",
|
||||
"URL" => "URL",
|
||||
"Target" => "Mål",
|
||||
"Target" => "Mål",
|
||||
"Timer" => "Tidsur",
|
||||
"Update" => "Oppdater",
|
||||
"Install" => "Installer",
|
||||
"Uninstall" => "Avinstaller",
|
||||
"Reload after install..." => "Omstart etter installasjon nødvendig"
|
||||
"Reload after install..." => "Omstart etter installasjon nødvendig"
|
||||
),
|
||||
|
||||
"properties" =>
|
||||
array(
|
||||
"properties" => "egenskaper",
|
||||
"Size" => "Størrelse",
|
||||
"Size" => "Størrelse",
|
||||
"Modified" => "Endret",
|
||||
"Last access" => "Siste tilgang",
|
||||
"Type" => "Type",
|
||||
@@ -336,20 +336,20 @@ $text = array(
|
||||
"Public" => "Offentlig",
|
||||
"Read" => "Lese",
|
||||
"Write" => "Skrive",
|
||||
"Execute" => "Kjøre",
|
||||
"Execute" => "Kjøre",
|
||||
"Change to" => "Endre til",
|
||||
"update" => "oppdatere"
|
||||
),
|
||||
|
||||
"settings-common" =>
|
||||
array(
|
||||
"Your document does..." => "Dokumentet ser ikke ut til å være i UTF-8 koding, derfor har det blitt omgjort"
|
||||
"Your document does..." => "Dokumentet ser ikke ut til å være i UTF-8 koding, derfor har det blitt omgjort"
|
||||
),
|
||||
|
||||
"settings-save-current-files" =>
|
||||
array(
|
||||
"Cannot update config..." => "Kan ikke oppdatere konfigurasjonsfilen. Vennligst sett offentlige skriverettigheter",
|
||||
"and try again" => "og prøv igjen"
|
||||
"and try again" => "og prøv igjen"
|
||||
),
|
||||
|
||||
"settings-screen" =>
|
||||
@@ -361,17 +361,17 @@ $text = array(
|
||||
"codemirror dir" => "codemirror mappe",
|
||||
"codemirror version" => "codemirror versjon",
|
||||
"file manager root" => "filbehandler root",
|
||||
"Free to use..." => "Gratis å bruke den til eget formål, kommersielle eller ikke, bare gi meg beskjed om eventuelle kule bruk eller tilpasninger. :) <br>Ingen garanti eller erstatningsansvar aksepteres for noe som helst, det er ditt eget ansvar for all bruk.<br>Mange fantastiske mennesker og bedrifter har bidratt til å bygge ICEcoder og det er for mange å takke her. Vennligst se hele listen på",
|
||||
"Free to use..." => "Gratis å bruke den til eget formål, kommersielle eller ikke, bare gi meg beskjed om eventuelle kule bruk eller tilpasninger. :) <br>Ingen garanti eller erstatningsansvar aksepteres for noe som helst, det er ditt eget ansvar for all bruk.<br>Mange fantastiske mennesker og bedrifter har bidratt til å bygge ICEcoder og det er for mange å takke her. Vennligst se hele listen på",
|
||||
"functionality" => "funksjonalitet",
|
||||
"check for updates..." => "se etter oppdateringer ved start",
|
||||
"auto open last..." => "åpne automatisk siste filer ved innlogging",
|
||||
"when finding in..." => "når funnet blant filer, utelukke",
|
||||
"auto open last..." => "åpne automatisk siste filer ved innlogging",
|
||||
"when finding in..." => "når funnet blant filer, utelukke",
|
||||
"assisting" => "assistere",
|
||||
"code assist" => "code assistent",
|
||||
"visible tabs" => "synlige faner",
|
||||
"locked nav" => "låst navi",
|
||||
"locked nav" => "låst navi",
|
||||
"tag wrapper command" => "tag wrapper kommando",
|
||||
"auto-complete on" => "autokompletering på",
|
||||
"auto-complete on" => "autokompletering på",
|
||||
"security" => "sikkerhet",
|
||||
"new password" => "nytt passord",
|
||||
"8 chars min" => "min. 8 tegn",
|
||||
@@ -385,8 +385,8 @@ $text = array(
|
||||
"theme" => "tema",
|
||||
"line wrapping" => "linjebryting",
|
||||
"indent type" => "innrykk type",
|
||||
"indent size" => "innrykk størr.",
|
||||
"font size" => "skrift størr.",
|
||||
"indent size" => "innrykk størr.",
|
||||
"font size" => "skrift størr.",
|
||||
"auto indent" => "auto indent",
|
||||
"layout" => "layout",
|
||||
"plugin panel aligned" => "programtilleggspanel justert",
|
||||
@@ -396,17 +396,17 @@ $text = array(
|
||||
"bug reporting" => "feil rapportering",
|
||||
"check in files" => "sjekke blant filer",
|
||||
"every" => "hver",
|
||||
"secs getting last" => "sek., får siste",
|
||||
"secs getting last" => "sek., får siste",
|
||||
"lines" => "linjer",
|
||||
"multi-user" => "flerbruker",
|
||||
"Make sure you..." => "Pass på, at du ikke stenger deg ut selv",
|
||||
"Make sure you..." => "Pass på, at du ikke stenger deg ut selv",
|
||||
"Registration" => "Registrering",
|
||||
"auth token" => "auth token",
|
||||
"Required to get..." => "Nødvendig for å skille, bestemme ditt lagringssted på GitHub lageret etc. Hvis du ikke har en, kan du bruke en:".PHP_EOL.PHP_EOL.
|
||||
"Required to get..." => "Nødvendig for å skille, bestemme ditt lagringssted på GitHub lageret etc. Hvis du ikke har en, kan du bruke en:".PHP_EOL.PHP_EOL.
|
||||
"- personal access token (https://help.github.com/articles/creating-an-access-token-for-command-line-use), eller".PHP_EOL.
|
||||
"- full client/secret pair token (http://developer.github.com/v3/oauth).".PHP_EOL.PHP_EOL.
|
||||
"Det anbefales ikke, at du setter token din her midlertidig, og vær sikre på å oppgi den, når du blir bedt av ICEcoder, som vil holde den i økten sin.".PHP_EOL.PHP_EOL.
|
||||
"Men hvis du jobber i et trygt og sikkert miljø, er det mer effektivt å sette den her.",
|
||||
"Det anbefales ikke, at du setter token din her midlertidig, og vær sikre på å oppgi den, når du blir bedt av ICEcoder, som vil holde den i økten sin.".PHP_EOL.PHP_EOL.
|
||||
"Men hvis du jobber i et trygt og sikkert miljø, er det mer effektivt å sette den her.",
|
||||
"Sorry cannot commit..." => "Beklager, kan ikke bekrefte innstillinger i demo-modus",
|
||||
"update" => "oppdatere"
|
||||
),
|
||||
@@ -414,15 +414,15 @@ $text = array(
|
||||
"settings-update" =>
|
||||
array(
|
||||
"Cannot update config..." => "Kan ikke oppdatere konfigurasjonsfilen. Vennligst sett offentlige skriverettigheter;",
|
||||
"and try again" => "og prøv igjen",
|
||||
"and try again" => "og prøv igjen",
|
||||
"and press refresh" => "og trykk refresh"
|
||||
),
|
||||
|
||||
"updater" =>
|
||||
array(
|
||||
"Update appears to..." => "Oppdatering synes å være vellykket"
|
||||
"Update appears to..." => "Oppdatering synes å være vellykket"
|
||||
)
|
||||
|
||||
);
|
||||
?>
|
||||
|
||||
|
||||
|
||||
@@ -422,4 +422,4 @@ $text = array(
|
||||
"Update appears to..." => "با موفقیت به روز شد"
|
||||
)
|
||||
);
|
||||
?>
|
||||
|
||||
|
||||
@@ -271,7 +271,7 @@ $text = array(
|
||||
"Replacing text in" => "Substituindo texto em",
|
||||
"Cancelled tasks" => "Tarefas canceladas",
|
||||
"Open previous files" => "Abrir arquivos anteriores?",
|
||||
"Please enter your..." => "Informe sua chave GitHub (chave pessoal ou par). Veja dica próximo à chave Github em Ajuda > Configurações para mais informações",
|
||||
"Please enter your..." => "Informe sua chave GitHub (chave pessoal ou par). Veja dica próximo à chave Github em Ajuda > Configurações para mais informações",
|
||||
"This will compare..." => "Esta ação irã comparar e exibir diferenças do seu repositório local. OK?",
|
||||
"Please note for..." => "Atenção: para atualizar corretamente, é necessãrio permissão de escrita em todos os diretórios/arquivos do ICEcoder. \\n\\nSe por algum motivo necessite recuperar esta versão do ICEcoder, estarã disponível na pasta /tmp.\\n\\nClique OK para prosseguir com a atualização, ou cancelar para visitar a pãgina do ICEcoder na internet onde poderã baixar a atualização manualmente.",
|
||||
"You can start..." => "Voce pode reportar um bug em Ajuda > Configurações",
|
||||
@@ -336,7 +336,7 @@ $text = array(
|
||||
"properties" => "propriedades",
|
||||
"Size" => "Tamanho",
|
||||
"Modified" => "Modificado",
|
||||
"Last access" => "Último acesso",
|
||||
"Last access" => "Último acesso",
|
||||
"Type" => "Tipo",
|
||||
"Readable Writeable" => "Leitura / Escrita",
|
||||
"Relative path" => "Caminho relativo",
|
||||
@@ -436,4 +436,3 @@ $text = array(
|
||||
)
|
||||
|
||||
);
|
||||
?>
|
||||
@@ -20,8 +20,6 @@ $text = array(
|
||||
"your device" => "su dispositivo",
|
||||
"Browser" => "Navegador:",
|
||||
"Your IP" => "Su IP:",
|
||||
"trial remaining" => "prueba restante",
|
||||
"days left" => "dias",
|
||||
"files" => "archivos",
|
||||
"Last 10 files..." => "Ultimos 10 archivos abiertos:",
|
||||
"none" => "[ninguno]",
|
||||
@@ -465,4 +463,4 @@ $text = array(
|
||||
)
|
||||
|
||||
);
|
||||
?>
|
||||
|
||||
|
||||
19
lib/adminer.css
Normal file
@@ -0,0 +1,19 @@
|
||||
body {font-family: arial, verdana, helvetica, sans-serif; font-size: 13px; background: rgba(0,0,0,0.92); color: #ccc}
|
||||
a, a:visited {color: #49d; text-decoration: none; background: transparent}
|
||||
a:link:hover, a:visited:hover {color: #eee}
|
||||
#logins a, #tables a, #tables span {background: transparent}
|
||||
h1 {display: none}
|
||||
h2 {color: #ccc; background: transparent}
|
||||
#breadcrumb {background: transparent}
|
||||
.js .checkable .checked .td {background: #888}
|
||||
thead td, thead th, th {background: transparent}
|
||||
|
||||
th:first-child,td:first-child{white-space: nowrap}
|
||||
tbody tr:hover td,tbody tr:hover th{background: #222}
|
||||
thead tr:hover td,thead tr:hover th{background: #333}
|
||||
.odd td {background: #111}
|
||||
|
||||
.footer {position: relative; border-image: none; border-top: 0; margin-top: 20px}
|
||||
.footer div {background: transparent}
|
||||
|
||||
.logout {display: none}
|
||||
@@ -6,7 +6,7 @@ include("settings.php");
|
||||
$file = str_replace("|","/",xssClean($_GET['file'],'html'));
|
||||
|
||||
// Get contents
|
||||
$loadedFile = toUTF8noBOM(getData("../backups/".$file),true);
|
||||
$loadedFile = toUTF8noBOM(getData("../data/backups/".$file),true);
|
||||
$encoding=ini_get("default_charset");
|
||||
if($encoding=="")
|
||||
$encoding="UTF-8";
|
||||
@@ -15,7 +15,7 @@ if($encoding=="")
|
||||
echo '<textarea name="loadedFile" id="loadedFile">'.htmlentities($loadedFile,ENT_COMPAT,$encoding).'</textarea>';
|
||||
|
||||
// Get bytes for this file
|
||||
$bytes = filesize("../backups/".$file);
|
||||
$bytes = filesize("../data/backups/".$file);
|
||||
// Change into kilobytes
|
||||
$outputSize = ($bytes/1024);
|
||||
$outputUnit = "kb";
|
||||
@@ -27,10 +27,10 @@ if ($outputSize >= 1024) {
|
||||
$size = number_format($outputSize, 2, '.', '').$outputUnit." (".number_format($bytes)." bytes)";
|
||||
|
||||
// Get date & time of file
|
||||
$datetime = str_replace("-","<br>",date( "D jS M Y-g:i:sa", filemtime("../backups/".$file)));
|
||||
$datetime = str_replace("-","<br>",date( "D jS M Y-g:i:sa", filemtime("../data/backups/".$file)));
|
||||
?>
|
||||
<script>
|
||||
parent.document.getElementById('buttonsContainer').style.display = 'inline-block';
|
||||
parent.editor.setValue(document.getElementById('loadedFile').value);
|
||||
parent.document.getElementById('infoContainer').innerHTML = 'Date & Time:<br><?php echo $datetime;?><br><br>Size:<br><?php echo $size;?>';
|
||||
</script>
|
||||
</script>
|
||||
|
||||
@@ -40,8 +40,6 @@ $versions = $fileCountInfo['count'];
|
||||
.CodeMirror-foldgutter-folded {background: #800; color: #ddd}
|
||||
.CodeMirror-foldgutter-folded:after {position: relative; top: -3px}
|
||||
</style>
|
||||
<script src="../<?php echo $ICEcoder["codeMirrorDir"]; ?>/addon/fold/foldcode.js?microtime=<?php echo microtime(true);?>"></script>
|
||||
<script src="../<?php echo $ICEcoder["codeMirrorDir"]; ?>/addon/fold/foldgutter.js?microtime=<?php echo microtime(true);?>"></script>
|
||||
<link rel="stylesheet" href="../<?php echo $ICEcoder["codeMirrorDir"]; ?>/addon/fold/foldgutter.css?microtime=<?php echo microtime(true);?>">
|
||||
<link rel="stylesheet" href="editor.css?microtime=<?php echo microtime(true);?>">
|
||||
<?php
|
||||
@@ -167,4 +165,4 @@ var restoreVersion = function() {
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
||||
|
||||
@@ -83,9 +83,9 @@ if ($result != "error") {
|
||||
$output = $t['Found in']." ".$filename."...\n".implode("\n",$output);
|
||||
|
||||
if ($filesWithNewBugs==1) {
|
||||
file_put_contents("../tmp/bug-report.log", $output);
|
||||
file_put_contents("../data/bug-report.log", $output);
|
||||
} else {
|
||||
file_put_contents("../tmp/bug-report.log", "\n\n".$output, FILE_APPEND);
|
||||
file_put_contents("../data/bug-report.log", "\n\n".$output, FILE_APPEND);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,16 +93,16 @@ if ($result != "error") {
|
||||
}
|
||||
|
||||
// Get dir name tmp dir's parent
|
||||
$tmpLoc = dirname(__FILE__);
|
||||
$tmpLoc = explode(DIRECTORY_SEPARATOR,$tmpLoc);
|
||||
$tmpLoc = $tmpLoc[count($tmpLoc)-2];
|
||||
$dataLoc = dirname(__FILE__);
|
||||
$dataLoc = explode(DIRECTORY_SEPARATOR,$dataLoc);
|
||||
$dataLoc = $dataLoc[count($dataLoc)-2];
|
||||
|
||||
// Output result and status array
|
||||
$status = array(
|
||||
"files" => $files,
|
||||
"filesSizesSeen" => $filesSizesSeen,
|
||||
"maxLines" => $maxLines,
|
||||
"bugReportPath" => "|".$tmpLoc."|tmp|bug-report.log",
|
||||
"bugReportPath" => "|".$dataLoc."|data|bug-report.log",
|
||||
"result" => $result
|
||||
);
|
||||
|
||||
@@ -112,4 +112,3 @@ include("../processes/on-bug-check.php");
|
||||
// Finally, display our status in JSON format as the XHR response text
|
||||
echo json_encode($status);
|
||||
|
||||
?>
|
||||
2040
lib/database.php
Normal file
@@ -24,4 +24,3 @@ if (file_exists($file)) {
|
||||
readfile($file);
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
@@ -162,7 +162,6 @@ function stitchChanges($fileLines) {
|
||||
return $contents;
|
||||
}
|
||||
|
||||
|
||||
// ============
|
||||
// SAVING FILES
|
||||
// ============
|
||||
@@ -269,7 +268,7 @@ if (!$error && $_GET['action']=="save") {
|
||||
$ftpFilepath = ltrim($fileLoc."/".$fileName,"/");
|
||||
if (isset($_POST['changes'])) {
|
||||
// Get existing file contents as lines
|
||||
$loadedFile = toUTF8noBOM(ftpGetContents($ftpConn, $ftpRoot.$fileLoc."/".$fileName, $ftpMode));
|
||||
$loadedFile = toUTF8noBOM(ftpGetContents($ftpConn, $ftpRoot.$fileLoc."/".$fileName, $ftpMode),false);
|
||||
$fileLines = explode("\n",str_replace("\r","",$loadedFile));
|
||||
// Need to add a new line at the end of each because explode will lose them,
|
||||
// want want to end up with same array that 'file($file)' produces for a local file
|
||||
@@ -359,7 +358,7 @@ if (!$error && $_GET['action']=="save") {
|
||||
$backupDirFormat = "Y-m-d";
|
||||
|
||||
// Establish the base, host and date dir parts...
|
||||
$backupDirBase = str_replace("\\","/",dirname(__FILE__))."/../backups/";
|
||||
$backupDirBase = str_replace("\\","/",dirname(__FILE__))."/../data/backups/";
|
||||
$backupDirHost = isset($ftpSite) ? parse_url($ftpSite,PHP_URL_HOST) : "localhost";
|
||||
$backupDirDate = date($backupDirFormat);
|
||||
|
||||
@@ -1009,4 +1008,6 @@ echo '{
|
||||
"errorMsg" : "'.$errorMsg.'"
|
||||
}
|
||||
}';
|
||||
?>
|
||||
|
||||
// Set timestamp of last index to 0 to force a re-index next time we index
|
||||
requireReIndexNextTime();
|
||||
|
||||
@@ -101,16 +101,22 @@ if ($_GET['action']=="load") {
|
||||
exit;
|
||||
}
|
||||
// Get our file contents and close the FTP connection
|
||||
$loadedFile = toUTF8noBOM(ftpGetContents($ftpConn, $ftpRoot.$fileLoc."/".$fileName, $ftpMode));
|
||||
$loadedFile = toUTF8noBOM(ftpGetContents($ftpConn, $ftpRoot.$fileLoc."/".$fileName, $ftpMode),false);
|
||||
ftpEnd();
|
||||
// Get local file
|
||||
} else {
|
||||
$loadedFile = toUTF8noBOM(getData($file),true);
|
||||
}
|
||||
$encoding=ini_get("default_charset");
|
||||
if($encoding=="")
|
||||
if($encoding=="") {
|
||||
$encoding="UTF-8";
|
||||
echo '</script><textarea name="loadedFile" id="loadedFile">'.htmlentities($loadedFile,ENT_COMPAT,$encoding).'</textarea><script>';
|
||||
}
|
||||
// Get content and set HTML entities on it according to encoding
|
||||
$loadedFile = htmlentities($loadedFile,ENT_COMPAT,$encoding);
|
||||
// Remove \r chars and replace \n with carriage return HTML entity char
|
||||
$loadedFile = preg_replace('/\\r/','',$loadedFile);
|
||||
$loadedFile = preg_replace('/\\n/',' ',$loadedFile);
|
||||
echo '</script><textarea name="loadedFile" id="loadedFile">'.$loadedFile.'</textarea><script>';
|
||||
// Run our custom processes
|
||||
include_once("../processes/on-file-load.php");
|
||||
} else if (strpos($finfo,"image")===0) {
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
.fileManager LI.ext-scss:before {background-position: -384px 0}
|
||||
.fileManager LI.ext-sql:before {background-position: -400px 0}
|
||||
.fileManager LI.ext-txt:before {background-position: -416px 0}
|
||||
.fileManager LI.ext-xml:before {background-position: -432px 0}
|
||||
.fileManager LI.ext-yaml:before {background-position: -448px 0}
|
||||
.fileManager LI.ext-zip:before {background-position: -464px 0}
|
||||
.fileManager LI.ext-ts:before {background-position: -432px 0}
|
||||
.fileManager LI.ext-xml:before {background-position: -448px 0}
|
||||
.fileManager LI.ext-yaml:before {background-position: -464px 0}
|
||||
.fileManager LI.ext-zip:before {background-position: -480px 0}
|
||||
@@ -13,13 +13,7 @@
|
||||
|
||||
/* 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: -20px; background:url(../images/file-folder-icons.png) no-repeat 0 0;
|
||||
position: absolute; width: 16px; height: 16px; content: ""; margin-top: -2px; margin-left: -20px; 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}
|
||||
.fileManager LI.pft-file:before {background-position: -32px 0}
|
||||
|
||||
@@ -112,4 +112,3 @@ function ftpDelete($ftpConn, $type, $path) {
|
||||
return ftp_rmdir($ftpConn, $path);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -8,7 +8,7 @@ if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && isset
|
||||
|
||||
// Get our old FTP sites & user settings
|
||||
$oldFTPSites = $ICEcoder["ftpSites"];
|
||||
$settingsContents = getData($settingsFile);
|
||||
$settingsContents = getData("../data/".$settingsFile);
|
||||
|
||||
// ========
|
||||
// CHOOSING
|
||||
@@ -103,16 +103,16 @@ if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && isset
|
||||
$settingsContents = substr($settingsContents,0,$repPosStart).$settingsNew.substr($settingsContents,$repPosEnd,strlen($settingsContents));
|
||||
|
||||
// Now update the config file
|
||||
if (is_writeable($settingsFile)) {
|
||||
$fh = fopen($settingsFile, 'w');
|
||||
fwrite($fh, $settingsContents);
|
||||
if (is_writeable("../data/".$settingsFile)) {
|
||||
$fh = fopen("../data/".$settingsFile, 'w');
|
||||
fwrite($fh, "../data/".$settingsContents);
|
||||
fclose($fh);
|
||||
// Finally, reload the iFrame screen for the user
|
||||
header("Location: ftp-manager.php?updatedFTPSites&csrf=".$_SESSION["csrf"]);
|
||||
echo "<script>window.location='ftp-manager.php?updatedFTPSites&csrf='+top.ICEcoder.csrf;</script>";
|
||||
die($t['Saving FTP sites']);
|
||||
} else {
|
||||
echo "<script>top.ICEcoder.message('".$t['Cannot update config...']." lib/".$settingsFile." ".$t['and try again']."');</script>";
|
||||
echo "<script>top.ICEcoder.message('".$t['Cannot update config...']." data/".$settingsFile." ".$t['and try again']."');</script>";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -209,4 +209,4 @@ if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && isset
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
||||
|
||||
@@ -48,9 +48,9 @@ if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && isset
|
||||
$settingsContents = substr($settingsContents,0,$repPosStart).$settingsNew.substr($settingsContents,$repPosEnd,strlen($settingsContents));
|
||||
|
||||
// Now update the config file
|
||||
if (is_writeable($settingsFile)) {
|
||||
$fh = fopen($settingsFile, 'w');
|
||||
fwrite($fh, $settingsContents);
|
||||
if (is_writeable("../data/".$settingsFile)) {
|
||||
$fh = fopen("../data/".$settingsFile, 'w');
|
||||
fwrite($fh, "../data/".$settingsContents);
|
||||
fclose($fh);
|
||||
|
||||
// Clear any FTP session we may have
|
||||
@@ -59,7 +59,7 @@ if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && isset
|
||||
// Hide this popup and reload file manager
|
||||
echo "<script>top.ICEcoder.showHide('hide',top.document.getElementById('blackMask'));top.ICEcoder.refreshFileManager();</script>";
|
||||
} else {
|
||||
echo "<script>top.ICEcoder.message('".$t['Cannot update config...']." lib/".$settingsFile." ".$t['and try again']."');</script>";
|
||||
echo "<script>top.ICEcoder.message('".$t['Cannot update config...']." data/".$settingsFile." ".$t['and try again']."');</script>";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -151,16 +151,16 @@ if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && isset
|
||||
$settingsContents = substr($settingsContents,0,$repPosStart).$settingsNew.substr($settingsContents,$repPosEnd,strlen($settingsContents));
|
||||
|
||||
// Now update the config file
|
||||
if (is_writeable($settingsFile)) {
|
||||
$fh = fopen($settingsFile, 'w');
|
||||
fwrite($fh, $settingsContents);
|
||||
if (is_writeable("../data/".$settingsFile)) {
|
||||
$fh = fopen("../data/".$settingsFile, 'w');
|
||||
fwrite($fh, "../data/".$settingsContents);
|
||||
fclose($fh);
|
||||
// Finally, reload the iFrame screen for the user
|
||||
header("Location: github-manager.php?updatedGithubPaths&csrf=".$_SESSION["csrf"]);
|
||||
echo "<script>window.location='github-manager.php?updatedGithubPaths&csrf='+top.ICEcoder.csrf;</script>";
|
||||
die($t['saving github paths']);
|
||||
} else {
|
||||
echo "<script>top.ICEcoder.message('".$t['Cannot update config...']." lib/".$settingsFile." ".$t['and try again']."');</script>";
|
||||
echo "<script>top.ICEcoder.message('".$t['Cannot update config...']." data/".$settingsFile." ".$t['and try again']."');</script>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ $t = $text['settings-update'];
|
||||
// Update our 'root' value to be blank
|
||||
// which resets the file manager to localhost root again
|
||||
if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn']) {
|
||||
$settingsContents = getData($settingsFile);
|
||||
$settingsContents = getData("../data/".$settingsFile);
|
||||
// Replace our root var
|
||||
$repPosStart = strpos($settingsContents,'"root"');
|
||||
$repPosEnd = strpos($settingsContents,'"checkUpdates"');
|
||||
@@ -18,9 +18,9 @@ if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn']) {
|
||||
substr($settingsContents,($repPosEnd),strlen($settingsContents));
|
||||
|
||||
// Now update the config file
|
||||
if (is_writeable($settingsFile)) {
|
||||
$fh = fopen($settingsFile, 'w');
|
||||
fwrite($fh, $settingsContents);
|
||||
if (is_writeable("../data/".$settingsFile)) {
|
||||
$fh = fopen("../data/".$settingsFile, 'w');
|
||||
fwrite($fh, "../data/".$settingsContents);
|
||||
fclose($fh);
|
||||
|
||||
// Clear any FTP session we may have
|
||||
@@ -29,9 +29,8 @@ if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn']) {
|
||||
// Now we've reset the root path to localhost root, refresh the file manager to show it
|
||||
echo "<script>top.ICEcoder.refreshFileManager();</script>";
|
||||
} else {
|
||||
echo "<script>top.ICEcoder.message('".$t['Cannot update config']." lib/".$settingsFile." ".$t['and try again']."');</script>";
|
||||
echo "<script>top.ICEcoder.message('".$t['Cannot update config']." data/".$settingsFile." ".$t['and try again']."');</script>";
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
;};
|
||||
?>
|
||||
@@ -37,4 +37,3 @@ if (!headers_sent()) {
|
||||
header('Pragma: no-cache'); // Caching over HTTP 1.0 covered
|
||||
header('Expires: 0'); // Caching over Proxies covered
|
||||
}
|
||||
?>
|
||||
@@ -135,9 +135,16 @@ h2 {font-size: 18px; font-weight: normal; color: #fff}
|
||||
.findBar .bug {position: fixed; display: inline-block; width: 16px; height: 16px; right: 209px; top: 48px; background: url('../images/bug-reporting-icons.png') 0 0 no-repeat; cursor: pointer; background-position: 0 0}
|
||||
.findBar .minimapLink {position: fixed; display: inline-block; width: 16px; height: 16px; right: 164px; top: 48px; background: url('../images/doc-explorer-icons.png') 0 0 no-repeat; cursor: pointer; background-position: 0 0; cursor: pointer; z-index: 1}
|
||||
.findBar .functionClassListLink {position: fixed; display: inline-block; width: 16px; height: 16px; right: 138px; top: 48px; background: url('../images/doc-explorer-icons.png') 0 0 no-repeat; cursor: pointer; background-position: -16px 0; cursor: pointer; z-index: 1}
|
||||
.findBar .terminalLink {position: fixed; display: inline-block; width: 16px; height: 16px; right: 112px; top: 48px; background: url('../images/doc-explorer-icons.png') 0 0 no-repeat; cursor: pointer; background-position: -32px 0; cursor: pointer; z-index: 1}
|
||||
.editor .terminal {position: fixed; top: 10000px; transition: top 0.2s ease; z-index: 2}
|
||||
.editor .output {position: fixed; top: 10000px; padding: 15px 18px 8px 13px; transition: top 0.2s ease; background: rgba(0,0,0,0.92); z-index: 2}
|
||||
.editor .database {position: fixed; top: 10000px; transition: top 0.2s ease; z-index: 2}
|
||||
.editor .git {position: fixed; top: 10000px; padding: 15px 18px 8px 13px; transition: top 0.2s ease; background: rgba(0,0,0,0.92); z-index: 2}
|
||||
.editor .code {position: relative; display: inline-block; top: 28px; width: 600px; height: 600px; visibility: hidden}
|
||||
|
||||
.tools {position: fixed; display: inline-block; width: 250px; height: 30px; left: 0; bottom: 0; z-index: 3}
|
||||
.tools div {display: inline-block; margin: 8px 0 8px 15px; color: #666; cursor: pointer}
|
||||
.tools div:hover {color: #fff; cursor: pointer}
|
||||
|
||||
.footer {position: fixed; display: inline-block; width: 100%; height: 30px; bottom: 0; background-color: rgba(0,0,0,0.15); left: 0; z-index: 1}
|
||||
.footer .nesting {position: absolute; display: inline-block; padding: 5px; margin-top: 10px; left: 260px; border-radius: 5px; background-color: #0b0; cursor: default}
|
||||
.footer .versionsDisplay {position: absolute; display: inline-block; padding: 5px; margin-top: 3px; left: 275px; color: #fff; font-weight: bold; cursor: pointer}
|
||||
@@ -175,4 +182,4 @@ h2 {font-size: 18px; font-weight: normal; color: #fff}
|
||||
.screenCenter .text a {position: relative; display: block; margin-top: 15px; font-size: 10px; color: #888; text-decoration: none}
|
||||
.screenCenter .password {border: 0; background-color: #333; color: #fff; height: 20px}
|
||||
.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}
|
||||
|
||||
481
lib/ice-coder.js
@@ -42,6 +42,7 @@ var ICEcoder = {
|
||||
tabFGopenFile: '#000', // FG of open file
|
||||
tabFGnormalFile: '#eee', // FG of normal file
|
||||
tabFGnormalTab: '#888', // FG of normal tab
|
||||
prevTab: 0, // Previous tab to current
|
||||
serverQueueItems: [], // Array of URLs to call in order
|
||||
miniMapBoxTop: 0, // Top of the minimap box highlighter
|
||||
miniMapBoxHeight: 0, // Height of the minimap box highlighter
|
||||
@@ -50,6 +51,8 @@ var ICEcoder = {
|
||||
pluginIntervalRefs: [], // Array of plugin interval refs
|
||||
overPopup: false, // Indicates if we're over a popup or not
|
||||
cmdKey: false, // Tracking apple Command key up/down state
|
||||
codeZoomedOut: false, // If true, code on non declaration lines is zoomed out
|
||||
showingTool: false, // Which tool is showing right now (terminal, output, database, git etc)
|
||||
oppTagReplaceData: [], // Will contain data for automatic opposite tag replacement to sync them
|
||||
fmReady: false, // Indicates if the file manager is ready for action
|
||||
bugReportStatus: "off", // Values of: off, error, ok, bugs
|
||||
@@ -65,11 +68,12 @@ var ICEcoder = {
|
||||
debounce: "", // Contains debounce timeout object
|
||||
editorFocusInstance: "", // Name of editor instance that has focus
|
||||
openSeconds: 0, // Number of seconds ICEcoder has been open for
|
||||
indexing: false, // Indicates if ICEcoder is currently indexing
|
||||
ready: false, // Indicates if ICEcoder is ready for action
|
||||
|
||||
// Set our aliases
|
||||
initAliases: function() {
|
||||
var aliasArray = ["header","files", "fileOptions", "optionsFile", "optionsEdit", "optionsSource", "optionsHelp", "filesFrame", "editor", "tabsBar", "findBar", "content", "terminal", "footer", "nestValid", "versionsDisplay", "splitPaneControls", "splitPaneNamesMain", "splitPaneNamesDiff", "charDisplay", "byteDisplay", "docExplorer", "miniMap", "miniMapContainer", "miniMapContent", "functionClassList"];
|
||||
var aliasArray = ["header","files", "fileOptions", "optionsFile", "optionsEdit", "optionsSource", "optionsHelp", "filesFrame", "editor", "tabsBar", "findBar", "terminal", "output", "database", "git", "content", "tools", "footer", "nestValid", "versionsDisplay", "splitPaneControls", "splitPaneNamesMain", "splitPaneNamesDiff", "charDisplay", "byteDisplay", "docExplorer", "miniMap", "miniMapContainer", "miniMapContent", "functionClassList"];
|
||||
|
||||
// Create our ID aliases
|
||||
for (var i=0;i<aliasArray.length;i++) {
|
||||
@@ -97,8 +101,7 @@ var ICEcoder = {
|
||||
top.ICEcoder.showHide('hide',top.get('loadingMask'));
|
||||
top.ICEcoder.autoOpenInt = setInterval(function() {
|
||||
if (top.ICEcoder.fmReady) {
|
||||
// Delay auto open process by 200ms to give trial bar time to begin animation
|
||||
if (top.ICEcoder.openLastFiles) {setTimeout(function() {top.ICEcoder.autoOpenFiles()},200);};
|
||||
if (top.ICEcoder.openLastFiles) {top.ICEcoder.autoOpenFiles();};
|
||||
clearInterval(top.ICEcoder.autoOpenInt);
|
||||
}
|
||||
}, 4);
|
||||
@@ -135,12 +138,25 @@ var ICEcoder = {
|
||||
if(!unsavedFiles && ICEcoder.autoLogoutMins > 0 && top.ICEcoder.autoLogoutTimer >= top.ICEcoder.autoLogoutMins*60) {
|
||||
top.ICEcoder.logout('autoLogout');
|
||||
}
|
||||
// Finally, increase number of seconds ICEcoder has been open for by 1
|
||||
// Increase number of seconds ICEcoder has been open for by 1
|
||||
top.ICEcoder.openSeconds++;
|
||||
// Every 5 mins, ping our file to keep the session alive
|
||||
if (top.ICEcoder.openSeconds % 300 == 0) {
|
||||
top.ICEcoder.filesFrame.contentWindow.frames['pingActive'].location.href = "lib/session-active-ping.php";
|
||||
}
|
||||
// Every 3 seconds, re-index if we're not already busy
|
||||
if (!top.ICEcoder.indexing && !top.ICEcoder.loadingFile && top.ICEcoder.serverQueueItems.length === 0 && top.ICEcoder.openSeconds % 3 == 0) {
|
||||
top.ICEcoder.indexing = true;
|
||||
// Get new data
|
||||
fetch('lib/indexer.php')
|
||||
.then(function(response) {
|
||||
// Convert to JSON
|
||||
return response.json();
|
||||
}).then(function(data) {
|
||||
top.ICEcoder.indexData = data;
|
||||
top.ICEcoder.indexing = false;
|
||||
});
|
||||
}
|
||||
},1000);
|
||||
|
||||
// ICEcoder is ready to start using
|
||||
@@ -153,18 +169,18 @@ var ICEcoder = {
|
||||
|
||||
// Set our layout according to the browser size
|
||||
setLayout: function(dontSetEditor) {
|
||||
var winW, winH, headerH, fileNavH, tabsBarH, findBarH;
|
||||
var winW, winH, headerH, fileNavH, tabsBarH, findBarH, toolsBarH;
|
||||
|
||||
// Determin width & height available
|
||||
winW = window.innerWidth;
|
||||
winH = window.innerHeight;
|
||||
|
||||
// Apply sizes to various elements of the page
|
||||
headerH = 25, fileNavH = 35, tabsBarH = 21, findBarH = 28;
|
||||
headerH = 25, fileNavH = 35, tabsBarH = 21, findBarH = 28, toolsBarH = 30;
|
||||
this.header.style.width = this.tabsBar.style.width = this.findBar.style.width = winW + "px";
|
||||
this.files.style.width = this.editor.style.left = this.filesW + "px";
|
||||
this.optionsFile.style.width = this.optionsEdit.style.width = this.optionsSource.style.width = this.optionsHelp.style.width = (this.filesW-60) + "px";
|
||||
this.filesFrame.style.height = (winH-headerH-fileNavH) + "px";
|
||||
this.filesFrame.style.height = (winH-headerH-fileNavH-toolsBarH) + "px";
|
||||
this.nestValid.style.left = (this.filesW+10) + "px";
|
||||
this.versionsDisplay.style.left = (this.filesW+25) + "px";
|
||||
this.splitPaneControls.style.left = (parseInt((winW-this.filesW)/2,10)-25-4+this.filesW) - 100 + "px";
|
||||
@@ -176,8 +192,21 @@ var ICEcoder = {
|
||||
if (!dontSetEditor) {
|
||||
this.editor.style.width = ICEcoder.content.style.width = (winW-this.filesW) - 200 + "px";
|
||||
ICEcoder.terminal.style.width = (winW-this.filesW) + "px";
|
||||
ICEcoder.output.style.width = (winW-this.filesW) + "px";
|
||||
ICEcoder.database.style.width = (winW-this.filesW) + "px";
|
||||
ICEcoder.git.style.width = (winW-this.filesW) + "px";
|
||||
ICEcoder.content.style.height = (winH-headerH-tabsBarH-findBarH-26) + "px";
|
||||
ICEcoder.terminal.style.height = winH + "px";
|
||||
ICEcoder.output.style.height = winH + "px";
|
||||
ICEcoder.database.style.height = winH + "px";
|
||||
ICEcoder.git.style.height = winH + "px";
|
||||
ICEcoder.terminal.style.top = winH + "px";
|
||||
ICEcoder.output.style.top = winH + "px";
|
||||
ICEcoder.database.style.top = winH + "px";
|
||||
ICEcoder.git.style.top = winH + "px";
|
||||
if (top.ICEcoder.showingTool !== false) {
|
||||
get(top.ICEcoder.showingTool).style.top = 0;
|
||||
}
|
||||
|
||||
// Resize the CodeMirror instances to match the window size
|
||||
setTimeout(function(){
|
||||
@@ -209,8 +238,8 @@ var ICEcoder = {
|
||||
var cM, cMdiff;
|
||||
|
||||
top.ICEcoder.splitPane = onOff == "on" ? true : false;
|
||||
top.get('splitPaneControlsOff').style.opacity = top.ICEcoder.splitPane ? 0.5 : 1;
|
||||
top.get('splitPaneControlsOn').style.opacity = top.ICEcoder.splitPane ? 1 : 0.5;
|
||||
top.get('splitPaneControlsOff').style.opacity = top.ICEcoder.splitPane ? 0.2 : 0.5;
|
||||
top.get('splitPaneControlsOn').style.opacity = top.ICEcoder.splitPane ? 0.5 : 0.2;
|
||||
top.get('splitPaneNamesMain').style.opacity = top.get('splitPaneNamesDiff').style.opacity = top.ICEcoder.splitPane ? 1 : 0;
|
||||
top.ICEcoder.setLayout();
|
||||
|
||||
@@ -260,28 +289,49 @@ var ICEcoder = {
|
||||
},4);
|
||||
},
|
||||
|
||||
// Tool show/hide toggle
|
||||
toolShowHideToggle: function(tool) {
|
||||
var winH;
|
||||
|
||||
winH = window.innerHeight;
|
||||
|
||||
if (["terminal","output","database","git"].indexOf(tool) > -1) {
|
||||
// Set out of view as a start point
|
||||
get('terminal').style.top = winH + "px";
|
||||
get('output').style.top = winH + "px";
|
||||
get('database').style.top = winH + "px";
|
||||
get('git').style.top = winH + "px";
|
||||
|
||||
// Now set tool requested, out of view, or in view
|
||||
get(tool).style.top = top.ICEcoder.showingTool === tool ? winH + "px" : 0;
|
||||
|
||||
// Carry out any extras...
|
||||
if (tool === "terminal") {
|
||||
// Focus on command prompt
|
||||
setTimeout(function(){
|
||||
top.ICEcoder.terminal.contentWindow.document.getElementById('command').focus();
|
||||
},0);
|
||||
}
|
||||
|
||||
// Note which tool we're showing
|
||||
top.ICEcoder.showingTool = top.ICEcoder.showingTool !== tool ? tool : false;
|
||||
}
|
||||
},
|
||||
|
||||
// Doc Explorer show item
|
||||
docExplorerShow: function(item) {
|
||||
var cM;
|
||||
|
||||
if (item == "terminal") {
|
||||
get('terminal').style.display = 'block';
|
||||
setTimeout(function(){
|
||||
top.ICEcoder.terminal.contentWindow.document.getElementById('command').focus();
|
||||
},0);
|
||||
} else {
|
||||
get('terminal').style.display = 'none';
|
||||
get('miniMap').style.display = item == "miniMap" ? 'block' : 'none';
|
||||
get('functionClassList').style.display = item == "functionClassList" ? 'block' : 'none';
|
||||
if (item == "miniMap") {
|
||||
top.miniMapInt = setInterval(function(){
|
||||
if (get('miniMapContent').getBoundingClientRect().height != 0) {
|
||||
cM = top.ICEcoder.getcMInstance();
|
||||
top.ICEcoder.setMinimapLayout(cM);
|
||||
clearInterval(top.miniMapInt);
|
||||
}
|
||||
},10);
|
||||
}
|
||||
get('miniMap').style.display = item == "miniMap" ? 'block' : 'none';
|
||||
get('functionClassList').style.display = item == "functionClassList" ? 'block' : 'none';
|
||||
if (item == "miniMap") {
|
||||
top.miniMapInt = setInterval(function(){
|
||||
if (get('miniMapContent').getBoundingClientRect().height != 0) {
|
||||
cM = top.ICEcoder.getcMInstance();
|
||||
top.ICEcoder.setMinimapLayout(cM);
|
||||
clearInterval(top.miniMapInt);
|
||||
}
|
||||
},10);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -627,10 +677,61 @@ var ICEcoder = {
|
||||
},
|
||||
|
||||
// On mouse down
|
||||
cMonMouseDown: function(thisCM,cMinstance) {
|
||||
cMonMouseDown: function(thisCM,cMinstance,evt) {
|
||||
top.ICEcoder.mouseDownInCM = "editor";
|
||||
},
|
||||
|
||||
// On context menu
|
||||
cMonContextMenu: function(thisCM,cMinstance,evt) {
|
||||
// Set cursor
|
||||
var currCoords = thisCM.coordsChar({left: evt.pageX, top: evt.pageY});
|
||||
thisCM.setCursor(currCoords);
|
||||
|
||||
// If CTRL key down
|
||||
if (evt.ctrlKey) {
|
||||
setTimeout(function() {
|
||||
// Get cM and word under mouse pointer
|
||||
var cM = thisCM;
|
||||
var word = (cM.getRange(cM.findWordAt(cM.getCursor()).anchor, cM.findWordAt(cM.getCursor()).head));
|
||||
|
||||
// Get result and number of results for word in functions and classes from index JSON object list
|
||||
result = null;
|
||||
numResults = 0;
|
||||
var filePath = top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1];
|
||||
var filePathExt = filePath.substr(filePath.lastIndexOf(".")+1);
|
||||
for(i in top.ICEcoder.indexData.functions[filePathExt]) {
|
||||
if (i === word) {
|
||||
result = top.ICEcoder.indexData.functions[filePathExt][i];
|
||||
numResults++;
|
||||
}
|
||||
};
|
||||
for(i in top.ICEcoder.indexData.classes[filePathExt]) {
|
||||
if (i === word) {
|
||||
result = top.ICEcoder.indexData.classes[filePathExt][i];
|
||||
numResults++;
|
||||
}
|
||||
};
|
||||
|
||||
// If we have a single result and the cursor isn't already on the definition of it we can jump to where it's defined
|
||||
if (numResults === 1 && [null,"def"].indexOf(cM.getTokenTypeAt(cM.getCursor())) === -1) {
|
||||
top.ICEcoder.openFile(result.filePath.replace(top.docRoot,""));
|
||||
top.ICEcoder.goFindAfterOpenInt = setInterval(function(){
|
||||
if (top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1] == result.filePath.replace(top.docRoot,"") && !top.ICEcoder.loadingFile) {
|
||||
cM = top.ICEcoder.getcMInstance();
|
||||
setTimeout(function() {
|
||||
top.ICEcoder.goToLine(result.range.from.line+1);
|
||||
cM.setSelection({line: result.range.from.line, ch: result.range.from.ch}, {line: result.range.to.line, ch: result.range.to.ch});
|
||||
},20);
|
||||
clearInterval(top.ICEcoder.goFindAfterOpenInt);
|
||||
}
|
||||
},20);
|
||||
}
|
||||
|
||||
top.ICEcoder.mouseDownInCM = "editor";
|
||||
},0);
|
||||
}
|
||||
},
|
||||
|
||||
// On drag over
|
||||
cMonDragOver: function(thisCM,evt,cMinstance) {
|
||||
top.ICEcoder.setDragCursor(evt,'editor');
|
||||
@@ -661,6 +762,59 @@ var ICEcoder = {
|
||||
}
|
||||
},
|
||||
|
||||
// Show Function & class params tooltip
|
||||
functionClassParamsTooltip: function(e, area) {
|
||||
if (top.ICEcoder.indexData) {
|
||||
// If we have no files open, return early
|
||||
if (top.ICEcoder.openFiles.length === 0) {
|
||||
get('tooltip').style.display = "none";
|
||||
return true;
|
||||
}
|
||||
|
||||
var i;
|
||||
// Get cM instance, and the word under mouse pointer
|
||||
var cM = top.ICEcoder.getcMInstance();
|
||||
var coordsChar = cM.coordsChar({left: top.ICEcoder.mouseX-top.ICEcoder.maxFilesW, top: top.ICEcoder.mouseY-72});
|
||||
var word = (cM.getRange(cM.findWordAt(coordsChar).anchor, cM.findWordAt(coordsChar).head));
|
||||
|
||||
// If it's not a word, return early
|
||||
if (word === "") {
|
||||
get('tooltip').style.display = "none";
|
||||
return true;
|
||||
}
|
||||
|
||||
// Get result and number of results for word in functions and classes from index JSON object list
|
||||
var result = null;
|
||||
var numResults = 0;
|
||||
var filePath = top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1];
|
||||
var filePathExt = filePath.substr(filePath.lastIndexOf(".")+1);
|
||||
for(i in top.ICEcoder.indexData.functions[filePathExt]) {
|
||||
if (i === word) {
|
||||
result = top.ICEcoder.indexData.functions[filePathExt][i];
|
||||
numResults++;
|
||||
}
|
||||
};
|
||||
for(i in top.ICEcoder.indexData.classes[filePathExt]) {
|
||||
if (i === word) {
|
||||
result = top.ICEcoder.indexData.classes[filePathExt][i];
|
||||
numResults++;
|
||||
}
|
||||
};
|
||||
|
||||
// If we have a single result and the mouse pointer is not over the definition of it (that would be pointless), show tooltip
|
||||
if (numResults === 1 && [null,"def"].indexOf(cM.getTokenTypeAt(coordsChar)) === -1) {
|
||||
get('tooltip').style.display = "block";
|
||||
get('tooltip').style.left = (top.ICEcoder.mouseX-top.ICEcoder.maxFilesW+10) + "px";
|
||||
get('tooltip').style.top = (top.ICEcoder.mouseY-30) + "px";
|
||||
get('tooltip').style.zIndex = "1";
|
||||
get('tooltip').innerHTML = result.params;
|
||||
// Else hide it
|
||||
} else {
|
||||
get('tooltip').style.display = "none";
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// Update diffs shown to the user in each pane
|
||||
updateDiffs: function() {
|
||||
var cM, cMdiff, mainText, diffText, sm, opcodes, cMmarks, cMdiffMarks, amt, sDiffs;
|
||||
@@ -950,10 +1104,11 @@ var ICEcoder = {
|
||||
},
|
||||
|
||||
// Go to a specific line number
|
||||
goToLine: function(lineNo) {
|
||||
goToLine: function(lineNo, charNo, noFocus) {
|
||||
var cM, cMdiff, thisCM;
|
||||
|
||||
lineNo = lineNo ? lineNo-1 : top.get('goToLineNo').value-1;
|
||||
charNo = charNo ? charNo : 0;
|
||||
|
||||
cM = ICEcoder.getcMInstance();
|
||||
cMdiff = ICEcoder.getcMdiffInstance();
|
||||
@@ -975,10 +1130,12 @@ var ICEcoder = {
|
||||
}
|
||||
},10);
|
||||
|
||||
thisCM.setCursor(lineNo);
|
||||
top.ICEcoder.focus();
|
||||
// Also do this after a 0ms tickover incase DOM wasn't ready
|
||||
setTimeout(function(){top.ICEcoder.focus();},0);
|
||||
thisCM.setCursor(lineNo, charNo);
|
||||
if (!noFocus) {
|
||||
top.ICEcoder.focus();
|
||||
// Also do this after a 0ms tickover incase DOM wasn't ready
|
||||
setTimeout(function(){top.ICEcoder.focus();},0);
|
||||
}
|
||||
return false;
|
||||
},
|
||||
|
||||
@@ -2959,7 +3116,6 @@ var ICEcoder = {
|
||||
if (["object","both"].indexOf(top.ICEcoder.fileDirResOutput) >= 0) {
|
||||
console.log(statusObj);
|
||||
}
|
||||
|
||||
// If error, show that, otherwise do whatever we're required to do next
|
||||
if (statusObj.status.error) {
|
||||
top.ICEcoder.message(statusObj.status.errorMsg);
|
||||
@@ -3235,7 +3391,7 @@ var ICEcoder = {
|
||||
thisCSS[strCSS][0].style['fontSize'] = fontSize;
|
||||
|
||||
// Update styles in editor
|
||||
thisCSS = ICEcoder.content.contentWindow.document.styleSheets[4];
|
||||
thisCSS = ICEcoder.content.contentWindow.document.styleSheets[6];
|
||||
strCSS = thisCSS.rules ? 'rules' : 'cssRules';
|
||||
thisCSS[strCSS][0].style['fontSize'] = fontSize;
|
||||
thisCSS[strCSS][4].style['border-left-width'] = visibleTabs ? '1px' : '0';
|
||||
@@ -3404,6 +3560,11 @@ var ICEcoder = {
|
||||
window.location = window.location + "?logout&"+(type ? "type="+type+"&" : "")+"csrf="+top.ICEcoder.csrf;
|
||||
},
|
||||
|
||||
// Show a message
|
||||
outputMsg: function(msg) {
|
||||
top.ICEcoder.output.innerHTML += msg + "<br>";
|
||||
},
|
||||
|
||||
// Show a message
|
||||
message: function(msg) {
|
||||
alert(msg);
|
||||
@@ -3595,6 +3756,11 @@ var ICEcoder = {
|
||||
switchTab: function(newTab,noFocus) {
|
||||
var cM, cMdiff, thisCM;
|
||||
|
||||
// If we're not switching to same tab (for some reason), note the previous tab
|
||||
if (newTab !== top.ICEcoder.selectedTab) {
|
||||
top.ICEcoder.prevTab = top.ICEcoder.selectedTab;
|
||||
}
|
||||
|
||||
// Identify tab that's currently selected & get the instance
|
||||
ICEcoder.selectedTab = newTab;
|
||||
cM = ICEcoder.getcMInstance();
|
||||
@@ -4054,11 +4220,74 @@ var ICEcoder = {
|
||||
// Reset the auto-logout timer
|
||||
top.ICEcoder.resetAutoLogoutTimer();
|
||||
|
||||
// Detect if we type s,n,a,k,e keys with content saved, if so start snake game
|
||||
if (!top.ICEcoder.last5Keys) {top.ICEcoder.last5Keys = [];}
|
||||
top.ICEcoder.last5Keys.push(key);
|
||||
if (top.ICEcoder.last5Keys.length == 6) {
|
||||
top.ICEcoder.last5Keys.shift();
|
||||
}
|
||||
if (top.ICEcoder.last5Keys.join() == "83,78,65,75,69") {
|
||||
setTimeout(function() {
|
||||
// Undo back to pre 'snake' word
|
||||
cM = ICEcoder.getcMInstance();
|
||||
var undoCounts = 0;
|
||||
var startCG = cM.changeGeneration();
|
||||
while (cM.changeGeneration() > startCG-5) {
|
||||
cM.undo();
|
||||
undoCounts++;
|
||||
}
|
||||
// If we have content saved
|
||||
if (top.ICEcoder.savedPoints[top.ICEcoder.selectedTab-1] == cM.changeGeneration()) {
|
||||
// Start snake game
|
||||
top.ICEcoder.startSnake();
|
||||
// If we don't, redo snake word
|
||||
} else {
|
||||
for (var i=1; i<=undoCounts; i++) {
|
||||
cM.redo();
|
||||
}
|
||||
}
|
||||
},0);
|
||||
}
|
||||
|
||||
// Detect arrow keys if playing snake
|
||||
if (top.ICEcoder.snakePlaying) {
|
||||
if (key==37) {top.ICEcoder.snakeDir = 'left'}
|
||||
if (key==39) {top.ICEcoder.snakeDir = 'right'}
|
||||
if (key==38) {top.ICEcoder.snakeDir = 'up'}
|
||||
if (key==40) {top.ICEcoder.snakeDir = 'down'}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Mac command key handling (224 = Moz, 91/93 = Webkit Left/Right Apple)
|
||||
if (key==224 || key==91 || key==93) {
|
||||
top.ICEcoder.cmdKey = true;
|
||||
}
|
||||
|
||||
// F1 (zoom code out non declaration lines)
|
||||
if (key === 112) {
|
||||
if (top.ICEcoder.codeZoomedOut) {
|
||||
return;
|
||||
}
|
||||
top.ICEcoder.codeZoomedOut = true;
|
||||
|
||||
cM = ICEcoder.getcMInstance();
|
||||
// For every line in the current editor, add code-zoomed-out class if not a function/class declaration line
|
||||
for (var i=0; i<cM.lineCount(); i++) {
|
||||
var nonDeclareLine = true;
|
||||
for (var j=0; j<top.ICEcoder.functionClassList.length; j++) {
|
||||
if (top.ICEcoder.functionClassList[j].line == i) {
|
||||
nonDeclareLine = false;
|
||||
}
|
||||
}
|
||||
if (nonDeclareLine) {
|
||||
cM.addLineClass(i, "wrap", "code-zoomed-out");
|
||||
}
|
||||
}
|
||||
// Refresh is necessary to re-draw lines
|
||||
cM.refresh();
|
||||
return false;
|
||||
};
|
||||
|
||||
// DEL (Delete file)
|
||||
if (key==46 && area == "files") {
|
||||
top.ICEcoder.deleteFiles();
|
||||
@@ -4150,12 +4379,19 @@ var ICEcoder = {
|
||||
top.ICEcoder.searchForSelected();
|
||||
return false;
|
||||
|
||||
// CTRL/Cmd+right arrow (Next tab)
|
||||
// CTRL/Cmd+backspace arrow (Go to previous tab selected)
|
||||
} else if(key==8 && (evt.ctrlKey||top.ICEcoder.cmdKey)) {
|
||||
if (top.ICEcoder.prevTab !== 0) {
|
||||
top.ICEcoder.switchTab(top.ICEcoder.prevTab);
|
||||
}
|
||||
return false;
|
||||
|
||||
// CTRL/Cmd+right arrow (Tab to right)
|
||||
} else if(key==39 && (evt.ctrlKey||top.ICEcoder.cmdKey) && area!="content") {
|
||||
top.ICEcoder.nextTab();
|
||||
return false;
|
||||
|
||||
// CTRL/Cmd+left arrow (Previous tab)
|
||||
// CTRL/Cmd+left arrow (Tab to left)
|
||||
} else if(key==37 && (evt.ctrlKey||top.ICEcoder.cmdKey) && area!="content") {
|
||||
top.ICEcoder.previousTab();
|
||||
return false;
|
||||
@@ -4282,8 +4518,35 @@ var ICEcoder = {
|
||||
|
||||
// Reset the state of keys back to the normal state
|
||||
resetKeys: function(evt) {
|
||||
var key, cM;
|
||||
|
||||
key = evt.keyCode ? evt.keyCode : evt.which ? evt.which : evt.charCode;
|
||||
|
||||
if (key == 112 && top.ICEcoder.codeZoomedOut) {
|
||||
cM = ICEcoder.getcMInstance();
|
||||
// For every line in the current editor, remove code-zoomed-out class if not a function/class declaration line
|
||||
for (var i=0; i<cM.lineCount(); i++) {
|
||||
var nonDeclareLine = true;
|
||||
for (var j=0; j<top.ICEcoder.functionClassList.length; j++) {
|
||||
if (top.ICEcoder.functionClassList[j].line == i) {
|
||||
nonDeclareLine = false;
|
||||
}
|
||||
}
|
||||
if (nonDeclareLine) {
|
||||
cM.removeLineClass(i, "wrap", "code-zoomed-out");
|
||||
}
|
||||
}
|
||||
// Refresh is necessary to re-draw lines
|
||||
cM.refresh();
|
||||
|
||||
// Go to line chosen if any
|
||||
var cursor = cM.getCursor();
|
||||
top.ICEcoder.goToLine(cursor.line + 1, cursor.ch, false);
|
||||
|
||||
top.ICEcoder.codeZoomedOut = false;
|
||||
}
|
||||
top.ICEcoder.cmdKey = false;
|
||||
},
|
||||
},
|
||||
|
||||
// Add snippet code completion
|
||||
addSnippet: function() {
|
||||
@@ -4351,5 +4614,145 @@ var ICEcoder = {
|
||||
// Finally, focus on the editor
|
||||
top.ICEcoder.focus(top.ICEcoder.editorFocusInstance.indexOf('diff') > -1 ? true : false);
|
||||
}
|
||||
},
|
||||
|
||||
// Snart snake
|
||||
startSnake: function() {
|
||||
top.ICEcoder.snakePlaying = true;
|
||||
top.ICEcoder.showHide('show',top.get('blackMask'));
|
||||
top.get('mediaContainer').innerHTML = '<span style="font-size: 14px">Let\'s play<br><img src="images/snake.png" alt="snake"><br><br><br>Use arrow keys to eat your code<br><br>(it returns afterwards of course) :-)</span>';
|
||||
setTimeout(function() {
|
||||
top.ICEcoder.showHide('hide',top.get('blackMask'));
|
||||
top.get('mediaContainer').innerHTML = '';
|
||||
top.ICEcoder.playSnake();
|
||||
},2000);
|
||||
},
|
||||
|
||||
// Play snake
|
||||
playSnake: function() {
|
||||
var cM;
|
||||
|
||||
cM = ICEcoder.getcMInstance();
|
||||
cM.setOption('readOnly', 'nocursor');
|
||||
cM.focus();
|
||||
|
||||
// Get state of editor at present
|
||||
top.ICEcoder.snakePreHistory = cM.getHistory();
|
||||
top.ICEcoder.snakePreContent = cM.getValue();
|
||||
top.ICEcoder.snakePreCursor = cM.getCursor();
|
||||
|
||||
// Pick a random point for snake to come in and set head and 4 body parts off screen
|
||||
var randPos = Math.floor(Math.random()*50);
|
||||
top.ICEcoder.snakePos = [
|
||||
[randPos,0],
|
||||
[randPos,-1],
|
||||
[randPos,-2],
|
||||
[randPos,-3],
|
||||
[randPos,-4]
|
||||
];
|
||||
|
||||
// Show game layer, set direction and do 1st frame of snake
|
||||
top.ICEcoder.content.contentWindow.document.getElementById('game').style.display = 'block';
|
||||
top.ICEcoder.snakeDir = "down";
|
||||
top.ICEcoder.doSnake();
|
||||
|
||||
// Every 0.1s, move snake
|
||||
top.ICEcoder.snakeInt = setInterval(function() {
|
||||
// Set new head X & Y pos according to direction
|
||||
var newHead = [];
|
||||
newHead[0] = top.ICEcoder.snakePos[0][0]+(top.ICEcoder.snakeDir == "right" ? 1 : top.ICEcoder.snakeDir == "left" ? -1 : 0);
|
||||
newHead[1] = top.ICEcoder.snakePos[0][1]+(top.ICEcoder.snakeDir == "down" ? 1 : top.ICEcoder.snakeDir == "up" ? -1 : 0);
|
||||
// Add new head and remove tail
|
||||
top.ICEcoder.snakePos.unshift(newHead);
|
||||
top.ICEcoder.snakePos.pop();
|
||||
// Do next frame of snake
|
||||
top.ICEcoder.doSnake();
|
||||
},100);
|
||||
},
|
||||
|
||||
doSnake: function() {
|
||||
var cM, cW, cH, newInnerHTML, lineData, lineContent, spaceReplaceChars, collision, scrollInfo;
|
||||
|
||||
// Get CodeMirror instance, plus char width and height
|
||||
cM = ICEcoder.getcMInstance();
|
||||
cW = cM.defaultCharWidth();
|
||||
cH = cM.defaultTextHeight();
|
||||
|
||||
// Clear content of game layer
|
||||
top.ICEcoder.content.contentWindow.document.getElementById('game').innerHTML = "";
|
||||
// Start a new set of contents
|
||||
newInnerHTML = "";
|
||||
// For every part of snake, draw it's block in position
|
||||
for (var i=0; i<top.ICEcoder.snakePos.length; i++) {
|
||||
newInnerHTML += '<div style="position: absolute; diplay: inline-block; width: '+cW+'px; height: '+cH+'px; top: '+((top.ICEcoder.snakePos[i][1]*cH)+4)+'px; left: '+((top.ICEcoder.snakePos[i][0]*cW)+60)+'px; background: #fff"></div>';
|
||||
}
|
||||
// Set new content in game layer
|
||||
top.ICEcoder.content.contentWindow.document.getElementById('game').innerHTML = newInnerHTML;
|
||||
|
||||
// Get line & ch value under snake head then line content
|
||||
lineData = cM.coordsChar({top: ((top.ICEcoder.snakePos[0][1]*cH)+4), left: ((top.ICEcoder.snakePos[0][0]*cW)+60)});
|
||||
lineContent = cM.getLine(lineData.line);
|
||||
|
||||
// If not the last char on the line
|
||||
if (top.ICEcoder.snakePos[0][0]-1 <= lineContent.length-2) {
|
||||
spaceReplaceChars = "";
|
||||
// If char under snake head is a tab, replace string contains spaces of same width
|
||||
if (lineContent.substr(lineData.ch,1) === "\t") {
|
||||
for (var i=0; i<cM.getOption('tabSize'); i++) {
|
||||
spaceReplaceChars += " ";
|
||||
}
|
||||
// Else replace string is a single space
|
||||
} else {
|
||||
spaceReplaceChars = " ";
|
||||
}
|
||||
// Push a duplicate of tail onto end, to increase snake length by 1 block
|
||||
top.ICEcoder.snakePos.push([top.ICEcoder.snakePos[top.ICEcoder.snakePos.length-1][0],top.ICEcoder.snakePos[top.ICEcoder.snakePos.length-1][1]]);
|
||||
// Replace char under head with nothing if end of line, else with our replacement string
|
||||
cM.doc.replaceRange(top.ICEcoder.snakePos[0][0]-1 == lineContent.length-2 ? "" : spaceReplaceChars,lineData,{line: lineData.line, ch: lineData.ch+1});
|
||||
// Remove any trailing space at end
|
||||
if (top.ICEcoder.snakePos[0][0]-1 == lineContent.length-2) {
|
||||
cM.doc.replaceRange(cM.getLine(lineData.line).replace(/[ \t]+$/,''),{line: lineData.line, ch: 0},{line: lineData.line, ch: 1000000});
|
||||
}
|
||||
} else {
|
||||
// Reduce snake length if over 5 chars and not on content
|
||||
if (top.ICEcoder.snakePos.length >= 5) {
|
||||
top.ICEcoder.snakePos.pop();
|
||||
}
|
||||
}
|
||||
// Detect if snake head has collided into itself
|
||||
collision = false;
|
||||
for (var i=1; i<top.ICEcoder.snakePos.length; i++) {
|
||||
if (top.ICEcoder.snakePos[i][0] == top.ICEcoder.snakePos[0][0] && top.ICEcoder.snakePos[i][1] == top.ICEcoder.snakePos[0][1]) {
|
||||
collision = true;
|
||||
}
|
||||
}
|
||||
// Get scroll info to get width and height of editor area shown
|
||||
scrollInfo = cM.getScrollInfo();
|
||||
if (
|
||||
// If snake out of bounds or a collision, game over!
|
||||
top.ICEcoder.snakePos[0][0] < 0 || top.ICEcoder.snakePos[0][1] < 0 ||
|
||||
((top.ICEcoder.snakePos[0][0]*cW)+60) > scrollInfo.clientWidth || ((top.ICEcoder.snakePos[0][1]*cH)+4) > scrollInfo.clientHeight ||
|
||||
collision
|
||||
) {
|
||||
// Clear interval and hide game layer
|
||||
clearInterval(top.ICEcoder.snakeInt);
|
||||
top.ICEcoder.content.contentWindow.document.getElementById('game').style.display = 'none';
|
||||
// Set content, saved point, saved contents and history back to what they were pre game
|
||||
cM.setValue(top.ICEcoder.snakePreContent);
|
||||
top.ICEcoder.savedPoints[top.ICEcoder.selectedTab-1] = cM.changeGeneration();
|
||||
top.ICEcoder.savedContents[top.ICEcoder.selectedTab-1] = top.ICEcoder.snakePreContent;
|
||||
cM.setHistory(top.ICEcoder.snakePreHistory);
|
||||
// Redo changes indicator in title tag and tab highlight save indicator also to what they are now (pre game state)
|
||||
top.ICEcoder.indicateChanges();
|
||||
top.ICEcoder.redoTabHighlight(top.ICEcoder.selectedTab);
|
||||
// Set editor to be editable again
|
||||
cM.setOption('readOnly', false);
|
||||
// Set cursor back to what it was pre game and focus on editor
|
||||
cM.setCursor(top.ICEcoder.snakePreCursor);
|
||||
cM.focus();
|
||||
// State we are no longer playing snake
|
||||
top.ICEcoder.snakePlaying = false;
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
361
lib/ice-coder.min.js
vendored
@@ -1,149 +1,155 @@
|
||||
var get=function(a){return top.document.getElementById(a)},ICEcoder={filesW:250,minFilesW:14,maxFilesW:250,selectedTab:0,savedPoints:[],savedContents:[],canSwitchTabs:!0,openFiles:[],openFileMDTs:[],openFileVersions:[],cMInstances:[],nextcMInstance:1,selectedFiles:[],findMode:!1,scrollbarVisible:!1,mouseDown:!1,mouseDownInCM:!1,mouseDownMinimap:!1,draggingFilesW:!1,draggingTab:!1,draggingWithKey:!1,tabLeftPos:[],tabBGcurrent:"#1d1d1b",tabBGselected:"#49d",tabBGopen:"#c3c3c3",tabBGnormal:"transparent",
|
||||
tabFGcurrent:"#fff",tabFGselected:"#fff",tabFGopenFile:"#000",tabFGnormalFile:"#eee",tabFGnormalTab:"#888",serverQueueItems:[],miniMapBoxTop:0,miniMapBoxHeight:0,previewWindow:!1,previewWindowLoading:!1,pluginIntervalRefs:[],overPopup:!1,cmdKey:!1,oppTagReplaceData:[],fmReady:!1,bugReportStatus:"off",bugReportPath:"",bugFilesSizesSeen:[],bugFilesSizesActual:[],githubDiff:!1,githubAuthTokenSet:!1,splitPane:!1,splitPaneLeftPerc:100,renderLineStyle:[],renderPaneShiftAmount:0,debounce:"",editorFocusInstance:"",
|
||||
openSeconds:0,ready:!1,initAliases:function(){for(var a="header files fileOptions optionsFile optionsEdit optionsSource optionsHelp filesFrame editor tabsBar findBar content terminal footer nestValid versionsDisplay splitPaneControls splitPaneNamesMain splitPaneNamesDiff charDisplay byteDisplay docExplorer miniMap miniMapContainer miniMapContent functionClassList".split(" "),b=0;b<a.length;b++)ICEcoder[a[b]]=top.get(a[b])},init:function(){top.ICEcoder.lockedNav||(top.ICEcoder.filesW=ICEcoder.minFilesW);
|
||||
ICEcoder.setLayout();top.ICEcoder.overFileFolder("folder","|");top.ICEcoder.selectFileFolder("init");top.ICEcoder.filesFrame.contentWindow.focus();top.ICEcoder.showHide("hide",top.get("loadingMask"));top.ICEcoder.autoOpenInt=setInterval(function(){top.ICEcoder.fmReady&&(top.ICEcoder.openLastFiles&&setTimeout(function(){top.ICEcoder.autoOpenFiles()},200),clearInterval(top.ICEcoder.autoOpenInt))},4);setInterval(ICEcoder.updateNestingIndicator,30);top.ICEcoder.startBugChecking();top.ICEcoder.autoLogoutTimer=
|
||||
tabFGcurrent:"#fff",tabFGselected:"#fff",tabFGopenFile:"#000",tabFGnormalFile:"#eee",tabFGnormalTab:"#888",prevTab:0,serverQueueItems:[],miniMapBoxTop:0,miniMapBoxHeight:0,previewWindow:!1,previewWindowLoading:!1,pluginIntervalRefs:[],overPopup:!1,cmdKey:!1,codeZoomedOut:!1,showingTool:!1,oppTagReplaceData:[],fmReady:!1,bugReportStatus:"off",bugReportPath:"",bugFilesSizesSeen:[],bugFilesSizesActual:[],githubDiff:!1,githubAuthTokenSet:!1,splitPane:!1,splitPaneLeftPerc:100,renderLineStyle:[],renderPaneShiftAmount:0,
|
||||
debounce:"",editorFocusInstance:"",openSeconds:0,indexing:!1,ready:!1,initAliases:function(){for(var a="header files fileOptions optionsFile optionsEdit optionsSource optionsHelp filesFrame editor tabsBar findBar terminal output database git content tools footer nestValid versionsDisplay splitPaneControls splitPaneNamesMain splitPaneNamesDiff charDisplay byteDisplay docExplorer miniMap miniMapContainer miniMapContent functionClassList".split(" "),b=0;b<a.length;b++)ICEcoder[a[b]]=top.get(a[b])},init:function(){top.ICEcoder.lockedNav||
|
||||
(top.ICEcoder.filesW=ICEcoder.minFilesW);ICEcoder.setLayout();top.ICEcoder.overFileFolder("folder","|");top.ICEcoder.selectFileFolder("init");top.ICEcoder.filesFrame.contentWindow.focus();top.ICEcoder.showHide("hide",top.get("loadingMask"));top.ICEcoder.autoOpenInt=setInterval(function(){top.ICEcoder.fmReady&&(top.ICEcoder.openLastFiles&&top.ICEcoder.autoOpenFiles(),clearInterval(top.ICEcoder.autoOpenInt))},4);setInterval(ICEcoder.updateNestingIndicator,30);top.ICEcoder.startBugChecking();top.ICEcoder.autoLogoutTimer=
|
||||
0;top.ICEcoder.oneSecondInt=setInterval(function(){top.ICEcoder.autoLogoutTimer++;for(var a=!1,b=1;b<=ICEcoder.savedPoints.length;b++)ICEcoder.savedPoints[b-1]!=top.ICEcoder.getcMInstance(b).changeGeneration()&&(a=!0);!a&&1<top.ICEcoder.autoLogoutMins&&top.ICEcoder.autoLogoutTimer==60*top.ICEcoder.autoLogoutMins-60&&top.ICEcoder.autoLogoutWarningScreen();get("autoLogoutIFrame")&&get("autoLogoutIFrame").contentWindow.document.getElementById("timeRemaning")&&(get("autoLogoutIFrame").contentWindow.document.getElementById("timeRemaning").innerHTML=
|
||||
0<top.ICEcoder.autoLogoutTimer?60*top.ICEcoder.autoLogoutMins-top.ICEcoder.autoLogoutTimer:0);!a&&0<ICEcoder.autoLogoutMins&&top.ICEcoder.autoLogoutTimer>=60*top.ICEcoder.autoLogoutMins&&top.ICEcoder.logout("autoLogout");top.ICEcoder.openSeconds++;0==top.ICEcoder.openSeconds%300&&(top.ICEcoder.filesFrame.contentWindow.frames.pingActive.location.href="lib/session-active-ping.php")},1E3);top.ICEcoder.ready=!0},setLayout:function(a){var b,c;b=window.innerWidth;c=window.innerHeight;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.optionsFile.style.width=this.optionsEdit.style.width=this.optionsSource.style.width=this.optionsHelp.style.width=this.filesW-60+"px";this.filesFrame.style.height=c-25-35+"px";this.nestValid.style.left=this.filesW+10+"px";this.versionsDisplay.style.left=this.filesW+25+"px";this.splitPaneControls.style.left=parseInt((b-this.filesW)/2,10)-25-4+this.filesW-100+"px";this.splitPaneNamesMain.style.left=
|
||||
parseInt(.25*(b-this.filesW),10)-50+this.filesW-60+"px";this.splitPaneNamesDiff.style.left=parseInt(.75*(b-this.filesW),10)-50+this.filesW-135+"px";top.ICEcoder.setTabWidths();a||(this.editor.style.width=ICEcoder.content.style.width=b-this.filesW-200+"px",ICEcoder.terminal.style.width=b-this.filesW+"px",ICEcoder.content.style.height=c-25-21-28-26+"px",ICEcoder.terminal.style.height=c+"px",setTimeout(function(){for(var a=0;a<top.ICEcoder.openFiles.length;a++)top.ICEcoder.splitPane||top.ICEcoder.content.contentWindow["cM"+
|
||||
ICEcoder.cMInstances[a]].setSize(top.ICEcoder.splitPaneLeftPerc+"%",top.ICEcoder.content.style.height),top.ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[a]+"diff"].setSize(100-top.ICEcoder.splitPaneLeftPerc+"%",top.ICEcoder.content.style.height),top.ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[a]+"diff"].getWrapperElement().style.left=top.ICEcoder.splitPaneLeftPerc+"%",top.ICEcoder.splitPane&&top.ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[a]].setSize(top.ICEcoder.splitPaneLeftPerc+
|
||||
"%",top.ICEcoder.content.style.height);this.docExplorer.style.height=top.ICEcoder.content.style.height;top.ICEcoder.splitPane?top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").style.right=top.ICEcoder.scrollBarVisible?parseInt(parseInt(ICEcoder.content.style.width,10)/2,10)+17+"px":parseInt(parseInt(ICEcoder.content.style.width,10)/2,10)+"px":top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").style.right=top.ICEcoder.scrollBarVisible?"17px":"0"},4))},setSplitPane:function(a){var b;
|
||||
top.ICEcoder.splitPane="on"==a?!0:!1;top.get("splitPaneControlsOff").style.opacity=top.ICEcoder.splitPane?.5:1;top.get("splitPaneControlsOn").style.opacity=top.ICEcoder.splitPane?1:.5;top.get("splitPaneNamesMain").style.opacity=top.get("splitPaneNamesDiff").style.opacity=top.ICEcoder.splitPane?1:0;top.ICEcoder.setLayout();if(top.ICEcoder.splitPane)top.ICEcoder.updateDiffs(),b=top.ICEcoder.getcMInstance(),top.ICEcoder.cMonScroll(b,"cM"+ICEcoder.cMInstances[ICEcoder.selectedTab-1]);else if(b=top.ICEcoder.getcMInstance(),
|
||||
a=top.ICEcoder.getcMdiffInstance(),b){cMmarks=b.getAllMarks();for(b=0;b<cMmarks.length;b++)cMmarks[b].clear();cMdiffMarks=a.getAllMarks();for(b=0;b<cMdiffMarks.length;b++)cMdiffMarks[b].clear()}"undefined"!=typeof top.ICEcoder.animSplitPaneInt&&clearInterval(top.ICEcoder.animSplitPaneInt);top.ICEcoder.animSplitPaneInt=setInterval(function(){top.ICEcoder.splitPane&&50.1<top.ICEcoder.splitPaneLeftPerc?top.ICEcoder.splitPaneLeftPerc=(top.ICEcoder.splitPaneLeftPerc-50)/1.8+50:!top.ICEcoder.splitPane&&
|
||||
99.9>top.ICEcoder.splitPaneLeftPerc?top.ICEcoder.splitPaneLeftPerc=50-(100-top.ICEcoder.splitPaneLeftPerc)/1.8+50:(top.ICEcoder.splitPaneLeftPerc=top.ICEcoder.splitPane?50:100,clearInterval(top.ICEcoder.animSplitPaneInt));top.ICEcoder.setLayout()},4)},docExplorerShow:function(a){var b;"terminal"==a?(get("terminal").style.display="block",setTimeout(function(){top.ICEcoder.terminal.contentWindow.document.getElementById("command").focus()},0)):(get("terminal").style.display="none",get("miniMap").style.display=
|
||||
"miniMap"==a?"block":"none",get("functionClassList").style.display="functionClassList"==a?"block":"none","miniMap"==a&&(top.miniMapInt=setInterval(function(){0!=get("miniMapContent").getBoundingClientRect().height&&(b=top.ICEcoder.getcMInstance(),top.ICEcoder.setMinimapLayout(b),clearInterval(top.miniMapInt))},10)))},changeFilesW:function(a){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(){top.ICEcoder.ready&&"w-resize"==top.document.body.style.cursor?top.ICEcoder.mouseDown&&"gutter"==top.ICEcoder.mouseDownInCM&&(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.filesFrame.style.width=top.ICEcoder.filesW+"px",top.ICEcoder.setLayout(),top.ICEcoder.draggingFilesW=!0):top.ICEcoder.draggingFilesW=!1},
|
||||
lockUnlockNav:function(){var a;a=top.ICEcoder.filesFrame.contentWindow.document.getElementById("fmLock");ICEcoder.lockedNav=!ICEcoder.lockedNav;a.style.backgroundPosition=ICEcoder.lockedNav?"0 0":"-16px 0"},showHidePlugins:function(a){get("plugins").style.width="show"==a?"55px":"3px";get("plugins").style.background="show"==a?"#333":"transparent";"show"==a&&ICEcoder.changeFilesW("expand")},cMonFocus:function(a,b){top.ICEcoder.getCaretPosition();top.ICEcoder.updateCharDisplay();top.ICEcoder.updateByteDisplay();
|
||||
top.ICEcoder.editorFocusInstance=b;top.ICEcoder.getCaretPosition()},cMonBlur:function(a,b){},cMonKeyUp:function(a,b){"undefined"!=typeof top.doFind&&clearInterval(top.doFind);top.doFind=setTimeout(function(){top.ICEcoder.findReplace(top.get("find").value,!0,!1)},500);top.ICEcoder.getCaretPosition();top.ICEcoder.updateCharDisplay();top.ICEcoder.updateByteDisplay()},cMonCursorActivity:function(a,b){var c;top.ICEcoder.getCaretPosition();top.ICEcoder.updateCharDisplay();top.ICEcoder.updateByteDisplay();
|
||||
a.removeLineClass(top.ICEcoder["cMActiveLine"+b],"background");a.getCursor("start").line==a.getCursor().line&&(top.ICEcoder["cMActiveLine"+b]=a.addLineClass(a.getCursor().line,"background","cm-s-activeLine"));"CSS"==top.ICEcoder.caretLocType&&top.ICEcoder.cssColorPreview();c=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?top.ICEcoder.prevLineDiff:top.ICEcoder.prevLine;c!=a.getCursor().line&&a.getLine(c)&&0<a.getLine(c).length&&0==a.getLine(c).replace(/\s/g,"").length&&a.replaceRange("",{line:c,
|
||||
ch:0},{line:c,ch:1E6});setTimeout(function(){for(var c,e=0;e<top.ICEcoder.renderLineStyle.length;e++){c=!1;if("diff"!=top.ICEcoder.renderLineStyle[e][0]&&-1==b.indexOf("diff")||"diff"==top.ICEcoder.renderLineStyle[e][0]&&-1<b.indexOf("diff"))c=!0;c&&a.getCursor().line+1==top.ICEcoder.renderLineStyle[e][1]?a.setOption("cursorHeight",a.defaultTextHeight()/a.lineInfo(a.getCursor().line).handle.height):a.setOption("cursorHeight",1)}},0)},cMonBeforeChange:function(a,b,c,d){var e,f;b=a.listSelections();
|
||||
for(var g=0;g<b.length;g++)e=d.findMatchingTag(a,b[g].anchor),0!==c.text[0].indexOf(">")&&"undefined"!=typeof e&&"undo"!=c.origin&&"redo"!=c.origin&&"undefined"!=typeof e.open&&"undefined"!=typeof e.close&&(f="open"==e.at?"close":"open",null!==e[f]&&(e=e[f].tag+";"+e[f].from.line+":"+e[f].from.ch,-1==top.ICEcoder.oppTagReplaceData.indexOf(e)&&top.ICEcoder.oppTagReplaceData.push(e)))},cMonChange:function(a,b,c,d){var e,f,g,k,h,l,p,n,m,r;b=a.listSelections();top.ICEcoder.loadingFile?setTimeout(function(){a.replaceRange("X",
|
||||
{line:1,ch:1},{line:1,ch:1});a.undo();a.clearHistory();top.ICEcoder.savedPoints[top.ICEcoder.selectedTab-1]=a.changeGeneration();top.ICEcoder.savedContents[top.ICEcoder.selectedTab-1]=a.getValue()},0):top.ICEcoder.redoTabHighlight(top.ICEcoder.selectedTab);setTimeout(function(){top.ICEcoder.scrollBarVisible=a.getScrollInfo().height>a.getScrollInfo().clientHeight;top.ICEcoder.setLayout()},0);if("undefined"!=typeof top.ICEcoder.oppTagReplaceData[0])for(var t=0;t<top.ICEcoder.oppTagReplaceData.length;t++)e=
|
||||
top.ICEcoder.oppTagReplaceData[t].split(";"),f=e[0],g=1*e[1].split(":")[0],k=1*e[1].split(":")[1],b[t]&&(h=d.findMatchingTag(a,b[t].anchor)),"undefined"!=typeof h&&(f="open"==h.at?h.open.tag:h.close.tag,"undefined"!=typeof c.from&&(l=g==c.from.line?c.text[0].length-c.removed[0].length:0,p="close"==h.at&&g==c.from.line?c.removed[0].length-c.text[0].length+1:1,n={line:g,ch:k+l+("open"==h.at?2:p)},l={line:g,ch:k+l+("open"==h.at?2:p)+e[0].length})),""!=f.trim()&&"undefined"!=typeof n&&"undefined"!=typeof l&&
|
||||
a.getRange(n,l)==e[0]&&(a.replaceRange(f,n,l),"close"==h.at&&(top.ICEcoder.autocompleteSkip=!0));top.ICEcoder.oppTagReplaceData=[];top.ICEcoder.getCaretPosition();top.ICEcoder.updateCharDisplay();top.ICEcoder.updateByteDisplay();top.ICEcoder.updateNestingIndicator();top.ICEcoder.findMode&&(top.ICEcoder.results.splice(top.ICEcoder.findResult,1),top.get("results").innerHTML=top.ICEcoder.results.length+" "+top.t.results,top.ICEcoder.findMode=!1);top.ICEcoder.updateFunctionClassList();"undefined"!=typeof top.doMiniNav&&
|
||||
clearTimeout(top.doMiniNav);top.doMiniNav=setTimeout(function(){top.ICEcoder.setMinimap()},top.ICEcoder.loadingFile?0:1E3);if(c=top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1])m=c.substr(c.lastIndexOf("/")+1),r=m.substr(m.lastIndexOf(".")+1);top.ICEcoder.splitPane&&setTimeout(function(){top.ICEcoder.updateDiffs()},0);c&&top.ICEcoder.previewWindow.location&&"/[NEW]"!=c&&top.ICEcoder.updatePreviewWindow(a,c,m,r);top.ICEcoder.indicateChanges()},cMonUpdate:function(a,b){setTimeout(function(){get("docExplorer").style.background=
|
||||
window.getComputedStyle(a.getWrapperElement(),null).getPropertyValue("background")},0);top.ICEcoder.setMinimapLayout(a,b)},cMonScroll:function(a,b){var c,d,e;top.ICEcoder.mouseDown=!1;top.ICEcoder.mouseDownInCM=!1;top.ICEcoder.splitPane&&(c=top.ICEcoder.getcMInstance(),d=top.ICEcoder.getcMdiffInstance(),e=-1<b.indexOf("diff")?c:d,c&&setTimeout(function(){e.scrollTo(a.getScrollInfo().left,a.getScrollInfo().top)},0));top.ICEcoder.setMinimapLayout(a,b)},cMonInputRead:function(a,b){"keypress"==top.ICEcoder.autoComplete&&
|
||||
top.ICEcoder.codeAssist&&!a.state.completionActive&&(top.ICEcoder.autocompleteSkip?top.ICEcoder.autocompleteSkip=!1:top.ICEcoder.autocomplete())},cMonGutterClick:function(a,b,c,d,e){top.ICEcoder.mouseDownInCM="gutter"},cMonMouseDown:function(a,b){top.ICEcoder.mouseDownInCM="editor"},cMonDragOver:function(a,b,c){top.ICEcoder.setDragCursor(b,"editor")},cMonRenderLine:function(a,b,c,d){for(var e,f=0;f<top.ICEcoder.renderLineStyle.length;f++){e=!1;if("diff"!=top.ICEcoder.renderLineStyle[f][0]&&-1==b.indexOf("diff")||
|
||||
"diff"==top.ICEcoder.renderLineStyle[f][0]&&-1<b.indexOf("diff"))e=!0;e&&a.lineInfo(c).line+1==top.ICEcoder.renderLineStyle[f][1]&&(d.style[top.ICEcoder.renderLineStyle[f][2]]=top.ICEcoder.renderLineStyle[f][3])}},updateDiffs:function(){var a,b,c,d,e,f;top.ICEcoder.renderLineStyle=[];top.ICEcoder.renderPaneShiftAmount=0;a=top.ICEcoder.getcMInstance();b=top.ICEcoder.getcMdiffInstance();c=a?difflib.stringAsLines(a.getValue()):"";d=b?difflib.stringAsLines(b.getValue()):"";c=(new difflib.SequenceMatcher(c,
|
||||
d)).get_opcodes();if(a){e=a.getAllMarks();for(d=0;d<e.length;d++)e[d].clear();e=b.getAllMarks();for(d=0;d<e.length;d++)e[d].clear()}if(a&&""!=b.getValue())for(d=0;d<c.length;d++)if("equal"!==c[d][0]){if("replace"==c[d][0]){f=(c[d][4]-c[d][2]+1+top.ICEcoder.renderPaneShiftAmount)*a.defaultTextHeight();for(e=c[d][4]-1;e<=c[d][2]-1;e++)b.getLineHandle(e).height>a.defaultTextHeight()&&(f+=b.getLineHandle(e).height-a.defaultTextHeight());f>a.defaultTextHeight()&&top.ICEcoder.renderLineStyle.push(["main",
|
||||
c[d][2],"height",f+"px"]);for(e=0;e<c[d][2]-c[d][1];e++)f=top.ICEcoder.findStringDiffs(a.getLine(c[d][1]+e),b.getLine(c[d][3]+e)),a.markText({line:c[d][1]+e,ch:0},{line:c[d][3]+e+top.ICEcoder.renderPaneShiftAmount,ch:f[0]},{className:"diffGreyLighter"}),a.markText({line:c[d][1]+e,ch:f[0]},{line:c[d][3]+e+top.ICEcoder.renderPaneShiftAmount,ch:f[0]+f[1]},{className:"diffGrey"}),a.markText({line:c[d][1]+e,ch:f[0]+f[1]},{line:c[d][3]+e+top.ICEcoder.renderPaneShiftAmount,ch:1E6},{className:"diffGreyLighter"})}else a.markText({line:c[d][1],
|
||||
ch:0},{line:c[d][2]-1,ch:1E6},{className:"diffGreen"});"replace"!=c[d][0]&&c[d][1]==c[d][2]&&(top.ICEcoder.renderLineStyle.push(["main",c[d][2],"height",(c[d][4]-c[d][3]+1)*a.defaultTextHeight()+"px"]),a.markText({line:c[d][2]-1,ch:0},{line:c[d][2]-1,ch:1E6},{className:"diffNone"}));if("replace"==c[d][0]){f=(c[d][2]-c[d][4]+1-top.ICEcoder.renderPaneShiftAmount)*a.defaultTextHeight();for(e=c[d][4]-1;e<=c[d][2]-1;e++)a.getLineHandle(e).height>a.defaultTextHeight()&&(f+=a.getLineHandle(e).height-a.defaultTextHeight());
|
||||
f>a.defaultTextHeight()&&top.ICEcoder.renderLineStyle.push(["diff",c[d][4],"height",f+"px"]);for(e=0;e<c[d][4]-c[d][3];e++)f=top.ICEcoder.findStringDiffs(a.getLine(c[d][1]+e),b.getLine(c[d][3]+e)),b.markText({line:c[d][1]+e-top.ICEcoder.renderPaneShiftAmount,ch:0},{line:c[d][3]+e,ch:f[0]},{className:"diffGreyLighter"}),b.markText({line:c[d][1]+e-top.ICEcoder.renderPaneShiftAmount,ch:f[0]},{line:c[d][3]+e,ch:f[0]+f[2]},{className:"diffGrey"}),b.markText({line:c[d][1]+e-top.ICEcoder.renderPaneShiftAmount,
|
||||
ch:f[0]+f[2]},{line:c[d][3]+e,ch:1E6},{className:"diffGreyLighter"})}else b.markText({line:c[d][3],ch:0},{line:c[d][4]-1,ch:1E6},{className:"diffRed"});"replace"!=c[d][0]&&c[d][3]==c[d][4]&&(top.ICEcoder.renderLineStyle.push(["diff",c[d][4],"height",(c[d][2]-c[d][1]+1)*a.defaultTextHeight()+"px"]),b.markText({line:c[d][4]-1,ch:0},{line:c[d][4]-1,ch:1E6},{className:"diffNone"}));top.ICEcoder.renderPaneShiftAmount=c[d][2]-c[d][4]}},findStringDiffs:function(a,b){"undefined"==typeof a&&(a="");"undefined"==
|
||||
typeof b&&(b="");for(var c=0,d=a.length,e=b.length;a[c]&&a[c]==b[c];c++);for(;d>c&e>c&a[d-1]==b[e-1];d--)e--;return[c,d-c,e-c]},updatePreviewWindow:function(a,b,c,d){top.ICEcoder.previewWindow.location.pathname==b?-1<["htm","html","txt"].indexOf(d)?top.ICEcoder.previewWindow.document.documentElement.innerHTML=a.getValue():-1<["md"].indexOf(d)&&(top.ICEcoder.previewWindow.document.documentElement.innerHTML=mmd(a.getValue())):-1<["css"].indexOf(d)&&-1<top.ICEcoder.previewWindow.document.documentElement.innerHTML.indexOf(c)&&
|
||||
(a=a.getValue(),c=document.createElement("style"),c.type="text/css",c.id="ICEcoder"+b.replace(/\//g,"_"),c.styleSheet?c.styleSheet.cssText=a:c.appendChild(document.createTextNode(a)),top.ICEcoder.previewWindow.document.getElementById(c.id)&&top.ICEcoder.previewWindow.document.documentElement.removeChild(top.ICEcoder.previewWindow.document.getElementById(c.id)),top.ICEcoder.previewWindow.document.documentElement.appendChild(c));try{top.ICEcoder.doPesticide()}catch(e){}try{top.ICEcoder.doStatsJS("update")}catch(e){}try{top.ICEcoder.doResponsive()}catch(e){}},
|
||||
contentCleanUp:function(){var a,b;a=ICEcoder.getcMInstance();b=ICEcoder.getcMdiffInstance();a=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?b:a;b=a.getValue();b=b.replace(/<ICEcoder:\/:textarea>/g,"</textarea>");a.setValue(b);a.clearHistory();top.ICEcoder.savedPoints[top.ICEcoder.selectedTab-1]=a.changeGeneration();top.ICEcoder.savedContents[top.ICEcoder.selectedTab-1]=a.getValue()},undo:function(){var a,b;a=ICEcoder.getcMInstance();b=ICEcoder.getcMdiffInstance();(-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?
|
||||
b:a).undo()},redo:function(){var a,b;a=ICEcoder.getcMInstance();b=ICEcoder.getcMdiffInstance();(-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?b:a).redo()},indent:function(a){var b,c;b=ICEcoder.getcMInstance();c=ICEcoder.getcMdiffInstance();b=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?c:b;"more"==a?top.ICEcoder.content.contentWindow.CodeMirror.commands.indentMore(b):top.ICEcoder.content.contentWindow.CodeMirror.commands.indentLess(b)},moveLines:function(a){var b,c,d,e,f,g,k;b=top.ICEcoder.getcMInstance();
|
||||
c=top.ICEcoder.getcMdiffInstance();d=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?c:b;e=d.getCursor("start");f=d.getCursor("end");"up"==a&&0<e.line&&(g=e.line-1);"down"==a&&f.line<d.lineCount()-1&&(g=f.line+1);isNaN(g)||(k=d.getLine(g),d.operation(function(){if("up"==a)for(var b=e.line;b<=f.line;b++)d.replaceRange(d.getLine(b),{line:b-1,ch:0},{line:b-1,ch:1E6});else for(b=f.line;b>=e.line;b--)d.replaceRange(d.getLine(b),{line:b+1,ch:0},{line:b+1,ch:1E6});d.replaceRange(k,{line:"up"==a?f.line:
|
||||
e.line,ch:0},{line:"up"==a?f.line:e.line,ch:1E6});d.setSelection({line:e.line+("up"==a?-1:1),ch:e.ch},{line:f.line+("up"==a?-1:1),ch:f.ch})}))},highlightLine:function(a){var b,c;b=top.ICEcoder.getcMInstance();c=top.ICEcoder.getcMdiffInstance();b=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?c:b;b.setSelection({line:a,ch:0},{line:a,ch:b.lineInfo(a).text.length})},focus:function(a){var b,c;/iPhone|iPad|iPod/i.test(navigator.userAgent)||(b=top.ICEcoder.getcMInstance(),c=top.ICEcoder.getcMdiffInstance(),
|
||||
(a=a?c:b)&&a.focus())},goToLine:function(a){var b,c,d;a=a?a-1:top.get("goToLineNo").value-1;b=ICEcoder.getcMInstance();c=ICEcoder.getcMdiffInstance();d=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?c:b;top.ICEcoder.scrollingOnLine=d.getCursor().line;"undefined"!=typeof top.ICEcoder.scrollInt&&clearInterval(top.ICEcoder.scrollInt);top.ICEcoder.scrollInt=setInterval(function(){top.ICEcoder.scrollingOnLine+=(a-top.ICEcoder.scrollingOnLine)/5;d.scrollTo(0,d.defaultTextHeight()*top.ICEcoder.scrollingOnLine-
|
||||
d.getScrollInfo().clientHeight/10);top.ICEcoder.setMinimapLayout(d);Math.round(top.ICEcoder.scrollingOnLine)==a&&clearInterval(top.ICEcoder.scrollInt)},10);d.setCursor(a);top.ICEcoder.focus();setTimeout(function(){top.ICEcoder.focus()},0);return!1},lineCommentToggle:function(){var a,b,c,d;a=ICEcoder.getcMInstance();b=ICEcoder.getcMdiffInstance();a=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?b:a;b=a.getCursor().ch;c=a.getCursor().line;d=a.getLine(c);ICEcoder.lineCommentToggleSub(a,b,c,d,d.length)},
|
||||
tagWrapper:function(a){var b,c,d,e,f;b=ICEcoder.getcMInstance();c=ICEcoder.getcMdiffInstance();d=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?c:b;b=a;"div"==a?(e=d.getCursor("start").line,f=d.getCursor().line,d.operation(function(){d.replaceSelection("<div>\n"+d.getSelection()+"\n</div>","around");for(var a=e+1;a<=f+1;a++)d.indentLine(a);d.indentLine(f+2,"prev");d.indentLine(f+2,"subtract")})):-1<["p","a","h1","h2","h3"].indexOf(a)&&d.getSelection().substr(0,a.length+1)=="<"+b&&d.getSelection().substr(-(a.length+
|
||||
3))=="</"+a+">"?d.replaceSelection(d.getSelection().substr(d.getSelection().indexOf(">")+1,d.getSelection().length-d.getSelection().indexOf(">")-1-a.length-3),"around"):("a"==a&&(b='a href=""'),d.replaceSelection("<"+b+">"+d.getSelection()+"</"+a+">","around"),"a"==a&&d.setCursor({line:d.getCursor("start").line,ch:d.getCursor("start").ch+9}))},addLineBreakAtEnd:function(a){var b,c;b=ICEcoder.getcMInstance();c=ICEcoder.getcMdiffInstance();b=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?c:b;a||
|
||||
(a=b.getCursor().line);b.replaceRange(b.getLine(a)+"<br>",{line:a,ch:0},{line:a,ch:1E6})},insertLineBefore:function(a){var b,c,d;b=ICEcoder.getcMInstance();c=ICEcoder.getcMdiffInstance();d=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?c:b;a||(a=d.getCursor().line);d.operation(function(){d.replaceRange("\n"+d.getLine(a),{line:a,ch:0},{line:a,ch:1E6});d.setCursor({line:d.getCursor().line-1,ch:0});d.execCommand("indentAuto")})},insertLineAfter:function(a){var b,c,d;b=ICEcoder.getcMInstance();c=
|
||||
ICEcoder.getcMdiffInstance();d=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?c:b;a||(a=d.getCursor().line);d.operation(function(){d.replaceRange(d.getLine(a)+"\n",{line:a,ch:0},{line:a,ch:1E6});d.execCommand("indentAuto")})},duplicateLines:function(a){var b,c,d;b=ICEcoder.getcMInstance();c=ICEcoder.getcMdiffInstance();b=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?c:b;!a&&b.somethingSelected()?(c=b.getCursor("start"),d=b.getCursor("end"),a=c.line!=d.line&&d.ch==b.getLine(d.line).length?
|
||||
"\n":"",b.replaceSelection(b.getSelection()+a+b.getSelection(),"end"),b.setSelection(c,d)):(a||(a=b.getCursor().line),c=b.getCursor().ch,b.replaceRange(b.getLine(a)+"\n"+b.getLine(a),{line:a,ch:0},{line:a,ch:1E6}),b.setCursor(a+1,c))},removeLines:function(a){var b,c;b=ICEcoder.getcMInstance();c=ICEcoder.getcMdiffInstance();b=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?c:b;!a&&b.somethingSelected()?b.replaceSelection("","end"):(a||(a=b.getCursor().line),c=b.getCursor().ch,b.execCommand("deleteLine"),
|
||||
b.setCursor(a-1,c))},jumpToDefinition:function(){var a,b;a=ICEcoder.getcMInstance();b=ICEcoder.getcMdiffInstance();a=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?b:a;b=a.getTokenAt(a.getCursor()).string;if(a.somethingSelected()&&top.ICEcoder.origCurorPos)a.setCursor(top.ICEcoder.origCurorPos);else for(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],b=0;b<a.length&&!top.ICEcoder.findReplace(a[b],!1,!1);b++);},updateFunctionClassList:function(){var a,b;a=ICEcoder.getcMInstance();top.ICEcoder.functionClassList=[];a&&(a.doc.eachLine(function(a){top.ICEcoder.updateFunctionClassListItems(a)}),setTimeout(function(){b="";for(var a=0;a<top.ICEcoder.functionClassList.length;a++)top.ICEcoder.functionClassList[a].verified&&(b+='<div onclick="top.ICEcoder.goToLine('+
|
||||
(top.ICEcoder.functionClassList[a].line+1)+')" class="functionClassListItem"><span class="name">'+top.ICEcoder.functionClassList[a].name+'</span><br><span class="params">'+top.ICEcoder.functionClassList[a].params+"</span></div>");get("functionClassList").innerHTML=b},0))},updateFunctionClassListItems:function(a){var b,c;b=ICEcoder.getcMInstance();c="";-1<a.text.indexOf("function ")&&-1<a.text.replace(/\$function/g,"").indexOf("function ")&&(c=a.text.substring(a.text.indexOf("function ")+9));-1<a.text.indexOf("class ")&&
|
||||
-1<a.text.replace(/\$class/g,"").indexOf("class ")&&(c=a.text.substring(a.text.indexOf("class ")+6));c=c.trim().split("{")[0].split("(");""!=c[0]&&(top.ICEcoder.functionClassList.push({line:b.getLineNumber(a),name:c[0],params:"("+(c[1]?c[1].replace(/[,]/g,", "):""),verified:!1}),setTimeout(function(){if(!a.styles||a.styles&&-1<a.styles.indexOf("def")&&b.getLineNumber(a))for(var c=0;c<top.ICEcoder.functionClassList.length;c++)top.ICEcoder.functionClassList[c].line==b.getLineNumber(a)&&(top.ICEcoder.functionClassList[c].verified=
|
||||
!0)},0))},setMinimap:function(){var a;if(a=ICEcoder.getcMInstance()){top.ICEcoder.content.contentWindow.CodeMirror.runMode(a.getValue(),a.getOption("mode"),get("miniMapContent"));get("miniMapContent").innerHTML='<div class="cm-s-'+top.ICEcoder.theme+'" style="font-family: monospace; white-space: '+(1==top.ICEcoder.lineWrapping?"pre-wrap":"pre")+'; font-size: 2px; line-height: 2px">'+get("miniMapContent").innerHTML+"</div>";get("miniMapContent").innerHTML=get("miniMapContent").innerHTML.replace(/\<span /g,
|
||||
'<span style="font-size: 2px; font-family: monospace" ');get("miniMapContainer").innerHTML='<div style="position: absolute; display: inline-block; top: '+top.ICEcoder.miniMapBoxTop+"px; left: 0; width: 200px; height: "+top.ICEcoder.miniMapBoxHeight+'px; background: rgba(0,198,255,0.1); z-index: 1; cursor: pointer" id="miniMapBox"></div>';var b=get("miniMapBox"),b=new Draggabilly(b,{axis:"y",containment:!0});b.on("dragMove",function(b,d,e){yPos=this.position.y;maxHeight=parseInt(get("docExplorer").style.height,
|
||||
10)<=parseInt(get("miniMapContent").getBoundingClientRect().height,10)?parseInt(get("docExplorer").style.height,10):parseInt(get("miniMapContent").getBoundingClientRect().height,10);newPerc=this.position.y/(maxHeight-top.ICEcoder.miniMapBoxHeight);yPos=(a.getScrollInfo().height-a.getScrollInfo().clientHeight)*newPerc;a.scrollTo(0,yPos)});b.on("pointerDown",function(a,b){top.ICEcoder.mouseDownMinimap=!0});b.on("pointerUp",function(a,b){top.ICEcoder.mouseDownMinimap=!1});top.ICEcoder.setMinimapLayout(a);
|
||||
get("docExplorer").style.right="-220px"}},setMinimapLayout:function(a,b){var c,d;get("miniMapBox")&&a&&(c=top.ICEcoder.getcMInstance(),d=a.getScrollInfo().top/(a.getScrollInfo().height-a.getScrollInfo().clientHeight),parseInt(get("miniMapContent").getBoundingClientRect().height,10)>parseInt(get("docExplorer").style.height,10)?(get("miniMapContainer").style.height=parseInt(get("docExplorer").style.height,10)+"px",top.ICEcoder.miniMapBoxHeight=parseInt(get("docExplorer").style.height,10)/c.defaultTextHeight()*
|
||||
2,get("miniMapBox").style.height=top.ICEcoder.miniMapBoxHeight+"px",top.ICEcoder.miniMapBoxTop=d*parseInt(get("docExplorer").style.height,10)-d*top.ICEcoder.miniMapBoxHeight,get("miniMapContent").style.marginTop=-(parseInt(get("miniMapContent").getBoundingClientRect().height,10)-parseInt(get("docExplorer").style.height,10))*d+"px"):(get("miniMapContainer").style.height=parseInt(get("miniMapContent").getBoundingClientRect().height,10)+"px",top.ICEcoder.miniMapBoxHeight=parseInt(get("docExplorer").style.height,
|
||||
10)/c.defaultTextHeight()*2,get("miniMapBox").style.height=top.ICEcoder.miniMapBoxHeight+"px",top.ICEcoder.miniMapBoxTop=d*parseInt(get("miniMapContainer").getBoundingClientRect().height,10)-d*top.ICEcoder.miniMapBoxHeight,get("miniMapContent").style.marginTop=0),top.ICEcoder.mouseDownMinimap||(get("miniMapBox").style.top=top.ICEcoder.miniMapBoxTop+"px"))},autocomplete:function(){var a,b;a=ICEcoder.getcMInstance();b=ICEcoder.getcMdiffInstance();a=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?
|
||||
b:a;top.ICEcoder.content.contentWindow.CodeMirror.commands.autocomplete(a)},pasteURL:function(a){var b,c;b=top.ICEcoder.getcMInstance();c=top.ICEcoder.getcMdiffInstance();b=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?c:b;"CTRL"==top.ICEcoder.draggingWithKey&&(a=window.location.protocol+"//"+window.location.hostname+a);b.replaceSelection(a,"around")},searchForSelected:function(){var a,b;a=top.ICEcoder.getcMInstance();b=top.ICEcoder.getcMdiffInstance();a=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?
|
||||
b:a;top.ICEcoder.caretLocType&&(""!=a.getSelection()?(b=top.ICEcoder.caretLocType.toLowerCase()+" ","Content"==top.ICEcoder.caretLocType&&(b=""),window.open("http://www.google.com/#output=search&q="+b+a.getSelection())):top.ICEcoder.message(top.t["No text selected..."]))},fmAction:function(a,b){var c,d,e,f;c=top.get("filesFrame").contentWindow.document.getElementById(top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1]+"_perms").parentNode;d=c.parentNode;e=-1<c.onmouseover.toString().indexOf("'folder'")?
|
||||
"folder":"file";f=!1;"up"==b&&(d.previousSibling&&d.previousSibling.previousSibling?(f=d.previousSibling.previousSibling,"UL"==f.tagName&&(f=f.childNodes[f.childNodes.length-1])):d.parentNode.previousSibling&&(f=d.parentNode.previousSibling),f&&(f=f.childNodes[0]));"down"==b&&(d.nextSibling&&d.nextSibling.childNodes[0]?f=d.nextSibling.childNodes[0]:d.nextSibling&&d.nextSibling.nextSibling?f=d.nextSibling.nextSibling:d.parentNode.nextSibling&&(f=d.parentNode.nextSibling.nextSibling),f&&(f=f.childNodes[0]));
|
||||
"left"==b&&"folder"==e&&d.parentNode.previousSibling&&top.ICEcoder.openCloseDir(c,!1);if("right"==b||"enter"==b)"folder"==e?top.ICEcoder.openCloseDir(c,!0):top.ICEcoder.openFile(c.childNodes[1].id.replace(/\|/g,"/"));f&&f.childNodes[1]&&(top.ICEcoder.overFileFolder(e,f.childNodes[1].id),top.ICEcoder.selectFileFolder(a))},openCloseDir:function(a,b){var c,d;a.onclick=function(a){a.ctrlKey||top.ICEcoder.cmdKey||top.ICEcoder.openCloseDir(this,!b)};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+"&csrf="+top.ICEcoder.csrf:"UL"==c.tagName&&c.parentNode.removeChild(c);return!1},overFileFolder:function(a,b){ICEcoder.thisFileFolderType=a;ICEcoder.thisFileFolderLink=b},isFileFolder:function(a){return(a=top.get("filesFrame").contentWindow.document.getElementById(a.replace(top.iceRoot,
|
||||
"").replace(/\/$/,"").replace(/\//g,"|")))?-1<a.parentNode.parentNode.className.indexOf("directory")?"folder":"file":!1},selectFileFolder:function(a,b,c){var d,e,f;if(""==top.ICEcoder.thisFileFolderLink)b||a.ctrlKey||top.ICEcoder.cmdKey||top.ICEcoder.deselectAllFiles();else if(top.ICEcoder.thisFileFolderLink)if(e=top.ICEcoder.thisFileFolderLink.replace(/\//g,"|"),d=top.ICEcoder.filesFrame.contentWindow.document.getElementById(e),b||a.ctrlKey||top.ICEcoder.cmdKey)-1<top.ICEcoder.selectedFiles.indexOf(e)?
|
||||
(ICEcoder.selectDeselectFile("deselect",d),top.ICEcoder.selectedFiles.splice(top.ICEcoder.selectedFiles.indexOf(e),1)):(ICEcoder.selectDeselectFile("select",d),top.ICEcoder.selectedFiles.push(e));else if(c||a.shiftKey){var g=function(a,b,c,d){return("00000000000000000000"+a).substr(-20)};a=!1;b=d.parentNode.parentNode.parentNode;f=top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1];c=e.replace(/\d+/g,g)<f.replace(/\d+/g,g)?e:f;f=e.replace(/\d+/g,g)>f.replace(/\d+/g,g)?e:f;if(0<top.ICEcoder.selectedFiles.length&&
|
||||
c.substr(0,c.lastIndexOf("|"))==f.substr(0,f.lastIndexOf("|")))for(e=0;1E6>e&&("LI"!=b.childNodes[e].nodeName&&e++,d=b.childNodes[e].childNodes[0].childNodes[1],d.id==c&&(a=!0),1==a&&-1==top.ICEcoder.selectedFiles.indexOf(d.id)&&(ICEcoder.selectDeselectFile("select",d),top.ICEcoder.selectedFiles.push(d.id)),d.id!=f);e+=2);else ICEcoder.selectDeselectFile("select",d),top.ICEcoder.selectedFiles.push(e)}else top.ICEcoder.deselectAllFiles(),ICEcoder.selectDeselectFile("select",d),top.ICEcoder.selectedFiles.push(e);
|
||||
top.ICEcoder.githubDiff&&(top.get("githubNavSelectedCount").innerHTML="Selected: "+top.ICEcoder.selectedFiles.length,top.get("githubNavCommit").style.color=0<top.ICEcoder.selectedFiles.length?"#fff":"#333",top.get("githubNavCommit").style.background=0<top.ICEcoder.selectedFiles.length?"#2187e7":"#555",top.get("githubNavSelectedCount").style.color=0<top.ICEcoder.selectedFiles.length?"#fff":"#333",top.get("githubNavPull").style.color=0<top.ICEcoder.selectedFiles.length?"#fff":"#333",top.get("githubNavPull").style.background=
|
||||
0<top.ICEcoder.selectedFiles.length?"#2187e7":"#555");document.findAndReplace.target[2].innerHTML=top.ICEcoder.selectedFiles[0]?top.t["selected files"]:top.t["all files"];document.findAndReplace.target[3].innerHTML=top.ICEcoder.selectedFiles[0]?top.t["selected filenames"]:top.t["all filenames"];top.ICEcoder.hideFileMenu()},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,top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1]==b.id.replace(/\|/g,"/")?b.style.backgroundColor="select"==a?top.ICEcoder.tabBGselected:top.ICEcoder.tabBGcurrent:b.style.backgroundColor="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)},boxSelect:function(a,b){var c,d;c=top.ICEcoder.filesFrame.contentWindow.document.getElementById("fmDragBox");"down"==b&&(top.ICEcoder.fmDragBoxStartX=top.ICEcoder.mouseX,top.ICEcoder.fmDragBoxStartY=top.ICEcoder.mouseY,top.ICEcoder.fmDragSelectFirst="",top.ICEcoder.fmDragSelectLast="");top.ICEcoder.mouseDown&&!top.ICEcoder.mouseDownInCM&&"drag"==b&&(top.ICEcoder.fmDraggedBox=!0,d=0<top.ICEcoder.mouseX-top.ICEcoder.fmDragBoxStartX,
|
||||
c.style.left=(d?top.ICEcoder.fmDragBoxStartX:top.ICEcoder.mouseX)+"px",c.style.width=Math.abs(top.ICEcoder.mouseX-top.ICEcoder.fmDragBoxStartX)+"px",d=0<top.ICEcoder.mouseY-top.ICEcoder.fmDragBoxStartY,c.style.top=(d?top.ICEcoder.fmDragBoxStartY-70:top.ICEcoder.mouseY-70)+"px",c.style.height=Math.abs(top.ICEcoder.mouseY-top.ICEcoder.fmDragBoxStartY)+"px",""!=top.ICEcoder.thisFileFolderLink&&(""==top.ICEcoder.fmDragSelectFirst?(top.ICEcoder.fmDragSelectFirst=top.ICEcoder.thisFileFolderLink,top.ICEcoder.overFileFolder(0<
|
||||
top.ICEcoder.thisFileFolderLink.indexOf(".")?"file":"folder",top.ICEcoder.fmDragSelectFirst),top.ICEcoder.selectFileFolder(a)):(top.ICEcoder.fmDragSelectLast=top.ICEcoder.thisFileFolderLink,top.ICEcoder.overFileFolder(0<top.ICEcoder.thisFileFolderLink.indexOf(".")?"file":"folder",top.ICEcoder.fmDragSelectLast),top.ICEcoder.selectFileFolder(a,!1,"shiftSim"))));"up"==b&&(c.style.width=0,c.style.height=0)},newFile:function(){top.ICEcoder.newTab("alsoSave")},newFolder:function(){var a,b;a=top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-
|
||||
1].replace(/\|/g,"/");if(b=top.ICEcoder.getInput("Enter new folder name at "+a,""))b=(a+"/"+b).replace(/\/\//,"/"),top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=newFolder&csrf="+top.ICEcoder.csrf,b.replace(/\//g,"|").replace(/\+/g,"%2B")),top.ICEcoder.serverMessage("<b>"+top.t["Creating Folder"]+"</b><br>"+b)},returnFileAndLine:function(a){var b=1,c=/^([^ ]*)\s+(on\s+)?(line\s+)?(\d+)/.exec(a);null!==c?(b=c[4],a=c[1]):0<a.indexOf("://")?a.lastIndexOf(":")!==a.indexOf("://")&&(b=
|
||||
a.split(":")[2],a=a.substr(0,a.lastIndexOf(":"))):0<a.indexOf(":")&&(b=a.split(":")[1],a=a.split(":")[0]);0<a.indexOf("(")&&0<a.indexOf(")")&&(b=a.split("(")[1].split(")")[0],a=a.split("(")[0]);return[a,b]},openFile:function(a){var b,c;"undefined"!=typeof a&&(b=top.ICEcoder.returnFileAndLine(a),a=b[0],b=b[1]);a&&(top.ICEcoder.thisFileFolderLink=a,top.ICEcoder.thisFileFolderType="file");"/[NEW]"!=top.ICEcoder.thisFileFolderLink&&!1!==top.ICEcoder.isOpen(top.ICEcoder.thisFileFolderLink)?(top.ICEcoder.switchTab(top.ICEcoder.isOpen(top.ICEcoder.thisFileFolderLink)+
|
||||
1),1<b&&top.ICEcoder.goToLine(b)):""!=top.ICEcoder.thisFileFolderLink&&"file"==top.ICEcoder.thisFileFolderType&&(a=top.ICEcoder.thisFileFolderLink.replace(/\|/g,"/"),c=!0,100<=top.ICEcoder.openFiles.length&&(top.ICEcoder.message(top.t["Sorry you can..."]),c=!1),c&&(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.replace(/\+/g,
|
||||
"%2B")+"&csrf="+top.ICEcoder.csrf+"&lineNumber="+b),top.ICEcoder.serverMessage("<b>"+top.t["Opening File"]+"</b><br>"+top.ICEcoder.shortURL)):top.ICEcoder.createNewTab("new"),top.ICEcoder.fMIconVis("fMView",1)))},openFilesFromList:function(a){for(var b=0;b<a.length;b++)top.ICEcoder.thisFileFolderLink=a[b].replace("|","/"),top.ICEcoder.thisFileFolderType="file",top.ICEcoder.openFile()},openPrompt:function(){var a;if(a=top.ICEcoder.getInput(top.t["Enter relative file..."],""))-1<a.indexOf("://")?top.ICEcoder.getRemoteFile(a):
|
||||
top.ICEcoder.openFile(a)},getRemoteFile:function(a){var b;"undefined"!=typeof a&&(b=top.ICEcoder.returnFileAndLine(a),a=b[0],b=b[1]);top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=getRemoteFile&csrf="+top.ICEcoder.csrf+"&lineNumber="+b,a.replace(/\+/g,"%2B"));top.ICEcoder.serverMessage("<b>"+top.t.Getting+"</b><br>"+a)},getChangesToSave:function(){var a,b;a=top.ICEcoder.getcMInstance();b=top.ICEcoder.savedContents[top.ICEcoder.selectedTab-1];a=difflib.stringAsLines(a.getValue());
|
||||
b=difflib.stringAsLines(b);b=(new difflib.SequenceMatcher(b,a)).get_opcodes();for(var c=0;c<b.length;c++)for(j=b[c][3];j<b[c][4];j++)"equal"!=b[c][0]&&("undefined"==typeof b[c][5]&&(b[c][5]=""),b[c][5]+=a[j]+"\n");return JSON.stringify(b)},saveFile:function(a){var b,c,d;a||(b=top.ICEcoder.getChangesToSave());a=a?"saveAs":"save";c=ICEcoder.openFiles[ICEcoder.selectedTab-1].replace(top.iceRoot,"").replace(/\//g,"|");"|[NEW]"==c&&0<top.ICEcoder.selectedFiles.length&&(d=top.ICEcoder.selectedFiles[0],
|
||||
c=-1==d.lastIndexOf(".")||d.lastIndexOf(".")<d.lastIndexOf("|")?d+c:"|[NEW]");c=c.replace("||","|");top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=save&fileMDT="+ICEcoder.openFileMDTs[ICEcoder.selectedTab-1]+"&fileVersion="+ICEcoder.openFileVersions[ICEcoder.selectedTab-1]+"&saveType="+a+"&csrf="+top.ICEcoder.csrf,c.replace(/\+/g,"%2B"),b);top.ICEcoder.serverMessage("<b>"+top.t.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.selectedFiles[top.ICEcoder.selectedFiles.length-1].replace(/\|/g,"/"),a=top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1].replace(/\|/g,"/"));b||(b=top.ICEcoder.getInput(top.t["Please enter the..."],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.get("tab"+(d+1)).innerHTML=closeTabLink+" "+c.slice(c.lastIndexOf("/")).replace(/\//,""),top.get("tab"+(d+1)).title=b),top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=rename&oldFileName="+a.replace(/\|/g,"/").replace(/\+/g,"%2B")+"&csrf="+top.ICEcoder.csrf,b.replace(/\+/g,"%2B")),top.ICEcoder.serverMessage("<b>"+top.t["Renaming to"]+"</b><br>"+b),top.ICEcoder.setPreviousFiles())},moveFile:function(a,b){var c,d;b&&b!=a&&(d=top.ICEcoder.openFiles.indexOf(a.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.get("tab"+(d+1)).innerHTML=closeTabLink+" "+c.slice(c.lastIndexOf("/")).replace(/\//,
|
||||
""),top.get("tab"+(d+1)).title=b),top.ICEcoder.ask("Are you sure you want to move file "+a+" to "+b+" ?")&&(top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=move&oldFileName="+a.replace(/\//g,"|").replace(/\+/g,"%2B")+"&csrf="+top.ICEcoder.csrf,b.replace(/\//g,"|").replace(/\+/g,"%2B")),top.ICEcoder.serverMessage("<b>"+top.t["Moving to"]+"</b><br>"+b)),top.ICEcoder.setPreviousFiles())},deleteFiles:function(a){var b;a=a?a:top.ICEcoder.selectedFiles;b=a.toString().replace(/\|/g,"/").replace(/,/g,
|
||||
"\n");0<a.length&&top.ICEcoder.ask("Delete:\n\n"+b+"?")&&(top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=delete&&csrf="+top.ICEcoder.csrf,a.join(";").replace(/\+/g,"%2B")),top.ICEcoder.serverMessage("<b>"+top.t["Deleting File"]+"</b><br>"+b))},copyFiles:function(a,b,c){top.ICEcoder.copiedFiles=[];for(var d=0;d<a.length;d++)top.ICEcoder.copiedFiles[d]=a[d];b||(top.get("fmMenuPasteOption").style.display="block");c||top.ICEcoder.hideFileMenu()},pasteFiles:function(a){if(top.ICEcoder.copiedFiles)for(var b=
|
||||
0;b<top.ICEcoder.copiedFiles.length;b++)"|"!=top.ICEcoder.copiedFiles[b]?(top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=paste&location="+a+"&csrf="+top.ICEcoder.csrf,top.ICEcoder.copiedFiles[b].replace(/\+/g,"%2B")),top.ICEcoder.serverMessage("<b>"+top.t["Pasting File"]+"</b><br>"+top.ICEcoder.copiedFiles[b].toString().replace(/\|/g,"/").replace(/,/g,"\n"))):top.ICEcoder.message(top.t["Sorry cannot paste..."]);else top.ICEcoder.message(top.t["Nothing to paste..."])},duplicateFiles:function(a){var b;
|
||||
top.ICEcoder.copiedFiles&&(b=top.ICEcoder.copiedFiles);top.ICEcoder.copyFiles(a,"dontShowPaste","dontHide");a=a[0].substr(0,a[0].lastIndexOf("|"));top.ICEcoder.pasteFiles(a);"undefined"!=typeof b&&(top.ICEcoder.copiedFiles=b)},uploadFilesSelect:function(a){top.get("uploadDir").value=a;top.get("fileInput").click()},uploadFilesSubmit:function(a){""!=top.get("fileInput").value&&(top.ICEcoder.showHide("show",top.get("loadingMask")),top.get("uploadFilesForm").submit(),event.preventDefault())},showHideFileNav:function(a,
|
||||
b){var c=["optionsFile","optionsEdit","optionsSource","optionsHelp"];if("hide"==a)fileNavInt=setTimeout(function(){for(var a=0;a<c.length;a++)top.ICEcoder.showHide("hide",top.get(c[a])),top.get(c[a]+"Nav").style.color=""},150);else for(var d=0;d<c.length;d++)top.ICEcoder.showHide("hide",top.get(c[d])),top.get(c[d]+"Nav").style.color="";get("fileOptions").style.opacity=0;"show"==a&&("undefined"!=typeof fileNavInt&&clearTimeout(fileNavInt),top.ICEcoder.showHide(a,top.get(b)),top.get(b+"Nav").style.color=
|
||||
"#fff",get("fileOptions").style.opacity=1)},isPathFolder:function(a){a=top.ICEcoder.filesFrame.contentDocument.getElementsByClassName("pft-directory");for(var b=top.ICEcoder.selectedFiles[0],c,d=0;d<a.length;d++)if(c=a[d],"underfined"!=typeof c&&(c=c.childNodes[0],"undefined"!=typeof c&&(c=c.childNodes[1],"undefined"!=typeof c&&b===c.getAttribute("id"))))return!0;return!1},checkExists:function(a){var b,c,d;a=a.replace(/\|/g,"/");0===a.indexOf(top.iceRoot)&&(a=a.replace(top.iceRoot,""));b=top.ICEcoder.xhrObj();
|
||||
b.onreadystatechange=function(){4==b.readyState&&(200==b.status?(c=JSON.parse(b.responseText),c.action.timeEnd=(new Date).getTime(),c.action.timeTaken=c.action.timeEnd-c.action.timeStart,0<=["raw","both"].indexOf(top.ICEcoder.fileDirResOutput)&&console.log(b.responseText),0<=["object","both"].indexOf(top.ICEcoder.fileDirResOutput)&&console.log(c),top.ICEcoder.lastFileDirCheckStatusObj=c,c.status.error?(top.ICEcoder.message(c.status.errorMsg),console.log("ICEcoder error info for your request..."),
|
||||
console.log(c),top.ICEcoder.serverMessage(),top.ICEcoder.serverQueue("del",0)):eval(c.action.doNext)):(top.ICEcoder.message(top.t["Sorry there was..."]),console.log("ICEcoder error info for your request..."),console.log(c),top.ICEcoder.serverMessage(),top.ICEcoder.serverQueue("del",0)))};b.open("POST","lib/file-control-xhr.php?action=checkExists&csrf="+top.ICEcoder.csrf,!0);b.setRequestHeader("Content-type","application/x-www-form-urlencoded");d=(new Date).getTime();b.send("timeStart="+d+"&file="+
|
||||
a.replace(/\+/g,"%2B"))},showMenu:function(a){var b,c;0!=top.ICEcoder.selectedFiles.length&&-1!=top.ICEcoder.selectedFiles.indexOf(top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1].replace(/\//g,"|"))||top.ICEcoder.selectFileFolder(a);a=129;c=window.innerHeight;"undefined"!=typeof top.ICEcoder.thisFileFolderLink&&""!=top.ICEcoder.thisFileFolderLink&&(b=this.isPathFolder(top.ICEcoder.selectedFiles[0])?"folder":"file",top.get("folderMenuItems").style.display="folder"==b&&1==top.ICEcoder.selectedFiles.length?
|
||||
"block":"none","folder"==b&&1==top.ICEcoder.selectedFiles.length&&(a+=67,"block"==top.get("fmMenuPasteOption").style.display&&(a+=19)),top.get("singleFileMenuItems").style.display=1<top.ICEcoder.selectedFiles.length?"none":"block",1==top.ICEcoder.selectedFiles.length&&(a+=43),top.get("fileMenu").style.display="inline-block",setTimeout(function(){top.get("fileMenu").style.opacity="1"},4),top.get("fileMenu").style.left=top.ICEcoder.mouseX+20+"px",b=top.ICEcoder.mouseY-top.ICEcoder.filesFrame.contentWindow.document.body.scrollTop-
|
||||
10,b+a>c&&(b-=b+a-c),top.get("fileMenu").style.top=b+"px");return!1},showFileMenu:function(){top.get("fileMenu").style.display="inline-block";setTimeout(function(){top.get("fileMenu").style.opacity="1"},4)},hideFileMenu:function(){top.get("fileMenu").style.display="none";top.get("fileMenu").style.opacity="0"},updateFileManagerList:function(a,b,c,d,e,f,g){var k,h,l,p,n,m,r;if("add"==a&&!top.get("filesFrame").contentWindow.document.getElementById(b.replace(top.iceRoot,"").replace(/\/$/,"").replace(/\//g,
|
||||
"|")+"|"+c)){k="file"==g?"pft-file ext-"+c.substr(c.indexOf(".")+1):"pft-directory";d="file"==g?top.ICEcoder.newFilePerms:top.ICEcoder.newDirPerms;b||(b="/");b=b.replace(top.iceRoot,"/");b=b.replace("//","/");h=top.get("filesFrame").contentWindow.document.getElementById(b.replace(/\//g,"|"));l=h.parentNode.parentNode.nextSibling;p=document.createTextNode("\n");n=777==d?"background: #800; color: #eee":"color: #888";n='<a nohref title="'+b.replace(/\/$/,"")+"/"+c+'" onMouseOver="parentNode.draggable=true;top.ICEcoder.overFileFolder(\''+
|
||||
g+"',this.childNodes[1].id)\" onMouseOut=\"parentNode.draggable=false;top.ICEcoder.overFileFolder('"+g+"','')\" "+("folder"==g?"ondragover=\"if(parentNode.nextSibling && parentNode.nextSibling.tagName != 'UL' && top.ICEcoder.thisFileFolderLink != this.childNodes[1].id) {top.ICEcoder.openCloseDir(this,true);}\"":"")+' onClick="if(!event.ctrlKey && !top.ICEcoder.cmdKey) {'+("folder"==g?"top.ICEcoder.openCloseDir(this,"+("folder"==g?"true":"false")+");":"")+' if (/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)) {top.ICEcoder.openFile()}}" style="position: relative; left:-22px"> <span id="'+
|
||||
b.replace(/\/$/,"").replace(/\//g,"|")+"|"+c+'">'+c+'</span> <span style="'+n+'; font-size: 8px" id="'+b.replace(/\/$/,"").replace(/\//g,"|")+"|"+c+'_perms">'+d+"</span></a>";if(!l||3>l.childNodes.length)m=document.createElement("ul"),l=h.parentNode.parentNode,l.parentNode.insertBefore(m,l.nextSibling),m=document.createElement("li"),m.className=k,m.draggable=!1,m.ondragstart=function(a){top.ICEcoder.addDefaultDragData(this,a)},m.ondrag=function(a){top.ICEcoder.draggingWithKeyTest(a);top.ICEcoder.getcMInstance()&&
|
||||
(-1==top.ICEcoder.editorFocusInstance.indexOf("diff")?top.ICEcoder.getcMInstance().focus():top.ICEcoder.getcMdiffInstance().focus())},m.ondragover=function(a){top.ICEcoder.setDragCursor(a,"folder"==g?"folder":"file")},m.ondragend=function(){top.ICEcoder.dropFile(this)},m.innerHTML=n,l.nextSibling.appendChild(m),l.nextSibling.appendChild(p);else for(h=0;h<l.childNodes.length;h++)if(l.childNodes[h].className&&(m=0<l.childNodes[h].className.indexOf("directory")?"folder":"file",r=l.childNodes[h].getElementsByTagName("span")[0].innerHTML,
|
||||
m==g&&r>c||"folder"==g&&"file"==m||h==l.childNodes.length-1)){m=document.createElement("li");m.className=k;m.draggable=!1;m.ondragstart=function(a){top.ICEcoder.addDefaultDragData(this,a)};m.ondrag=function(a){top.ICEcoder.draggingWithKeyTest(a);top.ICEcoder.getcMInstance()&&(-1==top.ICEcoder.editorFocusInstance.indexOf("diff")?top.ICEcoder.getcMInstance().focus():top.ICEcoder.getcMdiffInstance().focus())};m.ondragover=function(a){top.ICEcoder.setDragCursor(a,"folder"==g?"folder":"file")};m.ondragend=
|
||||
function(){top.ICEcoder.dropFile(this)};m.innerHTML=n;h==l.childNodes.length-1?(l.appendChild(m),l.appendChild(p)):(l.insertBefore(m,l.childNodes[h]),l.insertBefore(p,l.childNodes[h+1]));break}"file"!=g||f||(top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1]=b+c)}"rename"==a&&(f=e.replace(/\//g,"|"),h=top.get("filesFrame").contentWindow.document.getElementById(f),h.innerHTML=c,h.id=b.replace(/\//g,"|")+"|"+c,h.parentNode.title=h.id.replace(/\|/g,"/"),targetElemPerms=top.get("filesFrame").contentWindow.document.getElementById(f+
|
||||
"_perms"),targetElemPerms.id=b.replace(/\//g,"|")+"|"+c+"_perms",top.ICEcoder.renameInChildren(h,e,b,c));"move"==a&&(top.ICEcoder.updateFileManagerList("add",b,c,!1,!1,!1,g),top.ICEcoder.updateFileManagerList("delete",e.substr(0,e.lastIndexOf("/")),c));"chmod"==a&&(f=top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1].replace(/\|/g,"/"),h=top.get("filesFrame").contentWindow.document.getElementById(f.replace(/\//g,"|")+"_perms"),h.style.background=777==d?"#800":"none",h.style.color=777==
|
||||
d?"#eee":"#888",h.innerHTML=d);"delete"==a&&(b||(b=""),b=b.replace(top.iceRoot,"/"),b=b.replace("//","/"),b=b.replace(/\/$/,"").replace(/\//g,"|"),h=(b+"|"+c).replace("||","|"),h=top.get("filesFrame").contentWindow.document.getElementById(h).parentNode.parentNode,top.ICEcoder.openCloseDir(h.childNodes[0],!1),h.parentNode.removeChild(h))},renameInChildren:function(a,b,c,d){var e,f;if(a.parentNode.parentNode.nextSibling&&"UL"==a.parentNode.parentNode.nextSibling.nodeName){a=a.parentNode.parentNode.nextSibling;
|
||||
for(var g=0;g<a.childNodes.length;g++)"LI"==a.childNodes[g].nodeName&&(e=a.childNodes[g].childNodes[0].childNodes[1],e.id=e.id.replace(b.replace(/\//g,"|"),c.replace(/\//g,"|")+"|"+d),e.parentNode.title=e.id.replace(/\|/g,"/"),f=top.get("filesFrame").contentWindow.document.getElementById(e.id).nextSibling.nextSibling,f.id=e.id+"_perms",top.ICEcoder.renameInChildren(e,b,c,d))}},refreshFileManager:function(){top.ICEcoder.showHide("show",top.get("loadingMask"));top.ICEcoder.filesFrame.contentWindow.location.reload(!0);
|
||||
top.ICEcoder.filesFrame.style.opacity="0";top.ICEcoder.filesFrame.onload=function(){top.ICEcoder.filesFrame.style.opacity="1";top.ICEcoder.showHide("hide",top.get("loadingMask"))}},draggingWithKeyTest:function(a){var b;b=a.keyCode?a.keyCode:a.which?a.which:a.charCode;if(224==b||91==b||93==b)top.ICEcoder.cmdKey=!0;top.ICEcoder.draggingWithKey=a.ctrlKey||top.ICEcoder.cmdKey?"CTRL":!1},addDefaultDragData:function(a,b){b.dataTransfer.setData("Text",a.id)},setDragCursor:function(a,b){a.preventDefault();
|
||||
top.ICEcoder.draggingWithKeyTest(a);a.dataTransfer.dropEffect="editor"==b?"CTRL"==top.ICEcoder.draggingWithKey?"copy":"link":"folder"==b?"CTRL"==top.ICEcoder.draggingWithKey?"copy":"move":"none"},dropFile:function(a){var b,c;b=a.childNodes[0].childNodes[1].id.replace(/\|/g,"/");fileName=b.substr(b.lastIndexOf("/")+1);"editor"==top.ICEcoder.area&&top.ICEcoder.pasteURL(b);"files"==top.ICEcoder.area&&setTimeout(function(){c="folder"==ICEcoder.thisFileFolderType?ICEcoder.thisFileFolderLink:ICEcoder.thisFileFolderLink.substr(0,
|
||||
ICEcoder.thisFileFolderLink.lastIndexOf("|"));"CTRL"==top.ICEcoder.draggingWithKey?(top.ICEcoder.copyFiles(top.ICEcoder.selectedFiles),top.ICEcoder.pasteFiles(c)):top.ICEcoder.moveFile(b,c.replace(/\|/g,"/")+"/"+fileName)},4);top.ICEcoder.mouseDown=!1;top.ICEcoder.mouseDownInCM=!1},findReplaceOptions:function(){top.get("rText").style.display=top.get("replace").style.display=top.get("rTarget").style.display=document.findAndReplace.connector.value==top.t.and?"inline-block":"none"},findReplace:function(a,
|
||||
b,c,d,e){var f,g,k;if(d)top.get("find").value=top.get("find").value,top.ICEcoder.focus();else{"undefined"==typeof e&&(e=!1);a=a.toLowerCase();f=top.get("replace").value;g=top.get("results");d=ICEcoder.getcMInstance();k=ICEcoder.getcMdiffInstance();if((d=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?k:d)&&0<a.length&&document.findAndReplace.target.value==top.t["this document"]){d.getValue().toLowerCase();document.findAndReplace.connector.value==top.t.and&&c&&(document.findAndReplace.replaceAction.value==
|
||||
top.t.replace&&d.getSelection().toLowerCase()==a?d.replaceSelection(f,"around"):document.findAndReplace.replaceAction.value==top.t["replace all"]&&(c=new RegExp(a,"gi"),d.setValue(d.getValue().replace(c,f))));c=d.getValue().toLowerCase();if(!top.ICEcoder.findMode||a!=top.ICEcoder.lastsearch){ICEcoder.results=[];ICEcoder.resultsLines=[];for(f=0;f<c.length;f++)c.substr(f,a.length)==a&&-1==ICEcoder.results.indexOf(f)&&(ICEcoder.results.push(f),-1==ICEcoder.resultsLines.indexOf(d.posFromIndex(f).line+
|
||||
1)&&ICEcoder.resultsLines.push(d.posFromIndex(f).line+1));ICEcoder.lastsearch=a}if(0<ICEcoder.results.length){if(b)g.innerHTML=ICEcoder.results.length+" results";else{if(e)for(ICEcoder.findResult="undefined"==typeof ICEcoder.findResult?ICEcoder.results.length+1:ICEcoder.results.length,f=ICEcoder.results.length-1;0<=f;f--)ICEcoder.results[f]>d.indexFromPos({ch:d.getCursor().ch-1,line:d.getCursor().line})&&ICEcoder.findResult--;else for(f=ICEcoder.findResult=0;f<ICEcoder.results.length;f++)ICEcoder.results[f]<
|
||||
d.indexFromPos({ch:d.getCursor().ch+1,line:d.getCursor().line})&&ICEcoder.findResult++;!e&&ICEcoder.findResult>ICEcoder.results.length-1&&(ICEcoder.findResult=0);e&&1==ICEcoder.findResult&&(ICEcoder.findResult=ICEcoder.results.length+1);g.innerHTML="Highlighted result "+(ICEcoder.findResult+(e?-1:1))+" of "+ICEcoder.results.length+" results";e?(b=d.getSearchCursor(a,{ch:d.getCursor().ch-1,line:d.getCursor().line},!0),b.findPrevious(),b.from()||(b=d.getSearchCursor(a,{line:1E6,ch:1E6},!0),b.findPrevious())):
|
||||
(b=d.getSearchCursor(a,{ch:d.getCursor().ch+1,line:d.getCursor().line},!0),b.findNext(),b.from()||(b=d.getSearchCursor(a,{line:0,ch:0},!0),b.findNext()));d.setSelection(b.from(),b.to());top.ICEcoder.focus();top.ICEcoder.findMode=!0}a=top.ICEcoder.scrollBarVisible?parseInt(top.ICEcoder.content.style.height,10)/d.lineCount():d.defaultTextHeight();b=top.ICEcoder.scrollBarVisible?0:d.heightAtLine(0);e="";for(f=1;f<=d.lineCount();f++)g=-1<ICEcoder.resultsLines.indexOf(f)?d.getCursor().line+1==f?"#b00":
|
||||
"#888":"transparent",e+='<div style="position: absolute; display: block; width: 5px; height:'+a+"px; background: "+g+"; top: "+parseInt(a*(f-1)+b,10)+'px"></div>';top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").innerHTML=e;top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").style.display="inline-block";return!0}g.innerHTML="No results";top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").innerHTML="";top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").style.display=
|
||||
"none";return!1}""!=a&&c?(e=b=d="",document.findAndReplace.connector.value==top.t.and&&(d="&replace="+f),0<=document.findAndReplace.target.value.indexOf(top.t.file)&&(b="&target="+document.findAndReplace.target.value.replace(/ /g,"-")),document.findAndReplace.target.value==top.t["selected files"]&&(e="&selectedFiles="+top.ICEcoder.selectedFiles.join(":")),a=a.replace(/\'/g,"'"),a!=encodeURIComponent(a)?a="ICEcoder:"+encodeURIComponent(a):a,top.ICEcoder.showHide("show",top.get("loadingMask")),
|
||||
top.get("mediaContainer").innerHTML='<iframe src="lib/multiple-results.php?find='+a+d+b+e+"&csrf="+top.ICEcoder.csrf+'" class="whiteGlow" style="width: 700px; height: 500px"></iframe>'):(g.innerHTML="No results",top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").innerHTML="",top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").style.display="none")}},replaceInFile:function(a,b,c){top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=replaceText&find="+
|
||||
b+"&replace="+c+"&csrf="+top.ICEcoder.csrf,a.replace(/\//g,"|").replace(/\+/g,"%2B"));top.ICEcoder.serverMessage("<b>"+top.t["Replacing text in"]+"</b><br>"+a)},getCaretPosition:function(){var a,b,c,d;a=ICEcoder.getcMInstance();b=ICEcoder.getcMdiffInstance();a=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?b:a;b=a.getCursor().line;c=a.getCursor().ch;for(var e=d=0;e<b;e++)d+=a.getLine(e).length+1;ICEcoder.caretPos=d+c-1},updateCharDisplay:function(){var a,b;a=ICEcoder.getcMInstance();b=ICEcoder.getcMdiffInstance();
|
||||
a=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?b:a;ICEcoder.caretLocationType();ICEcoder.charDisplay.innerHTML=ICEcoder.caretLocType+", Line: "+(a.getCursor().line+1)+", Char: "+a.getCursor().ch},updateVersionsDisplay:function(){var a=top.ICEcoder.openFileVersions[ICEcoder.selectedTab-1];get("versionsDisplay").innerHTML="undefined"!=typeof a?top.ICEcoder.openFileVersions[ICEcoder.selectedTab-1]+" backup"+(1!=a?"s":""):""},updateByteDisplay:function(){var a,b;a=ICEcoder.getcMInstance();b=ICEcoder.getcMdiffInstance();
|
||||
a=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?b:a;ICEcoder.byteDisplay.innerHTML=a.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"},showHide:function(a,b){b.style.visibility="show"==a?"visible":"hidden"},getcMInstance:function(a){return top.ICEcoder.content.contentWindow[isNaN(a)?"new"==a||"new"!=a&&
|
||||
0<ICEcoder.openFiles.length?"cM"+ICEcoder.cMInstances[ICEcoder.selectedTab-1]:"cM1":"cM"+ICEcoder.cMInstances[a-1]]},getcMdiffInstance:function(a){return top.ICEcoder.content.contentWindow[(isNaN(a)?"new"==a||"new"!=a&&0<ICEcoder.openFiles.length?"cM"+ICEcoder.cMInstances[ICEcoder.selectedTab-1]:"cM1":"cM"+ICEcoder.cMInstances[a-1])+"diff"]},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.ICEcoder.area=b;"top"!=b&&(top.ICEcoder.mouseY+=70);"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;!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&&(top.ICEcoder.mouseDown||(top.ICEcoder.draggingFilesW=!1),a=!ICEcoder.draggingTab&&(top.ICEcoder.mouseX>top.ICEcoder.filesW-7&&top.ICEcoder.mouseX<top.ICEcoder.filesW+7||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=top.get("serverMessage");a?(b.innerHTML=top.ICEcoder.xssClean(a).replace(/\<b\>/g,"<b>").replace(/\<\/b\>/g,"</b>").replace(/\<br\>/g,"<br>"),b.style.left="0"):setTimeout(function(){b.style.left="2000px"},200);b.style.opacity=a?1:0},cssColorPreview:function(){var a,b,c,d;a=ICEcoder.getcMInstance();b=ICEcoder.getcMdiffInstance();if(a=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?b:a){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.get("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.get("header").appendChild(b),a.addWidget(a.getCursor(),top.get("cssColor"),!0))}},showColorPicker:function(a){top.get("blackMask").style.visibility="visible";top.get("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.get(\'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.get(\'colorRGB\').value)" value="insert >" class="insertColorValue">';
|
||||
farbtastic("picker","color");a&&top.get("picker").farbtastic.setColor(a)},initCanvasImage:function(a){var b,c;b=top.get("canvasPicker").getContext("2d");c=new Image;c.crossOrigin="Anonymous";c.src=a.src;c.onerror=function(){get("floatingContainer").style.visibility="hidden";get("canvasPickerColorInfo").style.display="none";get("canvasPickerCORSInfo").style.display="block"};c.onload=function(){top.get("canvasPicker").width=a.width;top.get("canvasPicker").height=a.height;b.drawImage(c,0,0,a.width,a.height);
|
||||
get("canvasPickerColorInfo").style.display="block";get("canvasPickerCORSInfo").style.display="none";top.get("canvasPicker").onmouseover=function(a){get("floatingContainer").style.visibility="visible"};top.get("canvasPicker").onmouseout=function(a){get("floatingContainer").style.visibility="hidden"}};top.document.getElementById("floatingContainer").style.backgroundSize=5*a.naturalWidth+"px "+5*a.naturalHeight+"px"},interactCanvasImage:function(a){var b,c,d,e,f,g,k,h,l,p,n,m,r;b=top.get("canvasPicker").getContext("2d");
|
||||
top.get("canvasPicker").onmousemove=function(t){c=t.pageX-this.offsetLeft;d=t.pageY-this.offsetTop;e=b.getImageData(c,d,1,1).data;f=e[0];g=e[1];k=e[2];h=f+","+g+","+k;l=top.ICEcoder.rgbToHex(f,g,k);top.get("rgbMouseXY").value=h;top.get("hexMouseXY").value="#"+l;top.get("hexMouseXY").style.backgroundColor=top.get("rgbMouseXY").style.backgroundColor="#"+l;p=128>f||128>g||128>k&&200>f&&200>g&&50<k?"#fff":"#000";top.get("hexMouseXY").style.color=top.get("rgbMouseXY").style.color=p;n=get("floatingContainer");
|
||||
n.style.left=top.ICEcoder.mouseX+20+"px";n.style.top=top.ICEcoder.mouseY+"px";m=-(a.naturalWidth/a.width*c*5)+25;r=-(a.naturalHeight/a.height*d*5)+25;n.style.backgroundPosition=m+"px "+r+"px"};top.get("canvasPicker").onclick=function(){top.get("rgb").value=top.get("rgbMouseXY").value;top.get("hex").value=top.get("hexMouseXY").value;top.get("hex").style.backgroundColor=top.get("rgb").style.backgroundColor=top.get("hex").value;top.get("hex").style.color=top.get("rgb").style.color=p}},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=ICEcoder.getcMdiffInstance();b=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?c:b;c=b.getTokenAt(b.getCursor());b.replaceRange(a,{line:b.getCursor().line,ch:c.start},{line:b.getCursor().line,
|
||||
0<top.ICEcoder.autoLogoutTimer?60*top.ICEcoder.autoLogoutMins-top.ICEcoder.autoLogoutTimer:0);!a&&0<ICEcoder.autoLogoutMins&&top.ICEcoder.autoLogoutTimer>=60*top.ICEcoder.autoLogoutMins&&top.ICEcoder.logout("autoLogout");top.ICEcoder.openSeconds++;0==top.ICEcoder.openSeconds%300&&(top.ICEcoder.filesFrame.contentWindow.frames.pingActive.location.href="lib/session-active-ping.php");top.ICEcoder.indexing||top.ICEcoder.loadingFile||0!==top.ICEcoder.serverQueueItems.length||0!=top.ICEcoder.openSeconds%
|
||||
3||(top.ICEcoder.indexing=!0,fetch("lib/indexer.php").then(function(a){return a.json()}).then(function(a){top.ICEcoder.indexData=a;top.ICEcoder.indexing=!1}))},1E3);top.ICEcoder.ready=!0},setLayout:function(a){var b=window.innerWidth;var c=window.innerHeight;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.optionsFile.style.width=this.optionsEdit.style.width=this.optionsSource.style.width=this.optionsHelp.style.width=
|
||||
this.filesW-60+"px";this.filesFrame.style.height=c-25-35-30+"px";this.nestValid.style.left=this.filesW+10+"px";this.versionsDisplay.style.left=this.filesW+25+"px";this.splitPaneControls.style.left=parseInt((b-this.filesW)/2,10)-25-4+this.filesW-100+"px";this.splitPaneNamesMain.style.left=parseInt(.25*(b-this.filesW),10)-50+this.filesW-60+"px";this.splitPaneNamesDiff.style.left=parseInt(.75*(b-this.filesW),10)-50+this.filesW-135+"px";top.ICEcoder.setTabWidths();a||(this.editor.style.width=ICEcoder.content.style.width=
|
||||
b-this.filesW-200+"px",ICEcoder.terminal.style.width=b-this.filesW+"px",ICEcoder.output.style.width=b-this.filesW+"px",ICEcoder.database.style.width=b-this.filesW+"px",ICEcoder.git.style.width=b-this.filesW+"px",ICEcoder.content.style.height=c-25-21-28-26+"px",ICEcoder.terminal.style.height=c+"px",ICEcoder.output.style.height=c+"px",ICEcoder.database.style.height=c+"px",ICEcoder.git.style.height=c+"px",ICEcoder.terminal.style.top=c+"px",ICEcoder.output.style.top=c+"px",ICEcoder.database.style.top=
|
||||
c+"px",ICEcoder.git.style.top=c+"px",!1!==top.ICEcoder.showingTool&&(get(top.ICEcoder.showingTool).style.top=0),setTimeout(function(){for(var a=0;a<top.ICEcoder.openFiles.length;a++)top.ICEcoder.splitPane||top.ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[a]].setSize(top.ICEcoder.splitPaneLeftPerc+"%",top.ICEcoder.content.style.height),top.ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[a]+"diff"].setSize(100-top.ICEcoder.splitPaneLeftPerc+"%",top.ICEcoder.content.style.height),
|
||||
top.ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[a]+"diff"].getWrapperElement().style.left=top.ICEcoder.splitPaneLeftPerc+"%",top.ICEcoder.splitPane&&top.ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[a]].setSize(top.ICEcoder.splitPaneLeftPerc+"%",top.ICEcoder.content.style.height);this.docExplorer.style.height=top.ICEcoder.content.style.height;top.ICEcoder.splitPane?top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").style.right=top.ICEcoder.scrollBarVisible?
|
||||
parseInt(parseInt(ICEcoder.content.style.width,10)/2,10)+17+"px":parseInt(parseInt(ICEcoder.content.style.width,10)/2,10)+"px":top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").style.right=top.ICEcoder.scrollBarVisible?"17px":"0"},4))},setSplitPane:function(a){top.ICEcoder.splitPane="on"==a?!0:!1;top.get("splitPaneControlsOff").style.opacity=top.ICEcoder.splitPane?.2:.5;top.get("splitPaneControlsOn").style.opacity=top.ICEcoder.splitPane?.5:.2;top.get("splitPaneNamesMain").style.opacity=
|
||||
top.get("splitPaneNamesDiff").style.opacity=top.ICEcoder.splitPane?1:0;top.ICEcoder.setLayout();if(top.ICEcoder.splitPane){top.ICEcoder.updateDiffs();var b=top.ICEcoder.getcMInstance();top.ICEcoder.cMonScroll(b,"cM"+ICEcoder.cMInstances[ICEcoder.selectedTab-1])}else if(b=top.ICEcoder.getcMInstance(),a=top.ICEcoder.getcMdiffInstance(),b){cMmarks=b.getAllMarks();for(b=0;b<cMmarks.length;b++)cMmarks[b].clear();cMdiffMarks=a.getAllMarks();for(b=0;b<cMdiffMarks.length;b++)cMdiffMarks[b].clear()}"undefined"!=
|
||||
typeof top.ICEcoder.animSplitPaneInt&&clearInterval(top.ICEcoder.animSplitPaneInt);top.ICEcoder.animSplitPaneInt=setInterval(function(){top.ICEcoder.splitPane&&50.1<top.ICEcoder.splitPaneLeftPerc?top.ICEcoder.splitPaneLeftPerc=(top.ICEcoder.splitPaneLeftPerc-50)/1.8+50:!top.ICEcoder.splitPane&&99.9>top.ICEcoder.splitPaneLeftPerc?top.ICEcoder.splitPaneLeftPerc=50-(100-top.ICEcoder.splitPaneLeftPerc)/1.8+50:(top.ICEcoder.splitPaneLeftPerc=top.ICEcoder.splitPane?50:100,clearInterval(top.ICEcoder.animSplitPaneInt));
|
||||
top.ICEcoder.setLayout()},4)},toolShowHideToggle:function(a){var b=window.innerHeight;-1<["terminal","output","database","git"].indexOf(a)&&(get("terminal").style.top=b+"px",get("output").style.top=b+"px",get("database").style.top=b+"px",get("git").style.top=b+"px",get(a).style.top=top.ICEcoder.showingTool===a?b+"px":0,"terminal"===a&&setTimeout(function(){top.ICEcoder.terminal.contentWindow.document.getElementById("command").focus()},0),top.ICEcoder.showingTool=top.ICEcoder.showingTool!==a?a:!1)},
|
||||
docExplorerShow:function(a){var b;get("miniMap").style.display="miniMap"==a?"block":"none";get("functionClassList").style.display="functionClassList"==a?"block":"none";"miniMap"==a&&(top.miniMapInt=setInterval(function(){0!=get("miniMapContent").getBoundingClientRect().height&&(b=top.ICEcoder.getcMInstance(),top.ICEcoder.setMinimapLayout(b),clearInterval(top.miniMapInt))},10))},changeFilesW:function(a){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(){top.ICEcoder.ready&&"w-resize"==top.document.body.style.cursor?top.ICEcoder.mouseDown&&"gutter"==top.ICEcoder.mouseDownInCM&&(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.filesFrame.style.width=top.ICEcoder.filesW+"px",top.ICEcoder.setLayout(),
|
||||
top.ICEcoder.draggingFilesW=!0):top.ICEcoder.draggingFilesW=!1},lockUnlockNav:function(){var a=top.ICEcoder.filesFrame.contentWindow.document.getElementById("fmLock");ICEcoder.lockedNav=!ICEcoder.lockedNav;a.style.backgroundPosition=ICEcoder.lockedNav?"0 0":"-16px 0"},showHidePlugins:function(a){get("plugins").style.width="show"==a?"55px":"3px";get("plugins").style.background="show"==a?"#333":"transparent";"show"==a&&ICEcoder.changeFilesW("expand")},cMonFocus:function(a,b){top.ICEcoder.getCaretPosition();
|
||||
top.ICEcoder.updateCharDisplay();top.ICEcoder.updateByteDisplay();top.ICEcoder.editorFocusInstance=b;top.ICEcoder.getCaretPosition()},cMonBlur:function(a,b){},cMonKeyUp:function(a,b){"undefined"!=typeof top.doFind&&clearInterval(top.doFind);top.doFind=setTimeout(function(){top.ICEcoder.findReplace(top.get("find").value,!0,!1)},500);top.ICEcoder.getCaretPosition();top.ICEcoder.updateCharDisplay();top.ICEcoder.updateByteDisplay()},cMonCursorActivity:function(a,b){top.ICEcoder.getCaretPosition();top.ICEcoder.updateCharDisplay();
|
||||
top.ICEcoder.updateByteDisplay();a.removeLineClass(top.ICEcoder["cMActiveLine"+b],"background");a.getCursor("start").line==a.getCursor().line&&(top.ICEcoder["cMActiveLine"+b]=a.addLineClass(a.getCursor().line,"background","cm-s-activeLine"));"CSS"==top.ICEcoder.caretLocType&&top.ICEcoder.cssColorPreview();var c=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?top.ICEcoder.prevLineDiff:top.ICEcoder.prevLine;c!=a.getCursor().line&&a.getLine(c)&&0<a.getLine(c).length&&0==a.getLine(c).replace(/\s/g,
|
||||
"").length&&a.replaceRange("",{line:c,ch:0},{line:c,ch:1E6});setTimeout(function(){for(var d,c=0;c<top.ICEcoder.renderLineStyle.length;c++){d=!1;if("diff"!=top.ICEcoder.renderLineStyle[c][0]&&-1==b.indexOf("diff")||"diff"==top.ICEcoder.renderLineStyle[c][0]&&-1<b.indexOf("diff"))d=!0;d&&a.getCursor().line+1==top.ICEcoder.renderLineStyle[c][1]?a.setOption("cursorHeight",a.defaultTextHeight()/a.lineInfo(a.getCursor().line).handle.height):a.setOption("cursorHeight",1)}},0)},cMonBeforeChange:function(a,
|
||||
b,c,d){b=a.listSelections();for(var e=0;e<b.length;e++){var f=d.findMatchingTag(a,b[e].anchor);if(0!==c.text[0].indexOf(">")&&"undefined"!=typeof f&&"undo"!=c.origin&&"redo"!=c.origin&&"undefined"!=typeof f.open&&"undefined"!=typeof f.close){var g="open"==f.at?"close":"open";null!==f[g]&&(f=f[g].tag+";"+f[g].from.line+":"+f[g].from.ch,-1==top.ICEcoder.oppTagReplaceData.indexOf(f)&&top.ICEcoder.oppTagReplaceData.push(f))}}},cMonChange:function(a,b,c,d){var e;b=a.listSelections();top.ICEcoder.loadingFile?
|
||||
setTimeout(function(){a.replaceRange("X",{line:1,ch:1},{line:1,ch:1});a.undo();a.clearHistory();top.ICEcoder.savedPoints[top.ICEcoder.selectedTab-1]=a.changeGeneration();top.ICEcoder.savedContents[top.ICEcoder.selectedTab-1]=a.getValue()},0):top.ICEcoder.redoTabHighlight(top.ICEcoder.selectedTab);setTimeout(function(){top.ICEcoder.scrollBarVisible=a.getScrollInfo().height>a.getScrollInfo().clientHeight;top.ICEcoder.setLayout()},0);if("undefined"!=typeof top.ICEcoder.oppTagReplaceData[0])for(var f=
|
||||
0;f<top.ICEcoder.oppTagReplaceData.length;f++){var g=top.ICEcoder.oppTagReplaceData[f].split(";");var m=g[0];var h=1*g[1].split(":")[0];var l=1*g[1].split(":")[1];b[f]&&(e=d.findMatchingTag(a,b[f].anchor));if("undefined"!=typeof e&&(m="open"==e.at?e.open.tag:e.close.tag,"undefined"!=typeof c.from)){var n=h==c.from.line?c.text[0].length-c.removed[0].length:0;var p="close"==e.at&&h==c.from.line?c.removed[0].length-c.text[0].length+1:1;var k={line:h,ch:l+n+("open"==e.at?2:p)};n={line:h,ch:l+n+("open"==
|
||||
e.at?2:p)+g[0].length}}""!=m.trim()&&"undefined"!=typeof k&&"undefined"!=typeof n&&a.getRange(k,n)==g[0]&&(a.replaceRange(m,k,n),"close"==e.at&&(top.ICEcoder.autocompleteSkip=!0))}top.ICEcoder.oppTagReplaceData=[];top.ICEcoder.getCaretPosition();top.ICEcoder.updateCharDisplay();top.ICEcoder.updateByteDisplay();top.ICEcoder.updateNestingIndicator();top.ICEcoder.findMode&&(top.ICEcoder.results.splice(top.ICEcoder.findResult,1),top.get("results").innerHTML=top.ICEcoder.results.length+" "+top.t.results,
|
||||
top.ICEcoder.findMode=!1);top.ICEcoder.updateFunctionClassList();"undefined"!=typeof top.doMiniNav&&clearTimeout(top.doMiniNav);top.ICEcoder.loadingFile?top.ICEcoder.setMinimap():top.doMiniNav=setTimeout(function(){top.ICEcoder.setMinimap()},1E3);if(c=top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1]){var r=c.substr(c.lastIndexOf("/")+1);var t=r.substr(r.lastIndexOf(".")+1)}top.ICEcoder.splitPane&&setTimeout(function(){top.ICEcoder.updateDiffs()},0);c&&top.ICEcoder.previewWindow.location&&"/[NEW]"!=
|
||||
c&&top.ICEcoder.updatePreviewWindow(a,c,r,t);top.ICEcoder.indicateChanges()},cMonUpdate:function(a,b){setTimeout(function(){get("docExplorer").style.background=window.getComputedStyle(a.getWrapperElement(),null).getPropertyValue("background")},0);top.ICEcoder.setMinimapLayout(a,b)},cMonScroll:function(a,b){top.ICEcoder.mouseDown=!1;top.ICEcoder.mouseDownInCM=!1;if(top.ICEcoder.splitPane){var c=top.ICEcoder.getcMInstance();var d=top.ICEcoder.getcMdiffInstance();var e=-1<b.indexOf("diff")?c:d;c&&setTimeout(function(){e.scrollTo(a.getScrollInfo().left,
|
||||
a.getScrollInfo().top)},0)}top.ICEcoder.setMinimapLayout(a,b)},cMonInputRead:function(a,b){"keypress"==top.ICEcoder.autoComplete&&top.ICEcoder.codeAssist&&!a.state.completionActive&&(top.ICEcoder.autocompleteSkip?top.ICEcoder.autocompleteSkip=!1:top.ICEcoder.autocomplete())},cMonGutterClick:function(a,b,c,d,e){top.ICEcoder.mouseDownInCM="gutter"},cMonMouseDown:function(a,b,c){top.ICEcoder.mouseDownInCM="editor"},cMonContextMenu:function(a,b,c){b=a.coordsChar({left:c.pageX,top:c.pageY});a.setCursor(b);
|
||||
c.ctrlKey&&setTimeout(function(){var b=a,c=b.getRange(b.findWordAt(b.getCursor()).anchor,b.findWordAt(b.getCursor()).head);result=null;numResults=0;var f=top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1];f=f.substr(f.lastIndexOf(".")+1);for(i in top.ICEcoder.indexData.functions[f])i===c&&(result=top.ICEcoder.indexData.functions[f][i],numResults++);for(i in top.ICEcoder.indexData.classes[f])i===c&&(result=top.ICEcoder.indexData.classes[f][i],numResults++);1===numResults&&-1===[null,"def"].indexOf(b.getTokenTypeAt(b.getCursor()))&&
|
||||
(top.ICEcoder.openFile(result.filePath.replace(top.docRoot,"")),top.ICEcoder.goFindAfterOpenInt=setInterval(function(){top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1]!=result.filePath.replace(top.docRoot,"")||top.ICEcoder.loadingFile||(b=top.ICEcoder.getcMInstance(),setTimeout(function(){top.ICEcoder.goToLine(result.range.from.line+1);b.setSelection({line:result.range.from.line,ch:result.range.from.ch},{line:result.range.to.line,ch:result.range.to.ch})},20),clearInterval(top.ICEcoder.goFindAfterOpenInt))},
|
||||
20));top.ICEcoder.mouseDownInCM="editor"},0)},cMonDragOver:function(a,b,c){top.ICEcoder.setDragCursor(b,"editor")},cMonRenderLine:function(a,b,c,d){for(var e,f=0;f<top.ICEcoder.renderLineStyle.length;f++){e=!1;if("diff"!=top.ICEcoder.renderLineStyle[f][0]&&-1==b.indexOf("diff")||"diff"==top.ICEcoder.renderLineStyle[f][0]&&-1<b.indexOf("diff"))e=!0;e&&a.lineInfo(c).line+1==top.ICEcoder.renderLineStyle[f][1]&&(d.style[top.ICEcoder.renderLineStyle[f][2]]=top.ICEcoder.renderLineStyle[f][3])}},functionClassParamsTooltip:function(a,
|
||||
b){if(top.ICEcoder.indexData){if(0===top.ICEcoder.openFiles.length)return get("tooltip").style.display="none",!0;var c,d=top.ICEcoder.getcMInstance(),e=d.coordsChar({left:top.ICEcoder.mouseX-top.ICEcoder.maxFilesW,top:top.ICEcoder.mouseY-72}),f=d.getRange(d.findWordAt(e).anchor,d.findWordAt(e).head);if(""===f)return get("tooltip").style.display="none",!0;var g=null,m=0,h=top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1];h=h.substr(h.lastIndexOf(".")+1);for(c in top.ICEcoder.indexData.functions[h])c===
|
||||
f&&(g=top.ICEcoder.indexData.functions[h][c],m++);for(c in top.ICEcoder.indexData.classes[h])c===f&&(g=top.ICEcoder.indexData.classes[h][c],m++);1===m&&-1===[null,"def"].indexOf(d.getTokenTypeAt(e))?(get("tooltip").style.display="block",get("tooltip").style.left=top.ICEcoder.mouseX-top.ICEcoder.maxFilesW+10+"px",get("tooltip").style.top=top.ICEcoder.mouseY-30+"px",get("tooltip").style.zIndex="1",get("tooltip").innerHTML=g.params):get("tooltip").style.display="none"}},updateDiffs:function(){top.ICEcoder.renderLineStyle=
|
||||
[];top.ICEcoder.renderPaneShiftAmount=0;var a=top.ICEcoder.getcMInstance();var b=top.ICEcoder.getcMdiffInstance();var c=a?difflib.stringAsLines(a.getValue()):"";var d=b?difflib.stringAsLines(b.getValue()):"";c=(new difflib.SequenceMatcher(c,d)).get_opcodes();if(a){var e=a.getAllMarks();for(d=0;d<e.length;d++)e[d].clear();e=b.getAllMarks();for(d=0;d<e.length;d++)e[d].clear()}if(a&&""!=b.getValue())for(d=0;d<c.length;d++)if("equal"!==c[d][0]){if("replace"==c[d][0]){var f=(c[d][4]-c[d][2]+1+top.ICEcoder.renderPaneShiftAmount)*
|
||||
a.defaultTextHeight();for(e=c[d][4]-1;e<=c[d][2]-1;e++)b.getLineHandle(e).height>a.defaultTextHeight()&&(f+=b.getLineHandle(e).height-a.defaultTextHeight());f>a.defaultTextHeight()&&top.ICEcoder.renderLineStyle.push(["main",c[d][2],"height",f+"px"]);for(e=0;e<c[d][2]-c[d][1];e++)f=top.ICEcoder.findStringDiffs(a.getLine(c[d][1]+e),b.getLine(c[d][3]+e)),a.markText({line:c[d][1]+e,ch:0},{line:c[d][3]+e+top.ICEcoder.renderPaneShiftAmount,ch:f[0]},{className:"diffGreyLighter"}),a.markText({line:c[d][1]+
|
||||
e,ch:f[0]},{line:c[d][3]+e+top.ICEcoder.renderPaneShiftAmount,ch:f[0]+f[1]},{className:"diffGrey"}),a.markText({line:c[d][1]+e,ch:f[0]+f[1]},{line:c[d][3]+e+top.ICEcoder.renderPaneShiftAmount,ch:1E6},{className:"diffGreyLighter"})}else a.markText({line:c[d][1],ch:0},{line:c[d][2]-1,ch:1E6},{className:"diffGreen"});"replace"!=c[d][0]&&c[d][1]==c[d][2]&&(top.ICEcoder.renderLineStyle.push(["main",c[d][2],"height",(c[d][4]-c[d][3]+1)*a.defaultTextHeight()+"px"]),a.markText({line:c[d][2]-1,ch:0},{line:c[d][2]-
|
||||
1,ch:1E6},{className:"diffNone"}));if("replace"==c[d][0]){f=(c[d][2]-c[d][4]+1-top.ICEcoder.renderPaneShiftAmount)*a.defaultTextHeight();for(e=c[d][4]-1;e<=c[d][2]-1;e++)a.getLineHandle(e).height>a.defaultTextHeight()&&(f+=a.getLineHandle(e).height-a.defaultTextHeight());f>a.defaultTextHeight()&&top.ICEcoder.renderLineStyle.push(["diff",c[d][4],"height",f+"px"]);for(e=0;e<c[d][4]-c[d][3];e++)f=top.ICEcoder.findStringDiffs(a.getLine(c[d][1]+e),b.getLine(c[d][3]+e)),b.markText({line:c[d][1]+e-top.ICEcoder.renderPaneShiftAmount,
|
||||
ch:0},{line:c[d][3]+e,ch:f[0]},{className:"diffGreyLighter"}),b.markText({line:c[d][1]+e-top.ICEcoder.renderPaneShiftAmount,ch:f[0]},{line:c[d][3]+e,ch:f[0]+f[2]},{className:"diffGrey"}),b.markText({line:c[d][1]+e-top.ICEcoder.renderPaneShiftAmount,ch:f[0]+f[2]},{line:c[d][3]+e,ch:1E6},{className:"diffGreyLighter"})}else b.markText({line:c[d][3],ch:0},{line:c[d][4]-1,ch:1E6},{className:"diffRed"});"replace"!=c[d][0]&&c[d][3]==c[d][4]&&(top.ICEcoder.renderLineStyle.push(["diff",c[d][4],"height",(c[d][2]-
|
||||
c[d][1]+1)*a.defaultTextHeight()+"px"]),b.markText({line:c[d][4]-1,ch:0},{line:c[d][4]-1,ch:1E6},{className:"diffNone"}));top.ICEcoder.renderPaneShiftAmount=c[d][2]-c[d][4]}},findStringDiffs:function(a,b){"undefined"==typeof a&&(a="");"undefined"==typeof b&&(b="");for(var c=0,d=a.length,e=b.length;a[c]&&a[c]==b[c];c++);for(;d>c&e>c&a[d-1]==b[e-1];d--)e--;return[c,d-c,e-c]},updatePreviewWindow:function(a,b,c,d){top.ICEcoder.previewWindow.location.pathname==b?-1<["htm","html","txt"].indexOf(d)?top.ICEcoder.previewWindow.document.documentElement.innerHTML=
|
||||
a.getValue():-1<["md"].indexOf(d)&&(top.ICEcoder.previewWindow.document.documentElement.innerHTML=mmd(a.getValue())):-1<["css"].indexOf(d)&&-1<top.ICEcoder.previewWindow.document.documentElement.innerHTML.indexOf(c)&&(a=a.getValue(),c=document.createElement("style"),c.type="text/css",c.id="ICEcoder"+b.replace(/\//g,"_"),c.styleSheet?c.styleSheet.cssText=a:c.appendChild(document.createTextNode(a)),top.ICEcoder.previewWindow.document.getElementById(c.id)&&top.ICEcoder.previewWindow.document.documentElement.removeChild(top.ICEcoder.previewWindow.document.getElementById(c.id)),
|
||||
top.ICEcoder.previewWindow.document.documentElement.appendChild(c));try{top.ICEcoder.doPesticide()}catch(e){}try{top.ICEcoder.doStatsJS("update")}catch(e){}try{top.ICEcoder.doResponsive()}catch(e){}},contentCleanUp:function(){var a=ICEcoder.getcMInstance();var b=ICEcoder.getcMdiffInstance();a=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?b:a;b=a.getValue();b=b.replace(/<ICEcoder:\/:textarea>/g,"</textarea>");a.setValue(b);a.clearHistory();top.ICEcoder.savedPoints[top.ICEcoder.selectedTab-1]=
|
||||
a.changeGeneration();top.ICEcoder.savedContents[top.ICEcoder.selectedTab-1]=a.getValue()},undo:function(){var a=ICEcoder.getcMInstance();var b=ICEcoder.getcMdiffInstance();(-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?b:a).undo()},redo:function(){var a=ICEcoder.getcMInstance();var b=ICEcoder.getcMdiffInstance();(-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?b:a).redo()},indent:function(a){var b=ICEcoder.getcMInstance();var c=ICEcoder.getcMdiffInstance();b=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?
|
||||
c:b;"more"==a?top.ICEcoder.content.contentWindow.CodeMirror.commands.indentMore(b):top.ICEcoder.content.contentWindow.CodeMirror.commands.indentLess(b)},moveLines:function(a){var b;var c=top.ICEcoder.getcMInstance();var d=top.ICEcoder.getcMdiffInstance();var e=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?d:c;var f=e.getCursor("start");var g=e.getCursor("end");"up"==a&&0<f.line&&(b=f.line-1);"down"==a&&g.line<e.lineCount()-1&&(b=g.line+1);if(!isNaN(b)){var m=e.getLine(b);e.operation(function(){if("up"==
|
||||
a)for(var b=f.line;b<=g.line;b++)e.replaceRange(e.getLine(b),{line:b-1,ch:0},{line:b-1,ch:1E6});else for(b=g.line;b>=f.line;b--)e.replaceRange(e.getLine(b),{line:b+1,ch:0},{line:b+1,ch:1E6});e.replaceRange(m,{line:"up"==a?g.line:f.line,ch:0},{line:"up"==a?g.line:f.line,ch:1E6});e.setSelection({line:f.line+("up"==a?-1:1),ch:f.ch},{line:g.line+("up"==a?-1:1),ch:g.ch})})}},highlightLine:function(a){var b=top.ICEcoder.getcMInstance();var c=top.ICEcoder.getcMdiffInstance();b=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?
|
||||
c:b;b.setSelection({line:a,ch:0},{line:a,ch:b.lineInfo(a).text.length})},focus:function(a){if(!/iPhone|iPad|iPod/i.test(navigator.userAgent)){var b=top.ICEcoder.getcMInstance();var c=top.ICEcoder.getcMdiffInstance();(a=a?c:b)&&a.focus()}},goToLine:function(a,b,c){a=a?a-1:top.get("goToLineNo").value-1;b=b?b:0;var d=ICEcoder.getcMInstance();var e=ICEcoder.getcMdiffInstance();var f=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?e:d;top.ICEcoder.scrollingOnLine=f.getCursor().line;"undefined"!=typeof top.ICEcoder.scrollInt&&
|
||||
clearInterval(top.ICEcoder.scrollInt);top.ICEcoder.scrollInt=setInterval(function(){top.ICEcoder.scrollingOnLine+=(a-top.ICEcoder.scrollingOnLine)/5;f.scrollTo(0,f.defaultTextHeight()*top.ICEcoder.scrollingOnLine-f.getScrollInfo().clientHeight/10);top.ICEcoder.setMinimapLayout(f);Math.round(top.ICEcoder.scrollingOnLine)==a&&clearInterval(top.ICEcoder.scrollInt)},10);f.setCursor(a,b);c||(top.ICEcoder.focus(),setTimeout(function(){top.ICEcoder.focus()},0));return!1},lineCommentToggle:function(){var a=
|
||||
ICEcoder.getcMInstance();var b=ICEcoder.getcMdiffInstance();a=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?b:a;b=a.getCursor().ch;var c=a.getCursor().line;var d=a.getLine(c);ICEcoder.lineCommentToggleSub(a,b,c,d,d.length)},tagWrapper:function(a){var b=ICEcoder.getcMInstance();var c=ICEcoder.getcMdiffInstance();var d=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?c:b;b=a;if("div"==a){var e=d.getCursor("start").line;var f=d.getCursor().line;d.operation(function(){d.replaceSelection("<div>\n"+
|
||||
d.getSelection()+"\n</div>","around");for(var a=e+1;a<=f+1;a++)d.indentLine(a);d.indentLine(f+2,"prev");d.indentLine(f+2,"subtract")})}else-1<["p","a","h1","h2","h3"].indexOf(a)&&d.getSelection().substr(0,a.length+1)=="<"+b&&d.getSelection().substr(-(a.length+3))=="</"+a+">"?d.replaceSelection(d.getSelection().substr(d.getSelection().indexOf(">")+1,d.getSelection().length-d.getSelection().indexOf(">")-1-a.length-3),"around"):("a"==a&&(b='a href=""'),d.replaceSelection("<"+b+">"+d.getSelection()+"</"+
|
||||
a+">","around"),"a"==a&&d.setCursor({line:d.getCursor("start").line,ch:d.getCursor("start").ch+9}))},addLineBreakAtEnd:function(a){var b=ICEcoder.getcMInstance();var c=ICEcoder.getcMdiffInstance();b=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?c:b;a||(a=b.getCursor().line);b.replaceRange(b.getLine(a)+"<br>",{line:a,ch:0},{line:a,ch:1E6})},insertLineBefore:function(a){var b=ICEcoder.getcMInstance();var c=ICEcoder.getcMdiffInstance();var d=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?
|
||||
c:b;a||(a=d.getCursor().line);d.operation(function(){d.replaceRange("\n"+d.getLine(a),{line:a,ch:0},{line:a,ch:1E6});d.setCursor({line:d.getCursor().line-1,ch:0});d.execCommand("indentAuto")})},insertLineAfter:function(a){var b=ICEcoder.getcMInstance();var c=ICEcoder.getcMdiffInstance();var d=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?c:b;a||(a=d.getCursor().line);d.operation(function(){d.replaceRange(d.getLine(a)+"\n",{line:a,ch:0},{line:a,ch:1E6});d.execCommand("indentAuto")})},duplicateLines:function(a){var b=
|
||||
ICEcoder.getcMInstance();var c=ICEcoder.getcMdiffInstance();b=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?c:b;if(!a&&b.somethingSelected()){c=b.getCursor("start");var d=b.getCursor("end");a=c.line!=d.line&&d.ch==b.getLine(d.line).length?"\n":"";b.replaceSelection(b.getSelection()+a+b.getSelection(),"end");b.setSelection(c,d)}else a||(a=b.getCursor().line),c=b.getCursor().ch,b.replaceRange(b.getLine(a)+"\n"+b.getLine(a),{line:a,ch:0},{line:a,ch:1E6}),b.setCursor(a+1,c)},removeLines:function(a){var b=
|
||||
ICEcoder.getcMInstance();var c=ICEcoder.getcMdiffInstance();b=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?c:b;!a&&b.somethingSelected()?b.replaceSelection("","end"):(a||(a=b.getCursor().line),c=b.getCursor().ch,b.execCommand("deleteLine"),b.setCursor(a-1,c))},jumpToDefinition:function(){var a=ICEcoder.getcMInstance();var b=ICEcoder.getcMdiffInstance();a=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?b:a;b=a.getTokenAt(a.getCursor()).string;if(a.somethingSelected()&&top.ICEcoder.origCurorPos)a.setCursor(top.ICEcoder.origCurorPos);
|
||||
else for(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],b=0;b<a.length&&!top.ICEcoder.findReplace(a[b],!1,!1);b++);},updateFunctionClassList:function(){var a;var b=ICEcoder.getcMInstance();top.ICEcoder.functionClassList=[];b&&(b.doc.eachLine(function(a){top.ICEcoder.updateFunctionClassListItems(a)}),
|
||||
setTimeout(function(){a="";for(var b=0;b<top.ICEcoder.functionClassList.length;b++)top.ICEcoder.functionClassList[b].verified&&(a+='<div onclick="top.ICEcoder.goToLine('+(top.ICEcoder.functionClassList[b].line+1)+')" class="functionClassListItem"><span class="name">'+top.ICEcoder.functionClassList[b].name+'</span><br><span class="params">'+top.ICEcoder.functionClassList[b].params+"</span></div>");get("functionClassList").innerHTML=a},0))},updateFunctionClassListItems:function(a){var b=ICEcoder.getcMInstance();
|
||||
var c="";-1<a.text.indexOf("function ")&&-1<a.text.replace(/\$function/g,"").indexOf("function ")&&(c=a.text.substring(a.text.indexOf("function ")+9));-1<a.text.indexOf("class ")&&-1<a.text.replace(/\$class/g,"").indexOf("class ")&&(c=a.text.substring(a.text.indexOf("class ")+6));c=c.trim().split("{")[0].split("(");""!=c[0]&&(top.ICEcoder.functionClassList.push({line:b.getLineNumber(a),name:c[0],params:"("+(c[1]?c[1].replace(/[,]/g,", "):""),verified:!1}),setTimeout(function(){if(!a.styles||a.styles&&
|
||||
-1<a.styles.indexOf("def")&&b.getLineNumber(a))for(var d=0;d<top.ICEcoder.functionClassList.length;d++)top.ICEcoder.functionClassList[d].line==b.getLineNumber(a)&&(top.ICEcoder.functionClassList[d].verified=!0)},0))},setMinimap:function(){var a;if(a=ICEcoder.getcMInstance()){top.ICEcoder.content.contentWindow.CodeMirror.runMode(a.getValue(),a.getOption("mode"),get("miniMapContent"));get("miniMapContent").innerHTML='<div class="cm-s-'+top.ICEcoder.theme+'" style="font-family: monospace; white-space: '+
|
||||
(1==top.ICEcoder.lineWrapping?"pre-wrap":"pre")+'; font-size: 2px; line-height: 2px">'+get("miniMapContent").innerHTML+"</div>";get("miniMapContent").innerHTML=get("miniMapContent").innerHTML.replace(/<span /g,'<span style="font-size: 2px; font-family: monospace" ');get("miniMapContainer").innerHTML='<div style="position: absolute; display: inline-block; top: '+top.ICEcoder.miniMapBoxTop+"px; left: 0; width: 200px; height: "+top.ICEcoder.miniMapBoxHeight+'px; background: rgba(0,198,255,0.1); z-index: 1; cursor: pointer" id="miniMapBox"></div>';
|
||||
var b=get("miniMapBox");b=new Draggabilly(b,{axis:"y",containment:!0});b.on("dragMove",function(b,d,e){yPos=this.position.y;maxHeight=parseInt(get("docExplorer").style.height,10)<=parseInt(get("miniMapContent").getBoundingClientRect().height,10)?parseInt(get("docExplorer").style.height,10):parseInt(get("miniMapContent").getBoundingClientRect().height,10);newPerc=this.position.y/(maxHeight-top.ICEcoder.miniMapBoxHeight);yPos=(a.getScrollInfo().height-a.getScrollInfo().clientHeight)*newPerc;a.scrollTo(0,
|
||||
yPos)});b.on("pointerDown",function(a,b){top.ICEcoder.mouseDownMinimap=!0});b.on("pointerUp",function(a,b){top.ICEcoder.mouseDownMinimap=!1});top.ICEcoder.setMinimapLayout(a);get("docExplorer").style.right="-220px"}},setMinimapLayout:function(a,b){if(get("miniMapBox")&&a){var c=top.ICEcoder.getcMInstance();var d=a.getScrollInfo().top/(a.getScrollInfo().height-a.getScrollInfo().clientHeight);parseInt(get("miniMapContent").getBoundingClientRect().height,10)>parseInt(get("docExplorer").style.height,
|
||||
10)?(get("miniMapContainer").style.height=parseInt(get("docExplorer").style.height,10)+"px",top.ICEcoder.miniMapBoxHeight=parseInt(get("docExplorer").style.height,10)/c.defaultTextHeight()*2,get("miniMapBox").style.height=top.ICEcoder.miniMapBoxHeight+"px",top.ICEcoder.miniMapBoxTop=d*parseInt(get("docExplorer").style.height,10)-d*top.ICEcoder.miniMapBoxHeight,get("miniMapContent").style.marginTop=-(parseInt(get("miniMapContent").getBoundingClientRect().height,10)-parseInt(get("docExplorer").style.height,
|
||||
10))*d+"px"):(get("miniMapContainer").style.height=parseInt(get("miniMapContent").getBoundingClientRect().height,10)+"px",top.ICEcoder.miniMapBoxHeight=parseInt(get("docExplorer").style.height,10)/c.defaultTextHeight()*2,get("miniMapBox").style.height=top.ICEcoder.miniMapBoxHeight+"px",top.ICEcoder.miniMapBoxTop=d*parseInt(get("miniMapContainer").getBoundingClientRect().height,10)-d*top.ICEcoder.miniMapBoxHeight,get("miniMapContent").style.marginTop=0);top.ICEcoder.mouseDownMinimap||(get("miniMapBox").style.top=
|
||||
top.ICEcoder.miniMapBoxTop+"px")}},autocomplete:function(){var a=ICEcoder.getcMInstance();var b=ICEcoder.getcMdiffInstance();a=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?b:a;top.ICEcoder.content.contentWindow.CodeMirror.commands.autocomplete(a)},pasteURL:function(a){var b=top.ICEcoder.getcMInstance();var c=top.ICEcoder.getcMdiffInstance();b=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?c:b;"CTRL"==top.ICEcoder.draggingWithKey&&(a=window.location.protocol+"//"+window.location.hostname+
|
||||
a);b.replaceSelection(a,"around")},searchForSelected:function(){var a=top.ICEcoder.getcMInstance();var b=top.ICEcoder.getcMdiffInstance();a=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?b:a;top.ICEcoder.caretLocType&&(""!=a.getSelection()?(b=top.ICEcoder.caretLocType.toLowerCase()+" ","Content"==top.ICEcoder.caretLocType&&(b=""),window.open("http://www.google.com/#output=search&q="+b+a.getSelection())):top.ICEcoder.message(top.t["No text selected..."]))},fmAction:function(a,b){var c=top.get("filesFrame").contentWindow.document.getElementById(top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-
|
||||
1]+"_perms").parentNode;var d=c.parentNode;var e=-1<c.onmouseover.toString().indexOf("'folder'")?"folder":"file";var f=!1;"up"==b&&(d.previousSibling&&d.previousSibling.previousSibling?(f=d.previousSibling.previousSibling,"UL"==f.tagName&&(f=f.childNodes[f.childNodes.length-1])):d.parentNode.previousSibling&&(f=d.parentNode.previousSibling),f&&(f=f.childNodes[0]));"down"==b&&(d.nextSibling&&d.nextSibling.childNodes[0]?f=d.nextSibling.childNodes[0]:d.nextSibling&&d.nextSibling.nextSibling?f=d.nextSibling.nextSibling:
|
||||
d.parentNode.nextSibling&&(f=d.parentNode.nextSibling.nextSibling),f&&(f=f.childNodes[0]));"left"==b&&"folder"==e&&d.parentNode.previousSibling&&top.ICEcoder.openCloseDir(c,!1);if("right"==b||"enter"==b)"folder"==e?top.ICEcoder.openCloseDir(c,!0):top.ICEcoder.openFile(c.childNodes[1].id.replace(/\|/g,"/"));f&&f.childNodes[1]&&(top.ICEcoder.overFileFolder(e,f.childNodes[1].id),top.ICEcoder.selectFileFolder(a))},openCloseDir:function(a,b){var c;a.onclick=function(a){a.ctrlKey||top.ICEcoder.cmdKey||
|
||||
top.ICEcoder.openCloseDir(this,!b)};var d=a.parentNode;d.nextSibling&&(d=d.nextSibling);d&&"UL"==d.tagName&&((c="none"==d.style.display)?b=!0:d.style.display="none",a.parentNode.className=a.className=c?"pft-directory dirOpen":"pft-directory");b?top.ICEcoder.filesFrame.contentWindow.frames.fileControl.location.href="lib/get-branch.php?location="+a.childNodes[1].id+"&csrf="+top.ICEcoder.csrf:"UL"==d.tagName&&d.parentNode.removeChild(d);return!1},overFileFolder:function(a,b){ICEcoder.thisFileFolderType=
|
||||
a;ICEcoder.thisFileFolderLink=b},isFileFolder:function(a){return(a=top.get("filesFrame").contentWindow.document.getElementById(a.replace(top.iceRoot,"").replace(/\/$/,"").replace(/\//g,"|")))?-1<a.parentNode.parentNode.className.indexOf("directory")?"folder":"file":!1},selectFileFolder:function(a,b,c){if(""==top.ICEcoder.thisFileFolderLink)b||a.ctrlKey||top.ICEcoder.cmdKey||top.ICEcoder.deselectAllFiles();else if(top.ICEcoder.thisFileFolderLink){var d=top.ICEcoder.thisFileFolderLink.replace(/\//g,
|
||||
"|");var e=top.ICEcoder.filesFrame.contentWindow.document.getElementById(d);if(b||a.ctrlKey||top.ICEcoder.cmdKey)-1<top.ICEcoder.selectedFiles.indexOf(d)?(ICEcoder.selectDeselectFile("deselect",e),top.ICEcoder.selectedFiles.splice(top.ICEcoder.selectedFiles.indexOf(d),1)):(ICEcoder.selectDeselectFile("select",e),top.ICEcoder.selectedFiles.push(d));else if(c||a.shiftKey){var f=function(a,b,d,c){return("00000000000000000000"+a).substr(-20)};a=!1;b=e.parentNode.parentNode.parentNode;var g=top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-
|
||||
1];c=d.replace(/\d+/g,f)<g.replace(/\d+/g,f)?d:g;g=d.replace(/\d+/g,f)>g.replace(/\d+/g,f)?d:g;if(0<top.ICEcoder.selectedFiles.length&&c.substr(0,c.lastIndexOf("|"))==g.substr(0,g.lastIndexOf("|")))for(d=0;1E6>d&&("LI"!=b.childNodes[d].nodeName&&d++,e=b.childNodes[d].childNodes[0].childNodes[1],e.id==c&&(a=!0),1==a&&-1==top.ICEcoder.selectedFiles.indexOf(e.id)&&(ICEcoder.selectDeselectFile("select",e),top.ICEcoder.selectedFiles.push(e.id)),e.id!=g);d+=2);else ICEcoder.selectDeselectFile("select",
|
||||
e),top.ICEcoder.selectedFiles.push(d)}else top.ICEcoder.deselectAllFiles(),ICEcoder.selectDeselectFile("select",e),top.ICEcoder.selectedFiles.push(d)}top.ICEcoder.githubDiff&&(top.get("githubNavSelectedCount").innerHTML="Selected: "+top.ICEcoder.selectedFiles.length,top.get("githubNavCommit").style.color=0<top.ICEcoder.selectedFiles.length?"#fff":"#333",top.get("githubNavCommit").style.background=0<top.ICEcoder.selectedFiles.length?"#2187e7":"#555",top.get("githubNavSelectedCount").style.color=0<
|
||||
top.ICEcoder.selectedFiles.length?"#fff":"#333",top.get("githubNavPull").style.color=0<top.ICEcoder.selectedFiles.length?"#fff":"#333",top.get("githubNavPull").style.background=0<top.ICEcoder.selectedFiles.length?"#2187e7":"#555");document.findAndReplace.target[2].innerHTML=top.ICEcoder.selectedFiles[0]?top.t["selected files"]:top.t["all files"];document.findAndReplace.target[3].innerHTML=top.ICEcoder.selectedFiles[0]?top.t["selected filenames"]:top.t["all filenames"];top.ICEcoder.hideFileMenu()},
|
||||
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){if(b){var c=-1<top.ICEcoder.openFiles.indexOf(b.id.replace(/\|/g,"/"))?!0:!1;top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1]==b.id.replace(/\|/g,"/")?b.style.backgroundColor="select"==a?top.ICEcoder.tabBGselected:
|
||||
top.ICEcoder.tabBGcurrent:b.style.backgroundColor="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}},boxSelect:function(a,b){var c=top.ICEcoder.filesFrame.contentWindow.document.getElementById("fmDragBox");"down"==b&&(top.ICEcoder.fmDragBoxStartX=top.ICEcoder.mouseX,top.ICEcoder.fmDragBoxStartY=top.ICEcoder.mouseY,top.ICEcoder.fmDragSelectFirst="",top.ICEcoder.fmDragSelectLast=
|
||||
"");if(top.ICEcoder.mouseDown&&!top.ICEcoder.mouseDownInCM&&"drag"==b){top.ICEcoder.fmDraggedBox=!0;var d=0<top.ICEcoder.mouseX-top.ICEcoder.fmDragBoxStartX;c.style.left=(d?top.ICEcoder.fmDragBoxStartX:top.ICEcoder.mouseX)+"px";c.style.width=Math.abs(top.ICEcoder.mouseX-top.ICEcoder.fmDragBoxStartX)+"px";d=0<top.ICEcoder.mouseY-top.ICEcoder.fmDragBoxStartY;c.style.top=(d?top.ICEcoder.fmDragBoxStartY-70:top.ICEcoder.mouseY-70)+"px";c.style.height=Math.abs(top.ICEcoder.mouseY-top.ICEcoder.fmDragBoxStartY)+
|
||||
"px";""!=top.ICEcoder.thisFileFolderLink&&(""==top.ICEcoder.fmDragSelectFirst?(top.ICEcoder.fmDragSelectFirst=top.ICEcoder.thisFileFolderLink,top.ICEcoder.overFileFolder(0<top.ICEcoder.thisFileFolderLink.indexOf(".")?"file":"folder",top.ICEcoder.fmDragSelectFirst),top.ICEcoder.selectFileFolder(a)):(top.ICEcoder.fmDragSelectLast=top.ICEcoder.thisFileFolderLink,top.ICEcoder.overFileFolder(0<top.ICEcoder.thisFileFolderLink.indexOf(".")?"file":"folder",top.ICEcoder.fmDragSelectLast),top.ICEcoder.selectFileFolder(a,
|
||||
!1,"shiftSim")))}"up"==b&&(c.style.width=0,c.style.height=0)},newFile:function(){top.ICEcoder.newTab("alsoSave")},newFolder:function(){var a;var b=top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1].replace(/\|/g,"/");if(a=top.ICEcoder.getInput("Enter new folder name at "+b,""))a=(b+"/"+a).replace(/\/\//,"/"),top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=newFolder&csrf="+top.ICEcoder.csrf,a.replace(/\//g,"|").replace(/\+/g,"%2B")),top.ICEcoder.serverMessage("<b>"+top.t["Creating Folder"]+
|
||||
"</b><br>"+a)},returnFileAndLine:function(a){var b=1,c=/^([^ ]*)\s+(on\s+)?(line\s+)?(\d+)/.exec(a);null!==c?(b=c[4],a=c[1]):0<a.indexOf("://")?a.lastIndexOf(":")!==a.indexOf("://")&&(b=a.split(":")[2],a=a.substr(0,a.lastIndexOf(":"))):0<a.indexOf(":")&&(b=a.split(":")[1],a=a.split(":")[0]);0<a.indexOf("(")&&0<a.indexOf(")")&&(b=a.split("(")[1].split(")")[0],a=a.split("(")[0]);return[a,b]},openFile:function(a){if("undefined"!=typeof a){var b=top.ICEcoder.returnFileAndLine(a);a=b[0];b=b[1]}a&&(top.ICEcoder.thisFileFolderLink=
|
||||
a,top.ICEcoder.thisFileFolderType="file");if("/[NEW]"!=top.ICEcoder.thisFileFolderLink&&!1!==top.ICEcoder.isOpen(top.ICEcoder.thisFileFolderLink))top.ICEcoder.switchTab(top.ICEcoder.isOpen(top.ICEcoder.thisFileFolderLink)+1),1<b&&top.ICEcoder.goToLine(b);else if(""!=top.ICEcoder.thisFileFolderLink&&"file"==top.ICEcoder.thisFileFolderType){a=top.ICEcoder.thisFileFolderLink.replace(/\|/g,"/");var c=!0;100<=top.ICEcoder.openFiles.length&&(top.ICEcoder.message(top.t["Sorry you can..."]),c=!1);c&&(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.replace(/\+/g,"%2B")+"&csrf="+top.ICEcoder.csrf+"&lineNumber="+b),top.ICEcoder.serverMessage("<b>"+top.t["Opening File"]+"</b><br>"+top.ICEcoder.shortURL)):top.ICEcoder.createNewTab("new"),top.ICEcoder.fMIconVis("fMView",1))}},openFilesFromList:function(a){for(var b=0;b<a.length;b++)top.ICEcoder.thisFileFolderLink=
|
||||
a[b].replace("|","/"),top.ICEcoder.thisFileFolderType="file",top.ICEcoder.openFile()},openPrompt:function(){var a;if(a=top.ICEcoder.getInput(top.t["Enter relative file..."],""))-1<a.indexOf("://")?top.ICEcoder.getRemoteFile(a):top.ICEcoder.openFile(a)},getRemoteFile:function(a){if("undefined"!=typeof a){var b=top.ICEcoder.returnFileAndLine(a);a=b[0];b=b[1]}top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=getRemoteFile&csrf="+top.ICEcoder.csrf+"&lineNumber="+b,a.replace(/\+/g,"%2B"));
|
||||
top.ICEcoder.serverMessage("<b>"+top.t.Getting+"</b><br>"+a)},getChangesToSave:function(){var a=top.ICEcoder.getcMInstance();var b=top.ICEcoder.savedContents[top.ICEcoder.selectedTab-1];a=difflib.stringAsLines(a.getValue());b=difflib.stringAsLines(b);b=(new difflib.SequenceMatcher(b,a)).get_opcodes();for(var c=0;c<b.length;c++)for(j=b[c][3];j<b[c][4];j++)"equal"!=b[c][0]&&("undefined"==typeof b[c][5]&&(b[c][5]=""),b[c][5]+=a[j]+"\n");return JSON.stringify(b)},saveFile:function(a){var b;a||(b=top.ICEcoder.getChangesToSave());
|
||||
a=a?"saveAs":"save";var c=ICEcoder.openFiles[ICEcoder.selectedTab-1].replace(top.iceRoot,"").replace(/\//g,"|");if("|[NEW]"==c&&0<top.ICEcoder.selectedFiles.length){var d=top.ICEcoder.selectedFiles[0];c=-1==d.lastIndexOf(".")||d.lastIndexOf(".")<d.lastIndexOf("|")?d+c:"|[NEW]"}c=c.replace("||","|");top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=save&fileMDT="+ICEcoder.openFileMDTs[ICEcoder.selectedTab-1]+"&fileVersion="+ICEcoder.openFileVersions[ICEcoder.selectedTab-1]+"&saveType="+
|
||||
a+"&csrf="+top.ICEcoder.csrf,c.replace(/\+/g,"%2B"),b);top.ICEcoder.serverMessage("<b>"+top.t.Saving+"</b><br>"+ICEcoder.openFiles[ICEcoder.selectedTab-1].replace(top.iceRoot,""))},renameFile:function(a,b){if(a)var c=a.replace(/\|/g,"/");else c=top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1].replace(/\|/g,"/"),a=top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1].replace(/\|/g,"/");b||(b=top.ICEcoder.getInput(top.t["Please enter the..."],c));if(b){var 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.get("tab"+(d+1)).innerHTML=closeTabLink+" "+c.slice(c.lastIndexOf("/")).replace(/\//,
|
||||
""),top.get("tab"+(d+1)).title=b);top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=rename&oldFileName="+a.replace(/\|/g,"/").replace(/\+/g,"%2B")+"&csrf="+top.ICEcoder.csrf,b.replace(/\+/g,"%2B"));top.ICEcoder.serverMessage("<b>"+top.t["Renaming to"]+"</b><br>"+b);top.ICEcoder.setPreviousFiles()}},moveFile:function(a,b){if(b&&b!=a){var c=top.ICEcoder.openFiles.indexOf(a.replace(/\|/g,"/"));if(-1<c){top.ICEcoder.openFiles[c]=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>';
|
||||
var d=top.ICEcoder.openFiles[c];top.get("tab"+(c+1)).innerHTML=closeTabLink+" "+d.slice(d.lastIndexOf("/")).replace(/\//,"");top.get("tab"+(c+1)).title=b}top.ICEcoder.ask("Are you sure you want to move file "+a+" to "+b+" ?")&&(top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=move&oldFileName="+a.replace(/\//g,"|").replace(/\+/g,"%2B")+"&csrf="+top.ICEcoder.csrf,b.replace(/\//g,"|").replace(/\+/g,"%2B")),top.ICEcoder.serverMessage("<b>"+top.t["Moving to"]+"</b><br>"+b));top.ICEcoder.setPreviousFiles()}},
|
||||
deleteFiles:function(a){a=a?a:top.ICEcoder.selectedFiles;var b=a.toString().replace(/\|/g,"/").replace(/,/g,"\n");0<a.length&&top.ICEcoder.ask("Delete:\n\n"+b+"?")&&(top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=delete&&csrf="+top.ICEcoder.csrf,a.join(";").replace(/\+/g,"%2B")),top.ICEcoder.serverMessage("<b>"+top.t["Deleting File"]+"</b><br>"+b))},copyFiles:function(a,b,c){top.ICEcoder.copiedFiles=[];for(var d=0;d<a.length;d++)top.ICEcoder.copiedFiles[d]=a[d];b||(top.get("fmMenuPasteOption").style.display=
|
||||
"block");c||top.ICEcoder.hideFileMenu()},pasteFiles:function(a){if(top.ICEcoder.copiedFiles)for(var b=0;b<top.ICEcoder.copiedFiles.length;b++)"|"!=top.ICEcoder.copiedFiles[b]?(top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=paste&location="+a+"&csrf="+top.ICEcoder.csrf,top.ICEcoder.copiedFiles[b].replace(/\+/g,"%2B")),top.ICEcoder.serverMessage("<b>"+top.t["Pasting File"]+"</b><br>"+top.ICEcoder.copiedFiles[b].toString().replace(/\|/g,"/").replace(/,/g,"\n"))):top.ICEcoder.message(top.t["Sorry cannot paste..."]);
|
||||
else top.ICEcoder.message(top.t["Nothing to paste..."])},duplicateFiles:function(a){if(top.ICEcoder.copiedFiles)var b=top.ICEcoder.copiedFiles;top.ICEcoder.copyFiles(a,"dontShowPaste","dontHide");a=a[0].substr(0,a[0].lastIndexOf("|"));top.ICEcoder.pasteFiles(a);"undefined"!=typeof b&&(top.ICEcoder.copiedFiles=b)},uploadFilesSelect:function(a){top.get("uploadDir").value=a;top.get("fileInput").click()},uploadFilesSubmit:function(a){""!=top.get("fileInput").value&&(top.ICEcoder.showHide("show",top.get("loadingMask")),
|
||||
top.get("uploadFilesForm").submit(),event.preventDefault())},showHideFileNav:function(a,b){var c=["optionsFile","optionsEdit","optionsSource","optionsHelp"];if("hide"==a)fileNavInt=setTimeout(function(){for(var a=0;a<c.length;a++)top.ICEcoder.showHide("hide",top.get(c[a])),top.get(c[a]+"Nav").style.color=""},150);else for(var d=0;d<c.length;d++)top.ICEcoder.showHide("hide",top.get(c[d])),top.get(c[d]+"Nav").style.color="";get("fileOptions").style.opacity=0;"show"==a&&("undefined"!=typeof fileNavInt&&
|
||||
clearTimeout(fileNavInt),top.ICEcoder.showHide(a,top.get(b)),top.get(b+"Nav").style.color="#fff",get("fileOptions").style.opacity=1)},isPathFolder:function(a){a=top.ICEcoder.filesFrame.contentDocument.getElementsByClassName("pft-directory");for(var b=top.ICEcoder.selectedFiles[0],c,d=0;d<a.length;d++)if(c=a[d],"underfined"!=typeof c&&(c=c.childNodes[0],"undefined"!=typeof c&&(c=c.childNodes[1],"undefined"!=typeof c&&b===c.getAttribute("id"))))return!0;return!1},checkExists:function(a){var b;a=a.replace(/\|/g,
|
||||
"/");0===a.indexOf(top.iceRoot)&&(a=a.replace(top.iceRoot,""));var c=top.ICEcoder.xhrObj();c.onreadystatechange=function(){4==c.readyState&&(200==c.status?(b=JSON.parse(c.responseText),b.action.timeEnd=(new Date).getTime(),b.action.timeTaken=b.action.timeEnd-b.action.timeStart,0<=["raw","both"].indexOf(top.ICEcoder.fileDirResOutput)&&console.log(c.responseText),0<=["object","both"].indexOf(top.ICEcoder.fileDirResOutput)&&console.log(b),top.ICEcoder.lastFileDirCheckStatusObj=b,b.status.error?(top.ICEcoder.message(b.status.errorMsg),
|
||||
console.log("ICEcoder error info for your request..."),console.log(b),top.ICEcoder.serverMessage(),top.ICEcoder.serverQueue("del",0)):eval(b.action.doNext)):(top.ICEcoder.message(top.t["Sorry there was..."]),console.log("ICEcoder error info for your request..."),console.log(b),top.ICEcoder.serverMessage(),top.ICEcoder.serverQueue("del",0)))};c.open("POST","lib/file-control-xhr.php?action=checkExists&csrf="+top.ICEcoder.csrf,!0);c.setRequestHeader("Content-type","application/x-www-form-urlencoded");
|
||||
var d=(new Date).getTime();c.send("timeStart="+d+"&file="+a.replace(/\+/g,"%2B"))},showMenu:function(a){0!=top.ICEcoder.selectedFiles.length&&-1!=top.ICEcoder.selectedFiles.indexOf(top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1].replace(/\//g,"|"))||top.ICEcoder.selectFileFolder(a);a=129;var b=window.innerHeight;if("undefined"!=typeof top.ICEcoder.thisFileFolderLink&&""!=top.ICEcoder.thisFileFolderLink){var c=this.isPathFolder(top.ICEcoder.selectedFiles[0])?"folder":"file";top.get("folderMenuItems").style.display=
|
||||
"folder"==c&&1==top.ICEcoder.selectedFiles.length?"block":"none";"folder"==c&&1==top.ICEcoder.selectedFiles.length&&(a+=67,"block"==top.get("fmMenuPasteOption").style.display&&(a+=19));top.get("singleFileMenuItems").style.display=1<top.ICEcoder.selectedFiles.length?"none":"block";1==top.ICEcoder.selectedFiles.length&&(a+=43);top.get("fileMenu").style.display="inline-block";setTimeout(function(){top.get("fileMenu").style.opacity="1"},4);top.get("fileMenu").style.left=top.ICEcoder.mouseX+20+"px";c=
|
||||
top.ICEcoder.mouseY-top.ICEcoder.filesFrame.contentWindow.document.body.scrollTop-10;c+a>b&&(c-=c+a-b);top.get("fileMenu").style.top=c+"px"}return!1},showFileMenu:function(){top.get("fileMenu").style.display="inline-block";setTimeout(function(){top.get("fileMenu").style.opacity="1"},4)},hideFileMenu:function(){top.get("fileMenu").style.display="none";top.get("fileMenu").style.opacity="0"},updateFileManagerList:function(a,b,c,d,e,f,g){if("add"==a&&!top.get("filesFrame").contentWindow.document.getElementById(b.replace(top.iceRoot,
|
||||
"").replace(/\/$/,"").replace(/\//g,"|")+"|"+c)){var m="file"==g?"pft-file ext-"+c.substr(c.indexOf(".")+1):"pft-directory";d="file"==g?top.ICEcoder.newFilePerms:top.ICEcoder.newDirPerms;b||(b="/");b=b.replace(top.iceRoot,"/");b=b.replace("//","/");var h=top.get("filesFrame").contentWindow.document.getElementById(b.replace(/\//g,"|"));var l=h.parentNode.parentNode.nextSibling;var n=document.createTextNode("\n");var p=777==d?"background: #800; color: #eee":"color: #888";p='<a nohref title="'+b.replace(/\/$/,
|
||||
"")+"/"+c+'" onMouseOver="parentNode.draggable=true;top.ICEcoder.overFileFolder(\''+g+"',this.childNodes[1].id)\" onMouseOut=\"parentNode.draggable=false;top.ICEcoder.overFileFolder('"+g+"','')\" "+("folder"==g?"ondragover=\"if(parentNode.nextSibling && parentNode.nextSibling.tagName != 'UL' && top.ICEcoder.thisFileFolderLink != this.childNodes[1].id) {top.ICEcoder.openCloseDir(this,true);}\"":"")+' onClick="if(!event.ctrlKey && !top.ICEcoder.cmdKey) {'+("folder"==g?"top.ICEcoder.openCloseDir(this,"+
|
||||
("folder"==g?"true":"false")+");":"")+' if (/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)) {top.ICEcoder.openFile()}}" style="position: relative; left:-22px"> <span id="'+b.replace(/\/$/,"").replace(/\//g,"|")+"|"+c+'">'+c+'</span> <span style="'+p+'; font-size: 8px" id="'+b.replace(/\/$/,"").replace(/\//g,"|")+"|"+c+'_perms">'+d+"</span></a>";if(!l||3>l.childNodes.length){var k=document.createElement("ul");l=h.parentNode.parentNode;
|
||||
l.parentNode.insertBefore(k,l.nextSibling);k=document.createElement("li");k.className=m;k.draggable=!1;k.ondragstart=function(a){top.ICEcoder.addDefaultDragData(this,a)};k.ondrag=function(a){top.ICEcoder.draggingWithKeyTest(a);top.ICEcoder.getcMInstance()&&(-1==top.ICEcoder.editorFocusInstance.indexOf("diff")?top.ICEcoder.getcMInstance().focus():top.ICEcoder.getcMdiffInstance().focus())};k.ondragover=function(a){top.ICEcoder.setDragCursor(a,"folder"==g?"folder":"file")};k.ondragend=function(){top.ICEcoder.dropFile(this)};
|
||||
k.innerHTML=p;l.nextSibling.appendChild(k);l.nextSibling.appendChild(n)}else for(h=0;h<l.childNodes.length;h++)if(l.childNodes[h].className){k=0<l.childNodes[h].className.indexOf("directory")?"folder":"file";var r=l.childNodes[h].getElementsByTagName("span")[0].innerHTML;if(k==g&&r>c||"folder"==g&&"file"==k||h==l.childNodes.length-1){k=document.createElement("li");k.className=m;k.draggable=!1;k.ondragstart=function(a){top.ICEcoder.addDefaultDragData(this,a)};k.ondrag=function(a){top.ICEcoder.draggingWithKeyTest(a);
|
||||
top.ICEcoder.getcMInstance()&&(-1==top.ICEcoder.editorFocusInstance.indexOf("diff")?top.ICEcoder.getcMInstance().focus():top.ICEcoder.getcMdiffInstance().focus())};k.ondragover=function(a){top.ICEcoder.setDragCursor(a,"folder"==g?"folder":"file")};k.ondragend=function(){top.ICEcoder.dropFile(this)};k.innerHTML=p;h==l.childNodes.length-1?(l.appendChild(k),l.appendChild(n)):(l.insertBefore(k,l.childNodes[h]),l.insertBefore(n,l.childNodes[h+1]));break}}"file"!=g||f||(top.ICEcoder.openFiles[top.ICEcoder.selectedTab-
|
||||
1]=b+c)}"rename"==a&&(f=e.replace(/\//g,"|"),h=top.get("filesFrame").contentWindow.document.getElementById(f),h.innerHTML=c,h.id=b.replace(/\//g,"|")+"|"+c,h.parentNode.title=h.id.replace(/\|/g,"/"),targetElemPerms=top.get("filesFrame").contentWindow.document.getElementById(f+"_perms"),targetElemPerms.id=b.replace(/\//g,"|")+"|"+c+"_perms",top.ICEcoder.renameInChildren(h,e,b,c));"move"==a&&(top.ICEcoder.updateFileManagerList("add",b,c,!1,!1,!1,g),top.ICEcoder.updateFileManagerList("delete",e.substr(0,
|
||||
e.lastIndexOf("/")),c));"chmod"==a&&(f=top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1].replace(/\|/g,"/"),h=top.get("filesFrame").contentWindow.document.getElementById(f.replace(/\//g,"|")+"_perms"),h.style.background=777==d?"#800":"none",h.style.color=777==d?"#eee":"#888",h.innerHTML=d);"delete"==a&&(b||(b=""),b=b.replace(top.iceRoot,"/"),b=b.replace("//","/"),b=b.replace(/\/$/,"").replace(/\//g,"|"),h=(b+"|"+c).replace("||","|"),h=top.get("filesFrame").contentWindow.document.getElementById(h).parentNode.parentNode,
|
||||
top.ICEcoder.openCloseDir(h.childNodes[0],!1),h.parentNode.removeChild(h))},renameInChildren:function(a,b,c,d){if(a.parentNode.parentNode.nextSibling&&"UL"==a.parentNode.parentNode.nextSibling.nodeName){a=a.parentNode.parentNode.nextSibling;for(var e=0;e<a.childNodes.length;e++)if("LI"==a.childNodes[e].nodeName){var f=a.childNodes[e].childNodes[0].childNodes[1];f.id=f.id.replace(b.replace(/\//g,"|"),c.replace(/\//g,"|")+"|"+d);f.parentNode.title=f.id.replace(/\|/g,"/");var g=top.get("filesFrame").contentWindow.document.getElementById(f.id).nextSibling.nextSibling;
|
||||
g.id=f.id+"_perms";top.ICEcoder.renameInChildren(f,b,c,d)}}},refreshFileManager:function(){top.ICEcoder.showHide("show",top.get("loadingMask"));top.ICEcoder.filesFrame.contentWindow.location.reload(!0);top.ICEcoder.filesFrame.style.opacity="0";top.ICEcoder.filesFrame.onload=function(){top.ICEcoder.filesFrame.style.opacity="1";top.ICEcoder.showHide("hide",top.get("loadingMask"))}},draggingWithKeyTest:function(a){var b=a.keyCode?a.keyCode:a.which?a.which:a.charCode;if(224==b||91==b||93==b)top.ICEcoder.cmdKey=
|
||||
!0;top.ICEcoder.draggingWithKey=a.ctrlKey||top.ICEcoder.cmdKey?"CTRL":!1},addDefaultDragData:function(a,b){b.dataTransfer.setData("Text",a.id)},setDragCursor:function(a,b){a.preventDefault();top.ICEcoder.draggingWithKeyTest(a);a.dataTransfer.dropEffect="editor"==b?"CTRL"==top.ICEcoder.draggingWithKey?"copy":"link":"folder"==b?"CTRL"==top.ICEcoder.draggingWithKey?"copy":"move":"none"},dropFile:function(a){var b;var c=a.childNodes[0].childNodes[1].id.replace(/\|/g,"/");fileName=c.substr(c.lastIndexOf("/")+
|
||||
1);"editor"==top.ICEcoder.area&&top.ICEcoder.pasteURL(c);"files"==top.ICEcoder.area&&setTimeout(function(){b="folder"==ICEcoder.thisFileFolderType?ICEcoder.thisFileFolderLink:ICEcoder.thisFileFolderLink.substr(0,ICEcoder.thisFileFolderLink.lastIndexOf("|"));"CTRL"==top.ICEcoder.draggingWithKey?(top.ICEcoder.copyFiles(top.ICEcoder.selectedFiles),top.ICEcoder.pasteFiles(b)):top.ICEcoder.moveFile(c,b.replace(/\|/g,"/")+"/"+fileName)},4);top.ICEcoder.mouseDown=!1;top.ICEcoder.mouseDownInCM=!1},findReplaceOptions:function(){top.get("rText").style.display=
|
||||
top.get("replace").style.display=top.get("rTarget").style.display=document.findAndReplace.connector.value==top.t.and?"inline-block":"none"},findReplace:function(a,b,c,d,e){if(d)top.get("find").value=top.get("find").value,top.ICEcoder.focus();else{"undefined"==typeof e&&(e=!1);a=a.toLowerCase();var f=top.get("replace").value;var g=top.get("results");d=ICEcoder.getcMInstance();var m=ICEcoder.getcMdiffInstance();if((d=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?m:d)&&0<a.length&&document.findAndReplace.target.value==
|
||||
top.t["this document"]){d.getValue().toLowerCase();document.findAndReplace.connector.value==top.t.and&&c&&(document.findAndReplace.replaceAction.value==top.t.replace&&d.getSelection().toLowerCase()==a?d.replaceSelection(f,"around"):document.findAndReplace.replaceAction.value==top.t["replace all"]&&(c=new RegExp(a,"gi"),d.setValue(d.getValue().replace(c,f))));c=d.getValue().toLowerCase();if(!top.ICEcoder.findMode||a!=top.ICEcoder.lastsearch){ICEcoder.results=[];ICEcoder.resultsLines=[];for(f=0;f<c.length;f++)c.substr(f,
|
||||
a.length)==a&&-1==ICEcoder.results.indexOf(f)&&(ICEcoder.results.push(f),-1==ICEcoder.resultsLines.indexOf(d.posFromIndex(f).line+1)&&ICEcoder.resultsLines.push(d.posFromIndex(f).line+1));ICEcoder.lastsearch=a}if(0<ICEcoder.results.length){if(b)g.innerHTML=ICEcoder.results.length+" results";else{if(e)for(ICEcoder.findResult="undefined"==typeof ICEcoder.findResult?ICEcoder.results.length+1:ICEcoder.results.length,f=ICEcoder.results.length-1;0<=f;f--)ICEcoder.results[f]>d.indexFromPos({ch:d.getCursor().ch-
|
||||
1,line:d.getCursor().line})&&ICEcoder.findResult--;else for(f=ICEcoder.findResult=0;f<ICEcoder.results.length;f++)ICEcoder.results[f]<d.indexFromPos({ch:d.getCursor().ch+1,line:d.getCursor().line})&&ICEcoder.findResult++;!e&&ICEcoder.findResult>ICEcoder.results.length-1&&(ICEcoder.findResult=0);e&&1==ICEcoder.findResult&&(ICEcoder.findResult=ICEcoder.results.length+1);g.innerHTML="Highlighted result "+(ICEcoder.findResult+(e?-1:1))+" of "+ICEcoder.results.length+" results";e?(b=d.getSearchCursor(a,
|
||||
{ch:d.getCursor().ch-1,line:d.getCursor().line},!0),b.findPrevious(),b.from()||(b=d.getSearchCursor(a,{line:1E6,ch:1E6},!0),b.findPrevious())):(b=d.getSearchCursor(a,{ch:d.getCursor().ch+1,line:d.getCursor().line},!0),b.findNext(),b.from()||(b=d.getSearchCursor(a,{line:0,ch:0},!0),b.findNext()));d.setSelection(b.from(),b.to());top.ICEcoder.focus();top.ICEcoder.findMode=!0}a=top.ICEcoder.scrollBarVisible?parseInt(top.ICEcoder.content.style.height,10)/d.lineCount():d.defaultTextHeight();b=top.ICEcoder.scrollBarVisible?
|
||||
0:d.heightAtLine(0);e="";for(f=1;f<=d.lineCount();f++)g=-1<ICEcoder.resultsLines.indexOf(f)?d.getCursor().line+1==f?"#b00":"#888":"transparent",e+='<div style="position: absolute; display: block; width: 5px; height:'+a+"px; background: "+g+"; top: "+parseInt(a*(f-1)+b,10)+'px"></div>';top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").innerHTML=e;top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").style.display="inline-block";return!0}g.innerHTML="No results";
|
||||
top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").innerHTML="";top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").style.display="none";return!1}""!=a&&c?(e=b=d="",document.findAndReplace.connector.value==top.t.and&&(d="&replace="+f),0<=document.findAndReplace.target.value.indexOf(top.t.file)&&(b="&target="+document.findAndReplace.target.value.replace(/ /g,"-")),document.findAndReplace.target.value==top.t["selected files"]&&(e="&selectedFiles="+top.ICEcoder.selectedFiles.join(":")),
|
||||
a=a.replace(/'/g,"'"),a!=encodeURIComponent(a)?a="ICEcoder:"+encodeURIComponent(a):a,top.ICEcoder.showHide("show",top.get("loadingMask")),top.get("mediaContainer").innerHTML='<iframe src="lib/multiple-results.php?find='+a+d+b+e+"&csrf="+top.ICEcoder.csrf+'" class="whiteGlow" style="width: 700px; height: 500px"></iframe>'):(g.innerHTML="No results",top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").innerHTML="",top.ICEcoder.content.contentWindow.document.getElementById("resultsBar").style.display=
|
||||
"none")}},replaceInFile:function(a,b,c){top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=replaceText&find="+b+"&replace="+c+"&csrf="+top.ICEcoder.csrf,a.replace(/\//g,"|").replace(/\+/g,"%2B"));top.ICEcoder.serverMessage("<b>"+top.t["Replacing text in"]+"</b><br>"+a)},getCaretPosition:function(){var a;var b=ICEcoder.getcMInstance();var c=ICEcoder.getcMdiffInstance();b=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?c:b;c=b.getCursor().line;var d=b.getCursor().ch;for(var e=a=0;e<
|
||||
c;e++)a+=b.getLine(e).length+1;ICEcoder.caretPos=a+d-1},updateCharDisplay:function(){var a=ICEcoder.getcMInstance();var b=ICEcoder.getcMdiffInstance();a=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?b:a;ICEcoder.caretLocationType();ICEcoder.charDisplay.innerHTML=ICEcoder.caretLocType+", Line: "+(a.getCursor().line+1)+", Char: "+a.getCursor().ch},updateVersionsDisplay:function(){var a=top.ICEcoder.openFileVersions[ICEcoder.selectedTab-1];get("versionsDisplay").innerHTML="undefined"!=typeof a?
|
||||
top.ICEcoder.openFileVersions[ICEcoder.selectedTab-1]+" backup"+(1!=a?"s":""):""},updateByteDisplay:function(){var a=ICEcoder.getcMInstance();var b=ICEcoder.getcMdiffInstance();a=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?b:a;ICEcoder.byteDisplay.innerHTML=a.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"},showHide:function(a,b){b.style.visibility="show"==a?"visible":"hidden"},getcMInstance:function(a){return top.ICEcoder.content.contentWindow[isNaN(a)?"new"==a||"new"!=a&&0<ICEcoder.openFiles.length?"cM"+ICEcoder.cMInstances[ICEcoder.selectedTab-1]:"cM1":"cM"+ICEcoder.cMInstances[a-1]]},getcMdiffInstance:function(a){return top.ICEcoder.content.contentWindow[(isNaN(a)?"new"==a||"new"!=a&&0<ICEcoder.openFiles.length?"cM"+ICEcoder.cMInstances[ICEcoder.selectedTab-1]:"cM1":"cM"+ICEcoder.cMInstances[a-
|
||||
1])+"diff"]},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.ICEcoder.area=b;"top"!=b&&(top.ICEcoder.mouseY+=70);"editor"==b&&(top.ICEcoder.mouseX+=top.ICEcoder.filesW);top.ICEcoder.dragCursorTest();62<top.ICEcoder.mouseY&&top.ICEcoder.setTabWidths()},dragCursorTest:function(){var a;var b=top.ICEcoder.mouseX-top.ICEcoder.diffStartX;!1!==top.ICEcoder.draggingTab&&top.ICEcoder.diffStartX&&
|
||||
(-10>=b||10<=b)&&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&&(top.ICEcoder.mouseDown||(top.ICEcoder.draggingFilesW=!1),b=!ICEcoder.draggingTab&&(top.ICEcoder.mouseX>top.ICEcoder.filesW-7&&top.ICEcoder.mouseX<top.ICEcoder.filesW+7||top.ICEcoder.draggingFilesW)?"w-resize":"auto",top.ICEcoder.content.contentWindow.document&&
|
||||
top.ICEcoder.filesFrame.contentWindow)){top.document.body.style.cursor=b;if(a=top.ICEcoder.content.contentWindow.document.body)a.style.cursor=b;if(a=top.ICEcoder.filesFrame.contentWindow.document.body)a.style.cursor=b}},serverMessage:function(a){var b=top.get("serverMessage");a?(b.innerHTML=top.ICEcoder.xssClean(a).replace(/<b>/g,"<b>").replace(/<\/b>/g,"</b>").replace(/<br>/g,"<br>"),b.style.left="0"):setTimeout(function(){b.style.left="2000px"},200);b.style.opacity=a?1:0},cssColorPreview:function(){var a,
|
||||
b;var c=ICEcoder.getcMInstance();var d=ICEcoder.getcMdiffInstance();if(c=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?d:c){d=c.getLine(c.getCursor().line);for(a=/(#[\da-f]{3}(?:[\da-f]{3})?\b|\b(?:rgb|hsl)a?\([\s\d%,.-]+\)|\b[a-z]+\b)/gi;(b=a.exec(d))&&c.getCursor().ch>b.index+b[0].length;);(d=top.get("content").contentWindow.document.getElementById("cssColor"))&&d.parentNode.removeChild(d);top.ICEcoder.codeAssist&&"CSS"==top.ICEcoder.caretLocType&&(d=top.document.createElement("div"),d.id=
|
||||
"cssColor",d.style.position="absolute",d.style.display="block",d.style.width=d.style.height="20px",d.style.zIndex="1000",d.style.background=b?b[0]:"",d.style.cursor="pointer",d.onclick=function(){top.ICEcoder.showColorPicker(b[0])},""==d.style.backgroundColor&&(d.style.display="none"),top.get("header").appendChild(d),c.addWidget(c.getCursor(),top.get("cssColor"),!0))}},showColorPicker:function(a){top.get("blackMask").style.visibility="visible";top.get("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.get(\'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.get(\'colorRGB\').value)" value="insert >" class="insertColorValue">';
|
||||
farbtastic("picker","color");a&&top.get("picker").farbtastic.setColor(a)},initCanvasImage:function(a){var b=top.get("canvasPicker").getContext("2d");var c=new Image;c.crossOrigin="Anonymous";c.src=a.src;c.onerror=function(){get("floatingContainer").style.visibility="hidden";get("canvasPickerColorInfo").style.display="none";get("canvasPickerCORSInfo").style.display="block"};c.onload=function(){top.get("canvasPicker").width=a.width;top.get("canvasPicker").height=a.height;b.drawImage(c,0,0,a.width,a.height);
|
||||
get("canvasPickerColorInfo").style.display="block";get("canvasPickerCORSInfo").style.display="none";top.get("canvasPicker").onmouseover=function(a){get("floatingContainer").style.visibility="visible"};top.get("canvasPicker").onmouseout=function(a){get("floatingContainer").style.visibility="hidden"}};top.document.getElementById("floatingContainer").style.backgroundSize=5*a.naturalWidth+"px "+5*a.naturalHeight+"px"},interactCanvasImage:function(a){var b,c,d,e,f,g,m,h,l,n,p,k;var r=top.get("canvasPicker").getContext("2d");
|
||||
top.get("canvasPicker").onmousemove=function(t){b=t.pageX-this.offsetLeft;c=t.pageY-this.offsetTop;d=r.getImageData(b,c,1,1).data;e=d[0];f=d[1];g=d[2];m=e+","+f+","+g;h=top.ICEcoder.rgbToHex(e,f,g);top.get("rgbMouseXY").value=m;top.get("hexMouseXY").value="#"+h;top.get("hexMouseXY").style.backgroundColor=top.get("rgbMouseXY").style.backgroundColor="#"+h;l=128>e||128>f||128>g&&200>e&&200>f&&50<g?"#fff":"#000";top.get("hexMouseXY").style.color=top.get("rgbMouseXY").style.color=l;n=get("floatingContainer");
|
||||
n.style.left=top.ICEcoder.mouseX+20+"px";n.style.top=top.ICEcoder.mouseY+"px";p=-(a.naturalWidth/a.width*b*5)+25;k=-(a.naturalHeight/a.height*c*5)+25;n.style.backgroundPosition=p+"px "+k+"px"};top.get("canvasPicker").onclick=function(){top.get("rgb").value=top.get("rgbMouseXY").value;top.get("hex").value=top.get("hexMouseXY").value;top.get("hex").style.backgroundColor=top.get("rgb").style.backgroundColor=top.get("hex").value;top.get("hex").style.color=top.get("rgb").style.color=l}},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=ICEcoder.getcMInstance();var c=ICEcoder.getcMdiffInstance();b=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?c:b;c=b.getTokenAt(b.getCursor());b.replaceRange(a,{line:b.getCursor().line,ch:c.start},{line:b.getCursor().line,
|
||||
ch:1E6})},fMIconVis:function(a,b){var c;if(c=top.get(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},startPluginIntervals:function(a,b,c,d){-1<b.indexOf("?")&&(b=b+"&csrf="+top.ICEcoder.csrf);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,b;top.ICEcoder.codeAssist=!top.ICEcoder.codeAssist;top.get("codeAssistDisplay").style.backgroundPosition=top.ICEcoder.codeAssist?"0 0":"-16px 0";top.ICEcoder.cssColorPreview();top.ICEcoder.focus(-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?"diff":!1);for(i=0;i<top.ICEcoder.cMInstances.length;i++)if(a=
|
||||
top.ICEcoder.openFiles[i],a=a.split("."),a=a[a.length-1],"js"==a||"json"==a)a=top.ICEcoder.content.contentWindow["cM"+top.ICEcoder.cMInstances[i]],b=top.ICEcoder.content.contentWindow["cM"+top.ICEcoder.cMInstances[i]+"diff"],top.ICEcoder.codeAssist?(a.setOption("lint",!0),b.setOption("lint",!0)):(a.clearGutter("CodeMirror-lint-markers"),a.setOption("lint",!1),b.clearGutter("CodeMirror-lint-markers"),b.setOption("lint",!1))},serverQueue:function(a,b,c,d){var e,f,g,k,h;if(-1!==ICEcoder.serverQueueItems.indexOf(b))top.ICEcoder.serverMessage(),
|
||||
top.ICEcoder.serverQueue("del",0);else{e=ICEcoder.getcMInstance();for(g=f=0;g<ICEcoder.serverQueueItems.length;g++)0<ICEcoder.serverQueueItems[g].indexOf("action=save")&&f++;f++;if("add"==a)ICEcoder.serverQueueItems.push(b),0<b.indexOf("action=save")&&(g=document.createElement("textarea"),g.setAttribute("id","saveTemp"+f),document.body.appendChild(g),0<b.indexOf("saveType=saveAs")||0<b.indexOf("fileVersion=undefined")?top.get("saveTemp"+f).value=e.getValue():top.get("saveTemp"+f).value=d);else if("del"==
|
||||
a){if(ICEcoder.serverQueueItems[0]&&0<ICEcoder.serverQueueItems[0].indexOf("action=save")){d=f-1;for(g=1;g<d;g++)top.get("saveTemp"+g).value=top.get("saveTemp"+(g+1)).value;d=top.get("saveTemp"+d);d.parentNode.removeChild(d)}ICEcoder.serverQueueItems.splice(0,1)}if("del"==a&&1<=ICEcoder.serverQueueItems.length||1==ICEcoder.serverQueueItems.length)b&&-1==b.indexOf("saveFiles=")&&-1==b.indexOf("action=load")?(k=top.ICEcoder.xhrObj(),k.onreadystatechange=function(){4==k.readyState&&(200==k.status?(h=
|
||||
JSON.parse(k.responseText),h.action.timeEnd=(new Date).getTime(),h.action.timeTaken=h.action.timeEnd-h.action.timeStart,0<=["raw","both"].indexOf(top.ICEcoder.fileDirResOutput)&&console.log(k.responseText),0<=["object","both"].indexOf(top.ICEcoder.fileDirResOutput)&&console.log(h),h.status.error?(top.ICEcoder.message(h.status.errorMsg),console.log("ICEcoder error info for your request..."),console.log(h),top.ICEcoder.serverMessage(),top.ICEcoder.serverQueue("del",0)):eval(h.action.doNext)):(top.ICEcoder.message(top.t["Sorry there was..."]),
|
||||
console.log("ICEcoder error info for your request..."),console.log(h),top.ICEcoder.serverMessage(),top.ICEcoder.serverQueue("del",0)))},k.open("POST",ICEcoder.serverQueueItems[0],!0),k.setRequestHeader("Content-type","application/x-www-form-urlencoded"),a=(new Date).getTime(),0<b.indexOf("action=saveAs")?k.send("timeStart="+a+"&file="+c+"&contents="+encodeURIComponent(top.document.getElementById("saveTemp1").value)):0<b.indexOf("action=save")?k.send("timeStart="+a+"&file="+c+"&changes="+encodeURIComponent(top.document.getElementById("saveTemp1").value)):
|
||||
k.send("timeStart="+a+"&file="+c)):setTimeout(function(){"undefined"!=typeof ICEcoder.serverQueueItems[0]&&(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.get("loadingMask"));top.ICEcoder.serverMessage('<b style="color: #d00">'+top.t["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+"&csrf="+top.ICEcoder.csrf);top.ICEcoder.updateLast10List(a)},updateLast10List:function(a){var b,c,d;a=a.split(",");for(var e=0;e<a.length;e++)"CLEAR"!=a[e]&&(b='<li class="pft-file ext-'+a[e].substring(a[e].lastIndexOf(".")+
|
||||
1)+'" style="margin-left: -21px"><a style="cursor:pointer" onclick="top.ICEcoder.openFile(\''+a[e].replace(/\|/g,"/")+"')\">"+a[e].replace(/\|/g,"/")+"</a></li>\n",c=top.ICEcoder.content.contentWindow.document.getElementById("last10Files"),-1==c.innerHTML.indexOf(b)&&(d=c.innerHTML.split("\n"),(10<=d.length||'<div style="display: inline-block; margin-left: -39px; margin-top: -4px">[none]</div><br><br>'==d[0]||""==d[d.length-1])&&d.pop(),c.innerHTML=b+d.join("\n")))},autoOpenFiles:function(){if(0<
|
||||
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(){top.ICEcoder.codeAssist=!top.ICEcoder.codeAssist;top.get("codeAssistDisplay").style.backgroundPosition=top.ICEcoder.codeAssist?"0 0":"-16px 0";top.ICEcoder.cssColorPreview();top.ICEcoder.focus(-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?"diff":!1);for(i=0;i<top.ICEcoder.cMInstances.length;i++){var a=
|
||||
top.ICEcoder.openFiles[i];a=a.split(".");a=a[a.length-1];if("js"==a||"json"==a){a=top.ICEcoder.content.contentWindow["cM"+top.ICEcoder.cMInstances[i]];var b=top.ICEcoder.content.contentWindow["cM"+top.ICEcoder.cMInstances[i]+"diff"];top.ICEcoder.codeAssist?(a.setOption("lint",!0),b.setOption("lint",!0)):(a.clearGutter("CodeMirror-lint-markers"),a.setOption("lint",!1),b.clearGutter("CodeMirror-lint-markers"),b.setOption("lint",!1))}}},serverQueue:function(a,b,c,d){var e,f,g;if(-1!==ICEcoder.serverQueueItems.indexOf(b))top.ICEcoder.serverMessage(),
|
||||
top.ICEcoder.serverQueue("del",0);else{var m=ICEcoder.getcMInstance();for(f=e=0;f<ICEcoder.serverQueueItems.length;f++)0<ICEcoder.serverQueueItems[f].indexOf("action=save")&&e++;e++;if("add"==a)ICEcoder.serverQueueItems.push(b),0<b.indexOf("action=save")&&(f=document.createElement("textarea"),f.setAttribute("id","saveTemp"+e),document.body.appendChild(f),0<b.indexOf("saveType=saveAs")||0<b.indexOf("fileVersion=undefined")?top.get("saveTemp"+e).value=m.getValue():top.get("saveTemp"+e).value=d);else if("del"==
|
||||
a){if(ICEcoder.serverQueueItems[0]&&0<ICEcoder.serverQueueItems[0].indexOf("action=save")){d=e-1;for(f=1;f<d;f++)top.get("saveTemp"+f).value=top.get("saveTemp"+(f+1)).value;d=top.get("saveTemp"+d);d.parentNode.removeChild(d)}ICEcoder.serverQueueItems.splice(0,1)}if("del"==a&&1<=ICEcoder.serverQueueItems.length||1==ICEcoder.serverQueueItems.length)if(b&&-1==b.indexOf("saveFiles=")&&-1==b.indexOf("action=load")){var h=top.ICEcoder.xhrObj();h.onreadystatechange=function(){4==h.readyState&&(200==h.status?
|
||||
(g=JSON.parse(h.responseText),g.action.timeEnd=(new Date).getTime(),g.action.timeTaken=g.action.timeEnd-g.action.timeStart,0<=["raw","both"].indexOf(top.ICEcoder.fileDirResOutput)&&console.log(h.responseText),0<=["object","both"].indexOf(top.ICEcoder.fileDirResOutput)&&console.log(g),g.status.error?(top.ICEcoder.message(g.status.errorMsg),console.log("ICEcoder error info for your request..."),console.log(g),top.ICEcoder.serverMessage(),top.ICEcoder.serverQueue("del",0)):eval(g.action.doNext)):(top.ICEcoder.message(top.t["Sorry there was..."]),
|
||||
console.log("ICEcoder error info for your request..."),console.log(g),top.ICEcoder.serverMessage(),top.ICEcoder.serverQueue("del",0)))};h.open("POST",ICEcoder.serverQueueItems[0],!0);h.setRequestHeader("Content-type","application/x-www-form-urlencoded");a=(new Date).getTime();0<b.indexOf("action=saveAs")?h.send("timeStart="+a+"&file="+c+"&contents="+encodeURIComponent(top.document.getElementById("saveTemp1").value)):0<b.indexOf("action=save")?h.send("timeStart="+a+"&file="+c+"&changes="+encodeURIComponent(top.document.getElementById("saveTemp1").value)):
|
||||
h.send("timeStart="+a+"&file="+c)}else setTimeout(function(){"undefined"!=typeof ICEcoder.serverQueueItems[0]&&(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.get("loadingMask"));top.ICEcoder.serverMessage('<b style="color: #d00">'+top.t["Cancelled tasks"]+"</b>");
|
||||
setTimeout(function(){top.ICEcoder.serverMessage()},2E3)},setPreviousFiles:function(){var 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+"&csrf="+top.ICEcoder.csrf);top.ICEcoder.updateLast10List(a)},updateLast10List:function(a){a=a.split(",");for(var b=0;b<a.length;b++)if("CLEAR"!=a[b]){var c='<li class="pft-file ext-'+a[b].substring(a[b].lastIndexOf(".")+
|
||||
1)+'" style="margin-left: -21px"><a style="cursor:pointer" onclick="top.ICEcoder.openFile(\''+a[b].replace(/\|/g,"/")+"')\">"+a[b].replace(/\|/g,"/")+"</a></li>\n";var d=top.ICEcoder.content.contentWindow.document.getElementById("last10Files");if(-1==d.innerHTML.indexOf(c)){var e=d.innerHTML.split("\n");(10<=e.length||'<div style="display: inline-block; margin-left: -39px; margin-top: -4px">[none]</div><br><br>'==e[0]||""==e[e.length-1])&&e.pop();d.innerHTML=c+e.join("\n")}}},autoOpenFiles:function(){if(0<
|
||||
top.ICEcoder.previousFiles.length&&top.ICEcoder.ask(top.t["Open previous files"]+"\n\n"+top.ICEcoder.previousFiles.length+" files:\n"+top.ICEcoder.previousFiles.join("\n").replace(/\|/g,"/").replace(new RegExp(top.docRoot+top.iceRoot,"gi"),"")))for(var a=0;a<top.ICEcoder.previousFiles.length;a++)top.ICEcoder.thisFileFolderLink=top.ICEcoder.previousFiles[a].replace("|","/"),top.ICEcoder.thisFileFolderType="file",top.ICEcoder.openFile()},settingsScreen:function(a){a||(top.get("mediaContainer").innerHTML=
|
||||
'<iframe src="lib/settings-screen.php" class="whiteGlow" style="width: 970px; height: 610px"></iframe>');top.ICEcoder.showHide(a?"hide":"show",top.get("blackMask"))},helpScreen:function(){top.get("mediaContainer").innerHTML='<iframe src="lib/help.php" class="whiteGlow" style="width: 840px; height: 465px"></iframe>';top.ICEcoder.showHide("show",top.get("blackMask"))},versionsScreen:function(a,b){top.get("mediaContainer").innerHTML='<iframe src="lib/backup-versions.php?file='+a+"&csrf="+top.ICEcoder.csrf+
|
||||
'" class="whiteGlow" style="width: 970px; height: 640px"></iframe>';top.ICEcoder.showHide("show",top.get("blackMask"))},showManual:function(a,b){var c;c=b?"#"+b:"";top.get("mediaContainer").innerHTML='<iframe src="https://icecoder.net/manual?version='+a+c+'" class="whiteGlow" style="width: 800px; height: 470px"></iframe>';top.ICEcoder.showHide("show",top.get("blackMask"))},propertiesScreen:function(a){top.get("mediaContainer").innerHTML='<iframe src="lib/properties.php?fileName='+a.replace(/\//g,
|
||||
"|")+"&csrf="+top.ICEcoder.csrf+'" class="whiteGlow" style="width: 660px; height: 330px"></iframe>';top.ICEcoder.showHide("show",top.get("blackMask"))},autoLogoutWarningScreen:function(){top.get("mediaContainer").innerHTML='<iframe src="lib/auto-logout-warning.php" id="autoLogoutIFrame" class="whiteGlow" style="width: 400px; height: 160px"></iframe>';top.ICEcoder.showHide("show",top.get("blackMask"))},pluginsManager:function(){top.get("mediaContainer").innerHTML='<iframe src="lib/plugins-manager.php" class="whiteGlow" style="width: 800px; height: 450px"></iframe>';
|
||||
'" class="whiteGlow" style="width: 970px; height: 640px"></iframe>';top.ICEcoder.showHide("show",top.get("blackMask"))},showManual:function(a,b){var c=b?"#"+b:"";top.get("mediaContainer").innerHTML='<iframe src="https://icecoder.net/manual?version='+a+c+'" class="whiteGlow" style="width: 800px; height: 470px"></iframe>';top.ICEcoder.showHide("show",top.get("blackMask"))},propertiesScreen:function(a){top.get("mediaContainer").innerHTML='<iframe src="lib/properties.php?fileName='+a.replace(/\//g,"|")+
|
||||
"&csrf="+top.ICEcoder.csrf+'" class="whiteGlow" style="width: 660px; height: 330px"></iframe>';top.ICEcoder.showHide("show",top.get("blackMask"))},autoLogoutWarningScreen:function(){top.get("mediaContainer").innerHTML='<iframe src="lib/auto-logout-warning.php" id="autoLogoutIFrame" class="whiteGlow" style="width: 400px; height: 160px"></iframe>';top.ICEcoder.showHide("show",top.get("blackMask"))},pluginsManager:function(){top.get("mediaContainer").innerHTML='<iframe src="lib/plugins-manager.php" class="whiteGlow" style="width: 800px; height: 450px"></iframe>';
|
||||
top.ICEcoder.showHide("show",top.get("blackMask"))},goLocalhostRoot:function(){top.ICEcoder.filesFrame.contentWindow.frames.fileControl.location.href="lib/go-localhost-root.php"},githubAction:function(a){top.get("mediaContainer").innerHTML='<iframe src="lib/github.php?action='+a+"&selectedFiles="+top.ICEcoder.selectedFiles.join(";")+"&csrf="+top.ICEcoder.csrf+'" class="whiteGlow" style="width: 340px; height: 340px"></iframe>';top.ICEcoder.showHide("show",top.get("blackMask"))},githubTokenAsk:function(a){if(githubAuthToken=
|
||||
top.ICEcoder.getInput(top.t["Please enter your..."],""))top.ICEcoder.filesFrame.contentWindow.frames.fileControl.location.href="lib/github.php?action=auth&token="+githubAuthToken+"&goNext="+a+"&csrf="+top.ICEcoder.csrf,githubAuthToken=""},showHideGithubNav:function(a){top.get("githubNav").style.display="show"==a?"block":"none";top.get("fileNav").style.display="show"==a?"none":"block"},githubManager:function(){top.ICEcoder.githubAuthTokenSet?(top.get("mediaContainer").innerHTML='<iframe src="lib/github-manager.php" class="whiteGlow" style="width: 660px; height: 450px"></iframe>',
|
||||
top.ICEcoder.showHide("show",top.get("blackMask"))):top.ICEcoder.githubTokenAsk("showManager")},githubDiffToggle:function(){var a;if(!top.ICEcoder.githubAuthTokenSet)top.ICEcoder.githubTokenAsk("loadFiles");else if(top.ICEcoder.githubDiff||top.ICEcoder.ask(top.t["This will compare..."]))top.ICEcoder.githubDiff=!top.ICEcoder.githubDiff,a=top.ICEcoder.githubDiff?"true":"false",top.ICEcoder.filesFrame.src="files.php?githubDiff="+a+"&csrf="+top.ICEcoder.csrf},ftpManager:function(){top.get("mediaContainer").innerHTML=
|
||||
'<iframe src="lib/ftp-manager.php" class="whiteGlow" style="width: 660px; height: 550px"></iframe>';top.ICEcoder.showHide("show",top.get("blackMask"))},useNewSettings:function(a,b,c,d,e,f,g,k,h,l,p,n,m,r,t,w,v,x,y,z,A,B,C,D){var q,u=a.slice(0,a.lastIndexOf("?")),u=u.slice(u.lastIndexOf("/")+1,u.lastIndexOf("."));top.ICEcoder.theme!==u&&(top.ICEcoder.theme=u,"editor"==top.ICEcoder.theme&&(top.ICEcoder.theme="icecoder"),q=document.createElement("link"),q.setAttribute("rel","stylesheet"),q.setAttribute("type",
|
||||
"text/css"),q.setAttribute("href",a),top.ICEcoder.content.contentWindow.document.getElementsByTagName("head")[0].appendChild(q),q=document.createElement("link"),q.setAttribute("rel","stylesheet"),q.setAttribute("type","text/css"),q.setAttribute("href",a),top.document.getElementsByTagName("head")[0].appendChild(q),q=-1<"3024-day base16-light eclipse elegant mdn-like neat neo paraiso-light solarized the-matrix xq-light".split(" ").indexOf(top.ICEcoder.theme)?"#ccc":-1<"3024-night blackboard colorforth liquibyte night tomorrow-night-bright tomorrow-night-eighties vibrant-ink".split(" ").indexOf(top.ICEcoder.theme)?
|
||||
"#888":"#000",top.ICEcoder.switchTab(top.ICEcoder.selectedTab));b!=top.ICEcoder.codeAssist&&(top.get("codeAssist").checked=b,top.ICEcoder.codeAssistToggle());c!=top.ICEcoder.lockedNav&&(top.ICEcoder.lockUnlockNav(),ICEcoder.changeFilesW(c?"expand":"contract"),top.ICEcoder.hideFileMenu());a=top.document.styleSheets[0];b=a.rules?"rules":"cssRules";a[b][0].style.fontSize=g;a=ICEcoder.filesFrame.contentWindow.document.styleSheets[3];b=a.rules?"rules":"cssRules";a[b][0].style.fontSize=g;a=ICEcoder.content.contentWindow.document.styleSheets[4];
|
||||
b=a.rules?"rules":"cssRules";a[b][0].style.fontSize=g;a[b][4].style["border-left-width"]=f?"1px":"0";a[b][4].style["margin-left"]=f?"-1px":"0";a[b][2].style.cssText="background-color: "+q+" !important";top.ICEcoder.lineWrapping=k;top.ICEcoder.lineNumbers=h;top.ICEcoder.showTrailingSpace=l;top.ICEcoder.matchBrackets=p;top.ICEcoder.autoCloseTags=n;top.ICEcoder.autoCloseBrackets=m;top.ICEcoder.indentWithTabs=r;top.ICEcoder.indentSize=w;top.ICEcoder.indentAuto=t;for(f=0;f<ICEcoder.cMInstances.length;f++)ICEcoder.content.contentWindow["cM"+
|
||||
top.ICEcoder.showHide("show",top.get("blackMask"))):top.ICEcoder.githubTokenAsk("showManager")},githubDiffToggle:function(){if(!top.ICEcoder.githubAuthTokenSet)top.ICEcoder.githubTokenAsk("loadFiles");else if(top.ICEcoder.githubDiff||top.ICEcoder.ask(top.t["This will compare..."])){top.ICEcoder.githubDiff=!top.ICEcoder.githubDiff;var a=top.ICEcoder.githubDiff?"true":"false";top.ICEcoder.filesFrame.src="files.php?githubDiff="+a+"&csrf="+top.ICEcoder.csrf}},ftpManager:function(){top.get("mediaContainer").innerHTML=
|
||||
'<iframe src="lib/ftp-manager.php" class="whiteGlow" style="width: 660px; height: 550px"></iframe>';top.ICEcoder.showHide("show",top.get("blackMask"))},useNewSettings:function(a,b,c,d,e,f,g,m,h,l,n,p,k,r,t,w,v,x,y,z,A,B,C,D){var u=a.slice(0,a.lastIndexOf("?"));u=u.slice(u.lastIndexOf("/")+1,u.lastIndexOf("."));if(top.ICEcoder.theme!==u){top.ICEcoder.theme=u;"editor"==top.ICEcoder.theme&&(top.ICEcoder.theme="icecoder");var q=document.createElement("link");q.setAttribute("rel","stylesheet");q.setAttribute("type",
|
||||
"text/css");q.setAttribute("href",a);top.ICEcoder.content.contentWindow.document.getElementsByTagName("head")[0].appendChild(q);q=document.createElement("link");q.setAttribute("rel","stylesheet");q.setAttribute("type","text/css");q.setAttribute("href",a);top.document.getElementsByTagName("head")[0].appendChild(q);q=-1<"3024-day base16-light eclipse elegant mdn-like neat neo paraiso-light solarized the-matrix xq-light".split(" ").indexOf(top.ICEcoder.theme)?"#ccc":-1<"3024-night blackboard colorforth liquibyte night tomorrow-night-bright tomorrow-night-eighties vibrant-ink".split(" ").indexOf(top.ICEcoder.theme)?
|
||||
"#888":"#000";top.ICEcoder.switchTab(top.ICEcoder.selectedTab)}b!=top.ICEcoder.codeAssist&&(top.get("codeAssist").checked=b,top.ICEcoder.codeAssistToggle());c!=top.ICEcoder.lockedNav&&(top.ICEcoder.lockUnlockNav(),ICEcoder.changeFilesW(c?"expand":"contract"),top.ICEcoder.hideFileMenu());a=top.document.styleSheets[0];b=a.rules?"rules":"cssRules";a[b][0].style.fontSize=g;a=ICEcoder.filesFrame.contentWindow.document.styleSheets[3];b=a.rules?"rules":"cssRules";a[b][0].style.fontSize=g;a=ICEcoder.content.contentWindow.document.styleSheets[6];
|
||||
b=a.rules?"rules":"cssRules";a[b][0].style.fontSize=g;a[b][4].style["border-left-width"]=f?"1px":"0";a[b][4].style["margin-left"]=f?"-1px":"0";a[b][2].style.cssText="background-color: "+q+" !important";top.ICEcoder.lineWrapping=m;top.ICEcoder.lineNumbers=h;top.ICEcoder.showTrailingSpace=l;top.ICEcoder.matchBrackets=n;top.ICEcoder.autoCloseTags=p;top.ICEcoder.autoCloseBrackets=k;top.ICEcoder.indentWithTabs=r;top.ICEcoder.indentSize=w;top.ICEcoder.indentAuto=t;for(f=0;f<ICEcoder.cMInstances.length;f++)ICEcoder.content.contentWindow["cM"+
|
||||
ICEcoder.cMInstances[f]].setOption("lineWrapping",top.ICEcoder.lineWrapping),ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[f]].setOption("lineNumbers",top.ICEcoder.lineNumbers),ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[f]].setOption("showTrailingSpace",top.ICEcoder.showTrailingSpace),ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[f]].setOption("matchBrackets",top.ICEcoder.matchBrackets),ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[f]].setOption("autoCloseTags",
|
||||
top.ICEcoder.autoCloseTags),ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[f]].setOption("autoCloseBrackets",top.ICEcoder.autoCloseBrackets),ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[f]].setOption("indentWithTabs",top.ICEcoder.indentWithTabs),ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[f]].setOption("indentUnit",top.ICEcoder.indentSize),ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[f]].setOption("tabSize",top.ICEcoder.indentSize),ICEcoder.content.contentWindow["cM"+
|
||||
ICEcoder.cMInstances[f]].refresh(),ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[f]+"diff"].setOption("lineWrapping",top.ICEcoder.lineWrapping),ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[f]+"diff"].setOption("lineNumbers",top.ICEcoder.lineNumbers),ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[f]+"diff"].setOption("showTrailingSpace",top.ICEcoder.showTrailingSpace),ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[f]+"diff"].setOption("matchBrackets",top.ICEcoder.matchBrackets),
|
||||
@@ -152,44 +158,53 @@ ICEcoder.cMInstances[f]+"diff"].setOption("tabSize",top.ICEcoder.indentSize),ICE
|
||||
top.ICEcoder.startBugChecking():"undefined"!=typeof top.ICEcoder.bugFileCheckInt&&clearInterval(top.ICEcoder.bugFileCheckInt);top.ICEcoder.splitPane&&top.ICEcoder.updateDiffs();top.ICEcoder.githubAuthTokenSet=A;top.ICEcoder.updateDiffOnSave=B;top.ICEcoder.autoLogoutMins=C;D&&top.ICEcoder.refreshFileManager()},updateResultsDisplay:function(a){ICEcoder.findReplace(top.get("find").value,!0,!1);top.get("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+"&csrf="+top.ICEcoder.csrf},downloadFile:function(a){a=a.replace(/\//g,"|");top.ICEcoder.filesFrame.contentWindow.frames.fileControl.location.href="lib/download.php?file="+a+"&csrf="+top.ICEcoder.csrf},chmod:function(a,b){a=a.replace(top.iceRoot,"");top.ICEcoder.showHide("hide",top.get("blackMask"));top.ICEcoder.serverQueue("add","lib/file-control-xhr.php?action=perms&perms="+b+"&csrf="+top.ICEcoder.csrf,a.replace(/\+/g,"%2B"));top.ICEcoder.serverMessage("<b>chMod "+
|
||||
b+" on </b><br>"+a.replace(/\|/g,"/"))},openPreviewWindow:function(){if(0<top.ICEcoder.openFiles.length){var a,b,c,d,e;d=top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1];a=d.substr(d.lastIndexOf("/")+1);e=a.substr(a.lastIndexOf(".")+1);a=ICEcoder.getcMInstance();b=ICEcoder.getcMdiffInstance();c=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?b:a;top.ICEcoder.previewWindowLoading=!0;top.ICEcoder.previewWindow=window.open(d,"previewWindow",500,500);-1<["md"].indexOf(e)?top.ICEcoder.previewWindow.onload=
|
||||
function(){top.ICEcoder.previewWindowLoading=!1;top.ICEcoder.previewWindow.document.documentElement.innerHTML=mmd(c.getValue())}:top.ICEcoder.previewWindow.onload=function(){top.ICEcoder.previewWindowLoading=!1;try{top.ICEcoder.doPesticide()}catch(f){}try{top.ICEcoder.doStatsJS("open")}catch(f){}try{top.ICEcoder.doResponsive()}catch(f){}}}},resetAutoLogoutTimer:function(){1<top.ICEcoder.autoLogoutMins&&top.ICEcoder.autoLogoutTimer>60*top.ICEcoder.autoLogoutMins-60&&ICEcoder.showHide("hide",get("blackMask"));
|
||||
top.ICEcoder.autoLogoutTimer=0},logout:function(a){window.location=window.location+"?logout&"+(a?"type="+a+"&":"")+"csrf="+top.ICEcoder.csrf},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},update:function(){confirm(top.t["Please note for..."])?(top.ICEcoder.showHide("show",top.get("loadingMask")),
|
||||
window.location="lib/updater.php"):window.open("https://icecoder.net")},updated:function(){top.get("blackMask").style.visibility="visible";top.get("mediaContainer").innerHTML='<h1 style="color: #fff; cursor: default">Thanks for updating to v'+top.ICEcoder.versionNo+'!</h1><h2 style="color: #888; cursor: default">Click anywhere to continue using ICEcoder...</h2>'},xhrObj:function(){try{return new XMLHttpRequest}catch(a){}try{return new ActiveXObject("Msxml3.XMLHTTP")}catch(a){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(a){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(a){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(a){}try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(a){}return null},
|
||||
openBugReport:function(){var a;"off"==top.ICEcoder.bugReportStatus&&top.ICEcoder.message(top.t["You can start..."]);"error"==top.ICEcoder.bugReportStatus&&top.ICEcoder.message(top.t["Error cannot find..."]);"ok"==top.ICEcoder.bugReportStatus&&top.ICEcoder.message(top.t["No new errors..."]);"bugs"==top.ICEcoder.bugReportStatus&&(a=top.ICEcoder.openFiles.indexOf(top.ICEcoder.bugReportPath.replace(/\|/g,"/")),-1<a&&top.ICEcoder.closeTab(a+1,"dontSetPV","dontAsk"),top.ICEcoder.openFile(top.ICEcoder.bugReportPath),
|
||||
top.ICEcoder.bugFilesSizesSeen=top.ICEcoder.bugFilesSizesActual)},startBugChecking:function(){var a;0!==top.ICEcoder.bugFileCheckTimer?("undefined"!=typeof top.ICEcoder.bugFileCheckInt&&clearInterval(top.ICEcoder.bugFileCheckInt),top.ICEcoder.bugFilesSizesSeen=[],top.ICEcoder.bugFileCheckInt=setInterval(function(){a="lib/bug-files-check.php?";a+="files="+(""!==top.ICEcoder.bugFilePaths[0]?top.ICEcoder.bugFilePaths.join():"null").replace(/\//g,"|");a+="&filesSizesSeen=";if(top.ICEcoder.bugFilesSizesSeen.length!=
|
||||
b+" on </b><br>"+a.replace(/\|/g,"/"))},openPreviewWindow:function(){if(0<top.ICEcoder.openFiles.length){var a=top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1];var b=a.substr(a.lastIndexOf("/")+1);var c=b.substr(b.lastIndexOf(".")+1);b=ICEcoder.getcMInstance();var d=ICEcoder.getcMdiffInstance();var e=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?d:b;top.ICEcoder.previewWindowLoading=!0;top.ICEcoder.previewWindow=window.open(a,"previewWindow",500,500);-1<["md"].indexOf(c)?top.ICEcoder.previewWindow.onload=
|
||||
function(){top.ICEcoder.previewWindowLoading=!1;top.ICEcoder.previewWindow.document.documentElement.innerHTML=mmd(e.getValue())}:top.ICEcoder.previewWindow.onload=function(){top.ICEcoder.previewWindowLoading=!1;try{top.ICEcoder.doPesticide()}catch(f){}try{top.ICEcoder.doStatsJS("open")}catch(f){}try{top.ICEcoder.doResponsive()}catch(f){}}}},resetAutoLogoutTimer:function(){1<top.ICEcoder.autoLogoutMins&&top.ICEcoder.autoLogoutTimer>60*top.ICEcoder.autoLogoutMins-60&&ICEcoder.showHide("hide",get("blackMask"));
|
||||
top.ICEcoder.autoLogoutTimer=0},logout:function(a){window.location=window.location+"?logout&"+(a?"type="+a+"&":"")+"csrf="+top.ICEcoder.csrf},outputMsg:function(a){top.ICEcoder.output.innerHTML+=a+"<br>"},message:function(a){alert(a)},ask:function(a){return confirm(a)},getInput:function(a,b){return prompt(a,b)},dataMessage:function(a){var b=top.ICEcoder.content.contentWindow.document.getElementById("dataMessage");b.style.display="block";b.innerHTML=a},update:function(){confirm(top.t["Please note for..."])?
|
||||
(top.ICEcoder.showHide("show",top.get("loadingMask")),window.location="lib/updater.php"):window.open("https://icecoder.net")},updated:function(){top.get("blackMask").style.visibility="visible";top.get("mediaContainer").innerHTML='<h1 style="color: #fff; cursor: default">Thanks for updating to v'+top.ICEcoder.versionNo+'!</h1><h2 style="color: #888; cursor: default">Click anywhere to continue using ICEcoder...</h2>'},xhrObj:function(){try{return new XMLHttpRequest}catch(a){}try{return new ActiveXObject("Msxml3.XMLHTTP")}catch(a){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(a){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(a){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(a){}try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(a){}return null},
|
||||
openBugReport:function(){"off"==top.ICEcoder.bugReportStatus&&top.ICEcoder.message(top.t["You can start..."]);"error"==top.ICEcoder.bugReportStatus&&top.ICEcoder.message(top.t["Error cannot find..."]);"ok"==top.ICEcoder.bugReportStatus&&top.ICEcoder.message(top.t["No new errors..."]);if("bugs"==top.ICEcoder.bugReportStatus){var a=top.ICEcoder.openFiles.indexOf(top.ICEcoder.bugReportPath.replace(/\|/g,"/"));-1<a&&top.ICEcoder.closeTab(a+1,"dontSetPV","dontAsk");top.ICEcoder.openFile(top.ICEcoder.bugReportPath);
|
||||
top.ICEcoder.bugFilesSizesSeen=top.ICEcoder.bugFilesSizesActual}},startBugChecking:function(){var a;0!==top.ICEcoder.bugFileCheckTimer?("undefined"!=typeof top.ICEcoder.bugFileCheckInt&&clearInterval(top.ICEcoder.bugFileCheckInt),top.ICEcoder.bugFilesSizesSeen=[],top.ICEcoder.bugFileCheckInt=setInterval(function(){a="lib/bug-files-check.php?";a+="files="+(""!==top.ICEcoder.bugFilePaths[0]?top.ICEcoder.bugFilePaths.join():"null").replace(/\//g,"|");a+="&filesSizesSeen=";if(top.ICEcoder.bugFilesSizesSeen.length!=
|
||||
top.ICEcoder.bugFilePaths.length)for(var b=0;b<top.ICEcoder.bugFilePaths.length;b++)top.ICEcoder.bugFilesSizesSeen[b]="null";a+=top.ICEcoder.bugFilesSizesSeen.join();a+="&maxLines="+top.ICEcoder.bugFileMaxLines;a+="&csrf="+top.ICEcoder.csrf;var c=top.ICEcoder.xhrObj();c.onreadystatechange=function(){if(4==c.readyState&&200==c.status){var a=JSON.parse(c.responseText);top.get("bugIcon").style.backgroundPosition="off"==a.result?"0 0":"ok"==a.result?"-32px 0":"bugs"==a.result?"-48px 0":"-16px 0";top.ICEcoder.bugReportStatus=
|
||||
a.result;"null"==top.ICEcoder.bugFilesSizesSeen[0]&&(top.ICEcoder.bugFilesSizesSeen=a.filesSizesSeen);top.ICEcoder.bugFilesSizesActual=a.filesSizesSeen;top.ICEcoder.bugReportPath=a.bugReportPath}};c.open("GET",a,!0);c.send()},parseInt(1E3*top.ICEcoder.bugFileCheckTimer,10)),top.ICEcoder.bugReportStatus="ok"):"undefined"!=typeof top.ICEcoder.bugFileCheckInt&&clearInterval(top.ICEcoder.bugFileCheckInt)},xssClean:function(a){return a.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,
|
||||
""").replace(/'/g,"'")},printCode:function(){var a,b;a=top.ICEcoder.getcMInstance();b=top.ICEcoder.getcMdiffInstance();a=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?b:a;b=top.ICEcoder.filesFrame.contentWindow.frames.fileControl;b.window.document.body.innerHTML='<!DOCTYPE html><head><title>ICEcoder code output</title></head><body><pre style="white-space: pre-wrap">'+top.ICEcoder.xssClean(a.getValue())+"</pre></body></html>";b.focus();b.print();a.focus()},indicateChanges:function(){var a;
|
||||
if(!top.ICEcoder.loadingFile){a="ICEcoder v "+top.ICEcoder.versionNo;for(var b=1;b<=top.ICEcoder.savedPoints.length;b++)if(top.ICEcoder.savedPoints[b-1]!=top.ICEcoder.getcMInstance(b).changeGeneration()){a+=" \u2744";break}top.document.title=a}},switchTab:function(a,b){var c,d;ICEcoder.selectedTab=a;c=ICEcoder.getcMInstance();d=ICEcoder.getcMdiffInstance();if(-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?d:c){ICEcoder.switchMode();for(var e=0;e<ICEcoder.cMInstances.length;e++)ICEcoder.content.contentWindow["cM"+
|
||||
ICEcoder.cMInstances[e]].getWrapperElement().style.display="none",ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[e]+"diff"].getWrapperElement().style.display="none";c.setOption("theme",top.ICEcoder.theme);d.setOption("theme",top.ICEcoder.theme+" diff");c.getWrapperElement().style.display="block";d.getWrapperElement().style.display="block";top.ICEcoder.splitPane&&top.ICEcoder.updateDiffs();b||setTimeout(function(){top.ICEcoder.focus()},4);c.refresh();d.refresh();top.ICEcoder.updateFunctionClassList();
|
||||
"undefined"!=typeof top.doMiniNav&&clearTimeout(top.doMiniNav);top.doMiniNav=setTimeout(function(){top.ICEcoder.setMinimap()},top.ICEcoder.loadingFile?0:100);get("docExplorer").style.display="block";get("docExplorer").style.right="-400px";ICEcoder.redoTabHighlight(ICEcoder.selectedTab);top.ICEcoder.findMode=!1;ICEcoder.findReplace(top.get("find").value,!0,!1);top.ICEcoder.updateVersionsDisplay();top.ICEcoder.getCaretPosition();top.ICEcoder.updateCharDisplay();top.ICEcoder.updateByteDisplay()}},newTab:function(a){var b;
|
||||
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();b=ICEcoder.getcMInstance("new");ICEcoder.switchTab(ICEcoder.openFiles.length);b.removeLineClass(ICEcoder["cMActiveLinecM"+ICEcoder.cMInstances[top.ICEcoder.selectedTab-1]],
|
||||
"background");ICEcoder["cMActiveLinecM"+ICEcoder.selectedTab]=b.addLineClass(0,"background","cm-s-activeLine");ICEcoder.nextcMInstance++;a&&top.ICEcoder.saveFile()},createNewTab:function(a){var b;top.ICEcoder.openFiles.push(top.ICEcoder.shortURL);top.get("tab"+top.ICEcoder.openFiles.length).style.display="inline-block";b=top.ICEcoder.openFiles[top.ICEcoder.openFiles.length-1];top.get("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> '+
|
||||
""").replace(/'/g,"'")},printCode:function(){var a=top.ICEcoder.getcMInstance();var b=top.ICEcoder.getcMdiffInstance();a=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?b:a;b=top.ICEcoder.filesFrame.contentWindow.frames.fileControl;b.window.document.body.innerHTML='<!DOCTYPE html><head><title>ICEcoder code output</title></head><body><pre style="white-space: pre-wrap">'+top.ICEcoder.xssClean(a.getValue())+"</pre></body></html>";b.focus();b.print();a.focus()},indicateChanges:function(){if(!top.ICEcoder.loadingFile){var a=
|
||||
"ICEcoder v "+top.ICEcoder.versionNo;for(var b=1;b<=top.ICEcoder.savedPoints.length;b++)if(top.ICEcoder.savedPoints[b-1]!=top.ICEcoder.getcMInstance(b).changeGeneration()){a+=" \u2744";break}top.document.title=a}},switchTab:function(a,b){a!==top.ICEcoder.selectedTab&&(top.ICEcoder.prevTab=top.ICEcoder.selectedTab);ICEcoder.selectedTab=a;var c=ICEcoder.getcMInstance();var d=ICEcoder.getcMdiffInstance();if(-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?d:c){ICEcoder.switchMode();for(var e=0;e<
|
||||
ICEcoder.cMInstances.length;e++)ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[e]].getWrapperElement().style.display="none",ICEcoder.content.contentWindow["cM"+ICEcoder.cMInstances[e]+"diff"].getWrapperElement().style.display="none";c.setOption("theme",top.ICEcoder.theme);d.setOption("theme",top.ICEcoder.theme+" diff");c.getWrapperElement().style.display="block";d.getWrapperElement().style.display="block";top.ICEcoder.splitPane&&top.ICEcoder.updateDiffs();b||setTimeout(function(){top.ICEcoder.focus()},
|
||||
4);c.refresh();d.refresh();top.ICEcoder.updateFunctionClassList();"undefined"!=typeof top.doMiniNav&&clearTimeout(top.doMiniNav);top.doMiniNav=setTimeout(function(){top.ICEcoder.setMinimap()},top.ICEcoder.loadingFile?0:100);get("docExplorer").style.display="block";get("docExplorer").style.right="-400px";ICEcoder.redoTabHighlight(ICEcoder.selectedTab);top.ICEcoder.findMode=!1;ICEcoder.findReplace(top.get("find").value,!0,!1);top.ICEcoder.updateVersionsDisplay();top.ICEcoder.getCaretPosition();top.ICEcoder.updateCharDisplay();
|
||||
top.ICEcoder.updateByteDisplay()}},newTab:function(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();var b=ICEcoder.getcMInstance("new");ICEcoder.switchTab(ICEcoder.openFiles.length);b.removeLineClass(ICEcoder["cMActiveLinecM"+
|
||||
ICEcoder.cMInstances[top.ICEcoder.selectedTab-1]],"background");ICEcoder["cMActiveLinecM"+ICEcoder.selectedTab]=b.addLineClass(0,"background","cm-s-activeLine");ICEcoder.nextcMInstance++;a&&top.ICEcoder.saveFile()},createNewTab:function(a){top.ICEcoder.openFiles.push(top.ICEcoder.shortURL);top.get("tab"+top.ICEcoder.openFiles.length).style.display="inline-block";var b=top.ICEcoder.openFiles[top.ICEcoder.openFiles.length-1];top.get("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> '+
|
||||
b.slice(b.lastIndexOf("/")).replace(/\//,"");top.get("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.savedPoints.push(0);top.ICEcoder.savedContents.push("");a||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.get("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> '+
|
||||
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){top.ICEcoder.openFiles[a-1]=b;var c=top.ICEcoder.openFiles[a-1];top.get("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.get("tab"+a).title="/"+top.ICEcoder.openFiles[a-1].replace(/\//,"")},redoTabHighlight:function(a){for(var b,c,d=1;d<=ICEcoder.savedPoints.length;d++)top.get("tab"+d).childNodes[0]&&(top.get("tab"+d).childNodes[0].childNodes[0].style.backgroundColor=ICEcoder.savedPoints[d-1]!=top.ICEcoder.getcMInstance(d).changeGeneration()?"#b00":"transparent"),b=d==a?top.ICEcoder.tabFGselected:top.ICEcoder.tabFGnormalTab,"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,c.style.color=d==a?top.ICEcoder.tabFGcurrent:top.ICEcoder.tabFGopenFile),top.get("tab"+d).style.color=b,top.get("tab"+d).style.background=d==a?top.ICEcoder.tabBGcurrent:top.ICEcoder.tabBGopen},closeTab:function(a,b,c){var d;a||(a=top.ICEcoder.selectedTab);ICEcoder.getcMInstance();
|
||||
ICEcoder.getcMdiffInstance();d=!0;c||ICEcoder.savedPoints[a-1]==top.ICEcoder.getcMInstance(a).changeGeneration()||(d=top.ICEcoder.ask(top.t["You have made..."]));if(d){c=top.ICEcoder.openFiles[a-1];for(d=a;d<ICEcoder.openFiles.length;d++)top.get("tab"+d).innerHTML=top.get("tab"+(d+1)).innerHTML,top.get("tab"+d).title=top.get("tab"+(d+1)).title,ICEcoder.openFiles[d-1]=ICEcoder.openFiles[d],ICEcoder.openFileMDTs[d-1]=ICEcoder.openFileMDTs[d],ICEcoder.openFileVersions[d-1]=ICEcoder.openFileVersions[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,c.style.color=d==a?top.ICEcoder.tabFGcurrent:top.ICEcoder.tabFGopenFile),top.get("tab"+d).style.color=b,top.get("tab"+d).style.background=d==a?top.ICEcoder.tabBGcurrent:top.ICEcoder.tabBGopen},closeTab:function(a,b,c){a||(a=top.ICEcoder.selectedTab);ICEcoder.getcMInstance();
|
||||
ICEcoder.getcMdiffInstance();var d=!0;c||ICEcoder.savedPoints[a-1]==top.ICEcoder.getcMInstance(a).changeGeneration()||(d=top.ICEcoder.ask(top.t["You have made..."]));if(d){c=top.ICEcoder.openFiles[a-1];for(d=a;d<ICEcoder.openFiles.length;d++)top.get("tab"+d).innerHTML=top.get("tab"+(d+1)).innerHTML,top.get("tab"+d).title=top.get("tab"+(d+1)).title,ICEcoder.openFiles[d-1]=ICEcoder.openFiles[d],ICEcoder.openFileMDTs[d-1]=ICEcoder.openFileMDTs[d],ICEcoder.openFileVersions[d-1]=ICEcoder.openFileVersions[d];
|
||||
ICEcoder.content.contentWindow["cM"+top.ICEcoder.cMInstances[a-1]].getWrapperElement().style.display="none";ICEcoder.content.contentWindow["cM"+top.ICEcoder.cMInstances[a-1]+"diff"].getWrapperElement().style.display="none";top.ICEcoder.cMInstances.splice(a-1,1);top.get("tab"+ICEcoder.openFiles.length).style.display="none";top.get("tab"+ICEcoder.openFiles.length).innerHTML="";top.get("tab"+ICEcoder.openFiles.length).title="";ICEcoder.openFiles.pop();ICEcoder.openFileMDTs.pop();ICEcoder.openFileVersions.pop();
|
||||
ICEcoder.selectedTab==a&&(0<ICEcoder.openFiles.length?--ICEcoder.selectedTab:ICEcoder.selectedTab=0);0<ICEcoder.openFiles.length&&0==ICEcoder.selectedTab&&(ICEcoder.selectedTab=1);0==ICEcoder.openFiles.length?(top.ICEcoder.fMIconVis("fMView",.3),get("docExplorer").style.display="none"):(ICEcoder.switchMode(),ICEcoder.switchTab(ICEcoder.selectedTab));top.ICEcoder.savedPoints.splice(a-1,1);top.ICEcoder.savedContents.splice(a-1,1);top.ICEcoder.redoTabHighlight(ICEcoder.selectedTab);top.ICEcoder.selectDeselectFile("deselect",
|
||||
top.ICEcoder.filesFrame.contentWindow.document.getElementById(c.replace(/\//g,"|")));b||top.ICEcoder.setPreviousFiles();top.ICEcoder.updateVersionsDisplay();top.ICEcoder.indicateChanges()}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(top.t["Close all tabs"]))for(var a=top.ICEcoder.cMInstances.length;0<a;a--)top.ICEcoder.closeTab(a,1<a?!0:
|
||||
!1);top.ICEcoder.indicateChanges()},setTabWidths:function(a){var b,c,d,e,f;if(top.ICEcoder.ready){b=parseInt(top.ICEcoder.content.style.width,10)-53-22-10;c=b/top.ICEcoder.openFiles.length-18;d=-18;e=53;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?53:parseInt(top.get("tab"+g).style.left,10),f=0==g?0:parseInt(top.get("tab"+g).style.width,10)+
|
||||
18,a?d=-18:(top.get("tab"+(g+1)).style.left=e+f+"px",top.get("tab"+(g+1)).style.width=d+"px"),top.ICEcoder.tabLeftPos.push(e+f);top.get("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)+53+18))%150;top.get("tab"+a).style.zIndex=2;for(var b=1;b<=top.ICEcoder.openFiles.length;b++)top.get("tab"+b).className=b!==a?"tab tabSlide":
|
||||
"tab tabDrag"},tabDragMove:function(){var a,b;a=parseInt(top.get("tab"+top.ICEcoder.openFiles.length).style.width,10)+18;top.ICEcoder.thisLeft=a=53<=top.ICEcoder.tabDragMouseX?top.ICEcoder.tabDragMouseX<=parseInt(top.get("newTab").style.left,10)-a?top.ICEcoder.tabDragMouseX:parseInt(top.get("newTab").style.left,10)-a:53;top.get("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.get("tab"+c).style.opacity=
|
||||
c==top.ICEcoder.draggingTab?1:.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.get("tab"+c).style.left=a<=top.ICEcoder.tabLeftPos[c-1]?top.ICEcoder.tabLeftPos[c-1]+b:top.ICEcoder.tabLeftPos[c-1]:top.get("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.get("tab"+c).className="tab",top.get("tab"+c).style.opacity=1,c!=top.ICEcoder.dragTabNo?top.get("tab"+c).style.zIndex=1:setTimeout(function(){top.get("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.savedPoints,ICEcoder.savedContents,ICEcoder.openFiles,ICEcoder.openFileMDTs,ICEcoder.openFileVersions,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++)top.get("tab"+a[e]).id="tab"+(e+1)+".temp",top.ICEcoder.selectedTab==a[e]&&(d=e+1);for(e=0;e<a.length;e++)top.get("tab"+(e+1)+".temp").id="tab"+
|
||||
(e+1);top.get("tab"+d)&&(top.get("tab"+d).className="tab tabSlide");ICEcoder.savedPoints=b[0];ICEcoder.savedContents=b[1];ICEcoder.openFiles=b[2];ICEcoder.openFileMDTs=b[3];ICEcoder.openFileVersions=b[4];ICEcoder.cMInstances=b[5];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.get("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,d,e;c=b.keyCode?b.keyCode:b.which?b.which:b.charCode;top.ICEcoder.resetAutoLogoutTimer();if(224==c||91==c||
|
||||
93==c)top.ICEcoder.cmdKey=!0;if(46==c&&"files"==a)return top.ICEcoder.deleteFiles(),!1;if(b.altKey){var f=b.ctrlKey||top.ICEcoder.cmdKey?!0:!1;return"ctrl+alt"==top.ICEcoder.tagWrapperCommand&&f||"alt-left"==top.ICEcoder.tagWrapperCommand&&!f?"content"==a?68==c?(top.ICEcoder.tagWrapper("div"),!1):83==c?(top.ICEcoder.tagWrapper("span"),!1):80==c?(top.ICEcoder.tagWrapper("p"),!1):65==c?(top.ICEcoder.tagWrapper("a"),!1):49==c?(top.ICEcoder.tagWrapper("h1"),!1):50==c?(top.ICEcoder.tagWrapper("h2"),!1):
|
||||
51==c?(top.ICEcoder.tagWrapper("h3"),!1):13==c?(top.ICEcoder.addLineBreakAtEnd(),!1):37==c?(top.ICEcoder.filesFrame.contentWindow.focus(),!1):c:37==c?(top.ICEcoder.filesFrame.contentWindow.focus(),!1):39==c?(top.ICEcoder.focus(-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?!0:!1),!1):c:13==c?(top.ICEcoder.insertLineAfter(),!1):c}if(13==c&&b.shiftKey)return top.ICEcoder.insertLineBefore(),!1;if(70!=c&&71!=c||!b.ctrlKey&&!top.ICEcoder.cmdKey){if(76==c&&(b.ctrlKey||top.ICEcoder.cmdKey))return c=
|
||||
top.get("goToLineNo"),c.select(),top.get("find").focus(),c.focus(),!1;if(73==c&&(b.ctrlKey||top.ICEcoder.cmdKey)&&"content"==a)return top.ICEcoder.searchForSelected(),!1;if(39==c&&(b.ctrlKey||top.ICEcoder.cmdKey)&&"content"!=a)return top.ICEcoder.nextTab(),!1;if(37==c&&(b.ctrlKey||top.ICEcoder.cmdKey)&&"content"!=a)return top.ICEcoder.previousTab(),!1;if(38==c&&(b.ctrlKey||top.ICEcoder.cmdKey)&&"content"==a)return top.ICEcoder.moveLines("up"),!1;if(40==c&&(b.ctrlKey||top.ICEcoder.cmdKey)&&"content"==
|
||||
a)return top.ICEcoder.moveLines("down"),!1;if(107!=c&&187!=c||!b.ctrlKey&&!top.ICEcoder.cmdKey){if(109!=c&&189!=c||!b.ctrlKey&&!top.ICEcoder.cmdKey){if(83==c&&(b.ctrlKey||top.ICEcoder.cmdKey))return b.shiftKey?top.ICEcoder.saveFile("saveAs"):top.ICEcoder.saveFile(),!1;if(13==c&&(b.ctrlKey||top.ICEcoder.cmdKey)&&"/[NEW]"!=top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1])return top.ICEcoder.resetKeys(b),window.open(top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1]),!1;if(13==c&&"files"==a)return b.ctrlKey||
|
||||
top.ICEcoder.cmdKey||(0==top.ICEcoder.selectedFiles.length&&(top.ICEcoder.overFileFolder("folder","|"),top.ICEcoder.selectFileFolder("init")),top.ICEcoder.fmAction(b,"enter")),!1;if(38!=c&&40!=c&&37!=c&&39!=c||"files"!=a)return 79==c&&(b.ctrlKey||top.ICEcoder.cmdKey)?(top.ICEcoder.openPrompt(),!1):32==c&&(b.ctrlKey||top.ICEcoder.cmdKey)&&"content"==a?(top.ICEcoder.addSnippet(),!1):74==c&&(b.ctrlKey||top.ICEcoder.cmdKey)&&"content"==a?(top.ICEcoder.jumpToDefinition(),!1):223==c&&(b.ctrlKey||top.ICEcoder.cmdKey)?
|
||||
(top.ICEcoder.lockUnlockNav(),ICEcoder.changeFilesW(top.ICEcoder.lockedNav?"expand":"contract"),!1):190==c&&(b.ctrlKey||top.ICEcoder.cmdKey)?(d=ICEcoder.getcMInstance(),e=ICEcoder.getcMdiffInstance(),d=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?e:d,d.getCursor(),!1):27==c&&"content"==a?(d=ICEcoder.getcMInstance(),e=ICEcoder.getcMdiffInstance(),d=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?e:d,1<d.getSelections().length?d.execCommand("singleSelection"):top.ICEcoder.lineCommentToggle(),
|
||||
!1):27==c&&"content"!=a?(top.ICEcoder.cancelAllActions(),!1):c;b.ctrlKey||top.ICEcoder.cmdKey||(0==top.ICEcoder.selectedFiles.length&&(top.ICEcoder.overFileFolder("folder","|"),top.ICEcoder.selectFileFolder("init")),top.ICEcoder.fmAction(b,38==c?"up":40==c?"down":37==c?"left":"right"));return!1}"content"==a?top.ICEcoder.removeLines():top.ICEcoder.closeTab(top.ICEcoder.selectedTab);return!1}"content"==a?top.ICEcoder.duplicateLines():top.ICEcoder.newTab();return!1}f=top.get("find");d=ICEcoder.getcMInstance();
|
||||
e=ICEcoder.getcMdiffInstance();d=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?e:d;d=d.getSelections();0<d.length&&0<d[0].length&&(f.value=d[0]);f.select();top.get("goToLineNo").focus();f.focus();70==c?top.get("findReplaceSubmit").click():ICEcoder.findReplace(top.document.getElementById("find").value,!1,!0,!1,"findPrevious");return!1},resetKeys:function(a){top.ICEcoder.cmdKey=!1},addSnippet:function(){var a,b,c;a=ICEcoder.getcMInstance();b=ICEcoder.getcMdiffInstance();a=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?
|
||||
b:a;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,k;c=ICEcoder.getcMInstance();d=ICEcoder.getcMdiffInstance();
|
||||
c=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?d:c;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+1);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;k=d;for(i=0;i<e.length;i++)e.indexOf("\n",g)<e.indexOf("CURSOR")&&(g=e.indexOf("\n",g)+1,k+=1);c.replaceRange(e.replace("CURSOR",""),
|
||||
{line:d,ch:0},{line:d,ch:1E6});c.setCursor(k,f);top.ICEcoder.focus(-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?!0:!1)}}};
|
||||
!1);top.ICEcoder.indicateChanges()},setTabWidths:function(a){if(top.ICEcoder.ready){var b=parseInt(top.ICEcoder.content.style.width,10)-53-22-10;var c=b/top.ICEcoder.openFiles.length-18;var d=-18;var e=53;var 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?53:parseInt(top.get("tab"+g).style.left,10),f=0==g?0:parseInt(top.get("tab"+g).style.width,
|
||||
10)+18,a?d=-18:(top.get("tab"+(g+1)).style.left=e+f+"px",top.get("tab"+(g+1)).style.width=d+"px"),top.ICEcoder.tabLeftPos.push(e+f);top.get("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)+53+18))%150;top.get("tab"+a).style.zIndex=2;for(var b=1;b<=top.ICEcoder.openFiles.length;b++)top.get("tab"+b).className=b!==a?"tab tabSlide":
|
||||
"tab tabDrag"},tabDragMove:function(){var a=parseInt(top.get("tab"+top.ICEcoder.openFiles.length).style.width,10)+18;top.ICEcoder.thisLeft=a=53<=top.ICEcoder.tabDragMouseX?top.ICEcoder.tabDragMouseX<=parseInt(top.get("newTab").style.left,10)-a?top.ICEcoder.tabDragMouseX:parseInt(top.get("newTab").style.left,10)-a:53;top.get("tab"+top.ICEcoder.draggingTab).style.left=a+"px";top.ICEcoder.dragTabNo=top.ICEcoder.draggingTab;for(var b=1;b<=top.ICEcoder.openFiles.length;b++){top.get("tab"+b).style.opacity=
|
||||
b==top.ICEcoder.draggingTab?1:.5;var c=top.ICEcoder.tabLeftPos[b]?top.ICEcoder.tabLeftPos[b]-top.ICEcoder.tabLeftPos[b-1]:c;b!=top.ICEcoder.draggingTab&&(b<top.ICEcoder.draggingTab?top.get("tab"+b).style.left=a<=top.ICEcoder.tabLeftPos[b-1]?top.ICEcoder.tabLeftPos[b-1]+c:top.ICEcoder.tabLeftPos[b-1]:top.get("tab"+b).style.left=a>=top.ICEcoder.tabLeftPos[b-1]?top.ICEcoder.tabLeftPos[b-1]-c:top.ICEcoder.tabLeftPos[b-1])}},tabDragEnd:function(){var a;top.ICEcoder.setTabWidths();for(var b=1;b<=top.ICEcoder.openFiles.length;b++)top.ICEcoder.thisLeft>=
|
||||
top.ICEcoder.tabLeftPos[b-1]&&(a=top.ICEcoder.thisLeft==top.ICEcoder.tabLeftPos[0]?1:top.ICEcoder.dragTabNo>b?b+1:b),top.get("tab"+b).className="tab",top.get("tab"+b).style.opacity=1,b!=top.ICEcoder.dragTabNo?top.get("tab"+b).style.zIndex=1:setTimeout(function(){top.get("tab"+b).style.zIndex=1},150);if(top.ICEcoder.thisLeft&&!1!==top.ICEcoder.thisLeft){var c=[];for(b=1;b<=top.ICEcoder.openFiles.length;b++)c.push(b);c.splice(top.ICEcoder.dragTabNo-1,1);c.splice(a-1,0,top.ICEcoder.dragTabNo);ICEcoder.sortTabs(c)}top.ICEcoder.setTabWidths();
|
||||
top.ICEcoder.draggingTab=!1;top.ICEcoder.thisLeft=!1},sortTabs:function(a){var b;var c=[ICEcoder.savedPoints,ICEcoder.savedContents,ICEcoder.openFiles,ICEcoder.openFileMDTs,ICEcoder.openFileVersions,ICEcoder.cMInstances];var d=[[],[],[],[],[],[]];for(var e=0;e<c.length;e++){for(var f=0;f<c[e].length;f++)d[e].push(c[e][a[f]-1]);c[e]=d[e]}for(e=0;e<a.length;e++)top.get("tab"+a[e]).id="tab"+(e+1)+".temp",top.ICEcoder.selectedTab==a[e]&&(b=e+1);for(e=0;e<a.length;e++)top.get("tab"+(e+1)+".temp").id="tab"+
|
||||
(e+1);top.get("tab"+b)&&(top.get("tab"+b).className="tab tabSlide");ICEcoder.savedPoints=c[0];ICEcoder.savedContents=c[1];ICEcoder.openFiles=c[2];ICEcoder.openFileMDTs=c[3];ICEcoder.openFileVersions=c[4];ICEcoder.cMInstances=c[5];top.ICEcoder.setTabWidths();top.ICEcoder.switchTab(b)},alphaTabs:function(){if(0<top.ICEcoder.openFiles.length){var a;var b=[];var c=[];var d=[];for(var e=0;e<top.ICEcoder.openFiles.length;e++)b.push(top.ICEcoder.openFiles[e].slice(top.ICEcoder.openFiles[e].lastIndexOf("/")+
|
||||
1)),c.push(top.ICEcoder.openFiles[e]),top.get("tab"+(e+1)).className="tab tabSlide";for(;0<b.length;){var f=b[0];nextValueFull=c[0];for(e=a=0;e<b.length;e++)b[e]<f&&(f=b[e],nextValueFull=top.ICEcoder.openFiles[top.ICEcoder.openFiles.indexOf(c[e])],a=e);d.push(top.ICEcoder.openFiles.indexOf(nextValueFull)+1);b.splice(a,1);c.splice(a,1)}top.ICEcoder.sortTabs(d)}},interceptKeys:function(a,b){var c;var d=b.keyCode?b.keyCode:b.which?b.which:b.charCode;top.ICEcoder.resetAutoLogoutTimer();top.ICEcoder.last5Keys||
|
||||
(top.ICEcoder.last5Keys=[]);top.ICEcoder.last5Keys.push(d);6==top.ICEcoder.last5Keys.length&&top.ICEcoder.last5Keys.shift();"83,78,65,75,69"==top.ICEcoder.last5Keys.join()&&setTimeout(function(){e=ICEcoder.getcMInstance();for(var a=0,b=e.changeGeneration();e.changeGeneration()>b-5;)e.undo(),a++;if(top.ICEcoder.savedPoints[top.ICEcoder.selectedTab-1]==e.changeGeneration())top.ICEcoder.startSnake();else for(b=1;b<=a;b++)e.redo()},0);if(top.ICEcoder.snakePlaying)return 37==d&&(top.ICEcoder.snakeDir=
|
||||
"left"),39==d&&(top.ICEcoder.snakeDir="right"),38==d&&(top.ICEcoder.snakeDir="up"),40==d&&(top.ICEcoder.snakeDir="down"),!1;if(224==d||91==d||93==d)top.ICEcoder.cmdKey=!0;if(112===d){if(top.ICEcoder.codeZoomedOut)return;top.ICEcoder.codeZoomedOut=!0;var e=ICEcoder.getcMInstance();for(d=0;d<e.lineCount();d++){var f=!0;for(c=0;c<top.ICEcoder.functionClassList.length;c++)top.ICEcoder.functionClassList[c].line==d&&(f=!1);f&&e.addLineClass(d,"wrap","code-zoomed-out")}e.refresh();return!1}if(46==d&&"files"==
|
||||
a)return top.ICEcoder.deleteFiles(),!1;if(b.altKey)return f=b.ctrlKey||top.ICEcoder.cmdKey?!0:!1,"ctrl+alt"==top.ICEcoder.tagWrapperCommand&&f||"alt-left"==top.ICEcoder.tagWrapperCommand&&!f?"content"==a?68==d?(top.ICEcoder.tagWrapper("div"),!1):83==d?(top.ICEcoder.tagWrapper("span"),!1):80==d?(top.ICEcoder.tagWrapper("p"),!1):65==d?(top.ICEcoder.tagWrapper("a"),!1):49==d?(top.ICEcoder.tagWrapper("h1"),!1):50==d?(top.ICEcoder.tagWrapper("h2"),!1):51==d?(top.ICEcoder.tagWrapper("h3"),!1):13==d?(top.ICEcoder.addLineBreakAtEnd(),
|
||||
!1):37==d?(top.ICEcoder.filesFrame.contentWindow.focus(),!1):d:37==d?(top.ICEcoder.filesFrame.contentWindow.focus(),!1):39==d?(top.ICEcoder.focus(-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?!0:!1),!1):d:13==d?(top.ICEcoder.insertLineAfter(),!1):d;if(13==d&&b.shiftKey)return top.ICEcoder.insertLineBefore(),!1;if(70!=d&&71!=d||!b.ctrlKey&&!top.ICEcoder.cmdKey){if(76==d&&(b.ctrlKey||top.ICEcoder.cmdKey))return d=top.get("goToLineNo"),d.select(),top.get("find").focus(),d.focus(),!1;if(73==d&&
|
||||
(b.ctrlKey||top.ICEcoder.cmdKey)&&"content"==a)return top.ICEcoder.searchForSelected(),!1;if(8==d&&(b.ctrlKey||top.ICEcoder.cmdKey))return 0!==top.ICEcoder.prevTab&&top.ICEcoder.switchTab(top.ICEcoder.prevTab),!1;if(39==d&&(b.ctrlKey||top.ICEcoder.cmdKey)&&"content"!=a)return top.ICEcoder.nextTab(),!1;if(37==d&&(b.ctrlKey||top.ICEcoder.cmdKey)&&"content"!=a)return top.ICEcoder.previousTab(),!1;if(38==d&&(b.ctrlKey||top.ICEcoder.cmdKey)&&"content"==a)return top.ICEcoder.moveLines("up"),!1;if(40==d&&
|
||||
(b.ctrlKey||top.ICEcoder.cmdKey)&&"content"==a)return top.ICEcoder.moveLines("down"),!1;if(107!=d&&187!=d||!b.ctrlKey&&!top.ICEcoder.cmdKey){if(109!=d&&189!=d||!b.ctrlKey&&!top.ICEcoder.cmdKey){if(83==d&&(b.ctrlKey||top.ICEcoder.cmdKey))return b.shiftKey?top.ICEcoder.saveFile("saveAs"):top.ICEcoder.saveFile(),!1;if(13==d&&(b.ctrlKey||top.ICEcoder.cmdKey)&&"/[NEW]"!=top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1])return top.ICEcoder.resetKeys(b),window.open(top.ICEcoder.openFiles[top.ICEcoder.selectedTab-
|
||||
1]),!1;if(13==d&&"files"==a)return b.ctrlKey||top.ICEcoder.cmdKey||(0==top.ICEcoder.selectedFiles.length&&(top.ICEcoder.overFileFolder("folder","|"),top.ICEcoder.selectFileFolder("init")),top.ICEcoder.fmAction(b,"enter")),!1;if(38!=d&&40!=d&&37!=d&&39!=d||"files"!=a)return 79==d&&(b.ctrlKey||top.ICEcoder.cmdKey)?(top.ICEcoder.openPrompt(),!1):32==d&&(b.ctrlKey||top.ICEcoder.cmdKey)&&"content"==a?(top.ICEcoder.addSnippet(),!1):74==d&&(b.ctrlKey||top.ICEcoder.cmdKey)&&"content"==a?(top.ICEcoder.jumpToDefinition(),
|
||||
!1):223==d&&(b.ctrlKey||top.ICEcoder.cmdKey)?(top.ICEcoder.lockUnlockNav(),ICEcoder.changeFilesW(top.ICEcoder.lockedNav?"expand":"contract"),!1):190==d&&(b.ctrlKey||top.ICEcoder.cmdKey)?(e=ICEcoder.getcMInstance(),c=ICEcoder.getcMdiffInstance(),c=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?c:e,c.getCursor(),!1):27==d&&"content"==a?(e=ICEcoder.getcMInstance(),c=ICEcoder.getcMdiffInstance(),c=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?c:e,1<c.getSelections().length?c.execCommand("singleSelection"):
|
||||
top.ICEcoder.lineCommentToggle(),!1):27==d&&"content"!=a?(top.ICEcoder.cancelAllActions(),!1):d;b.ctrlKey||top.ICEcoder.cmdKey||(0==top.ICEcoder.selectedFiles.length&&(top.ICEcoder.overFileFolder("folder","|"),top.ICEcoder.selectFileFolder("init")),top.ICEcoder.fmAction(b,38==d?"up":40==d?"down":37==d?"left":"right"));return!1}"content"==a?top.ICEcoder.removeLines():top.ICEcoder.closeTab(top.ICEcoder.selectedTab);return!1}"content"==a?top.ICEcoder.duplicateLines():top.ICEcoder.newTab();return!1}f=
|
||||
top.get("find");e=ICEcoder.getcMInstance();c=ICEcoder.getcMdiffInstance();c=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?c:e;c=c.getSelections();0<c.length&&0<c[0].length&&(f.value=c[0]);f.select();top.get("goToLineNo").focus();f.focus();70==d?top.get("findReplaceSubmit").click():ICEcoder.findReplace(top.document.getElementById("find").value,!1,!0,!1,"findPrevious");return!1},resetKeys:function(a){if(112==(a.keyCode?a.keyCode:a.which?a.which:a.charCode)&&top.ICEcoder.codeZoomedOut){a=ICEcoder.getcMInstance();
|
||||
for(var b=0;b<a.lineCount();b++){for(var c=!0,d=0;d<top.ICEcoder.functionClassList.length;d++)top.ICEcoder.functionClassList[d].line==b&&(c=!1);c&&a.removeLineClass(b,"wrap","code-zoomed-out")}a.refresh();a=a.getCursor();top.ICEcoder.goToLine(a.line+1,a.ch,!1);top.ICEcoder.codeZoomedOut=!1}top.ICEcoder.cmdKey=!1},addSnippet:function(){var a=ICEcoder.getcMInstance();var b=ICEcoder.getcMdiffInstance();a=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?b:a;b=a.getCursor().line;var 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=ICEcoder.getcMInstance();var d=ICEcoder.getcMdiffInstance();c=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?d:
|
||||
c;d=c.getCursor().line;if(-1<c.getLine(d).indexOf(a)){var e=c.getLine(d);var f=e.indexOf(a);e=e.slice(e.indexOf(a)+a.length+1);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");var g=0;var m=d;for(i=0;i<e.length;i++)e.indexOf("\n",g)<e.indexOf("CURSOR")&&(g=e.indexOf("\n",g)+1,m+=1);c.replaceRange(e.replace("CURSOR",""),{line:d,ch:0},{line:d,ch:1E6});c.setCursor(m,
|
||||
f);top.ICEcoder.focus(-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?!0:!1)}},startSnake:function(){top.ICEcoder.snakePlaying=!0;top.ICEcoder.showHide("show",top.get("blackMask"));top.get("mediaContainer").innerHTML='<span style="font-size: 14px">Let\'s play<br><img src="images/snake.png" alt="snake"><br><br><br>Use arrow keys to eat your code<br><br>(it returns afterwards of course) :-)</span>';setTimeout(function(){top.ICEcoder.showHide("hide",top.get("blackMask"));top.get("mediaContainer").innerHTML=
|
||||
"";top.ICEcoder.playSnake()},2E3)},playSnake:function(){var a=ICEcoder.getcMInstance();a.setOption("readOnly","nocursor");a.focus();top.ICEcoder.snakePreHistory=a.getHistory();top.ICEcoder.snakePreContent=a.getValue();top.ICEcoder.snakePreCursor=a.getCursor();a=Math.floor(50*Math.random());top.ICEcoder.snakePos=[[a,0],[a,-1],[a,-2],[a,-3],[a,-4]];top.ICEcoder.content.contentWindow.document.getElementById("game").style.display="block";top.ICEcoder.snakeDir="down";top.ICEcoder.doSnake();top.ICEcoder.snakeInt=
|
||||
setInterval(function(){var a=[];a[0]=top.ICEcoder.snakePos[0][0]+("right"==top.ICEcoder.snakeDir?1:"left"==top.ICEcoder.snakeDir?-1:0);a[1]=top.ICEcoder.snakePos[0][1]+("down"==top.ICEcoder.snakeDir?1:"up"==top.ICEcoder.snakeDir?-1:0);top.ICEcoder.snakePos.unshift(a);top.ICEcoder.snakePos.pop();top.ICEcoder.doSnake()},100)},doSnake:function(){var a;var b=ICEcoder.getcMInstance();var c=b.defaultCharWidth();var d=b.defaultTextHeight();var e=top.ICEcoder.content.contentWindow.document.getElementById("game").innerHTML=
|
||||
"";for(a=0;a<top.ICEcoder.snakePos.length;a++)e+='<div style="position: absolute; diplay: inline-block; width: '+c+"px; height: "+d+"px; top: "+(top.ICEcoder.snakePos[a][1]*d+4)+"px; left: "+(top.ICEcoder.snakePos[a][0]*c+60)+'px; background: #fff"></div>';top.ICEcoder.content.contentWindow.document.getElementById("game").innerHTML=e;e=b.coordsChar({top:top.ICEcoder.snakePos[0][1]*d+4,left:top.ICEcoder.snakePos[0][0]*c+60});var f=b.getLine(e.line);if(top.ICEcoder.snakePos[0][0]-1<=f.length-2){var g=
|
||||
"";if("\t"===f.substr(e.ch,1))for(a=0;a<b.getOption("tabSize");a++)g+=" ";else g=" ";top.ICEcoder.snakePos.push([top.ICEcoder.snakePos[top.ICEcoder.snakePos.length-1][0],top.ICEcoder.snakePos[top.ICEcoder.snakePos.length-1][1]]);b.doc.replaceRange(top.ICEcoder.snakePos[0][0]-1==f.length-2?"":g,e,{line:e.line,ch:e.ch+1});top.ICEcoder.snakePos[0][0]-1==f.length-2&&b.doc.replaceRange(b.getLine(e.line).replace(/[ \t]+$/,""),{line:e.line,ch:0},{line:e.line,ch:1E6})}else 5<=top.ICEcoder.snakePos.length&&
|
||||
top.ICEcoder.snakePos.pop();e=!1;for(a=1;a<top.ICEcoder.snakePos.length;a++)top.ICEcoder.snakePos[a][0]==top.ICEcoder.snakePos[0][0]&&top.ICEcoder.snakePos[a][1]==top.ICEcoder.snakePos[0][1]&&(e=!0);a=b.getScrollInfo();if(0>top.ICEcoder.snakePos[0][0]||0>top.ICEcoder.snakePos[0][1]||top.ICEcoder.snakePos[0][0]*c+60>a.clientWidth||top.ICEcoder.snakePos[0][1]*d+4>a.clientHeight||e)clearInterval(top.ICEcoder.snakeInt),top.ICEcoder.content.contentWindow.document.getElementById("game").style.display="none",
|
||||
b.setValue(top.ICEcoder.snakePreContent),top.ICEcoder.savedPoints[top.ICEcoder.selectedTab-1]=b.changeGeneration(),top.ICEcoder.savedContents[top.ICEcoder.selectedTab-1]=top.ICEcoder.snakePreContent,b.setHistory(top.ICEcoder.snakePreHistory),top.ICEcoder.indicateChanges(),top.ICEcoder.redoTabHighlight(top.ICEcoder.selectedTab),b.setOption("readOnly",!1),b.setCursor(top.ICEcoder.snakePreCursor),b.focus(),top.ICEcoder.snakePlaying=!1}};
|
||||
|
||||
171
lib/indexer.php
Normal file
@@ -0,0 +1,171 @@
|
||||
<?php
|
||||
include("headers.php");
|
||||
include("settings.php");
|
||||
|
||||
// File extensions to look for functions & classes in
|
||||
$indexableFileExts = ["php", "js", "coffee", "ts", "rb", "py", "sql", "erl", "java", "jl", "c", "cpp", "ino", "cs", "go", "lua", "pl"];
|
||||
|
||||
// Fallback for prevIndexData to start off initially
|
||||
$prevIndexData = [];
|
||||
|
||||
// If we have a data/index.php file
|
||||
if (file_exists($docRoot.$ICEcoderDir."/data/index.php")) {
|
||||
// Get serialized array back out of PHP file inside a comment block as prevIndexData
|
||||
$prevIndexData = file_get_contents($docRoot.$ICEcoderDir."/data/index.php");
|
||||
if (strpos($prevIndexData, "<?php") !== false) {
|
||||
$prevIndexData = str_replace("<?php\n/*\n\n", "", $prevIndexData);
|
||||
$prevIndexData = str_replace("\n\n*/\n?>", "", $prevIndexData);
|
||||
$prevIndexData = unserialize($prevIndexData);
|
||||
}
|
||||
}
|
||||
|
||||
// Roughly 1 in 100 index runs, we'll do a full index
|
||||
if (mt_rand(1,100) === 50) {
|
||||
$prevIndexData = [];
|
||||
}
|
||||
|
||||
// Start a new indexData for this run
|
||||
$indexData = [];
|
||||
|
||||
function phpGrep($path, $base) {
|
||||
global $indexableFileExts, $prevIndexData, $indexData;
|
||||
|
||||
$fp = opendir($path);
|
||||
global $ICEcoder, $serverType, $docRoot, $ICEcoderDir;
|
||||
if (!isset($ret)) {$ret="";};
|
||||
$slash = $serverType == strpos($path,"\\")>-1 ? "\\" : "/";
|
||||
while($f = readdir($fp)) {
|
||||
// Ignore . and .. paths
|
||||
if ($f == "." || $f == "..") continue;
|
||||
$filePath = $path.$slash.$f;
|
||||
$filePathExt = pathinfo($filePath, PATHINFO_EXTENSION);
|
||||
// Exclude the folder ICEcoder is running from
|
||||
$rootPrefix = '/'.str_replace("/","\/",preg_quote(str_replace("\\","/",$docRoot))).'/';
|
||||
$localPath = preg_replace($rootPrefix, '', $filePath, 1);
|
||||
if (strpos($localPath, $ICEcoderDir)===0) {
|
||||
continue;
|
||||
}
|
||||
if(is_dir($filePath)) {
|
||||
$ret .= phpGrep($filePath, $base);
|
||||
} else {
|
||||
// Check if we should scan within this file, by only considering files that may contain functions & classes
|
||||
if (in_array($filePathExt, $indexableFileExts) === false) {
|
||||
continue;
|
||||
}
|
||||
// Check if file appears to be the same (same size and mtime), if so, continue as we'll assume it's not changed
|
||||
if (isset($prevIndexData['files'][$filePath]) &&
|
||||
$prevIndexData['files'][$filePath]['size'] === stat($filePath)['size'] &&
|
||||
$prevIndexData['files'][$filePath]['mtime'] === stat($filePath)['mtime']
|
||||
) {
|
||||
// Continue, as data will be the same and we'll use data from prevIndexData
|
||||
continue;
|
||||
}
|
||||
// Start file data block if we don't have one yet
|
||||
if (!isset($indexData['files'][$filePath])) {
|
||||
$indexData['files'][$filePath] = [
|
||||
"size" => stat($filePath)['size'],
|
||||
"mtime" => stat($filePath)['mtime']
|
||||
];
|
||||
}
|
||||
$bFile = false;
|
||||
// Exclude banned files
|
||||
for ($i=0;$i<count($ICEcoder['bannedFiles']);$i++) {
|
||||
if (strpos($f,str_replace("*","",$ICEcoder['bannedFiles'][$i]))!==false) {$bFile = true;};
|
||||
}
|
||||
if (!$bFile) {
|
||||
$lines = file($filePath);
|
||||
foreach ($lines as $lineNum => $line) {
|
||||
$functionText = "";
|
||||
$classText = "";
|
||||
// Get function declaration lines
|
||||
if (strpos($line, "function ") !== false) {
|
||||
$functionText = substr($line, strpos($line, "function ") + 9);
|
||||
// Get just the name of the function/class
|
||||
$functionText = explode("(", explode("{", trim($functionText))[0]);
|
||||
}
|
||||
// Get class declaration lines
|
||||
if (strpos($line, "class ") !== false) {
|
||||
$classText = substr($line, strpos($line, "class ") + 6);
|
||||
// Get just the name of the function/class
|
||||
$classText = explode("(", explode("{", trim($classText))[0]);
|
||||
}
|
||||
|
||||
// Function data
|
||||
if (!empty($functionText)) {
|
||||
// Start language block if we don't have one yet
|
||||
if (!isset($indexData['functions'][$filePathExt])) {
|
||||
$indexData['functions'][$filePathExt] = [];
|
||||
}
|
||||
// Set all the data for this function
|
||||
$indexData['functions'][$filePathExt][$functionText[0]] = [
|
||||
"name" => $functionText[0],
|
||||
"range" => [
|
||||
"from" => [
|
||||
"line" => $lineNum,
|
||||
"ch" => strpos($line, $functionText[0])
|
||||
],
|
||||
"to" => [
|
||||
"line" => $lineNum,
|
||||
"ch" => (strpos($line, $functionText[0]) + strlen($functionText[0]))
|
||||
]
|
||||
],
|
||||
"filePath" => $filePath,
|
||||
"filePathExt" => $filePathExt,
|
||||
"params" => trim("(".$functionText[1])
|
||||
];
|
||||
}
|
||||
|
||||
// Class data
|
||||
if (!empty($classText)) {
|
||||
// Start language block if we don't have one yet
|
||||
if (!isset($indexData['classes'][$filePathExt])) {
|
||||
$indexData['classes'][$filePathExt] = [];
|
||||
}
|
||||
// Set all the data for this class
|
||||
$indexData['classes'][$filePathExt][$classText[0]] = [
|
||||
"name" => $classText[0],
|
||||
"range" => [
|
||||
"from" => [
|
||||
"line" => $lineNum,
|
||||
"ch" => strpos($line, $classText[0])
|
||||
],
|
||||
"to" => [
|
||||
"line" => $lineNum,
|
||||
"ch" => (strpos($line, $classText[0]) + strlen($classText[0]))
|
||||
]
|
||||
],
|
||||
"filePath" => $filePath,
|
||||
"filePathExt" => $filePathExt,
|
||||
"params" => trim("(".$classText[1])
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
// If something in the doc root changed, we can do an index...
|
||||
if (stat($docRoot)['mtime'] !== $prevIndexData["timestamps"]["indexed"]) {
|
||||
// Start a new indexData for this run
|
||||
$indexData["timestamps"] = [
|
||||
"indexed" => stat($docRoot)['mtime']
|
||||
];
|
||||
|
||||
// Start running function to index data
|
||||
$results = phpGrep($docRoot.$iceRoot, $docRoot.$iceRoot);
|
||||
|
||||
// Overlay indexData ontop of prevIndexData
|
||||
$output = array_replace_recursive($prevIndexData, $indexData);
|
||||
|
||||
// Store the serialized array in PHP comment block for next time
|
||||
file_put_contents($docRoot.$ICEcoderDir."/data/index.php", "<?php\n/*\n\n".serialize($output)."\n\n*/\n?".">");
|
||||
// Else it's the same as last time so do nothing...
|
||||
} else {
|
||||
$output = $prevIndexData;
|
||||
}
|
||||
|
||||
// Output the JSON
|
||||
echo json_encode($output, JSON_PRETTY_PRINT);
|
||||
?>
|
||||
@@ -5,6 +5,7 @@ fileExt = fileExt[fileExt.length-1];
|
||||
var mode =
|
||||
fileExt == "js" || fileExt == "json" ? "text/javascript"
|
||||
: fileExt == "coffee" ? "text/x-coffeescript"
|
||||
: fileExt == "ts" ? "application/typescript"
|
||||
: fileExt == "rb" ? "text/x-ruby"
|
||||
: fileExt == "py" ? "text/x-python"
|
||||
: fileExt == "css" ? "text/css"
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
include("headers.php");
|
||||
include("settings.php");
|
||||
$t = $text['login'];
|
||||
|
||||
$settingPW = $ICEcoderSettings["enableRegistration"] && ($ICEcoder["multiUser"] || $ICEcoder["password"] == "");
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
|
||||
@@ -19,34 +21,29 @@ echo $ICEcoder["password"] == "" && !$ICEcoder["multiUser"] ? "Setup" : "Login";
|
||||
</head>
|
||||
|
||||
<body style="background-color: #181817" onLoad="<?php if (!isset($_GET["get"])) {$inputFocus = $ICEcoder["multiUser"] ? "username" : "password"; echo "document.settingsUpdate.".$inputFocus.".focus(); ";}; ?>setTimeout(function(){document.getElementById('screenContainer').style.opacity=1},50)">
|
||||
|
||||
|
||||
<div class="screenContainer" id="screenContainer" style="background-color: #181817; opacity: 0; transition: opacity 0.1s ease-out">
|
||||
<div class="screenVCenter">
|
||||
<div class="screenCenter">
|
||||
<img src="../images/ice-coder.png" alt="ICEcoder">
|
||||
<div class="version" style="margin-bottom: 22px">v <?php echo $ICEcoder["versionNo"];?></div>
|
||||
|
||||
<form name="settingsUpdate" action="login.php" method="POST">
|
||||
<?php
|
||||
if (isset($_GET["get"]) && $_GET["get"]=="code") {
|
||||
<form name="settingsUpdate" action="login.php" method="POST"<?php if($settingPW) {?> onsubmit="return checkCanSubmit();"<?php } ?>>
|
||||
<?php
|
||||
if ($ICEcoder["multiUser"]) {echo ' <input type="text" name="username" class="password"><br><br>'.PHP_EOL;};
|
||||
?>
|
||||
<span style="color: #fff"><h1>Thanks for trialling ICEcoder!</h1><b>Please donate on the website to continue using it.</b><br><br>
|
||||
<h2>Step 1: Donate</h2><br><br>
|
||||
<a href="https://icecoder.net/?display=trialDonateScreen" target="_blank" style="background: #097695; color: #fff; padding: 10px; text-decoration: none; font-size: 17px; font-weight: bold; border-radius: 4px; cursor: pointer">Donate now</a><br><br><br>
|
||||
<h2>Step 2: Enter email address & code</h2><br>
|
||||
<?php if (isset($_GET["success"]) && $_GET["success"]=="no") {echo "Sorry, that doesn't seem to be correct.<br>Please check your emailed details and try again.<br><br>";};?>
|
||||
<?php if ($ICEcoder["multiUser"]) {echo ' <input type="text" name="username" value="Username" onfocus="origValue=\'Username\';if(this.value==origValue){this.value=\'\';};" onblur="if(this.value==\'\'){this.value=origValue;};" class="password"><br><br>'.PHP_EOL;};?>
|
||||
<input type="email" name="email" value="Email" onfocus="origValue='Email';if(this.value==origValue){this.value='';};" onblur="if(this.value==''){this.value=origValue;};" class="password"><br><br>
|
||||
<input type="text" name="code" value="Code" onfocus="origValue='Code';if(this.value==origValue){this.value='';};" onblur="if(this.value==''){this.value=origValue;};" class="password" autocomplete="off"><br><br>
|
||||
<input type="submit" name="submit" value="Unlock ICEcoder" style="background: #097695; color: #fff; border: 0; padding: 10px; text-decoration: none; font-size: 17px; font-weight: bold; border-radius: 4px; cursor: pointer"><br><br><br>
|
||||
Future development relies on your donation, to keep making awesome new features.<br><br>
|
||||
Many thanks.</span>
|
||||
<input type="password" name="password" class="password" id="password"<?php if($settingPW) {?> onkeyup="pwStrength(this.value)" onchange="pwStrength(this.value)" onpaste="pwStrength(this.value)"<?php } ?>><br>
|
||||
<?php
|
||||
} else {
|
||||
if (isset($_GET["message"]) && $_GET["message"]=="trialDonateThanks") {echo '<span style="color: #fff"><b>Thank you very much for your donation!</b><br><br>Your details have been accepted and<br>ICEcoder is now fully unlocked.</span><br><br><br>';};
|
||||
if ($ICEcoder["multiUser"]) {echo ' <input type="text" name="username" class="password"><br><br>'.PHP_EOL;};
|
||||
?>
|
||||
<input type="password" name="password" class="password"><br><br>
|
||||
if ($settingPW) {
|
||||
echo '<div id="pwReqs">'.
|
||||
'<div class="text" style="display: inline-block" id="pwChars">10+</div> '.
|
||||
'<div class="text" style="display: inline-block" id="pwUpper">upper</div> '.
|
||||
'<div class="text" style="display: inline-block" id="pwLower">lower</div> '.
|
||||
'<div class="text" style="display: inline-block" id="pwNum">number</div> '.
|
||||
'<div class="text" style="display: inline-block" id="pwSpecial">special</div>'.
|
||||
'</div>';
|
||||
}
|
||||
?><br>
|
||||
<input type="submit" name="submit" value="<?php
|
||||
// Multi-user
|
||||
if ($ICEcoder["multiUser"]) {
|
||||
@@ -71,7 +68,6 @@ echo $ICEcoder["password"] == "" && !$ICEcoder["multiUser"] ? "Setup" : "Login";
|
||||
echo '<div class="text" style="position: relative"><input type="checkbox" name="checkUpdates" value="true" style="position: absolute; margin: -1px 0 0 -20px" checked> '.$t['auto-check for updates'].'</div>';
|
||||
}
|
||||
if (!$ICEcoder["multiUser"]) { echo '<div class="text"><a href="javascript:alert(\''.$t['To put into...'].'\')">'.$t['multi-user'].'?</a></div>';};
|
||||
}
|
||||
?>
|
||||
<input type="hidden" name="csrf" value="<?php echo $_SESSION["csrf"]; ?>">
|
||||
</form>
|
||||
@@ -79,6 +75,55 @@ echo $ICEcoder["password"] == "" && !$ICEcoder["multiUser"] ? "Setup" : "Login";
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// Get any elem by ID
|
||||
var get = function(elem) {
|
||||
return top.document.getElementById(elem);
|
||||
};
|
||||
|
||||
// Check password strength and color requirements not met
|
||||
var pwStrength = function(pw) {
|
||||
// Set variables
|
||||
var chars, upper, lower, num, special;
|
||||
|
||||
// Test password for requirements
|
||||
chars = pw.length >= 10;
|
||||
upper = pw.replace(/[A-Z]/g, "").length < pw.length;
|
||||
lower = pw.replace(/[a-z]/g, "").length < pw.length;
|
||||
num = pw.replace(/[0-9]/g, "").length < pw.length;
|
||||
special = pw.replace(/[A-Za-z0-9]/g, "").length > 0;
|
||||
|
||||
// Set colors based on each requirements
|
||||
get("pwChars").style.color = chars ? "rgba(0,198,255,0.7)" : "";
|
||||
get("pwUpper").style.color = upper ? "rgba(0,198,255,0.7)" : "";
|
||||
get("pwLower").style.color = lower ? "rgba(0,198,255,0.7)" : "";
|
||||
get("pwNum").style.color = num ? "rgba(0,198,255,0.7)" : "";
|
||||
get("pwSpecial").style.color = special ? "rgba(0,198,255,0.7)" : "";
|
||||
|
||||
// Return a bool based on meeting the requirements
|
||||
return (chars && upper && lower && num && special);
|
||||
};
|
||||
|
||||
// Check if we can submit, else shake requirements
|
||||
var checkCanSubmit = function() {
|
||||
// Password isn't strong enough, shake requirements
|
||||
if(!pwStrength(get("password").value)) {
|
||||
var posArray = [6, -6, 3, -3, 0];
|
||||
var pos = -1;
|
||||
var anim = setInterval(function() {
|
||||
if (pos < posArray.length) {
|
||||
pos++;
|
||||
get("pwReqs").style.marginLeft = posArray[pos] + "px";
|
||||
} else {
|
||||
clearInterval(anim);
|
||||
}
|
||||
}, 50);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
||||
|
||||
@@ -15,7 +15,7 @@ if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && isset
|
||||
|
||||
// Get our old plugin & user settings
|
||||
$oldPlugins = $ICEcoder["plugins"];
|
||||
$settingsContents = getData($settingsFile);
|
||||
$settingsContents = getData("../data/".$settingsFile);
|
||||
|
||||
// ==========
|
||||
// INSTALLING
|
||||
@@ -132,9 +132,9 @@ if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && isset
|
||||
$settingsContents = substr($settingsContents,0,$repPosStart).$settingsNew.substr($settingsContents,$repPosEnd,strlen($settingsContents));
|
||||
|
||||
// Now update the config file
|
||||
if (is_writeable($settingsFile)) {
|
||||
$fh = fopen($settingsFile, 'w');
|
||||
fwrite($fh, $settingsContents);
|
||||
if (is_writeable("../data/".$settingsFile)) {
|
||||
$fh = fopen("../data/".$settingsFile, 'w');
|
||||
fwrite($fh, "../data/".$settingsContents);
|
||||
fclose($fh);
|
||||
// Finally, reload ICEcoder itself if plugin requires it or just the iFrame screen for the user if it doesn't
|
||||
if ($_GET['action']=="install" && $pluginsData[$_GET['plugin']]['reload'] == "true") {
|
||||
@@ -145,7 +145,7 @@ if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && isset
|
||||
}
|
||||
die("<span style='color: #fff'>".$t['saving plugins']."</span>");
|
||||
} else {
|
||||
echo "<script>top.ICEcoder.message('".$t['Cannot update config...']." lib/".$settingsFile." ".$t['and try again']."');</script>";
|
||||
echo "<script>top.ICEcoder.message('".$t['Cannot update config...']." data/".$settingsFile." ".$t['and try again']."');</script>";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
76
lib/requirements.php
Normal file
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
// Start off assuming all is fine with requirements
|
||||
$reqsPassed = true;
|
||||
$reqsFailures = [];
|
||||
|
||||
// Check PHP version meets minimum requirements
|
||||
if (phpversion()*1 < 7.0) {
|
||||
$reqsPassed = false;
|
||||
array_push($reqsFailures, "phpVersion");
|
||||
}
|
||||
|
||||
// Check we have a working session
|
||||
if (!isset($_SESSION) || session_id() === "") {
|
||||
$reqsPassed = false;
|
||||
array_push($reqsFailures, "phpSession");
|
||||
}
|
||||
|
||||
// Check we can read config settings
|
||||
if (file_exists(dirname(__FILE__)."/../data/config-settings.php")) {
|
||||
include(dirname(__FILE__)."/../data/config-settings.php");
|
||||
if (!isset($ICEcoderSettings['versionNo'])) {
|
||||
$reqsPassed = false;
|
||||
array_push($reqsFailures, "phpReadFile");
|
||||
}
|
||||
}
|
||||
|
||||
// If any of these failed, show requirements problem info screen
|
||||
if (!$reqsPassed) {
|
||||
// $t = $text['reqsIssue'];
|
||||
?>
|
||||
<html>
|
||||
<head>
|
||||
<title>ICEcoder <?php echo $ICEcoderSettings['versionNo'];?> : Requirements problem!</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta name="robots" content="noindex, nofollow">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||
<link rel="stylesheet" type="text/css" href="lib/ice-coder.css?microtime=<?php echo microtime(true);?>">
|
||||
<link rel="icon" type="image/png" href="favicon.png">
|
||||
</head>
|
||||
|
||||
<body style="background-color: #181817" onLoad="setTimeout(function(){document.getElementById('screenContainer').style.opacity=1},50)">
|
||||
|
||||
<div class="screenContainer" id="screenContainer" style="background-color: #181817; opacity: 0; transition: opacity 0.1s ease-out">
|
||||
<div class="screenVCenter">
|
||||
<div class="screenCenter">
|
||||
<img src="images/ice-coder.png" alt="ICEcoder">
|
||||
<div class="version" style="margin-bottom: 22px">v <?php echo $ICEcoderSettings['versionNo'];?></div>
|
||||
|
||||
<span style="display: inline-block; color: #fff">
|
||||
<b style="padding: 5px; background: #b00; color: #fff">Requirements problem!</b><br><br><br><br>
|
||||
Sorry, but ICEcoder has a problem<br>running on your server:<br><br><hr style="height: 1px; border: 0; background: #888"><br>
|
||||
<?php
|
||||
if (in_array("phpVersion", $reqsFailures)) {
|
||||
echo "Your PHP version is ".phpversion()."<br>and needs 7.0 or above<br><br>";
|
||||
}
|
||||
if (in_array("phpSession", $reqsFailures)) {
|
||||
echo "You don't appear to have a<br>working PHP session<br><br>";
|
||||
}
|
||||
if (in_array("phpReadFile", $reqsFailures)) {
|
||||
echo "You don't seem to be able<br>to read the config file<br><br>";
|
||||
}
|
||||
?>
|
||||
</span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
<?php
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
@@ -3,4 +3,3 @@
|
||||
// Do this every 5 mins to keep session alive
|
||||
include("headers.php");
|
||||
include("settings.php");
|
||||
?>
|
||||
@@ -2,7 +2,7 @@
|
||||
// Don't display, but log all errors
|
||||
ini_set('display_errors', 0);
|
||||
ini_set('log_errors', 1);
|
||||
ini_set('error_log', dirname(__FILE__).'/../error-log.txt');
|
||||
ini_set('error_log', dirname(__FILE__).'/../data/error.log');
|
||||
error_reporting(-1);
|
||||
|
||||
// Set our default timezone and supress warning with @
|
||||
@@ -45,6 +45,14 @@ if (isset($_SESSION['text'])) {
|
||||
$t = $text['settings-common'];
|
||||
}
|
||||
|
||||
// Check requirements meet minimum spec
|
||||
include(dirname(__FILE__)."/requirements.php");
|
||||
|
||||
// Create a backups dir in the data dir if it doesn't exist yet
|
||||
if (!file_exists(dirname(__FILE__)."/../data/backups")) {
|
||||
mkdir(dirname(__FILE__)."/../data/backups");
|
||||
}
|
||||
|
||||
// Get data from a fopen or CURL connection
|
||||
function getData($url,$type='fopen',$dieMessage=false,$timeout=60) {
|
||||
global $context;
|
||||
@@ -74,7 +82,9 @@ function getData($url,$type='fopen',$dieMessage=false,$timeout=60) {
|
||||
if (!$data) {
|
||||
$data = @file_get_contents(str_replace("https:","http:",$url), false, $context);
|
||||
}
|
||||
}
|
||||
} elseif (file_exists($url)) {
|
||||
$data = file_get_contents($url);
|
||||
}
|
||||
// Return data or die with message
|
||||
if ($data) {
|
||||
return $data;
|
||||
@@ -86,6 +96,26 @@ function getData($url,$type='fopen',$dieMessage=false,$timeout=60) {
|
||||
}
|
||||
}
|
||||
|
||||
// Require a re-index dir/file data next time we index
|
||||
function requireReIndexNextTime() {
|
||||
// If we have a data/index.php file
|
||||
global $docRoot, $ICEcoderDir;
|
||||
if (file_exists($docRoot.$ICEcoderDir."/data/index.php")) {
|
||||
// Get serialized array back out of PHP file inside a comment block as prevIndexData
|
||||
$prevIndexData = file_get_contents($docRoot.$ICEcoderDir."/data/index.php");
|
||||
if (strpos($prevIndexData, "<?php") !== false) {
|
||||
$prevIndexData = str_replace("<?php\n/*\n\n", "", $prevIndexData);
|
||||
$prevIndexData = str_replace("\n\n*/\n?>", "", $prevIndexData);
|
||||
$prevIndexData = unserialize($prevIndexData);
|
||||
|
||||
// Set timestamp back to epoch to force a re-index next time
|
||||
$prevIndexData['timestamps']['indexed'] = 0;
|
||||
|
||||
file_put_contents($docRoot.$ICEcoderDir."/data/index.php", "<?php\n/*\n\n".serialize($prevIndexData)."\n\n*/\n?".">");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Logout if that's the action we're taking
|
||||
if (isset($_GET['logout'])) {
|
||||
include(dirname(__FILE__)."/../processes/on-user-logout.php");
|
||||
@@ -108,15 +138,24 @@ if (get_magic_quotes_gpc ()) {
|
||||
$_REQUEST = (isset($_REQUEST) && !empty($_REQUEST)) ? array_map('stripslashes_deep', $_REQUEST) : array();
|
||||
}
|
||||
|
||||
// Function to handle salted hashing
|
||||
define('SALT_LENGTH',12);
|
||||
function generateHash($plainText,$salt=null) {
|
||||
if ($salt === null) {
|
||||
$salt = substr(md5(uniqid(rand(), true)),0,SALT_LENGTH);
|
||||
} else {
|
||||
$salt = substr($salt,0,SALT_LENGTH);
|
||||
}
|
||||
return $salt.sha1($salt.$plainText);
|
||||
// Generate hash
|
||||
function generateHash($pw) {
|
||||
// Generate Bcrypt hash
|
||||
return str_replace("\$", "\\$", password_hash($pw, PASSWORD_BCRYPT, $options = ['cost' => 10]));
|
||||
}
|
||||
|
||||
// Verify hash
|
||||
function verifyHash($pw, $orig) {
|
||||
// Verify Bcrypt hash
|
||||
if (substr($orig, 0, 4) === "$2y$") {
|
||||
return password_verify($pw, $orig)
|
||||
? $orig
|
||||
: "NO MATCH";
|
||||
}
|
||||
// Verify legacy sha1 hash
|
||||
$origSalt = substr($orig,0,SALT_LENGTH);
|
||||
return $origSalt.sha1($origSalt.$pw);
|
||||
}
|
||||
|
||||
// returns converted entities which have HTML entity equivalents
|
||||
@@ -177,7 +216,7 @@ function injClean($data) {
|
||||
}
|
||||
|
||||
// returns a UTF8 based string with any UFT8 BOM removed
|
||||
function toUTF8noBOM($string,$message) {
|
||||
function toUTF8noBOM($string,$message=false) {
|
||||
global $text;
|
||||
$t = $text['settings-common'];
|
||||
|
||||
@@ -252,7 +291,7 @@ function getVersionsCount($fileLoc,$fileName) {
|
||||
$dateCounts = array();
|
||||
$backupDateDirs = array();
|
||||
// Establish the base, host and date dirs within...
|
||||
$backupDirBase = str_replace("\\","/",dirname(__FILE__))."/../backups/";
|
||||
$backupDirBase = str_replace("\\","/",dirname(__FILE__))."/../data/backups/";
|
||||
$backupDirHost = isset($ftpSite) ? parse_url($ftpSite,PHP_URL_HOST) : "localhost";
|
||||
// check if folder exists if local before enumerating contents
|
||||
if(!isset($ftpSite)) {
|
||||
@@ -298,4 +337,16 @@ function getVersionsCount($fileLoc,$fileName) {
|
||||
"dateCounts" => $dateCounts
|
||||
);
|
||||
}
|
||||
?>
|
||||
|
||||
function serializedFileData($do, $path, $output=null) {
|
||||
if ($do === "get") {
|
||||
$data = file_get_contents($path);
|
||||
$data = str_replace("<"."?php\n/*\n\n", "", $data);
|
||||
$data = str_replace("\n\n*/\n?".">", "", $data);
|
||||
$data = unserialize($data);
|
||||
return $data;
|
||||
}
|
||||
if ($do === "set") {
|
||||
file_put_contents($path, "<"."?php\n/*\n\n".serialize($output)."\n\n*/\n?".">");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ $t = $text['settings-save-current-files'];
|
||||
|
||||
// Save the currently opened files for next time
|
||||
if ($_SESSION['loggedIn'] && isset($_GET["saveFiles"]) && $_GET['saveFiles']) {
|
||||
$settingsContents = getData($settingsFile);
|
||||
$settingsContents = getData("../data/".$settingsFile);
|
||||
|
||||
// Replace our previousFiles var with the the current
|
||||
$repPosStart = strpos($settingsContents,'previousFiles" => "')+20;
|
||||
@@ -26,12 +26,12 @@ if ($_SESSION['loggedIn'] && isset($_GET["saveFiles"]) && $_GET['saveFiles']) {
|
||||
}
|
||||
$settingsContents = substr($settingsContents,0,$repPosStart).$saveFiles.substr($settingsContents,($repPosStart+$repPosEnd),strlen($settingsContents));
|
||||
// Now update the config file
|
||||
if (is_writeable($settingsFile)) {
|
||||
$fh = fopen($settingsFile, 'w');
|
||||
if (is_writeable("../data/".$settingsFile)) {
|
||||
$fh = fopen("../data/".$settingsFile, 'w');
|
||||
fwrite($fh, $settingsContents);
|
||||
fclose($fh);
|
||||
} else {
|
||||
echo "<script>top.ICEcoder.message('".$t['Cannot update config...']." lib/".$settingsFile." ".$t['and try again']."');</script>";
|
||||
echo "<script>top.ICEcoder.message('".$t['Cannot update config...']." data/".$settingsFile." ".$t['and try again']."');</script>";
|
||||
}
|
||||
|
||||
// Update our last10Files var?
|
||||
@@ -45,16 +45,15 @@ if ($_SESSION['loggedIn'] && isset($_GET["saveFiles"]) && $_GET['saveFiles']) {
|
||||
if (count($last10FilesArray)>=10) {$ICEcoder["last10Files"]=substr($ICEcoder["last10Files"],0,strrpos($ICEcoder["last10Files"],','));};
|
||||
$settingsContents = substr($settingsContents,0,$repPosStart).$saveFilesArray[$i].$commaExtra.$ICEcoder["last10Files"].substr($settingsContents,($repPosStart+$repPosEnd),strlen($settingsContents));
|
||||
// Now update the config file
|
||||
if (is_writeable($settingsFile)) {
|
||||
$fh = fopen($settingsFile, 'w');
|
||||
if (is_writeable("../data/".$settingsFile)) {
|
||||
$fh = fopen("../data/".$settingsFile, 'w');
|
||||
fwrite($fh, $settingsContents);
|
||||
fclose($fh);
|
||||
} else {
|
||||
echo "<script>top.ICEcoder.message('".$t['Cannot update config...']." lib/".$settingsFile." ".$t['and try again']."');</script>";
|
||||
echo "<script>top.ICEcoder.message('".$t['Cannot update config...']." data/".$settingsFile." ".$t['and try again']."');</script>";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
echo '<script>top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);</script>';
|
||||
}
|
||||
?>
|
||||
@@ -1,441 +1,441 @@
|
||||
<?php
|
||||
include("headers.php");
|
||||
include("settings.php");
|
||||
$t = $text['settings-screen'];
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>ICEcoder <?php echo $ICEcoder["versionNo"];?> settings screen</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta name="robots" content="noindex, nofollow">
|
||||
<link rel="stylesheet" type="text/css" href="settings-screen.css?microtime=<?php echo microtime(true);?>">
|
||||
<link rel="stylesheet" href="../<?php echo $ICEcoder["codeMirrorDir"]; ?>/lib/codemirror.css?microtime=<?php echo microtime(true);?>">
|
||||
<script src="../<?php echo $ICEcoder["codeMirrorDir"]; ?>/lib/codemirror-compressed.js?microtime=<?php echo microtime(true);?>"></script>
|
||||
|
||||
<style type="text/css">
|
||||
.CodeMirror {position: absolute; width: 409px; height: 180px; font-size: <?php echo $ICEcoder["fontSize"];?>}
|
||||
.CodeMirror-scroll {overflow: hidden}
|
||||
/* Make sure this next one remains the 3rd item, updated with JS */
|
||||
.cm-tab {border-left-width: <?php echo $ICEcoder["visibleTabs"] ? "1px" : "0";?>; margin-left: <?php echo $ICEcoder["visibleTabs"] ? "-1px" : "0";?>; border-left-style: solid; border-left-color: rgba(255,255,255,0.2)}
|
||||
</style>
|
||||
|
||||
<link rel="stylesheet" href="editor.css?microtime=<?php echo microtime(true);?>">
|
||||
<?php
|
||||
$themeArray = array();
|
||||
$handle = opendir('../'.$ICEcoder["codeMirrorDir"].'/theme/');
|
||||
while (false !== ($file = readdir($handle))) {
|
||||
if ($file !== "." && $file != "..") {
|
||||
array_push($themeArray,basename($file,".css"));
|
||||
}
|
||||
}
|
||||
sort($themeArray);
|
||||
for ($i=0;$i<count($themeArray);$i++) {
|
||||
echo '<link rel="stylesheet" href="../'.$ICEcoder["codeMirrorDir"].'/theme/'.$themeArray[$i].'.css?microtime='.microtime(true).'">'.PHP_EOL;
|
||||
}
|
||||
?>
|
||||
</head>
|
||||
|
||||
<body class="settings">
|
||||
|
||||
<div class="infoPane">
|
||||
<a href="https://icecoder.net" target="_blank"><img src="../images/ice-coder.png" alt="ICEcoder" class="logo"></a>
|
||||
|
||||
<h1 style="margin: 10px 0"><?php echo $t['settings'];?></h1>
|
||||
|
||||
<p>
|
||||
<?php echo $t['version'];?>:<br>
|
||||
v <?php echo $ICEcoder["versionNo"];?>
|
||||
<br><br>
|
||||
|
||||
<?php echo $t['website'];?>:<br>
|
||||
<a href="https://icecoder.net" target="_blank">https://icecoder.net</a>
|
||||
<br><br>
|
||||
|
||||
<?php echo $t['git'];?>:<br>
|
||||
<a href="https://github.com/mattpass/ICEcoder" target="_blank">https://github.com/mattpass/ICEcoder</a>
|
||||
<br><br>
|
||||
|
||||
<?php echo $t['codemirror dir'];?>:<br>
|
||||
<?php echo $ICEcoder["codeMirrorDir"]; ?>
|
||||
<br><br>
|
||||
|
||||
<?php echo $t['codemirror version'];?>:<br>
|
||||
<script>
|
||||
document.write(CodeMirror.version);
|
||||
</script>
|
||||
<br><br>
|
||||
|
||||
<?php echo $t['file manager root'];?>:<br>
|
||||
<?php echo $ICEcoder['root'] == "" ? "/" : $ICEcoder['root'];?>
|
||||
<br><br>
|
||||
|
||||
<div style="font-size: 10px; line-height: 12px">
|
||||
<?php echo $t['Get in contact...'];?><br>
|
||||
<a href="https://www.twitter.com/icecoder" style="font-size: 10px" target="_blank">Twitter</a><br>
|
||||
<a href="https://facebook.com/ICEcoder.net" style="font-size: 10px" target="_blank">Facebook</a><br>
|
||||
<a href="https://groups.google.com/forum/#!forum/icecoder" style="font-size: 10px" target="_blank">Google Groups</a><br>
|
||||
<a href="https://github.com/mattpass/ICEcoder" style="font-size: 10px" target="_blank">GitHub</a><br>
|
||||
<a href="mailto:info@icecoder.net" style="font-size: 10px">Email</a><br><br>
|
||||
<?php echo $t['You may use...'];?>
|
||||
</div>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<form name="settings" action="settings.php" method="POST">
|
||||
|
||||
<div class="tabContainer">
|
||||
<div id="generalTab" class="tab tabActive" onclick="switchTab('general')">General</div>
|
||||
<div id="styleTab" class="tab" onclick="switchTab('style')">Style</div>
|
||||
<div id="accountsTab" class="tab" onclick="switchTab('accounts')">Accounts</div>
|
||||
<div id="securityTab" class="tab" onclick="switchTab('security')">Security</div>
|
||||
</div>
|
||||
|
||||
<div id="generalSection" class="section" style="display: block">
|
||||
|
||||
<div style="display: inline-block; margin-right: 40px">
|
||||
|
||||
<h2>language</h2><br>
|
||||
<select onchange="showButton()" name="languageUser">
|
||||
<?php
|
||||
$langFiles = array("chinese-simplified.php","chinese-traditional.php","dutch.php","english.php","french.php","german.php","italian.php","norwegian.php","persian.php","portuguese-brazilian.php","spanish.php");
|
||||
$langText = array("中国(简体)","中國(繁體)","Nederlands","English","Français","Deutsch","Italiano","Norsk","فارسی","Portugues(br)","Español");
|
||||
for ($i=0; $i<count($langFiles); $i++) {
|
||||
echo '<option value="'.$langFiles[$i].'"'.($ICEcoder["languageUser"]==$langFiles[$i] ? ' selected' : '').'>'.$langText[$i].'</option>'.PHP_EOL;
|
||||
}
|
||||
?>
|
||||
</select> <span class="info" style="display: inline-block; padding-top: 2px" title="Reload required after changing">[?]</span>
|
||||
<br><br>
|
||||
|
||||
<h2><?php echo $t['functionality'];?></h2><br>
|
||||
<input type="checkbox" onclick="showButton()" name="checkUpdates" value="true"<?php if($ICEcoder["checkUpdates"]) {echo ' checked';};?>> <?php echo $t['check for updates...'];?><br>
|
||||
<input type="checkbox" onclick="showButton()" name="openLastFiles" value="true"<?php if($ICEcoder["openLastFiles"]) {echo ' checked';};?>> <?php echo $t['auto open last...'];?><br>
|
||||
<input type="checkbox" onclick="showButton()" name="updateDiffOnSave" value="true"<?php if($ICEcoder["updateDiffOnSave"]) {echo ' checked';};?>> update diff pane on save
|
||||
<br><br>
|
||||
|
||||
<h2><?php echo $t['assisting'];?></h2><br>
|
||||
<input type="checkbox" onclick="showButton()" name="codeAssist" value="true"<?php if($ICEcoder["codeAssist"]) {echo ' checked';};?>> <?php echo $t['code assist'];?><br>
|
||||
<br>
|
||||
<?php echo $t['tag wrapper command'];?><br>
|
||||
<select onchange="showButton()" name="tagWrapperCommand">
|
||||
<option value="ctrl+alt"<?php if($ICEcoder["tagWrapperCommand"]=='ctrl+alt') {echo " selected";};?>>ctrl/cmd + alt</option>
|
||||
<option value="alt-left"<?php if($ICEcoder["tagWrapperCommand"]=='alt-left') {echo " selected";};?>>alt left</option>
|
||||
</select>
|
||||
<br><br>
|
||||
|
||||
<?php echo $t['auto-complete on'];?><br>
|
||||
<select onchange="showButton()" name="autoComplete">
|
||||
<option value="ctrl+space"<?php if($ICEcoder["autoComplete"]=='ctrl+space') {echo " selected";};?>>ctrl/cmd + space</option>
|
||||
<option value="keypress"<?php if($ICEcoder["autoComplete"]=='keypress') {echo " selected";};?>>keypress</option>
|
||||
</select>
|
||||
<br><br>
|
||||
|
||||
</div>
|
||||
|
||||
<div style="display: inline-block">
|
||||
|
||||
<h2>find & replace</h2><br>
|
||||
<?php echo $t['when finding in...'];?>:<br>
|
||||
<input type="text" onkeydown="showButton()" name="findFilesExclude" style="width: 300px" value="<?php echo implode(", ",$ICEcoder["findFilesExclude"]); ?>">
|
||||
<br><br>
|
||||
|
||||
<h2><?php echo $t['bug reporting'];?></h2><br>
|
||||
<?php echo $t['check in files'];?> <span class="info" title="<?php echo $t['Slash prefixed comma...'];?>">[?]</span><br>
|
||||
<input type="text" name="bugFilePaths" style="width: 300px" onkeydown="showButton()" value="<?php echo implode(", ",$ICEcoder["bugFilePaths"]);?>"><br>
|
||||
<span style="display: inline-block; padding: 6px 5px 0 0">...<?php echo $t['every'];?></span>
|
||||
<input type="text" name="bugFileCheckTimer" style="width: 50px; margin-top: 3px" onkeydown="showButton()" value="<?php echo $ICEcoder["bugFileCheckTimer"];?>">
|
||||
<span style="display: inline-block; padding: 6px 5px 0 5px"><?php echo $t['secs getting last'];?></span>
|
||||
<input type="text" name="bugFileMaxLines" style="width: 50px; margin-top: 3px" onkeydown="showButton()" value="<?php echo $ICEcoder["bugFileMaxLines"];?>">
|
||||
<span style="display: inline-block; padding: 6px 5px 0 5px"><?php echo $t['lines'];?></span>
|
||||
<br><br>
|
||||
|
||||
<h2><?php echo $t['file manager'];?></h2><br>
|
||||
<?php echo $t['root'];?> <span class="info" title="<?php echo $t['Slash prefixed'];?>">[?]</span><br>
|
||||
<input type="text" name="root" style="width: 300px" onkeydown="document.settings.changedFileSettings.value='true';showButton()" value="<?php echo $ICEcoder["root"];?>">
|
||||
<br><br>
|
||||
|
||||
<h2><?php echo $t['backups'];?></h2><br>
|
||||
<input type="checkbox" onclick="showButton();changeBackupsDaysStatus();" name="backupsKept" value="true"<?php if($ICEcoder["backupsKept"]) {echo ' checked';};?>> <?php echo $t['keep version control...'];?> <input type="text" name="backupsDays" id="backupsDays" style="width: 50px; margin: 3px 5px 0 5px" onkeydown="document.settings.changedFileSettings.value='true';showButton()" value="<?php echo $ICEcoder["backupsDays"];?>" <?php
|
||||
if(!$ICEcoder["backupsKept"]){
|
||||
echo ' disabled=""';
|
||||
}?>> <?php echo $t['days'];?><br>
|
||||
<div style="padding: 5px 5px 5px 5px; color: #888">
|
||||
<?php
|
||||
// Display number of days backups available
|
||||
$backupDirBase = str_replace("\\","/",dirname(__FILE__))."/../backups/";
|
||||
$backupDirHost = isset($ftpSite) ? parse_url($ftpSite,PHP_URL_HOST) : "localhost";
|
||||
$backupDirsList = scandir($backupDirBase.$backupDirHost);
|
||||
// Remove . and .. from array
|
||||
for ($i=0; $i<count($backupDirsList); $i++) {
|
||||
if ($backupDirsList[$i] == "." || $backupDirsList[$i] == "..") {
|
||||
array_splice($backupDirsList,$i,1);
|
||||
$i--;
|
||||
}
|
||||
}
|
||||
// Display text re the number of days backups have taken place
|
||||
$backupNumDays = $backupDirsList[0] != "" && count($backupDirsList) > 0 ? count($backupDirsList) : 0;
|
||||
echo $backupNumDays." ".($backupNumDays != 1 ? $t['days'] : $t['day'])." ".$t['of backups stored...'];
|
||||
?>
|
||||
</div><br>
|
||||
|
||||
<input type="checkbox" onclick="showButton();" name="deleteToTmp" value="true"<?php if($ICEcoder["deleteToTmp"]) {echo ' checked';};?>> <?php echo $t['deleting actually moves...'];?> <span class="info" title="<?php echo $t['local/server items...'];?>" style="position: absolute; margin-top: 6px">[?]</span>
|
||||
<br><br>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="styleSection" class="section" style="display: none">
|
||||
|
||||
<div style="display: inline-block; width: 400px; margin-right: 35px">
|
||||
<div style="height: 220px">
|
||||
<h2>preview</h2><br>
|
||||
<textarea id="code" name="code">
|
||||
function findSequence(goal) {
|
||||
function find(start,history) {
|
||||
if (start==goal)
|
||||
return history;
|
||||
else if (start>goal)
|
||||
return null;
|
||||
else
|
||||
return find(start+5,"("+history+"+5)") ||
|
||||
find(start*3,"("+history+"*3)");
|
||||
}
|
||||
return find(1,"1");
|
||||
}</textarea>
|
||||
</div>
|
||||
<br><br>
|
||||
|
||||
<h2><?php echo $t['layout'];?></h2><br>
|
||||
<input type="checkbox" onclick="showButton()" name="lockedNav" value="true"<?php if($ICEcoder["lockedNav"]) {echo ' checked';};?>> <?php echo $t['locked nav'];?><br><br>
|
||||
<?php echo $t['plugin panel aligned'];?><br>
|
||||
<select onchange="showButton()" name="pluginPanelAligned">
|
||||
<option value="left"<?php if($ICEcoder["pluginPanelAligned"] == "left") {echo " selected";};?>>left</option>
|
||||
<option value="right"<?php if($ICEcoder["pluginPanelAligned"] == "right") {echo " selected";};?>>right</option>
|
||||
</select>
|
||||
<br><br>
|
||||
|
||||
</div><div style="display: inline-block">
|
||||
<h2><?php echo $t['style'];?></h2><br>
|
||||
<?php echo $t['theme'];?><br>
|
||||
<select onchange="selectTheme();showButton()" id="select" name="theme" style="width: 95px">
|
||||
<option<?php if ($ICEcoder["theme"]=="default") {echo ' selected';}; ?>>default</option>
|
||||
<?php
|
||||
for ($i=0;$i<count($themeArray);$i++) {
|
||||
$optionSelected = $ICEcoder["theme"]==$themeArray[$i] ? ' selected' : '';
|
||||
echo '<option'.$optionSelected.'>'.$themeArray[$i].'</option>'.PHP_EOL;
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<br><br>
|
||||
|
||||
<div style="display: inline-block; width: 95px">
|
||||
<?php echo $t['font size'];?><br>
|
||||
<input type="text" name="fontSize" id="fontSize" style="width: 44px" onkeydown="showButton()" onkeyup="changeFontSize()" value="<?php echo $ICEcoder["fontSize"];?>">
|
||||
</div><div style="display: inline-block">
|
||||
<?php echo $t['indent size'];?><br>
|
||||
<input type="text" name="indentSize" id="indentSize" style="width: 44px" onkeydown="showButton()" onkeyup="changeIndentSize()" value="<?php echo $ICEcoder["indentSize"];?>">
|
||||
</div>
|
||||
<br><br>
|
||||
|
||||
<div style="display: inline-block; width: 95px">
|
||||
<?php echo $t['match brackets'];?><br>
|
||||
<select onchange="showButton()" name="matchBrackets">
|
||||
<option value="true"<?php if($ICEcoder["matchBrackets"]) {echo " selected";};?>>yes</option>
|
||||
<option value="false"<?php if(!$ICEcoder["matchBrackets"]) {echo " selected";};?>>no</option>
|
||||
</select>
|
||||
</div><div style="display: inline-block">
|
||||
<?php echo $t['show trailing space'];?><br>
|
||||
<select onchange="showButton()" name="showTrailingSpace">
|
||||
<option value="true"<?php if($ICEcoder["showTrailingSpace"]) {echo " selected";};?>>yes</option>
|
||||
<option value="false"<?php if(!$ICEcoder["showTrailingSpace"]) {echo " selected";};?>>no</option>
|
||||
</select>
|
||||
</div>
|
||||
<br><br>
|
||||
|
||||
<input type="checkbox" onclick="showButton();showHideTabs()" name="visibleTabs" value="true"<?php if($ICEcoder["visibleTabs"]) {echo ' checked';};?>> <?php echo $t['visible tabs'];?>
|
||||
<br><br>
|
||||
|
||||
<div style="display: inline-block; width: 95px">
|
||||
<?php echo $t['line wrapping'];?><br>
|
||||
<select onchange="showButton()" name="lineWrapping">
|
||||
<option value="true"<?php if($ICEcoder["lineWrapping"]) {echo " selected";};?>>yes</option>
|
||||
<option value="false"<?php if(!$ICEcoder["lineWrapping"]) {echo " selected";};?>>no</option>
|
||||
</select>
|
||||
</div><div style="display: inline-block">
|
||||
<?php echo $t['line numbers'];?><br>
|
||||
<select onchange="changeLineNumbersToggle();showButton()" name="lineNumbers" id="lineNumbers">
|
||||
<option value="true"<?php if($ICEcoder["lineNumbers"]) {echo " selected";};?>>yes</option>
|
||||
<option value="false"<?php if(!$ICEcoder["lineNumbers"]) {echo " selected";};?>>no</option>
|
||||
</select>
|
||||
</div>
|
||||
<br><br>
|
||||
|
||||
<h2><?php echo $t['functionality'];?></h2><br>
|
||||
|
||||
<div style="display: inline-block; width: 95px">
|
||||
<?php echo $t['indent type'];?><br>
|
||||
<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>
|
||||
<br><br>
|
||||
|
||||
<?php echo $t['auto indent'];?><br>
|
||||
<select onchange="showButton()" name="indentAuto">
|
||||
<option value="true"<?php if($ICEcoder["indentAuto"]) {echo " selected";};?>>yes</option>
|
||||
<option value="false"<?php if(!$ICEcoder["indentAuto"]) {echo " selected";};?>>no</option>
|
||||
</select>
|
||||
</div><div style="display: inline-block">
|
||||
<?php echo $t['auto close tags'];?><br>
|
||||
<select onchange="showButton()" name="autoCloseTags">
|
||||
<option value="true"<?php if($ICEcoder["autoCloseTags"]) {echo " selected";};?>>yes</option>
|
||||
<option value="false"<?php if(!$ICEcoder["autoCloseTags"]) {echo " selected";};?>>no</option>
|
||||
</select>
|
||||
<br><br>
|
||||
|
||||
<?php echo $t['auto close brackets'];?><br>
|
||||
<select onchange="showButton()" name="autoCloseBrackets">
|
||||
<option value="true"<?php if($ICEcoder["autoCloseBrackets"]) {echo " selected";};?>>yes</option>
|
||||
<option value="false"<?php if(!$ICEcoder["autoCloseBrackets"]) {echo " selected";};?>>no</option>
|
||||
</select>
|
||||
</div>
|
||||
<br><br>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="accountsSection" class="section" style="display: none">
|
||||
|
||||
<h2>password</h2><br>
|
||||
<?php echo $t['new password'];?> <span class="info" title="<?php echo $t['8 chars min'];?>">[?]</span><br>
|
||||
<input type="password" name="password" style="width: 320px" onkeydown="showButton()">
|
||||
<br><br>
|
||||
|
||||
<?php echo $t['confirm password'];?><br>
|
||||
<input type="password" name="passwordConfirm" style="width: 320px" onkeydown="showButton()">
|
||||
<br><br>
|
||||
|
||||
<h2><?php echo $t['multi-user'];?> <span class="info" title="<?php echo $t['Make sure you...'];?>">[?]</span></h2><br>
|
||||
<input type="checkbox" name="multiUser" value="true" onclick="showButton();changeEnableRegistrationStatus();"<?php if($ICEcoder["multiUser"]){echo ' checked';} ?>>Multi-User
|
||||
<?php
|
||||
echo '<input type="checkbox" name="enableRegistration" value="true"';
|
||||
if($ICEcoder["enableRegistration"]){echo ' checked';}
|
||||
if(!$ICEcoder["multiUser"]){
|
||||
echo ' disabled=""';
|
||||
}
|
||||
echo ' onclick="showButton()" id="enableRegistration"> '.$t['Registration'].' </input>';
|
||||
?>
|
||||
<br><br>
|
||||
|
||||
<h2>github</h2><br>
|
||||
<?php echo $t['auth token'];?> <span class="info" title="<?php echo $t['Required to get...'];?>">[?]</span> <a href="https://help.github.com/articles/creating-an-access-token-for-command-line-use" target="_blank" class="info">Personal Access Token</a> <a href="(http://developer.github.com/v3/oauth" target="_blank" class="info">Client/Secret Pair Token</a><br>
|
||||
<input type="text" name="githubAuthToken" style="width: 320px" onkeydown="showButton()" value="<?php echo $ICEcoder["githubAuthToken"];?>" autocomplete="off">
|
||||
</div>
|
||||
|
||||
<div id="securitySection" class="section" style="display: none">
|
||||
<h2><?php echo $t['security'];?></h2><br>
|
||||
<?php echo $t['banned files/folders'];?> <span class="info" title="<?php echo $t['Comma delimited'];?>">[?]</span><br>
|
||||
<input type="text" onkeydown="document.settings.changedFileSettings.value='true';showButton()" name="bannedFiles" style="width: 660px" value="<?php echo implode(", ",$ICEcoder["bannedFiles"]); ?>">
|
||||
<br><br>
|
||||
|
||||
<?php echo $t['banned paths'];?> <span class="info" title="<?php echo $t['Slash prefixed comma...'];?>">[?]</span><br>
|
||||
<input type="text" onkeydown="document.settings.changedFileSettings.value='true';showButton()" name="bannedPaths" style="width: 660px" value="<?php echo implode(", ",$ICEcoder["bannedPaths"]); ?>">
|
||||
<br><br>
|
||||
|
||||
<input type="hidden" name="changedFileSettings" value="false">
|
||||
<?php echo $t['ip addresses'];?> <span class="info" title="<?php echo $t['Comma delimited'];?>">[?]</span><br>
|
||||
<input type="text" onkeydown="showButton()" name="allowedIPs" style="width: 660px" value="<?php echo implode(", ",$ICEcoder["allowedIPs"]); ?>">
|
||||
<br><br>
|
||||
|
||||
<?php echo $t['auto-logout after'];?> <span class="info" title="<?php echo $t['Set 0 to...'];?>">[?]</span><br>
|
||||
<input type="text" onkeydown="showButton()" name="autoLogoutMins" style="width: 100px" value="<?php echo $ICEcoder["autoLogoutMins"]; ?>"> <span style="display: inline-block; padding: 2px 5px"><?php echo $t['mins of inactivity...'];?></span>
|
||||
<br><br>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
||||
lineNumbers: top.ICEcoder.lineNumbers,
|
||||
readOnly: "nocursor",
|
||||
indentUnit: top.ICEcoder.indentSize,
|
||||
tabSize: top.ICEcoder.indentSize,
|
||||
mode: "javascript",
|
||||
theme: "<?php echo $ICEcoder["theme"]=="default" ? 'icecoder' : $ICEcoder["theme"];?>"
|
||||
});
|
||||
|
||||
var input = document.getElementById("select");
|
||||
function selectTheme() {
|
||||
var theme = input.options[input.selectedIndex].innerHTML;
|
||||
if (theme=="default") {theme = "icecoder"};
|
||||
editor.setOption("theme", theme);
|
||||
}
|
||||
|
||||
function changeIndentSize() {
|
||||
var indentSize = document.getElementById("indentSize").value;
|
||||
editor.setOption("indentUnit", indentSize);
|
||||
editor.setOption("tabSize", indentSize);
|
||||
editor.refresh();
|
||||
}
|
||||
|
||||
|
||||
function changeLineNumbersToggle() {
|
||||
var lineNumbersSelect = document.getElementById("lineNumbers");
|
||||
var lineNumbers = lineNumbersSelect.options[lineNumbersSelect.selectedIndex].innerHTML == "yes" ? true : false;
|
||||
editor.setOption("lineNumbers", lineNumbers);
|
||||
editor.refresh();
|
||||
}
|
||||
|
||||
function changeFontSize() {
|
||||
cMCSS = document.styleSheets[2];
|
||||
cMCSS.rules ? strCSS = 'rules' : strCSS = 'cssRules';
|
||||
cMCSS[strCSS][0].style['fontSize'] = document.getElementById("fontSize").value;
|
||||
editor.refresh();
|
||||
}
|
||||
|
||||
var changeEnableRegistrationStatus = function(){
|
||||
document.getElementById('enableRegistration').disabled=!document.getElementById('enableRegistration').disabled;
|
||||
}
|
||||
var changeBackupsDaysStatus = function(){
|
||||
document.getElementById('backupsDays').disabled=!document.getElementById('backupsDays').disabled;
|
||||
}
|
||||
var showButton = function() {
|
||||
document.getElementById('updateButton').style.opacity = 1;
|
||||
}
|
||||
|
||||
var showHideTabs = function() {
|
||||
cMCSS = document.styleSheets[2];
|
||||
cMCSS.rules ? strCSS = 'rules' : strCSS = 'cssRules';
|
||||
cMCSS[strCSS][2].style['border-left-width'] = document.settings.visibleTabs.checked ? '1px' : '0';
|
||||
cMCSS[strCSS][2].style['margin-left'] = document.settings.visibleTabs.checked ? '-1px' : '0';
|
||||
}
|
||||
|
||||
var validatePasswords = function() {
|
||||
if (document.settings.password.value != 0 && document.settings.password.value.length<8) {
|
||||
top.ICEcoder.message('Please use at least 8 chars in the password');
|
||||
} else {
|
||||
if (document.settings.password.value != document.settings.passwordConfirm.value) {
|
||||
top.ICEcoder.message('Sorry, your passwords don\'t match')
|
||||
} else {
|
||||
document.settings.submit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tabNames = ['general','style','accounts','security'];
|
||||
var switchTab = function(tab) {
|
||||
for (var i=0; i<tabNames.length; i++) {
|
||||
document.getElementById(tabNames[i]+'Tab').className = tabNames[i] == tab ? "tab tabActive" : "tab";
|
||||
document.getElementById(tabNames[i]+'Section').style.display = tabNames[i] == tab ? "block" : "none";
|
||||
}
|
||||
editor.refresh();
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="update" id="updateButton" onClick="<?php echo $ICEcoder['demoMode'] ? "top.ICEcoder.message('Sorry, can\'t commit settings in demo mode')" : "validatePasswords()"; ?>">update</div>
|
||||
<input type="hidden" name="csrf" value="<?php echo $_SESSION["csrf"]; ?>">
|
||||
</form>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
<?php
|
||||
include("headers.php");
|
||||
include("settings.php");
|
||||
$t = $text['settings-screen'];
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>ICEcoder <?php echo $ICEcoder["versionNo"];?> settings screen</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta name="robots" content="noindex, nofollow">
|
||||
<link rel="stylesheet" type="text/css" href="settings-screen.css?microtime=<?php echo microtime(true);?>">
|
||||
<link rel="stylesheet" href="../<?php echo $ICEcoder["codeMirrorDir"]; ?>/lib/codemirror.css?microtime=<?php echo microtime(true);?>">
|
||||
<script src="../<?php echo $ICEcoder["codeMirrorDir"]; ?>/lib/codemirror-compressed.js?microtime=<?php echo microtime(true);?>"></script>
|
||||
|
||||
<style type="text/css">
|
||||
.CodeMirror {position: absolute; width: 409px; height: 180px; font-size: <?php echo $ICEcoder["fontSize"];?>; transition: font-size 0.25s ease}
|
||||
.CodeMirror-scroll {overflow: hidden}
|
||||
/* Make sure this next one remains the 3rd item, updated with JS */
|
||||
.cm-tab {border-left-width: <?php echo $ICEcoder["visibleTabs"] ? "1px" : "0";?>; margin-left: <?php echo $ICEcoder["visibleTabs"] ? "-1px" : "0";?>; border-left-style: solid; border-left-color: rgba(255,255,255,0.2)}
|
||||
</style>
|
||||
|
||||
<link rel="stylesheet" href="editor.css?microtime=<?php echo microtime(true);?>">
|
||||
<?php
|
||||
$themeArray = array();
|
||||
$handle = opendir('../'.$ICEcoder["codeMirrorDir"].'/theme/');
|
||||
while (false !== ($file = readdir($handle))) {
|
||||
if ($file !== "." && $file != "..") {
|
||||
array_push($themeArray,basename($file,".css"));
|
||||
}
|
||||
}
|
||||
sort($themeArray);
|
||||
for ($i=0;$i<count($themeArray);$i++) {
|
||||
echo '<link rel="stylesheet" href="../'.$ICEcoder["codeMirrorDir"].'/theme/'.$themeArray[$i].'.css?microtime='.microtime(true).'">'.PHP_EOL;
|
||||
}
|
||||
?>
|
||||
</head>
|
||||
|
||||
<body class="settings">
|
||||
|
||||
<div class="infoPane">
|
||||
<a href="https://icecoder.net" target="_blank"><img src="../images/ice-coder.png" alt="ICEcoder" class="logo"></a>
|
||||
|
||||
<h1 style="margin: 10px 0"><?php echo $t['settings'];?></h1>
|
||||
|
||||
<p>
|
||||
<?php echo $t['version'];?>:<br>
|
||||
v <?php echo $ICEcoder["versionNo"];?>
|
||||
<br><br>
|
||||
|
||||
<?php echo $t['website'];?>:<br>
|
||||
<a href="https://icecoder.net" target="_blank">https://icecoder.net</a>
|
||||
<br><br>
|
||||
|
||||
<?php echo $t['git'];?>:<br>
|
||||
<a href="https://github.com/mattpass/ICEcoder" target="_blank">https://github.com/mattpass/ICEcoder</a>
|
||||
<br><br>
|
||||
|
||||
<?php echo $t['codemirror dir'];?>:<br>
|
||||
<?php echo $ICEcoder["codeMirrorDir"]; ?>
|
||||
<br><br>
|
||||
|
||||
<?php echo $t['codemirror version'];?>:<br>
|
||||
<script>
|
||||
document.write(CodeMirror.version);
|
||||
</script>
|
||||
<br><br>
|
||||
|
||||
<?php echo $t['file manager root'];?>:<br>
|
||||
<?php echo $ICEcoder['root'] == "" ? "/" : $ICEcoder['root'];?>
|
||||
<br><br>
|
||||
|
||||
<div style="font-size: 10px; line-height: 12px">
|
||||
<?php echo $t['Get in contact...'];?><br>
|
||||
<a href="https://www.twitter.com/icecoder" style="font-size: 10px" target="_blank">Twitter</a><br>
|
||||
<a href="https://facebook.com/ICEcoder.net" style="font-size: 10px" target="_blank">Facebook</a><br>
|
||||
<a href="https://groups.google.com/forum/#!forum/icecoder" style="font-size: 10px" target="_blank">Google Groups</a><br>
|
||||
<a href="https://github.com/mattpass/ICEcoder" style="font-size: 10px" target="_blank">GitHub</a><br>
|
||||
<a href="mailto:info@icecoder.net" style="font-size: 10px">Email</a><br><br>
|
||||
<?php echo $t['You may use...'];?>
|
||||
</div>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<form name="settings" action="settings.php" method="POST">
|
||||
|
||||
<div class="tabContainer">
|
||||
<div id="generalTab" class="tab tabActive" onclick="switchTab('general')">General</div>
|
||||
<div id="styleTab" class="tab" onclick="switchTab('style')">Style</div>
|
||||
<div id="accountsTab" class="tab" onclick="switchTab('accounts')">Accounts</div>
|
||||
<div id="securityTab" class="tab" onclick="switchTab('security')">Security</div>
|
||||
</div>
|
||||
|
||||
<div id="generalSection" class="section" style="display: block">
|
||||
|
||||
<div style="display: inline-block; margin-right: 40px">
|
||||
|
||||
<h2>language</h2><br>
|
||||
<select onchange="showButton()" name="languageUser">
|
||||
<?php
|
||||
$langFiles = array("chinese-simplified.php","chinese-traditional.php","dutch.php","english.php","french.php","german.php","italian.php","norwegian.php","persian.php","portuguese-brazilian.php","spanish.php");
|
||||
$langText = array("中国(简体)","中國(繁體)","Nederlands","English","Français","Deutsch","Italiano","Norsk","فارسی","Portugues(br)","Español");
|
||||
for ($i=0; $i<count($langFiles); $i++) {
|
||||
echo '<option value="'.$langFiles[$i].'"'.($ICEcoder["languageUser"]==$langFiles[$i] ? ' selected' : '').'>'.$langText[$i].'</option>'.PHP_EOL;
|
||||
}
|
||||
?>
|
||||
</select> <span class="info" style="display: inline-block; padding-top: 2px" title="Reload required after changing">[?]</span>
|
||||
<br><br>
|
||||
|
||||
<h2><?php echo $t['functionality'];?></h2><br>
|
||||
<input type="checkbox" onclick="showButton()" name="checkUpdates" value="true"<?php if($ICEcoder["checkUpdates"]) {echo ' checked';};?>> <?php echo $t['check for updates...'];?><br>
|
||||
<input type="checkbox" onclick="showButton()" name="openLastFiles" value="true"<?php if($ICEcoder["openLastFiles"]) {echo ' checked';};?>> <?php echo $t['auto open last...'];?><br>
|
||||
<input type="checkbox" onclick="showButton()" name="updateDiffOnSave" value="true"<?php if($ICEcoder["updateDiffOnSave"]) {echo ' checked';};?>> update diff pane on save
|
||||
<br><br>
|
||||
|
||||
<h2><?php echo $t['assisting'];?></h2><br>
|
||||
<input type="checkbox" onclick="showButton()" name="codeAssist" value="true"<?php if($ICEcoder["codeAssist"]) {echo ' checked';};?>> <?php echo $t['code assist'];?><br>
|
||||
<br>
|
||||
<?php echo $t['tag wrapper command'];?><br>
|
||||
<select onchange="showButton()" name="tagWrapperCommand">
|
||||
<option value="ctrl+alt"<?php if($ICEcoder["tagWrapperCommand"]=='ctrl+alt') {echo " selected";};?>>ctrl/cmd + alt</option>
|
||||
<option value="alt-left"<?php if($ICEcoder["tagWrapperCommand"]=='alt-left') {echo " selected";};?>>alt left</option>
|
||||
</select>
|
||||
<br><br>
|
||||
|
||||
<?php echo $t['auto-complete on'];?><br>
|
||||
<select onchange="showButton()" name="autoComplete">
|
||||
<option value="ctrl+space"<?php if($ICEcoder["autoComplete"]=='ctrl+space') {echo " selected";};?>>ctrl/cmd + space</option>
|
||||
<option value="keypress"<?php if($ICEcoder["autoComplete"]=='keypress') {echo " selected";};?>>keypress</option>
|
||||
</select>
|
||||
<br><br>
|
||||
|
||||
</div>
|
||||
|
||||
<div style="display: inline-block">
|
||||
|
||||
<h2>find & replace</h2><br>
|
||||
<?php echo $t['when finding in...'];?>:<br>
|
||||
<input type="text" onkeydown="showButton()" name="findFilesExclude" style="width: 300px" value="<?php echo implode(", ",$ICEcoder["findFilesExclude"]); ?>">
|
||||
<br><br>
|
||||
|
||||
<h2><?php echo $t['bug reporting'];?></h2><br>
|
||||
<?php echo $t['check in files'];?> <span class="info" title="<?php echo $t['Slash prefixed comma...'];?>">[?]</span><br>
|
||||
<input type="text" name="bugFilePaths" style="width: 300px" onkeydown="showButton()" value="<?php echo implode(", ",$ICEcoder["bugFilePaths"]);?>"><br>
|
||||
<span style="display: inline-block; padding: 6px 5px 0 0">...<?php echo $t['every'];?></span>
|
||||
<input type="text" name="bugFileCheckTimer" style="width: 50px; margin-top: 3px" onkeydown="showButton()" value="<?php echo $ICEcoder["bugFileCheckTimer"];?>">
|
||||
<span style="display: inline-block; padding: 6px 5px 0 5px"><?php echo $t['secs getting last'];?></span>
|
||||
<input type="text" name="bugFileMaxLines" style="width: 50px; margin-top: 3px" onkeydown="showButton()" value="<?php echo $ICEcoder["bugFileMaxLines"];?>">
|
||||
<span style="display: inline-block; padding: 6px 5px 0 5px"><?php echo $t['lines'];?></span>
|
||||
<br><br>
|
||||
|
||||
<h2><?php echo $t['file manager'];?></h2><br>
|
||||
<?php echo $t['root'];?> <span class="info" title="<?php echo $t['Slash prefixed'];?>">[?]</span><br>
|
||||
<input type="text" name="root" style="width: 300px" onkeydown="document.settings.changedFileSettings.value='true';showButton()" value="<?php echo $ICEcoder["root"];?>">
|
||||
<br><br>
|
||||
|
||||
<h2><?php echo $t['backups'];?></h2><br>
|
||||
<input type="checkbox" onclick="showButton();changeBackupsDaysStatus();" name="backupsKept" value="true"<?php if($ICEcoder["backupsKept"]) {echo ' checked';};?>> <?php echo $t['keep version control...'];?> <input type="text" name="backupsDays" id="backupsDays" style="width: 50px; margin: 3px 5px 0 5px" onkeydown="document.settings.changedFileSettings.value='true';showButton()" value="<?php echo $ICEcoder["backupsDays"];?>" <?php
|
||||
if(!$ICEcoder["backupsKept"]){
|
||||
echo ' disabled=""';
|
||||
}?>> <?php echo $t['days'];?><br>
|
||||
<div style="padding: 5px 5px 5px 5px; color: #888">
|
||||
<?php
|
||||
// Display number of days backups available
|
||||
$backupDirBase = str_replace("\\","/",dirname(__FILE__))."/../data/backups/";
|
||||
$backupDirHost = isset($ftpSite) ? parse_url($ftpSite,PHP_URL_HOST) : "localhost";
|
||||
$backupDirsList = scandir($backupDirBase.$backupDirHost);
|
||||
// Remove . and .. from array
|
||||
for ($i=0; $i<count($backupDirsList); $i++) {
|
||||
if ($backupDirsList[$i] == "." || $backupDirsList[$i] == "..") {
|
||||
array_splice($backupDirsList,$i,1);
|
||||
$i--;
|
||||
}
|
||||
}
|
||||
// Display text re the number of days backups have taken place
|
||||
$backupNumDays = $backupDirsList[0] != "" && count($backupDirsList) > 0 ? count($backupDirsList) : 0;
|
||||
echo $backupNumDays." ".($backupNumDays != 1 ? $t['days'] : $t['day'])." ".$t['of backups stored...'];
|
||||
?>
|
||||
</div><br>
|
||||
|
||||
<input type="checkbox" onclick="showButton();" name="deleteToTmp" value="true"<?php if($ICEcoder["deleteToTmp"]) {echo ' checked';};?>> <?php echo $t['deleting actually moves...'];?> <span class="info" title="<?php echo $t['local/server items...'];?>" style="position: absolute; margin-top: 6px">[?]</span>
|
||||
<br><br>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="styleSection" class="section" style="display: none">
|
||||
|
||||
<div style="display: inline-block; width: 400px; margin-right: 35px">
|
||||
<div style="height: 220px">
|
||||
<h2>preview</h2><br>
|
||||
<textarea id="code" name="code">
|
||||
function findSequence(goal) {
|
||||
function find(start,history) {
|
||||
if (start==goal)
|
||||
return history;
|
||||
else if (start>goal)
|
||||
return null;
|
||||
else
|
||||
return find(start+5,"("+history+"+5)") ||
|
||||
find(start*3,"("+history+"*3)");
|
||||
}
|
||||
return find(1,"1");
|
||||
}</textarea>
|
||||
</div>
|
||||
<br><br>
|
||||
|
||||
<h2><?php echo $t['layout'];?></h2><br>
|
||||
<input type="checkbox" onclick="showButton()" name="lockedNav" value="true"<?php if($ICEcoder["lockedNav"]) {echo ' checked';};?>> <?php echo $t['locked nav'];?><br><br>
|
||||
<?php echo $t['plugin panel aligned'];?><br>
|
||||
<select onchange="showButton()" name="pluginPanelAligned">
|
||||
<option value="left"<?php if($ICEcoder["pluginPanelAligned"] == "left") {echo " selected";};?>>left</option>
|
||||
<option value="right"<?php if($ICEcoder["pluginPanelAligned"] == "right") {echo " selected";};?>>right</option>
|
||||
</select>
|
||||
<br><br>
|
||||
|
||||
</div><div style="display: inline-block">
|
||||
<h2><?php echo $t['style'];?></h2><br>
|
||||
<?php echo $t['theme'];?><br>
|
||||
<select onchange="selectTheme();showButton()" id="select" name="theme" style="width: 95px">
|
||||
<option<?php if ($ICEcoder["theme"]=="default") {echo ' selected';}; ?>>default</option>
|
||||
<?php
|
||||
for ($i=0;$i<count($themeArray);$i++) {
|
||||
$optionSelected = $ICEcoder["theme"]==$themeArray[$i] ? ' selected' : '';
|
||||
echo '<option'.$optionSelected.'>'.$themeArray[$i].'</option>'.PHP_EOL;
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<br><br>
|
||||
|
||||
<div style="display: inline-block; width: 95px">
|
||||
<?php echo $t['font size'];?><br>
|
||||
<input type="text" name="fontSize" id="fontSize" style="width: 44px" onkeydown="showButton()" onkeyup="changeFontSize()" value="<?php echo $ICEcoder["fontSize"];?>">
|
||||
</div><div style="display: inline-block">
|
||||
<?php echo $t['indent size'];?><br>
|
||||
<input type="text" name="indentSize" id="indentSize" style="width: 44px" onkeydown="showButton()" onkeyup="changeIndentSize()" value="<?php echo $ICEcoder["indentSize"];?>">
|
||||
</div>
|
||||
<br><br>
|
||||
|
||||
<div style="display: inline-block; width: 95px">
|
||||
<?php echo $t['match brackets'];?><br>
|
||||
<select onchange="showButton()" name="matchBrackets">
|
||||
<option value="true"<?php if($ICEcoder["matchBrackets"]) {echo " selected";};?>>yes</option>
|
||||
<option value="false"<?php if(!$ICEcoder["matchBrackets"]) {echo " selected";};?>>no</option>
|
||||
</select>
|
||||
</div><div style="display: inline-block">
|
||||
<?php echo $t['show trailing space'];?><br>
|
||||
<select onchange="showButton()" name="showTrailingSpace">
|
||||
<option value="true"<?php if($ICEcoder["showTrailingSpace"]) {echo " selected";};?>>yes</option>
|
||||
<option value="false"<?php if(!$ICEcoder["showTrailingSpace"]) {echo " selected";};?>>no</option>
|
||||
</select>
|
||||
</div>
|
||||
<br><br>
|
||||
|
||||
<input type="checkbox" onclick="showButton();showHideTabs()" name="visibleTabs" value="true"<?php if($ICEcoder["visibleTabs"]) {echo ' checked';};?>> <?php echo $t['visible tabs'];?>
|
||||
<br><br>
|
||||
|
||||
<div style="display: inline-block; width: 95px">
|
||||
<?php echo $t['line wrapping'];?><br>
|
||||
<select onchange="showButton()" name="lineWrapping">
|
||||
<option value="true"<?php if($ICEcoder["lineWrapping"]) {echo " selected";};?>>yes</option>
|
||||
<option value="false"<?php if(!$ICEcoder["lineWrapping"]) {echo " selected";};?>>no</option>
|
||||
</select>
|
||||
</div><div style="display: inline-block">
|
||||
<?php echo $t['line numbers'];?><br>
|
||||
<select onchange="changeLineNumbersToggle();showButton()" name="lineNumbers" id="lineNumbers">
|
||||
<option value="true"<?php if($ICEcoder["lineNumbers"]) {echo " selected";};?>>yes</option>
|
||||
<option value="false"<?php if(!$ICEcoder["lineNumbers"]) {echo " selected";};?>>no</option>
|
||||
</select>
|
||||
</div>
|
||||
<br><br>
|
||||
|
||||
<h2><?php echo $t['functionality'];?></h2><br>
|
||||
|
||||
<div style="display: inline-block; width: 95px">
|
||||
<?php echo $t['indent type'];?><br>
|
||||
<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>
|
||||
<br><br>
|
||||
|
||||
<?php echo $t['auto indent'];?><br>
|
||||
<select onchange="showButton()" name="indentAuto">
|
||||
<option value="true"<?php if($ICEcoder["indentAuto"]) {echo " selected";};?>>yes</option>
|
||||
<option value="false"<?php if(!$ICEcoder["indentAuto"]) {echo " selected";};?>>no</option>
|
||||
</select>
|
||||
</div><div style="display: inline-block">
|
||||
<?php echo $t['auto close tags'];?><br>
|
||||
<select onchange="showButton()" name="autoCloseTags">
|
||||
<option value="true"<?php if($ICEcoder["autoCloseTags"]) {echo " selected";};?>>yes</option>
|
||||
<option value="false"<?php if(!$ICEcoder["autoCloseTags"]) {echo " selected";};?>>no</option>
|
||||
</select>
|
||||
<br><br>
|
||||
|
||||
<?php echo $t['auto close brackets'];?><br>
|
||||
<select onchange="showButton()" name="autoCloseBrackets">
|
||||
<option value="true"<?php if($ICEcoder["autoCloseBrackets"]) {echo " selected";};?>>yes</option>
|
||||
<option value="false"<?php if(!$ICEcoder["autoCloseBrackets"]) {echo " selected";};?>>no</option>
|
||||
</select>
|
||||
</div>
|
||||
<br><br>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="accountsSection" class="section" style="display: none">
|
||||
|
||||
<h2>password</h2><br>
|
||||
<?php echo $t['new password'];?> <span class="info" title="<?php echo $t['8 chars min'];?>">[?]</span><br>
|
||||
<input type="password" name="password" style="width: 320px" onkeydown="showButton()">
|
||||
<br><br>
|
||||
|
||||
<?php echo $t['confirm password'];?><br>
|
||||
<input type="password" name="passwordConfirm" style="width: 320px" onkeydown="showButton()">
|
||||
<br><br>
|
||||
|
||||
<h2><?php echo $t['multi-user'];?> <span class="info" title="<?php echo $t['Make sure you...'];?>">[?]</span></h2><br>
|
||||
<input type="checkbox" name="multiUser" value="true" onclick="showButton();changeEnableRegistrationStatus();"<?php if($ICEcoder["multiUser"]){echo ' checked';} ?>>Multi-User
|
||||
<?php
|
||||
echo '<input type="checkbox" name="enableRegistration" value="true"';
|
||||
if($ICEcoder["enableRegistration"]){echo ' checked';}
|
||||
if(!$ICEcoder["multiUser"]){
|
||||
echo ' disabled=""';
|
||||
}
|
||||
echo ' onclick="showButton()" id="enableRegistration"> '.$t['Registration'].' </input>';
|
||||
?>
|
||||
<br><br>
|
||||
|
||||
<h2>github</h2><br>
|
||||
<?php echo $t['auth token'];?> <span class="info" title="<?php echo $t['Required to get...'];?>">[?]</span> <a href="https://help.github.com/articles/creating-an-access-token-for-command-line-use" target="_blank" class="info">Personal Access Token</a> <a href="(http://developer.github.com/v3/oauth" target="_blank" class="info">Client/Secret Pair Token</a><br>
|
||||
<input type="text" name="githubAuthToken" style="width: 320px" onkeydown="showButton()" value="<?php echo $ICEcoder["githubAuthToken"];?>" autocomplete="off">
|
||||
</div>
|
||||
|
||||
<div id="securitySection" class="section" style="display: none">
|
||||
<h2><?php echo $t['security'];?></h2><br>
|
||||
<?php echo $t['banned files/folders'];?> <span class="info" title="<?php echo $t['Comma delimited'];?>">[?]</span><br>
|
||||
<input type="text" onkeydown="document.settings.changedFileSettings.value='true';showButton()" name="bannedFiles" style="width: 660px" value="<?php echo implode(", ",$ICEcoder["bannedFiles"]); ?>">
|
||||
<br><br>
|
||||
|
||||
<?php echo $t['banned paths'];?> <span class="info" title="<?php echo $t['Slash prefixed comma...'];?>">[?]</span><br>
|
||||
<input type="text" onkeydown="document.settings.changedFileSettings.value='true';showButton()" name="bannedPaths" style="width: 660px" value="<?php echo implode(", ",$ICEcoder["bannedPaths"]); ?>">
|
||||
<br><br>
|
||||
|
||||
<input type="hidden" name="changedFileSettings" value="false">
|
||||
<?php echo $t['ip addresses'];?> <span class="info" title="<?php echo $t['Comma delimited'];?>">[?]</span><br>
|
||||
<input type="text" onkeydown="showButton()" name="allowedIPs" style="width: 660px" value="<?php echo implode(", ",$ICEcoder["allowedIPs"]); ?>">
|
||||
<br><br>
|
||||
|
||||
<?php echo $t['auto-logout after'];?> <span class="info" title="<?php echo $t['Set 0 to...'];?>">[?]</span><br>
|
||||
<input type="text" onkeydown="showButton()" name="autoLogoutMins" style="width: 100px" value="<?php echo $ICEcoder["autoLogoutMins"]; ?>"> <span style="display: inline-block; padding: 2px 5px"><?php echo $t['mins of inactivity...'];?></span>
|
||||
<br><br>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
||||
lineNumbers: top.ICEcoder.lineNumbers,
|
||||
readOnly: "nocursor",
|
||||
indentUnit: top.ICEcoder.indentSize,
|
||||
tabSize: top.ICEcoder.indentSize,
|
||||
mode: "javascript",
|
||||
theme: "<?php echo $ICEcoder["theme"]=="default" ? 'icecoder' : $ICEcoder["theme"];?>"
|
||||
});
|
||||
|
||||
var input = document.getElementById("select");
|
||||
function selectTheme() {
|
||||
var theme = input.options[input.selectedIndex].innerHTML;
|
||||
if (theme=="default") {theme = "icecoder"};
|
||||
editor.setOption("theme", theme);
|
||||
}
|
||||
|
||||
function changeIndentSize() {
|
||||
var indentSize = document.getElementById("indentSize").value;
|
||||
editor.setOption("indentUnit", indentSize);
|
||||
editor.setOption("tabSize", indentSize);
|
||||
editor.refresh();
|
||||
}
|
||||
|
||||
|
||||
function changeLineNumbersToggle() {
|
||||
var lineNumbersSelect = document.getElementById("lineNumbers");
|
||||
var lineNumbers = lineNumbersSelect.options[lineNumbersSelect.selectedIndex].innerHTML == "yes" ? true : false;
|
||||
editor.setOption("lineNumbers", lineNumbers);
|
||||
editor.refresh();
|
||||
}
|
||||
|
||||
function changeFontSize() {
|
||||
cMCSS = document.styleSheets[2];
|
||||
cMCSS.rules ? strCSS = 'rules' : strCSS = 'cssRules';
|
||||
cMCSS[strCSS][0].style['fontSize'] = document.getElementById("fontSize").value;
|
||||
editor.refresh();
|
||||
}
|
||||
|
||||
var changeEnableRegistrationStatus = function(){
|
||||
document.getElementById('enableRegistration').disabled=!document.getElementById('enableRegistration').disabled;
|
||||
}
|
||||
var changeBackupsDaysStatus = function(){
|
||||
document.getElementById('backupsDays').disabled=!document.getElementById('backupsDays').disabled;
|
||||
}
|
||||
var showButton = function() {
|
||||
document.getElementById('updateButton').style.opacity = 1;
|
||||
}
|
||||
|
||||
var showHideTabs = function() {
|
||||
cMCSS = document.styleSheets[2];
|
||||
cMCSS.rules ? strCSS = 'rules' : strCSS = 'cssRules';
|
||||
cMCSS[strCSS][2].style['border-left-width'] = document.settings.visibleTabs.checked ? '1px' : '0';
|
||||
cMCSS[strCSS][2].style['margin-left'] = document.settings.visibleTabs.checked ? '-1px' : '0';
|
||||
}
|
||||
|
||||
var validatePasswords = function() {
|
||||
if (document.settings.password.value != 0 && document.settings.password.value.length<8) {
|
||||
top.ICEcoder.message('Please use at least 8 chars in the password');
|
||||
} else {
|
||||
if (document.settings.password.value != document.settings.passwordConfirm.value) {
|
||||
top.ICEcoder.message('Sorry, your passwords don\'t match')
|
||||
} else {
|
||||
document.settings.submit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tabNames = ['general','style','accounts','security'];
|
||||
var switchTab = function(tab) {
|
||||
for (var i=0; i<tabNames.length; i++) {
|
||||
document.getElementById(tabNames[i]+'Tab').className = tabNames[i] == tab ? "tab tabActive" : "tab";
|
||||
document.getElementById(tabNames[i]+'Section').style.display = tabNames[i] == tab ? "block" : "none";
|
||||
}
|
||||
editor.refresh();
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="update" id="updateButton" onClick="<?php echo $ICEcoder['demoMode'] ? "top.ICEcoder.message('Sorry, can\'t commit settings in demo mode')" : "validatePasswords()"; ?>">update</div>
|
||||
<input type="hidden" name="csrf" value="<?php echo $_SESSION["csrf"]; ?>">
|
||||
</form>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
@@ -5,7 +5,7 @@ $t = $text['settings-update'];
|
||||
|
||||
// Update this config file?
|
||||
if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && isset($_POST["theme"]) && $_POST["theme"]) {
|
||||
$settingsContents = getData($settingsFile);
|
||||
$settingsContents = getData("../data/".$settingsFile);
|
||||
// Replace our settings vars
|
||||
$repPosStart = strpos($settingsContents,'"root"');
|
||||
$repPosEnd = strpos($settingsContents,'"plugins"');
|
||||
@@ -63,12 +63,12 @@ if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && isset
|
||||
$settingsContents = substr($settingsContents,0,$repPosStart).$settingsNew.substr($settingsContents,($repPosEnd),strlen($settingsContents));
|
||||
|
||||
// Now update the config file
|
||||
if (is_writeable($settingsFile)) {
|
||||
$fh = fopen($settingsFile, 'w');
|
||||
if (is_writeable("../data/".$settingsFile)) {
|
||||
$fh = fopen("../data/".$settingsFile, 'w');
|
||||
fwrite($fh, $settingsContents);
|
||||
fclose($fh);
|
||||
} else {
|
||||
echo "<script>top.ICEcoder.message('".$t['Cannot update config']." lib/".$settingsFile." ".$t['and try again']."');</script>";
|
||||
echo "<script>top.ICEcoder.message('".$t['Cannot update config']." data/".$settingsFile." ".$t['and try again']."');</script>";
|
||||
}
|
||||
|
||||
// OK, now the config file has been updated, update our current session with new arrays
|
||||
@@ -85,7 +85,7 @@ if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && isset
|
||||
$refreshFM = $_POST['changedFileSettings']=="true" ? "true" : "false";
|
||||
|
||||
// Change multiUser and enableRegistration in config___settings.php
|
||||
$generalSettingsContents = getData($configSettings);
|
||||
$generalSettingsContents = getData(dirname(__FILE__)."/../data/".$configSettings);
|
||||
$isMultiUser = isset($_POST['multiUser']) && $_POST['multiUser'] ? "true" : "false";
|
||||
$generalSettingsContents = str_replace('"multiUser" => true,','"multiUser" => '.$isMultiUser.',',$generalSettingsContents);
|
||||
$generalSettingsContents = str_replace('"multiUser" => false,','"multiUser" => '.$isMultiUser.',',$generalSettingsContents);
|
||||
@@ -94,12 +94,12 @@ if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && isset
|
||||
$generalSettingsContents = str_replace('"enableRegistration" => true','"enableRegistration" => '.$isEnableRegistration,$generalSettingsContents);
|
||||
$generalSettingsContents = str_replace('"enableRegistration" => false','"enableRegistration" => '.$isEnableRegistration,$generalSettingsContents);
|
||||
|
||||
if (is_writeable($configSettings)) {
|
||||
$fConfigSettings = fopen($configSettings, 'w');
|
||||
if (is_writeable(dirname(__FILE__)."/../data/".$configSettings)) {
|
||||
$fConfigSettings = fopen(dirname(__FILE__)."/../data/".$configSettings, 'w');
|
||||
fwrite($fConfigSettings, $generalSettingsContents);
|
||||
fclose($fConfigSettings);
|
||||
} else {
|
||||
echo "<script>top.ICEcoder.message('".$t['Cannot update config']." lib/".$configSettings." ".$t['and try again']."');</script>";
|
||||
echo "<script>top.ICEcoder.message('".$t['Cannot update config']." data/".$configSettings." ".$t['and try again']."');</script>";
|
||||
}
|
||||
|
||||
$githubAuthTokenSet = $ICEcoder["githubAuthToken"] != "" ? "true" : "false";
|
||||
@@ -114,4 +114,3 @@ if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && isset
|
||||
$jsBugFilePaths = "['".str_replace(",","','",str_replace(" ","",strClean($_POST['bugFilePaths'])))."']";
|
||||
echo "<script>top.ICEcoder.settingsScreen('hide');top.ICEcoder.useNewSettings('".$themeURL."',".$ICEcoder["codeAssist"].",".$ICEcoder["lockedNav"].",'".$ICEcoder["tagWrapperCommand"]."','".$ICEcoder["autoComplete"]."',".$ICEcoder["visibleTabs"].",'".$ICEcoder["fontSize"]."',".$ICEcoder["lineWrapping"].",".$ICEcoder["lineNumbers"].",".$ICEcoder["showTrailingSpace"].",".$ICEcoder["matchBrackets"].",".$ICEcoder["autoCloseTags"].",".$ICEcoder["autoCloseBrackets"].",".$ICEcoder["indentWithTabs"].",".$ICEcoder["indentAuto"].",".$ICEcoder["indentSize"].",'".$ICEcoder["pluginPanelAligned"]."',".$jsBugFilePaths.",".$ICEcoder["bugFileCheckTimer"].",".$ICEcoder["bugFileMaxLines"].",'".$githubAuthTokenSet."',".$ICEcoder["updateDiffOnSave"].",".$ICEcoder["autoLogoutMins"].",".$refreshFM.");top.iceRoot = '".$ICEcoder["root"]."';</script>";
|
||||
}
|
||||
?>
|
||||
@@ -1,23 +1,23 @@
|
||||
<?php
|
||||
// Establish settings and users template filenames
|
||||
$configSettings = 'config___settings.php';
|
||||
$configUsersTemplate = 'config___users-template.php';
|
||||
$configSettings = 'config-settings.php';
|
||||
$configUsersTemplate = 'template-users.php';
|
||||
|
||||
// Create a new config file if it doesn't exist yet.
|
||||
// The reason we create it, is so it has PHP write permissions, meaning we can update it later
|
||||
if (!file_exists(dirname(__FILE__)."/".$configSettings)) {
|
||||
if (!file_exists(dirname(__FILE__)."/../data/".$configSettings)) {
|
||||
// Include our params to make use of (as $newConfigSettingsFile)
|
||||
include(dirname(__FILE__)."/settings-system-params.php");
|
||||
if ($fConfigSettings = fopen(dirname(__FILE__)."/".$configSettings, 'w')) {
|
||||
include(dirname(__FILE__)."/template-system.php");
|
||||
if ($fConfigSettings = fopen(dirname(__FILE__)."/../data/".$configSettings, 'w')) {
|
||||
fwrite($fConfigSettings, $newConfigSettingsFile);
|
||||
fclose($fConfigSettings);
|
||||
} else {
|
||||
die("Cannot update config file lib/".$configSettings.". Please check write permissions on lib/ and try again");
|
||||
die("Cannot update config file data/".$configSettings.". Please check write permissions on data/ and try again");
|
||||
}
|
||||
}
|
||||
|
||||
// Load config settings
|
||||
include(dirname(__FILE__)."/".$configSettings);
|
||||
include(dirname(__FILE__)."/../data/".$configSettings);
|
||||
|
||||
// Load common functions
|
||||
include_once(dirname(__FILE__)."/settings-common.php");
|
||||
@@ -32,15 +32,15 @@ $settingsFile = 'config-'.$username.str_replace(".","_",str_replace("www.","",$_
|
||||
$setPWorLogin = "login";
|
||||
|
||||
// Create user settings file if it doesn't exist
|
||||
if (!file_exists(dirname(__FILE__)."/".$settingsFile) && $ICEcoderSettings['enableRegistration']) {
|
||||
if (!copy(dirname(__FILE__)."/".$configUsersTemplate, dirname(__FILE__)."/".$settingsFile)) {
|
||||
die("Couldn't create $settingsFile. Maybe you need write permissions on the lib folder?");
|
||||
if (!file_exists(dirname(__FILE__)."/../data/".$settingsFile) && $ICEcoderSettings['enableRegistration']) {
|
||||
if (!copy(dirname(__FILE__)."/".$configUsersTemplate, dirname(__FILE__)."/../data/".$settingsFile)) {
|
||||
die("Couldn't create $settingsFile. Maybe you need write permissions on the data folder?");
|
||||
}
|
||||
$setPWorLogin = "set password";
|
||||
}
|
||||
|
||||
// Load user settings
|
||||
include(dirname(__FILE__)."/".$settingsFile);
|
||||
include(dirname(__FILE__)."/../data/".$settingsFile);
|
||||
|
||||
// Remove any previous files that are no longer there
|
||||
$prevFiles = explode(",",$ICEcoderUserSettings['previousFiles']);
|
||||
@@ -55,9 +55,9 @@ $ICEcoderUserSettings['previousFiles'] = $prevFilesAvail;
|
||||
|
||||
// Replace our config created date with the filemtime?
|
||||
if (basename($_SERVER['SCRIPT_NAME']) == "index.php" && $ICEcoderUserSettings['configCreateDate'] == 0) {
|
||||
$settingsContents = getData(dirname(__FILE__)."/".$settingsFile);
|
||||
$settingsContents = getData(dirname(__FILE__)."/../data/".$settingsFile);
|
||||
clearstatcache();
|
||||
$configfilemtime = filemtime(dirname(__FILE__)."/"."config___settings.php");
|
||||
$configfilemtime = filemtime(dirname(__FILE__)."/../data/"."config-settings.php");
|
||||
// Make it a number (avoids null, undefined etc)
|
||||
$configfilemtime = intval($configfilemtime);
|
||||
// Set it to the epoch time now if we don't have a real value
|
||||
@@ -66,7 +66,7 @@ if (basename($_SERVER['SCRIPT_NAME']) == "index.php" && $ICEcoderUserSettings['c
|
||||
}
|
||||
$settingsContents = str_replace('"configCreateDate" => 0,','"configCreateDate" => '.$configfilemtime.',',$settingsContents);
|
||||
// Now update the config file
|
||||
$fh = fopen(dirname(__FILE__)."/".$settingsFile, 'w') or die("Can't update config file. Please set public write permissions on ".$settingsFile." and press refresh");
|
||||
$fh = fopen(dirname(__FILE__)."/../data/".$settingsFile, 'w') or die("Can't update config file. Please set public write permissions on ".$settingsFile." and press refresh");
|
||||
fwrite($fh, $settingsContents);
|
||||
fclose($fh);
|
||||
// Set the new value in array
|
||||
@@ -75,7 +75,7 @@ if (basename($_SERVER['SCRIPT_NAME']) == "index.php" && $ICEcoderUserSettings['c
|
||||
|
||||
// On mismatch of settings file to system, rename to .old and reload
|
||||
If ($ICEcoderUserSettings["versionNo"] != $ICEcoderSettings["versionNo"]) {
|
||||
rename(dirname(__FILE__)."/".$settingsFile,dirname(__FILE__)."/".str_replace(".php",".old",$settingsFile));
|
||||
rename(dirname(__FILE__)."/../data/".$settingsFile,dirname(__FILE__)."/../data/".str_replace(".php",".old",$settingsFile));
|
||||
header("Location: settings.php");
|
||||
echo "<script>window.location='settings.php';</script>";
|
||||
die('Found old settings file, reloading...');
|
||||
@@ -97,25 +97,6 @@ $_SESSION['text'] = $text;
|
||||
if ((!$ICEcoder['loginRequired'] || $ICEcoder['demoMode']) && $ICEcoder['password']!="") {$_SESSION['loggedIn']=true;};
|
||||
$demoMode = $ICEcoder['demoMode'];
|
||||
|
||||
// Check if trial period has ended
|
||||
$tPeriod = 1296000-1;
|
||||
|
||||
if (isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && generateHash(strClean($ICEcoder['licenseEmail']),$ICEcoder['licenseCode'])!=$ICEcoder['licenseCode'] && $ICEcoder['configCreateDate'] > 0 && $ICEcoder['configCreateDate']+$tPeriod < time() && !isset($_GET['get']) && !isset($_POST['code'])) {
|
||||
if (file_exists('lib/login.php')) {
|
||||
// Go to get code screen in top level window
|
||||
echo "<script>window.location='lib/login.php?get=code&csrf=".$_SESSION["csrf"]."';</script>";
|
||||
} else {
|
||||
// Go to get code screen in top level window
|
||||
echo "<script>window.location='login.php?get=code&csrf=".$_SESSION["csrf"]."';</script>";
|
||||
}
|
||||
die('Redirecting to donate screen...');
|
||||
exit;
|
||||
}
|
||||
$tRemaining = ($ICEcoder['configCreateDate']+$tPeriod)-time();
|
||||
if ($tRemaining > $tPeriod || $ICEcoder['configCreateDate'] == 0) {$tRemaining = $tPeriod;};
|
||||
$tRemainingPerc = number_format($tRemaining/$tPeriod,2);
|
||||
$tDaysRemaining = intval($tRemaining/(60*60*24));
|
||||
|
||||
// Update this config file?
|
||||
include(dirname(__FILE__)."/settings-update.php");
|
||||
|
||||
@@ -126,7 +107,7 @@ if (!isset($_SESSION['username'])) {$_SESSION['username'] = false;};
|
||||
// Attempt a login with password
|
||||
if(isset($_POST['submit']) && $setPWorLogin=="login") {
|
||||
// On success, set username if multiUser, loggedIn to true and redirect
|
||||
if (generateHash(strClean($_POST['password']),$ICEcoder["password"])==$ICEcoder["password"]) {
|
||||
if (verifyHash(strClean($_POST['password']),$ICEcoder["password"])==$ICEcoder["password"]) {
|
||||
session_regenerate_id();
|
||||
if ($ICEcoder["multiUser"]) {
|
||||
$_SESSION['username'] = $_POST['username'];
|
||||
@@ -200,40 +181,12 @@ if ((!$_SESSION['loggedIn'] || $ICEcoder["password"] == "") && !strpos($_SERVER[
|
||||
}
|
||||
die('Redirecting to login...');
|
||||
|
||||
// If we're unlocking ICEcoder after donating
|
||||
} elseif (isset($_POST['submit']) && (strpos($_POST['submit'],"Unlock ICEcoder")>-1)) {
|
||||
if (generateHash(strClean($_POST['email']),$_POST['code'])==$_POST['code']) {
|
||||
$settingsContents = getData($settingsFile);
|
||||
// Replace our empty email & code with the one submitted by user
|
||||
$settingsContents = str_replace('"licenseEmail" => "",','"licenseEmail" => "'.$_POST['email'].'",',$settingsContents);
|
||||
$settingsContents = str_replace('"licenseCode" => "",','"licenseCode" => "'.$_POST['code'].'",',$settingsContents);
|
||||
// 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");
|
||||
fwrite($fh, $settingsContents);
|
||||
fclose($fh);
|
||||
if (file_exists('lib/login.php')) {
|
||||
header('Location: lib/login.php?message=trialDonateThanks&csrf='.$_SESSION["csrf"]);
|
||||
echo "<script>window.location='lib/login.php?message=trialDonateThanks&csrf=".$_SESSION["csrf"]."';</script>";
|
||||
} else {
|
||||
header('Location: login.php?message=trialDonateThanks&csrf='.$_SESSION["csrf"]);
|
||||
echo "<script>window.location='login.php?message=trialDonateThanks&csrf=".$_SESSION["csrf"]."';</script>";
|
||||
}
|
||||
} else {
|
||||
if (file_exists('lib/login.php')) {
|
||||
header('Location: lib/login.php?get=code&success=no&csrf='.$_SESSION["csrf"]);
|
||||
echo "<script>window.location='lib/login.php?get=code&success=no&csrf=".$_SESSION["csrf"]."';</script>";
|
||||
} else {
|
||||
header('Location: login.php?get=code&success=no&csrf='.$_SESSION["csrf"]);
|
||||
echo "<script>window.location='login.php?get=code&success=no&csrf=".$_SESSION["csrf"]."';</script>";
|
||||
}
|
||||
}
|
||||
|
||||
// If we are on the login screen and not logged in
|
||||
} elseif (!$_SESSION['loggedIn']) {
|
||||
// If the password hasn't been set and we're setting it
|
||||
if ($ICEcoder["password"] == "" && isset($_POST['submit']) && (strpos($_POST['submit'],"set password")>-1)) {
|
||||
$password = generateHash(strClean($_POST['password']));
|
||||
$settingsContents = getData($settingsFile);
|
||||
$settingsContents = getData("../data/".$settingsFile);
|
||||
// Replace our empty password with the one submitted by user
|
||||
$settingsContents = str_replace('"password" => "",','"password" => "'.$password.'",',$settingsContents);
|
||||
// Also set the update checker preference
|
||||
@@ -242,7 +195,7 @@ if ((!$_SESSION['loggedIn'] || $ICEcoder["password"] == "") && !strpos($_SERVER[
|
||||
$settingsContents = str_replace('"checkUpdates" => true,','"checkUpdates" => '.$checkUpdates.',',$settingsContents);
|
||||
$settingsContents = str_replace('"checkUpdates" => false,','"checkUpdates" => '.$checkUpdates.',',$settingsContents);
|
||||
// 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("../data/".$settingsFile, 'w') or die("Can't update config file. Please set public write permissions on data/".$settingsFile." and press refresh");
|
||||
fwrite($fh, $settingsContents);
|
||||
fclose($fh);
|
||||
// Create a duplicate version for the IP address of the domain if it doesn't exist yet
|
||||
@@ -251,20 +204,20 @@ if ((!$_SESSION['loggedIn'] || $ICEcoder["password"] == "") && !strpos($_SERVER[
|
||||
$serverAddr = "127.0.0.1";
|
||||
}
|
||||
$settingsFileAddr = 'config-'.$username.str_replace(".","_",$serverAddr).'.php';
|
||||
if (!file_exists(dirname(__FILE__)."/".$settingsFileAddr)) {
|
||||
if (!copy(dirname(__FILE__)."/".$settingsFile, dirname(__FILE__)."/".$settingsFileAddr)) {
|
||||
die("Couldn't create $settingsFileAddr. Maybe you need write permissions on the lib folder?");
|
||||
if (!file_exists(dirname(__FILE__)."/../data/".$settingsFileAddr)) {
|
||||
if (!copy(dirname(__FILE__)."/../data/".$settingsFile, dirname(__FILE__)."/../data/".$settingsFileAddr)) {
|
||||
die("Couldn't create $settingsFileAddr. Maybe you need write permissions on the data folder?");
|
||||
}
|
||||
}
|
||||
// Disable the enableRegistration config setting if the user had that option chosen
|
||||
if (isset($_POST['disableFurtherRegistration'])) {
|
||||
$updatedConfigSettingsFile = getData(dirname(__FILE__)."/".$configSettings);
|
||||
if ($fUConfigSettings = fopen(dirname(__FILE__)."/".$configSettings, 'w')) {
|
||||
$updatedConfigSettingsFile = getData(dirname(__FILE__)."/../data/".$configSettings);
|
||||
if ($fUConfigSettings = fopen(dirname(__FILE__)."/../data/".$configSettings, 'w')) {
|
||||
$updatedConfigSettingsFile = str_replace('"enableRegistration" => true','"enableRegistration" => false',$updatedConfigSettingsFile);
|
||||
fwrite($fUConfigSettings, $updatedConfigSettingsFile);
|
||||
fclose($fUConfigSettings);
|
||||
} else {
|
||||
die("Cannot update config file lib/".$configSettings.". Please check write permissions on lib/ and try again");
|
||||
die("Cannot update config file data/".$configSettings.". Please check write permissions on data/ and try again");
|
||||
}
|
||||
}
|
||||
// Set the session user level
|
||||
@@ -290,4 +243,3 @@ if ((!$_SESSION['loggedIn'] || $ICEcoder["password"] == "") && !strpos($_SERVER[
|
||||
// Continue with whatever we're doing
|
||||
// ==================================
|
||||
}
|
||||
?>
|
||||
@@ -1,20 +1,19 @@
|
||||
<?php
|
||||
$newConfigSettingsFile = '<?php
|
||||
// ICEcoder system settings
|
||||
$ICEcoderSettings = array(
|
||||
"versionNo" => "6.0 beta",
|
||||
"codeMirrorDir" => "CodeMirror",
|
||||
"docRoot" => $_SERVER[\'DOCUMENT_ROOT\'], // Set absolute path of another location if needed
|
||||
"demoMode" => false,
|
||||
"devMode" => false,
|
||||
"fileDirResOutput" => "none", // Can be none, raw, object, both (all but \'none\' output to console)
|
||||
"loginRequired" => true,
|
||||
"multiUser" => false,
|
||||
"languageBase" => "english.php",
|
||||
"lineEnding" => "\n",
|
||||
"newDirPerms" => 755,
|
||||
"newFilePerms" => 644,
|
||||
"enableRegistration" => true
|
||||
);
|
||||
?>';
|
||||
?>
|
||||
<?php
|
||||
$newConfigSettingsFile = '<?php
|
||||
// ICEcoder system settings
|
||||
$ICEcoderSettings = array(
|
||||
"versionNo" => "7.0",
|
||||
"codeMirrorDir" => "CodeMirror",
|
||||
"docRoot" => $_SERVER[\'DOCUMENT_ROOT\'], // Set absolute path of another location if needed
|
||||
"demoMode" => false,
|
||||
"devMode" => false,
|
||||
"fileDirResOutput" => "none", // Can be none, raw, object, both (all but \'none\' output to console)
|
||||
"loginRequired" => true,
|
||||
"multiUser" => false,
|
||||
"languageBase" => "english.php",
|
||||
"lineEnding" => "\n",
|
||||
"newDirPerms" => 755,
|
||||
"newFilePerms" => 644,
|
||||
"enableRegistration" => true
|
||||
);
|
||||
?>';
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
$ICEcoderUserSettings = array(
|
||||
"versionNo" => "6.0 beta",
|
||||
"licenseEmail" => "",
|
||||
"licenseCode" => "",
|
||||
"versionNo" => "7.0",
|
||||
"licenseEmail" => "v7free@icecoder.net",
|
||||
"licenseCode" => "93be18fba1dee0e186031907422a0f8df3462568bfd0161e1504",
|
||||
"configCreateDate" => 0,
|
||||
"root" => "",
|
||||
"checkUpdates" => true,
|
||||
@@ -47,4 +47,3 @@ $ICEcoderUserSettings = array(
|
||||
"last10Files" => "",
|
||||
"favoritePaths" => array()
|
||||
);
|
||||
?>
|
||||
@@ -2,12 +2,23 @@
|
||||
include(dirname(__FILE__)."/headers.php");
|
||||
include(dirname(__FILE__)."/settings.php");
|
||||
|
||||
|
||||
function proc_open_enabled() {
|
||||
$disabled = explode(',', ini_get('disable_functions'));
|
||||
return !in_array('proc_open', $disabled);
|
||||
}
|
||||
|
||||
if(!proc_open_enabled()) {
|
||||
exit("<span style=\"color: #fff\">Sorry but you can't use this terminal if your proc_open is disabled</span>\n\n");
|
||||
}
|
||||
|
||||
$aliases = array(
|
||||
'la' => 'ls -la',
|
||||
'll' => 'ls -lvhF',
|
||||
);
|
||||
|
||||
// Get current working dir
|
||||
$user = str_replace("\n","",shell_exec("whoami"));
|
||||
$cwd = getcwd();
|
||||
|
||||
// If we have a command
|
||||
@@ -18,7 +29,17 @@ if(!empty($_REQUEST['command'])) {
|
||||
}
|
||||
|
||||
// Begin output with prompt and user command
|
||||
$output = "<span style=\"color: #fff\">".$cwd."\n$> ".$_REQUEST['command']."</span>\n\n";
|
||||
$output = '<div class="commandLine"><div class="user"> '.$user.' </div>'.
|
||||
'<div class="path"> '.$cwd.' </div> : '.date("H:m:s").
|
||||
'<br>'.
|
||||
'<div class="promptVLine"></div><div class="promptHLine">─<div class="promptArrow">▶</div></div> '.$_REQUEST['command'].'</div><br><br>';
|
||||
}
|
||||
|
||||
// If in demo mode, display message and go no further
|
||||
if ($demoMode) {
|
||||
$output .= "Sorry, shell usage not enabled in demo mode\n\n";
|
||||
echo $output;
|
||||
exit;
|
||||
}
|
||||
|
||||
// If command contains cd but no dir
|
||||
@@ -71,13 +92,13 @@ if (preg_match('/^[[:blank:]]*cd[[:blank:]]*$/', @$_REQUEST['command'])) {
|
||||
),
|
||||
$io
|
||||
);
|
||||
|
||||
|
||||
// Read output sent to stdout
|
||||
while (!feof($io[1])) {
|
||||
while (!feof($io[1])) { /// this will return always false ... and will loop forever until "fork: retry: no child processes" will show if proc_open is disabled;
|
||||
$output .= htmlspecialchars(fgets($io[1]),ENT_COMPAT, 'UTF-8');
|
||||
}
|
||||
// Read output sent to stderr
|
||||
while (!feof($io[2])) {
|
||||
while (!feof($io[2])) {
|
||||
$output .= htmlspecialchars(fgets($io[2]),ENT_COMPAT, 'UTF-8');
|
||||
}
|
||||
$output .= "\n";
|
||||
@@ -90,4 +111,4 @@ if (preg_match('/^[[:blank:]]*cd[[:blank:]]*$/', @$_REQUEST['command'])) {
|
||||
|
||||
// Finally, output our string
|
||||
echo $output;
|
||||
?>
|
||||
|
||||
|
||||
@@ -20,14 +20,18 @@ table, caption, tbody, tfoot, thead, tr, th, td {
|
||||
/* Box sizing */
|
||||
* {-moz-box-sizing: border-box; box-sizing: border-box}
|
||||
|
||||
::-webkit-scrollbar {width: 12px; height: 12px}
|
||||
::-webkit-scrollbar-thumb {background: rgba(0,198,255,0.1)}
|
||||
::-webkit-scrollbar {width: 12px; height: 12px; background: #666}
|
||||
::-webkit-scrollbar-thumb {background: rgba(0,198,255,1)}
|
||||
::-webkit-scrollbar-corner, ::-webkit-scrollbar-resizer {background: transparent}
|
||||
|
||||
html, body {width: 100%; height: 100%}
|
||||
|
||||
.close {position: fixed; top: 8px; right: 14px; padding: 5px 8px; border: solid 1px #888; color: #888; cursor: pointer; z-index: 1}
|
||||
.output {position: absolute; display: block; top: 0; padding: 15px 18px 38px 18px; width: 100%; min-height: 100%; border: 0; background: rgba(0,0,0,0.9); color: #0c0}
|
||||
.commandLine {position: fixed; width: 100%; bottom: 0; padding: 8px 2px 8px 10px; background: rgba(25,25,23,1); color: #fff; z-index: 1}
|
||||
.command {border: none; background: transparent; color: #fff}
|
||||
.command:focus {outline: none}
|
||||
.output {position: absolute; display: block; top: 0; padding: 15px 18px 8px 13px; width: 100%; min-height: 100%; border: 0; background: rgba(0,0,0,0.92); color: #ccc}
|
||||
.commandLine {width: 100%; padding: 8px 2px 8px 0; color: #fff}
|
||||
.commandLine .user {display: inline-block; height: 24px; margin-top: -4px; margin-left: -13px; padding: 5px 5px 5px 0; margin-bottom: 5px; background: #b58901; color: #000}
|
||||
.commandLine .path {display: inline-block; height: 24px; margin-top: -4px; padding: 5px 5px 5px 0; margin-bottom: 5px; background: #278bd2; color: #fff}
|
||||
.commandLine .promptVLine {display: inline-block; width: 1px; height: 12px; margin-top: -5px; margin-left: 3px; background: #b58901}
|
||||
.commandLine .promptHLine {display: inline-block; color: #b58901}
|
||||
.commandLine .promptArrow {display: inline-block; margin-left:-1px}
|
||||
.commandLine .command {border: none; background: transparent; color: #fff}
|
||||
.commandLine .command:focus {outline: none}
|
||||
|
||||
@@ -23,7 +23,7 @@ function startUpdate() {
|
||||
// Don't move backups, plugins or .git away
|
||||
$testPath = $source.DIRECTORY_SEPARATOR.$iterator->getSubPathName();
|
||||
$testPath = str_replace("\\","/",$testPath);
|
||||
if (strpos($testPath,"/backups/")==false && strpos($testPath,"/plugins/")==false && strpos($testPath,"/.git/")==false) {
|
||||
if (strpos($testPath,"/data/backups/")==false && strpos($testPath,"/plugins/")==false && strpos($testPath,"/.git/")==false) {
|
||||
if (!is_writeable($item)) {
|
||||
array_push($cantMoveArray,substr($item,count($source)+2));
|
||||
}
|
||||
@@ -55,19 +55,14 @@ function copyOldVersion() {
|
||||
}
|
||||
$source = "../";
|
||||
$dest = PATH;
|
||||
// Set a stream context timeout for file reading
|
||||
$context = stream_context_create(array('http'=>
|
||||
array(
|
||||
'timeout' => 60 // secs
|
||||
)
|
||||
));
|
||||
|
||||
echo 'Moving current ICEcoder files...<br>';
|
||||
foreach ($iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($source, RecursiveDirectoryIterator::SKIP_DOTS),RecursiveIteratorIterator::SELF_FIRST) as $item) {
|
||||
if (strpos($source.DIRECTORY_SEPARATOR.$iterator->getSubPathName(),"oldVersion")==false) {
|
||||
// Don't move backups, plugins or .git away
|
||||
$testPath = $source.DIRECTORY_SEPARATOR.$iterator->getSubPathName();
|
||||
$testPath = str_replace("\\","/",$testPath);
|
||||
if (strpos($testPath,"/backups/")==false && strpos($testPath,"/plugins/")==false && strpos($testPath,"/.git/")==false) {
|
||||
if (strpos($testPath,"/data/backups/")==false && strpos($testPath,"/plugins/")==false && strpos($testPath,"/.git/")==false) {
|
||||
if ($item->isDir()) {
|
||||
mkdir($dest.DIRECTORY_SEPARATOR.$iterator->getSubPathName(), 0755);
|
||||
} else {
|
||||
@@ -84,8 +79,6 @@ function copyOldVersion() {
|
||||
}
|
||||
|
||||
function openZipNew($icvInfo) {
|
||||
global $context;
|
||||
|
||||
echo 'Retrieving zip from ICEcoder site...<br>';
|
||||
$source = 'ICEcoder v'.$icvInfo;
|
||||
$target = '../';
|
||||
@@ -129,8 +122,6 @@ function openZipNew($icvInfo) {
|
||||
}
|
||||
|
||||
function transposeSettings($oldFile,$newFile,$saveFile) {
|
||||
global $context;
|
||||
|
||||
echo '- Getting old and new settings...<br>';
|
||||
// Get old and new settings and start a new $contents
|
||||
$oldSettingsContent = getData($oldFile);
|
||||
@@ -176,29 +167,29 @@ function copyOverSettings($icvInfo) {
|
||||
echo 'Transposing system settings...<br>';
|
||||
// Create a new config file if it doesn't exist yet.
|
||||
// The reason we create it, is so it has PHP write permissions, meaning we can update it later
|
||||
if (!file_exists(dirname(__FILE__)."/".$configSettings)) {
|
||||
if (!file_exists(dirname(__FILE__)."/../data/".$configSettings)) {
|
||||
echo 'Creating new settings file...<br>';
|
||||
// Include our params to make use of (as $newConfigSettingsFile)
|
||||
include(dirname(__FILE__)."/settings-system-params.php");
|
||||
if ($fConfigSettings = fopen(dirname(__FILE__)."/".$configSettings, 'w')) {
|
||||
if ($fConfigSettings = fopen(dirname(__FILE__)."/../data/".$configSettings, 'w')) {
|
||||
fwrite($fConfigSettings, $newConfigSettingsFile);
|
||||
fclose($fConfigSettings);
|
||||
} else {
|
||||
die("Cannot update config file lib/".$configSettings.". Please check write permissions on lib/ and try again");
|
||||
die("Cannot update config file data/".$configSettings.". Please check write permissions on data/ and try again");
|
||||
}
|
||||
}
|
||||
transposeSettings(PATH."lib/config___settings.php","config___settings.php","config___settings.php");
|
||||
transposeSettings(PATH."data/template-system.php","config-settings.php","config-settings.php");
|
||||
|
||||
// Users template settings
|
||||
echo 'Transposing users template settings...<br>';
|
||||
transposeSettings(PATH."lib/config___users-template.php","config___users-template.php","config___users-template.php");
|
||||
transposeSettings(PATH."data/template-users.php","template-users.php","template-users.php");
|
||||
|
||||
// Users settings files
|
||||
$fileList = scanDir(PATH."lib/");
|
||||
$fileList = scanDir(PATH."data/");
|
||||
for ($i=0; $i<count($fileList); $i++) {
|
||||
if (strpos($fileList[$i],"config-") > -1) {
|
||||
echo 'Transposing users settings file '.$fileList[$i].'...<br>';
|
||||
transposeSettings(PATH."lib/".$fileList[$i],"config___users-template.php",$fileList[$i]);
|
||||
transposeSettings(PATH."data/".$fileList[$i],"template-users.php",$fileList[$i]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -213,7 +204,7 @@ if ($updateDone) {
|
||||
echo '<script>alert("'.$t['Update appears to...'].'");window.location = "../?display=updated&csrf='.$_SESSION["csrf"].'";</script>';
|
||||
} else {
|
||||
echo 'Something appears to have gone wrong :-/<br><br>';
|
||||
echo 'Please report bugs at <a href=\"https://github.com/mattpass/ICEcoder\" style=\"color: #fff\">https://github.com/mattpass/ICEcoder</a><br><br>';
|
||||
echo 'Please report bugs at <a href=\"https://github.com/ICEcoder/ICEcoder\" style=\"color: #fff\">https://github.com/ICEcoder/ICEcoder</a><br><br>';
|
||||
echo 'You can recover the old version from ICEcoder\'s tmp dir';
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
<?php
|
||||
header("Location: ../");
|
||||
die();
|
||||
?>
|
||||
@@ -8,4 +8,3 @@ if (!isset($_SESSION['loggedIn'])) {
|
||||
// $fh = fopen(dirname(__FILE__)."/../bug-logs.log", 'a');
|
||||
// fwrite($fh, "Bug check on: ".date("D dS M Y h:i:sa")."\nresult: ".$result.", status array:".var_export($status, true)."\n");
|
||||
// fclose($fh);
|
||||
?>
|
||||
@@ -10,7 +10,7 @@ Langs: Anything - PHP, JS etc
|
||||
<script>
|
||||
CodeMirror.commands.autocomplete = function(cm) {
|
||||
var langType = top.ICEcoder.caretLocType;
|
||||
if (["JavaScript","CoffeeScript","SQL","CSS","HTML","XML","Content"].indexOf(langType)>-1) {
|
||||
if (["JavaScript","CoffeeScript","TypeScript","SQL","CSS","HTML","XML","Content"].indexOf(langType)>-1) {
|
||||
if (langType=="XML"||langType=="Content") {langType="HTML"};
|
||||
CodeMirror.showHint(cm,CodeMirror.hint[langType.toLowerCase()]);
|
||||
}
|
||||
@@ -46,11 +46,12 @@ top.ICEcoder.lineCommentToggleSub = function(cM, cursorPos, linePos, lineContent
|
||||
var comments, startLine, endLine, commentCH, commentBS, commentBE;
|
||||
|
||||
// Language specific commenting
|
||||
if (["JavaScript","CoffeeScript","PHP","Python","Ruby","CSS","SQL","Erlang","Julia","Java","YAML","C","C++","C#","Go","Lua","Perl","Sass"].indexOf(top.ICEcoder.caretLocType)>-1) {
|
||||
if (["JavaScript","CoffeeScript","TypeScript","PHP","Python","Ruby","CSS","SQL","Erlang","Julia","Java","YAML","C","C++","C#","Go","Lua","Perl","Sass"].indexOf(top.ICEcoder.caretLocType)>-1) {
|
||||
|
||||
comments = {
|
||||
"JavaScript" : ["// ", "/* ", " */"],
|
||||
"CoffeeScript" : ["// ", "/* ", " */"],
|
||||
"CoffeeScript" : ["# ", "### ", " ###"],
|
||||
"TypeScript" : ["// ", "/* ", " */"],
|
||||
"PHP" : ["// ", "/* ", " */"],
|
||||
"Python" : ["# ", "/* ", " */"],
|
||||
"Ruby" : ["# ", "/* ", " */"],
|
||||
@@ -93,7 +94,7 @@ top.ICEcoder.lineCommentToggleSub = function(cM, cursorPos, linePos, lineContent
|
||||
}
|
||||
// Single line commenting
|
||||
} else {
|
||||
if (["CoffeeScript","CSS","SQL"].indexOf(top.ICEcoder.caretLocType)>-1) {
|
||||
if (["CSS","SQL"].indexOf(top.ICEcoder.caretLocType)>-1) {
|
||||
cM.replaceRange(lineContent.slice(0,commentBS.length)!=commentBS
|
||||
? commentBS + lineContent + commentBE
|
||||
: lineContent.slice(commentBS.length,lCLen-commentBE.length), {line: linePos, ch: 0}, {line: linePos, ch: 1000000});
|
||||
@@ -137,7 +138,7 @@ top.ICEcoder.updateNestingIndicator = function() {
|
||||
fileExt = fileName.split(".");
|
||||
fileExt = fileExt[fileExt.length-1];
|
||||
}
|
||||
if (thisCM && fileName && ["js","coffee","css","less","sql","erl","yaml","java","jl","c","cpp","ino","cs","go","lua","pl","scss"].indexOf(fileExt)==-1) {
|
||||
if (thisCM && fileName && ["js","coffee","ts","css","less","sql","erl","yaml","java","jl","c","cpp","ino","cs","go","lua","pl","scss"].indexOf(fileExt)==-1) {
|
||||
testToken = thisCM.getTokenAt({line:thisCM.lineCount(),ch:thisCM.lineInfo(thisCM.lineCount()-1).text.length});
|
||||
nestOK = testToken.type && testToken.type.indexOf("error") == -1 ? true : false;
|
||||
}
|
||||
@@ -169,6 +170,7 @@ top.ICEcoder.caretLocationType = function() {
|
||||
caretLocType =
|
||||
fileExt == "js" ? "JavaScript"
|
||||
: fileExt == "coffee" ? "CoffeeScript"
|
||||
: fileExt == "ts" ? "TypeScript"
|
||||
: fileExt == "py" ? "Python"
|
||||
: fileExt == "rb" ? "Ruby"
|
||||
: fileExt == "css" ? "CSS"
|
||||
|
||||
@@ -3,9 +3,11 @@ if (!isset($_SESSION['loggedIn'])) {
|
||||
die('Sorry, not logged in.');
|
||||
}
|
||||
// Purpose: This file is run when a file or dir is deleted, has $fileLoc and $fileName strings available to it
|
||||
// Langs: PHP only
|
||||
// Langs: PHP (tho can concat JS within $doNext string, see below)
|
||||
// Example:
|
||||
// $fh = fopen(dirname(__FILE__)."/../file-dir-access.log", 'a');
|
||||
// fwrite($fh, "DELETED >>> ".date("D dS M Y h:i:sa").": ".$fileLoc."/".$fileName."\n");
|
||||
// fclose($fh);
|
||||
?>
|
||||
|
||||
// If JS is needed, add within $doNext string below, eg $doNext .= ";alert('deleted');";
|
||||
$doNext .= "";
|
||||
|
||||
@@ -3,9 +3,11 @@ if (!isset($_SESSION['loggedIn'])) {
|
||||
die('Sorry, not logged in.');
|
||||
}
|
||||
// Purpose: This file is run when a file or dir is moved, has $fileLoc and $fileName strings available to it
|
||||
// Langs: PHP only
|
||||
// Langs: PHP (tho can concat JS within $doNext string, see below)
|
||||
// Example:
|
||||
// $fh = fopen(dirname(__FILE__)."/../file-dir-access.log", 'a');
|
||||
// fwrite($fh, "MOVED >>> ".date("D dS M Y h:i:sa").": ".$fileLoc."/".$fileName."\n");
|
||||
// fclose($fh);
|
||||
?>
|
||||
|
||||
// If JS is needed, add within $doNext string below, eg $doNext .= ";alert('moved');";
|
||||
$doNext .= "";
|
||||
|
||||
@@ -3,9 +3,11 @@ if (!isset($_SESSION['loggedIn'])) {
|
||||
die('Sorry, not logged in.');
|
||||
}
|
||||
// Purpose: This file is run when a file or dir is pasted, has $fileLoc, $fileName and $dest strings available to it
|
||||
// Langs: PHP only
|
||||
// Langs: PHP (tho can concat JS within $doNext string, see below)
|
||||
// Example:
|
||||
// $fh = fopen(dirname(__FILE__)."/../file-dir-access.log", 'a');
|
||||
// fwrite($fh, "PASTE >>> ".date("D dS M Y h:i:sa").": ".$dest."\n");
|
||||
// fclose($fh);
|
||||
?>
|
||||
|
||||
// If JS is needed, add within $doNext string below, eg $doNext .= ";alert('pasted');";
|
||||
$doNext .= "";
|
||||
|
||||
@@ -3,9 +3,11 @@ if (!isset($_SESSION['loggedIn'])) {
|
||||
die('Sorry, not logged in.');
|
||||
}
|
||||
// Purpose: This file is run when a file or dir has its perms changed, has $fileLoc, $fileName and $_GET['perms'] strings available to it
|
||||
// Langs: PHP only
|
||||
// Langs: PHP (tho can concat JS within $doNext string, see below)
|
||||
// Example:
|
||||
// $fh = fopen(dirname(__FILE__)."/../file-dir-access.log", 'a');
|
||||
// fwrite($fh, "PERMS >>> ".date("D dS M Y h:i:sa").": ".$fileLoc."/".$fileName." = ".$_GET['perms']."\n");
|
||||
// fclose($fh);
|
||||
?>
|
||||
|
||||
// If JS is needed, add within $doNext string below, eg $doNext .= ";alert('perms changed');";
|
||||
$doNext .= "";
|
||||
|
||||
@@ -3,9 +3,11 @@ if (!isset($_SESSION['loggedIn'])) {
|
||||
die('Sorry, not logged in.');
|
||||
}
|
||||
// Purpose: This file is run when a file or dir is renamed, has $fileLoc and $fileName strings available to it
|
||||
// Langs: PHP only
|
||||
// Langs: PHP (tho can concat JS within $doNext string, see below)
|
||||
// Example:
|
||||
// $fh = fopen(dirname(__FILE__)."/../file-dir-access.log", 'a');
|
||||
// fwrite($fh, "RENAMED >>> ".date("D dS M Y h:i:sa").": ".$fileLoc."/".$fileName."\n");
|
||||
// fclose($fh);
|
||||
?>
|
||||
|
||||
// If JS is needed, add within $doNext string below, eg $doNext .= ";alert('renamed');";
|
||||
$doNext .= "";
|
||||
|
||||
@@ -3,9 +3,11 @@ if (!isset($_SESSION['loggedIn'])) {
|
||||
die('Sorry, not logged in.');
|
||||
}
|
||||
// Purpose: This file is run when a file is loaded, has $fileLoc and $fileName strings available to it
|
||||
// Langs: PHP only
|
||||
// Langs: PHP (tho can output JS via PHP echo, see below)
|
||||
// Example:
|
||||
// $fh = fopen(dirname(__FILE__)."/../file-dir-access.log", 'a');
|
||||
// fwrite($fh, "LOAD >>> ".date("D dS M Y h:i:sa").": ".$fileLoc."/".$fileName."\n");
|
||||
// fclose($fh);
|
||||
?>
|
||||
|
||||
// If JS is needed, echo within string below, eg echo "alert('loaded');";
|
||||
echo "";
|
||||
|
||||
@@ -3,9 +3,11 @@ if (!isset($_SESSION['loggedIn'])) {
|
||||
die('Sorry, not logged in.');
|
||||
}
|
||||
// Purpose: This file is run when a file has text in it replaced, has $_GET['fileRef'] string available to it
|
||||
// Langs: PHP only
|
||||
// Langs: PHP (tho can concat JS within $doNext string, see below)
|
||||
// Example:
|
||||
// $fh = fopen(dirname(__FILE__)."/../file-dir-access.log", 'a');
|
||||
// fwrite($fh, "REPLACED TEXT >>> ".date("D dS M Y h:i:sa").": ".$_GET['fileRef']."\n");
|
||||
// fclose($fh);
|
||||
?>
|
||||
|
||||
// If JS is needed, add within $doNext string below, eg $doNext .= ";alert('renamed');";
|
||||
$doNext .= "";
|
||||
|
||||
@@ -3,7 +3,7 @@ if (!isset($_SESSION['loggedIn'])) {
|
||||
die('Sorry, not logged in.');
|
||||
}
|
||||
// Purpose: This file is run when a user saves a file, has $fileLoc and $fileName strings available to it
|
||||
// Langs: PHP only
|
||||
// Langs: PHP (tho can concat JS within $doNext string, see below)
|
||||
// Example:
|
||||
// $fh = fopen(dirname(__FILE__)."/../file-dir-access.log", 'a');
|
||||
// fwrite($fh, "SAVE >>> ".date("D dS M Y h:i:sa").": ".$fileLoc."/".$fileName."\n");
|
||||
@@ -51,4 +51,6 @@ if (strtolower($fileExt) == "less" && file_exists(dirname(__FILE__)."/../plugins
|
||||
echo ";top.ICEcoder.message('Couldn\'t compile your LESS, error info below:\\n\\n".$e->getMessage()."');";
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
// If JS is needed, add within $doNext string below, eg $doNext .= ";alert('saved');";
|
||||
$doNext .= "";
|
||||
|
||||
@@ -3,9 +3,11 @@ if (!isset($_SESSION['loggedIn'])) {
|
||||
die('Sorry, not logged in.');
|
||||
}
|
||||
// Purpose: This file is run when files are uploaded, has $uploads array available to it
|
||||
// Langs: PHP only
|
||||
// Langs: PHP (tho can concat JS within $doNext string, see below)
|
||||
// Example:
|
||||
// $fh = fopen(dirname(__FILE__)."/../file-dir-access.log", 'a');
|
||||
// fwrite($fh, "UPLOAD >>> ".date("D dS M Y h:i:sa").": ".($uploads[0]->name)."\n");
|
||||
// fclose($fh);
|
||||
?>
|
||||
|
||||
// If JS is needed, add within $doNext string below, eg $doNext .= ";alert('uploaded');";
|
||||
$doNext .= "";
|
||||
|
||||
@@ -3,9 +3,11 @@ if (!isset($_SESSION['loggedIn'])) {
|
||||
die('Sorry, not logged in.');
|
||||
}
|
||||
// Purpose: This file is run when a remote file is loaded, has $file string available to it
|
||||
// Langs: PHP only
|
||||
// Langs: PHP (tho can concat JS within $doNext string, see below)
|
||||
// Example:
|
||||
// $fh = fopen(dirname(__FILE__)."/../file-dir-access.log", 'a');
|
||||
// fwrite($fh, "GET REMOTE FILE >>> ".date("D dS M Y h:i:sa").": ".$file."\n");
|
||||
// fclose($fh);
|
||||
?>
|
||||
|
||||
// If JS is needed, add within $doNext string below, eg $doNext .= ";alert('got remote file');";
|
||||
$doNext .= "";
|
||||
|
||||
@@ -3,9 +3,11 @@ if (!isset($_SESSION['loggedIn'])) {
|
||||
die('Sorry, not logged in.');
|
||||
}
|
||||
// Purpose: This file is run when a dir is created, has $fileLoc and $fileName strings available to it
|
||||
// Langs: PHP only
|
||||
// Langs: PHP (tho can concat JS within $doNext string, see below)
|
||||
// Example:
|
||||
// $fh = fopen(dirname(__FILE__)."/../file-dir-access.log", 'a');
|
||||
// fwrite($fh, "NEW DIR >>> ".date("D dS M Y h:i:sa").": ".$fileLoc."/".$fileName."\n");
|
||||
// fclose($fh);
|
||||
?>
|
||||
|
||||
// If JS is needed, add within $doNext string below, eg $doNext .= ";alert('new dir');";
|
||||
$doNext .= "";
|
||||
|
||||
@@ -3,9 +3,11 @@ if (!isset($_SESSION['loggedIn'])) {
|
||||
die('Sorry, not logged in.');
|
||||
}
|
||||
// Purpose: This file is run when a login fail occurs
|
||||
// Langs: PHP only
|
||||
// Langs: PHP (tho can concat JS within $doNext string, see below)
|
||||
// Example:
|
||||
// $fh = fopen(dirname(__FILE__)."/../user-access.log", 'a');
|
||||
// fwrite($fh, "FAIL ".date("D dS M Y h:i:sa").": ".$_POST['username']."\n");
|
||||
// fclose($fh);
|
||||
?>
|
||||
|
||||
// If JS is needed, add within $doNext string below, eg $doNext .= ";alert('user login failed');";
|
||||
$doNext .= "";
|
||||
|
||||
@@ -3,9 +3,11 @@ if (!isset($_SESSION['loggedIn'])) {
|
||||
die('Sorry, not logged in.');
|
||||
}
|
||||
// Purpose: This file is run when a user logs in
|
||||
// Langs: PHP only
|
||||
// Langs: PHP (tho can concat JS within $doNext string, see below)
|
||||
// Example:
|
||||
// $fh = fopen(dirname(__FILE__)."/../user-access.log", 'a');
|
||||
// fwrite($fh, "login ".date("D dS M Y h:i:sa").": ".$_SESSION['username']."\n");
|
||||
// fclose($fh);
|
||||
?>
|
||||
|
||||
// If JS is needed, add within $doNext string below, eg $doNext .= ";alert('logged in');";
|
||||
$doNext .= "";
|
||||
|
||||
@@ -3,9 +3,11 @@ if (!isset($_SESSION['loggedIn'])) {
|
||||
die('Sorry, not logged in.');
|
||||
}
|
||||
// Purpose: This file is run when a user logs out
|
||||
// Langs: PHP only
|
||||
// Langs: PHP (tho can concat JS within $doNext string, see below)
|
||||
// Example:
|
||||
// $fh = fopen(dirname(__FILE__)."/../user-access.log", 'a');
|
||||
// fwrite($fh, "logout ".date("D dS M Y h:i:sa").": ".$_SESSION['username']."\n");
|
||||
// fclose($fh);
|
||||
?>
|
||||
|
||||
// If JS is needed, add within $doNext string below, eg $doNext .= ";alert('logout');";
|
||||
$doNext .= "";
|
||||
|
||||
@@ -3,9 +3,11 @@ if (!isset($_SESSION['loggedIn'])) {
|
||||
die('Sorry, not logged in.');
|
||||
}
|
||||
// Purpose: This file is run when a new user sets up
|
||||
// Langs: PHP only
|
||||
// Langs: PHP (tho can concat JS within $doNext string, see below)
|
||||
// Example:
|
||||
// $fh = fopen(dirname(__FILE__)."/../user-access.log", 'a');
|
||||
// fwrite($fh, "NEW >>> ".date("D dS M Y h:i:sa").": ".$_SESSION['username']."\n");
|
||||
// fclose($fh);
|
||||
?>
|
||||
|
||||
// If JS is needed, add within $doNext string below, eg $doNext .= ";alert('new user');";
|
||||
$doNext .= "";
|
||||
|
||||
22
terminal.php
@@ -59,8 +59,11 @@ sendCmd = function(command) {
|
||||
// OK reponse?
|
||||
if (xhr.status==200) {
|
||||
// Set the output to also include our response and scroll down to bottom
|
||||
document.getElementById('output').innerHTML += xhr.responseText;
|
||||
document.body.scrollTop = document.body.scrollHeight;
|
||||
var newOutput = document.createElement("DIV");
|
||||
newOutput.innerHTML = xhr.responseText;
|
||||
var cmdElem = document.getElementById("commandLine");
|
||||
cmdElem.parentNode.insertBefore(newOutput, cmdElem);
|
||||
top.document.getElementById("terminal").contentWindow.document.documentElement.scrollTop = document.getElementById('output').scrollHeight;
|
||||
|
||||
// Add command onto end of history array or set as last item in array
|
||||
if (currentLine == 0 || commandHistory[commandHistory.length-1].indexOf("[[ICEcoder]]:") !== 0) {
|
||||
@@ -86,22 +89,17 @@ sendCmd = function(command) {
|
||||
<body>
|
||||
<?php
|
||||
$user = str_replace("\n","",shell_exec("whoami"));
|
||||
$cwd = $ICEcoder['docRoot'].$ICEcoder['root'];
|
||||
$cwd = getcwd();
|
||||
?>
|
||||
<span class="close" onclick="top.get('terminal').style.display = 'none'">Close X</span>
|
||||
|
||||
<form name="shell" onsubmit="sendCmd(document.getElementById('command').value); return false" method="POST">
|
||||
<pre class="output" id="output">ICEcoder v <?php echo $ICEcoder["versionNo"];?> terminal
|
||||
<pre class="output" id="output"><span style="color: #0a0">ICEcoder v<?php echo $ICEcoder["versionNo"];?> terminal</span>
|
||||
This is a full powered terminal, but will have the permissions of the '<?php echo $user;?>' user.
|
||||
The more access rights you give that user, the more this terminal has.
|
||||
|
||||
Current dir:
|
||||
<?php echo $cwd;?>
|
||||
|
||||
|
||||
</pre>
|
||||
<div class="commandLine">$> <input type="text" class="command" id="command" onkeyup="key(event)" tabindex="1" autocomplete="off"></div>
|
||||
<div class="commandLine" id="commandLine"><div class="user"> <?php echo $user;?> </div><div class="path"> <?php echo $cwd;?> </div>
|
||||
<div class="promptVLine"></div><div class="promptHLine">─<div class="promptArrow">▶</div></div> <input type="text" class="command" id="command" onkeyup="key(event)" tabindex="1" autocomplete="off"></div></pre>
|
||||
</form>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
||||
4
test.php
@@ -18,7 +18,7 @@ echo "<b>Test date, time & microtime:</b><br>".date("jS M Y g:i:sa")." (".microt
|
||||
$success = 0;
|
||||
|
||||
|
||||
echo '<b>TEST 1 of 3: PHP Version:</b><br>ICEcoder needs at least PHP 5.0, tho 5.3 and above is recommended:<br><br>';
|
||||
echo '<b>TEST 1 of 3: PHP Version:</b><br>ICEcoder needs at least PHP 5.0, though 5.3 and above is recommended:<br><br>';
|
||||
echo "Your PHP Version: ".phpversion()."<br><br>";
|
||||
|
||||
echo '<b>TEST RESULT:</b> ';
|
||||
@@ -64,7 +64,7 @@ echo '<b>TEST 3 of 3: Includes:</b><br>Attempt to include settings file:<br><br>
|
||||
$configSettings = 'config___settings.php';
|
||||
|
||||
// Load config settings
|
||||
include(dirname(__FILE__)."/lib/".$configSettings);
|
||||
include(dirname(__FILE__)."/data/".$configSettings);
|
||||
|
||||
echo "This version of ICEcoder is: ".$ICEcoderSettings['versionNo']."<br><br>";
|
||||
echo '<b>TEST RESULT:</b> ';
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
<?php
|
||||
header("Location: ../");
|
||||
die();
|
||||
?>
|
||||