Page MenuHomePhabricator

Load text into information box when uploading images
Closed, ResolvedPublic

Description

Author: wiccan1

Description:
Hi. Over at cywiki we'd like something similar to the [https://secure.wikimedia.org/wikipedia/de/wiki/Spezial:Hochladen dewiki version of the file uploader]. We currently have a problem where users are just ignoring copyright information and just uploading a picture without any information.

We have the Information template [https://secure.wikimedia.org/wikipedia/cy/wiki/Nodyn:Gwybodaeth here], which can been seen in dewiki's "Beschreibung/Quelle: {{Information...}}"

We'd like this also to be preloaded into the description box where the user is more likely to fill out the information. We've discussed it on translatewiki, and I've also asked over at dewiki to see if they could help, and they suggested here. A user on cytranslatewiki has found [https://secure.wikimedia.org/wikipedia/de/w/index.php?title=Spezial:MediaWiki-Systemnachrichten&offset=Robots.txt&limit=5000 this link] which shows "uploadtext" which redirects to the actual dewiki upload page. We've searched in the translate strings but have found nothing to the equivalent.

Is there a way of loading our [https://secure.wikimedia.org/wikipedia/cy/wiki/Nodyn:Gwybodaeth Information template] into the description? Thanks.


Version: unspecified
Severity: normal

Details

Reference
bz29026

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 21 2014, 11:35 PM
bzimport set Reference to bz29026.
bzimport added a subscriber: Unknown Object (MLST).

wiccan1 wrote:

Great! Thank you, Mark. I'll give it a go and come back if need be :)

wiccan1 wrote:

Mark, I've updated to something similar to dewiki, but still can't figure out how they get the parameters (or basically just text) in their "Beschreibung/Quelle:" box. Is there a way to edit the contents of that box? At the moment, the one on cywiki is blank.

That bit is added via JavaScript. In their MediaWiki:Common.js there is this bit:

//*** import Onlyifuploading-functions
// SEE ALSO [[MediaWiki:Onlyifuploading.js]]
 
if (mw.config.get( 'wgCanonicalSpecialPageName' ) == "Upload") {
    importScript("MediaWiki:Onlyifuploading.js");
    importScript("MediaWiki:Onlyifediting.js");
}

Meanwhile, MediaWiki:Onlyifuploading.js has this:

addOnloadHook(function() {
 
   var editbox = document.getElementById('wpUploadDescription');
   if (!editbox)            return;
   if (editbox.value !== '') return;
   editbox.value = "{"+"{Information\n"
                 + "|Beschreibung     = \n"
                 + "|Quelle           = \n"
                 + "|Urheber          = \n"
                 + "|Datum            = \n"
                 + "|Genehmigung      = \n"
                 + "|Andere Versionen = \n"
                 + "|Anmerkungen      = \n"
                 + "}"+"}";
});

wiccan1 wrote:

Amazing! Thank you very much, Mark!