Wikimedia Scripts/Policy draft

From Meta, a Wikimedia project coordination wiki

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

Best practices[edit]

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

Libraries[edit]

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

AJAX[edit]

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 Guess[edit]

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.

Presentation[edit]

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.