コモンズ:ガジェット
Jump to navigation
Jump to search
ガジェットとはウィキメディア・コモンズを実行するMediaWikiの機能性を拡張する標準的なユーザースクリプトのことで、利用者の個人設定ページから簡単にインストールして使います。(その他に手動のインストールが必要なOther user scriptsもあります。) ガジェットは個別に有効・無効の切り替えができ (既定で有効な物もあります) 、処理は個人設定のページ (先にログインが必要) で一覧の横のチェックボックスをクリックするだけです。ご利用のブラウザでJavaScriptを有効にしないと利用できない物がほとんどです。
技術的な詳細
定義
- MediaWiki:Gadgets-definitionはガジェットのインストール先で、ここにあるものは個人設定ページに表示
- ガジェットの利用者範囲を権限によって限定でき、たとえばガジェットの定義文に
rights=delete
など条件を加えます。default
と追加すると、ガジェットは (ログインしない匿名利用者も対象) 既定で読み込まれます。rights=upload
では対象をログイン利用者に限定します。
- ガジェットの利用者範囲を権限によって限定でき、たとえばガジェットの定義文に
- Special:Gadgetsによりあなたがインストールしたガジェットの概要を表示します。ガジェットのスクリプトファイルへのショートカット付き
- MediaWiki:Common.js はスクリプトをいくつか自動で読み込みます
地域化
- Localization within gadgets, where necessary, is handled in various ways. Usually this is within each gadget script, or using a separate subpage (eg MediaWiki:Gadget-HotCat.js/de) but in some cases multiple language versions of the entire script exist. {{Gadget-talk}} categorises localization, and if necessary places scripts in Category:User scripts needing internationalisation.
- Localization of gadget descriptions is done by creating
/xx
subpages of the main (English) gadget description page (eg MediaWiki:Gadget-Cat-a-lot and MediaWiki:Gadget-Cat-a-lot/fr). Special:Preferences, via {{Gadget-desc}}, provides "translate this" links which make this easier.
テンプレート
- {{Gadget-state}} stores some redundant information about gadgets and should be kept up-to-date. Indicating the default-state of a gadget is requested in phab:T51501
- {{Gadget-desc}} standardises descriptions of gadgets (as displayed in Preferences)
- {{Gadget-help}} and {{Gadget-talk}} standardise headers on gadget help and talk pages
- {{ActivateGadget}} and {{DeactivateGadget}} generate links which, when loaded create a dialog asking the user whether to enable or disable a gadget
- Some gadgets document browser compatibility on a subpage (eg Help:Gadget-PrettyLog/Compatibility); this has a common format but not a template
制限
Since MediaWiki 1.18, gadgets (and user CSS/JS) are not loaded on certain special pages, for security reasons. This includes Special:Preferences, breaking the previous means of moving gadgets to other parts of the Preferences. See phab:T20186. phab:T35220 requests a native MediaWiki replacement for what was previously done in Javascript.
リンク
- Category:Gadget scripts
- Commons:User Scripts - project to improve gadgets and other user scripts
- MediaWiki talk:Gadgets-definition - discussion
- mw:Extension:Gadgets - the MediaWiki extension which makes gadgets possible
- mw:Extension:Gadgets/Scripts - some gadgets on mediawiki.org
- mw:ResourceLoader - gadget framework; V2, in development, sees substantial changes; see also phab:T31398 and phab:T22153
- Special:GadgetUsage shows the number of active and inactive users who have different gadgets enabled