summaryrefslogtreecommitdiff
path: root/assets
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-02-14 23:22:06 -0500
committerFrederic Guillot <fred@kanboard.net>2015-02-14 23:22:06 -0500
commite84abb54987a497093ab2031a51fa1fe85ad2590 (patch)
tree33e63a80b7fc863655ad6d8d2d33576220adf1af /assets
parent998ef43e53f12e1e728bbf3fcd3ec3b7d7bf3a35 (diff)
Add keyboard shortcut to open the board selector
Diffstat (limited to 'assets')
-rw-r--r--assets/js/app.js5
-rw-r--r--assets/js/src/base.js5
2 files changed, 8 insertions, 2 deletions
diff --git a/assets/js/app.js b/assets/js/app.js
index 7ed2c4f3..9589b00d 100644
--- a/assets/js/app.js
+++ b/assets/js/app.js
@@ -139,8 +139,9 @@ var Kanboard=function(){jQuery(document).ready(function(){Kanboard.Init()});retu
$("#popover-content").click(function(a){a.stopPropagation()});$(".close-popover").click(function(a){a.preventDefault();$("#popover-container").remove()});Mousetrap.bind("esc",function(){$("#popover-container").remove()});c&&c()})},IsVisible:function(){var a="";"undefined"!==typeof document.hidden?a="visibilityState":"undefined"!==typeof document.mozHidden?a="mozVisibilityState":"undefined"!==typeof document.msHidden?a="msVisibilityState":"undefined"!==typeof document.webkitHidden&&(a="webkitVisibilityState");
return""!=a?"visible"==document[a]:!0},SetStorageItem:function(a,c){"undefined"!==typeof Storage&&localStorage.setItem(a,c)},GetStorageItem:function(a){return"undefined"!==typeof Storage?localStorage.getItem(a):""},MarkdownPreview:function(a){a.preventDefault();var c=$(this),b=$(this).closest("ul"),d=$(".write-area"),e=$(".preview-area"),f=$("textarea");$.ajax({url:"?controller=app&action=preview",contentType:"application/json",type:"POST",processData:!1,dataType:"html",data:JSON.stringify({text:f.val()})}).done(function(a){b.find("li").removeClass("form-tab-selected");
c.parent().addClass("form-tab-selected");e.find(".markdown").html(a);e.css("height",f.css("height"));e.css("width",f.css("width"));d.hide();e.show()})},MarkdownWriter:function(a){a.preventDefault();$(this).closest("ul").find("li").removeClass("form-tab-selected");$(this).parent().addClass("form-tab-selected");$(".write-area").show();$(".preview-area").hide()},CheckSession:function(){$(".form-login").length||$.ajax({cache:!1,url:$("body").data("status-url"),statusCode:{401:function(a){window.location=
-$("body").data("login-url")}}})},Init:function(){$("#board-selector").chosen({width:180});$("#board-selector").change(function(){window.location=$(this).attr("data-board-url").replace(/PROJECT_ID/g,$(this).val())});window.setInterval(Kanboard.CheckSession,6E4);$(".popover-subtask-restriction").click(Kanboard.Popover);$(".file-popover").click(Kanboard.Popover);Mousetrap.bind("mod+enter",function(){$("form").submit()});$(".column-tooltip").tooltip({content:function(a){return'<div class="markdown">'+
-$(this).attr("title")+"</div>"}});$.datepicker.setDefaults($.datepicker.regional[$("body").data("js-lang")]);Kanboard.InitAfterAjax()},InitAfterAjax:function(){$(".form-date").datepicker({showOtherMonths:!0,selectOtherMonths:!0,dateFormat:"yy-mm-dd",constrainInput:!1});$("#markdown-preview").click(Kanboard.MarkdownPreview);$("#markdown-write").click(Kanboard.MarkdownWriter);$(".auto-select").focus(function(){$(this).select()});$(".dropit-submenu").hide();$(".dropdown").not(".dropit").dropit()}}}();
+$("body").data("login-url")}}})},Init:function(){$("#board-selector").chosen({width:180});$("#board-selector").change(function(){window.location=$(this).attr("data-board-url").replace(/PROJECT_ID/g,$(this).val())});window.setInterval(Kanboard.CheckSession,6E4);$(".popover-subtask-restriction").click(Kanboard.Popover);$(".file-popover").click(Kanboard.Popover);Mousetrap.bind("mod+enter",function(){$("form").submit()});Mousetrap.bind("b",function(a){a.preventDefault();$("#board-selector").trigger("chosen:open")});
+$(".column-tooltip").tooltip({content:function(a){return'<div class="markdown">'+$(this).attr("title")+"</div>"}});$.datepicker.setDefaults($.datepicker.regional[$("body").data("js-lang")]);Kanboard.InitAfterAjax()},InitAfterAjax:function(){$(".form-date").datepicker({showOtherMonths:!0,selectOtherMonths:!0,dateFormat:"yy-mm-dd",constrainInput:!1});$("#markdown-preview").click(Kanboard.MarkdownPreview);$("#markdown-write").click(Kanboard.MarkdownWriter);$(".auto-select").focus(function(){$(this).select()});
+$(".dropit-submenu").hide();$(".dropdown").not(".dropit").dropit()}}}();
Kanboard.Board=function(){function a(a){Kanboard.Popover(a,Kanboard.InitAfterAjax)}function c(){Mousetrap.bind("n",function(){Kanboard.OpenPopover($(".task-creation-popover").attr("href"),Kanboard.InitAfterAjax)});Mousetrap.bind("s",function(){"expanded"===(Kanboard.GetStorageItem(d())||"expanded")?(e(),Kanboard.SetStorageItem(d(),"collapsed")):(f(),Kanboard.SetStorageItem(d(),"expanded"))})}function b(){$(".filter-expand-link").click(function(a){a.preventDefault();f();Kanboard.SetStorageItem(d(),
"expanded")});$(".filter-collapse-link").click(function(a){a.preventDefault();e();Kanboard.SetStorageItem(d(),"collapsed")});k()}function d(){return"board_stacking_"+$("#board").data("project-id")}function e(){$(".filter-collapse").hide();$(".task-board-collapsed").show();$(".filter-expand").show();$(".task-board-expanded").hide()}function f(){$(".filter-collapse").show();$(".task-board-collapsed").hide();$(".filter-expand").hide();$(".task-board-expanded").show()}function k(){"expanded"===(Kanboard.GetStorageItem(d())||
"expanded")?f():e()}function g(){$(".column").sortable({delay:300,distance:5,connectWith:".column",placeholder:"draggable-placeholder",stop:function(a,b){n(b.item.attr("data-task-id"),b.item.parent().attr("data-column-id"),b.item.index()+1,b.item.parent().attr("data-swimlane-id"))}});$(".assignee-popover").click(a);$(".category-popover").click(a);$(".task-edit-popover").click(a);$(".task-creation-popover").click(a);$(".task-description-popover").click(a);$(".task-board-tooltip").tooltip({track:!1,
diff --git a/assets/js/src/base.js b/assets/js/src/base.js
index 864cc950..9fb44ce2 100644
--- a/assets/js/src/base.js
+++ b/assets/js/src/base.js
@@ -188,6 +188,11 @@ var Kanboard = (function() {
$("form").submit();
});
+ Mousetrap.bind("b", function(e) {
+ e.preventDefault();
+ $('#board-selector').trigger('chosen:open');
+ });
+
// Tooltip for column description
$(".column-tooltip").tooltip({
content: function(e) {