Jump to content

User:Dragoniez/AjaxBlock/ja

From Meta, a Wikimedia project coordination wiki
This page is a translated version of the page User:Dragoniez/AjaxBlock and the translation is 100% complete.
AjaxBlockダイアログ

AjaxBlock は、管理者がブロック・ブロック解除を行う際に、特別ページを開くことなくページ上での処理を可能にするユーザースクリプトです。 このスクリプトは、主に以下の機能を有しています:

  • ダイアログからのブロック・ブロック解除
  • ワンクリックでのブロック・ブロック解除
  • 利用者 JavaScript を編集せずに設定を管理できる専用設定ページ

ダイアログで指定したブロックオプションは、ダイアログを閉じた後も保持されます。 この機能とワンクリック操作を組み合わせることで、AjaxBlockは一括ブロックツールとしても機能します。

インストール

このスクリプトを有効化したいウィキのSpecial:MyPage/common.jsに、以下のコードを追加して下さい。(ソースコード)

mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Dragoniez/AjaxBlock.js&action=raw&ctype=text/javascript');

または、すべてのウィキで block 権限が付与されるグローバルグループに所属している場合は、Special:MyPage/global.js を利用してスクリプトをインストールすることもできます。

そのようなグループに所属していなくてもこの方法は使用できますが、その場合はあなたがブロック権限を有するプロジェクトのみにスクリプトの読み込みを制限することを推奨します。 利用者をブロックできないウィキ上でスクリプトを読み込み、必要なデータの取得や初期化を行っても意味がないためです。

// 例1: global.js から metawiki でのみ AjaxBlock を読み込む
if (mw.config.get('wgWikiID') === 'metawiki') {
	mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Dragoniez/AjaxBlock.js&action=raw&ctype=text/javascript');
}
// 例2: global.js から metawiki と enwiki でのみ AjaxBlock を読み込む
if (['metawiki', 'enwiki'].includes(mw.config.get('wgWikiID'))) {
	mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Dragoniez/AjaxBlock.js&action=raw&ctype=text/javascript');
}

使用方法

初期化

ページの読み込み時、スクリプトの初期化中は画面右下に AjaxBlock のロゴが表示されます。ロゴが消えた後、AjaxBlockの機能を利用可能になります。

初期化が完了する前にブロックリンクやブロック解除リンクをクリックした場合は、リンク本来の遷移先ページが開かれます。

設定ページ

設定ページは、ダイアログ内の設定リンクをクリックするか、以下のページを開くことで利用できます。

設定ページでは以下の項目を変更できます:

  • スクリプトの表示言語
  • 警告設定
  • ブロック設定のプリセット
  • 利用者独自のブロック・ブロック解除理由

また、必要に応じてスクリプトの内部データをこの設定ページ上で削除することもできます。

ブロックリンクの挙動

AjaxBlockを導入すると、Special:BlockおよびSpecial:Unblockへのリンクに追加機能が付与されます。

  • 通常クリック
AjaxBlock ダイアログを開きます。
  • SHIFTクリック
ブロックまたはブロック解除をワンクリックで実行します(必要に応じて警告が表示されます)。
  • CTRLクリック
リンク本来の遷移先を開きます。
  • SHIFT+CTRLクリック
すべての警告を無効化しブロックまたはブロック解除をワンクリックで実行します。(非推奨)
  • 処理不能なリンク
点線の下線付きで表示されます。

利用者をブロックする際、AjaxBlock は登録利用者、仮アカウント、IP利用者のブロック設定を別々に保持します。 すなわち、登録利用者用に設定したブロックオプションは、仮アカウントや IP 利用者には反映されず、その逆も同様です。 ワンクリックブロックを行う際は、この違いに注意してください。

「処理不能なリンク」とは、AjaxBlock が処理できない、例として対象利用者名が指定されていないブロックリンクなどを指します。 これらのリンクは点線の下線付きで表示され、クリックすると通常どおり対応する特別ページへ移動します。

言語サポート

