Update of /cvsroot/magicajax/magicajax/Core/script
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20146/magicajax/Core/script
Modified Files:
AjaxCallObject.js
Log Message:
- fix for older version of FireFox
- __PAGE_STATE_CACHE only filled for Firefox
Index: AjaxCallObject.js
===================================================================
RCS file: /cvsroot/magicajax/magicajax/Core/script/AjaxCallObject.js,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** AjaxCallObject.js 21 Nov 2005 18:58:23 -0000 1.16
--- AjaxCallObject.js 21 Nov 2005 21:40:14 -0000 1.17
***************
*** 86,91 ****
window.onbeforeunload = this.OnPageBeforeUnload;
}
!
! if ( bPageIsStored && bUnloadStoredPage )
{
__PreviousOnPageUnload = window.onunload;
--- 86,90 ----
window.onbeforeunload = this.OnPageBeforeUnload;
}
! else
{
__PreviousOnPageUnload = window.onunload;
***************
*** 96,101 ****
AjaxCallObject.prototype.OnFormSubmit = function()
{
- document.forms[0][__PageStateCacheName].value = "";
-
var target;
if ("activeElement" in document)
--- 95,98 ----
***************
*** 107,111 ****
{
// Firefox
! target = arguments[0].explicitOriginalTarget;
}
--- 104,108 ----
{
// Firefox
! target = arguments[0] ? arguments[0].explicitOriginalTarget : null;
}
***************
*** 129,134 ****
AjaxCallObject.prototype.DoPostBack = function(eventTarget, eventArgument)
{
- document.forms[0][__PageStateCacheName].value = "";
-
var target;
var elemUniqueID = eventTarget.split("$").join(":");
--- 126,129 ----
***************
*** 178,186 ****
AjaxCallObject.prototype.OnPageBeforeUnload = function()
! {
! // Save the html of the form, so that it can be restored for the
! // browser's "Back Button"
! document.forms[0][__PageStateCacheName].value = "HTML:" + encodeURIComponent(document.forms[0].innerHTML);
!
if (__PreviousOnPageBeforeUnload != null)
return __PreviousOnPageBeforeUnload();
--- 173,183 ----
AjaxCallObject.prototype.OnPageBeforeUnload = function()
! {
! if (navigator.appName != "Microsoft Internet Explorer")
! {
! // Save the html of the form, so that it can be restored for the browser's "Back Button"
! // Note: Firefox only
! document.forms[0][__PageStateCacheName].value = "HTML:" + encodeURIComponent(document.forms[0].innerHTML);
! }
if (__PreviousOnPageBeforeUnload != null)
return __PreviousOnPageBeforeUnload();
***************
*** 305,310 ****
{
// Synchronous
! // Use a timeout so that the screen refreshes before getting stack waiting
! // the AjaxCall.
window.setTimeout(
function()
--- 302,306 ----
{
// Synchronous
! // Use a timeout so that the screen refreshes before getting stack waiting the AjaxCall.
window.setTimeout(
function()
***************
*** 318,323 ****
else
oThis.OnError(oThis.XmlHttp.status, oThis.XmlHttp.statusText, oThis.XmlHttp.responseText);
! },
! 1);
}
}
--- 314,318 ----
else
oThis.OnError(oThis.XmlHttp.status, oThis.XmlHttp.statusText, oThis.XmlHttp.responseText);
! }, 1);
}
}
***************
*** 565,570 ****
// wait element
CreateWaitElement();
! window.attachEvent("onscroll", MoveWaitElement);
! window.attachEvent("onresize", MoveWaitElement);
var waitElement;
function MoveWaitElement()
--- 560,573 ----
// wait element
CreateWaitElement();
! if (window.addEventListener)
! {
! window.addEventListener('onscroll', MoveWaitElement, false);
! window.addEventListener('onresize', MoveWaitElement, false);
! }
! else if (window.attachEvent)
! {
! window.attachEvent('onscroll', MoveWaitElement);
! window.attachEvent('onresize', MoveWaitElement);
! }
var waitElement;
function MoveWaitElement()
***************
*** 575,580 ****
var width = document.body.clientWidth;
waitElement.style.top = document.body.scrollTop;
! waitElement.style.left = width + document.body.offsetLeft -
! waitElement.offsetWidth;
}
function CreateWaitElement()
--- 578,582 ----
var width = document.body.clientWidth;
waitElement.style.top = document.body.scrollTop;
! waitElement.style.left = width + document.body.offsetLeft - waitElement.offsetWidth;
}
function CreateWaitElement()
|