diff --git a/app/Template/layout.php b/app/Template/layout.php index 592a49346..6063cbd73 100644 --- a/app/Template/layout.php +++ b/app/Template/layout.php @@ -1,5 +1,5 @@ - +
@@ -48,7 +48,6 @@ data-login-url="= $this->url->href('AuthController', 'login') ?>" data-keyboard-shortcut-url="= $this->url->href('DocumentationController', 'shortcuts') ?>" data-timezone="= $this->app->getTimezone() ?>" - data-js-lang="= $this->app->jsLang() ?>" data-js-date-format="= $this->app->getJsDateFormat() ?>" data-js-time-format="= $this->app->getJsTimeFormat() ?>" > diff --git a/assets/js/app.min.js b/assets/js/app.min.js index e02cf93b9..f8486fe59 100644 --- a/assets/js/app.min.js +++ b/assets/js/app.min.js @@ -282,7 +282,7 @@ textarea.value=replaceTextRange(textarea.value,selectionStart,selectionEnd,repla function setCursorBeforeClosingTag(tag,offset){offset=offset||0;var position=selectionEnd+tag.length+offset;textarea.setSelectionRange(position,position)}});document.addEventListener('DOMContentLoaded',function(){KB.render();KB.listen();KB.keyboardShortcuts();KB.tooltip();KB.trigger('dom.ready')});var Kanboard={};Kanboard.App=function(){this.controllers={}};Kanboard.App.prototype.get=function(controller){return this.controllers[controller]};Kanboard.App.prototype.execute=function(){for(var className in Kanboard){if(className!=="App"){var controller=new Kanboard[className](this);this.controllers[className]=controller;if(typeof controller.execute==="function"){controller.execute()} if(typeof controller.listen==="function"){controller.listen()} if(typeof controller.focus==="function"){controller.focus()}}} -this.focus();this.datePicker();this.autoComplete();this.tagAutoComplete()};Kanboard.App.prototype.focus=function(){$(document).on('focus','.auto-select',function(){$(this).select()});$(document).on('mouseup','.auto-select',function(e){e.preventDefault()})};Kanboard.App.prototype.datePicker=function(){var bodyElement=$("body");var dateFormat=bodyElement.data("js-date-format");var timeFormat=bodyElement.data("js-time-format");var lang=bodyElement.data("js-lang");$.datepicker.setDefaults($.datepicker.regional[lang]);$.timepicker.setDefaults($.timepicker.regional[lang]);$(".form-date").datepicker({showOtherMonths:!0,selectOtherMonths:!0,dateFormat:dateFormat,constrainInput:!1});$(".form-datetime").datetimepicker({dateFormat:dateFormat,timeFormat:timeFormat,constrainInput:!1,amNames:['am','AM'],pmNames:['pm','PM']})};Kanboard.App.prototype.tagAutoComplete=function(){$(".tag-autocomplete").select2({tags:!0})};Kanboard.App.prototype.autoComplete=function(){$(".autocomplete").each(function(){var input=$(this);var field=input.data("dst-field");var extraFields=input.data("dst-extra-fields");if($('#form-'+field).val()===''){input.parent().find("button[type=submit]").attr('disabled','disabled')} +this.focus();this.datePicker();this.autoComplete();this.tagAutoComplete()};Kanboard.App.prototype.focus=function(){$(document).on('focus','.auto-select',function(){$(this).select()});$(document).on('mouseup','.auto-select',function(e){e.preventDefault()})};Kanboard.App.prototype.datePicker=function(){var bodyElement=$("body");var dateFormat=bodyElement.data("js-date-format");var timeFormat=bodyElement.data("js-time-format");var lang=$("html").attr("lang");$.datepicker.setDefaults($.datepicker.regional[lang]);$.timepicker.setDefaults($.timepicker.regional[lang]);$(".form-date").datepicker({showOtherMonths:!0,selectOtherMonths:!0,dateFormat:dateFormat,constrainInput:!1});$(".form-datetime").datetimepicker({dateFormat:dateFormat,timeFormat:timeFormat,constrainInput:!1,amNames:['am','AM'],pmNames:['pm','PM']})};Kanboard.App.prototype.tagAutoComplete=function(){$(".tag-autocomplete").select2({tags:!0})};Kanboard.App.prototype.autoComplete=function(){$(".autocomplete").each(function(){var input=$(this);var field=input.data("dst-field");var extraFields=input.data("dst-extra-fields");if($('#form-'+field).val()===''){input.parent().find("button[type=submit]").attr('disabled','disabled')} input.autocomplete({source:input.data("search-url"),minLength:1,select:function(event,ui){$("input[name="+field+"]").val(ui.item.id);if(extraFields){var fields=extraFields.split(',');for(var i=0;i