Viewing File: /usr/local/cpanel/whostmgr/docroot/templates/master_templates/breadcrumbs.min.js

(function(){function Breadcrumb(){this.breadcrumbs=null}Breadcrumb.prototype={getBreadcrumbs:function(){if(typeof $==="undefined"){if(window&&window.console){window.console.log("You must include a version of Jquery to use the breadcrum client API.");throw"You must include a version of Jquery to use the breadcrum client API."}}if(!this.breadcrumbs){this.breadcrumbs=$("#breadcrumbs_list")}return this.breadcrumbs},updateDocLink:function(name){var docsUrl="https://go.cpanel.net/whmdocs"+encodeURIComponent(name.replace(/\W+/g,""));$("#docs-link").attr("href",docsUrl);var docMenuItem=$("#docs-menu-item");if(docMenuItem){docMenuItem.attr("href",docsUrl)}},push:function(name,link,tags){var last=this.getLeaf();var lastHref=last.find("a:last-child");var parentUniqueKey=lastHref.attr("uniquekey");lastHref.removeClass("leafNode");var separator=$("<span>&nbsp;&raquo;</span>");last.append(separator);var newLast=$("<li><a class='leafNode' href='"+link+"'"+(parentUniqueKey?" uniquekey='"+parentUniqueKey+"'":"")+"'><span>"+name+"</span></a></li>");this.setData(newLast,name,tags);last.after(newLast);this.updateDocLink(name)},pop:function(){var last=this.getLeaf();last.remove();last=this.getLeaf();last.find("a").addClass("leafNode");last.children("span").remove();this.updateDocLink(this.getLeafName())},update:function(name,link,tags){var last=this.getLeaf();this.setData(last,name,tags);var lastHref=last.find("a");lastHref.attr("href",link);lastHref.find("span").html(name);this.updateDocLink(name)},setData:function(elem,name,tags){if(!$.isArray(tags)){tags=[tags]}elem.data({name:name,tags:tags});return elem},leafHasTag:function(tag){var tags=this.getLeaf().data("tags");return tags?tags.indexOf(tag)>-1:false},getLeaf:function(){var breadcrumbs=this.getBreadcrumbs();return breadcrumbs.find("li:not(#docs-crumb)").filter(":last")},getLeafName:function(){return this.getLeaf().data("name")},getLeafHref:function(){return this.getLeaf().find("a").attr("href")},getLeafText:function(){return this.getLeaf().find("span").text()},getLeafUniqueKey:function(){return this.getLeaf().find("a").attr("uniquekey")}};function breadcrumbContentHandler(e){window.breadcrumb=new Breadcrumb}document.addEventListener("DOMContentLoaded",breadcrumbContentHandler)})();
Back to Directory File Manager