Jdlrobson has uploaded a new change for review.

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

Change subject: Hygiene: Remove the class code
......................................................................

Hygiene: Remove the class code

Have a single library oo-extend inside mobile.oo
now we are using the OO simplified way of doing things.

Change-Id: Ie8a815a0230ca81185c3d9acd138bac1934f408d
---
M includes/Resources.php
D resources/mobile.oo/Class.js
A resources/mobile.oo/oo-extend.js
3 files changed, 25 insertions(+), 71 deletions(-)


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

diff --git a/includes/Resources.php b/includes/Resources.php
index 4ab904a..34e182b 100644
--- a/includes/Resources.php
+++ b/includes/Resources.php
@@ -185,7 +185,7 @@
                        'oojs',
                ),
                'scripts' => array(
-                       'resources/mobile.oo/Class.js',
+                       'resources/mobile.oo/oo-extend.js',
                ),
        ),
        'mobile.view' => $wgMFResourceFileModuleBoilerplate + array(
diff --git a/resources/mobile.oo/Class.js b/resources/mobile.oo/Class.js
deleted file mode 100644
index 0d7b51c..0000000
--- a/resources/mobile.oo/Class.js
+++ /dev/null
@@ -1,70 +0,0 @@
-( function ( M ) {
-       /**
-        * Extends a class with new methods and member properties.
-        *
-        * @param {Function} Child function
-        * @param {Object|Function} ParentOrPrototype class to inherit from OR 
if no inheriting class a prototype to
-        *  extend the class with,
-        * @param {Object} prototype
-        * @member OO
-        */
-       OO.mfExtend = function ( Child, ParentOrPrototype, prototype ) {
-               var key;
-               if ( prototype ) {
-                       OO.inheritClass( Child, ParentOrPrototype );
-               } else {
-                       OO.initClass( Class );
-                       prototype = ParentOrPrototype;
-               }
-               for ( key in prototype ) {
-                       Child.prototype[key] = prototype[key];
-               }
-       };
-
-       /**
-        * Extends a class with new methods and member properties.
-        *
-        * @member Class
-        * @param {Object} prototype Prototype that should be incorporated into 
the new Class.
-        * @method
-        * @return {Class}
-        */
-       function extend( prototype ) {
-               var Parent = this;
-
-               /**
-                * @ignore
-                */
-               function Child() {
-                       return Parent.apply( this, arguments );
-               }
-               OO.mfExtend( Child, Parent, prototype );
-               Child.extend = extend;
-               return Child;
-       }
-
-       /**
-        * An extensible program-code-template for creating objects
-        *
-        * @class Class
-        */
-       function Class() {
-               OO.EventEmitter.call( this );
-               this.initialize.apply( this, arguments );
-       }
-       OO.mixinClass( Class, OO.EventEmitter );
-
-       /**
-        * Constructor, if you override it, use _super().
-        * @method
-        */
-       Class.prototype.initialize = function () {};
-       Class.extend = extend;
-       mw.log.deprecate( Class, 'extend', extend,
-               'Class is deprecated. Do not use this. Use OO.mfExtend' );
-
-       M.define( 'mobile.oo/Class', Class );
-       M.deprecate( 'Class', Class,
-               'OO.initClass, OO.inheritClass or OO.extendClass to create a 
class' );
-
-}( mw.mobileFrontend ) );
diff --git a/resources/mobile.oo/oo-extend.js b/resources/mobile.oo/oo-extend.js
new file mode 100644
index 0000000..e8872ba
--- /dev/null
+++ b/resources/mobile.oo/oo-extend.js
@@ -0,0 +1,24 @@
+( function ( M ) {
+       /**
+        * Extends a class with new methods and member properties.
+        *
+        * @param {Function} Child function
+        * @param {Object|Function} ParentOrPrototype class to inherit from OR 
if no inheriting class a prototype to
+        *  extend the class with,
+        * @param {Object} prototype
+        * @member OO
+        */
+       OO.mfExtend = function ( Child, ParentOrPrototype, prototype ) {
+               var key;
+               if ( prototype ) {
+                       OO.inheritClass( Child, ParentOrPrototype );
+               } else {
+                       OO.initClass( Child );
+                       prototype = ParentOrPrototype;
+               }
+               for ( key in prototype ) {
+                       Child.prototype[key] = prototype[key];
+               }
+       };
+
+}( mw.mobileFrontend ) );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie8a815a0230ca81185c3d9acd138bac1934f408d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <jrob...@wikimedia.org>

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

Reply via email to