25,204
edits
No edit summary |
No edit summary Tag: Reverted |
||
(26 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 () { | ||
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 193: | Line 197: | ||
performIE(); | performIE(); | ||
enhancements(); | enhancements(); | ||
// Fix the preview button losing custom script output | |||
// This is a complete ChatGPT moment, I couldn't be arsed to debug on my own | |||
$(document).on('DOMNodeInserted', function (event) { | |||
var element = event.target; | |||
if ($(element).hasClass('previewnote')) { | |||
var previewLoaded = $(element).find('.previewloading').length == 0; | |||
if (previewLoaded && !$(element).hasClass('custom-preview-run')) { | |||
$(element).addClass('custom-preview-run'); | |||
enhancements(); | |||
} | |||
} | |||
}); | |||
}); | }); | ||
Line 483: | 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 494: | Line 516: | ||
// Fix scripts literally disappearing when clicking "save changes" in VE | // Fix scripts literally disappearing when clicking "save changes" in VE | ||
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 | |||
originalSaveComplete.call(this, data); | |||
// Custom things | |||
doRoundEdges(); | doRoundEdges(); | ||
enhancements(); | enhancements(); | ||
} | } | ||
}); | }); |