diff options
author | anekos | 2011-07-27 01:06:42 +0900 |
---|---|---|
committer | anekos | 2011-07-27 01:06:42 +0900 |
commit | 3cd957ffe0db05c85d83f88023260448560119ed (patch) | |
tree | dd92af9a5c0a73b5e9313c62b8d647c3164e5825 /google-plus-commando.js | |
parent | 9b103500326b5fb9a24272684a13a753bf467dd2 (diff) | |
download | vimperator-plugins-3cd957ffe0db05c85d83f88023260448560119ed.tar.bz2 |
通知ウィンドウ内のヒント対応
Diffstat (limited to 'google-plus-commando.js')
-rw-r--r-- | google-plus-commando.js | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/google-plus-commando.js b/google-plus-commando.js index df85021..57e042e 100644 --- a/google-plus-commando.js +++ b/google-plus-commando.js @@ -731,19 +731,25 @@ let g:gplus_commando_map_menu = "m" 'div[contains(@class,"a-z-nb-A")]' ]; + const roots = [ + {get visible () !!Elements.viewer, selector: ('div[contains(@class, "' + s2x(S.viewer.root) + '")]')}, + {get visible () !!Elements.dialog, selector: ('div[contains(@class, "' + s2x(S.dialog.root) + '")]')}, + {get visible () !!Elements.frames.notifications.visible, selector: 'id("nw-content")'} + ]; + let xpath = options['hinttags'].split(/\s*\|\s*/).map(removeRoot).concat(ext); - for (let [, name] in Iterator(['viewer', 'dialog'])) { - if (!Elements[name]) + for (let [, root] in Iterator(roots)) { + if (!root.visible) continue; xpath.push(String(<>div[contains(@class, "{s2x(S.closeButton)}")]</>)); - xpath = xpath.map(function (it) String(<>*[contains(@class, "{s2x(S[name].root)}")]//{it}</>)) + xpath = xpath.map(function (it) (root.selector + '//' + it)); break; } styles.addSheet(false, HintStyleName, 'plus\\.google\\.com', '.a-b-f-W-Tj.a-f-W-Tj { display: inline !important }'); - return xpath.map(function (it) '//' + it).join(' | '); + return xpath.map(function (it) (/^id\(/.test(it) ? it : '//' + it)).join(' | '); } ); |