Remove the mediawiki.api.titleblacklist module
authorAlex Monk <krenair@gmail.com>
Sun, 3 Mar 2013 22:51:27 +0000 (22:51 +0000)
committerTimo Tijhof <ttijhof@wikimedia.org>
Thu, 7 Mar 2013 08:10:34 +0000 (09:10 +0100)
Moved to the TitleBlacklist extension in I5bf7064a.

Bug: 38244
Change-Id: Ia595085371615da057aaa358d76929916a3e2186

RELEASE-NOTES-1.21
resources/Resources.php
resources/mediawiki.api/mediawiki.api.titleblacklist.js [deleted file]

index 26a7d07..bda9254 100644 (file)
@@ -295,13 +295,21 @@ changes to languages because of Bugzilla reports.
   Vector extension (and possibly disable its features using config settings if
   you don't want them).
 * Experimental IBM DB2 support was removed due to lack of interest and maintainership
-* BREAKING CHANGE: Filenames of maintenance scripts were standardized into lowerCamelCase
-  format, and made more explicit: clear_stats.php -> clearCacheStats.php; 
-  clear_interwiki_cache.php -> clearInterwikiCache.php; initStats.php -> initSiteStats.php;
-  proxy_check.php -> proxyCheck.php; stats.php -> showCacheStats.php;
-  showStats.php -> showSiteStats.php. Class names were renamed accordingly:
-  clear_stats -> ClearCacheStats; InitStats -> InitSiteStats; CacheStats -> ShowCacheStats
-  ShowStats -> ShowSiteStats.
+* BREAKING CHANGE: Filenames of maintenance scripts were standardized into
+  lowerCamelCase format, and made more explicit:
+  - clear_stats.php -> clearCacheStats.php
+  - clear_interwiki_cache.php -> clearInterwikiCache.php
+  - initStats.php -> initSiteStats.php
+  - proxy_check.php -> proxyCheck.php
+  - stats.php -> showCacheStats.php
+  - showStats.php -> showSiteStats.php.
+  Class names were renamed accordingly:
+  - clear_stats -> ClearCacheStats
+  - InitStats -> InitSiteStats
+  - CacheStats -> ShowCacheStats
+  - ShowStats -> ShowSiteStats.
+* BREAKING CHANGE: (bug 38244) Removed the mediawiki.api.titleblacklist module
+  and moved it to the TitleBlacklist extension.
 
 == Compatibility ==
 
index d40e845..10689cd 100644 (file)
@@ -595,13 +595,6 @@ return array(
                'scripts' => 'resources/mediawiki.api/mediawiki.api.parse.js',
                'dependencies' => 'mediawiki.api',
        ),
-       'mediawiki.api.titleblacklist' => array(
-               'scripts' => 'resources/mediawiki.api/mediawiki.api.titleblacklist.js',
-               'dependencies' => array(
-                       'mediawiki.api',
-                       'mediawiki.Title',
-               ),
-       ),
        'mediawiki.api.watch' => array(
                'scripts' => 'resources/mediawiki.api/mediawiki.api.watch.js',
                'dependencies' => array(
diff --git a/resources/mediawiki.api/mediawiki.api.titleblacklist.js b/resources/mediawiki.api/mediawiki.api.titleblacklist.js
deleted file mode 100644 (file)
index 8c46717..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/**
- * @class mw.Api.plugin.titleblacklist
- */
-( function ( mw, $ ) {
-
-       $.extend( mw.Api.prototype, {
-               /**
-                * Convinience method for `action=titleblacklist`.
-                * Note: This action is not provided by MediaWiki core, but as part of the TitleBlacklist extension.
-                *
-                * @param {mw.Title|string} title
-                * @param {Function} [ok] Success callback (deprecated)
-                * @param {Function} [err] Error callback (deprecated)
-                * @return {jQuery.Promise}
-                * @return {Function} return.done
-                * @return {Object|boolean} return.done.result False if title wasn't blacklisted, an object with 'reason', 'line'
-                *  and 'message' properties if title was blacklisted.
-                */
-               isBlacklisted: function ( title, ok, err ) {
-                       var d = $.Deferred();
-                       // Backwards compatibility (< MW 1.20)
-                       d.done( ok );
-                       d.fail( err );
-
-                       this.get( {
-                                       action: 'titleblacklist',
-                                       tbaction: 'create',
-                                       tbtitle: title.toString()
-                               } )
-                               .done( function ( data ) {
-                                       var result;
-
-                                       // this fails open (if nothing valid is returned by the api, allows the title)
-                                       // also fails open when the API is not present, which will be most of the time
-                                       // as this API module is part of the TitleBlacklist extension.
-                                       if ( data.titleblacklist && data.titleblacklist.result && data.titleblacklist.result === 'blacklisted' ) {
-                                               if ( data.titleblacklist.reason ) {
-                                                       result = {
-                                                               reason: data.titleblacklist.reason,
-                                                               line: data.titleblacklist.line,
-                                                               message: data.titleblacklist.message
-                                                       };
-                                               } else {
-                                                       mw.log( 'mw.Api.titleblacklist::isBlacklisted> no reason data for blacklisted title', 'debug' );
-                                                       result = {
-                                                               reason: 'Blacklisted, but no reason supplied',
-                                                               line: 'Unknown',
-                                                               message: null
-                                                       };
-                                               }
-                                               d.resolve( result );
-                                       } else {
-                                               d.resolve( false );
-                                       }
-                               } )
-                               .fail( d.reject );
-
-                       return d.promise();
-               }
-
-       } );
-
-       /**
-        * @class mw.Api
-        * @mixins mw.Api.plugin.titleblacklist
-        */
-
-}( mediaWiki, jQuery ) );