Browse Source

add fetched URIs' text cropping (23 chars + '…') for better readability

readme-update
Simon Grim 9 years ago
parent
commit
1d480f2009
  1. 8
      js/interface_common.js

8
js/interface_common.js

@ -905,8 +905,16 @@ function applyShortenedURI(short, long) {
.off('click mouseup') .off('click mouseup')
.on('click mouseup', muteEvent) .on('click mouseup', muteEvent)
; ;
var cropped = (/*$.Options.cropLongURIs &&*/ long.length > 23) ? long.slice(0, 23) + '…' : undefined;
for (var i = 0; i < elems.length; i++) for (var i = 0; i < elems.length; i++)
if (elems[i].text === short) // there may be some other text, possibly formatted, so we check it if (elems[i].text === short) // there may be some other text, possibly formatted, so we check it
if (cropped)
$(elems[i])
.text(cropped)
.on('mouseover', {uri: long}, function (event) {event.target.text = event.data.uri;})
.on('mouseout', {uri: cropped}, function (event) {event.target.text = event.data.uri;})
;
else
elems[i].text = long; elems[i].text = long;
} }

Loading…
Cancel
Save