r76528 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76527‎ | r76528 | r76529 >
Date:18:46, 11 November 2010
Author:maxsem
Status:ok
Tags:
Comment:
Follow-up r76527: updated readme
Modified paths:
  • /trunk/extensions/Gadgets/README (modified) (history)

Diff [purge]

Index: trunk/extensions/Gadgets/README
@@ -15,6 +15,11 @@
1616 The internationalization files may contain contributions by several people;
1717 they should be mentioned in each file individually.
1818
 19+== Prerequisites ==
 20+This version of Gadgets requires MediaWiki 1.17 or later. To get a version
 21+compatible with earlier MediaWiki release, visit
 22+ http://www.mediawiki.org/wiki/Special:ExtensionDistributor/Gadgets
 23+
1924 == Installing ==
2025 Copy the Gadgets directory into the extensions folder of your
2126 MediaWiki installation. Then add the following lines to your
@@ -34,7 +39,11 @@
3540 (asterisk) characters defines a gadget; it must have the following form:
3641
3742 * mygadget|mygadget.js|mygadget.css
 43+
 44+or
3845
 46+ * mygadget[ResourceLoader]|mygadget.js|mygadget.css
 47+
3948 That is, each line consists of fields separated by a "|" (pipe) character.
4049 The first field ("mygadget" in the example) is the gadgets internal name,
4150 and references a system message (MediaWiki:Gadget-mygadget in the example)
@@ -44,6 +53,12 @@
4554 colons (":"), and periods (".") (spaces are also allowed but converted to
4655 underscores ("_"), like for page titles).
4756
 57+If the gadget name is followed by [ResourceLoader], its JavaScript will
 58+be loaded concatenated, minified and gzipped by ResourceLoader, thus
 59+improving load times. However, older gadgets may be incompatible with
 60+ResourceLoader, so all JS is by default loaded the old way, using separate
 61+<script> tags.
 62+
4863 The remaining fields on the line refer to the JavaScript or CSS code that
4964 makes up the gadget, contained in system messages
5065 (MediaWiki:Gadget-mygadget.js and MediaWiki:Gadget-mygadget.css in the
@@ -55,6 +70,15 @@
5671 * frobinator|commonStuff.js|frob.js|frob.css|pretty.css
5772 * l33t|commonStuff.js|tools.js|l33t.js
5873
 74+Gadget definitions can contain whitespace between its elements, e.g.
 75+the following definitions are equivalent:
 76+
 77+ *mygadget[ResourceLoader]|mygadget.js|mygadget.css
 78+
 79+and
 80+
 81+ * mygadget [ ResourceLoader ] | mygadget.js | mygadget.css
 82+
5983 The list of gadgets in MediaWiki:Gadgets-definition can be broken into
6084 sections using lines that start and end with two or more "=" (equals)
6185 characters, enclosing the name of a system message that defines the
@@ -68,9 +92,9 @@
6993
7094 == Caveats ==
7195
72 -* Requires MediaWiki 1.11alpha, revision 24477 or later.
73 -* Gadgets do not apply to Special:Preferences, so users can always disable
74 - any broken gadgets they may have enabled.
 96+* Gadgets do not apply to Special:Preferences, Special:UserLogin and
 97+ Special:ResetPass so users can always disable any broken gadgets they
 98+ may have enabled, and malicious gadgets will be unable to steal passwords.
7599 * Uses BeforePageDisplay hook, thus only works with MonoBook based skins;
76100 specifically, does not work with CologneBlue.
77101 * Gadget code is included after user code - that means that user JS has no

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r76527Merged branches/Gadgets-work/ to trunk. It now uses ResourceLoader (scripts m...maxsem18:19, 11 November 2010

Status & tagging log