mirror of
https://github.com/seejohnrun/haste-server
synced 2025-08-21 01:13:08 -07:00
Update source
This commit is contained in:
parent
745ef74238
commit
b0642ef52e
2 changed files with 4 additions and 8 deletions
|
@ -237,11 +237,6 @@ haste.prototype.removeLineNumbers = function() {
|
||||||
|
|
||||||
// Load a document and show it
|
// Load a document and show it
|
||||||
haste.prototype.loadDocument = function(key) {
|
haste.prototype.loadDocument = function(key) {
|
||||||
// remove all code elements from the page
|
|
||||||
const elements = document.getElementsByTagName('code');
|
|
||||||
while(elements.length > 0){
|
|
||||||
elements[0].parentNode.removeChild(elements[0]);
|
|
||||||
}
|
|
||||||
// Split the key up
|
// Split the key up
|
||||||
var parts = key.split('.', 2);
|
var parts = key.split('.', 2);
|
||||||
// Ask for what we want
|
// Ask for what we want
|
||||||
|
@ -296,8 +291,9 @@ haste.prototype.lockDocument = function() {
|
||||||
pre.appendChild(code);
|
pre.appendChild(code);
|
||||||
|
|
||||||
code.onclick = function() {
|
code.onclick = function() {
|
||||||
window.location.hash = (i + 1).toString();
|
var file = '/' + ret.key + "#" + (i + 1).toString();
|
||||||
// highlightNew(code);
|
window.history.pushState(null, _this.appName + '-' + ret.key, file);
|
||||||
|
highlightNew(code);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
2
static/application.min.js
vendored
2
static/application.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue