Skip to content

Commit fbbba41

Browse files
committed
Some minor style changes.
1 parent 3a73fdc commit fbbba41

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

background_page.html

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
var validFirstKeys = {};
1212
var singleKeyCommands = [];
1313

14-
var specialKeyStrokeRegex = /^<(a|m|c)-.>/;
14+
var hasModifierRegex = /^<[amc]-.>/;
1515

1616
var defaultSettings = {
1717
scrollStepSize: 60,
@@ -338,14 +338,14 @@
338338
// End action functions
339339

340340
function splitKeyIntoFirstAndSecond(key) {
341-
if (key.search(specialKeyStrokeRegex) == 0)
341+
if (key.search(hasModifierRegex) == 0)
342342
return { first: key.slice(0, 5), second: key.slice(5) };
343343
else
344344
return { first: key[0], second: key.slice(1) };
345345
}
346346

347347
function getActualKeyStrokeLength(key) {
348-
if (key.search(specialKeyStrokeRegex) == 0)
348+
if (key.search(hasModifierRegex) == 0)
349349
return 1 + getActualKeyStrokeLength(key.slice(5));
350350
else
351351
return key.length;
@@ -355,9 +355,7 @@
355355
for (var key in keyToCommandRegistry)
356356
{
357357
if (getActualKeyStrokeLength(key) == 2)
358-
{
359358
validFirstKeys[splitKeyIntoFirstAndSecond(key).first] = true;
360-
}
361359
}
362360
}
363361

0 commit comments

Comments
 (0)