Commons:User scripts
From Wikimedia Commons, the free media repository
(Redirected from 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.
We have a styleguide. But it is a guide, not a policy. Nevertheless, consider reading the MediaWiki manual.
Contents |
[edit] TO DO
- Clarify the copyright situation of user-scripts.
- standardize scripts' i18n methods → Gadgets 2.0 (mw.msg; example; explanation)
- Search & Detecting security vulnerable
[edit] To create
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
- A global-user-page and settings wizard allowing to create and update the userpage on several wikis.
- A notification-script using JSONP to notify uploaders in their home-wiki if they request so and you "the tagger" is logged in there.
- A slideshow-framework using templates and script like Image Annotator or {{ImageStack}} with customizable caption-boxes, slide-effects, drag&slide, preview thumb-bar, ...
- A script to close undeletion requests like closing deletion requests with MediaWiki:Gadget-DelReqHandler.js (maybe inside delreqhandler)
- Integrate code for VIC and FPC nomination in MediaWiki:Gadget-QInominator.js.
[edit] Scripts without il8n
[edit] Broken scripts
- MediaWiki talk:Gadget-massblock.js — will be removed soon. No maintainer.
[edit] Other
- MediaWiki:Gadget-ChooseResolution.js, MediaWiki:Gadget-dictionaryLookupHover.js not installed as a gadget
- MediaWiki:Gadget-Slideshow.js obsolete, not installed
- MediaWiki:Gadget-Tag.js - ? not installed
[edit] Under construction
- Improve: Gallery-like mass-changing script User:Rillke/AjaxMassDelete.js
- Improve: Gallery of uploads User:Rillke/JSONListUploads.js
- Improve: ZooFaris licensereviewer.js (switch to API, ease the process)
[edit] General Talk
[edit] Google Calendar extension causing scrip error
JFYI:
If you get an error similar like
Uncaught TypeError: Cannot call method 'match' of undefined chrome-extension://gmbgaklkmjakoegficnlkhebmhkjfich/calendar_utils.js:78
on each file description page, nothing is wrong with our scripts, it's because there is a vevent class on our {{information}} confusing this extension. -- RE rillke questions? 19:52, 6 May 2012 (UTC)
[edit] Users with script experience that may help
- User:DieBuche
- User:Dschwen
- Helder
- User:Ilmari Karonen
- User:Krinkle
- User:Lupo
- User:Magnus Manske
- User:Rillke
[edit] See also
[edit] Learning
- Wikibooks (de, en)
- mw:ResourceLoader/Default modules
- jQuery - code less, do more
- Usability drafts by Guillaume Paumier
[edit] Testing
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
[edit] Validating and styling
- Use MediaWiki:Gadgetprototype.js for new gadgets.
- jslint - JavaScript Code Quality Tool
- jshint - 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
[edit] Tools
[edit] Troubleshooting
- Commons Diagnostic: Let affected users make the test
- &debug=true - URL parameter to get un-minified code
- Debug AJAX requests (using mockjax) github doc