WPGlobus – Multilingual Everything! - Version 2.5.17

Version Description

  • (Core/JS) Fixed Uncaught TypeError: Cannot read property of undefined.
  • (Core/JS) Using val function instead of attr.
  • (Core/Admin) CSS tweak for the edit slug box.
  • (Core/Config) Changed the priority for plugins_loaded action.
  • (Core/Config Builder) Check $GLOBALS['WPGlobus'] for an array to prevent an occurring error Cannot use object of type WPGlobus as array.
  • (Core/Utils) Fixed current_url() warning when plugin deactivated with WP-CLI.
  • (Core) Do not decode special characters.
  • (Builders/Pods) Added support for the phone and wysiwyg fields of Pods Custom Content Types and Fields.
  • (Core/Post Types) Added the 3D FlipBook Dflip Lite plugin and OceanWP theme's post types to the "hidden types" list.
  • (Options/Languages table) Installed languages moved to the top of the table.
Download this release

Release Info

Developer tivnet
Plugin Icon 128x128 WPGlobus – Multilingual Everything!
Version 2.5.17
Comparing to
See all releases

Code changes from version 2.5.16 to 2.5.17

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-menu-visibility":{"title":"WPGlobus Menu Visibility","_api_new_version":"1.2.0","_api_tested_up_to":"4.9.6"},"wpglobus-multi-currency":{"title":"{:en}WPGlobus 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-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":"1.1.0","_api_tested_up_to":"5.4.0"},"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.2.0","_api_tested_up_to":"5.2"},"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.1.0","_api_tested_up_to":"5.4"},"wpglobus-header-images":{"title":"{:en}WPGlobus Header Images{:}{:ru}WPGlobus Header Images{:}","_api_new_version":"2.1.0","_api_tested_up_to":"5.5"},"woocommerce-wpglobus":{"title":"{:en}WPGlobus for WooCommerce{:}{:ru}\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 WooCommerce WPGlobus{:}","_api_new_version":"3.5.13","_api_tested_up_to":"5.4.1"},"wpglobus-mobile-menu":{"title":"{:en}WPGlobus Mobile Menu{:}{:ru}WPGlobus Mobile Menu{:}","_api_new_version":"2.1.0","_api_tested_up_to":"5.5.1"},"wpglobus-plus":{"title":"{:en}WPGlobus Plus multilingual extension{:}{:ru}WPGlobus \u041f\u043b\u044e\u0441{:}","_api_new_version":"1.4.6","_api_tested_up_to":"5.5.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-menu-visibility":{"title":"WPGlobus Menu Visibility","_api_new_version":"1.2.0","_api_tested_up_to":"4.9.6"},"wpglobus-multi-currency":{"title":"{:en}WPGlobus 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-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":"1.1.0","_api_tested_up_to":"5.4.0"},"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.1.0","_api_tested_up_to":"5.4"},"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-mobile-menu":{"title":"{:en}WPGlobus Mobile Menu{:}{:ru}WPGlobus Mobile Menu{:}","_api_new_version":"2.1.0","_api_tested_up_to":"5.5.1"},"wpglobus-plus":{"title":"{:en}WPGlobus Plus multilingual extension{:}{:ru}WPGlobus \u041f\u043b\u044e\u0441{:}","_api_new_version":"1.5.1","_api_tested_up_to":"5.5.1"},"woocommerce-wpglobus":{"title":"{:en}WPGlobus for WooCommerce{:}{:ru}\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 WooCommerce WPGlobus{:}","_api_new_version":"4.0.0","_api_tested_up_to":"5.5.3"},"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.3.0","_api_tested_up_to":"5.5"}}
includes/builders/assets/wpglobus-admin-builder-55.js CHANGED
@@ -3,6 +3,7 @@
3
  * Interface JS functions
4
  *
5
  * @since 2.5
 
6
  *
7
  * @package WPGlobus
8
  * @subpackage Administration
@@ -330,30 +331,71 @@ jQuery(document).ready(function ($) {
330
  });
331
  },
332
  setMultilingualFields: function() {
333
- $.each(WPGlobusAdmin.builder.multilingualFields, function(indx, field) {
334
- var elementBy = 'name';
335
- var node = document.getElementsByName(field);
336
- var $element;
337
-
338
- if ( 0 == node.length ) {
339
- elementBy = 'id';
340
- node = document.getElementById(field);
341
- }
 
 
 
 
 
 
 
 
 
 
 
342
 
343
- if ( null === node ) {
344
- return;
 
 
 
345
  } else {
346
- if ( 'id' == elementBy ) {
347
- $element = $('#'+field);
348
- } else {
349
- var nodeName = node[0].nodeName;
350
- nodeName = nodeName.toLowerCase();
351
- $element = $(nodeName+'[name="'+field+'"]');
352
- }
353
- $element.addClass(WPGlobusAdmin.builder.translatableClass);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
354
  }
355
-
356
- });
357
  }
358
  }
359
 
3
  * Interface JS functions
4
  *
5
  * @since 2.5
6
+ * @since 2.5.17 Revised `setMultilingualFields` function to use field param as string or object.
7
  *
8
  * @package WPGlobus
9
  * @subpackage Administration
331
  });
332
  },
