All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.resources.bower_components.datatables.net-autofill.js.dataTables.autoFill.min.js Maven / Gradle / Ivy

There is a newer version: 0.66.0.1
Show newest version
/*! AutoFill 2.3.1
 * ©2008-2018 SpryMedia Ltd - datatables.net/license
 */
(function(a){if(typeof define==="function"&&define.amd){define(["jquery","datatables.net"],function(b){return a(b,window,document)})}else{if(typeof exports==="object"){module.exports=function(b,c){if(!b){b=window}if(!c||!c.fn.dataTable){c=require("datatables.net")(b,c).$}return a(c,b,b.document)}}else{a(jQuery,window,document)}}}(function(g,e,a,h){var f=g.fn.dataTable;var c=0;var d=function(j,i){if(!f.versionCheck||!f.versionCheck("1.10.8")){throw ("Warning: AutoFill requires DataTables 1.10.8 or greater")}this.c=g.extend(true,{},f.defaults.autoFill,d.defaults,i);this.s={dt:new f.Api(j),namespace:".autoFill"+(c++),scroll:{},scrollInterval:null,handle:{height:0,width:0},enabled:false};this.dom={handle:g('
'),select:{top:g('
'),right:g('
'),bottom:g('
'),left:g('
')},background:g('
'),list:g('
'+this.s.dt.i18n("autoFill.info","")+"
    "),dtScroll:null,offsetParent:null};this._constructor()};g.extend(d.prototype,{enabled:function(){return this.s.enabled},enable:function(i){var j=this;if(i===false){return this.disable()}this.s.enabled=true;this._focusListener();this.dom.handle.on("mousedown",function(k){j._mousedown(k);return false});return this},disable:function(){this.s.enabled=false;this._focusListenerRemove();return this},_constructor:function(){var k=this;var j=this.s.dt;var i=g("div.dataTables_scrollBody",this.s.dt.table().container());j.settings()[0].autoFill=this;if(i.length){this.dom.dtScroll=i;if(i.css("position")==="static"){i.css("position","relative")}}if(this.c.enable!==false){this.enable()}j.on("destroy.autoFill",function(){k._focusListenerRemove()})},_attach:function(l){var k=this.s.dt;var i=k.cell(l).index();var m=this.dom.handle;var j=this.s.handle;if(!i||k.columns(this.c.columns).indexes().indexOf(i.column)===-1){this._detach();return}if(!this.dom.offsetParent){this.dom.offsetParent=g(k.table().node()).offsetParent()}if(!j.height||!j.width){m.appendTo("body");j.height=m.outerHeight();j.width=m.outerWidth()}var n=this._getPosition(l,this.dom.offsetParent);this.dom.attachedTo=l;m.css({top:n.top+l.offsetHeight-j.height,left:n.left+l.offsetWidth-j.width}).appendTo(this.dom.offsetParent)},_actionSelector:function(j){var l=this;var k=this.s.dt;var o=d.actions;var n=[];g.each(o,function(p,q){if(q.available(k,j)){n.push(p)}});if(n.length===1&&this.c.alwaysAsk===false){var i=o[n[0]].execute(k,j);this._update(i,j)}else{var m=this.dom.list.children("ul").empty();n.push("cancel");g.each(n,function(q,p){m.append(g("
  • ").append('
    '+o[p].option(k,j)+"
    ").append(g('
    ').append(g('").on("click",function(){var r=o[p].execute(k,j,g(this).closest("li"));l._update(r,j);l.dom.background.remove();l.dom.list.remove()}))))});this.dom.background.appendTo("body");this.dom.list.appendTo("body");this.dom.list.css("margin-top",this.dom.list.outerHeight()/2*-1)}},_detach:function(){this.dom.attachedTo=null;this.dom.handle.detach()},_drawSelection:function(q,r){var m=this.s.dt;var k=this.s.start;var u=g(this.dom.start);var p={row:this.c.vertical?m.rows({page:"current"}).nodes().indexOf(q.parentNode):k.row,column:this.c.horizontal?g(q).index():k.column};var o=m.column.index("toData",p.column);var l=g(m.cell(":eq("+p.row+")",o).node());if(!m.cell(l).any()){return}if(m.columns(this.c.columns).indexes().indexOf(o)===-1){return}this.s.end=p;var s,i,n,v,w,j;s=k.row=j;l--){k.push(l)}}return k},_shiftScroll:function(o){var n=this;var i=this.s.dt;var r=this.s.scroll;var q=false;var p=5;var k=65;var s=o.pageY-a.body.scrollTop,u=o.pageX-a.body.scrollLeft,j,t,l,m;if(sr.windowHeight-k){j=p}}if(ur.windowWidth-k){t=p}}if(r.dtTop!==null&&o.pageYr.dtTop+r.dtHeight-k){l=p}}if(r.dtLeft!==null&&o.pageXr.dtLeft+r.dtWidth-k){m=p}}if(j||t||l||m){r.windowVert=j;r.windowHoriz=t;r.dtVert=l;r.dtHoriz=m;q=true}else{if(this.s.scrollInterval){clearInterval(this.s.scrollInterval);this.s.scrollInterval=null}}if(!this.s.scrollInterval&&q){this.s.scrollInterval=setInterval(function(){if(r.windowVert){a.body.scrollTop+=r.windowVert}if(r.windowHoriz){a.body.scrollLeft+=r.windowHoriz}if(r.dtVert||r.dtHoriz){var v=n.dom.dtScroll[0];if(r.dtVert){v.scrollTop+=r.dtVert}if(r.dtHoriz){v.scrollLeft+=r.dtHoriz}}},20)}},_update:function(s,r){if(s===false){return}var l=this.s.dt;var p;this._emitEvent("preAutoFill",[l,r]);this._editor(r);var m=this.c.update!==null?this.c.update:this.c.editor?false:true;if(m){for(var o=0,q=r.length;o')},execute:function(l,s,m){var p=s[0][0].data*1;var q=g("input",m).val()*1;for(var o=0,r=s.length;o"+i[0][0].label+"")},execute:function(p,m,o){var q=m[0][0].data;for(var n=0,k=m.length;n1&&i[0].length>1},option:function(j,i){return j.i18n("autoFill.fillHorizontal","Fill cells horizontally")},execute:function(p,m,o){for(var n=0,k=m.length;n1&&i[0].length>1},option:function(j,i){return j.i18n("autoFill.fillVertical","Fill cells vertically")},execute:function(p,m,o){for(var n=0,k=m.length;n




  • © 2015 - 2025 Weber Informatics LLC | Privacy Policy