User:Xenwolf/vector.js: Difference between revisions

From Xenharmonic Wiki
Jump to navigation Jump to search
Xenwolf (talk | contribs)
m testing...
Xenwolf (talk | contribs)
m testing...
Line 8: Line 8:
$(document).ready(function(){
$(document).ready(function(){
   console.log("on ready [enter]");
   console.log("on ready [enter]");
   var numWords = $("#mw-content-text > div").text().split(" ").length;
   const numWords = $("#mw-content-text > div").text().split(" ").length;
   var header = $("#firstHeading").text();
   const header = $("#firstHeading").text();
   $("#firstHeading").text(format_words(header, numWords));
   $("#firstHeading").text(format_words(header, numWords));
  $("#toolbar").add('<div title="smile" id="user-button-smile" class="mw-toolbar-editbutton">"&#x1F642;"</div>');
   console.log("on ready [leave]");
   console.log("on ready [leave]");
});
});

Revision as of 13:35, 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('<div title="smile" id="user-button-smile" class="mw-toolbar-editbutton">"&#x1F642;"</div>');
  console.log("on ready [leave]");
});