2014-10-20 16:48:07 -04:00
|
|
|
class @Admin
|
2013-05-02 07:51:47 -04:00
|
|
|
constructor: ->
|
2013-05-02 04:46:45 -04:00
|
|
|
$('input#user_force_random_password').on 'change', (elem) ->
|
|
|
|
elems = $('#user_password, #user_password_confirmation')
|
2012-09-06 07:32:01 -04:00
|
|
|
|
2013-05-02 04:46:45 -04:00
|
|
|
if $(@).attr 'checked'
|
|
|
|
elems.val('').attr 'disabled', true
|
|
|
|
else
|
|
|
|
elems.removeAttr 'disabled'
|
2012-09-11 16:24:53 -04:00
|
|
|
|
2013-12-09 00:34:51 -05:00
|
|
|
$('body').on 'click', '.js-toggle-colors-link', (e) ->
|
|
|
|
e.preventDefault()
|
2015-12-31 15:19:13 -05:00
|
|
|
$('.js-toggle-colors-container').toggle()
|
2013-12-09 00:34:51 -05:00
|
|
|
|
|
|
|
$('input#broadcast_message_color').on 'input', ->
|
2015-12-31 15:56:59 -05:00
|
|
|
previewColor = $(@).val()
|
2013-12-09 00:34:51 -05:00
|
|
|
$('div.broadcast-message-preview').css('background-color', previewColor)
|
|
|
|
|
|
|
|
$('input#broadcast_message_font').on 'input', ->
|
2015-12-31 15:56:59 -05:00
|
|
|
previewColor = $(@).val()
|
2013-12-09 00:34:51 -05:00
|
|
|
$('div.broadcast-message-preview').css('color', previewColor)
|
|
|
|
|
|
|
|
$('textarea#broadcast_message_message').on 'input', ->
|
2015-12-31 15:56:59 -05:00
|
|
|
previewMessage = $(@).val()
|
|
|
|
previewMessage = "Your message here" if previewMessage.trim() == ''
|
2013-12-09 00:34:51 -05:00
|
|
|
$('div.broadcast-message-preview span').text(previewMessage)
|
|
|
|
|
2013-05-02 04:46:45 -04:00
|
|
|
$('.log-tabs a').click (e) ->
|
|
|
|
e.preventDefault()
|
|
|
|
$(this).tab('show')
|
2012-11-28 23:49:11 -05:00
|
|
|
|
2013-05-02 04:46:45 -04:00
|
|
|
$('.log-bottom').click (e) ->
|
|
|
|
e.preventDefault()
|
2013-07-13 02:52:47 -04:00
|
|
|
visible_log = $(".file-content:visible")
|
2013-05-02 04:46:45 -04:00
|
|
|
visible_log.animate({ scrollTop: visible_log.find('ol').height() }, "fast")
|
|
|
|
|
|
|
|
modal = $('.change-owner-holder')
|
|
|
|
|
2013-06-10 08:58:51 -04:00
|
|
|
$('.change-owner-link').bind "click", (e) ->
|
|
|
|
e.preventDefault()
|
2013-05-02 04:46:45 -04:00
|
|
|
$(this).hide()
|
|
|
|
modal.show()
|
2013-08-27 14:35:41 -04:00
|
|
|
|
2013-06-10 08:58:51 -04:00
|
|
|
$('.change-owner-cancel-link').bind "click", (e) ->
|
|
|
|
e.preventDefault()
|
2013-05-02 04:46:45 -04:00
|
|
|
modal.hide()
|
|
|
|
$('.change-owner-link').show()
|
2013-05-02 07:51:47 -04:00
|
|
|
|
2014-09-14 12:32:51 -04:00
|
|
|
$('li.project_member').bind 'ajax:success', ->
|
2013-08-27 14:35:41 -04:00
|
|
|
Turbolinks.visit(location.href)
|
|
|
|
|
2014-09-14 12:32:51 -04:00
|
|
|
$('li.group_member').bind 'ajax:success', ->
|
2013-08-27 14:35:41 -04:00
|
|
|
Turbolinks.visit(location.href)
|