diff options
author | anekos | 2011-08-03 00:20:08 +0900 |
---|---|---|
committer | anekos | 2011-08-03 00:20:08 +0900 |
commit | 6f560121cb9e72d79d757fdaddd9b66360405ed8 (patch) | |
tree | 1823545c4500469ff8dd0d66e3b534a0be1f6a7e /google-plus-commando.js | |
parent | 7899b37ea0f4ad17c23e9607b30e08f425b59979 (diff) | |
download | vimperator-plugins-6f560121cb9e72d79d757fdaddd9b66360405ed8.tar.bz2 |
通知の各エントリが表示されているとき状態に [comment] [unfold] を対応
Diffstat (limited to 'google-plus-commando.js')
-rw-r--r-- | google-plus-commando.js | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/google-plus-commando.js b/google-plus-commando.js index af8a73d..0bc7e3a 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.2" + <plugin name="GooglePlusCommando" version="2.0.3" href="http://github.com/vimpr/vimperator-plugins/blob/master/google-plus-commando.js" summary="The handy commands for Google+" lang="en-US" @@ -213,6 +213,9 @@ let g:gplus_commando_map_menu = "m" prev: '.a-b-l-fa-wi.d-h', next: '.a-b-l-fa-vi.d-h', back: '.a-b-l-fa-Zj.d-h.fAAdub' + }, + entry: { + comment: role('button', '.a-b-f-i-W-O.a-f-i-W-O') } } }, @@ -396,13 +399,7 @@ let g:gplus_commando_map_menu = "m" for ([, e] in Iterator(A(root.querySelectorAll('a')))) if (!e.getAttribute('oid')) ][0], - get unfold () { - for (let [, sel] in Iterator(S.currentEntry.unfold)) { - let result = root.querySelector(sel); - if (result) - return result; - } - }, + get unfold () root.querySelector(S.currentEntry.unfold.join(', ')), get buttons () A(self.plusone.parentNode.querySelectorAll(S.role('button'))), get commentButton () self.buttons[0], get commentEditor () let (e = root.querySelector(S.editable)) (e && e.parentNode), @@ -469,7 +466,9 @@ let g:gplus_commando_map_menu = "m" get visible () (!/none/.test(util.computedStyle(self.entry.root).display)), get prev () root.contentDocument.querySelector(S.frames.notifications.summary.prev), get next () root.contentDocument.querySelector(S.frames.notifications.summary.next), - get back () root.contentDocument.querySelector(S.frames.notifications.summary.back) + get back () root.contentDocument.querySelector(S.frames.notifications.summary.back), + get comment () root.contentDocument.querySelector(S.frames.notifications.entry.comment), + get unfold () root.contentDocument.querySelector(S.currentEntry.unfold.join(', ')) } }; return self; @@ -597,8 +596,13 @@ let g:gplus_commando_map_menu = "m" next: withCount(function () Commands.moveEntry(true)), prev: withCount(function () Commands.moveEntry(false)), comment: function () { - let entry = Elements.currentEntry; - click(entry.comment); + let notifications = Elements.frames.notifications; + if (notifications && notifications.visible && notifications.entry.visible) { + click(notifications.entry.comment); + } else { + let entry = Elements.currentEntry; + click(entry.comment); + } PostHelp.show(); }, plusone: function () click(Elements.currentEntry.plusone), @@ -641,6 +645,10 @@ let g:gplus_commando_map_menu = "m" click(Elements.focusedEditor.button.submit); }, unfold: function () { + let notifications = Elements.frames.notifications; + if (notifications && notifications.visible && notifications.entry.visible) + return click(notifications.entry.unfold); + click(Elements.currentEntry.unfold); }, menu: function () { |