From 9a7a0146c7707ac0346af813e3b97c547d452eba Mon Sep 17 00:00:00 2001 From: Dan Scott Date: Thu, 10 Aug 2017 13:17:03 -0400 Subject: [PATCH] Improve UI for wikidata note Move the note to the end of the role description, to avoid munging crawled schema.org results, and add a CSS class of "wikidata" so we can style it. Signed-off-by: Dan Scott --- Open-ILS/web/js/ui/default/opac/wikidata_music_card.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Open-ILS/web/js/ui/default/opac/wikidata_music_card.js b/Open-ILS/web/js/ui/default/opac/wikidata_music_card.js index e7ffa8e5f2..2d05f6357c 100644 --- a/Open-ILS/web/js/ui/default/opac/wikidata_music_card.js +++ b/Open-ILS/web/js/ui/default/opac/wikidata_music_card.js @@ -5,7 +5,7 @@ var wd; if (document.getElementById('canvas_main').getAttribute('typeof').indexOf('MusicAlbum') > -1) { - performer = document.querySelector('span[resource="#schemacontrib1"] span[property="name"]'); + performer = document.querySelector('span[resource="#schemacontrib1"] span[property="description"]'); entity_name = performer.textContent.trim(); var lastchar = entity_name[entity_name.length - 1]; if (lastchar === '.' || lastchar === ',') { @@ -16,9 +16,10 @@ entity_name = inverse[1].trim() + " " + inverse[0].trim(); } note = document.createElement('span'); - note.innerText = '♪'; + note.setAttribute('class', 'wikidata'); + note.innerText = ' ♪'; note.addEventListener('click', perform, { once: true }); - performer.appendChild(note); + performer.insertBefore(note, null); } function perform(e) { -- 2.11.0