Compare commits

..

19 Commits

Author SHA1 Message Date
Matt Pass
d3df8621b8 Version 6.0 2017-09-28 23:30:28 +01:00
Matt Pass
00680d0869 v6 is free! 2017-09-28 21:46:06 +01:00
Matt Pass
153aa1f0d5 Typo fix 2017-09-28 21:39:21 +01:00
Matt Pass
e4570d4530 Remove old console.log 2017-09-28 21:23:35 +01:00
Matt Pass
a5432a6854 Merge pull request #706 from aharris88/patch-1
Fix markdown in readme
2017-06-09 18:58:52 +02:00
Adam Harris
46dee99bba Fix markdown in readme 2017-06-09 10:50:11 -06:00
Matt Pass
d703d9b31f Merge branch 'master' of https://github.com/mattpass/ICEcoder 2017-05-13 16:20:18 +01:00
Matt Pass
e0101a3837 TypeScript added, CoffeeScript commenting fixed 2017-05-13 16:20:01 +01:00
Matt Pass
faa6950727 TypeScript icon added 2017-05-13 16:18:53 +01:00
Matt Pass
c6dc329ab6 Merge pull request #696 from Dj-jom2x/master
check if proc open is enabled .. ( dos vulnerability )
2017-04-20 23:50:34 +04:00
Dj-jom2x
1b19a77978 check if proc open is enabled ..
we need to check proc_open if disabled .. because line 93 expect something to return ... and it will lead you to self dos infinite while loop.. and your server will going down .. and the message you will receive is "fork: retry: no child processes" , if you try to login on ssh using your cpanel account :)
2017-04-18 08:28:27 +08:00
Matt Pass
a9732eea7e Merge pull request #690 from Servius/master
New Themes from CodeMirror
2017-03-21 09:22:53 +00:00
Servius
63bde7b9da New Themes from CodeMirror 2017-03-15 15:06:50 -07:00
Matt Pass
85e441390c Minified version to match full 2017-03-10 13:29:11 +00:00
Matt Pass
c1cd34951c Tweaks to way game starts and resets 2017-03-10 13:28:59 +00:00
Matt Pass
b38fee4bd0 ggE retsaE 2017-02-28 10:27:02 +00:00
Matt Pass
4bf04b1c08 Improved code to handle LR throughout 2017-02-21 18:34:07 +00:00
Matt Pass
0f971b547e Strip \r and replace \n ith CR for browser pickup 2017-02-21 16:49:27 +00:00
Matt Pass
3292439a61 Disable terminal usage in demo mode 2017-02-09 12:15:08 +00:00
23 changed files with 540 additions and 157 deletions

5
CodeMirror/theme/ambiance-mobile.css vendored Normal file
View File

@@ -0,0 +1,5 @@
.cm-s-ambiance.CodeMirror {
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
}

View File

@@ -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
View 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
View 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; }

View File

@@ -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; }

View File

@@ -7,7 +7,7 @@
*/
.cm-s-material {
.cm-s-material.CodeMirror {
background-color: #263238;
color: rgba(233, 237, 237, 1);
}

View File

@@ -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
View 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;
}

View File

@@ -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); }

View File

@@ -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);
}

View File

@@ -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-v6-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!

View File

@@ -316,6 +316,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>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 15 KiB