333
  setMultilingualFields: function() {
334
+ $.each(WPGlobusAdmin.builder.multilingualFields, function(indx, field) {
335
+ /**
336
+ * @since 2.5.17 Revised function to use field param as string or object.
337
+ */
338
+ var attrs = api.getFieldAttrs(field);
339
+ if ( 'function' === typeof WPGlobusAdmin[attrs.fieldFunction] ) {
340
+ WPGlobusAdmin[attrs.fieldFunction](attrs);
341
+ }
342
+ });
343
+ },
344
+ textField: function(attrs){
345
+ var id = attrs.id;
346
+ var elementBy = 'name';
347
+ var node = document.getElementsByName(id);
348
+ var $element;
349
+
350
+ if ( 0 == node.length ) {
351
+ elementBy = 'id';
352
+ node = document.getElementById(id);
353
+ }
354
 
355
+ if ( null === node ) {
356
+ return true;
357
+ } else {
358
+ if ( 'id' == elementBy ) {
359
+ $element = $('#'+id);
360
  } else {
361
+ var nodeName = node[0].nodeName;
362
+ nodeName = nodeName.toLowerCase();
363
+ $element = $(nodeName+'[name="'+id+'"]');
364
+ }
365
+ $element.addClass(WPGlobusAdmin.builder.translatableClass);
366
+ }
367
+ },
368
+ wysiwygField: function(attrs){
369
+ $(document).on('wpglobus_wysiwyg_field', function(evnt,params) {
370
+ params.callback(attrs);
371
+ });
372
+ },
373
+ fileField: function(attrs){
374
+ // @since 2.5.17 @W.I.P
375
+ /*
376
+ $(document).on('wpglobus_file_field', function(evnt,params) {
377
+ params.callback(attrs);
378
+ }); // */
379
+ },
380
+ getFieldAttrs: function(field){
381
+ var defaultAttrs = {
382
+ 'id': false,
383
+ 'type': 'text',
384
+ 'fieldFunction': 'textField'
385
+ }
386
+ var attrs = {};
387
+ if ( 'string' === typeof field ) {
388
+ attrs['id'] = field;
389
+ } else if ( 'object' === typeof field ) {
390
+ if ( 'undefined' !== typeof field.id ) {
391
+ attrs['id'] = field.id;
392
+ }
393
+ if ( 'undefined' !== typeof field.type ) {
394
+ attrs['type'] = field.type;
395
+ attrs['fieldFunction'] = field.type+'Field';
396
  }
397
+ }
398
+ return $.extend({}, defaultAttrs, attrs);
399
  }
400
  }
401
 
