aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoranekos2011-07-15 11:32:29 +0900
committeranekos2011-07-15 11:32:29 +0900
commit5d6a8778668509e102d1934cff2d4abf22be3f5a (patch)
tree39d8b8cbbeccf27048f64e3de15aaa2c81db5529
parentf58c3096ac93f6ce604c144e795ee95e23e7237b (diff)
downloadvimperator-plugins-5d6a8778668509e102d1934cff2d4abf22be3f5a.tar.bz2
エラーになる時もあるのさ
-rw-r--r--google-plus-commando.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/google-plus-commando.js b/google-plus-commando.js
index 4a438a1..1e288f4 100644
--- a/google-plus-commando.js
+++ b/google-plus-commando.js
@@ -35,7 +35,7 @@ THE POSSIBILITY OF SUCH DAMAGE.
// INFO {{{
let INFO =
<>
- <plugin name="GooglePlusCommando" version="1.7.1"
+ <plugin name="GooglePlusCommando" version="1.7.2"
href="http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk/google-plus-commando.js"
summary="The handy commands for Google+"
lang="en-US"
@@ -107,10 +107,15 @@ let INFO =
get dialog () MakeElement(Dialog, Elements.doc.querySelector('.' + Names.dialog)),
getFocusedEditorButton: function (type) {
+ function hasIFrame (elem) {
+ let iframe = elem.querySelector('iframe');
+ return iframe && iframe.contentWindow === win;
+ }
+
function get1 () {
const names = {submit: 'post', cancel: 'cancel'};
- let editors = A(doc.querySelectorAll('div[id$=".editor"]')).filter(function(it) it.querySelector('iframe').contentWindow === win);
+ let editors = A(doc.querySelectorAll('div[id$=".editor"]')).filter(hasIFrame);
if (editors.length === 0)
return;
if (editors.length > 1)
@@ -122,7 +127,7 @@ let INFO =
function get2 () {
const indexes = {submit: 0, cancel: 1};
- let editors = A(doc.querySelectorAll('.n')).filter(function(it) it.querySelector('iframe').contentWindow === win);
+ let editors = A(doc.querySelectorAll('.n')).filter(hasIFrame);
if (editors.length === 0)
return;
if (editors.length > 1)