MyShaarli/tpl/myShaarli/js/pluginsadmin.min.js

1 line
2.6 KiB
JavaScript

!function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=9)}({9:function(t,e){function r(t){return function(t){if(Array.isArray(t))return n(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return n(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function o(t,e){var r=t.getAttribute("data-line");t.setAttribute("data-order",e),document.querySelector('[name="order_'.concat(r,'"]')).setAttribute("value",e)}function a(t,e){var r=parseInt(t,10)+e,n=document.querySelectorAll('[data-order="'.concat(t,'"]')),a=document.querySelectorAll('[data-order="'.concat(r,'"]'));e>0&&(n=[].slice.call(n).reverse());for(var u=0;u<n.length;u+=1){var i=a[0].parentNode;o(n[u],r),o(a[u],parseInt(t,10));var c=e<0?a[0]:a[a.length-1].nextSibling;i.insertBefore(n[u],c)}}r(document.querySelectorAll(".order")).forEach((function(t){t.addEventListener("click",(function(t){var e;t.preventDefault(),t.target.classList.contains("order-up")?0!==(e=parseInt(t.target.parentNode.parentNode.getAttribute("data-order"),10))&&a(e,-1):t.target.classList.contains("order-down")&&function(t){t!==parseInt(document.querySelector("[data-order]:last-child").getAttribute("data-order"),10)&&a(t,1)}(parseInt(t.target.parentNode.parentNode.getAttribute("data-order"),10))}))}))}});