Difference between revisions of "MediaWiki:Common.js"

From 24PinTech Wiki
Jump to navigation Jump to search
 
(12 intermediate revisions by the same user not shown)
Line 1: Line 1:
/* Any JavaScript here will be loaded for all users on every page load. */
// js on this page loads globally


$(function () {
$(function () {
  // #wip
   var e = document.getElementById('wip');
   var e = document.getElementById('wip');
   e.style["font-size"] = "32px";
   e.style["font-size"] = "32px";
  e.style["vertical-align"] = "center";
   e.style["font-weight"] = "700";
   e.style["font-weight"] = "700";
  e.style["text-align"] = "center";


   var e2 = document.getElementById('cde');
  // #notice
   e2.style.color = "rgba(0, 0, 0, 1)";
   var notice = document.getElementById("notice");
   e2.style["background-color"] = "rgba(248, 249, 250, 1)";
  notice.style["background-color"] = "rgba(255, 56, 56, .5)";
  e2.style.border = "1px solid rgba(234, 236, 240, 1)";
  notice.style["font-size"] = "20px";
  e2.style["font-family"] = "'Courier', monospace";
  notice.style.border = "1px solid rgba(255, 56, 56, 1)";
  //e2.style.padding = "5px";
  notice.style.padding = "1em"; // i don't like em either but consistency is good
 
  // #banner
  var banner = document.getElementById("banner");
  notice.style["background-color"] = "rgba(52, 205, 239, .5)";
  notice.style["font-size"] = "20px";
   notice.style.border = "1px solid rgba(52, 205, 239, 1)";
   notice.style.padding = "1em";
 
 
  // #cde (in-line code element, use with span)
  var cdeArray = document.getElementsByClassName('cde');
  for (i = 0; i < cdeArray.length; i++) {
    cdeArray[i].style["background-color"] = "rgba(248, 249, 250, 1)";
    cdeArray[i].style.border = "1px solid rgba(234, 236, 240, 1)";
    cdeArray[i].style["font-family"] = "'Courier', monospace";
    cdeArray[i].style.padding = "4px";
  }
}());
}());

Latest revision as of 20:13, 9 May 2018

// js on this page loads globally

$(function () {
  // #wip
  var e = document.getElementById('wip');
  e.style["font-size"] = "32px";
  e.style["font-weight"] = "700";
  e.style["text-align"] = "center";

  // #notice
  var notice = document.getElementById("notice");
  notice.style["background-color"] = "rgba(255, 56, 56, .5)";
  notice.style["font-size"] = "20px";
  notice.style.border = "1px solid rgba(255, 56, 56, 1)";
  notice.style.padding = "1em"; // i don't like em either but consistency is good

  // #banner
  var banner = document.getElementById("banner");
  notice.style["background-color"] = "rgba(52, 205, 239, .5)";
  notice.style["font-size"] = "20px";
  notice.style.border = "1px solid rgba(52, 205, 239, 1)";
  notice.style.padding = "1em";


  // #cde (in-line code element, use with span)
  var cdeArray = document.getElementsByClassName('cde');
  for (i = 0; i < cdeArray.length; i++) {
    cdeArray[i].style["background-color"] = "rgba(248, 249, 250, 1)";
    cdeArray[i].style.border = "1px solid rgba(234, 236, 240, 1)";
    cdeArray[i].style["font-family"] = "'Courier', monospace";
    cdeArray[i].style.padding = "4px";
  }
}());