Projet:Scripts et gadgets/Recommandations

Recommandations aux développeurs

Intégration

  • Les fonctions sont dans des pages qui commencent par MediaWiki:Gadget- et se terminent par .js. Il faut l'extension .js (pour être compatible avec l'extension Gadgets), la liste complète de ces pages est donc accessible via Special:Prefixindex/MediaWiki:Gadget- (et choisissez celles qui se terminent par .js). Si vous n'êtes pas administrateur d'interface, vous pouvez demander l'insertion ou la modification d'un script sur Wikipédia:Demande d'intervention sur un message système (raccourci : WP:DIMS).
  • Variables permettant de personnaliser la fonction :
    • Elles sont déclarées hors de tout contexte (voir schéma dans le bloc #Personnaliser une fonction).
    • Elles ont un nom discriminatoire et préfixé par le nom de la fonction principale, ceci afin d'éviter les mélanges avec d'autres fonctions.

Présentation préférentielle du code

Tous les javascripts des wikis sont censés suivre MW:Manual:Coding conventions/JavaScript. De plus, ici :

  • Les tabulations valent 4 caractères et l'indentation est propre.
  • Les points-virgules en fin d'instructions doivent être présents.
  • Penser à catégoriser la page.

Catégorisation

La catégorisation d'un code s'effectue de préférence via le modèle {{Catégorisation JS}} insérée en commentaire en dehors d’éventuelles balises <syntaxhighlight>, <pre> ou <nowiki>.

Content Disclaimer

Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.

  1. The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
  2. There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
  3. It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
  4. Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
  5. Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.