diff options
-rw-r--r-- | README.md | 29 | ||||
-rw-r--r-- | _libly.js | 2 | ||||
-rw-r--r-- | lo.js | 14 | ||||
-rw-r--r-- | prevent-pseudo-domain.js | 2 | ||||
-rw-r--r-- | twittperator.js | 12 | ||||
-rw-r--r-- | twittperator/twsidebar.tw | 24 | ||||
-rw-r--r-- | twittperator/twsidebar/chrome/content/twsidebar.css | 23 | ||||
-rw-r--r-- | umihara.js | 2 | ||||
-rw-r--r-- | zip-de-download.js | 4 |
9 files changed, 88 insertions, 24 deletions
diff --git a/README.md b/README.md new file mode 100644 index 0000000..73cc3b6 --- /dev/null +++ b/README.md @@ -0,0 +1,29 @@ +# Vimperator Plugins + +This is a set of plugins that will work with Vimperator + +While Vimperator offers already lots of cool features, we cannot and don't want to include every feature directly in the core. Therefore you can enhance the Vimperator experience by adding plugins which add new commands or mappings. Install these plugins by copying them to the ~/.vimperator/plugin/ directory (or %HOME%\vimperator\plugin on Windows) unless noted differently. + +> ###### Note: Master is valid only for versions Firefox 19.* and lower. +> ##### For versions Firefox 20.* and higher, please check the branch 3.6 [here](https://github.com/vimpr/vimperator-plugins/tree/3.6) + +## Plugins +### feedSomeKeys_3.js + +You can add the following commands to your .vimperatorrc file + + +``` +:command! -nargs=+ lazy autocmd VimperatorEnter .* <args> +:lazy fmaps -u='mail\.google\.com/mail' c / j k n p o u e x s r a # [ ] ? gi gs gt gd ga gc +:lazy fmaps -u='mail\.google\.com/mail/.*/[0-9a-f]+$' c / j,n k,p n,j p,k o u e x s r a # [ ] ? gi gs gt gd ga gc +:lazy fmaps -u='www\.google\.co\.jp/reader' -events=vkeypress j k n p m s v A r S N P X O gh ga gs gt gu u / ? J K +:lazy fmaps -u='(fastladder|livedoor)\.com/reader' j k s a p o v c i,p <Space> <S-Space> z b < > q w e,g +:lazy fmaps -u='https?://www\.rememberthemilk\.com/home/' j k m i c t ? d F,f G,g S,s L,l Y,y H,h M,m <Del> <C-S-Left> <C-S-Right> +:lazy fmaps -u='http://code.google.com/p/vimperator-labs/issues/list' o j k +:lazy fmaps -u='http://code.google.com/p/vimperator-labs/issues/detail' u +``` + +> Note: If you are planning to add them via command line, then remove the "lazy" + + @@ -247,7 +247,7 @@ libly.$U = {//{{{ let pluginPath; Error('hoge').stack.split(/\n/).some( function (s) - let (m = s.match(/^(?:\(\))?@chrome:\/\/liberator\/content\/liberator\.js -> (.+):\d+$/)) + let (m = s.match(/-> liberator:\/\/template\/chrome:\/\/liberator\/content\/liberator\.js -> (.+):\d+$/)) (m && (pluginPath = m[1].replace(/\?.*$/, ''))) ); return pluginPath; @@ -39,7 +39,7 @@ let PLUGIN_INFO = xml` <name lang="ja">Link Opener</name> <description>Link Opener</description> <description lang="ja">リンクを開く</description> - <version>2.3.2</version> + <version>2.4.0</version> <author mail="anekos@snca.net" homepage="http://d.hatena.ne.jp/nokturnalmortum/">anekos</author> <license>new BSD License (Please read the source code comments of this plugin)</license> <license lang="ja">修正BSDライセンス (ソースコードのコメントを参照してください)</license> @@ -53,7 +53,7 @@ let PLUGIN_INFO = xml` // }}} // INFO {{{ let INFO = xml` - <plugin name="link-opener" version="2.3.2" + <plugin name="link-opener" version="2.4.0" href="http://github.com/vimpr/vimperator-plugins/blob/master/lo.js" summary="Link Opener" lang="en-US" @@ -102,7 +102,7 @@ let INFO = xml` </description> </item> </plugin> - <plugin name="link-opener" version="2.3.2" + <plugin name="link-opener" version="2.4.0" href="http://github.com/vimpr/vimperator-plugins/blob/master/lo.js" summary="Link Opener" lang="ja" @@ -247,6 +247,11 @@ let INFO = xml` if (!links.length) return; + if (args['-copy']) { + util.copyToClipboard(links.map(function (it) it.href).join("\n")); + return; + } + liberator.open(links[0].href, where); if (links.length <= 1) @@ -270,7 +275,8 @@ let INFO = xml` options: [ [['-interval', '-i'], commands.OPTION_INT], [['-where', '-w'], commands.OPTION_STRING, null, WHERE_COMPLETIONS], - [['-include-current', '-I'], commands.OPTION_NOARG] + [['-include-current', '-I'], commands.OPTION_NOARG], + [['-copy', '-c'], commands.OPTION_NOARG] ], completer: function (context, args) { context.title = ['URL', 'Text Content']; diff --git a/prevent-pseudo-domain.js b/prevent-pseudo-domain.js index 7981874..0e4124c 100644 --- a/prevent-pseudo-domain.js +++ b/prevent-pseudo-domain.js @@ -5,7 +5,7 @@ } function isWord (s) { - return /^[^\s\.]+$/i.test(s); + return /^[^\s\.\/]+$/i.test(s); } function isIPAddress (s) { diff --git a/twittperator.js b/twittperator.js index ef28958..604503c 100644 --- a/twittperator.js +++ b/twittperator.js @@ -2,7 +2,7 @@ * The MIT License * * Copyright (c) 2010 teramako - * Copyright (c) 2010-2012 anekos + * Copyright (c) 2010-2013 anekos * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -25,7 +25,7 @@ // INFO {{{ let INFO = xml` - <plugin name="Twittperator" version="1.19.0" + <plugin name="Twittperator" version="1.19.1" href="https://github.com/vimpr/vimperator-plugins/raw/master/twittperator.js" summary="Twitter Client using OAuth and Streaming API"> <author email="teramako@gmail.com" href="http://d.hatena.ne.jp/teramako/">teramako</author> @@ -174,7 +174,7 @@ let INFO = xml` Write the plugin. </p> </plugin> - <plugin name="Twittperator" version="1.19.0" + <plugin name="Twittperator" version="1.19.1" href="https://github.com/vimpr/vimperator-plugins/raw/master/twittperator.js" lang="ja" summary="OAuth/StreamingAPI対応Twitterクライアント"> @@ -1642,7 +1642,7 @@ let INFO = xml` }); }, // }}} favorite: function(id) { // {{{ - tw.jsonPost("favorites/create/" + id, null, function(res) { + tw.jsonPost("favorites/create", {id: id}, function(res) { res = Utils.fixStatusObject(res); Twittperator.echo("fav: " + res.user.name + " " + res.text) }); @@ -2043,7 +2043,7 @@ let INFO = xml` liberator.echo(new TemplateXML(html), true); }, // }}} showTwitterMentions: function(arg) { // {{{ - tw.jsonGet("statuses/mentions", null, function(res) { + tw.jsonGet("statuses/mentions_timeline", null, function(res) { Twittperator.showTL(res.map(Utils.fixStatusObject)); }); }, // }}} @@ -2655,7 +2655,7 @@ let INFO = xml` proxyPort: gv.twittperator_proxy_port, screenName: gv.twittperator_screen_name, apiURLBase: "http" + (!!gv.twittperator_use_ssl_connection_for_api_ep ? "s" : "") + - "://api.twitter.com/" + (gv.twittperator_twitter_api_version || 1) + "/", + "://api.twitter.com/" + (gv.twittperator_twitter_api_version || "1.1") + "/", trackWords: gv.twittperator_track_words, count: (gv.twittperator_count || 20), lang: (gv.twittperator_lang || ''), diff --git a/twittperator/twsidebar.tw b/twittperator/twsidebar.tw index f0c0cba..ee8ba3b 100644 --- a/twittperator/twsidebar.tw +++ b/twittperator/twsidebar.tw @@ -126,7 +126,7 @@ liberator.modules.TWAnekoSB = ANekoSB = (function () { let xml; let sbWidth = getSidebarWindow().document.width; let richlistitemClasses = [className('tweet-panel'), className('tweet-' + t.type)]; - let nameClass = t.protected ? className('tweet-protected') : ''; + let nameClass = className('item-name') + ' ' + (t.protected ? className('tweet-protected') : ''); xml = <richlistitem id={t.id} @@ -136,17 +136,21 @@ liberator.modules.TWAnekoSB = ANekoSB = (function () { "width: " + px(sbWidth - 100) + ' !important' ].join(';')} xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> - <hbox> - <vbox> + <hbox flex="1"> + <vbox width="48"> <image src={t.img} height="48" width="48" /> </vbox> - <vbox style={"width: " + (sbWidth - 48 - 35) + "px !important"}> + <vbox flex="1"> + <hbox flex="1"> + <label flex="2" class={nameClass}>{escapeBreakers(t.name)}</label> + <spacer hidden={!(t.sub || t.time)} /> + <description flex="1" class={className('item-time-and-sub')} hidden={!(t.sub || t.time)}>{escapeBreakers(t.sub || t.time)}</description> + </hbox> + <description flex="1" class={className('item-text')}>{escapeBreakers(t.text)}</description> <hbox> - <label class={nameClass} style="font-weight: bold">{escapeBreakers(t.name)}</label> - <spacer flex="1"/> - <label>{t.sub || ''}</label> + <description flex="1" class={className('item-sub')} hidden={!t.sub}>{escapeBreakers(t.sub || '')}</description> + <description flex="1" class={className('item-time')} hidden={!t.time}>{escapeBreakers(t.time || '')}</description> </hbox> - <description width="100%">{escapeBreakers(t.text)}</description> </vbox> </hbox> </richlistitem>; @@ -393,8 +397,8 @@ liberator.modules.TWAnekoSB = ANekoSB = (function () { t.text += ' [\u5730\u57DF: ' + msg.user.location + ']'; } - if (!t.sub && msg.created_at) { - t.sub = new Date(msg.created_at).toLocaleTimeString().replace(/:\d+$/,'');; + if (msg.created_at) { + t.time = new Date(msg.created_at).toLocaleTimeString().replace(/:\d+$/,'');; } if (real && dummy) { diff --git a/twittperator/twsidebar/chrome/content/twsidebar.css b/twittperator/twsidebar/chrome/content/twsidebar.css index 7081ea2..e431b3b 100644 --- a/twittperator/twsidebar/chrome/content/twsidebar.css +++ b/twittperator/twsidebar/chrome/content/twsidebar.css @@ -52,3 +52,26 @@ .tw-anekos-sb-plugin-tweet-follow-my { background-color: lightsalmon !important; } + +.tw-anekos-sb-plugin-item-name { + font-weight: bold; +} + +.tw-anekos-sb-plugin-item-text { + word-break: break-all; +} + +.tw-anekos-sb-plugin-item-sub { + background-color: pink; + font-size: 80%; +} + +.tw-anekos-sb-plugin-item-time { + font-size: 80%; +} + +.tw-anekos-sb-plugin-item-time-and-sub { + font-size: 80%; + display: none; +} + @@ -156,7 +156,7 @@ let PLUGIN_INFO = xml` if (req.readyState == 4 && req.status == 200) { let html = req.responseText; let doc = plugins.libly.$U.createHTMLDocument(html); - let a = doc.querySelector('tbody.yjM > tr > td > a[href^="http://rd.yahoo.co.jp"]'); + let a = doc.querySelector('tbody.yjM > tr > td > a[href^="http://stocks.finance.yahoo.co.jp"]'); if (a) { let tr = a.parentNode.parentNode; liberator.__tr = tr; diff --git a/zip-de-download.js b/zip-de-download.js index a6d8a97..f7a25b4 100644 --- a/zip-de-download.js +++ b/zip-de-download.js @@ -350,6 +350,8 @@ let SITE_INFO = [ completer: liberator.modules.completion.file }, true); - util.extend(__context__, self); + for (let [k, v] in Iterator(self)) { + __context__[k] = v; + } })(); // vim: sw=2 ts=2 et: |