From eb28ce2ac9f9da3b6d15c3af5cfb0b8b883809e7 Mon Sep 17 00:00:00 2001 From: Ruben van de Ven Date: Thu, 24 Jan 2019 15:27:22 +0100 Subject: [PATCH] Indicate missing audio --- www/images/music-broken.svg | 30 ++++++++++++++++++++++++++++++ www/images/music.svg | 6 ++++++ www/js/hugvey_console.js | 8 ++++++++ 3 files changed, 44 insertions(+) create mode 100644 www/images/music-broken.svg create mode 100644 www/images/music.svg diff --git a/www/images/music-broken.svg b/www/images/music-broken.svg new file mode 100644 index 0000000..9e0b732 --- /dev/null +++ b/www/images/music-broken.svg @@ -0,0 +1,30 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/www/images/music.svg b/www/images/music.svg new file mode 100644 index 0000000..bc72cad --- /dev/null +++ b/www/images/music.svg @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/www/js/hugvey_console.js b/www/js/hugvey_console.js index c3201c9..6d5632b 100644 --- a/www/js/hugvey_console.js +++ b/www/js/hugvey_console.js @@ -727,6 +727,13 @@ class Graph { ; let textId = newNodeG.append( "text" ).attr( 'class', 'msg_id' ); let textContent = newNodeG.append( "text" ).attr( 'class', 'msg_txt' ); + let statusIcon = newNodeG.append( "image" ) + .attr( 'class', 'status_icon' ) + .attr( 'x', '-10' ) + .attr( 'y', '10' ) + .attr( 'width', '20' ) + .attr( 'height', '20' ) + ; // remove node.exit().remove(); @@ -771,6 +778,7 @@ class Graph { node.selectAll( "text.msg_id" ).text( d => d['@id'] ); node.selectAll( "text.msg_txt" ).text( d => formatText( `${d['text']}` ) ); + node.selectAll( "image.status_icon" ).attr('xlink:href', d => d['audio'] ? '' : '/images/music-broken.svg'); // console.log('q'); // // TODO: update text // let text = newNodeG.append("text")