wp/wp-includes/js/wp-list-revisions.js
author ymh <ymh.work@gmail.com>
Tue, 27 Sep 2022 16:37:53 +0200
changeset 19 3d72ae0968f4
parent 9 177826044cd9
permissions -rw-r--r--
upgrade wordpress to 6.0.2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9
177826044cd9 upgrade wordpress to 5.2.3
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
     1
/**
177826044cd9 upgrade wordpress to 5.2.3
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
     2
 * @output wp-includes/js/wp-list-revisions.js
177826044cd9 upgrade wordpress to 5.2.3
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
     3
 */
177826044cd9 upgrade wordpress to 5.2.3
ymh <ymh.work@gmail.com>
parents: 5
diff changeset
     4
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     5
(function(w) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     6
	var init = function() {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     7
		var pr = document.getElementById('post-revisions'),
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     8
		inputs = pr ? pr.getElementsByTagName('input') : [];
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     9
		pr.onclick = function() {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    10
			var i, checkCount = 0, side;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    11
			for ( i = 0; i < inputs.length; i++ ) {
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    12
				checkCount += inputs[i].checked ? 1 : 0;
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    13
				side = inputs[i].getAttribute('name');
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    14
				if ( ! inputs[i].checked &&
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    15
				( 'left' == side && 1 > checkCount || 'right' == side && 1 < checkCount && ( ! inputs[i-1] || ! inputs[i-1].checked ) ) &&
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    16
				! ( inputs[i+1] && inputs[i+1].checked && 'right' == inputs[i+1].getAttribute('name') ) )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    17
					inputs[i].style.visibility = 'hidden';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    18
				else if ( 'left' == side || 'right' == side )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    19
					inputs[i].style.visibility = 'visible';
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    20
			}
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    21
		};
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    22
		pr.onclick();
5
5e2f62d02dcd upgrade wordpress + plugins
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    23
	};
0
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    24
	if ( w && w.addEventListener )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    25
		w.addEventListener('load', init, false);
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    26
	else if ( w && w.attachEvent )
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    27
		w.attachEvent('onload', init);
d970ebf37754 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
    28
})(window);