User:Kos730/global.js

function loadChatScripts { importArticles({   type: "script",    articles: [        "w:c:dev:ChatOptions/code.js",        "w:c:dev:ChatObject/code.js",        "w:c:d97:MediaWiki:TitleNotifications.js",        "w:c:dev:ChatOptions/code.js",        "User:Monchoman45/ChatHacks.js"    ]    }); mainRoom.maxCharacterLimit = 3000; $("#join-alert").remove; chatIsLoaded = true; } var loadedTester = setInterval(function {  if(typeof mainRoom !== "undefined") {       importScriptPage("MediaWiki:JacobsLadderSuite.js","d97"); // import the API       setTimeout(function { loadChatScripts; },500);      clearInterval(loadedTester);       console.log("[CHAT.JS] Chat.js loading complete.");   } },100); function appendTimestamps { if(cwmLoaded === true) { timer = new Date; hours = timer.getHours % 12; if (hours === 0) { hours = 12; } minutes = timer.getMinutes; seconds = timer.getSeconds; if($("#entry-"+JLAPI.mostRecentMessage.cid).hasClass('inline-alert')) { $("#entry-"+JLAPI.mostRecentMessage.cid).append(" "+hours+":"+padDigits(minutes,2)+":"+padDigits(seconds,2)+" "); } else { $("#entry-"+JLAPI.mostRecentMessage.cid+" > span.time").html(hours+":"+padDigits(minutes,2)+":"+padDigits(seconds,2)); }   } } function padDigits(number, digits) { return Array(Math.max(digits - String(number).length + 1, 0)).join(0) + number; }

//- /*Крутая штука*/ /*Magic Spells - by ShermanTheMythran*/ $('.WikiaBarWrapper .tools').append(' » ▲ ● ► ▼ #trigger{font-size:16px;display:inline-block;cursor:default;transition:transform .5s;-moz-transition:-moz-transform .5s;-webkit-transition:-webkit-transform .5s;-o-transition:-o-transform .5s}.spell{display:inline-block;color:white !important;margin:0 3px;vertical-align:top;cursor:pointer;transition:transform .5s,text-shadow .5s;-moz-transition:-moz-transform .5s,text-shadow .5s;-webkit-transition:-webkit-transform .5s,text-shadow .5s;-o-transition:-o-transform .5s,text-shadow .5s}.spell:hover{text-shadow:0 0 4px silver} '); $('#MagicSpells').mouseenter(function {	$('.spell').toggle('slow');	$('#trigger').css({'transform':'rotateY(180deg)','-moz-transform':'rotateY(180deg)','-webkit-transform':'rotateY(180deg)','-ms-transform':'scaleX(-1)','-o-transform':'scaleX(-1)'}); } ); $('#MagicSpells').mouseleave(function {	$('.spell').toggle('slow');	$('#trigger').css({'transform':'rotateY(0deg)','-moz-transform':'rotateY(0deg)','-webkit-transform':'rotateY(0deg)','-ms-transform':'scaleX(1)','-o-transform':'scaleX(1)'}); } ); $('.scroll-top').click(function {	$(this).parents('html, body').animate({scrollTop:0}, 'slow'); } ); $('#toggle-ads').toggle(function {	$('#toggle-ads').attr('title','Show ads');	$('.wikia-ad, .SelfServeUrl, .home-top-right-ads').hide('slow'); },	function {		$('#toggle-ads').attr('title','Hide ads');		$('.wikia-ad, .SelfServeUrl, .home-top-right-ads').show('slow');	} ); $('#hide-rail').toggle(function {	$('#hide-rail').css({'transform':'rotateY(180deg)','-moz-transform':'rotateY(180deg)','-webkit-transform':'rotateY(180deg)','-ms-transform':'scaleX(-1)','-o-transform':'scaleX(-1)'});	$('#hide-rail').attr('title', 'Show rail');	$('.WikiaRail').hide('slow');	$('.WikiaMainContent').animate({width:'1010'}, 'slow'); },	function {		$('#hide-rail').css({'transform':'rotateY(0deg)','-moz-transform':'rotateY(0deg)','-webkit-transform':'rotateY(0deg)','-ms-transform':'scaleX(1)','-o-transform':'scaleX(1)'});		$('#hide-rail').attr('title', 'Hide rail');		$('.WikiaRail').show('slow');		$('.WikiaMainContent').animate({width:'670'}, 'slow');	} ); $('.scroll-bottom').click(function {	$(this).parents('html, body').animate({scrollTop: $(document).height}, 'slow'); } );

var qtMessageWallGreetingTemplate = '';

var qtEnableUserPageOverwrite = true; var qtEnableMessageWallGreetingOverwrite = true;

// всякая дичь importArticles({   type: 'script',    articles: [        "u:dev:PurgeButton/code.js",        "u:dev:MediaWiki:AjaxRC/code.js",        "u:dev:MediaWiki:PortableCSSPad/code.js",        "u:dev:MediaWiki:NavCodeLinks/code.js",        "u:dev:AjaxThreadUnfollow/code.js",        "u:dev:MediaWiki:GlobalEditcount/code.js",        "u:dev:QQX/code.js",        "u:dev:QuickCreateUserPage/code.js",        "w:dev:QuickCreateMessageWallGreeting/code.js",        'u:dev:AntiSoundcloud/code.js',        "u:dev:CommentPreview/code.js",        "u:dev:MediaWiki:ViewRemoved/code.js",        'u:dev:MediaWiki:EditBio/code.js'    ] }); var ajaxPages = ["Служебная:Watchlist","Служебная:Contributions","Служебная:WikiActivity","Служебная:RecentChanges"]; var AjaxRCRefreshText = 'Автообновление'; var AjaxRCRefreshHoverText = 'Автоматически обновлять страницу';

// http://ru.siegenax.wikia.com/wiki/User:Kopcap94/linkParser.js !function( mw, $ ) { if ( [ 'edit', 'submit' ].indexOf( mw.config.get( 'wgAction' )) === -1 ) return; $( ' ', {       id: 'linkParser',        style: 'float: right; margin-bottom: 5px;',        text: 'Parse',        type: 'button'    }) .insertAfter( '.wpSummary_canMinorEdit' ) .on( 'click', function {       var text = $( '#wpTextbox1' ).val,            new_text = text;        $.each( text.match( /(%[A-Za-z0-9]{2}){1,}/g ), function( i, v ) { try { new_text = new_text.replace( v, decodeURIComponent( v ) ); } catch( e ) { console.log( 'There was error ( ' + e + ' ) during attempt to parse this: ' + v ); }       });        $( '#wpTextbox1' ).val( new_text );    }); }( mediaWiki, jQuery );

/*--*/ /* * Name:        GlobalNavTheme * Description: Allows to switch between light and dark global navbar themes * Author:      Rendann * Support:     Your Own Waifu * Script uses stylesheet of OneTwoThreeFall: * https://dev.wikia.com/wiki/MediaWiki:DarkGlobalNav.css */ (function( $, mw ) {   'use strict';    var i18n = {        en: {            dark: 'Dark Navbar Theme',            light: 'Light Navbar Theme',            info: 'Page needs to be restared in order to apply changes. Do it now?'        }    };    var GNT = {        isDarkOasis: false,        isDarkThemeLoaded: false,        preferredTheme: null,        defines: $.extend({ LIGHT_GNT: 0, DARK_GNT: 1 })   };    i18n = i18n[mw.config.get( 'wgUserLanguage' )] || i18n.en;    var GNTFunctions = {        init: function {            GNT.isDarkOasis = $( 'body' ).hasClass( 'oasis-dark-theme' );            var cookie = document.cookie.match(/wikia_navbar_theme=(\d)/);            if (cookie) {                GNT.preferredTheme = cookie[1];            }            console.log(GNT.isDarkOasis);            console.log(GNT.isDarkThemeLoaded);            console.log(GNT.preferredTheme);            if ( ( GNT.isDarkOasis && !GNTFunctions.isLightThemePreferred ) || GNTFunctions.isDarkThemePreferred ) {                GNT.isDarkThemeLoaded = true;                GNTFunctions.setDarkTheme;            }            GNTFunctions.addLink;        },        addLink: function {            var text = GNT.isDarkThemeLoaded ? i18n.light : i18n.dark;            $( '.wds-global-navigation__user-menu .wds-list').append( ' ' + text + '' ); $( '#gnt' ).on('click', function {                if ( GNT.isDarkThemeLoaded ) {                    GNTFunctions.setCookie(GNT.defines.LIGHT_GNT);                } else {                    GNTFunctions.setCookie(GNT.defines.DAKR_GNT);                }                if ( confirm( i18n.info ) ) {                    location.reload;                }            }); },       setCookie: function(val) { document.cookie = 'wikia_navbar_theme=' + encodeURIComponent(val) + ';path=/'; },       setDarkTheme: function { importStylesheetURI('https://dev.wikia.com/wiki/MediaWiki:DarkGlobalNav.css?action=raw&ctype=text/css'); },       isLightThemePreferred: function { return GNT.preferredTheme == GNT.defines.LIGHT_GNT; },       isDarkThemePreferred: function { return GNT.preferredTheme == GNT.defines.DARK_GNT; }   };    $(GNTFunctions.init); })(jQuery, mediaWiki);