View find.js
This file contains 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 ); | |
} |
View findAll.js
This file contains 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 ); | |
} |
View wrap.js
This file contains 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 ) | |
} |
View parseBool.js
This file contains 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; | |
} |
View inArray.js
This file contains 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; | |
} |
View loop.js
This file contains 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] ); | |
} | |
} |
View addEvent.js
This file contains 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