diff options
author | Dieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de> | 2007-06-22 22:39:11 +0000 |
---|---|---|
committer | Dieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de> | 2007-06-22 22:39:11 +0000 |
commit | b3ca0eb9198a66f163140dd0eccde35677921f12 (patch) | |
tree | 3a40c41208b3929029e9113648702a931f4f64e6 /js/live/vdr_status.js | |
parent | d9e1b706df7ebcb0fa7e7e716291f9c88aad6a24 (diff) | |
download | vdr-plugin-live-b3ca0eb9198a66f163140dd0eccde35677921f12.tar.gz vdr-plugin-live-b3ca0eb9198a66f163140dd0eccde35677921f12.tar.bz2 |
- directory restructuration regarding static content.
Diffstat (limited to 'js/live/vdr_status.js')
-rw-r--r-- | js/live/vdr_status.js | 168 |
1 files changed, 0 insertions, 168 deletions
diff --git a/js/live/vdr_status.js b/js/live/vdr_status.js deleted file mode 100644 index d16f2a3..0000000 --- a/js/live/vdr_status.js +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Javascript functions for the status update box. - * This file needs mootools.js to be included on the pages. - */ - -var LiveVdrInfo = Ajax.extend({ - - options: { - autoCancel: true - }, - - initialize: function(url, boxId) - { - this.parent(url, null); - this.addEvent('onComplete', this.showInfo); - this.addEvent('onFailure', this.reportError); - - this.boxId = boxId; - this.reload = true; - this.timer = null; - }, - - request: function(update) - { - this.parent({update: update ? "1" : "0"}); - }, - - showInfo: function(text, xmldoc) - { - try { - var infoType = xmldoc.getElementsByTagName('type').item(0); - - var channel = $(this.boxId + '_channel_buttons'); - var playback = $(this.boxId + '_recording_buttons'); - - if (infoType.firstChild.nodeValue != "channel") { - channel.style.display = 'none'; - playback.style.display = 'block'; - this.setTextContent('pause', infoType.firstChild.nodeValue); - this.setTextContent('play', infoType.firstChild.nodeValue); - this.setTextContent('rwd', infoType.firstChild.nodeValue); - this.setTextContent('ffw', infoType.firstChild.nodeValue); - this.setTextContent('stop', infoType.firstChild.nodeValue); - } - else { - playback.style.display = 'none'; - channel.style.display = 'block'; - } - - var epgInfo = xmldoc.getElementsByTagName('epginfo').item(0); - - for (var i = 0; i < epgInfo.childNodes.length; i++) { - var node = epgInfo.childNodes.item(i); - if (node.nodeType == 1) { - var textContent = ""; - if (node.firstChild != null) - textContent = node.firstChild.nodeValue; - this.setTextContent(node.nodeName, textContent); - } - } - - /* check if we still need to update the status */ - var upd = xmldoc.getElementsByTagName('update').item(0); - var rel = (upd.firstChild.nodeValue == "1"); - - if (rel != this.reload) { - this.reload = rel; - var img = $('statusReloadBtn'); - if (img != null) { - // change image according to state. - img.src = this.reload ? 'stop_update.png' : 'reload.png'; - } - } - if (this.reload) - this.timer = this.request.delay(1000, this, true); - } - catch (e) { - this.reportError(null); - } - }, - - reportError: function(transport) - { - this.setTextContent('caption', 'ERROR'); - var message; - if (transport != null) { - message = $("__infobox_request_err").firstChild.nodeValue; - } - else { - message = $("__infobox_update_err").firstChild.nodeValue; - } - this.setTextContent('name', message); - }, - - setTextContent: function(nodeName, textContent) - { - var docNode = $(this.boxId + '_' + nodeName); - if (docNode != null) { - switch (nodeName) { - case "caption": - case "timenow": - case "name": - case "duration": - { - if (docNode.innerHTML != textContent) - docNode.innerHTML = textContent; - break; - } - case "elapsed": - { - var width = textContent + "px"; - if (docNode.style.width != width) - docNode.style.width = width; - break; - } - case "nextchan": - case "prevchan": - { - if (textContent != "") { - docNode.href = "javascript:LiveSimpleAjaxRequest('switch_channel.xml', 'param', '" + textContent + "');"; - docNode.style.visibility = "visible"; - } - else { - docNode.style.visibility = "hidden"; - } - break; - } - case "pause": - case "play": - case "rwd": - case "ffw": - case "stop": - { - if (textContent != "") { - docNode.href = "javascript:LiveSimpleAjaxRequest('" + nodeName + "_recording.xml', 'param', '" + textContent + "');"; - docNode.style.visibility = "visible"; - } - else { - docNode.style.visibility = "hidden"; - } - break; - } - default: - break; - } - } - }, - - toggleUpdate: function() - { - if (this.reload) { - if (this.timer != null) { - this.timer = $clear(this.timer); - } - } - this.request(!this.reload); - }, - - pageFinished: function() - { - if (this.reload) { - if (this.timer != null) { - this.timer = $clear(this.timer); - } - } - this.cancel(); - } -}); |