Jump to content

User:Mr. Stradivarius/gadgets/DiffOnly

From Wikipedia, the free encyclopedia

The DiffOnly gadget adds diff-only links on diff pages. Clicking on the "diff only" link will show you the diff with no page content. These links usually load a lot faster than normal diff links, which can be handy for looking through lots of diffs.

This gadget can also add diff-only links on history pages, Special:RecentChanges, Special:Watchlist, and Special:Contributions, if you enable this behaviour in your configuration.

Note that you can choose to never show the page content when viewing diffs by going to Preferences → Appearance → Diffs, and by selecting the "Do not show page content below diffs" checkbox. This should be preferred over using this gadget if you do not want the option to choose between diffs with and without page content.

Installation

[edit]

Copy and paste the following code in Special:MyPage/common.js:

importScript('User:Mr. Stradivarius/gadgets/DiffOnly.js'); // Linkback: [[User:Mr. Stradivarius/gadgets/DiffOnly.js]]

Then save the page and bypass your browser cache.

Configuration

[edit]

By default, diff-only links on diff pages are enabled, but diff-only links on history pages, Special:RecentChanges, Special:Watchlist, and Special:Contributions are disabled. To change this, you can edit the settings for DiffOnly in your Special:MyPage/common.js. You should do this immediately above the importScript line which loads the gadget. Once you have finished editing your common.js page, save the page, and bypass your browser cache.

[edit]

To enable diff-only links on diff pages, history pages, Special:RecentChanges, Special:Watchlist, and Special:Contributions, use the following code:

DiffOnly = "all"
importScript('User:Mr. Stradivarius/gadgets/DiffOnly.js'); // Linkback: [[User:Mr. Stradivarius/gadgets/DiffOnly.js]]
[edit]

To choose which pages you want to enable and disable diff-only links on, use code like the following:

DiffOnly = {
    history: true,
    diff: false
}
importScript('User:Mr. Stradivarius/gadgets/DiffOnly.js'); // Linkback: [[User:Mr. Stradivarius/gadgets/DiffOnly.js]]

The above example enables diff-only links on history pages, and disables them on diff pages. For a complete list of codes, see below.

Codes

[edit]
Code Description Default
diff Show diff-only links on diff pages. true
history Show diff-only links on history pages. false
recentchanges Show diff-only links on Special:RecentChanges. false
watchlist Show diff-only links on Special:Watchlist. false
contributions Show diff-only links on Special:Contributions. false
all Show diff-only links on diff pages, history pages, Special:RecentChanges, Special:Watchlist, and Special:Contributions. This overrides all other settings. false