Index: trunk/extensions/Gadgets/README |
— | — | @@ -15,6 +15,11 @@ |
16 | 16 | The internationalization files may contain contributions by several people; |
17 | 17 | they should be mentioned in each file individually. |
18 | 18 | |
| 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 | + |
19 | 24 | == Installing == |
20 | 25 | Copy the Gadgets directory into the extensions folder of your |
21 | 26 | MediaWiki installation. Then add the following lines to your |
— | — | @@ -34,7 +39,11 @@ |
35 | 40 | (asterisk) characters defines a gadget; it must have the following form: |
36 | 41 | |
37 | 42 | * mygadget|mygadget.js|mygadget.css |
| 43 | + |
| 44 | +or |
38 | 45 | |
| 46 | + * mygadget[ResourceLoader]|mygadget.js|mygadget.css |
| 47 | + |
39 | 48 | That is, each line consists of fields separated by a "|" (pipe) character. |
40 | 49 | The first field ("mygadget" in the example) is the gadgets internal name, |
41 | 50 | and references a system message (MediaWiki:Gadget-mygadget in the example) |
— | — | @@ -44,6 +53,12 @@ |
45 | 54 | colons (":"), and periods (".") (spaces are also allowed but converted to |
46 | 55 | underscores ("_"), like for page titles). |
47 | 56 | |
| 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 | + |
48 | 63 | The remaining fields on the line refer to the JavaScript or CSS code that |
49 | 64 | makes up the gadget, contained in system messages |
50 | 65 | (MediaWiki:Gadget-mygadget.js and MediaWiki:Gadget-mygadget.css in the |
— | — | @@ -55,6 +70,15 @@ |
56 | 71 | * frobinator|commonStuff.js|frob.js|frob.css|pretty.css |
57 | 72 | * l33t|commonStuff.js|tools.js|l33t.js |
58 | 73 | |
| 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 | + |
59 | 83 | The list of gadgets in MediaWiki:Gadgets-definition can be broken into |
60 | 84 | sections using lines that start and end with two or more "=" (equals) |
61 | 85 | characters, enclosing the name of a system message that defines the |
— | — | @@ -68,9 +92,9 @@ |
69 | 93 | |
70 | 94 | == Caveats == |
71 | 95 | |
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. |
75 | 99 | * Uses BeforePageDisplay hook, thus only works with MonoBook based skins; |
76 | 100 | specifically, does not work with CologneBlue. |
77 | 101 | * Gadget code is included after user code - that means that user JS has no |