User:KurwaAntics/global.js

/* ********** Load scripts ********** */ importArticles({   type: "script",    articles: [        "u:dev:RelocateEditDiscussionButtons/code.js",        "u:dev:DisplayClock/code.js",        "u:dev:FindAndReplace/code.js",        "u:dev:View_Source/code.js",        "u:dev:Wikimarks/code.js",        "u:dev:QuickDiff/code.js",        "u:dev:ClearSandbox/code.js"    ] });

/* ********** Full resolution images ********** *//* $("img").click(function(e) {   if ( e.shiftKey ) {        var src = $(this).attr("src").split("/scale-to-width-down", 1);        $(this).attr("src", src).css({"max-width": "100%"});        event.preventDefault;        return false;    } });

if ( $("#file img").length > 0 ) { var src = $("#file img").attr("src").split("/scale-to-width-down", 1); $("#file img").attr("src", src); } /* ********** Case redirect ********** */ if ( $('.noarticletext .mw-headline a').length > 0 ) { window.location = $('.noarticletext .mw-headline a').attr('href'); }

// window.wgEnableLightboxExt = false;

if ( wgUserGroups.indexOf("sysop") < 0 ) { mw.util.addCSS('.admin-only { display: none; }'); }

/* ********** Google ********** */ $('Search on Google').insertAfter('#search-v2-button');

function googlesearch { window.open('https://www.google.com.hk/search?q=' + $('#search-v2-input').val + '+site:' + window.location.hostname,'_blank'); }

/* ********** Sidebar ********** */ mw.util.addCSS('.sidebar { position: fixed; right: -300px; width: 300px; height: 100%; background: #f8f8f8; z-index: 5000103; padding: 1em; box-sizing: border-box; box-shadow: 0 0 20px rgba(0,0,0,0.5); } .black-out { display: none; position: fixed; width: 100%; height: 100%; background: black; opacity: 0.5; z-index: 5000102; }');

$('.toolbar .tools').append('Sidebar');

$('body').prepend(' Sidebar  ');

function sidebar { $('.sidebar').toggle(function {       $('.sidebar').animate( { right: "+=300" }, 100 );    }, function {        $('.sidebar').animate( { right: "-=300" }, 100 );    });

//toggle( function{ $('.sidebar').animate( { right: "+=300" }, 100 ); }); $('.black-out').fadeToggle( 100 ); }