Update index.html

This commit is contained in:
wioniqle-q 2021-11-15 15:15:42 +03:00 committed by GitHub
commit b52afafac8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -14,19 +14,25 @@
<meta name="robots" content="noindex,nofollow"/>
<script type="text/javascript">
var app = null;
let app = null;
// Handle pops
var handlePop = function(evt) {
var path = evt.target.location.pathname;
if (path === '/') { app.newDocument(true); }
else { app.loadDocument(path.substring(1, path.length)); }
const handlePop = function (evt) {
const path = evt.target.location.pathname;
if (path === '/') {
app.newDocument(true);
} else {
app.loadDocument(path.substring(1, path.length));
}
};
// Set up the pop state to handle loads, skipping the first load
// to make chrome behave like others:
// http://code.google.com/p/chromium/issues/detail?id=63040
setTimeout(function () {
window.onpopstate = function (evt) {
try { handlePop(evt); } catch(err) { /* not loaded yet */ }
try {
handlePop(evt);
} catch (err) { /* not loaded yet */
}
};
}, 1000);
// Construct app and load initial path
@ -61,7 +67,9 @@
<div id="linenos"></div>
<pre id="box" style="display:none;" class="hljs" tabindex="0"><code></code></pre>
<label>
<textarea spellcheck="false" style="display:none;"></textarea>
</label>
</body>