From c255da09f072168ad82f913a56743af4c22bb579 Mon Sep 17 00:00:00 2001 From: Alex Z Date: Sun, 6 Sep 2009 04:10:26 +0000 Subject: [PATCH] (bug 20136) Synchronize the protection form expiry boxes onchange in addition to onkeyup. Technically the onkeyup handler is redundant, but at least on Firefox, onchange doesn't run until after the input loses focus, so its somewhat less intuitive, but necessary if the user clicks an option from a browser's autosuggestion --- RELEASE-NOTES | 2 ++ includes/ProtectionForm.php | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index be44c5e966..c55f7afacf 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -462,6 +462,8 @@ this. Was used when mwEmbed was going to be an extension. the local wiki, the user is now treated as the local user * (bug 20494) OutputPage::getArticleBodyOnly() no longer requires an useless argument +* (bug 20136) Protection form JavaScript now synchronizes the expiry boxes on + any change, in addition to onkeyup. == API changes in 1.16 == diff --git a/includes/ProtectionForm.php b/includes/ProtectionForm.php index 8c91544761..3d88420730 100644 --- a/includes/ProtectionForm.php +++ b/includes/ProtectionForm.php @@ -375,7 +375,8 @@ class ProtectionForm { } # Add custom expiry field $attribs = array( 'id' => "mwProtect-$action-expires", - 'onkeyup' => 'ProtectionForm.updateExpiry(this)' ) + $this->disabledAttrib; + 'onkeyup' => 'ProtectionForm.updateExpiry(this)', + 'onchange' => 'ProtectionForm.updateExpiry(this)' ) + $this->disabledAttrib; $out .= "
" . $mProtectother . -- 2.20.1