guys
I'm running a wonderful website with prototype, the israeli chess website at
www.ichess.co.ilhere are some stuff that I think are missing from prototype :
1. mouse wheel event (I found some custom code that did it)
2. ajax abort method
3. error handling (cross browser code that catches errors and returns an object with the URL, stack trace,etc)
I think its even possible that the entire prototype code will be run under try catch so that error can be reported even
from within prototype
4. some more string methods here are some custom stuff that I added in my scripts (for ideas...)
5. some more array methods (like get from array with a field/id in the objects in the array, check if array contains a value, etc)
below - some functions that I added for ideas...
Thanks
Ran
String.prototype.trim = function() {
return this.replace(/^\s+|\s+$/g,"");
};
String.prototype.ltrim = function() {
return this.replace(/^\s+/,"");
};
String.prototype.rtrim = function() {
return this.replace(/\s+$/,"");
};
String.prototype.removeLastChar = function() {
return this.substr(0, this.length - 1);
};
function isValid(object)
{
return (object !== null) && (object !== undefined);
}
function isValidString(str)
{
return (isValid(str) && (str !== ""));
}
function isValidEmail(str)
{
if (! isValidString(str)) {
return false;
}
return (/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,4}$/).test(str);
}