Skip to content
This repository has been archived by the owner on Dec 14, 2023. It is now read-only.

Increase readability #741

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions editor.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
include("lib/headers.php");
include("lib/settings.php");
include "lib/headers.php";
include "lib/settings.php";
$t = $text['editor'];
?>
<!DOCTYPE html>
Expand All @@ -21,34 +21,34 @@
//-->
<script src="<?php echo $ICEcoder["codeMirrorDir"]; ?>/lib/codemirror-compressed.js?microtime=<?php echo microtime(true);?>"></script>
<?php
if (file_exists(dirname(__FILE__)."/plugins/jshint/jshint-2.5.6.min.js")) {
if (file_exists(__DIR__."/plugins/jshint/jshint-2.5.6.min.js")) {
echo '<script src="plugins/jshint/jshint-2.5.6.min.js?microtime='.microtime(true).'></script>';
};?>
<script src="lib/mmd.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="<?php echo $ICEcoder["codeMirrorDir"]; ?>/addon/scroll/simplescrollbars.css?microtime=<?php echo microtime(true);?>">
<?php
if (file_exists(dirname(__FILE__)."/plugins/emmet/emmet.min.js")) {
if (file_exists(__DIR__."/plugins/emmet/emmet.min.js")) {
echo '<script src="plugins/emmet/emmet.min.js?microtime='.microtime(true).'"></script>';
};?>
<?php
if (file_exists(dirname(__FILE__)."/plugins/pesticide/pesticide.js")) {
if (file_exists(__DIR__."/plugins/pesticide/pesticide.js")) {
echo '<script src="plugins/pesticide/pesticide.js?microtime='.microtime(true).'"></script>';
};?>
<?php
if (file_exists(dirname(__FILE__)."/plugins/stats.js/stats.min.js")) {
if (file_exists(__DIR__."/plugins/stats.js/stats.min.js")) {
echo '<script src="plugins/stats.js/stats.min.js?microtime='.microtime(true).'"></script>';
};?>
<?php
if (file_exists(dirname(__FILE__)."/plugins/responsive-helper/responsive-helper.js")) {
if (file_exists(__DIR__."/plugins/responsive-helper/responsive-helper.js")) {
echo '<script src="plugins/responsive-helper/responsive-helper.js?microtime='.microtime(true).'"></script>';
};?>
<link rel="stylesheet" href="<?php
if ($ICEcoder["theme"]=="default") {echo 'lib/editor.css';} else {echo $ICEcoder["codeMirrorDir"].'/theme/'.$ICEcoder["theme"].'.css';};
echo "?microtime=".microtime(true);
if (array_search($ICEcoder["theme"],array("3024-day","base16-light","eclipse","elegant","mdn-like","neat","neo","paraiso-light","solarized","the-matrix","xq-light")) !== false) {
if (in_array($ICEcoder["theme"],array("3024-day","base16-light","eclipse","elegant","mdn-like","neat","neo","paraiso-light","solarized","the-matrix","xq-light"))) {
$activeLineBG = "#ccc";
} elseif (array_search($ICEcoder["theme"],array("3024-night","blackboard","colorforth","liquibyte","night","tomorrow-night-bright","tomorrow-night-eighties","vibrant-ink")) !== false) {
} elseif (in_array($ICEcoder["theme"],array("3024-night","blackboard","colorforth","liquibyte","night","tomorrow-night-bright","tomorrow-night-eighties","vibrant-ink"))) {
$activeLineBG = "#888";
} else {
$activeLineBG = "#000";
Expand Down Expand Up @@ -112,7 +112,7 @@
<span class="heading"><?php echo $t['ICEcoder root'];?></span><br>
<?php echo $docRoot.$iceRoot;?><br><br>
<span class="heading"><?php echo $t['PHP version'];?></span><br>
<?php echo phpversion();?><br><br>
<?php echo PHP_VERSION;?><br><br>
<span class="heading"><?php echo $t['Date & time'];?></span><br>
<span id="serverDT"></span><br><br>
<h2><?php echo $t['your device'];?></h2>
Expand All @@ -136,7 +136,7 @@
<span class="heading"><?php echo $t['Last 10 files...'];?></span><br>
<ul class="fileManager" id="last10Files" style="margin-left: 0; line-height: 20px"><?php
$last10FilesArray = explode(",",$ICEcoder["last10Files"]);
for ($i=0;$i<count($last10FilesArray);$i++) {
for ($i=0, $iMax = count($last10FilesArray); $i< $iMax; $i++) {
if ($ICEcoder["last10Files"]=="") {
echo '<div style="display: inline-block; margin-left: -39px; margin-top: -4px">'.$t['none'].'</div><br><br>';
} else {
Expand Down Expand Up @@ -318,7 +318,7 @@ function createNewCMInstance(num) {

<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"); ?>
<?php include_once "processes/on-editor-load.php"; ?>

</body>

Expand Down
4 changes: 2 additions & 2 deletions files.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
include("lib/headers.php");
include("lib/settings.php");
include "lib/headers.php";
include "lib/settings.php";
$t = $text['files'];

// Is our dir in the list of GitHub local paths?
Expand Down
10 changes: 5 additions & 5 deletions index.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
include("lib/headers.php");
include("lib/settings.php");
include "lib/headers.php";
include "lib/settings.php";
$t = $text['index'];

$updateMsg = '';
Expand All @@ -21,7 +21,7 @@
}
}

$isMac = strpos($_SERVER['HTTP_USER_AGENT'], "Macintosh")>-1 ? true : false;
$isMac = strpos($_SERVER['HTTP_USER_AGENT'], "Macintosh") > -1;
?>
<!DOCTYPE html>
<html onMouseDown="top.ICEcoder.mouseDown=true; top.ICEcoder.resetAutoLogoutTimer();" onMouseUp="top.ICEcoder.mouseDown=false; top.ICEcoder.resetAutoLogoutTimer(); top.ICEcoder.mouseDownInCM=false; if (!top.ICEcoder.overCloseLink) {top.ICEcoder.tabDragEnd()}" onMouseMove="if(top.ICEcoder) {top.ICEcoder.getMouseXY(event,'top'); top.ICEcoder.resetAutoLogoutTimer(); top.ICEcoder.canResizeFilesW()}" onMouseWheel="top.ICEcoder.resetAutoLogoutTimer(); if (top.ICEcoder.getcMInstance() && !top.ICEcoder.getcMInstance().hasFocus() && !top.ICEcoder.getcMdiffInstance().hasFocus()) {event.wheelDelta > 0 ? top.ICEcoder.nextTab() : top.ICEcoder.previousTab();}">
Expand Down Expand Up @@ -171,7 +171,7 @@
</span>
<div onMouseOver="ICEcoder.showFileMenu()" style="padding: 2px 0"><hr></div>
<?php
if (file_exists(dirname(__FILE__)."/plugins/zip-it/index.php")) {
if (file_exists(__DIR__."/plugins/zip-it/index.php")) {
echo '<a href="javascript:top.ICEcoder.zipIt(top.ICEcoder.selectedFiles[top.ICEcoder.selectedFiles.length-1])" onMouseOver="ICEcoder.showFileMenu()">Zip It!</a>'.PHP_EOL;
};
?>
Expand Down Expand Up @@ -344,4 +344,4 @@

</body>

</html>
</html>
6 changes: 3 additions & 3 deletions lib/auto-logout-warning.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
include("headers.php");
include("settings.php");
include "headers.php";
include "settings.php";
$t = $text['auto-logout-warning'];
?>
<!DOCTYPE html>
Expand All @@ -21,4 +21,4 @@

</body>

</html>
</html>
6 changes: 3 additions & 3 deletions lib/backup-versions-preview-loader.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
// Load common functions
include("headers.php");
include("settings.php");
include "headers.php";
include "settings.php";

$file = str_replace("|","/",xssClean($_GET['file'],'html'));

Expand Down Expand Up @@ -33,4 +33,4 @@
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>
12 changes: 6 additions & 6 deletions lib/backup-versions.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
// Load common functions
include("headers.php");
include("settings.php");
include "headers.php";
include "settings.php";
$text = $_SESSION['text'];
$t = $text['backup-versions'];

Expand Down Expand Up @@ -50,11 +50,11 @@

while (false !== ($cssFile = readdir($handle))) {
if ($cssFile !== "." && $cssFile != "..") {
array_push($themeArray,basename($cssFile,".css"));
$themeArray[] = basename($cssFile, ".css");
}
}
sort($themeArray);
for ($i=0;$i<count($themeArray);$i++) {
for ($i=0, $iMax = count($themeArray); $i< $iMax; $i++) {
echo '<link rel="stylesheet" href="../'.$ICEcoder["codeMirrorDir"].'/theme/'.$themeArray[$i].'.css?microtime='.microtime(true).'">'.PHP_EOL;
}
?>
Expand Down Expand Up @@ -110,7 +110,7 @@

<?php
echo "fileName = '".basename($file)."';";
include(dirname(__FILE__)."/language-modes-partial.js");
include __DIR__."/language-modes-partial.js";
?>

var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
Expand Down Expand Up @@ -167,4 +167,4 @@

</body>

</html>
</html>
14 changes: 7 additions & 7 deletions lib/bug-files-check.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
// Load common functions
include("headers.php");
include_once("settings-common.php");
include "headers.php";
include_once "settings-common.php";
$text = $_SESSION['text'];
$t = $text['bug-files-check'];

Expand All @@ -11,7 +11,7 @@

$result = "ok";

for ($i=0; $i<count($files); $i++) {
for ($i=0, $iMax = count($files); $i< $iMax; $i++) {
// Work out the real path for a file
$files[$i] = realpath($_SERVER['DOCUMENT_ROOT'].$files[$i]);
// If we can't find that file or it doesn't start with the doc root, it's an error
Expand All @@ -26,7 +26,7 @@

$filesWithNewBugs = 0;

for ($i=0; $i<count($files); $i++) {
for ($i=0, $iMax = count($files); $i< $iMax; $i++) {
// If we have set a filesize value previously and it's different to now, there's new bugs
$fileSizesSeenArray = explode(",",xssClean($_GET['filesSizesSeen'],"html"));
if ($fileSizesSeenArray[$i]!="null" && $fileSizesSeenArray[$i] != $filesSizesSeen[$i]) {
Expand Down Expand Up @@ -93,7 +93,7 @@
}

// Get dir name tmp dir's parent
$tmpLoc = dirname(__FILE__);
$tmpLoc = __DIR__;
$tmpLoc = explode(DIRECTORY_SEPARATOR,$tmpLoc);
$tmpLoc = $tmpLoc[count($tmpLoc)-2];

Expand All @@ -107,9 +107,9 @@
);

// Include our process once our bug checking work is done
include("../processes/on-bug-check.php");
include "../processes/on-bug-check.php";

// Finally, display our status in JSON format as the XHR response text
echo json_encode($status);

?>
?>
6 changes: 3 additions & 3 deletions lib/download.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
include("headers.php");
include("settings.php");
include "headers.php";
include "settings.php";

// Establish the real absolute path to the file
$file = realpath($docRoot.$iceRoot.str_replace("|","/",strClean($_GET['file'])));
Expand All @@ -24,4 +24,4 @@
readfile($file);
exit;
}
?>
?>
Loading