_ _    _ _____  ___   __                       
 __      _(_) | _(_)___ / ( _ ) / /_   ___ ___  _ __ ___  
 \ \ /\ / / | |/ / | |_ \ / _ \| '_ \ / __/ _ \| '_ ` _ \ 
  \ V  V /| |   <| |___) | (_) | (_) | (_| (_) | | | | | |
   \_/\_/ |_|_|\_\_|____/ \___/ \___(_)___\___/|_| |_| |_|

User:Writ Keeper/Scripts/watchlistToggle.js

User:Writ Keeper/Scripts/watchlistToggle.js is a topic that has captured the attention of many people in recent times. With a rich and varied history, it has been the subject of debate and discussion in different areas. From its impact on society to its global implications, User:Writ Keeper/Scripts/watchlistToggle.js has generated unprecedented interest. In this article, we will explore the different aspects related to User:Writ Keeper/Scripts/watchlistToggle.js, analyzing its importance and relevance in today's world. Through a detailed analysis, we will try to better understand this phenomenon and its influence on our daily lives.
function removeWatchlistItem(element)
{
	mw.loader.using("mediawiki.api").done(function()
	{
		var pageTitle = $(element).siblings().find(".mw-changeslist-history").prop("title");
		var mwApi = new mw.Api();
		mwApi.unwatch(pageTitle).done(function() 
		{
			$(element).unbind("click");
			$(element).click(function ()
			{
				return addWatchlistItem(this);
			});
			$(element).text("add");
			$(element).attr("title","Re-add this item to your watchlist");
		});
	});
	return false;
}
function addWatchlistItem(element)
{
	var pageTitle = $(element).siblings().find(".mw-changeslist-history").prop("title");
	var mwApi = new mw.Api();
	mwApi.watch(pageTitle).done(function() 
	{
		$(element).unbind("click");
		$(element).click(function ()
		{
			return addWatchlistItem(this);
		});
		$(element).text("rem");
		$(element).attr("title","Remove this item from your watchlist");
	});
	return false;
}

$(document).ready( function()
{
	if(mw.config.get("wgCanonicalSpecialPageName") === "Watchlist")
	{
		$("li.mw-changeslist-edit .mw-changeslist-links").not(".mw-usertoollinks").each(function(ind, el){$(el).append("&nbsp;|&nbsp;<a class='watchlistToggle' title='Remove this item from your watchlist'>rem</a>")});
		$("a.watchlistToggle").click(function() 
		{
			return removeWatchlistItem(this);
		});
	}
});