Jdlrobson has uploaded a new change for review.
https://gerrit.wikimedia.org/r/182290
Change subject: Hygiene: Move isTestA to Schema
......................................................................
Hygiene: Move isTestA to Schema
isTestA should be tied to EventLogging
Change-Id: I6f0d5881d17307425c46f248e0697a2e3e400d91
---
M javascripts/Schema.js
M javascripts/application.js
M javascripts/loggingSchemas/SchemaMobileWebEditing.js
3 files changed, 12 insertions(+), 8 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend
refs/changes/90/182290/1
diff --git a/javascripts/Schema.js b/javascripts/Schema.js
index daf65e2..629a31d 100644
--- a/javascripts/Schema.js
+++ b/javascripts/Schema.js
@@ -80,6 +80,16 @@
return sessionId;
};
+ /**
+ * User Bucketing for A/B testing
+ ** (we want this to be the same everywhere)
+ * @static
+ * @return {Boolean}
+ */
+ Schema.isTestA = function () {
+ return mw.config.get( 'wgUserId' ) % 2 === 0;
+ };
+
M.define( 'Schema', Schema );
}( mw.mobileFrontend, jQuery ) );
diff --git a/javascripts/application.js b/javascripts/application.js
index 6066ae2..a02c2eb 100644
--- a/javascripts/application.js
+++ b/javascripts/application.js
@@ -133,13 +133,7 @@
* PageApi instance
* @type {PageApi}
*/
- pageApi: pageApi,
- /**
- * User Bucketing for A/B testing
- ** (we want this to be the same everywhere)
- * @type {Boolean}
- */
- isTestA: mw.config.get( 'wgUserId' ) % 2 === 0
+ pageApi: pageApi
} );
// Initialize
diff --git a/javascripts/loggingSchemas/SchemaMobileWebEditing.js
b/javascripts/loggingSchemas/SchemaMobileWebEditing.js
index 4859fb2..e7fd574 100644
--- a/javascripts/loggingSchemas/SchemaMobileWebEditing.js
+++ b/javascripts/loggingSchemas/SchemaMobileWebEditing.js
@@ -16,7 +16,7 @@
token: Schema.getSessionId(),
revId: mw.config.get( 'wgRevisionId' ),
namespace: mw.config.get( 'wgNamespaceNumber' ),
- isTestA: M.isTestA,
+ isTestA: Schema.isTestA(),
// FIXME: Introduce a SchemaWithUser class that has
username and userEditCount
username: user.getName() || '',
userEditCount: user.getEditCount() || 0
--
To view, visit https://gerrit.wikimedia.org/r/182290
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6f0d5881d17307425c46f248e0697a2e3e400d91
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits