mirror of
https://github.com/twisterarmy/twister-html.git
synced 2025-01-27 07:04:24 +00:00
add fetched URIs' text cropping (23 chars + '…') for better readability
This commit is contained in:
parent
3d92f85410
commit
1d480f2009
@ -905,9 +905,17 @@ function applyShortenedURI(short, long) {
|
||||
.off('click mouseup')
|
||||
.on('click mouseup', muteEvent)
|
||||
;
|
||||
var cropped = (/*$.Options.cropLongURIs &&*/ long.length > 23) ? long.slice(0, 23) + '…' : undefined;
|
||||
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
|
||||
elems[i].text = long;
|
||||
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;
|
||||
}
|
||||
|
||||
function routeOnClick(event) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user