mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-27 03:27:46 +01:00
2710bcade1
* This moves our "development" versions from .dev.js to .js (same for css). * The compressed version then moves from .js to .min.js (same for css). By switching to the standard .min convention, it sets expectations for developers, and works nicely with existing tools such as ack. fixes #21633. git-svn-id: http://core.svn.wordpress.org/trunk@21592 1a063a9b-81f0-0310-95a4-ce76da25c4cd
25 lines
912 B
JavaScript
25 lines
912 B
JavaScript
(function(w) {
|
|
var init = function() {
|
|
var pr = document.getElementById('post-revisions'),
|
|
inputs = pr ? pr.getElementsByTagName('input') : [];
|
|
pr.onclick = function() {
|
|
var i, checkCount = 0, side;
|
|
for ( i = 0; i < inputs.length; i++ ) {
|
|
checkCount += inputs[i].checked ? 1 : 0;
|
|
side = inputs[i].getAttribute('name');
|
|
if ( ! inputs[i].checked &&
|
|
( 'left' == side && 1 > checkCount || 'right' == side && 1 < checkCount && ( ! inputs[i-1] || ! inputs[i-1].checked ) ) &&
|
|
! ( inputs[i+1] && inputs[i+1].checked && 'right' == inputs[i+1].getAttribute('name') ) )
|
|
inputs[i].style.visibility = 'hidden';
|
|
else if ( 'left' == side || 'right' == side )
|
|
inputs[i].style.visibility = 'visible';
|
|
}
|
|
}
|
|
pr.onclick();
|
|
}
|
|
if ( w && w.addEventListener )
|
|
w.addEventListener('load', init, false);
|
|
else if ( w && w.attachEvent )
|
|
w.attachEvent('onload', init);
|
|
})(window);
|