Commons:User scripts
Hi, interested in scripting? We need help, so do not hesitate to ask what you can do. We recommend start testing in your user-namespace (new users see basic instructions here).
We have a JavaScript styleguide, but it is a guide, not a policy. Nevertheless, consider reading the MediaWiki manual.
A list of currently available scripts can be found at Category:User scripts.
TO-DO[edit]
- Clarify the copyright situation of user-scripts.
- standardize scripts’ i18n methods → Gadgets 2.0 (mw.msg; example; explanation)
- Search & Detecting security vulnerable
- (urgent) Fix script affected by changes in the default continuation
To create[edit]
These are just suggestions. Feel free to comment in the talk-section.
- A script to get a formatted list of uploads, category-members, …
- A plugin to install scripts loaded with &withJS= – URL parameter to the user’s common or skin.js
- A script-installer which is invokable by a template (URL-params maybe) with a step-by-step wizard (done for gadgets → Template:ActivateGadget)
A global-user-page and settings wizard allowing to create and update the userpage on several wikis.Done
- A slideshow-framework using templates and script like Image Annotator or {{ImageStack}} with customizable caption-boxes, slide-effects, drag&slide, preview thumb-bar, …
- Integrate code for VIC and FPC nomination in MediaWiki:Gadget-QInominator.js.
An autotranslate-template creation wizardDone, see AutotranslateHelper — 0x010C ~talk~ 09:40, 4 April 2017 (UTC)
- Refractor MediaWiki:Gadget-LanguageSelect.js: Multiple language-preferences, showing a (+) like HotCat allowing to add a translation (create an input on-the-fly) to push i18n forward
- Script to show 1-3 file examples in parent categories from their child categories (Special:Permalink/84246834#Galleries in Categories)
Rewrite DerivativeFX as a JavaScript applicationmeta:WMDE Technical Wishes/Move files to Commons phab:T190716- A tool to visually explore Flickr-Images from streams/sets/… before uploading and allowing to unselect some of them by given criteria
A script to allow admins to close undeletion requests like closing deletion requests with MediaWiki:Gadget-DelReqHandler.js (maybe inside delreqhandler)Done here by Perhelion
- A tool similar to Help:QuickDelete but instead of adding deletion templates you can choose to add {{Opaque}}, {{Convert to SVG}} or {{BadJPEG}}.
Scripts without il8n[edit]
Other[edit]
- MediaWiki:Gadget-ChooseResolution.js, MediaWiki:Gadget-dictionaryLookupHover.js not installed as a gadget
- MediaWiki:Gadget-Tag.js – ? not installed
Under construction[edit]
- Improve: Gallery-like mass-changing script Help:VisualFileChange.js
(former User:Rillke/AjaxMassDelete.js) - Improve: Gallery of uploads Commons:Gallery tool (wrapper for MediaWiki:JSONListUploads.js)
- Improve: licensereviewer.js (switch to API, ease the process)
- Waiting for clearance: Common SVG Checker MediaWiki:CommonsSvgChecker.js and Commons:Commons SVG Checker as UI (former Commons:SVG Check)
General Talk[edit]
→ /talk
2020-29[edit]
Latest tech news from the Wikimedia technical community. Please tell other users about these changes. Not all changes will affect you. Translations are available.
Recent changes
- Users can thank others for their edits. Checkusers can now see user data related to that action. This can help identify sock puppets who harass others using thanks. [1]
Problems
- Everyone was logged out a couple of weeks ago to fix a security problem. The problem was not entirely fixed. Because of this everyone was logged out once again last week. [2][3]
Changes later this week
- Wikis that are not for one specific language can translate pages. Sometimes parts of translations are outdated or missing. Outdated translations are marked with a pink background. Missing translations will also be marked in the future. This markup can sometimes break things. It can soon be disabled by using a translate nowrap tag on the source page. [4]
The new version of MediaWiki will be on test wikis and MediaWiki.org from 14 July. It will be on non-Wikipedia wikis and some Wikipedias from 15 July. It will be on all wikis from 16 July (calendar).
Future changes
Tech news prepared by Tech News writers and posted by bot • Contribute • Translate • Get help • Give feedback • Subscribe or unsubscribe.
Users with script experience that may help[edit]
| ||
{{User script developer}} |
User:DieBuche (maybe inactive)- User:Dschwen
- User:Helder
- User:Ilmari Karonen
- User:Krinkle (WMF)
- User:Lupo
- User:Magnus Manske (WMF)
User:Rillke- User:Perhelion
- User:Zhuyifei1999
→ See also: Category:Commons JavaScript coders
See also[edit]
Learning[edit]
- Wikibooks (de, en)
- mw:ResourceLoader/Default modules
- jQuery – code less, do more
- Usability drafts by Guillaume Paumier
Testing[edit]
You can test any script by running it from your console or put the code in a Special:MyPage/test.js and hit “preview”.
- jsfiddle.net – Edit css, JavaScript, HTML and run it (big sandbox)
- Testing with different IE versions (Windows) (IETester: For slow machines) (Expression Web SuperPreview: For mordern machines)
- &withJS functionality: Commons has per-page JavaScript functionality, via this code being included in MediaWiki:Common.js. Try a random imagefile with MediaWiki:VisualFileChange.js.
- Testing the API
Validating and styling[edit]
- Commons:User scripts/reports
- Use MediaWiki:Gadgetprototype.js for new gadgets.
- ESLint – JavaScript Code Quality Tool (former jshint)
- jslint – another JavaScript Code Quality Tool
- jsbeautifier – Indenting and formatting your script – also on Commons:
- Commons Beautifier: escape unsafe characters and beautify the source code
- compactor- or just search yourself
Tools[edit]
Troubleshooting[edit]
- Commons Diagnostic: Let affected users make the test
- &debug=true – URL parameter to get un-minified code
- Debug AJAX requests (using mockjax) github doc