Version Description
- (Core/JS) Set new value using
val
function instead ofattr
for menu item labels and titles.
Download this release
Release Info
Developer | tivnet |
Plugin | WPGlobus – Multilingual Everything! |
Version | 2.8.2 |
Comparing to | |
See all releases |
Code changes from version 2.8.1 to 2.8.2
- data/wpglobus-product-info.json +1 -1
- includes/js/wpglobus-admin-56.js +48 -46
- includes/js/wpglobus-admin-56.min.js +1 -1
- readme.txt +3 -0
- wpglobus.php +2 -2
data/wpglobus-product-info.json
CHANGED
@@ -1 +1 @@
|
|
1 |
-
{"multilingual-woocommerce-nets-netaxept":{"title":"{:en}Multilingual WooCommerce Nets Netaxept{:}{:ru}\u041c\u0443\u043b\u044c\u0442\u0438\u044f\u0437\u044b\u0447\u043d\u043e\u0441\u0442\u044c \u0434\u043b\u044f WooCommerce Nets Netaxept{:}","_api_new_version":"1.0.3","_api_tested_up_to":"4.9.8"},"wpglobus-multi-currency":{"title":"{:en}Multi-Currency for WooCommerce{:}{:ru}WPGlobus - \u041c\u0443\u043b\u044c\u0442\u0438\u0432\u0430\u043b\u044e\u0442\u043d\u043e\u0441\u0442\u044c \u0434\u043b\u044f WooCommerce{:}","_api_new_version":"1.1.1","_api_tested_up_to":"4.9.4"},"wpglobus-mobile-menu":{"title":"{:en}WPGlobus Mobile Menu{:}{:ru}WPGlobus Mobile Menu{:}","_api_new_version":"2.2.0","_api_tested_up_to":"5.6"},"wpglobus-header-images":{"title":"{:en}WPGlobus Header Images{:}{:ru}WPGlobus Header Images{:}","_api_new_version":"2.1.0","_api_tested_up_to":"5.5"},"wpglobus-for-ultimate-member":{"title":"{:en}WPGlobus for Ultimate Member{:}{:ru}WPGlobus \u0434\u043b\u044f \u043f\u043b\u0430\u0433\u0438\u043d\u0430 Ultimate Member{:}","_api_new_version":"1.1.0","_api_tested_up_to":"5.6"},"wpglobus-menu-visibility":{"title":"WPGlobus Menu Visibility","_api_new_version":"2.0.0","_api_tested_up_to":"5.6"},"wpglobus-for-bridge-theme":{"title":"{:en}WPGlobus for the \"Bridge\" theme{:}{:ru}WPGlobus \u0434\u043b\u044f \u0442\u0435\u043c\u044b Bridge{:}","_api_new_version":"2.4.0","_api_tested_up_to":"5.5"},"wpglobus-language-widgets":{"title":"{:en}WPGlobus Language Widgets{:}{:ru}\u042f\u0437\u044b\u043a\u0438 WPGlobus \u0434\u043b\u044f \u0432\u0438\u0434\u0436\u0435\u0442\u043e\u0432{:}","_api_new_version":"2.1.0","_api_tested_up_to":"5.7"},"wpglobus-multilingual-popups":{"title":"{:en}WPGlobus Multilingual Popups{:}{:ru}WPGlobus Multilingual Popups{:}","_api_new_version":"1.4.0","_api_tested_up_to":"5.7"},"woocommerce-wpglobus":{"title":"{:en}WPGlobus for WooCommerce{:}{:ru}\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 WooCommerce WPGlobus{:}","_api_new_version":"5.3.0","_api_tested_up_to":"5.7"},"wpglobus-plus":{"title":"{:en}WPGlobus Plus multilingual extension{:}{:ru}WPGlobus \u041f\u043b\u044e\u0441{:}","_api_new_version":"1.7.3","_api_tested_up_to":"5.
|
1 |
+
{"multilingual-woocommerce-nets-netaxept":{"title":"{:en}Multilingual WooCommerce Nets Netaxept{:}{:ru}\u041c\u0443\u043b\u044c\u0442\u0438\u044f\u0437\u044b\u0447\u043d\u043e\u0441\u0442\u044c \u0434\u043b\u044f WooCommerce Nets Netaxept{:}","_api_new_version":"1.0.3","_api_tested_up_to":"4.9.8"},"wpglobus-multi-currency":{"title":"{:en}Multi-Currency for WooCommerce{:}{:ru}WPGlobus - \u041c\u0443\u043b\u044c\u0442\u0438\u0432\u0430\u043b\u044e\u0442\u043d\u043e\u0441\u0442\u044c \u0434\u043b\u044f WooCommerce{:}","_api_new_version":"1.1.1","_api_tested_up_to":"4.9.4"},"wpglobus-mobile-menu":{"title":"{:en}WPGlobus Mobile Menu{:}{:ru}WPGlobus Mobile Menu{:}","_api_new_version":"2.2.0","_api_tested_up_to":"5.6"},"wpglobus-header-images":{"title":"{:en}WPGlobus Header Images{:}{:ru}WPGlobus Header Images{:}","_api_new_version":"2.1.0","_api_tested_up_to":"5.5"},"wpglobus-for-ultimate-member":{"title":"{:en}WPGlobus for Ultimate Member{:}{:ru}WPGlobus \u0434\u043b\u044f \u043f\u043b\u0430\u0433\u0438\u043d\u0430 Ultimate Member{:}","_api_new_version":"1.1.0","_api_tested_up_to":"5.6"},"wpglobus-menu-visibility":{"title":"WPGlobus Menu Visibility","_api_new_version":"2.0.0","_api_tested_up_to":"5.6"},"wpglobus-for-bridge-theme":{"title":"{:en}WPGlobus for the \"Bridge\" theme{:}{:ru}WPGlobus \u0434\u043b\u044f \u0442\u0435\u043c\u044b Bridge{:}","_api_new_version":"2.4.0","_api_tested_up_to":"5.5"},"wpglobus-language-widgets":{"title":"{:en}WPGlobus Language Widgets{:}{:ru}\u042f\u0437\u044b\u043a\u0438 WPGlobus \u0434\u043b\u044f \u0432\u0438\u0434\u0436\u0435\u0442\u043e\u0432{:}","_api_new_version":"2.1.0","_api_tested_up_to":"5.7"},"wpglobus-multilingual-popups":{"title":"{:en}WPGlobus Multilingual Popups{:}{:ru}WPGlobus Multilingual Popups{:}","_api_new_version":"1.4.0","_api_tested_up_to":"5.7"},"woocommerce-wpglobus":{"title":"{:en}WPGlobus for WooCommerce{:}{:ru}\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 WooCommerce WPGlobus{:}","_api_new_version":"5.3.0","_api_tested_up_to":"5.7"},"wpglobus-plus":{"title":"{:en}WPGlobus Plus multilingual extension{:}{:ru}WPGlobus \u041f\u043b\u044e\u0441{:}","_api_new_version":"1.7.3","_api_tested_up_to":"5.8"},"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.9.1","_api_tested_up_to":"5.7.2"}}
|
includes/js/wpglobus-admin-56.js
CHANGED
@@ -1099,14 +1099,14 @@ jQuery(document).ready(function () {
|
|
1099 |
*/
|
1100 |
$(WPGlobusAdmin.data.multilingualSlug.title).insertAfter('.term-slug-wrap th label');
|
1101 |
},
|
1102 |
-
navMenus: function
|
1103 |
-
var iID,
|
1104 |
-
|
1105 |
|
1106 |
-
var timer = function
|
1107 |
-
if (
|
1108 |
clearInterval(iID);
|
1109 |
-
$(
|
1110 |
var $li = $(li);
|
1111 |
if ($li.hasClass('wpglobus-menu-item')) {
|
1112 |
return; /** the same as continue */
|
@@ -1135,19 +1135,19 @@ jQuery(document).ready(function () {
|
|
1135 |
return;
|
1136 |
}
|
1137 |
if (PlainObject.data.indexOf('action=add-menu-item') >= 0) {
|
1138 |
-
|
1139 |
iID = setInterval(timer, 500);
|
1140 |
}
|
1141 |
}
|
1142 |
});
|
1143 |
|
1144 |
-
|
1145 |
-
|
1146 |
-
|
1147 |
-
|
1148 |
|
1149 |
-
|
1150 |
-
|
1151 |
if ( $i.val() != WPGlobusAdmin.data.items[ item_id ][ input ][ 'source' ] ) {
|
1152 |
/**
|
1153 |
* fix for case when value resets by WP core
|
@@ -1155,40 +1155,42 @@ jQuery(document).ready(function () {
|
|
1155 |
$i.val( WPGlobusAdmin.data.items[ item_id ][ input ][ 'source' ] );
|
1156 |
}
|
1157 |
|
1158 |
-
|
1159 |
-
|
1160 |
-
|
1161 |
-
|
1162 |
-
|
1163 |
-
|
1164 |
-
|
1165 |
-
|
1166 |
-
|
1167 |
-
|
1168 |
-
|
1169 |
-
|
1170 |
-
|
1171 |
-
|
1172 |
-
|
1173 |
-
new_element.attr('class', classes);
|
1174 |
-
}
|
1175 |
-
|
1176 |
-
if ( WPGlobusAdmin.data.items[ item_id ][ language ][ input ][ 'caption' ] != '' ) {
|
1177 |
-
new_element.attr('value', WPGlobusAdmin.data.items[item_id][language][input]['caption']);
|
1178 |
} else {
|
1179 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
1180 |
}
|
1181 |
-
new_element.css('margin-bottom', '0.6em');
|
1182 |
-
$(p).append( new_element );
|
1183 |
-
height = index;
|
1184 |
-
});
|
1185 |
-
height = (height + 1) * 40;
|
1186 |
-
$i.css('display', 'none').attr('class', '').addClass('widefat wpglobus-hidden');
|
1187 |
-
$(p).css('height', height + 'px').addClass('wpglobus-menu-item-box');
|
1188 |
|
1189 |
-
|
1190 |
-
|
1191 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1192 |
|
1193 |
$('.menus-move-left, .menus-move-right').each(function(index,e) {
|
1194 |
var $e = $(e), new_title;
|
@@ -1240,7 +1242,7 @@ jQuery(document).ready(function () {
|
|
1240 |
* @since 1.9.16
|
1241 |
*/
|
1242 |
var menuItems = [];
|
1243 |
-
setTimeout(function
|
1244 |
$('.edit-menu-item-description').each(function() {
|
1245 |
var id = $(this).attr('id');
|
1246 |
menuItems.push(id);
|
@@ -1269,7 +1271,7 @@ jQuery(document).ready(function () {
|
|
1269 |
})
|
1270 |
.always(function (jqXHR, status) {
|
1271 |
});
|
1272 |
-
}, 1000
|
1273 |
|
1274 |
},
|
1275 |
postEdit: function () {
|
1099 |
*/
|
1100 |
$(WPGlobusAdmin.data.multilingualSlug.title).insertAfter('.term-slug-wrap th label');
|
1101 |
},
|
1102 |
+
navMenus: function() {
|
1103 |
+
var iID, menuSize,
|
1104 |
+
menuItem = '#menu-to-edit .menu-item';
|
1105 |
|
1106 |
+
var timer = function() {
|
1107 |
+
if ( menuSize !== $(menuItem).length ) {
|
1108 |
clearInterval(iID);
|
1109 |
+
$(menuItem).each(function (index, li) {
|
1110 |
var $li = $(li);
|
1111 |
if ($li.hasClass('wpglobus-menu-item')) {
|
1112 |
return; /** the same as continue */
|
1135 |
return;
|
1136 |
}
|
1137 |
if (PlainObject.data.indexOf('action=add-menu-item') >= 0) {
|
1138 |
+
menuSize = $(menuItem).length;
|
1139 |
iID = setInterval(timer, 500);
|
1140 |
}
|
1141 |
}
|
1142 |
});
|
1143 |
|
1144 |
+
$(menuItem).each(function(index, li) {
|
1145 |
+
|
1146 |
+
var id = $(li).attr('id'),
|
1147 |
+
item_id = id.replace('menu-item-', '');
|
1148 |
|
1149 |
+
$.each(['input.edit-menu-item-title', 'input.edit-menu-item-attr-title'], function (input_index, input) {
|
1150 |
+
var $i = $('#' + id + ' ' + input);
|
1151 |
if ( $i.val() != WPGlobusAdmin.data.items[ item_id ][ input ][ 'source' ] ) {
|
1152 |
/**
|
1153 |
* fix for case when value resets by WP core
|
1155 |
$i.val( WPGlobusAdmin.data.items[ item_id ][ input ][ 'source' ] );
|
1156 |
}
|
1157 |
|
1158 |
+
var p = $( '#' + id + ' ' + input ).parents('p');
|
1159 |
+
var height = 0;
|
1160 |
+
|
1161 |
+
$.each(WPGlobusAdmin.data.open_languages, function(languageIndex, language) {
|
1162 |
+
var newElement = $i.clone();
|
1163 |
+
newElement.attr('id', $i.attr('id') + '-' + language);
|
1164 |
+
newElement.attr('name', $i.attr('id') + '-' + language);
|
1165 |
+
newElement.attr('data-language', language);
|
1166 |
+
newElement.attr('data-item-id', item_id);
|
1167 |
+
newElement.attr('placeholder', WPGlobusAdmin.data.en_language_name[language]);
|
1168 |
+
newElement.attr('value', '');
|
1169 |
+
|
1170 |
+
var classes = WPGlobusAdmin.data.items[item_id][language][input]['class'];
|
1171 |
+
if (input_index === 0 && language === WPGlobusAdmin.data.default_language) {
|
1172 |
+
newElement.attr('class', classes + ' edit-menu-item-title');
|
|
|
|
|
|
|
|
|
|
|
1173 |
} else {
|
1174 |
+
newElement.attr('class', classes);
|
1175 |
+
}
|
1176 |
+
|
1177 |
+
if ( WPGlobusAdmin.data.items[ item_id ][ language ][ input ][ 'caption' ] == '' ) {
|
1178 |
+
newElement.val('');
|
1179 |
+
} else {
|
1180 |
+
newElement.val(WPGlobusAdmin.data.items[item_id][language][input]['caption']);
|
1181 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1182 |
|
1183 |
+
newElement.css('margin-bottom', '0.6em');
|
1184 |
+
$(p).append( newElement );
|
1185 |
+
height = languageIndex;
|
1186 |
+
});
|
1187 |
+
height = (height + 1) * 40;
|
1188 |
+
$i.css('display', 'none').attr('class', '').addClass('widefat wpglobus-hidden');
|
1189 |
+
$(p).css('height', height + 'px').addClass('wpglobus-menu-item-box');
|
1190 |
+
|
1191 |
+
});
|
1192 |
+
$(li).addClass('wpglobus-menu-item');
|
1193 |
+
});
|
1194 |
|
1195 |
$('.menus-move-left, .menus-move-right').each(function(index,e) {
|
1196 |
var $e = $(e), new_title;
|
1242 |
* @since 1.9.16
|
1243 |
*/
|
1244 |
var menuItems = [];
|
1245 |
+
setTimeout(function() {
|
1246 |
$('.edit-menu-item-description').each(function() {
|
1247 |
var id = $(this).attr('id');
|
1248 |
menuItems.push(id);
|
1271 |
})
|
1272 |
.always(function (jqXHR, status) {
|
1273 |
});
|
1274 |
+
}, 1000);
|
1275 |
|
1276 |
},
|
1277 |
postEdit: function () {
|
includes/js/wpglobus-admin-56.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var WPGlobusCore,WPGlobusDialogApp;!function(i){var d=WPGlobusCore={strpos:function(t,a,e){e=(t=""+t).indexOf(a,e);return 0<=e&&e},TextFilter:function(t,a,e){if(void 0===t||""===t)return t;var o,n,i=[],l=!1;a=""==a?"en":a,e=void 0===e||""==e?"RETURN_IN_DEFAULT_LANGUAGE":e,i[0]=[],i[0].start=WPGlobusCoreData.locale_tag_start.replace("%s",a),i[0].end=WPGlobusCoreData.locale_tag_end,i[1]=[],i[1].start="\x3c!--:"+a+"--\x3e",i[1].end="\x3c!--:--\x3e",i[2]=[],i[2].start="[:"+a+"]",i[2].end="[:";for(var s=0;s<3;s++)if(!1!==(o=d.strpos(t,i[s].start))){o+=i[s].start.length,t=!1===(n=d.strpos(t,i[s].end,o))?t.substr(o):t.substr(o,n-o),l=!0;break}return l||("RETURN_EMPTY"==e?a==WPGlobusCoreData.default_language&&!/(\{:|\[:|<!--:)[a-z]{2}/.test(t)||(t=""):a==WPGlobusCoreData.default_language?/(\{:|\[:|<!--:)[a-z]{2}/.test(t)&&(t=""):t=d.TextFilter(t,WPGlobusCoreData.default_language)),t},addLocaleMarks:function(t,a){return WPGlobusCoreData.locale_tag_start.replace("%s",a)+t+WPGlobusCoreData.locale_tag_end},getTranslations:function(e){var o,n={};return i.each(WPGlobusCoreData.enabled_languages,function(t,a){o=a==WPGlobusCoreData.default_language?"RETURN_IN_DEFAULT_LANGUAGE":"RETURN_EMPTY",n[a]=d.TextFilter(e,a,o)}),n},getString:function(t,a,e){if(void 0===t)return t;void 0===a&&(a=""),void 0===e&&(e=WPGlobusCoreData.language),(t=d.getTranslations(t))[e]=a;var o="";return i.each(t,function(t,a){""!=a&&t!=WPGlobusCoreData.default_language&&(o+=d.addLocaleMarks(a,t))}),o=""!=t[WPGlobusCoreData.default_language]?""==o?t[WPGlobusCoreData.default_language]:d.addLocaleMarks(t[WPGlobusCoreData.default_language],WPGlobusCoreData.default_language)+o:o}}}(jQuery),function(c){var g=WPGlobusDialogApp={inited:!1,option:{listenClass:".wpglobus_dialog_start",settingsClass:".wpglobus_dialog_settings",dialogTabs:"#wpglobus-dialog-tabs",dialogTitle:"",customData:null,callback:function(){},dialogOptions:{title:"",placeholder:"",formFooter:"",beforeOpen:function(){},afterOpen:function(){},afterSave:function(){},close:function(){}},dialog:{}},form:void 0,element:void 0,element_by:"id",id:"",clone_id:"",wpglobus_id:"",type:"textarea",source:"",order:{},value:{},request:"core",attrs:{},dialogTitle:"",trClass:"wpglobus-translatable",startButton:['<span id="wpglobus-dialog-start-{{clone_id}}" ','style="{{style}}" ','data-type="control" data-dialog-title="{{title}}" ','data-source-type="" data-source-id="{{id}}" data-source-name="{{name}}" ','data-nodename="{{nodename}}"',"{{sbTitle}} ",'class="{{classes}}"></span>'].join(""),startButtonClass:"wpglobus_dialog_start wpglobus_dialog_icon",clicks:0,init:function(t){g.inited||(g.option.dialog=g.option.dialogOptions,g.option=c.extend(g.option,t),c(g.option.dialogTabs).tabs(),g.dialogTitle=g.option.dialogTitle,this.attachListener(),null!=g.option.customData&&void 0!==g.option.customData.addElements&&c.each(g.option.customData.addElements,function(t,a){g.addElement(a)}),g.inited=!0)},convertToId:function(t){return t=(t=t.replace(/\]/g,"")).replace(/\[/g,"-")},addElement:function(t){g.init();var a={id:null,style:"",styleTextareaWrapper:"",sbTitle:"",onChangeClass:"",dialogTitle:"",dialog:g.option.dialogOptions};if("string"==typeof t)a.id=t;else{if("object"!=typeof t)return;a=c.extend(a,t)}var e,o=null,n=null,i=null,l=null,s=g.startButton,d="";if(g.element_by="name",0==(l=document.getElementsByName(a.id)).length&&(g.element_by="id",l=document.getElementById(a.id)),null!==l){if(n=a.id,i=void 0===(o="id"==g.element_by?c("#"+n):(d=(d=l[0].nodeName).toLowerCase(),c(d+'[name="'+n+'"]'))).attr("name")||""==o.attr("name")?n:o.attr("name"),g.clone_id=g.convertToId(n),-1!=i.indexOf("wpglobus")||-1!=g.clone_id.indexOf("wpglobus"))return!1;if(0<c("#wpglobus-"+g.clone_id).length)return!1;t=c(o.clone()),l=o.attr("style")||"",o.attr("style","display:none;"),t.attr("id","wpglobus-"+g.clone_id).attr("name","wpglobus-"+i),t.addClass(g.trClass),""!=a.onChangeClass&&t.addClass(a.onChangeClass),("id"==g.element_by?t.attr("data-source-id",n).attr("data-source-name",""):t.attr("data-source-id","").attr("data-source-name",i)).attr("data-source-get-by",g.element_by),"textarea"==d?(e=WPGlobusCore.getTranslations(o.val())[WPGlobusCoreData.language],t.val(e),t.attr("data-nodename","textarea"),""==a.style?t.attr("style",l+";width:95%;float:left;"):t.attr("style",l+";"+a.style)):(e=WPGlobusCore.getTranslations(o.val())[WPGlobusCoreData.language],t.val(e),t.attr("data-nodename","input"),""!=a.style&&t.attr("style",l+";"+a.style)),""!=a.dialog&&t.attr("data-dialog",JSON.stringify(a.dialog)),s=s.replace(/{{clone_id}}/g,g.clone_id),s="id"==g.element_by?(s=(s=s.replace(/{{id}}/g,g.clone_id)).replace(/{{name}}/g,"")).replace(/{{nodename}}/g,""):(s=(s=s.replace(/{{id}}/g,"")).replace(/{{name}}/g,i)).replace(/{{nodename}}/g,d);s="textarea"==d?s.replace("{{style}}","float:left;margin-top:0;"):s.replace("{{style}}",""),i="textarea"==d?g.startButtonClass+" wpglobus-textarea wpglobus-textarea-"+g.clone_id:g.startButtonClass;s=s.replace("{{classes}}",i),s=""==a.dialogTitle?s.replace("{{title}}",g.dialogTitle):s.replace("{{title}}",a.dialogTitle),s=""==a.sbTitle?s.replace("{{sbTitle}}",a.sbTitle):s.replace("{{sbTitle}}",'title="'+a.sbTitle+'"'),c(s).insertAfter(o),c(t).insertAfter(o),"textarea"==d&&(c("#wpglobus-"+g.clone_id).addClass("wpglobus-textarea-"+g.clone_id),c(".wpglobus-textarea-"+g.clone_id).wrapAll('<div class="wpglobus-textarea-wrapper" style="'+a.styleTextareaWrapper+'"></div>'));var u,r=!1;return(""==a.onChangeClass?u="#wpglobus-"+g.clone_id:(u="."+a.onChangeClass,void 0===(a=c._data(c(document)[0],"events"))?r=!0:void 0!==a.change&&c.each(a.change,function(t,a){if(a.selector==u)return!(r=!0)})),r)?!0:(c(document).on("change",u,function(){var t=c(this),a=""==(a=t.data("source-id"))?t.data("nodename")+'[name="'+t.data("source-name")+'"]':"#"+a;c(a).val(WPGlobusCore.getString(c(a).val(),t.val()))}),!0)}},saveDialog:function(){var e,o,n="",i="",l="";c(".wpglobus_dialog_textarea").each(function(t,a){o=c(a),e=o.val(),(o=o.data("language"))==WPGlobusAdmin.data.language&&(l=e),""!=e&&(n+=WPGlobusCore.addLocaleMarks(e,o),o==WPGlobusCoreData.default_language&&(i=e))}),n=n.length==i.length+8?i:n,c(g.id).val(n),n=""==l?i:l,c(g.wpglobus_id).val(n),g.runCallback(g.option.dialog.afterSave)},dialog:c("#wpglobus-dialog-wrapper").dialog({autoOpen:!1,width:650,modal:!0,dialogClass:"wpglobus-dialog",buttons:[{text:"Save",class:"wpglobus-button-save",click:function(){g.saveDialog(),g.dialog.dialog("close")}},{text:"Cancel",class:"wpglobus-button-cancel",click:function(){g.dialog.dialog("close")}}],open:function(t,a){var e=g.dialogTitle;void 0!==g.attrs.maxlength&&(c(".wpglobus_dialog_textarea").attr("maxlength",g.attrs.maxlength),e+=" | maxlength="+g.attrs.maxlength),c(".wpglobus-dialog .ui-dialog-title").text(e),c(this).removeClass("hidden")},close:function(){c(this).addClass("hidden"),g.runCallback(g.option.dialog.close),g.form[0].reset()}}),attachListener:function(){c(document).on("click",g.option.settingsClass,function(){c(".wpglobus_dialog_options_wrapper").hasClass("hidden")?c(".wpglobus_dialog_options_wrapper").removeClass("hidden"):c(".wpglobus_dialog_options_wrapper").addClass("hidden")}),c(document).on("click",".wpglobus_dialog_option",function(t){var a=c(this),e=a.data("object");g.order.action="save_post_meta_settings",g.order.post_type=WPGlobusAdmin.data.post_type,g.order.checked=a.prop("checked"),g.order.id=a.attr("id"),g.order.meta_key=a.data("meta-key"),g.ajax(g.order).done(function(t){"ok"==t.result&&("true"==t.checked?c(e).removeClass("wpglobus_dialog_start_hidden"):c(e).addClass("wpglobus_dialog_start_hidden"))}).fail(function(t){}).always(function(t,a){})}),c(document).on("click",g.option.listenClass,function(a){g.element=c(this),g.id=g.element.data("source-id"),""==g.id?(g.id=g.element.data("nodename")+'[name="'+g.element.data("source-name")+'"]',g.wpglobus_id="#wpglobus-"+g.convertToId(g.element.data("source-name"))):(g.wpglobus_id="#wpglobus-"+g.id,g.id="#"+g.id),g.clicks++,1==g.clicks&&setTimeout(function(){var t;1==g.clicks?g.onClick(a):(t=c(g.id)).hasClass("hidden")?t.removeClass("hidden").attr("style","display:block;"):t.addClass("hidden").attr("style","display:none;"),g.clicks=0},200)}),g.form=g.dialog.find("form#wpglobus-dialog-form").on("submit",function(t){t.preventDefault(),g.saveDialog()})},ajax:function(t){return c.ajax({type:"POST",url:WPGlobusAdmin.ajaxurl,data:{action:WPGlobusAdmin.process_ajax,order:t},dataType:"json",async:!1})},onClick:function(t){void 0===g.element.data("dialog-title")||""==g.element.data("dialog-title")?g.dialogTitle=g.option.dialogTitle:g.dialogTitle=g.element.data("dialog-title"),void 0!==g.id&&(g.attrs.maxlength=c(g.id).attr("maxlength")),g.source=g.element.data("source-value"),void 0===g.source&&(g.source=c(g.id).val(),"ajax"==g.request||(g.value=WPGlobusCore.getTranslations(g.source))),g.option.dialog=c.extend({},g.option.dialogOptions,c(g.wpglobus_id).data("dialog")),""!=g.option.dialog.title&&(g.dialogTitle=g.option.dialog.title),c.each(g.value,function(t,a){var e=c("#wpglobus-dialog-"+t);e.val(a),e.attr("placeholder",WPGlobusCore.TextFilter(g.option.dialog.placeholder,t,"RETURN_IN_DEFAULT_LANGUAGE"))}),c("#wpglobus-dialog-form-footer").html(g.option.dialog.formFooter),g.runCallback(g.option.dialog.beforeOpen),g.dialog.dialog("open"),g.runCallback(g.option.dialog.afterOpen)},runCallback:function(t){var a,e;"object"==typeof t?(a=Object.keys(t)[0],e=t[Object.keys(t)[0]],"window"===a?"function"==typeof window[e]&&window[e](t[Object.keys(t)[1]]):"function"==typeof window[a][e]&&window[a][e](t[Object.keys(t)[1]])):"string"==typeof t?"function"==typeof window[t]&&window[t]():"function"==typeof t&&t()}}}(jQuery),jQuery(document).ready(function(){"use strict";var t,r;window.WPGlobusAdminApp=(t=window.WPGlobusAdminApp||{},r=jQuery,t.App=function(t){void 0===window.WPGlobusAdminApp&&(this.config={debug:!1,version:WPGlobusAdmin.version},this.status="ok","undefined"==typeof WPGlobusAdmin?(this.status="error",this.config.debug&&console.log("WPGlobus: error options loading")):this.config.debug&&console.dir(WPGlobusAdmin),this.config.disable_first_language=['<div id="disable_first_language" style="display:block;" class="redux-field-errors notice-red">',"<strong>","<span> </span>",WPGlobusAdmin.i18n.cannot_disable_language,"</strong>","</div>"].join(""),r.extend(this.config,t),"ok"===this.status&&this.init())},t.App.prototype={$document:r(document),init:function(){WPGlobusCoreData.multisite=this.parseBool(WPGlobusCoreData.multisite),this.adminInit(),r("#content").addClass("wpglobus-editor").attr("data-language",WPGlobusAdmin.data.default_language),r("textarea[id^=content_]").each(function(t,a){var e=r(a).attr("id").replace("content_","");r(a).attr("data-language",e)}),"post.php"===WPGlobusAdmin.page?(this.postEdit(),this.set_dialog(),"undefined"!=typeof WPGlobusAioseop&&WPGlobusAioseop.init()):"menu-edit"===WPGlobusAdmin.page?(WPGlobusDialogApp.init({dialogTitle:"Edit description"}),this.navMenus()):"taxonomy-edit"===WPGlobusAdmin.page?WPGlobusAdmin.data.tag_id&&this.taxonomyEdit():"taxonomy-quick-edit"===WPGlobusAdmin.page?this.quickEdit("taxonomy"):"edit.php"===WPGlobusAdmin.page?(this.quickEdit("post"),0<_.size(WPGlobusAdmin.$_get)&&WPGlobusDialogApp.init()):"options-general.php"==WPGlobusAdmin.page?(this.optionsGeneral(),WPGlobusDialogApp.init({customData:WPGlobusCoreData.page_custom_data})):"widgets.php"==WPGlobusAdmin.page?"undefined"!=typeof WPGlobusWidgets&&(WPGlobusWidgets.init(),WPGlobusDialogApp.init({dialogTitle:"Edit text"})):"wpglobus_options"==WPGlobusAdmin.page?this.start():"wpglobusAdminCentral"==WPGlobusAdmin.page?this.adminCentral():WPGlobusDialogApp.init({customData:WPGlobusCoreData.page_custom_data})},parseBool:function(t){return!/^(false|0)$/i.test(t)&&!!t},getCurrentTab:function(){return r(".wpglobus-post-body-tabs-list .ui-tabs-active").data("language")},adminInit:function(){var t=r(".wpglobus-addons-group a").data("key");void 0!==t&&(0<=window.location.search.indexOf("page=wpglobus_options&tab="+t)?WPGlobusCoreData.multisite?window.location=WPGlobusCoreData.pluginInstallLocation.multisite:window.location=WPGlobusCoreData.pluginInstallLocation.single:(t=r("#toplevel_page_wpglobus_options li").eq(t+1),(WPGlobusCoreData.multisite?r(t).find("a").attr("href",WPGlobusCoreData.pluginInstallLocation.multisite):r(t).find("a").attr("href",WPGlobusCoreData.pluginInstallLocation.single)).attr("onclick","window.location=jQuery(this).attr('href');return false;")))},optionsGeneral:function(){var e=r("#blogname"),t=r("body");e.addClass("hidden"),r("#wpglobus-blogname").insertAfter(e).removeClass("hidden"),t.on("blur",".wpglobus-blogname",function(){r(".wpglobus-blogname").each(function(t,a){a=r(a);e.val(WPGlobusCore.getString(e.val(),a.val(),a.data("language")))})});var o=r("#blogdescription");o.addClass("hidden"),r("#wpglobus-blogdescription").insertAfter(o).removeClass("hidden"),t.on("blur",".wpglobus-blogdesc",function(){r(".wpglobus-blogdesc").each(function(t,a){a=r(a);o.val(WPGlobusCore.getString(o.val(),a.val(),a.data("language")))})})},quickEdit:function(o){var n,i,l,t;void 0!==WPGlobusAdmin.data.has_items&&WPGlobusAdmin.data.has_items&&(n="",i=0,r(document).ajaxComplete(function(t,a,e){void 0!==e.data&&""!=n&&0<=e.data.indexOf("action=inline-save-tax&")&&(r("#"+n+" a.row-title").text(WPGlobusAdmin.qedit_titles[i][WPGlobusAdmin.data.language].name),r("#"+n+" .description").text(WPGlobusAdmin.qedit_titles[i][WPGlobusAdmin.data.language].description))}),l={},r("#the-list tr").each(function(t,a){var e=r(a),a="post"===o?"post-":"tag-";i=e.attr("id").replace(a,""),l[i]={},"post"===o?l[i].source=e.find(".post_title").text():"taxonomy"===o&&(l[i].source=r("#inline_"+i+" .name").text())}),(t={action:"get_titles"}).type=o,t.taxonomy=void 0!==WPGlobusAdmin.data.taxonomy&&WPGlobusAdmin.data.taxonomy,t.title=l,r.ajax({type:"POST",url:WPGlobusAdmin.ajaxurl,data:{action:WPGlobusAdmin.process_ajax,order:t},dataType:"json"}).done(function(t){WPGlobusAdmin.qedit_titles=t.qedit_titles,r.each(t.bulkedit_post_titles,function(t,a){r("#inline_"+t+" .post_title").text(a[WPGlobusAdmin.data.language].name)})}).fail(function(t){}).always(function(t,a){}),r("body").on("change",".wpglobus-quick-edit-title",function(){var o="",n=[];r(".wpglobus-quick-edit-title").each(function(t,a){var e=r(a),a=e.data("language");""!==e.val()&&(o=WPGlobusCore.getString(o,e.val(),a)),WPGlobusAdmin.qedit_titles[i][a].name=e.val(),n[t]=a});var t=r(document).triggerHandler("wpglobus_get_translations",{string:o,lang:n,id:i});void 0!==t&&(o=t),r("input.ptitle").eq(0).val(o),WPGlobusAdmin.qedit_titles[i].source=o}),void 0!==WPGlobusAdmin.data.tags&&r.each(WPGlobusAdmin.data.tags,function(t,a){WPGlobusAdmin.data.value[a].post_id={}}),r("button.save, input#bulk_edit").on("mouseenter",function(t){void 0!==WPGlobusAdmin.data.tags&&(("bulk_edit"==t.currentTarget.id?r("input#bulk_edit"):r("button.save")).unbind("click"),r("button.save, input#bulk_edit").on("click",function(a){var t=r.when(),e=(r(this),r.Deferred());e.resolve(function(t){t.next(".spinner").css({visibility:"visible"}),"bulk_edit"!=a.currentTarget.id&&r.ajaxSetup({async:!1});var o,n,i,l=t.parents("tr"),s=l.attr("id").replace("edit-","");r.each(WPGlobusAdmin.data.tags,function(t,a){if(0==(o=l.find("textarea[name='"+WPGlobusAdmin.data.names[a]+"']")).length)return!0;WPGlobusAdmin.data.value[a].post_id[s]=o.val(),n=WPGlobusAdmin.data.value[a].post_id[s].split(","),i=[];for(var e=0;e<n.length;e++)n[e]=n[e].trim(" "),""!=n[e]&&(void 0===WPGlobusAdmin.data.tag[a][n[e]]?i[e]=n[e]:i[e]=WPGlobusAdmin.data.tag[a][n[e]]);o.val(i.join(", "))})}(r(this))),t=t.then(function(){return r.when(e.done())}).then(function(){"bulk_edit"!=a.currentTarget.id&&setTimeout(function(){inlineEditPost.save(i),r.ajaxSetup({async:!0})},50)})}))}),r("#the-list").on("click",".editinline",function(){var t=r(this);if(n=t.parents("tr").attr("id"),"post"===o)i=n.replace("post-","");else{if("taxonomy"!==o)return;i=n.replace("tag-","")}"post"===o&&void 0!==WPGlobusAdmin.data.tags&&r.each(WPGlobusAdmin.data.tags,function(t,a){var e,o;""==WPGlobusAdmin.data.value[a]||void 0!==(e=r("#edit-"+i+' textarea[name="'+WPGlobusAdmin.data.names[a]+'"]').val())&&(o=e.split(","),r.each(o,function(t,a){e=e.replace(a,WPGlobusCore.TextFilter(a,WPGlobusCoreData.language))}),r("#edit-"+i+' textarea[name="'+WPGlobusAdmin.data.names[a]+'"]').val(e))});var a=r("#edit-"+i+" input.ptitle").eq(0),t=a.parents("label");void 0!==WPGlobusAdmin.qedit_titles&&(a.val(WPGlobusAdmin.qedit_titles[i].source),a.addClass("hidden"),r(WPGlobusAdmin.data.template).insertAfter(t),void 0===WPGlobusAdmin.qedit_titles[i]&&(WPGlobusAdmin.qedit_titles[i]={},WPGlobusAdmin.qedit_titles[i].source=r("#"+n+" .name a.row-title").text(),r(WPGlobusAdmin.data.enabled_languages).each(function(t,a){WPGlobusAdmin.qedit_titles[i][a]={},a==WPGlobusAdmin.data.default_language?WPGlobusAdmin.qedit_titles[i][a].name=WPGlobusAdmin.qedit_titles[i].source:WPGlobusAdmin.qedit_titles[i][a].name="",WPGlobusAdmin.qedit_titles[i][a].description=""})),r(".wpglobus-quick-edit-title").each(function(t,a){var e=r(a),a=e.data("language");e.attr("id",a+i),void 0!==WPGlobusAdmin.qedit_titles[i][a]&&(WPGlobusAdmin.qedit_titles[i][a].name=WPGlobusAdmin.qedit_titles[i][a].name.replace(/\\\'/g,"'"),WPGlobusAdmin.qedit_titles[i][a].name=WPGlobusAdmin.qedit_titles[i][a].name.replace(/\\\"/g,'"'),e.val(WPGlobusAdmin.qedit_titles[i][a].name),WPGlobusAdmin.qedit_titles[i].source=WPGlobusCore.getString(WPGlobusAdmin.qedit_titles[i].source,WPGlobusAdmin.qedit_titles[i][a].name,a))}),r("input.ptitle").eq(0).val(WPGlobusAdmin.qedit_titles[i].source))}))},taxonomyEdit:function(){var a=[];a[0]="name",a[1]="description";r.each(WPGlobusCoreData.enabled_languages,function(t,e){r.each(a,function(t,a){!function(t,a){var e=r("#"+t);if(1!=e.length)return;var o=e.clone(),n=e.attr("name"),i="wpglobus-element wpglobus-element_"+t+" wpglobus-element_"+a+" wpglobus-translatable",l=document.getElementById(t);l=l.nodeName,r(o).attr("id",t+"_"+a),r(o).attr("name",n+"_"+a),a!==WPGlobusCoreData.default_language&&(i+=" hidden"),r(o).attr("class",i),r(o).attr("data-save-to",t),r(o).attr("data-language",a),"INPUT"==l?r(o).attr("value",r("#wpglobus-link-tab-"+a).data(t)):"TEXTAREA"==l&&r(o).text(r("#wpglobus-link-tab-"+a).data(t)),e.addClass("hidden"),0==r(".wpglobus-element_"+t).length?r(o).insertAfter(e):r(o).insertAfter(r(".wpglobus-element_"+t).last())}(a,e)})}),r(".wpglobus-taxonomy-tabs").insertAfter("#ajax-response"),r(".wrap").tabs(),r("body").on("click",".wpglobus-taxonomy-tabs li",function(t){var a=r(this).data("language");r(".wpglobus-element").addClass("hidden"),r(".wpglobus-element_"+a).removeClass("hidden"),r(".wpglobus-tax-edit-tab a").removeClass("wpglobus-tab-link-active"),r("#wpglobus-link-tab-"+a+" a").addClass("wpglobus-tab-link-active")}),r(".wpglobus-element").on("change",function(){var o=r(this).data("save-to"),n="";r(".wpglobus-element").each(function(t,a){var e=r(a),a=e.val();e.data("save-to")==o&&""!==a&&(n+=WPGlobusCore.addLocaleMarks(a,e.data("language")))}),r("#"+o).val(n)}),r(WPGlobusAdmin.data.multilingualSlug.title).insertAfter(".term-slug-wrap th label")},navMenus:function(){function e(){n!==r(i).length&&(clearInterval(o),r(i).each(function(t,a){var o,e=r(a);e.hasClass("wpglobus-menu-item")||(o=r(a).attr("id"),r.each(["input.edit-menu-item-title","input.edit-menu-item-attr-title"],function(t,a){var e=r("#"+o+" "+a),a=r(e);a.hasClass("wpglobus-hidden")||(a.addClass("wpglobus-hidden"),a.css("display","none"),e=a.parent("label"),a=a.parents("p"),r(a).css("height","80px"),r(e).append('<div style="color:#f00;">'+WPGlobusAdmin.i18n.save_nav_menu+"</div>"))}),e.addClass("wpglobus-menu-item"))}))}var o,n,i="#menu-to-edit .menu-item";r.ajaxSetup({beforeSend:function(t,a){void 0!==a.data&&0<=a.data.indexOf("action=add-menu-item")&&(n=r(i).length,o=setInterval(e,500))}}),r(i).each(function(t,a){var e=r(a).attr("id"),u=e.replace("menu-item-","");r.each(["input.edit-menu-item-title","input.edit-menu-item-attr-title"],function(n,i){var l=r("#"+e+" "+i);l.val()!=WPGlobusAdmin.data.items[u][i].source&&l.val(WPGlobusAdmin.data.items[u][i].source);var s=r("#"+e+" "+i).parents("p"),d=0;r.each(WPGlobusAdmin.data.open_languages,function(t,a){var e=l.clone();e.attr("id",l.attr("id")+"-"+a),e.attr("name",l.attr("id")+"-"+a),e.attr("data-language",a),e.attr("data-item-id",u),e.attr("placeholder",WPGlobusAdmin.data.en_language_name[a]);var o=WPGlobusAdmin.data.items[u][a][i].class;0===n&&a===WPGlobusAdmin.data.default_language?e.attr("class",o+" edit-menu-item-title"):e.attr("class",o),""!=WPGlobusAdmin.data.items[u][a][i].caption?e.attr("value",WPGlobusAdmin.data.items[u][a][i].caption):e.attr("value",""),e.css("margin-bottom","0.6em"),r(s).append(e),d=t}),d=40*(d+1),l.css("display","none").attr("class","").addClass("widefat wpglobus-hidden"),r(s).css("height",d+"px").addClass("wpglobus-menu-item-box")}),r(a).addClass("wpglobus-menu-item")}),r(".menus-move-left, .menus-move-right").each(function(t,a){var e,o=r(a),n=(o.parents("li").attr("id").replace("menu-item-",""),o.attr("title"));void 0!==n&&r.each(WPGlobusAdmin.data.post_titles,function(t,a){0<=n.indexOf(t)&&(e=n.replace(t,a),o.attr("title",e),o.text(e))})}),r(".edit-menu-item-title").trigger("change"),wpNavMenu.refreshAdvancedAccessibility(),wpNavMenu.menusChanged=!1,r(".wpglobus-menu-item").on("change",function(){var t,a,e=r(this),o=e.data("item-id");e.hasClass("wpglobus-item-title")&&(t=WPGlobusCore.getString(r("input#edit-menu-item-title-"+o).val(),e.val(),e.data("language")),void 0!==(a=r(document).triggerHandler("wpglobus_get_menu_translations",{string:t,lang:WPGlobusCoreData.open_languages,id:o,type:"input.edit-menu-item-title"}))&&(t=a),r("input#edit-menu-item-title-"+o).val(t)),e.hasClass("wpglobus-item-attr")&&(t=WPGlobusCore.getString(r("input#edit-menu-item-attr-title-"+o).val(),e.val(),e.data("language")),void 0!==(a=r(document).triggerHandler("wpglobus_get_menu_translations",{string:t,lang:WPGlobusCoreData.open_languages,id:o,type:"input.edit-menu-item-attr-title"}))&&(t=a),r("input#edit-menu-item-attr-title-"+o).val(t))});var a=[];setTimeout(function(){r(".edit-menu-item-description").each(function(){var t=r(this).attr("id");a.push(t),WPGlobusDialogApp.addElement(t)}),r(".wpglobus_dialog_start").each(function(){r(this).css({"font-style":"normal"}),r(this).after("<br />")});var t={action:"getNavMenuItemsDescription"};t.menuItems=a,r.ajax({type:"POST",url:WPGlobusAdmin.ajaxurl,data:{action:WPGlobusAdmin.process_ajax,order:t},dataType:"json"}).done(function(t){"object"==typeof t&&r.each(t,function(t,a){""!=a&&(r("#"+t).val(a),r("#wpglobus-"+t).val(WPGlobusCore.TextFilter(a,WPGlobus.language,"RETURN_EMPTY")))})}).fail(function(t){}).always(function(t,a){})},1e3)},postEdit:function(){r(document).on("heartbeat-send",function(t,o){void 0!==o.wp_autosave&&(o.wpglobus_heartbeat="wpglobus",r.each(WPGlobusAdmin.data.open_languages,function(t,a){var e=r("#title_"+a).val()||"";""!=(e=e.trim())&&(o.wp_autosave["post_title_"+a]=e),""!=(e=(e=r("#content_"+a).val()||"").trim())&&(o.wp_autosave["content_"+a]=e)}))});var a,i,l,e="#postdivrich",o=!0,s="#post-body-content";!1===WPGlobusAdmin.data.support.editor&&(o=!(e="#titlediv")),!1===WPGlobusAdmin.data.support.title&&(o=!1),r(s).prepend(r(".wpglobus-post-body-tabs-list")),r.each(WPGlobusAdmin.tabs,function(t,a){"default"===a?(r(e).wrap('<div id="tab-default"></div>'),o&&r(r("#titlediv")).insertBefore(e)):(r(e+"-"+a).wrap('<div id="tab-'+a+'"></div>'),o&&r(r("#titlediv-"+a)).insertBefore(e+"-"+a))}),setTimeout(function(){var n=!1;r(s).addClass("wpglobus-post-body-tabs").tabs({beforeActivate:function(t,a){var e,i,l;n||(o=(e=r("#wp-content-editor-container .mce-btn-group").eq(0)).children("div"),0!=e.length&&0!=o.length&&(i=e.attr("style"),l=o.attr("style"),r.each(WPGlobusCoreData.enabled_languages,function(t,a){if(a!=WPGlobusCoreData.default_language){var e=r("#wp-content_"+a+"-editor-container .mce-btn-group").eq(0),o=e.children("div");if(0==e.length||0==o.length)return!0;var n=e.attr("style"),a=o.attr("style");i!=n&&e.attr("style",i),l!=a&&o.attr("style",l)}}),n=!0));var o=a.oldTab[0].id.replace("link-tab-",""),a=a.newTab[0].id.replace("link-tab-","");r(".wpglobus-tab-link").removeClass("wpglobus-tab-link-active"),r("#link-tab-"+a+" .wpglobus-tab-link").addClass("wpglobus-tab-link-active"),"default"==o&&(o=WPGlobusCoreData.default_language),"default"==a&&(a=WPGlobusCoreData.default_language);a=r(document).triggerHandler("wpglobus_post_body_tabs",[o,a]);return!(!a&&void 0!==a)}})},500),r("#title").val(WPGlobusAdmin.title),r("#content").text(WPGlobusAdmin.content),"undefined"!=typeof WPGlobusVendor&&WPGlobusVendor.vendor.WPSEO&&("undefined"!=typeof wpglobus_wpseo?wpglobus_wpseo():"undefined"!=typeof WPGlobusYoastSeo&&("undefined"!=typeof WPGlobusYoastSeoPremium&&WPGlobusYoastSeoPremium&&"function"==typeof WPGlobusYoastSeoPremium.init&&WPGlobusYoastSeoPremium.init(),"function"==typeof WPGlobusYoastSeo.init&&WPGlobusYoastSeo.init())),WPGlobusAdmin.data.modify_excerpt&&((a=r("#excerpt")).addClass("hidden").css({display:"none"}),r(WPGlobusAdmin.data.template).insertAfter(a),r("body").on("change",".wpglobus-excerpt",function(){var t=r(this);a.val(WPGlobusCore.getString(a.val(),t.val(),t.data("language")))})),void 0!==wp.utils&&void 0!==wp.utils.WordCounter&&(WPGlobusCoreData.wordCounter={},i=this,l={},r.each(WPGlobusCoreData.enabled_languages,function(t,a){return a==WPGlobusCoreData.default_language||(l[t]="content_"+a,n=jQuery,t=new wp.utils.WordCounter,e=a,WPGlobusCoreData.wordCounter[e]={},WPGlobusCoreData.wordCounter[e].counter=t,void n(function(){function o(t){var a;"object"==typeof t&&(t="tinymce"==t?i.getCurrentTab():t.target.id.replace("content_","")),void 0!==WPGlobusCoreData.wordCounter[t]&&(a=!WPGlobusCoreData.wordCounter[t].contentEditor||WPGlobusCoreData.wordCounter[t].contentEditor.isHidden()?WPGlobusCoreData.wordCounter[t].content.val():WPGlobusCoreData.wordCounter[t].contentEditor.getContent({format:"raw"}),(a=WPGlobusCoreData.wordCounter[t].counter.count(a))!==WPGlobusCoreData.wordCounter[t].prevCount&&WPGlobusCoreData.wordCounter[t].count.text(a),WPGlobusCoreData.wordCounter[t].prevCount=a)}WPGlobusCoreData.wordCounter[e].content=n("#content_"+e),WPGlobusCoreData.wordCounter[e].count=n("#wp-word-count-"+e).find(".word-count-"+e),WPGlobusCoreData.wordCounter[e].prevCount=0,n(document).on("tinymce-editor-init",function(t,a){var e;-1!=n.inArray(a.id,l)&&(e=a.id.replace("content_",""),(WPGlobusCoreData.wordCounter[e].contentEditor=a).on("nodechange keyup",_.debounce(o,1e3)))}),WPGlobusCoreData.wordCounter[e].content.on("input keyup",_.debounce(o,1e3)),o(e)}));var n,e})),r(document).on("click","#publish, #save-post",function(){var e,t,o,n;1<WPGlobusAdmin.data.open_languages.length&&(r(document).triggerHandler("wpglobus_before_save_post",{content_tabs_id:s}),e=r("#title").val(),n=o="",0==e.length&&(t=WPGlobusAdmin.data.open_languages.indexOf(WPGlobusAdmin.data.default_language),WPGlobusAdmin.data.open_languages.splice(t,1),r(WPGlobusAdmin.data.open_languages).each(function(t,a){n=0==t?"":"-",0<(e=r("#title_"+a).val()).length&&(0==o.length&&(n=""),o=o+n+e)})),0<o.length&&r("#title").val(o)),void 0===WPGlobusAdmin.data.tagsdiv||WPGlobusAdmin.data.tagsdiv.length<1||r(WPGlobusAdmin.data.tagsdiv).each(function(t,a){if(0==r("#"+a).length)return!0;var e=a.replace("tagsdiv-","");if("undefined"===e)return!0;if(0==r("#tax-input-"+e).length)return!0;var o,n=[];r("#tagsdiv-"+e+" .tagchecklist li").each(function(t,a){o=(o=r(a).html()).replace(/<button.*<\/button> /,""),void 0===WPGlobusAdmin.data.tag[e][o]?n[t]=o:n[t]=WPGlobusAdmin.data.tag[e][o]}),r("#tax-input-"+e).val(n.join(", "))})}),r(".ui-state-default").on("click",function(){"link-tab-default"===r(this).attr("id")&&(r(window).scrollTop(r(window).scrollTop()+1),r(window).scrollTop(r(window).scrollTop()-1))}),r(document).on("tabsactivate",s,function(t,a){WPGlobusAdmin.currentTab=a.newTab[0].dataset.language}),r("#titlewrap input").addClass("wpglobus-translatable"),r(".title_wpglobus").addClass("wpglobus-translatable"),r(document).triggerHandler("wpglobus_after_post_edit")},adminCentral:function(){r(".wpglobus-admin-central-tab").css({display:"none"}),1<r(".nav-tab-active").length&&r(".wpglobus-about-wrap .nav-tab-wrapper a").removeClass("nav-tab-active");var e=!0;0==location.hash.indexOf("#")&&r(".wpglobus-about-wrap .nav-tab-wrapper a").each(function(t,a){r(a).attr("href")==location.hash&&(e=!1,r(a).addClass("nav-tab-active"))}),e&&r(".wpglobus-about-wrap .nav-tab-wrapper a").eq(0).addClass("nav-tab-active");var t=r(".wpglobus-about-wrap .nav-tab-active").data("tab-id");""!=t&&r("#"+t).css({display:"block"}),r(document).on("click",".wpglobus-about-wrap .nav-tab",function(t){var a=r(this);a.hasClass("nav-tab-active")||(r(".wpglobus-admin-central-tab").css({display:"none"}),r(".wpglobus-about-wrap .nav-tab").removeClass("nav-tab-active"),a.addClass("nav-tab-active"),""!=a.data("tab-id")&&r("#"+a.data("tab-id")).css({display:"block"}))})},start:function(){var a=this;r("#wpglobus_flags").select2({formatResult:this.format,formatSelection:this.format,minimumResultsForSearch:-1,escapeMarkup:function(t){return t}}),r("body").on("click","#enabled_languages-list li:first input",function(t){return t.preventDefault(),r(".redux-save-warn").css({display:"none"}),r("#enabled_languages-list").find("li:first > input").val("1"),0===r("#disable_first_language").length&&r(a.config.disable_first_language).insertAfter("#info_bar"),!1})},format:function(t){return'<img class="wpglobus_flag" src="'+WPGlobusAdmin.flag_url+t.text+'"/> '+t.text},set_dialog:function(){var o,a,n;void 0!==WPGlobusAdmin.data.customFieldsEnabled&&(WPGlobusAdmin.data.customFieldsEnabled=this.parseBool(WPGlobusAdmin.data.customFieldsEnabled),!WPGlobusAdmin.data.customFieldsEnabled)||(void 0===WPGlobusAdmin.data.excludeCustomFields&&(WPGlobusAdmin.data.excludeCustomFields=!1),a=!1,(n=function(t){var l,s,d="wpglobus_dialog_start wpglobus_dialog_icon",u=['<div class="wpglobus_dialog_options_wrapper hidden">','<input style="width:initial;" id="wpglobus-cb-{{id}}" data-object="#wpglobus-dialog-start-{{id}}" data-meta-key="{{meta-key}}" class="wpglobus_dialog_option wpglobus_dialog_cb" type="checkbox" {{checked}} />',"</div>"].join(""),t=void 0===t?"#the-list tr":"#the-list tr#"+t;r(t).each(function(){var t,a,e=r(this),o=e.attr("id"),n=e.find("textarea"),i=d;return void 0===(l=n.attr("id"))||(a=r("#"+o+"-key").val(),!(!WPGlobusAdmin.data.excludeCustomFields||-1==r.inArray(a,WPGlobusAdmin.data.excludeCustomFields))||(t=r("#"+l).clone(),r(n).addClass("wpglobus-dialog-field-source hidden"),o=n.attr("name"),r(t).attr("id","wpglobus-"+l),r(t).attr("name","wpglobus-"+o),r(t).attr("data-source-id",l),r(t).attr("class","wpglobus-dialog-field"),r(t).val(WPGlobusCore.TextFilter(r(n).val(),WPGlobusCoreData.language)),r(t).insertAfter(n),s=(s=u.replace(/{{id}}/g,l)).replace(/{{meta-key}}/g,a),void 0===WPGlobusAdmin.data.post_meta_settings[WPGlobusAdmin.data.post_type]?s=s.replace(/{{checked}}/,"checked"):i=void 0!==WPGlobusAdmin.data.post_meta_settings[WPGlobusAdmin.data.post_type][a]&&"false"==WPGlobusAdmin.data.post_meta_settings[WPGlobusAdmin.data.post_type][a]?(s=s.replace(/{{checked}}/,""),d+" wpglobus_dialog_start_hidden"):(s=s.replace(/{{checked}}/,"checked"),d),void e.append('<td style="width:20px;"><div id="wpglobus-dialog-start-'+l+'" data-type="control" data-source-type="textarea" data-source-id="'+l+'" class="'+i+'"></div>'+s+"</td>")))}),!a&&0<r("#list-table .wpglobus_dialog_start").length&&(r("#list-table thead tr").append('<th class="wpglobus-control-head"><div class="wpglobus_dialog_settings wpglobus_dialog_icon"></div></th>'),a=!0)})(),r("body").on("change",".wpglobus-dialog-field",function(){var e,o,n=r(this),t="#"+n.data("source-id"),i="";e=r(t).val(),/(\{:|\[:|<!--:)[a-z]{2}/.test(e)?(r.each(WPGlobusCoreData.enabled_languages,function(t,a){""!=(o=a==WPGlobusCoreData.language?n.val():WPGlobusCore.TextFilter(e,a,"RETURN_EMPTY"))&&(i+=WPGlobusCore.addLocaleMarks(o,a))}),r(t).val(i)):r(t).val(n.val())}),r(document).ajaxSend(function(t,a,e){"add-meta"==e.action&&(o=e.element)}),r(document).ajaxComplete(function(t,a,e){"add-meta"==e.action&&void 0!==a.responseXML&&n("newmeta"==o?"meta-"+r(a.responseXML.documentElement.outerHTML).find("meta").attr("id"):o)}),WPGlobusDialogApp.init({dialogTitle:"Edit meta"}))}},new t.App,t)});
|
1 |
+
var WPGlobusCore,WPGlobusDialogApp;!function(i){var d=WPGlobusCore={strpos:function(t,a,e){e=(t=""+t).indexOf(a,e);return 0<=e&&e},TextFilter:function(t,a,e){if(void 0===t||""===t)return t;var o,n,i=[],l=!1;a=""==a?"en":a,e=void 0===e||""==e?"RETURN_IN_DEFAULT_LANGUAGE":e,i[0]=[],i[0].start=WPGlobusCoreData.locale_tag_start.replace("%s",a),i[0].end=WPGlobusCoreData.locale_tag_end,i[1]=[],i[1].start="\x3c!--:"+a+"--\x3e",i[1].end="\x3c!--:--\x3e",i[2]=[],i[2].start="[:"+a+"]",i[2].end="[:";for(var s=0;s<3;s++)if(!1!==(o=d.strpos(t,i[s].start))){o+=i[s].start.length,t=!1===(n=d.strpos(t,i[s].end,o))?t.substr(o):t.substr(o,n-o),l=!0;break}return l||("RETURN_EMPTY"==e?a==WPGlobusCoreData.default_language&&!/(\{:|\[:|<!--:)[a-z]{2}/.test(t)||(t=""):a==WPGlobusCoreData.default_language?/(\{:|\[:|<!--:)[a-z]{2}/.test(t)&&(t=""):t=d.TextFilter(t,WPGlobusCoreData.default_language)),t},addLocaleMarks:function(t,a){return WPGlobusCoreData.locale_tag_start.replace("%s",a)+t+WPGlobusCoreData.locale_tag_end},getTranslations:function(e){var o,n={};return i.each(WPGlobusCoreData.enabled_languages,function(t,a){o=a==WPGlobusCoreData.default_language?"RETURN_IN_DEFAULT_LANGUAGE":"RETURN_EMPTY",n[a]=d.TextFilter(e,a,o)}),n},getString:function(t,a,e){if(void 0===t)return t;void 0===a&&(a=""),void 0===e&&(e=WPGlobusCoreData.language),(t=d.getTranslations(t))[e]=a;var o="";return i.each(t,function(t,a){""!=a&&t!=WPGlobusCoreData.default_language&&(o+=d.addLocaleMarks(a,t))}),o=""!=t[WPGlobusCoreData.default_language]?""==o?t[WPGlobusCoreData.default_language]:d.addLocaleMarks(t[WPGlobusCoreData.default_language],WPGlobusCoreData.default_language)+o:o}}}(jQuery),function(c){var g=WPGlobusDialogApp={inited:!1,option:{listenClass:".wpglobus_dialog_start",settingsClass:".wpglobus_dialog_settings",dialogTabs:"#wpglobus-dialog-tabs",dialogTitle:"",customData:null,callback:function(){},dialogOptions:{title:"",placeholder:"",formFooter:"",beforeOpen:function(){},afterOpen:function(){},afterSave:function(){},close:function(){}},dialog:{}},form:void 0,element:void 0,element_by:"id",id:"",clone_id:"",wpglobus_id:"",type:"textarea",source:"",order:{},value:{},request:"core",attrs:{},dialogTitle:"",trClass:"wpglobus-translatable",startButton:['<span id="wpglobus-dialog-start-{{clone_id}}" ','style="{{style}}" ','data-type="control" data-dialog-title="{{title}}" ','data-source-type="" data-source-id="{{id}}" data-source-name="{{name}}" ','data-nodename="{{nodename}}"',"{{sbTitle}} ",'class="{{classes}}"></span>'].join(""),startButtonClass:"wpglobus_dialog_start wpglobus_dialog_icon",clicks:0,init:function(t){g.inited||(g.option.dialog=g.option.dialogOptions,g.option=c.extend(g.option,t),c(g.option.dialogTabs).tabs(),g.dialogTitle=g.option.dialogTitle,this.attachListener(),null!=g.option.customData&&void 0!==g.option.customData.addElements&&c.each(g.option.customData.addElements,function(t,a){g.addElement(a)}),g.inited=!0)},convertToId:function(t){return t=(t=t.replace(/\]/g,"")).replace(/\[/g,"-")},addElement:function(t){g.init();var a={id:null,style:"",styleTextareaWrapper:"",sbTitle:"",onChangeClass:"",dialogTitle:"",dialog:g.option.dialogOptions};if("string"==typeof t)a.id=t;else{if("object"!=typeof t)return;a=c.extend(a,t)}var e,o=null,n=null,i=null,l=null,s=g.startButton,d="";if(g.element_by="name",0==(l=document.getElementsByName(a.id)).length&&(g.element_by="id",l=document.getElementById(a.id)),null!==l){if(n=a.id,i=void 0===(o="id"==g.element_by?c("#"+n):(d=(d=l[0].nodeName).toLowerCase(),c(d+'[name="'+n+'"]'))).attr("name")||""==o.attr("name")?n:o.attr("name"),g.clone_id=g.convertToId(n),-1!=i.indexOf("wpglobus")||-1!=g.clone_id.indexOf("wpglobus"))return!1;if(0<c("#wpglobus-"+g.clone_id).length)return!1;t=c(o.clone()),l=o.attr("style")||"",o.attr("style","display:none;"),t.attr("id","wpglobus-"+g.clone_id).attr("name","wpglobus-"+i),t.addClass(g.trClass),""!=a.onChangeClass&&t.addClass(a.onChangeClass),("id"==g.element_by?t.attr("data-source-id",n).attr("data-source-name",""):t.attr("data-source-id","").attr("data-source-name",i)).attr("data-source-get-by",g.element_by),"textarea"==d?(e=WPGlobusCore.getTranslations(o.val())[WPGlobusCoreData.language],t.val(e),t.attr("data-nodename","textarea"),""==a.style?t.attr("style",l+";width:95%;float:left;"):t.attr("style",l+";"+a.style)):(e=WPGlobusCore.getTranslations(o.val())[WPGlobusCoreData.language],t.val(e),t.attr("data-nodename","input"),""!=a.style&&t.attr("style",l+";"+a.style)),""!=a.dialog&&t.attr("data-dialog",JSON.stringify(a.dialog)),s=s.replace(/{{clone_id}}/g,g.clone_id),s="id"==g.element_by?(s=(s=s.replace(/{{id}}/g,g.clone_id)).replace(/{{name}}/g,"")).replace(/{{nodename}}/g,""):(s=(s=s.replace(/{{id}}/g,"")).replace(/{{name}}/g,i)).replace(/{{nodename}}/g,d);s="textarea"==d?s.replace("{{style}}","float:left;margin-top:0;"):s.replace("{{style}}",""),i="textarea"==d?g.startButtonClass+" wpglobus-textarea wpglobus-textarea-"+g.clone_id:g.startButtonClass;s=s.replace("{{classes}}",i),s=""==a.dialogTitle?s.replace("{{title}}",g.dialogTitle):s.replace("{{title}}",a.dialogTitle),s=""==a.sbTitle?s.replace("{{sbTitle}}",a.sbTitle):s.replace("{{sbTitle}}",'title="'+a.sbTitle+'"'),c(s).insertAfter(o),c(t).insertAfter(o),"textarea"==d&&(c("#wpglobus-"+g.clone_id).addClass("wpglobus-textarea-"+g.clone_id),c(".wpglobus-textarea-"+g.clone_id).wrapAll('<div class="wpglobus-textarea-wrapper" style="'+a.styleTextareaWrapper+'"></div>'));var u,r=!1;return(""==a.onChangeClass?u="#wpglobus-"+g.clone_id:(u="."+a.onChangeClass,void 0===(a=c._data(c(document)[0],"events"))?r=!0:void 0!==a.change&&c.each(a.change,function(t,a){if(a.selector==u)return!(r=!0)})),r)?!0:(c(document).on("change",u,function(){var t=c(this),a=""==(a=t.data("source-id"))?t.data("nodename")+'[name="'+t.data("source-name")+'"]':"#"+a;c(a).val(WPGlobusCore.getString(c(a).val(),t.val()))}),!0)}},saveDialog:function(){var e,o,n="",i="",l="";c(".wpglobus_dialog_textarea").each(function(t,a){o=c(a),e=o.val(),(o=o.data("language"))==WPGlobusAdmin.data.language&&(l=e),""!=e&&(n+=WPGlobusCore.addLocaleMarks(e,o),o==WPGlobusCoreData.default_language&&(i=e))}),n=n.length==i.length+8?i:n,c(g.id).val(n),n=""==l?i:l,c(g.wpglobus_id).val(n),g.runCallback(g.option.dialog.afterSave)},dialog:c("#wpglobus-dialog-wrapper").dialog({autoOpen:!1,width:650,modal:!0,dialogClass:"wpglobus-dialog",buttons:[{text:"Save",class:"wpglobus-button-save",click:function(){g.saveDialog(),g.dialog.dialog("close")}},{text:"Cancel",class:"wpglobus-button-cancel",click:function(){g.dialog.dialog("close")}}],open:function(t,a){var e=g.dialogTitle;void 0!==g.attrs.maxlength&&(c(".wpglobus_dialog_textarea").attr("maxlength",g.attrs.maxlength),e+=" | maxlength="+g.attrs.maxlength),c(".wpglobus-dialog .ui-dialog-title").text(e),c(this).removeClass("hidden")},close:function(){c(this).addClass("hidden"),g.runCallback(g.option.dialog.close),g.form[0].reset()}}),attachListener:function(){c(document).on("click",g.option.settingsClass,function(){c(".wpglobus_dialog_options_wrapper").hasClass("hidden")?c(".wpglobus_dialog_options_wrapper").removeClass("hidden"):c(".wpglobus_dialog_options_wrapper").addClass("hidden")}),c(document).on("click",".wpglobus_dialog_option",function(t){var a=c(this),e=a.data("object");g.order.action="save_post_meta_settings",g.order.post_type=WPGlobusAdmin.data.post_type,g.order.checked=a.prop("checked"),g.order.id=a.attr("id"),g.order.meta_key=a.data("meta-key"),g.ajax(g.order).done(function(t){"ok"==t.result&&("true"==t.checked?c(e).removeClass("wpglobus_dialog_start_hidden"):c(e).addClass("wpglobus_dialog_start_hidden"))}).fail(function(t){}).always(function(t,a){})}),c(document).on("click",g.option.listenClass,function(a){g.element=c(this),g.id=g.element.data("source-id"),""==g.id?(g.id=g.element.data("nodename")+'[name="'+g.element.data("source-name")+'"]',g.wpglobus_id="#wpglobus-"+g.convertToId(g.element.data("source-name"))):(g.wpglobus_id="#wpglobus-"+g.id,g.id="#"+g.id),g.clicks++,1==g.clicks&&setTimeout(function(){var t;1==g.clicks?g.onClick(a):(t=c(g.id)).hasClass("hidden")?t.removeClass("hidden").attr("style","display:block;"):t.addClass("hidden").attr("style","display:none;"),g.clicks=0},200)}),g.form=g.dialog.find("form#wpglobus-dialog-form").on("submit",function(t){t.preventDefault(),g.saveDialog()})},ajax:function(t){return c.ajax({type:"POST",url:WPGlobusAdmin.ajaxurl,data:{action:WPGlobusAdmin.process_ajax,order:t},dataType:"json",async:!1})},onClick:function(t){void 0===g.element.data("dialog-title")||""==g.element.data("dialog-title")?g.dialogTitle=g.option.dialogTitle:g.dialogTitle=g.element.data("dialog-title"),void 0!==g.id&&(g.attrs.maxlength=c(g.id).attr("maxlength")),g.source=g.element.data("source-value"),void 0===g.source&&(g.source=c(g.id).val(),"ajax"==g.request||(g.value=WPGlobusCore.getTranslations(g.source))),g.option.dialog=c.extend({},g.option.dialogOptions,c(g.wpglobus_id).data("dialog")),""!=g.option.dialog.title&&(g.dialogTitle=g.option.dialog.title),c.each(g.value,function(t,a){var e=c("#wpglobus-dialog-"+t);e.val(a),e.attr("placeholder",WPGlobusCore.TextFilter(g.option.dialog.placeholder,t,"RETURN_IN_DEFAULT_LANGUAGE"))}),c("#wpglobus-dialog-form-footer").html(g.option.dialog.formFooter),g.runCallback(g.option.dialog.beforeOpen),g.dialog.dialog("open"),g.runCallback(g.option.dialog.afterOpen)},runCallback:function(t){var a,e;"object"==typeof t?(a=Object.keys(t)[0],e=t[Object.keys(t)[0]],"window"===a?"function"==typeof window[e]&&window[e](t[Object.keys(t)[1]]):"function"==typeof window[a][e]&&window[a][e](t[Object.keys(t)[1]])):"string"==typeof t?"function"==typeof window[t]&&window[t]():"function"==typeof t&&t()}}}(jQuery),jQuery(document).ready(function(){"use strict";var t,r;window.WPGlobusAdminApp=(t=window.WPGlobusAdminApp||{},r=jQuery,t.App=function(t){void 0===window.WPGlobusAdminApp&&(this.config={debug:!1,version:WPGlobusAdmin.version},this.status="ok","undefined"==typeof WPGlobusAdmin?(this.status="error",this.config.debug&&console.log("WPGlobus: error options loading")):this.config.debug&&console.dir(WPGlobusAdmin),this.config.disable_first_language=['<div id="disable_first_language" style="display:block;" class="redux-field-errors notice-red">',"<strong>","<span> </span>",WPGlobusAdmin.i18n.cannot_disable_language,"</strong>","</div>"].join(""),r.extend(this.config,t),"ok"===this.status&&this.init())},t.App.prototype={$document:r(document),init:function(){WPGlobusCoreData.multisite=this.parseBool(WPGlobusCoreData.multisite),this.adminInit(),r("#content").addClass("wpglobus-editor").attr("data-language",WPGlobusAdmin.data.default_language),r("textarea[id^=content_]").each(function(t,a){var e=r(a).attr("id").replace("content_","");r(a).attr("data-language",e)}),"post.php"===WPGlobusAdmin.page?(this.postEdit(),this.set_dialog(),"undefined"!=typeof WPGlobusAioseop&&WPGlobusAioseop.init()):"menu-edit"===WPGlobusAdmin.page?(WPGlobusDialogApp.init({dialogTitle:"Edit description"}),this.navMenus()):"taxonomy-edit"===WPGlobusAdmin.page?WPGlobusAdmin.data.tag_id&&this.taxonomyEdit():"taxonomy-quick-edit"===WPGlobusAdmin.page?this.quickEdit("taxonomy"):"edit.php"===WPGlobusAdmin.page?(this.quickEdit("post"),0<_.size(WPGlobusAdmin.$_get)&&WPGlobusDialogApp.init()):"options-general.php"==WPGlobusAdmin.page?(this.optionsGeneral(),WPGlobusDialogApp.init({customData:WPGlobusCoreData.page_custom_data})):"widgets.php"==WPGlobusAdmin.page?"undefined"!=typeof WPGlobusWidgets&&(WPGlobusWidgets.init(),WPGlobusDialogApp.init({dialogTitle:"Edit text"})):"wpglobus_options"==WPGlobusAdmin.page?this.start():"wpglobusAdminCentral"==WPGlobusAdmin.page?this.adminCentral():WPGlobusDialogApp.init({customData:WPGlobusCoreData.page_custom_data})},parseBool:function(t){return!/^(false|0)$/i.test(t)&&!!t},getCurrentTab:function(){return r(".wpglobus-post-body-tabs-list .ui-tabs-active").data("language")},adminInit:function(){var t=r(".wpglobus-addons-group a").data("key");void 0!==t&&(0<=window.location.search.indexOf("page=wpglobus_options&tab="+t)?WPGlobusCoreData.multisite?window.location=WPGlobusCoreData.pluginInstallLocation.multisite:window.location=WPGlobusCoreData.pluginInstallLocation.single:(t=r("#toplevel_page_wpglobus_options li").eq(t+1),(WPGlobusCoreData.multisite?r(t).find("a").attr("href",WPGlobusCoreData.pluginInstallLocation.multisite):r(t).find("a").attr("href",WPGlobusCoreData.pluginInstallLocation.single)).attr("onclick","window.location=jQuery(this).attr('href');return false;")))},optionsGeneral:function(){var e=r("#blogname"),t=r("body");e.addClass("hidden"),r("#wpglobus-blogname").insertAfter(e).removeClass("hidden"),t.on("blur",".wpglobus-blogname",function(){r(".wpglobus-blogname").each(function(t,a){a=r(a);e.val(WPGlobusCore.getString(e.val(),a.val(),a.data("language")))})});var o=r("#blogdescription");o.addClass("hidden"),r("#wpglobus-blogdescription").insertAfter(o).removeClass("hidden"),t.on("blur",".wpglobus-blogdesc",function(){r(".wpglobus-blogdesc").each(function(t,a){a=r(a);o.val(WPGlobusCore.getString(o.val(),a.val(),a.data("language")))})})},quickEdit:function(o){var n,i,l,t;void 0!==WPGlobusAdmin.data.has_items&&WPGlobusAdmin.data.has_items&&(n="",i=0,r(document).ajaxComplete(function(t,a,e){void 0!==e.data&&""!=n&&0<=e.data.indexOf("action=inline-save-tax&")&&(r("#"+n+" a.row-title").text(WPGlobusAdmin.qedit_titles[i][WPGlobusAdmin.data.language].name),r("#"+n+" .description").text(WPGlobusAdmin.qedit_titles[i][WPGlobusAdmin.data.language].description))}),l={},r("#the-list tr").each(function(t,a){var e=r(a),a="post"===o?"post-":"tag-";i=e.attr("id").replace(a,""),l[i]={},"post"===o?l[i].source=e.find(".post_title").text():"taxonomy"===o&&(l[i].source=r("#inline_"+i+" .name").text())}),(t={action:"get_titles"}).type=o,t.taxonomy=void 0!==WPGlobusAdmin.data.taxonomy&&WPGlobusAdmin.data.taxonomy,t.title=l,r.ajax({type:"POST",url:WPGlobusAdmin.ajaxurl,data:{action:WPGlobusAdmin.process_ajax,order:t},dataType:"json"}).done(function(t){WPGlobusAdmin.qedit_titles=t.qedit_titles,r.each(t.bulkedit_post_titles,function(t,a){r("#inline_"+t+" .post_title").text(a[WPGlobusAdmin.data.language].name)})}).fail(function(t){}).always(function(t,a){}),r("body").on("change",".wpglobus-quick-edit-title",function(){var o="",n=[];r(".wpglobus-quick-edit-title").each(function(t,a){var e=r(a),a=e.data("language");""!==e.val()&&(o=WPGlobusCore.getString(o,e.val(),a)),WPGlobusAdmin.qedit_titles[i][a].name=e.val(),n[t]=a});var t=r(document).triggerHandler("wpglobus_get_translations",{string:o,lang:n,id:i});void 0!==t&&(o=t),r("input.ptitle").eq(0).val(o),WPGlobusAdmin.qedit_titles[i].source=o}),void 0!==WPGlobusAdmin.data.tags&&r.each(WPGlobusAdmin.data.tags,function(t,a){WPGlobusAdmin.data.value[a].post_id={}}),r("button.save, input#bulk_edit").on("mouseenter",function(t){void 0!==WPGlobusAdmin.data.tags&&(("bulk_edit"==t.currentTarget.id?r("input#bulk_edit"):r("button.save")).unbind("click"),r("button.save, input#bulk_edit").on("click",function(a){var t=r.when(),e=(r(this),r.Deferred());e.resolve(function(t){t.next(".spinner").css({visibility:"visible"}),"bulk_edit"!=a.currentTarget.id&&r.ajaxSetup({async:!1});var o,n,i,l=t.parents("tr"),s=l.attr("id").replace("edit-","");r.each(WPGlobusAdmin.data.tags,function(t,a){if(0==(o=l.find("textarea[name='"+WPGlobusAdmin.data.names[a]+"']")).length)return!0;WPGlobusAdmin.data.value[a].post_id[s]=o.val(),n=WPGlobusAdmin.data.value[a].post_id[s].split(","),i=[];for(var e=0;e<n.length;e++)n[e]=n[e].trim(" "),""!=n[e]&&(void 0===WPGlobusAdmin.data.tag[a][n[e]]?i[e]=n[e]:i[e]=WPGlobusAdmin.data.tag[a][n[e]]);o.val(i.join(", "))})}(r(this))),t=t.then(function(){return r.when(e.done())}).then(function(){"bulk_edit"!=a.currentTarget.id&&setTimeout(function(){inlineEditPost.save(i),r.ajaxSetup({async:!0})},50)})}))}),r("#the-list").on("click",".editinline",function(){var t=r(this);if(n=t.parents("tr").attr("id"),"post"===o)i=n.replace("post-","");else{if("taxonomy"!==o)return;i=n.replace("tag-","")}"post"===o&&void 0!==WPGlobusAdmin.data.tags&&r.each(WPGlobusAdmin.data.tags,function(t,a){var e,o;""==WPGlobusAdmin.data.value[a]||void 0!==(e=r("#edit-"+i+' textarea[name="'+WPGlobusAdmin.data.names[a]+'"]').val())&&(o=e.split(","),r.each(o,function(t,a){e=e.replace(a,WPGlobusCore.TextFilter(a,WPGlobusCoreData.language))}),r("#edit-"+i+' textarea[name="'+WPGlobusAdmin.data.names[a]+'"]').val(e))});var a=r("#edit-"+i+" input.ptitle").eq(0),t=a.parents("label");void 0!==WPGlobusAdmin.qedit_titles&&(a.val(WPGlobusAdmin.qedit_titles[i].source),a.addClass("hidden"),r(WPGlobusAdmin.data.template).insertAfter(t),void 0===WPGlobusAdmin.qedit_titles[i]&&(WPGlobusAdmin.qedit_titles[i]={},WPGlobusAdmin.qedit_titles[i].source=r("#"+n+" .name a.row-title").text(),r(WPGlobusAdmin.data.enabled_languages).each(function(t,a){WPGlobusAdmin.qedit_titles[i][a]={},a==WPGlobusAdmin.data.default_language?WPGlobusAdmin.qedit_titles[i][a].name=WPGlobusAdmin.qedit_titles[i].source:WPGlobusAdmin.qedit_titles[i][a].name="",WPGlobusAdmin.qedit_titles[i][a].description=""})),r(".wpglobus-quick-edit-title").each(function(t,a){var e=r(a),a=e.data("language");e.attr("id",a+i),void 0!==WPGlobusAdmin.qedit_titles[i][a]&&(WPGlobusAdmin.qedit_titles[i][a].name=WPGlobusAdmin.qedit_titles[i][a].name.replace(/\\\'/g,"'"),WPGlobusAdmin.qedit_titles[i][a].name=WPGlobusAdmin.qedit_titles[i][a].name.replace(/\\\"/g,'"'),e.val(WPGlobusAdmin.qedit_titles[i][a].name),WPGlobusAdmin.qedit_titles[i].source=WPGlobusCore.getString(WPGlobusAdmin.qedit_titles[i].source,WPGlobusAdmin.qedit_titles[i][a].name,a))}),r("input.ptitle").eq(0).val(WPGlobusAdmin.qedit_titles[i].source))}))},taxonomyEdit:function(){var a=[];a[0]="name",a[1]="description";r.each(WPGlobusCoreData.enabled_languages,function(t,e){r.each(a,function(t,a){!function(t,a){var e=r("#"+t);if(1!=e.length)return;var o=e.clone(),n=e.attr("name"),i="wpglobus-element wpglobus-element_"+t+" wpglobus-element_"+a+" wpglobus-translatable",l=document.getElementById(t);l=l.nodeName,r(o).attr("id",t+"_"+a),r(o).attr("name",n+"_"+a),a!==WPGlobusCoreData.default_language&&(i+=" hidden"),r(o).attr("class",i),r(o).attr("data-save-to",t),r(o).attr("data-language",a),"INPUT"==l?r(o).attr("value",r("#wpglobus-link-tab-"+a).data(t)):"TEXTAREA"==l&&r(o).text(r("#wpglobus-link-tab-"+a).data(t)),e.addClass("hidden"),0==r(".wpglobus-element_"+t).length?r(o).insertAfter(e):r(o).insertAfter(r(".wpglobus-element_"+t).last())}(a,e)})}),r(".wpglobus-taxonomy-tabs").insertAfter("#ajax-response"),r(".wrap").tabs(),r("body").on("click",".wpglobus-taxonomy-tabs li",function(t){var a=r(this).data("language");r(".wpglobus-element").addClass("hidden"),r(".wpglobus-element_"+a).removeClass("hidden"),r(".wpglobus-tax-edit-tab a").removeClass("wpglobus-tab-link-active"),r("#wpglobus-link-tab-"+a+" a").addClass("wpglobus-tab-link-active")}),r(".wpglobus-element").on("change",function(){var o=r(this).data("save-to"),n="";r(".wpglobus-element").each(function(t,a){var e=r(a),a=e.val();e.data("save-to")==o&&""!==a&&(n+=WPGlobusCore.addLocaleMarks(a,e.data("language")))}),r("#"+o).val(n)}),r(WPGlobusAdmin.data.multilingualSlug.title).insertAfter(".term-slug-wrap th label")},navMenus:function(){function e(){n!==r(i).length&&(clearInterval(o),r(i).each(function(t,a){var o,e=r(a);e.hasClass("wpglobus-menu-item")||(o=r(a).attr("id"),r.each(["input.edit-menu-item-title","input.edit-menu-item-attr-title"],function(t,a){var e=r("#"+o+" "+a),a=r(e);a.hasClass("wpglobus-hidden")||(a.addClass("wpglobus-hidden"),a.css("display","none"),e=a.parent("label"),a=a.parents("p"),r(a).css("height","80px"),r(e).append('<div style="color:#f00;">'+WPGlobusAdmin.i18n.save_nav_menu+"</div>"))}),e.addClass("wpglobus-menu-item"))}))}var o,n,i="#menu-to-edit .menu-item";r.ajaxSetup({beforeSend:function(t,a){void 0!==a.data&&0<=a.data.indexOf("action=add-menu-item")&&(n=r(i).length,o=setInterval(e,500))}}),r(i).each(function(t,a){var e=r(a).attr("id"),u=e.replace("menu-item-","");r.each(["input.edit-menu-item-title","input.edit-menu-item-attr-title"],function(n,i){var l=r("#"+e+" "+i);l.val()!=WPGlobusAdmin.data.items[u][i].source&&l.val(WPGlobusAdmin.data.items[u][i].source);var s=r("#"+e+" "+i).parents("p"),d=0;r.each(WPGlobusAdmin.data.open_languages,function(t,a){var e=l.clone();e.attr("id",l.attr("id")+"-"+a),e.attr("name",l.attr("id")+"-"+a),e.attr("data-language",a),e.attr("data-item-id",u),e.attr("placeholder",WPGlobusAdmin.data.en_language_name[a]),e.attr("value","");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.val(""):e.val(WPGlobusAdmin.data.items[u][a][i].caption),e.css("margin-bottom","0.6em"),r(s).append(e),d=t}),d=40*(d+1),l.css("display","none").attr("class","").addClass("widefat wpglobus-hidden"),r(s).css("height",d+"px").addClass("wpglobus-menu-item-box")}),r(a).addClass("wpglobus-menu-item")}),r(".menus-move-left, .menus-move-right").each(function(t,a){var e,o=r(a),n=(o.parents("li").attr("id").replace("menu-item-",""),o.attr("title"));void 0!==n&&r.each(WPGlobusAdmin.data.post_titles,function(t,a){0<=n.indexOf(t)&&(e=n.replace(t,a),o.attr("title",e),o.text(e))})}),r(".edit-menu-item-title").trigger("change"),wpNavMenu.refreshAdvancedAccessibility(),wpNavMenu.menusChanged=!1,r(".wpglobus-menu-item").on("change",function(){var t,a,e=r(this),o=e.data("item-id");e.hasClass("wpglobus-item-title")&&(t=WPGlobusCore.getString(r("input#edit-menu-item-title-"+o).val(),e.val(),e.data("language")),void 0!==(a=r(document).triggerHandler("wpglobus_get_menu_translations",{string:t,lang:WPGlobusCoreData.open_languages,id:o,type:"input.edit-menu-item-title"}))&&(t=a),r("input#edit-menu-item-title-"+o).val(t)),e.hasClass("wpglobus-item-attr")&&(t=WPGlobusCore.getString(r("input#edit-menu-item-attr-title-"+o).val(),e.val(),e.data("language")),void 0!==(a=r(document).triggerHandler("wpglobus_get_menu_translations",{string:t,lang:WPGlobusCoreData.open_languages,id:o,type:"input.edit-menu-item-attr-title"}))&&(t=a),r("input#edit-menu-item-attr-title-"+o).val(t))});var a=[];setTimeout(function(){r(".edit-menu-item-description").each(function(){var t=r(this).attr("id");a.push(t),WPGlobusDialogApp.addElement(t)}),r(".wpglobus_dialog_start").each(function(){r(this).css({"font-style":"normal"}),r(this).after("<br />")});var t={action:"getNavMenuItemsDescription"};t.menuItems=a,r.ajax({type:"POST",url:WPGlobusAdmin.ajaxurl,data:{action:WPGlobusAdmin.process_ajax,order:t},dataType:"json"}).done(function(t){"object"==typeof t&&r.each(t,function(t,a){""!=a&&(r("#"+t).val(a),r("#wpglobus-"+t).val(WPGlobusCore.TextFilter(a,WPGlobus.language,"RETURN_EMPTY")))})}).fail(function(t){}).always(function(t,a){})},1e3)},postEdit:function(){r(document).on("heartbeat-send",function(t,o){void 0!==o.wp_autosave&&(o.wpglobus_heartbeat="wpglobus",r.each(WPGlobusAdmin.data.open_languages,function(t,a){var e=r("#title_"+a).val()||"";""!=(e=e.trim())&&(o.wp_autosave["post_title_"+a]=e),""!=(e=(e=r("#content_"+a).val()||"").trim())&&(o.wp_autosave["content_"+a]=e)}))});var a,i,l,e="#postdivrich",o=!0,s="#post-body-content";!1===WPGlobusAdmin.data.support.editor&&(o=!(e="#titlediv")),!1===WPGlobusAdmin.data.support.title&&(o=!1),r(s).prepend(r(".wpglobus-post-body-tabs-list")),r.each(WPGlobusAdmin.tabs,function(t,a){"default"===a?(r(e).wrap('<div id="tab-default"></div>'),o&&r(r("#titlediv")).insertBefore(e)):(r(e+"-"+a).wrap('<div id="tab-'+a+'"></div>'),o&&r(r("#titlediv-"+a)).insertBefore(e+"-"+a))}),setTimeout(function(){var n=!1;r(s).addClass("wpglobus-post-body-tabs").tabs({beforeActivate:function(t,a){var e,i,l;n||(o=(e=r("#wp-content-editor-container .mce-btn-group").eq(0)).children("div"),0!=e.length&&0!=o.length&&(i=e.attr("style"),l=o.attr("style"),r.each(WPGlobusCoreData.enabled_languages,function(t,a){if(a!=WPGlobusCoreData.default_language){var e=r("#wp-content_"+a+"-editor-container .mce-btn-group").eq(0),o=e.children("div");if(0==e.length||0==o.length)return!0;var n=e.attr("style"),a=o.attr("style");i!=n&&e.attr("style",i),l!=a&&o.attr("style",l)}}),n=!0));var o=a.oldTab[0].id.replace("link-tab-",""),a=a.newTab[0].id.replace("link-tab-","");r(".wpglobus-tab-link").removeClass("wpglobus-tab-link-active"),r("#link-tab-"+a+" .wpglobus-tab-link").addClass("wpglobus-tab-link-active"),"default"==o&&(o=WPGlobusCoreData.default_language),"default"==a&&(a=WPGlobusCoreData.default_language);a=r(document).triggerHandler("wpglobus_post_body_tabs",[o,a]);return!(!a&&void 0!==a)}})},500),r("#title").val(WPGlobusAdmin.title),r("#content").text(WPGlobusAdmin.content),"undefined"!=typeof WPGlobusVendor&&WPGlobusVendor.vendor.WPSEO&&("undefined"!=typeof wpglobus_wpseo?wpglobus_wpseo():"undefined"!=typeof WPGlobusYoastSeo&&("undefined"!=typeof WPGlobusYoastSeoPremium&&WPGlobusYoastSeoPremium&&"function"==typeof WPGlobusYoastSeoPremium.init&&WPGlobusYoastSeoPremium.init(),"function"==typeof WPGlobusYoastSeo.init&&WPGlobusYoastSeo.init())),WPGlobusAdmin.data.modify_excerpt&&((a=r("#excerpt")).addClass("hidden").css({display:"none"}),r(WPGlobusAdmin.data.template).insertAfter(a),r("body").on("change",".wpglobus-excerpt",function(){var t=r(this);a.val(WPGlobusCore.getString(a.val(),t.val(),t.data("language")))})),void 0!==wp.utils&&void 0!==wp.utils.WordCounter&&(WPGlobusCoreData.wordCounter={},i=this,l={},r.each(WPGlobusCoreData.enabled_languages,function(t,a){return a==WPGlobusCoreData.default_language||(l[t]="content_"+a,n=jQuery,t=new wp.utils.WordCounter,e=a,WPGlobusCoreData.wordCounter[e]={},WPGlobusCoreData.wordCounter[e].counter=t,void n(function(){function o(t){var a;"object"==typeof t&&(t="tinymce"==t?i.getCurrentTab():t.target.id.replace("content_","")),void 0!==WPGlobusCoreData.wordCounter[t]&&(a=!WPGlobusCoreData.wordCounter[t].contentEditor||WPGlobusCoreData.wordCounter[t].contentEditor.isHidden()?WPGlobusCoreData.wordCounter[t].content.val():WPGlobusCoreData.wordCounter[t].contentEditor.getContent({format:"raw"}),(a=WPGlobusCoreData.wordCounter[t].counter.count(a))!==WPGlobusCoreData.wordCounter[t].prevCount&&WPGlobusCoreData.wordCounter[t].count.text(a),WPGlobusCoreData.wordCounter[t].prevCount=a)}WPGlobusCoreData.wordCounter[e].content=n("#content_"+e),WPGlobusCoreData.wordCounter[e].count=n("#wp-word-count-"+e).find(".word-count-"+e),WPGlobusCoreData.wordCounter[e].prevCount=0,n(document).on("tinymce-editor-init",function(t,a){var e;-1!=n.inArray(a.id,l)&&(e=a.id.replace("content_",""),(WPGlobusCoreData.wordCounter[e].contentEditor=a).on("nodechange keyup",_.debounce(o,1e3)))}),WPGlobusCoreData.wordCounter[e].content.on("input keyup",_.debounce(o,1e3)),o(e)}));var n,e})),r(document).on("click","#publish, #save-post",function(){var e,t,o,n;1<WPGlobusAdmin.data.open_languages.length&&(r(document).triggerHandler("wpglobus_before_save_post",{content_tabs_id:s}),e=r("#title").val(),n=o="",0==e.length&&(t=WPGlobusAdmin.data.open_languages.indexOf(WPGlobusAdmin.data.default_language),WPGlobusAdmin.data.open_languages.splice(t,1),r(WPGlobusAdmin.data.open_languages).each(function(t,a){n=0==t?"":"-",0<(e=r("#title_"+a).val()).length&&(0==o.length&&(n=""),o=o+n+e)})),0<o.length&&r("#title").val(o)),void 0===WPGlobusAdmin.data.tagsdiv||WPGlobusAdmin.data.tagsdiv.length<1||r(WPGlobusAdmin.data.tagsdiv).each(function(t,a){if(0==r("#"+a).length)return!0;var e=a.replace("tagsdiv-","");if("undefined"===e)return!0;if(0==r("#tax-input-"+e).length)return!0;var o,n=[];r("#tagsdiv-"+e+" .tagchecklist li").each(function(t,a){o=(o=r(a).html()).replace(/<button.*<\/button> /,""),void 0===WPGlobusAdmin.data.tag[e][o]?n[t]=o:n[t]=WPGlobusAdmin.data.tag[e][o]}),r("#tax-input-"+e).val(n.join(", "))})}),r(".ui-state-default").on("click",function(){"link-tab-default"===r(this).attr("id")&&(r(window).scrollTop(r(window).scrollTop()+1),r(window).scrollTop(r(window).scrollTop()-1))}),r(document).on("tabsactivate",s,function(t,a){WPGlobusAdmin.currentTab=a.newTab[0].dataset.language}),r("#titlewrap input").addClass("wpglobus-translatable"),r(".title_wpglobus").addClass("wpglobus-translatable"),r(document).triggerHandler("wpglobus_after_post_edit")},adminCentral:function(){r(".wpglobus-admin-central-tab").css({display:"none"}),1<r(".nav-tab-active").length&&r(".wpglobus-about-wrap .nav-tab-wrapper a").removeClass("nav-tab-active");var e=!0;0==location.hash.indexOf("#")&&r(".wpglobus-about-wrap .nav-tab-wrapper a").each(function(t,a){r(a).attr("href")==location.hash&&(e=!1,r(a).addClass("nav-tab-active"))}),e&&r(".wpglobus-about-wrap .nav-tab-wrapper a").eq(0).addClass("nav-tab-active");var t=r(".wpglobus-about-wrap .nav-tab-active").data("tab-id");""!=t&&r("#"+t).css({display:"block"}),r(document).on("click",".wpglobus-about-wrap .nav-tab",function(t){var a=r(this);a.hasClass("nav-tab-active")||(r(".wpglobus-admin-central-tab").css({display:"none"}),r(".wpglobus-about-wrap .nav-tab").removeClass("nav-tab-active"),a.addClass("nav-tab-active"),""!=a.data("tab-id")&&r("#"+a.data("tab-id")).css({display:"block"}))})},start:function(){var a=this;r("#wpglobus_flags").select2({formatResult:this.format,formatSelection:this.format,minimumResultsForSearch:-1,escapeMarkup:function(t){return t}}),r("body").on("click","#enabled_languages-list li:first input",function(t){return t.preventDefault(),r(".redux-save-warn").css({display:"none"}),r("#enabled_languages-list").find("li:first > input").val("1"),0===r("#disable_first_language").length&&r(a.config.disable_first_language).insertAfter("#info_bar"),!1})},format:function(t){return'<img class="wpglobus_flag" src="'+WPGlobusAdmin.flag_url+t.text+'"/> '+t.text},set_dialog:function(){var o,a,n;void 0!==WPGlobusAdmin.data.customFieldsEnabled&&(WPGlobusAdmin.data.customFieldsEnabled=this.parseBool(WPGlobusAdmin.data.customFieldsEnabled),!WPGlobusAdmin.data.customFieldsEnabled)||(void 0===WPGlobusAdmin.data.excludeCustomFields&&(WPGlobusAdmin.data.excludeCustomFields=!1),a=!1,(n=function(t){var l,s,d="wpglobus_dialog_start wpglobus_dialog_icon",u=['<div class="wpglobus_dialog_options_wrapper hidden">','<input style="width:initial;" id="wpglobus-cb-{{id}}" data-object="#wpglobus-dialog-start-{{id}}" data-meta-key="{{meta-key}}" class="wpglobus_dialog_option wpglobus_dialog_cb" type="checkbox" {{checked}} />',"</div>"].join(""),t=void 0===t?"#the-list tr":"#the-list tr#"+t;r(t).each(function(){var t,a,e=r(this),o=e.attr("id"),n=e.find("textarea"),i=d;return void 0===(l=n.attr("id"))||(a=r("#"+o+"-key").val(),!(!WPGlobusAdmin.data.excludeCustomFields||-1==r.inArray(a,WPGlobusAdmin.data.excludeCustomFields))||(t=r("#"+l).clone(),r(n).addClass("wpglobus-dialog-field-source hidden"),o=n.attr("name"),r(t).attr("id","wpglobus-"+l),r(t).attr("name","wpglobus-"+o),r(t).attr("data-source-id",l),r(t).attr("class","wpglobus-dialog-field"),r(t).val(WPGlobusCore.TextFilter(r(n).val(),WPGlobusCoreData.language)),r(t).insertAfter(n),s=(s=u.replace(/{{id}}/g,l)).replace(/{{meta-key}}/g,a),void 0===WPGlobusAdmin.data.post_meta_settings[WPGlobusAdmin.data.post_type]?s=s.replace(/{{checked}}/,"checked"):i=void 0!==WPGlobusAdmin.data.post_meta_settings[WPGlobusAdmin.data.post_type][a]&&"false"==WPGlobusAdmin.data.post_meta_settings[WPGlobusAdmin.data.post_type][a]?(s=s.replace(/{{checked}}/,""),d+" wpglobus_dialog_start_hidden"):(s=s.replace(/{{checked}}/,"checked"),d),void e.append('<td style="width:20px;"><div id="wpglobus-dialog-start-'+l+'" data-type="control" data-source-type="textarea" data-source-id="'+l+'" class="'+i+'"></div>'+s+"</td>")))}),!a&&0<r("#list-table .wpglobus_dialog_start").length&&(r("#list-table thead tr").append('<th class="wpglobus-control-head"><div class="wpglobus_dialog_settings wpglobus_dialog_icon"></div></th>'),a=!0)})(),r("body").on("change",".wpglobus-dialog-field",function(){var e,o,n=r(this),t="#"+n.data("source-id"),i="";e=r(t).val(),/(\{:|\[:|<!--:)[a-z]{2}/.test(e)?(r.each(WPGlobusCoreData.enabled_languages,function(t,a){""!=(o=a==WPGlobusCoreData.language?n.val():WPGlobusCore.TextFilter(e,a,"RETURN_EMPTY"))&&(i+=WPGlobusCore.addLocaleMarks(o,a))}),r(t).val(i)):r(t).val(n.val())}),r(document).ajaxSend(function(t,a,e){"add-meta"==e.action&&(o=e.element)}),r(document).ajaxComplete(function(t,a,e){"add-meta"==e.action&&void 0!==a.responseXML&&n("newmeta"==o?"meta-"+r(a.responseXML.documentElement.outerHTML).find("meta").attr("id"):o)}),WPGlobusDialogApp.init({dialogTitle:"Edit meta"}))}},new t.App,t)});
|
readme.txt
CHANGED
@@ -220,6 +220,9 @@ WPGlobus Version 2 supports WordPress 5.x, with Gutenberg.
|
|
220 |
|
221 |
== Changelog ==
|
222 |
|
|
|
|
|
|
|
223 |
= 2.8.1 =
|
224 |
* (Vendor/Yoast) Fixed PHP Notice: `Undefined index: description`.
|
225 |
* (Vendor/Yoast) Fixed an issue with `og:title` meta.
|
220 |
|
221 |
== Changelog ==
|
222 |
|
223 |
+
= 2.8.2 =
|
224 |
+
* (Core/JS) Set new value using `val` function instead of `attr` for menu item labels and titles.
|
225 |
+
|
226 |
= 2.8.1 =
|
227 |
* (Vendor/Yoast) Fixed PHP Notice: `Undefined index: description`.
|
228 |
* (Vendor/Yoast) Fixed an issue with `og:title` meta.
|
wpglobus.php
CHANGED
@@ -15,7 +15,7 @@
|
|
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.8.
|
19 |
* Author: WPGlobus
|
20 |
* Author URI: https://wpglobus.com/
|
21 |
* Network: false
|
@@ -44,7 +44,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
44 |
exit;
|
45 |
}
|
46 |
|
47 |
-
define( 'WPGLOBUS_VERSION', '2.8.
|
48 |
define( 'WPGLOBUS_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
|
49 |
define( 'WPGLOBUS_AJAX', 'wpglobus-ajax' );
|
50 |
|
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.8.2
|
19 |
* Author: WPGlobus
|
20 |
* Author URI: https://wpglobus.com/
|
21 |
* Network: false
|
44 |
exit;
|
45 |
}
|
46 |
|
47 |
+
define( 'WPGLOBUS_VERSION', '2.8.2' );
|
48 |
define( 'WPGLOBUS_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
|
49 |
define( 'WPGLOBUS_AJAX', 'wpglobus-ajax' );
|
50 |
|