truncate artist urls on display

This commit is contained in:
r888888888
2017-09-14 15:56:04 -07:00
parent b361809489
commit 5448ae5af4
2 changed files with 6 additions and 2 deletions

View File

@@ -59,7 +59,7 @@
$("#form").appendTo(dialog);
dialog.dialog({
title: "Edit tags",
width: $(window).width() / 3,
width: $(window).width() * 0.6,
position: {
my: "right",
at: "right-20",

View File

@@ -259,7 +259,11 @@
if (text.match(/^ http/)) {
text = text.substring(1, 1000);
var $url = $("<a/>");
$url.text(text);
var desc = text.replace(/^https?:\/\//, "");
if (desc.length > 30) {
desc = desc.substring(0, 30) + "...";
}
$url.text(desc);
$url.attr("href", text);
$url.attr("target", "_blank");
$ul.append($("<li/>").html($url));