Commit ed8701f65d925aa33b1623cb287a7cb11b357fa0
cleanup
cel committed on 7/15/2017, 8:57:45 PMParent: ad86f1213157422a7a3cd4b51bf503e6578bb446
Files changed
dat.dpi | changed |
dat.dpi | |||
---|---|---|---|
@@ -121,15 +121,10 @@ | |||
121 | 121 … | this.writeHeader('text/plain') | |
122 | 122 … | this.socket.end(JSON.stringify(st, 0, 2)) | |
123 | 123 … | } | |
124 | 124 … | ||
125 | -function escapeHTML(str) { | ||
126 | - return str.replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"') | ||
127 | -} | ||
128 | - | ||
129 | 125 … | var typeIcons = { | |
130 | 126 … | updir: h('img', {alt: 'up', src: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAKxJREFUeNpi/P//PwMlgImBQjAMDGBBF2BkZISz09LSwCE8a9YsuCBGoIMEkDEMJCUl/b90+QoYg9i41LNgc1ZycvL/hMQkhgcPH4H5iUnJIJf9nzt3LiNBL2RkZPwPj4hk4BMUYuDh44MEFDMLQ0xsHAMrKyvIJYyEwuDLiuXLeP7+/Qv3EihcmJmZGZiYmL5gqEcPFKBiAyDFjCPQ/wLVX8BrwGhSJh0ABBgAsetR5KBfw9EAAAAASUVORK5CYII='}), | |
131 | - // folder: h('img', {alt: 'folder', href: 'data:image/gif;base64,R0lGODdhFAAXAPAAMf///wAAACwAAAAAFAAXAAACOYSPqcvtD1OYNAZ1XcZtL1oZHpSNJGBqoYVO0QG+aJt263mTuUbL9AWcBYctoZEIdP1AzBisCc0UAAA7'}), | ||
132 | 127 … | directory: h('img', {alt: 'directory', src: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9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vsy3JwctK0wQWLvQabb/3/v7eoKuubqzdFZMk5PwuKqqIKoAB/Qba8d8/v3b2/xfFSVVbXPpWbUUO990Pd7Xa0Uv2paxurf1Y+vnucwA87AOh0OjP5iQL7v/dptWOacZ1ao0plZ5vdepV2q8Wt67dzxanik7fvlxcGBQQAxlgAqpUK5e0KO5Ua9d2IuNlmL/pFuVwhCAKuXrmWGx0Ze/pm+dXlFBAmAANAYSqPcy5p73DO4pwjE8OHzyuMZXNcvHAp9/3H1wXgWx9gjQGURi3CWjuU01S+xMkTBbxYgiCQg4ODGy9ePsvMzz1yfQUKTBTGcc7iVVHv8T5V4hhhFJExzp09z8bmesarzwIpINkaN1s454YUpCWBkC706gcysEkG+clxnPNo7y/0PsMhQHoAa1CvwyFCQBAoipBcFY4eyWCtxTt/FCBAHO3h7P8tZMIMpeI0xlh8z+pABkLpVBG0J1UGVKQKVBARrDH9rAaeERq1iG63298YhiFnZmf63rWXiTEGd9wCwOmZaUTkaA8ooJfpEEBEqnEcTRcKk//1n1a73QIkMtZ0EluqzD98cCfMhoum2y2pgpI84fEZlGx2pG6MmVtafP0F4B+wR1eZMTEGTgAAAABJRU5ErkJggg=='}), | |
134 | 129 … | } | |
135 | 130 … | ||
@@ -301,9 +296,9 @@ | |||
301 | 296 … | h('input', {type: 'hidden', name: 'reload', value: self.url}) | |
302 | 297 … | ]), | |
303 | 298 … | h('h3', 'Archives'), | |
304 | 299 … | Object.keys(archives).length === 0 ? [ | |
305 | - h('p', 'Not swarming any archives currently') | ||
300 … | + h('p', 'None') | ||
306 | 301 … | ] : Object.keys(archives).map(function (key) { | |
307 | 302 … | var archive = archives[key] | |
308 | 303 … | var description = archive.manifest && archive.manifest.description | |
309 | 304 … | var title = archive.manifest && archive.manifest.title | |
@@ -381,9 +376,8 @@ | |||
381 | 376 … | } | |
382 | 377 … | ||
383 | 378 … | function DpiReq_onOpenUrl(m) { | |
384 | 379 … | if (!this.authed) { | |
385 | - var addr = this.socket.remoteAddress + ':' + this.socket.remotePort | ||
386 | 380 … | console.error('[dat dpi] un-authed request from', this.getAddress()) | |
387 | 381 … | return this.socket.end() | |
388 | 382 … | } | |
389 | 383 … | this.url = m[1] | |
@@ -393,9 +387,8 @@ | |||
393 | 387 … | } | |
394 | 388 … | ||
395 | 389 … | function DpiReq_onBye(m) { | |
396 | 390 … | if (!this.authed) { | |
397 | - var addr = this.socket.remoteAddress + ':' + this.socket.remotePort | ||
398 | 391 … | console.error('[dat dpi] un-authed bye from', this.getAddress()) | |
399 | 392 … | return this.socket.end() | |
400 | 393 … | } | |
401 | 394 … | console.log('[dat dpi] stopping') |
Built with git-ssb-web