From: Dan Scott Date: Thu, 10 Aug 2017 17:17:03 +0000 (-0400) Subject: Improve UI for wikidata note X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=9a7a0146c7707ac0346af813e3b97c547d452eba;p=contrib%2FConifer.git 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 --- 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) {