FANDOM


UploadInPage is a script that allows them to upload a file without going to Special:Upload or Special:MultipleUpload and insert it into the page. If enabled, it prevents uploading files without a license in the special pages, the oasis modal and this modal.

This script has two customizable options for personal use. One of them is the replacement of the oasis modal with this one. It permits multiple uploads but prevents image searching within the modal.

Installation

Customization

Here is a list of possible things that you can enable or disable. Remember to add them before you import the code, or if you imported it in ImportJS, you can put this anywhere in Common.js

Option Description Default
window.needsLicense If enabled, the user has to select a license before uploading any file into the wiki. It works in the classic editor, source editor, Special:Upload and Special:MultipleUpload. Support for the visual editor isn't needed since it selects the license at the top. Possible values: true or false. false
window.allowMultiUpload If enabled, the user can upload multiple files at once with an input with the multiple attribute. You can put an individual license to each file, thing that you can't do in Special:MultipleUpload. Possible values: true or false. true
window.maxFiles The max files you can upload if allowMultiUpload is enabled. Possible values: numbers. 100
window.uploadDetails If enabled, the "More options" section uploading a file in oasis' WikiaMiniUpload modal is displayed by default. Possible values: true or false. Note: window.needsLicense has to be "true" for this to work. true
window.UploadFileIcon It is the image URL for the button to show the modal. This file
window.ignoreWarnings Personal use: Ignores the warnings such as: "name already exists", "the file is duplicated", or "the file was deleted" and upload the file no matter what. Possible values: 1 or 0, but true or false are valid. 1 is true and 0 is false false
window.UploadFileOasis Personal use: If enabled, it replaces the classic WikiaMiniUpload in the skin oasis and uses this modal. Possible values: true or false. false
/**** UploadInFile ****/
window.needsLicense = true;
window.allowMultiUpload = true;
window.maxFiles = 10;
window.uploadDetails = false;
window.UploadFileIcon = "https://vignette.wikia.nocookie.net/kirby/images/4/4a/A%C3%B1adirImagen.png/revision/latest?cb=20171020011105";
// Personal use only
window.ignoreWarnings = 0 || false;
window.UploadFileOasis = false;
importArticles({
    type: 'script',
    articles: [
        "u:dev:UploadInPage/code.js"
    ]
});

Using configuration options with Fandom Developers Wiki scripts

The instructions on this page describe how to use configuration options with a script. Here on the Fandom Developers Wiki, many scripts provide optional configuration settings as a mean to alter or enhance the default behavior of the script. When installing configuration options in your JavaScript file, please note that they need to go above the import statement in order to work — unless the directions say otherwise. In case MediaWiki:ImportJS is used to load the scripts, it will be executed last.

Configuration options load too late, don't work
// 1. AjaxRC import statement
importScriptPage('AjaxRC/code.js','dev');
 
// 2. AjaxRC configuration option
var ajaxRefresh = 30000;
Proper placement of configuration options
// 1. AjaxRC configuration option
var ajaxRefresh = 30000;
 
// 2. AjaxRC import statement
importScriptPage('AjaxRC/code.js','dev');
Community content is available under CC-BY-SA unless otherwise noted.