From a1789ddde42033f1b05cc4929491214ee6e79383 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Thu, 17 Dec 2015 09:15:42 +0100 Subject: Update to MediaWiki 1.26.0 --- .../mediawiki.messagePoster.factory.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'resources/src/mediawiki.messagePoster/mediawiki.messagePoster.factory.js') diff --git a/resources/src/mediawiki.messagePoster/mediawiki.messagePoster.factory.js b/resources/src/mediawiki.messagePoster/mediawiki.messagePoster.factory.js index 9d280800..6f9aa025 100644 --- a/resources/src/mediawiki.messagePoster/mediawiki.messagePoster.factory.js +++ b/resources/src/mediawiki.messagePoster/mediawiki.messagePoster.factory.js @@ -24,11 +24,11 @@ * @param {Function} messagePosterConstructor Constructor for MessagePoster */ MwMessagePosterFactory.prototype.register = function ( contentModel, messagePosterConstructor ) { - if ( this.contentModelToClass[contentModel] !== undefined ) { + if ( this.contentModelToClass[ contentModel ] !== undefined ) { throw new Error( 'The content model \'' + contentModel + '\' is already registered.' ); } - this.contentModelToClass[contentModel] = messagePosterConstructor; + this.contentModelToClass[ contentModel ] = messagePosterConstructor; }; /** @@ -38,7 +38,7 @@ * @param {string} contentModel Content model to unregister */ MwMessagePosterFactory.prototype.unregister = function ( contentModel ) { - delete this.contentModelToClass[contentModel]; + delete this.contentModelToClass[ contentModel ]; }; /** @@ -67,9 +67,9 @@ indexpageids: 1, titles: title.getPrefixedDb() } ).then( function ( result ) { - if ( result.query.pageids.length > 0 ) { - pageId = result.query.pageids[0]; - page = result.query.pages[pageId]; + if ( result.query.pageids && result.query.pageids.length > 0 ) { + pageId = result.query.pageids[ 0 ]; + page = result.query.pages[ pageId ]; contentModel = page.contentmodel; moduleName = 'mediawiki.messagePoster.' + contentModel; @@ -100,7 +100,7 @@ * */ MwMessagePosterFactory.prototype.createForContentModel = function ( contentModel, title ) { - return new this.contentModelToClass[contentModel]( title ); + return new this.contentModelToClass[ contentModel ]( title ); }; mw.messagePoster = { -- cgit v1.2.3-54-g00ecf