This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function find( selector , context = null ) | |
| { | |
| return ( context || document ).querySelector( selector ); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function findAll( selector , context = null ) | |
| { | |
| return ( context || document ).querySelectorAll( selector ); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function wrap( ellement , wrapper ) | |
| { | |
| ellement.parentNode.insertBefore( wrapper , ellement ) | |
| wrapper.appendChild( ellement ) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function parseBool( value ) | |
| { | |
| return value == "true" || value == true || value == 1 ? true : false; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function inArray( needle , haystack ) | |
| { | |
| for( var i = 0 ; i < haystack.length ; i++ ) | |
| { | |
| if( haystack[i] == needle ) return i; | |
| } | |
| return -1; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function loop( list , callback ) | |
| { | |
| for ( var i = 0 ; i < list.length ; i++ ) | |
| { | |
| callback( list[i] ); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function addEvent( ellement , type , callback ) | |
| { | |
| if ( ellement.attachEvent ) | |
| { | |
| ellement.attachEvent( 'on' + type , callback ); | |
| } | |
| else | |
| { | |
| ellement.addEventListener( type , callback ); | |
| } |
OlderNewer