MediaWiki: Common.js

From Genesys Documentation
Jump to: navigation, search

Note: After saving, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Go to Menu → Settings (Opera → Preferences on a Mac) and then to Privacy & security → Clear browsing data → Cached images and files.
/* Any JavaScript here will be loaded for all users on every page load. */
$(function () {
  if($("div#public-uc-heading").length) {
    var styles = {
      float : "none",
      fontSize: "50px",
      marginBottom: "15px",
      color: "#fff"
    };
    $("#firstHeading").css( styles ).prependTo("#public-uc-heading");
    var image = $("span.image-link").html(); 
    var imageStyles = {
      background: "linear-gradient(rgba(255,79,31,0.7),rgba(255,79,31,0.7)),url(" + image + ") no-repeat left 0/100%",
      padding: "50px",
      opacity: "1"
    }
    $("div#public-uc-heading").css( imageStyles );
  }

var apps = [];
console.log('YAMLBOX ON');
var boxElements = document.getElementsByClassName("yamlhead");
for (var i = 0; i < boxElements.length; i++) {

    var currentId = boxElements[i].getAttribute('id');
    boxElements[i].onclick = function () {
        console.log('click', currentId);
        var chilDivs = this.parentNode.getElementsByClassName("yaml-details");
        console.log('click', currentId, chilDivs);
        var classes = chilDivs[0].getAttribute('class');
        if (classes.includes('yaml-hidden')) {
            //remove hidden, replace with visible
            chilDivs[0].setAttribute('class', classes.replace('yaml-hidden', 'yaml-show'));
        } else {
            chilDivs[0].setAttribute('class', classes.replace('yaml-show', 'yaml-hidden'));
        }
    };
}
}());
//If there is a "footer-notice", move it to the bottom of the page
if ($("#footer-notice").html().length > 0) {
	$("#footer-notice").appendTo("#content");
	$("#footer-notice").css("display", "block");
}
Retrieved from "https://all.docs.genesys.com/MediaWiki:Common.js (2024-05-16 15:11:20)"