Jforrester has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/386029 )

Change subject: resources: Removed the deprecated 'jquery.badge' module
......................................................................

resources: Removed the deprecated 'jquery.badge' module

Bug: T178450
Change-Id: I4540e5959ea15323b1f54be51fbeea6ca3f35169
Depends-On: I78543abe412d04d61a05e76702cb7681d5fad61d
---
M RELEASE-NOTES-1.31
M resources/Resources.php
D resources/src/jquery/jquery.badge.css
D resources/src/jquery/jquery.badge.js
4 files changed, 1 insertion(+), 129 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/29/386029/1

diff --git a/RELEASE-NOTES-1.31 b/RELEASE-NOTES-1.31
index 3c22e78..e06f671 100644
--- a/RELEASE-NOTES-1.31
+++ b/RELEASE-NOTES-1.31
@@ -26,6 +26,7 @@
 * …
 
 ==== Removed and replaced external libraries ====
+* (T17845) The deprecated 'jquery.badge' module was removed.
 * …
 
 === Bug fixes in 1.31 ===
diff --git a/resources/Resources.php b/resources/Resources.php
index b4a3f2f..71b167a 100644
--- a/resources/Resources.php
+++ b/resources/Resources.php
@@ -164,12 +164,6 @@
                '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' ],
diff --git a/resources/src/jquery/jquery.badge.css 
b/resources/src/jquery/jquery.badge.css
deleted file mode 100644
index 1157c27..0000000
--- a/resources/src/jquery/jquery.badge.css
+++ /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
index 40b3baf..0000000
--- a/resources/src/jquery/jquery.badge.js
+++ /dev/null
@@ -1,88 +0,0 @@
-/*!
- * jQuery Badge plugin
- *
- * @license MIT
- *
- * @author Ryan Kaldari <rkald...@wikimedia.org>, 2012
- * @author Andrew Garrett <agarr...@wikimedia.org>, 2012
- * @author Marius Hoch <h...@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 ) );

-- 
To view, visit https://gerrit.wikimedia.org/r/386029
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4540e5959ea15323b1f54be51fbeea6ca3f35169
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Jforrester <jforres...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to