User:Xenwolf/vector.js: Difference between revisions

From Xenharmonic Wiki
Jump to navigation Jump to search
Xenwolf (talk | contribs)
testing...
Xenwolf (talk | contribs)
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)).add("🙂");
   $("#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]");
});