socialbox.js: improvements to refresh at interval
This commit is contained in:
parent
12b9f32dd4
commit
47e5bacd9c
@ -45,6 +45,7 @@ function ajax_getvalues_refresh(request,user,user_email,secret) {
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var webbuildurl = "/cgi-bin/webbuild.cgi"
|
var webbuildurl = "/cgi-bin/webbuild.cgi"
|
||||||
|
var xmlhttp1;
|
||||||
|
|
||||||
if (typeof webbuildhost != 'undefined' && webbuildhost != "") {
|
if (typeof webbuildhost != 'undefined' && webbuildhost != "") {
|
||||||
webbuildurl = "/cgi-bin/webbuild-" + webbuildhost + ".cgi";
|
webbuildurl = "/cgi-bin/webbuild-" + webbuildhost + ".cgi";
|
||||||
@ -67,9 +68,19 @@ function ajax_getvalues_refresh(request,user,user_email,secret) {
|
|||||||
request="REQUEST=refresh&USER="+user+"&USER_EMAIL="+user_email+"&SECRET="+secret+"&FROMID="+fromid;
|
request="REQUEST=refresh&USER="+user+"&USER_EMAIL="+user_email+"&SECRET="+secret+"&FROMID="+fromid;
|
||||||
|
|
||||||
if (window.XMLHttpRequest)
|
if (window.XMLHttpRequest)
|
||||||
var xmlhttp1 = new XMLHttpRequest();
|
try {
|
||||||
|
xmlhttp1 = new XMLHttpRequest();
|
||||||
|
} catch(e) {
|
||||||
|
console.log('XMLHttpRequest Error');
|
||||||
|
socialbox_interval = setInterval("ajax_getvalues_refresh(\"\",\""+user+"\",\""+user_email+"\",\""+secret+"\",\""+webbuildhost+"\")",socialbox_reloadtime);
|
||||||
|
}
|
||||||
else if (window.ActiveXObject)
|
else if (window.ActiveXObject)
|
||||||
var xmlhttp1 = new ActiveXObject("Microsoft.XMLHTTP");
|
try {
|
||||||
|
xmlhttp1 = new ActiveXObject("Microsoft.XMLHTTP");
|
||||||
|
} catch(e) {
|
||||||
|
console.log('XMLHttpRequest Error');
|
||||||
|
socialbox_interval = setInterval("ajax_getvalues_refresh(\"\",\""+user+"\",\""+user_email+"\",\""+secret+"\",\""+webbuildhost+"\")",socialbox_reloadtime);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -77,6 +88,8 @@ function ajax_getvalues_refresh(request,user,user_email,secret) {
|
|||||||
if (xmlhttp1.readyState != 4)
|
if (xmlhttp1.readyState != 4)
|
||||||
return;
|
return;
|
||||||
if (xmlhttp1.responseXML == undefined) {
|
if (xmlhttp1.responseXML == undefined) {
|
||||||
|
console.log('XMLHttpRequest Undefined response');
|
||||||
|
socialbox_interval = setInterval("ajax_getvalues_refresh(\"\",\""+user+"\",\""+user_email+"\",\""+secret+"\",\""+webbuildhost+"\")",socialbox_reloadtime);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var xmldoc = xmlhttp1.responseXML.documentElement;
|
var xmldoc = xmlhttp1.responseXML.documentElement;
|
||||||
@ -92,10 +105,15 @@ function ajax_getvalues_refresh(request,user,user_email,secret) {
|
|||||||
}
|
}
|
||||||
$(function() { $('.scroll-pane').jScrollPane({scrollbarWidth:10}); });
|
$(function() { $('.scroll-pane').jScrollPane({scrollbarWidth:10}); });
|
||||||
socialbox_refresh_times();
|
socialbox_refresh_times();
|
||||||
|
socialbox_interval = setInterval("ajax_getvalues_refresh(\"\",\""+user+"\",\""+user_email+"\",\""+secret+"\",\""+webbuildhost+"\")",socialbox_reloadtime);
|
||||||
|
}
|
||||||
|
|
||||||
|
xmlhttp1.timeout = function() {
|
||||||
|
console.log('XMLHttpRequest Timeout');
|
||||||
|
socialbox_interval = setInterval("ajax_getvalues_refresh(\"\",\""+user+"\",\""+user_email+"\",\""+secret+"\",\""+webbuildhost+"\")",socialbox_reloadtime);
|
||||||
}
|
}
|
||||||
|
|
||||||
xmlhttp1.open("POST", webbuildurl, true);
|
xmlhttp1.open("POST", webbuildurl, true);
|
||||||
xmlhttp1.setRequestHeader("Content-type","application/x-www-form-urlencoded");
|
xmlhttp1.setRequestHeader("Content-type","application/x-www-form-urlencoded");
|
||||||
xmlhttp1.send(request);
|
xmlhttp1.send(request);
|
||||||
socialbox_interval = setInterval("ajax_getvalues_refresh(\"\",\""+user+"\",\""+user_email+"\",\""+secret+"\",\""+webbuildhost+"\")",socialbox_reloadtime);
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user