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

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

// Toolbox // $("body").prepend('  Toolbox '+ ' Developer tools '+ 'Original width'+ ' Page actions '+ 'Edit page'+ 'View source'+ 'View history'+ 'Talk</a>'+ '<a href="' + $("#ca-move").attr("href") + '" class="page-actions move">Move</a>'+ '<a href="' + $("#ca-protect").attr("href") + '" class="page-actions protect">Protect</a>'+ '<a href="' + $("#ca-unprotect").attr("href") + '" class="page-actions unprotect">Change protection</a>'+ '<a href="' + $("#ca-delete").attr("href") + '" class="page-actions delete">Delete</a>'+ '<a href="' + $("a[data-id=userpage]").attr("href") + '">My user page</a>'+ '<a href="/wiki/Special:Preferences">Settings and notifications</a>'+ '<a href="/wiki/Special:WhatLinksHere/' + wgPageName + '">What links here</a>'+ '<a href="/wiki/Special:Upload">Upload</a>'+ '<a href="/wiki/Special:AdminDashboard" class="themedesigner">Admin dashboard</a>'+ '<a href="https://cse.google.com/cse/home?cx=015628384834097629555:tqjcvwmdock">Search</a>'+ ' ');

$('.originalwidth').toggle(function {   $('body:not(.mainpage) .WikiaMainContent').css("width","704px");    $('.originalwidth').html('Full width'); }, function {    $('body:not(.mainpage) .WikiaMainContent').css("width","100%");    $('.originalwidth').html('Original width'); });

// 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(' ')

// Edit wiki navigation // $(".WikiHeader div.buttons").append(   ' '+    '<a href="' + $("a[data-id=wikinavedit]").attr("href") + '" style="vertical-align: top; margin-top: 0.3em;">  </i>Edit wiki navigation</a>'+    '  ' ); // Edit the section before TOC // $(".header-column.header-title").append(   '<a class="editpage" href="' + $("#ca-edit").attr("href") + '&amp;section=0" title="Edit Extended Version section">Edit</a>' );

$('.page-User_blog_Yhynerson1 #mw-content-text').prepend('<a href="/wiki/Special:CreateBlogPage" style="position:relative; left:.75em; top:.75em;">Create Blog page</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">'+

'<a href="' + $("#ca-edit").attr("href") + '" class="wikia-button page-actions editpage"></i></a>'+

'<a href="' + window.location.href + x + 'action=raw" class="wikia-button page-actions view-source"></i></a>'+

'<a href="' + $("#ca-history").attr("href") + '" class="wikia-button page-actions history"><i class="fa fa-history" title="View history"></i></a>'+

'<a href="' + $(".wikia-button.comments.secondary").attr("href") + '" class="wikia-button page-actions talk-comments"><i class="fa fa-comments" title="Talk"></i></a>'+

'<a href="' + $("#ca-move").attr("href") + '" class="wikia-button page-actions move"><i class="fa fa-scissors" title="Move"></i></a>'+

'<a href="' + $("#ca-protect").attr("href") + '" class="wikia-button page-actions protect"><i class="fa fa-lock" title="Protect"></i></a>'+

'<a href="' + $("#ca-unprotect").attr("href") + '" class="wikia-button page-actions unprotect"><i class="fa fa-unlock-alt" title="Change protection"></i></a>'+

'<a href="' + $("#ca-delete").attr("href") + '" class="wikia-button page-actions delete"><i class="fa fa-trash" title="Delete"></i></a>'+

'<a href="' + $("a[data-id=userpage]").attr("href") + '" class="wikia-button"><i class="fa fa-user" title="My user page"></i></a>'+

'<a href="/wiki/Special:Preferences" class="wikia-button"><i class="fa fa-cog" title="Settings"></i></a>'+

'<a href="/wiki/Special:WhatLinksHere/' + wgPageName + '" class="wikia-button"><i class="fa fa-link" title="What links here"></i></a>'+

'<a href="/wiki/Special:Upload" class="wikia-button"><i class="fa fa-upload" title="Upload"></i></a>'+

'<a href="/wiki/Special:AdminDashboard" class="wikia-button themedesigner"><i class="fa fa-bars" title="Admin dashboard"></i></a>'+

'<a href="https://cse.google.com/cse/home?cx=015628384834097629555:tqjcvwmdock" class="wikia-button"><i class="fa fa-search" title="Search"></i></a>'+

' ');*/

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'; }

// Detect iOS 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; $("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 class="fa ' + iz + '" style=" font-size: 16px; color: #444; width:1em; height:1em"></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 class="fa fa-search" style=" font-size: 16px; color: #444; width:1em; height:1em"></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; }

// 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) { $("#WikiaRail").show.css({"background":"#333", "border-color":"#666", "color":"#ccc"}); $(".toolboxpanel").css({"background":"#333", "border-color":"#666", "color":"#ccc"}); $(".round-button, .bar").css({"background":"#333", "border-color":"#666"}); $(".bar .wikia-button").css({"background":"#333"}); $(".round-button i, .bar .wikia-button i").css("color","#ccc"); //$(".changefont").css('background', 'rgba(96, 96, 96, 0.5)'); } else { $("#WikiaRail").show }