Ricordisamoa has uploaded a new change for review. https://gerrit.wikimedia.org/r/274010
Change subject: build: Enable jscs rule 'requireVarDeclFirst' and make pass ...................................................................... build: Enable jscs rule 'requireVarDeclFirst' and make pass Change-Id: Id1581858e59ea5f49804b6cf753b0c2860fb9855 --- M .jscsrc M modules/logger/mw.echo.Logger.js M modules/viewmodel/mw.echo.dm.NotificationGroupItem.js M tests/qunit/overlay/test_ext.echo.overlay.js 4 files changed, 8 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo refs/changes/10/274010/1 diff --git a/.jscsrc b/.jscsrc index f9e389f..9a9fe01 100644 --- a/.jscsrc +++ b/.jscsrc @@ -1,7 +1,6 @@ { "preset": "wikimedia", "disallowDanglingUnderscores": null, - "requireVarDeclFirst": null, "jsDoc": { "checkAnnotations": { "preset": "jsduck5", diff --git a/modules/logger/mw.echo.Logger.js b/modules/logger/mw.echo.Logger.js index 3e1e936..0eaf01c 100644 --- a/modules/logger/mw.echo.Logger.js +++ b/modules/logger/mw.echo.Logger.js @@ -91,11 +91,13 @@ * @param {string} [notifWiki] Wiki the notification came from */ mw.echo.Logger.prototype.logInteraction = function ( action, context, eventId, eventType, mobile, notifWiki ) { + var myEvt; + if ( !this.constructor.static.clickThroughEnabled ) { return; } - var myEvt = { + myEvt = { action: action }; diff --git a/modules/viewmodel/mw.echo.dm.NotificationGroupItem.js b/modules/viewmodel/mw.echo.dm.NotificationGroupItem.js index 2cb0243..d48d3da 100644 --- a/modules/viewmodel/mw.echo.dm.NotificationGroupItem.js +++ b/modules/viewmodel/mw.echo.dm.NotificationGroupItem.js @@ -224,10 +224,11 @@ * @return {number} count */ mw.echo.dm.NotificationGroupItem.prototype.getCount = function () { + var sum; if ( this.anticipatedCount !== null ) { return this.anticipatedCount; } - var sum = 0; + sum = 0; this.getItems().forEach( function ( notificationsModel ) { sum += notificationsModel.getUnreadCount(); } ); diff --git a/tests/qunit/overlay/test_ext.echo.overlay.js b/tests/qunit/overlay/test_ext.echo.overlay.js index dd4696d..6afb250 100644 --- a/tests/qunit/overlay/test_ext.echo.overlay.js +++ b/tests/qunit/overlay/test_ext.echo.overlay.js @@ -1,12 +1,14 @@ ( function ( $, mw ) { QUnit.module( 'ext.echo.overlay', { setup: function () { + var ApiStub; + this.$badge = $( '<a class="mw-echo-notifications-badge mw-echo-unseen-notifications">1</a>' ); this.sandbox.stub( mw.echo, 'getBadge' ).returns( this.$badge ); // Kill any existing overlays to avoid clashing with other tests $( '.mw-echo-overlay' ).remove(); - var ApiStub = function ( mode, numberUnreadMessages ) { + ApiStub = function ( mode, numberUnreadMessages ) { this.mode = mode; this.numberUnreadMessages = numberUnreadMessages || 7; }; -- To view, visit https://gerrit.wikimedia.org/r/274010 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id1581858e59ea5f49804b6cf753b0c2860fb9855 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Echo Gerrit-Branch: master Gerrit-Owner: Ricordisamoa <ricordisa...@openmailbox.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits