|
|
@@ -1,45 +1,7 @@
|
|
|
-// Page entry point
|
|
|
-// Trigger listeners
|
|
|
-App.Listeners.DB.keypress_custom_folder();
|
|
|
-App.Listeners.DB.change_custom_doc();
|
|
|
-
|
|
|
-App.Actions.WEB.update_ftp_username_hint = function (elm, hint) {
|
|
|
- if (hint.trim() == '') {
|
|
|
- $(elm).parent().find('.hint').text('');
|
|
|
- }
|
|
|
-
|
|
|
- hint = hint.replace(/[^\w\d]/gi, '');
|
|
|
-
|
|
|
- $(elm).parent().find('.js-ftp-user').val(hint);
|
|
|
- $(elm)
|
|
|
- .parent()
|
|
|
- .find('.hint')
|
|
|
- .text(Alpine.store('globals').FTP_USER_PREFIX + hint);
|
|
|
-};
|
|
|
-
|
|
|
-App.Listeners.WEB.keypress_ftp_username = function () {
|
|
|
- var ftp_user_inputs = $('.js-ftp-user');
|
|
|
- $.each(ftp_user_inputs, function (i, ref) {
|
|
|
- var $ref = $(ref);
|
|
|
- var current_val = $ref.val();
|
|
|
- if (current_val.trim() != '') {
|
|
|
- App.Actions.WEB.update_ftp_username_hint($ref, current_val);
|
|
|
- }
|
|
|
-
|
|
|
- $ref.bind('keypress input', function (evt) {
|
|
|
- clearTimeout(window.frp_usr_tmt);
|
|
|
- window.frp_usr_tmt = setTimeout(function () {
|
|
|
- var elm = $(evt.target);
|
|
|
- App.Actions.WEB.update_ftp_username_hint(elm, $(elm).val());
|
|
|
- }, 100);
|
|
|
- });
|
|
|
- });
|
|
|
-};
|
|
|
-
|
|
|
App.Listeners.WEB.keypress_domain_name = function () {
|
|
|
$('#v_domain').bind('keypress input', function () {
|
|
|
- clearTimeout(window.frp_usr_tmt);
|
|
|
- window.frp_usr_tmt = setTimeout(function () {
|
|
|
+ clearTimeout(window.frpUserTimeout);
|
|
|
+ window.frpUserTimeout = setTimeout(function () {
|
|
|
$('#v-custom-doc-domain-main').text($('#v_domain').val());
|
|
|
$('#v-custom-doc-domain-main').val($('#v_domain').val());
|
|
|
App.Actions.WEB.update_custom_doc_root(13, 12);
|
|
|
@@ -47,24 +9,8 @@ App.Listeners.WEB.keypress_domain_name = function () {
|
|
|
});
|
|
|
};
|
|
|
|
|
|
-App.Actions.WEB.toggle_letsencrypt = function (elm) {
|
|
|
- if ($(elm).prop('checked')) {
|
|
|
- $(
|
|
|
- '#ssltable textarea[name=v_ssl_crt],#ssltable textarea[name=v_ssl_key], #ssltable textarea[name=v_ssl_ca]'
|
|
|
- ).attr('disabled', 'disabled');
|
|
|
- $('#generate-csr').hide();
|
|
|
- } else {
|
|
|
- $(
|
|
|
- '#ssltable textarea[name=v_ssl_crt],#ssltable textarea[name=v_ssl_key], #ssltable textarea[name=v_ssl_ca]'
|
|
|
- ).removeAttr('disabled');
|
|
|
- $('#generate-csr').show();
|
|
|
- }
|
|
|
-};
|
|
|
-
|
|
|
//
|
|
|
// Page entry point
|
|
|
-App.Listeners.WEB.keypress_ftp_username();
|
|
|
-App.Listeners.WEB.keypress_ftp_path();
|
|
|
App.Listeners.WEB.keypress_domain_name();
|
|
|
|
|
|
$(function () {
|
|
|
@@ -77,15 +23,4 @@ $(function () {
|
|
|
prefix + document.getElementById('v_domain').value;
|
|
|
}
|
|
|
});
|
|
|
- App.Actions.WEB.toggle_letsencrypt($('input[name=v_letsencrypt]'));
|
|
|
-
|
|
|
- $('select[name="v_stats"]').change(function (evt) {
|
|
|
- var select = $(evt.target);
|
|
|
-
|
|
|
- if (select.val() == 'none') {
|
|
|
- $('.stats-auth').hide();
|
|
|
- } else {
|
|
|
- $('.stats-auth').show();
|
|
|
- }
|
|
|
- });
|
|
|
});
|