מדיה ויקי:Gadget-Watchlist.js: הבדלים בין גרסאות בדף
| שורה 55: | שורה 55: | ||
var span = document.createElement(span); | var span = document.createElement(span); | ||
// this is a kludge: we take advantage of the fact that watched pages appear in boldface | // this is a kludge: we take advantage of the fact that watched pages appear in boldface | ||
// in last changes page, with className of "'mw-watched'" to deduc that this page is watched. | // in last changes page, with className of "'mw-changeslist-line-watched'" to deduc that this page is watched. | ||
var inWatchList = wgCanonicalSpecialPageName == 'Watchlist'; | var inWatchList = wgCanonicalSpecialPageName == 'Watchlist'; | ||
span.isWatched = inWatchList || getElementsByClassName(element, 'strong', 'mw-watched').length > 0; | span.isWatched = inWatchList || getElementsByClassName(element, 'strong', 'mw-changeslist-line-watched').length > 0; | ||
var stopFollowStr = inWatchList ? '[הסר]' : '[הפסק לעקוב]'; | var stopFollowStr = inWatchList ? '[הסר]' : '[הפסק לעקוב]'; | ||
span.appendChild(document.createTextNode(span.isWatched ? stopFollowStr : '[עקוב]')); | span.appendChild(document.createTextNode(span.isWatched ? stopFollowStr : '[עקוב]')); | ||