Skip to content

Commit

Permalink
Merge branch 'refs/heads/development'
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Skuse committed Dec 1, 2011
2 parents defefe5 + c763894 commit 5d09817
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion ATBar.user.js
Expand Up @@ -31,7 +31,7 @@ function __start(){
$lib = AtKit.lib();

var settings = {
'version': '2.0.080-beta3'
'version': '2.0.087-beta4'
};

settings.baseURL = ('https:' == document.location.protocol ? 'https://ssl.atbar.org/c/ATBar/' : 'http://c.atbar.org/ATBar/');
Expand Down Expand Up @@ -60,9 +60,33 @@ function __start(){
AtKit.addResetFn('reset-saved', function(){
AtKit.clearStorage();
});

// Select button based on keypress
ctrlModifier = false;
TModifier = false;
$lib(document).keyup(function (e) {
if(e.which == 17) ctrlModifier = false;
if(e.which == 84) TModifier = false;
}).keydown(function (e) {
if(e.which == 17) ctrlModifier = true;
if(e.which == 84) TModifier = true;

// If we don't have the T modifier just get the first button.
if(e.which == 49 && ctrlModifier && !TModifier) {
$lib('.at-btn:first a').focus();
return false;
} else if( e.which >= 49 && e.which <= 57 && ctrlModifier && TModifier){
// Select the button at offset
$lib('.at-btn:eq(' + ( String.fromCharCode(e.which) - 1 ) + ') a').focus();
return false;
}
});

// Run
AtKit.render();

// Select the first button.
$lib('.at-btn:first a').focus();
};


Expand Down

0 comments on commit 5d09817

Please sign in to comment.