diff --git a/webapp/src/index.js b/webapp/src/index.js index a8f2377..201012b 100644 --- a/webapp/src/index.js +++ b/webapp/src/index.js @@ -8,6 +8,13 @@ import LazyLoad from 'vanilla-lazyload'; $(function(){ + var trunc = function(s, length) { + if (s.length > length) { + s = s.substring(0, length) + '…'; + } + return s; + }; + var table = null; $.getJSON('data/screenshots.json', function(screenshots){ @@ -39,7 +46,7 @@ $(function(){ row.append('' + (item.meta.city === null ? '' : item.meta.city) + ''); // input URL - row.append('' + punycode.toUnicode(item.input_url) + ''); + row.append('' + trunc(punycode.toUnicode(item.input_url), 60) + ''); // score row.append('' + item.score.toFixed(1) + '');