2013-05-02 07:51:47 -04:00
|
|
|
class Admin
|
|
|
|
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()
|
|
|
|
$('.js-toggle-colors-link').hide()
|
|
|
|
$('.js-toggle-colors-container').show()
|
|
|
|
|
|
|
|
$('input#broadcast_message_color').on 'input', ->
|
|
|
|
previewColor = $('input#broadcast_message_color').val()
|
|
|
|
$('div.broadcast-message-preview').css('background-color', previewColor)
|
|
|
|
|
|
|
|
$('input#broadcast_message_font').on 'input', ->
|
|
|
|
previewColor = $('input#broadcast_message_font').val()
|
|
|
|
$('div.broadcast-message-preview').css('color', previewColor)
|
|
|
|
|
|
|
|
$('textarea#broadcast_message_message').on 'input', ->
|
|
|
|
previewMessage = $('textarea#broadcast_message_message').val()
|
|
|
|
$('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
|
|
|
|
2013-08-27 14:35:41 -04:00
|
|
|
$('li.users_project').bind 'ajax:success', ->
|
|
|
|
Turbolinks.visit(location.href)
|
|
|
|
|
|
|
|
$('li.users_group').bind 'ajax:success', ->
|
|
|
|
Turbolinks.visit(location.href)
|
|
|
|
|
2013-05-02 07:51:47 -04:00
|
|
|
@Admin = Admin
|