BIN
images/snake.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -1,50 +1,50 @@
<?php
$ICEcoderUserSettings = array(
"versionNo" => "6.0 beta",
"licenseEmail" => "",
"licenseCode" => "",
"configCreateDate" => 0,
"root" => "",
"checkUpdates" => true,
"openLastFiles" => true,
"updateDiffOnSave" => true,
"languageUser" => "english.php",
"backupsKept" => true,
"backupsDays" => 14,
"deleteToTmp" => true,
"findFilesExclude" => array(".doc",".gif",".jpg",".jpeg",".pdf",".png",".swf",".xml",".zip"),
"codeAssist" => true,
"visibleTabs" => false,
"lockedNav" => true,
"tagWrapperCommand" => "ctrl+alt",
"autoComplete" => "keypress",
"password" => "",
"bannedFiles" => array(),
"bannedPaths" => array("/var/www/.git","/var/www/sites/all/modules","/var/www/sites/default/files"),
"allowedIPs" => array("*"),
"autoLogoutMins" => 0,
"theme" => "default",
"fontSize" => "13px",
"lineWrapping" => false,
"lineNumbers" => true,
"showTrailingSpace" => true,
"matchBrackets" => true,
"autoCloseTags" => true,
"autoCloseBrackets" => true,
"indentWithTabs" => false,
"indentAuto" => true,
"indentSize" => 4,
"pluginPanelAligned" => "left",
"bugFilePaths" => array(),
"bugFileCheckTimer" => 0,
"bugFileMaxLines" => 0,
"githubAuthToken" => "",
"plugins" => array(),
"ftpSites" => array(),
"githubLocalPaths" => array(),
"githubRemotePaths" => array(),
"previousFiles" => "",
"last10Files" => "",
"favoritePaths" => array()
);
?>
<?php
$ICEcoderUserSettings = array(
"versionNo" => "6.0",
"licenseEmail" => "v6free@icecoder.net",
"licenseCode" => "93be18fba1dee0e186031907422a0f8df3462568bfd0161e1504",
"configCreateDate" => 0,
"root" => "",
"checkUpdates" => true,
"openLastFiles" => true,
"updateDiffOnSave" => true,
"languageUser" => "english.php",
"backupsKept" => true,
"backupsDays" => 14,
"deleteToTmp" => true,
"findFilesExclude" => array(".doc",".gif",".jpg",".jpeg",".pdf",".png",".swf",".xml",".zip"),
"codeAssist" => true,
"visibleTabs" => false,
"lockedNav" => true,
"tagWrapperCommand" => "ctrl+alt",
"autoComplete" => "keypress",
"password" => "",
"bannedFiles" => array(),
"bannedPaths" => array("/var/www/.git","/var/www/sites/all/modules","/var/www/sites/default/files"),
"allowedIPs" => array("*"),
"autoLogoutMins" => 0,
"theme" => "default",
"fontSize" => "13px",
"lineWrapping" => false,
"lineNumbers" => true,
"showTrailingSpace" => true,
"matchBrackets" => true,
"autoCloseTags" => true,
"autoCloseBrackets" => true,
"indentWithTabs" => false,
"indentAuto" => true,
"indentSize" => 4,
"pluginPanelAligned" => "left",
"bugFilePaths" => array(),
"bugFileCheckTimer" => 0,
"bugFileMaxLines" => 0,
"githubAuthToken" => "",
"plugins" => array(),
"ftpSites" => array(),
"githubLocalPaths" => array(),
"githubRemotePaths" => array(),
"previousFiles" => "",
"last10Files" => "",
"favoritePaths" => array()
);
?>

View File

@@ -108,9 +108,15 @@ if ($_GET['action']=="load") {
$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/','&#13;',$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) {

View File

@@ -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}

View File

@@ -4054,6 +4054,44 @@ 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;
@@ -4351,5 +4389,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;
}
}
};

33
lib/ice-coder.min.js vendored
View File

