diff --git a/assets/js/sections/user.js b/assets/js/sections/user.js index 89d118804..940c791bc 100644 --- a/assets/js/sections/user.js +++ b/assets/js/sections/user.js @@ -103,83 +103,83 @@ function convert_user(user_id, convert_to) { $(document).ready(function(){ - $('#adminusertable').DataTable({ - "pageLength": 25, - responsive: true, - ordering: true, - "scrollY": "100%", - "scrollCollapse": true, - "paging": true, - "language": { - url: getDataTablesLanguageUrl(), - }, - dom: 'Bfrtip', - buttons: [ - { - extend: 'csv', - exportOptions: { - columns: [ 0, 1, 2, 3, 4, 5 ] - } - } - ] - }); + $('#adminusertable').DataTable({ + "pageLength": 25, + responsive: true, + ordering: true, + "scrollY": "100%", + "scrollCollapse": true, + "paging": true, + "language": { + url: getDataTablesLanguageUrl(), + }, + dom: 'Bfrtip', + buttons: [ + { + extend: 'csv', + exportOptions: { + columns: [ 0, 1, 2, 3, 4, 5 ] + } + } + ] + }); - $('#adminclubusertable').DataTable({ - "pageLength": 25, - responsive: true, - ordering: true, - "scrollY": "100%", - "scrollCollapse": true, - "paging": true, - "language": { - url: getDataTablesLanguageUrl(), - }, - dom: 'Bfrtip', - buttons: [ - { - extend: 'csv', - exportOptions: { - columns: [ 0, 1, 2, 3, 4, 5 ] - } - } - ] - }); + $('#adminclubusertable').DataTable({ + "pageLength": 25, + responsive: true, + ordering: true, + "scrollY": "100%", + "scrollCollapse": true, + "paging": true, + "language": { + url: getDataTablesLanguageUrl(), + }, + dom: 'Bfrtip', + buttons: [ + { + extend: 'csv', + exportOptions: { + columns: [ 0, 1, 2, 3, 4, 5 ] + } + } + ] + }); - $(function () { - $('.btn-tooltip').tooltip(); - }); + $(function () { + $('.btn-tooltip').tooltip(); + }); - $('.icon_selectBox').off('click').on('click', function(){ - var boxcontent = $(this).attr('data-boxcontent'); - if ($('.icon_selectBox_data[data-boxcontent="'+boxcontent+'"]').is(":hidden")) { $('.icon_selectBox_data[data-boxcontent="'+boxcontent+'"]').show(); } else { $('.icon_selectBox_data[data-boxcontent="'+boxcontent+'"]').hide(); } - }); - $('.icon_selectBox_data').off('mouseleave').on('mouseleave', function(){ if ($(this).is(":visible")) { $(this).hide(); } }); - $('.icon_selectBox_data label').off('click').on('click', function(){ - var boxcontent = $(this).closest('.icon_selectBox_data').attr('data-boxcontent'); - $('input[name="user_map_'+boxcontent+'_icon"]').attr('value',$(this).attr('data-value')); - if ($(this).attr('data-value') != "0") { - $('.user_icon_color[data-icon="'+boxcontent+'"]').show(); - $('.icon_selectBox[data-boxcontent="'+boxcontent+'"] .icon_overSelect').html($(this).html()); - } else { - $('.user_icon_color[data-icon="'+boxcontent+'"]').hide(); - $('.icon_selectBox[data-boxcontent="'+boxcontent+'"] .icon_overSelect').html($(this).html().substring(0,10)+'.'); - } - $('.icon_selectBox_data[data-boxcontent="'+boxcontent+'"]').hide(); - }); + $('.icon_selectBox').off('click').on('click', function(){ + var boxcontent = $(this).attr('data-boxcontent'); + if ($('.icon_selectBox_data[data-boxcontent="'+boxcontent+'"]').is(":hidden")) { $('.icon_selectBox_data[data-boxcontent="'+boxcontent+'"]').show(); } else { $('.icon_selectBox_data[data-boxcontent="'+boxcontent+'"]').hide(); } + }); + $('.icon_selectBox_data').off('mouseleave').on('mouseleave', function(){ if ($(this).is(":visible")) { $(this).hide(); } }); + $('.icon_selectBox_data label').off('click').on('click', function(){ + var boxcontent = $(this).closest('.icon_selectBox_data').attr('data-boxcontent'); + $('input[name="user_map_'+boxcontent+'_icon"]').attr('value',$(this).attr('data-value')); + if ($(this).attr('data-value') != "0") { + $('.user_icon_color[data-icon="'+boxcontent+'"]').show(); + $('.icon_selectBox[data-boxcontent="'+boxcontent+'"] .icon_overSelect').html($(this).html()); + } else { + $('.user_icon_color[data-icon="'+boxcontent+'"]').hide(); + $('.icon_selectBox[data-boxcontent="'+boxcontent+'"] .icon_overSelect').html($(this).html().substring(0,10)+'.'); + } + $('.icon_selectBox_data[data-boxcontent="'+boxcontent+'"]').hide(); + }); - $('.collapse').on('shown.bs.collapse', function(e) { - var $card = $(this).closest('.accordion-item'); - var $open = $($(this).data('parent')).find('.collapse.show'); + $('.collapse').on('shown.bs.collapse', function(e) { + var $card = $(this).closest('.accordion-item'); + var $open = $($(this).data('parent')).find('.collapse.show'); - var additionalOffset = 0; - if($card.prevAll().filter($open.closest('.accordion-item')).length !== 0) - { - additionalOffset = $open.height(); - } - $('html,body').animate({ - scrollTop: $card.offset().top - additionalOffset - }, 300); - }); + var additionalOffset = 0; + if($card.prevAll().filter($open.closest('.accordion-item')).length !== 0) + { + additionalOffset = $open.height(); + } + $('html,body').animate({ + scrollTop: $card.offset().top - additionalOffset + }, 300); + }); $('#lotw_test_btn').click(function() { var btn_div = $('#lotw_test_btn'); @@ -203,75 +203,81 @@ $(document).ready(function(){ } }, error: function(res) { - btn_div.addClass('alert-danger').removeClass('running').prop('disabled', false);; + btn_div.addClass('alert-danger').removeClass('running').prop('disabled', false);; msg_div.addClass('alert-danger').text('ERROR').show(); }, }) }); - $('.admin_pwd_reset').click(function() { - var pwd_reset_user_name = $(this).data('username'); - var pwd_reset_user_callsign = $(this).data('callsign'); - var pwd_reset_user_id = $(this).data('userid'); - var pwd_reset_user_email = $(this).data('usermail'); + $('.admin_pwd_reset').click(function() { + var pwd_reset_user_name = $(this).data('username'); + var pwd_reset_user_callsign = $(this).data('callsign'); + var pwd_reset_user_id = $(this).data('userid'); + var pwd_reset_user_email = $(this).data('usermail'); - BootstrapDialog.confirm({ - title: lang_general_word_warning, - message: - lang_admin_confirm_pwd_reset + "\n\n" + - lang_admin_user + ": " + pwd_reset_user_name + "\n" + - lang_gen_hamradio_callsign + ": " + pwd_reset_user_callsign, - type: BootstrapDialog.TYPE_DANGER, - btnCancelLabel: lang_general_word_cancel, - btnOKLabel: lang_general_word_ok, - btnOKClass: "btn-warning", - closable: false, // set closable: false, to prevent closing during ajax call - callback: function (result) { - if (result) { - var wait_dialog = BootstrapDialog.show({ - title: lang_general_word_please_wait, - message: '