From 9cc6c1cdc10516cd348e87c407c5c72d90304a41 Mon Sep 17 00:00:00 2001 From: Ev Bogue Date: Sun, 7 Apr 2019 09:50:48 -0500 Subject: shorten hashes in urls so they stay on page in mobile --- app.js | 4 +--- lib.js | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/app.js b/app.js index 1869dba..0730463 100644 --- a/app.js +++ b/app.js @@ -1,8 +1,6 @@ var screen = h('div', {id: 'screen'}) document.body.appendChild(screen) -//var header = h('div', {classList: 'message'}) - var keys = getKeys() var navbar = h('div', {classList: 'navbar'}, [ @@ -140,7 +138,7 @@ function route () { document.getElementById("inp").addEventListener("change", readFile); } - var ws = new WebSocket('ws://localhost:8080/' + src) + var ws = new WebSocket('ws://bogbook.com/' + src) var clientLog = { publicKey: src diff --git a/lib.js b/lib.js index 97f8db3..b7919cc 100644 --- a/lib.js +++ b/lib.js @@ -169,7 +169,7 @@ function renderMessage (post) { if (post.content.reply) { message.appendChild(h('span', [ 're: ', - h('a', {href: '#' + post.content.reply}, [post.content.reply]) + h('a', {href: '#' + post.content.reply}, [post.content.reply.substring(0, 10) + '...']) ])) } @@ -234,7 +234,7 @@ function getImage (id) { } function getName (id) { - var name = h('span', [id]) + var name = h('span', [id.substring(0, 10) + '...']) if (localStorage[id]) { var log = JSON.parse(localStorage[id]) for (var i=0; i < log.length; i++) { -- cgit v1.2.3-70-g09d2