User:Xenwolf/vector.js: Difference between revisions
Jump to navigation
Jump to search
testing... |
m testing... |
||
| Line 10: | Line 10: | ||
const numWords = $("#mw-content-text > div").text().split(" ").length; | const numWords = $("#mw-content-text > div").text().split(" ").length; | ||
const header = $("#firstHeading").text(); | const header = $("#firstHeading").text(); | ||
$("#firstHeading").text(format_words(header, numWords) | $("#firstHeading").text(format_words(header, numWords)+" 🙂 😉 🙁"); | ||
$("#toolbar").add("🙂"); | $("#toolbar").add("🙂"); | ||
console.log("on ready [leave]"); | console.log("on ready [leave]"); | ||
}); | }); | ||
Revision as of 20:41, 31 May 2020
function format_words(title, numWords){
console.log("format_words [enter]");
const text = title+" ("+numWords+" words)";
console.log("format_words: text:"+text);
return text;
}
$(document).ready(function(){
console.log("on ready [enter]");
const numWords = $("#mw-content-text > div").text().split(" ").length;
const header = $("#firstHeading").text();
$("#firstHeading").text(format_words(header, numWords)+" 🙂 😉 🙁");
$("#toolbar").add("🙂");
console.log("on ready [leave]");
});