mirror of
https://github.com/seejohnrun/haste-server
synced 2025-08-22 17:13:28 -07:00
Update index.html
This commit is contained in:
parent
f0d8ebcb92
commit
b52afafac8
1 changed files with 63 additions and 55 deletions
|
@ -14,19 +14,25 @@
|
||||||
<meta name="robots" content="noindex,nofollow"/>
|
<meta name="robots" content="noindex,nofollow"/>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var app = null;
|
let app = null;
|
||||||
// Handle pops
|
// Handle pops
|
||||||
var handlePop = function(evt) {
|
const handlePop = function (evt) {
|
||||||
var path = evt.target.location.pathname;
|
const path = evt.target.location.pathname;
|
||||||
if (path === '/') { app.newDocument(true); }
|
if (path === '/') {
|
||||||
else { app.loadDocument(path.substring(1, path.length)); }
|
app.newDocument(true);
|
||||||
|
} else {
|
||||||
|
app.loadDocument(path.substring(1, path.length));
|
||||||
|
}
|
||||||
};
|
};
|
||||||
// Set up the pop state to handle loads, skipping the first load
|
// Set up the pop state to handle loads, skipping the first load
|
||||||
// to make chrome behave like others:
|
// to make chrome behave like others:
|
||||||
// http://code.google.com/p/chromium/issues/detail?id=63040
|
// http://code.google.com/p/chromium/issues/detail?id=63040
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
window.onpopstate = function (evt) {
|
window.onpopstate = function (evt) {
|
||||||
try { handlePop(evt); } catch(err) { /* not loaded yet */ }
|
try {
|
||||||
|
handlePop(evt);
|
||||||
|
} catch (err) { /* not loaded yet */
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}, 1000);
|
}, 1000);
|
||||||
// Construct app and load initial path
|
// Construct app and load initial path
|
||||||
|
@ -61,7 +67,9 @@
|
||||||
|
|
||||||
<div id="linenos"></div>
|
<div id="linenos"></div>
|
||||||
<pre id="box" style="display:none;" class="hljs" tabindex="0"><code></code></pre>
|
<pre id="box" style="display:none;" class="hljs" tabindex="0"><code></code></pre>
|
||||||
|
<label>
|
||||||
<textarea spellcheck="false" style="display:none;"></textarea>
|
<textarea spellcheck="false" style="display:none;"></textarea>
|
||||||
|
</label>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue