Jump to content

User:Dragoniez/Selective Rollback

From Meta, a Wikimedia project coordination wiki
This page is a translated version of the page User:Dragoniez/Selective Rollback and the translation is 100% complete.
Selective Rollbackダイアログ (英語インターフェース)
Selective Rollbackダイアログ (日本語インターフェース)

Selective Rollbackは、巻き戻しに様々な便利機能を追加するユーザースクリプトです:

  • 非遷移巻き戻し
巻き戻しリンククリック時にページを遷移させず、ページ上で巻き戻しを実行
  • 巻き戻し要約
巻き戻し要約をカスタマイズする機能を提供
  • 選択的巻き戻し (Selective rollback)
ページ内の巻き戻しリンクの一部を指定し一括巻き戻し
  • 一括巻き戻し
ページ内の巻き戻し可能な編集を一括巻き戻し
  • ボット巻き戻し
巻き戻しをボット編集扱いとし実行 (特定の利用者権限が必要、コンフィグあり)
  • ウォッチリストの管理
巻き戻し対象ページをウォッチリストに追加 (期間の設定も可能、コンフィグあり)
  • 巻き戻しの確認
巻き戻し実行前に確認メッセージを表示 (デスクトップ環境は既定では無効)
なお、このスクリプトは個人設定から有効化できるビルトインの巻き戻し確認機能を自動的に無効化します。
  • 容易なカスタマイズ
Special:SelectiveRollbackConfigにてスクリプトをカスタマイズできます。この特別ページは、スクリプトが読み込まれている際に動的に生成されます。

インストール方法

グローバルに使用する場合はSpecial:MyPage/global.jsに、メタウィキで使用する場合はSpecial:MyPage/common.jsに、ローカルウィキで使用する場合はそのウィキの利用者common.jsに以下を追加して下さい。(ソースコード)

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

このスクリプトの使い方については#使い方を、設定の方法については#設定をご覧ください。

使い方

ダイアログ

Selective Rollbackのダイアログは、「Tools」メニュー内の「Selective Rollback」ポートレットリンクをクリック、または巻き戻しリンクをCTRLクリックすることで開くことができます。

非遷移巻き戻し

単純に、巻き戻しリンクをクリックしてください。ページを遷移させずに巻き戻しが実行されます。

巻き戻し要約

ダイアログ上で「カスタム」を選択し要約を入力 (もしくはテキストボックスに直接要約を入力) してください。 一度指定したカスタム巻き戻し要約はダイアログを閉じた後も保持され、巻き戻しリンクをクリックした際の非遷移巻き戻しに使用されます。

巻き戻し要約で使用可能な置換表現:

  • $0 — ローカルウィキの既定の巻き戻し要約
  • $1 — 復元される編集の投稿者の利用者名
  • $2 — 巻き戻される編集の投稿者の利用者名
  • $3 — 巻き戻し先の版のID
  • $4 — 巻き戻し先の版のタイムスタンプ
  • $5 — 巻き戻し元の版のID
  • $6 — 巻き戻し元の版のタイムスタンプ
  • $7 — 巻き戻された版数

例:

$1Example$2Example2と想定してください。 メタウィキでは、

Long-term abuse $0

Long-term abuse Reverted changes by Example2 (talk) to last version by Example

に展開されます。これは、既定の巻き戻し要約が

Reverted changes by [[Special:Contributions/$2|$2]] ([[User talk:$2|talk]]) to last version by $1

であるためです。

$0の置換機能を使用すると、既定の巻き戻し要約にコメントを追加することができます。 これにより、「取り消し」の操作時と同じ要領で要約を指定することも可能です。

