In this article we are going to talk about
User:Quarl/watchbutton.js, a topic that has been the subject of interest and debate in recent years.
User:Quarl/watchbutton.js is an issue that affects people of all ages, genders and cultures, and its relevance crosses different fields such as health, economics, politics and society in general. Throughout history,
User:Quarl/watchbutton.js has played a fundamental role in people's lives and its study and understanding are crucial to understanding the world in which we live. Through this article, we will explore different aspects of
User:Quarl/watchbutton.js, from its origins to its impact today, with the aim of providing a comprehensive view on this relevant topic.
// ] - change standard watch/unwatch tab to be
// asynchronous.
// quarl 2006-02-03 initial version
// requires: wikiwatch.js, util.js
// <pre><nowiki>
var watchbutton = new Object();
watchbutton.toggleAsync = function() {
if (watchbutton.currentlyWatched) {
wikiwatch.unwatchAsync(wikiPage, watchbutton._wuwSuccess, watchbutton.tab);
} else {
wikiwatch.watchAsync(wikiPage, watchbutton._wuwSuccess, watchbutton.tab);
}
return false;
}
watchbutton._wuwSuccess = function() {
watchbutton.currentlyWatched = !watchbutton.currentlyWatched;
if (watchbutton.currentlyWatched) {
watchbutton.link.innerHTML = 'Unwatch';
watchbutton.link.href = wikiPage.qurl + '&action=unwatch';
watchbutton.link.title = 'Remove this page from your watchlist';
} else {
watchbutton.link.innerHTML = 'Watch';
watchbutton.link.href = wikiPage.qurl + '&action=watch';
watchbutton.link.title = 'Add this page to your watchlist';
}
}
watchbutton._load = function()
{
var tab_unwatch = document.getElementById('ca-unwatch');
if (tab_unwatch) {
watchbutton.currentlyWatched = true;
watchbutton.tab = tab_unwatch;
}
var tab_watch = document.getElementById('ca-watch');
if (tab_watch) {
watchbutton.currentlyWatched = false;
watchbutton.tab = tab_watch;
}
if (!watchbutton.tab) return;
watchbutton.link = watchbutton.tab.getElementsByTagName('a');
watchbutton.link.onclick = watchbutton.toggleAsync;
}
addOnloadHook(watchbutton._load);
// </nowiki></pre>