MediaWiki:Common.js: Difference between revisions
No edit summary |
No edit summary |
||
(13 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
/ | // 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); | |||
} | |||
} | |||
}); | }); |
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);
}
});