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 / admin / option-page-dictionary.js

option-page-dictionary.js in Translate and Go multilingual – Automatic AI translation – wpLingua 2.14.3, at assets/js/admin/option-page-dictionary.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(i){let r=JSON.parse(i("#wplng_dictionary_entries").val());function n(e){e.each(function(){var e,t=this,n=(t.style.height="0px",window.getComputedStyle(t));"border-box"===n.boxSizing?(e=parseFloat(n.borderTopWidth)+parseFloat(n.borderBottomWidth),t.style.height=t.scrollHeight+e+"px"):(e=parseFloat(n.paddingTop)+parseFloat(n.paddingBottom),t.style.height=t.scrollHeight-e+"px")})}i("#wplng-new-rule-button").click(function(){i("#wplng-section-entries-all").hide(),i("#wplng-section-entry-new").show(),n(i("#wplng-dictionary-entry-new .wplng-adaptive-textarea")),window.scrollTo(0,0)}),i("#wplng-new-never-translate").change(function(){this.checked?i("#wplng-new-rules").slideUp("fast"):i("#wplng-new-rules").slideDown("fast")}),i("#wplng-new-add-button").click(function(){var e=i("#wplng-new-source").val();let n={};null!=e&&""!=e.trim()&&(i("#wplng-edit-never-translate").prop("checked")||i(".wplng-new-rule").each(function(){var e=i(this).attr("wplng-rule"),t=i("textarea",this).val();null!=t&&""!=t.trim()&&(n[e]=t.trim())}),0==Object.keys(n).length?r.push({source:e}):r.push({source:e,rules:n}),i("#wplng_dictionary_entries").val(JSON.stringify(r)),i("#submit").click())}),i("#wplng-new-cancel-button").click(function(){i("#wplng-section-entries-all").show(),i("#wplng-section-entry-new").hide(),window.scrollTo(0,0)}),i(".wplng-rule-link-remove").click(function(){let t=i(this).attr("wplng-rule"),n=[],l=0;r.forEach(e=>{l!=t&&n.push(e),l++}),i("#wplng_dictionary_entries").val(JSON.stringify(n)),i("#submit").click()}),i(".wplng-rule-link-edit").click(function(){var e=i(this).attr("wplng-rule"),t=r[e];i("#wplng-section-entries-all").hide(),i("#wplng-section-entry-edit").show(),n(i("#wplng-dictionary-entry-edit .wplng-adaptive-textarea")),i("#wplng-edit-source").val(t.source),i("#wplng-edit-save-button").prop("wplng-rule",e),null==t.rules?(i("#wplng-edit-never-translate").prop("checked",!0),i("#wplng-edit-rules").hide()):(i("#wplng-edit-never-translate").prop("checked",!1),i("#wplng-edit-rules").show(),i("#wplng-edit-rules textarea").val(""),i.each(t.rules,function(e,t){i("#wplng-edit-always-translate-"+e).val(t)})),window.scrollTo(0,0)}),i("#wplng-edit-never-translate").change(function(){this.checked?i("#wplng-edit-rules").slideUp("fast"):i("#wplng-edit-rules").slideDown("fast")}),i("#wplng-edit-save-button").click(function(){var e=i("#wplng-edit-source").val();let n={};var t=i(this).prop("wplng-rule");null!=e&&""!=e.trim()&&(i("#wplng-edit-never-translate").prop("checked")||i(".wplng-edit-rule").each(function(){var e=i(this).attr("wplng-rule"),t=i("textarea",this).val();null!=t&&""!=t.trim()&&(n[e]=t.trim())}),r.splice(t,1),0==Object.keys(n).length?r.push({source:e}):r.push({source:e,rules:n}),i("#wplng_dictionary_entries").val(JSON.stringify(r)),i("#submit").click())}),i("#wplng-edit-cancel-button").click(function(){i("#wplng-section-entries-all").show(),i("#wplng-section-entry-edit").hide(),window.scrollTo(0,0)});let e=i("textarea.wplng-adaptive-textarea");e.off("keyup.textarea").on("keyup.textarea",function(){n(i(this))}),i(window).resize(function(){e.each(function(){n(i(this))})}),e.each(function(){n(i(this))})});//# sourceMappingURL=option-page-dictionary.js.map
18