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

User:Arved/common.js

In today's article, we are going to dive into the exciting world of User:Arved/common.js. From its origins to the present, User:Arved/common.js has played a fundamental role in society, impacting both on a personal and global level. Over the years, User:Arved/common.js has evolved and adapted to the changes of the modern world, staying relevant in different areas. Through this article, we will explore the most relevant aspects of User:Arved/common.js, analyzing its influence in different contexts and its importance today. Don't miss this complete guide on User:Arved/common.js!
// ]
importScript('User:Caorongjin/wordcount.js');
 
/**
 * Anzahl der Beobachter für Artikel in einem Tab
 * oben rechts anzeigen lassen mit Verweis auf
 * Artikel-Informationsseite
 *
 * Nutzbar für den Vector- und Monobook-Skin
 *
 * Author: Benutzer:Nightfly85
 */
(function($, mw) {

    function placeTab(text, url, title, isSelected) {
        var liClass = isSelected ? 'selected' : '',
            $liElement = $('<li id="ca-n-watchers" style="display:none" class="' + liClass +'" ><span><a title="' + title + '" href="' + url + '">' + text + '</a></span></li>');
        $('#ca-history').after($liElement);
        $liElement.slideDown();
    }

    var isInfoPage = (mw.config.get('wgAction') == 'info'),
        articleName = mw.util.wikiUrlencode(mw.config.get('wgPageName')),
        wikiBaseUrl = mw.config.get('wgServer') + mw.config.get('wgScriptPath'),
        infoUrl = wikiBaseUrl + '/index.php?action=info&title=' + articleName,
        apiUrl  = wikiBaseUrl + '/api.php?action=query&prop=info&inprop=watchers&format=xml&titles=' + articleName;

    if(isInfoPage) {
        // The info tab is selected, so highlight the tab and forget the ajax stuff
        placeTab('Information', infoUrl, 'Page Information', true);
    } else {
        if(false === mw.config.get('wgIsArticle') ) {
            return; // Generated page 
        }
        $.ajax({ url: apiUrl }).done(function(xmlData) {
            var numViewer = $(xmlData).find('page').attr('watchers'),
                numViewerText  = (numViewer > 0) ? '<strong>' + numViewer + '</strong>' : 'Nearly no';
            placeTab(numViewerText + ' Watcher', infoUrl, 'Show Page Information', false);

        });
    }
})(jQuery, mediaWiki);