|
|
(21 intermediate revisions by the same user not shown) |
Line 1: |
Line 1: |
| <html>
| | {{#ask: [[Doom II]]|?From Year}} |
| <script>
| |
| window.addEventListener("load", () => {
| |
| let button = document.getElementById("tt-button");
| |
| let fileInput = document.getElementById("tt-input");
| |
|
| |
| | |
| button.addEventListener("click", () => {
| |
| const api = new mw.Api();
| |
| let param = {
| |
| filename: "File_1.jpg",
| |
| format: "json",
| |
| ignorewarnings: 1,
| |
| };
| |
| | |
| api
| |
| .upload(fileInput[0], param)
| |
| .done(function (data) {
| |
| console.log(data.upload.filename + " has sucessfully uploaded.");
| |
| })
| |
| .fail(function (data) {
| |
| console.log(data);
| |
| });
| |
| });
| |
| });
| |
| </script>
| |
| | |
| <input type="file" id="tt-input"/>
| |
| <input type="button" id="tt-button" value="Upload" />
| |
| </html>
| |