aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--command_menu.js4
-rw-r--r--migemized_find.js5
2 files changed, 5 insertions, 4 deletions
diff --git a/command_menu.js b/command_menu.js
index f51b6fb..b701ca4 100644
--- a/command_menu.js
+++ b/command_menu.js
@@ -2,7 +2,7 @@
// @name Command-MainMenu
// @description-ja メインメニューとツールバーをコマンドで実行できる
// @license Creative Commons 2.1 (Attribution + Share Alike)
-// @version 1.2
+// @version 1.3
// ==/VimperatorPlugin==
//
// Usage:
@@ -115,7 +115,7 @@
const contextmenu = document.getElementById('contentAreaContextMenu');
function fixName (name) {
- return name.replace(/^\s+|\s+$/, '').replace(/[\-\s]+/g, '_');
+ return name ? name.replace(/^\s+|\s+$/, '').replace(/[\-\s]+/g, '_') : '';
}
function getElementName (elem, multi) {
diff --git a/migemized_find.js b/migemized_find.js
index 160d06c..0da0f04 100644
--- a/migemized_find.js
+++ b/migemized_find.js
@@ -24,7 +24,8 @@
// findMode := FIND_MODE_NATIVE | FIND_MODE_MIGEMO | FIND_MODE_REGEXP
- const findbarTextbox = document.getElementById('FindToolbar').getElement('findbar-textbox');
+ const FindToolbar = document.getElementById('FindToolbar')
+ const FindbarTextbox = FindToolbar.getElement('findbar-textbox');
const DOMUtils = Components.classes["@mozilla.org/inspector/dom-utils;1"].
getService(Components.interfaces["inIDOMUtils"]);
@@ -35,7 +36,7 @@
// とりあえず、アレな方法で not found を検出
function isNotFound () {
- let rules = DOMUtils.getCSSStyleRules(findbarTextbox);
+ let rules = DOMUtils.getCSSStyleRules(FindbarTextbox);
for (let i = 0; i < rules.Count(); i++) {
if (rules.GetElementAt(i).selectorText.indexOf('notfound') >= 0)
return true;