resources: Remove the deprecated 'jquery.badge' module
authorJames D. Forrester <jforrester@wikimedia.org>
Mon, 23 Oct 2017 17:52:33 +0000 (10:52 -0700)
committerJforrester <jforrester@wikimedia.org>
Wed, 25 Oct 2017 21:10:57 +0000 (21:10 +0000)
Bug: T178450
Change-Id: I4540e5959ea15323b1f54be51fbeea6ca3f35169
Depends-On: I78543abe412d04d61a05e76702cb7681d5fad61d

RELEASE-NOTES-1.31
jsduck.json
resources/Resources.php
resources/src/jquery/jquery.badge.css [deleted file]
resources/src/jquery/jquery.badge.js [deleted file]

index 042af6e..86d887b 100644 (file)
@@ -28,6 +28,7 @@ production.
 * …
 
 ==== Removed and replaced external libraries ====
 * …
 
 ==== Removed and replaced external libraries ====
+* (T17845) The deprecated 'jquery.badge' module was removed.
 * …
 
 === Bug fixes in 1.31 ===
 * …
 
 === Bug fixes in 1.31 ===
index 7e59432..0f8daf8 100644 (file)
@@ -22,7 +22,6 @@
                "resources/src/mediawiki.widgets",
                "resources/src/jquery/jquery.accessKeyLabel.js",
                "resources/src/jquery/jquery.autoEllipsis.js",
                "resources/src/mediawiki.widgets",
                "resources/src/jquery/jquery.accessKeyLabel.js",
                "resources/src/jquery/jquery.autoEllipsis.js",
-               "resources/src/jquery/jquery.badge.js",
                "resources/src/jquery/jquery.byteLength.js",
                "resources/src/jquery/jquery.byteLimit.js",
                "resources/src/jquery/jquery.checkboxShiftClick.js",
                "resources/src/jquery/jquery.byteLength.js",
                "resources/src/jquery/jquery.byteLimit.js",
                "resources/src/jquery/jquery.checkboxShiftClick.js",
index b9986fe..ca24922 100644 (file)
@@ -164,12 +164,6 @@ return [
                'dependencies' => 'jquery.highlightText',
                'targets' => [ 'desktop', 'mobile' ],
        ],
                'dependencies' => 'jquery.highlightText',
                'targets' => [ 'desktop', 'mobile' ],
        ],
-       'jquery.badge' => [
-               'deprecated' => 'Please use Notifications instead.',
-               'scripts' => 'resources/src/jquery/jquery.badge.js',
-               'styles' => 'resources/src/jquery/jquery.badge.css',
-               'dependencies' => 'mediawiki.language',
-       ],
        'jquery.byteLength' => [
                'scripts' => 'resources/src/jquery/jquery.byteLength.js',
                'targets' => [ 'desktop', 'mobile' ],
        'jquery.byteLength' => [
                'scripts' => 'resources/src/jquery/jquery.byteLength.js',
                'targets' => [ 'desktop', 'mobile' ],
diff --git a/resources/src/jquery/jquery.badge.css b/resources/src/jquery/jquery.badge.css
deleted file mode 100644 (file)
index 1157c27..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-.mw-badge {
-       background-color: #72777d;
-       min-width: 7px;
-       border-radius: 2px;
-       padding: 1px 4px;
-       text-align: center;
-       font-size: 12px;
-       line-height: 12px;
-       cursor: pointer;
-}
-
-.mw-badge-content {
-       font-weight: bold;
-       color: #fff;
-       vertical-align: baseline;
-}
-
-.mw-badge-inline {
-       margin-left: 3px;
-       display: inline-block;
-       /* Hack for IE6 and IE7 (T49926) */
-       zoom: 1;
-       *display: inline; /* stylelint-disable-line declaration-block-no-duplicate-properties */
-
-}
-.mw-badge-overlay {
-       position: absolute;
-       bottom: -1px;
-       right: -3px;
-       z-index: 50;
-}
-
-.mw-badge-important {
-       background-color: #d33;
-}
diff --git a/resources/src/jquery/jquery.badge.js b/resources/src/jquery/jquery.badge.js
deleted file mode 100644 (file)
index 40b3baf..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-/*!
- * jQuery Badge plugin
- *
- * @license MIT
- *
- * @author Ryan Kaldari <rkaldari@wikimedia.org>, 2012
- * @author Andrew Garrett <agarrett@wikimedia.org>, 2012
- * @author Marius Hoch <hoo@online.de>, 2012
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * This program is distributed WITHOUT ANY WARRANTY.
- */
-
-/**
- * @class jQuery.plugin.badge
- */
-( function ( $, mw ) {
-       /**
-        * Put a badge on an item on the page. The badge container will be appended to the selected element(s).
-        *
-        *     $element.badge( text );
-        *     $element.badge( 5 );
-        *     $element.badge( '100+' );
-        *     $element.badge( text, inline );
-        *     $element.badge( 'New', true );
-        *
-        * @param {number|string} text The value to display in the badge. If the value is falsey (0,
-        *  null, false, '', etc.), any existing badge will be removed.
-        * @param {boolean} [inline=true] True if the badge should be displayed inline, false
-        *  if the badge should overlay the parent element.
-        * @param {boolean} [displayZero=false] True if the number zero should be displayed,
-        *  false if the number zero should result in the badge being hidden
-        * @return {jQuery}
-        * @chainable
-        */
-       $.fn.badge = function ( text, inline, displayZero ) {
-               var $badge = this.find( '.mw-badge' ),
-                       badgeStyleClass = 'mw-badge-' + ( inline ? 'inline' : 'overlay' ),
-                       isImportant = true,
-                       displayBadge = true;
-
-               // If we're displaying zero, ensure style to be non-important
-               if ( mw.language.convertNumber( text, true ) === 0 ) {
-                       isImportant = false;
-                       if ( !displayZero ) {
-                               displayBadge = false;
-                       }
-               // If text is falsey (besides 0), hide the badge
-               } else if ( !text ) {
-                       displayBadge = false;
-               }
-
-               if ( displayBadge ) {
-                       // If a badge already exists, reuse it
-                       if ( $badge.length ) {
-                               $badge
-                                       .toggleClass( 'mw-badge-important', isImportant )
-                                       .find( '.mw-badge-content' ).text( text );
-                       } else {
-                               // Otherwise, create a new badge with the specified text and style
-                               $badge = $( '<div class="mw-badge"></div>' )
-                                       .addClass( badgeStyleClass )
-                                       .toggleClass( 'mw-badge-important', isImportant )
-                                       .append(
-                                               $( '<span class="mw-badge-content"></span>' ).text( text )
-                                       )
-                                       .appendTo( this );
-                       }
-               } else {
-                       $badge.remove();
-               }
-               return this;
-       };
-
-       /**
-        * @class jQuery
-        * @mixins jQuery.plugin.badge
-        */
-}( jQuery, mediaWiki ) );