;var posTop = 0; ;function openFileSendPopup(filename){ if($('#fileSendPopup').hasClass('active')){ $('#fileSendPopup').removeClass('active'); } else{ $('#fileSendPopup').addClass('active'); } document.querySelectorAll('.vic92eden-mail-servise-modal-box #filename')[0].value = filename; var hiddenElement = document.getElementById("fileSendPopup"); hiddenElement.scrollIntoView({block: "center", behavior: "smooth"}); posTop = Math.max( document.body.scrollHeight, document.documentElement.scrollHeight, document.body.offsetHeight, document.documentElement.offsetHeight, document.body.clientHeight, document.documentElement.clientHeight ); }; ;function closeFileSendPopup(){ if($('#fileSendPopup').hasClass('active')){ $('#fileSendPopup').removeClass('active'); } document.getElementById('checkRequest').innerHTML = ''; document.querySelectorAll('input[name="username"]')[0].value = ''; document.querySelectorAll('input[name="email"]')[0].value = ''; document.querySelectorAll('input[name="filename"]')[0].value = ''; console.log(posTop); }; ;function requestFileSend(){ var data = new Object(); data = { '_csrf' : 'ZREY5I5kZR3KD9zpPIYbPyVKH9QHAm-n9LNnukvvWxRUc12G_ABVc4NFq95yv0tgd3JTgFhbC8216x3VBIEUJQ==', 'username' : document.querySelectorAll('input[name="username"]')[0].value, 'email' : document.querySelectorAll('input[name="email"]')[0].value, 'filename' : document.querySelectorAll('input[name="filename"]')[0].value, 'lang' : document.documentElement.lang, }; $.ajax({ type: 'GET', url: '/app/web/index.php', data: data, dataType: 'html', success: function(data) { document.getElementById('checkRequest').innerHTML = data; setTimeout(closeFileSendPopup,5000); }, error: function(XMLHttpRequest, textStatus, errorThrown) { console.log(errorThrown); console.log(XMLHttpRequest.responseText); console.log(errorThrown); console.log(data); setTimeout(closeFileSendPopup,5000); } }); }; ;var lang = document.documentElement.lang, translate = new Object(); translate["en"] = []; translate["en"]["windowTitle"] = "Send file"; translate["en"]["labelForName"] = "Your Name"; translate["en"]["placeholderForName"] = "Your Name"; translate["en"]["labelForEmail"] = "Your email"; translate["en"]["placeholderForEmail"] = "Your email"; translate["en"]["SendButtonTitle"] = "Send"; translate["ru"] = []; translate["ru"]["windowTitle"] = "Послать файл"; translate["ru"]["labelForName"] = "Ваше имя"; translate["ru"]["placeholderForName"] = "Ваше имя"; translate["ru"]["labelForEmail"] = "Ваш E-mail"; translate["ru"]["placeholderForEmail"] = "Ваш E-mail"; translate["ru"]["SendButtonTitle"] = "Послать"; translate["uk"] = []; translate["uk"]["windowTitle"] = "Надіслати файл"; translate["uk"]["labelForName"] = "Ваше ім'я"; translate["uk"]["placeholderForName"] = "Ваше ім'я"; translate["uk"]["labelForEmail"] = "Ваш E-mail"; translate["uk"]["placeholderForEmail"] = "Ваш E-mail"; translate["uk"]["SendButtonTitle"] = "Надіслати"; document.querySelectorAll('.vic92eden-mail-servise-modal-box .popup-heading span')[0].innerHTML = translate[lang]['windowTitle']; document.querySelectorAll('.vic92eden-mail-servise-modal-box label[for="sendfile-name"]')[0].innerHTML = translate[lang]['labelForName']; document.querySelectorAll('.vic92eden-mail-servise-modal-box input[name="username"]')[0].setAttribute('placeholder',translate[lang]['placeholderForName']); document.querySelectorAll('.vic92eden-mail-servise-modal-box label[for="sendfile-email"]')[0].innerHTML = translate[lang]['labelForEmail']; document.querySelectorAll('.vic92eden-mail-servise-modal-box input[name="email"]')[0].setAttribute('placeholder',translate[lang]['placeholderForEmail']); document.querySelectorAll('.vic92eden-mail-servise-modal-box button[onclick="requestFileSend()"]')[0].innerHTML = translate[lang]['SendButtonTitle'];