「MediaWiki:Mobile.js」の版間の差分
細編集の要約なし タグ: モバイル編集 モバイルウェブ編集 |
編集の要約なし タグ: モバイル編集 モバイルウェブ編集 |
||
1行目: | 1行目: | ||
(function () { | (function () { | ||
var mediaViewerThread = mw.loader | |||
.using("mobile.mediaViewer") | |||
.then(function () { | |||
return mw.mobileFrontend.require("mobile.mediaViewer/ImageOverlay"); | |||
}); | |||
mw.loader | mw.loader | ||
.using( | .using("mobile.startup") | ||
.then(function () { | .then(function () { | ||
var startup = mw.mobileFrontend.require("mobile.startup"); | var startup = mw.mobileFrontend.require("mobile.startup"); | ||
12行目: | 14行目: | ||
} | } | ||
startup.mediaViewer = { | startup.mediaViewer = { | ||
overlay: | overlay: function (options) { | ||
mediaViewerThread | |||
.then(function (overlay) { | |||
startup.mediaViewer.overlay = overlay; | |||
overlay(options); | |||
}); | |||
} | |||
}; | }; | ||
}); | }); |
2019年8月27日 (火) 01:47時点における版
(function () {
var mediaViewerThread = mw.loader
.using("mobile.mediaViewer")
.then(function () {
return mw.mobileFrontend.require("mobile.mediaViewer/ImageOverlay");
});
mw.loader
.using("mobile.startup")
.then(function () {
var startup = mw.mobileFrontend.require("mobile.startup");
if (startup.mediaViewer) {
console.info("'mediaViewer.overlay' polyfill is no longer needed.");
return;
}
startup.mediaViewer = {
overlay: function (options) {
mediaViewerThread
.then(function (overlay) {
startup.mediaViewer.overlay = overlay;
overlay(options);
});
}
};
});
})();
(function () {
var disableMobileUI = false
|| window.localStorage.getItem("disableMobileUI")
|| window.sessionStorage.getItem("disableMobileUI")
if (disableMobileUI) {
return;
}
var wgScript = mw.config.get("wgScript");
var builderURL = wgScript
+ "?"
+ new URLSearchParams({
title: "MediaWiki:MobileUI.js",
action: "raw",
ctype: "text/javascript"
})
.toString();
var builderThread = mw.loader
.getScript(builderURL)
.then(function () {
return new MobileUIBuilder(mw)
.prebuild();
});
var dataURL = wgScript
+ "?"
+ new URLSearchParams({
title: "MediaWiki:MobileUI.json",
action: "raw",
ctype: "application/json"
})
.toString();
var dataThread = $
.getJSON(dataURL)
.then(Object);
$
.when(builderThread, dataThread)
.done(function (builder, data) {
builder.build(data);
});
})();