Update of /var/cvs/contributions/CMSContainer/cmsc/utilities/src/webapp/js
In directory james.mmbase.org:/tmp/cvs-serv24565
Modified Files:
Tag: b1_5
transparent_png.js
Log Message:
CMSC-1187, Newsletter: improve publication and sending mechanism,for ajax
loading prompt
See also:
http://cvs.mmbase.org/viewcvs/contributions/CMSContainer/cmsc/utilities/src/webapp/js
See also: http://www.mmbase.org/jira/browse/CMSC-1187
Index: transparent_png.js
===================================================================
RCS file:
/var/cvs/contributions/CMSContainer/cmsc/utilities/src/webapp/js/transparent_png.js,v
retrieving revision 1.1
retrieving revision 1.1.6.1
diff -u -b -r1.1 -r1.1.6.1
--- transparent_png.js 21 May 2007 18:06:16 -0000 1.1
+++ transparent_png.js 20 Feb 2009 09:10:36 -0000 1.1.6.1
@@ -34,3 +34,69 @@
window.onload = alphaImages;
\ No newline at end of file
+
+ajaxUrl = null;
+load=null;
+time=null;
+function workfor(url, a){
+ ajaxUrl = url + "number=" + a;
+ getFreezeInfo();
+ time=setTimeout("clear()",60000*5);
+}
+function clear(){
+ clearInterval(load);
+ document.getElementById("needajax").style.display="none";
+ document.getElementById("working").style.display="";
+}
+
+function getFreezeInfo(){
+ load=setInterval("loadInfo()", 10000);
+
+}
+
+function loadInfo(){
+ var req = loadXMLDoc(ajaxUrl, false);
+ var result = req.status;
+ if (result == 200) {
+ var areaInfo = req.responseText;
+ if (areaInfo == "0") {
+ location.reload();
+ }
+ }
+ req = null;
+}
+
+
+function loadXMLDoc(url, async) {
+ var req = false;
+ // branch for native XMLHttpRequest object
+ if(window.XMLHttpRequest && !(window.ActiveXObject)) {
+ try {
+ req = new XMLHttpRequest();
+ } catch(e) {
+ req = false;
+ }
+ // branch for IE/Windows ActiveX version
+ } else if(window.ActiveXObject) {
+ try {
+ req = new ActiveXObject("Msxml2.XMLHTTP");
+ } catch(e) {
+ try {
+ req = new ActiveXObject("Microsoft.XMLHTTP");
+ } catch(e) {
+ req = false;
+ }
+ }
+ }
+ if(req) {
+ var as;
+ if (async == undefined) {
+ as = true;
+ } else {
+ as = async;
+ }
+ req.open("GET", url, as);
+ req.send("");
+ }
+ return req;
+}
\ No newline at end of file
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs