Wikipedia:WikiProject User scripts/Scripts/Unwatch: Difference between revisions
Content deleted Content added
Xaosflux changed the content model of the page Wikipedia:WikiProject User scripts/Scripts/Unwatch from "wikitext" to "JavaScript": is a js page |
Amorymeltzer (talk | contribs) m Remove legacy globals per phab:T72470 (via WP:JWB) |
||
(One intermediate revision by one other user not shown) | |||
Line 7:
* [[Bugzilla:424]] (if implemented)
*/
addOnloadHook(function () {
// 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"));
Line 48:
}
});
|