gutenberg
3 years ago
gutenbergComponents
3 years ago
autoupdate_banner.js
3 years ago
banner_main.js
3 years ago
circle-progress.js
3 years ago
datatables.min.js
4 years ago
jquery.multi-select.js
4 years ago
jquery.tagsinput.min.js
4 years ago
referral_program.js
3 years ago
sidebar-plugin.js
3 years ago
speed.js
3 years ago
two_admin.js
1 year ago
two_admin_bar.js
4 years ago
two_bf_countdown.js
3 years ago
two_deactivate_plugin.js
3 years ago
two_elementor_editor.js
2 years ago
two_preview.js
3 years ago
two_update_white_label.js
1 year ago
two_white_label.js
2 years ago
two_white_label.js
45 lines
| 1 | jQuery("document").ready(function () { |
| 2 | jQuery('#two-save-company-name').click(function(){ |
| 3 | if( jQuery('#two-company-name').val() != '' ) { |
| 4 | let company_name = jQuery('#two-company-name').val(); |
| 5 | let support_url = jQuery('#two-support-url').val(); |
| 6 | change_company_name( company_name, support_url ); |
| 7 | } |
| 8 | }); |
| 9 | jQuery('#two-white-label-status').click(function(){ |
| 10 | // to not allow check on toggle |
| 11 | if( jQuery(this).is(":checked") ) { |
| 12 | jQuery('#two-white-label-status').prop("checked", false); |
| 13 | } else { |
| 14 | jQuery('#two-company-name').val(''); |
| 15 | change_company_name( '', '' ); |
| 16 | } |
| 17 | }) |
| 18 | jQuery('#two-company-name').on('keyup',function(){ |
| 19 | if( jQuery(this).val() != '' ) { |
| 20 | jQuery('#two-save-company-name').prop('disabled', false); |
| 21 | } else { |
| 22 | jQuery('#two-save-company-name').prop('disabled', true); |
| 23 | } |
| 24 | }) |
| 25 | }) |
| 26 | |
| 27 | function change_company_name(company_name, support_url) { |
| 28 | jQuery.ajax({ |
| 29 | type: "POST", |
| 30 | url: two_admin_vars.ajaxurl, |
| 31 | data: { |
| 32 | 'action': 'two_white_label', |
| 33 | 'nonce': two_admin_vars.ajaxnonce, |
| 34 | 'company_name': company_name, |
| 35 | 'support_url': support_url, |
| 36 | }, |
| 37 | }).done(function () { |
| 38 | if( company_name != '' ) { |
| 39 | location.reload(); |
| 40 | } else { |
| 41 | jQuery('#two-save-company-name').prop('disabled', true); |
| 42 | } |
| 43 | }) |
| 44 | } |
| 45 |