From 7899b37ea0f4ad17c23e9607b30e08f425b59979 Mon Sep 17 00:00:00 2001 From: anekos Date: Tue, 2 Aug 2011 23:54:05 +0900 Subject: 通知の各エントリが表示されている状態に対応 [prev] [next] で、前/次のエントリを表示する --- google-plus-commando.js | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/google-plus-commando.js b/google-plus-commando.js index eaf2ac4..af8a73d 100644 --- a/google-plus-commando.js +++ b/google-plus-commando.js @@ -36,7 +36,7 @@ THE POSSIBILITY OF SUCH DAMAGE. // INFO {{{ let INFO = <> - 100; + }, + summary: { + get root () root.contentDocument.querySelector(S.frames.notifications.summary.root), + get visible () (!/none/.test(util.computedStyle(self.summary.root).display)) + }, + entry: { + get root () self.summary.root.nextSibling, + 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) } }; return self; @@ -556,8 +575,12 @@ let g:gplus_commando_map_menu = "m" if (Elements.viewer) return click(Elements.viewer[dir]); + let notifications = Elements.frames.notifications; + + if (notifications.visible && notifications.entry.visible) + return click(Elements.frames.notifications.entry[dir]); + let arrowTarget = (function () { - let notifications = Elements.frames.notifications; if (notifications && notifications.visible) return notifications.root.contentDocument.body; @@ -596,6 +619,10 @@ let g:gplus_commando_map_menu = "m" click(Elements.notification); }, cancel: function () { + let notifications = Elements.frames.notifications; + if (notifications && notifications.visible && notifications.entry.visible) + return click(notifications.entry.back); + for (let [, n] in Iterator(['dialog', 'viewer'])) { let e = Elements[n]; if (e && e.cancel) -- cgit v1.2.3