Wiktionary:Gadgets

Hello, you have come here looking for the meaning of the word Wiktionary:Gadgets. In DICTIOUS you will not only get to know all the dictionary meanings for the word Wiktionary:Gadgets, but we will also tell you about its etymology, its characteristics and you will know how to say Wiktionary:Gadgets in singular and plural. Everything you need to know about the word Wiktionary:Gadgets you have here. The definition of the word Wiktionary:Gadgets will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofWiktionary:Gadgets, as well as those of other words, enriches your vocabulary and provides you with more and better linguistic resources.

A gadget is a JavaScript and/or a CSS snippet that can be enabled simply by checking an option in your Wiktionary preferences. The gadgets functionality is provided by the MediaWiki extension Extension:Gadgets.

General criteria for Gadgets

Gadgets should generally pass the following conditions:

  1. Gadgets must work if just included with no further configuration. They can be configurable via monobook.js, but must work unconfigured.
  2. Gadgets must be compatible with all major browsers, i.e. they must not terminate with errors.
  3. Gadgets should be functional in most major browsers (cross-browser compatibility). Exceptions must be clearly stated.
  4. Duplication of gadgets should only be made if it's reasonable.
  5. Gadgets requiring permissions must be marked, and must fail gracefully if the permissions aren't present.
  6. Gadgets only working in some skins must be marked as such, if that data is available.

Comments

Comments or warnings can be added to the gadget description templates in two ways:

  • noinclude tag (visible on description page with links): <noinclude> comment </noinclude>
  • HTML comments (visible in source text only): <!-- comment -->

Comments added in this way will be automatically discarded during the page creation process.

Installed gadgets

For currently installed gadgets, see Special:Gadgets.

Preferences

Gadgets may offer their own preferences to allow users to customize their behavior. This is done with the gadget WiktGadgetPrefs.js. To use it, you must either

  1. add ext.gadget.WiktGadgetPrefs as a direct dependency of the gadget in MediaWiki:Gadgets-definition, or
  2. use mw.loader.using("ext.gadget.WiktGadgetPrefs", ...) to load it dynamically.

After this, the preferences can be accessed through mw.wiktGadgetPrefs.get. For example, to implement a check box (true/false) and a string enum (one of three options), the call could look like this:

	var preferences = mw.wiktGadgetPrefs.get("gadgetfoobar", 
		{
			"label": {
				"en": "Example Gadget"
			}
		},
		{
			"frobulate": {
				"type": "boolean",
				"default": false,
				"label": {
					"en": "Whether this gadget should frobulate"
				}
			},
			"favoriteColor": {
				"type": "strenum",
				"default": "red",
				"label": {
					"en": "Favorite color"
				},
				"choices": [
					"red",
					"green",
					"blue"
				],
				"choiceLabels": {
					"en": {
						"red": "Red!",
						"green": "Green!",
						"blue": "Blue!"
					}
				}
			}
		});
	var frobulate = preferences.frobulate;

Full documentation can be found in MediaWiki:Gadget-WiktGadgetPrefs.js.

Once implemented, the preferences should appear in Wiktionary:Gadget preferences.

See also