AjaxBlock は複数の言語に対応しています。 対応言語の追加をご希望の場合は、以下のメッセージ一覧を参照のうえ、トークページに翻訳を投稿してください。

翻訳対象メッセージ

{
	'ajaxblock-link-title-unprocessable': '$1 cannot process this link',
	'ajaxblock-dialog-button-label-block': 'Block',
	'ajaxblock-dialog-button-label-unblock': 'Unblock',
	'ajaxblock-dialog-button-label-docs': 'Docs',
	'ajaxblock-dialog-button-label-config': 'Config',
	'ajaxblock-dialog-block-placeholder-preset': 'Select a preset to load',
	'ajaxblock-notify-block-placeholder-preset': 'Loaded preset "$1"',
	'ajaxblock-dialog-block-label-reason1': 'Reason 1',
	'ajaxblock-dialog-block-label-reason2': 'Reason 2',
	'ajaxblock-dialog-block-placeholder-reasonsuffix': 'Reason suffix',
	'ajaxblock-dialog-block-label-customreasons': 'Custom block reasons',
	'ajaxblock-dialog-block-label-partial': 'Partial block',
	'ajaxblock-dialog-block-label-option-autoblock': 'Apply autoblock',
	'ajaxblock-dialog-message-nonactive-id': 'The block with ID <b>#$1</b> specified by this link is no longer active and has been ignored.',
	'ajaxblock-dialog-message-existingblocks': '<b>This user already has active block(s).</b> Select the block you want to update.',
	'ajaxblock-dialog-message-existingblocks-canadd': '<b>This user already has active block(s).</b> Select the block you want to update, or check "{{int:block-create}}" to add a new block.',
	'ajaxblock-dialog-message-existingblocks-unblock': 'Select the block you want to remove.',
	'ajaxblock-dialog-message-existingblocks-dialogonly': '<b>This action must be performed via this dialog.</b> One-click execution is not supported.',
	'ajaxblock-dialog-message-predefinedparams-block': 'This link contains predefined block parameters.',
	'ajaxblock-dialog-message-predefinedparams-unblock': 'This link contains predefined unblock parameters.',
	'ajaxblock-dialog-message-applyparams-short': 'apply',
	'ajaxblock-dialog-message-applyparams-long': 'apply parameters',
	'ajaxblock-dialog-message-blocklog-missing': 'Failed to load the log for the block with ID <b>#$1</b>',
	'ajaxblock-notify-error-loadblocklogs': 'Failed to load block information ($1).',
	'ajaxblock-notify-error-idinactivenousername': 'This link cannot be processed because the block with ID <b>#$1</b> is no longer active and no username is specified.',
	'ajaxblock-notify-error-cannotunblock': '<b>$1</b> does not have any active blocks and cannot be unblocked.',
	'ajaxblock-notify-error-ambiguousblock': 'Select the block you want to update.',
	'ajaxblock-notify-error-ambiguousblock-canadd': 'Select the block you want to update, or check "{{int:block-create}}" to add a new block.',
	'ajaxblock-notify-error-notarget': 'This (un)block operation cannot be processed.',
	'ajaxblock-notify-error-emptyblock': 'This would result in an empty block. Please add restrictions or uncheck "{{int:ajaxblock-dialog-block-label-partial}}".',
	'ajaxblock-notify-error-processing': 'This link is temporarily unprocessable because another operation is currently processing it.',
	'ajaxblock-notify-error-noblocklinks': 'No associated block links found.',
	'ajaxblock-notify-error-cannotopendialog': 'Unable to open the $1 dialog because there are pending operations currently being processed. Please wait for them to finish and try again.',
	'ajaxblock-notify-error-cannotopendialog-oneclick': 'This link must be executed via the dialog, but could not open it because there are pending operations currently being processed. Please wait for them to finish and try again.',
	'ajaxblock-notify-error-paramapplier-presetsnotready': 'AjaxBlock is still loading block presets. Please try again in a few seconds. If this error occurs frequently, consider removing page restrictions from your presets.',
	'ajaxblock-notify-warning-paramapplier-filtered-top': 'Filtered invalid block parameter values:',
	'ajaxblock-notify-warning-paramapplier-filtered-pages': 'Page restrictions',
	'ajaxblock-notify-warning-paramapplier-filtered-namespaces': 'Namespace restrictions',
	'ajaxblock-confirm-block-noreason': 'Block with <b>no reason</b> specified',
	'ajaxblock-confirm-block-noexpiry': 'Block with <b>no expiry</b> specified (defaults to "{{int:infiniteblock}}")',
	'ajaxblock-confirm-block-hardblock': 'Apply a <b>hardblock</b>',
	'ajaxblock-confirm-block-hideuser': 'Block with <b>"Hide user" enabled</b>',
	'ajaxblock-confirm-block-reblock': '<b>Overwrite</b> the existing block',
	'ajaxblock-confirm-block-newblock': '<b>Add</b> a new block',
	'ajaxblock-confirm-block-self': 'Block <b>yourself</b>',
	'ajaxblock-confirm-block-ignorepredefined': 'Block while <b>ignoring predefined parameters</b>',
	'ajaxblock-confirm-unblock': '<b>Unblock</b> the user',
	'ajaxblock-confirm-unblock-noreason': 'Unblock with <b>no reason</b> specified',
	'ajaxblock-confirm-unblock-self': 'Unblock <b>yourself</b>',
	'ajaxblock-confirm-unblock-ignorepredefined': 'Unblock while <b>ignoring predefined parameters</b>',
	'ajaxblock-confirm-dialog-title-block': 'Confirm block',
	'ajaxblock-confirm-dialog-title-unblock': 'Confirm unblock',
	'ajaxblock-confirm-dialog-label-instruction': 'Please confirm the following warnings by <b>checking all the associated checkboxes</b> to proceed.',
	'ajaxblock-confirm-dialog-label-opendialog': 'Open the $1 dialog when cancelled',
	'ajaxblock-result-block-success': 'blocked',
	'ajaxblock-result-block-failure': 'block failed ($1)',
	'ajaxblock-result-unblock-success': 'unblocked',
	'ajaxblock-result-unblock-failure': 'unblock failed ($1)',
	'ajaxblock-config-title': 'Configure AjaxBlock',
	'ajaxblock-config-loading': 'Loading',
	'ajaxblock-config-loading-failure': 'Failed to initialize the AjaxBlock config interface',
	'ajaxblock-config-label-tab-common': 'Common',
	'ajaxblock-config-label-tab-global': 'Global',
	'ajaxblock-config-label-tab-local': 'Local',
	'ajaxblock-config-label-tab-misc': 'Miscellaneous',
	'ajaxblock-config-label-default': 'Default',
	'ajaxblock-config-label-languages-layout': 'Language options',
	'ajaxblock-config-label-languages-used': 'Used languages',
	'ajaxblock-config-placeholder-languages-used': 'Add languages',
	'ajaxblock-config-help-languages-used': 'Used when the interface language in use matches one of the selected languages.',
	'ajaxblock-config-label-languages-default': 'Default language',
	'ajaxblock-config-help-languages-default': 'Used when the interface language in use does not match any language selected in "{{int:ajaxblock-config-label-languages-used}}".',
	'ajaxblock-config-label-warning-layout': 'Warning options',
	'ajaxblock-config-label-warning-th-oneclick': 'One click',
	'ajaxblock-config-label-warning-th-dialog': 'Dialog',
	'ajaxblock-config-label-warning-block-noreason': 'When performing a block with no reason specified',
	'ajaxblock-config-label-warning-block-noexpiry': 'When performing a block with no expiry specified',
	'ajaxblock-config-label-warning-block-hardblock': 'When performing a hardblock',
	'ajaxblock-config-label-warning-block-hideuser': 'When performing a hideuser block',
	'ajaxblock-config-label-warning-block-reblock': 'When overwriting an existing block',
	'ajaxblock-config-label-warning-block-newblock': 'When adding a new block',
	'ajaxblock-config-label-warning-block-self': 'When performing a block on the performer themselves',
	'ajaxblock-config-label-warning-block-ignorepredefined': 'When not using predefined block parameters',
	'ajaxblock-config-label-warning-unblock': 'When performing an unblock',
	'ajaxblock-config-label-warning-unblock-noreason': 'When performing an unblock with no reason specified',
	'ajaxblock-config-label-warning-unblock-self': 'When performing an unblock on the performer themselves',
	'ajaxblock-config-label-warning-unblock-ignorepredefined': 'When not using predefined unblock parameters',
	'ajaxblock-config-label-reset': 'Reset',
	'ajaxblock-config-label-override': 'Override global options instead of merging with them',
	'ajaxblock-config-label-presetreasons-layout': 'Preset block options',
	'ajaxblock-config-label-presetreasons-name': 'Preset',
	'ajaxblock-config-placeholder-presetreasons-name': 'Enter a preset name',
	'ajaxblock-config-message-presetreasons-name-empty': 'The preset name must not be empty.',
	'ajaxblock-config-message-presetreasons-name-duplicate': 'The preset name must be unique.',
	'ajaxblock-config-notify-presetreasons-resolveerrors': 'Please fix the errors in the preset fields before continuing.',
	'ajaxblock-config-label-presetreasons-target-named': 'Registered users',
	'ajaxblock-config-label-presetreasons-target-temp': 'Temporary users',
	'ajaxblock-config-label-presetreasons-target-ip': 'IP users',
	'ajaxblock-config-placeholder-presetreasons-target': 'Add user types',
	'ajaxblock-config-notice-presetreasons-additionaloptions': 'In the dialog, some of the options below may be hidden depending on the target and user permissions.',
	'ajaxblock-config-title-presetreasons-hideuser-pseudodisabled': 'You cannot hide users on this project. If you have permission on another project, you can change this setting from this interface.',
	'ajaxblock-config-label-presetreasons-add': 'Add preset',
	'ajaxblock-config-label-presetreasons-delete': 'Delete preset',
	'ajaxblock-config-confirm-presetreasons-empty': 'The following empty presets will be removed before saving the options. Do you want to continue?',
	'ajaxblock-config-notify-save-nochange': 'No configuration changes detected.',
	'ajaxblock-config-notify-save-success': 'Configuration saved successfully.',
	'ajaxblock-config-notify-save-failure': 'Failed to save the configuration.',
	'ajaxblock-config-placeholder-customreasons': 'Enter reasons separated by line breaks',
	'ajaxblock-config-label-customreasons-block-layout': 'Custom block reason options',
	'ajaxblock-config-label-customreasons-unblock-layout': 'Custom unblock reason options',
	'ajaxblock-config-help-customreasons-block': 'Reasons specified here will be added to the block reason dropdown',
	'ajaxblock-config-help-customreasons-unblock': 'Reasons specified here will be shown as autocomplete suggestions in the unblock reason textbox',
	'ajaxblock-config-label-purgecache': 'Purge cache for AjaxBlock',
	'ajaxblock-config-label-deletelocal': 'Delete local config',
	'ajaxblock-config-help-deletelocal-absent': 'You do not have any local settings configured.',
	'ajaxblock-config-label-deletelocalall': 'Delete local config on all other projects',
	'ajaxblock-config-help-deletelocalall-present': 'Projects with saved local configuration: $1',
	'ajaxblock-config-help-deletelocalall-absent': 'You do not have any local settings configured on other projects.',
	'ajaxblock-config-label-deleteglobal': 'Delete global config',
	'ajaxblock-config-help-deleteglobal-absent': 'You do not have any global settings configured.',
	'ajaxblock-config-label-deletedata': 'Delete data',
	'ajaxblock-config-label-deletedata-short': 'Delete',
	'ajaxblock-config-confirm-deletedata': 'Are you sure you want to delete configuration data? This cannot be undone.',
	'ajaxblock-config-notify-deletedata-success': 'Deleted the specified configuration data.',
	'ajaxblock-config-notify-deletedata-failure': 'Failed to delete some of the specified configuration data.',
}