MediaWiki:Common.js: Difference between revisions
No edit summary |
No edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
// Initialize PhotoSwipe | // Initialize PhotoSwipe | ||
mw.loader.using(['ext. | mw.loader.using(['ext.photoSwipe'], function() { | ||
if ( | var config = mw.config.get('wgPhotoSwipeConfig'); | ||
// | if (!config) { | ||
// Default configuration if none exists | |||
config = { | |||
mode: 'recommended', | |||
options: { | |||
gallery: 'table.gallery', | |||
children: 'a.img', | |||
thumbSelector: 'a.img', | |||
allowPanToNext: false, | |||
wheelToZoom: true | |||
} | |||
}; | |||
mw.config.set('wgPhotoSwipeConfig', config); | |||
} | } | ||
}); | }); |
Latest revision as of 19:05, 28 October 2024
// Initialize PhotoSwipe
mw.loader.using(['ext.photoSwipe'], function() {
var config = mw.config.get('wgPhotoSwipeConfig');
if (!config) {
// Default configuration if none exists
config = {
mode: 'recommended',
options: {
gallery: 'table.gallery',
children: 'a.img',
thumbSelector: 'a.img',
allowPanToNext: false,
wheelToZoom: true
}
};
mw.config.set('wgPhotoSwipeConfig', config);
}
});