Файловый менеджер - Редактировать - /home/lmsyaran/public_html/joomla5/media/com_associations/js/sidebyside.min.js
Назад
/** * @copyright (C) 2017 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */if(!Joomla)throw new Error("Joomla API is not properly initialised");const hideElements=t=>{t.forEach(e=>{const o=document.getElementById(e);o&&o.classList.add("hidden")})},createOption=(t,e)=>{const o=document.createElement("option");return o.value=t,o.innerText=e,o};document.body.addEventListener("click",({target:t})=>{if(t.id==="toggle-left-panel"){const e=t.getAttribute("data-hide-reference"),o=t.getAttribute("data-show-reference");t.innerText===e?t.innerText=o:t.innerText=e,document.getElementById("left-panel").classList.toggle("hidden"),document.getElementById("right-panel").classList.toggle("full-width")}}),document.body.addEventListener("change",({target:t})=>{if(t.id==="jform_itemlanguage"){const e=document.getElementById("target-association"),o=t.value;o!==""&&typeof o<"u"?(e.setAttribute("data-action",o.split(":")[2]),e.setAttribute("data-id",o.split(":")[1]),e.setAttribute("data-language",o.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")}`):(hideElements(["toolbar-target","toolbar-copy","select-change","remove-assoc"]),e.setAttribute("data-action",""),e.setAttribute("data-id","0"),e.setAttribute("data-language",""),e.src="")}}),document.getElementById("reference-association").addEventListener("load",({target:t})=>{let e=Joomla.getOptions("targetSrc",!1);if(e){e=e.split("&").join("&"),document.getElementById("target-association").setAttribute("src",e),Joomla.loadOptions({targetSrc:!1});return}document.getElementById("target-association").setAttribute("src",document.getElementById("target-association").getAttribute("src"));const o=t.contentDocument.body||t.contentWindow.document.body;if(o.querySelector("#jform_id").value!==t.getAttribute("data-id")){const a=document.getElementById("target-association");a.src=`${a.getAttribute("data-editurl")}&task=${a.getAttribute("data-item")}.edit&id=${o.querySelector("#jform_id").value}`,t.src=`${t.getAttribute("data-editurl")}&task=${t.getAttribute("data-item")}.edit&id=${t.getAttribute("data-id")}`}o.querySelector("#jform_language").setAttribute("disabled","disabled"),o.querySelector("#associations .btn").remove(),document.querySelectorAll("#jform_itemlanguage option").forEach(a=>{const c=a.value.split(":");if(typeof c[0]<"u"){const r=c[0].replace(/-/,"_"),s=o.querySelector(`#jform_associations_${r}_id`);if(s&&s.value===""){const d=document.getElementById("reference-association");d.hasAttribute("data-no-assoc")&&(o.querySelector(`#jform_associations_${r}_name`).value=d.getAttribute("data-no-assoc"))}}});const n=document.querySelector("joomla-core-loader");n&&n.parentNode.removeChild(n)}),document.getElementById("target-association").addEventListener("load",({target:t})=>{if(t.getAttribute("src")!==""){document.getElementById("toolbar-target").classList.remove("hidden"),document.getElementById("toolbar-copy").classList.remove("hidden"),document.getElementById("select-change").classList.remove("hidden");const e=t.getAttribute("data-language"),o=t.getAttribute("data-id"),n=t.contentDocument.body||t.contentWindow.document.body,a=n.querySelector("#jform_id").value||"0",c=document.getElementById("reference-association");if(n.querySelector("#associations").classList.contains("active")&&(n.querySelector('a[href="#associations"]').parentNode.classList.remove("active"),n.querySelector("#associations").classList.remove("active"),n.querySelector(".nav-tabs li").classList.add("active"),n.querySelector(".tab-content .tab-pane").classList.add("active")),n.querySelector("#jform_language").value=e,n.querySelector("#jform_language").setAttribute("disabled","disabled"),a==="0")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")),document.getElementById("remove-assoc").classList.remove("hidden"),document.getElementById("remove-assoc").classList.add("toolbar-copy");const u=document.getElementById("target-id").value,i=u===""?a:`${u},${a}`;document.getElementById("target-id").value=i,a!==o&&(document.querySelector(`#jform_itemlanguage option[value^="${e}:${o}:add"]`).value=`${e}:${a}:edit`,t.setAttribute("data-id",a),t.setAttribute("data-action","edit"));const m=c.contentDocument.body||c.contentWindow.document.body,_=e.replace(/-/,"_"),g=n.querySelector(`#jform_${c.getAttribute("data-title")}`).value,p=m.querySelector(`#jform_associations_${_}_id`);p&&(p.value=a);const A=m.querySelector(`#jform_associations_${_}_name`);A&&(A.value=g);const v=m.querySelector(`#jform_associations_${_}`);v&&(v.appendChild(createOption(a,g)),v.value=a)}const r=c.getAttribute("data-id"),s=c.getAttribute("data-language").replace(/-/,"_"),d=c.getAttribute("data-title-value"),y=n.querySelector(`#jform_associations_${s}_id`);y&&(y.value=r);const b=n.querySelector(`#jform_associations_${s}_name`);b&&(b.value=d);let l=n.querySelector(`#jform_associations_${s}`);l.appendChild(createOption(r,d)),l.value=r,document.querySelectorAll("#jform_itemlanguage option").forEach(u=>{const i=u.value.split(":");if(typeof i[1]<"u"&&i[1]!=="0"){const m=i[0].replace(/-/,"_");n.querySelector(`#jform_associations_${m}_id`).value=i[1],l=n.querySelector(`#jform_associations_${m}`),l.appendChild(createOption(i[1],"")),l.value=i[1]}});const f=document.querySelector("joomla-core-loader");f&&f.parentNode.removeChild(f)}}),Joomla.submitbutton=t=>{if(t==="association.cancel")Joomla.submitform(t);else if(t==="copy"){document.body.appendChild(document.createElement("joomla-core-loader"));const e=document.getElementById("target-association").getAttribute("data-language"),o=window.frames["reference-association"].document.getElementById("jform_language");o.removeAttribute("disabled"),o.value=e,window.frames["reference-association"].Joomla.submitbutton(`${document.getElementById("adminForm").getAttribute("data-associatedview")}.save2copy`)}else if(t==="undo-association"){const e=document.getElementById("reference-association"),o=document.getElementById("target-association"),n=e.getAttribute("data-language").replace(/-/,"_"),a=o.getAttribute("data-language").replace(/-/,"_"),c=e.contentDocument.body||e.contentWindow.document.body,r=o.contentDocument.body||o.contentWindow.document.body,s=c.querySelector(`#jform_associations_${a}_id`);s&&(s.value="");const d=c.querySelector(`#jform_associations_${a}_name`);d&&(d.value="");const y=c.querySelector(`#jform_associations_${a}`);y&&(y.value=""),document.querySelectorAll("#jform_itemlanguage option").forEach(_=>{let g=_.value.split(":")[0];g&&(g=g.replace(/-/,"_"),r.querySelector(`#jform_associations_${g}_id`).value="",r.querySelector(`#jform_associations_${g}`).value="")});const b=r.querySelector(`#jform_associations_${n}_id`);b&&(b.value="");const l=r.querySelector(`#jform_associations_${n}_name`);l&&(l.value="");const f=r.querySelector(`#jform_associations_${n}`);f&&(f.value="");const u=document.getElementById("jform_itemlanguage"),i=u.value,m=a.replace(/_/,"-");document.querySelector(`#jform_itemlanguage option[value="${i}"]`).value=`${m}:0:add`,u.value="",u.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!0})),Joomla.submitbutton("reference")}else{const e=document.getElementById(`${t}-association`);(e.contentDocument.body||e.contentWindow.document.body).querySelector("#jform_language").removeAttribute("disabled"),window.frames[`${t}-association`].Joomla.submitbutton(`${document.getElementById("adminForm").getAttribute("data-associatedview")}.apply`)}return!1},hideElements(["toolbar-target","toolbar-copy"]);
| ver. 1.4 |
Github
|
.
| PHP 8.1.33 | Генерация страницы: 0.02 |
proxy
|
phpinfo
|
Настройка