Permalink
Browse files

- event.relocated renamed to event.relocateEnd

- added event.relocateBefore(div, to) - it's called before each
element is relocated
- added event.relocateAfter(div, to) - it's called after each element
is relocated
- added event.shiftOverflow - called after overflow happen in "shift"
drop mode
  • Loading branch information...
1 parent 89ef3c1 commit 36095672196eefe312234ed30d9d2be14e71f6d4 @dbunic committed Dec 21, 2012
Showing with 259 additions and 140 deletions.
  1. +4 −0 changes.txt
  2. +1 −1 example04/script.js
  3. +31 −31 example25/index.html
  4. +84 −39 example25/script.js
  5. +19 −5 example25/style.css
  6. +49 −49 redips-drag-min.js
  7. +71 −15 redips-drag-source.js
View
4 changes.txt
@@ -4,6 +4,10 @@ Changes for REDIPS.drag library
- modified enableDrag - method has option to accept node reference to enable / disable DIV elements inside that node
- fix inside relocate method (events were registered after DIV element was relocated and that should not be the case)
- added example26: jQuery dialog
+- event.relocated renamed to event.relocateEnd
+- added event.relocateBefore(div, to) - it's called before each element is relocated
+- added event.relocateAfter(div, to) - it's called after each element is relocated
+- added event.shiftOverflow - called after overflow happen in "shift" drop mode
5.0.3 (2012-12-19)
- modified emptyCell - now method has option to test target cell and to delete cell content
View
2 example04/script.js
@@ -35,7 +35,7 @@ redipsInit = function () {
objOld = rd.objOld, // previous element (this is clone element)
tac = rd.td.target; // target cell
// disable dropped DIV element
- rd.enableDrag(false, obj.id);
+ rd.enableDrag(false, obj);
// toggle X and O elements on the left
toggleXO();
// check board (objOld.id can be 'x' or 'o')
View
62 example25/index.html
@@ -15,45 +15,45 @@
<div id="main_container">
<!-- drag1 DIV container -->
<div id="drag">
- <select id="dropDown" onchange="setTable(this)">
+ <select id="dropDown" onchange="redips.setTable(this)">
<option value="addition">Addition</option>
<option value="multiplication">Multiplication</option>
</select>
<!-- numbers -->
<table id="number">
<colgroup>
- <col width="50"/>
- <col width="50"/>
- <col width="50"/>
- <col width="50"/>
- <col width="50"/>
+ <col width="70"/>
+ <col width="70"/>
+ <col width="70"/>
+ <col width="70"/>
+ <col width="70"/>
</colgroup>
<tbody>
<tr class="upper">
- <td class="mark"><div class="drag clone">1</div></td>
- <td class="mark"><div class="drag clone">2</div></td>
- <td class="mark"><div class="drag clone">3</div></td>
- <td class="mark"><div class="drag clone">4</div></td>
- <td class="mark"><div class="drag clone">5</div></td>
+ <td class="mark"><div class="drag box clone">1</div></td>
+ <td class="mark"><div class="drag box clone">2</div></td>
+ <td class="mark"><div class="drag box clone">3</div></td>
+ <td class="mark"><div class="drag box clone">4</div></td>
+ <td class="mark"><div class="drag box clone">5</div></td>
</tr>
<tr class="upper">
- <td class="mark"><div class="drag clone">6</div></td>
- <td class="mark"><div class="drag clone">7</div></td>
- <td class="mark"><div class="drag clone">8</div></td>
- <td class="mark"><div class="drag clone">9</div></td>
- <td class="mark"><div class="drag clone">10</div></td>
+ <td class="mark"><div class="drag box clone">6</div></td>
+ <td class="mark"><div class="drag box clone">7</div></td>
+ <td class="mark"><div class="drag box clone">8</div></td>
+ <td class="mark"><div class="drag box clone">9</div></td>
+ <td class="mark"><div class="drag box clone">10</div></td>
</tr>
</tbody>
</table>
<!-- addition table -->
<table id="addition">
<colgroup>
- <col width="50"/>
- <col width="50"/>
- <col width="50"/>
- <col width="50"/>
- <col width="50"/>
+ <col width="70"/>
+ <col width="70"/>
+ <col width="70"/>
+ <col width="70"/>
+ <col width="70"/>
</colgroup>
<tbody>
<tr>
@@ -132,11 +132,11 @@
<!-- multiplication table -->
<table id="multiplication" style="display:none">
<colgroup>
- <col width="50"/>
- <col width="50"/>
- <col width="50"/>
- <col width="50"/>
- <col width="50"/>
+ <col width="70"/>
+ <col width="70"/>
+ <col width="70"/>
+ <col width="70"/>
+ <col width="70"/>
</colgroup>
<tbody>
<tr>
@@ -215,7 +215,7 @@
<!-- trash -->
<table id="mini">
<colgroup>
- <col width="100"/>
+ <col width="70"/>
</colgroup>
<tbody>
<tr>
@@ -226,10 +226,10 @@
</div>
<!-- instructions -->
<div class="instructions">
- Try to drag numbers from top table to the first column.
- After dropping DIV element to the table cell, result will be automatically displayed.
- REDIPS.drag works in "overwrite" method so dropping number on top of existing content will overwrite bottom element.
- Numbers placed in first column can be cloned with shift key. Just press shift key and try to drag DIV element.
+ Try to drag numbers from top table to the first column in table below.
+ After dropping DIV element to the table cell, orange box with "?" will be automatically displayed to the most right column.
+ User should click on "?" and result will be shown.
+ REDIPS.drag works in "shift" mode so dropping number on top of existing content will shift other elements.
</div>
</div>
</body>
View
123 example25/script.js
@@ -4,71 +4,91 @@
/* enable strict mode */
"use strict";
-// define redipsInit variable
-var redipsInit,
- setTable,
- operation = 'addition';
+
+// create redips container
+var redips = {};
// redips initialization
-redipsInit = function () {
+redips.init = function () {
// reference to the REDIPS.drag class
var rd = REDIPS.drag;
+ // set initial math operation
+ redips.operation = 'addition';
// REDIPS.drag initialization
rd.init();
- // set overwrite mode
- rd.dropMode = 'overwrite';
- // enable cloning with shift key
- rd.clone.keyDiv = true;
- // event handler called after DIV is dropped
- rd.event.dropped = function (targetCell) {
+ // set shift mode and shift animation
+ rd.dropMode = 'shift';
+ rd.animation.shift = true;
+ // set vertical shift (each column is treated separately) and overflowed element will be deleted
+ rd.shift.mode = 'vertical2';
+ rd.shift.overflow = 'delete';
+ // event handler called after DIV is dropped (create result box in the most right column)
+ rd.event.dropped = function () {
var tr, // current row
- num1, num2; // numbers for addition or multiplication
- // set first multiplier
- num1 = rd.obj.innerHTML * 1;
+ num1, num2, // numbers for addition or multiplication
+ result; // result
// set current row
- tr = rd.findParent('TR', targetCell);
- // set second number
+ tr = REDIPS.drag.findParent('TR', rd.obj);
+ // set first and second number
+ num1 = rd.obj.innerHTML * 1;
num2 = tr.cells[2].innerHTML * 1;
- // add or multiply num1 and num2 and place result to the last cell in the row
- if (operation === 'addition') {
- tr.cells[4].innerHTML = num1 + num2;
- }
- else {
- tr.cells[4].innerHTML = num1 * num2;
+ // display result box
+ tr.cells[4].innerHTML = '<div class="result box r' + redips.math(num1, num2) + '" onclick="window.redips.showResult(this)">?</div>';
+ };
+ // even handler called when DIV element is moved (delete result box if DIV is moved in the bottom table)
+ rd.event.moved = function () {
+ // set source row
+ var tr = rd.findParent('TR', rd.td.source);
+ // if number is moved from bottom table then delete result box
+ if (tr.className.indexOf('upper') === -1) {
+ tr.cells[4].innerHTML = '';
}
};
- // even handler called when DIV element is moved
- rd.event.moved = function (cloned) {
- var tr;
- // if DIV element is not cloned
- if (!cloned) {
- // set source row
- tr = rd.findParent('TR', rd.td.source);
- // if number is moved from bottom table then delete result
- if (tr.className.indexOf('upper') === -1) {
- tr.cells[4].innerHTML = '';
+ // called before each DIV element is shifted (needed move orange box pn the right side)
+ rd.event.relocateBefore = function (div, to) {
+ var tr = rd.findParent('TR', div), // set current TR from DIV element that will be shifted by REDIPS.drag
+ resultDiv = tr.cells[4].getElementsByTagName('div')[0], // define result DIV (right orange DIV element)
+ target = to.parentNode.cells[4], // define target TD
+ num1 = div.innerHTML * 1; // set first number (from DIV element that will be shifted by REDIPS.drag)
+ // move right (orange) box
+ rd.moveObject({
+ obj: resultDiv,
+ target: target,
+ // call after result DIV is moved (el is reference to the moved DIV element)
+ callback: function (el) {
+ var targetTR = rd.findParent('TR', el), // set target TR
+ num2 = targetTR.cells[2].innerHTML * 1; // set number2 from target TR
+ // save (hide) new result to the class r(n+) and display "?"
+ el.className = el.className.replace(/r\d+/g, 'r' + redips.math(num1, num2));
+ el.innerHTML = '?';
}
- }
+ });
+ };
+ // delete last orange box when overflow happen (target is TD where overflow occurred)
+ rd.event.shiftOverflow = function (target) {
+ var rightCell = target.parentNode.cells[4];
+ // empty right cell
+ rd.emptyCell(rightCell);
};
};
-// set operation
-setTable = function (e) {
+// set operation - addition / multiplication
+redips.setTable = function (e) {
// set local variables
var tables = document.getElementById('drag').getElementsByTagName('table'),
i;
// set operation (global) - needed in event.dropped
- operation = e.options[e.selectedIndex].value;
+ redips.operation = e.options[e.selectedIndex].value;
// loop goes through all fetched tables within drag container
for (i = 0; i < tables.length; i++) {
// skip number or mini table
if (tables[i].id === 'number' || tables[i].id === 'mini') {
continue;
}
// show selected table
- else if (tables[i].id === operation) {
+ else if (tables[i].id === redips.operation) {
tables[i].style.display = '';
}
// hide all other tables
@@ -79,10 +99,35 @@ setTable = function (e) {
};
+// do math with num1 and num2
+redips.math = function (num1, num2) {
+ var result;
+ // add or multiply num1 and num2
+ if (redips.operation === 'addition') {
+ result = num1 + num2;
+ }
+ else {
+ result = num1 * num2;
+ }
+ // return result
+ return result;
+};
+
+
+// display result below "?" (called after user clicks on result DIV)
+redips.showResult = function (div) {
+ // result is saved as a class name r(n+)
+ var className = div.className,
+ matchArray = className.match(/r(\d+)/);
+ // show result
+ div.innerHTML = matchArray[1];
+};
+
+
// add onload event listener
if (window.addEventListener) {
- window.addEventListener('load', redipsInit, false);
+ window.addEventListener('load', redips.init, false);
}
else if (window.attachEvent) {
- window.attachEvent('onload', redipsInit);
+ window.attachEvent('onload', redips.init);
}
View
24 example25/style.css
@@ -14,7 +14,7 @@ body {
/* main container */
#main_container{
margin: auto;
- width: 570px;
+ width: 670px;
}
/* make drag container visible */
@@ -39,23 +39,37 @@ div#drag td {
padding: 2px;
}
-/* DIV elements */
-.drag {
+/* BOX class (common styles used for drag and result DIV */
+.box {
margin: auto;
margin-bottom: 1px;
margin-top: 1px;
font-size: 20pt;
text-align: center;
- width: 40px;
+ width: 56px;
height: 40px;
line-height: 40px;
- border: 2px solid SteelBlue;
background-color: white;
/* round corners */
border-radius: 4px; /* Opera, Chrome */
-moz-border-radius: 4px; /* FF */
}
+/* DIV elements */
+.drag {
+ background-color: #CDE1F2;
+ border: 2px solid SteelBlue;
+}
+
+/* result DIV */
+.result {
+ background-color: #FFE6C4;
+ border: 2px solid #A66C1D;
+ /* cursor */
+ cursor: pointer;
+ cursor: hand;
+}
+
/* forbidden cells */
.mark {
background-color: #eee;
View
98 redips-drag-min.js
@@ -3,68 +3,68 @@ Copyright (c) 2008-2011, www.redips.net All rights reserved.
Code licensed under the BSD License: http://www.redips.net/license/
http://www.redips.net/javascript/drag-and-drop-table-content/
Version 5.0.4
-Dec 20, 2012.
+Dec 21, 2012.
*/
var REDIPS=REDIPS||{};
-REDIPS.drag=function(){var q,B,K,za,La,Ma,ca,da,ia,Aa,Ba,V,ja,Ca,R,ka,Z,Da,C,u,O,la,ma,na,Ea,oa,Fa,E,x,Ga,ea,fa,pa,Na,Oa,Ha,qa,Ia,ra,ga,Ja,Pa,sa,Qa,n=null,G=0,H=0,ta=null,ua=null,L=[],s=null,M=0,N=0,P=0,Q=0,S=0,T=0,$,f=[],aa,va,p,I=[],m=[],y=null,D=null,W=0,X=0,Ra=0,Sa=0,ha=!1,Ka=!1,ba=!1,wa=[],h=null,t=null,z=null,j=null,v=null,J=null,k=null,A=null,U=null,i=!1,o=!1,r="cell",xa={div:[],cname:"only",other:"deny"},Ta={action:"deny",cname:"mark",exception:[]},l={},Ua={keyDiv:!1,keyRow:!1,sendBack:!1,
-drop:!1};K=function(){return!1};q=function(a){var b,c,d,e,g;f.length=0;e=void 0===a?y.getElementsByTagName("table"):document.querySelectorAll(a);for(b=a=0;a<e.length;a++)if(!("redips_clone"===e[a].parentNode.id||-1<e[a].className.indexOf("nolayout"))){c=e[a].parentNode;d=0;do"TD"===c.nodeName&&d++,c=c.parentNode;while(c&&c!==y);f[b]=e[a];f[b].redips||(f[b].redips={});f[b].redips.container=y;f[b].redips.nestedLevel=d;f[b].redips.idx=b;wa[b]=0;d=f[b].getElementsByTagName("td");c=0;for(g=!1;c<d.length;c++)if(1<
-d[c].rowSpan){g=!0;break}f[b].redips.rowspan=g;b++}a=0;for(e=aa=1;a<f.length;a++)if(0===f[a].redips.nestedLevel){f[a].redips.nestedGroup=e;f[a].redips.sort=100*aa;c=f[a].getElementsByTagName("table");for(b=0;b<c.length;b++)-1<c[b].className.indexOf("nolayout")||(c[b].redips.nestedGroup=e,c[b].redips.sort=100*aa+c[b].redips.nestedLevel);e++;aa++}};za=function(a){var b=a||window.event,c,d;if(!0===this.redips.animated)return!0;b.cancelBubble=!0;b.stopPropagation&&b.stopPropagation();Ka=b.shiftKey;a=
-b.which?b.which:b.button;if(Fa(b)||!b.touches&&1!==a)return!0;if(window.getSelection)window.getSelection().removeAllRanges();else if(document.selection&&"Text"===document.selection.type)try{document.selection.empty()}catch(e){}b.touches?(a=W=b.touches[0].clientX,d=X=b.touches[0].clientY):(a=W=b.clientX,d=X=b.clientY);Ra=a;Sa=d;ha=!1;REDIPS.drag.objOld=o=i||this;REDIPS.drag.obj=i=this;ba=-1<i.className.indexOf("clone")?!0:!1;REDIPS.drag.tableSort&&Ma(i);y!==i.redips.container&&(y=i.redips.container,
-q());-1===i.className.indexOf("row")?REDIPS.drag.mode=r="cell":(REDIPS.drag.mode=r="row",REDIPS.drag.obj=i=ga(i));u();!ba&&"cell"===r&&(i.style.zIndex=999);h=j=k=null;R();z=t=h;J=v=j;U=A=k;REDIPS.drag.td.source=l.source=x("TD",i);REDIPS.drag.td.current=l.current=l.source;REDIPS.drag.td.previous=l.previous=l.source;"cell"===r?REDIPS.drag.event.clicked(l.current):REDIPS.drag.event.rowClicked(l.current);if(null===h||null===j||null===k)if(R(),z=t=h,J=v=j,U=A=k,null===h||null===j||null===k)return!0;va=
-p=!1;REDIPS.event.add(document,"mousemove",da);REDIPS.event.add(document,"touchmove",da);REDIPS.event.add(document,"mouseup",ca);REDIPS.event.add(document,"touchend",ca);i.setCapture&&i.setCapture();null!==h&&(null!==j&&null!==k)&&($=Da(h,j,k));c=E(f[z],"position");"fixed"!==c&&(c=E(f[z].parentNode,"position"));c=C(i,c);n=[d-c[0],c[1]-a,c[2]-d,a-c[3]];y.onselectstart=function(a){b=a||window.event;if(!Fa(b)){b.shiftKey&&document.selection.clear();return false}};return!1};La=function(){REDIPS.drag.event.dblClicked()};
-Ma=function(a){var b;b=x("TABLE",a).redips.nestedGroup;for(a=0;a<f.length;a++)f[a].redips.nestedGroup===b&&(f[a].redips.sort=100*aa+f[a].redips.nestedLevel);f.sort(function(a,b){return b.redips.sort-a.redips.sort});aa++};ga=function(a,b){var c,d,e,g,f,w;if("DIV"===a.nodeName)return g=a,a=x("TR",a),void 0===a.redips&&(a.redips={}),a.redips.div=g,a;d=a;void 0===d.redips&&(d.redips={});a=x("TABLE",a);ba&&p&&(g=d.redips.div,g.className=sa(g.className.replace("clone","")));c=a.cloneNode(!0);ba&&p&&(g.className+=
-" clone");e=c.rows.length-1;g="animated"===b?0===e?!0:!1:!0;for(f=e;0<=f;f--)if(f!==d.rowIndex){if(!0===g&&void 0===b){e=c.rows[f];for(w=0;w<e.cells.length;w++)if(-1<e.cells[w].className.indexOf("rowhandler")){g=!1;break}}c.deleteRow(f)}p||(d.redips.emptyRow=g);c.redips={};c.redips.container=a.redips.container;c.redips.sourceRow=d;Pa(d,c.rows[0]);Ea(d,c.rows[0]);document.getElementById("redips_clone").appendChild(c);d=C(d,"fixed");c.style.position="fixed";c.style.top=d[0]+"px";c.style.left=d[3]+"px";
-c.style.width=d[1]-d[3]+"px";return c};Ja=function(a,b,c){var d=!1,e,g,ya,w,j,F,Y,k;k=function(a){var b;void 0===a.redips||!a.redips.emptyRow?(b=x("TABLE",a),b.deleteRow(a.rowIndex)):ra(a,"empty",REDIPS.drag.style.rowEmptyColor)};void 0===c?c=i:d=!0;e=c.redips.sourceRow;g=e.rowIndex;ya=x("TABLE",e);w=ya.rows[0].parentNode;j=f[a];F=j.rows[b];Y=j.rows[0].parentNode;a=c.getElementsByTagName("tr")[0];c.parentNode.removeChild(c);!1!==REDIPS.drag.event.rowDroppedBefore(ya,g)&&(!d&&-1<l.target.className.indexOf(REDIPS.drag.trash.className)?
+REDIPS.drag=function(){var q,B,K,Aa,La,Ma,ca,da,ia,Ba,Ca,V,ja,Da,R,ka,Z,Ea,C,u,O,la,ma,na,Fa,oa,Ga,E,x,Ha,ea,fa,pa,Na,Oa,Ia,qa,ra,sa,ga,Ja,Pa,ta,Qa,n=null,G=0,H=0,ua=null,va=null,L=[],s=null,M=0,N=0,P=0,Q=0,S=0,T=0,$,f=[],aa,wa,p,I=[],m=[],y=null,D=null,W=0,X=0,Ra=0,Sa=0,ha=!1,Ka=!1,ba=!1,xa=[],h=null,t=null,z=null,j=null,v=null,J=null,k=null,A=null,U=null,i=!1,o=!1,r="cell",ya={div:[],cname:"only",other:"deny"},Ta={action:"deny",cname:"mark",exception:[]},l={},Ua={keyDiv:!1,keyRow:!1,sendBack:!1,
+drop:!1};K=function(){return!1};q=function(a){var b,c,d,e,g;f.length=0;e=void 0===a?y.getElementsByTagName("table"):document.querySelectorAll(a);for(b=a=0;a<e.length;a++)if(!("redips_clone"===e[a].parentNode.id||-1<e[a].className.indexOf("nolayout"))){c=e[a].parentNode;d=0;do"TD"===c.nodeName&&d++,c=c.parentNode;while(c&&c!==y);f[b]=e[a];f[b].redips||(f[b].redips={});f[b].redips.container=y;f[b].redips.nestedLevel=d;f[b].redips.idx=b;xa[b]=0;d=f[b].getElementsByTagName("td");c=0;for(g=!1;c<d.length;c++)if(1<
+d[c].rowSpan){g=!0;break}f[b].redips.rowspan=g;b++}a=0;for(e=aa=1;a<f.length;a++)if(0===f[a].redips.nestedLevel){f[a].redips.nestedGroup=e;f[a].redips.sort=100*aa;c=f[a].getElementsByTagName("table");for(b=0;b<c.length;b++)-1<c[b].className.indexOf("nolayout")||(c[b].redips.nestedGroup=e,c[b].redips.sort=100*aa+c[b].redips.nestedLevel);e++;aa++}};Aa=function(a){var b=a||window.event,c,d;if(!0===this.redips.animated)return!0;b.cancelBubble=!0;b.stopPropagation&&b.stopPropagation();Ka=b.shiftKey;a=
+b.which?b.which:b.button;if(Ga(b)||!b.touches&&1!==a)return!0;if(window.getSelection)window.getSelection().removeAllRanges();else if(document.selection&&"Text"===document.selection.type)try{document.selection.empty()}catch(e){}b.touches?(a=W=b.touches[0].clientX,d=X=b.touches[0].clientY):(a=W=b.clientX,d=X=b.clientY);Ra=a;Sa=d;ha=!1;REDIPS.drag.objOld=o=i||this;REDIPS.drag.obj=i=this;ba=-1<i.className.indexOf("clone")?!0:!1;REDIPS.drag.tableSort&&Ma(i);y!==i.redips.container&&(y=i.redips.container,
+q());-1===i.className.indexOf("row")?REDIPS.drag.mode=r="cell":(REDIPS.drag.mode=r="row",REDIPS.drag.obj=i=ga(i));u();!ba&&"cell"===r&&(i.style.zIndex=999);h=j=k=null;R();z=t=h;J=v=j;U=A=k;REDIPS.drag.td.source=l.source=x("TD",i);REDIPS.drag.td.current=l.current=l.source;REDIPS.drag.td.previous=l.previous=l.source;"cell"===r?REDIPS.drag.event.clicked(l.current):REDIPS.drag.event.rowClicked(l.current);if(null===h||null===j||null===k)if(R(),z=t=h,J=v=j,U=A=k,null===h||null===j||null===k)return!0;wa=
+p=!1;REDIPS.event.add(document,"mousemove",da);REDIPS.event.add(document,"touchmove",da);REDIPS.event.add(document,"mouseup",ca);REDIPS.event.add(document,"touchend",ca);i.setCapture&&i.setCapture();null!==h&&(null!==j&&null!==k)&&($=Ea(h,j,k));c=E(f[z],"position");"fixed"!==c&&(c=E(f[z].parentNode,"position"));c=C(i,c);n=[d-c[0],c[1]-a,c[2]-d,a-c[3]];y.onselectstart=function(a){b=a||window.event;if(!Ga(b)){b.shiftKey&&document.selection.clear();return false}};return!1};La=function(){REDIPS.drag.event.dblClicked()};
+Ma=function(a){var b;b=x("TABLE",a).redips.nestedGroup;for(a=0;a<f.length;a++)f[a].redips.nestedGroup===b&&(f[a].redips.sort=100*aa+f[a].redips.nestedLevel);f.sort(function(a,b){return b.redips.sort-a.redips.sort});aa++};ga=function(a,b){var c,d,e,g,f,w;if("DIV"===a.nodeName)return g=a,a=x("TR",a),void 0===a.redips&&(a.redips={}),a.redips.div=g,a;d=a;void 0===d.redips&&(d.redips={});a=x("TABLE",a);ba&&p&&(g=d.redips.div,g.className=ta(g.className.replace("clone","")));c=a.cloneNode(!0);ba&&p&&(g.className+=
+" clone");e=c.rows.length-1;g="animated"===b?0===e?!0:!1:!0;for(f=e;0<=f;f--)if(f!==d.rowIndex){if(!0===g&&void 0===b){e=c.rows[f];for(w=0;w<e.cells.length;w++)if(-1<e.cells[w].className.indexOf("rowhandler")){g=!1;break}}c.deleteRow(f)}p||(d.redips.emptyRow=g);c.redips={};c.redips.container=a.redips.container;c.redips.sourceRow=d;Pa(d,c.rows[0]);Fa(d,c.rows[0]);document.getElementById("redips_clone").appendChild(c);d=C(d,"fixed");c.style.position="fixed";c.style.top=d[0]+"px";c.style.left=d[3]+"px";
+c.style.width=d[1]-d[3]+"px";return c};Ja=function(a,b,c){var d=!1,e,g,za,w,j,F,Y,k;k=function(a){var b;void 0===a.redips||!a.redips.emptyRow?(b=x("TABLE",a),b.deleteRow(a.rowIndex)):sa(a,"empty",REDIPS.drag.style.rowEmptyColor)};void 0===c?c=i:d=!0;e=c.redips.sourceRow;g=e.rowIndex;za=x("TABLE",e);w=za.rows[0].parentNode;j=f[a];F=j.rows[b];Y=j.rows[0].parentNode;a=c.getElementsByTagName("tr")[0];c.parentNode.removeChild(c);!1!==REDIPS.drag.event.rowDroppedBefore(za,g)&&(!d&&-1<l.target.className.indexOf(REDIPS.drag.trash.className)?
p?REDIPS.drag.event.rowDeleted():REDIPS.drag.trash.questionRow?confirm(REDIPS.drag.trash.questionRow)?(k(e),REDIPS.drag.event.rowDeleted()):(delete o.redips.emptyRow,REDIPS.drag.event.rowUndeleted()):(k(e),REDIPS.drag.event.rowDeleted()):(b<j.rows.length?h===z?g>b?Y.insertBefore(a,F):Y.insertBefore(a,F.nextSibling):"after"===REDIPS.drag.rowDropMode?Y.insertBefore(a,F.nextSibling):Y.insertBefore(a,F):(Y.appendChild(a),F=j.rows[0]),F&&F.redips&&F.redips.emptyRow?Y.deleteRow(F.rowIndex):"overwrite"===
-REDIPS.drag.rowDropMode?k(F):"switch"===REDIPS.drag.rowDropMode&&!p&&(w.insertBefore(F,e),void 0!==e.redips&&delete e.redips.emptyRow),(d||!p)&&k(e),delete a.redips.emptyRow,d||REDIPS.drag.event.rowDropped(a,ya,g)),0<a.getElementsByTagName("table").length&&q())};Pa=function(a,b){var c,d,e,g=[],f=[];g[0]=a.getElementsByTagName("input");g[1]=a.getElementsByTagName("textarea");g[2]=a.getElementsByTagName("select");f[0]=b.getElementsByTagName("input");f[1]=b.getElementsByTagName("textarea");f[2]=b.getElementsByTagName("select");
+REDIPS.drag.rowDropMode?k(F):"switch"===REDIPS.drag.rowDropMode&&!p&&(w.insertBefore(F,e),void 0!==e.redips&&delete e.redips.emptyRow),(d||!p)&&k(e),delete a.redips.emptyRow,d||REDIPS.drag.event.rowDropped(a,za,g)),0<a.getElementsByTagName("table").length&&q())};Pa=function(a,b){var c,d,e,g=[],f=[];g[0]=a.getElementsByTagName("input");g[1]=a.getElementsByTagName("textarea");g[2]=a.getElementsByTagName("select");f[0]=b.getElementsByTagName("input");f[1]=b.getElementsByTagName("textarea");f[2]=b.getElementsByTagName("select");
for(c=0;c<g.length;c++)for(d=0;d<g[c].length;d++)switch(e=g[c][d].type,e){case "text":case "textarea":case "password":f[c][d].value=g[c][d].value;break;case "radio":case "checkbox":f[c][d].checked=g[c][d].checked;break;case "select-one":f[c][d].selectedIndex=g[c][d].selectedIndex;break;case "select-multiple":for(e=0;e<g[c][d].options.length;e++)f[c][d].options[e].selected=g[c][d].options[e].selected}};ca=function(a){var b=a||window.event,c,d,e,a=b.clientX;e=b.clientY;S=T=0;i.releaseCapture&&i.releaseCapture();
-REDIPS.event.remove(document,"mousemove",da);REDIPS.event.remove(document,"touchmove",da);REDIPS.event.remove(document,"mouseup",ca);REDIPS.event.remove(document,"touchend",ca);y.onselectstart=null;Ba(i);ta=document.documentElement.scrollWidth;ua=document.documentElement.scrollHeight;S=T=0;if(p&&"cell"===r&&(null===h||null===j||null===k))i.parentNode.removeChild(i),I[o.id]-=1,REDIPS.drag.event.notCloned();else if(null===h||null===j||null===k)REDIPS.drag.event.notMoved();else{h<f.length?(b=f[h],REDIPS.drag.td.target=
-l.target=b.rows[j].cells[k],Z(h,j,k,$),c=h,d=j):null===t||null===v||null===A?(b=f[z],REDIPS.drag.td.target=l.target=b.rows[J].cells[U],Z(z,J,U,$),c=z,d=J):(b=f[t],REDIPS.drag.td.target=l.target=b.rows[v].cells[A],Z(t,v,A,$),c=t,d=v);if("row"===r)if(va)if(z===c&&J===d){b=i.getElementsByTagName("tr")[0];o.style.backgroundColor=b.style.backgroundColor;for(a=0;a<b.cells.length;a++)o.cells[a].style.backgroundColor=b.cells[a].style.backgroundColor;i.parentNode.removeChild(i);delete o.redips.emptyRow;p?
+REDIPS.event.remove(document,"mousemove",da);REDIPS.event.remove(document,"touchmove",da);REDIPS.event.remove(document,"mouseup",ca);REDIPS.event.remove(document,"touchend",ca);y.onselectstart=null;Ca(i);ua=document.documentElement.scrollWidth;va=document.documentElement.scrollHeight;S=T=0;if(p&&"cell"===r&&(null===h||null===j||null===k))i.parentNode.removeChild(i),I[o.id]-=1,REDIPS.drag.event.notCloned();else if(null===h||null===j||null===k)REDIPS.drag.event.notMoved();else{h<f.length?(b=f[h],REDIPS.drag.td.target=
+l.target=b.rows[j].cells[k],Z(h,j,k,$),c=h,d=j):null===t||null===v||null===A?(b=f[z],REDIPS.drag.td.target=l.target=b.rows[J].cells[U],Z(z,J,U,$),c=z,d=J):(b=f[t],REDIPS.drag.td.target=l.target=b.rows[v].cells[A],Z(t,v,A,$),c=t,d=v);if("row"===r)if(wa)if(z===c&&J===d){b=i.getElementsByTagName("tr")[0];o.style.backgroundColor=b.style.backgroundColor;for(a=0;a<b.cells.length;a++)o.cells[a].style.backgroundColor=b.cells[a].style.backgroundColor;i.parentNode.removeChild(i);delete o.redips.emptyRow;p?
REDIPS.drag.event.rowNotCloned():REDIPS.drag.event.rowDroppedSource(l.target)}else Ja(c,d);else REDIPS.drag.event.rowNotMoved();else if(!p&&!ha)REDIPS.drag.event.notMoved();else if(p&&z===h&&J===j&&U===k)i.parentNode.removeChild(i),I[o.id]-=1,REDIPS.drag.event.notCloned();else if(p&&!1===REDIPS.drag.clone.drop&&(a<b.redips.offset[3]||a>b.redips.offset[1]||e<b.redips.offset[0]||e>b.redips.offset[2]))i.parentNode.removeChild(i),I[o.id]-=1,REDIPS.drag.event.notCloned();else if(-1<l.target.className.indexOf(REDIPS.drag.trash.className))i.parentNode.removeChild(i),
-REDIPS.drag.trash.question?setTimeout(function(){if(confirm(REDIPS.drag.trash.question))Aa();else{if(!p){f[z].rows[J].cells[U].appendChild(i);u()}REDIPS.drag.event.undeleted()}},20):Aa();else if("switch"===REDIPS.drag.dropMode)if(a=REDIPS.drag.event.droppedBefore(l.target),!1===a)ia(!1);else{i.parentNode.removeChild(i);b=l.target.getElementsByTagName("div");c=b.length;for(a=0;a<c;a++)void 0!==b[0]&&(REDIPS.drag.objOld=o=b[0],l.source.appendChild(o),V(o));ia();c&&REDIPS.drag.event.switched()}else"overwrite"===
+REDIPS.drag.trash.question?setTimeout(function(){if(confirm(REDIPS.drag.trash.question))Ba();else{if(!p){f[z].rows[J].cells[U].appendChild(i);u()}REDIPS.drag.event.undeleted()}},20):Ba();else if("switch"===REDIPS.drag.dropMode)if(a=REDIPS.drag.event.droppedBefore(l.target),!1===a)ia(!1);else{i.parentNode.removeChild(i);b=l.target.getElementsByTagName("div");c=b.length;for(a=0;a<c;a++)void 0!==b[0]&&(REDIPS.drag.objOld=o=b[0],l.source.appendChild(o),V(o));ia();c&&REDIPS.drag.event.switched()}else"overwrite"===
REDIPS.drag.dropMode?(a=REDIPS.drag.event.droppedBefore(l.target),!1!==a&&fa(l.target)):a=REDIPS.drag.event.droppedBefore(l.target),ia(a);"cell"===r&&0<i.getElementsByTagName("table").length&&q();u();REDIPS.drag.event.finish()}t=v=A=null};ia=function(a){var b=null,c;if(!1!==a){if(!0===Ua.sendBack){a=l.target.getElementsByTagName("DIV");for(c=0;c<a.length;c++)if(i!==a[c]&&0===i.id.indexOf(a[c].id)){b=a[c];break}if(b){oa(b,1);i.parentNode.removeChild(i);return}}"shift"===REDIPS.drag.dropMode&&(Qa(l.target)||
-"always"===REDIPS.drag.shift.after)&&pa(l.source,l.target);"top"===REDIPS.drag.multipleDrop&&l.target.hasChildNodes()?l.target.insertBefore(i,l.target.firstChild):l.target.appendChild(i);V(i);REDIPS.drag.event.dropped(l.target);p&&(REDIPS.drag.event.clonedDropped(l.target),oa(o,-1))}else p&&i.parentNode&&i.parentNode.removeChild(i)};V=function(a,b){!1===b?(a.onmousedown=null,a.ontouchstart=null,a.ondblclick=null):(a.onmousedown=za,a.ontouchstart=za,a.ondblclick=La)};Ba=function(a){a.style.top="";
-a.style.left="";a.style.position="";a.style.zIndex=""};Aa=function(){var a;p&&oa(o,-1);if("shift"===REDIPS.drag.dropMode&&("delete"===REDIPS.drag.shift.after||"always"===REDIPS.drag.shift.after)){switch(REDIPS.drag.shift.mode){case "vertical2":a="lastInColumn";break;case "horizontal2":a="lastInRow";break;default:a="last"}pa(l.source,Ga(a,l.source)[2])}REDIPS.drag.event.deleted(p)};da=function(a){var a=a||window.event,b=REDIPS.drag.scroll.bound,c,d,e,g;a.touches?(d=W=a.touches[0].clientX,e=X=a.touches[0].clientY):
-(d=W=a.clientX,e=X=a.clientY);c=Math.abs(Ra-d);g=Math.abs(Sa-e);if(!va){if("cell"===r&&(ba||!0===REDIPS.drag.clone.keyDiv&&Ka))REDIPS.drag.objOld=o=i,REDIPS.drag.obj=i=na(i,!0),p=!0,REDIPS.drag.event.cloned();else{if("row"===r){if(ba||!0===REDIPS.drag.clone.keyRow&&Ka)p=!0;REDIPS.drag.objOld=o=i;REDIPS.drag.obj=i=ga(i);i.style.zIndex=999}i.setCapture&&i.setCapture();i.style.position="fixed";u();R();"row"===r&&(p?REDIPS.drag.event.rowCloned():REDIPS.drag.event.rowMoved())}ka();d>G-n[1]&&(i.style.left=
-G-(n[1]+n[3])+"px");e>H-n[2]&&(i.style.top=H-(n[0]+n[2])+"px")}va=!0;if("cell"===r&&(7<c||7<g)&&!ha)ha=!0,ka(),REDIPS.drag.event.moved(p);d>n[3]&&d<G-n[1]&&(i.style.left=d-n[3]+"px");e>n[0]&&e<H-n[2]&&(i.style.top=e-n[0]+"px");if(d<D[1]&&d>D[3]&&e<D[2]&&e>D[0]&&0===S&&0===T&&(m.containTable||d<m[3]||d>m[1]||e<m[0]||e>m[2]))R(),ja();if(REDIPS.drag.scroll.enable){M=b-(G/2>d?d-n[3]:G-d-n[1]);if(0<M){if(M>b&&(M=b),c=O()[0],M*=d<G/2?-1:1,!(0>M&&0>=c||0<M&&c>=ta-G)&&0===S++)REDIPS.event.remove(window,"scroll",
-u),la(window)}else M=0;N=b-(H/2>e?e-n[0]:H-e-n[2]);if(0<N){if(N>b&&(N=b),c=O()[1],N*=e<H/2?-1:1,!(0>N&&0>=c||0<N&&c>=ua-H)&&0===T++)REDIPS.event.remove(window,"scroll",u),ma(window)}else N=0;for(g=0;g<L.length;g++)if(c=L[g],c.autoscroll&&d<c.offset[1]&&d>c.offset[3]&&e<c.offset[2]&&e>c.offset[0]){P=b-(c.midstX>d?d-n[3]-c.offset[3]:c.offset[1]-d-n[1]);0<P?(P>b&&(P=b),P*=d<c.midstX?-1:1,0===S++&&(REDIPS.event.remove(c.div,"scroll",u),la(c.div))):P=0;Q=b-(c.midstY>e?e-n[0]-c.offset[0]:c.offset[2]-e-
+"always"===REDIPS.drag.shift.after)&&pa(l.source,l.target);"top"===REDIPS.drag.multipleDrop&&l.target.hasChildNodes()?l.target.insertBefore(i,l.target.firstChild):l.target.appendChild(i);V(i);REDIPS.drag.event.dropped(l.target);p&&(REDIPS.drag.event.clonedDropped(l.target),oa(o,-1))}else p&&i.parentNode&&i.parentNode.removeChild(i)};V=function(a,b){!1===b?(a.onmousedown=null,a.ontouchstart=null,a.ondblclick=null):(a.onmousedown=Aa,a.ontouchstart=Aa,a.ondblclick=La)};Ca=function(a){a.style.top="";
+a.style.left="";a.style.position="";a.style.zIndex=""};Ba=function(){var a;p&&oa(o,-1);if("shift"===REDIPS.drag.dropMode&&("delete"===REDIPS.drag.shift.after||"always"===REDIPS.drag.shift.after)){switch(REDIPS.drag.shift.mode){case "vertical2":a="lastInColumn";break;case "horizontal2":a="lastInRow";break;default:a="last"}pa(l.source,Ha(a,l.source)[2])}REDIPS.drag.event.deleted(p)};da=function(a){var a=a||window.event,b=REDIPS.drag.scroll.bound,c,d,e,g;a.touches?(d=W=a.touches[0].clientX,e=X=a.touches[0].clientY):
+(d=W=a.clientX,e=X=a.clientY);c=Math.abs(Ra-d);g=Math.abs(Sa-e);if(!wa){if("cell"===r&&(ba||!0===REDIPS.drag.clone.keyDiv&&Ka))REDIPS.drag.objOld=o=i,REDIPS.drag.obj=i=na(i,!0),p=!0,REDIPS.drag.event.cloned();else{if("row"===r){if(ba||!0===REDIPS.drag.clone.keyRow&&Ka)p=!0;REDIPS.drag.objOld=o=i;REDIPS.drag.obj=i=ga(i);i.style.zIndex=999}i.setCapture&&i.setCapture();i.style.position="fixed";u();R();"row"===r&&(p?REDIPS.drag.event.rowCloned():REDIPS.drag.event.rowMoved())}ka();d>G-n[1]&&(i.style.left=
+G-(n[1]+n[3])+"px");e>H-n[2]&&(i.style.top=H-(n[0]+n[2])+"px")}wa=!0;if("cell"===r&&(7<c||7<g)&&!ha)ha=!0,ka(),REDIPS.drag.event.moved(p);d>n[3]&&d<G-n[1]&&(i.style.left=d-n[3]+"px");e>n[0]&&e<H-n[2]&&(i.style.top=e-n[0]+"px");if(d<D[1]&&d>D[3]&&e<D[2]&&e>D[0]&&0===S&&0===T&&(m.containTable||d<m[3]||d>m[1]||e<m[0]||e>m[2]))R(),ja();if(REDIPS.drag.scroll.enable){M=b-(G/2>d?d-n[3]:G-d-n[1]);if(0<M){if(M>b&&(M=b),c=O()[0],M*=d<G/2?-1:1,!(0>M&&0>=c||0<M&&c>=ua-G)&&0===S++)REDIPS.event.remove(window,"scroll",
+u),la(window)}else M=0;N=b-(H/2>e?e-n[0]:H-e-n[2]);if(0<N){if(N>b&&(N=b),c=O()[1],N*=e<H/2?-1:1,!(0>N&&0>=c||0<N&&c>=va-H)&&0===T++)REDIPS.event.remove(window,"scroll",u),ma(window)}else N=0;for(g=0;g<L.length;g++)if(c=L[g],c.autoscroll&&d<c.offset[1]&&d>c.offset[3]&&e<c.offset[2]&&e>c.offset[0]){P=b-(c.midstX>d?d-n[3]-c.offset[3]:c.offset[1]-d-n[1]);0<P?(P>b&&(P=b),P*=d<c.midstX?-1:1,0===S++&&(REDIPS.event.remove(c.div,"scroll",u),la(c.div))):P=0;Q=b-(c.midstY>e?e-n[0]-c.offset[0]:c.offset[2]-e-
n[2]);0<Q?(Q>b&&(Q=b),Q*=e<c.midstY?-1:1,0===T++&&(REDIPS.event.remove(c.div,"scroll",u),ma(c.div))):Q=0;break}else P=Q=0}a.cancelBubble=!0;a.stopPropagation&&a.stopPropagation()};ja=function(){if(h<f.length&&(h!==t||j!==v||k!==A))null!==t&&(null!==v&&null!==A)&&(Z(t,v,A,$),REDIPS.drag.td.previous=l.previous=f[t].rows[v].cells[A],REDIPS.drag.td.current=l.current=f[h].rows[j].cells[k],"switching"===REDIPS.drag.dropMode&&"cell"===r&&(ea(l.current,l.previous),u(),R()),"cell"===r?REDIPS.drag.event.changed(l.current):
-"row"===r&&(h!==t||j!==v)&&REDIPS.drag.event.rowChanged(l.current)),ka()};Ca=function(){if("number"===typeof window.innerWidth)G=window.innerWidth,H=window.innerHeight;else if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight))G=document.documentElement.clientWidth,H=document.documentElement.clientHeight;else if(document.body&&(document.body.clientWidth||document.body.clientHeight))G=document.body.clientWidth,H=document.body.clientHeight;ta=document.documentElement.scrollWidth;
-ua=document.documentElement.scrollHeight;u()};R=function(){var a,b,c,d,e,g;c=[];a=function(){null!==t&&(null!==v&&null!==A)&&(h=t,j=v,k=A)};b=W;g=X;for(h=0;h<f.length;h++)if(!1!==f[h].redips.enabled&&(c[0]=f[h].redips.offset[0],c[1]=f[h].redips.offset[1],c[2]=f[h].redips.offset[2],c[3]=f[h].redips.offset[3],void 0!==f[h].sca&&(c[0]=c[0]>f[h].sca.offset[0]?c[0]:f[h].sca.offset[0],c[1]=c[1]<f[h].sca.offset[1]?c[1]:f[h].sca.offset[1],c[2]=c[2]<f[h].sca.offset[2]?c[2]:f[h].sca.offset[2],c[3]=c[3]>f[h].sca.offset[3]?
+"row"===r&&(h!==t||j!==v)&&REDIPS.drag.event.rowChanged(l.current)),ka()};Da=function(){if("number"===typeof window.innerWidth)G=window.innerWidth,H=window.innerHeight;else if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight))G=document.documentElement.clientWidth,H=document.documentElement.clientHeight;else if(document.body&&(document.body.clientWidth||document.body.clientHeight))G=document.body.clientWidth,H=document.body.clientHeight;ua=document.documentElement.scrollWidth;
+va=document.documentElement.scrollHeight;u()};R=function(){var a,b,c,d,e,g;c=[];a=function(){null!==t&&(null!==v&&null!==A)&&(h=t,j=v,k=A)};b=W;g=X;for(h=0;h<f.length;h++)if(!1!==f[h].redips.enabled&&(c[0]=f[h].redips.offset[0],c[1]=f[h].redips.offset[1],c[2]=f[h].redips.offset[2],c[3]=f[h].redips.offset[3],void 0!==f[h].sca&&(c[0]=c[0]>f[h].sca.offset[0]?c[0]:f[h].sca.offset[0],c[1]=c[1]<f[h].sca.offset[1]?c[1]:f[h].sca.offset[1],c[2]=c[2]<f[h].sca.offset[2]?c[2]:f[h].sca.offset[2],c[3]=c[3]>f[h].sca.offset[3]?
c[3]:f[h].sca.offset[3]),c[3]<b&&b<c[1]&&c[0]<g&&g<c[2])){c=f[h].redips.row_offset;for(j=0;j<c.length-1;j++)if(void 0!==c[j]){m[0]=c[j][0];if(void 0!==c[j+1])m[2]=c[j+1][0];else for(d=j+2;d<c.length;d++)if(void 0!==c[d]){m[2]=c[d][0];break}if(g<=m[2])break}d=j;j===c.length-1&&(m[0]=c[j][0],m[2]=f[h].redips.offset[2]);do for(k=e=f[h].rows[j].cells.length-1;0<=k&&!(m[3]=c[j][3]+f[h].rows[j].cells[k].offsetLeft,m[1]=m[3]+f[h].rows[j].cells[k].offsetWidth,m[3]<=b&&b<=m[1]);k--);while(f[h].redips.rowspan&&
--1===k&&0<j--);0>j||0>k?a():j!==d&&(m[0]=c[j][0],m[2]=m[0]+f[h].rows[j].cells[k].offsetHeight,(g<m[0]||g>m[2])&&a());b=f[h].rows[j].cells[k];m.containTable=0<b.childNodes.length&&0<b.getElementsByTagName("table").length?!0:!1;if(-1===b.className.indexOf(REDIPS.drag.trash.className))if(g=-1<b.className.indexOf(REDIPS.drag.only.cname)?!0:!1,!0===g){if(-1===b.className.indexOf(xa.div[i.id])){a();break}}else if(void 0!==xa.div[i.id]&&"deny"===xa.other){a();break}else if(g=-1<b.className.indexOf(REDIPS.drag.mark.cname)?
+-1===k&&0<j--);0>j||0>k?a():j!==d&&(m[0]=c[j][0],m[2]=m[0]+f[h].rows[j].cells[k].offsetHeight,(g<m[0]||g>m[2])&&a());b=f[h].rows[j].cells[k];m.containTable=0<b.childNodes.length&&0<b.getElementsByTagName("table").length?!0:!1;if(-1===b.className.indexOf(REDIPS.drag.trash.className))if(g=-1<b.className.indexOf(REDIPS.drag.only.cname)?!0:!1,!0===g){if(-1===b.className.indexOf(ya.div[i.id])){a();break}}else if(void 0!==ya.div[i.id]&&"deny"===ya.other){a();break}else if(g=-1<b.className.indexOf(REDIPS.drag.mark.cname)?
!0:!1,(!0===g&&"deny"===REDIPS.drag.mark.action||!1===g&&"allow"===REDIPS.drag.mark.action)&&-1===b.className.indexOf(Ta.exception[i.id])){a();break}g=-1<b.className.indexOf("single")?!0:!1;if("cell"===r){if(("single"===REDIPS.drag.dropMode||g)&&0<b.childNodes.length){if(1===b.childNodes.length&&3===b.firstChild.nodeType)break;g=!0;for(d=b.childNodes.length-1;0<=d;d--)if(b.childNodes[d].className&&-1<b.childNodes[d].className.indexOf("drag")){g=!1;break}if(!g&&(null!==t&&null!==v&&null!==A)&&(z!==
-h||J!==j||U!==k)){a();break}}if(-1<b.className.indexOf("rowhandler")){a();break}if(b.parentNode.redips&&b.parentNode.redips.emptyRow){a();break}}break}};ka=function(){h<f.length&&(null!==h&&null!==j&&null!==k)&&($=Da(h,j,k),Z(h,j,k),t=h,v=j,A=k)};Z=function(a,b,c,d){if("cell"===r&&ha)c=f[a].rows[b].cells[c].style,c.backgroundColor=void 0===d?REDIPS.drag.hover.colorTd:d.color[0].toString(),void 0!==REDIPS.drag.hover.borderTd&&(void 0===d?c.border=REDIPS.drag.hover.borderTd:(c.borderTopWidth=d.top[0][0],
+h||J!==j||U!==k)){a();break}}if(-1<b.className.indexOf("rowhandler")){a();break}if(b.parentNode.redips&&b.parentNode.redips.emptyRow){a();break}}break}};ka=function(){h<f.length&&(null!==h&&null!==j&&null!==k)&&($=Ea(h,j,k),Z(h,j,k),t=h,v=j,A=k)};Z=function(a,b,c,d){if("cell"===r&&ha)c=f[a].rows[b].cells[c].style,c.backgroundColor=void 0===d?REDIPS.drag.hover.colorTd:d.color[0].toString(),void 0!==REDIPS.drag.hover.borderTd&&(void 0===d?c.border=REDIPS.drag.hover.borderTd:(c.borderTopWidth=d.top[0][0],
c.borderTopStyle=d.top[0][1],c.borderTopColor=d.top[0][2],c.borderRightWidth=d.right[0][0],c.borderRightStyle=d.right[0][1],c.borderRightColor=d.right[0][2],c.borderBottomWidth=d.bottom[0][0],c.borderBottomStyle=d.bottom[0][1],c.borderBottomColor=d.bottom[0][2],c.borderLeftWidth=d.left[0][0],c.borderLeftStyle=d.left[0][1],c.borderLeftColor=d.left[0][2]));else if("row"===r){a=f[a].rows[b];for(b=0;b<a.cells.length;b++)c=a.cells[b].style,c.backgroundColor=void 0===d?REDIPS.drag.hover.colorTr:d.color[b].toString(),
-void 0!==REDIPS.drag.hover.borderTr&&(void 0===d?h===z?j<J?c.borderTop=REDIPS.drag.hover.borderTr:c.borderBottom=REDIPS.drag.hover.borderTr:"before"===REDIPS.drag.rowDropMode?c.borderTop=REDIPS.drag.hover.borderTr:c.borderBottom=REDIPS.drag.hover.borderTr:(c.borderTopWidth=d.top[b][0],c.borderTopStyle=d.top[b][1],c.borderTopColor=d.top[b][2],c.borderBottomWidth=d.bottom[b][0],c.borderBottomStyle=d.bottom[b][1],c.borderBottomColor=d.bottom[b][2]))}};Da=function(a,b,c){var d={color:[],top:[],right:[],
+void 0!==REDIPS.drag.hover.borderTr&&(void 0===d?h===z?j<J?c.borderTop=REDIPS.drag.hover.borderTr:c.borderBottom=REDIPS.drag.hover.borderTr:"before"===REDIPS.drag.rowDropMode?c.borderTop=REDIPS.drag.hover.borderTr:c.borderBottom=REDIPS.drag.hover.borderTr:(c.borderTopWidth=d.top[b][0],c.borderTopStyle=d.top[b][1],c.borderTopColor=d.top[b][2],c.borderBottomWidth=d.bottom[b][0],c.borderBottomStyle=d.bottom[b][1],c.borderBottomColor=d.bottom[b][2]))}};Ea=function(a,b,c){var d={color:[],top:[],right:[],
bottom:[],left:[]},e=function(a,b){var c="border"+b+"Style",d="border"+b+"Color";return[E(a,"border"+b+"Width"),E(a,c),E(a,d)]};if("cell"===r)c=f[a].rows[b].cells[c],d.color[0]=c.style.backgroundColor,void 0!==REDIPS.drag.hover.borderTd&&(d.top[0]=e(c,"Top"),d.right[0]=e(c,"Right"),d.bottom[0]=e(c,"Bottom"),d.left[0]=e(c,"Left"));else{a=f[a].rows[b];for(b=0;b<a.cells.length;b++)c=a.cells[b],d.color[b]=c.style.backgroundColor,void 0!==REDIPS.drag.hover.borderTr&&(d.top[b]=e(c,"Top"),d.bottom[b]=e(c,
"Bottom"))}return d};C=function(a,b,c){var d=0,e=0,g=a;"fixed"!==b&&(b=O(),d=0-b[0],e=0-b[1]);if(void 0===c||!0===c){do d+=a.offsetLeft-a.scrollLeft,e+=a.offsetTop-a.scrollTop,a=a.offsetParent;while(a&&"BODY"!==a.nodeName)}else{do d+=a.offsetLeft,e+=a.offsetTop,a=a.offsetParent;while(a&&"BODY"!==a.nodeName)}return[e,d+g.offsetWidth,e+g.offsetHeight,d]};u=function(){var a,b,c,d;for(a=0;a<f.length;a++){c=[];d=E(f[a],"position");"fixed"!==d&&(d=E(f[a].parentNode,"position"));for(b=f[a].rows.length-1;0<=
b;b--)"none"!==f[a].rows[b].style.display&&(c[b]=C(f[a].rows[b],d));f[a].redips.offset=C(f[a],d);f[a].redips.row_offset=c}D=C(y);for(a=0;a<L.length;a++)d=E(L[a].div,"position"),b=C(L[a].div,d,!1),L[a].offset=b,L[a].midstX=(b[1]+b[3])/2,L[a].midstY=(b[0]+b[2])/2};O=function(){var a,b;"number"===typeof window.pageYOffset?(a=window.pageXOffset,b=window.pageYOffset):document.body&&(document.body.scrollLeft||document.body.scrollTop)?(a=document.body.scrollLeft,b=document.body.scrollTop):document.documentElement&&
-(document.documentElement.scrollLeft||document.documentElement.scrollTop)?(a=document.documentElement.scrollLeft,b=document.documentElement.scrollTop):a=b=0;return[a,b]};la=function(a){var b,c;b=W;c=X;0<S&&(u(),R(),b<D[1]&&(b>D[3]&&c<D[2]&&c>D[0])&&ja());"object"===typeof a&&(s=a);s===window?(a=O()[0],b=ta-G,c=M):(a=s.scrollLeft,b=s.scrollWidth-s.clientWidth,c=P);0<S&&(0>c&&0<a||0<c&&a<b)?(s===window?(window.scrollBy(c,0),O(),a=parseInt(i.style.left,10),isNaN(a)):s.scrollLeft+=c,setTimeout(la,REDIPS.drag.scroll.speed)):
-(REDIPS.event.add(s,"scroll",u),S=0,m=[0,0,0,0])};ma=function(a){var b,c;b=W;c=X;0<T&&(u(),R(),b<D[1]&&(b>D[3]&&c<D[2]&&c>D[0])&&ja());"object"===typeof a&&(s=a);s===window?(a=O()[1],b=ua-H,c=N):(a=s.scrollTop,b=s.scrollHeight-s.clientHeight,c=Q);0<T&&(0>c&&0<a||0<c&&a<b)?(s===window?(window.scrollBy(0,c),O(),a=parseInt(i.style.top,10),isNaN(a)):s.scrollTop+=c,setTimeout(ma,REDIPS.drag.scroll.speed)):(REDIPS.event.add(s,"scroll",u),T=0,m=[0,0,0,0])};na=function(a,b){var c=a.cloneNode(!0),d=c.className,
-e,g;!0===b&&(document.getElementById("redips_clone").appendChild(c),c.style.zIndex=999,c.style.position="fixed",e=C(a),g=C(c),c.style.top=e[0]-g[0]+"px",c.style.left=e[3]-g[3]+"px");c.setCapture&&c.setCapture();d=d.replace("clone","");d=d.replace(/climit(\d)_(\d+)/,"");c.className=sa(d);void 0===I[a.id]&&(I[a.id]=0);c.id=a.id+"c"+I[a.id];I[a.id]+=1;Ea(a,c);return c};Ea=function(a,b){var c=[],d;c[0]=function(a,b){a.redips&&(b.redips={},b.redips.enabled=a.redips.enabled,b.redips.container=a.redips.container,
+(document.documentElement.scrollLeft||document.documentElement.scrollTop)?(a=document.documentElement.scrollLeft,b=document.documentElement.scrollTop):a=b=0;return[a,b]};la=function(a){var b,c;b=W;c=X;0<S&&(u(),R(),b<D[1]&&(b>D[3]&&c<D[2]&&c>D[0])&&ja());"object"===typeof a&&(s=a);s===window?(a=O()[0],b=ua-G,c=M):(a=s.scrollLeft,b=s.scrollWidth-s.clientWidth,c=P);0<S&&(0>c&&0<a||0<c&&a<b)?(s===window?(window.scrollBy(c,0),O(),a=parseInt(i.style.left,10),isNaN(a)):s.scrollLeft+=c,setTimeout(la,REDIPS.drag.scroll.speed)):
+(REDIPS.event.add(s,"scroll",u),S=0,m=[0,0,0,0])};ma=function(a){var b,c;b=W;c=X;0<T&&(u(),R(),b<D[1]&&(b>D[3]&&c<D[2]&&c>D[0])&&ja());"object"===typeof a&&(s=a);s===window?(a=O()[1],b=va-H,c=N):(a=s.scrollTop,b=s.scrollHeight-s.clientHeight,c=Q);0<T&&(0>c&&0<a||0<c&&a<b)?(s===window?(window.scrollBy(0,c),O(),a=parseInt(i.style.top,10),isNaN(a)):s.scrollTop+=c,setTimeout(ma,REDIPS.drag.scroll.speed)):(REDIPS.event.add(s,"scroll",u),T=0,m=[0,0,0,0])};na=function(a,b){var c=a.cloneNode(!0),d=c.className,
+e,g;!0===b&&(document.getElementById("redips_clone").appendChild(c),c.style.zIndex=999,c.style.position="fixed",e=C(a),g=C(c),c.style.top=e[0]-g[0]+"px",c.style.left=e[3]-g[3]+"px");c.setCapture&&c.setCapture();d=d.replace("clone","");d=d.replace(/climit(\d)_(\d+)/,"");c.className=ta(d);void 0===I[a.id]&&(I[a.id]=0);c.id=a.id+"c"+I[a.id];I[a.id]+=1;Fa(a,c);return c};Fa=function(a,b){var c=[],d;c[0]=function(a,b){a.redips&&(b.redips={},b.redips.enabled=a.redips.enabled,b.redips.container=a.redips.container,
a.redips.enabled&&V(b))};c[1]=function(a,b){a.redips&&(b.redips={},b.redips.emptyRow=a.redips.emptyRow)};d=function(d){var g,f,w;f=["DIV","TR"];g=a.getElementsByTagName(f[d]);f=b.getElementsByTagName(f[d]);for(w=0;w<f.length;w++)c[d](g[w],f[w])};if("DIV"===a.nodeName)c[0](a,b);else if("TR"===a.nodeName)c[1](a,b);d(0);d(1)};oa=function(a,b){var c,d,e;e=a.className;c=e.match(/climit(\d)_(\d+)/);null!==c&&(d=parseInt(c[1],10),c=parseInt(c[2],10),0===c&&1===b&&(e+=" clone",2===d&&B(!0,a)),c+=b,e=e.replace(/climit\d_\d+/g,
-"climit"+d+"_"+c),0>=c&&(e=e.replace("clone",""),2===d?(B(!1,a),REDIPS.drag.event.clonedEnd2()):REDIPS.drag.event.clonedEnd1()),a.className=sa(e))};Fa=function(a){var b=!1;a.srcElement?(b=a.srcElement.nodeName,a=a.srcElement.className):(b=a.target.nodeName,a=a.target.className);switch(b){case "A":case "INPUT":case "SELECT":case "OPTION":case "TEXTAREA":b=!0;break;default:b=/\bnodrag\b/i.test(a)?!0:!1}return b};B=function(a,b){var c,d,e,g=[],f=[],w,i,h,j,l=/\bdrag\b/i,k=/\bnoautoscroll\b/i;i=REDIPS.drag.style.opacityDisabled;
+"climit"+d+"_"+c),0>=c&&(e=e.replace("clone",""),2===d?(B(!1,a),REDIPS.drag.event.clonedEnd2()):REDIPS.drag.event.clonedEnd1()),a.className=ta(e))};Ga=function(a){var b=!1;a.srcElement?(b=a.srcElement.nodeName,a=a.srcElement.className):(b=a.target.nodeName,a=a.target.className);switch(b){case "A":case "INPUT":case "SELECT":case "OPTION":case "TEXTAREA":b=!0;break;default:b=/\bnodrag\b/i.test(a)?!0:!1}return b};B=function(a,b){var c,d,e,g=[],f=[],w,i,h,j,l=/\bdrag\b/i,k=/\bnoautoscroll\b/i;i=REDIPS.drag.style.opacityDisabled;
!0===a||"init"===a?(w=REDIPS.drag.style.borderEnabled,h="move",j=!0):(w=REDIPS.drag.style.borderDisabled,h="auto",j=!1);void 0===b?g=y.getElementsByTagName("div"):"string"===typeof b?g=document.querySelectorAll(b):"object"===typeof b&&("DIV"!==b.nodeName||-1===b.className.indexOf("drag"))?g=b.getElementsByTagName("div"):g[0]=b;for(d=c=0;c<g.length;c++)if(l.test(g[c].className))"init"===a||void 0===g[c].redips?(g[c].redips={},g[c].redips.container=y):!0===a&&"number"===typeof i?(g[c].style.opacity=
"",g[c].style.filter=""):!1===a&&"number"===typeof i&&(g[c].style.opacity=i/100,g[c].style.filter="alpha(opacity="+i+")"),V(g[c],j),g[c].style.borderStyle=w,g[c].style.cursor=h,g[c].redips.enabled=j;else if("init"===a&&(e=E(g[c],"overflow"),"visible"!==e)){REDIPS.event.add(g[c],"scroll",u);e=E(g[c],"position");f=C(g[c],e,!1);e=k.test(g[c].className)?!1:!0;L[d]={div:g[c],offset:f,midstX:(f[1]+f[3])/2,midstY:(f[0]+f[2])/2,autoscroll:e};f=g[c].getElementsByTagName("table");for(e=0;e<f.length;e++)f[e].sca=
-L[d];d++}};E=function(a,b){var c;a&&a.currentStyle?c=a.currentStyle[b]:a&&window.getComputedStyle&&(c=document.defaultView.getComputedStyle(a,null)[b]);return c};x=function(a,b,c){b=b.parentNode;for(void 0===c&&(c=0);b&&b.nodeName!==a;)if((b=b.parentNode)&&b.nodeName===a&&0<c)c--,b=b.parentNode;return b};Ga=function(a,b){var c=x("TABLE",b),d,e;switch(a){case "firstInColumn":d=0;e=b.cellIndex;break;case "firstInRow":d=b.parentNode.rowIndex;e=0;break;case "lastInColumn":d=c.rows.length-1;e=b.cellIndex;
-break;case "lastInRow":d=b.parentNode.rowIndex;e=c.rows[d].cells.length-1;break;case "last":d=c.rows.length-1;e=c.rows[d].cells.length-1;break;default:d=e=0}return[d,e,c.rows[d].cells[e]]};ea=function(a,b,c){var d,e,g;d=function(a,b){var c=REDIPS.drag.getPosition(b);REDIPS.drag.moveObject({obj:a,target:c,callback:function(a){var b,a=REDIPS.drag.findParent("TABLE",a);b=a.redips.idx;wa[b]--;0===wa[b]&&(REDIPS.drag.event.relocated(),REDIPS.drag.enableTable(!0,a))}})};if(a!==b&&!("object"!==typeof a||
-"object"!==typeof b))if(g=a.childNodes.length,"animation"===c){if(0<g){c=x("TABLE",b);e=c.redips.idx;REDIPS.drag.enableTable(!1,c);for(c=0;c<g;c++)1===a.childNodes[c].nodeType&&"DIV"===a.childNodes[c].nodeName&&(wa[e]++,d(a.childNodes[c],b))}}else for(d=c=0;c<g;c++)1===a.childNodes[d].nodeType&&"DIV"===a.childNodes[d].nodeName?(e=a.childNodes[d],b.appendChild(e),(!e.redips||!1!==e.redips.enabled)&&V(e)):d++};fa=function(a,b){var c,d=[],e=!0,g;if("TD"===a.nodeName){c=a.childNodes.length;if("test"===
-b){for(g=c-1;0<=g;g--)if(l.source!==a&&a.childNodes[g].className&&-1<a.childNodes[g].className.indexOf("drag")){e=!1;break}return e}for(g=0;g<c;g++)d.push(a.childNodes[0]),a.removeChild(a.childNodes[0]);return d}};pa=function(a,b){var c,d,e,g,f,i,h,j,k,o,m,n,p=!1,q,r;q=function(a,b){REDIPS.drag.animation.shift?ea(a,b,"animation"):ea(a,b)};r=function(a){"delete"===REDIPS.drag.shift.overflow?fa(a):"source"===REDIPS.drag.shift.overflow?q(a,l.source):"object"===typeof REDIPS.drag.shift.overflow&&q(a,
-REDIPS.drag.shift.overflow);p=!1};if(a!==b){f=REDIPS.drag.shift.mode;c=x("TABLE",a);d=x("TABLE",b);i=Na(d);e=c===d?[a.redips.rowIndex,a.redips.cellIndex]:[-1,-1];g=[b.redips.rowIndex,b.redips.cellIndex];m=d.rows.length;n=Oa(d);switch(f){case "vertical2":c=c===d&&a.redips.cellIndex===b.redips.cellIndex?e:[m,b.redips.cellIndex];break;case "horizontal2":c=c===d&&a.parentNode.rowIndex===b.parentNode.rowIndex?e:[b.redips.rowIndex,n];break;default:c=c===d?e:[m,n]}"vertical1"===f||"vertical2"===f?(f=1E3*
-c[1]+c[0]<1E3*g[1]+g[0]?1:-1,d=m,m=0,n=1):(f=1E3*c[0]+c[1]<1E3*g[0]+g[1]?1:-1,d=n,m=1,n=0);for(c[0]!==e[0]&&c[1]!==e[1]&&(p=!0);c[0]!==g[0]||c[1]!==g[1];)(h=i[c[0]+"-"+c[1]],c[m]+=f,0>c[m]?(c[m]=d,c[n]--):c[m]>d&&(c[m]=0,c[n]++),e=i[c[0]+"-"+c[1]],void 0!==e&&(j=e),void 0!==h&&(k=h),void 0!==e&&void 0!==k||void 0!==j&&void 0!==h)?(e=-1===j.className.indexOf(REDIPS.drag.mark.cname)?0:1,h=-1===k.className.indexOf(REDIPS.drag.mark.cname)?0:1,p&&0===e&&1===h&&r(j),1===e?0===h&&(o=k):(0===e&&1===h&&(k=
-o),q(j,k))):p&&(void 0!==j&&void 0===k)&&(e=-1===j.className.indexOf(REDIPS.drag.mark.cname)?0:1,0===e&&r(j))}};Na=function(a){var b=[],c,d={},e,g,f,i,h,j,k,l;i=a.rows;for(h=0;h<i.length;h++)for(j=0;j<i[h].cells.length;j++){c=i[h].cells[j];a=c.parentNode.rowIndex;e=c.rowSpan||1;g=c.colSpan||1;b[a]=b[a]||[];for(k=0;k<b[a].length+1;k++)if("undefined"===typeof b[a][k]){f=k;break}d[a+"-"+f]=c;void 0===c.redips&&(c.redips={});c.redips.rowIndex=a;c.redips.cellIndex=f;for(k=a;k<a+e;k++){b[k]=b[k]||[];c=
-b[k];for(l=f;l<f+g;l++)c[l]="x"}}return d};Oa=function(a){var b=a.rows,c=0,d,e;"string"===typeof a&&document.getElementById(a);for(d=0;d<b.length;d++){for(e=a=0;e<b[d].cells.length;e++)a+=b[d].cells[e].colSpan||1;a>c&&(c=a)}return c};Ha=function(a,b){var c=(b.k1-b.k2*a)*(b.k1-b.k2*a),d,a=a+REDIPS.drag.animation.step*(4-3*c)*b.direction;d=b.m*a+b.b;"horizontal"===b.type?(b.obj.style.left=a+"px",b.obj.style.top=d+"px"):(b.obj.style.left=d+"px",b.obj.style.top=a+"px");a<b.last&&0<b.direction||a>b.last&&
-0>b.direction?setTimeout(function(){Ha(a,b)},REDIPS.drag.animation.pause*c):(Ba(b.obj),b.obj.redips.animated=!1,"cell"===b.mode?(!0===b.overwrite&&fa(b.targetCell),b.targetCell.appendChild(b.obj),(!b.obj.redips||!1!==b.obj.redips.enabled)&&V(b.obj)):Ja(qa(b.target[0]),b.target[1],b.obj),"function"===typeof b.callback&&b.callback(b.obj))};Ia=function(a){var b,c,d;b=[];b=c=d=-1;if(void 0===a)b=h<f.length?f[h].redips.idx:null===t||null===v||null===A?f[z].redips.idx:f[t].redips.idx,c=f[z].redips.idx,
-b=[b,j,k,c,J,U];else{if(a="string"===typeof a?document.getElementById(a):a)"TD"!==a.nodeName&&(a=x("TD",a)),a&&"TD"===a.nodeName&&(b=a.cellIndex,c=a.parentNode.rowIndex,a=x("TABLE",a),d=a.redips.idx);b=[d,c,b]}return b};qa=function(a){var b;for(b=0;b<f.length&&f[b].redips.idx!==a;b++);return b};sa=function(a){void 0!==a&&(a=a.replace(/^\s+|\s+$/g,"").replace(/\s{2,}/g," "));return a};Qa=function(a){var b;for(b=0;b<a.childNodes.length;b++)if(1===a.childNodes[b].nodeType)return!0;return!1};ra=function(a,
-b,c){var d,e;"string"===typeof a&&(a=document.getElementById(a),a=x("TABLE",a));if("TR"===a.nodeName){a=a.getElementsByTagName("td");for(d=0;d<a.length;d++)if(a[d].style.backgroundColor=c?c:"","empty"===b)a[d].innerHTML="";else for(e=0;e<a[d].childNodes.length;e++)1===a[d].childNodes[e].nodeType&&(a[d].childNodes[e].style.opacity=b/100,a[d].childNodes[e].style.filter="alpha(opacity="+b+")")}else a.style.opacity=b/100,a.style.filter="alpha(opacity="+b+")",a.style.backgroundColor=c?c:""};return{obj:i,
-objOld:o,mode:r,td:l,hover:{colorTd:"#E7AB83",colorTr:"#E7AB83"},scroll:{enable:!0,bound:25,speed:20},only:xa,mark:Ta,style:{borderEnabled:"solid",borderDisabled:"dotted",opacityDisabled:"",rowEmptyColor:"white"},trash:{className:"trash",question:null,questionRow:null},saveParamName:"p",dropMode:"multiple",multipleDrop:"bottom",clone:Ua,animation:{pause:20,step:2,shift:!1},shift:{mode:"horizontal1",after:"default",overflow:"bunch"},rowDropMode:"before",tableSort:!0,init:function(a){var b;if(void 0===
-a||"string"!==typeof a)a="drag";y=document.getElementById(a);document.getElementById("redips_clone")||(a=document.createElement("div"),a.id="redips_clone",a.style.width=a.style.height="1px",y.appendChild(a));B("init");q();Ca();REDIPS.event.add(window,"resize",Ca);b=y.getElementsByTagName("img");for(a=0;a<b.length;a++)REDIPS.event.add(b[a],"mousemove",K),REDIPS.event.add(b[a],"touchmove",K);REDIPS.event.add(window,"scroll",u)},initTables:q,enableDrag:B,enableTable:function(a,b){var c;if("object"===
-typeof b&&"TABLE"===b.nodeName)b.redips.enabled=a;else for(c=0;c<f.length;c++)-1<f[c].className.indexOf(b)&&(f[c].redips.enabled=a)},cloneObject:na,saveContent:function(a,b){var c="",d,e,g,f,i,h,j,k=[],l=REDIPS.drag.saveParamName;"string"===typeof a&&(a=document.getElementById(a));if(void 0!==a&&"object"===typeof a&&"TABLE"===a.nodeName){d=a.rows.length;for(i=0;i<d;i++){e=a.rows[i].cells.length;for(h=0;h<e;h++)if(g=a.rows[i].cells[h],0<g.childNodes.length)for(j=0;j<g.childNodes.length;j++)f=g.childNodes[j],
-"DIV"===f.nodeName&&-1<f.className.indexOf("drag")&&(c+=l+"[]="+f.id+"_"+i+"_"+h+"&",k.push([f.id,i,h]))}c="json"===b&&0<k.length?JSON.stringify(k):c.substring(0,c.length-1)}return c},relocate:ea,emptyCell:fa,moveObject:function(a){var b={direction:1},c,d,e,g,i,h;b.callback=a.callback;b.overwrite=a.overwrite;"string"===typeof a.id?b.obj=b.objOld=document.getElementById(a.id):"object"===typeof a.obj&&"DIV"===a.obj.nodeName&&(b.obj=b.objOld=a.obj);if("row"===a.mode){b.mode="row";h=qa(a.source[0]);i=
-a.source[1];o=b.objOld=f[h].rows[i];if(o.redips&&!0===o.redips.emptyRow)return!1;b.obj=ga(b.objOld,"animated")}else if(b.obj&&-1<b.obj.className.indexOf("row")){b.mode="row";b.obj=b.objOld=o=x("TR",b.obj);if(o.redips&&!0===o.redips.emptyRow)return!1;b.obj=ga(b.objOld,"animated")}else b.mode="cell";if(!("object"!==typeof b.obj||null===b.obj))return b.obj.style.zIndex=999,y!==b.obj.redips.container&&(y=b.obj.redips.container,q()),h=C(b.obj),e=h[1]-h[3],g=h[2]-h[0],c=h[3],d=h[0],!0===a.clone&&"cell"===
-b.mode&&(b.obj=na(b.obj,!0),REDIPS.drag.event.cloned(b.obj)),void 0===a.target&&(a.target=Ia()),b.target=a.target,h=qa(a.target[0]),i=a.target[1],a=a.target[2],i>f[h].rows.length-1&&(i=f[h].rows.length-1),b.targetCell=f[h].rows[i].cells[a],"cell"===b.mode?(h=C(b.targetCell),i=h[1]-h[3],a=h[2]-h[0],e=h[3]+(i-e)/2,g=h[0]+(a-g)/2):(h=C(f[h].rows[i]),e=h[3],g=h[0]),h=e-c,a=g-d,b.obj.style.position="fixed",Math.abs(h)>Math.abs(a)?(b.type="horizontal",b.m=a/h,b.b=d-b.m*c,b.k1=(c+e)/(c-e),b.k2=2/(c-e),c>
-e&&(b.direction=-1),h=c,b.last=e):(b.type="vertical",b.m=h/a,b.b=c-b.m*d,b.k1=(d+g)/(d-g),b.k2=2/(d-g),d>g&&(b.direction=-1),h=d,b.last=g),b.obj.redips.animated=!0,Ha(h,b),[b.obj,b.objOld]},shiftCells:pa,deleteObject:function(a){"object"===typeof a&&"DIV"===a.nodeName?a.parentNode.removeChild(a):"string"===typeof a&&(a=document.getElementById(a))&&a.parentNode.removeChild(a)},getPosition:Ia,rowOpacity:ra,rowEmpty:function(a,b,c){a=document.getElementById(a).rows[b];void 0===c&&(c=REDIPS.drag.style.rowEmptyColor);
-void 0===a.redips&&(a.redips={});a.redips.emptyRow=!0;ra(a,"empty",c)},getScrollPosition:O,getStyle:E,findParent:x,findCell:Ga,event:{changed:function(){},clicked:function(){},cloned:function(){},clonedDropped:function(){},clonedEnd1:function(){},clonedEnd2:function(){},dblClicked:function(){},deleted:function(){},dropped:function(){},droppedBefore:function(){},finish:function(){},moved:function(){},notCloned:function(){},notMoved:function(){},relocated:function(){},rowChanged:function(){},rowClicked:function(){},
-rowCloned:function(){},rowDeleted:function(){},rowDropped:function(){},rowDroppedBefore:function(){},rowDroppedSource:function(){},rowMoved:function(){},rowNotCloned:function(){},rowNotMoved:function(){},rowUndeleted:function(){},switched:function(){},undeleted:function(){}}}}();
-REDIPS.event||(REDIPS.event=function(){return{add:function(q,B,K){q.addEventListener?q.addEventListener(B,K,!1):q.attachEvent?q.attachEvent("on"+B,K):q["on"+B]=K},remove:function(q,B,K){q.removeEventListener?q.removeEventListener(B,K,!1):q.detachEvent?q.detachEvent("on"+B,K):q["on"+B]=null}}}());
+L[d];d++}};E=function(a,b){var c;a&&a.currentStyle?c=a.currentStyle[b]:a&&window.getComputedStyle&&(c=document.defaultView.getComputedStyle(a,null)[b]);return c};x=function(a,b,c){b=b.parentNode;for(void 0===c&&(c=0);b&&b.nodeName!==a;)if((b=b.parentNode)&&b.nodeName===a&&0<c)c--,b=b.parentNode;return b};Ha=function(a,b){var c=x("TABLE",b),d,e;switch(a){case "firstInColumn":d=0;e=b.cellIndex;break;case "firstInRow":d=b.parentNode.rowIndex;e=0;break;case "lastInColumn":d=c.rows.length-1;e=b.cellIndex;
+break;case "lastInRow":d=b.parentNode.rowIndex;e=c.rows[d].cells.length-1;break;case "last":d=c.rows.length-1;e=c.rows[d].cells.length-1;break;default:d=e=0}return[d,e,c.rows[d].cells[e]]};ea=function(a,b,c){var d,e,g;d=function(a,b){REDIPS.drag.event.relocateBefore(a,b);var c=REDIPS.drag.getPosition(b);REDIPS.drag.moveObject({obj:a,target:c,callback:function(a){var c=REDIPS.drag.findParent("TABLE",a),d=c.redips.idx;REDIPS.drag.event.relocateAfter(a,b);xa[d]--;0===xa[d]&&(REDIPS.drag.event.relocateEnd(),
+REDIPS.drag.enableTable(!0,c))}})};if(a!==b&&!("object"!==typeof a||"object"!==typeof b))if(g=a.childNodes.length,"animation"===c){if(0<g){c=x("TABLE",b);e=c.redips.idx;REDIPS.drag.enableTable(!1,c);for(c=0;c<g;c++)1===a.childNodes[c].nodeType&&"DIV"===a.childNodes[c].nodeName&&(xa[e]++,d(a.childNodes[c],b))}}else for(d=c=0;c<g;c++)1===a.childNodes[d].nodeType&&"DIV"===a.childNodes[d].nodeName?(e=a.childNodes[d],REDIPS.drag.event.relocateBefore(e,b),b.appendChild(e),e.redips&&!1!==e.redips.enabled&&
+V(e),REDIPS.drag.event.relocateAfter(e)):d++};fa=function(a,b){var c,d=[],e=!0,g;if("TD"===a.nodeName){c=a.childNodes.length;if("test"===b){for(g=c-1;0<=g;g--)if(l.source!==a&&a.childNodes[g].className&&-1<a.childNodes[g].className.indexOf("drag")){e=!1;break}return e}for(g=0;g<c;g++)d.push(a.childNodes[0]),a.removeChild(a.childNodes[0]);return d}};pa=function(a,b){var c,d,e,g,f,i,h,j,k,o,m,n,p=!1,q,r;q=function(a,b){REDIPS.drag.animation.shift?ea(a,b,"animation"):ea(a,b)};r=function(a){"delete"===
+REDIPS.drag.shift.overflow?fa(a):"source"===REDIPS.drag.shift.overflow?q(a,l.source):"object"===typeof REDIPS.drag.shift.overflow&&q(a,REDIPS.drag.shift.overflow);p=!1;REDIPS.drag.event.shiftOverflow(a)};if(a!==b){f=REDIPS.drag.shift.mode;c=x("TABLE",a);d=x("TABLE",b);i=Na(d);e=c===d?[a.redips.rowIndex,a.redips.cellIndex]:[-1,-1];g=[b.redips.rowIndex,b.redips.cellIndex];m=d.rows.length;n=Oa(d);switch(f){case "vertical2":c=c===d&&a.redips.cellIndex===b.redips.cellIndex?e:[m,b.redips.cellIndex];break;
+case "horizontal2":c=c===d&&a.parentNode.rowIndex===b.parentNode.rowIndex?e:[b.redips.rowIndex,n];break;default:c=c===d?e:[m,n]}"vertical1"===f||"vertical2"===f?(f=1E3*c[1]+c[0]<1E3*g[1]+g[0]?1:-1,d=m,m=0,n=1):(f=1E3*c[0]+c[1]<1E3*g[0]+g[1]?1:-1,d=n,m=1,n=0);for(c[0]!==e[0]&&c[1]!==e[1]&&(p=!0);c[0]!==g[0]||c[1]!==g[1];)(h=i[c[0]+"-"+c[1]],c[m]+=f,0>c[m]?(c[m]=d,c[n]--):c[m]>d&&(c[m]=0,c[n]++),e=i[c[0]+"-"+c[1]],void 0!==e&&(j=e),void 0!==h&&(k=h),void 0!==e&&void 0!==k||void 0!==j&&void 0!==h)?(e=
+-1===j.className.indexOf(REDIPS.drag.mark.cname)?0:1,h=-1===k.className.indexOf(REDIPS.drag.mark.cname)?0:1,p&&0===e&&1===h&&r(j),1===e?0===h&&(o=k):(0===e&&1===h&&(k=o),q(j,k))):p&&(void 0!==j&&void 0===k)&&(e=-1===j.className.indexOf(REDIPS.drag.mark.cname)?0:1,0===e&&r(j))}};Na=function(a){var b=[],c,d={},e,g,f,i,h,j,k,l;i=a.rows;for(h=0;h<i.length;h++)for(j=0;j<i[h].cells.length;j++){c=i[h].cells[j];a=c.parentNode.rowIndex;e=c.rowSpan||1;g=c.colSpan||1;b[a]=b[a]||[];for(k=0;k<b[a].length+1;k++)if("undefined"===
+typeof b[a][k]){f=k;break}d[a+"-"+f]=c;void 0===c.redips&&(c.redips={});c.redips.rowIndex=a;c.redips.cellIndex=f;for(k=a;k<a+e;k++){b[k]=b[k]||[];c=b[k];for(l=f;l<f+g;l++)c[l]="x"}}return d};Oa=function(a){var b=a.rows,c=0,d,e;"string"===typeof a&&document.getElementById(a);for(d=0;d<b.length;d++){for(e=a=0;e<b[d].cells.length;e++)a+=b[d].cells[e].colSpan||1;a>c&&(c=a)}return c};Ia=function(a,b){var c=(b.k1-b.k2*a)*(b.k1-b.k2*a),d,a=a+REDIPS.drag.animation.step*(4-3*c)*b.direction;d=b.m*a+b.b;"horizontal"===
+b.type?(b.obj.style.left=a+"px",b.obj.style.top=d+"px"):(b.obj.style.left=d+"px",b.obj.style.top=a+"px");a<b.last&&0<b.direction||a>b.last&&0>b.direction?setTimeout(function(){Ia(a,b)},REDIPS.drag.animation.pause*c):(Ca(b.obj),b.obj.redips&&(b.obj.redips.animated=!1),"cell"===b.mode?(!0===b.overwrite&&fa(b.targetCell),b.targetCell.appendChild(b.obj),b.obj.redips&&!1!==b.obj.redips.enabled&&V(b.obj)):Ja(qa(b.target[0]),b.target[1],b.obj),"function"===typeof b.callback&&b.callback(b.obj))};ra=function(a){var b,
+c,d;b=[];b=c=d=-1;if(void 0===a)b=h<f.length?f[h].redips.idx:null===t||null===v||null===A?f[z].redips.idx:f[t].redips.idx,c=f[z].redips.idx,b=[b,j,k,c,J,U];else{if(a="string"===typeof a?document.getElementById(a):a)"TD"!==a.nodeName&&(a=x("TD",a)),a&&"TD"===a.nodeName&&(b=a.cellIndex,c=a.parentNode.rowIndex,a=x("TABLE",a),d=a.redips.idx);b=[d,c,b]}return b};qa=function(a){var b;for(b=0;b<f.length&&f[b].redips.idx!==a;b++);return b};ta=function(a){void 0!==a&&(a=a.replace(/^\s+|\s+$/g,"").replace(/\s{2,}/g,
+" "));return a};Qa=function(a){var b;for(b=0;b<a.childNodes.length;b++)if(1===a.childNodes[b].nodeType)return!0;return!1};sa=function(a,b,c){var d,e;"string"===typeof a&&(a=document.getElementById(a),a=x("TABLE",a));if("TR"===a.nodeName){a=a.getElementsByTagName("td");for(d=0;d<a.length;d++)if(a[d].style.backgroundColor=c?c:"","empty"===b)a[d].innerHTML="";else for(e=0;e<a[d].childNodes.length;e++)1===a[d].childNodes[e].nodeType&&(a[d].childNodes[e].style.opacity=b/100,a[d].childNodes[e].style.filter=
+"alpha(opacity="+b+")")}else a.style.opacity=b/100,a.style.filter="alpha(opacity="+b+")",a.style.backgroundColor=c?c:""};return{obj:i,objOld:o,mode:r,td:l,hover:{colorTd:"#E7AB83",colorTr:"#E7AB83"},scroll:{enable:!0,bound:25,speed:20},only:ya,mark:Ta,style:{borderEnabled:"solid",borderDisabled:"dotted",opacityDisabled:"",rowEmptyColor:"white"},trash:{className:"trash",question:null,questionRow:null},saveParamName:"p",dropMode:"multiple",multipleDrop:"bottom",clone:Ua,animation:{pause:20,step:2,shift:!1},
+shift:{mode:"horizontal1",after:"default",overflow:"bunch"},rowDropMode:"before",tableSort:!0,init:function(a){var b;if(void 0===a||"string"!==typeof a)a="drag";y=document.getElementById(a);document.getElementById("redips_clone")||(a=document.createElement("div"),a.id="redips_clone",a.style.width=a.style.height="1px",y.appendChild(a));B("init");q();Da();REDIPS.event.add(window,"resize",Da);b=y.getElementsByTagName("img");for(a=0;a<b.length;a++)REDIPS.event.add(b[a],"mousemove",K),REDIPS.event.add(b[a],
+"touchmove",K);REDIPS.event.add(window,"scroll",u)},initTables:q,enableDrag:B,enableTable:function(a,b){var c;if("object"===typeof b&&"TABLE"===b.nodeName)b.redips.enabled=a;else for(c=0;c<f.length;c++)-1<f[c].className.indexOf(b)&&(f[c].redips.enabled=a)},cloneObject:na,saveContent:function(a,b){var c="",d,e,g,f,i,h,j,k=[],l=REDIPS.drag.saveParamName;"string"===typeof a&&(a=document.getElementById(a));if(void 0!==a&&"object"===typeof a&&"TABLE"===a.nodeName){d=a.rows.length;for(i=0;i<d;i++){e=a.rows[i].cells.length;
+for(h=0;h<e;h++)if(g=a.rows[i].cells[h],0<g.childNodes.length)for(j=0;j<g.childNodes.length;j++)f=g.childNodes[j],"DIV"===f.nodeName&&-1<f.className.indexOf("drag")&&(c+=l+"[]="+f.id+"_"+i+"_"+h+"&",k.push([f.id,i,h]))}c="json"===b&&0<k.length?JSON.stringify(k):c.substring(0,c.length-1)}return c},relocate:ea,emptyCell:fa,moveObject:function(a){var b={direction:1},c,d,e,g,i,h;b.callback=a.callback;b.overwrite=a.overwrite;"string"===typeof a.id?b.obj=b.objOld=document.getElementById(a.id):"object"===
+typeof a.obj&&"DIV"===a.obj.nodeName&&(b.obj=b.objOld=a.obj);if("row"===a.mode){b.mode="row";h=qa(a.source[0]);i=a.source[1];o=b.objOld=f[h].rows[i];if(o.redips&&!0===o.redips.emptyRow)return!1;b.obj=ga(b.objOld,"animated")}else if(b.obj&&-1<b.obj.className.indexOf("row")){b.mode="row";b.obj=b.objOld=o=x("TR",b.obj);if(o.redips&&!0===o.redips.emptyRow)return!1;b.obj=ga(b.objOld,"animated")}else b.mode="cell";if(!("object"!==typeof b.obj||null===b.obj))return b.obj.style.zIndex=999,b.obj.redips&&y!==
+b.obj.redips.container&&(y=b.obj.redips.container,q()),h=C(b.obj),e=h[1]-h[3],g=h[2]-h[0],c=h[3],d=h[0],!0===a.clone&&"cell"===b.mode&&(b.obj=na(b.obj,!0),REDIPS.drag.event.cloned(b.obj)),void 0===a.target?a.target=ra():"object"===typeof a.target&&"TD"===a.target.nodeName&&(a.target=ra(a.target)),b.target=a.target,h=qa(a.target[0]),i=a.target[1],a=a.target[2],i>f[h].rows.length-1&&(i=f[h].rows.length-1),b.targetCell=f[h].rows[i].cells[a],"cell"===b.mode?(h=C(b.targetCell),i=h[1]-h[3],a=h[2]-h[0],
+e=h[3]+(i-e)/2,g=h[0]+(a-g)/2):(h=C(f[h].rows[i]),e=h[3],g=h[0]),h=e-c,a=g-d,b.obj.style.position="fixed",Math.abs(h)>Math.abs(a)?(b.type="horizontal",b.m=a/h,b.b=d-b.m*c,b.k1=(c+e)/(c-e),b.k2=2/(c-e),c>e&&(b.direction=-1),h=c,b.last=e):(b.type="vertical",b.m=h/a,b.b=c-b.m*d,b.k1=(d+g)/(d-g),b.k2=2/(d-g),d>g&&(b.direction=-1),h=d,b.last=g),b.obj.redips&&(b.obj.redips.animated=!0),Ia(h,b),[b.obj,b.objOld]},shiftCells:pa,deleteObject:function(a){"object"===typeof a&&"DIV"===a.nodeName?a.parentNode.removeChild(a):
+"string"===typeof a&&(a=document.getElementById(a))&&a.parentNode.removeChild(a)},getPosition:ra,rowOpacity:sa,rowEmpty:function(a,b,c){a=document.getElementById(a).rows[b];void 0===c&&(c=REDIPS.drag.style.rowEmptyColor);void 0===a.redips&&(a.redips={});a.redips.emptyRow=!0;sa(a,"empty",c)},getScrollPosition:O,getStyle:E,findParent:x,findCell:Ha,event:{changed:function(){},clicked:function(){},cloned:function(){},clonedDropped:function(){},clonedEnd1:function(){},clonedEnd2:function(){},dblClicked:function(){},
+deleted:function(){},dropped:function(){},droppedBefore:function(){},finish:function(){},moved:function(){},notCloned:function(){},notMoved:function(){},shiftOverflow:function(){},relocateBefore:function(){},relocateAfter:function(){},relocateEnd:function(){},rowChanged:function(){},rowClicked:function(){},rowCloned:function(){},rowDeleted:function(){},rowDropped:function(){},rowDroppedBefore:function(){},rowDroppedSource:function(){},rowMoved:function(){},rowNotCloned:function(){},rowNotMoved:function(){},
+rowUndeleted:function(){},switched:function(){},undeleted:function(){}}}}();REDIPS.event||(REDIPS.event=function(){return{add:function(q,B,K){q.addEventListener?q.addEventListener(B,K,!1):q.attachEvent?q.attachEvent("on"+B,K):q["on"+B]=K},remove:function(q,B,K){q.removeEventListener?q.removeEventListener(B,K,!1):q.detachEvent?q.detachEvent("on"+B,K):q["on"+B]=null}}}());
View
86 redips-drag-source.js
@@ -3,7 +3,7 @@ Copyright (c) 2008-2011, www.redips.net All rights reserved.
Code licensed under the BSD License: http://www.redips.net/license/
http://www.redips.net/javascript/drag-and-drop-table-content/
Version 5.0.4
-Dec 20, 2012.
+Dec 21, 2012.
*/
/*jslint white: true, browser: true, undef: true, nomen: true, eqeqeq: true, plusplus: false, bitwise: true, regexp: true, strict: true, newcap: true, immed: true, maxerr: 14 */
@@ -194,7 +194,10 @@ REDIPS.drag = (function () {
moved : function () {},
notCloned : function () {},
notMoved : function () {},
- relocated : function () {},
+ shiftOverflow: function () {},
+ relocateBefore : function () {},
+ relocateAfter : function () {},
+ relocateEnd : function () {},
rowChanged : function () {},
rowClicked : function () {},
rowCloned : function () {},
@@ -1333,7 +1336,7 @@ REDIPS.drag = (function () {
}
}
// shift table content if dropMode is set to "shift" and target cell is not empty or shift.after option is set to always
- // has_child() is a private method
+ // hasChild() is a private method
if (REDIPS.drag.dropMode === 'shift' && (hasChilds(td.target) || REDIPS.drag.shift.after === 'always')) {
shiftCells(td.source, td.target);
}
@@ -3128,23 +3131,26 @@ REDIPS.drag = (function () {
move; // move object (private function)
// define private move function (after animation is finished table will be enabled)
move = function (el, to) {
+ // call relocateBefore event handler for this element
+ REDIPS.drag.event.relocateBefore(el, to);
// define target position
var target = REDIPS.drag.getPosition(to);
// move object
REDIPS.drag.moveObject({
obj: el,
target: target,
callback: function (div) {
- var tbl, idx;
// set reference to the table and table index
- tbl = REDIPS.drag.findParent('TABLE', div);
- idx = tbl.redips.idx;
+ var tbl = REDIPS.drag.findParent('TABLE', div),
+ idx = tbl.redips.idx;
+ // call relocateAfter event handler for this div element
+ REDIPS.drag.event.relocateAfter(div, to);
// decrease animation counter per table
animationCounter[idx]--;
// after last element is placed the table then table should be enabled
if (animationCounter[idx] === 0) {
// call event handler after relocation is finished
- REDIPS.drag.event.relocated();
+ REDIPS.drag.event.relocateEnd();
// enable target table
REDIPS.drag.enableTable(true, tbl);
}
@@ -3191,12 +3197,16 @@ REDIPS.drag = (function () {
if (from.childNodes[j].nodeType === 1 && from.childNodes[j].nodeName === 'DIV') {
// set DIV element
div = from.childNodes[j];
+ // call relocateBefore event handler for this element
+ REDIPS.drag.event.relocateBefore(div, to);
// append DIV element to the table cell
to.appendChild(div);
// register event listeners (FIX for Safari Mobile) if DIV element is not disabled
- if (!div.redips || div.redips.enabled !== false) {
+ if (div.redips && div.redips.enabled !== false) {
registerEvents(div);
}
+ // call relocated event handler
+ REDIPS.drag.event.relocateAfter(div);
}
// skip text nodes, attribute nodes ...
else {
@@ -3326,6 +3336,8 @@ REDIPS.drag = (function () {
}
// set overflow flag to false (overflow could happen only once)
overflow = false;
+ // call shiftOverflow event handler
+ REDIPS.drag.event.shiftOverflow(target);
};
// if DIV element is dropped to the source cell then there's nothing to do - just return from method
if (td1 === td2) {
@@ -3687,7 +3699,8 @@ REDIPS.drag = (function () {
// set high z-index
p.obj.style.zIndex = 999;
// if clicked element doesn't belong to the current container then context should be changed
- if (dragContainer !== p.obj.redips.container) {
+ // redips property could not be set in case when static DIV is moved (like in example25)
+ if (p.obj.redips && dragContainer !== p.obj.redips.container) {
dragContainer = p.obj.redips.container;
initTables();
}
@@ -3709,6 +3722,10 @@ REDIPS.drag = (function () {
if (ip.target === undefined) {
ip.target = getPosition();
}
+ // if target is TD (object) then set position for this TD
+ else if (typeof(ip.target) === 'object' && ip.target.nodeName === 'TD') {
+ ip.target = getPosition(ip.target);
+ }
// set target table, row and cell indexes (needed for moving table row)
// table index is index from array not original table index
p.target = ip.target;
@@ -3784,7 +3801,10 @@ REDIPS.drag = (function () {
p.last = y2;
}
// set attribute "animated" of DIV object to true (to disable dragging od DIV while animation lasts)
- p.obj.redips.animated = true;
+ // redips property could not be set in case when static DIV is moved (like in example25)
+ if (p.obj.redips) {
+ p.obj.redips.animated = true;
+ }
// start animation
animateObject(i, p);
// return reference of obj and objOld elements
@@ -3845,8 +3865,11 @@ REDIPS.drag = (function () {
else {
// reset object styles
resetStyles(p.obj);
- // set animation flag to false (to enable DIV dragging)
- p.obj.redips.animated = false;
+ // set animation flag to false to enable DIV dragging
+ // redips property could not be set in case when static DIV is moved (like in example25)
+ if (p.obj.redips) {
+ p.obj.redips.animated = false;
+ }
// if moved element is cell then append element to the target cell
if (p.mode === 'cell') {
// if overwrite parameter is set to true then empty targetCell
@@ -3856,7 +3879,7 @@ REDIPS.drag = (function () {
}
p.targetCell.appendChild(p.obj);
// register event listeners (FIX for Safari Mobile) if DIV element is not disabled
- if (!p.obj.redips || p.obj.redips.enabled !== false) {
+ if (p.obj.redips && p.obj.redips.enabled !== false) {
registerEvents(p.obj);
}
}
@@ -4471,11 +4494,37 @@ REDIPS.drag = (function () {
* Event handler invoked after all DIV elements are relocated and before table is enabled (DIV elements enabled for dragging).
* This event can be triggered after single call of relocate() method or after all DIV elements are shifted in "shift" mode.
* It is called only if animation is turned on.
- * @name REDIPS.drag#event:relocated
+ * @name REDIPS.drag#event:relocateEnd
* @see <a href="#relocate">relocate</a>
+ * @see <a href="#event.relocateBefore">relocateBefore</a>
+ * @see <a href="#event.relocateAfter">relocateAfter</a>
* @function
* @event
- */
+ */
+ /**
+ * Event handler invoked before DIV element will be relocated.
+ * For example, in shift drop mode, this event handler will be called for each DIV element.
+ * @param {HTMLElement} div Reference of DIV element that will be relocated.
+ * @param {HTMLElement} td Reference of TD where DIV element will be relocated.
+ * @name REDIPS.drag#event:relocateBefore
+ * @see <a href="#relocate">relocate</a>
+ * @see <a href="#event.relocateAfter">relocateAfter</a>
+ * @see <a href="#event.relocateEnd">relocateEnd</a>
+ * @function
+ * @event
+ */
+ /**
+ * Event handler invoked after DIV element is relocated.
+ * For example, in shift drop mode, this event handler will be called for each DIV element.
+ * @param {HTMLElement} div Reference of DIV element that is relocated.
+ * @param {HTMLElement} td Reference of TD where DIV element will be relocated.
+ * @name REDIPS.drag#event:relocateAfter
+ * @see <a href="#relocate">relocate</a>
+ * @see <a href="#event.relocateBefore">relocateBefore</a>
+ * @see <a href="#event.relocateEnd">relocateEnd</a>
+ * @function
+ * @event
+ */
/**
* Event handler invoked on every change of current (highlighted) table cell.
* @param {HTMLElement} [currentCell] Reference to the current (highlighted) table cell.
@@ -4563,6 +4612,13 @@ REDIPS.drag = (function () {
* @function
* @event
*/
+ /**
+ * Event handler invoked in a moment when overflow happen in shift mode.
+ * @param {HTMLElement} td Reference of TD where overflow happen.
+ * @name REDIPS.drag#event:shiftOverflow
+ * @function
+ * @event
+ */
/* Row Event Handlers */
/**

0 comments on commit 3609567

Please sign in to comment.