").addClass("tooltip-arrow").addClass(C.vertical).addClass(D<1?"align-left":"align-right").appendTo(this)}},content:function(){var D=this;var B=$(this).attr("data-href");if(!B){return'
'+$(this).attr("title")+"
"}$.get(B,function C(G){var F=$(".ui-tooltip:visible");$(".ui-tooltip-content:visible").html(G);F.css({top:"",left:""});F.children(".tooltip-arrow").remove();var E=$(D).tooltip("option","position");E.of=$(D);F.position(E)});return'
'}}).on("mouseenter",function(){var B=this;$(this).tooltip("open");$(".ui-tooltip").on("mouseleave",function(){$(B).tooltip("close")})}).on("mouseleave focusout",function(B){B.stopImmediatePropagation();var C=this;setTimeout(function(){if(!$(".ui-tooltip:hover").length){$(C).tooltip("close")}},100)})};function n(){}n.prototype.showPreview=function(E){E.preventDefault();var B=$(".write-area");var D=$(".preview-area");var A=$("textarea");$("#markdown-write").parent().removeClass("form-tab-selected");$("#markdown-preview").parent().addClass("form-tab-selected");var C=$.ajax({url:$("body").data("markdown-preview-url"),contentType:"application/json",type:"POST",processData:false,dataType:"html",data:JSON.stringify({text:A.val()})});C.done(function(F){D.find(".markdown").html(F);D.css("height",A.css("height"));D.css("width",A.css("width"));B.hide();D.show()})};n.prototype.showWriter=function(A){A.preventDefault();$("#markdown-write").parent().addClass("form-tab-selected");$("#markdown-preview").parent().removeClass("form-tab-selected");$(".write-area").show();$(".preview-area").hide()};n.prototype.listen=function(){$(document).on("click","#markdown-preview",this.showPreview.bind(this));$(document).on("click","#markdown-write",this.showWriter.bind(this))};function g(A){this.app=A;this.keyboardShortcuts()}g.prototype.focus=function(){$(document).on("focus","#form-search",function(){if($("#form-search")[0].setSelectionRange){$("#form-search")[0].setSelectionRange($("#form-search").val().length,$("#form-search").val().length)}})};g.prototype.listen=function(){var A=this;$(document).on("click",".filter-helper",function(D){D.preventDefault();var C=$(this).data("filter");var B=$(this).data("append-filter");if(B){C=$("#form-search").val()+" "+B}$("#form-search").val(C);if($("#board").length){A.app.board.reloadFilters(C)}else{$("form.search").submit()}})};g.prototype.keyboardShortcuts=function(){var A=this;Mousetrap.bind("v o",function(C){var B=$(".view-overview");if(B.length){window.location=B.attr("href")}});Mousetrap.bind("v b",function(C){var B=$(".view-board");if(B.length){window.location=B.attr("href")}});Mousetrap.bind("v c",function(C){var B=$(".view-calendar");if(B.length){window.location=B.attr("href")}});Mousetrap.bind("v l",function(C){var B=$(".view-listing");if(B.length){window.location=B.attr("href")}});Mousetrap.bind("v g",function(C){var B=$(".view-gantt");if(B.length){window.location=B.attr("href")}});Mousetrap.bind("f",function(C){C.preventDefault();var B=document.getElementById("form-search");if(B){B.focus()}});Mousetrap.bind("r",function(C){C.preventDefault();var B=$(".filter-reset").data("filter");$("#form-search").val(B);if($("#board").length){A.app.board.reloadFilters(B)}else{$("form.search").submit()}})};function o(){this.board=new l(this);this.markdown=new n();this.search=new g(this);this.swimlane=new h(this);this.dropdown=new t();this.tooltip=new s(this);this.popover=new v(this);this.task=new a(this);this.project=new p();this.subtask=new f(this);this.column=new m(this);this.file=new x(this);this.accordion=new c(this);this.keyboardShortcuts();this.task.keyboardShortcuts();this.chosen();this.poll();$(".alert-fade-out").delay(5000).fadeOut(800,function(){$(this).remove()})}o.prototype.listen=function(){this.project.listen();this.popover.listen();this.markdown.listen();this.tooltip.listen();this.dropdown.listen();this.search.listen();this.task.listen();this.swimlane.listen();this.subtask.listen();this.column.listen();this.file.listen();this.accordion.listen();this.search.focus();this.autoComplete();this.datePicker();this.focus()};o.prototype.refresh=function(){$(document).off();this.listen()};o.prototype.focus=function(){$("[autofocus]").each(function(A,B){$(this).focus()});$(document).on("focus",".auto-select",function(){$(this).select()});$(document).on("mouseup",".auto-select",function(A){A.preventDefault()})};o.prototype.poll=function(){window.setInterval(this.checkSession,60000)};o.prototype.keyboardShortcuts=function(){var A=this;Mousetrap.bindGlobal("mod+enter",function(){$("form").submit()});Mousetrap.bind("b",function(B){B.preventDefault();$("#board-selector").trigger("chosen:open")});Mousetrap.bindGlobal("esc",function(){A.popover.close();A.dropdown.close()});Mousetrap.bind("?",function(){A.popover.open($("body").data("keyboard-shortcut-url"))})};o.prototype.checkSession=function(){if(!$(".form-login").length){$.ajax({cache:false,url:$("body").data("status-url"),statusCode:{401:function(){window.location=$("body").data("login-url")}}})}};o.prototype.datePicker=function(){$.datepicker.setDefaults($.datepicker.regional[$("body").data("js-lang")]);$(".form-date").datepicker({showOtherMonths:true,selectOtherMonths:true,dateFormat:"yy-mm-dd",constrainInput:false});$(".form-datetime").datetimepicker({controlType:"select",oneLine:true,dateFormat:"yy-mm-dd",constrainInput:false})};o.prototype.autoComplete=function(){$(".autocomplete").each(function(){var B=$(this);var C=B.data("dst-field");var A=B.data("dst-extra-field");if($("#form-"+C).val()==""){B.parent().find("button[type=submit]").attr("disabled","disabled")}B.autocomplete({source:B.data("search-url"),minLength:1,select:function(D,E){$("input[name="+C+"]").val(E.item.id);if(A){$("input[name="+A+"]").val(E.item[A])}B.parent().find("button[type=submit]").removeAttr("disabled")}})})};o.prototype.chosen=function(){$(".chosen-select").each(function(){var A=$(this).data("search-threshold");if(A===undefined){A=10}$(this).chosen({width:"180px",no_results_text:$(this).data("notfound"),disable_search_threshold:A})});$(".select-auto-redirect").change(function(){var A=new RegExp($(this).data("redirect-regex"),"g");window.location=$(this).data("redirect-url").replace(A,$(this).val())})};o.prototype.showLoadingIcon=function(){$("body").append('
')};o.prototype.hideLoadingIcon=function(){$("#app-loading-icon").remove()};o.prototype.isVisible=function(){var A="";if(typeof document.hidden!=="undefined"){A="visibilityState"}else{if(typeof document.mozHidden!=="undefined"){A="mozVisibilityState"}else{if(typeof document.msHidden!=="undefined"){A="msVisibilityState"}else{if(typeof document.webkitHidden!=="undefined"){A="webkitVisibilityState"}}}}if(A!=""){return document[A]=="visible"}return true};o.prototype.formatDuration=function(A){if(A>=86400){return Math.round(A/86400)+"d"}else{if(A>=3600){return Math.round(A/3600)+"h"}else{if(A>=60){return Math.round(A/60)+"m"}}}return A+"s"};function e(){this.pasteCatcher=null}e.prototype.execute=function(){this.initialize()};e.prototype.initialize=function(){this.destroy();if(!window.Clipboard){this.pasteCatcher=document.createElement("div");this.pasteCatcher.id="screenshot-pastezone";this.pasteCatcher.contentEditable="true";this.pasteCatcher.style.opacity=0;this.pasteCatcher.style.position="fixed";this.pasteCatcher.style.top=0;this.pasteCatcher.style.right=0;this.pasteCatcher.style.width=0;document.body.insertBefore(this.pasteCatcher,document.body.firstChild);this.pasteCatcher.focus();document.addEventListener("click",this.setFocus.bind(this));document.getElementById("screenshot-zone").addEventListener("click",this.setFocus.bind(this))}window.addEventListener("paste",this.pasteHandler.bind(this))};e.prototype.destroy=function(){if(this.pasteCatcher!=null){document.body.removeChild(this.pasteCatcher)}else{if(document.getElementById("screenshot-pastezone")){document.body.removeChild(document.getElementById("screenshot-pastezone"))}}document.removeEventListener("click",this.setFocus.bind(this));this.pasteCatcher=null};e.prototype.setFocus=function(){if(this.pasteCatcher!==null){this.pasteCatcher.focus()}};e.prototype.pasteHandler=function(F){if(F.clipboardData&&F.clipboardData.items){var D=F.clipboardData.items;if(D){for(var E=0;E
0){$("#file-upload-button").prop("disabled",false);$("#file-dropzone-inner").hide();var E=jQuery("",{id:"file-list"});for(var D=0;D",{id:"file-percentage-"+D}).append("(0%)");var C=jQuery("