##// END OF EJS Templates
repositories: rewrote whole admin section to pyramid....
repositories: rewrote whole admin section to pyramid. - fixed few small found problems - code cleanups

File last commit:

r2014:b776c5e0 default
r2014:b776c5e0 default
Show More
keyboard-bindings.js
101 lines | 3.4 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').select2('open');
// 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 });
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 });
templates: removed some unused JS variables....
r1285 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: ported to pyramid views.
r1931 'repo_changelog', {'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': ''
});
});
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});
});
}
}
setRCMouseBindings(templateContext.repo_name, templateContext.repo_landing_commit);