From b24b1e7e4e5ee0551ee56aa0f21c4425b479db2e Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Wed, 4 Feb 2015 22:19:32 -0500 Subject: Add subtasks restrictions and time tracking --- assets/js/app.js | 16 ++++++++-------- assets/js/src/base.js | 2 ++ assets/js/src/board.js | 8 +++++++- 3 files changed, 17 insertions(+), 9 deletions(-) (limited to 'assets') diff --git a/assets/js/app.js b/assets/js/app.js index 9e21e7c3..d040b3be 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -135,16 +135,16 @@ var Kanboard=function(){return{Exists:function(a){return document.getElementById $(".close-popover").click(function(a){a.preventDefault();$("#popover-container").remove()});Mousetrap.bind("esc",function(){$("#popover-container").remove()});d&&d()})},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, d){"undefined"!==typeof Storage&&localStorage.setItem(a,d)},GetStorageItem:function(a){return"undefined"!==typeof Storage?localStorage.getItem(a):""},MarkdownPreview:function(a){a.preventDefault();var d=$(this),c=$(this).closest("ul"),f=$(".write-area"),e=$(".preview-area"),b=$("textarea");$.ajax({url:"?controller=app&action=preview",contentType:"application/json",type:"POST",processData:!1,dataType:"html",data:JSON.stringify({text:b.val()})}).done(function(a){c.find("li").removeClass("form-tab-selected"); d.parent().addClass("form-tab-selected");e.find(".markdown").html(a);e.css("height",b.css("height"));e.css("width",b.css("width"));f.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);Mousetrap.bind("ctrl+enter",function(){$("form").submit()});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);Mousetrap.bind("ctrl+enter",function(){$("form").submit()});$(".popover-subtask-restriction").click(Kanboard.Popover);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 d(){Mousetrap.bind("n",function(){Kanboard.OpenPopover($(".task-creation-popover").attr("href"),Kanboard.InitAfterAjax)})}function c(){$(".column").sortable({delay:300,distance:5,connectWith:".column",placeholder:"draggable-placeholder",stop:function(a,b){e(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);$(".column-tooltip").tooltip({content:function(a){return $(this).attr("title")}});$(".task-board-tooltip").tooltip({track:!1,position:{my:"left-20 top",at:"center bottom+9",using:function(a,b){$(this).css(a);var c=b.target.left+b.target.width/2-b.element.left-20;$("
").addClass("tooltip-arrow").addClass(b.vertical).addClass(0==c?"align-left":"align-right").appendTo(this)}}, -content:function(a){if(a=$(this).attr("data-href")){var b=this;$.get(a,function k(a){$(".ui-tooltip-content:visible").html(a);a=$(".ui-tooltip:visible");a.css({top:"",left:""});a.children(".tooltip-arrow").remove();var c=$(b).tooltip("option","position");c.of=$(b);a.position(c);$("#tooltip-subtasks a").click(function(a){a.preventDefault();a.stopPropagation();$.get($(this).attr("href"),k)})});return''}}}).on("mouseenter",function(){var a=this;$(this).tooltip("open"); -$(".ui-tooltip").on("mouseleave",function(){$(a).tooltip("close")})}).on("mouseleave focusout",function(a){a.stopImmediatePropagation();var b=this;setTimeout(function(){$(".ui-tooltip:hover").length||$(b).tooltip("close")},100)});$("[data-task-url]").each(function(){$(this).click(function(){window.location=$(this).attr("data-task-url")})});var c=parseInt($("#board").attr("data-check-interval"));0'}}}).on("mouseenter",function(){var a=this;$(this).tooltip("open");$(".ui-tooltip").on("mouseleave",function(){$(a).tooltip("close")})}).on("mouseleave focusout",function(a){a.stopImmediatePropagation();var b=this;setTimeout(function(){$(".ui-tooltip:hover").length||$(b).tooltip("close")},100)});$("[data-task-url]").each(function(){$(this).click(function(){window.location=$(this).attr("data-task-url")})});var c=parseInt($("#board").attr("data-check-interval")); +0