From: Antoine Cellerier Date: Mon, 30 Jan 2006 17:33:05 +0000 (+0000) Subject: * Add "Stream and media info panel" ( http/dialogs/main, X-Git-Tag: 0.9.0-test0~12572 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=56d92ad2d9fcd6fdeb48de35bef77b28891d7529;p=vlc * Add "Stream and media info panel" ( http/dialogs/main, http/images/info.png, http/style.css, http/js/functions.js ) * Make instance playlist position consitent with position used in inputdeln (starts from 1 and not 0) ( src/misc/vlm.c, http/js/vlm.js ) * Make it possible to use "enter key" in some text boxes to confirm (*) --- diff --git a/share/http/dialogs/main b/share/http/dialogs/main index 67db9e0810..3c54241589 100644 --- a/share/http/dialogs/main +++ b/share/http/dialogs/main @@ -71,6 +71,10 @@ sout and playlist . Playlist Playlist +   + +
+
+ diff --git a/share/http/dialogs/sout b/share/http/dialogs/sout index 7f921667c1..27c1f2eae6 100644 --- a/share/http/dialogs/sout +++ b/share/http/dialogs/sout @@ -33,12 +33,14 @@ Note that the sout chain is used and sent to VLC by the input dialog
- -
+ +
+ +
diff --git a/share/http/dialogs/vlm b/share/http/dialogs/vlm index d86e6ae298..24861401aa 100644 --- a/share/http/dialogs/vlm +++ b/share/http/dialogs/vlm @@ -39,7 +39,7 @@ sout and vlmelements .
- +
diff --git a/share/http/images/info.png b/share/http/images/info.png new file mode 100644 index 0000000000..46dee721e7 Binary files /dev/null and b/share/http/images/info.png differ diff --git a/share/http/js/functions.js b/share/http/js/functions.js index d4542b3c0e..796ecd12e3 100644 --- a/share/http/js/functions.js +++ b/share/http/js/functions.js @@ -238,6 +238,13 @@ function toggle_btn_text() } } +function clear_children( elt ) +{ + if( elt ) + while( elt.hasChildNodes() ) + elt.removeChild( elt.firstChild ); +} + /********************************************************************** * Interface actions *********************************************************************/ @@ -390,6 +397,36 @@ function parse_status() document.getElementById( 'btn_pause_img' ).setAttribute( 'alt', 'Play' ); document.getElementById( 'btn_pause' ).setAttribute( 'title', 'Play' ); } + + var tree = document.createElement( "ul" ); + var categories = status.getElementsByTagName( 'category' ); + var i; + for( i = 0; i < categories.length; i++ ) + { + var item = document.createElement( "li" ); + item.appendChild( document.createTextNode( categories[i].getAttribute( 'name' ) ) ); + var subtree = document.createElement( "dl" ); + var infos = categories[i].getElementsByTagName( 'info' ); + var j; + for( j = 0; j < infos.length; j++ ) + { + var subitem = document.createElement( "dt" ); + subitem.appendChild( document.createTextNode( infos[j].getAttribute( 'name' ) ) ); + subtree.appendChild( subitem ); + if( infos[j].hasChildNodes() ) + { + var subitem = document.createElement( "dd" ); + subitem.appendChild( document.createTextNode( infos[j].firstChild.data ) ); + subtree.appendChild( subitem ); + } + } + item.appendChild( subtree ); + tree.appendChild( item ); + } + var infotree = document.getElementById('infotree' ); + clear_children( infotree ); + infotree.appendChild( tree ); + } else { diff --git a/share/http/js/vlm.js b/share/http/js/vlm.js index f5ffb520d9..69e73dcab9 100644 --- a/share/http/js/vlm.js +++ b/share/http/js/vlm.js @@ -260,13 +260,6 @@ function clear_vlm_add() document.getElementById( 'vlm_vod_name' ).value = ""; } -function clear_children( elt ) -{ - if( elt ) - while( elt.hasChildNodes() ) - elt.removeChild( elt.firstChild ); -} - function create_button( caption, action ) { var link = document.createElement( "input" ); @@ -409,6 +402,7 @@ function parse_vlm_elements() text.setAttribute( 'type', 'text' ); text.setAttribute( 'size', '40' ); text.setAttribute( 'id', 'vlm_elt_'+elt.getAttribute('name')+'_input' ); + text.setAttribute( 'onkeypress', 'if( event.keyCode == 13 ) vlm_add_input("'+elt.getAttribute('name')+'",document.getElementById("vlm_elt_'+elt.getAttribute('name')+'_input").value );' ); item.appendChild( text ); item.appendChild( document.createTextNode( ' ' ) ); item.appendChild( create_button( 'Edit', 'vlm_input_edit("vlm_elt_'+elt.getAttribute('name')+'_input");') ); @@ -419,7 +413,7 @@ function parse_vlm_elements() if( inputs.length > 0 ) { var ilist = document.createElement( "ol" ); - ilist.setAttribute( 'start', '0' ); + ilist.setAttribute( 'start', '1' ); item.appendChild( ilist ); for( i = 0; i < inputs.length; i++ ) { @@ -447,6 +441,7 @@ function parse_vlm_elements() text.setAttribute( 'type', 'text' ); text.setAttribute( 'id', 'vlm_elt_'+elt.getAttribute('name')+'_output' ); text.setAttribute( 'value', output ); + text.setAttribute( 'onkeypress', 'if( event.keyCode == 13 ) vlm_output("'+elt.getAttribute( 'name' )+ '",document.getElementById("vlm_elt_'+elt.getAttribute( 'name' )+'_output").value);' ); item.appendChild( text ); item.appendChild( document.createTextNode( ' ' ) ); @@ -466,6 +461,7 @@ function parse_vlm_elements() text.setAttribute( 'type', 'text' ); text.setAttribute( 'size', '40' ); text.setAttribute( 'id', 'vlm_elt_'+elt.getAttribute('name')+'_option' ); + text.setAttribute( 'onkeypress', 'if( event.keyCode == 13 ) vlm_option("'+elt.getAttribute('name')+'",document.getElementById("vlm_elt_'+elt.getAttribute('name')+'_option").value );' ); item.appendChild( text ); item.appendChild( document.createTextNode( ' ' ) ); item.appendChild( create_button( 'Add option', 'vlm_option("'+elt.getAttribute('name')+'",document.getElementById("vlm_elt_'+elt.getAttribute('name')+'_option").value );' ) ); diff --git a/share/http/requests/status.xml b/share/http/requests/status.xml index 202fac7e22..d92bd64ab4 100644 --- a/share/http/requests/status.xml +++ b/share/http/requests/status.xml @@ -97,4 +97,13 @@ + + + "> + + "> + + + + diff --git a/share/http/style.css b/share/http/style.css index 792158083f..780528a074 100644 --- a/share/http/style.css +++ b/share/http/style.css @@ -106,6 +106,22 @@ div.list_element ul { margin: 0px; } +div#infotree ul { + padding: 0.4em; + margin: 0em; +} +div#infotree li { + font-weight: bold; + font-size: 0.8em; +} +div#infotree dl { + font-weight: normal; + padding: 0em 1em; +} +div#infotree dt { + text-decoration: underline; +} + div.pl_node { padding-left: 20px; font-style: italic; diff --git a/src/misc/vlm.c b/src/misc/vlm.c index ed2cbf6137..2220203774 100644 --- a/src/misc/vlm.c +++ b/src/misc/vlm.c @@ -1683,7 +1683,7 @@ static vlm_message_t *vlm_Show( vlm_t *vlm, vlm_media_t *media, APPEND_INPUT_INFO( "chapter", "%d", Integer ); APPEND_INPUT_INFO( "seekable", "%d", Bool ); #undef APPEND_INPUT_INFO - asprintf( &psz_tmp, "%d", p_instance->i_index ); + asprintf( &psz_tmp, "%d", p_instance->i_index + 1 ); vlm_MessageAdd( msg_instance, vlm_MessageNew( "playlistindex", psz_tmp ) ); free( psz_tmp ); vlm_MessageAdd( msg_child, msg_instance );