User:MusikAnimal/customWatchlists.js: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 155:
var cw = e.data.customWatchlists,
iw = e.data.inWatchlists,
toWatch = false;,
updateStr = "";
 
$.each($(".cw-option"), function(i) {
Line 164 ⟶ 165:
if($(this).is(":checked")) {
if($(this).data("delete")) {
console.log(updateStr = "deleteDeleted the custom watchlist "+key);
delete cw[key];
} else {
toWatch = true;
if(id < 0) {
console.log(updateStr = "createdCreated the custom watchlist "+key+" with "+wgPageName);
cw[key] = [wgPageName];
} else {
console.log(updateStr = "addAdd "+wgPageName+" to the custom watchlist "+key);
cw[key].push(wgPageName);
}
}
} else if(exists) {
console.log(updateStr = "removeRemoved "+wgPageName+" from the custom watchlist "+key);
cw[key].splice($(this).data('index'),1);
}
Line 194 ⟶ 195:
}).done(function(result, jqXHR) {
$("#cw-overlay-body").html("Success!");
mw.notify(updateStr);
setTimeout(function() {
$("#cw-overlay").remove();