Skip to content
This repository was archived by the owner on Jun 12, 2021. It is now read-only.

Commit 6dd63a1

Browse files
committed
Fixed paste-key in URL
1 parent 7d20700 commit 6dd63a1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ It bases upon [haste](https://github.com/seejohnrun/haste-server) and got enhanc
3030
| `dataPath` | The directory where all pastes are stored | `./data` |
3131
| `keyLength` | The length of the pastes' key | `10` |
3232
| `maxLength` | Maximum chars in a paste | `500000` |
33-
| `createKey` | Needs to be in front of paste to allow creation | ` ` |
33+
| `createKey` | Needs to be in front of paste to allow creation | ` ` |
3434
| `documents` | Static documents to serve | See below |
3535

3636
### Default Config

static/application.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ haste.prototype.loadDocument = function(key) {
6060
if (ret) {
6161
_this.$code.html(ret.value);
6262
_this.setTitle(ret.key);
63+
window.history.pushState(null, _this.appName + '-' + ret.key, '/' + ret.key);
6364
_this.fullKey();
6465
_this.$textarea.val('').hide();
6566
_this.$box.show();
@@ -85,8 +86,7 @@ haste.prototype.lockDocument = function() {
8586
if (!err && ret) {
8687
_this.$code.html(ret.value.trim().replace(/.+/g, "<span class=\"line\">$&</span>").replace(/^\s*[\r\n]/gm, "<span class=\"line\"></span>\n"));
8788
_this.setTitle(ret.key);
88-
var file = '/' + ret.key;
89-
window.history.pushState(null, _this.appName + '-' + ret.key, file);
89+
window.history.pushState(null, _this.appName + '-' + ret.key, '/' + ret.key);
9090
_this.fullKey();
9191
_this.$textarea.val('').hide();
9292
_this.$box.show();

0 commit comments

Comments
 (0)