Robmoen has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/174866

Change subject: Upstream icons to Mantle extension
......................................................................

Upstream icons to Mantle extension

Change-Id: I0e127c33a83f781b654628a3a79f3886b0ce21f5
---
M includes/Resources.php
D javascripts/Icon.js
D javascripts/icons.js
3 files changed, 1 insertion(+), 90 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/66/174866/1

diff --git a/includes/Resources.php b/includes/Resources.php
index 3a90e75..b6137ca 100644
--- a/includes/Resources.php
+++ b/includes/Resources.php
@@ -149,9 +149,9 @@
                        'mediawiki.api',
                        'mobile.redlinks',
                        'ext.mantle.views',
+                       'ext.mantle.icons',
                ),
                'templates' => array(
-                       'icon.hogan' => 'templates/icon.hogan',
                        'Section.hogan' => 'templates/Section.hogan',
                ),
                'scripts' => array(
@@ -160,8 +160,6 @@
                        // FIXME: Remove api code to mobile.ajax
                        'javascripts/api.js',
                        'javascripts/PageApi.js',
-                       'javascripts/Icon.js',
-                       'javascripts/icons.js',
                        'javascripts/Panel.js',
                        'javascripts/Section.js',
                        'javascripts/Page.js',
diff --git a/javascripts/Icon.js b/javascripts/Icon.js
deleted file mode 100644
index e239526..0000000
--- a/javascripts/Icon.js
+++ /dev/null
@@ -1,51 +0,0 @@
-( function ( M ) {
-
-       var View = M.require( 'View' ),
-               useMediaWikiUI = M.isAlphaGroupMember(),
-               Icon;
-
-       /**
-        * A wrapper for creating an icon.
-        * @class Icon
-        * @extends View
-        */
-       Icon = View.extend( {
-               defaults: {
-                       hasText: false,
-                       tagName: 'div',
-                       base: useMediaWikiUI ? 'mw-ui-icon' : 'icon',
-                       name: '',
-                       modifier: useMediaWikiUI ? 'mw-ui-icon-element' : '',
-                       title: ''
-               },
-               /**
-                * Return the full class name that is required for the icon to 
render
-                * @method
-                * @return {string}
-                */
-               getClassName: function () {
-                       return this.$el.children( 0 ).attr( 'class' );
-               },
-               /**
-                * Return the class that relates to the icon glyph
-                * @method
-                * @return {string}
-                */
-               getGlyphClassName: function () {
-                       return this.options.base + '-' + this.options.name;
-               },
-               initialize: function ( options ) {
-                       if ( options.hasText ) {
-                               options.modifier = useMediaWikiUI ? 
'mw-ui-icon-before' : 'icon-text';
-                       }
-                       View.prototype.initialize.call( this, options );
-               },
-               toHtmlString: function () {
-                       return this.$el.html();
-               },
-               template: mw.template.get( 'mobile.startup', 'icon.hogan' )
-       } );
-
-       M.define( 'Icon', Icon );
-
-}( mw.mobileFrontend ) );
diff --git a/javascripts/icons.js b/javascripts/icons.js
deleted file mode 100644
index 1b38104..0000000
--- a/javascripts/icons.js
+++ /dev/null
@@ -1,36 +0,0 @@
-( function ( M, $ ) {
-
-       var Icon = M.require( 'Icon' );
-
-       /**
-        * A set of shared icons.
-        *
-        * Factory methods are used to keep separate features that use the same 
icons
-        * from accidentally manipulating one another's DOM when calling 
methods like
-        * `remove`.
-        *
-        * @class icons
-        * @singleton
-        */
-       M.define( 'icons', {
-
-               /**
-                * Gets a spinner icon.
-                *
-                * The icon should be used to inform the user that the 
front-end is
-                * communicating with the back-end.
-                *
-                * @param {Object} options See `Icon` for more details
-                * @return {Icon}
-                */
-               spinner: function ( options ) {
-                       options = options || {};
-
-                       return new Icon( $.extend( options, {
-                               name: 'spinner',
-                               additionalClassNames: 'spinner loading'
-                       } ) );
-               }
-       } );
-
-}( mw.mobileFrontend, jQuery ) );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0e127c33a83f781b654628a3a79f3886b0ce21f5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Robmoen <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to