src/ztfy/myams/resources/js/ext/jquery-dataTables-keyTable.min.js
changeset 0 8a19e25e39e4
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/ztfy/myams/resources/js/ext/jquery-dataTables-keyTable.min.js	Wed May 07 10:36:24 2014 +0200
@@ -0,0 +1,4 @@
+/* KeyTable 1.2.0
+ * ©2010-2014 SpryMedia Ltd - datatables.net/license
+ */
+var KeyTable;(function(c,a,d){var b=function(f,e){KeyTable=function(x){this.block=false;this.event={remove:{}};this.fnGetCurrentPosition=function(){return[i,g]};this.fnGetCurrentData=function(){return t.innerHTML};this.fnGetCurrentTD=function(){return t};this.fnSetPosition=function(P,Q){if(typeof P=="object"&&P.nodeName){h(P)}else{h(M(P,Q))}};this.fnBlur=function(){B()};var l=null;var t=null;var i=null;var g=null;var O=null;var o="focus";var D=false;var y={action:[],esc:[],focus:[],blur:[]};var k=null;var u;var z;var K=false;function J(P){return function(Q,T,S){if((Q===null||typeof Q=="number")&&(T===null||typeof T=="number")&&typeof S=="function"){E(P,Q,T,S)}else{if(typeof Q=="object"&&typeof T=="function"){var R=q(Q);E(P,R[0],R[1],T)}else{alert("Unhandable event type was added: x"+Q+"  y:"+T+"  z:"+S)}}}}function j(P){return function(Q,T,S){if((Q===null||typeof arguments[0]=="number")&&(T===null||typeof arguments[1]=="number")){if(typeof arguments[2]=="function"){N(P,Q,T,S)}else{N(P,Q,T)}}else{if(typeof arguments[0]=="object"){var R=q(Q);if(typeof arguments[1]=="function"){N(P,R[0],R[1],T)}else{N(P,R[0],R[1])}}else{alert("Unhandable event type was removed: x"+Q+"  y:"+T+"  z:"+S)}}}}for(var v in y){if(v){this.event[v]=J(v);this.event.remove[v]=j(v)}}function E(S,P,R,Q){y[S].push({x:P,y:R,fn:Q})}function N(V,Q,U,S){var T=0;for(var R=0,P=y[V].length;R<P-T;R++){if(typeof S!="undefined"){if(y[V][R-T].x==Q&&y[V][R-T].y==U&&y[V][R-T].fn==S){y[V].splice(R-T,1);T++}}else{if(y[V][R-T].x==Q&&y[V][R-T].y==U){y[V].splice(R,1);return 1}}}return T}function H(U,P,T){var S=0;var Q=y[U];for(var R=0;R<Q.length;R++){if((Q[R].x==P&&Q[R].y==T)||(Q[R].x===null&&Q[R].y==T)||(Q[R].x==P&&Q[R].y===null)||(Q[R].x===null&&Q[R].y===null)){Q[R].fn(M(P,T),P,T);S++}}return S}function h(U,ac){if(t==U){return}if(typeof ac=="undefined"){ac=true}if(t!==null){w(t)}f(U).addClass(o);f(U).parent().addClass(o);var R;if(k){R=k;var X=m(U)[1];var Y=D;while(X>=R.fnDisplayEnd()){if(R._iDisplayLength>=0){if(R._iDisplayStart+R._iDisplayLength<R.fnRecordsDisplay()){R._iDisplayStart+=R._iDisplayLength}}else{R._iDisplayStart=0}k.oApi._fnCalculateEnd(R)}while(X<R._iDisplayStart){R._iDisplayStart=R._iDisplayLength>=0?R._iDisplayStart-R._iDisplayLength:0;if(R._iDisplayStart<0){R._iDisplayStart=0}k.oApi._fnCalculateEnd(R)}k.oApi._fnDraw(R);D=Y}var V=q(U);t=U;i=V[0];g=V[1];var Z,ab,T,W,P,Q,aa;if(ac){Z=f(c).height();ab=f(c).width();T=f(a).scrollTop();W=f(a).scrollLeft();P=U.offsetHeight;Q=U.offsetWidth;aa=F(U);if(k&&typeof R.oScroll!="undefined"&&(R.oScroll.sX!==""||R.oScroll.sY!=="")){aa[1]-=f(R.nTable.parentNode).scrollTop();aa[0]-=f(R.nTable.parentNode).scrollLeft()}if(aa[1]+P>T+Z){G(aa[1]+P-Z)}else{if(aa[1]<T){G(aa[1])}}if(aa[0]+Q>W+ab){A(aa[0]+Q-ab)}else{if(aa[0]<W){A(aa[0])}}}if(k&&typeof R.oScroll!="undefined"&&(R.oScroll.sX!==""||R.oScroll.sY!=="")){var S=R.nTable.parentNode;Z=S.clientHeight;ab=S.clientWidth;T=S.scrollTop;W=S.scrollLeft;P=U.offsetHeight;Q=U.offsetWidth;if(U.offsetTop+P>Z+T){S.scrollTop=(U.offsetTop+P)-Z}else{if(U.offsetTop<T){S.scrollTop=U.offsetTop}}if(U.offsetLeft+Q>ab+W){S.scrollLeft=(U.offsetLeft+Q)-ab}else{if(U.offsetLeft<W){S.scrollLeft=U.offsetLeft}}}L();H("focus",i,g)}function B(){w(t);i=null;g=null;t=null;r()}function w(P){f(P).removeClass(o);f(P).parent().removeClass(o);H("blur",i,g)}function s(P){var Q=this;while(Q.nodeName!="TD"){Q=Q.parentNode}h(Q);L()}function n(U){if(O.block||!D){return true}if(U.metaKey||U.altKey||U.ctrlKey){return true}var Q,V,T=l.getElementsByTagName("tr")[0].getElementsByTagName("td").length,P;if(k){P=k.aiDisplay.length;var S=m(t);if(S===null){return}i=S[0];g=S[1]}else{P=l.getElementsByTagName("tr").length}var R=(U.keyCode==9&&U.shiftKey)?-1:U.keyCode;switch(R){case 13:U.preventDefault();U.stopPropagation();H("action",i,g);return true;case 27:if(!H("esc",i,g)){B();return}Q=i;V=g;break;case -1:case 37:if(i>0){Q=i-1;V=g}else{if(g>0){Q=T-1;V=g-1}else{if(R==-1&&u){K=true;z.focus();setTimeout(function(){K=false},0);D=false;B();return true}else{return false}}}break;case 38:if(g>0){Q=i;V=g-1}else{return false}break;case 36:Q=i;V=0;break;case 33:Q=i;V=g-10;if(V<0){V=0}break;case 9:case 39:if(i<T-1){Q=i+1;V=g}else{if(g<P-1){Q=0;V=g+1}else{if(R==9&&u){K=true;z.focus();setTimeout(function(){K=false},0);D=false;B();return true}else{return false}}}break;case 40:if(g<P-1){Q=i;V=g+1}else{return false}break;case 35:Q=i;V=P-1;break;case 34:Q=i;V=g+10;if(V>P-1){V=P-1}break;default:return true}h(M(Q,V));return false}function L(){if(!D){D=true}}function r(){D=false}function M(P,Q){if(k){if(typeof k.aoData[k.aiDisplay[Q]]!="undefined"){return k.aoData[k.aiDisplay[Q]].nTr.getElementsByTagName("td")[P]}else{return null}}else{return f("tr:eq("+Q+")>td:eq("+P+")",l)[0]}}function q(P){if(k){return[f("td",P.parentNode).index(P),f("tr",P.parentNode.parentNode).index(P.parentNode)+k._iDisplayStart]}else{return[f("td",P.parentNode).index(P),f("tr",P.parentNode.parentNode).index(P.parentNode)]}}function G(P){a.documentElement.scrollTop=P;a.body.scrollTop=P}function A(P){a.documentElement.scrollLeft=P;a.body.scrollLeft=P}function F(R){var Q=0;var P=0;if(R.offsetParent){Q=R.offsetLeft;P=R.offsetTop;R=R.offsetParent;while(R){Q+=R.offsetLeft;P+=R.offsetTop;R=R.offsetParent}}return[Q,P]}function m(V){for(var S=0,P=k.aiDisplay.length;S<P;S++){var U=k.aoData[k.aiDisplay[S]].nTr;var Q=U.getElementsByTagName("td");for(var R=0,T=Q.length;R<T;R++){if(Q[R]==V){return[R,S]}}}return null}function C(T,Q,P,S){O=S;if(typeof P=="undefined"){P={}}if(typeof P.focus=="undefined"){P.focus=[0,0]}P.table=T;f(P.table).addClass("KeyTable");if(typeof P.focusClass!="undefined"){o=P.focusClass}if(typeof Q!="undefined"){k=Q}if(typeof P.initScroll=="undefined"){P.initScroll=true}if(typeof P.form=="undefined"){P.form=false}u=P.form;l=P.table.getElementsByTagName("tbody")[0];if(u){var R=a.createElement("div");z=a.createElement("input");R.style.height="1px";R.style.width="0px";R.style.overflow="hidden";if(typeof P.tabIndex!="undefined"){z.tabIndex=P.tabIndex}R.appendChild(z);P.table.parentNode.insertBefore(R,P.table.nextSibling);f(z).focus(function(){if(!K){D=true;K=false;if(typeof P.focus.nodeName!="undefined"){h(P.focus,P.initScroll)}else{h(M(P.focus[0],P.focus[1]),P.initScroll)}setTimeout(function(){z.blur()},0)}});D=false}else{if(typeof P.focus.nodeName!="undefined"){h(P.focus,P.initScroll)}else{h(M(P.focus[0],P.focus[1]),P.initScroll)}L()}f(a).bind("keydown",n);if(k){f(k.nTable).on("click","td",s)}else{f(l).on("click","td",s)}f(a).click(function(V){var W=V.target;var U=false;while(W){if(W==P.table){U=true;break}W=W.parentNode}if(!U){B()}})}var I,p;if(x===d){I=f("table.KeyTable")[0];p=null}else{if(f.isPlainObject(x)){I=x.table;p=x.datatable}else{p=new f.fn.dataTable.Api(x).settings()[0];I=p.nTable}}C(I,p,x,this)};KeyTable.version="1.2.0";f.fn.dataTable.KeyTable=KeyTable;f.fn.DataTable.KeyTable=KeyTable;return KeyTable};b(jQuery,jQuery.fn.dataTable)})(window,document);
\ No newline at end of file