MediaWiki:Common.js/uploader.js:修订间差异

imported>=海豚=
无编辑摘要
无编辑摘要
 
(未显示1个用户的3个中间版本)
第2行: 第2行:
"use strict";
"use strict";
$(() => (async () => {
$(() => (async () => {
     await mw.loader.using(["mediawiki.notify", "mediawiki.api"]);
     await mw.loader.using(["mediawiki.api"]);
     const commonsApi = new mw.Api({
     const commonsApi = new mw.Api({
         timeout: 7000,
         timeout: 7000,
第786行: 第786行:


                     if (!this.allowedFileTypes.includes(file.name.replace(/.+\.(.+?)$/, "$1"))) { return alert(`【${file.name}】不支持上传这种格式的文件!`); }
                     if (!this.allowedFileTypes.includes(file.name.replace(/.+\.(.+?)$/, "$1"))) { return alert(`【${file.name}】不支持上传这种格式的文件!`); }
                     if (file.size / 1024 / 1024 > 20) { return alert(`【${file.name}】的大小超过20m,无法上传!`); }
                     if (file.size / 1024 / 1024 > 8) { return alert(`【${file.name}】的大小超过8m,无法上传!`); }
                     this.files.push(this.createFileItem(file));
                     this.files.push(this.createFileItem(file));
                 });
                 });
第819行: 第819行:


             addSourceUrlFile() {
             addSourceUrlFile() {
                 const url = (prompt("请输入文件地址:") || "").trim();
                 const url = (prompt("请输入文件地址:(萌娘百科、哔哩哔哩等网站图片加入了防盗链,你必须把图片下载下来后使用本地上传)") || "").trim();
                 if (!url) { return; }
                 if (!url) { return; }
                 this.files.push(this.createFileItem(url));
                 this.files.push(this.createFileItem(url));
第907行: 第907行:
                     }
                     }
                     const pageContent = [
                     const pageContent = [
                        "== 文件说明 ==",
source,
                         "基于批量上传工具上传的文件",
                         "基于批量上传工具上传的文件",
source,
                        "== 文件说明 ==",
                         metaCategories + this.form.categories.map(item => `[[分类:${item}]]`).join(""),
                         metaCategories + this.form.categories.map(item => `[[分类:${item}]]`).join(""),
                     ].join("\n");
                     ].join("\n");