User:Writ Keeper/Scripts/inlineDiffDocs

This is a common documentation page for User:Writ Keeper/Scripts/commonHistory.js, User:Writ Keeper/Scripts/watchlistDiffs.js, User:Writ Keeper/Scripts/userHistory.js, User:Writ Keeper/Scripts/generalHistory.js, and User:Writ Keeper/Scripts/contribsHistory.js. I created userHistory.js first at Yunshui's request; it's a modified version of Ale jrb's user history script. This script fixes a few bugs with Ale jrb's original, and it adds a new feature: a button is added to each entry that displays the diff of that entry in-line, without leaving the page. This way, all the diffs of the listed edits can be displayed, hidden, and re-shown on the same page at once. The generalHistory script extends this functionality to the standard article history page, the contribsHistory script likewise extends it to a user's contribs page, and the watchlistDiffs script does the same for the watchlist (and RecentChanges). The commonHistory.js script is a consolidated version of these scripts, providing the in-place diff functionality of all these scripts, with the exception of the original UserHistory script. That is, it provides the in-place diff functionality to recentchanges, watchlist, contributions, and history screens, without adding the history filter from Ale jrb's original script. Use of the commonHistory.js script instead of the piecemeal scripts is recommended.

By default, the added buttons are a Twinkle-style link like: [inspect diff]. The text that appears can be altered by adding the variables inspectText, showText, and hideText to the same .js page where you installed the commonHistory.js script, right above its import line. For example: if you wanted to change the text into + or -, you would put:

inspectText = "+";
showText = "+";
hideText = "-";
importScript("User:Writ Keeper/Scripts/commonHistory.js");

...where before you might have had only:

importScript("User:Writ Keeper/Scripts/commonHistory.js");

Similarly, if you want viewing the diff to mark that page as viewed on the watchlist, put markAsViewed = true.

If you want to install it on other wikiprojects use the following line instead:

mw.loader.load("//en.wikipedia.org/w/index.php?title=User:Writ Keeper/Scripts/commonHistory.js&action=raw&ctype=text/javascript");