Changeset 16883 for lang/javascript/vimperator-plugins/trunk
- Timestamp:
- 07/30/08 19:41:35 (4 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/javascript/vimperator-plugins/trunk/auto_detect_link.js
r16816 r16883 3 3 // @description-ja (次|前)っぽいページへのリンクを探してジャンプ 4 4 // @license Creative Commons 2.1 (Attribution + Share Alike) 5 // @version 1.0 5 // @version 1.0.1 6 6 // ==/VimperatorPlugin== 7 7 // … … 195 195 let [_, dir, file] = urim, result = []; 196 196 // succ number 197 let (dm, succs, file = file, left = '' ) {197 let (dm, succs, file = file, left = '', temp = []) { 198 198 while (file && (dm = file.match(/\d+/))) { 199 199 let [rcontext, lcontext, lmatch] = [RegExp.rightContext, RegExp.leftContext, RegExp.lastMatch]; … … 201 201 succs = succNumber(lmatch, next); 202 202 for each (let succ in succs) { 203 result.push(dir + left + succ + rcontext);203 temp.push(dir + left + succ + rcontext); 204 204 } 205 205 left += lmatch; 206 206 file = rcontext; 207 207 } 208 } 208 result = result.concat(temp.reverse()); 209 } 210 liberator.log(result); 209 211 // succ string 210 let (dm, succs, file = file, left = '' ) {212 let (dm, succs, file = file, left = '', temp = []) { 211 213 while (file && (dm = file.match(/(^|[^a-zA-Z])([a-zA-Z])([^a-zA-Z]|$)/))) { 212 214 let [rcontext, lcontext] = [RegExp.rightContext, RegExp.leftContext]; … … 214 216 succs = succString(dm[2], next); 215 217 for each (let succ in succs) { 216 result.push(dir + left + succ + dm[3] + rcontext);218 temp.push(dir + left + succ + dm[3] + rcontext); 217 219 } 218 220 left += dm[1]; 219 221 file = dm[3] + rcontext; 220 222 } 223 result = result.concat(temp.reverse()); 221 224 } 222 225 return result; … … 266 269 for each (let it in content.document.links) { 267 270 if (linkFilter(it)) 268 result.push({frame: content, uri: it.href, text: it.textContent, element: it}); 271 result.push({ 272 type: 'link', 273 frame: content, 274 uri: it.href, 275 text: it.textContent, 276 element: it 277 }); 269 278 } 270 279 // Form … … 272 281 (function (input) { 273 282 result.push({ 283 type: 'input', 274 284 frame: content, 275 285 uri: input.form && input.form.action, … … 329 339 if (setting.useSuccPattern) { 330 340 for each (succ in succs) { 331 let link = find(links, function (link) (link.uri .indexOf(succ) >= 0));341 let link = find(links, function (link) (link.uri && (link.uri.indexOf(succ) >= 0))); 332 342 if (link) 333 343 return link;
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)