Open main menu
Home
Random
Nearby
Log in
Settings
About Kancolle Wiki
Disclaimers
Kancolle Wiki
Search
Changes
← Older edit
Newer edit →
MediaWiki:Common.js
(view source)
Revision as of 09:21, 28 July 2024
549 bytes added
,
1 month ago
no edit summary
Line 583:
Line 583:
updateContent();
updateContent();
mw.hook("wikipage.content").add(updateContent);
mw.hook("wikipage.content").add(updateContent);
+
+
function showPageSizeWarning() {
+
var newpp = $(".mw-parser-output").contents().filter(function () { return this.nodeType === 8 && this.data.match(/Post‐expand include size: (\d+)\/(\d+) bytes/); });
+
if (!newpp.length) return;
+
var sizes = newpp[0].data.match(/Post‐expand include size: (\d+)\/(\d+) bytes/);
+
var usage = +sizes[1] / +sizes[2];
+
if (usage >= 0.95) {
+
$('#content').prepend('<pre style="color: red; text-align: center;">Warning: post‐expand include size is over 95%</pre>');
+
}
+
}
+
+
showPageSizeWarning();
});
});
}(mediaWiki, jQuery));
}(mediaWiki, jQuery));
がか
cssedit, gkautomate
7,060
edits