diff options
author | anekos | 2011-08-04 23:43:01 +0900 |
---|---|---|
committer | anekos | 2011-08-04 23:43:01 +0900 |
commit | edd6cd96be6f8c0d73830ff41bdd6ad10d585707 (patch) | |
tree | 77907c549b512230205e2ed5b9afe59d337fbf2f /google-plus-commando.js | |
parent | 1536bf48d3b766fb12faed7d3d1d34441a137c37 (diff) | |
download | vimperator-plugins-edd6cd96be6f8c0d73830ff41bdd6ad10d585707.tar.bz2 |
[open] マッピング追加
Diffstat (limited to 'google-plus-commando.js')
-rw-r--r-- | google-plus-commando.js | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/google-plus-commando.js b/google-plus-commando.js index 26a6e8e..dfdd2ef 100644 --- a/google-plus-commando.js +++ b/google-plus-commando.js @@ -36,7 +36,7 @@ THE POSSIBILITY OF SUCH DAMAGE. // INFO {{{ let INFO = <> - <plugin name="GooglePlusCommando" version="2.0.7" + <plugin name="GooglePlusCommando" version="2.1.0" href="http://github.com/vimpr/vimperator-plugins/blob/master/google-plus-commando.js" summary="The handy commands for Google+" lang="en-US" @@ -112,6 +112,7 @@ let INFO = <dt>unfold</dt> <dd>Unfold something on current entry.</dd> <dt>menu</dt> <dd>Open the menu of current entry.</dd> <dt>mute</dt> <dd>Mute current entry.</dd> + <dt>open</dt> <dd>Open something on current entry.</dd> </dl> </p> <p>rc file example</p> @@ -680,6 +681,19 @@ let g:gplus_commando_map_menu = "m" if (notifications && notifications.visible && notifications.entry.visible) return click(notifications.entry.mute); click(Elements.currentEntry.menu.mute); + }, + open: function () { + let ce = Elements.currentEntry; + if (!ce) + return; + let dct = ce.root.querySelector('div[data-content-type]'); + let links = dct.parentNode.querySelectorAll('a'); + if (links.length < 1) { + click(dct); + return; + } + if (links.length === 1) + click(links[0]); } }; @@ -722,7 +736,7 @@ let g:gplus_commando_map_menu = "m" ); } - 'comment plusone share next prev post yank notification cancel unfold menu mute'.split(/\s/).forEach(defineMapping.bind(null, modes.NORMAL)); + 'comment plusone share next prev post yank notification cancel unfold menu mute open'.split(/\s/).forEach(defineMapping.bind(null, modes.NORMAL)); 'submit'.split(/\s/).forEach(defineMapping.bind(null, modes.INSERT)); mappings.addUserMap( |