Author: eallen
Date: 2009-06-04 16:25:43 -0400 (Thu, 04 Jun 2009)
New Revision: 3416
Modified:
mgmt/trunk/wooly/resources/wooly.js
Log:
Add ability to return responseText from an Ajax call.
Added resumeIntervalUpdate to resume the background updates after they have been paused.
Modified: mgmt/trunk/wooly/resources/wooly.js
===================================================================
--- mgmt/trunk/wooly/resources/wooly.js 2009-06-04 13:33:41 UTC (rev 3415)
+++ mgmt/trunk/wooly/resources/wooly.js 2009-06-04 20:25:43 UTC (rev 3416)
@@ -380,7 +380,7 @@
passback: null
};
- this.setIntervalUpdate = function(url, callback, interval, passback) {
+ this.setIntervalUpdate = function(url, callback, interval, passback, astext) {
var req = this.getNewRequest();
function fetch() {
@@ -410,7 +410,10 @@
function update() {
try {
if (req.readyState == 4 && req.status == 200) {
- callback(req.responseXML, passback);
+ if (astext == true)
+ callback(req.responseText, passback);
+ else
+ callback(req.responseXML, passback);
}
} catch (e) {
log(e);
@@ -447,6 +450,12 @@
return this.session.branch(this.intervalUpdateInfo.url);
}
+ this.resumeIntervalUpdate = function () {
+ wooly.setIntervalUpdate(wooly.intervalUpdateInfo.url,
+ wooly.intervalUpdateInfo.callback,
+ wooly.intervalUpdateInfo.interval,
+ wooly.intervalUpdateInfo.passback);
+ }
this.doubleIntervalUpdate = function () {
wooly.cancelIntervalUpdate();
wooly.intervalUpdateInfo.interval *= 2;
Show replies by date