From ac28d37b293655bc3699555620a17822fd5424b2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bartosz=20Dziewo=C5=84ski?= Date: Mon, 25 Sep 2017 20:34:30 +0200 Subject: [PATCH] mw.special.preferences.timezone: Remove some very old unnecessary code The first two removed blocks date to the pre-HTMLForm versions of the preferences form (rSVN44915 / c672ce603272d5206f0967f70f2474b4c09ce43a), where the dual dropdown/textbox field was implemented specially for this form. Its behavior currently is handled by HTMLSelectOrOtherField and selectorother.js, and this code is entirely unnecessary. The third removed block was added as a workaround for an issue caused by the second block, in e8d94f433c43982003fb0d008e1fc8ee04ed7744. Looks like we didn't realize at the time that we can just delete the buggy line. This fixes a minor issue where no warning would be displayed when exiting the preferences page without saving the changes after the user changed the "Time zone" field from "Other" to "Fill in from the browser" and the guessed value was different from the saved one. Change-Id: I9b5317111aaf7f6039d476b263ee9e54c4b4cf52 --- .../mediawiki.special.preferences.timezone.js | 6 ------ 1 file changed, 6 deletions(-) diff --git a/resources/src/mediawiki.special/mediawiki.special.preferences.timezone.js b/resources/src/mediawiki.special/mediawiki.special.preferences.timezone.js index 58a5f84a9f..03656eedea 100644 --- a/resources/src/mediawiki.special/mediawiki.special.preferences.timezone.js +++ b/resources/src/mediawiki.special/mediawiki.special.preferences.timezone.js @@ -61,16 +61,10 @@ minuteDiff = -( new Date().getTimezoneOffset() ); $tzTextbox.val( minutesToHours( minuteDiff ) ); $tzSelect.val( 'other' ); - $tzTextbox.prop( 'disabled', false ); } else { // Grab data from the $tzSelect value minuteDiff = parseInt( type.split( '|' )[ 1 ], 10 ) || 0; - $tzTextbox.val( minutesToHours( minuteDiff ) ); } - - // Set defaultValue prop on the generated box so we don't trigger the - // unsaved preferences check - $tzTextbox.prop( 'defaultValue', $tzTextbox.val() ); } // Determine local time from server time and minutes difference, for display. -- 2.20.1