admin-articles-modal.min.js
1.18 KB
!function(){"use strict";window.jSelectArticle=function(a,b,c,d,e,f){var h,i,g="";return Joomla.getOptions("xtd-articles")?(h=Joomla.getOptions("xtd-articles").editor,""!==f&&(g=' hreflang="'+f+'"'),i="<a"+g+' href="'+e+'">'+b+"</a>",window.parent.Joomla&&window.parent.Joomla.editors&&window.parent.Joomla.editors.instances&&window.parent.Joomla.editors.instances.hasOwnProperty(h)?window.parent.Joomla.editors.instances[h].replaceSelection(i):window.parent.jInsertEditorText(i,h),void window.parent.jModalClose()):(window.parent.jModalClose(),!1)},document.addEventListener("DOMContentLoaded",function(){for(var a=document.querySelectorAll(".select-link"),b=0,c=a.length;c>b;b++)a[b].addEventListener("click",function(a){a.preventDefault();var b=a.target.getAttribute("data-function");"jSelectArticle"===b?window[b](a.target.getAttribute("data-id"),a.target.getAttribute("data-title"),a.target.getAttribute("data-cat-id"),null,a.target.getAttribute("data-uri"),a.target.getAttribute("data-language")):window.parent[b](a.target.getAttribute("data-id"),a.target.getAttribute("data-title"),a.target.getAttribute("data-cat-id"),null,a.target.getAttribute("data-uri"),a.target.getAttribute("data-language"))})})}();