aboutsummaryrefslogtreecommitdiffstats
path: root/google-plus-commando.js
diff options
context:
space:
mode:
authoranekos2011-08-03 01:37:23 +0900
committeranekos2011-08-03 01:37:23 +0900
commit90960ff039293be9f355f83a162249fdf0c3e31f (patch)
tree2bfff2be7a5999c7e3ef9a7e117e2fb54a30f384 /google-plus-commando.js
parent6f560121cb9e72d79d757fdaddd9b66360405ed8 (diff)
downloadvimperator-plugins-90960ff039293be9f355f83a162249fdf0c3e31f.tar.bz2
通知ウィンドウ内のコメント要素取得を修正
Diffstat (limited to 'google-plus-commando.js')
-rw-r--r--google-plus-commando.js15
1 files changed, 13 insertions, 2 deletions
diff --git a/google-plus-commando.js b/google-plus-commando.js
index 0bc7e3a..3dc299d 100644
--- a/google-plus-commando.js
+++ b/google-plus-commando.js
@@ -142,12 +142,18 @@ let g:gplus_commando_map_menu = "m"
function A (list)
Array.slice(list);
+ function IA (list)
+ Iterator(A(list));
+
function click (elem) {
if (!elem)
throw GPCError('elem is undefined');
buffer.followLink(elem, liberator.CURRENT_TAB);
}
+ function isDisplayed (elem)
+ (!/none/.test(util.computedStyle(elem).display));
+
function withCount (command) {
return function (count) {
if (count < 1)
@@ -215,8 +221,9 @@ let g:gplus_commando_map_menu = "m"
back: '.a-b-l-fa-Zj.d-h.fAAdub'
},
entry: {
+ entries: '.JEfY2c.a-b-l-fa-xf-df[id^=":2."]',
comment: role('button', '.a-b-f-i-W-O.a-f-i-W-O')
- }
+ },
}
},
closeButton: '.CH'
@@ -463,11 +470,13 @@ let g:gplus_commando_map_menu = "m"
},
entry: {
get root () self.summary.root.nextSibling,
+ get entries () A(root.contentDocument.querySelectorAll(S.frames.notifications.entry.entries)),
+ get current () self.entry.entries.filter(isDisplayed)[0],
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 comment () root.contentDocument.querySelector(S.frames.notifications.entry.comment),
+ get comment () self.entry.current.querySelector(S.frames.notifications.entry.comment),
get unfold () root.contentDocument.querySelector(S.currentEntry.unfold.join(', '))
}
};
@@ -598,6 +607,8 @@ let g:gplus_commando_map_menu = "m"
comment: function () {
let notifications = Elements.frames.notifications;
if (notifications && notifications.visible && notifications.entry.visible) {
+ let e = notifications.entry.current;
+ e.scrollTop = e.scrollHeight;
click(notifications.entry.comment);
} else {
let entry = Elements.currentEntry;