Merge "wikibits: Remove methods deprecated since 1.17 and 1.18"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Tue, 11 Apr 2017 23:00:36 +0000 (23:00 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 11 Apr 2017 23:00:36 +0000 (23:00 +0000)
RELEASE-NOTES-1.29
resources/Resources.php
resources/src/mediawiki.legacy/wikibits.js

index 4b7de88..38072dc 100644 (file)
@@ -307,6 +307,16 @@ changes to languages because of Phabricator reports.
 * (T156184) $wgRawHtml will no longer apply to internationalization messages.
 * Browser support for non-ES5 JavaScript browsers, including Android 2,
   Opera <12.10, and Internet Explorer 9, was lowered from Grade A to Grade C.
+* Removed wikibits global methods deprecated since MediaWiki 1.17 (T122755):
+  is_gecko, is_chrome_mac, is_chrome, webkit_version, is_safari_win, is_safari,
+  webkit_match, is_ff2, ff2_bugs, is_ff2_win, is_ff2_x11, opera95_bugs,
+  opera7_bugs, opera6_bugs, is_opera_95, is_opera_preseven, is_opera,
+  ie6_bugs, clientPC, changeText, killEvt, addHandler, hookEvent,
+  addClickHandler, removeHandler, getElementsByClassName, getInnerText,
+  setupCheckboxShiftClick, addCheckboxClickHandlers, mwEditButtons,
+  mwCustomEditButtons, injectSpinner, removeSpinner, escapeQuotes,
+  escapeQuotesHTML, jsMsg, addPortletLink, appendCSS, tooltipAccessKeyPrefix,
+  tooltipAccessKeyRegexp, updateTooltipAccessKeys.
 
 == Compatibility ==
 
index 33bdcb9..43582f0 100644 (file)
@@ -2151,7 +2151,6 @@ return [
        ],
        'mediawiki.legacy.wikibits' => [
                'scripts' => 'resources/src/mediawiki.legacy/wikibits.js',
-               'dependencies' => 'mediawiki.util',
                'targets' => [ 'desktop', 'mobile' ],
        ],
 
index 8062849..6eccc05 100644 (file)
  */
 ( function ( mw, $ ) {
        var msg,
-               win = window,
-               ua = navigator.userAgent.toLowerCase(),
-               onloadFuncts = [],
                loadedScripts = {};
 
-       /**
-        * User-agent sniffing.
-        *
-        * @deprecated since 1.17 Use jquery.client instead
-        */
-
-       msg = 'Use feature detection or module jquery.client instead.';
-
-       mw.log.deprecate( win, 'clientPC', ua, msg );
-
-       // Ignored dummy values
-       mw.log.deprecate( win, 'is_gecko', false, msg );
-       mw.log.deprecate( win, 'is_chrome_mac', false, msg );
-       mw.log.deprecate( win, 'is_chrome', false, msg );
-       mw.log.deprecate( win, 'webkit_version', false, msg );
-       mw.log.deprecate( win, 'is_safari_win', false, msg );
-       mw.log.deprecate( win, 'is_safari', false, msg );
-       mw.log.deprecate( win, 'webkit_match', false, msg );
-       mw.log.deprecate( win, 'is_ff2', false, msg );
-       mw.log.deprecate( win, 'ff2_bugs', false, msg );
-       mw.log.deprecate( win, 'is_ff2_win', false, msg );
-       mw.log.deprecate( win, 'is_ff2_x11', false, msg );
-       mw.log.deprecate( win, 'opera95_bugs', false, msg );
-       mw.log.deprecate( win, 'opera7_bugs', false, msg );
-       mw.log.deprecate( win, 'opera6_bugs', false, msg );
-       mw.log.deprecate( win, 'is_opera_95', false, msg );
-       mw.log.deprecate( win, 'is_opera_preseven', false, msg );
-       mw.log.deprecate( win, 'is_opera', false, msg );
-       mw.log.deprecate( win, 'ie6_bugs', false, msg );
+       function wikiUrlencode( page ) {
+               return encodeURIComponent( String( page ) )
+                       .replace( /'/g, '%27' )
+                       .replace( /%20/g, '_' )
+                       // wfUrlencode replacements
+                       .replace( /%3B/g, ';' )
+                       .replace( /%40/g, '@' )
+                       .replace( /%24/g, '$' )
+                       .replace( /%21/g, '!' )
+                       .replace( /%2A/g, '*' )
+                       .replace( /%28/g, '(' )
+                       .replace( /%29/g, ')' )
+                       .replace( /%2C/g, ',' )
+                       .replace( /%2F/g, '/' )
+                       .replace( /%7E/g, '~' )
+                       .replace( /%3A/g, ':' );
+       }
 
        /**
-        * DOM utilities for handling of events, text nodes and selecting elements
-        *
         * @deprecated since 1.17 Use jQuery instead
         */
-       msg = 'Use jQuery instead.';
-
-       // Ignored dummy values
-       mw.log.deprecate( win, 'doneOnloadHook', undefined, msg );
-       mw.log.deprecate( win, 'onloadFuncts', [], msg );
-       mw.log.deprecate( win, 'runOnloadHook', $.noop, msg );
-       mw.log.deprecate( win, 'changeText', $.noop, msg );
-       mw.log.deprecate( win, 'killEvt', $.noop, msg );
-       mw.log.deprecate( win, 'addHandler', $.noop, msg );
-       mw.log.deprecate( win, 'hookEvent', $.noop, msg );
-       mw.log.deprecate( win, 'addClickHandler', $.noop, msg );
-       mw.log.deprecate( win, 'removeHandler', $.noop, msg );
-       mw.log.deprecate( win, 'getElementsByClassName', function () { return []; }, msg );
-       mw.log.deprecate( win, 'getInnerText', function () { return ''; }, msg );
-
-       // Run a function after the window onload event is fired
-       mw.log.deprecate( win, 'addOnloadHook', function ( hookFunct ) {
-               if ( onloadFuncts ) {
-                       onloadFuncts.push( hookFunct );
-               } else {
-                       // If func queue is gone the event has happened already,
-                       // run immediately instead of queueing.
-                       hookFunct();
-               }
-       }, msg );
-
-       $( win ).on( 'load', function () {
-               var i, functs;
-
-               // Don't run twice
-               if ( !onloadFuncts ) {
-                       return;
-               }
-
-               // Deference and clear onloadFuncts before running any
-               // hooks to make sure we don't miss any addOnloadHook
-               // calls.
-               functs = onloadFuncts.slice();
-               onloadFuncts = undefined;
-
-               // Execute the queued functions
-               for ( i = 0; i < functs.length; i++ ) {
-                       functs[ i ]();
-               }
-       } );
-
-       /**
-        * Toggle checkboxes with shift selection
-        *
-        * @deprecated since 1.17 Use jquery.checkboxShiftClick instead
-        */
-       msg = 'Use jquery.checkboxShiftClick instead.';
-       mw.log.deprecate( win, 'checkboxes', [], msg );
-       mw.log.deprecate( win, 'lastCheckbox', null, msg );
-       mw.log.deprecate( win, 'setupCheckboxShiftClick', $.noop, msg );
-       mw.log.deprecate( win, 'addCheckboxClickHandlers', $.noop, msg );
-       mw.log.deprecate( win, 'checkboxClickHandler', $.noop, msg );
-
-       /**
-        * Add a button to the default editor toolbar
-        *
-        * @deprecated since 1.17 Use mw.toolbar instead
-        */
-       mw.log.deprecate( win, 'mwEditButtons', [], 'Use mw.toolbar instead.' );
-       mw.log.deprecate( win, 'mwCustomEditButtons', [], 'Use mw.toolbar instead.' );
-
-       /**
-        * Spinner creation, injection and removal
-        *
-        * @deprecated since 1.18 Use jquery.spinner instead
-        */
-       mw.log.deprecate( win, 'injectSpinner', $.noop, 'Use jquery.spinner instead.' );
-       mw.log.deprecate( win, 'removeSpinner', $.noop, 'Use jquery.spinner instead.' );
-
-       /**
-        * Escape utilities
-        *
-        * @deprecated since 1.18 Use mw.html instead
-        */
-       mw.log.deprecate( win, 'escapeQuotes', $.noop, 'Use mw.html instead.' );
-       mw.log.deprecate( win, 'escapeQuotesHTML', $.noop, 'Use mw.html instead.' );
-
-       /**
-        * Display a message to the user
-        *
-        * @deprecated since 1.17 Use mediawiki.notify instead
-        * @param {string|HTMLElement} message To be put inside the message box
-        */
-       mw.log.deprecate( win, 'jsMsg', function ( message ) {
-               if ( !arguments.length || message === '' || message === null ) {
-                       return true;
-               }
-               if ( typeof message !== 'object' ) {
-                       message = $.parseHTML( message );
-               }
-               mw.notify( message, { autoHide: true, tag: 'legacy' } );
-               return true;
-       }, 'Use mediawiki.notify instead.' );
-
-       /**
-        * Misc. utilities
-        *
-        * @deprecated since 1.17 Use mediawiki.util or jquery.accessKeyLabel instead
-        */
-       msg = 'Use mediawiki.util instead.';
-       mw.log.deprecate( win, 'addPortletLink', mw.util.addPortletLink, msg );
-       mw.log.deprecate( win, 'appendCSS', mw.util.addCSS, msg );
-       msg = 'Use jquery.accessKeyLabel instead.';
-       mw.log.deprecate( win, 'tooltipAccessKeyPrefix', 'alt-', msg );
-       mw.log.deprecate( win, 'tooltipAccessKeyRegexp', /\[(alt-)?(.)\]$/, msg );
-       // mw.util.updateTooltipAccessKeys already generates a deprecation message.
-       win.updateTooltipAccessKeys = function () {
-               return mw.util.updateTooltipAccessKeys.apply( null, arguments );
-       };
+       mw.log.deprecate( window, 'addOnloadHook', function ( fn ) {
+               $( function () { fn(); } );
+       }, 'Use jQuery instead.' );
 
        /**
         * Wikipage import methods
        }
 
        function importScript( page ) {
-               var uri = mw.config.get( 'wgScript' ) + '?title=' +
-                       mw.util.wikiUrlencode( page ) +
+               var uri = mw.config.get( 'wgScript' ) + '?title=' + wikiUrlencode( page ) +
                        '&action=raw&ctype=text/javascript';
                return importScriptURI( uri );
        }
        }
 
        function importStylesheet( page ) {
-               var uri = mw.config.get( 'wgScript' ) + '?title=' +
-                       mw.util.wikiUrlencode( page ) +
+               var uri = mw.config.get( 'wgScript' ) + '?title=' + wikiUrlencode( page ) +
                        '&action=raw&ctype=text/css';
                return importStylesheetURI( uri );
        }
 
        msg = 'Use mw.loader instead.';
-       mw.log.deprecate( win, 'loadedScripts', loadedScripts, msg );
-       mw.log.deprecate( win, 'importScriptURI', importScriptURI, msg );
-       mw.log.deprecate( win, 'importStylesheetURI', importStylesheetURI, msg );
+       mw.log.deprecate( window, 'loadedScripts', loadedScripts, msg );
+       mw.log.deprecate( window, 'importScriptURI', importScriptURI, msg );
+       mw.log.deprecate( window, 'importStylesheetURI', importStylesheetURI, msg );
        // Not quite deprecated yet.
-       win.importScript = importScript;
-       win.importStylesheet = importStylesheet;
+       window.importScript = importScript;
+       window.importStylesheet = importStylesheet;
 
-       // Replace document.write/writeln with basic html parsing that appends
-       // to the <body> to avoid blanking pages. Added JavaScript will not run.
+       /**
+        * Replace document.write/writeln with basic html parsing that appends
+        * to the <body> to avoid blanking pages. Added JavaScript will not run.
+        *
+        * @deprecated since 1.26
+        */
        $.each( [ 'write', 'writeln' ], function ( idx, method ) {
                mw.log.deprecate( document, method, function () {
                        $( 'body' ).append( $.parseHTML( Array.prototype.join.call( arguments, '' ) ) );