summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/lib/utils/common_utils.js.coffee
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/lib/utils/common_utils.js.coffee')
-rw-r--r--app/assets/javascripts/lib/utils/common_utils.js.coffee68
1 files changed, 0 insertions, 68 deletions
diff --git a/app/assets/javascripts/lib/utils/common_utils.js.coffee b/app/assets/javascripts/lib/utils/common_utils.js.coffee
deleted file mode 100644
index d4dd3dc329a..00000000000
--- a/app/assets/javascripts/lib/utils/common_utils.js.coffee
+++ /dev/null
@@ -1,68 +0,0 @@
-((w) ->
-
- w.gl or= {}
- w.gl.utils or= {}
-
- w.gl.utils.isInGroupsPage = ->
-
- return gl.utils.getPagePath() is 'groups'
-
-
- w.gl.utils.isInProjectPage = ->
-
- return gl.utils.getPagePath() is 'projects'
-
-
- w.gl.utils.getProjectSlug = ->
-
- return if @isInProjectPage() then $('body').data 'project' else null
-
-
- w.gl.utils.getGroupSlug = ->
-
- return if @isInGroupsPage() then $('body').data 'group' else null
-
-
-
- gl.utils.updateTooltipTitle = ($tooltipEl, newTitle) ->
-
- $tooltipEl
- .tooltip 'destroy'
- .attr 'title', newTitle
- .tooltip 'fixTitle'
-
-
- gl.utils.preventDisabledButtons = ->
-
- $('.btn').click (e) ->
- if $(this).hasClass 'disabled'
- e.preventDefault()
- e.stopImmediatePropagation()
- return false
-
- gl.utils.getPagePath = ->
- return $('body').data('page').split(':')[0]
-
-
- jQuery.timefor = (time, suffix, expiredLabel) ->
-
- return '' unless time
-
- suffix or= 'remaining'
- expiredLabel or= 'Past due'
-
- jQuery.timeago.settings.allowFuture = yes
-
- { suffixFromNow } = jQuery.timeago.settings.strings
- jQuery.timeago.settings.strings.suffixFromNow = suffix
-
- timefor = $.timeago time
-
- if timefor.indexOf('ago') > -1
- timefor = expiredLabel
-
- jQuery.timeago.settings.strings.suffixFromNow = suffixFromNow
-
- return timefor
-
-) window