rem
stringlengths
0
126k
add
stringlengths
0
441k
context
stringlengths
15
136k
DWREngine._remoteEndIFrameResponse = function(batchId) { DWREngine._clearUp(DWREngine._receivedBatch); DWREngine._receivedBatch = null;
dwr.engine._remoteEndIFrameResponse = function(batchId) { dwr.engine._clearUp(dwr.engine._receivedBatch); dwr.engine._receivedBatch = null;
DWREngine._remoteEndIFrameResponse = function(batchId) { DWREngine._clearUp(DWREngine._receivedBatch); DWREngine._receivedBatch = null;};
if (script == null) return null; dwr.engine._debug(script);
if (script == null) { return null; } if (script == "") { dwr.engine._debug("Warning: blank script", true); return null; } var debug = script; debug = debug.replace(/\/\/#DWR-START#\r\n/g, ""); debug = debug.replace(/\/\/#DWR-END#\r\n/g, ""); debug = debug.replace(/\r/g, ""); debug = debug.replace(/\n/g, " "); dwr.engine._debug("Exec: [" + debug + "]");
dwr.engine._remoteEval = function(script) { if (script == null) return null; dwr.engine._debug(script); return eval(script);};
DWREngine._remoteEval = function(script) {
dwr.engine._remoteEval = function(script) {
DWREngine._remoteEval = function(script) { return eval(script);};
dwr.engine._remoteHandleBatchException = function(ex) {
dwr.engine._remoteHandleBatchException = function(ex, batchId) { var searchBatch = (dwr.engine._receivedBatch == null && batchId != null); if (searchBatch) { dwr.engine._receivedBatch = dwr.engine._batches[batchId]; }
dwr.engine._remoteHandleBatchException = function(ex) { if (ex.message == undefined) ex.message = ""; dwr.engine._handleError(dwr.engine._receivedBatch, ex);};
if (searchBatch) { dwr.engine._receivedBatch = null; dwr.engine._clearUp(dwr.engine._batches[batchId]); }
dwr.engine._remoteHandleBatchException = function(ex) { if (ex.message == undefined) ex.message = ""; dwr.engine._handleError(dwr.engine._receivedBatch, ex);};
dwr.engine._debug("batch == null in dwr.engine._remoteHandleCallback for batchId=" + batchId);
dwr.engine._debug("Warning: batch == null in remoteHandleCallback for batchId=" + batchId, true);
dwr.engine._remoteHandleCallback = function(batchId, callId, reply) { var batch = dwr.engine._batches[batchId]; if (batch == null) { dwr.engine._debug("batch == null in dwr.engine._remoteHandleCallback for batchId=" + batchId); return; } // Error handlers inside here indicate an error that is nothing to do // with DWR so we handle them differently. try { var handlers = batch.handlers[callId]; if (!handlers) { dwr.engine._debug("Missing handlers. callId=" + callId + ", handlers=" + dwr.util.toDescriptiveString(batch.handlers)); } else if (typeof handlers.callback == "function") handlers.callback(reply); } catch (ex) { dwr.engine._handleError(batch, ex); }};
dwr.engine._debug("Missing handlers. callId=" + callId + ", handlers=" + dwr.util.toDescriptiveString(batch.handlers));
dwr.engine._debug("Warning: Missing handlers. callId=" + callId + ", handlers=" + dwr.util.toDescriptiveString(batch.handlers), true);
dwr.engine._remoteHandleCallback = function(batchId, callId, reply) { var batch = dwr.engine._batches[batchId]; if (batch == null) { dwr.engine._debug("batch == null in dwr.engine._remoteHandleCallback for batchId=" + batchId); return; } // Error handlers inside here indicate an error that is nothing to do // with DWR so we handle them differently. try { var handlers = batch.handlers[callId]; if (!handlers) { dwr.engine._debug("Missing handlers. callId=" + callId + ", handlers=" + dwr.util.toDescriptiveString(batch.handlers)); } else if (typeof handlers.callback == "function") handlers.callback(reply); } catch (ex) { dwr.engine._handleError(batch, ex); }};
DWREngine._remoteHandleCallback = function(callId, reply) {
DWREngine._remoteHandleCallback = function(batchId, callId, reply) { var batch = DWREngine._batches[batchId]; if (batch == null) { DWREngine._debug("batch == null in DWREngine._remoteHandleCallback for batchId=" + batchId); return; }
DWREngine._remoteHandleCallback = function(callId, reply) { // Error handlers inside here indicate an error that is nothing to do // with DWR so we handle them differently. if (DWREngine._receivedBatch == null) { DWREngine._debug("receivedBatch == null in DWREngine._remoteHandleCallback"); return; } try { var handlers = DWREngine._receivedBatch.callIds[callId]; if (handlers && typeof handlers.callback == "function") handlers.callback(reply); } catch (ex) { DWREngine._handleError(DWREngine._receivedBatch, ex); } DWREngine._maybeClearUpIFrame();};
if (DWREngine._receivedBatch == null) { DWREngine._debug("receivedBatch == null in DWREngine._remoteHandleCallback"); return; }
DWREngine._remoteHandleCallback = function(callId, reply) { // Error handlers inside here indicate an error that is nothing to do // with DWR so we handle them differently. if (DWREngine._receivedBatch == null) { DWREngine._debug("receivedBatch == null in DWREngine._remoteHandleCallback"); return; } try { var handlers = DWREngine._receivedBatch.callIds[callId]; if (handlers && typeof handlers.callback == "function") handlers.callback(reply); } catch (ex) { DWREngine._handleError(DWREngine._receivedBatch, ex); } DWREngine._maybeClearUpIFrame();};
var handlers = DWREngine._receivedBatch.callIds[callId];
var handlers = batch.callIds[callId];
DWREngine._remoteHandleCallback = function(callId, reply) { // Error handlers inside here indicate an error that is nothing to do // with DWR so we handle them differently. if (DWREngine._receivedBatch == null) { DWREngine._debug("receivedBatch == null in DWREngine._remoteHandleCallback"); return; } try { var handlers = DWREngine._receivedBatch.callIds[callId]; if (handlers && typeof handlers.callback == "function") handlers.callback(reply); } catch (ex) { DWREngine._handleError(DWREngine._receivedBatch, ex); } DWREngine._maybeClearUpIFrame();};
DWREngine._handleError(DWREngine._receivedBatch, ex);
DWREngine._handleError(batch, ex);
DWREngine._remoteHandleCallback = function(callId, reply) { // Error handlers inside here indicate an error that is nothing to do // with DWR so we handle them differently. if (DWREngine._receivedBatch == null) { DWREngine._debug("receivedBatch == null in DWREngine._remoteHandleCallback"); return; } try { var handlers = DWREngine._receivedBatch.callIds[callId]; if (handlers && typeof handlers.callback == "function") handlers.callback(reply); } catch (ex) { DWREngine._handleError(DWREngine._receivedBatch, ex); } DWREngine._maybeClearUpIFrame();};
DWREngine._maybeClearUpIFrame();
DWREngine._remoteHandleCallback = function(callId, reply) { // Error handlers inside here indicate an error that is nothing to do // with DWR so we handle them differently. if (DWREngine._receivedBatch == null) { DWREngine._debug("receivedBatch == null in DWREngine._remoteHandleCallback"); return; } try { var handlers = DWREngine._receivedBatch.callIds[callId]; if (handlers && typeof handlers.callback == "function") handlers.callback(reply); } catch (ex) { DWREngine._handleError(DWREngine._receivedBatch, ex); } DWREngine._maybeClearUpIFrame();};
dwr.engine._debug("Warning: Missing handlers. callId=" + callId + ", handlers=" + dwr.util.toDescriptiveString(batch.handlers), true);
dwr.engine._debug("Warning: Missing handlers. callId=" + callId, true);
dwr.engine._remoteHandleCallback = function(batchId, callId, reply) { var batch = dwr.engine._batches[batchId]; if (batch == null) { dwr.engine._debug("Warning: batch == null in remoteHandleCallback for batchId=" + batchId, true); return; } // Error handlers inside here indicate an error that is nothing to do // with DWR so we handle them differently. try { var handlers = batch.handlers[callId]; if (!handlers) { dwr.engine._debug("Warning: Missing handlers. callId=" + callId + ", handlers=" + dwr.util.toDescriptiveString(batch.handlers), true); } else if (typeof handlers.callback == "function") handlers.callback(reply); } catch (ex) { dwr.engine._handleError(batch, ex); }};
DWREngine._remoteHandleCallback = function(batchId, callId, reply) { var batch = DWREngine._batches[batchId];
dwr.engine._remoteHandleCallback = function(batchId, callId, reply) { var batch = dwr.engine._batches[batchId];
DWREngine._remoteHandleCallback = function(batchId, callId, reply) { var batch = DWREngine._batches[batchId]; if (batch == null) { DWREngine._debug("batch == null in DWREngine._remoteHandleCallback for batchId=" + batchId); return; } // Error handlers inside here indicate an error that is nothing to do // with DWR so we handle them differently. try { var handlers = batch.callIds[callId]; if (handlers && typeof handlers.callback == "function") handlers.callback(reply); } catch (ex) { DWREngine._handleError(batch, ex); }};
DWREngine._debug("batch == null in DWREngine._remoteHandleCallback for batchId=" + batchId);
dwr.engine._debug("batch == null in dwr.engine._remoteHandleCallback for batchId=" + batchId);
DWREngine._remoteHandleCallback = function(batchId, callId, reply) { var batch = DWREngine._batches[batchId]; if (batch == null) { DWREngine._debug("batch == null in DWREngine._remoteHandleCallback for batchId=" + batchId); return; } // Error handlers inside here indicate an error that is nothing to do // with DWR so we handle them differently. try { var handlers = batch.callIds[callId]; if (handlers && typeof handlers.callback == "function") handlers.callback(reply); } catch (ex) { DWREngine._handleError(batch, ex); }};
var handlers = batch.callIds[callId]; if (handlers && typeof handlers.callback == "function") handlers.callback(reply);
var handlers = batch.handlers[callId]; if (!handlers) { dwr.engine._debug("Missing handlers. callId=" + callId + ", handlers=" + dwr.util.toDescriptiveString(batch.handlers)); } else if (typeof handlers.callback == "function") handlers.callback(reply);
DWREngine._remoteHandleCallback = function(batchId, callId, reply) { var batch = DWREngine._batches[batchId]; if (batch == null) { DWREngine._debug("batch == null in DWREngine._remoteHandleCallback for batchId=" + batchId); return; } // Error handlers inside here indicate an error that is nothing to do // with DWR so we handle them differently. try { var handlers = batch.callIds[callId]; if (handlers && typeof handlers.callback == "function") handlers.callback(reply); } catch (ex) { DWREngine._handleError(batch, ex); }};
DWREngine._handleError(batch, ex);
dwr.engine._handleError(batch, ex);
DWREngine._remoteHandleCallback = function(batchId, callId, reply) { var batch = DWREngine._batches[batchId]; if (batch == null) { DWREngine._debug("batch == null in DWREngine._remoteHandleCallback for batchId=" + batchId); return; } // Error handlers inside here indicate an error that is nothing to do // with DWR so we handle them differently. try { var handlers = batch.callIds[callId]; if (handlers && typeof handlers.callback == "function") handlers.callback(reply); } catch (ex) { DWREngine._handleError(batch, ex); }};
dwr.engine._debug("batch == null in dwr.engine._remoteHandleException for batchId=" + batchId);
dwr.engine._debug("Warning: batch == null in remoteHandleException for batchId=" + batchId, true);
dwr.engine._remoteHandleException = function(batchId, callId, ex) { var batch = dwr.engine._batches[batchId]; if (batch == null) { dwr.engine._debug("batch == null in dwr.engine._remoteHandleException for batchId=" + batchId); return; } var handlers = batch.handlers[callId]; if (ex.message == undefined) ex.message = ""; if (handlers && typeof handlers.exceptionHandler == "function") handlers.exceptionHandler(ex.message, ex); else if (dwr.engine._exceptionHandler) dwr.engine._exceptionHandler(ex.message, ex);};
DWREngine._remoteHandleException = function(callId, ex) { if (DWREngine._receivedBatch == null) { DWREngine._debug("receivedBatch == null in DWREngine._remoteHandleException");
DWREngine._remoteHandleException = function(batchId, callId, ex) { var batch = DWREngine._batches[batchId]; if (batch == null) { DWREngine._debug("batch == null in DWREngine._remoteHandleException for batchId=" + batchId);
DWREngine._remoteHandleException = function(callId, ex) { if (DWREngine._receivedBatch == null) { DWREngine._debug("receivedBatch == null in DWREngine._remoteHandleException"); return; } var handlers = DWREngine._receivedBatch.callIds[callId]; if (ex.message == undefined) ex.message = ""; if (handlers && typeof handlers.exceptionHandler == "function") handlers.exceptionHandler(ex.message, ex); else if (DWREngine._exceptionHandler) DWREngine._exceptionHandler(ex.message, ex); DWREngine._maybeClearUpIFrame();};
var handlers = DWREngine._receivedBatch.callIds[callId];
var handlers = batch.callIds[callId];
DWREngine._remoteHandleException = function(callId, ex) { if (DWREngine._receivedBatch == null) { DWREngine._debug("receivedBatch == null in DWREngine._remoteHandleException"); return; } var handlers = DWREngine._receivedBatch.callIds[callId]; if (ex.message == undefined) ex.message = ""; if (handlers && typeof handlers.exceptionHandler == "function") handlers.exceptionHandler(ex.message, ex); else if (DWREngine._exceptionHandler) DWREngine._exceptionHandler(ex.message, ex); DWREngine._maybeClearUpIFrame();};
DWREngine._maybeClearUpIFrame();
DWREngine._remoteHandleException = function(callId, ex) { if (DWREngine._receivedBatch == null) { DWREngine._debug("receivedBatch == null in DWREngine._remoteHandleException"); return; } var handlers = DWREngine._receivedBatch.callIds[callId]; if (ex.message == undefined) ex.message = ""; if (handlers && typeof handlers.exceptionHandler == "function") handlers.exceptionHandler(ex.message, ex); else if (DWREngine._exceptionHandler) DWREngine._exceptionHandler(ex.message, ex); DWREngine._maybeClearUpIFrame();};
if (handlers && typeof handlers.exceptionHandler == "function") handlers.exceptionHandler(error.message, ex); else if (DWREngine._exceptionHandler) DWREngine._exceptionHandler(error.message, ex);
if (handlers && typeof handlers.exceptionHandler == "function") handlers.exceptionHandler(ex.message, ex); else if (DWREngine._exceptionHandler) DWREngine._exceptionHandler(ex.message, ex);
DWREngine._remoteHandleException = function(batchId, ex) { var handlers = DWREngine._receivedBatch.batchIds[batchId]; if (ex.message == undefined) ex.message = ""; if (handlers && typeof handlers.exceptionHandler == "function") handlers.exceptionHandler(error.message, ex); else if (DWREngine._exceptionHandler) DWREngine._exceptionHandler(error.message, ex); DWREngine._maybeClearUpIFrame();};
DWREngine._remoteHandleException = function(batchId, callId, ex) { var batch = DWREngine._batches[batchId];
dwr.engine._remoteHandleException = function(batchId, callId, ex) { var batch = dwr.engine._batches[batchId];
DWREngine._remoteHandleException = function(batchId, callId, ex) { var batch = DWREngine._batches[batchId]; if (batch == null) { DWREngine._debug("batch == null in DWREngine._remoteHandleException for batchId=" + batchId); return; } var handlers = batch.callIds[callId]; if (ex.message == undefined) ex.message = ""; if (handlers && typeof handlers.exceptionHandler == "function") handlers.exceptionHandler(ex.message, ex); else if (DWREngine._exceptionHandler) DWREngine._exceptionHandler(ex.message, ex);};
DWREngine._debug("batch == null in DWREngine._remoteHandleException for batchId=" + batchId);
dwr.engine._debug("batch == null in dwr.engine._remoteHandleException for batchId=" + batchId);
DWREngine._remoteHandleException = function(batchId, callId, ex) { var batch = DWREngine._batches[batchId]; if (batch == null) { DWREngine._debug("batch == null in DWREngine._remoteHandleException for batchId=" + batchId); return; } var handlers = batch.callIds[callId]; if (ex.message == undefined) ex.message = ""; if (handlers && typeof handlers.exceptionHandler == "function") handlers.exceptionHandler(ex.message, ex); else if (DWREngine._exceptionHandler) DWREngine._exceptionHandler(ex.message, ex);};
var handlers = batch.callIds[callId];
var handlers = batch.handlers[callId];
DWREngine._remoteHandleException = function(batchId, callId, ex) { var batch = DWREngine._batches[batchId]; if (batch == null) { DWREngine._debug("batch == null in DWREngine._remoteHandleException for batchId=" + batchId); return; } var handlers = batch.callIds[callId]; if (ex.message == undefined) ex.message = ""; if (handlers && typeof handlers.exceptionHandler == "function") handlers.exceptionHandler(ex.message, ex); else if (DWREngine._exceptionHandler) DWREngine._exceptionHandler(ex.message, ex);};
else if (DWREngine._exceptionHandler) DWREngine._exceptionHandler(ex.message, ex);
else if (dwr.engine._exceptionHandler) dwr.engine._exceptionHandler(ex.message, ex);
DWREngine._remoteHandleException = function(batchId, callId, ex) { var batch = DWREngine._batches[batchId]; if (batch == null) { DWREngine._debug("batch == null in DWREngine._remoteHandleException for batchId=" + batchId); return; } var handlers = batch.callIds[callId]; if (ex.message == undefined) ex.message = ""; if (handlers && typeof handlers.exceptionHandler == "function") handlers.exceptionHandler(ex.message, ex); else if (DWREngine._exceptionHandler) DWREngine._exceptionHandler(ex.message, ex);};
if (batch == null) { dwr.engine._debug("Warning: batch == null in remoteHandleException for batchId=" + batchId, true); return; }
if (batch == null) { dwr.engine._debug("Warning: null batch in remoteHandleException", true); return; }
dwr.engine._remoteHandleException = function(batchId, callId, ex) { var batch = dwr.engine._batches[batchId]; if (batch == null) { dwr.engine._debug("Warning: batch == null in remoteHandleException for batchId=" + batchId, true); return; } var handlers = batch.handlers[callId]; if (ex.message == undefined) ex.message = ""; if (handlers && typeof handlers.exceptionHandler == "function") handlers.exceptionHandler(ex.message, ex); else if (dwr.engine._exceptionHandler) dwr.engine._exceptionHandler(ex.message, ex);};
if (handlers && typeof handlers.exceptionHandler == "function") handlers.exceptionHandler(ex.message, ex); else if (dwr.engine._exceptionHandler) dwr.engine._exceptionHandler(ex.message, ex);
if (typeof handlers.exceptionHandler == "function") handlers.exceptionHandler(ex.message, ex); else if (typeof batch.errorHandler == "function") batch.errorHandler(ex.message, ex); else if (dwr.engine._errorHandler) dwr.engine._errorHandler(ex.message, ex);
dwr.engine._remoteHandleException = function(batchId, callId, ex) { var batch = dwr.engine._batches[batchId]; if (batch == null) { dwr.engine._debug("Warning: batch == null in remoteHandleException for batchId=" + batchId, true); return; } var handlers = batch.handlers[callId]; if (ex.message == undefined) ex.message = ""; if (handlers && typeof handlers.exceptionHandler == "function") handlers.exceptionHandler(ex.message, ex); else if (dwr.engine._exceptionHandler) dwr.engine._exceptionHandler(ex.message, ex);};
DWREngine._maybeClearUpIFrame();
DWREngine._remoteHandleExceptionWithoutCallId = function(ex) { if (ex.message == undefined) ex.message = ""; DWREngine._handleError(DWREngine._receivedBatch, ex); DWREngine._maybeClearUpIFrame();};
DWREngine._remoteHandleExceptionWithoutCallId = function(ex) {
dwr.engine._remoteHandleExceptionWithoutCallId = function(ex) {
DWREngine._remoteHandleExceptionWithoutCallId = function(ex) { if (ex.message == undefined) ex.message = ""; DWREngine._handleError(DWREngine._receivedBatch, ex);};
DWREngine._handleError(DWREngine._receivedBatch, ex);
dwr.engine._handleError(dwr.engine._receivedBatch, ex);
DWREngine._remoteHandleExceptionWithoutCallId = function(ex) { if (ex.message == undefined) ex.message = ""; DWREngine._handleError(DWREngine._receivedBatch, ex);};
dwr.engine._debug("Sending batchId=" + batch.map.batchId + " handlers=" + dwr.util.toDescriptiveString(batch.handlers));
dwr.engine._sendData = function(batch) { batch.map.batchId = dwr.engine._nextBatchId++; dwr.engine._batches[batch.map.batchId] = batch; dwr.engine._batchesLength++; batch.completed = false; dwr.engine._debug("Sending batchId=" + batch.map.batchId + " handlers=" + dwr.util.toDescriptiveString(batch.handlers)); for (var i = 0; i < batch.preHooks.length; i++) { batch.preHooks[i](); } batch.preHooks = null; // Set a timeout if (batch.timeout && batch.timeout != 0) { batch.interval = setInterval(function() { dwr.engine._abortRequest(batch); }, batch.timeout); } // Get setup for XMLHttpRequest if possible if (batch.rpcType == dwr.engine.XMLHttpRequest) { if (window.XMLHttpRequest) { batch.req = new XMLHttpRequest(); } // IE5 for the mac claims to support window.ActiveXObject, but throws an error when it's used else if (window.ActiveXObject && !(navigator.userAgent.indexOf("Mac") >= 0 && navigator.userAgent.indexOf("MSIE") >= 0)) { batch.req = dwr.engine._newActiveXObject(dwr.engine._XMLHTTP); } } var prop, request; if (batch.req) { // Proceed using XMLHttpRequest if (batch.async) { batch.req.onreadystatechange = function() { dwr.engine._stateChange(batch); }; } // If we're polling, record this for monitoring if (batch.isPoll) dwr.engine._pollReq = batch.req; // Workaround for Safari 1.x POST bug var indexSafari = navigator.userAgent.indexOf("Safari/"); if (indexSafari >= 0) { var version = navigator.userAgent.substring(indexSafari + 7); if (parseInt(version, 10) < 400) batch.httpMethod = "GET"; } batch.mode = batch.isPoll ? dwr.engine._ModePlainPoll : dwr.engine._ModePlainCall; request = dwr.engine._constructRequest(batch); try { batch.req.open(batch.httpMethod, request.url, batch.async); try { for (prop in batch.headers) { var value = batch.headers[prop]; if (typeof value == "string") batch.req.setRequestHeader(prop, value); } if (!batch.headers["Content-Type"]) batch.req.setRequestHeader("Content-Type", "text/plain"); } catch (ex) { dwr.engine._handleWarning(batch, ex); } batch.req.send(request.body); if (!batch.async) dwr.engine._stateChange(batch); } catch (ex) { dwr.engine._handleError(batch, ex); } } else if (batch.rpcType != dwr.engine.ScriptTag) { var idname = "dwr-if-" + batch.map["c0-id"]; // Proceed using iframe batch.div = document.createElement("div"); batch.div.innerHTML = "<iframe src='javascript:void(0)' frameborder='0' width='0' height='0' id='" + idname + "' name='" + idname + "'></iframe>"; document.body.appendChild(batch.div); batch.iframe = document.getElementById(idname); batch.iframe.setAttribute("style", "width:0px; height:0px; border:0px;"); batch.iframe.batch = batch; batch.mode = batch.isPoll ? dwr.engine._ModeHtmlPoll : dwr.engine._ModeHtmlCall; if (batch.isPoll) { // Settings that vary if we are polling dwr.engine._pollFrame = batch.iframe; dwr.engine._pollCometSize = 0; } request = dwr.engine._constructRequest(batch); if (batch.httpMethod == "GET") { batch.iframe.setAttribute("src", request.url); document.body.appendChild(batch.iframe); } else { batch.form = document.createElement("form"); batch.form.setAttribute("id", "dwr-form"); batch.form.setAttribute("action", request.url); batch.form.setAttribute("target", idname); batch.form.target = idname; batch.form.setAttribute("method", batch.httpMethod); for (prop in batch.map) { var value = batch.map[prop]; if (typeof value != "function") { var formInput = document.createElement("input"); formInput.setAttribute("type", "hidden"); formInput.setAttribute("name", prop); formInput.setAttribute("value", value); batch.form.appendChild(formInput); } } document.body.appendChild(batch.form); batch.form.submit(); } } else { batch.httpMethod = "GET"; // There's no such thing as ScriptTag using POST batch.mode = batch.isPoll ? dwr.engine._ModePlainPoll : dwr.engine._ModePlainCall; request = dwr.engine._constructRequest(batch); batch.script = document.createElement("script"); batch.script.id = "dwr-st-" + batch.map["c0-id"]; batch.script.src = request.url; document.body.appendChild(batch.script); }};
dwr.engine._pollCometSize = 0;
dwr.engine._cometProcessed = 0;
dwr.engine._sendData = function(batch) { batch.map.batchId = dwr.engine._nextBatchId++; dwr.engine._batches[batch.map.batchId] = batch; dwr.engine._batchesLength++; batch.completed = false; dwr.engine._debug("Sending batchId=" + batch.map.batchId + " handlers=" + dwr.util.toDescriptiveString(batch.handlers)); for (var i = 0; i < batch.preHooks.length; i++) { batch.preHooks[i](); } batch.preHooks = null; // Set a timeout if (batch.timeout && batch.timeout != 0) { batch.interval = setInterval(function() { dwr.engine._abortRequest(batch); }, batch.timeout); } // Get setup for XMLHttpRequest if possible if (batch.rpcType == dwr.engine.XMLHttpRequest) { if (window.XMLHttpRequest) { batch.req = new XMLHttpRequest(); } // IE5 for the mac claims to support window.ActiveXObject, but throws an error when it's used else if (window.ActiveXObject && !(navigator.userAgent.indexOf("Mac") >= 0 && navigator.userAgent.indexOf("MSIE") >= 0)) { batch.req = dwr.engine._newActiveXObject(dwr.engine._XMLHTTP); } } var prop, request; if (batch.req) { // Proceed using XMLHttpRequest if (batch.async) { batch.req.onreadystatechange = function() { dwr.engine._stateChange(batch); }; } // If we're polling, record this for monitoring if (batch.isPoll) dwr.engine._pollReq = batch.req; // Workaround for Safari 1.x POST bug var indexSafari = navigator.userAgent.indexOf("Safari/"); if (indexSafari >= 0) { var version = navigator.userAgent.substring(indexSafari + 7); if (parseInt(version, 10) < 400) batch.httpMethod = "GET"; } batch.mode = batch.isPoll ? dwr.engine._ModePlainPoll : dwr.engine._ModePlainCall; request = dwr.engine._constructRequest(batch); try { batch.req.open(batch.httpMethod, request.url, batch.async); try { for (prop in batch.headers) { var value = batch.headers[prop]; if (typeof value == "string") batch.req.setRequestHeader(prop, value); } if (!batch.headers["Content-Type"]) batch.req.setRequestHeader("Content-Type", "text/plain"); } catch (ex) { dwr.engine._handleWarning(batch, ex); } batch.req.send(request.body); if (!batch.async) dwr.engine._stateChange(batch); } catch (ex) { dwr.engine._handleError(batch, ex); } } else if (batch.rpcType != dwr.engine.ScriptTag) { var idname = "dwr-if-" + batch.map["c0-id"]; // Proceed using iframe batch.div = document.createElement("div"); batch.div.innerHTML = "<iframe src='javascript:void(0)' frameborder='0' width='0' height='0' id='" + idname + "' name='" + idname + "'></iframe>"; document.body.appendChild(batch.div); batch.iframe = document.getElementById(idname); batch.iframe.setAttribute("style", "width:0px; height:0px; border:0px;"); batch.iframe.batch = batch; batch.mode = batch.isPoll ? dwr.engine._ModeHtmlPoll : dwr.engine._ModeHtmlCall; if (batch.isPoll) { // Settings that vary if we are polling dwr.engine._pollFrame = batch.iframe; dwr.engine._pollCometSize = 0; } request = dwr.engine._constructRequest(batch); if (batch.httpMethod == "GET") { batch.iframe.setAttribute("src", request.url); document.body.appendChild(batch.iframe); } else { batch.form = document.createElement("form"); batch.form.setAttribute("id", "dwr-form"); batch.form.setAttribute("action", request.url); batch.form.setAttribute("target", idname); batch.form.target = idname; batch.form.setAttribute("method", batch.httpMethod); for (prop in batch.map) { var value = batch.map[prop]; if (typeof value != "function") { var formInput = document.createElement("input"); formInput.setAttribute("type", "hidden"); formInput.setAttribute("name", prop); formInput.setAttribute("value", value); batch.form.appendChild(formInput); } } document.body.appendChild(batch.form); batch.form.submit(); } } else { batch.httpMethod = "GET"; // There's no such thing as ScriptTag using POST batch.mode = batch.isPoll ? dwr.engine._ModePlainPoll : dwr.engine._ModePlainCall; request = dwr.engine._constructRequest(batch); batch.script = document.createElement("script"); batch.script.id = "dwr-st-" + batch.map["c0-id"]; batch.script.src = request.url; document.body.appendChild(batch.script); }};
batch.iframe.batch = batch;
DWREngine._sendData = function(batch) { for (var i = 0; i < batch.preHooks.length; i++) { batch.preHooks[i](); } batch.preHooks = null; // Set a timeout if (batch.timeout && batch.timeout != 0) { batch.interval = setInterval(function() { DWREngine._abortRequest(batch); }, batch.timeout); } // Get setup for XMLHttpRequest if possible if (batch.rpcType == DWREngine.XMLHttpRequest) { if (window.XMLHttpRequest) { batch.req = new XMLHttpRequest(); } // IE5 for the mac claims to support window.ActiveXObject, but throws an error when it's used else if (window.ActiveXObject && !(navigator.userAgent.indexOf("Mac") >= 0 && navigator.userAgent.indexOf("MSIE") >= 0)) { batch.req = DWREngine._newActiveXObject(DWREngine._XMLHTTP); } } var prop, request; if (batch.req) { // Proceed using XMLHttpRequest if (batch.async) { batch.req.onreadystatechange = function() { DWREngine._stateChange(batch); }; } // If we're polling, record this for monitoring if (batch.isPoll) DWREngine._pollReq = batch.req; // Workaround for Safari 1.x POST bug var indexSafari = navigator.userAgent.indexOf("Safari/"); if (indexSafari >= 0) { var version = navigator.userAgent.substring(indexSafari + 7); if (parseInt(version, 10) < 400) batch.httpMethod = "GET"; } batch.mode = batch.isPoll ? DWREngine._ModePlainPoll : DWREngine._ModePlainCall; request = DWREngine._constructRequest(batch); try { batch.req.open(batch.httpMethod, request.url, batch.async); try { for (prop in batch.headers) { var value = batch.headers[prop]; if (typeof value == "string") batch.req.setRequestHeader(prop, value); } if (!batch.headers["Content-Type"]) batch.req.setRequestHeader("Content-Type", "text/plain"); } catch (ex) { DWREngine._handleWarning(null, ex); } batch.req.send(request.body); if (!batch.async) DWREngine._stateChange(batch); } catch (ex) { DWREngine._handleError(batch, ex); } } else if (batch.rpcType != DWREngine.ScriptTag) { var idname = "dwr-if-" + batch.map["c0-id"]; // Proceed using iframe batch.div = document.createElement("div"); batch.div.innerHTML = "<iframe src='javascript:void(0)' frameborder='0' width='0' height='0' id='" + idname + "' name='" + idname + "'></iframe>"; document.body.appendChild(batch.div); batch.iframe = document.getElementById(idname); batch.iframe.setAttribute("style", "width:0px; height:0px; border:0px;"); batch.mode = batch.isPoll ? DWREngine._ModeHtmlPoll : DWREngine._ModeHtmlCall; if (batch.isPoll) { // Settings that vary if we are polling DWREngine._pollFrame = batch.iframe; DWREngine._pollCometSize = 0; } request = DWREngine._constructRequest(batch); if (batch.httpMethod == "GET") { batch.iframe.setAttribute("src", request.url); document.body.appendChild(batch.iframe); } else { batch.form = document.createElement("form"); batch.form.setAttribute("id", "dwr-form"); batch.form.setAttribute("action", request.url); batch.form.setAttribute("target", idname); batch.form.target = idname; batch.form.setAttribute("method", batch.httpMethod); for (prop in batch.map) { var value = batch.map[prop]; if (typeof value != "function") { var formInput = document.createElement("input"); formInput.setAttribute("type", "hidden"); formInput.setAttribute("name", prop); formInput.setAttribute("value", value); batch.form.appendChild(formInput); } } document.body.appendChild(batch.form); batch.form.submit(); } } else { batch.httpMethod = "GET"; // There's no such thing as ScriptTag using POST batch.mode = batch.isPoll ? DWREngine._ModePlainPoll : DWREngine._ModePlainCall; request = DWREngine._constructRequest(batch); batch.script = document.createElement("script"); batch.script.id = "dwr-st-" + batch.map["c0-id"]; batch.script.src = request.url; document.body.appendChild(batch.script); }};
if (batch.preHook) { batch.preHook(); }
if (batch.map.callCount == 0) return; if (batch.preHook) batch.preHook();
DWREngine._sendData = function(batch) { // Actually make the call if (batch.preHook) { batch.preHook(); } // Set a timeout if (batch.metadata && batch.metadata.timeout && batch.metadata.timeout != 0) { var funcReq = function() { DWREngine._abortRequest(batch); }; setTimeout(funcReq, batch.metadata.timeout); } // A quick string to help people that use web log analysers var statsInfo; if (batch.map.callCount == 1) { statsInfo = batch.map["c0-scriptName"] + "." + batch.map["c0-methodName"]; } else { statsInfo = "Multiple." + batch.map.callCount; } // Get setup for XMLHttpRequest if possible if (batch.method == DWREngine.XMLHttpRequest) { if (window.XMLHttpRequest) { batch.req = new XMLHttpRequest(); } // IE5 for the mac claims to support window.ActiveXObject, but throws an error when it's used else if (window.ActiveXObject && !(navigator.userAgent.indexOf('Mac') >= 0 && navigator.userAgent.indexOf("MSIE") >= 0)) { batch.req = DWREngine._newActiveXObject(DWREngine._XMLHTTP); } } var query = ""; var prop; if (batch.req) { batch.map.xml = "true"; // Proceed using XMLHttpRequest batch.req.onreadystatechange = function() { DWREngine._stateChange(batch); }; // Force Mac people to use GET because Safari is broken. if (batch.verb == "GET" || navigator.userAgent.indexOf('Safari') >= 0) { // Some browsers (Opera/Safari2) seem to fail to convert the value // of batch.map.callCount to a string in the loop below so we do it // manually here. batch.map.callCount = "" + batch.map.callCount; for (prop in batch.map) { var qkey = encodeURIComponent(prop); var qval = encodeURIComponent(batch.map[prop]); if (qval == "") { if (DWREngine._warningHandler) { DWREngine._warningHandler("Found empty qval for qkey=" + qkey); } } query += qkey + "=" + qval + "&"; } query = query.substring(0, query.length - 1); try { batch.req.open("GET", batch.path + "/exec/" + statsInfo + "?" + query, batch.asynchronous); batch.req.send(null); } catch (ex) { DWREngine._handleError(ex); } } else { for (prop in batch.map) { if (typeof batch.map[prop] != "function") { query += prop + "=" + batch.map[prop] + "\n"; } } try { // This might include Safari too, but it shouldn't do any harm// if (navigator.userAgent.indexOf('Gecko') >= 0) {// batch.req.setRequestHeader('Connection', 'close');// } batch.req.open("POST", batch.path + "/exec/" + statsInfo, batch.asynchronous); batch.req.send(query); } catch (ex) { DWREngine._handleError(ex); } } } else { batch.map.xml = "false"; var idname = "dwr-if-" + batch.map["c0-id"]; // Proceed using iframe batch.div = document.createElement('div'); batch.div.innerHTML = "<iframe frameborder='0' width='0' height='0' id='" + idname + "' name='" + idname + "'></iframe>"; document.body.appendChild(batch.div); batch.iframe = document.getElementById(idname); batch.iframe.setAttribute('style', 'width:0px; height:0px; border:0px;'); if (batch.verb == "GET") { for (prop in batch.map) { query += encodeURIComponent(prop) + "=" + encodeURIComponent(batch.map[prop]) + "&"; } query = query.substring(0, query.length - 1); batch.iframe.setAttribute('src', batch.path + "/exec/" + statsInfo + "?" + query); document.body.appendChild(batch.iframe); } else { batch.form = document.createElement('form'); batch.form.setAttribute('id', 'dwr-form'); batch.form.setAttribute('action', batch.path + "/exec" + statsInfo); batch.form.setAttribute('target', idname); batch.form.target = idname; batch.form.setAttribute('method', 'post'); for (prop in batch.map) { var formInput = document.createElement('input'); formInput.setAttribute('type', 'hidden'); formInput.setAttribute('name', prop); formInput.setAttribute('value', batch.map[prop]); batch.form.appendChild(formInput); } document.body.appendChild(batch.form); batch.form.submit(); } }};
DWREngine._handleError(ex);
batch.metadata.errorHandler(ex);
DWREngine._sendData = function(batch) { // Actually make the call if (batch.preHook) { batch.preHook(); } // Set a timeout if (batch.metadata && batch.metadata.timeout && batch.metadata.timeout != 0) { var funcReq = function() { DWREngine._abortRequest(batch); }; setTimeout(funcReq, batch.metadata.timeout); } // A quick string to help people that use web log analysers var statsInfo; if (batch.map.callCount == 1) { statsInfo = batch.map["c0-scriptName"] + "." + batch.map["c0-methodName"]; } else { statsInfo = "Multiple." + batch.map.callCount; } // Get setup for XMLHttpRequest if possible if (batch.method == DWREngine.XMLHttpRequest) { if (window.XMLHttpRequest) { batch.req = new XMLHttpRequest(); } // IE5 for the mac claims to support window.ActiveXObject, but throws an error when it's used else if (window.ActiveXObject && !(navigator.userAgent.indexOf('Mac') >= 0 && navigator.userAgent.indexOf("MSIE") >= 0)) { batch.req = DWREngine._newActiveXObject(DWREngine._XMLHTTP); } } var query = ""; var prop; if (batch.req) { batch.map.xml = "true"; // Proceed using XMLHttpRequest batch.req.onreadystatechange = function() { DWREngine._stateChange(batch); }; // Force Mac people to use GET because Safari is broken. if (batch.verb == "GET" || navigator.userAgent.indexOf('Safari') >= 0) { // Some browsers (Opera/Safari2) seem to fail to convert the value // of batch.map.callCount to a string in the loop below so we do it // manually here. batch.map.callCount = "" + batch.map.callCount; for (prop in batch.map) { var qkey = encodeURIComponent(prop); var qval = encodeURIComponent(batch.map[prop]); if (qval == "") { if (DWREngine._warningHandler) { DWREngine._warningHandler("Found empty qval for qkey=" + qkey); } } query += qkey + "=" + qval + "&"; } query = query.substring(0, query.length - 1); try { batch.req.open("GET", batch.path + "/exec/" + statsInfo + "?" + query, batch.asynchronous); batch.req.send(null); } catch (ex) { DWREngine._handleError(ex); } } else { for (prop in batch.map) { if (typeof batch.map[prop] != "function") { query += prop + "=" + batch.map[prop] + "\n"; } } try { // This might include Safari too, but it shouldn't do any harm// if (navigator.userAgent.indexOf('Gecko') >= 0) {// batch.req.setRequestHeader('Connection', 'close');// } batch.req.open("POST", batch.path + "/exec/" + statsInfo, batch.asynchronous); batch.req.send(query); } catch (ex) { DWREngine._handleError(ex); } } } else { batch.map.xml = "false"; var idname = "dwr-if-" + batch.map["c0-id"]; // Proceed using iframe batch.div = document.createElement('div'); batch.div.innerHTML = "<iframe frameborder='0' width='0' height='0' id='" + idname + "' name='" + idname + "'></iframe>"; document.body.appendChild(batch.div); batch.iframe = document.getElementById(idname); batch.iframe.setAttribute('style', 'width:0px; height:0px; border:0px;'); if (batch.verb == "GET") { for (prop in batch.map) { query += encodeURIComponent(prop) + "=" + encodeURIComponent(batch.map[prop]) + "&"; } query = query.substring(0, query.length - 1); batch.iframe.setAttribute('src', batch.path + "/exec/" + statsInfo + "?" + query); document.body.appendChild(batch.iframe); } else { batch.form = document.createElement('form'); batch.form.setAttribute('id', 'dwr-form'); batch.form.setAttribute('action', batch.path + "/exec" + statsInfo); batch.form.setAttribute('target', idname); batch.form.target = idname; batch.form.setAttribute('method', 'post'); for (prop in batch.map) { var formInput = document.createElement('input'); formInput.setAttribute('type', 'hidden'); formInput.setAttribute('name', prop); formInput.setAttribute('value', batch.map[prop]); batch.form.appendChild(formInput); } document.body.appendChild(batch.form); batch.form.submit(); } }};
DWREngine._handleMetaDataError(null, ex);
DWREngine._handleMetaDataWarning(null, ex);
DWREngine._sendData = function(batch) { if (batch.map.callCount == 0) return; // Call any pre-hooks for (var i = 0; i < batch.preHooks.length; i++) { batch.preHooks[i](); } batch.preHooks = null; // Set a timeout if (batch.timeout && batch.timeout != 0) { batch.interval = setInterval(function() { DWREngine._abortRequest(batch); }, batch.timeout); } // Get setup for XMLHttpRequest if possible if (batch.method == DWREngine.XMLHttpRequest) { if (window.XMLHttpRequest) { batch.req = new XMLHttpRequest(); } // IE5 for the mac claims to support window.ActiveXObject, but throws an error when it's used else if (window.ActiveXObject && !(navigator.userAgent.indexOf("Mac") >= 0 && navigator.userAgent.indexOf("MSIE") >= 0)) { batch.req = DWREngine._newActiveXObject(DWREngine._XMLHTTP); } } var prop, request; if (batch.req) { // Proceed using XMLHttpRequest if (batch.async) { batch.req.onreadystatechange = function() { DWREngine._stateChange(batch); }; } // If we're polling, record this for monitoring if (batch.isPoll) DWREngine._pollReq = batch.req; // Workaround for Safari 1.x POST bug var indexSafari = navigator.userAgent.indexOf("Safari/"); if (indexSafari >= 0) { var version = navigator.userAgent.substring(indexSafari + 7); if (parseInt(version, 10) < 400) batch.verb == "GET"; } batch.mode = batch.isPoll ? DWREngine._ModePlainPoll : DWREngine._ModePlainCall; request = DWREngine._constructRequest(batch); try { batch.req.open(batch.verb, request.url, batch.async); try { for (prop in batch.headers) { batch.req.setRequestHeader(prop, batch.headers[prop]); } if (!batch.headers["Content-Type"]) batch.req.setRequestHeader("Content-Type", "text/plain"); } catch (ex) { DWREngine._handleMetaDataError(null, ex); } batch.req.send(request.body); if (!batch.async) DWREngine._stateChange(batch); } catch (ex) { DWREngine._handleMetaDataError(null, ex); } } else if (batch.method != DWREngine.ScriptTag) { var idname = "dwr-if-" + batch.map["c0-id"]; // Proceed using iframe batch.div = document.createElement("div"); batch.div.innerHTML = "<iframe src='javascript:void(0)' frameborder='0' width='0' height='0' id='" + idname + "' name='" + idname + "'></iframe>"; document.body.appendChild(batch.div); batch.iframe = document.getElementById(idname); batch.iframe.setAttribute("style", "width:0px; height:0px; border:0px;"); batch.mode = batch.isPoll ? DWREngine._ModeHtmlPoll : DWREngine._ModeHtmlCall; if (batch.isPoll) { // Settings that vary if we are polling DWREngine._pollFrame = batch.iframe; DWREngine._pollCometSize = 0; } request = DWREngine._constructRequest(batch); if (batch.verb == "GET") { batch.iframe.setAttribute("src", request.url); document.body.appendChild(batch.iframe); } else { batch.form = document.createElement("form"); batch.form.setAttribute("id", "dwr-form"); batch.form.setAttribute("action", request.url); batch.form.setAttribute("target", idname); batch.form.target = idname; batch.form.setAttribute("method", batch.verb); for (prop in batch.map) { var formInput = document.createElement("input"); formInput.setAttribute("type", "hidden"); formInput.setAttribute("name", prop); formInput.setAttribute("value", batch.map[prop]); batch.form.appendChild(formInput); } document.body.appendChild(batch.form); batch.form.submit(); } } else { batch.verb = "GET"; // There's no such thing as ScriptTag using POST batch.mode = batch.isPoll ? DWREngine._ModePlainPoll : DWREngine._ModePlainCall; request = DWREngine._constructRequest(batch); batch.script = document.createElement("script"); batch.script.id = "dwr-st-" + batch.map["c0-id"]; batch.script.src = request.url; document.body.appendChild(batch.script); }};
batch.metadata.errorHandler(ex);
DWREngine._handleMetaDataError(batch.metadata, ex);
DWREngine._sendData = function(batch) { // If the batch is empty, don't send anything if (batch.map.callCount == 0) return; // Call any pre-hooks if (batch.preHook) batch.preHook(); // Set a timeout if (batch.metadata && batch.metadata.timeout && batch.metadata.timeout != 0) { var funcReq = function() { DWREngine._abortRequest(batch); }; setTimeout(funcReq, batch.metadata.timeout); } // A quick string to help people that use web log analysers var statsInfo; if (batch.map.callCount == 1) { statsInfo = batch.map["c0-scriptName"] + "." + batch.map["c0-methodName"]; } else { statsInfo = "Multiple." + batch.map.callCount; } // Get setup for XMLHttpRequest if possible if (batch.method == DWREngine.XMLHttpRequest) { if (window.XMLHttpRequest) { batch.req = new XMLHttpRequest(); } // IE5 for the mac claims to support window.ActiveXObject, but throws an error when it's used else if (window.ActiveXObject && !(navigator.userAgent.indexOf('Mac') >= 0 && navigator.userAgent.indexOf("MSIE") >= 0)) { batch.req = DWREngine._newActiveXObject(DWREngine._XMLHTTP); } } var query = ""; var prop; if (batch.req) { batch.map.xml = "true"; // Proceed using XMLHttpRequest batch.req.onreadystatechange = function() { DWREngine._stateChange(batch); }; // Force Mac people to use GET because Safari is broken. if (batch.verb == "GET" || navigator.userAgent.indexOf('Safari') >= 0) { // Some browsers (Opera/Safari2) seem to fail to convert the value // of batch.map.callCount to a string in the loop below so we do it // manually here. batch.map.callCount = "" + batch.map.callCount; for (prop in batch.map) { var qkey = encodeURIComponent(prop); var qval = encodeURIComponent(batch.map[prop]); if (qval == "") { if (DWREngine._warningHandler) { DWREngine._warningHandler("Found empty qval for qkey=" + qkey); } } query += qkey + "=" + qval + "&"; } query = query.substring(0, query.length - 1); try { batch.req.open("GET", batch.path + "/exec/" + statsInfo + "?" + query, batch.asynchronous); batch.req.send(null); } catch (ex) { batch.metadata.errorHandler(ex); } } else { for (prop in batch.map) { if (typeof batch.map[prop] != "function") { query += prop + "=" + batch.map[prop] + "\n"; } } try { // This might include Safari too, but it shouldn't do any harm// if (navigator.userAgent.indexOf('Gecko') >= 0) {// batch.req.setRequestHeader('Connection', 'close');// } batch.req.open("POST", batch.path + "/exec/" + statsInfo, batch.asynchronous); batch.req.send(query); } catch (ex) { batch.metadata.errorHandler(ex); } } } else { batch.map.xml = "false"; var idname = "dwr-if-" + batch.map["c0-id"]; // Proceed using iframe batch.div = document.createElement('div'); batch.div.innerHTML = "<iframe frameborder='0' width='0' height='0' id='" + idname + "' name='" + idname + "'></iframe>"; document.body.appendChild(batch.div); batch.iframe = document.getElementById(idname); batch.iframe.setAttribute('style', 'width:0px; height:0px; border:0px;'); if (batch.verb == "GET") { for (prop in batch.map) { query += encodeURIComponent(prop) + "=" + encodeURIComponent(batch.map[prop]) + "&"; } query = query.substring(0, query.length - 1); batch.iframe.setAttribute('src', batch.path + "/exec/" + statsInfo + "?" + query); document.body.appendChild(batch.iframe); } else { batch.form = document.createElement('form'); batch.form.setAttribute('id', 'dwr-form'); batch.form.setAttribute('action', batch.path + "/exec" + statsInfo); batch.form.setAttribute('target', idname); batch.form.target = idname; batch.form.setAttribute('method', 'post'); for (prop in batch.map) { var formInput = document.createElement('input'); formInput.setAttribute('type', 'hidden'); formInput.setAttribute('name', prop); formInput.setAttribute('value', batch.map[prop]); batch.form.appendChild(formInput); } document.body.appendChild(batch.form); batch.form.submit(); } }};
if (parseInt(version, 10) < 400) batch.httpMethod == "GET";
if (parseInt(version, 10) < 400) batch.httpMethod = "GET";
DWREngine._sendData = function(batch) { for (var i = 0; i < batch.preHooks.length; i++) { batch.preHooks[i](); } batch.preHooks = null; // Set a timeout if (batch.timeout && batch.timeout != 0) { batch.interval = setInterval(function() { DWREngine._abortRequest(batch); }, batch.timeout); } // Get setup for XMLHttpRequest if possible if (batch.rpcType == DWREngine.XMLHttpRequest) { if (window.XMLHttpRequest) { batch.req = new XMLHttpRequest(); } // IE5 for the mac claims to support window.ActiveXObject, but throws an error when it's used else if (window.ActiveXObject && !(navigator.userAgent.indexOf("Mac") >= 0 && navigator.userAgent.indexOf("MSIE") >= 0)) { batch.req = DWREngine._newActiveXObject(DWREngine._XMLHTTP); } } var prop, request; if (batch.req) { // Proceed using XMLHttpRequest if (batch.async) { batch.req.onreadystatechange = function() { DWREngine._stateChange(batch); }; } // If we're polling, record this for monitoring if (batch.isPoll) DWREngine._pollReq = batch.req; // Workaround for Safari 1.x POST bug var indexSafari = navigator.userAgent.indexOf("Safari/"); if (indexSafari >= 0) { var version = navigator.userAgent.substring(indexSafari + 7); if (parseInt(version, 10) < 400) batch.httpMethod == "GET"; } batch.mode = batch.isPoll ? DWREngine._ModePlainPoll : DWREngine._ModePlainCall; request = DWREngine._constructRequest(batch); try { batch.req.open(batch.httpMethod, request.url, batch.async); try { for (prop in batch.headers) { var value = batch.headers[prop]; if (typeof value == "string") batch.req.setRequestHeader(prop, value); } if (!batch.headers["Content-Type"]) batch.req.setRequestHeader("Content-Type", "text/plain"); } catch (ex) { DWREngine._handleMetaDataWarning(null, ex); } batch.req.send(request.body); if (!batch.async) DWREngine._stateChange(batch); } catch (ex) { DWREngine._handleMetaDataError(null, ex); } } else if (batch.rpcType != DWREngine.ScriptTag) { var idname = "dwr-if-" + batch.map["c0-id"]; // Proceed using iframe batch.div = document.createElement("div"); batch.div.innerHTML = "<iframe src='javascript:void(0)' frameborder='0' width='0' height='0' id='" + idname + "' name='" + idname + "'></iframe>"; document.body.appendChild(batch.div); batch.iframe = document.getElementById(idname); batch.iframe.setAttribute("style", "width:0px; height:0px; border:0px;"); batch.mode = batch.isPoll ? DWREngine._ModeHtmlPoll : DWREngine._ModeHtmlCall; if (batch.isPoll) { // Settings that vary if we are polling DWREngine._pollFrame = batch.iframe; DWREngine._pollCometSize = 0; } request = DWREngine._constructRequest(batch); if (batch.httpMethod == "GET") { batch.iframe.setAttribute("src", request.url); document.body.appendChild(batch.iframe); } else { batch.form = document.createElement("form"); batch.form.setAttribute("id", "dwr-form"); batch.form.setAttribute("action", request.url); batch.form.setAttribute("target", idname); batch.form.target = idname; batch.form.setAttribute("method", batch.httpMethod); for (prop in batch.map) { var value = batch.map[prop]; if (typeof value != "function") { var formInput = document.createElement("input"); formInput.setAttribute("type", "hidden"); formInput.setAttribute("name", prop); formInput.setAttribute("value", value); batch.form.appendChild(formInput); } } document.body.appendChild(batch.form); batch.form.submit(); } } else { batch.httpMethod = "GET"; // There's no such thing as ScriptTag using POST batch.mode = batch.isPoll ? DWREngine._ModePlainPoll : DWREngine._ModePlainCall; request = DWREngine._constructRequest(batch); batch.script = document.createElement("script"); batch.script.id = "dwr-st-" + batch.map["c0-id"]; batch.script.src = request.url; document.body.appendChild(batch.script); }};
if (batch.verb == "GET" || navigator.userAgent.indexOf('Safari') >= 0) {
var indexSafari = navigator.userAgent.indexOf('Safari/'); if (indexSafari >= 0) { var version = navigator.userAgent.substring(indexSafari + 7); if (parseInt(version, 10) < 400) { batch.verb == "GET"; } } if (batch.verb == "GET") {
DWREngine._sendData = function(batch) { // If the batch is empty, don't send anything if (batch.map.callCount == 0) return; // Call any pre-hooks if (batch.preHook) batch.preHook(); // Set a timeout if (batch.metadata && batch.metadata.timeout && batch.metadata.timeout != 0) { var funcReq = function() { DWREngine._abortRequest(batch); }; setTimeout(funcReq, batch.metadata.timeout); } // A quick string to help people that use web log analysers var statsInfo; if (batch.map.callCount == 1) { statsInfo = batch.map["c0-scriptName"] + "." + batch.map["c0-methodName"]; } else { statsInfo = "Multiple." + batch.map.callCount; } // Get setup for XMLHttpRequest if possible if (batch.method == DWREngine.XMLHttpRequest) { if (window.XMLHttpRequest) { batch.req = new XMLHttpRequest(); } // IE5 for the mac claims to support window.ActiveXObject, but throws an error when it's used else if (window.ActiveXObject && !(navigator.userAgent.indexOf('Mac') >= 0 && navigator.userAgent.indexOf("MSIE") >= 0)) { batch.req = DWREngine._newActiveXObject(DWREngine._XMLHTTP); } } var query = ""; var prop; if (batch.req) { batch.map.xml = "true"; // Proceed using XMLHttpRequest batch.req.onreadystatechange = function() { DWREngine._stateChange(batch); }; // Force Mac people to use GET because Safari is broken. if (batch.verb == "GET" || navigator.userAgent.indexOf('Safari') >= 0) { // Some browsers (Opera/Safari2) seem to fail to convert the value // of batch.map.callCount to a string in the loop below so we do it // manually here. batch.map.callCount = "" + batch.map.callCount; for (prop in batch.map) { var qkey = encodeURIComponent(prop); var qval = encodeURIComponent(batch.map[prop]); if (qval == "") { if (DWREngine._warningHandler) { DWREngine._warningHandler("Found empty qval for qkey=" + qkey); } } query += qkey + "=" + qval + "&"; } query = query.substring(0, query.length - 1); try { batch.req.open("GET", batch.path + "/exec/" + statsInfo + "?" + query, batch.asynchronous); batch.req.send(null); } catch (ex) { DWREngine._handleMetaDataError(batch.metadata, ex); } } else { for (prop in batch.map) { if (typeof batch.map[prop] != "function") { query += prop + "=" + batch.map[prop] + "\n"; } } try { // This might include Safari too, but it shouldn't do any harm// if (navigator.userAgent.indexOf('Gecko') >= 0) {// batch.req.setRequestHeader('Connection', 'close');// } batch.req.open("POST", batch.path + "/exec/" + statsInfo, batch.asynchronous); batch.req.send(query); } catch (ex) { DWREngine._handleMetaDataError(batch.metadata, ex); } } } else { batch.map.xml = "false"; var idname = "dwr-if-" + batch.map["c0-id"]; // Proceed using iframe batch.div = document.createElement('div'); batch.div.innerHTML = "<iframe frameborder='0' width='0' height='0' id='" + idname + "' name='" + idname + "'></iframe>"; document.body.appendChild(batch.div); batch.iframe = document.getElementById(idname); batch.iframe.setAttribute('style', 'width:0px; height:0px; border:0px;'); if (batch.verb == "GET") { for (prop in batch.map) { query += encodeURIComponent(prop) + "=" + encodeURIComponent(batch.map[prop]) + "&"; } query = query.substring(0, query.length - 1); batch.iframe.setAttribute('src', batch.path + "/exec/" + statsInfo + "?" + query); document.body.appendChild(batch.iframe); } else { batch.form = document.createElement('form'); batch.form.setAttribute('id', 'dwr-form'); batch.form.setAttribute('action', batch.path + "/exec" + statsInfo); batch.form.setAttribute('target', idname); batch.form.target = idname; batch.form.setAttribute('method', 'post'); for (prop in batch.map) { var formInput = document.createElement('input'); formInput.setAttribute('type', 'hidden'); formInput.setAttribute('name', prop); formInput.setAttribute('value', batch.map[prop]); batch.form.appendChild(formInput); } document.body.appendChild(batch.form); batch.form.submit(); } }};
if (navigator.userAgent.indexOf('Gecko') >= 0) { batch.req.setRequestHeader('Connection', 'close'); } batch.req.setRequestHeader('Content-type', 'application/x-dwr');
DWREngine._sendData = function(batch) { // Actually make the call if (batch.preHook) { batch.preHook(); } // Set a timeout if (batch.metadata && batch.metadata.timeout && batch.metadata.timeout != 0) { var funcReq = function() { DWREngine._abortRequest(batch); }; setTimeout(funcReq, batch.metadata.timeout); } // Get setup for XMLHttpRequest if possible if (batch.method == DWREngine.XMLHttpRequest) { if (window.XMLHttpRequest) { batch.req = new XMLHttpRequest(); } // IE5 for the mac claims to support window.ActiveXObject, but throws an error when it's used else if (window.ActiveXObject && !(navigator.userAgent.indexOf('Mac') >= 0 && navigator.userAgent.indexOf("MSIE") >= 0)) { batch.req = DWREngine._newActiveXObject(DWREngine._XMLHTTP); } } // A quick string to help people that use web log analysers var statsInfo; if (batch.map.callCount == 1) { statsInfo = batch.map["c0-scriptName"] + "." + batch.map["c0-methodName"]; } else { statsInfo = "Multiple." + batch.map.callCount; } var query = ""; var prop; if (batch.req) { batch.map.xml = "true"; // Proceed using XMLHttpRequest batch.req.onreadystatechange = function() { DWREngine._stateChange(batch); }; // Force Mac people to use GET because Safari is broken. if (batch.verb == "GET" || navigator.userAgent.indexOf('Safari') >= 0) { // Some browsers (Opera/Safari2) seem to fail to convert the value // of batch.map.callCount to a string in the loop below so we do it // manually here. batch.map.callCount = "" + batch.map.callCount; for (prop in batch.map) { var qkey = encodeURIComponent(prop); var qval = encodeURIComponent(batch.map[prop]); if (qval == "") { if (DWREngine._warningHandler) { DWREngine._warningHandler("Found empty qval for qkey=" + qkey); } } query += qkey + "=" + qval + "&"; } query = query.substring(0, query.length - 1); try { batch.req.open("GET", batch.path + "/exec/" + statsInfo + "?" + query, batch.asynchronous); batch.req.send(null); } catch (ex) { DWREngine._handleError(ex); } } else { for (prop in batch.map) { if (typeof batch.map[prop] != "function") { query += prop + "=" + batch.map[prop] + "\n"; } } try { // Prototype does the following, why? // batch.req.setRequestHeader('Connection', 'close'); // batch.req.setRequestHeader('Content-type', 'application/x-www-form-urlencoded'); batch.req.open("POST", batch.path + "/exec/" + statsInfo, batch.asynchronous); batch.req.send(query); } catch (ex) { DWREngine._handleError(ex); } } } else { batch.map.xml = "false"; var idname = "dwr-if-" + batch.map["c0-id"]; // Proceed using iframe batch.div = document.createElement('div'); batch.div.innerHTML = "<iframe frameborder='0' width='0' height='0' id='" + idname + "' name='" + idname + "'></iframe>"; document.body.appendChild(batch.div); batch.iframe = document.getElementById(idname); batch.iframe.setAttribute('style', 'width:0px; height:0px; border:0px;'); if (batch.verb == "GET") { for (prop in batch.map) { query += encodeURIComponent(prop) + "=" + encodeURIComponent(batch.map[prop]) + "&"; } query = query.substring(0, query.length - 1); batch.iframe.setAttribute('src', batch.path + "/exec/" + statsInfo + "?" + query); document.body.appendChild(batch.iframe); } else { batch.form = document.createElement('form'); batch.form.setAttribute('id', 'dwr-form'); batch.form.setAttribute('action', batch.path + "/exec" + statsInfo); batch.form.setAttribute('target', idname); batch.form.target = idname; batch.form.setAttribute('method', 'post'); for (prop in batch.map) { var formInput = document.createElement('input'); formInput.setAttribute('type', 'hidden'); formInput.setAttribute('name', prop); formInput.setAttribute('value', batch.map[prop]); batch.form.appendChild(formInput); } document.body.appendChild(batch.form); batch.form.submit(); } }};
batch.req.setRequestHeader(prop, batch.headers[prop]);
var value = batch.headers[prop]; if (typeof value == "string") batch.req.setRequestHeader(prop, value);
DWREngine._sendData = function(batch) { for (var i = 0; i < batch.preHooks.length; i++) { batch.preHooks[i](); } batch.preHooks = null; // Set a timeout if (batch.timeout && batch.timeout != 0) { batch.interval = setInterval(function() { DWREngine._abortRequest(batch); }, batch.timeout); } // Get setup for XMLHttpRequest if possible if (batch.rpcType == DWREngine.XMLHttpRequest) { if (window.XMLHttpRequest) { batch.req = new XMLHttpRequest(); } // IE5 for the mac claims to support window.ActiveXObject, but throws an error when it's used else if (window.ActiveXObject && !(navigator.userAgent.indexOf("Mac") >= 0 && navigator.userAgent.indexOf("MSIE") >= 0)) { batch.req = DWREngine._newActiveXObject(DWREngine._XMLHTTP); } } var prop, request; if (batch.req) { // Proceed using XMLHttpRequest if (batch.async) { batch.req.onreadystatechange = function() { DWREngine._stateChange(batch); }; } // If we're polling, record this for monitoring if (batch.isPoll) DWREngine._pollReq = batch.req; // Workaround for Safari 1.x POST bug var indexSafari = navigator.userAgent.indexOf("Safari/"); if (indexSafari >= 0) { var version = navigator.userAgent.substring(indexSafari + 7); if (parseInt(version, 10) < 400) batch.httpMethod == "GET"; } batch.mode = batch.isPoll ? DWREngine._ModePlainPoll : DWREngine._ModePlainCall; request = DWREngine._constructRequest(batch); try { batch.req.open(batch.httpMethod, request.url, batch.async); try { for (prop in batch.headers) { batch.req.setRequestHeader(prop, batch.headers[prop]); } if (!batch.headers["Content-Type"]) batch.req.setRequestHeader("Content-Type", "text/plain"); } catch (ex) { DWREngine._handleMetaDataWarning(null, ex); } batch.req.send(request.body); if (!batch.async) DWREngine._stateChange(batch); } catch (ex) { DWREngine._handleMetaDataError(null, ex); } } else if (batch.rpcType != DWREngine.ScriptTag) { var idname = "dwr-if-" + batch.map["c0-id"]; // Proceed using iframe batch.div = document.createElement("div"); batch.div.innerHTML = "<iframe src='javascript:void(0)' frameborder='0' width='0' height='0' id='" + idname + "' name='" + idname + "'></iframe>"; document.body.appendChild(batch.div); batch.iframe = document.getElementById(idname); batch.iframe.setAttribute("style", "width:0px; height:0px; border:0px;"); batch.mode = batch.isPoll ? DWREngine._ModeHtmlPoll : DWREngine._ModeHtmlCall; if (batch.isPoll) { // Settings that vary if we are polling DWREngine._pollFrame = batch.iframe; DWREngine._pollCometSize = 0; } request = DWREngine._constructRequest(batch); if (batch.httpMethod == "GET") { batch.iframe.setAttribute("src", request.url); document.body.appendChild(batch.iframe); } else { batch.form = document.createElement("form"); batch.form.setAttribute("id", "dwr-form"); batch.form.setAttribute("action", request.url); batch.form.setAttribute("target", idname); batch.form.target = idname; batch.form.setAttribute("method", batch.httpMethod); for (prop in batch.map) { var formInput = document.createElement("input"); formInput.setAttribute("type", "hidden"); formInput.setAttribute("name", prop); formInput.setAttribute("value", batch.map[prop]); batch.form.appendChild(formInput); } document.body.appendChild(batch.form); batch.form.submit(); } } else { batch.httpMethod = "GET"; // There's no such thing as ScriptTag using POST batch.mode = batch.isPoll ? DWREngine._ModePlainPoll : DWREngine._ModePlainCall; request = DWREngine._constructRequest(batch); batch.script = document.createElement("script"); batch.script.id = "dwr-st-" + batch.map["c0-id"]; batch.script.src = request.url; document.body.appendChild(batch.script); }};
var formInput = document.createElement("input"); formInput.setAttribute("type", "hidden"); formInput.setAttribute("name", prop); formInput.setAttribute("value", batch.map[prop]); batch.form.appendChild(formInput);
var value = batch.map[prop]; if (typeof value != "function") { var formInput = document.createElement("input"); formInput.setAttribute("type", "hidden"); formInput.setAttribute("name", prop); formInput.setAttribute("value", value); batch.form.appendChild(formInput); }
DWREngine._sendData = function(batch) { for (var i = 0; i < batch.preHooks.length; i++) { batch.preHooks[i](); } batch.preHooks = null; // Set a timeout if (batch.timeout && batch.timeout != 0) { batch.interval = setInterval(function() { DWREngine._abortRequest(batch); }, batch.timeout); } // Get setup for XMLHttpRequest if possible if (batch.rpcType == DWREngine.XMLHttpRequest) { if (window.XMLHttpRequest) { batch.req = new XMLHttpRequest(); } // IE5 for the mac claims to support window.ActiveXObject, but throws an error when it's used else if (window.ActiveXObject && !(navigator.userAgent.indexOf("Mac") >= 0 && navigator.userAgent.indexOf("MSIE") >= 0)) { batch.req = DWREngine._newActiveXObject(DWREngine._XMLHTTP); } } var prop, request; if (batch.req) { // Proceed using XMLHttpRequest if (batch.async) { batch.req.onreadystatechange = function() { DWREngine._stateChange(batch); }; } // If we're polling, record this for monitoring if (batch.isPoll) DWREngine._pollReq = batch.req; // Workaround for Safari 1.x POST bug var indexSafari = navigator.userAgent.indexOf("Safari/"); if (indexSafari >= 0) { var version = navigator.userAgent.substring(indexSafari + 7); if (parseInt(version, 10) < 400) batch.httpMethod == "GET"; } batch.mode = batch.isPoll ? DWREngine._ModePlainPoll : DWREngine._ModePlainCall; request = DWREngine._constructRequest(batch); try { batch.req.open(batch.httpMethod, request.url, batch.async); try { for (prop in batch.headers) { batch.req.setRequestHeader(prop, batch.headers[prop]); } if (!batch.headers["Content-Type"]) batch.req.setRequestHeader("Content-Type", "text/plain"); } catch (ex) { DWREngine._handleMetaDataWarning(null, ex); } batch.req.send(request.body); if (!batch.async) DWREngine._stateChange(batch); } catch (ex) { DWREngine._handleMetaDataError(null, ex); } } else if (batch.rpcType != DWREngine.ScriptTag) { var idname = "dwr-if-" + batch.map["c0-id"]; // Proceed using iframe batch.div = document.createElement("div"); batch.div.innerHTML = "<iframe src='javascript:void(0)' frameborder='0' width='0' height='0' id='" + idname + "' name='" + idname + "'></iframe>"; document.body.appendChild(batch.div); batch.iframe = document.getElementById(idname); batch.iframe.setAttribute("style", "width:0px; height:0px; border:0px;"); batch.mode = batch.isPoll ? DWREngine._ModeHtmlPoll : DWREngine._ModeHtmlCall; if (batch.isPoll) { // Settings that vary if we are polling DWREngine._pollFrame = batch.iframe; DWREngine._pollCometSize = 0; } request = DWREngine._constructRequest(batch); if (batch.httpMethod == "GET") { batch.iframe.setAttribute("src", request.url); document.body.appendChild(batch.iframe); } else { batch.form = document.createElement("form"); batch.form.setAttribute("id", "dwr-form"); batch.form.setAttribute("action", request.url); batch.form.setAttribute("target", idname); batch.form.target = idname; batch.form.setAttribute("method", batch.httpMethod); for (prop in batch.map) { var formInput = document.createElement("input"); formInput.setAttribute("type", "hidden"); formInput.setAttribute("name", prop); formInput.setAttribute("value", batch.map[prop]); batch.form.appendChild(formInput); } document.body.appendChild(batch.form); batch.form.submit(); } } else { batch.httpMethod = "GET"; // There's no such thing as ScriptTag using POST batch.mode = batch.isPoll ? DWREngine._ModePlainPoll : DWREngine._ModePlainCall; request = DWREngine._constructRequest(batch); batch.script = document.createElement("script"); batch.script.id = "dwr-st-" + batch.map["c0-id"]; batch.script.src = request.url; document.body.appendChild(batch.script); }};
DWREngine._sendData = function(batch) { batch.map.batchId = DWREngine._nextBatchId++; DWREngine._batches[batch.map.batchId] = batch; DWREngine._batchesLength++;
dwr.engine._sendData = function(batch) { batch.map.batchId = dwr.engine._nextBatchId++; dwr.engine._batches[batch.map.batchId] = batch; dwr.engine._batchesLength++;
DWREngine._sendData = function(batch) { batch.map.batchId = DWREngine._nextBatchId++; DWREngine._batches[batch.map.batchId] = batch; DWREngine._batchesLength++; batch.completed = false; DWREngine._debug("Sending batchId=" + batch.map.batchId + " outstanding batches=" + DWREngine._batchesLength + " queued batches=" + DWREngine._batchQueue.length); for (var i = 0; i < batch.preHooks.length; i++) { batch.preHooks[i](); } batch.preHooks = null; // Set a timeout if (batch.timeout && batch.timeout != 0) { batch.interval = setInterval(function() { DWREngine._abortRequest(batch); }, batch.timeout); } // Get setup for XMLHttpRequest if possible if (batch.rpcType == DWREngine.XMLHttpRequest) { if (window.XMLHttpRequest) { batch.req = new XMLHttpRequest(); } // IE5 for the mac claims to support window.ActiveXObject, but throws an error when it's used else if (window.ActiveXObject && !(navigator.userAgent.indexOf("Mac") >= 0 && navigator.userAgent.indexOf("MSIE") >= 0)) { batch.req = DWREngine._newActiveXObject(DWREngine._XMLHTTP); } } var prop, request; if (batch.req) { // Proceed using XMLHttpRequest if (batch.async) { batch.req.onreadystatechange = function() { DWREngine._stateChange(batch); }; } // If we're polling, record this for monitoring if (batch.isPoll) DWREngine._pollReq = batch.req; // Workaround for Safari 1.x POST bug var indexSafari = navigator.userAgent.indexOf("Safari/"); if (indexSafari >= 0) { var version = navigator.userAgent.substring(indexSafari + 7); if (parseInt(version, 10) < 400) batch.httpMethod = "GET"; } batch.mode = batch.isPoll ? DWREngine._ModePlainPoll : DWREngine._ModePlainCall; request = DWREngine._constructRequest(batch); try { batch.req.open(batch.httpMethod, request.url, batch.async); try { for (prop in batch.headers) { var value = batch.headers[prop]; if (typeof value == "string") batch.req.setRequestHeader(prop, value); } if (!batch.headers["Content-Type"]) batch.req.setRequestHeader("Content-Type", "text/plain"); } catch (ex) { DWREngine._handleWarning(null, ex); } batch.req.send(request.body); if (!batch.async) DWREngine._stateChange(batch); } catch (ex) { DWREngine._handleError(batch, ex); } } else if (batch.rpcType != DWREngine.ScriptTag) { var idname = "dwr-if-" + batch.map["c0-id"]; // Proceed using iframe batch.div = document.createElement("div"); batch.div.innerHTML = "<iframe src='javascript:void(0)' frameborder='0' width='0' height='0' id='" + idname + "' name='" + idname + "'></iframe>"; document.body.appendChild(batch.div); batch.iframe = document.getElementById(idname); batch.iframe.setAttribute("style", "width:0px; height:0px; border:0px;"); batch.iframe.batch = batch; batch.mode = batch.isPoll ? DWREngine._ModeHtmlPoll : DWREngine._ModeHtmlCall; if (batch.isPoll) { // Settings that vary if we are polling DWREngine._pollFrame = batch.iframe; DWREngine._pollCometSize = 0; } request = DWREngine._constructRequest(batch); if (batch.httpMethod == "GET") { batch.iframe.setAttribute("src", request.url); document.body.appendChild(batch.iframe); } else { batch.form = document.createElement("form"); batch.form.setAttribute("id", "dwr-form"); batch.form.setAttribute("action", request.url); batch.form.setAttribute("target", idname); batch.form.target = idname; batch.form.setAttribute("method", batch.httpMethod); for (prop in batch.map) { var value = batch.map[prop]; if (typeof value != "function") { var formInput = document.createElement("input"); formInput.setAttribute("type", "hidden"); formInput.setAttribute("name", prop); formInput.setAttribute("value", value); batch.form.appendChild(formInput); } } document.body.appendChild(batch.form); batch.form.submit(); } } else { batch.httpMethod = "GET"; // There's no such thing as ScriptTag using POST batch.mode = batch.isPoll ? DWREngine._ModePlainPoll : DWREngine._ModePlainCall; request = DWREngine._constructRequest(batch); batch.script = document.createElement("script"); batch.script.id = "dwr-st-" + batch.map["c0-id"]; batch.script.src = request.url; document.body.appendChild(batch.script); }};
DWREngine._debug("Sending batchId=" + batch.map.batchId + " outstanding batches=" + DWREngine._batchesLength + " queued batches=" + DWREngine._batchQueue.length);
dwr.engine._debug("Sending batchId=" + batch.map.batchId + " handlers=" + dwr.util.toDescriptiveString(batch.handlers));
DWREngine._sendData = function(batch) { batch.map.batchId = DWREngine._nextBatchId++; DWREngine._batches[batch.map.batchId] = batch; DWREngine._batchesLength++; batch.completed = false; DWREngine._debug("Sending batchId=" + batch.map.batchId + " outstanding batches=" + DWREngine._batchesLength + " queued batches=" + DWREngine._batchQueue.length); for (var i = 0; i < batch.preHooks.length; i++) { batch.preHooks[i](); } batch.preHooks = null; // Set a timeout if (batch.timeout && batch.timeout != 0) { batch.interval = setInterval(function() { DWREngine._abortRequest(batch); }, batch.timeout); } // Get setup for XMLHttpRequest if possible if (batch.rpcType == DWREngine.XMLHttpRequest) { if (window.XMLHttpRequest) { batch.req = new XMLHttpRequest(); } // IE5 for the mac claims to support window.ActiveXObject, but throws an error when it's used else if (window.ActiveXObject && !(navigator.userAgent.indexOf("Mac") >= 0 && navigator.userAgent.indexOf("MSIE") >= 0)) { batch.req = DWREngine._newActiveXObject(DWREngine._XMLHTTP); } } var prop, request; if (batch.req) { // Proceed using XMLHttpRequest if (batch.async) { batch.req.onreadystatechange = function() { DWREngine._stateChange(batch); }; } // If we're polling, record this for monitoring if (batch.isPoll) DWREngine._pollReq = batch.req; // Workaround for Safari 1.x POST bug var indexSafari = navigator.userAgent.indexOf("Safari/"); if (indexSafari >= 0) { var version = navigator.userAgent.substring(indexSafari + 7); if (parseInt(version, 10) < 400) batch.httpMethod = "GET"; } batch.mode = batch.isPoll ? DWREngine._ModePlainPoll : DWREngine._ModePlainCall; request = DWREngine._constructRequest(batch); try { batch.req.open(batch.httpMethod, request.url, batch.async); try { for (prop in batch.headers) { var value = batch.headers[prop]; if (typeof value == "string") batch.req.setRequestHeader(prop, value); } if (!batch.headers["Content-Type"]) batch.req.setRequestHeader("Content-Type", "text/plain"); } catch (ex) { DWREngine._handleWarning(null, ex); } batch.req.send(request.body); if (!batch.async) DWREngine._stateChange(batch); } catch (ex) { DWREngine._handleError(batch, ex); } } else if (batch.rpcType != DWREngine.ScriptTag) { var idname = "dwr-if-" + batch.map["c0-id"]; // Proceed using iframe batch.div = document.createElement("div"); batch.div.innerHTML = "<iframe src='javascript:void(0)' frameborder='0' width='0' height='0' id='" + idname + "' name='" + idname + "'></iframe>"; document.body.appendChild(batch.div); batch.iframe = document.getElementById(idname); batch.iframe.setAttribute("style", "width:0px; height:0px; border:0px;"); batch.iframe.batch = batch; batch.mode = batch.isPoll ? DWREngine._ModeHtmlPoll : DWREngine._ModeHtmlCall; if (batch.isPoll) { // Settings that vary if we are polling DWREngine._pollFrame = batch.iframe; DWREngine._pollCometSize = 0; } request = DWREngine._constructRequest(batch); if (batch.httpMethod == "GET") { batch.iframe.setAttribute("src", request.url); document.body.appendChild(batch.iframe); } else { batch.form = document.createElement("form"); batch.form.setAttribute("id", "dwr-form"); batch.form.setAttribute("action", request.url); batch.form.setAttribute("target", idname); batch.form.target = idname; batch.form.setAttribute("method", batch.httpMethod); for (prop in batch.map) { var value = batch.map[prop]; if (typeof value != "function") { var formInput = document.createElement("input"); formInput.setAttribute("type", "hidden"); formInput.setAttribute("name", prop); formInput.setAttribute("value", value); batch.form.appendChild(formInput); } } document.body.appendChild(batch.form); batch.form.submit(); } } else { batch.httpMethod = "GET"; // There's no such thing as ScriptTag using POST batch.mode = batch.isPoll ? DWREngine._ModePlainPoll : DWREngine._ModePlainCall; request = DWREngine._constructRequest(batch); batch.script = document.createElement("script"); batch.script.id = "dwr-st-" + batch.map["c0-id"]; batch.script.src = request.url; document.body.appendChild(batch.script); }};
batch.interval = setInterval(function() { DWREngine._abortRequest(batch); }, batch.timeout);
batch.interval = setInterval(function() { dwr.engine._abortRequest(batch); }, batch.timeout);
DWREngine._sendData = function(batch) { batch.map.batchId = DWREngine._nextBatchId++; DWREngine._batches[batch.map.batchId] = batch; DWREngine._batchesLength++; batch.completed = false; DWREngine._debug("Sending batchId=" + batch.map.batchId + " outstanding batches=" + DWREngine._batchesLength + " queued batches=" + DWREngine._batchQueue.length); for (var i = 0; i < batch.preHooks.length; i++) { batch.preHooks[i](); } batch.preHooks = null; // Set a timeout if (batch.timeout && batch.timeout != 0) { batch.interval = setInterval(function() { DWREngine._abortRequest(batch); }, batch.timeout); } // Get setup for XMLHttpRequest if possible if (batch.rpcType == DWREngine.XMLHttpRequest) { if (window.XMLHttpRequest) { batch.req = new XMLHttpRequest(); } // IE5 for the mac claims to support window.ActiveXObject, but throws an error when it's used else if (window.ActiveXObject && !(navigator.userAgent.indexOf("Mac") >= 0 && navigator.userAgent.indexOf("MSIE") >= 0)) { batch.req = DWREngine._newActiveXObject(DWREngine._XMLHTTP); } } var prop, request; if (batch.req) { // Proceed using XMLHttpRequest if (batch.async) { batch.req.onreadystatechange = function() { DWREngine._stateChange(batch); }; } // If we're polling, record this for monitoring if (batch.isPoll) DWREngine._pollReq = batch.req; // Workaround for Safari 1.x POST bug var indexSafari = navigator.userAgent.indexOf("Safari/"); if (indexSafari >= 0) { var version = navigator.userAgent.substring(indexSafari + 7); if (parseInt(version, 10) < 400) batch.httpMethod = "GET"; } batch.mode = batch.isPoll ? DWREngine._ModePlainPoll : DWREngine._ModePlainCall; request = DWREngine._constructRequest(batch); try { batch.req.open(batch.httpMethod, request.url, batch.async); try { for (prop in batch.headers) { var value = batch.headers[prop]; if (typeof value == "string") batch.req.setRequestHeader(prop, value); } if (!batch.headers["Content-Type"]) batch.req.setRequestHeader("Content-Type", "text/plain"); } catch (ex) { DWREngine._handleWarning(null, ex); } batch.req.send(request.body); if (!batch.async) DWREngine._stateChange(batch); } catch (ex) { DWREngine._handleError(batch, ex); } } else if (batch.rpcType != DWREngine.ScriptTag) { var idname = "dwr-if-" + batch.map["c0-id"]; // Proceed using iframe batch.div = document.createElement("div"); batch.div.innerHTML = "<iframe src='javascript:void(0)' frameborder='0' width='0' height='0' id='" + idname + "' name='" + idname + "'></iframe>"; document.body.appendChild(batch.div); batch.iframe = document.getElementById(idname); batch.iframe.setAttribute("style", "width:0px; height:0px; border:0px;"); batch.iframe.batch = batch; batch.mode = batch.isPoll ? DWREngine._ModeHtmlPoll : DWREngine._ModeHtmlCall; if (batch.isPoll) { // Settings that vary if we are polling DWREngine._pollFrame = batch.iframe; DWREngine._pollCometSize = 0; } request = DWREngine._constructRequest(batch); if (batch.httpMethod == "GET") { batch.iframe.setAttribute("src", request.url); document.body.appendChild(batch.iframe); } else { batch.form = document.createElement("form"); batch.form.setAttribute("id", "dwr-form"); batch.form.setAttribute("action", request.url); batch.form.setAttribute("target", idname); batch.form.target = idname; batch.form.setAttribute("method", batch.httpMethod); for (prop in batch.map) { var value = batch.map[prop]; if (typeof value != "function") { var formInput = document.createElement("input"); formInput.setAttribute("type", "hidden"); formInput.setAttribute("name", prop); formInput.setAttribute("value", value); batch.form.appendChild(formInput); } } document.body.appendChild(batch.form); batch.form.submit(); } } else { batch.httpMethod = "GET"; // There's no such thing as ScriptTag using POST batch.mode = batch.isPoll ? DWREngine._ModePlainPoll : DWREngine._ModePlainCall; request = DWREngine._constructRequest(batch); batch.script = document.createElement("script"); batch.script.id = "dwr-st-" + batch.map["c0-id"]; batch.script.src = request.url; document.body.appendChild(batch.script); }};
if (batch.rpcType == DWREngine.XMLHttpRequest) {
if (batch.rpcType == dwr.engine.XMLHttpRequest) {
DWREngine._sendData = function(batch) { batch.map.batchId = DWREngine._nextBatchId++; DWREngine._batches[batch.map.batchId] = batch; DWREngine._batchesLength++; batch.completed = false; DWREngine._debug("Sending batchId=" + batch.map.batchId + " outstanding batches=" + DWREngine._batchesLength + " queued batches=" + DWREngine._batchQueue.length); for (var i = 0; i < batch.preHooks.length; i++) { batch.preHooks[i](); } batch.preHooks = null; // Set a timeout if (batch.timeout && batch.timeout != 0) { batch.interval = setInterval(function() { DWREngine._abortRequest(batch); }, batch.timeout); } // Get setup for XMLHttpRequest if possible if (batch.rpcType == DWREngine.XMLHttpRequest) { if (window.XMLHttpRequest) { batch.req = new XMLHttpRequest(); } // IE5 for the mac claims to support window.ActiveXObject, but throws an error when it's used else if (window.ActiveXObject && !(navigator.userAgent.indexOf("Mac") >= 0 && navigator.userAgent.indexOf("MSIE") >= 0)) { batch.req = DWREngine._newActiveXObject(DWREngine._XMLHTTP); } } var prop, request; if (batch.req) { // Proceed using XMLHttpRequest if (batch.async) { batch.req.onreadystatechange = function() { DWREngine._stateChange(batch); }; } // If we're polling, record this for monitoring if (batch.isPoll) DWREngine._pollReq = batch.req; // Workaround for Safari 1.x POST bug var indexSafari = navigator.userAgent.indexOf("Safari/"); if (indexSafari >= 0) { var version = navigator.userAgent.substring(indexSafari + 7); if (parseInt(version, 10) < 400) batch.httpMethod = "GET"; } batch.mode = batch.isPoll ? DWREngine._ModePlainPoll : DWREngine._ModePlainCall; request = DWREngine._constructRequest(batch); try { batch.req.open(batch.httpMethod, request.url, batch.async); try { for (prop in batch.headers) { var value = batch.headers[prop]; if (typeof value == "string") batch.req.setRequestHeader(prop, value); } if (!batch.headers["Content-Type"]) batch.req.setRequestHeader("Content-Type", "text/plain"); } catch (ex) { DWREngine._handleWarning(null, ex); } batch.req.send(request.body); if (!batch.async) DWREngine._stateChange(batch); } catch (ex) { DWREngine._handleError(batch, ex); } } else if (batch.rpcType != DWREngine.ScriptTag) { var idname = "dwr-if-" + batch.map["c0-id"]; // Proceed using iframe batch.div = document.createElement("div"); batch.div.innerHTML = "<iframe src='javascript:void(0)' frameborder='0' width='0' height='0' id='" + idname + "' name='" + idname + "'></iframe>"; document.body.appendChild(batch.div); batch.iframe = document.getElementById(idname); batch.iframe.setAttribute("style", "width:0px; height:0px; border:0px;"); batch.iframe.batch = batch; batch.mode = batch.isPoll ? DWREngine._ModeHtmlPoll : DWREngine._ModeHtmlCall; if (batch.isPoll) { // Settings that vary if we are polling DWREngine._pollFrame = batch.iframe; DWREngine._pollCometSize = 0; } request = DWREngine._constructRequest(batch); if (batch.httpMethod == "GET") { batch.iframe.setAttribute("src", request.url); document.body.appendChild(batch.iframe); } else { batch.form = document.createElement("form"); batch.form.setAttribute("id", "dwr-form"); batch.form.setAttribute("action", request.url); batch.form.setAttribute("target", idname); batch.form.target = idname; batch.form.setAttribute("method", batch.httpMethod); for (prop in batch.map) { var value = batch.map[prop]; if (typeof value != "function") { var formInput = document.createElement("input"); formInput.setAttribute("type", "hidden"); formInput.setAttribute("name", prop); formInput.setAttribute("value", value); batch.form.appendChild(formInput); } } document.body.appendChild(batch.form); batch.form.submit(); } } else { batch.httpMethod = "GET"; // There's no such thing as ScriptTag using POST batch.mode = batch.isPoll ? DWREngine._ModePlainPoll : DWREngine._ModePlainCall; request = DWREngine._constructRequest(batch); batch.script = document.createElement("script"); batch.script.id = "dwr-st-" + batch.map["c0-id"]; batch.script.src = request.url; document.body.appendChild(batch.script); }};
batch.req = DWREngine._newActiveXObject(DWREngine._XMLHTTP);
batch.req = dwr.engine._newActiveXObject(dwr.engine._XMLHTTP);
DWREngine._sendData = function(batch) { batch.map.batchId = DWREngine._nextBatchId++; DWREngine._batches[batch.map.batchId] = batch; DWREngine._batchesLength++; batch.completed = false; DWREngine._debug("Sending batchId=" + batch.map.batchId + " outstanding batches=" + DWREngine._batchesLength + " queued batches=" + DWREngine._batchQueue.length); for (var i = 0; i < batch.preHooks.length; i++) { batch.preHooks[i](); } batch.preHooks = null; // Set a timeout if (batch.timeout && batch.timeout != 0) { batch.interval = setInterval(function() { DWREngine._abortRequest(batch); }, batch.timeout); } // Get setup for XMLHttpRequest if possible if (batch.rpcType == DWREngine.XMLHttpRequest) { if (window.XMLHttpRequest) { batch.req = new XMLHttpRequest(); } // IE5 for the mac claims to support window.ActiveXObject, but throws an error when it's used else if (window.ActiveXObject && !(navigator.userAgent.indexOf("Mac") >= 0 && navigator.userAgent.indexOf("MSIE") >= 0)) { batch.req = DWREngine._newActiveXObject(DWREngine._XMLHTTP); } } var prop, request; if (batch.req) { // Proceed using XMLHttpRequest if (batch.async) { batch.req.onreadystatechange = function() { DWREngine._stateChange(batch); }; } // If we're polling, record this for monitoring if (batch.isPoll) DWREngine._pollReq = batch.req; // Workaround for Safari 1.x POST bug var indexSafari = navigator.userAgent.indexOf("Safari/"); if (indexSafari >= 0) { var version = navigator.userAgent.substring(indexSafari + 7); if (parseInt(version, 10) < 400) batch.httpMethod = "GET"; } batch.mode = batch.isPoll ? DWREngine._ModePlainPoll : DWREngine._ModePlainCall; request = DWREngine._constructRequest(batch); try { batch.req.open(batch.httpMethod, request.url, batch.async); try { for (prop in batch.headers) { var value = batch.headers[prop]; if (typeof value == "string") batch.req.setRequestHeader(prop, value); } if (!batch.headers["Content-Type"]) batch.req.setRequestHeader("Content-Type", "text/plain"); } catch (ex) { DWREngine._handleWarning(null, ex); } batch.req.send(request.body); if (!batch.async) DWREngine._stateChange(batch); } catch (ex) { DWREngine._handleError(batch, ex); } } else if (batch.rpcType != DWREngine.ScriptTag) { var idname = "dwr-if-" + batch.map["c0-id"]; // Proceed using iframe batch.div = document.createElement("div"); batch.div.innerHTML = "<iframe src='javascript:void(0)' frameborder='0' width='0' height='0' id='" + idname + "' name='" + idname + "'></iframe>"; document.body.appendChild(batch.div); batch.iframe = document.getElementById(idname); batch.iframe.setAttribute("style", "width:0px; height:0px; border:0px;"); batch.iframe.batch = batch; batch.mode = batch.isPoll ? DWREngine._ModeHtmlPoll : DWREngine._ModeHtmlCall; if (batch.isPoll) { // Settings that vary if we are polling DWREngine._pollFrame = batch.iframe; DWREngine._pollCometSize = 0; } request = DWREngine._constructRequest(batch); if (batch.httpMethod == "GET") { batch.iframe.setAttribute("src", request.url); document.body.appendChild(batch.iframe); } else { batch.form = document.createElement("form"); batch.form.setAttribute("id", "dwr-form"); batch.form.setAttribute("action", request.url); batch.form.setAttribute("target", idname); batch.form.target = idname; batch.form.setAttribute("method", batch.httpMethod); for (prop in batch.map) { var value = batch.map[prop]; if (typeof value != "function") { var formInput = document.createElement("input"); formInput.setAttribute("type", "hidden"); formInput.setAttribute("name", prop); formInput.setAttribute("value", value); batch.form.appendChild(formInput); } } document.body.appendChild(batch.form); batch.form.submit(); } } else { batch.httpMethod = "GET"; // There's no such thing as ScriptTag using POST batch.mode = batch.isPoll ? DWREngine._ModePlainPoll : DWREngine._ModePlainCall; request = DWREngine._constructRequest(batch); batch.script = document.createElement("script"); batch.script.id = "dwr-st-" + batch.map["c0-id"]; batch.script.src = request.url; document.body.appendChild(batch.script); }};
batch.req.onreadystatechange = function() { DWREngine._stateChange(batch); };
batch.req.onreadystatechange = function() { dwr.engine._stateChange(batch); };
DWREngine._sendData = function(batch) { batch.map.batchId = DWREngine._nextBatchId++; DWREngine._batches[batch.map.batchId] = batch; DWREngine._batchesLength++; batch.completed = false; DWREngine._debug("Sending batchId=" + batch.map.batchId + " outstanding batches=" + DWREngine._batchesLength + " queued batches=" + DWREngine._batchQueue.length); for (var i = 0; i < batch.preHooks.length; i++) { batch.preHooks[i](); } batch.preHooks = null; // Set a timeout if (batch.timeout && batch.timeout != 0) { batch.interval = setInterval(function() { DWREngine._abortRequest(batch); }, batch.timeout); } // Get setup for XMLHttpRequest if possible if (batch.rpcType == DWREngine.XMLHttpRequest) { if (window.XMLHttpRequest) { batch.req = new XMLHttpRequest(); } // IE5 for the mac claims to support window.ActiveXObject, but throws an error when it's used else if (window.ActiveXObject && !(navigator.userAgent.indexOf("Mac") >= 0 && navigator.userAgent.indexOf("MSIE") >= 0)) { batch.req = DWREngine._newActiveXObject(DWREngine._XMLHTTP); } } var prop, request; if (batch.req) { // Proceed using XMLHttpRequest if (batch.async) { batch.req.onreadystatechange = function() { DWREngine._stateChange(batch); }; } // If we're polling, record this for monitoring if (batch.isPoll) DWREngine._pollReq = batch.req; // Workaround for Safari 1.x POST bug var indexSafari = navigator.userAgent.indexOf("Safari/"); if (indexSafari >= 0) { var version = navigator.userAgent.substring(indexSafari + 7); if (parseInt(version, 10) < 400) batch.httpMethod = "GET"; } batch.mode = batch.isPoll ? DWREngine._ModePlainPoll : DWREngine._ModePlainCall; request = DWREngine._constructRequest(batch); try { batch.req.open(batch.httpMethod, request.url, batch.async); try { for (prop in batch.headers) { var value = batch.headers[prop]; if (typeof value == "string") batch.req.setRequestHeader(prop, value); } if (!batch.headers["Content-Type"]) batch.req.setRequestHeader("Content-Type", "text/plain"); } catch (ex) { DWREngine._handleWarning(null, ex); } batch.req.send(request.body); if (!batch.async) DWREngine._stateChange(batch); } catch (ex) { DWREngine._handleError(batch, ex); } } else if (batch.rpcType != DWREngine.ScriptTag) { var idname = "dwr-if-" + batch.map["c0-id"]; // Proceed using iframe batch.div = document.createElement("div"); batch.div.innerHTML = "<iframe src='javascript:void(0)' frameborder='0' width='0' height='0' id='" + idname + "' name='" + idname + "'></iframe>"; document.body.appendChild(batch.div); batch.iframe = document.getElementById(idname); batch.iframe.setAttribute("style", "width:0px; height:0px; border:0px;"); batch.iframe.batch = batch; batch.mode = batch.isPoll ? DWREngine._ModeHtmlPoll : DWREngine._ModeHtmlCall; if (batch.isPoll) { // Settings that vary if we are polling DWREngine._pollFrame = batch.iframe; DWREngine._pollCometSize = 0; } request = DWREngine._constructRequest(batch); if (batch.httpMethod == "GET") { batch.iframe.setAttribute("src", request.url); document.body.appendChild(batch.iframe); } else { batch.form = document.createElement("form"); batch.form.setAttribute("id", "dwr-form"); batch.form.setAttribute("action", request.url); batch.form.setAttribute("target", idname); batch.form.target = idname; batch.form.setAttribute("method", batch.httpMethod); for (prop in batch.map) { var value = batch.map[prop]; if (typeof value != "function") { var formInput = document.createElement("input"); formInput.setAttribute("type", "hidden"); formInput.setAttribute("name", prop); formInput.setAttribute("value", value); batch.form.appendChild(formInput); } } document.body.appendChild(batch.form); batch.form.submit(); } } else { batch.httpMethod = "GET"; // There's no such thing as ScriptTag using POST batch.mode = batch.isPoll ? DWREngine._ModePlainPoll : DWREngine._ModePlainCall; request = DWREngine._constructRequest(batch); batch.script = document.createElement("script"); batch.script.id = "dwr-st-" + batch.map["c0-id"]; batch.script.src = request.url; document.body.appendChild(batch.script); }};
if (batch.isPoll) DWREngine._pollReq = batch.req;
if (batch.isPoll) dwr.engine._pollReq = batch.req;
DWREngine._sendData = function(batch) { batch.map.batchId = DWREngine._nextBatchId++; DWREngine._batches[batch.map.batchId] = batch; DWREngine._batchesLength++; batch.completed = false; DWREngine._debug("Sending batchId=" + batch.map.batchId + " outstanding batches=" + DWREngine._batchesLength + " queued batches=" + DWREngine._batchQueue.length); for (var i = 0; i < batch.preHooks.length; i++) { batch.preHooks[i](); } batch.preHooks = null; // Set a timeout if (batch.timeout && batch.timeout != 0) { batch.interval = setInterval(function() { DWREngine._abortRequest(batch); }, batch.timeout); } // Get setup for XMLHttpRequest if possible if (batch.rpcType == DWREngine.XMLHttpRequest) { if (window.XMLHttpRequest) { batch.req = new XMLHttpRequest(); } // IE5 for the mac claims to support window.ActiveXObject, but throws an error when it's used else if (window.ActiveXObject && !(navigator.userAgent.indexOf("Mac") >= 0 && navigator.userAgent.indexOf("MSIE") >= 0)) { batch.req = DWREngine._newActiveXObject(DWREngine._XMLHTTP); } } var prop, request; if (batch.req) { // Proceed using XMLHttpRequest if (batch.async) { batch.req.onreadystatechange = function() { DWREngine._stateChange(batch); }; } // If we're polling, record this for monitoring if (batch.isPoll) DWREngine._pollReq = batch.req; // Workaround for Safari 1.x POST bug var indexSafari = navigator.userAgent.indexOf("Safari/"); if (indexSafari >= 0) { var version = navigator.userAgent.substring(indexSafari + 7); if (parseInt(version, 10) < 400) batch.httpMethod = "GET"; } batch.mode = batch.isPoll ? DWREngine._ModePlainPoll : DWREngine._ModePlainCall; request = DWREngine._constructRequest(batch); try { batch.req.open(batch.httpMethod, request.url, batch.async); try { for (prop in batch.headers) { var value = batch.headers[prop]; if (typeof value == "string") batch.req.setRequestHeader(prop, value); } if (!batch.headers["Content-Type"]) batch.req.setRequestHeader("Content-Type", "text/plain"); } catch (ex) { DWREngine._handleWarning(null, ex); } batch.req.send(request.body); if (!batch.async) DWREngine._stateChange(batch); } catch (ex) { DWREngine._handleError(batch, ex); } } else if (batch.rpcType != DWREngine.ScriptTag) { var idname = "dwr-if-" + batch.map["c0-id"]; // Proceed using iframe batch.div = document.createElement("div"); batch.div.innerHTML = "<iframe src='javascript:void(0)' frameborder='0' width='0' height='0' id='" + idname + "' name='" + idname + "'></iframe>"; document.body.appendChild(batch.div); batch.iframe = document.getElementById(idname); batch.iframe.setAttribute("style", "width:0px; height:0px; border:0px;"); batch.iframe.batch = batch; batch.mode = batch.isPoll ? DWREngine._ModeHtmlPoll : DWREngine._ModeHtmlCall; if (batch.isPoll) { // Settings that vary if we are polling DWREngine._pollFrame = batch.iframe; DWREngine._pollCometSize = 0; } request = DWREngine._constructRequest(batch); if (batch.httpMethod == "GET") { batch.iframe.setAttribute("src", request.url); document.body.appendChild(batch.iframe); } else { batch.form = document.createElement("form"); batch.form.setAttribute("id", "dwr-form"); batch.form.setAttribute("action", request.url); batch.form.setAttribute("target", idname); batch.form.target = idname; batch.form.setAttribute("method", batch.httpMethod); for (prop in batch.map) { var value = batch.map[prop]; if (typeof value != "function") { var formInput = document.createElement("input"); formInput.setAttribute("type", "hidden"); formInput.setAttribute("name", prop); formInput.setAttribute("value", value); batch.form.appendChild(formInput); } } document.body.appendChild(batch.form); batch.form.submit(); } } else { batch.httpMethod = "GET"; // There's no such thing as ScriptTag using POST batch.mode = batch.isPoll ? DWREngine._ModePlainPoll : DWREngine._ModePlainCall; request = DWREngine._constructRequest(batch); batch.script = document.createElement("script"); batch.script.id = "dwr-st-" + batch.map["c0-id"]; batch.script.src = request.url; document.body.appendChild(batch.script); }};
batch.mode = batch.isPoll ? DWREngine._ModePlainPoll : DWREngine._ModePlainCall; request = DWREngine._constructRequest(batch);
batch.mode = batch.isPoll ? dwr.engine._ModePlainPoll : dwr.engine._ModePlainCall; request = dwr.engine._constructRequest(batch);
DWREngine._sendData = function(batch) { batch.map.batchId = DWREngine._nextBatchId++; DWREngine._batches[batch.map.batchId] = batch; DWREngine._batchesLength++; batch.completed = false; DWREngine._debug("Sending batchId=" + batch.map.batchId + " outstanding batches=" + DWREngine._batchesLength + " queued batches=" + DWREngine._batchQueue.length); for (var i = 0; i < batch.preHooks.length; i++) { batch.preHooks[i](); } batch.preHooks = null; // Set a timeout if (batch.timeout && batch.timeout != 0) { batch.interval = setInterval(function() { DWREngine._abortRequest(batch); }, batch.timeout); } // Get setup for XMLHttpRequest if possible if (batch.rpcType == DWREngine.XMLHttpRequest) { if (window.XMLHttpRequest) { batch.req = new XMLHttpRequest(); } // IE5 for the mac claims to support window.ActiveXObject, but throws an error when it's used else if (window.ActiveXObject && !(navigator.userAgent.indexOf("Mac") >= 0 && navigator.userAgent.indexOf("MSIE") >= 0)) { batch.req = DWREngine._newActiveXObject(DWREngine._XMLHTTP); } } var prop, request; if (batch.req) { // Proceed using XMLHttpRequest if (batch.async) { batch.req.onreadystatechange = function() { DWREngine._stateChange(batch); }; } // If we're polling, record this for monitoring if (batch.isPoll) DWREngine._pollReq = batch.req; // Workaround for Safari 1.x POST bug var indexSafari = navigator.userAgent.indexOf("Safari/"); if (indexSafari >= 0) { var version = navigator.userAgent.substring(indexSafari + 7); if (parseInt(version, 10) < 400) batch.httpMethod = "GET"; } batch.mode = batch.isPoll ? DWREngine._ModePlainPoll : DWREngine._ModePlainCall; request = DWREngine._constructRequest(batch); try { batch.req.open(batch.httpMethod, request.url, batch.async); try { for (prop in batch.headers) { var value = batch.headers[prop]; if (typeof value == "string") batch.req.setRequestHeader(prop, value); } if (!batch.headers["Content-Type"]) batch.req.setRequestHeader("Content-Type", "text/plain"); } catch (ex) { DWREngine._handleWarning(null, ex); } batch.req.send(request.body); if (!batch.async) DWREngine._stateChange(batch); } catch (ex) { DWREngine._handleError(batch, ex); } } else if (batch.rpcType != DWREngine.ScriptTag) { var idname = "dwr-if-" + batch.map["c0-id"]; // Proceed using iframe batch.div = document.createElement("div"); batch.div.innerHTML = "<iframe src='javascript:void(0)' frameborder='0' width='0' height='0' id='" + idname + "' name='" + idname + "'></iframe>"; document.body.appendChild(batch.div); batch.iframe = document.getElementById(idname); batch.iframe.setAttribute("style", "width:0px; height:0px; border:0px;"); batch.iframe.batch = batch; batch.mode = batch.isPoll ? DWREngine._ModeHtmlPoll : DWREngine._ModeHtmlCall; if (batch.isPoll) { // Settings that vary if we are polling DWREngine._pollFrame = batch.iframe; DWREngine._pollCometSize = 0; } request = DWREngine._constructRequest(batch); if (batch.httpMethod == "GET") { batch.iframe.setAttribute("src", request.url); document.body.appendChild(batch.iframe); } else { batch.form = document.createElement("form"); batch.form.setAttribute("id", "dwr-form"); batch.form.setAttribute("action", request.url); batch.form.setAttribute("target", idname); batch.form.target = idname; batch.form.setAttribute("method", batch.httpMethod); for (prop in batch.map) { var value = batch.map[prop]; if (typeof value != "function") { var formInput = document.createElement("input"); formInput.setAttribute("type", "hidden"); formInput.setAttribute("name", prop); formInput.setAttribute("value", value); batch.form.appendChild(formInput); } } document.body.appendChild(batch.form); batch.form.submit(); } } else { batch.httpMethod = "GET"; // There's no such thing as ScriptTag using POST batch.mode = batch.isPoll ? DWREngine._ModePlainPoll : DWREngine._ModePlainCall; request = DWREngine._constructRequest(batch); batch.script = document.createElement("script"); batch.script.id = "dwr-st-" + batch.map["c0-id"]; batch.script.src = request.url; document.body.appendChild(batch.script); }};
DWREngine._handleWarning(null, ex);
dwr.engine._handleWarning(null, ex);
DWREngine._sendData = function(batch) { batch.map.batchId = DWREngine._nextBatchId++; DWREngine._batches[batch.map.batchId] = batch; DWREngine._batchesLength++; batch.completed = false; DWREngine._debug("Sending batchId=" + batch.map.batchId + " outstanding batches=" + DWREngine._batchesLength + " queued batches=" + DWREngine._batchQueue.length); for (var i = 0; i < batch.preHooks.length; i++) { batch.preHooks[i](); } batch.preHooks = null; // Set a timeout if (batch.timeout && batch.timeout != 0) { batch.interval = setInterval(function() { DWREngine._abortRequest(batch); }, batch.timeout); } // Get setup for XMLHttpRequest if possible if (batch.rpcType == DWREngine.XMLHttpRequest) { if (window.XMLHttpRequest) { batch.req = new XMLHttpRequest(); } // IE5 for the mac claims to support window.ActiveXObject, but throws an error when it's used else if (window.ActiveXObject && !(navigator.userAgent.indexOf("Mac") >= 0 && navigator.userAgent.indexOf("MSIE") >= 0)) { batch.req = DWREngine._newActiveXObject(DWREngine._XMLHTTP); } } var prop, request; if (batch.req) { // Proceed using XMLHttpRequest if (batch.async) { batch.req.onreadystatechange = function() { DWREngine._stateChange(batch); }; } // If we're polling, record this for monitoring if (batch.isPoll) DWREngine._pollReq = batch.req; // Workaround for Safari 1.x POST bug var indexSafari = navigator.userAgent.indexOf("Safari/"); if (indexSafari >= 0) { var version = navigator.userAgent.substring(indexSafari + 7); if (parseInt(version, 10) < 400) batch.httpMethod = "GET"; } batch.mode = batch.isPoll ? DWREngine._ModePlainPoll : DWREngine._ModePlainCall; request = DWREngine._constructRequest(batch); try { batch.req.open(batch.httpMethod, request.url, batch.async); try { for (prop in batch.headers) { var value = batch.headers[prop]; if (typeof value == "string") batch.req.setRequestHeader(prop, value); } if (!batch.headers["Content-Type"]) batch.req.setRequestHeader("Content-Type", "text/plain"); } catch (ex) { DWREngine._handleWarning(null, ex); } batch.req.send(request.body); if (!batch.async) DWREngine._stateChange(batch); } catch (ex) { DWREngine._handleError(batch, ex); } } else if (batch.rpcType != DWREngine.ScriptTag) { var idname = "dwr-if-" + batch.map["c0-id"]; // Proceed using iframe batch.div = document.createElement("div"); batch.div.innerHTML = "<iframe src='javascript:void(0)' frameborder='0' width='0' height='0' id='" + idname + "' name='" + idname + "'></iframe>"; document.body.appendChild(batch.div); batch.iframe = document.getElementById(idname); batch.iframe.setAttribute("style", "width:0px; height:0px; border:0px;"); batch.iframe.batch = batch; batch.mode = batch.isPoll ? DWREngine._ModeHtmlPoll : DWREngine._ModeHtmlCall; if (batch.isPoll) { // Settings that vary if we are polling DWREngine._pollFrame = batch.iframe; DWREngine._pollCometSize = 0; } request = DWREngine._constructRequest(batch); if (batch.httpMethod == "GET") { batch.iframe.setAttribute("src", request.url); document.body.appendChild(batch.iframe); } else { batch.form = document.createElement("form"); batch.form.setAttribute("id", "dwr-form"); batch.form.setAttribute("action", request.url); batch.form.setAttribute("target", idname); batch.form.target = idname; batch.form.setAttribute("method", batch.httpMethod); for (prop in batch.map) { var value = batch.map[prop]; if (typeof value != "function") { var formInput = document.createElement("input"); formInput.setAttribute("type", "hidden"); formInput.setAttribute("name", prop); formInput.setAttribute("value", value); batch.form.appendChild(formInput); } } document.body.appendChild(batch.form); batch.form.submit(); } } else { batch.httpMethod = "GET"; // There's no such thing as ScriptTag using POST batch.mode = batch.isPoll ? DWREngine._ModePlainPoll : DWREngine._ModePlainCall; request = DWREngine._constructRequest(batch); batch.script = document.createElement("script"); batch.script.id = "dwr-st-" + batch.map["c0-id"]; batch.script.src = request.url; document.body.appendChild(batch.script); }};
if (!batch.async) DWREngine._stateChange(batch);
if (!batch.async) dwr.engine._stateChange(batch);
DWREngine._sendData = function(batch) { batch.map.batchId = DWREngine._nextBatchId++; DWREngine._batches[batch.map.batchId] = batch; DWREngine._batchesLength++; batch.completed = false; DWREngine._debug("Sending batchId=" + batch.map.batchId + " outstanding batches=" + DWREngine._batchesLength + " queued batches=" + DWREngine._batchQueue.length); for (var i = 0; i < batch.preHooks.length; i++) { batch.preHooks[i](); } batch.preHooks = null; // Set a timeout if (batch.timeout && batch.timeout != 0) { batch.interval = setInterval(function() { DWREngine._abortRequest(batch); }, batch.timeout); } // Get setup for XMLHttpRequest if possible if (batch.rpcType == DWREngine.XMLHttpRequest) { if (window.XMLHttpRequest) { batch.req = new XMLHttpRequest(); } // IE5 for the mac claims to support window.ActiveXObject, but throws an error when it's used else if (window.ActiveXObject && !(navigator.userAgent.indexOf("Mac") >= 0 && navigator.userAgent.indexOf("MSIE") >= 0)) { batch.req = DWREngine._newActiveXObject(DWREngine._XMLHTTP); } } var prop, request; if (batch.req) { // Proceed using XMLHttpRequest if (batch.async) { batch.req.onreadystatechange = function() { DWREngine._stateChange(batch); }; } // If we're polling, record this for monitoring if (batch.isPoll) DWREngine._pollReq = batch.req; // Workaround for Safari 1.x POST bug var indexSafari = navigator.userAgent.indexOf("Safari/"); if (indexSafari >= 0) { var version = navigator.userAgent.substring(indexSafari + 7); if (parseInt(version, 10) < 400) batch.httpMethod = "GET"; } batch.mode = batch.isPoll ? DWREngine._ModePlainPoll : DWREngine._ModePlainCall; request = DWREngine._constructRequest(batch); try { batch.req.open(batch.httpMethod, request.url, batch.async); try { for (prop in batch.headers) { var value = batch.headers[prop]; if (typeof value == "string") batch.req.setRequestHeader(prop, value); } if (!batch.headers["Content-Type"]) batch.req.setRequestHeader("Content-Type", "text/plain"); } catch (ex) { DWREngine._handleWarning(null, ex); } batch.req.send(request.body); if (!batch.async) DWREngine._stateChange(batch); } catch (ex) { DWREngine._handleError(batch, ex); } } else if (batch.rpcType != DWREngine.ScriptTag) { var idname = "dwr-if-" + batch.map["c0-id"]; // Proceed using iframe batch.div = document.createElement("div"); batch.div.innerHTML = "<iframe src='javascript:void(0)' frameborder='0' width='0' height='0' id='" + idname + "' name='" + idname + "'></iframe>"; document.body.appendChild(batch.div); batch.iframe = document.getElementById(idname); batch.iframe.setAttribute("style", "width:0px; height:0px; border:0px;"); batch.iframe.batch = batch; batch.mode = batch.isPoll ? DWREngine._ModeHtmlPoll : DWREngine._ModeHtmlCall; if (batch.isPoll) { // Settings that vary if we are polling DWREngine._pollFrame = batch.iframe; DWREngine._pollCometSize = 0; } request = DWREngine._constructRequest(batch); if (batch.httpMethod == "GET") { batch.iframe.setAttribute("src", request.url); document.body.appendChild(batch.iframe); } else { batch.form = document.createElement("form"); batch.form.setAttribute("id", "dwr-form"); batch.form.setAttribute("action", request.url); batch.form.setAttribute("target", idname); batch.form.target = idname; batch.form.setAttribute("method", batch.httpMethod); for (prop in batch.map) { var value = batch.map[prop]; if (typeof value != "function") { var formInput = document.createElement("input"); formInput.setAttribute("type", "hidden"); formInput.setAttribute("name", prop); formInput.setAttribute("value", value); batch.form.appendChild(formInput); } } document.body.appendChild(batch.form); batch.form.submit(); } } else { batch.httpMethod = "GET"; // There's no such thing as ScriptTag using POST batch.mode = batch.isPoll ? DWREngine._ModePlainPoll : DWREngine._ModePlainCall; request = DWREngine._constructRequest(batch); batch.script = document.createElement("script"); batch.script.id = "dwr-st-" + batch.map["c0-id"]; batch.script.src = request.url; document.body.appendChild(batch.script); }};
DWREngine._handleError(batch, ex);
dwr.engine._handleError(batch, ex);
DWREngine._sendData = function(batch) { batch.map.batchId = DWREngine._nextBatchId++; DWREngine._batches[batch.map.batchId] = batch; DWREngine._batchesLength++; batch.completed = false; DWREngine._debug("Sending batchId=" + batch.map.batchId + " outstanding batches=" + DWREngine._batchesLength + " queued batches=" + DWREngine._batchQueue.length); for (var i = 0; i < batch.preHooks.length; i++) { batch.preHooks[i](); } batch.preHooks = null; // Set a timeout if (batch.timeout && batch.timeout != 0) { batch.interval = setInterval(function() { DWREngine._abortRequest(batch); }, batch.timeout); } // Get setup for XMLHttpRequest if possible if (batch.rpcType == DWREngine.XMLHttpRequest) { if (window.XMLHttpRequest) { batch.req = new XMLHttpRequest(); } // IE5 for the mac claims to support window.ActiveXObject, but throws an error when it's used else if (window.ActiveXObject && !(navigator.userAgent.indexOf("Mac") >= 0 && navigator.userAgent.indexOf("MSIE") >= 0)) { batch.req = DWREngine._newActiveXObject(DWREngine._XMLHTTP); } } var prop, request; if (batch.req) { // Proceed using XMLHttpRequest if (batch.async) { batch.req.onreadystatechange = function() { DWREngine._stateChange(batch); }; } // If we're polling, record this for monitoring if (batch.isPoll) DWREngine._pollReq = batch.req; // Workaround for Safari 1.x POST bug var indexSafari = navigator.userAgent.indexOf("Safari/"); if (indexSafari >= 0) { var version = navigator.userAgent.substring(indexSafari + 7); if (parseInt(version, 10) < 400) batch.httpMethod = "GET"; } batch.mode = batch.isPoll ? DWREngine._ModePlainPoll : DWREngine._ModePlainCall; request = DWREngine._constructRequest(batch); try { batch.req.open(batch.httpMethod, request.url, batch.async); try { for (prop in batch.headers) { var value = batch.headers[prop]; if (typeof value == "string") batch.req.setRequestHeader(prop, value); } if (!batch.headers["Content-Type"]) batch.req.setRequestHeader("Content-Type", "text/plain"); } catch (ex) { DWREngine._handleWarning(null, ex); } batch.req.send(request.body); if (!batch.async) DWREngine._stateChange(batch); } catch (ex) { DWREngine._handleError(batch, ex); } } else if (batch.rpcType != DWREngine.ScriptTag) { var idname = "dwr-if-" + batch.map["c0-id"]; // Proceed using iframe batch.div = document.createElement("div"); batch.div.innerHTML = "<iframe src='javascript:void(0)' frameborder='0' width='0' height='0' id='" + idname + "' name='" + idname + "'></iframe>"; document.body.appendChild(batch.div); batch.iframe = document.getElementById(idname); batch.iframe.setAttribute("style", "width:0px; height:0px; border:0px;"); batch.iframe.batch = batch; batch.mode = batch.isPoll ? DWREngine._ModeHtmlPoll : DWREngine._ModeHtmlCall; if (batch.isPoll) { // Settings that vary if we are polling DWREngine._pollFrame = batch.iframe; DWREngine._pollCometSize = 0; } request = DWREngine._constructRequest(batch); if (batch.httpMethod == "GET") { batch.iframe.setAttribute("src", request.url); document.body.appendChild(batch.iframe); } else { batch.form = document.createElement("form"); batch.form.setAttribute("id", "dwr-form"); batch.form.setAttribute("action", request.url); batch.form.setAttribute("target", idname); batch.form.target = idname; batch.form.setAttribute("method", batch.httpMethod); for (prop in batch.map) { var value = batch.map[prop]; if (typeof value != "function") { var formInput = document.createElement("input"); formInput.setAttribute("type", "hidden"); formInput.setAttribute("name", prop); formInput.setAttribute("value", value); batch.form.appendChild(formInput); } } document.body.appendChild(batch.form); batch.form.submit(); } } else { batch.httpMethod = "GET"; // There's no such thing as ScriptTag using POST batch.mode = batch.isPoll ? DWREngine._ModePlainPoll : DWREngine._ModePlainCall; request = DWREngine._constructRequest(batch); batch.script = document.createElement("script"); batch.script.id = "dwr-st-" + batch.map["c0-id"]; batch.script.src = request.url; document.body.appendChild(batch.script); }};
else if (batch.rpcType != DWREngine.ScriptTag) {
else if (batch.rpcType != dwr.engine.ScriptTag) {
DWREngine._sendData = function(batch) { batch.map.batchId = DWREngine._nextBatchId++; DWREngine._batches[batch.map.batchId] = batch; DWREngine._batchesLength++; batch.completed = false; DWREngine._debug("Sending batchId=" + batch.map.batchId + " outstanding batches=" + DWREngine._batchesLength + " queued batches=" + DWREngine._batchQueue.length); for (var i = 0; i < batch.preHooks.length; i++) { batch.preHooks[i](); } batch.preHooks = null; // Set a timeout if (batch.timeout && batch.timeout != 0) { batch.interval = setInterval(function() { DWREngine._abortRequest(batch); }, batch.timeout); } // Get setup for XMLHttpRequest if possible if (batch.rpcType == DWREngine.XMLHttpRequest) { if (window.XMLHttpRequest) { batch.req = new XMLHttpRequest(); } // IE5 for the mac claims to support window.ActiveXObject, but throws an error when it's used else if (window.ActiveXObject && !(navigator.userAgent.indexOf("Mac") >= 0 && navigator.userAgent.indexOf("MSIE") >= 0)) { batch.req = DWREngine._newActiveXObject(DWREngine._XMLHTTP); } } var prop, request; if (batch.req) { // Proceed using XMLHttpRequest if (batch.async) { batch.req.onreadystatechange = function() { DWREngine._stateChange(batch); }; } // If we're polling, record this for monitoring if (batch.isPoll) DWREngine._pollReq = batch.req; // Workaround for Safari 1.x POST bug var indexSafari = navigator.userAgent.indexOf("Safari/"); if (indexSafari >= 0) { var version = navigator.userAgent.substring(indexSafari + 7); if (parseInt(version, 10) < 400) batch.httpMethod = "GET"; } batch.mode = batch.isPoll ? DWREngine._ModePlainPoll : DWREngine._ModePlainCall; request = DWREngine._constructRequest(batch); try { batch.req.open(batch.httpMethod, request.url, batch.async); try { for (prop in batch.headers) { var value = batch.headers[prop]; if (typeof value == "string") batch.req.setRequestHeader(prop, value); } if (!batch.headers["Content-Type"]) batch.req.setRequestHeader("Content-Type", "text/plain"); } catch (ex) { DWREngine._handleWarning(null, ex); } batch.req.send(request.body); if (!batch.async) DWREngine._stateChange(batch); } catch (ex) { DWREngine._handleError(batch, ex); } } else if (batch.rpcType != DWREngine.ScriptTag) { var idname = "dwr-if-" + batch.map["c0-id"]; // Proceed using iframe batch.div = document.createElement("div"); batch.div.innerHTML = "<iframe src='javascript:void(0)' frameborder='0' width='0' height='0' id='" + idname + "' name='" + idname + "'></iframe>"; document.body.appendChild(batch.div); batch.iframe = document.getElementById(idname); batch.iframe.setAttribute("style", "width:0px; height:0px; border:0px;"); batch.iframe.batch = batch; batch.mode = batch.isPoll ? DWREngine._ModeHtmlPoll : DWREngine._ModeHtmlCall; if (batch.isPoll) { // Settings that vary if we are polling DWREngine._pollFrame = batch.iframe; DWREngine._pollCometSize = 0; } request = DWREngine._constructRequest(batch); if (batch.httpMethod == "GET") { batch.iframe.setAttribute("src", request.url); document.body.appendChild(batch.iframe); } else { batch.form = document.createElement("form"); batch.form.setAttribute("id", "dwr-form"); batch.form.setAttribute("action", request.url); batch.form.setAttribute("target", idname); batch.form.target = idname; batch.form.setAttribute("method", batch.httpMethod); for (prop in batch.map) { var value = batch.map[prop]; if (typeof value != "function") { var formInput = document.createElement("input"); formInput.setAttribute("type", "hidden"); formInput.setAttribute("name", prop); formInput.setAttribute("value", value); batch.form.appendChild(formInput); } } document.body.appendChild(batch.form); batch.form.submit(); } } else { batch.httpMethod = "GET"; // There's no such thing as ScriptTag using POST batch.mode = batch.isPoll ? DWREngine._ModePlainPoll : DWREngine._ModePlainCall; request = DWREngine._constructRequest(batch); batch.script = document.createElement("script"); batch.script.id = "dwr-st-" + batch.map["c0-id"]; batch.script.src = request.url; document.body.appendChild(batch.script); }};
batch.mode = batch.isPoll ? DWREngine._ModeHtmlPoll : DWREngine._ModeHtmlCall;
batch.mode = batch.isPoll ? dwr.engine._ModeHtmlPoll : dwr.engine._ModeHtmlCall;
DWREngine._sendData = function(batch) { batch.map.batchId = DWREngine._nextBatchId++; DWREngine._batches[batch.map.batchId] = batch; DWREngine._batchesLength++; batch.completed = false; DWREngine._debug("Sending batchId=" + batch.map.batchId + " outstanding batches=" + DWREngine._batchesLength + " queued batches=" + DWREngine._batchQueue.length); for (var i = 0; i < batch.preHooks.length; i++) { batch.preHooks[i](); } batch.preHooks = null; // Set a timeout if (batch.timeout && batch.timeout != 0) { batch.interval = setInterval(function() { DWREngine._abortRequest(batch); }, batch.timeout); } // Get setup for XMLHttpRequest if possible if (batch.rpcType == DWREngine.XMLHttpRequest) { if (window.XMLHttpRequest) { batch.req = new XMLHttpRequest(); } // IE5 for the mac claims to support window.ActiveXObject, but throws an error when it's used else if (window.ActiveXObject && !(navigator.userAgent.indexOf("Mac") >= 0 && navigator.userAgent.indexOf("MSIE") >= 0)) { batch.req = DWREngine._newActiveXObject(DWREngine._XMLHTTP); } } var prop, request; if (batch.req) { // Proceed using XMLHttpRequest if (batch.async) { batch.req.onreadystatechange = function() { DWREngine._stateChange(batch); }; } // If we're polling, record this for monitoring if (batch.isPoll) DWREngine._pollReq = batch.req; // Workaround for Safari 1.x POST bug var indexSafari = navigator.userAgent.indexOf("Safari/"); if (indexSafari >= 0) { var version = navigator.userAgent.substring(indexSafari + 7); if (parseInt(version, 10) < 400) batch.httpMethod = "GET"; } batch.mode = batch.isPoll ? DWREngine._ModePlainPoll : DWREngine._ModePlainCall; request = DWREngine._constructRequest(batch); try { batch.req.open(batch.httpMethod, request.url, batch.async); try { for (prop in batch.headers) { var value = batch.headers[prop]; if (typeof value == "string") batch.req.setRequestHeader(prop, value); } if (!batch.headers["Content-Type"]) batch.req.setRequestHeader("Content-Type", "text/plain"); } catch (ex) { DWREngine._handleWarning(null, ex); } batch.req.send(request.body); if (!batch.async) DWREngine._stateChange(batch); } catch (ex) { DWREngine._handleError(batch, ex); } } else if (batch.rpcType != DWREngine.ScriptTag) { var idname = "dwr-if-" + batch.map["c0-id"]; // Proceed using iframe batch.div = document.createElement("div"); batch.div.innerHTML = "<iframe src='javascript:void(0)' frameborder='0' width='0' height='0' id='" + idname + "' name='" + idname + "'></iframe>"; document.body.appendChild(batch.div); batch.iframe = document.getElementById(idname); batch.iframe.setAttribute("style", "width:0px; height:0px; border:0px;"); batch.iframe.batch = batch; batch.mode = batch.isPoll ? DWREngine._ModeHtmlPoll : DWREngine._ModeHtmlCall; if (batch.isPoll) { // Settings that vary if we are polling DWREngine._pollFrame = batch.iframe; DWREngine._pollCometSize = 0; } request = DWREngine._constructRequest(batch); if (batch.httpMethod == "GET") { batch.iframe.setAttribute("src", request.url); document.body.appendChild(batch.iframe); } else { batch.form = document.createElement("form"); batch.form.setAttribute("id", "dwr-form"); batch.form.setAttribute("action", request.url); batch.form.setAttribute("target", idname); batch.form.target = idname; batch.form.setAttribute("method", batch.httpMethod); for (prop in batch.map) { var value = batch.map[prop]; if (typeof value != "function") { var formInput = document.createElement("input"); formInput.setAttribute("type", "hidden"); formInput.setAttribute("name", prop); formInput.setAttribute("value", value); batch.form.appendChild(formInput); } } document.body.appendChild(batch.form); batch.form.submit(); } } else { batch.httpMethod = "GET"; // There's no such thing as ScriptTag using POST batch.mode = batch.isPoll ? DWREngine._ModePlainPoll : DWREngine._ModePlainCall; request = DWREngine._constructRequest(batch); batch.script = document.createElement("script"); batch.script.id = "dwr-st-" + batch.map["c0-id"]; batch.script.src = request.url; document.body.appendChild(batch.script); }};
DWREngine._pollFrame = batch.iframe; DWREngine._pollCometSize = 0;
dwr.engine._pollFrame = batch.iframe; dwr.engine._pollCometSize = 0;
DWREngine._sendData = function(batch) { batch.map.batchId = DWREngine._nextBatchId++; DWREngine._batches[batch.map.batchId] = batch; DWREngine._batchesLength++; batch.completed = false; DWREngine._debug("Sending batchId=" + batch.map.batchId + " outstanding batches=" + DWREngine._batchesLength + " queued batches=" + DWREngine._batchQueue.length); for (var i = 0; i < batch.preHooks.length; i++) { batch.preHooks[i](); } batch.preHooks = null; // Set a timeout if (batch.timeout && batch.timeout != 0) { batch.interval = setInterval(function() { DWREngine._abortRequest(batch); }, batch.timeout); } // Get setup for XMLHttpRequest if possible if (batch.rpcType == DWREngine.XMLHttpRequest) { if (window.XMLHttpRequest) { batch.req = new XMLHttpRequest(); } // IE5 for the mac claims to support window.ActiveXObject, but throws an error when it's used else if (window.ActiveXObject && !(navigator.userAgent.indexOf("Mac") >= 0 && navigator.userAgent.indexOf("MSIE") >= 0)) { batch.req = DWREngine._newActiveXObject(DWREngine._XMLHTTP); } } var prop, request; if (batch.req) { // Proceed using XMLHttpRequest if (batch.async) { batch.req.onreadystatechange = function() { DWREngine._stateChange(batch); }; } // If we're polling, record this for monitoring if (batch.isPoll) DWREngine._pollReq = batch.req; // Workaround for Safari 1.x POST bug var indexSafari = navigator.userAgent.indexOf("Safari/"); if (indexSafari >= 0) { var version = navigator.userAgent.substring(indexSafari + 7); if (parseInt(version, 10) < 400) batch.httpMethod = "GET"; } batch.mode = batch.isPoll ? DWREngine._ModePlainPoll : DWREngine._ModePlainCall; request = DWREngine._constructRequest(batch); try { batch.req.open(batch.httpMethod, request.url, batch.async); try { for (prop in batch.headers) { var value = batch.headers[prop]; if (typeof value == "string") batch.req.setRequestHeader(prop, value); } if (!batch.headers["Content-Type"]) batch.req.setRequestHeader("Content-Type", "text/plain"); } catch (ex) { DWREngine._handleWarning(null, ex); } batch.req.send(request.body); if (!batch.async) DWREngine._stateChange(batch); } catch (ex) { DWREngine._handleError(batch, ex); } } else if (batch.rpcType != DWREngine.ScriptTag) { var idname = "dwr-if-" + batch.map["c0-id"]; // Proceed using iframe batch.div = document.createElement("div"); batch.div.innerHTML = "<iframe src='javascript:void(0)' frameborder='0' width='0' height='0' id='" + idname + "' name='" + idname + "'></iframe>"; document.body.appendChild(batch.div); batch.iframe = document.getElementById(idname); batch.iframe.setAttribute("style", "width:0px; height:0px; border:0px;"); batch.iframe.batch = batch; batch.mode = batch.isPoll ? DWREngine._ModeHtmlPoll : DWREngine._ModeHtmlCall; if (batch.isPoll) { // Settings that vary if we are polling DWREngine._pollFrame = batch.iframe; DWREngine._pollCometSize = 0; } request = DWREngine._constructRequest(batch); if (batch.httpMethod == "GET") { batch.iframe.setAttribute("src", request.url); document.body.appendChild(batch.iframe); } else { batch.form = document.createElement("form"); batch.form.setAttribute("id", "dwr-form"); batch.form.setAttribute("action", request.url); batch.form.setAttribute("target", idname); batch.form.target = idname; batch.form.setAttribute("method", batch.httpMethod); for (prop in batch.map) { var value = batch.map[prop]; if (typeof value != "function") { var formInput = document.createElement("input"); formInput.setAttribute("type", "hidden"); formInput.setAttribute("name", prop); formInput.setAttribute("value", value); batch.form.appendChild(formInput); } } document.body.appendChild(batch.form); batch.form.submit(); } } else { batch.httpMethod = "GET"; // There's no such thing as ScriptTag using POST batch.mode = batch.isPoll ? DWREngine._ModePlainPoll : DWREngine._ModePlainCall; request = DWREngine._constructRequest(batch); batch.script = document.createElement("script"); batch.script.id = "dwr-st-" + batch.map["c0-id"]; batch.script.src = request.url; document.body.appendChild(batch.script); }};
request = DWREngine._constructRequest(batch);
request = dwr.engine._constructRequest(batch);
DWREngine._sendData = function(batch) { batch.map.batchId = DWREngine._nextBatchId++; DWREngine._batches[batch.map.batchId] = batch; DWREngine._batchesLength++; batch.completed = false; DWREngine._debug("Sending batchId=" + batch.map.batchId + " outstanding batches=" + DWREngine._batchesLength + " queued batches=" + DWREngine._batchQueue.length); for (var i = 0; i < batch.preHooks.length; i++) { batch.preHooks[i](); } batch.preHooks = null; // Set a timeout if (batch.timeout && batch.timeout != 0) { batch.interval = setInterval(function() { DWREngine._abortRequest(batch); }, batch.timeout); } // Get setup for XMLHttpRequest if possible if (batch.rpcType == DWREngine.XMLHttpRequest) { if (window.XMLHttpRequest) { batch.req = new XMLHttpRequest(); } // IE5 for the mac claims to support window.ActiveXObject, but throws an error when it's used else if (window.ActiveXObject && !(navigator.userAgent.indexOf("Mac") >= 0 && navigator.userAgent.indexOf("MSIE") >= 0)) { batch.req = DWREngine._newActiveXObject(DWREngine._XMLHTTP); } } var prop, request; if (batch.req) { // Proceed using XMLHttpRequest if (batch.async) { batch.req.onreadystatechange = function() { DWREngine._stateChange(batch); }; } // If we're polling, record this for monitoring if (batch.isPoll) DWREngine._pollReq = batch.req; // Workaround for Safari 1.x POST bug var indexSafari = navigator.userAgent.indexOf("Safari/"); if (indexSafari >= 0) { var version = navigator.userAgent.substring(indexSafari + 7); if (parseInt(version, 10) < 400) batch.httpMethod = "GET"; } batch.mode = batch.isPoll ? DWREngine._ModePlainPoll : DWREngine._ModePlainCall; request = DWREngine._constructRequest(batch); try { batch.req.open(batch.httpMethod, request.url, batch.async); try { for (prop in batch.headers) { var value = batch.headers[prop]; if (typeof value == "string") batch.req.setRequestHeader(prop, value); } if (!batch.headers["Content-Type"]) batch.req.setRequestHeader("Content-Type", "text/plain"); } catch (ex) { DWREngine._handleWarning(null, ex); } batch.req.send(request.body); if (!batch.async) DWREngine._stateChange(batch); } catch (ex) { DWREngine._handleError(batch, ex); } } else if (batch.rpcType != DWREngine.ScriptTag) { var idname = "dwr-if-" + batch.map["c0-id"]; // Proceed using iframe batch.div = document.createElement("div"); batch.div.innerHTML = "<iframe src='javascript:void(0)' frameborder='0' width='0' height='0' id='" + idname + "' name='" + idname + "'></iframe>"; document.body.appendChild(batch.div); batch.iframe = document.getElementById(idname); batch.iframe.setAttribute("style", "width:0px; height:0px; border:0px;"); batch.iframe.batch = batch; batch.mode = batch.isPoll ? DWREngine._ModeHtmlPoll : DWREngine._ModeHtmlCall; if (batch.isPoll) { // Settings that vary if we are polling DWREngine._pollFrame = batch.iframe; DWREngine._pollCometSize = 0; } request = DWREngine._constructRequest(batch); if (batch.httpMethod == "GET") { batch.iframe.setAttribute("src", request.url); document.body.appendChild(batch.iframe); } else { batch.form = document.createElement("form"); batch.form.setAttribute("id", "dwr-form"); batch.form.setAttribute("action", request.url); batch.form.setAttribute("target", idname); batch.form.target = idname; batch.form.setAttribute("method", batch.httpMethod); for (prop in batch.map) { var value = batch.map[prop]; if (typeof value != "function") { var formInput = document.createElement("input"); formInput.setAttribute("type", "hidden"); formInput.setAttribute("name", prop); formInput.setAttribute("value", value); batch.form.appendChild(formInput); } } document.body.appendChild(batch.form); batch.form.submit(); } } else { batch.httpMethod = "GET"; // There's no such thing as ScriptTag using POST batch.mode = batch.isPoll ? DWREngine._ModePlainPoll : DWREngine._ModePlainCall; request = DWREngine._constructRequest(batch); batch.script = document.createElement("script"); batch.script.id = "dwr-st-" + batch.map["c0-id"]; batch.script.src = request.url; document.body.appendChild(batch.script); }};
if (batch.map.callCount == 0) return;
DWREngine._sendData = function(batch) { if (batch.map.callCount == 0) return; // Call any pre-hooks for (var i = 0; i < batch.preHooks.length; i++) { batch.preHooks[i](); } batch.preHooks = null; // Set a timeout if (batch.timeout && batch.timeout != 0) { batch.interval = setInterval(function() { DWREngine._abortRequest(batch); }, batch.timeout); } // Get setup for XMLHttpRequest if possible if (batch.method == DWREngine.XMLHttpRequest) { if (window.XMLHttpRequest) { batch.req = new XMLHttpRequest(); } // IE5 for the mac claims to support window.ActiveXObject, but throws an error when it's used else if (window.ActiveXObject && !(navigator.userAgent.indexOf("Mac") >= 0 && navigator.userAgent.indexOf("MSIE") >= 0)) { batch.req = DWREngine._newActiveXObject(DWREngine._XMLHTTP); } } var prop, request; if (batch.req) { // Proceed using XMLHttpRequest if (batch.async) { batch.req.onreadystatechange = function() { DWREngine._stateChange(batch); }; } // If we're polling, record this for monitoring if (batch.isPoll) DWREngine._pollReq = batch.req; // Workaround for Safari 1.x POST bug var indexSafari = navigator.userAgent.indexOf("Safari/"); if (indexSafari >= 0) { var version = navigator.userAgent.substring(indexSafari + 7); if (parseInt(version, 10) < 400) batch.verb == "GET"; } batch.mode = batch.isPoll ? DWREngine._ModePlainPoll : DWREngine._ModePlainCall; request = DWREngine._constructRequest(batch); try { batch.req.open(batch.verb, request.url, batch.async); try { for (prop in batch.headers) { batch.req.setRequestHeader(prop, batch.headers[prop]); } if (!batch.headers["Content-Type"]) batch.req.setRequestHeader("Content-Type", "text/plain"); } catch (ex) { DWREngine._handleMetaDataWarning(null, ex); } batch.req.send(request.body); if (!batch.async) DWREngine._stateChange(batch); } catch (ex) { DWREngine._handleMetaDataError(null, ex); } } else if (batch.method != DWREngine.ScriptTag) { var idname = "dwr-if-" + batch.map["c0-id"]; // Proceed using iframe batch.div = document.createElement("div"); batch.div.innerHTML = "<iframe src='javascript:void(0)' frameborder='0' width='0' height='0' id='" + idname + "' name='" + idname + "'></iframe>"; document.body.appendChild(batch.div); batch.iframe = document.getElementById(idname); batch.iframe.setAttribute("style", "width:0px; height:0px; border:0px;"); batch.mode = batch.isPoll ? DWREngine._ModeHtmlPoll : DWREngine._ModeHtmlCall; if (batch.isPoll) { // Settings that vary if we are polling DWREngine._pollFrame = batch.iframe; DWREngine._pollCometSize = 0; } request = DWREngine._constructRequest(batch); if (batch.verb == "GET") { batch.iframe.setAttribute("src", request.url); document.body.appendChild(batch.iframe); } else { batch.form = document.createElement("form"); batch.form.setAttribute("id", "dwr-form"); batch.form.setAttribute("action", request.url); batch.form.setAttribute("target", idname); batch.form.target = idname; batch.form.setAttribute("method", batch.verb); for (prop in batch.map) { var formInput = document.createElement("input"); formInput.setAttribute("type", "hidden"); formInput.setAttribute("name", prop); formInput.setAttribute("value", batch.map[prop]); batch.form.appendChild(formInput); } document.body.appendChild(batch.form); batch.form.submit(); } } else { batch.verb = "GET"; // There's no such thing as ScriptTag using POST batch.mode = batch.isPoll ? DWREngine._ModePlainPoll : DWREngine._ModePlainCall; request = DWREngine._constructRequest(batch); batch.script = document.createElement("script"); batch.script.id = "dwr-st-" + batch.map["c0-id"]; batch.script.src = request.url; document.body.appendChild(batch.script); }};
if (data == null) { batch.map[name] = "null:null"; return;
if (data == null) { batch.map[name] = "null:null"; return; } switch (typeof data) { case "boolean": batch.map[name] = "boolean:" + data; break; case "number": batch.map[name] = "number:" + data; break; case "string": batch.map[name] = "string:" + encodeURIComponent(data); break; case "object": if (data.dwrSerialize) { batch.map[name] = data.dwrSerialize(batch, referto, data, name);
DWREngine._serializeAll = function(batch, referto, data, name) { if (data == null) { batch.map[name] = "null:null"; return; } switch (typeof data) { case "boolean": batch.map[name] = "boolean:" + data; break; case "number": batch.map[name] = "number:" + data; break; case "string": batch.map[name] = "string:" + encodeURIComponent(data); break; case "object": if (data.dwrSerialize) { batch.map[name] = data.dwrSerialize(batch, referto, data, name); } else if (data.nodeName) { batch.map[name] = DWREngine._serializeXml(batch, referto, data, name); } else { if (DWREngine._warningHandler) { DWREngine._warningHandler("Object without dwrSerialize: " + typeof data + ", attempting default converter."); } batch.map[name] = "default:" + data; } break; case "function": // We just ignore functions. break; default: if (DWREngine._warningHandler) { DWREngine._warningHandler("Unexpected type: " + typeof data + ", attempting default converter."); } batch.map[name] = "default:" + data; break; }};
switch (typeof data) { case "boolean": batch.map[name] = "boolean:" + data; break;
case "function": break;
DWREngine._serializeAll = function(batch, referto, data, name) { if (data == null) { batch.map[name] = "null:null"; return; } switch (typeof data) { case "boolean": batch.map[name] = "boolean:" + data; break; case "number": batch.map[name] = "number:" + data; break; case "string": batch.map[name] = "string:" + encodeURIComponent(data); break; case "object": if (data.dwrSerialize) { batch.map[name] = data.dwrSerialize(batch, referto, data, name); } else if (data.nodeName) { batch.map[name] = DWREngine._serializeXml(batch, referto, data, name); } else { if (DWREngine._warningHandler) { DWREngine._warningHandler("Object without dwrSerialize: " + typeof data + ", attempting default converter."); } batch.map[name] = "default:" + data; } break; case "function": // We just ignore functions. break; default: if (DWREngine._warningHandler) { DWREngine._warningHandler("Unexpected type: " + typeof data + ", attempting default converter."); } batch.map[name] = "default:" + data; break; }};
case "number": batch.map[name] = "number:" + data; break; case "string": batch.map[name] = "string:" + encodeURIComponent(data); break; case "object": if (data.dwrSerialize) { batch.map[name] = data.dwrSerialize(batch, referto, data, name); } else if (data.nodeName) { batch.map[name] = DWREngine._serializeXml(batch, referto, data, name); } else { if (DWREngine._warningHandler) { DWREngine._warningHandler("Object without dwrSerialize: " + typeof data + ", attempting default converter."); } batch.map[name] = "default:" + data; } break; case "function": break; default: if (DWREngine._warningHandler) { DWREngine._warningHandler("Unexpected type: " + typeof data + ", attempting default converter."); } batch.map[name] = "default:" + data; break;
default: if (DWREngine._warningHandler) { DWREngine._warningHandler("Unexpected type: " + typeof data + ", attempting default converter.");
DWREngine._serializeAll = function(batch, referto, data, name) { if (data == null) { batch.map[name] = "null:null"; return; } switch (typeof data) { case "boolean": batch.map[name] = "boolean:" + data; break; case "number": batch.map[name] = "number:" + data; break; case "string": batch.map[name] = "string:" + encodeURIComponent(data); break; case "object": if (data.dwrSerialize) { batch.map[name] = data.dwrSerialize(batch, referto, data, name); } else if (data.nodeName) { batch.map[name] = DWREngine._serializeXml(batch, referto, data, name); } else { if (DWREngine._warningHandler) { DWREngine._warningHandler("Object without dwrSerialize: " + typeof data + ", attempting default converter."); } batch.map[name] = "default:" + data; } break; case "function": // We just ignore functions. break; default: if (DWREngine._warningHandler) { DWREngine._warningHandler("Unexpected type: " + typeof data + ", attempting default converter."); } batch.map[name] = "default:" + data; break; }};
batch.map[name] = "default:" + data; break; }
DWREngine._serializeAll = function(batch, referto, data, name) { if (data == null) { batch.map[name] = "null:null"; return; } switch (typeof data) { case "boolean": batch.map[name] = "boolean:" + data; break; case "number": batch.map[name] = "number:" + data; break; case "string": batch.map[name] = "string:" + encodeURIComponent(data); break; case "object": if (data.dwrSerialize) { batch.map[name] = data.dwrSerialize(batch, referto, data, name); } else if (data.nodeName) { batch.map[name] = DWREngine._serializeXml(batch, referto, data, name); } else { if (DWREngine._warningHandler) { DWREngine._warningHandler("Object without dwrSerialize: " + typeof data + ", attempting default converter."); } batch.map[name] = "default:" + data; } break; case "function": // We just ignore functions. break; default: if (DWREngine._warningHandler) { DWREngine._warningHandler("Unexpected type: " + typeof data + ", attempting default converter."); } batch.map[name] = "default:" + data; break; }};
DWREngine._serializeAll = function(batch, referto, data, name) {
dwr.engine._serializeAll = function(batch, referto, data, name) {
DWREngine._serializeAll = function(batch, referto, data, name) { if (data == null) { batch.map[name] = "null:null"; return; } switch (typeof data) { case "boolean": batch.map[name] = "boolean:" + data; break; case "number": batch.map[name] = "number:" + data; break; case "string": batch.map[name] = "string:" + encodeURIComponent(data); break; case "object": if (data instanceof String) batch.map[name] = "String:" + encodeURIComponent(data); else if (data instanceof Boolean) batch.map[name] = "Boolean:" + data; else if (data instanceof Number) batch.map[name] = "Number:" + data; else if (data instanceof Date) batch.map[name] = "Date:" + data.getTime(); else if (data instanceof Array) batch.map[name] = DWREngine._serializeArray(batch, referto, data, name); else batch.map[name] = DWREngine._serializeObject(batch, referto, data, name); break; case "function": // We just ignore functions. break; default: DWREngine._handleWarning(null, { name:"dwrengine.unexpectedType", message:"Unexpected type: " + typeof data + ", attempting default converter." }); batch.map[name] = "default:" + data; break; }};
else if (data instanceof Array) batch.map[name] = DWREngine._serializeArray(batch, referto, data, name); else batch.map[name] = DWREngine._serializeObject(batch, referto, data, name);
else if (data instanceof Array) batch.map[name] = dwr.engine._serializeArray(batch, referto, data, name); else batch.map[name] = dwr.engine._serializeObject(batch, referto, data, name);
DWREngine._serializeAll = function(batch, referto, data, name) { if (data == null) { batch.map[name] = "null:null"; return; } switch (typeof data) { case "boolean": batch.map[name] = "boolean:" + data; break; case "number": batch.map[name] = "number:" + data; break; case "string": batch.map[name] = "string:" + encodeURIComponent(data); break; case "object": if (data instanceof String) batch.map[name] = "String:" + encodeURIComponent(data); else if (data instanceof Boolean) batch.map[name] = "Boolean:" + data; else if (data instanceof Number) batch.map[name] = "Number:" + data; else if (data instanceof Date) batch.map[name] = "Date:" + data.getTime(); else if (data instanceof Array) batch.map[name] = DWREngine._serializeArray(batch, referto, data, name); else batch.map[name] = DWREngine._serializeObject(batch, referto, data, name); break; case "function": // We just ignore functions. break; default: DWREngine._handleWarning(null, { name:"dwrengine.unexpectedType", message:"Unexpected type: " + typeof data + ", attempting default converter." }); batch.map[name] = "default:" + data; break; }};
DWREngine._handleWarning(null, { name:"dwrengine.unexpectedType", message:"Unexpected type: " + typeof data + ", attempting default converter." });
dwr.engine._handleWarning(null, { name:"dwr.engine.unexpectedType", message:"Unexpected type: " + typeof data + ", attempting default converter." });
DWREngine._serializeAll = function(batch, referto, data, name) { if (data == null) { batch.map[name] = "null:null"; return; } switch (typeof data) { case "boolean": batch.map[name] = "boolean:" + data; break; case "number": batch.map[name] = "number:" + data; break; case "string": batch.map[name] = "string:" + encodeURIComponent(data); break; case "object": if (data instanceof String) batch.map[name] = "String:" + encodeURIComponent(data); else if (data instanceof Boolean) batch.map[name] = "Boolean:" + data; else if (data instanceof Number) batch.map[name] = "Number:" + data; else if (data instanceof Date) batch.map[name] = "Date:" + data.getTime(); else if (data instanceof Array) batch.map[name] = DWREngine._serializeArray(batch, referto, data, name); else batch.map[name] = DWREngine._serializeObject(batch, referto, data, name); break; case "function": // We just ignore functions. break; default: DWREngine._handleWarning(null, { name:"dwrengine.unexpectedType", message:"Unexpected type: " + typeof data + ", attempting default converter." }); batch.map[name] = "default:" + data; break; }};
DWREngine._serializeArray = function(batch, referto, data, name) { var ref = DWREngine._lookup(referto, data, name);
dwr.engine._serializeArray = function(batch, referto, data, name) { var ref = dwr.engine._lookup(referto, data, name);
DWREngine._serializeArray = function(batch, referto, data, name) { var ref = DWREngine._lookup(referto, data, name); if (ref) return ref; var reply = "Array:["; for (var i = 0; i < data.length; i++) { if (i != 0) reply += ","; batch.paramCount++; var childName = "c" + DWREngine._batch.map.callCount + "-e" + batch.paramCount; DWREngine._serializeAll(batch, referto, data[i], childName); reply += "reference:"; reply += childName; } reply += "]"; return reply;};
var childName = "c" + DWREngine._batch.map.callCount + "-e" + batch.paramCount; DWREngine._serializeAll(batch, referto, data[i], childName);
var childName = "c" + dwr.engine._batch.map.callCount + "-e" + batch.paramCount; dwr.engine._serializeAll(batch, referto, data[i], childName);
DWREngine._serializeArray = function(batch, referto, data, name) { var ref = DWREngine._lookup(referto, data, name); if (ref) return ref; var reply = "Array:["; for (var i = 0; i < data.length; i++) { if (i != 0) reply += ","; batch.paramCount++; var childName = "c" + DWREngine._batch.map.callCount + "-e" + batch.paramCount; DWREngine._serializeAll(batch, referto, data[i], childName); reply += "reference:"; reply += childName; } reply += "]"; return reply;};
var ref = DWREngine._lookup(referto, this, name);
var ref = DWREngine._lookup(referto, data, name);
DWREngine._serializeArray = function(batch, referto, data, name) { var ref = DWREngine._lookup(referto, this, name); if (ref) return ref; var reply = "Array:["; for (var i = 0; i < this.length; i++) { if (i != 0) { reply += ","; } batch.paramCount++; var childName = "c" + DWREngine._batch.map.callCount + "-e" + batch.paramCount; DWREngine._serializeAll(batch, referto, this[i], childName); reply += "reference:"; reply += childName; } reply += "]"; return reply;};
for (var i = 0; i < this.length; i++) {
for (var i = 0; i < data.length; i++) {
DWREngine._serializeArray = function(batch, referto, data, name) { var ref = DWREngine._lookup(referto, this, name); if (ref) return ref; var reply = "Array:["; for (var i = 0; i < this.length; i++) { if (i != 0) { reply += ","; } batch.paramCount++; var childName = "c" + DWREngine._batch.map.callCount + "-e" + batch.paramCount; DWREngine._serializeAll(batch, referto, this[i], childName); reply += "reference:"; reply += childName; } reply += "]"; return reply;};
DWREngine._serializeAll(batch, referto, this[i], childName);
DWREngine._serializeAll(batch, referto, data[i], childName);
DWREngine._serializeArray = function(batch, referto, data, name) { var ref = DWREngine._lookup(referto, this, name); if (ref) return ref; var reply = "Array:["; for (var i = 0; i < this.length; i++) { if (i != 0) { reply += ","; } batch.paramCount++; var childName = "c" + DWREngine._batch.map.callCount + "-e" + batch.paramCount; DWREngine._serializeAll(batch, referto, this[i], childName); reply += "reference:"; reply += childName; } reply += "]"; return reply;};
return "Date:[ " + this.getUTCFullYear() + ", " + this.getUTCMonth() + ", " + this.getUTCDate() + ", " + this.getUTCHours() + ", " + this.getUTCMinutes() + ", " + this.getUTCSeconds() + ", " + this.getUTCMilliseconds() + "]";
return "Date:" + this.getTime();
DWREngine._serializeDate = function(batch, referto, data, name){ return "Date:[ " + this.getUTCFullYear() + ", " + this.getUTCMonth() + ", " + this.getUTCDate() + ", " + this.getUTCHours() + ", " + this.getUTCMinutes() + ", " + this.getUTCSeconds() + ", " + this.getUTCMilliseconds() + "]";};
for (element in data) { if (element != "dwrSerialize") { batch.paramCount++; var childName = "c" + DWREngine._batch.map.callCount + "-e" + batch.paramCount; DWREngine._serializeAll(batch, referto, data[element], childName);
for (element in data) { batch.paramCount++; var childName = "c" + DWREngine._batch.map.callCount + "-e" + batch.paramCount; DWREngine._serializeAll(batch, referto, data[element], childName);
DWREngine._serializeObject = function(batch, referto, data, name) { var ref = DWREngine._lookup(referto, data, name); if (ref) return ref; // This check for an HTML is not complete, but is there a better way? // Maybe we should add: data.hasChildNodes typeof "function" == true if (data.nodeName && data.nodeType) { return DWREngine._serializeXml(batch, referto, data, name); } // treat objects as an associative arrays var reply = "Object:{"; var element; for (element in data) { if (element != "dwrSerialize") { batch.paramCount++; var childName = "c" + DWREngine._batch.map.callCount + "-e" + batch.paramCount; DWREngine._serializeAll(batch, referto, data[element], childName); reply += encodeURIComponent(element); reply += ":reference:"; reply += childName; reply += ", "; } } if (reply.substring(reply.length - 2) == ", ") { reply = reply.substring(0, reply.length - 2); } reply += "}"; return reply;};
reply += encodeURIComponent(element); reply += ":reference:"; reply += childName; reply += ", "; }
reply += encodeURIComponent(element) + ":reference:" + childName + ", ";
DWREngine._serializeObject = function(batch, referto, data, name) { var ref = DWREngine._lookup(referto, data, name); if (ref) return ref; // This check for an HTML is not complete, but is there a better way? // Maybe we should add: data.hasChildNodes typeof "function" == true if (data.nodeName && data.nodeType) { return DWREngine._serializeXml(batch, referto, data, name); } // treat objects as an associative arrays var reply = "Object:{"; var element; for (element in data) { if (element != "dwrSerialize") { batch.paramCount++; var childName = "c" + DWREngine._batch.map.callCount + "-e" + batch.paramCount; DWREngine._serializeAll(batch, referto, data[element], childName); reply += encodeURIComponent(element); reply += ":reference:"; reply += childName; reply += ", "; } } if (reply.substring(reply.length - 2) == ", ") { reply = reply.substring(0, reply.length - 2); } reply += "}"; return reply;};
var reply = "Object:{";
var reply = "Object_" + DWREngine._getObjectClassName(data) + ":{";
DWREngine._serializeObject = function(batch, referto, data, name) { var ref = DWREngine._lookup(referto, data, name); if (ref) return ref; // This check for an HTML is not complete, but is there a better way? // Maybe we should add: data.hasChildNodes typeof "function" == true if (data.nodeName && data.nodeType) { return DWREngine._serializeXml(batch, referto, data, name); } // treat objects as an associative arrays var reply = "Object:{"; var element; for (element in data) { batch.paramCount++; var childName = "c" + DWREngine._batch.map.callCount + "-e" + batch.paramCount; DWREngine._serializeAll(batch, referto, data[element], childName); reply += encodeURIComponent(element) + ":reference:" + childName + ", "; } if (reply.substring(reply.length - 2) == ", ") { reply = reply.substring(0, reply.length - 2); } reply += "}"; return reply;};
if (data.nodeName) { return DWREngine._serializeXml(batch, referto, data, name);
if (data.nodeName) { return DWREngine._serializeXml(batch, referto, data, name); } var reply = "Object:{"; var element; for (element in this) { if (element != "dwrSerialize") { batch.paramCount++; var childName = "c" + DWREngine._batch.map.callCount + "-e" + batch.paramCount; DWREngine._serializeAll(batch, referto, this[element], childName); reply += encodeURIComponent(element); reply += ":reference:"; reply += childName; reply += ", ";
DWREngine._serializeObject = function(batch, referto, data, name) { var ref = DWREngine._lookup(referto, this, name); if (ref) return ref; if (data.nodeName) { return DWREngine._serializeXml(batch, referto, data, name); } // treat objects as an associative arrays var reply = "Object:{"; var element; for (element in this) { if (element != "dwrSerialize") { batch.paramCount++; var childName = "c" + DWREngine._batch.map.callCount + "-e" + batch.paramCount; DWREngine._serializeAll(batch, referto, this[element], childName); reply += encodeURIComponent(element); reply += ":reference:"; reply += childName; reply += ", "; } } if (reply.substring(reply.length - 2) == ", ") { reply = reply.substring(0, reply.length - 2); } reply += "}"; return reply;};
var reply = "Object:{"; var element; for (element in this) { if (element != "dwrSerialize") { batch.paramCount++; var childName = "c" + DWREngine._batch.map.callCount + "-e" + batch.paramCount; DWREngine._serializeAll(batch, referto, this[element], childName);
if (reply.substring(reply.length - 2) == ", ") { reply = reply.substring(0, reply.length - 2); } reply += "}";
DWREngine._serializeObject = function(batch, referto, data, name) { var ref = DWREngine._lookup(referto, this, name); if (ref) return ref; if (data.nodeName) { return DWREngine._serializeXml(batch, referto, data, name); } // treat objects as an associative arrays var reply = "Object:{"; var element; for (element in this) { if (element != "dwrSerialize") { batch.paramCount++; var childName = "c" + DWREngine._batch.map.callCount + "-e" + batch.paramCount; DWREngine._serializeAll(batch, referto, this[element], childName); reply += encodeURIComponent(element); reply += ":reference:"; reply += childName; reply += ", "; } } if (reply.substring(reply.length - 2) == ", ") { reply = reply.substring(0, reply.length - 2); } reply += "}"; return reply;};
reply += encodeURIComponent(element); reply += ":reference:"; reply += childName; reply += ", "; } } if (reply.substring(reply.length - 2) == ", ") { reply = reply.substring(0, reply.length - 2); } reply += "}"; return reply;
return reply;
DWREngine._serializeObject = function(batch, referto, data, name) { var ref = DWREngine._lookup(referto, this, name); if (ref) return ref; if (data.nodeName) { return DWREngine._serializeXml(batch, referto, data, name); } // treat objects as an associative arrays var reply = "Object:{"; var element; for (element in this) { if (element != "dwrSerialize") { batch.paramCount++; var childName = "c" + DWREngine._batch.map.callCount + "-e" + batch.paramCount; DWREngine._serializeAll(batch, referto, this[element], childName); reply += encodeURIComponent(element); reply += ":reference:"; reply += childName; reply += ", "; } } if (reply.substring(reply.length - 2) == ", ") { reply = reply.substring(0, reply.length - 2); } reply += "}"; return reply;};
DWREngine._serializeObject = function(batch, referto, data, name) { var ref = DWREngine._lookup(referto, data, name);
dwr.engine._serializeObject = function(batch, referto, data, name) { var ref = dwr.engine._lookup(referto, data, name);
DWREngine._serializeObject = function(batch, referto, data, name) { var ref = DWREngine._lookup(referto, data, name); if (ref) return ref; // This check for an HTML is not complete, but is there a better way? // Maybe we should add: data.hasChildNodes typeof "function" == true if (data.nodeName && data.nodeType) { return DWREngine._serializeXml(batch, referto, data, name); } // treat objects as an associative arrays var reply = "Object_" + DWREngine._getObjectClassName(data) + ":{"; var element; for (element in data) { batch.paramCount++; var childName = "c" + DWREngine._batch.map.callCount + "-e" + batch.paramCount; DWREngine._serializeAll(batch, referto, data[element], childName); reply += encodeURIComponent(element) + ":reference:" + childName + ", "; } if (reply.substring(reply.length - 2) == ", ") { reply = reply.substring(0, reply.length - 2); } reply += "}"; return reply;};
return DWREngine._serializeXml(batch, referto, data, name);
return dwr.engine._serializeXml(batch, referto, data, name);
DWREngine._serializeObject = function(batch, referto, data, name) { var ref = DWREngine._lookup(referto, data, name); if (ref) return ref; // This check for an HTML is not complete, but is there a better way? // Maybe we should add: data.hasChildNodes typeof "function" == true if (data.nodeName && data.nodeType) { return DWREngine._serializeXml(batch, referto, data, name); } // treat objects as an associative arrays var reply = "Object_" + DWREngine._getObjectClassName(data) + ":{"; var element; for (element in data) { batch.paramCount++; var childName = "c" + DWREngine._batch.map.callCount + "-e" + batch.paramCount; DWREngine._serializeAll(batch, referto, data[element], childName); reply += encodeURIComponent(element) + ":reference:" + childName + ", "; } if (reply.substring(reply.length - 2) == ", ") { reply = reply.substring(0, reply.length - 2); } reply += "}"; return reply;};
var reply = "Object_" + DWREngine._getObjectClassName(data) + ":{";
var reply = "Object_" + dwr.engine._getObjectClassName(data) + ":{";
DWREngine._serializeObject = function(batch, referto, data, name) { var ref = DWREngine._lookup(referto, data, name); if (ref) return ref; // This check for an HTML is not complete, but is there a better way? // Maybe we should add: data.hasChildNodes typeof "function" == true if (data.nodeName && data.nodeType) { return DWREngine._serializeXml(batch, referto, data, name); } // treat objects as an associative arrays var reply = "Object_" + DWREngine._getObjectClassName(data) + ":{"; var element; for (element in data) { batch.paramCount++; var childName = "c" + DWREngine._batch.map.callCount + "-e" + batch.paramCount; DWREngine._serializeAll(batch, referto, data[element], childName); reply += encodeURIComponent(element) + ":reference:" + childName + ", "; } if (reply.substring(reply.length - 2) == ", ") { reply = reply.substring(0, reply.length - 2); } reply += "}"; return reply;};
var childName = "c" + DWREngine._batch.map.callCount + "-e" + batch.paramCount; DWREngine._serializeAll(batch, referto, data[element], childName);
var childName = "c" + dwr.engine._batch.map.callCount + "-e" + batch.paramCount; dwr.engine._serializeAll(batch, referto, data[element], childName);
DWREngine._serializeObject = function(batch, referto, data, name) { var ref = DWREngine._lookup(referto, data, name); if (ref) return ref; // This check for an HTML is not complete, but is there a better way? // Maybe we should add: data.hasChildNodes typeof "function" == true if (data.nodeName && data.nodeType) { return DWREngine._serializeXml(batch, referto, data, name); } // treat objects as an associative arrays var reply = "Object_" + DWREngine._getObjectClassName(data) + ":{"; var element; for (element in data) { batch.paramCount++; var childName = "c" + DWREngine._batch.map.callCount + "-e" + batch.paramCount; DWREngine._serializeAll(batch, referto, data[element], childName); reply += encodeURIComponent(element) + ":reference:" + childName + ", "; } if (reply.substring(reply.length - 2) == ", ") { reply = reply.substring(0, reply.length - 2); } reply += "}"; return reply;};
reply = reply.substring(0, reply.length - 2);
if (reply.substring(reply.length - 2) == ", ") { reply = reply.substring(0, reply.length - 2); }
DWREngine._serializeObject = function(batch, referto, data, name){ var ref = DWREngine._lookup(referto, this, name); if (ref) { return ref; } if (data.nodeName) { return DWREngine._serializeXml(batch, referto, data, name); } // treat objects as an associative arrays var reply = "Object:{"; var element; for (element in this) { if (element != "dwrSerialize") { batch.paramCount++; var childName = "c" + DWREngine._batch.map.callCount + "-e" + batch.paramCount; DWREngine._serializeAll(batch, referto, this[element], childName); reply += encodeURIComponent(element); reply += ":reference:"; reply += childName; reply += ", "; } } reply = reply.substring(0, reply.length - 2); reply += "}"; return reply;};
var ref = DWREngine._lookup(referto, this, name);
var ref = DWREngine._lookup(referto, data, name);
DWREngine._serializeObject = function(batch, referto, data, name) { var ref = DWREngine._lookup(referto, this, name); if (ref) return ref; // This check for an HTML is not complete, but is there a better way. // Maybe we should add: data.hasChildNodes typeof "function" == true if (data.nodeName && data.nodeType) { return DWREngine._serializeXml(batch, referto, data, name); } // treat objects as an associative arrays var reply = "Object:{"; var element; for (element in this) { if (element != "dwrSerialize") { batch.paramCount++; var childName = "c" + DWREngine._batch.map.callCount + "-e" + batch.paramCount; DWREngine._serializeAll(batch, referto, this[element], childName); reply += encodeURIComponent(element); reply += ":reference:"; reply += childName; reply += ", "; } } if (reply.substring(reply.length - 2) == ", ") { reply = reply.substring(0, reply.length - 2); } reply += "}"; return reply;};
for (element in this) {
for (element in data) {
DWREngine._serializeObject = function(batch, referto, data, name) { var ref = DWREngine._lookup(referto, this, name); if (ref) return ref; // This check for an HTML is not complete, but is there a better way. // Maybe we should add: data.hasChildNodes typeof "function" == true if (data.nodeName && data.nodeType) { return DWREngine._serializeXml(batch, referto, data, name); } // treat objects as an associative arrays var reply = "Object:{"; var element; for (element in this) { if (element != "dwrSerialize") { batch.paramCount++; var childName = "c" + DWREngine._batch.map.callCount + "-e" + batch.paramCount; DWREngine._serializeAll(batch, referto, this[element], childName); reply += encodeURIComponent(element); reply += ":reference:"; reply += childName; reply += ", "; } } if (reply.substring(reply.length - 2) == ", ") { reply = reply.substring(0, reply.length - 2); } reply += "}"; return reply;};
DWREngine._serializeAll(batch, referto, this[element], childName);
DWREngine._serializeAll(batch, referto, data[element], childName);
DWREngine._serializeObject = function(batch, referto, data, name) { var ref = DWREngine._lookup(referto, this, name); if (ref) return ref; // This check for an HTML is not complete, but is there a better way. // Maybe we should add: data.hasChildNodes typeof "function" == true if (data.nodeName && data.nodeType) { return DWREngine._serializeXml(batch, referto, data, name); } // treat objects as an associative arrays var reply = "Object:{"; var element; for (element in this) { if (element != "dwrSerialize") { batch.paramCount++; var childName = "c" + DWREngine._batch.map.callCount + "-e" + batch.paramCount; DWREngine._serializeAll(batch, referto, this[element], childName); reply += encodeURIComponent(element); reply += ":reference:"; reply += childName; reply += ", "; } } if (reply.substring(reply.length - 2) == ", ") { reply = reply.substring(0, reply.length - 2); } reply += "}"; return reply;};
else output = data.toXml;
else if (data.toXml) output = data.toXml; else output = data.innerHTML;
DWREngine._serializeXml = function(batch, referto, data, name) { var ref = DWREngine._lookup(referto, data, name); if (ref) return ref; var output; if (window.XMLSerializer) output = new XMLSerializer().serializeToString(data); else output = data.toXml; return "XML:" + encodeURIComponent(output);};
if (window.XMLSerializer) { var serializer = new XMLSerializer(); output = serializer.serializeToString(data); } else { output = data.toXml; }
if (window.XMLSerializer) output = new XMLSerializer().serializeToString(data); else output = data.toXml;
DWREngine._serializeXml = function(batch, referto, data, name) { var ref = DWREngine._lookup(referto, data, name); if (ref) return ref; var output; if (window.XMLSerializer) { var serializer = new XMLSerializer(); output = serializer.serializeToString(data); } else { output = data.toXml; } return "XML:" + encodeURIComponent(output);};
DWREngine._serializeXml = function(batch, referto, data, name) { var ref = DWREngine._lookup(referto, data, name);
dwr.engine._serializeXml = function(batch, referto, data, name) { var ref = dwr.engine._lookup(referto, data, name);
DWREngine._serializeXml = function(batch, referto, data, name) { var ref = DWREngine._lookup(referto, data, name); if (ref) return ref; var output; if (window.XMLSerializer) output = new XMLSerializer().serializeToString(data); else if (data.toXml) output = data.toXml; else output = data.innerHTML; return "XML:" + encodeURIComponent(output);};
var ref = DWREngine._lookup(referto, this, name);
var ref = DWREngine._lookup(referto, data, name);
DWREngine._serializeXml = function(batch, referto, data, name) { var ref = DWREngine._lookup(referto, this, name); if (ref) return ref; var output; if (window.XMLSerializer) { var serializer = new XMLSerializer(); output = serializer.serializeToString(data); } else { output = data.toXml; } return "XML:" + encodeURIComponent(output);};
if (data[property] != null && typeof data[property] == "object") { var prefixClone = new Array();
if (dwr.util._isObject(data[property]) && !dwr.util._isArray(data[property])) { var prefixClone = [];
dwr.util._setDataProperties = function(data, prefixes) { for (var property in data) { // Are there any elements with that id or name if (data[property] != null && typeof data[property] == "object") { var prefixClone = new Array(); for (var i = 0; i < prefixes.length; i++) { prefixClone.push(prefixes[i]); } prefixClone.push(property); dwr.util._setDataProperties(data[property], prefixClone); } else { var nestedProperty = property; if (prefixes.length > 0) { nestedProperty = (prefixes.join(".")) + "." + property; } if (dwr.util.byId(nestedProperty) != null || document.getElementsByName(nestedProperty).length >= 1) { data[property] = dwr.util.getValue(nestedProperty); } } }};
var disabledZone = document.createElement('div');
disabledZone = document.createElement('div');
DWRUtil._showLoadingMessage = function(){ var disabledZone = $('disabledZone'); if (!disabledZone) { var disabledZone = document.createElement('div'); disabledZone.setAttribute('id', 'disabledZone'); disabledZone.style.position = "absolute"; disabledZone.style.zIndex = "1000"; disabledZone.style.left = "0px"; disabledZone.style.top = "0px"; disabledZone.style.width = "100%"; disabledZone.style.height = "100%"; document.body.appendChild(disabledZone); var messageZone = document.createElement('div'); messageZone.setAttribute('id', 'messageZone'); messageZone.style.position = "absolute"; messageZone.style.top = "0px"; messageZone.style.right = "0px"; messageZone.style.background = "red"; messageZone.style.color = "white"; messageZone.style.fontFamily = "Arial,Helvetica,sans-serif"; messageZone.style.padding = "4px"; disabledZone.appendChild(messageZone); var text = document.createTextNode(DWRUtil._loadingMessage); messageZone.appendChild(text); } else { $('messageZone').innerHTML = DWRUtil._loadingMessage; disabledZone.style.visibility = 'visible'; }}
batch.completed = true;
DWREngine._stateChange = function(batch) { if (batch.req.readyState == 4 && !batch.completed) { try { var reply = batch.req.responseText; if (reply != null && reply != "") { if (batch.req.status && batch.req.status == 200) { batch.completed = true; eval(reply); } else { DWREngine._stateChangeError(batch, reply); } } else { DWREngine._stateChangeError(batch, "No data received from server"); } } catch (ex) { DWREngine._stateChangeError(batch, ex); } DWREngine._finalize(batch); }};
DWREngine._finalize(batch);
DWREngine._removeNode(batch.div); DWREngine._removeNode(batch.iframe); DWREngine._removeNode(batch.form); delete batch.req; if (batch.postHook) { batch.postHook(); } for (var i = 0; i < DWREngine._batches.length; i++) { if (DWREngine._batches[i] == batch) { DWREngine._batches.splice(i, 1); break; } } if (DWREngine._batchQueue.length != 0) { var sendbatch = DWREngine._batchQueue.shift(); DWREngine._sendData(sendbatch); DWREngine._batches[DWREngine._batches.length] = sendbatch; } batch.completed = true;
DWREngine._stateChange = function(batch) { if (batch.req.readyState == 4 && !batch.completed) { try { var reply = batch.req.responseText; if (reply != null && reply != "") { if (batch.req.status && batch.req.status == 200) { batch.completed = true; eval(reply); } else { DWREngine._stateChangeError(batch, reply); } } else { DWREngine._stateChangeError(batch, "No data received from server"); } } catch (ex) { DWREngine._stateChangeError(batch, ex); } DWREngine._finalize(batch); }};
DWREngine._stateChangeError(reply);
DWREngine._stateChangeError(batch, reply);
DWREngine._stateChange = function(batch){ if (batch.req.readyState == 4) { try { var reply = batch.req.responseText; if (reply != null && reply != "") { if (batch.req.status && batch.req.status == 200) { batch.completed = true; eval(reply); } else { DWREngine._stateChangeError(reply); } } else { DWREngine._stateChangeError("No data received from server"); } } catch (ex) { DWREngine._stateChangeError(ex); } DWREngine._finalize(batch); }};
DWREngine._stateChangeError("No data received from server");
DWREngine._stateChangeError(batch, "No data received from server");
DWREngine._stateChange = function(batch){ if (batch.req.readyState == 4) { try { var reply = batch.req.responseText; if (reply != null && reply != "") { if (batch.req.status && batch.req.status == 200) { batch.completed = true; eval(reply); } else { DWREngine._stateChangeError(reply); } } else { DWREngine._stateChangeError("No data received from server"); } } catch (ex) { DWREngine._stateChangeError(ex); } DWREngine._finalize(batch); }};
DWREngine._stateChangeError(ex);
DWREngine._stateChangeError(batch, ex);
DWREngine._stateChange = function(batch){ if (batch.req.readyState == 4) { try { var reply = batch.req.responseText; if (reply != null && reply != "") { if (batch.req.status && batch.req.status == 200) { batch.completed = true; eval(reply); } else { DWREngine._stateChangeError(reply); } } else { DWREngine._stateChangeError("No data received from server"); } } catch (ex) { DWREngine._stateChangeError(ex); } DWREngine._finalize(batch); }};
DWREngine.handleError(call.id, call.req.responseText);
DWREngine._handleError(call.id, call.req.responseText);
DWREngine._stateChange = function(call){ if (call.req.readyState == 4) { try { if (call.req.status && call.req.status == 200) { eval(call.req.responseText); } else { DWREngine.handleError(call.id, call.req.responseText); } } catch (ex) { DWREngine.handleError(call.id, ex); } }}
DWREngine.handleError(call.id, ex);
DWREngine._handleError(call.id, ex);
DWREngine._stateChange = function(call){ if (call.req.readyState == 4) { try { if (call.req.status && call.req.status == 200) { eval(call.req.responseText); } else { DWREngine.handleError(call.id, call.req.responseText); } } catch (ex) { DWREngine.handleError(call.id, ex); } }}
if (toEval != null) dwr.engine._remoteEval(toEval); else dwr.engine._debug("Nothing to eval");
dwr.engine._remoteEval(toEval);
dwr.engine._stateChange = function(batch) { var toEval; if (batch.completed) { dwr.engine._debug("Error: _stateChange() with batch.completed"); return; } try { if (batch.req.readyState != 4) return; } catch (ex) { dwr.engine._handleWarning(batch, ex); // It's broken - clear up and forget this call dwr.engine._clearUp(batch); return; } try { var reply = batch.req.responseText; reply = dwr.engine._replyRewriteHandler(reply); var status = batch.req.status; // causes Mozilla to except on page moves if (reply == null || reply == "") { dwr.engine._handleWarning(batch, { name:"dwr.engine.missingData", message:"No data received from server" }); } else if (status != 200) { dwr.engine._handleWarning(batch, { name:"dwr.engine.http." + status, message:reply }); } else { var contentType = batch.req.getResponseHeader("Content-Type"); if (!contentType.match(/^text\/plain/) && !contentType.match(/^text\/javascript/)) { if (dwr.engine._textHtmlHandler && contentType.match(/^text\/html/)) { dwr.engine._textHtmlHandler(); } else { dwr.engine._handleWarning(batch, { name:"dwr.engine.invalidMimeType", message:"Invalid content type: '" + contentType + "'" }); } } else { // Comet replies might have already partially executed if (batch.req == dwr.engine._pollReq && batch.map.partialResponse == "true") { dwr.engine._receivedBatch = batch; dwr.engine._processCometResponse(reply); dwr.engine._receivedBatch = null; } else { if (reply.search("//#DWR") == -1) { dwr.engine._handleWarning(batch, { name:"dwr.engine.invalidReply", message:"Invalid reply from server" }); } else { toEval = reply; } } } } } catch (ex) { dwr.engine._handleWarning(batch, ex); } // Outside of the try/catch so errors propogate normally: dwr.engine._receivedBatch = batch; if (toEval != null) dwr.engine._remoteEval(toEval); else dwr.engine._debug("Nothing to eval"); dwr.engine._receivedBatch = null; dwr.engine._clearUp(batch);};