* Input dialog functions
*********************************************************************/
+function toggle_show_vlm_helper()
+{
+ var vlmh = document.getElementById( "vlm_helper" );
+ var vlmhctrl = document.getElementById( "vlm_helper_controls" );
+ var btn = document.getElementById( "btn_vlm_helper_toggle" );
+ if( vlmh.style.display == 'block' || vlmh.style.display == '')
+ {
+ vlmh.style.display = 'none';
+ vlmhctrl.style.display = 'none';
+ btn.removeChild( btn.firstChild );
+ btn.appendChild( document.createTextNode( 'Show VLM helper' ) );
+ }
+ else
+ {
+ vlmh.style.display = 'block';
+ vlmhctrl.style.display = 'inline';
+ btn.removeChild( btn.firstChild );
+ btn.appendChild( document.createTextNode( 'Hide VLM helper' ) );
+ }
+}
+
function vlm_input_edit( dest )
{
document.getElementById( 'input_dest' ).value = dest;
function vlm_input_change()
{
- document.getElementById( value( 'input_dest' ) ).value = value( 'input_mrl' );
+ document.getElementById( value( 'input_dest' ) ).value = value( 'input_mrl' ).replace( /\ :/g, " option " );
hide( 'input' );
document.getElementById( value( 'input_dest' ) ).focus();
}
function vlm_output_change()
{
- document.getElementById( value( 'sout_dest' ) ).value = value( 'sout_mrl' ).substr(6); /* substr <-> remove :sout= */
+ document.getElementById( value( 'sout_dest' ) ).value = value( 'sout_mrl' ).substr(6).replace( /\ :/g, " option " ); /* substr <-> remove :sout= */
hide( 'sout' );
document.getElementById( value( 'sout_dest' ) ).focus();
}
function create_button( caption, action )
{
- var link = document.createElement( "input" );
- link.setAttribute( 'type', 'button' );
- link.setAttribute( 'onclick', action );
- link.setAttribute( 'value', caption );
+/* var link = document.createElement( "input" );
+ link.setAttribute( 'type', 'button' );*/
+ /* link.setAttribute( 'onclick', action ); */
+ /* Above doesn't work on ie. You need to use something like
+ * link.onclick = function() { alert( 'pouet' ); };
+ * instead ... conclusion: IE is crap */
+ /* link.setAttribute( 'value', caption );*/
+
+ var d = document.createElement( 'div' );
+ d.innerHTML = "<input type='button' onclick='"+action+"' value='"+caption+"' />"; /* other IE work around ... still crap. Use double quotes only in action */
+ var link = d.firstChild;
return link;
}
function create_option( caption, value )
if( elt.nodeName == "broadcast" || elt.nodeName == "vod" )
{
var nb = document.createElement( 'div' );
- nb.setAttribute( 'class', 'list_element' );
+ setclass( nb, 'list_element' );
if( elt.nodeName == "broadcast" )
{
vlmb.appendChild( nb );
nbname.appendChild( document.createTextNode( elt.getAttribute( 'name' ) ) );
nb.appendChild( nbname );
- var link = document.createElement( 'input' );
- link.setAttribute( 'type', 'button' );
if( elt.getAttribute( 'enabled' ) == 'yes' )
{
nb.appendChild( document.createTextNode( " enabled " ) );
- link.setAttribute( 'onclick', 'vlm_disable("'+elt.getAttribute( 'name' ) + '");' );
- link.setAttribute( 'value', "Disable" );
+ nb.appendChild( create_button( "Disable", 'vlm_disable("'+elt.getAttribute( 'name' ) + '");' ) );
}
else
{
nb.appendChild( document.createTextNode( " disabled " ) );
- link.setAttribute( 'onclick', 'vlm_enable("'+elt.getAttribute( 'name' ) + '");' );
- link.setAttribute( 'value', "Enable" );
+ nb.appendChild( create_button( "Enable", 'vlm_enable("'+elt.getAttribute( 'name' ) + '");' ) );
}
- nb.appendChild( link );
if( elt.nodeName == "broadcast" )
{
- link = document.createElement( 'input' );
- link.setAttribute( 'type', 'button' );
if( elt.getAttribute( 'loop' ) == 'yes' )
{
nb.appendChild( document.createTextNode( " loop " ) );
- link.setAttribute( 'onclick', 'vlm_unloop("'+elt.getAttribute( 'name' ) + '");' );
- link.setAttribute( 'value', "Un-loop" );
+ nb.appendChild( create_button( 'Un-loop', 'vlm_unloop("'+elt.getAttribute( 'name' ) + '");' ) );
}
else
{
nb.appendChild( document.createTextNode( " play once " ) );
+ nb.appendChild( create_button( 'Loop', 'vlm_loop("'+elt.getAttribute( 'name' ) + '");' ) );
- link.setAttribute( 'onclick', 'vlm_loop("'+elt.getAttribute( 'name' ) + '");' );
- link.setAttribute( 'value', "Loop" );
}
- nb.appendChild( link );
if( elt.getAttribute( 'enabled' ) == 'yes' )
{
else if( elt.nodeName == "schedule" )
{
var nb = document.createElement( 'div' );
- nb.setAttribute( 'class', 'list_element' );
+ setclass( nb, 'list_element' );
vlms.appendChild( nb );
var nbname = document.createElement( 'b' );
nbname.appendChild( document.createTextNode( elt.getAttribute( 'name' ) ) );
nb.appendChild( nbname );
- var link = document.createElement( 'input' );
- link.setAttribute( 'type', 'button' );
if( elt.getAttribute( 'enabled' ) == 'yes' )
{
nb.appendChild( document.createTextNode( " enabled " ) );
- link.setAttribute( 'onclick', 'vlm_disable("'+elt.getAttribute( 'name' ) + '");' );
- link.setAttribute( 'value', "Disable" );
+ nb.appendChild( create_button( "Disable", 'vlm_disable("'+elt.getAttribute( 'name' ) + '");' ) );
}
else
{
nb.appendChild( document.createTextNode( " disabled " ) );
- link.setAttribute( 'onclick', 'vlm_enable("'+elt.getAttribute( 'name' ) + '");' );
- link.setAttribute( 'value', "Enable" );
+ nb.appendChild( create_button( "Enable", 'vlm_enable("'+elt.getAttribute( 'name' ) + '");' ) );
}
- nb.appendChild( link );
nb.appendChild( document.createTextNode( " " ) );
nb.appendChild( create_button( "Delete", 'vlm_delete("'+elt.getAttribute( 'name' ) + '");' ) );