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AAI,EAA0B,EAAE,SAAS,MAAM,KAAK,iBAClD,EAAyB,EAAE,SAAS,MAAM,KAAK,gBAkCjD,SAAS,EAAU,EAAG,GACpB,IAAI,EAAU,EAAE,WACZ,EAAW,EAAE,cAAgB,EAAI,EAAI,EAAE,YAC3C,EAAE,WAAW,aAAa,EAAG,GAC7B,EAAQ,aAAa,EAAG,EAC1B,CACD,CA5VD,CA4VG","file":"/gh/akottr/dragtable@master/jquery.dragtable.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /gh/akottr/dragtable@master/jquery.dragtable.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","/*!\n * dragtable\n *\n * @Version 2.0.15\n *\n * Copyright (c) 2010-2013, Andres akottr@gmail.com\n * Dual licensed under the MIT (MIT-LICENSE.txt)\n * and GPL (GPL-LICENSE.txt) licenses.\n *\n * Inspired by the the dragtable from Dan Vanderkam (danvk.org/dragtable/)\n * Thanks to the jquery and jqueryui comitters\n *\n * Any comment, bug report, feature-request is welcome\n * Feel free to contact me.\n */\n\n/* TOKNOW:\n * For IE7 you need this css rule:\n * table {\n *   border-collapse: collapse;\n * }\n * Or take a clean reset.css (see http://meyerweb.com/eric/tools/css/reset/)\n */\n\n/* TODO: investigate\n * Does not work properly with css rule:\n * html {\n *      overflow: -moz-scrollbars-vertical;\n *  }\n * Workaround:\n * Fixing Firefox issues by scrolling down the page\n * http://stackoverflow.com/questions/2451528/jquery-ui-sortable-scroll-helper-element-offset-firefox-issue\n *\n * var start = $.noop;\n * var beforeStop = $.noop;\n * if($.browser.mozilla) {\n * var start = function (event, ui) {\n *               if( ui.helper !== undefined )\n *                 ui.helper.css('position','absolute').css('margin-top', $(window).scrollTop() );\n *               }\n * var beforeStop = function (event, ui) {\n *              if( ui.offset !== undefined )\n *                ui.helper.css('margin-top', 0);\n *              }\n * }\n *\n * and pass this as start and stop function to the sortable initialisation\n * start: start,\n * beforeStop: beforeStop\n */\n/*\n * Special thx to all pull requests comitters\n */\n\n(function($) {\n  $.widget(\"akottr.dragtable\", {\n    options: {\n      revert: false,               // smooth revert\n      dragHandle: '.table-handle', // handle for moving cols, if not exists the whole 'th' is the handle\n      maxMovingRows: 40,           // 1 -> only header. 40 row should be enough, the rest is usually not in the viewport\n      excludeFooter: false,        // excludes the footer row(s) while moving other columns. Make sense if there is a footer with a colspan. */\n      onlyHeaderThreshold: 100,    // TODO:  not implemented yet, switch automatically between entire col moving / only header moving\n      dragaccept: null,            // draggable cols -> default all\n      persistState: null,          // url or function -> plug in your custom persistState function right here. function call is persistState(originalTable)\n      restoreState: null,          // JSON-Object or function:  some kind of experimental aka Quick-Hack TODO: do it better\n      exact: true,                 // removes pixels, so that the overlay table width fits exactly the original table width\n      clickDelay: 10,              // ms to wait before rendering sortable list and delegating click event\n      containment: null,           // @see http://api.jqueryui.com/sortable/#option-containment, use it if you want to move in 2 dimesnions (together with axis: null)\n      cursor: 'move',              // @see http://api.jqueryui.com/sortable/#option-cursor\n      cursorAt: false,             // @see http://api.jqueryui.com/sortable/#option-cursorAt\n      distance: 0,                 // @see http://api.jqueryui.com/sortable/#option-distance, for immediate feedback use \"0\"\n      tolerance: 'pointer',        // @see http://api.jqueryui.com/sortable/#option-tolerance\n      axis: 'x',                   // @see http://api.jqueryui.com/sortable/#option-axis, Only vertical moving is allowed. Use 'x' or null. Use this in conjunction with the 'containment' setting\n      beforeStart: $.noop,         // returning FALSE will stop the execution chain.\n      beforeMoving: $.noop,\n      beforeReorganize: $.noop,\n      beforeStop: $.noop\n    },\n    originalTable: {\n      el: null,\n      selectedHandle: null,\n      sortOrder: null,\n      startIndex: 0,\n      endIndex: 0\n    },\n    sortableTable: {\n      el: $(),\n      selectedHandle: $(),\n      movingRow: $()\n    },\n    persistState: function() {\n      var _this = this;\n      this.originalTable.el.find('th').each(function(i) {\n        if (this.id !== '') {\n          _this.originalTable.sortOrder[this.id] = i;\n        }\n      });\n      $.ajax({\n        url: this.options.persistState,\n        data: this.originalTable.sortOrder\n      });\n    },\n    /*\n     * persistObj looks like\n     * {'id1':'2','id3':'3','id2':'1'}\n     * table looks like\n     * |   id2  |   id1   |   id3   |\n     */\n    _restoreState: function(persistObj) {\n      for (var n in persistObj) {\n        this.originalTable.startIndex = $('#' + n).closest('th').prevAll().length + 1;\n        this.originalTable.endIndex = parseInt(persistObj[n], 10) + 1;\n        this._bubbleCols();\n      }\n    },\n    // bubble the moved col left or right\n    _bubbleCols: function() {\n      var i, j, col1, col2;\n      var from = this.originalTable.startIndex;\n      var to = this.originalTable.endIndex;\n      /* Find children thead and tbody.\n       * Only to process the immediate tr-children. Bugfix for inner tables\n       */\n      var thtb = this.originalTable.el.children();\n      if (this.options.excludeFooter) {\n        thtb = thtb.not('tfoot');\n      }\n      if (from < to) {\n        for (i = from; i < to; i++) {\n          col1 = thtb.find('> tr > td:nth-child(' + i + ')')\n            .add(thtb.find('> tr > th:nth-child(' + i + ')'));\n          col2 = thtb.find('> tr > td:nth-child(' + (i + 1) + ')')\n            .add(thtb.find('> tr > th:nth-child(' + (i + 1) + ')'));\n          for (j = 0; j < col1.length; j++) {\n            swapNodes(col1[j], col2[j]);\n          }\n        }\n      } else {\n        for (i = from; i > to; i--) {\n          col1 = thtb.find('> tr > td:nth-child(' + i + ')')\n            .add(thtb.find('> tr > th:nth-child(' + i + ')'));\n          col2 = thtb.find('> tr > td:nth-child(' + (i - 1) + ')')\n            .add(thtb.find('> tr > th:nth-child(' + (i - 1) + ')'));\n          for (j = 0; j < col1.length; j++) {\n            swapNodes(col1[j], col2[j]);\n          }\n        }\n      }\n    },\n    _rearrangeTableBackroundProcessing: function() {\n      var _this = this;\n      return function() {\n        _this._bubbleCols();\n        _this.options.beforeStop(_this.originalTable);\n        _this.sortableTable.el.remove();\n        restoreTextSelection();\n        // persist state if necessary\n        if (_this.options.persistState !== null) {\n          $.isFunction(_this.options.persistState) ? _this.options.persistState(_this.originalTable) : _this.persistState();\n        }\n      };\n    },\n    _rearrangeTable: function() {\n      var _this = this;\n      return function() {\n        // remove handler-class -> handler is now finished\n        _this.originalTable.selectedHandle.removeClass('dragtable-handle-selected');\n        // add disabled class -> reorgorganisation starts soon\n        _this.sortableTable.el.sortable(\"disable\");\n        _this.sortableTable.el.addClass('dragtable-disabled');\n        _this.options.beforeReorganize(_this.originalTable, _this.sortableTable);\n        // do reorganisation asynchronous\n        // for chrome a little bit more than 1 ms because we want to force a rerender\n        _this.originalTable.endIndex = _this.sortableTable.movingRow.prevAll().length + 1;\n        setTimeout(_this._rearrangeTableBackroundProcessing(), 50);\n      };\n    },\n    /*\n     * Disrupts the table. The original table stays the same.\n     * But on a layer above the original table we are constructing a list (ul > li)\n     * each li with a separate table representig a single col of the original table.\n     */\n    _generateSortable: function(e) {\n      !e.cancelBubble && (e.cancelBubble = true);\n      var _this = this;\n      // table attributes\n      var attrs = this.originalTable.el[0].attributes;\n      var attrsString = '';\n      for (var i = 0; i < attrs.length; i++) {\n        if (attrs[i].nodeValue && attrs[i].nodeName != 'id' && attrs[i].nodeName != 'width') {\n          attrsString += attrs[i].nodeName + '=\"' + attrs[i].nodeValue + '\" ';\n        }\n      }\n\n      // row attributes\n      var rowAttrsArr = [];\n      //compute height, special handling for ie needed :-(\n      var heightArr = [];\n      this.originalTable.el.find('tr').slice(0, this.options.maxMovingRows).each(function(i, v) {\n        // row attributes\n        var attrs = this.attributes;\n        var attrsString = \"\";\n        for (var j = 0; j < attrs.length; j++) {\n          if (attrs[j].nodeValue && attrs[j].nodeName != 'id') {\n            attrsString += \" \" + attrs[j].nodeName + '=\"' + attrs[j].nodeValue + '\"';\n          }\n        }\n        rowAttrsArr.push(attrsString);\n        heightArr.push($(this).height());\n      });\n\n      // compute width, no special handling for ie needed :-)\n      var widthArr = [];\n      // compute total width, needed for not wrapping around after the screen ends (floating)\n      var totalWidth = 0;\n      /* Find children thead and tbody.\n       * Only to process the immediate tr-children. Bugfix for inner tables\n       */\n      var thtb = _this.originalTable.el.children();\n      if (this.options.excludeFooter) {\n        thtb = thtb.not('tfoot');\n      }\n      thtb.find('> tr > th').each(function(i, v) {\n        var w = $(this).is(':visible') ? $(this).outerWidth() : 0;\n        widthArr.push(w);\n        totalWidth += w;\n      });\n      if(_this.options.exact) {\n          var difference = totalWidth - _this.originalTable.el.outerWidth();\n          widthArr[0] -= difference;\n      }\n      // one extra px on right and left side\n      totalWidth += 2\n\n      var sortableHtml = '<ul class=\"dragtable-sortable\" style=\"position:absolute; width:' + totalWidth + 'px;\">';\n      // assemble the needed html\n      thtb.find('> tr > th').each(function(i, v) {\n        var width_li = $(this).is(':visible') ? $(this).outerWidth() : 0;\n        sortableHtml += '<li style=\"width:' + width_li + 'px;\">';\n        sortableHtml += '<table ' + attrsString + '>';\n        var row = thtb.find('> tr > th:nth-child(' + (i + 1) + ')');\n        if (_this.options.maxMovingRows > 1) {\n          row = row.add(thtb.find('> tr > td:nth-child(' + (i + 1) + ')').slice(0, _this.options.maxMovingRows - 1));\n        }\n        row.each(function(j) {\n          // TODO: May cause duplicate style-Attribute\n          var row_content = $(this).clone().wrap('<div></div>').parent().html();\n          if (row_content.toLowerCase().indexOf('<th') === 0) sortableHtml += \"<thead>\";\n          sortableHtml += '<tr ' + rowAttrsArr[j] + '\" style=\"height:' + heightArr[j] + 'px;\">';\n          sortableHtml += row_content;\n          if (row_content.toLowerCase().indexOf('<th') === 0) sortableHtml += \"</thead>\";\n          sortableHtml += '</tr>';\n        });\n        sortableHtml += '</table>';\n        sortableHtml += '</li>';\n      });\n      sortableHtml += '</ul>';\n      this.sortableTable.el = this.originalTable.el.before(sortableHtml).prev();\n      // set width if necessary\n      this.sortableTable.el.find('> li > table').each(function(i, v) {\n        $(this).css('width', widthArr[i] + 'px');\n      });\n\n      // assign this.sortableTable.selectedHandle\n      this.sortableTable.selectedHandle = this.sortableTable.el.find('th .dragtable-handle-selected');\n\n      var items = !this.options.dragaccept ? 'li' : 'li:has(' + this.options.dragaccept + ')';\n      this.sortableTable.el.sortable({\n        items: items,\n        stop: this._rearrangeTable(),\n        // pass thru options for sortable widget\n        revert: this.options.revert,\n        tolerance: this.options.tolerance,\n        containment: this.options.containment,\n        cursor: this.options.cursor,\n        cursorAt: this.options.cursorAt,\n        distance: this.options.distance,\n        axis: this.options.axis\n      });\n\n      // assign start index\n      this.originalTable.startIndex = $(e.target).closest('th').prevAll().length + 1;\n\n      this.options.beforeMoving(this.originalTable, this.sortableTable);\n      // Start moving by delegating the original event to the new sortable table\n      this.sortableTable.movingRow = this.sortableTable.el.find('> li:nth-child(' + this.originalTable.startIndex + ')');\n\n      // prevent the user from drag selecting \"highlighting\" surrounding page elements\n      disableTextSelection();\n      // clone the initial event and trigger the sort with it\n      this.sortableTable.movingRow.trigger($.extend($.Event(e.type), {\n        which: 1,\n        clientX: e.clientX,\n        clientY: e.clientY,\n        pageX: e.pageX,\n        pageY: e.pageY,\n        screenX: e.screenX,\n        screenY: e.screenY\n      }));\n\n      // Some inner divs to deliver the posibillity to style the placeholder more sophisticated\n      var placeholder = this.sortableTable.el.find('.ui-sortable-placeholder');\n      if(!placeholder.height()  <= 0) {\n        placeholder.css('height', this.sortableTable.el.find('.ui-sortable-helper').height());\n      }\n\n      placeholder.html('<div class=\"outer\" style=\"height:100%;\"><div class=\"inner\" style=\"height:100%;\"></div></div>');\n    },\n    bindTo: {},\n    _create: function() {\n      this.originalTable = {\n        el: this.element,\n        selectedHandle: $(),\n        sortOrder: {},\n        startIndex: 0,\n        endIndex: 0\n      };\n      // bind draggable to 'th' by default\n      this.bindTo = this.originalTable.el.find('th');\n      // filter only the cols that are accepted\n      if (this.options.dragaccept) {\n        this.bindTo = this.bindTo.filter(this.options.dragaccept);\n      }\n      // bind draggable to handle if exists\n      if (this.bindTo.find(this.options.dragHandle).length > 0) {\n        this.bindTo = this.bindTo.find(this.options.dragHandle);\n      }\n      // restore state if necessary\n      if (this.options.restoreState !== null) {\n        $.isFunction(this.options.restoreState) ? this.options.restoreState(this.originalTable) : this._restoreState(this.options.restoreState);\n      }\n      var _this = this;\n      this.bindTo.mousedown(function(evt) {\n        // listen only to left mouse click\n        if(evt.which!==1) return;\n        if (_this.options.beforeStart(_this.originalTable) === false) {\n          return;\n        }\n        clearTimeout(this.downTimer);\n        this.downTimer = setTimeout(function() {\n          _this.originalTable.selectedHandle = $(this);\n          _this.originalTable.selectedHandle.addClass('dragtable-handle-selected');\n          _this._generateSortable(evt);\n        }, _this.options.clickDelay);\n      }).mouseup(function(evt) {\n        clearTimeout(this.downTimer);\n      });\n    },\n    redraw: function(){\n      this.destroy();\n      this._create();\n    },\n    destroy: function() {\n      this.bindTo.unbind('mousedown');\n      $.Widget.prototype.destroy.apply(this, arguments); // default destroy\n      // now do other stuff particular to this widget\n    }\n  });\n\n  /** closure-scoped \"private\" functions **/\n\n  var body_onselectstart_save = $(document.body).attr('onselectstart'),\n    body_unselectable_save = $(document.body).attr('unselectable');\n\n  // css properties to disable user-select on the body tag by appending a <style> tag to the <head>\n  // remove any current document selections\n\n  function disableTextSelection() {\n    // jQuery doesn't support the element.text attribute in MSIE 8\n    // http://stackoverflow.com/questions/2692770/style-style-textcss-appendtohead-does-not-work-in-ie\n    var $style = $('<style id=\"__dragtable_disable_text_selection__\" type=\"text/css\">body { -ms-user-select:none;-moz-user-select:-moz-none;-khtml-user-select:none;-webkit-user-select:none;user-select:none; }</style>');\n    $(document.head).append($style);\n    $(document.body).attr('onselectstart', 'return false;').attr('unselectable', 'on');\n    if (window.getSelection) {\n      window.getSelection().removeAllRanges();\n    } else {\n      document.selection.empty(); // MSIE http://msdn.microsoft.com/en-us/library/ms535869%28v=VS.85%29.aspx\n    }\n  }\n\n  // remove the <style> tag, and restore the original <body> onselectstart attribute\n\n  function restoreTextSelection() {\n    $('#__dragtable_disable_text_selection__').remove();\n    if (body_onselectstart_save) {\n      $(document.body).attr('onselectstart', body_onselectstart_save);\n    } else {\n      $(document.body).removeAttr('onselectstart');\n    }\n    if (body_unselectable_save) {\n      $(document.body).attr('unselectable', body_unselectable_save);\n    } else {\n      $(document.body).removeAttr('unselectable');\n    }\n  }\n\n  function swapNodes(a, b) {\n    var aparent = a.parentNode;\n    var asibling = a.nextSibling === b ? a : a.nextSibling;\n    b.parentNode.insertBefore(a, b);\n    aparent.insertBefore(b, asibling);\n  }\n})(jQuery);\n"]}