includes/clientside/static/functions.js
changeset 810 7fd2b8a58ae4
parent 779 609e35845ec3
child 823 4596c40aaa94
equal deleted inserted replaced
809:ae4ef502f742 810:7fd2b8a58ae4
    46   return [string, 'Article'];
    46   return [string, 'Article'];
    47 }
    47 }
    48 
    48 
    49 function append_sid(url)
    49 function append_sid(url)
    50 {
    50 {
       
    51   var match = url.match(/#(.*?)$/);
       
    52   url = url.replace(/#(.*?)$/, '');
    51   sep = ( url.indexOf('?') > 0 ) ? '&' : '?';
    53   sep = ( url.indexOf('?') > 0 ) ? '&' : '?';
    52   if(ENANO_SID.length > 10)
    54   if(ENANO_SID.length > 10)
    53   {
    55   {
    54     url = url + sep + 'auth=' + ENANO_SID;
    56     url = url + sep + 'auth=' + ENANO_SID;
    55     sep = '&';
    57     sep = '&';
    56   }
    58   }
    57   if ( pagepass.length > 0 )
    59   if ( pagepass.length > 0 )
    58   {
    60   {
    59     url = url + sep + 'pagepass=' + pagepass;
    61     url = url + sep + 'pagepass=' + pagepass;
       
    62   }
       
    63   if ( match )
       
    64   {
       
    65     url = url + match[0];
    60   }
    66   }
    61   return url;
    67   return url;
    62 }
    68 }
    63 
    69 
    64 var stdAjaxPrefix = append_sid(scriptPath+'/ajax.php?title='+title);
    70 var stdAjaxPrefix = append_sid(scriptPath+'/ajax.php?title='+title);
   598  * briefly fades in, then fades out and destroys the box so as to re-allow control over the underlying element
   604  * briefly fades in, then fades out and destroys the box so as to re-allow control over the underlying element
   599  */
   605  */
   600 
   606 
   601 function whiteOutReportSuccess(whitey)
   607 function whiteOutReportSuccess(whitey)
   602 {
   608 {
       
   609   whiteOutDestroyWithImage(whitey, cdnPath + '/images/check.png');
       
   610 }
       
   611 
       
   612 function whiteOutReportFailure(whitey)
       
   613 {
       
   614   whiteOutDestroyWithImage(whitey, cdnPath + '/images/checkbad.png');
       
   615 }
       
   616 
       
   617 function whiteOutDestroyWithImage(whitey, image)
       
   618 {
   603   // fade the status indicator in and then out
   619   // fade the status indicator in and then out
   604   whitey.style.backgroundImage = 'url(' + scriptPath + '/images/check.png)';
   620   whitey.style.backgroundImage = 'url(' + image + ')';
   605   if ( aclDisableTransitionFX )
   621   if ( aclDisableTransitionFX )
   606   {
   622   {
   607     domObjChangeOpac(80, whitey);
   623     domObjChangeOpac(80, whitey);
   608   }
   624   }
   609   else
   625   else
   614         domOpacity(whitey, 60, 0, 500);
   630         domOpacity(whitey, 60, 0, 500);
   615       }, 750);
   631       }, 750);
   616   }
   632   }
   617   setTimeout(function()
   633   setTimeout(function()
   618     {
   634     {
   619       whitey.parentNode.removeChild(whitey);
   635       if ( whitey )
       
   636         if ( whitey.parentNode )
       
   637           whitey.parentNode.removeChild(whitey);
   620     }, 1250);
   638     }, 1250);
   621 }
   639 }
   622 
   640 
   623 /**
   641 /**
   624  * Whites out a form and disables all buttons under it. Useful for onsubmit functions.
   642  * Whites out a form and disables all buttons under it. Useful for onsubmit functions.