@@ -22,7 +22,7 @@ for(var g=0;g<b.length;g++)e=d.findMatchingTag(a,b[g].anchor),0!==c.text[0].inde
{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=
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])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,
@@ -181,15 +181,22 @@ c==top.ICEcoder.draggingTab?1:.5,b=top.ICEcoder.tabLeftPos[c]?top.ICEcoder.tabLe
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)),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();top.ICEcoder.last5Keys||
(top.ICEcoder.last5Keys=[]);top.ICEcoder.last5Keys.push(c);6==top.ICEcoder.last5Keys.length&&top.ICEcoder.last5Keys.shift();"83,78,65,75,69"==top.ICEcoder.last5Keys.join()&&setTimeout(function(){d=ICEcoder.getcMInstance();for(var a=0,b=d.changeGeneration();d.changeGeneration()>b-5;)d.undo(),a++;if(top.ICEcoder.savedPoints[top.ICEcoder.selectedTab-1]==d.changeGeneration())top.ICEcoder.startSnake();else for(b=1;b<=a;b++)d.redo()},0);if(top.ICEcoder.snakePlaying)return 37==c&&(top.ICEcoder.snakeDir=
"left"),39==c&&(top.ICEcoder.snakeDir="right"),38==c&&(top.ICEcoder.snakeDir="up"),40==c&&(top.ICEcoder.snakeDir="down"),!1;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(),e=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?e:d,e.getCursor(),!1):27==c&&"content"==a?(d=ICEcoder.getcMInstance(),e=ICEcoder.getcMdiffInstance(),e=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?
e:d,1<e.getSelections().length?e.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();e=-1<top.ICEcoder.editorFocusInstance.indexOf("diff")?e:d;e=e.getSelections();0<e.length&&0<e[0].length&&(f.value=e[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)}},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;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,b,c,d,e,f,g;a=ICEcoder.getcMInstance();b=a.defaultCharWidth();c=a.defaultTextHeight();
d=top.ICEcoder.content.contentWindow.document.getElementById("game").innerHTML="";for(g=0;g<top.ICEcoder.snakePos.length;g++)d+='<div style="position: absolute; diplay: inline-block; width: '+b+"px; height: "+c+"px; top: "+(top.ICEcoder.snakePos[g][1]*c+4)+"px; left: "+(top.ICEcoder.snakePos[g][0]*b+60)+'px; background: #fff"></div>';top.ICEcoder.content.contentWindow.document.getElementById("game").innerHTML=d;d=a.coordsChar({top:top.ICEcoder.snakePos[0][1]*c+4,left:top.ICEcoder.snakePos[0][0]*b+
60});e=a.getLine(d.line);if(top.ICEcoder.snakePos[0][0]-1<=e.length-2){f="";if("\t"===e.substr(d.ch,1))for(g=0;g<a.getOption("tabSize");g++)f+=" ";else f=" ";top.ICEcoder.snakePos.push([top.ICEcoder.snakePos[top.ICEcoder.snakePos.length-1][0],top.ICEcoder.snakePos[top.ICEcoder.snakePos.length-1][1]]);a.doc.replaceRange(top.ICEcoder.snakePos[0][0]-1==e.length-2?"":f,d,{line:d.line,ch:d.ch+1});top.ICEcoder.snakePos[0][0]-1==e.length-2&&a.doc.replaceRange(a.getLine(d.line).replace(/[ \t]+$/,""),{line:d.line,
ch:0},{line:d.line,ch:1E6})}else 5<=top.ICEcoder.snakePos.length&&top.ICEcoder.snakePos.pop();d=!1;for(g=1;g<top.ICEcoder.snakePos.length;g++)top.ICEcoder.snakePos[g][0]==top.ICEcoder.snakePos[0][0]&&top.ICEcoder.snakePos[g][1]==top.ICEcoder.snakePos[0][1]&&(d=!0);g=a.getScrollInfo();if(0>top.ICEcoder.snakePos[0][0]||0>top.ICEcoder.snakePos[0][1]||top.ICEcoder.snakePos[0][0]*b+60>g.clientWidth||top.ICEcoder.snakePos[0][1]*c+4>g.clientHeight||d)clearInterval(top.ICEcoder.snakeInt),top.ICEcoder.content.contentWindow.document.getElementById("game").style.display=
"none",a.setValue(top.ICEcoder.snakePreContent),top.ICEcoder.savedPoints[top.ICEcoder.selectedTab-1]=a.changeGeneration(),top.ICEcoder.savedContents[top.ICEcoder.selectedTab-1]=top.ICEcoder.snakePreContent,a.setHistory(top.ICEcoder.snakePreHistory),top.ICEcoder.indicateChanges(),top.ICEcoder.redoTabHighlight(top.ICEcoder.selectedTab),a.setOption("readOnly",!1),a.setCursor(top.ICEcoder.snakePreCursor),a.focus(),top.ICEcoder.snakePlaying=!1}};

View File

@@ -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"

View File

@@ -1,20 +1,20 @@
<?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" => "6.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
);
?>';
?>

View File

@@ -2,6 +2,16 @@
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',
@@ -21,6 +31,13 @@ if(!empty($_REQUEST['command'])) {
$output = "<span style=\"color: #fff\">".$cwd."\n$&gt; ".$_REQUEST['command']."</span>\n\n";
}
// 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
if (preg_match('/^[[:blank:]]*cd[[:blank:]]*$/', @$_REQUEST['command'])) {
$_SESSION['cwd'] = getcwd(); //dirname(__FILE__);
@@ -71,13 +88,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 +107,4 @@ if (preg_match('/^[[:blank:]]*cd[[:blank:]]*$/', @$_REQUEST['command'])) {
// Finally, output our string
echo $output;
?>
?>

View File

@@ -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"