Jump to content

利用者:Jon Harald Søby/diffedit

From Meta, a Wikimedia project coordination wiki
This page is a translated version of the page User:Jon Harald Søby/diffedit and the translation is 33% complete.

diffedit

2021 Coolest Tool
Award Winner

in the category
Tiny

ユーザースクリプトの動作を紹介する動画

diffeditは、差分を表示して直接編集できるようにするユーザースクリプトです。最初は不要に思えるかもしれませんが("編集ボタンはすでにあります")、たとえば記事の見つけにくいところで小さな間違いがあった時、記事全体を編集してその小さな間違いを探したくないときなどに便利です。このスクリプトは、巡回を行われる方に向いています。ページの最新版との差分を表示している場合のみ編集できます。古い版の差分を表示している場合は編集できませんが、代わりに最新版と比較できます。

利用方法

以下のコードを global.js ファイルか common.js ファイルの末尾に追加します:

// [[m:User:Jon Harald Søby/diffedit.js]]
mw.loader.load( '//meta.wikimedia.org/w/index.php?title=User:Jon_Harald_Søby/diffedit.js&action=raw&ctype=text/javascript' );

特徴

  • Edit pages directly from (wikitext) diff view
  • Content model detection – the script won't be enabled for content models it can't handle
  • Accesskeys! (What key combination you need to use to use access keys varies by browser and OS. Here I use "Alt+<key>" to illustrate them, but they could be different for you.)
    • Alt+S or Ctrl+ Enter: Save the change
    • Alt+B: Go to edit summary
    • Alt+,: Go the the first editable element
    • Esc: Cancel editing
  • Translations. The script uses existing MediaWiki messages where it can, but some messages are also handled in the script. You can translate them here.

注意点

The script will not let you edit if:

  • You're viewing an old diff (it will give a link comparing the diff you're on with the current diff, which you can edit)
  • The content model of the page isn't a simple text-based one
  • You're not allowed to edit the page (for instance if it is protected)
  • You use the "visual diff" feature

Additionally, it is not currently possible to delete lines with this script.