403Webshell
Server IP : 146.59.209.152  /  Your IP : 216.73.216.46
Web Server : Apache
System : Linux webm005.cluster131.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64
User : infrafs ( 43850)
PHP Version : 8.2.29
Disable Function : _dyuweyrj4,_dyuweyrj4r,dl
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/infrafs/INFRABIKEDE/wp-content/plugins/weglot/app/javascripts/settings/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/infrafs/INFRABIKEDE/wp-content/plugins/weglot/app/javascripts/settings/admin-check-api-key.js
const init_admin_button_preview = function () {
	const $ = jQuery

	const execute = () => {

		$("#api_key_private").blur(function() {
			var key = $(this).val();
			if( key.length === 0){
                $(".weglot-keyres").remove();
                $("#api_key_private").after('<span class="weglot-keyres weglot-nokkey"></span>');
                $("#wrap-weglot #submit").prop("disabled", true);
				return;
			}

			function validApiKey(response){

				$(".weglot-keyres").remove();
				$("#api_key_private").after(
					'<span class="weglot-keyres weglot-okkey"></span>'
				);

				$("#wrap-weglot #submit").prop(
					"disabled",
					false
				);

				const evt = new CustomEvent("weglotCheckApi", {
					detail: response
				});

				window.dispatchEvent(evt);
			}

			function unvalidApiKey(){
				$(".weglot-keyres").remove();
				$("#api_key_private").after('<span class="weglot-keyres weglot-nokkey"></span><p class="weglot-keyres">Make sure you enter a valid Weglot API key. If the key is still not validating, you can contact your host provider and ask if it\'s possible to whitelist api.weglot.com and weglot.com</p>');
				$("#wrap-weglot #submit").prop("disabled", true);
			}

			$(".weglot-keyres").remove();
			$("#api_key_private").after('<span class="weglot-keyres weglot-ckeckkey"></span>');

			$.ajax(
				{
					method: 'POST',
					url: ajaxurl,
					data : {
						action: 'get_user_info',
						api_key: key,
					},
					success: ({data, success}) => {
						$(".weglot-keyres").remove();
						if (success ){
							validApiKey(data)
						}
						else{
							unvalidApiKey()
						}

					}
				}
			).fail(function() {
				unvalidApiKey()
			});
		});

		$( ".toplevel_page_weglot-settings form" ).submit(function( event ) {
			$("#wrap-weglot #submit").prop("disabled", true);
		});

	}

	document.addEventListener('DOMContentLoaded', () => {
		execute();
	})
}

export default init_admin_button_preview;


Youez - 2016 - github.com/yon3zu
LinuXploit