1 /*****************************************************************************
2 * vlm.js: VLC media player web interface
3 *****************************************************************************
4 * Copyright (C) 2005-2006 the VideoLAN team
7 * Authors: Antoine Cellerier <dionoea -at- videolan -dot- org>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
22 *****************************************************************************/
24 /* replace quotes and spaces by underscores */
25 function addunderscores( str ){ return str.replace(/\'|\"| /g, '_'); }
27 /**********************************************************************
28 * Input dialog functions
29 *********************************************************************/
31 function vlm_input_edit( dest )
33 document.getElementById( 'input_dest' ).value = dest;
37 function vlm_input_change()
39 document.getElementById( value( 'input_dest' ) ).value = value( 'input_mrl' );
41 document.getElementById( value( 'input_dest' ) ).focus();
44 function vlm_output_edit( dest )
46 document.getElementById( 'sout_dest' ).value = dest;
50 function vlm_output_change()
52 document.getElementById( value( 'sout_dest' ) ).value = value( 'sout_mrl' ).substr(6); /* substr <-> remove :sout= */
54 document.getElementById( value( 'sout_dest' ) ).focus();
57 function hide_vlm_add()
59 document.getElementById( 'vlm_add_broadcast' ).style.display = 'none';
60 document.getElementById( 'vlm_add_vod' ).style.display = 'none';
61 document.getElementById( 'vlm_add_schedule' ).style.display = 'none';
62 document.getElementById( 'vlm_add_other' ).style.display = 'none';
65 function toggle_schedule_date()
67 if( checked( 'vlm_schedule_now' ) )
69 disable( 'vlm_schedule_year' );
70 disable( 'vlm_schedule_month' );
71 disable( 'vlm_schedule_day' );
72 disable( 'vlm_schedule_hour' );
73 disable( 'vlm_schedule_minute' );
74 disable( 'vlm_schedule_second' );
78 enable( 'vlm_schedule_year' );
79 enable( 'vlm_schedule_month' );
80 enable( 'vlm_schedule_day' );
81 enable( 'vlm_schedule_hour' );
82 enable( 'vlm_schedule_minute' );
83 enable( 'vlm_schedule_second' );
87 function toggle_schedule_repeat()
89 if( checked( 'vlm_schedule_repeat' ) )
91 enable( 'vlm_schedule_period_year' );
92 enable( 'vlm_schedule_period_month' );
93 enable( 'vlm_schedule_period_day' );
94 enable( 'vlm_schedule_period_hour' );
95 enable( 'vlm_schedule_period_minute' );
96 enable( 'vlm_schedule_period_second' );
97 enable( 'vlm_schedule_repeat_times' );
101 disable( 'vlm_schedule_period_year' );
102 disable( 'vlm_schedule_period_month' );
103 disable( 'vlm_schedule_period_day' );
104 disable( 'vlm_schedule_period_hour' );
105 disable( 'vlm_schedule_period_minute' );
106 disable( 'vlm_schedule_period_second' );
107 disable( 'vlm_schedule_repeat_times' );
111 function vlm_schedule_type_change( name )
113 var act = document.getElementById( 'vlm_elt_' + name + '_action' ).value;
114 var itemname = document.getElementById( 'vlm_elt_' + name + '_name' );
115 var opt = document.getElementById( 'vlm_elt_' + name + '_opt' );
116 if( act == "play" || act == "pause" || act == "stop" )
118 itemname.style.display = "";
119 opt.style.display = "none";
121 else if( act == "seek" )
123 itemname.style.display = "";
124 opt.style.display = "";
128 itemname.style.display = "none";
129 opt.style.display = "";
133 function update_vlm_add_broadcast()
135 var cmd = document.getElementById( 'vlm_command' );
137 if( value( 'vlm_broadcast_name' ) )
139 cmd.value = "new " + addunderscores( value( 'vlm_broadcast_name' ) )
142 if( checked( 'vlm_broadcast_enabled' ) )
144 cmd.value += " enabled";
147 if( checked( 'vlm_broadcast_loop' ) )
149 cmd.value += " loop";
152 if( value( 'vlm_broadcast_input' ) )
154 cmd.value += " input " + value( 'vlm_broadcast_input' );
157 if( value( 'vlm_broadcast_output' ) )
159 cmd.value += " output " + value( 'vlm_broadcast_output' );
168 function update_vlm_add_vod()
170 var cmd = document.getElementById( 'vlm_command' );
172 if( value( 'vlm_vod_name' ) )
174 cmd.value = "new " + addunderscores( value( 'vlm_vod_name' ) )
177 if( checked( 'vlm_vod_enabled' ) )
179 cmd.value += " enabled";
182 if( value( 'vlm_vod_input' ) )
184 cmd.value += " input " + value( 'vlm_vod_input' );
187 if( value( 'vlm_vod_output' ) )
189 cmd.value += " output " + value( 'vlm_vod_output' );
198 function update_vlm_add_schedule()
200 var cmd = document.getElementById( 'vlm_command' );
202 check_and_replace_int( 'vlm_schedule_year', '0000' );
203 check_and_replace_int( 'vlm_schedule_month', '00' );
204 check_and_replace_int( 'vlm_schedule_day', '00' );
205 check_and_replace_int( 'vlm_schedule_hour', '00' );
206 check_and_replace_int( 'vlm_schedule_minute', '00' );
207 check_and_replace_int( 'vlm_schedule_second', '00' );
208 check_and_replace_int( 'vlm_schedule_period_year', '0000' );
209 check_and_replace_int( 'vlm_schedule_period_month', '00' );
210 check_and_replace_int( 'vlm_schedule_period_day', '00' );
211 check_and_replace_int( 'vlm_schedule_period_hour', '00' );
212 check_and_replace_int( 'vlm_schedule_period_minute', '00' );
213 check_and_replace_int( 'vlm_schedule_period_second', '00' );
215 if( value( 'vlm_schedule_name' ) )
217 cmd.value = "new " + addunderscores( value( 'vlm_schedule_name' ) ) + " schedule";
219 if( checked( 'vlm_schedule_enabled' ) )
221 cmd.value += " enabled";
224 if( checked( 'vlm_schedule_now' ) )
226 cmd.value += " date now";
230 cmd.value += " date " + value( 'vlm_schedule_year' ) + "/" + value( 'vlm_schedule_month' ) + "/" + value( 'vlm_schedule_day' ) + '-' + value( 'vlm_schedule_hour' ) + ':' + value( 'vlm_schedule_minute' ) + ':' + value( 'vlm_schedule_second' );
233 if( checked( 'vlm_schedule_repeat' ) )
235 cmd.value += " period " + value( 'vlm_schedule_period_year' ) + "/" + value( 'vlm_schedule_period_month' ) + "/" + value( 'vlm_schedule_period_day' ) + '-' + value( 'vlm_schedule_period_hour' ) + ':' + value( 'vlm_schedule_period_minute' ) + ':' + value( 'vlm_schedule_period_second' );
237 if( value( 'vlm_schedule_repeat_times' ) != 0 )
239 cmd.value += " repeat " + (value( 'vlm_schedule_repeat_times' ) - 1 );
250 function update_vlm_add_other()
252 var cmd = document.getElementById( 'vlm_command' );
256 function clear_vlm_add()
258 document.getElementById( 'vlm_command' ).value = "";
259 document.getElementById( 'vlm_broadcast_name' ).value = "";
260 document.getElementById( 'vlm_vod_name' ).value = "";
263 function create_button( caption, action )
265 var link = document.createElement( "input" );
266 link.setAttribute( 'type', 'button' );
267 link.setAttribute( 'onclick', action );
268 link.setAttribute( 'value', caption );
271 function create_option( caption, value )
273 var opt = document.createElement( 'option' );
274 opt.setAttribute( 'value', value );
275 opt.appendChild( document.createTextNode( caption ) );
279 function parse_vlm_cmd()
281 if( req.readyState == 4 )
283 if( req.status == 200 )
285 var vlm_answer = req.responseXML.documentElement;
286 var error_tag = vlm_answer.getElementsByTagName( 'error' )[0];
287 var vlme = document.getElementById( 'vlm_error' );
288 clear_children( vlme );
289 if( error_tag.hasChildNodes() )
291 vlme.appendChild( document.createTextNode( 'Error: ' + error_tag.firstChild.data ) );
292 vlme.style.color = "#f00";
296 vlme.appendChild( document.createTextNode( 'Command succesful (' + value( 'vlm_command' ) + ') ' ) );
297 vlme.style.color = "#0f0";
300 vlme.appendChild( create_button( 'clear', 'clear_children( document.getElementById( "vlm_error" ) );' ) );
307 function parse_vlm_elements()
309 if( req.readyState == 4 )
311 if( req.status == 200 )
313 var vlmb = document.getElementById( 'vlm_broadcast_list' );
314 var vlmv = document.getElementById( 'vlm_vod_list' );
315 var vlms = document.getElementById( 'vlm_schedule_list' );
317 clear_children( vlmb );
318 clear_children( vlmv );
319 clear_children( vlms );
321 answer = req.responseXML.documentElement;
323 var elt = answer.firstChild;
327 if( elt.nodeName == "broadcast" || elt.nodeName == "vod" )
329 var nb = document.createElement( 'div' );
330 nb.setAttribute( 'class', 'list_element' );
331 if( elt.nodeName == "broadcast" )
333 vlmb.appendChild( nb );
337 vlmv.appendChild( nb );
339 var nbname = document.createElement( 'b' );
340 nbname.appendChild( document.createTextNode( elt.getAttribute( 'name' ) ) );
341 nb.appendChild( nbname );
343 var link = document.createElement( 'input' );
344 link.setAttribute( 'type', 'button' );
345 if( elt.getAttribute( 'enabled' ) == 'yes' )
347 nb.appendChild( document.createTextNode( " enabled " ) );
348 link.setAttribute( 'onclick', 'vlm_disable("'+elt.getAttribute( 'name' ) + '");' );
349 link.setAttribute( 'value', "Disable" );
353 nb.appendChild( document.createTextNode( " disabled " ) );
354 link.setAttribute( 'onclick', 'vlm_enable("'+elt.getAttribute( 'name' ) + '");' );
355 link.setAttribute( 'value', "Enable" );
357 nb.appendChild( link );
359 if( elt.nodeName == "broadcast" )
361 link = document.createElement( 'input' );
362 link.setAttribute( 'type', 'button' );
363 if( elt.getAttribute( 'loop' ) == 'yes' )
365 nb.appendChild( document.createTextNode( " loop " ) );
367 link.setAttribute( 'onclick', 'vlm_unloop("'+elt.getAttribute( 'name' ) + '");' );
368 link.setAttribute( 'value', "Un-loop" );
372 nb.appendChild( document.createTextNode( " play once " ) );
374 link.setAttribute( 'onclick', 'vlm_loop("'+elt.getAttribute( 'name' ) + '");' );
375 link.setAttribute( 'value', "Loop" );
377 nb.appendChild( link );
379 if( elt.getAttribute( 'enabled' ) == 'yes' )
381 nb.appendChild( document.createTextNode( " " ) );
382 nb.appendChild( create_button( 'Play', 'vlm_play("'+elt.getAttribute('name')+'");' ) );
385 nb.appendChild( document.createTextNode( " " ) );
386 nb.appendChild( create_button( 'Pause', 'vlm_pause("'+elt.getAttribute('name')+'");' ) );
388 nb.appendChild( document.createTextNode( " " ) );
389 nb.appendChild( create_button( 'Stop', 'vlm_stop("'+elt.getAttribute('name')+'");' ) );
392 nb.appendChild( document.createTextNode( " " ) );
393 nb.appendChild( create_button( 'Delete', 'vlm_delete("'+elt.getAttribute( 'name' ) + '");' ) );
395 var list = document.createElement( "ul" );
397 /* begin input list */
398 var item = document.createElement( "li" );
399 list.appendChild( item );
400 item.appendChild( document.createTextNode( "Inputs: " ) );
401 var text = document.createElement( "input" );
402 text.setAttribute( 'type', 'text' );
403 text.setAttribute( 'size', '40' );
404 text.setAttribute( 'id', 'vlm_elt_'+elt.getAttribute('name')+'_input' );
405 text.setAttribute( 'onkeypress', 'if( event.keyCode == 13 ) vlm_add_input("'+elt.getAttribute('name')+'",document.getElementById("vlm_elt_'+elt.getAttribute('name')+'_input").value );' );
406 item.appendChild( text );
407 item.appendChild( document.createTextNode( ' ' ) );
408 item.appendChild( create_button( 'Edit', 'vlm_input_edit("vlm_elt_'+elt.getAttribute('name')+'_input");') );
409 item.appendChild( document.createTextNode( ' ' ) );
410 item.appendChild( create_button( 'Add input', 'vlm_add_input("'+elt.getAttribute('name')+'",document.getElementById("vlm_elt_'+elt.getAttribute('name')+'_input").value );' ) );
412 var inputs = elt.getElementsByTagName( 'input' );
413 if( inputs.length > 0 )
415 var ilist = document.createElement( "ol" );
416 ilist.setAttribute( 'start', '1' );
417 item.appendChild( ilist );
418 for( i = 0; i < inputs.length; i++ )
420 var item = document.createElement( "li" );
421 item.appendChild( document.createTextNode( inputs[i].firstChild.data + " " ) );
422 item.appendChild( create_button( "Delete", 'vlm_delete_input("' + elt.getAttribute( 'name' ) + '", '+(i+1)+' );' ) );
423 ilist.appendChild( item );
426 /* end of input list */
429 var item = document.createElement( "li" );
430 outputelt = elt.getElementsByTagName( 'output' )[0];
431 if( outputelt.hasChildNodes() )
433 output = outputelt.firstChild.data;
439 item.appendChild( document.createTextNode( 'Output: ' ) );
440 var text = document.createElement( "input" );
441 text.setAttribute( 'type', 'text' );
442 text.setAttribute( 'id', 'vlm_elt_'+elt.getAttribute('name')+'_output' );
443 text.setAttribute( 'value', output );
444 text.setAttribute( 'onkeypress', 'if( event.keyCode == 13 ) vlm_output("'+elt.getAttribute( 'name' )+ '",document.getElementById("vlm_elt_'+elt.getAttribute( 'name' )+'_output").value);' );
445 item.appendChild( text );
447 item.appendChild( document.createTextNode( ' ' ) );
449 item.appendChild( create_button( 'Edit', 'vlm_output_edit("vlm_elt_'+elt.getAttribute('name')+'_output");' ) );
450 item.appendChild( document.createTextNode( ' ' ) );
451 item.appendChild( create_button( 'Change output', 'vlm_output("'+elt.getAttribute( 'name' )+ '",document.getElementById("vlm_elt_'+elt.getAttribute( 'name' )+'_output").value);' ) );
452 list.appendChild( item );
455 /* begin options list */
456 var item = document.createElement( "li" );
457 list.appendChild( item );
458 item.appendChild( document.createTextNode( "Options: " ) );
460 var text = document.createElement( "input" );
461 text.setAttribute( 'type', 'text' );
462 text.setAttribute( 'size', '40' );
463 text.setAttribute( 'id', 'vlm_elt_'+elt.getAttribute('name')+'_option' );
464 text.setAttribute( 'onkeypress', 'if( event.keyCode == 13 ) vlm_option("'+elt.getAttribute('name')+'",document.getElementById("vlm_elt_'+elt.getAttribute('name')+'_option").value );' );
465 item.appendChild( text );
466 item.appendChild( document.createTextNode( ' ' ) );
467 item.appendChild( create_button( 'Add option', 'vlm_option("'+elt.getAttribute('name')+'",document.getElementById("vlm_elt_'+elt.getAttribute('name')+'_option").value );' ) );
469 var options = elt.getElementsByTagName( 'option' );
470 if( options.length > 0 )
472 var olist = document.createElement( "ul" );
473 item.appendChild( olist );
474 for( i = 0; i < options.length; i++ )
476 var item = document.createElement( "li" );
477 item.appendChild( document.createTextNode( options[i].firstChild.data ) );
478 olist.appendChild( item );
484 var instances = elt.getElementsByTagName( 'instance' );
485 if( instances.length > 0 )
487 var item = document.createElement("li");
488 var ilist = document.createElement("ul");
489 list.appendChild( item );
490 item.appendChild(document.createTextNode("Instances:"));
491 item.appendChild( ilist );
492 for( i = 0; i < instances.length; i++ )
494 var iname = instances[i].getAttribute( 'name' );
495 var istate = instances[i].getAttribute( 'state' );
496 var iposition = Number( instances[i].getAttribute( 'position' ) * 100);
497 var itime = Math.floor( instances[i].getAttribute( 'time' ) / 1000000);
498 var ilength = Math.floor( instances[i].getAttribute( 'length' ) / 1000000);
499 var irate = instances[i].getAttribute( 'rate' );
500 var ititle = instances[i].getAttribute( 'title' );
501 var ichapter = instances[i].getAttribute( 'chapter' );
502 var iseekable = instances[i].getAttribute( 'seekable' );
503 var iplaylistindex = instances[i].getAttribute( 'playlistindex' );
505 var item = document.createElement( "li" );
506 item.appendChild( document.createTextNode( iname + ": " + istate + " (" + iplaylistindex + ") " + (iposition.toFixed(2)) + "%" + " " + format_time( itime ) + "/" + format_time( ilength ) ) );
507 ilist.appendChild( item );
510 /* end of instances list */
512 nb.appendChild( list );
515 else if( elt.nodeName == "schedule" )
517 var nb = document.createElement( 'div' );
518 nb.setAttribute( 'class', 'list_element' );
519 vlms.appendChild( nb );
521 var nbname = document.createElement( 'b' );
522 nbname.appendChild( document.createTextNode( elt.getAttribute( 'name' ) ) );
523 nb.appendChild( nbname );
525 var link = document.createElement( 'input' );
526 link.setAttribute( 'type', 'button' );
527 if( elt.getAttribute( 'enabled' ) == 'yes' )
529 nb.appendChild( document.createTextNode( " enabled " ) );
530 link.setAttribute( 'onclick', 'vlm_disable("'+elt.getAttribute( 'name' ) + '");' );
531 link.setAttribute( 'value', "Disable" );
535 nb.appendChild( document.createTextNode( " disabled " ) );
536 link.setAttribute( 'onclick', 'vlm_enable("'+elt.getAttribute( 'name' ) + '");' );
537 link.setAttribute( 'value', "Enable" );
539 nb.appendChild( link );
541 nb.appendChild( document.createTextNode( " " ) );
542 nb.appendChild( create_button( "Delete", 'vlm_delete("'+elt.getAttribute( 'name' ) + '");' ) );
544 var list = document.createElement( 'ul' );
546 var item = document.createElement( 'li' );
547 item.appendChild( document.createTextNode( "Date: " + elt.getAttribute( 'date' ) ) );
548 list.appendChild( item );
550 var item = document.createElement( 'li' );
551 item.appendChild( document.createTextNode( "Period (in seconds): " + elt.getAttribute( 'period' ) ) );
552 list.appendChild( item );
554 var item = document.createElement( 'li' );
555 if( elt.getAttribute( 'repeat' ) == -1 )
557 item.appendChild( document.createTextNode( "Number of repeats left: for ever" ) );
561 item.appendChild( document.createTextNode( "Number of repeats left: " + elt.getAttribute( 'repeat' ) ) );
563 list.appendChild( item );
565 var commands = elt.getElementsByTagName( 'command' );
566 for( i = 0; i < commands.length; i++ )
568 var item = document.createElement( "li" );
569 item.appendChild( document.createTextNode( "Command: " + commands[i].firstChild.data + " " ) );
570 list.appendChild( item );
573 var item = document.createElement( 'li' );
574 var sel = document.createElement( 'select' );
575 sel.setAttribute( 'id', 'vlm_elt_'+elt.getAttribute('name')+'_action' );
576 sel.setAttribute( 'onchange', 'vlm_schedule_type_change("'+elt.getAttribute('name')+'");');
577 sel.appendChild( create_option( 'play', 'play' ) );
578 sel.appendChild( create_option( 'pause', 'pause' ) );
579 sel.appendChild( create_option( 'stop', 'stop' ) );
580 sel.appendChild( create_option( 'seek', 'seek' ) );
581 sel.appendChild( create_option( '(other)', '' ) );
582 item.appendChild( sel );
584 item.appendChild( document.createTextNode( " " ) );
585 var text = document.createElement( 'input' );
586 text.setAttribute( 'type', 'text' );
587 text.setAttribute( 'id', 'vlm_elt_'+elt.getAttribute('name')+'_name' );
588 text.setAttribute( 'size', '10' );
589 text.setAttribute( 'value', '(name)' );
590 text.setAttribute( 'onfocus', 'if( this.value == "(name)" ) this.value = "";' );
591 text.setAttribute( 'onblur', 'if( this.value == "" ) this.value = "(name)";' );
592 item.appendChild( text );
594 item.appendChild( document.createTextNode( " " ) );
595 text = document.createElement( 'input' );
596 text.setAttribute( 'type', 'text' );
597 text.setAttribute( 'id', 'vlm_elt_'+elt.getAttribute('name')+'_opt' );
598 text.setAttribute( 'size', '30' );
599 text.setAttribute( 'value', '(options)' );
600 text.setAttribute( 'onfocus', 'if( this.value == "(options)" ) this.value = "";' );
601 text.setAttribute( 'onblur', 'if( this.value == "" ) this.value = "(options)";' );
602 item.appendChild( text );
603 item.appendChild( document.createTextNode( " " ) );
604 item.appendChild( create_button( "Append command", 'vlm_schedule_append("' + elt.getAttribute( 'name' ) + '");') );
606 list.appendChild( item );
608 nb.appendChild( list );
609 vlm_schedule_type_change( elt.getAttribute('name') );
612 elt = elt.nextSibling;
618 function vlm_cmd( cmd )
620 loadXMLDoc( 'requests/vlm_cmd.xml?command='+cmd.replace(/\#/g, '%23'), parse_vlm_cmd );
623 function vlm_get_elements( )
625 loadXMLDoc( 'requests/vlm.xml', parse_vlm_elements );
628 /* helper functions */
630 function vlm_disable( name )
632 document.getElementById( 'vlm_command' ).value = "setup "+name+" disabled";
633 vlm_cmd( value( 'vlm_command' ) );
636 function vlm_enable( name )
638 document.getElementById( 'vlm_command' ).value = "setup "+name+" enabled";
639 vlm_cmd( value( 'vlm_command' ) );
642 function vlm_loop( name )
644 document.getElementById( 'vlm_command' ).value = "setup "+name+" loop";
645 vlm_cmd( value( 'vlm_command' ) );
648 function vlm_unloop( name )
650 document.getElementById( 'vlm_command' ).value = "setup "+name+" unloop";
651 vlm_cmd( value( 'vlm_command' ) );
654 function vlm_play( name )
656 document.getElementById( 'vlm_command' ).value = "control "+name+" play";
657 vlm_cmd( value( 'vlm_command' ) );
660 function vlm_pause( name )
662 document.getElementById( 'vlm_command' ).value = "control "+name+" pause";
663 vlm_cmd( value( 'vlm_command' ) );
666 function vlm_stop( name )
668 document.getElementById( 'vlm_command' ).value = "control "+name+" stop";
669 vlm_cmd( value( 'vlm_command' ) );
672 function vlm_delete( name )
674 document.getElementById( 'vlm_command' ).value = "del "+name;
675 vlm_cmd( value( 'vlm_command' ) );
678 function vlm_delete_input( name, num )
680 document.getElementById( 'vlm_command' ).value = "setup "+name+" inputdeln "+num;
681 vlm_cmd( value( 'vlm_command' ) );
684 function vlm_add_input( name, input )
686 document.getElementById( 'vlm_command' ).value = "setup "+name+" input "+input;
687 vlm_cmd( value( 'vlm_command' ) );
690 function vlm_output( name, output )
692 document.getElementById( 'vlm_command' ).value = "setup "+name+" output "+output;
693 vlm_cmd( value( 'vlm_command' ) );
696 function vlm_option( name, option )
698 document.getElementById( 'vlm_command' ).value = "setup "+name+" option "+option;
699 vlm_cmd( value( 'vlm_command' ) );
702 function vlm_batch( batch )
705 var commands = batch.split( '\n' );
706 for( i = 0; i < commands.length; i++ )
708 document.getElementById( 'vlm_command' ).value = commands[i];
709 vlm_cmd( value( 'vlm_command' ) );
713 function vlm_schedule_append( name )
715 var act = document.getElementById( 'vlm_elt_' + name + '_action' ).value;
716 document.getElementById( 'vlm_command' ).value = "setup " + name + " append ";
718 var itemname = document.getElementById( 'vlm_elt_' + name + '_name' ).value;
719 if( itemname == "(name)" ) itemname = "";
721 var opt = document.getElementById( 'vlm_elt_' + name + '_opt' ).value;
722 if( opt == "(options)" ) opt = "";
726 document.getElementById( 'vlm_command' ).value += opt;
730 document.getElementById( 'vlm_command' ).value += 'control ' + itemname + " " + act + " " + opt;
732 vlm_cmd( value( 'vlm_command' ) );
736 vlm_cmd( value( 'vlm_command' ) );