-
Notifications
You must be signed in to change notification settings - Fork 46
/
Copy pathquo.js
8 lines (8 loc) · 2.8 KB
/
quo.js
1
2
3
4
5
6
7
8
/**
* QuoJS - Micro #JavaScript Library for Mobile Devices.
* @version v3.0.7
* @link http://quojs.tapquo.com
* @author Javi Jimenez Villar (@soyjavi) (https://twitter.com/soyjavi)
* @license MIT
*/
(function(){"use strict";var e;e=function(){var e,t,n,r,o,u,l,i,c,a,f,d,s,p,y,h,m;return r=[],i=Object.prototype,l=/^\s*<(\w+|!)[^>]*>/,n=[1,9,11],t=/^\.([\w-]+)$/,u=/^#[\w\d-]+$/,f=/^[\w-]+$/,c=document.createElement("table"),a=document.createElement("tr"),o={tr:document.createElement("tbody"),tbody:c,thead:c,tfoot:c,td:a,th:a,"*":document.createElement("div")},e=function(t,n){var r;return t?"function"===e.toType(t)?e(document).ready(t):(r=y(t,n),h(r,t)):h()},e.query=function(e,n){var r;return t.test(n)?r=e.getElementsByClassName(n.replace(".","")):f.test(n)?r=e.getElementsByTagName(n):u.test(n)&&e===document?(r=e.getElementById(n.replace("#","")),r||(r=[])):r=e.querySelectorAll(n),r.nodeType?[r]:Array.prototype.slice.call(r)},e.extend=function(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){var n,r;r=[];for(n in t)r.push(e[n]=t[n]);return r}),e},e.toType=function(e){var t;return t=i.toString.call(e).match(/\s([a-z|A-Z]+)/),t.length>1?t[1].toLowerCase():"object"},e.each=function(t,n){var r,o,u,l,i;if(o=void 0,l=void 0,"array"===e.toType(t))for(o=u=0,i=t.length;i>u;o=++u)r=t[o],n.call(r,o,r)===!1;else for(l in t)n.call(t[l],l,t[l])===!1;return t},e.map=function(t,n){var r,o,u,l;if(l=[],r=void 0,o=void 0,"array"===e.toType(t))for(r=0;r<t.length;)u=n(t[r],r),null!=u&&l.push(u),r++;else for(o in t)u=n(t[o],o),null!=u&&l.push(u);return s(l)},e.mix=function(){var e,t,n,r,o;for(n={},e=0,r=arguments.length;r>e;){t=arguments[e];for(o in t)m(t,o)&&void 0!==t[o]&&(n[o]=t[o]);e++}return n},h=function(e,t){return null==t&&(t=""),e=e||r,e.selector=t,e.__proto__=h.prototype,e},y=function(t,r){var o,u;return o=null,u=e.toType(t),"array"===u?o=d(t):"string"===u&&l.test(t)?(o=p(t.trim(),RegExp.$1),t=null):"string"===u?(o=e.query(document,t),r&&(o=1===o.length?e.query(o[0],r):e.map(function(){return e.query(o,r)}))):(n.indexOf(t.nodeType)>=0||t===window)&&(o=[t],t=null),o},p=function(t,n){var r;return null==n&&(n="*"),n in o||(n="*"),r=o[n],r.innerHTML=""+t,e.each(Array.prototype.slice.call(r.childNodes),function(){return r.removeChild(this)})},d=function(e){return e.filter(function(e){return null!=e?e:void 0})},s=function(e){return e.length>0?r.concat.apply(r,e):e},m=function(e,t){return i.hasOwnProperty.call(e,t)},h.prototype=e.fn={},e.fn.each=function(e){return this.forEach(function(t,n){return e.call(t,n,t)}),this},e.fn.filter=function(t){return e(r.filter.call(this,function(n){return n.parentNode&&e.query(n.parentNode,t).indexOf(n)>=0}))},e.fn.forEach=r.forEach,e.fn.indexOf=r.indexOf,e.version="3.0.7",e}(),this.Quo=this.$$=e,"undefined"!=typeof module&&null!==module&&(module.exports=e)}).call(this);