Difference between revisions of "MediaWiki: Common.js"

From Genesys Documentation
Jump to: navigation, search
Line 11: Line 11:
 
     if($("span.image-link").length) {
 
     if($("span.image-link").length) {
 
         var image = $("span.image-link").html();
 
         var image = $("span.image-link").html();
console.log("Image found " + image);
+
console.log(image);
 
         $("div#public-uc-heading").css( "background: linear-gradient(rgba(255,79,31,0.7),rgba(255,79,31,0.7)),url('" + image + "').html()) no-repeat top -65px left 0/100%");
 
         $("div#public-uc-heading").css( "background: linear-gradient(rgba(255,79,31,0.7),rgba(255,79,31,0.7)),url('" + image + "').html()) no-repeat top -65px left 0/100%");
 
     }
 
     }

Revision as of 16:58, October 30, 2020

/* 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");
    if($("span.image-link").length) {
        var image = $("span.image-link").html();
console.log(image);
        $("div#public-uc-heading").css( "background: linear-gradient(rgba(255,79,31,0.7),rgba(255,79,31,0.7)),url('" + image + "').html()) no-repeat top -65px left 0/100%");
    }
  }

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'));
        }
    };
}
}());
Retrieved from "https://all.docs.genesys.com/MediaWiki:Common.js (2025-06-19 10:38:44)"