Jump to content

User:PrimeHunter/common.js

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by PrimeHunter (talk | contribs) at 20:58, 17 April 2017 (importScript('User:PrimeHunter/Safe mode.js'); // Linkback: User:PrimeHunter/Safe mode.js). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
importScript('User:קיפודנחש/cat-a-lot.js');// Backlink: [[User:קיפודנחש/cat-a-lot.js]]
importScript('User:PrimeHunter/Subpages.js'); // Linkback: [[User:PrimeHunter/Subpages.js]]
importScript('User:PrimeHunter/Image tabs.js'); // Linkback: [[User:PrimeHunter/Image tabs.js]]
importScript('User:PrimeHunter/English_interface.js'); // Linkback: [[User:PrimeHunter/English interface.js]]
importScript('User:Mr. Stradivarius/gadgets/DiffOnly.js') // Linkback: [[User:Mr. Stradivarius/gadgets/DiffOnly.js]]
importScript('User:Mr. Stradivarius/gadgets/SearchEditLink.js') // Linkback: [[User:Mr. Stradivarius/gadgets/SearchEditLink.js]]
importScript('User:PrimeHunter/Pageviews.js'); // Linkback: [[User:PrimeHunter/Pageviews.js]]
importScript('User:PrimeHunter/Search_sister_projects.js'); // Linkback: [[User:PrimeHunter/Search sister projects.js]]
importScript('User:PrimeHunter/Safe mode.js'); // Linkback: [[User:PrimeHunter/Safe mode.js]]

// Adds a wikidata description just below the "page title"
    var wdDescription = " " 
    var wgLanguage = mw.config.get("wgContentLanguage");
        var wgQid = mw.config.get("wgWikibaseItemId");
        $.ajax({
                url: '//www.wikidata.org/w/api.php',
                data: {
                        action: 'wbgetentities',
                        ids: wgQid,
                        props: "descriptions",
                        languages : wgLanguage,
                        format: 'json'
                },
                dataType: 'jsonp',
                success: function(data) {
                        if ( data.entities[wgQid].descriptions[wgLanguage]){
                                $("#siteSub").append('<div class = "wdDesc">' + wdDescription + data.entities[wgQid].descriptions[wgLanguage].value + '</div>');

                        }
                }
        });