Skip to content
Snippets Groups Projects
Commit 6153ec68 authored by Commander-lol's avatar Commander-lol
Browse files

updated tinyDOM.min.js

parent 50487911
No related branches found
No related tags found
No related merge requests found
!function(){var a=function(a){return new b(a)},b=function(a){if(null===a||"undefined"==typeof a)this.length=0;else if("string"==typeof a){var b=document.querySelectorAll(a);this.length=b.length;for(var c=0;c<b.length;c++){var d=b.item(c);"undefined"==typeof d.td_prop&&(d.td_prop={isHidden:!1}),this[c]=b.item(c)}}else this[0]=a,this.length=1;return this};a.fn=b.prototype={each:function(a){for(var b=this.length;b--;)a(b,this[b],this);return this},hide:function(){return this.each(function(a,b){b.td_prop.isHidden||(b.style.td_previousDisplay=b.style.display,b.style.display="none",b.td_prop.isHidden=!0)}),this},show:function(){return this.each(function(a,b){b.td_prop.isHidden===!0&&(b.style.display="undefined"!=typeof b.style.td_previousDisplay?b.style.td_previousDisplay:"block",b.td_prop.isHidden=!1)}),this},on:function(a,b){return this.each(function(c,d){d.addEventListener(a,b)}),this},first:function(){return"undefined"!=typeof this[0]?this[0]:null},data:function(a,b){var c=this[0];return"undefined"!=typeof b?(c.setAttribute("data-"+a,b),this):c.getAttribute("data-"+a)}},a.exists=function(a){return null!==a&&"undefined"!=typeof a},a.merge=function(a,b){if(this.exists(a)&&this.exists(b)){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);return a}return null},a.ajax=function(a){var b=new XMLHttpRequest,c=this,d={method:"GET",url:"",async:!0,user:null,password:null,responseType:"text",data:null,headers:[],success:null,error:null};this.merge(d,a),b.responseType=d.responseType,b.onreadystatechange=function(){b.readyState>1&&(200===b.status?4===b.readyState&&c.exists(d.success)&&d.success(b.response,b):(b.abort(),c.exists(d.error)&&d.error({status:b.status,message:b.statusText},b)))},b.open(d.method,d.url,d.async,d.user,d.password);for(var e=0;e<d.headers.length;e++)b.setRequestHeader(d.headers[e].header,d.headers[e].value);return b.send(d.data),b},window.μ||(window.μ=a),window.mu||(window.mu=a)}();
!function(){if(Element&&!Element.prototype.matches){var a=Element.prototype;a.matches=a.matchesSelector||a.mozMatchesSelector||a.msMatchesSelector||a.oMatchesSelector||a.webkitMatchesSelector}var b=function(a){return new c(a)},c=function(a){if(null===a||"undefined"==typeof a)this.length=0;else if("string"==typeof a){var b=document.querySelectorAll(a);this.length=b.length;for(var c=0;c<b.length;c++){var d=b.item(c);"undefined"==typeof d.td_prop&&(d.td_prop={isHidden:!1}),this[c]=b.item(c)}}else this[0]=a,this.length=1;return this};b.fn=c.prototype={each:function(a){for(var b=this.length;b--;)a(b,this[b],this);return this},hide:function(){return this.each(function(a,b){b.td_prop.isHidden||(b.style.td_previousDisplay=b.style.display,b.style.display="none",b.td_prop.isHidden=!0)}),this},show:function(){return this.each(function(a,b){b.td_prop.isHidden===!0&&(b.style.display="undefined"!=typeof b.style.td_previousDisplay?b.style.td_previousDisplay:"block",b.td_prop.isHidden=!1)}),this},on:function(a,b,c){if("string"==typeof b)this.each(function(d,e){e.addEventListener(a,function(a){var d=a.target,e=!1;do d&&d.matches(b)?(c.call(d,a),e=!0):(d=d.parentNode,d&&d.matches||(e=!0));while(e!==!0)})});else{var c=b;this.each(function(b,d){d.addEventListener(a,c)})}return this},first:function(){return"undefined"!=typeof this[0]?this[0]:null},data:function(a,b){var c=this[0];return"undefined"!=typeof b?(c.setAttribute("data-"+a,b),this):c.getAttribute("data-"+a)}},b.exists=function(a){return null!==a&&"undefined"!=typeof a},b.merge=function(a,b){if(this.exists(a)&&this.exists(b)){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);return a}return null},b.ajax=function(a){var b=new XMLHttpRequest,c=this,d={method:"GET",url:"",async:!0,user:null,password:null,responseType:"text",data:null,headers:[],success:null,error:null};this.merge(d,a),b.responseType=d.responseType,b.onreadystatechange=function(){b.readyState>1&&(b.status>=200&&b.status<400?4===b.readyState&&c.exists(d.success)&&d.success(b.response,b):c.exists(b.td_hasAborted)&&b.td_hasAborted||(c.exists(d.error)&&d.error({status:b.status,message:b.statusText},b),b.td_hasAborted=!0,b.abort()))},b.open(d.method,d.url,d.async,d.user,d.password);for(var e=0;e<d.headers.length;e++)b.setRequestHeader(d.headers[e].header,d.headers[e].value);return b.send(d.data),b},window.μ||(window.μ=b),window.mu||(window.mu=b)}();
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment