[ Index ] |
|
Code source de vtiger CRM 5.0.2 |
1 var Hash = { 2 _each: function(iterator) { 3 for (key in this) { 4 var value = this[key]; 5 if (typeof value == 'function') continue; 6 7 var pair = [key, value]; 8 pair.key = key; 9 pair.value = value; 10 iterator(pair); 11 } 12 }, 13 14 keys: function() { 15 return this.pluck('key'); 16 }, 17 18 values: function() { 19 return this.pluck('value'); 20 }, 21 22 merge: function(hash) { 23 return $H(hash).inject($H(this), function(mergedHash, pair) { 24 mergedHash[pair.key] = pair.value; 25 return mergedHash; 26 }); 27 }, 28 29 toQueryString: function() { 30 return this.map(function(pair) { 31 return pair.map(encodeURIComponent).join('='); 32 }).join('&'); 33 }, 34 35 inspect: function() { 36 return '#<Hash:{' + this.map(function(pair) { 37 return pair.map(Object.inspect).join(': '); 38 }).join(', ') + '}>'; 39 } 40 } 41 42 function $H(object) { 43 var hash = Object.extend({}, object || {}); 44 Object.extend(hash, Enumerable); 45 Object.extend(hash, Hash); 46 return hash; 47 }
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Feb 25 10:22:19 2007 | par Balluche grâce à PHPXref 0.7 |