mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Popups
synced 2024-11-23 23:24:39 +00:00
Hygiene: Rename builder vars on require preview/model
preview/model is just a module/namespace object, not a builder class or similar. This patch changes a couple of imports to reference some of the exposed functions of the preview/model where required. In a shiny future, this pattern would be: const { createModel, createNullModel } = require( '../preview/model' ) Bug: T165018 Change-Id: If6ad4611538ca4f24e2443c0c3ed433275e995a6
This commit is contained in:
parent
010a4d91a6
commit
98d9415361
BIN
resources/dist/index.js
vendored
BIN
resources/dist/index.js
vendored
Binary file not shown.
BIN
resources/dist/index.js.map
vendored
BIN
resources/dist/index.js.map
vendored
Binary file not shown.
|
@ -13,7 +13,7 @@
|
|||
//
|
||||
// FIXME: Move this to src/constants.js.
|
||||
var CACHE_LIFETIME = 300,
|
||||
modelBuilder = require( '../preview/model' ),
|
||||
createModel = require( '../preview/model' ).createModel,
|
||||
formatter = require( '../formatter' ),
|
||||
$ = jQuery;
|
||||
|
||||
|
@ -129,7 +129,7 @@ function formatPlainTextExtract( data ) {
|
|||
* @returns {PreviewModel}
|
||||
*/
|
||||
function convertPageToModel( page ) {
|
||||
return modelBuilder.createModel(
|
||||
return createModel(
|
||||
page.title,
|
||||
page.canonicalurl,
|
||||
page.pagelanguagehtmlcode,
|
||||
|
|
|
@ -4,7 +4,9 @@
|
|||
|
||||
var RESTBASE_ENDPOINT = '/api/rest_v1/page/summary/',
|
||||
RESTBASE_PROFILE = 'https://www.mediawiki.org/wiki/Specs/Summary/1.2.0',
|
||||
modelBuilder = require( '../preview/model' ),
|
||||
model = require( '../preview/model' ),
|
||||
createModel = model.createModel,
|
||||
createNullModel = model.createNullModel,
|
||||
mw = window.mediaWiki,
|
||||
$ = jQuery;
|
||||
/**
|
||||
|
@ -65,7 +67,7 @@ module.exports = function createRESTBaseGateway( ajax, config, extractParser ) {
|
|||
if ( jqXHR.status === 404 ) {
|
||||
|
||||
result.resolve(
|
||||
modelBuilder.createNullModel( title )
|
||||
createNullModel( title )
|
||||
);
|
||||
} else {
|
||||
result.reject();
|
||||
|
@ -147,7 +149,7 @@ function generateThumbnailData( thumbnail, original, thumbSize ) {
|
|||
* @returns {PreviewModel}
|
||||
*/
|
||||
function convertPageToModel( page, thumbSize, extractParser ) {
|
||||
return modelBuilder.createModel(
|
||||
return createModel(
|
||||
page.title,
|
||||
new mw.Title( page.title ).getUrl(),
|
||||
page.lang,
|
||||
|
|
Loading…
Reference in a new issue