// parsing values from xml-element
try{
this.xmlitems = xml.getElementsByTagName("e2eventlist").item(0).getElementsByTagName("e2event");
- } catch (e) { debug("[EPGList] parsing Error");}
+ } catch (e) {
+ notify("Error Parsing EPG: " + e, false);
+ }
this.getArray = function(sortbytime){
debug("[EPGList] Sort by time "+sortbytime);
'model' : model
};
} catch (e) {
- debug("[incomingDeviceInfo] error parsing NIM data: " + e);
+ notify("Error parsing frontend data: " + e);
}
}
'free' : free
};
} catch(e){
- debug("[incomingDeviceInfo] error parsing HDD data: " + e);
+ notify("Error parsing HDD data: " + e, false);
}
}
'netmask' : netmask
};
} catch (e) {
- debug("[incomingDeviceInfo] error parsing NIC data: " + e);
+ notify("Error parsing NIC data: " + e, false);
}
}
'webifversion': xml.getElementsByTagName('e2webifversion').item(0).firstChild.data
};
} catch (e) {
- debug("[incomingDeviceInfo] parsing Error" + e);
+ notify("Error parsing deviceinfo data: " + e, false);
}
this.json = {
try{
this.xmlitems = xml.getElementsByTagName("e2simplexmlresult").item(0);
} catch (e) {
- debug("[SimpleXMLResult] parsing e2simplexmlresult" + e);
+ notify("Error parsing e2simplexmlresult: " + e, false);
}
this.state = getNodeContent(this.xmlitems, 'e2state', 'False');
try{
this.xmlitems = xml.getElementsByTagName(tagname);
} catch (e) {
- debug("[SimpleXMLList] parsing e2simplexmllist"+e);
+ notify("Error parsing SimpleXMLList: " + e, false);
}
+
this.xmllist = [];
this.getList = function(){
this.xmlitems = xml.getElementsByTagName("e2settings").item(0).getElementsByTagName("e2setting");
debug("[Settings] Number of items: " + this.xmlitems);
} catch (e) {
- debug("[Settings] parsing Error");
+ notify("Error parsing Settings: " + e, false);
}
+
this.settings = [];
this.getArray = function(){
try{
this.xmlitems = xml.getElementsByTagName("e2filelist").item(0).getElementsByTagName("e2file");
} catch (e) {
- debug("[FileList] parsing Error");
+ notify("Error parsing FileList: " + e, false);
}
this.filelist = [];
set('notification', "<div>"+text+"</div>");
notif.appear({duration : 0.5, to: 0.9 });
- hideNotifierTimeout = setTimeout(hideNotifier, 7500);
+ hideNotifierTimeout = setTimeout(hideNotifier, 10000);
}
}
debugWin = openPopupPage("Debug", uri, 500, 300);
}
+function requestFailed(transport){
+ var notifText = "Request failed for: " + transport.request.url + "<br>Status: " + transport.status + " " + transport.statusText;
+ notify(notifText, false);
+}
+
function doRequest(url, readyFunction){
requestStarted();
var request = '';
try{
request = new Ajax.Request(url,
{
- asynchronous: true,
- method: 'GET',
- requestHeaders: ['Pragma', 'no-cache', 'Cache-Control', 'no-cache,no-store', 'Expires', '-1'],
- onException: function(o,e){ throw(e); },
- onSuccess: function (transport, json) {
- if(typeof(readyFunction) != "undefined"){
- readyFunction(transport);
- }
- },
- onComplete: requestFinished
+ asynchronous: true,
+ method: 'GET',
+ requestHeaders: ['Cache-Control', 'no-cache,no-store', 'Expires', '-1'],
+ onException: function(o,e){ throw(e); },
+ onSuccess: function (transport, json) {
+ if(typeof(readyFunction) != "undefined"){
+ readyFunction(transport);
+ }
+ },
+ onFailure: function(transport){
+ requestFailed(transport);
+ },
+ onComplete: requestFinished
});
} catch(e) {}
} else { //we're on gears!
request = google.gears.factory.create('beta.httprequest');
request.open('GET', url);
- if( typeof(readyFunction) != "undefined" ){
- request.onreadystatechange = function(){
- if(request.readyState == 4){
- if(request.status == 200){
+
+ request.onreadystatechange = function(){
+ if(request.readyState == 4){
+ if(request.status == 200){
+ if( typeof(readyFunction) != "undefined" ){
readyFunction(request);
- } else {
- //we COULD do some error handling here
}
+ } else {
+ requestFailed(transport);
}
- };
- }
+ }
+ };
request.send();
} catch(e) {}
}