includes/builders/assets/wpglobus-admin-builder-55.min.js CHANGED
@@ -1 +1 @@
1
- var WPGlobusCore;!function(l){var s=WPGlobusCore={strpos:function(a,t,e){var o=(a=""+a).indexOf(t,e);return 0<=o&&o},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))}),""!=a[WPGlobusCoreData.default_language]&&(o=""==o?a[WPGlobusCoreData.default_language]:s.addLocaleMarks(a[WPGlobusCoreData.default_language],WPGlobusCoreData.default_language)+o),o}}}(jQuery),jQuery(document).ready(function(l){"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<l("#language").length&&(a=l("#language").val()),console.log("Current language from hidden (#language) : ",a),a=void 0,0<l("#wpglobus-language").length&&(a=l("#wpglobus-language").val()),console.log("Current language from hidden (#wpglobus-language) : ",a),a=void 0,0<l('input[name="wpglobus-language"]').length&&(a=l('input[name="wpglobus-language"]').val()),console.log('Current language from hidden (input[name="wpglobus-language"]) : ',a),a=void 0,0<l('input[name="wpglobus_language"]').length&&(a=l('input[name="wpglobus_language"]').val()),console.log('Current language from hidden (input[name="wpglobus_language"]) : ',a),console.log("Builder : ",WPGlobusAdmin.builder);var t=l("#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){var a=wpCookies.get(WPGlobusAdmin.builder.languageCookie);if(null!==a&&history.pushState){var t=(a=a.split("+"))[0];if(void 0!==a[1]&&a[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 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(){l(".wpglobus-taxonomy-tabs").insertAfter("#ajax-response"),l(".wrap").tabs(),l(WPGlobusAdmin.data.multilingualSlug.title).insertAfter(".term-slug-wrap th label"),WPGlobusAdmin.currentTab!==WPGlobusAdmin.data.default_language&&(l(".wpglobus-tax-edit-tab").removeClass("ui-tabs-active ui-state-active"),l("#wpglobus-link-tab-"+WPGlobusAdmin.currentTab).addClass("ui-tabs-active ui-state-active")),l(document).on("click",".wpglobus-tax-edit-tab a",function(a){a.preventDefault();var t=l(this).data("href");location.href=t}),t.setMultilingualFields(),l(document).on("tinymce-editor-init",function(a,t){l("#"+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),l(a).prepend(l(".wpglobus-post-body-tabs-list")),l.each(WPGlobusAdmin.tabs,function(a,t){"default"===t?(l(e).wrap('<div id="tab-default"></div>'),o&&l(l("#titlediv")).insertBefore(e)):(l(e+"-"+t).wrap('<div id="tab-'+t+'"></div>'),o&&l(l("#titlediv-"+t)).insertBefore(e+"-"+t))}),l(a).addClass("wpglobus-post-body-tabs"),t.setMultilingualFields(),"post.php"===WPGlobusAdmin.page&&this.postEdit()},postEdit:function(){l(document).triggerHandler("wpglobus_after_post_edit")},ajaxPrefilter:function(){l.ajaxPrefilter(function(a,t,e){})},setMultilingualFields:function(){l.each(WPGlobusAdmin.builder.multilingualFields,function(a,t){var e,o="name",n=document.getElementsByName(t);0==n.length&&(o="id",n=document.getElementById(t)),null!==n&&("id"==o?l("#"+t):(e=(e=n[0].nodeName).toLowerCase(),l(e+'[name="'+t+'"]'))).addClass(WPGlobusAdmin.builder.translatableClass)})}},(WPGlobusAdmin=l.extend({},WPGlobusAdmin,t)).init())});
1
+ var WPGlobusCore;!function(l){var s=WPGlobusCore={strpos:function(t,e,a){var o=(t=""+t).indexOf(e,a);return 0<=o&&o},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))}),""!=t[WPGlobusCoreData.default_language]&&(o=""==o?t[WPGlobusCoreData.default_language]:s.addLocaleMarks(t[WPGlobusCoreData.default_language],WPGlobusCoreData.default_language)+o),o}}}(jQuery),jQuery(document).ready(function(l){"use strict";var n;"undefined"!=typeof WPGlobusAdmin&&(n={languageSelectorBoxDelta:0,locationPathname:"/wp-admin/post.php",init:function(){"taxonomy-edit"===WPGlobusAdmin.page?n.taxonomyEdit():n.start()},_info:function(){var t=void 0;0<l("#language").length&&(t=l("#language").val()),console.log("Current language from hidden (#language) : ",t),t=void 0,0<l("#wpglobus-language").length&&(t=l("#wpglobus-language").val()),console.log("Current language from hidden (#wpglobus-language) : ",t),t=void 0,0<l('input[name="wpglobus-language"]').length&&(t=l('input[name="wpglobus-language"]').val()),console.log('Current language from hidden (input[name="wpglobus-language"]) : ',t),t=void 0,0<l('input[name="wpglobus_language"]').length&&(t=l('input[name="wpglobus_language"]').val()),console.log('Current language from hidden (input[name="wpglobus_language"]) : ',t),console.log("Builder : ",WPGlobusAdmin.builder);var e=l("#content").val();""==e?console.log("Editor content (#content) : (empty)"):console.log(e)},checkCookie:function(){if(-1!=window.location.search.indexOf("language="))return!1;if("post.php"==WPGlobusAdmin.page){var t=wpCookies.get(WPGlobusAdmin.builder.languageCookie);if(null!==t&&history.pushState){var e=(t=t.split("+"))[0];if(void 0!==t[1]&&t[1]+0==WPGlobusAdmin.$_get.post){var a=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search+"&language="+e;return window.history.pushState({path:a},"",a),e}}}return!1},setCookie:function(){var t=n.checkCookie();t||void 0===(t=WPGlobusAdmin.$_get.language)&&(t=WPGlobusAdmin.data.default_language),wpCookies.set(WPGlobusAdmin.builder.languageCookie,t+"+"+WPGlobusAdmin.$_get.post,31536e3,n.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(){l(".wpglobus-taxonomy-tabs").insertAfter("#ajax-response"),l(".wrap").tabs(),l(WPGlobusAdmin.data.multilingualSlug.title).insertAfter(".term-slug-wrap th label"),WPGlobusAdmin.currentTab!==WPGlobusAdmin.data.default_language&&(l(".wpglobus-tax-edit-tab").removeClass("ui-tabs-active ui-state-active"),l("#wpglobus-link-tab-"+WPGlobusAdmin.currentTab).addClass("ui-tabs-active ui-state-active")),l(document).on("click",".wpglobus-tax-edit-tab a",function(t){t.preventDefault();var e=l(this).data("href");location.href=e}),n.setMultilingualFields(),l(document).on("tinymce-editor-init",function(t,e){l("#"+e.getContainer().id).find("iframe").addClass(WPGlobusAdmin.builder.translatableClass).css({width:""})})},start:function(){n.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),l(t).prepend(l(".wpglobus-post-body-tabs-list")),l.each(WPGlobusAdmin.tabs,function(t,e){"default"===e?(l(a).wrap('<div id="tab-default"></div>'),o&&l(l("#titlediv")).insertBefore(a)):(l(a+"-"+e).wrap('<div id="tab-'+e+'"></div>'),o&&l(l("#titlediv-"+e)).insertBefore(a+"-"+e))}),l(t).addClass("wpglobus-post-body-tabs"),n.setMultilingualFields(),"post.php"===WPGlobusAdmin.page&&this.postEdit()},postEdit:function(){l(document).triggerHandler("wpglobus_after_post_edit")},ajaxPrefilter:function(){l.ajaxPrefilter(function(t,e,a){})},setMultilingualFields:function(){l.each(WPGlobusAdmin.builder.multilingualFields,function(t,e){var a=n.getFieldAttrs(e);"function"==typeof WPGlobusAdmin[a.fieldFunction]&&WPGlobusAdmin[a.fieldFunction](a)})},textField:function(t){var e,a=t.id,o="name",n=document.getElementsByName(a);if(0==n.length&&(o="id",n=document.getElementById(a)),null===n)return!0;("id"==o?l("#"+a):(e=(e=n[0].nodeName).toLowerCase(),l(e+'[name="'+a+'"]'))).addClass(WPGlobusAdmin.builder.translatableClass)},wysiwygField:function(a){l(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")),l.extend({},{id:!1,type:"text",fieldFunction:"textField"},e)}},(WPGlobusAdmin=l.extend({},WPGlobusAdmin,n)).init())});
includes/builders/class-wpglobus-config-builder.php CHANGED
@@ -304,7 +304,16 @@ if ( ! class_exists( 'WPGlobus_Config_Builder' ) ) :
304
  * See also the Update action in @see \WPGlobus_Builders
305
  */
306
  $_continue = false;
307
- if ( isset( $GLOBALS['WPGlobus'] ) && ! empty( $GLOBALS['WPGlobus']['post_type'] ) ) {
 
 
 
 
 
 
 
 
 
308
  $_continue = true;
309
  }
310
  if ( false !== strpos( $_SERVER['REQUEST_URI'], '/wp-json/wp/v2/posts/' )
304
  * See also the Update action in @see \WPGlobus_Builders
305
  */
306
  $_continue = false;
307
+
308
+ /**
309
+ * @since 2.5.17 Check $GLOBALS['WPGlobus'] for an array to prevent an occurring error `Cannot use object of type WPGlobus as array`.
310
+ * @todo In a rare case (so far only one) $GLOBALS['WPGlobus'] defined as object. Need an investigation.
311
+ */
312
+ if ( isset( $GLOBALS['WPGlobus'] ) &&
313
+ is_array( $GLOBALS['WPGlobus'] ) &&
314
+ ! empty( $GLOBALS['WPGlobus']['post_type'] )
315
+ )
316
+ {
317
  $_continue = true;
318
  }
319
  if ( false !== strpos( $_SERVER['REQUEST_URI'], '/wp-json/wp/v2/posts/' )
includes/class-wpglobus-config.php CHANGED
@@ -292,17 +292,19 @@ class WPGlobus_Config {
292
  }
293
 
294
  /**
295
- * Constructor
296
  */
297
  public function __construct() {
298
 
299
  /**
300
  * @since 1.0.9 Hooked to 'plugins_loaded'. The 'init' is too late, because it happens after all plugins already loaded their translations.
301
- */
 
 
302
  add_action( 'plugins_loaded', array(
303
  $this,
304
  'init_current_language'
305
- ), 0 );
306
 
307
  add_action( 'plugins_loaded', array(
308
  $this,
292
  }
293
 
294
  /**
295
+ * Constructor.
296
  */
297
  public function __construct() {
298
 
299
  /**
300
  * @since 1.0.9 Hooked to 'plugins_loaded'. The 'init' is too late, because it happens after all plugins already loaded their translations.
301
+ * @since 2.5.17 Change the priority for compatibility with `woocommerce-pdf-invoices-italian-add-on`,
302
+ * it seems that calling init_current_language() in plugin_loaded hook with priority 0 is too late, with -1 it works fine.
303
+ */
304
  add_action( 'plugins_loaded', array(
305
  $this,
306
  'init_current_language'
307
+ ), -1 );
308
 
309
  add_action( 'plugins_loaded', array(
310
  $this,
includes/class-wpglobus-core.php CHANGED
@@ -65,9 +65,14 @@ class WPGlobus_Core {
65
  * Fix for the case
66
  * &lt;!--:en--&gt;ENG&lt;!--:--&gt;&lt;!--:ru--&gt;RUS&lt;!--:--&gt;
67
  *
68
- * @todo need careful investigation
 
 
 
 
 
 
69
  */
70
- $text = htmlspecialchars_decode( $text );
71
 
72
  $possible_delimiters =
73
  array(
@@ -92,6 +97,15 @@ class WPGlobus_Core {
92
  'start' => "<!--:{$language}-->",
93
  'end' => '<!--:-->',
94
  ),
 
 
 
 
 
 
 
 
 
95
  array(
96
  'start' => "[:{$language}]",
97
  'end' => '[:',
65
  * Fix for the case
66
  * &lt;!--:en--&gt;ENG&lt;!--:--&gt;&lt;!--:ru--&gt;RUS&lt;!--:--&gt;
67
  *
68
+ * @since 2.5.17 Disabled. Breaks block editing and converts markup-as-text to actual markup.
69
+ * <code>
70
+ * // This `if` solves only the block editing. But we still have issues with viewing the post.
71
+ * if ( ! WPGlobus_WP::is_function_in_backtrace( array( 'WPGlobus_Gutenberg', 'translate_post' ) ) ) {
72
+ * $text = htmlspecialchars_decode( $text );
73
+ * }
74
+ * </code>
75
  */
 
76
 
77
  $possible_delimiters =
78
  array(
97
  'start' => "<!--:{$language}-->",
98
  'end' => '<!--:-->',
99
  ),
100
+ /**
101
+ * Check for encoded version here instead of applying htmlspecialchars_decode().
102
+ *
103
+ * @since 2.5.17
104
+ */
105
+ array(
106
+ 'start' => "&lt;!--:{$language}--&gt;",
107
+ 'end' => '&lt;!--:--&gt;',
108
+ ),
109
  array(
110
  'start' => "[:{$language}]",
111
  'end' => '[:',
includes/class-wpglobus-post-types.php CHANGED
@@ -104,6 +104,10 @@ class WPGlobus_Post_Types {
104
  // Web Stories: https://wordpress.org/plugins/web-stories/ @since 2.5.15
105
  'web-story-template',
106
  'web-story',
 
 
 
 
107
  );
108
 
109
  /**
104
  // Web Stories: https://wordpress.org/plugins/web-stories/ @since 2.5.15
105
  'web-story-template',
106
  'web-story',
107
+ // 3D FlipBook Dflip Lite: https://wordpress.org/plugins/3d-flipbook-dflip-lite/ @since 2.5.17
108
+ 'dflip',
109
+ // https://oceanwp.org/ @since 2.5.17
110
+ 'oceanwp_library',
111
  );
112
 
113
  /**
includes/class-wpglobus-utils.php CHANGED
@@ -272,7 +272,7 @@ class WPGlobus_Utils {
272
  * @since 1.1.1
273
  */
274
  public static function current_url() {
275
- return set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ); // WPCS: input var ok, sanitization ok.
276
  }
277
 
278
  /**
@@ -475,4 +475,36 @@ class WPGlobus_Utils {
475
  /* @noinspection SubStrUsedAsStrPosInspection */
476
  return ( $n === substr( $s, 0, strlen( $n ) ) );
477
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
478
  }
272
  * @since 1.1.1
273
  */
274
  public static function current_url() {
275
+ return \set_url_scheme( 'http://' . self::http_host() . self::request_uri('/') );
276
  }
277
 
278
  /**
475
  /* @noinspection SubStrUsedAsStrPosInspection */
476
  return ( $n === substr( $s, 0, strlen( $n ) ) );
477
  }
478
+
479
+ /**
480
+ * Returns sanitized $_SERVER['REQUEST_URI'].
481
+ *
482
+ * @param string $default Default to return when unset.
483
+ *
484
+ * @return string
485
+ */
486
+ public static function request_uri( $default = '' ) {
487
+ if ( ! isset( $_SERVER['REQUEST_URI'] ) ) {
488
+ // Something abnormal.
489
+ return $default;
490
+ }
491
+
492
+ return \esc_url_raw( \wp_unslash( $_SERVER['REQUEST_URI'] ) );
493
+ }
494
+
495
+ /**
496
+ * Returns sanitized $_SERVER['HTTP_HOST'].
497
+ *
498
+ * @param string $default Default to return when unset.
499
+ *
500
+ * @return string
501
+ */
502
+ public static function http_host( $default = 'localhost' ) {
503
+ if ( ! isset( $_SERVER['HTTP_HOST'] ) ) {
504
+ // Something abnormal. Maybe WP-CLI.
505
+ return $default;
506
+ }
507
+
508
+ return \sanitize_text_field( \wp_unslash( $_SERVER['HTTP_HOST'] ) );
509
+ }
510
  }
includes/css/wpglobus-admin-tabs.css CHANGED
@@ -1,3 +1,3 @@
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 #dddddd;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 #00f}.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:24px}.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}
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 #dddddd;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 #00f}.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}
2
 
3
  /*# sourceMappingURL=wpglobus-admin-tabs.css.map */
includes/css/wpglobus-admin-tabs.scss CHANGED
@@ -171,7 +171,7 @@
171
  }
172
 
173
  .wpglobus-edit-slug-box {
174
- height: 24px;
175
  }
176
 
177
  /* WPSEO metabox */
171
  }
172
 
173
  .wpglobus-edit-slug-box {
174
+ height: 31px;
175
  }
176
 
177
  /* WPSEO metabox */
includes/js/wpglobus-admin-55.js CHANGED
@@ -836,7 +836,8 @@ jQuery(document).ready(function () {
836
  if ( typeof so !== 'undefined' ) {
837
  s = so;
838
  }
839
- $( 'input.ptitle' ).eq( 0 ).attr( 'value', s ) ;
 
840
  WPGlobusAdmin.qedit_titles[ id ][ 'source' ] = s;
841
  });
842
 
@@ -950,6 +951,10 @@ jQuery(document).ready(function () {
950
 
951
  var e = $('#edit-' + id + ' input.ptitle').eq(0);
952
  var p = e.parents('label');
 
 
 
 
953
  e.val(WPGlobusAdmin.qedit_titles[id].source);
954
  e.addClass('hidden');
955
  $(WPGlobusAdmin.data.template).insertAfter(p);
@@ -975,7 +980,8 @@ jQuery(document).ready(function () {
975
  if ( typeof WPGlobusAdmin.qedit_titles[id][l] !== 'undefined' ) {
976
  WPGlobusAdmin.qedit_titles[id][l]['name'] = WPGlobusAdmin.qedit_titles[id][l]['name'].replace( /\\\'/g, "'" );
977
  WPGlobusAdmin.qedit_titles[id][l]['name'] = WPGlobusAdmin.qedit_titles[id][l]['name'].replace( /\\\"/g, '"' );
978
- $e.attr( 'value', WPGlobusAdmin.qedit_titles[id][l]['name'] );
 
979
  WPGlobusAdmin.qedit_titles[id]['source'] =
980
  WPGlobusCore.getString(
981
  WPGlobusAdmin.qedit_titles[id]['source'],
@@ -984,7 +990,8 @@ jQuery(document).ready(function () {
984
  );
985
  }
986
  });
987
- $( 'input.ptitle' ).eq( 0 ).attr( 'value', WPGlobusAdmin.qedit_titles[ id ][ 'source' ] );
 
988
  });
989
 
990
  },
836
  if ( typeof so !== 'undefined' ) {
837
  s = so;
838
  }
839
+ // @since 2.5.17 Using `val` function instead of `attr`.
840
+ $( 'input.ptitle' ).eq( 0 ).val( s ) ;
841
  WPGlobusAdmin.qedit_titles[ id ][ 'source' ] = s;
842
  });
843
 
951
 
952
  var e = $('#edit-' + id + ' input.ptitle').eq(0);
953
  var p = e.parents('label');
954
+ if ( 'undefined' === typeof WPGlobusAdmin.qedit_titles ) {
955
+ // @since 2.5.17 Fixed Uncaught TypeError: Cannot read property of undefined.
956
+ return;
957
+ }
958
  e.val(WPGlobusAdmin.qedit_titles[id].source);
959
  e.addClass('hidden');
960
  $(WPGlobusAdmin.data.template).insertAfter(p);
980
  if ( typeof WPGlobusAdmin.qedit_titles[id][l] !== 'undefined' ) {
981
  WPGlobusAdmin.qedit_titles[id][l]['name'] = WPGlobusAdmin.qedit_titles[id][l]['name'].replace( /\\\'/g, "'" );
982
  WPGlobusAdmin.qedit_titles[id][l]['name'] = WPGlobusAdmin.qedit_titles[id][l]['name'].replace( /\\\"/g, '"' );
983
+ // @since 2.5.17 Using `val` function instead of `attr`.
984
+ $e.val( WPGlobusAdmin.qedit_titles[id][l]['name'] );
985
  WPGlobusAdmin.qedit_titles[id]['source'] =
986
  WPGlobusCore.getString(
987
  WPGlobusAdmin.qedit_titles[id]['source'],
990
  );
991
  }
992
  });
993
+ // @since 2.5.17 Using `val` function instead of `attr`.
994
+ $( 'input.ptitle' ).eq(0).val( WPGlobusAdmin.qedit_titles[ id ][ 'source' ] );
995
  });
996
 
997
  },
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>&nbsp;</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-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>&nbsp;/,""),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+'"/>&nbsp;&nbsp;'+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){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>&nbsp;</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>&nbsp;/,""),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+'"/>&nbsp;&nbsp;'+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)});
includes/js/wpglobus-vendor-pods.js ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * WPGlobus Vendor Pods.
3
+ * Interface JS functions
4
+ *
5
+ * @since 2.5.17
6
+ *
7
+ * @package WPGlobus
8
+ */
9
+ /*jslint browser:true*/
10
+ /*global tinymce:true */
11
+ /*global jQuery, console, WPGlobusVendorPods*/
12
+ jQuery(document).ready(function($){
13
+ "use strict";
14
+
15
+ if ( 'undefined' === typeof WPGlobusVendorPods ) {
16
+ return;
17
+ }
18
+
19
+ var api = {
20
+ start: function(){
21
+ api.triggerHandlers();
22
+ },
23
+ wysiwygFieldHandler: function(attrs){
24
+
25
+ if ( 'undefined' === typeof WPGlobusAdmin ) {
26
+ return;
27
+ }
28
+
29
+ if ( 'undefined' === typeof attrs.id ) {
30
+ return;
31
+ }
32
+ /**
33
+ * @see id = 'meta_description' => iframe id = 'pods-form-ui-pods-meta-description_ifr'
34
+ * @see id = 'persion_full_biography' => iframe id = 'pods-form-ui-pods-meta-persion-full-biography_ifr'
35
+ */
36
+ var id = attrs.id.replace(/_/g, '-');
37
+
38
+ tinymce.PluginManager.add('wpglobus_globe', function(editor, url) {
39
+
40
+ if ( -1 === editor.id.indexOf(id) ) {
41
+ return;
42
+ }
43
+
44
+ _.delay( function() {
45
+ $( editor.iframeElement ).addClass(WPGlobusAdmin.builder.translatableClass).css({'width':'99%'});
46
+ $( '#' + editor.id ).addClass(WPGlobusAdmin.builder.translatableClass);
47
+ }, 2000 );
48
+ editor.addButton( 'wpglobus_globe', {
49
+ text: ' '+WPGlobusAdmin.data.en_language_name[WPGlobusAdmin.currentTab],
50
+ icon: 'wpglobus-plus-globe'
51
+ });
52
+ });
53
+ },
54
+ fileFieldHandler: function(attrs){
55
+ // @since 2.5.17 @W.I.P
56
+ },
57
+ triggerHandlers: function(){
58
+ $(document).triggerHandler('wpglobus_wysiwyg_field', {callback:api.wysiwygFieldHandler});
59
+ // @since 2.5.17 @W.I.P
60
+ //$(document).triggerHandler('wpglobus_file_field', {callback:api.fileFieldHandler});
61
+ }
62
+ };
63
+
64
+ WPGlobusVendorPods = $.extend({}, WPGlobusVendorPods, api);
65
+ WPGlobusVendorPods.start();
66
+ });
includes/js/wpglobus-vendor-pods.min.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery(document).ready(function(l){"use strict";var e;"undefined"!=typeof WPGlobusVendorPods&&(e={start:function(){e.triggerHandlers()},wysiwygFieldHandler:function(e){var n;"undefined"!=typeof WPGlobusAdmin&&void 0!==e.id&&(n=e.id.replace(/_/g,"-"),tinymce.PluginManager.add("wpglobus_globe",function(e,d){-1!==e.id.indexOf(n)&&(_.delay(function(){l(e.iframeElement).addClass(WPGlobusAdmin.builder.translatableClass).css({width:"99%"}),l("#"+e.id).addClass(WPGlobusAdmin.builder.translatableClass)},2e3),e.addButton("wpglobus_globe",{text:" "+WPGlobusAdmin.data.en_language_name[WPGlobusAdmin.currentTab],icon:"wpglobus-plus-globe"}))}))},fileFieldHandler:function(e){},triggerHandlers:function(){l(document).triggerHandler("wpglobus_wysiwyg_field",{callback:e.wysiwygFieldHandler})}},(WPGlobusVendorPods=l.extend({},WPGlobusVendorPods,e)).start())});
includes/options/fields/table/class-wpglobus-languages-table.php CHANGED
@@ -505,13 +505,22 @@ class WPGlobus_Languages_Table extends WP_List_Table {
505
  * Generates content for a single row of the table.
506
  *
507
  * @since 1.5.10
 
 
508
  * @access public
509
  *
510
  * @param object $item The current item.
511
  */
512
  public function single_row( $item ) {
 
513
  if ( in_array( $item['wpglobus_code'], WPGlobus::Config()->enabled_languages, true ) ) {
514
- echo '<tr style="background-color:#d3e4f4;">';
 
 
 
 
 
 
515
  } else {
516
  echo '<tr>';
517
  }
@@ -520,3 +529,5 @@ class WPGlobus_Languages_Table extends WP_List_Table {
520
  echo '</tr>';
521
  }
522
  }
 
 
505
  * Generates content for a single row of the table.
506
  *
507
  * @since 1.5.10
508
+ * @since 2.5.17 Installed languages moved to top of table.
509
+ *
510
  * @access public
511
  *
512
  * @param object $item The current item.
513
  */
514
  public function single_row( $item ) {
515
+
516
  if ( in_array( $item['wpglobus_code'], WPGlobus::Config()->enabled_languages, true ) ) {
517
+ $order = '-1';
518
+ foreach( WPGlobus::Config()->enabled_languages as $order=>$language ) {
519
+ if ( $language == $item['wpglobus_code'] ) {
520
+ break;
521
+ }
522
+ }
523
+ echo '<tr class="wpglobus-the-language-item wpglobus-the-language-item-installed" style="background-color:#d3e4f4;" data-order="'.$order.'">';
524
  } else {
525
  echo '<tr>';
526
  }
529
  echo '</tr>';
530
  }
531
  }
532
+
533
+ # --- EOF
includes/vendor/pods/class-wpglobus-vendor-pods.php CHANGED
@@ -33,7 +33,19 @@ if ( ! class_exists( 'WPGlobus_Vendor_Pods' ) ) :
33
  /**
34
  * Constructor.
35
  */
36
- protected function __construct() {}
 
 
 
 
 
 
 
 
 
 
 
 
37
 
38
  /**
39
  * Get instance of this class.
@@ -48,6 +60,35 @@ if ( ! class_exists( 'WPGlobus_Vendor_Pods' ) ) :
48
  return self::$instance;
49
  }
50
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
  /**
52
  * Get multilingual fields.
53
  */
@@ -79,38 +120,42 @@ if ( ! class_exists( 'WPGlobus_Vendor_Pods' ) ) :
79
  'paragraph',
80
  'text',
81
  'website',
 
82
  );
83
 
84
  if ( $post_id > 0 ) {
85
 
86
- /**
87
- * @todo may be use pods_api() @see includes\builders\pods\class-wpglobus-builder-pods.php
88
- * @since 2.3.0
89
- */
90
-
91
- $fields = $wpdb->get_results( $wpdb->prepare(
92
- "SELECT p.post_name AS name, p.ID, p.post_title AS title, p.post_parent AS parent, pm.meta_value AS type FROM $wpdb->posts as p
93
- LEFT JOIN $wpdb->postmeta AS pm ON pm.post_id = p.ID WHERE p.post_type = %s AND p.post_status = 'publish' AND pm.meta_key = 'type'",
94
- self::$field_type
95
- ), OBJECT_K );
96
 
97
- if ( ! empty( $fields ) ) {
98
 
99
  self::$post_meta_fields = array();
100
  self::$post_multilingual_fields = array();
101
 
102
  foreach ( $fields as $key => $field ) :
103
-
104
  if ( 'wysiwyg' == $field->type ) {
105
- // wysiwyg field is enabled be default.
106
  if ( true ) {
107
  self::$post_meta_fields[$key] = $key;
 
 
 
 
108
  }
109
  } else if ( '____some_value____' == $field->type ) {
110
  // @todo W.I.P.
111
  } else if ( in_array( $field->type, $default_fields ) ) {
112
  self::$post_meta_fields[$key] = $key;
113
  self::$post_multilingual_fields[$key] = self::$meta_field_name_prefix . $key;
 
 
 
 
 
 
 
 
114
  } else {
115
  //
116
  }
@@ -122,6 +167,52 @@ if ( ! class_exists( 'WPGlobus_Vendor_Pods' ) ) :
122
  return self::$post_meta_fields;
123
  }
124
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
125
  /**
126
  * Check 3rd party plugin to enable/disable field.
127
  *
33
  /**
34
  * Constructor.
35
  */
36
+ protected function __construct() {
37
+
38
+ if ( is_admin() ) {
39
+
40
+ /**
41
+ * @since 2.5.17
42
+ */
43
+ add_action( 'admin_print_scripts', array(
44
+ __CLASS__,
45
+ 'on__admin_print_scripts'
46
+ ) );
47
+ }
48
+ }
49
 
50
  /**
51
  * Get instance of this class.
60
  return self::$instance;
61
  }
62
 
63
+ /**
64
+ * Enqueue JS for Pods support.
65
+ *
66
+ * @since 2.5.17
67
+ */
68
+ public static function on__admin_print_scripts() {
69
+
70
+ if ( WPGlobus_WP::is_pagenow( array( 'post.php' ) ) ) :
71
+
72
+ wp_register_script(
73
+ 'wpglobus-vendor-pods',
74
+ WPGlobus::$PLUGIN_DIR_URL . "includes/js/wpglobus-vendor-pods" . WPGlobus::SCRIPT_SUFFIX() . ".js",
75
+ array( 'jquery' ),
76
+ WPGLOBUS_VERSION,
77
+ true
78
+ );
79
+ wp_enqueue_script( 'wpglobus-vendor-pods' );
80
+ wp_localize_script(
81
+ 'wpglobus-vendor-pods',
82
+ 'WPGlobusVendorPods',
83
+ array(
84
+ 'version' => WPGLOBUS_VERSION,
85
+ 'vendor_version' => PODS_VERSION,
86
+ )
87
+ );
88
+
89
+ endif;
90
+ }
91
+
92
  /**
93
  * Get multilingual fields.
94
  */
120
  'paragraph',
121
  'text',
122
  'website',
123
+ 'phone',
124
  );
125
 
126
  if ( $post_id > 0 ) {
127
 
128
+ $fields = self::get_fields( $post_id, $post_type );
 
 
 
 
 
 
 
 
 
129
 
130
+ if ( $fields ) {
131
 
132
  self::$post_meta_fields = array();
133
  self::$post_multilingual_fields = array();
134
 
135
  foreach ( $fields as $key => $field ) :
136
+
137
  if ( 'wysiwyg' == $field->type ) {
138
+ // wysiwyg field is enabled by default.
139
  if ( true ) {
140
  self::$post_meta_fields[$key] = $key;
141
+ /**
142
+ * @since 2.5.16 @W.I.P
143
+ */
144
+ self::$post_multilingual_fields[$key] = array( 'id'=>self::$meta_field_name_prefix . $key, 'type'=>$field->type );
145
  }
146
  } else if ( '____some_value____' == $field->type ) {
147
  // @todo W.I.P.
148
  } else if ( in_array( $field->type, $default_fields ) ) {
149
  self::$post_meta_fields[$key] = $key;
150
  self::$post_multilingual_fields[$key] = self::$meta_field_name_prefix . $key;
151
+ } else if ( 'file' == $field->type ) {
152
+ // @todo need more investigation.
153
+ // Pods creates 2 meta:
154
+ // _pods_person_photo = `{:en}a:1:{i:0;i:19;}{:}{:ru}a:1:{i:0;i:21;}{:}`
155
+ // person_photo = imgID (latest value for any language)
156
+ // self::$post_meta_fields['_pods_' . $key] = '_pods_' . $key;
157
+ // self::$post_meta_fields[$key] = $key;
158
+ // self::$post_multilingual_fields[$key] = array( 'id'=>self::$meta_field_name_prefix . $key, 'type'=>$field->type );
159
  } else {
160
  //
161
  }
167
  return self::$post_meta_fields;
168
  }
169
 
170
+ /**
171
+ * Get fields.
172
+ *
173
+ * @since 2.5.17
174
+ *
175
+ * @return array || boolean
176
+ */
177
+ protected static function get_fields( $post_id, $post_type ) {
178
+
179
+ /**
180
+ * @see pods\classes\Pods.php
181
+ */
182
+ $pods = pods($post_type, $post_id);
183
+ $_fields = $pods->fields();
184
+
185
+ if ( empty( $_fields ) ) {
186
+ return false;
187
+ }
188
+
189
+ $fields = array();
190
+
191
+ foreach ( $_fields as $_key=>$_field ) :
192
+
193
+ $fields[$_key] = new stdClass;
194
+
195
+ $fields[$_key]->name = $_key;
196
+ $fields[$_key]->ID = $_field['id'];
197
+ $fields[$_key]->title = $_field['label'];
198
+ $fields[$_key]->parent = $_field['pod_id'];
199
+ $fields[$_key]->type = $_field['type'];
200
+ endforeach;
201
+
202
+ /**
203
+ * If we need full list of pods fields, then here is SELECT.
204
+ */
205
+ /*
206
+ $fields = $wpdb->get_results( $wpdb->prepare(
207
+ "SELECT p.post_name AS name, p.ID, p.post_title AS title, p.post_parent AS parent, pm.meta_value AS type FROM $wpdb->posts as p
208
+ LEFT JOIN $wpdb->postmeta AS pm ON pm.post_id = p.ID WHERE p.post_type = %s AND p.post_status = 'publish' AND pm.meta_key = 'type'",
209
+ self::$field_type
210
+ ), OBJECT_K );
211
+ // */
212
+
213
+ return $fields;
214
+ }
215
+
216
  /**
217
  * Check 3rd party plugin to enable/disable field.
218
  *
languages/wpglobus.pot CHANGED
@@ -1,8 +1,8 @@
1
- # Copyright (C) 2020 WPGlobus 2.5.16
2
- # This file is distributed under the same license as the WPGlobus 2.5.16 package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: WPGlobus 2.5.16\n"
6
  "MIME-Version: 1.0\n"
7
  "Content-Type: text/plain; charset=UTF-8\n"
8
  "Content-Transfer-Encoding: 8bit\n"
1
+ # Copyright (C) 2020 WPGlobus 2.5.17
2
+ # This file is distributed under the same license as the WPGlobus 2.5.17 package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: WPGlobus 2.5.17\n"
6
  "MIME-Version: 1.0\n"
7
  "Content-Type: text/plain; charset=UTF-8\n"
8
  "Content-Transfer-Encoding: 8bit\n"
readme.txt CHANGED
@@ -217,6 +217,19 @@ WPGlobus Version 2 supports WordPress 5.x, with Gutenberg.
217
 
218
  == Changelog ==
219
 
 
 
 
 
 
 
 
 
 
 
 
 
 
220
  = 2.5.16 =
221
 
222
  * (Core/Meta) Fixed PHP Warning: count(): Parameter must be an array or an object that implements Countable.
217
 
218
  == Changelog ==
219
 
220
+ = 2.5.17 =
221
+
222
+ * (Core/JS) Fixed `Uncaught TypeError: Cannot read property of undefined`.
223
+ * (Core/JS) Using `val` function instead of `attr`.
224
+ * (Core/Admin) CSS tweak for the `edit slug` box.
225
+ * (Core/Config) Changed the priority for `plugins_loaded` action.
226
+ * (Core/Config Builder) Check `$GLOBALS['WPGlobus']` for an array to prevent an occurring error `Cannot use object of type WPGlobus as array`.
227
+ * (Core/Utils) Fixed `current_url()` warning when plugin deactivated with WP-CLI.
228
+ * (Core) Do not decode special characters.
229
+ * (Builders/Pods) Added support for the `phone` and `wysiwyg` fields of `Pods – Custom Content Types and Fields`.
230
+ * (Core/Post Types) Added the `3D FlipBook Dflip Lite` plugin and `OceanWP` theme's post types to the `"hidden types"` list.
231
+ * (Options/Languages table) Installed languages moved to the top of the table.
232
+
233
  = 2.5.16 =
234
 
235
  * (Core/Meta) Fixed PHP Warning: count(): Parameter must be an array or an object that implements Countable.
wpglobus.php CHANGED
@@ -15,10 +15,12 @@
15
  * Description: A WordPress Globalization / Multilingual Plugin. Posts, pages, menus, widgets and even custom fields - in multiple languages!
16
  * Text Domain: wpglobus
17
  * Domain Path: /languages/
18
- * Version: 2.5.16
19
  * Author: WPGlobus
20
  * Author URI: https://wpglobus.com/
21
  * Network: false
 
 
22
  * License: GPL-3.0-or-later
23
  * License URI: https://spdx.org/licenses/GPL-3.0-or-later.html
24
  */
@@ -42,7 +44,7 @@ if ( ! defined( 'ABSPATH' ) ) {
42
  exit;
43
  }
44
 
45
- define( 'WPGLOBUS_VERSION', '2.5.16' );
46
  define( 'WPGLOBUS_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
47
  define( 'WPGLOBUS_AJAX', 'wpglobus-ajax' );
48
 
15
  * Description: A WordPress Globalization / Multilingual Plugin. Posts, pages, menus, widgets and even custom fields - in multiple languages!
16
  * Text Domain: wpglobus
17
  * Domain Path: /languages/
18
+ * Version: 2.5.17
19
  * Author: WPGlobus
20
  * Author URI: https://wpglobus.com/
21
  * Network: false
22
+ * Requires at least: 5.0
23
+ * Requires PHP: 5.6
24
  * License: GPL-3.0-or-later
25
  * License URI: https://spdx.org/licenses/GPL-3.0-or-later.html
26
  */
44
  exit;
45
  }
46
 
47
+ define( 'WPGLOBUS_VERSION', '2.5.17' );
48
  define( 'WPGLOBUS_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
49
  define( 'WPGLOBUS_AJAX', 'wpglobus-ajax' );
50