Version Description
- (Vendor/Yoast) Fixed issue with attachment caption in Schema Presenter.
- (Core/Options) Avoid warning when
get_plugins
tries to open non-existing folder.
Download this release
Release Info
Developer | tivnet |
Plugin | WPGlobus – Multilingual Everything! |
Version | 2.7.4 |
Comparing to | |
See all releases |
Code changes from version 2.7.3 to 2.7.4
- data/wpglobus-product-info.json +1 -1
- includes/builders/assets/wpglobus-admin-builder-49.min.js +1 -1
- includes/builders/assets/wpglobus-admin-builder-51.min.js +1 -1
- includes/builders/assets/wpglobus-admin-builder-55.min.js +1 -1
- includes/builders/assets/wpglobus-admin-builder-56.min.js +1 -1
- includes/builders/gutenberg/assets/css/dist/wpglobus-block-editor.css +1 -3
- includes/builders/gutenberg/assets/css/dist/wpglobus-block-editor.css.map +0 -1
- includes/builders/gutenberg/assets/css/wpglobus-gutenberg.css +1 -3
- includes/builders/gutenberg/assets/css/wpglobus-gutenberg.css.map +0 -1
- includes/builders/gutenberg/assets/js/wpglobus-gutenberg.min.js +1 -1
- includes/css/wpglobus-admin-debug.css +1 -3
- includes/css/wpglobus-admin-debug.css.map +0 -1
- includes/css/wpglobus-admin-tabs.css +1 -3
- includes/css/wpglobus-admin-tabs.css.map +0 -1
- includes/css/wpglobus-admin.css +1 -3
- includes/css/wpglobus-admin.css.map +0 -1
- includes/css/wpglobus-admin.scss +28 -1
- includes/css/wpglobus-dialog-ui.css +1 -3
- includes/css/wpglobus-dialog-ui.css.map +0 -1
- includes/css/wpglobus-options.css +1 -3
- includes/css/wpglobus-options.css.map +0 -1
- includes/css/wpglobus-special-pages.css +1 -3
- includes/css/wpglobus-special-pages.css.map +0 -1
- includes/css/wpglobus.css +1 -3
- includes/css/wpglobus.css.map +0 -1
- includes/js/wpglobus-admin-47.min.js +1 -1
- includes/js/wpglobus-admin-49.min.js +1 -1
- includes/js/wpglobus-admin-51.min.js +1 -1
- includes/js/wpglobus-admin-55.min.js +1 -1
- includes/js/wpglobus-admin-56.min.js +1 -1
- includes/js/wpglobus-admin-debug.min.js +1 -1
- includes/js/wpglobus-admin.min.js +1 -1
- includes/js/wpglobus-customize-control.min.js +1 -1
- includes/js/wpglobus-customize-control140.min.js +1 -1
- includes/js/wpglobus-customize-control170.min.js +1 -1
- includes/js/wpglobus-customize-control190.min.js +1 -1
- includes/js/wpglobus-customize-options.min.js +1 -1
- includes/js/wpglobus-media.min.js +1 -1
- includes/js/wpglobus-options.min.js +1 -1
- includes/js/wpglobus-plugin-install.min.js +1 -1
- includes/js/wpglobus-vendor-acf.min.js +1 -1
- includes/js/wpglobus-vendor-aioseop.min.js +1 -1
- includes/js/wpglobus-widgets.min.js +1 -1
- includes/js/wpglobus-wpseo-21.min.js +1 -1
- includes/js/wpglobus-wpseo-22.min.js +1 -1
- includes/js/wpglobus-yoastseo-120.min.js +1 -1
- includes/js/wpglobus-yoastseo-140.min.js +1 -1
- includes/js/wpglobus-yoastseo-30.min.js +1 -1
- includes/js/wpglobus-yoastseo-31.min.js +1 -1
- includes/js/wpglobus-yoastseo-32.min.js +1 -1
- includes/js/wpglobus-yoastseo-33.min.js +1 -1
- includes/js/wpglobus-yoastseo-34.min.js +1 -1
- includes/js/wpglobus-yoastseo-38.min.js +1 -1
- includes/js/wpglobus-yoastseo-40.min.js +1 -1
- includes/js/wpglobus-yoastseo-41.min.js +1 -1
data/wpglobus-product-info.json
CHANGED
@@ -1 +1 @@
|
|
1 |
-
{"multilingual-woocommerce-nets-netaxept":{"title":"{:en}Multilingual WooCommerce Nets Netaxept{:}{:ru}\u041c\u0443\u043b\u044c\u0442\u0438\u044f\u0437\u044b\u0447\u043d\u043e\u0441\u0442\u044c \u0434\u043b\u044f WooCommerce Nets Netaxept{:}","_api_new_version":"1.0.3","_api_tested_up_to":"4.9.8"},"wpglobus-multi-currency":{"title":"{:en}Multi-Currency for WooCommerce{:}{:ru}WPGlobus - \u041c\u0443\u043b\u044c\u0442\u0438\u0432\u0430\u043b\u044e\u0442\u043d\u043e\u0441\u0442\u044c \u0434\u043b\u044f WooCommerce{:}","_api_new_version":"1.1.1","_api_tested_up_to":"4.9.4"},"wpglobus-mobile-menu":{"title":"{:en}WPGlobus Mobile Menu{:}{:ru}WPGlobus Mobile Menu{:}","_api_new_version":"2.2.0","_api_tested_up_to":"5.6"},"wpglobus-header-images":{"title":"{:en}WPGlobus Header Images{:}{:ru}WPGlobus Header Images{:}","_api_new_version":"2.1.0","_api_tested_up_to":"5.5"},"wpglobus-for-ultimate-member":{"title":"{:en}WPGlobus for Ultimate Member{:}{:ru}WPGlobus \u0434\u043b\u044f \u043f\u043b\u0430\u0433\u0438\u043d\u0430 Ultimate Member{:}","_api_new_version":"1.1.0","_api_tested_up_to":"5.6"},"wpglobus-menu-visibility":{"title":"WPGlobus Menu Visibility","_api_new_version":"2.0.0","_api_tested_up_to":"5.6"},"wpglobus-for-bridge-theme":{"title":"{:en}WPGlobus for the \"Bridge\" theme{:}{:ru}WPGlobus \u0434\u043b\u044f \u0442\u0435\u043c\u044b Bridge{:}","_api_new_version":"2.4.0","_api_tested_up_to":"5.5"},"wpglobus-
|
1 |
+
{"multilingual-woocommerce-nets-netaxept":{"title":"{:en}Multilingual WooCommerce Nets Netaxept{:}{:ru}\u041c\u0443\u043b\u044c\u0442\u0438\u044f\u0437\u044b\u0447\u043d\u043e\u0441\u0442\u044c \u0434\u043b\u044f WooCommerce Nets Netaxept{:}","_api_new_version":"1.0.3","_api_tested_up_to":"4.9.8"},"wpglobus-multi-currency":{"title":"{:en}Multi-Currency for WooCommerce{:}{:ru}WPGlobus - \u041c\u0443\u043b\u044c\u0442\u0438\u0432\u0430\u043b\u044e\u0442\u043d\u043e\u0441\u0442\u044c \u0434\u043b\u044f WooCommerce{:}","_api_new_version":"1.1.1","_api_tested_up_to":"4.9.4"},"wpglobus-mobile-menu":{"title":"{:en}WPGlobus Mobile Menu{:}{:ru}WPGlobus Mobile Menu{:}","_api_new_version":"2.2.0","_api_tested_up_to":"5.6"},"wpglobus-header-images":{"title":"{:en}WPGlobus Header Images{:}{:ru}WPGlobus Header Images{:}","_api_new_version":"2.1.0","_api_tested_up_to":"5.5"},"wpglobus-for-ultimate-member":{"title":"{:en}WPGlobus for Ultimate Member{:}{:ru}WPGlobus \u0434\u043b\u044f \u043f\u043b\u0430\u0433\u0438\u043d\u0430 Ultimate Member{:}","_api_new_version":"1.1.0","_api_tested_up_to":"5.6"},"wpglobus-menu-visibility":{"title":"WPGlobus Menu Visibility","_api_new_version":"2.0.0","_api_tested_up_to":"5.6"},"wpglobus-for-bridge-theme":{"title":"{:en}WPGlobus for the \"Bridge\" theme{:}{:ru}WPGlobus \u0434\u043b\u044f \u0442\u0435\u043c\u044b Bridge{:}","_api_new_version":"2.4.0","_api_tested_up_to":"5.5"},"wpglobus-plus":{"title":"{:en}WPGlobus Plus multilingual extension{:}{:ru}WPGlobus \u041f\u043b\u044e\u0441{:}","_api_new_version":"1.6.0","_api_tested_up_to":"5.7.1"},"wpglobus-language-widgets":{"title":"{:en}WPGlobus Language Widgets{:}{:ru}\u042f\u0437\u044b\u043a\u0438 WPGlobus \u0434\u043b\u044f \u0432\u0438\u0434\u0436\u0435\u0442\u043e\u0432{:}","_api_new_version":"2.1.0","_api_tested_up_to":"5.7"},"wpglobus-multilingual-popups":{"title":"{:en}WPGlobus Multilingual Popups{:}{:ru}WPGlobus Multilingual Popups{:}","_api_new_version":"1.4.0","_api_tested_up_to":"5.7"},"woocommerce-wpglobus":{"title":"{:en}WPGlobus for WooCommerce{:}{:ru}\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 WooCommerce WPGlobus{:}","_api_new_version":"5.3.0","_api_tested_up_to":"5.7"},"wpglobus-multilingual-notices":{"title":"{:en}WPGlobus Multilingual Notices{:}{:ru}WPGlobus - \u043c\u043d\u043e\u0433\u043e\u044f\u0437\u044b\u0447\u043d\u044b\u0435 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f{:}","_api_new_version":"2.7.0","_api_tested_up_to":"5.7"}}
|
includes/builders/assets/wpglobus-admin-builder-49.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var WPGlobusCore;!function(l){var s=WPGlobusCore={strpos:function(a,t,e){
|
1 |
+
var WPGlobusCore;!function(l){var s=WPGlobusCore={strpos:function(a,t,e){e=(a=""+a).indexOf(t,e);return 0<=e&&e},TextFilter:function(a,t,e){if(void 0===a||""===a)return a;var o,n,l=[],i=!1;t=""==t?"en":t,e=void 0===e||""==e?"RETURN_IN_DEFAULT_LANGUAGE":e,l[0]=[],l[0].start=WPGlobusCoreData.locale_tag_start.replace("%s",t),l[0].end=WPGlobusCoreData.locale_tag_end,l[1]=[],l[1].start="\x3c!--:"+t+"--\x3e",l[1].end="\x3c!--:--\x3e",l[2]=[],l[2].start="[:"+t+"]",l[2].end="[:";for(var u=0;u<3;u++)if(!1!==(o=s.strpos(a,l[u].start))){o+=l[u].start.length,a=!1===(n=s.strpos(a,l[u].end,o))?a.substr(o):a.substr(o,n-o),i=!0;break}return i||("RETURN_EMPTY"==e?t==WPGlobusCoreData.default_language&&!/(\{:|\[:|<!--:)[a-z]{2}/.test(a)||(a=""):t==WPGlobusCoreData.default_language?/(\{:|\[:|<!--:)[a-z]{2}/.test(a)&&(a=""):a=s.TextFilter(a,WPGlobusCoreData.default_language)),a},addLocaleMarks:function(a,t){return WPGlobusCoreData.locale_tag_start.replace("%s",t)+a+WPGlobusCoreData.locale_tag_end},getTranslations:function(e){var o,n={};return l.each(WPGlobusCoreData.enabled_languages,function(a,t){o=t==WPGlobusCoreData.default_language?"RETURN_IN_DEFAULT_LANGUAGE":"RETURN_EMPTY",n[t]=s.TextFilter(e,t,o)}),n},getString:function(a,t,e){if(void 0===a)return a;void 0===t&&(t=""),void 0===e&&(e=WPGlobusCoreData.language),(a=s.getTranslations(a))[e]=t;var o="";return l.each(a,function(a,t){""!=t&&a!=WPGlobusCoreData.default_language&&(o+=s.addLocaleMarks(t,a))}),o=""!=a[WPGlobusCoreData.default_language]?""==o?a[WPGlobusCoreData.default_language]:s.addLocaleMarks(a[WPGlobusCoreData.default_language],WPGlobusCoreData.default_language)+o:o}}}(jQuery),jQuery(document).ready(function(n){"use strict";var t;"undefined"!=typeof WPGlobusAdmin&&(t={languageSelectorBoxDelta:0,locationPathname:"/wp-admin/post.php",init:function(){"taxonomy-edit"===WPGlobusAdmin.page?t.taxonomyEdit():t.start()},_info:function(){var a=void 0;0<n("#language").length&&(a=n("#language").val()),console.log("Current language from hidden (#language) : ",a),a=void 0,0<n("#wpglobus-language").length&&(a=n("#wpglobus-language").val()),console.log("Current language from hidden (#wpglobus-language) : ",a),a=void 0,0<n('input[name="wpglobus-language"]').length&&(a=n('input[name="wpglobus-language"]').val()),console.log('Current language from hidden (input[name="wpglobus-language"]) : ',a),a=void 0,0<n('input[name="wpglobus_language"]').length&&(a=n('input[name="wpglobus_language"]').val()),console.log('Current language from hidden (input[name="wpglobus_language"]) : ',a),console.log("Builder : ",WPGlobusAdmin.builder);a=n("#content").val();""==a?console.log("Editor content (#content) : (empty)"):console.log(a)},checkCookie:function(){if(-1!=window.location.search.indexOf("language="))return!1;if("post.php"==WPGlobusAdmin.page&&(null!==(t=wpCookies.get(WPGlobusAdmin.builder.languageCookie))&&history.pushState)){var a=(t=t.split("+"))[0];if(void 0!==t[1]&&t[1]+0==WPGlobusAdmin.$_get.post){var t=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search+"&language="+a;return window.history.pushState({path:t},"",t),a}}return!1},setCookie:function(){var a=t.checkCookie();a||void 0===(a=WPGlobusAdmin.$_get.language)&&(a=WPGlobusAdmin.data.default_language),wpCookies.set(WPGlobusAdmin.builder.languageCookie,a+"+"+WPGlobusAdmin.$_get.post,31536e3,t.locationPathname)},setLocationSearch:function(){var a;history.pushState&&-1==window.location.search.indexOf("language=")&&WPGlobusAdmin.data.default_language!=WPGlobusAdmin.currentTab&&(a=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search+"&language="+WPGlobusAdmin.currentTab,window.history.pushState({path:a},"",a))},taxonomyEdit:function(){n(".wpglobus-taxonomy-tabs").insertAfter("#ajax-response"),n(".wrap").tabs(),n(WPGlobusAdmin.data.multilingualSlug.title).insertAfter(".term-slug-wrap th label"),WPGlobusAdmin.currentTab!==WPGlobusAdmin.data.default_language&&(n(".wpglobus-tax-edit-tab").removeClass("ui-tabs-active ui-state-active"),n("#wpglobus-link-tab-"+WPGlobusAdmin.currentTab).addClass("ui-tabs-active ui-state-active")),n(document).on("click",".wpglobus-tax-edit-tab a",function(a){a.preventDefault();a=n(this).data("href");location.href=a}),t.setMultilingualFields(),n(document).on("tinymce-editor-init",function(a,t){n("#"+t.getContainer().id).find("iframe").addClass(WPGlobusAdmin.builder.translatableClass).css({width:""})})},start:function(){t.setLocationSearch();var e="#postdivrich",o=!0,a="#post-body-content";!1===WPGlobusAdmin.data.support.editor&&(o=!(e="#titlediv")),!1===WPGlobusAdmin.data.support.title&&(o=!1),n(a).prepend(n(".wpglobus-post-body-tabs-list")),n.each(WPGlobusAdmin.tabs,function(a,t){"default"===t?(n(e).wrap('<div id="tab-default"></div>'),o&&n(n("#titlediv")).insertBefore(e)):(n(e+"-"+t).wrap('<div id="tab-'+t+'"></div>'),o&&n(n("#titlediv-"+t)).insertBefore(e+"-"+t))}),n(a).addClass("wpglobus-post-body-tabs"),t.setMultilingualFields()},ajaxPrefilter:function(){n.ajaxPrefilter(function(a,t,e){})},setMultilingualFields:function(){n.each(WPGlobusAdmin.builder.multilingualFields,function(a,t){var e="name",o=document.getElementsByName(t);0==o.length&&(e="id",o=document.getElementById(t)),null===o||("id"==e?n("#"+t):(o=(o=o[0].nodeName).toLowerCase(),n(o+'[name="'+t+'"]'))).addClass(WPGlobusAdmin.builder.translatableClass)})}},(WPGlobusAdmin=n.extend({},WPGlobusAdmin,t)).init())});
|
includes/builders/assets/wpglobus-admin-builder-51.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var WPGlobusCore;!function(l){var s=WPGlobusCore={strpos:function(a,t,e){
|
1 |
+
var WPGlobusCore;!function(l){var s=WPGlobusCore={strpos:function(a,t,e){e=(a=""+a).indexOf(t,e);return 0<=e&&e},TextFilter:function(a,t,e){if(void 0===a||""===a)return a;var o,n,l=[],i=!1;t=""==t?"en":t,e=void 0===e||""==e?"RETURN_IN_DEFAULT_LANGUAGE":e,l[0]=[],l[0].start=WPGlobusCoreData.locale_tag_start.replace("%s",t),l[0].end=WPGlobusCoreData.locale_tag_end,l[1]=[],l[1].start="\x3c!--:"+t+"--\x3e",l[1].end="\x3c!--:--\x3e",l[2]=[],l[2].start="[:"+t+"]",l[2].end="[:";for(var u=0;u<3;u++)if(!1!==(o=s.strpos(a,l[u].start))){o+=l[u].start.length,a=!1===(n=s.strpos(a,l[u].end,o))?a.substr(o):a.substr(o,n-o),i=!0;break}return i||("RETURN_EMPTY"==e?t==WPGlobusCoreData.default_language&&!/(\{:|\[:|<!--:)[a-z]{2}/.test(a)||(a=""):t==WPGlobusCoreData.default_language?/(\{:|\[:|<!--:)[a-z]{2}/.test(a)&&(a=""):a=s.TextFilter(a,WPGlobusCoreData.default_language)),a},addLocaleMarks:function(a,t){return WPGlobusCoreData.locale_tag_start.replace("%s",t)+a+WPGlobusCoreData.locale_tag_end},getTranslations:function(e){var o,n={};return l.each(WPGlobusCoreData.enabled_languages,function(a,t){o=t==WPGlobusCoreData.default_language?"RETURN_IN_DEFAULT_LANGUAGE":"RETURN_EMPTY",n[t]=s.TextFilter(e,t,o)}),n},getString:function(a,t,e){if(void 0===a)return a;void 0===t&&(t=""),void 0===e&&(e=WPGlobusCoreData.language),(a=s.getTranslations(a))[e]=t;var o="";return l.each(a,function(a,t){""!=t&&a!=WPGlobusCoreData.default_language&&(o+=s.addLocaleMarks(t,a))}),o=""!=a[WPGlobusCoreData.default_language]?""==o?a[WPGlobusCoreData.default_language]:s.addLocaleMarks(a[WPGlobusCoreData.default_language],WPGlobusCoreData.default_language)+o:o}}}(jQuery),jQuery(document).ready(function(n){"use strict";var t;"undefined"!=typeof WPGlobusAdmin&&(t={languageSelectorBoxDelta:0,locationPathname:"/wp-admin/post.php",init:function(){"taxonomy-edit"===WPGlobusAdmin.page?t.taxonomyEdit():t.start()},_info:function(){var a=void 0;0<n("#language").length&&(a=n("#language").val()),console.log("Current language from hidden (#language) : ",a),a=void 0,0<n("#wpglobus-language").length&&(a=n("#wpglobus-language").val()),console.log("Current language from hidden (#wpglobus-language) : ",a),a=void 0,0<n('input[name="wpglobus-language"]').length&&(a=n('input[name="wpglobus-language"]').val()),console.log('Current language from hidden (input[name="wpglobus-language"]) : ',a),a=void 0,0<n('input[name="wpglobus_language"]').length&&(a=n('input[name="wpglobus_language"]').val()),console.log('Current language from hidden (input[name="wpglobus_language"]) : ',a),console.log("Builder : ",WPGlobusAdmin.builder);a=n("#content").val();""==a?console.log("Editor content (#content) : (empty)"):console.log(a)},checkCookie:function(){if(-1!=window.location.search.indexOf("language="))return!1;if("post.php"==WPGlobusAdmin.page&&(null!==(t=wpCookies.get(WPGlobusAdmin.builder.languageCookie))&&history.pushState)){var a=(t=t.split("+"))[0];if(void 0!==t[1]&&t[1]+0==WPGlobusAdmin.$_get.post){var t=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search+"&language="+a;return window.history.pushState({path:t},"",t),a}}return!1},setCookie:function(){var a=t.checkCookie();a||void 0===(a=WPGlobusAdmin.$_get.language)&&(a=WPGlobusAdmin.data.default_language),wpCookies.set(WPGlobusAdmin.builder.languageCookie,a+"+"+WPGlobusAdmin.$_get.post,31536e3,t.locationPathname)},setLocationSearch:function(){var a;history.pushState&&-1==window.location.search.indexOf("language=")&&WPGlobusAdmin.data.default_language!=WPGlobusAdmin.currentTab&&(a=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search+"&language="+WPGlobusAdmin.currentTab,window.history.pushState({path:a},"",a))},taxonomyEdit:function(){n(".wpglobus-taxonomy-tabs").insertAfter("#ajax-response"),n(".wrap").tabs(),n(WPGlobusAdmin.data.multilingualSlug.title).insertAfter(".term-slug-wrap th label"),WPGlobusAdmin.currentTab!==WPGlobusAdmin.data.default_language&&(n(".wpglobus-tax-edit-tab").removeClass("ui-tabs-active ui-state-active"),n("#wpglobus-link-tab-"+WPGlobusAdmin.currentTab).addClass("ui-tabs-active ui-state-active")),n(document).on("click",".wpglobus-tax-edit-tab a",function(a){a.preventDefault();a=n(this).data("href");location.href=a}),t.setMultilingualFields(),n(document).on("tinymce-editor-init",function(a,t){n("#"+t.getContainer().id).find("iframe").addClass(WPGlobusAdmin.builder.translatableClass).css({width:""})})},start:function(){t.setLocationSearch();var e="#postdivrich",o=!0,a="#post-body-content";!1===WPGlobusAdmin.data.support.editor&&(o=!(e="#titlediv")),!1===WPGlobusAdmin.data.support.title&&(o=!1),n(a).prepend(n(".wpglobus-post-body-tabs-list")),n.each(WPGlobusAdmin.tabs,function(a,t){"default"===t?(n(e).wrap('<div id="tab-default"></div>'),o&&n(n("#titlediv")).insertBefore(e)):(n(e+"-"+t).wrap('<div id="tab-'+t+'"></div>'),o&&n(n("#titlediv-"+t)).insertBefore(e+"-"+t))}),n(a).addClass("wpglobus-post-body-tabs"),t.setMultilingualFields(),"post.php"===WPGlobusAdmin.page&&this.postEdit()},postEdit:function(){n(document).triggerHandler("wpglobus_after_post_edit")},ajaxPrefilter:function(){n.ajaxPrefilter(function(a,t,e){})},setMultilingualFields:function(){n.each(WPGlobusAdmin.builder.multilingualFields,function(a,t){var e="name",o=document.getElementsByName(t);0==o.length&&(e="id",o=document.getElementById(t)),null===o||("id"==e?n("#"+t):(o=(o=o[0].nodeName).toLowerCase(),n(o+'[name="'+t+'"]'))).addClass(WPGlobusAdmin.builder.translatableClass)})}},(WPGlobusAdmin=n.extend({},WPGlobusAdmin,t)).init())});
|
includes/builders/assets/wpglobus-admin-builder-55.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var WPGlobusCore;!function(l){var s=WPGlobusCore={strpos:function(t,e,a){
|
1 |
+
var WPGlobusCore;!function(l){var s=WPGlobusCore={strpos:function(t,e,a){a=(t=""+t).indexOf(e,a);return 0<=a&&a},TextFilter:function(t,e,a){if(void 0===t||""===t)return t;var o,n,l=[],i=!1;e=""==e?"en":e,a=void 0===a||""==a?"RETURN_IN_DEFAULT_LANGUAGE":a,l[0]=[],l[0].start=WPGlobusCoreData.locale_tag_start.replace("%s",e),l[0].end=WPGlobusCoreData.locale_tag_end,l[1]=[],l[1].start="\x3c!--:"+e+"--\x3e",l[1].end="\x3c!--:--\x3e",l[2]=[],l[2].start="[:"+e+"]",l[2].end="[:";for(var u=0;u<3;u++)if(!1!==(o=s.strpos(t,l[u].start))){o+=l[u].start.length,t=!1===(n=s.strpos(t,l[u].end,o))?t.substr(o):t.substr(o,n-o),i=!0;break}return i||("RETURN_EMPTY"==a?e==WPGlobusCoreData.default_language&&!/(\{:|\[:|<!--:)[a-z]{2}/.test(t)||(t=""):e==WPGlobusCoreData.default_language?/(\{:|\[:|<!--:)[a-z]{2}/.test(t)&&(t=""):t=s.TextFilter(t,WPGlobusCoreData.default_language)),t},addLocaleMarks:function(t,e){return WPGlobusCoreData.locale_tag_start.replace("%s",e)+t+WPGlobusCoreData.locale_tag_end},getTranslations:function(a){var o,n={};return l.each(WPGlobusCoreData.enabled_languages,function(t,e){o=e==WPGlobusCoreData.default_language?"RETURN_IN_DEFAULT_LANGUAGE":"RETURN_EMPTY",n[e]=s.TextFilter(a,e,o)}),n},getString:function(t,e,a){if(void 0===t)return t;void 0===e&&(e=""),void 0===a&&(a=WPGlobusCoreData.language),(t=s.getTranslations(t))[a]=e;var o="";return l.each(t,function(t,e){""!=e&&t!=WPGlobusCoreData.default_language&&(o+=s.addLocaleMarks(e,t))}),o=""!=t[WPGlobusCoreData.default_language]?""==o?t[WPGlobusCoreData.default_language]:s.addLocaleMarks(t[WPGlobusCoreData.default_language],WPGlobusCoreData.default_language)+o:o}}}(jQuery),jQuery(document).ready(function(n){"use strict";var l;"undefined"!=typeof WPGlobusAdmin&&(l={languageSelectorBoxDelta:0,locationPathname:"/wp-admin/post.php",init:function(){"taxonomy-edit"===WPGlobusAdmin.page?l.taxonomyEdit():l.start()},_info:function(){var t=void 0;0<n("#language").length&&(t=n("#language").val()),console.log("Current language from hidden (#language) : ",t),t=void 0,0<n("#wpglobus-language").length&&(t=n("#wpglobus-language").val()),console.log("Current language from hidden (#wpglobus-language) : ",t),t=void 0,0<n('input[name="wpglobus-language"]').length&&(t=n('input[name="wpglobus-language"]').val()),console.log('Current language from hidden (input[name="wpglobus-language"]) : ',t),t=void 0,0<n('input[name="wpglobus_language"]').length&&(t=n('input[name="wpglobus_language"]').val()),console.log('Current language from hidden (input[name="wpglobus_language"]) : ',t),console.log("Builder : ",WPGlobusAdmin.builder);t=n("#content").val();""==t?console.log("Editor content (#content) : (empty)"):console.log(t)},checkCookie:function(){if(-1!=window.location.search.indexOf("language="))return!1;if("post.php"==WPGlobusAdmin.page&&(null!==(e=wpCookies.get(WPGlobusAdmin.builder.languageCookie))&&history.pushState)){var t=(e=e.split("+"))[0];if(void 0!==e[1]&&e[1]+0==WPGlobusAdmin.$_get.post){var e=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search+"&language="+t;return window.history.pushState({path:e},"",e),t}}return!1},setCookie:function(){var t=l.checkCookie();t||void 0===(t=WPGlobusAdmin.$_get.language)&&(t=WPGlobusAdmin.data.default_language),wpCookies.set(WPGlobusAdmin.builder.languageCookie,t+"+"+WPGlobusAdmin.$_get.post,31536e3,l.locationPathname)},setLocationSearch:function(){var t;history.pushState&&-1==window.location.search.indexOf("language=")&&WPGlobusAdmin.data.default_language!=WPGlobusAdmin.currentTab&&(t=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search+"&language="+WPGlobusAdmin.currentTab,window.history.pushState({path:t},"",t))},taxonomyEdit:function(){n(".wpglobus-taxonomy-tabs").insertAfter("#ajax-response"),n(".wrap").tabs(),n(WPGlobusAdmin.data.multilingualSlug.title).insertAfter(".term-slug-wrap th label"),WPGlobusAdmin.currentTab!==WPGlobusAdmin.data.default_language&&(n(".wpglobus-tax-edit-tab").removeClass("ui-tabs-active ui-state-active"),n("#wpglobus-link-tab-"+WPGlobusAdmin.currentTab).addClass("ui-tabs-active ui-state-active")),n(document).on("click",".wpglobus-tax-edit-tab a",function(t){t.preventDefault();t=n(this).data("href");location.href=t}),l.setMultilingualFields(),n(document).on("tinymce-editor-init",function(t,e){n("#"+e.getContainer().id).find("iframe").addClass(WPGlobusAdmin.builder.translatableClass).css({width:""})})},start:function(){l.setLocationSearch();var a="#postdivrich",o=!0,t="#post-body-content";!1===WPGlobusAdmin.data.support.editor&&(o=!(a="#titlediv")),!1===WPGlobusAdmin.data.support.title&&(o=!1),n(t).prepend(n(".wpglobus-post-body-tabs-list")),n.each(WPGlobusAdmin.tabs,function(t,e){"default"===e?(n(a).wrap('<div id="tab-default"></div>'),o&&n(n("#titlediv")).insertBefore(a)):(n(a+"-"+e).wrap('<div id="tab-'+e+'"></div>'),o&&n(n("#titlediv-"+e)).insertBefore(a+"-"+e))}),n(t).addClass("wpglobus-post-body-tabs"),l.setMultilingualFields(),"post.php"===WPGlobusAdmin.page&&this.postEdit()},postEdit:function(){n(document).triggerHandler("wpglobus_after_post_edit")},ajaxPrefilter:function(){n.ajaxPrefilter(function(t,e,a){})},setMultilingualFields:function(){n.each(WPGlobusAdmin.builder.multilingualFields,function(t,e){e=l.getFieldAttrs(e);"function"==typeof WPGlobusAdmin[e.fieldFunction]&&WPGlobusAdmin[e.fieldFunction](e)})},textField:function(t){var e=t.id,a="name",t=document.getElementsByName(e);if(0==t.length&&(a="id",t=document.getElementById(e)),null===t)return!0;("id"==a?n("#"+e):(t=(t=t[0].nodeName).toLowerCase(),n(t+'[name="'+e+'"]'))).addClass(WPGlobusAdmin.builder.translatableClass)},wysiwygField:function(a){n(document).on("wpglobus_wysiwyg_field",function(t,e){e.callback(a)})},fileField:function(t){},getFieldAttrs:function(t){var e={};return"string"==typeof t?e.id=t:"object"==typeof t&&(void 0!==t.id&&(e.id=t.id),void 0!==t.type&&(e.type=t.type,e.fieldFunction=t.type+"Field")),n.extend({},{id:!1,type:"text",fieldFunction:"textField"},e)}},(WPGlobusAdmin=n.extend({},WPGlobusAdmin,l)).init())});
|
includes/builders/assets/wpglobus-admin-builder-56.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var WPGlobusCore;!function(l){var s=WPGlobusCore={strpos:function(t,e,a){
|
1 |
+
var WPGlobusCore;!function(l){var s=WPGlobusCore={strpos:function(t,e,a){a=(t=""+t).indexOf(e,a);return 0<=a&&a},TextFilter:function(t,e,a){if(void 0===t||""===t)return t;var o,n,l=[],i=!1;e=""==e?"en":e,a=void 0===a||""==a?"RETURN_IN_DEFAULT_LANGUAGE":a,l[0]=[],l[0].start=WPGlobusCoreData.locale_tag_start.replace("%s",e),l[0].end=WPGlobusCoreData.locale_tag_end,l[1]=[],l[1].start="\x3c!--:"+e+"--\x3e",l[1].end="\x3c!--:--\x3e",l[2]=[],l[2].start="[:"+e+"]",l[2].end="[:";for(var u=0;u<3;u++)if(!1!==(o=s.strpos(t,l[u].start))){o+=l[u].start.length,t=!1===(n=s.strpos(t,l[u].end,o))?t.substr(o):t.substr(o,n-o),i=!0;break}return i||("RETURN_EMPTY"==a?e==WPGlobusCoreData.default_language&&!/(\{:|\[:|<!--:)[a-z]{2}/.test(t)||(t=""):e==WPGlobusCoreData.default_language?/(\{:|\[:|<!--:)[a-z]{2}/.test(t)&&(t=""):t=s.TextFilter(t,WPGlobusCoreData.default_language)),t},addLocaleMarks:function(t,e){return WPGlobusCoreData.locale_tag_start.replace("%s",e)+t+WPGlobusCoreData.locale_tag_end},getTranslations:function(a){var o,n={};return l.each(WPGlobusCoreData.enabled_languages,function(t,e){o=e==WPGlobusCoreData.default_language?"RETURN_IN_DEFAULT_LANGUAGE":"RETURN_EMPTY",n[e]=s.TextFilter(a,e,o)}),n},getString:function(t,e,a){if(void 0===t)return t;void 0===e&&(e=""),void 0===a&&(a=WPGlobusCoreData.language),(t=s.getTranslations(t))[a]=e;var o="";return l.each(t,function(t,e){""!=e&&t!=WPGlobusCoreData.default_language&&(o+=s.addLocaleMarks(e,t))}),o=""!=t[WPGlobusCoreData.default_language]?""==o?t[WPGlobusCoreData.default_language]:s.addLocaleMarks(t[WPGlobusCoreData.default_language],WPGlobusCoreData.default_language)+o:o}}}(jQuery),jQuery(document).ready(function(n){"use strict";var l;"undefined"!=typeof WPGlobusAdmin&&(l={languageSelectorBoxDelta:0,locationPathname:"/wp-admin/post.php",init:function(){"taxonomy-edit"===WPGlobusAdmin.page?l.taxonomyEdit():l.start()},_info:function(){var t=void 0;0<n("#language").length&&(t=n("#language").val()),console.log("Current language from hidden (#language) : ",t),t=void 0,0<n("#wpglobus-language").length&&(t=n("#wpglobus-language").val()),console.log("Current language from hidden (#wpglobus-language) : ",t),t=void 0,0<n('input[name="wpglobus-language"]').length&&(t=n('input[name="wpglobus-language"]').val()),console.log('Current language from hidden (input[name="wpglobus-language"]) : ',t),t=void 0,0<n('input[name="wpglobus_language"]').length&&(t=n('input[name="wpglobus_language"]').val()),console.log('Current language from hidden (input[name="wpglobus_language"]) : ',t),console.log("Builder : ",WPGlobusAdmin.builder);t=n("#content").val();""==t?console.log("Editor content (#content) : (empty)"):console.log(t)},checkCookie:function(){if(-1!=window.location.search.indexOf("language="))return!1;if("post.php"==WPGlobusAdmin.page&&(null!==(e=wpCookies.get(WPGlobusAdmin.builder.languageCookie))&&history.pushState)){var t=(e=e.split("+"))[0];if(void 0!==e[1]&&e[1]+0==WPGlobusAdmin.$_get.post){var e=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search+"&language="+t;return window.history.pushState({path:e},"",e),t}}return!1},setCookie:function(){var t=l.checkCookie();t||void 0===(t=WPGlobusAdmin.$_get.language)&&(t=WPGlobusAdmin.data.default_language),wpCookies.set(WPGlobusAdmin.builder.languageCookie,t+"+"+WPGlobusAdmin.$_get.post,31536e3,l.locationPathname)},setLocationSearch:function(){var t;history.pushState&&-1==window.location.search.indexOf("language=")&&WPGlobusAdmin.data.default_language!=WPGlobusAdmin.currentTab&&(t=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search+"&language="+WPGlobusAdmin.currentTab,window.history.pushState({path:t},"",t))},taxonomyEdit:function(){n(".wpglobus-taxonomy-tabs").insertAfter("#ajax-response"),n(".wrap").tabs(),n(WPGlobusAdmin.data.multilingualSlug.title).insertAfter(".term-slug-wrap th label"),WPGlobusAdmin.currentTab!==WPGlobusAdmin.data.default_language&&(n(".wpglobus-tax-edit-tab").removeClass("ui-tabs-active ui-state-active"),n("#wpglobus-link-tab-"+WPGlobusAdmin.currentTab).addClass("ui-tabs-active ui-state-active")),n(document).on("click",".wpglobus-tax-edit-tab a",function(t){t.preventDefault();t=n(this).data("href");location.href=t}),l.setMultilingualFields(),n(document).on("tinymce-editor-init",function(t,e){n("#"+e.getContainer().id).find("iframe").addClass(WPGlobusAdmin.builder.translatableClass).css({width:""})})},start:function(){l.setLocationSearch();var a="#postdivrich",o=!0,t="#post-body-content";!1===WPGlobusAdmin.data.support.editor&&(o=!(a="#titlediv")),!1===WPGlobusAdmin.data.support.title&&(o=!1),n(t).prepend(n(".wpglobus-post-body-tabs-list")),n.each(WPGlobusAdmin.tabs,function(t,e){"default"===e?(n(a).wrap('<div id="tab-default"></div>'),o&&n(n("#titlediv")).insertBefore(a)):(n(a+"-"+e).wrap('<div id="tab-'+e+'"></div>'),o&&n(n("#titlediv-"+e)).insertBefore(a+"-"+e))}),n(t).addClass("wpglobus-post-body-tabs"),l.setMultilingualFields(),"post.php"===WPGlobusAdmin.page&&this.postEdit()},postEdit:function(){n(document).triggerHandler("wpglobus_after_post_edit")},ajaxPrefilter:function(){n.ajaxPrefilter(function(t,e,a){})},setMultilingualFields:function(){n.each(WPGlobusAdmin.builder.multilingualFields,function(t,e){e=l.getFieldAttrs(e);"function"==typeof WPGlobusAdmin[e.fieldFunction]&&WPGlobusAdmin[e.fieldFunction](e)})},textField:function(t){var e=t.id,a="name",t=document.getElementsByName(e);if(0==t.length&&(a="id",t=document.getElementById(e)),null===t)return!0;("id"==a?n("#"+e):(t=(t=t[0].nodeName).toLowerCase(),n(t+'[name="'+e+'"]'))).addClass(WPGlobusAdmin.builder.translatableClass)},wysiwygField:function(a){n(document).on("wpglobus_wysiwyg_field",function(t,e){e.callback(a)})},fileField:function(t){},getFieldAttrs:function(t){var e={};return"string"==typeof t?e.id=t:"object"==typeof t&&(void 0!==t.id&&(e.id=t.id),void 0!==t.type&&(e.type=t.type,e.fieldFunction=t.type+"Field")),n.extend({},{id:!1,type:"text",fieldFunction:"textField"},e)}},(WPGlobusAdmin=n.extend({},WPGlobusAdmin,l)).init())});
|
includes/builders/gutenberg/assets/css/dist/wpglobus-block-editor.css
CHANGED
@@ -1,3 +1 @@
|
|
1 |
-
.edit-post-pinned-plugins .components-icon-button.is-toggled svg.dashicons-admin-site,.edit-post-pinned-plugins .components-icon-button.is-toggled svg.dashicons-admin-site *{fill
|
2 |
-
|
3 |
-
/*# sourceMappingURL=wpglobus-block-editor.css.map */
|
1 |
+
.edit-post-pinned-plugins .components-icon-button.is-toggled svg.dashicons-admin-site,.edit-post-pinned-plugins .components-icon-button.is-toggled svg.dashicons-admin-site *{fill:blue !important;display:none}.edit-post-pinned-plugins .components-icon-button:not(.is-toggled) svg.dashicons-admin-site,.edit-post-pinned-plugins .components-icon-button:not(.is-toggled) svg.dashicons-admin-site *{fill:blue;display:none}.edit-post-pinned-plugins .wpglobus-switcher-button{border-color:#ccc;border-radius:3px}.wpglobus-block-editor-panel__notice{border-left:0}.wpglobus-block-editor-panel__notice .components-notice__content{margin-top:0;margin-bottom:0;color:#000;font-weight:500}.edit-post-layout .wpglobus-block-editor-panel__notice.components-notice{min-height:0}.edit-post-layout .wpglobus-block-editor-panel__settings-link{float:right;margin-bottom:10px}.edit-post-layout .wpglobus-block-editor-panel__info{float:left;margin-bottom:10px}.edit-post-layout .wpglobus-block-editor-panel__flag{vertical-align:middle}
|
|
|
|
includes/builders/gutenberg/assets/css/dist/wpglobus-block-editor.css.map
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
{"version":3,"sources":["wpglobus-block-editor.scss"],"names":[],"mappings":"AAAA,8KAEE,uBAAwB,CACxB,YAAa,CACd,0LAIC,YAAa,CACb,YAAa,CACd,oDAGC,oBAAqB,CACrB,iBAAkB,CACnB,qCAGC,aAAc,CACf,iEAGC,YAAa,CACb,eAAgB,CAChB,UAAW,CACX,eAAgB,CACjB,yEAGC,YAAa,CACd,8DAGC,WAAY,CACZ,kBAAmB,CACpB,qDAGC,UAAW,CACX,kBAAmB,CACpB,qDAGC,qBAAsB","file":"wpglobus-block-editor.css"}
|
|
includes/builders/gutenberg/assets/css/wpglobus-gutenberg.css
CHANGED
@@ -1,3 +1 @@
|
|
1 |
-
.wpglobus-selector-grid{display:grid;grid-template-columns:40% 60%;place-items:center;grid-gap:0}.wpglobus-selector-grid .wpglobus-gutenberg-selector-column-2{width:90px}.wpglobus-gutenberg-selector-box{margin-left:220px}@media screen and (max-width: 599px){.wpglobus-gutenberg-selector-box{margin-left:40px}}@media screen and (max-width: 700px){.wpglobus-gutenberg-selector-column-1{height:25px;width:25px}.wpglobus-gutenberg-selector-column-2{display:none}}
|
2 |
-
|
3 |
-
/*# sourceMappingURL=wpglobus-gutenberg.css.map */
|
1 |
+
.wpglobus-selector-grid{display:grid;grid-template-columns:40% 60%;place-items:center;grid-gap:0}.wpglobus-selector-grid .wpglobus-gutenberg-selector-column-2{width:90px}.wpglobus-gutenberg-selector-box{margin-left:220px}@media screen and (max-width: 599px){.wpglobus-gutenberg-selector-box{margin-left:40px}}@media screen and (max-width: 700px){.wpglobus-gutenberg-selector-column-1{height:25px;width:25px}.wpglobus-gutenberg-selector-column-2{display:none}}
|
|
|
|
includes/builders/gutenberg/assets/css/wpglobus-gutenberg.css.map
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
{"version":3,"sources":["wpglobus-gutenberg.scss"],"names":[],"mappings":"AAAA,wBACE,YAAa,CACb,6BAA8B,CAC9B,kBAAmB,CACnB,UAAW,CACZ,8DAGC,UAAW,CACZ,iCAGC,iBAAkB,CACnB,qCAGC,iCACE,gBAAiB,CAClB,CAGH,qCACE,sCACE,WAAY,CACZ,UAAW,CACZ,sCAEC,YAAa,CACd","file":"wpglobus-gutenberg.css"}
|
|
includes/builders/gutenberg/assets/js/wpglobus-gutenberg.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
"use strict";jQuery(document).ready(function(E){var C={counter:0,noticeOn:!1,initDone:!1,languageSelectorBoxDelta:0,oldLanguageSelector:!1,languageSelectorEnabled:!0,parseBool:function(e){return!/^(false|0)$/i.test(e)&&!!e},getCounter:function(){return C.counter},getOptionKey:function(e){return e=e||"",WPGlobusGutenberg.keyOption[e]},getOptions:function(){return WPGlobusGutenberg.options},isOldLanguageSelector:function(){return C.oldLanguageSelector},isPostDisabled:function(){return WPGlobusGutenberg.__post.disabled},isEnabledTab:function(e){void 0===e&&(e="options");var t=!1;return"options"==e&&C.parseBool(WPGlobusGutenberg.enabledOptionsTab)&&(t=!0),t},init:function(){WPGlobusGutenberg.yoastSeo=C.parseBool(WPGlobusGutenberg.yoastSeo),WPGlobusGutenberg.elementor=C.parseBool(WPGlobusGutenberg.elementor),C.isPostDisabled()||(C.initListeners(),C.initNotifications(),C.setTabs(),C.formHandler(),C.attachListeners())},initListeners:function(){WPGlobusGutenberg.yoastSeo&&1==E(".yoast.wpseo-metabox").length&&E(window).on("beforeunload",function(e){e.stopImmediatePropagation()})},formHandler:function(){var e=E(".metabox-base-form #referredby").attr("value");void 0!==e&&(e=-1==e.indexOf("language=en")?e+"&language="+WPGlobusGutenberg.language:e.replace("language=en","language="+WPGlobusGutenberg.language),E(".metabox-base-form #referredby").attr("value",e)),void 0!==(e=E('input[name="_wp_original_http_referer"]').attr("value"))&&(e=-1==e.indexOf("language=en")?e+"&language="+WPGlobusGutenberg.language:e.replace("language=en","language="+WPGlobusGutenberg.language),E('input[name="_wp_original_http_referer"]').attr("value",e))},initNotifications:function(){void 0!==wp.editPost&&void 0!==wp.plugins&&WPGlobusGutenberg.elementor&&"internal"==WPGlobusGutenberg.data.elementorCssPrintMethod&&wp.data.dispatch("core/notices").createNotice("error",WPGlobusGutenberg.i18n.elementorWarning,{id:"elementorcssprintmethodnotice",isDismissible:!0,actions:[{url:WPGlobusGutenberg.i18n.elementorActionLink,label:WPGlobusGutenberg.i18n.elementorActionLabel}]})},setTabs:function(){var t;0!=WPGlobusGutenberg.tabs.length?(C.oldLanguageSelector=!0,t=setInterval(function(){var e=E(".edit-post-header__settings");1==e.length&&(e.before(WPGlobusGutenberg.tabs),clearInterval(t))},200)):C.WPGlobusSwitcherPlugin()},setSelectorStatus:function(){var e;C.isOldLanguageSelector()&&(E(".wpglobus-gutenberg-selector-box").css({opacity:"0.2"}).attr("onclick","return false;"),C.languageSelectorEnabled=!1,e=setInterval(function(){if(0==E(".is-saving").length){if(clearInterval(e),WPGlobusGutenberg.pagenow==WPGlobusGutenberg.postNewPage&&-1!=location.pathname.indexOf(WPGlobusGutenberg.postEditPage))return WPGlobusGutenberg.pagenow=WPGlobusGutenberg.postEditPage,E(".wpglobus-gutenberg-selector-box").css({opacity:"1"}).attr("onclick",""),void C.reloadPage();C.languageSelectorEnabled=!0,E(".wpglobus-gutenberg-selector-box").css({opacity:"1"}).attr("onclick","")}},400))},reloadPage:function(){E(".wpglobus-selector-grid").css({"grid-template-columns":"10% 90%"}),E(".wpglobus-gutenberg-selector-text").text(WPGlobusGutenberg.i18n.reload),function e(){E(".wpglobus-gutenberg-selector").fadeOut(500).fadeIn(500,e)}(),setTimeout(function(){location.reload()},500)},attachListeners:function(){C.isOldLanguageSelector()&&(E(document).on("mouseenter",".wpglobus-gutenberg-selector",function(e){C.languageSelectorEnabled&&(E(".wpglobus-gutenberg-selector-dropdown").css({display:"block"}),C.languageSelectorBoxDelta=e.screenY,E(".edit-post-header").css({"z-index":"100000"}),E(".wpglobus-gutenberg-selector-box").css({"z-index":"100001"}))}),E(document).on("mouseleave",".wpglobus-gutenberg-selector",function(e){0!=C.languageSelectorBoxDelta&&e.screenY-C.languageSelectorBoxDelta<=0&&(E(".wpglobus-gutenberg-selector-dropdown").css({display:"none"}),E(".edit-post-header").css({"z-index":"9989"}),E(".wpglobus-gutenberg-selector-box").css({"z-index":"100"}))}),E(document).on("mouseleave",".wpglobus-gutenberg-selector-dropdown",function(e){E(".wpglobus-gutenberg-selector-dropdown").css({display:"none"}),E(".edit-post-header").css({"z-index":"9989"}),E(".wpglobus-gutenberg-selector-box").css({"z-index":"10000"})}),E(document).on("click",".editor-post-save-draft",function(){C.setSelectorStatus()}),E(document).on("click",".editor-post-publish-button",function(){C.setSelectorStatus()}))},WPGlobusSwitcherPlugin:function(){if(void 0!==wp.editPost&&void 0!==wp.plugins){var e,t=WPGlobusGutenberg.language,n=WPGlobusCoreData.enabled_languages,o=WPGlobusCoreData.en_language_name,s=WPGlobusGutenberg.flags_url,a="WPGlobus Switcher",l=location.href,u={};for(e in n)-1==l.indexOf("language="+t)?u[n[e]]=l+"&language="+n[e]:u[n[e]]=l.replace("language="+t,"language="+n[e]);var i=wp.i18n.__,r=wp.element.createElement,g=wp.element.Fragment,c=wp.components.TabPanel,b=wp.compose.withState,p=wp.components.RadioControl,d=wp.components.Notice,w=wp.components.Button,m=wp.editPost.PluginSidebarMoreMenuItem,G=wp.components.PanelBody,f=wp.editPost.PluginSidebar,h=wp.plugins.registerPlugin,P=E(".components-panel__header.edit-post-sidebar-header button.components-icon-button").eq(0),v={flagOnly:'<img height="20" width="20" style="width:20px;" src="'+WPGlobusGutenberg.flags_url[WPGlobusGutenberg.language]+'" />',flagLanguage:'<img height="20" width="20" style="width:20px;" src="'+WPGlobusGutenberg.flags_url[WPGlobusGutenberg.language]+'" /> '+WPGlobusAdmin.data.en_language_name[WPGlobusGutenberg.language],flagCode:'<img height="20" width="20" style="width:20px;" src="'+WPGlobusGutenberg.flags_url[WPGlobusGutenberg.language]+'" /> '+WPGlobusGutenberg.language,languageOnly:" "+WPGlobusAdmin.data.en_language_name[WPGlobusGutenberg.language],languageCode:" "+WPGlobusGutenberg.language},W="",_="",y=C.getOptionKey("switcherButtonType");S(WPGlobusGutenberg.options[y]),_=W,E(document).on("click",P,function(){T()});var x=b({value:_})(function(e){e.value;var t=e.setState;return r(p,{label:"",help:"Select type of switcher language button.",selected:_,className:"wpglobus-switcher-components-radio-control",options:[{label:"Flag only",value:"flagOnly"},{label:"Flag with language",value:"flagLanguage"},{label:"Flag with language code",value:"flagCode"},{label:"Language only",value:"languageOnly"},{label:"Language code",value:"languageCode"}],onChange:function(e){t({value:_=e}),O(y,e)}})});h("wpglobus-switcher",{icon:"",render:function(){return T(),r(g,{},r(m,{target:"wpglobus-switcher-sidebar",icon:"admin-site"},i("WPGlobus")),r(f,{name:"wpglobus-switcher-sidebar",title:a,className:"wpglobus-switcher-components-panel"},r("div",{className:"wpglobus-switcher-message wpglobus-switcher-error-message hidden",style:{}},""),r(G,{className:"wpglobus-switcher-panel__body"},(e=[{name:"switcher",title:"Languages",className:"wpglobus-panel-tab wpglobus-panel-tab-selector edit-post-sidebar__panel-tab"}],WPGlobusGutenberg.isEnabledTab("options")&&e.push({name:"options",title:"Options",className:"wpglobus-panel-tab wpglobus-panel-tab-options edit-post-sidebar__panel-tab"}),r(c,{name:"WPGlobusSwitcherTabPanel",className:"wpglobus-tab-panel",activeClass:"is-active",tabs:e},B)))));var e}})}function S(e){W=e=e||"flagLanguage"}function L(e){void 0===e&&(e=!0);var t,n=document.querySelectorAll(".wpglobus-switcher-components-radio-control .components-radio-control__input");0!=n.length&&(e?(n.forEach(function(e){e.classList.add(e.value),e.classList.remove("wpglobus-switcher-pulsate-radio"),e.classList.add("wpglobus-switcher-pulsate-radio-off")}),(t=document.querySelector(".wpglobus-switcher-components-radio-control ."+_)).classList.remove("wpglobus-switcher-pulsate-radio-off"),t.classList.add("wpglobus-switcher-pulsate-radio")):n.forEach(function(e){e.classList.remove("wpglobus-switcher-pulsate-radio"),e.classList.remove("wpglobus-switcher-pulsate-radio-off"),e.classList.add("wpglobus-switcher-pulsate-radio-on")}))}function N(e,t){void 0===e||C.noticeOn||(C.noticeOn=!0,e.innerText=t,e.classList.remove("hidden"),setTimeout(function(){e.classList.add("hidden"),C.noticeOn=!1},3e3))}function O(e,t){t=t||"",y==(e=e||"")&&(L(!0),function(e,t){if(""==(e=e||""))return;var n={sender:"WPGlobusGutenberg",_action:"saveOption",is_admin:1};return n.counter=C.counter++,n.options={},n.options[e]=t,wp.ajax.post(WPGlobusGutenberg.wpglobusAjax,{data:n})}(e,t).then(function(e){"success"==e.result&&(S(t),T(WPGlobusGutenberg.options[y]=t))}).fail(function(e){var t=document.getElementsByClassName("wpglobus-switcher-error-message");void 0!==t[0]&&("error"==e.result?N(t[0],e.message):400==e.status&&N(t[0],"Error: "+e.status+" ("+e.statusText+")"),_=W);var n=document.getElementsByClassName("wpglobus-panel-tab-options");void 0!==n[0]&&-1!=n[0].classList.value.indexOf("is-active")&&n[0].click()}).always(function(){L(!1)}))}function k(e){return void 0===v[e]&&(e=W),v[e]}function T(n){void 0!==n&&void 0!==v[n]||(n=W),setTimeout(function(){var e,t=document.querySelector('[aria-label="'+a+'"]');null!=t&&(void 0===t.dataset.status?(e=t.innerHTML,t.innerHTML=e+k(n),t.dataset.status="init"):(t.innerHTML=k(n),t.dataset.status="changed"))},300)}function B(e){return"switcher"==e.name?r("div",{className:"wpglobus-tab-content wpglobus-selector-tab-content"},r(d,{className:"wpglobus-switcher-panel__notice",status:"informational",isDismissible:!1},i("Select language")),r("div",{className:"wpglobus-switcher-panel__switcher-box"},WPGlobusGutenberg.pagenow==WPGlobusGutenberg.postNewPage?r("div",{style:{marginBottom:"20px"},className:"wpglobus-switcher-panel__switcher-notice"},WPGlobusGutenberg.i18n.save_post):r("ul",{className:"language-list"},n.map(function(e){return r("li",{key:e,className:"language-item"},r("img",{style:{marginRight:"7px",width:"20px"},className:"wpglobus-switcher-panel__flag",height:"20",width:"20",src:s[e]}),r(w,{href:u[e],isSmall:!0,isPrimary:!0},o[e]))}))),r(w,{className:"wpglobus-switcher-panel__button-link wpglobus-switcher-panel__info",href:WPGlobusGutenberg.store_link,isLink:!0,target:"_blank"},i("WPGlobus Premium")),r(w,{className:"wpglobus-switcher-panel__button-link wpglobus-switcher-panel__settings-link",href:WPGlobusGutenberg.options_page_url,isLink:!0},i("WPGlobus Options"))):"options"==e.name?r("div",{className:"wpglobus-tab-content wpglobus-options-tab-content"},r(d,{className:"wpglobus-switcher-panel__notice",status:"informational",isDismissible:!1},i("Select type")),r(x,null)):void 0}}};WPGlobusGutenberg=E.extend({},WPGlobusGutenberg,C),WPGlobusGutenberg.init()});
|
1 |
+
"use strict";jQuery(document).ready(function(E){var C={counter:0,noticeOn:!1,initDone:!1,languageSelectorBoxDelta:0,oldLanguageSelector:!1,languageSelectorEnabled:!0,parseBool:function(e){return!/^(false|0)$/i.test(e)&&!!e},getCounter:function(e){return C.counter},getOptionKey:function(e){return e=e||"",WPGlobusGutenberg.keyOption[e]},getOptions:function(){return WPGlobusGutenberg.options},isOldLanguageSelector:function(){return C.oldLanguageSelector},isPostDisabled:function(){return WPGlobusGutenberg.__post.disabled},isEnabledTab:function(e){var t=!1;return t="options"==(e=void 0===e?"options":e)&&C.parseBool(WPGlobusGutenberg.enabledOptionsTab)?!0:t},init:function(){WPGlobusGutenberg.yoastSeo=C.parseBool(WPGlobusGutenberg.yoastSeo),WPGlobusGutenberg.elementor=C.parseBool(WPGlobusGutenberg.elementor),C.isPostDisabled()||(C.initListeners(),C.initNotifications(),C.setTabs(),C.formHandler(),C.attachListeners())},initListeners:function(){WPGlobusGutenberg.yoastSeo&&1==E(".yoast.wpseo-metabox").length&&E(window).on("beforeunload",function(e){e.stopImmediatePropagation()})},formHandler:function(){var e=E(".metabox-base-form #referredby").attr("value");void 0!==e&&(e=-1==e.indexOf("language=en")?e+"&language="+WPGlobusGutenberg.language:e.replace("language=en","language="+WPGlobusGutenberg.language),E(".metabox-base-form #referredby").attr("value",e)),void 0!==(e=E('input[name="_wp_original_http_referer"]').attr("value"))&&(e=-1==e.indexOf("language=en")?e+"&language="+WPGlobusGutenberg.language:e.replace("language=en","language="+WPGlobusGutenberg.language),E('input[name="_wp_original_http_referer"]').attr("value",e))},initNotifications:function(){void 0!==wp.editPost&&void 0!==wp.plugins&&WPGlobusGutenberg.elementor&&"internal"==WPGlobusGutenberg.data.elementorCssPrintMethod&&wp.data.dispatch("core/notices").createNotice("error",WPGlobusGutenberg.i18n.elementorWarning,{id:"elementorcssprintmethodnotice",isDismissible:!0,actions:[{url:WPGlobusGutenberg.i18n.elementorActionLink,label:WPGlobusGutenberg.i18n.elementorActionLabel}]})},setTabs:function(){var t;0!=WPGlobusGutenberg.tabs.length?(C.oldLanguageSelector=!0,t=setInterval(function(){var e=E(".edit-post-header__settings");1==e.length&&(e.before(WPGlobusGutenberg.tabs),clearInterval(t))},200)):C.WPGlobusSwitcherPlugin()},setSelectorStatus:function(){var e;C.isOldLanguageSelector()&&(E(".wpglobus-gutenberg-selector-box").css({opacity:"0.2"}).attr("onclick","return false;"),C.languageSelectorEnabled=!1,e=setInterval(function(){if(0==E(".is-saving").length){if(clearInterval(e),WPGlobusGutenberg.pagenow==WPGlobusGutenberg.postNewPage&&-1!=location.pathname.indexOf(WPGlobusGutenberg.postEditPage))return WPGlobusGutenberg.pagenow=WPGlobusGutenberg.postEditPage,E(".wpglobus-gutenberg-selector-box").css({opacity:"1"}).attr("onclick",""),void C.reloadPage();C.languageSelectorEnabled=!0,E(".wpglobus-gutenberg-selector-box").css({opacity:"1"}).attr("onclick","")}},400))},reloadPage:function(){E(".wpglobus-selector-grid").css({"grid-template-columns":"10% 90%"}),E(".wpglobus-gutenberg-selector-text").text(WPGlobusGutenberg.i18n.reload),function e(){E(".wpglobus-gutenberg-selector").fadeOut(500).fadeIn(500,e)}(),setTimeout(function(){location.reload()},500)},attachListeners:function(){C.isOldLanguageSelector()&&(E(document).on("mouseenter",".wpglobus-gutenberg-selector",function(e){C.languageSelectorEnabled&&(E(".wpglobus-gutenberg-selector-dropdown").css({display:"block"}),C.languageSelectorBoxDelta=e.screenY,E(".edit-post-header").css({"z-index":"100000"}),E(".wpglobus-gutenberg-selector-box").css({"z-index":"100001"}))}),E(document).on("mouseleave",".wpglobus-gutenberg-selector",function(e){0!=C.languageSelectorBoxDelta&&e.screenY-C.languageSelectorBoxDelta<=0&&(E(".wpglobus-gutenberg-selector-dropdown").css({display:"none"}),E(".edit-post-header").css({"z-index":"9989"}),E(".wpglobus-gutenberg-selector-box").css({"z-index":"100"}))}),E(document).on("mouseleave",".wpglobus-gutenberg-selector-dropdown",function(e){E(".wpglobus-gutenberg-selector-dropdown").css({display:"none"}),E(".edit-post-header").css({"z-index":"9989"}),E(".wpglobus-gutenberg-selector-box").css({"z-index":"10000"})}),E(document).on("click",".editor-post-save-draft",function(){C.setSelectorStatus()}),E(document).on("click",".editor-post-publish-button",function(){C.setSelectorStatus()}))},WPGlobusSwitcherPlugin:function(){if(void 0!==wp.editPost&&void 0!==wp.plugins){var e,t=WPGlobusGutenberg.language,n=WPGlobusCoreData.enabled_languages,o=WPGlobusCoreData.en_language_name,s=WPGlobusGutenberg.flags_url,a="WPGlobus Switcher",l=location.href,u={};for(e in n)-1==l.indexOf("language="+t)?u[n[e]]=l+"&language="+n[e]:u[n[e]]=l.replace("language="+t,"language="+n[e]);var i=wp.i18n.__,r=wp.element.createElement,g=wp.element.Fragment,c=wp.components.TabPanel,b=wp.compose.withState,p=wp.components.RadioControl,d=wp.components.Notice,w=wp.components.Button,m=wp.editPost.PluginSidebarMoreMenuItem,G=wp.components.PanelBody,f=wp.editPost.PluginSidebar,h=wp.plugins.registerPlugin,P=E(".components-panel__header.edit-post-sidebar-header button.components-icon-button").eq(0),v={flagOnly:'<img height="20" width="20" style="width:20px;" src="'+WPGlobusGutenberg.flags_url[WPGlobusGutenberg.language]+'" />',flagLanguage:'<img height="20" width="20" style="width:20px;" src="'+WPGlobusGutenberg.flags_url[WPGlobusGutenberg.language]+'" /> '+WPGlobusAdmin.data.en_language_name[WPGlobusGutenberg.language],flagCode:'<img height="20" width="20" style="width:20px;" src="'+WPGlobusGutenberg.flags_url[WPGlobusGutenberg.language]+'" /> '+WPGlobusGutenberg.language,languageOnly:" "+WPGlobusAdmin.data.en_language_name[WPGlobusGutenberg.language],languageCode:" "+WPGlobusGutenberg.language},W="",_="",y=C.getOptionKey("switcherButtonType");S(WPGlobusGutenberg.options[y]),_=W,E(document).on("click",P,function(){T()});var x=b({value:_})(function(e){e.value;var t=e.setState;return r(p,{label:"",help:"Select type of switcher language button.",selected:_,className:"wpglobus-switcher-components-radio-control",options:[{label:"Flag only",value:"flagOnly"},{label:"Flag with language",value:"flagLanguage"},{label:"Flag with language code",value:"flagCode"},{label:"Language only",value:"languageOnly"},{label:"Language code",value:"languageCode"}],onChange:function(e){t({value:_=e}),O(y,e)}})});h("wpglobus-switcher",{icon:"",render:function(){return T(),r(g,{},r(m,{target:"wpglobus-switcher-sidebar",icon:"admin-site"},i("WPGlobus")),r(f,{name:"wpglobus-switcher-sidebar",title:a,className:"wpglobus-switcher-components-panel"},r("div",{className:"wpglobus-switcher-message wpglobus-switcher-error-message hidden",style:{}},""),r(G,{className:"wpglobus-switcher-panel__body"},(e=[{name:"switcher",title:"Languages",className:"wpglobus-panel-tab wpglobus-panel-tab-selector edit-post-sidebar__panel-tab"}],WPGlobusGutenberg.isEnabledTab("options")&&e.push({name:"options",title:"Options",className:"wpglobus-panel-tab wpglobus-panel-tab-options edit-post-sidebar__panel-tab"}),r(c,{name:"WPGlobusSwitcherTabPanel",className:"wpglobus-tab-panel",activeClass:"is-active",tabs:e},B)))));var e}})}function S(e){W=e=e||"flagLanguage"}function L(e){void 0===e&&(e=!0);var t=document.querySelectorAll(".wpglobus-switcher-components-radio-control .components-radio-control__input");0!=t.length&&(e?(t.forEach(function(e){e.classList.add(e.value),e.classList.remove("wpglobus-switcher-pulsate-radio"),e.classList.add("wpglobus-switcher-pulsate-radio-off")}),(e=document.querySelector(".wpglobus-switcher-components-radio-control ."+_)).classList.remove("wpglobus-switcher-pulsate-radio-off"),e.classList.add("wpglobus-switcher-pulsate-radio")):t.forEach(function(e){e.classList.remove("wpglobus-switcher-pulsate-radio"),e.classList.remove("wpglobus-switcher-pulsate-radio-off"),e.classList.add("wpglobus-switcher-pulsate-radio-on")}))}function N(e,t){void 0===e||C.noticeOn||(C.noticeOn=!0,e.innerText=t,e.classList.remove("hidden"),setTimeout(function(){e.classList.add("hidden"),C.noticeOn=!1},3e3))}function O(e,t){t=t||"",y==(e=e||"")&&(L(!0),function(e,t){if(""!=(e=e||"")){var n={sender:"WPGlobusGutenberg",_action:"saveOption",is_admin:1};return n.counter=C.counter++,n.options={},n.options[e]=t,wp.ajax.post(WPGlobusGutenberg.wpglobusAjax,{data:n})}}(e,t).then(function(e){"success"==e.result&&(S(t),T(WPGlobusGutenberg.options[y]=t))}).fail(function(e){var t=document.getElementsByClassName("wpglobus-switcher-error-message");void 0!==t[0]&&("error"==e.result?N(t[0],e.message):400==e.status&&N(t[0],"Error: "+e.status+" ("+e.statusText+")"),_=W);e=document.getElementsByClassName("wpglobus-panel-tab-options");void 0!==e[0]&&-1!=e[0].classList.value.indexOf("is-active")&&e[0].click()}).always(function(){L(!1)}))}function k(e){return void 0===v[e]&&(e=W),v[e]}function T(n){void 0!==n&&void 0!==v[n]||(n=W),setTimeout(function(){var e,t=document.querySelector('[aria-label="'+a+'"]');null!=t&&(void 0===t.dataset.status?(e=t.innerHTML,t.innerHTML=e+k(n),t.dataset.status="init"):(t.innerHTML=k(n),t.dataset.status="changed"))},300)}function B(e){return"switcher"==e.name?r("div",{className:"wpglobus-tab-content wpglobus-selector-tab-content"},r(d,{className:"wpglobus-switcher-panel__notice",status:"informational",isDismissible:!1},i("Select language")),r("div",{className:"wpglobus-switcher-panel__switcher-box"},WPGlobusGutenberg.pagenow==WPGlobusGutenberg.postNewPage?r("div",{style:{marginBottom:"20px"},className:"wpglobus-switcher-panel__switcher-notice"},WPGlobusGutenberg.i18n.save_post):r("ul",{className:"language-list"},n.map(function(e){return r("li",{key:e,className:"language-item"},r("img",{style:{marginRight:"7px",width:"20px"},className:"wpglobus-switcher-panel__flag",height:"20",width:"20",src:s[e]}),r(w,{href:u[e],isSmall:!0,isPrimary:!0},o[e]))}))),r(w,{className:"wpglobus-switcher-panel__button-link wpglobus-switcher-panel__info",href:WPGlobusGutenberg.store_link,isLink:!0,target:"_blank"},i("WPGlobus Premium")),r(w,{className:"wpglobus-switcher-panel__button-link wpglobus-switcher-panel__settings-link",href:WPGlobusGutenberg.options_page_url,isLink:!0},i("WPGlobus Options"))):"options"==e.name?r("div",{className:"wpglobus-tab-content wpglobus-options-tab-content"},r(d,{className:"wpglobus-switcher-panel__notice",status:"informational",isDismissible:!1},i("Select type")),r(x,null)):void 0}}};WPGlobusGutenberg=E.extend({},WPGlobusGutenberg,C),WPGlobusGutenberg.init()});
|
includes/css/wpglobus-admin-debug.css
CHANGED
@@ -1,3 +1 @@
|
|
1 |
-
#wpglobus-admin-debug-box{clear:both;background-color:#f1f1f1;margin:25px 0 0;border-top:1px solid #ccc;min-width:1000px;padding:0 0 35px 190px;position:absolute;bottom:-100px}#wpglobus-admin-debug-box pre{white-space:pre-wrap;word-wrap:break-word}#wpglobus-admin-debug-box table{position:absolute;color:#333 !important;border-collapse:collapse !important;box-shadow:none !important;width:90% !important;table-layout:auto !important;margin:0 0 30px}#wpglobus-admin-debug-box td,#wpglobus-admin-debug-box th,#wpglobus-admin-debug-box caption{background:#fff !important;color:#333 !important;box-sizing:border-box !important;text-align:left !important;font-style:normal !important;font-weight:normal !important;font-size:11px !important;line-height:16px !important;font-family:Menlo,
|
2 |
-
|
3 |
-
/*# sourceMappingURL=wpglobus-admin-debug.css.map */
|
1 |
+
#wpglobus-admin-debug-box{clear:both;background-color:#f1f1f1;margin:25px 0 0;border-top:1px solid #ccc;min-width:1000px;padding:0 0 35px 190px;position:absolute;bottom:-100px}#wpglobus-admin-debug-box pre{white-space:pre-wrap;word-wrap:break-word}#wpglobus-admin-debug-box table{position:absolute;color:#333 !important;border-collapse:collapse !important;box-shadow:none !important;width:90% !important;table-layout:auto !important;margin:0 0 30px}#wpglobus-admin-debug-box td,#wpglobus-admin-debug-box th,#wpglobus-admin-debug-box caption{background:#fff !important;color:#333 !important;box-sizing:border-box !important;text-align:left !important;font-style:normal !important;font-weight:normal !important;font-size:11px !important;line-height:16px !important;font-family:Menlo,Monaco,Consolas,monospace !important;border:1px solid #e8e8e8 !important;padding:4px 6px 3px !important;vertical-align:top !important;text-shadow:none !important;text-transform:none !important;-webkit-font-smoothing:initial !important;letter-spacing:normal !important}#wpglobus-admin-debug-box th{font-weight:bold}#wpglobus-admin-debug-box caption{caption-side:top !important;border-bottom-width:0 !important}#wpglobus-admin-debug-box tbody tr:hover td{background:#f1f1f1 !important}#wpglobus-admin-debug-box th[scope=col]{border-bottom-width:0 !important}
|
|
|
|
includes/css/wpglobus-admin-debug.css.map
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
{"version":3,"sources":["wpglobus-admin-debug.scss"],"names":[],"mappings":"AAAA,0BACE,UAAW,CACX,wBAAyB,CACzB,eAAgB,CAChB,yBAA0B,CAC1B,gBAAiB,CACjB,sBAAuB,CACvB,iBAAkB,CAClB,aAAc,CARhB,8BAWI,oBAAqB,CACrB,oBAAqB,CAZzB,gCAgBI,iBAAkB,CAClB,qBAAsB,CACtB,mCAAoC,CACpC,0BAA2B,CAC3B,oBAAqB,CACrB,4BAA6B,CAC7B,eAAgB,CAtBpB,4FA0BI,0BAA2B,CAC3B,qBAAsB,CACtB,gCAAiC,CACjC,0BAA2B,CAC3B,4BAA6B,CAC7B,6BAA8B,CAC9B,yBAA0B,CAC1B,2BAA4B,CAC5B,yDAA0D,CAC1D,mCAAoC,CACpC,8BAA+B,CAC/B,6BAA8B,CAC9B,2BAA4B,CAC5B,8BAA+B,CAC/B,yCAA0C,CAC1C,gCAAiC,CAzCrC,6BA6CI,gBAAiB,CA7CrB,kCAiDI,2BAA4B,CAC5B,gCAAiC,CAlDrC,4CAsDI,6BAA8B,CAtDlC,wCA0DI,gCAAiC","file":"wpglobus-admin-debug.css"}
|
|
includes/css/wpglobus-admin-tabs.css
CHANGED
@@ -1,3 +1 @@
|
|
1 |
-
.wpglobus-wp-admin #post-body .wpglobus-post-body-tabs .ui-widget-content input.like-default-title{padding:3px 8px;font-size:1.7em;line-height:100%;width:100%;outline:none}.wpglobus-wp-admin .wpglobus-post-body-tabs .titlediv{margin-bottom:20px}.wpglobus-wp-admin .wpglobus-post-body-tabs .mceIframeContainer iframe{min-height:150px !important}.wpglobus-wp-admin .wpglobus-post-body-tabs .wp-editor-container{border:1px solid #ccc}.wpglobus-wp-admin .wpglobus-post-body-tabs .titlediv-wpglobus{position:relative}.wpglobus-wp-admin .wpglobus-post-body-tabs .tabs-nav ul,.wpglobus-wp-admin #wpglobus-aioseop-tabs .tabs-nav ul,.wpglobus-wp-admin #wpglobus-wpseo-tabs .tabs-nav ul,.wpglobus-wp-admin .wpglobus-wpseo-tabs .tabs-nav ul,.wpglobus-wp-admin .wpglobus-taxonomy-tabs .tabs-nav ul{list-style-type:none;margin:0 10px;padding:0}.wpglobus-wp-admin .wpglobus-post-body-tabs li a,.wpglobus-wp-admin .wpglobus-post-body-tabs ul li,.wpglobus-wp-admin #wpglobus-aioseop-tabs li a,.wpglobus-wp-admin #wpglobus-aioseop-tabs ul li,.wpglobus-wp-admin #wpglobus-wpseo-tabs li a,.wpglobus-wp-admin #wpglobus-wpseo-tabs ul li,.wpglobus-wp-admin .wpglobus-wpseo-tabs li a,.wpglobus-wp-admin .wpglobus-wpseo-tabs ul li,.wpglobus-wp-admin .wpglobus-taxonomy-tabs li a,.wpglobus-wp-admin .wpglobus-taxonomy-tabs ul li{float:left;margin:0}.wpglobus-wp-admin .wpglobus-post-body-tabs li.ui-state-default,.wpglobus-wp-admin #wpglobus-aioseop-tabs li.ui-state-default,.wpglobus-wp-admin #wpglobus-wpseo-tabs li.ui-state-default,.wpglobus-wp-admin .wpglobus-wpseo-tabs li.ui-state-default,.wpglobus-wp-admin .wpglobus-taxonomy-tabs li.ui-state-default{border:0;background:transparent}.wpglobus-wp-admin .wpglobus-post-body-tabs ul li.ui-state-default a,.wpglobus-wp-admin #wpglobus-aioseop-tabs ul li.ui-state-default a,.wpglobus-wp-admin #wpglobus-wpseo-tabs ul li.ui-state-default a,.wpglobus-wp-admin .wpglobus-wpseo-tabs ul li.ui-state-default a,.wpglobus-wp-admin .wpglobus-taxonomy-tabs ul li.ui-state-default a{display:block;color:#777;background:#ebebeb;border:1px solid #e5e5e5;border-bottom:0;font-weight:normal;height:2em;line-height:2em;margin-right:5px;padding:0 10px;text-decoration:none}.wpglobus-wp-admin .wpglobus-post-body-tabs ul li.ui-state-active a,.wpglobus-wp-admin #wpglobus-aioseop-tabs ul li.ui-state-active a,.wpglobus-wp-admin #wpglobus-wpseo-tabs ul li.ui-state-active a,.wpglobus-wp-admin .wpglobus-wpseo-tabs ul li.ui-state-active a,.wpglobus-wp-admin .wpglobus-taxonomy-tabs ul li.ui-state-active a{background:#fff;border:1px solid #e5e5e5;border-bottom-color:#fff;color:#000;margin-bottom:-1px;font-weight:700}.wpglobus-wp-admin .wpglobus-post-body-tabs ul li a:hover,.wpglobus-wp-admin #wpglobus-aioseop-tabs ul li a:hover,.wpglobus-wp-admin #wpglobus-wpseo-tabs ul li a:hover,.wpglobus-wp-admin .wpglobus-wpseo-tabs ul li a:hover,.wpglobus-wp-admin .wpglobus-taxonomy-tabs ul li a:hover{color:#000}.wpglobus-wp-admin .wpglobus-post-body-tabs ul li a:focus,.wpglobus-wp-admin #wpglobus-aioseop-tabs ul li a:focus,.wpglobus-wp-admin #wpglobus-wpseo-tabs ul li a:focus,.wpglobus-wp-admin .wpglobus-wpseo-tabs ul li a:focus,.wpglobus-wp-admin .wpglobus-taxonomy-tabs ul li a:focus{box-shadow:none}.wpglobus-wp-admin .wpglobus-post-body-tabs .wpglobus-post-body-tabs-list,.wpglobus-wp-admin .wpglobus-post-body-tabs .wpglobus-wpseo-tabs-list,.wpglobus-wp-admin .wpglobus-post-body-tabs .wpglobus-aioseop-tabs-list,.wpglobus-wp-admin #wpglobus-aioseop-tabs .wpglobus-post-body-tabs-list,.wpglobus-wp-admin #wpglobus-aioseop-tabs .wpglobus-wpseo-tabs-list,.wpglobus-wp-admin #wpglobus-aioseop-tabs .wpglobus-aioseop-tabs-list,.wpglobus-wp-admin #wpglobus-wpseo-tabs .wpglobus-post-body-tabs-list,.wpglobus-wp-admin #wpglobus-wpseo-tabs .wpglobus-wpseo-tabs-list,.wpglobus-wp-admin #wpglobus-wpseo-tabs .wpglobus-aioseop-tabs-list,.wpglobus-wp-admin .wpglobus-wpseo-tabs .wpglobus-post-body-tabs-list,.wpglobus-wp-admin .wpglobus-wpseo-tabs .wpglobus-wpseo-tabs-list,.wpglobus-wp-admin .wpglobus-wpseo-tabs .wpglobus-aioseop-tabs-list,.wpglobus-wp-admin .wpglobus-taxonomy-tabs .wpglobus-post-body-tabs-list,.wpglobus-wp-admin .wpglobus-taxonomy-tabs .wpglobus-wpseo-tabs-list,.wpglobus-wp-admin .wpglobus-taxonomy-tabs .wpglobus-aioseop-tabs-list{border:none;border-bottom:1px solid #
|
2 |
-
|
3 |
-
/*# sourceMappingURL=wpglobus-admin-tabs.css.map */
|
1 |
+
.wpglobus-wp-admin #post-body .wpglobus-post-body-tabs .ui-widget-content input.like-default-title{padding:3px 8px;font-size:1.7em;line-height:100%;width:100%;outline:none}.wpglobus-wp-admin .wpglobus-post-body-tabs .titlediv{margin-bottom:20px}.wpglobus-wp-admin .wpglobus-post-body-tabs .mceIframeContainer iframe{min-height:150px !important}.wpglobus-wp-admin .wpglobus-post-body-tabs .wp-editor-container{border:1px solid #ccc}.wpglobus-wp-admin .wpglobus-post-body-tabs .titlediv-wpglobus{position:relative}.wpglobus-wp-admin .wpglobus-post-body-tabs .tabs-nav ul,.wpglobus-wp-admin #wpglobus-aioseop-tabs .tabs-nav ul,.wpglobus-wp-admin #wpglobus-wpseo-tabs .tabs-nav ul,.wpglobus-wp-admin .wpglobus-wpseo-tabs .tabs-nav ul,.wpglobus-wp-admin .wpglobus-taxonomy-tabs .tabs-nav ul{list-style-type:none;margin:0 10px;padding:0}.wpglobus-wp-admin .wpglobus-post-body-tabs li a,.wpglobus-wp-admin .wpglobus-post-body-tabs ul li,.wpglobus-wp-admin #wpglobus-aioseop-tabs li a,.wpglobus-wp-admin #wpglobus-aioseop-tabs ul li,.wpglobus-wp-admin #wpglobus-wpseo-tabs li a,.wpglobus-wp-admin #wpglobus-wpseo-tabs ul li,.wpglobus-wp-admin .wpglobus-wpseo-tabs li a,.wpglobus-wp-admin .wpglobus-wpseo-tabs ul li,.wpglobus-wp-admin .wpglobus-taxonomy-tabs li a,.wpglobus-wp-admin .wpglobus-taxonomy-tabs ul li{float:left;margin:0}.wpglobus-wp-admin .wpglobus-post-body-tabs li.ui-state-default,.wpglobus-wp-admin #wpglobus-aioseop-tabs li.ui-state-default,.wpglobus-wp-admin #wpglobus-wpseo-tabs li.ui-state-default,.wpglobus-wp-admin .wpglobus-wpseo-tabs li.ui-state-default,.wpglobus-wp-admin .wpglobus-taxonomy-tabs li.ui-state-default{border:0;background:transparent}.wpglobus-wp-admin .wpglobus-post-body-tabs ul li.ui-state-default a,.wpglobus-wp-admin #wpglobus-aioseop-tabs ul li.ui-state-default a,.wpglobus-wp-admin #wpglobus-wpseo-tabs ul li.ui-state-default a,.wpglobus-wp-admin .wpglobus-wpseo-tabs ul li.ui-state-default a,.wpglobus-wp-admin .wpglobus-taxonomy-tabs ul li.ui-state-default a{display:block;color:#777;background:#ebebeb;border:1px solid #e5e5e5;border-bottom:0;font-weight:normal;height:2em;line-height:2em;margin-right:5px;padding:0 10px;text-decoration:none}.wpglobus-wp-admin .wpglobus-post-body-tabs ul li.ui-state-active a,.wpglobus-wp-admin #wpglobus-aioseop-tabs ul li.ui-state-active a,.wpglobus-wp-admin #wpglobus-wpseo-tabs ul li.ui-state-active a,.wpglobus-wp-admin .wpglobus-wpseo-tabs ul li.ui-state-active a,.wpglobus-wp-admin .wpglobus-taxonomy-tabs ul li.ui-state-active a{background:#fff;border:1px solid #e5e5e5;border-bottom-color:#fff;color:#000;margin-bottom:-1px;font-weight:700}.wpglobus-wp-admin .wpglobus-post-body-tabs ul li a:hover,.wpglobus-wp-admin #wpglobus-aioseop-tabs ul li a:hover,.wpglobus-wp-admin #wpglobus-wpseo-tabs ul li a:hover,.wpglobus-wp-admin .wpglobus-wpseo-tabs ul li a:hover,.wpglobus-wp-admin .wpglobus-taxonomy-tabs ul li a:hover{color:#000}.wpglobus-wp-admin .wpglobus-post-body-tabs ul li a:focus,.wpglobus-wp-admin #wpglobus-aioseop-tabs ul li a:focus,.wpglobus-wp-admin #wpglobus-wpseo-tabs ul li a:focus,.wpglobus-wp-admin .wpglobus-wpseo-tabs ul li a:focus,.wpglobus-wp-admin .wpglobus-taxonomy-tabs ul li a:focus{box-shadow:none}.wpglobus-wp-admin .wpglobus-post-body-tabs .wpglobus-post-body-tabs-list,.wpglobus-wp-admin .wpglobus-post-body-tabs .wpglobus-wpseo-tabs-list,.wpglobus-wp-admin .wpglobus-post-body-tabs .wpglobus-aioseop-tabs-list,.wpglobus-wp-admin #wpglobus-aioseop-tabs .wpglobus-post-body-tabs-list,.wpglobus-wp-admin #wpglobus-aioseop-tabs .wpglobus-wpseo-tabs-list,.wpglobus-wp-admin #wpglobus-aioseop-tabs .wpglobus-aioseop-tabs-list,.wpglobus-wp-admin #wpglobus-wpseo-tabs .wpglobus-post-body-tabs-list,.wpglobus-wp-admin #wpglobus-wpseo-tabs .wpglobus-wpseo-tabs-list,.wpglobus-wp-admin #wpglobus-wpseo-tabs .wpglobus-aioseop-tabs-list,.wpglobus-wp-admin .wpglobus-wpseo-tabs .wpglobus-post-body-tabs-list,.wpglobus-wp-admin .wpglobus-wpseo-tabs .wpglobus-wpseo-tabs-list,.wpglobus-wp-admin .wpglobus-wpseo-tabs .wpglobus-aioseop-tabs-list,.wpglobus-wp-admin .wpglobus-taxonomy-tabs .wpglobus-post-body-tabs-list,.wpglobus-wp-admin .wpglobus-taxonomy-tabs .wpglobus-wpseo-tabs-list,.wpglobus-wp-admin .wpglobus-taxonomy-tabs .wpglobus-aioseop-tabs-list{border:none;border-bottom:1px solid #ddd;background:transparent;min-height:3em}.wpglobus-wp-admin .wpglobus-post-body-tabs .wpglobus-post-body-tabs-list .wpglobus-tab-link-active,.wpglobus-wp-admin #wpglobus-aioseop-tabs .wpglobus-post-body-tabs-list .wpglobus-tab-link-active,.wpglobus-wp-admin #wpglobus-wpseo-tabs .wpglobus-post-body-tabs-list .wpglobus-tab-link-active,.wpglobus-wp-admin .wpglobus-wpseo-tabs .wpglobus-post-body-tabs-list .wpglobus-tab-link-active,.wpglobus-wp-admin .wpglobus-taxonomy-tabs .wpglobus-post-body-tabs-list .wpglobus-tab-link-active{border-top:2px solid blue}.wpglobus-wp-admin .wpglobus-post-body-tabs .ui-corner-all,.wpglobus-wp-admin #wpglobus-aioseop-tabs .ui-corner-all,.wpglobus-wp-admin #wpglobus-wpseo-tabs .ui-corner-all,.wpglobus-wp-admin .wpglobus-wpseo-tabs .ui-corner-all,.wpglobus-wp-admin .wpglobus-taxonomy-tabs .ui-corner-all{border-bottom-right-radius:0;border-bottom-left-radius:0;border-top-right-radius:0;border-top-left-radius:0}.wpglobus-wp-admin .wpglobus-post-body-tabs.ui-widget-content,.wpglobus-wp-admin #wpglobus-aioseop-tabs.ui-widget-content,.wpglobus-wp-admin #wpglobus-wpseo-tabs.ui-widget-content,.wpglobus-wp-admin .wpglobus-wpseo-tabs.ui-widget-content,.wpglobus-wp-admin .wpglobus-taxonomy-tabs.ui-widget-content{border:none;background:transparent;color:inherit}.wpglobus-wp-admin .wpglobus-post-body-tabs.ui-widget,.wpglobus-wp-admin #wpglobus-aioseop-tabs.ui-widget,.wpglobus-wp-admin #wpglobus-wpseo-tabs.ui-widget,.wpglobus-wp-admin .wpglobus-wpseo-tabs.ui-widget,.wpglobus-wp-admin .wpglobus-taxonomy-tabs.ui-widget{font-family:inherit;font-size:inherit}.wpglobus-wp-admin .wpglobus-post-body-tabs.ui-tabs,.wpglobus-wp-admin #wpglobus-aioseop-tabs.ui-tabs,.wpglobus-wp-admin #wpglobus-wpseo-tabs.ui-tabs,.wpglobus-wp-admin .wpglobus-wpseo-tabs.ui-tabs,.wpglobus-wp-admin .wpglobus-taxonomy-tabs.ui-tabs{padding:inherit}.wpglobus-wp-admin .wpglobus-post-body-tabs.ui-tabs .ui-tabs-nav,.wpglobus-wp-admin #wpglobus-aioseop-tabs.ui-tabs .ui-tabs-nav,.wpglobus-wp-admin #wpglobus-wpseo-tabs.ui-tabs .ui-tabs-nav,.wpglobus-wp-admin .wpglobus-wpseo-tabs.ui-tabs .ui-tabs-nav,.wpglobus-wp-admin .wpglobus-taxonomy-tabs.ui-tabs .ui-tabs-nav{margin:0 0 1em 0;padding:0}.wpglobus-wp-admin .wpglobus-post-body-tabs.ui-tabs .ui-tabs-panel,.wpglobus-wp-admin #wpglobus-aioseop-tabs.ui-tabs .ui-tabs-panel,.wpglobus-wp-admin #wpglobus-wpseo-tabs.ui-tabs .ui-tabs-panel,.wpglobus-wp-admin .wpglobus-wpseo-tabs.ui-tabs .ui-tabs-panel,.wpglobus-wp-admin .wpglobus-taxonomy-tabs.ui-tabs .ui-tabs-panel{border-width:0;padding:inherit;background:inherit}.wpglobus-wp-admin #edittag #cat-tabs .form-field{margin:0 0 10px;padding:8px}.wpglobus-wp-admin #edittag #cat-tabs .form-field p{font-size:12px;font-style:italic;font-family:sans-serif;color:#666;margin:4px 0 5px}.wpglobus-wp-admin #edittag #cat-tabs label{display:block}.wpglobus-wp-admin .post-excerpt{margin:0;height:4em;width:98%}.wpglobus-wp-admin .titlediv-wpglobus .title_wpglobus{background-color:#fff;font-size:1.7em;height:1.7em;line-height:100%;margin:0;outline:-moz-use-text-color none 0;padding:3px 8px;width:100%}.wpglobus-wp-admin .postdivrich-wpglobus .wp-editor-tools{background-color:#f1f1f1;padding-top:20px}.wpglobus-wp-admin .wpglobus-edit-slug-box{height:31px}.wpglobus-wp-admin #wpglobus-wpseo-tabs .wpglobus-wpseosnippet{font-family:Arial,Helvetica,sans-serif;font-style:normal}.wpglobus-wp-admin #wpglobus-wpseo-tabs .wpglobus-wpseosnippet .title{color:#1e0fbe;display:block;font-size:18px !important;line-height:1.2;overflow-x:hidden;overflow-y:hidden;text-overflow:ellipsis;white-space:nowrap;width:512px}.wpglobus-wp-admin #wpglobus-wpseo-tabs .wpglobus-wpseosnippet .url{color:#006621;font-size:13px;line-height:16px}.wpglobus-wp-admin #wpglobus-wpseo-tabs .wpglobus-wpseosnippet .desc{font-size:small;line-height:1.4;word-wrap:break-word}.wpglobus-wp-admin #wpglobus-wpseo-tabs .wpglobus-focuskwresults ul{margin:0}.wpglobus-wp-admin #wpglobus-wpseo-tabs .wpglobus-focuskwresults li{float:none !important;list-style-type:disc;margin:0 0 0 20px !important}.wpglobus-wp-admin #wpglobus-wpseo-tabs .wpglobus-focuskwresults li,.wpglobus-wp-admin #wpglobus-wpseo-tabs .wpglobus-focuskwresults p{font-size:13px !important}.wpglobus-wp-admin #wpglobus-wpseo-tabs .wpglobus-snippet_container [contenteditable=true]:hover{background:url(images/edit.svg) right top no-repeat #bbdefb;cursor:pointer}.wpglobus-wp-admin .wpglobus-wpseo-meta-section .wpseotab .yoast-section ul[role=list] li,.wpglobus-wp-admin .wpglobus-wpseo-meta-section .wpseotab .yoast-section ul[role=list] li a{float:none !important}
|
|
|
|
includes/css/wpglobus-admin-tabs.css.map
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
{"version":3,"sources":["wpglobus-admin-tabs.scss"],"names":[],"mappings":"AAKA,mGAII,eAAgB,CAChB,eAAgB,CAChB,gBAAiB,CACjB,UAAW,CACX,YAAa,CARjB,sDAcM,kBAAmB,CAdzB,uEAkBM,2BAA4B,CAlBlC,iEAsBM,qBAAsB,CAtB5B,+DA0BM,iBAAkB,CA1BxB,kRAkCM,oBAAqB,CACrB,aAAc,CACd,SAAU,CApChB,ydAwCM,UAAW,CACX,QAAS,CAzCf,qTA6CM,QAAS,CACT,sBAAuB,CA9C7B,8UAkDM,aAAc,CACd,UAAW,CACX,kBAAmB,CACnB,wBAAyB,CACzB,eAAgB,CAChB,kBAAmB,CACnB,UAAW,CACX,eAAgB,CAChB,gBAAiB,CACjB,cAAe,CACf,oBAAqB,CA5D3B,yUAgEM,eAAgB,CAChB,wBAAyB,CACzB,wBAAyB,CACzB,UAAW,CACX,kBAAmB,CACnB,eAAgB,CArEtB,uRA0EQ,UAAW,CA1EnB,uRA6EQ,eAAgB,CA7ExB,uhCAkFM,WAAY,CACZ,+BAAgC,CAChC,sBAAuB,CAGvB,cAAe,CAvFrB,yeA2FG,yBAAyB,CA3F5B,4RA+FM,4BAA6B,CAC7B,2BAA4B,CAC5B,yBAA0B,CAC1B,wBAAyB,CAlG/B,2SAsGM,WAAY,CACZ,sBAAuB,CACvB,aAAc,CAxGpB,mQA4GM,mBAAoB,CACpB,iBAAkB,CA7GxB,yPAiHM,eAAgB,CAjHtB,0TAmHQ,gBAAiB,CACjB,SAAU,CApHlB,oUAuHQ,cAAe,CACf,eAAgB,CAChB,kBAAmB,CAzH3B,kDAiII,eAAgB,CAChB,WAAY,CAlIhB,oDAsII,cAAe,CACf,iBAAkB,CAClB,sBAAuB,CACvB,UAAW,CACX,gBAAiB,CA1IrB,4CA8II,aAAc,CA9IlB,iCAkJI,QAAS,CACT,UAAW,CACX,SAAU,CApJd,sDAwJI,qBAAsB,CACtB,eAAgB,CAChB,YAAa,CACb,gBAAiB,CACjB,QAAS,CACT,kCAAmC,CACnC,eAAgB,CAChB,UAAW,CA/Jf,0DAmKI,wBAAyB,CACzB,gBAAiB,CApKrB,2CAwKI,WAAY,CAxKhB,+DA+KM,wCAAyC,CACzC,iBAAkB,CAhLxB,sEAoLM,aAAc,CACd,aAAc,CACd,yBAA0B,CAC1B,eAAgB,CAChB,iBAAkB,CAClB,iBAAkB,CAClB,sBAAuB,CACvB,kBAAmB,CACnB,WAAY,CA5LlB,oEAgMM,aAAc,CACd,cAAe,CACf,gBAAiB,CAlMvB,qEAsMM,eAAgB,CAChB,eAAgB,CAChB,oBAAqB,CAxM3B,oEA4MM,QAAS,CA5Mf,oEAgNM,qBAAsB,CACtB,oBAAqB,CACrB,4BAA6B,CAlNnC,uIAsNM,yBAA0B,CAtNhC,iGA0NM,2DAA4D,CAC5D,cAAe,CA3NrB,0LAsPY,qBAAsB","file":"wpglobus-admin-tabs.css"}
|
|
includes/css/wpglobus-admin.css
CHANGED
@@ -1,3 +1 @@
|
|
1 |
-
#adminmenu li.toplevel_page_wpglobus_options div.wp-menu-image:before{content:"\f319"}.wpglobus-menu-item-box{background-color:#e0e0e0;padding-bottom:20px}.wpglobus-excerpt{width:98%;height:4em}.widefat thead tr th.column-wpglobus_languages{width:7%}.wpglobus-switch .wpglobus-icon-globe:before{display:inline-block;-webkit-font-smoothing:antialiased;font-family:dashicons;font-weight:400;font-style:normal;text-decoration:inherit;content:"\f319";font-size:20px;vertical-align:text-bottom;opacity
|
2 |
-
|
3 |
-
/*# sourceMappingURL=wpglobus-admin.css.map */
|
1 |
+
#adminmenu li.toplevel_page_wpglobus_options div.wp-menu-image:before{content:"\f319"}.wpglobus-menu-item-box{background-color:#e0e0e0;padding-bottom:20px}.wpglobus-excerpt{width:98%;height:4em}.widefat thead tr th.column-wpglobus_languages{width:7%}.wpglobus-switch .wpglobus-icon-globe:before{display:inline-block;-webkit-font-smoothing:antialiased;font-family:dashicons;font-weight:400;font-style:normal;text-decoration:inherit;content:"\f319";font-size:20px;vertical-align:text-bottom;opacity:.6}ul.wpglobus-checkmarks li:before{display:inline-block;-webkit-font-smoothing:antialiased;font-family:dashicons;font-weight:400;font-style:normal;text-decoration:inherit;content:"\f147";font-size:2em;vertical-align:top;color:#228b22}ul.wpglobus-checkmarks li{text-indent:-1em;margin-left:1.5em}ul.wpglobus-important li:before{display:inline-block;-webkit-font-smoothing:antialiased;font-family:dashicons;font-weight:400;font-style:normal;text-decoration:inherit;content:"\f522";font-size:23px;vertical-align:top;color:darkred}ul.wpglobus-important li{text-indent:-14px;margin-left:24px}.wpglobus-state-error{border:1px solid red !important}.wpglobus-post-status-info{width:100%;border-spacing:0;border:1px solid #e5e5e5;border-top:none;background-color:#f7f7f7;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.04);box-shadow:0 1px 1px rgba(0,0,0,.04);z-index:999}.wpglobus-post-status-info td{font-size:12px}.wpglobus-post-status-info .wpglobus-wp-word-count{display:block;padding:2px 10px}.wpglobus-wp-admin .wpglobus-translatable{border-left:3px solid blue !important}.wpglobus-wp-admin .wpglobus-link-lock-icon{cursor:not-allowed}.wpglobus-wp-admin .wpglobus-link-trash-icon{cursor:not-allowed}.wpglobus-wp-admin .wpglobus-link-lock-icon:before{font-family:dashicons;font-weight:400;font-style:normal;text-decoration:inherit;content:"\f160";font-size:11px}.wpglobus-wp-admin .wpglobus-link-open-icon:before{font-family:dashicons;font-weight:400;font-style:normal;text-decoration:inherit;content:"\f504";font-size:11px}.wpglobus-wp-admin .wpglobus-link-trash-icon:before{font-family:dashicons;font-weight:400;font-style:normal;text-decoration:inherit;content:"\f182";font-size:11px}.wpglobus-wp-admin .wpglobus-spinner{background:url(images/spinner.gif) no-repeat;-webkit-background-size:20px 20px;background-size:20px 20px;display:inline-block;visibility:hidden;float:right;vertical-align:middle;opacity:.7;filter:alpha(opacity=70);width:20px;height:20px;margin:0}.wpglobus-edit-slug-box{line-height:24px;min-height:25px;margin-top:5px;padding:0 10px;color:#666}.wpglobus-edit-slug-box .wpglobus-editable-post-name{background-color:#fffbcc}.wpglobus-edit-slug-box .wpglobus-editable-post-name-full{display:none}.wpglobus-edit-slug-box .wpglobus-editable-post-name input{font-size:13px;height:22px;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;width:20em}.about-wrap.wpglobus-about-wrap .wpglobus-version{color:#e38869;font-size:95%}.about-wrap.wpglobus-about-wrap .wpglobus-motto{font-style:italic}.about-wrap.wpglobus-about-wrap .wpglobus-wp{color:#23769c}.about-wrap.wpglobus-about-wrap h1.wpglobus{font-family:Georgia,serif;font-variant:small-caps;letter-spacing:1.5px}.about-wrap.wpglobus-about-wrap .wpglobus-stars{color:#e38869}.about-wrap.wpglobus-about-wrap .feature-section div{text-align:left}.about-wrap.wpglobus-about-wrap .notice{display:block !important;margin-right:140px}.about-wrap.wpglobus-about-wrap .nav-tab .dashicons,.about-wrap.wpglobus-about-wrap .nav-tab .dashicons-before{vertical-align:middle}.toplevel_page_wpglobus_options #redux-header,.toplevel_page_wpglobus_options .redux-timer{display:none}.toplevel_page_wpglobus_options .el-move::before{display:inline-block;-webkit-font-smoothing:antialiased;font-family:dashicons;font-weight:400;font-style:normal;text-decoration:inherit;content:"\f545";border:1px solid #2866a0;color:#2866a0;background-color:#fff;margin:0 3px 0 3px;line-height:1.2;width:1.5em;text-align:center;cursor:move}.redux-container #redux-intro-text{background-color:#d3e4f4;color:#000}.redux-container #redux-intro-text h1{color:#2866a0;float:left;width:204px;margin:0;padding:0}.redux-container #redux-intro-text .wpg-bnr{width:400px}.redux-container #redux-intro-text .wpg-bnr.wpg-bnr-left{float:left}.redux-container #redux-intro-text .wpg-bnr.wpg-bnr-right{float:right}.redux-container #redux-intro-text .wpg-a-img{float:left;display:block;height:100px;border:1px solid #5999d5;background-color:#fff;margin-right:1em}.redux-container #redux-intro-text .wpg-a-img img{width:100px}.redux-container #redux-intro-text .wpg-text-block{padding-top:.3em}.redux-container #redux-intro-text .wpg-text-block .wpg-title{font-weight:700}.redux-container #redux-intro-text .wpg-text-block .wpg-body{margin:.3em 0}.redux-container #redux-intro-text .wpg-text-block .wpg-footer{font-style:italic}.customize-controls-close.wpglobus-customize-selector:before{content:""}.customize-controls-close.wpglobus-customize-selector .wpglobus-icon-globe:before{color:blue;display:inline-block;font-family:dashicons;content:"\f319";font-size:20px}.wpglobus-customize-translatable-element,.wpglobus-customize-control,.wpglobus-customize-widget-control{border-left:3px solid blue !important}@media screen and (max-width: 640px){.customize-controls-preview-toggle{left:88px}}.yoast_help.yoast-help-button.dashicons{font-family:dashicons !important;font-size:20px !important}.wpglobus-mark{font-weight:700}.wpglobus-mark.wpglobus-warning{background-color:#ff0;color:#000}@media screen and (max-width: 782px){#wpadminbar li#wp-admin-bar-wpglobus-language-select{display:block}#wpadminbar li#wp-admin-bar-wpglobus-language-select .ab-icon{margin-top:-3px}#wpadminbar li#wp-admin-bar-wpglobus-language-select .ab-icon img{height:25px}}
|
|
|
|
includes/css/wpglobus-admin.css.map
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
{"version":3,"sources":["wpglobus-admin.scss"],"names":[],"mappings":"AA0BA,sEAZE,eAAgB,CAcjB,wBAGC,wBAAyB,CACzB,mBAAoB,CACrB,kBAGC,SAAU,CACV,UAAW,CACZ,+CAGC,QAAS,CACV,6CAIC,oBAAqB,CACrB,kCAAmC,CACnC,qBAAsB,CACtB,eAAgB,CAChB,iBAAkB,CAClB,uBAAwB,CArCxB,eAAgB,CA2ChB,cAAe,CACf,0BAA2B,CAC3B,WAAY,CACb,iCAdC,oBAAqB,CACrB,kCAAmC,CACnC,qBAAsB,CACtB,eAAgB,CAChB,iBAAkB,CAClB,uBAAwB,CA7CxB,eAAgB,CA4Dd,aAAc,CACd,kBAAmB,CACnB,iBAAkB,CANtB,0BASI,gBAAiB,CACjB,iBAAkB,CACnB,gCA3BD,oBAAqB,CACrB,kCAAmC,CACnC,qBAAsB,CACtB,eAAgB,CAChB,iBAAkB,CAClB,uBAAwB,CAzCxB,eAAgB,CAsEd,cAAe,CACf,kBAAmB,CACnB,aAAc,CANlB,yBASI,iBAAkB,CAClB,gBAAiB,CAClB,sBAID,gCAAiC,CAClC,2BAGC,UAAW,CACX,gBAAiB,CACjB,wBAAyB,CACzB,eAAgB,CAChB,wBAAyB,CAEzB,qCAAyC,CACzC,WAAY,CARd,8BAUI,cAAe,CAVnB,mDAaI,aAAc,CACd,gBAAiB,CAClB,0CAKC,qCAAsC,CAF1C,4CAKI,kBAAmB,CALvB,6CAQI,kBAAmB,CARvB,mDAWI,qBAAsB,CACtB,eAAgB,CAChB,iBAAkB,CAClB,uBAAwB,CACxB,eAAgB,CAChB,cAAe,CAhBnB,mDAmBI,qBAAsB,CACtB,eAAgB,CAChB,iBAAkB,CAClB,uBAAwB,CACxB,eAAgB,CAChB,cAAe,CAxBnB,oDA2BI,qBAAsB,CACtB,eAAgB,CAChB,iBAAkB,CAClB,uBAAwB,CACxB,eAAgB,CAChB,cAAe,CAhCnB,qCAmCI,4CAA6C,CAE7C,yBAA0B,CAC1B,oBAAqB,CACrB,iBAAkB,CAClB,WAAY,CACZ,qBAAsB,CACtB,WAAY,CACZ,wBAAyB,CACzB,UAAW,CACX,WAAY,CACZ,QAAS,CACV,wBAMD,gBAAiB,CACjB,eAAgB,CAChB,cAAe,CACf,cAAe,CACf,UAAW,CALb,qDAOI,wBAAyB,CAP7B,0DAUI,YAAa,CAVjB,2DAcI,cAAe,CACf,WAAY,CACZ,eAAgB,CAChB,aAAc,CACd,cAAe,CACf,YAAa,CACb,UAAW,CACZ,kDAUC,aAN+B,CAO/B,aAAc,CAHlB,gDAOI,iBAAkB,CAPtB,6CAWI,aAd4B,CAGhC,4CAeI,0BAA2B,CAC3B,uBAAwB,CACxB,oBAAqB,CAjBzB,gDAqBI,aAzB+B,CAInC,qDA4BM,eAAgB,CA5BtB,wCAkCI,wBAAyB,CACzB,kBAAmB,CAnCvB,+GAyCM,qBAAsB,CACvB,2FAOD,YAAa,CACd,iDArMD,oBAAqB,CACrB,kCAAmC,CACnC,qBAAsB,CACtB,eAAgB,CAChB,iBAAkB,CAClB,uBAAwB,CA5BxB,eAAgB,CAqOd,wBALkC,CAMlC,aANkC,CAOlC,sBAAuB,CACvB,kBAAmB,CACnB,eAAgB,CAChB,WAAY,CACZ,iBAAkB,CAClB,WAAY,CACb,mCAOD,wBAFqB,CAGrB,WAAY,CAFd,sCAII,aAAkC,CAClC,UAAW,CACX,WAAY,CACZ,QAAS,CACT,SAAU,CARd,4CAWI,WAAY,CAXhB,yDAaM,UAAW,CAbjB,0DAgBM,WAAY,CAhBlB,8CAoBI,UAAW,CACX,aAAc,CACd,YAAa,CACb,wBAA6C,CAC7C,sBAAuB,CACvB,gBAAiB,CAzBrB,kDA2BM,WAAY,CA3BlB,mDA+BI,iBAAkB,CA/BtB,8DAiCM,eAAgB,CAjCtB,6DAoCM,cAAe,CApCrB,+DAuCM,iBAAkB,CACnB,6DAOH,UAAW,CACZ,kFAGC,UAAW,CACX,oBAAqB,CACrB,qBAAsB,CACtB,eAAgB,CAChB,cAAe,CAChB,wGAGC,qCAAsC,CACvC,qCAGC,mCACE,SAAU,CACX,CAKH,wCACE,gCAAiC,CACjC,yBAA0B,CAC3B,eAIC,eAAgB,CADlB,gCAGI,uBAAwB,CACxB,WAAY,CACb,qCAKD,qDACE,aAAc,CADhB,8DAGI,eAAgB,CAHpB,kEAKM,WAAY,CACb","file":"wpglobus-admin.css"}
|
|
includes/css/wpglobus-admin.scss
CHANGED
@@ -1,3 +1,5 @@
|
|
|
|
|
|
1 |
/**
|
2 |
* Admin styles
|
3 |
* @package WPGlobus
|
@@ -68,6 +70,7 @@ ul.wpglobus-checkmarks {
|
|
68 |
vertical-align: top;
|
69 |
color: forestgreen;
|
70 |
}
|
|
|
71 |
li {
|
72 |
text-indent: -1em;
|
73 |
margin-left: 1.5em;
|
@@ -82,6 +85,7 @@ ul.wpglobus-important {
|
|
82 |
vertical-align: top;
|
83 |
color: darkred;
|
84 |
}
|
|
|
85 |
li {
|
86 |
text-indent: -14px;
|
87 |
margin-left: 24px;
|
@@ -101,9 +105,11 @@ ul.wpglobus-important {
|
|
101 |
-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
|
102 |
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
|
103 |
z-index: 999;
|
|
|
104 |
td {
|
105 |
font-size: 12px;
|
106 |
}
|
|
|
107 |
.wpglobus-wp-word-count {
|
108 |
display: block;
|
109 |
padding: 2px 10px;
|
@@ -114,12 +120,15 @@ ul.wpglobus-important {
|
|
114 |
.wpglobus-translatable {
|
115 |
border-left: 3px solid blue !important;
|
116 |
}
|
|
|
117 |
.wpglobus-link-lock-icon {
|
118 |
cursor: not-allowed;
|
119 |
}
|
|
|
120 |
.wpglobus-link-trash-icon {
|
121 |
cursor: not-allowed;
|
122 |
}
|
|
|
123 |
.wpglobus-link-lock-icon:before {
|
124 |
font-family: dashicons;
|
125 |
font-weight: 400;
|
@@ -128,6 +137,7 @@ ul.wpglobus-important {
|
|
128 |
content: "\f160";
|
129 |
font-size: 11px;
|
130 |
}
|
|
|
131 |
.wpglobus-link-open-icon:before {
|
132 |
font-family: dashicons;
|
133 |
font-weight: 400;
|
@@ -136,6 +146,7 @@ ul.wpglobus-important {
|
|
136 |
content: "\f504";
|
137 |
font-size: 11px;
|
138 |
}
|
|
|
139 |
.wpglobus-link-trash-icon:before {
|
140 |
font-family: dashicons;
|
141 |
font-weight: 400;
|
@@ -144,6 +155,7 @@ ul.wpglobus-important {
|
|
144 |
content: "\f182";
|
145 |
font-size: 11px;
|
146 |
}
|
|
|
147 |
.wpglobus-spinner {
|
148 |
background: url(images/spinner.gif) no-repeat;
|
149 |
-webkit-background-size: 20px 20px;
|
@@ -168,12 +180,15 @@ ul.wpglobus-important {
|
|
168 |
margin-top: 5px;
|
169 |
padding: 0 10px;
|
170 |
color: #666;
|
|
|
171 |
.wpglobus-editable-post-name {
|
172 |
background-color: #fffbcc;
|
173 |
}
|
|
|
174 |
.wpglobus-editable-post-name-full {
|
175 |
display: none;
|
176 |
}
|
|
|
177 |
/* @see #editable-post-name input */
|
178 |
.wpglobus-editable-post-name input {
|
179 |
font-size: 13px;
|
@@ -267,6 +282,7 @@ $bg-redux-info: #d3e4f4;
|
|
267 |
.redux-container #redux-intro-text {
|
268 |
background-color: $bg-redux-info;
|
269 |
color: black;
|
|
|
270 |
h1 {
|
271 |
color: darken($bg-redux-info, 50%);
|
272 |
float: left;
|
@@ -274,15 +290,19 @@ $bg-redux-info: #d3e4f4;
|
|
274 |
margin: 0;
|
275 |
padding: 0;
|
276 |
}
|
|
|
277 |
.wpg-bnr {
|
278 |
width: 400px;
|
|
|
279 |
&.wpg-bnr-left {
|
280 |
float: left;
|
281 |
}
|
|
|
282 |
&.wpg-bnr-right {
|
283 |
float: right;
|
284 |
}
|
285 |
}
|
|
|
286 |
.wpg-a-img {
|
287 |
float: left;
|
288 |
display: block;
|
@@ -290,18 +310,23 @@ $bg-redux-info: #d3e4f4;
|
|
290 |
border: 1px solid darken($bg-redux-info, 30%);
|
291 |
background-color: white;
|
292 |
margin-right: 1em;
|
|
|
293 |
img {
|
294 |
width: 100px;
|
295 |
}
|
296 |
}
|
|
|
297 |
.wpg-text-block {
|
298 |
padding-top: 0.3em;
|
|
|
299 |
.wpg-title {
|
300 |
font-weight: 700;
|
301 |
}
|
|
|
302 |
.wpg-body {
|
303 |
margin: 0.3em 0;
|
304 |
}
|
|
|
305 |
.wpg-footer {
|
306 |
font-style: italic;
|
307 |
}
|
@@ -342,6 +367,7 @@ $bg-redux-info: #d3e4f4;
|
|
342 |
// To highlight texts in admin area.
|
343 |
.wpglobus-mark {
|
344 |
font-weight: 700;
|
|
|
345 |
&.wpglobus-warning {
|
346 |
background-color: yellow;
|
347 |
color: black;
|
@@ -352,8 +378,10 @@ $bg-redux-info: #d3e4f4;
|
|
352 |
@media screen and (max-width: 782px) {
|
353 |
#wpadminbar li#wp-admin-bar-wpglobus-language-select {
|
354 |
display: block;
|
|
|
355 |
.ab-icon {
|
356 |
margin-top: -3px;
|
|
|
357 |
img {
|
358 |
height: 25px;
|
359 |
}
|
@@ -361,4 +389,3 @@ $bg-redux-info: #d3e4f4;
|
|
361 |
}
|
362 |
}
|
363 |
|
364 |
-
// --- EOF
|
1 |
+
@charset "UTF-8";
|
2 |
+
|
3 |
/**
|
4 |
* Admin styles
|
5 |
* @package WPGlobus
|
70 |
vertical-align: top;
|
71 |
color: forestgreen;
|
72 |
}
|
73 |
+
|
74 |
li {
|
75 |
text-indent: -1em;
|
76 |
margin-left: 1.5em;
|
85 |
vertical-align: top;
|
86 |
color: darkred;
|
87 |
}
|
88 |
+
|
89 |
li {
|
90 |
text-indent: -14px;
|
91 |
margin-left: 24px;
|
105 |
-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
|
106 |
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
|
107 |
z-index: 999;
|
108 |
+
|
109 |
td {
|
110 |
font-size: 12px;
|
111 |
}
|
112 |
+
|
113 |
.wpglobus-wp-word-count {
|
114 |
display: block;
|
115 |
padding: 2px 10px;
|
120 |
.wpglobus-translatable {
|
121 |
border-left: 3px solid blue !important;
|
122 |
}
|
123 |
+
|
124 |
.wpglobus-link-lock-icon {
|
125 |
cursor: not-allowed;
|
126 |
}
|
127 |
+
|
128 |
.wpglobus-link-trash-icon {
|
129 |
cursor: not-allowed;
|
130 |
}
|
131 |
+
|
132 |
.wpglobus-link-lock-icon:before {
|
133 |
font-family: dashicons;
|
134 |
font-weight: 400;
|
137 |
content: "\f160";
|
138 |
font-size: 11px;
|
139 |
}
|
140 |
+
|
141 |
.wpglobus-link-open-icon:before {
|
142 |
font-family: dashicons;
|
143 |
font-weight: 400;
|
146 |
content: "\f504";
|
147 |
font-size: 11px;
|
148 |
}
|
149 |
+
|
150 |
.wpglobus-link-trash-icon:before {
|
151 |
font-family: dashicons;
|
152 |
font-weight: 400;
|
155 |
content: "\f182";
|
156 |
font-size: 11px;
|
157 |
}
|
158 |
+
|
159 |
.wpglobus-spinner {
|
160 |
background: url(images/spinner.gif) no-repeat;
|
161 |
-webkit-background-size: 20px 20px;
|
180 |
margin-top: 5px;
|
181 |
padding: 0 10px;
|
182 |
color: #666;
|
183 |
+
|
184 |
.wpglobus-editable-post-name {
|
185 |
background-color: #fffbcc;
|
186 |
}
|
187 |
+
|
188 |
.wpglobus-editable-post-name-full {
|
189 |
display: none;
|
190 |
}
|
191 |
+
|
192 |
/* @see #editable-post-name input */
|
193 |
.wpglobus-editable-post-name input {
|
194 |
font-size: 13px;
|
282 |
.redux-container #redux-intro-text {
|
283 |
background-color: $bg-redux-info;
|
284 |
color: black;
|
285 |
+
|
286 |
h1 {
|
287 |
color: darken($bg-redux-info, 50%);
|
288 |
float: left;
|
290 |
margin: 0;
|
291 |
padding: 0;
|
292 |
}
|
293 |
+
|
294 |
.wpg-bnr {
|
295 |
width: 400px;
|
296 |
+
|
297 |
&.wpg-bnr-left {
|
298 |
float: left;
|
299 |
}
|
300 |
+
|
301 |
&.wpg-bnr-right {
|
302 |
float: right;
|
303 |
}
|
304 |
}
|
305 |
+
|
306 |
.wpg-a-img {
|
307 |
float: left;
|
308 |
display: block;
|
310 |
border: 1px solid darken($bg-redux-info, 30%);
|
311 |
background-color: white;
|
312 |
margin-right: 1em;
|
313 |
+
|
314 |
img {
|
315 |
width: 100px;
|
316 |
}
|
317 |
}
|
318 |
+
|
319 |
.wpg-text-block {
|
320 |
padding-top: 0.3em;
|
321 |
+
|
322 |
.wpg-title {
|
323 |
font-weight: 700;
|
324 |
}
|
325 |
+
|
326 |
.wpg-body {
|
327 |
margin: 0.3em 0;
|
328 |
}
|
329 |
+
|
330 |
.wpg-footer {
|
331 |
font-style: italic;
|
332 |
}
|
367 |
// To highlight texts in admin area.
|
368 |
.wpglobus-mark {
|
369 |
font-weight: 700;
|
370 |
+
|
371 |
&.wpglobus-warning {
|
372 |
background-color: yellow;
|
373 |
color: black;
|
378 |
@media screen and (max-width: 782px) {
|
379 |
#wpadminbar li#wp-admin-bar-wpglobus-language-select {
|
380 |
display: block;
|
381 |
+
|
382 |
.ab-icon {
|
383 |
margin-top: -3px;
|
384 |
+
|
385 |
img {
|
386 |
height: 25px;
|
387 |
}
|
389 |
}
|
390 |
}
|
391 |
|
|
includes/css/wpglobus-dialog-ui.css
CHANGED
@@ -1,3 +1 @@
|
|
1 |
-
.wpglobus-wp-admin .wpglobus-icon-globe:before{color
|
2 |
-
|
3 |
-
/*# sourceMappingURL=wpglobus-dialog-ui.css.map */
|
1 |
+
.wpglobus-wp-admin .wpglobus-icon-globe:before{color:blue;display:inline-block;font-family:dashicons;content:"\f319";font-size:20px}.wpglobus-wp-admin .wpglobus_dialog_icon{margin-top:10px;cursor:pointer}.wpglobus-wp-admin.widgets-php .wpglobus_dialog_icon{margin-top:0;float:right;cursor:pointer}.wpglobus-wp-admin .wpglobus_dialog_settings{margin-top:0}.wpglobus-wp-admin .wpglobus_dialog_settings:before{color:blue;display:inline-block;font-family:dashicons;content:"\f107";font-size:20px}.wpglobus-wp-admin .wpglobus_dialog_start:before{color:blue;display:inline-block;font-family:dashicons;content:"\f319";font-size:20px}.wpglobus-wp-admin .wpglobus_dialog_start_hidden{visibility:hidden;width:0}.wpglobus-wp-admin .wpglobus_dialog_error:before{color:red}.wpglobus-wp-admin .wpglobus-dialog-tabs-list{min-height:3em}.wpglobus-wp-admin .wpglobus-dialog-tabs li a,.wpglobus-wp-admin .wpglobus-dialog-tabs ul li{float:left;margin:0}.wpglobus-wp-admin .wpglobus-dialog-tabs li.ui-state-default{border:0;background:transparent}.wpglobus-wp-admin .wpglobus-dialog-tabs ul li a:hover{color:#666}.wpglobus-wp-admin .wpglobus-dialog-tabs ul li.ui-state-default a{display:block;color:#999;background:#f9f9f9;background:-moz-linear-gradient(left, #f9f9f9 0%, #ececec 100%);background:-webkit-gradient(linear, left top, right top, color-stop(0%, #f9f9f9), color-stop(100%, #ececec));background:-webkit-linear-gradient(left, #f9f9f9 0%, #ececec 100%);background:-o-linear-gradient(left, #f9f9f9 0%, #ececec 100%);background:-ms-linear-gradient(left, #f9f9f9 0%, #ececec 100%);background:linear-gradient(to right, #f9f9f9 0%, #ececec 100%);border:1px solid #ddd;border-bottom:0;font-weight:normal;height:2em;line-height:2em;margin-right:5px;padding:0 10px;text-decoration:none;text-shadow:#fff 0 1px 1px;-moz-border-radius-topleft:3px;-webkit-border-top-left-radius:3px;border-top-left-radius:3px;-moz-border-radius-topright:3px;-webkit-border-top-right-radius:3px;border-top-right-radius:3px}.wpglobus-wp-admin .wpglobus-dialog-tabs ul li.ui-state-active a{background:#fff;border:1px solid #ccc;border-bottom-color:#fff;color:#464646;margin-bottom:-1px;font-weight:normal}.wpglobus-wp-admin .wpglobus-dialog{z-index:1000000}.wpglobus-wp-admin .wpglobus-dialog .ui-dialog-title:before{color:blue;display:inline-block;font-family:dashicons;content:"\f319";font-size:20px;margin-right:.5em;vertical-align:bottom}.wpglobus-wp-admin .wpglobus-dialog .ui-dialog-title{font-size:20px}.wpglobus-wp-admin .wpglobus-dialog .ui-dialog-buttonpane .ui-dialog-buttonset{float:right;margin-bottom:10px}.wpglobus-wp-admin .wpglobus-dialog .ui-dialog-buttonpane button{cursor:pointer}.wpglobus-wp-admin .wpglobus-dialog .ui-dialog-titlebar{cursor:move}.wpglobus-wp-admin .wpglobus-dialog .wpglobus-dialog-wrapper.ui-dialog-content.ui-widget-content{position:relative;border:0;padding:.5em 1em;background:none;overflow:auto}.wpglobus-wp-admin .wpglobus-dialog .ui-tabs .ui-tabs-panel{border-width:0;padding:0;background:transparent}.wpglobus-wp-admin .wpglobus-dialog .ui-tabs .ui-tabs-nav{margin:0;padding:0}.wpglobus-wp-admin .wpglobus-dialog .ui-corner-all{border-radius:0}.wpglobus-wp-admin .wpglobus-dialog .ui-widget-header{border:none;background:transparent;color:inherit;font-weight:normal}.wpglobus-wp-admin .wpglobus-dialog .ui-widget-content{border:none;background:transparent;color:inherit}.wpglobus-wp-admin .wpglobus-dialog .ui-widget{font-family:inherit;font-size:inherit}.wpglobus-wp-admin .wpglobus-dialog .ui-widget textarea{font-family:inherit;font-size:inherit}.wpglobus-wp-admin .wpglobus-dialog .ui-tabs{padding:0}.wpglobus-wp-admin .wpglobus-dialog .wpglobus-button-cancel,.wpglobus-wp-admin .wpglobus-dialog .wpglobus-button-save{border-radius:3px;padding:.5em 1em;border:none;margin-right:1em}.wpglobus-wp-admin .wpglobus-dialog .wpglobus-button-save{color:#fff;background:#2ea2cc}.wpglobus-wp-admin .wpglobus-dialog .wpglobus-button-cancel{color:#000;background:#eee}.wpglobus-wp-admin .wpglobus-dialog .ui-button-text-only .ui-button-text{padding:0}.wpglobus-wp-admin .ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.wpglobus-wp-admin .ui-widget-overlay{background:#aaa url("images/ui-bg_flat40x100.png") 50% 50% repeat-x;opacity:.3}.wpglobus-wp-admin .ui-widget-shadow{margin:-8px 0 0 -8px;padding:8px;opacity:.3;border-radius:8px}.wpglobus-wp-admin .ui-dialog.wpglobus-dialog{overflow:hidden;position:absolute;top:0;left:0;padding:.2em;outline:0;background-color:#fff}.wpglobus-wp-admin .ui-dialog.wpglobus-dialog .ui-dialog-titlebar{padding:.4em 1em;position:relative;height:25px !important;margin-bottom:0 !important;background-color:#e1e1e1 !important}.wpglobus-wp-admin .ui-dialog.wpglobus-dialog .ui-dialog-titlebar-close{position:absolute;right:.3em;top:50%;width:20px;margin:-10px 0 0 0;padding:1px;height:20px;display:none}.wpglobus-wp-admin .ui-dialog.wpglobus-dialog .ui-dialog-content textarea{width:100%;min-height:8em !important;margin-bottom:1em}.wpglobus-wp-admin .ui-dialog.wpglobus-dialog .ui-resizable-se{width:12px;height:12px;right:-5px;bottom:-5px;background-position:16px 16px}
|
|
|
|
includes/css/wpglobus-dialog-ui.css.map
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
{"version":3,"sources":["wpglobus-dialog-ui.scss"],"names":[],"mappings":"AAKA,+CAGI,UAAW,CACX,oBAAqB,CACrB,qBAAsB,CACtB,eAAgB,CAChB,cAAe,CAPnB,yCAWI,eAAgB,CAChB,cAAe,CAZnB,qDAeI,YAAa,CACb,WAAY,CACZ,cAAe,CAjBnB,6CAoBI,YAAa,CApBjB,oDAuBI,UAAW,CACX,oBAAqB,CACrB,qBAAsB,CACtB,eAAgB,CAChB,cAAe,CA3BnB,iDA8BI,UAAW,CACX,oBAAqB,CACrB,qBAAsB,CACtB,eAAgB,CAChB,cAAe,CAlCnB,iDAqCI,iBAAkB,CAClB,OAAQ,CAtCZ,iDAyCI,UAAW,CAzCf,8CA4CI,cAAe,CA5CnB,6FAkDM,UAAW,CACX,QAAS,CAnDf,6DAuDM,QAAS,CACT,sBAAuB,CAxD7B,uDA4DM,UAAW,CA5DjB,kEAgEM,aAAc,CACd,UAAW,CAEX,kBAAmB,CAMnB,8DAA+D,CAE/D,qBAAsB,CACtB,eAAgB,CAChB,kBAAmB,CACnB,UAAW,CACX,eAAgB,CAChB,gBAAiB,CACjB,cAAe,CACf,oBAAqB,CACrB,0BAA2B,CAG3B,0BAA2B,CAG3B,2BAA4B,CAzFlC,iEA6FM,eAAgB,CAChB,qBAAsB,CACtB,wBAAyB,CACzB,aAAc,CACd,kBAAmB,CACnB,kBAAmB,CAlGzB,oCAyGI,eAAgB,CAzGpB,4DA4GM,UAAW,CACX,oBAAqB,CACrB,qBAAsB,CACtB,eAAgB,CAChB,cAAe,CACf,kBAAmB,CACnB,qBAAsB,CAlH5B,qDAqHM,cAAe,CArHrB,+EAwHM,WAAY,CACZ,kBAAmB,CAzHzB,iEA6HM,cAAe,CA7HrB,wDAiIM,WAAY,CAjIlB,iGAqIM,iBAAkB,CAClB,QAAS,CACT,gBAAiB,CACjB,eAAgB,CAChB,aAAc,CAzIpB,4DA6IM,cAAe,CACf,SAAU,CACV,sBAAuB,CA/I7B,0DAmJM,QAAS,CACT,SAAU,CApJhB,mDAwJM,eAAgB,CAxJtB,sDA4JM,WAAY,CACZ,sBAAuB,CACvB,aAAc,CACd,kBAAmB,CA/JzB,uDAmKM,WAAY,CACZ,sBAAuB,CACvB,aAAc,CArKpB,+CAyKM,mBAAoB,CACpB,iBAAkB,CA1KxB,wDA4KQ,mBAAoB,CACpB,iBAAkB,CA7K1B,6CAkLM,SAAU,CAlLhB,sHA0LM,iBAAkB,CAClB,gBAAiB,CACjB,WAAY,CACZ,gBAAiB,CA7LvB,0DAiMM,aAAc,CACd,kBAAmB,CAlMzB,4DAsMM,UAAW,CACX,eAAgB,CAvMtB,yEA2MM,SAAU,CA3MhB,sCAkNI,cAAe,CACf,KAAM,CACN,MAAO,CACP,UAAW,CACX,WAAY,CAtNhB,sCAyNI,mEAAuE,CACvE,UAAW,CA1Nf,qCA6NI,oBAAqB,CACrB,WAAY,CACZ,UAAW,CACX,iBAAkB,CAhOtB,8CAoOI,eAAgB,CAChB,iBAAkB,CAClB,KAAM,CACN,MAAO,CACP,YAAa,CACb,SAAU,CACV,qBAAsB,CA1O1B,kEA6OM,gBAAiB,CACjB,iBAAkB,CAClB,sBAAuB,CACvB,0BAA2B,CAC3B,mCAAoC,CAjP1C,wEAqPM,iBAAkB,CAClB,UAAW,CACX,OAAQ,CACR,UAAW,CACX,kBAAmB,CACnB,WAAY,CACZ,WAAY,CACZ,YAAa,CA5PnB,0EA+PM,UAAW,CACX,yBAA0B,CAC1B,iBAAkB,CAjQxB,+DAoQM,UAAW,CACX,WAAY,CACZ,UAAW,CACX,WAAY,CACZ,6BAA8B","file":"wpglobus-dialog-ui.css"}
|
|
includes/css/wpglobus-options.css
CHANGED
@@ -1,3 +1 @@
|
|
1 |
-
@supports
|
2 |
-
|
3 |
-
/*# sourceMappingURL=wpglobus-options.css.map */
|
1 |
+
@supports(display: grid){#wpglobus-options-old-browser-warning{display:none}}#wpglobus-options-intro-text{display:grid;grid-template-columns:100%;place-items:center;grid-gap:0;background-color:#d3e4f4}@media screen and (min-width: 699px){#wpglobus-options-intro-text{grid-template-columns:20% 40% 40%}}#wpglobus-options-intro-text .grid__item{padding:initial;max-width:none}.wpg-bnr{display:grid;grid-template-columns:100%;place-items:center}@media screen and (min-width: 1499px){.wpg-bnr{grid-template-columns:30% 70%}}.wpg-bnr .wpg-bnr__item{max-width:none}#wpglobus-options-intro-text .wpg-bnr-title{padding:20px 0}.wpg-bnr .wpg-img-block{height:150px;width:150px;background-color:#fff}.wpg-bnr .wpg-text-block{width:40%;padding:10px}@media screen and (min-width: 699px){.wpg-bnr .wpg-text-block{width:95%}}.wpglobus-options-wrap{display:grid;grid-template-columns:15% 85%;grid-gap:0;background-color:#f3f3f3}@media screen and (max-width: 750px){.wpglobus-options-wrap{grid-template-columns:7% 93%}}.wpglobus-options-tab{display:none}.wpglobus-options-sidebar li a{display:block;padding:10px 4px 10px 14px;background:transparent;border-width:1px 0;border-style:solid;border-bottom-color:#e7e7e7;border-top-color:#f9f9f9;opacity:.7;color:#555;font-weight:bold;text-decoration:none;-webkit-transition:none;transition:none}@media screen and (max-width: 750px){.wpglobus-options-sidebar li a{padding:10px 0;text-align:center}}.wpglobus-options-sidebar li a:hover{color:blue !important}.wpglobus-options-sidebar .wpglobus-tab-link-active{background-color:#fcfcfc}@media screen and (max-width: 750px){.wpglobus-options-sidebar .group_title{display:none}}.wpglobus-options-main{padding:0 10px 10px;background-color:#fcfcfc}.wpglobus-options-main h2{padding-left:20px}.wpglobus-options-main #wpglobus_add_language.button-primary{margin:15px 15px 0}.wpglobus-options-main .tablenav .one-page .displaying-num{margin-right:15px}.wpglobus-options-main .wpglobus-options-field{border:1px solid #a9b6c2;border-radius:0;margin:10px 0}.wpglobus-options-main .wpglobus-options-field .title{margin:0;padding:1em 2em 1em 0;font-size:14px;font-weight:600}.wpglobus-options-main .wpglobus-options-field .grid__item .title{padding:1em 1em .5em 1.5em}.wpglobus-options-main .wpglobus-options-field .subtitle{padding:0 2em 0 1.5em;font-size:13px;font-weight:400}.wpglobus-options-main .wpglobus-options-field .description{font-size:13px;font-style:normal}.wpglobus-options-main .wpglobus-options-field-wpglobus_info{min-height:20px;padding:8px 19px;color:#000;background-color:#d3e4f4}.wpglobus-options-main .wpglobus-options-field-wpglobus_info.info{background-color:#d3e4f4;border-color:#a9b6c2}.wpglobus-options-main .wpglobus-options-field-wpglobus_info.normal{background-color:#eee;border-color:#ccc}.wpglobus-options-main .wpglobus-options-field-wpglobus_sortable{display:grid;grid-template-columns:30% 70%;align-items:center;grid-gap:0;background-color:#d3e4f4}.wpglobus-options-main .wpglobus-options-field-wpglobus_sortable .dashicons-move{cursor:move}.wpglobus-options-main .wpglobus-options-field-wpglobus_sortable .ui-state-highlight{height:2em;line-height:1.5em;background-color:#f1f1f1;width:200px;border-radius:5px}.wpglobus-options-main .wpglobus-options-field-wpglobus_sortable .grid__item{padding:initial;max-width:none}.wpglobus-options-main .wpglobus-options-field-wpglobus_select{display:grid;grid-template-columns:30% 70%;align-items:center;grid-gap:0;background-color:#d3e4f4;padding:20px 0 20px}.wpglobus-options-main .wpglobus-options-field-wpglobus_select .grid__item{padding:initial;max-width:none}.wpglobus-options-main .wpglobus-options-field-wpglobus_select .subtitle{margin:1em 0}.wpglobus-options-main .wpglobus-options-field-wpglobus_ace_editor{display:grid;grid-template-columns:20% 80%;align-items:center;grid-gap:0;background-color:#d3e4f4;padding:20px 0 20px}.wpglobus-options-main .wpglobus-options-field-wpglobus_ace_editor .grid__item{padding:initial;max-width:none}.wpglobus-options-main .wpglobus-options-field-wpglobus_ace_editor .subtitle{margin:1em 0}.wpglobus-options-main .wpglobus-options-field-wpglobus_ace_editor .ace_editor{margin:0 1em 0 0}.wpglobus-options-main .wpglobus-options-field-wpglobus_checkbox{display:grid;grid-template-columns:30% 70%;align-items:center;grid-gap:0;background-color:#d3e4f4;padding:20px 0 20px}.wpglobus-options-main .wpglobus-options-field-wpglobus_checkbox .grid__item{padding:initial;max-width:none}.wpglobus-options-main .wpglobus-options-field-wpglobus_checkbox .subtitle{margin:1em 0}.wpglobus-options-main .wpglobus-options-field-wpglobus_checkbox .checkbox{margin:0 1em 0 0}.wpglobus-options-menu li i,.wpglobus-options-menu li .group_title{color:#1445b8}#wpglobus-tab-link-helpdesk i,#wpglobus-tab-link-helpdesk .group_title{color:#178217}#wpglobus-tab-link-helpdesk .group_title{border-bottom:1px dotted}#wpglobus-tab-link-uninstall i,#wpglobus-tab-link-uninstall .group_title{color:#79867d}#wpglobus-tab-link-recommendations i{color:maroon;animation:filter-animation-blink 8s infinite}@keyframes filter-animation-blink{0%{filter:opacity(0.1)}50%{filter:opacity(1)}100%{filter:opacity(0.1)}}.wpglobus-recommend-container{display:grid;grid-template-columns:20% 80%;grid-gap:2em}.wpglobus-recommend-container .grid__item{padding:initial;max-width:none}.wpglobus-recommend-container .wpglobus-recommend-logo img{background-color:#fff;width:100%;max-width:200px;border:1px solid #a9b6c2}.wpglobus-recommend-container h3{margin-top:0;color:#0070a8}@media screen and (max-width: 500px){.wpglobus-recommend-container{grid-template-columns:100%;place-items:center;grid-gap:0}}.wpglobus-options-main #section-tab-customizer ul{margin-left:3em;list-style:initial}#wpglobus-options-compatibility{border-collapse:collapse}#wpglobus-options-compatibility th,#wpglobus-options-compatibility td{border:1px solid #000;padding:3px}
|
|
|
|
includes/css/wpglobus-options.css.map
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
{"version":3,"sources":["wpglobus-options.scss"],"names":[],"mappings":"AAAwB,0BACtB,sCACE,YAAa,CACd,CAMH,6BACE,YAAa,CACb,0BAA2B,CAC3B,kBAAmB,CACnB,UAAW,CACX,wBAAyB,CAC1B,qCAGC,6BACE,iCAAkC,CACnC,CAGH,yCACE,eAAgB,CAChB,cAAe,CAChB,SAIC,YAAa,CACb,0BAA2B,CAC3B,kBAAmB,CACpB,sCAGC,SACE,6BAA8B,CAC/B,CAGH,wBACE,cAAe,CAChB,4CAGC,cAAe,CAChB,wBAGC,YAAa,CACb,WAAY,CACZ,qBAAsB,CACvB,yBAGC,SAAU,CACV,YAAa,CACd,qCAGC,yBACE,SAAU,CACX,CAMH,uBACE,YAAa,CACb,6BAA8B,CAC9B,UAAW,CACX,wBAAoC,CACrC,qCAGC,uBACE,4BAA6B,CAC9B,CAIH,sBACE,YAAa,CACd,+BAMC,aAAc,CACd,0BAA2B,CAC3B,sBAAuB,CACvB,kBAAmB,CACnB,kBAAmB,CACnB,2BAA4B,CAC5B,wBAAyB,CACzB,WAAY,CACZ,UAAW,CACX,gBAAiB,CACjB,oBAAqB,CAErB,eAAgB,CACjB,qCAGC,+BACE,cAAe,CACf,iBAAkB,CACnB,CAGH,qCACE,qBAAsB,CACvB,oDAGC,wBAAoC,CACrC,qCAGC,uCACE,YAAa,CACd,CAIH,uBACE,mBAAoB,CACpB,wBAAoC,CACrC,0BAGC,iBAAkB,CACnB,6DAIC,kBAAmB,CACpB,2DAGC,iBAAkB,CACnB,+CAIC,wBAAyB,CACzB,eAAgB,CAChB,aAAc,CACf,sDAGC,QAAS,CACT,qBAAsB,CACtB,cAAe,CACf,eAAgB,CACjB,kEAGC,2BAA4B,CAC7B,yDAGC,qBAAsB,CACtB,cAAe,CACf,eAAgB,CACjB,4DAGC,cAAe,CACf,iBAAkB,CACnB,6DAIC,eAAgB,CAChB,gBAAiB,CACjB,UAAW,CACX,wBAAyB,CAE1B,kEAGC,wBAAyB,CACzB,oBAAqB,CACtB,oEAGC,wBAAyB,CACzB,oBAAqB,CACtB,iEAIC,YAAa,CACb,6BAA8B,CAC9B,kBAAmB,CAEnB,UAAW,CACX,wBAAyB,CAC1B,iFAGC,WAAY,CACb,qFAGC,UAAW,CACX,iBAAkB,CAClB,wBAAyB,CACzB,WAAY,CACZ,iBAAkB,CACnB,6EAGC,eAAgB,CAChB,cAAe,CAChB,+DAIC,YAAa,CACb,6BAA8B,CAC9B,kBAAmB,CACnB,UAAW,CACX,wBAAyB,CACzB,mBAAoB,CACrB,2EAGC,eAAgB,CAChB,cAAe,CAChB,yEAGC,YAAa,CACd,mEAIC,YAAa,CACb,6BAA8B,CAC9B,kBAAmB,CACnB,UAAW,CACX,wBAAyB,CACzB,mBAAoB,CACrB,+EAGC,eAAgB,CAChB,cAAe,CAChB,6EAGC,YAAa,CACd,+EAGC,gBAAiB,CAClB,iEAIC,YAAa,CACb,6BAA8B,CAC9B,kBAAmB,CACnB,UAAW,CACX,wBAAyB,CACzB,mBAAoB,CACrB,6EAGC,eAAgB,CAChB,cAAe,CAChB,2EAGC,YAAa,CACd,2EAGC,gBAAiB,CAClB,mEAQC,aAAyB,CAC1B,uEAWC,aAAyB,CAC1B,yCAGC,wBAAyB,CAC1B,yEAeC,aAAwB,CACzB,qCAGC,YAAwB,CACxB,oDAAW,CAAX,4CAA6C,CAC9C,0CAGC,GACE,mBAAmB,CAGrB,IACE,iBAAkB,CAGpB,KACE,mBAAmB,CAAA,CAZtB,kCAGC,GACE,mBAAmB,CAGrB,IACE,iBAAkB,CAGpB,KACE,mBAAmB,CAAA,CAOvB,8BACE,YAAa,CACb,6BAA8B,CAC9B,YAAa,CACd,0CAGC,eAAgB,CAChB,cAAe,CAChB,2DAGC,sBAAuB,CACvB,UAAW,CACX,eAAgB,CAChB,wBAAyB,CAC1B,iCAGC,YAAa,CACb,aAA0B,CAC3B,qCAGC,8BACE,0BAA2B,CAC3B,kBAAmB,CACnB,UAAW,CACZ,CAGH,kDAEI,eAAgB,CAChB,kBAAmB,CACpB,gCAID,wBAAyB,CAC1B,sEAIC,sBAAuB,CACvB,WAAY","file":"wpglobus-options.css"}
|
|
includes/css/wpglobus-special-pages.css
CHANGED
@@ -1,3 +1 @@
|
|
1 |
-
.addons-wrap .products{overflow:hidden}.addons-wrap .products li{float:left;margin:0 1em 1em 0 !important;padding:0;vertical-align:top;width:300px}.addons-wrap .products li a{text-decoration:none;color:inherit;border:1px solid #ddd;display:block;min-height:220px;overflow:hidden;background:#f5f5f5
|
2 |
-
|
3 |
-
/*# sourceMappingURL=wpglobus-special-pages.css.map */
|
1 |
+
.addons-wrap .products{overflow:hidden}.addons-wrap .products li{float:left;margin:0 1em 1em 0 !important;padding:0;vertical-align:top;width:300px}.addons-wrap .products li a{text-decoration:none;color:inherit;border:1px solid #ddd;display:block;min-height:220px;overflow:hidden;background:#f5f5f5;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.2),inset 0 -1px 0 rgba(0,0,0,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.2),inset 0 -1px 0 rgba(0,0,0,.1)}.addons-wrap .products li a img{max-width:258px;max-height:24px;padding:17px 20px;display:block;margin:0;background:#fff;border-right:260px solid #fff}.addons-wrap .products li a img.own-thumb{max-width:300px;max-height:300px;background:#f5f5f5;padding:0}.addons-wrap .products li a img.extension-thumb+h3{display:none}.addons-wrap .products li a .price{display:none}.addons-wrap .products li a h3{margin:0 !important;padding:20px !important;background:#fff}.addons-wrap .products li a p{padding:20px !important;margin:0 !important;border-top:1px solid #f1f1f1}.addons-wrap .products li a:hover,.addons-wrap .products li a:focus{background-color:#fff}
|
|
|
|
includes/css/wpglobus-special-pages.css.map
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
{"version":3,"sources":["wpglobus-special-pages.scss"],"names":[],"mappings":"AACA,uBAEI,eAAgB,CAFpB,0BAIM,UAAW,CACX,6BAA8B,CAC9B,SAAU,CACV,kBAAmB,CACnB,WAAY,CARlB,4BAWQ,oBAAqB,CACrB,aAAc,CACd,qBAAsB,CACtB,aAAc,CACd,gBAAiB,CACjB,eAAgB,CAChB,kBAAmB,CAGnB,6EACgC,CArBxC,gCAwBU,eAAgB,CAChB,eAAgB,CAChB,iBAAkB,CAClB,aAAc,CACd,QAAS,CACT,eAAgB,CAChB,6BAA8B,CA9BxC,0CAiCU,eAAgB,CAChB,gBAAiB,CACjB,kBAAmB,CACnB,SAAU,CApCpB,mDAuCU,YAAa,CAvCvB,mCA0CU,YAAa,CA1CvB,+BA6CU,mBAAoB,CACpB,uBAAwB,CACxB,eAAgB,CA/C1B,8BAkDU,uBAAwB,CACxB,mBAAoB,CACpB,4BAA6B,CApDvC,oEAuDU,qBAAsB","file":"wpglobus-special-pages.css"}
|
|
includes/css/wpglobus.css
CHANGED
@@ -1,3 +1 @@
|
|
1 |
-
.wpglobus_flag{height:12px;width:18px;background-repeat:no-repeat;background-position:center left}.wpglobus_language_name{padding-left:22px}.page_item_wpglobus_menu_switch .children{display:none}.page_item_wpglobus_menu_switch:hover .children{display:block}.menu_item_wpglobus_menu_switch .sub-menu{display:none}.menu_item_wpglobus_menu_switch:hover .sub-menu{display:block}.widget_wpglobus .flags-styled .flag{margin-right
|
2 |
-
|
3 |
-
/*# sourceMappingURL=wpglobus.css.map */
|
1 |
+
.wpglobus_flag{height:12px;width:18px;background-repeat:no-repeat;background-position:center left}.wpglobus_language_name{padding-left:22px}.page_item_wpglobus_menu_switch .children{display:none}.page_item_wpglobus_menu_switch:hover .children{display:block}.menu_item_wpglobus_menu_switch .sub-menu{display:none}.menu_item_wpglobus_menu_switch:hover .sub-menu{display:block}.widget_wpglobus .flags-styled .flag{margin-right:.4em}.widget_wpglobus .list a{display:block}.widget_wpglobus .list a img{display:none}.widget_wpglobus .list a span.name{display:inline-block}.widget_wpglobus .list a span.code{display:inline-block;margin:0 0 0 4px}.widget_wpglobus .list a span.code:before{content:"("}.widget_wpglobus .list a span.code:after{content:")"}.widget_wpglobus .list.flags img{margin:0 4px 0 0;display:inline-block}.widget_wpglobus .select-styled{overflow:hidden}.widget_wpglobus .dropdown-styled{text-align:center;display:inline;list-style:none}.widget_wpglobus .dropdown-styled li{text-align:left;display:inline-block;margin-right:-4px;position:relative;padding:5px 10px;background:#fff;cursor:pointer}.widget_wpglobus .dropdown-styled li:hover{background:#eee;color:#fff}.widget_wpglobus .dropdown-styled li:hover ul{display:block;opacity:1;visibility:visible}.widget_wpglobus .dropdown-styled li ul{padding:0;position:absolute;top:28px;left:-21px;width:150px;display:none;opacity:0;visibility:hidden}.widget_wpglobus .dropdown-styled li ul li{background:#eee;display:block;color:#fff}.widget_wpglobus .dropdown-styled li ul li:hover{background:#ddd}
|
|
|
|
includes/css/wpglobus.css.map
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
{"version":3,"sources":["_wpglobus-flags.scss","_wpglobus-widget.scss"],"names":[],"mappings":"AAKA,eACC,WAAY,CACZ,UAAW,CACX,2BAA4B,CAC5B,+BAAgC,CAChC,wBAGA,iBAAkB,CAClB,0CAKA,YAAa,CACb,gDAGA,aAAc,CACd,0CAKA,YAAa,CACb,gDAGA,aAAc,CACd,qCCtBE,kBAAmB,CALtB,yBAcG,aAAc,CAdjB,6BAgBI,YAAa,CAhBjB,mCAmBI,oBAAqB,CAnBzB,mCAsBI,oBAAqB,CACrB,gBAAiB,CAvBrB,0CAyBK,WAAY,CAzBjB,yCA4BK,WAAY,CA5BjB,iCAqCI,gBAAiB,CACjB,oBAAqB,CAtCzB,gCAqDE,eAAgB,CArDlB,kCAoEE,iBAAkB,CAClB,cAAe,CACf,eAAgB,CAtElB,qCAyEG,eAAgB,CAChB,oBAAqB,CACrB,iBAAkB,CAClB,iBAAkB,CAClB,gBAAiB,CACjB,eAAgB,CAChB,cAAe,CA/ElB,2CAkFI,eAAgB,CAChB,UAAW,CAnFf,8CAsFK,aAAc,CACd,SAAU,CACV,kBAAmB,CAxFxB,wCA6FI,SAAU,CACV,iBAAkB,CAClB,QAAS,CACT,UAAW,CACX,WAAY,CACZ,YAAa,CACb,SAAU,CACV,iBAAkB,CApGtB,2CAuGK,eAAgB,CAChB,aAAc,CACd,UAAW,CAzGhB,iDA4GM,eAAgB","file":"wpglobus.css"}
|
|
includes/js/wpglobus-admin-47.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var WPGlobusCore,WPGlobusDialogApp;!function(i){var d=WPGlobusCore={strpos:function(t,a,e){var o=(t=""+t).indexOf(a,e);return 0<=o&&o},TextFilter:function(t,a,e){if(void 0===t||""===t)return t;var o,n,i=[],l=!1;a=""==a?"en":a,e=void 0===e||""==e?"RETURN_IN_DEFAULT_LANGUAGE":e,i[0]=[],i[0].start=WPGlobusCoreData.locale_tag_start.replace("%s",a),i[0].end=WPGlobusCoreData.locale_tag_end,i[1]=[],i[1].start="\x3c!--:"+a+"--\x3e",i[1].end="\x3c!--:--\x3e",i[2]=[],i[2].start="[:"+a+"]",i[2].end="[:";for(var s=0;s<3;s++)if(!1!==(o=d.strpos(t,i[s].start))){o+=i[s].start.length,t=!1===(n=d.strpos(t,i[s].end,o))?t.substr(o):t.substr(o,n-o),l=!0;break}return l||("RETURN_EMPTY"==e?a==WPGlobusCoreData.default_language&&!/(\{:|\[:|<!--:)[a-z]{2}/.test(t)||(t=""):a==WPGlobusCoreData.default_language?/(\{:|\[:|<!--:)[a-z]{2}/.test(t)&&(t=""):t=d.TextFilter(t,WPGlobusCoreData.default_language)),t},addLocaleMarks:function(t,a){return WPGlobusCoreData.locale_tag_start.replace("%s",a)+t+WPGlobusCoreData.locale_tag_end},getTranslations:function(e){var o,n={};return i.each(WPGlobusCoreData.enabled_languages,function(t,a){o=a==WPGlobusCoreData.default_language?"RETURN_IN_DEFAULT_LANGUAGE":"RETURN_EMPTY",n[a]=d.TextFilter(e,a,o)}),n},getString:function(t,a,e){if(void 0===t)return t;void 0===a&&(a=""),void 0===e&&(e=WPGlobusCoreData.language),(t=d.getTranslations(t))[e]=a;var o="";return i.each(t,function(t,a){""!=a&&t!=WPGlobusCoreData.default_language&&(o+=d.addLocaleMarks(a,t))}),""!=t[WPGlobusCoreData.default_language]&&(o=""==o?t[WPGlobusCoreData.default_language]:d.addLocaleMarks(t[WPGlobusCoreData.default_language],WPGlobusCoreData.default_language)+o),o}}}(jQuery),function(m){var v=WPGlobusDialogApp={option:{listenClass:".wpglobus_dialog_start",settingsClass:".wpglobus_dialog_settings",dialogTabs:"#wpglobus-dialog-tabs",dialogTitle:"",customData:null,callback:function(){},dialogOptions:{title:"",placeholder:"",formFooter:"",beforeOpen:function(){},close:function(){}},dialog:{}},form:void 0,element:void 0,element_by:"id",id:"",clone_id:"",wpglobus_id:"",type:"textarea",source:"",order:{},value:{},request:"core",attrs:{},dialogTitle:"",trClass:"wpglobus-translatable",startButton:['<span id="wpglobus-dialog-start-{{clone_id}}" ','style="{{style}}" ','data-type="control" data-dialog-title="{{title}}" ','data-source-type="" data-source-id="{{id}}" data-source-name="{{name}}" ','data-nodename="{{nodename}}"',"{{sbTitle}} ",'class="{{classes}}"></span>'].join(""),startButtonClass:"wpglobus_dialog_start wpglobus_dialog_icon",clicks:0,init:function(t){v.option.dialog=v.option.dialogOptions,v.option=m.extend(v.option,t),m(v.option.dialogTabs).tabs(),v.dialogTitle=v.option.dialogTitle,this.attachListener(),null!=v.option.customData&&void 0!==v.option.customData.addElements&&m.each(v.option.customData.addElements,function(t,a){v.addElement(a)})},convertToId:function(t){return t=(t=t.replace(/\]/g,"")).replace(/\[/g,"-")},addElement:function(t){var a={id:null,style:"",styleTextareaWrapper:"",sbTitle:"",onChangeClass:"",dialogTitle:"",dialog:v.option.dialogOptions};if("string"==typeof t)a.id=t;else{if("object"!=typeof t)return;a=m.extend(a,t)}var e,o,n,i=null,l=null,s=null,d=null,u=v.startButton,r="";if(v.element_by="name",0==(d=document.getElementsByName(a.id)).length&&(v.element_by="id",d=document.getElementById(a.id)),null!==d){if(l=a.id,s=void 0===(i="id"==v.element_by?m("#"+l):(r=(r=d[0].nodeName).toLowerCase(),m(r+'[name="'+l+'"]'))).attr("name")||""==i.attr("name")?l:i.attr("name"),v.clone_id=v.convertToId(l),-1!=s.indexOf("wpglobus")||-1!=v.clone_id.indexOf("wpglobus"))return!1;if(0<m("#wpglobus-"+v.clone_id).length)return!1;if(0<m(r+'[name="wpglobus-'+s+'"]').length)return!1;e=m(i.clone()),n=i.attr("style")||"",i.attr("style","display:none;"),e.attr("id","wpglobus-"+v.clone_id).attr("name","wpglobus-"+s),e.addClass(v.trClass),""!=a.onChangeClass&&e.addClass(a.onChangeClass),"id"==v.element_by?e.attr("data-source-id",l).attr("data-source-name","").attr("data-source-get-by",v.element_by):e.attr("data-source-id","").attr("data-source-name",s).attr("data-source-get-by",v.element_by),"textarea"==r?(o=WPGlobusCore.getTranslations(i.val())[WPGlobusCoreData.language],e.val(o),e.attr("data-nodename","textarea"),""==a.style?e.attr("style",n+";width:95%;float:left;"):e.attr("style",n+";"+a.style)):(o=WPGlobusCore.getTranslations(i.val())[WPGlobusCoreData.language],e.attr("value",o),e.attr("data-nodename","input"),""!=a.style&&e.attr("style",n+";"+a.style)),""!=a.dialog&&e.attr("data-dialog",JSON.stringify(a.dialog)),u=u.replace(/{{clone_id}}/g,v.clone_id),u="id"==v.element_by?(u=(u=u.replace(/{{id}}/g,v.clone_id)).replace(/{{name}}/g,"")).replace(/{{nodename}}/g,""):(u=(u=u.replace(/{{id}}/g,"")).replace(/{{name}}/g,s)).replace(/{{nodename}}/g,r),u="textarea"==r?u.replace("{{style}}","float:left;margin-top:0;"):u.replace("{{style}}","");var c="textarea"==r?v.startButtonClass+" wpglobus-textarea wpglobus-textarea-"+v.clone_id:v.startButtonClass,u=u.replace("{{classes}}",c);u=""==a.dialogTitle?u.replace("{{title}}",v.dialogTitle):u.replace("{{title}}",a.dialogTitle),u=""==a.sbTitle?u.replace("{{sbTitle}}",a.sbTitle):u.replace("{{sbTitle}}",'title="'+a.sbTitle+'"'),m(u).insertAfter(i),m(e).insertAfter(i),"textarea"==r&&(m("#wpglobus-"+v.clone_id).addClass("wpglobus-textarea-"+v.clone_id),m(".wpglobus-textarea-"+v.clone_id).wrapAll('<div class="wpglobus-textarea-wrapper" style="'+a.styleTextareaWrapper+'"></div>'));var g,b,p=!1;return(""==a.onChangeClass?g="#wpglobus-"+v.clone_id:(g="."+a.onChangeClass,void 0===(b=m._data(m(document)[0],"events"))?p=!0:void 0!==b.change&&m.each(b.change,function(t,a){if(a.selector==g)return!(p=!0)})),p)?!0:(m(document).on("change",g,function(){var t=m(this),a=""==(a=t.data("source-id"))?t.data("nodename")+'[name="'+t.data("source-name")+'"]':"#"+a;m(a).val(WPGlobusCore.getString(m(a).val(),t.val()))}),!0)}},saveDialog:function(){var e,o,n,i="",l="",s="";m(".wpglobus_dialog_textarea").each(function(t,a){e=m(a),o=e.val(),(n=e.data("language"))==WPGlobusAdmin.data.language&&(s=o),""!=o&&(i+=WPGlobusCore.addLocaleMarks(o,n),n==WPGlobusCoreData.default_language&&(l=o))}),i=i.length==l.length+8?l:i,m(v.id).val(i),i=""==s?l:s,m(v.wpglobus_id).val(i)},dialog:m("#wpglobus-dialog-wrapper").dialog({autoOpen:!1,width:650,modal:!0,dialogClass:"wpglobus-dialog",buttons:[{text:"Save",class:"wpglobus-button-save",click:function(){v.saveDialog(),v.dialog.dialog("close")}},{text:"Cancel",class:"wpglobus-button-cancel",click:function(){v.dialog.dialog("close")}}],open:function(t,a){var e=v.dialogTitle;void 0!==v.attrs.maxlength&&(m(".wpglobus_dialog_textarea").attr("maxlength",v.attrs.maxlength),e+=" | maxlength="+v.attrs.maxlength),m(".wpglobus-dialog .ui-dialog-title").text(e)},close:function(){v.runCallback(v.option.dialog.close),v.form[0].reset()}}),attachListener:function(){m(document).on("click",v.option.settingsClass,function(){m(".wpglobus_dialog_options_wrapper").hasClass("hidden")?m(".wpglobus_dialog_options_wrapper").removeClass("hidden"):m(".wpglobus_dialog_options_wrapper").addClass("hidden")}),m(document).on("click",".wpglobus_dialog_option",function(t){var a=m(this),e=a.data("object");v.order.action="save_post_meta_settings",v.order.post_type=WPGlobusAdmin.data.post_type,v.order.checked=a.prop("checked"),v.order.id=a.attr("id"),v.order.meta_key=a.data("meta-key"),v.ajax(v.order).done(function(t){"ok"==t.result&&("true"==t.checked?m(e).removeClass("wpglobus_dialog_start_hidden"):m(e).addClass("wpglobus_dialog_start_hidden"))}).fail(function(t){}).always(function(t,a){})}),m(document).on("click",v.option.listenClass,function(a){v.element=m(this),v.id=v.element.data("source-id"),""==v.id?(v.id=v.element.data("nodename")+'[name="'+v.element.data("source-name")+'"]',v.wpglobus_id="#wpglobus-"+v.convertToId(v.element.data("source-name"))):(v.wpglobus_id="#wpglobus-"+v.id,v.id="#"+v.id),v.clicks++,1==v.clicks&&setTimeout(function(){var t;1==v.clicks?v.onClick(a):(t=m(v.id)).hasClass("hidden")?t.removeClass("hidden").attr("style","display:block;"):t.addClass("hidden").attr("style","display:none;"),v.clicks=0},200)}),v.form=v.dialog.find("form#wpglobus-dialog-form").on("submit",function(t){t.preventDefault(),v.saveDialog()})},ajax:function(t){return m.ajax({type:"POST",url:WPGlobusAdmin.ajaxurl,data:{action:WPGlobusAdmin.process_ajax,order:t},dataType:"json",async:!1})},onClick:function(t){void 0===v.element.data("dialog-title")||""==v.element.data("dialog-title")?v.dialogTitle=v.option.dialogTitle:v.dialogTitle=v.element.data("dialog-title"),void 0!==v.id&&(v.attrs.maxlength=m(v.id).attr("maxlength")),v.source=v.element.data("source-value"),void 0===v.source&&(v.source=m(v.id).val(),"ajax"==v.request||(v.value=WPGlobusCore.getTranslations(v.source))),v.option.dialog=m.extend({},v.option.dialogOptions,m(v.wpglobus_id).data("dialog")),""!=v.option.dialog.title&&(v.dialogTitle=v.option.dialog.title),m.each(v.value,function(t,a){var e=m("#wpglobus-dialog-"+t);e.val(a),e.attr("placeholder",WPGlobusCore.TextFilter(v.option.dialog.placeholder,t,"RETURN_IN_DEFAULT_LANGUAGE"))}),m("#wpglobus-dialog-form-footer").html(v.option.dialog.formFooter),v.runCallback(v.option.dialog.beforeOpen),v.dialog.dialog("open")},runCallback:function(t){var a,e;"object"==typeof t?(a=Object.keys(t)[0],e=t[Object.keys(t)[0]],"window"===a?"function"==typeof window[e]&&window[e](t[Object.keys(t)[1]]):"function"==typeof window[a][e]&&window[a][e](t[Object.keys(t)[1]])):"string"==typeof t&&"function"==typeof window[t]&&window[t]()}}}(jQuery),jQuery(document).ready(function(){"use strict";var t,c;window.WPGlobusAdminApp=(t=window.WPGlobusAdminApp||{},c=jQuery,t.App=function(t){void 0===window.WPGlobusAdminApp&&(this.config={debug:!1,version:WPGlobusAdmin.version},this.status="ok","undefined"==typeof WPGlobusAdmin?(this.status="error",this.config.debug&&console.log("WPGlobus: error options loading")):this.config.debug&&console.dir(WPGlobusAdmin),this.config.disable_first_language=['<div id="disable_first_language" style="display:block;" class="redux-field-errors notice-red">',"<strong>","<span> </span>",WPGlobusAdmin.i18n.cannot_disable_language,"</strong>","</div>"].join(""),c.extend(this.config,t),"ok"===this.status&&this.init())},t.App.prototype={$document:c(document),init:function(){WPGlobusCoreData.multisite=this.parseBool(WPGlobusCoreData.multisite),this.adminInit(),c("#content").addClass("wpglobus-editor").attr("data-language",WPGlobusAdmin.data.default_language),c("textarea[id^=content_]").each(function(t,a){var e=c(a).attr("id").replace("content_","");c(a).attr("data-language",e)}),"post.php"===WPGlobusAdmin.page?(this.postEdit(),this.set_dialog(),"undefined"!=typeof WPGlobusAioseop&&WPGlobusAioseop.init()):"menu-edit"===WPGlobusAdmin.page?this.navMenus():"taxonomy-edit"===WPGlobusAdmin.page?WPGlobusAdmin.data.tag_id&&this.taxonomyEdit():"taxonomy-quick-edit"===WPGlobusAdmin.page?this.quickEdit("taxonomy"):"edit.php"===WPGlobusAdmin.page?this.quickEdit("post"):"options-general.php"==WPGlobusAdmin.page?this.optionsGeneral():"widgets.php"==WPGlobusAdmin.page?(WPGlobusWidgets.init(),WPGlobusDialogApp.init({dialogTitle:"Edit text"})):"wpglobus_options"==WPGlobusAdmin.page?this.start():"wpglobusAdminCentral"==WPGlobusAdmin.page?this.adminCentral():WPGlobusDialogApp.init({customData:WPGlobusCoreData.page_custom_data})},parseBool:function(t){return!/^(false|0)$/i.test(t)&&!!t},getCurrentTab:function(){return c(".wpglobus-post-body-tabs-list .ui-tabs-active").data("language")},adminInit:function(){var t,a=c(".wpglobus-addons-group a").data("key");void 0!==a&&(0<=window.location.search.indexOf("page=wpglobus_options&tab="+a)?WPGlobusCoreData.multisite?window.location=WPGlobusCoreData.pluginInstallLocation.multisite:window.location=WPGlobusCoreData.pluginInstallLocation.single:(t=c("#toplevel_page_wpglobus_options li").eq(a+1),WPGlobusCoreData.multisite?c(t).find("a").attr("href",WPGlobusCoreData.pluginInstallLocation.multisite).attr("onclick","window.location=jQuery(this).attr('href');return false;"):c(t).find("a").attr("href",WPGlobusCoreData.pluginInstallLocation.single).attr("onclick","window.location=jQuery(this).attr('href');return false;")))},optionsGeneral:function(){var o=c("#blogname"),t=c("body");o.addClass("hidden"),c("#wpglobus-blogname").insertAfter(o).removeClass("hidden"),t.on("blur",".wpglobus-blogname",function(){c(".wpglobus-blogname").each(function(t,a){var e=c(a);o.val(WPGlobusCore.getString(o.val(),e.val(),e.data("language")))})});var n=c("#blogdescription");n.addClass("hidden"),c("#wpglobus-blogdescription").insertAfter(n).removeClass("hidden"),t.on("blur",".wpglobus-blogdesc",function(){c(".wpglobus-blogdesc").each(function(t,a){var e=c(a);n.val(WPGlobusCore.getString(n.val(),e.val(),e.data("language")))})})},quickEdit:function(n){var o,l,i,t;void 0!==WPGlobusAdmin.data.has_items&&WPGlobusAdmin.data.has_items&&(o="",l=0,c(document).ajaxComplete(function(t,a,e){void 0!==e.data&&""!=o&&0<=e.data.indexOf("action=inline-save-tax&")&&(c("#"+o+" a.row-title").text(WPGlobusAdmin.qedit_titles[l][WPGlobusAdmin.data.language].name),c("#"+o+" .description").text(WPGlobusAdmin.qedit_titles[l][WPGlobusAdmin.data.language].description))}),i={},c("#the-list tr").each(function(t,a){var e=c(a),o="post"===n?"post-":"tag-";l=e.attr("id").replace(o,""),i[l]={},"post"===n?i[l].source=e.find(".post_title").text():"taxonomy"===n&&(i[l].source=c("#inline_"+l+" .name").text())}),(t={action:"get_titles"}).type=n,t.taxonomy=void 0!==WPGlobusAdmin.data.taxonomy&&WPGlobusAdmin.data.taxonomy,t.title=i,c.ajax({type:"POST",url:WPGlobusAdmin.ajaxurl,data:{action:WPGlobusAdmin.process_ajax,order:t},dataType:"json"}).done(function(t){WPGlobusAdmin.qedit_titles=t.qedit_titles,c.each(t.bulkedit_post_titles,function(t,a){c("#inline_"+t+" .post_title").text(a[WPGlobusAdmin.data.language].name)})}).fail(function(t){}).always(function(t,a){}),c("body").on("change",".wpglobus-quick-edit-title",function(){var n="",i=[];c(".wpglobus-quick-edit-title").each(function(t,a){var e=c(a),o=e.data("language");""!==e.val()&&(n=WPGlobusCore.getString(n,e.val(),o)),WPGlobusAdmin.qedit_titles[l][o].name=e.val(),i[t]=o});var t=c(document).triggerHandler("wpglobus_get_translations",{string:n,lang:i,id:l});void 0!==t&&(n=t),c("input.ptitle").eq(0).attr("value",n),WPGlobusAdmin.qedit_titles[l].source=n}),void 0!==WPGlobusAdmin.data.tags&&c.each(WPGlobusAdmin.data.tags,function(t,a){WPGlobusAdmin.data.value[a].post_id={}}),c("button.save, input#bulk_edit").on("mouseenter",function(t){void 0!==WPGlobusAdmin.data.tags&&("bulk_edit"==t.currentTarget.id?c("input#bulk_edit").unbind("click"):c("button.save").unbind("click"),c("button.save, input#bulk_edit").on("click",function(a){var t=c.when(),e=(c(this),c.Deferred());e.resolve(function(t){t.next(".spinner").css({visibility:"visible"}),"bulk_edit"!=a.currentTarget.id&&c.ajaxSetup({async:!1});var o,n,i,l=t.parents("tr"),s=l.attr("id").replace("edit-","");c.each(WPGlobusAdmin.data.tags,function(t,a){if(0==(o=l.find("textarea[name='"+WPGlobusAdmin.data.names[a]+"']")).length)return!0;WPGlobusAdmin.data.value[a].post_id[s]=o.val(),n=WPGlobusAdmin.data.value[a].post_id[s].split(","),i=[];for(var e=0;e<n.length;e++)n[e]=n[e].trim(" "),""!=n[e]&&(void 0===WPGlobusAdmin.data.tag[a][n[e]]?i[e]=n[e]:i[e]=WPGlobusAdmin.data.tag[a][n[e]]);o.val(i.join(", "))})}(c(this))),t=t.then(function(){return c.when(e.done())}).then(function(){"bulk_edit"!=a.currentTarget.id&&setTimeout(function(){inlineEditPost.save(l),c.ajaxSetup({async:!0})},50)})}))}),c("#the-list").on("click","a.editinline",function(){var t=c(this);if(o=t.parents("tr").attr("id"),"post"===n)l=o.replace("post-","");else{if("taxonomy"!==n)return;l=o.replace("tag-","")}"post"===n&&void 0!==WPGlobusAdmin.data.tags&&c.each(WPGlobusAdmin.data.tags,function(t,a){var e,o;""==WPGlobusAdmin.data.value[a]||void 0!==(e=c("#edit-"+l+' textarea[name="'+WPGlobusAdmin.data.names[a]+'"]').val())&&(o=e.split(","),c.each(o,function(t,a){e=e.replace(a,WPGlobusCore.TextFilter(a,WPGlobusCoreData.language))}),c("#edit-"+l+' textarea[name="'+WPGlobusAdmin.data.names[a]+'"]').val(e))});var a=c("#edit-"+l+" input.ptitle").eq(0),e=a.parents("label");a.val(WPGlobusAdmin.qedit_titles[l].source),a.addClass("hidden"),c(WPGlobusAdmin.data.template).insertAfter(e),void 0===WPGlobusAdmin.qedit_titles[l]&&(WPGlobusAdmin.qedit_titles[l]={},WPGlobusAdmin.qedit_titles[l].source=c("#"+o+" .name a.row-title").text(),c(WPGlobusAdmin.data.enabled_languages).each(function(t,a){WPGlobusAdmin.qedit_titles[l][a]={},a==WPGlobusAdmin.data.default_language?WPGlobusAdmin.qedit_titles[l][a].name=WPGlobusAdmin.qedit_titles[l].source:WPGlobusAdmin.qedit_titles[l][a].name="",WPGlobusAdmin.qedit_titles[l][a].description=""})),c(".wpglobus-quick-edit-title").each(function(t,a){var e=c(a),o=e.data("language");e.attr("id",o+l),void 0!==WPGlobusAdmin.qedit_titles[l][o]&&(WPGlobusAdmin.qedit_titles[l][o].name=WPGlobusAdmin.qedit_titles[l][o].name.replace(/\\\'/g,"'"),WPGlobusAdmin.qedit_titles[l][o].name=WPGlobusAdmin.qedit_titles[l][o].name.replace(/\\\"/g,'"'),e.attr("value",WPGlobusAdmin.qedit_titles[l][o].name),WPGlobusAdmin.qedit_titles[l].source=WPGlobusCore.getString(WPGlobusAdmin.qedit_titles[l].source,WPGlobusAdmin.qedit_titles[l][o].name,o))}),c("input.ptitle").eq(0).attr("value",WPGlobusAdmin.qedit_titles[l].source)}))},taxonomyEdit:function(){var a=[];a[0]="name",a[1]="description";c.each(WPGlobusCoreData.enabled_languages,function(t,u){c.each(a,function(t,a){var e,o,n,i,l,s,d;o=u,n=c("#"+(e=a)),i=n.clone(),l=n.attr("name"),s="wpglobus-element wpglobus-element_"+e+" wpglobus-element_"+o+" wpglobus-translatable",d=(d=document.getElementById(e)).nodeName,c(i).attr("id",e+"_"+o),c(i).attr("name",l+"_"+o),o!==WPGlobusCoreData.default_language&&(s+=" hidden"),c(i).attr("class",s),c(i).attr("data-save-to",e),c(i).attr("data-language",o),"INPUT"==d?c(i).attr("value",c("#wpglobus-link-tab-"+o).data(e)):"TEXTAREA"==d&&c(i).text(c("#wpglobus-link-tab-"+o).data(e)),n.addClass("hidden"),0==c(".wpglobus-element_"+e).length?c(i).insertAfter(n):c(i).insertAfter(c(".wpglobus-element_"+e).last())})}),c(".wpglobus-taxonomy-tabs").insertAfter("#ajax-response"),c(".wrap").tabs(),c("body").on("click",".wpglobus-taxonomy-tabs li",function(t){var a=c(this).data("language");c(".wpglobus-element").addClass("hidden"),c(".wpglobus-element_"+a).removeClass("hidden")}),c(".wpglobus-element").on("change",function(){var n=c(this).data("save-to"),i="";c(".wpglobus-element").each(function(t,a){var e=c(a),o=e.val();e.data("save-to")==n&&""!==o&&(i+=WPGlobusCore.addLocaleMarks(o,e.data("language")))}),c("#"+n).val(i)}),c(WPGlobusAdmin.data.multilingualSlug.title).insertAfter(".term-slug-wrap th label")},navMenus:function(){function e(){n!==c(i).length&&(clearInterval(o),c(i).each(function(t,a){var l,e=c(a);e.hasClass("wpglobus-menu-item")||(l=c(a).attr("id"),c.each(["input.edit-menu-item-title","input.edit-menu-item-attr-title"],function(t,a){var e,o,n=c("#"+l+" "+a),i=c(n);i.hasClass("wpglobus-hidden")||(i.addClass("wpglobus-hidden"),i.css("display","none"),e=i.parent("label"),o=i.parents("p"),c(o).css("height","80px"),c(e).append('<div style="color:#f00;">'+WPGlobusAdmin.i18n.save_nav_menu+"</div>"))}),e.addClass("wpglobus-menu-item"))}))}var o,n,i="#menu-to-edit .menu-item";c.ajaxSetup({beforeSend:function(t,a){void 0!==a.data&&0<=a.data.indexOf("action=add-menu-item")&&(n=c(i).length,o=setInterval(e,500))}}),c(i).each(function(t,a){var e=c(a).attr("id"),u=e.replace("menu-item-","");c.each(["input.edit-menu-item-title","input.edit-menu-item-attr-title"],function(n,i){var l=c("#"+e+" "+i);l.val()!=WPGlobusAdmin.data.items[u][i].source&&l.val(WPGlobusAdmin.data.items[u][i].source);var s=c("#"+e+" "+i).parents("p"),d=0;c.each(WPGlobusAdmin.data.open_languages,function(t,a){var e=l.clone();e.attr("id",l.attr("id")+"-"+a),e.attr("name",l.attr("id")+"-"+a),e.attr("data-language",a),e.attr("data-item-id",u),e.attr("placeholder",WPGlobusAdmin.data.en_language_name[a]);var o=WPGlobusAdmin.data.items[u][a][i].class;0===n&&a===WPGlobusAdmin.data.default_language?e.attr("class",o+" edit-menu-item-title"):e.attr("class",o),""!=WPGlobusAdmin.data.items[u][a][i].caption?e.attr("value",WPGlobusAdmin.data.items[u][a][i].caption):e.attr("value",""),e.css("margin-bottom","0.6em"),c(s).append(e),d=t}),d=40*(d+1),l.css("display","none").attr("class","").addClass("widefat wpglobus-hidden"),c(s).css("height",d+"px").addClass("wpglobus-menu-item-box")}),c(a).addClass("wpglobus-menu-item")}),c(".menus-move-left, .menus-move-right").each(function(t,a){var e,o=c(a),n=(o.parents("li").attr("id").replace("menu-item-",""),o.attr("title"));void 0!==n&&c.each(WPGlobusAdmin.data.post_titles,function(t,a){0<=n.indexOf(t)&&(e=n.replace(t,a),o.attr("title",e),o.text(e))})}),c(".edit-menu-item-title").trigger("change"),wpNavMenu.refreshAdvancedAccessibility(),wpNavMenu.menusChanged=!1,c(".wpglobus-menu-item").on("change",function(){var t,a,e=c(this),o=e.data("item-id");e.hasClass("wpglobus-item-title")&&(t=WPGlobusCore.getString(c("input#edit-menu-item-title-"+o).val(),e.val(),e.data("language")),void 0!==(a=c(document).triggerHandler("wpglobus_get_menu_translations",{string:t,lang:WPGlobusCoreData.open_languages,id:o,type:"input.edit-menu-item-title"}))&&(t=a),c("input#edit-menu-item-title-"+o).val(t)),e.hasClass("wpglobus-item-attr")&&(t=WPGlobusCore.getString(c("input#edit-menu-item-attr-title-"+o).val(),e.val(),e.data("language")),void 0!==(a=c(document).triggerHandler("wpglobus_get_menu_translations",{string:t,lang:WPGlobusCoreData.open_languages,id:o,type:"input.edit-menu-item-attr-title"}))&&(t=a),c("input#edit-menu-item-attr-title-"+o).val(t))})},postEdit:function(){c(document).on("heartbeat-send",function(t,o){void 0!==o.wp_autosave&&(o.wpglobus_heartbeat="wpglobus",c.each(WPGlobusAdmin.data.open_languages,function(t,a){var e=c("#title_"+a).val()||"";""!=(e=c.trim(e))&&(o.wp_autosave["post_title_"+a]=e),e=c("#content_"+a).val()||"",""!=(e=c.trim(e))&&(o.wp_autosave["content_"+a]=e)}))});var a,l,s,e="#postdivrich",o=!0,i="#post-body-content";!1===WPGlobusAdmin.data.support.editor&&(o=!(e="#titlediv")),!1===WPGlobusAdmin.data.support.title&&(o=!1),c(i).prepend(c(".wpglobus-post-body-tabs-list")),c.each(WPGlobusAdmin.tabs,function(t,a){"default"===a?(c(e).wrap('<div id="tab-default"></div>'),o&&c(c("#titlediv")).insertBefore(e)):(c(e+"-"+a).wrap('<div id="tab-'+a+'"></div>'),o&&c(c("#titlediv-"+a)).insertBefore(e+"-"+a))}),c(i).addClass("wpglobus-post-body-tabs").tabs({beforeActivate:function(t,a){var e=a.oldTab[0].id.replace("link-tab-",""),o=a.newTab[0].id.replace("link-tab-","");"default"==e&&(e=WPGlobusCoreData.default_language),"default"==o&&(o=WPGlobusCoreData.default_language);var n=c(document).triggerHandler("wpglobus_post_body_tabs",[e,o]);return!(!n&&void 0!==n)}}),c("#title").val(WPGlobusAdmin.title),c("#content").text(WPGlobusAdmin.content),"undefined"!=typeof WPGlobusVendor&&WPGlobusVendor.vendor.WPSEO&&("undefined"!=typeof wpglobus_wpseo?wpglobus_wpseo():"undefined"!=typeof WPGlobusYoastSeo&&("undefined"!=typeof WPGlobusYoastSeoPremium&&WPGlobusYoastSeoPremium&&WPGlobusYoastSeoPremium.init(),WPGlobusYoastSeo.init())),WPGlobusAdmin.data.modify_excerpt&&((a=c("#excerpt")).addClass("hidden").css({display:"none"}),c(WPGlobusAdmin.data.template).insertAfter(a),c("body").on("change",".wpglobus-excerpt",function(){var t=c(this);a.val(WPGlobusCore.getString(a.val(),t.val(),t.data("language")))})),void 0!==wp.utils&&void 0!==wp.utils.WordCounter&&(WPGlobusCoreData.wordCounter={},l=this,s={},c.each(WPGlobusCoreData.enabled_languages,function(t,a){return a==WPGlobusCoreData.default_language||(s[t]="content_"+a,n=jQuery,e=new wp.utils.WordCounter,i=a,WPGlobusCoreData.wordCounter[i]={},WPGlobusCoreData.wordCounter[i].counter=e,void n(function(){function o(t){var a,e;"object"==typeof t&&(t="tinymce"==t?l.getCurrentTab():t.target.id.replace("content_","")),void 0!==WPGlobusCoreData.wordCounter[t]&&(a=!WPGlobusCoreData.wordCounter[t].contentEditor||WPGlobusCoreData.wordCounter[t].contentEditor.isHidden()?WPGlobusCoreData.wordCounter[t].content.val():WPGlobusCoreData.wordCounter[t].contentEditor.getContent({format:"raw"}),(e=WPGlobusCoreData.wordCounter[t].counter.count(a))!==WPGlobusCoreData.wordCounter[t].prevCount&&WPGlobusCoreData.wordCounter[t].count.text(e),WPGlobusCoreData.wordCounter[t].prevCount=e)}WPGlobusCoreData.wordCounter[i].content=n("#content_"+i),WPGlobusCoreData.wordCounter[i].count=n("#wp-word-count-"+i).find(".word-count-"+i),WPGlobusCoreData.wordCounter[i].prevCount=0,n(document).on("tinymce-editor-init",function(t,a){var e;-1!=n.inArray(a.id,s)&&(e=a.id.replace("content_",""),(WPGlobusCoreData.wordCounter[e].contentEditor=a).on("nodechange keyup",_.debounce(o,1e3)))}),WPGlobusCoreData.wordCounter[i].content.on("input keyup",_.debounce(o,1e3)),o(i)}));var n,e,i})),c(document).on("click","#publish, #save-post",function(){var e,t,o,n;1<WPGlobusAdmin.data.open_languages.length&&(c(document).triggerHandler("wpglobus_before_save_post",{content_tabs_id:i}),e=c("#title").val(),n=o="",0==e.length&&(t=WPGlobusAdmin.data.open_languages.indexOf(WPGlobusAdmin.data.default_language),WPGlobusAdmin.data.open_languages.splice(t,1),c(WPGlobusAdmin.data.open_languages).each(function(t,a){n=0==t?"":"-",0<(e=c("#title_"+a).val()).length&&(0==o.length&&(n=""),o=o+n+e)})),0<o.length&&c("#title").val(o)),void 0===WPGlobusAdmin.data.tagsdiv||WPGlobusAdmin.data.tagsdiv.length<1||c(WPGlobusAdmin.data.tagsdiv).each(function(t,a){if(0==c("#"+a).length)return!0;var e=a.replace("tagsdiv-","");if("undefined"===e)return!0;if(0==c("#tax-input-"+e).length)return!0;var o,n=[];c("#tagsdiv-"+e+" .tagchecklist > span").each(function(t,a){o=(o=c(a).html()).replace(/<button.*<\/button> /,""),void 0===WPGlobusAdmin.data.tag[e][o]?n[t]=o:n[t]=WPGlobusAdmin.data.tag[e][o]}),c("#tax-input-"+e).val(n.join(", "))})}),c(".ui-state-default").on("click",function(){"link-tab-default"===c(this).attr("id")&&(c(window).scrollTop(c(window).scrollTop()+1),c(window).scrollTop(c(window).scrollTop()-1))}),c(document).on("tabsactivate",i,function(t,a){WPGlobusAdmin.currentTab=a.newTab[0].dataset.language}),c(document).triggerHandler("wpglobus_after_post_edit")},adminCentral:function(){c(".wpglobus-admin-central-tab").css({display:"none"}),1<c(".nav-tab-active").length&&c(".wpglobus-about-wrap .nav-tab-wrapper a").removeClass("nav-tab-active");var e=!0;0==location.hash.indexOf("#")&&c(".wpglobus-about-wrap .nav-tab-wrapper a").each(function(t,a){c(a).attr("href")==location.hash&&(e=!1,c(a).addClass("nav-tab-active"))}),e&&c(".wpglobus-about-wrap .nav-tab-wrapper a").eq(0).addClass("nav-tab-active");var t=c(".wpglobus-about-wrap .nav-tab-active").data("tab-id");""!=t&&c("#"+t).css({display:"block"}),c(document).on("click",".wpglobus-about-wrap .nav-tab",function(t){var a=c(this);a.hasClass("nav-tab-active")||(c(".wpglobus-admin-central-tab").css({display:"none"}),c(".wpglobus-about-wrap .nav-tab").removeClass("nav-tab-active"),a.addClass("nav-tab-active"),""!=a.data("tab-id")&&c("#"+a.data("tab-id")).css({display:"block"}))})},start:function(){var a=this;c("#wpglobus_flags").select2({formatResult:this.format,formatSelection:this.format,minimumResultsForSearch:-1,escapeMarkup:function(t){return t}}),c("body").on("click","#enabled_languages-list li:first input",function(t){return t.preventDefault(),c(".redux-save-warn").css({display:"none"}),c("#enabled_languages-list").find("li:first > input").val("1"),0===c("#disable_first_language").length&&c(a.config.disable_first_language).insertAfter("#info_bar"),!1})},format:function(t){return'<img class="wpglobus_flag" src="'+WPGlobusAdmin.flag_url+t.text+'"/> '+t.text},set_dialog:function(){var o,e,n;void 0!==WPGlobusAdmin.data.customFieldsEnabled&&(WPGlobusAdmin.data.customFieldsEnabled=this.parseBool(WPGlobusAdmin.data.customFieldsEnabled),!WPGlobusAdmin.data.customFieldsEnabled)||(e=!1,(n=function(t){var s,d,u="wpglobus_dialog_start wpglobus_dialog_icon",r=['<div class="wpglobus_dialog_options_wrapper hidden">','<input style="width:initial;" id="wpglobus-cb-{{id}}" data-object="#wpglobus-dialog-start-{{id}}" data-meta-key="{{meta-key}}" class="wpglobus_dialog_option wpglobus_dialog_cb" type="checkbox" {{checked}} />',"</div>"].join(""),a=void 0===t?"#the-list tr":"#the-list tr#"+t;c(a).each(function(){var t,a,e,o=c(this),n=o.attr("id"),i=o.find("textarea"),l=u;if(void 0===(s=i.attr("id")))return!0;e=c("#"+n+"-key").val(),t=c("#"+s).clone(),c(i).addClass("wpglobus-dialog-field-source hidden"),a=i.attr("name"),c(t).attr("id","wpglobus-"+s),c(t).attr("name","wpglobus-"+a),c(t).attr("data-source-id",s),c(t).attr("class","wpglobus-dialog-field"),c(t).val(WPGlobusCore.TextFilter(c(i).val(),WPGlobusCoreData.language)),c(t).insertAfter(i),d=(d=r.replace(/{{id}}/g,s)).replace(/{{meta-key}}/g,e),void 0===WPGlobusAdmin.data.post_meta_settings[WPGlobusAdmin.data.post_type]?d=d.replace(/{{checked}}/,"checked"):l=void 0!==WPGlobusAdmin.data.post_meta_settings[WPGlobusAdmin.data.post_type][e]&&"false"==WPGlobusAdmin.data.post_meta_settings[WPGlobusAdmin.data.post_type][e]?(d=d.replace(/{{checked}}/,""),u+" wpglobus_dialog_start_hidden"):(d=d.replace(/{{checked}}/,"checked"),u),o.append('<td style="width:20px;"><div id="wpglobus-dialog-start-'+s+'" data-type="control" data-source-type="textarea" data-source-id="'+s+'" class="'+l+'"></div>'+d+"</td>")}),!e&&0<c("#list-table .wpglobus_dialog_start").length&&(c("#list-table thead tr").append('<th class="wpglobus-control-head"><div class="wpglobus_dialog_settings wpglobus_dialog_icon"></div></th>'),e=!0)})(),c("body").on("change",".wpglobus-dialog-field",function(){var e,o,n=c(this),t="#"+n.data("source-id"),i="";e=c(t).val(),/(\{:|\[:|<!--:)[a-z]{2}/.test(e)?(c.each(WPGlobusCoreData.enabled_languages,function(t,a){""!=(o=a==WPGlobusCoreData.language?n.val():WPGlobusCore.TextFilter(e,a,"RETURN_EMPTY"))&&(i+=WPGlobusCore.addLocaleMarks(o,a))}),c(t).val(i)):c(t).val(n.val())}),c(document).ajaxSend(function(t,a,e){"add-meta"==e.action&&(o=e.element)}),c(document).ajaxComplete(function(t,a,e){"add-meta"==e.action&&void 0!==a.responseXML&&n("newmeta"==o?"meta-"+c(a.responseXML.documentElement.outerHTML).find("meta").attr("id"):o)}),WPGlobusDialogApp.init({dialogTitle:"Edit meta"}))}},new t.App,t)});
|
1 |
+
var WPGlobusCore,WPGlobusDialogApp;!function(i){var d=WPGlobusCore={strpos:function(t,a,e){e=(t=""+t).indexOf(a,e);return 0<=e&&e},TextFilter:function(t,a,e){if(void 0===t||""===t)return t;var o,n,i=[],l=!1;a=""==a?"en":a,e=void 0===e||""==e?"RETURN_IN_DEFAULT_LANGUAGE":e,i[0]=[],i[0].start=WPGlobusCoreData.locale_tag_start.replace("%s",a),i[0].end=WPGlobusCoreData.locale_tag_end,i[1]=[],i[1].start="\x3c!--:"+a+"--\x3e",i[1].end="\x3c!--:--\x3e",i[2]=[],i[2].start="[:"+a+"]",i[2].end="[:";for(var s=0;s<3;s++)if(!1!==(o=d.strpos(t,i[s].start))){o+=i[s].start.length,t=!1===(n=d.strpos(t,i[s].end,o))?t.substr(o):t.substr(o,n-o),l=!0;break}return l||("RETURN_EMPTY"==e?a==WPGlobusCoreData.default_language&&!/(\{:|\[:|<!--:)[a-z]{2}/.test(t)||(t=""):a==WPGlobusCoreData.default_language?/(\{:|\[:|<!--:)[a-z]{2}/.test(t)&&(t=""):t=d.TextFilter(t,WPGlobusCoreData.default_language)),t},addLocaleMarks:function(t,a){return WPGlobusCoreData.locale_tag_start.replace("%s",a)+t+WPGlobusCoreData.locale_tag_end},getTranslations:function(e){var o,n={};return i.each(WPGlobusCoreData.enabled_languages,function(t,a){o=a==WPGlobusCoreData.default_language?"RETURN_IN_DEFAULT_LANGUAGE":"RETURN_EMPTY",n[a]=d.TextFilter(e,a,o)}),n},getString:function(t,a,e){if(void 0===t)return t;void 0===a&&(a=""),void 0===e&&(e=WPGlobusCoreData.language),(t=d.getTranslations(t))[e]=a;var o="";return i.each(t,function(t,a){""!=a&&t!=WPGlobusCoreData.default_language&&(o+=d.addLocaleMarks(a,t))}),o=""!=t[WPGlobusCoreData.default_language]?""==o?t[WPGlobusCoreData.default_language]:d.addLocaleMarks(t[WPGlobusCoreData.default_language],WPGlobusCoreData.default_language)+o:o}}}(jQuery),function(c){var g=WPGlobusDialogApp={option:{listenClass:".wpglobus_dialog_start",settingsClass:".wpglobus_dialog_settings",dialogTabs:"#wpglobus-dialog-tabs",dialogTitle:"",customData:null,callback:function(){},dialogOptions:{title:"",placeholder:"",formFooter:"",beforeOpen:function(){},close:function(){}},dialog:{}},form:void 0,element:void 0,element_by:"id",id:"",clone_id:"",wpglobus_id:"",type:"textarea",source:"",order:{},value:{},request:"core",attrs:{},dialogTitle:"",trClass:"wpglobus-translatable",startButton:['<span id="wpglobus-dialog-start-{{clone_id}}" ','style="{{style}}" ','data-type="control" data-dialog-title="{{title}}" ','data-source-type="" data-source-id="{{id}}" data-source-name="{{name}}" ','data-nodename="{{nodename}}"',"{{sbTitle}} ",'class="{{classes}}"></span>'].join(""),startButtonClass:"wpglobus_dialog_start wpglobus_dialog_icon",clicks:0,init:function(t){g.option.dialog=g.option.dialogOptions,g.option=c.extend(g.option,t),c(g.option.dialogTabs).tabs(),g.dialogTitle=g.option.dialogTitle,this.attachListener(),null!=g.option.customData&&void 0!==g.option.customData.addElements&&c.each(g.option.customData.addElements,function(t,a){g.addElement(a)})},convertToId:function(t){return t=(t=t.replace(/\]/g,"")).replace(/\[/g,"-")},addElement:function(t){var a={id:null,style:"",styleTextareaWrapper:"",sbTitle:"",onChangeClass:"",dialogTitle:"",dialog:g.option.dialogOptions};if("string"==typeof t)a.id=t;else{if("object"!=typeof t)return;a=c.extend(a,t)}var e,o=null,n=null,i=null,l=null,s=g.startButton,d="";if(g.element_by="name",0==(l=document.getElementsByName(a.id)).length&&(g.element_by="id",l=document.getElementById(a.id)),null!==l){if(n=a.id,i=void 0===(o="id"==g.element_by?c("#"+n):(d=(d=l[0].nodeName).toLowerCase(),c(d+'[name="'+n+'"]'))).attr("name")||""==o.attr("name")?n:o.attr("name"),g.clone_id=g.convertToId(n),-1!=i.indexOf("wpglobus")||-1!=g.clone_id.indexOf("wpglobus"))return!1;if(0<c("#wpglobus-"+g.clone_id).length)return!1;if(0<c(d+'[name="wpglobus-'+i+'"]').length)return!1;t=c(o.clone()),l=o.attr("style")||"",o.attr("style","display:none;"),t.attr("id","wpglobus-"+g.clone_id).attr("name","wpglobus-"+i),t.addClass(g.trClass),""!=a.onChangeClass&&t.addClass(a.onChangeClass),("id"==g.element_by?t.attr("data-source-id",n).attr("data-source-name",""):t.attr("data-source-id","").attr("data-source-name",i)).attr("data-source-get-by",g.element_by),"textarea"==d?(e=WPGlobusCore.getTranslations(o.val())[WPGlobusCoreData.language],t.val(e),t.attr("data-nodename","textarea"),""==a.style?t.attr("style",l+";width:95%;float:left;"):t.attr("style",l+";"+a.style)):(e=WPGlobusCore.getTranslations(o.val())[WPGlobusCoreData.language],t.attr("value",e),t.attr("data-nodename","input"),""!=a.style&&t.attr("style",l+";"+a.style)),""!=a.dialog&&t.attr("data-dialog",JSON.stringify(a.dialog)),s=s.replace(/{{clone_id}}/g,g.clone_id),s="id"==g.element_by?(s=(s=s.replace(/{{id}}/g,g.clone_id)).replace(/{{name}}/g,"")).replace(/{{nodename}}/g,""):(s=(s=s.replace(/{{id}}/g,"")).replace(/{{name}}/g,i)).replace(/{{nodename}}/g,d);s="textarea"==d?s.replace("{{style}}","float:left;margin-top:0;"):s.replace("{{style}}",""),i="textarea"==d?g.startButtonClass+" wpglobus-textarea wpglobus-textarea-"+g.clone_id:g.startButtonClass;s=s.replace("{{classes}}",i),s=""==a.dialogTitle?s.replace("{{title}}",g.dialogTitle):s.replace("{{title}}",a.dialogTitle),s=""==a.sbTitle?s.replace("{{sbTitle}}",a.sbTitle):s.replace("{{sbTitle}}",'title="'+a.sbTitle+'"'),c(s).insertAfter(o),c(t).insertAfter(o),"textarea"==d&&(c("#wpglobus-"+g.clone_id).addClass("wpglobus-textarea-"+g.clone_id),c(".wpglobus-textarea-"+g.clone_id).wrapAll('<div class="wpglobus-textarea-wrapper" style="'+a.styleTextareaWrapper+'"></div>'));var u,r=!1;return(""==a.onChangeClass?u="#wpglobus-"+g.clone_id:(u="."+a.onChangeClass,void 0===(a=c._data(c(document)[0],"events"))?r=!0:void 0!==a.change&&c.each(a.change,function(t,a){if(a.selector==u)return!(r=!0)})),r)?!0:(c(document).on("change",u,function(){var t=c(this),a=""==(a=t.data("source-id"))?t.data("nodename")+'[name="'+t.data("source-name")+'"]':"#"+a;c(a).val(WPGlobusCore.getString(c(a).val(),t.val()))}),!0)}},saveDialog:function(){var e,o,n="",i="",l="";c(".wpglobus_dialog_textarea").each(function(t,a){o=c(a),e=o.val(),(o=o.data("language"))==WPGlobusAdmin.data.language&&(l=e),""!=e&&(n+=WPGlobusCore.addLocaleMarks(e,o),o==WPGlobusCoreData.default_language&&(i=e))}),n=n.length==i.length+8?i:n,c(g.id).val(n),n=""==l?i:l,c(g.wpglobus_id).val(n)},dialog:c("#wpglobus-dialog-wrapper").dialog({autoOpen:!1,width:650,modal:!0,dialogClass:"wpglobus-dialog",buttons:[{text:"Save",class:"wpglobus-button-save",click:function(){g.saveDialog(),g.dialog.dialog("close")}},{text:"Cancel",class:"wpglobus-button-cancel",click:function(){g.dialog.dialog("close")}}],open:function(t,a){var e=g.dialogTitle;void 0!==g.attrs.maxlength&&(c(".wpglobus_dialog_textarea").attr("maxlength",g.attrs.maxlength),e+=" | maxlength="+g.attrs.maxlength),c(".wpglobus-dialog .ui-dialog-title").text(e)},close:function(){g.runCallback(g.option.dialog.close),g.form[0].reset()}}),attachListener:function(){c(document).on("click",g.option.settingsClass,function(){c(".wpglobus_dialog_options_wrapper").hasClass("hidden")?c(".wpglobus_dialog_options_wrapper").removeClass("hidden"):c(".wpglobus_dialog_options_wrapper").addClass("hidden")}),c(document).on("click",".wpglobus_dialog_option",function(t){var a=c(this),e=a.data("object");g.order.action="save_post_meta_settings",g.order.post_type=WPGlobusAdmin.data.post_type,g.order.checked=a.prop("checked"),g.order.id=a.attr("id"),g.order.meta_key=a.data("meta-key"),g.ajax(g.order).done(function(t){"ok"==t.result&&("true"==t.checked?c(e).removeClass("wpglobus_dialog_start_hidden"):c(e).addClass("wpglobus_dialog_start_hidden"))}).fail(function(t){}).always(function(t,a){})}),c(document).on("click",g.option.listenClass,function(a){g.element=c(this),g.id=g.element.data("source-id"),""==g.id?(g.id=g.element.data("nodename")+'[name="'+g.element.data("source-name")+'"]',g.wpglobus_id="#wpglobus-"+g.convertToId(g.element.data("source-name"))):(g.wpglobus_id="#wpglobus-"+g.id,g.id="#"+g.id),g.clicks++,1==g.clicks&&setTimeout(function(){var t;1==g.clicks?g.onClick(a):(t=c(g.id)).hasClass("hidden")?t.removeClass("hidden").attr("style","display:block;"):t.addClass("hidden").attr("style","display:none;"),g.clicks=0},200)}),g.form=g.dialog.find("form#wpglobus-dialog-form").on("submit",function(t){t.preventDefault(),g.saveDialog()})},ajax:function(t){return c.ajax({type:"POST",url:WPGlobusAdmin.ajaxurl,data:{action:WPGlobusAdmin.process_ajax,order:t},dataType:"json",async:!1})},onClick:function(t){void 0===g.element.data("dialog-title")||""==g.element.data("dialog-title")?g.dialogTitle=g.option.dialogTitle:g.dialogTitle=g.element.data("dialog-title"),void 0!==g.id&&(g.attrs.maxlength=c(g.id).attr("maxlength")),g.source=g.element.data("source-value"),void 0===g.source&&(g.source=c(g.id).val(),"ajax"==g.request||(g.value=WPGlobusCore.getTranslations(g.source))),g.option.dialog=c.extend({},g.option.dialogOptions,c(g.wpglobus_id).data("dialog")),""!=g.option.dialog.title&&(g.dialogTitle=g.option.dialog.title),c.each(g.value,function(t,a){var e=c("#wpglobus-dialog-"+t);e.val(a),e.attr("placeholder",WPGlobusCore.TextFilter(g.option.dialog.placeholder,t,"RETURN_IN_DEFAULT_LANGUAGE"))}),c("#wpglobus-dialog-form-footer").html(g.option.dialog.formFooter),g.runCallback(g.option.dialog.beforeOpen),g.dialog.dialog("open")},runCallback:function(t){var a,e;"object"==typeof t?(a=Object.keys(t)[0],e=t[Object.keys(t)[0]],"window"===a?"function"==typeof window[e]&&window[e](t[Object.keys(t)[1]]):"function"==typeof window[a][e]&&window[a][e](t[Object.keys(t)[1]])):"string"==typeof t&&"function"==typeof window[t]&&window[t]()}}}(jQuery),jQuery(document).ready(function(){"use strict";var t,r;window.WPGlobusAdminApp=(t=window.WPGlobusAdminApp||{},r=jQuery,t.App=function(t){void 0===window.WPGlobusAdminApp&&(this.config={debug:!1,version:WPGlobusAdmin.version},this.status="ok","undefined"==typeof WPGlobusAdmin?(this.status="error",this.config.debug&&console.log("WPGlobus: error options loading")):this.config.debug&&console.dir(WPGlobusAdmin),this.config.disable_first_language=['<div id="disable_first_language" style="display:block;" class="redux-field-errors notice-red">',"<strong>","<span> </span>",WPGlobusAdmin.i18n.cannot_disable_language,"</strong>","</div>"].join(""),r.extend(this.config,t),"ok"===this.status&&this.init())},t.App.prototype={$document:r(document),init:function(){WPGlobusCoreData.multisite=this.parseBool(WPGlobusCoreData.multisite),this.adminInit(),r("#content").addClass("wpglobus-editor").attr("data-language",WPGlobusAdmin.data.default_language),r("textarea[id^=content_]").each(function(t,a){var e=r(a).attr("id").replace("content_","");r(a).attr("data-language",e)}),"post.php"===WPGlobusAdmin.page?(this.postEdit(),this.set_dialog(),"undefined"!=typeof WPGlobusAioseop&&WPGlobusAioseop.init()):"menu-edit"===WPGlobusAdmin.page?this.navMenus():"taxonomy-edit"===WPGlobusAdmin.page?WPGlobusAdmin.data.tag_id&&this.taxonomyEdit():"taxonomy-quick-edit"===WPGlobusAdmin.page?this.quickEdit("taxonomy"):"edit.php"===WPGlobusAdmin.page?this.quickEdit("post"):"options-general.php"==WPGlobusAdmin.page?this.optionsGeneral():"widgets.php"==WPGlobusAdmin.page?(WPGlobusWidgets.init(),WPGlobusDialogApp.init({dialogTitle:"Edit text"})):"wpglobus_options"==WPGlobusAdmin.page?this.start():"wpglobusAdminCentral"==WPGlobusAdmin.page?this.adminCentral():WPGlobusDialogApp.init({customData:WPGlobusCoreData.page_custom_data})},parseBool:function(t){return!/^(false|0)$/i.test(t)&&!!t},getCurrentTab:function(){return r(".wpglobus-post-body-tabs-list .ui-tabs-active").data("language")},adminInit:function(){var t=r(".wpglobus-addons-group a").data("key");void 0!==t&&(0<=window.location.search.indexOf("page=wpglobus_options&tab="+t)?WPGlobusCoreData.multisite?window.location=WPGlobusCoreData.pluginInstallLocation.multisite:window.location=WPGlobusCoreData.pluginInstallLocation.single:(t=r("#toplevel_page_wpglobus_options li").eq(t+1),(WPGlobusCoreData.multisite?r(t).find("a").attr("href",WPGlobusCoreData.pluginInstallLocation.multisite):r(t).find("a").attr("href",WPGlobusCoreData.pluginInstallLocation.single)).attr("onclick","window.location=jQuery(this).attr('href');return false;")))},optionsGeneral:function(){var e=r("#blogname"),t=r("body");e.addClass("hidden"),r("#wpglobus-blogname").insertAfter(e).removeClass("hidden"),t.on("blur",".wpglobus-blogname",function(){r(".wpglobus-blogname").each(function(t,a){a=r(a);e.val(WPGlobusCore.getString(e.val(),a.val(),a.data("language")))})});var o=r("#blogdescription");o.addClass("hidden"),r("#wpglobus-blogdescription").insertAfter(o).removeClass("hidden"),t.on("blur",".wpglobus-blogdesc",function(){r(".wpglobus-blogdesc").each(function(t,a){a=r(a);o.val(WPGlobusCore.getString(o.val(),a.val(),a.data("language")))})})},quickEdit:function(o){var n,i,l,t;void 0!==WPGlobusAdmin.data.has_items&&WPGlobusAdmin.data.has_items&&(n="",i=0,r(document).ajaxComplete(function(t,a,e){void 0!==e.data&&""!=n&&0<=e.data.indexOf("action=inline-save-tax&")&&(r("#"+n+" a.row-title").text(WPGlobusAdmin.qedit_titles[i][WPGlobusAdmin.data.language].name),r("#"+n+" .description").text(WPGlobusAdmin.qedit_titles[i][WPGlobusAdmin.data.language].description))}),l={},r("#the-list tr").each(function(t,a){var e=r(a),a="post"===o?"post-":"tag-";i=e.attr("id").replace(a,""),l[i]={},"post"===o?l[i].source=e.find(".post_title").text():"taxonomy"===o&&(l[i].source=r("#inline_"+i+" .name").text())}),(t={action:"get_titles"}).type=o,t.taxonomy=void 0!==WPGlobusAdmin.data.taxonomy&&WPGlobusAdmin.data.taxonomy,t.title=l,r.ajax({type:"POST",url:WPGlobusAdmin.ajaxurl,data:{action:WPGlobusAdmin.process_ajax,order:t},dataType:"json"}).done(function(t){WPGlobusAdmin.qedit_titles=t.qedit_titles,r.each(t.bulkedit_post_titles,function(t,a){r("#inline_"+t+" .post_title").text(a[WPGlobusAdmin.data.language].name)})}).fail(function(t){}).always(function(t,a){}),r("body").on("change",".wpglobus-quick-edit-title",function(){var o="",n=[];r(".wpglobus-quick-edit-title").each(function(t,a){var e=r(a),a=e.data("language");""!==e.val()&&(o=WPGlobusCore.getString(o,e.val(),a)),WPGlobusAdmin.qedit_titles[i][a].name=e.val(),n[t]=a});var t=r(document).triggerHandler("wpglobus_get_translations",{string:o,lang:n,id:i});void 0!==t&&(o=t),r("input.ptitle").eq(0).attr("value",o),WPGlobusAdmin.qedit_titles[i].source=o}),void 0!==WPGlobusAdmin.data.tags&&r.each(WPGlobusAdmin.data.tags,function(t,a){WPGlobusAdmin.data.value[a].post_id={}}),r("button.save, input#bulk_edit").on("mouseenter",function(t){void 0!==WPGlobusAdmin.data.tags&&(("bulk_edit"==t.currentTarget.id?r("input#bulk_edit"):r("button.save")).unbind("click"),r("button.save, input#bulk_edit").on("click",function(a){var t=r.when(),e=(r(this),r.Deferred());e.resolve(function(t){t.next(".spinner").css({visibility:"visible"}),"bulk_edit"!=a.currentTarget.id&&r.ajaxSetup({async:!1});var o,n,i,l=t.parents("tr"),s=l.attr("id").replace("edit-","");r.each(WPGlobusAdmin.data.tags,function(t,a){if(0==(o=l.find("textarea[name='"+WPGlobusAdmin.data.names[a]+"']")).length)return!0;WPGlobusAdmin.data.value[a].post_id[s]=o.val(),n=WPGlobusAdmin.data.value[a].post_id[s].split(","),i=[];for(var e=0;e<n.length;e++)n[e]=n[e].trim(" "),""!=n[e]&&(void 0===WPGlobusAdmin.data.tag[a][n[e]]?i[e]=n[e]:i[e]=WPGlobusAdmin.data.tag[a][n[e]]);o.val(i.join(", "))})}(r(this))),t=t.then(function(){return r.when(e.done())}).then(function(){"bulk_edit"!=a.currentTarget.id&&setTimeout(function(){inlineEditPost.save(i),r.ajaxSetup({async:!0})},50)})}))}),r("#the-list").on("click","a.editinline",function(){var t=r(this);if(n=t.parents("tr").attr("id"),"post"===o)i=n.replace("post-","");else{if("taxonomy"!==o)return;i=n.replace("tag-","")}"post"===o&&void 0!==WPGlobusAdmin.data.tags&&r.each(WPGlobusAdmin.data.tags,function(t,a){var e,o;""==WPGlobusAdmin.data.value[a]||void 0!==(e=r("#edit-"+i+' textarea[name="'+WPGlobusAdmin.data.names[a]+'"]').val())&&(o=e.split(","),r.each(o,function(t,a){e=e.replace(a,WPGlobusCore.TextFilter(a,WPGlobusCoreData.language))}),r("#edit-"+i+' textarea[name="'+WPGlobusAdmin.data.names[a]+'"]').val(e))});var a=r("#edit-"+i+" input.ptitle").eq(0),t=a.parents("label");a.val(WPGlobusAdmin.qedit_titles[i].source),a.addClass("hidden"),r(WPGlobusAdmin.data.template).insertAfter(t),void 0===WPGlobusAdmin.qedit_titles[i]&&(WPGlobusAdmin.qedit_titles[i]={},WPGlobusAdmin.qedit_titles[i].source=r("#"+n+" .name a.row-title").text(),r(WPGlobusAdmin.data.enabled_languages).each(function(t,a){WPGlobusAdmin.qedit_titles[i][a]={},a==WPGlobusAdmin.data.default_language?WPGlobusAdmin.qedit_titles[i][a].name=WPGlobusAdmin.qedit_titles[i].source:WPGlobusAdmin.qedit_titles[i][a].name="",WPGlobusAdmin.qedit_titles[i][a].description=""})),r(".wpglobus-quick-edit-title").each(function(t,a){var e=r(a),a=e.data("language");e.attr("id",a+i),void 0!==WPGlobusAdmin.qedit_titles[i][a]&&(WPGlobusAdmin.qedit_titles[i][a].name=WPGlobusAdmin.qedit_titles[i][a].name.replace(/\\\'/g,"'"),WPGlobusAdmin.qedit_titles[i][a].name=WPGlobusAdmin.qedit_titles[i][a].name.replace(/\\\"/g,'"'),e.attr("value",WPGlobusAdmin.qedit_titles[i][a].name),WPGlobusAdmin.qedit_titles[i].source=WPGlobusCore.getString(WPGlobusAdmin.qedit_titles[i].source,WPGlobusAdmin.qedit_titles[i][a].name,a))}),r("input.ptitle").eq(0).attr("value",WPGlobusAdmin.qedit_titles[i].source)}))},taxonomyEdit:function(){var a=[];a[0]="name",a[1]="description";r.each(WPGlobusCoreData.enabled_languages,function(t,d){r.each(a,function(t,a){var e,o,n,i,l,s;o=d,n=r("#"+(e=a)),i=n.clone(),l=n.attr("name"),s="wpglobus-element wpglobus-element_"+e+" wpglobus-element_"+o+" wpglobus-translatable",a=(a=document.getElementById(e)).nodeName,r(i).attr("id",e+"_"+o),r(i).attr("name",l+"_"+o),o!==WPGlobusCoreData.default_language&&(s+=" hidden"),r(i).attr("class",s),r(i).attr("data-save-to",e),r(i).attr("data-language",o),"INPUT"==a?r(i).attr("value",r("#wpglobus-link-tab-"+o).data(e)):"TEXTAREA"==a&&r(i).text(r("#wpglobus-link-tab-"+o).data(e)),n.addClass("hidden"),0==r(".wpglobus-element_"+e).length?r(i).insertAfter(n):r(i).insertAfter(r(".wpglobus-element_"+e).last())})}),r(".wpglobus-taxonomy-tabs").insertAfter("#ajax-response"),r(".wrap").tabs(),r("body").on("click",".wpglobus-taxonomy-tabs li",function(t){var a=r(this).data("language");r(".wpglobus-element").addClass("hidden"),r(".wpglobus-element_"+a).removeClass("hidden")}),r(".wpglobus-element").on("change",function(){var o=r(this).data("save-to"),n="";r(".wpglobus-element").each(function(t,a){var e=r(a),a=e.val();e.data("save-to")==o&&""!==a&&(n+=WPGlobusCore.addLocaleMarks(a,e.data("language")))}),r("#"+o).val(n)}),r(WPGlobusAdmin.data.multilingualSlug.title).insertAfter(".term-slug-wrap th label")},navMenus:function(){function e(){n!==r(i).length&&(clearInterval(o),r(i).each(function(t,a){var o,e=r(a);e.hasClass("wpglobus-menu-item")||(o=r(a).attr("id"),r.each(["input.edit-menu-item-title","input.edit-menu-item-attr-title"],function(t,a){var e=r("#"+o+" "+a),a=r(e);a.hasClass("wpglobus-hidden")||(a.addClass("wpglobus-hidden"),a.css("display","none"),e=a.parent("label"),a=a.parents("p"),r(a).css("height","80px"),r(e).append('<div style="color:#f00;">'+WPGlobusAdmin.i18n.save_nav_menu+"</div>"))}),e.addClass("wpglobus-menu-item"))}))}var o,n,i="#menu-to-edit .menu-item";r.ajaxSetup({beforeSend:function(t,a){void 0!==a.data&&0<=a.data.indexOf("action=add-menu-item")&&(n=r(i).length,o=setInterval(e,500))}}),r(i).each(function(t,a){var e=r(a).attr("id"),u=e.replace("menu-item-","");r.each(["input.edit-menu-item-title","input.edit-menu-item-attr-title"],function(n,i){var l=r("#"+e+" "+i);l.val()!=WPGlobusAdmin.data.items[u][i].source&&l.val(WPGlobusAdmin.data.items[u][i].source);var s=r("#"+e+" "+i).parents("p"),d=0;r.each(WPGlobusAdmin.data.open_languages,function(t,a){var e=l.clone();e.attr("id",l.attr("id")+"-"+a),e.attr("name",l.attr("id")+"-"+a),e.attr("data-language",a),e.attr("data-item-id",u),e.attr("placeholder",WPGlobusAdmin.data.en_language_name[a]);var o=WPGlobusAdmin.data.items[u][a][i].class;0===n&&a===WPGlobusAdmin.data.default_language?e.attr("class",o+" edit-menu-item-title"):e.attr("class",o),""!=WPGlobusAdmin.data.items[u][a][i].caption?e.attr("value",WPGlobusAdmin.data.items[u][a][i].caption):e.attr("value",""),e.css("margin-bottom","0.6em"),r(s).append(e),d=t}),d=40*(d+1),l.css("display","none").attr("class","").addClass("widefat wpglobus-hidden"),r(s).css("height",d+"px").addClass("wpglobus-menu-item-box")}),r(a).addClass("wpglobus-menu-item")}),r(".menus-move-left, .menus-move-right").each(function(t,a){var e,o=r(a),n=(o.parents("li").attr("id").replace("menu-item-",""),o.attr("title"));void 0!==n&&r.each(WPGlobusAdmin.data.post_titles,function(t,a){0<=n.indexOf(t)&&(e=n.replace(t,a),o.attr("title",e),o.text(e))})}),r(".edit-menu-item-title").trigger("change"),wpNavMenu.refreshAdvancedAccessibility(),wpNavMenu.menusChanged=!1,r(".wpglobus-menu-item").on("change",function(){var t,a,e=r(this),o=e.data("item-id");e.hasClass("wpglobus-item-title")&&(t=WPGlobusCore.getString(r("input#edit-menu-item-title-"+o).val(),e.val(),e.data("language")),void 0!==(a=r(document).triggerHandler("wpglobus_get_menu_translations",{string:t,lang:WPGlobusCoreData.open_languages,id:o,type:"input.edit-menu-item-title"}))&&(t=a),r("input#edit-menu-item-title-"+o).val(t)),e.hasClass("wpglobus-item-attr")&&(t=WPGlobusCore.getString(r("input#edit-menu-item-attr-title-"+o).val(),e.val(),e.data("language")),void 0!==(a=r(document).triggerHandler("wpglobus_get_menu_translations",{string:t,lang:WPGlobusCoreData.open_languages,id:o,type:"input.edit-menu-item-attr-title"}))&&(t=a),r("input#edit-menu-item-attr-title-"+o).val(t))})},postEdit:function(){r(document).on("heartbeat-send",function(t,o){void 0!==o.wp_autosave&&(o.wpglobus_heartbeat="wpglobus",r.each(WPGlobusAdmin.data.open_languages,function(t,a){var e=r("#title_"+a).val()||"";""!=(e=r.trim(e))&&(o.wp_autosave["post_title_"+a]=e),e=r("#content_"+a).val()||"",""!=(e=r.trim(e))&&(o.wp_autosave["content_"+a]=e)}))});var a,i,l,e="#postdivrich",o=!0,s="#post-body-content";!1===WPGlobusAdmin.data.support.editor&&(o=!(e="#titlediv")),!1===WPGlobusAdmin.data.support.title&&(o=!1),r(s).prepend(r(".wpglobus-post-body-tabs-list")),r.each(WPGlobusAdmin.tabs,function(t,a){"default"===a?(r(e).wrap('<div id="tab-default"></div>'),o&&r(r("#titlediv")).insertBefore(e)):(r(e+"-"+a).wrap('<div id="tab-'+a+'"></div>'),o&&r(r("#titlediv-"+a)).insertBefore(e+"-"+a))}),r(s).addClass("wpglobus-post-body-tabs").tabs({beforeActivate:function(t,a){var e=a.oldTab[0].id.replace("link-tab-",""),a=a.newTab[0].id.replace("link-tab-","");"default"==e&&(e=WPGlobusCoreData.default_language),"default"==a&&(a=WPGlobusCoreData.default_language);a=r(document).triggerHandler("wpglobus_post_body_tabs",[e,a]);return!(!a&&void 0!==a)}}),r("#title").val(WPGlobusAdmin.title),r("#content").text(WPGlobusAdmin.content),"undefined"!=typeof WPGlobusVendor&&WPGlobusVendor.vendor.WPSEO&&("undefined"!=typeof wpglobus_wpseo?wpglobus_wpseo():"undefined"!=typeof WPGlobusYoastSeo&&("undefined"!=typeof WPGlobusYoastSeoPremium&&WPGlobusYoastSeoPremium&&WPGlobusYoastSeoPremium.init(),WPGlobusYoastSeo.init())),WPGlobusAdmin.data.modify_excerpt&&((a=r("#excerpt")).addClass("hidden").css({display:"none"}),r(WPGlobusAdmin.data.template).insertAfter(a),r("body").on("change",".wpglobus-excerpt",function(){var t=r(this);a.val(WPGlobusCore.getString(a.val(),t.val(),t.data("language")))})),void 0!==wp.utils&&void 0!==wp.utils.WordCounter&&(WPGlobusCoreData.wordCounter={},i=this,l={},r.each(WPGlobusCoreData.enabled_languages,function(t,a){return a==WPGlobusCoreData.default_language||(l[t]="content_"+a,n=jQuery,t=new wp.utils.WordCounter,e=a,WPGlobusCoreData.wordCounter[e]={},WPGlobusCoreData.wordCounter[e].counter=t,void n(function(){function o(t){var a;"object"==typeof t&&(t="tinymce"==t?i.getCurrentTab():t.target.id.replace("content_","")),void 0!==WPGlobusCoreData.wordCounter[t]&&(a=!WPGlobusCoreData.wordCounter[t].contentEditor||WPGlobusCoreData.wordCounter[t].contentEditor.isHidden()?WPGlobusCoreData.wordCounter[t].content.val():WPGlobusCoreData.wordCounter[t].contentEditor.getContent({format:"raw"}),(a=WPGlobusCoreData.wordCounter[t].counter.count(a))!==WPGlobusCoreData.wordCounter[t].prevCount&&WPGlobusCoreData.wordCounter[t].count.text(a),WPGlobusCoreData.wordCounter[t].prevCount=a)}WPGlobusCoreData.wordCounter[e].content=n("#content_"+e),WPGlobusCoreData.wordCounter[e].count=n("#wp-word-count-"+e).find(".word-count-"+e),WPGlobusCoreData.wordCounter[e].prevCount=0,n(document).on("tinymce-editor-init",function(t,a){var e;-1!=n.inArray(a.id,l)&&(e=a.id.replace("content_",""),(WPGlobusCoreData.wordCounter[e].contentEditor=a).on("nodechange keyup",_.debounce(o,1e3)))}),WPGlobusCoreData.wordCounter[e].content.on("input keyup",_.debounce(o,1e3)),o(e)}));var n,e})),r(document).on("click","#publish, #save-post",function(){var e,t,o,n;1<WPGlobusAdmin.data.open_languages.length&&(r(document).triggerHandler("wpglobus_before_save_post",{content_tabs_id:s}),e=r("#title").val(),n=o="",0==e.length&&(t=WPGlobusAdmin.data.open_languages.indexOf(WPGlobusAdmin.data.default_language),WPGlobusAdmin.data.open_languages.splice(t,1),r(WPGlobusAdmin.data.open_languages).each(function(t,a){n=0==t?"":"-",0<(e=r("#title_"+a).val()).length&&(0==o.length&&(n=""),o=o+n+e)})),0<o.length&&r("#title").val(o)),void 0===WPGlobusAdmin.data.tagsdiv||WPGlobusAdmin.data.tagsdiv.length<1||r(WPGlobusAdmin.data.tagsdiv).each(function(t,a){if(0==r("#"+a).length)return!0;var e=a.replace("tagsdiv-","");if("undefined"===e)return!0;if(0==r("#tax-input-"+e).length)return!0;var o,n=[];r("#tagsdiv-"+e+" .tagchecklist > span").each(function(t,a){o=(o=r(a).html()).replace(/<button.*<\/button> /,""),void 0===WPGlobusAdmin.data.tag[e][o]?n[t]=o:n[t]=WPGlobusAdmin.data.tag[e][o]}),r("#tax-input-"+e).val(n.join(", "))})}),r(".ui-state-default").on("click",function(){"link-tab-default"===r(this).attr("id")&&(r(window).scrollTop(r(window).scrollTop()+1),r(window).scrollTop(r(window).scrollTop()-1))}),r(document).on("tabsactivate",s,function(t,a){WPGlobusAdmin.currentTab=a.newTab[0].dataset.language}),r(document).triggerHandler("wpglobus_after_post_edit")},adminCentral:function(){r(".wpglobus-admin-central-tab").css({display:"none"}),1<r(".nav-tab-active").length&&r(".wpglobus-about-wrap .nav-tab-wrapper a").removeClass("nav-tab-active");var e=!0;0==location.hash.indexOf("#")&&r(".wpglobus-about-wrap .nav-tab-wrapper a").each(function(t,a){r(a).attr("href")==location.hash&&(e=!1,r(a).addClass("nav-tab-active"))}),e&&r(".wpglobus-about-wrap .nav-tab-wrapper a").eq(0).addClass("nav-tab-active");var t=r(".wpglobus-about-wrap .nav-tab-active").data("tab-id");""!=t&&r("#"+t).css({display:"block"}),r(document).on("click",".wpglobus-about-wrap .nav-tab",function(t){var a=r(this);a.hasClass("nav-tab-active")||(r(".wpglobus-admin-central-tab").css({display:"none"}),r(".wpglobus-about-wrap .nav-tab").removeClass("nav-tab-active"),a.addClass("nav-tab-active"),""!=a.data("tab-id")&&r("#"+a.data("tab-id")).css({display:"block"}))})},start:function(){var a=this;r("#wpglobus_flags").select2({formatResult:this.format,formatSelection:this.format,minimumResultsForSearch:-1,escapeMarkup:function(t){return t}}),r("body").on("click","#enabled_languages-list li:first input",function(t){return t.preventDefault(),r(".redux-save-warn").css({display:"none"}),r("#enabled_languages-list").find("li:first > input").val("1"),0===r("#disable_first_language").length&&r(a.config.disable_first_language).insertAfter("#info_bar"),!1})},format:function(t){return'<img class="wpglobus_flag" src="'+WPGlobusAdmin.flag_url+t.text+'"/> '+t.text},set_dialog:function(){var o,a,n;void 0!==WPGlobusAdmin.data.customFieldsEnabled&&(WPGlobusAdmin.data.customFieldsEnabled=this.parseBool(WPGlobusAdmin.data.customFieldsEnabled),!WPGlobusAdmin.data.customFieldsEnabled)||(a=!1,(n=function(t){var l,s,d="wpglobus_dialog_start wpglobus_dialog_icon",u=['<div class="wpglobus_dialog_options_wrapper hidden">','<input style="width:initial;" id="wpglobus-cb-{{id}}" data-object="#wpglobus-dialog-start-{{id}}" data-meta-key="{{meta-key}}" class="wpglobus_dialog_option wpglobus_dialog_cb" type="checkbox" {{checked}} />',"</div>"].join(""),t=void 0===t?"#the-list tr":"#the-list tr#"+t;r(t).each(function(){var t,a,e=r(this),o=e.attr("id"),n=e.find("textarea"),i=d;if(void 0===(l=n.attr("id")))return!0;a=r("#"+o+"-key").val(),t=r("#"+l).clone(),r(n).addClass("wpglobus-dialog-field-source hidden"),o=n.attr("name"),r(t).attr("id","wpglobus-"+l),r(t).attr("name","wpglobus-"+o),r(t).attr("data-source-id",l),r(t).attr("class","wpglobus-dialog-field"),r(t).val(WPGlobusCore.TextFilter(r(n).val(),WPGlobusCoreData.language)),r(t).insertAfter(n),s=(s=u.replace(/{{id}}/g,l)).replace(/{{meta-key}}/g,a),void 0===WPGlobusAdmin.data.post_meta_settings[WPGlobusAdmin.data.post_type]?s=s.replace(/{{checked}}/,"checked"):i=void 0!==WPGlobusAdmin.data.post_meta_settings[WPGlobusAdmin.data.post_type][a]&&"false"==WPGlobusAdmin.data.post_meta_settings[WPGlobusAdmin.data.post_type][a]?(s=s.replace(/{{checked}}/,""),d+" wpglobus_dialog_start_hidden"):(s=s.replace(/{{checked}}/,"checked"),d),e.append('<td style="width:20px;"><div id="wpglobus-dialog-start-'+l+'" data-type="control" data-source-type="textarea" data-source-id="'+l+'" class="'+i+'"></div>'+s+"</td>")}),!a&&0<r("#list-table .wpglobus_dialog_start").length&&(r("#list-table thead tr").append('<th class="wpglobus-control-head"><div class="wpglobus_dialog_settings wpglobus_dialog_icon"></div></th>'),a=!0)})(),r("body").on("change",".wpglobus-dialog-field",function(){var e,o,n=r(this),t="#"+n.data("source-id"),i="";e=r(t).val(),/(\{:|\[:|<!--:)[a-z]{2}/.test(e)?(r.each(WPGlobusCoreData.enabled_languages,function(t,a){""!=(o=a==WPGlobusCoreData.language?n.val():WPGlobusCore.TextFilter(e,a,"RETURN_EMPTY"))&&(i+=WPGlobusCore.addLocaleMarks(o,a))}),r(t).val(i)):r(t).val(n.val())}),r(document).ajaxSend(function(t,a,e){"add-meta"==e.action&&(o=e.element)}),r(document).ajaxComplete(function(t,a,e){"add-meta"==e.action&&void 0!==a.responseXML&&n("newmeta"==o?"meta-"+r(a.responseXML.documentElement.outerHTML).find("meta").attr("id"):o)}),WPGlobusDialogApp.init({dialogTitle:"Edit meta"}))}},new t.App,t)});
|
includes/js/wpglobus-admin-49.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var WPGlobusCore,WPGlobusDialogApp;!function(i){var d=WPGlobusCore={strpos:function(t,a,e){var o=(t=""+t).indexOf(a,e);return 0<=o&&o},TextFilter:function(t,a,e){if(void 0===t||""===t)return t;var o,n,i=[],l=!1;a=""==a?"en":a,e=void 0===e||""==e?"RETURN_IN_DEFAULT_LANGUAGE":e,i[0]=[],i[0].start=WPGlobusCoreData.locale_tag_start.replace("%s",a),i[0].end=WPGlobusCoreData.locale_tag_end,i[1]=[],i[1].start="\x3c!--:"+a+"--\x3e",i[1].end="\x3c!--:--\x3e",i[2]=[],i[2].start="[:"+a+"]",i[2].end="[:";for(var s=0;s<3;s++)if(!1!==(o=d.strpos(t,i[s].start))){o+=i[s].start.length,t=!1===(n=d.strpos(t,i[s].end,o))?t.substr(o):t.substr(o,n-o),l=!0;break}return l||("RETURN_EMPTY"==e?a==WPGlobusCoreData.default_language&&!/(\{:|\[:|<!--:)[a-z]{2}/.test(t)||(t=""):a==WPGlobusCoreData.default_language?/(\{:|\[:|<!--:)[a-z]{2}/.test(t)&&(t=""):t=d.TextFilter(t,WPGlobusCoreData.default_language)),t},addLocaleMarks:function(t,a){return WPGlobusCoreData.locale_tag_start.replace("%s",a)+t+WPGlobusCoreData.locale_tag_end},getTranslations:function(e){var o,n={};return i.each(WPGlobusCoreData.enabled_languages,function(t,a){o=a==WPGlobusCoreData.default_language?"RETURN_IN_DEFAULT_LANGUAGE":"RETURN_EMPTY",n[a]=d.TextFilter(e,a,o)}),n},getString:function(t,a,e){if(void 0===t)return t;void 0===a&&(a=""),void 0===e&&(e=WPGlobusCoreData.language),(t=d.getTranslations(t))[e]=a;var o="";return i.each(t,function(t,a){""!=a&&t!=WPGlobusCoreData.default_language&&(o+=d.addLocaleMarks(a,t))}),""!=t[WPGlobusCoreData.default_language]&&(o=""==o?t[WPGlobusCoreData.default_language]:d.addLocaleMarks(t[WPGlobusCoreData.default_language],WPGlobusCoreData.default_language)+o),o}}}(jQuery),function(m){var v=WPGlobusDialogApp={option:{listenClass:".wpglobus_dialog_start",settingsClass:".wpglobus_dialog_settings",dialogTabs:"#wpglobus-dialog-tabs",dialogTitle:"",customData:null,callback:function(){},dialogOptions:{title:"",placeholder:"",formFooter:"",beforeOpen:function(){},close:function(){}},dialog:{}},form:void 0,element:void 0,element_by:"id",id:"",clone_id:"",wpglobus_id:"",type:"textarea",source:"",order:{},value:{},request:"core",attrs:{},dialogTitle:"",trClass:"wpglobus-translatable",startButton:['<span id="wpglobus-dialog-start-{{clone_id}}" ','style="{{style}}" ','data-type="control" data-dialog-title="{{title}}" ','data-source-type="" data-source-id="{{id}}" data-source-name="{{name}}" ','data-nodename="{{nodename}}"',"{{sbTitle}} ",'class="{{classes}}"></span>'].join(""),startButtonClass:"wpglobus_dialog_start wpglobus_dialog_icon",clicks:0,init:function(t){v.option.dialog=v.option.dialogOptions,v.option=m.extend(v.option,t),m(v.option.dialogTabs).tabs(),v.dialogTitle=v.option.dialogTitle,this.attachListener(),null!=v.option.customData&&void 0!==v.option.customData.addElements&&m.each(v.option.customData.addElements,function(t,a){v.addElement(a)})},convertToId:function(t){return t=(t=t.replace(/\]/g,"")).replace(/\[/g,"-")},addElement:function(t){var a={id:null,style:"",styleTextareaWrapper:"",sbTitle:"",onChangeClass:"",dialogTitle:"",dialog:v.option.dialogOptions};if("string"==typeof t)a.id=t;else{if("object"!=typeof t)return;a=m.extend(a,t)}var e,o,n,i=null,l=null,s=null,d=null,u=v.startButton,r="";if(v.element_by="name",0==(d=document.getElementsByName(a.id)).length&&(v.element_by="id",d=document.getElementById(a.id)),null!==d){if(l=a.id,s=void 0===(i="id"==v.element_by?m("#"+l):(r=(r=d[0].nodeName).toLowerCase(),m(r+'[name="'+l+'"]'))).attr("name")||""==i.attr("name")?l:i.attr("name"),v.clone_id=v.convertToId(l),-1!=s.indexOf("wpglobus")||-1!=v.clone_id.indexOf("wpglobus"))return!1;if(0<m("#wpglobus-"+v.clone_id).length)return!1;if(0<m(r+'[name="wpglobus-'+s+'"]').length)return!1;e=m(i.clone()),n=i.attr("style")||"",i.attr("style","display:none;"),e.attr("id","wpglobus-"+v.clone_id).attr("name","wpglobus-"+s),e.addClass(v.trClass),""!=a.onChangeClass&&e.addClass(a.onChangeClass),"id"==v.element_by?e.attr("data-source-id",l).attr("data-source-name","").attr("data-source-get-by",v.element_by):e.attr("data-source-id","").attr("data-source-name",s).attr("data-source-get-by",v.element_by),"textarea"==r?(o=WPGlobusCore.getTranslations(i.val())[WPGlobusCoreData.language],e.val(o),e.attr("data-nodename","textarea"),""==a.style?e.attr("style",n+";width:95%;float:left;"):e.attr("style",n+";"+a.style)):(o=WPGlobusCore.getTranslations(i.val())[WPGlobusCoreData.language],e.attr("value",o),e.attr("data-nodename","input"),""!=a.style&&e.attr("style",n+";"+a.style)),""!=a.dialog&&e.attr("data-dialog",JSON.stringify(a.dialog)),u=u.replace(/{{clone_id}}/g,v.clone_id),u="id"==v.element_by?(u=(u=u.replace(/{{id}}/g,v.clone_id)).replace(/{{name}}/g,"")).replace(/{{nodename}}/g,""):(u=(u=u.replace(/{{id}}/g,"")).replace(/{{name}}/g,s)).replace(/{{nodename}}/g,r),u="textarea"==r?u.replace("{{style}}","float:left;margin-top:0;"):u.replace("{{style}}","");var c="textarea"==r?v.startButtonClass+" wpglobus-textarea wpglobus-textarea-"+v.clone_id:v.startButtonClass,u=u.replace("{{classes}}",c);u=""==a.dialogTitle?u.replace("{{title}}",v.dialogTitle):u.replace("{{title}}",a.dialogTitle),u=""==a.sbTitle?u.replace("{{sbTitle}}",a.sbTitle):u.replace("{{sbTitle}}",'title="'+a.sbTitle+'"'),m(u).insertAfter(i),m(e).insertAfter(i),"textarea"==r&&(m("#wpglobus-"+v.clone_id).addClass("wpglobus-textarea-"+v.clone_id),m(".wpglobus-textarea-"+v.clone_id).wrapAll('<div class="wpglobus-textarea-wrapper" style="'+a.styleTextareaWrapper+'"></div>'));var g,p,b=!1;return(""==a.onChangeClass?g="#wpglobus-"+v.clone_id:(g="."+a.onChangeClass,void 0===(p=m._data(m(document)[0],"events"))?b=!0:void 0!==p.change&&m.each(p.change,function(t,a){if(a.selector==g)return!(b=!0)})),b)?!0:(m(document).on("change",g,function(){var t=m(this),a=""==(a=t.data("source-id"))?t.data("nodename")+'[name="'+t.data("source-name")+'"]':"#"+a;m(a).val(WPGlobusCore.getString(m(a).val(),t.val()))}),!0)}},saveDialog:function(){var e,o,n,i="",l="",s="";m(".wpglobus_dialog_textarea").each(function(t,a){e=m(a),o=e.val(),(n=e.data("language"))==WPGlobusAdmin.data.language&&(s=o),""!=o&&(i+=WPGlobusCore.addLocaleMarks(o,n),n==WPGlobusCoreData.default_language&&(l=o))}),i=i.length==l.length+8?l:i,m(v.id).val(i),i=""==s?l:s,m(v.wpglobus_id).val(i)},dialog:m("#wpglobus-dialog-wrapper").dialog({autoOpen:!1,width:650,modal:!0,dialogClass:"wpglobus-dialog",buttons:[{text:"Save",class:"wpglobus-button-save",click:function(){v.saveDialog(),v.dialog.dialog("close")}},{text:"Cancel",class:"wpglobus-button-cancel",click:function(){v.dialog.dialog("close")}}],open:function(t,a){var e=v.dialogTitle;void 0!==v.attrs.maxlength&&(m(".wpglobus_dialog_textarea").attr("maxlength",v.attrs.maxlength),e+=" | maxlength="+v.attrs.maxlength),m(".wpglobus-dialog .ui-dialog-title").text(e)},close:function(){v.runCallback(v.option.dialog.close),v.form[0].reset()}}),attachListener:function(){m(document).on("click",v.option.settingsClass,function(){m(".wpglobus_dialog_options_wrapper").hasClass("hidden")?m(".wpglobus_dialog_options_wrapper").removeClass("hidden"):m(".wpglobus_dialog_options_wrapper").addClass("hidden")}),m(document).on("click",".wpglobus_dialog_option",function(t){var a=m(this),e=a.data("object");v.order.action="save_post_meta_settings",v.order.post_type=WPGlobusAdmin.data.post_type,v.order.checked=a.prop("checked"),v.order.id=a.attr("id"),v.order.meta_key=a.data("meta-key"),v.ajax(v.order).done(function(t){"ok"==t.result&&("true"==t.checked?m(e).removeClass("wpglobus_dialog_start_hidden"):m(e).addClass("wpglobus_dialog_start_hidden"))}).fail(function(t){}).always(function(t,a){})}),m(document).on("click",v.option.listenClass,function(a){v.element=m(this),v.id=v.element.data("source-id"),""==v.id?(v.id=v.element.data("nodename")+'[name="'+v.element.data("source-name")+'"]',v.wpglobus_id="#wpglobus-"+v.convertToId(v.element.data("source-name"))):(v.wpglobus_id="#wpglobus-"+v.id,v.id="#"+v.id),v.clicks++,1==v.clicks&&setTimeout(function(){var t;1==v.clicks?v.onClick(a):(t=m(v.id)).hasClass("hidden")?t.removeClass("hidden").attr("style","display:block;"):t.addClass("hidden").attr("style","display:none;"),v.clicks=0},200)}),v.form=v.dialog.find("form#wpglobus-dialog-form").on("submit",function(t){t.preventDefault(),v.saveDialog()})},ajax:function(t){return m.ajax({type:"POST",url:WPGlobusAdmin.ajaxurl,data:{action:WPGlobusAdmin.process_ajax,order:t},dataType:"json",async:!1})},onClick:function(t){void 0===v.element.data("dialog-title")||""==v.element.data("dialog-title")?v.dialogTitle=v.option.dialogTitle:v.dialogTitle=v.element.data("dialog-title"),void 0!==v.id&&(v.attrs.maxlength=m(v.id).attr("maxlength")),v.source=v.element.data("source-value"),void 0===v.source&&(v.source=m(v.id).val(),"ajax"==v.request||(v.value=WPGlobusCore.getTranslations(v.source))),v.option.dialog=m.extend({},v.option.dialogOptions,m(v.wpglobus_id).data("dialog")),""!=v.option.dialog.title&&(v.dialogTitle=v.option.dialog.title),m.each(v.value,function(t,a){var e=m("#wpglobus-dialog-"+t);e.val(a),e.attr("placeholder",WPGlobusCore.TextFilter(v.option.dialog.placeholder,t,"RETURN_IN_DEFAULT_LANGUAGE"))}),m("#wpglobus-dialog-form-footer").html(v.option.dialog.formFooter),v.runCallback(v.option.dialog.beforeOpen),v.dialog.dialog("open")},runCallback:function(t){var a,e;"object"==typeof t?(a=Object.keys(t)[0],e=t[Object.keys(t)[0]],"window"===a?"function"==typeof window[e]&&window[e](t[Object.keys(t)[1]]):"function"==typeof window[a][e]&&window[a][e](t[Object.keys(t)[1]])):"string"==typeof t&&"function"==typeof window[t]&&window[t]()}}}(jQuery),jQuery(document).ready(function(){"use strict";var t,c;window.WPGlobusAdminApp=(t=window.WPGlobusAdminApp||{},c=jQuery,t.App=function(t){void 0===window.WPGlobusAdminApp&&(this.config={debug:!1,version:WPGlobusAdmin.version},this.status="ok","undefined"==typeof WPGlobusAdmin?(this.status="error",this.config.debug&&console.log("WPGlobus: error options loading")):this.config.debug&&console.dir(WPGlobusAdmin),this.config.disable_first_language=['<div id="disable_first_language" style="display:block;" class="redux-field-errors notice-red">',"<strong>","<span> </span>",WPGlobusAdmin.i18n.cannot_disable_language,"</strong>","</div>"].join(""),c.extend(this.config,t),"ok"===this.status&&this.init())},t.App.prototype={$document:c(document),init:function(){WPGlobusCoreData.multisite=this.parseBool(WPGlobusCoreData.multisite),this.adminInit(),c("#content").addClass("wpglobus-editor").attr("data-language",WPGlobusAdmin.data.default_language),c("textarea[id^=content_]").each(function(t,a){var e=c(a).attr("id").replace("content_","");c(a).attr("data-language",e)}),"post.php"===WPGlobusAdmin.page?(this.postEdit(),this.set_dialog(),"undefined"!=typeof WPGlobusAioseop&&WPGlobusAioseop.init()):"menu-edit"===WPGlobusAdmin.page?(WPGlobusDialogApp.init({dialogTitle:"Edit description"}),this.navMenus()):"taxonomy-edit"===WPGlobusAdmin.page?WPGlobusAdmin.data.tag_id&&this.taxonomyEdit():"taxonomy-quick-edit"===WPGlobusAdmin.page?this.quickEdit("taxonomy"):"edit.php"===WPGlobusAdmin.page?(this.quickEdit("post"),0<_.size(WPGlobusAdmin.$_get)&&WPGlobusDialogApp.init()):"options-general.php"==WPGlobusAdmin.page?(this.optionsGeneral(),WPGlobusDialogApp.init({customData:WPGlobusCoreData.page_custom_data})):"widgets.php"==WPGlobusAdmin.page?(WPGlobusWidgets.init(),WPGlobusDialogApp.init({dialogTitle:"Edit text"})):"wpglobus_options"==WPGlobusAdmin.page?this.start():"wpglobusAdminCentral"==WPGlobusAdmin.page?this.adminCentral():WPGlobusDialogApp.init({customData:WPGlobusCoreData.page_custom_data})},parseBool:function(t){return!/^(false|0)$/i.test(t)&&!!t},getCurrentTab:function(){return c(".wpglobus-post-body-tabs-list .ui-tabs-active").data("language")},adminInit:function(){var t,a=c(".wpglobus-addons-group a").data("key");void 0!==a&&(0<=window.location.search.indexOf("page=wpglobus_options&tab="+a)?WPGlobusCoreData.multisite?window.location=WPGlobusCoreData.pluginInstallLocation.multisite:window.location=WPGlobusCoreData.pluginInstallLocation.single:(t=c("#toplevel_page_wpglobus_options li").eq(a+1),WPGlobusCoreData.multisite?c(t).find("a").attr("href",WPGlobusCoreData.pluginInstallLocation.multisite).attr("onclick","window.location=jQuery(this).attr('href');return false;"):c(t).find("a").attr("href",WPGlobusCoreData.pluginInstallLocation.single).attr("onclick","window.location=jQuery(this).attr('href');return false;")))},optionsGeneral:function(){var o=c("#blogname"),t=c("body");o.addClass("hidden"),c("#wpglobus-blogname").insertAfter(o).removeClass("hidden"),t.on("blur",".wpglobus-blogname",function(){c(".wpglobus-blogname").each(function(t,a){var e=c(a);o.val(WPGlobusCore.getString(o.val(),e.val(),e.data("language")))})});var n=c("#blogdescription");n.addClass("hidden"),c("#wpglobus-blogdescription").insertAfter(n).removeClass("hidden"),t.on("blur",".wpglobus-blogdesc",function(){c(".wpglobus-blogdesc").each(function(t,a){var e=c(a);n.val(WPGlobusCore.getString(n.val(),e.val(),e.data("language")))})})},quickEdit:function(n){var o,l,i,t;void 0!==WPGlobusAdmin.data.has_items&&WPGlobusAdmin.data.has_items&&(o="",l=0,c(document).ajaxComplete(function(t,a,e){void 0!==e.data&&""!=o&&0<=e.data.indexOf("action=inline-save-tax&")&&(c("#"+o+" a.row-title").text(WPGlobusAdmin.qedit_titles[l][WPGlobusAdmin.data.language].name),c("#"+o+" .description").text(WPGlobusAdmin.qedit_titles[l][WPGlobusAdmin.data.language].description))}),i={},c("#the-list tr").each(function(t,a){var e=c(a),o="post"===n?"post-":"tag-";l=e.attr("id").replace(o,""),i[l]={},"post"===n?i[l].source=e.find(".post_title").text():"taxonomy"===n&&(i[l].source=c("#inline_"+l+" .name").text())}),(t={action:"get_titles"}).type=n,t.taxonomy=void 0!==WPGlobusAdmin.data.taxonomy&&WPGlobusAdmin.data.taxonomy,t.title=i,c.ajax({type:"POST",url:WPGlobusAdmin.ajaxurl,data:{action:WPGlobusAdmin.process_ajax,order:t},dataType:"json"}).done(function(t){WPGlobusAdmin.qedit_titles=t.qedit_titles,c.each(t.bulkedit_post_titles,function(t,a){c("#inline_"+t+" .post_title").text(a[WPGlobusAdmin.data.language].name)})}).fail(function(t){}).always(function(t,a){}),c("body").on("change",".wpglobus-quick-edit-title",function(){var n="",i=[];c(".wpglobus-quick-edit-title").each(function(t,a){var e=c(a),o=e.data("language");""!==e.val()&&(n=WPGlobusCore.getString(n,e.val(),o)),WPGlobusAdmin.qedit_titles[l][o].name=e.val(),i[t]=o});var t=c(document).triggerHandler("wpglobus_get_translations",{string:n,lang:i,id:l});void 0!==t&&(n=t),c("input.ptitle").eq(0).attr("value",n),WPGlobusAdmin.qedit_titles[l].source=n}),void 0!==WPGlobusAdmin.data.tags&&c.each(WPGlobusAdmin.data.tags,function(t,a){WPGlobusAdmin.data.value[a].post_id={}}),c("button.save, input#bulk_edit").on("mouseenter",function(t){void 0!==WPGlobusAdmin.data.tags&&("bulk_edit"==t.currentTarget.id?c("input#bulk_edit").unbind("click"):c("button.save").unbind("click"),c("button.save, input#bulk_edit").on("click",function(a){var t=c.when(),e=(c(this),c.Deferred());e.resolve(function(t){t.next(".spinner").css({visibility:"visible"}),"bulk_edit"!=a.currentTarget.id&&c.ajaxSetup({async:!1});var o,n,i,l=t.parents("tr"),s=l.attr("id").replace("edit-","");c.each(WPGlobusAdmin.data.tags,function(t,a){if(0==(o=l.find("textarea[name='"+WPGlobusAdmin.data.names[a]+"']")).length)return!0;WPGlobusAdmin.data.value[a].post_id[s]=o.val(),n=WPGlobusAdmin.data.value[a].post_id[s].split(","),i=[];for(var e=0;e<n.length;e++)n[e]=n[e].trim(" "),""!=n[e]&&(void 0===WPGlobusAdmin.data.tag[a][n[e]]?i[e]=n[e]:i[e]=WPGlobusAdmin.data.tag[a][n[e]]);o.val(i.join(", "))})}(c(this))),t=t.then(function(){return c.when(e.done())}).then(function(){"bulk_edit"!=a.currentTarget.id&&setTimeout(function(){inlineEditPost.save(l),c.ajaxSetup({async:!0})},50)})}))}),c("#the-list").on("click","a.editinline",function(){var t=c(this);if(o=t.parents("tr").attr("id"),"post"===n)l=o.replace("post-","");else{if("taxonomy"!==n)return;l=o.replace("tag-","")}"post"===n&&void 0!==WPGlobusAdmin.data.tags&&c.each(WPGlobusAdmin.data.tags,function(t,a){var e,o;""==WPGlobusAdmin.data.value[a]||void 0!==(e=c("#edit-"+l+' textarea[name="'+WPGlobusAdmin.data.names[a]+'"]').val())&&(o=e.split(","),c.each(o,function(t,a){e=e.replace(a,WPGlobusCore.TextFilter(a,WPGlobusCoreData.language))}),c("#edit-"+l+' textarea[name="'+WPGlobusAdmin.data.names[a]+'"]').val(e))});var a=c("#edit-"+l+" input.ptitle").eq(0),e=a.parents("label");a.val(WPGlobusAdmin.qedit_titles[l].source),a.addClass("hidden"),c(WPGlobusAdmin.data.template).insertAfter(e),void 0===WPGlobusAdmin.qedit_titles[l]&&(WPGlobusAdmin.qedit_titles[l]={},WPGlobusAdmin.qedit_titles[l].source=c("#"+o+" .name a.row-title").text(),c(WPGlobusAdmin.data.enabled_languages).each(function(t,a){WPGlobusAdmin.qedit_titles[l][a]={},a==WPGlobusAdmin.data.default_language?WPGlobusAdmin.qedit_titles[l][a].name=WPGlobusAdmin.qedit_titles[l].source:WPGlobusAdmin.qedit_titles[l][a].name="",WPGlobusAdmin.qedit_titles[l][a].description=""})),c(".wpglobus-quick-edit-title").each(function(t,a){var e=c(a),o=e.data("language");e.attr("id",o+l),void 0!==WPGlobusAdmin.qedit_titles[l][o]&&(WPGlobusAdmin.qedit_titles[l][o].name=WPGlobusAdmin.qedit_titles[l][o].name.replace(/\\\'/g,"'"),WPGlobusAdmin.qedit_titles[l][o].name=WPGlobusAdmin.qedit_titles[l][o].name.replace(/\\\"/g,'"'),e.attr("value",WPGlobusAdmin.qedit_titles[l][o].name),WPGlobusAdmin.qedit_titles[l].source=WPGlobusCore.getString(WPGlobusAdmin.qedit_titles[l].source,WPGlobusAdmin.qedit_titles[l][o].name,o))}),c("input.ptitle").eq(0).attr("value",WPGlobusAdmin.qedit_titles[l].source)}))},taxonomyEdit:function(){var a=[];a[0]="name",a[1]="description";c.each(WPGlobusCoreData.enabled_languages,function(t,u){c.each(a,function(t,a){var e,o,n,i,l,s,d;o=u,n=c("#"+(e=a)),i=n.clone(),l=n.attr("name"),s="wpglobus-element wpglobus-element_"+e+" wpglobus-element_"+o+" wpglobus-translatable",d=(d=document.getElementById(e)).nodeName,c(i).attr("id",e+"_"+o),c(i).attr("name",l+"_"+o),o!==WPGlobusCoreData.default_language&&(s+=" hidden"),c(i).attr("class",s),c(i).attr("data-save-to",e),c(i).attr("data-language",o),"INPUT"==d?c(i).attr("value",c("#wpglobus-link-tab-"+o).data(e)):"TEXTAREA"==d&&c(i).text(c("#wpglobus-link-tab-"+o).data(e)),n.addClass("hidden"),0==c(".wpglobus-element_"+e).length?c(i).insertAfter(n):c(i).insertAfter(c(".wpglobus-element_"+e).last())})}),c(".wpglobus-taxonomy-tabs").insertAfter("#ajax-response"),c(".wrap").tabs(),c("body").on("click",".wpglobus-taxonomy-tabs li",function(t){var a=c(this).data("language");c(".wpglobus-element").addClass("hidden"),c(".wpglobus-element_"+a).removeClass("hidden")}),c(".wpglobus-element").on("change",function(){var n=c(this).data("save-to"),i="";c(".wpglobus-element").each(function(t,a){var e=c(a),o=e.val();e.data("save-to")==n&&""!==o&&(i+=WPGlobusCore.addLocaleMarks(o,e.data("language")))}),c("#"+n).val(i)}),c(WPGlobusAdmin.data.multilingualSlug.title).insertAfter(".term-slug-wrap th label")},navMenus:function(){function e(){n!==c(i).length&&(clearInterval(o),c(i).each(function(t,a){var l,e=c(a);e.hasClass("wpglobus-menu-item")||(l=c(a).attr("id"),c.each(["input.edit-menu-item-title","input.edit-menu-item-attr-title"],function(t,a){var e,o,n=c("#"+l+" "+a),i=c(n);i.hasClass("wpglobus-hidden")||(i.addClass("wpglobus-hidden"),i.css("display","none"),e=i.parent("label"),o=i.parents("p"),c(o).css("height","80px"),c(e).append('<div style="color:#f00;">'+WPGlobusAdmin.i18n.save_nav_menu+"</div>"))}),e.addClass("wpglobus-menu-item"))}))}var o,n,i="#menu-to-edit .menu-item";c.ajaxSetup({beforeSend:function(t,a){void 0!==a.data&&0<=a.data.indexOf("action=add-menu-item")&&(n=c(i).length,o=setInterval(e,500))}}),c(i).each(function(t,a){var e=c(a).attr("id"),u=e.replace("menu-item-","");c.each(["input.edit-menu-item-title","input.edit-menu-item-attr-title"],function(n,i){var l=c("#"+e+" "+i);l.val()!=WPGlobusAdmin.data.items[u][i].source&&l.val(WPGlobusAdmin.data.items[u][i].source);var s=c("#"+e+" "+i).parents("p"),d=0;c.each(WPGlobusAdmin.data.open_languages,function(t,a){var e=l.clone();e.attr("id",l.attr("id")+"-"+a),e.attr("name",l.attr("id")+"-"+a),e.attr("data-language",a),e.attr("data-item-id",u),e.attr("placeholder",WPGlobusAdmin.data.en_language_name[a]);var o=WPGlobusAdmin.data.items[u][a][i].class;0===n&&a===WPGlobusAdmin.data.default_language?e.attr("class",o+" edit-menu-item-title"):e.attr("class",o),""!=WPGlobusAdmin.data.items[u][a][i].caption?e.attr("value",WPGlobusAdmin.data.items[u][a][i].caption):e.attr("value",""),e.css("margin-bottom","0.6em"),c(s).append(e),d=t}),d=40*(d+1),l.css("display","none").attr("class","").addClass("widefat wpglobus-hidden"),c(s).css("height",d+"px").addClass("wpglobus-menu-item-box")}),c(a).addClass("wpglobus-menu-item")}),c(".menus-move-left, .menus-move-right").each(function(t,a){var e,o=c(a),n=(o.parents("li").attr("id").replace("menu-item-",""),o.attr("title"));void 0!==n&&c.each(WPGlobusAdmin.data.post_titles,function(t,a){0<=n.indexOf(t)&&(e=n.replace(t,a),o.attr("title",e),o.text(e))})}),c(".edit-menu-item-title").trigger("change"),wpNavMenu.refreshAdvancedAccessibility(),wpNavMenu.menusChanged=!1,c(".wpglobus-menu-item").on("change",function(){var t,a,e=c(this),o=e.data("item-id");e.hasClass("wpglobus-item-title")&&(t=WPGlobusCore.getString(c("input#edit-menu-item-title-"+o).val(),e.val(),e.data("language")),void 0!==(a=c(document).triggerHandler("wpglobus_get_menu_translations",{string:t,lang:WPGlobusCoreData.open_languages,id:o,type:"input.edit-menu-item-title"}))&&(t=a),c("input#edit-menu-item-title-"+o).val(t)),e.hasClass("wpglobus-item-attr")&&(t=WPGlobusCore.getString(c("input#edit-menu-item-attr-title-"+o).val(),e.val(),e.data("language")),void 0!==(a=c(document).triggerHandler("wpglobus_get_menu_translations",{string:t,lang:WPGlobusCoreData.open_languages,id:o,type:"input.edit-menu-item-attr-title"}))&&(t=a),c("input#edit-menu-item-attr-title-"+o).val(t))});var a=[];setTimeout(function(){c(".edit-menu-item-description").each(function(){var t=c(this).attr("id");a.push(t),WPGlobusDialogApp.addElement(t)}),c(".wpglobus_dialog_start").each(function(){c(this).css({"font-style":"normal"}),c(this).after("<br />")});var t={action:"getNavMenuItemsDescription"};t.menuItems=a,c.ajax({type:"POST",url:WPGlobusAdmin.ajaxurl,data:{action:WPGlobusAdmin.process_ajax,order:t},dataType:"json"}).done(function(t){"object"==typeof t&&c.each(t,function(t,a){""!=a&&(c("#"+t).val(a),c("#wpglobus-"+t).val(WPGlobusCore.TextFilter(a,WPGlobus.language,"RETURN_EMPTY")))})}).fail(function(t){}).always(function(t,a){})},1e3)},postEdit:function(){c(document).on("heartbeat-send",function(t,o){void 0!==o.wp_autosave&&(o.wpglobus_heartbeat="wpglobus",c.each(WPGlobusAdmin.data.open_languages,function(t,a){var e=c("#title_"+a).val()||"";""!=(e=c.trim(e))&&(o.wp_autosave["post_title_"+a]=e),e=c("#content_"+a).val()||"",""!=(e=c.trim(e))&&(o.wp_autosave["content_"+a]=e)}))});var a,l,s,e="#postdivrich",o=!0,i="#post-body-content";!1===WPGlobusAdmin.data.support.editor&&(o=!(e="#titlediv")),!1===WPGlobusAdmin.data.support.title&&(o=!1),c(i).prepend(c(".wpglobus-post-body-tabs-list")),c.each(WPGlobusAdmin.tabs,function(t,a){"default"===a?(c(e).wrap('<div id="tab-default"></div>'),o&&c(c("#titlediv")).insertBefore(e)):(c(e+"-"+a).wrap('<div id="tab-'+a+'"></div>'),o&&c(c("#titlediv-"+a)).insertBefore(e+"-"+a))}),c(i).addClass("wpglobus-post-body-tabs").tabs({beforeActivate:function(t,a){var e=a.oldTab[0].id.replace("link-tab-",""),o=a.newTab[0].id.replace("link-tab-","");"default"==e&&(e=WPGlobusCoreData.default_language),"default"==o&&(o=WPGlobusCoreData.default_language);var n=c(document).triggerHandler("wpglobus_post_body_tabs",[e,o]);return!(!n&&void 0!==n)}}),c("#title").val(WPGlobusAdmin.title),c("#content").text(WPGlobusAdmin.content),"undefined"!=typeof WPGlobusVendor&&WPGlobusVendor.vendor.WPSEO&&("undefined"!=typeof wpglobus_wpseo?wpglobus_wpseo():"undefined"!=typeof WPGlobusYoastSeo&&("undefined"!=typeof WPGlobusYoastSeoPremium&&WPGlobusYoastSeoPremium&&WPGlobusYoastSeoPremium.init(),WPGlobusYoastSeo.init())),WPGlobusAdmin.data.modify_excerpt&&((a=c("#excerpt")).addClass("hidden").css({display:"none"}),c(WPGlobusAdmin.data.template).insertAfter(a),c("body").on("change",".wpglobus-excerpt",function(){var t=c(this);a.val(WPGlobusCore.getString(a.val(),t.val(),t.data("language")))})),void 0!==wp.utils&&void 0!==wp.utils.WordCounter&&(WPGlobusCoreData.wordCounter={},l=this,s={},c.each(WPGlobusCoreData.enabled_languages,function(t,a){return a==WPGlobusCoreData.default_language||(s[t]="content_"+a,n=jQuery,e=new wp.utils.WordCounter,i=a,WPGlobusCoreData.wordCounter[i]={},WPGlobusCoreData.wordCounter[i].counter=e,void n(function(){function o(t){var a,e;"object"==typeof t&&(t="tinymce"==t?l.getCurrentTab():t.target.id.replace("content_","")),void 0!==WPGlobusCoreData.wordCounter[t]&&(a=!WPGlobusCoreData.wordCounter[t].contentEditor||WPGlobusCoreData.wordCounter[t].contentEditor.isHidden()?WPGlobusCoreData.wordCounter[t].content.val():WPGlobusCoreData.wordCounter[t].contentEditor.getContent({format:"raw"}),(e=WPGlobusCoreData.wordCounter[t].counter.count(a))!==WPGlobusCoreData.wordCounter[t].prevCount&&WPGlobusCoreData.wordCounter[t].count.text(e),WPGlobusCoreData.wordCounter[t].prevCount=e)}WPGlobusCoreData.wordCounter[i].content=n("#content_"+i),WPGlobusCoreData.wordCounter[i].count=n("#wp-word-count-"+i).find(".word-count-"+i),WPGlobusCoreData.wordCounter[i].prevCount=0,n(document).on("tinymce-editor-init",function(t,a){var e;-1!=n.inArray(a.id,s)&&(e=a.id.replace("content_",""),(WPGlobusCoreData.wordCounter[e].contentEditor=a).on("nodechange keyup",_.debounce(o,1e3)))}),WPGlobusCoreData.wordCounter[i].content.on("input keyup",_.debounce(o,1e3)),o(i)}));var n,e,i})),c(document).on("click","#publish, #save-post",function(){var e,t,o,n;1<WPGlobusAdmin.data.open_languages.length&&(c(document).triggerHandler("wpglobus_before_save_post",{content_tabs_id:i}),e=c("#title").val(),n=o="",0==e.length&&(t=WPGlobusAdmin.data.open_languages.indexOf(WPGlobusAdmin.data.default_language),WPGlobusAdmin.data.open_languages.splice(t,1),c(WPGlobusAdmin.data.open_languages).each(function(t,a){n=0==t?"":"-",0<(e=c("#title_"+a).val()).length&&(0==o.length&&(n=""),o=o+n+e)})),0<o.length&&c("#title").val(o)),void 0===WPGlobusAdmin.data.tagsdiv||WPGlobusAdmin.data.tagsdiv.length<1||c(WPGlobusAdmin.data.tagsdiv).each(function(t,a){if(0==c("#"+a).length)return!0;var e=a.replace("tagsdiv-","");if("undefined"===e)return!0;if(0==c("#tax-input-"+e).length)return!0;var o,n=[];c("#tagsdiv-"+e+" .tagchecklist li").each(function(t,a){o=(o=c(a).html()).replace(/<button.*<\/button> /,""),void 0===WPGlobusAdmin.data.tag[e][o]?n[t]=o:n[t]=WPGlobusAdmin.data.tag[e][o]}),c("#tax-input-"+e).val(n.join(", "))})}),c(".ui-state-default").on("click",function(){"link-tab-default"===c(this).attr("id")&&(c(window).scrollTop(c(window).scrollTop()+1),c(window).scrollTop(c(window).scrollTop()-1))}),c(document).on("tabsactivate",i,function(t,a){WPGlobusAdmin.currentTab=a.newTab[0].dataset.language}),c(document).triggerHandler("wpglobus_after_post_edit")},adminCentral:function(){c(".wpglobus-admin-central-tab").css({display:"none"}),1<c(".nav-tab-active").length&&c(".wpglobus-about-wrap .nav-tab-wrapper a").removeClass("nav-tab-active");var e=!0;0==location.hash.indexOf("#")&&c(".wpglobus-about-wrap .nav-tab-wrapper a").each(function(t,a){c(a).attr("href")==location.hash&&(e=!1,c(a).addClass("nav-tab-active"))}),e&&c(".wpglobus-about-wrap .nav-tab-wrapper a").eq(0).addClass("nav-tab-active");var t=c(".wpglobus-about-wrap .nav-tab-active").data("tab-id");""!=t&&c("#"+t).css({display:"block"}),c(document).on("click",".wpglobus-about-wrap .nav-tab",function(t){var a=c(this);a.hasClass("nav-tab-active")||(c(".wpglobus-admin-central-tab").css({display:"none"}),c(".wpglobus-about-wrap .nav-tab").removeClass("nav-tab-active"),a.addClass("nav-tab-active"),""!=a.data("tab-id")&&c("#"+a.data("tab-id")).css({display:"block"}))})},start:function(){var a=this;c("#wpglobus_flags").select2({formatResult:this.format,formatSelection:this.format,minimumResultsForSearch:-1,escapeMarkup:function(t){return t}}),c("body").on("click","#enabled_languages-list li:first input",function(t){return t.preventDefault(),c(".redux-save-warn").css({display:"none"}),c("#enabled_languages-list").find("li:first > input").val("1"),0===c("#disable_first_language").length&&c(a.config.disable_first_language).insertAfter("#info_bar"),!1})},format:function(t){return'<img class="wpglobus_flag" src="'+WPGlobusAdmin.flag_url+t.text+'"/> '+t.text},set_dialog:function(){var o,e,n;void 0!==WPGlobusAdmin.data.customFieldsEnabled&&(WPGlobusAdmin.data.customFieldsEnabled=this.parseBool(WPGlobusAdmin.data.customFieldsEnabled),!WPGlobusAdmin.data.customFieldsEnabled)||(e=!1,(n=function(t){var s,d,u="wpglobus_dialog_start wpglobus_dialog_icon",r=['<div class="wpglobus_dialog_options_wrapper hidden">','<input style="width:initial;" id="wpglobus-cb-{{id}}" data-object="#wpglobus-dialog-start-{{id}}" data-meta-key="{{meta-key}}" class="wpglobus_dialog_option wpglobus_dialog_cb" type="checkbox" {{checked}} />',"</div>"].join(""),a=void 0===t?"#the-list tr":"#the-list tr#"+t;c(a).each(function(){var t,a,e,o=c(this),n=o.attr("id"),i=o.find("textarea"),l=u;if(void 0===(s=i.attr("id")))return!0;e=c("#"+n+"-key").val(),t=c("#"+s).clone(),c(i).addClass("wpglobus-dialog-field-source hidden"),a=i.attr("name"),c(t).attr("id","wpglobus-"+s),c(t).attr("name","wpglobus-"+a),c(t).attr("data-source-id",s),c(t).attr("class","wpglobus-dialog-field"),c(t).val(WPGlobusCore.TextFilter(c(i).val(),WPGlobusCoreData.language)),c(t).insertAfter(i),d=(d=r.replace(/{{id}}/g,s)).replace(/{{meta-key}}/g,e),void 0===WPGlobusAdmin.data.post_meta_settings[WPGlobusAdmin.data.post_type]?d=d.replace(/{{checked}}/,"checked"):l=void 0!==WPGlobusAdmin.data.post_meta_settings[WPGlobusAdmin.data.post_type][e]&&"false"==WPGlobusAdmin.data.post_meta_settings[WPGlobusAdmin.data.post_type][e]?(d=d.replace(/{{checked}}/,""),u+" wpglobus_dialog_start_hidden"):(d=d.replace(/{{checked}}/,"checked"),u),o.append('<td style="width:20px;"><div id="wpglobus-dialog-start-'+s+'" data-type="control" data-source-type="textarea" data-source-id="'+s+'" class="'+l+'"></div>'+d+"</td>")}),!e&&0<c("#list-table .wpglobus_dialog_start").length&&(c("#list-table thead tr").append('<th class="wpglobus-control-head"><div class="wpglobus_dialog_settings wpglobus_dialog_icon"></div></th>'),e=!0)})(),c("body").on("change",".wpglobus-dialog-field",function(){var e,o,n=c(this),t="#"+n.data("source-id"),i="";e=c(t).val(),/(\{:|\[:|<!--:)[a-z]{2}/.test(e)?(c.each(WPGlobusCoreData.enabled_languages,function(t,a){""!=(o=a==WPGlobusCoreData.language?n.val():WPGlobusCore.TextFilter(e,a,"RETURN_EMPTY"))&&(i+=WPGlobusCore.addLocaleMarks(o,a))}),c(t).val(i)):c(t).val(n.val())}),c(document).ajaxSend(function(t,a,e){"add-meta"==e.action&&(o=e.element)}),c(document).ajaxComplete(function(t,a,e){"add-meta"==e.action&&void 0!==a.responseXML&&n("newmeta"==o?"meta-"+c(a.responseXML.documentElement.outerHTML).find("meta").attr("id"):o)}),WPGlobusDialogApp.init({dialogTitle:"Edit meta"}))}},new t.App,t)});
|
1 |
+
var WPGlobusCore,WPGlobusDialogApp;!function(i){var d=WPGlobusCore={strpos:function(t,a,e){e=(t=""+t).indexOf(a,e);return 0<=e&&e},TextFilter:function(t,a,e){if(void 0===t||""===t)return t;var o,n,i=[],l=!1;a=""==a?"en":a,e=void 0===e||""==e?"RETURN_IN_DEFAULT_LANGUAGE":e,i[0]=[],i[0].start=WPGlobusCoreData.locale_tag_start.replace("%s",a),i[0].end=WPGlobusCoreData.locale_tag_end,i[1]=[],i[1].start="\x3c!--:"+a+"--\x3e",i[1].end="\x3c!--:--\x3e",i[2]=[],i[2].start="[:"+a+"]",i[2].end="[:";for(var s=0;s<3;s++)if(!1!==(o=d.strpos(t,i[s].start))){o+=i[s].start.length,t=!1===(n=d.strpos(t,i[s].end,o))?t.substr(o):t.substr(o,n-o),l=!0;break}return l||("RETURN_EMPTY"==e?a==WPGlobusCoreData.default_language&&!/(\{:|\[:|<!--:)[a-z]{2}/.test(t)||(t=""):a==WPGlobusCoreData.default_language?/(\{:|\[:|<!--:)[a-z]{2}/.test(t)&&(t=""):t=d.TextFilter(t,WPGlobusCoreData.default_language)),t},addLocaleMarks:function(t,a){return WPGlobusCoreData.locale_tag_start.replace("%s",a)+t+WPGlobusCoreData.locale_tag_end},getTranslations:function(e){var o,n={};return i.each(WPGlobusCoreData.enabled_languages,function(t,a){o=a==WPGlobusCoreData.default_language?"RETURN_IN_DEFAULT_LANGUAGE":"RETURN_EMPTY",n[a]=d.TextFilter(e,a,o)}),n},getString:function(t,a,e){if(void 0===t)return t;void 0===a&&(a=""),void 0===e&&(e=WPGlobusCoreData.language),(t=d.getTranslations(t))[e]=a;var o="";return i.each(t,function(t,a){""!=a&&t!=WPGlobusCoreData.default_language&&(o+=d.addLocaleMarks(a,t))}),o=""!=t[WPGlobusCoreData.default_language]?""==o?t[WPGlobusCoreData.default_language]:d.addLocaleMarks(t[WPGlobusCoreData.default_language],WPGlobusCoreData.default_language)+o:o}}}(jQuery),function(c){var g=WPGlobusDialogApp={option:{listenClass:".wpglobus_dialog_start",settingsClass:".wpglobus_dialog_settings",dialogTabs:"#wpglobus-dialog-tabs",dialogTitle:"",customData:null,callback:function(){},dialogOptions:{title:"",placeholder:"",formFooter:"",beforeOpen:function(){},close:function(){}},dialog:{}},form:void 0,element:void 0,element_by:"id",id:"",clone_id:"",wpglobus_id:"",type:"textarea",source:"",order:{},value:{},request:"core",attrs:{},dialogTitle:"",trClass:"wpglobus-translatable",startButton:['<span id="wpglobus-dialog-start-{{clone_id}}" ','style="{{style}}" ','data-type="control" data-dialog-title="{{title}}" ','data-source-type="" data-source-id="{{id}}" data-source-name="{{name}}" ','data-nodename="{{nodename}}"',"{{sbTitle}} ",'class="{{classes}}"></span>'].join(""),startButtonClass:"wpglobus_dialog_start wpglobus_dialog_icon",clicks:0,init:function(t){g.option.dialog=g.option.dialogOptions,g.option=c.extend(g.option,t),c(g.option.dialogTabs).tabs(),g.dialogTitle=g.option.dialogTitle,this.attachListener(),null!=g.option.customData&&void 0!==g.option.customData.addElements&&c.each(g.option.customData.addElements,function(t,a){g.addElement(a)})},convertToId:function(t){return t=(t=t.replace(/\]/g,"")).replace(/\[/g,"-")},addElement:function(t){var a={id:null,style:"",styleTextareaWrapper:"",sbTitle:"",onChangeClass:"",dialogTitle:"",dialog:g.option.dialogOptions};if("string"==typeof t)a.id=t;else{if("object"!=typeof t)return;a=c.extend(a,t)}var e,o=null,n=null,i=null,l=null,s=g.startButton,d="";if(g.element_by="name",0==(l=document.getElementsByName(a.id)).length&&(g.element_by="id",l=document.getElementById(a.id)),null!==l){if(n=a.id,i=void 0===(o="id"==g.element_by?c("#"+n):(d=(d=l[0].nodeName).toLowerCase(),c(d+'[name="'+n+'"]'))).attr("name")||""==o.attr("name")?n:o.attr("name"),g.clone_id=g.convertToId(n),-1!=i.indexOf("wpglobus")||-1!=g.clone_id.indexOf("wpglobus"))return!1;if(0<c("#wpglobus-"+g.clone_id).length)return!1;if(0<c(d+'[name="wpglobus-'+i+'"]').length)return!1;t=c(o.clone()),l=o.attr("style")||"",o.attr("style","display:none;"),t.attr("id","wpglobus-"+g.clone_id).attr("name","wpglobus-"+i),t.addClass(g.trClass),""!=a.onChangeClass&&t.addClass(a.onChangeClass),("id"==g.element_by?t.attr("data-source-id",n).attr("data-source-name",""):t.attr("data-source-id","").attr("data-source-name",i)).attr("data-source-get-by",g.element_by),"textarea"==d?(e=WPGlobusCore.getTranslations(o.val())[WPGlobusCoreData.language],t.val(e),t.attr("data-nodename","textarea"),""==a.style?t.attr("style",l+";width:95%;float:left;"):t.attr("style",l+";"+a.style)):(e=WPGlobusCore.getTranslations(o.val())[WPGlobusCoreData.language],t.attr("value",e),t.attr("data-nodename","input"),""!=a.style&&t.attr("style",l+";"+a.style)),""!=a.dialog&&t.attr("data-dialog",JSON.stringify(a.dialog)),s=s.replace(/{{clone_id}}/g,g.clone_id),s="id"==g.element_by?(s=(s=s.replace(/{{id}}/g,g.clone_id)).replace(/{{name}}/g,"")).replace(/{{nodename}}/g,""):(s=(s=s.replace(/{{id}}/g,"")).replace(/{{name}}/g,i)).replace(/{{nodename}}/g,d);s="textarea"==d?s.replace("{{style}}","float:left;margin-top:0;"):s.replace("{{style}}",""),i="textarea"==d?g.startButtonClass+" wpglobus-textarea wpglobus-textarea-"+g.clone_id:g.startButtonClass;s=s.replace("{{classes}}",i),s=""==a.dialogTitle?s.replace("{{title}}",g.dialogTitle):s.replace("{{title}}",a.dialogTitle),s=""==a.sbTitle?s.replace("{{sbTitle}}",a.sbTitle):s.replace("{{sbTitle}}",'title="'+a.sbTitle+'"'),c(s).insertAfter(o),c(t).insertAfter(o),"textarea"==d&&(c("#wpglobus-"+g.clone_id).addClass("wpglobus-textarea-"+g.clone_id),c(".wpglobus-textarea-"+g.clone_id).wrapAll('<div class="wpglobus-textarea-wrapper" style="'+a.styleTextareaWrapper+'"></div>'));var u,r=!1;return(""==a.onChangeClass?u="#wpglobus-"+g.clone_id:(u="."+a.onChangeClass,void 0===(a=c._data(c(document)[0],"events"))?r=!0:void 0!==a.change&&c.each(a.change,function(t,a){if(a.selector==u)return!(r=!0)})),r)?!0:(c(document).on("change",u,function(){var t=c(this),a=""==(a=t.data("source-id"))?t.data("nodename")+'[name="'+t.data("source-name")+'"]':"#"+a;c(a).val(WPGlobusCore.getString(c(a).val(),t.val()))}),!0)}},saveDialog:function(){var e,o,n="",i="",l="";c(".wpglobus_dialog_textarea").each(function(t,a){o=c(a),e=o.val(),(o=o.data("language"))==WPGlobusAdmin.data.language&&(l=e),""!=e&&(n+=WPGlobusCore.addLocaleMarks(e,o),o==WPGlobusCoreData.default_language&&(i=e))}),n=n.length==i.length+8?i:n,c(g.id).val(n),n=""==l?i:l,c(g.wpglobus_id).val(n)},dialog:c("#wpglobus-dialog-wrapper").dialog({autoOpen:!1,width:650,modal:!0,dialogClass:"wpglobus-dialog",buttons:[{text:"Save",class:"wpglobus-button-save",click:function(){g.saveDialog(),g.dialog.dialog("close")}},{text:"Cancel",class:"wpglobus-button-cancel",click:function(){g.dialog.dialog("close")}}],open:function(t,a){var e=g.dialogTitle;void 0!==g.attrs.maxlength&&(c(".wpglobus_dialog_textarea").attr("maxlength",g.attrs.maxlength),e+=" | maxlength="+g.attrs.maxlength),c(".wpglobus-dialog .ui-dialog-title").text(e)},close:function(){g.runCallback(g.option.dialog.close),g.form[0].reset()}}),attachListener:function(){c(document).on("click",g.option.settingsClass,function(){c(".wpglobus_dialog_options_wrapper").hasClass("hidden")?c(".wpglobus_dialog_options_wrapper").removeClass("hidden"):c(".wpglobus_dialog_options_wrapper").addClass("hidden")}),c(document).on("click",".wpglobus_dialog_option",function(t){var a=c(this),e=a.data("object");g.order.action="save_post_meta_settings",g.order.post_type=WPGlobusAdmin.data.post_type,g.order.checked=a.prop("checked"),g.order.id=a.attr("id"),g.order.meta_key=a.data("meta-key"),g.ajax(g.order).done(function(t){"ok"==t.result&&("true"==t.checked?c(e).removeClass("wpglobus_dialog_start_hidden"):c(e).addClass("wpglobus_dialog_start_hidden"))}).fail(function(t){}).always(function(t,a){})}),c(document).on("click",g.option.listenClass,function(a){g.element=c(this),g.id=g.element.data("source-id"),""==g.id?(g.id=g.element.data("nodename")+'[name="'+g.element.data("source-name")+'"]',g.wpglobus_id="#wpglobus-"+g.convertToId(g.element.data("source-name"))):(g.wpglobus_id="#wpglobus-"+g.id,g.id="#"+g.id),g.clicks++,1==g.clicks&&setTimeout(function(){var t;1==g.clicks?g.onClick(a):(t=c(g.id)).hasClass("hidden")?t.removeClass("hidden").attr("style","display:block;"):t.addClass("hidden").attr("style","display:none;"),g.clicks=0},200)}),g.form=g.dialog.find("form#wpglobus-dialog-form").on("submit",function(t){t.preventDefault(),g.saveDialog()})},ajax:function(t){return c.ajax({type:"POST",url:WPGlobusAdmin.ajaxurl,data:{action:WPGlobusAdmin.process_ajax,order:t},dataType:"json",async:!1})},onClick:function(t){void 0===g.element.data("dialog-title")||""==g.element.data("dialog-title")?g.dialogTitle=g.option.dialogTitle:g.dialogTitle=g.element.data("dialog-title"),void 0!==g.id&&(g.attrs.maxlength=c(g.id).attr("maxlength")),g.source=g.element.data("source-value"),void 0===g.source&&(g.source=c(g.id).val(),"ajax"==g.request||(g.value=WPGlobusCore.getTranslations(g.source))),g.option.dialog=c.extend({},g.option.dialogOptions,c(g.wpglobus_id).data("dialog")),""!=g.option.dialog.title&&(g.dialogTitle=g.option.dialog.title),c.each(g.value,function(t,a){var e=c("#wpglobus-dialog-"+t);e.val(a),e.attr("placeholder",WPGlobusCore.TextFilter(g.option.dialog.placeholder,t,"RETURN_IN_DEFAULT_LANGUAGE"))}),c("#wpglobus-dialog-form-footer").html(g.option.dialog.formFooter),g.runCallback(g.option.dialog.beforeOpen),g.dialog.dialog("open")},runCallback:function(t){var a,e;"object"==typeof t?(a=Object.keys(t)[0],e=t[Object.keys(t)[0]],"window"===a?"function"==typeof window[e]&&window[e](t[Object.keys(t)[1]]):"function"==typeof window[a][e]&&window[a][e](t[Object.keys(t)[1]])):"string"==typeof t&&"function"==typeof window[t]&&window[t]()}}}(jQuery),jQuery(document).ready(function(){"use strict";var t,r;window.WPGlobusAdminApp=(t=window.WPGlobusAdminApp||{},r=jQuery,t.App=function(t){void 0===window.WPGlobusAdminApp&&(this.config={debug:!1,version:WPGlobusAdmin.version},this.status="ok","undefined"==typeof WPGlobusAdmin?(this.status="error",this.config.debug&&console.log("WPGlobus: error options loading")):this.config.debug&&console.dir(WPGlobusAdmin),this.config.disable_first_language=['<div id="disable_first_language" style="display:block;" class="redux-field-errors notice-red">',"<strong>","<span> </span>",WPGlobusAdmin.i18n.cannot_disable_language,"</strong>","</div>"].join(""),r.extend(this.config,t),"ok"===this.status&&this.init())},t.App.prototype={$document:r(document),init:function(){WPGlobusCoreData.multisite=this.parseBool(WPGlobusCoreData.multisite),this.adminInit(),r("#content").addClass("wpglobus-editor").attr("data-language",WPGlobusAdmin.data.default_language),r("textarea[id^=content_]").each(function(t,a){var e=r(a).attr("id").replace("content_","");r(a).attr("data-language",e)}),"post.php"===WPGlobusAdmin.page?(this.postEdit(),this.set_dialog(),"undefined"!=typeof WPGlobusAioseop&&WPGlobusAioseop.init()):"menu-edit"===WPGlobusAdmin.page?(WPGlobusDialogApp.init({dialogTitle:"Edit description"}),this.navMenus()):"taxonomy-edit"===WPGlobusAdmin.page?WPGlobusAdmin.data.tag_id&&this.taxonomyEdit():"taxonomy-quick-edit"===WPGlobusAdmin.page?this.quickEdit("taxonomy"):"edit.php"===WPGlobusAdmin.page?(this.quickEdit("post"),0<_.size(WPGlobusAdmin.$_get)&&WPGlobusDialogApp.init()):"options-general.php"==WPGlobusAdmin.page?(this.optionsGeneral(),WPGlobusDialogApp.init({customData:WPGlobusCoreData.page_custom_data})):"widgets.php"==WPGlobusAdmin.page?(WPGlobusWidgets.init(),WPGlobusDialogApp.init({dialogTitle:"Edit text"})):"wpglobus_options"==WPGlobusAdmin.page?this.start():"wpglobusAdminCentral"==WPGlobusAdmin.page?this.adminCentral():WPGlobusDialogApp.init({customData:WPGlobusCoreData.page_custom_data})},parseBool:function(t){return!/^(false|0)$/i.test(t)&&!!t},getCurrentTab:function(){return r(".wpglobus-post-body-tabs-list .ui-tabs-active").data("language")},adminInit:function(){var t=r(".wpglobus-addons-group a").data("key");void 0!==t&&(0<=window.location.search.indexOf("page=wpglobus_options&tab="+t)?WPGlobusCoreData.multisite?window.location=WPGlobusCoreData.pluginInstallLocation.multisite:window.location=WPGlobusCoreData.pluginInstallLocation.single:(t=r("#toplevel_page_wpglobus_options li").eq(t+1),(WPGlobusCoreData.multisite?r(t).find("a").attr("href",WPGlobusCoreData.pluginInstallLocation.multisite):r(t).find("a").attr("href",WPGlobusCoreData.pluginInstallLocation.single)).attr("onclick","window.location=jQuery(this).attr('href');return false;")))},optionsGeneral:function(){var e=r("#blogname"),t=r("body");e.addClass("hidden"),r("#wpglobus-blogname").insertAfter(e).removeClass("hidden"),t.on("blur",".wpglobus-blogname",function(){r(".wpglobus-blogname").each(function(t,a){a=r(a);e.val(WPGlobusCore.getString(e.val(),a.val(),a.data("language")))})});var o=r("#blogdescription");o.addClass("hidden"),r("#wpglobus-blogdescription").insertAfter(o).removeClass("hidden"),t.on("blur",".wpglobus-blogdesc",function(){r(".wpglobus-blogdesc").each(function(t,a){a=r(a);o.val(WPGlobusCore.getString(o.val(),a.val(),a.data("language")))})})},quickEdit:function(o){var n,i,l,t;void 0!==WPGlobusAdmin.data.has_items&&WPGlobusAdmin.data.has_items&&(n="",i=0,r(document).ajaxComplete(function(t,a,e){void 0!==e.data&&""!=n&&0<=e.data.indexOf("action=inline-save-tax&")&&(r("#"+n+" a.row-title").text(WPGlobusAdmin.qedit_titles[i][WPGlobusAdmin.data.language].name),r("#"+n+" .description").text(WPGlobusAdmin.qedit_titles[i][WPGlobusAdmin.data.language].description))}),l={},r("#the-list tr").each(function(t,a){var e=r(a),a="post"===o?"post-":"tag-";i=e.attr("id").replace(a,""),l[i]={},"post"===o?l[i].source=e.find(".post_title").text():"taxonomy"===o&&(l[i].source=r("#inline_"+i+" .name").text())}),(t={action:"get_titles"}).type=o,t.taxonomy=void 0!==WPGlobusAdmin.data.taxonomy&&WPGlobusAdmin.data.taxonomy,t.title=l,r.ajax({type:"POST",url:WPGlobusAdmin.ajaxurl,data:{action:WPGlobusAdmin.process_ajax,order:t},dataType:"json"}).done(function(t){WPGlobusAdmin.qedit_titles=t.qedit_titles,r.each(t.bulkedit_post_titles,function(t,a){r("#inline_"+t+" .post_title").text(a[WPGlobusAdmin.data.language].name)})}).fail(function(t){}).always(function(t,a){}),r("body").on("change",".wpglobus-quick-edit-title",function(){var o="",n=[];r(".wpglobus-quick-edit-title").each(function(t,a){var e=r(a),a=e.data("language");""!==e.val()&&(o=WPGlobusCore.getString(o,e.val(),a)),WPGlobusAdmin.qedit_titles[i][a].name=e.val(),n[t]=a});var t=r(document).triggerHandler("wpglobus_get_translations",{string:o,lang:n,id:i});void 0!==t&&(o=t),r("input.ptitle").eq(0).attr("value",o),WPGlobusAdmin.qedit_titles[i].source=o}),void 0!==WPGlobusAdmin.data.tags&&r.each(WPGlobusAdmin.data.tags,function(t,a){WPGlobusAdmin.data.value[a].post_id={}}),r("button.save, input#bulk_edit").on("mouseenter",function(t){void 0!==WPGlobusAdmin.data.tags&&(("bulk_edit"==t.currentTarget.id?r("input#bulk_edit"):r("button.save")).unbind("click"),r("button.save, input#bulk_edit").on("click",function(a){var t=r.when(),e=(r(this),r.Deferred());e.resolve(function(t){t.next(".spinner").css({visibility:"visible"}),"bulk_edit"!=a.currentTarget.id&&r.ajaxSetup({async:!1});var o,n,i,l=t.parents("tr"),s=l.attr("id").replace("edit-","");r.each(WPGlobusAdmin.data.tags,function(t,a){if(0==(o=l.find("textarea[name='"+WPGlobusAdmin.data.names[a]+"']")).length)return!0;WPGlobusAdmin.data.value[a].post_id[s]=o.val(),n=WPGlobusAdmin.data.value[a].post_id[s].split(","),i=[];for(var e=0;e<n.length;e++)n[e]=n[e].trim(" "),""!=n[e]&&(void 0===WPGlobusAdmin.data.tag[a][n[e]]?i[e]=n[e]:i[e]=WPGlobusAdmin.data.tag[a][n[e]]);o.val(i.join(", "))})}(r(this))),t=t.then(function(){return r.when(e.done())}).then(function(){"bulk_edit"!=a.currentTarget.id&&setTimeout(function(){inlineEditPost.save(i),r.ajaxSetup({async:!0})},50)})}))}),r("#the-list").on("click","a.editinline",function(){var t=r(this);if(n=t.parents("tr").attr("id"),"post"===o)i=n.replace("post-","");else{if("taxonomy"!==o)return;i=n.replace("tag-","")}"post"===o&&void 0!==WPGlobusAdmin.data.tags&&r.each(WPGlobusAdmin.data.tags,function(t,a){var e,o;""==WPGlobusAdmin.data.value[a]||void 0!==(e=r("#edit-"+i+' textarea[name="'+WPGlobusAdmin.data.names[a]+'"]').val())&&(o=e.split(","),r.each(o,function(t,a){e=e.replace(a,WPGlobusCore.TextFilter(a,WPGlobusCoreData.language))}),r("#edit-"+i+' textarea[name="'+WPGlobusAdmin.data.names[a]+'"]').val(e))});var a=r("#edit-"+i+" input.ptitle").eq(0),t=a.parents("label");a.val(WPGlobusAdmin.qedit_titles[i].source),a.addClass("hidden"),r(WPGlobusAdmin.data.template).insertAfter(t),void 0===WPGlobusAdmin.qedit_titles[i]&&(WPGlobusAdmin.qedit_titles[i]={},WPGlobusAdmin.qedit_titles[i].source=r("#"+n+" .name a.row-title").text(),r(WPGlobusAdmin.data.enabled_languages).each(function(t,a){WPGlobusAdmin.qedit_titles[i][a]={},a==WPGlobusAdmin.data.default_language?WPGlobusAdmin.qedit_titles[i][a].name=WPGlobusAdmin.qedit_titles[i].source:WPGlobusAdmin.qedit_titles[i][a].name="",WPGlobusAdmin.qedit_titles[i][a].description=""})),r(".wpglobus-quick-edit-title").each(function(t,a){var e=r(a),a=e.data("language");e.attr("id",a+i),void 0!==WPGlobusAdmin.qedit_titles[i][a]&&(WPGlobusAdmin.qedit_titles[i][a].name=WPGlobusAdmin.qedit_titles[i][a].name.replace(/\\\'/g,"'"),WPGlobusAdmin.qedit_titles[i][a].name=WPGlobusAdmin.qedit_titles[i][a].name.replace(/\\\"/g,'"'),e.attr("value",WPGlobusAdmin.qedit_titles[i][a].name),WPGlobusAdmin.qedit_titles[i].source=WPGlobusCore.getString(WPGlobusAdmin.qedit_titles[i].source,WPGlobusAdmin.qedit_titles[i][a].name,a))}),r("input.ptitle").eq(0).attr("value",WPGlobusAdmin.qedit_titles[i].source)}))},taxonomyEdit:function(){var a=[];a[0]="name",a[1]="description";r.each(WPGlobusCoreData.enabled_languages,function(t,d){r.each(a,function(t,a){var e,o,n,i,l,s;o=d,n=r("#"+(e=a)),i=n.clone(),l=n.attr("name"),s="wpglobus-element wpglobus-element_"+e+" wpglobus-element_"+o+" wpglobus-translatable",a=(a=document.getElementById(e)).nodeName,r(i).attr("id",e+"_"+o),r(i).attr("name",l+"_"+o),o!==WPGlobusCoreData.default_language&&(s+=" hidden"),r(i).attr("class",s),r(i).attr("data-save-to",e),r(i).attr("data-language",o),"INPUT"==a?r(i).attr("value",r("#wpglobus-link-tab-"+o).data(e)):"TEXTAREA"==a&&r(i).text(r("#wpglobus-link-tab-"+o).data(e)),n.addClass("hidden"),0==r(".wpglobus-element_"+e).length?r(i).insertAfter(n):r(i).insertAfter(r(".wpglobus-element_"+e).last())})}),r(".wpglobus-taxonomy-tabs").insertAfter("#ajax-response"),r(".wrap").tabs(),r("body").on("click",".wpglobus-taxonomy-tabs li",function(t){var a=r(this).data("language");r(".wpglobus-element").addClass("hidden"),r(".wpglobus-element_"+a).removeClass("hidden")}),r(".wpglobus-element").on("change",function(){var o=r(this).data("save-to"),n="";r(".wpglobus-element").each(function(t,a){var e=r(a),a=e.val();e.data("save-to")==o&&""!==a&&(n+=WPGlobusCore.addLocaleMarks(a,e.data("language")))}),r("#"+o).val(n)}),r(WPGlobusAdmin.data.multilingualSlug.title).insertAfter(".term-slug-wrap th label")},navMenus:function(){function e(){n!==r(i).length&&(clearInterval(o),r(i).each(function(t,a){var o,e=r(a);e.hasClass("wpglobus-menu-item")||(o=r(a).attr("id"),r.each(["input.edit-menu-item-title","input.edit-menu-item-attr-title"],function(t,a){var e=r("#"+o+" "+a),a=r(e);a.hasClass("wpglobus-hidden")||(a.addClass("wpglobus-hidden"),a.css("display","none"),e=a.parent("label"),a=a.parents("p"),r(a).css("height","80px"),r(e).append('<div style="color:#f00;">'+WPGlobusAdmin.i18n.save_nav_menu+"</div>"))}),e.addClass("wpglobus-menu-item"))}))}var o,n,i="#menu-to-edit .menu-item";r.ajaxSetup({beforeSend:function(t,a){void 0!==a.data&&0<=a.data.indexOf("action=add-menu-item")&&(n=r(i).length,o=setInterval(e,500))}}),r(i).each(function(t,a){var e=r(a).attr("id"),u=e.replace("menu-item-","");r.each(["input.edit-menu-item-title","input.edit-menu-item-attr-title"],function(n,i){var l=r("#"+e+" "+i);l.val()!=WPGlobusAdmin.data.items[u][i].source&&l.val(WPGlobusAdmin.data.items[u][i].source);var s=r("#"+e+" "+i).parents("p"),d=0;r.each(WPGlobusAdmin.data.open_languages,function(t,a){var e=l.clone();e.attr("id",l.attr("id")+"-"+a),e.attr("name",l.attr("id")+"-"+a),e.attr("data-language",a),e.attr("data-item-id",u),e.attr("placeholder",WPGlobusAdmin.data.en_language_name[a]);var o=WPGlobusAdmin.data.items[u][a][i].class;0===n&&a===WPGlobusAdmin.data.default_language?e.attr("class",o+" edit-menu-item-title"):e.attr("class",o),""!=WPGlobusAdmin.data.items[u][a][i].caption?e.attr("value",WPGlobusAdmin.data.items[u][a][i].caption):e.attr("value",""),e.css("margin-bottom","0.6em"),r(s).append(e),d=t}),d=40*(d+1),l.css("display","none").attr("class","").addClass("widefat wpglobus-hidden"),r(s).css("height",d+"px").addClass("wpglobus-menu-item-box")}),r(a).addClass("wpglobus-menu-item")}),r(".menus-move-left, .menus-move-right").each(function(t,a){var e,o=r(a),n=(o.parents("li").attr("id").replace("menu-item-",""),o.attr("title"));void 0!==n&&r.each(WPGlobusAdmin.data.post_titles,function(t,a){0<=n.indexOf(t)&&(e=n.replace(t,a),o.attr("title",e),o.text(e))})}),r(".edit-menu-item-title").trigger("change"),wpNavMenu.refreshAdvancedAccessibility(),wpNavMenu.menusChanged=!1,r(".wpglobus-menu-item").on("change",function(){var t,a,e=r(this),o=e.data("item-id");e.hasClass("wpglobus-item-title")&&(t=WPGlobusCore.getString(r("input#edit-menu-item-title-"+o).val(),e.val(),e.data("language")),void 0!==(a=r(document).triggerHandler("wpglobus_get_menu_translations",{string:t,lang:WPGlobusCoreData.open_languages,id:o,type:"input.edit-menu-item-title"}))&&(t=a),r("input#edit-menu-item-title-"+o).val(t)),e.hasClass("wpglobus-item-attr")&&(t=WPGlobusCore.getString(r("input#edit-menu-item-attr-title-"+o).val(),e.val(),e.data("language")),void 0!==(a=r(document).triggerHandler("wpglobus_get_menu_translations",{string:t,lang:WPGlobusCoreData.open_languages,id:o,type:"input.edit-menu-item-attr-title"}))&&(t=a),r("input#edit-menu-item-attr-title-"+o).val(t))});var a=[];setTimeout(function(){r(".edit-menu-item-description").each(function(){var t=r(this).attr("id");a.push(t),WPGlobusDialogApp.addElement(t)}),r(".wpglobus_dialog_start").each(function(){r(this).css({"font-style":"normal"}),r(this).after("<br />")});var t={action:"getNavMenuItemsDescription"};t.menuItems=a,r.ajax({type:"POST",url:WPGlobusAdmin.ajaxurl,data:{action:WPGlobusAdmin.process_ajax,order:t},dataType:"json"}).done(function(t){"object"==typeof t&&r.each(t,function(t,a){""!=a&&(r("#"+t).val(a),r("#wpglobus-"+t).val(WPGlobusCore.TextFilter(a,WPGlobus.language,"RETURN_EMPTY")))})}).fail(function(t){}).always(function(t,a){})},1e3)},postEdit:function(){r(document).on("heartbeat-send",function(t,o){void 0!==o.wp_autosave&&(o.wpglobus_heartbeat="wpglobus",r.each(WPGlobusAdmin.data.open_languages,function(t,a){var e=r("#title_"+a).val()||"";""!=(e=r.trim(e))&&(o.wp_autosave["post_title_"+a]=e),e=r("#content_"+a).val()||"",""!=(e=r.trim(e))&&(o.wp_autosave["content_"+a]=e)}))});var a,i,l,e="#postdivrich",o=!0,s="#post-body-content";!1===WPGlobusAdmin.data.support.editor&&(o=!(e="#titlediv")),!1===WPGlobusAdmin.data.support.title&&(o=!1),r(s).prepend(r(".wpglobus-post-body-tabs-list")),r.each(WPGlobusAdmin.tabs,function(t,a){"default"===a?(r(e).wrap('<div id="tab-default"></div>'),o&&r(r("#titlediv")).insertBefore(e)):(r(e+"-"+a).wrap('<div id="tab-'+a+'"></div>'),o&&r(r("#titlediv-"+a)).insertBefore(e+"-"+a))}),r(s).addClass("wpglobus-post-body-tabs").tabs({beforeActivate:function(t,a){var e=a.oldTab[0].id.replace("link-tab-",""),a=a.newTab[0].id.replace("link-tab-","");"default"==e&&(e=WPGlobusCoreData.default_language),"default"==a&&(a=WPGlobusCoreData.default_language);a=r(document).triggerHandler("wpglobus_post_body_tabs",[e,a]);return!(!a&&void 0!==a)}}),r("#title").val(WPGlobusAdmin.title),r("#content").text(WPGlobusAdmin.content),"undefined"!=typeof WPGlobusVendor&&WPGlobusVendor.vendor.WPSEO&&("undefined"!=typeof wpglobus_wpseo?wpglobus_wpseo():"undefined"!=typeof WPGlobusYoastSeo&&("undefined"!=typeof WPGlobusYoastSeoPremium&&WPGlobusYoastSeoPremium&&WPGlobusYoastSeoPremium.init(),WPGlobusYoastSeo.init())),WPGlobusAdmin.data.modify_excerpt&&((a=r("#excerpt")).addClass("hidden").css({display:"none"}),r(WPGlobusAdmin.data.template).insertAfter(a),r("body").on("change",".wpglobus-excerpt",function(){var t=r(this);a.val(WPGlobusCore.getString(a.val(),t.val(),t.data("language")))})),void 0!==wp.utils&&void 0!==wp.utils.WordCounter&&(WPGlobusCoreData.wordCounter={},i=this,l={},r.each(WPGlobusCoreData.enabled_languages,function(t,a){return a==WPGlobusCoreData.default_language||(l[t]="content_"+a,n=jQuery,t=new wp.utils.WordCounter,e=a,WPGlobusCoreData.wordCounter[e]={},WPGlobusCoreData.wordCounter[e].counter=t,void n(function(){function o(t){var a;"object"==typeof t&&(t="tinymce"==t?i.getCurrentTab():t.target.id.replace("content_","")),void 0!==WPGlobusCoreData.wordCounter[t]&&(a=!WPGlobusCoreData.wordCounter[t].contentEditor||WPGlobusCoreData.wordCounter[t].contentEditor.isHidden()?WPGlobusCoreData.wordCounter[t].content.val():WPGlobusCoreData.wordCounter[t].contentEditor.getContent({format:"raw"}),(a=WPGlobusCoreData.wordCounter[t].counter.count(a))!==WPGlobusCoreData.wordCounter[t].prevCount&&WPGlobusCoreData.wordCounter[t].count.text(a),WPGlobusCoreData.wordCounter[t].prevCount=a)}WPGlobusCoreData.wordCounter[e].content=n("#content_"+e),WPGlobusCoreData.wordCounter[e].count=n("#wp-word-count-"+e).find(".word-count-"+e),WPGlobusCoreData.wordCounter[e].prevCount=0,n(document).on("tinymce-editor-init",function(t,a){var e;-1!=n.inArray(a.id,l)&&(e=a.id.replace("content_",""),(WPGlobusCoreData.wordCounter[e].contentEditor=a).on("nodechange keyup",_.debounce(o,1e3)))}),WPGlobusCoreData.wordCounter[e].content.on("input keyup",_.debounce(o,1e3)),o(e)}));var n,e})),r(document).on("click","#publish, #save-post",function(){var e,t,o,n;1<WPGlobusAdmin.data.open_languages.length&&(r(document).triggerHandler("wpglobus_before_save_post",{content_tabs_id:s}),e=r("#title").val(),n=o="",0==e.length&&(t=WPGlobusAdmin.data.open_languages.indexOf(WPGlobusAdmin.data.default_language),WPGlobusAdmin.data.open_languages.splice(t,1),r(WPGlobusAdmin.data.open_languages).each(function(t,a){n=0==t?"":"-",0<(e=r("#title_"+a).val()).length&&(0==o.length&&(n=""),o=o+n+e)})),0<o.length&&r("#title").val(o)),void 0===WPGlobusAdmin.data.tagsdiv||WPGlobusAdmin.data.tagsdiv.length<1||r(WPGlobusAdmin.data.tagsdiv).each(function(t,a){if(0==r("#"+a).length)return!0;var e=a.replace("tagsdiv-","");if("undefined"===e)return!0;if(0==r("#tax-input-"+e).length)return!0;var o,n=[];r("#tagsdiv-"+e+" .tagchecklist li").each(function(t,a){o=(o=r(a).html()).replace(/<button.*<\/button> /,""),void 0===WPGlobusAdmin.data.tag[e][o]?n[t]=o:n[t]=WPGlobusAdmin.data.tag[e][o]}),r("#tax-input-"+e).val(n.join(", "))})}),r(".ui-state-default").on("click",function(){"link-tab-default"===r(this).attr("id")&&(r(window).scrollTop(r(window).scrollTop()+1),r(window).scrollTop(r(window).scrollTop()-1))}),r(document).on("tabsactivate",s,function(t,a){WPGlobusAdmin.currentTab=a.newTab[0].dataset.language}),r(document).triggerHandler("wpglobus_after_post_edit")},adminCentral:function(){r(".wpglobus-admin-central-tab").css({display:"none"}),1<r(".nav-tab-active").length&&r(".wpglobus-about-wrap .nav-tab-wrapper a").removeClass("nav-tab-active");var e=!0;0==location.hash.indexOf("#")&&r(".wpglobus-about-wrap .nav-tab-wrapper a").each(function(t,a){r(a).attr("href")==location.hash&&(e=!1,r(a).addClass("nav-tab-active"))}),e&&r(".wpglobus-about-wrap .nav-tab-wrapper a").eq(0).addClass("nav-tab-active");var t=r(".wpglobus-about-wrap .nav-tab-active").data("tab-id");""!=t&&r("#"+t).css({display:"block"}),r(document).on("click",".wpglobus-about-wrap .nav-tab",function(t){var a=r(this);a.hasClass("nav-tab-active")||(r(".wpglobus-admin-central-tab").css({display:"none"}),r(".wpglobus-about-wrap .nav-tab").removeClass("nav-tab-active"),a.addClass("nav-tab-active"),""!=a.data("tab-id")&&r("#"+a.data("tab-id")).css({display:"block"}))})},start:function(){var a=this;r("#wpglobus_flags").select2({formatResult:this.format,formatSelection:this.format,minimumResultsForSearch:-1,escapeMarkup:function(t){return t}}),r("body").on("click","#enabled_languages-list li:first input",function(t){return t.preventDefault(),r(".redux-save-warn").css({display:"none"}),r("#enabled_languages-list").find("li:first > input").val("1"),0===r("#disable_first_language").length&&r(a.config.disable_first_language).insertAfter("#info_bar"),!1})},format:function(t){return'<img class="wpglobus_flag" src="'+WPGlobusAdmin.flag_url+t.text+'"/> '+t.text},set_dialog:function(){var o,a,n;void 0!==WPGlobusAdmin.data.customFieldsEnabled&&(WPGlobusAdmin.data.customFieldsEnabled=this.parseBool(WPGlobusAdmin.data.customFieldsEnabled),!WPGlobusAdmin.data.customFieldsEnabled)||(a=!1,(n=function(t){var l,s,d="wpglobus_dialog_start wpglobus_dialog_icon",u=['<div class="wpglobus_dialog_options_wrapper hidden">','<input style="width:initial;" id="wpglobus-cb-{{id}}" data-object="#wpglobus-dialog-start-{{id}}" data-meta-key="{{meta-key}}" class="wpglobus_dialog_option wpglobus_dialog_cb" type="checkbox" {{checked}} />',"</div>"].join(""),t=void 0===t?"#the-list tr":"#the-list tr#"+t;r(t).each(function(){var t,a,e=r(this),o=e.attr("id"),n=e.find("textarea"),i=d;if(void 0===(l=n.attr("id")))return!0;a=r("#"+o+"-key").val(),t=r("#"+l).clone(),r(n).addClass("wpglobus-dialog-field-source hidden"),o=n.attr("name"),r(t).attr("id","wpglobus-"+l),r(t).attr("name","wpglobus-"+o),r(t).attr("data-source-id",l),r(t).attr("class","wpglobus-dialog-field"),r(t).val(WPGlobusCore.TextFilter(r(n).val(),WPGlobusCoreData.language)),r(t).insertAfter(n),s=(s=u.replace(/{{id}}/g,l)).replace(/{{meta-key}}/g,a),void 0===WPGlobusAdmin.data.post_meta_settings[WPGlobusAdmin.data.post_type]?s=s.replace(/{{checked}}/,"checked"):i=void 0!==WPGlobusAdmin.data.post_meta_settings[WPGlobusAdmin.data.post_type][a]&&"false"==WPGlobusAdmin.data.post_meta_settings[WPGlobusAdmin.data.post_type][a]?(s=s.replace(/{{checked}}/,""),d+" wpglobus_dialog_start_hidden"):(s=s.replace(/{{checked}}/,"checked"),d),e.append('<td style="width:20px;"><div id="wpglobus-dialog-start-'+l+'" data-type="control" data-source-type="textarea" data-source-id="'+l+'" class="'+i+'"></div>'+s+"</td>")}),!a&&0<r("#list-table .wpglobus_dialog_start").length&&(r("#list-table thead tr").append('<th class="wpglobus-control-head"><div class="wpglobus_dialog_settings wpglobus_dialog_icon"></div></th>'),a=!0)})(),r("body").on("change",".wpglobus-dialog-field",function(){var e,o,n=r(this),t="#"+n.data("source-id"),i="";e=r(t).val(),/(\{:|\[:|<!--:)[a-z]{2}/.test(e)?(r.each(WPGlobusCoreData.enabled_languages,function(t,a){""!=(o=a==WPGlobusCoreData.language?n.val():WPGlobusCore.TextFilter(e,a,"RETURN_EMPTY"))&&(i+=WPGlobusCore.addLocaleMarks(o,a))}),r(t).val(i)):r(t).val(n.val())}),r(document).ajaxSend(function(t,a,e){"add-meta"==e.action&&(o=e.element)}),r(document).ajaxComplete(function(t,a,e){"add-meta"==e.action&&void 0!==a.responseXML&&n("newmeta"==o?"meta-"+r(a.responseXML.documentElement.outerHTML).find("meta").attr("id"):o)}),WPGlobusDialogApp.init({dialogTitle:"Edit meta"}))}},new t.App,t)});
|
includes/js/wpglobus-admin-51.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var WPGlobusCore,WPGlobusDialogApp;!function(i){var d=WPGlobusCore={strpos:function(t,a,e){var o=(t=""+t).indexOf(a,e);return 0<=o&&o},TextFilter:function(t,a,e){if(void 0===t||""===t)return t;var o,n,i=[],l=!1;a=""==a?"en":a,e=void 0===e||""==e?"RETURN_IN_DEFAULT_LANGUAGE":e,i[0]=[],i[0].start=WPGlobusCoreData.locale_tag_start.replace("%s",a),i[0].end=WPGlobusCoreData.locale_tag_end,i[1]=[],i[1].start="\x3c!--:"+a+"--\x3e",i[1].end="\x3c!--:--\x3e",i[2]=[],i[2].start="[:"+a+"]",i[2].end="[:";for(var s=0;s<3;s++)if(!1!==(o=d.strpos(t,i[s].start))){o+=i[s].start.length,t=!1===(n=d.strpos(t,i[s].end,o))?t.substr(o):t.substr(o,n-o),l=!0;break}return l||("RETURN_EMPTY"==e?a==WPGlobusCoreData.default_language&&!/(\{:|\[:|<!--:)[a-z]{2}/.test(t)||(t=""):a==WPGlobusCoreData.default_language?/(\{:|\[:|<!--:)[a-z]{2}/.test(t)&&(t=""):t=d.TextFilter(t,WPGlobusCoreData.default_language)),t},addLocaleMarks:function(t,a){return WPGlobusCoreData.locale_tag_start.replace("%s",a)+t+WPGlobusCoreData.locale_tag_end},getTranslations:function(e){var o,n={};return i.each(WPGlobusCoreData.enabled_languages,function(t,a){o=a==WPGlobusCoreData.default_language?"RETURN_IN_DEFAULT_LANGUAGE":"RETURN_EMPTY",n[a]=d.TextFilter(e,a,o)}),n},getString:function(t,a,e){if(void 0===t)return t;void 0===a&&(a=""),void 0===e&&(e=WPGlobusCoreData.language),(t=d.getTranslations(t))[e]=a;var o="";return i.each(t,function(t,a){""!=a&&t!=WPGlobusCoreData.default_language&&(o+=d.addLocaleMarks(a,t))}),""!=t[WPGlobusCoreData.default_language]&&(o=""==o?t[WPGlobusCoreData.default_language]:d.addLocaleMarks(t[WPGlobusCoreData.default_language],WPGlobusCoreData.default_language)+o),o}}}(jQuery),function(m){var v=WPGlobusDialogApp={option:{listenClass:".wpglobus_dialog_start",settingsClass:".wpglobus_dialog_settings",dialogTabs:"#wpglobus-dialog-tabs",dialogTitle:"",customData:null,callback:function(){},dialogOptions:{title:"",placeholder:"",formFooter:"",beforeOpen:function(){},afterOpen:function(){},afterSave:function(){},close:function(){}},dialog:{}},form:void 0,element:void 0,element_by:"id",id:"",clone_id:"",wpglobus_id:"",type:"textarea",source:"",order:{},value:{},request:"core",attrs:{},dialogTitle:"",trClass:"wpglobus-translatable",startButton:['<span id="wpglobus-dialog-start-{{clone_id}}" ','style="{{style}}" ','data-type="control" data-dialog-title="{{title}}" ','data-source-type="" data-source-id="{{id}}" data-source-name="{{name}}" ','data-nodename="{{nodename}}"',"{{sbTitle}} ",'class="{{classes}}"></span>'].join(""),startButtonClass:"wpglobus_dialog_start wpglobus_dialog_icon",clicks:0,init:function(t){v.option.dialog=v.option.dialogOptions,v.option=m.extend(v.option,t),m(v.option.dialogTabs).tabs(),v.dialogTitle=v.option.dialogTitle,this.attachListener(),null!=v.option.customData&&void 0!==v.option.customData.addElements&&m.each(v.option.customData.addElements,function(t,a){v.addElement(a)})},convertToId:function(t){return t=(t=t.replace(/\]/g,"")).replace(/\[/g,"-")},addElement:function(t){var a={id:null,style:"",styleTextareaWrapper:"",sbTitle:"",onChangeClass:"",dialogTitle:"",dialog:v.option.dialogOptions};if("string"==typeof t)a.id=t;else{if("object"!=typeof t)return;a=m.extend(a,t)}var e,o,n,i=null,l=null,s=null,d=null,u=v.startButton,r="";if(v.element_by="name",0==(d=document.getElementsByName(a.id)).length&&(v.element_by="id",d=document.getElementById(a.id)),null!==d){if(l=a.id,s=void 0===(i="id"==v.element_by?m("#"+l):(r=(r=d[0].nodeName).toLowerCase(),m(r+'[name="'+l+'"]'))).attr("name")||""==i.attr("name")?l:i.attr("name"),v.clone_id=v.convertToId(l),-1!=s.indexOf("wpglobus")||-1!=v.clone_id.indexOf("wpglobus"))return!1;if(0<m("#wpglobus-"+v.clone_id).length)return!1;if(0<m(r+'[name="wpglobus-'+s+'"]').length)return!1;e=m(i.clone()),n=i.attr("style")||"",i.attr("style","display:none;"),e.attr("id","wpglobus-"+v.clone_id).attr("name","wpglobus-"+s),e.addClass(v.trClass),""!=a.onChangeClass&&e.addClass(a.onChangeClass),"id"==v.element_by?e.attr("data-source-id",l).attr("data-source-name","").attr("data-source-get-by",v.element_by):e.attr("data-source-id","").attr("data-source-name",s).attr("data-source-get-by",v.element_by),"textarea"==r?(o=WPGlobusCore.getTranslations(i.val())[WPGlobusCoreData.language],e.val(o),e.attr("data-nodename","textarea"),""==a.style?e.attr("style",n+";width:95%;float:left;"):e.attr("style",n+";"+a.style)):(o=WPGlobusCore.getTranslations(i.val())[WPGlobusCoreData.language],e.attr("value",o),e.attr("data-nodename","input"),""!=a.style&&e.attr("style",n+";"+a.style)),""!=a.dialog&&e.attr("data-dialog",JSON.stringify(a.dialog)),u=u.replace(/{{clone_id}}/g,v.clone_id),u="id"==v.element_by?(u=(u=u.replace(/{{id}}/g,v.clone_id)).replace(/{{name}}/g,"")).replace(/{{nodename}}/g,""):(u=(u=u.replace(/{{id}}/g,"")).replace(/{{name}}/g,s)).replace(/{{nodename}}/g,r),u="textarea"==r?u.replace("{{style}}","float:left;margin-top:0;"):u.replace("{{style}}","");var c="textarea"==r?v.startButtonClass+" wpglobus-textarea wpglobus-textarea-"+v.clone_id:v.startButtonClass,u=u.replace("{{classes}}",c);u=""==a.dialogTitle?u.replace("{{title}}",v.dialogTitle):u.replace("{{title}}",a.dialogTitle),u=""==a.sbTitle?u.replace("{{sbTitle}}",a.sbTitle):u.replace("{{sbTitle}}",'title="'+a.sbTitle+'"'),m(u).insertAfter(i),m(e).insertAfter(i),"textarea"==r&&(m("#wpglobus-"+v.clone_id).addClass("wpglobus-textarea-"+v.clone_id),m(".wpglobus-textarea-"+v.clone_id).wrapAll('<div class="wpglobus-textarea-wrapper" style="'+a.styleTextareaWrapper+'"></div>'));var g,b,p=!1;return(""==a.onChangeClass?g="#wpglobus-"+v.clone_id:(g="."+a.onChangeClass,void 0===(b=m._data(m(document)[0],"events"))?p=!0:void 0!==b.change&&m.each(b.change,function(t,a){if(a.selector==g)return!(p=!0)})),p)?!0:(m(document).on("change",g,function(){var t=m(this),a=""==(a=t.data("source-id"))?t.data("nodename")+'[name="'+t.data("source-name")+'"]':"#"+a;m(a).val(WPGlobusCore.getString(m(a).val(),t.val()))}),!0)}},saveDialog:function(){var e,o,n,i="",l="",s="";m(".wpglobus_dialog_textarea").each(function(t,a){e=m(a),o=e.val(),(n=e.data("language"))==WPGlobusAdmin.data.language&&(s=o),""!=o&&(i+=WPGlobusCore.addLocaleMarks(o,n),n==WPGlobusCoreData.default_language&&(l=o))}),i=i.length==l.length+8?l:i,m(v.id).val(i),i=""==s?l:s,m(v.wpglobus_id).val(i),v.runCallback(v.option.dialog.afterSave)},dialog:m("#wpglobus-dialog-wrapper").dialog({autoOpen:!1,width:650,modal:!0,dialogClass:"wpglobus-dialog",buttons:[{text:"Save",class:"wpglobus-button-save",click:function(){v.saveDialog(),v.dialog.dialog("close")}},{text:"Cancel",class:"wpglobus-button-cancel",click:function(){v.dialog.dialog("close")}}],open:function(t,a){var e=v.dialogTitle;void 0!==v.attrs.maxlength&&(m(".wpglobus_dialog_textarea").attr("maxlength",v.attrs.maxlength),e+=" | maxlength="+v.attrs.maxlength),m(".wpglobus-dialog .ui-dialog-title").text(e),m(this).removeClass("hidden")},close:function(){m(this).addClass("hidden"),v.runCallback(v.option.dialog.close),v.form[0].reset()}}),attachListener:function(){m(document).on("click",v.option.settingsClass,function(){m(".wpglobus_dialog_options_wrapper").hasClass("hidden")?m(".wpglobus_dialog_options_wrapper").removeClass("hidden"):m(".wpglobus_dialog_options_wrapper").addClass("hidden")}),m(document).on("click",".wpglobus_dialog_option",function(t){var a=m(this),e=a.data("object");v.order.action="save_post_meta_settings",v.order.post_type=WPGlobusAdmin.data.post_type,v.order.checked=a.prop("checked"),v.order.id=a.attr("id"),v.order.meta_key=a.data("meta-key"),v.ajax(v.order).done(function(t){"ok"==t.result&&("true"==t.checked?m(e).removeClass("wpglobus_dialog_start_hidden"):m(e).addClass("wpglobus_dialog_start_hidden"))}).fail(function(t){}).always(function(t,a){})}),m(document).on("click",v.option.listenClass,function(a){v.element=m(this),v.id=v.element.data("source-id"),""==v.id?(v.id=v.element.data("nodename")+'[name="'+v.element.data("source-name")+'"]',v.wpglobus_id="#wpglobus-"+v.convertToId(v.element.data("source-name"))):(v.wpglobus_id="#wpglobus-"+v.id,v.id="#"+v.id),v.clicks++,1==v.clicks&&setTimeout(function(){var t;1==v.clicks?v.onClick(a):(t=m(v.id)).hasClass("hidden")?t.removeClass("hidden").attr("style","display:block;"):t.addClass("hidden").attr("style","display:none;"),v.clicks=0},200)}),v.form=v.dialog.find("form#wpglobus-dialog-form").on("submit",function(t){t.preventDefault(),v.saveDialog()})},ajax:function(t){return m.ajax({type:"POST",url:WPGlobusAdmin.ajaxurl,data:{action:WPGlobusAdmin.process_ajax,order:t},dataType:"json",async:!1})},onClick:function(t){void 0===v.element.data("dialog-title")||""==v.element.data("dialog-title")?v.dialogTitle=v.option.dialogTitle:v.dialogTitle=v.element.data("dialog-title"),void 0!==v.id&&(v.attrs.maxlength=m(v.id).attr("maxlength")),v.source=v.element.data("source-value"),void 0===v.source&&(v.source=m(v.id).val(),"ajax"==v.request||(v.value=WPGlobusCore.getTranslations(v.source))),v.option.dialog=m.extend({},v.option.dialogOptions,m(v.wpglobus_id).data("dialog")),""!=v.option.dialog.title&&(v.dialogTitle=v.option.dialog.title),m.each(v.value,function(t,a){var e=m("#wpglobus-dialog-"+t);e.val(a),e.attr("placeholder",WPGlobusCore.TextFilter(v.option.dialog.placeholder,t,"RETURN_IN_DEFAULT_LANGUAGE"))}),m("#wpglobus-dialog-form-footer").html(v.option.dialog.formFooter),v.runCallback(v.option.dialog.beforeOpen),v.dialog.dialog("open"),v.runCallback(v.option.dialog.afterOpen)},runCallback:function(t){var a,e;"object"==typeof t?(a=Object.keys(t)[0],e=t[Object.keys(t)[0]],"window"===a?"function"==typeof window[e]&&window[e](t[Object.keys(t)[1]]):"function"==typeof window[a][e]&&window[a][e](t[Object.keys(t)[1]])):"string"==typeof t?"function"==typeof window[t]&&window[t]():"function"==typeof t&&t()}}}(jQuery),jQuery(document).ready(function(){"use strict";var t,c;window.WPGlobusAdminApp=(t=window.WPGlobusAdminApp||{},c=jQuery,t.App=function(t){void 0===window.WPGlobusAdminApp&&(this.config={debug:!1,version:WPGlobusAdmin.version},this.status="ok","undefined"==typeof WPGlobusAdmin?(this.status="error",this.config.debug&&console.log("WPGlobus: error options loading")):this.config.debug&&console.dir(WPGlobusAdmin),this.config.disable_first_language=['<div id="disable_first_language" style="display:block;" class="redux-field-errors notice-red">',"<strong>","<span> </span>",WPGlobusAdmin.i18n.cannot_disable_language,"</strong>","</div>"].join(""),c.extend(this.config,t),"ok"===this.status&&this.init())},t.App.prototype={$document:c(document),init:function(){WPGlobusCoreData.multisite=this.parseBool(WPGlobusCoreData.multisite),this.adminInit(),c("#content").addClass("wpglobus-editor").attr("data-language",WPGlobusAdmin.data.default_language),c("textarea[id^=content_]").each(function(t,a){var e=c(a).attr("id").replace("content_","");c(a).attr("data-language",e)}),"post.php"===WPGlobusAdmin.page?(this.postEdit(),this.set_dialog(),"undefined"!=typeof WPGlobusAioseop&&WPGlobusAioseop.init()):"menu-edit"===WPGlobusAdmin.page?(WPGlobusDialogApp.init({dialogTitle:"Edit description"}),this.navMenus()):"taxonomy-edit"===WPGlobusAdmin.page?WPGlobusAdmin.data.tag_id&&this.taxonomyEdit():"taxonomy-quick-edit"===WPGlobusAdmin.page?this.quickEdit("taxonomy"):"edit.php"===WPGlobusAdmin.page?(this.quickEdit("post"),0<_.size(WPGlobusAdmin.$_get)&&WPGlobusDialogApp.init()):"options-general.php"==WPGlobusAdmin.page?(this.optionsGeneral(),WPGlobusDialogApp.init({customData:WPGlobusCoreData.page_custom_data})):"widgets.php"==WPGlobusAdmin.page?(WPGlobusWidgets.init(),WPGlobusDialogApp.init({dialogTitle:"Edit text"})):"wpglobus_options"==WPGlobusAdmin.page?this.start():"wpglobusAdminCentral"==WPGlobusAdmin.page?this.adminCentral():WPGlobusDialogApp.init({customData:WPGlobusCoreData.page_custom_data})},parseBool:function(t){return!/^(false|0)$/i.test(t)&&!!t},getCurrentTab:function(){return c(".wpglobus-post-body-tabs-list .ui-tabs-active").data("language")},adminInit:function(){var t,a=c(".wpglobus-addons-group a").data("key");void 0!==a&&(0<=window.location.search.indexOf("page=wpglobus_options&tab="+a)?WPGlobusCoreData.multisite?window.location=WPGlobusCoreData.pluginInstallLocation.multisite:window.location=WPGlobusCoreData.pluginInstallLocation.single:(t=c("#toplevel_page_wpglobus_options li").eq(a+1),WPGlobusCoreData.multisite?c(t).find("a").attr("href",WPGlobusCoreData.pluginInstallLocation.multisite).attr("onclick","window.location=jQuery(this).attr('href');return false;"):c(t).find("a").attr("href",WPGlobusCoreData.pluginInstallLocation.single).attr("onclick","window.location=jQuery(this).attr('href');return false;")))},optionsGeneral:function(){var o=c("#blogname"),t=c("body");o.addClass("hidden"),c("#wpglobus-blogname").insertAfter(o).removeClass("hidden"),t.on("blur",".wpglobus-blogname",function(){c(".wpglobus-blogname").each(function(t,a){var e=c(a);o.val(WPGlobusCore.getString(o.val(),e.val(),e.data("language")))})});var n=c("#blogdescription");n.addClass("hidden"),c("#wpglobus-blogdescription").insertAfter(n).removeClass("hidden"),t.on("blur",".wpglobus-blogdesc",function(){c(".wpglobus-blogdesc").each(function(t,a){var e=c(a);n.val(WPGlobusCore.getString(n.val(),e.val(),e.data("language")))})})},quickEdit:function(n){var o,l,i,t;void 0!==WPGlobusAdmin.data.has_items&&WPGlobusAdmin.data.has_items&&(o="",l=0,c(document).ajaxComplete(function(t,a,e){void 0!==e.data&&""!=o&&0<=e.data.indexOf("action=inline-save-tax&")&&(c("#"+o+" a.row-title").text(WPGlobusAdmin.qedit_titles[l][WPGlobusAdmin.data.language].name),c("#"+o+" .description").text(WPGlobusAdmin.qedit_titles[l][WPGlobusAdmin.data.language].description))}),i={},c("#the-list tr").each(function(t,a){var e=c(a),o="post"===n?"post-":"tag-";l=e.attr("id").replace(o,""),i[l]={},"post"===n?i[l].source=e.find(".post_title").text():"taxonomy"===n&&(i[l].source=c("#inline_"+l+" .name").text())}),(t={action:"get_titles"}).type=n,t.taxonomy=void 0!==WPGlobusAdmin.data.taxonomy&&WPGlobusAdmin.data.taxonomy,t.title=i,c.ajax({type:"POST",url:WPGlobusAdmin.ajaxurl,data:{action:WPGlobusAdmin.process_ajax,order:t},dataType:"json"}).done(function(t){WPGlobusAdmin.qedit_titles=t.qedit_titles,c.each(t.bulkedit_post_titles,function(t,a){c("#inline_"+t+" .post_title").text(a[WPGlobusAdmin.data.language].name)})}).fail(function(t){}).always(function(t,a){}),c("body").on("change",".wpglobus-quick-edit-title",function(){var n="",i=[];c(".wpglobus-quick-edit-title").each(function(t,a){var e=c(a),o=e.data("language");""!==e.val()&&(n=WPGlobusCore.getString(n,e.val(),o)),WPGlobusAdmin.qedit_titles[l][o].name=e.val(),i[t]=o});var t=c(document).triggerHandler("wpglobus_get_translations",{string:n,lang:i,id:l});void 0!==t&&(n=t),c("input.ptitle").eq(0).attr("value",n),WPGlobusAdmin.qedit_titles[l].source=n}),void 0!==WPGlobusAdmin.data.tags&&c.each(WPGlobusAdmin.data.tags,function(t,a){WPGlobusAdmin.data.value[a].post_id={}}),c("button.save, input#bulk_edit").on("mouseenter",function(t){void 0!==WPGlobusAdmin.data.tags&&("bulk_edit"==t.currentTarget.id?c("input#bulk_edit").unbind("click"):c("button.save").unbind("click"),c("button.save, input#bulk_edit").on("click",function(a){var t=c.when(),e=(c(this),c.Deferred());e.resolve(function(t){t.next(".spinner").css({visibility:"visible"}),"bulk_edit"!=a.currentTarget.id&&c.ajaxSetup({async:!1});var o,n,i,l=t.parents("tr"),s=l.attr("id").replace("edit-","");c.each(WPGlobusAdmin.data.tags,function(t,a){if(0==(o=l.find("textarea[name='"+WPGlobusAdmin.data.names[a]+"']")).length)return!0;WPGlobusAdmin.data.value[a].post_id[s]=o.val(),n=WPGlobusAdmin.data.value[a].post_id[s].split(","),i=[];for(var e=0;e<n.length;e++)n[e]=n[e].trim(" "),""!=n[e]&&(void 0===WPGlobusAdmin.data.tag[a][n[e]]?i[e]=n[e]:i[e]=WPGlobusAdmin.data.tag[a][n[e]]);o.val(i.join(", "))})}(c(this))),t=t.then(function(){return c.when(e.done())}).then(function(){"bulk_edit"!=a.currentTarget.id&&setTimeout(function(){inlineEditPost.save(l),c.ajaxSetup({async:!0})},50)})}))}),c("#the-list").on("click",".editinline",function(){var t=c(this);if(o=t.parents("tr").attr("id"),"post"===n)l=o.replace("post-","");else{if("taxonomy"!==n)return;l=o.replace("tag-","")}"post"===n&&void 0!==WPGlobusAdmin.data.tags&&c.each(WPGlobusAdmin.data.tags,function(t,a){var e,o;""==WPGlobusAdmin.data.value[a]||void 0!==(e=c("#edit-"+l+' textarea[name="'+WPGlobusAdmin.data.names[a]+'"]').val())&&(o=e.split(","),c.each(o,function(t,a){e=e.replace(a,WPGlobusCore.TextFilter(a,WPGlobusCoreData.language))}),c("#edit-"+l+' textarea[name="'+WPGlobusAdmin.data.names[a]+'"]').val(e))});var a=c("#edit-"+l+" input.ptitle").eq(0),e=a.parents("label");a.val(WPGlobusAdmin.qedit_titles[l].source),a.addClass("hidden"),c(WPGlobusAdmin.data.template).insertAfter(e),void 0===WPGlobusAdmin.qedit_titles[l]&&(WPGlobusAdmin.qedit_titles[l]={},WPGlobusAdmin.qedit_titles[l].source=c("#"+o+" .name a.row-title").text(),c(WPGlobusAdmin.data.enabled_languages).each(function(t,a){WPGlobusAdmin.qedit_titles[l][a]={},a==WPGlobusAdmin.data.default_language?WPGlobusAdmin.qedit_titles[l][a].name=WPGlobusAdmin.qedit_titles[l].source:WPGlobusAdmin.qedit_titles[l][a].name="",WPGlobusAdmin.qedit_titles[l][a].description=""})),c(".wpglobus-quick-edit-title").each(function(t,a){var e=c(a),o=e.data("language");e.attr("id",o+l),void 0!==WPGlobusAdmin.qedit_titles[l][o]&&(WPGlobusAdmin.qedit_titles[l][o].name=WPGlobusAdmin.qedit_titles[l][o].name.replace(/\\\'/g,"'"),WPGlobusAdmin.qedit_titles[l][o].name=WPGlobusAdmin.qedit_titles[l][o].name.replace(/\\\"/g,'"'),e.attr("value",WPGlobusAdmin.qedit_titles[l][o].name),WPGlobusAdmin.qedit_titles[l].source=WPGlobusCore.getString(WPGlobusAdmin.qedit_titles[l].source,WPGlobusAdmin.qedit_titles[l][o].name,o))}),c("input.ptitle").eq(0).attr("value",WPGlobusAdmin.qedit_titles[l].source)}))},taxonomyEdit:function(){var a=[];a[0]="name",a[1]="description";c.each(WPGlobusCoreData.enabled_languages,function(t,u){c.each(a,function(t,a){var e,o,n,i,l,s,d;o=u,n=c("#"+(e=a)),i=n.clone(),l=n.attr("name"),s="wpglobus-element wpglobus-element_"+e+" wpglobus-element_"+o+" wpglobus-translatable",d=(d=document.getElementById(e)).nodeName,c(i).attr("id",e+"_"+o),c(i).attr("name",l+"_"+o),o!==WPGlobusCoreData.default_language&&(s+=" hidden"),c(i).attr("class",s),c(i).attr("data-save-to",e),c(i).attr("data-language",o),"INPUT"==d?c(i).attr("value",c("#wpglobus-link-tab-"+o).data(e)):"TEXTAREA"==d&&c(i).text(c("#wpglobus-link-tab-"+o).data(e)),n.addClass("hidden"),0==c(".wpglobus-element_"+e).length?c(i).insertAfter(n):c(i).insertAfter(c(".wpglobus-element_"+e).last())})}),c(".wpglobus-taxonomy-tabs").insertAfter("#ajax-response"),c(".wrap").tabs(),c("body").on("click",".wpglobus-taxonomy-tabs li",function(t){var a=c(this).data("language");c(".wpglobus-element").addClass("hidden"),c(".wpglobus-element_"+a).removeClass("hidden")}),c(".wpglobus-element").on("change",function(){var n=c(this).data("save-to"),i="";c(".wpglobus-element").each(function(t,a){var e=c(a),o=e.val();e.data("save-to")==n&&""!==o&&(i+=WPGlobusCore.addLocaleMarks(o,e.data("language")))}),c("#"+n).val(i)}),c(WPGlobusAdmin.data.multilingualSlug.title).insertAfter(".term-slug-wrap th label")},navMenus:function(){function e(){n!==c(i).length&&(clearInterval(o),c(i).each(function(t,a){var l,e=c(a);e.hasClass("wpglobus-menu-item")||(l=c(a).attr("id"),c.each(["input.edit-menu-item-title","input.edit-menu-item-attr-title"],function(t,a){var e,o,n=c("#"+l+" "+a),i=c(n);i.hasClass("wpglobus-hidden")||(i.addClass("wpglobus-hidden"),i.css("display","none"),e=i.parent("label"),o=i.parents("p"),c(o).css("height","80px"),c(e).append('<div style="color:#f00;">'+WPGlobusAdmin.i18n.save_nav_menu+"</div>"))}),e.addClass("wpglobus-menu-item"))}))}var o,n,i="#menu-to-edit .menu-item";c.ajaxSetup({beforeSend:function(t,a){void 0!==a.data&&0<=a.data.indexOf("action=add-menu-item")&&(n=c(i).length,o=setInterval(e,500))}}),c(i).each(function(t,a){var e=c(a).attr("id"),u=e.replace("menu-item-","");c.each(["input.edit-menu-item-title","input.edit-menu-item-attr-title"],function(n,i){var l=c("#"+e+" "+i);l.val()!=WPGlobusAdmin.data.items[u][i].source&&l.val(WPGlobusAdmin.data.items[u][i].source);var s=c("#"+e+" "+i).parents("p"),d=0;c.each(WPGlobusAdmin.data.open_languages,function(t,a){var e=l.clone();e.attr("id",l.attr("id")+"-"+a),e.attr("name",l.attr("id")+"-"+a),e.attr("data-language",a),e.attr("data-item-id",u),e.attr("placeholder",WPGlobusAdmin.data.en_language_name[a]);var o=WPGlobusAdmin.data.items[u][a][i].class;0===n&&a===WPGlobusAdmin.data.default_language?e.attr("class",o+" edit-menu-item-title"):e.attr("class",o),""!=WPGlobusAdmin.data.items[u][a][i].caption?e.attr("value",WPGlobusAdmin.data.items[u][a][i].caption):e.attr("value",""),e.css("margin-bottom","0.6em"),c(s).append(e),d=t}),d=40*(d+1),l.css("display","none").attr("class","").addClass("widefat wpglobus-hidden"),c(s).css("height",d+"px").addClass("wpglobus-menu-item-box")}),c(a).addClass("wpglobus-menu-item")}),c(".menus-move-left, .menus-move-right").each(function(t,a){var e,o=c(a),n=(o.parents("li").attr("id").replace("menu-item-",""),o.attr("title"));void 0!==n&&c.each(WPGlobusAdmin.data.post_titles,function(t,a){0<=n.indexOf(t)&&(e=n.replace(t,a),o.attr("title",e),o.text(e))})}),c(".edit-menu-item-title").trigger("change"),wpNavMenu.refreshAdvancedAccessibility(),wpNavMenu.menusChanged=!1,c(".wpglobus-menu-item").on("change",function(){var t,a,e=c(this),o=e.data("item-id");e.hasClass("wpglobus-item-title")&&(t=WPGlobusCore.getString(c("input#edit-menu-item-title-"+o).val(),e.val(),e.data("language")),void 0!==(a=c(document).triggerHandler("wpglobus_get_menu_translations",{string:t,lang:WPGlobusCoreData.open_languages,id:o,type:"input.edit-menu-item-title"}))&&(t=a),c("input#edit-menu-item-title-"+o).val(t)),e.hasClass("wpglobus-item-attr")&&(t=WPGlobusCore.getString(c("input#edit-menu-item-attr-title-"+o).val(),e.val(),e.data("language")),void 0!==(a=c(document).triggerHandler("wpglobus_get_menu_translations",{string:t,lang:WPGlobusCoreData.open_languages,id:o,type:"input.edit-menu-item-attr-title"}))&&(t=a),c("input#edit-menu-item-attr-title-"+o).val(t))});var a=[];setTimeout(function(){c(".edit-menu-item-description").each(function(){var t=c(this).attr("id");a.push(t),WPGlobusDialogApp.addElement(t)}),c(".wpglobus_dialog_start").each(function(){c(this).css({"font-style":"normal"}),c(this).after("<br />")});var t={action:"getNavMenuItemsDescription"};t.menuItems=a,c.ajax({type:"POST",url:WPGlobusAdmin.ajaxurl,data:{action:WPGlobusAdmin.process_ajax,order:t},dataType:"json"}).done(function(t){"object"==typeof t&&c.each(t,function(t,a){""!=a&&(c("#"+t).val(a),c("#wpglobus-"+t).val(WPGlobusCore.TextFilter(a,WPGlobus.language,"RETURN_EMPTY")))})}).fail(function(t){}).always(function(t,a){})},1e3)},postEdit:function(){c(document).on("heartbeat-send",function(t,o){void 0!==o.wp_autosave&&(o.wpglobus_heartbeat="wpglobus",c.each(WPGlobusAdmin.data.open_languages,function(t,a){var e=c("#title_"+a).val()||"";""!=(e=c.trim(e))&&(o.wp_autosave["post_title_"+a]=e),e=c("#content_"+a).val()||"",""!=(e=c.trim(e))&&(o.wp_autosave["content_"+a]=e)}))});var a,l,s,e="#postdivrich",o=!0,i="#post-body-content";!1===WPGlobusAdmin.data.support.editor&&(o=!(e="#titlediv")),!1===WPGlobusAdmin.data.support.title&&(o=!1),c(i).prepend(c(".wpglobus-post-body-tabs-list")),c.each(WPGlobusAdmin.tabs,function(t,a){"default"===a?(c(e).wrap('<div id="tab-default"></div>'),o&&c(c("#titlediv")).insertBefore(e)):(c(e+"-"+a).wrap('<div id="tab-'+a+'"></div>'),o&&c(c("#titlediv-"+a)).insertBefore(e+"-"+a))}),setTimeout(function(){var u=!1;c(i).addClass("wpglobus-post-body-tabs").tabs({beforeActivate:function(t,a){var e,o,l,s;u||(o=(e=c("#wp-content-editor-container .mce-btn-group").eq(0)).children("div"),0!=e.length&&0!=o.length&&(l=e.attr("style"),s=o.attr("style"),c.each(WPGlobusCoreData.enabled_languages,function(t,a){if(a!=WPGlobusCoreData.default_language){var e=c("#wp-content_"+a+"-editor-container .mce-btn-group").eq(0),o=e.children("div");if(0==e.length||0==o.length)return!0;var n=e.attr("style"),i=o.attr("style");l!=n&&e.attr("style",l),s!=i&&o.attr("style",s)}}),u=!0));var n=a.oldTab[0].id.replace("link-tab-",""),i=a.newTab[0].id.replace("link-tab-","");c(".wpglobus-tab-link").removeClass("wpglobus-tab-link-active"),c("#link-tab-"+i+" .wpglobus-tab-link").addClass("wpglobus-tab-link-active"),"default"==n&&(n=WPGlobusCoreData.default_language),"default"==i&&(i=WPGlobusCoreData.default_language);var d=c(document).triggerHandler("wpglobus_post_body_tabs",[n,i]);return!(!d&&void 0!==d)}})},500),c("#title").val(WPGlobusAdmin.title),c("#content").text(WPGlobusAdmin.content),"undefined"!=typeof WPGlobusVendor&&WPGlobusVendor.vendor.WPSEO&&("undefined"!=typeof wpglobus_wpseo?wpglobus_wpseo():"undefined"!=typeof WPGlobusYoastSeo&&("undefined"!=typeof WPGlobusYoastSeoPremium&&WPGlobusYoastSeoPremium&&"function"==typeof WPGlobusYoastSeoPremium.init&&WPGlobusYoastSeoPremium.init(),"function"==typeof WPGlobusYoastSeo.init&&WPGlobusYoastSeo.init())),WPGlobusAdmin.data.modify_excerpt&&((a=c("#excerpt")).addClass("hidden").css({display:"none"}),c(WPGlobusAdmin.data.template).insertAfter(a),c("body").on("change",".wpglobus-excerpt",function(){var t=c(this);a.val(WPGlobusCore.getString(a.val(),t.val(),t.data("language")))})),void 0!==wp.utils&&void 0!==wp.utils.WordCounter&&(WPGlobusCoreData.wordCounter={},l=this,s={},c.each(WPGlobusCoreData.enabled_languages,function(t,a){return a==WPGlobusCoreData.default_language||(s[t]="content_"+a,n=jQuery,e=new wp.utils.WordCounter,i=a,WPGlobusCoreData.wordCounter[i]={},WPGlobusCoreData.wordCounter[i].counter=e,void n(function(){function o(t){var a,e;"object"==typeof t&&(t="tinymce"==t?l.getCurrentTab():t.target.id.replace("content_","")),void 0!==WPGlobusCoreData.wordCounter[t]&&(a=!WPGlobusCoreData.wordCounter[t].contentEditor||WPGlobusCoreData.wordCounter[t].contentEditor.isHidden()?WPGlobusCoreData.wordCounter[t].content.val():WPGlobusCoreData.wordCounter[t].contentEditor.getContent({format:"raw"}),(e=WPGlobusCoreData.wordCounter[t].counter.count(a))!==WPGlobusCoreData.wordCounter[t].prevCount&&WPGlobusCoreData.wordCounter[t].count.text(e),WPGlobusCoreData.wordCounter[t].prevCount=e)}WPGlobusCoreData.wordCounter[i].content=n("#content_"+i),WPGlobusCoreData.wordCounter[i].count=n("#wp-word-count-"+i).find(".word-count-"+i),WPGlobusCoreData.wordCounter[i].prevCount=0,n(document).on("tinymce-editor-init",function(t,a){var e;-1!=n.inArray(a.id,s)&&(e=a.id.replace("content_",""),(WPGlobusCoreData.wordCounter[e].contentEditor=a).on("nodechange keyup",_.debounce(o,1e3)))}),WPGlobusCoreData.wordCounter[i].content.on("input keyup",_.debounce(o,1e3)),o(i)}));var n,e,i})),c(document).on("click","#publish, #save-post",function(){var e,t,o,n;1<WPGlobusAdmin.data.open_languages.length&&(c(document).triggerHandler("wpglobus_before_save_post",{content_tabs_id:i}),e=c("#title").val(),n=o="",0==e.length&&(t=WPGlobusAdmin.data.open_languages.indexOf(WPGlobusAdmin.data.default_language),WPGlobusAdmin.data.open_languages.splice(t,1),c(WPGlobusAdmin.data.open_languages).each(function(t,a){n=0==t?"":"-",0<(e=c("#title_"+a).val()).length&&(0==o.length&&(n=""),o=o+n+e)})),0<o.length&&c("#title").val(o)),void 0===WPGlobusAdmin.data.tagsdiv||WPGlobusAdmin.data.tagsdiv.length<1||c(WPGlobusAdmin.data.tagsdiv).each(function(t,a){if(0==c("#"+a).length)return!0;var e=a.replace("tagsdiv-","");if("undefined"===e)return!0;if(0==c("#tax-input-"+e).length)return!0;var o,n=[];c("#tagsdiv-"+e+" .tagchecklist li").each(function(t,a){o=(o=c(a).html()).replace(/<button.*<\/button> /,""),void 0===WPGlobusAdmin.data.tag[e][o]?n[t]=o:n[t]=WPGlobusAdmin.data.tag[e][o]}),c("#tax-input-"+e).val(n.join(", "))})}),c(".ui-state-default").on("click",function(){"link-tab-default"===c(this).attr("id")&&(c(window).scrollTop(c(window).scrollTop()+1),c(window).scrollTop(c(window).scrollTop()-1))}),c(document).on("tabsactivate",i,function(t,a){WPGlobusAdmin.currentTab=a.newTab[0].dataset.language}),c("#titlewrap input").addClass("wpglobus-translatable"),c(".title_wpglobus").addClass("wpglobus-translatable"),c(document).triggerHandler("wpglobus_after_post_edit")},adminCentral:function(){c(".wpglobus-admin-central-tab").css({display:"none"}),1<c(".nav-tab-active").length&&c(".wpglobus-about-wrap .nav-tab-wrapper a").removeClass("nav-tab-active");var e=!0;0==location.hash.indexOf("#")&&c(".wpglobus-about-wrap .nav-tab-wrapper a").each(function(t,a){c(a).attr("href")==location.hash&&(e=!1,c(a).addClass("nav-tab-active"))}),e&&c(".wpglobus-about-wrap .nav-tab-wrapper a").eq(0).addClass("nav-tab-active");var t=c(".wpglobus-about-wrap .nav-tab-active").data("tab-id");""!=t&&c("#"+t).css({display:"block"}),c(document).on("click",".wpglobus-about-wrap .nav-tab",function(t){var a=c(this);a.hasClass("nav-tab-active")||(c(".wpglobus-admin-central-tab").css({display:"none"}),c(".wpglobus-about-wrap .nav-tab").removeClass("nav-tab-active"),a.addClass("nav-tab-active"),""!=a.data("tab-id")&&c("#"+a.data("tab-id")).css({display:"block"}))})},start:function(){var a=this;c("#wpglobus_flags").select2({formatResult:this.format,formatSelection:this.format,minimumResultsForSearch:-1,escapeMarkup:function(t){return t}}),c("body").on("click","#enabled_languages-list li:first input",function(t){return t.preventDefault(),c(".redux-save-warn").css({display:"none"}),c("#enabled_languages-list").find("li:first > input").val("1"),0===c("#disable_first_language").length&&c(a.config.disable_first_language).insertAfter("#info_bar"),!1})},format:function(t){return'<img class="wpglobus_flag" src="'+WPGlobusAdmin.flag_url+t.text+'"/> '+t.text},set_dialog:function(){var o,e,n;void 0!==WPGlobusAdmin.data.customFieldsEnabled&&(WPGlobusAdmin.data.customFieldsEnabled=this.parseBool(WPGlobusAdmin.data.customFieldsEnabled),!WPGlobusAdmin.data.customFieldsEnabled)||(void 0===WPGlobusAdmin.data.excludeCustomFields&&(WPGlobusAdmin.data.excludeCustomFields=!1),e=!1,(n=function(t){var s,d,u="wpglobus_dialog_start wpglobus_dialog_icon",r=['<div class="wpglobus_dialog_options_wrapper hidden">','<input style="width:initial;" id="wpglobus-cb-{{id}}" data-object="#wpglobus-dialog-start-{{id}}" data-meta-key="{{meta-key}}" class="wpglobus_dialog_option wpglobus_dialog_cb" type="checkbox" {{checked}} />',"</div>"].join(""),a=void 0===t?"#the-list tr":"#the-list tr#"+t;c(a).each(function(){var t,a,e,o=c(this),n=o.attr("id"),i=o.find("textarea"),l=u;return void 0===(s=i.attr("id"))||(e=c("#"+n+"-key").val(),!(!WPGlobusAdmin.data.excludeCustomFields||-1==c.inArray(e,WPGlobusAdmin.data.excludeCustomFields))||(t=c("#"+s).clone(),c(i).addClass("wpglobus-dialog-field-source hidden"),a=i.attr("name"),c(t).attr("id","wpglobus-"+s),c(t).attr("name","wpglobus-"+a),c(t).attr("data-source-id",s),c(t).attr("class","wpglobus-dialog-field"),c(t).val(WPGlobusCore.TextFilter(c(i).val(),WPGlobusCoreData.language)),c(t).insertAfter(i),d=(d=r.replace(/{{id}}/g,s)).replace(/{{meta-key}}/g,e),void 0===WPGlobusAdmin.data.post_meta_settings[WPGlobusAdmin.data.post_type]?d=d.replace(/{{checked}}/,"checked"):l=void 0!==WPGlobusAdmin.data.post_meta_settings[WPGlobusAdmin.data.post_type][e]&&"false"==WPGlobusAdmin.data.post_meta_settings[WPGlobusAdmin.data.post_type][e]?(d=d.replace(/{{checked}}/,""),u+" wpglobus_dialog_start_hidden"):(d=d.replace(/{{checked}}/,"checked"),u),void o.append('<td style="width:20px;"><div id="wpglobus-dialog-start-'+s+'" data-type="control" data-source-type="textarea" data-source-id="'+s+'" class="'+l+'"></div>'+d+"</td>")))}),!e&&0<c("#list-table .wpglobus_dialog_start").length&&(c("#list-table thead tr").append('<th class="wpglobus-control-head"><div class="wpglobus_dialog_settings wpglobus_dialog_icon"></div></th>'),e=!0)})(),c("body").on("change",".wpglobus-dialog-field",function(){var e,o,n=c(this),t="#"+n.data("source-id"),i="";e=c(t).val(),/(\{:|\[:|<!--:)[a-z]{2}/.test(e)?(c.each(WPGlobusCoreData.enabled_languages,function(t,a){""!=(o=a==WPGlobusCoreData.language?n.val():WPGlobusCore.TextFilter(e,a,"RETURN_EMPTY"))&&(i+=WPGlobusCore.addLocaleMarks(o,a))}),c(t).val(i)):c(t).val(n.val())}),c(document).ajaxSend(function(t,a,e){"add-meta"==e.action&&(o=e.element)}),c(document).ajaxComplete(function(t,a,e){"add-meta"==e.action&&void 0!==a.responseXML&&n("newmeta"==o?"meta-"+c(a.responseXML.documentElement.outerHTML).find("meta").attr("id"):o)}),WPGlobusDialogApp.init({dialogTitle:"Edit meta"}))}},new t.App,t)});
|
1 |
+
var WPGlobusCore,WPGlobusDialogApp;!function(i){var d=WPGlobusCore={strpos:function(t,a,e){e=(t=""+t).indexOf(a,e);return 0<=e&&e},TextFilter:function(t,a,e){if(void 0===t||""===t)return t;var o,n,i=[],l=!1;a=""==a?"en":a,e=void 0===e||""==e?"RETURN_IN_DEFAULT_LANGUAGE":e,i[0]=[],i[0].start=WPGlobusCoreData.locale_tag_start.replace("%s",a),i[0].end=WPGlobusCoreData.locale_tag_end,i[1]=[],i[1].start="\x3c!--:"+a+"--\x3e",i[1].end="\x3c!--:--\x3e",i[2]=[],i[2].start="[:"+a+"]",i[2].end="[:";for(var s=0;s<3;s++)if(!1!==(o=d.strpos(t,i[s].start))){o+=i[s].start.length,t=!1===(n=d.strpos(t,i[s].end,o))?t.substr(o):t.substr(o,n-o),l=!0;break}return l||("RETURN_EMPTY"==e?a==WPGlobusCoreData.default_language&&!/(\{:|\[:|<!--:)[a-z]{2}/.test(t)||(t=""):a==WPGlobusCoreData.default_language?/(\{:|\[:|<!--:)[a-z]{2}/.test(t)&&(t=""):t=d.TextFilter(t,WPGlobusCoreData.default_language)),t},addLocaleMarks:function(t,a){return WPGlobusCoreData.locale_tag_start.replace("%s",a)+t+WPGlobusCoreData.locale_tag_end},getTranslations:function(e){var o,n={};return i.each(WPGlobusCoreData.enabled_languages,function(t,a){o=a==WPGlobusCoreData.default_language?"RETURN_IN_DEFAULT_LANGUAGE":"RETURN_EMPTY",n[a]=d.TextFilter(e,a,o)}),n},getString:function(t,a,e){if(void 0===t)return t;void 0===a&&(a=""),void 0===e&&(e=WPGlobusCoreData.language),(t=d.getTranslations(t))[e]=a;var o="";return i.each(t,function(t,a){""!=a&&t!=WPGlobusCoreData.default_language&&(o+=d.addLocaleMarks(a,t))}),o=""!=t[WPGlobusCoreData.default_language]?""==o?t[WPGlobusCoreData.default_language]:d.addLocaleMarks(t[WPGlobusCoreData.default_language],WPGlobusCoreData.default_language)+o:o}}}(jQuery),function(c){var g=WPGlobusDialogApp={option:{listenClass:".wpglobus_dialog_start",settingsClass:".wpglobus_dialog_settings",dialogTabs:"#wpglobus-dialog-tabs",dialogTitle:"",customData:null,callback:function(){},dialogOptions:{title:"",placeholder:"",formFooter:"",beforeOpen:function(){},afterOpen:function(){},afterSave:function(){},close:function(){}},dialog:{}},form:void 0,element:void 0,element_by:"id",id:"",clone_id:"",wpglobus_id:"",type:"textarea",source:"",order:{},value:{},request:"core",attrs:{},dialogTitle:"",trClass:"wpglobus-translatable",startButton:['<span id="wpglobus-dialog-start-{{clone_id}}" ','style="{{style}}" ','data-type="control" data-dialog-title="{{title}}" ','data-source-type="" data-source-id="{{id}}" data-source-name="{{name}}" ','data-nodename="{{nodename}}"',"{{sbTitle}} ",'class="{{classes}}"></span>'].join(""),startButtonClass:"wpglobus_dialog_start wpglobus_dialog_icon",clicks:0,init:function(t){g.option.dialog=g.option.dialogOptions,g.option=c.extend(g.option,t),c(g.option.dialogTabs).tabs(),g.dialogTitle=g.option.dialogTitle,this.attachListener(),null!=g.option.customData&&void 0!==g.option.customData.addElements&&c.each(g.option.customData.addElements,function(t,a){g.addElement(a)})},convertToId:function(t){return t=(t=t.replace(/\]/g,"")).replace(/\[/g,"-")},addElement:function(t){var a={id:null,style:"",styleTextareaWrapper:"",sbTitle:"",onChangeClass:"",dialogTitle:"",dialog:g.option.dialogOptions};if("string"==typeof t)a.id=t;else{if("object"!=typeof t)return;a=c.extend(a,t)}var e,o=null,n=null,i=null,l=null,s=g.startButton,d="";if(g.element_by="name",0==(l=document.getElementsByName(a.id)).length&&(g.element_by="id",l=document.getElementById(a.id)),null!==l){if(n=a.id,i=void 0===(o="id"==g.element_by?c("#"+n):(d=(d=l[0].nodeName).toLowerCase(),c(d+'[name="'+n+'"]'))).attr("name")||""==o.attr("name")?n:o.attr("name"),g.clone_id=g.convertToId(n),-1!=i.indexOf("wpglobus")||-1!=g.clone_id.indexOf("wpglobus"))return!1;if(0<c("#wpglobus-"+g.clone_id).length)return!1;if(0<c(d+'[name="wpglobus-'+i+'"]').length)return!1;t=c(o.clone()),l=o.attr("style")||"",o.attr("style","display:none;"),t.attr("id","wpglobus-"+g.clone_id).attr("name","wpglobus-"+i),t.addClass(g.trClass),""!=a.onChangeClass&&t.addClass(a.onChangeClass),("id"==g.element_by?t.attr("data-source-id",n).attr("data-source-name",""):t.attr("data-source-id","").attr("data-source-name",i)).attr("data-source-get-by",g.element_by),"textarea"==d?(e=WPGlobusCore.getTranslations(o.val())[WPGlobusCoreData.language],t.val(e),t.attr("data-nodename","textarea"),""==a.style?t.attr("style",l+";width:95%;float:left;"):t.attr("style",l+";"+a.style)):(e=WPGlobusCore.getTranslations(o.val())[WPGlobusCoreData.language],t.attr("value",e),t.attr("data-nodename","input"),""!=a.style&&t.attr("style",l+";"+a.style)),""!=a.dialog&&t.attr("data-dialog",JSON.stringify(a.dialog)),s=s.replace(/{{clone_id}}/g,g.clone_id),s="id"==g.element_by?(s=(s=s.replace(/{{id}}/g,g.clone_id)).replace(/{{name}}/g,"")).replace(/{{nodename}}/g,""):(s=(s=s.replace(/{{id}}/g,"")).replace(/{{name}}/g,i)).replace(/{{nodename}}/g,d);s="textarea"==d?s.replace("{{style}}","float:left;margin-top:0;"):s.replace("{{style}}",""),i="textarea"==d?g.startButtonClass+" wpglobus-textarea wpglobus-textarea-"+g.clone_id:g.startButtonClass;s=s.replace("{{classes}}",i),s=""==a.dialogTitle?s.replace("{{title}}",g.dialogTitle):s.replace("{{title}}",a.dialogTitle),s=""==a.sbTitle?s.replace("{{sbTitle}}",a.sbTitle):s.replace("{{sbTitle}}",'title="'+a.sbTitle+'"'),c(s).insertAfter(o),c(t).insertAfter(o),"textarea"==d&&(c("#wpglobus-"+g.clone_id).addClass("wpglobus-textarea-"+g.clone_id),c(".wpglobus-textarea-"+g.clone_id).wrapAll('<div class="wpglobus-textarea-wrapper" style="'+a.styleTextareaWrapper+'"></div>'));var u,r=!1;return(""==a.onChangeClass?u="#wpglobus-"+g.clone_id:(u="."+a.onChangeClass,void 0===(a=c._data(c(document)[0],"events"))?r=!0:void 0!==a.change&&c.each(a.change,function(t,a){if(a.selector==u)return!(r=!0)})),r)?!0:(c(document).on("change",u,function(){var t=c(this),a=""==(a=t.data("source-id"))?t.data("nodename")+'[name="'+t.data("source-name")+'"]':"#"+a;c(a).val(WPGlobusCore.getString(c(a).val(),t.val()))}),!0)}},saveDialog:function(){var e,o,n="",i="",l="";c(".wpglobus_dialog_textarea").each(function(t,a){o=c(a),e=o.val(),(o=o.data("language"))==WPGlobusAdmin.data.language&&(l=e),""!=e&&(n+=WPGlobusCore.addLocaleMarks(e,o),o==WPGlobusCoreData.default_language&&(i=e))}),n=n.length==i.length+8?i:n,c(g.id).val(n),n=""==l?i:l,c(g.wpglobus_id).val(n),g.runCallback(g.option.dialog.afterSave)},dialog:c("#wpglobus-dialog-wrapper").dialog({autoOpen:!1,width:650,modal:!0,dialogClass:"wpglobus-dialog",buttons:[{text:"Save",class:"wpglobus-button-save",click:function(){g.saveDialog(),g.dialog.dialog("close")}},{text:"Cancel",class:"wpglobus-button-cancel",click:function(){g.dialog.dialog("close")}}],open:function(t,a){var e=g.dialogTitle;void 0!==g.attrs.maxlength&&(c(".wpglobus_dialog_textarea").attr("maxlength",g.attrs.maxlength),e+=" | maxlength="+g.attrs.maxlength),c(".wpglobus-dialog .ui-dialog-title").text(e),c(this).removeClass("hidden")},close:function(){c(this).addClass("hidden"),g.runCallback(g.option.dialog.close),g.form[0].reset()}}),attachListener:function(){c(document).on("click",g.option.settingsClass,function(){c(".wpglobus_dialog_options_wrapper").hasClass("hidden")?c(".wpglobus_dialog_options_wrapper").removeClass("hidden"):c(".wpglobus_dialog_options_wrapper").addClass("hidden")}),c(document).on("click",".wpglobus_dialog_option",function(t){var a=c(this),e=a.data("object");g.order.action="save_post_meta_settings",g.order.post_type=WPGlobusAdmin.data.post_type,g.order.checked=a.prop("checked"),g.order.id=a.attr("id"),g.order.meta_key=a.data("meta-key"),g.ajax(g.order).done(function(t){"ok"==t.result&&("true"==t.checked?c(e).removeClass("wpglobus_dialog_start_hidden"):c(e).addClass("wpglobus_dialog_start_hidden"))}).fail(function(t){}).always(function(t,a){})}),c(document).on("click",g.option.listenClass,function(a){g.element=c(this),g.id=g.element.data("source-id"),""==g.id?(g.id=g.element.data("nodename")+'[name="'+g.element.data("source-name")+'"]',g.wpglobus_id="#wpglobus-"+g.convertToId(g.element.data("source-name"))):(g.wpglobus_id="#wpglobus-"+g.id,g.id="#"+g.id),g.clicks++,1==g.clicks&&setTimeout(function(){var t;1==g.clicks?g.onClick(a):(t=c(g.id)).hasClass("hidden")?t.removeClass("hidden").attr("style","display:block;"):t.addClass("hidden").attr("style","display:none;"),g.clicks=0},200)}),g.form=g.dialog.find("form#wpglobus-dialog-form").on("submit",function(t){t.preventDefault(),g.saveDialog()})},ajax:function(t){return c.ajax({type:"POST",url:WPGlobusAdmin.ajaxurl,data:{action:WPGlobusAdmin.process_ajax,order:t},dataType:"json",async:!1})},onClick:function(t){void 0===g.element.data("dialog-title")||""==g.element.data("dialog-title")?g.dialogTitle=g.option.dialogTitle:g.dialogTitle=g.element.data("dialog-title"),void 0!==g.id&&(g.attrs.maxlength=c(g.id).attr("maxlength")),g.source=g.element.data("source-value"),void 0===g.source&&(g.source=c(g.id).val(),"ajax"==g.request||(g.value=WPGlobusCore.getTranslations(g.source))),g.option.dialog=c.extend({},g.option.dialogOptions,c(g.wpglobus_id).data("dialog")),""!=g.option.dialog.title&&(g.dialogTitle=g.option.dialog.title),c.each(g.value,function(t,a){var e=c("#wpglobus-dialog-"+t);e.val(a),e.attr("placeholder",WPGlobusCore.TextFilter(g.option.dialog.placeholder,t,"RETURN_IN_DEFAULT_LANGUAGE"))}),c("#wpglobus-dialog-form-footer").html(g.option.dialog.formFooter),g.runCallback(g.option.dialog.beforeOpen),g.dialog.dialog("open"),g.runCallback(g.option.dialog.afterOpen)},runCallback:function(t){var a,e;"object"==typeof t?(a=Object.keys(t)[0],e=t[Object.keys(t)[0]],"window"===a?"function"==typeof window[e]&&window[e](t[Object.keys(t)[1]]):"function"==typeof window[a][e]&&window[a][e](t[Object.keys(t)[1]])):"string"==typeof t?"function"==typeof window[t]&&window[t]():"function"==typeof t&&t()}}}(jQuery),jQuery(document).ready(function(){"use strict";var t,r;window.WPGlobusAdminApp=(t=window.WPGlobusAdminApp||{},r=jQuery,t.App=function(t){void 0===window.WPGlobusAdminApp&&(this.config={debug:!1,version:WPGlobusAdmin.version},this.status="ok","undefined"==typeof WPGlobusAdmin?(this.status="error",this.config.debug&&console.log("WPGlobus: error options loading")):this.config.debug&&console.dir(WPGlobusAdmin),this.config.disable_first_language=['<div id="disable_first_language" style="display:block;" class="redux-field-errors notice-red">',"<strong>","<span> </span>",WPGlobusAdmin.i18n.cannot_disable_language,"</strong>","</div>"].join(""),r.extend(this.config,t),"ok"===this.status&&this.init())},t.App.prototype={$document:r(document),init:function(){WPGlobusCoreData.multisite=this.parseBool(WPGlobusCoreData.multisite),this.adminInit(),r("#content").addClass("wpglobus-editor").attr("data-language",WPGlobusAdmin.data.default_language),r("textarea[id^=content_]").each(function(t,a){var e=r(a).attr("id").replace("content_","");r(a).attr("data-language",e)}),"post.php"===WPGlobusAdmin.page?(this.postEdit(),this.set_dialog(),"undefined"!=typeof WPGlobusAioseop&&WPGlobusAioseop.init()):"menu-edit"===WPGlobusAdmin.page?(WPGlobusDialogApp.init({dialogTitle:"Edit description"}),this.navMenus()):"taxonomy-edit"===WPGlobusAdmin.page?WPGlobusAdmin.data.tag_id&&this.taxonomyEdit():"taxonomy-quick-edit"===WPGlobusAdmin.page?this.quickEdit("taxonomy"):"edit.php"===WPGlobusAdmin.page?(this.quickEdit("post"),0<_.size(WPGlobusAdmin.$_get)&&WPGlobusDialogApp.init()):"options-general.php"==WPGlobusAdmin.page?(this.optionsGeneral(),WPGlobusDialogApp.init({customData:WPGlobusCoreData.page_custom_data})):"widgets.php"==WPGlobusAdmin.page?(WPGlobusWidgets.init(),WPGlobusDialogApp.init({dialogTitle:"Edit text"})):"wpglobus_options"==WPGlobusAdmin.page?this.start():"wpglobusAdminCentral"==WPGlobusAdmin.page?this.adminCentral():WPGlobusDialogApp.init({customData:WPGlobusCoreData.page_custom_data})},parseBool:function(t){return!/^(false|0)$/i.test(t)&&!!t},getCurrentTab:function(){return r(".wpglobus-post-body-tabs-list .ui-tabs-active").data("language")},adminInit:function(){var t=r(".wpglobus-addons-group a").data("key");void 0!==t&&(0<=window.location.search.indexOf("page=wpglobus_options&tab="+t)?WPGlobusCoreData.multisite?window.location=WPGlobusCoreData.pluginInstallLocation.multisite:window.location=WPGlobusCoreData.pluginInstallLocation.single:(t=r("#toplevel_page_wpglobus_options li").eq(t+1),(WPGlobusCoreData.multisite?r(t).find("a").attr("href",WPGlobusCoreData.pluginInstallLocation.multisite):r(t).find("a").attr("href",WPGlobusCoreData.pluginInstallLocation.single)).attr("onclick","window.location=jQuery(this).attr('href');return false;")))},optionsGeneral:function(){var e=r("#blogname"),t=r("body");e.addClass("hidden"),r("#wpglobus-blogname").insertAfter(e).removeClass("hidden"),t.on("blur",".wpglobus-blogname",function(){r(".wpglobus-blogname").each(function(t,a){a=r(a);e.val(WPGlobusCore.getString(e.val(),a.val(),a.data("language")))})});var o=r("#blogdescription");o.addClass("hidden"),r("#wpglobus-blogdescription").insertAfter(o).removeClass("hidden"),t.on("blur",".wpglobus-blogdesc",function(){r(".wpglobus-blogdesc").each(function(t,a){a=r(a);o.val(WPGlobusCore.getString(o.val(),a.val(),a.data("language")))})})},quickEdit:function(o){var n,i,l,t;void 0!==WPGlobusAdmin.data.has_items&&WPGlobusAdmin.data.has_items&&(n="",i=0,r(document).ajaxComplete(function(t,a,e){void 0!==e.data&&""!=n&&0<=e.data.indexOf("action=inline-save-tax&")&&(r("#"+n+" a.row-title").text(WPGlobusAdmin.qedit_titles[i][WPGlobusAdmin.data.language].name),r("#"+n+" .description").text(WPGlobusAdmin.qedit_titles[i][WPGlobusAdmin.data.language].description))}),l={},r("#the-list tr").each(function(t,a){var e=r(a),a="post"===o?"post-":"tag-";i=e.attr("id").replace(a,""),l[i]={},"post"===o?l[i].source=e.find(".post_title").text():"taxonomy"===o&&(l[i].source=r("#inline_"+i+" .name").text())}),(t={action:"get_titles"}).type=o,t.taxonomy=void 0!==WPGlobusAdmin.data.taxonomy&&WPGlobusAdmin.data.taxonomy,t.title=l,r.ajax({type:"POST",url:WPGlobusAdmin.ajaxurl,data:{action:WPGlobusAdmin.process_ajax,order:t},dataType:"json"}).done(function(t){WPGlobusAdmin.qedit_titles=t.qedit_titles,r.each(t.bulkedit_post_titles,function(t,a){r("#inline_"+t+" .post_title").text(a[WPGlobusAdmin.data.language].name)})}).fail(function(t){}).always(function(t,a){}),r("body").on("change",".wpglobus-quick-edit-title",function(){var o="",n=[];r(".wpglobus-quick-edit-title").each(function(t,a){var e=r(a),a=e.data("language");""!==e.val()&&(o=WPGlobusCore.getString(o,e.val(),a)),WPGlobusAdmin.qedit_titles[i][a].name=e.val(),n[t]=a});var t=r(document).triggerHandler("wpglobus_get_translations",{string:o,lang:n,id:i});void 0!==t&&(o=t),r("input.ptitle").eq(0).attr("value",o),WPGlobusAdmin.qedit_titles[i].source=o}),void 0!==WPGlobusAdmin.data.tags&&r.each(WPGlobusAdmin.data.tags,function(t,a){WPGlobusAdmin.data.value[a].post_id={}}),r("button.save, input#bulk_edit").on("mouseenter",function(t){void 0!==WPGlobusAdmin.data.tags&&(("bulk_edit"==t.currentTarget.id?r("input#bulk_edit"):r("button.save")).unbind("click"),r("button.save, input#bulk_edit").on("click",function(a){var t=r.when(),e=(r(this),r.Deferred());e.resolve(function(t){t.next(".spinner").css({visibility:"visible"}),"bulk_edit"!=a.currentTarget.id&&r.ajaxSetup({async:!1});var o,n,i,l=t.parents("tr"),s=l.attr("id").replace("edit-","");r.each(WPGlobusAdmin.data.tags,function(t,a){if(0==(o=l.find("textarea[name='"+WPGlobusAdmin.data.names[a]+"']")).length)return!0;WPGlobusAdmin.data.value[a].post_id[s]=o.val(),n=WPGlobusAdmin.data.value[a].post_id[s].split(","),i=[];for(var e=0;e<n.length;e++)n[e]=n[e].trim(" "),""!=n[e]&&(void 0===WPGlobusAdmin.data.tag[a][n[e]]?i[e]=n[e]:i[e]=WPGlobusAdmin.data.tag[a][n[e]]);o.val(i.join(", "))})}(r(this))),t=t.then(function(){return r.when(e.done())}).then(function(){"bulk_edit"!=a.currentTarget.id&&setTimeout(function(){inlineEditPost.save(i),r.ajaxSetup({async:!0})},50)})}))}),r("#the-list").on("click",".editinline",function(){var t=r(this);if(n=t.parents("tr").attr("id"),"post"===o)i=n.replace("post-","");else{if("taxonomy"!==o)return;i=n.replace("tag-","")}"post"===o&&void 0!==WPGlobusAdmin.data.tags&&r.each(WPGlobusAdmin.data.tags,function(t,a){var e,o;""==WPGlobusAdmin.data.value[a]||void 0!==(e=r("#edit-"+i+' textarea[name="'+WPGlobusAdmin.data.names[a]+'"]').val())&&(o=e.split(","),r.each(o,function(t,a){e=e.replace(a,WPGlobusCore.TextFilter(a,WPGlobusCoreData.language))}),r("#edit-"+i+' textarea[name="'+WPGlobusAdmin.data.names[a]+'"]').val(e))});var a=r("#edit-"+i+" input.ptitle").eq(0),t=a.parents("label");a.val(WPGlobusAdmin.qedit_titles[i].source),a.addClass("hidden"),r(WPGlobusAdmin.data.template).insertAfter(t),void 0===WPGlobusAdmin.qedit_titles[i]&&(WPGlobusAdmin.qedit_titles[i]={},WPGlobusAdmin.qedit_titles[i].source=r("#"+n+" .name a.row-title").text(),r(WPGlobusAdmin.data.enabled_languages).each(function(t,a){WPGlobusAdmin.qedit_titles[i][a]={},a==WPGlobusAdmin.data.default_language?WPGlobusAdmin.qedit_titles[i][a].name=WPGlobusAdmin.qedit_titles[i].source:WPGlobusAdmin.qedit_titles[i][a].name="",WPGlobusAdmin.qedit_titles[i][a].description=""})),r(".wpglobus-quick-edit-title").each(function(t,a){var e=r(a),a=e.data("language");e.attr("id",a+i),void 0!==WPGlobusAdmin.qedit_titles[i][a]&&(WPGlobusAdmin.qedit_titles[i][a].name=WPGlobusAdmin.qedit_titles[i][a].name.replace(/\\\'/g,"'"),WPGlobusAdmin.qedit_titles[i][a].name=WPGlobusAdmin.qedit_titles[i][a].name.replace(/\\\"/g,'"'),e.attr("value",WPGlobusAdmin.qedit_titles[i][a].name),WPGlobusAdmin.qedit_titles[i].source=WPGlobusCore.getString(WPGlobusAdmin.qedit_titles[i].source,WPGlobusAdmin.qedit_titles[i][a].name,a))}),r("input.ptitle").eq(0).attr("value",WPGlobusAdmin.qedit_titles[i].source)}))},taxonomyEdit:function(){var a=[];a[0]="name",a[1]="description";r.each(WPGlobusCoreData.enabled_languages,function(t,d){r.each(a,function(t,a){var e,o,n,i,l,s;o=d,n=r("#"+(e=a)),i=n.clone(),l=n.attr("name"),s="wpglobus-element wpglobus-element_"+e+" wpglobus-element_"+o+" wpglobus-translatable",a=(a=document.getElementById(e)).nodeName,r(i).attr("id",e+"_"+o),r(i).attr("name",l+"_"+o),o!==WPGlobusCoreData.default_language&&(s+=" hidden"),r(i).attr("class",s),r(i).attr("data-save-to",e),r(i).attr("data-language",o),"INPUT"==a?r(i).attr("value",r("#wpglobus-link-tab-"+o).data(e)):"TEXTAREA"==a&&r(i).text(r("#wpglobus-link-tab-"+o).data(e)),n.addClass("hidden"),0==r(".wpglobus-element_"+e).length?r(i).insertAfter(n):r(i).insertAfter(r(".wpglobus-element_"+e).last())})}),r(".wpglobus-taxonomy-tabs").insertAfter("#ajax-response"),r(".wrap").tabs(),r("body").on("click",".wpglobus-taxonomy-tabs li",function(t){var a=r(this).data("language");r(".wpglobus-element").addClass("hidden"),r(".wpglobus-element_"+a).removeClass("hidden")}),r(".wpglobus-element").on("change",function(){var o=r(this).data("save-to"),n="";r(".wpglobus-element").each(function(t,a){var e=r(a),a=e.val();e.data("save-to")==o&&""!==a&&(n+=WPGlobusCore.addLocaleMarks(a,e.data("language")))}),r("#"+o).val(n)}),r(WPGlobusAdmin.data.multilingualSlug.title).insertAfter(".term-slug-wrap th label")},navMenus:function(){function e(){n!==r(i).length&&(clearInterval(o),r(i).each(function(t,a){var o,e=r(a);e.hasClass("wpglobus-menu-item")||(o=r(a).attr("id"),r.each(["input.edit-menu-item-title","input.edit-menu-item-attr-title"],function(t,a){var e=r("#"+o+" "+a),a=r(e);a.hasClass("wpglobus-hidden")||(a.addClass("wpglobus-hidden"),a.css("display","none"),e=a.parent("label"),a=a.parents("p"),r(a).css("height","80px"),r(e).append('<div style="color:#f00;">'+WPGlobusAdmin.i18n.save_nav_menu+"</div>"))}),e.addClass("wpglobus-menu-item"))}))}var o,n,i="#menu-to-edit .menu-item";r.ajaxSetup({beforeSend:function(t,a){void 0!==a.data&&0<=a.data.indexOf("action=add-menu-item")&&(n=r(i).length,o=setInterval(e,500))}}),r(i).each(function(t,a){var e=r(a).attr("id"),u=e.replace("menu-item-","");r.each(["input.edit-menu-item-title","input.edit-menu-item-attr-title"],function(n,i){var l=r("#"+e+" "+i);l.val()!=WPGlobusAdmin.data.items[u][i].source&&l.val(WPGlobusAdmin.data.items[u][i].source);var s=r("#"+e+" "+i).parents("p"),d=0;r.each(WPGlobusAdmin.data.open_languages,function(t,a){var e=l.clone();e.attr("id",l.attr("id")+"-"+a),e.attr("name",l.attr("id")+"-"+a),e.attr("data-language",a),e.attr("data-item-id",u),e.attr("placeholder",WPGlobusAdmin.data.en_language_name[a]);var o=WPGlobusAdmin.data.items[u][a][i].class;0===n&&a===WPGlobusAdmin.data.default_language?e.attr("class",o+" edit-menu-item-title"):e.attr("class",o),""!=WPGlobusAdmin.data.items[u][a][i].caption?e.attr("value",WPGlobusAdmin.data.items[u][a][i].caption):e.attr("value",""),e.css("margin-bottom","0.6em"),r(s).append(e),d=t}),d=40*(d+1),l.css("display","none").attr("class","").addClass("widefat wpglobus-hidden"),r(s).css("height",d+"px").addClass("wpglobus-menu-item-box")}),r(a).addClass("wpglobus-menu-item")}),r(".menus-move-left, .menus-move-right").each(function(t,a){var e,o=r(a),n=(o.parents("li").attr("id").replace("menu-item-",""),o.attr("title"));void 0!==n&&r.each(WPGlobusAdmin.data.post_titles,function(t,a){0<=n.indexOf(t)&&(e=n.replace(t,a),o.attr("title",e),o.text(e))})}),r(".edit-menu-item-title").trigger("change"),wpNavMenu.refreshAdvancedAccessibility(),wpNavMenu.menusChanged=!1,r(".wpglobus-menu-item").on("change",function(){var t,a,e=r(this),o=e.data("item-id");e.hasClass("wpglobus-item-title")&&(t=WPGlobusCore.getString(r("input#edit-menu-item-title-"+o).val(),e.val(),e.data("language")),void 0!==(a=r(document).triggerHandler("wpglobus_get_menu_translations",{string:t,lang:WPGlobusCoreData.open_languages,id:o,type:"input.edit-menu-item-title"}))&&(t=a),r("input#edit-menu-item-title-"+o).val(t)),e.hasClass("wpglobus-item-attr")&&(t=WPGlobusCore.getString(r("input#edit-menu-item-attr-title-"+o).val(),e.val(),e.data("language")),void 0!==(a=r(document).triggerHandler("wpglobus_get_menu_translations",{string:t,lang:WPGlobusCoreData.open_languages,id:o,type:"input.edit-menu-item-attr-title"}))&&(t=a),r("input#edit-menu-item-attr-title-"+o).val(t))});var a=[];setTimeout(function(){r(".edit-menu-item-description").each(function(){var t=r(this).attr("id");a.push(t),WPGlobusDialogApp.addElement(t)}),r(".wpglobus_dialog_start").each(function(){r(this).css({"font-style":"normal"}),r(this).after("<br />")});var t={action:"getNavMenuItemsDescription"};t.menuItems=a,r.ajax({type:"POST",url:WPGlobusAdmin.ajaxurl,data:{action:WPGlobusAdmin.process_ajax,order:t},dataType:"json"}).done(function(t){"object"==typeof t&&r.each(t,function(t,a){""!=a&&(r("#"+t).val(a),r("#wpglobus-"+t).val(WPGlobusCore.TextFilter(a,WPGlobus.language,"RETURN_EMPTY")))})}).fail(function(t){}).always(function(t,a){})},1e3)},postEdit:function(){r(document).on("heartbeat-send",function(t,o){void 0!==o.wp_autosave&&(o.wpglobus_heartbeat="wpglobus",r.each(WPGlobusAdmin.data.open_languages,function(t,a){var e=r("#title_"+a).val()||"";""!=(e=r.trim(e))&&(o.wp_autosave["post_title_"+a]=e),e=r("#content_"+a).val()||"",""!=(e=r.trim(e))&&(o.wp_autosave["content_"+a]=e)}))});var a,i,l,e="#postdivrich",o=!0,s="#post-body-content";!1===WPGlobusAdmin.data.support.editor&&(o=!(e="#titlediv")),!1===WPGlobusAdmin.data.support.title&&(o=!1),r(s).prepend(r(".wpglobus-post-body-tabs-list")),r.each(WPGlobusAdmin.tabs,function(t,a){"default"===a?(r(e).wrap('<div id="tab-default"></div>'),o&&r(r("#titlediv")).insertBefore(e)):(r(e+"-"+a).wrap('<div id="tab-'+a+'"></div>'),o&&r(r("#titlediv-"+a)).insertBefore(e+"-"+a))}),setTimeout(function(){var n=!1;r(s).addClass("wpglobus-post-body-tabs").tabs({beforeActivate:function(t,a){var e,i,l;n||(o=(e=r("#wp-content-editor-container .mce-btn-group").eq(0)).children("div"),0!=e.length&&0!=o.length&&(i=e.attr("style"),l=o.attr("style"),r.each(WPGlobusCoreData.enabled_languages,function(t,a){if(a!=WPGlobusCoreData.default_language){var e=r("#wp-content_"+a+"-editor-container .mce-btn-group").eq(0),o=e.children("div");if(0==e.length||0==o.length)return!0;var n=e.attr("style"),a=o.attr("style");i!=n&&e.attr("style",i),l!=a&&o.attr("style",l)}}),n=!0));var o=a.oldTab[0].id.replace("link-tab-",""),a=a.newTab[0].id.replace("link-tab-","");r(".wpglobus-tab-link").removeClass("wpglobus-tab-link-active"),r("#link-tab-"+a+" .wpglobus-tab-link").addClass("wpglobus-tab-link-active"),"default"==o&&(o=WPGlobusCoreData.default_language),"default"==a&&(a=WPGlobusCoreData.default_language);a=r(document).triggerHandler("wpglobus_post_body_tabs",[o,a]);return!(!a&&void 0!==a)}})},500),r("#title").val(WPGlobusAdmin.title),r("#content").text(WPGlobusAdmin.content),"undefined"!=typeof WPGlobusVendor&&WPGlobusVendor.vendor.WPSEO&&("undefined"!=typeof wpglobus_wpseo?wpglobus_wpseo():"undefined"!=typeof WPGlobusYoastSeo&&("undefined"!=typeof WPGlobusYoastSeoPremium&&WPGlobusYoastSeoPremium&&"function"==typeof WPGlobusYoastSeoPremium.init&&WPGlobusYoastSeoPremium.init(),"function"==typeof WPGlobusYoastSeo.init&&WPGlobusYoastSeo.init())),WPGlobusAdmin.data.modify_excerpt&&((a=r("#excerpt")).addClass("hidden").css({display:"none"}),r(WPGlobusAdmin.data.template).insertAfter(a),r("body").on("change",".wpglobus-excerpt",function(){var t=r(this);a.val(WPGlobusCore.getString(a.val(),t.val(),t.data("language")))})),void 0!==wp.utils&&void 0!==wp.utils.WordCounter&&(WPGlobusCoreData.wordCounter={},i=this,l={},r.each(WPGlobusCoreData.enabled_languages,function(t,a){return a==WPGlobusCoreData.default_language||(l[t]="content_"+a,n=jQuery,t=new wp.utils.WordCounter,e=a,WPGlobusCoreData.wordCounter[e]={},WPGlobusCoreData.wordCounter[e].counter=t,void n(function(){function o(t){var a;"object"==typeof t&&(t="tinymce"==t?i.getCurrentTab():t.target.id.replace("content_","")),void 0!==WPGlobusCoreData.wordCounter[t]&&(a=!WPGlobusCoreData.wordCounter[t].contentEditor||WPGlobusCoreData.wordCounter[t].contentEditor.isHidden()?WPGlobusCoreData.wordCounter[t].content.val():WPGlobusCoreData.wordCounter[t].contentEditor.getContent({format:"raw"}),(a=WPGlobusCoreData.wordCounter[t].counter.count(a))!==WPGlobusCoreData.wordCounter[t].prevCount&&WPGlobusCoreData.wordCounter[t].count.text(a),WPGlobusCoreData.wordCounter[t].prevCount=a)}WPGlobusCoreData.wordCounter[e].content=n("#content_"+e),WPGlobusCoreData.wordCounter[e].count=n("#wp-word-count-"+e).find(".word-count-"+e),WPGlobusCoreData.wordCounter[e].prevCount=0,n(document).on("tinymce-editor-init",function(t,a){var e;-1!=n.inArray(a.id,l)&&(e=a.id.replace("content_",""),(WPGlobusCoreData.wordCounter[e].contentEditor=a).on("nodechange keyup",_.debounce(o,1e3)))}),WPGlobusCoreData.wordCounter[e].content.on("input keyup",_.debounce(o,1e3)),o(e)}));var n,e})),r(document).on("click","#publish, #save-post",function(){var e,t,o,n;1<WPGlobusAdmin.data.open_languages.length&&(r(document).triggerHandler("wpglobus_before_save_post",{content_tabs_id:s}),e=r("#title").val(),n=o="",0==e.length&&(t=WPGlobusAdmin.data.open_languages.indexOf(WPGlobusAdmin.data.default_language),WPGlobusAdmin.data.open_languages.splice(t,1),r(WPGlobusAdmin.data.open_languages).each(function(t,a){n=0==t?"":"-",0<(e=r("#title_"+a).val()).length&&(0==o.length&&(n=""),o=o+n+e)})),0<o.length&&r("#title").val(o)),void 0===WPGlobusAdmin.data.tagsdiv||WPGlobusAdmin.data.tagsdiv.length<1||r(WPGlobusAdmin.data.tagsdiv).each(function(t,a){if(0==r("#"+a).length)return!0;var e=a.replace("tagsdiv-","");if("undefined"===e)return!0;if(0==r("#tax-input-"+e).length)return!0;var o,n=[];r("#tagsdiv-"+e+" .tagchecklist li").each(function(t,a){o=(o=r(a).html()).replace(/<button.*<\/button> /,""),void 0===WPGlobusAdmin.data.tag[e][o]?n[t]=o:n[t]=WPGlobusAdmin.data.tag[e][o]}),r("#tax-input-"+e).val(n.join(", "))})}),r(".ui-state-default").on("click",function(){"link-tab-default"===r(this).attr("id")&&(r(window).scrollTop(r(window).scrollTop()+1),r(window).scrollTop(r(window).scrollTop()-1))}),r(document).on("tabsactivate",s,function(t,a){WPGlobusAdmin.currentTab=a.newTab[0].dataset.language}),r("#titlewrap input").addClass("wpglobus-translatable"),r(".title_wpglobus").addClass("wpglobus-translatable"),r(document).triggerHandler("wpglobus_after_post_edit")},adminCentral:function(){r(".wpglobus-admin-central-tab").css({display:"none"}),1<r(".nav-tab-active").length&&r(".wpglobus-about-wrap .nav-tab-wrapper a").removeClass("nav-tab-active");var e=!0;0==location.hash.indexOf("#")&&r(".wpglobus-about-wrap .nav-tab-wrapper a").each(function(t,a){r(a).attr("href")==location.hash&&(e=!1,r(a).addClass("nav-tab-active"))}),e&&r(".wpglobus-about-wrap .nav-tab-wrapper a").eq(0).addClass("nav-tab-active");var t=r(".wpglobus-about-wrap .nav-tab-active").data("tab-id");""!=t&&r("#"+t).css({display:"block"}),r(document).on("click",".wpglobus-about-wrap .nav-tab",function(t){var a=r(this);a.hasClass("nav-tab-active")||(r(".wpglobus-admin-central-tab").css({display:"none"}),r(".wpglobus-about-wrap .nav-tab").removeClass("nav-tab-active"),a.addClass("nav-tab-active"),""!=a.data("tab-id")&&r("#"+a.data("tab-id")).css({display:"block"}))})},start:function(){var a=this;r("#wpglobus_flags").select2({formatResult:this.format,formatSelection:this.format,minimumResultsForSearch:-1,escapeMarkup:function(t){return t}}),r("body").on("click","#enabled_languages-list li:first input",function(t){return t.preventDefault(),r(".redux-save-warn").css({display:"none"}),r("#enabled_languages-list").find("li:first > input").val("1"),0===r("#disable_first_language").length&&r(a.config.disable_first_language).insertAfter("#info_bar"),!1})},format:function(t){return'<img class="wpglobus_flag" src="'+WPGlobusAdmin.flag_url+t.text+'"/> '+t.text},set_dialog:function(){var o,a,n;void 0!==WPGlobusAdmin.data.customFieldsEnabled&&(WPGlobusAdmin.data.customFieldsEnabled=this.parseBool(WPGlobusAdmin.data.customFieldsEnabled),!WPGlobusAdmin.data.customFieldsEnabled)||(void 0===WPGlobusAdmin.data.excludeCustomFields&&(WPGlobusAdmin.data.excludeCustomFields=!1),a=!1,(n=function(t){var l,s,d="wpglobus_dialog_start wpglobus_dialog_icon",u=['<div class="wpglobus_dialog_options_wrapper hidden">','<input style="width:initial;" id="wpglobus-cb-{{id}}" data-object="#wpglobus-dialog-start-{{id}}" data-meta-key="{{meta-key}}" class="wpglobus_dialog_option wpglobus_dialog_cb" type="checkbox" {{checked}} />',"</div>"].join(""),t=void 0===t?"#the-list tr":"#the-list tr#"+t;r(t).each(function(){var t,a,e=r(this),o=e.attr("id"),n=e.find("textarea"),i=d;return void 0===(l=n.attr("id"))||(a=r("#"+o+"-key").val(),!(!WPGlobusAdmin.data.excludeCustomFields||-1==r.inArray(a,WPGlobusAdmin.data.excludeCustomFields))||(t=r("#"+l).clone(),r(n).addClass("wpglobus-dialog-field-source hidden"),o=n.attr("name"),r(t).attr("id","wpglobus-"+l),r(t).attr("name","wpglobus-"+o),r(t).attr("data-source-id",l),r(t).attr("class","wpglobus-dialog-field"),r(t).val(WPGlobusCore.TextFilter(r(n).val(),WPGlobusCoreData.language)),r(t).insertAfter(n),s=(s=u.replace(/{{id}}/g,l)).replace(/{{meta-key}}/g,a),void 0===WPGlobusAdmin.data.post_meta_settings[WPGlobusAdmin.data.post_type]?s=s.replace(/{{checked}}/,"checked"):i=void 0!==WPGlobusAdmin.data.post_meta_settings[WPGlobusAdmin.data.post_type][a]&&"false"==WPGlobusAdmin.data.post_meta_settings[WPGlobusAdmin.data.post_type][a]?(s=s.replace(/{{checked}}/,""),d+" wpglobus_dialog_start_hidden"):(s=s.replace(/{{checked}}/,"checked"),d),void e.append('<td style="width:20px;"><div id="wpglobus-dialog-start-'+l+'" data-type="control" data-source-type="textarea" data-source-id="'+l+'" class="'+i+'"></div>'+s+"</td>")))}),!a&&0<r("#list-table .wpglobus_dialog_start").length&&(r("#list-table thead tr").append('<th class="wpglobus-control-head"><div class="wpglobus_dialog_settings wpglobus_dialog_icon"></div></th>'),a=!0)})(),r("body").on("change",".wpglobus-dialog-field",function(){var e,o,n=r(this),t="#"+n.data("source-id"),i="";e=r(t).val(),/(\{:|\[:|<!--:)[a-z]{2}/.test(e)?(r.each(WPGlobusCoreData.enabled_languages,function(t,a){""!=(o=a==WPGlobusCoreData.language?n.val():WPGlobusCore.TextFilter(e,a,"RETURN_EMPTY"))&&(i+=WPGlobusCore.addLocaleMarks(o,a))}),r(t).val(i)):r(t).val(n.val())}),r(document).ajaxSend(function(t,a,e){"add-meta"==e.action&&(o=e.element)}),r(document).ajaxComplete(function(t,a,e){"add-meta"==e.action&&void 0!==a.responseXML&&n("newmeta"==o?"meta-"+r(a.responseXML.documentElement.outerHTML).find("meta").attr("id"):o)}),WPGlobusDialogApp.init({dialogTitle:"Edit meta"}))}},new t.App,t)});
|
includes/js/wpglobus-admin-55.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var WPGlobusCore,WPGlobusDialogApp;!function(i){var d=WPGlobusCore={strpos:function(t,a,e){var o=(t=""+t).indexOf(a,e);return 0<=o&&o},TextFilter:function(t,a,e){if(void 0===t||""===t)return t;var o,n,i=[],l=!1;a=""==a?"en":a,e=void 0===e||""==e?"RETURN_IN_DEFAULT_LANGUAGE":e,i[0]=[],i[0].start=WPGlobusCoreData.locale_tag_start.replace("%s",a),i[0].end=WPGlobusCoreData.locale_tag_end,i[1]=[],i[1].start="\x3c!--:"+a+"--\x3e",i[1].end="\x3c!--:--\x3e",i[2]=[],i[2].start="[:"+a+"]",i[2].end="[:";for(var s=0;s<3;s++)if(!1!==(o=d.strpos(t,i[s].start))){o+=i[s].start.length,t=!1===(n=d.strpos(t,i[s].end,o))?t.substr(o):t.substr(o,n-o),l=!0;break}return l||("RETURN_EMPTY"==e?a==WPGlobusCoreData.default_language&&!/(\{:|\[:|<!--:)[a-z]{2}/.test(t)||(t=""):a==WPGlobusCoreData.default_language?/(\{:|\[:|<!--:)[a-z]{2}/.test(t)&&(t=""):t=d.TextFilter(t,WPGlobusCoreData.default_language)),t},addLocaleMarks:function(t,a){return WPGlobusCoreData.locale_tag_start.replace("%s",a)+t+WPGlobusCoreData.locale_tag_end},getTranslations:function(e){var o,n={};return i.each(WPGlobusCoreData.enabled_languages,function(t,a){o=a==WPGlobusCoreData.default_language?"RETURN_IN_DEFAULT_LANGUAGE":"RETURN_EMPTY",n[a]=d.TextFilter(e,a,o)}),n},getString:function(t,a,e){if(void 0===t)return t;void 0===a&&(a=""),void 0===e&&(e=WPGlobusCoreData.language),(t=d.getTranslations(t))[e]=a;var o="";return i.each(t,function(t,a){""!=a&&t!=WPGlobusCoreData.default_language&&(o+=d.addLocaleMarks(a,t))}),""!=t[WPGlobusCoreData.default_language]&&(o=""==o?t[WPGlobusCoreData.default_language]:d.addLocaleMarks(t[WPGlobusCoreData.default_language],WPGlobusCoreData.default_language)+o),o}}}(jQuery),function(m){var v=WPGlobusDialogApp={option:{listenClass:".wpglobus_dialog_start",settingsClass:".wpglobus_dialog_settings",dialogTabs:"#wpglobus-dialog-tabs",dialogTitle:"",customData:null,callback:function(){},dialogOptions:{title:"",placeholder:"",formFooter:"",beforeOpen:function(){},afterOpen:function(){},afterSave:function(){},close:function(){}},dialog:{}},form:void 0,element:void 0,element_by:"id",id:"",clone_id:"",wpglobus_id:"",type:"textarea",source:"",order:{},value:{},request:"core",attrs:{},dialogTitle:"",trClass:"wpglobus-translatable",startButton:['<span id="wpglobus-dialog-start-{{clone_id}}" ','style="{{style}}" ','data-type="control" data-dialog-title="{{title}}" ','data-source-type="" data-source-id="{{id}}" data-source-name="{{name}}" ','data-nodename="{{nodename}}"',"{{sbTitle}} ",'class="{{classes}}"></span>'].join(""),startButtonClass:"wpglobus_dialog_start wpglobus_dialog_icon",clicks:0,init:function(t){v.option.dialog=v.option.dialogOptions,v.option=m.extend(v.option,t),m(v.option.dialogTabs).tabs(),v.dialogTitle=v.option.dialogTitle,this.attachListener(),null!=v.option.customData&&void 0!==v.option.customData.addElements&&m.each(v.option.customData.addElements,function(t,a){v.addElement(a)})},convertToId:function(t){return t=(t=t.replace(/\]/g,"")).replace(/\[/g,"-")},addElement:function(t){var a={id:null,style:"",styleTextareaWrapper:"",sbTitle:"",onChangeClass:"",dialogTitle:"",dialog:v.option.dialogOptions};if("string"==typeof t)a.id=t;else{if("object"!=typeof t)return;a=m.extend(a,t)}var e,o,n,i=null,l=null,s=null,d=null,u=v.startButton,r="";if(v.element_by="name",0==(d=document.getElementsByName(a.id)).length&&(v.element_by="id",d=document.getElementById(a.id)),null!==d){if(l=a.id,s=void 0===(i="id"==v.element_by?m("#"+l):(r=(r=d[0].nodeName).toLowerCase(),m(r+'[name="'+l+'"]'))).attr("name")||""==i.attr("name")?l:i.attr("name"),v.clone_id=v.convertToId(l),-1!=s.indexOf("wpglobus")||-1!=v.clone_id.indexOf("wpglobus"))return!1;if(0<m("#wpglobus-"+v.clone_id).length)return!1;if(0<m(r+'[name="wpglobus-'+s+'"]').length)return!1;e=m(i.clone()),n=i.attr("style")||"",i.attr("style","display:none;"),e.attr("id","wpglobus-"+v.clone_id).attr("name","wpglobus-"+s),e.addClass(v.trClass),""!=a.onChangeClass&&e.addClass(a.onChangeClass),"id"==v.element_by?e.attr("data-source-id",l).attr("data-source-name","").attr("data-source-get-by",v.element_by):e.attr("data-source-id","").attr("data-source-name",s).attr("data-source-get-by",v.element_by),"textarea"==r?(o=WPGlobusCore.getTranslations(i.val())[WPGlobusCoreData.language],e.val(o),e.attr("data-nodename","textarea"),""==a.style?e.attr("style",n+";width:95%;float:left;"):e.attr("style",n+";"+a.style)):(o=WPGlobusCore.getTranslations(i.val())[WPGlobusCoreData.language],e.val(o),e.attr("data-nodename","input"),""!=a.style&&e.attr("style",n+";"+a.style)),""!=a.dialog&&e.attr("data-dialog",JSON.stringify(a.dialog)),u=u.replace(/{{clone_id}}/g,v.clone_id),u="id"==v.element_by?(u=(u=u.replace(/{{id}}/g,v.clone_id)).replace(/{{name}}/g,"")).replace(/{{nodename}}/g,""):(u=(u=u.replace(/{{id}}/g,"")).replace(/{{name}}/g,s)).replace(/{{nodename}}/g,r),u="textarea"==r?u.replace("{{style}}","float:left;margin-top:0;"):u.replace("{{style}}","");var c="textarea"==r?v.startButtonClass+" wpglobus-textarea wpglobus-textarea-"+v.clone_id:v.startButtonClass,u=u.replace("{{classes}}",c);u=""==a.dialogTitle?u.replace("{{title}}",v.dialogTitle):u.replace("{{title}}",a.dialogTitle),u=""==a.sbTitle?u.replace("{{sbTitle}}",a.sbTitle):u.replace("{{sbTitle}}",'title="'+a.sbTitle+'"'),m(u).insertAfter(i),m(e).insertAfter(i),"textarea"==r&&(m("#wpglobus-"+v.clone_id).addClass("wpglobus-textarea-"+v.clone_id),m(".wpglobus-textarea-"+v.clone_id).wrapAll('<div class="wpglobus-textarea-wrapper" style="'+a.styleTextareaWrapper+'"></div>'));var g,b,p=!1;return(""==a.onChangeClass?g="#wpglobus-"+v.clone_id:(g="."+a.onChangeClass,void 0===(b=m._data(m(document)[0],"events"))?p=!0:void 0!==b.change&&m.each(b.change,function(t,a){if(a.selector==g)return!(p=!0)})),p)?!0:(m(document).on("change",g,function(){var t=m(this),a=""==(a=t.data("source-id"))?t.data("nodename")+'[name="'+t.data("source-name")+'"]':"#"+a;m(a).val(WPGlobusCore.getString(m(a).val(),t.val()))}),!0)}},saveDialog:function(){var e,o,n,i="",l="",s="";m(".wpglobus_dialog_textarea").each(function(t,a){e=m(a),o=e.val(),(n=e.data("language"))==WPGlobusAdmin.data.language&&(s=o),""!=o&&(i+=WPGlobusCore.addLocaleMarks(o,n),n==WPGlobusCoreData.default_language&&(l=o))}),i=i.length==l.length+8?l:i,m(v.id).val(i),i=""==s?l:s,m(v.wpglobus_id).val(i),v.runCallback(v.option.dialog.afterSave)},dialog:m("#wpglobus-dialog-wrapper").dialog({autoOpen:!1,width:650,modal:!0,dialogClass:"wpglobus-dialog",buttons:[{text:"Save",class:"wpglobus-button-save",click:function(){v.saveDialog(),v.dialog.dialog("close")}},{text:"Cancel",class:"wpglobus-button-cancel",click:function(){v.dialog.dialog("close")}}],open:function(t,a){var e=v.dialogTitle;void 0!==v.attrs.maxlength&&(m(".wpglobus_dialog_textarea").attr("maxlength",v.attrs.maxlength),e+=" | maxlength="+v.attrs.maxlength),m(".wpglobus-dialog .ui-dialog-title").text(e),m(this).removeClass("hidden")},close:function(){m(this).addClass("hidden"),v.runCallback(v.option.dialog.close),v.form[0].reset()}}),attachListener:function(){m(document).on("click",v.option.settingsClass,function(){m(".wpglobus_dialog_options_wrapper").hasClass("hidden")?m(".wpglobus_dialog_options_wrapper").removeClass("hidden"):m(".wpglobus_dialog_options_wrapper").addClass("hidden")}),m(document).on("click",".wpglobus_dialog_option",function(t){var a=m(this),e=a.data("object");v.order.action="save_post_meta_settings",v.order.post_type=WPGlobusAdmin.data.post_type,v.order.checked=a.prop("checked"),v.order.id=a.attr("id"),v.order.meta_key=a.data("meta-key"),v.ajax(v.order).done(function(t){"ok"==t.result&&("true"==t.checked?m(e).removeClass("wpglobus_dialog_start_hidden"):m(e).addClass("wpglobus_dialog_start_hidden"))}).fail(function(t){}).always(function(t,a){})}),m(document).on("click",v.option.listenClass,function(a){v.element=m(this),v.id=v.element.data("source-id"),""==v.id?(v.id=v.element.data("nodename")+'[name="'+v.element.data("source-name")+'"]',v.wpglobus_id="#wpglobus-"+v.convertToId(v.element.data("source-name"))):(v.wpglobus_id="#wpglobus-"+v.id,v.id="#"+v.id),v.clicks++,1==v.clicks&&setTimeout(function(){var t;1==v.clicks?v.onClick(a):(t=m(v.id)).hasClass("hidden")?t.removeClass("hidden").attr("style","display:block;"):t.addClass("hidden").attr("style","display:none;"),v.clicks=0},200)}),v.form=v.dialog.find("form#wpglobus-dialog-form").on("submit",function(t){t.preventDefault(),v.saveDialog()})},ajax:function(t){return m.ajax({type:"POST",url:WPGlobusAdmin.ajaxurl,data:{action:WPGlobusAdmin.process_ajax,order:t},dataType:"json",async:!1})},onClick:function(t){void 0===v.element.data("dialog-title")||""==v.element.data("dialog-title")?v.dialogTitle=v.option.dialogTitle:v.dialogTitle=v.element.data("dialog-title"),void 0!==v.id&&(v.attrs.maxlength=m(v.id).attr("maxlength")),v.source=v.element.data("source-value"),void 0===v.source&&(v.source=m(v.id).val(),"ajax"==v.request||(v.value=WPGlobusCore.getTranslations(v.source))),v.option.dialog=m.extend({},v.option.dialogOptions,m(v.wpglobus_id).data("dialog")),""!=v.option.dialog.title&&(v.dialogTitle=v.option.dialog.title),m.each(v.value,function(t,a){var e=m("#wpglobus-dialog-"+t);e.val(a),e.attr("placeholder",WPGlobusCore.TextFilter(v.option.dialog.placeholder,t,"RETURN_IN_DEFAULT_LANGUAGE"))}),m("#wpglobus-dialog-form-footer").html(v.option.dialog.formFooter),v.runCallback(v.option.dialog.beforeOpen),v.dialog.dialog("open"),v.runCallback(v.option.dialog.afterOpen)},runCallback:function(t){var a,e;"object"==typeof t?(a=Object.keys(t)[0],e=t[Object.keys(t)[0]],"window"===a?"function"==typeof window[e]&&window[e](t[Object.keys(t)[1]]):"function"==typeof window[a][e]&&window[a][e](t[Object.keys(t)[1]])):"string"==typeof t?"function"==typeof window[t]&&window[t]():"function"==typeof t&&t()}}}(jQuery),jQuery(document).ready(function(){"use strict";var t,c;window.WPGlobusAdminApp=(t=window.WPGlobusAdminApp||{},c=jQuery,t.App=function(t){void 0===window.WPGlobusAdminApp&&(this.config={debug:!1,version:WPGlobusAdmin.version},this.status="ok","undefined"==typeof WPGlobusAdmin?(this.status="error",this.config.debug&&console.log("WPGlobus: error options loading")):this.config.debug&&console.dir(WPGlobusAdmin),this.config.disable_first_language=['<div id="disable_first_language" style="display:block;" class="redux-field-errors notice-red">',"<strong>","<span> </span>",WPGlobusAdmin.i18n.cannot_disable_language,"</strong>","</div>"].join(""),c.extend(this.config,t),"ok"===this.status&&this.init())},t.App.prototype={$document:c(document),init:function(){WPGlobusCoreData.multisite=this.parseBool(WPGlobusCoreData.multisite),this.adminInit(),c("#content").addClass("wpglobus-editor").attr("data-language",WPGlobusAdmin.data.default_language),c("textarea[id^=content_]").each(function(t,a){var e=c(a).attr("id").replace("content_","");c(a).attr("data-language",e)}),"post.php"===WPGlobusAdmin.page?(this.postEdit(),this.set_dialog(),"undefined"!=typeof WPGlobusAioseop&&WPGlobusAioseop.init()):"menu-edit"===WPGlobusAdmin.page?(WPGlobusDialogApp.init({dialogTitle:"Edit description"}),this.navMenus()):"taxonomy-edit"===WPGlobusAdmin.page?WPGlobusAdmin.data.tag_id&&this.taxonomyEdit():"taxonomy-quick-edit"===WPGlobusAdmin.page?this.quickEdit("taxonomy"):"edit.php"===WPGlobusAdmin.page?(this.quickEdit("post"),0<_.size(WPGlobusAdmin.$_get)&&WPGlobusDialogApp.init()):"options-general.php"==WPGlobusAdmin.page?(this.optionsGeneral(),WPGlobusDialogApp.init({customData:WPGlobusCoreData.page_custom_data})):"widgets.php"==WPGlobusAdmin.page?(WPGlobusWidgets.init(),WPGlobusDialogApp.init({dialogTitle:"Edit text"})):"wpglobus_options"==WPGlobusAdmin.page?this.start():"wpglobusAdminCentral"==WPGlobusAdmin.page?this.adminCentral():WPGlobusDialogApp.init({customData:WPGlobusCoreData.page_custom_data})},parseBool:function(t){return!/^(false|0)$/i.test(t)&&!!t},getCurrentTab:function(){return c(".wpglobus-post-body-tabs-list .ui-tabs-active").data("language")},adminInit:function(){var t,a=c(".wpglobus-addons-group a").data("key");void 0!==a&&(0<=window.location.search.indexOf("page=wpglobus_options&tab="+a)?WPGlobusCoreData.multisite?window.location=WPGlobusCoreData.pluginInstallLocation.multisite:window.location=WPGlobusCoreData.pluginInstallLocation.single:(t=c("#toplevel_page_wpglobus_options li").eq(a+1),WPGlobusCoreData.multisite?c(t).find("a").attr("href",WPGlobusCoreData.pluginInstallLocation.multisite).attr("onclick","window.location=jQuery(this).attr('href');return false;"):c(t).find("a").attr("href",WPGlobusCoreData.pluginInstallLocation.single).attr("onclick","window.location=jQuery(this).attr('href');return false;")))},optionsGeneral:function(){var o=c("#blogname"),t=c("body");o.addClass("hidden"),c("#wpglobus-blogname").insertAfter(o).removeClass("hidden"),t.on("blur",".wpglobus-blogname",function(){c(".wpglobus-blogname").each(function(t,a){var e=c(a);o.val(WPGlobusCore.getString(o.val(),e.val(),e.data("language")))})});var n=c("#blogdescription");n.addClass("hidden"),c("#wpglobus-blogdescription").insertAfter(n).removeClass("hidden"),t.on("blur",".wpglobus-blogdesc",function(){c(".wpglobus-blogdesc").each(function(t,a){var e=c(a);n.val(WPGlobusCore.getString(n.val(),e.val(),e.data("language")))})})},quickEdit:function(n){var o,l,i,t;void 0!==WPGlobusAdmin.data.has_items&&WPGlobusAdmin.data.has_items&&(o="",l=0,c(document).ajaxComplete(function(t,a,e){void 0!==e.data&&""!=o&&0<=e.data.indexOf("action=inline-save-tax&")&&(c("#"+o+" a.row-title").text(WPGlobusAdmin.qedit_titles[l][WPGlobusAdmin.data.language].name),c("#"+o+" .description").text(WPGlobusAdmin.qedit_titles[l][WPGlobusAdmin.data.language].description))}),i={},c("#the-list tr").each(function(t,a){var e=c(a),o="post"===n?"post-":"tag-";l=e.attr("id").replace(o,""),i[l]={},"post"===n?i[l].source=e.find(".post_title").text():"taxonomy"===n&&(i[l].source=c("#inline_"+l+" .name").text())}),(t={action:"get_titles"}).type=n,t.taxonomy=void 0!==WPGlobusAdmin.data.taxonomy&&WPGlobusAdmin.data.taxonomy,t.title=i,c.ajax({type:"POST",url:WPGlobusAdmin.ajaxurl,data:{action:WPGlobusAdmin.process_ajax,order:t},dataType:"json"}).done(function(t){WPGlobusAdmin.qedit_titles=t.qedit_titles,c.each(t.bulkedit_post_titles,function(t,a){c("#inline_"+t+" .post_title").text(a[WPGlobusAdmin.data.language].name)})}).fail(function(t){}).always(function(t,a){}),c("body").on("change",".wpglobus-quick-edit-title",function(){var n="",i=[];c(".wpglobus-quick-edit-title").each(function(t,a){var e=c(a),o=e.data("language");""!==e.val()&&(n=WPGlobusCore.getString(n,e.val(),o)),WPGlobusAdmin.qedit_titles[l][o].name=e.val(),i[t]=o});var t=c(document).triggerHandler("wpglobus_get_translations",{string:n,lang:i,id:l});void 0!==t&&(n=t),c("input.ptitle").eq(0).val(n),WPGlobusAdmin.qedit_titles[l].source=n}),void 0!==WPGlobusAdmin.data.tags&&c.each(WPGlobusAdmin.data.tags,function(t,a){WPGlobusAdmin.data.value[a].post_id={}}),c("button.save, input#bulk_edit").on("mouseenter",function(t){void 0!==WPGlobusAdmin.data.tags&&("bulk_edit"==t.currentTarget.id?c("input#bulk_edit").unbind("click"):c("button.save").unbind("click"),c("button.save, input#bulk_edit").on("click",function(a){var t=c.when(),e=(c(this),c.Deferred());e.resolve(function(t){t.next(".spinner").css({visibility:"visible"}),"bulk_edit"!=a.currentTarget.id&&c.ajaxSetup({async:!1});var o,n,i,l=t.parents("tr"),s=l.attr("id").replace("edit-","");c.each(WPGlobusAdmin.data.tags,function(t,a){if(0==(o=l.find("textarea[name='"+WPGlobusAdmin.data.names[a]+"']")).length)return!0;WPGlobusAdmin.data.value[a].post_id[s]=o.val(),n=WPGlobusAdmin.data.value[a].post_id[s].split(","),i=[];for(var e=0;e<n.length;e++)n[e]=n[e].trim(" "),""!=n[e]&&(void 0===WPGlobusAdmin.data.tag[a][n[e]]?i[e]=n[e]:i[e]=WPGlobusAdmin.data.tag[a][n[e]]);o.val(i.join(", "))})}(c(this))),t=t.then(function(){return c.when(e.done())}).then(function(){"bulk_edit"!=a.currentTarget.id&&setTimeout(function(){inlineEditPost.save(l),c.ajaxSetup({async:!0})},50)})}))}),c("#the-list").on("click",".editinline",function(){var t=c(this);if(o=t.parents("tr").attr("id"),"post"===n)l=o.replace("post-","");else{if("taxonomy"!==n)return;l=o.replace("tag-","")}"post"===n&&void 0!==WPGlobusAdmin.data.tags&&c.each(WPGlobusAdmin.data.tags,function(t,a){var e,o;""==WPGlobusAdmin.data.value[a]||void 0!==(e=c("#edit-"+l+' textarea[name="'+WPGlobusAdmin.data.names[a]+'"]').val())&&(o=e.split(","),c.each(o,function(t,a){e=e.replace(a,WPGlobusCore.TextFilter(a,WPGlobusCoreData.language))}),c("#edit-"+l+' textarea[name="'+WPGlobusAdmin.data.names[a]+'"]').val(e))});var a=c("#edit-"+l+" input.ptitle").eq(0),e=a.parents("label");void 0!==WPGlobusAdmin.qedit_titles&&(a.val(WPGlobusAdmin.qedit_titles[l].source),a.addClass("hidden"),c(WPGlobusAdmin.data.template).insertAfter(e),void 0===WPGlobusAdmin.qedit_titles[l]&&(WPGlobusAdmin.qedit_titles[l]={},WPGlobusAdmin.qedit_titles[l].source=c("#"+o+" .name a.row-title").text(),c(WPGlobusAdmin.data.enabled_languages).each(function(t,a){WPGlobusAdmin.qedit_titles[l][a]={},a==WPGlobusAdmin.data.default_language?WPGlobusAdmin.qedit_titles[l][a].name=WPGlobusAdmin.qedit_titles[l].source:WPGlobusAdmin.qedit_titles[l][a].name="",WPGlobusAdmin.qedit_titles[l][a].description=""})),c(".wpglobus-quick-edit-title").each(function(t,a){var e=c(a),o=e.data("language");e.attr("id",o+l),void 0!==WPGlobusAdmin.qedit_titles[l][o]&&(WPGlobusAdmin.qedit_titles[l][o].name=WPGlobusAdmin.qedit_titles[l][o].name.replace(/\\\'/g,"'"),WPGlobusAdmin.qedit_titles[l][o].name=WPGlobusAdmin.qedit_titles[l][o].name.replace(/\\\"/g,'"'),e.val(WPGlobusAdmin.qedit_titles[l][o].name),WPGlobusAdmin.qedit_titles[l].source=WPGlobusCore.getString(WPGlobusAdmin.qedit_titles[l].source,WPGlobusAdmin.qedit_titles[l][o].name,o))}),c("input.ptitle").eq(0).val(WPGlobusAdmin.qedit_titles[l].source))}))},taxonomyEdit:function(){var a=[];a[0]="name",a[1]="description";c.each(WPGlobusCoreData.enabled_languages,function(t,u){c.each(a,function(t,a){var e,o,n,i,l,s,d;o=u,n=c("#"+(e=a)),i=n.clone(),l=n.attr("name"),s="wpglobus-element wpglobus-element_"+e+" wpglobus-element_"+o+" wpglobus-translatable",d=(d=document.getElementById(e)).nodeName,c(i).attr("id",e+"_"+o),c(i).attr("name",l+"_"+o),o!==WPGlobusCoreData.default_language&&(s+=" hidden"),c(i).attr("class",s),c(i).attr("data-save-to",e),c(i).attr("data-language",o),"INPUT"==d?c(i).attr("value",c("#wpglobus-link-tab-"+o).data(e)):"TEXTAREA"==d&&c(i).text(c("#wpglobus-link-tab-"+o).data(e)),n.addClass("hidden"),0==c(".wpglobus-element_"+e).length?c(i).insertAfter(n):c(i).insertAfter(c(".wpglobus-element_"+e).last())})}),c(".wpglobus-taxonomy-tabs").insertAfter("#ajax-response"),c(".wrap").tabs(),c("body").on("click",".wpglobus-taxonomy-tabs li",function(t){var a=c(this).data("language");c(".wpglobus-element").addClass("hidden"),c(".wpglobus-element_"+a).removeClass("hidden"),c(".wpglobus-tax-edit-tab a").removeClass("wpglobus-tab-link-active"),c("#wpglobus-link-tab-"+a+" a").addClass("wpglobus-tab-link-active")}),c(".wpglobus-element").on("change",function(){var n=c(this).data("save-to"),i="";c(".wpglobus-element").each(function(t,a){var e=c(a),o=e.val();e.data("save-to")==n&&""!==o&&(i+=WPGlobusCore.addLocaleMarks(o,e.data("language")))}),c("#"+n).val(i)}),c(WPGlobusAdmin.data.multilingualSlug.title).insertAfter(".term-slug-wrap th label")},navMenus:function(){function e(){n!==c(i).length&&(clearInterval(o),c(i).each(function(t,a){var l,e=c(a);e.hasClass("wpglobus-menu-item")||(l=c(a).attr("id"),c.each(["input.edit-menu-item-title","input.edit-menu-item-attr-title"],function(t,a){var e,o,n=c("#"+l+" "+a),i=c(n);i.hasClass("wpglobus-hidden")||(i.addClass("wpglobus-hidden"),i.css("display","none"),e=i.parent("label"),o=i.parents("p"),c(o).css("height","80px"),c(e).append('<div style="color:#f00;">'+WPGlobusAdmin.i18n.save_nav_menu+"</div>"))}),e.addClass("wpglobus-menu-item"))}))}var o,n,i="#menu-to-edit .menu-item";c.ajaxSetup({beforeSend:function(t,a){void 0!==a.data&&0<=a.data.indexOf("action=add-menu-item")&&(n=c(i).length,o=setInterval(e,500))}}),c(i).each(function(t,a){var e=c(a).attr("id"),u=e.replace("menu-item-","");c.each(["input.edit-menu-item-title","input.edit-menu-item-attr-title"],function(n,i){var l=c("#"+e+" "+i);l.val()!=WPGlobusAdmin.data.items[u][i].source&&l.val(WPGlobusAdmin.data.items[u][i].source);var s=c("#"+e+" "+i).parents("p"),d=0;c.each(WPGlobusAdmin.data.open_languages,function(t,a){var e=l.clone();e.attr("id",l.attr("id")+"-"+a),e.attr("name",l.attr("id")+"-"+a),e.attr("data-language",a),e.attr("data-item-id",u),e.attr("placeholder",WPGlobusAdmin.data.en_language_name[a]);var o=WPGlobusAdmin.data.items[u][a][i].class;0===n&&a===WPGlobusAdmin.data.default_language?e.attr("class",o+" edit-menu-item-title"):e.attr("class",o),""!=WPGlobusAdmin.data.items[u][a][i].caption?e.attr("value",WPGlobusAdmin.data.items[u][a][i].caption):e.attr("value",""),e.css("margin-bottom","0.6em"),c(s).append(e),d=t}),d=40*(d+1),l.css("display","none").attr("class","").addClass("widefat wpglobus-hidden"),c(s).css("height",d+"px").addClass("wpglobus-menu-item-box")}),c(a).addClass("wpglobus-menu-item")}),c(".menus-move-left, .menus-move-right").each(function(t,a){var e,o=c(a),n=(o.parents("li").attr("id").replace("menu-item-",""),o.attr("title"));void 0!==n&&c.each(WPGlobusAdmin.data.post_titles,function(t,a){0<=n.indexOf(t)&&(e=n.replace(t,a),o.attr("title",e),o.text(e))})}),c(".edit-menu-item-title").trigger("change"),wpNavMenu.refreshAdvancedAccessibility(),wpNavMenu.menusChanged=!1,c(".wpglobus-menu-item").on("change",function(){var t,a,e=c(this),o=e.data("item-id");e.hasClass("wpglobus-item-title")&&(t=WPGlobusCore.getString(c("input#edit-menu-item-title-"+o).val(),e.val(),e.data("language")),void 0!==(a=c(document).triggerHandler("wpglobus_get_menu_translations",{string:t,lang:WPGlobusCoreData.open_languages,id:o,type:"input.edit-menu-item-title"}))&&(t=a),c("input#edit-menu-item-title-"+o).val(t)),e.hasClass("wpglobus-item-attr")&&(t=WPGlobusCore.getString(c("input#edit-menu-item-attr-title-"+o).val(),e.val(),e.data("language")),void 0!==(a=c(document).triggerHandler("wpglobus_get_menu_translations",{string:t,lang:WPGlobusCoreData.open_languages,id:o,type:"input.edit-menu-item-attr-title"}))&&(t=a),c("input#edit-menu-item-attr-title-"+o).val(t))});var a=[];setTimeout(function(){c(".edit-menu-item-description").each(function(){var t=c(this).attr("id");a.push(t),WPGlobusDialogApp.addElement(t)}),c(".wpglobus_dialog_start").each(function(){c(this).css({"font-style":"normal"}),c(this).after("<br />")});var t={action:"getNavMenuItemsDescription"};t.menuItems=a,c.ajax({type:"POST",url:WPGlobusAdmin.ajaxurl,data:{action:WPGlobusAdmin.process_ajax,order:t},dataType:"json"}).done(function(t){"object"==typeof t&&c.each(t,function(t,a){""!=a&&(c("#"+t).val(a),c("#wpglobus-"+t).val(WPGlobusCore.TextFilter(a,WPGlobus.language,"RETURN_EMPTY")))})}).fail(function(t){}).always(function(t,a){})},1e3)},postEdit:function(){c(document).on("heartbeat-send",function(t,o){void 0!==o.wp_autosave&&(o.wpglobus_heartbeat="wpglobus",c.each(WPGlobusAdmin.data.open_languages,function(t,a){var e=c("#title_"+a).val()||"";""!=(e=c.trim(e))&&(o.wp_autosave["post_title_"+a]=e),e=c("#content_"+a).val()||"",""!=(e=c.trim(e))&&(o.wp_autosave["content_"+a]=e)}))});var a,l,s,e="#postdivrich",o=!0,i="#post-body-content";!1===WPGlobusAdmin.data.support.editor&&(o=!(e="#titlediv")),!1===WPGlobusAdmin.data.support.title&&(o=!1),c(i).prepend(c(".wpglobus-post-body-tabs-list")),c.each(WPGlobusAdmin.tabs,function(t,a){"default"===a?(c(e).wrap('<div id="tab-default"></div>'),o&&c(c("#titlediv")).insertBefore(e)):(c(e+"-"+a).wrap('<div id="tab-'+a+'"></div>'),o&&c(c("#titlediv-"+a)).insertBefore(e+"-"+a))}),setTimeout(function(){var u=!1;c(i).addClass("wpglobus-post-body-tabs").tabs({beforeActivate:function(t,a){var e,o,l,s;u||(o=(e=c("#wp-content-editor-container .mce-btn-group").eq(0)).children("div"),0!=e.length&&0!=o.length&&(l=e.attr("style"),s=o.attr("style"),c.each(WPGlobusCoreData.enabled_languages,function(t,a){if(a!=WPGlobusCoreData.default_language){var e=c("#wp-content_"+a+"-editor-container .mce-btn-group").eq(0),o=e.children("div");if(0==e.length||0==o.length)return!0;var n=e.attr("style"),i=o.attr("style");l!=n&&e.attr("style",l),s!=i&&o.attr("style",s)}}),u=!0));var n=a.oldTab[0].id.replace("link-tab-",""),i=a.newTab[0].id.replace("link-tab-","");c(".wpglobus-tab-link").removeClass("wpglobus-tab-link-active"),c("#link-tab-"+i+" .wpglobus-tab-link").addClass("wpglobus-tab-link-active"),"default"==n&&(n=WPGlobusCoreData.default_language),"default"==i&&(i=WPGlobusCoreData.default_language);var d=c(document).triggerHandler("wpglobus_post_body_tabs",[n,i]);return!(!d&&void 0!==d)}})},500),c("#title").val(WPGlobusAdmin.title),c("#content").text(WPGlobusAdmin.content),"undefined"!=typeof WPGlobusVendor&&WPGlobusVendor.vendor.WPSEO&&("undefined"!=typeof wpglobus_wpseo?wpglobus_wpseo():"undefined"!=typeof WPGlobusYoastSeo&&("undefined"!=typeof WPGlobusYoastSeoPremium&&WPGlobusYoastSeoPremium&&"function"==typeof WPGlobusYoastSeoPremium.init&&WPGlobusYoastSeoPremium.init(),"function"==typeof WPGlobusYoastSeo.init&&WPGlobusYoastSeo.init())),WPGlobusAdmin.data.modify_excerpt&&((a=c("#excerpt")).addClass("hidden").css({display:"none"}),c(WPGlobusAdmin.data.template).insertAfter(a),c("body").on("change",".wpglobus-excerpt",function(){var t=c(this);a.val(WPGlobusCore.getString(a.val(),t.val(),t.data("language")))})),void 0!==wp.utils&&void 0!==wp.utils.WordCounter&&(WPGlobusCoreData.wordCounter={},l=this,s={},c.each(WPGlobusCoreData.enabled_languages,function(t,a){return a==WPGlobusCoreData.default_language||(s[t]="content_"+a,n=jQuery,e=new wp.utils.WordCounter,i=a,WPGlobusCoreData.wordCounter[i]={},WPGlobusCoreData.wordCounter[i].counter=e,void n(function(){function o(t){var a,e;"object"==typeof t&&(t="tinymce"==t?l.getCurrentTab():t.target.id.replace("content_","")),void 0!==WPGlobusCoreData.wordCounter[t]&&(a=!WPGlobusCoreData.wordCounter[t].contentEditor||WPGlobusCoreData.wordCounter[t].contentEditor.isHidden()?WPGlobusCoreData.wordCounter[t].content.val():WPGlobusCoreData.wordCounter[t].contentEditor.getContent({format:"raw"}),(e=WPGlobusCoreData.wordCounter[t].counter.count(a))!==WPGlobusCoreData.wordCounter[t].prevCount&&WPGlobusCoreData.wordCounter[t].count.text(e),WPGlobusCoreData.wordCounter[t].prevCount=e)}WPGlobusCoreData.wordCounter[i].content=n("#content_"+i),WPGlobusCoreData.wordCounter[i].count=n("#wp-word-count-"+i).find(".word-count-"+i),WPGlobusCoreData.wordCounter[i].prevCount=0,n(document).on("tinymce-editor-init",function(t,a){var e;-1!=n.inArray(a.id,s)&&(e=a.id.replace("content_",""),(WPGlobusCoreData.wordCounter[e].contentEditor=a).on("nodechange keyup",_.debounce(o,1e3)))}),WPGlobusCoreData.wordCounter[i].content.on("input keyup",_.debounce(o,1e3)),o(i)}));var n,e,i})),c(document).on("click","#publish, #save-post",function(){var e,t,o,n;1<WPGlobusAdmin.data.open_languages.length&&(c(document).triggerHandler("wpglobus_before_save_post",{content_tabs_id:i}),e=c("#title").val(),n=o="",0==e.length&&(t=WPGlobusAdmin.data.open_languages.indexOf(WPGlobusAdmin.data.default_language),WPGlobusAdmin.data.open_languages.splice(t,1),c(WPGlobusAdmin.data.open_languages).each(function(t,a){n=0==t?"":"-",0<(e=c("#title_"+a).val()).length&&(0==o.length&&(n=""),o=o+n+e)})),0<o.length&&c("#title").val(o)),void 0===WPGlobusAdmin.data.tagsdiv||WPGlobusAdmin.data.tagsdiv.length<1||c(WPGlobusAdmin.data.tagsdiv).each(function(t,a){if(0==c("#"+a).length)return!0;var e=a.replace("tagsdiv-","");if("undefined"===e)return!0;if(0==c("#tax-input-"+e).length)return!0;var o,n=[];c("#tagsdiv-"+e+" .tagchecklist li").each(function(t,a){o=(o=c(a).html()).replace(/<button.*<\/button> /,""),void 0===WPGlobusAdmin.data.tag[e][o]?n[t]=o:n[t]=WPGlobusAdmin.data.tag[e][o]}),c("#tax-input-"+e).val(n.join(", "))})}),c(".ui-state-default").on("click",function(){"link-tab-default"===c(this).attr("id")&&(c(window).scrollTop(c(window).scrollTop()+1),c(window).scrollTop(c(window).scrollTop()-1))}),c(document).on("tabsactivate",i,function(t,a){WPGlobusAdmin.currentTab=a.newTab[0].dataset.language}),c("#titlewrap input").addClass("wpglobus-translatable"),c(".title_wpglobus").addClass("wpglobus-translatable"),c(document).triggerHandler("wpglobus_after_post_edit")},adminCentral:function(){c(".wpglobus-admin-central-tab").css({display:"none"}),1<c(".nav-tab-active").length&&c(".wpglobus-about-wrap .nav-tab-wrapper a").removeClass("nav-tab-active");var e=!0;0==location.hash.indexOf("#")&&c(".wpglobus-about-wrap .nav-tab-wrapper a").each(function(t,a){c(a).attr("href")==location.hash&&(e=!1,c(a).addClass("nav-tab-active"))}),e&&c(".wpglobus-about-wrap .nav-tab-wrapper a").eq(0).addClass("nav-tab-active");var t=c(".wpglobus-about-wrap .nav-tab-active").data("tab-id");""!=t&&c("#"+t).css({display:"block"}),c(document).on("click",".wpglobus-about-wrap .nav-tab",function(t){var a=c(this);a.hasClass("nav-tab-active")||(c(".wpglobus-admin-central-tab").css({display:"none"}),c(".wpglobus-about-wrap .nav-tab").removeClass("nav-tab-active"),a.addClass("nav-tab-active"),""!=a.data("tab-id")&&c("#"+a.data("tab-id")).css({display:"block"}))})},start:function(){var a=this;c("#wpglobus_flags").select2({formatResult:this.format,formatSelection:this.format,minimumResultsForSearch:-1,escapeMarkup:function(t){return t}}),c("body").on("click","#enabled_languages-list li:first input",function(t){return t.preventDefault(),c(".redux-save-warn").css({display:"none"}),c("#enabled_languages-list").find("li:first > input").val("1"),0===c("#disable_first_language").length&&c(a.config.disable_first_language).insertAfter("#info_bar"),!1})},format:function(t){return'<img class="wpglobus_flag" src="'+WPGlobusAdmin.flag_url+t.text+'"/> '+t.text},set_dialog:function(){var o,e,n;void 0!==WPGlobusAdmin.data.customFieldsEnabled&&(WPGlobusAdmin.data.customFieldsEnabled=this.parseBool(WPGlobusAdmin.data.customFieldsEnabled),!WPGlobusAdmin.data.customFieldsEnabled)||(void 0===WPGlobusAdmin.data.excludeCustomFields&&(WPGlobusAdmin.data.excludeCustomFields=!1),e=!1,(n=function(t){var s,d,u="wpglobus_dialog_start wpglobus_dialog_icon",r=['<div class="wpglobus_dialog_options_wrapper hidden">','<input style="width:initial;" id="wpglobus-cb-{{id}}" data-object="#wpglobus-dialog-start-{{id}}" data-meta-key="{{meta-key}}" class="wpglobus_dialog_option wpglobus_dialog_cb" type="checkbox" {{checked}} />',"</div>"].join(""),a=void 0===t?"#the-list tr":"#the-list tr#"+t;c(a).each(function(){var t,a,e,o=c(this),n=o.attr("id"),i=o.find("textarea"),l=u;return void 0===(s=i.attr("id"))||(e=c("#"+n+"-key").val(),!(!WPGlobusAdmin.data.excludeCustomFields||-1==c.inArray(e,WPGlobusAdmin.data.excludeCustomFields))||(t=c("#"+s).clone(),c(i).addClass("wpglobus-dialog-field-source hidden"),a=i.attr("name"),c(t).attr("id","wpglobus-"+s),c(t).attr("name","wpglobus-"+a),c(t).attr("data-source-id",s),c(t).attr("class","wpglobus-dialog-field"),c(t).val(WPGlobusCore.TextFilter(c(i).val(),WPGlobusCoreData.language)),c(t).insertAfter(i),d=(d=r.replace(/{{id}}/g,s)).replace(/{{meta-key}}/g,e),void 0===WPGlobusAdmin.data.post_meta_settings[WPGlobusAdmin.data.post_type]?d=d.replace(/{{checked}}/,"checked"):l=void 0!==WPGlobusAdmin.data.post_meta_settings[WPGlobusAdmin.data.post_type][e]&&"false"==WPGlobusAdmin.data.post_meta_settings[WPGlobusAdmin.data.post_type][e]?(d=d.replace(/{{checked}}/,""),u+" wpglobus_dialog_start_hidden"):(d=d.replace(/{{checked}}/,"checked"),u),void o.append('<td style="width:20px;"><div id="wpglobus-dialog-start-'+s+'" data-type="control" data-source-type="textarea" data-source-id="'+s+'" class="'+l+'"></div>'+d+"</td>")))}),!e&&0<c("#list-table .wpglobus_dialog_start").length&&(c("#list-table thead tr").append('<th class="wpglobus-control-head"><div class="wpglobus_dialog_settings wpglobus_dialog_icon"></div></th>'),e=!0)})(),c("body").on("change",".wpglobus-dialog-field",function(){var e,o,n=c(this),t="#"+n.data("source-id"),i="";e=c(t).val(),/(\{:|\[:|<!--:)[a-z]{2}/.test(e)?(c.each(WPGlobusCoreData.enabled_languages,function(t,a){""!=(o=a==WPGlobusCoreData.language?n.val():WPGlobusCore.TextFilter(e,a,"RETURN_EMPTY"))&&(i+=WPGlobusCore.addLocaleMarks(o,a))}),c(t).val(i)):c(t).val(n.val())}),c(document).ajaxSend(function(t,a,e){"add-meta"==e.action&&(o=e.element)}),c(document).ajaxComplete(function(t,a,e){"add-meta"==e.action&&void 0!==a.responseXML&&n("newmeta"==o?"meta-"+c(a.responseXML.documentElement.outerHTML).find("meta").attr("id"):o)}),WPGlobusDialogApp.init({dialogTitle:"Edit meta"}))}},new t.App,t)});
|
1 |
+
var WPGlobusCore,WPGlobusDialogApp;!function(i){var d=WPGlobusCore={strpos:function(t,a,e){e=(t=""+t).indexOf(a,e);return 0<=e&&e},TextFilter:function(t,a,e){if(void 0===t||""===t)return t;var o,n,i=[],l=!1;a=""==a?"en":a,e=void 0===e||""==e?"RETURN_IN_DEFAULT_LANGUAGE":e,i[0]=[],i[0].start=WPGlobusCoreData.locale_tag_start.replace("%s",a),i[0].end=WPGlobusCoreData.locale_tag_end,i[1]=[],i[1].start="\x3c!--:"+a+"--\x3e",i[1].end="\x3c!--:--\x3e",i[2]=[],i[2].start="[:"+a+"]",i[2].end="[:";for(var s=0;s<3;s++)if(!1!==(o=d.strpos(t,i[s].start))){o+=i[s].start.length,t=!1===(n=d.strpos(t,i[s].end,o))?t.substr(o):t.substr(o,n-o),l=!0;break}return l||("RETURN_EMPTY"==e?a==WPGlobusCoreData.default_language&&!/(\{:|\[:|<!--:)[a-z]{2}/.test(t)||(t=""):a==WPGlobusCoreData.default_language?/(\{:|\[:|<!--:)[a-z]{2}/.test(t)&&(t=""):t=d.TextFilter(t,WPGlobusCoreData.default_language)),t},addLocaleMarks:function(t,a){return WPGlobusCoreData.locale_tag_start.replace("%s",a)+t+WPGlobusCoreData.locale_tag_end},getTranslations:function(e){var o,n={};return i.each(WPGlobusCoreData.enabled_languages,function(t,a){o=a==WPGlobusCoreData.default_language?"RETURN_IN_DEFAULT_LANGUAGE":"RETURN_EMPTY",n[a]=d.TextFilter(e,a,o)}),n},getString:function(t,a,e){if(void 0===t)return t;void 0===a&&(a=""),void 0===e&&(e=WPGlobusCoreData.language),(t=d.getTranslations(t))[e]=a;var o="";return i.each(t,function(t,a){""!=a&&t!=WPGlobusCoreData.default_language&&(o+=d.addLocaleMarks(a,t))}),o=""!=t[WPGlobusCoreData.default_language]?""==o?t[WPGlobusCoreData.default_language]:d.addLocaleMarks(t[WPGlobusCoreData.default_language],WPGlobusCoreData.default_language)+o:o}}}(jQuery),function(c){var g=WPGlobusDialogApp={option:{listenClass:".wpglobus_dialog_start",settingsClass:".wpglobus_dialog_settings",dialogTabs:"#wpglobus-dialog-tabs",dialogTitle:"",customData:null,callback:function(){},dialogOptions:{title:"",placeholder:"",formFooter:"",beforeOpen:function(){},afterOpen:function(){},afterSave:function(){},close:function(){}},dialog:{}},form:void 0,element:void 0,element_by:"id",id:"",clone_id:"",wpglobus_id:"",type:"textarea",source:"",order:{},value:{},request:"core",attrs:{},dialogTitle:"",trClass:"wpglobus-translatable",startButton:['<span id="wpglobus-dialog-start-{{clone_id}}" ','style="{{style}}" ','data-type="control" data-dialog-title="{{title}}" ','data-source-type="" data-source-id="{{id}}" data-source-name="{{name}}" ','data-nodename="{{nodename}}"',"{{sbTitle}} ",'class="{{classes}}"></span>'].join(""),startButtonClass:"wpglobus_dialog_start wpglobus_dialog_icon",clicks:0,init:function(t){g.option.dialog=g.option.dialogOptions,g.option=c.extend(g.option,t),c(g.option.dialogTabs).tabs(),g.dialogTitle=g.option.dialogTitle,this.attachListener(),null!=g.option.customData&&void 0!==g.option.customData.addElements&&c.each(g.option.customData.addElements,function(t,a){g.addElement(a)})},convertToId:function(t){return t=(t=t.replace(/\]/g,"")).replace(/\[/g,"-")},addElement:function(t){var a={id:null,style:"",styleTextareaWrapper:"",sbTitle:"",onChangeClass:"",dialogTitle:"",dialog:g.option.dialogOptions};if("string"==typeof t)a.id=t;else{if("object"!=typeof t)return;a=c.extend(a,t)}var e,o=null,n=null,i=null,l=null,s=g.startButton,d="";if(g.element_by="name",0==(l=document.getElementsByName(a.id)).length&&(g.element_by="id",l=document.getElementById(a.id)),null!==l){if(n=a.id,i=void 0===(o="id"==g.element_by?c("#"+n):(d=(d=l[0].nodeName).toLowerCase(),c(d+'[name="'+n+'"]'))).attr("name")||""==o.attr("name")?n:o.attr("name"),g.clone_id=g.convertToId(n),-1!=i.indexOf("wpglobus")||-1!=g.clone_id.indexOf("wpglobus"))return!1;if(0<c("#wpglobus-"+g.clone_id).length)return!1;if(0<c(d+'[name="wpglobus-'+i+'"]').length)return!1;t=c(o.clone()),l=o.attr("style")||"",o.attr("style","display:none;"),t.attr("id","wpglobus-"+g.clone_id).attr("name","wpglobus-"+i),t.addClass(g.trClass),""!=a.onChangeClass&&t.addClass(a.onChangeClass),("id"==g.element_by?t.attr("data-source-id",n).attr("data-source-name",""):t.attr("data-source-id","").attr("data-source-name",i)).attr("data-source-get-by",g.element_by),"textarea"==d?(e=WPGlobusCore.getTranslations(o.val())[WPGlobusCoreData.language],t.val(e),t.attr("data-nodename","textarea"),""==a.style?t.attr("style",l+";width:95%;float:left;"):t.attr("style",l+";"+a.style)):(e=WPGlobusCore.getTranslations(o.val())[WPGlobusCoreData.language],t.val(e),t.attr("data-nodename","input"),""!=a.style&&t.attr("style",l+";"+a.style)),""!=a.dialog&&t.attr("data-dialog",JSON.stringify(a.dialog)),s=s.replace(/{{clone_id}}/g,g.clone_id),s="id"==g.element_by?(s=(s=s.replace(/{{id}}/g,g.clone_id)).replace(/{{name}}/g,"")).replace(/{{nodename}}/g,""):(s=(s=s.replace(/{{id}}/g,"")).replace(/{{name}}/g,i)).replace(/{{nodename}}/g,d);s="textarea"==d?s.replace("{{style}}","float:left;margin-top:0;"):s.replace("{{style}}",""),i="textarea"==d?g.startButtonClass+" wpglobus-textarea wpglobus-textarea-"+g.clone_id:g.startButtonClass;s=s.replace("{{classes}}",i),s=""==a.dialogTitle?s.replace("{{title}}",g.dialogTitle):s.replace("{{title}}",a.dialogTitle),s=""==a.sbTitle?s.replace("{{sbTitle}}",a.sbTitle):s.replace("{{sbTitle}}",'title="'+a.sbTitle+'"'),c(s).insertAfter(o),c(t).insertAfter(o),"textarea"==d&&(c("#wpglobus-"+g.clone_id).addClass("wpglobus-textarea-"+g.clone_id),c(".wpglobus-textarea-"+g.clone_id).wrapAll('<div class="wpglobus-textarea-wrapper" style="'+a.styleTextareaWrapper+'"></div>'));var u,r=!1;return(""==a.onChangeClass?u="#wpglobus-"+g.clone_id:(u="."+a.onChangeClass,void 0===(a=c._data(c(document)[0],"events"))?r=!0:void 0!==a.change&&c.each(a.change,function(t,a){if(a.selector==u)return!(r=!0)})),r)?!0:(c(document).on("change",u,function(){var t=c(this),a=""==(a=t.data("source-id"))?t.data("nodename")+'[name="'+t.data("source-name")+'"]':"#"+a;c(a).val(WPGlobusCore.getString(c(a).val(),t.val()))}),!0)}},saveDialog:function(){var e,o,n="",i="",l="";c(".wpglobus_dialog_textarea").each(function(t,a){o=c(a),e=o.val(),(o=o.data("language"))==WPGlobusAdmin.data.language&&(l=e),""!=e&&(n+=WPGlobusCore.addLocaleMarks(e,o),o==WPGlobusCoreData.default_language&&(i=e))}),n=n.length==i.length+8?i:n,c(g.id).val(n),n=""==l?i:l,c(g.wpglobus_id).val(n),g.runCallback(g.option.dialog.afterSave)},dialog:c("#wpglobus-dialog-wrapper").dialog({autoOpen:!1,width:650,modal:!0,dialogClass:"wpglobus-dialog",buttons:[{text:"Save",class:"wpglobus-button-save",click:function(){g.saveDialog(),g.dialog.dialog("close")}},{text:"Cancel",class:"wpglobus-button-cancel",click:function(){g.dialog.dialog("close")}}],open:function(t,a){var e=g.dialogTitle;void 0!==g.attrs.maxlength&&(c(".wpglobus_dialog_textarea").attr("maxlength",g.attrs.maxlength),e+=" | maxlength="+g.attrs.maxlength),c(".wpglobus-dialog .ui-dialog-title").text(e),c(this).removeClass("hidden")},close:function(){c(this).addClass("hidden"),g.runCallback(g.option.dialog.close),g.form[0].reset()}}),attachListener:function(){c(document).on("click",g.option.settingsClass,function(){c(".wpglobus_dialog_options_wrapper").hasClass("hidden")?c(".wpglobus_dialog_options_wrapper").removeClass("hidden"):c(".wpglobus_dialog_options_wrapper").addClass("hidden")}),c(document).on("click",".wpglobus_dialog_option",function(t){var a=c(this),e=a.data("object");g.order.action="save_post_meta_settings",g.order.post_type=WPGlobusAdmin.data.post_type,g.order.checked=a.prop("checked"),g.order.id=a.attr("id"),g.order.meta_key=a.data("meta-key"),g.ajax(g.order).done(function(t){"ok"==t.result&&("true"==t.checked?c(e).removeClass("wpglobus_dialog_start_hidden"):c(e).addClass("wpglobus_dialog_start_hidden"))}).fail(function(t){}).always(function(t,a){})}),c(document).on("click",g.option.listenClass,function(a){g.element=c(this),g.id=g.element.data("source-id"),""==g.id?(g.id=g.element.data("nodename")+'[name="'+g.element.data("source-name")+'"]',g.wpglobus_id="#wpglobus-"+g.convertToId(g.element.data("source-name"))):(g.wpglobus_id="#wpglobus-"+g.id,g.id="#"+g.id),g.clicks++,1==g.clicks&&setTimeout(function(){var t;1==g.clicks?g.onClick(a):(t=c(g.id)).hasClass("hidden")?t.removeClass("hidden").attr("style","display:block;"):t.addClass("hidden").attr("style","display:none;"),g.clicks=0},200)}),g.form=g.dialog.find("form#wpglobus-dialog-form").on("submit",function(t){t.preventDefault(),g.saveDialog()})},ajax:function(t){return c.ajax({type:"POST",url:WPGlobusAdmin.ajaxurl,data:{action:WPGlobusAdmin.process_ajax,order:t},dataType:"json",async:!1})},onClick:function(t){void 0===g.element.data("dialog-title")||""==g.element.data("dialog-title")?g.dialogTitle=g.option.dialogTitle:g.dialogTitle=g.element.data("dialog-title"),void 0!==g.id&&(g.attrs.maxlength=c(g.id).attr("maxlength")),g.source=g.element.data("source-value"),void 0===g.source&&(g.source=c(g.id).val(),"ajax"==g.request||(g.value=WPGlobusCore.getTranslations(g.source))),g.option.dialog=c.extend({},g.option.dialogOptions,c(g.wpglobus_id).data("dialog")),""!=g.option.dialog.title&&(g.dialogTitle=g.option.dialog.title),c.each(g.value,function(t,a){var e=c("#wpglobus-dialog-"+t);e.val(a),e.attr("placeholder",WPGlobusCore.TextFilter(g.option.dialog.placeholder,t,"RETURN_IN_DEFAULT_LANGUAGE"))}),c("#wpglobus-dialog-form-footer").html(g.option.dialog.formFooter),g.runCallback(g.option.dialog.beforeOpen),g.dialog.dialog("open"),g.runCallback(g.option.dialog.afterOpen)},runCallback:function(t){var a,e;"object"==typeof t?(a=Object.keys(t)[0],e=t[Object.keys(t)[0]],"window"===a?"function"==typeof window[e]&&window[e](t[Object.keys(t)[1]]):"function"==typeof window[a][e]&&window[a][e](t[Object.keys(t)[1]])):"string"==typeof t?"function"==typeof window[t]&&window[t]():"function"==typeof t&&t()}}}(jQuery),jQuery(document).ready(function(){"use strict";var t,r;window.WPGlobusAdminApp=(t=window.WPGlobusAdminApp||{},r=jQuery,t.App=function(t){void 0===window.WPGlobusAdminApp&&(this.config={debug:!1,version:WPGlobusAdmin.version},this.status="ok","undefined"==typeof WPGlobusAdmin?(this.status="error",this.config.debug&&console.log("WPGlobus: error options loading")):this.config.debug&&console.dir(WPGlobusAdmin),this.config.disable_first_language=['<div id="disable_first_language" style="display:block;" class="redux-field-errors notice-red">',"<strong>","<span> </span>",WPGlobusAdmin.i18n.cannot_disable_language,"</strong>","</div>"].join(""),r.extend(this.config,t),"ok"===this.status&&this.init())},t.App.prototype={$document:r(document),init:function(){WPGlobusCoreData.multisite=this.parseBool(WPGlobusCoreData.multisite),this.adminInit(),r("#content").addClass("wpglobus-editor").attr("data-language",WPGlobusAdmin.data.default_language),r("textarea[id^=content_]").each(function(t,a){var e=r(a).attr("id").replace("content_","");r(a).attr("data-language",e)}),"post.php"===WPGlobusAdmin.page?(this.postEdit(),this.set_dialog(),"undefined"!=typeof WPGlobusAioseop&&WPGlobusAioseop.init()):"menu-edit"===WPGlobusAdmin.page?(WPGlobusDialogApp.init({dialogTitle:"Edit description"}),this.navMenus()):"taxonomy-edit"===WPGlobusAdmin.page?WPGlobusAdmin.data.tag_id&&this.taxonomyEdit():"taxonomy-quick-edit"===WPGlobusAdmin.page?this.quickEdit("taxonomy"):"edit.php"===WPGlobusAdmin.page?(this.quickEdit("post"),0<_.size(WPGlobusAdmin.$_get)&&WPGlobusDialogApp.init()):"options-general.php"==WPGlobusAdmin.page?(this.optionsGeneral(),WPGlobusDialogApp.init({customData:WPGlobusCoreData.page_custom_data})):"widgets.php"==WPGlobusAdmin.page?(WPGlobusWidgets.init(),WPGlobusDialogApp.init({dialogTitle:"Edit text"})):"wpglobus_options"==WPGlobusAdmin.page?this.start():"wpglobusAdminCentral"==WPGlobusAdmin.page?this.adminCentral():WPGlobusDialogApp.init({customData:WPGlobusCoreData.page_custom_data})},parseBool:function(t){return!/^(false|0)$/i.test(t)&&!!t},getCurrentTab:function(){return r(".wpglobus-post-body-tabs-list .ui-tabs-active").data("language")},adminInit:function(){var t=r(".wpglobus-addons-group a").data("key");void 0!==t&&(0<=window.location.search.indexOf("page=wpglobus_options&tab="+t)?WPGlobusCoreData.multisite?window.location=WPGlobusCoreData.pluginInstallLocation.multisite:window.location=WPGlobusCoreData.pluginInstallLocation.single:(t=r("#toplevel_page_wpglobus_options li").eq(t+1),(WPGlobusCoreData.multisite?r(t).find("a").attr("href",WPGlobusCoreData.pluginInstallLocation.multisite):r(t).find("a").attr("href",WPGlobusCoreData.pluginInstallLocation.single)).attr("onclick","window.location=jQuery(this).attr('href');return false;")))},optionsGeneral:function(){var e=r("#blogname"),t=r("body");e.addClass("hidden"),r("#wpglobus-blogname").insertAfter(e).removeClass("hidden"),t.on("blur",".wpglobus-blogname",function(){r(".wpglobus-blogname").each(function(t,a){a=r(a);e.val(WPGlobusCore.getString(e.val(),a.val(),a.data("language")))})});var o=r("#blogdescription");o.addClass("hidden"),r("#wpglobus-blogdescription").insertAfter(o).removeClass("hidden"),t.on("blur",".wpglobus-blogdesc",function(){r(".wpglobus-blogdesc").each(function(t,a){a=r(a);o.val(WPGlobusCore.getString(o.val(),a.val(),a.data("language")))})})},quickEdit:function(o){var n,i,l,t;void 0!==WPGlobusAdmin.data.has_items&&WPGlobusAdmin.data.has_items&&(n="",i=0,r(document).ajaxComplete(function(t,a,e){void 0!==e.data&&""!=n&&0<=e.data.indexOf("action=inline-save-tax&")&&(r("#"+n+" a.row-title").text(WPGlobusAdmin.qedit_titles[i][WPGlobusAdmin.data.language].name),r("#"+n+" .description").text(WPGlobusAdmin.qedit_titles[i][WPGlobusAdmin.data.language].description))}),l={},r("#the-list tr").each(function(t,a){var e=r(a),a="post"===o?"post-":"tag-";i=e.attr("id").replace(a,""),l[i]={},"post"===o?l[i].source=e.find(".post_title").text():"taxonomy"===o&&(l[i].source=r("#inline_"+i+" .name").text())}),(t={action:"get_titles"}).type=o,t.taxonomy=void 0!==WPGlobusAdmin.data.taxonomy&&WPGlobusAdmin.data.taxonomy,t.title=l,r.ajax({type:"POST",url:WPGlobusAdmin.ajaxurl,data:{action:WPGlobusAdmin.process_ajax,order:t},dataType:"json"}).done(function(t){WPGlobusAdmin.qedit_titles=t.qedit_titles,r.each(t.bulkedit_post_titles,function(t,a){r("#inline_"+t+" .post_title").text(a[WPGlobusAdmin.data.language].name)})}).fail(function(t){}).always(function(t,a){}),r("body").on("change",".wpglobus-quick-edit-title",function(){var o="",n=[];r(".wpglobus-quick-edit-title").each(function(t,a){var e=r(a),a=e.data("language");""!==e.val()&&(o=WPGlobusCore.getString(o,e.val(),a)),WPGlobusAdmin.qedit_titles[i][a].name=e.val(),n[t]=a});var t=r(document).triggerHandler("wpglobus_get_translations",{string:o,lang:n,id:i});void 0!==t&&(o=t),r("input.ptitle").eq(0).val(o),WPGlobusAdmin.qedit_titles[i].source=o}),void 0!==WPGlobusAdmin.data.tags&&r.each(WPGlobusAdmin.data.tags,function(t,a){WPGlobusAdmin.data.value[a].post_id={}}),r("button.save, input#bulk_edit").on("mouseenter",function(t){void 0!==WPGlobusAdmin.data.tags&&(("bulk_edit"==t.currentTarget.id?r("input#bulk_edit"):r("button.save")).unbind("click"),r("button.save, input#bulk_edit").on("click",function(a){var t=r.when(),e=(r(this),r.Deferred());e.resolve(function(t){t.next(".spinner").css({visibility:"visible"}),"bulk_edit"!=a.currentTarget.id&&r.ajaxSetup({async:!1});var o,n,i,l=t.parents("tr"),s=l.attr("id").replace("edit-","");r.each(WPGlobusAdmin.data.tags,function(t,a){if(0==(o=l.find("textarea[name='"+WPGlobusAdmin.data.names[a]+"']")).length)return!0;WPGlobusAdmin.data.value[a].post_id[s]=o.val(),n=WPGlobusAdmin.data.value[a].post_id[s].split(","),i=[];for(var e=0;e<n.length;e++)n[e]=n[e].trim(" "),""!=n[e]&&(void 0===WPGlobusAdmin.data.tag[a][n[e]]?i[e]=n[e]:i[e]=WPGlobusAdmin.data.tag[a][n[e]]);o.val(i.join(", "))})}(r(this))),t=t.then(function(){return r.when(e.done())}).then(function(){"bulk_edit"!=a.currentTarget.id&&setTimeout(function(){inlineEditPost.save(i),r.ajaxSetup({async:!0})},50)})}))}),r("#the-list").on("click",".editinline",function(){var t=r(this);if(n=t.parents("tr").attr("id"),"post"===o)i=n.replace("post-","");else{if("taxonomy"!==o)return;i=n.replace("tag-","")}"post"===o&&void 0!==WPGlobusAdmin.data.tags&&r.each(WPGlobusAdmin.data.tags,function(t,a){var e,o;""==WPGlobusAdmin.data.value[a]||void 0!==(e=r("#edit-"+i+' textarea[name="'+WPGlobusAdmin.data.names[a]+'"]').val())&&(o=e.split(","),r.each(o,function(t,a){e=e.replace(a,WPGlobusCore.TextFilter(a,WPGlobusCoreData.language))}),r("#edit-"+i+' textarea[name="'+WPGlobusAdmin.data.names[a]+'"]').val(e))});var a=r("#edit-"+i+" input.ptitle").eq(0),t=a.parents("label");void 0!==WPGlobusAdmin.qedit_titles&&(a.val(WPGlobusAdmin.qedit_titles[i].source),a.addClass("hidden"),r(WPGlobusAdmin.data.template).insertAfter(t),void 0===WPGlobusAdmin.qedit_titles[i]&&(WPGlobusAdmin.qedit_titles[i]={},WPGlobusAdmin.qedit_titles[i].source=r("#"+n+" .name a.row-title").text(),r(WPGlobusAdmin.data.enabled_languages).each(function(t,a){WPGlobusAdmin.qedit_titles[i][a]={},a==WPGlobusAdmin.data.default_language?WPGlobusAdmin.qedit_titles[i][a].name=WPGlobusAdmin.qedit_titles[i].source:WPGlobusAdmin.qedit_titles[i][a].name="",WPGlobusAdmin.qedit_titles[i][a].description=""})),r(".wpglobus-quick-edit-title").each(function(t,a){var e=r(a),a=e.data("language");e.attr("id",a+i),void 0!==WPGlobusAdmin.qedit_titles[i][a]&&(WPGlobusAdmin.qedit_titles[i][a].name=WPGlobusAdmin.qedit_titles[i][a].name.replace(/\\\'/g,"'"),WPGlobusAdmin.qedit_titles[i][a].name=WPGlobusAdmin.qedit_titles[i][a].name.replace(/\\\"/g,'"'),e.val(WPGlobusAdmin.qedit_titles[i][a].name),WPGlobusAdmin.qedit_titles[i].source=WPGlobusCore.getString(WPGlobusAdmin.qedit_titles[i].source,WPGlobusAdmin.qedit_titles[i][a].name,a))}),r("input.ptitle").eq(0).val(WPGlobusAdmin.qedit_titles[i].source))}))},taxonomyEdit:function(){var a=[];a[0]="name",a[1]="description";r.each(WPGlobusCoreData.enabled_languages,function(t,d){r.each(a,function(t,a){var e,o,n,i,l,s;o=d,n=r("#"+(e=a)),i=n.clone(),l=n.attr("name"),s="wpglobus-element wpglobus-element_"+e+" wpglobus-element_"+o+" wpglobus-translatable",a=(a=document.getElementById(e)).nodeName,r(i).attr("id",e+"_"+o),r(i).attr("name",l+"_"+o),o!==WPGlobusCoreData.default_language&&(s+=" hidden"),r(i).attr("class",s),r(i).attr("data-save-to",e),r(i).attr("data-language",o),"INPUT"==a?r(i).attr("value",r("#wpglobus-link-tab-"+o).data(e)):"TEXTAREA"==a&&r(i).text(r("#wpglobus-link-tab-"+o).data(e)),n.addClass("hidden"),0==r(".wpglobus-element_"+e).length?r(i).insertAfter(n):r(i).insertAfter(r(".wpglobus-element_"+e).last())})}),r(".wpglobus-taxonomy-tabs").insertAfter("#ajax-response"),r(".wrap").tabs(),r("body").on("click",".wpglobus-taxonomy-tabs li",function(t){var a=r(this).data("language");r(".wpglobus-element").addClass("hidden"),r(".wpglobus-element_"+a).removeClass("hidden"),r(".wpglobus-tax-edit-tab a").removeClass("wpglobus-tab-link-active"),r("#wpglobus-link-tab-"+a+" a").addClass("wpglobus-tab-link-active")}),r(".wpglobus-element").on("change",function(){var o=r(this).data("save-to"),n="";r(".wpglobus-element").each(function(t,a){var e=r(a),a=e.val();e.data("save-to")==o&&""!==a&&(n+=WPGlobusCore.addLocaleMarks(a,e.data("language")))}),r("#"+o).val(n)}),r(WPGlobusAdmin.data.multilingualSlug.title).insertAfter(".term-slug-wrap th label")},navMenus:function(){function e(){n!==r(i).length&&(clearInterval(o),r(i).each(function(t,a){var o,e=r(a);e.hasClass("wpglobus-menu-item")||(o=r(a).attr("id"),r.each(["input.edit-menu-item-title","input.edit-menu-item-attr-title"],function(t,a){var e=r("#"+o+" "+a),a=r(e);a.hasClass("wpglobus-hidden")||(a.addClass("wpglobus-hidden"),a.css("display","none"),e=a.parent("label"),a=a.parents("p"),r(a).css("height","80px"),r(e).append('<div style="color:#f00;">'+WPGlobusAdmin.i18n.save_nav_menu+"</div>"))}),e.addClass("wpglobus-menu-item"))}))}var o,n,i="#menu-to-edit .menu-item";r.ajaxSetup({beforeSend:function(t,a){void 0!==a.data&&0<=a.data.indexOf("action=add-menu-item")&&(n=r(i).length,o=setInterval(e,500))}}),r(i).each(function(t,a){var e=r(a).attr("id"),u=e.replace("menu-item-","");r.each(["input.edit-menu-item-title","input.edit-menu-item-attr-title"],function(n,i){var l=r("#"+e+" "+i);l.val()!=WPGlobusAdmin.data.items[u][i].source&&l.val(WPGlobusAdmin.data.items[u][i].source);var s=r("#"+e+" "+i).parents("p"),d=0;r.each(WPGlobusAdmin.data.open_languages,function(t,a){var e=l.clone();e.attr("id",l.attr("id")+"-"+a),e.attr("name",l.attr("id")+"-"+a),e.attr("data-language",a),e.attr("data-item-id",u),e.attr("placeholder",WPGlobusAdmin.data.en_language_name[a]);var o=WPGlobusAdmin.data.items[u][a][i].class;0===n&&a===WPGlobusAdmin.data.default_language?e.attr("class",o+" edit-menu-item-title"):e.attr("class",o),""!=WPGlobusAdmin.data.items[u][a][i].caption?e.attr("value",WPGlobusAdmin.data.items[u][a][i].caption):e.attr("value",""),e.css("margin-bottom","0.6em"),r(s).append(e),d=t}),d=40*(d+1),l.css("display","none").attr("class","").addClass("widefat wpglobus-hidden"),r(s).css("height",d+"px").addClass("wpglobus-menu-item-box")}),r(a).addClass("wpglobus-menu-item")}),r(".menus-move-left, .menus-move-right").each(function(t,a){var e,o=r(a),n=(o.parents("li").attr("id").replace("menu-item-",""),o.attr("title"));void 0!==n&&r.each(WPGlobusAdmin.data.post_titles,function(t,a){0<=n.indexOf(t)&&(e=n.replace(t,a),o.attr("title",e),o.text(e))})}),r(".edit-menu-item-title").trigger("change"),wpNavMenu.refreshAdvancedAccessibility(),wpNavMenu.menusChanged=!1,r(".wpglobus-menu-item").on("change",function(){var t,a,e=r(this),o=e.data("item-id");e.hasClass("wpglobus-item-title")&&(t=WPGlobusCore.getString(r("input#edit-menu-item-title-"+o).val(),e.val(),e.data("language")),void 0!==(a=r(document).triggerHandler("wpglobus_get_menu_translations",{string:t,lang:WPGlobusCoreData.open_languages,id:o,type:"input.edit-menu-item-title"}))&&(t=a),r("input#edit-menu-item-title-"+o).val(t)),e.hasClass("wpglobus-item-attr")&&(t=WPGlobusCore.getString(r("input#edit-menu-item-attr-title-"+o).val(),e.val(),e.data("language")),void 0!==(a=r(document).triggerHandler("wpglobus_get_menu_translations",{string:t,lang:WPGlobusCoreData.open_languages,id:o,type:"input.edit-menu-item-attr-title"}))&&(t=a),r("input#edit-menu-item-attr-title-"+o).val(t))});var a=[];setTimeout(function(){r(".edit-menu-item-description").each(function(){var t=r(this).attr("id");a.push(t),WPGlobusDialogApp.addElement(t)}),r(".wpglobus_dialog_start").each(function(){r(this).css({"font-style":"normal"}),r(this).after("<br />")});var t={action:"getNavMenuItemsDescription"};t.menuItems=a,r.ajax({type:"POST",url:WPGlobusAdmin.ajaxurl,data:{action:WPGlobusAdmin.process_ajax,order:t},dataType:"json"}).done(function(t){"object"==typeof t&&r.each(t,function(t,a){""!=a&&(r("#"+t).val(a),r("#wpglobus-"+t).val(WPGlobusCore.TextFilter(a,WPGlobus.language,"RETURN_EMPTY")))})}).fail(function(t){}).always(function(t,a){})},1e3)},postEdit:function(){r(document).on("heartbeat-send",function(t,o){void 0!==o.wp_autosave&&(o.wpglobus_heartbeat="wpglobus",r.each(WPGlobusAdmin.data.open_languages,function(t,a){var e=r("#title_"+a).val()||"";""!=(e=r.trim(e))&&(o.wp_autosave["post_title_"+a]=e),e=r("#content_"+a).val()||"",""!=(e=r.trim(e))&&(o.wp_autosave["content_"+a]=e)}))});var a,i,l,e="#postdivrich",o=!0,s="#post-body-content";!1===WPGlobusAdmin.data.support.editor&&(o=!(e="#titlediv")),!1===WPGlobusAdmin.data.support.title&&(o=!1),r(s).prepend(r(".wpglobus-post-body-tabs-list")),r.each(WPGlobusAdmin.tabs,function(t,a){"default"===a?(r(e).wrap('<div id="tab-default"></div>'),o&&r(r("#titlediv")).insertBefore(e)):(r(e+"-"+a).wrap('<div id="tab-'+a+'"></div>'),o&&r(r("#titlediv-"+a)).insertBefore(e+"-"+a))}),setTimeout(function(){var n=!1;r(s).addClass("wpglobus-post-body-tabs").tabs({beforeActivate:function(t,a){var e,i,l;n||(o=(e=r("#wp-content-editor-container .mce-btn-group").eq(0)).children("div"),0!=e.length&&0!=o.length&&(i=e.attr("style"),l=o.attr("style"),r.each(WPGlobusCoreData.enabled_languages,function(t,a){if(a!=WPGlobusCoreData.default_language){var e=r("#wp-content_"+a+"-editor-container .mce-btn-group").eq(0),o=e.children("div");if(0==e.length||0==o.length)return!0;var n=e.attr("style"),a=o.attr("style");i!=n&&e.attr("style",i),l!=a&&o.attr("style",l)}}),n=!0));var o=a.oldTab[0].id.replace("link-tab-",""),a=a.newTab[0].id.replace("link-tab-","");r(".wpglobus-tab-link").removeClass("wpglobus-tab-link-active"),r("#link-tab-"+a+" .wpglobus-tab-link").addClass("wpglobus-tab-link-active"),"default"==o&&(o=WPGlobusCoreData.default_language),"default"==a&&(a=WPGlobusCoreData.default_language);a=r(document).triggerHandler("wpglobus_post_body_tabs",[o,a]);return!(!a&&void 0!==a)}})},500),r("#title").val(WPGlobusAdmin.title),r("#content").text(WPGlobusAdmin.content),"undefined"!=typeof WPGlobusVendor&&WPGlobusVendor.vendor.WPSEO&&("undefined"!=typeof wpglobus_wpseo?wpglobus_wpseo():"undefined"!=typeof WPGlobusYoastSeo&&("undefined"!=typeof WPGlobusYoastSeoPremium&&WPGlobusYoastSeoPremium&&"function"==typeof WPGlobusYoastSeoPremium.init&&WPGlobusYoastSeoPremium.init(),"function"==typeof WPGlobusYoastSeo.init&&WPGlobusYoastSeo.init())),WPGlobusAdmin.data.modify_excerpt&&((a=r("#excerpt")).addClass("hidden").css({display:"none"}),r(WPGlobusAdmin.data.template).insertAfter(a),r("body").on("change",".wpglobus-excerpt",function(){var t=r(this);a.val(WPGlobusCore.getString(a.val(),t.val(),t.data("language")))})),void 0!==wp.utils&&void 0!==wp.utils.WordCounter&&(WPGlobusCoreData.wordCounter={},i=this,l={},r.each(WPGlobusCoreData.enabled_languages,function(t,a){return a==WPGlobusCoreData.default_language||(l[t]="content_"+a,n=jQuery,t=new wp.utils.WordCounter,e=a,WPGlobusCoreData.wordCounter[e]={},WPGlobusCoreData.wordCounter[e].counter=t,void n(function(){function o(t){var a;"object"==typeof t&&(t="tinymce"==t?i.getCurrentTab():t.target.id.replace("content_","")),void 0!==WPGlobusCoreData.wordCounter[t]&&(a=!WPGlobusCoreData.wordCounter[t].contentEditor||WPGlobusCoreData.wordCounter[t].contentEditor.isHidden()?WPGlobusCoreData.wordCounter[t].content.val():WPGlobusCoreData.wordCounter[t].contentEditor.getContent({format:"raw"}),(a=WPGlobusCoreData.wordCounter[t].counter.count(a))!==WPGlobusCoreData.wordCounter[t].prevCount&&WPGlobusCoreData.wordCounter[t].count.text(a),WPGlobusCoreData.wordCounter[t].prevCount=a)}WPGlobusCoreData.wordCounter[e].content=n("#content_"+e),WPGlobusCoreData.wordCounter[e].count=n("#wp-word-count-"+e).find(".word-count-"+e),WPGlobusCoreData.wordCounter[e].prevCount=0,n(document).on("tinymce-editor-init",function(t,a){var e;-1!=n.inArray(a.id,l)&&(e=a.id.replace("content_",""),(WPGlobusCoreData.wordCounter[e].contentEditor=a).on("nodechange keyup",_.debounce(o,1e3)))}),WPGlobusCoreData.wordCounter[e].content.on("input keyup",_.debounce(o,1e3)),o(e)}));var n,e})),r(document).on("click","#publish, #save-post",function(){var e,t,o,n;1<WPGlobusAdmin.data.open_languages.length&&(r(document).triggerHandler("wpglobus_before_save_post",{content_tabs_id:s}),e=r("#title").val(),n=o="",0==e.length&&(t=WPGlobusAdmin.data.open_languages.indexOf(WPGlobusAdmin.data.default_language),WPGlobusAdmin.data.open_languages.splice(t,1),r(WPGlobusAdmin.data.open_languages).each(function(t,a){n=0==t?"":"-",0<(e=r("#title_"+a).val()).length&&(0==o.length&&(n=""),o=o+n+e)})),0<o.length&&r("#title").val(o)),void 0===WPGlobusAdmin.data.tagsdiv||WPGlobusAdmin.data.tagsdiv.length<1||r(WPGlobusAdmin.data.tagsdiv).each(function(t,a){if(0==r("#"+a).length)return!0;var e=a.replace("tagsdiv-","");if("undefined"===e)return!0;if(0==r("#tax-input-"+e).length)return!0;var o,n=[];r("#tagsdiv-"+e+" .tagchecklist li").each(function(t,a){o=(o=r(a).html()).replace(/<button.*<\/button> /,""),void 0===WPGlobusAdmin.data.tag[e][o]?n[t]=o:n[t]=WPGlobusAdmin.data.tag[e][o]}),r("#tax-input-"+e).val(n.join(", "))})}),r(".ui-state-default").on("click",function(){"link-tab-default"===r(this).attr("id")&&(r(window).scrollTop(r(window).scrollTop()+1),r(window).scrollTop(r(window).scrollTop()-1))}),r(document).on("tabsactivate",s,function(t,a){WPGlobusAdmin.currentTab=a.newTab[0].dataset.language}),r("#titlewrap input").addClass("wpglobus-translatable"),r(".title_wpglobus").addClass("wpglobus-translatable"),r(document).triggerHandler("wpglobus_after_post_edit")},adminCentral:function(){r(".wpglobus-admin-central-tab").css({display:"none"}),1<r(".nav-tab-active").length&&r(".wpglobus-about-wrap .nav-tab-wrapper a").removeClass("nav-tab-active");var e=!0;0==location.hash.indexOf("#")&&r(".wpglobus-about-wrap .nav-tab-wrapper a").each(function(t,a){r(a).attr("href")==location.hash&&(e=!1,r(a).addClass("nav-tab-active"))}),e&&r(".wpglobus-about-wrap .nav-tab-wrapper a").eq(0).addClass("nav-tab-active");var t=r(".wpglobus-about-wrap .nav-tab-active").data("tab-id");""!=t&&r("#"+t).css({display:"block"}),r(document).on("click",".wpglobus-about-wrap .nav-tab",function(t){var a=r(this);a.hasClass("nav-tab-active")||(r(".wpglobus-admin-central-tab").css({display:"none"}),r(".wpglobus-about-wrap .nav-tab").removeClass("nav-tab-active"),a.addClass("nav-tab-active"),""!=a.data("tab-id")&&r("#"+a.data("tab-id")).css({display:"block"}))})},start:function(){var a=this;r("#wpglobus_flags").select2({formatResult:this.format,formatSelection:this.format,minimumResultsForSearch:-1,escapeMarkup:function(t){return t}}),r("body").on("click","#enabled_languages-list li:first input",function(t){return t.preventDefault(),r(".redux-save-warn").css({display:"none"}),r("#enabled_languages-list").find("li:first > input").val("1"),0===r("#disable_first_language").length&&r(a.config.disable_first_language).insertAfter("#info_bar"),!1})},format:function(t){return'<img class="wpglobus_flag" src="'+WPGlobusAdmin.flag_url+t.text+'"/> '+t.text},set_dialog:function(){var o,a,n;void 0!==WPGlobusAdmin.data.customFieldsEnabled&&(WPGlobusAdmin.data.customFieldsEnabled=this.parseBool(WPGlobusAdmin.data.customFieldsEnabled),!WPGlobusAdmin.data.customFieldsEnabled)||(void 0===WPGlobusAdmin.data.excludeCustomFields&&(WPGlobusAdmin.data.excludeCustomFields=!1),a=!1,(n=function(t){var l,s,d="wpglobus_dialog_start wpglobus_dialog_icon",u=['<div class="wpglobus_dialog_options_wrapper hidden">','<input style="width:initial;" id="wpglobus-cb-{{id}}" data-object="#wpglobus-dialog-start-{{id}}" data-meta-key="{{meta-key}}" class="wpglobus_dialog_option wpglobus_dialog_cb" type="checkbox" {{checked}} />',"</div>"].join(""),t=void 0===t?"#the-list tr":"#the-list tr#"+t;r(t).each(function(){var t,a,e=r(this),o=e.attr("id"),n=e.find("textarea"),i=d;return void 0===(l=n.attr("id"))||(a=r("#"+o+"-key").val(),!(!WPGlobusAdmin.data.excludeCustomFields||-1==r.inArray(a,WPGlobusAdmin.data.excludeCustomFields))||(t=r("#"+l).clone(),r(n).addClass("wpglobus-dialog-field-source hidden"),o=n.attr("name"),r(t).attr("id","wpglobus-"+l),r(t).attr("name","wpglobus-"+o),r(t).attr("data-source-id",l),r(t).attr("class","wpglobus-dialog-field"),r(t).val(WPGlobusCore.TextFilter(r(n).val(),WPGlobusCoreData.language)),r(t).insertAfter(n),s=(s=u.replace(/{{id}}/g,l)).replace(/{{meta-key}}/g,a),void 0===WPGlobusAdmin.data.post_meta_settings[WPGlobusAdmin.data.post_type]?s=s.replace(/{{checked}}/,"checked"):i=void 0!==WPGlobusAdmin.data.post_meta_settings[WPGlobusAdmin.data.post_type][a]&&"false"==WPGlobusAdmin.data.post_meta_settings[WPGlobusAdmin.data.post_type][a]?(s=s.replace(/{{checked}}/,""),d+" wpglobus_dialog_start_hidden"):(s=s.replace(/{{checked}}/,"checked"),d),void e.append('<td style="width:20px;"><div id="wpglobus-dialog-start-'+l+'" data-type="control" data-source-type="textarea" data-source-id="'+l+'" class="'+i+'"></div>'+s+"</td>")))}),!a&&0<r("#list-table .wpglobus_dialog_start").length&&(r("#list-table thead tr").append('<th class="wpglobus-control-head"><div class="wpglobus_dialog_settings wpglobus_dialog_icon"></div></th>'),a=!0)})(),r("body").on("change",".wpglobus-dialog-field",function(){var e,o,n=r(this),t="#"+n.data("source-id"),i="";e=r(t).val(),/(\{:|\[:|<!--:)[a-z]{2}/.test(e)?(r.each(WPGlobusCoreData.enabled_languages,function(t,a){""!=(o=a==WPGlobusCoreData.language?n.val():WPGlobusCore.TextFilter(e,a,"RETURN_EMPTY"))&&(i+=WPGlobusCore.addLocaleMarks(o,a))}),r(t).val(i)):r(t).val(n.val())}),r(document).ajaxSend(function(t,a,e){"add-meta"==e.action&&(o=e.element)}),r(document).ajaxComplete(function(t,a,e){"add-meta"==e.action&&void 0!==a.responseXML&&n("newmeta"==o?"meta-"+r(a.responseXML.documentElement.outerHTML).find("meta").attr("id"):o)}),WPGlobusDialogApp.init({dialogTitle:"Edit meta"}))}},new t.App,t)});
|
includes/js/wpglobus-admin-56.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var WPGlobusCore,WPGlobusDialogApp;!function(i){var d=WPGlobusCore={strpos:function(t,a,e){var o=(t=""+t).indexOf(a,e);return 0<=o&&o},TextFilter:function(t,a,e){if(void 0===t||""===t)return t;var o,n,i=[],l=!1;a=""==a?"en":a,e=void 0===e||""==e?"RETURN_IN_DEFAULT_LANGUAGE":e,i[0]=[],i[0].start=WPGlobusCoreData.locale_tag_start.replace("%s",a),i[0].end=WPGlobusCoreData.locale_tag_end,i[1]=[],i[1].start="\x3c!--:"+a+"--\x3e",i[1].end="\x3c!--:--\x3e",i[2]=[],i[2].start="[:"+a+"]",i[2].end="[:";for(var s=0;s<3;s++)if(!1!==(o=d.strpos(t,i[s].start))){o+=i[s].start.length,t=!1===(n=d.strpos(t,i[s].end,o))?t.substr(o):t.substr(o,n-o),l=!0;break}return l||("RETURN_EMPTY"==e?a==WPGlobusCoreData.default_language&&!/(\{:|\[:|<!--:)[a-z]{2}/.test(t)||(t=""):a==WPGlobusCoreData.default_language?/(\{:|\[:|<!--:)[a-z]{2}/.test(t)&&(t=""):t=d.TextFilter(t,WPGlobusCoreData.default_language)),t},addLocaleMarks:function(t,a){return WPGlobusCoreData.locale_tag_start.replace("%s",a)+t+WPGlobusCoreData.locale_tag_end},getTranslations:function(e){var o,n={};return i.each(WPGlobusCoreData.enabled_languages,function(t,a){o=a==WPGlobusCoreData.default_language?"RETURN_IN_DEFAULT_LANGUAGE":"RETURN_EMPTY",n[a]=d.TextFilter(e,a,o)}),n},getString:function(t,a,e){if(void 0===t)return t;void 0===a&&(a=""),void 0===e&&(e=WPGlobusCoreData.language),(t=d.getTranslations(t))[e]=a;var o="";return i.each(t,function(t,a){""!=a&&t!=WPGlobusCoreData.default_language&&(o+=d.addLocaleMarks(a,t))}),""!=t[WPGlobusCoreData.default_language]&&(o=""==o?t[WPGlobusCoreData.default_language]:d.addLocaleMarks(t[WPGlobusCoreData.default_language],WPGlobusCoreData.default_language)+o),o}}}(jQuery),function(m){var v=WPGlobusDialogApp={option:{listenClass:".wpglobus_dialog_start",settingsClass:".wpglobus_dialog_settings",dialogTabs:"#wpglobus-dialog-tabs",dialogTitle:"",customData:null,callback:function(){},dialogOptions:{title:"",placeholder:"",formFooter:"",beforeOpen:function(){},afterOpen:function(){},afterSave:function(){},close:function(){}},dialog:{}},form:void 0,element:void 0,element_by:"id",id:"",clone_id:"",wpglobus_id:"",type:"textarea",source:"",order:{},value:{},request:"core",attrs:{},dialogTitle:"",trClass:"wpglobus-translatable",startButton:['<span id="wpglobus-dialog-start-{{clone_id}}" ','style="{{style}}" ','data-type="control" data-dialog-title="{{title}}" ','data-source-type="" data-source-id="{{id}}" data-source-name="{{name}}" ','data-nodename="{{nodename}}"',"{{sbTitle}} ",'class="{{classes}}"></span>'].join(""),startButtonClass:"wpglobus_dialog_start wpglobus_dialog_icon",clicks:0,init:function(t){v.option.dialog=v.option.dialogOptions,v.option=m.extend(v.option,t),m(v.option.dialogTabs).tabs(),v.dialogTitle=v.option.dialogTitle,this.attachListener(),null!=v.option.customData&&void 0!==v.option.customData.addElements&&m.each(v.option.customData.addElements,function(t,a){v.addElement(a)})},convertToId:function(t){return t=(t=t.replace(/\]/g,"")).replace(/\[/g,"-")},addElement:function(t){var a={id:null,style:"",styleTextareaWrapper:"",sbTitle:"",onChangeClass:"",dialogTitle:"",dialog:v.option.dialogOptions};if("string"==typeof t)a.id=t;else{if("object"!=typeof t)return;a=m.extend(a,t)}var e,o,n,i=null,l=null,s=null,d=null,u=v.startButton,r="";if(v.element_by="name",0==(d=document.getElementsByName(a.id)).length&&(v.element_by="id",d=document.getElementById(a.id)),null!==d){if(l=a.id,s=void 0===(i="id"==v.element_by?m("#"+l):(r=(r=d[0].nodeName).toLowerCase(),m(r+'[name="'+l+'"]'))).attr("name")||""==i.attr("name")?l:i.attr("name"),v.clone_id=v.convertToId(l),-1!=s.indexOf("wpglobus")||-1!=v.clone_id.indexOf("wpglobus"))return!1;if(0<m("#wpglobus-"+v.clone_id).length)return!1;e=m(i.clone()),n=i.attr("style")||"",i.attr("style","display:none;"),e.attr("id","wpglobus-"+v.clone_id).attr("name","wpglobus-"+s),e.addClass(v.trClass),""!=a.onChangeClass&&e.addClass(a.onChangeClass),"id"==v.element_by?e.attr("data-source-id",l).attr("data-source-name","").attr("data-source-get-by",v.element_by):e.attr("data-source-id","").attr("data-source-name",s).attr("data-source-get-by",v.element_by),"textarea"==r?(o=WPGlobusCore.getTranslations(i.val())[WPGlobusCoreData.language],e.val(o),e.attr("data-nodename","textarea"),""==a.style?e.attr("style",n+";width:95%;float:left;"):e.attr("style",n+";"+a.style)):(o=WPGlobusCore.getTranslations(i.val())[WPGlobusCoreData.language],e.val(o),e.attr("data-nodename","input"),""!=a.style&&e.attr("style",n+";"+a.style)),""!=a.dialog&&e.attr("data-dialog",JSON.stringify(a.dialog)),u=u.replace(/{{clone_id}}/g,v.clone_id),u="id"==v.element_by?(u=(u=u.replace(/{{id}}/g,v.clone_id)).replace(/{{name}}/g,"")).replace(/{{nodename}}/g,""):(u=(u=u.replace(/{{id}}/g,"")).replace(/{{name}}/g,s)).replace(/{{nodename}}/g,r),u="textarea"==r?u.replace("{{style}}","float:left;margin-top:0;"):u.replace("{{style}}","");var c="textarea"==r?v.startButtonClass+" wpglobus-textarea wpglobus-textarea-"+v.clone_id:v.startButtonClass,u=u.replace("{{classes}}",c);u=""==a.dialogTitle?u.replace("{{title}}",v.dialogTitle):u.replace("{{title}}",a.dialogTitle),u=""==a.sbTitle?u.replace("{{sbTitle}}",a.sbTitle):u.replace("{{sbTitle}}",'title="'+a.sbTitle+'"'),m(u).insertAfter(i),m(e).insertAfter(i),"textarea"==r&&(m("#wpglobus-"+v.clone_id).addClass("wpglobus-textarea-"+v.clone_id),m(".wpglobus-textarea-"+v.clone_id).wrapAll('<div class="wpglobus-textarea-wrapper" style="'+a.styleTextareaWrapper+'"></div>'));var g,b,p=!1;return(""==a.onChangeClass?g="#wpglobus-"+v.clone_id:(g="."+a.onChangeClass,void 0===(b=m._data(m(document)[0],"events"))?p=!0:void 0!==b.change&&m.each(b.change,function(t,a){if(a.selector==g)return!(p=!0)})),p)?!0:(m(document).on("change",g,function(){var t=m(this),a=""==(a=t.data("source-id"))?t.data("nodename")+'[name="'+t.data("source-name")+'"]':"#"+a;m(a).val(WPGlobusCore.getString(m(a).val(),t.val()))}),!0)}},saveDialog:function(){var e,o,n,i="",l="",s="";m(".wpglobus_dialog_textarea").each(function(t,a){e=m(a),o=e.val(),(n=e.data("language"))==WPGlobusAdmin.data.language&&(s=o),""!=o&&(i+=WPGlobusCore.addLocaleMarks(o,n),n==WPGlobusCoreData.default_language&&(l=o))}),i=i.length==l.length+8?l:i,m(v.id).val(i),i=""==s?l:s,m(v.wpglobus_id).val(i),v.runCallback(v.option.dialog.afterSave)},dialog:m("#wpglobus-dialog-wrapper").dialog({autoOpen:!1,width:650,modal:!0,dialogClass:"wpglobus-dialog",buttons:[{text:"Save",class:"wpglobus-button-save",click:function(){v.saveDialog(),v.dialog.dialog("close")}},{text:"Cancel",class:"wpglobus-button-cancel",click:function(){v.dialog.dialog("close")}}],open:function(t,a){var e=v.dialogTitle;void 0!==v.attrs.maxlength&&(m(".wpglobus_dialog_textarea").attr("maxlength",v.attrs.maxlength),e+=" | maxlength="+v.attrs.maxlength),m(".wpglobus-dialog .ui-dialog-title").text(e),m(this).removeClass("hidden")},close:function(){m(this).addClass("hidden"),v.runCallback(v.option.dialog.close),v.form[0].reset()}}),attachListener:function(){m(document).on("click",v.option.settingsClass,function(){m(".wpglobus_dialog_options_wrapper").hasClass("hidden")?m(".wpglobus_dialog_options_wrapper").removeClass("hidden"):m(".wpglobus_dialog_options_wrapper").addClass("hidden")}),m(document).on("click",".wpglobus_dialog_option",function(t){var a=m(this),e=a.data("object");v.order.action="save_post_meta_settings",v.order.post_type=WPGlobusAdmin.data.post_type,v.order.checked=a.prop("checked"),v.order.id=a.attr("id"),v.order.meta_key=a.data("meta-key"),v.ajax(v.order).done(function(t){"ok"==t.result&&("true"==t.checked?m(e).removeClass("wpglobus_dialog_start_hidden"):m(e).addClass("wpglobus_dialog_start_hidden"))}).fail(function(t){}).always(function(t,a){})}),m(document).on("click",v.option.listenClass,function(a){v.element=m(this),v.id=v.element.data("source-id"),""==v.id?(v.id=v.element.data("nodename")+'[name="'+v.element.data("source-name")+'"]',v.wpglobus_id="#wpglobus-"+v.convertToId(v.element.data("source-name"))):(v.wpglobus_id="#wpglobus-"+v.id,v.id="#"+v.id),v.clicks++,1==v.clicks&&setTimeout(function(){var t;1==v.clicks?v.onClick(a):(t=m(v.id)).hasClass("hidden")?t.removeClass("hidden").attr("style","display:block;"):t.addClass("hidden").attr("style","display:none;"),v.clicks=0},200)}),v.form=v.dialog.find("form#wpglobus-dialog-form").on("submit",function(t){t.preventDefault(),v.saveDialog()})},ajax:function(t){return m.ajax({type:"POST",url:WPGlobusAdmin.ajaxurl,data:{action:WPGlobusAdmin.process_ajax,order:t},dataType:"json",async:!1})},onClick:function(t){void 0===v.element.data("dialog-title")||""==v.element.data("dialog-title")?v.dialogTitle=v.option.dialogTitle:v.dialogTitle=v.element.data("dialog-title"),void 0!==v.id&&(v.attrs.maxlength=m(v.id).attr("maxlength")),v.source=v.element.data("source-value"),void 0===v.source&&(v.source=m(v.id).val(),"ajax"==v.request||(v.value=WPGlobusCore.getTranslations(v.source))),v.option.dialog=m.extend({},v.option.dialogOptions,m(v.wpglobus_id).data("dialog")),""!=v.option.dialog.title&&(v.dialogTitle=v.option.dialog.title),m.each(v.value,function(t,a){var e=m("#wpglobus-dialog-"+t);e.val(a),e.attr("placeholder",WPGlobusCore.TextFilter(v.option.dialog.placeholder,t,"RETURN_IN_DEFAULT_LANGUAGE"))}),m("#wpglobus-dialog-form-footer").html(v.option.dialog.formFooter),v.runCallback(v.option.dialog.beforeOpen),v.dialog.dialog("open"),v.runCallback(v.option.dialog.afterOpen)},runCallback:function(t){var a,e;"object"==typeof t?(a=Object.keys(t)[0],e=t[Object.keys(t)[0]],"window"===a?"function"==typeof window[e]&&window[e](t[Object.keys(t)[1]]):"function"==typeof window[a][e]&&window[a][e](t[Object.keys(t)[1]])):"string"==typeof t?"function"==typeof window[t]&&window[t]():"function"==typeof t&&t()}}}(jQuery),jQuery(document).ready(function(){"use strict";var t,c;window.WPGlobusAdminApp=(t=window.WPGlobusAdminApp||{},c=jQuery,t.App=function(t){void 0===window.WPGlobusAdminApp&&(this.config={debug:!1,version:WPGlobusAdmin.version},this.status="ok","undefined"==typeof WPGlobusAdmin?(this.status="error",this.config.debug&&console.log("WPGlobus: error options loading")):this.config.debug&&console.dir(WPGlobusAdmin),this.config.disable_first_language=['<div id="disable_first_language" style="display:block;" class="redux-field-errors notice-red">',"<strong>","<span> </span>",WPGlobusAdmin.i18n.cannot_disable_language,"</strong>","</div>"].join(""),c.extend(this.config,t),"ok"===this.status&&this.init())},t.App.prototype={$document:c(document),init:function(){WPGlobusCoreData.multisite=this.parseBool(WPGlobusCoreData.multisite),this.adminInit(),c("#content").addClass("wpglobus-editor").attr("data-language",WPGlobusAdmin.data.default_language),c("textarea[id^=content_]").each(function(t,a){var e=c(a).attr("id").replace("content_","");c(a).attr("data-language",e)}),"post.php"===WPGlobusAdmin.page?(this.postEdit(),this.set_dialog(),"undefined"!=typeof WPGlobusAioseop&&WPGlobusAioseop.init()):"menu-edit"===WPGlobusAdmin.page?(WPGlobusDialogApp.init({dialogTitle:"Edit description"}),this.navMenus()):"taxonomy-edit"===WPGlobusAdmin.page?WPGlobusAdmin.data.tag_id&&this.taxonomyEdit():"taxonomy-quick-edit"===WPGlobusAdmin.page?this.quickEdit("taxonomy"):"edit.php"===WPGlobusAdmin.page?(this.quickEdit("post"),0<_.size(WPGlobusAdmin.$_get)&&WPGlobusDialogApp.init()):"options-general.php"==WPGlobusAdmin.page?(this.optionsGeneral(),WPGlobusDialogApp.init({customData:WPGlobusCoreData.page_custom_data})):"widgets.php"==WPGlobusAdmin.page?(WPGlobusWidgets.init(),WPGlobusDialogApp.init({dialogTitle:"Edit text"})):"wpglobus_options"==WPGlobusAdmin.page?this.start():"wpglobusAdminCentral"==WPGlobusAdmin.page?this.adminCentral():WPGlobusDialogApp.init({customData:WPGlobusCoreData.page_custom_data})},parseBool:function(t){return!/^(false|0)$/i.test(t)&&!!t},getCurrentTab:function(){return c(".wpglobus-post-body-tabs-list .ui-tabs-active").data("language")},adminInit:function(){var t,a=c(".wpglobus-addons-group a").data("key");void 0!==a&&(0<=window.location.search.indexOf("page=wpglobus_options&tab="+a)?WPGlobusCoreData.multisite?window.location=WPGlobusCoreData.pluginInstallLocation.multisite:window.location=WPGlobusCoreData.pluginInstallLocation.single:(t=c("#toplevel_page_wpglobus_options li").eq(a+1),WPGlobusCoreData.multisite?c(t).find("a").attr("href",WPGlobusCoreData.pluginInstallLocation.multisite).attr("onclick","window.location=jQuery(this).attr('href');return false;"):c(t).find("a").attr("href",WPGlobusCoreData.pluginInstallLocation.single).attr("onclick","window.location=jQuery(this).attr('href');return false;")))},optionsGeneral:function(){var o=c("#blogname"),t=c("body");o.addClass("hidden"),c("#wpglobus-blogname").insertAfter(o).removeClass("hidden"),t.on("blur",".wpglobus-blogname",function(){c(".wpglobus-blogname").each(function(t,a){var e=c(a);o.val(WPGlobusCore.getString(o.val(),e.val(),e.data("language")))})});var n=c("#blogdescription");n.addClass("hidden"),c("#wpglobus-blogdescription").insertAfter(n).removeClass("hidden"),t.on("blur",".wpglobus-blogdesc",function(){c(".wpglobus-blogdesc").each(function(t,a){var e=c(a);n.val(WPGlobusCore.getString(n.val(),e.val(),e.data("language")))})})},quickEdit:function(n){var o,l,i,t;void 0!==WPGlobusAdmin.data.has_items&&WPGlobusAdmin.data.has_items&&(o="",l=0,c(document).ajaxComplete(function(t,a,e){void 0!==e.data&&""!=o&&0<=e.data.indexOf("action=inline-save-tax&")&&(c("#"+o+" a.row-title").text(WPGlobusAdmin.qedit_titles[l][WPGlobusAdmin.data.language].name),c("#"+o+" .description").text(WPGlobusAdmin.qedit_titles[l][WPGlobusAdmin.data.language].description))}),i={},c("#the-list tr").each(function(t,a){var e=c(a),o="post"===n?"post-":"tag-";l=e.attr("id").replace(o,""),i[l]={},"post"===n?i[l].source=e.find(".post_title").text():"taxonomy"===n&&(i[l].source=c("#inline_"+l+" .name").text())}),(t={action:"get_titles"}).type=n,t.taxonomy=void 0!==WPGlobusAdmin.data.taxonomy&&WPGlobusAdmin.data.taxonomy,t.title=i,c.ajax({type:"POST",url:WPGlobusAdmin.ajaxurl,data:{action:WPGlobusAdmin.process_ajax,order:t},dataType:"json"}).done(function(t){WPGlobusAdmin.qedit_titles=t.qedit_titles,c.each(t.bulkedit_post_titles,function(t,a){c("#inline_"+t+" .post_title").text(a[WPGlobusAdmin.data.language].name)})}).fail(function(t){}).always(function(t,a){}),c("body").on("change",".wpglobus-quick-edit-title",function(){var n="",i=[];c(".wpglobus-quick-edit-title").each(function(t,a){var e=c(a),o=e.data("language");""!==e.val()&&(n=WPGlobusCore.getString(n,e.val(),o)),WPGlobusAdmin.qedit_titles[l][o].name=e.val(),i[t]=o});var t=c(document).triggerHandler("wpglobus_get_translations",{string:n,lang:i,id:l});void 0!==t&&(n=t),c("input.ptitle").eq(0).val(n),WPGlobusAdmin.qedit_titles[l].source=n}),void 0!==WPGlobusAdmin.data.tags&&c.each(WPGlobusAdmin.data.tags,function(t,a){WPGlobusAdmin.data.value[a].post_id={}}),c("button.save, input#bulk_edit").on("mouseenter",function(t){void 0!==WPGlobusAdmin.data.tags&&("bulk_edit"==t.currentTarget.id?c("input#bulk_edit").unbind("click"):c("button.save").unbind("click"),c("button.save, input#bulk_edit").on("click",function(a){var t=c.when(),e=(c(this),c.Deferred());e.resolve(function(t){t.next(".spinner").css({visibility:"visible"}),"bulk_edit"!=a.currentTarget.id&&c.ajaxSetup({async:!1});var o,n,i,l=t.parents("tr"),s=l.attr("id").replace("edit-","");c.each(WPGlobusAdmin.data.tags,function(t,a){if(0==(o=l.find("textarea[name='"+WPGlobusAdmin.data.names[a]+"']")).length)return!0;WPGlobusAdmin.data.value[a].post_id[s]=o.val(),n=WPGlobusAdmin.data.value[a].post_id[s].split(","),i=[];for(var e=0;e<n.length;e++)n[e]=n[e].trim(" "),""!=n[e]&&(void 0===WPGlobusAdmin.data.tag[a][n[e]]?i[e]=n[e]:i[e]=WPGlobusAdmin.data.tag[a][n[e]]);o.val(i.join(", "))})}(c(this))),t=t.then(function(){return c.when(e.done())}).then(function(){"bulk_edit"!=a.currentTarget.id&&setTimeout(function(){inlineEditPost.save(l),c.ajaxSetup({async:!0})},50)})}))}),c("#the-list").on("click",".editinline",function(){var t=c(this);if(o=t.parents("tr").attr("id"),"post"===n)l=o.replace("post-","");else{if("taxonomy"!==n)return;l=o.replace("tag-","")}"post"===n&&void 0!==WPGlobusAdmin.data.tags&&c.each(WPGlobusAdmin.data.tags,function(t,a){var e,o;""==WPGlobusAdmin.data.value[a]||void 0!==(e=c("#edit-"+l+' textarea[name="'+WPGlobusAdmin.data.names[a]+'"]').val())&&(o=e.split(","),c.each(o,function(t,a){e=e.replace(a,WPGlobusCore.TextFilter(a,WPGlobusCoreData.language))}),c("#edit-"+l+' textarea[name="'+WPGlobusAdmin.data.names[a]+'"]').val(e))});var a=c("#edit-"+l+" input.ptitle").eq(0),e=a.parents("label");void 0!==WPGlobusAdmin.qedit_titles&&(a.val(WPGlobusAdmin.qedit_titles[l].source),a.addClass("hidden"),c(WPGlobusAdmin.data.template).insertAfter(e),void 0===WPGlobusAdmin.qedit_titles[l]&&(WPGlobusAdmin.qedit_titles[l]={},WPGlobusAdmin.qedit_titles[l].source=c("#"+o+" .name a.row-title").text(),c(WPGlobusAdmin.data.enabled_languages).each(function(t,a){WPGlobusAdmin.qedit_titles[l][a]={},a==WPGlobusAdmin.data.default_language?WPGlobusAdmin.qedit_titles[l][a].name=WPGlobusAdmin.qedit_titles[l].source:WPGlobusAdmin.qedit_titles[l][a].name="",WPGlobusAdmin.qedit_titles[l][a].description=""})),c(".wpglobus-quick-edit-title").each(function(t,a){var e=c(a),o=e.data("language");e.attr("id",o+l),void 0!==WPGlobusAdmin.qedit_titles[l][o]&&(WPGlobusAdmin.qedit_titles[l][o].name=WPGlobusAdmin.qedit_titles[l][o].name.replace(/\\\'/g,"'"),WPGlobusAdmin.qedit_titles[l][o].name=WPGlobusAdmin.qedit_titles[l][o].name.replace(/\\\"/g,'"'),e.val(WPGlobusAdmin.qedit_titles[l][o].name),WPGlobusAdmin.qedit_titles[l].source=WPGlobusCore.getString(WPGlobusAdmin.qedit_titles[l].source,WPGlobusAdmin.qedit_titles[l][o].name,o))}),c("input.ptitle").eq(0).val(WPGlobusAdmin.qedit_titles[l].source))}))},taxonomyEdit:function(){var a=[];a[0]="name",a[1]="description";c.each(WPGlobusCoreData.enabled_languages,function(t,e){c.each(a,function(t,a){!function(t,a){var e=c("#"+t);if(1!=e.length)return;var o=e.clone(),n=e.attr("name"),i="wpglobus-element wpglobus-element_"+t+" wpglobus-element_"+a+" wpglobus-translatable",l=document.getElementById(t);l=l.nodeName,c(o).attr("id",t+"_"+a),c(o).attr("name",n+"_"+a),a!==WPGlobusCoreData.default_language&&(i+=" hidden"),c(o).attr("class",i),c(o).attr("data-save-to",t),c(o).attr("data-language",a),"INPUT"==l?c(o).attr("value",c("#wpglobus-link-tab-"+a).data(t)):"TEXTAREA"==l&&c(o).text(c("#wpglobus-link-tab-"+a).data(t)),e.addClass("hidden"),0==c(".wpglobus-element_"+t).length?c(o).insertAfter(e):c(o).insertAfter(c(".wpglobus-element_"+t).last())}(a,e)})}),c(".wpglobus-taxonomy-tabs").insertAfter("#ajax-response"),c(".wrap").tabs(),c("body").on("click",".wpglobus-taxonomy-tabs li",function(t){var a=c(this).data("language");c(".wpglobus-element").addClass("hidden"),c(".wpglobus-element_"+a).removeClass("hidden"),c(".wpglobus-tax-edit-tab a").removeClass("wpglobus-tab-link-active"),c("#wpglobus-link-tab-"+a+" a").addClass("wpglobus-tab-link-active")}),c(".wpglobus-element").on("change",function(){var n=c(this).data("save-to"),i="";c(".wpglobus-element").each(function(t,a){var e=c(a),o=e.val();e.data("save-to")==n&&""!==o&&(i+=WPGlobusCore.addLocaleMarks(o,e.data("language")))}),c("#"+n).val(i)}),c(WPGlobusAdmin.data.multilingualSlug.title).insertAfter(".term-slug-wrap th label")},navMenus:function(){function e(){n!==c(i).length&&(clearInterval(o),c(i).each(function(t,a){var l,e=c(a);e.hasClass("wpglobus-menu-item")||(l=c(a).attr("id"),c.each(["input.edit-menu-item-title","input.edit-menu-item-attr-title"],function(t,a){var e,o,n=c("#"+l+" "+a),i=c(n);i.hasClass("wpglobus-hidden")||(i.addClass("wpglobus-hidden"),i.css("display","none"),e=i.parent("label"),o=i.parents("p"),c(o).css("height","80px"),c(e).append('<div style="color:#f00;">'+WPGlobusAdmin.i18n.save_nav_menu+"</div>"))}),e.addClass("wpglobus-menu-item"))}))}var o,n,i="#menu-to-edit .menu-item";c.ajaxSetup({beforeSend:function(t,a){void 0!==a.data&&0<=a.data.indexOf("action=add-menu-item")&&(n=c(i).length,o=setInterval(e,500))}}),c(i).each(function(t,a){var e=c(a).attr("id"),u=e.replace("menu-item-","");c.each(["input.edit-menu-item-title","input.edit-menu-item-attr-title"],function(n,i){var l=c("#"+e+" "+i);l.val()!=WPGlobusAdmin.data.items[u][i].source&&l.val(WPGlobusAdmin.data.items[u][i].source);var s=c("#"+e+" "+i).parents("p"),d=0;c.each(WPGlobusAdmin.data.open_languages,function(t,a){var e=l.clone();e.attr("id",l.attr("id")+"-"+a),e.attr("name",l.attr("id")+"-"+a),e.attr("data-language",a),e.attr("data-item-id",u),e.attr("placeholder",WPGlobusAdmin.data.en_language_name[a]);var o=WPGlobusAdmin.data.items[u][a][i].class;0===n&&a===WPGlobusAdmin.data.default_language?e.attr("class",o+" edit-menu-item-title"):e.attr("class",o),""!=WPGlobusAdmin.data.items[u][a][i].caption?e.attr("value",WPGlobusAdmin.data.items[u][a][i].caption):e.attr("value",""),e.css("margin-bottom","0.6em"),c(s).append(e),d=t}),d=40*(d+1),l.css("display","none").attr("class","").addClass("widefat wpglobus-hidden"),c(s).css("height",d+"px").addClass("wpglobus-menu-item-box")}),c(a).addClass("wpglobus-menu-item")}),c(".menus-move-left, .menus-move-right").each(function(t,a){var e,o=c(a),n=(o.parents("li").attr("id").replace("menu-item-",""),o.attr("title"));void 0!==n&&c.each(WPGlobusAdmin.data.post_titles,function(t,a){0<=n.indexOf(t)&&(e=n.replace(t,a),o.attr("title",e),o.text(e))})}),c(".edit-menu-item-title").trigger("change"),wpNavMenu.refreshAdvancedAccessibility(),wpNavMenu.menusChanged=!1,c(".wpglobus-menu-item").on("change",function(){var t,a,e=c(this),o=e.data("item-id");e.hasClass("wpglobus-item-title")&&(t=WPGlobusCore.getString(c("input#edit-menu-item-title-"+o).val(),e.val(),e.data("language")),void 0!==(a=c(document).triggerHandler("wpglobus_get_menu_translations",{string:t,lang:WPGlobusCoreData.open_languages,id:o,type:"input.edit-menu-item-title"}))&&(t=a),c("input#edit-menu-item-title-"+o).val(t)),e.hasClass("wpglobus-item-attr")&&(t=WPGlobusCore.getString(c("input#edit-menu-item-attr-title-"+o).val(),e.val(),e.data("language")),void 0!==(a=c(document).triggerHandler("wpglobus_get_menu_translations",{string:t,lang:WPGlobusCoreData.open_languages,id:o,type:"input.edit-menu-item-attr-title"}))&&(t=a),c("input#edit-menu-item-attr-title-"+o).val(t))});var a=[];setTimeout(function(){c(".edit-menu-item-description").each(function(){var t=c(this).attr("id");a.push(t),WPGlobusDialogApp.addElement(t)}),c(".wpglobus_dialog_start").each(function(){c(this).css({"font-style":"normal"}),c(this).after("<br />")});var t={action:"getNavMenuItemsDescription"};t.menuItems=a,c.ajax({type:"POST",url:WPGlobusAdmin.ajaxurl,data:{action:WPGlobusAdmin.process_ajax,order:t},dataType:"json"}).done(function(t){"object"==typeof t&&c.each(t,function(t,a){""!=a&&(c("#"+t).val(a),c("#wpglobus-"+t).val(WPGlobusCore.TextFilter(a,WPGlobus.language,"RETURN_EMPTY")))})}).fail(function(t){}).always(function(t,a){})},1e3)},postEdit:function(){c(document).on("heartbeat-send",function(t,o){void 0!==o.wp_autosave&&(o.wpglobus_heartbeat="wpglobus",c.each(WPGlobusAdmin.data.open_languages,function(t,a){var e=c("#title_"+a).val()||"";""!=(e=e.trim())&&(o.wp_autosave["post_title_"+a]=e),""!=(e=(e=c("#content_"+a).val()||"").trim())&&(o.wp_autosave["content_"+a]=e)}))});var a,l,s,e="#postdivrich",o=!0,i="#post-body-content";!1===WPGlobusAdmin.data.support.editor&&(o=!(e="#titlediv")),!1===WPGlobusAdmin.data.support.title&&(o=!1),c(i).prepend(c(".wpglobus-post-body-tabs-list")),c.each(WPGlobusAdmin.tabs,function(t,a){"default"===a?(c(e).wrap('<div id="tab-default"></div>'),o&&c(c("#titlediv")).insertBefore(e)):(c(e+"-"+a).wrap('<div id="tab-'+a+'"></div>'),o&&c(c("#titlediv-"+a)).insertBefore(e+"-"+a))}),setTimeout(function(){var u=!1;c(i).addClass("wpglobus-post-body-tabs").tabs({beforeActivate:function(t,a){var e,o,l,s;u||(o=(e=c("#wp-content-editor-container .mce-btn-group").eq(0)).children("div"),0!=e.length&&0!=o.length&&(l=e.attr("style"),s=o.attr("style"),c.each(WPGlobusCoreData.enabled_languages,function(t,a){if(a!=WPGlobusCoreData.default_language){var e=c("#wp-content_"+a+"-editor-container .mce-btn-group").eq(0),o=e.children("div");if(0==e.length||0==o.length)return!0;var n=e.attr("style"),i=o.attr("style");l!=n&&e.attr("style",l),s!=i&&o.attr("style",s)}}),u=!0));var n=a.oldTab[0].id.replace("link-tab-",""),i=a.newTab[0].id.replace("link-tab-","");c(".wpglobus-tab-link").removeClass("wpglobus-tab-link-active"),c("#link-tab-"+i+" .wpglobus-tab-link").addClass("wpglobus-tab-link-active"),"default"==n&&(n=WPGlobusCoreData.default_language),"default"==i&&(i=WPGlobusCoreData.default_language);var d=c(document).triggerHandler("wpglobus_post_body_tabs",[n,i]);return!(!d&&void 0!==d)}})},500),c("#title").val(WPGlobusAdmin.title),c("#content").text(WPGlobusAdmin.content),"undefined"!=typeof WPGlobusVendor&&WPGlobusVendor.vendor.WPSEO&&("undefined"!=typeof wpglobus_wpseo?wpglobus_wpseo():"undefined"!=typeof WPGlobusYoastSeo&&("undefined"!=typeof WPGlobusYoastSeoPremium&&WPGlobusYoastSeoPremium&&"function"==typeof WPGlobusYoastSeoPremium.init&&WPGlobusYoastSeoPremium.init(),"function"==typeof WPGlobusYoastSeo.init&&WPGlobusYoastSeo.init())),WPGlobusAdmin.data.modify_excerpt&&((a=c("#excerpt")).addClass("hidden").css({display:"none"}),c(WPGlobusAdmin.data.template).insertAfter(a),c("body").on("change",".wpglobus-excerpt",function(){var t=c(this);a.val(WPGlobusCore.getString(a.val(),t.val(),t.data("language")))})),void 0!==wp.utils&&void 0!==wp.utils.WordCounter&&(WPGlobusCoreData.wordCounter={},l=this,s={},c.each(WPGlobusCoreData.enabled_languages,function(t,a){return a==WPGlobusCoreData.default_language||(s[t]="content_"+a,n=jQuery,e=new wp.utils.WordCounter,i=a,WPGlobusCoreData.wordCounter[i]={},WPGlobusCoreData.wordCounter[i].counter=e,void n(function(){function o(t){var a,e;"object"==typeof t&&(t="tinymce"==t?l.getCurrentTab():t.target.id.replace("content_","")),void 0!==WPGlobusCoreData.wordCounter[t]&&(a=!WPGlobusCoreData.wordCounter[t].contentEditor||WPGlobusCoreData.wordCounter[t].contentEditor.isHidden()?WPGlobusCoreData.wordCounter[t].content.val():WPGlobusCoreData.wordCounter[t].contentEditor.getContent({format:"raw"}),(e=WPGlobusCoreData.wordCounter[t].counter.count(a))!==WPGlobusCoreData.wordCounter[t].prevCount&&WPGlobusCoreData.wordCounter[t].count.text(e),WPGlobusCoreData.wordCounter[t].prevCount=e)}WPGlobusCoreData.wordCounter[i].content=n("#content_"+i),WPGlobusCoreData.wordCounter[i].count=n("#wp-word-count-"+i).find(".word-count-"+i),WPGlobusCoreData.wordCounter[i].prevCount=0,n(document).on("tinymce-editor-init",function(t,a){var e;-1!=n.inArray(a.id,s)&&(e=a.id.replace("content_",""),(WPGlobusCoreData.wordCounter[e].contentEditor=a).on("nodechange keyup",_.debounce(o,1e3)))}),WPGlobusCoreData.wordCounter[i].content.on("input keyup",_.debounce(o,1e3)),o(i)}));var n,e,i})),c(document).on("click","#publish, #save-post",function(){var e,t,o,n;1<WPGlobusAdmin.data.open_languages.length&&(c(document).triggerHandler("wpglobus_before_save_post",{content_tabs_id:i}),e=c("#title").val(),n=o="",0==e.length&&(t=WPGlobusAdmin.data.open_languages.indexOf(WPGlobusAdmin.data.default_language),WPGlobusAdmin.data.open_languages.splice(t,1),c(WPGlobusAdmin.data.open_languages).each(function(t,a){n=0==t?"":"-",0<(e=c("#title_"+a).val()).length&&(0==o.length&&(n=""),o=o+n+e)})),0<o.length&&c("#title").val(o)),void 0===WPGlobusAdmin.data.tagsdiv||WPGlobusAdmin.data.tagsdiv.length<1||c(WPGlobusAdmin.data.tagsdiv).each(function(t,a){if(0==c("#"+a).length)return!0;var e=a.replace("tagsdiv-","");if("undefined"===e)return!0;if(0==c("#tax-input-"+e).length)return!0;var o,n=[];c("#tagsdiv-"+e+" .tagchecklist li").each(function(t,a){o=(o=c(a).html()).replace(/<button.*<\/button> /,""),void 0===WPGlobusAdmin.data.tag[e][o]?n[t]=o:n[t]=WPGlobusAdmin.data.tag[e][o]}),c("#tax-input-"+e).val(n.join(", "))})}),c(".ui-state-default").on("click",function(){"link-tab-default"===c(this).attr("id")&&(c(window).scrollTop(c(window).scrollTop()+1),c(window).scrollTop(c(window).scrollTop()-1))}),c(document).on("tabsactivate",i,function(t,a){WPGlobusAdmin.currentTab=a.newTab[0].dataset.language}),c("#titlewrap input").addClass("wpglobus-translatable"),c(".title_wpglobus").addClass("wpglobus-translatable"),c(document).triggerHandler("wpglobus_after_post_edit")},adminCentral:function(){c(".wpglobus-admin-central-tab").css({display:"none"}),1<c(".nav-tab-active").length&&c(".wpglobus-about-wrap .nav-tab-wrapper a").removeClass("nav-tab-active");var e=!0;0==location.hash.indexOf("#")&&c(".wpglobus-about-wrap .nav-tab-wrapper a").each(function(t,a){c(a).attr("href")==location.hash&&(e=!1,c(a).addClass("nav-tab-active"))}),e&&c(".wpglobus-about-wrap .nav-tab-wrapper a").eq(0).addClass("nav-tab-active");var t=c(".wpglobus-about-wrap .nav-tab-active").data("tab-id");""!=t&&c("#"+t).css({display:"block"}),c(document).on("click",".wpglobus-about-wrap .nav-tab",function(t){var a=c(this);a.hasClass("nav-tab-active")||(c(".wpglobus-admin-central-tab").css({display:"none"}),c(".wpglobus-about-wrap .nav-tab").removeClass("nav-tab-active"),a.addClass("nav-tab-active"),""!=a.data("tab-id")&&c("#"+a.data("tab-id")).css({display:"block"}))})},start:function(){var a=this;c("#wpglobus_flags").select2({formatResult:this.format,formatSelection:this.format,minimumResultsForSearch:-1,escapeMarkup:function(t){return t}}),c("body").on("click","#enabled_languages-list li:first input",function(t){return t.preventDefault(),c(".redux-save-warn").css({display:"none"}),c("#enabled_languages-list").find("li:first > input").val("1"),0===c("#disable_first_language").length&&c(a.config.disable_first_language).insertAfter("#info_bar"),!1})},format:function(t){return'<img class="wpglobus_flag" src="'+WPGlobusAdmin.flag_url+t.text+'"/> '+t.text},set_dialog:function(){var o,e,n;void 0!==WPGlobusAdmin.data.customFieldsEnabled&&(WPGlobusAdmin.data.customFieldsEnabled=this.parseBool(WPGlobusAdmin.data.customFieldsEnabled),!WPGlobusAdmin.data.customFieldsEnabled)||(void 0===WPGlobusAdmin.data.excludeCustomFields&&(WPGlobusAdmin.data.excludeCustomFields=!1),e=!1,(n=function(t){var s,d,u="wpglobus_dialog_start wpglobus_dialog_icon",r=['<div class="wpglobus_dialog_options_wrapper hidden">','<input style="width:initial;" id="wpglobus-cb-{{id}}" data-object="#wpglobus-dialog-start-{{id}}" data-meta-key="{{meta-key}}" class="wpglobus_dialog_option wpglobus_dialog_cb" type="checkbox" {{checked}} />',"</div>"].join(""),a=void 0===t?"#the-list tr":"#the-list tr#"+t;c(a).each(function(){var t,a,e,o=c(this),n=o.attr("id"),i=o.find("textarea"),l=u;return void 0===(s=i.attr("id"))||(e=c("#"+n+"-key").val(),!(!WPGlobusAdmin.data.excludeCustomFields||-1==c.inArray(e,WPGlobusAdmin.data.excludeCustomFields))||(t=c("#"+s).clone(),c(i).addClass("wpglobus-dialog-field-source hidden"),a=i.attr("name"),c(t).attr("id","wpglobus-"+s),c(t).attr("name","wpglobus-"+a),c(t).attr("data-source-id",s),c(t).attr("class","wpglobus-dialog-field"),c(t).val(WPGlobusCore.TextFilter(c(i).val(),WPGlobusCoreData.language)),c(t).insertAfter(i),d=(d=r.replace(/{{id}}/g,s)).replace(/{{meta-key}}/g,e),void 0===WPGlobusAdmin.data.post_meta_settings[WPGlobusAdmin.data.post_type]?d=d.replace(/{{checked}}/,"checked"):l=void 0!==WPGlobusAdmin.data.post_meta_settings[WPGlobusAdmin.data.post_type][e]&&"false"==WPGlobusAdmin.data.post_meta_settings[WPGlobusAdmin.data.post_type][e]?(d=d.replace(/{{checked}}/,""),u+" wpglobus_dialog_start_hidden"):(d=d.replace(/{{checked}}/,"checked"),u),void o.append('<td style="width:20px;"><div id="wpglobus-dialog-start-'+s+'" data-type="control" data-source-type="textarea" data-source-id="'+s+'" class="'+l+'"></div>'+d+"</td>")))}),!e&&0<c("#list-table .wpglobus_dialog_start").length&&(c("#list-table thead tr").append('<th class="wpglobus-control-head"><div class="wpglobus_dialog_settings wpglobus_dialog_icon"></div></th>'),e=!0)})(),c("body").on("change",".wpglobus-dialog-field",function(){var e,o,n=c(this),t="#"+n.data("source-id"),i="";e=c(t).val(),/(\{:|\[:|<!--:)[a-z]{2}/.test(e)?(c.each(WPGlobusCoreData.enabled_languages,function(t,a){""!=(o=a==WPGlobusCoreData.language?n.val():WPGlobusCore.TextFilter(e,a,"RETURN_EMPTY"))&&(i+=WPGlobusCore.addLocaleMarks(o,a))}),c(t).val(i)):c(t).val(n.val())}),c(document).ajaxSend(function(t,a,e){"add-meta"==e.action&&(o=e.element)}),c(document).ajaxComplete(function(t,a,e){"add-meta"==e.action&&void 0!==a.responseXML&&n("newmeta"==o?"meta-"+c(a.responseXML.documentElement.outerHTML).find("meta").attr("id"):o)}),WPGlobusDialogApp.init({dialogTitle:"Edit meta"}))}},new t.App,t)});
|
1 |
+
var WPGlobusCore,WPGlobusDialogApp;!function(i){var d=WPGlobusCore={strpos:function(t,a,e){e=(t=""+t).indexOf(a,e);return 0<=e&&e},TextFilter:function(t,a,e){if(void 0===t||""===t)return t;var o,n,i=[],l=!1;a=""==a?"en":a,e=void 0===e||""==e?"RETURN_IN_DEFAULT_LANGUAGE":e,i[0]=[],i[0].start=WPGlobusCoreData.locale_tag_start.replace("%s",a),i[0].end=WPGlobusCoreData.locale_tag_end,i[1]=[],i[1].start="\x3c!--:"+a+"--\x3e",i[1].end="\x3c!--:--\x3e",i[2]=[],i[2].start="[:"+a+"]",i[2].end="[:";for(var s=0;s<3;s++)if(!1!==(o=d.strpos(t,i[s].start))){o+=i[s].start.length,t=!1===(n=d.strpos(t,i[s].end,o))?t.substr(o):t.substr(o,n-o),l=!0;break}return l||("RETURN_EMPTY"==e?a==WPGlobusCoreData.default_language&&!/(\{:|\[:|<!--:)[a-z]{2}/.test(t)||(t=""):a==WPGlobusCoreData.default_language?/(\{:|\[:|<!--:)[a-z]{2}/.test(t)&&(t=""):t=d.TextFilter(t,WPGlobusCoreData.default_language)),t},addLocaleMarks:function(t,a){return WPGlobusCoreData.locale_tag_start.replace("%s",a)+t+WPGlobusCoreData.locale_tag_end},getTranslations:function(e){var o,n={};return i.each(WPGlobusCoreData.enabled_languages,function(t,a){o=a==WPGlobusCoreData.default_language?"RETURN_IN_DEFAULT_LANGUAGE":"RETURN_EMPTY",n[a]=d.TextFilter(e,a,o)}),n},getString:function(t,a,e){if(void 0===t)return t;void 0===a&&(a=""),void 0===e&&(e=WPGlobusCoreData.language),(t=d.getTranslations(t))[e]=a;var o="";return i.each(t,function(t,a){""!=a&&t!=WPGlobusCoreData.default_language&&(o+=d.addLocaleMarks(a,t))}),o=""!=t[WPGlobusCoreData.default_language]?""==o?t[WPGlobusCoreData.default_language]:d.addLocaleMarks(t[WPGlobusCoreData.default_language],WPGlobusCoreData.default_language)+o:o}}}(jQuery),function(c){var g=WPGlobusDialogApp={option:{listenClass:".wpglobus_dialog_start",settingsClass:".wpglobus_dialog_settings",dialogTabs:"#wpglobus-dialog-tabs",dialogTitle:"",customData:null,callback:function(){},dialogOptions:{title:"",placeholder:"",formFooter:"",beforeOpen:function(){},afterOpen:function(){},afterSave:function(){},close:function(){}},dialog:{}},form:void 0,element:void 0,element_by:"id",id:"",clone_id:"",wpglobus_id:"",type:"textarea",source:"",order:{},value:{},request:"core",attrs:{},dialogTitle:"",trClass:"wpglobus-translatable",startButton:['<span id="wpglobus-dialog-start-{{clone_id}}" ','style="{{style}}" ','data-type="control" data-dialog-title="{{title}}" ','data-source-type="" data-source-id="{{id}}" data-source-name="{{name}}" ','data-nodename="{{nodename}}"',"{{sbTitle}} ",'class="{{classes}}"></span>'].join(""),startButtonClass:"wpglobus_dialog_start wpglobus_dialog_icon",clicks:0,init:function(t){g.option.dialog=g.option.dialogOptions,g.option=c.extend(g.option,t),c(g.option.dialogTabs).tabs(),g.dialogTitle=g.option.dialogTitle,this.attachListener(),null!=g.option.customData&&void 0!==g.option.customData.addElements&&c.each(g.option.customData.addElements,function(t,a){g.addElement(a)})},convertToId:function(t){return t=(t=t.replace(/\]/g,"")).replace(/\[/g,"-")},addElement:function(t){var a={id:null,style:"",styleTextareaWrapper:"",sbTitle:"",onChangeClass:"",dialogTitle:"",dialog:g.option.dialogOptions};if("string"==typeof t)a.id=t;else{if("object"!=typeof t)return;a=c.extend(a,t)}var e,o=null,n=null,i=null,l=null,s=g.startButton,d="";if(g.element_by="name",0==(l=document.getElementsByName(a.id)).length&&(g.element_by="id",l=document.getElementById(a.id)),null!==l){if(n=a.id,i=void 0===(o="id"==g.element_by?c("#"+n):(d=(d=l[0].nodeName).toLowerCase(),c(d+'[name="'+n+'"]'))).attr("name")||""==o.attr("name")?n:o.attr("name"),g.clone_id=g.convertToId(n),-1!=i.indexOf("wpglobus")||-1!=g.clone_id.indexOf("wpglobus"))return!1;if(0<c("#wpglobus-"+g.clone_id).length)return!1;t=c(o.clone()),l=o.attr("style")||"",o.attr("style","display:none;"),t.attr("id","wpglobus-"+g.clone_id).attr("name","wpglobus-"+i),t.addClass(g.trClass),""!=a.onChangeClass&&t.addClass(a.onChangeClass),("id"==g.element_by?t.attr("data-source-id",n).attr("data-source-name",""):t.attr("data-source-id","").attr("data-source-name",i)).attr("data-source-get-by",g.element_by),"textarea"==d?(e=WPGlobusCore.getTranslations(o.val())[WPGlobusCoreData.language],t.val(e),t.attr("data-nodename","textarea"),""==a.style?t.attr("style",l+";width:95%;float:left;"):t.attr("style",l+";"+a.style)):(e=WPGlobusCore.getTranslations(o.val())[WPGlobusCoreData.language],t.val(e),t.attr("data-nodename","input"),""!=a.style&&t.attr("style",l+";"+a.style)),""!=a.dialog&&t.attr("data-dialog",JSON.stringify(a.dialog)),s=s.replace(/{{clone_id}}/g,g.clone_id),s="id"==g.element_by?(s=(s=s.replace(/{{id}}/g,g.clone_id)).replace(/{{name}}/g,"")).replace(/{{nodename}}/g,""):(s=(s=s.replace(/{{id}}/g,"")).replace(/{{name}}/g,i)).replace(/{{nodename}}/g,d);s="textarea"==d?s.replace("{{style}}","float:left;margin-top:0;"):s.replace("{{style}}",""),i="textarea"==d?g.startButtonClass+" wpglobus-textarea wpglobus-textarea-"+g.clone_id:g.startButtonClass;s=s.replace("{{classes}}",i),s=""==a.dialogTitle?s.replace("{{title}}",g.dialogTitle):s.replace("{{title}}",a.dialogTitle),s=""==a.sbTitle?s.replace("{{sbTitle}}",a.sbTitle):s.replace("{{sbTitle}}",'title="'+a.sbTitle+'"'),c(s).insertAfter(o),c(t).insertAfter(o),"textarea"==d&&(c("#wpglobus-"+g.clone_id).addClass("wpglobus-textarea-"+g.clone_id),c(".wpglobus-textarea-"+g.clone_id).wrapAll('<div class="wpglobus-textarea-wrapper" style="'+a.styleTextareaWrapper+'"></div>'));var u,r=!1;return(""==a.onChangeClass?u="#wpglobus-"+g.clone_id:(u="."+a.onChangeClass,void 0===(a=c._data(c(document)[0],"events"))?r=!0:void 0!==a.change&&c.each(a.change,function(t,a){if(a.selector==u)return!(r=!0)})),r)?!0:(c(document).on("change",u,function(){var t=c(this),a=""==(a=t.data("source-id"))?t.data("nodename")+'[name="'+t.data("source-name")+'"]':"#"+a;c(a).val(WPGlobusCore.getString(c(a).val(),t.val()))}),!0)}},saveDialog:function(){var e,o,n="",i="",l="";c(".wpglobus_dialog_textarea").each(function(t,a){o=c(a),e=o.val(),(o=o.data("language"))==WPGlobusAdmin.data.language&&(l=e),""!=e&&(n+=WPGlobusCore.addLocaleMarks(e,o),o==WPGlobusCoreData.default_language&&(i=e))}),n=n.length==i.length+8?i:n,c(g.id).val(n),n=""==l?i:l,c(g.wpglobus_id).val(n),g.runCallback(g.option.dialog.afterSave)},dialog:c("#wpglobus-dialog-wrapper").dialog({autoOpen:!1,width:650,modal:!0,dialogClass:"wpglobus-dialog",buttons:[{text:"Save",class:"wpglobus-button-save",click:function(){g.saveDialog(),g.dialog.dialog("close")}},{text:"Cancel",class:"wpglobus-button-cancel",click:function(){g.dialog.dialog("close")}}],open:function(t,a){var e=g.dialogTitle;void 0!==g.attrs.maxlength&&(c(".wpglobus_dialog_textarea").attr("maxlength",g.attrs.maxlength),e+=" | maxlength="+g.attrs.maxlength),c(".wpglobus-dialog .ui-dialog-title").text(e),c(this).removeClass("hidden")},close:function(){c(this).addClass("hidden"),g.runCallback(g.option.dialog.close),g.form[0].reset()}}),attachListener:function(){c(document).on("click",g.option.settingsClass,function(){c(".wpglobus_dialog_options_wrapper").hasClass("hidden")?c(".wpglobus_dialog_options_wrapper").removeClass("hidden"):c(".wpglobus_dialog_options_wrapper").addClass("hidden")}),c(document).on("click",".wpglobus_dialog_option",function(t){var a=c(this),e=a.data("object");g.order.action="save_post_meta_settings",g.order.post_type=WPGlobusAdmin.data.post_type,g.order.checked=a.prop("checked"),g.order.id=a.attr("id"),g.order.meta_key=a.data("meta-key"),g.ajax(g.order).done(function(t){"ok"==t.result&&("true"==t.checked?c(e).removeClass("wpglobus_dialog_start_hidden"):c(e).addClass("wpglobus_dialog_start_hidden"))}).fail(function(t){}).always(function(t,a){})}),c(document).on("click",g.option.listenClass,function(a){g.element=c(this),g.id=g.element.data("source-id"),""==g.id?(g.id=g.element.data("nodename")+'[name="'+g.element.data("source-name")+'"]',g.wpglobus_id="#wpglobus-"+g.convertToId(g.element.data("source-name"))):(g.wpglobus_id="#wpglobus-"+g.id,g.id="#"+g.id),g.clicks++,1==g.clicks&&setTimeout(function(){var t;1==g.clicks?g.onClick(a):(t=c(g.id)).hasClass("hidden")?t.removeClass("hidden").attr("style","display:block;"):t.addClass("hidden").attr("style","display:none;"),g.clicks=0},200)}),g.form=g.dialog.find("form#wpglobus-dialog-form").on("submit",function(t){t.preventDefault(),g.saveDialog()})},ajax:function(t){return c.ajax({type:"POST",url:WPGlobusAdmin.ajaxurl,data:{action:WPGlobusAdmin.process_ajax,order:t},dataType:"json",async:!1})},onClick:function(t){void 0===g.element.data("dialog-title")||""==g.element.data("dialog-title")?g.dialogTitle=g.option.dialogTitle:g.dialogTitle=g.element.data("dialog-title"),void 0!==g.id&&(g.attrs.maxlength=c(g.id).attr("maxlength")),g.source=g.element.data("source-value"),void 0===g.source&&(g.source=c(g.id).val(),"ajax"==g.request||(g.value=WPGlobusCore.getTranslations(g.source))),g.option.dialog=c.extend({},g.option.dialogOptions,c(g.wpglobus_id).data("dialog")),""!=g.option.dialog.title&&(g.dialogTitle=g.option.dialog.title),c.each(g.value,function(t,a){var e=c("#wpglobus-dialog-"+t);e.val(a),e.attr("placeholder",WPGlobusCore.TextFilter(g.option.dialog.placeholder,t,"RETURN_IN_DEFAULT_LANGUAGE"))}),c("#wpglobus-dialog-form-footer").html(g.option.dialog.formFooter),g.runCallback(g.option.dialog.beforeOpen),g.dialog.dialog("open"),g.runCallback(g.option.dialog.afterOpen)},runCallback:function(t){var a,e;"object"==typeof t?(a=Object.keys(t)[0],e=t[Object.keys(t)[0]],"window"===a?"function"==typeof window[e]&&window[e](t[Object.keys(t)[1]]):"function"==typeof window[a][e]&&window[a][e](t[Object.keys(t)[1]])):"string"==typeof t?"function"==typeof window[t]&&window[t]():"function"==typeof t&&t()}}}(jQuery),jQuery(document).ready(function(){"use strict";var t,r;window.WPGlobusAdminApp=(t=window.WPGlobusAdminApp||{},r=jQuery,t.App=function(t){void 0===window.WPGlobusAdminApp&&(this.config={debug:!1,version:WPGlobusAdmin.version},this.status="ok","undefined"==typeof WPGlobusAdmin?(this.status="error",this.config.debug&&console.log("WPGlobus: error options loading")):this.config.debug&&console.dir(WPGlobusAdmin),this.config.disable_first_language=['<div id="disable_first_language" style="display:block;" class="redux-field-errors notice-red">',"<strong>","<span> </span>",WPGlobusAdmin.i18n.cannot_disable_language,"</strong>","</div>"].join(""),r.extend(this.config,t),"ok"===this.status&&this.init())},t.App.prototype={$document:r(document),init:function(){WPGlobusCoreData.multisite=this.parseBool(WPGlobusCoreData.multisite),this.adminInit(),r("#content").addClass("wpglobus-editor").attr("data-language",WPGlobusAdmin.data.default_language),r("textarea[id^=content_]").each(function(t,a){var e=r(a).attr("id").replace("content_","");r(a).attr("data-language",e)}),"post.php"===WPGlobusAdmin.page?(this.postEdit(),this.set_dialog(),"undefined"!=typeof WPGlobusAioseop&&WPGlobusAioseop.init()):"menu-edit"===WPGlobusAdmin.page?(WPGlobusDialogApp.init({dialogTitle:"Edit description"}),this.navMenus()):"taxonomy-edit"===WPGlobusAdmin.page?WPGlobusAdmin.data.tag_id&&this.taxonomyEdit():"taxonomy-quick-edit"===WPGlobusAdmin.page?this.quickEdit("taxonomy"):"edit.php"===WPGlobusAdmin.page?(this.quickEdit("post"),0<_.size(WPGlobusAdmin.$_get)&&WPGlobusDialogApp.init()):"options-general.php"==WPGlobusAdmin.page?(this.optionsGeneral(),WPGlobusDialogApp.init({customData:WPGlobusCoreData.page_custom_data})):"widgets.php"==WPGlobusAdmin.page?(WPGlobusWidgets.init(),WPGlobusDialogApp.init({dialogTitle:"Edit text"})):"wpglobus_options"==WPGlobusAdmin.page?this.start():"wpglobusAdminCentral"==WPGlobusAdmin.page?this.adminCentral():WPGlobusDialogApp.init({customData:WPGlobusCoreData.page_custom_data})},parseBool:function(t){return!/^(false|0)$/i.test(t)&&!!t},getCurrentTab:function(){return r(".wpglobus-post-body-tabs-list .ui-tabs-active").data("language")},adminInit:function(){var t=r(".wpglobus-addons-group a").data("key");void 0!==t&&(0<=window.location.search.indexOf("page=wpglobus_options&tab="+t)?WPGlobusCoreData.multisite?window.location=WPGlobusCoreData.pluginInstallLocation.multisite:window.location=WPGlobusCoreData.pluginInstallLocation.single:(t=r("#toplevel_page_wpglobus_options li").eq(t+1),(WPGlobusCoreData.multisite?r(t).find("a").attr("href",WPGlobusCoreData.pluginInstallLocation.multisite):r(t).find("a").attr("href",WPGlobusCoreData.pluginInstallLocation.single)).attr("onclick","window.location=jQuery(this).attr('href');return false;")))},optionsGeneral:function(){var e=r("#blogname"),t=r("body");e.addClass("hidden"),r("#wpglobus-blogname").insertAfter(e).removeClass("hidden"),t.on("blur",".wpglobus-blogname",function(){r(".wpglobus-blogname").each(function(t,a){a=r(a);e.val(WPGlobusCore.getString(e.val(),a.val(),a.data("language")))})});var o=r("#blogdescription");o.addClass("hidden"),r("#wpglobus-blogdescription").insertAfter(o).removeClass("hidden"),t.on("blur",".wpglobus-blogdesc",function(){r(".wpglobus-blogdesc").each(function(t,a){a=r(a);o.val(WPGlobusCore.getString(o.val(),a.val(),a.data("language")))})})},quickEdit:function(o){var n,i,l,t;void 0!==WPGlobusAdmin.data.has_items&&WPGlobusAdmin.data.has_items&&(n="",i=0,r(document).ajaxComplete(function(t,a,e){void 0!==e.data&&""!=n&&0<=e.data.indexOf("action=inline-save-tax&")&&(r("#"+n+" a.row-title").text(WPGlobusAdmin.qedit_titles[i][WPGlobusAdmin.data.language].name),r("#"+n+" .description").text(WPGlobusAdmin.qedit_titles[i][WPGlobusAdmin.data.language].description))}),l={},r("#the-list tr").each(function(t,a){var e=r(a),a="post"===o?"post-":"tag-";i=e.attr("id").replace(a,""),l[i]={},"post"===o?l[i].source=e.find(".post_title").text():"taxonomy"===o&&(l[i].source=r("#inline_"+i+" .name").text())}),(t={action:"get_titles"}).type=o,t.taxonomy=void 0!==WPGlobusAdmin.data.taxonomy&&WPGlobusAdmin.data.taxonomy,t.title=l,r.ajax({type:"POST",url:WPGlobusAdmin.ajaxurl,data:{action:WPGlobusAdmin.process_ajax,order:t},dataType:"json"}).done(function(t){WPGlobusAdmin.qedit_titles=t.qedit_titles,r.each(t.bulkedit_post_titles,function(t,a){r("#inline_"+t+" .post_title").text(a[WPGlobusAdmin.data.language].name)})}).fail(function(t){}).always(function(t,a){}),r("body").on("change",".wpglobus-quick-edit-title",function(){var o="",n=[];r(".wpglobus-quick-edit-title").each(function(t,a){var e=r(a),a=e.data("language");""!==e.val()&&(o=WPGlobusCore.getString(o,e.val(),a)),WPGlobusAdmin.qedit_titles[i][a].name=e.val(),n[t]=a});var t=r(document).triggerHandler("wpglobus_get_translations",{string:o,lang:n,id:i});void 0!==t&&(o=t),r("input.ptitle").eq(0).val(o),WPGlobusAdmin.qedit_titles[i].source=o}),void 0!==WPGlobusAdmin.data.tags&&r.each(WPGlobusAdmin.data.tags,function(t,a){WPGlobusAdmin.data.value[a].post_id={}}),r("button.save, input#bulk_edit").on("mouseenter",function(t){void 0!==WPGlobusAdmin.data.tags&&(("bulk_edit"==t.currentTarget.id?r("input#bulk_edit"):r("button.save")).unbind("click"),r("button.save, input#bulk_edit").on("click",function(a){var t=r.when(),e=(r(this),r.Deferred());e.resolve(function(t){t.next(".spinner").css({visibility:"visible"}),"bulk_edit"!=a.currentTarget.id&&r.ajaxSetup({async:!1});var o,n,i,l=t.parents("tr"),s=l.attr("id").replace("edit-","");r.each(WPGlobusAdmin.data.tags,function(t,a){if(0==(o=l.find("textarea[name='"+WPGlobusAdmin.data.names[a]+"']")).length)return!0;WPGlobusAdmin.data.value[a].post_id[s]=o.val(),n=WPGlobusAdmin.data.value[a].post_id[s].split(","),i=[];for(var e=0;e<n.length;e++)n[e]=n[e].trim(" "),""!=n[e]&&(void 0===WPGlobusAdmin.data.tag[a][n[e]]?i[e]=n[e]:i[e]=WPGlobusAdmin.data.tag[a][n[e]]);o.val(i.join(", "))})}(r(this))),t=t.then(function(){return r.when(e.done())}).then(function(){"bulk_edit"!=a.currentTarget.id&&setTimeout(function(){inlineEditPost.save(i),r.ajaxSetup({async:!0})},50)})}))}),r("#the-list").on("click",".editinline",function(){var t=r(this);if(n=t.parents("tr").attr("id"),"post"===o)i=n.replace("post-","");else{if("taxonomy"!==o)return;i=n.replace("tag-","")}"post"===o&&void 0!==WPGlobusAdmin.data.tags&&r.each(WPGlobusAdmin.data.tags,function(t,a){var e,o;""==WPGlobusAdmin.data.value[a]||void 0!==(e=r("#edit-"+i+' textarea[name="'+WPGlobusAdmin.data.names[a]+'"]').val())&&(o=e.split(","),r.each(o,function(t,a){e=e.replace(a,WPGlobusCore.TextFilter(a,WPGlobusCoreData.language))}),r("#edit-"+i+' textarea[name="'+WPGlobusAdmin.data.names[a]+'"]').val(e))});var a=r("#edit-"+i+" input.ptitle").eq(0),t=a.parents("label");void 0!==WPGlobusAdmin.qedit_titles&&(a.val(WPGlobusAdmin.qedit_titles[i].source),a.addClass("hidden"),r(WPGlobusAdmin.data.template).insertAfter(t),void 0===WPGlobusAdmin.qedit_titles[i]&&(WPGlobusAdmin.qedit_titles[i]={},WPGlobusAdmin.qedit_titles[i].source=r("#"+n+" .name a.row-title").text(),r(WPGlobusAdmin.data.enabled_languages).each(function(t,a){WPGlobusAdmin.qedit_titles[i][a]={},a==WPGlobusAdmin.data.default_language?WPGlobusAdmin.qedit_titles[i][a].name=WPGlobusAdmin.qedit_titles[i].source:WPGlobusAdmin.qedit_titles[i][a].name="",WPGlobusAdmin.qedit_titles[i][a].description=""})),r(".wpglobus-quick-edit-title").each(function(t,a){var e=r(a),a=e.data("language");e.attr("id",a+i),void 0!==WPGlobusAdmin.qedit_titles[i][a]&&(WPGlobusAdmin.qedit_titles[i][a].name=WPGlobusAdmin.qedit_titles[i][a].name.replace(/\\\'/g,"'"),WPGlobusAdmin.qedit_titles[i][a].name=WPGlobusAdmin.qedit_titles[i][a].name.replace(/\\\"/g,'"'),e.val(WPGlobusAdmin.qedit_titles[i][a].name),WPGlobusAdmin.qedit_titles[i].source=WPGlobusCore.getString(WPGlobusAdmin.qedit_titles[i].source,WPGlobusAdmin.qedit_titles[i][a].name,a))}),r("input.ptitle").eq(0).val(WPGlobusAdmin.qedit_titles[i].source))}))},taxonomyEdit:function(){var a=[];a[0]="name",a[1]="description";r.each(WPGlobusCoreData.enabled_languages,function(t,e){r.each(a,function(t,a){!function(t,a){var e=r("#"+t);if(1!=e.length)return;var o=e.clone(),n=e.attr("name"),i="wpglobus-element wpglobus-element_"+t+" wpglobus-element_"+a+" wpglobus-translatable",l=document.getElementById(t);l=l.nodeName,r(o).attr("id",t+"_"+a),r(o).attr("name",n+"_"+a),a!==WPGlobusCoreData.default_language&&(i+=" hidden"),r(o).attr("class",i),r(o).attr("data-save-to",t),r(o).attr("data-language",a),"INPUT"==l?r(o).attr("value",r("#wpglobus-link-tab-"+a).data(t)):"TEXTAREA"==l&&r(o).text(r("#wpglobus-link-tab-"+a).data(t)),e.addClass("hidden"),0==r(".wpglobus-element_"+t).length?r(o).insertAfter(e):r(o).insertAfter(r(".wpglobus-element_"+t).last())}(a,e)})}),r(".wpglobus-taxonomy-tabs").insertAfter("#ajax-response"),r(".wrap").tabs(),r("body").on("click",".wpglobus-taxonomy-tabs li",function(t){var a=r(this).data("language");r(".wpglobus-element").addClass("hidden"),r(".wpglobus-element_"+a).removeClass("hidden"),r(".wpglobus-tax-edit-tab a").removeClass("wpglobus-tab-link-active"),r("#wpglobus-link-tab-"+a+" a").addClass("wpglobus-tab-link-active")}),r(".wpglobus-element").on("change",function(){var o=r(this).data("save-to"),n="";r(".wpglobus-element").each(function(t,a){var e=r(a),a=e.val();e.data("save-to")==o&&""!==a&&(n+=WPGlobusCore.addLocaleMarks(a,e.data("language")))}),r("#"+o).val(n)}),r(WPGlobusAdmin.data.multilingualSlug.title).insertAfter(".term-slug-wrap th label")},navMenus:function(){function e(){n!==r(i).length&&(clearInterval(o),r(i).each(function(t,a){var o,e=r(a);e.hasClass("wpglobus-menu-item")||(o=r(a).attr("id"),r.each(["input.edit-menu-item-title","input.edit-menu-item-attr-title"],function(t,a){var e=r("#"+o+" "+a),a=r(e);a.hasClass("wpglobus-hidden")||(a.addClass("wpglobus-hidden"),a.css("display","none"),e=a.parent("label"),a=a.parents("p"),r(a).css("height","80px"),r(e).append('<div style="color:#f00;">'+WPGlobusAdmin.i18n.save_nav_menu+"</div>"))}),e.addClass("wpglobus-menu-item"))}))}var o,n,i="#menu-to-edit .menu-item";r.ajaxSetup({beforeSend:function(t,a){void 0!==a.data&&0<=a.data.indexOf("action=add-menu-item")&&(n=r(i).length,o=setInterval(e,500))}}),r(i).each(function(t,a){var e=r(a).attr("id"),u=e.replace("menu-item-","");r.each(["input.edit-menu-item-title","input.edit-menu-item-attr-title"],function(n,i){var l=r("#"+e+" "+i);l.val()!=WPGlobusAdmin.data.items[u][i].source&&l.val(WPGlobusAdmin.data.items[u][i].source);var s=r("#"+e+" "+i).parents("p"),d=0;r.each(WPGlobusAdmin.data.open_languages,function(t,a){var e=l.clone();e.attr("id",l.attr("id")+"-"+a),e.attr("name",l.attr("id")+"-"+a),e.attr("data-language",a),e.attr("data-item-id",u),e.attr("placeholder",WPGlobusAdmin.data.en_language_name[a]);var o=WPGlobusAdmin.data.items[u][a][i].class;0===n&&a===WPGlobusAdmin.data.default_language?e.attr("class",o+" edit-menu-item-title"):e.attr("class",o),""!=WPGlobusAdmin.data.items[u][a][i].caption?e.attr("value",WPGlobusAdmin.data.items[u][a][i].caption):e.attr("value",""),e.css("margin-bottom","0.6em"),r(s).append(e),d=t}),d=40*(d+1),l.css("display","none").attr("class","").addClass("widefat wpglobus-hidden"),r(s).css("height",d+"px").addClass("wpglobus-menu-item-box")}),r(a).addClass("wpglobus-menu-item")}),r(".menus-move-left, .menus-move-right").each(function(t,a){var e,o=r(a),n=(o.parents("li").attr("id").replace("menu-item-",""),o.attr("title"));void 0!==n&&r.each(WPGlobusAdmin.data.post_titles,function(t,a){0<=n.indexOf(t)&&(e=n.replace(t,a),o.attr("title",e),o.text(e))})}),r(".edit-menu-item-title").trigger("change"),wpNavMenu.refreshAdvancedAccessibility(),wpNavMenu.menusChanged=!1,r(".wpglobus-menu-item").on("change",function(){var t,a,e=r(this),o=e.data("item-id");e.hasClass("wpglobus-item-title")&&(t=WPGlobusCore.getString(r("input#edit-menu-item-title-"+o).val(),e.val(),e.data("language")),void 0!==(a=r(document).triggerHandler("wpglobus_get_menu_translations",{string:t,lang:WPGlobusCoreData.open_languages,id:o,type:"input.edit-menu-item-title"}))&&(t=a),r("input#edit-menu-item-title-"+o).val(t)),e.hasClass("wpglobus-item-attr")&&(t=WPGlobusCore.getString(r("input#edit-menu-item-attr-title-"+o).val(),e.val(),e.data("language")),void 0!==(a=r(document).triggerHandler("wpglobus_get_menu_translations",{string:t,lang:WPGlobusCoreData.open_languages,id:o,type:"input.edit-menu-item-attr-title"}))&&(t=a),r("input#edit-menu-item-attr-title-"+o).val(t))});var a=[];setTimeout(function(){r(".edit-menu-item-description").each(function(){var t=r(this).attr("id");a.push(t),WPGlobusDialogApp.addElement(t)}),r(".wpglobus_dialog_start").each(function(){r(this).css({"font-style":"normal"}),r(this).after("<br />")});var t={action:"getNavMenuItemsDescription"};t.menuItems=a,r.ajax({type:"POST",url:WPGlobusAdmin.ajaxurl,data:{action:WPGlobusAdmin.process_ajax,order:t},dataType:"json"}).done(function(t){"object"==typeof t&&r.each(t,function(t,a){""!=a&&(r("#"+t).val(a),r("#wpglobus-"+t).val(WPGlobusCore.TextFilter(a,WPGlobus.language,"RETURN_EMPTY")))})}).fail(function(t){}).always(function(t,a){})},1e3)},postEdit:function(){r(document).on("heartbeat-send",function(t,o){void 0!==o.wp_autosave&&(o.wpglobus_heartbeat="wpglobus",r.each(WPGlobusAdmin.data.open_languages,function(t,a){var e=r("#title_"+a).val()||"";""!=(e=e.trim())&&(o.wp_autosave["post_title_"+a]=e),""!=(e=(e=r("#content_"+a).val()||"").trim())&&(o.wp_autosave["content_"+a]=e)}))});var a,i,l,e="#postdivrich",o=!0,s="#post-body-content";!1===WPGlobusAdmin.data.support.editor&&(o=!(e="#titlediv")),!1===WPGlobusAdmin.data.support.title&&(o=!1),r(s).prepend(r(".wpglobus-post-body-tabs-list")),r.each(WPGlobusAdmin.tabs,function(t,a){"default"===a?(r(e).wrap('<div id="tab-default"></div>'),o&&r(r("#titlediv")).insertBefore(e)):(r(e+"-"+a).wrap('<div id="tab-'+a+'"></div>'),o&&r(r("#titlediv-"+a)).insertBefore(e+"-"+a))}),setTimeout(function(){var n=!1;r(s).addClass("wpglobus-post-body-tabs").tabs({beforeActivate:function(t,a){var e,i,l;n||(o=(e=r("#wp-content-editor-container .mce-btn-group").eq(0)).children("div"),0!=e.length&&0!=o.length&&(i=e.attr("style"),l=o.attr("style"),r.each(WPGlobusCoreData.enabled_languages,function(t,a){if(a!=WPGlobusCoreData.default_language){var e=r("#wp-content_"+a+"-editor-container .mce-btn-group").eq(0),o=e.children("div");if(0==e.length||0==o.length)return!0;var n=e.attr("style"),a=o.attr("style");i!=n&&e.attr("style",i),l!=a&&o.attr("style",l)}}),n=!0));var o=a.oldTab[0].id.replace("link-tab-",""),a=a.newTab[0].id.replace("link-tab-","");r(".wpglobus-tab-link").removeClass("wpglobus-tab-link-active"),r("#link-tab-"+a+" .wpglobus-tab-link").addClass("wpglobus-tab-link-active"),"default"==o&&(o=WPGlobusCoreData.default_language),"default"==a&&(a=WPGlobusCoreData.default_language);a=r(document).triggerHandler("wpglobus_post_body_tabs",[o,a]);return!(!a&&void 0!==a)}})},500),r("#title").val(WPGlobusAdmin.title),r("#content").text(WPGlobusAdmin.content),"undefined"!=typeof WPGlobusVendor&&WPGlobusVendor.vendor.WPSEO&&("undefined"!=typeof wpglobus_wpseo?wpglobus_wpseo():"undefined"!=typeof WPGlobusYoastSeo&&("undefined"!=typeof WPGlobusYoastSeoPremium&&WPGlobusYoastSeoPremium&&"function"==typeof WPGlobusYoastSeoPremium.init&&WPGlobusYoastSeoPremium.init(),"function"==typeof WPGlobusYoastSeo.init&&WPGlobusYoastSeo.init())),WPGlobusAdmin.data.modify_excerpt&&((a=r("#excerpt")).addClass("hidden").css({display:"none"}),r(WPGlobusAdmin.data.template).insertAfter(a),r("body").on("change",".wpglobus-excerpt",function(){var t=r(this);a.val(WPGlobusCore.getString(a.val(),t.val(),t.data("language")))})),void 0!==wp.utils&&void 0!==wp.utils.WordCounter&&(WPGlobusCoreData.wordCounter={},i=this,l={},r.each(WPGlobusCoreData.enabled_languages,function(t,a){return a==WPGlobusCoreData.default_language||(l[t]="content_"+a,n=jQuery,t=new wp.utils.WordCounter,e=a,WPGlobusCoreData.wordCounter[e]={},WPGlobusCoreData.wordCounter[e].counter=t,void n(function(){function o(t){var a;"object"==typeof t&&(t="tinymce"==t?i.getCurrentTab():t.target.id.replace("content_","")),void 0!==WPGlobusCoreData.wordCounter[t]&&(a=!WPGlobusCoreData.wordCounter[t].contentEditor||WPGlobusCoreData.wordCounter[t].contentEditor.isHidden()?WPGlobusCoreData.wordCounter[t].content.val():WPGlobusCoreData.wordCounter[t].contentEditor.getContent({format:"raw"}),(a=WPGlobusCoreData.wordCounter[t].counter.count(a))!==WPGlobusCoreData.wordCounter[t].prevCount&&WPGlobusCoreData.wordCounter[t].count.text(a),WPGlobusCoreData.wordCounter[t].prevCount=a)}WPGlobusCoreData.wordCounter[e].content=n("#content_"+e),WPGlobusCoreData.wordCounter[e].count=n("#wp-word-count-"+e).find(".word-count-"+e),WPGlobusCoreData.wordCounter[e].prevCount=0,n(document).on("tinymce-editor-init",function(t,a){var e;-1!=n.inArray(a.id,l)&&(e=a.id.replace("content_",""),(WPGlobusCoreData.wordCounter[e].contentEditor=a).on("nodechange keyup",_.debounce(o,1e3)))}),WPGlobusCoreData.wordCounter[e].content.on("input keyup",_.debounce(o,1e3)),o(e)}));var n,e})),r(document).on("click","#publish, #save-post",function(){var e,t,o,n;1<WPGlobusAdmin.data.open_languages.length&&(r(document).triggerHandler("wpglobus_before_save_post",{content_tabs_id:s}),e=r("#title").val(),n=o="",0==e.length&&(t=WPGlobusAdmin.data.open_languages.indexOf(WPGlobusAdmin.data.default_language),WPGlobusAdmin.data.open_languages.splice(t,1),r(WPGlobusAdmin.data.open_languages).each(function(t,a){n=0==t?"":"-",0<(e=r("#title_"+a).val()).length&&(0==o.length&&(n=""),o=o+n+e)})),0<o.length&&r("#title").val(o)),void 0===WPGlobusAdmin.data.tagsdiv||WPGlobusAdmin.data.tagsdiv.length<1||r(WPGlobusAdmin.data.tagsdiv).each(function(t,a){if(0==r("#"+a).length)return!0;var e=a.replace("tagsdiv-","");if("undefined"===e)return!0;if(0==r("#tax-input-"+e).length)return!0;var o,n=[];r("#tagsdiv-"+e+" .tagchecklist li").each(function(t,a){o=(o=r(a).html()).replace(/<button.*<\/button> /,""),void 0===WPGlobusAdmin.data.tag[e][o]?n[t]=o:n[t]=WPGlobusAdmin.data.tag[e][o]}),r("#tax-input-"+e).val(n.join(", "))})}),r(".ui-state-default").on("click",function(){"link-tab-default"===r(this).attr("id")&&(r(window).scrollTop(r(window).scrollTop()+1),r(window).scrollTop(r(window).scrollTop()-1))}),r(document).on("tabsactivate",s,function(t,a){WPGlobusAdmin.currentTab=a.newTab[0].dataset.language}),r("#titlewrap input").addClass("wpglobus-translatable"),r(".title_wpglobus").addClass("wpglobus-translatable"),r(document).triggerHandler("wpglobus_after_post_edit")},adminCentral:function(){r(".wpglobus-admin-central-tab").css({display:"none"}),1<r(".nav-tab-active").length&&r(".wpglobus-about-wrap .nav-tab-wrapper a").removeClass("nav-tab-active");var e=!0;0==location.hash.indexOf("#")&&r(".wpglobus-about-wrap .nav-tab-wrapper a").each(function(t,a){r(a).attr("href")==location.hash&&(e=!1,r(a).addClass("nav-tab-active"))}),e&&r(".wpglobus-about-wrap .nav-tab-wrapper a").eq(0).addClass("nav-tab-active");var t=r(".wpglobus-about-wrap .nav-tab-active").data("tab-id");""!=t&&r("#"+t).css({display:"block"}),r(document).on("click",".wpglobus-about-wrap .nav-tab",function(t){var a=r(this);a.hasClass("nav-tab-active")||(r(".wpglobus-admin-central-tab").css({display:"none"}),r(".wpglobus-about-wrap .nav-tab").removeClass("nav-tab-active"),a.addClass("nav-tab-active"),""!=a.data("tab-id")&&r("#"+a.data("tab-id")).css({display:"block"}))})},start:function(){var a=this;r("#wpglobus_flags").select2({formatResult:this.format,formatSelection:this.format,minimumResultsForSearch:-1,escapeMarkup:function(t){return t}}),r("body").on("click","#enabled_languages-list li:first input",function(t){return t.preventDefault(),r(".redux-save-warn").css({display:"none"}),r("#enabled_languages-list").find("li:first > input").val("1"),0===r("#disable_first_language").length&&r(a.config.disable_first_language).insertAfter("#info_bar"),!1})},format:function(t){return'<img class="wpglobus_flag" src="'+WPGlobusAdmin.flag_url+t.text+'"/> '+t.text},set_dialog:function(){var o,a,n;void 0!==WPGlobusAdmin.data.customFieldsEnabled&&(WPGlobusAdmin.data.customFieldsEnabled=this.parseBool(WPGlobusAdmin.data.customFieldsEnabled),!WPGlobusAdmin.data.customFieldsEnabled)||(void 0===WPGlobusAdmin.data.excludeCustomFields&&(WPGlobusAdmin.data.excludeCustomFields=!1),a=!1,(n=function(t){var l,s,d="wpglobus_dialog_start wpglobus_dialog_icon",u=['<div class="wpglobus_dialog_options_wrapper hidden">','<input style="width:initial;" id="wpglobus-cb-{{id}}" data-object="#wpglobus-dialog-start-{{id}}" data-meta-key="{{meta-key}}" class="wpglobus_dialog_option wpglobus_dialog_cb" type="checkbox" {{checked}} />',"</div>"].join(""),t=void 0===t?"#the-list tr":"#the-list tr#"+t;r(t).each(function(){var t,a,e=r(this),o=e.attr("id"),n=e.find("textarea"),i=d;return void 0===(l=n.attr("id"))||(a=r("#"+o+"-key").val(),!(!WPGlobusAdmin.data.excludeCustomFields||-1==r.inArray(a,WPGlobusAdmin.data.excludeCustomFields))||(t=r("#"+l).clone(),r(n).addClass("wpglobus-dialog-field-source hidden"),o=n.attr("name"),r(t).attr("id","wpglobus-"+l),r(t).attr("name","wpglobus-"+o),r(t).attr("data-source-id",l),r(t).attr("class","wpglobus-dialog-field"),r(t).val(WPGlobusCore.TextFilter(r(n).val(),WPGlobusCoreData.language)),r(t).insertAfter(n),s=(s=u.replace(/{{id}}/g,l)).replace(/{{meta-key}}/g,a),void 0===WPGlobusAdmin.data.post_meta_settings[WPGlobusAdmin.data.post_type]?s=s.replace(/{{checked}}/,"checked"):i=void 0!==WPGlobusAdmin.data.post_meta_settings[WPGlobusAdmin.data.post_type][a]&&"false"==WPGlobusAdmin.data.post_meta_settings[WPGlobusAdmin.data.post_type][a]?(s=s.replace(/{{checked}}/,""),d+" wpglobus_dialog_start_hidden"):(s=s.replace(/{{checked}}/,"checked"),d),void e.append('<td style="width:20px;"><div id="wpglobus-dialog-start-'+l+'" data-type="control" data-source-type="textarea" data-source-id="'+l+'" class="'+i+'"></div>'+s+"</td>")))}),!a&&0<r("#list-table .wpglobus_dialog_start").length&&(r("#list-table thead tr").append('<th class="wpglobus-control-head"><div class="wpglobus_dialog_settings wpglobus_dialog_icon"></div></th>'),a=!0)})(),r("body").on("change",".wpglobus-dialog-field",function(){var e,o,n=r(this),t="#"+n.data("source-id"),i="";e=r(t).val(),/(\{:|\[:|<!--:)[a-z]{2}/.test(e)?(r.each(WPGlobusCoreData.enabled_languages,function(t,a){""!=(o=a==WPGlobusCoreData.language?n.val():WPGlobusCore.TextFilter(e,a,"RETURN_EMPTY"))&&(i+=WPGlobusCore.addLocaleMarks(o,a))}),r(t).val(i)):r(t).val(n.val())}),r(document).ajaxSend(function(t,a,e){"add-meta"==e.action&&(o=e.element)}),r(document).ajaxComplete(function(t,a,e){"add-meta"==e.action&&void 0!==a.responseXML&&n("newmeta"==o?"meta-"+r(a.responseXML.documentElement.outerHTML).find("meta").attr("id"):o)}),WPGlobusDialogApp.init({dialogTitle:"Edit meta"}))}},new t.App,t)});
|
includes/js/wpglobus-admin-debug.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(n){"use strict";var e;"undefined"!=typeof WPGlobusAdminDebug&&(e={init:function(e){setTimeout(function(){n('<a name="debug-box"></a>').appendTo("#wpwrap"),n("#wpglobus-admin-debug-box").detach().appendTo("#wpwrap"),n("#wpglobus-admin-debug-box").css({display:"block"})},1e3),setTimeout(function(){var e=0,n=0,u=jQuery("#wpglobus-admin-debug-box .table1");1==u.length&&(e=(n=+u.css("height").replace("px",""))+50);
|
1 |
+
!function(n){"use strict";var e;"undefined"!=typeof WPGlobusAdminDebug&&(e={init:function(e){setTimeout(function(){n('<a name="debug-box"></a>').appendTo("#wpwrap"),n("#wpglobus-admin-debug-box").detach().appendTo("#wpwrap"),n("#wpglobus-admin-debug-box").css({display:"block"})},1e3),setTimeout(function(){var e=0,n=0,u=jQuery("#wpglobus-admin-debug-box .table1");1==u.length&&(e=(n=+u.css("height").replace("px",""))+50);u=jQuery("#wpglobus-admin-debug-box .table2");1==u.length&&(u.css({"margin-top":e+"px"}),e=n+ +u.css("height").replace("px","")+100);u=jQuery("#wpglobus-admin-debug-box .table3");1==u.length&&u.css({"margin-top":e+"px"})},1200)}},(WPGlobusAdminDebug=n.extend({},WPGlobusAdminDebug,e)).init())}(jQuery);
|
includes/js/wpglobus-admin.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var WPGlobusCore,WPGlobusDialogApp;!function(i){var d=WPGlobusCore={strpos:function(t,a,e){var o=(t=""+t).indexOf(a,e);return 0<=o&&o},TextFilter:function(t,a,e){if(void 0===t||""===t)return t;var o,n,i=[],l=!1;a=""==a?"en":a,e=void 0===e||""==e?"RETURN_IN_DEFAULT_LANGUAGE":e,i[0]=[],i[0].start=WPGlobusCoreData.locale_tag_start.replace("%s",a),i[0].end=WPGlobusCoreData.locale_tag_end,i[1]=[],i[1].start="\x3c!--:"+a+"--\x3e",i[1].end="\x3c!--:--\x3e",i[2]=[],i[2].start="[:"+a+"]",i[2].end="[:";for(var s=0;s<3;s++)if(!1!==(o=d.strpos(t,i[s].start))){o+=i[s].start.length,t=!1===(n=d.strpos(t,i[s].end,o))?t.substr(o):t.substr(o,n-o),l=!0;break}return l||("RETURN_EMPTY"==e?a==WPGlobusCoreData.default_language&&!/(\{:|\[:|<!--:)[a-z]{2}/.test(t)||(t=""):a==WPGlobusCoreData.default_language?/(\{:|\[:|<!--:)[a-z]{2}/.test(t)&&(t=""):t=d.TextFilter(t,WPGlobusCoreData.default_language)),t},addLocaleMarks:function(t,a){return WPGlobusCoreData.locale_tag_start.replace("%s",a)+t+WPGlobusCoreData.locale_tag_end},getTranslations:function(e){var o,n={};return i.each(WPGlobusCoreData.enabled_languages,function(t,a){o=a==WPGlobusCoreData.default_language?"RETURN_IN_DEFAULT_LANGUAGE":"RETURN_EMPTY",n[a]=d.TextFilter(e,a,o)}),n},getString:function(t,a,e){if(void 0===t)return t;void 0===a&&(a=""),void 0===e&&(e=WPGlobusCoreData.language),(t=d.getTranslations(t))[e]=a;var o="";return i.each(t,function(t,a){""!=a&&t!=WPGlobusCoreData.default_language&&(o+=d.addLocaleMarks(a,t))}),""!=t[WPGlobusCoreData.default_language]&&(o=""==o?t[WPGlobusCoreData.default_language]:d.addLocaleMarks(t[WPGlobusCoreData.default_language],WPGlobusCoreData.default_language)+o),o}}}(jQuery),function(m){var v=WPGlobusDialogApp={option:{listenClass:".wpglobus_dialog_start",settingsClass:".wpglobus_dialog_settings",dialogTabs:"#wpglobus-dialog-tabs",dialogTitle:"",customData:null,callback:function(){}},form:void 0,element:void 0,element_by:"id",id:"",clone_id:"",wpglobus_id:"",type:"textarea",source:"",order:{},value:{},request:"core",attrs:{},dialogTitle:"",trClass:"wpglobus-translatable",startButton:['<span id="wpglobus-dialog-start-{{clone_id}}" ','style="{{style}}" ','data-type="control" data-dialog-title="{{title}}" ','data-source-type="" data-source-id="{{id}}" data-source-name="{{name}}" ','data-nodename="{{nodename}}"',"{{sbTitle}} ",'class="{{classes}}"></span>'].join(""),startButtonClass:"wpglobus_dialog_start wpglobus_dialog_icon",clicks:0,init:function(t){v.option=m.extend(v.option,t),m(v.option.dialogTabs).tabs(),v.dialogTitle=v.option.dialogTitle,this.attachListener(),null!=v.option.customData&&void 0!==v.option.customData.addElements&&m.each(v.option.customData.addElements,function(t,a){v.addElement(a)})},convertToId:function(t){return t=(t=t.replace(/\]/g,"")).replace(/\[/g,"-")},addElement:function(t){var a={id:null,dialogTitle:"",style:"",styleTextareaWrapper:"",sbTitle:"",onChangeClass:""};if("string"==typeof t)a.id=t;else{if("object"!=typeof t)return;a=m.extend(a,t)}var e,o,n,i,l,s,d,u=null,r=null,c=null,g=null,b=v.startButton,p="";v.element_by="id",null===(g=document.getElementById(a.id))?(v.element_by="name",g=document.getElementsByName(a.id)):p=(p=g.nodeName).toLowerCase(),0!=g.length&&(r=a.id,c="undefined"===(u="id"==v.element_by?m("#"+r):(p=(p=g[0].nodeName).toLowerCase(),m(p+'[name="'+r+'"]'))).attr("name")?r:u.attr("name"),v.clone_id=v.convertToId(r),-1==c.indexOf("wpglobus")&&-1==v.clone_id.indexOf("wpglobus")&&(0<m("#wpglobus-"+v.clone_id).length||0<m(p+'[name="wpglobus-'+c+'"]').length||(e=m(u.clone()),n=u.attr("style")||"",u.attr("style","display:none;"),e.attr("id","wpglobus-"+v.clone_id).attr("name","wpglobus-"+c),e.addClass(v.trClass),""!=a.onChangeClass&&e.addClass(a.onChangeClass),"id"==v.element_by?e.attr("data-source-id",r).attr("data-source-name","").attr("data-source-get-by",v.element_by):e.attr("data-source-id","").attr("data-source-name",c).attr("data-source-get-by",v.element_by),"textarea"==p?(o=WPGlobusCore.getTranslations(u.text())[WPGlobusCoreData.language],e.text(o),e.attr("data-nodename","textarea"),""==a.style?e.attr("style",n+";width:95%;float:left;"):e.attr("style",n+";"+a.style)):(o=WPGlobusCore.getTranslations(u.val())[WPGlobusCoreData.language],e.attr("value",o),e.attr("data-nodename","input"),""!=a.style&&e.attr("style",n+";"+a.style)),b=b.replace(/{{clone_id}}/g,v.clone_id),b="id"==v.element_by?(b=(b=b.replace(/{{id}}/g,v.clone_id)).replace(/{{name}}/g,"")).replace(/{{nodename}}/g,""):(b=(b=b.replace(/{{id}}/g,"")).replace(/{{name}}/g,c)).replace(/{{nodename}}/g,p),b="textarea"==p?b.replace("{{style}}","float:left;margin-top:0;"):b.replace("{{style}}",""),i="textarea"==p?v.startButtonClass+" wpglobus-textarea wpglobus-textarea-"+v.clone_id:v.startButtonClass,b=b.replace("{{classes}}",i),b=""==a.dialogTitle?b.replace("{{title}}",v.dialogTitle):b.replace("{{title}}",a.dialogTitle),b=""==a.sbTitle?b.replace("{{sbTitle}}",a.sbTitle):b.replace("{{sbTitle}}",'title="'+a.sbTitle+'"'),m(b).insertAfter(u),m(e).insertAfter(u),"textarea"==p&&(m("#wpglobus-"+v.clone_id).addClass("wpglobus-textarea-"+v.clone_id),m(".wpglobus-textarea-"+v.clone_id).wrapAll('<div class="wpglobus-textarea-wrapper" style="'+a.styleTextareaWrapper+'"></div>')),s=!1,""==a.onChangeClass?l="#wpglobus-"+v.clone_id:(l="."+a.onChangeClass,void 0===(d=m._data(m(document)[0],"events"))?s=!0:void 0!==d.change&&m.each(d.change,function(t,a){if(a.selector==l)return!(s=!0)})),s||m(document).on("change",l,function(){var t=m(this),a=""==(a=t.data("source-id"))?t.data("nodename")+'[name="'+t.data("source-name")+'"]':"#"+a;m(a).val(WPGlobusCore.getString(m(a).val(),t.val()))}))))},saveDialog:function(){var e,o,n,i="",l="",s="";m(".wpglobus_dialog_textarea").each(function(t,a){e=m(a),o=e.val(),(n=e.data("language"))==WPGlobusAdmin.data.language&&(s=o),""!=o&&(i+=WPGlobusCore.addLocaleMarks(o,n),n==WPGlobusCoreData.default_language&&(l=o))}),i=i.length==l.length+8?l:i,m(v.id).val(i),i=""==s?l:s,m(v.wpglobus_id).val(i)},dialog:m("#wpglobus-dialog-wrapper").dialog({autoOpen:!1,width:650,modal:!0,dialogClass:"wpglobus-dialog",buttons:[{text:"Save",class:"wpglobus-button-save",click:function(){v.saveDialog(),v.dialog.dialog("close")}},{text:"Cancel",class:"wpglobus-button-cancel",click:function(){v.dialog.dialog("close")}}],open:function(){var t=v.dialogTitle;void 0!==v.attrs.maxlength&&(m(".wpglobus_dialog_textarea").attr("maxlength",v.attrs.maxlength),t+=" | maxlength="+v.attrs.maxlength),m(".wpglobus-dialog .ui-dialog-title").text(t)},close:function(){v.form[0].reset()}}),attachListener:function(){m(document).on("click",v.option.settingsClass,function(){m(".wpglobus_dialog_options_wrapper").hasClass("hidden")?m(".wpglobus_dialog_options_wrapper").removeClass("hidden"):m(".wpglobus_dialog_options_wrapper").addClass("hidden")}),m(document).on("click",".wpglobus_dialog_option",function(t){var a=m(this),e=a.data("object");v.order.action="save_post_meta_settings",v.order.post_type=WPGlobusAdmin.data.post_type,v.order.checked=a.prop("checked"),v.order.id=a.attr("id"),v.order.meta_key=a.data("meta-key"),v.ajax(v.order).done(function(t){"ok"==t.result&&("true"==t.checked?m(e).removeClass("wpglobus_dialog_start_hidden"):m(e).addClass("wpglobus_dialog_start_hidden"))}).fail(function(t){}).always(function(t,a){})}),m(document).on("click",v.option.listenClass,function(a){v.element=m(this),v.id=v.element.data("source-id"),""==v.id?(v.id=v.element.data("nodename")+'[name="'+v.element.data("source-name")+'"]',v.wpglobus_id="#wpglobus-"+v.convertToId(v.element.data("source-name"))):(v.wpglobus_id="#wpglobus-"+v.id,v.id="#"+v.id),v.clicks++,1==v.clicks&&setTimeout(function(){var t;1==v.clicks?v.onClick(a):(t=m(v.id)).hasClass("hidden")?t.removeClass("hidden").attr("style","display:block;"):t.addClass("hidden").attr("style","display:none;"),v.clicks=0},200)}),v.form=v.dialog.find("form#wpglobus-dialog-form").on("submit",function(t){t.preventDefault(),v.saveDialog()})},ajax:function(t){return m.ajax({type:"POST",url:WPGlobusAdmin.ajaxurl,data:{action:WPGlobusAdmin.process_ajax,order:t},dataType:"json",async:!1})},onClick:function(t){void 0===v.element.data("dialog-title")||""==v.element.data("dialog-title")?v.dialogTitle=v.option.dialogTitle:v.dialogTitle=v.element.data("dialog-title"),void 0!==v.id&&(v.attrs.maxlength=m(v.id).attr("maxlength")),v.source=v.element.data("source-value"),void 0===v.source&&(v.source=m(v.id).val(),"ajax"==v.request||(v.value=WPGlobusCore.getTranslations(v.source))),m.each(v.value,function(t,a){m("#wpglobus-dialog-"+t).val(a)}),v.dialog.dialog("open")}}}(jQuery),jQuery(document).ready(function(){"use strict";var t,c;window.WPGlobusAdminApp=(t=window.WPGlobusAdminApp||{},c=jQuery,t.App=function(t){void 0===window.WPGlobusAdminApp&&(this.config={debug:!1,version:WPGlobusAdmin.version},this.status="ok","undefined"===WPGlobusAdmin?(this.status="error",this.config.debug&&console.log("Error options loading")):this.config.debug&&console.dir(WPGlobusAdmin),this.config.disable_first_language=['<div id="disable_first_language" style="display:block;" class="redux-field-errors notice-red">',"<strong>","<span> </span>",WPGlobusAdmin.i18n.cannot_disable_language,"</strong>","</div>"].join(""),c.extend(this.config,t),"ok"===this.status&&this.init())},t.App.prototype={$document:c(document),init:function(){WPGlobusCoreData.multisite=this.parseBool(WPGlobusCoreData.multisite),this.admin_init(),c("#content").addClass("wpglobus-editor").attr("data-language",WPGlobusAdmin.data.default_language),c("textarea[id^=content_]").each(function(t,a){var e=c(a).attr("id").replace("content_","");c(a).attr("data-language",e)}),"post.php"===WPGlobusAdmin.page?(this.post_edit(),this.set_dialog(),"undefined"!=typeof WPGlobusAioseop&&WPGlobusAioseop.init()):"menu-edit"===WPGlobusAdmin.page?this.nav_menus():"taxonomy-edit"===WPGlobusAdmin.page?WPGlobusAdmin.data.tag_id&&this.taxonomy_edit():"taxonomy-quick-edit"===WPGlobusAdmin.page?this.quickEdit("taxonomy"):"edit.php"===WPGlobusAdmin.page?this.quickEdit("post"):"options-general.php"==WPGlobusAdmin.page?this.options_general():"widgets.php"==WPGlobusAdmin.page?(WPGlobusWidgets.init(),WPGlobusDialogApp.init({dialogTitle:"Edit text"})):"wpglobus_options"==WPGlobusAdmin.page?this.start():"wpglobusAdminCentral"==WPGlobusAdmin.page?this.adminCentral():WPGlobusDialogApp.init({customData:WPGlobusCoreData.page_custom_data})},parseBool:function(t){return!/^(false|0)$/i.test(t)&&!!t},getCurrentTab:function(){return c(".wpglobus-post-body-tabs-list .ui-tabs-active").data("language")},admin_init:function(){var t,a=c(".wpglobus-addons-group a").data("key");void 0!==a&&(0<=window.location.search.indexOf("page=wpglobus_options&tab="+a)?WPGlobusCoreData.multisite?window.location=WPGlobusCoreData.pluginInstallLocation.multisite:window.location=WPGlobusCoreData.pluginInstallLocation.single:(t=c("#toplevel_page_wpglobus_options li").eq(a+1),WPGlobusCoreData.multisite?c(t).find("a").attr("href",WPGlobusCoreData.pluginInstallLocation.multisite).attr("onclick","window.location=jQuery(this).attr('href');return false;"):c(t).find("a").attr("href",WPGlobusCoreData.pluginInstallLocation.single).attr("onclick","window.location=jQuery(this).attr('href');return false;")))},options_general:function(){var o=c("#blogname"),t=c("body");o.addClass("hidden"),c("#wpglobus-blogname").insertAfter(o).removeClass("hidden"),t.on("blur",".wpglobus-blogname",function(){c(".wpglobus-blogname").each(function(t,a){var e=c(a);o.val(WPGlobusCore.getString(o.val(),e.val(),e.data("language")))})});var n=c("#blogdescription");n.addClass("hidden"),c("#wpglobus-blogdescription").insertAfter(n).removeClass("hidden"),t.on("blur",".wpglobus-blogdesc",function(){c(".wpglobus-blogdesc").each(function(t,a){var e=c(a);n.val(WPGlobusCore.getString(n.val(),e.val(),e.data("language")))})})},quickEdit:function(n){var o,l,i,t;void 0!==WPGlobusAdmin.data.has_items&&WPGlobusAdmin.data.has_items&&(o="",l=0,c(document).ajaxComplete(function(t,a,e){void 0!==e.data&&""!=o&&0<=e.data.indexOf("action=inline-save-tax&")&&(c("#"+o+" a.row-title").text(WPGlobusAdmin.qedit_titles[l][WPGlobusAdmin.data.language].name),c("#"+o+" .description").text(WPGlobusAdmin.qedit_titles[l][WPGlobusAdmin.data.language].description))}),i={},c("#the-list tr").each(function(t,a){var e=c(a),o="post"===n?"post-":"tag-";l=e.attr("id").replace(o,""),i[l]={},"post"===n?i[l].source=e.find(".post_title").text():"taxonomy"===n&&(i[l].source=c("#inline_"+l+" .name").text())}),(t={action:"get_titles"}).type=n,t.taxonomy=void 0!==WPGlobusAdmin.data.taxonomy&&WPGlobusAdmin.data.taxonomy,t.title=i,c.ajax({type:"POST",url:WPGlobusAdmin.ajaxurl,data:{action:WPGlobusAdmin.process_ajax,order:t},dataType:"json"}).done(function(t){WPGlobusAdmin.qedit_titles=t.qedit_titles,c.each(t.bulkedit_post_titles,function(t,a){c("#inline_"+t+" .post_title").text(a[WPGlobusAdmin.data.language].name)})}).fail(function(t){}).always(function(t,a){}),c("body").on("change",".wpglobus-quick-edit-title",function(){var n="",i=[];c(".wpglobus-quick-edit-title").each(function(t,a){var e=c(a),o=e.data("language");""!==e.val()&&(n=WPGlobusCore.getString(n,e.val(),o)),WPGlobusAdmin.qedit_titles[l][o].name=e.val(),i[t]=o});var t=c(document).triggerHandler("wpglobus_get_translations",{string:n,lang:i,id:l});void 0!==t&&(n=t),c("input.ptitle").eq(0).attr("value",n),WPGlobusAdmin.qedit_titles[l].source=n}),void 0!==WPGlobusAdmin.data.tags&&c.each(WPGlobusAdmin.data.tags,function(t,a){WPGlobusAdmin.data.value[a].post_id={}}),c("button.save, input#bulk_edit").on("mouseenter",function(t){void 0!==WPGlobusAdmin.data.tags&&("bulk_edit"==t.currentTarget.id?c("input#bulk_edit").unbind("click"):c("button.save").unbind("click"),c("button.save, input#bulk_edit").on("click",function(a){console.log("Start Updating");var t=c.when(),e=(c(this),c.Deferred());e.resolve(function(t){t.next(".spinner").css({visibility:"visible"}),"bulk_edit"!=a.currentTarget.id&&c.ajaxSetup({async:!1});var o,n,i,l=t.parents("tr"),s=l.attr("id").replace("edit-","");c.each(WPGlobusAdmin.data.tags,function(t,a){if(0==(o=l.find("textarea[name='"+WPGlobusAdmin.data.names[a]+"']")).length)return!0;WPGlobusAdmin.data.value[a].post_id[s]=o.val(),n=WPGlobusAdmin.data.value[a].post_id[s].split(","),i=[];for(var e=0;e<n.length;e++)n[e]=n[e].trim(" "),""!=n[e]&&(void 0===WPGlobusAdmin.data.tag[a][n[e]]?i[e]=n[e]:i[e]=WPGlobusAdmin.data.tag[a][n[e]]);o.val(i.join(", "))})}(c(this))),t=t.then(function(){return c.when(e.done())}).then(function(){"bulk_edit"!=a.currentTarget.id&&setTimeout(function(){inlineEditPost.save(l),c.ajaxSetup({async:!0})},50)})}))}),c("#the-list").on("click","a.editinline",function(){var t=c(this);if(o=t.parents("tr").attr("id"),"post"===n)l=o.replace("post-","");else{if("taxonomy"!==n)return;l=o.replace("tag-","")}"post"===n&&void 0!==WPGlobusAdmin.data.tags&&c.each(WPGlobusAdmin.data.tags,function(t,a){var e,o;""==WPGlobusAdmin.data.value[a]||void 0!==(e=c("#edit-"+l+' textarea[name="'+WPGlobusAdmin.data.names[a]+'"]').val())&&(o=e.split(","),c.each(o,function(t,a){e=e.replace(a,WPGlobusCore.TextFilter(a,WPGlobusCoreData.language))}),c("#edit-"+l+' textarea[name="'+WPGlobusAdmin.data.names[a]+'"]').val(e))});var a=c("#edit-"+l+" input.ptitle").eq(0),e=a.parents("label");a.val(WPGlobusAdmin.qedit_titles[l].source),a.addClass("hidden"),c(WPGlobusAdmin.data.template).insertAfter(e),void 0===WPGlobusAdmin.qedit_titles[l]&&(WPGlobusAdmin.qedit_titles[l]={},WPGlobusAdmin.qedit_titles[l].source=c("#"+o+" .name a.row-title").text(),c(WPGlobusAdmin.data.enabled_languages).each(function(t,a){WPGlobusAdmin.qedit_titles[l][a]={},a==WPGlobusAdmin.data.default_language?WPGlobusAdmin.qedit_titles[l][a].name=WPGlobusAdmin.qedit_titles[l].source:WPGlobusAdmin.qedit_titles[l][a].name="",WPGlobusAdmin.qedit_titles[l][a].description=""})),c(".wpglobus-quick-edit-title").each(function(t,a){var e=c(a),o=e.data("language");e.attr("id",o+l),void 0!==WPGlobusAdmin.qedit_titles[l][o]&&(WPGlobusAdmin.qedit_titles[l][o].name=WPGlobusAdmin.qedit_titles[l][o].name.replace(/\\\'/g,"'"),WPGlobusAdmin.qedit_titles[l][o].name=WPGlobusAdmin.qedit_titles[l][o].name.replace(/\\\"/g,'"'),e.attr("value",WPGlobusAdmin.qedit_titles[l][o].name),WPGlobusAdmin.qedit_titles[l].source=WPGlobusCore.getString(WPGlobusAdmin.qedit_titles[l].source,WPGlobusAdmin.qedit_titles[l][o].name,o))}),c("input.ptitle").eq(0).attr("value",WPGlobusAdmin.qedit_titles[l].source)}))},taxonomy_edit:function(){var a=[];a[0]="name",a[1]="description";c.each(WPGlobusCoreData.enabled_languages,function(t,u){c.each(a,function(t,a){var e,o,n,i,l,s,d;o=u,n=c("#"+(e=a)),i=n.clone(),l=n.attr("name"),s="wpglobus-element wpglobus-element_"+e+" wpglobus-element_"+o+" wpglobus-translatable",d=(d=document.getElementById(e)).nodeName,c(i).attr("id",e+"_"+o),c(i).attr("name",l+"_"+o),o!==WPGlobusCoreData.default_language&&(s+=" hidden"),c(i).attr("class",s),c(i).attr("data-save-to",e),c(i).attr("data-language",o),"INPUT"==d?c(i).attr("value",c("#wpglobus-link-tab-"+o).data(e)):"TEXTAREA"==d&&c(i).text(c("#wpglobus-link-tab-"+o).data(e)),n.addClass("hidden"),0==c(".wpglobus-element_"+e).size()?c(i).insertAfter(n):c(i).insertAfter(c(".wpglobus-element_"+e).last())})}),c(".wpglobus-taxonomy-tabs").insertAfter("#ajax-response"),c(".wrap").tabs(),c("body").on("click",".wpglobus-taxonomy-tabs li",function(t){var a=c(this).data("language");c(".wpglobus-element").addClass("hidden"),c(".wpglobus-element_"+a).removeClass("hidden")}),c(".wpglobus-element").on("change",function(){var n=c(this).data("save-to"),i="";c(".wpglobus-element").each(function(t,a){var e=c(a),o=e.val();e.data("save-to")==n&&""!==o&&(i+=WPGlobusCore.addLocaleMarks(o,e.data("language")))}),c("#"+n).val(i)})},nav_menus:function(){function e(){n!==c(i).size()&&(clearInterval(o),c(i).each(function(t,a){var l,e=c(a);e.hasClass("wpglobus-menu-item")||(l=c(a).attr("id"),c.each(["input.edit-menu-item-title","input.edit-menu-item-attr-title"],function(t,a){var e,o,n=c("#"+l+" "+a),i=c(n);i.hasClass("wpglobus-hidden")||(i.addClass("wpglobus-hidden"),i.css("display","none"),e=i.parent("label"),o=i.parents("p"),c(o).css("height","80px"),c(e).append('<div style="color:#f00;">'+WPGlobusAdmin.i18n.save_nav_menu+"</div>"))}),e.addClass("wpglobus-menu-item"))}))}var o,n,i="#menu-to-edit .menu-item";c.ajaxSetup({beforeSend:function(t,a){void 0!==a.data&&0<=a.data.indexOf("action=add-menu-item")&&(n=c(i).size(),o=setInterval(e,500))}}),c(i).each(function(t,a){var e=c(a).attr("id"),u=e.replace("menu-item-","");c.each(["input.edit-menu-item-title","input.edit-menu-item-attr-title"],function(n,i){var l=c("#"+e+" "+i);l.val()!=WPGlobusAdmin.data.items[u][i].source&&l.val(WPGlobusAdmin.data.items[u][i].source);var s=c("#"+e+" "+i).parents("p"),d=0;c.each(WPGlobusAdmin.data.open_languages,function(t,a){var e=l.clone();e.attr("id",l.attr("id")+"-"+a),e.attr("name",l.attr("id")+"-"+a),e.attr("data-language",a),e.attr("data-item-id",u),e.attr("placeholder",WPGlobusAdmin.data.en_language_name[a]);var o=WPGlobusAdmin.data.items[u][a][i].class;0===n&&a===WPGlobusAdmin.data.default_language?e.attr("class",o+" edit-menu-item-title"):e.attr("class",o),""!=WPGlobusAdmin.data.items[u][a][i].caption?e.attr("value",WPGlobusAdmin.data.items[u][a][i].caption):e.attr("value",""),e.css("margin-bottom","0.6em"),c(s).append(e),d=t}),d=40*(d+1),l.css("display","none").attr("class","").addClass("widefat wpglobus-hidden"),c(s).css("height",d+"px").addClass("wpglobus-menu-item-box")}),c(a).addClass("wpglobus-menu-item")}),c(".menus-move-left, .menus-move-right").each(function(t,a){var e,o=c(a),n=(o.parents("li").attr("id").replace("menu-item-",""),o.attr("title"));void 0!==n&&c.each(WPGlobusAdmin.data.post_titles,function(t,a){0<=n.indexOf(t)&&(e=n.replace(t,a),o.attr("title",e),o.text(e))})}),c(".edit-menu-item-title").trigger("change"),wpNavMenu.refreshAdvancedAccessibility(),wpNavMenu.menusChanged=!1,c(".wpglobus-menu-item").on("change",function(){var t,a,e=c(this),o=e.data("item-id");e.hasClass("wpglobus-item-title")&&(t=WPGlobusCore.getString(c("input#edit-menu-item-title-"+o).val(),e.val(),e.data("language")),void 0!==(a=c(document).triggerHandler("wpglobus_get_menu_translations",{string:t,lang:WPGlobusCoreData.open_languages,id:o,type:"input.edit-menu-item-title"}))&&(t=a),c("input#edit-menu-item-title-"+o).val(t)),e.hasClass("wpglobus-item-attr")&&(t=WPGlobusCore.getString(c("input#edit-menu-item-attr-title-"+o).val(),e.val(),e.data("language")),void 0!==(a=c(document).triggerHandler("wpglobus_get_menu_translations",{string:t,lang:WPGlobusCoreData.open_languages,id:o,type:"input.edit-menu-item-attr-title"}))&&(t=a),c("input#edit-menu-item-attr-title-"+o).val(t))})},post_edit:function(){c(document).on("heartbeat-send",function(t,o){void 0!==o.wp_autosave&&(o.wpglobus_heartbeat="wpglobus",c.each(WPGlobusAdmin.data.open_languages,function(t,a){var e=c("#title_"+a).val()||"";""!=(e=c.trim(e))&&(o.wp_autosave["post_title_"+a]=e),e=c("#content_"+a).val()||"",""!=(e=c.trim(e))&&(o.wp_autosave["content_"+a]=e)}))});var a,i,n,t,l,e,o,s="#postdivrich",d=!0,u="#post-body-content";!1===WPGlobusAdmin.data.support.editor&&(d=!(s="#titlediv")),!1===WPGlobusAdmin.data.support.title&&(d=!1),c(u).prepend(c(".wpglobus-post-body-tabs-list")),c.each(WPGlobusAdmin.tabs,function(t,a){"default"===a?(c(s).wrap('<div id="tab-default"></div>'),d&&c(c("#titlediv")).insertBefore(s)):(c(s+"-"+a).wrap('<div id="tab-'+a+'"></div>'),d&&c(c("#titlediv-"+a)).insertBefore(s+"-"+a))}),c(u).addClass("wpglobus-post-body-tabs").tabs({beforeActivate:function(t,a){var e=a.oldTab[0].id.replace("link-tab-",""),o=a.newTab[0].id.replace("link-tab-","");"default"==e&&(e=WPGlobusCoreData.default_language),"default"==o&&(o=WPGlobusCoreData.default_language);var n=c(document).triggerHandler("wpglobus_post_body_tabs",[e,o]);return!(!n&&void 0!==n)}}),c("#title").val(WPGlobusAdmin.title),c("#content").text(WPGlobusAdmin.content),"undefined"!=typeof WPGlobusVendor&&WPGlobusVendor.vendor.WPSEO&&("undefined"!=typeof wpglobus_wpseo?wpglobus_wpseo():"undefined"!=typeof WPGlobusYoastSeo&&WPGlobusYoastSeo.init()),WPGlobusAdmin.data.modify_excerpt&&((a=c("#excerpt")).addClass("hidden").css({display:"none"}),c(WPGlobusAdmin.data.template).insertAfter(a),c("body").on("change",".wpglobus-excerpt",function(){var t=c(this);a.val(WPGlobusCore.getString(a.val(),t.val(),t.data("language")))})),void 0!==wp.utils&&void 0!==wp.utils.WordCounter&&(WPGlobusCoreData.wordCounter={},i=this,c.each(WPGlobusCoreData.enabled_languages,function(t,a){return a==WPGlobusCoreData.default_language||(e=jQuery,o=new wp.utils.WordCounter,n=a,WPGlobusCoreData.wordCounter[n]={},WPGlobusCoreData.wordCounter[n].counter=o,void e(function(){function o(t){var a,e;"object"==typeof t&&(t="tinymce"==t?i.getCurrentTab():t.target.id.replace("content_","")),void 0!==WPGlobusCoreData.wordCounter[t]&&(a=!WPGlobusCoreData.wordCounter[t].contentEditor||WPGlobusCoreData.wordCounter[t].contentEditor.isHidden()?WPGlobusCoreData.wordCounter[t].content.val():WPGlobusCoreData.wordCounter[t].contentEditor.getContent({format:"raw"}),(e=WPGlobusCoreData.wordCounter[t].counter.count(a))!==WPGlobusCoreData.wordCounter[t].prevCount&&WPGlobusCoreData.wordCounter[t].count.text(e),WPGlobusCoreData.wordCounter[t].prevCount=e)}WPGlobusCoreData.wordCounter[n].content=e("#content_"+n),WPGlobusCoreData.wordCounter[n].count=e("#wp-word-count-"+n).find(".word-count-"+n),WPGlobusCoreData.wordCounter[n].prevCount=0,e(document).on("tinymce-editor-init",function(t,a){var e;-1!=a.id.indexOf("content_")&&(e=a.id.replace("content_",""),(WPGlobusCoreData.wordCounter[e].contentEditor=a).on("nodechange keyup",_.debounce(o,1e3)))}),WPGlobusCoreData.wordCounter[n].content.on("input keyup",_.debounce(o,1e3)),o(n)}));var e,o,n})),"undefined"!=typeof wpWordCount&&(n=0,t=WPGlobusCoreData.open_languages,l=this.$document,e={},t.shift(),c.each(WPGlobusCoreData.open_languages,function(t,a){e[a]=0}),o={settings:{strip:/<[a-zA-Z\/][^<>]*>/g,clean:/[0-9.(),;:!?%#$¿'"_+=\\/-]+/g,w:/\S\s+/g,c:/\S/g},block:e,wc:function(t,a,e){var o=this,n=0,i=a==WPGlobusCoreData.default_language?c(".word-count"):c(".word-count-"+a);void 0===e&&(e=wordCountL10n.type),"w"!==e&&"c"!==e&&(e="w"),o.block[a]||(o.block[a]=1,setTimeout(function(){t&&(t=(t=t.replace(o.settings.strip," ").replace(/ | /gi," ")).replace(o.settings.clean,"")).replace(o.settings[e],function(){n++}),i.html(n.toString()),setTimeout(function(){o.block[a]=0},2e3)},1))}},l.bind("wpglobuscountwords",function(t,a,e){o.wc(a,e)}),c.each(t,function(t,e){var o=c("#content_"+e);l.triggerHandler("wpglobuscountwords",[o.val(),e]),o.keyup(function(t){var a=t.keyCode||t.charCode;return a==n||(13!=a&&8!=n&&46!=n||l.triggerHandler("wpglobuscountwords",[o.val(),e]),n=a),!0})}),c(document).triggerHandler("wpglobuscountwords",[c("#content").val(),WPGlobusCoreData.default_language])),c("body").on("click","#publish, #save-post",function(){var e,t,o,n;1<WPGlobusAdmin.data.open_languages.length&&(c(document).triggerHandler("wpglobus_before_save_post",{content_tabs_id:u}),e=c("#title").val(),n=o="",0==e.length&&(t=WPGlobusAdmin.data.open_languages.indexOf(WPGlobusAdmin.data.default_language),WPGlobusAdmin.data.open_languages.splice(t,1),c(WPGlobusAdmin.data.open_languages).each(function(t,a){n=0==t?"":"-",0<(e=c("#title_"+a).val()).length&&(0==o.length&&(n=""),o=o+n+e)})),0<o.length&&c("#title").val(o)),void 0===WPGlobusAdmin.data.tagsdiv||WPGlobusAdmin.data.tagsdiv.length<1||c(WPGlobusAdmin.data.tagsdiv).each(function(t,a){if(0==c("#"+a).size())return!0;var e=a.replace("tagsdiv-","");if("undefined"===e)return!0;if(0==c("#tax-input-"+e).size())return!0;var o,n=[];c("#tagsdiv-"+e+" .tagchecklist span").each(function(t,a){o=(o=c(a).text()).replace("X","").trim(" "),void 0===WPGlobusAdmin.data.tag[e][o]?n[t]=o:n[t]=WPGlobusAdmin.data.tag[e][o]}),c("#tax-input-"+e).val(n.join(", "))})}),c(".ui-state-default").on("click",function(){"link-tab-default"===c(this).attr("id")&&(c(window).scrollTop(c(window).scrollTop()+1),c(window).scrollTop(c(window).scrollTop()-1))})},adminCentral:function(){c(".wpglobus-admin-central-tab").css({display:"none"}),1<c(".nav-tab-active").length&&c(".wpglobus-about-wrap .nav-tab-wrapper a").removeClass("nav-tab-active");var e=!0;0==location.hash.indexOf("#")&&c(".wpglobus-about-wrap .nav-tab-wrapper a").each(function(t,a){c(a).attr("href")==location.hash&&(e=!1,c(a).addClass("nav-tab-active"))}),e&&c(".wpglobus-about-wrap .nav-tab-wrapper a").eq(0).addClass("nav-tab-active");var t=c(".wpglobus-about-wrap .nav-tab-active").data("tab-id");""!=t&&c("#"+t).css({display:"block"}),c(document).on("click",".wpglobus-about-wrap .nav-tab",function(t){var a=c(this);a.hasClass("nav-tab-active")||(c(".wpglobus-admin-central-tab").css({display:"none"}),c(".wpglobus-about-wrap .nav-tab").removeClass("nav-tab-active"),a.addClass("nav-tab-active"),""!=a.data("tab-id")&&c("#"+a.data("tab-id")).css({display:"block"}))})},start:function(){var a=this;c("#wpglobus_flags").select2({formatResult:this.format,formatSelection:this.format,minimumResultsForSearch:-1,escapeMarkup:function(t){return t}}),c("body").on("click","#enabled_languages-list li:first input",function(t){return t.preventDefault(),c(".redux-save-warn").css({display:"none"}),c("#enabled_languages-list").find("li:first > input").val("1"),0===c("#disable_first_language").length&&c(a.config.disable_first_language).insertAfter("#info_bar"),!1})},format:function(t){return'<img class="wpglobus_flag" src="'+WPGlobusAdmin.flag_url+t.text+'"/> '+t.text},set_dialog:function(){var o,e,n;void 0!==WPGlobusAdmin.data.customFieldsEnabled&&(WPGlobusAdmin.data.customFieldsEnabled=this.parseBool(WPGlobusAdmin.data.customFieldsEnabled),!WPGlobusAdmin.data.customFieldsEnabled)||(e=!1,(n=function(t){var s,d,u="wpglobus_dialog_start wpglobus_dialog_icon",r=['<div class="wpglobus_dialog_options_wrapper hidden">','<input style="width:initial;" id="wpglobus-cb-{{id}}" data-object="#wpglobus-dialog-start-{{id}}" data-meta-key="{{meta-key}}" class="wpglobus_dialog_option wpglobus_dialog_cb" type="checkbox" {{checked}} />',"</div>"].join(""),a=void 0===t?"#the-list tr":"#the-list tr#"+t;c(a).each(function(){var t,a,e,o=c(this),n=o.attr("id"),i=o.find("textarea"),l=u;if(void 0===(s=i.attr("id")))return!0;e=c("#"+n+"-key").val(),t=c("#"+s).clone(),c(i).addClass("wpglobus-dialog-field-source hidden"),a=i.attr("name"),c(t).attr("id","wpglobus-"+s),c(t).attr("name","wpglobus-"+a),c(t).attr("data-source-id",s),c(t).attr("class","wpglobus-dialog-field"),c(t).val(WPGlobusCore.TextFilter(c(i).val(),WPGlobusCoreData.language)),c(t).insertAfter(i),d=(d=r.replace(/{{id}}/g,s)).replace(/{{meta-key}}/g,e),void 0===WPGlobusAdmin.data.post_meta_settings[WPGlobusAdmin.data.post_type]?d=d.replace(/{{checked}}/,"checked"):l=void 0!==WPGlobusAdmin.data.post_meta_settings[WPGlobusAdmin.data.post_type][e]&&"false"==WPGlobusAdmin.data.post_meta_settings[WPGlobusAdmin.data.post_type][e]?(d=d.replace(/{{checked}}/,""),u+" wpglobus_dialog_start_hidden"):(d=d.replace(/{{checked}}/,"checked"),u),o.append('<td style="width:20px;"><div id="wpglobus-dialog-start-'+s+'" data-type="control" data-source-type="textarea" data-source-id="'+s+'" class="'+l+'"></div>'+d+"</td>")}),!e&&0<c("#list-table .wpglobus_dialog_start").length&&(c("#list-table thead tr").append('<th class="wpglobus-control-head"><div class="wpglobus_dialog_settings wpglobus_dialog_icon"></div></th>'),e=!0)})(),c("body").on("change",".wpglobus-dialog-field",function(){var e,o,n=c(this),t="#"+n.data("source-id"),i="";e=c(t).val(),/(\{:|\[:|<!--:)[a-z]{2}/.test(e)?(c.each(WPGlobusCoreData.enabled_languages,function(t,a){""!=(o=a==WPGlobusCoreData.language?n.val():WPGlobusCore.TextFilter(e,a,"RETURN_EMPTY"))&&(i+=WPGlobusCore.addLocaleMarks(o,a))}),c(t).val(i)):c(t).val(n.val())}),c(document).ajaxSend(function(t,a,e){"add-meta"==e.action&&(o=e.element)}),c(document).ajaxComplete(function(t,a,e){"add-meta"==e.action&&void 0!==a.responseXML&&n("newmeta"==o?"meta-"+c(a.responseXML.documentElement.outerHTML).find("meta").attr("id"):o)}),WPGlobusDialogApp.init({dialogTitle:"Edit meta"}))}},new t.App,t)});
|
1 |
+
var WPGlobusCore,WPGlobusDialogApp;!function(i){var d=WPGlobusCore={strpos:function(t,a,e){e=(t=""+t).indexOf(a,e);return 0<=e&&e},TextFilter:function(t,a,e){if(void 0===t||""===t)return t;var o,n,i=[],l=!1;a=""==a?"en":a,e=void 0===e||""==e?"RETURN_IN_DEFAULT_LANGUAGE":e,i[0]=[],i[0].start=WPGlobusCoreData.locale_tag_start.replace("%s",a),i[0].end=WPGlobusCoreData.locale_tag_end,i[1]=[],i[1].start="\x3c!--:"+a+"--\x3e",i[1].end="\x3c!--:--\x3e",i[2]=[],i[2].start="[:"+a+"]",i[2].end="[:";for(var s=0;s<3;s++)if(!1!==(o=d.strpos(t,i[s].start))){o+=i[s].start.length,t=!1===(n=d.strpos(t,i[s].end,o))?t.substr(o):t.substr(o,n-o),l=!0;break}return l||("RETURN_EMPTY"==e?a==WPGlobusCoreData.default_language&&!/(\{:|\[:|<!--:)[a-z]{2}/.test(t)||(t=""):a==WPGlobusCoreData.default_language?/(\{:|\[:|<!--:)[a-z]{2}/.test(t)&&(t=""):t=d.TextFilter(t,WPGlobusCoreData.default_language)),t},addLocaleMarks:function(t,a){return WPGlobusCoreData.locale_tag_start.replace("%s",a)+t+WPGlobusCoreData.locale_tag_end},getTranslations:function(e){var o,n={};return i.each(WPGlobusCoreData.enabled_languages,function(t,a){o=a==WPGlobusCoreData.default_language?"RETURN_IN_DEFAULT_LANGUAGE":"RETURN_EMPTY",n[a]=d.TextFilter(e,a,o)}),n},getString:function(t,a,e){if(void 0===t)return t;void 0===a&&(a=""),void 0===e&&(e=WPGlobusCoreData.language),(t=d.getTranslations(t))[e]=a;var o="";return i.each(t,function(t,a){""!=a&&t!=WPGlobusCoreData.default_language&&(o+=d.addLocaleMarks(a,t))}),o=""!=t[WPGlobusCoreData.default_language]?""==o?t[WPGlobusCoreData.default_language]:d.addLocaleMarks(t[WPGlobusCoreData.default_language],WPGlobusCoreData.default_language)+o:o}}}(jQuery),function(c){var g=WPGlobusDialogApp={option:{listenClass:".wpglobus_dialog_start",settingsClass:".wpglobus_dialog_settings",dialogTabs:"#wpglobus-dialog-tabs",dialogTitle:"",customData:null,callback:function(){}},form:void 0,element:void 0,element_by:"id",id:"",clone_id:"",wpglobus_id:"",type:"textarea",source:"",order:{},value:{},request:"core",attrs:{},dialogTitle:"",trClass:"wpglobus-translatable",startButton:['<span id="wpglobus-dialog-start-{{clone_id}}" ','style="{{style}}" ','data-type="control" data-dialog-title="{{title}}" ','data-source-type="" data-source-id="{{id}}" data-source-name="{{name}}" ','data-nodename="{{nodename}}"',"{{sbTitle}} ",'class="{{classes}}"></span>'].join(""),startButtonClass:"wpglobus_dialog_start wpglobus_dialog_icon",clicks:0,init:function(t){g.option=c.extend(g.option,t),c(g.option.dialogTabs).tabs(),g.dialogTitle=g.option.dialogTitle,this.attachListener(),null!=g.option.customData&&void 0!==g.option.customData.addElements&&c.each(g.option.customData.addElements,function(t,a){g.addElement(a)})},convertToId:function(t){return t=(t=t.replace(/\]/g,"")).replace(/\[/g,"-")},addElement:function(t){var a={id:null,dialogTitle:"",style:"",styleTextareaWrapper:"",sbTitle:"",onChangeClass:""};if("string"==typeof t)a.id=t;else{if("object"!=typeof t)return;a=c.extend(a,t)}var e,o,n,i=null,l=null,s=null,d=null,u=g.startButton,r="";g.element_by="id",null===(d=document.getElementById(a.id))?(g.element_by="name",d=document.getElementsByName(a.id)):r=(r=d.nodeName).toLowerCase(),0!=d.length&&(l=a.id,s="undefined"===(i="id"==g.element_by?c("#"+l):(r=(r=d[0].nodeName).toLowerCase(),c(r+'[name="'+l+'"]'))).attr("name")?l:i.attr("name"),g.clone_id=g.convertToId(l),-1==s.indexOf("wpglobus")&&-1==g.clone_id.indexOf("wpglobus")&&(0<c("#wpglobus-"+g.clone_id).length||0<c(r+'[name="wpglobus-'+s+'"]').length||(t=c(i.clone()),d=i.attr("style")||"",i.attr("style","display:none;"),t.attr("id","wpglobus-"+g.clone_id).attr("name","wpglobus-"+s),t.addClass(g.trClass),""!=a.onChangeClass&&t.addClass(a.onChangeClass),("id"==g.element_by?t.attr("data-source-id",l).attr("data-source-name",""):t.attr("data-source-id","").attr("data-source-name",s)).attr("data-source-get-by",g.element_by),"textarea"==r?(e=WPGlobusCore.getTranslations(i.text())[WPGlobusCoreData.language],t.text(e),t.attr("data-nodename","textarea"),""==a.style?t.attr("style",d+";width:95%;float:left;"):t.attr("style",d+";"+a.style)):(e=WPGlobusCore.getTranslations(i.val())[WPGlobusCoreData.language],t.attr("value",e),t.attr("data-nodename","input"),""!=a.style&&t.attr("style",d+";"+a.style)),u=u.replace(/{{clone_id}}/g,g.clone_id),u="id"==g.element_by?(u=(u=u.replace(/{{id}}/g,g.clone_id)).replace(/{{name}}/g,"")).replace(/{{nodename}}/g,""):(u=(u=u.replace(/{{id}}/g,"")).replace(/{{name}}/g,s)).replace(/{{nodename}}/g,r),u="textarea"==r?u.replace("{{style}}","float:left;margin-top:0;"):u.replace("{{style}}",""),s="textarea"==r?g.startButtonClass+" wpglobus-textarea wpglobus-textarea-"+g.clone_id:g.startButtonClass,u=u.replace("{{classes}}",s),u=""==a.dialogTitle?u.replace("{{title}}",g.dialogTitle):u.replace("{{title}}",a.dialogTitle),u=""==a.sbTitle?u.replace("{{sbTitle}}",a.sbTitle):u.replace("{{sbTitle}}",'title="'+a.sbTitle+'"'),c(u).insertAfter(i),c(t).insertAfter(i),"textarea"==r&&(c("#wpglobus-"+g.clone_id).addClass("wpglobus-textarea-"+g.clone_id),c(".wpglobus-textarea-"+g.clone_id).wrapAll('<div class="wpglobus-textarea-wrapper" style="'+a.styleTextareaWrapper+'"></div>')),o=!1,""==a.onChangeClass?n="#wpglobus-"+g.clone_id:(n="."+a.onChangeClass,void 0===(a=c._data(c(document)[0],"events"))?o=!0:void 0!==a.change&&c.each(a.change,function(t,a){if(a.selector==n)return!(o=!0)})),o||c(document).on("change",n,function(){var t=c(this),a=""==(a=t.data("source-id"))?t.data("nodename")+'[name="'+t.data("source-name")+'"]':"#"+a;c(a).val(WPGlobusCore.getString(c(a).val(),t.val()))}))))},saveDialog:function(){var e,o,n="",i="",l="";c(".wpglobus_dialog_textarea").each(function(t,a){o=c(a),e=o.val(),(o=o.data("language"))==WPGlobusAdmin.data.language&&(l=e),""!=e&&(n+=WPGlobusCore.addLocaleMarks(e,o),o==WPGlobusCoreData.default_language&&(i=e))}),n=n.length==i.length+8?i:n,c(g.id).val(n),n=""==l?i:l,c(g.wpglobus_id).val(n)},dialog:c("#wpglobus-dialog-wrapper").dialog({autoOpen:!1,width:650,modal:!0,dialogClass:"wpglobus-dialog",buttons:[{text:"Save",class:"wpglobus-button-save",click:function(){g.saveDialog(),g.dialog.dialog("close")}},{text:"Cancel",class:"wpglobus-button-cancel",click:function(){g.dialog.dialog("close")}}],open:function(){var t=g.dialogTitle;void 0!==g.attrs.maxlength&&(c(".wpglobus_dialog_textarea").attr("maxlength",g.attrs.maxlength),t+=" | maxlength="+g.attrs.maxlength),c(".wpglobus-dialog .ui-dialog-title").text(t)},close:function(){g.form[0].reset()}}),attachListener:function(){c(document).on("click",g.option.settingsClass,function(){c(".wpglobus_dialog_options_wrapper").hasClass("hidden")?c(".wpglobus_dialog_options_wrapper").removeClass("hidden"):c(".wpglobus_dialog_options_wrapper").addClass("hidden")}),c(document).on("click",".wpglobus_dialog_option",function(t){var a=c(this),e=a.data("object");g.order.action="save_post_meta_settings",g.order.post_type=WPGlobusAdmin.data.post_type,g.order.checked=a.prop("checked"),g.order.id=a.attr("id"),g.order.meta_key=a.data("meta-key"),g.ajax(g.order).done(function(t){"ok"==t.result&&("true"==t.checked?c(e).removeClass("wpglobus_dialog_start_hidden"):c(e).addClass("wpglobus_dialog_start_hidden"))}).fail(function(t){}).always(function(t,a){})}),c(document).on("click",g.option.listenClass,function(a){g.element=c(this),g.id=g.element.data("source-id"),""==g.id?(g.id=g.element.data("nodename")+'[name="'+g.element.data("source-name")+'"]',g.wpglobus_id="#wpglobus-"+g.convertToId(g.element.data("source-name"))):(g.wpglobus_id="#wpglobus-"+g.id,g.id="#"+g.id),g.clicks++,1==g.clicks&&setTimeout(function(){var t;1==g.clicks?g.onClick(a):(t=c(g.id)).hasClass("hidden")?t.removeClass("hidden").attr("style","display:block;"):t.addClass("hidden").attr("style","display:none;"),g.clicks=0},200)}),g.form=g.dialog.find("form#wpglobus-dialog-form").on("submit",function(t){t.preventDefault(),g.saveDialog()})},ajax:function(t){return c.ajax({type:"POST",url:WPGlobusAdmin.ajaxurl,data:{action:WPGlobusAdmin.process_ajax,order:t},dataType:"json",async:!1})},onClick:function(t){void 0===g.element.data("dialog-title")||""==g.element.data("dialog-title")?g.dialogTitle=g.option.dialogTitle:g.dialogTitle=g.element.data("dialog-title"),void 0!==g.id&&(g.attrs.maxlength=c(g.id).attr("maxlength")),g.source=g.element.data("source-value"),void 0===g.source&&(g.source=c(g.id).val(),"ajax"==g.request||(g.value=WPGlobusCore.getTranslations(g.source))),c.each(g.value,function(t,a){c("#wpglobus-dialog-"+t).val(a)}),g.dialog.dialog("open")}}}(jQuery),jQuery(document).ready(function(){"use strict";var t,r;window.WPGlobusAdminApp=(t=window.WPGlobusAdminApp||{},r=jQuery,t.App=function(t){void 0===window.WPGlobusAdminApp&&(this.config={debug:!1,version:WPGlobusAdmin.version},this.status="ok","undefined"===WPGlobusAdmin?(this.status="error",this.config.debug&&console.log("Error options loading")):this.config.debug&&console.dir(WPGlobusAdmin),this.config.disable_first_language=['<div id="disable_first_language" style="display:block;" class="redux-field-errors notice-red">',"<strong>","<span> </span>",WPGlobusAdmin.i18n.cannot_disable_language,"</strong>","</div>"].join(""),r.extend(this.config,t),"ok"===this.status&&this.init())},t.App.prototype={$document:r(document),init:function(){WPGlobusCoreData.multisite=this.parseBool(WPGlobusCoreData.multisite),this.admin_init(),r("#content").addClass("wpglobus-editor").attr("data-language",WPGlobusAdmin.data.default_language),r("textarea[id^=content_]").each(function(t,a){var e=r(a).attr("id").replace("content_","");r(a).attr("data-language",e)}),"post.php"===WPGlobusAdmin.page?(this.post_edit(),this.set_dialog(),"undefined"!=typeof WPGlobusAioseop&&WPGlobusAioseop.init()):"menu-edit"===WPGlobusAdmin.page?this.nav_menus():"taxonomy-edit"===WPGlobusAdmin.page?WPGlobusAdmin.data.tag_id&&this.taxonomy_edit():"taxonomy-quick-edit"===WPGlobusAdmin.page?this.quickEdit("taxonomy"):"edit.php"===WPGlobusAdmin.page?this.quickEdit("post"):"options-general.php"==WPGlobusAdmin.page?this.options_general():"widgets.php"==WPGlobusAdmin.page?(WPGlobusWidgets.init(),WPGlobusDialogApp.init({dialogTitle:"Edit text"})):"wpglobus_options"==WPGlobusAdmin.page?this.start():"wpglobusAdminCentral"==WPGlobusAdmin.page?this.adminCentral():WPGlobusDialogApp.init({customData:WPGlobusCoreData.page_custom_data})},parseBool:function(t){return!/^(false|0)$/i.test(t)&&!!t},getCurrentTab:function(){return r(".wpglobus-post-body-tabs-list .ui-tabs-active").data("language")},admin_init:function(){var t=r(".wpglobus-addons-group a").data("key");void 0!==t&&(0<=window.location.search.indexOf("page=wpglobus_options&tab="+t)?WPGlobusCoreData.multisite?window.location=WPGlobusCoreData.pluginInstallLocation.multisite:window.location=WPGlobusCoreData.pluginInstallLocation.single:(t=r("#toplevel_page_wpglobus_options li").eq(t+1),(WPGlobusCoreData.multisite?r(t).find("a").attr("href",WPGlobusCoreData.pluginInstallLocation.multisite):r(t).find("a").attr("href",WPGlobusCoreData.pluginInstallLocation.single)).attr("onclick","window.location=jQuery(this).attr('href');return false;")))},options_general:function(){var e=r("#blogname"),t=r("body");e.addClass("hidden"),r("#wpglobus-blogname").insertAfter(e).removeClass("hidden"),t.on("blur",".wpglobus-blogname",function(){r(".wpglobus-blogname").each(function(t,a){a=r(a);e.val(WPGlobusCore.getString(e.val(),a.val(),a.data("language")))})});var o=r("#blogdescription");o.addClass("hidden"),r("#wpglobus-blogdescription").insertAfter(o).removeClass("hidden"),t.on("blur",".wpglobus-blogdesc",function(){r(".wpglobus-blogdesc").each(function(t,a){a=r(a);o.val(WPGlobusCore.getString(o.val(),a.val(),a.data("language")))})})},quickEdit:function(o){var n,i,l,t;void 0!==WPGlobusAdmin.data.has_items&&WPGlobusAdmin.data.has_items&&(n="",i=0,r(document).ajaxComplete(function(t,a,e){void 0!==e.data&&""!=n&&0<=e.data.indexOf("action=inline-save-tax&")&&(r("#"+n+" a.row-title").text(WPGlobusAdmin.qedit_titles[i][WPGlobusAdmin.data.language].name),r("#"+n+" .description").text(WPGlobusAdmin.qedit_titles[i][WPGlobusAdmin.data.language].description))}),l={},r("#the-list tr").each(function(t,a){var e=r(a),a="post"===o?"post-":"tag-";i=e.attr("id").replace(a,""),l[i]={},"post"===o?l[i].source=e.find(".post_title").text():"taxonomy"===o&&(l[i].source=r("#inline_"+i+" .name").text())}),(t={action:"get_titles"}).type=o,t.taxonomy=void 0!==WPGlobusAdmin.data.taxonomy&&WPGlobusAdmin.data.taxonomy,t.title=l,r.ajax({type:"POST",url:WPGlobusAdmin.ajaxurl,data:{action:WPGlobusAdmin.process_ajax,order:t},dataType:"json"}).done(function(t){WPGlobusAdmin.qedit_titles=t.qedit_titles,r.each(t.bulkedit_post_titles,function(t,a){r("#inline_"+t+" .post_title").text(a[WPGlobusAdmin.data.language].name)})}).fail(function(t){}).always(function(t,a){}),r("body").on("change",".wpglobus-quick-edit-title",function(){var o="",n=[];r(".wpglobus-quick-edit-title").each(function(t,a){var e=r(a),a=e.data("language");""!==e.val()&&(o=WPGlobusCore.getString(o,e.val(),a)),WPGlobusAdmin.qedit_titles[i][a].name=e.val(),n[t]=a});var t=r(document).triggerHandler("wpglobus_get_translations",{string:o,lang:n,id:i});void 0!==t&&(o=t),r("input.ptitle").eq(0).attr("value",o),WPGlobusAdmin.qedit_titles[i].source=o}),void 0!==WPGlobusAdmin.data.tags&&r.each(WPGlobusAdmin.data.tags,function(t,a){WPGlobusAdmin.data.value[a].post_id={}}),r("button.save, input#bulk_edit").on("mouseenter",function(t){void 0!==WPGlobusAdmin.data.tags&&(("bulk_edit"==t.currentTarget.id?r("input#bulk_edit"):r("button.save")).unbind("click"),r("button.save, input#bulk_edit").on("click",function(a){console.log("Start Updating");var t=r.when(),e=(r(this),r.Deferred());e.resolve(function(t){t.next(".spinner").css({visibility:"visible"}),"bulk_edit"!=a.currentTarget.id&&r.ajaxSetup({async:!1});var o,n,i,l=t.parents("tr"),s=l.attr("id").replace("edit-","");r.each(WPGlobusAdmin.data.tags,function(t,a){if(0==(o=l.find("textarea[name='"+WPGlobusAdmin.data.names[a]+"']")).length)return!0;WPGlobusAdmin.data.value[a].post_id[s]=o.val(),n=WPGlobusAdmin.data.value[a].post_id[s].split(","),i=[];for(var e=0;e<n.length;e++)n[e]=n[e].trim(" "),""!=n[e]&&(void 0===WPGlobusAdmin.data.tag[a][n[e]]?i[e]=n[e]:i[e]=WPGlobusAdmin.data.tag[a][n[e]]);o.val(i.join(", "))})}(r(this))),t=t.then(function(){return r.when(e.done())}).then(function(){"bulk_edit"!=a.currentTarget.id&&setTimeout(function(){inlineEditPost.save(i),r.ajaxSetup({async:!0})},50)})}))}),r("#the-list").on("click","a.editinline",function(){var t=r(this);if(n=t.parents("tr").attr("id"),"post"===o)i=n.replace("post-","");else{if("taxonomy"!==o)return;i=n.replace("tag-","")}"post"===o&&void 0!==WPGlobusAdmin.data.tags&&r.each(WPGlobusAdmin.data.tags,function(t,a){var e,o;""==WPGlobusAdmin.data.value[a]||void 0!==(e=r("#edit-"+i+' textarea[name="'+WPGlobusAdmin.data.names[a]+'"]').val())&&(o=e.split(","),r.each(o,function(t,a){e=e.replace(a,WPGlobusCore.TextFilter(a,WPGlobusCoreData.language))}),r("#edit-"+i+' textarea[name="'+WPGlobusAdmin.data.names[a]+'"]').val(e))});var a=r("#edit-"+i+" input.ptitle").eq(0),t=a.parents("label");a.val(WPGlobusAdmin.qedit_titles[i].source),a.addClass("hidden"),r(WPGlobusAdmin.data.template).insertAfter(t),void 0===WPGlobusAdmin.qedit_titles[i]&&(WPGlobusAdmin.qedit_titles[i]={},WPGlobusAdmin.qedit_titles[i].source=r("#"+n+" .name a.row-title").text(),r(WPGlobusAdmin.data.enabled_languages).each(function(t,a){WPGlobusAdmin.qedit_titles[i][a]={},a==WPGlobusAdmin.data.default_language?WPGlobusAdmin.qedit_titles[i][a].name=WPGlobusAdmin.qedit_titles[i].source:WPGlobusAdmin.qedit_titles[i][a].name="",WPGlobusAdmin.qedit_titles[i][a].description=""})),r(".wpglobus-quick-edit-title").each(function(t,a){var e=r(a),a=e.data("language");e.attr("id",a+i),void 0!==WPGlobusAdmin.qedit_titles[i][a]&&(WPGlobusAdmin.qedit_titles[i][a].name=WPGlobusAdmin.qedit_titles[i][a].name.replace(/\\\'/g,"'"),WPGlobusAdmin.qedit_titles[i][a].name=WPGlobusAdmin.qedit_titles[i][a].name.replace(/\\\"/g,'"'),e.attr("value",WPGlobusAdmin.qedit_titles[i][a].name),WPGlobusAdmin.qedit_titles[i].source=WPGlobusCore.getString(WPGlobusAdmin.qedit_titles[i].source,WPGlobusAdmin.qedit_titles[i][a].name,a))}),r("input.ptitle").eq(0).attr("value",WPGlobusAdmin.qedit_titles[i].source)}))},taxonomy_edit:function(){var a=[];a[0]="name",a[1]="description";r.each(WPGlobusCoreData.enabled_languages,function(t,d){r.each(a,function(t,a){var e,o,n,i,l,s;o=d,n=r("#"+(e=a)),i=n.clone(),l=n.attr("name"),s="wpglobus-element wpglobus-element_"+e+" wpglobus-element_"+o+" wpglobus-translatable",a=(a=document.getElementById(e)).nodeName,r(i).attr("id",e+"_"+o),r(i).attr("name",l+"_"+o),o!==WPGlobusCoreData.default_language&&(s+=" hidden"),r(i).attr("class",s),r(i).attr("data-save-to",e),r(i).attr("data-language",o),"INPUT"==a?r(i).attr("value",r("#wpglobus-link-tab-"+o).data(e)):"TEXTAREA"==a&&r(i).text(r("#wpglobus-link-tab-"+o).data(e)),n.addClass("hidden"),0==r(".wpglobus-element_"+e).size()?r(i).insertAfter(n):r(i).insertAfter(r(".wpglobus-element_"+e).last())})}),r(".wpglobus-taxonomy-tabs").insertAfter("#ajax-response"),r(".wrap").tabs(),r("body").on("click",".wpglobus-taxonomy-tabs li",function(t){var a=r(this).data("language");r(".wpglobus-element").addClass("hidden"),r(".wpglobus-element_"+a).removeClass("hidden")}),r(".wpglobus-element").on("change",function(){var o=r(this).data("save-to"),n="";r(".wpglobus-element").each(function(t,a){var e=r(a),a=e.val();e.data("save-to")==o&&""!==a&&(n+=WPGlobusCore.addLocaleMarks(a,e.data("language")))}),r("#"+o).val(n)})},nav_menus:function(){function e(){n!==r(i).size()&&(clearInterval(o),r(i).each(function(t,a){var o,e=r(a);e.hasClass("wpglobus-menu-item")||(o=r(a).attr("id"),r.each(["input.edit-menu-item-title","input.edit-menu-item-attr-title"],function(t,a){var e=r("#"+o+" "+a),a=r(e);a.hasClass("wpglobus-hidden")||(a.addClass("wpglobus-hidden"),a.css("display","none"),e=a.parent("label"),a=a.parents("p"),r(a).css("height","80px"),r(e).append('<div style="color:#f00;">'+WPGlobusAdmin.i18n.save_nav_menu+"</div>"))}),e.addClass("wpglobus-menu-item"))}))}var o,n,i="#menu-to-edit .menu-item";r.ajaxSetup({beforeSend:function(t,a){void 0!==a.data&&0<=a.data.indexOf("action=add-menu-item")&&(n=r(i).size(),o=setInterval(e,500))}}),r(i).each(function(t,a){var e=r(a).attr("id"),u=e.replace("menu-item-","");r.each(["input.edit-menu-item-title","input.edit-menu-item-attr-title"],function(n,i){var l=r("#"+e+" "+i);l.val()!=WPGlobusAdmin.data.items[u][i].source&&l.val(WPGlobusAdmin.data.items[u][i].source);var s=r("#"+e+" "+i).parents("p"),d=0;r.each(WPGlobusAdmin.data.open_languages,function(t,a){var e=l.clone();e.attr("id",l.attr("id")+"-"+a),e.attr("name",l.attr("id")+"-"+a),e.attr("data-language",a),e.attr("data-item-id",u),e.attr("placeholder",WPGlobusAdmin.data.en_language_name[a]);var o=WPGlobusAdmin.data.items[u][a][i].class;0===n&&a===WPGlobusAdmin.data.default_language?e.attr("class",o+" edit-menu-item-title"):e.attr("class",o),""!=WPGlobusAdmin.data.items[u][a][i].caption?e.attr("value",WPGlobusAdmin.data.items[u][a][i].caption):e.attr("value",""),e.css("margin-bottom","0.6em"),r(s).append(e),d=t}),d=40*(d+1),l.css("display","none").attr("class","").addClass("widefat wpglobus-hidden"),r(s).css("height",d+"px").addClass("wpglobus-menu-item-box")}),r(a).addClass("wpglobus-menu-item")}),r(".menus-move-left, .menus-move-right").each(function(t,a){var e,o=r(a),n=(o.parents("li").attr("id").replace("menu-item-",""),o.attr("title"));void 0!==n&&r.each(WPGlobusAdmin.data.post_titles,function(t,a){0<=n.indexOf(t)&&(e=n.replace(t,a),o.attr("title",e),o.text(e))})}),r(".edit-menu-item-title").trigger("change"),wpNavMenu.refreshAdvancedAccessibility(),wpNavMenu.menusChanged=!1,r(".wpglobus-menu-item").on("change",function(){var t,a,e=r(this),o=e.data("item-id");e.hasClass("wpglobus-item-title")&&(t=WPGlobusCore.getString(r("input#edit-menu-item-title-"+o).val(),e.val(),e.data("language")),void 0!==(a=r(document).triggerHandler("wpglobus_get_menu_translations",{string:t,lang:WPGlobusCoreData.open_languages,id:o,type:"input.edit-menu-item-title"}))&&(t=a),r("input#edit-menu-item-title-"+o).val(t)),e.hasClass("wpglobus-item-attr")&&(t=WPGlobusCore.getString(r("input#edit-menu-item-attr-title-"+o).val(),e.val(),e.data("language")),void 0!==(a=r(document).triggerHandler("wpglobus_get_menu_translations",{string:t,lang:WPGlobusCoreData.open_languages,id:o,type:"input.edit-menu-item-attr-title"}))&&(t=a),r("input#edit-menu-item-attr-title-"+o).val(t))})},post_edit:function(){r(document).on("heartbeat-send",function(t,o){void 0!==o.wp_autosave&&(o.wpglobus_heartbeat="wpglobus",r.each(WPGlobusAdmin.data.open_languages,function(t,a){var e=r("#title_"+a).val()||"";""!=(e=r.trim(e))&&(o.wp_autosave["post_title_"+a]=e),e=r("#content_"+a).val()||"",""!=(e=r.trim(e))&&(o.wp_autosave["content_"+a]=e)}))});var a,i,o,t,n,e,l,s="#postdivrich",d=!0,u="#post-body-content";!1===WPGlobusAdmin.data.support.editor&&(d=!(s="#titlediv")),!1===WPGlobusAdmin.data.support.title&&(d=!1),r(u).prepend(r(".wpglobus-post-body-tabs-list")),r.each(WPGlobusAdmin.tabs,function(t,a){"default"===a?(r(s).wrap('<div id="tab-default"></div>'),d&&r(r("#titlediv")).insertBefore(s)):(r(s+"-"+a).wrap('<div id="tab-'+a+'"></div>'),d&&r(r("#titlediv-"+a)).insertBefore(s+"-"+a))}),r(u).addClass("wpglobus-post-body-tabs").tabs({beforeActivate:function(t,a){var e=a.oldTab[0].id.replace("link-tab-",""),a=a.newTab[0].id.replace("link-tab-","");"default"==e&&(e=WPGlobusCoreData.default_language),"default"==a&&(a=WPGlobusCoreData.default_language);a=r(document).triggerHandler("wpglobus_post_body_tabs",[e,a]);return!(!a&&void 0!==a)}}),r("#title").val(WPGlobusAdmin.title),r("#content").text(WPGlobusAdmin.content),"undefined"!=typeof WPGlobusVendor&&WPGlobusVendor.vendor.WPSEO&&("undefined"!=typeof wpglobus_wpseo?wpglobus_wpseo():"undefined"!=typeof WPGlobusYoastSeo&&WPGlobusYoastSeo.init()),WPGlobusAdmin.data.modify_excerpt&&((a=r("#excerpt")).addClass("hidden").css({display:"none"}),r(WPGlobusAdmin.data.template).insertAfter(a),r("body").on("change",".wpglobus-excerpt",function(){var t=r(this);a.val(WPGlobusCore.getString(a.val(),t.val(),t.data("language")))})),void 0!==wp.utils&&void 0!==wp.utils.WordCounter&&(WPGlobusCoreData.wordCounter={},i=this,r.each(WPGlobusCoreData.enabled_languages,function(t,a){return a==WPGlobusCoreData.default_language||(e=jQuery,o=new wp.utils.WordCounter,n=a,WPGlobusCoreData.wordCounter[n]={},WPGlobusCoreData.wordCounter[n].counter=o,void e(function(){function o(t){var a;"object"==typeof t&&(t="tinymce"==t?i.getCurrentTab():t.target.id.replace("content_","")),void 0!==WPGlobusCoreData.wordCounter[t]&&(a=!WPGlobusCoreData.wordCounter[t].contentEditor||WPGlobusCoreData.wordCounter[t].contentEditor.isHidden()?WPGlobusCoreData.wordCounter[t].content.val():WPGlobusCoreData.wordCounter[t].contentEditor.getContent({format:"raw"}),(a=WPGlobusCoreData.wordCounter[t].counter.count(a))!==WPGlobusCoreData.wordCounter[t].prevCount&&WPGlobusCoreData.wordCounter[t].count.text(a),WPGlobusCoreData.wordCounter[t].prevCount=a)}WPGlobusCoreData.wordCounter[n].content=e("#content_"+n),WPGlobusCoreData.wordCounter[n].count=e("#wp-word-count-"+n).find(".word-count-"+n),WPGlobusCoreData.wordCounter[n].prevCount=0,e(document).on("tinymce-editor-init",function(t,a){var e;-1!=a.id.indexOf("content_")&&(e=a.id.replace("content_",""),(WPGlobusCoreData.wordCounter[e].contentEditor=a).on("nodechange keyup",_.debounce(o,1e3)))}),WPGlobusCoreData.wordCounter[n].content.on("input keyup",_.debounce(o,1e3)),o(n)}));var e,o,n})),"undefined"!=typeof wpWordCount&&(o=0,t=WPGlobusCoreData.open_languages,n=this.$document,e={},t.shift(),r.each(WPGlobusCoreData.open_languages,function(t,a){e[a]=0}),l={settings:{strip:/<[a-zA-Z\/][^<>]*>/g,clean:/[0-9.(),;:!?%#$¿'"_+=\\/-]+/g,w:/\S\s+/g,c:/\S/g},block:e,wc:function(t,a,e){var o=this,n=0,i=a==WPGlobusCoreData.default_language?r(".word-count"):r(".word-count-"+a);"w"!==(e=void 0===e?wordCountL10n.type:e)&&"c"!==e&&(e="w"),o.block[a]||(o.block[a]=1,setTimeout(function(){t&&(t=(t=t.replace(o.settings.strip," ").replace(/ | /gi," ")).replace(o.settings.clean,"")).replace(o.settings[e],function(){n++}),i.html(n.toString()),setTimeout(function(){o.block[a]=0},2e3)},1))}},n.bind("wpglobuscountwords",function(t,a,e){l.wc(a,e)}),r.each(t,function(t,a){var e=r("#content_"+a);n.triggerHandler("wpglobuscountwords",[e.val(),a]),e.keyup(function(t){t=t.keyCode||t.charCode;return t==o||(13!=t&&8!=o&&46!=o||n.triggerHandler("wpglobuscountwords",[e.val(),a]),o=t),!0})}),r(document).triggerHandler("wpglobuscountwords",[r("#content").val(),WPGlobusCoreData.default_language])),r("body").on("click","#publish, #save-post",function(){var e,t,o,n;1<WPGlobusAdmin.data.open_languages.length&&(r(document).triggerHandler("wpglobus_before_save_post",{content_tabs_id:u}),e=r("#title").val(),n=o="",0==e.length&&(t=WPGlobusAdmin.data.open_languages.indexOf(WPGlobusAdmin.data.default_language),WPGlobusAdmin.data.open_languages.splice(t,1),r(WPGlobusAdmin.data.open_languages).each(function(t,a){n=0==t?"":"-",0<(e=r("#title_"+a).val()).length&&(0==o.length&&(n=""),o=o+n+e)})),0<o.length&&r("#title").val(o)),void 0===WPGlobusAdmin.data.tagsdiv||WPGlobusAdmin.data.tagsdiv.length<1||r(WPGlobusAdmin.data.tagsdiv).each(function(t,a){if(0==r("#"+a).size())return!0;var e=a.replace("tagsdiv-","");if("undefined"===e)return!0;if(0==r("#tax-input-"+e).size())return!0;var o,n=[];r("#tagsdiv-"+e+" .tagchecklist span").each(function(t,a){o=(o=r(a).text()).replace("X","").trim(" "),void 0===WPGlobusAdmin.data.tag[e][o]?n[t]=o:n[t]=WPGlobusAdmin.data.tag[e][o]}),r("#tax-input-"+e).val(n.join(", "))})}),r(".ui-state-default").on("click",function(){"link-tab-default"===r(this).attr("id")&&(r(window).scrollTop(r(window).scrollTop()+1),r(window).scrollTop(r(window).scrollTop()-1))})},adminCentral:function(){r(".wpglobus-admin-central-tab").css({display:"none"}),1<r(".nav-tab-active").length&&r(".wpglobus-about-wrap .nav-tab-wrapper a").removeClass("nav-tab-active");var e=!0;0==location.hash.indexOf("#")&&r(".wpglobus-about-wrap .nav-tab-wrapper a").each(function(t,a){r(a).attr("href")==location.hash&&(e=!1,r(a).addClass("nav-tab-active"))}),e&&r(".wpglobus-about-wrap .nav-tab-wrapper a").eq(0).addClass("nav-tab-active");var t=r(".wpglobus-about-wrap .nav-tab-active").data("tab-id");""!=t&&r("#"+t).css({display:"block"}),r(document).on("click",".wpglobus-about-wrap .nav-tab",function(t){var a=r(this);a.hasClass("nav-tab-active")||(r(".wpglobus-admin-central-tab").css({display:"none"}),r(".wpglobus-about-wrap .nav-tab").removeClass("nav-tab-active"),a.addClass("nav-tab-active"),""!=a.data("tab-id")&&r("#"+a.data("tab-id")).css({display:"block"}))})},start:function(){var a=this;r("#wpglobus_flags").select2({formatResult:this.format,formatSelection:this.format,minimumResultsForSearch:-1,escapeMarkup:function(t){return t}}),r("body").on("click","#enabled_languages-list li:first input",function(t){return t.preventDefault(),r(".redux-save-warn").css({display:"none"}),r("#enabled_languages-list").find("li:first > input").val("1"),0===r("#disable_first_language").length&&r(a.config.disable_first_language).insertAfter("#info_bar"),!1})},format:function(t){return'<img class="wpglobus_flag" src="'+WPGlobusAdmin.flag_url+t.text+'"/> '+t.text},set_dialog:function(){var o,a,n;void 0!==WPGlobusAdmin.data.customFieldsEnabled&&(WPGlobusAdmin.data.customFieldsEnabled=this.parseBool(WPGlobusAdmin.data.customFieldsEnabled),!WPGlobusAdmin.data.customFieldsEnabled)||(a=!1,(n=function(t){var l,s,d="wpglobus_dialog_start wpglobus_dialog_icon",u=['<div class="wpglobus_dialog_options_wrapper hidden">','<input style="width:initial;" id="wpglobus-cb-{{id}}" data-object="#wpglobus-dialog-start-{{id}}" data-meta-key="{{meta-key}}" class="wpglobus_dialog_option wpglobus_dialog_cb" type="checkbox" {{checked}} />',"</div>"].join(""),t=void 0===t?"#the-list tr":"#the-list tr#"+t;r(t).each(function(){var t,a,e=r(this),o=e.attr("id"),n=e.find("textarea"),i=d;if(void 0===(l=n.attr("id")))return!0;a=r("#"+o+"-key").val(),t=r("#"+l).clone(),r(n).addClass("wpglobus-dialog-field-source hidden"),o=n.attr("name"),r(t).attr("id","wpglobus-"+l),r(t).attr("name","wpglobus-"+o),r(t).attr("data-source-id",l),r(t).attr("class","wpglobus-dialog-field"),r(t).val(WPGlobusCore.TextFilter(r(n).val(),WPGlobusCoreData.language)),r(t).insertAfter(n),s=(s=u.replace(/{{id}}/g,l)).replace(/{{meta-key}}/g,a),void 0===WPGlobusAdmin.data.post_meta_settings[WPGlobusAdmin.data.post_type]?s=s.replace(/{{checked}}/,"checked"):i=void 0!==WPGlobusAdmin.data.post_meta_settings[WPGlobusAdmin.data.post_type][a]&&"false"==WPGlobusAdmin.data.post_meta_settings[WPGlobusAdmin.data.post_type][a]?(s=s.replace(/{{checked}}/,""),d+" wpglobus_dialog_start_hidden"):(s=s.replace(/{{checked}}/,"checked"),d),e.append('<td style="width:20px;"><div id="wpglobus-dialog-start-'+l+'" data-type="control" data-source-type="textarea" data-source-id="'+l+'" class="'+i+'"></div>'+s+"</td>")}),!a&&0<r("#list-table .wpglobus_dialog_start").length&&(r("#list-table thead tr").append('<th class="wpglobus-control-head"><div class="wpglobus_dialog_settings wpglobus_dialog_icon"></div></th>'),a=!0)})(),r("body").on("change",".wpglobus-dialog-field",function(){var e,o,n=r(this),t="#"+n.data("source-id"),i="";e=r(t).val(),/(\{:|\[:|<!--:)[a-z]{2}/.test(e)?(r.each(WPGlobusCoreData.enabled_languages,function(t,a){""!=(o=a==WPGlobusCoreData.language?n.val():WPGlobusCore.TextFilter(e,a,"RETURN_EMPTY"))&&(i+=WPGlobusCore.addLocaleMarks(o,a))}),r(t).val(i)):r(t).val(n.val())}),r(document).ajaxSend(function(t,a,e){"add-meta"==e.action&&(o=e.element)}),r(document).ajaxComplete(function(t,a,e){"add-meta"==e.action&&void 0!==a.responseXML&&n("newmeta"==o?"meta-"+r(a.responseXML.documentElement.outerHTML).find("meta").attr("id"):o)}),WPGlobusDialogApp.init({dialogTitle:"Edit meta"}))}},new t.App,t)});
|
includes/js/wpglobus-customize-control.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var WPGlobusCustomize;jQuery(document).ready(function(l){"use strict";var s;void 0!==WPGlobusCoreData.customize&&(s={languages:{},index:0,length:0,positionSet:!1,selectorHtml:'<span style="margin-left:5px;" class="wpglobus-icon-globe"></span><span style="font-weight:bold;">{{language}}</span>',init:function(e){l.each(WPGlobusCoreData.enabled_languages,function(e,t){s.languages[e]=t,s.length=e}),s.addLanguageSelector(),s.setElements(),s.addListeners()},setTitle:function(){l(WPGlobusCoreData.customize.info.element).html(WPGlobusCoreData.customize.info.html)},getString:function(e){var
|
1 |
+
var WPGlobusCustomize;jQuery(document).ready(function(l){"use strict";var s;void 0!==WPGlobusCoreData.customize&&(s={languages:{},index:0,length:0,positionSet:!1,selectorHtml:'<span style="margin-left:5px;" class="wpglobus-icon-globe"></span><span style="font-weight:bold;">{{language}}</span>',init:function(e){l.each(WPGlobusCoreData.enabled_languages,function(e,t){s.languages[e]=t,s.length=e}),s.addLanguageSelector(),s.setElements(),s.addListeners()},setTitle:function(){l(WPGlobusCoreData.customize.info.element).html(WPGlobusCoreData.customize.info.html)},getString:function(e){var e=WPGlobusCore.getTranslations(e),o=[],a=0;return l.each(e,function(e,t){o[a]=""==t?"null":t,a++}),o=o.join(":::")},setElements:function(){var a;s.setTitle(),l.each(WPGlobusCoreData.customize.addElements,function(e,t){var o=l(t.element);o.attr("id",e).val(t.value).trigger("change"),"textarea"==t.type&&void 0!==t.textarea_attrs&&o.addClass(t.textarea_attrs.class),void 0!==t.options&&(void 0!==t.options.setValue&&t.options.setValue&&(a=l(t.origin_element).val(),o.data("source",a),o.val(WPGlobusCore.TextFilter(a,WPGlobusCoreData.language,"RETURN_EMPTY")),o.hasClass("wpglobus-control-url")&&l(t.origin_element).val(s.getString(a))),void 0!==t.options.setLabel&&t.options.setLabel&&(l(t.title).text(l(t.origin_title).text()),l(t.description).text(l(t.origin_description).text()))),o.on("change",function(e){var t=l(this),o=l(WPGlobusCoreData.customize.addElements[l(this).data("customize-setting-link")].origin_element);t.data("source",WPGlobusCore.getString(t.data("source"),t.val())),t.hasClass("wpglobus-control-url")?o.val(s.getString(t.data("source"))):o.val(WPGlobusCore.getString(o.val(),t.val())),t.hasClass("wpglobus-not-trigger-change")||o.trigger("change")})})},addLanguageSelector:function(){l('<a style="margin-left:48px;" class="customize-controls-close wpglobus-customize-selector"><span class="wpglobus-globe"></span></a>').insertAfter(".customize-controls-preview-toggle"),l(".wpglobus-customize-selector").html(s.selectorHtml.replace("{{language}}",WPGlobusCoreData.language))},setPosition:function(e){void 0!==e.options.setPosition&&e.options.setPosition&&(l(e.parent).detach().insertBefore(e.origin_parent),l(e.parent).css({display:"block"}))},addListeners:function(){l(document).on("click",".control-section",function(e){s.positionSet||(s.positionSet=!0,l.each(WPGlobusCoreData.customize.addElements,function(e,t){l(t.origin_parent).css({display:"none"}),l(t.origin_parent+" label").css({display:"none"}),void 0!==t.options&&s.setPosition(t)}))}),l(document).on("click",".wpglobus-customize-selector",function(e){s.index>s.length-1?s.index=0:s.index++,WPGlobusCoreData.language=s.languages[s.index],l(this).html(s.selectorHtml.replace("{{language}}",WPGlobusCoreData.language)),l(".wpglobus-customize-control").each(function(e,t){var o;void 0!==WPGlobusCoreData.customize.addElements[l(t).data("customize-setting-link")]&&(o=l(WPGlobusCoreData.customize.addElements[l(t).data("customize-setting-link")].origin_element),(t=l(t)).hasClass("wpglobus-control-url")?t.val(WPGlobusCore.TextFilter(t.data("source"),WPGlobusCoreData.language,"RETURN_EMPTY")):t.val(WPGlobusCore.TextFilter(o.val(),WPGlobusCoreData.language,"RETURN_EMPTY")))})}),l(document).ajaxSend(function(e,t,o){var a,s,n,i;void 0!==o.data&&0<=o.data.indexOf("action=customize_save")&&(a=o.data.split("&"),l.each(a,function(e,t){"customized"==(s=t.split("="))[0]&&(n=s[1])}),i=decodeURIComponent(n),i=JSON.parse(i),l.each(WPGlobusCoreData.customize.addElements,function(e,t){void 0!==i[e]&&(i[t.origin]=l(WPGlobusCoreData.customize.addElements[e].origin_element).val())}),o.data=o.data.replace(n,JSON.stringify(i)))})}},(WPGlobusCustomize=l.extend({},WPGlobusCustomize,s)).init())});
|
includes/js/wpglobus-customize-control140.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
jQuery(document).ready(function(a){"use strict";var c={languages:{},index:0,length:0,controlInstances:{},controlWidgets:{},instancesKeep:!1,widgetKeep:!1,action:!1,selectorHtml:'<span style="margin-left:5px;" class="wpglobus-icon-globe"></span><span style="font-weight:bold;">{{language}}</span>',init:function(t){c.setTitle(),"false"!=WPGlobusCustomizeOptions.themeEnabled&&(a.each(WPGlobusCoreData.enabled_languages,function(t,e){c.languages[t]=e,c.length=t}),c.addLanguageSelector(),c.setControlInstances(),c.setFieldsSection(),c.attachListeners())},setFieldsSection:function(){var o={},n=a(".wpglobus-fields_settings_control_box").data("section-template"),s="",l="",i="";a.each(WPGlobusCustomize.controlInstances,function(t,e){void 0===o[e.section]&&(o[e.section]={}),o[e.section][t]=e}),a.each(o,function(t,e){l="<ul>",a.each(e,function(t,e){i=e.userControl.enabled?" checked ":"",l+='<li><input id="wpglobus-cb-control-'+t+'" data-control="'+t+'" class="wpglobus-customize-cb-control" type="checkbox"'+i+" /> "+e.title+"</li>"}),l+="</ul>",s=(s=(s=(s=n.replace("{{section_title}}",wp.customize.section(t).params.title)).replace(/{{section}}/g,t)).replace("{{section_id}}",'"'+t+'"')).replace("{{items}}",l),a(s).insertBefore(a("#"+WPGlobusCustomizeOptions.userControlSaveButton))}),a("#accordion-section-wpglobus_fields_settings_section").css({"margin-top":"15px"}),a(WPGlobusCustomizeOptions.helpButton).insertAfter(a("#accordion-section-wpglobus_fields_settings_section .customize-action")),a("#accordion-section-wpglobus_fields_settings_section .customize-section-description").addClass("hidden"),a("."+WPGlobusCustomizeOptions.userControlIconClass).on("click",function(t){var o=a(this).data("section");a(WPGlobusCustomizeOptions.userControlBoxSelector).each(function(t,e){o==a(e).data("section")?a(this).css({display:"block"}):a(this).css({display:"none"})}),wp.customize.control("wpglobus_fields_settings_section").expand()}),a(".wpglobus-customize-icon-help.customize-help-toggle").on("click",function(t){a("#accordion-section-wpglobus_fields_settings_section .customize-section-description").toggleClass("hidden")})},setUserControls:function(t,e){var o=e.controlSelector+" "+e.selector,n='<img class="'+WPGlobusCustomizeOptions.userControlIconClass+'" data-section="'+e.section+'" style="position:absolute;right:0px;" src="'+WPGlobusCustomizeOptions.userControlIcon+'" />';a(n).insertBefore(o),e.userControl.enabled||(1<a(o).length?a(o).each(function(t,e){a(e).removeClass(WPGlobusCustomize.controlClass)}):a(o).removeClass(WPGlobusCustomize.controlClass).val(e.setting))},ctrlMenuItemsCallback:function(t,e){},ctrlWidgetCallback:function(l,i){var t;c.action=!1,void 0===c.controlWidgets[l].element&&(void 0===i&&(i=wp.customize.control.instance(l)),c.controlWidgets[l].element={},c.controlWidgets[l].control=i,c.controlWidgets[l].inWidgetTitle=i.container.find(".in-widget-title"),0!=(t=i.container.find("input[type=submit]")).length&&(t.css({display:"block"}),t.attr("data-widget",l),c.controlWidgets[l].submit=t,c.attachWidgetListeners(c.controlWidgets[l])),i.liveUpdateMode=!1,void 0===i.setting().title?c.controlWidgets[l].inWidgetTitle.text(""):c.controlWidgets[l].inWidgetTitle.text(": "+WPGlobusCore.TextFilter(i.setting().title,WPGlobusCustomize.languageAdmin)),a.each(WPGlobusCustomize.elementSelector,function(t,n){var s=i.container.find(n);0!=s.length&&a.each(s,function(t,e){if(void 0===e.id||""==e.id)return!0;var o=a(s[t]);void 0===c.controlWidgets[l].element[e.id]&&(c.controlWidgets[l].element[e.id]={}),o.addClass("wpglobus-customize-widget-control"),o.attr("data-widget",l),c.controlWidgets[l].element[e.id].element=o,c.controlWidgets[l].element[e.id].setting=i.setting(),c.controlWidgets[l].element[e.id].selector=n,c.controlWidgets[l].element[e.id].value=e.defaultValue,o.val(WPGlobusCore.TextFilter(e.defaultValue,WPGlobusCoreData.language,"RETURN_EMPTY"))})}),a(document).triggerHandler("wpglobus_customize_control_added_widget",[l]))},ctrlCallback:function(o,n,t){var s=!1;if(a.each(WPGlobusCustomize.disabledSections,function(t,e){if(o.section()==e)return!(s=!0)}),!s&&(a.each(WPGlobusCustomize.disabledSettingMask,function(t,e){if(0<=n.indexOf(e))return!(s=!0)}),!s)){var l,i=wp.customize.control.instance(n);if(0<=n.indexOf("widget"))return void 0===c.controlWidgets[n]&&(c.controlWidgets[n]={},c.action&&c.ctrlWidgetCallback(n,i)),c.controlWidgets[n].parent=i.selector,!1;void 0===c.controlInstances[n]&&(l=!0,a.each(WPGlobusCustomize.elementSelector,function(t,e){var o=i.container.find(e);0!=o.length&&(c.controlInstances[n]={},c.controlInstances[n].element=o,c.controlInstances[n].setting=i.setting(),c.controlInstances[n].selector=e,c.controlInstances[n].controlSelector=i.selector,c.controlInstances[n].type="",c.controlInstances[n].section=i.section(),c.controlInstances[n].title=null,c.controlInstances[n].userControl=null,a.each(WPGlobusCustomize.setLinkBy,function(t,e){0<=n.indexOf(e)&&(c.controlInstances[n].type="link",""==c.controlInstances[n].setting&&(c.controlInstances[n].setting=o[0].defaultValue),o.addClass("wpglobus-control-link"))}),""===c.controlInstances[n].type&&(c.controlInstances[n].type="textarea"==e?"textarea":"text"),o.val(WPGlobusCore.TextFilter(c.controlInstances[n].setting,WPGlobusCoreData.language,"RETURN_EMPTY")),o.addClass("wpglobus-customize-control"),o.attr("data-wpglobus-customize-control",c.controlInstances[n].controlSelector.replace("#customize-control-","")),"link"==c.controlInstances[n].type&&(c.controlInstances[n].setting=c.convertString(o[0].defaultValue)),c.controlInstances[n].title=a(i.selector+" .customize-control-title").text(),null!==WPGlobusCustomizeOptions.userControl&&void 0!==WPGlobusCustomizeOptions.userControl[WPGlobusCustomizeOptions.themeName]&&void 0!==WPGlobusCustomizeOptions.userControl[WPGlobusCustomizeOptions.themeName][n]&&"disable"==WPGlobusCustomizeOptions.userControl[WPGlobusCustomizeOptions.themeName][n]&&(l=!1),c.controlInstances[n].userControl={},c.controlInstances[n].userControl.enabled=l,c.setUserControls(n,c.controlInstances[n]))}))}},setControlInstances:function(){wp.customize.control.each(c.ctrlCallback)},setTitle:function(){a(WPGlobusCoreData.customize.info.element).html(WPGlobusCoreData.customize.info.html)},convertString:function(t){if(void 0===t)return t;var o=[],e=WPGlobusCore.getTranslations(t),n=0,s=!0;return a.each(e,function(t,e){""==e?o[n]="null":(s=!1,o[n]=e),n++}),s?"":o.join("|||")},getTranslations:function(t){var o={},n=t.split("|||");return a.each(WPGlobusCoreData.enabled_languages,function(t,e){o[e]="undefined"===n[t]||"null"===n[t]?"":n[t]}),o},getString:function(t,o,n){if(void 0===t)return t;void 0===o&&(o=""),void 0===n&&(n=WPGlobusCoreData.language);var e=c.getTranslations(t),s=[],l=0;return a.each(e,function(t,e){s[l]=t==n?o:""==e?"null":e,l++}),s=s.join("|||")},addLanguageSelector:function(){a(WPGlobusCustomize.selectorButton).insertAfter(".customize-controls-preview-toggle"),a(".wpglobus-customize-selector").html(c.selectorHtml.replace("{{language}}",WPGlobusCoreData.language)),a(document).on("click",".wpglobus-customize-selector",function(t){c.index>c.length-1?c.index=0:c.index++,WPGlobusCoreData.language=c.languages[c.index],a(this).html(c.selectorHtml.replace("{{language}}",WPGlobusCoreData.language)),a(document).triggerHandler("wpglobus_customize_control_language",[WPGlobusCoreData.language]),a(".wpglobus-customize-control").each(function(t,e){var o,n=a(e),s=n.data("customize-setting-link");void 0===WPGlobusCustomize.controlInstances[s]&&(s=n.data("wpglobus-customize-control"),void 0===WPGlobusCustomize.controlInstances[s])||(n.hasClass("wpglobus-control-link")?(o=c.getTranslations(WPGlobusCustomize.controlInstances[s].setting),n.val(o[WPGlobusCoreData.language])):n.val(WPGlobusCore.TextFilter(WPGlobusCustomize.controlInstances[s].setting,WPGlobusCoreData.language,"RETURN_EMPTY")))}),a(".wpglobus-customize-widget-control").each(function(t,e){var o=a(e),n=o.data("widget");if(void 0===o.attr("id"))return!0;o.val(WPGlobusCore.TextFilter(WPGlobusCustomize.controlWidgets[n].element[o.attr("id")].value,WPGlobusCoreData.language,"RETURN_EMPTY"))})})},updateElements:function(s){void 0===s&&(s=!0),a.each(WPGlobusCustomize.controlInstances,function(t,e){if(!e.userControl.enabled)return!0;var o,n=wp.customize.control.instance(t);"link"==e.type?(o=c.getTranslations(WPGlobusCustomize.controlInstances[t].setting),s?(n.setting.set(o[WPGlobusCoreData.language]),e.element.val(n.setting())):e.element.val(o[WPGlobusCoreData.language])):s?(n.setting.set(WPGlobusCore.TextFilter(WPGlobusCustomize.controlInstances[t].setting,WPGlobusCoreData.language,"RETURN_EMPTY")),e.element.val(n.setting())):e.element.val(WPGlobusCore.TextFilter(WPGlobusCustomize.controlInstances[t].setting,WPGlobusCoreData.language,"RETURN_EMPTY"))})},onSubmitEvents:function(t){"mouseenter"==t.type?a.each(c.controlWidgets[a(this).data("widget")].element,function(t,e){a("#"+t).val(e.value)}):"mouseleave"==t.type?c.widgetKeep||a.each(c.controlWidgets[a(this).data("widget")].element,function(t,e){a("#"+t).val(WPGlobusCore.TextFilter(e.value,WPGlobusCoreData.language,"RETURN_EMPTY"))}):"click"==t.type&&(c.widgetKeep=!0)},attachWidgetListeners:function(t){void 0!==t.submit[0].id&&a(document).on("mouseenter","#"+t.submit[0].id,c.onSubmitEvents).on("mouseleave","#"+t.submit[0].id,c.onSubmitEvents).on("click","#"+t.submit[0].id,c.onSubmitEvents)},attachListeners:function(){a(".wpglobus-customize-control").on("keyup",function(t){var e=a(this),o=e.data("customize-setting-link");void 0===WPGlobusCustomize.controlInstances[o]&&(o=e.data("wpglobus-customize-control"),void 0===WPGlobusCustomize.controlInstances[o])||("link"==WPGlobusCustomize.controlInstances[o].type?WPGlobusCustomize.controlInstances[o].setting=c.getString(WPGlobusCustomize.controlInstances[o].setting,e.val(),WPGlobusCoreData.language):WPGlobusCustomize.controlInstances[o].setting=WPGlobusCore.getString(WPGlobusCustomize.controlInstances[o].setting,e.val(),WPGlobusCoreData.language))}),a(document).on("keyup",".wpglobus-customize-widget-control",function(t){var e=a(this),o=e.data("widget");void 0!==WPGlobusCustomize.controlWidgets[o]&&(WPGlobusCustomize.controlWidgets[o].element[e.attr("id")].value=WPGlobusCore.getString(WPGlobusCustomize.controlWidgets[o].element[e.attr("id")].value,e.val(),WPGlobusCoreData.language))}),a("#save").on("mouseenter",function(t){a.each(WPGlobusCustomize.controlInstances,function(t,e){var o;e.userControl.enabled&&((o=wp.customize.control.instance(t)).setting.set(e.setting),e.element.val(o.setting()))})}).on("mouseleave",function(t){c.instancesKeep||c.updateElements()}).on("click",function(t){c.instancesKeep=!0}),a(document).on("ajaxComplete",function(t,n){void 0!==n.responseText&&('{"success":true,"data":[]}'==n.responseText?c.updateElements(!1):(0<=n.responseText.indexOf("WP_CUSTOMIZER_SIGNATURE")&&(c.action="customizerAjaxComplete",c.setControlInstances()),a.each(WPGlobusCustomize.controlWidgets,function(t,e){var o=t.replace("_","-");if(0<=n.responseText.indexOf(o))return e.submit.css({display:"block"}),e.control.liveUpdateMode=!1,a.each(e.element,function(t,e){a("#"+t).val(WPGlobusCore.TextFilter(e.value,WPGlobusCoreData.language,"RETURN_EMPTY"))}),e.inWidgetTitle.text(": "+WPGlobusCore.TextFilter(e.control.setting().title,WPGlobusCustomize.languageAdmin)),c.widgetKeep=!1})))}),a(document).on("click",".widget-title, .widget-title-action",function(t){var o=a(this).parents(".customize-control-widget_form").attr("id");a.each(c.controlWidgets,function(t,e){if("#"+o==e.parent)return c.ctrlWidgetCallback(t),!1})})}};WPGlobusCustomize=a.extend({},WPGlobusCustomize,c),WPGlobusCustomize.init()});
|
1 |
+
jQuery(document).ready(function(a){"use strict";var c={languages:{},index:0,length:0,controlInstances:{},controlWidgets:{},instancesKeep:!1,widgetKeep:!1,action:!1,selectorHtml:'<span style="margin-left:5px;" class="wpglobus-icon-globe"></span><span style="font-weight:bold;">{{language}}</span>',init:function(t){c.setTitle(),"false"!=WPGlobusCustomizeOptions.themeEnabled&&(a.each(WPGlobusCoreData.enabled_languages,function(t,e){c.languages[t]=e,c.length=t}),c.addLanguageSelector(),c.setControlInstances(),c.setFieldsSection(),c.attachListeners())},setFieldsSection:function(){var o={},n=a(".wpglobus-fields_settings_control_box").data("section-template"),s="",l="",i="";a.each(WPGlobusCustomize.controlInstances,function(t,e){void 0===o[e.section]&&(o[e.section]={}),o[e.section][t]=e}),a.each(o,function(t,e){l="<ul>",a.each(e,function(t,e){i=e.userControl.enabled?" checked ":"",l+='<li><input id="wpglobus-cb-control-'+t+'" data-control="'+t+'" class="wpglobus-customize-cb-control" type="checkbox"'+i+" /> "+e.title+"</li>"}),l+="</ul>",s=(s=(s=(s=n.replace("{{section_title}}",wp.customize.section(t).params.title)).replace(/{{section}}/g,t)).replace("{{section_id}}",'"'+t+'"')).replace("{{items}}",l),a(s).insertBefore(a("#"+WPGlobusCustomizeOptions.userControlSaveButton))}),a("#accordion-section-wpglobus_fields_settings_section").css({"margin-top":"15px"}),a(WPGlobusCustomizeOptions.helpButton).insertAfter(a("#accordion-section-wpglobus_fields_settings_section .customize-action")),a("#accordion-section-wpglobus_fields_settings_section .customize-section-description").addClass("hidden"),a("."+WPGlobusCustomizeOptions.userControlIconClass).on("click",function(t){var o=a(this).data("section");a(WPGlobusCustomizeOptions.userControlBoxSelector).each(function(t,e){o==a(e).data("section")?a(this).css({display:"block"}):a(this).css({display:"none"})}),wp.customize.control("wpglobus_fields_settings_section").expand()}),a(".wpglobus-customize-icon-help.customize-help-toggle").on("click",function(t){a("#accordion-section-wpglobus_fields_settings_section .customize-section-description").toggleClass("hidden")})},setUserControls:function(t,e){var o=e.controlSelector+" "+e.selector,n='<img class="'+WPGlobusCustomizeOptions.userControlIconClass+'" data-section="'+e.section+'" style="position:absolute;right:0px;" src="'+WPGlobusCustomizeOptions.userControlIcon+'" />';a(n).insertBefore(o),e.userControl.enabled||(1<a(o).length?a(o).each(function(t,e){a(e).removeClass(WPGlobusCustomize.controlClass)}):a(o).removeClass(WPGlobusCustomize.controlClass).val(e.setting))},ctrlMenuItemsCallback:function(t,e){},ctrlWidgetCallback:function(s,l){var t;c.action=!1,void 0===c.controlWidgets[s].element&&(void 0===l&&(l=wp.customize.control.instance(s)),c.controlWidgets[s].element={},c.controlWidgets[s].control=l,c.controlWidgets[s].inWidgetTitle=l.container.find(".in-widget-title"),0!=(t=l.container.find("input[type=submit]")).length&&(t.css({display:"block"}),t.attr("data-widget",s),c.controlWidgets[s].submit=t,c.attachWidgetListeners(c.controlWidgets[s])),l.liveUpdateMode=!1,void 0===l.setting().title?c.controlWidgets[s].inWidgetTitle.text(""):c.controlWidgets[s].inWidgetTitle.text(": "+WPGlobusCore.TextFilter(l.setting().title,WPGlobusCustomize.languageAdmin)),a.each(WPGlobusCustomize.elementSelector,function(t,o){var n=l.container.find(o);0!=n.length&&a.each(n,function(t,e){if(void 0===e.id||""==e.id)return!0;t=a(n[t]);void 0===c.controlWidgets[s].element[e.id]&&(c.controlWidgets[s].element[e.id]={}),t.addClass("wpglobus-customize-widget-control"),t.attr("data-widget",s),c.controlWidgets[s].element[e.id].element=t,c.controlWidgets[s].element[e.id].setting=l.setting(),c.controlWidgets[s].element[e.id].selector=o,c.controlWidgets[s].element[e.id].value=e.defaultValue,t.val(WPGlobusCore.TextFilter(e.defaultValue,WPGlobusCoreData.language,"RETURN_EMPTY"))})}),a(document).triggerHandler("wpglobus_customize_control_added_widget",[s]))},ctrlCallback:function(o,n,t){var s=!1;if(a.each(WPGlobusCustomize.disabledSections,function(t,e){if(o.section()==e)return!(s=!0)}),!s&&(a.each(WPGlobusCustomize.disabledSettingMask,function(t,e){if(0<=n.indexOf(e))return!(s=!0)}),!s)){var l,i=wp.customize.control.instance(n);if(0<=n.indexOf("widget"))return void 0===c.controlWidgets[n]&&(c.controlWidgets[n]={},c.action&&c.ctrlWidgetCallback(n,i)),c.controlWidgets[n].parent=i.selector,!1;void 0===c.controlInstances[n]&&(l=!0,a.each(WPGlobusCustomize.elementSelector,function(t,e){var o=i.container.find(e);0!=o.length&&(c.controlInstances[n]={},c.controlInstances[n].element=o,c.controlInstances[n].setting=i.setting(),c.controlInstances[n].selector=e,c.controlInstances[n].controlSelector=i.selector,c.controlInstances[n].type="",c.controlInstances[n].section=i.section(),c.controlInstances[n].title=null,c.controlInstances[n].userControl=null,a.each(WPGlobusCustomize.setLinkBy,function(t,e){0<=n.indexOf(e)&&(c.controlInstances[n].type="link",""==c.controlInstances[n].setting&&(c.controlInstances[n].setting=o[0].defaultValue),o.addClass("wpglobus-control-link"))}),""===c.controlInstances[n].type&&(c.controlInstances[n].type="textarea"==e?"textarea":"text"),o.val(WPGlobusCore.TextFilter(c.controlInstances[n].setting,WPGlobusCoreData.language,"RETURN_EMPTY")),o.addClass("wpglobus-customize-control"),o.attr("data-wpglobus-customize-control",c.controlInstances[n].controlSelector.replace("#customize-control-","")),"link"==c.controlInstances[n].type&&(c.controlInstances[n].setting=c.convertString(o[0].defaultValue)),c.controlInstances[n].title=a(i.selector+" .customize-control-title").text(),null!==WPGlobusCustomizeOptions.userControl&&void 0!==WPGlobusCustomizeOptions.userControl[WPGlobusCustomizeOptions.themeName]&&void 0!==WPGlobusCustomizeOptions.userControl[WPGlobusCustomizeOptions.themeName][n]&&"disable"==WPGlobusCustomizeOptions.userControl[WPGlobusCustomizeOptions.themeName][n]&&(l=!1),c.controlInstances[n].userControl={},c.controlInstances[n].userControl.enabled=l,c.setUserControls(n,c.controlInstances[n]))}))}},setControlInstances:function(){wp.customize.control.each(c.ctrlCallback)},setTitle:function(){a(WPGlobusCoreData.customize.info.element).html(WPGlobusCoreData.customize.info.html)},convertString:function(t){if(void 0===t)return t;var o=[],t=WPGlobusCore.getTranslations(t),n=0,s=!0;return a.each(t,function(t,e){""==e?o[n]="null":(s=!1,o[n]=e),n++}),s?"":o.join("|||")},getTranslations:function(t){var o={},n=t.split("|||");return a.each(WPGlobusCoreData.enabled_languages,function(t,e){o[e]="undefined"===n[t]||"null"===n[t]?"":n[t]}),o},getString:function(t,o,n){if(void 0===t)return t;void 0===o&&(o=""),void 0===n&&(n=WPGlobusCoreData.language);var t=c.getTranslations(t),s=[],l=0;return a.each(t,function(t,e){s[l]=t==n?o:""==e?"null":e,l++}),s=s.join("|||")},addLanguageSelector:function(){a(WPGlobusCustomize.selectorButton).insertAfter(".customize-controls-preview-toggle"),a(".wpglobus-customize-selector").html(c.selectorHtml.replace("{{language}}",WPGlobusCoreData.language)),a(document).on("click",".wpglobus-customize-selector",function(t){c.index>c.length-1?c.index=0:c.index++,WPGlobusCoreData.language=c.languages[c.index],a(this).html(c.selectorHtml.replace("{{language}}",WPGlobusCoreData.language)),a(document).triggerHandler("wpglobus_customize_control_language",[WPGlobusCoreData.language]),a(".wpglobus-customize-control").each(function(t,e){var o=a(e),n=o.data("customize-setting-link");void 0===WPGlobusCustomize.controlInstances[n]&&(n=o.data("wpglobus-customize-control"),void 0===WPGlobusCustomize.controlInstances[n])||(o.hasClass("wpglobus-control-link")?(e=c.getTranslations(WPGlobusCustomize.controlInstances[n].setting),o.val(e[WPGlobusCoreData.language])):o.val(WPGlobusCore.TextFilter(WPGlobusCustomize.controlInstances[n].setting,WPGlobusCoreData.language,"RETURN_EMPTY")))}),a(".wpglobus-customize-widget-control").each(function(t,e){var o=a(e),e=o.data("widget");if(void 0===o.attr("id"))return!0;o.val(WPGlobusCore.TextFilter(WPGlobusCustomize.controlWidgets[e].element[o.attr("id")].value,WPGlobusCoreData.language,"RETURN_EMPTY"))})})},updateElements:function(s){void 0===s&&(s=!0),a.each(WPGlobusCustomize.controlInstances,function(t,e){if(!e.userControl.enabled)return!0;var o,n=wp.customize.control.instance(t);"link"==e.type?(o=c.getTranslations(WPGlobusCustomize.controlInstances[t].setting),s?(n.setting.set(o[WPGlobusCoreData.language]),e.element.val(n.setting())):e.element.val(o[WPGlobusCoreData.language])):s?(n.setting.set(WPGlobusCore.TextFilter(WPGlobusCustomize.controlInstances[t].setting,WPGlobusCoreData.language,"RETURN_EMPTY")),e.element.val(n.setting())):e.element.val(WPGlobusCore.TextFilter(WPGlobusCustomize.controlInstances[t].setting,WPGlobusCoreData.language,"RETURN_EMPTY"))})},onSubmitEvents:function(t){"mouseenter"==t.type?a.each(c.controlWidgets[a(this).data("widget")].element,function(t,e){a("#"+t).val(e.value)}):"mouseleave"==t.type?c.widgetKeep||a.each(c.controlWidgets[a(this).data("widget")].element,function(t,e){a("#"+t).val(WPGlobusCore.TextFilter(e.value,WPGlobusCoreData.language,"RETURN_EMPTY"))}):"click"==t.type&&(c.widgetKeep=!0)},attachWidgetListeners:function(t){void 0!==t.submit[0].id&&a(document).on("mouseenter","#"+t.submit[0].id,c.onSubmitEvents).on("mouseleave","#"+t.submit[0].id,c.onSubmitEvents).on("click","#"+t.submit[0].id,c.onSubmitEvents)},attachListeners:function(){a(".wpglobus-customize-control").on("keyup",function(t){var e=a(this),o=e.data("customize-setting-link");void 0===WPGlobusCustomize.controlInstances[o]&&(o=e.data("wpglobus-customize-control"),void 0===WPGlobusCustomize.controlInstances[o])||("link"==WPGlobusCustomize.controlInstances[o].type?WPGlobusCustomize.controlInstances[o].setting=c.getString(WPGlobusCustomize.controlInstances[o].setting,e.val(),WPGlobusCoreData.language):WPGlobusCustomize.controlInstances[o].setting=WPGlobusCore.getString(WPGlobusCustomize.controlInstances[o].setting,e.val(),WPGlobusCoreData.language))}),a(document).on("keyup",".wpglobus-customize-widget-control",function(t){var e=a(this),o=e.data("widget");void 0!==WPGlobusCustomize.controlWidgets[o]&&(WPGlobusCustomize.controlWidgets[o].element[e.attr("id")].value=WPGlobusCore.getString(WPGlobusCustomize.controlWidgets[o].element[e.attr("id")].value,e.val(),WPGlobusCoreData.language))}),a("#save").on("mouseenter",function(t){a.each(WPGlobusCustomize.controlInstances,function(t,e){e.userControl.enabled&&((t=wp.customize.control.instance(t)).setting.set(e.setting),e.element.val(t.setting()))})}).on("mouseleave",function(t){c.instancesKeep||c.updateElements()}).on("click",function(t){c.instancesKeep=!0}),a(document).on("ajaxComplete",function(t,o){void 0!==o.responseText&&('{"success":true,"data":[]}'==o.responseText?c.updateElements(!1):(0<=o.responseText.indexOf("WP_CUSTOMIZER_SIGNATURE")&&(c.action="customizerAjaxComplete",c.setControlInstances()),a.each(WPGlobusCustomize.controlWidgets,function(t,e){t=t.replace("_","-");if(0<=o.responseText.indexOf(t))return e.submit.css({display:"block"}),e.control.liveUpdateMode=!1,a.each(e.element,function(t,e){a("#"+t).val(WPGlobusCore.TextFilter(e.value,WPGlobusCoreData.language,"RETURN_EMPTY"))}),e.inWidgetTitle.text(": "+WPGlobusCore.TextFilter(e.control.setting().title,WPGlobusCustomize.languageAdmin)),c.widgetKeep=!1})))}),a(document).on("click",".widget-title, .widget-title-action",function(t){var o=a(this).parents(".customize-control-widget_form").attr("id");a.each(c.controlWidgets,function(t,e){if("#"+o==e.parent)return c.ctrlWidgetCallback(t),!1})})}};WPGlobusCustomize=a.extend({},WPGlobusCustomize,c),WPGlobusCustomize.init()});
|
includes/js/wpglobus-customize-control170.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
jQuery(document).ready(function(c){"use strict";var u={languages:{},index:0,length:0,controlInstances:{},controlWidgets:{},instancesKeep:!1,widgetKeep:!1,action:!1,customizeSave:!1,selectorHtml:'<span style="margin-left:5px;" class="wpglobus-icon-globe"></span><span style="font-weight:bold;">{{language}}</span>',settingsSectionExpand:function(){c(document).triggerHandler("wpglobus_fields_settings_section_expand",[this,u])},init:function(t){u.setTitle(),"false"!=WPGlobusCustomizeOptions.themeEnabled&&(c.each(WPGlobusCoreData.enabled_languages,function(t,e){u.languages[t]=e,u.length=t}),u.addLanguageSelector(),u.setControlInstances(),u.setFieldsSection(),u.attachListeners(),u.setTinymce())},updateTinymce:function(t){"tinymce"==WPGlobusCustomize.controlInstances[this.id].type&&(WPGlobusCustomize.controlInstances[this.id].setting=WPGlobusCore.getString(WPGlobusCustomize.controlInstances[this.id].setting,t.target.textContent,WPGlobusCoreData.language))},setTinymce:function(t){c(document).on("tinymce-editor-init",function(t,e){"object"==typeof u.controlInstances[e.id]&&(u.controlInstances[e.id].type="tinymce",c(e.iframeElement).addClass("wpglobus-customize-control").css({width:"99%"}),e.on("input",_.debounce(u.updateTinymce,300)))})},getSize:function(t){return void 0===t?_.size(u.controlInstances):"widget"==t?_.size(u.controlWidgets):null},setFieldsSection:function(){var o={},n=c(".wpglobus-fields_settings_control_box").data("section-template"),s="",i="",l="";c.each(WPGlobusCustomize.controlInstances,function(t,e){void 0===o[e.section]&&(o[e.section]={}),o[e.section][t]=e}),c.each(o,function(t,e){return i="<ul>",c.each(e,function(t,e){l=e.userControl.enabled?" checked ":"",i+='<li id="'+e.fieldSettings.itemID+'">',i+='<input id="'+e.fieldSettings.cbID+'" data-control="'+t+'" class="wpglobus-customize-cb-control" type="checkbox"'+l+' /> <span class="wpglobus-cb-control-title">'+e.title+"</span>",i+="</li>"}),i+="</ul>",void 0===wp.customize.section(t)||(s=(s=(s=(s=n.replace("{{section_title}}",wp.customize.section(t).params.title)).replace(/{{section}}/g,t)).replace("{{section_id}}",'"'+t+'"')).replace("{{items}}",i),void c(s).insertBefore(c("#"+WPGlobusCustomizeOptions.userControlSaveButton)))}),c("#accordion-section-wpglobus_fields_settings_section").css({"margin-top":"15px"}),c(WPGlobusCustomizeOptions.helpButton).insertAfter(c("#accordion-section-wpglobus_fields_settings_section .customize-action")),c("#accordion-section-wpglobus_fields_settings_section .customize-section-description").addClass("hidden"),c(document).on("click","."+WPGlobusCustomizeOptions.userControlIconClass,function(t){var o=c(this).data("section");c(WPGlobusCustomizeOptions.userControlBoxSelector).each(function(t,e){o==c(e).data("section")?c(this).css({display:"block"}):c(this).css({display:"none"})}),wp.customize.control("wpglobus_fields_settings_section").expand({completeCallback:u.settingsSectionExpand})}),c(".wpglobus-customize-icon-help.customize-help-toggle").on("click",function(t){c("#accordion-section-wpglobus_fields_settings_section .customize-section-description").toggleClass("hidden")})},setUserControls:function(t,e){var o=e.controlSelector+" "+e.selector,n='<img class="'+WPGlobusCustomizeOptions.userControlIconClass+'" data-section="'+e.section+'" style="position:absolute;right:0px;cursor:pointer;" src="'+WPGlobusCustomizeOptions.userControlIcon+'" />';c(n).insertBefore(o),e.userControl.enabled||(1<c(o).length?c(o).each(function(t,e){c(e).removeClass(WPGlobusCustomize.controlClass)}):c(o).removeClass(WPGlobusCustomize.controlClass).val(e.setting))},ctrlMenuItemsCallback:function(t,e){},ctrlWidgetCallback:function(i,l){var t;u.action=!1,void 0===u.controlWidgets[i].element&&(void 0===l&&(l=wp.customize.control.instance(i)),u.controlWidgets[i].element={},u.controlWidgets[i].control=l,u.controlWidgets[i].inWidgetTitle=l.container.find(".in-widget-title"),u.controlWidgets[i].parent=l.selector,0!=(t=l.container.find("input[type=submit]")).length&&(t.css({display:"block"}),t.attr("data-widget",i),u.controlWidgets[i].submit=t,u.attachWidgetListeners(u.controlWidgets[i])),l.liveUpdateMode=!1,void 0===l.setting().title?u.controlWidgets[i].inWidgetTitle.text(""):u.controlWidgets[i].inWidgetTitle.text(": "+WPGlobusCore.TextFilter(l.setting().title,WPGlobusCustomize.languageAdmin)),c.each(WPGlobusCustomize.elementSelector,function(t,n){var s=l.container.find(n);0!=s.length&&c.each(s,function(t,e){if(void 0===e.id||""==e.id)return!0;var o=c(s[t]);void 0===u.controlWidgets[i].element[e.id]&&(u.controlWidgets[i].element[e.id]={}),o.addClass("wpglobus-customize-widget-control"),o.attr("data-widget",i),u.controlWidgets[i].element[e.id].element=o,u.controlWidgets[i].element[e.id].setting=l.setting(),u.controlWidgets[i].element[e.id].selector=n,u.controlWidgets[i].element[e.id].value=e.defaultValue,o.val(WPGlobusCore.TextFilter(e.defaultValue,WPGlobusCoreData.language,"RETURN_EMPTY"))})}),c(document).triggerHandler("wpglobus_customize_control_added_widget",[i]))},ctrlCallback:function(o,i,t){var n=!1;if(c.each(WPGlobusCustomize.disabledSections,function(t,e){if(o.section()==e)return!(n=!0)}),!n&&(c.each(WPGlobusCustomize.disabledSettingMask,function(t,e){if(0<=i.indexOf(e))return!(n=!0)}),!n)){var l,a=wp.customize.control.instance(i);if(0<=i.indexOf("widget"))return void 0===u.controlWidgets[i]&&(u.controlWidgets[i]={},u.action&&u.ctrlWidgetCallback(i,a)),u.controlWidgets[i].parent=a.selector,1!=c(a.selector).length?u.controlWidgets[i].observer=null:(u.controlWidgets[i].observer=new MutationObserver(function(t){t.forEach(function(t){"class"==t.attributeName&&-1!=t.target.className.indexOf("expanding")&&u.ctrlWidgetCallback(i)})}),u.controlWidgets[i].observer.observe(document.querySelector(u.controlWidgets[i].parent),{attributes:!0,childList:!0,characterData:!0})),!1;void 0===u.controlInstances[i]&&(l=!0,c.each(WPGlobusCustomize.elementSelector,function(t,e){var s=a.container.find(e);0!=s.length&&(u.controlInstances[i]={},u.controlInstances[i].element=s,u.controlInstances[i].elementID=s.attr("id")?"#"+s.attr("id"):void 0,u.controlInstances[i].setting=a.setting(),u.controlInstances[i].selector=e,u.controlInstances[i].controlSelector=a.selector,u.controlInstances[i].type="",u.controlInstances[i].section=a.section(),u.controlInstances[i].title=null,u.controlInstances[i].userControl=null,u.controlInstances[i].fieldSettings={},u.controlInstances[i].fieldSettings.itemID="item-wpglobus-cb-control-"+WPGlobusDialogApp.convertToId(i),u.controlInstances[i].fieldSettings.cbID="wpglobus-cb-control-"+WPGlobusDialogApp.convertToId(i),c.each(WPGlobusCustomize.setLinkBy,function(t,e){var o,n;0<=i.indexOf(e)&&(u.controlInstances[i].type="link",""==u.controlInstances[i].setting&&(u.controlInstances[i].setting=s[0].defaultValue),!WPGlobusCustomize.changeset_uuid||-1!==(o=wp.customize.control(i).setting()).indexOf("|||")&&(n=u.getTranslations(o),wp.customize.control(i).setting(n[WPGlobusCoreData.default_language]),c(WPGlobusCustomize.controlInstances[i].controlSelector+" "+WPGlobusCustomize.controlInstances[i].selector).val(n[WPGlobusCoreData.default_language])),s.addClass("wpglobus-control-link"))}),""===u.controlInstances[i].type&&(u.controlInstances[i].type="textarea"==e?"textarea":"text"),s.val(WPGlobusCore.TextFilter(u.controlInstances[i].setting,WPGlobusCoreData.language,"RETURN_EMPTY")),s.addClass("wpglobus-customize-control"),s.attr("data-wpglobus-customize-control",u.controlInstances[i].controlSelector.replace("#customize-control-","")),"link"==u.controlInstances[i].type&&(u.controlInstances[i].setting=u.convertString(s[0].defaultValue)),u.controlInstances[i].title=a.params.label,null!==WPGlobusCustomizeOptions.userControl&&void 0!==WPGlobusCustomizeOptions.userControl[WPGlobusCustomizeOptions.themeName]&&void 0!==WPGlobusCustomizeOptions.userControl[WPGlobusCustomizeOptions.themeName][i]&&"disable"==WPGlobusCustomizeOptions.userControl[WPGlobusCustomizeOptions.themeName][i]&&(l=!1),u.controlInstances[i].userControl={},u.controlInstances[i].userControl.enabled=l,u.setUserControls(i,u.controlInstances[i]))}))}},setControlInstances:function(){wp.customize.control.each(u.ctrlCallback)},setTitle:function(){c(WPGlobusCoreData.customize.info.element).html(WPGlobusCoreData.customize.info.html)},convertString:function(t){if(void 0===t)return t;var o=[],e=WPGlobusCore.getTranslations(t),n=0,s=!0;return t==e[WPGlobusCoreData.default_language]?t:(c.each(e,function(t,e){""==e?o[n]="null":(s=!1,o[n]=e),n++}),s?"":o.join("|||"))},getTranslations:function(t){if(void 0===t)return t;var o={},n=t.split("|||");return c.each(WPGlobusCoreData.enabled_languages,function(t,e){o[e]=void 0===n[t]||"null"===n[t]?"":n[t]}),o},getString:function(t,o,n){if(void 0===t)return t;void 0===o&&(o=""),void 0===n&&(n=WPGlobusCoreData.language);var e=u.getTranslations(t),s=[],i=0,l=!0;return c.each(e,function(t,e){t==n?(o=o.trim(),s[i]=""==o?"null":o):s[i]=""==e?"null":e,t!=WPGlobusCoreData.default_language&&"null"!=s[i]&&(l=!1),i++}),s=l?s[0]:s.join("|||")},addLanguageSelector:function(){c(WPGlobusCustomize.selectorButton).insertAfter(".customize-controls-preview-toggle"),c(".wpglobus-customize-selector").html(u.selectorHtml.replace("{{language}}",WPGlobusCoreData.language)),c(document).on("click",".wpglobus-customize-selector",function(t){u.index>u.length-1?u.index=0:u.index++,WPGlobusCoreData.language=u.languages[u.index],c(this).html(u.selectorHtml.replace("{{language}}",WPGlobusCoreData.language)),c(document).triggerHandler("wpglobus_customize_control_language",[WPGlobusCoreData.language]),c(".wpglobus-customize-control").each(function(t,e){var o,n=c(e),s=n.data("customize-setting-link");void 0===WPGlobusCustomize.controlInstances[s]&&(s=n.data("wpglobus-customize-control"),void 0===WPGlobusCustomize.controlInstances[s])||(n.hasClass("wpglobus-control-link")?(o=u.getTranslations(WPGlobusCustomize.controlInstances[s].setting),n.val(o[WPGlobusCoreData.language])):(o=WPGlobusCore.TextFilter(WPGlobusCustomize.controlInstances[s].setting,WPGlobusCoreData.language,"RETURN_EMPTY"),"tinymce"==WPGlobusCustomize.controlInstances[s].type&&tinymce.get(s).setContent(o,{format:"raw"}),n.val(WPGlobusCore.TextFilter(o,"RETURN_EMPTY"))))}),c(".wpglobus-customize-widget-control").each(function(t,e){var o=c(e),n=o.data("widget");if(void 0===o.attr("id"))return!0;o.val(WPGlobusCore.TextFilter(WPGlobusCustomize.controlWidgets[n].element[o.attr("id")].value,WPGlobusCoreData.language,"RETURN_EMPTY"))})})},updateElements:function(s){void 0===s&&(s=!0),c.each(WPGlobusCustomize.controlInstances,function(t,e){if(!e.userControl.enabled)return!0;var o,n=wp.customize.control.instance(t);"link"==e.type?(o=u.getTranslations(WPGlobusCustomize.controlInstances[t].setting),s?(n.setting.set(o[WPGlobusCoreData.language]),e.element.val(n.setting())):e.element.val(o[WPGlobusCoreData.language])):"tinymce"==e.type?(o=WPGlobusCore.TextFilter(WPGlobusCustomize.controlInstances[t].setting,WPGlobusCoreData.language,"RETURN_EMPTY"),tinymce.get(t).setContent(o,{format:"raw"}),e.element.val(o)):s?(n.setting.set(WPGlobusCore.TextFilter(WPGlobusCustomize.controlInstances[t].setting,WPGlobusCoreData.language,"RETURN_EMPTY")),e.element.val(n.setting())):e.element.val(WPGlobusCore.TextFilter(WPGlobusCustomize.controlInstances[t].setting,WPGlobusCoreData.language,"RETURN_EMPTY"))})},onSubmitEvents:function(t){"mouseenter"==t.type?c.each(u.controlWidgets[c(this).data("widget")].element,function(t,e){c("#"+t).val(e.value)}):"mouseleave"==t.type?u.widgetKeep||c.each(u.controlWidgets[c(this).data("widget")].element,function(t,e){c("#"+t).val(WPGlobusCore.TextFilter(e.value,WPGlobusCoreData.language,"RETURN_EMPTY"))}):"click"==t.type&&(u.widgetKeep=!0)},attachWidgetListeners:function(t){void 0!==t.submit[0].id&&c(document).on("mouseenter","#"+t.submit[0].id,u.onSubmitEvents).on("mouseleave","#"+t.submit[0].id,u.onSubmitEvents).on("click","#"+t.submit[0].id,u.onSubmitEvents)},attachListeners:function(){c(".wpglobus-customize-control").on("keyup",function(t){var e=c(this),o=e.data("customize-setting-link");void 0===WPGlobusCustomize.controlInstances[o]&&(o=e.data("wpglobus-customize-control"),WPGlobusCustomize.controlInstances[o]),void 0===c(document).triggerHandler("wpglobus_customize_control_keyup",[e,o])&&("link"==WPGlobusCustomize.controlInstances[o].type?WPGlobusCustomize.controlInstances[o].setting=u.getString(WPGlobusCustomize.controlInstances[o].setting,e.val(),WPGlobusCoreData.language):WPGlobusCustomize.controlInstances[o].setting=WPGlobusCore.getString(WPGlobusCustomize.controlInstances[o].setting,e.val(),WPGlobusCoreData.language))}),c(document).on("keyup",".wpglobus-customize-widget-control",function(t){var e=c(this),o=e.data("widget");void 0!==WPGlobusCustomize.controlWidgets[o]&&(WPGlobusCustomize.controlWidgets[o].element[e.attr("id")].value=WPGlobusCore.getString(WPGlobusCustomize.controlWidgets[o].element[e.attr("id")].value,e.val(),WPGlobusCoreData.language))}),c(document).on("mouseenter","#save",function(t){c.each(WPGlobusCustomize.controlInstances,function(t,e){var o;e.userControl.enabled&&(o=wp.customize.control.instance(t),"tinymce"==e.type&&tinymce.get(t).setContent(e.setting,{format:"raw"}),o.setting.set(e.setting),e.element.val(o.setting()))})}).on("mouseleave","#save",function(t){u.instancesKeep||(u.updateElements(),wp.customize.previewer.refresh())}),c("#save").on("click",function(t){u.instancesKeep=!0}),c(document).on("ajaxSend",function(t,e,o){void 0!==o.data&&-1!=o.data.indexOf("wp_customize=on")&&-1!=o.data.indexOf("action=customize_save")&&(u.customizeSave=!0)}),c(document).on("ajaxComplete",function(t,n){void 0!==n.responseText&&(u.customizeSave?(u.updateElements(!1),u.instancesKeep&&(u.instancesKeep=!1)):(0<=n.responseText.indexOf("WP_CUSTOMIZER_SIGNATURE")&&(u.action="customizerAjaxComplete",u.setControlInstances()),c.each(WPGlobusCustomize.controlWidgets,function(t,e){var o=t.replace("_","-");if(0<=n.responseText.indexOf(o))return e.submit.css({display:"block"}),e.control.liveUpdateMode=!1,c.each(e.element,function(t,e){c("#"+t).val(WPGlobusCore.TextFilter(e.value,WPGlobusCoreData.language,"RETURN_EMPTY"))}),e.inWidgetTitle.text(": "+WPGlobusCore.TextFilter(e.control.setting().title,WPGlobusCustomize.languageAdmin)),u.widgetKeep=!1})),u.customizeSave=!1,wp.customize.previewer.refresh())})}};WPGlobusCustomize=c.extend({},WPGlobusCustomize,u),WPGlobusCustomize.init()});
|
1 |
+
jQuery(document).ready(function(a){"use strict";var c={languages:{},index:0,length:0,controlInstances:{},controlWidgets:{},instancesKeep:!1,widgetKeep:!1,action:!1,customizeSave:!1,selectorHtml:'<span style="margin-left:5px;" class="wpglobus-icon-globe"></span><span style="font-weight:bold;">{{language}}</span>',settingsSectionExpand:function(){a(document).triggerHandler("wpglobus_fields_settings_section_expand",[this,c])},init:function(t){c.setTitle(),"false"!=WPGlobusCustomizeOptions.themeEnabled&&(a.each(WPGlobusCoreData.enabled_languages,function(t,e){c.languages[t]=e,c.length=t}),c.addLanguageSelector(),c.setControlInstances(),c.setFieldsSection(),c.attachListeners(),c.setTinymce())},updateTinymce:function(t){"tinymce"==WPGlobusCustomize.controlInstances[this.id].type&&(WPGlobusCustomize.controlInstances[this.id].setting=WPGlobusCore.getString(WPGlobusCustomize.controlInstances[this.id].setting,t.target.textContent,WPGlobusCoreData.language))},setTinymce:function(t){a(document).on("tinymce-editor-init",function(t,e){"object"==typeof c.controlInstances[e.id]&&(c.controlInstances[e.id].type="tinymce",a(e.iframeElement).addClass("wpglobus-customize-control").css({width:"99%"}),e.on("input",_.debounce(c.updateTinymce,300)))})},getSize:function(t){return void 0===t?_.size(c.controlInstances):"widget"==t?_.size(c.controlWidgets):null},setFieldsSection:function(){var o={},n=a(".wpglobus-fields_settings_control_box").data("section-template"),s="",i="",l="";a.each(WPGlobusCustomize.controlInstances,function(t,e){void 0===o[e.section]&&(o[e.section]={}),o[e.section][t]=e}),a.each(o,function(t,e){return i="<ul>",a.each(e,function(t,e){l=e.userControl.enabled?" checked ":"",i+='<li id="'+e.fieldSettings.itemID+'">',i+='<input id="'+e.fieldSettings.cbID+'" data-control="'+t+'" class="wpglobus-customize-cb-control" type="checkbox"'+l+' /> <span class="wpglobus-cb-control-title">'+e.title+"</span>",i+="</li>"}),i+="</ul>",void 0===wp.customize.section(t)||(s=(s=(s=(s=n.replace("{{section_title}}",wp.customize.section(t).params.title)).replace(/{{section}}/g,t)).replace("{{section_id}}",'"'+t+'"')).replace("{{items}}",i),void a(s).insertBefore(a("#"+WPGlobusCustomizeOptions.userControlSaveButton)))}),a("#accordion-section-wpglobus_fields_settings_section").css({"margin-top":"15px"}),a(WPGlobusCustomizeOptions.helpButton).insertAfter(a("#accordion-section-wpglobus_fields_settings_section .customize-action")),a("#accordion-section-wpglobus_fields_settings_section .customize-section-description").addClass("hidden"),a(document).on("click","."+WPGlobusCustomizeOptions.userControlIconClass,function(t){var o=a(this).data("section");a(WPGlobusCustomizeOptions.userControlBoxSelector).each(function(t,e){o==a(e).data("section")?a(this).css({display:"block"}):a(this).css({display:"none"})}),wp.customize.control("wpglobus_fields_settings_section").expand({completeCallback:c.settingsSectionExpand})}),a(".wpglobus-customize-icon-help.customize-help-toggle").on("click",function(t){a("#accordion-section-wpglobus_fields_settings_section .customize-section-description").toggleClass("hidden")})},setUserControls:function(t,e){var o=e.controlSelector+" "+e.selector,n='<img class="'+WPGlobusCustomizeOptions.userControlIconClass+'" data-section="'+e.section+'" style="position:absolute;right:0px;cursor:pointer;" src="'+WPGlobusCustomizeOptions.userControlIcon+'" />';a(n).insertBefore(o),e.userControl.enabled||(1<a(o).length?a(o).each(function(t,e){a(e).removeClass(WPGlobusCustomize.controlClass)}):a(o).removeClass(WPGlobusCustomize.controlClass).val(e.setting))},ctrlMenuItemsCallback:function(t,e){},ctrlWidgetCallback:function(s,i){var t;c.action=!1,void 0===c.controlWidgets[s].element&&(void 0===i&&(i=wp.customize.control.instance(s)),c.controlWidgets[s].element={},c.controlWidgets[s].control=i,c.controlWidgets[s].inWidgetTitle=i.container.find(".in-widget-title"),c.controlWidgets[s].parent=i.selector,0!=(t=i.container.find("input[type=submit]")).length&&(t.css({display:"block"}),t.attr("data-widget",s),c.controlWidgets[s].submit=t,c.attachWidgetListeners(c.controlWidgets[s])),i.liveUpdateMode=!1,void 0===i.setting().title?c.controlWidgets[s].inWidgetTitle.text(""):c.controlWidgets[s].inWidgetTitle.text(": "+WPGlobusCore.TextFilter(i.setting().title,WPGlobusCustomize.languageAdmin)),a.each(WPGlobusCustomize.elementSelector,function(t,o){var n=i.container.find(o);0!=n.length&&a.each(n,function(t,e){if(void 0===e.id||""==e.id)return!0;t=a(n[t]);void 0===c.controlWidgets[s].element[e.id]&&(c.controlWidgets[s].element[e.id]={}),t.addClass("wpglobus-customize-widget-control"),t.attr("data-widget",s),c.controlWidgets[s].element[e.id].element=t,c.controlWidgets[s].element[e.id].setting=i.setting(),c.controlWidgets[s].element[e.id].selector=o,c.controlWidgets[s].element[e.id].value=e.defaultValue,t.val(WPGlobusCore.TextFilter(e.defaultValue,WPGlobusCoreData.language,"RETURN_EMPTY"))})}),a(document).triggerHandler("wpglobus_customize_control_added_widget",[s]))},ctrlCallback:function(o,n,t){var s=!1;if(a.each(WPGlobusCustomize.disabledSections,function(t,e){if(o.section()==e)return!(s=!0)}),!s&&(a.each(WPGlobusCustomize.disabledSettingMask,function(t,e){if(0<=n.indexOf(e))return!(s=!0)}),!s)){var i,l=wp.customize.control.instance(n);if(0<=n.indexOf("widget"))return void 0===c.controlWidgets[n]&&(c.controlWidgets[n]={},c.action&&c.ctrlWidgetCallback(n,l)),c.controlWidgets[n].parent=l.selector,1!=a(l.selector).length?c.controlWidgets[n].observer=null:(c.controlWidgets[n].observer=new MutationObserver(function(t){t.forEach(function(t){"class"==t.attributeName&&-1!=t.target.className.indexOf("expanding")&&c.ctrlWidgetCallback(n)})}),c.controlWidgets[n].observer.observe(document.querySelector(c.controlWidgets[n].parent),{attributes:!0,childList:!0,characterData:!0})),!1;void 0===c.controlInstances[n]&&(i=!0,a.each(WPGlobusCustomize.elementSelector,function(t,e){var o=l.container.find(e);0!=o.length&&(c.controlInstances[n]={},c.controlInstances[n].element=o,c.controlInstances[n].elementID=o.attr("id")?"#"+o.attr("id"):void 0,c.controlInstances[n].setting=l.setting(),c.controlInstances[n].selector=e,c.controlInstances[n].controlSelector=l.selector,c.controlInstances[n].type="",c.controlInstances[n].section=l.section(),c.controlInstances[n].title=null,c.controlInstances[n].userControl=null,c.controlInstances[n].fieldSettings={},c.controlInstances[n].fieldSettings.itemID="item-wpglobus-cb-control-"+WPGlobusDialogApp.convertToId(n),c.controlInstances[n].fieldSettings.cbID="wpglobus-cb-control-"+WPGlobusDialogApp.convertToId(n),a.each(WPGlobusCustomize.setLinkBy,function(t,e){0<=n.indexOf(e)&&(c.controlInstances[n].type="link",""==c.controlInstances[n].setting&&(c.controlInstances[n].setting=o[0].defaultValue),!WPGlobusCustomize.changeset_uuid||-1!==(e=wp.customize.control(n).setting()).indexOf("|||")&&(e=c.getTranslations(e),wp.customize.control(n).setting(e[WPGlobusCoreData.default_language]),a(WPGlobusCustomize.controlInstances[n].controlSelector+" "+WPGlobusCustomize.controlInstances[n].selector).val(e[WPGlobusCoreData.default_language])),o.addClass("wpglobus-control-link"))}),""===c.controlInstances[n].type&&(c.controlInstances[n].type="textarea"==e?"textarea":"text"),o.val(WPGlobusCore.TextFilter(c.controlInstances[n].setting,WPGlobusCoreData.language,"RETURN_EMPTY")),o.addClass("wpglobus-customize-control"),o.attr("data-wpglobus-customize-control",c.controlInstances[n].controlSelector.replace("#customize-control-","")),"link"==c.controlInstances[n].type&&(c.controlInstances[n].setting=c.convertString(o[0].defaultValue)),c.controlInstances[n].title=l.params.label,null!==WPGlobusCustomizeOptions.userControl&&void 0!==WPGlobusCustomizeOptions.userControl[WPGlobusCustomizeOptions.themeName]&&void 0!==WPGlobusCustomizeOptions.userControl[WPGlobusCustomizeOptions.themeName][n]&&"disable"==WPGlobusCustomizeOptions.userControl[WPGlobusCustomizeOptions.themeName][n]&&(i=!1),c.controlInstances[n].userControl={},c.controlInstances[n].userControl.enabled=i,c.setUserControls(n,c.controlInstances[n]))}))}},setControlInstances:function(){wp.customize.control.each(c.ctrlCallback)},setTitle:function(){a(WPGlobusCoreData.customize.info.element).html(WPGlobusCoreData.customize.info.html)},convertString:function(t){if(void 0===t)return t;var o=[],e=WPGlobusCore.getTranslations(t),n=0,s=!0;return t==e[WPGlobusCoreData.default_language]?t:(a.each(e,function(t,e){""==e?o[n]="null":(s=!1,o[n]=e),n++}),s?"":o.join("|||"))},getTranslations:function(t){if(void 0===t)return t;var o={},n=t.split("|||");return a.each(WPGlobusCoreData.enabled_languages,function(t,e){o[e]=void 0===n[t]||"null"===n[t]?"":n[t]}),o},getString:function(t,o,n){if(void 0===t)return t;void 0===o&&(o=""),void 0===n&&(n=WPGlobusCoreData.language);var t=c.getTranslations(t),s=[],i=0,l=!0;return a.each(t,function(t,e){t==n?(o=o.trim(),s[i]=""==o?"null":o):s[i]=""==e?"null":e,t!=WPGlobusCoreData.default_language&&"null"!=s[i]&&(l=!1),i++}),s=l?s[0]:s.join("|||")},addLanguageSelector:function(){a(WPGlobusCustomize.selectorButton).insertAfter(".customize-controls-preview-toggle"),a(".wpglobus-customize-selector").html(c.selectorHtml.replace("{{language}}",WPGlobusCoreData.language)),a(document).on("click",".wpglobus-customize-selector",function(t){c.index>c.length-1?c.index=0:c.index++,WPGlobusCoreData.language=c.languages[c.index],a(this).html(c.selectorHtml.replace("{{language}}",WPGlobusCoreData.language)),a(document).triggerHandler("wpglobus_customize_control_language",[WPGlobusCoreData.language]),a(".wpglobus-customize-control").each(function(t,e){var o,n=a(e),e=n.data("customize-setting-link");void 0===WPGlobusCustomize.controlInstances[e]&&(e=n.data("wpglobus-customize-control"),void 0===WPGlobusCustomize.controlInstances[e])||(n.hasClass("wpglobus-control-link")?(o=c.getTranslations(WPGlobusCustomize.controlInstances[e].setting),n.val(o[WPGlobusCoreData.language])):(o=WPGlobusCore.TextFilter(WPGlobusCustomize.controlInstances[e].setting,WPGlobusCoreData.language,"RETURN_EMPTY"),"tinymce"==WPGlobusCustomize.controlInstances[e].type&&tinymce.get(e).setContent(o,{format:"raw"}),n.val(WPGlobusCore.TextFilter(o,"RETURN_EMPTY"))))}),a(".wpglobus-customize-widget-control").each(function(t,e){var o=a(e),e=o.data("widget");if(void 0===o.attr("id"))return!0;o.val(WPGlobusCore.TextFilter(WPGlobusCustomize.controlWidgets[e].element[o.attr("id")].value,WPGlobusCoreData.language,"RETURN_EMPTY"))})})},updateElements:function(s){void 0===s&&(s=!0),a.each(WPGlobusCustomize.controlInstances,function(t,e){if(!e.userControl.enabled)return!0;var o,n=wp.customize.control.instance(t);"link"==e.type?(o=c.getTranslations(WPGlobusCustomize.controlInstances[t].setting),s?(n.setting.set(o[WPGlobusCoreData.language]),e.element.val(n.setting())):e.element.val(o[WPGlobusCoreData.language])):"tinymce"==e.type?(o=WPGlobusCore.TextFilter(WPGlobusCustomize.controlInstances[t].setting,WPGlobusCoreData.language,"RETURN_EMPTY"),tinymce.get(t).setContent(o,{format:"raw"}),e.element.val(o)):s?(n.setting.set(WPGlobusCore.TextFilter(WPGlobusCustomize.controlInstances[t].setting,WPGlobusCoreData.language,"RETURN_EMPTY")),e.element.val(n.setting())):e.element.val(WPGlobusCore.TextFilter(WPGlobusCustomize.controlInstances[t].setting,WPGlobusCoreData.language,"RETURN_EMPTY"))})},onSubmitEvents:function(t){"mouseenter"==t.type?a.each(c.controlWidgets[a(this).data("widget")].element,function(t,e){a("#"+t).val(e.value)}):"mouseleave"==t.type?c.widgetKeep||a.each(c.controlWidgets[a(this).data("widget")].element,function(t,e){a("#"+t).val(WPGlobusCore.TextFilter(e.value,WPGlobusCoreData.language,"RETURN_EMPTY"))}):"click"==t.type&&(c.widgetKeep=!0)},attachWidgetListeners:function(t){void 0!==t.submit[0].id&&a(document).on("mouseenter","#"+t.submit[0].id,c.onSubmitEvents).on("mouseleave","#"+t.submit[0].id,c.onSubmitEvents).on("click","#"+t.submit[0].id,c.onSubmitEvents)},attachListeners:function(){a(".wpglobus-customize-control").on("keyup",function(t){var e=a(this),o=e.data("customize-setting-link");void 0===WPGlobusCustomize.controlInstances[o]&&(o=e.data("wpglobus-customize-control"),WPGlobusCustomize.controlInstances[o]),void 0===a(document).triggerHandler("wpglobus_customize_control_keyup",[e,o])&&("link"==WPGlobusCustomize.controlInstances[o].type?WPGlobusCustomize.controlInstances[o].setting=c.getString(WPGlobusCustomize.controlInstances[o].setting,e.val(),WPGlobusCoreData.language):WPGlobusCustomize.controlInstances[o].setting=WPGlobusCore.getString(WPGlobusCustomize.controlInstances[o].setting,e.val(),WPGlobusCoreData.language))}),a(document).on("keyup",".wpglobus-customize-widget-control",function(t){var e=a(this),o=e.data("widget");void 0!==WPGlobusCustomize.controlWidgets[o]&&(WPGlobusCustomize.controlWidgets[o].element[e.attr("id")].value=WPGlobusCore.getString(WPGlobusCustomize.controlWidgets[o].element[e.attr("id")].value,e.val(),WPGlobusCoreData.language))}),a(document).on("mouseenter","#save",function(t){a.each(WPGlobusCustomize.controlInstances,function(t,e){var o;e.userControl.enabled&&(o=wp.customize.control.instance(t),"tinymce"==e.type&&tinymce.get(t).setContent(e.setting,{format:"raw"}),o.setting.set(e.setting),e.element.val(o.setting()))})}).on("mouseleave","#save",function(t){c.instancesKeep||(c.updateElements(),wp.customize.previewer.refresh())}),a("#save").on("click",function(t){c.instancesKeep=!0}),a(document).on("ajaxSend",function(t,e,o){void 0!==o.data&&-1!=o.data.indexOf("wp_customize=on")&&-1!=o.data.indexOf("action=customize_save")&&(c.customizeSave=!0)}),a(document).on("ajaxComplete",function(t,o){void 0!==o.responseText&&(c.customizeSave?(c.updateElements(!1),c.instancesKeep&&(c.instancesKeep=!1)):(0<=o.responseText.indexOf("WP_CUSTOMIZER_SIGNATURE")&&(c.action="customizerAjaxComplete",c.setControlInstances()),a.each(WPGlobusCustomize.controlWidgets,function(t,e){t=t.replace("_","-");if(0<=o.responseText.indexOf(t))return e.submit.css({display:"block"}),e.control.liveUpdateMode=!1,a.each(e.element,function(t,e){a("#"+t).val(WPGlobusCore.TextFilter(e.value,WPGlobusCoreData.language,"RETURN_EMPTY"))}),e.inWidgetTitle.text(": "+WPGlobusCore.TextFilter(e.control.setting().title,WPGlobusCustomize.languageAdmin)),c.widgetKeep=!1})),c.customizeSave=!1,wp.customize.previewer.refresh())})}};WPGlobusCustomize=a.extend({},WPGlobusCustomize,c),WPGlobusCustomize.init()});
|
includes/js/wpglobus-customize-control190.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
jQuery(document).ready(function(a){"use strict";var u={languages:{},index:0,length:0,controlInstances:{},controlWidgets:{},instancesKeep:!1,widgetKeep:!1,action:!1,customizeSave:!1,selectorHtml:"",settingsSectionExpand:function(){a(document).triggerHandler("wpglobus_fields_settings_section_expand",[this,u])},init:function(t){u.selectorHtml=WPGlobusCustomize.selector_html,u.setTitle(),"false"!=WPGlobusCustomizeOptions.themeEnabled&&(a.each(WPGlobusCoreData.enabled_languages,function(t,e){u.languages[t]=e,u.length=t}),u.addLanguageSelector(),u.setControlInstances(),u.setFieldsSection(),u.attachListeners(),u.setTinymce())},updateTinymce:function(t){"tinymce"==WPGlobusCustomize.controlInstances[this.id].type&&(WPGlobusCustomize.controlInstances[this.id].setting=WPGlobusCore.getString(WPGlobusCustomize.controlInstances[this.id].setting,t.target.textContent,WPGlobusCoreData.language))},setTinymce:function(t){a(document).on("tinymce-editor-init",function(t,e){"object"==typeof u.controlInstances[e.id]&&(u.controlInstances[e.id].type="tinymce",a(e.iframeElement).addClass("wpglobus-customize-control").css({width:"99%"}),e.on("input",_.debounce(u.updateTinymce,300)))})},getSize:function(t){return void 0===t?_.size(u.controlInstances):"widget"==t?_.size(u.controlWidgets):null},setFieldsSection:function(){var o={},n=a(".wpglobus-fields_settings_control_box").data("section-template"),s="",l="",i="";a.each(WPGlobusCustomize.controlInstances,function(t,e){void 0===o[e.section]&&(o[e.section]={}),o[e.section][t]=e}),a.each(o,function(t,e){return l="<ul>",a.each(e,function(t,e){i=e.userControl.enabled?" checked ":"",l+='<li id="'+e.fieldSettings.itemID+'">',l+='<input id="'+e.fieldSettings.cbID+'" data-control="'+t+'" class="wpglobus-customize-cb-control" type="checkbox"'+i+' /> <span class="wpglobus-cb-control-title">'+e.title+"</span>",l+="</li>"}),l+="</ul>",void 0===wp.customize.section(t)||(s=(s=(s=(s=n.replace("{{section_title}}",wp.customize.section(t).params.title)).replace(/{{section}}/g,t)).replace("{{section_id}}",'"'+t+'"')).replace("{{items}}",l),void a(s).insertBefore(a("#"+WPGlobusCustomizeOptions.userControlSaveButton)))}),a("#accordion-section-wpglobus_fields_settings_section").css({"margin-top":"15px"}),a(WPGlobusCustomizeOptions.helpButton).insertAfter(a("#accordion-section-wpglobus_fields_settings_section .customize-action")),a("#accordion-section-wpglobus_fields_settings_section .customize-section-description").addClass("hidden"),a(document).on("click","."+WPGlobusCustomizeOptions.userControlIconClass,function(t){var o=a(this).data("section");a(WPGlobusCustomizeOptions.userControlBoxSelector).each(function(t,e){o==a(e).data("section")?a(this).css({display:"block"}):a(this).css({display:"none"})}),wp.customize.control("wpglobus_fields_settings_section").expand({completeCallback:u.settingsSectionExpand})}),a(".wpglobus-customize-icon-help.customize-help-toggle").on("click",function(t){a("#accordion-section-wpglobus_fields_settings_section .customize-section-description").toggleClass("hidden")})},setUserControls:function(t,e){var o=e.controlSelector+" "+e.selector,n='<img class="'+WPGlobusCustomizeOptions.userControlIconClass+'" data-section="'+e.section+'" style="position:absolute;right:0px;cursor:pointer;" src="'+WPGlobusCustomizeOptions.userControlIcon+'" />';a(n).insertBefore(o),e.userControl.enabled||(1<a(o).length?a(o).each(function(t,e){a(e).removeClass(WPGlobusCustomize.controlClass)}):a(o).removeClass(WPGlobusCustomize.controlClass).val(e.setting))},ctrlMenuItemsCallback:function(t,e){},ctrlWidgetCallback:function(l,i){var t;u.action=!1,void 0===u.controlWidgets[l].element&&(void 0===i&&(i=wp.customize.control.instance(l)),u.controlWidgets[l].element={},u.controlWidgets[l].control=i,u.controlWidgets[l].inWidgetTitle=i.container.find(".in-widget-title"),u.controlWidgets[l].parent=i.selector,0!=(t=i.container.find("input[type=submit]")).length&&(t.css({display:"block"}),t.attr("data-widget",l),u.controlWidgets[l].submit=t,u.attachWidgetListeners(u.controlWidgets[l])),i.liveUpdateMode=!1,void 0===i.setting().title?u.controlWidgets[l].inWidgetTitle.text(""):u.controlWidgets[l].inWidgetTitle.text(": "+WPGlobusCore.TextFilter(i.setting().title,WPGlobusCustomize.languageAdmin)),a.each(WPGlobusCustomize.elementSelector,function(t,n){var s=i.container.find(n);0!=s.length&&a.each(s,function(t,e){if(void 0===e.id||""==e.id)return!0;var o=a(s[t]);void 0===u.controlWidgets[l].element[e.id]&&(u.controlWidgets[l].element[e.id]={}),o.addClass("wpglobus-customize-widget-control"),o.attr("data-widget",l),u.controlWidgets[l].element[e.id].element=o,u.controlWidgets[l].element[e.id].setting=i.setting(),u.controlWidgets[l].element[e.id].selector=n,u.controlWidgets[l].element[e.id].value=e.defaultValue,o.val(WPGlobusCore.TextFilter(e.defaultValue,WPGlobusCoreData.language,"RETURN_EMPTY"))})}),a(document).triggerHandler("wpglobus_customize_control_added_widget",[l]))},ctrlCallback:function(o,l,t){var n=!1;if(a.each(WPGlobusCustomize.disabledSections,function(t,e){if(o.section()==e)return!(n=!0)}),!n&&(a.each(WPGlobusCustomize.disabledSettingMask,function(t,e){if(0<=l.indexOf(e))return!(n=!0)}),!n)){var i,c=wp.customize.control.instance(l);if(0<=l.indexOf("widget"))return void 0===u.controlWidgets[l]&&(u.controlWidgets[l]={},u.action&&u.ctrlWidgetCallback(l,c)),u.controlWidgets[l].parent=c.selector,1!=a(c.selector).length?u.controlWidgets[l].observer=null:(u.controlWidgets[l].observer=new MutationObserver(function(t){t.forEach(function(t){"class"==t.attributeName&&-1!=t.target.className.indexOf("expanding")&&u.ctrlWidgetCallback(l)})}),u.controlWidgets[l].observer.observe(document.querySelector(u.controlWidgets[l].parent),{attributes:!0,childList:!0,characterData:!0})),!1;void 0===u.controlInstances[l]&&(i=!0,a.each(WPGlobusCustomize.elementSelector,function(t,e){var s=c.container.find(e);if(0!=s.length){if("function"!=typeof c.setting)return!0;s.attr("id"),u.controlInstances[l]={},u.controlInstances[l].element=s,u.controlInstances[l].elementID=s.attr("id")?"#"+s.attr("id"):void 0,u.controlInstances[l].setting=c.setting(),u.controlInstances[l].settingType=typeof c.setting(),u.controlInstances[l].selector=e,u.controlInstances[l].controlSelector=c.selector,u.controlInstances[l].type="",u.controlInstances[l].section=c.section(),u.controlInstances[l].title=null,u.controlInstances[l].userControl=null,u.controlInstances[l].fieldSettings={},u.controlInstances[l].fieldSettings.itemID="item-wpglobus-cb-control-"+WPGlobusDialogApp.convertToId(l),u.controlInstances[l].fieldSettings.cbID="wpglobus-cb-control-"+WPGlobusDialogApp.convertToId(l),a.each(WPGlobusCustomize.setLinkBy,function(t,e){var o,n;0<=l.indexOf(e)&&(u.controlInstances[l].type="link",""==u.controlInstances[l].setting&&(u.controlInstances[l].setting=s[0].defaultValue),!WPGlobusCustomize.changeset_uuid||-1!==(o=wp.customize.control(l).setting()).indexOf("|||")&&(n=u.getTranslations(o),wp.customize.control(l).setting(n[WPGlobusCoreData.default_language]),a(WPGlobusCustomize.controlInstances[l].controlSelector+" "+WPGlobusCustomize.controlInstances[l].selector).val(n[WPGlobusCoreData.default_language])),s.addClass("wpglobus-control-link"))}),""===u.controlInstances[l].type&&(u.controlInstances[l].type="textarea"==e?"textarea":"text"),"string"==u.controlInstances[l].settingType&&""!=u.controlInstances[l].setting&&s.val(WPGlobusCore.TextFilter(u.controlInstances[l].setting,WPGlobusCoreData.language,"RETURN_EMPTY")),s.addClass("wpglobus-customize-control"),s.attr("data-wpglobus-customize-control",u.controlInstances[l].controlSelector.replace("#customize-control-","")),s.attr("data-wpglobus-customize-control-setting-type",u.controlInstances[l].settingType),"link"==u.controlInstances[l].type&&(u.controlInstances[l].setting=u.convertString(s[0].defaultValue)),u.controlInstances[l].title=c.params.label,null!==WPGlobusCustomizeOptions.userControl&&void 0!==WPGlobusCustomizeOptions.userControl[WPGlobusCustomizeOptions.themeName]&&void 0!==WPGlobusCustomizeOptions.userControl[WPGlobusCustomizeOptions.themeName][l]&&"disable"==WPGlobusCustomizeOptions.userControl[WPGlobusCustomizeOptions.themeName][l]&&(i=!1),u.controlInstances[l].userControl={},u.controlInstances[l].userControl.enabled=i,u.setUserControls(l,u.controlInstances[l])}}))}},setControlInstances:function(){wp.customize.control.each(u.ctrlCallback)},setTitle:function(){a(WPGlobusCoreData.customize.info.element).html(WPGlobusCoreData.customize.info.html)},convertString:function(t){if(void 0===t)return t;var o=[],e=WPGlobusCore.getTranslations(t),n=0,s=!0;return t==e[WPGlobusCoreData.default_language]?t:(a.each(e,function(t,e){""==e?o[n]="null":(s=!1,o[n]=e),n++}),s?"":o.join("|||"))},getTranslations:function(t){if(void 0===t)return t;var o={},n=t.split("|||");return a.each(WPGlobusCoreData.enabled_languages,function(t,e){o[e]=void 0===n[t]||"null"===n[t]?"":n[t]}),o},getString:function(t,o,n){if(void 0===t)return t;void 0===o&&(o=""),void 0===n&&(n=WPGlobusCoreData.language);var e=u.getTranslations(t),s=[],l=0,i=!0;return a.each(e,function(t,e){t==n?(o=o.trim(),s[l]=""==o?"null":o):s[l]=""==e?"null":e,t!=WPGlobusCoreData.default_language&&"null"!=s[l]&&(i=!1),l++}),s=i?s[0]:s.join("|||")},addLanguageSelector:function(){"dropdown"!=WPGlobusCustomize.selectorType?(a(WPGlobusCustomize.selectorButton).insertAfter(".customize-controls-preview-toggle"),a(".wpglobus-customize-selector").html(u.selectorHtml.replace("{{language}}",WPGlobusCoreData.language)),a(document).on("click",".wpglobus-customize-selector",function(t){u.index>u.length-1?u.index=0:u.index++,WPGlobusCoreData.language=u.languages[u.index],a(this).html(u.selectorHtml.replace("{{language}}",WPGlobusCoreData.language)),a(document).triggerHandler("wpglobus_customize_control_language",[WPGlobusCoreData.language]),u.setControlsValue()})):u.addLanguageSelectorDropdown()},addLanguageSelectorDropdown:function(){a(WPGlobusCustomize.selectorButton).insertAfter(".customize-controls-preview-toggle"),a(".wpglobus-customize-selector").html(u.selectorHtml.replace("{{language}}",WPGlobusCoreData.language));var t=a(".wpglobus-customize-selector").offset(),e=t.top+46;e+="px;";var o=t.left+"px;",n=0,s='<ul class="wpglobus-customize-selector-dropdown" style="display:none;position:fixed;width:46px;border-left:1px solid #ddd;border-right:1px solid #ddd;background-color:#eee;margin:-1px 0 0;padding:0;top:'+e+"left:"+o+'">';a.each(WPGlobusCoreData.enabled_languages,function(t,e){s+='<li class="item" style="text-align:center;cursor:pointer;border-bottom:1px solid #ddd;margin:0;" data-language="'+e+'">',s+='<span class="value value-'+e+'" style="font-size:15px;">'+e+"</span>",s+="</li>"}),s+='<li class="item wpglobus-customize-item-settings" style="text-align:center;cursor:pointer;border-bottom:1px solid #ddd;margin:0;"><span style="padding-top:14px;" class="dashicons dashicons-admin-tools"></span></li>',s+="</ul>",a(".wpglobus-customize-selector").after(s),a(document).on("mouseenter",".wpglobus-customize-selector",function(t){a(".wpglobus-customize-selector-dropdown").css({display:"block"}),n=t.screenY}),a(document).on("mouseleave",".wpglobus-customize-selector",function(t){0!=n&&t.screenY-n<=0&&a(".wpglobus-customize-selector-dropdown").css({display:"none"})}),a(document).on("mouseleave",".wpglobus-customize-selector-dropdown",function(t){a(".wpglobus-customize-selector-dropdown").css({display:"none"})}),a(document).on("mouseenter",".wpglobus-customize-selector-dropdown .item",function(t){var e=a(this),o=e.data("language");e.addClass("active"),e.css({"background-color":"#fff"}),e.find(".value-"+o).css({"font-weight":"bold"})}),a(document).on("mouseleave",".wpglobus-customize-selector-dropdown .item",function(t){var e=a(this);e.removeClass("active"),e.css({"background-color":"#eee"}),a(this).find(".value").css({"font-weight":""})}),a(document).on("click",".wpglobus-customize-selector-dropdown .item",function(t){var e=a(this).data("language");void 0!==e&&e!=a(".wpglobus-customize-selector").data("language")&&u.languageChanged(e)}),a(document).on("click",".wpglobus-customize-item-settings",function(t){wp.customize.control("wpglobus_fields_settings_section").expand({completeCallback:u.settingsSectionExpand}),a(".wpglobus-customize-selector-dropdown").css({display:"none"})})},languageChanged:function(t){WPGlobusCoreData.language=t,a(".wpglobus-customize-selector").data("language",t),a(".wpglobus-customize-selector .current-language").text(t),a(document).triggerHandler("wpglobus_customize_control_language",[WPGlobusCoreData.language]),u.setControlsValue()},setControlsValue:function(){a(".wpglobus-customize-control").each(function(t,e){var o,n=a(e),s=n.data("customize-setting-link");void 0===WPGlobusCustomize.controlInstances[s]&&(s=n.data("wpglobus-customize-control"),void 0===WPGlobusCustomize.controlInstances[s])||(n.hasClass("wpglobus-control-link")?(o=u.getTranslations(WPGlobusCustomize.controlInstances[s].setting),n.val(o[WPGlobusCoreData.language])):"object"==WPGlobusCustomize.controlInstances[s].settingType||"number"==WPGlobusCustomize.controlInstances[s].settingType||(o=WPGlobusCore.TextFilter(WPGlobusCustomize.controlInstances[s].setting,WPGlobusCoreData.language,"RETURN_EMPTY"),"tinymce"==WPGlobusCustomize.controlInstances[s].type&&tinymce.get(s).setContent(o,{format:"raw"}),n.val(WPGlobusCore.TextFilter(o,"RETURN_EMPTY"))))}),a(".wpglobus-customize-widget-control").each(function(t,e){var o=a(e),n=o.data("widget");if(void 0===o.attr("id"))return!0;o.val(WPGlobusCore.TextFilter(WPGlobusCustomize.controlWidgets[n].element[o.attr("id")].value,WPGlobusCoreData.language,"RETURN_EMPTY"))})},updateElements:function(s){void 0===s&&(s=!0),a.each(WPGlobusCustomize.controlInstances,function(t,e){if(!e.userControl.enabled)return!0;var o,n=wp.customize.control.instance(t);"link"==e.type?(o=u.getTranslations(WPGlobusCustomize.controlInstances[t].setting),s?(n.setting.set(o[WPGlobusCoreData.language]),e.element.val(n.setting())):e.element.val(o[WPGlobusCoreData.language])):"tinymce"==e.type?(o=WPGlobusCore.TextFilter(WPGlobusCustomize.controlInstances[t].setting,WPGlobusCoreData.language,"RETURN_EMPTY"),tinymce.get(t).setContent(o,{format:"raw"}),e.element.val(o)):s?(n.setting.set(WPGlobusCore.TextFilter(WPGlobusCustomize.controlInstances[t].setting,WPGlobusCoreData.language,"RETURN_EMPTY")),e.element.val(n.setting())):e.element.val(WPGlobusCore.TextFilter(WPGlobusCustomize.controlInstances[t].setting,WPGlobusCoreData.language,"RETURN_EMPTY"))})},onSubmitEvents:function(t){"mouseenter"==t.type?a.each(u.controlWidgets[a(this).data("widget")].element,function(t,e){a("#"+t).val(e.value)}):"mouseleave"==t.type?u.widgetKeep||a.each(u.controlWidgets[a(this).data("widget")].element,function(t,e){a("#"+t).val(WPGlobusCore.TextFilter(e.value,WPGlobusCoreData.language,"RETURN_EMPTY"))}):"click"==t.type&&(u.widgetKeep=!0)},attachWidgetListeners:function(t){void 0!==t.submit[0].id&&a(document).on("mouseenter","#"+t.submit[0].id,u.onSubmitEvents).on("mouseleave","#"+t.submit[0].id,u.onSubmitEvents).on("click","#"+t.submit[0].id,u.onSubmitEvents)},attachListeners:function(){a(".wpglobus-customize-control").on("keyup",function(t){var e=a(this),o=e.data("customize-setting-link");void 0===WPGlobusCustomize.controlInstances[o]&&(o=e.data("wpglobus-customize-control"),WPGlobusCustomize.controlInstances[o]),void 0===a(document).triggerHandler("wpglobus_customize_control_keyup",[e,o])&&("link"==WPGlobusCustomize.controlInstances[o].type?WPGlobusCustomize.controlInstances[o].setting=u.getString(WPGlobusCustomize.controlInstances[o].setting,e.val(),WPGlobusCoreData.language):WPGlobusCustomize.controlInstances[o].setting=WPGlobusCore.getString(WPGlobusCustomize.controlInstances[o].setting,e.val(),WPGlobusCoreData.language))}),a(document).on("keyup",".wpglobus-customize-widget-control",function(t){var e=a(this),o=e.data("widget");void 0!==WPGlobusCustomize.controlWidgets[o]&&(WPGlobusCustomize.controlWidgets[o].element[e.attr("id")].value=WPGlobusCore.getString(WPGlobusCustomize.controlWidgets[o].element[e.attr("id")].value,e.val(),WPGlobusCoreData.language))}),a(document).on("mouseenter","#save",function(t){a.each(WPGlobusCustomize.controlInstances,function(t,e){var o;e.userControl.enabled&&(o=wp.customize.control.instance(t),"tinymce"==e.type&&tinymce.get(t).setContent(e.setting,{format:"raw"}),o.setting.set(e.setting),e.element.val(o.setting()))})}).on("mouseleave","#save",function(t){u.instancesKeep||(u.updateElements(),wp.customize.previewer.refresh())}),a("#save").on("click",function(t){u.instancesKeep=!0}),a(document).on("ajaxSend",function(t,e,o){void 0!==o.data&&-1!=o.data.indexOf("wp_customize=on")&&-1!=o.data.indexOf("action=customize_save")&&(u.customizeSave=!0)}),a(document).on("ajaxComplete",function(t,n){void 0!==n.responseText&&(u.customizeSave?(u.updateElements(!1),u.instancesKeep&&(u.instancesKeep=!1)):(0<=n.responseText.indexOf("WP_CUSTOMIZER_SIGNATURE")&&(u.action="customizerAjaxComplete",u.setControlInstances()),a.each(WPGlobusCustomize.controlWidgets,function(t,e){var o=t.replace("_","-");if(0<=n.responseText.indexOf(o))return e.submit.css({display:"block"}),e.control.liveUpdateMode=!1,a.each(e.element,function(t,e){a("#"+t).val(WPGlobusCore.TextFilter(e.value,WPGlobusCoreData.language,"RETURN_EMPTY"))}),e.inWidgetTitle.text(": "+WPGlobusCore.TextFilter(e.control.setting().title,WPGlobusCustomize.languageAdmin)),u.widgetKeep=!1})),u.customizeSave=!1,wp.customize.previewer.refresh())})}};WPGlobusCustomize=a.extend({},WPGlobusCustomize,u),WPGlobusCustomize.init()});
|
1 |
+
jQuery(document).ready(function(c){"use strict";var a={languages:{},index:0,length:0,controlInstances:{},controlWidgets:{},instancesKeep:!1,widgetKeep:!1,action:!1,customizeSave:!1,selectorHtml:"",settingsSectionExpand:function(){c(document).triggerHandler("wpglobus_fields_settings_section_expand",[this,a])},init:function(t){a.selectorHtml=WPGlobusCustomize.selector_html,a.setTitle(),"false"!=WPGlobusCustomizeOptions.themeEnabled&&(c.each(WPGlobusCoreData.enabled_languages,function(t,e){a.languages[t]=e,a.length=t}),a.addLanguageSelector(),a.setControlInstances(),a.setFieldsSection(),a.attachListeners(),a.setTinymce())},updateTinymce:function(t){"tinymce"==WPGlobusCustomize.controlInstances[this.id].type&&(WPGlobusCustomize.controlInstances[this.id].setting=WPGlobusCore.getString(WPGlobusCustomize.controlInstances[this.id].setting,t.target.textContent,WPGlobusCoreData.language))},setTinymce:function(t){c(document).on("tinymce-editor-init",function(t,e){"object"==typeof a.controlInstances[e.id]&&(a.controlInstances[e.id].type="tinymce",c(e.iframeElement).addClass("wpglobus-customize-control").css({width:"99%"}),e.on("input",_.debounce(a.updateTinymce,300)))})},getSize:function(t){return void 0===t?_.size(a.controlInstances):"widget"==t?_.size(a.controlWidgets):null},setFieldsSection:function(){var o={},n=c(".wpglobus-fields_settings_control_box").data("section-template"),s="",l="",i="";c.each(WPGlobusCustomize.controlInstances,function(t,e){void 0===o[e.section]&&(o[e.section]={}),o[e.section][t]=e}),c.each(o,function(t,e){return l="<ul>",c.each(e,function(t,e){i=e.userControl.enabled?" checked ":"",l+='<li id="'+e.fieldSettings.itemID+'">',l+='<input id="'+e.fieldSettings.cbID+'" data-control="'+t+'" class="wpglobus-customize-cb-control" type="checkbox"'+i+' /> <span class="wpglobus-cb-control-title">'+e.title+"</span>",l+="</li>"}),l+="</ul>",void 0===wp.customize.section(t)||(s=(s=(s=(s=n.replace("{{section_title}}",wp.customize.section(t).params.title)).replace(/{{section}}/g,t)).replace("{{section_id}}",'"'+t+'"')).replace("{{items}}",l),void c(s).insertBefore(c("#"+WPGlobusCustomizeOptions.userControlSaveButton)))}),c("#accordion-section-wpglobus_fields_settings_section").css({"margin-top":"15px"}),c(WPGlobusCustomizeOptions.helpButton).insertAfter(c("#accordion-section-wpglobus_fields_settings_section .customize-action")),c("#accordion-section-wpglobus_fields_settings_section .customize-section-description").addClass("hidden"),c(document).on("click","."+WPGlobusCustomizeOptions.userControlIconClass,function(t){var o=c(this).data("section");c(WPGlobusCustomizeOptions.userControlBoxSelector).each(function(t,e){o==c(e).data("section")?c(this).css({display:"block"}):c(this).css({display:"none"})}),wp.customize.control("wpglobus_fields_settings_section").expand({completeCallback:a.settingsSectionExpand})}),c(".wpglobus-customize-icon-help.customize-help-toggle").on("click",function(t){c("#accordion-section-wpglobus_fields_settings_section .customize-section-description").toggleClass("hidden")})},setUserControls:function(t,e){var o=e.controlSelector+" "+e.selector,n='<img class="'+WPGlobusCustomizeOptions.userControlIconClass+'" data-section="'+e.section+'" style="position:absolute;right:0px;cursor:pointer;" src="'+WPGlobusCustomizeOptions.userControlIcon+'" />';c(n).insertBefore(o),e.userControl.enabled||(1<c(o).length?c(o).each(function(t,e){c(e).removeClass(WPGlobusCustomize.controlClass)}):c(o).removeClass(WPGlobusCustomize.controlClass).val(e.setting))},ctrlMenuItemsCallback:function(t,e){},ctrlWidgetCallback:function(s,l){var t;a.action=!1,void 0===a.controlWidgets[s].element&&(void 0===l&&(l=wp.customize.control.instance(s)),a.controlWidgets[s].element={},a.controlWidgets[s].control=l,a.controlWidgets[s].inWidgetTitle=l.container.find(".in-widget-title"),a.controlWidgets[s].parent=l.selector,0!=(t=l.container.find("input[type=submit]")).length&&(t.css({display:"block"}),t.attr("data-widget",s),a.controlWidgets[s].submit=t,a.attachWidgetListeners(a.controlWidgets[s])),l.liveUpdateMode=!1,void 0===l.setting().title?a.controlWidgets[s].inWidgetTitle.text(""):a.controlWidgets[s].inWidgetTitle.text(": "+WPGlobusCore.TextFilter(l.setting().title,WPGlobusCustomize.languageAdmin)),c.each(WPGlobusCustomize.elementSelector,function(t,o){var n=l.container.find(o);0!=n.length&&c.each(n,function(t,e){if(void 0===e.id||""==e.id)return!0;t=c(n[t]);void 0===a.controlWidgets[s].element[e.id]&&(a.controlWidgets[s].element[e.id]={}),t.addClass("wpglobus-customize-widget-control"),t.attr("data-widget",s),a.controlWidgets[s].element[e.id].element=t,a.controlWidgets[s].element[e.id].setting=l.setting(),a.controlWidgets[s].element[e.id].selector=o,a.controlWidgets[s].element[e.id].value=e.defaultValue,t.val(WPGlobusCore.TextFilter(e.defaultValue,WPGlobusCoreData.language,"RETURN_EMPTY"))})}),c(document).triggerHandler("wpglobus_customize_control_added_widget",[s]))},ctrlCallback:function(o,n,t){var s=!1;if(c.each(WPGlobusCustomize.disabledSections,function(t,e){if(o.section()==e)return!(s=!0)}),!s&&(c.each(WPGlobusCustomize.disabledSettingMask,function(t,e){if(0<=n.indexOf(e))return!(s=!0)}),!s)){var l,i=wp.customize.control.instance(n);if(0<=n.indexOf("widget"))return void 0===a.controlWidgets[n]&&(a.controlWidgets[n]={},a.action&&a.ctrlWidgetCallback(n,i)),a.controlWidgets[n].parent=i.selector,1!=c(i.selector).length?a.controlWidgets[n].observer=null:(a.controlWidgets[n].observer=new MutationObserver(function(t){t.forEach(function(t){"class"==t.attributeName&&-1!=t.target.className.indexOf("expanding")&&a.ctrlWidgetCallback(n)})}),a.controlWidgets[n].observer.observe(document.querySelector(a.controlWidgets[n].parent),{attributes:!0,childList:!0,characterData:!0})),!1;void 0===a.controlInstances[n]&&(l=!0,c.each(WPGlobusCustomize.elementSelector,function(t,e){var o=i.container.find(e);if(0!=o.length){if("function"!=typeof i.setting)return!0;o.attr("id"),a.controlInstances[n]={},a.controlInstances[n].element=o,a.controlInstances[n].elementID=o.attr("id")?"#"+o.attr("id"):void 0,a.controlInstances[n].setting=i.setting(),a.controlInstances[n].settingType=typeof i.setting(),a.controlInstances[n].selector=e,a.controlInstances[n].controlSelector=i.selector,a.controlInstances[n].type="",a.controlInstances[n].section=i.section(),a.controlInstances[n].title=null,a.controlInstances[n].userControl=null,a.controlInstances[n].fieldSettings={},a.controlInstances[n].fieldSettings.itemID="item-wpglobus-cb-control-"+WPGlobusDialogApp.convertToId(n),a.controlInstances[n].fieldSettings.cbID="wpglobus-cb-control-"+WPGlobusDialogApp.convertToId(n),c.each(WPGlobusCustomize.setLinkBy,function(t,e){0<=n.indexOf(e)&&(a.controlInstances[n].type="link",""==a.controlInstances[n].setting&&(a.controlInstances[n].setting=o[0].defaultValue),!WPGlobusCustomize.changeset_uuid||-1!==(e=wp.customize.control(n).setting()).indexOf("|||")&&(e=a.getTranslations(e),wp.customize.control(n).setting(e[WPGlobusCoreData.default_language]),c(WPGlobusCustomize.controlInstances[n].controlSelector+" "+WPGlobusCustomize.controlInstances[n].selector).val(e[WPGlobusCoreData.default_language])),o.addClass("wpglobus-control-link"))}),""===a.controlInstances[n].type&&(a.controlInstances[n].type="textarea"==e?"textarea":"text"),"string"==a.controlInstances[n].settingType&&""!=a.controlInstances[n].setting&&o.val(WPGlobusCore.TextFilter(a.controlInstances[n].setting,WPGlobusCoreData.language,"RETURN_EMPTY")),o.addClass("wpglobus-customize-control"),o.attr("data-wpglobus-customize-control",a.controlInstances[n].controlSelector.replace("#customize-control-","")),o.attr("data-wpglobus-customize-control-setting-type",a.controlInstances[n].settingType),"link"==a.controlInstances[n].type&&(a.controlInstances[n].setting=a.convertString(o[0].defaultValue)),a.controlInstances[n].title=i.params.label,null!==WPGlobusCustomizeOptions.userControl&&void 0!==WPGlobusCustomizeOptions.userControl[WPGlobusCustomizeOptions.themeName]&&void 0!==WPGlobusCustomizeOptions.userControl[WPGlobusCustomizeOptions.themeName][n]&&"disable"==WPGlobusCustomizeOptions.userControl[WPGlobusCustomizeOptions.themeName][n]&&(l=!1),a.controlInstances[n].userControl={},a.controlInstances[n].userControl.enabled=l,a.setUserControls(n,a.controlInstances[n])}}))}},setControlInstances:function(){wp.customize.control.each(a.ctrlCallback)},setTitle:function(){c(WPGlobusCoreData.customize.info.element).html(WPGlobusCoreData.customize.info.html)},convertString:function(t){if(void 0===t)return t;var o=[],e=WPGlobusCore.getTranslations(t),n=0,s=!0;return t==e[WPGlobusCoreData.default_language]?t:(c.each(e,function(t,e){""==e?o[n]="null":(s=!1,o[n]=e),n++}),s?"":o.join("|||"))},getTranslations:function(t){if(void 0===t)return t;var o={},n=t.split("|||");return c.each(WPGlobusCoreData.enabled_languages,function(t,e){o[e]=void 0===n[t]||"null"===n[t]?"":n[t]}),o},getString:function(t,o,n){if(void 0===t)return t;void 0===o&&(o=""),void 0===n&&(n=WPGlobusCoreData.language);var t=a.getTranslations(t),s=[],l=0,i=!0;return c.each(t,function(t,e){t==n?(o=o.trim(),s[l]=""==o?"null":o):s[l]=""==e?"null":e,t!=WPGlobusCoreData.default_language&&"null"!=s[l]&&(i=!1),l++}),s=i?s[0]:s.join("|||")},addLanguageSelector:function(){"dropdown"!=WPGlobusCustomize.selectorType?(c(WPGlobusCustomize.selectorButton).insertAfter(".customize-controls-preview-toggle"),c(".wpglobus-customize-selector").html(a.selectorHtml.replace("{{language}}",WPGlobusCoreData.language)),c(document).on("click",".wpglobus-customize-selector",function(t){a.index>a.length-1?a.index=0:a.index++,WPGlobusCoreData.language=a.languages[a.index],c(this).html(a.selectorHtml.replace("{{language}}",WPGlobusCoreData.language)),c(document).triggerHandler("wpglobus_customize_control_language",[WPGlobusCoreData.language]),a.setControlsValue()})):a.addLanguageSelectorDropdown()},addLanguageSelectorDropdown:function(){c(WPGlobusCustomize.selectorButton).insertAfter(".customize-controls-preview-toggle"),c(".wpglobus-customize-selector").html(a.selectorHtml.replace("{{language}}",WPGlobusCoreData.language));var t=c(".wpglobus-customize-selector").offset(),e=t.top+46,t=t.left+"px;",o=0,n='<ul class="wpglobus-customize-selector-dropdown" style="display:none;position:fixed;width:46px;border-left:1px solid #ddd;border-right:1px solid #ddd;background-color:#eee;margin:-1px 0 0;padding:0;top:'+(e+="px;")+"left:"+t+'">';c.each(WPGlobusCoreData.enabled_languages,function(t,e){n+='<li class="item" style="text-align:center;cursor:pointer;border-bottom:1px solid #ddd;margin:0;" data-language="'+e+'">',n+='<span class="value value-'+e+'" style="font-size:15px;">'+e+"</span>",n+="</li>"}),n+='<li class="item wpglobus-customize-item-settings" style="text-align:center;cursor:pointer;border-bottom:1px solid #ddd;margin:0;"><span style="padding-top:14px;" class="dashicons dashicons-admin-tools"></span></li>',n+="</ul>",c(".wpglobus-customize-selector").after(n),c(document).on("mouseenter",".wpglobus-customize-selector",function(t){c(".wpglobus-customize-selector-dropdown").css({display:"block"}),o=t.screenY}),c(document).on("mouseleave",".wpglobus-customize-selector",function(t){0!=o&&t.screenY-o<=0&&c(".wpglobus-customize-selector-dropdown").css({display:"none"})}),c(document).on("mouseleave",".wpglobus-customize-selector-dropdown",function(t){c(".wpglobus-customize-selector-dropdown").css({display:"none"})}),c(document).on("mouseenter",".wpglobus-customize-selector-dropdown .item",function(t){var e=c(this),o=e.data("language");e.addClass("active"),e.css({"background-color":"#fff"}),e.find(".value-"+o).css({"font-weight":"bold"})}),c(document).on("mouseleave",".wpglobus-customize-selector-dropdown .item",function(t){var e=c(this);e.removeClass("active"),e.css({"background-color":"#eee"}),c(this).find(".value").css({"font-weight":""})}),c(document).on("click",".wpglobus-customize-selector-dropdown .item",function(t){var e=c(this).data("language");void 0!==e&&e!=c(".wpglobus-customize-selector").data("language")&&a.languageChanged(e)}),c(document).on("click",".wpglobus-customize-item-settings",function(t){wp.customize.control("wpglobus_fields_settings_section").expand({completeCallback:a.settingsSectionExpand}),c(".wpglobus-customize-selector-dropdown").css({display:"none"})})},languageChanged:function(t){WPGlobusCoreData.language=t,c(".wpglobus-customize-selector").data("language",t),c(".wpglobus-customize-selector .current-language").text(t),c(document).triggerHandler("wpglobus_customize_control_language",[WPGlobusCoreData.language]),a.setControlsValue()},setControlsValue:function(){c(".wpglobus-customize-control").each(function(t,e){var o,n=c(e),e=n.data("customize-setting-link");void 0===WPGlobusCustomize.controlInstances[e]&&(e=n.data("wpglobus-customize-control"),void 0===WPGlobusCustomize.controlInstances[e])||(n.hasClass("wpglobus-control-link")?(o=a.getTranslations(WPGlobusCustomize.controlInstances[e].setting),n.val(o[WPGlobusCoreData.language])):"object"==WPGlobusCustomize.controlInstances[e].settingType||"number"==WPGlobusCustomize.controlInstances[e].settingType||(o=WPGlobusCore.TextFilter(WPGlobusCustomize.controlInstances[e].setting,WPGlobusCoreData.language,"RETURN_EMPTY"),"tinymce"==WPGlobusCustomize.controlInstances[e].type&&tinymce.get(e).setContent(o,{format:"raw"}),n.val(WPGlobusCore.TextFilter(o,"RETURN_EMPTY"))))}),c(".wpglobus-customize-widget-control").each(function(t,e){var o=c(e),e=o.data("widget");if(void 0===o.attr("id"))return!0;o.val(WPGlobusCore.TextFilter(WPGlobusCustomize.controlWidgets[e].element[o.attr("id")].value,WPGlobusCoreData.language,"RETURN_EMPTY"))})},updateElements:function(s){void 0===s&&(s=!0),c.each(WPGlobusCustomize.controlInstances,function(t,e){if(!e.userControl.enabled)return!0;var o,n=wp.customize.control.instance(t);"link"==e.type?(o=a.getTranslations(WPGlobusCustomize.controlInstances[t].setting),s?(n.setting.set(o[WPGlobusCoreData.language]),e.element.val(n.setting())):e.element.val(o[WPGlobusCoreData.language])):"tinymce"==e.type?(o=WPGlobusCore.TextFilter(WPGlobusCustomize.controlInstances[t].setting,WPGlobusCoreData.language,"RETURN_EMPTY"),tinymce.get(t).setContent(o,{format:"raw"}),e.element.val(o)):s?(n.setting.set(WPGlobusCore.TextFilter(WPGlobusCustomize.controlInstances[t].setting,WPGlobusCoreData.language,"RETURN_EMPTY")),e.element.val(n.setting())):e.element.val(WPGlobusCore.TextFilter(WPGlobusCustomize.controlInstances[t].setting,WPGlobusCoreData.language,"RETURN_EMPTY"))})},onSubmitEvents:function(t){"mouseenter"==t.type?c.each(a.controlWidgets[c(this).data("widget")].element,function(t,e){c("#"+t).val(e.value)}):"mouseleave"==t.type?a.widgetKeep||c.each(a.controlWidgets[c(this).data("widget")].element,function(t,e){c("#"+t).val(WPGlobusCore.TextFilter(e.value,WPGlobusCoreData.language,"RETURN_EMPTY"))}):"click"==t.type&&(a.widgetKeep=!0)},attachWidgetListeners:function(t){void 0!==t.submit[0].id&&c(document).on("mouseenter","#"+t.submit[0].id,a.onSubmitEvents).on("mouseleave","#"+t.submit[0].id,a.onSubmitEvents).on("click","#"+t.submit[0].id,a.onSubmitEvents)},attachListeners:function(){c(".wpglobus-customize-control").on("keyup",function(t){var e=c(this),o=e.data("customize-setting-link");void 0===WPGlobusCustomize.controlInstances[o]&&(o=e.data("wpglobus-customize-control"),WPGlobusCustomize.controlInstances[o]),void 0===c(document).triggerHandler("wpglobus_customize_control_keyup",[e,o])&&("link"==WPGlobusCustomize.controlInstances[o].type?WPGlobusCustomize.controlInstances[o].setting=a.getString(WPGlobusCustomize.controlInstances[o].setting,e.val(),WPGlobusCoreData.language):WPGlobusCustomize.controlInstances[o].setting=WPGlobusCore.getString(WPGlobusCustomize.controlInstances[o].setting,e.val(),WPGlobusCoreData.language))}),c(document).on("keyup",".wpglobus-customize-widget-control",function(t){var e=c(this),o=e.data("widget");void 0!==WPGlobusCustomize.controlWidgets[o]&&(WPGlobusCustomize.controlWidgets[o].element[e.attr("id")].value=WPGlobusCore.getString(WPGlobusCustomize.controlWidgets[o].element[e.attr("id")].value,e.val(),WPGlobusCoreData.language))}),c(document).on("mouseenter","#save",function(t){c.each(WPGlobusCustomize.controlInstances,function(t,e){var o;e.userControl.enabled&&(o=wp.customize.control.instance(t),"tinymce"==e.type&&tinymce.get(t).setContent(e.setting,{format:"raw"}),o.setting.set(e.setting),e.element.val(o.setting()))})}).on("mouseleave","#save",function(t){a.instancesKeep||(a.updateElements(),wp.customize.previewer.refresh())}),c("#save").on("click",function(t){a.instancesKeep=!0}),c(document).on("ajaxSend",function(t,e,o){void 0!==o.data&&-1!=o.data.indexOf("wp_customize=on")&&-1!=o.data.indexOf("action=customize_save")&&(a.customizeSave=!0)}),c(document).on("ajaxComplete",function(t,o){void 0!==o.responseText&&(a.customizeSave?(a.updateElements(!1),a.instancesKeep&&(a.instancesKeep=!1)):(0<=o.responseText.indexOf("WP_CUSTOMIZER_SIGNATURE")&&(a.action="customizerAjaxComplete",a.setControlInstances()),c.each(WPGlobusCustomize.controlWidgets,function(t,e){t=t.replace("_","-");if(0<=o.responseText.indexOf(t))return e.submit.css({display:"block"}),e.control.liveUpdateMode=!1,c.each(e.element,function(t,e){c("#"+t).val(WPGlobusCore.TextFilter(e.value,WPGlobusCoreData.language,"RETURN_EMPTY"))}),e.inWidgetTitle.text(": "+WPGlobusCore.TextFilter(e.control.setting().title,WPGlobusCustomize.languageAdmin)),a.widgetKeep=!1})),a.customizeSave=!1,wp.customize.previewer.refresh())})}};WPGlobusCustomize=c.extend({},WPGlobusCustomize,a),WPGlobusCustomize.init()});
|
includes/js/wpglobus-customize-options.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
jQuery(document).ready(function(
|
1 |
+
jQuery(document).ready(function(a){"use strict";var c={listID:"#wpglobus-sortable",customizeSave:!1,customizeSaveData:"",init:function(){a("#wpglobus-sortable").sortable({update:c.sortUpdate}),c.setJSCodeSection(),c.addListeners(),c.ajaxListener()},setJSCodeSection:function(){var o=WPGlobusCustomizeOptions.settings.wpglobus_js_editor_section;void 0!==o&&void 0!==o.wpglobus_customize_js_editor&&(a("#customize-control-wpglobus_customize_js_editor .customize-control-title").css({width:"50%"}).after('<span class="wpglobus-customize-js-editor-expand" style="float:right;"><a href="#">'+WPGlobusCustomizeOptions.i18n.expandShrink+"</a></span>"),a(document).on("click",".wpglobus-customize-js-editor-expand",function(o){var e=a(this),t=a("#customize-controls");e.toggleClass("expanded"),e.hasClass("expanded")?t.css({width:"500px"}):t.css({width:""})}),a("#sub-accordion-section-wpglobus_js_editor_section .customize-section-back").on("click",function(o){a("#customize-controls").css({width:""}),a(".wpglobus-customize-js-editor-expand").removeClass("expanded")}))},addListeners:function(){a("body").on("change",".wpglobus-listen-change",function(o){c.setState(!1)}),a("body").on("change","#wpglobus-sortable input.wpglobus-language-item",function(o){var e=a(this);e.prop("checked")||c.removeLanguage(e)}),a("#customize-control-wpglobus_add_languages_select_box select").on("change",function(o){c.addLanguage(o,this)}),a("#accordion-section-"+WPGlobusCustomizeOptions.sections.wpglobus_addons_section+" .accordion-section-title").off("click keydown"),a("body").on("click","#accordion-section-"+WPGlobusCustomizeOptions.sections.wpglobus_addons_section+" .accordion-section-title",function(o){window.open(WPGlobusCustomizeOptions.addonsPage,"_blank")}),a(document).on("click","#"+WPGlobusCustomizeOptions.userControlSaveButton,function(){c.userControlAjax(this)}),a(document).on("click","#accordion-section-"+WPGlobusCustomizeOptions.sections.wpglobus_js_editor_section+" .accordion-section-title",function(o){a("#customize-control-wpglobus_customize_js_editor .CodeMirror").css({height:"40em"})})},removeLanguage:function(o){var e=o.data("language"),t=a("#customize-control-wpglobus_add_languages_select_box select option").eq(0);a('<option value="'+e+'">'+WPGlobusCustomizeOptions.config.language_name[e]+" ("+WPGlobusCustomizeOptions.config.en_language_name[e]+") </option>").insertAfter(t),o.parent("li").remove()},addLanguage:function(o,e){var t=a(e).attr("value"),s=a("#wpglobus-item-skeleton").html(),n="",i=a(c.listID+" li").attr("class");"select"!=t&&(n=(n=(n=(n=(n=(n=(n=(n=(n=s.replace("{{flag}}",'src="'+WPGlobusCustomizeOptions.config.flags_url+WPGlobusCustomizeOptions.config.flag[t]+'"')).replace("{{name}}",t)).replace("{{id}}",t)).replace('checked="{{checked}}"','checked="checked"')).replace('disabled="{{disabled}}"',"")).replace("{{item}}",WPGlobusCustomizeOptions.config.en_language_name[t]+" ("+t+") ")).replace("{{order}}","#")).replace("{{language}}",t)).replace("{{edit-link}}",WPGlobusCustomizeOptions.editLink.replace("{{language}}",t)),a('<li class="'+i+'">'+n+"</li>").appendTo(c.listID),c.setOrder(),e=a(e).find("option"),a.each(e,function(o,e){a(e).attr("value")==t&&a(e).remove()}))},sortUpdate:function(o,e){c.setState(!1),c.setOrder()},setOrder:function(){a("#wpglobus-sortable input.wpglobus-language-item").each(function(o,e){e=a(e);0==o?e.prop("disabled","disabled").prop("checked","checked"):e.removeProp("disabled"),e.data("order",o)})},setState:function(o){wp.customize.state("saved").set(o)},getCustomizeSaveData:function(){return c.customizeSaveData},enabledUserControl:function(o){return void 0!==WPGlobusCustomize.controlInstances[o]&&WPGlobusCustomize.controlInstances[o].userControl.enabled},userControlAjax:function(o){a(o).prop("disabled",!0);var t={action:"cb-controls-save",controls:{}};a(".wpglobus-customize-cb-control").each(function(o,e){e=a(e);e.prop("checked")||(e=(e=(e=e.data("control")).replace("[","{{")).replace("]","}}"),t.controls[e]="disable")}),a.ajax({beforeSend:function(){},type:"POST",url:WPGlobusCustomizeOptions.ajaxurl,data:{action:WPGlobusCustomizeOptions.process_ajax,order:t},dataType:"json"}).always(function(){location.reload(!0)})},ajax:function(o,e){var i;"wpglobus_customize_save"==o&&(i={action:"wpglobus_customize_save",options:{}},a.each(WPGlobusCustomizeOptions.settings,function(o,e){a.each(e,function(o,t){return"wpglobus_customize_enabled_languages"==o?(i.options[t.option]={},a("#wpglobus-sortable input.wpglobus-language-item").each(function(o,e){i.options[t.option][a(this).data("language")]="1"}),!0):void(-1!=c.customizeSaveData.indexOf("wpglobus_customize_post_type_")&&-1!=o.indexOf("wpglobus_customize_post_type_")?(void 0===i.options[t.option]&&(i.options[t.option]={}),i.options[t.option][o.replace("wpglobus_customize_post_type_","")]=a("#customize-control-"+o+" input").prop("checked")?1:0):-1!=c.customizeSaveData.indexOf(o)&&(e=a("#customize-control-"+o+" "+t.type),s="","textarea"==t.type?s=e.val():"wpglobus_checkbox"==t.type?(e=a("#customize-control-"+o+" input"),s="wpglobus_customize_selector_wp_list_pages"==o?e.prop("checked")?1:0:e.prop("checked")?1:""):"checkbox"==t.type?s=e.prop("checked")?1:"":"select"==t.type?s=e.val():"code_editor"!=t.type||void 0!==(n=wp.customize.control.instance(o))&&(s=n.setting()),i.options[t.option]=s,"code_editor"==t.type&&void 0===n&&delete i.options[t.option]));var e,s,n})})),a.ajax({beforeSend:function(){},type:"POST",url:WPGlobusCustomizeOptions.ajaxurl,data:{action:WPGlobusCustomizeOptions.process_ajax,order:i},dataType:"json"})},getChangesetData:function(o){if(void 0!==o){var e=/customize_changeset_data=([^&]+)/.exec(o);if(void 0===e[1])return;var t,s=decodeURIComponent(e[1]),n=JSON.parse(s);a.each(n,function(o,e){void 0!==WPGlobusCustomize.controlInstances[o]&&(t="",t=(WPGlobusCustomize.controlInstances[o].type,WPGlobusCustomize.controlInstances[o].setting),n[o].value=t)});s=JSON.stringify(n);s=(s=encodeURIComponent(s)).replace(/%20/g,"+"),o=o.replace(e[1],s)}return o},ajaxListener:function(){a(document).on("ajaxSend",function(o,e,t){void 0!==t.data&&-1!=t.data.indexOf("wp_customize=on")&&-1!=t.data.indexOf("action=customize_save")&&(-1!=t.data.indexOf("customized=")?(c.customizeSave=!0,c.customizeSaveData=t.data):-1!=t.data.indexOf("customize_changeset_data=")&&(t.data=c.getChangesetData(t.data)))}),a(document).on("ajaxComplete",function(o,e,t){void 0!==e.responseText&&c.customizeSave&&(c.customizeSave=!1,c.ajax("wpglobus_customize_save"))}),a(document).on("ajaxStop",function(){c.customizeSave&&(c.customizeSave=!1,c.ajax("wpglobus_customize_save"))})}};WPGlobusCustomizeOptions=a.extend({},WPGlobusCustomizeOptions,c),WPGlobusCustomizeOptions.init()});
|
includes/js/wpglobus-media.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(n){"use strict";var a;"undefined"!=typeof WPGlobusCore&&"undefined"!=typeof WPGlobusMedia&&(a={content:{},save:!0,resetContent:!0,init:function(t){var e=n(".wpglobus-post-body-tabs");1==e.length&&(e.insertBefore(".wp_attachment_details"),e.tabs(),a.iniSet(),a.setContent(),a.attachListeners())},iniSet:function(){n.each(WPGlobusMedia.attachment,function(t,e){a.content[e]=n("#"+e).val(),n("#"+e).addClass("wpglobus-translatable")})},setContent:function(t){void 0===t
|
1 |
+
!function(n){"use strict";var a;"undefined"!=typeof WPGlobusCore&&"undefined"!=typeof WPGlobusMedia&&(a={content:{},save:!0,resetContent:!0,init:function(t){var e=n(".wpglobus-post-body-tabs");1==e.length&&(e.insertBefore(".wp_attachment_details"),e.tabs(),a.iniSet(),a.setContent(),a.attachListeners())},iniSet:function(){n.each(WPGlobusMedia.attachment,function(t,e){a.content[e]=n("#"+e).val(),n("#"+e).addClass("wpglobus-translatable")})},setContent:function(t){(t=void 0===t?!1:t)?n.each(WPGlobusMedia.attachment,function(t,e){n("#"+e).val(a.content[e])}):n.each(WPGlobusMedia.attachment,function(t,e){n("#"+e).val(WPGlobusCore.TextFilter(a.content[e],WPGlobusMedia.language,"RETURN_EMPTY"))})},attachListeners:function(){n(document).on("tabsactivate",".wpglobus-post-body-tabs",function(t,e){WPGlobusMedia.language=e.newTab[0].dataset.language,a.setContent()}),n.each(WPGlobusMedia.attachment,function(t,e){n(document).on("keyup","#"+e,function(t){a.content[t.currentTarget.id]=WPGlobusCore.getString(a.content[t.currentTarget.id],t.currentTarget.value,WPGlobusMedia.language)})}),n(document).on("mouseenter","#publish",function(t){a.setContent(a.save)}).on("mouseleave","#publish",function(t){a.resetContent&&a.setContent(),a.resetContent=!0}).on("click","#publish",function(t){a.resetContent=!1}),n(document).ajaxSend(function(t,e,n){void 0!==n.data&&-1!=n.data.indexOf("action=send-attachment-to-editor")&&(n.data=n.data+"&wpglobusLanguageTab="+WPGlobusAdmin.currentTab)})}},(WPGlobusMedia=n.extend({},WPGlobusMedia,a)).init())}(jQuery);
|
includes/js/wpglobus-options.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
jQuery(document).ready(function(e){"use strict";var
|
1 |
+
jQuery(document).ready(function(e){"use strict";var a;"undefined"!=typeof WPGlobusOptions&&(a={currentTabID:"",firstLanguageCb:null,init:function(){a.initTab(),a.checkHandlers(),a.addListeners(),a.initSpecs()},setCurrentTabID:function(t){a.currentTabID=t},getCurrentTabID:function(){return a.currentTabID},setFirstLanguageCb:function(){null!==a.firstLanguageCb&&a.firstLanguageCb.off("click"),e('#enabled_languages-list li input[type="checkbox"]').prop("disabled",!1);var t=e("#enabled_languages-list li").eq(0);a.firstLanguageCb=t.find('input[type="checkbox"]'),a.firstLanguageCb.prop("checked","checked"),a.firstLanguageCb.prop("disabled","disabled"),a.firstLanguageCb.css({visibility:"hidden"}),a.firstLanguageCb.on("click",function(t){return t.preventDefault(),!1})},handlerEnabled_languages:function(){e(".wpglobus-sortable").sortable({placeholder:"ui-state-highlight",update:function(t,n){e('#enabled_languages-list li input[type="checkbox"]').css({visibility:"visible"}),a.setFirstLanguageCb()}}),e(".wpglobus-sortable").disableSelection(),a.setFirstLanguageCb()},handlerLanguagesTable:function(){var s=e("#wpglobus-options-languagesTable").parents(".wpglobus-options-tab").data("tab");e("#wpglobus-options-languagesTable .manage-column.sortable a").each(function(t,n){var a=e(n).attr("href");-1!=a.indexOf("tab")?-1==a.indexOf("tab-from")&&(a=a.replace(/tab/,"tab-from"),a+="&tab="+s):a+="&tab="+s,e(n).attr("href",a)})},checkHandlers:function(){e(".wpglobus-options-field").each(function(t,n){if(void 0===e(n).data("js-handler"))return!0;n=e(n).data("js-handler");"function"==typeof a[n]&&a[n]()})},initTab:function(){var t=e("#section-tab-"+WPGlobusOptions.tab);a.setCurrentTabID(WPGlobusOptions.tab),0==t.length&&(a.setCurrentTabID(WPGlobusOptions.defaultTab),t=e("#section-tab-"+a.currentTabID)),t.css({display:"block"}),e("#wpglobus-tab-link-"+a.currentTabID).addClass("wpglobus-tab-link-active"),a.initLanguageTable(),e(".wpglobus-options-wrap .no-inline-js").attr("onclick","return false;"),setTimeout(function(){e("#section-tab-"+WPGlobusOptions.tab+" .wpglobus-options-menu .wpglobus-tab-link-subsection").eq(0).click()},200),a.tabActions(a.getCurrentTabID())},initLanguageTable:function(){var a,s,t=e(".wpglobus-the-language-item-installed");9<t.length||(a=[],t.each(function(t){var n=+e(this).data("order");a[n]=e(this)}),s=e("#wpglobus-options-languagesTable #the-list tr").eq(0),e.each(a,function(t,n){e(s).before(n)}))},addListeners:function(){e(document).on("click","input.wpglobus-enabled_languages",function(t){var n=e(this).prop("checked"),a=e(this).attr("rel");n?e("#"+a).val("1"):e("#"+a).val("")}),e(document).on("click",".wpglobus-tab-link",function(t){var n=e(this).data("tab");a.setCurrentTabID(n),window.history.pushState("data","Title",WPGlobusOptions.newUrl.replace("{*}",n)),e(".wpglobus-options-tab").css({display:"none"}),e("#section-tab-"+n).css({display:"block"}),e(".wpglobus-tab-link").removeClass("wpglobus-tab-link-active"),e("#wpglobus-tab-link-"+n).addClass("wpglobus-tab-link-active"),e("#wpglobus_options_current_tab").val(n),1==e("#section-tab-"+n+" .wpglobus-tab-link-subsection.wpglobus-tab-link-active").length?e("#section-tab-"+n+" .wpglobus-tab-link-subsection.wpglobus-tab-link-active").click():0<e("#section-tab-"+n+" .wpglobus-tab-link-subsection").length&&e("#section-tab-"+n+" .wpglobus-tab-link-subsection").eq(0).click(),a.tabActions(e(this))}),e(document).on("click",".wpglobus-tab-link-subsection",function(t){var n=e(this).data("tab");e(".wpglobus-options-tab-subsection").css({display:"none"}),e("#subsection-tab-"+n).css({display:"block"}),e(".wpglobus-tab-link-subsection").removeClass("wpglobus-tab-link-active"),e("#wpglobus-tab-link-subsection-"+n).addClass("wpglobus-tab-link-active")})},tabActions:function(t){0!=(t="string"==typeof t?e("#wpglobus-tab-link-"+t).eq(0):t).length&&(t.hasClass("wpglobus-tab-hide-submit-button")?e("#form-wpglobus-options .submit").addClass("hidden"):e("#form-wpglobus-options .submit").removeClass("hidden"))},initSpecs:function(){e(document).on("dblclick","#section-tab-customizer h2",function(t){e(".wpglobus-theme-info-spec").removeClass("hidden")}),e(document).on("dblclick",".column-wpglobus_flag",function(t){location=location.href+"&flags"})}},(WPGlobusOptions=e.extend({},WPGlobusOptions,a)).init())});
|
includes/js/wpglobus-plugin-install.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
jQuery(document).ready(function(
|
1 |
+
jQuery(document).ready(function(i){"use strict";var s;"undefined"!=typeof WPGlobusPluginInstall&&(s={pluginInstalled:'<li><span class="button button-disabled">'+WPGlobusPluginInstall.i18n.installed+"</span></li>",columnName:'<a href="{{href}}" class="" target="_blank">{{name}}<img src="{{img}}" class="plugin-icon"></a>',currentVersion:"<strong>"+WPGlobusPluginInstall.i18n.current_version+": </strong>{{version}}",showPreAddonsInfo:!0,init:function(){i.each(WPGlobusPluginInstall.pluginCard.paid,function(n,l){var a=".plugin-card-"+l;i(a+" .column-rating").css({visibility:"hidden"}),i(a+" .column-downloaded").css({visibility:"hidden"}),i(a+" .column-rating").css({display:"none"}),i(a+" .column-updated").css({display:"none"}),1==i(a+" .plugin-action-buttons li").length&&null!==WPGlobusPluginInstall.pluginData[l].plugin_data&&(i(a+" .plugin-action-buttons").prepend(s.pluginInstalled),s.showPreAddonsInfo=!1),i(a+" .plugin-action-buttons .button").each(function(n,l){i(l).hasClass("install-now")&&i(l).removeClass("install-now").addClass("wpglobus-install-now")}),i(a+" .plugin-action-buttons .wpglobus-install-now").attr("href",WPGlobusPluginInstall.pluginData[l].extra_data.product_url).attr("target","_blank"),i(a+" .open-plugin-details-modal").css({display:"none"});var t=s.columnName.replace("{{href}}",WPGlobusPluginInstall.pluginData[l].extra_data.details_url);t=(t=t.replace("{{name}}",WPGlobusPluginInstall.pluginData[l].card.name)).replace("{{img}}",WPGlobusPluginInstall.pluginData[l].card.icons["1x"]),i(a+" .column-name h3").html(t),null===WPGlobusPluginInstall.pluginData[l].plugin_data?i(a+" .column-updated").css({visibility:"hidden"}):i(a+" .column-updated").html(s.currentVersion.replace("{{version}}",WPGlobusPluginInstall.pluginData[l].plugin_data.Version)),i(a).prepend('<div class="plugin-card-header" style="text-align:center;height:40px;background-color:#00a0d2;padding-top:15px;"><h3 style="color:#fff;">'+WPGlobusPluginInstall.i18n.card_header+"</h3></div>")}),i(".plugin-action-buttons .wpglobus-install-now").css({"background-color":"#0f0"}).text(WPGlobusPluginInstall.i18n.get_it),i(".plugin-card.plugin-card-wpglobus-for-black-studio-widget a").each(function(n,l){var a=i(l),l=a.attr("href");-1===l.indexOf("wpglobus-for-black-studio-widget")||a.hasClass("button")||(l=l.replace("wpglobus-for-black-studio-widget",WPGlobusPluginInstall.pluginData["wpglobus-for-black-studio-widget"].extra_data.correctLink),a.attr("href",l))}),s.showPreAddonsInfoBlock()},showPreAddonsInfoBlock:function(){s.showPreAddonsInfo&&""!=WPGlobusPluginInstall.i18n.pre_addons_info&&i("#plugin-filter").prepend('<div style="color:#fff;text-align:center;height:70px;background-color:#00a0d2;margin-top:15px;"><h3 style="padding-top:22px;font-size:18px;color:#fff;">'+WPGlobusPluginInstall.i18n.pre_addons_info+"</h3></div>")}},(WPGlobusPluginInstall=i.extend({},WPGlobusPluginInstall,s)).init())});
|
includes/js/wpglobus-vendor-acf.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
jQuery(document).ready(function(
|
1 |
+
jQuery(document).ready(function(d){"use strict";var o;"undefined"!=typeof WPGlobusAcf&&(o={parseBool:function(e){return!/^(false|0)$/i.test(e)&&!!e},isPro:function(){return o.parseBool(WPGlobusAcf.pro)},isBuilder:function(){return o.parseBool(WPGlobusAcf.builder_id)},vendorAcfFields:null,option:{},init:function(e){o.isBuilder()&&"undefined"==typeof WPGlobusDialogApp||(o.option=d.extend(o.option,e),o.option.pro?(o.startAcf(".acf-field"),o.runActions()):(0<d(".acf_postbox .field").length&&o.startAcf(".acf_postbox .field"),0<d(".acf-postbox .acf-field").length&&o.startAcf(".acf-postbox .acf-field")),o.attachListeners())},runActions:function(){void 0!==WPGlobusAcf.actions.fixTextFields&&WPGlobusAcf.actions.fixTextFields&&o.fixTextFields()},fixTextFields:function(){d.each(WPGlobusAcf.fields,function(e,i){i=d('input[type="text"]#'+i);1!=i.length||1==(i=i.parent(".acf-input-wrap")).length&&i.hasClass("acf-input-wrap")&&i.css("height","auto")})},isDisabledField:function(t){var n=!1,o=d("#"+t).parents(".acf-field").attr("id");return void 0!==o&&d.each(WPGlobusAcf.disabledFields,function(e,i){i==o&&(n=!0)}),n||(d.each(WPGlobusAcf.disabledFields,function(e,i){i==t&&(n=!0)}),n)},startAcf:function(e){d(".acf_postbox").parents("#postbox-container-2").length,d(e).each(function(){var e,i,t=d(this);return t.hasClass("field_type-textarea")||t.hasClass("acf-field-textarea")?(e=t.find("textarea").attr("id"),o.registerField(e),!!o.isDisabledField(e)||(!o.isVendorAcfField(e)||(i=d("#"+e).height()+20,void WPGlobusDialogApp.addElement({id:e,dialogTitle:"Edit ACF field",style:"width:97%;float:left;",styleTextareaWrapper:"height:"+i+"px;",sbTitle:"Click for edit",onChangeClass:"wpglobus-on-change-acf-field"})))):t.hasClass("field_type-text")||t.hasClass("acf-field-text")?(e=t.find("input").attr("id"),o.registerField(e),!!o.isDisabledField(e)||(!o.isVendorAcfField(e)||void WPGlobusDialogApp.addElement({id:e,dialogTitle:"Edit ACF field",style:"width:97%;float:left;",sbTitle:"Click for edit",onChangeClass:"wpglobus-on-change-acf-field"}))):void 0})},registerField:function(e,i){var t=!1;return void 0!==e&&-1==e.indexOf("acfcloneindex")&&(o.isRegisteredField(e)||(t=!0,WPGlobusAcf.fields.push(e))),!!t&&e},getFields:function(){return WPGlobusAcf.fields},getDisabledFields:function(){return WPGlobusAcf.disabledFields},unificationField:function(e){return e=/acf\[/.test(e)?(e=e.replace("[","-")).replace("]",""):e},getVendorAcfFields:function(){if(null===o.vendorAcfFields){if("undefined"==typeof WPGlobusVendorAcfFields||""==WPGlobusVendorAcfFields)return o.vendorAcfFields=!1,o.vendorAcfFields;o.vendorAcfFields=WPGlobusVendorAcfFields.split(",")}return o.vendorAcfFields},isVendorAcfField:function(t){if(void 0===t)return!1;t=o.unificationField(t);var n=!1,e=o.getVendorAcfFields();return e&&d.each(e,function(e,i){if(i===t)return!(n=!0)}),n},isRegisteredField:function(i){var t=!1;return o.getFields().forEach(function(e){if(e==i)return!(t=!0)}),t},attachListeners:function(){var i;o.option.pro&&(i=this,acf.add_action&&acf.add_action("append",function(e){i.replaceCloneIndex(e)}))},replaceCloneIndex:function(e){var i=e.data("id");e.find('[data-source-id*="acfcloneindex"]').each(function(){d(this).attr("data-source-id",d(this).attr("data-source-id").replace("acfcloneindex",i))})}},(WPGlobusAcf=d.extend({},WPGlobusAcf,o)).init({pro:WPGlobusAcf.pro}))});
|
includes/js/wpglobus-vendor-aioseop.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(
|
1 |
+
!function(s){"use strict";var e;"undefined"!=typeof WPGlobusAioseop&&(e={addRules:!1,parseBool:function(a){return!/^(false|0)$/i.test(a)&&!!a},init:function(){0!=s("#aiosp_snippet_wrapper").size()&&(e.addRules=e.parseBool(WPGlobusAioseop.add_css_rules),s("#wpglobus-aioseop-tabs").removeClass("hidden wpglobus-hidden").tabs(),s("#wpglobus-aioseop-tabs").insertBefore(s("#aiosp_snippet_wrapper")),s("#aiosp_snippet_wrapper, #aiosp_title_wrapper, #aiosp_description_wrapper, #aiosp_keywords_wrapper").addClass("hidden"),e.setCounters(),e.addRules&&e.addCssRules(),e.tabDecoration(!0),e.attachListeners())},addCssRules:function(){s(".wpglobus-aioseop-general .aioseop_wrapper.aioseop_html_type").each(function(a,o){s(o).css({"border-radius":"4px",border:"1px solid #8d96a0",padding:"10px 10px 0","max-width":"97%","margin-bottom":"15px"})})},setCounters:function(){s(".wpglobus_countable").each(function(a,o){var e=s(o),t=0,o=e.data("field-count");void 0!==e.data("extra-element")&&(t=s("#"+e.data("extra-element")).data("extra-length")),s("input[name="+o+"]").val(e.val().length+t)})},countChars:function(a,o){var e=0,o="input[name="+o+"]",t=a.data("max-size");void 0!==a.data("extra-element")&&(e=s("#"+a.data("extra-element")).data("extra-length")),e=a.val().length+e,s(o).val(e),t<e?s(o).css({color:"#fff","background-color":"#f00"}):t-6<e?s(o).css({color:"#515151","background-color":"#ff0"}):s(o).css({color:"#515151","background-color":"#eee"})},tabDecoration:function(a){"boolean"==typeof(a=void 0===a?!1:a)&&a?s(".wpglobus-aioseop-tabs-list li#aioseop-link-tab-"+WPGlobusCoreData.default_language+" a").css({"border-top":"2px solid #00f"}):"string"==typeof a&&(s(".wpglobus-aioseop-tabs-list li a").css({"border-top":""}),s(".wpglobus-aioseop-tabs-list li#aioseop-link-tab-"+a+" a").css({"border-top":"2px solid #00f"}))},attachListeners:function(){s(".wpglobus_countable").on("keyup",function(a){var o=s(this);e.countChars(o,o.data("field-count"))}),s("#wpglobus-aioseop-tabs").on("tabsactivate",function(a,o){e.tabDecoration(s(o.newTab).data("language"))}),s("body").on("click",".wpglobus-post-body-tabs-list li",function(a){var o=s(this);o.hasClass("wpglobus-post-tab")&&(s("#wpglobus-aioseop-tabs").tabs("option","active",o.data("order")),e.tabDecoration(o.data("language")))}),s(".wpglobus-aioseop_title").on("keyup",function(a){var o=s(this);s("#aioseop_snippet_title_"+o.data("language")).text(o.val())}),s("body").on("change",".wpglobus-aioseop_title",function(a){var o=s(this),e="input[name=aiosp_title]";s(e).val(WPGlobusCore.getString(s(e).val(),o.val(),o.data("language")))}),s(".wpglobus-aioseop_description").on("keyup",function(a){var o=s(this);s("#aioseop_snippet_description_"+o.data("language")).text(o.val())}),s("body").on("change",".wpglobus-aioseop_description",function(a){var o=s(this),e="textarea[name=aiosp_description]";s(e).val(WPGlobusCore.getString(s(e).val(),o.val(),o.data("language")))}),s("body").on("change",".wpglobus-aioseop_keywords",function(a){var o=s(this),e="input[name=aiosp_keywords]";s(e).val(WPGlobusCore.getString(s(e).val(),o.val(),o.data("language")))})}},(WPGlobusAioseop=s.extend({},WPGlobusAioseop,e)).init())}(jQuery);
|
includes/js/wpglobus-widgets.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(
|
1 |
+
!function(g){"use strict";var s;"undefined"!=typeof WPGlobusWidgets&&(s={saveArbitraryTextOrHTML:!1,editor:{},languageBoxActive:!1,languageBoxTimeout:null,imageWidgets:{},init:function(){s.addElements(),s.attachListeners(),s.arbitraryTextOrHTML()},wysiwygClean:function(){g(".wpglobus-dialog-field").each(function(e,t){var i=g(t).data("source-id");1==g("#"+i+"-tmce").length&&(i=g(t).next(".wpglobus_dialog_start"),g(t).remove(),g(i).remove())})},setupWidgetControl:function(i,e,o){var a,n,d,l,t,r=!1;g.each(s.editor,function(e,t){if(t.widgetName==i)return!(r=!0)}),r||(""==(a=e.$el[0].id)&&(t=e.$el[0].offsetParent,void 0===(a=g(t).attr("id"))&&g(".widget").each(function(e,t){t=g(t).attr("id");if(-1!=t.indexOf(i))return a=t,!1})),n="#"+a+" #widget-"+i+"-text",t="#"+a+" #widget-"+i+"-title",s.editor[o.id]={},s.editor[o.id].widgetName=i,s.editor[o.id].controls=e,s.editor[o.id].sourceTitleSelector=t,s.editor[o.id].titleSelector=null,s.editor[o.id].sourceSelector=n,s.editor[o.id].content=g(n).val(),s.editor[o.id].saveSelector="#"+a+" #widget-"+i+"-savewidget",s.editor[o.id].languageSelector="#"+a+" .wpglobus-current-language",s.editor[o.id].inWidgetTitleSelector="#"+a+" .in-widget-title",t=WPGlobusCore.TextFilter(s.editor[o.id].content,WPGlobusCoreData.language,"RETURN_EMPTY"),g("#"+o.id).val(t),l=d="",g.each(WPGlobusCoreData.enabled_languages,function(e,t){d=(d=(d=(d=(d=(d=(d='<a href="#" onclick="return false;" class="item" data-widget-id="{{widgetID}}" data-source="{{source}}" data-editor-id="{{editorID}}" data-language="{{language}}" data-widget-name="{{widgetName}}" style="text-align:center;"><span>{{item}}</span></a>').replace("{{language}}",t)).replace("{{item}}",WPGlobusCoreData.en_language_name[t])).replace("{{widgetName}}",i)).replace("{{widgetID}}",a)).replace("{{editorID}}",o.id)).replace("{{source}}",n),l+=d}),t='<button style="z-index:200000;" type="button" id="'+o.id+'-wpglobus-button" data-widget-id="'+a+'"class="wp-switch-editor switch-wpglobus-language wpglobus-icon-globe"><span class="wpglobus-current-language" data-language="'+WPGlobusCoreData.language+'" style="">'+WPGlobusCoreData.language+'</span></button><div class="wpglobus-language-box" style="position:absolute;top:0;left:0;display:none;z-index:200100;border:1px solid #9e9e9e;border-radius:3px;background-color:#fff;padding: 2px 5px;"><div style="display:flex;flex-direction:column;">'+l+"</div></div>",g("#"+a+" .wp-editor-tabs").append(t),WPGlobusDialogApp.addElement({id:e.fields.title[0].id,style:"width:93%;"})&&(s.editor[o.id].titleSelector="#"+e.fields.title[0].id),s.arbitraryWidgetTitle(o.id),g(n).hasClass("hidden")&&(e=g(n).parent(),g(e).find("div.wpglobus-widgets.wpglobus_dialog_start.wpglobus_dialog_icon").css({display:"none"})))},arbitraryWidgetTitle:function(e){var t=WPGlobusCore.TextFilter(g("#"+s.editor[e].controls.fields.title[0].id).val(),WPGlobusCoreData.language);g(s.editor[e].inWidgetTitleSelector).text(": "+t)},setBoxTimeout:function(){s.languageBoxTimeout=setTimeout(function(){s.languageBoxActive=!1,g(".wpglobus-language-box").css({display:"none"})},1e3)},arbitraryTextOrHTML:function(){function i(e){var t,i="",i="keyup"==e.type&&"tinymce"==e.target.id?g(e.target).data("id"):e.target.id;s.editor[i]&&(t=g(s.editor[i].languageSelector).data("language"),e="",e=tinymce.get(i).isHidden()?g("#"+i).val():tinymce.get(i).getContent({format:"raw"}),s.editor[i].content=WPGlobusCore.getString(s.editor[i].content,e,t),g(s.editor[i].sourceSelector).val(s.editor[i].content))}g(document).on("click",".switch-wpglobus-language",function(e){var t,i;s.languageBoxActive||(s.languageBoxActive=!0,t=(i=g(this)).data("widget-id"),(i=i.position()).top+=34,i.left+=10,g("#"+t+" .wpglobus-language-box").css({display:"block",top:i.top+"px",left:i.left+"px"}),s.setBoxTimeout())}),g(document).on("mouseenter",".wpglobus-language-box",function(e){clearTimeout(s.languageBoxTimeout)}).on("mouseleave",".wpglobus-language-box",function(e){g(".wpglobus-language-box").css({display:"none"}),s.languageBoxActive=!1}),g(document).on("click",".wpglobus-language-box .item",function(e){var t=g(this),i=t.data("language"),o=t.data("widget-id"),t=t.data("editor-id");g("#"+o+" .wpglobus-current-language").text(i).data("language",i);i=WPGlobusCore.TextFilter(s.editor[t].content,i,"RETURN_EMPTY");tinymce.get(t).setContent(i,{format:"raw"}),g("textarea#"+t).val(i)}),g(document).on("tinymce-editor-setup",function(e,i){g.each(wp.textWidgets.widgetControls,function(e,t){s.setupWidgetControl(e,t,i)})}),g(document).on("tinymce-editor-init",function(e,t){g(document).on("mouseenter",s.editor[t.id].saveSelector,function(e){g(s.editor[t.id].sourceTitleSelector).val(g(s.editor[t.id].titleSelector).val()),g(s.editor[t.id].sourceSelector).val(s.editor[t.id].content)}),g(document).on("click",s.editor[t.id].saveSelector,function(e){s.saveArbitraryTextOrHTML=t.id}),t.on("nodechange keyup",_.debounce(i,100)),g("#"+t.id).on("keyup",_.debounce(i,100))})},addElements:function(e,t){var i,o=[];o[0]='input[type="text"]',o[1]="textarea",void 0===e||"class"==e?(i=".widget-liquid-right .widget .widget-content",g.each(o,function(e,t){s.makeClone(i,t)})):"id"==e&&(i="#"+t+" .widget-content",g.each(o,function(e,t){s.makeClone(i,t)}))},makeClone:function(e,d){g(e+" "+d).each(function(e,t){var i,o=g(t),a=!1,n=o.attr("id");return void 0===n||-1!=n.indexOf("-number")||""==n||(_.each(WPGlobusWidgets.disabledMask,function(e){if(-1!=n.indexOf(e))return!(a=!0)}),!!a||void(-1!=n.indexOf("-title")&&(i=g("#"+n).clone(),g(o).addClass("wpglobus-dialog-field-source hidden"),t=o.attr("name"),g(i).attr("id","wpglobus-"+n),g(i).attr("name","wpglobus-"+t),g(i).attr("data-source-id",n),g(i).attr("class","wpglobus-dialog-field"),g(i).attr("style","width:90%;"),t=WPGlobusCore.TextFilter(g(o).val(),WPGlobusCoreData.language),g(i).val(t),g('<div style="width:20px;" data-type="control" data-source-type="" data-source-id="'+n+'" class="wpglobus-widgets wpglobus_dialog_start wpglobus_dialog_icon"></div>').insertAfter(o),g(i).insertAfter(o),'input[type="text"]'==d&&""!=t&&(o=o.parents(".widget").attr("id"),g("#"+o+" .in-widget-title").text(": "+t)))))})},attachListeners:function(){g(document).ajaxComplete(function(e,t,i){if(-1!=i.data.indexOf("action=save-widget")&&-1==i.data.indexOf("delete_widget=1")){if(s.saveArbitraryTextOrHTML){var o=WPGlobusCore.TextFilter(s.editor[s.saveArbitraryTextOrHTML].content,g(s.editor[s.saveArbitraryTextOrHTML].languageSelector).data("language"),"RETURN_EMPTY");return tinymce.get(s.saveArbitraryTextOrHTML).isHidden()?(g("#"+s.saveArbitraryTextOrHTML).val(o),g("#"+s.saveArbitraryTextOrHTML+"-tmce").click()):tinymce.get(s.saveArbitraryTextOrHTML).setContent(o,{format:"raw"}),s.arbitraryWidgetTitle(s.saveArbitraryTextOrHTML),void(s.saveArbitraryTextOrHTML=!1)}var a=(a=i.data.split("widget-id="))[1].split("&");g(".widget-liquid-right .widget").each(function(e,t){t=g(t).attr("id");-1!==t.indexOf(a[0])&&(s.addElements("id",t),s.wysiwygClean())})}}),g("body").on("change",".wpglobus-dialog-field",function(){var i,o,a=g(this),e="#"+a.data("source-id"),n="";i=g(e).val(),/(\{:|\[:|<!--:)[a-z]{2}/.test(i)?(g.each(WPGlobusCoreData.enabled_languages,function(e,t){""!=(o=t==WPGlobusCoreData.language?a.val():WPGlobusCore.TextFilter(i,t,"RETURN_EMPTY"))&&(n+=WPGlobusCore.addLocaleMarks(o,t))}),g(e).val(n)):g(e).val(a.val())}),g(document).on("click",".widget-title, .widget-title-action",function(e){e.preventDefault(),s.wysiwygClean(),s.setImageWidget(this)})},getImageWidgets:function(e){return s.imageWidgets},setImageWidget:function(e){e=g(e).parents(".widget").attr("id");void 0!==e&&-1!=e.indexOf("media_image")&&void 0===s.imageWidgets[e]&&(g('<hr /><div class="">'+WPGlobusWidgets.l10n.imageWidget.suggest+"</div>").appendTo("#"+e+" .widget-inside"),s.imageWidgets[e]=!0)},__getEditorContent:function(){if(0!=Object.keys(s.editor).length)for(var i in console.log("WPGlobusWidgets editors length is: ",Object.keys(s.editor).length),s.editor)console.log("editor : ",i," -> widgetName: ",s.editor[i].widgetName),console.log("source content: ",s.editor[i].content),g.each(WPGlobusCoreData.enabled_languages,function(e,t){console.log("Language: ",t);t=WPGlobusCore.TextFilter(s.editor[i].content,t,"RETURN_EMPTY");""==t?console.log("empty"):console.log("Content: ",t)}),console.log("--------------------");else console.log("WPGlobusWidgets editors length is: 0")},__getEditorLanguage:function(){if(0!=Object.keys(s.editor).length)for(var e in console.log("WPGlobusWidgets editors length is: ",Object.keys(s.editor).length),s.editor)console.log("editor : ",e," -> widgetName: ",s.editor[e].widgetName),console.log("current language : ",g(s.editor[e].languageSelector).data("language")),console.log("--------------------");else console.log("WPGlobusWidgets editors length is: 0")}},WPGlobusWidgets=g.extend({},WPGlobusWidgets,s))}(jQuery);
|
includes/js/wpglobus-wpseo-21.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var wpglobus_wpseo=function(){var
|
1 |
+
var wpglobus_wpseo=function(){var r,p,e,u,c,d,g;function _(e,t,a){a=yst_escapeFocusKw(jQuery.trim(jQuery("#"+wpseoMetaboxL10n.field_prefix+"focuskw_"+a).val()));if(""==a)return e;for(var s=-1!=a.search(" ")?a.split(" "):new Array(a),o=0;o<s.length;o++){var n=yst_clean(s[o]),l="",l=t?(n=n.replace(" ","-").toLowerCase(),new RegExp("([-/])("+n+")([-/])?")):new RegExp("(^|[ s\n\r\t.,'(\"+;!?:-]+)("+n+")($|[ s\n\r\t.,')\"+;!?:-]+)","gim");null!=e&&(e=e.replace(l,"$1<strong>$2</strong>$3"))}return e}function w(a){var e,t=jQuery.trim(yst_clean(jQuery("#"+wpseoMetaboxL10n.field_prefix+"metadesc_"+a).val())),s=jQuery("<div />"),o=jQuery("#wpseosnippet_"+a);""!=(t=""==t&&""!=wpseoMetaboxL10n.wpseo_metadesc_template?wpseoMetaboxL10n.wpseo_metadesc_template:t)?t=yst_replaceVariables(t,function(e){var t;e=s.text(e).html(),e=yst_clean(e),t=(t=wpseoMetaboxL10n.wpseo_meta_desc_length-e.length)<0?'<span class="wrong">'+t+"</span>":'<span class="good">'+t+"</span>",jQuery("#"+wpseoMetaboxL10n.field_prefix+"metadesc-length_"+a).html(t),e=_(e=yst_trimDesc(e),!1),o.find(".desc span.autogen").html(""),o.find(".desc span.content").html(e),y(a)}):(jQuery("#"+wpseoMetaboxL10n.field_prefix+"metadesc-length_"+a).html(wpseoMetaboxL10n.wpseo_meta_desc_length),o.find(".desc span.content").html(""),y(a),e="#content",a!=WPGlobusAdmin.data.default_language&&(e="#content_"+a),jQuery(e).length&&(t=jQuery(e).val(),t=yst_clean(t)),t=_(t=""!=(e=yst_escapeFocusKw(jQuery.trim(jQuery("#"+wpseoMetaboxL10n.field_prefix+"focuskw_"+a).val())))?(e=new RegExp(e,"gim"),-1!=t.search(e)&&t.length>wpseoMetaboxL10n.wpseo_meta_desc_length?t.substr(t.search(e),wpseoMetaboxL10n.wpseo_meta_desc_length):t.substr(0,wpseoMetaboxL10n.wpseo_meta_desc_length)):t.substr(0,wpseoMetaboxL10n.wpseo_meta_desc_length),!1),t=yst_trimDesc(t),o.find(".desc span.autogen").html(t))}function y(e){var t=jQuery.trim(jQuery("#"+wpseoMetaboxL10n.field_prefix+"focuskw_"+e).val()),t=yst_escapeFocusKw(t).toLowerCase(),a="#title",s="#content";e!=WPGlobusAdmin.data.default_language&&(a="#title_"+e,s="#content_"+e);var o,n=jQuery(document).triggerHandler("wpglobus_post_name_full",{postnamefull:"#editable-post-name-full",language:e})||"#editable-post-name-full";jQuery(n).length&&(p=jQuery(n).text(),o=wpseoMetaboxL10n.wpseo_permalink_template.replace("%postname%",p).replace("http://",""));var l=new RegExp("(^|[ s\n\r\t.,'(\"+;!?:-])"+t+"($|[ s\n\r\t.,')\"+!?:;-])","gim"),r=removeLowerCaseDiacritics(t),n=new RegExp(r.replace(/\s+/g,"[-_\\//]"),"gim"),p=jQuery("#focuskwresults_"+e),r=jQuery("#wpseosnippet_"+e).find(".desc span.content").text();""!=t?(t="<p>"+wpseoMetaboxL10n.keyword_header+"</p>",t+="<ul>",jQuery(a).length&&(t+="<li>"+wpseoMetaboxL10n.article_header_text+ptest(jQuery(a).val(),l)+"</li>"),t+="<li>"+wpseoMetaboxL10n.page_title_text+ptest(jQuery("#wpseosnippet_title_"+e).text(),l)+"</li>",t+="<li>"+wpseoMetaboxL10n.page_url_text+ptest(o,n)+"</li>",jQuery(s).length&&(t+="<li>"+wpseoMetaboxL10n.content_text+ptest(jQuery(s).val(),l)+"</li>"),t+="<li>"+wpseoMetaboxL10n.meta_description_text+ptest(r,l)+"</li>",p.html(t+="</ul>")):p.html("")}"undefined"!=typeof wpseoMetaboxL10n&&(r=function(e,a){var t="",s=jQuery("#"+wpseoMetaboxL10n.field_prefix+"title_"+a),o=jQuery("#"+wpseoMetaboxL10n.field_prefix+"title-length-warning_"+a),n=jQuery("<div />"),l=jQuery("#wpseosnippet_title_"+a);if(""==(t=s.val()?s.val():(t=wpseoMetaboxL10n.wpseo_title_template,n.html(t).text())))return l.html(""),void o.hide();t=yst_clean(t),t=jQuery.trim(t),t=n.text(t).html(),e&&s.val(t),t=function(t,e,a){if(void 0===t)return"";if("undefined"==typeof replacedVars&&0==jQuery("#title").size())return t;var s="#title",o="#excerpt-"+e,n="#content";if(e!=WPGlobusAdmin.data.default_language&&(s="#title_"+e,n="#content_"+e),t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=jQuery(s).length?t.replace(/%%title%%/g,jQuery(s).val()):t).replace(/%%sitedesc%%/g,WPGlobusAdmin.data.blogdescription[e])).replace(/%%sitename%%/g,WPGlobusAdmin.data.blogname[e])).replace(/%%sep%%/g,wpseoMetaboxL10n.sep)).replace(/%%date%%/g,wpseoMetaboxL10n.date)).replace(/%%id%%/g,wpseoMetaboxL10n.id)).replace(/%%page%%/g,wpseoMetaboxL10n.page)).replace(/%%currenttime%%/g,wpseoMetaboxL10n.currenttime)).replace(/%%currentdate%%/g,wpseoMetaboxL10n.currentdate)).replace(/%%currentday%%/g,wpseoMetaboxL10n.currentday)).replace(/%%currentmonth%%/g,wpseoMetaboxL10n.currentmonth)).replace(/%%currentyear%%/g,wpseoMetaboxL10n.currentyear)).replace(/%%focuskw%%/g,jQuery("#yoast_wpseo_focuskw_"+e).val()),e="",jQuery(o).length&&(e=yst_clean(jQuery(o).val()),t=t.replace(/%%excerpt_only%%/g,e)),""==e&&jQuery(n).length&&(e=jQuery(n).val().replace(/(<([^>]+)>)/gi,"").substring(0,wpseoMetaboxL10n.wpseo_meta_desc_length-1)),t=t.replace(/%%excerpt%%/g,e),jQuery("#parent_id").length&&jQuery("#parent_id option:selected").text()!=wpseoMetaboxL10n.no_parent_text&&(t=t.replace(/%%parent_title%%/g,jQuery("#parent_id option:selected").text())),e=yst_escapeFocusKw(wpseoMetaboxL10n.sep),e=new RegExp(e+" "+e,"g"),-1!=(t=t.replace(e,wpseoMetaboxL10n.sep)).indexOf("%%")&&null!=t.match(/%%[a-z0-9_-]+%%/i))for(regex=/%%[a-z0-9_-]+%%/gi,matches=t.match(regex),i=0;i<matches.length;i++)null!=replacedVars[matches[i]]?t=t.replace(matches[i],replacedVars[matches[i]]):(replaceableVar=matches[i],replacedVars[replaceableVar]="",jQuery.post(ajaxurl,{action:"wpseo_replace_vars",string:matches[i],post_id:jQuery("#post_ID").val(),_wpnonce:wpseoMetaboxL10n.wpseo_replace_vars_nonce},function(e){e&&(replacedVars[replaceableVar]=e),yst_replaceVariables(t,a)}));a(t)}(t,a,function(e){var t=n.html(e).text();s.attr("placeholder",t),e=_(e=yst_clean(e),!1,a),jQuery("#wpseosnippet_title_"+a).html(e);e=document.getElementById("wpseosnippet_title_"+a);null!=e&&(e.scrollWidth>e.clientWidth?o.show():o.hide()),y(a)})},p=function(e){r(!1,e),w(e)},jQuery("#wpglobus-wpseo-tabs").tabs(),e=jQuery("#wpglobus-wpseo-attr"),u=jQuery(".wpseotab.general .form-table"),g=e.data("ids"),c=e.data("names"),d="",g=(g=g+","+e.data("qtip")).split(","),c=c.split(","),jQuery("#wpglobus-wpseo-tabs").insertBefore(u),jQuery(".wpglobus-wpseo-general").each(function(e,t){var n,l,s=jQuery(t),o=s.data("language");s.html('<table class="form-table wpglobus-table-'+o+'" data-language="'+o+'">'+u.html()+"</table>"),jQuery.each(c,function(e,t){jQuery("#"+t).attr("name",t+"_"+o)}),jQuery.each(g,function(e,t){var a=jQuery("#"+t);"wpseosnippet"==t&&a.addClass("wpglobus-wpseosnippet"),"focuskwresults"==t&&a.addClass("wpglobus-focuskwresults"),wpseoMetaboxL10n.field_prefix+"metadesc"==t&&a.addClass("wpglobus-wpseo_metadesc").text(s.data("metadesc")),wpseoMetaboxL10n.field_prefix+"title"==t&&a.addClass("wpglobus-wpseo_title").val(s.data("wpseotitle")),wpseoMetaboxL10n.field_prefix+"focuskw"==t&&a.addClass("wpglobus-wpseo_focuskw").val(s.data("focuskw")),a.attr("id",t+"_"+o),jQuery("#"+t+"_"+o).attr("data-language",o)}),d="complete"==s.data("permalink")?s.data("url-"+o):s.data("url-"+o)+jQuery("#editable-post-name-full").text()+"/",jQuery("#wpseosnippet_"+o+" .url").text(d),p(o),void 0!==jQuery().autocomplete&&(n={},jQuery("#"+wpseoMetaboxL10n.field_prefix+"focuskw_"+o).autocomplete({minLength:3,formatResult:function(e){return jQuery("<div/>").html(e).html()},source:function(e,s){var o=e.term;o in n?s(n[o]):(e._ajax_nonce=wpseoMetaboxL10n.wpseo_keyword_suggest_nonce,e.action="wpseo_get_suggest",l=jQuery.getJSON(ajaxurl,e,function(e,t,a){n[o]=e,a===l&&s(e)}))}})),jQuery("#"+wpseoMetaboxL10n.field_prefix+"title_"+o).keyup(function(){r(!1,jQuery(this).data("language"))}),jQuery("#title_"+o).keyup(function(){var e=jQuery(this).data("language")?jQuery(this).data("language"):WPGlobusAdmin.data.default_language;r(!1,e),w(e)}),0==e&&jQuery("#title").keyup(function(){r(!1,WPGlobusAdmin.data.default_language),w(WPGlobusAdmin.data.default_language)}),0==e&&jQuery("body").on("change","#parent_id",function(){jQuery.each(WPGlobusAdmin.data.enabled_languages,function(e,t){r(!1,t),w(t)})}),jQuery("#"+wpseoMetaboxL10n.field_prefix+"metadesc_"+o).keyup(function(){w(jQuery(this).data("language"))}),jQuery("body").on("keyup","#excerpt-"+o,function(){w(jQuery(this).data("language")?jQuery(this).data("language"):WPGlobusAdmin.data.default_language)}),0==e&&jQuery(".wpglobus-editor").focusout(function(){w(jQuery(this).data("language"))});var a=!1;jQuery(document).on("change","#"+wpseoMetaboxL10n.field_prefix+"focuskw_"+o,function(){var e=jQuery(this).data("language"),t=jQuery("#focuskwhelp_"+e);-1!=jQuery("#"+wpseoMetaboxL10n.field_prefix+"focuskw_"+e).val().search(",")?(t.click(),a=!0):a&&(t.qtip("hide"),a=!1),p(e)})}),u.addClass("hidden"),jQuery("body").on("change",".wpglobus-wpseo_metadesc",function(e){var t="#"+wpseoMetaboxL10n.field_prefix+"metadesc",a=jQuery(this);jQuery(t).val(WPGlobusCore.getString(jQuery(t).val(),a.val(),a.data("language")))}),jQuery("body").on("change",".wpglobus-wpseo_title",function(e){var t="#"+wpseoMetaboxL10n.field_prefix+"title",a=jQuery(this);jQuery(t).val(WPGlobusCore.getString(jQuery(t).val(),a.val(),a.data("language")))}),jQuery("body").on("change",".wpglobus-wpseo_focuskw",function(e){var t="#"+wpseoMetaboxL10n.field_prefix+"focuskw",a=jQuery(this);jQuery(t).val(WPGlobusCore.getString(jQuery(t).val(),a.val(),a.data("language")))}),jQuery("body").on("click",".wpglobus-post-body-tabs-list li",function(e){$this=jQuery(this),$this.hasClass("wpglobus-post-tab")&&jQuery("#wpglobus-wpseo-tabs").tabs("option","active",jQuery(this).data("order"))}),jQuery(".yoast_help").qtip({content:{attr:"alt"},position:{my:"bottom left",at:"top center"},style:{tip:{corner:!0},classes:"yoast-qtip qtip-rounded qtip-blue"},show:{when:{event:"mouseover"}},hide:{fixed:!0,when:{event:"mouseout"}}}),yst_updateSnippet())};
|
includes/js/wpglobus-wpseo-22.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
"use strict";var wpglobus_wpseo=function(){var r,u,e,p,i,c,d;function
|
1 |
+
"use strict";var wpglobus_wpseo=function(){var r,u,e,p,i,c,d;function o(e,t,a){a=ystEscapeFocusKw(jQuery.trim(jQuery("#"+wpseoMetaboxL10n.field_prefix+"focuskw_"+a).val()));if(""===a)return e;for(var s=-1!==a.search(" ")?a.split(" "):new Array(a),n=0;n<s.length;n++){var o=ystClean(s[n]),l="",l=t?(o=o.replace(" ","-").toLowerCase(),new RegExp("([-/])("+o+")([-/])?")):new RegExp("(^|[ \\s\n\r\t\\.,'\\(\"\\+;!?:\\-]+)("+o+")($|[ \\s\n\r\t\\.,'\\)\"\\+;!?:\\-]+)","gim");void 0!==e&&(e=e.replace(l,"$1<strong>$2</strong>$3"))}return e}function g(a){var e,t=jQuery.trim(ystClean(jQuery("#"+wpseoMetaboxL10n.field_prefix+"metadesc_"+a).val())),s=jQuery("<div />"),n=jQuery("#wpseosnippet_"+a);""!==(t=""===t&&""!==wpseoMetaboxL10n.wpseo_metadesc_template?wpseoMetaboxL10n.wpseo_metadesc_template:t)?t=ystReplaceVariables(t,function(e){e=s.text(e).html(),e=ystClean(e);var t=(t=wpseoMetaboxL10n.wpseo_meta_desc_length-e.length)<0?'<span class="wrong">'+t+"</span>":'<span class="good">'+t+"</span>";jQuery("#"+wpseoMetaboxL10n.field_prefix+"metadesc-length_"+a).html(t),e=o(e=ystSanitizeDesc(e),!1),n.find(".desc span.autogen").html(""),n.find(".desc span.content").html(e),y(a)}):(jQuery("#"+wpseoMetaboxL10n.field_prefix+"metadesc-length_"+a).html(wpseoMetaboxL10n.wpseo_meta_desc_length),n.find(".desc span.content").html(""),y(a),e="#content",a!=WPGlobusAdmin.data.default_language&&(e="#content_"+a),"undefined"!=typeof tinyMCE&&null!==tinyMCE.get("excerpt-"+a)&&(t=tinyMCE.get("excerpt-"+a).getContent(),t=ystClean(t)),"undefined"!=typeof tinyMCE&&null!==tinyMCE.get(e)&&0===t.length&&(t=tinyMCE.get(e).getContent(),t=ystClean(t)),t=o(t=""!==(e=ystEscapeFocusKw(jQuery.trim(jQuery("#"+wpseoMetaboxL10n.field_prefix+"focuskw_"+a).val())))?(e=new RegExp(e,"gim"),-1!==t.search(e)&&t.length>wpseoMetaboxL10n.wpseo_meta_desc_length?t.substr(t.search(e),wpseoMetaboxL10n.wpseo_meta_desc_length):t.substr(0,wpseoMetaboxL10n.wpseo_meta_desc_length)):t.substr(0,wpseoMetaboxL10n.wpseo_meta_desc_length),!1),t=ystSanitizeDesc(t),n.find(".desc span.autogen").html(t))}function y(e){var t,a=jQuery.trim(jQuery("#"+wpseoMetaboxL10n.field_prefix+"focuskw_"+e).val()),a=ystEscapeFocusKw(a).toLowerCase(),s="#title",n="#content";e!=WPGlobusAdmin.data.default_language&&(s="#title_"+e,n="#content_"+e);var o=jQuery(document).triggerHandler("wpglobus_post_name_full",{postnamefull:"#editable-post-name-full",language:e})||"#editable-post-name-full";jQuery(o).length&&(u=jQuery(o).text(),t=wpseoMetaboxL10n.wpseo_permalink_template.replace("%postname%",u).replace("http://",""));var l=new RegExp("(^|[ \\s\n\r\t\\.,'\\(\"\\+;!?:\\-])"+ystRemoveLowerCaseDiacritics(a)+"($|[\\s\n\r\t.,'\\)\"\\+!?:;\\-])","gim"),r=ystRemoveLowerCaseDiacritics(a),o=new RegExp(r.replace(/\s+/g,"[-_\\//]"),"gim"),u=jQuery("#focuskwresults_"+e),r=jQuery("#wpseosnippet_"+e).find(".desc span.content").text();""!==a?(a="<p>"+wpseoMetaboxL10n.keyword_header+"</p>",a+="<ul>",jQuery(s).length&&(a+="<li>"+wpseoMetaboxL10n.article_header_text+ystFocusKwTest(jQuery(s).val(),l)+"</li>"),a+="<li>"+wpseoMetaboxL10n.page_title_text+ystFocusKwTest(jQuery("#wpseosnippet_title_"+e).text(),l)+"</li>",a+="<li>"+wpseoMetaboxL10n.page_url_text+ystFocusKwTest(t,o)+"</li>",jQuery(n).length&&(a+="<li>"+wpseoMetaboxL10n.content_text+ystFocusKwTest(jQuery(n).val(),l)+"</li>"),a+="<li>"+wpseoMetaboxL10n.meta_description_text+ystFocusKwTest(r,l)+"</li>",u.html(a+="</ul>")):u.html("")}"undefined"!=typeof wpseoMetaboxL10n&&(r=function(e,t){var a="",s=jQuery("#"+wpseoMetaboxL10n.field_prefix+"title_"+t),n=jQuery("#"+wpseoMetaboxL10n.field_prefix+"title-length-warning_"+t),o=jQuery("<div />"),l=jQuery("#wpseosnippet_title_"+t);if(""===(a=s.val()?s.val().replace(/(<([^>]+)>)/gi,""):(a=wpseoMetaboxL10n.wpseo_title_template,o.html(a).text())))return l.html(""),void n.hide();a=ystClean(a),a=jQuery.trim(a),a=o.text(a).html(),e&&s.val(a),a=function(e,t,a){if(void 0!==e){if("undefined"==typeof replacedVars&&0==jQuery("#title").size())return e;var s="#title",n="#excerpt-"+t,o="#content";t!=WPGlobusAdmin.data.default_language&&(s="#title_"+t,o="#content_"+t),e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=jQuery(s).length?e.replace(/%%title%%/g,jQuery(s).val().replace(/(<([^>]+)>)/gi,"")):e).replace(/%%sitedesc%%/g,WPGlobusAdmin.data.blogdescription[t])).replace(/%%sitename%%/g,WPGlobusAdmin.data.blogname[t])).replace(/%%sep%%/g,wpseoMetaboxL10n.sep)).replace(/%%date%%/g,wpseoMetaboxL10n.date)).replace(/%%id%%/g,wpseoMetaboxL10n.id)).replace(/%%page%%/g,wpseoMetaboxL10n.page)).replace(/%%currenttime%%/g,wpseoMetaboxL10n.currenttime)).replace(/%%currentdate%%/g,wpseoMetaboxL10n.currentdate)).replace(/%%currentday%%/g,wpseoMetaboxL10n.currentday)).replace(/%%currentmonth%%/g,wpseoMetaboxL10n.currentmonth)).replace(/%%currentyear%%/g,wpseoMetaboxL10n.currentyear)).replace(/%%focuskw%%/g,jQuery("#yoast_wpseo_focuskw_"+t).val().replace(/(<([^>]+)>)/gi,""));t="";jQuery(n).length&&(t=ystClean(jQuery(n).val().replace(/(<([^>]+)>)/gi,"")),e=e.replace(/%%excerpt_only%%/g,t)),""===t&&jQuery(o).length&&(t=jQuery(o).val().replace(/(<([^>]+)>)/gi,"").substring(0,wpseoMetaboxL10n.wpseo_meta_desc_length-1)),e=e.replace(/%%excerpt%%/g,t),jQuery("#parent_id").length&&jQuery("#parent_id option:selected").text()!==wpseoMetaboxL10n.no_parent_text&&(e=e.replace(/%%parent_title%%/g,jQuery("#parent_id option:selected").text()));t=ystEscapeFocusKw(wpseoMetaboxL10n.sep),t=new RegExp(t+" "+t,"g");if(-1!==(e=e.replace(t,wpseoMetaboxL10n.sep)).indexOf("%%")&&null!==e.match(/%%[a-z0-9_-]+%%/i))for(var l,r=e.match(/%%[a-z0-9_-]+%%/gi),u=0;u<r.length;u++)void 0===replacedVars[r[u]]?e=e.replace(r[u],replacedVars[r[u]]):(l=r[u],replacedVars[l]="",ystAjaxReplaceVariables(l,a));a(e)}}(a,t,function(e){e=ystSanitizeTitle(e),jQuery("#wpseosnippet_title_"+t).html(e);e=o.html(e).text();s.attr("placeholder",e);e=document.getElementById("wpseosnippet_title_"+t);null!==e&&(e.scrollWidth>e.clientWidth?n.show():n.hide()),y(t)})},u=function(e){r(!1,e),g(e)},jQuery("#wpglobus-wpseo-tabs").tabs(),e=jQuery("#wpglobus-wpseo-attr"),p=jQuery(".wpseotab.general .form-table"),d=e.data("ids"),i=e.data("names"),c="",d=(d=d+","+e.data("qtip")).split(","),i=i.split(","),jQuery("#wpglobus-wpseo-tabs").insertBefore(p),jQuery(".wpglobus-wpseo-general").each(function(e,t){var o,l,s=jQuery(t),n=s.data("language");s.html('<table class="form-table wpglobus-table-'+n+'" data-language="'+n+'">'+p.html()+"</table>"),jQuery.each(i,function(e,t){jQuery("#"+t).attr("name",t+"_"+n)}),jQuery.each(d,function(e,t){var a=jQuery("#"+t);"wpseosnippet"==t&&a.addClass("wpglobus-wpseosnippet"),"focuskwresults"==t&&a.addClass("wpglobus-focuskwresults"),wpseoMetaboxL10n.field_prefix+"metadesc"==t&&a.addClass("wpglobus-wpseo_metadesc").text(s.data("metadesc")),wpseoMetaboxL10n.field_prefix+"title"==t&&a.addClass("wpglobus-wpseo_title").val(s.data("wpseotitle")),wpseoMetaboxL10n.field_prefix+"focuskw"==t&&a.addClass("wpglobus-wpseo_focuskw").val(s.data("focuskw")),a.attr("id",t+"_"+n),jQuery("#"+t+"_"+n).attr("data-language",n)}),c="complete"==s.data("permalink")?s.data("url-"+n):s.data("url-"+n)+jQuery("#editable-post-name-full").text()+"/",jQuery("#wpseosnippet_"+n+" .url").text(c),u(n),void 0!==jQuery().autocomplete&&(o={},jQuery("#"+wpseoMetaboxL10n.field_prefix+"focuskw_"+n).autocomplete({minLength:3,formatResult:function(e){return jQuery("<div/>").html(e).html()},source:function(e,s){var n=e.term;n in o?s(o[n]):(e._ajax_nonce=wpseoMetaboxL10n.wpseo_keyword_suggest_nonce,e.action="wpseo_get_suggest",l=jQuery.getJSON(ajaxurl,e,function(e,t,a){o[n]=e,a===l&&s(e)}))}})),jQuery("#"+wpseoMetaboxL10n.field_prefix+"title_"+n).keyup(function(){r(!1,jQuery(this).data("language"))}),jQuery("#title_"+n).keyup(function(){var e=jQuery(this).data("language")?jQuery(this).data("language"):WPGlobusAdmin.data.default_language;r(!1,e),g(e)}),0==e&&jQuery("#title").keyup(function(){r(!1,WPGlobusAdmin.data.default_language),g(WPGlobusAdmin.data.default_language)}),0==e&&jQuery("body").on("change","#parent_id",function(){jQuery.each(WPGlobusAdmin.data.enabled_languages,function(e,t){r(!1,t),g(t)})}),jQuery("#"+wpseoMetaboxL10n.field_prefix+"metadesc_"+n).keyup(function(){g(jQuery(this).data("language"))}),jQuery("body").on("keyup","#excerpt-"+n,function(){g(jQuery(this).data("language")?jQuery(this).data("language"):WPGlobusAdmin.data.default_language)}),0==e&&jQuery(".wpglobus-editor").focusout(function(){g(jQuery(this).data("language"))});var a=!1;jQuery(document).on("change","#"+wpseoMetaboxL10n.field_prefix+"focuskw_"+n,function(){var e=jQuery(this).data("language"),t=jQuery("#focuskwhelp_"+e);-1!=jQuery("#"+wpseoMetaboxL10n.field_prefix+"focuskw_"+e).val().search(",")?(t.click(),a=!0):a&&(t.qtip("hide"),a=!1),u(e)})}),p.addClass("hidden"),jQuery("body").on("change",".wpglobus-wpseo_metadesc",function(e){var t="#"+wpseoMetaboxL10n.field_prefix+"metadesc",a=jQuery(this);jQuery(t).val(WPGlobusCore.getString(jQuery(t).val(),a.val(),a.data("language")))}),jQuery("body").on("change",".wpglobus-wpseo_title",function(e){var t="#"+wpseoMetaboxL10n.field_prefix+"title",a=jQuery(this);jQuery(t).val(WPGlobusCore.getString(jQuery(t).val(),a.val(),a.data("language")))}),jQuery("body").on("change",".wpglobus-wpseo_focuskw",function(e){var t="#"+wpseoMetaboxL10n.field_prefix+"focuskw",a=jQuery(this);jQuery(t).val(WPGlobusCore.getString(jQuery(t).val(),a.val(),a.data("language")))}),jQuery("body").on("click",".wpglobus-post-body-tabs-list li",function(e){jQuery(this).hasClass("wpglobus-post-tab")&&jQuery("#wpglobus-wpseo-tabs").tabs("option","active",jQuery(this).data("order"))}),jQuery(".yoast_help").qtip({content:{attr:"alt"},position:{my:"bottom left",at:"top center"},style:{tip:{corner:!0},classes:"yoast-qtip qtip-rounded qtip-blue"},show:"click",hide:{fixed:!0,delay:500}}),ystUpdateSnippet())};
|
includes/js/wpglobus-yoastseo-120.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
jQuery(document).ready(function(
|
1 |
+
jQuery(document).ready(function(s){"use strict";var a;"undefined"!=typeof wpseoReplaceVarsL10n&&"undefined"!=typeof WPGlobusCoreData&&"undefined"!=typeof WPGlobusVendor&&(a={initSeoAnalysis:!1,initReadability:!1,parseBool:function(e){return!/^(false|0)$/i.test(e)&&!!e},moduleState:function(){return"string"==typeof WPGlobusYoastSeo.plus_module&&""!=WPGlobusYoastSeo.plus_module?WPGlobusYoastSeo.plus_module:a.parseBool(WPGlobusYoastSeo.plus_access)},isPremium:function(){return WPGlobusVendor.vendor.WPSEO_PREMIUM},isDefaultLanguage:function(){return a.parseBool(WPGlobusYoastSeo.is_default_language)},isBuilderPage:function(){return a.parseBool(WPGlobusYoastSeo.builder_page)},getSuggest:function(e){var t="";return void 0===e?t:("inactive"===a.moduleState()?"keyword"==e?t=WPGlobusVendor.i18n.yoastseo_plus_meta_keywords_inactive:"analysis"==e?t=WPGlobusVendor.i18n.yoastseo_plus_page_analysis_inactive:"readability"==e&&(t=WPGlobusVendor.i18n.yoastseo_plus_readability_inactive):"boolean"!=typeof a.moduleState()||a.moduleState()||("keyword"==e?t=WPGlobusVendor.i18n.yoastseo_plus_meta_keywords_access:"analysis"==e?t=WPGlobusVendor.i18n.yoastseo_plus_page_analysis_access:"readability"==e&&(t=WPGlobusVendor.i18n.yoastseo_plus_readability_access)),t='<div class="wpglobus-suggest" style="font-weight:bold;border:1px solid rgb(221, 221, 221);height:35px;width:90%;padding:8px 10px;">'+t+"</div>")},init:function(){a.isBuilderPage()&&a.start()},start:function(){a.isDefaultLanguage()||(a.setMetaBoxTitle(),"inactive"!=a.moduleState()&&a.moduleState()||(a.setKeywordField(),a.setSeoAnalysis(),a.setReadability()))},setKeywordField:function(){setTimeout(function(){var e=s("#focus-keyword-input-metabox").parent("div");1==e.length&&e.empty().append(a.getSuggest("keyword"))},2e3)},setReadability:function(){var e=s(".yoast-aria-tabs li").eq(1);s(document).on("click",e,function(e){a.initReadability||setTimeout(function(){s("#wpseo-meta-section-readability div").each(function(e,t){t=s(t);if(-1!==t.attr("class").indexOf("ContentAnalysis__ContentAnalysisContainer"))return t.empty().append(a.getSuggest("readability")),!1}),a.initReadability=!0},100)})},setSeoAnalysis:function(){var t;setTimeout(function(){var e=s("#yoast-seo-analysis-collapsible-metabox").parents("div");void 0!==e[0]&&(t=e[0])},500),s(document).on("click",t,function(e){setTimeout(function(){var o=!1;s("#wpseo-metabox-root span").each(function(e,t){t=s(t);if(-1!==t.attr("class").indexOf("SeoAnalysis__")){t=t.attr("class").split(" ")[0];return o=s("."+t).next(),!1}}),o&&o.empty().append(a.getSuggest("analysis"))},300)})},setMetaBoxTitle:function(){var e,t=s("#wpseo_meta .hndle");1!=t.length&&1!=(t=s("#wpseo_meta > h2 > span")).length||(e=t.text(),t.text(e+" ("+WPGlobusCoreData.en_language_name[WPGlobusYoastSeo.language]+")"))}},WPGlobusYoastSeo=s.extend({},WPGlobusYoastSeo,a),WPGlobusYoastSeo.init())});
|
includes/js/wpglobus-yoastseo-140.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
jQuery(document).ready(function(i){"use strict";var
|
1 |
+
jQuery(document).ready(function(i){"use strict";var a;"undefined"!=typeof WPGlobusCoreData&&"undefined"!=typeof WPGlobusVendor&&(a={initSeoAnalysis:!1,initReadability:!1,accessExtra:!1,parseBool:function(e){return!/^(false|0)$/i.test(e)&&!!e},moduleState:function(){return!!a.accessExtra||("string"==typeof WPGlobusYoastSeo.plus_module&&""!=WPGlobusYoastSeo.plus_module?WPGlobusYoastSeo.plus_module:a.parseBool(WPGlobusYoastSeo.plus_access))},isPremium:function(){return WPGlobusVendor.vendor.WPSEO_PREMIUM},isDefaultLanguage:function(){return a.parseBool(WPGlobusYoastSeo.is_default_language)},isBuilderPage:function(){return a.parseBool(WPGlobusYoastSeo.builder_page)},isBlockEditor:function(){return!(!a.isBuilderPage()||"gutenberg"!==WPGlobusYoastSeo.builder_id)},getSuggest:function(e,t){var o="",s="wpglobus-suggest";if(t=t||{},void 0===e)return o;"inactive"===a.moduleState()?"keyword"==e?o=WPGlobusVendor.i18n.yoastseo_plus_meta_keywords_inactive:"analysis"==e?o=WPGlobusVendor.i18n.yoastseo_plus_page_analysis_inactive:"readability"==e?o=WPGlobusVendor.i18n.yoastseo_plus_readability_inactive:"social"==e&&(o=WPGlobusVendor.i18n.yoastseo_plus_social_inactive):"boolean"!=typeof a.moduleState()||a.moduleState()||("keyword"==e?o=WPGlobusVendor.i18n.yoastseo_plus_meta_keywords_access:"analysis"==e?o=WPGlobusVendor.i18n.yoastseo_plus_page_analysis_access:"readability"==e?o=WPGlobusVendor.i18n.yoastseo_plus_readability_access:"social"==e&&(o=WPGlobusVendor.i18n.yoastseo_plus_social_access)),s+=" wpglobus-suggest-"+e;e="";if(void 0!==t.id){if(0<i("#"+t.id).length)return!1;e='id="'+t.id+'"'}return"<div "+e+' class="'+s+'" style="font-weight:bold;border:1px solid rgb(221, 221, 221);padding:20px 10px;">'+o+"</div>"},init:function(){a.isBuilderPage()&&a.start()},start:function(){a.accessExtra=a.parseBool(WPGlobusYoastSeo.access_extra),a.setMetaBoxTitle(),a.isDefaultLanguage()||"inactive"!=a.moduleState()&&a.moduleState()||(a.setKeywordFieldSuggest(),a.setSeoAnalysisSuggest(),a.setReadabilitySuggest(),a.setSocialSuggest(),a.attachListeners())},setSocialSuggest:function(){setTimeout(function(){var e=i("#wpseo-section-social");1==e.length&&e.empty().append(a.getSuggest("social",{id:"wpglobus-suggest-social-metabox"}))},500),a.isBlockEditor()&&new MutationObserver(function(e){e.forEach(function(e){e=i(e.addedNodes).find("div.yoast-modal-content");if(1==e.length){if(0<e.find("#yoast-snippet-preview-container").length)return!0;e.find("div").each(function(){var e,t=i(this),o=t.attr("class")||"";-1!==o.indexOf("SocialMetadataPreviewForm__")&&((e=a.getSuggest("social",{id:"wpglobus-suggest-social-modal"}))&&t.after(e),t.empty()),-1!==o.indexOf("shared__FormSection")&&t.empty()})}})}).observe(i("body.block-editor-page")[0],{childList:!0,subtree:!0})},setKeywordFieldSuggest:function(){a.isBlockEditor()?setTimeout(function(){var e=i("#focus-keyword-input-sidebar").parent("div");1==e.length&&e.empty().append(a.getSuggest("keyword")),1==(e=i("#focus-keyword-input-metabox").parent("div")).length&&e.empty().append(a.getSuggest("keyword"))},2e3):setTimeout(function(){var e=i("#focus-keyword-input-metabox").parent("div");1==e.length&&e.empty().append(a.getSuggest("keyword"))},2e3)},setReadabilitySuggest:function(){var e=i(".yoast-aria-tabs li").eq(1);i(document).on("click",e,function(e){a.initReadability||setTimeout(function(){i("#wpseo-meta-section-readability div").each(function(e,t){t=i(t);if(-1!==t.attr("class").indexOf("ContentAnalysis__ContentAnalysisContainer"))return t.empty().append(a.getSuggest("readability")),!1}),a.initReadability=!0},100)})},setSeoAnalysisSuggest:function(){var t;setTimeout(function(){var e=i("#yoast-seo-analysis-collapsible-metabox").parents("div");void 0!==e[0]&&(t=e[0])},500),i(document).on("click",t,function(e){setTimeout(function(){var o=!1;i("#wpseo-metabox-root span").each(function(e,t){t=i(t).attr("class");if(void 0===t)return!0;if(-1!==t.indexOf("SeoAnalysis__")){t=t.split(" ")[0];return o=i("."+t).next(),!1}}),o&&o.empty().append(a.getSuggest("analysis"))},300)})},attachListeners:function(){var e;a.isBlockEditor()&&(i(document).on("click",".yoast.components-panel__body",function(e){setTimeout(function(){i("div").each(function(e,t){var o=i(t).attr("class");void 0!==o&&-1!=o.indexOf("ContentAnalysis__ContentAnalysisContainer")&&i(t).empty().append(a.getSuggest("analysis"))})},200)}),e=document.querySelector('[aria-label="Yoast SEO"]'),i(document).on("click",e,function(e){setTimeout(function(){var e=i("#focus-keyword-input-sidebar").parent("div");1==e.length&&e.empty().append(a.getSuggest("keyword"))},100)}))},setMetaBoxTitle:function(){var e,t=i("#wpseo_meta .hndle");1!=t.length&&1!=(t=i("#wpseo_meta > h2 > span")).length||(e=t.text(),t.text(e+" ("+WPGlobusCoreData.en_language_name[WPGlobusYoastSeo.language]+")"))}},WPGlobusYoastSeo=i.extend({},WPGlobusYoastSeo,a),WPGlobusYoastSeo.init())});
|
includes/js/wpglobus-yoastseo-30.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var WPGlobusYoastSeo;jQuery(document).ready(function(r){"use strict";var p,n,e;"undefined"!=typeof wpseoReplaceVarsL10n&&"undefined"!=typeof WPGlobusCoreData&&("edit-tags.php"==WPGlobusVendor.pagenow?(n=WPGlobusYoastSeo={editorIDs:["description"],editor:{},submitId:"#submit",preventChangeEditor:!1,observer:null,init:function(){n.attachListeners(),_.delay(n.start,1500)},submit:function(e){"mouseenter"===e.type?r.each(n.editor,function(e,t){!n.editor[e].contentEditor||n.editor[e].contentEditor.isHidden()?r("#"+e).val(n.editor[e].content):tinymce.get(e).setContent(n.editor[e].content)}):"mouseleave"===e.type?n.preventChangeEditor||(r.each(n.editor,function(e,t){!n.editor[e].contentEditor||n.editor[e].contentEditor.isHidden()?r("#"+e).val(WPGlobusCore.TextFilter(t.content,n.getCurrentTab(),"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,n.getCurrentTab(),"RETURN_EMPTY"))}),n.preventChangeEditor=!1):"click"===e.type&&(n.preventChangeEditor=!0,"tinymce"!=getUserSetting("editor")&&setUserSetting("editor","tinymce"))},attachListeners:function(){r(".wrap").on("tabsactivate",function(e,a){r.each(n.editor,function(e,t){!n.editor[e].contentEditor||n.editor[e].contentEditor.isHidden()?r("#"+e).val(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY"))})}),r(document).on("mouseenter",n.submitId,n.submit).on("mouseleave",n.submitId,n.submit).on("click",n.submitId,n.submit),r(document).on("tinymce-editor-init",function(e,t){var a;-1!=_.indexOf(n.editorIDs,t.id)&&(a=r("#"+t.id),n.editor[t.id]={},n.editor[t.id].contentEditor=t,n.editor[t.id].content=a.val(),t.setContent(WPGlobusCore.TextFilter(n.editor[t.id].content,WPGlobusCoreData.default_language,"RETURN_EMPTY")),r("#"+t.getContainer().id).find("iframe").addClass("wpglobus-translatable"),a.removeClass("hidden"),t.on("nodechange keyup",_.debounce(n.update,500)),a.on("input keyup",_.debounce(n.update,500)))})},update:function(e){var t,a;void 0!==e.target&&("tinymce"==(t=e.target.id)&&(t=e.target.dataset.id),void 0!==n.editor[t].contentEditor&&(a=!n.editor[t].contentEditor||n.editor[t].contentEditor.isHidden()?r("#"+t).val():n.editor[t].contentEditor.getContent({format:"raw"}),n.editor[t].content=WPGlobusCore.getString(n.editor[t].content,a,n.getCurrentTab())))},getCurrentTab:function(){return r(".wpglobus-taxonomy-tabs-list .ui-tabs-active").data("language")},start:function(){r(".wpglobus-element_description").css({display:"none"})}},WPGlobusYoastSeo.init(),e=function(){r(".wrap").on("tabsactivate",function(e,t){t.newTab[0].dataset.language==WPGlobusCoreData.default_language?r("#poststuff .inside").css({display:"block"}):r("#poststuff .inside").css({display:"none"})}),r.each(["category_description","sitedesc","sitename","tag_description","term_description","term_title"],function(e,t){wpseoReplaceVarsL10n.replace_vars[t]=WPGlobusCore.TextFilter(wpseoReplaceVarsL10n.replace_vars[t],WPGlobusCoreData.default_language)}),WPGlobusYoastSeo.observer=new MutationObserver(function(e){e.forEach(function(e){var t;"placeholder"==e.attributeName&&(WPGlobusYoastSeo.observer.disconnect(),""==(t=r("#wpseo_focuskw")).val()&&t.attr("placeholder",WPGlobusCore.TextFilter(t.attr("placeholder"),WPGlobusCoreData.default_language)),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0}))})}),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0})},window.WPGlobusYoastSeoPlugin=new e):(n=WPGlobusYoastSeo={wpseoTabSelector:"#wpglobus-wpseo-tabs",url:"",attrs:r("#wpglobus-wpseo-attr"),iB:r("#wpseo-meta-section-content"),t:r("#wpseo-meta-section-content"),ids:"",names:"",init:function(){n.start()},initAddKeywordPopup:function(){1===r("#wpseo-add-keyword-popup").length&&r(".wpseo-add-keyword").on("click",n.addKeywordPopup)},addKeywordPopup:function(){var e=r("#wpseo-add-keyword-popup").find("h3").html();tb_show(e,"#TB_inline?width=650&height=350&inlineId=wpseo-add-keyword-popup","group"),jQuery("#TB_window").css("height",235),jQuery("#TB_window").css("width",680)},qtip:function(){r(".yoast_help").qtip({content:{attr:"alt"},position:{my:"bottom left",at:"top center"},style:{tip:{corner:!0},classes:"yoast-qtip qtip-rounded qtip-blue"},show:"click",hide:{fixed:!0,delay:500}})},start:function(){r(n.wpseoTabSelector).tabs(),n.ids=n.attrs.data("ids"),n.names=n.attrs.data("names"),n.ids=n.ids+","+n.attrs.data("qtip"),n.ids=n.ids.split(","),n.names=n.names.split(","),r("#wpglobus-wpseo-tabs").insertBefore(n.iB),r(".wpseo-metabox-tabs").css({height:"26px"}),r(".wpglobus-wpseo-general").each(function(e,t){var a=r(t),o=a.data("language"),s="wpseo-meta-section-content_"+o;a.html('<div id="'+s+'" class="wpseo-meta-section wpglobus-wpseo-meta-section" style="width:100%" data-language="'+o+'">'+n.t.html()+"</div>"),r("#"+s+" .wpseo-metabox-tabs").attr("id","wpseo-metabox-tabs_"+o),r("#"+s+" .wpseotab").attr("id","wpseo_content_"+o),r("#"+s).css({display:"block"}),r("#wpseo_meta").css({overflow:"hidden"}),r("#"+s+" .snippet_container").addClass("wpglobus-snippet_container"),o!==WPGlobusCoreData.default_language&&r("#"+s+" .wpseo-add-keyword").addClass("hidden"),r.each(n.names,function(e,t){r("#"+t).attr("name",t+"_"+o)}),r.each(n.ids,function(e,t){var a=r("#"+t);"wpseosnippet"==t&&a.addClass("wpglobus-wpseosnippet"),"snippet_title"==t&&a.addClass("wpglobus-snippet_title"),"snippet_meta"==t&&a.addClass("wpglobus-snippet_meta"),"snippet_cite"==t&&a.addClass("wpglobus-snippet_cite"),"snippet_citeBase"==t&&a.addClass("wpglobus-snippet_citeBase"),"yoast_wpseo_focuskw_text_input"==t&&a.addClass("wpglobus-yoast_wpseo_focuskw_text_input"),"wpseo-pageanalysis"==t&&a.addClass("wpglobus-wpseo-pageanalysis"),"snippet_preview"==t&&a.addClass("wpglobus-snippet_preview"),a.attr("id",t+"_"+o),r("#"+t+"_"+o).attr("data-language",o)});var i=WPGlobusCore.TextFilter(r("#yoast_wpseo_focuskw_text_input").val(),o,"RETURN_EMPTY");r("#yoast_wpseo_focuskw_text_input_"+o).val(i),r("#yoast_wpseo_focuskw_"+o).val(i),o!==WPGlobusCoreData.default_language&&(r("#"+s+" #yoast_wpseo_focuskw_text_input_"+o).addClass("hidden").after('<div class="wpglobus-suggest" style="font-weight:bold;">'+WPGlobusVendor.i18n.yoastseo_plus_access+"</div>"),r("#"+s+" #wpseo-pageanalysis_"+o).addClass("hidden"))}),n.iB.addClass("hidden"),n.iB.css({height:0,overflow:"hidden"});var e=WPGlobusCore.TextFilter(r("#yoast_wpseo_focuskw_text_input").val(),WPGlobusCoreData.default_language,"RETURN_EMPTY");r("#yoast_wpseo_focuskw_text_input").val(e),r("#yoast_wpseo_focuskw").val(e),r(".wpseo-metabox-sidebar .wpseo-meta-section-link").on("click",function(e){"#wpseo-meta-section-content"==r(this).attr("href")?r("#wpglobus-wpseo-tabs").css({display:"block"}):r("#wpglobus-wpseo-tabs").css({display:"none"})}),r("body").on("click",".wpglobus-post-body-tabs-list li",function(e){var t,a=r(this);a.hasClass("wpglobus-post-tab")&&(r("#wpglobus-wpseo-tabs").tabs("option","active",a.data("order")),t=r("#yoast_wpseo_focuskw_text_input_"+r(this).data("language")).val(),YoastSEO.app.rawData.keyword=t,r("#yoast_wpseo_focuskw_text_input").val(t),r('input[name="yoast_wpseo_focuskw"]').val(t),YoastSEO.app.analyzeTimer(YoastSEO.app))}),n.qtip(),n.initAddKeywordPopup()}},(e=function(){this.replaceVars=wpseoReplaceVarsL10n.replace_vars,this.language=WPGlobusCoreData.default_language,this.tab=WPGlobusCoreData.default_language,this.wpseoTab=WPGlobusCoreData.default_language,this.title_template=wpseoPostScraperL10n.title_template,this.focuskw=r("#yoast_wpseo_focuskw_text_input"),this.focuskw_hidden=r('input[name="yoast_wpseo_focuskw"]'),this.focuskwKeep=!1,this.post_slug="#editable-post-name-full",YoastSEO.app.registerPlugin("wpglobusYoastSeoPlugin",{status:"ready"}),YoastSEO.app.registerModification("content",this.contentModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("title",this.titleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_title",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_meta",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_page_title",this.pageTitleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_meta_desc",this.metaDescModification,"wpglobusYoastSeoPlugin",0),r(document).on("blur",".wpglobus-snippet_title",function(e){var t=r(this),a=WPGlobusCore.getString(r("#yoast_wpseo_title").val(),t.text(),t.data("language"));YoastSEO.app.rawData.pageTitle=a,r('input[name="yoast_wpseo_title"]').val(a),r("#snippet_title").text(a)}),r(document).on("blur",".wpglobus-snippet_meta",function(e){var t=r(this),a=WPGlobusCore.getString(r("#yoast_wpseo_metadesc").val(),t.text(),t.data("language"));r("#yoast_wpseo_metadesc").val(a),r("#snippet_meta").text(a)}),r(document).on("keyup",".wpglobus-yoast_wpseo_focuskw_text_input",function(e){var t=r(this),a=t.val();p.focuskw.val(a),p.focuskw_hidden.val(a),p.updateWpseoKeyword(a,t.data("language")),YoastSEO.app.analyzeTimer(YoastSEO.app)}),r("#publish,#save-post").on("mouseenter",function(e){var a,o="";r(".wpglobus-yoast_wpseo_focuskw_text_input").each(function(e,t){a=r(this),o=WPGlobusCore.getString(o,a.val(),a.data("language"))}),p.focuskw.val(o),p.focuskw_hidden.val(o)}).on("mouseleave",function(e){p.focuskwKeep||(p.wpseoTab=r(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language"),r(this),p.focuskw.val(r("#yoast_wpseo_focuskw_text_input_"+p.wpseoTab).val()),p.focuskw_hidden.val(r("#yoast_wpseo_focuskw_text_input_"+p.wpseoTab).val()))}).on("click",function(e){p.focuskwKeep=!0}),r(WPGlobusYoastSeo.wpseoTabSelector).on("tabsactivate",function(e,t){var a;t.newPanel.attr("data-language")===WPGlobusCoreData.default_language&&(WPGlobusYoastSeo.url=r(p.post_slug).text(),a=r("#yoast_wpseo_focuskw_text_input_"+WPGlobusCoreData.default_language).val(),YoastSEO.app.rawData.keyword=a,p.focuskw.val(a),p.focuskw_hidden.val(a),YoastSEO.app.analyzeTimer(YoastSEO.app))}),p=this}).prototype.getWPseoTab=function(){return r(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language")},e.prototype.citeModification=function(e){var t="#snippet_citeBase_"+e,a="#snippet_cite_"+e,o=r("#wpseo-tab-"+e).data("yoast-cite-base");!1===r("#wpseo-tab-"+e).data("cite-contenteditable")&&r(a).attr("contenteditable","false"),r(t).text(o)},e.prototype.pageTitleModification=function(a){var o,s="#snippet_title_",i="",n="";return p.title_template==a?r.each(WPGlobusCoreData.enabled_languages,function(e,t){p.language=t,i=p.replaceVariablesPlugin(a),r(s+t).text(i),t==p.getWPseoTab()&&(n=i)}):(o=WPGlobusCore.getTranslations(a),r.each(WPGlobusCoreData.enabled_languages,function(e,t){p.language=t,i=""===o[t]?p.replaceVariablesPlugin(p.title_template):o[t],r(s+t).text(i),t==p.getWPseoTab()&&(n=i)})),n},e.prototype.metaDescModification=function(a){return r.each(WPGlobusCoreData.enabled_languages,function(e,t){r("#snippet_meta_"+t).text(WPGlobusCore.TextFilter(a,t,"RETURN_EMPTY")),p.citeModification(t)}),WPGlobusCore.TextFilter(a,p.getWPseoTab(),"RETURN_EMPTY")},e.prototype.snippetModification=function(e){return WPGlobusCore.TextFilter(e,p.getWPseoTab(),"RETURN_EMPTY")},e.prototype.contentModification=function(e){return p.getWPseoTab()==WPGlobusCoreData.default_language?e:r("#content_"+p.getWPseoTab()).val()},e.prototype.titleModification=function(e){return setTimeout(p.updatePageAnalysis,1e3),p.getWPseoTab()==WPGlobusCoreData.default_language?e:r("#title_"+p.getWPseoTab()).val()},e.prototype.defaultReplace=function(e){return e.replace(/%%sitedesc%%/g,this.replaceVars.sitedesc).replace(/%%sitename%%/g,WPGlobusCore.TextFilter(this.replaceVars.sitename,this.language)).replace(/%%term_title%%/g,this.replaceVars.term_title).replace(/%%term_description%%/g,this.replaceVars.term_description).replace(/%%category_description%%/g,this.replaceVars.category_description).replace(/%%tag_description%%/g,this.replaceVars.tag_description).replace(/%%searchphrase%%/g,this.replaceVars.searchphrase).replace(/%%sep%%/g,this.replaceVars.sep).replace(/%%date%%/g,this.replaceVars.date).replace(/%%id%%/g,this.replaceVars.id).replace(/%%page%%/g,this.replaceVars.page).replace(/%%currenttime%%/g,this.replaceVars.currenttime).replace(/%%currentdate%%/g,this.replaceVars.currentdate).replace(/%%currentday%%/g,this.replaceVars.currentday).replace(/%%currentmonth%%/g,this.replaceVars.currentmonth).replace(/%%currentyear%%/g,this.replaceVars.currentyear).replace(/%%focuskw%%/g,YoastSEO.app.stringHelper.stripAllTags(YoastSEO.app.rawData.keyword))},e.prototype.replaceVariablesPlugin=function(e){return void 0!==e&&(e=this.titleReplace(e),e=this.defaultReplace(e),e=this.doubleSepReplace(e)),e},e.prototype.titleReplace=function(e){var t="";return void 0===(t=this.language==WPGlobusCoreData.default_language?r("#title").val():r("#title_"+this.language).val())&&(t=YoastSEO.app.rawData.pageTitle),e=e.replace(/%%title%%/g,t)},e.prototype.doubleSepReplace=function(e){var t=YoastSEO.app.stringHelper.addEscapeChars(this.replaceVars.sep),a=new RegExp(t+" "+t,"g");return e=e.replace(a,this.replaceVars.sep)},e.prototype.updateWpseoKeyword=function(e,t){t!=WPGlobusCoreData.default_language&&(1==r("#wpseo-meta-section-content_"+t+" .wpseo_keyword").length&&r("#wpseo-meta-section-content_"+t+" .wpseo_keyword").removeClass("wpseo_keyword").addClass("wpglobus-wpseo_keyword_"+t),r(".wpglobus-wpseo_keyword_"+t).text(e))},e.prototype.updatePageAnalysis=function(){r("#wpseo-pageanalysis_"+p.getWPseoTab()).html(r("#wpseo-pageanalysis").html())},window.WPGlobusYoastSeoPlugin=new e,YoastSEO.Analyzer.prototype.urlKeyword=function(){var e=[{test:"urlKeyword",result:0}];return void 0!==WPGlobusYoastSeo&&""!==WPGlobusYoastSeo.url&&(this.config.url=WPGlobusYoastSeo.url),void 0!==this.config.url&&(e[0].result=this.stringHelper.countMatches(this.config.url,this.keywordRegexInverse)),e}))});
|
1 |
+
var WPGlobusYoastSeo;jQuery(document).ready(function(r){"use strict";var p,s,e;"undefined"!=typeof wpseoReplaceVarsL10n&&"undefined"!=typeof WPGlobusCoreData&&("edit-tags.php"==WPGlobusVendor.pagenow?(s=WPGlobusYoastSeo={editorIDs:["description"],editor:{},submitId:"#submit",preventChangeEditor:!1,observer:null,init:function(){s.attachListeners(),_.delay(s.start,1500)},submit:function(e){"mouseenter"===e.type?r.each(s.editor,function(e,t){!s.editor[e].contentEditor||s.editor[e].contentEditor.isHidden()?r("#"+e).val(s.editor[e].content):tinymce.get(e).setContent(s.editor[e].content)}):"mouseleave"===e.type?s.preventChangeEditor||(r.each(s.editor,function(e,t){!s.editor[e].contentEditor||s.editor[e].contentEditor.isHidden()?r("#"+e).val(WPGlobusCore.TextFilter(t.content,s.getCurrentTab(),"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,s.getCurrentTab(),"RETURN_EMPTY"))}),s.preventChangeEditor=!1):"click"===e.type&&(s.preventChangeEditor=!0,"tinymce"!=getUserSetting("editor")&&setUserSetting("editor","tinymce"))},attachListeners:function(){r(".wrap").on("tabsactivate",function(e,a){r.each(s.editor,function(e,t){!s.editor[e].contentEditor||s.editor[e].contentEditor.isHidden()?r("#"+e).val(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY"))})}),r(document).on("mouseenter",s.submitId,s.submit).on("mouseleave",s.submitId,s.submit).on("click",s.submitId,s.submit),r(document).on("tinymce-editor-init",function(e,t){var a;-1!=_.indexOf(s.editorIDs,t.id)&&(a=r("#"+t.id),s.editor[t.id]={},s.editor[t.id].contentEditor=t,s.editor[t.id].content=a.val(),t.setContent(WPGlobusCore.TextFilter(s.editor[t.id].content,WPGlobusCoreData.default_language,"RETURN_EMPTY")),r("#"+t.getContainer().id).find("iframe").addClass("wpglobus-translatable"),a.removeClass("hidden"),t.on("nodechange keyup",_.debounce(s.update,500)),a.on("input keyup",_.debounce(s.update,500)))})},update:function(e){var t;void 0!==e.target&&("tinymce"==(t=e.target.id)&&(t=e.target.dataset.id),void 0!==s.editor[t].contentEditor&&(e=!s.editor[t].contentEditor||s.editor[t].contentEditor.isHidden()?r("#"+t).val():s.editor[t].contentEditor.getContent({format:"raw"}),s.editor[t].content=WPGlobusCore.getString(s.editor[t].content,e,s.getCurrentTab())))},getCurrentTab:function(){return r(".wpglobus-taxonomy-tabs-list .ui-tabs-active").data("language")},start:function(){r(".wpglobus-element_description").css({display:"none"})}},WPGlobusYoastSeo.init(),e=function(){r(".wrap").on("tabsactivate",function(e,t){t.newTab[0].dataset.language==WPGlobusCoreData.default_language?r("#poststuff .inside").css({display:"block"}):r("#poststuff .inside").css({display:"none"})}),r.each(["category_description","sitedesc","sitename","tag_description","term_description","term_title"],function(e,t){wpseoReplaceVarsL10n.replace_vars[t]=WPGlobusCore.TextFilter(wpseoReplaceVarsL10n.replace_vars[t],WPGlobusCoreData.default_language)}),WPGlobusYoastSeo.observer=new MutationObserver(function(e){e.forEach(function(e){"placeholder"==e.attributeName&&(WPGlobusYoastSeo.observer.disconnect(),""==(e=r("#wpseo_focuskw")).val()&&e.attr("placeholder",WPGlobusCore.TextFilter(e.attr("placeholder"),WPGlobusCoreData.default_language)),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0}))})}),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0})},window.WPGlobusYoastSeoPlugin=new e):(s=WPGlobusYoastSeo={wpseoTabSelector:"#wpglobus-wpseo-tabs",url:"",attrs:r("#wpglobus-wpseo-attr"),iB:r("#wpseo-meta-section-content"),t:r("#wpseo-meta-section-content"),ids:"",names:"",init:function(){s.start()},initAddKeywordPopup:function(){1===r("#wpseo-add-keyword-popup").length&&r(".wpseo-add-keyword").on("click",s.addKeywordPopup)},addKeywordPopup:function(){var e=r("#wpseo-add-keyword-popup").find("h3").html();tb_show(e,"#TB_inline?width=650&height=350&inlineId=wpseo-add-keyword-popup","group"),jQuery("#TB_window").css("height",235),jQuery("#TB_window").css("width",680)},qtip:function(){r(".yoast_help").qtip({content:{attr:"alt"},position:{my:"bottom left",at:"top center"},style:{tip:{corner:!0},classes:"yoast-qtip qtip-rounded qtip-blue"},show:"click",hide:{fixed:!0,delay:500}})},start:function(){r(s.wpseoTabSelector).tabs(),s.ids=s.attrs.data("ids"),s.names=s.attrs.data("names"),s.ids=s.ids+","+s.attrs.data("qtip"),s.ids=s.ids.split(","),s.names=s.names.split(","),r("#wpglobus-wpseo-tabs").insertBefore(s.iB),r(".wpseo-metabox-tabs").css({height:"26px"}),r(".wpglobus-wpseo-general").each(function(e,t){var a=r(t),o=a.data("language"),t="wpseo-meta-section-content_"+o;a.html('<div id="'+t+'" class="wpseo-meta-section wpglobus-wpseo-meta-section" style="width:100%" data-language="'+o+'">'+s.t.html()+"</div>"),r("#"+t+" .wpseo-metabox-tabs").attr("id","wpseo-metabox-tabs_"+o),r("#"+t+" .wpseotab").attr("id","wpseo_content_"+o),r("#"+t).css({display:"block"}),r("#wpseo_meta").css({overflow:"hidden"}),r("#"+t+" .snippet_container").addClass("wpglobus-snippet_container"),o!==WPGlobusCoreData.default_language&&r("#"+t+" .wpseo-add-keyword").addClass("hidden"),r.each(s.names,function(e,t){r("#"+t).attr("name",t+"_"+o)}),r.each(s.ids,function(e,t){var a=r("#"+t);"wpseosnippet"==t&&a.addClass("wpglobus-wpseosnippet"),"snippet_title"==t&&a.addClass("wpglobus-snippet_title"),"snippet_meta"==t&&a.addClass("wpglobus-snippet_meta"),"snippet_cite"==t&&a.addClass("wpglobus-snippet_cite"),"snippet_citeBase"==t&&a.addClass("wpglobus-snippet_citeBase"),"yoast_wpseo_focuskw_text_input"==t&&a.addClass("wpglobus-yoast_wpseo_focuskw_text_input"),"wpseo-pageanalysis"==t&&a.addClass("wpglobus-wpseo-pageanalysis"),"snippet_preview"==t&&a.addClass("wpglobus-snippet_preview"),a.attr("id",t+"_"+o),r("#"+t+"_"+o).attr("data-language",o)});a=WPGlobusCore.TextFilter(r("#yoast_wpseo_focuskw_text_input").val(),o,"RETURN_EMPTY");r("#yoast_wpseo_focuskw_text_input_"+o).val(a),r("#yoast_wpseo_focuskw_"+o).val(a),o!==WPGlobusCoreData.default_language&&(r("#"+t+" #yoast_wpseo_focuskw_text_input_"+o).addClass("hidden").after('<div class="wpglobus-suggest" style="font-weight:bold;">'+WPGlobusVendor.i18n.yoastseo_plus_access+"</div>"),r("#"+t+" #wpseo-pageanalysis_"+o).addClass("hidden"))}),s.iB.addClass("hidden"),s.iB.css({height:0,overflow:"hidden"});var e=WPGlobusCore.TextFilter(r("#yoast_wpseo_focuskw_text_input").val(),WPGlobusCoreData.default_language,"RETURN_EMPTY");r("#yoast_wpseo_focuskw_text_input").val(e),r("#yoast_wpseo_focuskw").val(e),r(".wpseo-metabox-sidebar .wpseo-meta-section-link").on("click",function(e){"#wpseo-meta-section-content"==r(this).attr("href")?r("#wpglobus-wpseo-tabs").css({display:"block"}):r("#wpglobus-wpseo-tabs").css({display:"none"})}),r("body").on("click",".wpglobus-post-body-tabs-list li",function(e){var t=r(this);t.hasClass("wpglobus-post-tab")&&(r("#wpglobus-wpseo-tabs").tabs("option","active",t.data("order")),t=r("#yoast_wpseo_focuskw_text_input_"+r(this).data("language")).val(),YoastSEO.app.rawData.keyword=t,r("#yoast_wpseo_focuskw_text_input").val(t),r('input[name="yoast_wpseo_focuskw"]').val(t),YoastSEO.app.analyzeTimer(YoastSEO.app))}),s.qtip(),s.initAddKeywordPopup()}},(e=function(){this.replaceVars=wpseoReplaceVarsL10n.replace_vars,this.language=WPGlobusCoreData.default_language,this.tab=WPGlobusCoreData.default_language,this.wpseoTab=WPGlobusCoreData.default_language,this.title_template=wpseoPostScraperL10n.title_template,this.focuskw=r("#yoast_wpseo_focuskw_text_input"),this.focuskw_hidden=r('input[name="yoast_wpseo_focuskw"]'),this.focuskwKeep=!1,this.post_slug="#editable-post-name-full",YoastSEO.app.registerPlugin("wpglobusYoastSeoPlugin",{status:"ready"}),YoastSEO.app.registerModification("content",this.contentModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("title",this.titleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_title",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_meta",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_page_title",this.pageTitleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_meta_desc",this.metaDescModification,"wpglobusYoastSeoPlugin",0),r(document).on("blur",".wpglobus-snippet_title",function(e){var t=r(this),t=WPGlobusCore.getString(r("#yoast_wpseo_title").val(),t.text(),t.data("language"));YoastSEO.app.rawData.pageTitle=t,r('input[name="yoast_wpseo_title"]').val(t),r("#snippet_title").text(t)}),r(document).on("blur",".wpglobus-snippet_meta",function(e){var t=r(this),t=WPGlobusCore.getString(r("#yoast_wpseo_metadesc").val(),t.text(),t.data("language"));r("#yoast_wpseo_metadesc").val(t),r("#snippet_meta").text(t)}),r(document).on("keyup",".wpglobus-yoast_wpseo_focuskw_text_input",function(e){var t=r(this),a=t.val();p.focuskw.val(a),p.focuskw_hidden.val(a),p.updateWpseoKeyword(a,t.data("language")),YoastSEO.app.analyzeTimer(YoastSEO.app)}),r("#publish,#save-post").on("mouseenter",function(e){var a,o="";r(".wpglobus-yoast_wpseo_focuskw_text_input").each(function(e,t){a=r(this),o=WPGlobusCore.getString(o,a.val(),a.data("language"))}),p.focuskw.val(o),p.focuskw_hidden.val(o)}).on("mouseleave",function(e){p.focuskwKeep||(p.wpseoTab=r(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language"),r(this),p.focuskw.val(r("#yoast_wpseo_focuskw_text_input_"+p.wpseoTab).val()),p.focuskw_hidden.val(r("#yoast_wpseo_focuskw_text_input_"+p.wpseoTab).val()))}).on("click",function(e){p.focuskwKeep=!0}),r(WPGlobusYoastSeo.wpseoTabSelector).on("tabsactivate",function(e,t){t.newPanel.attr("data-language")===WPGlobusCoreData.default_language&&(WPGlobusYoastSeo.url=r(p.post_slug).text(),t=r("#yoast_wpseo_focuskw_text_input_"+WPGlobusCoreData.default_language).val(),YoastSEO.app.rawData.keyword=t,p.focuskw.val(t),p.focuskw_hidden.val(t),YoastSEO.app.analyzeTimer(YoastSEO.app))}),p=this}).prototype.getWPseoTab=function(){return r(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language")},e.prototype.citeModification=function(e){var t="#snippet_citeBase_"+e,a="#snippet_cite_"+e,o=r("#wpseo-tab-"+e).data("yoast-cite-base");!1===r("#wpseo-tab-"+e).data("cite-contenteditable")&&r(a).attr("contenteditable","false"),r(t).text(o)},e.prototype.pageTitleModification=function(a){var o,s="#snippet_title_",i="",n="";return p.title_template==a?r.each(WPGlobusCoreData.enabled_languages,function(e,t){p.language=t,i=p.replaceVariablesPlugin(a),r(s+t).text(i),t==p.getWPseoTab()&&(n=i)}):(o=WPGlobusCore.getTranslations(a),r.each(WPGlobusCoreData.enabled_languages,function(e,t){p.language=t,i=""===o[t]?p.replaceVariablesPlugin(p.title_template):o[t],r(s+t).text(i),t==p.getWPseoTab()&&(n=i)})),n},e.prototype.metaDescModification=function(a){return r.each(WPGlobusCoreData.enabled_languages,function(e,t){r("#snippet_meta_"+t).text(WPGlobusCore.TextFilter(a,t,"RETURN_EMPTY")),p.citeModification(t)}),WPGlobusCore.TextFilter(a,p.getWPseoTab(),"RETURN_EMPTY")},e.prototype.snippetModification=function(e){return WPGlobusCore.TextFilter(e,p.getWPseoTab(),"RETURN_EMPTY")},e.prototype.contentModification=function(e){return p.getWPseoTab()==WPGlobusCoreData.default_language?e:r("#content_"+p.getWPseoTab()).val()},e.prototype.titleModification=function(e){return setTimeout(p.updatePageAnalysis,1e3),p.getWPseoTab()==WPGlobusCoreData.default_language?e:r("#title_"+p.getWPseoTab()).val()},e.prototype.defaultReplace=function(e){return e.replace(/%%sitedesc%%/g,this.replaceVars.sitedesc).replace(/%%sitename%%/g,WPGlobusCore.TextFilter(this.replaceVars.sitename,this.language)).replace(/%%term_title%%/g,this.replaceVars.term_title).replace(/%%term_description%%/g,this.replaceVars.term_description).replace(/%%category_description%%/g,this.replaceVars.category_description).replace(/%%tag_description%%/g,this.replaceVars.tag_description).replace(/%%searchphrase%%/g,this.replaceVars.searchphrase).replace(/%%sep%%/g,this.replaceVars.sep).replace(/%%date%%/g,this.replaceVars.date).replace(/%%id%%/g,this.replaceVars.id).replace(/%%page%%/g,this.replaceVars.page).replace(/%%currenttime%%/g,this.replaceVars.currenttime).replace(/%%currentdate%%/g,this.replaceVars.currentdate).replace(/%%currentday%%/g,this.replaceVars.currentday).replace(/%%currentmonth%%/g,this.replaceVars.currentmonth).replace(/%%currentyear%%/g,this.replaceVars.currentyear).replace(/%%focuskw%%/g,YoastSEO.app.stringHelper.stripAllTags(YoastSEO.app.rawData.keyword))},e.prototype.replaceVariablesPlugin=function(e){return void 0!==e&&(e=this.titleReplace(e),e=this.defaultReplace(e),e=this.doubleSepReplace(e)),e},e.prototype.titleReplace=function(e){var t="";return void 0===(t=(this.language==WPGlobusCoreData.default_language?r("#title"):r("#title_"+this.language)).val())&&(t=YoastSEO.app.rawData.pageTitle),e=e.replace(/%%title%%/g,t)},e.prototype.doubleSepReplace=function(e){var t=YoastSEO.app.stringHelper.addEscapeChars(this.replaceVars.sep),t=new RegExp(t+" "+t,"g");return e=e.replace(t,this.replaceVars.sep)},e.prototype.updateWpseoKeyword=function(e,t){t!=WPGlobusCoreData.default_language&&(1==r("#wpseo-meta-section-content_"+t+" .wpseo_keyword").length&&r("#wpseo-meta-section-content_"+t+" .wpseo_keyword").removeClass("wpseo_keyword").addClass("wpglobus-wpseo_keyword_"+t),r(".wpglobus-wpseo_keyword_"+t).text(e))},e.prototype.updatePageAnalysis=function(){r("#wpseo-pageanalysis_"+p.getWPseoTab()).html(r("#wpseo-pageanalysis").html())},window.WPGlobusYoastSeoPlugin=new e,YoastSEO.Analyzer.prototype.urlKeyword=function(){var e=[{test:"urlKeyword",result:0}];return void 0!==WPGlobusYoastSeo&&""!==WPGlobusYoastSeo.url&&(this.config.url=WPGlobusYoastSeo.url),void 0!==this.config.url&&(e[0].result=this.stringHelper.countMatches(this.config.url,this.keywordRegexInverse)),e}))});
|
includes/js/wpglobus-yoastseo-31.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var WPGlobusYoastSeo;jQuery(document).ready(function(r){"use strict";var p,l,t;"undefined"!=typeof wpseoReplaceVarsL10n&&"undefined"!=typeof WPGlobusCoreData&&"undefined"!=typeof WPGlobusVendor&&("edit-tags.php"==WPGlobusVendor.pagenow||"term.php"==WPGlobusVendor.pagenow?(l=WPGlobusYoastSeo={editorIDs:["description"],editor:{},submitId:"#submit",preventChangeEditor:!1,observer:null,init:function(){l.attachListeners(),_.delay(l.start,1500)},submit:function(e){"mouseenter"===e.type?r.each(l.editor,function(e,t){!l.editor[e].contentEditor||l.editor[e].contentEditor.isHidden()?r("#"+e).val(l.editor[e].content):tinymce.get(e).setContent(l.editor[e].content)}):"mouseleave"===e.type?l.preventChangeEditor||(r.each(l.editor,function(e,t){!l.editor[e].contentEditor||l.editor[e].contentEditor.isHidden()?r("#"+e).val(WPGlobusCore.TextFilter(t.content,l.getCurrentTab(),"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,l.getCurrentTab(),"RETURN_EMPTY"))}),l.preventChangeEditor=!1):"click"===e.type&&(l.preventChangeEditor=!0,"tinymce"!=getUserSetting("editor")&&setUserSetting("editor","tinymce"))},attachListeners:function(){r(".wrap").on("tabsactivate",function(e,a){r.each(l.editor,function(e,t){!l.editor[e].contentEditor||l.editor[e].contentEditor.isHidden()?r("#"+e).val(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY"))})}),r(document).on("mouseenter",l.submitId,l.submit).on("mouseleave",l.submitId,l.submit).on("click",l.submitId,l.submit),r(document).on("tinymce-editor-init",function(e,t){var a;-1!=_.indexOf(l.editorIDs,t.id)&&(a=r("#"+t.id),l.editor[t.id]={},l.editor[t.id].contentEditor=t,l.editor[t.id].content=a.val(),t.setContent(WPGlobusCore.TextFilter(l.editor[t.id].content,WPGlobusCoreData.default_language,"RETURN_EMPTY")),r("#"+t.getContainer().id).find("iframe").addClass("wpglobus-translatable"),a.removeClass("hidden"),t.on("nodechange keyup",_.debounce(l.update,500)),a.on("input keyup",_.debounce(l.update,500)))})},update:function(e){var t,a;void 0!==e.target&&("tinymce"==(t=e.target.id)&&(t=e.target.dataset.id),void 0!==l.editor[t].contentEditor&&(a=!l.editor[t].contentEditor||l.editor[t].contentEditor.isHidden()?r("#"+t).val():l.editor[t].contentEditor.getContent({format:"raw"}),l.editor[t].content=WPGlobusCore.getString(l.editor[t].content,a,l.getCurrentTab())))},getCurrentTab:function(){return r(".wpglobus-taxonomy-tabs-list .ui-tabs-active").data("language")},start:function(){r(".wpglobus-element_description").css({display:"none"})}},WPGlobusYoastSeo.init(),t=function(){r(".wrap").on("tabsactivate",function(e,t){t.newTab[0].dataset.language==WPGlobusCoreData.default_language?r("#poststuff .inside").css({display:"block"}):r("#poststuff .inside").css({display:"none"})}),r.each(["category_description","sitedesc","sitename","tag_description","term_description","term_title"],function(e,t){wpseoReplaceVarsL10n.replace_vars[t]=WPGlobusCore.TextFilter(wpseoReplaceVarsL10n.replace_vars[t],WPGlobusCoreData.default_language)}),WPGlobusYoastSeo.observer=new MutationObserver(function(e){e.forEach(function(e){var t;"placeholder"==e.attributeName&&(WPGlobusYoastSeo.observer.disconnect(),""==(t=r("#wpseo_focuskw")).val()&&t.attr("placeholder",WPGlobusCore.TextFilter(t.attr("placeholder"),WPGlobusCoreData.default_language)),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0}))})}),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0})},window.WPGlobusYoastSeoPlugin=new t):(l=WPGlobusYoastSeo={wpseoTabSelector:"#wpglobus-wpseo-tabs",url:"",attrs:r("#wpglobus-wpseo-attr"),iB:r("#wpseo-meta-section-content"),t:r("#wpseo-meta-section-content"),ids:"",names:"",editSnippetButtonClass:"wpglobus-snippet-editor__edit-button",editSnippetFormClass:"wpglobus-snippet-editor__form",editSnippetSubmitClass:"wpglobus-snippet-editor__submit",editSnippetHeadingClass:"wpglobus-snippet-editor__heading-editor",yoastTitleProgress:"wpglobus-yoast-title-progress",yoastMetadescProgress:"wpglobus-yoast-metadesc-progress",init:function(){l.start()},initAddKeywordPopup:function(){1===r("#wpseo-add-keyword-popup").length&&r(".wpseo-add-keyword").on("click",l.addKeywordPopup)},addKeywordPopup:function(){var e=r("#wpseo-add-keyword-popup").find("h3").html();tb_show(e,"#TB_inline?width=650&height=350&inlineId=wpseo-add-keyword-popup","group"),jQuery("#TB_window").css("height",235),jQuery("#TB_window").css("width",680)},qtip:function(){r(".yoast_help").qtip({content:{attr:"alt"},position:{my:"bottom left",at:"top center"},style:{tip:{corner:!0},classes:"yoast-qtip qtip-rounded qtip-blue"},show:"click",hide:{fixed:!0,delay:500}})},removeClasses:function(t,e){_.each(e,function(e){t.removeClass(e)})},updateProgressBar:function(e,t){var a,s,o,i,n,p;void 0!==e&&(void 0===t&&("undefined"!==e.data("language")&&(t=e.data("language")),void 0===t)||(o="",i=p=0,n=!(a=["snippet-editor__progress--bad","snippet-editor__progress--ok","snippet-editor__progress--good"]),p=e.val().length,e.hasClass("wpglobus-snippet-editor-title")?(i=(s=r("progress."+l.yoastTitleProgress+"_"+t)).attr("max"),o=a[2],0==p?o=a[1]:i<p?(o=a[1],n=!0):0<p&&p<35&&(o=a[1])):e.hasClass("wpglobus-snippet-editor-meta-description")&&(i=(s=r("progress."+l.yoastMetadescProgress+"_"+t)).attr("max"),o=a[2],0==p?o=a[1]:i<p?(o=a[1],n=!0):0<p&&p<121&&(o=a[1])),l.removeClasses(s,a),s.attr("value",p).addClass(o),n?e.css("color","#f00"):e.css("color","#000")))},start:function(){r(l.wpseoTabSelector).tabs(),l.ids=l.attrs.data("ids"),l.names=l.attrs.data("names"),l.ids=l.ids+","+l.attrs.data("qtip"),l.ids=l.ids.split(","),l.names=l.names.split(","),r("#wpglobus-wpseo-tabs").insertBefore(l.iB),r(".wpseo-metabox-tabs").css({height:"26px"}),r(".wpglobus-wpseo-general").each(function(e,t){var a=r(t),s=a.data("language"),o="wpseo-meta-section-content_"+s;a.html('<div id="'+o+'" class="wpseo-meta-section wpglobus-wpseo-meta-section" style="width:100%" data-language="'+s+'">'+l.t.html()+"</div>"),r("#"+o+" .wpseo-metabox-tabs").attr("id","wpseo-metabox-tabs_"+s),r("#"+o+" .wpseotab").attr("id","wpseo_content_"+s),r("#"+o).css({display:"block"}),r("#wpseo_meta").css({overflow:"hidden"}),r("#"+o+" .snippet_container").addClass("wpglobus-snippet_container"),s!==WPGlobusCoreData.default_language&&r("#"+o+" .wpseo-add-keyword").addClass("hidden"),r.each(l.names,function(e,t){r("#"+t).attr("name",t+"_"+s)}),r.each(l.ids,function(e,t){var a=r("#"+t);"wpseosnippet"==t&&a.addClass("wpglobus-wpseosnippet"),"snippet_title"==t&&a.addClass("wpglobus-snippet_title"),"snippet_meta"==t&&a.addClass("wpglobus-snippet_meta"),"snippet_cite"==t&&a.addClass("wpglobus-snippet_cite"),"snippet_citeBase"==t&&a.addClass("wpglobus-snippet_citeBase"),"yoast_wpseo_focuskw_text_input"==t&&a.addClass("wpglobus-yoast_wpseo_focuskw_text_input"),"wpseo-pageanalysis"==t&&a.addClass("wpglobus-wpseo-pageanalysis"),"snippet_preview"==t&&a.addClass("wpglobus-snippet_preview"),"snippet-editor-title"==t&&(a.addClass("wpglobus-snippet-editor-title"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),a.val(r("#wpseo-tab-"+s).data("wpseotitle")),a.parent("label").find("progress").addClass(l.yoastTitleProgress).addClass(l.yoastTitleProgress+"_"+s),_.debounce(l.updateProgressBar(a,s),500)),"snippet-editor-slug"==t&&(a.addClass("wpglobus-snippet-editor-slug"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),WPGlobusCoreData.default_language!=s&&a.attr("disabled","disabled")),"snippet-editor-meta-description"==t&&(a.addClass("wpglobus-snippet-editor-meta-description"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),a.val(r("#wpseo-tab-"+s).data("metadesc")),a.parent("label").find("progress").addClass(l.yoastMetadescProgress).addClass(l.yoastMetadescProgress+"_"+s),_.debounce(l.updateProgressBar(a,s),500)),a.attr("id",t+"_"+s),r("#"+t+"_"+s).attr("data-language",s)});var i=WPGlobusCore.TextFilter(r("#yoast_wpseo_focuskw_text_input").val(),s,"RETURN_EMPTY");r("#yoast_wpseo_focuskw_text_input_"+s).val(i),r("#yoast_wpseo_focuskw_"+s).val(i),s!==WPGlobusCoreData.default_language&&(r("#"+o+" #yoast_wpseo_focuskw_text_input_"+s).addClass("hidden").after('<div class="wpglobus-suggest" style="font-weight:bold;">'+WPGlobusVendor.i18n.yoastseo_plus_access+"</div>"),r("#"+o+" #wpseo-pageanalysis_"+s).addClass("hidden"))}),r(".wpglobus-wpseosnippet").each(function(e,t){var a=r(t),s=a.data("language");a.find("button.snippet-editor__button.snippet-editor__edit-button").addClass(l.editSnippetButtonClass).addClass(l.editSnippetButtonClass+"_"+s).attr("data-language",s),a.find(".snippet-editor__form").addClass(l.editSnippetFormClass).addClass(l.editSnippetFormClass+"_"+s),a.find(".snippet-editor__heading-editor").addClass(l.editSnippetHeadingClass).addClass(l.editSnippetHeadingClass+"_"+s),a.find(".snippet-editor__submit").addClass(l.editSnippetSubmitClass).addClass(l.editSnippetSubmitClass+"_"+s).attr("data-language",s)}),l.iB.addClass("hidden"),l.iB.css({height:0,overflow:"hidden"});var e=WPGlobusCore.TextFilter(r("#yoast_wpseo_focuskw_text_input").val(),WPGlobusCoreData.default_language,"RETURN_EMPTY");r("#yoast_wpseo_focuskw_text_input").val(e),r("#yoast_wpseo_focuskw").val(e),r(".wpseo-metabox-sidebar .wpseo-meta-section-link").on("click",function(e){"#wpseo-meta-section-content"==r(this).attr("href")?r("#wpglobus-wpseo-tabs").css({display:"block"}):r("#wpglobus-wpseo-tabs").css({display:"none"})}),r("body").on("click","."+l.editSnippetButtonClass,function(e){var t=r(this),a=t.data("language"),s=r("."+l.editSnippetFormClass+"_"+a),o=r("."+l.editSnippetSubmitClass+"_"+a),i=r("."+l.editSnippetHeadingClass+"_"+a);s.hasClass("snippet-editor--hidden")?(s.removeClass("snippet-editor--hidden"),i.removeClass("snippet-editor--hidden"),o.removeClass("snippet-editor--hidden")):(s.addClass("snippet-editor--hidden"),i.addClass("snippet-editor--hidden")),t.addClass("snippet-editor--hidden")}),r("body").on("click","."+l.editSnippetSubmitClass,function(e){var t=r(this).data("language"),a=r("."+l.editSnippetButtonClass+"_"+t),s=r("."+l.editSnippetFormClass+"_"+t),o=r("."+l.editSnippetSubmitClass+"_"+t),i=r("."+l.editSnippetHeadingClass+"_"+t);a.removeClass("snippet-editor--hidden"),s.addClass("snippet-editor--hidden"),o.addClass("snippet-editor--hidden"),i.addClass("snippet-editor--hidden")}),r(document).on("keyup","input.wpglobus-snippet-editor-title",function(e){var t=r(this),a=t.data("language"),s=WPGlobusCore.getString(r('input[name="yoast_wpseo_title"]').val(),t.val(),a);r("#snippet_title_"+a).text(t.val()),YoastSEO.app.rawData.pageTitle=s,r('input[name="yoast_wpseo_title"]').val(s),r("#snippet_title").text(s),_.debounce(l.updateProgressBar(t,a),500)}),r(document).on("keyup","input.wpglobus-snippet-editor-slug",function(e){var t=r(this),a=t.data("language");r("#snippet_cite_"+a).text(t.val()+"/"),r("#editable-post-name").text(t.val()),r("#editable-post-name-full").text(t.val())}),r(document).on("change","input.wpglobus-snippet-editor-slug",function(e){var t=r(this);r.post(ajaxurl,{action:"sample-permalink",post_id:r("#post_ID").val()||0,new_slug:t.val(),new_title:r("#title").val(),samplepermalinknonce:r("#samplepermalinknonce").val()})}),r(document).on("keyup","textarea.wpglobus-snippet-editor-meta-description",function(e){var t=r(this),a=t.data("language");r("#snippet_meta_"+a).text(t.val());var s=WPGlobusCore.getString(r("#yoast_wpseo_metadesc").val(),t.val(),t.data("language"));r("#yoast_wpseo_metadesc").val(s),r("#snippet_meta").text(s),_.debounce(l.updateProgressBar(t,a),500)}),r("body").on("click",".wpglobus-post-body-tabs-list li",function(e){var t,a=r(this);a.hasClass("wpglobus-post-tab")&&(r("#wpglobus-wpseo-tabs").tabs("option","active",a.data("order")),t=r("#yoast_wpseo_focuskw_text_input_"+r(this).data("language")).val(),YoastSEO.app.rawData.keyword=t,r("#yoast_wpseo_focuskw_text_input").val(t),r('input[name="yoast_wpseo_focuskw"]').val(t),YoastSEO.app.analyzeTimer(YoastSEO.app))}),l.qtip(),l.initAddKeywordPopup()}},(t=function(){this.replaceVars=wpseoReplaceVarsL10n.replace_vars,this.language=WPGlobusCoreData.default_language,this.tab=WPGlobusCoreData.default_language,this.wpseoTab=WPGlobusCoreData.default_language,this.title_template=wpseoPostScraperL10n.title_template,this.focuskw=r("#yoast_wpseo_focuskw_text_input"),this.focuskw_hidden=r('input[name="yoast_wpseo_focuskw"]'),this.focuskwKeep=!1,this.post_slug="#editable-post-name-full",YoastSEO.app.registerPlugin("wpglobusYoastSeoPlugin",{status:"ready"}),YoastSEO.app.registerModification("content",this.contentModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("title",this.titleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_title",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_meta",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_page_title",this.pageTitleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_meta_desc",this.metaDescModification,"wpglobusYoastSeoPlugin",0),r(document).on("blur",".wpglobus-snippet_title",function(e){var t=r(this),a=WPGlobusCore.getString(r("#yoast_wpseo_title").val(),t.text(),t.data("language"));YoastSEO.app.rawData.pageTitle=a,r('input[name="yoast_wpseo_title"]').val(a),r("#snippet_title").text(a)}),r(document).on("blur",".wpglobus-snippet_meta",function(e){var t=r(this),a=WPGlobusCore.getString(r("#yoast_wpseo_metadesc").val(),t.text(),t.data("language"));r("#yoast_wpseo_metadesc").val(a),r("#snippet_meta").text(a)}),r(document).on("keyup",".wpglobus-yoast_wpseo_focuskw_text_input",function(e){var t=r(this),a=t.val();p.focuskw.val(a),p.focuskw_hidden.val(a),p.updateWpseoKeyword(a,t.data("language")),YoastSEO.app.analyzeTimer(YoastSEO.app)}),r("#publish,#save-post").on("mouseenter",function(e){var a,s="";r(".wpglobus-yoast_wpseo_focuskw_text_input").each(function(e,t){a=r(this),s=WPGlobusCore.getString(s,a.val(),a.data("language"))}),p.focuskw.val(s),p.focuskw_hidden.val(s)}).on("mouseleave",function(e){p.focuskwKeep||(p.wpseoTab=r(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language"),r(this),p.focuskw.val(r("#yoast_wpseo_focuskw_text_input_"+p.wpseoTab).val()),p.focuskw_hidden.val(r("#yoast_wpseo_focuskw_text_input_"+p.wpseoTab).val()))}).on("click",function(e){p.focuskwKeep=!0}),r(WPGlobusYoastSeo.wpseoTabSelector).on("tabsactivate",function(e,t){var a;t.newPanel.attr("data-language")===WPGlobusCoreData.default_language&&(WPGlobusYoastSeo.url=r(p.post_slug).text(),a=r("#yoast_wpseo_focuskw_text_input_"+WPGlobusCoreData.default_language).val(),YoastSEO.app.rawData.keyword=a,p.focuskw.val(a),p.focuskw_hidden.val(a),YoastSEO.app.analyzeTimer(YoastSEO.app))}),p=this}).prototype.getWPseoTab=function(){return r(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language")},t.prototype.citeModification=function(e){var t="#snippet_citeBase_"+e,a="#snippet_cite_"+e,s=r("#wpseo-tab-"+e).data("yoast-cite-base");!1===r("#wpseo-tab-"+e).data("cite-contenteditable")&&r(a).attr("contenteditable","false"),r(t).text(s)},t.prototype.pageTitleModification=function(a){var s,o="#snippet_title_",i="",n="";if(p.title_template==a)r.each(WPGlobusCoreData.enabled_languages,function(e,t){p.language=t,i=p.replaceVariablesPlugin(a),r(o+t).text(i),t==p.getWPseoTab()&&(n=i)});else{if(s=WPGlobusCore.getTranslations(a),p.getWPseoTab()!==WPGlobusCoreData.default_language&&s[WPGlobusCoreData.default_language]==a){var e=p.getWPseoTab();return r(o+e).text(a),a}r.each(WPGlobusCoreData.enabled_languages,function(e,t){p.language=t,i=""===s[t]?p.replaceVariablesPlugin(p.title_template):s[t],r(o+t).text(i),t==p.getWPseoTab()&&(n=i)})}return n},t.prototype.metaDescModification=function(a){var s="#snippet_meta_";if(p.getWPseoTab()!==WPGlobusCoreData.default_language&&WPGlobusCore.getTranslations(a)[WPGlobusCoreData.default_language]==a){var e=p.getWPseoTab();return r(s+e).text(a),p.citeModification(e),a}return r.each(WPGlobusCoreData.enabled_languages,function(e,t){r(s+t).text(WPGlobusCore.TextFilter(a,t,"RETURN_EMPTY")),p.citeModification(t)}),WPGlobusCore.TextFilter(a,p.getWPseoTab(),"RETURN_EMPTY")},t.prototype.snippetModification=function(e){return WPGlobusCore.TextFilter(e,p.getWPseoTab(),"RETURN_EMPTY")},t.prototype.contentModification=function(e){return p.getWPseoTab()==WPGlobusCoreData.default_language?e:r("#content_"+p.getWPseoTab()).val()},t.prototype.titleModification=function(e){return setTimeout(p.updatePageAnalysis,1e3),p.getWPseoTab()==WPGlobusCoreData.default_language?e:r("#title_"+p.getWPseoTab()).val()},t.prototype.defaultReplace=function(e){var t=YoastSEO.app.rawData.keyword;return e.replace(/%%sitedesc%%/g,this.replaceVars.sitedesc).replace(/%%sitename%%/g,this.replaceVars.sitename).replace(/%%term_title%%/g,this.replaceVars.term_title).replace(/%%term_description%%/g,this.replaceVars.term_description).replace(/%%category_description%%/g,this.replaceVars.category_description).replace(/%%tag_description%%/g,this.replaceVars.tag_description).replace(/%%searchphrase%%/g,this.replaceVars.searchphrase).replace(/%%date%%/g,this.replaceVars.date).replace(/%%id%%/g,this.replaceVars.id).replace(/%%page%%/g,this.replaceVars.page).replace(/%%currenttime%%/g,this.replaceVars.currenttime).replace(/%%currentdate%%/g,this.replaceVars.currentdate).replace(/%%currentday%%/g,this.replaceVars.currentday).replace(/%%currentmonth%%/g,this.replaceVars.currentmonth).replace(/%%currentyear%%/g,this.replaceVars.currentyear).replace(/%%focuskw%%/g,t)},t.prototype.replaceVariablesPlugin=function(e){return void 0!==e&&(e=this.titleReplace(e),e=this.defaultReplace(e),e=this.replaceSeparators(e)),e},t.prototype.replaceSeparators=function(e){return e.replace(/%%sep%%(\s+%%sep%%)*/g,this.replaceVars.sep)},t.prototype.titleReplace=function(e){var t="";return void 0===(t=this.language==WPGlobusCoreData.default_language?r("#title").val():r("#title_"+this.language).val())&&(t=YoastSEO.app.rawData.pageTitle),e=e.replace(/%%title%%/g,t)},t.prototype.doubleSepReplace=function(e){var t=YoastSEO.app.stringHelper.addEscapeChars(this.replaceVars.sep),a=new RegExp(t+" "+t,"g");return e=e.replace(a,this.replaceVars.sep)},t.prototype.updateWpseoKeyword=function(e,t){t!=WPGlobusCoreData.default_language&&(1==r("#wpseo-meta-section-content_"+t+" .wpseo_keyword").length&&r("#wpseo-meta-section-content_"+t+" .wpseo_keyword").removeClass("wpseo_keyword").addClass("wpglobus-wpseo_keyword_"+t),r(".wpglobus-wpseo_keyword_"+t).text(e))},t.prototype.updatePageAnalysis=function(){r("#wpseo-pageanalysis_"+p.getWPseoTab()).html(r("#wpseo-pageanalysis").html())},t.prototype.countMatches=function(e,t){return null!==e.match(t)?e.match.length:0},window.WPGlobusYoastSeoPlugin=new t,YoastSEO.Analyzer.prototype.urlKeyword=function(){var e=[{test:"urlKeyword",result:0}];return void 0!==WPGlobusYoastSeo&&""!==WPGlobusYoastSeo.url&&(this.config.url=WPGlobusYoastSeo.url),void 0!==this.config.url&&(e[0].result=t.prototype.countMatches(this.config.url,this.keywordRegexInverse)),e}))});
|
1 |
+
var WPGlobusYoastSeo;jQuery(document).ready(function(r){"use strict";var p,l,t;"undefined"!=typeof wpseoReplaceVarsL10n&&"undefined"!=typeof WPGlobusCoreData&&"undefined"!=typeof WPGlobusVendor&&("edit-tags.php"==WPGlobusVendor.pagenow||"term.php"==WPGlobusVendor.pagenow?(l=WPGlobusYoastSeo={editorIDs:["description"],editor:{},submitId:"#submit",preventChangeEditor:!1,observer:null,init:function(){l.attachListeners(),_.delay(l.start,1500)},submit:function(e){"mouseenter"===e.type?r.each(l.editor,function(e,t){!l.editor[e].contentEditor||l.editor[e].contentEditor.isHidden()?r("#"+e).val(l.editor[e].content):tinymce.get(e).setContent(l.editor[e].content)}):"mouseleave"===e.type?l.preventChangeEditor||(r.each(l.editor,function(e,t){!l.editor[e].contentEditor||l.editor[e].contentEditor.isHidden()?r("#"+e).val(WPGlobusCore.TextFilter(t.content,l.getCurrentTab(),"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,l.getCurrentTab(),"RETURN_EMPTY"))}),l.preventChangeEditor=!1):"click"===e.type&&(l.preventChangeEditor=!0,"tinymce"!=getUserSetting("editor")&&setUserSetting("editor","tinymce"))},attachListeners:function(){r(".wrap").on("tabsactivate",function(e,a){r.each(l.editor,function(e,t){!l.editor[e].contentEditor||l.editor[e].contentEditor.isHidden()?r("#"+e).val(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY"))})}),r(document).on("mouseenter",l.submitId,l.submit).on("mouseleave",l.submitId,l.submit).on("click",l.submitId,l.submit),r(document).on("tinymce-editor-init",function(e,t){var a;-1!=_.indexOf(l.editorIDs,t.id)&&(a=r("#"+t.id),l.editor[t.id]={},l.editor[t.id].contentEditor=t,l.editor[t.id].content=a.val(),t.setContent(WPGlobusCore.TextFilter(l.editor[t.id].content,WPGlobusCoreData.default_language,"RETURN_EMPTY")),r("#"+t.getContainer().id).find("iframe").addClass("wpglobus-translatable"),a.removeClass("hidden"),t.on("nodechange keyup",_.debounce(l.update,500)),a.on("input keyup",_.debounce(l.update,500)))})},update:function(e){var t;void 0!==e.target&&("tinymce"==(t=e.target.id)&&(t=e.target.dataset.id),void 0!==l.editor[t].contentEditor&&(e=!l.editor[t].contentEditor||l.editor[t].contentEditor.isHidden()?r("#"+t).val():l.editor[t].contentEditor.getContent({format:"raw"}),l.editor[t].content=WPGlobusCore.getString(l.editor[t].content,e,l.getCurrentTab())))},getCurrentTab:function(){return r(".wpglobus-taxonomy-tabs-list .ui-tabs-active").data("language")},start:function(){r(".wpglobus-element_description").css({display:"none"})}},WPGlobusYoastSeo.init(),t=function(){r(".wrap").on("tabsactivate",function(e,t){t.newTab[0].dataset.language==WPGlobusCoreData.default_language?r("#poststuff .inside").css({display:"block"}):r("#poststuff .inside").css({display:"none"})}),r.each(["category_description","sitedesc","sitename","tag_description","term_description","term_title"],function(e,t){wpseoReplaceVarsL10n.replace_vars[t]=WPGlobusCore.TextFilter(wpseoReplaceVarsL10n.replace_vars[t],WPGlobusCoreData.default_language)}),WPGlobusYoastSeo.observer=new MutationObserver(function(e){e.forEach(function(e){"placeholder"==e.attributeName&&(WPGlobusYoastSeo.observer.disconnect(),""==(e=r("#wpseo_focuskw")).val()&&e.attr("placeholder",WPGlobusCore.TextFilter(e.attr("placeholder"),WPGlobusCoreData.default_language)),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0}))})}),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0})},window.WPGlobusYoastSeoPlugin=new t):(l=WPGlobusYoastSeo={wpseoTabSelector:"#wpglobus-wpseo-tabs",url:"",attrs:r("#wpglobus-wpseo-attr"),iB:r("#wpseo-meta-section-content"),t:r("#wpseo-meta-section-content"),ids:"",names:"",editSnippetButtonClass:"wpglobus-snippet-editor__edit-button",editSnippetFormClass:"wpglobus-snippet-editor__form",editSnippetSubmitClass:"wpglobus-snippet-editor__submit",editSnippetHeadingClass:"wpglobus-snippet-editor__heading-editor",yoastTitleProgress:"wpglobus-yoast-title-progress",yoastMetadescProgress:"wpglobus-yoast-metadesc-progress",init:function(){l.start()},initAddKeywordPopup:function(){1===r("#wpseo-add-keyword-popup").length&&r(".wpseo-add-keyword").on("click",l.addKeywordPopup)},addKeywordPopup:function(){var e=r("#wpseo-add-keyword-popup").find("h3").html();tb_show(e,"#TB_inline?width=650&height=350&inlineId=wpseo-add-keyword-popup","group"),jQuery("#TB_window").css("height",235),jQuery("#TB_window").css("width",680)},qtip:function(){r(".yoast_help").qtip({content:{attr:"alt"},position:{my:"bottom left",at:"top center"},style:{tip:{corner:!0},classes:"yoast-qtip qtip-rounded qtip-blue"},show:"click",hide:{fixed:!0,delay:500}})},removeClasses:function(t,e){_.each(e,function(e){t.removeClass(e)})},updateProgressBar:function(e,t){var a,s,o,i,n,p;void 0!==e&&(void 0===t&&void 0===(t="undefined"!==e.data("language")?e.data("language"):t)||(o="",i=p=0,n=!(a=["snippet-editor__progress--bad","snippet-editor__progress--ok","snippet-editor__progress--good"]),p=e.val().length,e.hasClass("wpglobus-snippet-editor-title")?(i=(s=r("progress."+l.yoastTitleProgress+"_"+t)).attr("max"),o=a[2],0==p?o=a[1]:i<p?(o=a[1],n=!0):0<p&&p<35&&(o=a[1])):e.hasClass("wpglobus-snippet-editor-meta-description")&&(i=(s=r("progress."+l.yoastMetadescProgress+"_"+t)).attr("max"),o=a[2],0==p?o=a[1]:i<p?(o=a[1],n=!0):0<p&&p<121&&(o=a[1])),l.removeClasses(s,a),s.attr("value",p).addClass(o),n?e.css("color","#f00"):e.css("color","#000")))},start:function(){r(l.wpseoTabSelector).tabs(),l.ids=l.attrs.data("ids"),l.names=l.attrs.data("names"),l.ids=l.ids+","+l.attrs.data("qtip"),l.ids=l.ids.split(","),l.names=l.names.split(","),r("#wpglobus-wpseo-tabs").insertBefore(l.iB),r(".wpseo-metabox-tabs").css({height:"26px"}),r(".wpglobus-wpseo-general").each(function(e,t){var a=r(t),s=a.data("language"),t="wpseo-meta-section-content_"+s;a.html('<div id="'+t+'" class="wpseo-meta-section wpglobus-wpseo-meta-section" style="width:100%" data-language="'+s+'">'+l.t.html()+"</div>"),r("#"+t+" .wpseo-metabox-tabs").attr("id","wpseo-metabox-tabs_"+s),r("#"+t+" .wpseotab").attr("id","wpseo_content_"+s),r("#"+t).css({display:"block"}),r("#wpseo_meta").css({overflow:"hidden"}),r("#"+t+" .snippet_container").addClass("wpglobus-snippet_container"),s!==WPGlobusCoreData.default_language&&r("#"+t+" .wpseo-add-keyword").addClass("hidden"),r.each(l.names,function(e,t){r("#"+t).attr("name",t+"_"+s)}),r.each(l.ids,function(e,t){var a=r("#"+t);"wpseosnippet"==t&&a.addClass("wpglobus-wpseosnippet"),"snippet_title"==t&&a.addClass("wpglobus-snippet_title"),"snippet_meta"==t&&a.addClass("wpglobus-snippet_meta"),"snippet_cite"==t&&a.addClass("wpglobus-snippet_cite"),"snippet_citeBase"==t&&a.addClass("wpglobus-snippet_citeBase"),"yoast_wpseo_focuskw_text_input"==t&&a.addClass("wpglobus-yoast_wpseo_focuskw_text_input"),"wpseo-pageanalysis"==t&&a.addClass("wpglobus-wpseo-pageanalysis"),"snippet_preview"==t&&a.addClass("wpglobus-snippet_preview"),"snippet-editor-title"==t&&(a.addClass("wpglobus-snippet-editor-title"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),a.val(r("#wpseo-tab-"+s).data("wpseotitle")),a.parent("label").find("progress").addClass(l.yoastTitleProgress).addClass(l.yoastTitleProgress+"_"+s),_.debounce(l.updateProgressBar(a,s),500)),"snippet-editor-slug"==t&&(a.addClass("wpglobus-snippet-editor-slug"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),WPGlobusCoreData.default_language!=s&&a.attr("disabled","disabled")),"snippet-editor-meta-description"==t&&(a.addClass("wpglobus-snippet-editor-meta-description"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),a.val(r("#wpseo-tab-"+s).data("metadesc")),a.parent("label").find("progress").addClass(l.yoastMetadescProgress).addClass(l.yoastMetadescProgress+"_"+s),_.debounce(l.updateProgressBar(a,s),500)),a.attr("id",t+"_"+s),r("#"+t+"_"+s).attr("data-language",s)});a=WPGlobusCore.TextFilter(r("#yoast_wpseo_focuskw_text_input").val(),s,"RETURN_EMPTY");r("#yoast_wpseo_focuskw_text_input_"+s).val(a),r("#yoast_wpseo_focuskw_"+s).val(a),s!==WPGlobusCoreData.default_language&&(r("#"+t+" #yoast_wpseo_focuskw_text_input_"+s).addClass("hidden").after('<div class="wpglobus-suggest" style="font-weight:bold;">'+WPGlobusVendor.i18n.yoastseo_plus_access+"</div>"),r("#"+t+" #wpseo-pageanalysis_"+s).addClass("hidden"))}),r(".wpglobus-wpseosnippet").each(function(e,t){var a=r(t),t=a.data("language");a.find("button.snippet-editor__button.snippet-editor__edit-button").addClass(l.editSnippetButtonClass).addClass(l.editSnippetButtonClass+"_"+t).attr("data-language",t),a.find(".snippet-editor__form").addClass(l.editSnippetFormClass).addClass(l.editSnippetFormClass+"_"+t),a.find(".snippet-editor__heading-editor").addClass(l.editSnippetHeadingClass).addClass(l.editSnippetHeadingClass+"_"+t),a.find(".snippet-editor__submit").addClass(l.editSnippetSubmitClass).addClass(l.editSnippetSubmitClass+"_"+t).attr("data-language",t)}),l.iB.addClass("hidden"),l.iB.css({height:0,overflow:"hidden"});var e=WPGlobusCore.TextFilter(r("#yoast_wpseo_focuskw_text_input").val(),WPGlobusCoreData.default_language,"RETURN_EMPTY");r("#yoast_wpseo_focuskw_text_input").val(e),r("#yoast_wpseo_focuskw").val(e),r(".wpseo-metabox-sidebar .wpseo-meta-section-link").on("click",function(e){"#wpseo-meta-section-content"==r(this).attr("href")?r("#wpglobus-wpseo-tabs").css({display:"block"}):r("#wpglobus-wpseo-tabs").css({display:"none"})}),r("body").on("click","."+l.editSnippetButtonClass,function(e){var t=r(this),a=t.data("language"),s=r("."+l.editSnippetFormClass+"_"+a),o=r("."+l.editSnippetSubmitClass+"_"+a),a=r("."+l.editSnippetHeadingClass+"_"+a);s.hasClass("snippet-editor--hidden")?(s.removeClass("snippet-editor--hidden"),a.removeClass("snippet-editor--hidden"),o.removeClass("snippet-editor--hidden")):(s.addClass("snippet-editor--hidden"),a.addClass("snippet-editor--hidden")),t.addClass("snippet-editor--hidden")}),r("body").on("click","."+l.editSnippetSubmitClass,function(e){var t=r(this).data("language"),a=r("."+l.editSnippetButtonClass+"_"+t),s=r("."+l.editSnippetFormClass+"_"+t),o=r("."+l.editSnippetSubmitClass+"_"+t),t=r("."+l.editSnippetHeadingClass+"_"+t);a.removeClass("snippet-editor--hidden"),s.addClass("snippet-editor--hidden"),o.addClass("snippet-editor--hidden"),t.addClass("snippet-editor--hidden")}),r(document).on("keyup","input.wpglobus-snippet-editor-title",function(e){var t=r(this),a=t.data("language"),s=WPGlobusCore.getString(r('input[name="yoast_wpseo_title"]').val(),t.val(),a);r("#snippet_title_"+a).text(t.val()),YoastSEO.app.rawData.pageTitle=s,r('input[name="yoast_wpseo_title"]').val(s),r("#snippet_title").text(s),_.debounce(l.updateProgressBar(t,a),500)}),r(document).on("keyup","input.wpglobus-snippet-editor-slug",function(e){var t=r(this),a=t.data("language");r("#snippet_cite_"+a).text(t.val()+"/"),r("#editable-post-name").text(t.val()),r("#editable-post-name-full").text(t.val())}),r(document).on("change","input.wpglobus-snippet-editor-slug",function(e){var t=r(this);r.post(ajaxurl,{action:"sample-permalink",post_id:r("#post_ID").val()||0,new_slug:t.val(),new_title:r("#title").val(),samplepermalinknonce:r("#samplepermalinknonce").val()})}),r(document).on("keyup","textarea.wpglobus-snippet-editor-meta-description",function(e){var t=r(this),a=t.data("language");r("#snippet_meta_"+a).text(t.val());var s=WPGlobusCore.getString(r("#yoast_wpseo_metadesc").val(),t.val(),t.data("language"));r("#yoast_wpseo_metadesc").val(s),r("#snippet_meta").text(s),_.debounce(l.updateProgressBar(t,a),500)}),r("body").on("click",".wpglobus-post-body-tabs-list li",function(e){var t=r(this);t.hasClass("wpglobus-post-tab")&&(r("#wpglobus-wpseo-tabs").tabs("option","active",t.data("order")),t=r("#yoast_wpseo_focuskw_text_input_"+r(this).data("language")).val(),YoastSEO.app.rawData.keyword=t,r("#yoast_wpseo_focuskw_text_input").val(t),r('input[name="yoast_wpseo_focuskw"]').val(t),YoastSEO.app.analyzeTimer(YoastSEO.app))}),l.qtip(),l.initAddKeywordPopup()}},(t=function(){this.replaceVars=wpseoReplaceVarsL10n.replace_vars,this.language=WPGlobusCoreData.default_language,this.tab=WPGlobusCoreData.default_language,this.wpseoTab=WPGlobusCoreData.default_language,this.title_template=wpseoPostScraperL10n.title_template,this.focuskw=r("#yoast_wpseo_focuskw_text_input"),this.focuskw_hidden=r('input[name="yoast_wpseo_focuskw"]'),this.focuskwKeep=!1,this.post_slug="#editable-post-name-full",YoastSEO.app.registerPlugin("wpglobusYoastSeoPlugin",{status:"ready"}),YoastSEO.app.registerModification("content",this.contentModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("title",this.titleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_title",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_meta",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_page_title",this.pageTitleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_meta_desc",this.metaDescModification,"wpglobusYoastSeoPlugin",0),r(document).on("blur",".wpglobus-snippet_title",function(e){var t=r(this),t=WPGlobusCore.getString(r("#yoast_wpseo_title").val(),t.text(),t.data("language"));YoastSEO.app.rawData.pageTitle=t,r('input[name="yoast_wpseo_title"]').val(t),r("#snippet_title").text(t)}),r(document).on("blur",".wpglobus-snippet_meta",function(e){var t=r(this),t=WPGlobusCore.getString(r("#yoast_wpseo_metadesc").val(),t.text(),t.data("language"));r("#yoast_wpseo_metadesc").val(t),r("#snippet_meta").text(t)}),r(document).on("keyup",".wpglobus-yoast_wpseo_focuskw_text_input",function(e){var t=r(this),a=t.val();p.focuskw.val(a),p.focuskw_hidden.val(a),p.updateWpseoKeyword(a,t.data("language")),YoastSEO.app.analyzeTimer(YoastSEO.app)}),r("#publish,#save-post").on("mouseenter",function(e){var a,s="";r(".wpglobus-yoast_wpseo_focuskw_text_input").each(function(e,t){a=r(this),s=WPGlobusCore.getString(s,a.val(),a.data("language"))}),p.focuskw.val(s),p.focuskw_hidden.val(s)}).on("mouseleave",function(e){p.focuskwKeep||(p.wpseoTab=r(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language"),r(this),p.focuskw.val(r("#yoast_wpseo_focuskw_text_input_"+p.wpseoTab).val()),p.focuskw_hidden.val(r("#yoast_wpseo_focuskw_text_input_"+p.wpseoTab).val()))}).on("click",function(e){p.focuskwKeep=!0}),r(WPGlobusYoastSeo.wpseoTabSelector).on("tabsactivate",function(e,t){t.newPanel.attr("data-language")===WPGlobusCoreData.default_language&&(WPGlobusYoastSeo.url=r(p.post_slug).text(),t=r("#yoast_wpseo_focuskw_text_input_"+WPGlobusCoreData.default_language).val(),YoastSEO.app.rawData.keyword=t,p.focuskw.val(t),p.focuskw_hidden.val(t),YoastSEO.app.analyzeTimer(YoastSEO.app))}),p=this}).prototype.getWPseoTab=function(){return r(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language")},t.prototype.citeModification=function(e){var t="#snippet_citeBase_"+e,a="#snippet_cite_"+e,s=r("#wpseo-tab-"+e).data("yoast-cite-base");!1===r("#wpseo-tab-"+e).data("cite-contenteditable")&&r(a).attr("contenteditable","false"),r(t).text(s)},t.prototype.pageTitleModification=function(a){var s,o="#snippet_title_",i="",n="";if(p.title_template==a)r.each(WPGlobusCoreData.enabled_languages,function(e,t){p.language=t,i=p.replaceVariablesPlugin(a),r(o+t).text(i),t==p.getWPseoTab()&&(n=i)});else{if(s=WPGlobusCore.getTranslations(a),p.getWPseoTab()!==WPGlobusCoreData.default_language&&s[WPGlobusCoreData.default_language]==a){var e=p.getWPseoTab();return r(o+e).text(a),a}r.each(WPGlobusCoreData.enabled_languages,function(e,t){p.language=t,i=""===s[t]?p.replaceVariablesPlugin(p.title_template):s[t],r(o+t).text(i),t==p.getWPseoTab()&&(n=i)})}return n},t.prototype.metaDescModification=function(a){var s="#snippet_meta_";if(p.getWPseoTab()!==WPGlobusCoreData.default_language&&WPGlobusCore.getTranslations(a)[WPGlobusCoreData.default_language]==a){var e=p.getWPseoTab();return r(s+e).text(a),p.citeModification(e),a}return r.each(WPGlobusCoreData.enabled_languages,function(e,t){r(s+t).text(WPGlobusCore.TextFilter(a,t,"RETURN_EMPTY")),p.citeModification(t)}),WPGlobusCore.TextFilter(a,p.getWPseoTab(),"RETURN_EMPTY")},t.prototype.snippetModification=function(e){return WPGlobusCore.TextFilter(e,p.getWPseoTab(),"RETURN_EMPTY")},t.prototype.contentModification=function(e){return p.getWPseoTab()==WPGlobusCoreData.default_language?e:r("#content_"+p.getWPseoTab()).val()},t.prototype.titleModification=function(e){return setTimeout(p.updatePageAnalysis,1e3),p.getWPseoTab()==WPGlobusCoreData.default_language?e:r("#title_"+p.getWPseoTab()).val()},t.prototype.defaultReplace=function(e){var t=YoastSEO.app.rawData.keyword;return e.replace(/%%sitedesc%%/g,this.replaceVars.sitedesc).replace(/%%sitename%%/g,this.replaceVars.sitename).replace(/%%term_title%%/g,this.replaceVars.term_title).replace(/%%term_description%%/g,this.replaceVars.term_description).replace(/%%category_description%%/g,this.replaceVars.category_description).replace(/%%tag_description%%/g,this.replaceVars.tag_description).replace(/%%searchphrase%%/g,this.replaceVars.searchphrase).replace(/%%date%%/g,this.replaceVars.date).replace(/%%id%%/g,this.replaceVars.id).replace(/%%page%%/g,this.replaceVars.page).replace(/%%currenttime%%/g,this.replaceVars.currenttime).replace(/%%currentdate%%/g,this.replaceVars.currentdate).replace(/%%currentday%%/g,this.replaceVars.currentday).replace(/%%currentmonth%%/g,this.replaceVars.currentmonth).replace(/%%currentyear%%/g,this.replaceVars.currentyear).replace(/%%focuskw%%/g,t)},t.prototype.replaceVariablesPlugin=function(e){return void 0!==e&&(e=this.titleReplace(e),e=this.defaultReplace(e),e=this.replaceSeparators(e)),e},t.prototype.replaceSeparators=function(e){return e.replace(/%%sep%%(\s+%%sep%%)*/g,this.replaceVars.sep)},t.prototype.titleReplace=function(e){var t="";return void 0===(t=(this.language==WPGlobusCoreData.default_language?r("#title"):r("#title_"+this.language)).val())&&(t=YoastSEO.app.rawData.pageTitle),e=e.replace(/%%title%%/g,t)},t.prototype.doubleSepReplace=function(e){var t=YoastSEO.app.stringHelper.addEscapeChars(this.replaceVars.sep),t=new RegExp(t+" "+t,"g");return e=e.replace(t,this.replaceVars.sep)},t.prototype.updateWpseoKeyword=function(e,t){t!=WPGlobusCoreData.default_language&&(1==r("#wpseo-meta-section-content_"+t+" .wpseo_keyword").length&&r("#wpseo-meta-section-content_"+t+" .wpseo_keyword").removeClass("wpseo_keyword").addClass("wpglobus-wpseo_keyword_"+t),r(".wpglobus-wpseo_keyword_"+t).text(e))},t.prototype.updatePageAnalysis=function(){r("#wpseo-pageanalysis_"+p.getWPseoTab()).html(r("#wpseo-pageanalysis").html())},t.prototype.countMatches=function(e,t){return null!==e.match(t)?e.match.length:0},window.WPGlobusYoastSeoPlugin=new t,YoastSEO.Analyzer.prototype.urlKeyword=function(){var e=[{test:"urlKeyword",result:0}];return void 0!==WPGlobusYoastSeo&&""!==WPGlobusYoastSeo.url&&(this.config.url=WPGlobusYoastSeo.url),void 0!==this.config.url&&(e[0].result=t.prototype.countMatches(this.config.url,this.keywordRegexInverse)),e}))});
|
includes/js/wpglobus-yoastseo-32.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var WPGlobusYoastSeo;jQuery(document).ready(function(l){"use strict";var r,d,s;"undefined"!=typeof wpseoReplaceVarsL10n&&"undefined"!=typeof WPGlobusCoreData&&"undefined"!=typeof WPGlobusVendor&&("edit-tags.php"==WPGlobusVendor.pagenow||"term.php"==WPGlobusVendor.pagenow?(d=WPGlobusYoastSeo={editorIDs:["description"],editor:{},submitId:"#submit",preventChangeEditor:!1,observer:null,init:function(){d.attachListeners(),_.delay(d.start,1500)},submit:function(e){"mouseenter"===e.type?l.each(d.editor,function(e,t){!d.editor[e].contentEditor||d.editor[e].contentEditor.isHidden()?l("#"+e).val(d.editor[e].content):tinymce.get(e).setContent(d.editor[e].content)}):"mouseleave"===e.type?d.preventChangeEditor||(l.each(d.editor,function(e,t){!d.editor[e].contentEditor||d.editor[e].contentEditor.isHidden()?l("#"+e).val(WPGlobusCore.TextFilter(t.content,d.getCurrentTab(),"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,d.getCurrentTab(),"RETURN_EMPTY"))}),d.preventChangeEditor=!1):"click"===e.type&&(d.preventChangeEditor=!0,"tinymce"!=getUserSetting("editor")&&setUserSetting("editor","tinymce"))},attachListeners:function(){l(".wrap").on("tabsactivate",function(e,a){l.each(d.editor,function(e,t){!d.editor[e].contentEditor||d.editor[e].contentEditor.isHidden()?l("#"+e).val(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY"))})}),l(document).on("mouseenter",d.submitId,d.submit).on("mouseleave",d.submitId,d.submit).on("click",d.submitId,d.submit),l(document).on("tinymce-editor-init",function(e,t){var a;-1!=_.indexOf(d.editorIDs,t.id)&&(a=l("#"+t.id),d.editor[t.id]={},d.editor[t.id].contentEditor=t,d.editor[t.id].content=a.val(),t.setContent(WPGlobusCore.TextFilter(d.editor[t.id].content,WPGlobusCoreData.default_language,"RETURN_EMPTY")),l("#"+t.getContainer().id).find("iframe").addClass("wpglobus-translatable"),a.removeClass("hidden"),t.on("nodechange keyup",_.debounce(d.update,500)),a.on("input keyup",_.debounce(d.update,500)))})},update:function(e){var t,a;void 0!==e.target&&("tinymce"==(t=e.target.id)&&(t=e.target.dataset.id),void 0!==d.editor[t].contentEditor&&(a=!d.editor[t].contentEditor||d.editor[t].contentEditor.isHidden()?l("#"+t).val():d.editor[t].contentEditor.getContent({format:"raw"}),d.editor[t].content=WPGlobusCore.getString(d.editor[t].content,a,d.getCurrentTab())))},getCurrentTab:function(){return l(".wpglobus-taxonomy-tabs-list .ui-tabs-active").data("language")},start:function(){l(".wpglobus-element_description").css({display:"none"})}},WPGlobusYoastSeo.init(),s=function(){l(".wrap").on("tabsactivate",function(e,t){t.newTab[0].dataset.language==WPGlobusCoreData.default_language?l("#poststuff .inside").css({display:"block"}):l("#poststuff .inside").css({display:"none"})}),l.each(["category_description","sitedesc","sitename","tag_description","term_description","term_title"],function(e,t){wpseoReplaceVarsL10n.replace_vars[t]=WPGlobusCore.TextFilter(wpseoReplaceVarsL10n.replace_vars[t],WPGlobusCoreData.default_language)}),WPGlobusYoastSeo.observer=new MutationObserver(function(e){e.forEach(function(e){var t;"placeholder"==e.attributeName&&(WPGlobusYoastSeo.observer.disconnect(),""==(t=l("#wpseo_focuskw")).val()&&t.attr("placeholder",WPGlobusCore.TextFilter(t.attr("placeholder"),WPGlobusCoreData.default_language)),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0}))})}),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0})}):(d=WPGlobusYoastSeo={wpseoTabSelector:"#wpglobus-wpseo-tabs",url:"",attrs:l("#wpglobus-wpseo-attr"),iB:l("#wpseo-meta-section-content"),t:l("#wpseo-meta-section-content"),ids:"",names:"",editSnippetButtonClass:"wpglobus-snippet-editor__edit-button",editSnippetFormClass:"wpglobus-snippet-editor__form",editSnippetSubmitClass:"wpglobus-snippet-editor__submit",editSnippetHeadingClass:"wpglobus-snippet-editor__heading-editor",yoastTitleProgress:"wpglobus-yoast-title-progress",yoastMetadescProgress:"wpglobus-yoast-metadesc-progress",init:function(){d.start()},initAddKeywordPopup:function(){1===l("#wpseo-add-keyword-popup").length&&l(".wpseo-add-keyword").on("click",d.addKeywordPopup)},addKeywordPopup:function(){var e=l("#wpseo-add-keyword-popup-button").text();tb_show(e,"#TB_inline?width=650&height=350&inlineId=wpseo-add-keyword-popup","group"),jQuery("#TB_window").css("height",235),jQuery("#TB_window").css("width",680)},qtip:function(){l(".yoast_help").qtip({content:{attr:"alt"},position:{my:"bottom left",at:"top center"},style:{tip:{corner:!0},classes:"yoast-qtip qtip-rounded qtip-blue"},show:"click",hide:{fixed:!0,delay:500}})},removeClasses:function(t,e){_.each(e,function(e){t.removeClass(e)})},updateProgressBar:function(e,t){var a,s,o,i,n,p;void 0!==e&&(void 0===t&&("undefined"!==e.data("language")&&(t=e.data("language")),void 0===t)||(o="",i=p=0,n=!(a=["snippet-editor__progress--bad","snippet-editor__progress--ok","snippet-editor__progress--good"]),p=e.val().length,e.hasClass("wpglobus-snippet-editor-title")?(i=(s=l("progress."+d.yoastTitleProgress+"_"+t)).attr("max"),o=a[2],0==p?o=a[1]:i<p?(o=a[1],n=!0):0<p&&p<35&&(o=a[1])):e.hasClass("wpglobus-snippet-editor-meta-description")&&(i=(s=l("progress."+d.yoastMetadescProgress+"_"+t)).attr("max"),o=a[2],0==p?o=a[1]:i<p?(o=a[1],n=!0):0<p&&p<121&&(o=a[1])),d.removeClasses(s,a),s.attr("value",p).addClass(o),n?e.css("color","#f00"):e.css("color","#000")))},updateWpseoKeyword:function(e,t){l("#wpseo-meta-section-content_"+t+" .wpseo_keyword").text(e)},start:function(){l(d.wpseoTabSelector).tabs(),d.ids=d.attrs.data("ids"),d.names=d.attrs.data("names"),d.ids=d.ids+","+d.attrs.data("qtip"),d.ids=d.ids.split(","),d.names=d.names.split(","),l("#wpglobus-wpseo-tabs").insertBefore(d.iB),l(".wpseo-metabox-tabs").css({height:"26px"}),l(".wpglobus-wpseo-general").each(function(e,t){var a=l(t),s=a.data("language"),o="wpseo-meta-section-content_"+s;a.html('<div id="'+o+'" class="wpseo-meta-section wpglobus-wpseo-meta-section" style="width:100%" data-language="'+s+'">'+d.t.html()+"</div>"),l("#"+o+" .wpseo-metabox-tabs").attr("id","wpseo-metabox-tabs_"+s),l("#"+o+" .wpseotab").attr("id","wpseo_content_"+s),l("#wpseo_content_"+s).css({float:"left"}),l("#"+o).css({display:"block"}),l("#wpseo_meta").css({overflow:"hidden"}),l("#"+o+" .snippet_container").addClass("wpglobus-snippet_container"),s!==WPGlobusCoreData.default_language&&l("#"+o+" .wpseo-add-keyword").addClass("hidden"),l.each(d.names,function(e,t){l("#"+t).attr("name",t+"_"+s)}),l.each(d.ids,function(e,t){var a=l("#"+t);"wpseosnippet"==t&&a.addClass("wpglobus-wpseosnippet"),"snippet_title"==t&&a.addClass("wpglobus-snippet_title"),"snippet_meta"==t&&a.addClass("wpglobus-snippet_meta"),"snippet_cite"==t&&a.addClass("wpglobus-snippet_cite"),"snippet_citeBase"==t&&a.addClass("wpglobus-snippet_citeBase"),"yoast_wpseo_focuskw_text_input"==t&&a.addClass("wpglobus-yoast_wpseo_focuskw_text_input"),"wpseo-pageanalysis"==t&&a.addClass("wpglobus-wpseo-pageanalysis"),"snippet_preview"==t&&a.addClass("wpglobus-snippet_preview"),"snippet-editor-title"==t&&(a.addClass("wpglobus-snippet-editor-title"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),a.val(l("#wpseo-tab-"+s).data("wpseotitle")),a.parent("label").find("progress").addClass(d.yoastTitleProgress).addClass(d.yoastTitleProgress+"_"+s),_.debounce(d.updateProgressBar(a,s),500)),"snippet-editor-slug"==t&&(a.addClass("wpglobus-snippet-editor-slug"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),WPGlobusCoreData.default_language!=s&&a.attr("disabled","disabled")),"snippet-editor-meta-description"==t&&(a.addClass("wpglobus-snippet-editor-meta-description"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),a.val(l("#wpseo-tab-"+s).data("metadesc")),a.parent("label").find("progress").addClass(d.yoastMetadescProgress).addClass(d.yoastMetadescProgress+"_"+s),_.debounce(d.updateProgressBar(a,s),500)),"snippetpreview-help-toggle"==t&&(a.addClass("wpglobus-snippetpreview-help-toggle_"+s),l(document).on("click",".wpglobus-snippetpreview-help-toggle_"+s,function(e){var t=l(this);"none"===l("#snippetpreview-help_"+t.data("language")).css("display")?l("#snippetpreview-help_"+t.data("language")).css({display:"block"}):l("#snippetpreview-help_"+t.data("language")).css({display:"none"})})),"focuskw_text_input-help-toggle"==t&&(a.addClass("wpglobus-focuskw_text_input-help-toggle_"+s),l(document).on("click",".wpglobus-focuskw_text_input-help-toggle_"+s,function(e){var t=l(this);"none"===l("#focuskw_text_input-help_"+t.data("language")).css("display")?l("#focuskw_text_input-help_"+t.data("language")).css({display:"block"}):l("#focuskw_text_input-help_"+t.data("language")).css({display:"none"})})),"pageanalysis-help-toggle"==t&&(a.addClass("wpglobus-pageanalysis-help-toggle_"+s),l(document).on("click",".wpglobus-pageanalysis-help-toggle_"+s,function(e){var t=l(this);"none"===l("#pageanalysis-help_"+t.data("language")).css("display")?l("#pageanalysis-help_"+t.data("language")).css({display:"block"}):l("#pageanalysis-help_"+t.data("language")).css({display:"none"})})),a.attr("id",t+"_"+s),l("#"+t+"_"+s).attr("data-language",s)});var i=WPGlobusCore.TextFilter(l("#yoast_wpseo_focuskw_text_input").val(),s,"RETURN_EMPTY");l("#yoast_wpseo_focuskw_text_input_"+s).val(i),l("#yoast_wpseo_focuskw_"+s).val(i),d.updateWpseoKeyword(i,s),s!==WPGlobusCoreData.default_language&&(l("#"+o+" #yoast_wpseo_focuskw_text_input_"+s).addClass("hidden").after('<div class="wpglobus-suggest" style="font-weight:bold;">'+WPGlobusVendor.i18n.yoastseo_plus_access+"</div>"),l("#"+o+" #wpseo-pageanalysis_"+s).addClass("hidden"))}),l(".wpglobus-wpseosnippet").each(function(e,t){var a=l(t),s=a.data("language");a.find("button.snippet-editor__button.snippet-editor__edit-button").addClass(d.editSnippetButtonClass).addClass(d.editSnippetButtonClass+"_"+s).attr("data-language",s),a.find(".snippet-editor__form").addClass(d.editSnippetFormClass).addClass(d.editSnippetFormClass+"_"+s),a.find(".snippet-editor__heading-editor").addClass(d.editSnippetHeadingClass).addClass(d.editSnippetHeadingClass+"_"+s),a.find(".snippet-editor__submit").addClass(d.editSnippetSubmitClass).addClass(d.editSnippetSubmitClass+"_"+s).attr("data-language",s)}),d.iB.addClass("hidden"),d.iB.css({height:0,overflow:"hidden"});var e=WPGlobusCore.TextFilter(l("#yoast_wpseo_focuskw_text_input").val(),WPGlobusCoreData.default_language,"RETURN_EMPTY");l("#yoast_wpseo_focuskw_text_input").val(e),l("#yoast_wpseo_focuskw").val(e),l(".wpseo-metabox-sidebar .wpseo-meta-section-link").on("click",function(e){"#wpseo-meta-section-content"==l(this).attr("href")?l("#wpglobus-wpseo-tabs").css({display:"block"}):l("#wpglobus-wpseo-tabs").css({display:"none"})}),l("body").on("click","."+d.editSnippetButtonClass,function(e){var t=l(this),a=t.data("language"),s=l("."+d.editSnippetFormClass+"_"+a),o=l("."+d.editSnippetSubmitClass+"_"+a),i=l("."+d.editSnippetHeadingClass+"_"+a);s.hasClass("snippet-editor--hidden")?(s.removeClass("snippet-editor--hidden"),i.removeClass("snippet-editor--hidden"),o.removeClass("snippet-editor--hidden")):(s.addClass("snippet-editor--hidden"),i.addClass("snippet-editor--hidden")),t.addClass("snippet-editor--hidden")}),l("body").on("click","."+d.editSnippetSubmitClass,function(e){var t=l(this).data("language"),a=l("."+d.editSnippetButtonClass+"_"+t),s=l("."+d.editSnippetFormClass+"_"+t),o=l("."+d.editSnippetSubmitClass+"_"+t),i=l("."+d.editSnippetHeadingClass+"_"+t);a.removeClass("snippet-editor--hidden"),s.addClass("snippet-editor--hidden"),o.addClass("snippet-editor--hidden"),i.addClass("snippet-editor--hidden")}),l(document).on("keyup","input.wpglobus-snippet-editor-title",function(e){var t=l(this),a=t.data("language"),s=WPGlobusCore.getString(l('input[name="yoast_wpseo_title"]').val(),t.val(),a);l("#snippet_title_"+a).html(r.replaceVariablesPlugin(t.val())),YoastSEO.app.rawData.pageTitle=s,l('input[name="yoast_wpseo_title"]').val(s),l("#snippet_title").text(s),_.debounce(d.updateProgressBar(t,a),500)}),l(document).on("keyup","input.wpglobus-snippet-editor-slug",function(e){var t=l(this),a=t.data("language");l("#snippet_cite_"+a).text(t.val()+"/"),l("#editable-post-name").text(t.val()),l("#editable-post-name-full").text(t.val())}),l(document).on("change","input.wpglobus-snippet-editor-slug",function(e){var t=l(this);l.post(ajaxurl,{action:"sample-permalink",post_id:l("#post_ID").val()||0,new_slug:t.val(),new_title:l("#title").val(),samplepermalinknonce:l("#samplepermalinknonce").val()})}),l(document).on("keyup","textarea.wpglobus-snippet-editor-meta-description",function(e){var t=l(this),a=t.data("language");l("#snippet_meta_"+a).text(t.val());var s=WPGlobusCore.getString(l("#yoast_wpseo_metadesc").val(),t.val(),t.data("language"));l("#yoast_wpseo_metadesc").val(s),l("#snippet_meta").text(s),_.debounce(d.updateProgressBar(t,a),500)}),l("body").on("click",".wpglobus-post-body-tabs-list li",function(e){var t,a=l(this);a.hasClass("wpglobus-post-tab")&&(l("#wpglobus-wpseo-tabs").tabs("option","active",a.data("order")),t=l("#yoast_wpseo_focuskw_text_input_"+l(this).data("language")).val(),YoastSEO.app.rawData.keyword=t,l("#yoast_wpseo_focuskw_text_input").val(t),l('input[name="yoast_wpseo_focuskw"]').val(t),s.prototype.analyze())}),d.initAddKeywordPopup()}},(s=function(){this.replaceVars=wpseoReplaceVarsL10n.replace_vars,this.language=WPGlobusCoreData.default_language,this.tab=WPGlobusCoreData.default_language,this.wpseoTab=WPGlobusCoreData.default_language,this.title_template=wpseoPostScraperL10n.title_template,this.focuskw=l("#yoast_wpseo_focuskw_text_input"),this.focuskw_hidden=l('input[name="yoast_wpseo_focuskw"]'),this.focuskwKeep=!1,this.post_slug="#editable-post-name-full",YoastSEO.app.registerPlugin("wpglobusYoastSeoPlugin",{status:"ready"}),YoastSEO.app.registerModification("content",this.contentModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("title",this.titleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_title",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_meta",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_page_title",this.pageTitleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_meta_desc",this.metaDescModification,"wpglobusYoastSeoPlugin",0),s.prototype.setScoreIcon(),l(document).on("blur",".wpglobus-snippet_title",function(e){var t=l(this),a=WPGlobusCore.getString(l("#yoast_wpseo_title").val(),t.text(),t.data("language"));YoastSEO.app.rawData.pageTitle=a,l('input[name="yoast_wpseo_title"]').val(a),l("#snippet_title").text(a)}),l(document).on("blur",".wpglobus-snippet_meta",function(e){var t=l(this),a=WPGlobusCore.getString(l("#yoast_wpseo_metadesc").val(),t.text(),t.data("language"));l("#yoast_wpseo_metadesc").val(a),l("#snippet_meta").text(a)}),l(document).on("keyup",".wpglobus-yoast_wpseo_focuskw_text_input",function(e){var t=l(this),a=t.val();r.focuskw.val(a),r.focuskw_hidden.val(a),r.updateWpseoKeyword(a,t.data("language")),s.prototype.analyze()}),l("#publish,#save-post").on("mouseenter",function(e){var a,s="";l(".wpglobus-yoast_wpseo_focuskw_text_input").each(function(e,t){a=l(this),s=WPGlobusCore.getString(s,a.val(),a.data("language"))}),r.focuskw.val(s),r.focuskw_hidden.val(s)}).on("mouseleave",function(e){r.focuskwKeep||(r.wpseoTab=l(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language"),l(this),r.focuskw.val(l("#yoast_wpseo_focuskw_text_input_"+r.wpseoTab).val()),r.focuskw_hidden.val(l("#yoast_wpseo_focuskw_text_input_"+r.wpseoTab).val()))}).on("click",function(e){r.focuskwKeep=!0}),l(WPGlobusYoastSeo.wpseoTabSelector).on("tabsactivate",function(e,t){var a;r.language=t.newPanel.attr("data-language"),t.newPanel.attr("data-language")===WPGlobusCoreData.default_language&&(a=l("#yoast_wpseo_focuskw_text_input_"+WPGlobusCoreData.default_language).val(),YoastSEO.app.rawData.keyword=a,r.focuskw.val(a),r.focuskw_hidden.val(a)),s.prototype.analyze()}),r=this}).prototype.analyze=function(){var e=l(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language");e!=WPGlobusCoreData.default_language&&0!=l("#editable-post-name-full-"+e).length?YoastSEO.app.snippetPreview.data.urlPath=l("#editable-post-name-full-"+e).text():YoastSEO.app.snippetPreview.data.urlPath=l("#editable-post-name-full").text(),YoastSEO.app.analyzeTimer(YoastSEO.app),s.prototype.setScoreIcon()},s.prototype.setScoreIcon=function(){var a=setInterval(function(){var e=l(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language"),t=l("#wpseo-metabox-tabs .wpseo-score-icon").attr("class");"bad"!=(t=t.replace("wpseo-score-icon ",""))&&"ok"!=t&&"good"!=t||(l("#wpseo-metabox-tabs_"+e+" .wpseo-score-icon").removeClass("bad ok good 100"),l("#wpseo-metabox-tabs_"+e+" .wpseo-score-icon").addClass(t),clearInterval(a))},700)},s.prototype.getWPseoTab=function(){return l(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language")},s.prototype.citeModification=function(e){var t="#snippet_citeBase_"+e,a="#snippet_cite_"+e,s=l("#wpseo-tab-"+e).data("yoast-cite-base");!1===l("#wpseo-tab-"+e).data("cite-contenteditable")&&l(a).attr("contenteditable","false"),l(t).text(s)},s.prototype.pageTitleModification=function(e){var a,s="#snippet_title_",o="",i="";if(r.title_template==e)l.each(WPGlobusCoreData.enabled_languages,function(e,t){n=l("#snippet-editor-title_"+t).val(),p=0==n.length?r.title_template:n,o=r.replaceVariablesPlugin(p),l(s+t).text(o),t==r.getWPseoTab()&&(i=o)});else{if(a=WPGlobusCore.getTranslations(e),r.getWPseoTab()!==WPGlobusCoreData.default_language&&a[WPGlobusCoreData.default_language]==e){var n,t=r.getWPseoTab(),p=0<(n=l("#snippet-editor-title_"+t).val()).length?n:r.title_template;return p=r.replaceVariablesPlugin(p),l(s+t).text(p),p}l.each(WPGlobusCoreData.enabled_languages,function(e,t){o=""===a[t]?r.replaceVariablesPlugin(r.title_template):r.replaceVariablesPlugin(a[t]),t==r.getWPseoTab()&&(i=o,0!=(n=l("#snippet-editor-title_"+t).val()).length?n!=i&&(i=r.replaceVariablesPlugin(n)):i=r.replaceVariablesPlugin(r.title_template)),l(s+t).html(i)})}return i},s.prototype.metaDescModification=function(a){var s="#snippet_meta_",e=WPGlobusCore.getTranslations(a),t="",o=l("#snippet-editor-meta-description_"+r.getWPseoTab()).val();if(r.getWPseoTab()===WPGlobusCoreData.default_language||e[WPGlobusCoreData.default_language]!=a)return l.each(WPGlobusCoreData.enabled_languages,function(e,t){l(s+t).text(WPGlobusCore.TextFilter(a,t,"RETURN_EMPTY")),r.citeModification(t)}),o==e[r.getWPseoTab()]?0==(t=e[r.getWPseoTab()]).length&&l(s+r.getWPseoTab()).text(WPGlobusCore.TextFilter(YoastSEO.app.snippetPreview.data.metaDesc,WPGlobusCoreData.default_language,"RETURN_EMPTY")):0==(t=o).length?l(s+r.getWPseoTab()).text(WPGlobusCore.TextFilter(YoastSEO.app.snippetPreview.data.metaDesc,WPGlobusCoreData.default_language,"RETURN_EMPTY")):l(s+r.getWPseoTab()).text(t),l(s+r.getWPseoTab()).text(t),t;var i=r.getWPseoTab();return r.citeModification(i),0==o.length?l(s+i).text(""):o!=a&&l(s+i).text(o),a},s.prototype.snippetModification=function(e){return WPGlobusCore.TextFilter(e,r.getWPseoTab(),"RETURN_EMPTY")},s.prototype.contentModification=function(e){return r.getWPseoTab()==WPGlobusCoreData.default_language?e:l("#content_"+r.getWPseoTab()).val()},s.prototype.titleModification=function(e){return setTimeout(r.updatePageAnalysis,1e3),r.getWPseoTab()==WPGlobusCoreData.default_language?e:l("#title_"+r.getWPseoTab()).val()},s.prototype.defaultReplace=function(e){var t=YoastSEO.app.rawData.keyword;return e.replace(/%%sitedesc%%/g,this.replaceVars.sitedesc).replace(/%%sitename%%/g,WPGlobusCore.TextFilter(this.replaceVars.sitename,r.getWPseoTab())).replace(/%%term_title%%/g,this.replaceVars.term_title).replace(/%%term_description%%/g,this.replaceVars.term_description).replace(/%%category_description%%/g,this.replaceVars.category_description).replace(/%%tag_description%%/g,this.replaceVars.tag_description).replace(/%%searchphrase%%/g,this.replaceVars.searchphrase).replace(/%%date%%/g,this.replaceVars.date).replace(/%%id%%/g,this.replaceVars.id).replace(/%%page%%/g,this.replaceVars.page).replace(/%%currenttime%%/g,this.replaceVars.currenttime).replace(/%%currentdate%%/g,this.replaceVars.currentdate).replace(/%%currentday%%/g,this.replaceVars.currentday).replace(/%%currentmonth%%/g,this.replaceVars.currentmonth).replace(/%%currentyear%%/g,this.replaceVars.currentyear).replace(/%%focuskw%%/g,t)},s.prototype.replaceVariablesPlugin=function(e){return void 0!==e&&(e=this.titleReplace(e),e=this.defaultReplace(e),e=this.replaceSeparators(e)),e},s.prototype.replaceSeparators=function(e){return e.replace(/%%sep%%(\s+%%sep%%)*/g,this.replaceVars.sep)},s.prototype.titleReplace=function(e){var t="";return void 0===(t=this.language==WPGlobusCoreData.default_language?l("#title").val():l("#title_"+this.language).val())&&(t=YoastSEO.app.rawData.pageTitle),this.language!=WPGlobusCoreData.default_language&&0==t.length&&(t=l("#title").val()),e=e.replace(/%%title%%/g,t)},s.prototype.doubleSepReplace=function(e){var t=YoastSEO.app.stringHelper.addEscapeChars(this.replaceVars.sep),a=new RegExp(t+" "+t,"g");return e=e.replace(a,this.replaceVars.sep)},s.prototype.updateWpseoKeyword=function(e,t){1==l("#wpseo-meta-section-content_"+t+" .wpseo_keyword").length&&l("#wpseo-meta-section-content_"+t+" .wpseo_keyword").removeClass("wpseo_keyword").addClass("wpglobus-wpseo_keyword_"+t),l(".wpglobus-wpseo_keyword_"+t).text(e)},s.prototype.updatePageAnalysis=function(){l("#wpseo-pageanalysis_"+r.getWPseoTab()).html(l("#wpseo-pageanalysis").html())}),window.WPGlobusYoastSeoPlugin=new s)});
|
1 |
+
var WPGlobusYoastSeo;jQuery(document).ready(function(l){"use strict";var r,d,s;"undefined"!=typeof wpseoReplaceVarsL10n&&"undefined"!=typeof WPGlobusCoreData&&"undefined"!=typeof WPGlobusVendor&&("edit-tags.php"==WPGlobusVendor.pagenow||"term.php"==WPGlobusVendor.pagenow?(d=WPGlobusYoastSeo={editorIDs:["description"],editor:{},submitId:"#submit",preventChangeEditor:!1,observer:null,init:function(){d.attachListeners(),_.delay(d.start,1500)},submit:function(e){"mouseenter"===e.type?l.each(d.editor,function(e,t){!d.editor[e].contentEditor||d.editor[e].contentEditor.isHidden()?l("#"+e).val(d.editor[e].content):tinymce.get(e).setContent(d.editor[e].content)}):"mouseleave"===e.type?d.preventChangeEditor||(l.each(d.editor,function(e,t){!d.editor[e].contentEditor||d.editor[e].contentEditor.isHidden()?l("#"+e).val(WPGlobusCore.TextFilter(t.content,d.getCurrentTab(),"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,d.getCurrentTab(),"RETURN_EMPTY"))}),d.preventChangeEditor=!1):"click"===e.type&&(d.preventChangeEditor=!0,"tinymce"!=getUserSetting("editor")&&setUserSetting("editor","tinymce"))},attachListeners:function(){l(".wrap").on("tabsactivate",function(e,a){l.each(d.editor,function(e,t){!d.editor[e].contentEditor||d.editor[e].contentEditor.isHidden()?l("#"+e).val(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY"))})}),l(document).on("mouseenter",d.submitId,d.submit).on("mouseleave",d.submitId,d.submit).on("click",d.submitId,d.submit),l(document).on("tinymce-editor-init",function(e,t){var a;-1!=_.indexOf(d.editorIDs,t.id)&&(a=l("#"+t.id),d.editor[t.id]={},d.editor[t.id].contentEditor=t,d.editor[t.id].content=a.val(),t.setContent(WPGlobusCore.TextFilter(d.editor[t.id].content,WPGlobusCoreData.default_language,"RETURN_EMPTY")),l("#"+t.getContainer().id).find("iframe").addClass("wpglobus-translatable"),a.removeClass("hidden"),t.on("nodechange keyup",_.debounce(d.update,500)),a.on("input keyup",_.debounce(d.update,500)))})},update:function(e){var t;void 0!==e.target&&("tinymce"==(t=e.target.id)&&(t=e.target.dataset.id),void 0!==d.editor[t].contentEditor&&(e=!d.editor[t].contentEditor||d.editor[t].contentEditor.isHidden()?l("#"+t).val():d.editor[t].contentEditor.getContent({format:"raw"}),d.editor[t].content=WPGlobusCore.getString(d.editor[t].content,e,d.getCurrentTab())))},getCurrentTab:function(){return l(".wpglobus-taxonomy-tabs-list .ui-tabs-active").data("language")},start:function(){l(".wpglobus-element_description").css({display:"none"})}},WPGlobusYoastSeo.init(),s=function(){l(".wrap").on("tabsactivate",function(e,t){t.newTab[0].dataset.language==WPGlobusCoreData.default_language?l("#poststuff .inside").css({display:"block"}):l("#poststuff .inside").css({display:"none"})}),l.each(["category_description","sitedesc","sitename","tag_description","term_description","term_title"],function(e,t){wpseoReplaceVarsL10n.replace_vars[t]=WPGlobusCore.TextFilter(wpseoReplaceVarsL10n.replace_vars[t],WPGlobusCoreData.default_language)}),WPGlobusYoastSeo.observer=new MutationObserver(function(e){e.forEach(function(e){"placeholder"==e.attributeName&&(WPGlobusYoastSeo.observer.disconnect(),""==(e=l("#wpseo_focuskw")).val()&&e.attr("placeholder",WPGlobusCore.TextFilter(e.attr("placeholder"),WPGlobusCoreData.default_language)),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0}))})}),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0})}):(d=WPGlobusYoastSeo={wpseoTabSelector:"#wpglobus-wpseo-tabs",url:"",attrs:l("#wpglobus-wpseo-attr"),iB:l("#wpseo-meta-section-content"),t:l("#wpseo-meta-section-content"),ids:"",names:"",editSnippetButtonClass:"wpglobus-snippet-editor__edit-button",editSnippetFormClass:"wpglobus-snippet-editor__form",editSnippetSubmitClass:"wpglobus-snippet-editor__submit",editSnippetHeadingClass:"wpglobus-snippet-editor__heading-editor",yoastTitleProgress:"wpglobus-yoast-title-progress",yoastMetadescProgress:"wpglobus-yoast-metadesc-progress",init:function(){d.start()},initAddKeywordPopup:function(){1===l("#wpseo-add-keyword-popup").length&&l(".wpseo-add-keyword").on("click",d.addKeywordPopup)},addKeywordPopup:function(){var e=l("#wpseo-add-keyword-popup-button").text();tb_show(e,"#TB_inline?width=650&height=350&inlineId=wpseo-add-keyword-popup","group"),jQuery("#TB_window").css("height",235),jQuery("#TB_window").css("width",680)},qtip:function(){l(".yoast_help").qtip({content:{attr:"alt"},position:{my:"bottom left",at:"top center"},style:{tip:{corner:!0},classes:"yoast-qtip qtip-rounded qtip-blue"},show:"click",hide:{fixed:!0,delay:500}})},removeClasses:function(t,e){_.each(e,function(e){t.removeClass(e)})},updateProgressBar:function(e,t){var a,s,o,i,n,p;void 0!==e&&(void 0===t&&void 0===(t="undefined"!==e.data("language")?e.data("language"):t)||(o="",i=p=0,n=!(a=["snippet-editor__progress--bad","snippet-editor__progress--ok","snippet-editor__progress--good"]),p=e.val().length,e.hasClass("wpglobus-snippet-editor-title")?(i=(s=l("progress."+d.yoastTitleProgress+"_"+t)).attr("max"),o=a[2],0==p?o=a[1]:i<p?(o=a[1],n=!0):0<p&&p<35&&(o=a[1])):e.hasClass("wpglobus-snippet-editor-meta-description")&&(i=(s=l("progress."+d.yoastMetadescProgress+"_"+t)).attr("max"),o=a[2],0==p?o=a[1]:i<p?(o=a[1],n=!0):0<p&&p<121&&(o=a[1])),d.removeClasses(s,a),s.attr("value",p).addClass(o),n?e.css("color","#f00"):e.css("color","#000")))},updateWpseoKeyword:function(e,t){l("#wpseo-meta-section-content_"+t+" .wpseo_keyword").text(e)},start:function(){l(d.wpseoTabSelector).tabs(),d.ids=d.attrs.data("ids"),d.names=d.attrs.data("names"),d.ids=d.ids+","+d.attrs.data("qtip"),d.ids=d.ids.split(","),d.names=d.names.split(","),l("#wpglobus-wpseo-tabs").insertBefore(d.iB),l(".wpseo-metabox-tabs").css({height:"26px"}),l(".wpglobus-wpseo-general").each(function(e,t){var a=l(t),s=a.data("language"),t="wpseo-meta-section-content_"+s;a.html('<div id="'+t+'" class="wpseo-meta-section wpglobus-wpseo-meta-section" style="width:100%" data-language="'+s+'">'+d.t.html()+"</div>"),l("#"+t+" .wpseo-metabox-tabs").attr("id","wpseo-metabox-tabs_"+s),l("#"+t+" .wpseotab").attr("id","wpseo_content_"+s),l("#wpseo_content_"+s).css({float:"left"}),l("#"+t).css({display:"block"}),l("#wpseo_meta").css({overflow:"hidden"}),l("#"+t+" .snippet_container").addClass("wpglobus-snippet_container"),s!==WPGlobusCoreData.default_language&&l("#"+t+" .wpseo-add-keyword").addClass("hidden"),l.each(d.names,function(e,t){l("#"+t).attr("name",t+"_"+s)}),l.each(d.ids,function(e,t){var a=l("#"+t);"wpseosnippet"==t&&a.addClass("wpglobus-wpseosnippet"),"snippet_title"==t&&a.addClass("wpglobus-snippet_title"),"snippet_meta"==t&&a.addClass("wpglobus-snippet_meta"),"snippet_cite"==t&&a.addClass("wpglobus-snippet_cite"),"snippet_citeBase"==t&&a.addClass("wpglobus-snippet_citeBase"),"yoast_wpseo_focuskw_text_input"==t&&a.addClass("wpglobus-yoast_wpseo_focuskw_text_input"),"wpseo-pageanalysis"==t&&a.addClass("wpglobus-wpseo-pageanalysis"),"snippet_preview"==t&&a.addClass("wpglobus-snippet_preview"),"snippet-editor-title"==t&&(a.addClass("wpglobus-snippet-editor-title"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),a.val(l("#wpseo-tab-"+s).data("wpseotitle")),a.parent("label").find("progress").addClass(d.yoastTitleProgress).addClass(d.yoastTitleProgress+"_"+s),_.debounce(d.updateProgressBar(a,s),500)),"snippet-editor-slug"==t&&(a.addClass("wpglobus-snippet-editor-slug"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),WPGlobusCoreData.default_language!=s&&a.attr("disabled","disabled")),"snippet-editor-meta-description"==t&&(a.addClass("wpglobus-snippet-editor-meta-description"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),a.val(l("#wpseo-tab-"+s).data("metadesc")),a.parent("label").find("progress").addClass(d.yoastMetadescProgress).addClass(d.yoastMetadescProgress+"_"+s),_.debounce(d.updateProgressBar(a,s),500)),"snippetpreview-help-toggle"==t&&(a.addClass("wpglobus-snippetpreview-help-toggle_"+s),l(document).on("click",".wpglobus-snippetpreview-help-toggle_"+s,function(e){var t=l(this);"none"===l("#snippetpreview-help_"+t.data("language")).css("display")?l("#snippetpreview-help_"+t.data("language")).css({display:"block"}):l("#snippetpreview-help_"+t.data("language")).css({display:"none"})})),"focuskw_text_input-help-toggle"==t&&(a.addClass("wpglobus-focuskw_text_input-help-toggle_"+s),l(document).on("click",".wpglobus-focuskw_text_input-help-toggle_"+s,function(e){var t=l(this);"none"===l("#focuskw_text_input-help_"+t.data("language")).css("display")?l("#focuskw_text_input-help_"+t.data("language")).css({display:"block"}):l("#focuskw_text_input-help_"+t.data("language")).css({display:"none"})})),"pageanalysis-help-toggle"==t&&(a.addClass("wpglobus-pageanalysis-help-toggle_"+s),l(document).on("click",".wpglobus-pageanalysis-help-toggle_"+s,function(e){var t=l(this);"none"===l("#pageanalysis-help_"+t.data("language")).css("display")?l("#pageanalysis-help_"+t.data("language")).css({display:"block"}):l("#pageanalysis-help_"+t.data("language")).css({display:"none"})})),a.attr("id",t+"_"+s),l("#"+t+"_"+s).attr("data-language",s)});a=WPGlobusCore.TextFilter(l("#yoast_wpseo_focuskw_text_input").val(),s,"RETURN_EMPTY");l("#yoast_wpseo_focuskw_text_input_"+s).val(a),l("#yoast_wpseo_focuskw_"+s).val(a),d.updateWpseoKeyword(a,s),s!==WPGlobusCoreData.default_language&&(l("#"+t+" #yoast_wpseo_focuskw_text_input_"+s).addClass("hidden").after('<div class="wpglobus-suggest" style="font-weight:bold;">'+WPGlobusVendor.i18n.yoastseo_plus_access+"</div>"),l("#"+t+" #wpseo-pageanalysis_"+s).addClass("hidden"))}),l(".wpglobus-wpseosnippet").each(function(e,t){var a=l(t),t=a.data("language");a.find("button.snippet-editor__button.snippet-editor__edit-button").addClass(d.editSnippetButtonClass).addClass(d.editSnippetButtonClass+"_"+t).attr("data-language",t),a.find(".snippet-editor__form").addClass(d.editSnippetFormClass).addClass(d.editSnippetFormClass+"_"+t),a.find(".snippet-editor__heading-editor").addClass(d.editSnippetHeadingClass).addClass(d.editSnippetHeadingClass+"_"+t),a.find(".snippet-editor__submit").addClass(d.editSnippetSubmitClass).addClass(d.editSnippetSubmitClass+"_"+t).attr("data-language",t)}),d.iB.addClass("hidden"),d.iB.css({height:0,overflow:"hidden"});var e=WPGlobusCore.TextFilter(l("#yoast_wpseo_focuskw_text_input").val(),WPGlobusCoreData.default_language,"RETURN_EMPTY");l("#yoast_wpseo_focuskw_text_input").val(e),l("#yoast_wpseo_focuskw").val(e),l(".wpseo-metabox-sidebar .wpseo-meta-section-link").on("click",function(e){"#wpseo-meta-section-content"==l(this).attr("href")?l("#wpglobus-wpseo-tabs").css({display:"block"}):l("#wpglobus-wpseo-tabs").css({display:"none"})}),l("body").on("click","."+d.editSnippetButtonClass,function(e){var t=l(this),a=t.data("language"),s=l("."+d.editSnippetFormClass+"_"+a),o=l("."+d.editSnippetSubmitClass+"_"+a),a=l("."+d.editSnippetHeadingClass+"_"+a);s.hasClass("snippet-editor--hidden")?(s.removeClass("snippet-editor--hidden"),a.removeClass("snippet-editor--hidden"),o.removeClass("snippet-editor--hidden")):(s.addClass("snippet-editor--hidden"),a.addClass("snippet-editor--hidden")),t.addClass("snippet-editor--hidden")}),l("body").on("click","."+d.editSnippetSubmitClass,function(e){var t=l(this).data("language"),a=l("."+d.editSnippetButtonClass+"_"+t),s=l("."+d.editSnippetFormClass+"_"+t),o=l("."+d.editSnippetSubmitClass+"_"+t),t=l("."+d.editSnippetHeadingClass+"_"+t);a.removeClass("snippet-editor--hidden"),s.addClass("snippet-editor--hidden"),o.addClass("snippet-editor--hidden"),t.addClass("snippet-editor--hidden")}),l(document).on("keyup","input.wpglobus-snippet-editor-title",function(e){var t=l(this),a=t.data("language"),s=WPGlobusCore.getString(l('input[name="yoast_wpseo_title"]').val(),t.val(),a);l("#snippet_title_"+a).html(r.replaceVariablesPlugin(t.val())),YoastSEO.app.rawData.pageTitle=s,l('input[name="yoast_wpseo_title"]').val(s),l("#snippet_title").text(s),_.debounce(d.updateProgressBar(t,a),500)}),l(document).on("keyup","input.wpglobus-snippet-editor-slug",function(e){var t=l(this),a=t.data("language");l("#snippet_cite_"+a).text(t.val()+"/"),l("#editable-post-name").text(t.val()),l("#editable-post-name-full").text(t.val())}),l(document).on("change","input.wpglobus-snippet-editor-slug",function(e){var t=l(this);l.post(ajaxurl,{action:"sample-permalink",post_id:l("#post_ID").val()||0,new_slug:t.val(),new_title:l("#title").val(),samplepermalinknonce:l("#samplepermalinknonce").val()})}),l(document).on("keyup","textarea.wpglobus-snippet-editor-meta-description",function(e){var t=l(this),a=t.data("language");l("#snippet_meta_"+a).text(t.val());var s=WPGlobusCore.getString(l("#yoast_wpseo_metadesc").val(),t.val(),t.data("language"));l("#yoast_wpseo_metadesc").val(s),l("#snippet_meta").text(s),_.debounce(d.updateProgressBar(t,a),500)}),l("body").on("click",".wpglobus-post-body-tabs-list li",function(e){var t=l(this);t.hasClass("wpglobus-post-tab")&&(l("#wpglobus-wpseo-tabs").tabs("option","active",t.data("order")),t=l("#yoast_wpseo_focuskw_text_input_"+l(this).data("language")).val(),YoastSEO.app.rawData.keyword=t,l("#yoast_wpseo_focuskw_text_input").val(t),l('input[name="yoast_wpseo_focuskw"]').val(t),s.prototype.analyze())}),d.initAddKeywordPopup()}},(s=function(){this.replaceVars=wpseoReplaceVarsL10n.replace_vars,this.language=WPGlobusCoreData.default_language,this.tab=WPGlobusCoreData.default_language,this.wpseoTab=WPGlobusCoreData.default_language,this.title_template=wpseoPostScraperL10n.title_template,this.focuskw=l("#yoast_wpseo_focuskw_text_input"),this.focuskw_hidden=l('input[name="yoast_wpseo_focuskw"]'),this.focuskwKeep=!1,this.post_slug="#editable-post-name-full",YoastSEO.app.registerPlugin("wpglobusYoastSeoPlugin",{status:"ready"}),YoastSEO.app.registerModification("content",this.contentModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("title",this.titleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_title",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_meta",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_page_title",this.pageTitleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_meta_desc",this.metaDescModification,"wpglobusYoastSeoPlugin",0),s.prototype.setScoreIcon(),l(document).on("blur",".wpglobus-snippet_title",function(e){var t=l(this),t=WPGlobusCore.getString(l("#yoast_wpseo_title").val(),t.text(),t.data("language"));YoastSEO.app.rawData.pageTitle=t,l('input[name="yoast_wpseo_title"]').val(t),l("#snippet_title").text(t)}),l(document).on("blur",".wpglobus-snippet_meta",function(e){var t=l(this),t=WPGlobusCore.getString(l("#yoast_wpseo_metadesc").val(),t.text(),t.data("language"));l("#yoast_wpseo_metadesc").val(t),l("#snippet_meta").text(t)}),l(document).on("keyup",".wpglobus-yoast_wpseo_focuskw_text_input",function(e){var t=l(this),a=t.val();r.focuskw.val(a),r.focuskw_hidden.val(a),r.updateWpseoKeyword(a,t.data("language")),s.prototype.analyze()}),l("#publish,#save-post").on("mouseenter",function(e){var a,s="";l(".wpglobus-yoast_wpseo_focuskw_text_input").each(function(e,t){a=l(this),s=WPGlobusCore.getString(s,a.val(),a.data("language"))}),r.focuskw.val(s),r.focuskw_hidden.val(s)}).on("mouseleave",function(e){r.focuskwKeep||(r.wpseoTab=l(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language"),l(this),r.focuskw.val(l("#yoast_wpseo_focuskw_text_input_"+r.wpseoTab).val()),r.focuskw_hidden.val(l("#yoast_wpseo_focuskw_text_input_"+r.wpseoTab).val()))}).on("click",function(e){r.focuskwKeep=!0}),l(WPGlobusYoastSeo.wpseoTabSelector).on("tabsactivate",function(e,t){r.language=t.newPanel.attr("data-language"),t.newPanel.attr("data-language")===WPGlobusCoreData.default_language&&(t=l("#yoast_wpseo_focuskw_text_input_"+WPGlobusCoreData.default_language).val(),YoastSEO.app.rawData.keyword=t,r.focuskw.val(t),r.focuskw_hidden.val(t)),s.prototype.analyze()}),r=this}).prototype.analyze=function(){var e=l(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language");e!=WPGlobusCoreData.default_language&&0!=l("#editable-post-name-full-"+e).length?YoastSEO.app.snippetPreview.data.urlPath=l("#editable-post-name-full-"+e).text():YoastSEO.app.snippetPreview.data.urlPath=l("#editable-post-name-full").text(),YoastSEO.app.analyzeTimer(YoastSEO.app),s.prototype.setScoreIcon()},s.prototype.setScoreIcon=function(){var a=setInterval(function(){var e=l(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language"),t=l("#wpseo-metabox-tabs .wpseo-score-icon").attr("class");"bad"!=(t=t.replace("wpseo-score-icon ",""))&&"ok"!=t&&"good"!=t||(l("#wpseo-metabox-tabs_"+e+" .wpseo-score-icon").removeClass("bad ok good 100"),l("#wpseo-metabox-tabs_"+e+" .wpseo-score-icon").addClass(t),clearInterval(a))},700)},s.prototype.getWPseoTab=function(){return l(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language")},s.prototype.citeModification=function(e){var t="#snippet_citeBase_"+e,a="#snippet_cite_"+e,s=l("#wpseo-tab-"+e).data("yoast-cite-base");!1===l("#wpseo-tab-"+e).data("cite-contenteditable")&&l(a).attr("contenteditable","false"),l(t).text(s)},s.prototype.pageTitleModification=function(e){var a,s="#snippet_title_",o="",i="";if(r.title_template==e)l.each(WPGlobusCoreData.enabled_languages,function(e,t){n=l("#snippet-editor-title_"+t).val(),p=0==n.length?r.title_template:n,o=r.replaceVariablesPlugin(p),l(s+t).text(o),t==r.getWPseoTab()&&(i=o)});else{if(a=WPGlobusCore.getTranslations(e),r.getWPseoTab()!==WPGlobusCoreData.default_language&&a[WPGlobusCoreData.default_language]==e){var n,e=r.getWPseoTab(),p=0<(n=l("#snippet-editor-title_"+e).val()).length?n:r.title_template;return p=r.replaceVariablesPlugin(p),l(s+e).text(p),p}l.each(WPGlobusCoreData.enabled_languages,function(e,t){o=""===a[t]?r.replaceVariablesPlugin(r.title_template):r.replaceVariablesPlugin(a[t]),t==r.getWPseoTab()&&(i=o,0!=(n=l("#snippet-editor-title_"+t).val()).length?n!=i&&(i=r.replaceVariablesPlugin(n)):i=r.replaceVariablesPlugin(r.title_template)),l(s+t).html(i)})}return i},s.prototype.metaDescModification=function(a){var s="#snippet_meta_",e=WPGlobusCore.getTranslations(a),t="",o=l("#snippet-editor-meta-description_"+r.getWPseoTab()).val();if(r.getWPseoTab()===WPGlobusCoreData.default_language||e[WPGlobusCoreData.default_language]!=a)return l.each(WPGlobusCoreData.enabled_languages,function(e,t){l(s+t).text(WPGlobusCore.TextFilter(a,t,"RETURN_EMPTY")),r.citeModification(t)}),o==e[r.getWPseoTab()]?0==(t=e[r.getWPseoTab()]).length&&l(s+r.getWPseoTab()).text(WPGlobusCore.TextFilter(YoastSEO.app.snippetPreview.data.metaDesc,WPGlobusCoreData.default_language,"RETURN_EMPTY")):0==(t=o).length?l(s+r.getWPseoTab()).text(WPGlobusCore.TextFilter(YoastSEO.app.snippetPreview.data.metaDesc,WPGlobusCoreData.default_language,"RETURN_EMPTY")):l(s+r.getWPseoTab()).text(t),l(s+r.getWPseoTab()).text(t),t;t=r.getWPseoTab();return r.citeModification(t),0==o.length?l(s+t).text(""):o!=a&&l(s+t).text(o),a},s.prototype.snippetModification=function(e){return WPGlobusCore.TextFilter(e,r.getWPseoTab(),"RETURN_EMPTY")},s.prototype.contentModification=function(e){return r.getWPseoTab()==WPGlobusCoreData.default_language?e:l("#content_"+r.getWPseoTab()).val()},s.prototype.titleModification=function(e){return setTimeout(r.updatePageAnalysis,1e3),r.getWPseoTab()==WPGlobusCoreData.default_language?e:l("#title_"+r.getWPseoTab()).val()},s.prototype.defaultReplace=function(e){var t=YoastSEO.app.rawData.keyword;return e.replace(/%%sitedesc%%/g,this.replaceVars.sitedesc).replace(/%%sitename%%/g,WPGlobusCore.TextFilter(this.replaceVars.sitename,r.getWPseoTab())).replace(/%%term_title%%/g,this.replaceVars.term_title).replace(/%%term_description%%/g,this.replaceVars.term_description).replace(/%%category_description%%/g,this.replaceVars.category_description).replace(/%%tag_description%%/g,this.replaceVars.tag_description).replace(/%%searchphrase%%/g,this.replaceVars.searchphrase).replace(/%%date%%/g,this.replaceVars.date).replace(/%%id%%/g,this.replaceVars.id).replace(/%%page%%/g,this.replaceVars.page).replace(/%%currenttime%%/g,this.replaceVars.currenttime).replace(/%%currentdate%%/g,this.replaceVars.currentdate).replace(/%%currentday%%/g,this.replaceVars.currentday).replace(/%%currentmonth%%/g,this.replaceVars.currentmonth).replace(/%%currentyear%%/g,this.replaceVars.currentyear).replace(/%%focuskw%%/g,t)},s.prototype.replaceVariablesPlugin=function(e){return void 0!==e&&(e=this.titleReplace(e),e=this.defaultReplace(e),e=this.replaceSeparators(e)),e},s.prototype.replaceSeparators=function(e){return e.replace(/%%sep%%(\s+%%sep%%)*/g,this.replaceVars.sep)},s.prototype.titleReplace=function(e){var t="";return void 0===(t=(this.language==WPGlobusCoreData.default_language?l("#title"):l("#title_"+this.language)).val())&&(t=YoastSEO.app.rawData.pageTitle),this.language!=WPGlobusCoreData.default_language&&0==t.length&&(t=l("#title").val()),e=e.replace(/%%title%%/g,t)},s.prototype.doubleSepReplace=function(e){var t=YoastSEO.app.stringHelper.addEscapeChars(this.replaceVars.sep),t=new RegExp(t+" "+t,"g");return e=e.replace(t,this.replaceVars.sep)},s.prototype.updateWpseoKeyword=function(e,t){1==l("#wpseo-meta-section-content_"+t+" .wpseo_keyword").length&&l("#wpseo-meta-section-content_"+t+" .wpseo_keyword").removeClass("wpseo_keyword").addClass("wpglobus-wpseo_keyword_"+t),l(".wpglobus-wpseo_keyword_"+t).text(e)},s.prototype.updatePageAnalysis=function(){l("#wpseo-pageanalysis_"+r.getWPseoTab()).html(l("#wpseo-pageanalysis").html())}),window.WPGlobusYoastSeoPlugin=new s)});
|
includes/js/wpglobus-yoastseo-33.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var WPGlobusYoastSeo;jQuery(document).ready(function(p){"use strict";var r,d,s;"undefined"!=typeof wpseoReplaceVarsL10n&&"undefined"!=typeof WPGlobusCoreData&&"undefined"!=typeof WPGlobusVendor&&("edit-tags.php"==WPGlobusVendor.pagenow||"term.php"==WPGlobusVendor.pagenow?(d=WPGlobusYoastSeo={editorIDs:["description"],editor:{},submitId:"#submit",preventChangeEditor:!1,observer:null,init:function(){d.attachListeners(),_.delay(d.start,1500)},submit:function(e){"mouseenter"===e.type?p.each(d.editor,function(e,t){!d.editor[e].contentEditor||d.editor[e].contentEditor.isHidden()?p("#"+e).val(d.editor[e].content):tinymce.get(e).setContent(d.editor[e].content)}):"mouseleave"===e.type?d.preventChangeEditor||(p.each(d.editor,function(e,t){!d.editor[e].contentEditor||d.editor[e].contentEditor.isHidden()?p("#"+e).val(WPGlobusCore.TextFilter(t.content,d.getCurrentTab(),"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,d.getCurrentTab(),"RETURN_EMPTY"))}),d.preventChangeEditor=!1):"click"===e.type&&(d.preventChangeEditor=!0,"tinymce"!=getUserSetting("editor")&&setUserSetting("editor","tinymce"))},attachListeners:function(){p(".wrap").on("tabsactivate",function(e,a){p.each(d.editor,function(e,t){!d.editor[e].contentEditor||d.editor[e].contentEditor.isHidden()?p("#"+e).val(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY"))})}),p(document).on("mouseenter",d.submitId,d.submit).on("mouseleave",d.submitId,d.submit).on("click",d.submitId,d.submit),p(document).on("tinymce-editor-init",function(e,t){var a;-1!=_.indexOf(d.editorIDs,t.id)&&(a=p("#"+t.id),d.editor[t.id]={},d.editor[t.id].contentEditor=t,d.editor[t.id].content=a.val(),t.setContent(WPGlobusCore.TextFilter(d.editor[t.id].content,WPGlobusCoreData.default_language,"RETURN_EMPTY")),p("#"+t.getContainer().id).find("iframe").addClass("wpglobus-translatable"),a.removeClass("hidden"),t.on("nodechange keyup",_.debounce(d.update,500)),a.on("input keyup",_.debounce(d.update,500)))})},update:function(e){var t,a;void 0!==e.target&&("tinymce"==(t=e.target.id)&&(t=e.target.dataset.id),void 0!==d.editor[t].contentEditor&&(a=!d.editor[t].contentEditor||d.editor[t].contentEditor.isHidden()?p("#"+t).val():d.editor[t].contentEditor.getContent({format:"raw"}),d.editor[t].content=WPGlobusCore.getString(d.editor[t].content,a,d.getCurrentTab())))},getCurrentTab:function(){return p(".wpglobus-taxonomy-tabs-list .ui-tabs-active").data("language")},start:function(){p(".wpglobus-element_description").css({display:"none"})}},WPGlobusYoastSeo.init(),s=function(){p(".wrap").on("tabsactivate",function(e,t){t.newTab[0].dataset.language==WPGlobusCoreData.default_language?p("#poststuff .inside").css({display:"block"}):p("#poststuff .inside").css({display:"none"})}),p.each(["category_description","sitedesc","sitename","tag_description","term_description","term_title"],function(e,t){wpseoReplaceVarsL10n.replace_vars[t]=WPGlobusCore.TextFilter(wpseoReplaceVarsL10n.replace_vars[t],WPGlobusCoreData.default_language)}),WPGlobusYoastSeo.observer=new MutationObserver(function(e){e.forEach(function(e){var t;"placeholder"==e.attributeName&&(WPGlobusYoastSeo.observer.disconnect(),""==(t=p("#wpseo_focuskw")).val()&&t.attr("placeholder",WPGlobusCore.TextFilter(t.attr("placeholder"),WPGlobusCoreData.default_language)),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0}))})}),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0})}):(d=WPGlobusYoastSeo={wpseoTabSelector:"#wpglobus-wpseo-tabs",url:"",attrs:p("#wpglobus-wpseo-attr"),iB:p("#wpseo-meta-section-content"),t:p("#wpseo-meta-section-content"),ids:"",names:"",editSnippetButtonClass:"wpglobus-snippet-editor__edit-button",editSnippetFormClass:"wpglobus-snippet-editor__form",editSnippetSubmitClass:"wpglobus-snippet-editor__submit",editSnippetHeadingClass:"wpglobus-snippet-editor__heading-editor",yoastTitleProgress:"wpglobus-yoast-title-progress",yoastMetadescProgress:"wpglobus-yoast-metadesc-progress",init:function(){d.start()},initAddKeywordPopup:function(){1===p("#wpseo-add-keyword-popup").length&&p(".wpseo-add-keyword").on("click",d.addKeywordPopup)},addKeywordPopup:function(){var e=p("#wpseo-add-keyword-popup-button").text();tb_show(e,"#TB_inline?width=650&height=350&inlineId=wpseo-add-keyword-popup","group"),jQuery("#TB_window").css("height",235),jQuery("#TB_window").css("width",680)},qtip:function(){p(".yoast_help").qtip({content:{attr:"alt"},position:{my:"bottom left",at:"top center"},style:{tip:{corner:!0},classes:"yoast-qtip qtip-rounded qtip-blue"},show:"click",hide:{fixed:!0,delay:500}})},removeClasses:function(t,e){_.each(e,function(e){t.removeClass(e)})},updateProgressBar:function(e,t){var a,s,o,i,n,l;void 0!==e&&(void 0===t&&("undefined"!==e.data("language")&&(t=e.data("language")),void 0===t)||(o="",i=l=0,n=!(a=["snippet-editor__progress--bad","snippet-editor__progress--ok","snippet-editor__progress--good"]),l=e.val().length,e.hasClass("wpglobus-snippet-editor-title")?(i=(s=p("progress."+d.yoastTitleProgress+"_"+t)).attr("max"),o=a[2],0==l?o=a[1]:i<l?(o=a[1],n=!0):0<l&&l<35&&(o=a[1])):e.hasClass("wpglobus-snippet-editor-meta-description")&&(i=(s=p("progress."+d.yoastMetadescProgress+"_"+t)).attr("max"),o=a[2],0==l?o=a[1]:i<l?(o=a[1],n=!0):0<l&&l<121&&(o=a[1])),d.removeClasses(s,a),s.attr("value",l).addClass(o),n?e.css("color","#f00"):e.css("color","#000")))},updateWpseoKeyword:function(e,t){p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").eq(1).text(e)},start:function(){p(d.wpseoTabSelector).tabs(),d.ids=d.attrs.data("ids"),d.names=d.attrs.data("names"),d.ids=d.ids+","+d.attrs.data("qtip"),d.ids=d.ids.split(","),d.names=d.names.split(","),p("#wpglobus-wpseo-tabs").insertBefore(d.iB),p(".wpseo-metabox-tabs").css({height:"26px"}),p(".wpglobus-wpseo-general").each(function(e,t){var a=p(t),s=a.data("language"),o="wpseo-meta-section-content_"+s;a.html('<div id="'+o+'" class="wpseo-meta-section wpglobus-wpseo-meta-section" style="width:100%" data-language="'+s+'">'+d.t.html()+"</div>"),p("#"+o+" .wpseo-metabox-tabs").attr("id","wpseo-metabox-tabs_"+s).attr("data-language",s),p("#"+o+" .wpseotab").attr("id","wpseo_content_"+s),p("#wpseo_content_"+s).css({float:"left"}),p("#"+o).css({display:"block"}),p("#wpseo_meta").css({overflow:"hidden"}),p("#"+o+" .snippet_container").addClass("wpglobus-snippet_container"),s!==WPGlobusCoreData.default_language&&p("#"+o+" .wpseo-add-keyword").addClass("hidden"),p.each(d.names,function(e,t){p("#"+t).attr("name",t+"_"+s)}),p.each(d.ids,function(e,t){var a=p("#"+t);"wpseosnippet"==t&&a.addClass("wpglobus-wpseosnippet"),"snippet_title"==t&&a.addClass("wpglobus-snippet_title"),"snippet_meta"==t&&a.addClass("wpglobus-snippet_meta"),"snippet_cite"==t&&a.addClass("wpglobus-snippet_cite"),"snippet_citeBase"==t&&a.addClass("wpglobus-snippet_citeBase"),"url_container"==t&&a.css({height:"16px"}),"yoast_wpseo_focuskw_text_input"==t&&a.addClass("wpglobus-yoast_wpseo_focuskw_text_input"),"wpseo-pageanalysis"==t&&a.addClass("wpglobus-wpseo-pageanalysis"),"yoast-seo-content-analysis"==t&&a.addClass("wpglobus-yoast-seo-content-analysis"),"snippet_preview"==t&&a.addClass("wpglobus-snippet_preview"),"snippet-editor-title"==t&&(a.addClass("wpglobus-snippet-editor-title"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),a.val(p("#wpseo-tab-"+s).data("wpseotitle")),a.parent("label").next("progress").addClass(d.yoastTitleProgress).addClass(d.yoastTitleProgress+"_"+s),_.debounce(d.updateProgressBar(a,s),500)),"snippet-editor-slug"==t&&(a.addClass("wpglobus-snippet-editor-slug"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),WPGlobusCoreData.default_language!=s&&a.attr("disabled","disabled")),"snippet-editor-meta-description"==t&&(a.addClass("wpglobus-snippet-editor-meta-description"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),a.val(p("#wpseo-tab-"+s).data("metadesc")),a.parent("label").next("progress").addClass(d.yoastMetadescProgress).addClass(d.yoastMetadescProgress+"_"+s),_.debounce(d.updateProgressBar(a,s),500)),"snippetpreview-help-toggle"==t&&(a.addClass("wpglobus-snippetpreview-help-toggle_"+s),p(document).on("click",".wpglobus-snippetpreview-help-toggle_"+s,function(e){var t=p(this);"none"===p("#snippetpreview-help_"+t.data("language")).css("display")?p("#snippetpreview-help_"+t.data("language")).css({display:"block"}):p("#snippetpreview-help_"+t.data("language")).css({display:"none"})})),"focuskw_text_input-help-toggle"==t&&(a.addClass("wpglobus-focuskw_text_input-help-toggle_"+s),p(document).on("click",".wpglobus-focuskw_text_input-help-toggle_"+s,function(e){var t=p(this);"none"===p("#focuskw_text_input-help_"+t.data("language")).css("display")?p("#focuskw_text_input-help_"+t.data("language")).css({display:"block"}):p("#focuskw_text_input-help_"+t.data("language")).css({display:"none"})})),"pageanalysis-help-toggle"==t&&(a.addClass("wpglobus-pageanalysis-help-toggle_"+s),p(document).on("click",".wpglobus-pageanalysis-help-toggle_"+s,function(e){var t=p(this);"none"===p("#pageanalysis-help_"+t.data("language")).css("display")?p("#pageanalysis-help_"+t.data("language")).css({display:"block"}):p("#pageanalysis-help_"+t.data("language")).css({display:"none"})})),a.attr("id",t+"_"+s),p("#"+t+"_"+s).attr("data-language",s)});var i=WPGlobusCore.TextFilter(p("#yoast_wpseo_focuskw_text_input").val(),s,"RETURN_EMPTY");p("#yoast_wpseo_focuskw_text_input_"+s).val(i),p("#yoast_wpseo_focuskw_"+s).val(i),d.updateWpseoKeyword(i,s),s!==WPGlobusCoreData.default_language&&(p("#"+o+" #yoast_wpseo_focuskw_text_input_"+s).addClass("hidden").after('<div class="wpglobus-suggest" style="font-weight:bold;">'+WPGlobusVendor.i18n.yoastseo_plus_access+"</div>"),p("#"+o+" #wpseo-pageanalysis_"+s).addClass("hidden").css({display:"none"}))}),p(".wpglobus-wpseosnippet").each(function(e,t){var a=p(t),s=a.data("language");a.find("button.snippet-editor__button.snippet-editor__edit-button").addClass(d.editSnippetButtonClass).addClass(d.editSnippetButtonClass+"_"+s).attr("data-language",s),a.find(".snippet-editor__form").addClass(d.editSnippetFormClass).addClass(d.editSnippetFormClass+"_"+s),a.find(".snippet-editor__heading-editor").addClass(d.editSnippetHeadingClass).addClass(d.editSnippetHeadingClass+"_"+s),a.find(".snippet-editor__submit").addClass(d.editSnippetSubmitClass).addClass(d.editSnippetSubmitClass+"_"+s).attr("data-language",s)}),d.iB.addClass("hidden"),d.iB.css({height:0,overflow:"hidden"});var e=WPGlobusCore.TextFilter(p("#yoast_wpseo_focuskw_text_input").val(),WPGlobusCoreData.default_language,"RETURN_EMPTY");p("#yoast_wpseo_focuskw_text_input").val(e),p("#yoast_wpseo_focuskw").val(e),p(".wpglobus-wpseo-general .wpseo_tablink").on("click",function(e){e.preventDefault();var t=p(this),a=t.parents("ul").data("language"),s=t.parent("li");a!=WPGlobusCoreData.default_language&&void 0===p(document).triggerHandler("wpglobus_yoast_analysis",{language:a})||(s.hasClass("wpseo_content_tab")?(p("#wpseo-pageanalysis_"+a).css({display:"none"}),p("#yoast-seo-content-analysis_"+a).css({display:"block"}),p("#wpseo_content_"+a+" table tr").eq(0).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(1).css({display:"none"}),p("#yoast-seo-content-analysis_"+a+" li a").css({float:"none"})):s.hasClass("wpseo_keyword_tab")&&(p("#wpseo-pageanalysis_"+a).css({display:"block"}),p("#yoast-seo-content-analysis_"+a).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(0).css("display",""),p("#wpseo_content_"+a+" table tr").eq(1).css("display","")))}),p(".wpseo-metabox-sidebar .wpseo-meta-section-link").on("click",function(e){"#wpseo-meta-section-content"==p(this).attr("href")?p("#wpglobus-wpseo-tabs").css({display:"block"}):p("#wpglobus-wpseo-tabs").css({display:"none"})}),p("body").on("click","."+d.editSnippetButtonClass,function(e){var t=p(this),a=t.data("language"),s=p("."+d.editSnippetFormClass+"_"+a),o=p("."+d.editSnippetSubmitClass+"_"+a),i=p("."+d.editSnippetHeadingClass+"_"+a);s.hasClass("snippet-editor--hidden")?(s.removeClass("snippet-editor--hidden"),i.removeClass("snippet-editor--hidden"),o.removeClass("snippet-editor--hidden")):(s.addClass("snippet-editor--hidden"),i.addClass("snippet-editor--hidden")),t.addClass("snippet-editor--hidden")}),p("body").on("click","."+d.editSnippetSubmitClass,function(e){var t=p(this).data("language"),a=p("."+d.editSnippetButtonClass+"_"+t),s=p("."+d.editSnippetFormClass+"_"+t),o=p("."+d.editSnippetSubmitClass+"_"+t),i=p("."+d.editSnippetHeadingClass+"_"+t);a.removeClass("snippet-editor--hidden"),s.addClass("snippet-editor--hidden"),o.addClass("snippet-editor--hidden"),i.addClass("snippet-editor--hidden")}),p(document).on("keyup","input.wpglobus-snippet-editor-title",function(e){var t=p(this),a=t.data("language"),s=WPGlobusCore.getString(p('input[name="yoast_wpseo_title"]').val(),t.val(),a);p("#snippet_title_"+a).html(r.replaceVariablesPlugin(t.val())),YoastSEO.app.rawData.pageTitle=s,p('input[name="yoast_wpseo_title"]').val(s),p("#snippet_title").text(s),_.debounce(d.updateProgressBar(t,a),500)}),p(document).on("keyup","input.wpglobus-snippet-editor-slug",function(e){var t=p(this),a=t.data("language");p("#snippet_cite_"+a).text(t.val()+"/"),p("#editable-post-name").text(t.val()),p("#editable-post-name-full").text(t.val())}),p(document).on("change","input.wpglobus-snippet-editor-slug",function(e){var t=p(this);p.post(ajaxurl,{action:"sample-permalink",post_id:p("#post_ID").val()||0,new_slug:t.val(),new_title:p("#title").val(),samplepermalinknonce:p("#samplepermalinknonce").val()})}),p(document).on("keyup","textarea.wpglobus-snippet-editor-meta-description",function(e){var t=p(this),a=t.data("language");p("#snippet_meta_"+a).text(t.val());var s=WPGlobusCore.getString(p("#yoast_wpseo_metadesc").val(),t.val(),t.data("language"));p("#yoast_wpseo_metadesc").val(s),p("#snippet_meta").text(s),_.debounce(d.updateProgressBar(t,a),500)}),p("body").on("click",".wpglobus-post-body-tabs-list li",function(e){var t,a=p(this);a.hasClass("wpglobus-post-tab")&&(p("#wpglobus-wpseo-tabs").tabs("option","active",a.data("order")),t=p("#yoast_wpseo_focuskw_text_input_"+p(this).data("language")).val(),YoastSEO.app.rawData.keyword=t,p("#yoast_wpseo_focuskw_text_input").val(t),p('input[name="yoast_wpseo_focuskw"]').val(t),s.prototype.analyze())}),d.initAddKeywordPopup()}},(s=function(){this.replaceVars=wpseoReplaceVarsL10n.replace_vars,this.language=WPGlobusCoreData.default_language,this.tab=WPGlobusCoreData.default_language,this.wpseoTab=WPGlobusCoreData.default_language,this.title_template=wpseoPostScraperL10n.title_template,this.focuskw=p("#yoast_wpseo_focuskw_text_input"),this.focuskw_hidden=p('input[name="yoast_wpseo_focuskw"]'),this.focuskwKeep=!1,this.post_slug="#editable-post-name-full",YoastSEO.app.registerPlugin("wpglobusYoastSeoPlugin",{status:"ready"}),YoastSEO.app.registerModification("content",this.contentModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("title",this.titleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_title",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_meta",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_page_title",this.pageTitleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_meta_desc",this.metaDescModification,"wpglobusYoastSeoPlugin",0),s.prototype.setScoreIcon(),p(document).on("blur",".wpglobus-snippet_title",function(e){var t=p(this),a=WPGlobusCore.getString(p("#yoast_wpseo_title").val(),t.text(),t.data("language"));YoastSEO.app.rawData.pageTitle=a,p('input[name="yoast_wpseo_title"]').val(a),p("#snippet_title").text(a)}),p(document).on("blur",".wpglobus-snippet_meta",function(e){var t=p(this),a=WPGlobusCore.getString(p("#yoast_wpseo_metadesc").val(),t.text(),t.data("language"));p("#yoast_wpseo_metadesc").val(a),p("#snippet_meta").text(a)}),p(document).on("keyup",".wpglobus-yoast_wpseo_focuskw_text_input",function(e){var t=p(this),a=t.val();r.focuskw.val(a),r.focuskw_hidden.val(a),r.updateWpseoKeyword(a,t.data("language")),s.prototype.analyze()}),p("#publish,#save-post").on("mouseenter",function(e){var a,s="";p(".wpglobus-yoast_wpseo_focuskw_text_input").each(function(e,t){a=p(this),s=WPGlobusCore.getString(s,a.val(),a.data("language"))}),r.focuskw.val(s),r.focuskw_hidden.val(s)}).on("mouseleave",function(e){r.focuskwKeep||(r.wpseoTab=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language"),p(this),r.focuskw.val(p("#yoast_wpseo_focuskw_text_input_"+r.wpseoTab).val()),r.focuskw_hidden.val(p("#yoast_wpseo_focuskw_text_input_"+r.wpseoTab).val()))}).on("click",function(e){r.focuskwKeep=!0}),p(WPGlobusYoastSeo.wpseoTabSelector).on("tabsactivate",function(e,t){var a;r.language=t.newPanel.attr("data-language"),t.newPanel.attr("data-language")===WPGlobusCoreData.default_language&&(a=p("#yoast_wpseo_focuskw_text_input_"+WPGlobusCoreData.default_language).val(),YoastSEO.app.rawData.keyword=a,r.focuskw.val(a),r.focuskw_hidden.val(a)),s.prototype.analyze()}),r=this}).prototype.analyze=function(){var e=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language");e!=WPGlobusCoreData.default_language&&0!=p("#editable-post-name-full-"+e).length?YoastSEO.app.snippetPreview.data.urlPath=p("#editable-post-name-full-"+e).text():YoastSEO.app.snippetPreview.data.urlPath=p("#editable-post-name-full").text(),YoastSEO.app.analyzeTimer(YoastSEO.app),s.prototype.setScoreIcon()},s.prototype.setScoreIcon=function(){var a=setInterval(function(){var e=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language"),t=p("#wpseo-metabox-tabs .wpseo-score-icon").attr("class");"bad"!=(t=t.replace("wpseo-score-icon ",""))&&"ok"!=t&&"good"!=t||(p("#wpseo-metabox-tabs_"+e+" .wpseo-score-icon").removeClass("bad ok good 100"),p("#wpseo-metabox-tabs_"+e+" .wpseo-score-icon").addClass(t),clearInterval(a))},700)},s.prototype.getWPseoTab=function(){return p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language")},s.prototype.citeModification=function(e){var t="#snippet_citeBase_"+e,a="#snippet_cite_"+e,s=p("#wpseo-tab-"+e).data("yoast-cite-base");!1===p("#wpseo-tab-"+e).data("cite-contenteditable")&&p(a).attr("contenteditable","false"),p(t).text(s)},s.prototype.pageTitleModification=function(e){var a,s="#snippet_title_",o="",i="";if(r.title_template==e)p.each(WPGlobusCoreData.enabled_languages,function(e,t){n=p("#snippet-editor-title_"+t).val(),l=0==n.length?r.title_template:n,o=r.replaceVariablesPlugin(l),p(s+t).text(o),t==r.getWPseoTab()&&(i=o)});else{if(a=WPGlobusCore.getTranslations(e),r.getWPseoTab()!==WPGlobusCoreData.default_language&&a[WPGlobusCoreData.default_language]==e){var n,t=r.getWPseoTab(),l=0<(n=p("#snippet-editor-title_"+t).val()).length?n:r.title_template;return l=r.replaceVariablesPlugin(l),p(s+t).text(l),l}p.each(WPGlobusCoreData.enabled_languages,function(e,t){o=""===a[t]?r.replaceVariablesPlugin(r.title_template):r.replaceVariablesPlugin(a[t]),t==r.getWPseoTab()&&(i=o,0!=(n=p("#snippet-editor-title_"+t).val()).length?n!=i&&(i=r.replaceVariablesPlugin(n)):i=r.replaceVariablesPlugin(r.title_template)),p(s+t).html(i)})}return i},s.prototype.metaDescModification=function(a){var s="#snippet_meta_",e=WPGlobusCore.getTranslations(a),t="",o=p("#snippet-editor-meta-description_"+r.getWPseoTab()).val();if(r.getWPseoTab()===WPGlobusCoreData.default_language||e[WPGlobusCoreData.default_language]!=a)return p.each(WPGlobusCoreData.enabled_languages,function(e,t){p(s+t).text(WPGlobusCore.TextFilter(a,t,"RETURN_EMPTY")),r.citeModification(t)}),o==e[r.getWPseoTab()]?0==(t=e[r.getWPseoTab()]).length&&p(s+r.getWPseoTab()).text(WPGlobusCore.TextFilter(YoastSEO.app.snippetPreview.data.metaDesc,WPGlobusCoreData.default_language,"RETURN_EMPTY")):0==(t=o).length?p(s+r.getWPseoTab()).text(WPGlobusCore.TextFilter(YoastSEO.app.snippetPreview.data.metaDesc,WPGlobusCoreData.default_language,"RETURN_EMPTY")):p(s+r.getWPseoTab()).text(t),p(s+r.getWPseoTab()).text(t),t;var i=r.getWPseoTab();return r.citeModification(i),0==o.length?p(s+i).text(""):o!=a&&p(s+i).text(o),a},s.prototype.snippetModification=function(e){return WPGlobusCore.TextFilter(e,r.getWPseoTab(),"RETURN_EMPTY")},s.prototype.contentModification=function(e){return r.getWPseoTab()==WPGlobusCoreData.default_language?e:p("#content_"+r.getWPseoTab()).val()},s.prototype.titleModification=function(e){return setTimeout(r.updatePageAnalysis,1e3),r.getWPseoTab()==WPGlobusCoreData.default_language?e:p("#title_"+r.getWPseoTab()).val()},s.prototype.defaultReplace=function(e){var t=YoastSEO.app.rawData.keyword;return e.replace(/%%sitedesc%%/g,this.replaceVars.sitedesc).replace(/%%sitename%%/g,WPGlobusCore.TextFilter(this.replaceVars.sitename,r.getWPseoTab())).replace(/%%term_title%%/g,this.replaceVars.term_title).replace(/%%term_description%%/g,this.replaceVars.term_description).replace(/%%category_description%%/g,this.replaceVars.category_description).replace(/%%tag_description%%/g,this.replaceVars.tag_description).replace(/%%searchphrase%%/g,this.replaceVars.searchphrase).replace(/%%date%%/g,this.replaceVars.date).replace(/%%id%%/g,this.replaceVars.id).replace(/%%page%%/g,this.replaceVars.page).replace(/%%currenttime%%/g,this.replaceVars.currenttime).replace(/%%currentdate%%/g,this.replaceVars.currentdate).replace(/%%currentday%%/g,this.replaceVars.currentday).replace(/%%currentmonth%%/g,this.replaceVars.currentmonth).replace(/%%currentyear%%/g,this.replaceVars.currentyear).replace(/%%focuskw%%/g,t)},s.prototype.replaceVariablesPlugin=function(e){return void 0!==e&&(e=this.titleReplace(e),e=this.defaultReplace(e),e=this.replaceSeparators(e)),e},s.prototype.replaceSeparators=function(e){return e.replace(/%%sep%%(\s+%%sep%%)*/g,this.replaceVars.sep)},s.prototype.titleReplace=function(e){var t="";return void 0===(t=this.language==WPGlobusCoreData.default_language?p("#title").val():p("#title_"+this.language).val())&&(t=YoastSEO.app.rawData.pageTitle),this.language!=WPGlobusCoreData.default_language&&0==t.length&&(t=p("#title").val()),e=e.replace(/%%title%%/g,t)},s.prototype.doubleSepReplace=function(e){var t=YoastSEO.app.stringHelper.addEscapeChars(this.replaceVars.sep),a=new RegExp(t+" "+t,"g");return e=e.replace(a,this.replaceVars.sep)},s.prototype.updateWpseoKeyword=function(e,t){0<p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").length&&p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").eq(1).removeClass("wpseo-keyword").addClass("wpglobus-wpseo_keyword_"+t),p(".wpglobus-wpseo_keyword_"+t).text(e)},s.prototype.updatePageAnalysis=function(){p("#wpseo-pageanalysis_"+r.getWPseoTab()).html(p("#wpseo-pageanalysis").html()),p("#yoast-seo-content-analysis_"+r.getWPseoTab()).html(p("#yoast-seo-content-analysis").html()),p("#yoast-seo-content-analysis_"+r.getWPseoTab()+" li a").css({float:"none"})}),window.WPGlobusYoastSeoPlugin=new s)});
|
1 |
+
var WPGlobusYoastSeo;jQuery(document).ready(function(p){"use strict";var r,d,s;"undefined"!=typeof wpseoReplaceVarsL10n&&"undefined"!=typeof WPGlobusCoreData&&"undefined"!=typeof WPGlobusVendor&&("edit-tags.php"==WPGlobusVendor.pagenow||"term.php"==WPGlobusVendor.pagenow?(d=WPGlobusYoastSeo={editorIDs:["description"],editor:{},submitId:"#submit",preventChangeEditor:!1,observer:null,init:function(){d.attachListeners(),_.delay(d.start,1500)},submit:function(e){"mouseenter"===e.type?p.each(d.editor,function(e,t){!d.editor[e].contentEditor||d.editor[e].contentEditor.isHidden()?p("#"+e).val(d.editor[e].content):tinymce.get(e).setContent(d.editor[e].content)}):"mouseleave"===e.type?d.preventChangeEditor||(p.each(d.editor,function(e,t){!d.editor[e].contentEditor||d.editor[e].contentEditor.isHidden()?p("#"+e).val(WPGlobusCore.TextFilter(t.content,d.getCurrentTab(),"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,d.getCurrentTab(),"RETURN_EMPTY"))}),d.preventChangeEditor=!1):"click"===e.type&&(d.preventChangeEditor=!0,"tinymce"!=getUserSetting("editor")&&setUserSetting("editor","tinymce"))},attachListeners:function(){p(".wrap").on("tabsactivate",function(e,a){p.each(d.editor,function(e,t){!d.editor[e].contentEditor||d.editor[e].contentEditor.isHidden()?p("#"+e).val(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY"))})}),p(document).on("mouseenter",d.submitId,d.submit).on("mouseleave",d.submitId,d.submit).on("click",d.submitId,d.submit),p(document).on("tinymce-editor-init",function(e,t){var a;-1!=_.indexOf(d.editorIDs,t.id)&&(a=p("#"+t.id),d.editor[t.id]={},d.editor[t.id].contentEditor=t,d.editor[t.id].content=a.val(),t.setContent(WPGlobusCore.TextFilter(d.editor[t.id].content,WPGlobusCoreData.default_language,"RETURN_EMPTY")),p("#"+t.getContainer().id).find("iframe").addClass("wpglobus-translatable"),a.removeClass("hidden"),t.on("nodechange keyup",_.debounce(d.update,500)),a.on("input keyup",_.debounce(d.update,500)))})},update:function(e){var t;void 0!==e.target&&("tinymce"==(t=e.target.id)&&(t=e.target.dataset.id),void 0!==d.editor[t].contentEditor&&(e=!d.editor[t].contentEditor||d.editor[t].contentEditor.isHidden()?p("#"+t).val():d.editor[t].contentEditor.getContent({format:"raw"}),d.editor[t].content=WPGlobusCore.getString(d.editor[t].content,e,d.getCurrentTab())))},getCurrentTab:function(){return p(".wpglobus-taxonomy-tabs-list .ui-tabs-active").data("language")},start:function(){p(".wpglobus-element_description").css({display:"none"})}},WPGlobusYoastSeo.init(),s=function(){p(".wrap").on("tabsactivate",function(e,t){t.newTab[0].dataset.language==WPGlobusCoreData.default_language?p("#poststuff .inside").css({display:"block"}):p("#poststuff .inside").css({display:"none"})}),p.each(["category_description","sitedesc","sitename","tag_description","term_description","term_title"],function(e,t){wpseoReplaceVarsL10n.replace_vars[t]=WPGlobusCore.TextFilter(wpseoReplaceVarsL10n.replace_vars[t],WPGlobusCoreData.default_language)}),WPGlobusYoastSeo.observer=new MutationObserver(function(e){e.forEach(function(e){"placeholder"==e.attributeName&&(WPGlobusYoastSeo.observer.disconnect(),""==(e=p("#wpseo_focuskw")).val()&&e.attr("placeholder",WPGlobusCore.TextFilter(e.attr("placeholder"),WPGlobusCoreData.default_language)),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0}))})}),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0})}):(d=WPGlobusYoastSeo={wpseoTabSelector:"#wpglobus-wpseo-tabs",url:"",attrs:p("#wpglobus-wpseo-attr"),iB:p("#wpseo-meta-section-content"),t:p("#wpseo-meta-section-content"),ids:"",names:"",editSnippetButtonClass:"wpglobus-snippet-editor__edit-button",editSnippetFormClass:"wpglobus-snippet-editor__form",editSnippetSubmitClass:"wpglobus-snippet-editor__submit",editSnippetHeadingClass:"wpglobus-snippet-editor__heading-editor",yoastTitleProgress:"wpglobus-yoast-title-progress",yoastMetadescProgress:"wpglobus-yoast-metadesc-progress",init:function(){d.start()},initAddKeywordPopup:function(){1===p("#wpseo-add-keyword-popup").length&&p(".wpseo-add-keyword").on("click",d.addKeywordPopup)},addKeywordPopup:function(){var e=p("#wpseo-add-keyword-popup-button").text();tb_show(e,"#TB_inline?width=650&height=350&inlineId=wpseo-add-keyword-popup","group"),jQuery("#TB_window").css("height",235),jQuery("#TB_window").css("width",680)},qtip:function(){p(".yoast_help").qtip({content:{attr:"alt"},position:{my:"bottom left",at:"top center"},style:{tip:{corner:!0},classes:"yoast-qtip qtip-rounded qtip-blue"},show:"click",hide:{fixed:!0,delay:500}})},removeClasses:function(t,e){_.each(e,function(e){t.removeClass(e)})},updateProgressBar:function(e,t){var a,s,o,i,n,l;void 0!==e&&(void 0===t&&void 0===(t="undefined"!==e.data("language")?e.data("language"):t)||(o="",i=l=0,n=!(a=["snippet-editor__progress--bad","snippet-editor__progress--ok","snippet-editor__progress--good"]),l=e.val().length,e.hasClass("wpglobus-snippet-editor-title")?(i=(s=p("progress."+d.yoastTitleProgress+"_"+t)).attr("max"),o=a[2],0==l?o=a[1]:i<l?(o=a[1],n=!0):0<l&&l<35&&(o=a[1])):e.hasClass("wpglobus-snippet-editor-meta-description")&&(i=(s=p("progress."+d.yoastMetadescProgress+"_"+t)).attr("max"),o=a[2],0==l?o=a[1]:i<l?(o=a[1],n=!0):0<l&&l<121&&(o=a[1])),d.removeClasses(s,a),s.attr("value",l).addClass(o),n?e.css("color","#f00"):e.css("color","#000")))},updateWpseoKeyword:function(e,t){p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").eq(1).text(e)},start:function(){p(d.wpseoTabSelector).tabs(),d.ids=d.attrs.data("ids"),d.names=d.attrs.data("names"),d.ids=d.ids+","+d.attrs.data("qtip"),d.ids=d.ids.split(","),d.names=d.names.split(","),p("#wpglobus-wpseo-tabs").insertBefore(d.iB),p(".wpseo-metabox-tabs").css({height:"26px"}),p(".wpglobus-wpseo-general").each(function(e,t){var a=p(t),s=a.data("language"),t="wpseo-meta-section-content_"+s;a.html('<div id="'+t+'" class="wpseo-meta-section wpglobus-wpseo-meta-section" style="width:100%" data-language="'+s+'">'+d.t.html()+"</div>"),p("#"+t+" .wpseo-metabox-tabs").attr("id","wpseo-metabox-tabs_"+s).attr("data-language",s),p("#"+t+" .wpseotab").attr("id","wpseo_content_"+s),p("#wpseo_content_"+s).css({float:"left"}),p("#"+t).css({display:"block"}),p("#wpseo_meta").css({overflow:"hidden"}),p("#"+t+" .snippet_container").addClass("wpglobus-snippet_container"),s!==WPGlobusCoreData.default_language&&p("#"+t+" .wpseo-add-keyword").addClass("hidden"),p.each(d.names,function(e,t){p("#"+t).attr("name",t+"_"+s)}),p.each(d.ids,function(e,t){var a=p("#"+t);"wpseosnippet"==t&&a.addClass("wpglobus-wpseosnippet"),"snippet_title"==t&&a.addClass("wpglobus-snippet_title"),"snippet_meta"==t&&a.addClass("wpglobus-snippet_meta"),"snippet_cite"==t&&a.addClass("wpglobus-snippet_cite"),"snippet_citeBase"==t&&a.addClass("wpglobus-snippet_citeBase"),"url_container"==t&&a.css({height:"16px"}),"yoast_wpseo_focuskw_text_input"==t&&a.addClass("wpglobus-yoast_wpseo_focuskw_text_input"),"wpseo-pageanalysis"==t&&a.addClass("wpglobus-wpseo-pageanalysis"),"yoast-seo-content-analysis"==t&&a.addClass("wpglobus-yoast-seo-content-analysis"),"snippet_preview"==t&&a.addClass("wpglobus-snippet_preview"),"snippet-editor-title"==t&&(a.addClass("wpglobus-snippet-editor-title"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),a.val(p("#wpseo-tab-"+s).data("wpseotitle")),a.parent("label").next("progress").addClass(d.yoastTitleProgress).addClass(d.yoastTitleProgress+"_"+s),_.debounce(d.updateProgressBar(a,s),500)),"snippet-editor-slug"==t&&(a.addClass("wpglobus-snippet-editor-slug"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),WPGlobusCoreData.default_language!=s&&a.attr("disabled","disabled")),"snippet-editor-meta-description"==t&&(a.addClass("wpglobus-snippet-editor-meta-description"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),a.val(p("#wpseo-tab-"+s).data("metadesc")),a.parent("label").next("progress").addClass(d.yoastMetadescProgress).addClass(d.yoastMetadescProgress+"_"+s),_.debounce(d.updateProgressBar(a,s),500)),"snippetpreview-help-toggle"==t&&(a.addClass("wpglobus-snippetpreview-help-toggle_"+s),p(document).on("click",".wpglobus-snippetpreview-help-toggle_"+s,function(e){var t=p(this);"none"===p("#snippetpreview-help_"+t.data("language")).css("display")?p("#snippetpreview-help_"+t.data("language")).css({display:"block"}):p("#snippetpreview-help_"+t.data("language")).css({display:"none"})})),"focuskw_text_input-help-toggle"==t&&(a.addClass("wpglobus-focuskw_text_input-help-toggle_"+s),p(document).on("click",".wpglobus-focuskw_text_input-help-toggle_"+s,function(e){var t=p(this);"none"===p("#focuskw_text_input-help_"+t.data("language")).css("display")?p("#focuskw_text_input-help_"+t.data("language")).css({display:"block"}):p("#focuskw_text_input-help_"+t.data("language")).css({display:"none"})})),"pageanalysis-help-toggle"==t&&(a.addClass("wpglobus-pageanalysis-help-toggle_"+s),p(document).on("click",".wpglobus-pageanalysis-help-toggle_"+s,function(e){var t=p(this);"none"===p("#pageanalysis-help_"+t.data("language")).css("display")?p("#pageanalysis-help_"+t.data("language")).css({display:"block"}):p("#pageanalysis-help_"+t.data("language")).css({display:"none"})})),a.attr("id",t+"_"+s),p("#"+t+"_"+s).attr("data-language",s)});a=WPGlobusCore.TextFilter(p("#yoast_wpseo_focuskw_text_input").val(),s,"RETURN_EMPTY");p("#yoast_wpseo_focuskw_text_input_"+s).val(a),p("#yoast_wpseo_focuskw_"+s).val(a),d.updateWpseoKeyword(a,s),s!==WPGlobusCoreData.default_language&&(p("#"+t+" #yoast_wpseo_focuskw_text_input_"+s).addClass("hidden").after('<div class="wpglobus-suggest" style="font-weight:bold;">'+WPGlobusVendor.i18n.yoastseo_plus_access+"</div>"),p("#"+t+" #wpseo-pageanalysis_"+s).addClass("hidden").css({display:"none"}))}),p(".wpglobus-wpseosnippet").each(function(e,t){var a=p(t),t=a.data("language");a.find("button.snippet-editor__button.snippet-editor__edit-button").addClass(d.editSnippetButtonClass).addClass(d.editSnippetButtonClass+"_"+t).attr("data-language",t),a.find(".snippet-editor__form").addClass(d.editSnippetFormClass).addClass(d.editSnippetFormClass+"_"+t),a.find(".snippet-editor__heading-editor").addClass(d.editSnippetHeadingClass).addClass(d.editSnippetHeadingClass+"_"+t),a.find(".snippet-editor__submit").addClass(d.editSnippetSubmitClass).addClass(d.editSnippetSubmitClass+"_"+t).attr("data-language",t)}),d.iB.addClass("hidden"),d.iB.css({height:0,overflow:"hidden"});var e=WPGlobusCore.TextFilter(p("#yoast_wpseo_focuskw_text_input").val(),WPGlobusCoreData.default_language,"RETURN_EMPTY");p("#yoast_wpseo_focuskw_text_input").val(e),p("#yoast_wpseo_focuskw").val(e),p(".wpglobus-wpseo-general .wpseo_tablink").on("click",function(e){e.preventDefault();var t=p(this),e=t.parents("ul").data("language"),t=t.parent("li");e!=WPGlobusCoreData.default_language&&void 0===p(document).triggerHandler("wpglobus_yoast_analysis",{language:e})||(t.hasClass("wpseo_content_tab")?(p("#wpseo-pageanalysis_"+e).css({display:"none"}),p("#yoast-seo-content-analysis_"+e).css({display:"block"}),p("#wpseo_content_"+e+" table tr").eq(0).css({display:"none"}),p("#wpseo_content_"+e+" table tr").eq(1).css({display:"none"}),p("#yoast-seo-content-analysis_"+e+" li a").css({float:"none"})):t.hasClass("wpseo_keyword_tab")&&(p("#wpseo-pageanalysis_"+e).css({display:"block"}),p("#yoast-seo-content-analysis_"+e).css({display:"none"}),p("#wpseo_content_"+e+" table tr").eq(0).css("display",""),p("#wpseo_content_"+e+" table tr").eq(1).css("display","")))}),p(".wpseo-metabox-sidebar .wpseo-meta-section-link").on("click",function(e){"#wpseo-meta-section-content"==p(this).attr("href")?p("#wpglobus-wpseo-tabs").css({display:"block"}):p("#wpglobus-wpseo-tabs").css({display:"none"})}),p("body").on("click","."+d.editSnippetButtonClass,function(e){var t=p(this),a=t.data("language"),s=p("."+d.editSnippetFormClass+"_"+a),o=p("."+d.editSnippetSubmitClass+"_"+a),a=p("."+d.editSnippetHeadingClass+"_"+a);s.hasClass("snippet-editor--hidden")?(s.removeClass("snippet-editor--hidden"),a.removeClass("snippet-editor--hidden"),o.removeClass("snippet-editor--hidden")):(s.addClass("snippet-editor--hidden"),a.addClass("snippet-editor--hidden")),t.addClass("snippet-editor--hidden")}),p("body").on("click","."+d.editSnippetSubmitClass,function(e){var t=p(this).data("language"),a=p("."+d.editSnippetButtonClass+"_"+t),s=p("."+d.editSnippetFormClass+"_"+t),o=p("."+d.editSnippetSubmitClass+"_"+t),t=p("."+d.editSnippetHeadingClass+"_"+t);a.removeClass("snippet-editor--hidden"),s.addClass("snippet-editor--hidden"),o.addClass("snippet-editor--hidden"),t.addClass("snippet-editor--hidden")}),p(document).on("keyup","input.wpglobus-snippet-editor-title",function(e){var t=p(this),a=t.data("language"),s=WPGlobusCore.getString(p('input[name="yoast_wpseo_title"]').val(),t.val(),a);p("#snippet_title_"+a).html(r.replaceVariablesPlugin(t.val())),YoastSEO.app.rawData.pageTitle=s,p('input[name="yoast_wpseo_title"]').val(s),p("#snippet_title").text(s),_.debounce(d.updateProgressBar(t,a),500)}),p(document).on("keyup","input.wpglobus-snippet-editor-slug",function(e){var t=p(this),a=t.data("language");p("#snippet_cite_"+a).text(t.val()+"/"),p("#editable-post-name").text(t.val()),p("#editable-post-name-full").text(t.val())}),p(document).on("change","input.wpglobus-snippet-editor-slug",function(e){var t=p(this);p.post(ajaxurl,{action:"sample-permalink",post_id:p("#post_ID").val()||0,new_slug:t.val(),new_title:p("#title").val(),samplepermalinknonce:p("#samplepermalinknonce").val()})}),p(document).on("keyup","textarea.wpglobus-snippet-editor-meta-description",function(e){var t=p(this),a=t.data("language");p("#snippet_meta_"+a).text(t.val());var s=WPGlobusCore.getString(p("#yoast_wpseo_metadesc").val(),t.val(),t.data("language"));p("#yoast_wpseo_metadesc").val(s),p("#snippet_meta").text(s),_.debounce(d.updateProgressBar(t,a),500)}),p("body").on("click",".wpglobus-post-body-tabs-list li",function(e){var t=p(this);t.hasClass("wpglobus-post-tab")&&(p("#wpglobus-wpseo-tabs").tabs("option","active",t.data("order")),t=p("#yoast_wpseo_focuskw_text_input_"+p(this).data("language")).val(),YoastSEO.app.rawData.keyword=t,p("#yoast_wpseo_focuskw_text_input").val(t),p('input[name="yoast_wpseo_focuskw"]').val(t),s.prototype.analyze())}),d.initAddKeywordPopup()}},(s=function(){this.replaceVars=wpseoReplaceVarsL10n.replace_vars,this.language=WPGlobusCoreData.default_language,this.tab=WPGlobusCoreData.default_language,this.wpseoTab=WPGlobusCoreData.default_language,this.title_template=wpseoPostScraperL10n.title_template,this.focuskw=p("#yoast_wpseo_focuskw_text_input"),this.focuskw_hidden=p('input[name="yoast_wpseo_focuskw"]'),this.focuskwKeep=!1,this.post_slug="#editable-post-name-full",YoastSEO.app.registerPlugin("wpglobusYoastSeoPlugin",{status:"ready"}),YoastSEO.app.registerModification("content",this.contentModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("title",this.titleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_title",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_meta",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_page_title",this.pageTitleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_meta_desc",this.metaDescModification,"wpglobusYoastSeoPlugin",0),s.prototype.setScoreIcon(),p(document).on("blur",".wpglobus-snippet_title",function(e){var t=p(this),t=WPGlobusCore.getString(p("#yoast_wpseo_title").val(),t.text(),t.data("language"));YoastSEO.app.rawData.pageTitle=t,p('input[name="yoast_wpseo_title"]').val(t),p("#snippet_title").text(t)}),p(document).on("blur",".wpglobus-snippet_meta",function(e){var t=p(this),t=WPGlobusCore.getString(p("#yoast_wpseo_metadesc").val(),t.text(),t.data("language"));p("#yoast_wpseo_metadesc").val(t),p("#snippet_meta").text(t)}),p(document).on("keyup",".wpglobus-yoast_wpseo_focuskw_text_input",function(e){var t=p(this),a=t.val();r.focuskw.val(a),r.focuskw_hidden.val(a),r.updateWpseoKeyword(a,t.data("language")),s.prototype.analyze()}),p("#publish,#save-post").on("mouseenter",function(e){var a,s="";p(".wpglobus-yoast_wpseo_focuskw_text_input").each(function(e,t){a=p(this),s=WPGlobusCore.getString(s,a.val(),a.data("language"))}),r.focuskw.val(s),r.focuskw_hidden.val(s)}).on("mouseleave",function(e){r.focuskwKeep||(r.wpseoTab=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language"),p(this),r.focuskw.val(p("#yoast_wpseo_focuskw_text_input_"+r.wpseoTab).val()),r.focuskw_hidden.val(p("#yoast_wpseo_focuskw_text_input_"+r.wpseoTab).val()))}).on("click",function(e){r.focuskwKeep=!0}),p(WPGlobusYoastSeo.wpseoTabSelector).on("tabsactivate",function(e,t){r.language=t.newPanel.attr("data-language"),t.newPanel.attr("data-language")===WPGlobusCoreData.default_language&&(t=p("#yoast_wpseo_focuskw_text_input_"+WPGlobusCoreData.default_language).val(),YoastSEO.app.rawData.keyword=t,r.focuskw.val(t),r.focuskw_hidden.val(t)),s.prototype.analyze()}),r=this}).prototype.analyze=function(){var e=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language");e!=WPGlobusCoreData.default_language&&0!=p("#editable-post-name-full-"+e).length?YoastSEO.app.snippetPreview.data.urlPath=p("#editable-post-name-full-"+e).text():YoastSEO.app.snippetPreview.data.urlPath=p("#editable-post-name-full").text(),YoastSEO.app.analyzeTimer(YoastSEO.app),s.prototype.setScoreIcon()},s.prototype.setScoreIcon=function(){var a=setInterval(function(){var e=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language"),t=p("#wpseo-metabox-tabs .wpseo-score-icon").attr("class");"bad"!=(t=t.replace("wpseo-score-icon ",""))&&"ok"!=t&&"good"!=t||(p("#wpseo-metabox-tabs_"+e+" .wpseo-score-icon").removeClass("bad ok good 100"),p("#wpseo-metabox-tabs_"+e+" .wpseo-score-icon").addClass(t),clearInterval(a))},700)},s.prototype.getWPseoTab=function(){return p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language")},s.prototype.citeModification=function(e){var t="#snippet_citeBase_"+e,a="#snippet_cite_"+e,s=p("#wpseo-tab-"+e).data("yoast-cite-base");!1===p("#wpseo-tab-"+e).data("cite-contenteditable")&&p(a).attr("contenteditable","false"),p(t).text(s)},s.prototype.pageTitleModification=function(e){var a,s="#snippet_title_",o="",i="";if(r.title_template==e)p.each(WPGlobusCoreData.enabled_languages,function(e,t){n=p("#snippet-editor-title_"+t).val(),l=0==n.length?r.title_template:n,o=r.replaceVariablesPlugin(l),p(s+t).text(o),t==r.getWPseoTab()&&(i=o)});else{if(a=WPGlobusCore.getTranslations(e),r.getWPseoTab()!==WPGlobusCoreData.default_language&&a[WPGlobusCoreData.default_language]==e){var n,e=r.getWPseoTab(),l=0<(n=p("#snippet-editor-title_"+e).val()).length?n:r.title_template;return l=r.replaceVariablesPlugin(l),p(s+e).text(l),l}p.each(WPGlobusCoreData.enabled_languages,function(e,t){o=""===a[t]?r.replaceVariablesPlugin(r.title_template):r.replaceVariablesPlugin(a[t]),t==r.getWPseoTab()&&(i=o,0!=(n=p("#snippet-editor-title_"+t).val()).length?n!=i&&(i=r.replaceVariablesPlugin(n)):i=r.replaceVariablesPlugin(r.title_template)),p(s+t).html(i)})}return i},s.prototype.metaDescModification=function(a){var s="#snippet_meta_",e=WPGlobusCore.getTranslations(a),t="",o=p("#snippet-editor-meta-description_"+r.getWPseoTab()).val();if(r.getWPseoTab()===WPGlobusCoreData.default_language||e[WPGlobusCoreData.default_language]!=a)return p.each(WPGlobusCoreData.enabled_languages,function(e,t){p(s+t).text(WPGlobusCore.TextFilter(a,t,"RETURN_EMPTY")),r.citeModification(t)}),o==e[r.getWPseoTab()]?0==(t=e[r.getWPseoTab()]).length&&p(s+r.getWPseoTab()).text(WPGlobusCore.TextFilter(YoastSEO.app.snippetPreview.data.metaDesc,WPGlobusCoreData.default_language,"RETURN_EMPTY")):0==(t=o).length?p(s+r.getWPseoTab()).text(WPGlobusCore.TextFilter(YoastSEO.app.snippetPreview.data.metaDesc,WPGlobusCoreData.default_language,"RETURN_EMPTY")):p(s+r.getWPseoTab()).text(t),p(s+r.getWPseoTab()).text(t),t;t=r.getWPseoTab();return r.citeModification(t),0==o.length?p(s+t).text(""):o!=a&&p(s+t).text(o),a},s.prototype.snippetModification=function(e){return WPGlobusCore.TextFilter(e,r.getWPseoTab(),"RETURN_EMPTY")},s.prototype.contentModification=function(e){return r.getWPseoTab()==WPGlobusCoreData.default_language?e:p("#content_"+r.getWPseoTab()).val()},s.prototype.titleModification=function(e){return setTimeout(r.updatePageAnalysis,1e3),r.getWPseoTab()==WPGlobusCoreData.default_language?e:p("#title_"+r.getWPseoTab()).val()},s.prototype.defaultReplace=function(e){var t=YoastSEO.app.rawData.keyword;return e.replace(/%%sitedesc%%/g,this.replaceVars.sitedesc).replace(/%%sitename%%/g,WPGlobusCore.TextFilter(this.replaceVars.sitename,r.getWPseoTab())).replace(/%%term_title%%/g,this.replaceVars.term_title).replace(/%%term_description%%/g,this.replaceVars.term_description).replace(/%%category_description%%/g,this.replaceVars.category_description).replace(/%%tag_description%%/g,this.replaceVars.tag_description).replace(/%%searchphrase%%/g,this.replaceVars.searchphrase).replace(/%%date%%/g,this.replaceVars.date).replace(/%%id%%/g,this.replaceVars.id).replace(/%%page%%/g,this.replaceVars.page).replace(/%%currenttime%%/g,this.replaceVars.currenttime).replace(/%%currentdate%%/g,this.replaceVars.currentdate).replace(/%%currentday%%/g,this.replaceVars.currentday).replace(/%%currentmonth%%/g,this.replaceVars.currentmonth).replace(/%%currentyear%%/g,this.replaceVars.currentyear).replace(/%%focuskw%%/g,t)},s.prototype.replaceVariablesPlugin=function(e){return void 0!==e&&(e=this.titleReplace(e),e=this.defaultReplace(e),e=this.replaceSeparators(e)),e},s.prototype.replaceSeparators=function(e){return e.replace(/%%sep%%(\s+%%sep%%)*/g,this.replaceVars.sep)},s.prototype.titleReplace=function(e){var t="";return void 0===(t=(this.language==WPGlobusCoreData.default_language?p("#title"):p("#title_"+this.language)).val())&&(t=YoastSEO.app.rawData.pageTitle),this.language!=WPGlobusCoreData.default_language&&0==t.length&&(t=p("#title").val()),e=e.replace(/%%title%%/g,t)},s.prototype.doubleSepReplace=function(e){var t=YoastSEO.app.stringHelper.addEscapeChars(this.replaceVars.sep),t=new RegExp(t+" "+t,"g");return e=e.replace(t,this.replaceVars.sep)},s.prototype.updateWpseoKeyword=function(e,t){0<p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").length&&p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").eq(1).removeClass("wpseo-keyword").addClass("wpglobus-wpseo_keyword_"+t),p(".wpglobus-wpseo_keyword_"+t).text(e)},s.prototype.updatePageAnalysis=function(){p("#wpseo-pageanalysis_"+r.getWPseoTab()).html(p("#wpseo-pageanalysis").html()),p("#yoast-seo-content-analysis_"+r.getWPseoTab()).html(p("#yoast-seo-content-analysis").html()),p("#yoast-seo-content-analysis_"+r.getWPseoTab()+" li a").css({float:"none"})}),window.WPGlobusYoastSeoPlugin=new s)});
|
includes/js/wpglobus-yoastseo-34.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var WPGlobusYoastSeo;jQuery(document).ready(function(p){"use strict";var r,d,s;"undefined"!=typeof wpseoReplaceVarsL10n&&"undefined"!=typeof WPGlobusCoreData&&"undefined"!=typeof WPGlobusVendor&&("edit-tags.php"==WPGlobusVendor.pagenow||"term.php"==WPGlobusVendor.pagenow?(d=WPGlobusYoastSeo={editorIDs:["description"],editor:{},submitId:"#submit",preventChangeEditor:!1,observer:null,init:function(){d.attachListeners(),_.delay(d.start,1500)},submit:function(e){"mouseenter"===e.type?p.each(d.editor,function(e,t){!d.editor[e].contentEditor||d.editor[e].contentEditor.isHidden()?p("#"+e).val(d.editor[e].content):tinymce.get(e).setContent(d.editor[e].content)}):"mouseleave"===e.type?d.preventChangeEditor||(p.each(d.editor,function(e,t){!d.editor[e].contentEditor||d.editor[e].contentEditor.isHidden()?p("#"+e).val(WPGlobusCore.TextFilter(t.content,d.getCurrentTab(),"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,d.getCurrentTab(),"RETURN_EMPTY"))}),d.preventChangeEditor=!1):"click"===e.type&&(d.preventChangeEditor=!0,"tinymce"!=getUserSetting("editor")&&setUserSetting("editor","tinymce"))},attachListeners:function(){p(".wrap").on("tabsactivate",function(e,a){p.each(d.editor,function(e,t){!d.editor[e].contentEditor||d.editor[e].contentEditor.isHidden()?p("#"+e).val(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY"))})}),p(document).on("mouseenter",d.submitId,d.submit).on("mouseleave",d.submitId,d.submit).on("click",d.submitId,d.submit),p(document).on("tinymce-editor-init",function(e,t){var a;-1!=_.indexOf(d.editorIDs,t.id)&&(a=p("#"+t.id),d.editor[t.id]={},d.editor[t.id].contentEditor=t,d.editor[t.id].content=a.val(),t.setContent(WPGlobusCore.TextFilter(d.editor[t.id].content,WPGlobusCoreData.default_language,"RETURN_EMPTY")),p("#"+t.getContainer().id).find("iframe").addClass("wpglobus-translatable"),a.removeClass("hidden"),t.on("nodechange keyup",_.debounce(d.update,500)),a.on("input keyup",_.debounce(d.update,500)))})},update:function(e){var t,a;void 0!==e.target&&("tinymce"==(t=e.target.id)&&(t=e.target.dataset.id),void 0!==d.editor[t].contentEditor&&(a=!d.editor[t].contentEditor||d.editor[t].contentEditor.isHidden()?p("#"+t).val():d.editor[t].contentEditor.getContent({format:"raw"}),d.editor[t].content=WPGlobusCore.getString(d.editor[t].content,a,d.getCurrentTab())))},getCurrentTab:function(){return p(".wpglobus-taxonomy-tabs-list .ui-tabs-active").data("language")},start:function(){p(".wpglobus-element_description").css({display:"none"})}},WPGlobusYoastSeo.init(),s=function(){p(".wrap").on("tabsactivate",function(e,t){t.newTab[0].dataset.language==WPGlobusCoreData.default_language?p("#poststuff .inside").css({display:"block"}):p("#poststuff .inside").css({display:"none"})}),p.each(["category_description","sitedesc","sitename","tag_description","term_description","term_title"],function(e,t){wpseoReplaceVarsL10n.replace_vars[t]=WPGlobusCore.TextFilter(wpseoReplaceVarsL10n.replace_vars[t],WPGlobusCoreData.default_language)}),WPGlobusYoastSeo.observer=new MutationObserver(function(e){e.forEach(function(e){var t;"placeholder"==e.attributeName&&(WPGlobusYoastSeo.observer.disconnect(),""==(t=p("#wpseo_focuskw")).val()&&t.attr("placeholder",WPGlobusCore.TextFilter(t.attr("placeholder"),WPGlobusCoreData.default_language)),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0}))})}),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0})}):(d=WPGlobusYoastSeo={wpseoTabSelector:"#wpglobus-wpseo-tabs",url:"",attrs:p("#wpglobus-wpseo-attr"),iB:p("#wpseo-meta-section-content"),t:p("#wpseo-meta-section-content"),ids:"",names:"",editSnippetButtonClass:"wpglobus-snippet-editor__edit-button",editSnippetFormClass:"wpglobus-snippet-editor__form",editSnippetSubmitClass:"wpglobus-snippet-editor__submit",editSnippetHeadingClass:"wpglobus-snippet-editor__heading-editor",yoastTitleProgress:"wpglobus-yoast-title-progress",yoastMetadescProgress:"wpglobus-yoast-metadesc-progress",init:function(){d.start()},initAddKeywordPopup:function(){1===p("#wpseo-add-keyword-popup").length&&p(".wpseo-add-keyword").on("click",d.addKeywordPopup)},addKeywordPopup:function(){var e=p("#wpseo-add-keyword-popup-button").text();tb_show(e,"#TB_inline?width=650&height=350&inlineId=wpseo-add-keyword-popup","group"),jQuery("#TB_window").css("height",235),jQuery("#TB_window").css("width",680)},qtip:function(){p(".yoast_help").qtip({content:{attr:"alt"},position:{my:"bottom left",at:"top center"},style:{tip:{corner:!0},classes:"yoast-qtip qtip-rounded qtip-blue"},show:"click",hide:{fixed:!0,delay:500}})},removeClasses:function(t,e){_.each(e,function(e){t.removeClass(e)})},updateProgressBar:function(e,t){var a,s,o,i,n,l;void 0!==e&&(void 0===t&&("undefined"!==e.data("language")&&(t=e.data("language")),void 0===t)||(o="",i=l=0,n=!(a=["snippet-editor__progress--bad","snippet-editor__progress--ok","snippet-editor__progress--good"]),l=e.val().length,e.hasClass("wpglobus-snippet-editor-title")?(i=(s=p("progress."+d.yoastTitleProgress+"_"+t)).attr("max"),o=a[2],0==l?o=a[1]:i<l?(o=a[1],n=!0):0<l&&l<35&&(o=a[1])):e.hasClass("wpglobus-snippet-editor-meta-description")&&(i=(s=p("progress."+d.yoastMetadescProgress+"_"+t)).attr("max"),o=a[2],0==l?o=a[1]:i<l?(o=a[1],n=!0):0<l&&l<121&&(o=a[1])),d.removeClasses(s,a),s.attr("value",l).addClass(o),n?e.css("color","#f00"):e.css("color","#000")))},updateWpseoKeyword:function(e,t){p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").text(e)},start:function(){p(d.wpseoTabSelector).tabs(),d.ids=d.attrs.data("ids"),d.names=d.attrs.data("names"),d.ids=d.ids+","+d.attrs.data("qtip"),d.ids=d.ids.split(","),d.names=d.names.split(","),p("#wpglobus-wpseo-tabs").insertBefore(d.iB),p(".wpseo-metabox-tabs").css({height:"26px"}),p(".wpglobus-wpseo-general").each(function(e,t){var a=p(t),s=a.data("language"),o="wpseo-meta-section-content_"+s;a.html('<div id="'+o+'" class="wpseo-meta-section wpglobus-wpseo-meta-section" style="width:100%" data-language="'+s+'">'+d.t.html()+"</div>"),p("#"+o+" .wpseo-metabox-tabs").attr("id","wpseo-metabox-tabs_"+s).attr("data-language",s),p("#"+o+" .wpseotab").attr("id","wpseo_content_"+s),p("#wpseo_content_"+s).css({float:"left"}),p("#"+o).css({display:"block"}),p("#wpseo_meta").css({overflow:"hidden"}),p("#"+o+" .snippet_container").addClass("wpglobus-snippet_container"),s!==WPGlobusCoreData.default_language&&p("#"+o+" .wpseo-add-keyword").addClass("hidden"),p.each(d.names,function(e,t){p("#"+t).attr("name",t+"_"+s)}),p.each(d.ids,function(e,t){var a=p("#"+t);"wpseosnippet"==t&&a.addClass("wpglobus-wpseosnippet"),"snippet_title"==t&&a.addClass("wpglobus-snippet_title"),"snippet_meta"==t&&a.addClass("wpglobus-snippet_meta"),"snippet_cite"==t&&a.addClass("wpglobus-snippet_cite"),"snippet_citeBase"==t&&a.addClass("wpglobus-snippet_citeBase"),"url_container"==t&&a.css({height:"16px"}),"yoast_wpseo_focuskw_text_input"==t&&a.addClass("wpglobus-yoast_wpseo_focuskw_text_input"),"wpseo-pageanalysis"==t&&a.addClass("wpglobus-wpseo-pageanalysis"),"yoast-seo-content-analysis"==t&&a.addClass("wpglobus-yoast-seo-content-analysis"),"snippet_preview"==t&&a.addClass("wpglobus-snippet_preview"),"snippet-editor-title"==t&&(a.addClass("wpglobus-snippet-editor-title"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),a.val(p("#wpseo-tab-"+s).data("wpseotitle")),a.parent("label").next("progress").addClass(d.yoastTitleProgress).addClass(d.yoastTitleProgress+"_"+s),_.debounce(d.updateProgressBar(a,s),500)),"snippet-editor-slug"==t&&(a.addClass("wpglobus-snippet-editor-slug"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),WPGlobusCoreData.default_language!=s&&a.attr("disabled","disabled")),"snippet-editor-meta-description"==t&&(a.addClass("wpglobus-snippet-editor-meta-description"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),a.val(p("#wpseo-tab-"+s).data("metadesc")),a.parent("label").next("progress").addClass(d.yoastMetadescProgress).addClass(d.yoastMetadescProgress+"_"+s),_.debounce(d.updateProgressBar(a,s),500)),"snippetpreview-help-toggle"==t&&(a.addClass("wpglobus-snippetpreview-help-toggle_"+s),p(document).on("click",".wpglobus-snippetpreview-help-toggle_"+s,function(e){var t=p(this);"none"===p("#snippetpreview-help_"+t.data("language")).css("display")?p("#snippetpreview-help_"+t.data("language")).css({display:"block"}):p("#snippetpreview-help_"+t.data("language")).css({display:"none"})})),"focuskw_text_input-help-toggle"==t&&(a.addClass("wpglobus-focuskw_text_input-help-toggle_"+s),p(document).on("click",".wpglobus-focuskw_text_input-help-toggle_"+s,function(e){var t=p(this);"none"===p("#focuskw_text_input-help_"+t.data("language")).css("display")?p("#focuskw_text_input-help_"+t.data("language")).css({display:"block"}):p("#focuskw_text_input-help_"+t.data("language")).css({display:"none"})})),"pageanalysis-help-toggle"==t&&(a.addClass("wpglobus-pageanalysis-help-toggle_"+s),p(document).on("click",".wpglobus-pageanalysis-help-toggle_"+s,function(e){var t=p(this);"none"===p("#pageanalysis-help_"+t.data("language")).css("display")?p("#pageanalysis-help_"+t.data("language")).css({display:"block"}):p("#pageanalysis-help_"+t.data("language")).css({display:"none"})})),a.attr("id",t+"_"+s),p("#"+t+"_"+s).attr("data-language",s)});var i=WPGlobusCore.TextFilter(p("#yoast_wpseo_focuskw_text_input").val(),s,"RETURN_EMPTY");p("#yoast_wpseo_focuskw_text_input_"+s).val(i),p("#yoast_wpseo_focuskw_"+s).val(i),d.updateWpseoKeyword(i,s),s!==WPGlobusCoreData.default_language&&(p("#"+o+" #yoast_wpseo_focuskw_text_input_"+s).addClass("hidden").after('<div class="wpglobus-suggest" style="font-weight:bold;">'+WPGlobusVendor.i18n.yoastseo_plus_access+"</div>"),p("#"+o+" #wpseo-pageanalysis_"+s).addClass("hidden").css({display:"none"}))}),p(".wpglobus-wpseosnippet").each(function(e,t){var a=p(t),s=a.data("language");a.find("button.snippet-editor__button.snippet-editor__edit-button").addClass(d.editSnippetButtonClass).addClass(d.editSnippetButtonClass+"_"+s).attr("data-language",s),a.find(".snippet-editor__form").addClass(d.editSnippetFormClass).addClass(d.editSnippetFormClass+"_"+s),a.find(".snippet-editor__heading-editor").addClass(d.editSnippetHeadingClass).addClass(d.editSnippetHeadingClass+"_"+s),a.find(".snippet-editor__submit").addClass(d.editSnippetSubmitClass).addClass(d.editSnippetSubmitClass+"_"+s).attr("data-language",s)}),d.iB.addClass("hidden"),d.iB.css({height:0,overflow:"hidden",display:"none"});var e=WPGlobusCore.TextFilter(p("#yoast_wpseo_focuskw_text_input").val(),WPGlobusCoreData.default_language,"RETURN_EMPTY");p("#yoast_wpseo_focuskw_text_input").val(e),p("#yoast_wpseo_focuskw").val(e),p(".wpglobus-wpseo-general .wpseo_tablink").on("click",function(e){e.preventDefault();var t=p(this),a=t.parents("ul").data("language"),s=t.parent("li");a!=WPGlobusCoreData.default_language&&void 0===p(document).triggerHandler("wpglobus_yoast_analysis",{language:a})||(s.hasClass("wpseo_generic_tab")?(p("#wpseo-pageanalysis_"+a).css({display:"none"}),p("#yoast-seo-content-analysis_"+a).css({display:"block"}),p("#wpseo_content_"+a+" table tr").eq(0).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(1).css({display:"none"}),p("#yoast-seo-content-analysis_"+a+" li a").css({float:"none"})):s.hasClass("wpseo_keyword_tab")&&(p("#wpseo-pageanalysis_"+a).css({display:"block"}),p("#yoast-seo-content-analysis_"+a).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(0).css("display",""),p("#wpseo_content_"+a+" table tr").eq(1).css("display","")))}),p(".wpseo-metabox-sidebar .wpseo-meta-section-link").on("click",function(e){"#wpseo-meta-section-content"==p(this).attr("href")?p("#wpglobus-wpseo-tabs").css({display:"block"}):p("#wpglobus-wpseo-tabs").css({display:"none"})}),p("body").on("click","."+d.editSnippetButtonClass,function(e){var t=p(this),a=t.data("language"),s=p("."+d.editSnippetFormClass+"_"+a),o=p("."+d.editSnippetSubmitClass+"_"+a),i=p("."+d.editSnippetHeadingClass+"_"+a);s.hasClass("snippet-editor--hidden")?(s.removeClass("snippet-editor--hidden"),i.removeClass("snippet-editor--hidden"),o.removeClass("snippet-editor--hidden")):(s.addClass("snippet-editor--hidden"),i.addClass("snippet-editor--hidden")),t.addClass("snippet-editor--hidden")}),p("body").on("click","."+d.editSnippetSubmitClass,function(e){var t=p(this).data("language"),a=p("."+d.editSnippetButtonClass+"_"+t),s=p("."+d.editSnippetFormClass+"_"+t),o=p("."+d.editSnippetSubmitClass+"_"+t),i=p("."+d.editSnippetHeadingClass+"_"+t);a.removeClass("snippet-editor--hidden"),s.addClass("snippet-editor--hidden"),o.addClass("snippet-editor--hidden"),i.addClass("snippet-editor--hidden")}),p(document).on("keyup","input.wpglobus-snippet-editor-title",function(e){var t=p(this),a=t.data("language"),s=WPGlobusCore.getString(p('input[name="yoast_wpseo_title"]').val(),t.val(),a);p("#snippet_title_"+a).html(r.replaceVariablesPlugin(t.val())),YoastSEO.app.rawData.pageTitle=s,p('input[name="yoast_wpseo_title"]').val(s),p("#snippet_title").text(s),_.debounce(d.updateProgressBar(t,a),500)}),p(document).on("keyup","input.wpglobus-snippet-editor-slug",function(e){var t=p(this),a=t.data("language");p("#snippet_cite_"+a).text(t.val()+"/"),p("#editable-post-name").text(t.val()),p("#editable-post-name-full").text(t.val())}),p(document).on("change","input.wpglobus-snippet-editor-slug",function(e){var t=p(this);p.post(ajaxurl,{action:"sample-permalink",post_id:p("#post_ID").val()||0,new_slug:t.val(),new_title:p("#title").val(),samplepermalinknonce:p("#samplepermalinknonce").val()})}),p(document).on("keyup","textarea.wpglobus-snippet-editor-meta-description",function(e){var t=p(this),a=t.data("language");p("#snippet_meta_"+a).text(t.val());var s=WPGlobusCore.getString(p("#yoast_wpseo_metadesc").val(),t.val(),t.data("language"));p("#yoast_wpseo_metadesc").val(s),p("#snippet_meta").text(s),_.debounce(d.updateProgressBar(t,a),500)}),p("body").on("click",".wpglobus-post-body-tabs-list li",function(e){var t,a=p(this);a.hasClass("wpglobus-post-tab")&&(p("#wpglobus-wpseo-tabs").tabs("option","active",a.data("order")),t=p("#yoast_wpseo_focuskw_text_input_"+p(this).data("language")).val(),YoastSEO.app.rawData.keyword=t,p("#yoast_wpseo_focuskw_text_input").val(t),p('input[name="yoast_wpseo_focuskw"]').val(t),s.prototype.analyze())}),d.initAddKeywordPopup()}},(s=function(){this.replaceVars=wpseoReplaceVarsL10n.replace_vars,this.language=WPGlobusCoreData.default_language,this.tab=WPGlobusCoreData.default_language,this.wpseoTab=WPGlobusCoreData.default_language,this.title_template=wpseoPostScraperL10n.title_template,this.focuskw=p("#yoast_wpseo_focuskw_text_input"),this.focuskw_hidden=p('input[name="yoast_wpseo_focuskw"]'),this.focuskwKeep=!1,this.post_slug="#editable-post-name-full",YoastSEO.app.registerPlugin("wpglobusYoastSeoPlugin",{status:"ready"}),YoastSEO.app.registerModification("content",this.contentModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("title",this.titleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_title",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_meta",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_page_title",this.pageTitleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_meta_desc",this.metaDescModification,"wpglobusYoastSeoPlugin",0),s.prototype.setScoreIcon(),p(document).on("blur",".wpglobus-snippet_title",function(e){var t=p(this),a=WPGlobusCore.getString(p("#yoast_wpseo_title").val(),t.text(),t.data("language"));YoastSEO.app.rawData.pageTitle=a,p('input[name="yoast_wpseo_title"]').val(a),p("#snippet_title").text(a)}),p(document).on("blur",".wpglobus-snippet_meta",function(e){var t=p(this),a=WPGlobusCore.getString(p("#yoast_wpseo_metadesc").val(),t.text(),t.data("language"));p("#yoast_wpseo_metadesc").val(a),p("#snippet_meta").text(a)}),p(document).on("keyup",".wpglobus-yoast_wpseo_focuskw_text_input",function(e){var t=p(this),a=t.val();r.focuskw.val(a),r.focuskw_hidden.val(a),r.updateWpseoKeyword(a,t.data("language")),s.prototype.analyze()}),p("#publish,#save-post").on("mouseenter",function(e){var a,s="";p(".wpglobus-yoast_wpseo_focuskw_text_input").each(function(e,t){a=p(this),s=WPGlobusCore.getString(s,a.val(),a.data("language"))}),r.focuskw.val(s),r.focuskw_hidden.val(s)}).on("mouseleave",function(e){r.focuskwKeep||(r.wpseoTab=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language"),p(this),r.focuskw.val(p("#yoast_wpseo_focuskw_text_input_"+r.wpseoTab).val()),r.focuskw_hidden.val(p("#yoast_wpseo_focuskw_text_input_"+r.wpseoTab).val()))}).on("click",function(e){r.focuskwKeep=!0}),p(WPGlobusYoastSeo.wpseoTabSelector).on("tabsactivate",function(e,t){var a;r.language=t.newPanel.attr("data-language"),t.newPanel.attr("data-language")===WPGlobusCoreData.default_language&&(a=p("#yoast_wpseo_focuskw_text_input_"+WPGlobusCoreData.default_language).val(),YoastSEO.app.rawData.keyword=a,r.focuskw.val(a),r.focuskw_hidden.val(a)),s.prototype.analyze()}),r=this}).prototype.analyze=function(){var e=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language");e!=WPGlobusCoreData.default_language&&0!=p("#editable-post-name-full-"+e).length?YoastSEO.app.snippetPreview.data.urlPath=p("#editable-post-name-full-"+e).text():YoastSEO.app.snippetPreview.data.urlPath=p("#editable-post-name-full").text(),YoastSEO.app.analyzeTimer(YoastSEO.app),s.prototype.setScoreIcon()},s.prototype.setScoreIcon=function(){var a=setInterval(function(){var e=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language"),t=p("#wpseo-metabox-tabs .wpseo-score-icon").attr("class");"bad"!=(t=t.replace("wpseo-score-icon ",""))&&"ok"!=t&&"good"!=t||(p("#wpseo-metabox-tabs_"+e+" .wpseo-score-icon").removeClass("bad ok good 100"),p("#wpseo-metabox-tabs_"+e+" .wpseo-score-icon").addClass(t),clearInterval(a))},700)},s.prototype.getWPseoTab=function(){return p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language")},s.prototype.citeModification=function(e){var t="#snippet_citeBase_"+e,a="#snippet_cite_"+e,s=p("#wpseo-tab-"+e).data("yoast-cite-base");!1===p("#wpseo-tab-"+e).data("cite-contenteditable")&&p(a).attr("contenteditable","false"),p(t).text(s)},s.prototype.pageTitleModification=function(e){var a,s="#snippet_title_",o="",i="";if(r.title_template==e)p.each(WPGlobusCoreData.enabled_languages,function(e,t){n=p("#snippet-editor-title_"+t).val(),l=0==n.length?r.title_template:n,o=r.replaceVariablesPlugin(l),p(s+t).text(o),t==r.getWPseoTab()&&(i=o)});else{if(a=WPGlobusCore.getTranslations(e),r.getWPseoTab()!==WPGlobusCoreData.default_language&&a[WPGlobusCoreData.default_language]==e){var n,t=r.getWPseoTab(),l=0<(n=p("#snippet-editor-title_"+t).val()).length?n:r.title_template;return l=r.replaceVariablesPlugin(l),p(s+t).text(l),l}p.each(WPGlobusCoreData.enabled_languages,function(e,t){o=""===a[t]?r.replaceVariablesPlugin(r.title_template):r.replaceVariablesPlugin(a[t]),t==r.getWPseoTab()&&(i=o,0!=(n=p("#snippet-editor-title_"+t).val()).length?n!=i&&(i=r.replaceVariablesPlugin(n)):i=r.replaceVariablesPlugin(r.title_template)),p(s+t).html(i)})}return i},s.prototype.metaDescModification=function(a){var s="#snippet_meta_",e=WPGlobusCore.getTranslations(a),t="",o=p("#snippet-editor-meta-description_"+r.getWPseoTab()).val();if(r.getWPseoTab()===WPGlobusCoreData.default_language||e[WPGlobusCoreData.default_language]!=a)return p.each(WPGlobusCoreData.enabled_languages,function(e,t){p(s+t).text(WPGlobusCore.TextFilter(a,t,"RETURN_EMPTY")),r.citeModification(t)}),o==e[r.getWPseoTab()]?0==(t=e[r.getWPseoTab()]).length&&p(s+r.getWPseoTab()).text(WPGlobusCore.TextFilter(YoastSEO.app.snippetPreview.data.metaDesc,WPGlobusCoreData.default_language,"RETURN_EMPTY")):0==(t=o).length?p(s+r.getWPseoTab()).text(WPGlobusCore.TextFilter(YoastSEO.app.snippetPreview.data.metaDesc,WPGlobusCoreData.default_language,"RETURN_EMPTY")):p(s+r.getWPseoTab()).text(t),p(s+r.getWPseoTab()).text(t),t;var i=r.getWPseoTab();return r.citeModification(i),0==o.length?p(s+i).text(""):o!=a&&p(s+i).text(o),a},s.prototype.snippetModification=function(e){return WPGlobusCore.TextFilter(e,r.getWPseoTab(),"RETURN_EMPTY")},s.prototype.contentModification=function(e){return r.getWPseoTab()==WPGlobusCoreData.default_language?e:p("#content_"+r.getWPseoTab()).val()},s.prototype.titleModification=function(e){return setTimeout(r.updatePageAnalysis,1e3),r.getWPseoTab()==WPGlobusCoreData.default_language?e:p("#title_"+r.getWPseoTab()).val()},s.prototype.defaultReplace=function(e){var t=YoastSEO.app.rawData.keyword;return e.replace(/%%sitedesc%%/g,this.replaceVars.sitedesc).replace(/%%sitename%%/g,WPGlobusCore.TextFilter(this.replaceVars.sitename,r.getWPseoTab())).replace(/%%term_title%%/g,this.replaceVars.term_title).replace(/%%term_description%%/g,this.replaceVars.term_description).replace(/%%category_description%%/g,this.replaceVars.category_description).replace(/%%tag_description%%/g,this.replaceVars.tag_description).replace(/%%searchphrase%%/g,this.replaceVars.searchphrase).replace(/%%date%%/g,this.replaceVars.date).replace(/%%id%%/g,this.replaceVars.id).replace(/%%page%%/g,this.replaceVars.page).replace(/%%currenttime%%/g,this.replaceVars.currenttime).replace(/%%currentdate%%/g,this.replaceVars.currentdate).replace(/%%currentday%%/g,this.replaceVars.currentday).replace(/%%currentmonth%%/g,this.replaceVars.currentmonth).replace(/%%currentyear%%/g,this.replaceVars.currentyear).replace(/%%focuskw%%/g,t)},s.prototype.replaceVariablesPlugin=function(e){return void 0!==e&&(e=this.titleReplace(e),e=this.defaultReplace(e),e=this.replaceSeparators(e)),e},s.prototype.replaceSeparators=function(e){return e.replace(/%%sep%%(\s+%%sep%%)*/g,this.replaceVars.sep)},s.prototype.titleReplace=function(e){var t="";return void 0===(t=this.language==WPGlobusCoreData.default_language?p("#title").val():p("#title_"+this.language).val())&&(t=YoastSEO.app.rawData.pageTitle),this.language!=WPGlobusCoreData.default_language&&0==t.length&&(t=p("#title").val()),e=e.replace(/%%title%%/g,t)},s.prototype.doubleSepReplace=function(e){var t=YoastSEO.app.stringHelper.addEscapeChars(this.replaceVars.sep),a=new RegExp(t+" "+t,"g");return e=e.replace(a,this.replaceVars.sep)},s.prototype.updateWpseoKeyword=function(e,t){0<p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").length&&p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").removeClass("wpseo-keyword").addClass("wpglobus-wpseo_keyword_"+t),p(".wpglobus-wpseo_keyword_"+t).text(e)},s.prototype.updatePageAnalysis=function(){p("#wpseo-pageanalysis_"+r.getWPseoTab()).html(p("#wpseo-pageanalysis").html()),p("#yoast-seo-content-analysis_"+r.getWPseoTab()).html(p("#yoast-seo-content-analysis").html()),p("#yoast-seo-content-analysis_"+r.getWPseoTab()+" li a").css({float:"none"})}),window.WPGlobusYoastSeoPlugin=new s)});
|
1 |
+
var WPGlobusYoastSeo;jQuery(document).ready(function(p){"use strict";var r,d,s;"undefined"!=typeof wpseoReplaceVarsL10n&&"undefined"!=typeof WPGlobusCoreData&&"undefined"!=typeof WPGlobusVendor&&("edit-tags.php"==WPGlobusVendor.pagenow||"term.php"==WPGlobusVendor.pagenow?(d=WPGlobusYoastSeo={editorIDs:["description"],editor:{},submitId:"#submit",preventChangeEditor:!1,observer:null,init:function(){d.attachListeners(),_.delay(d.start,1500)},submit:function(e){"mouseenter"===e.type?p.each(d.editor,function(e,t){!d.editor[e].contentEditor||d.editor[e].contentEditor.isHidden()?p("#"+e).val(d.editor[e].content):tinymce.get(e).setContent(d.editor[e].content)}):"mouseleave"===e.type?d.preventChangeEditor||(p.each(d.editor,function(e,t){!d.editor[e].contentEditor||d.editor[e].contentEditor.isHidden()?p("#"+e).val(WPGlobusCore.TextFilter(t.content,d.getCurrentTab(),"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,d.getCurrentTab(),"RETURN_EMPTY"))}),d.preventChangeEditor=!1):"click"===e.type&&(d.preventChangeEditor=!0,"tinymce"!=getUserSetting("editor")&&setUserSetting("editor","tinymce"))},attachListeners:function(){p(".wrap").on("tabsactivate",function(e,a){p.each(d.editor,function(e,t){!d.editor[e].contentEditor||d.editor[e].contentEditor.isHidden()?p("#"+e).val(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY"))})}),p(document).on("mouseenter",d.submitId,d.submit).on("mouseleave",d.submitId,d.submit).on("click",d.submitId,d.submit),p(document).on("tinymce-editor-init",function(e,t){var a;-1!=_.indexOf(d.editorIDs,t.id)&&(a=p("#"+t.id),d.editor[t.id]={},d.editor[t.id].contentEditor=t,d.editor[t.id].content=a.val(),t.setContent(WPGlobusCore.TextFilter(d.editor[t.id].content,WPGlobusCoreData.default_language,"RETURN_EMPTY")),p("#"+t.getContainer().id).find("iframe").addClass("wpglobus-translatable"),a.removeClass("hidden"),t.on("nodechange keyup",_.debounce(d.update,500)),a.on("input keyup",_.debounce(d.update,500)))})},update:function(e){var t;void 0!==e.target&&("tinymce"==(t=e.target.id)&&(t=e.target.dataset.id),void 0!==d.editor[t].contentEditor&&(e=!d.editor[t].contentEditor||d.editor[t].contentEditor.isHidden()?p("#"+t).val():d.editor[t].contentEditor.getContent({format:"raw"}),d.editor[t].content=WPGlobusCore.getString(d.editor[t].content,e,d.getCurrentTab())))},getCurrentTab:function(){return p(".wpglobus-taxonomy-tabs-list .ui-tabs-active").data("language")},start:function(){p(".wpglobus-element_description").css({display:"none"})}},WPGlobusYoastSeo.init(),s=function(){p(".wrap").on("tabsactivate",function(e,t){t.newTab[0].dataset.language==WPGlobusCoreData.default_language?p("#poststuff .inside").css({display:"block"}):p("#poststuff .inside").css({display:"none"})}),p.each(["category_description","sitedesc","sitename","tag_description","term_description","term_title"],function(e,t){wpseoReplaceVarsL10n.replace_vars[t]=WPGlobusCore.TextFilter(wpseoReplaceVarsL10n.replace_vars[t],WPGlobusCoreData.default_language)}),WPGlobusYoastSeo.observer=new MutationObserver(function(e){e.forEach(function(e){"placeholder"==e.attributeName&&(WPGlobusYoastSeo.observer.disconnect(),""==(e=p("#wpseo_focuskw")).val()&&e.attr("placeholder",WPGlobusCore.TextFilter(e.attr("placeholder"),WPGlobusCoreData.default_language)),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0}))})}),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0})}):(d=WPGlobusYoastSeo={wpseoTabSelector:"#wpglobus-wpseo-tabs",url:"",attrs:p("#wpglobus-wpseo-attr"),iB:p("#wpseo-meta-section-content"),t:p("#wpseo-meta-section-content"),ids:"",names:"",editSnippetButtonClass:"wpglobus-snippet-editor__edit-button",editSnippetFormClass:"wpglobus-snippet-editor__form",editSnippetSubmitClass:"wpglobus-snippet-editor__submit",editSnippetHeadingClass:"wpglobus-snippet-editor__heading-editor",yoastTitleProgress:"wpglobus-yoast-title-progress",yoastMetadescProgress:"wpglobus-yoast-metadesc-progress",init:function(){d.start()},initAddKeywordPopup:function(){1===p("#wpseo-add-keyword-popup").length&&p(".wpseo-add-keyword").on("click",d.addKeywordPopup)},addKeywordPopup:function(){var e=p("#wpseo-add-keyword-popup-button").text();tb_show(e,"#TB_inline?width=650&height=350&inlineId=wpseo-add-keyword-popup","group"),jQuery("#TB_window").css("height",235),jQuery("#TB_window").css("width",680)},qtip:function(){p(".yoast_help").qtip({content:{attr:"alt"},position:{my:"bottom left",at:"top center"},style:{tip:{corner:!0},classes:"yoast-qtip qtip-rounded qtip-blue"},show:"click",hide:{fixed:!0,delay:500}})},removeClasses:function(t,e){_.each(e,function(e){t.removeClass(e)})},updateProgressBar:function(e,t){var a,s,o,i,n,l;void 0!==e&&(void 0===t&&void 0===(t="undefined"!==e.data("language")?e.data("language"):t)||(o="",i=l=0,n=!(a=["snippet-editor__progress--bad","snippet-editor__progress--ok","snippet-editor__progress--good"]),l=e.val().length,e.hasClass("wpglobus-snippet-editor-title")?(i=(s=p("progress."+d.yoastTitleProgress+"_"+t)).attr("max"),o=a[2],0==l?o=a[1]:i<l?(o=a[1],n=!0):0<l&&l<35&&(o=a[1])):e.hasClass("wpglobus-snippet-editor-meta-description")&&(i=(s=p("progress."+d.yoastMetadescProgress+"_"+t)).attr("max"),o=a[2],0==l?o=a[1]:i<l?(o=a[1],n=!0):0<l&&l<121&&(o=a[1])),d.removeClasses(s,a),s.attr("value",l).addClass(o),n?e.css("color","#f00"):e.css("color","#000")))},updateWpseoKeyword:function(e,t){p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").text(e)},start:function(){p(d.wpseoTabSelector).tabs(),d.ids=d.attrs.data("ids"),d.names=d.attrs.data("names"),d.ids=d.ids+","+d.attrs.data("qtip"),d.ids=d.ids.split(","),d.names=d.names.split(","),p("#wpglobus-wpseo-tabs").insertBefore(d.iB),p(".wpseo-metabox-tabs").css({height:"26px"}),p(".wpglobus-wpseo-general").each(function(e,t){var a=p(t),s=a.data("language"),t="wpseo-meta-section-content_"+s;a.html('<div id="'+t+'" class="wpseo-meta-section wpglobus-wpseo-meta-section" style="width:100%" data-language="'+s+'">'+d.t.html()+"</div>"),p("#"+t+" .wpseo-metabox-tabs").attr("id","wpseo-metabox-tabs_"+s).attr("data-language",s),p("#"+t+" .wpseotab").attr("id","wpseo_content_"+s),p("#wpseo_content_"+s).css({float:"left"}),p("#"+t).css({display:"block"}),p("#wpseo_meta").css({overflow:"hidden"}),p("#"+t+" .snippet_container").addClass("wpglobus-snippet_container"),s!==WPGlobusCoreData.default_language&&p("#"+t+" .wpseo-add-keyword").addClass("hidden"),p.each(d.names,function(e,t){p("#"+t).attr("name",t+"_"+s)}),p.each(d.ids,function(e,t){var a=p("#"+t);"wpseosnippet"==t&&a.addClass("wpglobus-wpseosnippet"),"snippet_title"==t&&a.addClass("wpglobus-snippet_title"),"snippet_meta"==t&&a.addClass("wpglobus-snippet_meta"),"snippet_cite"==t&&a.addClass("wpglobus-snippet_cite"),"snippet_citeBase"==t&&a.addClass("wpglobus-snippet_citeBase"),"url_container"==t&&a.css({height:"16px"}),"yoast_wpseo_focuskw_text_input"==t&&a.addClass("wpglobus-yoast_wpseo_focuskw_text_input"),"wpseo-pageanalysis"==t&&a.addClass("wpglobus-wpseo-pageanalysis"),"yoast-seo-content-analysis"==t&&a.addClass("wpglobus-yoast-seo-content-analysis"),"snippet_preview"==t&&a.addClass("wpglobus-snippet_preview"),"snippet-editor-title"==t&&(a.addClass("wpglobus-snippet-editor-title"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),a.val(p("#wpseo-tab-"+s).data("wpseotitle")),a.parent("label").next("progress").addClass(d.yoastTitleProgress).addClass(d.yoastTitleProgress+"_"+s),_.debounce(d.updateProgressBar(a,s),500)),"snippet-editor-slug"==t&&(a.addClass("wpglobus-snippet-editor-slug"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),WPGlobusCoreData.default_language!=s&&a.attr("disabled","disabled")),"snippet-editor-meta-description"==t&&(a.addClass("wpglobus-snippet-editor-meta-description"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),a.val(p("#wpseo-tab-"+s).data("metadesc")),a.parent("label").next("progress").addClass(d.yoastMetadescProgress).addClass(d.yoastMetadescProgress+"_"+s),_.debounce(d.updateProgressBar(a,s),500)),"snippetpreview-help-toggle"==t&&(a.addClass("wpglobus-snippetpreview-help-toggle_"+s),p(document).on("click",".wpglobus-snippetpreview-help-toggle_"+s,function(e){var t=p(this);"none"===p("#snippetpreview-help_"+t.data("language")).css("display")?p("#snippetpreview-help_"+t.data("language")).css({display:"block"}):p("#snippetpreview-help_"+t.data("language")).css({display:"none"})})),"focuskw_text_input-help-toggle"==t&&(a.addClass("wpglobus-focuskw_text_input-help-toggle_"+s),p(document).on("click",".wpglobus-focuskw_text_input-help-toggle_"+s,function(e){var t=p(this);"none"===p("#focuskw_text_input-help_"+t.data("language")).css("display")?p("#focuskw_text_input-help_"+t.data("language")).css({display:"block"}):p("#focuskw_text_input-help_"+t.data("language")).css({display:"none"})})),"pageanalysis-help-toggle"==t&&(a.addClass("wpglobus-pageanalysis-help-toggle_"+s),p(document).on("click",".wpglobus-pageanalysis-help-toggle_"+s,function(e){var t=p(this);"none"===p("#pageanalysis-help_"+t.data("language")).css("display")?p("#pageanalysis-help_"+t.data("language")).css({display:"block"}):p("#pageanalysis-help_"+t.data("language")).css({display:"none"})})),a.attr("id",t+"_"+s),p("#"+t+"_"+s).attr("data-language",s)});a=WPGlobusCore.TextFilter(p("#yoast_wpseo_focuskw_text_input").val(),s,"RETURN_EMPTY");p("#yoast_wpseo_focuskw_text_input_"+s).val(a),p("#yoast_wpseo_focuskw_"+s).val(a),d.updateWpseoKeyword(a,s),s!==WPGlobusCoreData.default_language&&(p("#"+t+" #yoast_wpseo_focuskw_text_input_"+s).addClass("hidden").after('<div class="wpglobus-suggest" style="font-weight:bold;">'+WPGlobusVendor.i18n.yoastseo_plus_access+"</div>"),p("#"+t+" #wpseo-pageanalysis_"+s).addClass("hidden").css({display:"none"}))}),p(".wpglobus-wpseosnippet").each(function(e,t){var a=p(t),t=a.data("language");a.find("button.snippet-editor__button.snippet-editor__edit-button").addClass(d.editSnippetButtonClass).addClass(d.editSnippetButtonClass+"_"+t).attr("data-language",t),a.find(".snippet-editor__form").addClass(d.editSnippetFormClass).addClass(d.editSnippetFormClass+"_"+t),a.find(".snippet-editor__heading-editor").addClass(d.editSnippetHeadingClass).addClass(d.editSnippetHeadingClass+"_"+t),a.find(".snippet-editor__submit").addClass(d.editSnippetSubmitClass).addClass(d.editSnippetSubmitClass+"_"+t).attr("data-language",t)}),d.iB.addClass("hidden"),d.iB.css({height:0,overflow:"hidden",display:"none"});var e=WPGlobusCore.TextFilter(p("#yoast_wpseo_focuskw_text_input").val(),WPGlobusCoreData.default_language,"RETURN_EMPTY");p("#yoast_wpseo_focuskw_text_input").val(e),p("#yoast_wpseo_focuskw").val(e),p(".wpglobus-wpseo-general .wpseo_tablink").on("click",function(e){e.preventDefault();var t=p(this),e=t.parents("ul").data("language"),t=t.parent("li");e!=WPGlobusCoreData.default_language&&void 0===p(document).triggerHandler("wpglobus_yoast_analysis",{language:e})||(t.hasClass("wpseo_generic_tab")?(p("#wpseo-pageanalysis_"+e).css({display:"none"}),p("#yoast-seo-content-analysis_"+e).css({display:"block"}),p("#wpseo_content_"+e+" table tr").eq(0).css({display:"none"}),p("#wpseo_content_"+e+" table tr").eq(1).css({display:"none"}),p("#yoast-seo-content-analysis_"+e+" li a").css({float:"none"})):t.hasClass("wpseo_keyword_tab")&&(p("#wpseo-pageanalysis_"+e).css({display:"block"}),p("#yoast-seo-content-analysis_"+e).css({display:"none"}),p("#wpseo_content_"+e+" table tr").eq(0).css("display",""),p("#wpseo_content_"+e+" table tr").eq(1).css("display","")))}),p(".wpseo-metabox-sidebar .wpseo-meta-section-link").on("click",function(e){"#wpseo-meta-section-content"==p(this).attr("href")?p("#wpglobus-wpseo-tabs").css({display:"block"}):p("#wpglobus-wpseo-tabs").css({display:"none"})}),p("body").on("click","."+d.editSnippetButtonClass,function(e){var t=p(this),a=t.data("language"),s=p("."+d.editSnippetFormClass+"_"+a),o=p("."+d.editSnippetSubmitClass+"_"+a),a=p("."+d.editSnippetHeadingClass+"_"+a);s.hasClass("snippet-editor--hidden")?(s.removeClass("snippet-editor--hidden"),a.removeClass("snippet-editor--hidden"),o.removeClass("snippet-editor--hidden")):(s.addClass("snippet-editor--hidden"),a.addClass("snippet-editor--hidden")),t.addClass("snippet-editor--hidden")}),p("body").on("click","."+d.editSnippetSubmitClass,function(e){var t=p(this).data("language"),a=p("."+d.editSnippetButtonClass+"_"+t),s=p("."+d.editSnippetFormClass+"_"+t),o=p("."+d.editSnippetSubmitClass+"_"+t),t=p("."+d.editSnippetHeadingClass+"_"+t);a.removeClass("snippet-editor--hidden"),s.addClass("snippet-editor--hidden"),o.addClass("snippet-editor--hidden"),t.addClass("snippet-editor--hidden")}),p(document).on("keyup","input.wpglobus-snippet-editor-title",function(e){var t=p(this),a=t.data("language"),s=WPGlobusCore.getString(p('input[name="yoast_wpseo_title"]').val(),t.val(),a);p("#snippet_title_"+a).html(r.replaceVariablesPlugin(t.val())),YoastSEO.app.rawData.pageTitle=s,p('input[name="yoast_wpseo_title"]').val(s),p("#snippet_title").text(s),_.debounce(d.updateProgressBar(t,a),500)}),p(document).on("keyup","input.wpglobus-snippet-editor-slug",function(e){var t=p(this),a=t.data("language");p("#snippet_cite_"+a).text(t.val()+"/"),p("#editable-post-name").text(t.val()),p("#editable-post-name-full").text(t.val())}),p(document).on("change","input.wpglobus-snippet-editor-slug",function(e){var t=p(this);p.post(ajaxurl,{action:"sample-permalink",post_id:p("#post_ID").val()||0,new_slug:t.val(),new_title:p("#title").val(),samplepermalinknonce:p("#samplepermalinknonce").val()})}),p(document).on("keyup","textarea.wpglobus-snippet-editor-meta-description",function(e){var t=p(this),a=t.data("language");p("#snippet_meta_"+a).text(t.val());var s=WPGlobusCore.getString(p("#yoast_wpseo_metadesc").val(),t.val(),t.data("language"));p("#yoast_wpseo_metadesc").val(s),p("#snippet_meta").text(s),_.debounce(d.updateProgressBar(t,a),500)}),p("body").on("click",".wpglobus-post-body-tabs-list li",function(e){var t=p(this);t.hasClass("wpglobus-post-tab")&&(p("#wpglobus-wpseo-tabs").tabs("option","active",t.data("order")),t=p("#yoast_wpseo_focuskw_text_input_"+p(this).data("language")).val(),YoastSEO.app.rawData.keyword=t,p("#yoast_wpseo_focuskw_text_input").val(t),p('input[name="yoast_wpseo_focuskw"]').val(t),s.prototype.analyze())}),d.initAddKeywordPopup()}},(s=function(){this.replaceVars=wpseoReplaceVarsL10n.replace_vars,this.language=WPGlobusCoreData.default_language,this.tab=WPGlobusCoreData.default_language,this.wpseoTab=WPGlobusCoreData.default_language,this.title_template=wpseoPostScraperL10n.title_template,this.focuskw=p("#yoast_wpseo_focuskw_text_input"),this.focuskw_hidden=p('input[name="yoast_wpseo_focuskw"]'),this.focuskwKeep=!1,this.post_slug="#editable-post-name-full",YoastSEO.app.registerPlugin("wpglobusYoastSeoPlugin",{status:"ready"}),YoastSEO.app.registerModification("content",this.contentModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("title",this.titleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_title",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_meta",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_page_title",this.pageTitleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_meta_desc",this.metaDescModification,"wpglobusYoastSeoPlugin",0),s.prototype.setScoreIcon(),p(document).on("blur",".wpglobus-snippet_title",function(e){var t=p(this),t=WPGlobusCore.getString(p("#yoast_wpseo_title").val(),t.text(),t.data("language"));YoastSEO.app.rawData.pageTitle=t,p('input[name="yoast_wpseo_title"]').val(t),p("#snippet_title").text(t)}),p(document).on("blur",".wpglobus-snippet_meta",function(e){var t=p(this),t=WPGlobusCore.getString(p("#yoast_wpseo_metadesc").val(),t.text(),t.data("language"));p("#yoast_wpseo_metadesc").val(t),p("#snippet_meta").text(t)}),p(document).on("keyup",".wpglobus-yoast_wpseo_focuskw_text_input",function(e){var t=p(this),a=t.val();r.focuskw.val(a),r.focuskw_hidden.val(a),r.updateWpseoKeyword(a,t.data("language")),s.prototype.analyze()}),p("#publish,#save-post").on("mouseenter",function(e){var a,s="";p(".wpglobus-yoast_wpseo_focuskw_text_input").each(function(e,t){a=p(this),s=WPGlobusCore.getString(s,a.val(),a.data("language"))}),r.focuskw.val(s),r.focuskw_hidden.val(s)}).on("mouseleave",function(e){r.focuskwKeep||(r.wpseoTab=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language"),p(this),r.focuskw.val(p("#yoast_wpseo_focuskw_text_input_"+r.wpseoTab).val()),r.focuskw_hidden.val(p("#yoast_wpseo_focuskw_text_input_"+r.wpseoTab).val()))}).on("click",function(e){r.focuskwKeep=!0}),p(WPGlobusYoastSeo.wpseoTabSelector).on("tabsactivate",function(e,t){r.language=t.newPanel.attr("data-language"),t.newPanel.attr("data-language")===WPGlobusCoreData.default_language&&(t=p("#yoast_wpseo_focuskw_text_input_"+WPGlobusCoreData.default_language).val(),YoastSEO.app.rawData.keyword=t,r.focuskw.val(t),r.focuskw_hidden.val(t)),s.prototype.analyze()}),r=this}).prototype.analyze=function(){var e=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language");e!=WPGlobusCoreData.default_language&&0!=p("#editable-post-name-full-"+e).length?YoastSEO.app.snippetPreview.data.urlPath=p("#editable-post-name-full-"+e).text():YoastSEO.app.snippetPreview.data.urlPath=p("#editable-post-name-full").text(),YoastSEO.app.analyzeTimer(YoastSEO.app),s.prototype.setScoreIcon()},s.prototype.setScoreIcon=function(){var a=setInterval(function(){var e=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language"),t=p("#wpseo-metabox-tabs .wpseo-score-icon").attr("class");"bad"!=(t=t.replace("wpseo-score-icon ",""))&&"ok"!=t&&"good"!=t||(p("#wpseo-metabox-tabs_"+e+" .wpseo-score-icon").removeClass("bad ok good 100"),p("#wpseo-metabox-tabs_"+e+" .wpseo-score-icon").addClass(t),clearInterval(a))},700)},s.prototype.getWPseoTab=function(){return p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language")},s.prototype.citeModification=function(e){var t="#snippet_citeBase_"+e,a="#snippet_cite_"+e,s=p("#wpseo-tab-"+e).data("yoast-cite-base");!1===p("#wpseo-tab-"+e).data("cite-contenteditable")&&p(a).attr("contenteditable","false"),p(t).text(s)},s.prototype.pageTitleModification=function(e){var a,s="#snippet_title_",o="",i="";if(r.title_template==e)p.each(WPGlobusCoreData.enabled_languages,function(e,t){n=p("#snippet-editor-title_"+t).val(),l=0==n.length?r.title_template:n,o=r.replaceVariablesPlugin(l),p(s+t).text(o),t==r.getWPseoTab()&&(i=o)});else{if(a=WPGlobusCore.getTranslations(e),r.getWPseoTab()!==WPGlobusCoreData.default_language&&a[WPGlobusCoreData.default_language]==e){var n,e=r.getWPseoTab(),l=0<(n=p("#snippet-editor-title_"+e).val()).length?n:r.title_template;return l=r.replaceVariablesPlugin(l),p(s+e).text(l),l}p.each(WPGlobusCoreData.enabled_languages,function(e,t){o=""===a[t]?r.replaceVariablesPlugin(r.title_template):r.replaceVariablesPlugin(a[t]),t==r.getWPseoTab()&&(i=o,0!=(n=p("#snippet-editor-title_"+t).val()).length?n!=i&&(i=r.replaceVariablesPlugin(n)):i=r.replaceVariablesPlugin(r.title_template)),p(s+t).html(i)})}return i},s.prototype.metaDescModification=function(a){var s="#snippet_meta_",e=WPGlobusCore.getTranslations(a),t="",o=p("#snippet-editor-meta-description_"+r.getWPseoTab()).val();if(r.getWPseoTab()===WPGlobusCoreData.default_language||e[WPGlobusCoreData.default_language]!=a)return p.each(WPGlobusCoreData.enabled_languages,function(e,t){p(s+t).text(WPGlobusCore.TextFilter(a,t,"RETURN_EMPTY")),r.citeModification(t)}),o==e[r.getWPseoTab()]?0==(t=e[r.getWPseoTab()]).length&&p(s+r.getWPseoTab()).text(WPGlobusCore.TextFilter(YoastSEO.app.snippetPreview.data.metaDesc,WPGlobusCoreData.default_language,"RETURN_EMPTY")):0==(t=o).length?p(s+r.getWPseoTab()).text(WPGlobusCore.TextFilter(YoastSEO.app.snippetPreview.data.metaDesc,WPGlobusCoreData.default_language,"RETURN_EMPTY")):p(s+r.getWPseoTab()).text(t),p(s+r.getWPseoTab()).text(t),t;t=r.getWPseoTab();return r.citeModification(t),0==o.length?p(s+t).text(""):o!=a&&p(s+t).text(o),a},s.prototype.snippetModification=function(e){return WPGlobusCore.TextFilter(e,r.getWPseoTab(),"RETURN_EMPTY")},s.prototype.contentModification=function(e){return r.getWPseoTab()==WPGlobusCoreData.default_language?e:p("#content_"+r.getWPseoTab()).val()},s.prototype.titleModification=function(e){return setTimeout(r.updatePageAnalysis,1e3),r.getWPseoTab()==WPGlobusCoreData.default_language?e:p("#title_"+r.getWPseoTab()).val()},s.prototype.defaultReplace=function(e){var t=YoastSEO.app.rawData.keyword;return e.replace(/%%sitedesc%%/g,this.replaceVars.sitedesc).replace(/%%sitename%%/g,WPGlobusCore.TextFilter(this.replaceVars.sitename,r.getWPseoTab())).replace(/%%term_title%%/g,this.replaceVars.term_title).replace(/%%term_description%%/g,this.replaceVars.term_description).replace(/%%category_description%%/g,this.replaceVars.category_description).replace(/%%tag_description%%/g,this.replaceVars.tag_description).replace(/%%searchphrase%%/g,this.replaceVars.searchphrase).replace(/%%date%%/g,this.replaceVars.date).replace(/%%id%%/g,this.replaceVars.id).replace(/%%page%%/g,this.replaceVars.page).replace(/%%currenttime%%/g,this.replaceVars.currenttime).replace(/%%currentdate%%/g,this.replaceVars.currentdate).replace(/%%currentday%%/g,this.replaceVars.currentday).replace(/%%currentmonth%%/g,this.replaceVars.currentmonth).replace(/%%currentyear%%/g,this.replaceVars.currentyear).replace(/%%focuskw%%/g,t)},s.prototype.replaceVariablesPlugin=function(e){return void 0!==e&&(e=this.titleReplace(e),e=this.defaultReplace(e),e=this.replaceSeparators(e)),e},s.prototype.replaceSeparators=function(e){return e.replace(/%%sep%%(\s+%%sep%%)*/g,this.replaceVars.sep)},s.prototype.titleReplace=function(e){var t="";return void 0===(t=(this.language==WPGlobusCoreData.default_language?p("#title"):p("#title_"+this.language)).val())&&(t=YoastSEO.app.rawData.pageTitle),this.language!=WPGlobusCoreData.default_language&&0==t.length&&(t=p("#title").val()),e=e.replace(/%%title%%/g,t)},s.prototype.doubleSepReplace=function(e){var t=YoastSEO.app.stringHelper.addEscapeChars(this.replaceVars.sep),t=new RegExp(t+" "+t,"g");return e=e.replace(t,this.replaceVars.sep)},s.prototype.updateWpseoKeyword=function(e,t){0<p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").length&&p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").removeClass("wpseo-keyword").addClass("wpglobus-wpseo_keyword_"+t),p(".wpglobus-wpseo_keyword_"+t).text(e)},s.prototype.updatePageAnalysis=function(){p("#wpseo-pageanalysis_"+r.getWPseoTab()).html(p("#wpseo-pageanalysis").html()),p("#yoast-seo-content-analysis_"+r.getWPseoTab()).html(p("#yoast-seo-content-analysis").html()),p("#yoast-seo-content-analysis_"+r.getWPseoTab()+" li a").css({float:"none"})}),window.WPGlobusYoastSeoPlugin=new s)});
|
includes/js/wpglobus-yoastseo-38.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var WPGlobusYoastSeo;jQuery(document).ready(function(l){"use strict";var r,d,s;"undefined"!=typeof wpseoReplaceVarsL10n&&"undefined"!=typeof WPGlobusCoreData&&"undefined"!=typeof WPGlobusVendor&&("edit-tags.php"==WPGlobusVendor.pagenow||"term.php"==WPGlobusVendor.pagenow?(d=WPGlobusYoastSeo={editorIDs:["description"],editor:{},submitId:"#submit",preventChangeEditor:!1,observer:null,init:function(){d.attachListeners(),_.delay(d.start,1500)},submit:function(e){"mouseenter"===e.type?l.each(d.editor,function(e,t){!d.editor[e].contentEditor||d.editor[e].contentEditor.isHidden()?l("#"+e).val(d.editor[e].content):tinymce.get(e).setContent(d.editor[e].content)}):"mouseleave"===e.type?d.preventChangeEditor||(l.each(d.editor,function(e,t){!d.editor[e].contentEditor||d.editor[e].contentEditor.isHidden()?l("#"+e).val(WPGlobusCore.TextFilter(t.content,d.getCurrentTab(),"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,d.getCurrentTab(),"RETURN_EMPTY"))}),d.preventChangeEditor=!1):"click"===e.type&&(d.preventChangeEditor=!0,"tinymce"!=getUserSetting("editor")&&setUserSetting("editor","tinymce"))},attachListeners:function(){l(".wrap").on("tabsactivate",function(e,a){l.each(d.editor,function(e,t){!d.editor[e].contentEditor||d.editor[e].contentEditor.isHidden()?l("#"+e).val(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY"))})}),l(document).on("mouseenter",d.submitId,d.submit).on("mouseleave",d.submitId,d.submit).on("click",d.submitId,d.submit),l(document).on("tinymce-editor-init",function(e,t){var a;-1!=_.indexOf(d.editorIDs,t.id)&&(a=l("#"+t.id),d.editor[t.id]={},d.editor[t.id].contentEditor=t,d.editor[t.id].content=a.val(),t.setContent(WPGlobusCore.TextFilter(d.editor[t.id].content,WPGlobusCoreData.default_language,"RETURN_EMPTY")),l("#"+t.getContainer().id).find("iframe").addClass("wpglobus-translatable"),a.removeClass("hidden"),t.on("nodechange keyup",_.debounce(d.update,500)),a.on("input keyup",_.debounce(d.update,500)))})},update:function(e){var t,a;void 0!==e.target&&("tinymce"==(t=e.target.id)&&(t=e.target.dataset.id),void 0!==d.editor[t].contentEditor&&(a=!d.editor[t].contentEditor||d.editor[t].contentEditor.isHidden()?l("#"+t).val():d.editor[t].contentEditor.getContent({format:"raw"}),d.editor[t].content=WPGlobusCore.getString(d.editor[t].content,a,d.getCurrentTab())))},getCurrentTab:function(){return l(".wpglobus-taxonomy-tabs-list .ui-tabs-active").data("language")},start:function(){l(".wpglobus-element_description").css({display:"none"})}},WPGlobusYoastSeo.init(),s=function(){l(".wrap").on("tabsactivate",function(e,t){t.newTab[0].dataset.language==WPGlobusCoreData.default_language?l("#poststuff .inside").css({display:"block"}):l("#poststuff .inside").css({display:"none"})}),l.each(["category_description","sitedesc","sitename","tag_description","term_description","term_title"],function(e,t){wpseoReplaceVarsL10n.replace_vars[t]=WPGlobusCore.TextFilter(wpseoReplaceVarsL10n.replace_vars[t],WPGlobusCoreData.default_language)}),WPGlobusYoastSeo.observer=new MutationObserver(function(e){e.forEach(function(e){var t;"placeholder"==e.attributeName&&(WPGlobusYoastSeo.observer.disconnect(),""==(t=l("#wpseo_focuskw")).val()&&t.attr("placeholder",WPGlobusCore.TextFilter(t.attr("placeholder"),WPGlobusCoreData.default_language)),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0}))})}),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0})}):(d=WPGlobusYoastSeo={wpseoTabSelector:"#wpglobus-wpseo-tabs",url:"",attrs:l("#wpglobus-wpseo-attr"),iB:l("#wpseo-meta-section-content"),t:l("#wpseo-meta-section-content"),ids:"",names:"",editSnippetButtonClass:"wpglobus-snippet-editor__edit-button",editSnippetFormClass:"wpglobus-snippet-editor__form",editSnippetSubmitClass:"wpglobus-snippet-editor__submit",editSnippetHeadingClass:"wpglobus-snippet-editor__heading-editor",yoastTitleProgress:"wpglobus-yoast-title-progress",yoastMetadescProgress:"wpglobus-yoast-metadesc-progress",init:function(){d.start()},initAddKeywordPopup:function(){1===l("#wpseo-add-keyword-popup").length&&l(".wpseo-add-keyword").on("click",d.addKeywordPopup)},addKeywordPopup:function(){var e=l("#wpseo-add-keyword-popup-button").text();tb_show(e,"#TB_inline?width=650&height=350&inlineId=wpseo-add-keyword-popup","group"),jQuery("#TB_window").css("height",235),jQuery("#TB_window").css("width",680)},qtip:function(){l(".yoast_help").qtip({content:{attr:"alt"},position:{my:"bottom left",at:"top center"},style:{tip:{corner:!0},classes:"yoast-qtip qtip-rounded qtip-blue"},show:"click",hide:{fixed:!0,delay:500}})},removeClasses:function(t,e){_.each(e,function(e){t.removeClass(e)})},updateProgressBar:function(e,t){var a,s,o,i,n,p;void 0!==e&&(void 0===t&&("undefined"!==e.data("language")&&(t=e.data("language")),void 0===t)||(o="",i=p=0,n=!(a=["snippet-editor__progress--bad","snippet-editor__progress--ok","snippet-editor__progress--good"]),p=e.val().length,e.hasClass("wpglobus-snippet-editor-title")?(i=(s=l("progress."+d.yoastTitleProgress+"_"+t)).attr("max"),o=a[2],0==p?o=a[1]:i<p?(o=a[1],n=!0):0<p&&p<35&&(o=a[1])):e.hasClass("wpglobus-snippet-editor-meta-description")&&(i=(s=l("progress."+d.yoastMetadescProgress+"_"+t)).attr("max"),o=a[2],0==p?o=a[1]:i<p?(o=a[1],n=!0):0<p&&p<121&&(o=a[1])),d.removeClasses(s,a),s.attr("value",p).addClass(o),n?e.css("color","#f00"):e.css("color","#000")))},updateWpseoKeyword:function(e,t){l("#wpseo-meta-section-content_"+t+" .wpseo-keyword").text(e)},start:function(){l(d.wpseoTabSelector).tabs(),d.ids=d.attrs.data("ids"),d.names=d.attrs.data("names"),d.ids=d.ids+","+d.attrs.data("qtip"),d.ids=d.ids.split(","),d.names=d.names.split(","),l("#wpglobus-wpseo-tabs").insertBefore(d.iB),l(".wpseo-metabox-tabs").css({height:"26px"}),l(".wpglobus-wpseo-general").each(function(e,t){var a=l(t),s=a.data("language"),o="wpseo-meta-section-content_"+s;a.html('<div id="'+o+'" class="wpseo-meta-section wpglobus-wpseo-meta-section" style="width:100%" data-language="'+s+'">'+d.t.html()+"</div>"),l("#"+o+" .wpseo-metabox-tabs").attr("id","wpseo-metabox-tabs_"+s).attr("data-language",s),l("#"+o+" .wpseotab").attr("id","wpseo_content_"+s),l("#wpseo_content_"+s).css({float:"left"}),l("#"+o).css({display:"block"}),l("#wpseo_meta").css({overflow:"hidden"}),l("#"+o+" .snippet_container").addClass("wpglobus-snippet_container"),s!==WPGlobusCoreData.default_language&&l("#"+o+" .wpseo-add-keyword").addClass("hidden"),l.each(d.names,function(e,t){l("#"+t).attr("name",t+"_"+s)}),l.each(d.ids,function(e,t){var a=l("#"+t);"wpseosnippet"==t&&a.addClass("wpglobus-wpseosnippet"),"snippet_title"==t&&a.addClass("wpglobus-snippet_title"),"snippet_meta"==t&&a.addClass("wpglobus-snippet_meta"),"snippet_cite"==t&&a.addClass("wpglobus-snippet_cite"),"snippet_citeBase"==t&&a.addClass("wpglobus-snippet_citeBase"),"url_container"==t&&a.css({height:"16px"}),"yoast_wpseo_focuskw_text_input"==t&&a.addClass("wpglobus-yoast_wpseo_focuskw_text_input"),"wpseo-pageanalysis"==t&&a.addClass("wpglobus-wpseo-pageanalysis"),"yoast-seo-content-analysis"==t&&a.addClass("wpglobus-yoast-seo-content-analysis"),"snippet_preview"==t&&a.addClass("wpglobus-snippet_preview"),"snippet-editor-title"==t&&(a.addClass("wpglobus-snippet-editor-title"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),a.val(l("#wpseo-tab-"+s).data("wpseotitle")),a.parent("label").next("progress").addClass(d.yoastTitleProgress).addClass(d.yoastTitleProgress+"_"+s),_.debounce(d.updateProgressBar(a,s),500)),"snippet-editor-slug"==t&&(a.addClass("wpglobus-snippet-editor-slug"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),WPGlobusCoreData.default_language!=s&&a.attr("disabled","disabled")),"snippet-editor-meta-description"==t&&(a.addClass("wpglobus-snippet-editor-meta-description"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),a.val(l("#wpseo-tab-"+s).data("metadesc")),a.parent("label").next("progress").addClass(d.yoastMetadescProgress).addClass(d.yoastMetadescProgress+"_"+s),_.debounce(d.updateProgressBar(a,s),500)),"snippetpreview-help-toggle"==t&&(a.addClass("wpglobus-snippetpreview-help-toggle_"+s),l(document).on("click",".wpglobus-snippetpreview-help-toggle_"+s,function(e){var t=l(this);"none"===l("#snippetpreview-help_"+t.data("language")).css("display")?l("#snippetpreview-help_"+t.data("language")).css({display:"block"}):l("#snippetpreview-help_"+t.data("language")).css({display:"none"})})),"focuskw_text_input-help-toggle"==t&&(a.addClass("wpglobus-focuskw_text_input-help-toggle_"+s),l(document).on("click",".wpglobus-focuskw_text_input-help-toggle_"+s,function(e){var t=l(this);"none"===l("#focuskw_text_input-help_"+t.data("language")).css("display")?l("#focuskw_text_input-help_"+t.data("language")).css({display:"block"}):l("#focuskw_text_input-help_"+t.data("language")).css({display:"none"})})),"pageanalysis-help-toggle"==t&&(a.addClass("wpglobus-pageanalysis-help-toggle_"+s),l(document).on("click",".wpglobus-pageanalysis-help-toggle_"+s,function(e){var t=l(this);"none"===l("#pageanalysis-help_"+t.data("language")).css("display")?l("#pageanalysis-help_"+t.data("language")).css({display:"block"}):l("#pageanalysis-help_"+t.data("language")).css({display:"none"})})),a.attr("id",t+"_"+s),l("#"+t+"_"+s).attr("data-language",s)});var i=WPGlobusCore.TextFilter(l("#yoast_wpseo_focuskw_text_input").val(),s,"RETURN_EMPTY");l("#yoast_wpseo_focuskw_text_input_"+s).val(i),l("#yoast_wpseo_focuskw_"+s).val(i),d.updateWpseoKeyword(i,s),s!==WPGlobusCoreData.default_language&&(l("#"+o+" #yoast_wpseo_focuskw_text_input_"+s).addClass("hidden").after('<div class="wpglobus-suggest" style="font-weight:bold;">'+WPGlobusVendor.i18n.yoastseo_plus_access+"</div>"),l("#"+o+" #wpseo-pageanalysis_"+s).addClass("hidden").css({display:"none"}))}),l(".wpglobus-wpseosnippet").each(function(e,t){var a=l(t),s=a.data("language");a.find("button.snippet-editor__button.snippet-editor__edit-button").addClass(d.editSnippetButtonClass).addClass(d.editSnippetButtonClass+"_"+s).attr("data-language",s),a.find(".snippet-editor__form").addClass(d.editSnippetFormClass).addClass(d.editSnippetFormClass+"_"+s),a.find(".snippet-editor__heading-editor").addClass(d.editSnippetHeadingClass).addClass(d.editSnippetHeadingClass+"_"+s),a.find(".snippet-editor__submit").addClass(d.editSnippetSubmitClass).addClass(d.editSnippetSubmitClass+"_"+s).attr("data-language",s)}),d.iB.addClass("hidden"),d.iB.css({height:0,overflow:"hidden",display:"none"});var e=WPGlobusCore.TextFilter(l("#yoast_wpseo_focuskw_text_input").val(),WPGlobusCoreData.default_language,"RETURN_EMPTY");l("#yoast_wpseo_focuskw_text_input").val(e),l("#yoast_wpseo_focuskw").val(e),l(".wpglobus-wpseo-general .wpseo_tablink").on("click",function(e){e.preventDefault();var t=l(this),a=t.parents("ul").data("language"),s=t.parent("li");a!=WPGlobusCoreData.default_language&&void 0===l(document).triggerHandler("wpglobus_yoast_analysis",{language:a})||(s.hasClass("wpseo_generic_tab")?(l("#wpseo-pageanalysis_"+a).css({display:"none"}),l("#yoast-seo-content-analysis_"+a).css({display:"block"}),l("#wpseo_content_"+a+" table tr").eq(0).css({display:"none"}),l("#wpseo_content_"+a+" table tr").eq(1).css({display:"none"}),l("#yoast-seo-content-analysis_"+a+" li a").css({float:"none"})):s.hasClass("wpseo_keyword_tab")&&(l("#wpseo-pageanalysis_"+a).css({display:"block"}),l("#yoast-seo-content-analysis_"+a).css({display:"none"}),l("#wpseo_content_"+a+" table tr").eq(0).css("display",""),l("#wpseo_content_"+a+" table tr").eq(1).css("display","")))}),l(".wpseo-metabox-sidebar .wpseo-meta-section-link").on("click",function(e){"#wpseo-meta-section-content"==l(this).attr("href")?l("#wpglobus-wpseo-tabs").css({display:"block"}):l("#wpglobus-wpseo-tabs").css({display:"none"})}),l("body").on("click","."+d.editSnippetButtonClass,function(e){var t=l(this),a=t.data("language"),s=l("."+d.editSnippetFormClass+"_"+a),o=l("."+d.editSnippetSubmitClass+"_"+a),i=l("."+d.editSnippetHeadingClass+"_"+a);s.hasClass("snippet-editor--hidden")?(s.removeClass("snippet-editor--hidden"),i.removeClass("snippet-editor--hidden"),o.removeClass("snippet-editor--hidden")):(s.addClass("snippet-editor--hidden"),i.addClass("snippet-editor--hidden")),t.addClass("snippet-editor--hidden")}),l("body").on("click","."+d.editSnippetSubmitClass,function(e){var t=l(this).data("language"),a=l("."+d.editSnippetButtonClass+"_"+t),s=l("."+d.editSnippetFormClass+"_"+t),o=l("."+d.editSnippetSubmitClass+"_"+t),i=l("."+d.editSnippetHeadingClass+"_"+t);a.removeClass("snippet-editor--hidden"),s.addClass("snippet-editor--hidden"),o.addClass("snippet-editor--hidden"),i.addClass("snippet-editor--hidden")}),l(document).on("keyup","input.wpglobus-snippet-editor-title",function(e){var t=l(this),a=t.data("language"),s=WPGlobusCore.getString(l('input[name="yoast_wpseo_title"]').val(),t.val(),a);l("#snippet_title_"+a).html(r.replaceVariablesPlugin(t.val())),YoastSEO.app.rawData.pageTitle=s,l('input[name="yoast_wpseo_title"]').val(s),l("#snippet_title").text(s),_.debounce(d.updateProgressBar(t,a),500)}),l(document).on("keyup","input.wpglobus-snippet-editor-slug",function(e){var t=l(this),a=t.data("language");l("#snippet_cite_"+a).text(t.val()+"/"),l("#editable-post-name").text(t.val()),l("#editable-post-name-full").text(t.val())}),l(document).on("change","input.wpglobus-snippet-editor-slug",function(e){var t=l(this);l.post(ajaxurl,{action:"sample-permalink",post_id:l("#post_ID").val()||0,new_slug:t.val(),new_title:l("#title").val(),samplepermalinknonce:l("#samplepermalinknonce").val()})}),l(document).on("keyup","textarea.wpglobus-snippet-editor-meta-description",function(e){var t=l(this),a=t.data("language");l("#snippet_meta_"+a).text(t.val());var s=WPGlobusCore.getString(l("#yoast_wpseo_metadesc").val(),t.val(),t.data("language"));l("#yoast_wpseo_metadesc").val(s),l("#snippet_meta").text(s),_.debounce(d.updateProgressBar(t,a),500)}),l("body").on("click",".wpglobus-post-body-tabs-list li",function(e){var t,a=l(this);a.hasClass("wpglobus-post-tab")&&(l("#wpglobus-wpseo-tabs").tabs("option","active",a.data("order")),t=l("#yoast_wpseo_focuskw_text_input_"+l(this).data("language")).val(),YoastSEO.app.rawData.keyword=t,l("#yoast_wpseo_focuskw_text_input").val(t),l('input[name="yoast_wpseo_focuskw"]').val(t),s.prototype.analyze())}),d.initAddKeywordPopup()}},(s=function(){this.replaceVars=wpseoReplaceVarsL10n.replace_vars,this.language=WPGlobusCoreData.default_language,this.tab=WPGlobusCoreData.default_language,this.wpseoTab=WPGlobusCoreData.default_language,this.title_template=wpseoPostScraperL10n.title_template,this.focuskw=l("#yoast_wpseo_focuskw_text_input"),this.focuskw_hidden=l('input[name="yoast_wpseo_focuskw"]'),this.focuskwKeep=!1,this.post_slug="#editable-post-name-full",YoastSEO.app.registerPlugin("wpglobusYoastSeoPlugin",{status:"ready"}),YoastSEO.app.registerModification("content",this.contentModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("title",this.titleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_title",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_meta",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_page_title",this.pageTitleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_meta_desc",this.metaDescModification,"wpglobusYoastSeoPlugin",0),s.prototype.setScoreIcon(),l(document).on("blur",".wpglobus-snippet_title",function(e){var t=l(this),a=WPGlobusCore.getString(l("#yoast_wpseo_title").val(),t.text(),t.data("language"));YoastSEO.app.rawData.pageTitle=a,l('input[name="yoast_wpseo_title"]').val(a),l("#snippet_title").text(a)}),l(document).on("blur",".wpglobus-snippet_meta",function(e){var t=l(this),a=WPGlobusCore.getString(l("#yoast_wpseo_metadesc").val(),t.text(),t.data("language"));l("#yoast_wpseo_metadesc").val(a),l("#snippet_meta").text(a)}),l(document).on("keyup",".wpglobus-yoast_wpseo_focuskw_text_input",function(e){var t=l(this),a=t.val();r.focuskw.val(a),r.focuskw_hidden.val(a),r.updateWpseoKeyword(a,t.data("language")),s.prototype.analyze()}),l("#publish,#save-post").on("mouseenter",function(e){var a,s="";l(".wpglobus-yoast_wpseo_focuskw_text_input").each(function(e,t){a=l(this),s=WPGlobusCore.getString(s,a.val(),a.data("language"))}),r.focuskw.val(s),r.focuskw_hidden.val(s)}).on("mouseleave",function(e){r.focuskwKeep||(r.wpseoTab=l(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language"),l(this),r.focuskw.val(l("#yoast_wpseo_focuskw_text_input_"+r.wpseoTab).val()),r.focuskw_hidden.val(l("#yoast_wpseo_focuskw_text_input_"+r.wpseoTab).val()))}).on("click",function(e){r.focuskwKeep=!0}),l(WPGlobusYoastSeo.wpseoTabSelector).on("tabsactivate",function(e,t){var a;r.language=t.newPanel.attr("data-language"),t.newPanel.attr("data-language")===WPGlobusCoreData.default_language&&(a=l("#yoast_wpseo_focuskw_text_input_"+WPGlobusCoreData.default_language).val(),YoastSEO.app.rawData.keyword=a,r.focuskw.val(a),r.focuskw_hidden.val(a)),s.prototype.analyze()}),r=this}).prototype.analyze=function(){var e=l(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language");e!=WPGlobusCoreData.default_language&&0!=l("#editable-post-name-full-"+e).length?YoastSEO.app.snippetPreview.data.urlPath=l("#editable-post-name-full-"+e).text():YoastSEO.app.snippetPreview.data.urlPath=l("#editable-post-name-full").text(),YoastSEO.app.analyzeTimer(YoastSEO.app),s.prototype.setScoreIcon()},s.prototype.setScoreIcon=function(){var s=setInterval(function(){var e=l(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language"),t=l("#wpseo-meta-section-content .wpseo_generic_tab a").data("score"),a=l("#wpseo-meta-section-content .wpseo_keyword_tab a").data("score");""!=t&&(l("#wpseo-metabox-tabs_"+e+" .wpseo_generic_tab .wpseo-score-icon").removeClass("bad ok good 100 na"),l("#wpseo-metabox-tabs_"+e+" .wpseo_generic_tab .wpseo-score-icon").addClass(t)),""!=a&&(l("#wpseo-metabox-tabs_"+e+" .wpseo_keyword_tab .wpseo-score-icon").removeClass("bad ok good 100 na"),l("#wpseo-metabox-tabs_"+e+" .wpseo_keyword_tab .wpseo-score-icon").addClass(a)),clearInterval(s)},1500)},s.prototype.getWPseoTab=function(){return l(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language")},s.prototype.citeModification=function(e){var t="#snippet_citeBase_"+e,a="#snippet_cite_"+e,s=l("#wpseo-tab-"+e).data("yoast-cite-base");!1===l("#wpseo-tab-"+e).data("cite-contenteditable")&&l(a).attr("contenteditable","false"),l(t).text(s)},s.prototype.pageTitleModification=function(e){var a,s="#snippet_title_",o="",i="";if(r.title_template==e)l.each(WPGlobusCoreData.enabled_languages,function(e,t){n=l("#snippet-editor-title_"+t).val(),p=0==n.length?r.title_template:n,o=r.replaceVariablesPlugin(p),l(s+t).text(o),t==r.getWPseoTab()&&(i=o)});else{if(a=WPGlobusCore.getTranslations(e),r.getWPseoTab()!==WPGlobusCoreData.default_language&&a[WPGlobusCoreData.default_language]==e){var n,t=r.getWPseoTab(),p=0<(n=l("#snippet-editor-title_"+t).val()).length?n:r.title_template;return p=r.replaceVariablesPlugin(p),l(s+t).text(p),p}l.each(WPGlobusCoreData.enabled_languages,function(e,t){o=""===a[t]?r.replaceVariablesPlugin(r.title_template):r.replaceVariablesPlugin(a[t]),t==r.getWPseoTab()&&(i=o,0!=(n=l("#snippet-editor-title_"+t).val()).length?n!=i&&(i=r.replaceVariablesPlugin(n)):i=r.replaceVariablesPlugin(r.title_template)),l(s+t).html(i)})}return i},s.prototype.metaDescModification=function(a){var s="#snippet_meta_",e=WPGlobusCore.getTranslations(a),t="",o=l("#snippet-editor-meta-description_"+r.getWPseoTab()).val();if(r.getWPseoTab()===WPGlobusCoreData.default_language||e[WPGlobusCoreData.default_language]!=a)return l.each(WPGlobusCoreData.enabled_languages,function(e,t){l(s+t).text(WPGlobusCore.TextFilter(a,t,"RETURN_EMPTY")),r.citeModification(t)}),o==e[r.getWPseoTab()]?0==(t=e[r.getWPseoTab()]).length&&l(s+r.getWPseoTab()).text(WPGlobusCore.TextFilter(YoastSEO.app.snippetPreview.data.metaDesc,WPGlobusCoreData.default_language,"RETURN_EMPTY")):0==(t=o).length?l(s+r.getWPseoTab()).text(WPGlobusCore.TextFilter(YoastSEO.app.snippetPreview.data.metaDesc,WPGlobusCoreData.default_language,"RETURN_EMPTY")):l(s+r.getWPseoTab()).text(t),l(s+r.getWPseoTab()).text(t),t;var i=r.getWPseoTab();return r.citeModification(i),0==o.length?l(s+i).text(""):o!=a&&l(s+i).text(o),a},s.prototype.snippetModification=function(e){return WPGlobusCore.TextFilter(e,r.getWPseoTab(),"RETURN_EMPTY")},s.prototype.contentModification=function(e){return r.getWPseoTab()==WPGlobusCoreData.default_language?e:l("#content_"+r.getWPseoTab()).val()},s.prototype.titleModification=function(e){return setTimeout(r.updatePageAnalysis,1e3),r.getWPseoTab()==WPGlobusCoreData.default_language?e:l("#title_"+r.getWPseoTab()).val()},s.prototype.defaultReplace=function(e){var t=YoastSEO.app.rawData.keyword;return e.replace(/%%sitedesc%%/g,this.replaceVars.sitedesc).replace(/%%sitename%%/g,WPGlobusCore.TextFilter(this.replaceVars.sitename,r.getWPseoTab())).replace(/%%term_title%%/g,this.replaceVars.term_title).replace(/%%term_description%%/g,this.replaceVars.term_description).replace(/%%category_description%%/g,this.replaceVars.category_description).replace(/%%tag_description%%/g,this.replaceVars.tag_description).replace(/%%searchphrase%%/g,this.replaceVars.searchphrase).replace(/%%date%%/g,this.replaceVars.date).replace(/%%id%%/g,this.replaceVars.id).replace(/%%page%%/g,this.replaceVars.page).replace(/%%currenttime%%/g,this.replaceVars.currenttime).replace(/%%currentdate%%/g,this.replaceVars.currentdate).replace(/%%currentday%%/g,this.replaceVars.currentday).replace(/%%currentmonth%%/g,this.replaceVars.currentmonth).replace(/%%currentyear%%/g,this.replaceVars.currentyear).replace(/%%focuskw%%/g,t)},s.prototype.replaceVariablesPlugin=function(e){return void 0!==e&&(e=this.titleReplace(e),e=this.defaultReplace(e),e=this.replaceSeparators(e)),e},s.prototype.replaceSeparators=function(e){return e.replace(/%%sep%%(\s+%%sep%%)*/g,this.replaceVars.sep)},s.prototype.titleReplace=function(e){var t="";return void 0===(t=this.language==WPGlobusCoreData.default_language?l("#title").val():l("#title_"+this.language).val())&&(t=YoastSEO.app.rawData.pageTitle),this.language!=WPGlobusCoreData.default_language&&0==t.length&&(t=l("#title").val()),e=e.replace(/%%title%%/g,t)},s.prototype.doubleSepReplace=function(e){var t=YoastSEO.app.stringHelper.addEscapeChars(this.replaceVars.sep),a=new RegExp(t+" "+t,"g");return e=e.replace(a,this.replaceVars.sep)},s.prototype.updateWpseoKeyword=function(e,t){0<l("#wpseo-meta-section-content_"+t+" .wpseo-keyword").length&&l("#wpseo-meta-section-content_"+t+" .wpseo-keyword").removeClass("wpseo-keyword").addClass("wpglobus-wpseo_keyword_"+t),l(".wpglobus-wpseo_keyword_"+t).text(e)},s.prototype.updatePageAnalysis=function(){l("#wpseo-pageanalysis_"+r.getWPseoTab()).html(l("#wpseo-pageanalysis").html()),l("#yoast-seo-content-analysis_"+r.getWPseoTab()).html(l("#yoast-seo-content-analysis").html()),l("#yoast-seo-content-analysis_"+r.getWPseoTab()+" li a").css({float:"none"})}),window.WPGlobusYoastSeoPlugin=new s)});
|
1 |
+
var WPGlobusYoastSeo;jQuery(document).ready(function(l){"use strict";var r,d,s;"undefined"!=typeof wpseoReplaceVarsL10n&&"undefined"!=typeof WPGlobusCoreData&&"undefined"!=typeof WPGlobusVendor&&("edit-tags.php"==WPGlobusVendor.pagenow||"term.php"==WPGlobusVendor.pagenow?(d=WPGlobusYoastSeo={editorIDs:["description"],editor:{},submitId:"#submit",preventChangeEditor:!1,observer:null,init:function(){d.attachListeners(),_.delay(d.start,1500)},submit:function(e){"mouseenter"===e.type?l.each(d.editor,function(e,t){!d.editor[e].contentEditor||d.editor[e].contentEditor.isHidden()?l("#"+e).val(d.editor[e].content):tinymce.get(e).setContent(d.editor[e].content)}):"mouseleave"===e.type?d.preventChangeEditor||(l.each(d.editor,function(e,t){!d.editor[e].contentEditor||d.editor[e].contentEditor.isHidden()?l("#"+e).val(WPGlobusCore.TextFilter(t.content,d.getCurrentTab(),"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,d.getCurrentTab(),"RETURN_EMPTY"))}),d.preventChangeEditor=!1):"click"===e.type&&(d.preventChangeEditor=!0,"tinymce"!=getUserSetting("editor")&&setUserSetting("editor","tinymce"))},attachListeners:function(){l(".wrap").on("tabsactivate",function(e,a){l.each(d.editor,function(e,t){!d.editor[e].contentEditor||d.editor[e].contentEditor.isHidden()?l("#"+e).val(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY"))})}),l(document).on("mouseenter",d.submitId,d.submit).on("mouseleave",d.submitId,d.submit).on("click",d.submitId,d.submit),l(document).on("tinymce-editor-init",function(e,t){var a;-1!=_.indexOf(d.editorIDs,t.id)&&(a=l("#"+t.id),d.editor[t.id]={},d.editor[t.id].contentEditor=t,d.editor[t.id].content=a.val(),t.setContent(WPGlobusCore.TextFilter(d.editor[t.id].content,WPGlobusCoreData.default_language,"RETURN_EMPTY")),l("#"+t.getContainer().id).find("iframe").addClass("wpglobus-translatable"),a.removeClass("hidden"),t.on("nodechange keyup",_.debounce(d.update,500)),a.on("input keyup",_.debounce(d.update,500)))})},update:function(e){var t;void 0!==e.target&&("tinymce"==(t=e.target.id)&&(t=e.target.dataset.id),void 0!==d.editor[t].contentEditor&&(e=!d.editor[t].contentEditor||d.editor[t].contentEditor.isHidden()?l("#"+t).val():d.editor[t].contentEditor.getContent({format:"raw"}),d.editor[t].content=WPGlobusCore.getString(d.editor[t].content,e,d.getCurrentTab())))},getCurrentTab:function(){return l(".wpglobus-taxonomy-tabs-list .ui-tabs-active").data("language")},start:function(){l(".wpglobus-element_description").css({display:"none"})}},WPGlobusYoastSeo.init(),s=function(){l(".wrap").on("tabsactivate",function(e,t){t.newTab[0].dataset.language==WPGlobusCoreData.default_language?l("#poststuff .inside").css({display:"block"}):l("#poststuff .inside").css({display:"none"})}),l.each(["category_description","sitedesc","sitename","tag_description","term_description","term_title"],function(e,t){wpseoReplaceVarsL10n.replace_vars[t]=WPGlobusCore.TextFilter(wpseoReplaceVarsL10n.replace_vars[t],WPGlobusCoreData.default_language)}),WPGlobusYoastSeo.observer=new MutationObserver(function(e){e.forEach(function(e){"placeholder"==e.attributeName&&(WPGlobusYoastSeo.observer.disconnect(),""==(e=l("#wpseo_focuskw")).val()&&e.attr("placeholder",WPGlobusCore.TextFilter(e.attr("placeholder"),WPGlobusCoreData.default_language)),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0}))})}),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0})}):(d=WPGlobusYoastSeo={wpseoTabSelector:"#wpglobus-wpseo-tabs",url:"",attrs:l("#wpglobus-wpseo-attr"),iB:l("#wpseo-meta-section-content"),t:l("#wpseo-meta-section-content"),ids:"",names:"",editSnippetButtonClass:"wpglobus-snippet-editor__edit-button",editSnippetFormClass:"wpglobus-snippet-editor__form",editSnippetSubmitClass:"wpglobus-snippet-editor__submit",editSnippetHeadingClass:"wpglobus-snippet-editor__heading-editor",yoastTitleProgress:"wpglobus-yoast-title-progress",yoastMetadescProgress:"wpglobus-yoast-metadesc-progress",init:function(){d.start()},initAddKeywordPopup:function(){1===l("#wpseo-add-keyword-popup").length&&l(".wpseo-add-keyword").on("click",d.addKeywordPopup)},addKeywordPopup:function(){var e=l("#wpseo-add-keyword-popup-button").text();tb_show(e,"#TB_inline?width=650&height=350&inlineId=wpseo-add-keyword-popup","group"),jQuery("#TB_window").css("height",235),jQuery("#TB_window").css("width",680)},qtip:function(){l(".yoast_help").qtip({content:{attr:"alt"},position:{my:"bottom left",at:"top center"},style:{tip:{corner:!0},classes:"yoast-qtip qtip-rounded qtip-blue"},show:"click",hide:{fixed:!0,delay:500}})},removeClasses:function(t,e){_.each(e,function(e){t.removeClass(e)})},updateProgressBar:function(e,t){var a,s,o,i,n,p;void 0!==e&&(void 0===t&&void 0===(t="undefined"!==e.data("language")?e.data("language"):t)||(o="",i=p=0,n=!(a=["snippet-editor__progress--bad","snippet-editor__progress--ok","snippet-editor__progress--good"]),p=e.val().length,e.hasClass("wpglobus-snippet-editor-title")?(i=(s=l("progress."+d.yoastTitleProgress+"_"+t)).attr("max"),o=a[2],0==p?o=a[1]:i<p?(o=a[1],n=!0):0<p&&p<35&&(o=a[1])):e.hasClass("wpglobus-snippet-editor-meta-description")&&(i=(s=l("progress."+d.yoastMetadescProgress+"_"+t)).attr("max"),o=a[2],0==p?o=a[1]:i<p?(o=a[1],n=!0):0<p&&p<121&&(o=a[1])),d.removeClasses(s,a),s.attr("value",p).addClass(o),n?e.css("color","#f00"):e.css("color","#000")))},updateWpseoKeyword:function(e,t){l("#wpseo-meta-section-content_"+t+" .wpseo-keyword").text(e)},start:function(){l(d.wpseoTabSelector).tabs(),d.ids=d.attrs.data("ids"),d.names=d.attrs.data("names"),d.ids=d.ids+","+d.attrs.data("qtip"),d.ids=d.ids.split(","),d.names=d.names.split(","),l("#wpglobus-wpseo-tabs").insertBefore(d.iB),l(".wpseo-metabox-tabs").css({height:"26px"}),l(".wpglobus-wpseo-general").each(function(e,t){var a=l(t),s=a.data("language"),t="wpseo-meta-section-content_"+s;a.html('<div id="'+t+'" class="wpseo-meta-section wpglobus-wpseo-meta-section" style="width:100%" data-language="'+s+'">'+d.t.html()+"</div>"),l("#"+t+" .wpseo-metabox-tabs").attr("id","wpseo-metabox-tabs_"+s).attr("data-language",s),l("#"+t+" .wpseotab").attr("id","wpseo_content_"+s),l("#wpseo_content_"+s).css({float:"left"}),l("#"+t).css({display:"block"}),l("#wpseo_meta").css({overflow:"hidden"}),l("#"+t+" .snippet_container").addClass("wpglobus-snippet_container"),s!==WPGlobusCoreData.default_language&&l("#"+t+" .wpseo-add-keyword").addClass("hidden"),l.each(d.names,function(e,t){l("#"+t).attr("name",t+"_"+s)}),l.each(d.ids,function(e,t){var a=l("#"+t);"wpseosnippet"==t&&a.addClass("wpglobus-wpseosnippet"),"snippet_title"==t&&a.addClass("wpglobus-snippet_title"),"snippet_meta"==t&&a.addClass("wpglobus-snippet_meta"),"snippet_cite"==t&&a.addClass("wpglobus-snippet_cite"),"snippet_citeBase"==t&&a.addClass("wpglobus-snippet_citeBase"),"url_container"==t&&a.css({height:"16px"}),"yoast_wpseo_focuskw_text_input"==t&&a.addClass("wpglobus-yoast_wpseo_focuskw_text_input"),"wpseo-pageanalysis"==t&&a.addClass("wpglobus-wpseo-pageanalysis"),"yoast-seo-content-analysis"==t&&a.addClass("wpglobus-yoast-seo-content-analysis"),"snippet_preview"==t&&a.addClass("wpglobus-snippet_preview"),"snippet-editor-title"==t&&(a.addClass("wpglobus-snippet-editor-title"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),a.val(l("#wpseo-tab-"+s).data("wpseotitle")),a.parent("label").next("progress").addClass(d.yoastTitleProgress).addClass(d.yoastTitleProgress+"_"+s),_.debounce(d.updateProgressBar(a,s),500)),"snippet-editor-slug"==t&&(a.addClass("wpglobus-snippet-editor-slug"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),WPGlobusCoreData.default_language!=s&&a.attr("disabled","disabled")),"snippet-editor-meta-description"==t&&(a.addClass("wpglobus-snippet-editor-meta-description"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),a.val(l("#wpseo-tab-"+s).data("metadesc")),a.parent("label").next("progress").addClass(d.yoastMetadescProgress).addClass(d.yoastMetadescProgress+"_"+s),_.debounce(d.updateProgressBar(a,s),500)),"snippetpreview-help-toggle"==t&&(a.addClass("wpglobus-snippetpreview-help-toggle_"+s),l(document).on("click",".wpglobus-snippetpreview-help-toggle_"+s,function(e){var t=l(this);"none"===l("#snippetpreview-help_"+t.data("language")).css("display")?l("#snippetpreview-help_"+t.data("language")).css({display:"block"}):l("#snippetpreview-help_"+t.data("language")).css({display:"none"})})),"focuskw_text_input-help-toggle"==t&&(a.addClass("wpglobus-focuskw_text_input-help-toggle_"+s),l(document).on("click",".wpglobus-focuskw_text_input-help-toggle_"+s,function(e){var t=l(this);"none"===l("#focuskw_text_input-help_"+t.data("language")).css("display")?l("#focuskw_text_input-help_"+t.data("language")).css({display:"block"}):l("#focuskw_text_input-help_"+t.data("language")).css({display:"none"})})),"pageanalysis-help-toggle"==t&&(a.addClass("wpglobus-pageanalysis-help-toggle_"+s),l(document).on("click",".wpglobus-pageanalysis-help-toggle_"+s,function(e){var t=l(this);"none"===l("#pageanalysis-help_"+t.data("language")).css("display")?l("#pageanalysis-help_"+t.data("language")).css({display:"block"}):l("#pageanalysis-help_"+t.data("language")).css({display:"none"})})),a.attr("id",t+"_"+s),l("#"+t+"_"+s).attr("data-language",s)});a=WPGlobusCore.TextFilter(l("#yoast_wpseo_focuskw_text_input").val(),s,"RETURN_EMPTY");l("#yoast_wpseo_focuskw_text_input_"+s).val(a),l("#yoast_wpseo_focuskw_"+s).val(a),d.updateWpseoKeyword(a,s),s!==WPGlobusCoreData.default_language&&(l("#"+t+" #yoast_wpseo_focuskw_text_input_"+s).addClass("hidden").after('<div class="wpglobus-suggest" style="font-weight:bold;">'+WPGlobusVendor.i18n.yoastseo_plus_access+"</div>"),l("#"+t+" #wpseo-pageanalysis_"+s).addClass("hidden").css({display:"none"}))}),l(".wpglobus-wpseosnippet").each(function(e,t){var a=l(t),t=a.data("language");a.find("button.snippet-editor__button.snippet-editor__edit-button").addClass(d.editSnippetButtonClass).addClass(d.editSnippetButtonClass+"_"+t).attr("data-language",t),a.find(".snippet-editor__form").addClass(d.editSnippetFormClass).addClass(d.editSnippetFormClass+"_"+t),a.find(".snippet-editor__heading-editor").addClass(d.editSnippetHeadingClass).addClass(d.editSnippetHeadingClass+"_"+t),a.find(".snippet-editor__submit").addClass(d.editSnippetSubmitClass).addClass(d.editSnippetSubmitClass+"_"+t).attr("data-language",t)}),d.iB.addClass("hidden"),d.iB.css({height:0,overflow:"hidden",display:"none"});var e=WPGlobusCore.TextFilter(l("#yoast_wpseo_focuskw_text_input").val(),WPGlobusCoreData.default_language,"RETURN_EMPTY");l("#yoast_wpseo_focuskw_text_input").val(e),l("#yoast_wpseo_focuskw").val(e),l(".wpglobus-wpseo-general .wpseo_tablink").on("click",function(e){e.preventDefault();var t=l(this),e=t.parents("ul").data("language"),t=t.parent("li");e!=WPGlobusCoreData.default_language&&void 0===l(document).triggerHandler("wpglobus_yoast_analysis",{language:e})||(t.hasClass("wpseo_generic_tab")?(l("#wpseo-pageanalysis_"+e).css({display:"none"}),l("#yoast-seo-content-analysis_"+e).css({display:"block"}),l("#wpseo_content_"+e+" table tr").eq(0).css({display:"none"}),l("#wpseo_content_"+e+" table tr").eq(1).css({display:"none"}),l("#yoast-seo-content-analysis_"+e+" li a").css({float:"none"})):t.hasClass("wpseo_keyword_tab")&&(l("#wpseo-pageanalysis_"+e).css({display:"block"}),l("#yoast-seo-content-analysis_"+e).css({display:"none"}),l("#wpseo_content_"+e+" table tr").eq(0).css("display",""),l("#wpseo_content_"+e+" table tr").eq(1).css("display","")))}),l(".wpseo-metabox-sidebar .wpseo-meta-section-link").on("click",function(e){"#wpseo-meta-section-content"==l(this).attr("href")?l("#wpglobus-wpseo-tabs").css({display:"block"}):l("#wpglobus-wpseo-tabs").css({display:"none"})}),l("body").on("click","."+d.editSnippetButtonClass,function(e){var t=l(this),a=t.data("language"),s=l("."+d.editSnippetFormClass+"_"+a),o=l("."+d.editSnippetSubmitClass+"_"+a),a=l("."+d.editSnippetHeadingClass+"_"+a);s.hasClass("snippet-editor--hidden")?(s.removeClass("snippet-editor--hidden"),a.removeClass("snippet-editor--hidden"),o.removeClass("snippet-editor--hidden")):(s.addClass("snippet-editor--hidden"),a.addClass("snippet-editor--hidden")),t.addClass("snippet-editor--hidden")}),l("body").on("click","."+d.editSnippetSubmitClass,function(e){var t=l(this).data("language"),a=l("."+d.editSnippetButtonClass+"_"+t),s=l("."+d.editSnippetFormClass+"_"+t),o=l("."+d.editSnippetSubmitClass+"_"+t),t=l("."+d.editSnippetHeadingClass+"_"+t);a.removeClass("snippet-editor--hidden"),s.addClass("snippet-editor--hidden"),o.addClass("snippet-editor--hidden"),t.addClass("snippet-editor--hidden")}),l(document).on("keyup","input.wpglobus-snippet-editor-title",function(e){var t=l(this),a=t.data("language"),s=WPGlobusCore.getString(l('input[name="yoast_wpseo_title"]').val(),t.val(),a);l("#snippet_title_"+a).html(r.replaceVariablesPlugin(t.val())),YoastSEO.app.rawData.pageTitle=s,l('input[name="yoast_wpseo_title"]').val(s),l("#snippet_title").text(s),_.debounce(d.updateProgressBar(t,a),500)}),l(document).on("keyup","input.wpglobus-snippet-editor-slug",function(e){var t=l(this),a=t.data("language");l("#snippet_cite_"+a).text(t.val()+"/"),l("#editable-post-name").text(t.val()),l("#editable-post-name-full").text(t.val())}),l(document).on("change","input.wpglobus-snippet-editor-slug",function(e){var t=l(this);l.post(ajaxurl,{action:"sample-permalink",post_id:l("#post_ID").val()||0,new_slug:t.val(),new_title:l("#title").val(),samplepermalinknonce:l("#samplepermalinknonce").val()})}),l(document).on("keyup","textarea.wpglobus-snippet-editor-meta-description",function(e){var t=l(this),a=t.data("language");l("#snippet_meta_"+a).text(t.val());var s=WPGlobusCore.getString(l("#yoast_wpseo_metadesc").val(),t.val(),t.data("language"));l("#yoast_wpseo_metadesc").val(s),l("#snippet_meta").text(s),_.debounce(d.updateProgressBar(t,a),500)}),l("body").on("click",".wpglobus-post-body-tabs-list li",function(e){var t=l(this);t.hasClass("wpglobus-post-tab")&&(l("#wpglobus-wpseo-tabs").tabs("option","active",t.data("order")),t=l("#yoast_wpseo_focuskw_text_input_"+l(this).data("language")).val(),YoastSEO.app.rawData.keyword=t,l("#yoast_wpseo_focuskw_text_input").val(t),l('input[name="yoast_wpseo_focuskw"]').val(t),s.prototype.analyze())}),d.initAddKeywordPopup()}},(s=function(){this.replaceVars=wpseoReplaceVarsL10n.replace_vars,this.language=WPGlobusCoreData.default_language,this.tab=WPGlobusCoreData.default_language,this.wpseoTab=WPGlobusCoreData.default_language,this.title_template=wpseoPostScraperL10n.title_template,this.focuskw=l("#yoast_wpseo_focuskw_text_input"),this.focuskw_hidden=l('input[name="yoast_wpseo_focuskw"]'),this.focuskwKeep=!1,this.post_slug="#editable-post-name-full",YoastSEO.app.registerPlugin("wpglobusYoastSeoPlugin",{status:"ready"}),YoastSEO.app.registerModification("content",this.contentModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("title",this.titleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_title",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_meta",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_page_title",this.pageTitleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_meta_desc",this.metaDescModification,"wpglobusYoastSeoPlugin",0),s.prototype.setScoreIcon(),l(document).on("blur",".wpglobus-snippet_title",function(e){var t=l(this),t=WPGlobusCore.getString(l("#yoast_wpseo_title").val(),t.text(),t.data("language"));YoastSEO.app.rawData.pageTitle=t,l('input[name="yoast_wpseo_title"]').val(t),l("#snippet_title").text(t)}),l(document).on("blur",".wpglobus-snippet_meta",function(e){var t=l(this),t=WPGlobusCore.getString(l("#yoast_wpseo_metadesc").val(),t.text(),t.data("language"));l("#yoast_wpseo_metadesc").val(t),l("#snippet_meta").text(t)}),l(document).on("keyup",".wpglobus-yoast_wpseo_focuskw_text_input",function(e){var t=l(this),a=t.val();r.focuskw.val(a),r.focuskw_hidden.val(a),r.updateWpseoKeyword(a,t.data("language")),s.prototype.analyze()}),l("#publish,#save-post").on("mouseenter",function(e){var a,s="";l(".wpglobus-yoast_wpseo_focuskw_text_input").each(function(e,t){a=l(this),s=WPGlobusCore.getString(s,a.val(),a.data("language"))}),r.focuskw.val(s),r.focuskw_hidden.val(s)}).on("mouseleave",function(e){r.focuskwKeep||(r.wpseoTab=l(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language"),l(this),r.focuskw.val(l("#yoast_wpseo_focuskw_text_input_"+r.wpseoTab).val()),r.focuskw_hidden.val(l("#yoast_wpseo_focuskw_text_input_"+r.wpseoTab).val()))}).on("click",function(e){r.focuskwKeep=!0}),l(WPGlobusYoastSeo.wpseoTabSelector).on("tabsactivate",function(e,t){r.language=t.newPanel.attr("data-language"),t.newPanel.attr("data-language")===WPGlobusCoreData.default_language&&(t=l("#yoast_wpseo_focuskw_text_input_"+WPGlobusCoreData.default_language).val(),YoastSEO.app.rawData.keyword=t,r.focuskw.val(t),r.focuskw_hidden.val(t)),s.prototype.analyze()}),r=this}).prototype.analyze=function(){var e=l(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language");e!=WPGlobusCoreData.default_language&&0!=l("#editable-post-name-full-"+e).length?YoastSEO.app.snippetPreview.data.urlPath=l("#editable-post-name-full-"+e).text():YoastSEO.app.snippetPreview.data.urlPath=l("#editable-post-name-full").text(),YoastSEO.app.analyzeTimer(YoastSEO.app),s.prototype.setScoreIcon()},s.prototype.setScoreIcon=function(){var s=setInterval(function(){var e=l(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language"),t=l("#wpseo-meta-section-content .wpseo_generic_tab a").data("score"),a=l("#wpseo-meta-section-content .wpseo_keyword_tab a").data("score");""!=t&&(l("#wpseo-metabox-tabs_"+e+" .wpseo_generic_tab .wpseo-score-icon").removeClass("bad ok good 100 na"),l("#wpseo-metabox-tabs_"+e+" .wpseo_generic_tab .wpseo-score-icon").addClass(t)),""!=a&&(l("#wpseo-metabox-tabs_"+e+" .wpseo_keyword_tab .wpseo-score-icon").removeClass("bad ok good 100 na"),l("#wpseo-metabox-tabs_"+e+" .wpseo_keyword_tab .wpseo-score-icon").addClass(a)),clearInterval(s)},1500)},s.prototype.getWPseoTab=function(){return l(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language")},s.prototype.citeModification=function(e){var t="#snippet_citeBase_"+e,a="#snippet_cite_"+e,s=l("#wpseo-tab-"+e).data("yoast-cite-base");!1===l("#wpseo-tab-"+e).data("cite-contenteditable")&&l(a).attr("contenteditable","false"),l(t).text(s)},s.prototype.pageTitleModification=function(e){var a,s="#snippet_title_",o="",i="";if(r.title_template==e)l.each(WPGlobusCoreData.enabled_languages,function(e,t){n=l("#snippet-editor-title_"+t).val(),p=0==n.length?r.title_template:n,o=r.replaceVariablesPlugin(p),l(s+t).text(o),t==r.getWPseoTab()&&(i=o)});else{if(a=WPGlobusCore.getTranslations(e),r.getWPseoTab()!==WPGlobusCoreData.default_language&&a[WPGlobusCoreData.default_language]==e){var n,e=r.getWPseoTab(),p=0<(n=l("#snippet-editor-title_"+e).val()).length?n:r.title_template;return p=r.replaceVariablesPlugin(p),l(s+e).text(p),p}l.each(WPGlobusCoreData.enabled_languages,function(e,t){o=""===a[t]?r.replaceVariablesPlugin(r.title_template):r.replaceVariablesPlugin(a[t]),t==r.getWPseoTab()&&(i=o,0!=(n=l("#snippet-editor-title_"+t).val()).length?n!=i&&(i=r.replaceVariablesPlugin(n)):i=r.replaceVariablesPlugin(r.title_template)),l(s+t).html(i)})}return i},s.prototype.metaDescModification=function(a){var s="#snippet_meta_",e=WPGlobusCore.getTranslations(a),t="",o=l("#snippet-editor-meta-description_"+r.getWPseoTab()).val();if(r.getWPseoTab()===WPGlobusCoreData.default_language||e[WPGlobusCoreData.default_language]!=a)return l.each(WPGlobusCoreData.enabled_languages,function(e,t){l(s+t).text(WPGlobusCore.TextFilter(a,t,"RETURN_EMPTY")),r.citeModification(t)}),o==e[r.getWPseoTab()]?0==(t=e[r.getWPseoTab()]).length&&l(s+r.getWPseoTab()).text(WPGlobusCore.TextFilter(YoastSEO.app.snippetPreview.data.metaDesc,WPGlobusCoreData.default_language,"RETURN_EMPTY")):0==(t=o).length?l(s+r.getWPseoTab()).text(WPGlobusCore.TextFilter(YoastSEO.app.snippetPreview.data.metaDesc,WPGlobusCoreData.default_language,"RETURN_EMPTY")):l(s+r.getWPseoTab()).text(t),l(s+r.getWPseoTab()).text(t),t;t=r.getWPseoTab();return r.citeModification(t),0==o.length?l(s+t).text(""):o!=a&&l(s+t).text(o),a},s.prototype.snippetModification=function(e){return WPGlobusCore.TextFilter(e,r.getWPseoTab(),"RETURN_EMPTY")},s.prototype.contentModification=function(e){return r.getWPseoTab()==WPGlobusCoreData.default_language?e:l("#content_"+r.getWPseoTab()).val()},s.prototype.titleModification=function(e){return setTimeout(r.updatePageAnalysis,1e3),r.getWPseoTab()==WPGlobusCoreData.default_language?e:l("#title_"+r.getWPseoTab()).val()},s.prototype.defaultReplace=function(e){var t=YoastSEO.app.rawData.keyword;return e.replace(/%%sitedesc%%/g,this.replaceVars.sitedesc).replace(/%%sitename%%/g,WPGlobusCore.TextFilter(this.replaceVars.sitename,r.getWPseoTab())).replace(/%%term_title%%/g,this.replaceVars.term_title).replace(/%%term_description%%/g,this.replaceVars.term_description).replace(/%%category_description%%/g,this.replaceVars.category_description).replace(/%%tag_description%%/g,this.replaceVars.tag_description).replace(/%%searchphrase%%/g,this.replaceVars.searchphrase).replace(/%%date%%/g,this.replaceVars.date).replace(/%%id%%/g,this.replaceVars.id).replace(/%%page%%/g,this.replaceVars.page).replace(/%%currenttime%%/g,this.replaceVars.currenttime).replace(/%%currentdate%%/g,this.replaceVars.currentdate).replace(/%%currentday%%/g,this.replaceVars.currentday).replace(/%%currentmonth%%/g,this.replaceVars.currentmonth).replace(/%%currentyear%%/g,this.replaceVars.currentyear).replace(/%%focuskw%%/g,t)},s.prototype.replaceVariablesPlugin=function(e){return void 0!==e&&(e=this.titleReplace(e),e=this.defaultReplace(e),e=this.replaceSeparators(e)),e},s.prototype.replaceSeparators=function(e){return e.replace(/%%sep%%(\s+%%sep%%)*/g,this.replaceVars.sep)},s.prototype.titleReplace=function(e){var t="";return void 0===(t=(this.language==WPGlobusCoreData.default_language?l("#title"):l("#title_"+this.language)).val())&&(t=YoastSEO.app.rawData.pageTitle),this.language!=WPGlobusCoreData.default_language&&0==t.length&&(t=l("#title").val()),e=e.replace(/%%title%%/g,t)},s.prototype.doubleSepReplace=function(e){var t=YoastSEO.app.stringHelper.addEscapeChars(this.replaceVars.sep),t=new RegExp(t+" "+t,"g");return e=e.replace(t,this.replaceVars.sep)},s.prototype.updateWpseoKeyword=function(e,t){0<l("#wpseo-meta-section-content_"+t+" .wpseo-keyword").length&&l("#wpseo-meta-section-content_"+t+" .wpseo-keyword").removeClass("wpseo-keyword").addClass("wpglobus-wpseo_keyword_"+t),l(".wpglobus-wpseo_keyword_"+t).text(e)},s.prototype.updatePageAnalysis=function(){l("#wpseo-pageanalysis_"+r.getWPseoTab()).html(l("#wpseo-pageanalysis").html()),l("#yoast-seo-content-analysis_"+r.getWPseoTab()).html(l("#yoast-seo-content-analysis").html()),l("#yoast-seo-content-analysis_"+r.getWPseoTab()+" li a").css({float:"none"})}),window.WPGlobusYoastSeoPlugin=new s)});
|
includes/js/wpglobus-yoastseo-40.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var WPGlobusYoastSeo,WPGlobusYoastSeoPremium=!1;jQuery(document).ready(function(p){"use strict";var r,d,n;"undefined"!=typeof wpseoReplaceVarsL10n&&"undefined"!=typeof WPGlobusCoreData&&"undefined"!=typeof WPGlobusVendor&&("edit-tags.php"==WPGlobusVendor.pagenow||"term.php"==WPGlobusVendor.pagenow?(d=WPGlobusYoastSeo={editorIDs:["description"],editor:{},submitId:"#submit",preventChangeEditor:!1,observer:null,init:function(){d.attachListeners(),_.delay(d.start,1500)},submit:function(e){"mouseenter"===e.type?p.each(d.editor,function(e,t){!d.editor[e].contentEditor||d.editor[e].contentEditor.isHidden()?p("#"+e).val(d.editor[e].content):tinymce.get(e).setContent(d.editor[e].content)}):"mouseleave"===e.type?d.preventChangeEditor||(p.each(d.editor,function(e,t){!d.editor[e].contentEditor||d.editor[e].contentEditor.isHidden()?p("#"+e).val(WPGlobusCore.TextFilter(t.content,d.getCurrentTab(),"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,d.getCurrentTab(),"RETURN_EMPTY"))}),d.preventChangeEditor=!1):"click"===e.type&&(d.preventChangeEditor=!0,"tinymce"!=getUserSetting("editor")&&setUserSetting("editor","tinymce"))},attachListeners:function(){p(".wrap").on("tabsactivate",function(e,a){p.each(d.editor,function(e,t){!d.editor[e].contentEditor||d.editor[e].contentEditor.isHidden()?p("#"+e).val(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY"))})}),p(document).on("mouseenter",d.submitId,d.submit).on("mouseleave",d.submitId,d.submit).on("click",d.submitId,d.submit),p(document).on("tinymce-editor-init",function(e,t){var a;-1!=_.indexOf(d.editorIDs,t.id)&&(a=p("#"+t.id),d.editor[t.id]={},d.editor[t.id].contentEditor=t,d.editor[t.id].content=a.val(),t.setContent(WPGlobusCore.TextFilter(d.editor[t.id].content,WPGlobusCoreData.default_language,"RETURN_EMPTY")),p("#"+t.getContainer().id).find("iframe").addClass("wpglobus-translatable"),a.removeClass("hidden"),t.on("nodechange keyup",_.debounce(d.update,500)),a.on("input keyup",_.debounce(d.update,500)))})},update:function(e){var t,a;void 0!==e.target&&("tinymce"==(t=e.target.id)&&(t=e.target.dataset.id),void 0!==d.editor[t].contentEditor&&(a=!d.editor[t].contentEditor||d.editor[t].contentEditor.isHidden()?p("#"+t).val():d.editor[t].contentEditor.getContent({format:"raw"}),d.editor[t].content=WPGlobusCore.getString(d.editor[t].content,a,d.getCurrentTab())))},getCurrentTab:function(){return p(".wpglobus-taxonomy-tabs-list .ui-tabs-active").data("language")},start:function(){p(".wpglobus-element_description").css({display:"none"})}},WPGlobusYoastSeo.init(),n=function(){p(".wrap").on("tabsactivate",function(e,t){t.newTab[0].dataset.language==WPGlobusCoreData.default_language?p("#poststuff .inside").css({display:"block"}):p("#poststuff .inside").css({display:"none"})}),p.each(["category_description","sitedesc","sitename","tag_description","term_description","term_title"],function(e,t){wpseoReplaceVarsL10n.replace_vars[t]=WPGlobusCore.TextFilter(wpseoReplaceVarsL10n.replace_vars[t],WPGlobusCoreData.default_language)}),WPGlobusYoastSeo.observer=new MutationObserver(function(e){e.forEach(function(e){var t;"placeholder"==e.attributeName&&(WPGlobusYoastSeo.observer.disconnect(),""==(t=p("#wpseo_focuskw")).val()&&t.attr("placeholder",WPGlobusCore.TextFilter(t.attr("placeholder"),WPGlobusCoreData.default_language)),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0}))})}),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0})}):(d=WPGlobusYoastSeo={wpseoTabSelector:"#wpglobus-wpseo-tabs",url:"",attrs:p("#wpglobus-wpseo-attr"),iB:p("#wpseo-meta-section-content"),t:p("#wpseo-meta-section-content"),ids:"",names:"",wpseoTab:WPGlobusCoreData.default_language,editSnippetButtonClass:"wpglobus-snippet-editor__edit-button",editSnippetFormClass:"wpglobus-snippet-editor__form",editSnippetSubmitClass:"wpglobus-snippet-editor__submit",editSnippetHeadingClass:"wpglobus-snippet-editor__heading-editor",yoastTitleProgress:"wpglobus-yoast-title-progress",yoastMetadescProgress:"wpglobus-yoast-metadesc-progress",yoastPremium:WPGlobusVendor.vendor.WPSEO_PREMIUM,keywordIndex:{},init:function(){p.each(WPGlobusCoreData.enabled_languages,function(e,t){d.keywordIndex[t]=0}),d.start()},initAddKeywordPopup:function(){1==p("#wpseo-add-keyword-popup").length?p(".wpseo-add-keyword").on("click",d.addKeywordPopup):WPGlobusYoastSeoPremium&&WPGlobusYoastSeoPremium.addKeywordButton()},addKeywordPopup:function(){var e=p("#wpseo-add-keyword-popup-button").text();tb_show(e,"#TB_inline?width=650&height=350&inlineId=wpseo-add-keyword-popup","group"),p("#TB_window").css("height",235),p("#TB_window").css("width",680)},qtip:function(){p(".yoast_help").qtip({content:{attr:"alt"},position:{my:"bottom left",at:"top center"},style:{tip:{corner:!0},classes:"yoast-qtip qtip-rounded qtip-blue"},show:"click",hide:{fixed:!0,delay:500}})},removeClasses:function(t,e){_.each(e,function(e){t.removeClass(e)})},updateProgressBar:function(e,t){var a,s,o,n,i,l;void 0!==e&&(void 0===t&&("undefined"!==e.data("language")&&(t=e.data("language")),void 0===t)||(o="",n=l=0,i=!(a=["snippet-editor__progress--bad","snippet-editor__progress--ok","snippet-editor__progress--good"]),l=e.val().length,e.hasClass("wpglobus-snippet-editor-title")?(n=(s=p("progress."+d.yoastTitleProgress+"_"+t)).attr("max"),o=a[2],0==l?o=a[1]:n<l?(o=a[1],i=!0):0<l&&l<35&&(o=a[1])):e.hasClass("wpglobus-snippet-editor-meta-description")&&(n=(s=p("progress."+d.yoastMetadescProgress+"_"+t)).attr("max"),o=a[2],0==l?o=a[1]:n<l?(o=a[1],i=!0):0<l&&l<121&&(o=a[1])),d.removeClasses(s,a),s.attr("value",l).addClass(o),i?e.css("color","#f00"):e.css("color","#000")))},updateWpseoKeyword:function(e,t){p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").text(e)},start:function(){p(d.wpseoTabSelector).tabs(),d.ids=d.attrs.data("ids"),d.names=d.attrs.data("names"),d.ids=d.ids+","+d.attrs.data("qtip"),d.ids=d.ids.split(","),d.names=d.names.split(","),p("#wpglobus-wpseo-tabs").insertBefore(d.iB),p(".wpseo-metabox-tabs").css({height:"26px"}),p(".wpglobus-wpseo-general").each(function(e,t){var a=p(t),s=a.data("language"),o="wpseo-meta-section-content_"+s;a.html('<div id="'+o+'" class="wpseo-meta-section wpglobus-wpseo-meta-section" style="width:100%" data-language="'+s+'">'+d.t.html()+"</div>"),p("#"+o+" .wpseo-metabox-tabs").attr("id","wpseo-metabox-tabs_"+s).attr("data-language",s),p("#"+o+" .wpseotab").attr("id","wpseo_content_"+s),p("#wpseo_content_"+s).css({float:"left"}),p("#"+o).css({display:"block"}),p("#wpseo_meta").css({overflow:"hidden"}),p("#"+o+" .snippet_container").addClass("wpglobus-snippet_container"),s!==WPGlobusCoreData.default_language&&p("#"+o+" .wpseo-add-keyword").addClass("hidden"),p.each(d.names,function(e,t){p("#"+t).attr("name",t+"_"+s)}),p.each(d.ids,function(e,t){var a=p("#"+t);"wpseosnippet"==t&&a.addClass("wpglobus-wpseosnippet"),"snippet_title"==t&&a.addClass("wpglobus-snippet_title"),"snippet_meta"==t&&a.addClass("wpglobus-snippet_meta"),"snippet_cite"==t&&a.addClass("wpglobus-snippet_cite"),"snippet_citeBase"==t&&a.addClass("wpglobus-snippet_citeBase"),"url_container"==t&&a.css({height:"16px"}),"yoast_wpseo_focuskw_text_input"==t&&(a.addClass("wpglobus-yoast_wpseo_focuskw_text_input"),a.attr("data-value",""),a.parents("div#wpseofocuskeyword").attr("id","wpseofocuskeyword_"+s)),"yoast_wpseo_focuskeywords"==t&&a.addClass("wpglobus-yoast_wpseo_focuskeywords"),"wpseo-pageanalysis"==t&&a.addClass("wpglobus-wpseo-pageanalysis"),"yoast-seo-content-analysis"==t&&a.addClass("wpglobus-yoast-seo-content-analysis"),"snippet_preview"==t&&a.addClass("wpglobus-snippet_preview"),"snippet-editor-title"==t&&(a.addClass("wpglobus-snippet-editor-title"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),a.val(p("#wpseo-tab-"+s).data("wpseotitle")),a.parent("label").next("progress").addClass(d.yoastTitleProgress).addClass(d.yoastTitleProgress+"_"+s),_.debounce(d.updateProgressBar(a,s),500)),"snippet-editor-slug"==t&&(a.addClass("wpglobus-snippet-editor-slug"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),WPGlobusCoreData.default_language!=s&&a.attr("disabled","disabled")),"snippet-editor-meta-description"==t&&(a.addClass("wpglobus-snippet-editor-meta-description"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),a.val(p("#wpseo-tab-"+s).data("metadesc")),a.parent("label").next("progress").addClass(d.yoastMetadescProgress).addClass(d.yoastMetadescProgress+"_"+s),_.debounce(d.updateProgressBar(a,s),500)),"snippetpreview-help-toggle"==t&&(a.addClass("wpglobus-snippetpreview-help-toggle_"+s),p(document).on("click",".wpglobus-snippetpreview-help-toggle_"+s,function(e){var t=p(this);"none"===p("#snippetpreview-help_"+t.data("language")).css("display")?p("#snippetpreview-help_"+t.data("language")).css({display:"block"}):p("#snippetpreview-help_"+t.data("language")).css({display:"none"})})),"focuskw_text_input-help-toggle"==t&&(a.addClass("wpglobus-focuskw_text_input-help-toggle_"+s),p(document).on("click",".wpglobus-focuskw_text_input-help-toggle_"+s,function(e){var t=p(this);"none"===p("#focuskw_text_input-help_"+t.data("language")).css("display")?p("#focuskw_text_input-help_"+t.data("language")).css({display:"block"}):p("#focuskw_text_input-help_"+t.data("language")).css({display:"none"})})),"pageanalysis-help-toggle"==t&&(a.addClass("wpglobus-pageanalysis-help-toggle_"+s),p(document).on("click",".wpglobus-pageanalysis-help-toggle_"+s,function(e){var t=p(this);"none"===p("#pageanalysis-help_"+t.data("language")).css("display")?p("#pageanalysis-help_"+t.data("language")).css({display:"block"}):p("#pageanalysis-help_"+t.data("language")).css({display:"none"})})),a.attr("id",t+"_"+s),p("#"+t+"_"+s).attr("data-language",s)});var n=WPGlobusCore.TextFilter(p("#yoast_wpseo_focuskw_text_input").val(),s,"RETURN_EMPTY");p("#yoast_wpseo_focuskw_text_input_"+s).val(n).data("value",n),p("#yoast_wpseo_focuskw_"+s).val(n),d.updateWpseoKeyword(n,s),s!==WPGlobusCoreData.default_language&&(p("#"+o+" #yoast_wpseo_focuskw_text_input_"+s).addClass("hidden").after('<div class="wpglobus-suggest" style="font-weight:bold;">'+WPGlobusVendor.i18n.yoastseo_plus_access+"</div>"),p("#"+o+" #wpseo-pageanalysis_"+s).addClass("hidden").css({display:"none"})),WPGlobusYoastSeoPremium&&(s==WPGlobusCoreData.default_language||(p("#wpseo-metabox-tabs_"+s+" .wpseo_keyword_tab").removeClass("wpseo_keyword_tab").addClass("wpglobus-wpseo_keyword_tab"),p("#wpseo-meta-section-content_"+s+" .wpseo_keyword_tab_hideable").css({display:"none"}).attr("data-language",s)))}),p(".wpglobus-wpseosnippet").each(function(e,t){var a=p(t),s=a.data("language");a.find("button.snippet-editor__button.snippet-editor__edit-button").addClass(d.editSnippetButtonClass).addClass(d.editSnippetButtonClass+"_"+s).attr("data-language",s),a.find(".snippet-editor__form").addClass(d.editSnippetFormClass).addClass(d.editSnippetFormClass+"_"+s),a.find(".snippet-editor__heading-editor").addClass(d.editSnippetHeadingClass).addClass(d.editSnippetHeadingClass+"_"+s),a.find(".snippet-editor__submit").addClass(d.editSnippetSubmitClass).addClass(d.editSnippetSubmitClass+"_"+s).attr("data-language",s)}),d.iB.addClass("hidden"),d.iB.css({height:0,overflow:"hidden",display:"none"}),WPGlobusYoastSeoPremium&&p("#wpseo-meta-section-content .wpseo_keyword_tab").removeClass("wpseo_keyword_tab").addClass("wpseo_keyword_tab_original");var e=WPGlobusCore.TextFilter(p("#yoast_wpseo_focuskw_text_input").val(),WPGlobusCoreData.default_language,"RETURN_EMPTY");p("#yoast_wpseo_focuskw_text_input").val(e),p("#yoast_wpseo_focuskw").val(e),p(document).on("click",".wpglobus-wpseo-general .wpseo_tablink",function(e){e.preventDefault();var t,a=p(this),s=a.parents("ul").data("language"),o=a.parent("li");s!=WPGlobusCoreData.default_language&&void 0===p(document).triggerHandler("wpglobus_yoast_analysis",{language:s})||(o.hasClass("wpseo_generic_tab")?(p("#wpseo-pageanalysis_"+s).css({display:"none"}),p("#yoast-seo-content-analysis_"+s).css({display:"block"}),p("#wpseo_content_"+s+" table tr").eq(0).css({display:"none"}),p("#wpseo_content_"+s+" table tr").eq(1).css({display:"none"}),p("#yoast-seo-content-analysis_"+s+" li a").css({float:"none"})):o.hasClass("wpseo_keyword_tab")?(WPGlobusYoastSeoPremium&&(p("#wpseo-meta-section-content_"+s+" .wpseo_keyword_tab").removeClass("active"),a.parent(".wpseo_keyword_tab").addClass("active"),p("#wpseo-metabox-tabs_"+s+" .wpseo_keyword_tab").each(function(e,t){if(p(t).hasClass("active"))return d.keywordIndex[s]=e,!1})),t=d.getKeywordsOrig()[d.keywordIndex[s]].keyword,YoastSEO.app.rawData.keyword=t,p("#yoast_wpseo_focuskw_text_input").val(t),p("#yoast_wpseo_focuskw_text_input_"+s).val(t),p('input[name="yoast_wpseo_focuskw"]').val(t),n.prototype.analyze(),p("#wpseo-pageanalysis_"+s).css({display:"block"}),p("#yoast-seo-content-analysis_"+s).css({display:"none"}),p("#wpseo_content_"+s+" table tr").eq(0).css("display",""),p("#wpseo_content_"+s+" table tr").eq(1).css("display","")):o.hasClass("wpglobus-wpseo_keyword_tab"))}),p(".wpseo-metabox-sidebar .wpseo-meta-section-link").on("click",function(e){"#wpseo-meta-section-content"==p(this).attr("href")?p("#wpglobus-wpseo-tabs").css({display:"block"}):p("#wpglobus-wpseo-tabs").css({display:"none"})}),p(document).on("click","."+d.editSnippetButtonClass,function(e){var t=p(this),a=t.data("language"),s=p("."+d.editSnippetFormClass+"_"+a),o=p("."+d.editSnippetSubmitClass+"_"+a),n=p("."+d.editSnippetHeadingClass+"_"+a);s.hasClass("snippet-editor--hidden")?(s.removeClass("snippet-editor--hidden"),n.removeClass("snippet-editor--hidden"),o.removeClass("snippet-editor--hidden")):(s.addClass("snippet-editor--hidden"),n.addClass("snippet-editor--hidden")),t.addClass("snippet-editor--hidden")}),p(document).on("click","."+d.editSnippetSubmitClass,function(e){var t=p(this).data("language"),a=p("."+d.editSnippetButtonClass+"_"+t),s=p("."+d.editSnippetFormClass+"_"+t),o=p("."+d.editSnippetSubmitClass+"_"+t),n=p("."+d.editSnippetHeadingClass+"_"+t);a.removeClass("snippet-editor--hidden"),s.addClass("snippet-editor--hidden"),o.addClass("snippet-editor--hidden"),n.addClass("snippet-editor--hidden")}),p(document).on("keyup","input.wpglobus-snippet-editor-title",function(e){var t=p(this),a=t.data("language"),s=WPGlobusCore.getString(p('input[name="yoast_wpseo_title"]').val(),t.val(),a);p("#snippet_title_"+a).html(r.replaceVariablesPlugin(t.val())),YoastSEO.app.rawData.pageTitle=s,p('input[name="yoast_wpseo_title"]').val(s),p("#snippet_title").text(s),_.debounce(d.updateProgressBar(t,a),500)}),p(document).on("keyup","input.wpglobus-snippet-editor-slug",function(e){var t=p(this),a=t.data("language");p("#snippet_cite_"+a).text(t.val()+"/"),p("#editable-post-name").text(t.val()),p("#editable-post-name-full").text(t.val())}),p(document).on("change","input.wpglobus-snippet-editor-slug",function(e){var t=p(this);p.post(ajaxurl,{action:"sample-permalink",post_id:p("#post_ID").val()||0,new_slug:t.val(),new_title:p("#title").val(),samplepermalinknonce:p("#samplepermalinknonce").val()})}),p(document).on("keyup","textarea.wpglobus-snippet-editor-meta-description",function(e){var t=p(this),a=t.data("language");p("#snippet_meta_"+a).text(t.val());var s=WPGlobusCore.getString(p("#yoast_wpseo_metadesc").val(),t.val(),t.data("language"));p("#yoast_wpseo_metadesc").val(s),p("#snippet_meta").text(s),_.debounce(d.updateProgressBar(t,a),500)}),p(document).on("click",".wpglobus-post-body-tabs-list li",function(e){var t,a=p(this);a.hasClass("wpglobus-post-tab")&&(p("#wpglobus-wpseo-tabs").tabs("option","active",a.data("order")),t=p("#yoast_wpseo_focuskw_text_input_"+a.data("language")).val(),YoastSEO.app.rawData.keyword=t,p("#yoast_wpseo_focuskw_text_input").val(t),p('input[name="yoast_wpseo_focuskw"]').val(t),n.prototype.analyze())}),d.initAddKeywordPopup()},getKeywordsOrig:function(){return p(".wpseo_keyword_tab").map(function(e,t){return{keyword:(t=p(t).find(".wpseo_tablink")).data("keyword")+"",score:t.data("score")}}).get()}},(n=function(){this.replaceVars=wpseoReplaceVarsL10n.replace_vars,this.language=WPGlobusCoreData.default_language,this.tab=WPGlobusCoreData.default_language,this.wpseoTab=WPGlobusCoreData.default_language,this.title_template=wpseoPostScraperL10n.title_template,this.focuskw=p("#yoast_wpseo_focuskw_text_input"),this.focuskw_hidden=p('input[name="yoast_wpseo_focuskw"]'),this.focuskwKeep=!1,this.post_slug="#editable-post-name-full",YoastSEO.app.registerPlugin("wpglobusYoastSeoPlugin",{status:"ready"}),YoastSEO.app.registerModification("content",this.contentModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("title",this.titleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_title",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_meta",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_page_title",this.pageTitleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_meta_desc",this.metaDescModification,"wpglobusYoastSeoPlugin",0),n.prototype.setScoreIcon(),p(document).on("blur",".wpglobus-snippet_title",function(e){var t=p(this),a=WPGlobusCore.getString(p("#yoast_wpseo_title").val(),t.text(),t.data("language"));YoastSEO.app.rawData.pageTitle=a,p('input[name="yoast_wpseo_title"]').val(a),p("#snippet_title").text(a)}),p(document).on("blur",".wpglobus-snippet_meta",function(e){var t=p(this),a=WPGlobusCore.getString(p("#yoast_wpseo_metadesc").val(),t.text(),t.data("language"));p("#yoast_wpseo_metadesc").val(a),p("#snippet_meta").text(a)}),p(document).on("keyup",".wpglobus-yoast_wpseo_focuskw_text_input",function(e){var t=p(this),a=t.val(),s=t.data("language");r.focuskw.val(a),r.focuskw_hidden.val(a),r.updateWpseoKeyword(a,s),0==WPGlobusYoastSeo.keywordIndex[s]?p("#yoast_wpseo_focuskw_text_input_"+s).data("value",a):WPGlobusYoastSeoPremium&&WPGlobusYoastSeoPremium.setFocuskeyword(s),n.prototype.analyze()}),p("#publish,#save-post").on("mouseenter",function(e){var s,o="";p(".wpglobus-yoast_wpseo_focuskw_text_input").each(function(e,t){var a;s=p(this),o=s.data("language")==WPGlobusCoreData.default_language&&WPGlobusYoastSeoPremium?(a=WPGlobusYoastSeo.getKeywordsOrig(),WPGlobusCore.getString(o,a[0].keyword,s.data("language"))):WPGlobusCore.getString(o,s.val(),s.data("language"))}),r.focuskw.val(o),r.focuskw_hidden.val(o)}).on("mouseleave",function(e){r.focuskwKeep||(r.wpseoTab=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language"),p(this),r.focuskw.val(p("#yoast_wpseo_focuskw_text_input_"+r.wpseoTab).val()),r.focuskw_hidden.val(p("#yoast_wpseo_focuskw_text_input_"+r.wpseoTab).val()))}).on("click",function(e){r.focuskwKeep=!0}),p(document).on("tabsactivate",WPGlobusYoastSeo.wpseoTabSelector,function(e,t){var a;r.language=t.newPanel.attr("data-language"),WPGlobusYoastSeo.wpseoTab=r.language,t.newPanel.attr("data-language")===WPGlobusCoreData.default_language&&(a=WPGlobusYoastSeoPremium?(p("#wpseo-meta-section-content_"+WPGlobusYoastSeoPremium.dLang+" .wpseo_keyword_tab").removeClass("active"),p("#wpseo-meta-section-content_"+WPGlobusYoastSeoPremium.dLang+" .wpseo_keyword_tab").eq(WPGlobusYoastSeo.keywordIndex[WPGlobusYoastSeoPremium.dLang]).addClass("active"),p("#yoast_wpseo_focuskw_text_input_"+WPGlobusYoastSeoPremium.dLang).val()):p("#yoast_wpseo_focuskw_text_input_"+WPGlobusCoreData.default_language).val(),YoastSEO.app.rawData.keyword=a,r.focuskw.val(a),r.focuskw_hidden.val(a)),p("#wpseo-metabox-tabs_"+r.language+" .wpseo_keyword_tab").each(function(e,t){if(p(t).hasClass("active"))return WPGlobusYoastSeo.keywordIndex[r.language]=e,!1}),n.prototype.analyze()}),r=this}).prototype.analyze=function(){var e=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language");e!=WPGlobusCoreData.default_language&&0!=p("#editable-post-name-full-"+e).length?YoastSEO.app.snippetPreview.data.urlPath=p("#editable-post-name-full-"+e).text():YoastSEO.app.snippetPreview.data.urlPath=p("#editable-post-name-full").text(),YoastSEO.app.analyzeTimer(YoastSEO.app),n.prototype.setScoreIcon()},n.prototype.setScoreIcon=function(){var s=setInterval(function(){var e=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language"),t=p("#wpseo-meta-section-content .wpseo_generic_tab a").data("score"),a=p("#wpseo-meta-section-content .wpseo_keyword_tab a").data("score");""!=t&&(p("#wpseo-metabox-tabs_"+e+" .wpseo_generic_tab .wpseo-score-icon").removeClass("bad ok good 100 na"),p("#wpseo-metabox-tabs_"+e+" .wpseo_generic_tab .wpseo-score-icon").addClass(t)),""!=a&&(p("#wpseo-metabox-tabs_"+e+" .wpseo_keyword_tab .wpseo-score-icon").removeClass("bad ok good 100 na"),p("#wpseo-metabox-tabs_"+e+" .wpseo_keyword_tab .wpseo-score-icon").addClass(a)),clearInterval(s)},1500)},n.prototype.getWPseoTab=function(){return p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language")},n.prototype.citeModification=function(e){var t="#snippet_citeBase_"+e,a="#snippet_cite_"+e,s=p("#wpseo-tab-"+e).data("yoast-cite-base");!1===p("#wpseo-tab-"+e).data("cite-contenteditable")&&p(a).attr("contenteditable","false"),p(t).text(s)},n.prototype.pageTitleModification=function(e){var a,s="#snippet_title_",o="",n="";if(r.title_template==e)p.each(WPGlobusCoreData.enabled_languages,function(e,t){i=p("#snippet-editor-title_"+t).val(),l=0==i.length?r.title_template:i,o=r.replaceVariablesPlugin(l),p(s+t).text(o),t==r.getWPseoTab()&&(n=o)});else{if(a=WPGlobusCore.getTranslations(e),r.getWPseoTab()!==WPGlobusCoreData.default_language&&a[WPGlobusCoreData.default_language]==e){var i,t=r.getWPseoTab(),l=0<(i=p("#snippet-editor-title_"+t).val()).length?i:r.title_template;return l=r.replaceVariablesPlugin(l),p(s+t).text(l),l}p.each(WPGlobusCoreData.enabled_languages,function(e,t){o=""===a[t]?r.replaceVariablesPlugin(r.title_template):r.replaceVariablesPlugin(a[t]),t==r.getWPseoTab()&&(n=o,0!=(i=p("#snippet-editor-title_"+t).val()).length?i!=n&&(n=r.replaceVariablesPlugin(i)):n=r.replaceVariablesPlugin(r.title_template)),p(s+t).html(n)})}return n},n.prototype.metaDescModification=function(a){var s="#snippet_meta_",e=WPGlobusCore.getTranslations(a),t="",o=p("#snippet-editor-meta-description_"+r.getWPseoTab()).val();if(r.getWPseoTab()===WPGlobusCoreData.default_language||e[WPGlobusCoreData.default_language]!=a)return p.each(WPGlobusCoreData.enabled_languages,function(e,t){p(s+t).text(WPGlobusCore.TextFilter(a,t,"RETURN_EMPTY")),r.citeModification(t)}),o==e[r.getWPseoTab()]?0==(t=e[r.getWPseoTab()]).length&&p(s+r.getWPseoTab()).text(WPGlobusCore.TextFilter(YoastSEO.app.snippetPreview.data.metaDesc,WPGlobusCoreData.default_language,"RETURN_EMPTY")):0==(t=o).length?p(s+r.getWPseoTab()).text(WPGlobusCore.TextFilter(YoastSEO.app.snippetPreview.data.metaDesc,WPGlobusCoreData.default_language,"RETURN_EMPTY")):p(s+r.getWPseoTab()).text(t),p(s+r.getWPseoTab()).text(t),t;var n=r.getWPseoTab();return r.citeModification(n),0==o.length?p(s+n).text(""):o!=a&&p(s+n).text(o),a},n.prototype.snippetModification=function(e){return WPGlobusCore.TextFilter(e,r.getWPseoTab(),"RETURN_EMPTY")},n.prototype.contentModification=function(e){return r.getWPseoTab()==WPGlobusCoreData.default_language?e:p("#content_"+r.getWPseoTab()).val()},n.prototype.titleModification=function(e){return setTimeout(r.updatePageAnalysis,1e3),r.getWPseoTab()==WPGlobusCoreData.default_language?e:p("#title_"+r.getWPseoTab()).val()},n.prototype.defaultReplace=function(e){var t=YoastSEO.app.rawData.keyword;return e.replace(/%%sitedesc%%/g,this.replaceVars.sitedesc).replace(/%%sitename%%/g,WPGlobusCore.TextFilter(this.replaceVars.sitename,r.getWPseoTab())).replace(/%%term_title%%/g,this.replaceVars.term_title).replace(/%%term_description%%/g,this.replaceVars.term_description).replace(/%%category_description%%/g,this.replaceVars.category_description).replace(/%%tag_description%%/g,this.replaceVars.tag_description).replace(/%%searchphrase%%/g,this.replaceVars.searchphrase).replace(/%%date%%/g,this.replaceVars.date).replace(/%%id%%/g,this.replaceVars.id).replace(/%%page%%/g,this.replaceVars.page).replace(/%%currenttime%%/g,this.replaceVars.currenttime).replace(/%%currentdate%%/g,this.replaceVars.currentdate).replace(/%%currentday%%/g,this.replaceVars.currentday).replace(/%%currentmonth%%/g,this.replaceVars.currentmonth).replace(/%%currentyear%%/g,this.replaceVars.currentyear).replace(/%%focuskw%%/g,t)},n.prototype.replaceVariablesPlugin=function(e){return void 0!==e&&(e=this.titleReplace(e),e=this.defaultReplace(e),e=this.replaceSeparators(e)),e},n.prototype.replaceSeparators=function(e){return e.replace(/%%sep%%(\s+%%sep%%)*/g,this.replaceVars.sep)},n.prototype.titleReplace=function(e){var t="";return void 0===(t=this.language==WPGlobusCoreData.default_language?p("#title").val():p("#title_"+this.language).val())&&(t=YoastSEO.app.rawData.pageTitle),this.language!=WPGlobusCoreData.default_language&&0==t.length&&(t=p("#title").val()),e=e.replace(/%%title%%/g,t)},n.prototype.doubleSepReplace=function(e){var t=YoastSEO.app.stringHelper.addEscapeChars(this.replaceVars.sep),a=new RegExp(t+" "+t,"g");return e=e.replace(a,this.replaceVars.sep)},n.prototype.updateWpseoKeyword=function(e,t){0<p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").length&&p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").removeClass("wpseo-keyword").addClass("wpglobus-wpseo_keyword_"+t),p(".wpglobus-wpseo_keyword_"+t).text(e)},n.prototype.updatePageAnalysis=function(){p("#wpseo-pageanalysis_"+r.getWPseoTab()).html(p("#wpseo-pageanalysis").html()),p("#yoast-seo-content-analysis_"+r.getWPseoTab()).html(p("#yoast-seo-content-analysis").html()),p("#yoast-seo-content-analysis_"+r.getWPseoTab()+" li a").css({float:"none"})}),window.WPGlobusYoastSeoPlugin=new n)});
|
1 |
+
var WPGlobusYoastSeo,WPGlobusYoastSeoPremium=!1;jQuery(document).ready(function(p){"use strict";var r,d,s;"undefined"!=typeof wpseoReplaceVarsL10n&&"undefined"!=typeof WPGlobusCoreData&&"undefined"!=typeof WPGlobusVendor&&("edit-tags.php"==WPGlobusVendor.pagenow||"term.php"==WPGlobusVendor.pagenow?(d=WPGlobusYoastSeo={editorIDs:["description"],editor:{},submitId:"#submit",preventChangeEditor:!1,observer:null,init:function(){d.attachListeners(),_.delay(d.start,1500)},submit:function(e){"mouseenter"===e.type?p.each(d.editor,function(e,t){!d.editor[e].contentEditor||d.editor[e].contentEditor.isHidden()?p("#"+e).val(d.editor[e].content):tinymce.get(e).setContent(d.editor[e].content)}):"mouseleave"===e.type?d.preventChangeEditor||(p.each(d.editor,function(e,t){!d.editor[e].contentEditor||d.editor[e].contentEditor.isHidden()?p("#"+e).val(WPGlobusCore.TextFilter(t.content,d.getCurrentTab(),"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,d.getCurrentTab(),"RETURN_EMPTY"))}),d.preventChangeEditor=!1):"click"===e.type&&(d.preventChangeEditor=!0,"tinymce"!=getUserSetting("editor")&&setUserSetting("editor","tinymce"))},attachListeners:function(){p(".wrap").on("tabsactivate",function(e,a){p.each(d.editor,function(e,t){!d.editor[e].contentEditor||d.editor[e].contentEditor.isHidden()?p("#"+e).val(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY"))})}),p(document).on("mouseenter",d.submitId,d.submit).on("mouseleave",d.submitId,d.submit).on("click",d.submitId,d.submit),p(document).on("tinymce-editor-init",function(e,t){var a;-1!=_.indexOf(d.editorIDs,t.id)&&(a=p("#"+t.id),d.editor[t.id]={},d.editor[t.id].contentEditor=t,d.editor[t.id].content=a.val(),t.setContent(WPGlobusCore.TextFilter(d.editor[t.id].content,WPGlobusCoreData.default_language,"RETURN_EMPTY")),p("#"+t.getContainer().id).find("iframe").addClass("wpglobus-translatable"),a.removeClass("hidden"),t.on("nodechange keyup",_.debounce(d.update,500)),a.on("input keyup",_.debounce(d.update,500)))})},update:function(e){var t;void 0!==e.target&&("tinymce"==(t=e.target.id)&&(t=e.target.dataset.id),void 0!==d.editor[t].contentEditor&&(e=!d.editor[t].contentEditor||d.editor[t].contentEditor.isHidden()?p("#"+t).val():d.editor[t].contentEditor.getContent({format:"raw"}),d.editor[t].content=WPGlobusCore.getString(d.editor[t].content,e,d.getCurrentTab())))},getCurrentTab:function(){return p(".wpglobus-taxonomy-tabs-list .ui-tabs-active").data("language")},start:function(){p(".wpglobus-element_description").css({display:"none"})}},WPGlobusYoastSeo.init(),s=function(){p(".wrap").on("tabsactivate",function(e,t){t.newTab[0].dataset.language==WPGlobusCoreData.default_language?p("#poststuff .inside").css({display:"block"}):p("#poststuff .inside").css({display:"none"})}),p.each(["category_description","sitedesc","sitename","tag_description","term_description","term_title"],function(e,t){wpseoReplaceVarsL10n.replace_vars[t]=WPGlobusCore.TextFilter(wpseoReplaceVarsL10n.replace_vars[t],WPGlobusCoreData.default_language)}),WPGlobusYoastSeo.observer=new MutationObserver(function(e){e.forEach(function(e){"placeholder"==e.attributeName&&(WPGlobusYoastSeo.observer.disconnect(),""==(e=p("#wpseo_focuskw")).val()&&e.attr("placeholder",WPGlobusCore.TextFilter(e.attr("placeholder"),WPGlobusCoreData.default_language)),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0}))})}),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0})}):(d=WPGlobusYoastSeo={wpseoTabSelector:"#wpglobus-wpseo-tabs",url:"",attrs:p("#wpglobus-wpseo-attr"),iB:p("#wpseo-meta-section-content"),t:p("#wpseo-meta-section-content"),ids:"",names:"",wpseoTab:WPGlobusCoreData.default_language,editSnippetButtonClass:"wpglobus-snippet-editor__edit-button",editSnippetFormClass:"wpglobus-snippet-editor__form",editSnippetSubmitClass:"wpglobus-snippet-editor__submit",editSnippetHeadingClass:"wpglobus-snippet-editor__heading-editor",yoastTitleProgress:"wpglobus-yoast-title-progress",yoastMetadescProgress:"wpglobus-yoast-metadesc-progress",yoastPremium:WPGlobusVendor.vendor.WPSEO_PREMIUM,keywordIndex:{},init:function(){p.each(WPGlobusCoreData.enabled_languages,function(e,t){d.keywordIndex[t]=0}),d.start()},initAddKeywordPopup:function(){1==p("#wpseo-add-keyword-popup").length?p(".wpseo-add-keyword").on("click",d.addKeywordPopup):WPGlobusYoastSeoPremium&&WPGlobusYoastSeoPremium.addKeywordButton()},addKeywordPopup:function(){var e=p("#wpseo-add-keyword-popup-button").text();tb_show(e,"#TB_inline?width=650&height=350&inlineId=wpseo-add-keyword-popup","group"),p("#TB_window").css("height",235),p("#TB_window").css("width",680)},qtip:function(){p(".yoast_help").qtip({content:{attr:"alt"},position:{my:"bottom left",at:"top center"},style:{tip:{corner:!0},classes:"yoast-qtip qtip-rounded qtip-blue"},show:"click",hide:{fixed:!0,delay:500}})},removeClasses:function(t,e){_.each(e,function(e){t.removeClass(e)})},updateProgressBar:function(e,t){var a,s,o,n,i,l;void 0!==e&&(void 0===t&&void 0===(t="undefined"!==e.data("language")?e.data("language"):t)||(o="",n=l=0,i=!(a=["snippet-editor__progress--bad","snippet-editor__progress--ok","snippet-editor__progress--good"]),l=e.val().length,e.hasClass("wpglobus-snippet-editor-title")?(n=(s=p("progress."+d.yoastTitleProgress+"_"+t)).attr("max"),o=a[2],0==l?o=a[1]:n<l?(o=a[1],i=!0):0<l&&l<35&&(o=a[1])):e.hasClass("wpglobus-snippet-editor-meta-description")&&(n=(s=p("progress."+d.yoastMetadescProgress+"_"+t)).attr("max"),o=a[2],0==l?o=a[1]:n<l?(o=a[1],i=!0):0<l&&l<121&&(o=a[1])),d.removeClasses(s,a),s.attr("value",l).addClass(o),i?e.css("color","#f00"):e.css("color","#000")))},updateWpseoKeyword:function(e,t){p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").text(e)},start:function(){p(d.wpseoTabSelector).tabs(),d.ids=d.attrs.data("ids"),d.names=d.attrs.data("names"),d.ids=d.ids+","+d.attrs.data("qtip"),d.ids=d.ids.split(","),d.names=d.names.split(","),p("#wpglobus-wpseo-tabs").insertBefore(d.iB),p(".wpseo-metabox-tabs").css({height:"26px"}),p(".wpglobus-wpseo-general").each(function(e,t){var a=p(t),s=a.data("language"),t="wpseo-meta-section-content_"+s;a.html('<div id="'+t+'" class="wpseo-meta-section wpglobus-wpseo-meta-section" style="width:100%" data-language="'+s+'">'+d.t.html()+"</div>"),p("#"+t+" .wpseo-metabox-tabs").attr("id","wpseo-metabox-tabs_"+s).attr("data-language",s),p("#"+t+" .wpseotab").attr("id","wpseo_content_"+s),p("#wpseo_content_"+s).css({float:"left"}),p("#"+t).css({display:"block"}),p("#wpseo_meta").css({overflow:"hidden"}),p("#"+t+" .snippet_container").addClass("wpglobus-snippet_container"),s!==WPGlobusCoreData.default_language&&p("#"+t+" .wpseo-add-keyword").addClass("hidden"),p.each(d.names,function(e,t){p("#"+t).attr("name",t+"_"+s)}),p.each(d.ids,function(e,t){var a=p("#"+t);"wpseosnippet"==t&&a.addClass("wpglobus-wpseosnippet"),"snippet_title"==t&&a.addClass("wpglobus-snippet_title"),"snippet_meta"==t&&a.addClass("wpglobus-snippet_meta"),"snippet_cite"==t&&a.addClass("wpglobus-snippet_cite"),"snippet_citeBase"==t&&a.addClass("wpglobus-snippet_citeBase"),"url_container"==t&&a.css({height:"16px"}),"yoast_wpseo_focuskw_text_input"==t&&(a.addClass("wpglobus-yoast_wpseo_focuskw_text_input"),a.attr("data-value",""),a.parents("div#wpseofocuskeyword").attr("id","wpseofocuskeyword_"+s)),"yoast_wpseo_focuskeywords"==t&&a.addClass("wpglobus-yoast_wpseo_focuskeywords"),"wpseo-pageanalysis"==t&&a.addClass("wpglobus-wpseo-pageanalysis"),"yoast-seo-content-analysis"==t&&a.addClass("wpglobus-yoast-seo-content-analysis"),"snippet_preview"==t&&a.addClass("wpglobus-snippet_preview"),"snippet-editor-title"==t&&(a.addClass("wpglobus-snippet-editor-title"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),a.val(p("#wpseo-tab-"+s).data("wpseotitle")),a.parent("label").next("progress").addClass(d.yoastTitleProgress).addClass(d.yoastTitleProgress+"_"+s),_.debounce(d.updateProgressBar(a,s),500)),"snippet-editor-slug"==t&&(a.addClass("wpglobus-snippet-editor-slug"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),WPGlobusCoreData.default_language!=s&&a.attr("disabled","disabled")),"snippet-editor-meta-description"==t&&(a.addClass("wpglobus-snippet-editor-meta-description"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),a.val(p("#wpseo-tab-"+s).data("metadesc")),a.parent("label").next("progress").addClass(d.yoastMetadescProgress).addClass(d.yoastMetadescProgress+"_"+s),_.debounce(d.updateProgressBar(a,s),500)),"snippetpreview-help-toggle"==t&&(a.addClass("wpglobus-snippetpreview-help-toggle_"+s),p(document).on("click",".wpglobus-snippetpreview-help-toggle_"+s,function(e){var t=p(this);"none"===p("#snippetpreview-help_"+t.data("language")).css("display")?p("#snippetpreview-help_"+t.data("language")).css({display:"block"}):p("#snippetpreview-help_"+t.data("language")).css({display:"none"})})),"focuskw_text_input-help-toggle"==t&&(a.addClass("wpglobus-focuskw_text_input-help-toggle_"+s),p(document).on("click",".wpglobus-focuskw_text_input-help-toggle_"+s,function(e){var t=p(this);"none"===p("#focuskw_text_input-help_"+t.data("language")).css("display")?p("#focuskw_text_input-help_"+t.data("language")).css({display:"block"}):p("#focuskw_text_input-help_"+t.data("language")).css({display:"none"})})),"pageanalysis-help-toggle"==t&&(a.addClass("wpglobus-pageanalysis-help-toggle_"+s),p(document).on("click",".wpglobus-pageanalysis-help-toggle_"+s,function(e){var t=p(this);"none"===p("#pageanalysis-help_"+t.data("language")).css("display")?p("#pageanalysis-help_"+t.data("language")).css({display:"block"}):p("#pageanalysis-help_"+t.data("language")).css({display:"none"})})),a.attr("id",t+"_"+s),p("#"+t+"_"+s).attr("data-language",s)});a=WPGlobusCore.TextFilter(p("#yoast_wpseo_focuskw_text_input").val(),s,"RETURN_EMPTY");p("#yoast_wpseo_focuskw_text_input_"+s).val(a).data("value",a),p("#yoast_wpseo_focuskw_"+s).val(a),d.updateWpseoKeyword(a,s),s!==WPGlobusCoreData.default_language&&(p("#"+t+" #yoast_wpseo_focuskw_text_input_"+s).addClass("hidden").after('<div class="wpglobus-suggest" style="font-weight:bold;">'+WPGlobusVendor.i18n.yoastseo_plus_access+"</div>"),p("#"+t+" #wpseo-pageanalysis_"+s).addClass("hidden").css({display:"none"})),WPGlobusYoastSeoPremium&&(s==WPGlobusCoreData.default_language||(p("#wpseo-metabox-tabs_"+s+" .wpseo_keyword_tab").removeClass("wpseo_keyword_tab").addClass("wpglobus-wpseo_keyword_tab"),p("#wpseo-meta-section-content_"+s+" .wpseo_keyword_tab_hideable").css({display:"none"}).attr("data-language",s)))}),p(".wpglobus-wpseosnippet").each(function(e,t){var a=p(t),t=a.data("language");a.find("button.snippet-editor__button.snippet-editor__edit-button").addClass(d.editSnippetButtonClass).addClass(d.editSnippetButtonClass+"_"+t).attr("data-language",t),a.find(".snippet-editor__form").addClass(d.editSnippetFormClass).addClass(d.editSnippetFormClass+"_"+t),a.find(".snippet-editor__heading-editor").addClass(d.editSnippetHeadingClass).addClass(d.editSnippetHeadingClass+"_"+t),a.find(".snippet-editor__submit").addClass(d.editSnippetSubmitClass).addClass(d.editSnippetSubmitClass+"_"+t).attr("data-language",t)}),d.iB.addClass("hidden"),d.iB.css({height:0,overflow:"hidden",display:"none"}),WPGlobusYoastSeoPremium&&p("#wpseo-meta-section-content .wpseo_keyword_tab").removeClass("wpseo_keyword_tab").addClass("wpseo_keyword_tab_original");var e=WPGlobusCore.TextFilter(p("#yoast_wpseo_focuskw_text_input").val(),WPGlobusCoreData.default_language,"RETURN_EMPTY");p("#yoast_wpseo_focuskw_text_input").val(e),p("#yoast_wpseo_focuskw").val(e),p(document).on("click",".wpglobus-wpseo-general .wpseo_tablink",function(e){e.preventDefault();var t=p(this),a=t.parents("ul").data("language"),e=t.parent("li");a!=WPGlobusCoreData.default_language&&void 0===p(document).triggerHandler("wpglobus_yoast_analysis",{language:a})||(e.hasClass("wpseo_generic_tab")?(p("#wpseo-pageanalysis_"+a).css({display:"none"}),p("#yoast-seo-content-analysis_"+a).css({display:"block"}),p("#wpseo_content_"+a+" table tr").eq(0).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(1).css({display:"none"}),p("#yoast-seo-content-analysis_"+a+" li a").css({float:"none"})):e.hasClass("wpseo_keyword_tab")?(WPGlobusYoastSeoPremium&&(p("#wpseo-meta-section-content_"+a+" .wpseo_keyword_tab").removeClass("active"),t.parent(".wpseo_keyword_tab").addClass("active"),p("#wpseo-metabox-tabs_"+a+" .wpseo_keyword_tab").each(function(e,t){if(p(t).hasClass("active"))return d.keywordIndex[a]=e,!1})),t=d.getKeywordsOrig()[d.keywordIndex[a]].keyword,YoastSEO.app.rawData.keyword=t,p("#yoast_wpseo_focuskw_text_input").val(t),p("#yoast_wpseo_focuskw_text_input_"+a).val(t),p('input[name="yoast_wpseo_focuskw"]').val(t),s.prototype.analyze(),p("#wpseo-pageanalysis_"+a).css({display:"block"}),p("#yoast-seo-content-analysis_"+a).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(0).css("display",""),p("#wpseo_content_"+a+" table tr").eq(1).css("display","")):e.hasClass("wpglobus-wpseo_keyword_tab"))}),p(".wpseo-metabox-sidebar .wpseo-meta-section-link").on("click",function(e){"#wpseo-meta-section-content"==p(this).attr("href")?p("#wpglobus-wpseo-tabs").css({display:"block"}):p("#wpglobus-wpseo-tabs").css({display:"none"})}),p(document).on("click","."+d.editSnippetButtonClass,function(e){var t=p(this),a=t.data("language"),s=p("."+d.editSnippetFormClass+"_"+a),o=p("."+d.editSnippetSubmitClass+"_"+a),a=p("."+d.editSnippetHeadingClass+"_"+a);s.hasClass("snippet-editor--hidden")?(s.removeClass("snippet-editor--hidden"),a.removeClass("snippet-editor--hidden"),o.removeClass("snippet-editor--hidden")):(s.addClass("snippet-editor--hidden"),a.addClass("snippet-editor--hidden")),t.addClass("snippet-editor--hidden")}),p(document).on("click","."+d.editSnippetSubmitClass,function(e){var t=p(this).data("language"),a=p("."+d.editSnippetButtonClass+"_"+t),s=p("."+d.editSnippetFormClass+"_"+t),o=p("."+d.editSnippetSubmitClass+"_"+t),t=p("."+d.editSnippetHeadingClass+"_"+t);a.removeClass("snippet-editor--hidden"),s.addClass("snippet-editor--hidden"),o.addClass("snippet-editor--hidden"),t.addClass("snippet-editor--hidden")}),p(document).on("keyup","input.wpglobus-snippet-editor-title",function(e){var t=p(this),a=t.data("language"),s=WPGlobusCore.getString(p('input[name="yoast_wpseo_title"]').val(),t.val(),a);p("#snippet_title_"+a).html(r.replaceVariablesPlugin(t.val())),YoastSEO.app.rawData.pageTitle=s,p('input[name="yoast_wpseo_title"]').val(s),p("#snippet_title").text(s),_.debounce(d.updateProgressBar(t,a),500)}),p(document).on("keyup","input.wpglobus-snippet-editor-slug",function(e){var t=p(this),a=t.data("language");p("#snippet_cite_"+a).text(t.val()+"/"),p("#editable-post-name").text(t.val()),p("#editable-post-name-full").text(t.val())}),p(document).on("change","input.wpglobus-snippet-editor-slug",function(e){var t=p(this);p.post(ajaxurl,{action:"sample-permalink",post_id:p("#post_ID").val()||0,new_slug:t.val(),new_title:p("#title").val(),samplepermalinknonce:p("#samplepermalinknonce").val()})}),p(document).on("keyup","textarea.wpglobus-snippet-editor-meta-description",function(e){var t=p(this),a=t.data("language");p("#snippet_meta_"+a).text(t.val());var s=WPGlobusCore.getString(p("#yoast_wpseo_metadesc").val(),t.val(),t.data("language"));p("#yoast_wpseo_metadesc").val(s),p("#snippet_meta").text(s),_.debounce(d.updateProgressBar(t,a),500)}),p(document).on("click",".wpglobus-post-body-tabs-list li",function(e){var t=p(this);t.hasClass("wpglobus-post-tab")&&(p("#wpglobus-wpseo-tabs").tabs("option","active",t.data("order")),t=p("#yoast_wpseo_focuskw_text_input_"+t.data("language")).val(),YoastSEO.app.rawData.keyword=t,p("#yoast_wpseo_focuskw_text_input").val(t),p('input[name="yoast_wpseo_focuskw"]').val(t),s.prototype.analyze())}),d.initAddKeywordPopup()},getKeywordsOrig:function(){return p(".wpseo_keyword_tab").map(function(e,t){return{keyword:(t=p(t).find(".wpseo_tablink")).data("keyword")+"",score:t.data("score")}}).get()}},(s=function(){this.replaceVars=wpseoReplaceVarsL10n.replace_vars,this.language=WPGlobusCoreData.default_language,this.tab=WPGlobusCoreData.default_language,this.wpseoTab=WPGlobusCoreData.default_language,this.title_template=wpseoPostScraperL10n.title_template,this.focuskw=p("#yoast_wpseo_focuskw_text_input"),this.focuskw_hidden=p('input[name="yoast_wpseo_focuskw"]'),this.focuskwKeep=!1,this.post_slug="#editable-post-name-full",YoastSEO.app.registerPlugin("wpglobusYoastSeoPlugin",{status:"ready"}),YoastSEO.app.registerModification("content",this.contentModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("title",this.titleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_title",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_meta",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_page_title",this.pageTitleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_meta_desc",this.metaDescModification,"wpglobusYoastSeoPlugin",0),s.prototype.setScoreIcon(),p(document).on("blur",".wpglobus-snippet_title",function(e){var t=p(this),t=WPGlobusCore.getString(p("#yoast_wpseo_title").val(),t.text(),t.data("language"));YoastSEO.app.rawData.pageTitle=t,p('input[name="yoast_wpseo_title"]').val(t),p("#snippet_title").text(t)}),p(document).on("blur",".wpglobus-snippet_meta",function(e){var t=p(this),t=WPGlobusCore.getString(p("#yoast_wpseo_metadesc").val(),t.text(),t.data("language"));p("#yoast_wpseo_metadesc").val(t),p("#snippet_meta").text(t)}),p(document).on("keyup",".wpglobus-yoast_wpseo_focuskw_text_input",function(e){var t=p(this),a=t.val(),t=t.data("language");r.focuskw.val(a),r.focuskw_hidden.val(a),r.updateWpseoKeyword(a,t),0==WPGlobusYoastSeo.keywordIndex[t]?p("#yoast_wpseo_focuskw_text_input_"+t).data("value",a):WPGlobusYoastSeoPremium&&WPGlobusYoastSeoPremium.setFocuskeyword(t),s.prototype.analyze()}),p("#publish,#save-post").on("mouseenter",function(e){var s,o="";p(".wpglobus-yoast_wpseo_focuskw_text_input").each(function(e,t){var a;s=p(this),o=s.data("language")==WPGlobusCoreData.default_language&&WPGlobusYoastSeoPremium?(a=WPGlobusYoastSeo.getKeywordsOrig(),WPGlobusCore.getString(o,a[0].keyword,s.data("language"))):WPGlobusCore.getString(o,s.val(),s.data("language"))}),r.focuskw.val(o),r.focuskw_hidden.val(o)}).on("mouseleave",function(e){r.focuskwKeep||(r.wpseoTab=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language"),p(this),r.focuskw.val(p("#yoast_wpseo_focuskw_text_input_"+r.wpseoTab).val()),r.focuskw_hidden.val(p("#yoast_wpseo_focuskw_text_input_"+r.wpseoTab).val()))}).on("click",function(e){r.focuskwKeep=!0}),p(document).on("tabsactivate",WPGlobusYoastSeo.wpseoTabSelector,function(e,t){r.language=t.newPanel.attr("data-language"),WPGlobusYoastSeo.wpseoTab=r.language,t.newPanel.attr("data-language")===WPGlobusCoreData.default_language&&(t=WPGlobusYoastSeoPremium?(p("#wpseo-meta-section-content_"+WPGlobusYoastSeoPremium.dLang+" .wpseo_keyword_tab").removeClass("active"),p("#wpseo-meta-section-content_"+WPGlobusYoastSeoPremium.dLang+" .wpseo_keyword_tab").eq(WPGlobusYoastSeo.keywordIndex[WPGlobusYoastSeoPremium.dLang]).addClass("active"),p("#yoast_wpseo_focuskw_text_input_"+WPGlobusYoastSeoPremium.dLang).val()):p("#yoast_wpseo_focuskw_text_input_"+WPGlobusCoreData.default_language).val(),YoastSEO.app.rawData.keyword=t,r.focuskw.val(t),r.focuskw_hidden.val(t)),p("#wpseo-metabox-tabs_"+r.language+" .wpseo_keyword_tab").each(function(e,t){if(p(t).hasClass("active"))return WPGlobusYoastSeo.keywordIndex[r.language]=e,!1}),s.prototype.analyze()}),r=this}).prototype.analyze=function(){var e=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language");e!=WPGlobusCoreData.default_language&&0!=p("#editable-post-name-full-"+e).length?YoastSEO.app.snippetPreview.data.urlPath=p("#editable-post-name-full-"+e).text():YoastSEO.app.snippetPreview.data.urlPath=p("#editable-post-name-full").text(),YoastSEO.app.analyzeTimer(YoastSEO.app),s.prototype.setScoreIcon()},s.prototype.setScoreIcon=function(){var s=setInterval(function(){var e=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language"),t=p("#wpseo-meta-section-content .wpseo_generic_tab a").data("score"),a=p("#wpseo-meta-section-content .wpseo_keyword_tab a").data("score");""!=t&&(p("#wpseo-metabox-tabs_"+e+" .wpseo_generic_tab .wpseo-score-icon").removeClass("bad ok good 100 na"),p("#wpseo-metabox-tabs_"+e+" .wpseo_generic_tab .wpseo-score-icon").addClass(t)),""!=a&&(p("#wpseo-metabox-tabs_"+e+" .wpseo_keyword_tab .wpseo-score-icon").removeClass("bad ok good 100 na"),p("#wpseo-metabox-tabs_"+e+" .wpseo_keyword_tab .wpseo-score-icon").addClass(a)),clearInterval(s)},1500)},s.prototype.getWPseoTab=function(){return p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language")},s.prototype.citeModification=function(e){var t="#snippet_citeBase_"+e,a="#snippet_cite_"+e,s=p("#wpseo-tab-"+e).data("yoast-cite-base");!1===p("#wpseo-tab-"+e).data("cite-contenteditable")&&p(a).attr("contenteditable","false"),p(t).text(s)},s.prototype.pageTitleModification=function(e){var a,s="#snippet_title_",o="",n="";if(r.title_template==e)p.each(WPGlobusCoreData.enabled_languages,function(e,t){i=p("#snippet-editor-title_"+t).val(),l=0==i.length?r.title_template:i,o=r.replaceVariablesPlugin(l),p(s+t).text(o),t==r.getWPseoTab()&&(n=o)});else{if(a=WPGlobusCore.getTranslations(e),r.getWPseoTab()!==WPGlobusCoreData.default_language&&a[WPGlobusCoreData.default_language]==e){var i,e=r.getWPseoTab(),l=0<(i=p("#snippet-editor-title_"+e).val()).length?i:r.title_template;return l=r.replaceVariablesPlugin(l),p(s+e).text(l),l}p.each(WPGlobusCoreData.enabled_languages,function(e,t){o=""===a[t]?r.replaceVariablesPlugin(r.title_template):r.replaceVariablesPlugin(a[t]),t==r.getWPseoTab()&&(n=o,0!=(i=p("#snippet-editor-title_"+t).val()).length?i!=n&&(n=r.replaceVariablesPlugin(i)):n=r.replaceVariablesPlugin(r.title_template)),p(s+t).html(n)})}return n},s.prototype.metaDescModification=function(a){var s="#snippet_meta_",e=WPGlobusCore.getTranslations(a),t="",o=p("#snippet-editor-meta-description_"+r.getWPseoTab()).val();if(r.getWPseoTab()===WPGlobusCoreData.default_language||e[WPGlobusCoreData.default_language]!=a)return p.each(WPGlobusCoreData.enabled_languages,function(e,t){p(s+t).text(WPGlobusCore.TextFilter(a,t,"RETURN_EMPTY")),r.citeModification(t)}),o==e[r.getWPseoTab()]?0==(t=e[r.getWPseoTab()]).length&&p(s+r.getWPseoTab()).text(WPGlobusCore.TextFilter(YoastSEO.app.snippetPreview.data.metaDesc,WPGlobusCoreData.default_language,"RETURN_EMPTY")):0==(t=o).length?p(s+r.getWPseoTab()).text(WPGlobusCore.TextFilter(YoastSEO.app.snippetPreview.data.metaDesc,WPGlobusCoreData.default_language,"RETURN_EMPTY")):p(s+r.getWPseoTab()).text(t),p(s+r.getWPseoTab()).text(t),t;t=r.getWPseoTab();return r.citeModification(t),0==o.length?p(s+t).text(""):o!=a&&p(s+t).text(o),a},s.prototype.snippetModification=function(e){return WPGlobusCore.TextFilter(e,r.getWPseoTab(),"RETURN_EMPTY")},s.prototype.contentModification=function(e){return r.getWPseoTab()==WPGlobusCoreData.default_language?e:p("#content_"+r.getWPseoTab()).val()},s.prototype.titleModification=function(e){return setTimeout(r.updatePageAnalysis,1e3),r.getWPseoTab()==WPGlobusCoreData.default_language?e:p("#title_"+r.getWPseoTab()).val()},s.prototype.defaultReplace=function(e){var t=YoastSEO.app.rawData.keyword;return e.replace(/%%sitedesc%%/g,this.replaceVars.sitedesc).replace(/%%sitename%%/g,WPGlobusCore.TextFilter(this.replaceVars.sitename,r.getWPseoTab())).replace(/%%term_title%%/g,this.replaceVars.term_title).replace(/%%term_description%%/g,this.replaceVars.term_description).replace(/%%category_description%%/g,this.replaceVars.category_description).replace(/%%tag_description%%/g,this.replaceVars.tag_description).replace(/%%searchphrase%%/g,this.replaceVars.searchphrase).replace(/%%date%%/g,this.replaceVars.date).replace(/%%id%%/g,this.replaceVars.id).replace(/%%page%%/g,this.replaceVars.page).replace(/%%currenttime%%/g,this.replaceVars.currenttime).replace(/%%currentdate%%/g,this.replaceVars.currentdate).replace(/%%currentday%%/g,this.replaceVars.currentday).replace(/%%currentmonth%%/g,this.replaceVars.currentmonth).replace(/%%currentyear%%/g,this.replaceVars.currentyear).replace(/%%focuskw%%/g,t)},s.prototype.replaceVariablesPlugin=function(e){return void 0!==e&&(e=this.titleReplace(e),e=this.defaultReplace(e),e=this.replaceSeparators(e)),e},s.prototype.replaceSeparators=function(e){return e.replace(/%%sep%%(\s+%%sep%%)*/g,this.replaceVars.sep)},s.prototype.titleReplace=function(e){var t="";return void 0===(t=(this.language==WPGlobusCoreData.default_language?p("#title"):p("#title_"+this.language)).val())&&(t=YoastSEO.app.rawData.pageTitle),this.language!=WPGlobusCoreData.default_language&&0==t.length&&(t=p("#title").val()),e=e.replace(/%%title%%/g,t)},s.prototype.doubleSepReplace=function(e){var t=YoastSEO.app.stringHelper.addEscapeChars(this.replaceVars.sep),t=new RegExp(t+" "+t,"g");return e=e.replace(t,this.replaceVars.sep)},s.prototype.updateWpseoKeyword=function(e,t){0<p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").length&&p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").removeClass("wpseo-keyword").addClass("wpglobus-wpseo_keyword_"+t),p(".wpglobus-wpseo_keyword_"+t).text(e)},s.prototype.updatePageAnalysis=function(){p("#wpseo-pageanalysis_"+r.getWPseoTab()).html(p("#wpseo-pageanalysis").html()),p("#yoast-seo-content-analysis_"+r.getWPseoTab()).html(p("#yoast-seo-content-analysis").html()),p("#yoast-seo-content-analysis_"+r.getWPseoTab()+" li a").css({float:"none"})}),window.WPGlobusYoastSeoPlugin=new s)});
|
includes/js/wpglobus-yoastseo-41.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var WPGlobusYoastSeo,WPGlobusYoastSeoPremium=!1;jQuery(document).ready(function(p){"use strict";var r,d,n;"undefined"!=typeof wpseoReplaceVarsL10n&&"undefined"!=typeof WPGlobusCoreData&&"undefined"!=typeof WPGlobusVendor&&("edit-tags.php"==WPGlobusVendor.pagenow||"term.php"==WPGlobusVendor.pagenow?(d=WPGlobusYoastSeo={editorIDs:["description"],editor:{},submitId:"#submit",preventChangeEditor:!1,observer:null,init:function(){d.attachListeners(),_.delay(d.start,1500)},submit:function(e){"mouseenter"===e.type?p.each(d.editor,function(e,t){!d.editor[e].contentEditor||d.editor[e].contentEditor.isHidden()?p("#"+e).val(d.editor[e].content):tinymce.get(e).setContent(d.editor[e].content)}):"mouseleave"===e.type?d.preventChangeEditor||(p.each(d.editor,function(e,t){!d.editor[e].contentEditor||d.editor[e].contentEditor.isHidden()?p("#"+e).val(WPGlobusCore.TextFilter(t.content,d.getCurrentTab(),"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,d.getCurrentTab(),"RETURN_EMPTY"))}),d.preventChangeEditor=!1):"click"===e.type&&(d.preventChangeEditor=!0,"tinymce"!=getUserSetting("editor")&&setUserSetting("editor","tinymce"))},attachListeners:function(){p(".wrap").on("tabsactivate",function(e,a){p.each(d.editor,function(e,t){!d.editor[e].contentEditor||d.editor[e].contentEditor.isHidden()?p("#"+e).val(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY"))})}),p(document).on("mouseenter",d.submitId,d.submit).on("mouseleave",d.submitId,d.submit).on("click",d.submitId,d.submit),p(document).on("tinymce-editor-init",function(e,t){var a;-1!=_.indexOf(d.editorIDs,t.id)&&(a=p("#"+t.id),d.editor[t.id]={},d.editor[t.id].contentEditor=t,d.editor[t.id].content=a.val(),t.setContent(WPGlobusCore.TextFilter(d.editor[t.id].content,WPGlobusCoreData.default_language,"RETURN_EMPTY")),p("#"+t.getContainer().id).find("iframe").addClass("wpglobus-translatable"),a.removeClass("hidden"),t.on("nodechange keyup",_.debounce(d.update,500)),a.on("input keyup",_.debounce(d.update,500)))})},update:function(e){var t,a;void 0!==e.target&&("tinymce"==(t=e.target.id)&&(t=e.target.dataset.id),void 0!==d.editor[t].contentEditor&&(a=!d.editor[t].contentEditor||d.editor[t].contentEditor.isHidden()?p("#"+t).val():d.editor[t].contentEditor.getContent({format:"raw"}),d.editor[t].content=WPGlobusCore.getString(d.editor[t].content,a,d.getCurrentTab())))},getCurrentTab:function(){return p(".wpglobus-taxonomy-tabs-list .ui-tabs-active").data("language")},start:function(){p(".wpglobus-element_description").css({display:"none"})}},WPGlobusYoastSeo.init(),n=function(){p(".wrap").on("tabsactivate",function(e,t){t.newTab[0].dataset.language==WPGlobusCoreData.default_language?p("#poststuff .inside").css({display:"block"}):p("#poststuff .inside").css({display:"none"})}),p.each(["category_description","sitedesc","sitename","tag_description","term_description","term_title"],function(e,t){wpseoReplaceVarsL10n.replace_vars[t]=WPGlobusCore.TextFilter(wpseoReplaceVarsL10n.replace_vars[t],WPGlobusCoreData.default_language)}),WPGlobusYoastSeo.observer=new MutationObserver(function(e){e.forEach(function(e){var t;"placeholder"==e.attributeName&&(WPGlobusYoastSeo.observer.disconnect(),""==(t=p("#wpseo_focuskw")).val()&&t.attr("placeholder",WPGlobusCore.TextFilter(t.attr("placeholder"),WPGlobusCoreData.default_language)),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0}))})}),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0})}):(d=WPGlobusYoastSeo={wpseoTabSelector:"#wpglobus-wpseo-tabs",url:"",attrs:p("#wpglobus-wpseo-attr"),iB:p("#wpseo-meta-section-content"),t:p("#wpseo-meta-section-content"),ids:"",names:"",wpseoTab:WPGlobusCoreData.default_language,editSnippetButtonClass:"wpglobus-snippet-editor__edit-button",editSnippetFormClass:"wpglobus-snippet-editor__form",editSnippetSubmitClass:"wpglobus-snippet-editor__submit",editSnippetHeadingClass:"wpglobus-snippet-editor__heading-editor",yoastTitleProgress:"wpglobus-yoast-title-progress",yoastMetadescProgress:"wpglobus-yoast-metadesc-progress",yoastPremium:WPGlobusVendor.vendor.WPSEO_PREMIUM,keywordIndex:{},init:function(){p.each(WPGlobusCoreData.enabled_languages,function(e,t){d.keywordIndex[t]=0}),d.start()},initAddKeywordPopup:function(){1==p("#wpseo-add-keyword-popup").length?p(".wpseo-add-keyword").on("click",d.addKeywordPopup):WPGlobusYoastSeoPremium&&WPGlobusYoastSeoPremium.addKeywordButton()},addKeywordPopup:function(){var e=p("#wpseo-add-keyword-popup-button").text();tb_show(e,"#TB_inline?width=650&height=350&inlineId=wpseo-add-keyword-popup","group"),p("#TB_window").css("height",235),p("#TB_window").css("width",680)},qtip:function(){p(".yoast_help").qtip({content:{attr:"alt"},position:{my:"bottom left",at:"top center"},style:{tip:{corner:!0},classes:"yoast-qtip qtip-rounded qtip-blue"},show:"click",hide:{fixed:!0,delay:500}})},removeClasses:function(t,e){_.each(e,function(e){t.removeClass(e)})},updateProgressBar:function(e,t){var a,s,o,n,i,l;void 0!==e&&(void 0===t&&("undefined"!==e.data("language")&&(t=e.data("language")),void 0===t)||(o="",n=l=0,i=!(a=["snippet-editor__progress--bad","snippet-editor__progress--ok","snippet-editor__progress--good"]),l=e.val().length,e.hasClass("wpglobus-snippet-editor-title")?(n=(s=p("progress."+d.yoastTitleProgress+"_"+t)).attr("max"),o=a[2],0==l?o=a[1]:n<l?(o=a[1],i=!0):0<l&&l<35&&(o=a[1])):e.hasClass("wpglobus-snippet-editor-meta-description")&&(n=(s=p("progress."+d.yoastMetadescProgress+"_"+t)).attr("max"),o=a[2],0==l?o=a[1]:n<l?(o=a[1],i=!0):0<l&&l<121&&(o=a[1])),d.removeClasses(s,a),s.attr("value",l).addClass(o),i?e.css("color","#f00"):e.css("color","#000")))},updateWpseoKeyword:function(e,t){p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").text(e)},start:function(){p(d.wpseoTabSelector).tabs(),d.ids=d.attrs.data("ids"),d.names=d.attrs.data("names"),d.ids=d.ids+","+d.attrs.data("qtip"),d.ids=d.ids.split(","),d.names=d.names.split(","),p("#wpglobus-wpseo-tabs").insertBefore(d.iB),p(".wpseo-metabox-tabs").css({height:"26px"}),p(".wpglobus-wpseo-general").each(function(e,t){var a=p(t),s=a.data("language"),o="wpseo-meta-section-content_"+s;a.html('<div id="'+o+'" class="wpseo-meta-section wpglobus-wpseo-meta-section" style="width:100%" data-language="'+s+'">'+d.t.html()+"</div>"),p("#"+o+" .wpseo-metabox-tabs").attr("id","wpseo-metabox-tabs_"+s).attr("data-language",s),p("#"+o+" .wpseotab").attr("id","wpseo_content_"+s),p("#wpseo_content_"+s).css({float:"left"}),p("#"+o).css({display:"block"}),p("#wpseo_meta").css({overflow:"hidden"}),p("#"+o+" .snippet_container").addClass("wpglobus-snippet_container"),s!==WPGlobusCoreData.default_language&&p("#"+o+" .wpseo-add-keyword").addClass("hidden"),p.each(d.names,function(e,t){p("#"+t).attr("name",t+"_"+s)}),p.each(d.ids,function(e,t){var a=p("#"+t);"wpseosnippet"==t&&a.addClass("wpglobus-wpseosnippet"),"snippet_title"==t&&a.addClass("wpglobus-snippet_title"),"snippet_meta"==t&&a.addClass("wpglobus-snippet_meta"),"snippet_cite"==t&&a.addClass("wpglobus-snippet_cite"),"snippet_citeBase"==t&&a.addClass("wpglobus-snippet_citeBase"),"url_container"==t&&a.css({height:"16px"}),"yoast_wpseo_focuskw_text_input"==t&&(a.addClass("wpglobus-yoast_wpseo_focuskw_text_input"),a.attr("data-value",""),a.parents("div#wpseofocuskeyword").attr("id","wpseofocuskeyword_"+s)),"yoast_wpseo_focuskeywords"==t&&a.addClass("wpglobus-yoast_wpseo_focuskeywords"),"wpseo-pageanalysis"==t&&a.addClass("wpglobus-wpseo-pageanalysis"),"yoast-seo-content-analysis"==t&&a.addClass("wpglobus-yoast-seo-content-analysis"),"snippet_preview"==t&&a.addClass("wpglobus-snippet_preview"),"snippet-editor-title"==t&&(a.addClass("wpglobus-snippet-editor-title"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),a.val(p("#wpseo-tab-"+s).data("wpseotitle")),a.parent("label").next("progress").addClass(d.yoastTitleProgress).addClass(d.yoastTitleProgress+"_"+s),_.debounce(d.updateProgressBar(a,s),500)),"snippet-editor-slug"==t&&(a.addClass("wpglobus-snippet-editor-slug"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),WPGlobusCoreData.default_language!=s&&a.attr("disabled","disabled")),"snippet-editor-meta-description"==t&&(a.addClass("wpglobus-snippet-editor-meta-description"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),a.val(p("#wpseo-tab-"+s).data("metadesc")),a.parent("label").next("progress").addClass(d.yoastMetadescProgress).addClass(d.yoastMetadescProgress+"_"+s),_.debounce(d.updateProgressBar(a,s),500)),"snippetpreview-help-toggle"==t&&(a.addClass("wpglobus-snippetpreview-help-toggle_"+s),p(document).on("click",".wpglobus-snippetpreview-help-toggle_"+s,function(e){var t=p(this);"none"===p("#snippetpreview-help_"+t.data("language")).css("display")?p("#snippetpreview-help_"+t.data("language")).css({display:"block"}):p("#snippetpreview-help_"+t.data("language")).css({display:"none"})})),"focuskw_text_input-help-toggle"==t&&(a.addClass("wpglobus-focuskw_text_input-help-toggle_"+s),p(document).on("click",".wpglobus-focuskw_text_input-help-toggle_"+s,function(e){var t=p(this);"none"===p("#focuskw_text_input-help_"+t.data("language")).css("display")?p("#focuskw_text_input-help_"+t.data("language")).css({display:"block"}):p("#focuskw_text_input-help_"+t.data("language")).css({display:"none"})})),"pageanalysis-help-toggle"==t&&(a.addClass("wpglobus-pageanalysis-help-toggle_"+s),p(document).on("click",".wpglobus-pageanalysis-help-toggle_"+s,function(e){var t=p(this);"none"===p("#pageanalysis-help_"+t.data("language")).css("display")?p("#pageanalysis-help_"+t.data("language")).css({display:"block"}):p("#pageanalysis-help_"+t.data("language")).css({display:"none"})})),a.attr("id",t+"_"+s),p("#"+t+"_"+s).attr("data-language",s)});var n=WPGlobusCore.TextFilter(p("#yoast_wpseo_focuskw_text_input").val(),s,"RETURN_EMPTY");p("#yoast_wpseo_focuskw_text_input_"+s).val(n).data("value",n),p("#yoast_wpseo_focuskw_"+s).val(n),WPGlobusYoastSeoPremium||p("#wpseo-metabox-tabs_"+s+" .wpseo_keyword_tab .wpseo_tablink").data("keyword",n),d.updateWpseoKeyword(n,s),s!==WPGlobusCoreData.default_language&&(p("#"+o+" #yoast_wpseo_focuskw_text_input_"+s).addClass("hidden").after('<div class="wpglobus-suggest" style="font-weight:bold;">'+WPGlobusVendor.i18n.yoastseo_plus_access+"</div>"),p("#"+o+" #wpseo-pageanalysis_"+s).addClass("hidden").css({display:"none"})),WPGlobusYoastSeoPremium&&(s==WPGlobusCoreData.default_language||(p("#wpseo-metabox-tabs_"+s+" .wpseo_keyword_tab").removeClass("wpseo_keyword_tab").addClass("wpglobus-wpseo_keyword_tab"),p("#wpseo-meta-section-content_"+s+" .wpseo_keyword_tab_hideable").css({display:"none"}).attr("data-language",s)))}),p(".wpglobus-wpseosnippet").each(function(e,t){var a=p(t),s=a.data("language");a.find("button.snippet-editor__button.snippet-editor__edit-button").addClass(d.editSnippetButtonClass).addClass(d.editSnippetButtonClass+"_"+s).attr("data-language",s),a.find(".snippet-editor__form").addClass(d.editSnippetFormClass).addClass(d.editSnippetFormClass+"_"+s),a.find(".snippet-editor__heading-editor").addClass(d.editSnippetHeadingClass).addClass(d.editSnippetHeadingClass+"_"+s),a.find(".snippet-editor__submit").addClass(d.editSnippetSubmitClass).addClass(d.editSnippetSubmitClass+"_"+s).attr("data-language",s)}),d.iB.addClass("hidden"),d.iB.css({height:0,overflow:"hidden",display:"none"}),WPGlobusYoastSeoPremium&&p("#wpseo-meta-section-content .wpseo_keyword_tab").removeClass("wpseo_keyword_tab").addClass("wpseo_keyword_tab_original");var e=WPGlobusCore.TextFilter(p("#yoast_wpseo_focuskw_text_input").val(),WPGlobusCoreData.default_language,"RETURN_EMPTY");p("#yoast_wpseo_focuskw_text_input").val(e),p("#yoast_wpseo_focuskw").val(e),p(document).on("click",".wpglobus-wpseo-general .wpseo_tablink",function(e){e.preventDefault();var t=p(this),a=t.parents("ul").data("language"),s=t.parent("li");if(a==WPGlobusCoreData.default_language||void 0!==p(document).triggerHandler("wpglobus_yoast_analysis",{language:a}))if(s.hasClass("wpseo_generic_tab"))p("#wpseo-pageanalysis_"+a).css({display:"none"}),p("#yoast-seo-content-analysis_"+a).css({display:"block"}),p("#wpseo_content_"+a+" table tr").eq(0).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(1).css({display:"none"}),p("#yoast-seo-content-analysis_"+a+" li a").css({float:"none"});else if(s.hasClass("wpseo_keyword_tab")){if(WPGlobusYoastSeoPremium&&(p("#wpseo-meta-section-content_"+a+" .wpseo_keyword_tab").removeClass("active"),t.parent(".wpseo_keyword_tab").addClass("active"),p("#wpseo-pageanalysis_"+a).css({display:"block"}),p("#yoast-seo-content-analysis_"+a).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(0).css("display",""),p("#wpseo_content_"+a+" table tr").eq(1).css("display",""),p("#wpseo-metabox-tabs_"+a+" .wpseo_keyword_tab").each(function(e,t){if(p(t).hasClass("active"))return d.keywordIndex[a]=e,!1})),!WPGlobusYoastSeoPremium&&a!=WPGlobusCoreData.default_language)return p("#wpseo-pageanalysis_"+a).css({display:"block"}),p("#yoast-seo-content-analysis_"+a).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(0).css("display",""),void p("#wpseo_content_"+a+" table tr").eq(1).css("display","");var o=d.getKeywordsOrig()[d.keywordIndex[a]].keyword;YoastSEO.app.rawData.keyword=o,p("#yoast_wpseo_focuskw_text_input").val(o),p("#yoast_wpseo_focuskw_text_input_"+a).val(o),p('input[name="yoast_wpseo_focuskw"]').val(o),n.prototype.analyze(),p("#wpseo-pageanalysis_"+a).css({display:"block"}),p("#yoast-seo-content-analysis_"+a).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(0).css("display",""),p("#wpseo_content_"+a+" table tr").eq(1).css("display","")}else s.hasClass("wpglobus-wpseo_keyword_tab")&&(p("#wpseo-pageanalysis_"+a).css({display:"block"}),p("#yoast-seo-content-analysis_"+a).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(0).css("display",""),p("#wpseo_content_"+a+" table tr").eq(1).css("display",""))}),p(".wpseo-metabox-sidebar .wpseo-meta-section-link").on("click",function(e){"#wpseo-meta-section-content"==p(this).attr("href")?p("#wpglobus-wpseo-tabs").css({display:"block"}):p("#wpglobus-wpseo-tabs").css({display:"none"})}),p(document).on("click","."+d.editSnippetButtonClass,function(e){var t=p(this),a=t.data("language"),s=p("."+d.editSnippetFormClass+"_"+a),o=p("."+d.editSnippetSubmitClass+"_"+a),n=p("."+d.editSnippetHeadingClass+"_"+a);s.hasClass("snippet-editor--hidden")?(s.removeClass("snippet-editor--hidden"),n.removeClass("snippet-editor--hidden"),o.removeClass("snippet-editor--hidden")):(s.addClass("snippet-editor--hidden"),n.addClass("snippet-editor--hidden")),t.addClass("snippet-editor--hidden")}),p(document).on("click","."+d.editSnippetSubmitClass,function(e){var t=p(this).data("language"),a=p("."+d.editSnippetButtonClass+"_"+t),s=p("."+d.editSnippetFormClass+"_"+t),o=p("."+d.editSnippetSubmitClass+"_"+t),n=p("."+d.editSnippetHeadingClass+"_"+t);a.removeClass("snippet-editor--hidden"),s.addClass("snippet-editor--hidden"),o.addClass("snippet-editor--hidden"),n.addClass("snippet-editor--hidden")}),p(document).on("keyup","input.wpglobus-snippet-editor-title",function(e){var t=p(this),a=t.data("language"),s=WPGlobusCore.getString(p('input[name="yoast_wpseo_title"]').val(),t.val(),a);p("#snippet_title_"+a).html(r.replaceVariablesPlugin(t.val())),YoastSEO.app.rawData.pageTitle=s,p('input[name="yoast_wpseo_title"]').val(s),p("#snippet_title").text(s),_.debounce(d.updateProgressBar(t,a),500)}),p(document).on("keyup","input.wpglobus-snippet-editor-slug",function(e){var t=p(this),a=t.data("language");p("#snippet_cite_"+a).text(t.val()+"/"),p("#editable-post-name").text(t.val()),p("#editable-post-name-full").text(t.val())}),p(document).on("change","input.wpglobus-snippet-editor-slug",function(e){var t=p(this);p.post(ajaxurl,{action:"sample-permalink",post_id:p("#post_ID").val()||0,new_slug:t.val(),new_title:p("#title").val(),samplepermalinknonce:p("#samplepermalinknonce").val()})}),p(document).on("keyup","textarea.wpglobus-snippet-editor-meta-description",function(e){var t=p(this),a=t.data("language");p("#snippet_meta_"+a).text(t.val());var s=WPGlobusCore.getString(p("#yoast_wpseo_metadesc").val(),t.val(),t.data("language"));p("#yoast_wpseo_metadesc").val(s),p("#snippet_meta").text(s),_.debounce(d.updateProgressBar(t,a),500)}),p(document).on("click",".wpglobus-post-body-tabs-list li",function(e){var t,a=p(this);a.hasClass("wpglobus-post-tab")&&(p("#wpglobus-wpseo-tabs").tabs("option","active",a.data("order")),t=p("#yoast_wpseo_focuskw_text_input_"+a.data("language")).val(),YoastSEO.app.rawData.keyword=t,p("#yoast_wpseo_focuskw_text_input").val(t),p('input[name="yoast_wpseo_focuskw"]').val(t),n.prototype.analyze())}),d.initAddKeywordPopup()},getKeywordsOrig:function(){return p(".wpseo_keyword_tab").map(function(e,t){return{keyword:(t=p(t).find(".wpseo_tablink")).data("keyword")+"",score:t.data("score")}}).get()}},(n=function(){this.replaceVars=wpseoReplaceVarsL10n.replace_vars,this.language=WPGlobusCoreData.default_language,this.tab=WPGlobusCoreData.default_language,this.wpseoTab=WPGlobusCoreData.default_language,this.title_template=wpseoPostScraperL10n.title_template,this.focuskw=p("#yoast_wpseo_focuskw_text_input"),this.focuskw_hidden=p('input[name="yoast_wpseo_focuskw"]'),this.focuskwKeep=!1,this.post_slug="#editable-post-name-full",YoastSEO.app.registerPlugin("wpglobusYoastSeoPlugin",{status:"ready"}),YoastSEO.app.registerModification("content",this.contentModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("title",this.titleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_title",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_meta",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_page_title",this.pageTitleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_meta_desc",this.metaDescModification,"wpglobusYoastSeoPlugin",0),n.prototype.setScoreIcon(),p(document).on("blur",".wpglobus-snippet_title",function(e){var t=p(this),a=WPGlobusCore.getString(p("#yoast_wpseo_title").val(),t.text(),t.data("language"));YoastSEO.app.rawData.pageTitle=a,p('input[name="yoast_wpseo_title"]').val(a),p("#snippet_title").text(a)}),p(document).on("blur",".wpglobus-snippet_meta",function(e){var t=p(this),a=WPGlobusCore.getString(p("#yoast_wpseo_metadesc").val(),t.text(),t.data("language"));p("#yoast_wpseo_metadesc").val(a),p("#snippet_meta").text(a)}),p(document).on("keyup",".wpglobus-yoast_wpseo_focuskw_text_input",function(e){var t=p(this),a=t.val(),s=t.data("language");r.focuskw.val(a),r.focuskw_hidden.val(a),WPGlobusYoastSeoPremium||p("#wpseo-metabox-tabs_"+s+" .wpseo_keyword_tab .wpseo_tablink").data("keyword",a),r.updateWpseoKeyword(a,s),0==WPGlobusYoastSeo.keywordIndex[s]?p("#yoast_wpseo_focuskw_text_input_"+s).data("value",a):WPGlobusYoastSeoPremium&&WPGlobusYoastSeoPremium.setFocuskeyword(s),n.prototype.analyze()}),p("#publish,#save-post").on("mouseenter",function(e){var s,o="";p(".wpglobus-yoast_wpseo_focuskw_text_input").each(function(e,t){var a;s=p(this),o=s.data("language")==WPGlobusCoreData.default_language&&WPGlobusYoastSeoPremium?(a=WPGlobusYoastSeo.getKeywordsOrig(),WPGlobusCore.getString(o,a[0].keyword,s.data("language"))):WPGlobusCore.getString(o,s.val(),s.data("language"))}),r.focuskw.val(o),r.focuskw_hidden.val(o)}).on("mouseleave",function(e){r.focuskwKeep||(r.wpseoTab=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language"),p(this),r.focuskw.val(p("#yoast_wpseo_focuskw_text_input_"+r.wpseoTab).val()),r.focuskw_hidden.val(p("#yoast_wpseo_focuskw_text_input_"+r.wpseoTab).val()))}).on("click",function(e){r.focuskwKeep=!0}),p(document).on("tabsactivate",WPGlobusYoastSeo.wpseoTabSelector,function(e,t){var a;r.language=t.newPanel.attr("data-language"),WPGlobusYoastSeo.wpseoTab=r.language,t.newPanel.attr("data-language")===WPGlobusCoreData.default_language&&(a=WPGlobusYoastSeoPremium?(p("#wpseo-meta-section-content_"+WPGlobusYoastSeoPremium.dLang+" .wpseo_keyword_tab").removeClass("active"),p("#wpseo-meta-section-content_"+WPGlobusYoastSeoPremium.dLang+" .wpseo_keyword_tab").eq(WPGlobusYoastSeo.keywordIndex[WPGlobusYoastSeoPremium.dLang]).addClass("active"),p("#yoast_wpseo_focuskw_text_input_"+WPGlobusYoastSeoPremium.dLang).val()):p("#yoast_wpseo_focuskw_text_input_"+WPGlobusCoreData.default_language).val(),YoastSEO.app.rawData.keyword=a,r.focuskw.val(a),r.focuskw_hidden.val(a)),p("#wpseo-metabox-tabs_"+r.language+" .wpseo_keyword_tab").each(function(e,t){if(p(t).hasClass("active"))return WPGlobusYoastSeo.keywordIndex[r.language]=e,!1}),n.prototype.analyze()}),r=this}).prototype.analyze=function(){var e=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language");e!=WPGlobusCoreData.default_language&&0!=p("#editable-post-name-full-"+e).length?YoastSEO.app.snippetPreview.data.urlPath=p("#editable-post-name-full-"+e).text():YoastSEO.app.snippetPreview.data.urlPath=p("#editable-post-name-full").text(),YoastSEO.app.analyzeTimer(YoastSEO.app),n.prototype.setScoreIcon()},n.prototype.setScoreIcon=function(){var s=setInterval(function(){var e=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language"),t=p("#wpseo-meta-section-content .wpseo_generic_tab a").data("score"),a=p("#wpseo-meta-section-content .wpseo_keyword_tab a").data("score");""!=t&&(p("#wpseo-metabox-tabs_"+e+" .wpseo_generic_tab .wpseo-score-icon").removeClass("bad ok good 100 na"),p("#wpseo-metabox-tabs_"+e+" .wpseo_generic_tab .wpseo-score-icon").addClass(t)),void 0!==a&&""!=a&&(WPGlobusYoastSeoPremium&&e!=WPGlobusYoastSeoPremium.dLang?(p("#wpseo-metabox-tabs_"+e+" .wpglobus-wpseo_keyword_tab .wpseo-score-icon").removeClass("bad ok good 100 na"),p("#wpseo-metabox-tabs_"+e+" .wpglobus-wpseo_keyword_tab .wpseo-score-icon").addClass(a)):(p("#wpseo-metabox-tabs_"+e+" .wpseo_keyword_tab .wpseo-score-icon").removeClass("bad ok good 100 na"),p("#wpseo-metabox-tabs_"+e+" .wpseo_keyword_tab .wpseo-score-icon").addClass(a))),clearInterval(s)},1500)},n.prototype.getWPseoTab=function(){return p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language")},n.prototype.citeModification=function(e){var t="#snippet_citeBase_"+e,a="#snippet_cite_"+e,s=p("#wpseo-tab-"+e).data("yoast-cite-base");!1===p("#wpseo-tab-"+e).data("cite-contenteditable")&&p(a).attr("contenteditable","false"),p(t).text(s)},n.prototype.pageTitleModification=function(e){var a,s="#snippet_title_",o="",n="";if(r.title_template==e)p.each(WPGlobusCoreData.enabled_languages,function(e,t){i=p("#snippet-editor-title_"+t).val(),l=0==i.length?r.title_template:i,o=r.replaceVariablesPlugin(l),p(s+t).text(o),t==r.getWPseoTab()&&(n=o)});else{if(a=WPGlobusCore.getTranslations(e),r.getWPseoTab()!==WPGlobusCoreData.default_language&&a[WPGlobusCoreData.default_language]==e){var i,t=r.getWPseoTab(),l=0<(i=p("#snippet-editor-title_"+t).val()).length?i:r.title_template;return l=r.replaceVariablesPlugin(l),p(s+t).text(l),l}p.each(WPGlobusCoreData.enabled_languages,function(e,t){o=""===a[t]?r.replaceVariablesPlugin(r.title_template):r.replaceVariablesPlugin(a[t]),t==r.getWPseoTab()&&(n=o,0!=(i=p("#snippet-editor-title_"+t).val()).length?i!=n&&(n=r.replaceVariablesPlugin(i)):n=r.replaceVariablesPlugin(r.title_template)),p(s+t).html(n)})}return n},n.prototype.metaDescModification=function(a){var s="#snippet_meta_",e=WPGlobusCore.getTranslations(a),t="",o=p("#snippet-editor-meta-description_"+r.getWPseoTab()).val();if(r.getWPseoTab()===WPGlobusCoreData.default_language||e[WPGlobusCoreData.default_language]!=a)return p.each(WPGlobusCoreData.enabled_languages,function(e,t){p(s+t).text(WPGlobusCore.TextFilter(a,t,"RETURN_EMPTY")),r.citeModification(t)}),o==e[r.getWPseoTab()]?0==(t=e[r.getWPseoTab()]).length&&p(s+r.getWPseoTab()).text(WPGlobusCore.TextFilter(YoastSEO.app.snippetPreview.data.metaDesc,WPGlobusCoreData.default_language,"RETURN_EMPTY")):0==(t=o).length?p(s+r.getWPseoTab()).text(WPGlobusCore.TextFilter(YoastSEO.app.snippetPreview.data.metaDesc,WPGlobusCoreData.default_language,"RETURN_EMPTY")):p(s+r.getWPseoTab()).text(t),p(s+r.getWPseoTab()).text(t),t;var n=r.getWPseoTab();return r.citeModification(n),0==o.length?p(s+n).text(""):o!=a&&p(s+n).text(o),a},n.prototype.snippetModification=function(e){return WPGlobusCore.TextFilter(e,r.getWPseoTab(),"RETURN_EMPTY")},n.prototype.contentModification=function(e){return r.getWPseoTab()==WPGlobusCoreData.default_language?e:p("#content_"+r.getWPseoTab()).val()},n.prototype.titleModification=function(e){return setTimeout(r.updatePageAnalysis,1e3),r.getWPseoTab()==WPGlobusCoreData.default_language?e:p("#title_"+r.getWPseoTab()).val()},n.prototype.defaultReplace=function(e){var t=YoastSEO.app.rawData.keyword;return e.replace(/%%sitedesc%%/g,this.replaceVars.sitedesc).replace(/%%sitename%%/g,WPGlobusCore.TextFilter(this.replaceVars.sitename,r.getWPseoTab())).replace(/%%term_title%%/g,this.replaceVars.term_title).replace(/%%term_description%%/g,this.replaceVars.term_description).replace(/%%category_description%%/g,this.replaceVars.category_description).replace(/%%tag_description%%/g,this.replaceVars.tag_description).replace(/%%searchphrase%%/g,this.replaceVars.searchphrase).replace(/%%date%%/g,this.replaceVars.date).replace(/%%id%%/g,this.replaceVars.id).replace(/%%page%%/g,this.replaceVars.page).replace(/%%currenttime%%/g,this.replaceVars.currenttime).replace(/%%currentdate%%/g,this.replaceVars.currentdate).replace(/%%currentday%%/g,this.replaceVars.currentday).replace(/%%currentmonth%%/g,this.replaceVars.currentmonth).replace(/%%currentyear%%/g,this.replaceVars.currentyear).replace(/%%focuskw%%/g,t)},n.prototype.replaceVariablesPlugin=function(e){return void 0!==e&&(e=this.titleReplace(e),e=this.defaultReplace(e),e=this.replaceSeparators(e)),e},n.prototype.replaceSeparators=function(e){return e.replace(/%%sep%%(\s+%%sep%%)*/g,this.replaceVars.sep)},n.prototype.titleReplace=function(e){var t="";return void 0===(t=this.language==WPGlobusCoreData.default_language?p("#title").val():p("#title_"+this.language).val())&&(t=YoastSEO.app.rawData.pageTitle),this.language!=WPGlobusCoreData.default_language&&0==t.length&&(t=p("#title").val()),e=e.replace(/%%title%%/g,t)},n.prototype.doubleSepReplace=function(e){var t=YoastSEO.app.stringHelper.addEscapeChars(this.replaceVars.sep),a=new RegExp(t+" "+t,"g");return e=e.replace(a,this.replaceVars.sep)},n.prototype.updateWpseoKeyword=function(e,t){0<p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").length&&p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").removeClass("wpseo-keyword").addClass("wpglobus-wpseo_keyword_"+t),p(".wpglobus-wpseo_keyword_"+t).text(e)},n.prototype.updatePageAnalysis=function(){p("#wpseo-pageanalysis_"+r.getWPseoTab()).html(p("#wpseo-pageanalysis").html()),p("#yoast-seo-content-analysis_"+r.getWPseoTab()).html(p("#yoast-seo-content-analysis").html()),p("#yoast-seo-content-analysis_"+r.getWPseoTab()+" li a").css({float:"none"})}),window.WPGlobusYoastSeoPlugin=new n)});
|
1 |
+
var WPGlobusYoastSeo,WPGlobusYoastSeoPremium=!1;jQuery(document).ready(function(p){"use strict";var r,d,s;"undefined"!=typeof wpseoReplaceVarsL10n&&"undefined"!=typeof WPGlobusCoreData&&"undefined"!=typeof WPGlobusVendor&&("edit-tags.php"==WPGlobusVendor.pagenow||"term.php"==WPGlobusVendor.pagenow?(d=WPGlobusYoastSeo={editorIDs:["description"],editor:{},submitId:"#submit",preventChangeEditor:!1,observer:null,init:function(){d.attachListeners(),_.delay(d.start,1500)},submit:function(e){"mouseenter"===e.type?p.each(d.editor,function(e,t){!d.editor[e].contentEditor||d.editor[e].contentEditor.isHidden()?p("#"+e).val(d.editor[e].content):tinymce.get(e).setContent(d.editor[e].content)}):"mouseleave"===e.type?d.preventChangeEditor||(p.each(d.editor,function(e,t){!d.editor[e].contentEditor||d.editor[e].contentEditor.isHidden()?p("#"+e).val(WPGlobusCore.TextFilter(t.content,d.getCurrentTab(),"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,d.getCurrentTab(),"RETURN_EMPTY"))}),d.preventChangeEditor=!1):"click"===e.type&&(d.preventChangeEditor=!0,"tinymce"!=getUserSetting("editor")&&setUserSetting("editor","tinymce"))},attachListeners:function(){p(".wrap").on("tabsactivate",function(e,a){p.each(d.editor,function(e,t){!d.editor[e].contentEditor||d.editor[e].contentEditor.isHidden()?p("#"+e).val(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY"))})}),p(document).on("mouseenter",d.submitId,d.submit).on("mouseleave",d.submitId,d.submit).on("click",d.submitId,d.submit),p(document).on("tinymce-editor-init",function(e,t){var a;-1!=_.indexOf(d.editorIDs,t.id)&&(a=p("#"+t.id),d.editor[t.id]={},d.editor[t.id].contentEditor=t,d.editor[t.id].content=a.val(),t.setContent(WPGlobusCore.TextFilter(d.editor[t.id].content,WPGlobusCoreData.default_language,"RETURN_EMPTY")),p("#"+t.getContainer().id).find("iframe").addClass("wpglobus-translatable"),a.removeClass("hidden"),t.on("nodechange keyup",_.debounce(d.update,500)),a.on("input keyup",_.debounce(d.update,500)))})},update:function(e){var t;void 0!==e.target&&("tinymce"==(t=e.target.id)&&(t=e.target.dataset.id),void 0!==d.editor[t].contentEditor&&(e=!d.editor[t].contentEditor||d.editor[t].contentEditor.isHidden()?p("#"+t).val():d.editor[t].contentEditor.getContent({format:"raw"}),d.editor[t].content=WPGlobusCore.getString(d.editor[t].content,e,d.getCurrentTab())))},getCurrentTab:function(){return p(".wpglobus-taxonomy-tabs-list .ui-tabs-active").data("language")},start:function(){p(".wpglobus-element_description").css({display:"none"})}},WPGlobusYoastSeo.init(),s=function(){p(".wrap").on("tabsactivate",function(e,t){t.newTab[0].dataset.language==WPGlobusCoreData.default_language?p("#poststuff .inside").css({display:"block"}):p("#poststuff .inside").css({display:"none"})}),p.each(["category_description","sitedesc","sitename","tag_description","term_description","term_title"],function(e,t){wpseoReplaceVarsL10n.replace_vars[t]=WPGlobusCore.TextFilter(wpseoReplaceVarsL10n.replace_vars[t],WPGlobusCoreData.default_language)}),WPGlobusYoastSeo.observer=new MutationObserver(function(e){e.forEach(function(e){"placeholder"==e.attributeName&&(WPGlobusYoastSeo.observer.disconnect(),""==(e=p("#wpseo_focuskw")).val()&&e.attr("placeholder",WPGlobusCore.TextFilter(e.attr("placeholder"),WPGlobusCoreData.default_language)),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0}))})}),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0})}):(d=WPGlobusYoastSeo={wpseoTabSelector:"#wpglobus-wpseo-tabs",url:"",attrs:p("#wpglobus-wpseo-attr"),iB:p("#wpseo-meta-section-content"),t:p("#wpseo-meta-section-content"),ids:"",names:"",wpseoTab:WPGlobusCoreData.default_language,editSnippetButtonClass:"wpglobus-snippet-editor__edit-button",editSnippetFormClass:"wpglobus-snippet-editor__form",editSnippetSubmitClass:"wpglobus-snippet-editor__submit",editSnippetHeadingClass:"wpglobus-snippet-editor__heading-editor",yoastTitleProgress:"wpglobus-yoast-title-progress",yoastMetadescProgress:"wpglobus-yoast-metadesc-progress",yoastPremium:WPGlobusVendor.vendor.WPSEO_PREMIUM,keywordIndex:{},init:function(){p.each(WPGlobusCoreData.enabled_languages,function(e,t){d.keywordIndex[t]=0}),d.start()},initAddKeywordPopup:function(){1==p("#wpseo-add-keyword-popup").length?p(".wpseo-add-keyword").on("click",d.addKeywordPopup):WPGlobusYoastSeoPremium&&WPGlobusYoastSeoPremium.addKeywordButton()},addKeywordPopup:function(){var e=p("#wpseo-add-keyword-popup-button").text();tb_show(e,"#TB_inline?width=650&height=350&inlineId=wpseo-add-keyword-popup","group"),p("#TB_window").css("height",235),p("#TB_window").css("width",680)},qtip:function(){p(".yoast_help").qtip({content:{attr:"alt"},position:{my:"bottom left",at:"top center"},style:{tip:{corner:!0},classes:"yoast-qtip qtip-rounded qtip-blue"},show:"click",hide:{fixed:!0,delay:500}})},removeClasses:function(t,e){_.each(e,function(e){t.removeClass(e)})},updateProgressBar:function(e,t){var a,s,o,n,i,l;void 0!==e&&(void 0===t&&void 0===(t="undefined"!==e.data("language")?e.data("language"):t)||(o="",n=l=0,i=!(a=["snippet-editor__progress--bad","snippet-editor__progress--ok","snippet-editor__progress--good"]),l=e.val().length,e.hasClass("wpglobus-snippet-editor-title")?(n=(s=p("progress."+d.yoastTitleProgress+"_"+t)).attr("max"),o=a[2],0==l?o=a[1]:n<l?(o=a[1],i=!0):0<l&&l<35&&(o=a[1])):e.hasClass("wpglobus-snippet-editor-meta-description")&&(n=(s=p("progress."+d.yoastMetadescProgress+"_"+t)).attr("max"),o=a[2],0==l?o=a[1]:n<l?(o=a[1],i=!0):0<l&&l<121&&(o=a[1])),d.removeClasses(s,a),s.attr("value",l).addClass(o),i?e.css("color","#f00"):e.css("color","#000")))},updateWpseoKeyword:function(e,t){p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").text(e)},start:function(){p(d.wpseoTabSelector).tabs(),d.ids=d.attrs.data("ids"),d.names=d.attrs.data("names"),d.ids=d.ids+","+d.attrs.data("qtip"),d.ids=d.ids.split(","),d.names=d.names.split(","),p("#wpglobus-wpseo-tabs").insertBefore(d.iB),p(".wpseo-metabox-tabs").css({height:"26px"}),p(".wpglobus-wpseo-general").each(function(e,t){var a=p(t),s=a.data("language"),t="wpseo-meta-section-content_"+s;a.html('<div id="'+t+'" class="wpseo-meta-section wpglobus-wpseo-meta-section" style="width:100%" data-language="'+s+'">'+d.t.html()+"</div>"),p("#"+t+" .wpseo-metabox-tabs").attr("id","wpseo-metabox-tabs_"+s).attr("data-language",s),p("#"+t+" .wpseotab").attr("id","wpseo_content_"+s),p("#wpseo_content_"+s).css({float:"left"}),p("#"+t).css({display:"block"}),p("#wpseo_meta").css({overflow:"hidden"}),p("#"+t+" .snippet_container").addClass("wpglobus-snippet_container"),s!==WPGlobusCoreData.default_language&&p("#"+t+" .wpseo-add-keyword").addClass("hidden"),p.each(d.names,function(e,t){p("#"+t).attr("name",t+"_"+s)}),p.each(d.ids,function(e,t){var a=p("#"+t);"wpseosnippet"==t&&a.addClass("wpglobus-wpseosnippet"),"snippet_title"==t&&a.addClass("wpglobus-snippet_title"),"snippet_meta"==t&&a.addClass("wpglobus-snippet_meta"),"snippet_cite"==t&&a.addClass("wpglobus-snippet_cite"),"snippet_citeBase"==t&&a.addClass("wpglobus-snippet_citeBase"),"url_container"==t&&a.css({height:"16px"}),"yoast_wpseo_focuskw_text_input"==t&&(a.addClass("wpglobus-yoast_wpseo_focuskw_text_input"),a.attr("data-value",""),a.parents("div#wpseofocuskeyword").attr("id","wpseofocuskeyword_"+s)),"yoast_wpseo_focuskeywords"==t&&a.addClass("wpglobus-yoast_wpseo_focuskeywords"),"wpseo-pageanalysis"==t&&a.addClass("wpglobus-wpseo-pageanalysis"),"yoast-seo-content-analysis"==t&&a.addClass("wpglobus-yoast-seo-content-analysis"),"snippet_preview"==t&&a.addClass("wpglobus-snippet_preview"),"snippet-editor-title"==t&&(a.addClass("wpglobus-snippet-editor-title"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),a.val(p("#wpseo-tab-"+s).data("wpseotitle")),a.parent("label").next("progress").addClass(d.yoastTitleProgress).addClass(d.yoastTitleProgress+"_"+s),_.debounce(d.updateProgressBar(a,s),500)),"snippet-editor-slug"==t&&(a.addClass("wpglobus-snippet-editor-slug"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),WPGlobusCoreData.default_language!=s&&a.attr("disabled","disabled")),"snippet-editor-meta-description"==t&&(a.addClass("wpglobus-snippet-editor-meta-description"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),a.val(p("#wpseo-tab-"+s).data("metadesc")),a.parent("label").next("progress").addClass(d.yoastMetadescProgress).addClass(d.yoastMetadescProgress+"_"+s),_.debounce(d.updateProgressBar(a,s),500)),"snippetpreview-help-toggle"==t&&(a.addClass("wpglobus-snippetpreview-help-toggle_"+s),p(document).on("click",".wpglobus-snippetpreview-help-toggle_"+s,function(e){var t=p(this);"none"===p("#snippetpreview-help_"+t.data("language")).css("display")?p("#snippetpreview-help_"+t.data("language")).css({display:"block"}):p("#snippetpreview-help_"+t.data("language")).css({display:"none"})})),"focuskw_text_input-help-toggle"==t&&(a.addClass("wpglobus-focuskw_text_input-help-toggle_"+s),p(document).on("click",".wpglobus-focuskw_text_input-help-toggle_"+s,function(e){var t=p(this);"none"===p("#focuskw_text_input-help_"+t.data("language")).css("display")?p("#focuskw_text_input-help_"+t.data("language")).css({display:"block"}):p("#focuskw_text_input-help_"+t.data("language")).css({display:"none"})})),"pageanalysis-help-toggle"==t&&(a.addClass("wpglobus-pageanalysis-help-toggle_"+s),p(document).on("click",".wpglobus-pageanalysis-help-toggle_"+s,function(e){var t=p(this);"none"===p("#pageanalysis-help_"+t.data("language")).css("display")?p("#pageanalysis-help_"+t.data("language")).css({display:"block"}):p("#pageanalysis-help_"+t.data("language")).css({display:"none"})})),a.attr("id",t+"_"+s),p("#"+t+"_"+s).attr("data-language",s)});a=WPGlobusCore.TextFilter(p("#yoast_wpseo_focuskw_text_input").val(),s,"RETURN_EMPTY");p("#yoast_wpseo_focuskw_text_input_"+s).val(a).data("value",a),p("#yoast_wpseo_focuskw_"+s).val(a),WPGlobusYoastSeoPremium||p("#wpseo-metabox-tabs_"+s+" .wpseo_keyword_tab .wpseo_tablink").data("keyword",a),d.updateWpseoKeyword(a,s),s!==WPGlobusCoreData.default_language&&(p("#"+t+" #yoast_wpseo_focuskw_text_input_"+s).addClass("hidden").after('<div class="wpglobus-suggest" style="font-weight:bold;">'+WPGlobusVendor.i18n.yoastseo_plus_access+"</div>"),p("#"+t+" #wpseo-pageanalysis_"+s).addClass("hidden").css({display:"none"})),WPGlobusYoastSeoPremium&&(s==WPGlobusCoreData.default_language||(p("#wpseo-metabox-tabs_"+s+" .wpseo_keyword_tab").removeClass("wpseo_keyword_tab").addClass("wpglobus-wpseo_keyword_tab"),p("#wpseo-meta-section-content_"+s+" .wpseo_keyword_tab_hideable").css({display:"none"}).attr("data-language",s)))}),p(".wpglobus-wpseosnippet").each(function(e,t){var a=p(t),t=a.data("language");a.find("button.snippet-editor__button.snippet-editor__edit-button").addClass(d.editSnippetButtonClass).addClass(d.editSnippetButtonClass+"_"+t).attr("data-language",t),a.find(".snippet-editor__form").addClass(d.editSnippetFormClass).addClass(d.editSnippetFormClass+"_"+t),a.find(".snippet-editor__heading-editor").addClass(d.editSnippetHeadingClass).addClass(d.editSnippetHeadingClass+"_"+t),a.find(".snippet-editor__submit").addClass(d.editSnippetSubmitClass).addClass(d.editSnippetSubmitClass+"_"+t).attr("data-language",t)}),d.iB.addClass("hidden"),d.iB.css({height:0,overflow:"hidden",display:"none"}),WPGlobusYoastSeoPremium&&p("#wpseo-meta-section-content .wpseo_keyword_tab").removeClass("wpseo_keyword_tab").addClass("wpseo_keyword_tab_original");var e=WPGlobusCore.TextFilter(p("#yoast_wpseo_focuskw_text_input").val(),WPGlobusCoreData.default_language,"RETURN_EMPTY");p("#yoast_wpseo_focuskw_text_input").val(e),p("#yoast_wpseo_focuskw").val(e),p(document).on("click",".wpglobus-wpseo-general .wpseo_tablink",function(e){e.preventDefault();var t=p(this),a=t.parents("ul").data("language"),e=t.parent("li");if(a==WPGlobusCoreData.default_language||void 0!==p(document).triggerHandler("wpglobus_yoast_analysis",{language:a}))if(e.hasClass("wpseo_generic_tab"))p("#wpseo-pageanalysis_"+a).css({display:"none"}),p("#yoast-seo-content-analysis_"+a).css({display:"block"}),p("#wpseo_content_"+a+" table tr").eq(0).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(1).css({display:"none"}),p("#yoast-seo-content-analysis_"+a+" li a").css({float:"none"});else if(e.hasClass("wpseo_keyword_tab")){if(WPGlobusYoastSeoPremium&&(p("#wpseo-meta-section-content_"+a+" .wpseo_keyword_tab").removeClass("active"),t.parent(".wpseo_keyword_tab").addClass("active"),p("#wpseo-pageanalysis_"+a).css({display:"block"}),p("#yoast-seo-content-analysis_"+a).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(0).css("display",""),p("#wpseo_content_"+a+" table tr").eq(1).css("display",""),p("#wpseo-metabox-tabs_"+a+" .wpseo_keyword_tab").each(function(e,t){if(p(t).hasClass("active"))return d.keywordIndex[a]=e,!1})),!WPGlobusYoastSeoPremium&&a!=WPGlobusCoreData.default_language)return p("#wpseo-pageanalysis_"+a).css({display:"block"}),p("#yoast-seo-content-analysis_"+a).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(0).css("display",""),void p("#wpseo_content_"+a+" table tr").eq(1).css("display","");t=d.getKeywordsOrig()[d.keywordIndex[a]].keyword;YoastSEO.app.rawData.keyword=t,p("#yoast_wpseo_focuskw_text_input").val(t),p("#yoast_wpseo_focuskw_text_input_"+a).val(t),p('input[name="yoast_wpseo_focuskw"]').val(t),s.prototype.analyze(),p("#wpseo-pageanalysis_"+a).css({display:"block"}),p("#yoast-seo-content-analysis_"+a).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(0).css("display",""),p("#wpseo_content_"+a+" table tr").eq(1).css("display","")}else e.hasClass("wpglobus-wpseo_keyword_tab")&&(p("#wpseo-pageanalysis_"+a).css({display:"block"}),p("#yoast-seo-content-analysis_"+a).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(0).css("display",""),p("#wpseo_content_"+a+" table tr").eq(1).css("display",""))}),p(".wpseo-metabox-sidebar .wpseo-meta-section-link").on("click",function(e){"#wpseo-meta-section-content"==p(this).attr("href")?p("#wpglobus-wpseo-tabs").css({display:"block"}):p("#wpglobus-wpseo-tabs").css({display:"none"})}),p(document).on("click","."+d.editSnippetButtonClass,function(e){var t=p(this),a=t.data("language"),s=p("."+d.editSnippetFormClass+"_"+a),o=p("."+d.editSnippetSubmitClass+"_"+a),a=p("."+d.editSnippetHeadingClass+"_"+a);s.hasClass("snippet-editor--hidden")?(s.removeClass("snippet-editor--hidden"),a.removeClass("snippet-editor--hidden"),o.removeClass("snippet-editor--hidden")):(s.addClass("snippet-editor--hidden"),a.addClass("snippet-editor--hidden")),t.addClass("snippet-editor--hidden")}),p(document).on("click","."+d.editSnippetSubmitClass,function(e){var t=p(this).data("language"),a=p("."+d.editSnippetButtonClass+"_"+t),s=p("."+d.editSnippetFormClass+"_"+t),o=p("."+d.editSnippetSubmitClass+"_"+t),t=p("."+d.editSnippetHeadingClass+"_"+t);a.removeClass("snippet-editor--hidden"),s.addClass("snippet-editor--hidden"),o.addClass("snippet-editor--hidden"),t.addClass("snippet-editor--hidden")}),p(document).on("keyup","input.wpglobus-snippet-editor-title",function(e){var t=p(this),a=t.data("language"),s=WPGlobusCore.getString(p('input[name="yoast_wpseo_title"]').val(),t.val(),a);p("#snippet_title_"+a).html(r.replaceVariablesPlugin(t.val())),YoastSEO.app.rawData.pageTitle=s,p('input[name="yoast_wpseo_title"]').val(s),p("#snippet_title").text(s),_.debounce(d.updateProgressBar(t,a),500)}),p(document).on("keyup","input.wpglobus-snippet-editor-slug",function(e){var t=p(this),a=t.data("language");p("#snippet_cite_"+a).text(t.val()+"/"),p("#editable-post-name").text(t.val()),p("#editable-post-name-full").text(t.val())}),p(document).on("change","input.wpglobus-snippet-editor-slug",function(e){var t=p(this);p.post(ajaxurl,{action:"sample-permalink",post_id:p("#post_ID").val()||0,new_slug:t.val(),new_title:p("#title").val(),samplepermalinknonce:p("#samplepermalinknonce").val()})}),p(document).on("keyup","textarea.wpglobus-snippet-editor-meta-description",function(e){var t=p(this),a=t.data("language");p("#snippet_meta_"+a).text(t.val());var s=WPGlobusCore.getString(p("#yoast_wpseo_metadesc").val(),t.val(),t.data("language"));p("#yoast_wpseo_metadesc").val(s),p("#snippet_meta").text(s),_.debounce(d.updateProgressBar(t,a),500)}),p(document).on("click",".wpglobus-post-body-tabs-list li",function(e){var t=p(this);t.hasClass("wpglobus-post-tab")&&(p("#wpglobus-wpseo-tabs").tabs("option","active",t.data("order")),t=p("#yoast_wpseo_focuskw_text_input_"+t.data("language")).val(),YoastSEO.app.rawData.keyword=t,p("#yoast_wpseo_focuskw_text_input").val(t),p('input[name="yoast_wpseo_focuskw"]').val(t),s.prototype.analyze())}),d.initAddKeywordPopup()},getKeywordsOrig:function(){return p(".wpseo_keyword_tab").map(function(e,t){return{keyword:(t=p(t).find(".wpseo_tablink")).data("keyword")+"",score:t.data("score")}}).get()}},(s=function(){this.replaceVars=wpseoReplaceVarsL10n.replace_vars,this.language=WPGlobusCoreData.default_language,this.tab=WPGlobusCoreData.default_language,this.wpseoTab=WPGlobusCoreData.default_language,this.title_template=wpseoPostScraperL10n.title_template,this.focuskw=p("#yoast_wpseo_focuskw_text_input"),this.focuskw_hidden=p('input[name="yoast_wpseo_focuskw"]'),this.focuskwKeep=!1,this.post_slug="#editable-post-name-full",YoastSEO.app.registerPlugin("wpglobusYoastSeoPlugin",{status:"ready"}),YoastSEO.app.registerModification("content",this.contentModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("title",this.titleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_title",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_meta",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_page_title",this.pageTitleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_meta_desc",this.metaDescModification,"wpglobusYoastSeoPlugin",0),s.prototype.setScoreIcon(),p(document).on("blur",".wpglobus-snippet_title",function(e){var t=p(this),t=WPGlobusCore.getString(p("#yoast_wpseo_title").val(),t.text(),t.data("language"));YoastSEO.app.rawData.pageTitle=t,p('input[name="yoast_wpseo_title"]').val(t),p("#snippet_title").text(t)}),p(document).on("blur",".wpglobus-snippet_meta",function(e){var t=p(this),t=WPGlobusCore.getString(p("#yoast_wpseo_metadesc").val(),t.text(),t.data("language"));p("#yoast_wpseo_metadesc").val(t),p("#snippet_meta").text(t)}),p(document).on("keyup",".wpglobus-yoast_wpseo_focuskw_text_input",function(e){var t=p(this),a=t.val(),t=t.data("language");r.focuskw.val(a),r.focuskw_hidden.val(a),WPGlobusYoastSeoPremium||p("#wpseo-metabox-tabs_"+t+" .wpseo_keyword_tab .wpseo_tablink").data("keyword",a),r.updateWpseoKeyword(a,t),0==WPGlobusYoastSeo.keywordIndex[t]?p("#yoast_wpseo_focuskw_text_input_"+t).data("value",a):WPGlobusYoastSeoPremium&&WPGlobusYoastSeoPremium.setFocuskeyword(t),s.prototype.analyze()}),p("#publish,#save-post").on("mouseenter",function(e){var s,o="";p(".wpglobus-yoast_wpseo_focuskw_text_input").each(function(e,t){var a;s=p(this),o=s.data("language")==WPGlobusCoreData.default_language&&WPGlobusYoastSeoPremium?(a=WPGlobusYoastSeo.getKeywordsOrig(),WPGlobusCore.getString(o,a[0].keyword,s.data("language"))):WPGlobusCore.getString(o,s.val(),s.data("language"))}),r.focuskw.val(o),r.focuskw_hidden.val(o)}).on("mouseleave",function(e){r.focuskwKeep||(r.wpseoTab=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language"),p(this),r.focuskw.val(p("#yoast_wpseo_focuskw_text_input_"+r.wpseoTab).val()),r.focuskw_hidden.val(p("#yoast_wpseo_focuskw_text_input_"+r.wpseoTab).val()))}).on("click",function(e){r.focuskwKeep=!0}),p(document).on("tabsactivate",WPGlobusYoastSeo.wpseoTabSelector,function(e,t){r.language=t.newPanel.attr("data-language"),WPGlobusYoastSeo.wpseoTab=r.language,t.newPanel.attr("data-language")===WPGlobusCoreData.default_language&&(t=WPGlobusYoastSeoPremium?(p("#wpseo-meta-section-content_"+WPGlobusYoastSeoPremium.dLang+" .wpseo_keyword_tab").removeClass("active"),p("#wpseo-meta-section-content_"+WPGlobusYoastSeoPremium.dLang+" .wpseo_keyword_tab").eq(WPGlobusYoastSeo.keywordIndex[WPGlobusYoastSeoPremium.dLang]).addClass("active"),p("#yoast_wpseo_focuskw_text_input_"+WPGlobusYoastSeoPremium.dLang).val()):p("#yoast_wpseo_focuskw_text_input_"+WPGlobusCoreData.default_language).val(),YoastSEO.app.rawData.keyword=t,r.focuskw.val(t),r.focuskw_hidden.val(t)),p("#wpseo-metabox-tabs_"+r.language+" .wpseo_keyword_tab").each(function(e,t){if(p(t).hasClass("active"))return WPGlobusYoastSeo.keywordIndex[r.language]=e,!1}),s.prototype.analyze()}),r=this}).prototype.analyze=function(){var e=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language");e!=WPGlobusCoreData.default_language&&0!=p("#editable-post-name-full-"+e).length?YoastSEO.app.snippetPreview.data.urlPath=p("#editable-post-name-full-"+e).text():YoastSEO.app.snippetPreview.data.urlPath=p("#editable-post-name-full").text(),YoastSEO.app.analyzeTimer(YoastSEO.app),s.prototype.setScoreIcon()},s.prototype.setScoreIcon=function(){var s=setInterval(function(){var e=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language"),t=p("#wpseo-meta-section-content .wpseo_generic_tab a").data("score"),a=p("#wpseo-meta-section-content .wpseo_keyword_tab a").data("score");""!=t&&(p("#wpseo-metabox-tabs_"+e+" .wpseo_generic_tab .wpseo-score-icon").removeClass("bad ok good 100 na"),p("#wpseo-metabox-tabs_"+e+" .wpseo_generic_tab .wpseo-score-icon").addClass(t)),void 0!==a&&""!=a&&(WPGlobusYoastSeoPremium&&e!=WPGlobusYoastSeoPremium.dLang?(p("#wpseo-metabox-tabs_"+e+" .wpglobus-wpseo_keyword_tab .wpseo-score-icon").removeClass("bad ok good 100 na"),p("#wpseo-metabox-tabs_"+e+" .wpglobus-wpseo_keyword_tab .wpseo-score-icon").addClass(a)):(p("#wpseo-metabox-tabs_"+e+" .wpseo_keyword_tab .wpseo-score-icon").removeClass("bad ok good 100 na"),p("#wpseo-metabox-tabs_"+e+" .wpseo_keyword_tab .wpseo-score-icon").addClass(a))),clearInterval(s)},1500)},s.prototype.getWPseoTab=function(){return p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language")},s.prototype.citeModification=function(e){var t="#snippet_citeBase_"+e,a="#snippet_cite_"+e,s=p("#wpseo-tab-"+e).data("yoast-cite-base");!1===p("#wpseo-tab-"+e).data("cite-contenteditable")&&p(a).attr("contenteditable","false"),p(t).text(s)},s.prototype.pageTitleModification=function(e){var a,s="#snippet_title_",o="",n="";if(r.title_template==e)p.each(WPGlobusCoreData.enabled_languages,function(e,t){i=p("#snippet-editor-title_"+t).val(),l=0==i.length?r.title_template:i,o=r.replaceVariablesPlugin(l),p(s+t).text(o),t==r.getWPseoTab()&&(n=o)});else{if(a=WPGlobusCore.getTranslations(e),r.getWPseoTab()!==WPGlobusCoreData.default_language&&a[WPGlobusCoreData.default_language]==e){var i,e=r.getWPseoTab(),l=0<(i=p("#snippet-editor-title_"+e).val()).length?i:r.title_template;return l=r.replaceVariablesPlugin(l),p(s+e).text(l),l}p.each(WPGlobusCoreData.enabled_languages,function(e,t){o=""===a[t]?r.replaceVariablesPlugin(r.title_template):r.replaceVariablesPlugin(a[t]),t==r.getWPseoTab()&&(n=o,0!=(i=p("#snippet-editor-title_"+t).val()).length?i!=n&&(n=r.replaceVariablesPlugin(i)):n=r.replaceVariablesPlugin(r.title_template)),p(s+t).html(n)})}return n},s.prototype.metaDescModification=function(a){var s="#snippet_meta_",e=WPGlobusCore.getTranslations(a),t="",o=p("#snippet-editor-meta-description_"+r.getWPseoTab()).val();if(r.getWPseoTab()===WPGlobusCoreData.default_language||e[WPGlobusCoreData.default_language]!=a)return p.each(WPGlobusCoreData.enabled_languages,function(e,t){p(s+t).text(WPGlobusCore.TextFilter(a,t,"RETURN_EMPTY")),r.citeModification(t)}),o==e[r.getWPseoTab()]?0==(t=e[r.getWPseoTab()]).length&&p(s+r.getWPseoTab()).text(WPGlobusCore.TextFilter(YoastSEO.app.snippetPreview.data.metaDesc,WPGlobusCoreData.default_language,"RETURN_EMPTY")):0==(t=o).length?p(s+r.getWPseoTab()).text(WPGlobusCore.TextFilter(YoastSEO.app.snippetPreview.data.metaDesc,WPGlobusCoreData.default_language,"RETURN_EMPTY")):p(s+r.getWPseoTab()).text(t),p(s+r.getWPseoTab()).text(t),t;t=r.getWPseoTab();return r.citeModification(t),0==o.length?p(s+t).text(""):o!=a&&p(s+t).text(o),a},s.prototype.snippetModification=function(e){return WPGlobusCore.TextFilter(e
|