Community Central
Community Central
No edit summary
(toolbar available in editor)
Line 34: Line 34:
 
$("#my-tools-menu").append('<li><a href="' + url + '">' + title + '</a>');
 
$("#my-tools-menu").append('<li><a href="' + url + '">' + title + '</a>');
 
});
 
});
 
/****WhatLinksHere in editor****/
 
/*******Visual Editor********/
 
mw.hook('ve.activationComplete').add(function() {
 
$(".ve-init-mw-viewPageTarget-toolbar-actions").append('<span class="oo-ui-widget oo-ui-buttonElement-framed oo-ui-buttonWidget" tabindex="0"><a class="oo-ui-buttonElement-button" href="/Special:WhatLinksHere/' + wgRelevantPageName + '" target="_blank">WhatLinksHere</a></span>');
 
});
 
 
/*******Classic Editor*******/
 
$("#EditPageToolbar").append('<a href="/Special:WhatLinksHere/' + wgRelevantPageName + '" target="_blank"><p style=" text-align:center; background:' + mw.config.get('wgSassParams')['color-links'] + '; color:white; font-family:Rubik; border-radius:3em 3em 3em 3em">WhatLinksHere</p></a>');
 
   
 
/****Infobox + Mobile related stuff****/
 
/****Infobox + Mobile related stuff****/

Revision as of 21:47, 23 April 2021

window.pageCreatorAvatar = true;
window.pageCreatorTimestamp = true;
window.pageCreatorUTC = true;
window.ajaxSpecialPages = ["Recentchanges", "WikiActivity", "Log"];
window.ajaxRefresh = 25000;

importArticles({
    type: 'script',
    articles: [
        'u:dev:AjaxRC/code.js',
        'u:dev:UserAccountAge/code2.js',
        'u:dev:PageCreator/code2.js',
        'u:dev:LastEdited/code.js',
        'u:dev:View Source/code.js',
        'u:dev:UserActivityTab/code.js',
        'u:dev:GlobalEditcount/code.js',
        'u:dev:PortableCSSPad/code.js',
        'u:dev:MassNullEdit/code.js'
    ]
});

/****JS and CSS pages on toolbar****/
var Links = {
	"/Special:MyPage/common.js": "Personal JS",
	"//community.wikia.com/wiki/Special:MyPage/global.js": "Global JS",
	"//community.wikia.com/wiki/Special:MyPage/global.css": "Global CSS",
    "/MediaWiki:Common.js": "Wiki JS",
    "/MediaWiki:Wikia.css": "Wiki CSS",
    "/MediaWiki:ImportJS": "ImportJS",
    "/Special:PrefixIndex/User:Mendes2": "Personal pages"
};

$.each(Links, function (url, title) {
	$("#my-tools-menu").append('<li><a href="' + url + '">' + title + '</a>');
});

/****Infobox + Mobile related stuff****/
var file = $('.pi-image-thumbnail');
if(file.length!==0) {
    $(".page-header__contribution-buttons .wds-list.wds-is-linked").append('<li><a href="/wiki/File:' + file.attr('data-image-key') + '" target="_blank">Infobox image</a></li>');
}
$(".page-header__contribution-buttons .wds-list.wds-is-linked").append('<li><a href="/' + wgContentLanguage + '/' + wgRelevantPageName.replace("?", "%3F") + '?useskin=mercury">Mobile</a></li>');

if(file.attr('src')===undefined||file.attr('src').match(new RegExp('https?:\/\/vignette.wikia.nocookie.net\/' + wgDBname + '\/.*')))
{
    $(".toolbar .tools").prepend('<li><a href="https://www.google.com/search?q=' + wgPageName.replace(/_/g, "+") + '" target="_blank">Image</a></li>');
}
else
{
    $(".page-header__contribution-buttons .wds-list.wds-is-linked").append('<li><a href="https://www.google.com/search?q=' + wgPageName.replace(/_/g, "+") + '" target="_blank">Google</a></li>');
}

/****Showing amount of redlinks****/
if(wgNamespaceNumber!=-1) {
    var p = document.getElementsByClassName('new').length;
    if(p > 0) {
        if(document.getElementsByClassName('new')[0].id == 'ca-talk'){
            p--;
        }
        if(p > 0) {
        $(".toolbar .tools").prepend('<li>' + p + '</li>');
        }
    }
}