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"    ] });

/* ********** Wikimarks ********** */ 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 ********** */ var bg = $('#WikiaPageBackground').css('background'); var width = 320;

mw.util.addCSS('.sidebar { transition-duration: 0.2s; position: fixed; right: -' + width + 'px; width: ' + width + 'px; height: 100%; background: '+ bg +'; z-index: 5000103; padding: 1em; box-sizing: border-box; } .sidebar.show { right: 0; 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; -webkit-tap-highlight-color: transparent; }');

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

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

function sidebar { $('.black-out').fadeToggle( 200 ); $('.sidebar').toggleClass("show"); }