Skip to content

russdogg/toolbox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

Russdesigns Toolbox » Version 0.1

This is my first attempt at putting together a javascript toolkit all in one place.

Email validation:

function checkMail(email){
var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (filter.test(email)) {
	return true;
	}
	return false;
}    

iPhone style orientation change detection:

window.addEventListener('load', setOrientation, false);
window.addEventListener('orientationchange', setOrientation, false);

function setOrientation() {
	var orient = Math.abs(window.orientation) === 90 ? 'landscape' : 'portrait';
	var cl = document.body.className;
	cl = cl.replace(/portrait|landscape/, orient);
	document.body.className = cl;
}

Some people seem to like definition lists

Lower cost
The new version of this product costs significantly less than the previous one!
Easier to use
We've changed the product so that it's much easier to use!

Table for two

IDNameRank
1Tom Preston-WernerAwesome
2Albert EinsteinNearly as awesome

Crazy linking action

I get 10 times more traffic from [Google] 1 than from [Yahoo] 2 or [MSN] 3.

About

JS toolbox of random helper scripts

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published