מדיה ויקי:Gadget-Watchlist.js: הבדלים בין גרסאות בדף
יותר פשוט |
הכנה ל-1.18 |
||
| שורה 7: | שורה 7: | ||
} | } | ||
function wlinrc_done() { | function wlinrc_done(span) { | ||
if (wgCanonicalSpecialPageName == 'Watchlist') { | if (wgCanonicalSpecialPageName == 'Watchlist') { | ||
span.parentNode.removeChild(span); | span.parentNode.removeChild(span); | ||
| שורה 22: | שורה 19: | ||
function wlinrc_watchme() { | function wlinrc_watchme() { | ||
var | var params = {action: 'watch', title: this.target.replace(' ', '_') , format: 'json'}; | ||
if (this.isWatched) | |||
params.unwatch = ''; | |||
if (mw && mw.user && mw.user.tokens) | |||
params.token = mw.user.tokens.get('watchToken'); | |||
var span = this; | |||
$.post(mw.util.wikiScript('api'), params, function() { wlinrc_done(span); }) | |||
wlinrc_setText(this.firstChild, '[נשלח...]'); | wlinrc_setText(this.firstChild, '[נשלח...]'); | ||
this.style.color = 'orange'; | this.style.color = 'orange'; | ||
} | } | ||