From 150d63454d2dbe852aec0ebda557bf1ab74b1f72 Mon Sep 17 00:00:00 2001 From: Mike Alhayek Date: Tue, 6 Aug 2024 15:48:26 -0700 Subject: [PATCH 1/5] Add Sortable dependency to script using Sortable --- .../OrchardCore.ContentTypes/Views/Admin/Edit.cshtml | 4 ++-- .../OrchardCore.ContentTypes/Views/Admin/EditPart.cshtml | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/OrchardCore.Modules/OrchardCore.ContentTypes/Views/Admin/Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.ContentTypes/Views/Admin/Edit.cshtml index 6ddbeac0611..5ed3b33aea3 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentTypes/Views/Admin/Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.ContentTypes/Views/Admin/Edit.cshtml @@ -156,8 +156,8 @@ - - + + diff --git a/src/OrchardCore.Modules/OrchardCore.ContentTypes/Views/Admin/EditPart.cshtml b/src/OrchardCore.Modules/OrchardCore.ContentTypes/Views/Admin/EditPart.cshtml index a968068d0a4..138941becd1 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentTypes/Views/Admin/EditPart.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.ContentTypes/Views/Admin/EditPart.cshtml @@ -67,10 +67,12 @@ - - diff --git a/src/OrchardCore.Modules/OrchardCore.Deployment/Views/DeploymentPlan/Display.cshtml b/src/OrchardCore.Modules/OrchardCore.Deployment/Views/DeploymentPlan/Display.cshtml index e511dbbbcdb..89f4a49437b 100644 --- a/src/OrchardCore.Modules/OrchardCore.Deployment/Views/DeploymentPlan/Display.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.Deployment/Views/DeploymentPlan/Display.cshtml @@ -6,7 +6,7 @@ var orderUrl = Url.Action("UpdateOrder", "Step"); } - +

@RenderTitleSegments(T["Deployment Plan"])

