mirror of
https://github.com/murdos/musicbrainz-userscripts
synced 2025-03-04 14:27:14 +00:00
Fix for ISRC year highlighting. (#527)
* Update mb_ui_enhancements.user.js Fix for ISRC year highlighting.
This commit is contained in:
parent
2cb8763139
commit
9b3d7c6a47
1 changed files with 11 additions and 14 deletions
|
@ -165,21 +165,18 @@ $(document).ready(function () {
|
|||
return false;
|
||||
}
|
||||
});
|
||||
let reg = new RegExp('([A-Z]{2}[A-Z0-9]{3}[0-9]{7})');
|
||||
$('#content table.tbl tbody tr').each(function () {
|
||||
let $td = $(this).find(`td:eq(${isrcColNo})`);
|
||||
let isrcs = $td.text().trim().split('\n<br>\n');
|
||||
let newHTML = '';
|
||||
$.each(isrcs, function (index, isrc) {
|
||||
isrc = isrc.trim();
|
||||
newHTML += `<a href='/isrc/${isrc}'><code>`;
|
||||
newHTML += `${isrc.substring(0, 5)}<b>${isrc.substring(5, 7)}</b>${isrc.substring(7)}`;
|
||||
newHTML += '</code></a>';
|
||||
if (index != isrcs.length - 1) {
|
||||
newHTML += '<br>';
|
||||
}
|
||||
});
|
||||
$td.html(newHTML);
|
||||
$(this)
|
||||
.find(`td:eq(${isrcColNo})`)
|
||||
.find('li')
|
||||
.each(function () {
|
||||
let newHTML = '';
|
||||
var isrc = $(this).text();
|
||||
newHTML += `<a href='/isrc/${isrc}'><bdi><code>`;
|
||||
newHTML += `${isrc.substring(0, 5)}<b>${isrc.substring(5, 7)}</b>${isrc.substring(7)}`;
|
||||
newHTML += '</code></bdi></a>';
|
||||
$(this).html(newHTML);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue