move normalizeString to utils
parent
bf2ead8839
commit
2339bb8c4b
|
@ -24,6 +24,7 @@
|
|||
|
||||
taiga = @.taiga
|
||||
bindOnce = @.taiga.bindOnce
|
||||
normalizeString = @.taiga.normalizeString
|
||||
|
||||
module = angular.module("taigaCommon")
|
||||
|
||||
|
@ -536,15 +537,6 @@ $translate, $compile, $currentUserService, avatarService) ->
|
|||
isEditable = ->
|
||||
return $scope.project?.my_permissions?.indexOf($attrs.requiredPerm) != -1
|
||||
|
||||
normalizeString = (string) ->
|
||||
normalizedString = string
|
||||
normalizedString = normalizedString.replace("Á", "A").replace("Ä", "A").replace("À", "A")
|
||||
normalizedString = normalizedString.replace("É", "E").replace("Ë", "E").replace("È", "E")
|
||||
normalizedString = normalizedString.replace("Í", "I").replace("Ï", "I").replace("Ì", "I")
|
||||
normalizedString = normalizedString.replace("Ó", "O").replace("Ö", "O").replace("Ò", "O")
|
||||
normalizedString = normalizedString.replace("Ú", "U").replace("Ü", "U").replace("Ù", "U")
|
||||
return normalizedString
|
||||
|
||||
filterUsers = (text, user) ->
|
||||
username = user.full_name_display.toUpperCase()
|
||||
username = normalizeString(username)
|
||||
|
@ -652,15 +644,6 @@ $translate, $compile, $currentUserService, avatarService) ->
|
|||
isAssigned = ->
|
||||
return currentAssignedIds.length > 0
|
||||
|
||||
normalizeString = (string) ->
|
||||
normalizedString = string
|
||||
normalizedString = normalizedString.replace("Á", "A").replace("Ä", "A").replace("À", "A")
|
||||
normalizedString = normalizedString.replace("É", "E").replace("Ë", "E").replace("È", "E")
|
||||
normalizedString = normalizedString.replace("Í", "I").replace("Ï", "I").replace("Ì", "I")
|
||||
normalizedString = normalizedString.replace("Ó", "O").replace("Ö", "O").replace("Ò", "O")
|
||||
normalizedString = normalizedString.replace("Ú", "U").replace("Ü", "U").replace("Ù", "U")
|
||||
return normalizedString
|
||||
|
||||
filterUsers = (text, user) ->
|
||||
username = user.full_name_display.toUpperCase()
|
||||
username = normalizeString(username)
|
||||
|
|
|
@ -29,6 +29,7 @@ timeout = @.taiga.timeout
|
|||
debounce = @.taiga.debounce
|
||||
sizeFormat = @.taiga.sizeFormat
|
||||
trim = @.taiga.trim
|
||||
normalizeString = @.taiga.normalizeString
|
||||
|
||||
#############################################################################
|
||||
## Common Lightbox Services
|
||||
|
@ -366,15 +367,6 @@ AssignedToLightboxDirective = (lightboxService, lightboxKeyboardNavigationServic
|
|||
selectedItem = null
|
||||
usersTemplate = $template.get("common/lightbox/lightbox-assigned-to-users.html", true)
|
||||
|
||||
normalizeString = (string) ->
|
||||
normalizedString = string
|
||||
normalizedString = normalizedString.replace("Á", "A").replace("Ä", "A").replace("À", "A")
|
||||
normalizedString = normalizedString.replace("É", "E").replace("Ë", "E").replace("È", "E")
|
||||
normalizedString = normalizedString.replace("Í", "I").replace("Ï", "I").replace("Ì", "I")
|
||||
normalizedString = normalizedString.replace("Ó", "O").replace("Ö", "O").replace("Ò", "O")
|
||||
normalizedString = normalizedString.replace("Ú", "U").replace("Ü", "U").replace("Ù", "U")
|
||||
return normalizedString
|
||||
|
||||
filterUsers = (text, user) ->
|
||||
username = user.full_name_display.toUpperCase()
|
||||
username = normalizeString(username)
|
||||
|
@ -474,15 +466,6 @@ AssignedUsersLightboxDirective = ($repo, lightboxService, lightboxKeyboardNaviga
|
|||
selectedItem = null
|
||||
usersTemplate = $template.get("common/lightbox/lightbox-assigned-users-users.html", true)
|
||||
|
||||
normalizeString = (string) ->
|
||||
normalizedString = string
|
||||
normalizedString = normalizedString.replace("Á", "A").replace("Ä", "A").replace("À", "A")
|
||||
normalizedString = normalizedString.replace("É", "E").replace("Ë", "E").replace("È", "E")
|
||||
normalizedString = normalizedString.replace("Í", "I").replace("Ï", "I").replace("Ì", "I")
|
||||
normalizedString = normalizedString.replace("Ó", "O").replace("Ö", "O").replace("Ò", "O")
|
||||
normalizedString = normalizedString.replace("Ú", "U").replace("Ü", "U").replace("Ù", "U")
|
||||
return normalizedString
|
||||
|
||||
filterUsers = (text, user) ->
|
||||
username = user.full_name_display.toUpperCase()
|
||||
username = normalizeString(username)
|
||||
|
|
|
@ -270,6 +270,15 @@ randomInt = (start, end) ->
|
|||
interval = end - start
|
||||
return start + Math.floor(Math.random()*(interval+1))
|
||||
|
||||
normalizeString = (string) ->
|
||||
normalizedString = string
|
||||
normalizedString = normalizedString.replace("Á", "A").replace("Ä", "A").replace("À", "A")
|
||||
normalizedString = normalizedString.replace("É", "E").replace("Ë", "E").replace("È", "E")
|
||||
normalizedString = normalizedString.replace("Í", "I").replace("Ï", "I").replace("Ì", "I")
|
||||
normalizedString = normalizedString.replace("Ó", "O").replace("Ö", "O").replace("Ò", "O")
|
||||
normalizedString = normalizedString.replace("Ú", "U").replace("Ü", "U").replace("Ù", "U")
|
||||
return normalizedString
|
||||
|
||||
taiga = @.taiga
|
||||
taiga.addClass = addClass
|
||||
taiga.nl2br = nl2br
|
||||
|
@ -302,3 +311,4 @@ taiga.getRandomDefaultColor = getRandomDefaultColor
|
|||
taiga.getDefaulColorList = getDefaulColorList
|
||||
taiga.getMatches = getMatches
|
||||
taiga.randomInt = randomInt
|
||||
taiga.normalizeString = normalizeString
|
||||
|
|
Loading…
Reference in New Issue