diff --git a/app/coffee/modules/common.coffee b/app/coffee/modules/common.coffee index 955861d0..86afc2ab 100644 --- a/app/coffee/modules/common.coffee +++ b/app/coffee/modules/common.coffee @@ -234,26 +234,6 @@ ProjectUrl = ($navurls) -> module.factory("$projectUrl", ["$tgNavUrls", ProjectUrl]) -############################################################################# -## Limite line size in a text area -############################################################################# - -LimitLineLengthDirective = () -> - link = ($scope, $el, $attrs) -> - maxColsPerLine = parseInt($el.attr("cols")) - $el.on "keyup", (event) -> - code = event.keyCode - lines = $el.val().split("\n") - - _.each lines, (line, index) -> - lines[index] = line.substring(0, maxColsPerLine - 2) - - $el.val(lines.join("\n")) - - return {link:link} - -module.directive("tgLimitLineLength", LimitLineLengthDirective) - ############################################################################# ## Queue Q promises ############################################################################# diff --git a/app/locales/taiga/locale-en.json b/app/locales/taiga/locale-en.json index 3ab75a0d..86fee941 100644 --- a/app/locales/taiga/locale-en.json +++ b/app/locales/taiga/locale-en.json @@ -66,6 +66,7 @@ "MAX_CHECK": "You must select %s choices or less.", "RANGE_CHECK": "You must select between %s and %s choices.", "EQUAL_TO": "This value should be the same.", + "LINEWIDTH": "One or some lines are too long. They should have %s characters or less.", "PIKADAY": "Invalid date format, use DD MMM YYYY (like 23 Mar 1984)" }, "PICKERDATE": { diff --git a/app/partials/includes/modules/lightbox-issue-bulk.jade b/app/partials/includes/modules/lightbox-issue-bulk.jade index bef68aac..917fb5ee 100644 --- a/app/partials/includes/modules/lightbox-issue-bulk.jade +++ b/app/partials/includes/modules/lightbox-issue-bulk.jade @@ -3,6 +3,17 @@ a.close(href="", title="{{'COMMON.CLOSE' | translate}}") form h2.title(translate="COMMON.NEW_BULK") fieldset - textarea(cols="200", wrap="off", tg-limit-line-length, ng-attr-placeholder="{{'COMMON.ONE_ITEM_LINE' | translate}}", ng-model="new.bulk", data-required="true", data-linewidth="200") + textarea( + cols="200" + wrap="off" + ng-model="new.bulk" + data-required="true" + data-linewidth="200" + ng-attr-placeholder="{{'COMMON.ONE_ITEM_LINE' | translate}}" + ) - button.button-green.submit-button(type="submit", title="{{'COMMON.SAVE' | translate}}", translate="COMMON.SAVE") + button.button-green.submit-button( + type="submit" + title="{{'COMMON.SAVE' | translate}}" + translate="COMMON.SAVE" + ) diff --git a/app/partials/includes/modules/lightbox-task-bulk.jade b/app/partials/includes/modules/lightbox-task-bulk.jade index f07ef517..5a1d4b1a 100644 --- a/app/partials/includes/modules/lightbox-task-bulk.jade +++ b/app/partials/includes/modules/lightbox-task-bulk.jade @@ -3,6 +3,17 @@ a.close(href="", title="{{'COMMON.CLOSE' | translate}}") form h2.title(translate="COMMON.NEW_BULK") fieldset - textarea(cols="200", wrap="off", tg-limit-line-length, ng-attr-placeholder="{{'COMMON.ONE_ITEM_LINE' | translate}}", ng-model="form.data", data-required="true") + textarea( + cols="200" + wrap="off" + ng-model="form.data" + data-required="true" + data-linewidth="200" + ng-attr-placeholder="{{'COMMON.ONE_ITEM_LINE' | translate}}" + ) - button.button-green.submit-button(type="submit", title="{{'COMMON.SAVE' | translate}}", translate="COMMON.SAVE") + button.button-green.submit-button( + type="submit" + title="{{'COMMON.SAVE' | translate}}" + translate="COMMON.SAVE" + ) diff --git a/app/partials/includes/modules/lightbox-us-bulk.jade b/app/partials/includes/modules/lightbox-us-bulk.jade index e12442fd..4da92990 100644 --- a/app/partials/includes/modules/lightbox-us-bulk.jade +++ b/app/partials/includes/modules/lightbox-us-bulk.jade @@ -3,6 +3,17 @@ a.close(href="", title="{{'COMMON.CLOSE' | translate}}") form h2.title(translate="COMMON.NEW_BULK") fieldset - textarea(cols="200", wrap="off", tg-limit-line-length, ng-attr-placeholder="{{'COMMON.ONE_ITEM_LINE' | translate}}", ng-model="new.bulk", data-required="true", data-linewidth="200") + textarea( + cols="200" + wrap="off" + ng-model="new.bulk" + data-required="true" + data-linewidth="200" + ng-attr-placeholder="{{'COMMON.ONE_ITEM_LINE' | translate}}" + ) - button.button-green.submit-button(type="submit", title="{{'COMMON.SAVE' | translate}}", translate="COMMON.SAVE") \ No newline at end of file + button.button-green.submit-button( + type="submit", + title="{{'COMMON.SAVE' | translate}}", + translate="COMMON.SAVE" + )