[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-includes/js/ -> wp-list-revisions.js (source)

   1  /**
   2   * @output wp-includes/js/wp-list-revisions.js
   3   */
   4  
   5  (function(w) {
   6      var init = function() {
   7          var pr = document.getElementById('post-revisions'),
   8          inputs = pr ? pr.getElementsByTagName('input') : [];
   9          pr.onclick = function() {
  10              var i, checkCount = 0, side;
  11              for ( i = 0; i < inputs.length; i++ ) {
  12                  checkCount += inputs[i].checked ? 1 : 0;
  13                  side = inputs[i].getAttribute('name');
  14                  if ( ! inputs[i].checked &&
  15                  ( 'left' == side && 1 > checkCount || 'right' == side && 1 < checkCount && ( ! inputs[i-1] || ! inputs[i-1].checked ) ) &&
  16                  ! ( inputs[i+1] && inputs[i+1].checked && 'right' == inputs[i+1].getAttribute('name') ) )
  17                      inputs[i].style.visibility = 'hidden';
  18                  else if ( 'left' == side || 'right' == side )
  19                      inputs[i].style.visibility = 'visible';
  20              }
  21          };
  22          pr.onclick();
  23      };
  24      if ( w && w.addEventListener )
  25          w.addEventListener('load', init, false);
  26      else if ( w && w.attachEvent )
  27          w.attachEvent('onload', init);
  28  })(window);


Generated: Thu Nov 21 01:00:03 2024 Cross-referenced by PHPXref 0.7.1