mirror of
https://github.com/seejohnrun/haste-server
synced 2025-08-22 10:43:10 -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"/>
|
||||
|
||||
<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>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue