##// END OF EJS Templates
release: Merge default into stable for release preparation
release: Merge default into stable for release preparation

File last commit:

r4485:ac1b264f default
r4491:f919670e merge stable
Show More
keyboard-bindings.js
142 lines | 5.0 KiB | application/javascript | JavascriptLexer
project: added all source files and assets
r1 // Global keyboard bindings
function setRCMouseBindings(repoName, repoLandingRev) {
mousetrap: add a stub for custom suppression logic for kb handling
r835
/** custom callback for supressing mousetrap from firing */
Mousetrap.stopCallback = function(e, element) {
// if the element has the class "mousetrap" then no need to stop
if ((' ' + element.className + ' ').indexOf(' mousetrap ') > -1) {
return false;
}
// stop for input, select, and textarea
return element.tagName == 'INPUT' || element.tagName == 'SELECT' || element.tagName == 'TEXTAREA' || element.isContentEditable;
};
project: added all source files and assets
r1 // general help "?"
Mousetrap.bind(['?'], function(e) {
$('#help_kb').modal({});
});
// / open the quick filter
Mousetrap.bind(['/'], function(e) {
repo-switcher: new unified search box for filtering/accessing users, repos and repo groups....
r2774 $('#main_filter').get(0).focus();
project: added all source files and assets
r1
// return false to prevent default browser behavior
// and stop event from bubbling
return false;
});
// ctrl/command+b, show the the main bar
Mousetrap.bind(['command+b', 'ctrl+b'], function(e) {
var $headerInner = $('#header-inner'),
$content = $('#content');
if ($headerInner.hasClass('hover') && $content.hasClass('hover')) {
$headerInner.removeClass('hover');
$content.removeClass('hover');
} else {
$headerInner.addClass('hover');
$content.addClass('hover');
}
return false;
});
// general nav g + action
Mousetrap.bind(['g h'], function(e) {
window.location = pyroutes.url('home');
});
Mousetrap.bind(['g g'], function(e) {
dan
gists: migrated gists controller to pyramid view.
r1891 window.location = pyroutes.url('gists_show', {'private': 1});
project: added all source files and assets
r1 });
Mousetrap.bind(['g G'], function(e) {
dan
gists: migrated gists controller to pyramid view.
r1891 window.location = pyroutes.url('gists_show', {'public': 1});
project: added all source files and assets
r1 });
dan
ui: introduce user-bookmarks for creation of quick shortcuts
r3424
Mousetrap.bind(['g 0'], function(e) {
window.location = pyroutes.url('my_account_goto_bookmark', {'bookmark_id': 0});
});
Mousetrap.bind(['g 1'], function(e) {
window.location = pyroutes.url('my_account_goto_bookmark', {'bookmark_id': 1});
});
Mousetrap.bind(['g 2'], function(e) {
window.location = pyroutes.url('my_account_goto_bookmark', {'bookmark_id': 2});
});
Mousetrap.bind(['g 3'], function(e) {
window.location = pyroutes.url('my_account_goto_bookmark', {'bookmark_id': 3});
});
Mousetrap.bind(['g 4'], function(e) {
window.location = pyroutes.url('my_account_goto_bookmark', {'bookmark_id': 4});
});
Mousetrap.bind(['g 5'], function(e) {
window.location = pyroutes.url('my_account_goto_bookmark', {'bookmark_id': 5});
});
Mousetrap.bind(['g 6'], function(e) {
window.location = pyroutes.url('my_account_goto_bookmark', {'bookmark_id': 6});
});
Mousetrap.bind(['g 7'], function(e) {
window.location = pyroutes.url('my_account_goto_bookmark', {'bookmark_id': 7});
});
Mousetrap.bind(['g 8'], function(e) {
window.location = pyroutes.url('my_account_goto_bookmark', {'bookmark_id': 8});
});
Mousetrap.bind(['g 9'], function(e) {
window.location = pyroutes.url('my_account_goto_bookmark', {'bookmark_id': 9});
});
project: added all source files and assets
r1 Mousetrap.bind(['n g'], function(e) {
dan
gists: migrated gists controller to pyramid view.
r1891 window.location = pyroutes.url('gists_new');
project: added all source files and assets
r1 });
Mousetrap.bind(['n r'], function(e) {
repositories: rewrote whole admin section to pyramid....
r2014 window.location = pyroutes.url('repo_new');
project: added all source files and assets
r1 });
dan
ui: introduce user-bookmarks for creation of quick shortcuts
r3424 if (repoName && repoName !== '') {
project: added all source files and assets
r1 // nav in repo context
Mousetrap.bind(['g s'], function(e) {
window.location = pyroutes.url(
repo-summary: re-implemented summary view as pyramid....
r1785 'repo_summary', {'repo_name': repoName});
project: added all source files and assets
r1 });
Mousetrap.bind(['g c'], function(e) {
window.location = pyroutes.url(
changelog: rename changelog to commits pages
r3742 'repo_commits', {'repo_name': repoName});
project: added all source files and assets
r1 });
Mousetrap.bind(['g F'], function(e) {
window.location = pyroutes.url(
files: ported repository files controllers to pyramid views.
r1927 'repo_files',
project: added all source files and assets
r1 {
'repo_name': repoName,
files: ported repository files controllers to pyramid views.
r1927 'commit_id': repoLandingRev,
project: added all source files and assets
r1 'f_path': '',
'search': '1'
});
});
Mousetrap.bind(['g f'], function(e) {
window.location = pyroutes.url(
files: ported repository files controllers to pyramid views.
r1927 'repo_files',
project: added all source files and assets
r1 {
'repo_name': repoName,
files: ported repository files controllers to pyramid views.
r1927 'commit_id': repoLandingRev,
project: added all source files and assets
r1 'f_path': ''
});
});
keyboard-shortcuts: fixed missing go to pull requests shortcut.
r4084 Mousetrap.bind(['g p'], function(e) {
window.location = pyroutes.url(
'pullrequest_show_all', {'repo_name': repoName});
});
project: added all source files and assets
r1 Mousetrap.bind(['g o'], function(e) {
window.location = pyroutes.url(
'edit_repo', {'repo_name': repoName});
});
Mousetrap.bind(['g O'], function(e) {
window.location = pyroutes.url(
'edit_repo_perms', {'repo_name': repoName});
});
commits/pr pages various fixes....
r4485 Mousetrap.bind(['t s'], function(e) {
if (window.toggleSidebar !== undefined) {
window.toggleSidebar();
}
});
project: added all source files and assets
r1 }
}
setRCMouseBindings(templateContext.repo_name, templateContext.repo_landing_commit);