5
5
?>
6
6
<!DOCTYPE html>
7
7
8
- <html style="margin: 0" onmousedown="parent.ICEcoder.mouseDown = true; parent.ICEcoder.resetAutoLogoutTimer()" onMouseUp ="parent.ICEcoder.mouseDown = false; parent.ICEcoder.mouseDownInCM = false; parent.ICEcoder.resetAutoLogoutTimer(); if (!parent.ICEcoder.overCloseLink) {parent.ICEcoder.tabDragEnd()}" onmousemove="if(parent.ICEcoder) {parent.ICEcoder.getMouseXY(event, 'editor'); parent.ICEcoder.functionArgsTooltip(event, 'editor'); parent.ICEcoder.resetAutoLogoutTimer(); parent.ICEcoder.canResizeFilesW()}" ondrop="if(parent.ICEcoder) {parent.ICEcoder.getMouseXY(event, 'editor')}">
8
+ <html style="margin: 0" onmousedown="parent.ICEcoder.mouseDown = true; parent.ICEcoder.resetAutoLogoutTimer()" onmouseup ="parent.ICEcoder.mouseDown = false; parent.ICEcoder.mouseDownInCM = false; parent.ICEcoder.resetAutoLogoutTimer(); if (!parent.ICEcoder.overCloseLink) {parent.ICEcoder.tabDragEnd()}" onmousemove="if (parent.ICEcoder) {parent.ICEcoder.getMouseXY(event, 'editor'); parent.ICEcoder.functionArgsTooltip(event, 'editor'); parent.ICEcoder.resetAutoLogoutTimer(); parent.ICEcoder.canResizeFilesW()}" ondrop="if (parent.ICEcoder) {parent.ICEcoder.getMouseXY(event, 'editor')}">
9
9
<head>
10
- <title>ICEcoder v <?php echo $ ICEcoder ["versionNo " ];?> editor</title>
10
+ <title>ICEcoder v<?php echo $ ICEcoder ["versionNo " ];?> editor</title>
11
11
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
12
12
<meta name="robots" content="noindex, nofollow">
13
13
<link rel="stylesheet" href="assets/css/codemirror.css?microtime=<?php echo microtime (true );?> ">
14
14
<link rel="stylesheet" href="assets/css/show-hint.css?microtime=<?php echo microtime (true );?> ">
15
15
<link rel="stylesheet" href="assets/css/lint.css?microtime=<?php echo microtime (true );?> ">
16
16
<!--
17
17
codemirror-compressed.js
18
- incls: codemirror
19
- modes: clike, coffeescript, css, erlang, go, htmlmixed, javascript, julia, lua, markdown, perl, php, python, ruby, sass, sql, xml, yaml
20
- addon: brace-fold, closebrackets, closetag, css-hint, foldcode, foldgutter, html-hint, javascript-hint, javascript-lint, lint, match-highlighter, matchbrackets, runmode, searchcursor, show-hint, simplescrollbars, sql-hint, trailingspace, xml-fold, xml-hint
18
+ - incls: codemirror
19
+ - modes: clike, coffeescript, css, erlang, go, htmlmixed, javascript, julia, lua, markdown, perl, php, python, ruby, sass, sql, xml, yaml
20
+ - addon: brace-fold, closebrackets, closetag, css-hint, foldcode, foldgutter, html-hint, javascript-hint, javascript-lint, lint, match-highlighter, matchbrackets, runmode, searchcursor, show-hint, simplescrollbars, sql-hint, trailingspace, xml-fold, xml-hint
21
21
//-->
22
22
<script src="assets/js/codemirror-compressed.js?microtime=<?php echo microtime (true );?> "></script>
23
23
<?php
24
- if ( true === file_exists ( dirname ( __FILE__ ). " /plugins/jshint/jshint-2.5.6.min.js " )) {
25
- echo ' <script src="http://github.com/plugins/%3C/span%3Ejshint/jshint-2.5.6.min.js%3Cspan%20class="x x-first">?microtime= ' . microtime ( true ) . ' "></script> ' ;
26
- };
27
-
28
- if ( true === file_exists ( dirname ( __FILE__ ). " /plugins/emmet/emmet .min.js ")) {
29
- echo ' <script src="http://github.com/plugins/emmet/emmet.min.js?microtime=%3C/span%3E%3Cspan%20class="x">' . microtime ( true ) . ' "></script> ' ;
30
- } ;
24
+ $ pluginFiles = [
25
+ " jshint/jshint-2.5.6.min.js " ,
26
+ " emmet/emmet.min.js " ,
27
+ " pesticide/pesticide.js " ,
28
+ " stats.js/stats .min.js ",
29
+ " responsive-helper/responsive-helper.js "
30
+ ] ;
31
31
32
- if (true === file_exists (dirname (__FILE__ )."/plugins/pesticide/pesticide.js " )) {
33
- echo '<script src="plugins/pesticide/pesticide.js?microtime= ' . microtime (true ) . '"></script> ' ;
34
- };
35
-
36
- if (true === file_exists (dirname (__FILE__ )."/plugins/stats.js/stats.min.js " )) {
37
- echo '<script src="plugins/stats.js/stats.min.js?microtime= ' . microtime (true ) . '"></script> ' ;
38
- };
39
-
40
- if (true === file_exists (dirname (__FILE__ )."/plugins/responsive-helper/responsive-helper.js " )) {
41
- echo '<script src="plugins/responsive-helper/responsive-helper.js?microtime= ' . microtime (true ) . '"></script> ' ;
42
- };?>
32
+ for ($ i = 0 ; $ i < count ($ pluginFiles ); $ i ++) {
33
+ if (true === file_exists (dirname (__FILE__ ) . "/plugins/ " . $ pluginFiles [$ i ])) {
34
+ echo '<script src="plugins/ ' . $ pluginFiles [$ i ] . '?microtime= ' . microtime (true ) . '"></script> ' . PHP_EOL ;
35
+ }
36
+ }
37
+ ?>
43
38
<link rel="stylesheet" href="<?php
44
39
echo dirname (basename (__DIR__ )) . '/assets/css/theme/ ' ;
45
40
echo "default " === $ ICEcoder ["theme " ] ? 'icecoder.css ' : $ ICEcoder ["theme " ] . '.css ' ;
73
68
background-position: bottom left;
74
69
background-repeat: repeat-x;
75
70
}
76
- .code-zoomed-out { font-size: 2px }
77
- .CodeMirror-foldmarker {font-family: arial; line-height: .3; color: #b00; cursor: pointer;
71
+ .code-zoomed-out {font-size: 2px}
72
+ .CodeMirror-foldmarker {font-family: arial; line-height: 0 .3; color: #b00; cursor: pointer;
78
73
text-shadow: #fff 1px 1px 2px, #fff -1px -1px 2px, #fff 1px -1px 2px, #fff -1px 1px 2px;
79
74
}
80
75
.CodeMirror-foldgutter {display: inline-block; width: 13px}
84
79
.CodeMirror-foldgutter-folded {background: #800; color: #ddd}
85
80
.CodeMirror-foldgutter-folded:after {position: relative; top: -3px}
86
81
h2 {color: rgba(0,198,255,0.7)}
87
- .heading {color:#888}
82
+ .heading {color: #888}
88
83
.cm-s-diff {left: 50%}
89
84
.diffGreen {background: #0b0 !important; color: #000 !important}
90
85
.diffRed {background: #800 !important; color: #fff !important}
91
86
.diffGrey {background: #444 !important; color: #fff !important}
92
87
.diffGreyLighter {background: #888 !important; color: #1d1d1b !important}
93
88
.diffNone {}
94
89
.info {font-size: 10px; color: rgba(0,198,255,0.7); cursor: help}
90
+ .dataItems {float: left; line-height: 14px}
91
+ .dataItems span {line-height: 21px}
95
92
</style>
96
93
<link rel="stylesheet" href="assets/css/file-types.css?microtime=<?php echo microtime (true );?> ">
97
94
<link rel="stylesheet" href="assets/css/file-type-icons.css?microtime=<?php echo microtime (true );?> ">
102
99
<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>
103
100
104
101
<div style="margin: 20px 43px 32px 43px; font-family: arial; font-size: 10px; color: #ddd">
105
- <div style="float: left; width: 300px; margin-right: 50px">
102
+ <div class="dataItems" style=" width: 300px; margin-right: 50px">
106
103
<h2><?php echo $ t ['server ' ];?> </h2>
107
104
<span class="heading"><?php echo $ t ['Server name, OS... ' ];?> </span><br>
108
105
<?php
109
106
$ serverAddr = $ _SERVER ['SERVER_ADDR ' ] ?? "1 " ;
110
- if ($ serverAddr == "1 " || $ serverAddr == "::1 " ) {
107
+ if ("1 " == $ serverAddr || "::1 " == $ serverAddr ) {
111
108
$ serverAddr = "127.0.0.1 " ;
112
109
}
113
110
echo
125
122
<span id="serverDT"></span><br><br>
126
123
<h2><?php echo $ t ['your device ' ];?> </h2>
127
124
<span class="heading"><?php echo $ t ['Browser ' ];?> </span><br>
128
- <?php echo xssClean ($ _SERVER ['HTTP_USER_AGENT ' ],"html " );?> <br><br>
125
+ <?php echo xssClean ($ _SERVER ['HTTP_USER_AGENT ' ], "html " );?> <br><br>
129
126
<span class="heading"><?php echo $ t ['Your IP ' ];?> </span><br>
130
127
<?php echo getUserIP ();?> <br><br>
131
128
</div>
132
129
133
- <div style="float: left ">
130
+ <div class="dataItems ">
134
131
<h2><?php echo $ t ['files ' ];?> </h2>
135
132
<span class="heading"><?php echo $ t ['Last 10 files... ' ];?> </span><br>
136
- <ul class="fileManager" id="last10Files" style="margin-left: 0; line-height: 20px "><?php
133
+ <ul class="fileManager" id="last10Files" style="margin-top: 5px; margin- left: 0; line-height: 21px "><?php
137
134
if (empty ($ ICEcoder ["last10Files " ])) {
138
135
echo '<div style="display: inline-block; margin-left: -39px; margin-top: -4px"> ' . $ t ['none ' ] . '</div><br> ' ;
139
136
} else {
142
139
// Get extension (prefix 'ext-' to prevent invalid classes from extensions that begin with numbers)
143
140
$ ext = "ext- " . pathinfo ($ docRoot . $ iceRoot . $ fileFolderName , PATHINFO_EXTENSION );
144
141
echo '<li class="pft-file ' . strtolower ($ ext ) . '" style="margin-left: -21px"> ' ;
145
- echo '<a style="cursor:pointer" onClick ="parent.ICEcoder.openFile( \'' . str_replace ($ docRoot , "" , str_replace ("| " , "/ " , $ ICEcoder ["last10Files " ][$ i ])) . '\')"> ' ;
146
- echo str_replace ($ docRoot , "" , str_replace ("| " , "/ " , $ ICEcoder ["last10Files " ][$ i ]));
142
+ echo '<a style="position: relative; top: -2px; left: 5px; cursor: pointer" onclick ="parent.ICEcoder.openFile( \'' . str_replace ($ docRoot , "" , str_replace ("| " , "/ " , $ ICEcoder ["last10Files " ][$ i ])) . '\')"> ' ;
143
+ echo preg_replace ( " /^\// " , "" , str_replace ($ docRoot , "" , str_replace ("| " , "/ " , $ ICEcoder ["last10Files " ][$ i ]) ));
147
144
echo '</a></li> ' ;
148
145
if ($ i > 0 ) {
149
146
echo PHP_EOL ;
164
161
165
162
<div style="clear: both"></div>
166
163
<script>
167
- var nDT = <?php echo time () * 1000 ;?> ;
164
+ let nDT = <?php echo time () * 1000 ;?> ;
168
165
setInterval(function(){
169
- var s = (new Date(nDT += 1e3) + '').split(' '),
166
+ let s = (new Date(nDT += 1e3) + '').split(' '),
170
167
d = s[2] * 1,
171
168
t = s[4].split(':'),
172
169
p = t[0] > 11 ? 'pm' : 'am',
184
181
"Tab": function(cm) {
185
182
return cm.somethingSelected()
186
183
? (parent.ICEcoder.indentAuto
187
- ? cm.execCommand("indentAuto") // Honour our own setting indentAuto
184
+ ? cm.execCommand("indentAuto") // Honor our own setting indentAuto
188
185
: cm.indentSelection("add") // Add indent (this is default handler in CodeMirror)
189
186
)
190
187
: CodeMirror.Pass // Falls through to default or Emmet plugin
199
196
};
200
197
201
198
// CodeMirror does not honor indentWithTabs = false properly when handling Tab key
202
- // Marijn said that it is by design, so we need to make a workaround of our own
199
+ // It does this by design, so we need to make a workaround of our own
203
200
(function(){
204
201
// let's back up original insertTab function which actually puts
205
202
var originalInsertTabFunction = CodeMirror.commands.insertTab;
@@ -244,8 +241,8 @@ function createNewCMInstance(num) {
244
241
};
245
242
246
243
// Start editor instances, main and diff
247
- window['cM'+ num] = CodeMirror(document.body, cMOptions);
248
- window['cM'+ num+ 'diff'] = CodeMirror(document.body, cMOptions);
244
+ window['cM' + num] = CodeMirror(document.body, cMOptions);
245
+ window['cM' + num + 'diff'] = CodeMirror(document.body, cMOptions);
249
246
250
247
// Define actions for those...
251
248
createNewCMInstanceEvents(num, '');
@@ -257,29 +254,27 @@ function createNewCMInstance(num) {
257
254
};
258
255
259
256
function createNewCMInstanceEvents(num, pane) {
260
- window['cM'+ num+ pane].on("focus", function(thisCM) {parent.ICEcoder.cMonFocus(thisCM, 'cM' + num + pane)});
261
- window['cM'+ num+ pane].on("blur", function(thisCM) {parent.ICEcoder.cMonBlur(thisCM, 'cM' + num + pane)});
262
- window['cM'+ num+ pane].on("keyup", function(thisCM) {parent.ICEcoder.cMonKeyUp(thisCM, 'cM' + num + pane)});
263
- window['cM'+ num+ pane].on("cursorActivity", function(thisCM) {parent.ICEcoder.cMonCursorActivity(thisCM, 'cM' + num + pane)});
264
- window['cM'+ num+ pane].on("beforeSelectionChange", function(thisCM, changeObj) {parent.ICEcoder.prevLine = thisCM.getCursor().line;});
265
- window['cM'+ num+ pane].on("change", function(thisCM, changeObj) {parent.ICEcoder.cMonChange(thisCM, 'cM' + num + pane, changeObj, CodeMirror)});
266
- window['cM'+ num+ pane].on("beforeChange", function(thisCM, changeObj) {parent.ICEcoder.cMonBeforeChange(thisCM, 'cM' + num + pane, changeObj, CodeMirror)});
267
- window['cM'+ num+ pane].on("scroll", function(thisCM) {parent.ICEcoder.cMonScroll(thisCM, 'cM' + num + pane)});
268
- window['cM'+ num+ pane].on("update", function(thisCM) {parent.ICEcoder.cMonUpdate(thisCM, 'cM' + num + pane)});
269
- window['cM'+ num+ pane].on("inputRead", function(thisCM) {parent.ICEcoder.cMonInputRead(thisCM, 'cM' + num + pane)});
270
- window['cM'+ num+ pane].on("gutterClick", function(thisCM,line,gutter,evt) {parent.ICEcoder.cMonGutterClick(thisCM, line, gutter, evt, 'cM' + num + pane)});
271
- window['cM'+ num+ pane].on("mousedown", function(thisCM,evt) {parent.ICEcoder.cMonMouseDown(thisCM, 'cM' + num + pane, evt)});
272
- window['cM'+ num+ pane].on("paste", function(thisCM,evt) {parent.ICEcoder.cMonPaste(thisCM, 'cM' + num + pane, evt, (evt.clipboardData || window.clipboardData))});
273
- window['cM'+ num+ pane].on("contextmenu", function(thisCM,evt) {parent.ICEcoder.cMonContextMenu(thisCM, 'cM' + num + pane, evt)});
274
- window['cM'+ num+ pane].on("dragover", function(thisCM) {parent.ICEcoder.cMonDragOver(thisCM, event, 'cM' + num + pane)});
275
- window['cM'+ num+ pane].on("renderLine", function(thisCM, line, element) {parent.ICEcoder.cMonRenderLine(thisCM, 'cM' + num + pane, line, element)});
257
+ window['cM' + num + pane].on("focus", function(thisCM) {parent.ICEcoder.cMonFocus(thisCM, 'cM' + num + pane)});
258
+ window['cM' + num + pane].on("blur", function(thisCM) {parent.ICEcoder.cMonBlur(thisCM, 'cM' + num + pane)});
259
+ window['cM' + num + pane].on("keyup", function(thisCM) {parent.ICEcoder.cMonKeyUp(thisCM, 'cM' + num + pane)});
260
+ window['cM' + num + pane].on("cursorActivity", function(thisCM) {parent.ICEcoder.cMonCursorActivity(thisCM, 'cM' + num + pane)});
261
+ window['cM' + num + pane].on("beforeSelectionChange", function(thisCM, changeObj) {parent.ICEcoder.prevLine = thisCM.getCursor().line;});
262
+ window['cM' + num + pane].on("change", function(thisCM, changeObj) {parent.ICEcoder.cMonChange(thisCM, 'cM' + num + pane, changeObj, CodeMirror)});
263
+ window['cM' + num + pane].on("beforeChange", function(thisCM, changeObj) {parent.ICEcoder.cMonBeforeChange(thisCM, 'cM' + num + pane, changeObj, CodeMirror)});
264
+ window['cM' + num + pane].on("scroll", function(thisCM) {parent.ICEcoder.cMonScroll(thisCM, 'cM' + num + pane)});
265
+ window['cM' + num + pane].on("update", function(thisCM) {parent.ICEcoder.cMonUpdate(thisCM, 'cM' + num + pane)});
266
+ window['cM' + num + pane].on("inputRead", function(thisCM) {parent.ICEcoder.cMonInputRead(thisCM, 'cM' + num + pane)});
267
+ window['cM' + num + pane].on("gutterClick", function(thisCM, line, gutter, evt) {parent.ICEcoder.cMonGutterClick(thisCM, line, gutter, evt, 'cM' + num + pane)});
268
+ window['cM' + num + pane].on("mousedown", function(thisCM, evt) {parent.ICEcoder.cMonMouseDown(thisCM, 'cM' + num + pane, evt)});
269
+ window['cM' + num + pane].on("paste", function(thisCM, evt) {parent.ICEcoder.cMonPaste(thisCM, 'cM' + num + pane, evt, (evt.clipboardData || window.clipboardData))});
270
+ window['cM' + num + pane].on("contextmenu", function(thisCM, evt) {parent.ICEcoder.cMonContextMenu(thisCM, 'cM' + num + pane, evt)});
271
+ window['cM' + num + pane].on("dragover", function(thisCM) {parent.ICEcoder.cMonDragOver(thisCM, event, 'cM' + num + pane)});
272
+ window['cM' + num + pane].on("renderLine", function(thisCM, line, element) {parent.ICEcoder.cMonRenderLine(thisCM, 'cM' + num + pane, line, element)});
276
273
}
277
274
</script>
278
275
279
276
<div style="position: absolute; display: none; width: 12px; height: 100%; top: 0; right: 0; overflow: hidden; pointer-events: none; z-index: 2" id="resultsBar"></div>
280
277
281
- <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>
282
-
283
278
<script>
284
279
CodeMirror.commands.autocomplete = function(cM) {
285
280
let langType = parent.ICEcoder.caretLocType;
0 commit comments