Created
May 31, 2011 01:09
-
-
Save 958/999712 to your computer and use it in GitHub Desktop.
[keysnail]XUL/Migemo を KeySnail から叩く
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
key.setViewKey('/', function (ev, arg) { | |
window.XMigemoFind.target = document.getElementById('content'); | |
window.XMigemoFind.clear(false); | |
window.XMigemoFind.isLinksOnly = false; | |
window.XMigemoFind.isQuickFind = false; | |
window.XMigemoFind.findMode = window.XMigemoFind.FIND_MODE_MIGEMO; | |
window.XMigemoFind.caseSensitive = false; | |
prompt.reader({ | |
message : 'Find:', | |
onChange: function (arg) window.XMigemoFind.find(false, arg.textbox.value, false), | |
callback: function (text) {} | |
}); | |
}, 'Migemo 検索', true); | |
key.setViewKey('n', function (ev, arg) { | |
window.XMigemoFind.findNext(true); | |
}, 'Migemo 検索 - 次へ', true); | |
key.setViewKey('N', function (ev, arg) { | |
window.XMigemoFind.findPrevious(true); | |
}, 'Migemo 検索 - 前へ', true); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- a/components/xmXMigemoTextUtils.js | |
+++ b/components/xmXMigemoTextUtils.js | |
@@ -538,9 +538,11 @@ | |
var lastNode; | |
+ var isGet = false; | |
var utils = w.QueryInterface(Ci.nsIInterfaceRequestor) | |
.getInterface(Ci.nsIDOMWindowUtils); | |
if ('nodesFromRect' in utils) { // Firefox 3.6- | |
+try { | |
let nodes = utils.nodesFromRect( | |
0, | |
0, | |
@@ -568,8 +570,11 @@ | |
} | |
while (this.visibleNodeFilter.acceptNode(nodes[i]) != this.visibleNodeFilter.kACCEPT && i > -1); | |
} | |
+ isGet = true; | |
+}catch(e){} | |
} | |
- else { // -Firefox 3.5 | |
+// else { // -Firefox 3.5 | |
+ if (!isGet) { | |
let walker = aDocument.createTreeWalker( | |
aDocument.documentElement, | |
Ci.nsIDOMNodeFilter.SHOW_ELEMENT, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
とりあえずこれでうごいたからいいや