projects
/
euphorik.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
MOD avancement dans la Grande Restructuration
[euphorik.git]
/
js
/
euphorik.js
diff --git
a/js/euphorik.js
b/js/euphorik.js
index
28cba42
..
8c13841
100755
(executable)
--- a/
js/euphorik.js
+++ b/
js/euphorik.js
@@
-67,16
+67,22
@@
var euphorik = {}
Object.prototype.each = function(f) {
\r
for (var k in this) {
\r
if (this.hasOwnProperty(k)) {
\r
Object.prototype.each = function(f) {
\r
for (var k in this) {
\r
if (this.hasOwnProperty(k)) {
\r
- f(k, this[k])
\r
+ f(k, this[k])
;
\r
}
\r
}
\r
}
\r
}
\r
-}
\r
+}
;
\r
\r
Array.prototype.each = function(f) {
\r
for (var i = 0; i < this.length; i++) {
\r
\r
Array.prototype.each = function(f) {
\r
for (var i = 0; i < this.length; i++) {
\r
- f(i, this[i])
\r
+ f(i, this[i])
;
\r
}
\r
}
\r
-}
\r
+};
\r
+
\r
+Array.prototype.map = function(f) {
\r
+ for (var i = 0; i < this.length; i++) {
\r
+ this[i] = f(this[i])
\r
+ }
\r
+};
\r
String.prototype.trim = function() {
return jQuery.trim(this) // anciennement : this.replace(/^\s+|\s+$/g, "");
String.prototype.trim = function() {
return jQuery.trim(this) // anciennement : this.replace(/^\s+|\s+$/g, "");