PluginProbe
Translate and Go multilingual – Automatic AI translation – wpLingua / 2.14.3
Translate and Go multilingual – Automatic AI translation – wpLingua v2.14.3
2.16.7 2.16.6 2.16.5 2.16.4 2.16.3 2.16.2 2.16.1 2.16.0 2.15.2 2.15.1 2.15.0 2.14.3 2.14.2 2.14.1 2.14.0 2.13.1 2.13.0 2.12.3 2.12.2 2.12.1 trunk 1.0.3 1.0.4 1.0.5 1.1.0 All 112 releases
wplingua / assets / js / load-in-progress.js

load-in-progress.js in Translate and Go multilingual – Automatic AI translation – wpLingua 2.14.3, at assets/js/load-in-progress.js

18 lines 3.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /*!*
2 ** _ _
3 ** __ ___ __ | | (_)_ __ __ _ _ _ __ _
4 ** \ \ /\ / / '_ \| | | | '_ \ / _` | | | |/ _` |
5 ** \ V V /| |_) | |___| | | | | (_| | |_| | (_| |
6 ** \_/\_/ | .__/|_____|_|_| |_|\__, |\__,_|\__,_|
7 ** |_| |___/
8 **
9 ** -- wpLingua | WordPress plugin --
10 ** Translate and make your website multilingual
11 **
12 ** https://github.com/julien-jacob/wplingua
13 ** https://wordpress.org/plugins/wplingua/
14 ** https://wplingua.com/
15 **
16 **/
17 jQuery(document).ready(function(p){let d=1,a=1,e=!1;function c(n){e=!0,p("#wplng-in-progress-message").hide(),p("#wplng-progress-bar").hide(),p("#wplng-in-progress-error").show(),n="wpLingua error - Load in progress: "+n,console.error(n)}function w(n){p("#wplng-in-progress-percent").html(n),p("#wplng-progress-bar-value").animate({width:n.toString()+"%"},500)}function n(){var n=parseInt(p("#wplng-in-progress-percent").html());n<d&&!e?w(d):n<a&&n<99&&!e&&w(++n)}p("#wplng-in-progress-container").length?"undefined"==typeof wplngLoadInProgressData?(c("Invalide data (wplngLoadInProgressData undefined)."),console.info(wplngLoadInProgressData)):"string"!=typeof wplngLoadInProgressData.urlAjax?(c("Invalide data (wplngLoadInProgressData.urlAjax)."),console.info(wplngLoadInProgressData.urlAjax)):"string"!=typeof wplngLoadInProgressData.urlReload?(c("Invalide data (wplngLoadInProgressData.urlReload)."),console.info(wplngLoadInProgressData.urlReload)):"string"!=typeof wplngLoadInProgressData.nonce||0===wplngLoadInProgressData.nonce.length?(c("Invalide data (wplngLoadInProgressData.nonce)."),console.info(wplngLoadInProgressData.nonce)):"string"!=typeof wplngLoadInProgressData.language||2!==wplngLoadInProgressData.language.length?(c("Invalide data (wplngLoadInProgressData.language)."),console.info(wplngLoadInProgressData.language)):"object"!=typeof wplngLoadInProgressData.chunks||0===wplngLoadInProgressData.chunks.length?(c("Invalide data (wplngLoadInProgressData.chunks)."),console.info(wplngLoadInProgressData.chunks)):function o(r,s,t,l,g){if(!g[r]||"object"!=typeof g[r]||"number"!=typeof g[r].percentage||"object"!=typeof g[r].texts||0===g[r].texts.length)return c("Invalide text chunk."),void console.info(g[r]);let i=g[r].percentage;let n=g[r].texts;a=i;p.ajax({url:s,method:"POST",data:{action:"wplng_load_in_progress",wplng_language:l,wplng_texts:n,wplng_nonce:wplngLoadInProgressData.nonce},success:function(a){if(a.success){d=i;let n=a.data,e=Object.create(null);Array.isArray(n)&&n.forEach(function(n){n&&"string"==typeof n.source&&(e[n.source.trim()]="string"==typeof n.translation?n.translation:"")}),p(".wplng-in-progress-text").each(function(){let n=p(this).text().trim(),a=e[n];"string"==typeof a&&0<a.length&&p(this).replaceWith(a)}),void 0===g[r+1]?(w(100),window.location.href=t):o(r+1,s,t,l,g)}else"object"==typeof a.data&&"string"==typeof a.data.error_message?c("Translation AJAX call fail (message: "+a.data.error_message+")."):c("Translation AJAX call fail (response.success is false, unknow message).")},error:function(n){c("Translation AJAX call fail (callback error).")}})}(0,wplngLoadInProgressData.urlAjax,wplngLoadInProgressData.urlReload,wplngLoadInProgressData.language,wplngLoadInProgressData.chunks):c("Mode loaded without the progress bar container"),p("#wplng-in-progress-error-close").on("click",function(){p("#wplng-in-progress-container").hide(),p("#wpadminbar").show(),"string"==typeof wplngLoadInProgressData.urlReload&&(window.location.href=wplngLoadInProgressData.urlReload)}),n(),p("#wplng-in-progress-percent").length&&setInterval(n,500),p("#wpadminbar").length&&p("#wplng-in-progress-container").length&&p("#wpadminbar").hide()});//# sourceMappingURL=load-in-progress.js.map
18