auto detection of accesskey was broken

This commit is contained in:
Piro / SHIMODA Hiroshi 2011-03-18 22:10:53 +09:00
parent 85cbf6bbba
commit e005536edf

View File

@ -1,7 +1,7 @@
/** /**
* @fileOverview Tab Related Confirmation Library for Firefox 3.5 or later * @fileOverview Tab Related Confirmation Library for Firefox 3.5 or later
* @author SHIMODA "Piro" Hiroshi * @author SHIMODA "Piro" Hiroshi
* @version 4 * @version 5
* Basic usage: * Basic usage:
* *
* @example * @example
@ -72,7 +72,7 @@ if (typeof namespace.Deferred == 'undefined')
var confirmWithTab; var confirmWithTab;
(function() { (function() {
const currentRevision = 4; const currentRevision = 5;
var loadedRevision = 'confirmWithTab' in namespace ? var loadedRevision = 'confirmWithTab' in namespace ?
namespace.confirmWithTab.revision : namespace.confirmWithTab.revision :
@ -115,13 +115,13 @@ var confirmWithTab;
box.PRIORITY_INFO_MEDIUM box.PRIORITY_INFO_MEDIUM
), ),
aOptions.buttons.map(function(aLabel, aIndex) { aOptions.buttons.map(function(aLabel, aIndex) {
var accessKey;
var match = aLabel.match(/\s*\(&([0-9a-z])\)/i); var match = aLabel.match(/\s*\(&([0-9a-z])\)/i);
if (match) { if (match) {
accessKey = match[1]; accessKey = match[1];
aLabel = aLabel.replace(match[0], ''); aLabel = aLabel.replace(match[0], '');
} }
else { else {
let accessKey;
let lastUniqueKey; let lastUniqueKey;
let sanitizedLabel = []; let sanitizedLabel = [];
for (let i = 0, maxi = aLabel.length; i < maxi; i++) for (let i = 0, maxi = aLabel.length; i < maxi; i++)