function copyToClipboard(a){var b=!1,c=document.createElement("textarea");c.innerHTML=a;document.body.appendChild(c);c.select();try{(b=document.execCommand("copy"))?console.log("copy successful: "+a):console.log("copy unsuccessful")}catch(d){console.log("browser not compatible")}document.body.removeChild(c);return b}function addHashToCurrentURL(a){return location.href.replace(location.hash,"").concat(a)}
function addPostfix(a,b,c){var d=a.getAttribute(b).split("__")[0],e=String(parseInt(a.getAttribute(b).split("__")[1]||0)+1);a.setAttribute(b,d+"__"+e);return c.includes(a.getAttribute(b))?addPostfix(a,b,c):a.getAttribute(b)}function changeDuplicateAttr(a,b){var c=Array.prototype.slice.call(document.querySelectorAll("["+a+'^\x3d"'+b+'"]'));if(0<c.length){var d=[];c.map(function(e){return d.includes(e.getAttribute(a))?d.push(addPostfix(e,a,d)):d.push(e.getAttribute(a))})}}AUI().ready(function(){console.log("AUI().ready")});
Liferay.on("allPortletsReady",function(){console.log("categorie-documenti allPortletsReady");changeDuplicateAttr("id","doc");changeDuplicateAttr("href","#doc");changeDuplicateAttr("data-clipboard-text","#doc");changeDuplicateAttr("id","categdoc");changeDuplicateAttr("href","#categdoc");changeDuplicateAttr("data-clipboard-text","#categdoc");$(".copy-url").on("click",function(a){a.preventDefault();a.stopPropagation();copyToClipboard(addHashToCurrentURL($(this).data("clipboard-text")))?$(this).attr("title",
"Copiato!"):$(this).attr("title","Errore!");$("#".concat($(this).attr("aria-describedby"))).text($(this).attr("title"));return!1})});
