User:Bradv/SearchLinks.js

In today's world, User:Bradv/SearchLinks.js has become a topic of increasing interest and debate. From its origins to its impact on today's society, User:Bradv/SearchLinks.js has captured the attention of experts and the general public. As its relevance continues to increase, it is crucial to understand its implications and consequences in different areas. In order to address this question comprehensively, this article seeks to explore the different aspects of User:Bradv/SearchLinks.js, from its historical origins to its influence today. Through a detailed analysis, it is intended to shed light on this topic in an objective and complete manner, offering the reader a broad and precise vision.
(function ( $, mw ) {
    var ns = mw.config.get('wgCanonicalNamespace');
    if (ns === "Special")
        return;  // no links for special pages

    mw.loader.using().then(function () {
        var title = mw.config.get('wgTitle');
        if (ns !== "")
            title = title.replace(/^.*\//, "");  // subpage name only
 
        var query = encodeURIComponent(title); 
        mw.util.addPortletLink('p-tb', 
            'https://www.google.com/search?as_eq=wikipedia&q=%22'+query+'%22&num=50',
            'Google', 
            't-googlesearch', 
            'Search Google for "'+title+'"', 'G');
        mw.util.addPortletLink('p-tb', 
            'https://www.google.com/search?tbm=nws&q=%22'+query+'%22+-wikipedia',
            'news', 
            't-googlenewssearch', 
            'Search Google News for "'+title+'"');
        mw.util.addPortletLink('p-tb', 
            'https://www.google.com/search?&q=%22'+query+'%22+site:news.google.com/newspapers&source=newspapers',
            'newspapers', 
            't-googlenewspapersearch', 
            'Search newspapers for "'+title+'"');
        mw.util.addPortletLink('p-tb', 
            'https://www.google.com/search?tbs=bks:1&q=%22'+query+'%22+-wikipedia',
            'books', 
            't-googlebookssearch', 
            'Search Google Books for "'+title+'"');
        mw.util.addPortletLink('p-tb', 
            'https://scholar.google.com/scholar?q=%22'+query+'%22',
            'scholar', 
            't-googlescholarsearch', 
            'Search Google Scholar for "'+title+'"');
        mw.util.addPortletLink('p-tb', 
            'https://www.jstor.org/action/doBasicSearch?Query=%22'+query+'%22&acc=on&wc=on',
            'JSTOR', 
            't-jstor', 
            'Search JSTOR for "'+title+'"');
    });
} (jQuery, mediaWiki ));

/*
$(function () {
    if (wgCanonicalNamespace == "Special")
        return;  // no links for special pages
    var title = wgTitle;
    if (wgCanonicalNamespace !== "")
        title = title.replace(/^.*\//, "");  // subpage name only
    var query = encodeURIComponent(title); 
    mw.util.addPortletLink('p-tb', 'https://www.google.com/search?as_eq=wikipedia&q=%22'+query+'%22&num=50',
                   'Google', 't-googlesearch', 'Search Google for "'+title+'"', 'G');
    mw.util.addPortletLink('p-tb', 'https://www.google.com/search?tbm=nws&q=%22'+query+'%22+-wikipedia',
                   'news', 't-googlenewssearch', 'Search Google News for "'+title+'"');
    mw.util.addPortletLink('p-tb', 'https://www.google.com/search?&q=%22'+query+'%22+site:news.google.com/newspapers&source=newspapers',
                   'newspapers', 't-googlenewspapersearch', 'Search newspapers for "'+title+'"');
    mw.util.addPortletLink('p-tb', 'https://www.google.com/search?tbs=bks:1&q=%22'+query+'%22+-wikipedia',
                   'books', 't-googlebookssearch', 'Search Google Books for "'+title+'"');
    mw.util.addPortletLink('p-tb', 'https://scholar.google.com/scholar?q=%22'+query+'%22',
                   'scholar', 't-googlescholarsearch', 'Search Google Scholar for "'+title+'"');
    mw.util.addPortletLink('p-tb', 'https://www.jstor.org/action/doBasicSearch?Query=%22'+query+'%22&acc=on&wc=on',
                   'JSTOR', 't-jstor', 'Search JSTOR for "'+title+'"');
});
*//*
https://www.google.com/search?as_eq=wikipedia&q=%22'+query+'%22&num=50
https://www.google.com/search?tbm=nws&q=%22'+query+'%22+-wikipedia
https://www.google.com/search?&q=%22'+query+'%22+site:news.google.com/newspapers&source=newspapers
https://www.google.com/search?tbs=bks:1&q=%22'+query+'%22+-wikipedia
https://scholar.google.com/scholar?q=%22'+query+'%22
https://www.jstor.org/action/doBasicSearch?Query=%22'+query+'%22&acc=on&wc=on
*/