Jdlrobson has uploaded a new change for review.

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

Change subject: Hygiene: Make schema MobileFrontend agnostic
......................................................................

Hygiene: Make schema MobileFrontend agnostic

Gather uses Schema but since it works outside MobileFrontend in Vector
wgMFMode is not available

Change-Id: I0554b6a0daecfc4d72ba0c6f886ec0574dc76105
---
M javascripts/Schema.js
M javascripts/loggingSchemas/SchemaMobileWebClickTracking.js
M javascripts/loggingSchemas/SchemaMobileWebEditing.js
M javascripts/loggingSchemas/SchemaMobileWebUploads.js
4 files changed, 11 insertions(+), 4 deletions(-)


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

diff --git a/javascripts/Schema.js b/javascripts/Schema.js
index 4cd909c..1182b60 100644
--- a/javascripts/Schema.js
+++ b/javascripts/Schema.js
@@ -1,7 +1,6 @@
 ( function ( M, $ ) {
        var Schema,
                Class = M.require( 'Class' ),
-               context = M.require( 'context' ),
                user = M.require( 'user' );
 
        /**
@@ -15,9 +14,7 @@
                 * @cfg {Object} defaults Default options hash.
                 * @cfg {String} defaults.mobileMode whether user is in stable 
beta or alpha
                 */
-               defaults: {
-                       mobileMode: context.getMode()
-               },
+               defaults: {},
                /**
                 * Whether or not the logging is sampled (i.e. not recorded at 
100% frequency)
                 * @property {Boolean}
diff --git a/javascripts/loggingSchemas/SchemaMobileWebClickTracking.js 
b/javascripts/loggingSchemas/SchemaMobileWebClickTracking.js
index 81f0fbc..b79232f 100644
--- a/javascripts/loggingSchemas/SchemaMobileWebClickTracking.js
+++ b/javascripts/loggingSchemas/SchemaMobileWebClickTracking.js
@@ -1,6 +1,7 @@
 ( function ( M, $ ) {
        var SchemaMobileWebClickTracking,
                Schema = M.require( 'Schema' ),
+               context = M.require( 'context' ),
                user = M.require( 'user' ),
                s = M.require( 'settings' );
 
@@ -65,6 +66,7 @@
                defaults: $.extend( {}, Schema.prototype.defaults, {
                        // FIXME: Introduce a SchemaWithUser class that has 
username and userEditCount
                        username: user.getName() || undefined,
+                       mobileMode: context.getMode(),
                        userEditCount: typeof user.getEditCount() === 'number' 
? user.getEditCount() : undefined
                } ),
                /**
diff --git a/javascripts/loggingSchemas/SchemaMobileWebEditing.js 
b/javascripts/loggingSchemas/SchemaMobileWebEditing.js
index 4e87362..5ba6f4e 100644
--- a/javascripts/loggingSchemas/SchemaMobileWebEditing.js
+++ b/javascripts/loggingSchemas/SchemaMobileWebEditing.js
@@ -1,6 +1,7 @@
 ( function ( M, $ ) {
        var SchemaMobileWebEditing,
                user = M.require( 'user' ),
+               context = M.require( 'context' ),
                Schema = M.require( 'Schema' );
 
        /**
@@ -10,6 +11,9 @@
        SchemaMobileWebEditing = Schema.extend( {
                /** @inheritdoc **/
                name: 'MobileWebEditing',
+               defaults: {
+                       mobileMode: context.getMode()
+               },
                /**
                 * @inheritdoc
                 *
diff --git a/javascripts/loggingSchemas/SchemaMobileWebUploads.js 
b/javascripts/loggingSchemas/SchemaMobileWebUploads.js
index 466c342..00ed211 100644
--- a/javascripts/loggingSchemas/SchemaMobileWebUploads.js
+++ b/javascripts/loggingSchemas/SchemaMobileWebUploads.js
@@ -2,6 +2,7 @@
        var SchemaMobileWebUploads,
                user = M.require( 'user' ),
                page = M.getCurrentPage(),
+               context = M.require( 'context' ),
                Schema = M.require( 'Schema' );
 
        /**
@@ -11,6 +12,9 @@
        SchemaMobileWebUploads = Schema.extend( {
                /** @inheritdoc **/
                name: 'MobileWebUploads',
+               defaults: {
+                       mobileMode: context.getMode()
+               },
                /**
                 * @inheritdoc
                 *

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0554b6a0daecfc4d72ba0c6f886ec0574dc76105
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