Wikipedia:WikiProject User scripts/Scripts/Unwatch: Difference between revisions

Content deleted Content added
cleanup
m Remove legacy globals per phab:T72470 (via WP:JWB)
 
Line 12:
 
// Check if we're on the watchlist
if (!mw.config.get('wgCanonicalSpecialPageName') || mw.config.get('wgCanonicalSpecialPageName') != "Watchlist") return;
if (!document.forms[0] || !document.forms[0].namespace) return;
 
// Unwatch links go back to watchlist with "Removing requested items from watchlist..." message
var query_prefix = "title="+encodeURIComponent(mw.config.get('wgPageName'))+"&action=submit&remove=1&id[]=";
 
// ...or...
Line 36:
// create unwatch link and append it after history link
var unwatch = document.createElement('a');
unwatch.href = mw.config.get('wgServer') + mw.config.get('wgScriptPath') + "/index.php?" + query_prefix + encodeURIComponent(links[i].title);
unwatch.title = "Unwatch "+links[i].title;
unwatch.appendChild(document.createTextNode("unwatch"));