Commit 735a0a47 authored by Felix Paul Kühne's avatar Felix Paul Kühne

lua/http: remove remnants of the first generation http interface which weren't used in years

parent 14f35fd3
......@@ -259,60 +259,17 @@ DIST_http_lua = \
lua/http/dialogs/stream_window.html \
lua/http/dialogs/offset_window.html \
lua/http/dialogs/stream_config_window.html \
lua/http/dialogs/old/browse \
lua/http/dialogs/old/footer \
lua/http/dialogs/old/input \
lua/http/dialogs/old/main \
lua/http/dialogs/old/playlist \
lua/http/dialogs/old/sout \
lua/http/dialogs/old/vlm \
lua/http/custom.lua \
lua/http/vlm.html \
lua/http/old/images/loop.png \
lua/http/images/buttons.png \
lua/http/images/speaker-32.png \
lua/http/old/images/fullscreen.png \
lua/http/images/vlc-48.png \
lua/http/old/images/prev.png \
lua/http/old/images/play.png \
lua/http/images/Audio-48.png \
lua/http/old/images/empty.png \
lua/http/old/images/minus.png \
lua/http/old/images/slider_right.png \
lua/http/old/images/slider_point.png \
lua/http/old/images/pause.png \
lua/http/old/images/speaker_mute.png \
lua/http/old/images/delete_small.png \
lua/http/old/images/snapshot.png \
lua/http/images/Folder-48.png \
lua/http/old/images/info.png \
lua/http/old/images/refresh.png \
lua/http/old/images/sout.png \
lua/http/old/images/sort.png \
lua/http/old/images/white_cross_small.png \
lua/http/old/images/shuffle.png \
lua/http/images/Other-48.png \
lua/http/old/images/repeat.png \
lua/http/old/images/slow.png \
lua/http/old/images/slider_left.png \
lua/http/old/images/help.png \
lua/http/old/images/stop.png \
lua/http/old/images/sd.png \
lua/http/old/images/speaker.png \
lua/http/old/images/delete.png \
lua/http/images/Back-48.png \
lua/http/images/Video-48.png \
lua/http/old/images/playlist_small.png \
lua/http/old/images/eject.png \
lua/http/old/images/playlist.png \
lua/http/old/images/volume_up.png \
lua/http/old/images/next.png \
lua/http/old/images/volume_down.png \
lua/http/old/images/slider_bar.png \
lua/http/images/vlc16x16.png \
lua/http/old/images/plus.png \
lua/http/old/images/white.png \
lua/http/old/images/reset.png \
lua/http/mobile_equalizer.html \
lua/http/vlm_export.html \
lua/http/mobile_browse.html \
......@@ -346,13 +303,10 @@ DIST_http_lua = \
lua/http/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png \
lua/http/css/main.css \
lua/http/css/mobile.css \
lua/http/old/js/functions.js \
lua/http/old/js/vlm.js \
lua/http/js/ui.js \
lua/http/js/common.js \
lua/http/js/jquery.jstree.js \
lua/http/js/controllers.js \
lua/http/old/style.css
lua/http/js/controllers.js
DIST_solid = \
solid/vlc-openbd.desktop \
......
<?vlc --[[
vim:syntax=html
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >
< browse: VLC media player web interface - remote file browse dialog
< - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >
< Copyright (C) 2005-2006 the VideoLAN team
< $Id$
<
< Authors: Antoine Cellerier <dionoea -at- videolan -dot- org>
<
< This program is free software; you can redistribute it and/or modify
< it under the terms of the GNU General Public License as published by
< the Free Software Foundation; either version 2 of the License, or
< (at your option) any later version.
<
< This program is distributed in the hope that it will be useful,
< but WITHOUT ANY WARRANTY; without even the implied warranty of
< MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
< GNU General Public License for more details.
<
< You should have received a copy of the GNU General Public License
< along with this program; if not, write to the Free Software
< Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
< - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
This dialog needs the following dialogs to be fully functional: <none>
]]?>
<div id="browse" class="popup" style="display: none;">
<div class="title">
Browse
<img class="close" src="old/images/white_cross_small.png" alt="Close" onclick="hide('browse');"/>
</div>
<div id="browser">
<a href="javascript:browse_dir(document.getElementById( 'browse_lastdir' ).value);">Click here to browse</a>
( or <a href="javascript:browse_dir('');">here</a> if it doesn't work )
</div>
<div class="controls">
<button id="btn_browse_close" onclick="hide('browse');">
Close
</button>
<input type="hidden" id="browse_lastdir" value="~" />
<input type="hidden" id="browse_dest" value="" />
</div>
</div>
<?vlc --[[
vim:syntax=html
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >
< footer: VLC media player web interface - VLC copyright footer
< - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >
< Copyright (C) 2005-2006 the VideoLAN team
< $Id$
<
< Authors: Antoine Cellerier <dionoea -at- videolan -dot- org>
<
< This program is free software; you can redistribute it and/or modify
< it under the terms of the GNU General Public License as published by
< the Free Software Foundation; either version 2 of the License, or
< (at your option) any later version.
<
< This program is distributed in the hope that it will be useful,
< but WITHOUT ANY WARRANTY; without even the implied warranty of
< MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
< GNU General Public License for more details.
<
< You should have received a copy of the GNU General Public License
< along with this program; if not, write to the Free Software
< Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
< - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
This dialog needs the following dialogs to be fully functional: <none>
]]?>
<div id="footer" class="dialog" >
<a href="/">main VLC interface</a> -
<a href="/vlm.html">VLM interface</a> -
<a href="http://www.videolan.org">VideoLAN website</a>
<br />
<?vlc print(vlc.misc.version() .. " - Lua Web Interface - " .. vlc.misc.copyright()) ?>
</div>
<?vlc --[[
vim:syntax=html
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >
< input: VLC media player web interface - input selection dialog
< - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >
< Copyright (C) 2005-2006 the VideoLAN team
< $Id$
<
< Authors: Antoine Cellerier <dionoea -at- videolan -dot- org>
<
< This program is free software; you can redistribute it and/or modify
< it under the terms of the GNU General Public License as published by
< the Free Software Foundation; either version 2 of the License, or
< (at your option) any later version.
<
< This program is distributed in the hope that it will be useful,
< but WITHOUT ANY WARRANTY; without even the implied warranty of
< MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
< GNU General Public License for more details.
<
< You should have received a copy of the GNU General Public License
< along with this program; if not, write to the Free Software
< Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
< - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
This dialog needs the following dialogs to be fully functional: browse
]]?>
<div id="input" class="dialog" style="display: none">
<div class="title">
Input
<img class="close" src="old/images/white_cross_small.png" alt="Close" onclick="hide('input');"/>
</div>
<div class="controls">
<label for="input_mrl">Input</label>
<?vlc if current_page == "vlm" then ?>
<input type="text" name="input_mrl" id="input_mrl" size="60" onkeypress="if( event.keyCode == 13 ) vlm_input_change();"/>
<?vlc else ?>
<input type="text" name="input_mrl" id="input_mrl" size="60" onkeypress="if( event.keyCode == 13 ) in_play();"/>
<?vlc end ?>
<div>
Options
<!-- <input type="button" value="Refresh options" onclick="refresh_input_options_list();" /> -->
<input type="button" value="Add option" onclick="add_input_option(':option=value');" />
<div id="input_options_list"></div>
</div>
<?vlc if current_page == "vlm" then ?>
<input type="button" value="Ok" onclick="vlm_input_change();" />
<input type="button" value="Cancel" onclick="hide('input');" />
<input type="hidden" id="input_dest" value="" />
<?vlc else ?>
<input type="button" value="Play" onclick="in_play();" />
<input type="button" value="Enqueue" onclick="in_enqueue();" />
<?vlc end ?>
<br/>
<!--<button id="btn_inhide" onclick="hide_input();">
Hide
</button>-->
<button id="btn_file" onclick="hide_input();show('input_file');update_input_file();">
File
</button>
<button id="btn_disc" onclick="hide_input();show('input_disc');update_input_disc();">
Disc
</button>
<button id="btn_network" onclick="hide_input();show('input_network');update_input_net();">
Network
</button>
<button id="btn_fake" onclick="hide_input();show('input_fake');update_input_fake();">
Fixed image
</button>
</div>
<div id="input_helper" class="helper" >
<div id="input_file" style="display: block">
Open File
<hr/>
<label for="input_file_filename">File name</label>
<input type="text" id="input_file_filename" size="60" onchange="update_input_file();" onfocus="update_input_file();"/>
<input type="button" id="input_file_browse" value="Browse" onclick="browse( 'input_file_filename' );" />
<!-- <hr/>
<input type="checkbox" id="input_sub_options" />
<label for="input_sub_options">Subtitle options *TODO/FIXME/FIXHTTPD*</label>
<br/>
<label for="input_sub_file">Subtitle file</label>
<input type="text" id="input_sub_file" size="60" />
<br/>
<label for="input_sub_enc">Subtitle encoding</label>
<select id="input_sub_enc">
<option></option>
</select>
<br/>
<label for="input_sub_size">Font size</label>
<select id="input_sub_size">
<option></option>
</select>
<label for="input_sub_justification">Justification</label>
<select id="input_sub_justification">
<option></option>
</select>
<br/>
<label for="input_sub_fps">Frames per second</label>
<input type="text" id="input_sub_fps" />
<label for="input_sub_delay">Delay</label>
<input type="text" id="input_sub_delay" />-->
</div>
<div id="input_disc" style="display: none">
Open Disc
<hr/>
Disc type :
<input type="radio" name="input_disc_type" id="input_disc_dvdmenu" value="dvd" onchange="update_input_disc();" />
<label for="input_disc_dvdmenu">DVD (menus)</label>
<input type="radio" name="input_disc_type" id="input_disc_dvd" value="dvdsimple" onchange="update_input_disc();" />
<label for="input_disc_dvd">DVD</label>
<input type="radio" name="input_disc_type" id="input_disc_vcd" value="vcd" onchange="update_input_disc();" />
<label for="input_disc_vcd">VCD</label>
<input type="radio" name="input_disc_type" id="input_disc_cdda" value="cdda" onchange="update_input_disc();" />
<label for="input_disc_cdda">Audio CD</label>
<hr/>
<table>
<tr>
<td>
<label for="input_disc_dev">Device name</label>
</td>
<td>
<input type="text" id="input_disc_dev" onchange="update_input_disc();" />
</td>
</tr>
<tr>
<td>
<label for="input_disc_title">Title</label>
</td>
<td>
<input type="text" id="input_disc_title" onchange="update_input_disc();" />
</td>
</tr>
<tr>
<td>
<label for="input_disc_chapter">Chapter</label>
</td>
<td>
<input type="text" id="input_disc_chapter" onchange="update_input_disc();" />
</td>
</tr>
<tr>
<td>
<label for="input_disc_subtrack">Subtitle track</label>
</td>
<td>
<input type="text" id="input_disc_subtrack" onchange="update_input_disc();" />
</td>
</tr>
<tr>
<td>
<label for="input_disc_audiotrack">Audio track</label>
</td>
<td>
<input type="text" id="input_disc_audiotrack" onchange="update_input_disc();" />
</td>
</tr>
</table>
</div>
<div id="input_network" style="display: none">
Open Network
<hr/>
<table>
<tr>
<td>
<input type="radio" name="input_net_type" id="input_net_udp" value="udp" onchange="update_input_net();" />
<label for="input_net_udp">UDP/RTP</label>
</td>
<td>
<label for="input_net_udp_port">Port</label>
<input type="text" id="input_net_udp_port" size="6" onchange="update_input_net();" />
</td>
</tr>
<tr>
<td>
<input type="radio" name="input_net_type" id="input_net_udpmcast" value="udpmcast" onchange="update_input_net();" />
<label for="input_net_udpmcast">UDP/RTP Multicast</label>
</td>
<td>
<label for="input_net_udpmcast_address">Address</label>
<input type="text" id="input_net_udpmcast_address" onchange="update_input_net();" />
<label for="input_net_udpmcast_port">Port</label>
<input type="text" id="input_net_udpmcast_port" size="6" onchange="update_input_net();" />
</td>
</tr>
<tr>
<td>
<input type="radio" name="input_net_type" id="input_net_http" value="http" onchange="update_input_net();" />
<label for="input_net_http">HTTP/HTTPS/FTP/MMS</label>
</td>
<td>
<label for="input_net_http_url">URL</label>
<input type="text" id="input_net_http_url" onchange="update_input_net();" />
</td>
</tr>
<tr>
<td>
<input type="radio" name="input_net_type" id="input_net_rtsp" value="rtsp" onchange="update_input_net();" />
<label for="input_net_rtsp">RTSP</label>
</td>
<td>
<label for="input_net_rtsp_url">URL</label>
<input type="text" id="input_net_rtsp_url" value="rtsp://" onchange="update_input_net();" />
</td>
</tr>
<tr>
<td>
<input type="checkbox" id="input_net_timeshift" onchange="update_input_net();" />
<label for="input_net_timeshift">Allow timeshifting</label>
</td>
<td></td>
</tr>
</table>
</div>
<div id="input_fake" style="display: none">
Fixed image stream (fake)
<hr/>
<label for="input_fake_filename">Image file name</label>
<input type="text" id="input_fake_filename" size="60" onchange="update_input_fake();" onfocus="update_input_fake();"/>
<input type="button" id="input_fake_browse" value="Browse" onclick="browse( 'input_fake_filename' );" />
<hr/>
<label for="input_fake_width">Width</label>
<input type="text" id="input_fake_width" size="8" onchange="update_input_fake();" />
<label for="input_fake_height">Height</label>
<input type="text" id="input_fake_height" size="8" onchange="update_input_fake();" />
<label for="input_fake_ar">Aspect ratio</label>
<input type="text" id="input_fake_ar" size="8" onchange="update_input_fake();" />
</div>
</div>
</div>
<?vlc --[[
vim:syntax=html
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >
< main: VLC media player web interface - main VLC controler
< - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >
< Copyright (C) 2005-2006 the VideoLAN team
< $Id$
<
< Authors: Antoine Cellerier <dionoea -at- videolan -dot- org>
<
< This program is free software; you can redistribute it and/or modify
< it under the terms of the GNU General Public License as published by
< the Free Software Foundation; either version 2 of the License, or
< (at your option) any later version.
<
< This program is distributed in the hope that it will be useful,
< but WITHOUT ANY WARRANTY; without even the implied warranty of
< MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
< GNU General Public License for more details.
<
< You should have received a copy of the GNU General Public License
< along with this program; if not, write to the Free Software
< Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
< - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
This dialog needs the following dialogs to be fully functional: input,
sout and playlist .
]]?>
<div id="main" class="dialog" >
<div class="title">
VLC media player
<button id="btn_toggle_text" onclick="toggle_btn_text();" title="Help" >
<img src="old/images/help.png" alt="Help" />
Help
</button>
</div>
<div class="controls">
<button id="btn_open" onclick="toggle_show('input');" onmouseover="button_over(this);" onmouseout="button_out(this);" title="Open" >
<img src="old/images/eject.png" alt="Open" />
<span class="btn_text">Open</span>
</button>
&nbsp;
<button id="btn_stop" onclick="pl_stop();" onmouseover="button_over(this);" onmouseout="button_out(this);" title="Stop" >
<img src="old/images/stop.png" alt="Stop" />
<span class="btn_text">Stop</span>
</button>
<!--<button id="btn_play" onclick="alert('FIXME');" onmouseover="button_over(this);" onmouseout="button_out(this);" title="Play" >
<img src="old/images/play.png" alt="Play" />
<span class="btn_text">Play</span>
</button>-->
<button id="btn_pause" onclick="pl_pause();" onmouseover="button_over(this);" onmouseout="button_out(this);" title="Pause" >
<img src="old/images/pause.png" alt="Pause" id="btn_pause_img" />
<span class="btn_text">Pause</span>
</button>
&nbsp;
<button id="btn_previous" onclick="pl_previous();" onmouseover="button_over(this);" onmouseout="button_out(this);" title="Previous" >
<img src="old/images/prev.png" alt="Previous" />
<span class="btn_text">Previous</span>
</button>
<button id="btn_next" onclick="pl_next();" onmouseover="button_over(this);" onmouseout="button_out(this);" title="Next" >
<img src="old/images/next.png" alt="Next" />
<span class="btn_text">Next</span>
</button>
&nbsp;
<button id="btn_sout" onclick="toggle_show('sout');" onmouseover="button_over(this);" onmouseout="button_out(this);" title="Stream Output" >
<img src="old/images/sout.png" alt="Stream Output" />
<span class="btn_text">Stream Output</span>
</button>
<button id="btn_playlist" onclick="toggle_show('playlist');" onmouseover="button_over(this);" onmouseout="button_out(this);" title="Playlist" >
<img src="old/images/playlist.png" alt="Playlist" />
<span class="btn_text">Playlist</span>
</button>
<button id="btn_info" onclick="toggle_show('info');" onmouseover="button_over(this);" onmouseout="button_out(this);" title="Info" >
<img src="old/images/info.png" alt="Info" />
<span class="btn_text">Info</span>
</button>
&nbsp;
<button id="btn_fullscreen" onclick="fullscreen();" onmouseover="button_over(this);" onmouseout="button_out(this);" title="Fullscreen" >
<img src="old/images/fullscreen.png" alt="Fullscreen" />
<span class="btn_text">Fullscreen</span>
</button>
&nbsp;
<button id="btn_snapshot" onclick="snapshot();" onmouseover="button_over(this);" onmouseout="button_out(this);" title="Take video snapshot" >
<img src="old/images/snapshot.png" alt="Take video snapshot" />
<span class="btn_text">Take video snapshot</span>
</button>
&nbsp;
<button id="btn_volume_down" onclick="volume_down();" onmouseover="button_over(this);" onmouseout="button_out(this);" title="Decrease Volume" >
<img src="old/images/volume_down.png" alt="Decrease Volume" />
<span class="btn_text">Decrease Volume</span>
</button>
<button id="btn_volume_up" onclick="volume_up();" onmouseover="button_over(this);" onmouseout="button_out(this);" title="Increase Volume" >
<img src="old/images/volume_up.png" alt="Increase Volume" />
<span class="btn_text">Increase Volume</span>
</button>
<button id="btn_volume_mute" onclick="volume_mute();" onmouseover="button_over(this);" onmouseout="button_out(this);" title="Mute Volume" >
<img src="old/images/speaker_mute.png" alt="Mute Volume" />
<span class="btn_text">Mute Volume</span>
</button>
<br />
Audio Delay:
<button id="btn_audiodelay_down" onclick="audiodelay_down();" onmouseover="button_over(this);" onmouseout="button_out(this);" title="Decrease Audio Delay by 50ms" >
<img src="old/images/minus.png" alt="Decrease Audio Delay" />
<span class="btn_text">Decrease Audio Delay</span>
</button>
<button id="btn_audiodelay_up" onclick="audiodelay_up();" onmouseover="button_over(this);" onmouseout="button_out(this);" title="Increase Audio Delay by 50ms" >
<img src="old/images/plus.png" alt="Increase Audio Delay" />
<span class="btn_text">Increase Audio Delay</span>
</button>
<span id="a_del">(?)</span> ms
<br />
Playback Speed:
<button id="btn_playrate_down" onclick="playrate_down();" onmouseover="button_over(this);" onmouseout="button_out(this);" title="Decrease playback rate by 0.05x" >
<img src="old/images/minus.png" alt="Decrease Playback Rate" />
<span class="btn_text">Decrease Playback Rate</span>
</button>
<button id="btn_playrate_up" onclick="playrate_up();" onmouseover="button_over(this);" onmouseout="button_out(this);" title="Increase playback rate by 0.05x" >
<img src="old/images/plus.png" alt="Increase Playback Rate" />
<span class="btn_text">Increase Playback Rate</span>
</button>
<span id="p_rate">(?)</span>x
<br/>
Advance of subtitles over video:
<button id="btn_subdel_down" onclick="subdel_down();" onmouseover="button_over(this);" onmouseout="button_out(this);" title="Decrease subtitle delay by 50ms" >
<img src="old/images/minus.png" alt="Decrease Subtitle delay" />
<span class="btn_text">Decrease Subtitle delay</span>
</button>
<button id="btn_subdel_up" onclick="subdel_up();" onmouseover="button_over(this);" onmouseout="button_out(this);" title="Increase subtitle delay by 50ms" >
<img src="old/images/plus.png" alt="Increase Subtitle delay" />
<span class="btn_text">Increase Subtitle delay</span>
</button>
<span id="s_del">(?)</span>ms
</div>
<div id="status">
<span id="state">(?)</span>
-
Time : <span id="time">(?)</span>/<span id="length">(?)</span>
-
Volume : <span id="volume">(?)</span>
<br/>
<!-- progress bar -->
<img src="old/images/slider_left.png" alt="slider left" /><span id="progressbar" style="background-image: url( 'old/images/slider_bar.png' ); width: 408px; height:16px; position:absolute;" onclick="slider_seek( event, this );" onmousemove="slider_move( event, this );"><img src="old/images/slider_point.png" alt="slider point" style="position:relative; left:0px;" id="main_slider_point" onmousedown="slider_down( event, this );" onmouseup="slider_up( event, this.parentNode );" onmouseout="slider_up( event, this.parentNode );"/></span><img src="old/images/slider_right.png" alt="slider right" style="position:relative;left:408px;" />
<br/>
<span id="nowplaying">(?)</span>
<img id="albumart" alt="" src="/art" style="float: right" onclick="refresh_albumart(true);"/>
</div>
</div>
<div id="info" class="dialog" style="display: none;" >
<div class="title">
Stream and media info
<img class="close" src="old/images/white_cross_small.png" alt="Close" onclick="hide('info');"/>
</div>
<div id="infotree">
</div>
</div>
<?vlc --[[
vim:syntax=html
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >
< playlist: VLC media player web interface - playlist dialog
< - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >
< Copyright (C) 2005-2006 the VideoLAN team
< $Id$
<
< Authors: Antoine Cellerier <dionoea -at- videolan -dot- org>
<
< This program is free software; you can redistribute it and/or modify
< it under the terms of the GNU General Public License as published by
< the Free Software Foundation; either version 2 of the License, or
< (at your option) any later version.
<
< This program is distributed in the hope that it will be useful,
< but WITHOUT ANY WARRANTY; without even the implied warranty of
< MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
< GNU General Public License for more details.
<
< You should have received a copy of the GNU General Public License
< along with this program; if not, write to the Free Software
< Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
< - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
This dialog needs the following dialogs to be fully functional: <none>
]]?>
<div id="playlist" class="dialog" >
<div class="title">
Playlist
<img class="close" src="old/images/white_cross_small.png" alt="Close" onclick="hide('playlist');"/>
</div>
<div class="controls">
<table>
<tr>
<td>
<!--<button id="btn_delete" onmouseover="button_over(this);" onmouseout="button_out(this);">
<img src="old/images/delete.png" alt="Delete" />
<span class="btn_text">Delete</span>
</button>-->
<button id="btn_empty" onclick="pl_empty();" onmouseover="button_over(this);" onmouseout="button_out(this);" title="Empty" >
<img src="old/images/empty.png" alt="Empty" />
<span class="btn_text">Empty</span>
</button>
<button id="btn_shuffle" onclick="pl_shuffle();" onmouseover="button_over(this);" onmouseout="button_out(this);" title="Shuffle" >
<img src="old/images/shuffle.png" alt="Shuffle" />
<span class="btn_text">Shuffle</span>
</button>
<button id="btn_loop" onclick="pl_loop();" onmouseover="button_over(this);" onmouseout="button_out(this);" title="Loop" >
<img src="old/images/loop.png" alt="Loop" />
<span class="btn_text">Loop</span>
</button>
<button id="btn_repeat" onclick="pl_repeat();" onmouseover="button_over(this);" onmouseout="button_out(this);" title="Repeat" >
<img src="old/images/repeat.png" alt="Repeat" />
<span class="btn_text">Repeat</span>
</button>
</td>
<td onmouseout="hide_menu('menu_sort');" onmouseover="show_menu('menu_sort');" >
<button id="btn_sort" title="Sort" >
<img src="old/images/sort.png" alt="Sort" />
<span class="btn_text">Sort</span>
</button>
<div id="menu_sort" class="menu" >
<div class="menuout" onclick="pl_sort('title',0);hide_menu('menu_sort');" onmouseover="setclass(this,'menuover');" onmouseout="setclass(this,'menuout');" title="Sort by Title ascending" >Title</div>
<div class="menuout" onclick="pl_sort('title',1);hide_menu('menu_sort');" onmouseover="setclass(this,'menuover');" onmouseout="setclass(this,'menuout');" title="Sort by Title descending" >Title reverse</div>
<div class="menuout" onclick="pl_sort('artist',0);hide_menu('menu_sort');" onmouseover="setclass(this,'menuover');" onmouseout="setclass(this,'menuout');" title="Sort by Artist ascending" >Artist</div>
<div class="menuout" onclick="pl_sort('artist',1);hide_menu('menu_sort');" onmouseover="setclass(this,'menuover');" onmouseout="setclass(this,'menuout');" title="Sort by Artist ascending" >Artist reverse</div>
<div class="menuout" onclick="pl_sort('album',0);hide_menu('menu_sort');" onmouseover="setclass(this,'menuover');" onmouseout="setclass(this,'menuout');" title="Sort by Album ascending" >Album</div>
<div class="menuout" onclick="pl_sort('album',1);hide_menu('menu_sort');" onmouseover="setclass(this,'menuover');" onmouseout="setclass(this,'menuout');" title="Sort by Album ascending" >Album reverse</div>
<div class="menuout" onclick="pl_sort('genre',0);hide_menu('menu_sort');" onmouseover="setclass(this,'menuover');" onmouseout="setclass(this,'menuout');" title="Sort by Genre ascending" >Genre</div>
<div class="menuout" onclick="pl_sort('genre',1);hide_menu('menu_sort');" onmouseover="setclass(this,'menuover');" onmouseout="setclass(this,'menuout');" title="Sort by Genre ascending" >Genre reverse</div>
<div class="menuout" onclick="pl_sort('random',0);hide_menu('menu_sort');" onmouseover="setclass(this,'menuover');" onmouseout="setclass(this,'menuout');" title="Randomize" >Random</div>
<div class="menuout" onclick="pl_sort('id',0);hide_menu('menu_sort');" onmouseover="setclass(this,'menuover');" onmouseout="setclass(this,'menuout');" title="Sort by Id ascending" >Id</div>
<div class="menuout" onclick="pl_sort('id',1);hide_menu('menu_sort');" onmouseover="setclass(this,'menuover');" onmouseout="setclass(this,'menuout');" title="Sort by Id descending" >Id reverse</div>
</div>
</td>
<td onmouseover="show_menu('menu_sd');" onmouseout="hide_menu('menu_sd');">
<button id="btn_sd" title="Services Discovery" >
<img src="old/images/sd.png" alt="Services Discovery" />
<span class="btn_text">Services Discovery</span>
</button>
<div id="menu_sd" class="menu" >
<?vlc
local sd = vlc.sd.get_services_names()
for n,ln in pairs(sd) do
print([[<div class="menuout" onclick='pl_sd("]]..vlc.strings.encode_uri_component(n)..[[");hide_menu("menu_sd");' onmouseover="setclass(this,'menuover');" onmouseout="setclass(this,'menuout');" title="Toggle ]]..ln..[[" >]]..ln..[[</div>]])
end
?>
</div>
</td>
<td style='width: 30px'></td>
<td>
<span class="btn_text">Live search:</span>
<input title="Live search" type="text" value="<?vlc if _G.search_key then print(search_key) else print('<search>') end ?>" id="search" onfocus="if( this.value == '<search>' ) this.value = ''" onblur="if( this.value == '' ) reset_search()" onchange="update_playlist_search(this.value)" onkeyup="update_playlist_search(this.value)" />
<button id="btn_search_reset" onclick="reset_search()" onmouseover="button_over(this);" onmouseout="button_out(this);" title="Reset search">
<img src="old/images/reset.png" alt="Reset" />
<span class="btn_text">Reset</span>
</button>
</td>
</tr>
</table>
</div>
<div id="playtree">
(?)
</div>
</div>
<?vlc --[[
vim:syntax=html
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >
< sout: VLC media player web interface - stream output dialog
< - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >
< Copyright (C) 2005-2006 the VideoLAN team
< $Id$
<
< Authors: Antoine Cellerier <dionoea -at- videolan -dot- org>
<
< This program is free software; you can redistribute it and/or modify
< it under the terms of the GNU General Public License as published by
< the Free Software Foundation; either version 2 of the License, or
< (at your option) any later version.
<
< This program is distributed in the hope that it will be useful,
< but WITHOUT ANY WARRANTY; without even the implied warranty of
< MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
< GNU General Public License for more details.
<
< You should have received a copy of the GNU General Public License
< along with this program; if not, write to the Free Software
< Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
< - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
This dialog needs the following dialogs to be fully functional: <none>
Note that the sout chain is used and sent to VLC by the input dialog
]]?>
<div id="sout" class="dialog" style="display: none">
<div class="title">
Stream Output
<img class="close" src="old/images/white_cross_small.png" alt="Close" onclick="hide('sout');"/>
</div>
<div class="controls">
<label for="sout_mrl">Destination</label>
<?vlc if current_page == "vlm" then ?>
<input type="text" name="sout_mrl" id="sout_mrl" size="60" onkeypress="if( event.keyCode == 13 ) vlm_output_change();" disabled="disabled" />
<br/>
<input type="button" value="Ok" onclick="vlm_output_change();" />
<input type="button" value="Cancel" onclick="hide('sout');" />
<input type="hidden" id="sout_dest" />
<?vlc else ?>
<input type="text" name="sout_mrl" id="sout_mrl" size="60" onkeypress="if( event.keyCode == 13 ) save_sout();" disabled="disabled" />
<br/>
<input type="button" value="Save" onclick="save_sout();" />
<?vlc end ?>
<input type="button" value="Reset" onclick="reset_sout();"/>
<input type="hidden" id="sout_old_mrl" value="" /> <!-- FIXME -->
<input type="button" id="sout_helper_toggle" onclick="toggle_show_sout_helper()" value="Hide sout interface" />
</div>
<div id="sout_helper" class="helper">
Stream Output Helper
<hr/>
<div id="sout_method">
<table>
<tr>
<td>
<input type="checkbox" id="sout_display" onchange="update_sout()"/>
<label for="sout_display">Display</label>
</td>
<td></td>
<td></td>
</tr>
<tr>
<td>
<input type="checkbox" id="sout_file" onchange="update_sout()"/>
<label for="sout_file">File</label>
</td>
<td>
<label for="sout_file_filename">File name</label>
<input type="text" id="sout_file_filename" onchange="update_sout()"/>
</td>
<td></td>
</tr>
<tr>
<td>
<input type="checkbox" id="sout_http" onchange="update_sout()"/>
<label for="sout_http">HTTP</label>
</td>
<td>
<label for="sout_http_addr">Address</label>
<input type="text" id="sout_http_addr" onchange="update_sout()"/>
</td>
<td>
<label for="sout_http_port">Port</label>
<input type="text" id="sout_http_port" onchange="update_sout()"/>
</td>
</tr>
<tr>
<td>
<input type="checkbox" id="sout_mmsh" onchange="update_sout()"/>
<label for="sout_mmsh">MMSH</label>
</td>
<td>
<label for="sout_mmsh_addr">Address</label>
<input type="text" id="sout_mmsh_addr" onchange="update_sout()"/>
</td>
<td>
<label for="sout_mmsh_port">Port</label>
<input type="text" id="sout_mmsh_port" onchange="update_sout()"/>
</td>
</tr>
<tr>
<td>
<input type="checkbox" id="sout_rtp" onchange="update_sout()"/>
<label for="sout_rtp">RTP</label>
</td>
<td>
<label for="sout_rtp_addr">Address</label>
<input type="text" id="sout_rtp_addr" onchange="update_sout()"/>
</td>
<td>
<label for="sout_rtp_port">Port</label>
<input type="text" id="sout_rtp_port" onchange="update_sout()"/>
</td>
</tr>
<tr>
<td>
<input type="checkbox" id="sout_udp" onchange="update_sout()"/>
<label for="sout_udp">UDP</label>
</td>
<td>
<label for="sout_udp_addr">Address</label>
<input type="text" id="sout_udp_addr" onchange="update_sout()"/>
</td>
<td>
<label for="sout_udp_port">Port</label>
<input type="text" id="sout_udp_port" onchange="update_sout()"/>
</td>
</tr>
</table>
</div>
<hr/>
<div id="sout_muxh">
<input type="radio" name="sout_mux" id="sout_mux_default" value="" onchange="update_sout()" />
<label for="sout_mux_default">Default</label>
<input type="radio" name="sout_mux" id="sout_mux_ts" value="ts" onchange="update_sout()"/>
<label for="sout_mux_ts">MPEG TS</label>
<input type="radio" name="sout_mux" id="sout_mux_ps" value="ps" onchange="update_sout()"/>
<label for="sout_mux_ps">MPEG PS</label>
<input type="radio" name="sout_mux" id="sout_mux_mpeg1" value="mpeg1" onchange="update_sout()"/>
<label for="sout_mux_ts">MPEG 1</label>
<input type="radio" name="sout_mux" id="sout_mux_ogg" value="ogg" onchange="update_sout()"/>
<label for="sout_mux_ts">OGG</label>
<br/>
<input type="radio" name="sout_mux" id="sout_mux_asf" value="asf" onchange="update_sout()"/>
<label for="sout_mux_ts">ASF</label>
<input type="radio" name="sout_mux" id="sout_mux_mp4" value="mp4" onchange="update_sout()"/>
<label for="sout_mux_ts">MP4</label>
<input type="radio" name="sout_mux" id="sout_mux_mov" value="mov" onchange="update_sout()"/>
<label for="sout_mux_ts">MOV</label>
<input type="radio" name="sout_mux" id="sout_mux_wav" value="wav" onchange="update_sout()"/>
<label for="sout_mux_ts">WAV</label>
<input type="radio" name="sout_mux" id="sout_mux_raw" value="raw" onchange="update_sout()"/>
<label for="sout_mux_ts">Raw</label>
</div>
<hr/>
<div id="sout_transcode">
<input type="hidden" id="sout_transcode_extra" value="" />
<table>
<tr>
<td>
<input type="checkbox" id="sout_vcodec_s" onchange="update_sout()"/>
<label for="sout_vcodec_s">Video Codec</label>
</td>
<td>
<select id="sout_vcodec" onchange="update_sout()">
<option value="mp1v">mp1v</option>
<option value="mp2v">mp2v</option>
<option value="mp4v">mp4v</option>
<option value="DIV1">DIV1</option>
<option value="DIV2">DIV2</option>
<option value="DIV3">DIV3</option>
<option value="h263">h263</option>
<option value="h264">h264</option>
<option value="WMV1">WMV1</option>
<option value="WMV2">WMV2</option>
<option value="MJPG">MJPG</option>
<option value="theo">theo</option>
</select>
</td>
<td>
<label for="sout_vb">Bitrate (kb/s)</label>
<select id="sout_vb" onchange="update_sout()">
<option value="4096">4096</option>
<option value="3072">3072</option>
<option value="2048">2048</option>
<option value="1024">1024</option>
<option value="768">768</option>
<option value="512">512</option>
<option value="384">384</option>
<option value="256">256</option>
<option value="192">192</option>
<option value="128">128</option>
<option value="96">96</option>
<option value="64">64</option>
<option value="32">32</option>
<option value="16">16</option>
</select>
</td>
<td>
<label for="sout_scale">Scale</label>
<select id="sout_scale" onchange="update_sout()">
<option value="0.25">0.25</option>
<option value="0.5">0.5</option>
<option value="0.75">0.75</option>
<option value="1" selected="selected">1</option>
<option value="1.25">1.25</option>
<option value="1.5">1.5</option>
<option value="1.75">1.75</option>
<option value="2">2</option>
</select>
</td>
</tr>
<tr>
<td>
<input type="checkbox" id="sout_acodec_s" onchange="update_sout()"/>
<label for="sout_acodec_s">Audio Codec</label>
</td>
<td>
<select id="sout_acodec" onchange="update_sout()">
<option value="mpga">mpga</option>
<option value="mp2a">mp2a</option>
<option value="mp3">mp3</option>
<option value="mp4a">mp4a</option>
<option value="a52">a52</option>
<option value="vorb">vorb</option>
<option value="flac">flac</option>
<option value="spx">spx</option>
<option value="s16l">s16l</option>
<option value="fl32">fl32</option>
</select>
</td>
<td>
<label for="sout_ab">Bitrate (kb/s)</label>
<select id="sout_ab" onchange="update_sout()">
<option value="512">512</option>
<option value="384">384</option>
<option value="256">256</option>
<option value="192">192</option>
<option value="128">128</option>
<option value="96">96</option>
<option value="64">64</option>
<option value="32">32</option>
<option value="16">16</option>
</select>
</td>
<td>
<label for="sout_channels">Channels</label>
<select id="sout_channels" onchange="update_sout()">
<option value="">default</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="4">4</option>
<option value="6">6</option>
</select>
</td>
</tr>
<tr>
<td>
<input type="checkbox" id="sout_sub" onchange="update_sout()"/>
<label for="sout_sub">Subtitle Codec</label>
</td>
<td>
<select id="sout_scodec" onchange="update_sout()">
<option value="dvbs">dvbs</option>
</select>
</td>
<td colspan="2">
<input type="checkbox" id="sout_soverlay" onchange="update_sout()"/>
<label for="sout_soverlay">Subtitle overlay</label>
</td>
</tr>
</table>
</div>
<hr/>
<div id="sout_misc">
<input type="checkbox" id="sout_sap" onchange="update_sout()"/>
<label for="sout_sap">SAP announce</label>
<br/>
<label for="sout_sap_group">Group name</label>
<input type="text" id="sout_sap_group" onchange="update_sout()"/>
<label for="sout_sap_name">Channel name</label>
<input type="text" id="sout_sap_name" onchange="update_sout()"/>
<hr/>
<input type="checkbox" id="sout_all" onchange="update_sout()"/>
<label for="sout_all">Select all elementary streams</label>
<hr/>
<label for="sout_ttl">Time-To-Live (TTL)</label>
<input type="text" id="sout_ttl" onchange="update_sout()"/>
</div>
</div>
</div>
<?vlc --[[
vim:syntax=html
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >
< vlm: VLC media player web interface - VLM controler
< - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >
< Copyright (C) 2005-2006 the VideoLAN team
< $Id$
<
< Authors: Antoine Cellerier <dionoea -at- videolan -dot- org>
<
< This program is free software; you can redistribute it and/or modify
< it under the terms of the GNU General Public License as published by
< the Free Software Foundation; either version 2 of the License, or
< (at your option) any later version.
<
< This program is distributed in the hope that it will be useful,
< but WITHOUT ANY WARRANTY; without even the implied warranty of
< MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
< GNU General Public License for more details.
<
< You should have received a copy of the GNU General Public License
< along with this program; if not, write to the Free Software
< Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
< - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
This dialog needs the following dialogs to be fully functional: input,
sout and vlmelements .
]]?>
<div id="vlm" class="dialog" >
<div class="title">
VLC media player - VLM interface
<!--
<button id="btn_toggle_text" onclick="toggle_btn_text();">
<img src="/images/help.png" alt="Help" />
Help
</button>
-->
</div>
<div class="controls">
<label for="vlm_command">VLM command:</label>
<input type="text" id="vlm_command" size="60" onkeypress="if( event.keyCode == 13 ) vlm_send();" />
<input type="button" value="Send" onclick="vlm_send();" />
<br />
<span id="vlm_error"></span>
<br />
<span id="vlm_helper_controls">
<button id="btn_broadcast" onclick="hide_vlm_add();show('vlm_add_broadcast');update_vlm_add_broadcast();" onmouseover="button_over(this);" onmouseout="button_out(this);">
Broadcast
</button>
<button id="btn_vod" onclick="hide_vlm_add();show('vlm_add_vod');update_vlm_add_vod();" onmouseover="button_over(this);" onmouseout="button_out(this);">
Video on Demand
</button>
<button id="btn_schedule" onclick="hide_vlm_add();show('vlm_add_schedule');update_vlm_add_schedule();" onmouseover="button_over(this);" onmouseout="button_out(this);">
Schedule
</button>
<button id="btn_other" onclick="hide_vlm_add();show('vlm_add_other');update_vlm_add_other();" onmouseover="button_over(this);" onmouseout="button_out(this);">
Other
</button>
</span>
<button id="btn_vlm_helper_toggle" onclick="toggle_show_vlm_helper();" onmouseover="button_over(this);" onmouseout="button_out(this);">
Hide VLM helper
</button>
</div>
<div id="vlm_helper" class="helper" >
<div id="vlm_add_broadcast" style="display: block">
New broadcast element
<hr />
<label for="vlm_broadcast_name">Name</label>
<input type="text" id="vlm_broadcast_name" size="20" onchange="update_vlm_add_broadcast();" />
<input type="checkbox" id="vlm_broadcast_enabled" onchange="update_vlm_add_broadcast();" />
<label for="vlm_broadcast_enabled">Enable</label>
<input type="checkbox" id="vlm_broadcast_loop" onchange="update_vlm_add_broadcast();" />
<label for="vlm_broadcast_loop">Loop</label>
<br/>
<label for="vlm_broadcast_input">Input</label>
<input type="text" id="vlm_broadcast_input" size="60" onblur="update_vlm_add_broadcast();" />
<input type="button" value="Edit" onclick="vlm_input_edit('vlm_broadcast_input');" />
<br/>
<label for="vlm_broadcast_output">Output</label>
<input type="text" id="vlm_broadcast_output" size="60" onblur="update_vlm_add_broadcast();" />
<input type="button" value="Edit" onclick="vlm_output_edit('vlm_broadcast_output');" />
<br/>
</div>
<div id="vlm_add_vod" style="display: none">
New video on demand element
<hr />
<label for="vlm_vod_name">Name</label>
<input type="text" id="vlm_vod_name" size="20" onchange="update_vlm_add_vod();" />
<input type="checkbox" id="vlm_vod_enabled" onchange="update_vlm_add_vod();" />
<label for="vlm_vod_enabled">Enable</label>
<br/>
<label for="vlm_vod_input">Input</label>
<input type="text" id="vlm_vod_input" size="60" onblur="update_vlm_add_vod();" />
<input type="button" value="Edit" onclick="vlm_input_edit('vlm_vod_input');" />
<br/>
<label for="vlm_vod_output">Output (leave empty unless you want to transcode)</label>
<input type="text" id="vlm_vod_output" size="60" onblur="update_vlm_add_vod();" />
<input type="button" value="Edit" onclick="vlm_output_edit('vlm_vod_output');" />
<br/>
</div>
<div id="vlm_add_schedule" style="display: none">
New schedule
<hr />
<label for="vlm_schedule_name">Name</label>
<input type="text" id="vlm_schedule_name" size="20" onchange="update_vlm_add_schedule();" />
<input type="checkbox" id="vlm_schedule_enabled" onchange="update_vlm_add_schedule();" />
<label for="vlm_schedule_enabled">Enable</label>
<br />
Schedule date:
<input type="checkbox" id="vlm_schedule_now" onchange="toggle_schedule_date();update_vlm_add_schedule();" />
<label for="vlm_schedule_now">Now</label>
<br/>
<label for="vlm_schedule_year">Year:</label>
<input type="text" id="vlm_schedule_year" value="1970" size="4" maxlength="4" onchange="update_vlm_add_schedule();" />
<label for="vlm_schedule_month">Month:</label>
<input type="text" id="vlm_schedule_month" value="01" size="2" maxlength="2" onchange="update_vlm_add_schedule();" />
<label for="vlm_schedule_day">Day:</label>
<input type="text" id="vlm_schedule_day" value="01" size="2" maxlength="2" onchange="update_vlm_add_schedule();" />
<label for="vlm_schedule_hour">Hour:</label>
<input type="text" id="vlm_schedule_hour" value="00" size="2" maxlength="2" onchange="update_vlm_add_schedule();" />
<label for="vlm_schedule_minute">Minute:</label>
<input type="text" id="vlm_schedule_minute" value="59" size="2" maxlength="2" onchange="update_vlm_add_schedule();" />
<label for="vlm_schedule_second">Second:</label>
<input type="text" id="vlm_schedule_second" value="59" size="2" maxlength="2" onchange="update_vlm_add_schedule();" />
<br/>
Schedule period:<br/>
<input type="checkbox" id="vlm_schedule_repeat" onchange="toggle_schedule_repeat();update_vlm_add_schedule();" />
<label for="vlm_schedule_repeat">Repeat</label>
<br />
<label for="vlm_schedule_period_year">Year:</label>
<input type="text" id="vlm_schedule_period_year" value="0" size="4" disabled="disabled" onchange="update_vlm_add_schedule();" />
<label for="vlm_schedule_period_month">Month:</label>
<input type="text" id="vlm_schedule_period_month" value="0" size="2" disabled="disabled" onchange="update_vlm_add_schedule();" />
<label for="vlm_schedule_period_day">Day:</label>
<input type="text" id="vlm_schedule_period_day" value="0" size="2" disabled="disabled" onchange="update_vlm_add_schedule();" />
<label for="vlm_schedule_period_hour">Hour:</label>
<input type="text" id="vlm_schedule_period_hour" value="0" size="2" disabled="disabled" onchange="update_vlm_add_schedule();" />
<label for="vlm_schedule_period_minute">Minute:</label>
<input type="text" id="vlm_schedule_period_minute" value="0" size="4" disabled="disabled" onchange="update_vlm_add_schedule();" />
<label for="vlm_schedule_period_second">Second:</label>
<input type="text" id="vlm_schedule_period_second" value="0" size="4" disabled="disabled" onchange="update_vlm_add_schedule();" />
<br />
<label for="vlm_schedule_repeat_times">Number of repetitions (use 0 to repeat endlessly):</label>
<input type="text" id="vlm_schedule_repeat_times" size="8" disabled="disabled" value="0" onchange="update_vlm_add_schedule();" />
</div>
<div id="vlm_add_other" style="display: none">
<input type="button" id="btn_import" onclick="vlm_batch(document.getElementById('vlm_batch_text').value);" value="Send command batch" />
<input type="button" id="btn_export" onclick="document.location.assign('vlm_export.html');" value="Export VLM commands (new page)" />
<br/>
<textarea cols="70" rows="20" id="vlm_batch_text">#paste your VLM commands here</textarea>
</div>
</div>
</div>
<div id="vlm_broadcast" class="dialog" >
<div class="title">
Broadcast Elements
<button id="btn_refresh_broadcast" onclick="vlm_get_elements();" title="Refresh" >
<img src="/old/images/refresh.png" alt="Refresh" />
</button>
</div>
<div id="vlm_broadcast_list" class="list"></div>
</div>
<div id="vlm_vod" class="dialog" >
<div class="title">
Video on Demand Elements
<button id="btn_refresh_vod" onclick="vlm_get_elements();" title="Refresh" >
<img src="/old/images/refresh.png" alt="Refresh" />
</button>
</div>
<div id="vlm_vod_list" class="list"></div>
</div>
<div id="vlm_schedule" class="dialog" >
<div class="title">
Schedule Elements
<button id="btn_refresh_schedule" onclick="vlm_get_elements();" title="Refresh" >
<img src="/old/images/refresh.png" alt="Refresh" />
</button>
</div>
<div id="vlm_schedule_list" class="list"></div>
</div>
/*****************************************************************************
* functions.js: VLC media player web interface
*****************************************************************************
* Copyright (C) 2005-2014 VLC authors and VideoLAN
* $Id: functions.js 21264 2007-08-19 17:48:28Z dionoea $
*
* Authors: Antoine Cellerier <dionoea -at- videolan -dot- org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
/**********************************************************************
* Global variables
*********************************************************************/
var old_time = 0;
var pl_cur_id;
var albumart_id = -1;
/**********************************************************************
* Slider functions
*********************************************************************/
var slider_mouse_down = 0;
var slider_dx = 0;
var input_options = new Array();
/* findPosX() from http://www.quirksmode.rg/js/indpos.html */
function findPosX(obj)
{
var curleft = 0;
if (obj.offsetParent)
{
while (obj.offsetParent)
{
curleft += obj.offsetLeft
obj = obj.offsetParent;
}
}
else if (obj.x)
curleft += obj.x;
return curleft;
}
function slider_seek( e, bar )
{
seek(Math.floor(( e.clientX + document.body.scrollLeft - findPosX( bar )) / 4)+"%25");
}
function slider_down( e, point )
{
slider_mouse_down = 1;
slider_dx = e.clientX - findPosX( point );
}
function slider_up( e, bar )
{
slider_mouse_down = 0;
/* slider_seek( e, bar ); */
}
function slider_move( e, bar )
{
if( slider_mouse_down == 1 )
{
var slider_position = Math.floor( e.clientX - slider_dx + document.body.scrollLeft - findPosX( bar ));
document.getElementById( 'main_slider_point' ).style.left = slider_position+"px";
slider_seek( e, bar );
}
}
/**********************************************************************
* Misc utils
*********************************************************************/
/* XMLHttpRequest wrapper */
function loadXMLDoc( url, callback )
{
// branch for native XMLHttpRequest object
if ( window.XMLHttpRequest )
{
req = new XMLHttpRequest();
req.onreadystatechange = callback;
req.open( "GET", url, true );
req.send( null );
// branch for IE/Windows ActiveX version
}
else if ( window.ActiveXObject )
{
req = new ActiveXObject( "Microsoft.XMLHTTP" );
if ( req )
{
req.onreadystatechange = callback;
req.open( "GET", url, true );
req.send();
}
}
}
/* fomat time in second as hh:mm:ss */
function format_time( s )
{
var hours = Math.floor(s/3600);
var minutes = Math.floor((s/60)%60);
var seconds = Math.floor(s%60);
if( hours < 10 ) hours = "0"+hours;
if( minutes < 10 ) minutes = "0"+minutes;
if( seconds < 10 ) seconds = "0"+seconds;
return hours+":"+minutes+":"+seconds;
}
/* delete all a tag's children and add a text child node */
function set_text( id, val )
{
var elt = document.getElementById( id );
while( elt.hasChildNodes() )
elt.removeChild( elt.firstChild );
elt.appendChild( document.createTextNode( val ) );
}
/* set item's 'element' attribute to value */
function set_css( item, element, value )
{
for( var j = 0; j < document.styleSheets.length; j++ )
{
var cssRules = document.styleSheets[j].cssRules;
if( !cssRules ) cssRules = document.styleSheets[j].rules;
for( var i = 0; i < cssRules.length; i++)
{
if( cssRules[i].selectorText == item )
{
if( cssRules[i].style.setProperty )
cssRules[i].style.setProperty( element, value, null );
else
cssRules[i].style.setAttribute( toCamelCase( element ), value );
return;
}
}
}
}
/* get item's 'element' attribute */
function get_css( item, element )
{
for( var j = 0; j < document.styleSheets.length; j++ )
{
var cssRules = document.styleSheets[j].cssRules;
if( !cssRules ) cssRules = document.styleSheets[j].rules;
for( var i = 0; i < cssRules.length; i++)
{
if( cssRules[i].selectorText == item )
{
if( cssRules[i].style.getPropertyValue )
return cssRules[i].style.getPropertyValue( element );
else
return cssRules[i].style.getAttribute( toCamelCase( element ) );
}
}
}
}
function toggle_show( id )
{
var element = document.getElementById( id );
if( element.style.display == 'block' || element.style.display == '' )
{
element.style.display = 'none';
}
else
{
element.style.display = 'block';
}
}
function toggle_show_node( id )
{
var element = document.getElementById( 'pl_'+id );
var img = document.getElementById( 'pl_img_'+id );
if( element.style.display == 'block' || element.style.display == '' )
{
element.style.display = 'none';
img.setAttribute( 'src', '/old/images/plus.png' );
img.setAttribute( 'alt', '[+]' );
}
else
{
element.style.display = 'block';
img.setAttribute( 'src', '/old/images/minus.png' );
img.setAttribute( 'alt', '[-]' );
}
}
function show( id ){ document.getElementById( id ).style.display = 'block'; }
function showinline( id ){ document.getElementById( id ).style.display = 'inline'; }
function hide( id ){ document.getElementById( id ).style.display = 'none'; }
function checked( id ){ return document.getElementById( id ).checked; }
function value( id ){ return document.getElementById( id ).value; }
function setclass( obj, value )
{
obj.setAttribute( 'class', value ); /* Firefox */
obj.setAttribute( 'className', value ); /* IE */
}
function radio_value( name )
{
var radio = document.getElementsByName( name );
for( var i = 0; i < radio.length; i++ )
{
if( radio[i].checked )
{
return radio[i].value;
}
}
return "";
}
function check_and_replace_int( id, val )
{
var objRegExp = /^\d+$/;
if( value( id ) != ''
&& ( !objRegExp.test( value( id ) )
|| parseInt( value( id ) ) < 1 ) )
return document.getElementById( id ).value = val;
return document.getElementById( id ).value;
}
function addslashes( str ){ return str.replace(/\'/g, '\\\''); }
function escapebackslashes( str ){ return str.replace(/\\/g, '\\\\'); }
function toCamelCase( str )
{
str = str.split( '-' );
var cml = str[0];
for( var i=1; i<str.length; i++)
cml += str[i].charAt(0).toUpperCase()+str[i].substring(1);
return cml;
}
function disable( id ){ document.getElementById( id ).disabled = true; }
function enable( id ){ document.getElementById( id ).disabled = false; }
function button_over( element ){ element.style.border = "1px solid #000"; }
function button_out( element ){ element.style.border = "1px solid #fff"; }
function button_out_menu( element ){ element.style.border = "1px solid transparent"; }
function show_menu( id ){ document.getElementById(id).style.display = 'block'; }
function hide_menu( id ){ document.getElementById(id).style.display = 'none'; }
/* toggle show help under the buttons */
function toggle_btn_text()
{
if( get_css( '.btn_text', 'display' ) == 'none' )
{
set_css( '.btn_text', 'display', 'block' );
}
else
{
set_css( '.btn_text', 'display', 'none' );
}
}
function clear_children( elt )
{
if( elt )
while( elt.hasChildNodes() )
elt.removeChild( elt.firstChild );
}
/**********************************************************************
* Interface actions
*********************************************************************/
/* input actions */
function in_playenqueue( cmd )
{
var input = value('input_mrl');
var url = 'requests/status.xml?command=in_'+cmd+'&input='+encodeURIComponent( addslashes(escapebackslashes(input)) );
for( i in input_options )
if( input_options[i] != ':option=value' )
url += '&option='+encodeURIComponent( addslashes(escapebackslashes(input_options[i]) ));
loadXMLDoc( url, parse_status );
setTimeout( 'update_playlist()', 1000 );
}
function in_play()
{
in_playenqueue( 'play' );
}
function in_enqueue()
{
in_playenqueue( 'enqueue' );
}
/* playlist actions */
function pl_play( id )
{
loadXMLDoc( 'requests/status.xml?command=pl_play&id='+id, parse_status );
pl_cur_id = id;
setTimeout( 'update_playlist()', 1000 );
}
function pl_pause()
{
loadXMLDoc( 'requests/status.xml?command=pl_pause&id='+pl_cur_id, parse_status );
}
function pl_stop()
{
loadXMLDoc( 'requests/status.xml?command=pl_stop', parse_status );
setTimeout( 'update_playlist()', 1000 );
}
function pl_next()
{
loadXMLDoc( 'requests/status.xml?command=pl_next', parse_status );
setTimeout( 'update_playlist()', 1000 );
}
function pl_previous()
{
loadXMLDoc( 'requests/status.xml?command=pl_previous', parse_status );
setTimeout( 'update_playlist()', 1000 );
}
function pl_delete( id )
{
loadXMLDoc( 'requests/status.xml?command=pl_delete&id='+id, parse_status );
setTimeout( 'update_playlist()', 1000 );
}
function pl_empty()
{
loadXMLDoc( 'requests/status.xml?command=pl_empty', parse_status );
setTimeout( 'update_playlist()', 1000 );
}
function pl_sort( sort, order )
{
loadXMLDoc( 'requests/status.xml?command=pl_sort&id='+order+'&val='+sort, parse_status );
setTimeout( 'update_playlist()', 1000 );
}
function pl_shuffle()
{
loadXMLDoc( 'requests/status.xml?command=pl_random', parse_status );
setTimeout( 'update_playlist()', 1000 );
}
function pl_loop()
{
loadXMLDoc( 'requests/status.xml?command=pl_loop', parse_status );
}
function pl_repeat()
{
loadXMLDoc( 'requests/status.xml?command=pl_repeat', parse_status );
}
function pl_sd( value )
{
loadXMLDoc( 'requests/status.xml?command=pl_sd&val='+value, parse_status );
}
/* misc actions */
function volume_down()
{
loadXMLDoc( 'requests/status.xml?command=volume&val=-20', parse_status );
}
function volume_up()
{
loadXMLDoc( 'requests/status.xml?command=volume&val=%2B20', parse_status );
}
function volume_mute()
{
loadXMLDoc( 'requests/status.xml?command=volume&val=0', parse_status );
}
function seek( pos )
{
loadXMLDoc( 'requests/status.xml?command=seek&val='+pos, parse_status );
}
function fullscreen()
{
loadXMLDoc( 'requests/status.xml?command=fullscreen', parse_status );
}
function snapshot()
{
loadXMLDoc( 'requests/status.xml?command=snapshot', parse_status );
}
function hotkey( str )
{
/* Use hotkey name (without the "key-" part) as the argument to simulate a hotkey press */
loadXMLDoc( 'requests/status.xml?command=key&val='+str, parse_status );
}
function update_status()
{
loadXMLDoc( 'requests/status.xml', parse_status );
}
function update_playlist()
{
loadXMLDoc( 'requests/playlist.xml', parse_playlist );
}
function update_playlist_search(key)
{
loadXMLDoc( 'requests/playlist.xml?search='+encodeURIComponent(key), parse_playlist )
}
function reset_search()
{
var search = document.getElementById('search')
if( search )
{
search.value = '<search>'
update_playlist_search('')
}
}
function audiodelay_down()
{
var curdel = parseFloat(req.responseXML.documentElement.getElementsByTagName( 'audiodelay' )[0].firstChild.data);
var curdelnew = curdel - 0.05;
curdelnew=curdelnew.toFixed(2);
loadXMLDoc( 'requests/status.xml?command=audiodelay&val='+encodeURIComponent(curdelnew), parse_status );
}
function audiodelay_up()
{
var curdel = parseFloat(req.responseXML.documentElement.getElementsByTagName( 'audiodelay' )[0].firstChild.data);
var curdelnew = curdel + 0.05;
curdelnew=curdelnew.toFixed(2);
loadXMLDoc( 'requests/status.xml?command=audiodelay&val='+encodeURIComponent(curdelnew), parse_status );
}
function playrate_down()
{
var currate = parseFloat(req.responseXML.documentElement.getElementsByTagName( 'rate' )[0].firstChild.data);
var curratenew = currate - 0.05;
curratenew=curratenew.toFixed(2);
loadXMLDoc( 'requests/status.xml?command=rate&val='+encodeURIComponent(curratenew), parse_status );
}
function playrate_up()
{
var currate = parseFloat(req.responseXML.documentElement.getElementsByTagName( 'rate' )[0].firstChild.data);
var curratenew = currate + 0.05;
curratenew=curratenew.toFixed(2);
loadXMLDoc( 'requests/status.xml?command=rate&val='+encodeURIComponent(curratenew), parse_status );
}
function subdel_down()
{
var curdel = parseFloat(req.responseXML.documentElement.getElementsByTagName( 'subtitledelay' )[0].firstChild.data);
var curdelnew = curdel - 0.05;
curdelnew=curdelnew.toFixed(2);
loadXMLDoc( 'requests/status.xml?command=subdelay&val='+encodeURIComponent(curdelnew), parse_status );
}
function subdel_up()
{
var curdel = parseFloat(req.responseXML.documentElement.getElementsByTagName( 'subtitledelay' )[0].firstChild.data);
var curdelnew = curdel + 0.05;
curdelnew=curdelnew.toFixed(2);
loadXMLDoc( 'requests/status.xml?command=subdelay&val='+encodeURIComponent(curdelnew), parse_status );
}
/**********************************************************************
* Parse xml replies to XMLHttpRequests
*********************************************************************/
/* parse request/status.xml */
function parse_status()
{
if( req.readyState == 4 )
{
if( req.status == 200 )
{
var status = req.responseXML.documentElement;
var timetag = status.getElementsByTagName( 'time' );
if( timetag.length > 0 )
{
var new_time = timetag[0].firstChild.data;
}
else
{
new_time = old_time;
}
var lengthtag = status.getElementsByTagName( 'length' );
var length;
if( lengthtag.length > 0 )
{
length = lengthtag[0].firstChild.data;
}
else
{
length = 0;
}
var slider_position;
positiontag = status.getElementsByTagName( 'position' );
if( length < 100 && positiontag.length > 0 )
{
slider_position = ( positiontag[0].firstChild.data * 4 ) + "px";
}
else if( length > 0 )
{
/* this is more precise if length > 100 */
slider_position = Math.floor( ( new_time * 400 ) / length ) + "px";
}
else
{
slider_position = 0;
}
if( old_time > new_time )
setTimeout('update_playlist()',50);
old_time = new_time;
set_text( 'time', format_time( new_time ) );
set_text( 'length', format_time( length ) );
var audio_delay = (parseFloat(req.responseXML.documentElement.getElementsByTagName( 'audiodelay' )[0].firstChild.data).toFixed(2))*1000;
set_text( 'a_del', audio_delay );
var play_rate = (parseFloat(req.responseXML.documentElement.getElementsByTagName( 'rate' )[0].firstChild.data).toFixed(2));
set_text( 'p_rate', play_rate );
var subs_delay = (parseFloat(req.responseXML.documentElement.getElementsByTagName( 'subtitledelay' )[0].firstChild.data).toFixed(2))*1000;
set_text( 's_del', subs_delay );
if( status.getElementsByTagName( 'volume' ).length != 0 )
set_text( 'volume', Math.floor(status.getElementsByTagName( 'volume' )[0].firstChild.data/5.12)+'%' );
var statetag = status.getElementsByTagName( 'state' );
if( statetag.length > 0 )
{
set_text( 'state', statetag[0].firstChild.data );
}
else
{
set_text( 'state', '(?)' );
}
if( slider_mouse_down == 0 )
{
document.getElementById( 'main_slider_point' ).style.left = slider_position;
}
var statustag = status.getElementsByTagName( 'state' );
if( statustag.length > 0 ? statustag[0].firstChild.data == "playing" : 0 )
{
document.getElementById( 'btn_pause_img' ).setAttribute( 'src', '/old/images/pause.png' );
document.getElementById( 'btn_pause_img' ).setAttribute( 'alt', 'Pause' );
document.getElementById( 'btn_pause' ).setAttribute( 'title', 'Pause' );
}
else
{
document.getElementById( 'btn_pause_img' ).setAttribute( 'src', '/old/images/play.png' );
document.getElementById( 'btn_pause_img' ).setAttribute( 'alt', 'Play' );
document.getElementById( 'btn_pause' ).setAttribute( 'title', 'Play' );
}
var randomtag = status.getElementsByTagName( 'random' );
if( randomtag.length > 0 ? randomtag[0].firstChild.data == "1" : 0)
setclass( document.getElementById( 'btn_shuffle'), 'on' );
else
setclass( document.getElementById( 'btn_shuffle'), 'off' );
var looptag = status.getElementsByTagName( 'loop' );
if( looptag.length > 0 ? looptag[0].firstChild.data == "1" : 0)
setclass( document.getElementById( 'btn_loop'), 'on' );
else
setclass( document.getElementById( 'btn_loop'), 'off' );
var repeattag = status.getElementsByTagName( 'repeat' );
if( repeattag.length > 0 ? repeattag[0].firstChild.data == "1" : 0 )
setclass( document.getElementById( 'btn_repeat'), 'on' );
else
setclass( document.getElementById( 'btn_repeat'), 'off' );
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
{
/*alert( 'Error! HTTP server replied: ' + req.status );*/
}
}
}
/* parse playlist.xml */
function parse_playlist()
{
if( req.readyState == 4 )
{
if( req.status == 200 )
{
var answer = req.responseXML.documentElement;
var playtree = document.getElementById( 'playtree' );
var pos = document.createElement( "div" );
var pos_top = pos;
var elt = answer.firstChild;
pl_cur_id = 0; /* changed to the current id is there actually
* is a current id */
while( elt )
{
if( elt.nodeName == "node" )
{
if( pos.hasChildNodes() )
pos.appendChild( document.createElement( "br" ) );
var nda = document.createElement( 'a' );
nda.setAttribute( 'href', 'javascript:toggle_show_node(\''+elt.getAttribute( 'id' )+'\');' );
var ndai = document.createElement( 'img' );
ndai.setAttribute( 'src', '/old/images/minus.png' );
ndai.setAttribute( 'alt', '[-]' );
ndai.setAttribute( 'id', 'pl_img_'+elt.getAttribute( 'id' ) );
nda.appendChild( ndai );
pos.appendChild( nda );
pos.appendChild( document.createTextNode( ' ' + elt.getAttribute( 'name' ) ) );
if( elt.getAttribute( 'ro' ) == 'rw' )
{
pos.appendChild( document.createTextNode( ' ' ) );
var del = document.createElement( "a" );
del.setAttribute( 'href', 'javascript:pl_delete('+elt.getAttribute( 'id' )+')' );
var delimg = document.createElement( "img" );
delimg.setAttribute( 'src', '/old/images/delete_small.png' );
delimg.setAttribute( 'alt', '(delete)' );
del.appendChild( delimg );
pos.appendChild( del );
}
var nd = document.createElement( "div" );
setclass( nd, 'pl_node' );
nd.setAttribute( 'id', 'pl_'+elt.getAttribute( 'id' ) );
pos.appendChild( nd );
}
else if( elt.nodeName == "leaf" )
{
if( pos.hasChildNodes() )
pos.appendChild( document.createElement( "br" ) );
var pl = document.createElement( "a" );
setclass( pl, 'pl_leaf' );
pl.setAttribute( 'href', 'javascript:pl_play('+elt.getAttribute( 'id' )+');' );
pl.setAttribute( 'id', 'pl_'+elt.getAttribute( 'id' ) );
if( elt.getAttribute( 'current' ) == 'current' )
{
pl.style.fontWeight = 'bold';
var nowplaying = document.getElementById( 'nowplaying' );
clear_children( nowplaying );
nowplaying.appendChild( document.createTextNode( elt.getAttribute( 'name' ) ) );
pl.appendChild( document.createTextNode( '* '));
pl_cur_id = elt.getAttribute( 'id' );
}
pl.setAttribute( 'title', elt.getAttribute( 'uri' ));
pl.appendChild( document.createTextNode( elt.getAttribute( 'name' ) ) );
var duration = elt.getAttribute( 'duration' );
if( duration > 0 )
pl.appendChild( document.createTextNode( " (" + format_time( elt.getAttribute( 'duration' ) ) + ")" ) );
pos.appendChild( pl );
if( elt.getAttribute( 'ro' ) == 'rw' )
{
pos.appendChild( document.createTextNode( ' ' ) );
var del = document.createElement( "a" );
del.setAttribute( 'href', 'javascript:pl_delete('+elt.getAttribute( 'id' )+')' );
var delimg = document.createElement( "img" );
delimg.setAttribute( 'src', '/old/images/delete_small.png' );
delimg.setAttribute( 'alt', '(delete)' );
del.appendChild( delimg );
pos.appendChild( del );
}
}
if( elt.firstChild )
{
elt = elt.firstChild;
pos = pos.lastChild;
}
else if( elt.nextSibling )
{
elt = elt.nextSibling;
pos = pos;
}
else
{
while( ! elt.parentNode.nextSibling )
{
elt = elt.parentNode;
if( ! elt.parentNode ) break;
pos = pos.parentNode;
}
if( ! elt.parentNode ) break;
elt = elt.parentNode.nextSibling;
pos = pos.parentNode;
}
}
clear_children( playtree );
playtree.appendChild( pos_top );
}
else
{
/*alert( 'Error! HTTP server replied: ' + req.status );*/
}
}
}
/* parse browse.xml */
function parse_browse_dir( )
{
if( req.readyState == 4 )
{
if( req.status == 200 )
{
var answer = req.responseXML.documentElement;
if( !answer ) return;
var browser = document.getElementById( 'browser' );
var pos = document.createElement( "div" );
var elt = answer.firstChild;
while( elt )
{
if( elt.nodeName == "element" )
{
var item = document.createElement( "a" );
setclass( item, 'browser' );
if( elt.getAttribute( 'type' ) == 'dir' )
{
item.setAttribute( 'href', 'javascript:browse_dir(\''+addslashes(escapebackslashes(elt.getAttribute( 'path' )))+'\');');
}
else
{
item.setAttribute( 'href', 'javascript:browse_path(\''+addslashes(escapebackslashes(elt.getAttribute( 'path' )))+'\');' );
}
item.appendChild( document.createTextNode( elt.getAttribute( 'name' ) ) );
pos.appendChild( item );
if( elt.getAttribute( 'type' ) == 'dir' )
{
pos.appendChild( document.createTextNode( ' ' ) );
var item = document.createElement( "a" );
setclass( item, 'browser' );
item.setAttribute( 'href', 'javascript:browse_path(\''+addslashes(escapebackslashes(elt.getAttribute( 'path' )))+'\');');
item.appendChild( document.createTextNode( '(select)' ) );
pos.appendChild( item );
}
pos.appendChild( document.createElement( "br" ) );
}
elt = elt.nextSibling;
}
clear_children( browser );
browser.appendChild( pos );
}
else
{
/*alert( 'Error! HTTP server replied: ' + req.status );*/
}
}
}
/**********************************************************************
* Input dialog functions
*********************************************************************/
function hide_input( )
{
document.getElementById( 'input_file' ).style.display = 'none';
document.getElementById( 'input_disc' ).style.display = 'none';
document.getElementById( 'input_network' ).style.display = 'none';
document.getElementById( 'input_fake' ).style.display = 'none';
}
/* update the input MRL using data from the input file helper */
/* FIXME ... subs support */
function update_input_file()
{
var mrl = document.getElementById( 'input_mrl' );
mrl.value = value( 'input_file_filename' );
}
/* update the input MRL using data from the input disc helper */
function update_input_disc()
{
var mrl = document.getElementById( 'input_mrl' );
var type = radio_value( "input_disc_type" );
var device = value( "input_disc_dev" );
var title = check_and_replace_int( 'input_disc_title', 0 );
var chapter = check_and_replace_int( 'input_disc_chapter', 0 );
var subs = check_and_replace_int( 'input_disc_subtrack', '' );
var audio = check_and_replace_int( 'input_disc_audiotrack', 0 );
mrl.value = "";
if( type == "dvd" )
{
mrl.value += "dvd://";
}
else if( type == "dvdsimple" )
{
mrl.value += "dvdsimple://";
}
else if( type == "vcd" )
{
mrl.value += "vcd://";
}
else if( type == "cdda" )
{
mrl.value += "cdda://";
}
mrl.value += device;
if( title )
{
mrl.value += "@"+title;
if( chapter && type != "cdda" )
mrl.value += ":"+chapter;
}
remove_input_options( ':sub-track' );
remove_input_options( ':audio-track' );
if( type != "cdda" )
{
if( subs != '' )
add_input_option( ":sub-track="+subs );
if( audio != '' )
add_input_option( ":audio-track="+audio );
}
}
/* update the input MRL using data from the input network helper */
function update_input_net()
{
var mrl = document.getElementById( 'input_mrl' );
var type = radio_value( "input_net_type" );
check_and_replace_int( 'input_net_udp_port', 1234 );
check_and_replace_int( 'input_net_udpmcast_port', 1234 );
mrl.value = "";
if( type == "udp" )
{
mrl.value += "udp://";
if( value( 'input_net_udp_port' ) )
mrl.value += ":"+value( 'input_net_udp_port' );
}
else if( type == "udpmcast" )
{
mrl.value += "udp://@"+value( 'input_net_udpmcast_address');
if( value( 'input_net_udpmcast_port' ) )
mrl.value += ":"+value( 'input_net_udpmcast_port' );
}
else if( type == "http" )
{
var url = value( 'input_net_http_url' );
if( url.substring(0,7) != "http://"
&& url.substring(0,8) != "https://"
&& url.substring(0,6) != "ftp://"
&& url.substring(0,6) != "mms://"
&& url.substring(0,7) != "mmsh://" )
mrl.value += "http://";
mrl.value += url;
}
else if( type == "rtsp" )
{
var url = value( 'input_net_rtsp_url' );
if( url.substring(0,7) != "rtsp://" )
mrl.value += "rtsp://";
mrl.value += url;
}
remove_input_options( ':access-filter' );
if( checked( "input_net_timeshift" ) )
add_input_option( ":access-filter=timeshift" );
}
/* update the input MRL using data from the input fake helper */
function update_input_fake()
{
remove_input_options( ":fake" );
var mrl = document.getElementById( 'input_mrl' );
mrl.value = "fake://";
add_input_option( ":fake-file=" + value( "input_fake_filename" ) );
if( value( "input_fake_width" ) )
add_input_option( ":fake-width=" + value( "input_fake_width" ) );
if( value( "input_fake_height" ) )
add_input_option( ":fake-height=" + value( "input_fake_height" ) );
if( value( "input_fake_ar" ) )
add_input_option( ":fake-ar=" + value( "input_fake_ar" ) );
}
/**********************************************************************
* Sout dialog functions
*********************************************************************/
/* toggle show the full sout interface */
function toggle_show_sout_helper()
{
var element = document.getElementById( "sout_helper" );
if( element.style.display == 'block' )
{
element.style.display = 'none';
document.getElementById( "sout_helper_toggle" ).value = 'Full sout interface';
}
else
{
element.style.display = 'block';
document.getElementById( "sout_helper_toggle" ).value = 'Hide sout interface';
}
}
/* update the sout MRL using data from the sout_helper */
function update_sout()
{
var option = "";
/* Remove all options starting with :sout since we're going to write them
* again. */
remove_input_options( ":sout" );
check_and_replace_int( 'sout_http_port', 8080 );
check_and_replace_int( 'sout_mmsh_port', 8080 );
check_and_replace_int( 'sout_rtp_port', 1234 );
check_and_replace_int( 'sout_udp_port', 1234 );
check_and_replace_int( 'sout_ttl', 1 );
if( checked( 'sout_soverlay' ) )
{
disable( 'sout_scodec' );
disable( 'sout_sub' );
}
else
{
enable( 'sout_scodec' );
enable( 'sout_sub' );
}
var transcode = checked( 'sout_vcodec_s' ) || checked( 'sout_acodec_s' )
|| checked( 'sout_sub' ) || checked( 'sout_soverlay' );
if( transcode )
{
option = ":sout=#transcode{";
var alot = false; /* alot == at least one transcode */
if( checked( 'sout_vcodec_s' ) )
{
option += "vcodec="+value( 'sout_vcodec' )+",vb="+value( 'sout_vb' )+",scale="+value( 'sout_scale' );
alot = true;
}
if( checked( 'sout_acodec_s' ) )
{
if( alot ) option += ",";
option += "acodec="+value( 'sout_acodec' )+",ab="+value( 'sout_ab' );
if( value( 'sout_channels' ) )
option += ",channels="+value( 'sout_channels' );
alot = true;
}
if( checked( 'sout_soverlay' ) )
{
if( alot ) option += ",";
option += "soverlay";
alot = true;
}
else if( checked( 'sout_sub' ) )
{
if( alot ) option += ",";
option += "scodec="+value( 'sout_scodec' );
alot = true;
}
option += value( 'sout_transcode_extra' );
option += "}";
}
var output = checked( 'sout_display' ) + checked( 'sout_file' )
+ checked( 'sout_http' ) + checked( 'sout_mmsh' )
+ checked( 'sout_rtp' ) + checked( 'sout_udp' );
if( output )
{
if( transcode )
option += ":";
else
option += ":sout=#";
var aloo = false; /* aloo == at least one output */
var mux = radio_value( 'sout_mux' );
var ttl = parseInt( value( 'sout_ttl' ) );
if( output > 1 ) option += "duplicate{";
if( checked( 'sout_display' ) )
{
if( output > 1 ) option += "dst="
option += "display";
aloo = true;
}
if( checked( 'sout_file' ) )
{
if( aloo ) option += ",";
if( output > 1 ) option += "dst="
option += "std{access=file,mux="+mux+",dst="+value( 'sout_file_filename' )+"}";
aloo = true;
}
if( checked( 'sout_http' ) )
{
if( aloo ) option += ",";
if( output > 1 ) option += "dst="
option += "std{access=http,mux="+mux+",dst="+value( 'sout_http_addr' );
if( value( 'sout_http_port' ) )
option += ":"+value( 'sout_http_port' );
option += "}";
aloo = true;
}
if( checked( 'sout_mmsh' ) )
{
if( aloo ) option += ",";
if( output > 1 ) option += "dst="
option += "std{access=mmsh,mux="+mux+",dst="+value( 'sout_mmsh_addr' );
if( value( 'sout_mmsh_port' ) )
option += ":"+value( 'sout_mmsh_port' );
option += "}";
aloo = true;
}
if( checked( 'sout_rtp' ) )
{
if( aloo ) option += ",";
if( output > 1 ) option += "dst="
option += "std{access=rtp";
if( ttl ) option += "{ttl="+ttl+"}";
option += ",mux="+mux+",dst="+value( 'sout_rtp_addr' );
if( value( 'sout_rtp_port' ) )
option += ":"+value( 'sout_rtp_port' );
if( checked( 'sout_sap' ) )
{
option += ",sap";
if( value( 'sout_sap_group' ) != '' )
{
option += ",group=\""+value( 'sout_sap_group' )+"\"";
}
option += ",name=\""+value( 'sout_sap_name' )+"\"";
}
option += "}";
aloo = true;
}
if( checked( 'sout_udp' ) )
{
if( aloo ) option += ",";
if( output > 1 ) option += "dst="
option += "std{access=udp";
if( ttl ) option += "{ttl="+ttl+"}";
option += ",mux="+mux+",dst="+value( 'sout_udp_addr' );
if( value('sout_udp_port' ) )
option += ":"+value( 'sout_udp_port' );
if( checked( 'sout_sap' ) )
{
option += ",sap";
if( value( 'sout_sap_group' ) != '' )
{
option += ",group=\""+value( 'sout_sap_group' )+"\"";
}
option += ",name=\""+value( 'sout_sap_name' )+"\"";
}
option += "}";
aloo = true;
}
if( output > 1 ) option += "}";
}
if( option != "" )
input_options.push( option );
if( ( transcode || output ) && checked( 'sout_all' ) )
input_options.push( ":sout-all" );
var mrl = document.getElementById( 'sout_mrl' );
mrl.value = option;
refresh_input_options_list();
}
/* reset sout mrl value */
function reset_sout()
{
document.getElementById('sout_mrl').value = value('sout_old_mrl');
}
/* save sout mrl value */
function save_sout()
{
document.getElementById('sout_old_mrl').value = value('sout_mrl');
}
function refresh_input_options_list()
{
var iol = document.getElementById( 'input_options_list' );
clear_children( iol );
input_options.sort();
for( i in input_options )
{
var o = document.createElement( 'div' );
var ot = document.createElement( 'input' );
ot.setAttribute( 'type', 'text' );
ot.setAttribute( 'size', '60' );
ot.setAttribute( 'value', input_options[i] );
ot.setAttribute( 'id', 'input_option_item_'+i );
ot.setAttribute( 'onchange', 'javascript:save_input_option('+i+',this.value);' );
ot.setAttribute( 'onfocus', 'if( this.value == ":option=value" ) this.value = ":";' );
ot.setAttribute( 'onblur', 'if( this.value == ":" ) this.value = ":option=value";' );
o.appendChild( ot );
var od = document.createElement( 'a' );
od.setAttribute( 'href', 'javascript:delete_input_option('+i+');' );
var delimg = document.createElement( "img" );
delimg.setAttribute( 'src', '/old/images/delete_small.png' );
delimg.setAttribute( 'alt', '(delete)' );
od.appendChild( delimg );
o.appendChild( od );
iol.appendChild( o );
}
}
function delete_input_option( i )
{
input_options.splice(i,1);
refresh_input_options_list();
}
function save_input_option( i, value )
{
input_options[i] = value;
refresh_input_options_list();
}
function add_input_option( value )
{
input_options.push( value );
refresh_input_options_list();
}
function remove_input_options( prefix )
{
for( i in input_options )
if( input_options[i].substring( 0, prefix.length ) == prefix )
{
delete input_options[i];
i--;
}
}
/**********************************************************************
* Browser dialog functions
*********************************************************************/
/* only browse() should be called directly */
function browse( dest )
{
document.getElementById( 'browse_dest' ).value = dest;
document.getElementById( 'browse_lastdir' ).value;
browse_dir( document.getElementById( 'browse_lastdir' ).value );
show( 'browse' );
}
function browse_dir( dir )
{
document.getElementById( 'browse_lastdir' ).value = dir;
loadXMLDoc( 'requests/browse.xml?dir='+encodeURIComponent(dir), parse_browse_dir );
}
function browse_path( p )
{
document.getElementById( value( 'browse_dest' ) ).value = p;
hide( 'browse' );
document.getElementById( value( 'browse_dest' ) ).focus();
}
function refresh_albumart( force )
{
if( albumart_id != pl_cur_id || force )
{
var now = new Date();
var albumart = document.getElementById( 'albumart' );
albumart.src = '/art?timestamp=' + now.getTime();
albumart_id = pl_cur_id;
}
}
/**********************************************************************
* Periodically update stuff in the interface
*********************************************************************/
function loop_refresh_status()
{
setTimeout( 'loop_refresh_status()', 1000 );
update_status();
}
function loop_refresh_playlist()
{
/* setTimeout( 'loop_refresh_playlist()', 10000 ); */
update_playlist();
}
function loop_refresh_albumart()
{
setTimeout( 'loop_refresh_albumart()', 1000 );
refresh_albumart( false );
}
function loop_refresh()
{
setTimeout( 'loop_refresh_status()', 1 );
setTimeout( 'loop_refresh_playlist()', 1 );
setTimeout( 'loop_refresh_albumart()', 1 );
}
/*****************************************************************************
* vlm.js: VLC media player web interface
*****************************************************************************
* Copyright (C) 2005-2014 VLC authors and VideoLAN
* $Id$
*
* Authors: Antoine Cellerier <dionoea -at- videolan -dot- org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
/* replace quotes and spaces by underscores */
function addunderscores( str ){ return str.replace(/\'|\"| /g, '_'); }
/**********************************************************************
* 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;
show( 'input' );
}
function vlm_input_change()
{
document.getElementById( value( 'input_dest' ) ).value = value( 'input_mrl' ).replace( /\ :/g, " option " );
hide( 'input' );
document.getElementById( value( 'input_dest' ) ).focus();
}
function vlm_output_edit( dest )
{
document.getElementById( 'sout_dest' ).value = dest;
show( 'sout' );
}
function vlm_output_change()
{
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 hide_vlm_add()
{
document.getElementById( 'vlm_add_broadcast' ).style.display = 'none';
document.getElementById( 'vlm_add_vod' ).style.display = 'none';
document.getElementById( 'vlm_add_schedule' ).style.display = 'none';
document.getElementById( 'vlm_add_other' ).style.display = 'none';
}
function toggle_schedule_date()
{
if( checked( 'vlm_schedule_now' ) )
{
disable( 'vlm_schedule_year' );
disable( 'vlm_schedule_month' );
disable( 'vlm_schedule_day' );
disable( 'vlm_schedule_hour' );
disable( 'vlm_schedule_minute' );
disable( 'vlm_schedule_second' );
}
else
{
enable( 'vlm_schedule_year' );
enable( 'vlm_schedule_month' );
enable( 'vlm_schedule_day' );
enable( 'vlm_schedule_hour' );
enable( 'vlm_schedule_minute' );
enable( 'vlm_schedule_second' );
}
}
function toggle_schedule_repeat()
{
if( checked( 'vlm_schedule_repeat' ) )
{
enable( 'vlm_schedule_period_year' );
enable( 'vlm_schedule_period_month' );
enable( 'vlm_schedule_period_day' );
enable( 'vlm_schedule_period_hour' );
enable( 'vlm_schedule_period_minute' );
enable( 'vlm_schedule_period_second' );
enable( 'vlm_schedule_repeat_times' );
}
else
{
disable( 'vlm_schedule_period_year' );
disable( 'vlm_schedule_period_month' );
disable( 'vlm_schedule_period_day' );
disable( 'vlm_schedule_period_hour' );
disable( 'vlm_schedule_period_minute' );
disable( 'vlm_schedule_period_second' );
disable( 'vlm_schedule_repeat_times' );
}
}
function vlm_schedule_type_change( name )
{
var act = document.getElementById( 'vlm_elt_' + name + '_action' ).value;
var itemname = document.getElementById( 'vlm_elt_' + name + '_name' );
var opt = document.getElementById( 'vlm_elt_' + name + '_opt' );
if( act == "play" || act == "pause" || act == "stop" )
{
itemname.style.display = "";
opt.style.display = "none";
}
else if( act == "seek" )
{
itemname.style.display = "";
opt.style.display = "";
}
else
{
itemname.style.display = "none";
opt.style.display = "";
}
}
function sanitize_input( str )
{
return str.replace( /\"/g, '\\\"' ).replace( /^/, '"' ).replace( /$/, '"' ).replace( /\ option\ /g, '" option "' );
}
function update_vlm_add_broadcast()
{
var cmd = document.getElementById( 'vlm_command' );
if( value( 'vlm_broadcast_name' ) )
{
cmd.value = "new " + addunderscores( value( 'vlm_broadcast_name' ) )
+ " broadcast";
if( checked( 'vlm_broadcast_enabled' ) )
{
cmd.value += " enabled";
}
if( checked( 'vlm_broadcast_loop' ) )
{
cmd.value += " loop";
}
if( value( 'vlm_broadcast_input' ) )
{
cmd.value += " input " + sanitize_input( value( 'vlm_broadcast_input' ) );
}
if( value( 'vlm_broadcast_output' ) )
{
cmd.value += " output " + value( 'vlm_broadcast_output' );
}
}
else
{
cmd.value = "";
}
}
function update_vlm_add_vod()
{
var cmd = document.getElementById( 'vlm_command' );
if( value( 'vlm_vod_name' ) )
{
cmd.value = "new " + addunderscores( value( 'vlm_vod_name' ) )
+ " vod";
if( checked( 'vlm_vod_enabled' ) )
{
cmd.value += " enabled";
}
if( value( 'vlm_vod_input' ) )
{
cmd.value += " input " + sanitize_input( value( 'vlm_vod_input' ) );
}
if( value( 'vlm_vod_output' ) )
{
cmd.value += " output " + value( 'vlm_vod_output' );
}
}
else
{
cmd.value = "";
}
}
function update_vlm_add_schedule()
{
var cmd = document.getElementById( 'vlm_command' );
check_and_replace_int( 'vlm_schedule_year', '0000' );
check_and_replace_int( 'vlm_schedule_month', '00' );
check_and_replace_int( 'vlm_schedule_day', '00' );
check_and_replace_int( 'vlm_schedule_hour', '00' );
check_and_replace_int( 'vlm_schedule_minute', '00' );
check_and_replace_int( 'vlm_schedule_second', '00' );
check_and_replace_int( 'vlm_schedule_period_year', '0000' );
check_and_replace_int( 'vlm_schedule_period_month', '00' );
check_and_replace_int( 'vlm_schedule_period_day', '00' );
check_and_replace_int( 'vlm_schedule_period_hour', '00' );
check_and_replace_int( 'vlm_schedule_period_minute', '00' );
check_and_replace_int( 'vlm_schedule_period_second', '00' );
if( value( 'vlm_schedule_name' ) )
{
cmd.value = "new " + addunderscores( value( 'vlm_schedule_name' ) ) + " schedule";
if( checked( 'vlm_schedule_enabled' ) )
{
cmd.value += " enabled";
}
if( checked( 'vlm_schedule_now' ) )
{
cmd.value += " date now";
}
else
{
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' );
}
if( checked( 'vlm_schedule_repeat' ) )
{
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' );
if( value( 'vlm_schedule_repeat_times' ) != 0 )
{
cmd.value += " repeat " + (value( 'vlm_schedule_repeat_times' ) - 1 );
}
}
}
else
{
cmd.value = "";
}
}
function update_vlm_add_other()
{
var cmd = document.getElementById( 'vlm_command' );
cmd.value = "";
}
function clear_vlm_add()
{
document.getElementById( 'vlm_command' ).value = "";
document.getElementById( 'vlm_broadcast_name' ).value = "";
document.getElementById( 'vlm_vod_name' ).value = "";
}
function create_button( caption, action )
{
/* 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 )
{
var opt = document.createElement( 'option' );
opt.setAttribute( 'value', value );
opt.appendChild( document.createTextNode( caption ) );
return opt;
}
function parse_vlm_cmd()
{
if( req.readyState == 4 )
{
if( req.status == 200 )
{
var vlm_answer = req.responseXML.documentElement;
var error_tag = vlm_answer.getElementsByTagName( 'error' )[0];
var vlme = document.getElementById( 'vlm_error' );
clear_children( vlme );
if( error_tag.hasChildNodes() )
{
vlme.appendChild( document.createTextNode( 'Error: ' + error_tag.firstChild.data ) );
vlme.style.color = "#f00";
}
else
{
vlme.appendChild( document.createTextNode( 'Command successful (' + value( 'vlm_command' ) + ') ' ) );
vlme.style.color = "#0f0";
clear_vlm_add();
}
vlme.appendChild( create_button( 'clear', 'clear_children( document.getElementById( "vlm_error" ) );' ) );
vlm_get_elements();
}
}
}
function parse_vlm_elements()
{
if( req.readyState == 4 )
{
if( req.status == 200 )
{
var vlmb = document.getElementById( 'vlm_broadcast_list' );
var vlmv = document.getElementById( 'vlm_vod_list' );
var vlms = document.getElementById( 'vlm_schedule_list' );
clear_children( vlmb );
clear_children( vlmv );
clear_children( vlms );
answer = req.responseXML.documentElement;
var elt = answer.firstChild;
while( elt )
{
if( elt.nodeName == "broadcast" || elt.nodeName == "vod" )
{
var nb = document.createElement( 'div' );
setclass( nb, 'list_element' );
if( elt.nodeName == "broadcast" )
{
vlmb.appendChild( nb );
}
else
{
vlmv.appendChild( nb );
}
var nbname = document.createElement( 'b' );
nbname.appendChild( document.createTextNode( elt.getAttribute( 'name' ) ) );
nb.appendChild( nbname );
if( elt.getAttribute( 'enabled' ) == 'yes' )
{
nb.appendChild( document.createTextNode( " enabled " ) );
nb.appendChild( create_button( "Disable", 'vlm_disable("'+elt.getAttribute( 'name' ) + '");' ) );
}
else
{
nb.appendChild( document.createTextNode( " disabled " ) );
nb.appendChild( create_button( "Enable", 'vlm_enable("'+elt.getAttribute( 'name' ) + '");' ) );
}
if( elt.nodeName == "broadcast" )
{
if( elt.getAttribute( 'loop' ) == 'yes' )
{
nb.appendChild( document.createTextNode( " 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' ) + '");' ) );
}
if( elt.getAttribute( 'enabled' ) == 'yes' )
{
nb.appendChild( document.createTextNode( " " ) );
nb.appendChild( create_button( 'Play', 'vlm_play("'+elt.getAttribute('name')+'");' ) );
}
nb.appendChild( document.createTextNode( " " ) );
nb.appendChild( create_button( 'Pause', 'vlm_pause("'+elt.getAttribute('name')+'");' ) );
nb.appendChild( document.createTextNode( " " ) );
nb.appendChild( create_button( 'Stop', 'vlm_stop("'+elt.getAttribute('name')+'");' ) );
}
nb.appendChild( document.createTextNode( " " ) );
nb.appendChild( create_button( 'Delete', 'vlm_delete("'+elt.getAttribute( 'name' ) + '");' ) );
var list = document.createElement( "ul" );
/* begin input list */
var item = document.createElement( "li" );
list.appendChild( item );
item.appendChild( document.createTextNode( "Inputs: " ) );
var text = document.createElement( "input" );
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");') );
item.appendChild( document.createTextNode( ' ' ) );
item.appendChild( create_button( 'Add input', 'vlm_add_input("'+elt.getAttribute('name')+'",document.getElementById("vlm_elt_'+elt.getAttribute('name')+'_input").value );' ) );
var inputs = elt.getElementsByTagName( 'input' );
if( inputs.length > 0 )
{
var ilist = document.createElement( "ol" );
ilist.setAttribute( 'start', '1' );
item.appendChild( ilist );
for( i = 0; i < inputs.length; i++ )
{
var item = document.createElement( "li" );
item.appendChild( document.createTextNode( inputs[i].firstChild.data + " " ) );
item.appendChild( create_button( "Delete", 'vlm_delete_input("' + elt.getAttribute( 'name' ) + '", '+(i+1)+' );' ) );
ilist.appendChild( item );
}
}
/* end of input list */
/* output */
var item = document.createElement( "li" );
outputelt = elt.getElementsByTagName( 'output' )[0];
if( outputelt.hasChildNodes() )
{
output = outputelt.firstChild.data;
}
else
{
output = "";
}
item.appendChild( document.createTextNode( 'Output: ' ) );
var text = document.createElement( "input" );
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( ' ' ) );
item.appendChild( create_button( 'Edit', 'vlm_output_edit("vlm_elt_'+elt.getAttribute('name')+'_output");' ) );
item.appendChild( document.createTextNode( ' ' ) );
item.appendChild( create_button( 'Change output', 'vlm_output("'+elt.getAttribute( 'name' )+ '",document.getElementById("vlm_elt_'+elt.getAttribute( 'name' )+'_output").value);' ) );
list.appendChild( item );
/* end of output */
/* begin options list */
var item = document.createElement( "li" );
list.appendChild( item );
item.appendChild( document.createTextNode( "Options: " ) );
/* Add option */
var text = document.createElement( "input" );
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 );' ) );
var options = elt.getElementsByTagName( 'option' );
if( options.length > 0 )
{
var olist = document.createElement( "ul" );
item.appendChild( olist );
for( i = 0; i < options.length; i++ )
{
var item = document.createElement( "li" );
item.appendChild( document.createTextNode( options[i].firstChild.data ) );
olist.appendChild( item );
}
}
/* end of options */
/* Instances list */
var instances = elt.getElementsByTagName( 'instance' );
if( instances.length > 0 )
{
var item = document.createElement("li");
var ilist = document.createElement("ul");
list.appendChild( item );
item.appendChild(document.createTextNode("Instances:"));
item.appendChild( ilist );
for( i = 0; i < instances.length; i++ )
{
var iname = instances[i].getAttribute( 'name' );
var istate = instances[i].getAttribute( 'state' );
var iposition = Number( instances[i].getAttribute( 'position' ) * 100);
var itime = Math.floor( instances[i].getAttribute( 'time' ) / 1000000);
var ilength = Math.floor( instances[i].getAttribute( 'length' ) / 1000000);
var irate = instances[i].getAttribute( 'rate' );
var ititle = instances[i].getAttribute( 'title' );
var ichapter = instances[i].getAttribute( 'chapter' );
var iseekable = instances[i].getAttribute( 'seekable' );
var iplaylistindex = instances[i].getAttribute( 'playlistindex' );
var item = document.createElement( "li" );
item.appendChild( document.createTextNode( iname + ": " + istate + " (" + iplaylistindex + ") " + (iposition.toFixed(2)) + "%" + " " + format_time( itime ) + "/" + format_time( ilength ) ) );
ilist.appendChild( item );
}
}
/* end of instances list */
nb.appendChild( list );
}
else if( elt.nodeName == "schedule" )
{
var nb = document.createElement( 'div' );
setclass( nb, 'list_element' );
vlms.appendChild( nb );
var nbname = document.createElement( 'b' );
nbname.appendChild( document.createTextNode( elt.getAttribute( 'name' ) ) );
nb.appendChild( nbname );
if( elt.getAttribute( 'enabled' ) == 'yes' )
{
nb.appendChild( document.createTextNode( " enabled " ) );
nb.appendChild( create_button( "Disable", 'vlm_disable("'+elt.getAttribute( 'name' ) + '");' ) );
}
else
{
nb.appendChild( document.createTextNode( " disabled " ) );
nb.appendChild( create_button( "Enable", 'vlm_enable("'+elt.getAttribute( 'name' ) + '");' ) );
}
nb.appendChild( document.createTextNode( " " ) );
nb.appendChild( create_button( "Delete", 'vlm_delete("'+elt.getAttribute( 'name' ) + '");' ) );
var list = document.createElement( 'ul' );
var item = document.createElement( 'li' );
item.appendChild( document.createTextNode( "Date: " + elt.getAttribute( 'date' ) ) );
list.appendChild( item );
var item = document.createElement( 'li' );
item.appendChild( document.createTextNode( "Period (in seconds): " + elt.getAttribute( 'period' ) ) );
list.appendChild( item );
var item = document.createElement( 'li' );
if( elt.getAttribute( 'repeat' ) == -1 )
{
item.appendChild( document.createTextNode( "Number of repeats left: for ever" ) );
}
else
{
item.appendChild( document.createTextNode( "Number of repeats left: " + elt.getAttribute( 'repeat' ) ) );
}
list.appendChild( item );
var commands = elt.getElementsByTagName( 'command' );
for( i = 0; i < commands.length; i++ )
{
var item = document.createElement( "li" );
item.appendChild( document.createTextNode( "Command: " + commands[i].firstChild.data + " " ) );
list.appendChild( item );
}
var item = document.createElement( 'li' );
var sel = document.createElement( 'select' );
sel.setAttribute( 'id', 'vlm_elt_'+elt.getAttribute('name')+'_action' );
sel.setAttribute( 'onchange', 'vlm_schedule_type_change("'+elt.getAttribute('name')+'");');
sel.appendChild( create_option( 'play', 'play' ) );
sel.appendChild( create_option( 'pause', 'pause' ) );
sel.appendChild( create_option( 'stop', 'stop' ) );
sel.appendChild( create_option( 'seek', 'seek' ) );
sel.appendChild( create_option( '(other)', '' ) );
item.appendChild( sel );
item.appendChild( document.createTextNode( " " ) );
var text = document.createElement( 'input' );
text.setAttribute( 'type', 'text' );
text.setAttribute( 'id', 'vlm_elt_'+elt.getAttribute('name')+'_name' );
text.setAttribute( 'size', '10' );
text.setAttribute( 'value', '(name)' );
text.setAttribute( 'onfocus', 'if( this.value == "(name)" ) this.value = "";' );
text.setAttribute( 'onblur', 'if( this.value == "" ) this.value = "(name)";' );
item.appendChild( text );
item.appendChild( document.createTextNode( " " ) );
text = document.createElement( 'input' );
text.setAttribute( 'type', 'text' );
text.setAttribute( 'id', 'vlm_elt_'+elt.getAttribute('name')+'_opt' );
text.setAttribute( 'size', '30' );
text.setAttribute( 'value', '(options)' );
text.setAttribute( 'onfocus', 'if( this.value == "(options)" ) this.value = "";' );
text.setAttribute( 'onblur', 'if( this.value == "" ) this.value = "(options)";' );
item.appendChild( text );
item.appendChild( document.createTextNode( " " ) );
item.appendChild( create_button( "Append command", 'vlm_schedule_append("' + elt.getAttribute( 'name' ) + '");') );
list.appendChild( item );
nb.appendChild( list );
vlm_schedule_type_change( elt.getAttribute('name') );
}
elt = elt.nextSibling;
}
}
}
}
function vlm_cmd( cmd )
{
loadXMLDoc( 'requests/vlm_cmd.xml?command='+encodeURIComponent(cmd), parse_vlm_cmd );
}
function vlm_get_elements( )
{
loadXMLDoc( 'requests/vlm.xml', parse_vlm_elements );
}
/* helper functions */
function vlm_disable( name )
{
document.getElementById( 'vlm_command' ).value = "setup "+name+" disabled";
vlm_cmd( value( 'vlm_command' ) );
}
function vlm_enable( name )
{
document.getElementById( 'vlm_command' ).value = "setup "+name+" enabled";
vlm_cmd( value( 'vlm_command' ) );
}
function vlm_loop( name )
{
document.getElementById( 'vlm_command' ).value = "setup "+name+" loop";
vlm_cmd( value( 'vlm_command' ) );
}
function vlm_unloop( name )
{
document.getElementById( 'vlm_command' ).value = "setup "+name+" unloop";
vlm_cmd( value( 'vlm_command' ) );
}
function vlm_play( name )
{
document.getElementById( 'vlm_command' ).value = "control "+name+" play";
vlm_cmd( value( 'vlm_command' ) );
}
function vlm_pause( name )
{
document.getElementById( 'vlm_command' ).value = "control "+name+" pause";
vlm_cmd( value( 'vlm_command' ) );
}
function vlm_stop( name )
{
document.getElementById( 'vlm_command' ).value = "control "+name+" stop";
vlm_cmd( value( 'vlm_command' ) );
}
function vlm_delete( name )
{
document.getElementById( 'vlm_command' ).value = "del "+name;
vlm_cmd( value( 'vlm_command' ) );
}
function vlm_delete_input( name, num )
{
document.getElementById( 'vlm_command' ).value = "setup "+name+" inputdeln "+num;
vlm_cmd( value( 'vlm_command' ) );
}
function vlm_add_input( name, input )
{
document.getElementById( 'vlm_command' ).value = "setup "+name+" input "+sanitize_input( input );
vlm_cmd( value( 'vlm_command' ) );
}
function vlm_output( name, output )
{
document.getElementById( 'vlm_command' ).value = "setup "+name+" output "+output;
vlm_cmd( value( 'vlm_command' ) );
}
function vlm_option( name, option )
{
document.getElementById( 'vlm_command' ).value = "setup "+name+" option "+option;
vlm_cmd( value( 'vlm_command' ) );
}
function vlm_batch( batch )
{
var i;
var commands = batch.split( '\n' );
for( i = 0; i < commands.length; i++ )
{
document.getElementById( 'vlm_command' ).value = commands[i];
vlm_cmd( value( 'vlm_command' ) );
}
}
function vlm_schedule_append( name )
{
var act = document.getElementById( 'vlm_elt_' + name + '_action' ).value;
document.getElementById( 'vlm_command' ).value = "setup " + name + " append ";
var itemname = document.getElementById( 'vlm_elt_' + name + '_name' ).value;
if( itemname == "(name)" ) itemname = "";
var opt = document.getElementById( 'vlm_elt_' + name + '_opt' ).value;
if( opt == "(options)" ) opt = "";
if( act == '' )
{
document.getElementById( 'vlm_command' ).value += opt;
}
else
{
document.getElementById( 'vlm_command' ).value += 'control ' + itemname + " " + act + " " + opt;
}
vlm_cmd( value( 'vlm_command' ) );
}
function vlm_send( )
{
vlm_cmd( value( 'vlm_command' ) );
}
/*****************************************************************************
* style.css: VLC media player web interface
*****************************************************************************
* Copyright (C) 2005-2006 the VideoLAN team
* $Id$
*
* Authors: Antoine Cellerier <dionoea -at- videolan -dot- org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
body {
background-color: #eee;
font-family: Arial, sans-serif;
font-size: 12pt;
text-align: center; /* Center on page - IE */
padding: 0px;
margin: 0px;
}
div {
padding: 0px;
margin: 0px;
text-align: left;
}
div.dialog {
width: 440pt;
background: #fff;
border: solid #000 1px;
margin: 10px auto; /* Center on page - Firefox */
padding: 0px;
overflow: hidden; /* so that the title bar doesn't overflow on
* firefox but still takes all the div's width
* in IE */
}
div#footer {
font-size: 8pt;
text-align: center;
}
.btn_text {
display: none;
}
form {
display: inline;
}
input, textarea {
border: solid #000 1px;
background-color: #fff;
}
div.helper {
margin: 10px;
padding: 10px 0px;
border: solid 1px #000;
}
div.helper hr {
border: solid 1px #000;
}
div.title {
width: 100%/*576px*/; /* see overflow:hidden several lines
* before for explanation */
background: #000 url('/images/vlc16x16.png') no-repeat top left;
padding-left: 24px;
color: #fff;
font-weight: bold;
}
div.title button {
border: 1px none #000;
padding: 0px;
background-color: #000;
color: #fff;
}
div.controls {
width: 100%;
padding: 3px 5px;
}
div.controls button {
border: 1px solid #fff;
padding: 0px;
background-color: #fff;
}
div.list {
padding: 1em;
}
div.list_element {
padding-bottom: 0.3em;
}
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#playtree {
min-height: 150px;
}
div.pl_node {
padding-left: 20px;
font-style: italic;
}
a.pl_leaf {
font-style: normal;
}
a.pl_leaf:hover {
color: #f00;
}
img {
border: 0px none black;
}
div.popup {
background-color: #fff;
overflow: hidden;
border: solid #888 1px;
margin: 10px auto; /* Center on page - Firefox */
position: absolute;
z-index: 2;
font-size: 0.8em;
}
div#browse {
width: 70%;
left: 15%;
}
div#browse div.title {
background-color: #008;
}
div#browser {
padding: 20px;
}
div#mosaic_list {
width: 50%;
left: 25%;
background: url('/old/images/white.png') repeat;
display: none;
}
.mosaic_bg {
background-color: #aaf;
}
.mosaic_tbl {
background-color: #faa;
}
.mosaic_itm {
background-color: #afa;
}
div#mosaic_layout {
border: 0px solid #000;
padding: 0px;
margin: 10px auto;
}
div#mosaic_dt {
border: 0px solid #000;
position: relative;
}
table#mosaic_table {
border-spacing: 0px 0px;
position: relative;
}
table#mosaic_table tr {
padding: 0px;
margin: 0px;
}
table#mosaic_table td {
border: 0px solid #000;
text-align: center;
padding: 0px;
margin: 0px;
}
table#mosaic_table input {
border: 0px;
background: transparent;
text-align: center;
}
textarea#mosaic_code {
padding: 0px;
display: block;
margin: 10px auto;
}
div.controls button.on {
background-color: #aaa;
}
div.controls button.off {
background-color: #fff;
}
div.menubtn {
display: inline;
}
div.menu {
position: absolute;
border: 1px solid #ccc;
padding: 5px;
margin-top: -5px;
background: url('/old/images/white.png') repeat;
z-index: 2;
display: none;
}
/* FIXME: still some div.menu > button around ? */
div.menu div,
div.menu button {
background: transparent;
cursor: pointer;
white-space: nowrap;
}
div.menu button.menuout {
border: 1px solid transparent;
}
div.menu div.menuover,
div.menu button.menuover {
background: #000;
color: #fff;
}
div.popup img.close {
position: absolute;
right: 2px;
top: 2px;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment