mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Popups
synced 2024-11-24 07:34:11 +00:00
Model should capture page id
We're going to need this for logging page views. Change-Id: I1fc46a9fab54f512edaf5feb5abbaa4f025dcb4a
This commit is contained in:
parent
f8533dbac8
commit
21f2d4ab0f
BIN
resources/dist/index.js
vendored
BIN
resources/dist/index.js
vendored
Binary file not shown.
BIN
resources/dist/index.js.json
vendored
BIN
resources/dist/index.js.json
vendored
Binary file not shown.
|
@ -136,6 +136,7 @@ function convertPageToModel( page ) {
|
|||
page.pagelanguagehtmlcode,
|
||||
page.pagelanguagedir,
|
||||
page.extract,
|
||||
page.thumbnail
|
||||
page.thumbnail,
|
||||
page.pageid
|
||||
);
|
||||
}
|
||||
|
|
|
@ -172,6 +172,7 @@ function convertPageToModel( page, thumbSize, extractParser ) {
|
|||
page.thumbnail ?
|
||||
generateThumbnailData(
|
||||
page.thumbnail, page.originalimage, thumbSize
|
||||
) : undefined
|
||||
) : undefined,
|
||||
page.pageid
|
||||
);
|
||||
}
|
||||
|
|
|
@ -36,6 +36,7 @@ export var TYPE_PAGE = 'page'; // eslint-disable-line one-var
|
|||
* @param {String} languageDirection Either "ltr" or "rtl"
|
||||
* @param {?Array} extract
|
||||
* @param {?Object} thumbnail
|
||||
* @param {?Number} pageId
|
||||
* @return {PreviewModel}
|
||||
*/
|
||||
export function createModel(
|
||||
|
@ -44,7 +45,8 @@ export function createModel(
|
|||
languageCode,
|
||||
languageDirection,
|
||||
extract,
|
||||
thumbnail
|
||||
thumbnail,
|
||||
pageId
|
||||
) {
|
||||
var processedExtract = processExtract( extract );
|
||||
|
||||
|
@ -55,7 +57,8 @@ export function createModel(
|
|||
languageDirection: languageDirection,
|
||||
extract: processedExtract,
|
||||
type: processedExtract === undefined ? TYPE_GENERIC : TYPE_PAGE,
|
||||
thumbnail: thumbnail
|
||||
thumbnail: thumbnail,
|
||||
pageId: pageId
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -45,7 +45,8 @@ var DEFAULT_CONSTANTS = {
|
|||
height: 300,
|
||||
source: 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6d/Rick_Astley_-_Pepsifest_2009.jpg/200px-Rick_Astley_-_Pepsifest_2009.jpg',
|
||||
width: 200
|
||||
}
|
||||
},
|
||||
447541
|
||||
);
|
||||
|
||||
QUnit.module( 'ext.popups/gateway/mediawiki', {
|
||||
|
|
Loading…
Reference in a new issue