2016-04-22 08:27:58 +00:00
function $ ( a ) { return document . querySelector ( a ) } function $$ ( a ) { return document . querySelectorAll ( a ) } Element . prototype . getData = function ( a ) { return "undefined" == typeof this . dataset ? ! 1 : this . dataset . hasOwnProperty ( a ) ? this . dataset [ a ] : ! 1 } ; Element . prototype . addClass = function ( a ) { var b = this . className . split ( " " ) ; - 1 < b . indexOf ( a ) || ( b . push ( a ) , this . className = b . join ( " " ) . trim ( ) ) } ;
2016-04-25 14:18:50 +00:00
Element . prototype . remClass = function ( a ) { var b = this . className . split ( " " ) ; a = b . indexOf ( a ) ; - 1 != a && ( b = b . slice ( 0 , a ) . concat ( b . slice ( a + 1 ) ) , this . className = b . join ( " " ) . trim ( ) ) } ; NodeList . prototype . indexOf = HTMLCollection . prototype . indexOf = function ( a ) { for ( var b = 0 ; b < this . length ; b ++ ) if ( this [ b ] == a ) return b ; return - 1 } ; Element . prototype . anim = function ( a , b ) { var c = this ; c . addClass ( a ) ; setTimeout ( function ( ) { c . remClass ( a ) } , b ) } ; var _includes = [ ] , _includeTags = [ ] ;
function include ( a , b , c ) { a = "string" === typeof a ? a : null ; b = "function" === typeof b ? b : function ( ) { console . log ( "[x] " + a + " loaded" ) } ; if ( null == a ) return ! 1 ; if ( "boolean" === typeof c && c ) { b = _includes . indexOf ( a ) ; if ( - 1 == b ) return ! 1 ; document . head . removeChild ( _includeTags [ b ] ) ; _includes . splice ( b , 1 ) ; _includeTags . splice ( b , 1 ) } else { if ( - 1 < _includes . indexOf ( a ) ) return b ( ) , ! 0 ; c = document . createElement ( "script" ) ; c . type = "text/javascript" ; c . src = a ; document . head . appendChild ( c ) ; _includes . push ( a ) ; _includeTags . push ( c ) ; c . onload = b } return ! 0 }
2016-05-08 13:25:20 +00:00
function diff ( a , b ) { var c = [ ] , d ; for ( d in a ) null != b [ d ] && null != a [ d ] && ( typeof a [ d ] !== typeof b [ d ] ? c . push ( d ) : a [ d ] instanceof Object && b [ d ] instanceof Object ? 0 < diff ( a [ d ] , b [ d ] ) . length && c . push ( d ) : a [ d ] != b [ d ] && c . push ( d ) ) ; return c } var format _number = new formatChecker ( null , "0i ii ii ii ii" ) ;