User:KurwaAntics/global.js

// AjaxBatchDelete delay // batchDeleteDelay = 750;

// Import script files // importArticles({   type: "script",    articles: [        "w:c:dev:DisplayClock/code.js",        "w:c:dev:ReferencePopups/code.js",        "w:c:dev:FindAndReplace/code.js",        "w:c:dev:RevealAnonIP/usercode.js",        "w:c:community:MediaWiki:Snow.js"    ] });

// Quick redirect // if( window.location.href.indexOf('T:') > -1) window.location.href = window.location.href.replace('T:','Template:'); if( window.location.href.indexOf('mw:') > -1) window.location.href = window.location.href.replace('mw:','MediaWiki:');

// Teleporter // $(".page-User_Yhynerson1 .mw-content-ltr.mw-content-text, .page-用戶_Yhynerson1 .mw-content-ltr.mw-content-text").prepend(' ')

// Replace pictures with Font Awesome icons // $('a[data-name="whatlinkshere"]').prepend(' '); $('a[data-name="upload"]').prepend(' '); $('a[data-name="themedesigner"], span[title="This tool can be used by wiki administrators."]').prepend(' '); $('.mytools.menu > a').prepend('  '); $('a.tools-customize').prepend('  ');

var x = (window.location.href.indexOf('?') > -1) ? '&' : '?';

// Edit wiki navigation // $(".WikiHeader div.buttons").append(   ' '+    '  Edit wiki navigation'+    '  ' ); // Edit the section before TOC // $(".header-column.header-title").append(   'Edit</a>' );

// Font changer // function changefont { var y = document.getElementById("changefont").value; $( "body" ).css( 'font-family', y ); }

// New bar // $("body").prepend(

// Edit menu // '<div style="position: fixed; z-index: 9; left: 50%; transform: translateX(-50%); bottom: 0" class="bar">'+ '<select class="page-actions" onChange="window.location.href=this.value">'+ ' Menu '+ '<optgroup label="Page actions">'+ '<option class="editpage" value="' + $("#ca-edit").attr("href") + '">Edit '+ '<option class="view-source" value="' + window.location.href + x + 'action=raw">View source '+ '<option class="history" value="' + $("#ca-history").attr("href") + '">History '+ '<option class="move" value="' + $("#ca-move").attr("href") + '">Move '+ '<option class="talk-comments" value="' + $(".wikia-button.comments.secondary").attr("href") + '">Talk '+ '<option class="protect" value="' + $("#ca-protect").attr("href") + '">Protect '+ '<option class="unprotect" value="' + $("#ca-unprotect").attr("href") + '">Change protection '+ '<option class="delete" value="' + $("#ca-delete").attr("href") + '">Delete '+ ' '+ '<optgroup label="User">'+ '<option value="' + $("a[data-id=userpage]").attr("href") + '">My page '+ '<option value="' + $("a[data-id=mytalk]").attr("href") + '">Talk '+ '<option value="/wiki/Special:Contributions/' + wgUserName + '">Contributions '+ '<option value="/wiki/Special:Preferences">Settings '+ ' '+ '<optgroup label="Tools">'+ ' Tools '+ '<option value="' + $("a[data-name=whatlinkshere]").attr("href") + '">What links here '+ '<option class="themedesigner" value="' + $("a[data-name=themedesigner]").attr("href") + '">Theme designer '+ '<option value="/wiki/Special:Upload">Upload '+ ' '+ ' '+ '<select id="changefont" onchange="changefont;">'+ ' Change font '+ '<option name="font" value="Helvetica">Helvetica '+ '<option name="font" value="Helvetica Neue">Helvetica Neue '+ '<option name="font" value="Arial">Arial '+ '<option name="font" value="Roboto">Roboto '+ '<option name="font" value="\'.SFNSDisplay-Regular\'">San Francisco Display '+ '<option name="font" value="-apple-system, San Francisco">San Francisco Text '+ ' '+ ' ');

var userAgent = navigator.userAgent || navigator.vendor || window.opera; if( userAgent.match( /iPad/i ) || userAgent.match( /iPhone/i ) || userAgent.match( /iPod/i ) || userAgent.match( /Android/i )) $(".bar").hide;

if( $("#ca-edit").attr("href")===undefined) { ez = window.location.href + x + 'action=raw'; iz = 'fa-code'; } else { ez = $("#ca-edit").attr("href"); iz = 'fa-pencil'; }

