large playlists can take >10 seconds to load. since the xmlhttp object is
common within the page, multiple /status.xml requests would occurr (1 per sec)
before the playlist was loaded cancelling the /playlist.xml request.. i moved
the xmlhttp request object to a global variable. it's now checked to see if
there are any outstanding/active requests before submitting a new request. -
improved playlist display of large playlists.
Signed-off-by: Ilkka Ollakka <ileoo@videolan.org>
var old_time = 0;
var pl_cur_id;
var albumart_id = -1;
+var req = null;
/**********************************************************************
* Slider functions
}
function update_status()
{
- loadXMLDoc( 'requests/status.xml', parse_status );
+ if( req == null || req.readyState == 0 || req.readyState == 4 )
+ {
+ loadXMLDoc( 'requests/status.xml', parse_status );
+ }
}
function update_playlist()
{
var answer = req.responseXML.documentElement;
var playtree = document.getElementById( 'playtree' );
var pos = document.createElement( "div" );
+ pos.style.height = document.body.clientHeight - 100 + "px";
+ pos.style.overflow = "auto";
var pos_top = pos;
var elt = answer.firstChild;