מדיה ויקי:Gadget-watchlistMark.js: הבדלים בין גרסאות בדף
rawcontinue |
מ 12 גרסאות של הדף wikipedia:he:מדיה_ויקי:Gadget-watchlistMark.js יובאו |
||
| (גרסת ביניים אחת של משתמש אחר אחד אינה מוצגת) | |||
| שורה 7: | שורה 7: | ||
function readWatchList(continuation) { | function readWatchList(continuation) { | ||
var params = { action: 'query', list: 'watchlistraw', wrlimit: | var params = { action: 'query', list: 'watchlistraw', wrlimit: 'max', format: 'json', rawcontinue: 1 }; | ||
if (continuation) | if (continuation) | ||
params.wrcontinue = continuation; | params.wrcontinue = continuation; | ||
| שורה 25: | שורה 25: | ||
function colorWatched() { | function colorWatched() { | ||
var pagesList = isCat ? $('#mw-pages').find('li') : mw.util.$content.find('ul > li') | var | ||
pagesList = isCat ? $('#mw-pages').find('li') : mw.util.$content.find('ul > li'), | |||
all = pagesList.each(function() { | |||
var li = $(this); | var li = $(this); | ||
var line = li.children().filter('a:last'); | var line = li.children().filter('a:last'); | ||
| שורה 36: | שורה 36: | ||
var watchLink = $('<span>', {'class': watched? 'unwatchit-link' : 'watchit-link', title: watchTitle( !watched)}) | var watchLink = $('<span>', {'class': watched? 'unwatchit-link' : 'watchit-link', title: watchTitle( !watched)}) | ||
.text(watchText(! watched)) | .text(watchText(! watched)) | ||
.click(function() {watchIt($(this), page)}) | .click(function() {watchIt($(this), page)}); | ||
li.append(watchLink); | li.append(watchLink); | ||
}); | }), | ||
showLink = $('<a>', {href: '#', text:'הצג קישוריות מעקב'}).click( | |||
function(){ | |||
mw.util.addCSS('.unwatchit-link,.watchit-link{display:inline;}'); | |||
$(this).remove(); | |||
} | |||
); | |||
if ($('#contentSub a').length) | |||
$('#contentSub a:last').after(showLink).after(' | '); | |||
else | |||
$('#contentSub').append(showLink); | |||
} | } | ||
| שורה 61: | שורה 72: | ||
".unwatchit-link{color:#a00; cursor: pointer; font-size: 70%;display:none} \n" + | ".unwatchit-link{color:#a00; cursor: pointer; font-size: 70%;display:none} \n" + | ||
".watchit-link{color:#008; cursor: pointer; font-size: 70%;display:none} \n" + | ".watchit-link{color:#008; cursor: pointer; font-size: 70%;display:none} \n" + | ||
".iswatched{font-weight: bolder;} | ".iswatched{font-weight: bolder;}" | ||
); | |||
) | |||
readWatchList(); | readWatchList(); | ||
}); // document ready | }); // document ready | ||