You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 lines
4.2 KiB

!function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=13)}([function(t,e){!function(){t.exports=this.wp.domReady}()},,function(t,e,n){var r=n(4),i=n(5),o=n(6);t.exports=function(t){return r(t)||i(t)||o()}},,function(t,e){t.exports=function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}},function(t,e){t.exports=function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e){function n(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}t.exports=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t}},function(t,e){t.exports=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}},,,,function(t,e,n){"use strict";n.r(e);var r=n(2),i=n.n(r),o=n(7),a=n.n(o),l=n(8),u=n.n(l),s=n(9),c=n.n(s),d=n(0),f=n.n(d),p=function(){function t(e,n){var r=this;a()(this,t),c()(this,"toggle",(function(t){r.tr.classList.contains("expanded")?r.onClose(t):r.onOpen(t)})),this.tr=e,this.index=n,this.tr.classList.add(this.index%2?"odd":"even")}return u()(t,[{key:"init",value:function(){var t=this;(this.details=this.tr.querySelector(".column-details details"),this.details)&&(this.createNewTr(),[].concat(i()(this.tr.querySelectorAll(".single-url-detail-toggle")),[this.details.querySelector("summary")]).forEach((function(e){e.addEventListener("click",(function(){t.toggle(e)}))})))}},{key:"createNewTr",value:function(){this.newTr=document.createElement("tr"),this.newTr.classList.add("details"),this.newTr.classList.add(this.index%2?"odd":"even");var t=document.createElement("td");t.setAttribute("colspan",this.getRowColspan());var e=!0,n=!1,r=void 0;try{for(var i,o=this.details.childNodes[Symbol.iterator]();!(e=(i=o.next()).done);e=!0){var a=i.value;"SUMMARY"!==a.tagName&&t.appendChild(a.cloneNode(!0))}}catch(t){n=!0,r=t}finally{try{e||null==o.return||o.return()}finally{if(n)throw r}}this.newTr.appendChild(t)}},{key:"getRowColspan",value:function(){return i()(this.tr.childNodes).filter((function(t){return["TD","TH"].includes(t.tagName)})).length}},{key:"onOpen",value:function(t){this.tr.parentNode.insertBefore(this.newTr,this.tr.nextSibling),this.tr.classList.add("expanded"),"SUMMARY"!==t.tagName&&this.details.setAttribute("open",!0)}},{key:"onClose",value:function(t){this.tr.parentNode.removeChild(this.newTr),this.tr.classList.remove("expanded"),"SUMMARY"!==t.tagName&&this.details.removeAttribute("open")}}]),t}(),h=function(){function t(){a()(this,t),this.rows=i()(document.querySelectorAll('.wp-list-table tr[id^="tag-"]')).map((function(t,e){var n=new p(t,e);return n.init(),n})).filter((function(t){return t.details}))}return u()(t,[{key:"init",value:function(){this.addToggleAllListener()}},{key:"addToggleAllListener",value:function(){var t=this,e=!1,n=i()(document.querySelectorAll(".column-details button.error-details-toggle"));window.addEventListener("click",(function(r){var i;n.includes(r.target)&&(i=r.target,e=!e,t.rows.forEach((function(t){e?t.onOpen(i):t.onClose(i)})))}))}}]),t}();f()((function(){(new h).init()}))}]);