17,097
edits
(Amend purge link such that it only appears for current revisions of articles which the user can edit) |
(Amend for ECMASCript 5 compatibility) |
||
Line 776: | Line 776: | ||
function addToPageTools() { | function addToPageTools() { | ||
if (isUserLoggedIn()) { | if (isUserLoggedIn()) { | ||
var canEdit = mw.config.get('wgIsProbablyEditable') | var canEdit = mw.config.get('wgIsProbablyEditable'); | ||
var isArticle = mw.config.get('wgIsArticle') | var isArticle = mw.config.get('wgIsArticle'); | ||
var isCurRevision = | var isCurRevision = mw.config.get('wgRevisionId') >= mw.config.get('wgCurRevisionId'); | ||
if (canEdit && isArticle && isCurRevision) { | if (canEdit && isArticle && isCurRevision) { | ||
$.when(mw.loader.using(['mediawiki.util']), $.ready).then( function() { | $.when(mw.loader.using(['mediawiki.util']), $.ready).then( function() { |