From: Mark Hassman Date: Wed, 28 Jul 2010 16:02:23 +0000 (-0400) Subject: http-interface: - fixed large playlist loading failure X-Git-Tag: 1.2.0-pre1~5642 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=11c280f342df4e6ffc57e041b01f332419ab3a3f;p=vlc http-interface: - fixed large playlist loading failure 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 --- diff --git a/share/http/js/functions.js b/share/http/js/functions.js index fcd6c7a167..f259542987 100644 --- a/share/http/js/functions.js +++ b/share/http/js/functions.js @@ -28,6 +28,7 @@ var old_time = 0; var pl_cur_id; var albumart_id = -1; +var req = null; /********************************************************************** * Slider functions @@ -389,7 +390,10 @@ function hotkey( str ) } 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() { @@ -540,6 +544,8 @@ function parse_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;