X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=resources%2Fsrc%2Fmediawiki.special%2Fmediawiki.special.preferences.js;h=163e85d335b3f8a58e0a0ea96c6f7cd66448e352;hb=75a85b412c4adb86d3cea6986a4c0394f7a531be;hp=a756f22d4d3c141f26dbfda2363011f7d5878f8a;hpb=0f0ff5db75fb594edb55df3ac7f2cb2cb592e75e;p=lhc%2Fweb%2Fwiklou.git diff --git a/resources/src/mediawiki.special/mediawiki.special.preferences.js b/resources/src/mediawiki.special/mediawiki.special.preferences.js index a756f22d4d..163e85d335 100644 --- a/resources/src/mediawiki.special/mediawiki.special.preferences.js +++ b/resources/src/mediawiki.special/mediawiki.special.preferences.js @@ -3,10 +3,9 @@ */ ( function ( mw, $ ) { $( function () { - var $preftoc, $preferences, $fieldsets, - labelFunc, - $tzSelect, $tzTextbox, $localtimeHolder, servertime, - allowCloseWindow, notif; + var $preftoc, $preferences, $fieldsets, labelFunc, + $tzSelect, $tzTextbox, $localtimeHolder, servertime, allowCloseWindow, + convertmessagebox = require( 'mediawiki.notification.convertmessagebox' ); labelFunc = function () { return this.id.replace( /^mw-prefsection/g, 'preftab' ); @@ -82,20 +81,8 @@ } } - // Check for messageboxes (.successbox, .warningbox, .errorbox) to replace with notifications - if ( $( '.mw-preferences-messagebox' ).length ) { - // If there is a #mw-preferences-success box and javascript is enabled, use a slick notification instead! - if ( $( '#mw-preferences-success' ).length ) { - notif = mw.notification.notify( mw.message( 'savedprefs' ), { autoHide: false } ); - // 'change' event not reliable! - $( '#preftoc, .prefsection' ).one( 'change keydown mousedown', function () { - if ( notif ) { - notif.close(); - notif = null; - } - } ); - } - } + // Check for successbox to replace with notifications + convertmessagebox(); // Enable keyboard users to use left and right keys to switch tabs $preftoc.on( 'keydown', function ( event ) {