Changeset 23331 for lang/javascript
- Timestamp:
- 11/12/08 15:10:09 (5 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/javascript/vimperator-plugins/trunk/i_love_echo.js
r23278 r23331 132 132 }, 133 133 __noSuchMethod__: function(name, args){ 134 return this.value[name].apply(this.value, args);134 return $(this.value[name].apply(this.value, args)); 135 135 } 136 136 }; … … 149 149 get encodeURICompoenent() $(encodeURIComponent(this.value)), 150 150 get MD5Hash(){ 151 varconverter = Cc["@mozilla.org/intl/scriptableunicodeconverter"].createInstance(Ci.nsIScriptableUnicodeConverter);151 context converter = Cc["@mozilla.org/intl/scriptableunicodeconverter"].createInstance(Ci.nsIScriptableUnicodeConverter); 152 152 converter.charset = "UTF-8"; 153 153 var result = {}; … … 173 173 return null; 174 174 } 175 }, 176 evaluate: function(doc,context){ 177 if (!doc) doc = content.document; 178 if (!context) context = doc; 179 var result = []; 180 var nodes = doc.evaluate(this.value, context, null, XPathResult.ORDERED_NODE_ITERATOR_TYPE, null); 181 var node; 182 while (node = nodes.iterateNext()) { 183 result.push(node); 184 } 185 return $(result); 175 186 } 176 187 }); … … 199 210 this.value.unshift(arg); 200 211 return this; 201 } 212 }, 213 get first() $(this.value[0]), 214 get last() $(this.value[this.length - 1]) 202 215 }); 203 216 // }}}
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)