Difference between revisions of "User:R0o0di/common.js"

From Detective Conan Wiki
(Undo revision 383417 by R0o0di (talk))
(Tag: Undo)
 
Line 1: Line 1:
const numWords = $( '#mw-content-text > div' ).text().split( ' ' ).length;
+
mw.loader.using(['mediawiki.util'], function () {
const headerWords = $( 'h1' ).text().split( ' ' ).length;
+
console.log("ttt");
const totalWords = numWords + headerWords;
+
});
const timeInMinutes = totalWords / 200;
 
const header = $( 'h1' ).text();
 
$( 'h1' ).text( header + ' (it will take you ' + timeInMinutes + ' minutes to read this page)' );
 

Latest revision as of 22:46, 11 April 2025

mw.loader.using(['mediawiki.util'], function () {
console.log("ttt");
});