diff --git a/src/OrchardCore.Modules/OrchardCore.Lists/Views/ListPartDetailAdmin.cshtml b/src/OrchardCore.Modules/OrchardCore.Lists/Views/ListPartDetailAdmin.cshtml index 6a2c1a022cf..64157790c6d 100644 --- a/src/OrchardCore.Modules/OrchardCore.Lists/Views/ListPartDetailAdmin.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.Lists/Views/ListPartDetailAdmin.cshtml @@ -17,7 +17,7 @@ if (enableOrdering) { - + } var authorizedContentTypeDefinitions = new List(); diff --git a/src/OrchardCore.Themes/TheAdmin/Assets/js/Sortable.js b/src/OrchardCore.Themes/TheAdmin/Assets/js/Sortable.js deleted file mode 100644 index 4cb969b940d..00000000000 --- a/src/OrchardCore.Themes/TheAdmin/Assets/js/Sortable.js +++ /dev/null @@ -1,1277 +0,0 @@ -/**! - * Sortable - * @author RubaXa - * @license MIT - */ - - -(function (factory) { - "use strict"; - - if (typeof define === "function" && define.amd) { - define(factory); - } - else if (typeof module != "undefined" && typeof module.exports != "undefined") { - module.exports = factory(); - } - else if (typeof Package !== "undefined") { - Sortable = factory(); // export for Meteor.js - } - else { - /* jshint sub:true */ - window["Sortable"] = factory(); - } -})(function () { - "use strict"; - - if (typeof window == "undefined" || typeof window.document == "undefined") { - return function () { - throw new Error("Sortable.js requires a window with a document"); - }; - } - - var dragEl, - parentEl, - ghostEl, - cloneEl, - rootEl, - nextEl, - - scrollEl, - scrollParentEl, - - lastEl, - lastCSS, - lastParentCSS, - - oldIndex, - newIndex, - - activeGroup, - autoScroll = {}, - - tapEvt, - touchEvt, - - moved, - - /** @const */ - RSPACE = /\s+/g, - - expando = 'Sortable' + (new Date).getTime(), - - win = window, - document = win.document, - parseInt = win.parseInt, - - supportDraggable = !!('draggable' in document.createElement('div')), - supportCssPointerEvents = (function (el) { - el = document.createElement('x'); - el.style.cssText = 'pointer-events:auto'; - return el.style.pointerEvents === 'auto'; - })(), - - _silent = false, - - abs = Math.abs, - slice = [].slice, - - touchDragOverListeners = [], - - _autoScroll = _throttle(function (/**Event*/evt, /**Object*/options, /**HTMLElement*/rootEl) { - // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=505521 - if (rootEl && options.scroll) { - var el, - rect, - sens = options.scrollSensitivity, - speed = options.scrollSpeed, - - x = evt.clientX, - y = evt.clientY, - - winWidth = window.innerWidth, - winHeight = window.innerHeight, - - vx, - vy - ; - - // Delect scrollEl - if (scrollParentEl !== rootEl) { - scrollEl = options.scroll; - scrollParentEl = rootEl; - - if (scrollEl === true) { - scrollEl = rootEl; - - do { - if ((scrollEl.offsetWidth < scrollEl.scrollWidth) || - (scrollEl.offsetHeight < scrollEl.scrollHeight) - ) { - break; - } - /* jshint boss:true */ - } while (scrollEl = scrollEl.parentNode); - } - } - - if (scrollEl) { - el = scrollEl; - rect = scrollEl.getBoundingClientRect(); - vx = (abs(rect.right - x) <= sens) - (abs(rect.left - x) <= sens); - vy = (abs(rect.bottom - y) <= sens) - (abs(rect.top - y) <= sens); - } - - - if (!(vx || vy)) { - vx = (winWidth - x <= sens) - (x <= sens); - vy = (winHeight - y <= sens) - (y <= sens); - - /* jshint expr:true */ - (vx || vy) && (el = win); - } - - - if (autoScroll.vx !== vx || autoScroll.vy !== vy || autoScroll.el !== el) { - autoScroll.el = el; - autoScroll.vx = vx; - autoScroll.vy = vy; - - clearInterval(autoScroll.pid); - - if (el) { - autoScroll.pid = setInterval(function () { - if (el === win) { - win.scrollTo(win.pageXOffset + vx * speed, win.pageYOffset + vy * speed); - } else { - vy && (el.scrollTop += vy * speed); - vx && (el.scrollLeft += vx * speed); - } - }, 24); - } - } - } - }, 30), - - _prepareGroup = function (options) { - var group = options.group; - - if (!group || typeof group != 'object') { - group = options.group = {name: group}; - } - - ['pull', 'put'].forEach(function (key) { - if (!(key in group)) { - group[key] = true; - } - }); - - options.groups = ' ' + group.name + (group.put.join ? ' ' + group.put.join(' ') : '') + ' '; - } - ; - - - - /** - * @class Sortable - * @param {HTMLElement} el - * @param {Object} [options] - */ - function Sortable(el, options) { - if (!(el && el.nodeType && el.nodeType === 1)) { - throw 'Sortable: `el` must be HTMLElement, and not ' + {}.toString.call(el); - } - - this.el = el; // root element - this.options = options = _extend({}, options); - - - // Export instance - el[expando] = this; - - - // Default options - var defaults = { - group: Math.random(), - sort: true, - disabled: false, - store: null, - handle: null, - scroll: true, - scrollSensitivity: 30, - scrollSpeed: 10, - draggable: /[uo]l/i.test(el.nodeName) ? 'li' : '>*', - ghostClass: 'sortable-ghost', - chosenClass: 'sortable-chosen', - ignore: 'a, img', - filter: null, - animation: 0, - setData: function (dataTransfer, dragEl) { - dataTransfer.setData('Text', dragEl.textContent); - }, - dropBubble: false, - dragoverBubble: false, - dataIdAttr: 'data-id', - delay: 0, - forceFallback: false, - fallbackClass: 'sortable-fallback', - fallbackOnBody: false - }; - - - // Set default options - for (var name in defaults) { - !(name in options) && (options[name] = defaults[name]); - } - - _prepareGroup(options); - - // Bind all private methods - for (var fn in this) { - if (fn.charAt(0) === '_') { - this[fn] = this[fn].bind(this); - } - } - - // Setup drag mode - this.nativeDraggable = options.forceFallback ? false : supportDraggable; - - // Bind events - _on(el, 'mousedown', this._onTapStart); - _on(el, 'touchstart', this._onTapStart); - - if (this.nativeDraggable) { - _on(el, 'dragover', this); - _on(el, 'dragenter', this); - } - - touchDragOverListeners.push(this._onDragOver); - - // Restore sorting - options.store && this.sort(options.store.get(this)); - } - - - Sortable.prototype = /** @lends Sortable.prototype */ { - constructor: Sortable, - - _onTapStart: function (/** Event|TouchEvent */evt) { - var _this = this, - el = this.el, - options = this.options, - type = evt.type, - touch = evt.touches && evt.touches[0], - target = (touch || evt).target, - originalTarget = target, - filter = options.filter; - - - if (type === 'mousedown' && evt.button !== 0 || options.disabled) { - return; // only left button or enabled - } - - target = _closest(target, options.draggable, el); - - if (!target) { - return; - } - - // get the index of the dragged element within its parent - oldIndex = _index(target, options.draggable); - - // Check filter - if (typeof filter === 'function') { - if (filter.call(this, evt, target, this)) { - _dispatchEvent(_this, originalTarget, 'filter', target, el, oldIndex); - evt.preventDefault(); - return; // cancel dnd - } - } - else if (filter) { - filter = filter.split(',').some(function (criteria) { - criteria = _closest(originalTarget, criteria.trim(), el); - - if (criteria) { - _dispatchEvent(_this, criteria, 'filter', target, el, oldIndex); - return true; - } - }); - - if (filter) { - evt.preventDefault(); - return; // cancel dnd - } - } - - - if (options.handle && !_closest(originalTarget, options.handle, el)) { - return; - } - - - // Prepare `dragstart` - this._prepareDragStart(evt, touch, target); - }, - - _prepareDragStart: function (/** Event */evt, /** Touch */touch, /** HTMLElement */target) { - var _this = this, - el = _this.el, - options = _this.options, - ownerDocument = el.ownerDocument, - dragStartFn; - - if (target && !dragEl && (target.parentNode === el)) { - tapEvt = evt; - - rootEl = el; - dragEl = target; - parentEl = dragEl.parentNode; - nextEl = dragEl.nextSibling; - activeGroup = options.group; - - dragStartFn = function () { - // Delayed drag has been triggered - // we can re-enable the events: touchmove/mousemove - _this._disableDelayedDrag(); - - // Make the element draggable - dragEl.draggable = true; - - // Chosen item - _toggleClass(dragEl, _this.options.chosenClass, true); - - // Bind the events: dragstart/dragend - _this._triggerDragStart(touch); - }; - - // Disable "draggable" - options.ignore.split(',').forEach(function (criteria) { - _find(dragEl, criteria.trim(), _disableDraggable); - }); - - _on(ownerDocument, 'mouseup', _this._onDrop); - _on(ownerDocument, 'touchend', _this._onDrop); - _on(ownerDocument, 'touchcancel', _this._onDrop); - - if (options.delay) { - // If the user moves the pointer or let go the click or touch - // before the delay has been reached: - // disable the delayed drag - _on(ownerDocument, 'mouseup', _this._disableDelayedDrag); - _on(ownerDocument, 'touchend', _this._disableDelayedDrag); - _on(ownerDocument, 'touchcancel', _this._disableDelayedDrag); - _on(ownerDocument, 'mousemove', _this._disableDelayedDrag); - _on(ownerDocument, 'touchmove', _this._disableDelayedDrag); - - _this._dragStartTimer = setTimeout(dragStartFn, options.delay); - } else { - dragStartFn(); - } - } - }, - - _disableDelayedDrag: function () { - var ownerDocument = this.el.ownerDocument; - - clearTimeout(this._dragStartTimer); - _off(ownerDocument, 'mouseup', this._disableDelayedDrag); - _off(ownerDocument, 'touchend', this._disableDelayedDrag); - _off(ownerDocument, 'touchcancel', this._disableDelayedDrag); - _off(ownerDocument, 'mousemove', this._disableDelayedDrag); - _off(ownerDocument, 'touchmove', this._disableDelayedDrag); - }, - - _triggerDragStart: function (/** Touch */touch) { - if (touch) { - // Touch device support - tapEvt = { - target: dragEl, - clientX: touch.clientX, - clientY: touch.clientY - }; - - this._onDragStart(tapEvt, 'touch'); - } - else if (!this.nativeDraggable) { - this._onDragStart(tapEvt, true); - } - else { - _on(dragEl, 'dragend', this); - _on(rootEl, 'dragstart', this._onDragStart); - } - - try { - if (document.selection) { - // Timeout neccessary for IE9 - setTimeout(function () { - document.selection.empty(); - }); - } else { - window.getSelection().removeAllRanges(); - } - } catch (err) { - } - }, - - _dragStarted: function () { - if (rootEl && dragEl) { - // Apply effect - _toggleClass(dragEl, this.options.ghostClass, true); - - Sortable.active = this; - - // Drag start event - _dispatchEvent(this, rootEl, 'start', dragEl, rootEl, oldIndex); - } - }, - - _emulateDragOver: function () { - if (touchEvt) { - if (this._lastX === touchEvt.clientX && this._lastY === touchEvt.clientY) { - return; - } - - this._lastX = touchEvt.clientX; - this._lastY = touchEvt.clientY; - - if (!supportCssPointerEvents) { - _css(ghostEl, 'display', 'none'); - } - - var target = document.elementFromPoint(touchEvt.clientX, touchEvt.clientY), - parent = target, - groupName = ' ' + this.options.group.name + '', - i = touchDragOverListeners.length; - - if (parent) { - do { - if (parent[expando] && parent[expando].options.groups.indexOf(groupName) > -1) { - while (i--) { - touchDragOverListeners[i]({ - clientX: touchEvt.clientX, - clientY: touchEvt.clientY, - target: target, - rootEl: parent - }); - } - - break; - } - - target = parent; // store last element - } - /* jshint boss:true */ - while (parent = parent.parentNode); - } - - if (!supportCssPointerEvents) { - _css(ghostEl, 'display', ''); - } - } - }, - - - _onTouchMove: function (/**TouchEvent*/evt) { - if (tapEvt) { - // only set the status to dragging, when we are actually dragging - if (!Sortable.active) { - this._dragStarted(); - } - - // as well as creating the ghost element on the document body - this._appendGhost(); - - var touch = evt.touches ? evt.touches[0] : evt, - dx = touch.clientX - tapEvt.clientX, - dy = touch.clientY - tapEvt.clientY, - translate3d = evt.touches ? 'translate3d(' + dx + 'px,' + dy + 'px,0)' : 'translate(' + dx + 'px,' + dy + 'px)'; - - moved = true; - touchEvt = touch; - - _css(ghostEl, 'webkitTransform', translate3d); - _css(ghostEl, 'mozTransform', translate3d); - _css(ghostEl, 'msTransform', translate3d); - _css(ghostEl, 'transform', translate3d); - - evt.preventDefault(); - } - }, - - _appendGhost: function () { - if (!ghostEl) { - var rect = dragEl.getBoundingClientRect(), - css = _css(dragEl), - options = this.options, - ghostRect; - - ghostEl = dragEl.cloneNode(true); - - _toggleClass(ghostEl, options.ghostClass, false); - _toggleClass(ghostEl, options.fallbackClass, true); - - _css(ghostEl, 'top', rect.top - parseInt(css.marginTop, 10)); - _css(ghostEl, 'left', rect.left - parseInt(css.marginLeft, 10)); - _css(ghostEl, 'width', rect.width); - _css(ghostEl, 'height', rect.height); - _css(ghostEl, 'opacity', '0.8'); - _css(ghostEl, 'position', 'fixed'); - _css(ghostEl, 'zIndex', '100000'); - _css(ghostEl, 'pointerEvents', 'none'); - - options.fallbackOnBody && document.body.appendChild(ghostEl) || rootEl.appendChild(ghostEl); - - // Fixing dimensions. - ghostRect = ghostEl.getBoundingClientRect(); - _css(ghostEl, 'width', rect.width * 2 - ghostRect.width); - _css(ghostEl, 'height', rect.height * 2 - ghostRect.height); - } - }, - - _onDragStart: function (/**Event*/evt, /**boolean*/useFallback) { - var dataTransfer = evt.dataTransfer, - options = this.options; - - this._offUpEvents(); - - if (activeGroup.pull == 'clone') { - cloneEl = dragEl.cloneNode(true); - _css(cloneEl, 'display', 'none'); - rootEl.insertBefore(cloneEl, dragEl); - } - - if (useFallback) { - - if (useFallback === 'touch') { - // Bind touch events - _on(document, 'touchmove', this._onTouchMove); - _on(document, 'touchend', this._onDrop); - _on(document, 'touchcancel', this._onDrop); - } else { - // Old brwoser - _on(document, 'mousemove', this._onTouchMove); - _on(document, 'mouseup', this._onDrop); - } - - this._loopId = setInterval(this._emulateDragOver, 50); - } - else { - if (dataTransfer) { - dataTransfer.effectAllowed = 'move'; - options.setData && options.setData.call(this, dataTransfer, dragEl); - } - - _on(document, 'drop', this); - setTimeout(this._dragStarted, 0); - } - }, - - _onDragOver: function (/**Event*/evt) { - var el = this.el, - target, - dragRect, - revert, - options = this.options, - group = options.group, - groupPut = group.put, - isOwner = (activeGroup === group), - canSort = options.sort; - - if (evt.preventDefault !== void 0) { - evt.preventDefault(); - !options.dragoverBubble && evt.stopPropagation(); - } - - moved = true; - - if (activeGroup && !options.disabled && - (isOwner - ? canSort || (revert = !rootEl.contains(dragEl)) // Reverting item into the original list - : activeGroup.pull && groupPut && ( - (activeGroup.name === group.name) || // by Name - (groupPut.indexOf && ~groupPut.indexOf(activeGroup.name)) // by Array - ) - ) && - (evt.rootEl === void 0 || evt.rootEl === this.el) // touch fallback - ) { - // Smart auto-scrolling - _autoScroll(evt, options, this.el); - - if (_silent) { - return; - } - - target = _closest(evt.target, options.draggable, el); - dragRect = dragEl.getBoundingClientRect(); - - if (revert) { - _cloneHide(true); - - if (cloneEl || nextEl) { - rootEl.insertBefore(dragEl, cloneEl || nextEl); - } - else if (!canSort) { - rootEl.appendChild(dragEl); - } - - return; - } - - - if ((el.children.length === 0) || (el.children[0] === ghostEl) || - (el === evt.target) && (target = _ghostIsLast(el, evt)) - ) { - - if (target) { - if (target.animated) { - return; - } - - targetRect = target.getBoundingClientRect(); - } - - _cloneHide(isOwner); - - if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect) !== false) { - if (!dragEl.contains(el)) { - el.appendChild(dragEl); - parentEl = el; // actualization - } - - this._animate(dragRect, dragEl); - target && this._animate(targetRect, target); - } - } - else if (target && !target.animated && target !== dragEl && (target.parentNode[expando] !== void 0)) { - if (lastEl !== target) { - lastEl = target; - lastCSS = _css(target); - lastParentCSS = _css(target.parentNode); - } - - - var targetRect = target.getBoundingClientRect(), - width = targetRect.right - targetRect.left, - height = targetRect.bottom - targetRect.top, - floating = /left|right|inline/.test(lastCSS.cssFloat + lastCSS.display) - || (lastParentCSS.display == 'flex' && lastParentCSS['flex-direction'].indexOf('row') === 0), - isWide = (target.offsetWidth > dragEl.offsetWidth), - isLong = (target.offsetHeight > dragEl.offsetHeight), - halfway = (floating ? (evt.clientX - targetRect.left) / width : (evt.clientY - targetRect.top) / height) > 0.5, - nextSibling = target.nextElementSibling, - moveVector = _onMove(rootEl, el, dragEl, dragRect, target, targetRect), - after - ; - - if (moveVector !== false) { - _silent = true; - setTimeout(_unsilent, 30); - - _cloneHide(isOwner); - - if (moveVector === 1 || moveVector === -1) { - after = (moveVector === 1); - } - else if (floating) { - var elTop = dragEl.offsetTop, - tgTop = target.offsetTop; - - if (elTop === tgTop) { - after = (target.previousElementSibling === dragEl) && !isWide || halfway && isWide; - } else { - after = tgTop > elTop; - } - } else { - after = (nextSibling !== dragEl) && !isLong || halfway && isLong; - } - - if (!dragEl.contains(el)) { - if (after && !nextSibling) { - el.appendChild(dragEl); - } else { - target.parentNode.insertBefore(dragEl, after ? nextSibling : target); - } - } - - parentEl = dragEl.parentNode; // actualization - - this._animate(dragRect, dragEl); - this._animate(targetRect, target); - } - } - } - }, - - _animate: function (prevRect, target) { - var ms = this.options.animation; - - if (ms) { - var currentRect = target.getBoundingClientRect(); - - _css(target, 'transition', 'none'); - _css(target, 'transform', 'translate3d(' - + (prevRect.left - currentRect.left) + 'px,' - + (prevRect.top - currentRect.top) + 'px,0)' - ); - - target.offsetWidth; // repaint - - _css(target, 'transition', 'all ' + ms + 'ms'); - _css(target, 'transform', 'translate3d(0,0,0)'); - - clearTimeout(target.animated); - target.animated = setTimeout(function () { - _css(target, 'transition', ''); - _css(target, 'transform', ''); - target.animated = false; - }, ms); - } - }, - - _offUpEvents: function () { - var ownerDocument = this.el.ownerDocument; - - _off(document, 'touchmove', this._onTouchMove); - _off(ownerDocument, 'mouseup', this._onDrop); - _off(ownerDocument, 'touchend', this._onDrop); - _off(ownerDocument, 'touchcancel', this._onDrop); - }, - - _onDrop: function (/**Event*/evt) { - var el = this.el, - options = this.options; - - clearInterval(this._loopId); - clearInterval(autoScroll.pid); - clearTimeout(this._dragStartTimer); - - // Unbind events - _off(document, 'mousemove', this._onTouchMove); - - if (this.nativeDraggable) { - _off(document, 'drop', this); - _off(el, 'dragstart', this._onDragStart); - } - - this._offUpEvents(); - - if (evt) { - if (moved) { - evt.preventDefault(); - !options.dropBubble && evt.stopPropagation(); - } - - ghostEl && ghostEl.parentNode.removeChild(ghostEl); - - if (dragEl) { - if (this.nativeDraggable) { - _off(dragEl, 'dragend', this); - } - - _disableDraggable(dragEl); - - // Remove class's - _toggleClass(dragEl, this.options.ghostClass, false); - _toggleClass(dragEl, this.options.chosenClass, false); - - if (rootEl !== parentEl) { - newIndex = _index(dragEl, options.draggable); - - if (newIndex >= 0) { - // drag from one list and drop into another - _dispatchEvent(null, parentEl, 'sort', dragEl, rootEl, oldIndex, newIndex); - _dispatchEvent(this, rootEl, 'sort', dragEl, rootEl, oldIndex, newIndex); - - // Add event - _dispatchEvent(null, parentEl, 'add', dragEl, rootEl, oldIndex, newIndex); - - // Remove event - _dispatchEvent(this, rootEl, 'remove', dragEl, rootEl, oldIndex, newIndex); - } - } - else { - // Remove clone - cloneEl && cloneEl.parentNode.removeChild(cloneEl); - - if (dragEl.nextSibling !== nextEl) { - // Get the index of the dragged element within its parent - newIndex = _index(dragEl, options.draggable); - - if (newIndex >= 0) { - // drag & drop within the same list - _dispatchEvent(this, rootEl, 'update', dragEl, rootEl, oldIndex, newIndex); - _dispatchEvent(this, rootEl, 'sort', dragEl, rootEl, oldIndex, newIndex); - } - } - } - - if (Sortable.active) { - /* jshint eqnull:true */ - if (newIndex == null || newIndex === -1) { - newIndex = oldIndex; - } - - _dispatchEvent(this, rootEl, 'end', dragEl, rootEl, oldIndex, newIndex); - - // Save sorting - this.save(); - } - } - - } - - this._nulling(); - }, - - _nulling: function () { - if (Sortable.active === this) { - rootEl = - dragEl = - parentEl = - ghostEl = - nextEl = - cloneEl = - - scrollEl = - scrollParentEl = - - tapEvt = - touchEvt = - - moved = - newIndex = - - lastEl = - lastCSS = - - activeGroup = - Sortable.active = null; - } - }, - - handleEvent: function (/**Event*/evt) { - var type = evt.type; - - if (type === 'dragover' || type === 'dragenter') { - if (dragEl) { - this._onDragOver(evt); - _globalDragOver(evt); - } - } - else if (type === 'drop' || type === 'dragend') { - this._onDrop(evt); - } - }, - - - /** - * Serializes the item into an array of string. - * @returns {String[]} - */ - toArray: function () { - var order = [], - el, - children = this.el.children, - i = 0, - n = children.length, - options = this.options; - - for (; i < n; i++) { - el = children[i]; - if (_closest(el, options.draggable, this.el)) { - order.push(el.getAttribute(options.dataIdAttr) || _generateId(el)); - } - } - - return order; - }, - - - /** - * Sorts the elements according to the array. - * @param {String[]} order order of the items - */ - sort: function (order) { - var items = {}, rootEl = this.el; - - this.toArray().forEach(function (id, i) { - var el = rootEl.children[i]; - - if (_closest(el, this.options.draggable, rootEl)) { - items[id] = el; - } - }, this); - - order.forEach(function (id) { - if (items[id]) { - rootEl.removeChild(items[id]); - rootEl.appendChild(items[id]); - } - }); - }, - - - /** - * Save the current sorting - */ - save: function () { - var store = this.options.store; - store && store.set(this); - }, - - - /** - * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree. - * @param {HTMLElement} el - * @param {String} [selector] default: `options.draggable` - * @returns {HTMLElement|null} - */ - closest: function (el, selector) { - return _closest(el, selector || this.options.draggable, this.el); - }, - - - /** - * Set/get option - * @param {string} name - * @param {*} [value] - * @returns {*} - */ - option: function (name, value) { - var options = this.options; - - if (value === void 0) { - return options[name]; - } else { - options[name] = value; - - if (name === 'group') { - _prepareGroup(options); - } - } - }, - - - /** - * Destroy - */ - destroy: function () { - var el = this.el; - - el[expando] = null; - - _off(el, 'mousedown', this._onTapStart); - _off(el, 'touchstart', this._onTapStart); - - if (this.nativeDraggable) { - _off(el, 'dragover', this); - _off(el, 'dragenter', this); - } - - // Remove draggable attributes - Array.prototype.forEach.call(el.querySelectorAll('[draggable]'), function (el) { - el.removeAttribute('draggable'); - }); - - touchDragOverListeners.splice(touchDragOverListeners.indexOf(this._onDragOver), 1); - - this._onDrop(); - - this.el = el = null; - } - }; - - - function _cloneHide(state) { - if (cloneEl && (cloneEl.state !== state)) { - _css(cloneEl, 'display', state ? 'none' : ''); - !state && cloneEl.state && rootEl.insertBefore(cloneEl, dragEl); - cloneEl.state = state; - } - } - - - function _closest(/**HTMLElement*/el, /**String*/selector, /**HTMLElement*/ctx) { - if (el) { - ctx = ctx || document; - - do { - if ( - (selector === '>*' && el.parentNode === ctx) - || _matches(el, selector) - ) { - return el; - } - } - while (el !== ctx && (el = el.parentNode)); - } - - return null; - } - - - function _globalDragOver(/**Event*/evt) { - if (evt.dataTransfer) { - evt.dataTransfer.dropEffect = 'move'; - } - evt.preventDefault(); - } - - - function _on(el, event, fn) { - el.addEventListener(event, fn, false); - } - - - function _off(el, event, fn) { - el.removeEventListener(event, fn, false); - } - - - function _toggleClass(el, name, state) { - if (el) { - if (el.classList) { - el.classList[state ? 'add' : 'remove'](name); - } - else { - var className = (' ' + el.className + ' ').replace(RSPACE, ' ').replace(' ' + name + ' ', ' '); - el.className = (className + (state ? ' ' + name : '')).replace(RSPACE, ' '); - } - } - } - - - function _css(el, prop, val) { - var style = el && el.style; - - if (style) { - if (val === void 0) { - if (document.defaultView && document.defaultView.getComputedStyle) { - val = document.defaultView.getComputedStyle(el, ''); - } - else if (el.currentStyle) { - val = el.currentStyle; - } - - return prop === void 0 ? val : val[prop]; - } - else { - if (!(prop in style)) { - prop = '-webkit-' + prop; - } - - style[prop] = val + (typeof val === 'string' ? '' : 'px'); - } - } - } - - - function _find(ctx, tagName, iterator) { - if (ctx) { - var list = ctx.getElementsByTagName(tagName), i = 0, n = list.length; - - if (iterator) { - for (; i < n; i++) { - iterator(list[i], i); - } - } - - return list; - } - - return []; - } - - - - function _dispatchEvent(sortable, rootEl, name, targetEl, fromEl, startIndex, newIndex) { - var evt = document.createEvent('Event'), - options = (sortable || rootEl[expando]).options, - onName = 'on' + name.charAt(0).toUpperCase() + name.substr(1); - - evt.initEvent(name, true, true); - - evt.to = rootEl; - evt.from = fromEl || rootEl; - evt.item = targetEl || rootEl; - evt.clone = cloneEl; - - evt.oldIndex = startIndex; - evt.newIndex = newIndex; - - rootEl.dispatchEvent(evt); - - if (options[onName]) { - options[onName].call(sortable, evt); - } - } - - - function _onMove(fromEl, toEl, dragEl, dragRect, targetEl, targetRect) { - var evt, - sortable = fromEl[expando], - onMoveFn = sortable.options.onMove, - retVal; - - evt = document.createEvent('Event'); - evt.initEvent('move', true, true); - - evt.to = toEl; - evt.from = fromEl; - evt.dragged = dragEl; - evt.draggedRect = dragRect; - evt.related = targetEl || toEl; - evt.relatedRect = targetRect || toEl.getBoundingClientRect(); - - fromEl.dispatchEvent(evt); - - if (onMoveFn) { - retVal = onMoveFn.call(sortable, evt); - } - - return retVal; - } - - - function _disableDraggable(el) { - el.draggable = false; - } - - - function _unsilent() { - _silent = false; - } - - - /** @returns {HTMLElement|false} */ - function _ghostIsLast(el, evt) { - var lastEl = el.lastElementChild, - rect = lastEl.getBoundingClientRect(); - - return ((evt.clientY - (rect.top + rect.height) > 5) || (evt.clientX - (rect.right + rect.width) > 5)) && lastEl; // min delta - } - - - /** - * Generate id - * @param {HTMLElement} el - * @returns {String} - * @private - */ - function _generateId(el) { - var str = el.tagName + el.className + el.src + el.href + el.textContent, - i = str.length, - sum = 0; - - while (i--) { - sum += str.charCodeAt(i); - } - - return sum.toString(36); - } - - /** - * Returns the index of an element within its parent for a selected set of - * elements - * @param {HTMLElement} el - * @param {selector} selector - * @return {number} - */ - function _index(el, selector) { - var index = 0; - - if (!el || !el.parentNode) { - return -1; - } - - while (el && (el = el.previousElementSibling)) { - if (el.nodeName.toUpperCase() !== 'TEMPLATE' - && _matches(el, selector)) { - index++; - } - } - - return index; - } - - function _matches(/**HTMLElement*/el, /**String*/selector) { - if (el) { - selector = selector.split('.'); - - var tag = selector.shift().toUpperCase(), - re = new RegExp('\\s(' + selector.join('|') + ')(?=\\s)', 'g'); - - return ( - (tag === '' || el.nodeName.toUpperCase() == tag) && - (!selector.length || ((' ' + el.className + ' ').match(re) || []).length == selector.length) - ); - } - - return false; - } - - function _throttle(callback, ms) { - var args, _this; - - return function () { - if (args === void 0) { - args = arguments; - _this = this; - - setTimeout(function () { - if (args.length === 1) { - callback.call(_this, args[0]); - } else { - callback.apply(_this, args); - } - - args = void 0; - }, ms); - } - }; - } - - function _extend(dst, src) { - if (dst && src) { - for (var key in src) { - if (src.hasOwnProperty(key)) { - dst[key] = src[key]; - } - } - } - - return dst; - } - - - // Export utils - Sortable.utils = { - on: _on, - off: _off, - css: _css, - find: _find, - is: function (el, selector) { - return !!_closest(el, selector, el); - }, - extend: _extend, - throttle: _throttle, - closest: _closest, - toggleClass: _toggleClass, - index: _index - }; - - - /** - * Create sortable instance - * @param {HTMLElement} el - * @param {Object} [options] - */ - Sortable.create = function (el, options) { - return new Sortable(el, options); - }; - - - // Export - Sortable.version = '1.4.2'; - return Sortable; -}); diff --git a/src/OrchardCore.Themes/TheAdmin/ResourceManagementOptionsConfiguration.cs b/src/OrchardCore.Themes/TheAdmin/ResourceManagementOptionsConfiguration.cs index 2a08b7f89a6..3472e01ada3 100644 --- a/src/OrchardCore.Themes/TheAdmin/ResourceManagementOptionsConfiguration.cs +++ b/src/OrchardCore.Themes/TheAdmin/ResourceManagementOptionsConfiguration.cs @@ -13,7 +13,7 @@ static ResourceManagementOptionsConfiguration() _manifest .DefineScript("admin") - .SetDependencies("bootstrap", "admin-main", "theme-manager", "jQuery") + .SetDependencies("bootstrap", "admin-main", "theme-manager", "jQuery", "Sortable") .SetUrl("~/TheAdmin/js/TheAdmin.min.js", "~/TheAdmin/js/TheAdmin.js") .SetVersion("1.0.0"); diff --git a/src/OrchardCore.Themes/TheAdmin/wwwroot/js/TheAdmin.js b/src/OrchardCore.Themes/TheAdmin/wwwroot/js/TheAdmin.js index 3a744ee794a..dd10b36eb6a 100644 --- a/src/OrchardCore.Themes/TheAdmin/wwwroot/js/TheAdmin.js +++ b/src/OrchardCore.Themes/TheAdmin/wwwroot/js/TheAdmin.js @@ -3,1000 +3,6 @@ ** Any changes made directly to this file will be overwritten next time its asset group is processed by Gulp. */ -function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } -/**! - * Sortable - * @author RubaXa - * @license MIT - */ - -(function (factory) { - "use strict"; - - if (typeof define === "function" && define.amd) { - define(factory); - } else if (typeof module != "undefined" && typeof module.exports != "undefined") { - module.exports = factory(); - } else if (typeof Package !== "undefined") { - Sortable = factory(); // export for Meteor.js - } else { - /* jshint sub:true */ - window["Sortable"] = factory(); - } -})(function () { - "use strict"; - - if (typeof window == "undefined" || typeof window.document == "undefined") { - return function () { - throw new Error("Sortable.js requires a window with a document"); - }; - } - var dragEl, - parentEl, - ghostEl, - cloneEl, - rootEl, - nextEl, - scrollEl, - scrollParentEl, - lastEl, - lastCSS, - lastParentCSS, - oldIndex, - newIndex, - activeGroup, - autoScroll = {}, - tapEvt, - touchEvt, - moved, - /** @const */ - RSPACE = /\s+/g, - expando = 'Sortable' + new Date().getTime(), - win = window, - document = win.document, - parseInt = win.parseInt, - supportDraggable = !!('draggable' in document.createElement('div')), - supportCssPointerEvents = function (el) { - el = document.createElement('x'); - el.style.cssText = 'pointer-events:auto'; - return el.style.pointerEvents === 'auto'; - }(), - _silent = false, - abs = Math.abs, - slice = [].slice, - touchDragOverListeners = [], - _autoScroll = _throttle(function ( /**Event*/evt, /**Object*/options, /**HTMLElement*/rootEl) { - // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=505521 - if (rootEl && options.scroll) { - var el, - rect, - sens = options.scrollSensitivity, - speed = options.scrollSpeed, - x = evt.clientX, - y = evt.clientY, - winWidth = window.innerWidth, - winHeight = window.innerHeight, - vx, - vy; - - // Delect scrollEl - if (scrollParentEl !== rootEl) { - scrollEl = options.scroll; - scrollParentEl = rootEl; - if (scrollEl === true) { - scrollEl = rootEl; - do { - if (scrollEl.offsetWidth < scrollEl.scrollWidth || scrollEl.offsetHeight < scrollEl.scrollHeight) { - break; - } - /* jshint boss:true */ - } while (scrollEl = scrollEl.parentNode); - } - } - if (scrollEl) { - el = scrollEl; - rect = scrollEl.getBoundingClientRect(); - vx = (abs(rect.right - x) <= sens) - (abs(rect.left - x) <= sens); - vy = (abs(rect.bottom - y) <= sens) - (abs(rect.top - y) <= sens); - } - if (!(vx || vy)) { - vx = (winWidth - x <= sens) - (x <= sens); - vy = (winHeight - y <= sens) - (y <= sens); - - /* jshint expr:true */ - (vx || vy) && (el = win); - } - if (autoScroll.vx !== vx || autoScroll.vy !== vy || autoScroll.el !== el) { - autoScroll.el = el; - autoScroll.vx = vx; - autoScroll.vy = vy; - clearInterval(autoScroll.pid); - if (el) { - autoScroll.pid = setInterval(function () { - if (el === win) { - win.scrollTo(win.pageXOffset + vx * speed, win.pageYOffset + vy * speed); - } else { - vy && (el.scrollTop += vy * speed); - vx && (el.scrollLeft += vx * speed); - } - }, 24); - } - } - } - }, 30), - _prepareGroup = function _prepareGroup(options) { - var group = options.group; - if (!group || _typeof(group) != 'object') { - group = options.group = { - name: group - }; - } - ['pull', 'put'].forEach(function (key) { - if (!(key in group)) { - group[key] = true; - } - }); - options.groups = ' ' + group.name + (group.put.join ? ' ' + group.put.join(' ') : '') + ' '; - }; - - /** - * @class Sortable - * @param {HTMLElement} el - * @param {Object} [options] - */ - function Sortable(el, options) { - if (!(el && el.nodeType && el.nodeType === 1)) { - throw 'Sortable: `el` must be HTMLElement, and not ' + {}.toString.call(el); - } - this.el = el; // root element - this.options = options = _extend({}, options); - - // Export instance - el[expando] = this; - - // Default options - var defaults = { - group: Math.random(), - sort: true, - disabled: false, - store: null, - handle: null, - scroll: true, - scrollSensitivity: 30, - scrollSpeed: 10, - draggable: /[uo]l/i.test(el.nodeName) ? 'li' : '>*', - ghostClass: 'sortable-ghost', - chosenClass: 'sortable-chosen', - ignore: 'a, img', - filter: null, - animation: 0, - setData: function setData(dataTransfer, dragEl) { - dataTransfer.setData('Text', dragEl.textContent); - }, - dropBubble: false, - dragoverBubble: false, - dataIdAttr: 'data-id', - delay: 0, - forceFallback: false, - fallbackClass: 'sortable-fallback', - fallbackOnBody: false - }; - - // Set default options - for (var name in defaults) { - !(name in options) && (options[name] = defaults[name]); - } - _prepareGroup(options); - - // Bind all private methods - for (var fn in this) { - if (fn.charAt(0) === '_') { - this[fn] = this[fn].bind(this); - } - } - - // Setup drag mode - this.nativeDraggable = options.forceFallback ? false : supportDraggable; - - // Bind events - _on(el, 'mousedown', this._onTapStart); - _on(el, 'touchstart', this._onTapStart); - if (this.nativeDraggable) { - _on(el, 'dragover', this); - _on(el, 'dragenter', this); - } - touchDragOverListeners.push(this._onDragOver); - - // Restore sorting - options.store && this.sort(options.store.get(this)); - } - Sortable.prototype = /** @lends Sortable.prototype */{ - constructor: Sortable, - _onTapStart: function _onTapStart( /** Event|TouchEvent */evt) { - var _this = this, - el = this.el, - options = this.options, - type = evt.type, - touch = evt.touches && evt.touches[0], - target = (touch || evt).target, - originalTarget = target, - filter = options.filter; - if (type === 'mousedown' && evt.button !== 0 || options.disabled) { - return; // only left button or enabled - } - - target = _closest(target, options.draggable, el); - if (!target) { - return; - } - - // get the index of the dragged element within its parent - oldIndex = _index(target, options.draggable); - - // Check filter - if (typeof filter === 'function') { - if (filter.call(this, evt, target, this)) { - _dispatchEvent(_this, originalTarget, 'filter', target, el, oldIndex); - evt.preventDefault(); - return; // cancel dnd - } - } else if (filter) { - filter = filter.split(',').some(function (criteria) { - criteria = _closest(originalTarget, criteria.trim(), el); - if (criteria) { - _dispatchEvent(_this, criteria, 'filter', target, el, oldIndex); - return true; - } - }); - if (filter) { - evt.preventDefault(); - return; // cancel dnd - } - } - - if (options.handle && !_closest(originalTarget, options.handle, el)) { - return; - } - - // Prepare `dragstart` - this._prepareDragStart(evt, touch, target); - }, - _prepareDragStart: function _prepareDragStart( /** Event */evt, /** Touch */touch, /** HTMLElement */target) { - var _this = this, - el = _this.el, - options = _this.options, - ownerDocument = el.ownerDocument, - dragStartFn; - if (target && !dragEl && target.parentNode === el) { - tapEvt = evt; - rootEl = el; - dragEl = target; - parentEl = dragEl.parentNode; - nextEl = dragEl.nextSibling; - activeGroup = options.group; - dragStartFn = function dragStartFn() { - // Delayed drag has been triggered - // we can re-enable the events: touchmove/mousemove - _this._disableDelayedDrag(); - - // Make the element draggable - dragEl.draggable = true; - - // Chosen item - _toggleClass(dragEl, _this.options.chosenClass, true); - - // Bind the events: dragstart/dragend - _this._triggerDragStart(touch); - }; - - // Disable "draggable" - options.ignore.split(',').forEach(function (criteria) { - _find(dragEl, criteria.trim(), _disableDraggable); - }); - _on(ownerDocument, 'mouseup', _this._onDrop); - _on(ownerDocument, 'touchend', _this._onDrop); - _on(ownerDocument, 'touchcancel', _this._onDrop); - if (options.delay) { - // If the user moves the pointer or let go the click or touch - // before the delay has been reached: - // disable the delayed drag - _on(ownerDocument, 'mouseup', _this._disableDelayedDrag); - _on(ownerDocument, 'touchend', _this._disableDelayedDrag); - _on(ownerDocument, 'touchcancel', _this._disableDelayedDrag); - _on(ownerDocument, 'mousemove', _this._disableDelayedDrag); - _on(ownerDocument, 'touchmove', _this._disableDelayedDrag); - _this._dragStartTimer = setTimeout(dragStartFn, options.delay); - } else { - dragStartFn(); - } - } - }, - _disableDelayedDrag: function _disableDelayedDrag() { - var ownerDocument = this.el.ownerDocument; - clearTimeout(this._dragStartTimer); - _off(ownerDocument, 'mouseup', this._disableDelayedDrag); - _off(ownerDocument, 'touchend', this._disableDelayedDrag); - _off(ownerDocument, 'touchcancel', this._disableDelayedDrag); - _off(ownerDocument, 'mousemove', this._disableDelayedDrag); - _off(ownerDocument, 'touchmove', this._disableDelayedDrag); - }, - _triggerDragStart: function _triggerDragStart( /** Touch */touch) { - if (touch) { - // Touch device support - tapEvt = { - target: dragEl, - clientX: touch.clientX, - clientY: touch.clientY - }; - this._onDragStart(tapEvt, 'touch'); - } else if (!this.nativeDraggable) { - this._onDragStart(tapEvt, true); - } else { - _on(dragEl, 'dragend', this); - _on(rootEl, 'dragstart', this._onDragStart); - } - try { - if (document.selection) { - // Timeout neccessary for IE9 - setTimeout(function () { - document.selection.empty(); - }); - } else { - window.getSelection().removeAllRanges(); - } - } catch (err) {} - }, - _dragStarted: function _dragStarted() { - if (rootEl && dragEl) { - // Apply effect - _toggleClass(dragEl, this.options.ghostClass, true); - Sortable.active = this; - - // Drag start event - _dispatchEvent(this, rootEl, 'start', dragEl, rootEl, oldIndex); - } - }, - _emulateDragOver: function _emulateDragOver() { - if (touchEvt) { - if (this._lastX === touchEvt.clientX && this._lastY === touchEvt.clientY) { - return; - } - this._lastX = touchEvt.clientX; - this._lastY = touchEvt.clientY; - if (!supportCssPointerEvents) { - _css(ghostEl, 'display', 'none'); - } - var target = document.elementFromPoint(touchEvt.clientX, touchEvt.clientY), - parent = target, - groupName = ' ' + this.options.group.name + '', - i = touchDragOverListeners.length; - if (parent) { - do { - if (parent[expando] && parent[expando].options.groups.indexOf(groupName) > -1) { - while (i--) { - touchDragOverListeners[i]({ - clientX: touchEvt.clientX, - clientY: touchEvt.clientY, - target: target, - rootEl: parent - }); - } - break; - } - target = parent; // store last element - } - /* jshint boss:true */ while (parent = parent.parentNode); - } - if (!supportCssPointerEvents) { - _css(ghostEl, 'display', ''); - } - } - }, - _onTouchMove: function _onTouchMove( /**TouchEvent*/evt) { - if (tapEvt) { - // only set the status to dragging, when we are actually dragging - if (!Sortable.active) { - this._dragStarted(); - } - - // as well as creating the ghost element on the document body - this._appendGhost(); - var touch = evt.touches ? evt.touches[0] : evt, - dx = touch.clientX - tapEvt.clientX, - dy = touch.clientY - tapEvt.clientY, - translate3d = evt.touches ? 'translate3d(' + dx + 'px,' + dy + 'px,0)' : 'translate(' + dx + 'px,' + dy + 'px)'; - moved = true; - touchEvt = touch; - _css(ghostEl, 'webkitTransform', translate3d); - _css(ghostEl, 'mozTransform', translate3d); - _css(ghostEl, 'msTransform', translate3d); - _css(ghostEl, 'transform', translate3d); - evt.preventDefault(); - } - }, - _appendGhost: function _appendGhost() { - if (!ghostEl) { - var rect = dragEl.getBoundingClientRect(), - css = _css(dragEl), - options = this.options, - ghostRect; - ghostEl = dragEl.cloneNode(true); - _toggleClass(ghostEl, options.ghostClass, false); - _toggleClass(ghostEl, options.fallbackClass, true); - _css(ghostEl, 'top', rect.top - parseInt(css.marginTop, 10)); - _css(ghostEl, 'left', rect.left - parseInt(css.marginLeft, 10)); - _css(ghostEl, 'width', rect.width); - _css(ghostEl, 'height', rect.height); - _css(ghostEl, 'opacity', '0.8'); - _css(ghostEl, 'position', 'fixed'); - _css(ghostEl, 'zIndex', '100000'); - _css(ghostEl, 'pointerEvents', 'none'); - options.fallbackOnBody && document.body.appendChild(ghostEl) || rootEl.appendChild(ghostEl); - - // Fixing dimensions. - ghostRect = ghostEl.getBoundingClientRect(); - _css(ghostEl, 'width', rect.width * 2 - ghostRect.width); - _css(ghostEl, 'height', rect.height * 2 - ghostRect.height); - } - }, - _onDragStart: function _onDragStart( /**Event*/evt, /**boolean*/useFallback) { - var dataTransfer = evt.dataTransfer, - options = this.options; - this._offUpEvents(); - if (activeGroup.pull == 'clone') { - cloneEl = dragEl.cloneNode(true); - _css(cloneEl, 'display', 'none'); - rootEl.insertBefore(cloneEl, dragEl); - } - if (useFallback) { - if (useFallback === 'touch') { - // Bind touch events - _on(document, 'touchmove', this._onTouchMove); - _on(document, 'touchend', this._onDrop); - _on(document, 'touchcancel', this._onDrop); - } else { - // Old brwoser - _on(document, 'mousemove', this._onTouchMove); - _on(document, 'mouseup', this._onDrop); - } - this._loopId = setInterval(this._emulateDragOver, 50); - } else { - if (dataTransfer) { - dataTransfer.effectAllowed = 'move'; - options.setData && options.setData.call(this, dataTransfer, dragEl); - } - _on(document, 'drop', this); - setTimeout(this._dragStarted, 0); - } - }, - _onDragOver: function _onDragOver( /**Event*/evt) { - var el = this.el, - target, - dragRect, - revert, - options = this.options, - group = options.group, - groupPut = group.put, - isOwner = activeGroup === group, - canSort = options.sort; - if (evt.preventDefault !== void 0) { - evt.preventDefault(); - !options.dragoverBubble && evt.stopPropagation(); - } - moved = true; - if (activeGroup && !options.disabled && (isOwner ? canSort || (revert = !rootEl.contains(dragEl)) // Reverting item into the original list - : activeGroup.pull && groupPut && (activeGroup.name === group.name || - // by Name - groupPut.indexOf && ~groupPut.indexOf(activeGroup.name) // by Array - )) && (evt.rootEl === void 0 || evt.rootEl === this.el) // touch fallback - ) { - // Smart auto-scrolling - _autoScroll(evt, options, this.el); - if (_silent) { - return; - } - target = _closest(evt.target, options.draggable, el); - dragRect = dragEl.getBoundingClientRect(); - if (revert) { - _cloneHide(true); - if (cloneEl || nextEl) { - rootEl.insertBefore(dragEl, cloneEl || nextEl); - } else if (!canSort) { - rootEl.appendChild(dragEl); - } - return; - } - if (el.children.length === 0 || el.children[0] === ghostEl || el === evt.target && (target = _ghostIsLast(el, evt))) { - if (target) { - if (target.animated) { - return; - } - targetRect = target.getBoundingClientRect(); - } - _cloneHide(isOwner); - if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect) !== false) { - if (!dragEl.contains(el)) { - el.appendChild(dragEl); - parentEl = el; // actualization - } - - this._animate(dragRect, dragEl); - target && this._animate(targetRect, target); - } - } else if (target && !target.animated && target !== dragEl && target.parentNode[expando] !== void 0) { - if (lastEl !== target) { - lastEl = target; - lastCSS = _css(target); - lastParentCSS = _css(target.parentNode); - } - var targetRect = target.getBoundingClientRect(), - width = targetRect.right - targetRect.left, - height = targetRect.bottom - targetRect.top, - floating = /left|right|inline/.test(lastCSS.cssFloat + lastCSS.display) || lastParentCSS.display == 'flex' && lastParentCSS['flex-direction'].indexOf('row') === 0, - isWide = target.offsetWidth > dragEl.offsetWidth, - isLong = target.offsetHeight > dragEl.offsetHeight, - halfway = (floating ? (evt.clientX - targetRect.left) / width : (evt.clientY - targetRect.top) / height) > 0.5, - nextSibling = target.nextElementSibling, - moveVector = _onMove(rootEl, el, dragEl, dragRect, target, targetRect), - after; - if (moveVector !== false) { - _silent = true; - setTimeout(_unsilent, 30); - _cloneHide(isOwner); - if (moveVector === 1 || moveVector === -1) { - after = moveVector === 1; - } else if (floating) { - var elTop = dragEl.offsetTop, - tgTop = target.offsetTop; - if (elTop === tgTop) { - after = target.previousElementSibling === dragEl && !isWide || halfway && isWide; - } else { - after = tgTop > elTop; - } - } else { - after = nextSibling !== dragEl && !isLong || halfway && isLong; - } - if (!dragEl.contains(el)) { - if (after && !nextSibling) { - el.appendChild(dragEl); - } else { - target.parentNode.insertBefore(dragEl, after ? nextSibling : target); - } - } - parentEl = dragEl.parentNode; // actualization - - this._animate(dragRect, dragEl); - this._animate(targetRect, target); - } - } - } - }, - _animate: function _animate(prevRect, target) { - var ms = this.options.animation; - if (ms) { - var currentRect = target.getBoundingClientRect(); - _css(target, 'transition', 'none'); - _css(target, 'transform', 'translate3d(' + (prevRect.left - currentRect.left) + 'px,' + (prevRect.top - currentRect.top) + 'px,0)'); - target.offsetWidth; // repaint - - _css(target, 'transition', 'all ' + ms + 'ms'); - _css(target, 'transform', 'translate3d(0,0,0)'); - clearTimeout(target.animated); - target.animated = setTimeout(function () { - _css(target, 'transition', ''); - _css(target, 'transform', ''); - target.animated = false; - }, ms); - } - }, - _offUpEvents: function _offUpEvents() { - var ownerDocument = this.el.ownerDocument; - _off(document, 'touchmove', this._onTouchMove); - _off(ownerDocument, 'mouseup', this._onDrop); - _off(ownerDocument, 'touchend', this._onDrop); - _off(ownerDocument, 'touchcancel', this._onDrop); - }, - _onDrop: function _onDrop( /**Event*/evt) { - var el = this.el, - options = this.options; - clearInterval(this._loopId); - clearInterval(autoScroll.pid); - clearTimeout(this._dragStartTimer); - - // Unbind events - _off(document, 'mousemove', this._onTouchMove); - if (this.nativeDraggable) { - _off(document, 'drop', this); - _off(el, 'dragstart', this._onDragStart); - } - this._offUpEvents(); - if (evt) { - if (moved) { - evt.preventDefault(); - !options.dropBubble && evt.stopPropagation(); - } - ghostEl && ghostEl.parentNode.removeChild(ghostEl); - if (dragEl) { - if (this.nativeDraggable) { - _off(dragEl, 'dragend', this); - } - _disableDraggable(dragEl); - - // Remove class's - _toggleClass(dragEl, this.options.ghostClass, false); - _toggleClass(dragEl, this.options.chosenClass, false); - if (rootEl !== parentEl) { - newIndex = _index(dragEl, options.draggable); - if (newIndex >= 0) { - // drag from one list and drop into another - _dispatchEvent(null, parentEl, 'sort', dragEl, rootEl, oldIndex, newIndex); - _dispatchEvent(this, rootEl, 'sort', dragEl, rootEl, oldIndex, newIndex); - - // Add event - _dispatchEvent(null, parentEl, 'add', dragEl, rootEl, oldIndex, newIndex); - - // Remove event - _dispatchEvent(this, rootEl, 'remove', dragEl, rootEl, oldIndex, newIndex); - } - } else { - // Remove clone - cloneEl && cloneEl.parentNode.removeChild(cloneEl); - if (dragEl.nextSibling !== nextEl) { - // Get the index of the dragged element within its parent - newIndex = _index(dragEl, options.draggable); - if (newIndex >= 0) { - // drag & drop within the same list - _dispatchEvent(this, rootEl, 'update', dragEl, rootEl, oldIndex, newIndex); - _dispatchEvent(this, rootEl, 'sort', dragEl, rootEl, oldIndex, newIndex); - } - } - } - if (Sortable.active) { - /* jshint eqnull:true */ - if (newIndex == null || newIndex === -1) { - newIndex = oldIndex; - } - _dispatchEvent(this, rootEl, 'end', dragEl, rootEl, oldIndex, newIndex); - - // Save sorting - this.save(); - } - } - } - this._nulling(); - }, - _nulling: function _nulling() { - if (Sortable.active === this) { - rootEl = dragEl = parentEl = ghostEl = nextEl = cloneEl = scrollEl = scrollParentEl = tapEvt = touchEvt = moved = newIndex = lastEl = lastCSS = activeGroup = Sortable.active = null; - } - }, - handleEvent: function handleEvent( /**Event*/evt) { - var type = evt.type; - if (type === 'dragover' || type === 'dragenter') { - if (dragEl) { - this._onDragOver(evt); - _globalDragOver(evt); - } - } else if (type === 'drop' || type === 'dragend') { - this._onDrop(evt); - } - }, - /** - * Serializes the item into an array of string. - * @returns {String[]} - */ - toArray: function toArray() { - var order = [], - el, - children = this.el.children, - i = 0, - n = children.length, - options = this.options; - for (; i < n; i++) { - el = children[i]; - if (_closest(el, options.draggable, this.el)) { - order.push(el.getAttribute(options.dataIdAttr) || _generateId(el)); - } - } - return order; - }, - /** - * Sorts the elements according to the array. - * @param {String[]} order order of the items - */ - sort: function sort(order) { - var items = {}, - rootEl = this.el; - this.toArray().forEach(function (id, i) { - var el = rootEl.children[i]; - if (_closest(el, this.options.draggable, rootEl)) { - items[id] = el; - } - }, this); - order.forEach(function (id) { - if (items[id]) { - rootEl.removeChild(items[id]); - rootEl.appendChild(items[id]); - } - }); - }, - /** - * Save the current sorting - */ - save: function save() { - var store = this.options.store; - store && store.set(this); - }, - /** - * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree. - * @param {HTMLElement} el - * @param {String} [selector] default: `options.draggable` - * @returns {HTMLElement|null} - */ - closest: function closest(el, selector) { - return _closest(el, selector || this.options.draggable, this.el); - }, - /** - * Set/get option - * @param {string} name - * @param {*} [value] - * @returns {*} - */ - option: function option(name, value) { - var options = this.options; - if (value === void 0) { - return options[name]; - } else { - options[name] = value; - if (name === 'group') { - _prepareGroup(options); - } - } - }, - /** - * Destroy - */ - destroy: function destroy() { - var el = this.el; - el[expando] = null; - _off(el, 'mousedown', this._onTapStart); - _off(el, 'touchstart', this._onTapStart); - if (this.nativeDraggable) { - _off(el, 'dragover', this); - _off(el, 'dragenter', this); - } - - // Remove draggable attributes - Array.prototype.forEach.call(el.querySelectorAll('[draggable]'), function (el) { - el.removeAttribute('draggable'); - }); - touchDragOverListeners.splice(touchDragOverListeners.indexOf(this._onDragOver), 1); - this._onDrop(); - this.el = el = null; - } - }; - function _cloneHide(state) { - if (cloneEl && cloneEl.state !== state) { - _css(cloneEl, 'display', state ? 'none' : ''); - !state && cloneEl.state && rootEl.insertBefore(cloneEl, dragEl); - cloneEl.state = state; - } - } - function _closest( /**HTMLElement*/el, /**String*/selector, /**HTMLElement*/ctx) { - if (el) { - ctx = ctx || document; - do { - if (selector === '>*' && el.parentNode === ctx || _matches(el, selector)) { - return el; - } - } while (el !== ctx && (el = el.parentNode)); - } - return null; - } - function _globalDragOver( /**Event*/evt) { - if (evt.dataTransfer) { - evt.dataTransfer.dropEffect = 'move'; - } - evt.preventDefault(); - } - function _on(el, event, fn) { - el.addEventListener(event, fn, false); - } - function _off(el, event, fn) { - el.removeEventListener(event, fn, false); - } - function _toggleClass(el, name, state) { - if (el) { - if (el.classList) { - el.classList[state ? 'add' : 'remove'](name); - } else { - var className = (' ' + el.className + ' ').replace(RSPACE, ' ').replace(' ' + name + ' ', ' '); - el.className = (className + (state ? ' ' + name : '')).replace(RSPACE, ' '); - } - } - } - function _css(el, prop, val) { - var style = el && el.style; - if (style) { - if (val === void 0) { - if (document.defaultView && document.defaultView.getComputedStyle) { - val = document.defaultView.getComputedStyle(el, ''); - } else if (el.currentStyle) { - val = el.currentStyle; - } - return prop === void 0 ? val : val[prop]; - } else { - if (!(prop in style)) { - prop = '-webkit-' + prop; - } - style[prop] = val + (typeof val === 'string' ? '' : 'px'); - } - } - } - function _find(ctx, tagName, iterator) { - if (ctx) { - var list = ctx.getElementsByTagName(tagName), - i = 0, - n = list.length; - if (iterator) { - for (; i < n; i++) { - iterator(list[i], i); - } - } - return list; - } - return []; - } - function _dispatchEvent(sortable, rootEl, name, targetEl, fromEl, startIndex, newIndex) { - var evt = document.createEvent('Event'), - options = (sortable || rootEl[expando]).options, - onName = 'on' + name.charAt(0).toUpperCase() + name.substr(1); - evt.initEvent(name, true, true); - evt.to = rootEl; - evt.from = fromEl || rootEl; - evt.item = targetEl || rootEl; - evt.clone = cloneEl; - evt.oldIndex = startIndex; - evt.newIndex = newIndex; - rootEl.dispatchEvent(evt); - if (options[onName]) { - options[onName].call(sortable, evt); - } - } - function _onMove(fromEl, toEl, dragEl, dragRect, targetEl, targetRect) { - var evt, - sortable = fromEl[expando], - onMoveFn = sortable.options.onMove, - retVal; - evt = document.createEvent('Event'); - evt.initEvent('move', true, true); - evt.to = toEl; - evt.from = fromEl; - evt.dragged = dragEl; - evt.draggedRect = dragRect; - evt.related = targetEl || toEl; - evt.relatedRect = targetRect || toEl.getBoundingClientRect(); - fromEl.dispatchEvent(evt); - if (onMoveFn) { - retVal = onMoveFn.call(sortable, evt); - } - return retVal; - } - function _disableDraggable(el) { - el.draggable = false; - } - function _unsilent() { - _silent = false; - } - - /** @returns {HTMLElement|false} */ - function _ghostIsLast(el, evt) { - var lastEl = el.lastElementChild, - rect = lastEl.getBoundingClientRect(); - return (evt.clientY - (rect.top + rect.height) > 5 || evt.clientX - (rect.right + rect.width) > 5) && lastEl; // min delta - } - - /** - * Generate id - * @param {HTMLElement} el - * @returns {String} - * @private - */ - function _generateId(el) { - var str = el.tagName + el.className + el.src + el.href + el.textContent, - i = str.length, - sum = 0; - while (i--) { - sum += str.charCodeAt(i); - } - return sum.toString(36); - } - - /** - * Returns the index of an element within its parent for a selected set of - * elements - * @param {HTMLElement} el - * @param {selector} selector - * @return {number} - */ - function _index(el, selector) { - var index = 0; - if (!el || !el.parentNode) { - return -1; - } - while (el && (el = el.previousElementSibling)) { - if (el.nodeName.toUpperCase() !== 'TEMPLATE' && _matches(el, selector)) { - index++; - } - } - return index; - } - function _matches( /**HTMLElement*/el, /**String*/selector) { - if (el) { - selector = selector.split('.'); - var tag = selector.shift().toUpperCase(), - re = new RegExp('\\s(' + selector.join('|') + ')(?=\\s)', 'g'); - return (tag === '' || el.nodeName.toUpperCase() == tag) && (!selector.length || ((' ' + el.className + ' ').match(re) || []).length == selector.length); - } - return false; - } - function _throttle(callback, ms) { - var args, _this; - return function () { - if (args === void 0) { - args = arguments; - _this = this; - setTimeout(function () { - if (args.length === 1) { - callback.call(_this, args[0]); - } else { - callback.apply(_this, args); - } - args = void 0; - }, ms); - } - }; - } - function _extend(dst, src) { - if (dst && src) { - for (var key in src) { - if (src.hasOwnProperty(key)) { - dst[key] = src[key]; - } - } - } - return dst; - } - - // Export utils - Sortable.utils = { - on: _on, - off: _off, - css: _css, - find: _find, - is: function is(el, selector) { - return !!_closest(el, selector, el); - }, - extend: _extend, - throttle: _throttle, - closest: _closest, - toggleClass: _toggleClass, - index: _index - }; - - /** - * Create sortable instance - * @param {HTMLElement} el - * @param {Object} [options] - */ - Sortable.create = function (el, options) { - return new Sortable(el, options); - }; - - // Export - Sortable.version = '1.4.2'; - return Sortable; -}); function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } var _excluded = ["callback"]; function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } diff --git a/src/OrchardCore.Themes/TheAdmin/wwwroot/js/TheAdmin.min.js b/src/OrchardCore.Themes/TheAdmin/wwwroot/js/TheAdmin.min.js index b88172d6a61..cad42a1de33 100644 --- a/src/OrchardCore.Themes/TheAdmin/wwwroot/js/TheAdmin.min.js +++ b/src/OrchardCore.Themes/TheAdmin/wwwroot/js/TheAdmin.min.js @@ -1,6 +1 @@ -function _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(e) -/**! - * Sortable - * @author RubaXa - * @license MIT - */}function _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(e)}!function(e){"use strict";"function"==typeof define&&define.amd?define(e):"undefined"!=typeof module&&void 0!==module.exports?module.exports=e():"undefined"!=typeof Package?Sortable=e():window.Sortable=e()}((function(){"use strict";if("undefined"==typeof window||void 0===window.document)return function(){throw new Error("Sortable.js requires a window with a document")};var e,t,o,a,n,i,r,s,l,c,d,u,f,p,m,h,b,g,v={},y=/\s+/g,_="Sortable"+(new Date).getTime(),D=window,w=D.document,S=D.parseInt,C=!!("draggable"in w.createElement("div")),E=((g=w.createElement("x")).style.cssText="pointer-events:auto","auto"===g.style.pointerEvents),O=!1,T=Math.abs,x=[],$=V((function(e,t,o){if(o&&t.scroll){var a,n,i,l,c=t.scrollSensitivity,d=t.scrollSpeed,u=e.clientX,f=e.clientY,p=window.innerWidth,m=window.innerHeight;if(s!==o&&(r=t.scroll,s=o,!0===r)){r=o;do{if(r.offsetWidth*",ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",ignore:"a, img",filter:null,animation:0,setData:function(e,t){e.setData("Text",t.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1};for(var a in o)!(a in t)&&(t[a]=o[a]);for(var n in j(t),this)"_"===n.charAt(0)&&(this[n]=this[n].bind(this));this.nativeDraggable=!t.forceFallback&&C,R(e,"mousedown",this._onTapStart),R(e,"touchstart",this._onTapStart),this.nativeDraggable&&(R(e,"dragover",this),R(e,"dragenter",this)),x.push(this._onDragOver),t.store&&this.sort(t.store.get(this))}function N(t){a&&a.state!==t&&(B(a,"display",t?"none":""),!t&&a.state&&n.insertBefore(a,e),a.state=t)}function k(e,t,o){if(e){o=o||w;do{if(">*"===t&&e.parentNode===o||H(e,t))return e}while(e!==o&&(e=e.parentNode))}return null}function R(e,t,o){e.addEventListener(t,o,!1)}function U(e,t,o){e.removeEventListener(t,o,!1)}function A(e,t,o){if(e)if(e.classList)e.classList[o?"add":"remove"](t);else{var a=(" "+e.className+" ").replace(y," ").replace(" "+t+" "," ");e.className=(a+(o?" "+t:"")).replace(y," ")}}function B(e,t,o){var a=e&&e.style;if(a){if(void 0===o)return w.defaultView&&w.defaultView.getComputedStyle?o=w.defaultView.getComputedStyle(e,""):e.currentStyle&&(o=e.currentStyle),void 0===t?o:o[t];t in a||(t="-webkit-"+t),a[t]=o+("string"==typeof o?"":"px")}}function M(e,t,o){if(e){var a=e.getElementsByTagName(t),n=0,i=a.length;if(o)for(;n-1){for(;n--;)x[n]({clientX:h.clientX,clientY:h.clientY,target:e,rootEl:t});break}e=t}while(t=t.parentNode);E||B(o,"display","")}},_onTouchMove:function(e){if(m){P.active||this._dragStarted(),this._appendGhost();var t=e.touches?e.touches[0]:e,a=t.clientX-m.clientX,n=t.clientY-m.clientY,i=e.touches?"translate3d("+a+"px,"+n+"px,0)":"translate("+a+"px,"+n+"px)";b=!0,h=t,B(o,"webkitTransform",i),B(o,"mozTransform",i),B(o,"msTransform",i),B(o,"transform",i),e.preventDefault()}},_appendGhost:function(){if(!o){var t,a=e.getBoundingClientRect(),i=B(e),r=this.options;A(o=e.cloneNode(!0),r.ghostClass,!1),A(o,r.fallbackClass,!0),B(o,"top",a.top-S(i.marginTop,10)),B(o,"left",a.left-S(i.marginLeft,10)),B(o,"width",a.width),B(o,"height",a.height),B(o,"opacity","0.8"),B(o,"position","fixed"),B(o,"zIndex","100000"),B(o,"pointerEvents","none"),r.fallbackOnBody&&w.body.appendChild(o)||n.appendChild(o),t=o.getBoundingClientRect(),B(o,"width",2*a.width-t.width),B(o,"height",2*a.height-t.height)}},_onDragStart:function(t,o){var i=t.dataTransfer,r=this.options;this._offUpEvents(),"clone"==p.pull&&(B(a=e.cloneNode(!0),"display","none"),n.insertBefore(a,e)),o?("touch"===o?(R(w,"touchmove",this._onTouchMove),R(w,"touchend",this._onDrop),R(w,"touchcancel",this._onDrop)):(R(w,"mousemove",this._onTouchMove),R(w,"mouseup",this._onDrop)),this._loopId=setInterval(this._emulateDragOver,50)):(i&&(i.effectAllowed="move",r.setData&&r.setData.call(this,i,e)),R(w,"drop",this),setTimeout(this._dragStarted,0))},_onDragOver:function(r){var s,u,f,m=this.el,h=this.options,g=h.group,v=g.put,y=p===g,D=h.sort;if(void 0!==r.preventDefault&&(r.preventDefault(),!h.dragoverBubble&&r.stopPropagation()),b=!0,p&&!h.disabled&&(y?D||(f=!n.contains(e)):p.pull&&v&&(p.name===g.name||v.indexOf&&~v.indexOf(p.name)))&&(void 0===r.rootEl||r.rootEl===this.el)){if($(r,h,this.el),O)return;if(s=k(r.target,h.draggable,m),u=e.getBoundingClientRect(),f)return N(!0),void(a||i?n.insertBefore(e,a||i):D||n.appendChild(e));if(0===m.children.length||m.children[0]===o||m===r.target&&(s=function(e,t){var o=e.lastElementChild,a=o.getBoundingClientRect();return(t.clientY-(a.top+a.height)>5||t.clientX-(a.right+a.width)>5)&&o}(m,r))){if(s){if(s.animated)return;S=s.getBoundingClientRect()}N(y),!1!==I(n,m,e,u,s,S)&&(e.contains(m)||(m.appendChild(e),t=m),this._animate(u,e),s&&this._animate(S,s))}else if(s&&!s.animated&&s!==e&&void 0!==s.parentNode[_]){l!==s&&(l=s,c=B(s),d=B(s.parentNode));var w,S=s.getBoundingClientRect(),C=S.right-S.left,E=S.bottom-S.top,T=/left|right|inline/.test(c.cssFloat+c.display)||"flex"==d.display&&0===d["flex-direction"].indexOf("row"),x=s.offsetWidth>e.offsetWidth,j=s.offsetHeight>e.offsetHeight,P=(T?(r.clientX-S.left)/C:(r.clientY-S.top)/E)>.5,R=s.nextElementSibling,U=I(n,m,e,u,s,S);if(!1!==U){if(O=!0,setTimeout(X,30),N(y),1===U||-1===U)w=1===U;else if(T){var A=e.offsetTop,M=s.offsetTop;w=A===M?s.previousElementSibling===e&&!x||P&&x:M>A}else w=R!==e&&!j||P&&j;e.contains(m)||(w&&!R?m.appendChild(e):s.parentNode.insertBefore(e,w?R:s)),t=e.parentNode,this._animate(u,e),this._animate(S,s)}}}},_animate:function(e,t){var o=this.options.animation;if(o){var a=t.getBoundingClientRect();B(t,"transition","none"),B(t,"transform","translate3d("+(e.left-a.left)+"px,"+(e.top-a.top)+"px,0)"),t.offsetWidth,B(t,"transition","all "+o+"ms"),B(t,"transform","translate3d(0,0,0)"),clearTimeout(t.animated),t.animated=setTimeout((function(){B(t,"transition",""),B(t,"transform",""),t.animated=!1}),o)}},_offUpEvents:function(){var e=this.el.ownerDocument;U(w,"touchmove",this._onTouchMove),U(e,"mouseup",this._onDrop),U(e,"touchend",this._onDrop),U(e,"touchcancel",this._onDrop)},_onDrop:function(r){var s=this.el,l=this.options;clearInterval(this._loopId),clearInterval(v.pid),clearTimeout(this._dragStartTimer),U(w,"mousemove",this._onTouchMove),this.nativeDraggable&&(U(w,"drop",this),U(s,"dragstart",this._onDragStart)),this._offUpEvents(),r&&(b&&(r.preventDefault(),!l.dropBubble&&r.stopPropagation()),o&&o.parentNode.removeChild(o),e&&(this.nativeDraggable&&U(e,"dragend",this),Y(e),A(e,this.options.ghostClass,!1),A(e,this.options.chosenClass,!1),n!==t?(f=z(e,l.draggable))>=0&&(L(null,t,"sort",e,n,u,f),L(this,n,"sort",e,n,u,f),L(null,t,"add",e,n,u,f),L(this,n,"remove",e,n,u,f)):(a&&a.parentNode.removeChild(a),e.nextSibling!==i&&(f=z(e,l.draggable))>=0&&(L(this,n,"update",e,n,u,f),L(this,n,"sort",e,n,u,f))),P.active&&(null!=f&&-1!==f||(f=u),L(this,n,"end",e,n,u,f),this.save()))),this._nulling()},_nulling:function(){P.active===this&&(n=e=t=o=i=a=r=s=m=h=b=f=l=c=p=P.active=null)},handleEvent:function(t){var o=t.type;"dragover"===o||"dragenter"===o?e&&(this._onDragOver(t),function(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move");e.preventDefault()}(t)):"drop"!==o&&"dragend"!==o||this._onDrop(t)},toArray:function(){for(var e,t=[],o=this.el.children,a=0,n=o.length,i=this.options;a=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}function _objectWithoutPropertiesLoose(e,t){if(null==e)return{};var o,a,n={},i=Object.keys(e);for(a=0;a=0||(n[o]=e[o]);return n}function confirmDialog(e){var t=e.callback,o=_objectWithoutProperties(e,_excluded),a=$("#confirmRemoveModalMetadata").data(),n=$.extend({},a,o),i=n.title,r=n.message,s=n.okText,l=n.cancelText,c=n.okClass,d=n.cancelClass;$('").appendTo("body");var u=new bootstrap.Modal($("#confirmRemoveModal"),{backdrop:"static",keyboard:!1});u.show(),document.getElementById("confirmRemoveModal").addEventListener("hidden.bs.modal",(function(){document.getElementById("confirmRemoveModal").remove(),u.dispose()})),$("#modalOkButton").click((function(){t(!0),u.hide()})),$("#modalCancelButton").click((function(){t(!1),u.hide()}))}function getTechnicalName(e){var t,o="";if(!e||0==e.length)return"";for(e=removeDiacritics(e),i=0;i0)&&(o+=t);return o}function isLetter(e){return 1===e.length&&e.match(/[a-z]/i)}function isNumber(e){return 1===e.length&&e.match(/[0-9]/i)}document.addEventListener("DOMContentLoaded",(function(){document.body.classList.remove("preload")})),$((function(){$("body").on("click",'[data-url-af~="RemoveUrl"], a[itemprop~="RemoveUrl"]',(function(){var e=$(this);return 1==e.filter('a[itemprop~="UnsafeUrl"]').length&&console.warn("Please use data-url-af instead of itemprop attribute for confirm modals. Using itemprop will eventually become deprecated."),1==e.filter('[data-url-af~="UnsafeUrl"], a[itemprop~="UnsafeUrl"]').length||confirmDialog(_objectSpread(_objectSpread({},e.data()),{},{callback:function(t){if(t){var o=e.attr("href");if(null==o){var a=e.parents("form");a.append($('')),a.submit()}else window.location=o}}})),!1}))})),$((function(){var e=$("input[name=__RequestVerificationToken]").first();e&&$("body").on("click",'a[data-url-af~="UnsafeUrl"], a[itemprop~="UnsafeUrl"]',(function(){var t=$(this);1==t.filter('a[itemprop~="UnsafeUrl"]').length&&console.warn("Please use data-url-af instead of itemprop attribute for confirm modals. Using itemprop will eventually become deprecated.");var o=t.attr("href").split("?"),a=$('
');if(a.append(e.clone()),o.length>1)for(var n=o[1].split("&"),i=0;i'))}a.css({position:"absolute",left:"-9999em"}),$("body").append(a);var s=t.data("unsafe-url");return s&&s.length>0||1==t.filter('[data-url-af~="RemoveUrl"], a[itemprop~="RemoveUrl"]').length?(confirmDialog(_objectSpread(_objectSpread({},t.data()),{},{callback:function(e){e&&a.submit()}})),!1):(a.submit(),!1)}))})),[].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]')).map((function(e){return new bootstrap.Tooltip(e)})),$("body").on("submit","form.no-multisubmit",(function(e){var t="submitting";form=$(this),form.hasClass(t)?e.preventDefault():(form.addClass(t),setTimeout((function(){form.removeClass(t)}),5e3))})),$((function(){($("body").hasClass("left-sidebar-compact")||$("body").hasClass("no-admin-preferences")&&$(window).width()<768)&&setCompactStatus()})),$("span.title").each((function(){$(this).prev(".icon").prop("title",$(this).text())})),$(".leftbar-compactor").click((function(){$("body").hasClass("left-sidebar-compact")?unSetCompactStatus():setCompactStatus(!0)})),$("#left-nav li.has-items").click((function(){$("#left-nav li.has-items").removeClass("visible"),$(this).addClass("visible")})),$(document).on("click",(function(e){var t=$("#left-nav li.has-items");t===e.target||t.has(e.target).length||$("#left-nav li.has-items").removeClass("visible")}));var subMenuArray=new Array;function setCompactStatus(e){if(!$("body").hasClass("left-sidebar-compact")){var t=$("#left-nav ul.menu-admin > li > figure > figcaption > .item-label");t.css("background-color","transparent"),setTimeout((function(){t.css("background-color","")}),200)}$("body").addClass("left-sidebar-compact"),$("#left-nav ul.menu-admin > li > figure > ul").removeClass("collapse"),$("#left-nav ul.menu-admin > li > figure > figcaption > a").attr("data-bs-toggle",""),$("#left-nav li.has-items").removeClass("visible"),setTimeout((function(){$("#left-nav > ul > li").css("transition","none")}),200),1==e&&(isCompactExplicit=!0),persistAdminPreferences()}function unSetCompactStatus(){$("body").removeClass("left-sidebar-compact"),$("#left-nav ul.menu-admin > li > figure > ul").addClass("collapse"),$("#left-nav ul.menu-admin > li > figure > figcaption a").attr("data-bs-toggle","collapse"),$("#left-nav li.has-items").removeClass("visible"),$("#left-nav > ul > li").css("transition",""),isCompactExplicit=!1,persistAdminPreferences()}var leftNav=document.getElementById("left-nav"),resizeObserver=new ResizeObserver((function(e){isCompactExplicit&&leftNav.scrollHeight>leftNav.clientHeight?document.body.classList.add("scroll"):document.body.classList.remove("scroll")}));null!=leftNav&&resizeObserver.observe(leftNav);for(var defaultDiacriticsRemovalMap=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"OE",letters:"ŒŒ"},{base:"oe",letters:"œœ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],diacriticsMap={},i=0;i768&&(0==isCompactExplicit&&unSetCompactStatus(),t=i,o=!0)),e=i,a=n}))}(); +function _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(e)}var _excluded=["callback"];function ownKeys(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,s)}return a}function _objectSpread(e){for(var t=1;t=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}function _objectWithoutPropertiesLoose(e,t){if(null==e)return{};var a,s,r={},l=Object.keys(e);for(s=0;s=0||(r[a]=e[a]);return r}function confirmDialog(e){var t=e.callback,a=_objectWithoutProperties(e,_excluded),s=$("#confirmRemoveModalMetadata").data(),r=$.extend({},s,a),l=r.title,o=r.message,i=r.okText,n=r.cancelText,c=r.okClass,b=r.cancelClass;$('").appendTo("body");var u=new bootstrap.Modal($("#confirmRemoveModal"),{backdrop:"static",keyboard:!1});u.show(),document.getElementById("confirmRemoveModal").addEventListener("hidden.bs.modal",(function(){document.getElementById("confirmRemoveModal").remove(),u.dispose()})),$("#modalOkButton").click((function(){t(!0),u.hide()})),$("#modalCancelButton").click((function(){t(!1),u.hide()}))}function getTechnicalName(e){var t,a="";if(!e||0==e.length)return"";for(e=removeDiacritics(e),i=0;i0)&&(a+=t);return a}function isLetter(e){return 1===e.length&&e.match(/[a-z]/i)}function isNumber(e){return 1===e.length&&e.match(/[0-9]/i)}document.addEventListener("DOMContentLoaded",(function(){document.body.classList.remove("preload")})),$((function(){$("body").on("click",'[data-url-af~="RemoveUrl"], a[itemprop~="RemoveUrl"]',(function(){var e=$(this);return 1==e.filter('a[itemprop~="UnsafeUrl"]').length&&console.warn("Please use data-url-af instead of itemprop attribute for confirm modals. Using itemprop will eventually become deprecated."),1==e.filter('[data-url-af~="UnsafeUrl"], a[itemprop~="UnsafeUrl"]').length||confirmDialog(_objectSpread(_objectSpread({},e.data()),{},{callback:function(t){if(t){var a=e.attr("href");if(null==a){var s=e.parents("form");s.append($('')),s.submit()}else window.location=a}}})),!1}))})),$((function(){var e=$("input[name=__RequestVerificationToken]").first();e&&$("body").on("click",'a[data-url-af~="UnsafeUrl"], a[itemprop~="UnsafeUrl"]',(function(){var t=$(this);1==t.filter('a[itemprop~="UnsafeUrl"]').length&&console.warn("Please use data-url-af instead of itemprop attribute for confirm modals. Using itemprop will eventually become deprecated.");var a=t.attr("href").split("?"),s=$('');if(s.append(e.clone()),a.length>1)for(var r=a[1].split("&"),l=0;l'))}s.css({position:"absolute",left:"-9999em"}),$("body").append(s);var i=t.data("unsafe-url");return i&&i.length>0||1==t.filter('[data-url-af~="RemoveUrl"], a[itemprop~="RemoveUrl"]').length?(confirmDialog(_objectSpread(_objectSpread({},t.data()),{},{callback:function(e){e&&s.submit()}})),!1):(s.submit(),!1)}))})),[].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]')).map((function(e){return new bootstrap.Tooltip(e)})),$("body").on("submit","form.no-multisubmit",(function(e){var t="submitting";form=$(this),form.hasClass(t)?e.preventDefault():(form.addClass(t),setTimeout((function(){form.removeClass(t)}),5e3))})),$((function(){($("body").hasClass("left-sidebar-compact")||$("body").hasClass("no-admin-preferences")&&$(window).width()<768)&&setCompactStatus()})),$("span.title").each((function(){$(this).prev(".icon").prop("title",$(this).text())})),$(".leftbar-compactor").click((function(){$("body").hasClass("left-sidebar-compact")?unSetCompactStatus():setCompactStatus(!0)})),$("#left-nav li.has-items").click((function(){$("#left-nav li.has-items").removeClass("visible"),$(this).addClass("visible")})),$(document).on("click",(function(e){var t=$("#left-nav li.has-items");t===e.target||t.has(e.target).length||$("#left-nav li.has-items").removeClass("visible")}));var subMenuArray=new Array;function setCompactStatus(e){if(!$("body").hasClass("left-sidebar-compact")){var t=$("#left-nav ul.menu-admin > li > figure > figcaption > .item-label");t.css("background-color","transparent"),setTimeout((function(){t.css("background-color","")}),200)}$("body").addClass("left-sidebar-compact"),$("#left-nav ul.menu-admin > li > figure > ul").removeClass("collapse"),$("#left-nav ul.menu-admin > li > figure > figcaption > a").attr("data-bs-toggle",""),$("#left-nav li.has-items").removeClass("visible"),setTimeout((function(){$("#left-nav > ul > li").css("transition","none")}),200),1==e&&(isCompactExplicit=!0),persistAdminPreferences()}function unSetCompactStatus(){$("body").removeClass("left-sidebar-compact"),$("#left-nav ul.menu-admin > li > figure > ul").addClass("collapse"),$("#left-nav ul.menu-admin > li > figure > figcaption a").attr("data-bs-toggle","collapse"),$("#left-nav li.has-items").removeClass("visible"),$("#left-nav > ul > li").css("transition",""),isCompactExplicit=!1,persistAdminPreferences()}var leftNav=document.getElementById("left-nav"),resizeObserver=new ResizeObserver((function(e){isCompactExplicit&&leftNav.scrollHeight>leftNav.clientHeight?document.body.classList.add("scroll"):document.body.classList.remove("scroll")}));null!=leftNav&&resizeObserver.observe(leftNav);for(var defaultDiacriticsRemovalMap=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"OE",letters:"ŒŒ"},{base:"oe",letters:"œœ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],diacriticsMap={},i=0;i768&&(0==isCompactExplicit&&unSetCompactStatus(),t=l,a=!0)),e=l,s=r}))}(); From afa4f407b91d7622b09b191214d5b4aea753c612 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 7 Aug 2024 22:22:47 +0200 Subject: [PATCH 3/5] Formatting --- .../OrchardCore.ContentTypes/Views/Admin/Edit.cshtml | 1 + 1 file changed, 1 insertion(+) diff --git a/src/OrchardCore.Modules/OrchardCore.ContentTypes/Views/Admin/Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.ContentTypes/Views/Admin/Edit.cshtml index 0864df92452..d2b175e9620 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentTypes/Views/Admin/Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.ContentTypes/Views/Admin/Edit.cshtml @@ -163,6 +163,7 @@ if (fields) { Sortable.create(document.getElementById("fields")); } + const parts = document.getElementById("parts"); if (parts) { From f75a5635304a35a57405e0ef6b3252788f9f6c85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 7 Aug 2024 22:23:05 +0200 Subject: [PATCH 4/5] Fixing Sortable dependency name for Media too --- .../OrchardCore.Media/ResourceManifestOptionsConfiguration.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OrchardCore.Modules/OrchardCore.Media/ResourceManifestOptionsConfiguration.cs b/src/OrchardCore.Modules/OrchardCore.Media/ResourceManifestOptionsConfiguration.cs index 3031fc29a58..50e933d1be7 100644 --- a/src/OrchardCore.Modules/OrchardCore.Media/ResourceManifestOptionsConfiguration.cs +++ b/src/OrchardCore.Modules/OrchardCore.Media/ResourceManifestOptionsConfiguration.cs @@ -14,7 +14,7 @@ static ResourceManagementOptionsConfiguration() _manifest .DefineScript("media") .SetUrl("~/OrchardCore.Media/Scripts/media.min.js", "~/OrchardCore.Media/Scripts/media.js") - .SetDependencies("vuejs", "sortable", "vuedraggable", "jQuery-ui", "credential-helpers") + .SetDependencies("vuejs", "Sortable", "vuedraggable", "jQuery-ui", "credential-helpers") .SetVersion("1.0.0"); _manifest From 0e1d7b81a193f877440b7963e967c8788159566d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 7 Aug 2024 23:06:47 +0200 Subject: [PATCH 5/5] Re-adding necessary Sortable inclusions --- .../OrchardCore.ContentTypes/Views/Admin/Edit.cshtml | 3 ++- .../OrchardCore.ContentTypes/Views/Admin/EditPart.cshtml | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/OrchardCore.Modules/OrchardCore.ContentTypes/Views/Admin/Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.ContentTypes/Views/Admin/Edit.cshtml index d2b175e9620..1e8cf0c376c 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentTypes/Views/Admin/Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.ContentTypes/Views/Admin/Edit.cshtml @@ -156,7 +156,8 @@ - +