CoreFiles by mySites.guru
admin-articles-workflow-buttons.es6.min.js1 lines, 3,560 bytes, from Joomla_4.0.0-alpha12-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha11
md5
e1e228335cb4ced5251120fb220429b0
sha1
d63a1d72e7549526e95665bab6f07599ee300303
sha256
94e230babac6de45dd0f59699e6308d842607760dba778112a03d0a9da55dae2
Joomla=window.Joomla||{},Joomla.toggleAllNextElements=(a,b)=>{const c=(a=>{const b=[];do b.push(a);while(null!==(a=a.nextElementSibling));return b})(a);c.length&&c.forEach(a=>{a.classList.contains(b)?a.classList.remove(b):a.classList.add(b)})},(()=>{'use strict';document.addEventListener("DOMContentLoaded",()=>{function a(a,b){const c=Joomla.getOptions("articles.transitions")[b],d={};let e=!1;if(void 0!==c&&(o.length&&o.forEach(a=>{const b=a.querySelectorAll("input[type=checkbox]")[0];if(b.checked){const a=b.closest("tr"),f=parseInt(a.getAttribute("data-stage_id"),10),g=parseInt(a.getAttribute("data-workflow_id"),10);if(d[b.value]=[],void 0===c[g])return;let h=0;if(void 0!==c[g][-1])for(let a=0;a<c[g][-1].length;a+=1)c[g][-1][a].to_stage_id!==f&&(d[b.value][h]=c[g][-1][a],h+=1);if(void 0!==c[g][f])for(let a=0;a<c[g][f].length;a+=1)c[g][f][a].to_stage_id!==f&&(d[b.value][h]=c[g][f][a],h+=1);1<d[b.value].length?e=!0:delete d[b.value]}}),e)){a.stopPropagation();const c=Joomla.getOptions("articles.items");let e="";m.setAttribute(n,"articles.".concat(b)),Object.keys(d).forEach(a=>{void 0!==c["article-".concat(a)]&&(e+="<div class=\"form-group col-md-6\">",e+="<label for=\"publish_transitions_".concat(a,"\">").concat(c["article-".concat(a)],"</label>"),e+="<select id=\"publish_transitions_".concat(a,"\" class=\"custom-select\" name=\"publish_transitions[").concat(a,"]\">"),Object.keys(d[a]).forEach(b=>{e+="<option value=\"".concat(d[a][b].value,"\">").concat(d[a][b].text,"</option>")}),e+="</select>",e+="</div>",e+="</div>")}),l.innerHTML=e,window.jQuery(k).modal()}}function b(a,b){b?a.classList.remove("disabled"):a.classList.add("disabled")}function c(){b(f,p),b(g,q),b(h,r),b(i,s)}function d(a){p=0<a.getAttribute("data-condition-publish")&&(0===t||p),q=0<a.getAttribute("data-condition-unpublish")&&(0===t||q),r=0<a.getAttribute("data-condition-archive")&&(0===t||r),s=0<a.getAttribute("data-condition-trash")&&(0===t||s)}const e=document.getElementById("toolbar-dropdown-status-group"),f=e.getElementsByClassName("button-publish")[0],g=e.getElementsByClassName("button-unpublish")[0],h=e.getElementsByClassName("button-archive")[0],i=e.getElementsByClassName("button-trash")[0],j=document.querySelector("#articleList"),k=document.getElementById("stageModal"),l=document.getElementById("stageModal-content"),m=document.getElementById("stage-submit-button-id"),n="data-submit-task";let o=[],p=!1,q=!1,r=!1,s=!1,t=0;j&&(o=[].slice.call(j.querySelectorAll("tbody tr"))),window.jQuery(k).on("hide.bs.modal",()=>{l.innerHTML=""}),f.parentElement.addEventListener("click",b=>{f.classList.contains("disabled")?(b.stopImmediatePropagation(),Joomla.renderMessages({error:[Joomla.JText._("COM_CONTENT_ERROR_CANNOT_PUBlISH")]})):a(b,"publish")}),g.parentElement.addEventListener("click",b=>{g.classList.contains("disabled")?(b.stopImmediatePropagation(),Joomla.renderMessages({error:[Joomla.JText._("COM_CONTENT_ERROR_CANNOT_UNPUBlISH")]})):a(b,"unpublish")}),h.parentElement.addEventListener("click",b=>{h.classList.contains("disabled")?(b.stopImmediatePropagation(),Joomla.renderMessages({error:[Joomla.JText._("COM_CONTENT_ERROR_CANNOT_ARCHIVE")]})):a(b,"archive")}),i.parentElement.addEventListener("click",b=>{i.classList.contains("disabled")?(b.stopImmediatePropagation(),Joomla.renderMessages({error:[Joomla.JText._("COM_CONTENT_ERROR_CANNOT_TRASH")]})):a(b,"trash")}),j&&j.addEventListener("click",()=>{o.forEach(a=>{const b=a.querySelectorAll("input[type=checkbox]")[0];if(b.checked){const a=b.closest("tr");d(a),t+=1}}),c(),t=0})})})();

The same content is in 5 releases, Joomla 4.0.0-alpha8 to 4.0.0-alpha12. See them all, or every version of this file.