user.js 851 B

12345678910111213141516171819202122232425262728
  1. $(document).ready(function() {
  2. // Show and activate password fields after box was checked
  3. // Hidden by default
  4. if ( !$("#togglePwNew").is(':checked') ) {
  5. $(".passFields").hide();
  6. }
  7. $('#togglePwNew').click(function() {
  8. $("#user_new_pass").attr("disabled", !this.checked);
  9. $("#user_new_pass2").attr("disabled", !this.checked);
  10. var $this = $(this);
  11. if ($this.is(':checked')) {
  12. $(".passFields").slideDown();
  13. } else {
  14. $(".passFields").slideUp();
  15. }
  16. });
  17. // Show generate button after time selection
  18. $('#trigger_set_time_limited_aliases').hide();
  19. $('#validity').change(function(){
  20. $('#trigger_set_time_limited_aliases').show();
  21. });
  22. // Init Bootstrap Switch
  23. $.fn.bootstrapSwitch.defaults.onColor = 'success';
  24. $("[name='tls_out']").bootstrapSwitch();
  25. $("[name='tls_in']").bootstrapSwitch();
  26. });