$("body").prepend( // Quick edit button '<div onclick="location.href=\'' + ez + '\'"class="round-button editpage2" style="position: fixed; background: white; left: 0; bottom: 0; z-index: 9; border-top: 1px solid #ccc; border-right: 1px solid #ccc; border-top-right-radius: 99px; padding: 16px 16px 8px 8px; "></i> '+ // Search button '<div onclick="location.href=\'https://cse.google.com/cse/home?cx=015628384834097629555:tqjcvwmdock\'"class="round-button" style="position: fixed; background: white; right: 0; bottom: 0; z-index: 9; border-top: 1px solid #ccc; border-left: 1px solid #ccc; border-top-left-radius: 99px; padding: 16px 8px 8px 16px; "></i> ');

// Edit boolean // if( $(".wikia-button.comments.secondary").attr("href")===undefined){ $(".talk-comments").hide; } if( $("#ca-edit").attr("href")===undefined){ $(".editpage").hide; } if( $("#ca-history").attr("href")===undefined){ $(".history").hide; } if( $("#ca-move").attr("href")===undefined){ $(".move").hide; } if( $("#ca-protect").attr("href")===undefined){ $(".protect").hide; } if( $("#ca-unprotect").attr("href")===undefined){ $(".unprotect").hide; } if( $("#ca-delete").attr("href")===undefined){ $(".delete").hide; } if( $("a[data-id=wikinavedit]").attr("href")===undefined){ $(".wikinavedit").hide; } if( $("a[data-name=themedesigner]").attr("href")===undefined){ $(".themedesigner").hide; } if( window.location.href.indexOf('Message_Wall:') >= 0 || window.location.href.indexOf('Thread:') >= 0 || window.location.href.indexOf('Special:') >= 0 || window.location.href.endsWith("User_blog:" + wgUserName ) ){ $('.page-actions, .round-button.editpage2').hide; }

// Show Hide Bar // $("body:not(.mainpage):not(.editor)").prepend(' </i> ');

$(".WikiaPage").prepend(' ');

$( "#WikiaRail" ).addClass( "show-hide-hidden" );

$( ".show-hide-rail" ).click(function {   if ( $( "#WikiaRail" ).hasClass( "show-hide-hidden" ) === false ) {        HideRail;    } else if ( $( "#WikiaRail" ).is(":visible") === true ) {        ShowRail;    } }); $( ".show-hide-greyout" ).click(function {   HideRail; });

function ShowRail { $( "#WikiaRail" ).removeClass( "show-hide-hidden" ); $( "#WikiaRail" ).animate( {"right": "0"}, 250 ); $( "#WikiaPage" ).animate( {"left": "-300px"}, 250 ); $( ".show-hide-rail" ).animate( {"right": "300px"}, 250 ); $( ".show-hide-rail i" ).addClass( "fa-chevron-right" ).removeClass( "fa-chevron-left" ); $( ".show-hide-greyout" ).fadeIn(250); }

function HideRail { $( "#WikiaRail" ).addClass( "show-hide-hidden" ); $( "#WikiaRail" ).animate( {"right": "-300px"}, 250 ); $( "#WikiaPage" ).animate( {"left": "0"}, 250 ); $( ".show-hide-rail" ).animate( {"right": "0"}, 250 ); $( ".show-hide-rail i" ).addClass( "fa-chevron-left" ).removeClass( "fa-chevron-right" ); $( ".show-hide-greyout" ).fadeOut(250); }

// Background color brightness // var bgColor = $('#WikiaPageBackground').css('background-color'); if ('transparent' == bgColor) bgColor = $('#WikiaPage').css('background-color'); if ('transparent' == bgColor) bgColor = $('#EditPageHeader').css('background-color'); var color = bgColor; function isBright (color) { var m = color.match(/(?:([\da-fA-F]{2})([\da-fA-F]{2})([\da-fA-F]{2}))|(?:(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3}))/); if (!m) return false; var rgb = m[1] ? { r: parseInt(m[1], 16), g: parseInt(m[2], 16), b: parseInt(m[3], 16) } : { r: parseInt(m[4], 10), g: parseInt(m[5], 10), b: parseInt(m[6], 10) }; return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1000 >= 128; } if(isBright (color)===false) { $(".show-hide-rail, #WikiaRail").css({"background":"#333", "border-color":"#666", "color":"#ccc"}); $(".round-button").css({"background":"#333", "border-color":"#666"}); $(".round-button i").css("color","#ccc"); $(".changefont").css('background', 'rgba(96, 96, 96, 0.5)'); }