Commit c3537d93 authored by Antoine Cellerier's avatar Antoine Cellerier

* misc fixes. Should now work in IE

parent 4bc7b47e
...@@ -58,19 +58,19 @@ function format_time( s ) ...@@ -58,19 +58,19 @@ function format_time( s )
function in_play() function in_play()
{ {
input = value('input_mrl'); input_iesuxx = value('input_mrl');
if( value('sout_mrl') != '' ) if( value('sout_mrl') != '' )
input += ' '+value('sout_mrl'); input_iesuxx += ' '+value('sout_mrl');
url = 'requests/status.xml?command=in_play&input='+escape(input); url = 'requests/status.xml?command=in_play&input='+escape(input_iesuxx);
loadXMLDoc( url, parse_status ); loadXMLDoc( url, parse_status );
setTimeout( 'update_playlist()', 1000 ); setTimeout( 'update_playlist()', 1000 );
} }
function in_enqueue() function in_enqueue()
{ {
input = value('input_mrl'); input_iesuxx = value('input_mrl');
if( value('sout_mrl') != '' ) if( value('sout_mrl') != '' )
input += ' '+value('sout_mrl'); input_iesuxx += ' '+value('sout_mrl');
url = 'requests/status.xml?command=in_enqueue&input='+escape(input); url = 'requests/status.xml?command=in_enqueue&input='+escape(input_iesuxx);
loadXMLDoc( url, parse_status ); loadXMLDoc( url, parse_status );
setTimeout( 'update_playlist()', 1000 ); setTimeout( 'update_playlist()', 1000 );
} }
...@@ -129,19 +129,27 @@ function update_playlist() ...@@ -129,19 +129,27 @@ function update_playlist()
loadXMLDoc( 'requests/playlist.xml', parse_playlist ); loadXMLDoc( 'requests/playlist.xml', parse_playlist );
} }
function set_text( id, val )
{
elt = document.getElementById( id );
while( elt.hasChildNodes() )
elt.removeChild( elt.firstChild );
elt.appendChild( document.createTextNode( val ) );
}
function parse_status() function parse_status()
{ {
if( req.readyState == 4 ) if( req.readyState == 4 )
{ {
if( req.status == 200 ) if( req.status == 200 )
{ {
status = req.responseXML.documentElement; status_iesuxx = req.responseXML.documentElement;
document.getElementById( 'time' ).textContent = format_time( status.getElementsByTagName( 'time' )[0].firstChild.data ); set_text( 'time', format_time( status_iesuxx.getElementsByTagName( 'time' )[0].firstChild.data ) );
document.getElementById( 'length' ).textContent = format_time( status.getElementsByTagName( 'length' )[0].firstChild.data ); set_text( 'length', format_time( status_iesuxx.getElementsByTagName( 'length' )[0].firstChild.data ) );
if( status.getElementsByTagName( 'volume' ).length != 0 ) if( status_iesuxx.getElementsByTagName( 'volume' ).length != 0 )
document.getElementById( 'volume' ).textContent = Math.floor(status.getElementsByTagName( 'volume' )[0].firstChild.data/5.12)+"%"; set_text( 'volume', Math.floor(status_iesuxx.getElementsByTagName( 'volume' )[0].firstChild.data/512)+'%' );
document.getElementById( 'state' ).textContent = status.getElementsByTagName( 'state' )[0].firstChild.data; set_text( 'state', status_iesuxx.getElementsByTagName( 'state' )[0].firstChild.data );
if( status.getElementsByTagName( 'state' )[0].firstChild.data == "playing" ) if( status_iesuxx.getElementsByTagName( 'state' )[0].firstChild.data == "playing" )
{ {
document.getElementById( 'btn_pause_img' ).setAttribute( 'src', 'images/pause.png' ); document.getElementById( 'btn_pause_img' ).setAttribute( 'src', 'images/pause.png' );
} }
...@@ -164,7 +172,7 @@ function parse_playlist() ...@@ -164,7 +172,7 @@ function parse_playlist()
if( req.status == 200 ) if( req.status == 200 )
{ {
answer = req.responseXML.documentElement; answer = req.responseXML.documentElement;
playtree = document.getElementById( 'playtree' ); playtree_iesuxx = document.getElementById( 'playtree' );
/* pos = playtree; */ /* pos = playtree; */
pos = document.createElement( "div" ); pos = document.createElement( "div" );
pos_top = pos; pos_top = pos;
...@@ -211,9 +219,9 @@ function parse_playlist() ...@@ -211,9 +219,9 @@ function parse_playlist()
pos = pos.parentNode; pos = pos.parentNode;
} }
} }
while( playtree.hasChildNodes() ) while( playtree_iesuxx.hasChildNodes() )
playtree.removeChild( playtree.firstChild ); playtree_iesuxx.removeChild( playtree.firstChild );
playtree.appendChild( pos_top ); playtree_iesuxx.appendChild( pos_top );
} }
else else
{ {
...@@ -681,7 +689,7 @@ function parse_browse_dir( ) ...@@ -681,7 +689,7 @@ function parse_browse_dir( )
if( req.status == 200 ) if( req.status == 200 )
{ {
answer = req.responseXML.documentElement; answer = req.responseXML.documentElement;
browser = document.getElementById( 'browser' ); browser_iesuxx = document.getElementById( 'browser' );
pos = document.createElement( "div" ); pos = document.createElement( "div" );
elt = answer.firstChild; elt = answer.firstChild;
while( elt ) while( elt )
...@@ -711,9 +719,9 @@ function parse_browse_dir( ) ...@@ -711,9 +719,9 @@ function parse_browse_dir( )
} }
elt = elt.nextSibling; elt = elt.nextSibling;
} }
while( browser.hasChildNodes() ) while( browser_iesuxx.hasChildNodes() )
browser.removeChild( browser.firstChild ); browser_iesuxx.removeChild( browser.firstChild );
browser.appendChild( pos ); browser_iesuxx.appendChild( pos );
} }
else else
{ {
......
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >
< index.html: VLC media player web interface < index.html: VLC media player web interface
< - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > < - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >
...@@ -21,8 +23,6 @@ ...@@ -21,8 +23,6 @@
< Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. < Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
< - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> < - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
Browse Browse
</div> </div>
<div id="browser"> <div id="browser">
<a href="javascript:browse_dir('~');">Lets browse !</a> <a href="javascript:browse_dir(document.getElementById( 'browse_lastdir' ).value);">Lets browse !</a>
</div> </div>
<div class="controls"> <div class="controls">
<button id="btn_browse_close" onclick="hide('browse');"> <button id="btn_browse_close" onclick="hide('browse');">
......
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