![]() ![]() The library Using OOUI in MediaWiki#Gadgets can be used in gadgets. OOUI is a JavaScript library with user interface elements (for example pop-up windows) specifically for use in MediaWiki. Also see the ResourceLoader best practices.Developing with ResourceLoader - A list of useful practices, like enabling the debug mode and help with debugging.See the jQuery documentation for information about using jQuery in MediaWiki.Modules - A list of JavaScript libraries, jQuery plugins and MediaWiki utilities that already exist within ResourceLoader for you to reuse.Your gadget should load useful ResourceLoader modules. Because Gadgets are coded in JavaScript, as a Gadget coder you're bound to interact with ResourceLoader. ResourceLoader is a core feature of MediaWiki that intelligently delivers JavaScript and CSS assets to users and readers. This section lists resources which are either needed or helpful for non-simple user scripts. If you're running your own copy of MediaWiki, $wgAllowUserJs needs to be enabled for user scripts to work, and the Gadgets extension needs to be installed to make it possible to promote individual scripts to gadget status.įor a nicer development experience, ensure that the CodeEditor extension is installed on your wiki.ĭeveloping user scripts and gadgets Read Manual:Interface/JavaScript for detailed information. Interface administrators can edit that page. The JavaScript in that file affects everyone and is executed automatically for both logged-out and logged-in users. For completeness: There is also the siteJS located at MediaWiki:Common.js.Gadgets are created and managed by interface administrators. Logged-in users can enable gadgets in the "Gadgets" tab of their user preferences. A gadget is a user script which has been "promoted" by an interface administrator, by adding it to MediaWiki:Gadgets-definition.User scripts are similar to the personal JavaScript pages such as Special:MyPage/common.js, but they allow single code chunks to be shared with other users. Examples include: XTools/ArticleInfo.js and m:User:Hoo man/useful links.js. The code is usually hosted on a subpage of your user page. A user script can be edited by the original author (if it is stored in the User: namespace) and by anyone with the "edituserjs" user right (usually just interface administrators).This code can be shared with other users. MediaWiki allows anyone to write public JavaScript code to immediately change the behavior of the software. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |