2015-04-26 12:48:37 +05:30
|
|
|
class @Admin
|
2014-09-02 18:07:02 +05:30
|
|
|
constructor: ->
|
|
|
|
$('input#user_force_random_password').on 'change', (elem) ->
|
|
|
|
elems = $('#user_password, #user_password_confirmation')
|
|
|
|
|
|
|
|
if $(@).attr 'checked'
|
|
|
|
elems.val('').attr 'disabled', true
|
|
|
|
else
|
|
|
|
elems.removeAttr 'disabled'
|
|
|
|
|
|
|
|
$('body').on 'click', '.js-toggle-colors-link', (e) ->
|
|
|
|
e.preventDefault()
|
2016-01-19 16:12:03 +05:30
|
|
|
$('.js-toggle-colors-container').toggle()
|
2014-09-02 18:07:02 +05:30
|
|
|
|
|
|
|
$('.log-tabs a').click (e) ->
|
|
|
|
e.preventDefault()
|
|
|
|
$(this).tab('show')
|
|
|
|
|
|
|
|
$('.log-bottom').click (e) ->
|
|
|
|
e.preventDefault()
|
|
|
|
visible_log = $(".file-content:visible")
|
|
|
|
visible_log.animate({ scrollTop: visible_log.find('ol').height() }, "fast")
|
|
|
|
|
|
|
|
modal = $('.change-owner-holder')
|
|
|
|
|
|
|
|
$('.change-owner-link').bind "click", (e) ->
|
|
|
|
e.preventDefault()
|
|
|
|
$(this).hide()
|
|
|
|
modal.show()
|
|
|
|
|
|
|
|
$('.change-owner-cancel-link').bind "click", (e) ->
|
|
|
|
e.preventDefault()
|
|
|
|
modal.hide()
|
|
|
|
$('.change-owner-link').show()
|
|
|
|
|
2015-04-26 12:48:37 +05:30
|
|
|
$('li.project_member').bind 'ajax:success', ->
|
2014-09-02 18:07:02 +05:30
|
|
|
Turbolinks.visit(location.href)
|
|
|
|
|
2015-04-26 12:48:37 +05:30
|
|
|
$('li.group_member').bind 'ajax:success', ->
|
2014-09-02 18:07:02 +05:30
|
|
|
Turbolinks.visit(location.href)
|
2016-08-24 12:49:21 +05:30
|
|
|
|
|
|
|
showBlacklistType = ->
|
|
|
|
if $("input[name='blacklist_type']:checked").val() == 'file'
|
|
|
|
$('.blacklist-file').show()
|
|
|
|
$('.blacklist-raw').hide()
|
|
|
|
else
|
|
|
|
$('.blacklist-file').hide()
|
|
|
|
$('.blacklist-raw').show()
|
|
|
|
|
|
|
|
$("input[name='blacklist_type']").click showBlacklistType
|
|
|
|
showBlacklistType()
|