From: Brion Vibber Date: Thu, 19 Jul 2007 15:33:12 +0000 (+0000) Subject: * (bug 10642) Fix shift-click checkbox behavior for Opera 9.0+ and 6.0 X-Git-Tag: 1.31.0-rc.0~52008 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=9154cb1539e90e1fd92fda56f9add377035310a7;p=lhc%2Fweb%2Fwiklou.git * (bug 10642) Fix shift-click checkbox behavior for Opera 9.0+ and 6.0 The previous code was using the 'onmouseup' event to trigger the shift-click multiple selection behavior. This had a number of problems: * Opera 6.0 doesn't fire this event on radio buttons * Opera 7.x and 8.x flip the check state before sending the event, while Opera 9.x and other browsers flip it after * A UA check for Opera was used to work around the state inconsistency for 7.x and 8.x, which broke on 9.x * Minor quibble: the event fires if you click outside the radio and release while the mouse is over it, though that wouldn't normally count as a click on the radio. I've switched it to use the 'onclick' event handler instead, which resolves this: * Opera 6.x fires this event * All tested browsers have flipped the check state before the event, so special-case code can be removed. Tested browsers: * Opera 9.2, 9.0, 8.5, 8.0, 7.5, 6.0/Mac * Firefox 2/Mac * Safari 2/Mac * Safari 3/Win * IE 7/Win * IE 6/Win * IE 5.2/Mac * iCab 3/Mac * Mozilla 1.1/Mac --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 1378e2e4ac..0b879c5a1b 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -314,6 +314,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 10631) Warn when illegal characters are removed from filename at upload * Fix several JavaScript bugs under MSIE 5/Macintosh * (bug 10591) Use Arabic numerals (0,1,2...) for the Malayam language +* (bug 10642) Fix shift-click checkbox behavior for Opera 9.0+ and 6.0 + == API changes since 1.10 == diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 097d95ffa7..bfec7cd5f9 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -1201,7 +1201,7 @@ $wgCacheEpoch = '20030516000000'; * to ensure that client-side caches don't keep obsolete copies of global * styles. */ -$wgStyleVersion = '89'; +$wgStyleVersion = '90'; # Server-side caching: diff --git a/skins/common/wikibits.js b/skins/common/wikibits.js index fd371f2375..ee8c493145 100644 --- a/skins/common/wikibits.js +++ b/skins/common/wikibits.js @@ -728,7 +728,7 @@ function addCheckboxClickHandlers(inputs, start) { var end = checkboxes.length; checkboxes[end] = cb; cb.index = end; - cb.onmouseup = checkboxMouseupHandler; + cb.onclick = checkboxMouseupHandler; } if ( finish < inputs.length ) { @@ -746,10 +746,7 @@ function checkboxMouseupHandler(e) { lastCheckbox = this.index; return true; } - var endState = !this.checked; - if ( is_opera ) { // opera has already toggled the checkbox by this point - endState = !endState; - } + var endState = this.checked; var start, finish; if ( this.index < lastCheckbox ) { start = this.index + 1;