Changes

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