芝麻web文件管理V1.00
编辑当前文件:/home2/sdektunc/.trash/media.5/com_associations/js/sidebyside.min.js
jQuery(document).ready((function(t){t("#toolbar-target").hide(),t("#toolbar-copy").hide(),Joomla.submitbutton=function(e){if("association.cancel"===e)Joomla.submitform(e);else if("copy"===e){document.body.appendChild(document.createElement("joomla-core-loader"));var a=document.getElementById("target-association").getAttribute("data-language"),i=window.frames["reference-association"].document.getElementById("jform_language");i.removeAttribute("disabled"),i.value=a,window.frames["reference-association"].Joomla.submitbutton(document.getElementById("adminForm").getAttribute("data-associatedview")+".save2copy")}else if("undo-association"===e){var o=document.getElementById("reference-association"),n=document.getElementById("target-association"),s=(o.getAttribute("data-id"),o.getAttribute("data-language").replace(/-/,"_"));n.getAttribute("data-id"),a=n.getAttribute("data-language").replace(/-/,"_");o=t(o).contents(),n=t(n).contents(),o.find("#jform_associations_"+a+"_id").val(""),o.find("#jform_associations_"+a+"_name").val(""),o.find("#jform_associations_"+a).val("");var d="";t("#jform_itemlanguage option").each((function(){void 0!==(d=t(this).val().split("|")[0])&&(d=d.replace(/-/,"_"),n.find("#jform_associations_"+d+"_id").val(""),n.find("#jform_associations_"+d).val(""))})),n.find("#jform_associations_"+s+"_id").val(""),n.find("#jform_associations_"+s+"_name").val(""),n.find("#jform_associations_"+s).val("");var r=t("#jform_itemlanguage"),c=r.val(),l=a.replace(/_/,"-");t('#jform_itemlanguage option[value="'+c+'"]').val(l+":0:add"),r.val(""),r[0].dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!0})),Joomla.submitbutton("reference")}else t("#"+e+"-association").contents().find("#jform_language").attr("disabled",!1),window.frames[e+"-association"].Joomla.submitbutton(document.getElementById("adminForm").getAttribute("data-associatedview")+".apply");return!1},t(document).on("click","#toogle-left-panel",(function(){var e=this.getAttribute("data-hide-reference"),a=this.getAttribute("data-show-reference");t(this).text()===e?t(this).text(a):t(this).text(e),t("#left-panel").toggle(),t("#right-panel").toggleClass("full-width")})),t(document).on("change","#jform_itemlanguage",(function(){var e=document.getElementById("target-association"),a=t(this).val();""!==a&&void 0!==a?(e.setAttribute("data-action",a.split(":")[2]),e.setAttribute("data-id",a.split(":")[1]),e.setAttribute("data-language",a.split(":")[0]),document.body.appendChild(document.createElement("joomla-core-loader")),e.src=e.getAttribute("data-editurl")+"&task="+e.getAttribute("data-item")+"."+e.getAttribute("data-action")+"&id="+e.getAttribute("data-id")):(t("#toolbar-target").hide(),t("#toolbar-copy").hide(),t("#select-change").addClass("hidden"),t("#remove-assoc").addClass("hidden"),e.setAttribute("data-action",""),e.setAttribute("data-id","0"),e.setAttribute("data-language",""),e.src="")})),t("#reference-association").on("load",(function(){var e=Joomla.getOptions("targetSrc",!1);if(e)return e=e.split("&").join("&"),document.getElementById("target-association").setAttribute("src",e),void Joomla.loadOptions({targetSrc:!1});if(document.getElementById("target-association").setAttribute("src",document.getElementById("target-association").getAttribute("src")),t(this).contents().find("#jform_id").val()!==this.getAttribute("data-id")){var a=document.getElementById("target-association");a.src=a.getAttribute("data-editurl")+"&task="+a.getAttribute("data-item")+".edit&id="+t(this).contents().find("#jform_id").val(),this.src=this.getAttribute("data-editurl")+"&task="+this.getAttribute("data-item")+".edit&id="+this.getAttribute("data-id")}var i=t(this).contents();i.find("#jform_language").attr("disabled",""),i.find("#associations").find(".btn").remove();var o="";t("#jform_itemlanguage option").each((function(){if(void 0!==(o=t(this).val().split(":"))[0]){var e=o[0].replace(/-/,"_");""==i.find("#jform_associations_"+e+"_id").val()&&i.find("#jform_associations_"+e+"_name").val(document.getElementById("reference-association").getAttribute("data-no-assoc"))}}));var n=document.querySelector("joomla-core-loader");n&&n.parentNode.removeChild(n)})),t("#target-association").on("load",(function(){if(""!=this.getAttribute("src")){t("#toolbar-target").show(),t("#toolbar-copy").show(),t("#select-change").removeClass("hidden");var e=this.getAttribute("data-language"),a=this.getAttribute("data-id"),i=t(this).contents().find("#jform_id").val()||"0";if(t(this).contents().find('a[href="#associations"]').parent().find(".btn").remove(),t(this).contents().find("#associations").find(".btn").remove(),t(this).contents().find("#associations").hasClass("active")&&(t(this).contents().find('a[href="#associations"]').parent().removeClass("active"),t(this).contents().find("#associations").removeClass("active"),t(this).contents().find(".nav-tabs").find("li").first().addClass("active"),t(this).contents().find(".tab-content").find(".tab-pane").first().addClass("active")),t(this).contents().find("#jform_language").val(e).attr("disabled",""),"0"==i)document.getElementById("select-change-text").innerHTML=Joomla.sanitizeHtml(document.getElementById("select-change").getAttribute("data-select"));else{document.getElementById("select-change-text").innerHTML=Joomla.sanitizeHtml(document.getElementById("select-change").getAttribute("data-change")),t("#remove-assoc").removeClass("hidden"),t("#toolbar-copy").hide();var o=document.getElementById("target-id").value,n=""==o?i:o+","+i;document.getElementById("target-id").value=n,i!=a&&(t('#jform_itemlanguage option[value^="'+e+":"+a+':add"]').val(e+":"+i+":edit"),this.setAttribute("data-id",i),this.setAttribute("data-action","edit"));var s=document.getElementById("reference-association"),d=e.replace(/-/,"_"),r=s.getAttribute("data-title"),c=t(this).contents().find("#jform_"+r).val();t(s).contents().find("#jform_associations_"+d+"_id").val(i),t(s).contents().find("#jform_associations_"+d+"_name").val(c),t(s).contents().find("#jform_associations_"+d).append('
'+c+"
"),t(s).contents().find("#jform_associations_"+d).val(i)}var l,m=(s=document.getElementById("reference-association")).getAttribute("data-id");d=s.getAttribute("data-language").replace(/-/,"_"),(l=document.getElementById("target-association")).getAttribute("data-title"),c=s.getAttribute("data-title-value");(l=t(this).contents()).find("#jform_associations_"+d+"_id").val(m),l.find("#jform_associations_"+d+"_name").val(c);var u,g,f=l.find("#jform_associations_"+d);f.append('
'+c+"
"),f.val(m),t("#jform_itemlanguage option").each((function(){void 0!==(u=t(this).val().split(":"))[1]&&"0"!==u[1]&&(g=u[0].replace(/-/,"_"),l.find("#jform_associations_"+g+"_id").val(u[1]),(f=l.find("#jform_associations_"+g)).append('
'),f.val(u[1]))}));var v=document.querySelector("joomla-core-loader");v&&v.parentNode.removeChild(v)}}))}));