Microtime all CSS and JS paths to help stop caching

This commit is contained in:
Matt Pass
2015-01-23 08:22:41 +00:00
parent 3dc26528b4
commit b65a7a690e
12 changed files with 35 additions and 33 deletions

View File

@@ -10,36 +10,37 @@ $t = $text['editor'];
<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="<?php echo $ICEcoder["codeMirrorDir"]; ?>/lib/codemirror.css">
<link rel="stylesheet" href="<?php echo $ICEcoder["codeMirrorDir"]; ?>/addon/hint/show-hint.css">
<link rel="stylesheet" href="<?php echo $ICEcoder["codeMirrorDir"]; ?>/addon/lint/lint.css">
<link rel="stylesheet" href="<?php echo $ICEcoder["codeMirrorDir"]; ?>/lib/codemirror.css?microtime=<?php echo microtime(true);?>">
<link rel="stylesheet" href="<?php echo $ICEcoder["codeMirrorDir"]; ?>/addon/hint/show-hint.css?microtime=<?php echo microtime(true);?>">
<link rel="stylesheet" href="<?php echo $ICEcoder["codeMirrorDir"]; ?>/addon/lint/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, rust, sass, sql, xml, yaml
addon: brace-fold, closebrackets, closetag, css-hint, html-hint, javascript-hint, javascript-lint, lint, match-highlighter, searchcursor, show-hint, sql-hint, trailingspace, xml-fold, xml-hint
//-->
<script src="<?php echo $ICEcoder["codeMirrorDir"]; ?>/lib/codemirror-compressed.js"></script>
<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")) {
echo '<script src="plugins/jshint/jshint-2.5.6.min.js"></script>';
echo '<script src="plugins/jshint/jshint-2.5.6.min.js?microtime='.microtime(true).'></script>';
};?>
<script src="lib/mmd.js"></script>
<script src="lib/foldcode.js"></script>
<script src="lib/mmd.js?microtime=<?php echo microtime(true);?>"></script>
<script src="lib/foldcode.js?microtime=<?php echo microtime(true);?>"></script>
<?php
if (file_exists(dirname(__FILE__)."/plugins/emmet/emmet.min.js")) {
echo '<script src="plugins/emmet/emmet.min.js"></script>';
echo '<script src="plugins/emmet/emmet.min.js?microtime=".microtime(true)."></script>';
};?>
<?php
if (file_exists(dirname(__FILE__)."/plugins/pesticide/pesticide.js")) {
echo '<script src="plugins/pesticide/pesticide.js"></script>';
echo '<script src="plugins/pesticide/pesticide.js?microtime=".microtime(true)."></script>';
};?>
<?php
if (file_exists(dirname(__FILE__)."/plugins/stats.js/stats.min.js")) {
echo '<script src="plugins/stats.js/stats.min.js"></script>';
echo '<script src="plugins/stats.js/stats.min.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);
$activeLineBG = array_search($ICEcoder["theme"],array("3024-day","base16-light","eclipse","elegant","neat","solarized","xq-light")) !== false ? "#ccc" : "#000";
?>">
@@ -74,8 +75,8 @@ h2 {color: rgba(0,198,255,0.7)}
.diffGreyLighter {background: #888 !important; color: #222 !important}
.diffNone {}
</style>
<link rel="stylesheet" href="lib/file-types.css">
<link rel="stylesheet" href="lib/file-type-icons.css">
<link rel="stylesheet" href="lib/file-types.css?microtime=<?php echo microtime(true);?>">
<link rel="stylesheet" href="lib/file-type-icons.css?microtime=<?php echo microtime(true);?>">
</head>
<body style="color: #fff; margin: 0" onKeyDown="return top.ICEcoder.interceptKeys('content', event);" onKeyUp="top.ICEcoder.resetKeys(event);" onBlur="parent.ICEcoder.resetKeys(event);">

View File

@@ -12,10 +12,10 @@ $isGitHubRepoDir = in_array($ICEcoder["root"],$ICEcoder['githubLocalPaths']);
<head>
<title>ICEcoder v <?php echo $ICEcoder["versionNo"];?> file manager</title>
<meta name="robots" content="noindex, nofollow">
<link rel="stylesheet" type="text/css" href="lib/files.css">
<link rel="stylesheet" type="text/css" href="lib/file-types.css">
<link rel="stylesheet" type="text/css" href="lib/file-type-icons.css">
<script src="lib/ice-coder<?php if (!$ICEcoder['devMode']) {echo '.min';};?>.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="lib/files.css?microtime=<?php echo microtime(true);?>">
<link rel="stylesheet" type="text/css" href="lib/file-types.css?microtime=<?php echo microtime(true);?>">
<link rel="stylesheet" type="text/css" href="lib/file-type-icons.css?microtime=<?php echo microtime(true);?>">
<script src="lib/ice-coder<?php if (!$ICEcoder['devMode']) {echo '.min';}; echo ".js?microtime=".microtime(true);?>" type="text/javascript"></script>
</head>
<body onFocus="top.ICEcoder.files.style.background='#444'" onBlur="top.ICEcoder.files.style.background='#383838'" onload="top.ICEcoder.showHideGithubNav(top.ICEcoder.githubDiff ? 'show' : 'hide')" onDblClick="top.ICEcoder.openFile()" onKeyDown="return top.ICEcoder.interceptKeys('files', event);" onKeyUp="top.ICEcoder.resetKeys(event);" onBlur="parent.ICEcoder.resetKeys(event);">

View File

@@ -168,7 +168,7 @@ if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && isset
<title>ICEcoder <?php echo $ICEcoder["versionNo"];?> GitHub manager</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="robots" content="noindex, nofollow">
<link rel="stylesheet" type="text/css" href="github-manager.css">
<link rel="stylesheet" type="text/css" href="github-manager.css?microtime=<?php echo microtime(true);?>">
</head>
<body class="githubManager">

View File

@@ -23,7 +23,7 @@ if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && isset
echo '<!DOCTYPE html>
<html>
<head>
<script src="github.js"></script>
<script src="github.js?microtime=<?php echo microtime(true);?>"></script>
</body>
<script>
top.ICEcoder.githubAuthTokenSet = true;
@@ -47,8 +47,8 @@ if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && isset
echo '<!DOCTYPE html>
<html>
<head>
<script src="github.js"></script>
<script src="underscore-min.js"></script>
<script src="github.js?microtime=<?php echo microtime(true);?>"></script>
<script src="underscore-min.js?microtime=<?php echo microtime(true);?>"></script>
</body>
<script>
// Start our github object, establish this repo & file path
@@ -153,8 +153,8 @@ if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && isset
<title>ICEcoder <?php echo $ICEcoder["versionNo"];?> GitHub commit files</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="robots" content="noindex, nofollow">
<script src="github.js"></script>
<link rel="stylesheet" type="text/css" href="github.css">
<script src="github.js?microtime=<?php echo microtime(true);?>"></script>
<link rel="stylesheet" type="text/css" href="github.css?microtime=<?php echo microtime(true);?>">
</head>
<body class="githubAction">

View File

@@ -10,7 +10,7 @@ $t = $text['help'];
<title>ICEcoder <?php echo $ICEcoder["versionNo"];?> help</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="robots" content="noindex, nofollow">
<link rel="stylesheet" type="text/css" href="help.css">
<link rel="stylesheet" type="text/css" href="help.css?microtime=<?php echo microtime(true);?>">
</head>
<body class="help">

View File

@@ -14,7 +14,7 @@ echo $ICEcoder["password"] == "" && !$ICEcoder["multiUser"] ? "Setup" : "Login";
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="robots" content="noindex, nofollow">
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<link rel="stylesheet" type="text/css" href="ice-coder.css">
<link rel="stylesheet" type="text/css" href="ice-coder.css?microtime=<?php echo microtime(true);?>">
<link rel="icon" type="image/png" href="../favicon.png">
</head>

View File

@@ -15,7 +15,7 @@ if(isset($_GET['selectedFiles'])) {
<title>ICEcoder <?php echo $ICEcoder["versionNo"];?> multiple results screen</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="robots" content="noindex, nofollow">
<link rel="stylesheet" type="text/css" href="multiple-results.css">
<link rel="stylesheet" type="text/css" href="multiple-results.css?microtime=<?php echo microtime(true);?>">
</head>
<body class="results" onLoad="top.get('loadingMask').style.visibility = 'hidden'">

View File

@@ -193,7 +193,7 @@ function deletePlugin($dir) {
<title>ICEcoder <?php echo $ICEcoder["versionNo"];?> plugins manager</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="robots" content="noindex, nofollow">
<link rel="stylesheet" type="text/css" href="plugins-manager.css">
<link rel="stylesheet" type="text/css" href="plugins-manager.css?microtime=<?php echo microtime(true);?>">
</head>
<body class="pluginsManager">

View File

@@ -17,7 +17,7 @@ if (!file_exists($fileName) || strpos(str_replace("\\","/",$fileName),$docRoot)
<title>ICEcoder <?php echo $ICEcoder["versionNo"];?> file/folder properties</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="robots" content="noindex, nofollow">
<link rel="stylesheet" type="text/css" href="properties.css">
<link rel="stylesheet" type="text/css" href="properties.css?microtime=<?php echo microtime(true);?>">
</head>
<body class="properties">

View File

@@ -10,9 +10,9 @@ $t = $text['settings-screen'];
<title>ICEcoder <?php echo $ICEcoder["versionNo"];?> settings screen</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="robots" content="noindex, nofollow">
<link rel="stylesheet" type="text/css" href="settings-screen.css">
<link rel="stylesheet" href="../<?php echo $ICEcoder["codeMirrorDir"]; ?>/lib/codemirror.css">
<script src="../<?php echo $ICEcoder["codeMirrorDir"]; ?>/lib/codemirror-compressed.js"></script>
<link rel="stylesheet" type="text/css" href="settings-screen.css?microtime=<?php echo microtime(true);?>">
<link rel="stylesheet" href="../<?php echo $ICEcoder["codeMirrorDir"]; ?>/lib/codemirror.css?microtime=<?php echo microtime(true);?>">
<script src="../<?php echo $ICEcoder["codeMirrorDir"]; ?>/lib/codemirror-compressed.js?microtime=<?php echo microtime(true);?>"></script>
<style type="text/css">
.CodeMirror {position: absolute; width: 409px; height: 180px; font-size: <?php echo $ICEcoder["fontSize"];?>}
@@ -21,7 +21,7 @@ $t = $text['settings-screen'];
.cm-tab {border-left-width: <?php echo $ICEcoder["visibleTabs"] ? "1px" : "0";?>; margin-left: <?php echo $ICEcoder["visibleTabs"] ? "-1px" : "0";?>; border-left-style: solid; border-left-color: rgba(255,255,255,0.2)}
</style>
<link rel="stylesheet" href="editor.css">
<link rel="stylesheet" href="editor.css?microtime=<?php echo microtime(true);?>">
<?php
$themeArray = array();
$handle = opendir('../'.$ICEcoder["codeMirrorDir"].'/theme/');
@@ -32,7 +32,7 @@ while (false !== ($file = readdir($handle))) {
}
sort($themeArray);
for ($i=0;$i<count($themeArray);$i++) {
echo '<link rel="stylesheet" href="../'.$ICEcoder["codeMirrorDir"].'/theme/'.$themeArray[$i].'.css">'.PHP_EOL;
echo '<link rel="stylesheet" href="../'.$ICEcoder["codeMirrorDir"].'/theme/'.$themeArray[$i].'.css?microtime=<?php echo microtime(true);?>">'.PHP_EOL;
}
?>
</head>

View File

@@ -69,6 +69,7 @@ if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && isset
// Work out the theme to use now
$ICEcoder["theme"]=="default" ? $themeURL = 'lib/editor.css' : $themeURL = $ICEcoder["codeMirrorDir"].'/theme/'.$ICEcoder["theme"].'.css';
$themeURL .= "?microtime=".microtime(true);
// Do we need a file manager refresh?
$refreshFM = $_POST['changedFileSettings']=="true" ? "true" : "false";

View File

@@ -8,7 +8,7 @@ Open file, update document, save file, highlight line, add tag wrappers, duplica
<head>
<title>ICEcoder Test Suite</title>
<meta name="robots" content="noindex, nofollow">
<script src="object-watch.js"></script>
<script src="object-watch.js?microtime=<?php echo microtime(true);?>"></script>
</head>
<script>