MediaWiki:Common.js: Difference between revisions

no edit summary
No edit summary
No edit summary
(23 intermediate revisions by 2 users not shown)
Line 69: Line 69:
         var rows = $('[class^="colortable-"] td b:contains("' + rowContent + '")');
         var rows = $('[class^="colortable-"] td b:contains("' + rowContent + '")');
         rows.each(function () {
         rows.each(function () {
             if ($(this).text() == rowContent) $(this).parent().addClass('tone-4');
             const textContent = $(this).parents('td')[0].textContent.trim();
            if (textContent == rowContent) $(this).parent().addClass('tone-4');
         })
         })
     })
     })
Line 187: Line 188:
     if (getCookie('elwiki-dark-mode') == 'true') $('body').addClass('dark-mode');
     if (getCookie('elwiki-dark-mode') == 'true') $('body').addClass('dark-mode');
     if (getCookie('not-new') == null) $('#dark-mode-switch').addClass('new');
     if (getCookie('not-new') == null) $('#dark-mode-switch').addClass('new');
    // This is pretty cringe, tabs don't load sometimes
    if (!$('.tabber-new.loaded').length) mw.loader.load('https://elwiki.net/wiki/index.php?title=MediaWiki:Gadget-Tabs.js&action=raw&ctype=text/javascript')
}
}


Line 496: Line 500:
     }
     }
}
}
//Fix height issue with ads
var HeightFix = $("#mw-content-block");
//$("#mw-related-navigation").css("min-height", HeightFix.height());
$("#mw-related-navigation").attr("style", "min-height: " + HeightFix.height() + "px !important");


//Get Ad Dart Number
//Get Ad Dart Number
Line 506: Line 515:


// Fix scripts literally disappearing when clicking "save changes" in VE
// Fix scripts literally disappearing when clicking "save changes" in VE
var originalSaveComplete = ve.init.mw.ArticleTarget.prototype.saveComplete;
mw.hook('ve.activationComplete').add(function () {
mw.hook('ve.activationComplete').add(function () {
    var originalSaveComplete = ve.init.mw.ArticleTarget.prototype.saveComplete;
     ve.init.mw.ArticleTarget.prototype.saveComplete = function (data) {
     ve.init.mw.ArticleTarget.prototype.saveComplete = function (data) {
         // Calling the original implementation first
         // Calling the original implementation first
25,162

edits