Last modified: 2011-05-23 23:10:17 UTC
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.
Modify https://secure.wikimedia.org/wikipedia/cy/wiki/MediaWiki:Uploadtext See https://secure.wikimedia.org/wikipedia/de/wiki/MediaWiki:Uploadtext for how dewiki has modified theirs.
Great! Thank you, Mark. I'll give it a go and come back if need be :)
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" + "}"+"}"; });
Amazing! Thank you very much, Mark!