feat(gallery): load PhotoSwipe lib from JSDelivr

This commit is contained in:
Jimmy Cai 2020-10-04 15:59:56 +02:00
parent feff86a9b4
commit fa0f8fa365
No known key found for this signature in database
GPG key ID: 3EA408E527F37B18

View file

@ -236,10 +236,10 @@ function wrap(gallery: HTMLElement[]) {
*/ */
function loadPhotoSwipe() { function loadPhotoSwipe() {
const tasks = [ const tasks = [
loadScript("https://cdnjs.cloudflare.com/ajax/libs/photoswipe/4.1.3/photoswipe.min.js"), loadScript("https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe.min.js"),
loadScript("https://cdnjs.cloudflare.com/ajax/libs/photoswipe/4.1.3/photoswipe-ui-default.min.js"), loadScript("https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe-ui-default.min.js"),
loadStyle("https://cdnjs.cloudflare.com/ajax/libs/photoswipe/4.1.3/photoswipe.min.css"), loadStyle("https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe.min.css"),
loadStyle("https://cdnjs.cloudflare.com/ajax/libs/photoswipe/4.1.3/default-skin/default-skin.min.css") loadStyle("https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/default-skin/default-skin.min.css")
]; ];
return Promise.all(tasks); return Promise.all(tasks);