aboutsummaryrefslogtreecommitdiffstats
path: root/google-plus-commando.js
diff options
context:
space:
mode:
authoranekos2011-08-22 15:23:07 +0900
committeranekos2011-08-22 15:23:07 +0900
commit574f9e36c8b2a9ca46439619357887531cf22a87 (patch)
tree4891951b7ff2c105e1f0c9901f101d0f24ea2043 /google-plus-commando.js
parent45ef1f7be43596c4b78a076bd79be95996956373 (diff)
downloadvimperator-plugins-574f9e36c8b2a9ca46439619357887531cf22a87.tar.bz2
cssRules に __iterator__ つけた
Diffstat (limited to 'google-plus-commando.js')
-rw-r--r--google-plus-commando.js10
1 files changed, 4 insertions, 6 deletions
diff --git a/google-plus-commando.js b/google-plus-commando.js
index 607de35..a6f38c2 100644
--- a/google-plus-commando.js
+++ b/google-plus-commando.js
@@ -237,22 +237,21 @@ let g:gplus_commando_map_menu = "m"
}
let cssRules = {
- items: function () {
+ __iterator__: function (nameOnly) {
if (content.location.host != 'plus.google.com')
return;
let result = [];
for (let [, sheet] in IA(content.document.styleSheets)) {
- for (let [, rule] in IA(sheet.cssRules)) {
- result.push(rule);
+ for (let [n, rule] in IA(sheet.cssRules)) {
+ yield nameOnly ? n : [n, rule];
}
}
- return result;
},
find: function (re, notre) {
let result = [];
- for (let [, rule] in I(this.items)) {
+ for (let [, rule] in I(this)) {
if (re.test(rule.cssText)) {
if (notre && notre.test(rule.cssText))
continue;
@@ -349,7 +348,6 @@ let g:gplus_commando_map_menu = "m"
};
onceAll(selector, '.MEOW_MEOW_MEOW');
- once(cssRules, 'items');
return [selector, xpath];
})();