テンプレート:DiscordIntegrator
ナビゲーションに移動
検索に移動
以下のJavaScriptを使用しています: |
Description[ソースを編集]
This template is used as a utility for making usage of DiscordIntegrator easier. In order to integrate the widget, it first needs to be enabled, for instructions on how to do that check "Enabling the widget" section in the documentation.
This template requires MediaWiki:DiscordIntegrator.js.
導入方法[ソースを編集]
このテンプレートを有効にするにはMediaWiki:DiscordIntegrator.jsが必要です。
こちらのバージョンはinterwiki翻訳のi18n.jsonを使用しない古いシンプルなバージョンです。Mirahezeではこちらのファイルが実装しやすいとおもいます。
Javascriptを読み込ませる[ソースを編集]
MediaWiki:DiscordIntegrator.jsをお使いのMediaWikiのCommon.jsから読み込ませるようにする必要があります。
- 読み込みの一例
mw.loader.using( 'mediawiki.util', function() {
mw.loader.load( '/w/index.php?title=MediaWiki:DiscordIntegrator.js&action=raw&ctype=text/javascript' );
});
Extension:Gadgetを利用する方法[ソースを編集]
Extension:Gadgetsが有効な場合は以下の方法で実装できます。
- ページ名を MediaWiki:Gadget-DiscordIntegrator.js として保存する。
- MediaWiki:Gadgets-definitionへ以下のように追記する。
DiscordIntegrator[ResourceLoader|default|type=general|dependencies=jquery,mediawiki.util]|DiscordIntegrator.js
Parameters[ソースを編集]
Option | Type | What it changes | Default |
---|---|---|---|
id | String | ID of the server. For more information on how to find Discord server ID, see "Enabling the widget" section in the documentation | N/A |
theme | String | Theme of the widget. Can be set to either light or dark . If invalid option specified the default is used
|
dark |
width | String | Width of the widget. | 100% |
height | String | Height of the widget. | 90% |
allowtransparency | Boolean | allowtransparency attribute of the element. | true |
frameborder | Number | frameborder attribute | 0 |
usePTB | Anything | If to use the widget from Public Test Build server instead of the normal one | N/A |
See also[ソースを編集]
- DiscordIntegrator for complete documentation
[閲覧 | 編集 | 履歴 | キャッシュ破棄]上記の記事は次のページから転記しています: テンプレート:DiscordIntegrator/doc.