- // 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;
- }
- } );
- }
- }