Open main menu

Wikimedia Scripts/Policy draft

This is a Policy Draft for the proposed project Wikimedia Scripts.

Best practicesEdit

All the advice presented here is not mandatory, but it's highly recommended to follow it.

LibrariesEdit

Use jQuery and the other available JavaScript libraries when suitable. Use OOjs UI (see documentation) as a standard User experience.

AJAXEdit

Use Ajax when possible: it's easier to do a POST request (with jQuery) than storing somewhere the action to make and then manipulate the edit page. It's very inadvisable to do it, unless some strong interaction or control by the user is needed.

Usually, all actions can be made directly from the page: for example, a script to help voting Quality Images on Commons, ...

Intelligent GuessEdit

Use 'Artificial Intelligence' to guess as many things as possible without the user's interaction: for example, a voting script would check automatically if every user has the requirements, and in case of negative result, provide the user a simple way to 'rollback' the vote.

PresentationEdit

Give your code the best indentation possible, according to the policies. It's not useful to compress and 'minify' the source code by any means, since this is made by ResourceLoader in production.