巻き戻し要約と置換表現は、事前に定義することもできます(詳細は#設定を参照のこと)。

選択的巻き戻し

ページ上に巻き戻しリンクがある場合、「SR」チェックボックスがその横に追加されます。 巻き戻したい版のチェックボックスを選択し、ダイアログを開き、「巻き戻し」をクリックしてください。

注意: この機能は特別:最近の更新特別:ウォッチリストでは無効化されています。

一括巻き戻し

ダイアログを開き、「全選択」をクリックし、「巻き戻し」をクリックしてください。

注意: この機能は特別:最近の更新特別:ウォッチリストでは無効化されています。

ボット巻き戻し

「ボット編集として巻き戻し」をチェックし巻き戻しを実行してください。

ウォッチリストの管理

「巻き戻し対象をウォッチリストに追加」をチェックし巻き戻しを実行してください。

設定

Selective Rollbackは、Special:SelectiveRollbackConfig(またはSpecial:SRC)でカスタマイズでき、直感的かつ自明なインターフェース上から設定を行えます。

特記事項:

  • 設定はグローバル設定とローカル設定で構成されており、ローカル設定が存在する場合はグローバル設定を(部分的に)上書きします。
  • 既存の設定は、設定ページの「その他」タブから削除できます。
  • Selective Rollbackは、スクリプトの初期化時に既定の巻き戻し要約と利用者権限を自動取得し、そのデータをキャッシュすることでAPIリクエストの送信数を減らしています。 ただし、このキャッシュ機能により、内部データに影響する更新がウィキ上で行われても、即座には変更が反映されません。 この仕様により問題が生じた場合は、設定ページの「その他」タブからキャッシュの破棄をお試しください。

翻訳

Selective Rollbackは複数の言語をサポートしています。 新規の言語のサポートをご希望の場合は、以下のテキストを翻訳のうえ、トークページに翻訳テキストをご投稿ください。

翻訳用テキスト

{
	'scriptname': 'Selective Rollback', // Added in v5.0.1
	'portlet-tooltip-dialog': 'Open the Selective Rollback dialog',
	'portlet-label-uncacher': 'Purge cache for Selective Rollback', // v4.4.3
	'dialog-label-summary': 'Edit summary',
	'dialog-label-summary-default': 'Default edit summary',
	'dialog-label-summary-custom': 'Custom',
	'dialog-label-summaryinput': 'Custom edit summary',
	'dialog-help-summaryinput-$0': '<code>$0</code> will be replaced with the default rollback summary.',
	'dialog-help-summaryinput-$0-error': '<code>$0</code> will be replaced with the default rollback summary <b>in English</b>.',
	'dialog-label-summarypreview': 'Summary preview', // v4.0.0
	'dialog-help-summarypreview': '<code>{{PLURAL:$7}}</code> will be replaced.', // Updated in v5.0.0
	'dialog-label-markbot': 'Mark rollbacks as bot edits',
	'dialog-label-watchlist': 'Add rollback targets to watchlist',
	'dialog-label-watchlistexpiry': 'Expiry', // Deprecated since v5.0.0
	'dialog-label-watchlistexpiry-indefinite': 'Indefinite',
	'dialog-label-watchlistexpiry-1week': '1 week',
	'dialog-label-watchlistexpiry-1month': '1 month',
	'dialog-label-watchlistexpiry-3months': '3 months',
	'dialog-label-watchlistexpiry-6months': '6 months',
	'dialog-label-watchlistexpiry-1year': '1 year',
	'dialog-button-rollback': 'Rollback', // Updated in v5.0.0
	'dialog-button-documentation': 'Docs', // Added in v5.0.0
	'dialog-button-config': 'Config', // v5.1.0
	'dialog-button-selectall': 'Select all', // Updated in v5.0.0
	'dialog-label-selectcount': 'Selected:', // Added in v5.0.7
	'dialog-button-close': 'Close', // Deprecated since v5.0.0
	'rollback-notify-noneselected': 'No checkbox is checked.',
	'rollback-notify-linksresolved': 'Rollback links on this page have all been resolved.',
	'rollback-confirm': 'Are you sure you want to rollback this edit?',
	'rollback-label-success': 'reverted',
	'rollback-label-failure': 'rollback failed',
	'rollback-notify-success': 'Success', // v4.0.0
	'rollback-notify-failure': 'Failure', // v4.0.0
	// v5.1.0
	'config-title': 'Configure Selective Rollback',
	'config-tab-local': 'Local',
	'config-tab-global': 'Global',
	'config-notice-local': 'Local config applies only to this project and may (partially) override the global config if present.',
	'config-notice-global': 'Global config applies to all projects and may be (partially) overridden by the local config if present.',
	'config-default': 'Default',
	'config-default-disabled': 'Disabled',
	'config-default-enabled': 'Enabled',
	'config-label-lang': 'Language',
	'config-help-lang': 'The user\'s interface language as set in preferences, or English if translations are unavailable.',
	'config-label-summary': 'Preset summaries',
	'config-label-propertyinput-key': 'Key',
	'config-label-propertyinput-value': 'Value',
	'config-error-propertyinput-key-empty': 'The key must not be empty.',
	'config-error-propertyinput-value-empty': 'The value must not be empty.',
	'config-error-propertyinput-key-reserved': 'The key "$1" is reserved by the system and hence disallowed.',
	'config-error-propertyinput-key-duplicate': 'The key must be unique.',
	'config-button-add': 'Add',
	'config-button-remove': 'Remove',
	'config-button-deselectall': 'Deselect all',
	'config-help-summary-$0': '<code>$0</code> — default rollback summary on the local wiki',
	'config-help-summary-$1': '<code>$1</code> — username of the author of the edit that is being restored',
	'config-help-summary-$2': '<code>$2</code> — username of the author of the edits that are being reverted',
	'config-help-summary-$3': '<code>$3</code> — revision ID of the revision reverted to',
	'config-help-summary-$4': '<code>$4</code> — timestamp of the revision reverted to',
	'config-help-summary-$5': '<code>$5</code> — revision ID of the revision reverted from',
	'config-help-summary-$6': '<code>$6</code> — timestamp of the revision reverted from',
	'config-help-summary-$7': '<code>$7</code> — the number of edits that have been reverted',
	'config-label-showkeys': 'Use keys instead of values as dropdown options',
	'config-label-mergesummaries': 'Merge summaries from the global config instead of overriding them',
	'config-label-replacer': 'Replacement expressions',
	'config-help-replacer': 'Replacement expressions are keywords that will be replaced with certain texts in a rollback summary. It is recommended to <b>always prefix your expressions</b> with <code>$</code> or a similar symbol to avoid unintentional text replacements.',
	'config-label-mergereplacers': 'Merge replacement expressions from the global config instead of overriding them',
	'config-label-watchlist': 'Watchlist',
	'config-label-watchlistexpiry': 'Watchlist expiry',
	'config-label-confirmation': 'Rollback confirmation',
	'config-label-confirmation-desktop': 'Desktop',
	'config-label-confirmation-mobile': 'Mobile',
	'config-label-confirmation-always': 'Always',
	'config-label-confirmation-never': 'Never',
	'config-label-confirmation-RCW': 'If on Recentchanges or Watchlist',
	'config-label-confirmation-nonRCW': 'If not on Recentchanges or Watchlist',
	'config-label-checkboxlabelcolor': 'Checkbox label color',
	'config-help-checkboxlabelcolor': 'Preview:',
	'config-label-miscellaneous': 'Miscellaneous',
	'config-help-markbot': 'This option applies only when you have the required rights on the wiki.',
	'config-label-configlink': 'Generate a portlet link to the config page',
	'config-label-purger': 'Generate a portlet link to purge the cache',
	'config-button-save': 'Save',
	'config-notify-save-success': 'Saved the configurations.',
	'config-notify-save-failure': 'Failed to save the configurations: $1',
	'config-button-reset': 'Reset',
	'config-confirm-reset': 'Do you want to reset the configurations to their default values? Changes will need to be saved manually.',
	'config-notify-reset': 'Field values have been reset to their default values.',
	'config-label-deleteglobal': 'Delete global config',
	'config-help-deleteglobal-absent': 'You do not have any global settings configured.',
	'config-label-deletelocal': 'Delete local config',
	'config-help-deletelocal-absent': 'You do not have any local settings configured.',
	'config-label-deletelocalall': 'Delete local config on all other projects',
	'config-help-deletelocalall-present': 'To perform this action, you need to be logged in on $1.',
	'config-help-deletelocalall-absent': 'You do not have any local settings configured on other projects.',
	'config-label-deletedata': 'Delete data',
	'config-button-deletedata': 'Delete',
	'config-confirm-deletedata': 'Are you sure you want to delete configuration data? This cannot be undone.',
	'config-notify-deletedata-success': 'Deleted the specified configuration data.',
	'config-notify-deletedata-failure': 'Failed to delete some of the specified configuration data.',
}