MediaWiki:Common.js/uploader.js:修订间差异
imported>=海豚= 无编辑摘要 |
小无编辑摘要 |
||
| (未显示1个用户的8个中间版本) | |||
| 第1行: | 第1行: | ||
// <pre> | // <pre> | ||
"use strict"; | "use strict"; | ||
$(() => (async () => { | $(() => (async () => { | ||
await mw.loader.using([ | await mw.loader.using(["mediawiki.api"]); | ||
const commonsApi = new mw.Api({ | const commonsApi = new mw.Api({ | ||
timeout: 7000, | timeout: 7000, | ||
| 第289行: | 第288行: | ||
@click="submit(true)" | @click="submit(true)" | ||
>差分上传</button> | >差分上传</button> | ||
<button title="将当前文件除文件名的信息同步到全部文件" @click="asyncCurrentFileInfo"> | <button title="将当前文件除文件名的信息同步到全部文件" @click="asyncCurrentFileInfo">同步已输入信息至全部</button> | ||
<button @click="showManual">使用说明</button> | <button @click="showManual">-使用说明-</button> | ||
</div> | </div> | ||
</div> | </div> | ||
| 第787行: | 第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 > | if (file.size / 1024 / 1024 > 8) { return alert(`【${file.name}】的大小超过8m,无法上传!`); } | ||
this.files.push(this.createFileItem(file)); | this.files.push(this.createFileItem(file)); | ||
}); | }); | ||
| 第820行: | 第819行: | ||
addSourceUrlFile() { | addSourceUrlFile() { | ||
const url = (prompt(" | const url = (prompt("请输入文件地址:(萌娘百科、哔哩哔哩等网站图片加入了防盗链,你必须把图片下载下来后使用本地上传)") || "").trim(); | ||
if (!url) { return; } | if (!url) { return; } | ||
this.files.push(this.createFileItem(url)); | this.files.push(this.createFileItem(url)); | ||
| 第908行: | 第907行: | ||
} | } | ||
const pageContent = [ | const pageContent = [ | ||
"== 文件说明 ==", | |||
source, | |||
"基于批量上传工具上传的文件", | "基于批量上传工具上传的文件", | ||
metaCategories + this.form.categories.map(item => `[[分类:${item}]]`).join(""), | metaCategories + this.form.categories.map(item => `[[分类:${item}]]`).join(""), | ||
].join("\n"); | ].join("\n"); | ||
| 第969行: | 第968行: | ||
); | ); | ||
} else { | } else { | ||
printLog.warn("上传文件超过3个,执行分段上传"); | printLog.warn("上传文件超过3个,执行分段上传"); | ||