User:MusikAnimal/customWatchlists.js: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 165:
if($(this).is(":checked")) {
if($(this).data("delete")) {
updateStr = "Deleted the custom watchlist <b>"+key+"</b>.";
delete cw[key];
} else {
toWatch = true;
if(id < 0) {
updateStr = "Created the custom watchlist <b>"+key+"</b> with <b>"+wgPageName+"</b>";
cw[key] = [wgPageName];
} else {
updateStr = "Add "+wgPageName+" to the custom watchlist <b>"+key+"</b>";
cw[key].push(wgPageName);
}
}
} else if(exists) {
updateStr = "Removed "+wgPageName+" from the custom watchlist <b>"+key+"</b>";
cw[key].splice($(this).data('index'),1);
}
Line 187:
var api = new mw.Api();
api.watch(wgPageName).done(function(watchResult) {
debugger;
api.postWithToken( "edit", {
action: "edit",
Line 198 ⟶ 197:
setTimeout(function() {
$("#cw-overlay").remove();
},50003000);
}).fail(function(code, result) {
if ( code === "http" ) {