mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Popups
synced 2024-11-28 01:10:04 +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.pagelanguagehtmlcode,
|
||||||
page.pagelanguagedir,
|
page.pagelanguagedir,
|
||||||
page.extract,
|
page.extract,
|
||||||
page.thumbnail
|
page.thumbnail,
|
||||||
|
page.pageid
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -172,6 +172,7 @@ function convertPageToModel( page, thumbSize, extractParser ) {
|
||||||
page.thumbnail ?
|
page.thumbnail ?
|
||||||
generateThumbnailData(
|
generateThumbnailData(
|
||||||
page.thumbnail, page.originalimage, thumbSize
|
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 {String} languageDirection Either "ltr" or "rtl"
|
||||||
* @param {?Array} extract
|
* @param {?Array} extract
|
||||||
* @param {?Object} thumbnail
|
* @param {?Object} thumbnail
|
||||||
|
* @param {?Number} pageId
|
||||||
* @return {PreviewModel}
|
* @return {PreviewModel}
|
||||||
*/
|
*/
|
||||||
export function createModel(
|
export function createModel(
|
||||||
|
@ -44,7 +45,8 @@ export function createModel(
|
||||||
languageCode,
|
languageCode,
|
||||||
languageDirection,
|
languageDirection,
|
||||||
extract,
|
extract,
|
||||||
thumbnail
|
thumbnail,
|
||||||
|
pageId
|
||||||
) {
|
) {
|
||||||
var processedExtract = processExtract( extract );
|
var processedExtract = processExtract( extract );
|
||||||
|
|
||||||
|
@ -55,7 +57,8 @@ export function createModel(
|
||||||
languageDirection: languageDirection,
|
languageDirection: languageDirection,
|
||||||
extract: processedExtract,
|
extract: processedExtract,
|
||||||
type: processedExtract === undefined ? TYPE_GENERIC : TYPE_PAGE,
|
type: processedExtract === undefined ? TYPE_GENERIC : TYPE_PAGE,
|
||||||
thumbnail: thumbnail
|
thumbnail: thumbnail,
|
||||||
|
pageId: pageId
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,8 @@ var DEFAULT_CONSTANTS = {
|
||||||
height: 300,
|
height: 300,
|
||||||
source: 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6d/Rick_Astley_-_Pepsifest_2009.jpg/200px-Rick_Astley_-_Pepsifest_2009.jpg',
|
source: 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6d/Rick_Astley_-_Pepsifest_2009.jpg/200px-Rick_Astley_-_Pepsifest_2009.jpg',
|
||||||
width: 200
|
width: 200
|
||||||
}
|
},
|
||||||
|
447541
|
||||||
);
|
);
|
||||||
|
|
||||||
QUnit.module( 'ext.popups/gateway/mediawiki', {
|
QUnit.module( 'ext.popups/gateway/mediawiki', {
|
||||||
|
|
Loading…
Reference in a new issue