Tidy, no space after v, less PHP, nicer system display, remove old game DIV container

This commit is contained in:
mattpass
2020-10-06 14:12:51 +01:00
parent 352c8c1a3a
commit ca39d31f0e

View File

@@ -5,9 +5,9 @@ $t = $text['editor'];
?>
<!DOCTYPE html>
<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')}">
<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')}">
<head>
<title>ICEcoder v <?php echo $ICEcoder["versionNo"];?> editor</title>
<title>ICEcoder v<?php echo $ICEcoder["versionNo"];?> editor</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="robots" content="noindex, nofollow">
<link rel="stylesheet" href="assets/css/codemirror.css?microtime=<?php echo microtime(true);?>">
@@ -15,31 +15,26 @@ $t = $text['editor'];
<link rel="stylesheet" href="assets/css/lint.css?microtime=<?php echo microtime(true);?>">
<!--
codemirror-compressed.js
incls: codemirror
modes: clike, coffeescript, css, erlang, go, htmlmixed, javascript, julia, lua, markdown, perl, php, python, ruby, sass, sql, xml, yaml
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
- incls: codemirror
- modes: clike, coffeescript, css, erlang, go, htmlmixed, javascript, julia, lua, markdown, perl, php, python, ruby, sass, sql, xml, yaml
- 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
//-->
<script src="assets/js/codemirror-compressed.js?microtime=<?php echo microtime(true);?>"></script>
<?php
if (true === file_exists(dirname(__FILE__)."/plugins/jshint/jshint-2.5.6.min.js")) {
echo '<script src="plugins/jshint/jshint-2.5.6.min.js?microtime=' . microtime(true) . '"></script>';
};
$pluginFiles = [
"jshint/jshint-2.5.6.min.js",
"emmet/emmet.min.js",
"pesticide/pesticide.js",
"stats.js/stats.min.js",
"responsive-helper/responsive-helper.js"
];
if (true === file_exists(dirname(__FILE__)."/plugins/emmet/emmet.min.js")) {
echo '<script src="plugins/emmet/emmet.min.js?microtime=' . microtime(true) . '"></script>';
};
if (true === file_exists(dirname(__FILE__)."/plugins/pesticide/pesticide.js")) {
echo '<script src="plugins/pesticide/pesticide.js?microtime=' . microtime(true) . '"></script>';
};
if (true === file_exists(dirname(__FILE__)."/plugins/stats.js/stats.min.js")) {
echo '<script src="plugins/stats.js/stats.min.js?microtime=' . microtime(true) . '"></script>';
};
if (true === file_exists(dirname(__FILE__)."/plugins/responsive-helper/responsive-helper.js")) {
echo '<script src="plugins/responsive-helper/responsive-helper.js?microtime=' . microtime(true) . '"></script>';
};?>
for ($i = 0; $i < count($pluginFiles); $i++) {
if (true === file_exists(dirname(__FILE__) . "/plugins/" . $pluginFiles[$i])) {
echo '<script src="plugins/' . $pluginFiles[$i] . '?microtime=' . microtime(true) . '"></script>' . PHP_EOL;
}
}
?>
<link rel="stylesheet" href="<?php
echo dirname(basename(__DIR__)) . '/assets/css/theme/';
echo "default" === $ICEcoder["theme"] ? 'icecoder.css' : $ICEcoder["theme"] . '.css';
@@ -73,8 +68,8 @@ if (false !== array_search($ICEcoder["theme"], ["base16-light", "chrome-devtools
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;
.code-zoomed-out {font-size: 2px}
.CodeMirror-foldmarker {font-family: arial; line-height: 0.3; color: #b00; cursor: pointer;
text-shadow: #fff 1px 1px 2px, #fff -1px -1px 2px, #fff 1px -1px 2px, #fff -1px 1px 2px;
}
.CodeMirror-foldgutter {display: inline-block; width: 13px}
@@ -84,7 +79,7 @@ if (false !== array_search($ICEcoder["theme"], ["base16-light", "chrome-devtools
.CodeMirror-foldgutter-folded {background: #800; color: #ddd}
.CodeMirror-foldgutter-folded:after {position: relative; top: -3px}
h2 {color: rgba(0,198,255,0.7)}
.heading {color:#888}
.heading {color: #888}
.cm-s-diff {left: 50%}
.diffGreen {background: #0b0 !important; color: #000 !important}
.diffRed {background: #800 !important; color: #fff !important}
@@ -92,6 +87,8 @@ 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}
.dataItems {float: left; line-height: 14px}
.dataItems span {line-height: 21px}
</style>
<link rel="stylesheet" href="assets/css/file-types.css?microtime=<?php echo microtime(true);?>">
<link rel="stylesheet" href="assets/css/file-type-icons.css?microtime=<?php echo microtime(true);?>">
@@ -102,12 +99,12 @@ h2 {color: rgba(0,198,255,0.7)}
<div style="display: none; margin: 32px 43px 0 43px; padding: 10px; width: 500px; font-family: arial; font-size: 10px; color: #ddd; background: #333" id="dataMessage"></div>
<div style="margin: 20px 43px 32px 43px; font-family: arial; font-size: 10px; color: #ddd">
<div style="float: left; width: 300px; margin-right: 50px">
<div class="dataItems" style="width: 300px; margin-right: 50px">
<h2><?php echo $t['server'];?></h2>
<span class="heading"><?php echo $t['Server name, OS...'];?></span><br>
<?php
$serverAddr = $_SERVER['SERVER_ADDR'] ?? "1";
if ($serverAddr == "1" || $serverAddr == "::1") {
if ("1" == $serverAddr || "::1" == $serverAddr) {
$serverAddr = "127.0.0.1";
}
echo
@@ -125,15 +122,15 @@ h2 {color: rgba(0,198,255,0.7)}
<span id="serverDT"></span><br><br>
<h2><?php echo $t['your device'];?></h2>
<span class="heading"><?php echo $t['Browser'];?></span><br>
<?php echo xssClean($_SERVER['HTTP_USER_AGENT'],"html");?><br><br>
<?php echo xssClean($_SERVER['HTTP_USER_AGENT'], "html");?><br><br>
<span class="heading"><?php echo $t['Your IP'];?></span><br>
<?php echo getUserIP();?><br><br>
</div>
<div style="float: left">
<div class="dataItems">
<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
<ul class="fileManager" id="last10Files" style="margin-top: 5px; margin-left: 0; line-height: 21px"><?php
if (empty($ICEcoder["last10Files"])) {
echo '<div style="display: inline-block; margin-left: -39px; margin-top: -4px">' . $t['none'] . '</div><br>';
} else {
@@ -142,8 +139,8 @@ h2 {color: rgba(0,198,255,0.7)}
// Get extension (prefix 'ext-' to prevent invalid classes from extensions that begin with numbers)
$ext = "ext-" . pathinfo($docRoot . $iceRoot . $fileFolderName, PATHINFO_EXTENSION);
echo '<li class="pft-file ' . strtolower($ext) . '" style="margin-left: -21px">';
echo '<a style="cursor:pointer" onClick="parent.ICEcoder.openFile(\'' . str_replace($docRoot, "", str_replace("|", "/", $ICEcoder["last10Files"][$i])) . '\')">';
echo str_replace($docRoot, "", str_replace("|", "/", $ICEcoder["last10Files"][$i]));
echo '<a style="position: relative; top: -2px; left: 5px; cursor: pointer" onclick="parent.ICEcoder.openFile(\'' . str_replace($docRoot, "", str_replace("|", "/", $ICEcoder["last10Files"][$i])) . '\')">';
echo preg_replace("/^\//", "", str_replace($docRoot, "", str_replace("|", "/", $ICEcoder["last10Files"][$i])));
echo '</a></li>';
if ($i > 0) {
echo PHP_EOL;
@@ -164,9 +161,9 @@ h2 {color: rgba(0,198,255,0.7)}
<div style="clear: both"></div>
<script>
var nDT = <?php echo time() * 1000;?>;
let nDT = <?php echo time() * 1000;?>;
setInterval(function(){
var s = (new Date(nDT += 1e3) + '').split(' '),
let s = (new Date(nDT += 1e3) + '').split(' '),
d = s[2] * 1,
t = s[4].split(':'),
p = t[0] > 11 ? 'pm' : 'am',
@@ -184,7 +181,7 @@ CodeMirror.keyMap.ICEcoder = {
"Tab": function(cm) {
return cm.somethingSelected()
? (parent.ICEcoder.indentAuto
? cm.execCommand("indentAuto") // Honour our own setting indentAuto
? cm.execCommand("indentAuto") // Honor our own setting indentAuto
: cm.indentSelection("add") // Add indent (this is default handler in CodeMirror)
)
: CodeMirror.Pass // Falls through to default or Emmet plugin
@@ -199,7 +196,7 @@ CodeMirror.keyMap.ICEcoder = {
};
// CodeMirror does not honor indentWithTabs = false properly when handling Tab key
// Marijn said that it is by design, so we need to make a workaround of our own
// It does this by design, so we need to make a workaround of our own
(function(){
// let's back up original insertTab function which actually puts
var originalInsertTabFunction = CodeMirror.commands.insertTab;
@@ -244,8 +241,8 @@ function createNewCMInstance(num) {
};
// Start editor instances, main and diff
window['cM'+num] = CodeMirror(document.body, cMOptions);
window['cM'+num+'diff'] = CodeMirror(document.body, cMOptions);
window['cM' + num] = CodeMirror(document.body, cMOptions);
window['cM' + num + 'diff'] = CodeMirror(document.body, cMOptions);
// Define actions for those...
createNewCMInstanceEvents(num, '');
@@ -257,29 +254,27 @@ function createNewCMInstance(num) {
};
function createNewCMInstanceEvents(num, pane) {
window['cM'+num+pane].on("focus", function(thisCM) {parent.ICEcoder.cMonFocus(thisCM, 'cM' + num + pane)});
window['cM'+num+pane].on("blur", function(thisCM) {parent.ICEcoder.cMonBlur(thisCM, 'cM' + num + pane)});
window['cM'+num+pane].on("keyup", function(thisCM) {parent.ICEcoder.cMonKeyUp(thisCM, 'cM' + num + pane)});
window['cM'+num+pane].on("cursorActivity", function(thisCM) {parent.ICEcoder.cMonCursorActivity(thisCM, 'cM' + num + pane)});
window['cM'+num+pane].on("beforeSelectionChange", function(thisCM, changeObj) {parent.ICEcoder.prevLine = thisCM.getCursor().line;});
window['cM'+num+pane].on("change", function(thisCM, changeObj) {parent.ICEcoder.cMonChange(thisCM, 'cM' + num + pane, changeObj, CodeMirror)});
window['cM'+num+pane].on("beforeChange", function(thisCM, changeObj) {parent.ICEcoder.cMonBeforeChange(thisCM, 'cM' + num + pane, changeObj, CodeMirror)});
window['cM'+num+pane].on("scroll", function(thisCM) {parent.ICEcoder.cMonScroll(thisCM, 'cM' + num + pane)});
window['cM'+num+pane].on("update", function(thisCM) {parent.ICEcoder.cMonUpdate(thisCM, 'cM' + num + pane)});
window['cM'+num+pane].on("inputRead", function(thisCM) {parent.ICEcoder.cMonInputRead(thisCM, 'cM' + num + pane)});
window['cM'+num+pane].on("gutterClick", function(thisCM,line,gutter,evt) {parent.ICEcoder.cMonGutterClick(thisCM, line, gutter, evt, 'cM' + num + pane)});
window['cM'+num+pane].on("mousedown", function(thisCM,evt) {parent.ICEcoder.cMonMouseDown(thisCM, 'cM' + num + pane, evt)});
window['cM'+num+pane].on("paste", function(thisCM,evt) {parent.ICEcoder.cMonPaste(thisCM, 'cM' + num + pane, evt, (evt.clipboardData || window.clipboardData))});
window['cM'+num+pane].on("contextmenu", function(thisCM,evt) {parent.ICEcoder.cMonContextMenu(thisCM, 'cM' + num + pane, evt)});
window['cM'+num+pane].on("dragover", function(thisCM) {parent.ICEcoder.cMonDragOver(thisCM, event, 'cM' + num + pane)});
window['cM'+num+pane].on("renderLine", function(thisCM, line, element) {parent.ICEcoder.cMonRenderLine(thisCM, 'cM' + num + pane, line, element)});
window['cM' + num + pane].on("focus", function(thisCM) {parent.ICEcoder.cMonFocus(thisCM, 'cM' + num + pane)});
window['cM' + num + pane].on("blur", function(thisCM) {parent.ICEcoder.cMonBlur(thisCM, 'cM' + num + pane)});
window['cM' + num + pane].on("keyup", function(thisCM) {parent.ICEcoder.cMonKeyUp(thisCM, 'cM' + num + pane)});
window['cM' + num + pane].on("cursorActivity", function(thisCM) {parent.ICEcoder.cMonCursorActivity(thisCM, 'cM' + num + pane)});
window['cM' + num + pane].on("beforeSelectionChange", function(thisCM, changeObj) {parent.ICEcoder.prevLine = thisCM.getCursor().line;});
window['cM' + num + pane].on("change", function(thisCM, changeObj) {parent.ICEcoder.cMonChange(thisCM, 'cM' + num + pane, changeObj, CodeMirror)});
window['cM' + num + pane].on("beforeChange", function(thisCM, changeObj) {parent.ICEcoder.cMonBeforeChange(thisCM, 'cM' + num + pane, changeObj, CodeMirror)});
window['cM' + num + pane].on("scroll", function(thisCM) {parent.ICEcoder.cMonScroll(thisCM, 'cM' + num + pane)});
window['cM' + num + pane].on("update", function(thisCM) {parent.ICEcoder.cMonUpdate(thisCM, 'cM' + num + pane)});
window['cM' + num + pane].on("inputRead", function(thisCM) {parent.ICEcoder.cMonInputRead(thisCM, 'cM' + num + pane)});
window['cM' + num + pane].on("gutterClick", function(thisCM, line, gutter, evt) {parent.ICEcoder.cMonGutterClick(thisCM, line, gutter, evt, 'cM' + num + pane)});
window['cM' + num + pane].on("mousedown", function(thisCM, evt) {parent.ICEcoder.cMonMouseDown(thisCM, 'cM' + num + pane, evt)});
window['cM' + num + pane].on("paste", function(thisCM, evt) {parent.ICEcoder.cMonPaste(thisCM, 'cM' + num + pane, evt, (evt.clipboardData || window.clipboardData))});
window['cM' + num + pane].on("contextmenu", function(thisCM, evt) {parent.ICEcoder.cMonContextMenu(thisCM, 'cM' + num + pane, evt)});
window['cM' + num + pane].on("dragover", function(thisCM) {parent.ICEcoder.cMonDragOver(thisCM, event, 'cM' + num + pane)});
window['cM' + num + pane].on("renderLine", function(thisCM, line, element) {parent.ICEcoder.cMonRenderLine(thisCM, 'cM' + num + pane, line, element)});
}
</script>
<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>
<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>
<script>
CodeMirror.commands.autocomplete = function(cM) {
let langType = parent.ICEcoder.caretLocType;