Changeset 38182 for lang/javascript
- Timestamp:
- 08/05/10 22:50:14 (3 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/javascript/vimperator-plugins/trunk/twittperator.js
r38181 r38182 1327 1327 }); 1328 1328 } // }}} 1329 function openLink(text) { // {{{ 1330 // TODO 複数のリンクに対応 1331 let links = []; 1332 text.replace(/https?:\/\/\S+/g, function(m) links.push(m)); 1333 if (links.length <= 0) 1329 function selectAndOpenLink(links) { // {{{ 1330 if (!links || !links.length) 1334 1331 return; 1335 1332 1336 if (links.length == 1)1337 return liberator.open(links[0] , liberator.NEW_TAB);1333 if (links.length === 1) 1334 return liberator.open(links[0][0], liberator.NEW_TAB); 1338 1335 1339 1336 commandline.input( … … 1342 1339 { 1343 1340 completer: function(context) { 1344 context.completions = [[link, link] for ([, link] in Iterator(links))];1341 context.completions = links; 1345 1342 } 1346 1343 } 1347 1344 ); 1345 } // }}} 1346 function openLink(text) { // {{{ 1347 let m = text.match(/.*?(https?:\/\/[\S]+)/g); 1348 if (!m) 1349 return; 1350 1351 let links = 1352 m.map(function (s) s.match(/^(.*?)(https?:\/\/[\S]+)/).slice(1)) . 1353 map(function (ss) (ss.reverse(), ss.map(String.trim))) 1354 selectAndOpenLink(links); 1348 1355 } // }}} 1349 1356 function ReTweet(id) { // {{{
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)