zeniko wrote:@Philip Chee:
Do you insist on those tests? Both the map method and the fix for Bug 296700 are included in Gecko 1.8 (among others in the upcoming Firefox 1.5), which doesn't include the patch-aviary.js file, since that file is only referenced in contents.rdf, but not in chrome.manifest.
I don't insist on anything! I just thought that someone might implement the javascript array libraries as an extension for gecko 1.7 browsers then there might be a conflict. I've seen several subtly different versions that implement these new methods out there.
Also there are several extensions like Multizilla and (probably) All-in-One-Sidebar that replace console.xul with their own versions that might implement a keyset ID.
zeniko wrote:Philip Chee wrote:Code: Select all
if (/^ConsoleFilter\./.test(keys[i].getAttribute("oncommand")))
What does this do?
This determines whether a <key> is one of Console Filter's which should be manually added to the main keyset (part of the work-around for Bug 296700). The test relies on the fact that the commands of all of CF's keys refer to a method of the global object
ConsoleFilter.
So why don't you give them a custom property e.g. consolefilterkey="true" and then use getElementsByAttribute(in DOMString name, in DOMString value):
Code: Select all
<key key="K" modifiers="accel" consolefilterkey="true" oncommand="ConsoleFilter.focus();"/>
<key key="Q" modifiers="accel" consolefilterkey="true" oncommand="ConsoleFilter.focus();"/>
....
var keys = getElementsByAttribute("consolefilterkey", "true")
keys.forEach(keyset.appendChild)
If you are going to implement array.map you might as well implement array.forEach