Update source

This commit is contained in:
Kenox 2022-11-04 09:09:51 +01:00
commit b0642ef52e
2 changed files with 4 additions and 8 deletions

View file

@ -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);
} }
} }

File diff suppressed because one or more lines are too long