JS core: whiteOutReportSuccess now has a sister whiteOutReportFailure(); both abstracted to function whiteOutDestroyWithImage(whitey, image_url)
authorDan
Sun, 11 Jan 2009 21:37:39 -0500
changeset 810 7fd2b8a58ae4
parent 809 ae4ef502f742
child 811 5c807fe77020
JS core: whiteOutReportSuccess now has a sister whiteOutReportFailure(); both abstracted to function whiteOutDestroyWithImage(whitey, image_url)
includes/clientside/static/functions.js
--- a/includes/clientside/static/functions.js	Sun Jan 11 21:36:36 2009 -0500
+++ b/includes/clientside/static/functions.js	Sun Jan 11 21:37:39 2009 -0500
@@ -48,6 +48,8 @@
 
 function append_sid(url)
 {
+  var match = url.match(/#(.*?)$/);
+  url = url.replace(/#(.*?)$/, '');
   sep = ( url.indexOf('?') > 0 ) ? '&' : '?';
   if(ENANO_SID.length > 10)
   {
@@ -58,6 +60,10 @@
   {
     url = url + sep + 'pagepass=' + pagepass;
   }
+  if ( match )
+  {
+    url = url + match[0];
+  }
   return url;
 }
 
@@ -600,8 +606,18 @@
 
 function whiteOutReportSuccess(whitey)
 {
+  whiteOutDestroyWithImage(whitey, cdnPath + '/images/check.png');
+}
+
+function whiteOutReportFailure(whitey)
+{
+  whiteOutDestroyWithImage(whitey, cdnPath + '/images/checkbad.png');
+}
+
+function whiteOutDestroyWithImage(whitey, image)
+{
   // fade the status indicator in and then out
-  whitey.style.backgroundImage = 'url(' + scriptPath + '/images/check.png)';
+  whitey.style.backgroundImage = 'url(' + image + ')';
   if ( aclDisableTransitionFX )
   {
     domObjChangeOpac(80, whitey);
@@ -616,7 +632,9 @@
   }
   setTimeout(function()
     {
-      whitey.parentNode.removeChild(whitey);
+      if ( whitey )
+        if ( whitey.parentNode )
+          whitey.parentNode.removeChild(whitey);
     }, 1250);
 }