Changeset 36881
- Timestamp:
- 03/01/10 21:22:31 (3 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/javascript/vimperator-plugins/trunk/feedSomeKeys_3.js
r36880 r36881 134 134 }; 135 135 136 function id (v) 137 v; 138 139 function or (list, func) 140 let ([head, tail] = list) 141 ((func || v)(head) || (tail && or(tail, func))); 142 136 143 function getFrames () { 137 144 function bodyCheck (content) … … 144 151 get(content); 145 152 return result; 153 } 154 155 function fromXPath (doc, xpath) { 156 let result = util.evaluateXPath(xpath, doc); 157 return result.snapshotLength && result.snapshotItem(0); 146 158 } 147 159 … … 197 209 args['description'] || 'by feedSomeKeys_3.js', 198 210 function () { 211 let win = document.commandDispatcher.focusedWindow; 199 212 let frames = getFrames(); 200 let elem = document.commandDispatcher.focusedWindow;213 let elem = win; 201 214 202 215 if (typeof args['-frame'] !== 'undefined') { 203 216 frames = [frames[args['-frame']]]; 204 217 elem = frames[0]; 218 } 219 220 if (args['-xpath']) 221 elem = or(frames, function (f) fromXPath(args['-xpath'])); 222 223 if (!elem) { 224 liberator.log('feedSomeKeys_3: Not found target element'); 225 elem = win; 205 226 } 206 227
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)