classnative.js 2.86 KB
(function(){function n(e,t){var n={};jQuery.each(t||[],function(t,n){if(!(n instanceof Array))n=[n,n];e.push([n[0],"get"+n[1]],[n[0],"set"+n[1]])});jQuery.each(e,function(e,t){var r=t;if(t instanceof Array){r=t[1];t=t[0]}n[r]=jQuery.newClass({init:function(){var e=Array.prototype.slice.call(arguments);if(this.constructor==n[r])this.arguments=e;else return n[r].prototype.attach.apply(n[r],e)},arguments:[],attach:function(e){var n=arguments.length==1?this.arguments:Array.prototype.slice.call(arguments,1);if(n.length){var r=n[n.length-1];if(typeof r=="function"){n[n.length-1]=function(){var e=Array.prototype.slice.call(arguments);return r.apply(this,[this].concat(e))}}}return jQuery.fn[t].apply(jQuery(e),n)}})});return n}var e=false,t=/xyz/.test(function(){xyz})?/\b_super\b/:/.*/;jQuery.newClass=function(){};jQuery.newClass=function(n){function o(){if(!e&&o.prototype.init)return o.prototype.init.apply(this,arguments)}var r=this.prototype;e=true;var i=new this;e=false;for(var s in n){i[s]=typeof n[s]=="function"&&typeof r[s]=="function"&&t.test(n[s])?function(e,t){return function(){var n=this._super;this._super=r[e];var i=t.apply(this,arguments);this._super=n;return i}}(s,n[s]):n[s]}o.prototype=i;o.prototype.constructor=o;o.extend=arguments.callee;return o};jQuery.querySelectorAll=function(){return jQuery.apply(jQuery,arguments)};jQuery.querySelector=function(){return jQuery.querySelectorAll.apply(jQuery,arguments)[0]};jQuery.fn.forEach=function(e){return this.each(function(t){e(this,t)})};jQuery.fn.attach=function(e){var t=e.attach||(new e).attach||function(){};return this.forEach(function(n){t.call(e,n)})};jQuery.DOM=n(["prepend","append",["before","insertBefore"],["after","insertAfter"],"wrap","wrapInner","wrapAll","clone","empty","remove","replaceWith",["removeAttr","removeAttribute"],["addClass","addClassName"],["hasClass","hasClassName"],["removeClass","removeClassName"],["offset","getOffset"]],[["text","Text"],["html","HTML"],["attr","Attribute"],["val","Value"],["height","Height"],["width","Width"],["css","CSS"]]);jQuery.Traverse=n([["children","getChildElements"],["find","getDescendantElements"],["next","getNextSiblingElements"],["nextAll","getAllNextSiblingElements"],["parent","getParentElements"],["parents","getAncestorElements"],["prev","getPreviousSiblingElements"],["prevAll","getAllPreviousSiblingElements"],["siblings","getSiblingElements"],["filter","filterSelector"]]);jQuery.Events=n([["bind","addEventListener"],["unbind","removeEventListener"],["trigger","triggerEvent"],"hover","toggle"]);jQuery.fn.buildAnimation=function(e){var t=this;return{start:function(){t.animate(e)},stop:function(){t.stop()}}};jQuery.Effects=n(["show","hide","toggle","buildAnimation","queue","dequeue"]);jQuery.fn.ajax=jQuery.ajax;jQuery.Ajax=n([["ajax","request"],["load","loadAndInsert"],["ajaxSetup","setup"],["serialize","getSerializedString"],["serializeArray","getSerializedArray"]])})()