From a9695a21caea61e04f721d6dda443ea1521f259f Mon Sep 17 00:00:00 2001 From: Laurent Monin Date: Fri, 12 Jun 2015 15:08:12 +0200 Subject: [PATCH] discogs_importer: improve debug_color() output --- discogs_importer.user.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/discogs_importer.user.js b/discogs_importer.user.js index 2d3f430..da8239e 100644 --- a/discogs_importer.user.js +++ b/discogs_importer.user.js @@ -112,7 +112,7 @@ function insertMBLinks($root) { $root = $('body'); } - function debug_color(what, n) { + function debug_color(what, n, id) { var colors = [ '#B3C6FF', '#C6B3FF', @@ -131,10 +131,11 @@ function insertMBLinks($root) { if (DEBUG) { $(what).css('border', '2px dotted ' + colors[n%colors.length]); var debug_attr = $(what).attr('debug_discogs'); + if (!id) id = ''; if (debug_attr) { - $(what).attr('debug_discogs', debug_attr + ',' + n); + $(what).attr('debug_discogs', debug_attr + ' || ' + id + '(' + n + ')'); } else { - $(what).attr('debug_discogs', n); + $(what).attr('debug_discogs', id + '(' + n + ')'); } } }