User:Sanchozz/global.js

window.nullEditDelay = 2000; window.massRenameDelay = 2000; window.massEditConfig = { editInterval: 2000 };

window.ImprovedTabbers = { HideHeaderTitle: false, HideContentTitle: true, };

/* importArticles({   type: 'script',    articles: [ //        'u:dev:MediaWiki:ImprovedTabbers.js', //        'u:dev:MediaWiki:PurgeButton/code.js', //        'u:dev:MediaWiki:MassNullEdit/code.js', //        'u:dev:MediaWiki:FastOldImageDelete/code.js', //        'u:dev:MediaWiki:MassCategorization/code.js', //        'u:dev:MediaWiki:MassRename/code.js', //        'u:dev:MediaWiki:MassEdit/code.js', //        'u:dev:MediaWiki:Wikificator.js',        'u:dev:MediaWiki:SandboxTab/code.js', //        'u:dev:MediaWiki:QuickDiff/code.js', //        'u:dev:MediaWiki:RCStats.js' ,        'u:dev:MediaWiki:SourceEditButton.js',    ] });

/* $(function {   $(".DSWHoverTabContainer img.lzy").each(function { var dataSrc = $(this).attr('data-src'); if (dataSrc) { $(this).attr('src', dataSrc); }   }); });

//require(['wikia.window', 'jquery', 'mw'],

(function (module, $, mw) {

if (/*typeof module.Load !== 'undefined' || */$('body').hasClass('editor')) { return; // prevent second load. }   module = $.extend({        Load: true,        HideHeaderTitle: true,        HideContentTitle: true,        NonASCIIAnchor: true,        SynchroInfoboxes: true,        SynchroTabbers: true,    }, module); const HeaderTitle = module.HideHeaderTitle  ? 'data-tabber-title' : 'title', ContentTitle = module.HideContentTitle ? 'data-tabber-title' : 'title'; if (module.HideHeaderTitle || module.HideContentTitle || module.SynchroTabbers) { var tabbers = $(".tabber"); tabbers.each(function {           var $this = $(this),            tabContent = $this.children('.tabbertab'),            nav = $this.children('.tabbernav');            // hidding titles in header and content of tabbers.            if (module.HideHeaderTitle) {                nav.find('a').each(function  { $(this).attr(HeaderTitle, $(this).attr('title') ); $(this).attr('title', null); });           }

if (module.HideContentTitle) { tabContent.each(function {                    $(this).attr(ContentTitle, $(this).attr('title') );                    $(this).attr('title', null);                }); }           function showContent(title) { var content = tabContent.filter('[' + ContentTitle + '="' + title + '"]'); if (content.length !== 1) return false; tabContent.hide; content.show; nav.find('.tabberactive').removeClass('tabberactive'); nav.find('a[' + HeaderTitle + '="' + title + '"]').parent.addClass('tabberactive'); $(window).trigger('scroll'); return true; }           nav.off('click', 'a'); nav.on('click', 'a', function (e) {               var title = $(this).attr(HeaderTitle);                e.preventDefault;                location.hash = '#' + title;                showContent(title);                // open tabs with same name in others tabbers on page                if (module.SynchroTabbers) {                    tabbers.not($this).find('.tabbernav a[' + HeaderTitle + '="' + title + '"]').trigger('customclick', [title]);                }            }); nav.on('customclick', 'a', function (e, title) {               showContent(title);            }); });   }    // if tabber contain inside infoboxes with collapsible sections    // when section on active tab collapsed or expanded    // then automatically synchronously collapse or expande sections with same name on nonactive tabs    if (module.SynchroInfoboxes) {        var collapsibleGroups = $(".tabber .pi-collapse");        collapsibleGroups.each(function(index) { collapsibleGroups.eq(index).find(".pi-header:first").click(function {               collapsibleGroups.not($(this).parent).has(".pi-header:first:contains('" + $(this).text + "')").toggleClass("pi-collapse-closed");            }); });   }    // if location hash anchor contain a non ascii-characters, decode it and open tab with same title    if (module.NonASCIIAnchor) {        var loc = location.hash.replace("#", "").replace(/\./g, "%");        if (loc !== "") {            $(".tabber .tabbernav a").filter(function { return (mw.util.wikiUrlencode($(this).attr(HeaderTitle)) == loc); }).click;       }    } } (window.ImprovedTabbers = window.ImprovedTabbers || {}, jQuery, mediaWiki));