WPGlobus – Multilingual Everything! - Version 1.9.20

Version Description

  • FIXED:
    • Missing some *.min.js files.
Download this release

Release Info

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

Code changes from version 1.9.19 to 1.9.20

includes/builders/assets/wpglobus-admin-builder-49.min.js ADDED
@@ -0,0 +1 @@
 
1
+ var WPGlobusCore;!function(l){var s;s=WPGlobusCore={strpos:function(a,e,o){var t=(a=""+a).indexOf(e,o);return 0<=t&&t},TextFilter:function(a,e,o){if(void 0===a||""===a)return a;var t,n,l=[],u=!1;e=""==e?"en":e,o=void 0===o||""==o?"RETURN_IN_DEFAULT_LANGUAGE":o,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 i=0;i<3;i++)if(!1!==(t=s.strpos(a,l[i].start))){t+=l[i].start.length,a=!1===(n=s.strpos(a,l[i].end,t))?a.substr(t):a.substr(t,n-t),u=!0;break}return u||("RETURN_EMPTY"==o?(e!=WPGlobusCoreData.default_language||/(\{:|\[:|<!--:)[a-z]{2}/.test(a))&&(a=""):e==WPGlobusCoreData.default_language?/(\{:|\[:|<!--:)[a-z]{2}/.test(a)&&(a=""):a=s.TextFilter(a,WPGlobusCoreData.default_language)),a},addLocaleMarks:function(a,e){return WPGlobusCoreData.locale_tag_start.replace("%s",e)+a+WPGlobusCoreData.locale_tag_end},getTranslations:function(o){var t,n={};return l.each(WPGlobusCoreData.enabled_languages,function(a,e){t=e==WPGlobusCoreData.default_language?"RETURN_IN_DEFAULT_LANGUAGE":"RETURN_EMPTY",n[e]=s.TextFilter(o,e,t)}),n},getString:function(a,e,o){if(void 0===a)return a;void 0===e&&(e=""),void 0===o&&(o=WPGlobusCoreData.language),(a=s.getTranslations(a))[o]=e;var t="";return l.each(a,function(a,e){""!=e&&a!=WPGlobusCoreData.default_language&&(t+=s.addLocaleMarks(e,a))}),""!=a[WPGlobusCoreData.default_language]&&(t=""==t?a[WPGlobusCoreData.default_language]:s.addLocaleMarks(a[WPGlobusCoreData.default_language],WPGlobusCoreData.default_language)+t),t}}}(jQuery),jQuery(document).ready(function(u){"use strict";if("undefined"!=typeof WPGlobusAdmin){var e={languageSelectorBoxDelta:0,locationPathname:"/wp-admin/post.php",init:function(){e.start()},_info:function(){var a=void 0;0<u("#language").length&&(a=u("#language").val()),console.log("Current language from hidden (#language) : ",a),a=void 0,0<u("#wpglobus-language").length&&(a=u("#wpglobus-language").val()),console.log("Current language from hidden (#wpglobus-language) : ",a),a=void 0,0<u('input[name="wpglobus-language"]').length&&(a=u('input[name="wpglobus-language"]').val()),console.log('Current language from hidden (input[name="wpglobus-language"]) : ',a),a=void 0,0<u('input[name="wpglobus_language"]').length&&(a=u('input[name="wpglobus_language"]').val()),console.log('Current language from hidden (input[name="wpglobus_language"]) : ',a),console.log("Builder : ",WPGlobusAdmin.builder);var e=u("#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 a=wpCookies.get(WPGlobusAdmin.builder.languageCookie);if(null!==a&&history.pushState){var e=(a=a.split("+"))[0];if(void 0!==a[1]&&a[1]+0==WPGlobusAdmin.$_get.post){var o=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search+"&language="+e;return window.history.pushState({path:o},"",o),e}}}return!1},setCookie:function(){var a=e.checkCookie();a||void 0===(a=WPGlobusAdmin.$_get.language)&&(a=WPGlobusAdmin.data.default_language),wpCookies.set(WPGlobusAdmin.builder.languageCookie,a+"+"+WPGlobusAdmin.$_get.post,31536e3,e.locationPathname)},setLocationSearch:function(){if(history.pushState&&-1==window.location.search.indexOf("language=")&&WPGlobusAdmin.data.default_language!=WPGlobusAdmin.currentTab){var a=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search+"&language="+WPGlobusAdmin.currentTab;window.history.pushState({path:a},"",a)}},start:function(){e.setLocationSearch();var o="#postdivrich",t=!0,a="#post-body-content";!1===WPGlobusAdmin.data.support.editor&&(t=!(o="#titlediv")),!1===WPGlobusAdmin.data.support.title&&(t=!1),u(a).prepend(u(".wpglobus-post-body-tabs-list")),u.each(WPGlobusAdmin.tabs,function(a,e){"default"===e?(u(o).wrap('<div id="tab-default"></div>'),t&&u(u("#titlediv")).insertBefore(o)):(u(o+"-"+e).wrap('<div id="tab-'+e+'"></div>'),t&&u(u("#titlediv-"+e)).insertBefore(o+"-"+e))}),u(a).addClass("wpglobus-post-body-tabs"),e.setMultilingualFields()},ajaxPrefilter:function(){u.ajaxPrefilter(function(a,e,o){})},setMultilingualFields:function(){u.each(WPGlobusAdmin.builder.multilingualFields,function(a,e){var o,t="name",n=document.getElementsByName(e);if(0==n.length&&(t="id",n=document.getElementById(e)),null!==n){if("id"==t)o=u("#"+e);else{var l=n[0].nodeName;l=l.toLowerCase(),o=u(l+'[name="'+e+'"]')}o.addClass(WPGlobusAdmin.builder.translatableClass)}})}};WPGlobusAdmin=u.extend({},WPGlobusAdmin,e),WPGlobusAdmin.init()}});
includes/builders/gutenberg/assets/js/wpglobus-gutenberg.min.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery(document).ready(function(n){"use strict";var t={initDone:!1,languageSelectorBoxDelta:0,languageSelectorEnabled:!0,parseBool:function(e){return!/^(false|0)$/i.test(e)&&!!e},init:function(){"undefined"!=typeof _wpGutenbergCodeEditorSettings&&(WPGlobusGutenberg.yoastSeo=t.parseBool(WPGlobusGutenberg.yoastSeo),t.initListeners(),t.setTabs(),t.formHandler(),t.attachListeners())},initListeners:function(){WPGlobusGutenberg.yoastSeo&&1==n(".yoast.wpseo-metabox").length&&n(window).on("beforeunload",function(e){e.stopImmediatePropagation()})},formHandler:function(){var e=n(".metabox-base-form #referredby").attr("value");e=-1==e.indexOf("language=en")?e+"&language="+WPGlobusGutenberg.language:e.replace("language=en","language="+WPGlobusGutenberg.language),n(".metabox-base-form #referredby").attr("value",e),void 0!==(e=n('input[name="_wp_original_http_referer"]').attr("value"))&&(e=-1==e.indexOf("language=en")?e+"&language="+WPGlobusGutenberg.language:e.replace("language=en","language="+WPGlobusGutenberg.language),n('input[name="_wp_original_http_referer"]').attr("value",e))},setTabs:function(){var o=setInterval(function(){var e=n(".edit-post-header__settings");if(1==e.length){e.before(WPGlobusGutenberg.tabs);var t=n(".edit-post-header-toolbar").css("width");t=1*t.replace("px",""),t+=t<50?5:30,n(".wpglobus-gutenberg-selector-box").css({"margin-left":t+"px"}),clearInterval(o)}},200)},setSelectorStatus:function(){n(".wpglobus-gutenberg-selector-box").css({opacity:"0.2"}).attr("onclick","return false;"),t.languageSelectorEnabled=!1;var e=setInterval(function(){if(0==n(".is-saving").length){if(clearInterval(e),WPGlobusGutenberg.pagenow==WPGlobusGutenberg.postNewPage&&-1!=location.pathname.indexOf(WPGlobusGutenberg.postEditPage))return WPGlobusGutenberg.pagenow=WPGlobusGutenberg.postEditPage,n(".wpglobus-gutenberg-selector-box").css({opacity:"1"}).attr("onclick",""),void t.reloadPage();t.languageSelectorEnabled=!0,n(".wpglobus-gutenberg-selector-box").css({opacity:"1"}).attr("onclick","")}},400)},reloadPage:function(){n(".wpglobus-selector-grid").css({"grid-template-columns":"10% 90%"}),n(".wpglobus-gutenberg-selector-text").text(WPGlobusGutenberg.i18n.reload),function e(){n(".wpglobus-gutenberg-selector").fadeOut(500).fadeIn(500,e)}(),setTimeout(function(){location.reload()},500)},attachListeners:function(){n(document).on("mouseenter",".wpglobus-gutenberg-selector",function(e){t.languageSelectorEnabled&&(n(".wpglobus-gutenberg-selector-dropdown").css({display:"block"}),t.languageSelectorBoxDelta=e.screenY,n(".edit-post-header").css({"z-index":"100000"}),n(".wpglobus-gutenberg-selector-box").css({"z-index":"100001"}))}),n(document).on("mouseleave",".wpglobus-gutenberg-selector",function(e){0!=t.languageSelectorBoxDelta&&e.screenY-t.languageSelectorBoxDelta<=0&&(n(".wpglobus-gutenberg-selector-dropdown").css({display:"none"}),n(".edit-post-header").css({"z-index":"9989"}),n(".wpglobus-gutenberg-selector-box").css({"z-index":"100"}))}),n(document).on("mouseleave",".wpglobus-gutenberg-selector-dropdown",function(e){n(".wpglobus-gutenberg-selector-dropdown").css({display:"none"}),n(".edit-post-header").css({"z-index":"9989"}),n(".wpglobus-gutenberg-selector-box").css({"z-index":"10000"})}),n(document).on("click",".editor-post-save-draft",function(){t.setSelectorStatus()}),n(document).on("click",".editor-post-publish-button",function(){t.setSelectorStatus()})}};WPGlobusGutenberg=n.extend({},WPGlobusGutenberg,t),WPGlobusGutenberg.init()});
includes/js/wpglobus-admin-47.min.js CHANGED
@@ -1 +1 @@
1
- var WPGlobusCore,WPGlobusDialogApp;!function(i){var d;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;v=WPGlobusDialogApp={option:{listenClass:".wpglobus_dialog_start",settingsClass:".wpglobus_dialog_settings",dialogTabs:"#wpglobus-dialog-tabs",dialogTitle:"",customData:null,callback:function(){},dialogOptions:{title:"",placeholder:"",formFooter:"",beforeOpen:function(){},close:function(){}},dialog:{}},form:void 0,element:void 0,element_by:"id",id:"",clone_id:"",wpglobus_id:"",type:"textarea",source:"",order:{},value:{},request:"core",attrs:{},dialogTitle:"",trClass:"wpglobus-translatable",startButton:['<span id="wpglobus-dialog-start-{{clone_id}}" ','style="{{style}}" ','data-type="control" data-dialog-title="{{title}}" ','data-source-type="" data-source-id="{{id}}" data-source-name="{{name}}" ','data-nodename="{{nodename}}"',"{{sbTitle}} ",'class="{{classes}}"></span>'].join(""),startButtonClass:"wpglobus_dialog_start wpglobus_dialog_icon",clicks:0,init:function(t){v.option.dialog=v.option.dialogOptions,v.option=m.extend(v.option,t),m(v.option.dialogTabs).tabs(),v.dialogTitle=v.option.dialogTitle,this.attachListener(),null!=v.option.customData&&void 0!==v.option.customData.addElements&&m.each(v.option.customData.addElements,function(t,a){v.addElement(a)})},convertToId:function(t){return t=(t=t.replace(/\]/g,"")).replace(/\[/g,"-")},addElement:function(t){var a={id:null,style:"",styleTextareaWrapper:"",sbTitle:"",onChangeClass:"",dialogTitle:"",dialog:v.option.dialogOptions};if("string"==typeof t)a.id=t;else{if("object"!=typeof t)return;a=m.extend(a,t)}var e,o,n,i=null,l=null,s=null,d=null,u=v.startButton,r="";if(v.element_by="name",0==(d=document.getElementsByName(a.id)).length&&(v.element_by="id",d=document.getElementById(a.id)),null!==d){if(l=a.id,"id"==v.element_by?i=m("#"+l):(r=(r=d[0].nodeName).toLowerCase(),i=m(r+'[name="'+l+'"]')),s=void 0===i.attr("name")||""==i.attr("name")?l:i.attr("name"),v.clone_id=v.convertToId(l),-1!=s.indexOf("wpglobus")||-1!=v.clone_id.indexOf("wpglobus"))return!1;if(0<m("#wpglobus-"+v.clone_id).length)return!1;if(0<m(r+'[name="wpglobus-'+s+'"]').length)return!1;e=m(i.clone()),n=i.attr("style")||"",i.attr("style","display:none;"),e.attr("id","wpglobus-"+v.clone_id).attr("name","wpglobus-"+s),e.addClass(v.trClass),""!=a.onChangeClass&&e.addClass(a.onChangeClass),"id"==v.element_by?e.attr("data-source-id",l).attr("data-source-name","").attr("data-source-get-by",v.element_by):e.attr("data-source-id","").attr("data-source-name",s).attr("data-source-get-by",v.element_by),"textarea"==r?(o=WPGlobusCore.getTranslations(i.val())[WPGlobusCoreData.language],e.val(o),e.attr("data-nodename","textarea"),""==a.style?e.attr("style",n+";width:95%;float:left;"):e.attr("style",n+";"+a.style)):(o=WPGlobusCore.getTranslations(i.val())[WPGlobusCoreData.language],e.attr("value",o),e.attr("data-nodename","input"),""!=a.style&&e.attr("style",n+";"+a.style)),""!=a.dialog&&e.attr("data-dialog",JSON.stringify(a.dialog)),u=u.replace(/{{clone_id}}/g,v.clone_id),u="id"==v.element_by?(u=(u=u.replace(/{{id}}/g,v.clone_id)).replace(/{{name}}/g,"")).replace(/{{nodename}}/g,""):(u=(u=u.replace(/{{id}}/g,"")).replace(/{{name}}/g,s)).replace(/{{nodename}}/g,r),u="textarea"==r?u.replace("{{style}}","float:left;margin-top:0;"):u.replace("{{style}}","");var c="textarea"==r?v.startButtonClass+" wpglobus-textarea wpglobus-textarea-"+v.clone_id:v.startButtonClass;u=u.replace("{{classes}}",c),u=""==a.dialogTitle?u.replace("{{title}}",v.dialogTitle):u.replace("{{title}}",a.dialogTitle),u=""==a.sbTitle?u.replace("{{sbTitle}}",a.sbTitle):u.replace("{{sbTitle}}",'title="'+a.sbTitle+'"'),m(u).insertAfter(i),m(e).insertAfter(i),"textarea"==r&&(m("#wpglobus-"+v.clone_id).addClass("wpglobus-textarea-"+v.clone_id),m(".wpglobus-textarea-"+v.clone_id).wrapAll('<div class="wpglobus-textarea-wrapper" style="'+a.styleTextareaWrapper+'"></div>'));var g,b=!1;if(""==a.onChangeClass)g="#wpglobus-"+v.clone_id;else{g="."+a.onChangeClass;var p=m._data(m(document)[0],"events");void 0===p?b=!0:void 0!==p.change&&m.each(p.change,function(t,a){if(a.selector==g)return!(b=!0)})}return b||m(document).on("change",g,function(){var t=m(this),a=t.data("source-id");a=""==a?t.data("nodename")+'[name="'+t.data("source-name")+'"]':"#"+a,m(a).val(WPGlobusCore.getString(m(a).val(),t.val()))}),!0}},saveDialog:function(){var e,o,n,i="",l="",s="";m(".wpglobus_dialog_textarea").each(function(t,a){e=m(a),o=e.val(),(n=e.data("language"))==WPGlobusAdmin.data.language&&(s=o),""!=o&&(i+=WPGlobusCore.addLocaleMarks(o,n),n==WPGlobusCoreData.default_language&&(l=o))}),i=i.length==l.length+8?l:i,m(v.id).val(i),i=""==s?l:s,m(v.wpglobus_id).val(i)},dialog:m("#wpglobus-dialog-wrapper").dialog({autoOpen:!1,width:650,modal:!0,dialogClass:"wpglobus-dialog",buttons:[{text:"Save",class:"wpglobus-button-save",click:function(){v.saveDialog(),v.dialog.dialog("close")}},{text:"Cancel",class:"wpglobus-button-cancel",click:function(){v.dialog.dialog("close")}}],open:function(t,a){var e=v.dialogTitle;void 0!==v.attrs.maxlength&&(m(".wpglobus_dialog_textarea").attr("maxlength",v.attrs.maxlength),e+=" | maxlength="+v.attrs.maxlength),m(".wpglobus-dialog .ui-dialog-title").text(e)},close:function(){v.runCallback(v.option.dialog.close),v.form[0].reset()}}),attachListener:function(){m(document).on("click",v.option.settingsClass,function(){m(".wpglobus_dialog_options_wrapper").hasClass("hidden")?m(".wpglobus_dialog_options_wrapper").removeClass("hidden"):m(".wpglobus_dialog_options_wrapper").addClass("hidden")}),m(document).on("click",".wpglobus_dialog_option",function(t){var a=m(this),e=a.data("object");v.order.action="save_post_meta_settings",v.order.post_type=WPGlobusAdmin.data.post_type,v.order.checked=a.prop("checked"),v.order.id=a.attr("id"),v.order.meta_key=a.data("meta-key"),v.ajax(v.order).done(function(t){"ok"==t.result&&("true"==t.checked?m(e).removeClass("wpglobus_dialog_start_hidden"):m(e).addClass("wpglobus_dialog_start_hidden"))}).fail(function(t){}).always(function(t,a){})}),m(document).on("click",v.option.listenClass,function(a){v.element=m(this),v.id=v.element.data("source-id"),""==v.id?(v.id=v.element.data("nodename")+'[name="'+v.element.data("source-name")+'"]',v.wpglobus_id="#wpglobus-"+v.convertToId(v.element.data("source-name"))):(v.wpglobus_id="#wpglobus-"+v.id,v.id="#"+v.id),v.clicks++,1==v.clicks&&setTimeout(function(){if(1==v.clicks)v.onClick(a);else{var t=m(v.id);t.hasClass("hidden")?t.removeClass("hidden").attr("style","display:block;"):t.addClass("hidden").attr("style","display:none;")}v.clicks=0},200)}),v.form=v.dialog.find("form#wpglobus-dialog-form").on("submit",function(t){t.preventDefault(),v.saveDialog()})},ajax:function(t){return m.ajax({type:"POST",url:WPGlobusAdmin.ajaxurl,data:{action:WPGlobusAdmin.process_ajax,order:t},dataType:"json",async:!1})},onClick:function(t){void 0===v.element.data("dialog-title")||""==v.element.data("dialog-title")?v.dialogTitle=v.option.dialogTitle:v.dialogTitle=v.element.data("dialog-title"),void 0!==v.id&&(v.attrs.maxlength=m(v.id).attr("maxlength")),v.source=v.element.data("source-value"),void 0===v.source&&(v.source=m(v.id).val(),"ajax"==v.request||(v.value=WPGlobusCore.getTranslations(v.source))),v.option.dialog=m.extend({},v.option.dialogOptions,m(v.wpglobus_id).data("dialog")),""!=v.option.dialog.title&&(v.dialogTitle=v.option.dialog.title),m.each(v.value,function(t,a){var e=m("#wpglobus-dialog-"+t);e.val(a),e.attr("placeholder",WPGlobusCore.TextFilter(v.option.dialog.placeholder,t,"RETURN_IN_DEFAULT_LANGUAGE"))}),m("#wpglobus-dialog-form-footer").html(v.option.dialog.formFooter),v.runCallback(v.option.dialog.beforeOpen),v.dialog.dialog("open")},runCallback:function(t){if("object"==typeof t){var 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]])}else"string"==typeof t&&"function"==typeof window[t]&&window[t]()}}}(jQuery),jQuery(document).ready(function(){"use strict";var t,c;window.WPGlobusAdminApp=(t=window.WPGlobusAdminApp||{},c=jQuery,t.App=function(t){void 0===window.WPGlobusAdminApp&&(this.config={debug:!1,version:WPGlobusAdmin.version},this.status="ok","undefined"==typeof WPGlobusAdmin?(this.status="error",this.config.debug&&console.log("WPGlobus: error options loading")):this.config.debug&&console.dir(WPGlobusAdmin),this.config.disable_first_language=['<div id="disable_first_language" style="display:block;" class="redux-field-errors notice-red">',"<strong>","<span>&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?this.navMenus():"taxonomy-edit"===WPGlobusAdmin.page?WPGlobusAdmin.data.tag_id&&this.taxonomyEdit():"taxonomy-quick-edit"===WPGlobusAdmin.page?this.quickEdit("taxonomy"):"edit.php"===WPGlobusAdmin.page?this.quickEdit("post"):"options-general.php"==WPGlobusAdmin.page?this.optionsGeneral():"widgets.php"==WPGlobusAdmin.page?(WPGlobusWidgets.init(),WPGlobusDialogApp.init({dialogTitle:"Edit text"})):"wpglobus_options"==WPGlobusAdmin.page?this.start():"wpglobusAdminCentral"==WPGlobusAdmin.page?this.adminCentral():WPGlobusDialogApp.init({customData:WPGlobusCoreData.page_custom_data})},parseBool:function(t){return!/^(false|0)$/i.test(t)&&!!t},getCurrentTab:function(){return c(".wpglobus-post-body-tabs-list .ui-tabs-active").data("language")},adminInit:function(){var t=c(".wpglobus-addons-group a").data("key");if(void 0!==t)if(0<=window.location.search.indexOf("page=wpglobus_options&tab="+t))WPGlobusCoreData.multisite?window.location=WPGlobusCoreData.pluginInstallLocation.multisite:window.location=WPGlobusCoreData.pluginInstallLocation.single;else{var a=c("#toplevel_page_wpglobus_options li").eq(t+1);WPGlobusCoreData.multisite?c(a).find("a").attr("href",WPGlobusCoreData.pluginInstallLocation.multisite).attr("onclick","window.location=jQuery(this).attr('href');return false;"):c(a).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){if(void 0!==WPGlobusAdmin.data.has_items&&WPGlobusAdmin.data.has_items){var 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))});var 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())});var t={action:"get_titles"};t.type=n,t.taxonomy=void 0!==WPGlobusAdmin.data.taxonomy&&WPGlobusAdmin.data.taxonomy,t.title=i,c.ajax({type:"POST",url:WPGlobusAdmin.ajaxurl,data:{action:WPGlobusAdmin.process_ajax,order:t},dataType:"json"}).done(function(t){WPGlobusAdmin.qedit_titles=t.qedit_titles,c.each(t.bulkedit_post_titles,function(t,a){c("#inline_"+t+" .post_title").text(a[WPGlobusAdmin.data.language].name)})}).fail(function(t){}).always(function(t,a){}),c("body").on("change",".wpglobus-quick-edit-title",function(){var n="",i=[];c(".wpglobus-quick-edit-title").each(function(t,a){var e=c(a),o=e.data("language");""!==e.val()&&(n=WPGlobusCore.getString(n,e.val(),o)),WPGlobusAdmin.qedit_titles[l][o].name=e.val(),i[t]=o});var t=c(document).triggerHandler("wpglobus_get_translations",{string:n,lang:i,id:l});void 0!==t&&(n=t),c("input.ptitle").eq(0).attr("value",n),WPGlobusAdmin.qedit_titles[l].source=n}),void 0!==WPGlobusAdmin.data.tags&&c.each(WPGlobusAdmin.data.tags,function(t,a){WPGlobusAdmin.data.value[a].post_id={}}),c("button.save, input#bulk_edit").on("mouseenter",function(t){void 0!==WPGlobusAdmin.data.tags&&("bulk_edit"==t.currentTarget.id?c("input#bulk_edit").unbind("click"):c("button.save").unbind("click"),c("button.save, input#bulk_edit").on("click",function(a){var t=c.when(),e=(c(this),c.Deferred());e.resolve(function(t){t.next(".spinner").css({visibility:"visible"}),"bulk_edit"!=a.currentTarget.id&&c.ajaxSetup({async:!1});var o,n,i,l=t.parents("tr"),s=l.attr("id").replace("edit-","");c.each(WPGlobusAdmin.data.tags,function(t,a){if(0==(o=l.find("textarea[name='"+WPGlobusAdmin.data.names[a]+"']")).length)return!0;WPGlobusAdmin.data.value[a].post_id[s]=o.val(),n=WPGlobusAdmin.data.value[a].post_id[s].split(","),i=[];for(var e=0;e<n.length;e++)n[e]=n[e].trim(" "),""!=n[e]&&(void 0===WPGlobusAdmin.data.tag[a][n[e]]?i[e]=n[e]:i[e]=WPGlobusAdmin.data.tag[a][n[e]]);o.val(i.join(", "))})}(c(this))),t=t.then(function(){return c.when(e.done())}).then(function(){"bulk_edit"!=a.currentTarget.id&&setTimeout(function(){inlineEditPost.save(l),c.ajaxSetup({async:!0})},50)})}))}),c("#the-list").on("click","a.editinline",function(){var t=c(this);if(o=t.parents("tr").attr("id"),"post"===n)l=o.replace("post-","");else{if("taxonomy"!==n)return;l=o.replace("tag-","")}"post"===n&&void 0!==WPGlobusAdmin.data.tags&&c.each(WPGlobusAdmin.data.tags,function(t,a){if(""!=WPGlobusAdmin.data.value[a]){var e,o=c("#edit-"+l+' textarea[name="'+WPGlobusAdmin.data.names[a]+'"]').val();void 0!==o&&(e=o.split(","),c.each(e,function(t,a){o=o.replace(a,WPGlobusCore.TextFilter(a,WPGlobusCoreData.language))}),c("#edit-"+l+' textarea[name="'+WPGlobusAdmin.data.names[a]+'"]').val(o))}});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,i=c("#"+(e=a)),l=i.clone(),s=i.attr("name"),d="wpglobus-element wpglobus-element_"+e+" wpglobus-element_"+o+" wpglobus-translatable",n=(n=document.getElementById(e)).nodeName,c(l).attr("id",e+"_"+o),c(l).attr("name",s+"_"+o),o!==WPGlobusCoreData.default_language&&(d+=" hidden"),c(l).attr("class",d),c(l).attr("data-save-to",e),c(l).attr("data-language",o),"INPUT"==n?c(l).attr("value",c("#wpglobus-link-tab-"+o).data(e)):"TEXTAREA"==n&&c(l).text(c("#wpglobus-link-tab-"+o).data(e)),i.addClass("hidden"),0==c(".wpglobus-element_"+e).length?c(l).insertAfter(i):c(l).insertAfter(c(".wpglobus-element_"+e).last())})}),c(".wpglobus-taxonomy-tabs").insertAfter("#ajax-response"),c(".wrap").tabs(),c("body").on("click",".wpglobus-taxonomy-tabs li",function(t){var a=c(this).data("language");c(".wpglobus-element").addClass("hidden"),c(".wpglobus-element_"+a).removeClass("hidden")}),c(".wpglobus-element").on("change",function(){var n=c(this).data("save-to"),i="";c(".wpglobus-element").each(function(t,a){var e=c(a),o=e.val();e.data("save-to")==n&&""!==o&&(i+=WPGlobusCore.addLocaleMarks(o,e.data("language")))}),c("#"+n).val(i)}),c(WPGlobusAdmin.data.multilingualSlug.title).insertAfter(".term-slug-wrap th label")},navMenus:function(){var e,o,n="#menu-to-edit .menu-item",i=function(){o!==c(n).length&&(clearInterval(e),c(n).each(function(t,a){var e=c(a);if(!e.hasClass("wpglobus-menu-item")){var l=c(a).attr("id");c.each(["input.edit-menu-item-title","input.edit-menu-item-attr-title"],function(t,a){var e=c("#"+l+" "+a),o=c(e);if(!o.hasClass("wpglobus-hidden")){o.addClass("wpglobus-hidden"),o.css("display","none");var n=o.parent("label"),i=o.parents("p");c(i).css("height","80px"),c(n).append('<div style="color:#f00;">'+WPGlobusAdmin.i18n.save_nav_menu+"</div>")}}),e.addClass("wpglobus-menu-item")}}))};c.ajaxSetup({beforeSend:function(t,a){void 0!==a.data&&0<=a.data.indexOf("action=add-menu-item")&&(o=c(n).length,e=setInterval(i,500))}}),c(n).each(function(t,a){var e=c(a).attr("id"),u=e.replace("menu-item-","");c.each(["input.edit-menu-item-title","input.edit-menu-item-attr-title"],function(n,i){var l=c("#"+e+" "+i);l.val()!=WPGlobusAdmin.data.items[u][i].source&&l.val(WPGlobusAdmin.data.items[u][i].source);var s=c("#"+e+" "+i).parents("p"),d=0;c.each(WPGlobusAdmin.data.open_languages,function(t,a){var e=l.clone();e.attr("id",l.attr("id")+"-"+a),e.attr("name",l.attr("id")+"-"+a),e.attr("data-language",a),e.attr("data-item-id",u),e.attr("placeholder",WPGlobusAdmin.data.en_language_name[a]);var o=WPGlobusAdmin.data.items[u][a][i].class;0===n&&a===WPGlobusAdmin.data.default_language?e.attr("class",o+" edit-menu-item-title"):e.attr("class",o),""!=WPGlobusAdmin.data.items[u][a][i].caption?e.attr("value",WPGlobusAdmin.data.items[u][a][i].caption):e.attr("value",""),e.css("margin-bottom","0.6em"),c(s).append(e),d=t}),d=40*(d+1),l.css("display","none").attr("class","").addClass("widefat wpglobus-hidden"),c(s).css("height",d+"px").addClass("wpglobus-menu-item-box")}),c(a).addClass("wpglobus-menu-item")}),c(".menus-move-left, .menus-move-right").each(function(t,a){var e,o=c(a),n=(o.parents("li").attr("id").replace("menu-item-",""),o.attr("title"));void 0!==n&&c.each(WPGlobusAdmin.data.post_titles,function(t,a){0<=n.indexOf(t)&&(e=n.replace(t,a),o.attr("title",e),o.text(e))})}),c(".edit-menu-item-title").trigger("change"),wpNavMenu.refreshAdvancedAccessibility(),wpNavMenu.menusChanged=!1,c(".wpglobus-menu-item").on("change",function(){var t,a,e=c(this),o=e.data("item-id");e.hasClass("wpglobus-item-title")&&(t=WPGlobusCore.getString(c("input#edit-menu-item-title-"+o).val(),e.val(),e.data("language")),void 0!==(a=c(document).triggerHandler("wpglobus_get_menu_translations",{string:t,lang:WPGlobusCoreData.open_languages,id:o,type:"input.edit-menu-item-title"}))&&(t=a),c("input#edit-menu-item-title-"+o).val(t)),e.hasClass("wpglobus-item-attr")&&(t=WPGlobusCore.getString(c("input#edit-menu-item-attr-title-"+o).val(),e.val(),e.data("language")),void 0!==(a=c(document).triggerHandler("wpglobus_get_menu_translations",{string:t,lang:WPGlobusCoreData.open_languages,id:o,type:"input.edit-menu-item-attr-title"}))&&(t=a),c("input#edit-menu-item-attr-title-"+o).val(t))})},postEdit:function(){c(document).on("heartbeat-send",function(t,o){void 0!==o.wp_autosave&&(o.wpglobus_heartbeat="wpglobus",c.each(WPGlobusAdmin.data.open_languages,function(t,a){var e=c("#title_"+a).val()||"";""!=(e=c.trim(e))&&(o.wp_autosave["post_title_"+a]=e),e=c("#content_"+a).val()||"",""!=(e=c.trim(e))&&(o.wp_autosave["content_"+a]=e)}))});var e="#postdivrich",o=!0,a="#post-body-content";if(!1===WPGlobusAdmin.data.support.editor&&(o=!(e="#titlediv")),!1===WPGlobusAdmin.data.support.title&&(o=!1),c(a).prepend(c(".wpglobus-post-body-tabs-list")),c.each(WPGlobusAdmin.tabs,function(t,a){"default"===a?(c(e).wrap('<div id="tab-default"></div>'),o&&c(c("#titlediv")).insertBefore(e)):(c(e+"-"+a).wrap('<div id="tab-'+a+'"></div>'),o&&c(c("#titlediv-"+a)).insertBefore(e+"-"+a))}),c(a).addClass("wpglobus-post-body-tabs").tabs({beforeActivate:function(t,a){var e=a.oldTab[0].id.replace("link-tab-",""),o=a.newTab[0].id.replace("link-tab-","");"default"==e&&(e=WPGlobusCoreData.default_language),"default"==o&&(o=WPGlobusCoreData.default_language);var n=c(document).triggerHandler("wpglobus_post_body_tabs",[e,o]);return!(!n&&void 0!==n)}}),c("#title").val(WPGlobusAdmin.title),c("#content").text(WPGlobusAdmin.content),"undefined"!=typeof WPGlobusVendor&&WPGlobusVendor.vendor.WPSEO&&("undefined"!=typeof wpglobus_wpseo?wpglobus_wpseo():"undefined"!=typeof WPGlobusYoastSeo&&("undefined"!=typeof WPGlobusYoastSeoPremium&&WPGlobusYoastSeoPremium&&WPGlobusYoastSeoPremium.init(),WPGlobusYoastSeo.init())),WPGlobusAdmin.data.modify_excerpt){var n=c("#excerpt");n.addClass("hidden").css({display:"none"}),c(WPGlobusAdmin.data.template).insertAfter(n),c("body").on("change",".wpglobus-excerpt",function(){var t=c(this);n.val(WPGlobusCore.getString(n.val(),t.val(),t.data("language")))})}if(void 0!==wp.utils&&void 0!==wp.utils.WordCounter){WPGlobusCoreData.wordCounter={};var l=this,s={};c.each(WPGlobusCoreData.enabled_languages,function(t,a){if(a==WPGlobusCoreData.default_language)return!0;var n,e,i;s[t]="content_"+a,n=jQuery,e=new wp.utils.WordCounter,i=a,WPGlobusCoreData.wordCounter[i]={},WPGlobusCoreData.wordCounter[i].counter=e,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){if(-1!=n.inArray(a.id,s)){var 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)})})}c(document).on("click","#publish, #save-post",function(){if(1<WPGlobusAdmin.data.open_languages.length){c(document).triggerHandler("wpglobus_before_save_post",{content_tabs_id:a});var t,e=c("#title").val(),o="",n="";0==e.length&&(t=WPGlobusAdmin.data.open_languages.indexOf(WPGlobusAdmin.data.default_language),WPGlobusAdmin.data.open_languages.splice(t,1),c(WPGlobusAdmin.data.open_languages).each(function(t,a){n=0==t?"":"-",0<(e=c("#title_"+a).val()).length&&(0==o.length&&(n=""),o=o+n+e)})),0<o.length&&c("#title").val(o)}void 0===WPGlobusAdmin.data.tagsdiv||WPGlobusAdmin.data.tagsdiv.length<1||c(WPGlobusAdmin.data.tagsdiv).each(function(t,a){if(0==c("#"+a).length)return!0;var e=a.replace("tagsdiv-","");if("undefined"===e)return!0;if(0==c("#tax-input-"+e).length)return!0;var o,n=[];c("#tagsdiv-"+e+" .tagchecklist > span").each(function(t,a){o=(o=c(a).html()).replace(/<button.*<\/button>&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",a,function(t,a){WPGlobusAdmin.currentTab=a.newTab[0].dataset.language}),c(document).triggerHandler("wpglobus_after_post_edit")},adminCentral:function(){c(".wpglobus-admin-central-tab").css({display:"none"}),1<c(".nav-tab-active").length&&c(".wpglobus-about-wrap .nav-tab-wrapper a").removeClass("nav-tab-active");var e=!0;0==location.hash.indexOf("#")&&c(".wpglobus-about-wrap .nav-tab-wrapper a").each(function(t,a){c(a).attr("href")==location.hash&&(e=!1,c(a).addClass("nav-tab-active"))}),e&&c(".wpglobus-about-wrap .nav-tab-wrapper a").eq(0).addClass("nav-tab-active");var t=c(".wpglobus-about-wrap .nav-tab-active").data("tab-id");""!=t&&c("#"+t).css({display:"block"}),c(document).on("click",".wpglobus-about-wrap .nav-tab",function(t){var a=c(this);a.hasClass("nav-tab-active")||(c(".wpglobus-admin-central-tab").css({display:"none"}),c(".wpglobus-about-wrap .nav-tab").removeClass("nav-tab-active"),a.addClass("nav-tab-active"),""!=a.data("tab-id")&&c("#"+a.data("tab-id")).css({display:"block"}))})},start:function(){var a=this;c("#wpglobus_flags").select2({formatResult:this.format,formatSelection:this.format,minimumResultsForSearch:-1,escapeMarkup:function(t){return t}}),c("body").on("click","#enabled_languages-list li:first input",function(t){return t.preventDefault(),c(".redux-save-warn").css({display:"none"}),c("#enabled_languages-list").find("li:first > input").val("1"),0===c("#disable_first_language").length&&c(a.config.disable_first_language).insertAfter("#info_bar"),!1})},format:function(t){return'<img class="wpglobus_flag" src="'+WPGlobusAdmin.flag_url+t.text+'"/>&nbsp;&nbsp;'+t.text},set_dialog:function(){if(void 0===WPGlobusAdmin.data.customFieldsEnabled||(WPGlobusAdmin.data.customFieldsEnabled=this.parseBool(WPGlobusAdmin.data.customFieldsEnabled),WPGlobusAdmin.data.customFieldsEnabled)){var o,a=!1,n=function(t){var s,d,u,r="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(""),c(void 0===t?"#the-list tr":"#the-list tr#"+t).each(function(){var t,a,e,o=c(this),n=o.attr("id"),i=o.find("textarea"),l=r;if(void 0===(s=i.attr("id")))return!0;e=c("#"+n+"-key").val(),t=c("#"+s).clone(),c(i).addClass("wpglobus-dialog-field-source hidden"),a=i.attr("name"),c(t).attr("id","wpglobus-"+s),c(t).attr("name","wpglobus-"+a),c(t).attr("data-source-id",s),c(t).attr("class","wpglobus-dialog-field"),c(t).val(WPGlobusCore.TextFilter(c(i).val(),WPGlobusCoreData.language)),c(t).insertAfter(i),d=(d=u.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"):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}}/,""),l=r+" wpglobus_dialog_start_hidden"):(d=d.replace(/{{checked}}/,"checked"),l=r),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>")}),!a&&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>'),a=!0)};n(),c("body").on("change",".wpglobus-dialog-field",function(){var e,o,n=c(this),t="#"+n.data("source-id"),i="";void 0!==t&&(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;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;v=WPGlobusDialogApp={option:{listenClass:".wpglobus_dialog_start",settingsClass:".wpglobus_dialog_settings",dialogTabs:"#wpglobus-dialog-tabs",dialogTitle:"",customData:null,callback:function(){},dialogOptions:{title:"",placeholder:"",formFooter:"",beforeOpen:function(){},close:function(){}},dialog:{}},form:void 0,element:void 0,element_by:"id",id:"",clone_id:"",wpglobus_id:"",type:"textarea",source:"",order:{},value:{},request:"core",attrs:{},dialogTitle:"",trClass:"wpglobus-translatable",startButton:['<span id="wpglobus-dialog-start-{{clone_id}}" ','style="{{style}}" ','data-type="control" data-dialog-title="{{title}}" ','data-source-type="" data-source-id="{{id}}" data-source-name="{{name}}" ','data-nodename="{{nodename}}"',"{{sbTitle}} ",'class="{{classes}}"></span>'].join(""),startButtonClass:"wpglobus_dialog_start wpglobus_dialog_icon",clicks:0,init:function(t){v.option.dialog=v.option.dialogOptions,v.option=m.extend(v.option,t),m(v.option.dialogTabs).tabs(),v.dialogTitle=v.option.dialogTitle,this.attachListener(),null!=v.option.customData&&void 0!==v.option.customData.addElements&&m.each(v.option.customData.addElements,function(t,a){v.addElement(a)})},convertToId:function(t){return t=(t=t.replace(/\]/g,"")).replace(/\[/g,"-")},addElement:function(t){var a={id:null,style:"",styleTextareaWrapper:"",sbTitle:"",onChangeClass:"",dialogTitle:"",dialog:v.option.dialogOptions};if("string"==typeof t)a.id=t;else{if("object"!=typeof t)return;a=m.extend(a,t)}var e,o,n,i=null,l=null,s=null,d=null,u=v.startButton,r="";if(v.element_by="name",0==(d=document.getElementsByName(a.id)).length&&(v.element_by="id",d=document.getElementById(a.id)),null!==d){if(l=a.id,s=void 0===(i="id"==v.element_by?m("#"+l):(r=(r=d[0].nodeName).toLowerCase(),m(r+'[name="'+l+'"]'))).attr("name")||""==i.attr("name")?l:i.attr("name"),v.clone_id=v.convertToId(l),-1!=s.indexOf("wpglobus")||-1!=v.clone_id.indexOf("wpglobus"))return!1;if(0<m("#wpglobus-"+v.clone_id).length)return!1;if(0<m(r+'[name="wpglobus-'+s+'"]').length)return!1;e=m(i.clone()),n=i.attr("style")||"",i.attr("style","display:none;"),e.attr("id","wpglobus-"+v.clone_id).attr("name","wpglobus-"+s),e.addClass(v.trClass),""!=a.onChangeClass&&e.addClass(a.onChangeClass),"id"==v.element_by?e.attr("data-source-id",l).attr("data-source-name","").attr("data-source-get-by",v.element_by):e.attr("data-source-id","").attr("data-source-name",s).attr("data-source-get-by",v.element_by),"textarea"==r?(o=WPGlobusCore.getTranslations(i.val())[WPGlobusCoreData.language],e.val(o),e.attr("data-nodename","textarea"),""==a.style?e.attr("style",n+";width:95%;float:left;"):e.attr("style",n+";"+a.style)):(o=WPGlobusCore.getTranslations(i.val())[WPGlobusCoreData.language],e.attr("value",o),e.attr("data-nodename","input"),""!=a.style&&e.attr("style",n+";"+a.style)),""!=a.dialog&&e.attr("data-dialog",JSON.stringify(a.dialog)),u=u.replace(/{{clone_id}}/g,v.clone_id),u="id"==v.element_by?(u=(u=u.replace(/{{id}}/g,v.clone_id)).replace(/{{name}}/g,"")).replace(/{{nodename}}/g,""):(u=(u=u.replace(/{{id}}/g,"")).replace(/{{name}}/g,s)).replace(/{{nodename}}/g,r),u="textarea"==r?u.replace("{{style}}","float:left;margin-top:0;"):u.replace("{{style}}","");var c="textarea"==r?v.startButtonClass+" wpglobus-textarea wpglobus-textarea-"+v.clone_id:v.startButtonClass;u=u.replace("{{classes}}",c),u=""==a.dialogTitle?u.replace("{{title}}",v.dialogTitle):u.replace("{{title}}",a.dialogTitle),u=""==a.sbTitle?u.replace("{{sbTitle}}",a.sbTitle):u.replace("{{sbTitle}}",'title="'+a.sbTitle+'"'),m(u).insertAfter(i),m(e).insertAfter(i),"textarea"==r&&(m("#wpglobus-"+v.clone_id).addClass("wpglobus-textarea-"+v.clone_id),m(".wpglobus-textarea-"+v.clone_id).wrapAll('<div class="wpglobus-textarea-wrapper" style="'+a.styleTextareaWrapper+'"></div>'));var g,b=!1;if(""==a.onChangeClass)g="#wpglobus-"+v.clone_id;else{g="."+a.onChangeClass;var p=m._data(m(document)[0],"events");void 0===p?b=!0:void 0!==p.change&&m.each(p.change,function(t,a){if(a.selector==g)return!(b=!0)})}return b||m(document).on("change",g,function(){var t=m(this),a=t.data("source-id");a=""==a?t.data("nodename")+'[name="'+t.data("source-name")+'"]':"#"+a,m(a).val(WPGlobusCore.getString(m(a).val(),t.val()))}),!0}},saveDialog:function(){var e,o,n,i="",l="",s="";m(".wpglobus_dialog_textarea").each(function(t,a){e=m(a),o=e.val(),(n=e.data("language"))==WPGlobusAdmin.data.language&&(s=o),""!=o&&(i+=WPGlobusCore.addLocaleMarks(o,n),n==WPGlobusCoreData.default_language&&(l=o))}),i=i.length==l.length+8?l:i,m(v.id).val(i),i=""==s?l:s,m(v.wpglobus_id).val(i)},dialog:m("#wpglobus-dialog-wrapper").dialog({autoOpen:!1,width:650,modal:!0,dialogClass:"wpglobus-dialog",buttons:[{text:"Save",class:"wpglobus-button-save",click:function(){v.saveDialog(),v.dialog.dialog("close")}},{text:"Cancel",class:"wpglobus-button-cancel",click:function(){v.dialog.dialog("close")}}],open:function(t,a){var e=v.dialogTitle;void 0!==v.attrs.maxlength&&(m(".wpglobus_dialog_textarea").attr("maxlength",v.attrs.maxlength),e+=" | maxlength="+v.attrs.maxlength),m(".wpglobus-dialog .ui-dialog-title").text(e)},close:function(){v.runCallback(v.option.dialog.close),v.form[0].reset()}}),attachListener:function(){m(document).on("click",v.option.settingsClass,function(){m(".wpglobus_dialog_options_wrapper").hasClass("hidden")?m(".wpglobus_dialog_options_wrapper").removeClass("hidden"):m(".wpglobus_dialog_options_wrapper").addClass("hidden")}),m(document).on("click",".wpglobus_dialog_option",function(t){var a=m(this),e=a.data("object");v.order.action="save_post_meta_settings",v.order.post_type=WPGlobusAdmin.data.post_type,v.order.checked=a.prop("checked"),v.order.id=a.attr("id"),v.order.meta_key=a.data("meta-key"),v.ajax(v.order).done(function(t){"ok"==t.result&&("true"==t.checked?m(e).removeClass("wpglobus_dialog_start_hidden"):m(e).addClass("wpglobus_dialog_start_hidden"))}).fail(function(t){}).always(function(t,a){})}),m(document).on("click",v.option.listenClass,function(a){v.element=m(this),v.id=v.element.data("source-id"),""==v.id?(v.id=v.element.data("nodename")+'[name="'+v.element.data("source-name")+'"]',v.wpglobus_id="#wpglobus-"+v.convertToId(v.element.data("source-name"))):(v.wpglobus_id="#wpglobus-"+v.id,v.id="#"+v.id),v.clicks++,1==v.clicks&&setTimeout(function(){if(1==v.clicks)v.onClick(a);else{var t=m(v.id);t.hasClass("hidden")?t.removeClass("hidden").attr("style","display:block;"):t.addClass("hidden").attr("style","display:none;")}v.clicks=0},200)}),v.form=v.dialog.find("form#wpglobus-dialog-form").on("submit",function(t){t.preventDefault(),v.saveDialog()})},ajax:function(t){return m.ajax({type:"POST",url:WPGlobusAdmin.ajaxurl,data:{action:WPGlobusAdmin.process_ajax,order:t},dataType:"json",async:!1})},onClick:function(t){void 0===v.element.data("dialog-title")||""==v.element.data("dialog-title")?v.dialogTitle=v.option.dialogTitle:v.dialogTitle=v.element.data("dialog-title"),void 0!==v.id&&(v.attrs.maxlength=m(v.id).attr("maxlength")),v.source=v.element.data("source-value"),void 0===v.source&&(v.source=m(v.id).val(),"ajax"==v.request||(v.value=WPGlobusCore.getTranslations(v.source))),v.option.dialog=m.extend({},v.option.dialogOptions,m(v.wpglobus_id).data("dialog")),""!=v.option.dialog.title&&(v.dialogTitle=v.option.dialog.title),m.each(v.value,function(t,a){var e=m("#wpglobus-dialog-"+t);e.val(a),e.attr("placeholder",WPGlobusCore.TextFilter(v.option.dialog.placeholder,t,"RETURN_IN_DEFAULT_LANGUAGE"))}),m("#wpglobus-dialog-form-footer").html(v.option.dialog.formFooter),v.runCallback(v.option.dialog.beforeOpen),v.dialog.dialog("open")},runCallback:function(t){if("object"==typeof t){var 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]])}else"string"==typeof t&&"function"==typeof window[t]&&window[t]()}}}(jQuery),jQuery(document).ready(function(){"use strict";var t,c;window.WPGlobusAdminApp=(t=window.WPGlobusAdminApp||{},c=jQuery,t.App=function(t){void 0===window.WPGlobusAdminApp&&(this.config={debug:!1,version:WPGlobusAdmin.version},this.status="ok","undefined"==typeof WPGlobusAdmin?(this.status="error",this.config.debug&&console.log("WPGlobus: error options loading")):this.config.debug&&console.dir(WPGlobusAdmin),this.config.disable_first_language=['<div id="disable_first_language" style="display:block;" class="redux-field-errors notice-red">',"<strong>","<span>&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?this.navMenus():"taxonomy-edit"===WPGlobusAdmin.page?WPGlobusAdmin.data.tag_id&&this.taxonomyEdit():"taxonomy-quick-edit"===WPGlobusAdmin.page?this.quickEdit("taxonomy"):"edit.php"===WPGlobusAdmin.page?this.quickEdit("post"):"options-general.php"==WPGlobusAdmin.page?this.optionsGeneral():"widgets.php"==WPGlobusAdmin.page?(WPGlobusWidgets.init(),WPGlobusDialogApp.init({dialogTitle:"Edit text"})):"wpglobus_options"==WPGlobusAdmin.page?this.start():"wpglobusAdminCentral"==WPGlobusAdmin.page?this.adminCentral():WPGlobusDialogApp.init({customData:WPGlobusCoreData.page_custom_data})},parseBool:function(t){return!/^(false|0)$/i.test(t)&&!!t},getCurrentTab:function(){return c(".wpglobus-post-body-tabs-list .ui-tabs-active").data("language")},adminInit:function(){var t=c(".wpglobus-addons-group a").data("key");if(void 0!==t)if(0<=window.location.search.indexOf("page=wpglobus_options&tab="+t))WPGlobusCoreData.multisite?window.location=WPGlobusCoreData.pluginInstallLocation.multisite:window.location=WPGlobusCoreData.pluginInstallLocation.single;else{var a=c("#toplevel_page_wpglobus_options li").eq(t+1);WPGlobusCoreData.multisite?c(a).find("a").attr("href",WPGlobusCoreData.pluginInstallLocation.multisite).attr("onclick","window.location=jQuery(this).attr('href');return false;"):c(a).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){if(void 0!==WPGlobusAdmin.data.has_items&&WPGlobusAdmin.data.has_items){var 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))});var 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())});var t={action:"get_titles"};t.type=n,t.taxonomy=void 0!==WPGlobusAdmin.data.taxonomy&&WPGlobusAdmin.data.taxonomy,t.title=i,c.ajax({type:"POST",url:WPGlobusAdmin.ajaxurl,data:{action:WPGlobusAdmin.process_ajax,order:t},dataType:"json"}).done(function(t){WPGlobusAdmin.qedit_titles=t.qedit_titles,c.each(t.bulkedit_post_titles,function(t,a){c("#inline_"+t+" .post_title").text(a[WPGlobusAdmin.data.language].name)})}).fail(function(t){}).always(function(t,a){}),c("body").on("change",".wpglobus-quick-edit-title",function(){var n="",i=[];c(".wpglobus-quick-edit-title").each(function(t,a){var e=c(a),o=e.data("language");""!==e.val()&&(n=WPGlobusCore.getString(n,e.val(),o)),WPGlobusAdmin.qedit_titles[l][o].name=e.val(),i[t]=o});var t=c(document).triggerHandler("wpglobus_get_translations",{string:n,lang:i,id:l});void 0!==t&&(n=t),c("input.ptitle").eq(0).attr("value",n),WPGlobusAdmin.qedit_titles[l].source=n}),void 0!==WPGlobusAdmin.data.tags&&c.each(WPGlobusAdmin.data.tags,function(t,a){WPGlobusAdmin.data.value[a].post_id={}}),c("button.save, input#bulk_edit").on("mouseenter",function(t){void 0!==WPGlobusAdmin.data.tags&&("bulk_edit"==t.currentTarget.id?c("input#bulk_edit").unbind("click"):c("button.save").unbind("click"),c("button.save, input#bulk_edit").on("click",function(a){var t=c.when(),e=(c(this),c.Deferred());e.resolve(function(t){t.next(".spinner").css({visibility:"visible"}),"bulk_edit"!=a.currentTarget.id&&c.ajaxSetup({async:!1});var o,n,i,l=t.parents("tr"),s=l.attr("id").replace("edit-","");c.each(WPGlobusAdmin.data.tags,function(t,a){if(0==(o=l.find("textarea[name='"+WPGlobusAdmin.data.names[a]+"']")).length)return!0;WPGlobusAdmin.data.value[a].post_id[s]=o.val(),n=WPGlobusAdmin.data.value[a].post_id[s].split(","),i=[];for(var e=0;e<n.length;e++)n[e]=n[e].trim(" "),""!=n[e]&&(void 0===WPGlobusAdmin.data.tag[a][n[e]]?i[e]=n[e]:i[e]=WPGlobusAdmin.data.tag[a][n[e]]);o.val(i.join(", "))})}(c(this))),t=t.then(function(){return c.when(e.done())}).then(function(){"bulk_edit"!=a.currentTarget.id&&setTimeout(function(){inlineEditPost.save(l),c.ajaxSetup({async:!0})},50)})}))}),c("#the-list").on("click","a.editinline",function(){var t=c(this);if(o=t.parents("tr").attr("id"),"post"===n)l=o.replace("post-","");else{if("taxonomy"!==n)return;l=o.replace("tag-","")}"post"===n&&void 0!==WPGlobusAdmin.data.tags&&c.each(WPGlobusAdmin.data.tags,function(t,a){if(""!=WPGlobusAdmin.data.value[a]){var e,o=c("#edit-"+l+' textarea[name="'+WPGlobusAdmin.data.names[a]+'"]').val();void 0!==o&&(e=o.split(","),c.each(e,function(t,a){o=o.replace(a,WPGlobusCore.TextFilter(a,WPGlobusCoreData.language))}),c("#edit-"+l+' textarea[name="'+WPGlobusAdmin.data.names[a]+'"]').val(o))}});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,i=c("#"+(e=a)),l=i.clone(),s=i.attr("name"),d="wpglobus-element wpglobus-element_"+e+" wpglobus-element_"+o+" wpglobus-translatable",n=(n=document.getElementById(e)).nodeName,c(l).attr("id",e+"_"+o),c(l).attr("name",s+"_"+o),o!==WPGlobusCoreData.default_language&&(d+=" hidden"),c(l).attr("class",d),c(l).attr("data-save-to",e),c(l).attr("data-language",o),"INPUT"==n?c(l).attr("value",c("#wpglobus-link-tab-"+o).data(e)):"TEXTAREA"==n&&c(l).text(c("#wpglobus-link-tab-"+o).data(e)),i.addClass("hidden"),0==c(".wpglobus-element_"+e).length?c(l).insertAfter(i):c(l).insertAfter(c(".wpglobus-element_"+e).last())})}),c(".wpglobus-taxonomy-tabs").insertAfter("#ajax-response"),c(".wrap").tabs(),c("body").on("click",".wpglobus-taxonomy-tabs li",function(t){var a=c(this).data("language");c(".wpglobus-element").addClass("hidden"),c(".wpglobus-element_"+a).removeClass("hidden")}),c(".wpglobus-element").on("change",function(){var n=c(this).data("save-to"),i="";c(".wpglobus-element").each(function(t,a){var e=c(a),o=e.val();e.data("save-to")==n&&""!==o&&(i+=WPGlobusCore.addLocaleMarks(o,e.data("language")))}),c("#"+n).val(i)}),c(WPGlobusAdmin.data.multilingualSlug.title).insertAfter(".term-slug-wrap th label")},navMenus:function(){var e,o,n="#menu-to-edit .menu-item",i=function(){o!==c(n).length&&(clearInterval(e),c(n).each(function(t,a){var e=c(a);if(!e.hasClass("wpglobus-menu-item")){var l=c(a).attr("id");c.each(["input.edit-menu-item-title","input.edit-menu-item-attr-title"],function(t,a){var e=c("#"+l+" "+a),o=c(e);if(!o.hasClass("wpglobus-hidden")){o.addClass("wpglobus-hidden"),o.css("display","none");var n=o.parent("label"),i=o.parents("p");c(i).css("height","80px"),c(n).append('<div style="color:#f00;">'+WPGlobusAdmin.i18n.save_nav_menu+"</div>")}}),e.addClass("wpglobus-menu-item")}}))};c.ajaxSetup({beforeSend:function(t,a){void 0!==a.data&&0<=a.data.indexOf("action=add-menu-item")&&(o=c(n).length,e=setInterval(i,500))}}),c(n).each(function(t,a){var e=c(a).attr("id"),u=e.replace("menu-item-","");c.each(["input.edit-menu-item-title","input.edit-menu-item-attr-title"],function(n,i){var l=c("#"+e+" "+i);l.val()!=WPGlobusAdmin.data.items[u][i].source&&l.val(WPGlobusAdmin.data.items[u][i].source);var s=c("#"+e+" "+i).parents("p"),d=0;c.each(WPGlobusAdmin.data.open_languages,function(t,a){var e=l.clone();e.attr("id",l.attr("id")+"-"+a),e.attr("name",l.attr("id")+"-"+a),e.attr("data-language",a),e.attr("data-item-id",u),e.attr("placeholder",WPGlobusAdmin.data.en_language_name[a]);var o=WPGlobusAdmin.data.items[u][a][i].class;0===n&&a===WPGlobusAdmin.data.default_language?e.attr("class",o+" edit-menu-item-title"):e.attr("class",o),""!=WPGlobusAdmin.data.items[u][a][i].caption?e.attr("value",WPGlobusAdmin.data.items[u][a][i].caption):e.attr("value",""),e.css("margin-bottom","0.6em"),c(s).append(e),d=t}),d=40*(d+1),l.css("display","none").attr("class","").addClass("widefat wpglobus-hidden"),c(s).css("height",d+"px").addClass("wpglobus-menu-item-box")}),c(a).addClass("wpglobus-menu-item")}),c(".menus-move-left, .menus-move-right").each(function(t,a){var e,o=c(a),n=(o.parents("li").attr("id").replace("menu-item-",""),o.attr("title"));void 0!==n&&c.each(WPGlobusAdmin.data.post_titles,function(t,a){0<=n.indexOf(t)&&(e=n.replace(t,a),o.attr("title",e),o.text(e))})}),c(".edit-menu-item-title").trigger("change"),wpNavMenu.refreshAdvancedAccessibility(),wpNavMenu.menusChanged=!1,c(".wpglobus-menu-item").on("change",function(){var t,a,e=c(this),o=e.data("item-id");e.hasClass("wpglobus-item-title")&&(t=WPGlobusCore.getString(c("input#edit-menu-item-title-"+o).val(),e.val(),e.data("language")),void 0!==(a=c(document).triggerHandler("wpglobus_get_menu_translations",{string:t,lang:WPGlobusCoreData.open_languages,id:o,type:"input.edit-menu-item-title"}))&&(t=a),c("input#edit-menu-item-title-"+o).val(t)),e.hasClass("wpglobus-item-attr")&&(t=WPGlobusCore.getString(c("input#edit-menu-item-attr-title-"+o).val(),e.val(),e.data("language")),void 0!==(a=c(document).triggerHandler("wpglobus_get_menu_translations",{string:t,lang:WPGlobusCoreData.open_languages,id:o,type:"input.edit-menu-item-attr-title"}))&&(t=a),c("input#edit-menu-item-attr-title-"+o).val(t))})},postEdit:function(){c(document).on("heartbeat-send",function(t,o){void 0!==o.wp_autosave&&(o.wpglobus_heartbeat="wpglobus",c.each(WPGlobusAdmin.data.open_languages,function(t,a){var e=c("#title_"+a).val()||"";""!=(e=c.trim(e))&&(o.wp_autosave["post_title_"+a]=e),e=c("#content_"+a).val()||"",""!=(e=c.trim(e))&&(o.wp_autosave["content_"+a]=e)}))});var e="#postdivrich",o=!0,a="#post-body-content";if(!1===WPGlobusAdmin.data.support.editor&&(o=!(e="#titlediv")),!1===WPGlobusAdmin.data.support.title&&(o=!1),c(a).prepend(c(".wpglobus-post-body-tabs-list")),c.each(WPGlobusAdmin.tabs,function(t,a){"default"===a?(c(e).wrap('<div id="tab-default"></div>'),o&&c(c("#titlediv")).insertBefore(e)):(c(e+"-"+a).wrap('<div id="tab-'+a+'"></div>'),o&&c(c("#titlediv-"+a)).insertBefore(e+"-"+a))}),c(a).addClass("wpglobus-post-body-tabs").tabs({beforeActivate:function(t,a){var e=a.oldTab[0].id.replace("link-tab-",""),o=a.newTab[0].id.replace("link-tab-","");"default"==e&&(e=WPGlobusCoreData.default_language),"default"==o&&(o=WPGlobusCoreData.default_language);var n=c(document).triggerHandler("wpglobus_post_body_tabs",[e,o]);return!(!n&&void 0!==n)}}),c("#title").val(WPGlobusAdmin.title),c("#content").text(WPGlobusAdmin.content),"undefined"!=typeof WPGlobusVendor&&WPGlobusVendor.vendor.WPSEO&&("undefined"!=typeof wpglobus_wpseo?wpglobus_wpseo():"undefined"!=typeof WPGlobusYoastSeo&&("undefined"!=typeof WPGlobusYoastSeoPremium&&WPGlobusYoastSeoPremium&&WPGlobusYoastSeoPremium.init(),WPGlobusYoastSeo.init())),WPGlobusAdmin.data.modify_excerpt){var n=c("#excerpt");n.addClass("hidden").css({display:"none"}),c(WPGlobusAdmin.data.template).insertAfter(n),c("body").on("change",".wpglobus-excerpt",function(){var t=c(this);n.val(WPGlobusCore.getString(n.val(),t.val(),t.data("language")))})}if(void 0!==wp.utils&&void 0!==wp.utils.WordCounter){WPGlobusCoreData.wordCounter={};var l=this,s={};c.each(WPGlobusCoreData.enabled_languages,function(t,a){if(a==WPGlobusCoreData.default_language)return!0;var n,e,i;s[t]="content_"+a,n=jQuery,e=new wp.utils.WordCounter,i=a,WPGlobusCoreData.wordCounter[i]={},WPGlobusCoreData.wordCounter[i].counter=e,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){if(-1!=n.inArray(a.id,s)){var 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)})})}c(document).on("click","#publish, #save-post",function(){if(1<WPGlobusAdmin.data.open_languages.length){c(document).triggerHandler("wpglobus_before_save_post",{content_tabs_id:a});var t,e=c("#title").val(),o="",n="";0==e.length&&(t=WPGlobusAdmin.data.open_languages.indexOf(WPGlobusAdmin.data.default_language),WPGlobusAdmin.data.open_languages.splice(t,1),c(WPGlobusAdmin.data.open_languages).each(function(t,a){n=0==t?"":"-",0<(e=c("#title_"+a).val()).length&&(0==o.length&&(n=""),o=o+n+e)})),0<o.length&&c("#title").val(o)}void 0===WPGlobusAdmin.data.tagsdiv||WPGlobusAdmin.data.tagsdiv.length<1||c(WPGlobusAdmin.data.tagsdiv).each(function(t,a){if(0==c("#"+a).length)return!0;var e=a.replace("tagsdiv-","");if("undefined"===e)return!0;if(0==c("#tax-input-"+e).length)return!0;var o,n=[];c("#tagsdiv-"+e+" .tagchecklist > span").each(function(t,a){o=(o=c(a).html()).replace(/<button.*<\/button>&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",a,function(t,a){WPGlobusAdmin.currentTab=a.newTab[0].dataset.language}),c(document).triggerHandler("wpglobus_after_post_edit")},adminCentral:function(){c(".wpglobus-admin-central-tab").css({display:"none"}),1<c(".nav-tab-active").length&&c(".wpglobus-about-wrap .nav-tab-wrapper a").removeClass("nav-tab-active");var e=!0;0==location.hash.indexOf("#")&&c(".wpglobus-about-wrap .nav-tab-wrapper a").each(function(t,a){c(a).attr("href")==location.hash&&(e=!1,c(a).addClass("nav-tab-active"))}),e&&c(".wpglobus-about-wrap .nav-tab-wrapper a").eq(0).addClass("nav-tab-active");var t=c(".wpglobus-about-wrap .nav-tab-active").data("tab-id");""!=t&&c("#"+t).css({display:"block"}),c(document).on("click",".wpglobus-about-wrap .nav-tab",function(t){var a=c(this);a.hasClass("nav-tab-active")||(c(".wpglobus-admin-central-tab").css({display:"none"}),c(".wpglobus-about-wrap .nav-tab").removeClass("nav-tab-active"),a.addClass("nav-tab-active"),""!=a.data("tab-id")&&c("#"+a.data("tab-id")).css({display:"block"}))})},start:function(){var a=this;c("#wpglobus_flags").select2({formatResult:this.format,formatSelection:this.format,minimumResultsForSearch:-1,escapeMarkup:function(t){return t}}),c("body").on("click","#enabled_languages-list li:first input",function(t){return t.preventDefault(),c(".redux-save-warn").css({display:"none"}),c("#enabled_languages-list").find("li:first > input").val("1"),0===c("#disable_first_language").length&&c(a.config.disable_first_language).insertAfter("#info_bar"),!1})},format:function(t){return'<img class="wpglobus_flag" src="'+WPGlobusAdmin.flag_url+t.text+'"/>&nbsp;&nbsp;'+t.text},set_dialog:function(){if(void 0===WPGlobusAdmin.data.customFieldsEnabled||(WPGlobusAdmin.data.customFieldsEnabled=this.parseBool(WPGlobusAdmin.data.customFieldsEnabled),WPGlobusAdmin.data.customFieldsEnabled)){var o,a=!1,n=function(t){var s,d,u,r="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(""),c(void 0===t?"#the-list tr":"#the-list tr#"+t).each(function(){var t,a,e,o=c(this),n=o.attr("id"),i=o.find("textarea"),l=r;if(void 0===(s=i.attr("id")))return!0;e=c("#"+n+"-key").val(),t=c("#"+s).clone(),c(i).addClass("wpglobus-dialog-field-source hidden"),a=i.attr("name"),c(t).attr("id","wpglobus-"+s),c(t).attr("name","wpglobus-"+a),c(t).attr("data-source-id",s),c(t).attr("class","wpglobus-dialog-field"),c(t).val(WPGlobusCore.TextFilter(c(i).val(),WPGlobusCoreData.language)),c(t).insertAfter(i),d=(d=u.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}}/,""),r+" wpglobus_dialog_start_hidden"):(d=d.replace(/{{checked}}/,"checked"),r),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>")}),!a&&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>'),a=!0)};n(),c("body").on("change",".wpglobus-dialog-field",function(){var e,o,n=c(this),t="#"+n.data("source-id"),i="";void 0!==t&&(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-admin-49.min.js CHANGED
@@ -1 +1 @@
1
- var WPGlobusCore,WPGlobusDialogApp;!function(i){var d;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 f;f=WPGlobusDialogApp={option:{listenClass:".wpglobus_dialog_start",settingsClass:".wpglobus_dialog_settings",dialogTabs:"#wpglobus-dialog-tabs",dialogTitle:"",customData:null,callback:function(){},dialogOptions:{title:"",placeholder:"",formFooter:"",beforeOpen:function(){},close:function(){}},dialog:{}},form:void 0,element:void 0,element_by:"id",id:"",clone_id:"",wpglobus_id:"",type:"textarea",source:"",order:{},value:{},request:"core",attrs:{},dialogTitle:"",trClass:"wpglobus-translatable",startButton:['<span id="wpglobus-dialog-start-{{clone_id}}" ','style="{{style}}" ','data-type="control" data-dialog-title="{{title}}" ','data-source-type="" data-source-id="{{id}}" data-source-name="{{name}}" ','data-nodename="{{nodename}}"',"{{sbTitle}} ",'class="{{classes}}"></span>'].join(""),startButtonClass:"wpglobus_dialog_start wpglobus_dialog_icon",clicks:0,init:function(t){f.option.dialog=f.option.dialogOptions,f.option=m.extend(f.option,t),m(f.option.dialogTabs).tabs(),f.dialogTitle=f.option.dialogTitle,this.attachListener(),null!=f.option.customData&&void 0!==f.option.customData.addElements&&m.each(f.option.customData.addElements,function(t,a){f.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:f.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=f.startButton,r="";if(f.element_by="name",0==(d=document.getElementsByName(a.id)).length&&(f.element_by="id",d=document.getElementById(a.id)),null!==d){if(l=a.id,"id"==f.element_by?i=m("#"+l):(r=(r=d[0].nodeName).toLowerCase(),i=m(r+'[name="'+l+'"]')),s=void 0===i.attr("name")||""==i.attr("name")?l:i.attr("name"),f.clone_id=f.convertToId(l),-1!=s.indexOf("wpglobus")||-1!=f.clone_id.indexOf("wpglobus"))return!1;if(0<m("#wpglobus-"+f.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-"+f.clone_id).attr("name","wpglobus-"+s),e.addClass(f.trClass),""!=a.onChangeClass&&e.addClass(a.onChangeClass),"id"==f.element_by?e.attr("data-source-id",l).attr("data-source-name","").attr("data-source-get-by",f.element_by):e.attr("data-source-id","").attr("data-source-name",s).attr("data-source-get-by",f.element_by),"textarea"==r?(o=WPGlobusCore.getTranslations(i.val())[WPGlobusCoreData.language],e.val(o),e.attr("data-nodename","textarea"),""==a.style?e.attr("style",n+";width:95%;float:left;"):e.attr("style",n+";"+a.style)):(o=WPGlobusCore.getTranslations(i.val())[WPGlobusCoreData.language],e.attr("value",o),e.attr("data-nodename","input"),""!=a.style&&e.attr("style",n+";"+a.style)),""!=a.dialog&&e.attr("data-dialog",JSON.stringify(a.dialog)),u=u.replace(/{{clone_id}}/g,f.clone_id),u="id"==f.element_by?(u=(u=u.replace(/{{id}}/g,f.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?f.startButtonClass+" wpglobus-textarea wpglobus-textarea-"+f.clone_id:f.startButtonClass;u=u.replace("{{classes}}",c),u=""==a.dialogTitle?u.replace("{{title}}",f.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-"+f.clone_id).addClass("wpglobus-textarea-"+f.clone_id),m(".wpglobus-textarea-"+f.clone_id).wrapAll('<div class="wpglobus-textarea-wrapper" style="'+a.styleTextareaWrapper+'"></div>'));var g,p=!1;if(""==a.onChangeClass)g="#wpglobus-"+f.clone_id;else{g="."+a.onChangeClass;var b=m._data(m(document)[0],"events");void 0===b?p=!0:void 0!==b.change&&m.each(b.change,function(t,a){if(a.selector==g)return!(p=!0)})}return p||m(document).on("change",g,function(){var t=m(this),a=t.data("source-id");a=""==a?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(f.id).val(i),i=""==s?l:s,m(f.wpglobus_id).val(i)},dialog:m("#wpglobus-dialog-wrapper").dialog({autoOpen:!1,width:650,modal:!0,dialogClass:"wpglobus-dialog",buttons:[{text:"Save",class:"wpglobus-button-save",click:function(){f.saveDialog(),f.dialog.dialog("close")}},{text:"Cancel",class:"wpglobus-button-cancel",click:function(){f.dialog.dialog("close")}}],open:function(t,a){var e=f.dialogTitle;void 0!==f.attrs.maxlength&&(m(".wpglobus_dialog_textarea").attr("maxlength",f.attrs.maxlength),e+=" | maxlength="+f.attrs.maxlength),m(".wpglobus-dialog .ui-dialog-title").text(e)},close:function(){f.runCallback(f.option.dialog.close),f.form[0].reset()}}),attachListener:function(){m(document).on("click",f.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");f.order.action="save_post_meta_settings",f.order.post_type=WPGlobusAdmin.data.post_type,f.order.checked=a.prop("checked"),f.order.id=a.attr("id"),f.order.meta_key=a.data("meta-key"),f.ajax(f.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",f.option.listenClass,function(a){f.element=m(this),f.id=f.element.data("source-id"),""==f.id?(f.id=f.element.data("nodename")+'[name="'+f.element.data("source-name")+'"]',f.wpglobus_id="#wpglobus-"+f.convertToId(f.element.data("source-name"))):(f.wpglobus_id="#wpglobus-"+f.id,f.id="#"+f.id),f.clicks++,1==f.clicks&&setTimeout(function(){if(1==f.clicks)f.onClick(a);else{var t=m(f.id);t.hasClass("hidden")?t.removeClass("hidden").attr("style","display:block;"):t.addClass("hidden").attr("style","display:none;")}f.clicks=0},200)}),f.form=f.dialog.find("form#wpglobus-dialog-form").on("submit",function(t){t.preventDefault(),f.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===f.element.data("dialog-title")||""==f.element.data("dialog-title")?f.dialogTitle=f.option.dialogTitle:f.dialogTitle=f.element.data("dialog-title"),void 0!==f.id&&(f.attrs.maxlength=m(f.id).attr("maxlength")),f.source=f.element.data("source-value"),void 0===f.source&&(f.source=m(f.id).val(),"ajax"==f.request||(f.value=WPGlobusCore.getTranslations(f.source))),f.option.dialog=m.extend({},f.option.dialogOptions,m(f.wpglobus_id).data("dialog")),""!=f.option.dialog.title&&(f.dialogTitle=f.option.dialog.title),m.each(f.value,function(t,a){var e=m("#wpglobus-dialog-"+t);e.val(a),e.attr("placeholder",WPGlobusCore.TextFilter(f.option.dialog.placeholder,t,"RETURN_IN_DEFAULT_LANGUAGE"))}),m("#wpglobus-dialog-form-footer").html(f.option.dialog.formFooter),f.runCallback(f.option.dialog.beforeOpen),f.dialog.dialog("open")},runCallback:function(t){if("object"==typeof t){var 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]])}else"string"==typeof t&&"function"==typeof window[t]&&window[t]()}}}(jQuery),jQuery(document).ready(function(){"use strict";var t,c;window.WPGlobusAdminApp=(t=window.WPGlobusAdminApp||{},c=jQuery,t.App=function(t){void 0===window.WPGlobusAdminApp&&(this.config={debug:!1,version:WPGlobusAdmin.version},this.status="ok","undefined"==typeof WPGlobusAdmin?(this.status="error",this.config.debug&&console.log("WPGlobus: error options loading")):this.config.debug&&console.dir(WPGlobusAdmin),this.config.disable_first_language=['<div id="disable_first_language" style="display:block;" class="redux-field-errors notice-red">',"<strong>","<span>&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=c(".wpglobus-addons-group a").data("key");if(void 0!==t)if(0<=window.location.search.indexOf("page=wpglobus_options&tab="+t))WPGlobusCoreData.multisite?window.location=WPGlobusCoreData.pluginInstallLocation.multisite:window.location=WPGlobusCoreData.pluginInstallLocation.single;else{var a=c("#toplevel_page_wpglobus_options li").eq(t+1);WPGlobusCoreData.multisite?c(a).find("a").attr("href",WPGlobusCoreData.pluginInstallLocation.multisite).attr("onclick","window.location=jQuery(this).attr('href');return false;"):c(a).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){if(void 0!==WPGlobusAdmin.data.has_items&&WPGlobusAdmin.data.has_items){var 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))});var 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())});var t={action:"get_titles"};t.type=n,t.taxonomy=void 0!==WPGlobusAdmin.data.taxonomy&&WPGlobusAdmin.data.taxonomy,t.title=i,c.ajax({type:"POST",url:WPGlobusAdmin.ajaxurl,data:{action:WPGlobusAdmin.process_ajax,order:t},dataType:"json"}).done(function(t){WPGlobusAdmin.qedit_titles=t.qedit_titles,c.each(t.bulkedit_post_titles,function(t,a){c("#inline_"+t+" .post_title").text(a[WPGlobusAdmin.data.language].name)})}).fail(function(t){}).always(function(t,a){}),c("body").on("change",".wpglobus-quick-edit-title",function(){var n="",i=[];c(".wpglobus-quick-edit-title").each(function(t,a){var e=c(a),o=e.data("language");""!==e.val()&&(n=WPGlobusCore.getString(n,e.val(),o)),WPGlobusAdmin.qedit_titles[l][o].name=e.val(),i[t]=o});var t=c(document).triggerHandler("wpglobus_get_translations",{string:n,lang:i,id:l});void 0!==t&&(n=t),c("input.ptitle").eq(0).attr("value",n),WPGlobusAdmin.qedit_titles[l].source=n}),void 0!==WPGlobusAdmin.data.tags&&c.each(WPGlobusAdmin.data.tags,function(t,a){WPGlobusAdmin.data.value[a].post_id={}}),c("button.save, input#bulk_edit").on("mouseenter",function(t){void 0!==WPGlobusAdmin.data.tags&&("bulk_edit"==t.currentTarget.id?c("input#bulk_edit").unbind("click"):c("button.save").unbind("click"),c("button.save, input#bulk_edit").on("click",function(a){var t=c.when(),e=(c(this),c.Deferred());e.resolve(function(t){t.next(".spinner").css({visibility:"visible"}),"bulk_edit"!=a.currentTarget.id&&c.ajaxSetup({async:!1});var o,n,i,l=t.parents("tr"),s=l.attr("id").replace("edit-","");c.each(WPGlobusAdmin.data.tags,function(t,a){if(0==(o=l.find("textarea[name='"+WPGlobusAdmin.data.names[a]+"']")).length)return!0;WPGlobusAdmin.data.value[a].post_id[s]=o.val(),n=WPGlobusAdmin.data.value[a].post_id[s].split(","),i=[];for(var e=0;e<n.length;e++)n[e]=n[e].trim(" "),""!=n[e]&&(void 0===WPGlobusAdmin.data.tag[a][n[e]]?i[e]=n[e]:i[e]=WPGlobusAdmin.data.tag[a][n[e]]);o.val(i.join(", "))})}(c(this))),t=t.then(function(){return c.when(e.done())}).then(function(){"bulk_edit"!=a.currentTarget.id&&setTimeout(function(){inlineEditPost.save(l),c.ajaxSetup({async:!0})},50)})}))}),c("#the-list").on("click","a.editinline",function(){var t=c(this);if(o=t.parents("tr").attr("id"),"post"===n)l=o.replace("post-","");else{if("taxonomy"!==n)return;l=o.replace("tag-","")}"post"===n&&void 0!==WPGlobusAdmin.data.tags&&c.each(WPGlobusAdmin.data.tags,function(t,a){if(""!=WPGlobusAdmin.data.value[a]){var e,o=c("#edit-"+l+' textarea[name="'+WPGlobusAdmin.data.names[a]+'"]').val();void 0!==o&&(e=o.split(","),c.each(e,function(t,a){o=o.replace(a,WPGlobusCore.TextFilter(a,WPGlobusCoreData.language))}),c("#edit-"+l+' textarea[name="'+WPGlobusAdmin.data.names[a]+'"]').val(o))}});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,i=c("#"+(e=a)),l=i.clone(),s=i.attr("name"),d="wpglobus-element wpglobus-element_"+e+" wpglobus-element_"+o+" wpglobus-translatable",n=(n=document.getElementById(e)).nodeName,c(l).attr("id",e+"_"+o),c(l).attr("name",s+"_"+o),o!==WPGlobusCoreData.default_language&&(d+=" hidden"),c(l).attr("class",d),c(l).attr("data-save-to",e),c(l).attr("data-language",o),"INPUT"==n?c(l).attr("value",c("#wpglobus-link-tab-"+o).data(e)):"TEXTAREA"==n&&c(l).text(c("#wpglobus-link-tab-"+o).data(e)),i.addClass("hidden"),0==c(".wpglobus-element_"+e).length?c(l).insertAfter(i):c(l).insertAfter(c(".wpglobus-element_"+e).last())})}),c(".wpglobus-taxonomy-tabs").insertAfter("#ajax-response"),c(".wrap").tabs(),c("body").on("click",".wpglobus-taxonomy-tabs li",function(t){var a=c(this).data("language");c(".wpglobus-element").addClass("hidden"),c(".wpglobus-element_"+a).removeClass("hidden")}),c(".wpglobus-element").on("change",function(){var n=c(this).data("save-to"),i="";c(".wpglobus-element").each(function(t,a){var e=c(a),o=e.val();e.data("save-to")==n&&""!==o&&(i+=WPGlobusCore.addLocaleMarks(o,e.data("language")))}),c("#"+n).val(i)}),c(WPGlobusAdmin.data.multilingualSlug.title).insertAfter(".term-slug-wrap th label")},navMenus:function(){var e,o,n="#menu-to-edit .menu-item",i=function(){o!==c(n).length&&(clearInterval(e),c(n).each(function(t,a){var e=c(a);if(!e.hasClass("wpglobus-menu-item")){var l=c(a).attr("id");c.each(["input.edit-menu-item-title","input.edit-menu-item-attr-title"],function(t,a){var e=c("#"+l+" "+a),o=c(e);if(!o.hasClass("wpglobus-hidden")){o.addClass("wpglobus-hidden"),o.css("display","none");var n=o.parent("label"),i=o.parents("p");c(i).css("height","80px"),c(n).append('<div style="color:#f00;">'+WPGlobusAdmin.i18n.save_nav_menu+"</div>")}}),e.addClass("wpglobus-menu-item")}}))};c.ajaxSetup({beforeSend:function(t,a){void 0!==a.data&&0<=a.data.indexOf("action=add-menu-item")&&(o=c(n).length,e=setInterval(i,500))}}),c(n).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 e="#postdivrich",o=!0,a="#post-body-content";if(!1===WPGlobusAdmin.data.support.editor&&(o=!(e="#titlediv")),!1===WPGlobusAdmin.data.support.title&&(o=!1),c(a).prepend(c(".wpglobus-post-body-tabs-list")),c.each(WPGlobusAdmin.tabs,function(t,a){"default"===a?(c(e).wrap('<div id="tab-default"></div>'),o&&c(c("#titlediv")).insertBefore(e)):(c(e+"-"+a).wrap('<div id="tab-'+a+'"></div>'),o&&c(c("#titlediv-"+a)).insertBefore(e+"-"+a))}),c(a).addClass("wpglobus-post-body-tabs").tabs({beforeActivate:function(t,a){var e=a.oldTab[0].id.replace("link-tab-",""),o=a.newTab[0].id.replace("link-tab-","");"default"==e&&(e=WPGlobusCoreData.default_language),"default"==o&&(o=WPGlobusCoreData.default_language);var n=c(document).triggerHandler("wpglobus_post_body_tabs",[e,o]);return!(!n&&void 0!==n)}}),c("#title").val(WPGlobusAdmin.title),c("#content").text(WPGlobusAdmin.content),"undefined"!=typeof WPGlobusVendor&&WPGlobusVendor.vendor.WPSEO&&("undefined"!=typeof wpglobus_wpseo?wpglobus_wpseo():"undefined"!=typeof WPGlobusYoastSeo&&("undefined"!=typeof WPGlobusYoastSeoPremium&&WPGlobusYoastSeoPremium&&WPGlobusYoastSeoPremium.init(),WPGlobusYoastSeo.init())),WPGlobusAdmin.data.modify_excerpt){var n=c("#excerpt");n.addClass("hidden").css({display:"none"}),c(WPGlobusAdmin.data.template).insertAfter(n),c("body").on("change",".wpglobus-excerpt",function(){var t=c(this);n.val(WPGlobusCore.getString(n.val(),t.val(),t.data("language")))})}if(void 0!==wp.utils&&void 0!==wp.utils.WordCounter){WPGlobusCoreData.wordCounter={};var l=this,s={};c.each(WPGlobusCoreData.enabled_languages,function(t,a){if(a==WPGlobusCoreData.default_language)return!0;var n,e,i;s[t]="content_"+a,n=jQuery,e=new wp.utils.WordCounter,i=a,WPGlobusCoreData.wordCounter[i]={},WPGlobusCoreData.wordCounter[i].counter=e,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){if(-1!=n.inArray(a.id,s)){var 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)})})}c(document).on("click","#publish, #save-post",function(){if(1<WPGlobusAdmin.data.open_languages.length){c(document).triggerHandler("wpglobus_before_save_post",{content_tabs_id:a});var t,e=c("#title").val(),o="",n="";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",a,function(t,a){WPGlobusAdmin.currentTab=a.newTab[0].dataset.language}),c(document).triggerHandler("wpglobus_after_post_edit")},adminCentral:function(){c(".wpglobus-admin-central-tab").css({display:"none"}),1<c(".nav-tab-active").length&&c(".wpglobus-about-wrap .nav-tab-wrapper a").removeClass("nav-tab-active");var e=!0;0==location.hash.indexOf("#")&&c(".wpglobus-about-wrap .nav-tab-wrapper a").each(function(t,a){c(a).attr("href")==location.hash&&(e=!1,c(a).addClass("nav-tab-active"))}),e&&c(".wpglobus-about-wrap .nav-tab-wrapper a").eq(0).addClass("nav-tab-active");var t=c(".wpglobus-about-wrap .nav-tab-active").data("tab-id");""!=t&&c("#"+t).css({display:"block"}),c(document).on("click",".wpglobus-about-wrap .nav-tab",function(t){var a=c(this);a.hasClass("nav-tab-active")||(c(".wpglobus-admin-central-tab").css({display:"none"}),c(".wpglobus-about-wrap .nav-tab").removeClass("nav-tab-active"),a.addClass("nav-tab-active"),""!=a.data("tab-id")&&c("#"+a.data("tab-id")).css({display:"block"}))})},start:function(){var a=this;c("#wpglobus_flags").select2({formatResult:this.format,formatSelection:this.format,minimumResultsForSearch:-1,escapeMarkup:function(t){return t}}),c("body").on("click","#enabled_languages-list li:first input",function(t){return t.preventDefault(),c(".redux-save-warn").css({display:"none"}),c("#enabled_languages-list").find("li:first > input").val("1"),0===c("#disable_first_language").length&&c(a.config.disable_first_language).insertAfter("#info_bar"),!1})},format:function(t){return'<img class="wpglobus_flag" src="'+WPGlobusAdmin.flag_url+t.text+'"/>&nbsp;&nbsp;'+t.text},set_dialog:function(){if(void 0===WPGlobusAdmin.data.customFieldsEnabled||(WPGlobusAdmin.data.customFieldsEnabled=this.parseBool(WPGlobusAdmin.data.customFieldsEnabled),WPGlobusAdmin.data.customFieldsEnabled)){var o,a=!1,n=function(t){var s,d,u,r="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(""),c(void 0===t?"#the-list tr":"#the-list tr#"+t).each(function(){var t,a,e,o=c(this),n=o.attr("id"),i=o.find("textarea"),l=r;if(void 0===(s=i.attr("id")))return!0;e=c("#"+n+"-key").val(),t=c("#"+s).clone(),c(i).addClass("wpglobus-dialog-field-source hidden"),a=i.attr("name"),c(t).attr("id","wpglobus-"+s),c(t).attr("name","wpglobus-"+a),c(t).attr("data-source-id",s),c(t).attr("class","wpglobus-dialog-field"),c(t).val(WPGlobusCore.TextFilter(c(i).val(),WPGlobusCoreData.language)),c(t).insertAfter(i),d=(d=u.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"):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}}/,""),l=r+" wpglobus_dialog_start_hidden"):(d=d.replace(/{{checked}}/,"checked"),l=r),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>")}),!a&&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>'),a=!0)};n(),c("body").on("change",".wpglobus-dialog-field",function(){var e,o,n=c(this),t="#"+n.data("source-id"),i="";void 0!==t&&(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;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 f;f=WPGlobusDialogApp={option:{listenClass:".wpglobus_dialog_start",settingsClass:".wpglobus_dialog_settings",dialogTabs:"#wpglobus-dialog-tabs",dialogTitle:"",customData:null,callback:function(){},dialogOptions:{title:"",placeholder:"",formFooter:"",beforeOpen:function(){},close:function(){}},dialog:{}},form:void 0,element:void 0,element_by:"id",id:"",clone_id:"",wpglobus_id:"",type:"textarea",source:"",order:{},value:{},request:"core",attrs:{},dialogTitle:"",trClass:"wpglobus-translatable",startButton:['<span id="wpglobus-dialog-start-{{clone_id}}" ','style="{{style}}" ','data-type="control" data-dialog-title="{{title}}" ','data-source-type="" data-source-id="{{id}}" data-source-name="{{name}}" ','data-nodename="{{nodename}}"',"{{sbTitle}} ",'class="{{classes}}"></span>'].join(""),startButtonClass:"wpglobus_dialog_start wpglobus_dialog_icon",clicks:0,init:function(t){f.option.dialog=f.option.dialogOptions,f.option=m.extend(f.option,t),m(f.option.dialogTabs).tabs(),f.dialogTitle=f.option.dialogTitle,this.attachListener(),null!=f.option.customData&&void 0!==f.option.customData.addElements&&m.each(f.option.customData.addElements,function(t,a){f.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:f.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=f.startButton,r="";if(f.element_by="name",0==(d=document.getElementsByName(a.id)).length&&(f.element_by="id",d=document.getElementById(a.id)),null!==d){if(l=a.id,s=void 0===(i="id"==f.element_by?m("#"+l):(r=(r=d[0].nodeName).toLowerCase(),m(r+'[name="'+l+'"]'))).attr("name")||""==i.attr("name")?l:i.attr("name"),f.clone_id=f.convertToId(l),-1!=s.indexOf("wpglobus")||-1!=f.clone_id.indexOf("wpglobus"))return!1;if(0<m("#wpglobus-"+f.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-"+f.clone_id).attr("name","wpglobus-"+s),e.addClass(f.trClass),""!=a.onChangeClass&&e.addClass(a.onChangeClass),"id"==f.element_by?e.attr("data-source-id",l).attr("data-source-name","").attr("data-source-get-by",f.element_by):e.attr("data-source-id","").attr("data-source-name",s).attr("data-source-get-by",f.element_by),"textarea"==r?(o=WPGlobusCore.getTranslations(i.val())[WPGlobusCoreData.language],e.val(o),e.attr("data-nodename","textarea"),""==a.style?e.attr("style",n+";width:95%;float:left;"):e.attr("style",n+";"+a.style)):(o=WPGlobusCore.getTranslations(i.val())[WPGlobusCoreData.language],e.attr("value",o),e.attr("data-nodename","input"),""!=a.style&&e.attr("style",n+";"+a.style)),""!=a.dialog&&e.attr("data-dialog",JSON.stringify(a.dialog)),u=u.replace(/{{clone_id}}/g,f.clone_id),u="id"==f.element_by?(u=(u=u.replace(/{{id}}/g,f.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?f.startButtonClass+" wpglobus-textarea wpglobus-textarea-"+f.clone_id:f.startButtonClass;u=u.replace("{{classes}}",c),u=""==a.dialogTitle?u.replace("{{title}}",f.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-"+f.clone_id).addClass("wpglobus-textarea-"+f.clone_id),m(".wpglobus-textarea-"+f.clone_id).wrapAll('<div class="wpglobus-textarea-wrapper" style="'+a.styleTextareaWrapper+'"></div>'));var g,p=!1;if(""==a.onChangeClass)g="#wpglobus-"+f.clone_id;else{g="."+a.onChangeClass;var b=m._data(m(document)[0],"events");void 0===b?p=!0:void 0!==b.change&&m.each(b.change,function(t,a){if(a.selector==g)return!(p=!0)})}return p||m(document).on("change",g,function(){var t=m(this),a=t.data("source-id");a=""==a?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(f.id).val(i),i=""==s?l:s,m(f.wpglobus_id).val(i)},dialog:m("#wpglobus-dialog-wrapper").dialog({autoOpen:!1,width:650,modal:!0,dialogClass:"wpglobus-dialog",buttons:[{text:"Save",class:"wpglobus-button-save",click:function(){f.saveDialog(),f.dialog.dialog("close")}},{text:"Cancel",class:"wpglobus-button-cancel",click:function(){f.dialog.dialog("close")}}],open:function(t,a){var e=f.dialogTitle;void 0!==f.attrs.maxlength&&(m(".wpglobus_dialog_textarea").attr("maxlength",f.attrs.maxlength),e+=" | maxlength="+f.attrs.maxlength),m(".wpglobus-dialog .ui-dialog-title").text(e)},close:function(){f.runCallback(f.option.dialog.close),f.form[0].reset()}}),attachListener:function(){m(document).on("click",f.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");f.order.action="save_post_meta_settings",f.order.post_type=WPGlobusAdmin.data.post_type,f.order.checked=a.prop("checked"),f.order.id=a.attr("id"),f.order.meta_key=a.data("meta-key"),f.ajax(f.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",f.option.listenClass,function(a){f.element=m(this),f.id=f.element.data("source-id"),""==f.id?(f.id=f.element.data("nodename")+'[name="'+f.element.data("source-name")+'"]',f.wpglobus_id="#wpglobus-"+f.convertToId(f.element.data("source-name"))):(f.wpglobus_id="#wpglobus-"+f.id,f.id="#"+f.id),f.clicks++,1==f.clicks&&setTimeout(function(){if(1==f.clicks)f.onClick(a);else{var t=m(f.id);t.hasClass("hidden")?t.removeClass("hidden").attr("style","display:block;"):t.addClass("hidden").attr("style","display:none;")}f.clicks=0},200)}),f.form=f.dialog.find("form#wpglobus-dialog-form").on("submit",function(t){t.preventDefault(),f.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===f.element.data("dialog-title")||""==f.element.data("dialog-title")?f.dialogTitle=f.option.dialogTitle:f.dialogTitle=f.element.data("dialog-title"),void 0!==f.id&&(f.attrs.maxlength=m(f.id).attr("maxlength")),f.source=f.element.data("source-value"),void 0===f.source&&(f.source=m(f.id).val(),"ajax"==f.request||(f.value=WPGlobusCore.getTranslations(f.source))),f.option.dialog=m.extend({},f.option.dialogOptions,m(f.wpglobus_id).data("dialog")),""!=f.option.dialog.title&&(f.dialogTitle=f.option.dialog.title),m.each(f.value,function(t,a){var e=m("#wpglobus-dialog-"+t);e.val(a),e.attr("placeholder",WPGlobusCore.TextFilter(f.option.dialog.placeholder,t,"RETURN_IN_DEFAULT_LANGUAGE"))}),m("#wpglobus-dialog-form-footer").html(f.option.dialog.formFooter),f.runCallback(f.option.dialog.beforeOpen),f.dialog.dialog("open")},runCallback:function(t){if("object"==typeof t){var 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]])}else"string"==typeof t&&"function"==typeof window[t]&&window[t]()}}}(jQuery),jQuery(document).ready(function(){"use strict";var t,c;window.WPGlobusAdminApp=(t=window.WPGlobusAdminApp||{},c=jQuery,t.App=function(t){void 0===window.WPGlobusAdminApp&&(this.config={debug:!1,version:WPGlobusAdmin.version},this.status="ok","undefined"==typeof WPGlobusAdmin?(this.status="error",this.config.debug&&console.log("WPGlobus: error options loading")):this.config.debug&&console.dir(WPGlobusAdmin),this.config.disable_first_language=['<div id="disable_first_language" style="display:block;" class="redux-field-errors notice-red">',"<strong>","<span>&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=c(".wpglobus-addons-group a").data("key");if(void 0!==t)if(0<=window.location.search.indexOf("page=wpglobus_options&tab="+t))WPGlobusCoreData.multisite?window.location=WPGlobusCoreData.pluginInstallLocation.multisite:window.location=WPGlobusCoreData.pluginInstallLocation.single;else{var a=c("#toplevel_page_wpglobus_options li").eq(t+1);WPGlobusCoreData.multisite?c(a).find("a").attr("href",WPGlobusCoreData.pluginInstallLocation.multisite).attr("onclick","window.location=jQuery(this).attr('href');return false;"):c(a).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){if(void 0!==WPGlobusAdmin.data.has_items&&WPGlobusAdmin.data.has_items){var 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))});var 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())});var t={action:"get_titles"};t.type=n,t.taxonomy=void 0!==WPGlobusAdmin.data.taxonomy&&WPGlobusAdmin.data.taxonomy,t.title=i,c.ajax({type:"POST",url:WPGlobusAdmin.ajaxurl,data:{action:WPGlobusAdmin.process_ajax,order:t},dataType:"json"}).done(function(t){WPGlobusAdmin.qedit_titles=t.qedit_titles,c.each(t.bulkedit_post_titles,function(t,a){c("#inline_"+t+" .post_title").text(a[WPGlobusAdmin.data.language].name)})}).fail(function(t){}).always(function(t,a){}),c("body").on("change",".wpglobus-quick-edit-title",function(){var n="",i=[];c(".wpglobus-quick-edit-title").each(function(t,a){var e=c(a),o=e.data("language");""!==e.val()&&(n=WPGlobusCore.getString(n,e.val(),o)),WPGlobusAdmin.qedit_titles[l][o].name=e.val(),i[t]=o});var t=c(document).triggerHandler("wpglobus_get_translations",{string:n,lang:i,id:l});void 0!==t&&(n=t),c("input.ptitle").eq(0).attr("value",n),WPGlobusAdmin.qedit_titles[l].source=n}),void 0!==WPGlobusAdmin.data.tags&&c.each(WPGlobusAdmin.data.tags,function(t,a){WPGlobusAdmin.data.value[a].post_id={}}),c("button.save, input#bulk_edit").on("mouseenter",function(t){void 0!==WPGlobusAdmin.data.tags&&("bulk_edit"==t.currentTarget.id?c("input#bulk_edit").unbind("click"):c("button.save").unbind("click"),c("button.save, input#bulk_edit").on("click",function(a){var t=c.when(),e=(c(this),c.Deferred());e.resolve(function(t){t.next(".spinner").css({visibility:"visible"}),"bulk_edit"!=a.currentTarget.id&&c.ajaxSetup({async:!1});var o,n,i,l=t.parents("tr"),s=l.attr("id").replace("edit-","");c.each(WPGlobusAdmin.data.tags,function(t,a){if(0==(o=l.find("textarea[name='"+WPGlobusAdmin.data.names[a]+"']")).length)return!0;WPGlobusAdmin.data.value[a].post_id[s]=o.val(),n=WPGlobusAdmin.data.value[a].post_id[s].split(","),i=[];for(var e=0;e<n.length;e++)n[e]=n[e].trim(" "),""!=n[e]&&(void 0===WPGlobusAdmin.data.tag[a][n[e]]?i[e]=n[e]:i[e]=WPGlobusAdmin.data.tag[a][n[e]]);o.val(i.join(", "))})}(c(this))),t=t.then(function(){return c.when(e.done())}).then(function(){"bulk_edit"!=a.currentTarget.id&&setTimeout(function(){inlineEditPost.save(l),c.ajaxSetup({async:!0})},50)})}))}),c("#the-list").on("click","a.editinline",function(){var t=c(this);if(o=t.parents("tr").attr("id"),"post"===n)l=o.replace("post-","");else{if("taxonomy"!==n)return;l=o.replace("tag-","")}"post"===n&&void 0!==WPGlobusAdmin.data.tags&&c.each(WPGlobusAdmin.data.tags,function(t,a){if(""!=WPGlobusAdmin.data.value[a]){var e,o=c("#edit-"+l+' textarea[name="'+WPGlobusAdmin.data.names[a]+'"]').val();void 0!==o&&(e=o.split(","),c.each(e,function(t,a){o=o.replace(a,WPGlobusCore.TextFilter(a,WPGlobusCoreData.language))}),c("#edit-"+l+' textarea[name="'+WPGlobusAdmin.data.names[a]+'"]').val(o))}});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,i=c("#"+(e=a)),l=i.clone(),s=i.attr("name"),d="wpglobus-element wpglobus-element_"+e+" wpglobus-element_"+o+" wpglobus-translatable",n=(n=document.getElementById(e)).nodeName,c(l).attr("id",e+"_"+o),c(l).attr("name",s+"_"+o),o!==WPGlobusCoreData.default_language&&(d+=" hidden"),c(l).attr("class",d),c(l).attr("data-save-to",e),c(l).attr("data-language",o),"INPUT"==n?c(l).attr("value",c("#wpglobus-link-tab-"+o).data(e)):"TEXTAREA"==n&&c(l).text(c("#wpglobus-link-tab-"+o).data(e)),i.addClass("hidden"),0==c(".wpglobus-element_"+e).length?c(l).insertAfter(i):c(l).insertAfter(c(".wpglobus-element_"+e).last())})}),c(".wpglobus-taxonomy-tabs").insertAfter("#ajax-response"),c(".wrap").tabs(),c("body").on("click",".wpglobus-taxonomy-tabs li",function(t){var a=c(this).data("language");c(".wpglobus-element").addClass("hidden"),c(".wpglobus-element_"+a).removeClass("hidden")}),c(".wpglobus-element").on("change",function(){var n=c(this).data("save-to"),i="";c(".wpglobus-element").each(function(t,a){var e=c(a),o=e.val();e.data("save-to")==n&&""!==o&&(i+=WPGlobusCore.addLocaleMarks(o,e.data("language")))}),c("#"+n).val(i)}),c(WPGlobusAdmin.data.multilingualSlug.title).insertAfter(".term-slug-wrap th label")},navMenus:function(){var e,o,n="#menu-to-edit .menu-item",i=function(){o!==c(n).length&&(clearInterval(e),c(n).each(function(t,a){var e=c(a);if(!e.hasClass("wpglobus-menu-item")){var l=c(a).attr("id");c.each(["input.edit-menu-item-title","input.edit-menu-item-attr-title"],function(t,a){var e=c("#"+l+" "+a),o=c(e);if(!o.hasClass("wpglobus-hidden")){o.addClass("wpglobus-hidden"),o.css("display","none");var n=o.parent("label"),i=o.parents("p");c(i).css("height","80px"),c(n).append('<div style="color:#f00;">'+WPGlobusAdmin.i18n.save_nav_menu+"</div>")}}),e.addClass("wpglobus-menu-item")}}))};c.ajaxSetup({beforeSend:function(t,a){void 0!==a.data&&0<=a.data.indexOf("action=add-menu-item")&&(o=c(n).length,e=setInterval(i,500))}}),c(n).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 e="#postdivrich",o=!0,a="#post-body-content";if(!1===WPGlobusAdmin.data.support.editor&&(o=!(e="#titlediv")),!1===WPGlobusAdmin.data.support.title&&(o=!1),c(a).prepend(c(".wpglobus-post-body-tabs-list")),c.each(WPGlobusAdmin.tabs,function(t,a){"default"===a?(c(e).wrap('<div id="tab-default"></div>'),o&&c(c("#titlediv")).insertBefore(e)):(c(e+"-"+a).wrap('<div id="tab-'+a+'"></div>'),o&&c(c("#titlediv-"+a)).insertBefore(e+"-"+a))}),c(a).addClass("wpglobus-post-body-tabs").tabs({beforeActivate:function(t,a){var e=a.oldTab[0].id.replace("link-tab-",""),o=a.newTab[0].id.replace("link-tab-","");"default"==e&&(e=WPGlobusCoreData.default_language),"default"==o&&(o=WPGlobusCoreData.default_language);var n=c(document).triggerHandler("wpglobus_post_body_tabs",[e,o]);return!(!n&&void 0!==n)}}),c("#title").val(WPGlobusAdmin.title),c("#content").text(WPGlobusAdmin.content),"undefined"!=typeof WPGlobusVendor&&WPGlobusVendor.vendor.WPSEO&&("undefined"!=typeof wpglobus_wpseo?wpglobus_wpseo():"undefined"!=typeof WPGlobusYoastSeo&&("undefined"!=typeof WPGlobusYoastSeoPremium&&WPGlobusYoastSeoPremium&&WPGlobusYoastSeoPremium.init(),WPGlobusYoastSeo.init())),WPGlobusAdmin.data.modify_excerpt){var n=c("#excerpt");n.addClass("hidden").css({display:"none"}),c(WPGlobusAdmin.data.template).insertAfter(n),c("body").on("change",".wpglobus-excerpt",function(){var t=c(this);n.val(WPGlobusCore.getString(n.val(),t.val(),t.data("language")))})}if(void 0!==wp.utils&&void 0!==wp.utils.WordCounter){WPGlobusCoreData.wordCounter={};var l=this,s={};c.each(WPGlobusCoreData.enabled_languages,function(t,a){if(a==WPGlobusCoreData.default_language)return!0;var n,e,i;s[t]="content_"+a,n=jQuery,e=new wp.utils.WordCounter,i=a,WPGlobusCoreData.wordCounter[i]={},WPGlobusCoreData.wordCounter[i].counter=e,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){if(-1!=n.inArray(a.id,s)){var 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)})})}c(document).on("click","#publish, #save-post",function(){if(1<WPGlobusAdmin.data.open_languages.length){c(document).triggerHandler("wpglobus_before_save_post",{content_tabs_id:a});var t,e=c("#title").val(),o="",n="";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",a,function(t,a){WPGlobusAdmin.currentTab=a.newTab[0].dataset.language}),c(document).triggerHandler("wpglobus_after_post_edit")},adminCentral:function(){c(".wpglobus-admin-central-tab").css({display:"none"}),1<c(".nav-tab-active").length&&c(".wpglobus-about-wrap .nav-tab-wrapper a").removeClass("nav-tab-active");var e=!0;0==location.hash.indexOf("#")&&c(".wpglobus-about-wrap .nav-tab-wrapper a").each(function(t,a){c(a).attr("href")==location.hash&&(e=!1,c(a).addClass("nav-tab-active"))}),e&&c(".wpglobus-about-wrap .nav-tab-wrapper a").eq(0).addClass("nav-tab-active");var t=c(".wpglobus-about-wrap .nav-tab-active").data("tab-id");""!=t&&c("#"+t).css({display:"block"}),c(document).on("click",".wpglobus-about-wrap .nav-tab",function(t){var a=c(this);a.hasClass("nav-tab-active")||(c(".wpglobus-admin-central-tab").css({display:"none"}),c(".wpglobus-about-wrap .nav-tab").removeClass("nav-tab-active"),a.addClass("nav-tab-active"),""!=a.data("tab-id")&&c("#"+a.data("tab-id")).css({display:"block"}))})},start:function(){var a=this;c("#wpglobus_flags").select2({formatResult:this.format,formatSelection:this.format,minimumResultsForSearch:-1,escapeMarkup:function(t){return t}}),c("body").on("click","#enabled_languages-list li:first input",function(t){return t.preventDefault(),c(".redux-save-warn").css({display:"none"}),c("#enabled_languages-list").find("li:first > input").val("1"),0===c("#disable_first_language").length&&c(a.config.disable_first_language).insertAfter("#info_bar"),!1})},format:function(t){return'<img class="wpglobus_flag" src="'+WPGlobusAdmin.flag_url+t.text+'"/>&nbsp;&nbsp;'+t.text},set_dialog:function(){if(void 0===WPGlobusAdmin.data.customFieldsEnabled||(WPGlobusAdmin.data.customFieldsEnabled=this.parseBool(WPGlobusAdmin.data.customFieldsEnabled),WPGlobusAdmin.data.customFieldsEnabled)){var o,a=!1,n=function(t){var s,d,u,r="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(""),c(void 0===t?"#the-list tr":"#the-list tr#"+t).each(function(){var t,a,e,o=c(this),n=o.attr("id"),i=o.find("textarea"),l=r;if(void 0===(s=i.attr("id")))return!0;e=c("#"+n+"-key").val(),t=c("#"+s).clone(),c(i).addClass("wpglobus-dialog-field-source hidden"),a=i.attr("name"),c(t).attr("id","wpglobus-"+s),c(t).attr("name","wpglobus-"+a),c(t).attr("data-source-id",s),c(t).attr("class","wpglobus-dialog-field"),c(t).val(WPGlobusCore.TextFilter(c(i).val(),WPGlobusCoreData.language)),c(t).insertAfter(i),d=(d=u.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}}/,""),r+" wpglobus_dialog_start_hidden"):(d=d.replace(/{{checked}}/,"checked"),r),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>")}),!a&&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>'),a=!0)};n(),c("body").on("change",".wpglobus-dialog-field",function(){var e,o,n=c(this),t="#"+n.data("source-id"),i="";void 0!==t&&(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-admin.min.js CHANGED
@@ -1 +1 @@
1
- var WPGlobusCore,WPGlobusDialogApp;!function(i){var d;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;v=WPGlobusDialogApp={option:{listenClass:".wpglobus_dialog_start",settingsClass:".wpglobus_dialog_settings",dialogTabs:"#wpglobus-dialog-tabs",dialogTitle:"",customData:null,callback:function(){}},form:void 0,element:void 0,element_by:"id",id:"",clone_id:"",wpglobus_id:"",type:"textarea",source:"",order:{},value:{},request:"core",attrs:{},dialogTitle:"",trClass:"wpglobus-translatable",startButton:['<span id="wpglobus-dialog-start-{{clone_id}}" ','style="{{style}}" ','data-type="control" data-dialog-title="{{title}}" ','data-source-type="" data-source-id="{{id}}" data-source-name="{{name}}" ','data-nodename="{{nodename}}"',"{{sbTitle}} ",'class="{{classes}}"></span>'].join(""),startButtonClass:"wpglobus_dialog_start wpglobus_dialog_icon",clicks:0,init:function(t){v.option=m.extend(v.option,t),m(v.option.dialogTabs).tabs(),v.dialogTitle=v.option.dialogTitle,this.attachListener(),null!=v.option.customData&&void 0!==v.option.customData.addElements&&m.each(v.option.customData.addElements,function(t,a){v.addElement(a)})},convertToId:function(t){return t=(t=t.replace(/\]/g,"")).replace(/\[/g,"-")},addElement:function(t){var a={id:null,dialogTitle:"",style:"",styleTextareaWrapper:"",sbTitle:"",onChangeClass:""};if("string"==typeof t)a.id=t;else{if("object"!=typeof t)return;a=m.extend(a,t)}var e,o,n,i=null,l=null,s=null,d=null,u=v.startButton,r="";if(v.element_by="id",null===(d=document.getElementById(a.id))?(v.element_by="name",d=document.getElementsByName(a.id)):r=(r=d.nodeName).toLowerCase(),0!=d.length&&(l=a.id,"id"==v.element_by?i=m("#"+l):(r=(r=d[0].nodeName).toLowerCase(),i=m(r+'[name="'+l+'"]')),s="undefined"===i.attr("name")?l:i.attr("name"),v.clone_id=v.convertToId(l),-1==s.indexOf("wpglobus")&&-1==v.clone_id.indexOf("wpglobus")&&!(0<m("#wpglobus-"+v.clone_id).length||0<m(r+'[name="wpglobus-'+s+'"]').length))){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.text())[WPGlobusCoreData.language],e.text(o),e.attr("data-nodename","textarea"),""==a.style?e.attr("style",n+";width:95%;float:left;"):e.attr("style",n+";"+a.style)):(o=WPGlobusCore.getTranslations(i.val())[WPGlobusCoreData.language],e.attr("value",o),e.attr("data-nodename","input"),""!=a.style&&e.attr("style",n+";"+a.style)),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=!1;if(""==a.onChangeClass)g="#wpglobus-"+v.clone_id;else{g="."+a.onChangeClass;var p=m._data(m(document)[0],"events");void 0===p?b=!0:void 0!==p.change&&m.each(p.change,function(t,a){if(a.selector==g)return!(b=!0)})}b||m(document).on("change",g,function(){var t=m(this),a=t.data("source-id");a=""==a?t.data("nodename")+'[name="'+t.data("source-name")+'"]':"#"+a,m(a).val(WPGlobusCore.getString(m(a).val(),t.val()))})}},saveDialog:function(){var e,o,n,i="",l="",s="";m(".wpglobus_dialog_textarea").each(function(t,a){e=m(a),o=e.val(),(n=e.data("language"))==WPGlobusAdmin.data.language&&(s=o),""!=o&&(i+=WPGlobusCore.addLocaleMarks(o,n),n==WPGlobusCoreData.default_language&&(l=o))}),i=i.length==l.length+8?l:i,m(v.id).val(i),i=""==s?l:s,m(v.wpglobus_id).val(i)},dialog:m("#wpglobus-dialog-wrapper").dialog({autoOpen:!1,width:650,modal:!0,dialogClass:"wpglobus-dialog",buttons:[{text:"Save",class:"wpglobus-button-save",click:function(){v.saveDialog(),v.dialog.dialog("close")}},{text:"Cancel",class:"wpglobus-button-cancel",click:function(){v.dialog.dialog("close")}}],open:function(){var t=v.dialogTitle;void 0!==v.attrs.maxlength&&(m(".wpglobus_dialog_textarea").attr("maxlength",v.attrs.maxlength),t+=" | maxlength="+v.attrs.maxlength),m(".wpglobus-dialog .ui-dialog-title").text(t)},close:function(){v.form[0].reset()}}),attachListener:function(){m(document).on("click",v.option.settingsClass,function(){m(".wpglobus_dialog_options_wrapper").hasClass("hidden")?m(".wpglobus_dialog_options_wrapper").removeClass("hidden"):m(".wpglobus_dialog_options_wrapper").addClass("hidden")}),m(document).on("click",".wpglobus_dialog_option",function(t){var a=m(this),e=a.data("object");v.order.action="save_post_meta_settings",v.order.post_type=WPGlobusAdmin.data.post_type,v.order.checked=a.prop("checked"),v.order.id=a.attr("id"),v.order.meta_key=a.data("meta-key"),v.ajax(v.order).done(function(t){"ok"==t.result&&("true"==t.checked?m(e).removeClass("wpglobus_dialog_start_hidden"):m(e).addClass("wpglobus_dialog_start_hidden"))}).fail(function(t){}).always(function(t,a){})}),m(document).on("click",v.option.listenClass,function(a){v.element=m(this),v.id=v.element.data("source-id"),""==v.id?(v.id=v.element.data("nodename")+'[name="'+v.element.data("source-name")+'"]',v.wpglobus_id="#wpglobus-"+v.convertToId(v.element.data("source-name"))):(v.wpglobus_id="#wpglobus-"+v.id,v.id="#"+v.id),v.clicks++,1==v.clicks&&setTimeout(function(){if(1==v.clicks)v.onClick(a);else{var t=m(v.id);t.hasClass("hidden")?t.removeClass("hidden").attr("style","display:block;"):t.addClass("hidden").attr("style","display:none;")}v.clicks=0},200)}),v.form=v.dialog.find("form#wpglobus-dialog-form").on("submit",function(t){t.preventDefault(),v.saveDialog()})},ajax:function(t){return m.ajax({type:"POST",url:WPGlobusAdmin.ajaxurl,data:{action:WPGlobusAdmin.process_ajax,order:t},dataType:"json",async:!1})},onClick:function(t){void 0===v.element.data("dialog-title")||""==v.element.data("dialog-title")?v.dialogTitle=v.option.dialogTitle:v.dialogTitle=v.element.data("dialog-title"),void 0!==v.id&&(v.attrs.maxlength=m(v.id).attr("maxlength")),v.source=v.element.data("source-value"),void 0===v.source&&(v.source=m(v.id).val(),"ajax"==v.request||(v.value=WPGlobusCore.getTranslations(v.source))),m.each(v.value,function(t,a){m("#wpglobus-dialog-"+t).val(a)}),v.dialog.dialog("open")}}}(jQuery),jQuery(document).ready(function(){"use strict";var t,c;window.WPGlobusAdminApp=(t=window.WPGlobusAdminApp||{},c=jQuery,t.App=function(t){void 0===window.WPGlobusAdminApp&&(this.config={debug:!1,version:WPGlobusAdmin.version},this.status="ok","undefined"===WPGlobusAdmin?(this.status="error",this.config.debug&&console.log("Error options loading")):this.config.debug&&console.dir(WPGlobusAdmin),this.config.disable_first_language=['<div id="disable_first_language" style="display:block;" class="redux-field-errors notice-red">',"<strong>","<span>&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.admin_init(),c("#content").addClass("wpglobus-editor").attr("data-language",WPGlobusAdmin.data.default_language),c("textarea[id^=content_]").each(function(t,a){var e=c(a).attr("id").replace("content_","");c(a).attr("data-language",e)}),"post.php"===WPGlobusAdmin.page?(this.post_edit(),this.set_dialog(),"undefined"!=typeof WPGlobusAioseop&&WPGlobusAioseop.init()):"menu-edit"===WPGlobusAdmin.page?this.nav_menus():"taxonomy-edit"===WPGlobusAdmin.page?WPGlobusAdmin.data.tag_id&&this.taxonomy_edit():"taxonomy-quick-edit"===WPGlobusAdmin.page?this.quickEdit("taxonomy"):"edit.php"===WPGlobusAdmin.page?this.quickEdit("post"):"options-general.php"==WPGlobusAdmin.page?this.options_general():"widgets.php"==WPGlobusAdmin.page?(WPGlobusWidgets.init(),WPGlobusDialogApp.init({dialogTitle:"Edit text"})):"wpglobus_options"==WPGlobusAdmin.page?this.start():"wpglobusAdminCentral"==WPGlobusAdmin.page?this.adminCentral():WPGlobusDialogApp.init({customData:WPGlobusCoreData.page_custom_data})},parseBool:function(t){return!/^(false|0)$/i.test(t)&&!!t},getCurrentTab:function(){return c(".wpglobus-post-body-tabs-list .ui-tabs-active").data("language")},admin_init:function(){var t=c(".wpglobus-addons-group a").data("key");if(void 0!==t)if(0<=window.location.search.indexOf("page=wpglobus_options&tab="+t))WPGlobusCoreData.multisite?window.location=WPGlobusCoreData.pluginInstallLocation.multisite:window.location=WPGlobusCoreData.pluginInstallLocation.single;else{var a=c("#toplevel_page_wpglobus_options li").eq(t+1);WPGlobusCoreData.multisite?c(a).find("a").attr("href",WPGlobusCoreData.pluginInstallLocation.multisite).attr("onclick","window.location=jQuery(this).attr('href');return false;"):c(a).find("a").attr("href",WPGlobusCoreData.pluginInstallLocation.single).attr("onclick","window.location=jQuery(this).attr('href');return false;")}},options_general:function(){var o=c("#blogname"),t=c("body");o.addClass("hidden"),c("#wpglobus-blogname").insertAfter(o).removeClass("hidden"),t.on("blur",".wpglobus-blogname",function(){c(".wpglobus-blogname").each(function(t,a){var e=c(a);o.val(WPGlobusCore.getString(o.val(),e.val(),e.data("language")))})});var n=c("#blogdescription");n.addClass("hidden"),c("#wpglobus-blogdescription").insertAfter(n).removeClass("hidden"),t.on("blur",".wpglobus-blogdesc",function(){c(".wpglobus-blogdesc").each(function(t,a){var e=c(a);n.val(WPGlobusCore.getString(n.val(),e.val(),e.data("language")))})})},quickEdit:function(n){if(void 0!==WPGlobusAdmin.data.has_items&&WPGlobusAdmin.data.has_items){var 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))});var 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())});var t={action:"get_titles"};t.type=n,t.taxonomy=void 0!==WPGlobusAdmin.data.taxonomy&&WPGlobusAdmin.data.taxonomy,t.title=i,c.ajax({type:"POST",url:WPGlobusAdmin.ajaxurl,data:{action:WPGlobusAdmin.process_ajax,order:t},dataType:"json"}).done(function(t){WPGlobusAdmin.qedit_titles=t.qedit_titles,c.each(t.bulkedit_post_titles,function(t,a){c("#inline_"+t+" .post_title").text(a[WPGlobusAdmin.data.language].name)})}).fail(function(t){}).always(function(t,a){}),c("body").on("change",".wpglobus-quick-edit-title",function(){var n="",i=[];c(".wpglobus-quick-edit-title").each(function(t,a){var e=c(a),o=e.data("language");""!==e.val()&&(n=WPGlobusCore.getString(n,e.val(),o)),WPGlobusAdmin.qedit_titles[l][o].name=e.val(),i[t]=o});var t=c(document).triggerHandler("wpglobus_get_translations",{string:n,lang:i,id:l});void 0!==t&&(n=t),c("input.ptitle").eq(0).attr("value",n),WPGlobusAdmin.qedit_titles[l].source=n}),void 0!==WPGlobusAdmin.data.tags&&c.each(WPGlobusAdmin.data.tags,function(t,a){WPGlobusAdmin.data.value[a].post_id={}}),c("button.save, input#bulk_edit").on("mouseenter",function(t){void 0!==WPGlobusAdmin.data.tags&&("bulk_edit"==t.currentTarget.id?c("input#bulk_edit").unbind("click"):c("button.save").unbind("click"),c("button.save, input#bulk_edit").on("click",function(a){console.log("Start Updating");var t=c.when(),e=(c(this),c.Deferred());e.resolve(function(t){t.next(".spinner").css({visibility:"visible"}),"bulk_edit"!=a.currentTarget.id&&c.ajaxSetup({async:!1});var o,n,i,l=t.parents("tr"),s=l.attr("id").replace("edit-","");c.each(WPGlobusAdmin.data.tags,function(t,a){if(0==(o=l.find("textarea[name='"+WPGlobusAdmin.data.names[a]+"']")).length)return!0;WPGlobusAdmin.data.value[a].post_id[s]=o.val(),n=WPGlobusAdmin.data.value[a].post_id[s].split(","),i=[];for(var e=0;e<n.length;e++)n[e]=n[e].trim(" "),""!=n[e]&&(void 0===WPGlobusAdmin.data.tag[a][n[e]]?i[e]=n[e]:i[e]=WPGlobusAdmin.data.tag[a][n[e]]);o.val(i.join(", "))})}(c(this))),t=t.then(function(){return c.when(e.done())}).then(function(){"bulk_edit"!=a.currentTarget.id&&setTimeout(function(){inlineEditPost.save(l),c.ajaxSetup({async:!0})},50)})}))}),c("#the-list").on("click","a.editinline",function(){var t=c(this);if(o=t.parents("tr").attr("id"),"post"===n)l=o.replace("post-","");else{if("taxonomy"!==n)return;l=o.replace("tag-","")}"post"===n&&void 0!==WPGlobusAdmin.data.tags&&c.each(WPGlobusAdmin.data.tags,function(t,a){if(""!=WPGlobusAdmin.data.value[a]){var e,o=c("#edit-"+l+' textarea[name="'+WPGlobusAdmin.data.names[a]+'"]').val();void 0!==o&&(e=o.split(","),c.each(e,function(t,a){o=o.replace(a,WPGlobusCore.TextFilter(a,WPGlobusCoreData.language))}),c("#edit-"+l+' textarea[name="'+WPGlobusAdmin.data.names[a]+'"]').val(o))}});var a=c("#edit-"+l+" input.ptitle").eq(0),e=a.parents("label");a.val(WPGlobusAdmin.qedit_titles[l].source),a.addClass("hidden"),c(WPGlobusAdmin.data.template).insertAfter(e),void 0===WPGlobusAdmin.qedit_titles[l]&&(WPGlobusAdmin.qedit_titles[l]={},WPGlobusAdmin.qedit_titles[l].source=c("#"+o+" .name a.row-title").text(),c(WPGlobusAdmin.data.enabled_languages).each(function(t,a){WPGlobusAdmin.qedit_titles[l][a]={},a==WPGlobusAdmin.data.default_language?WPGlobusAdmin.qedit_titles[l][a].name=WPGlobusAdmin.qedit_titles[l].source:WPGlobusAdmin.qedit_titles[l][a].name="",WPGlobusAdmin.qedit_titles[l][a].description=""})),c(".wpglobus-quick-edit-title").each(function(t,a){var e=c(a),o=e.data("language");e.attr("id",o+l),void 0!==WPGlobusAdmin.qedit_titles[l][o]&&(WPGlobusAdmin.qedit_titles[l][o].name=WPGlobusAdmin.qedit_titles[l][o].name.replace(/\\\'/g,"'"),WPGlobusAdmin.qedit_titles[l][o].name=WPGlobusAdmin.qedit_titles[l][o].name.replace(/\\\"/g,'"'),e.attr("value",WPGlobusAdmin.qedit_titles[l][o].name),WPGlobusAdmin.qedit_titles[l].source=WPGlobusCore.getString(WPGlobusAdmin.qedit_titles[l].source,WPGlobusAdmin.qedit_titles[l][o].name,o))}),c("input.ptitle").eq(0).attr("value",WPGlobusAdmin.qedit_titles[l].source)})}},taxonomy_edit:function(){var a=[];a[0]="name",a[1]="description",c.each(WPGlobusCoreData.enabled_languages,function(t,u){c.each(a,function(t,a){var e,o,n,i,l,s,d;o=u,i=c("#"+(e=a)),l=i.clone(),s=i.attr("name"),d="wpglobus-element wpglobus-element_"+e+" wpglobus-element_"+o+" wpglobus-translatable",n=(n=document.getElementById(e)).nodeName,c(l).attr("id",e+"_"+o),c(l).attr("name",s+"_"+o),o!==WPGlobusCoreData.default_language&&(d+=" hidden"),c(l).attr("class",d),c(l).attr("data-save-to",e),c(l).attr("data-language",o),"INPUT"==n?c(l).attr("value",c("#wpglobus-link-tab-"+o).data(e)):"TEXTAREA"==n&&c(l).text(c("#wpglobus-link-tab-"+o).data(e)),i.addClass("hidden"),0==c(".wpglobus-element_"+e).size()?c(l).insertAfter(i):c(l).insertAfter(c(".wpglobus-element_"+e).last())})}),c(".wpglobus-taxonomy-tabs").insertAfter("#ajax-response"),c(".wrap").tabs(),c("body").on("click",".wpglobus-taxonomy-tabs li",function(t){var a=c(this).data("language");c(".wpglobus-element").addClass("hidden"),c(".wpglobus-element_"+a).removeClass("hidden")}),c(".wpglobus-element").on("change",function(){var n=c(this).data("save-to"),i="";c(".wpglobus-element").each(function(t,a){var e=c(a),o=e.val();e.data("save-to")==n&&""!==o&&(i+=WPGlobusCore.addLocaleMarks(o,e.data("language")))}),c("#"+n).val(i)})},nav_menus:function(){var e,o,n="#menu-to-edit .menu-item",i=function(){o!==c(n).size()&&(clearInterval(e),c(n).each(function(t,a){var e=c(a);if(!e.hasClass("wpglobus-menu-item")){var l=c(a).attr("id");c.each(["input.edit-menu-item-title","input.edit-menu-item-attr-title"],function(t,a){var e=c("#"+l+" "+a),o=c(e);if(!o.hasClass("wpglobus-hidden")){o.addClass("wpglobus-hidden"),o.css("display","none");var n=o.parent("label"),i=o.parents("p");c(i).css("height","80px"),c(n).append('<div style="color:#f00;">'+WPGlobusAdmin.i18n.save_nav_menu+"</div>")}}),e.addClass("wpglobus-menu-item")}}))};c.ajaxSetup({beforeSend:function(t,a){void 0!==a.data&&0<=a.data.indexOf("action=add-menu-item")&&(o=c(n).size(),e=setInterval(i,500))}}),c(n).each(function(t,a){var e=c(a).attr("id"),u=e.replace("menu-item-","");c.each(["input.edit-menu-item-title","input.edit-menu-item-attr-title"],function(n,i){var l=c("#"+e+" "+i);l.val()!=WPGlobusAdmin.data.items[u][i].source&&l.val(WPGlobusAdmin.data.items[u][i].source);var s=c("#"+e+" "+i).parents("p"),d=0;c.each(WPGlobusAdmin.data.open_languages,function(t,a){var e=l.clone();e.attr("id",l.attr("id")+"-"+a),e.attr("name",l.attr("id")+"-"+a),e.attr("data-language",a),e.attr("data-item-id",u),e.attr("placeholder",WPGlobusAdmin.data.en_language_name[a]);var o=WPGlobusAdmin.data.items[u][a][i].class;0===n&&a===WPGlobusAdmin.data.default_language?e.attr("class",o+" edit-menu-item-title"):e.attr("class",o),""!=WPGlobusAdmin.data.items[u][a][i].caption?e.attr("value",WPGlobusAdmin.data.items[u][a][i].caption):e.attr("value",""),e.css("margin-bottom","0.6em"),c(s).append(e),d=t}),d=40*(d+1),l.css("display","none").attr("class","").addClass("widefat wpglobus-hidden"),c(s).css("height",d+"px").addClass("wpglobus-menu-item-box")}),c(a).addClass("wpglobus-menu-item")}),c(".menus-move-left, .menus-move-right").each(function(t,a){var e,o=c(a),n=(o.parents("li").attr("id").replace("menu-item-",""),o.attr("title"));void 0!==n&&c.each(WPGlobusAdmin.data.post_titles,function(t,a){0<=n.indexOf(t)&&(e=n.replace(t,a),o.attr("title",e),o.text(e))})}),c(".edit-menu-item-title").trigger("change"),wpNavMenu.refreshAdvancedAccessibility(),wpNavMenu.menusChanged=!1,c(".wpglobus-menu-item").on("change",function(){var t,a,e=c(this),o=e.data("item-id");e.hasClass("wpglobus-item-title")&&(t=WPGlobusCore.getString(c("input#edit-menu-item-title-"+o).val(),e.val(),e.data("language")),void 0!==(a=c(document).triggerHandler("wpglobus_get_menu_translations",{string:t,lang:WPGlobusCoreData.open_languages,id:o,type:"input.edit-menu-item-title"}))&&(t=a),c("input#edit-menu-item-title-"+o).val(t)),e.hasClass("wpglobus-item-attr")&&(t=WPGlobusCore.getString(c("input#edit-menu-item-attr-title-"+o).val(),e.val(),e.data("language")),void 0!==(a=c(document).triggerHandler("wpglobus_get_menu_translations",{string:t,lang:WPGlobusCoreData.open_languages,id:o,type:"input.edit-menu-item-attr-title"}))&&(t=a),c("input#edit-menu-item-attr-title-"+o).val(t))})},post_edit:function(){c(document).on("heartbeat-send",function(t,o){void 0!==o.wp_autosave&&(o.wpglobus_heartbeat="wpglobus",c.each(WPGlobusAdmin.data.open_languages,function(t,a){var e=c("#title_"+a).val()||"";""!=(e=c.trim(e))&&(o.wp_autosave["post_title_"+a]=e),e=c("#content_"+a).val()||"",""!=(e=c.trim(e))&&(o.wp_autosave["content_"+a]=e)}))});var e="#postdivrich",o=!0,a="#post-body-content";if(!1===WPGlobusAdmin.data.support.editor&&(o=!(e="#titlediv")),!1===WPGlobusAdmin.data.support.title&&(o=!1),c(a).prepend(c(".wpglobus-post-body-tabs-list")),c.each(WPGlobusAdmin.tabs,function(t,a){"default"===a?(c(e).wrap('<div id="tab-default"></div>'),o&&c(c("#titlediv")).insertBefore(e)):(c(e+"-"+a).wrap('<div id="tab-'+a+'"></div>'),o&&c(c("#titlediv-"+a)).insertBefore(e+"-"+a))}),c(a).addClass("wpglobus-post-body-tabs").tabs({beforeActivate:function(t,a){var e=a.oldTab[0].id.replace("link-tab-",""),o=a.newTab[0].id.replace("link-tab-","");"default"==e&&(e=WPGlobusCoreData.default_language),"default"==o&&(o=WPGlobusCoreData.default_language);var n=c(document).triggerHandler("wpglobus_post_body_tabs",[e,o]);return!(!n&&void 0!==n)}}),c("#title").val(WPGlobusAdmin.title),c("#content").text(WPGlobusAdmin.content),"undefined"!=typeof WPGlobusVendor&&WPGlobusVendor.vendor.WPSEO&&("undefined"!=typeof wpglobus_wpseo?wpglobus_wpseo():"undefined"!=typeof WPGlobusYoastSeo&&WPGlobusYoastSeo.init()),WPGlobusAdmin.data.modify_excerpt){var n=c("#excerpt");n.addClass("hidden").css({display:"none"}),c(WPGlobusAdmin.data.template).insertAfter(n),c("body").on("change",".wpglobus-excerpt",function(){var t=c(this);n.val(WPGlobusCore.getString(n.val(),t.val(),t.data("language")))})}if(void 0!==wp.utils&&void 0!==wp.utils.WordCounter){WPGlobusCoreData.wordCounter={};var i=this;c.each(WPGlobusCoreData.enabled_languages,function(t,a){if(a==WPGlobusCoreData.default_language)return!0;var e,o,n;e=jQuery,o=new wp.utils.WordCounter,n=a,WPGlobusCoreData.wordCounter[n]={},WPGlobusCoreData.wordCounter[n].counter=o,e(function(){function o(t){var a,e;"object"==typeof t&&(t="tinymce"==t?i.getCurrentTab():t.target.id.replace("content_","")),void 0!==WPGlobusCoreData.wordCounter[t]&&(a=!WPGlobusCoreData.wordCounter[t].contentEditor||WPGlobusCoreData.wordCounter[t].contentEditor.isHidden()?WPGlobusCoreData.wordCounter[t].content.val():WPGlobusCoreData.wordCounter[t].contentEditor.getContent({format:"raw"}),(e=WPGlobusCoreData.wordCounter[t].counter.count(a))!==WPGlobusCoreData.wordCounter[t].prevCount&&WPGlobusCoreData.wordCounter[t].count.text(e),WPGlobusCoreData.wordCounter[t].prevCount=e)}WPGlobusCoreData.wordCounter[n].content=e("#content_"+n),WPGlobusCoreData.wordCounter[n].count=e("#wp-word-count-"+n).find(".word-count-"+n),WPGlobusCoreData.wordCounter[n].prevCount=0,e(document).on("tinymce-editor-init",function(t,a){if(-1!=a.id.indexOf("content_")){var e=a.id.replace("content_","");(WPGlobusCoreData.wordCounter[e].contentEditor=a).on("nodechange keyup",_.debounce(o,1e3))}}),WPGlobusCoreData.wordCounter[n].content.on("input keyup",_.debounce(o,1e3)),o(n)})})}if("undefined"!=typeof wpWordCount){var l=0,t=WPGlobusCoreData.open_languages,s=this.$document,d={};t.shift(),c.each(WPGlobusCoreData.open_languages,function(t,a){d[a]=0});var u={settings:{strip:/<[a-zA-Z\/][^<>]*>/g,clean:/[0-9.(),;:!?%#$¿'"_+=\\/-]+/g,w:/\S\s+/g,c:/\S/g},block:d,wc:function(t,a,e){var o,n=this,i=0;o=a==WPGlobusCoreData.default_language?c(".word-count"):c(".word-count-"+a),void 0===e&&(e=wordCountL10n.type),"w"!==e&&"c"!==e&&(e="w"),n.block[a]||(n.block[a]=1,setTimeout(function(){t&&(t=(t=t.replace(n.settings.strip," ").replace(/&nbsp;|&#160;/gi," ")).replace(n.settings.clean,"")).replace(n.settings[e],function(){i++}),o.html(i.toString()),setTimeout(function(){n.block[a]=0},2e3)},1))}};s.bind("wpglobuscountwords",function(t,a,e){u.wc(a,e)}),c.each(t,function(t,e){var o=c("#content_"+e);s.triggerHandler("wpglobuscountwords",[o.val(),e]),o.keyup(function(t){var a=t.keyCode||t.charCode;return a==l||(13!=a&&8!=l&&46!=l||s.triggerHandler("wpglobuscountwords",[o.val(),e]),l=a),!0})}),c(document).triggerHandler("wpglobuscountwords",[c("#content").val(),WPGlobusCoreData.default_language])}c("body").on("click","#publish, #save-post",function(){if(1<WPGlobusAdmin.data.open_languages.length){c(document).triggerHandler("wpglobus_before_save_post",{content_tabs_id:a});var t,e=c("#title").val(),o="",n="";0==e.length&&(t=WPGlobusAdmin.data.open_languages.indexOf(WPGlobusAdmin.data.default_language),WPGlobusAdmin.data.open_languages.splice(t,1),c(WPGlobusAdmin.data.open_languages).each(function(t,a){n=0==t?"":"-",0<(e=c("#title_"+a).val()).length&&(0==o.length&&(n=""),o=o+n+e)})),0<o.length&&c("#title").val(o)}void 0===WPGlobusAdmin.data.tagsdiv||WPGlobusAdmin.data.tagsdiv.length<1||c(WPGlobusAdmin.data.tagsdiv).each(function(t,a){if(0==c("#"+a).size())return!0;var e=a.replace("tagsdiv-","");if("undefined"===e)return!0;if(0==c("#tax-input-"+e).size())return!0;var o,n=[];c("#tagsdiv-"+e+" .tagchecklist span").each(function(t,a){o=(o=c(a).text()).replace("X","").trim(" "),void 0===WPGlobusAdmin.data.tag[e][o]?n[t]=o:n[t]=WPGlobusAdmin.data.tag[e][o]}),c("#tax-input-"+e).val(n.join(", "))})}),c(".ui-state-default").on("click",function(){"link-tab-default"===c(this).attr("id")&&(c(window).scrollTop(c(window).scrollTop()+1),c(window).scrollTop(c(window).scrollTop()-1))})},adminCentral:function(){c(".wpglobus-admin-central-tab").css({display:"none"}),1<c(".nav-tab-active").length&&c(".wpglobus-about-wrap .nav-tab-wrapper a").removeClass("nav-tab-active");var e=!0;0==location.hash.indexOf("#")&&c(".wpglobus-about-wrap .nav-tab-wrapper a").each(function(t,a){c(a).attr("href")==location.hash&&(e=!1,c(a).addClass("nav-tab-active"))}),e&&c(".wpglobus-about-wrap .nav-tab-wrapper a").eq(0).addClass("nav-tab-active");var t=c(".wpglobus-about-wrap .nav-tab-active").data("tab-id");""!=t&&c("#"+t).css({display:"block"}),c(document).on("click",".wpglobus-about-wrap .nav-tab",function(t){var a=c(this);a.hasClass("nav-tab-active")||(c(".wpglobus-admin-central-tab").css({display:"none"}),c(".wpglobus-about-wrap .nav-tab").removeClass("nav-tab-active"),a.addClass("nav-tab-active"),""!=a.data("tab-id")&&c("#"+a.data("tab-id")).css({display:"block"}))})},start:function(){var a=this;c("#wpglobus_flags").select2({formatResult:this.format,formatSelection:this.format,minimumResultsForSearch:-1,escapeMarkup:function(t){return t}}),c("body").on("click","#enabled_languages-list li:first input",function(t){return t.preventDefault(),c(".redux-save-warn").css({display:"none"}),c("#enabled_languages-list").find("li:first > input").val("1"),0===c("#disable_first_language").length&&c(a.config.disable_first_language).insertAfter("#info_bar"),!1})},format:function(t){return'<img class="wpglobus_flag" src="'+WPGlobusAdmin.flag_url+t.text+'"/>&nbsp;&nbsp;'+t.text},set_dialog:function(){if(void 0===WPGlobusAdmin.data.customFieldsEnabled||(WPGlobusAdmin.data.customFieldsEnabled=this.parseBool(WPGlobusAdmin.data.customFieldsEnabled),WPGlobusAdmin.data.customFieldsEnabled)){var o,a=!1,n=function(t){var s,d,u,r="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(""),c(void 0===t?"#the-list tr":"#the-list tr#"+t).each(function(){var t,a,e,o=c(this),n=o.attr("id"),i=o.find("textarea"),l=r;if(void 0===(s=i.attr("id")))return!0;e=c("#"+n+"-key").val(),t=c("#"+s).clone(),c(i).addClass("wpglobus-dialog-field-source hidden"),a=i.attr("name"),c(t).attr("id","wpglobus-"+s),c(t).attr("name","wpglobus-"+a),c(t).attr("data-source-id",s),c(t).attr("class","wpglobus-dialog-field"),c(t).val(WPGlobusCore.TextFilter(c(i).val(),WPGlobusCoreData.language)),c(t).insertAfter(i),d=(d=u.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"):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}}/,""),l=r+" wpglobus_dialog_start_hidden"):(d=d.replace(/{{checked}}/,"checked"),l=r),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>")}),!a&&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>'),a=!0)};n(),c("body").on("change",".wpglobus-dialog-field",function(){var e,o,n=c(this),t="#"+n.data("source-id"),i="";void 0!==t&&(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;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;v=WPGlobusDialogApp={option:{listenClass:".wpglobus_dialog_start",settingsClass:".wpglobus_dialog_settings",dialogTabs:"#wpglobus-dialog-tabs",dialogTitle:"",customData:null,callback:function(){}},form:void 0,element:void 0,element_by:"id",id:"",clone_id:"",wpglobus_id:"",type:"textarea",source:"",order:{},value:{},request:"core",attrs:{},dialogTitle:"",trClass:"wpglobus-translatable",startButton:['<span id="wpglobus-dialog-start-{{clone_id}}" ','style="{{style}}" ','data-type="control" data-dialog-title="{{title}}" ','data-source-type="" data-source-id="{{id}}" data-source-name="{{name}}" ','data-nodename="{{nodename}}"',"{{sbTitle}} ",'class="{{classes}}"></span>'].join(""),startButtonClass:"wpglobus_dialog_start wpglobus_dialog_icon",clicks:0,init:function(t){v.option=m.extend(v.option,t),m(v.option.dialogTabs).tabs(),v.dialogTitle=v.option.dialogTitle,this.attachListener(),null!=v.option.customData&&void 0!==v.option.customData.addElements&&m.each(v.option.customData.addElements,function(t,a){v.addElement(a)})},convertToId:function(t){return t=(t=t.replace(/\]/g,"")).replace(/\[/g,"-")},addElement:function(t){var a={id:null,dialogTitle:"",style:"",styleTextareaWrapper:"",sbTitle:"",onChangeClass:""};if("string"==typeof t)a.id=t;else{if("object"!=typeof t)return;a=m.extend(a,t)}var e,o,n,i=null,l=null,s=null,d=null,u=v.startButton,r="";if(v.element_by="id",null===(d=document.getElementById(a.id))?(v.element_by="name",d=document.getElementsByName(a.id)):r=(r=d.nodeName).toLowerCase(),0!=d.length&&(l=a.id,s="undefined"===(i="id"==v.element_by?m("#"+l):(r=(r=d[0].nodeName).toLowerCase(),m(r+'[name="'+l+'"]'))).attr("name")?l:i.attr("name"),v.clone_id=v.convertToId(l),-1==s.indexOf("wpglobus")&&-1==v.clone_id.indexOf("wpglobus")&&!(0<m("#wpglobus-"+v.clone_id).length||0<m(r+'[name="wpglobus-'+s+'"]').length))){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.text())[WPGlobusCoreData.language],e.text(o),e.attr("data-nodename","textarea"),""==a.style?e.attr("style",n+";width:95%;float:left;"):e.attr("style",n+";"+a.style)):(o=WPGlobusCore.getTranslations(i.val())[WPGlobusCoreData.language],e.attr("value",o),e.attr("data-nodename","input"),""!=a.style&&e.attr("style",n+";"+a.style)),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=!1;if(""==a.onChangeClass)g="#wpglobus-"+v.clone_id;else{g="."+a.onChangeClass;var p=m._data(m(document)[0],"events");void 0===p?b=!0:void 0!==p.change&&m.each(p.change,function(t,a){if(a.selector==g)return!(b=!0)})}b||m(document).on("change",g,function(){var t=m(this),a=t.data("source-id");a=""==a?t.data("nodename")+'[name="'+t.data("source-name")+'"]':"#"+a,m(a).val(WPGlobusCore.getString(m(a).val(),t.val()))})}},saveDialog:function(){var e,o,n,i="",l="",s="";m(".wpglobus_dialog_textarea").each(function(t,a){e=m(a),o=e.val(),(n=e.data("language"))==WPGlobusAdmin.data.language&&(s=o),""!=o&&(i+=WPGlobusCore.addLocaleMarks(o,n),n==WPGlobusCoreData.default_language&&(l=o))}),i=i.length==l.length+8?l:i,m(v.id).val(i),i=""==s?l:s,m(v.wpglobus_id).val(i)},dialog:m("#wpglobus-dialog-wrapper").dialog({autoOpen:!1,width:650,modal:!0,dialogClass:"wpglobus-dialog",buttons:[{text:"Save",class:"wpglobus-button-save",click:function(){v.saveDialog(),v.dialog.dialog("close")}},{text:"Cancel",class:"wpglobus-button-cancel",click:function(){v.dialog.dialog("close")}}],open:function(){var t=v.dialogTitle;void 0!==v.attrs.maxlength&&(m(".wpglobus_dialog_textarea").attr("maxlength",v.attrs.maxlength),t+=" | maxlength="+v.attrs.maxlength),m(".wpglobus-dialog .ui-dialog-title").text(t)},close:function(){v.form[0].reset()}}),attachListener:function(){m(document).on("click",v.option.settingsClass,function(){m(".wpglobus_dialog_options_wrapper").hasClass("hidden")?m(".wpglobus_dialog_options_wrapper").removeClass("hidden"):m(".wpglobus_dialog_options_wrapper").addClass("hidden")}),m(document).on("click",".wpglobus_dialog_option",function(t){var a=m(this),e=a.data("object");v.order.action="save_post_meta_settings",v.order.post_type=WPGlobusAdmin.data.post_type,v.order.checked=a.prop("checked"),v.order.id=a.attr("id"),v.order.meta_key=a.data("meta-key"),v.ajax(v.order).done(function(t){"ok"==t.result&&("true"==t.checked?m(e).removeClass("wpglobus_dialog_start_hidden"):m(e).addClass("wpglobus_dialog_start_hidden"))}).fail(function(t){}).always(function(t,a){})}),m(document).on("click",v.option.listenClass,function(a){v.element=m(this),v.id=v.element.data("source-id"),""==v.id?(v.id=v.element.data("nodename")+'[name="'+v.element.data("source-name")+'"]',v.wpglobus_id="#wpglobus-"+v.convertToId(v.element.data("source-name"))):(v.wpglobus_id="#wpglobus-"+v.id,v.id="#"+v.id),v.clicks++,1==v.clicks&&setTimeout(function(){if(1==v.clicks)v.onClick(a);else{var t=m(v.id);t.hasClass("hidden")?t.removeClass("hidden").attr("style","display:block;"):t.addClass("hidden").attr("style","display:none;")}v.clicks=0},200)}),v.form=v.dialog.find("form#wpglobus-dialog-form").on("submit",function(t){t.preventDefault(),v.saveDialog()})},ajax:function(t){return m.ajax({type:"POST",url:WPGlobusAdmin.ajaxurl,data:{action:WPGlobusAdmin.process_ajax,order:t},dataType:"json",async:!1})},onClick:function(t){void 0===v.element.data("dialog-title")||""==v.element.data("dialog-title")?v.dialogTitle=v.option.dialogTitle:v.dialogTitle=v.element.data("dialog-title"),void 0!==v.id&&(v.attrs.maxlength=m(v.id).attr("maxlength")),v.source=v.element.data("source-value"),void 0===v.source&&(v.source=m(v.id).val(),"ajax"==v.request||(v.value=WPGlobusCore.getTranslations(v.source))),m.each(v.value,function(t,a){m("#wpglobus-dialog-"+t).val(a)}),v.dialog.dialog("open")}}}(jQuery),jQuery(document).ready(function(){"use strict";var t,c;window.WPGlobusAdminApp=(t=window.WPGlobusAdminApp||{},c=jQuery,t.App=function(t){void 0===window.WPGlobusAdminApp&&(this.config={debug:!1,version:WPGlobusAdmin.version},this.status="ok","undefined"===WPGlobusAdmin?(this.status="error",this.config.debug&&console.log("Error options loading")):this.config.debug&&console.dir(WPGlobusAdmin),this.config.disable_first_language=['<div id="disable_first_language" style="display:block;" class="redux-field-errors notice-red">',"<strong>","<span>&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.admin_init(),c("#content").addClass("wpglobus-editor").attr("data-language",WPGlobusAdmin.data.default_language),c("textarea[id^=content_]").each(function(t,a){var e=c(a).attr("id").replace("content_","");c(a).attr("data-language",e)}),"post.php"===WPGlobusAdmin.page?(this.post_edit(),this.set_dialog(),"undefined"!=typeof WPGlobusAioseop&&WPGlobusAioseop.init()):"menu-edit"===WPGlobusAdmin.page?this.nav_menus():"taxonomy-edit"===WPGlobusAdmin.page?WPGlobusAdmin.data.tag_id&&this.taxonomy_edit():"taxonomy-quick-edit"===WPGlobusAdmin.page?this.quickEdit("taxonomy"):"edit.php"===WPGlobusAdmin.page?this.quickEdit("post"):"options-general.php"==WPGlobusAdmin.page?this.options_general():"widgets.php"==WPGlobusAdmin.page?(WPGlobusWidgets.init(),WPGlobusDialogApp.init({dialogTitle:"Edit text"})):"wpglobus_options"==WPGlobusAdmin.page?this.start():"wpglobusAdminCentral"==WPGlobusAdmin.page?this.adminCentral():WPGlobusDialogApp.init({customData:WPGlobusCoreData.page_custom_data})},parseBool:function(t){return!/^(false|0)$/i.test(t)&&!!t},getCurrentTab:function(){return c(".wpglobus-post-body-tabs-list .ui-tabs-active").data("language")},admin_init:function(){var t=c(".wpglobus-addons-group a").data("key");if(void 0!==t)if(0<=window.location.search.indexOf("page=wpglobus_options&tab="+t))WPGlobusCoreData.multisite?window.location=WPGlobusCoreData.pluginInstallLocation.multisite:window.location=WPGlobusCoreData.pluginInstallLocation.single;else{var a=c("#toplevel_page_wpglobus_options li").eq(t+1);WPGlobusCoreData.multisite?c(a).find("a").attr("href",WPGlobusCoreData.pluginInstallLocation.multisite).attr("onclick","window.location=jQuery(this).attr('href');return false;"):c(a).find("a").attr("href",WPGlobusCoreData.pluginInstallLocation.single).attr("onclick","window.location=jQuery(this).attr('href');return false;")}},options_general:function(){var o=c("#blogname"),t=c("body");o.addClass("hidden"),c("#wpglobus-blogname").insertAfter(o).removeClass("hidden"),t.on("blur",".wpglobus-blogname",function(){c(".wpglobus-blogname").each(function(t,a){var e=c(a);o.val(WPGlobusCore.getString(o.val(),e.val(),e.data("language")))})});var n=c("#blogdescription");n.addClass("hidden"),c("#wpglobus-blogdescription").insertAfter(n).removeClass("hidden"),t.on("blur",".wpglobus-blogdesc",function(){c(".wpglobus-blogdesc").each(function(t,a){var e=c(a);n.val(WPGlobusCore.getString(n.val(),e.val(),e.data("language")))})})},quickEdit:function(n){if(void 0!==WPGlobusAdmin.data.has_items&&WPGlobusAdmin.data.has_items){var 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))});var 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())});var t={action:"get_titles"};t.type=n,t.taxonomy=void 0!==WPGlobusAdmin.data.taxonomy&&WPGlobusAdmin.data.taxonomy,t.title=i,c.ajax({type:"POST",url:WPGlobusAdmin.ajaxurl,data:{action:WPGlobusAdmin.process_ajax,order:t},dataType:"json"}).done(function(t){WPGlobusAdmin.qedit_titles=t.qedit_titles,c.each(t.bulkedit_post_titles,function(t,a){c("#inline_"+t+" .post_title").text(a[WPGlobusAdmin.data.language].name)})}).fail(function(t){}).always(function(t,a){}),c("body").on("change",".wpglobus-quick-edit-title",function(){var n="",i=[];c(".wpglobus-quick-edit-title").each(function(t,a){var e=c(a),o=e.data("language");""!==e.val()&&(n=WPGlobusCore.getString(n,e.val(),o)),WPGlobusAdmin.qedit_titles[l][o].name=e.val(),i[t]=o});var t=c(document).triggerHandler("wpglobus_get_translations",{string:n,lang:i,id:l});void 0!==t&&(n=t),c("input.ptitle").eq(0).attr("value",n),WPGlobusAdmin.qedit_titles[l].source=n}),void 0!==WPGlobusAdmin.data.tags&&c.each(WPGlobusAdmin.data.tags,function(t,a){WPGlobusAdmin.data.value[a].post_id={}}),c("button.save, input#bulk_edit").on("mouseenter",function(t){void 0!==WPGlobusAdmin.data.tags&&("bulk_edit"==t.currentTarget.id?c("input#bulk_edit").unbind("click"):c("button.save").unbind("click"),c("button.save, input#bulk_edit").on("click",function(a){console.log("Start Updating");var t=c.when(),e=(c(this),c.Deferred());e.resolve(function(t){t.next(".spinner").css({visibility:"visible"}),"bulk_edit"!=a.currentTarget.id&&c.ajaxSetup({async:!1});var o,n,i,l=t.parents("tr"),s=l.attr("id").replace("edit-","");c.each(WPGlobusAdmin.data.tags,function(t,a){if(0==(o=l.find("textarea[name='"+WPGlobusAdmin.data.names[a]+"']")).length)return!0;WPGlobusAdmin.data.value[a].post_id[s]=o.val(),n=WPGlobusAdmin.data.value[a].post_id[s].split(","),i=[];for(var e=0;e<n.length;e++)n[e]=n[e].trim(" "),""!=n[e]&&(void 0===WPGlobusAdmin.data.tag[a][n[e]]?i[e]=n[e]:i[e]=WPGlobusAdmin.data.tag[a][n[e]]);o.val(i.join(", "))})}(c(this))),t=t.then(function(){return c.when(e.done())}).then(function(){"bulk_edit"!=a.currentTarget.id&&setTimeout(function(){inlineEditPost.save(l),c.ajaxSetup({async:!0})},50)})}))}),c("#the-list").on("click","a.editinline",function(){var t=c(this);if(o=t.parents("tr").attr("id"),"post"===n)l=o.replace("post-","");else{if("taxonomy"!==n)return;l=o.replace("tag-","")}"post"===n&&void 0!==WPGlobusAdmin.data.tags&&c.each(WPGlobusAdmin.data.tags,function(t,a){if(""!=WPGlobusAdmin.data.value[a]){var e,o=c("#edit-"+l+' textarea[name="'+WPGlobusAdmin.data.names[a]+'"]').val();void 0!==o&&(e=o.split(","),c.each(e,function(t,a){o=o.replace(a,WPGlobusCore.TextFilter(a,WPGlobusCoreData.language))}),c("#edit-"+l+' textarea[name="'+WPGlobusAdmin.data.names[a]+'"]').val(o))}});var a=c("#edit-"+l+" input.ptitle").eq(0),e=a.parents("label");a.val(WPGlobusAdmin.qedit_titles[l].source),a.addClass("hidden"),c(WPGlobusAdmin.data.template).insertAfter(e),void 0===WPGlobusAdmin.qedit_titles[l]&&(WPGlobusAdmin.qedit_titles[l]={},WPGlobusAdmin.qedit_titles[l].source=c("#"+o+" .name a.row-title").text(),c(WPGlobusAdmin.data.enabled_languages).each(function(t,a){WPGlobusAdmin.qedit_titles[l][a]={},a==WPGlobusAdmin.data.default_language?WPGlobusAdmin.qedit_titles[l][a].name=WPGlobusAdmin.qedit_titles[l].source:WPGlobusAdmin.qedit_titles[l][a].name="",WPGlobusAdmin.qedit_titles[l][a].description=""})),c(".wpglobus-quick-edit-title").each(function(t,a){var e=c(a),o=e.data("language");e.attr("id",o+l),void 0!==WPGlobusAdmin.qedit_titles[l][o]&&(WPGlobusAdmin.qedit_titles[l][o].name=WPGlobusAdmin.qedit_titles[l][o].name.replace(/\\\'/g,"'"),WPGlobusAdmin.qedit_titles[l][o].name=WPGlobusAdmin.qedit_titles[l][o].name.replace(/\\\"/g,'"'),e.attr("value",WPGlobusAdmin.qedit_titles[l][o].name),WPGlobusAdmin.qedit_titles[l].source=WPGlobusCore.getString(WPGlobusAdmin.qedit_titles[l].source,WPGlobusAdmin.qedit_titles[l][o].name,o))}),c("input.ptitle").eq(0).attr("value",WPGlobusAdmin.qedit_titles[l].source)})}},taxonomy_edit:function(){var a=[];a[0]="name",a[1]="description",c.each(WPGlobusCoreData.enabled_languages,function(t,u){c.each(a,function(t,a){var e,o,n,i,l,s,d;o=u,i=c("#"+(e=a)),l=i.clone(),s=i.attr("name"),d="wpglobus-element wpglobus-element_"+e+" wpglobus-element_"+o+" wpglobus-translatable",n=(n=document.getElementById(e)).nodeName,c(l).attr("id",e+"_"+o),c(l).attr("name",s+"_"+o),o!==WPGlobusCoreData.default_language&&(d+=" hidden"),c(l).attr("class",d),c(l).attr("data-save-to",e),c(l).attr("data-language",o),"INPUT"==n?c(l).attr("value",c("#wpglobus-link-tab-"+o).data(e)):"TEXTAREA"==n&&c(l).text(c("#wpglobus-link-tab-"+o).data(e)),i.addClass("hidden"),0==c(".wpglobus-element_"+e).size()?c(l).insertAfter(i):c(l).insertAfter(c(".wpglobus-element_"+e).last())})}),c(".wpglobus-taxonomy-tabs").insertAfter("#ajax-response"),c(".wrap").tabs(),c("body").on("click",".wpglobus-taxonomy-tabs li",function(t){var a=c(this).data("language");c(".wpglobus-element").addClass("hidden"),c(".wpglobus-element_"+a).removeClass("hidden")}),c(".wpglobus-element").on("change",function(){var n=c(this).data("save-to"),i="";c(".wpglobus-element").each(function(t,a){var e=c(a),o=e.val();e.data("save-to")==n&&""!==o&&(i+=WPGlobusCore.addLocaleMarks(o,e.data("language")))}),c("#"+n).val(i)})},nav_menus:function(){var e,o,n="#menu-to-edit .menu-item",i=function(){o!==c(n).size()&&(clearInterval(e),c(n).each(function(t,a){var e=c(a);if(!e.hasClass("wpglobus-menu-item")){var l=c(a).attr("id");c.each(["input.edit-menu-item-title","input.edit-menu-item-attr-title"],function(t,a){var e=c("#"+l+" "+a),o=c(e);if(!o.hasClass("wpglobus-hidden")){o.addClass("wpglobus-hidden"),o.css("display","none");var n=o.parent("label"),i=o.parents("p");c(i).css("height","80px"),c(n).append('<div style="color:#f00;">'+WPGlobusAdmin.i18n.save_nav_menu+"</div>")}}),e.addClass("wpglobus-menu-item")}}))};c.ajaxSetup({beforeSend:function(t,a){void 0!==a.data&&0<=a.data.indexOf("action=add-menu-item")&&(o=c(n).size(),e=setInterval(i,500))}}),c(n).each(function(t,a){var e=c(a).attr("id"),u=e.replace("menu-item-","");c.each(["input.edit-menu-item-title","input.edit-menu-item-attr-title"],function(n,i){var l=c("#"+e+" "+i);l.val()!=WPGlobusAdmin.data.items[u][i].source&&l.val(WPGlobusAdmin.data.items[u][i].source);var s=c("#"+e+" "+i).parents("p"),d=0;c.each(WPGlobusAdmin.data.open_languages,function(t,a){var e=l.clone();e.attr("id",l.attr("id")+"-"+a),e.attr("name",l.attr("id")+"-"+a),e.attr("data-language",a),e.attr("data-item-id",u),e.attr("placeholder",WPGlobusAdmin.data.en_language_name[a]);var o=WPGlobusAdmin.data.items[u][a][i].class;0===n&&a===WPGlobusAdmin.data.default_language?e.attr("class",o+" edit-menu-item-title"):e.attr("class",o),""!=WPGlobusAdmin.data.items[u][a][i].caption?e.attr("value",WPGlobusAdmin.data.items[u][a][i].caption):e.attr("value",""),e.css("margin-bottom","0.6em"),c(s).append(e),d=t}),d=40*(d+1),l.css("display","none").attr("class","").addClass("widefat wpglobus-hidden"),c(s).css("height",d+"px").addClass("wpglobus-menu-item-box")}),c(a).addClass("wpglobus-menu-item")}),c(".menus-move-left, .menus-move-right").each(function(t,a){var e,o=c(a),n=(o.parents("li").attr("id").replace("menu-item-",""),o.attr("title"));void 0!==n&&c.each(WPGlobusAdmin.data.post_titles,function(t,a){0<=n.indexOf(t)&&(e=n.replace(t,a),o.attr("title",e),o.text(e))})}),c(".edit-menu-item-title").trigger("change"),wpNavMenu.refreshAdvancedAccessibility(),wpNavMenu.menusChanged=!1,c(".wpglobus-menu-item").on("change",function(){var t,a,e=c(this),o=e.data("item-id");e.hasClass("wpglobus-item-title")&&(t=WPGlobusCore.getString(c("input#edit-menu-item-title-"+o).val(),e.val(),e.data("language")),void 0!==(a=c(document).triggerHandler("wpglobus_get_menu_translations",{string:t,lang:WPGlobusCoreData.open_languages,id:o,type:"input.edit-menu-item-title"}))&&(t=a),c("input#edit-menu-item-title-"+o).val(t)),e.hasClass("wpglobus-item-attr")&&(t=WPGlobusCore.getString(c("input#edit-menu-item-attr-title-"+o).val(),e.val(),e.data("language")),void 0!==(a=c(document).triggerHandler("wpglobus_get_menu_translations",{string:t,lang:WPGlobusCoreData.open_languages,id:o,type:"input.edit-menu-item-attr-title"}))&&(t=a),c("input#edit-menu-item-attr-title-"+o).val(t))})},post_edit:function(){c(document).on("heartbeat-send",function(t,o){void 0!==o.wp_autosave&&(o.wpglobus_heartbeat="wpglobus",c.each(WPGlobusAdmin.data.open_languages,function(t,a){var e=c("#title_"+a).val()||"";""!=(e=c.trim(e))&&(o.wp_autosave["post_title_"+a]=e),e=c("#content_"+a).val()||"",""!=(e=c.trim(e))&&(o.wp_autosave["content_"+a]=e)}))});var e="#postdivrich",o=!0,a="#post-body-content";if(!1===WPGlobusAdmin.data.support.editor&&(o=!(e="#titlediv")),!1===WPGlobusAdmin.data.support.title&&(o=!1),c(a).prepend(c(".wpglobus-post-body-tabs-list")),c.each(WPGlobusAdmin.tabs,function(t,a){"default"===a?(c(e).wrap('<div id="tab-default"></div>'),o&&c(c("#titlediv")).insertBefore(e)):(c(e+"-"+a).wrap('<div id="tab-'+a+'"></div>'),o&&c(c("#titlediv-"+a)).insertBefore(e+"-"+a))}),c(a).addClass("wpglobus-post-body-tabs").tabs({beforeActivate:function(t,a){var e=a.oldTab[0].id.replace("link-tab-",""),o=a.newTab[0].id.replace("link-tab-","");"default"==e&&(e=WPGlobusCoreData.default_language),"default"==o&&(o=WPGlobusCoreData.default_language);var n=c(document).triggerHandler("wpglobus_post_body_tabs",[e,o]);return!(!n&&void 0!==n)}}),c("#title").val(WPGlobusAdmin.title),c("#content").text(WPGlobusAdmin.content),"undefined"!=typeof WPGlobusVendor&&WPGlobusVendor.vendor.WPSEO&&("undefined"!=typeof wpglobus_wpseo?wpglobus_wpseo():"undefined"!=typeof WPGlobusYoastSeo&&WPGlobusYoastSeo.init()),WPGlobusAdmin.data.modify_excerpt){var n=c("#excerpt");n.addClass("hidden").css({display:"none"}),c(WPGlobusAdmin.data.template).insertAfter(n),c("body").on("change",".wpglobus-excerpt",function(){var t=c(this);n.val(WPGlobusCore.getString(n.val(),t.val(),t.data("language")))})}if(void 0!==wp.utils&&void 0!==wp.utils.WordCounter){WPGlobusCoreData.wordCounter={};var i=this;c.each(WPGlobusCoreData.enabled_languages,function(t,a){if(a==WPGlobusCoreData.default_language)return!0;var e,o,n;e=jQuery,o=new wp.utils.WordCounter,n=a,WPGlobusCoreData.wordCounter[n]={},WPGlobusCoreData.wordCounter[n].counter=o,e(function(){function o(t){var a,e;"object"==typeof t&&(t="tinymce"==t?i.getCurrentTab():t.target.id.replace("content_","")),void 0!==WPGlobusCoreData.wordCounter[t]&&(a=!WPGlobusCoreData.wordCounter[t].contentEditor||WPGlobusCoreData.wordCounter[t].contentEditor.isHidden()?WPGlobusCoreData.wordCounter[t].content.val():WPGlobusCoreData.wordCounter[t].contentEditor.getContent({format:"raw"}),(e=WPGlobusCoreData.wordCounter[t].counter.count(a))!==WPGlobusCoreData.wordCounter[t].prevCount&&WPGlobusCoreData.wordCounter[t].count.text(e),WPGlobusCoreData.wordCounter[t].prevCount=e)}WPGlobusCoreData.wordCounter[n].content=e("#content_"+n),WPGlobusCoreData.wordCounter[n].count=e("#wp-word-count-"+n).find(".word-count-"+n),WPGlobusCoreData.wordCounter[n].prevCount=0,e(document).on("tinymce-editor-init",function(t,a){if(-1!=a.id.indexOf("content_")){var e=a.id.replace("content_","");(WPGlobusCoreData.wordCounter[e].contentEditor=a).on("nodechange keyup",_.debounce(o,1e3))}}),WPGlobusCoreData.wordCounter[n].content.on("input keyup",_.debounce(o,1e3)),o(n)})})}if("undefined"!=typeof wpWordCount){var l=0,t=WPGlobusCoreData.open_languages,s=this.$document,d={};t.shift(),c.each(WPGlobusCoreData.open_languages,function(t,a){d[a]=0});var u={settings:{strip:/<[a-zA-Z\/][^<>]*>/g,clean:/[0-9.(),;:!?%#$¿'"_+=\\/-]+/g,w:/\S\s+/g,c:/\S/g},block:d,wc:function(t,a,e){var o,n=this,i=0;o=a==WPGlobusCoreData.default_language?c(".word-count"):c(".word-count-"+a),void 0===e&&(e=wordCountL10n.type),"w"!==e&&"c"!==e&&(e="w"),n.block[a]||(n.block[a]=1,setTimeout(function(){t&&(t=(t=t.replace(n.settings.strip," ").replace(/&nbsp;|&#160;/gi," ")).replace(n.settings.clean,"")).replace(n.settings[e],function(){i++}),o.html(i.toString()),setTimeout(function(){n.block[a]=0},2e3)},1))}};s.bind("wpglobuscountwords",function(t,a,e){u.wc(a,e)}),c.each(t,function(t,e){var o=c("#content_"+e);s.triggerHandler("wpglobuscountwords",[o.val(),e]),o.keyup(function(t){var a=t.keyCode||t.charCode;return a==l||(13!=a&&8!=l&&46!=l||s.triggerHandler("wpglobuscountwords",[o.val(),e]),l=a),!0})}),c(document).triggerHandler("wpglobuscountwords",[c("#content").val(),WPGlobusCoreData.default_language])}c("body").on("click","#publish, #save-post",function(){if(1<WPGlobusAdmin.data.open_languages.length){c(document).triggerHandler("wpglobus_before_save_post",{content_tabs_id:a});var t,e=c("#title").val(),o="",n="";0==e.length&&(t=WPGlobusAdmin.data.open_languages.indexOf(WPGlobusAdmin.data.default_language),WPGlobusAdmin.data.open_languages.splice(t,1),c(WPGlobusAdmin.data.open_languages).each(function(t,a){n=0==t?"":"-",0<(e=c("#title_"+a).val()).length&&(0==o.length&&(n=""),o=o+n+e)})),0<o.length&&c("#title").val(o)}void 0===WPGlobusAdmin.data.tagsdiv||WPGlobusAdmin.data.tagsdiv.length<1||c(WPGlobusAdmin.data.tagsdiv).each(function(t,a){if(0==c("#"+a).size())return!0;var e=a.replace("tagsdiv-","");if("undefined"===e)return!0;if(0==c("#tax-input-"+e).size())return!0;var o,n=[];c("#tagsdiv-"+e+" .tagchecklist span").each(function(t,a){o=(o=c(a).text()).replace("X","").trim(" "),void 0===WPGlobusAdmin.data.tag[e][o]?n[t]=o:n[t]=WPGlobusAdmin.data.tag[e][o]}),c("#tax-input-"+e).val(n.join(", "))})}),c(".ui-state-default").on("click",function(){"link-tab-default"===c(this).attr("id")&&(c(window).scrollTop(c(window).scrollTop()+1),c(window).scrollTop(c(window).scrollTop()-1))})},adminCentral:function(){c(".wpglobus-admin-central-tab").css({display:"none"}),1<c(".nav-tab-active").length&&c(".wpglobus-about-wrap .nav-tab-wrapper a").removeClass("nav-tab-active");var e=!0;0==location.hash.indexOf("#")&&c(".wpglobus-about-wrap .nav-tab-wrapper a").each(function(t,a){c(a).attr("href")==location.hash&&(e=!1,c(a).addClass("nav-tab-active"))}),e&&c(".wpglobus-about-wrap .nav-tab-wrapper a").eq(0).addClass("nav-tab-active");var t=c(".wpglobus-about-wrap .nav-tab-active").data("tab-id");""!=t&&c("#"+t).css({display:"block"}),c(document).on("click",".wpglobus-about-wrap .nav-tab",function(t){var a=c(this);a.hasClass("nav-tab-active")||(c(".wpglobus-admin-central-tab").css({display:"none"}),c(".wpglobus-about-wrap .nav-tab").removeClass("nav-tab-active"),a.addClass("nav-tab-active"),""!=a.data("tab-id")&&c("#"+a.data("tab-id")).css({display:"block"}))})},start:function(){var a=this;c("#wpglobus_flags").select2({formatResult:this.format,formatSelection:this.format,minimumResultsForSearch:-1,escapeMarkup:function(t){return t}}),c("body").on("click","#enabled_languages-list li:first input",function(t){return t.preventDefault(),c(".redux-save-warn").css({display:"none"}),c("#enabled_languages-list").find("li:first > input").val("1"),0===c("#disable_first_language").length&&c(a.config.disable_first_language).insertAfter("#info_bar"),!1})},format:function(t){return'<img class="wpglobus_flag" src="'+WPGlobusAdmin.flag_url+t.text+'"/>&nbsp;&nbsp;'+t.text},set_dialog:function(){if(void 0===WPGlobusAdmin.data.customFieldsEnabled||(WPGlobusAdmin.data.customFieldsEnabled=this.parseBool(WPGlobusAdmin.data.customFieldsEnabled),WPGlobusAdmin.data.customFieldsEnabled)){var o,a=!1,n=function(t){var s,d,u,r="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(""),c(void 0===t?"#the-list tr":"#the-list tr#"+t).each(function(){var t,a,e,o=c(this),n=o.attr("id"),i=o.find("textarea"),l=r;if(void 0===(s=i.attr("id")))return!0;e=c("#"+n+"-key").val(),t=c("#"+s).clone(),c(i).addClass("wpglobus-dialog-field-source hidden"),a=i.attr("name"),c(t).attr("id","wpglobus-"+s),c(t).attr("name","wpglobus-"+a),c(t).attr("data-source-id",s),c(t).attr("class","wpglobus-dialog-field"),c(t).val(WPGlobusCore.TextFilter(c(i).val(),WPGlobusCoreData.language)),c(t).insertAfter(i),d=(d=u.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}}/,""),r+" wpglobus_dialog_start_hidden"):(d=d.replace(/{{checked}}/,"checked"),r),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>")}),!a&&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>'),a=!0)};n(),c("body").on("change",".wpglobus-dialog-field",function(){var e,o,n=c(this),t="#"+n.data("source-id"),i="";void 0!==t&&(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-customize-control140.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(document).ready(function(a){"use strict";var c={languages:{},index:0,length:0,controlInstances:{},controlWidgets:{},instancesKeep:!1,widgetKeep:!1,action:!1,selectorHtml:'<span style="margin-left:5px;" class="wpglobus-icon-globe"></span><span style="font-weight:bold;">{{language}}</span>',init:function(t){c.setTitle(),"false"!=WPGlobusCustomizeOptions.themeEnabled&&(a.each(WPGlobusCoreData.enabled_languages,function(t,e){c.languages[t]=e,c.length=t}),c.addLanguageSelector(),c.setControlInstances(),c.setFieldsSection(),c.attachListeners())},setFieldsSection:function(){var o={},n=a(".wpglobus-fields_settings_control_box").data("section-template"),s="",l="",i="";a.each(WPGlobusCustomize.controlInstances,function(t,e){void 0===o[e.section]&&(o[e.section]={}),o[e.section][t]=e}),a.each(o,function(t,e){l="<ul>",a.each(e,function(t,e){i=e.userControl.enabled?" checked ":"",l+='<li><input id="wpglobus-cb-control-'+t+'" data-control="'+t+'" class="wpglobus-customize-cb-control" type="checkbox"'+i+" /> "+e.title+"</li>"}),l+="</ul>",s=(s=(s=(s=n.replace("{{section_title}}",wp.customize.section(t).params.title)).replace(/{{section}}/g,t)).replace("{{section_id}}",'"'+t+'"')).replace("{{items}}",l),a(s).insertBefore(a("#"+WPGlobusCustomizeOptions.userControlSaveButton))}),a("#accordion-section-wpglobus_fields_settings_section").css({"margin-top":"15px"}),a(WPGlobusCustomizeOptions.helpButton).insertAfter(a("#accordion-section-wpglobus_fields_settings_section .customize-action")),a("#accordion-section-wpglobus_fields_settings_section .customize-section-description").addClass("hidden"),a("."+WPGlobusCustomizeOptions.userControlIconClass).on("click",function(t){var o=a(this).data("section");a(WPGlobusCustomizeOptions.userControlBoxSelector).each(function(t,e){o==a(e).data("section")?a(this).css({display:"block"}):a(this).css({display:"none"})}),wp.customize.control("wpglobus_fields_settings_section").expand()}),a(".wpglobus-customize-icon-help.customize-help-toggle").on("click",function(t){a("#accordion-section-wpglobus_fields_settings_section .customize-section-description").toggleClass("hidden")})},setUserControls:function(t,e){var o=e.controlSelector+" "+e.selector,n='<img class="'+WPGlobusCustomizeOptions.userControlIconClass+'" data-section="'+e.section+'" style="position:absolute;right:0px;" src="'+WPGlobusCustomizeOptions.userControlIcon+'" />';a(n).insertBefore(o),e.userControl.enabled||(1<a(o).length?a(o).each(function(t,e){a(e).removeClass(WPGlobusCustomize.controlClass)}):a(o).removeClass(WPGlobusCustomize.controlClass).val(e.setting))},ctrlMenuItemsCallback:function(t,e){},ctrlWidgetCallback:function(l,i){if(c.action=!1,void 0===c.controlWidgets[l].element){void 0===i&&(i=wp.customize.control.instance(l)),c.controlWidgets[l].element={},c.controlWidgets[l].control=i,c.controlWidgets[l].inWidgetTitle=i.container.find(".in-widget-title");var t=i.container.find("input[type=submit]");0!=t.length&&(t.css({display:"block"}),t.attr("data-widget",l),c.controlWidgets[l].submit=t,c.attachWidgetListeners(c.controlWidgets[l])),i.liveUpdateMode=!1,void 0===i.setting().title?c.controlWidgets[l].inWidgetTitle.text(""):c.controlWidgets[l].inWidgetTitle.text(": "+WPGlobusCore.TextFilter(i.setting().title,WPGlobusCustomize.languageAdmin)),a.each(WPGlobusCustomize.elementSelector,function(t,n){var s=i.container.find(n);0!=s.length&&a.each(s,function(t,e){if(void 0===e.id||""==e.id)return!0;var o=a(s[t]);void 0===c.controlWidgets[l].element[e.id]&&(c.controlWidgets[l].element[e.id]={}),o.addClass("wpglobus-customize-widget-control"),o.attr("data-widget",l),c.controlWidgets[l].element[e.id].element=o,c.controlWidgets[l].element[e.id].setting=i.setting(),c.controlWidgets[l].element[e.id].selector=n,c.controlWidgets[l].element[e.id].value=e.defaultValue,o.val(WPGlobusCore.TextFilter(e.defaultValue,WPGlobusCoreData.language,"RETURN_EMPTY"))})}),a(document).triggerHandler("wpglobus_customize_control_added_widget",[l])}},ctrlCallback:function(o,n,t){var s=!1;if(a.each(WPGlobusCustomize.disabledSections,function(t,e){if(o.section()==e)return!(s=!0)}),!s&&(a.each(WPGlobusCustomize.disabledSettingMask,function(t,e){if(0<=n.indexOf(e))return!(s=!0)}),!s)){var l=wp.customize.control.instance(n);if(0<=n.indexOf("widget"))return void 0===c.controlWidgets[n]&&(c.controlWidgets[n]={},c.action&&c.ctrlWidgetCallback(n,l)),c.controlWidgets[n].parent=l.selector,!1;if(void 0===c.controlInstances[n]){var i=!0;a.each(WPGlobusCustomize.elementSelector,function(t,e){var o=l.container.find(e);0!=o.length&&(c.controlInstances[n]={},c.controlInstances[n].element=o,c.controlInstances[n].setting=l.setting(),c.controlInstances[n].selector=e,c.controlInstances[n].controlSelector=l.selector,c.controlInstances[n].type="",c.controlInstances[n].section=l.section(),c.controlInstances[n].title=null,c.controlInstances[n].userControl=null,a.each(WPGlobusCustomize.setLinkBy,function(t,e){0<=n.indexOf(e)&&(c.controlInstances[n].type="link",""==c.controlInstances[n].setting&&(c.controlInstances[n].setting=o[0].defaultValue),o.addClass("wpglobus-control-link"))}),""===c.controlInstances[n].type&&(c.controlInstances[n].type="textarea"==e?"textarea":"text"),o.val(WPGlobusCore.TextFilter(c.controlInstances[n].setting,WPGlobusCoreData.language,"RETURN_EMPTY")),o.addClass("wpglobus-customize-control"),o.attr("data-wpglobus-customize-control",c.controlInstances[n].controlSelector.replace("#customize-control-","")),"link"==c.controlInstances[n].type&&(c.controlInstances[n].setting=c.convertString(o[0].defaultValue)),c.controlInstances[n].title=a(l.selector+" .customize-control-title").text(),null!==WPGlobusCustomizeOptions.userControl&&void 0!==WPGlobusCustomizeOptions.userControl[WPGlobusCustomizeOptions.themeName]&&void 0!==WPGlobusCustomizeOptions.userControl[WPGlobusCustomizeOptions.themeName][n]&&"disable"==WPGlobusCustomizeOptions.userControl[WPGlobusCustomizeOptions.themeName][n]&&(i=!1),c.controlInstances[n].userControl={},c.controlInstances[n].userControl.enabled=i,c.setUserControls(n,c.controlInstances[n]))})}}},setControlInstances:function(){wp.customize.control.each(c.ctrlCallback)},setTitle:function(){a(WPGlobusCoreData.customize.info.element).html(WPGlobusCoreData.customize.info.html)},convertString:function(t){if(void 0===t)return t;var o=[],e=WPGlobusCore.getTranslations(t),n=0,s=!0;return a.each(e,function(t,e){""==e?o[n]="null":(s=!1,o[n]=e),n++}),s?"":o.join("|||")},getTranslations:function(t){var o={},n=t.split("|||");return a.each(WPGlobusCoreData.enabled_languages,function(t,e){o[e]="undefined"===n[t]||"null"===n[t]?"":n[t]}),o},getString:function(t,o,n){if(void 0===t)return t;void 0===o&&(o=""),void 0===n&&(n=WPGlobusCoreData.language);var e=c.getTranslations(t),s=[],l=0;return a.each(e,function(t,e){s[l]=t==n?o:""==e?"null":e,l++}),s=s.join("|||")},addLanguageSelector:function(){a(WPGlobusCustomize.selectorButton).insertAfter(".customize-controls-preview-toggle"),a(".wpglobus-customize-selector").html(c.selectorHtml.replace("{{language}}",WPGlobusCoreData.language)),a(document).on("click",".wpglobus-customize-selector",function(t){c.index>c.length-1?c.index=0:c.index++,WPGlobusCoreData.language=c.languages[c.index],a(this).html(c.selectorHtml.replace("{{language}}",WPGlobusCoreData.language)),a(document).triggerHandler("wpglobus_customize_control_language",[WPGlobusCoreData.language]),a(".wpglobus-customize-control").each(function(t,e){var o=a(e),n=o.data("customize-setting-link");if(void 0!==WPGlobusCustomize.controlInstances[n]||(n=o.data("wpglobus-customize-control"),void 0!==WPGlobusCustomize.controlInstances[n]))if(o.hasClass("wpglobus-control-link")){var s=c.getTranslations(WPGlobusCustomize.controlInstances[n].setting);o.val(s[WPGlobusCoreData.language])}else o.val(WPGlobusCore.TextFilter(WPGlobusCustomize.controlInstances[n].setting,WPGlobusCoreData.language,"RETURN_EMPTY"))}),a(".wpglobus-customize-widget-control").each(function(t,e){var o=a(e),n=o.data("widget");if(void 0===o.attr("id"))return!0;o.val(WPGlobusCore.TextFilter(WPGlobusCustomize.controlWidgets[n].element[o.attr("id")].value,WPGlobusCoreData.language,"RETURN_EMPTY"))})})},updateElements:function(s){void 0===s&&(s=!0),a.each(WPGlobusCustomize.controlInstances,function(t,e){if(!e.userControl.enabled)return!0;var o=wp.customize.control.instance(t);if("link"==e.type){var n=c.getTranslations(WPGlobusCustomize.controlInstances[t].setting);s?(o.setting.set(n[WPGlobusCoreData.language]),e.element.val(o.setting())):e.element.val(n[WPGlobusCoreData.language])}else s?(o.setting.set(WPGlobusCore.TextFilter(WPGlobusCustomize.controlInstances[t].setting,WPGlobusCoreData.language,"RETURN_EMPTY")),e.element.val(o.setting())):e.element.val(WPGlobusCore.TextFilter(WPGlobusCustomize.controlInstances[t].setting,WPGlobusCoreData.language,"RETURN_EMPTY"))})},onSubmitEvents:function(t){"mouseenter"==t.type?a.each(c.controlWidgets[a(this).data("widget")].element,function(t,e){a("#"+t).val(e.value)}):"mouseleave"==t.type?c.widgetKeep||a.each(c.controlWidgets[a(this).data("widget")].element,function(t,e){a("#"+t).val(WPGlobusCore.TextFilter(e.value,WPGlobusCoreData.language,"RETURN_EMPTY"))}):"click"==t.type&&(c.widgetKeep=!0)},attachWidgetListeners:function(t){void 0!==t.submit[0].id&&a(document).on("mouseenter","#"+t.submit[0].id,c.onSubmitEvents).on("mouseleave","#"+t.submit[0].id,c.onSubmitEvents).on("click","#"+t.submit[0].id,c.onSubmitEvents)},attachListeners:function(){a(".wpglobus-customize-control").on("keyup",function(t){var e=a(this),o=e.data("customize-setting-link");void 0===WPGlobusCustomize.controlInstances[o]&&(o=e.data("wpglobus-customize-control"),void 0===WPGlobusCustomize.controlInstances[o])||("link"==WPGlobusCustomize.controlInstances[o].type?WPGlobusCustomize.controlInstances[o].setting=c.getString(WPGlobusCustomize.controlInstances[o].setting,e.val(),WPGlobusCoreData.language):WPGlobusCustomize.controlInstances[o].setting=WPGlobusCore.getString(WPGlobusCustomize.controlInstances[o].setting,e.val(),WPGlobusCoreData.language))}),a(document).on("keyup",".wpglobus-customize-widget-control",function(t){var e=a(this),o=e.data("widget");void 0!==WPGlobusCustomize.controlWidgets[o]&&(WPGlobusCustomize.controlWidgets[o].element[e.attr("id")].value=WPGlobusCore.getString(WPGlobusCustomize.controlWidgets[o].element[e.attr("id")].value,e.val(),WPGlobusCoreData.language))}),a("#save").on("mouseenter",function(t){a.each(WPGlobusCustomize.controlInstances,function(t,e){if(e.userControl.enabled){var o=wp.customize.control.instance(t);o.setting.set(e.setting),e.element.val(o.setting())}})}).on("mouseleave",function(t){c.instancesKeep||c.updateElements()}).on("click",function(t){c.instancesKeep=!0}),a(document).on("ajaxComplete",function(t,n){void 0!==n.responseText&&('{"success":true,"data":[]}'==n.responseText?c.updateElements(!1):(0<=n.responseText.indexOf("WP_CUSTOMIZER_SIGNATURE")&&(c.action="customizerAjaxComplete",c.setControlInstances()),a.each(WPGlobusCustomize.controlWidgets,function(t,e){var o=t.replace("_","-");if(0<=n.responseText.indexOf(o))return e.submit.css({display:"block"}),e.control.liveUpdateMode=!1,a.each(e.element,function(t,e){a("#"+t).val(WPGlobusCore.TextFilter(e.value,WPGlobusCoreData.language,"RETURN_EMPTY"))}),e.inWidgetTitle.text(": "+WPGlobusCore.TextFilter(e.control.setting().title,WPGlobusCustomize.languageAdmin)),c.widgetKeep=!1})))}),a(document).on("click",".widget-title, .widget-title-action",function(t){var o=a(this).parents(".customize-control-widget_form").attr("id");a.each(c.controlWidgets,function(t,e){if("#"+o==e.parent)return c.ctrlWidgetCallback(t),!1})})}};WPGlobusCustomize=a.extend({},WPGlobusCustomize,c),WPGlobusCustomize.init()});
1
+ jQuery(document).ready(function(a){"use strict";var c={languages:{},index:0,length:0,controlInstances:{},controlWidgets:{},instancesKeep:!1,widgetKeep:!1,action:!1,selectorHtml:'<span style="margin-left:5px;" class="wpglobus-icon-globe"></span><span style="font-weight:bold;">{{language}}</span>',init:function(t){c.setTitle(),"false"!=WPGlobusCustomizeOptions.themeEnabled&&(a.each(WPGlobusCoreData.enabled_languages,function(t,e){c.languages[t]=e,c.length=t}),c.addLanguageSelector(),c.setControlInstances(),c.setFieldsSection(),c.attachListeners())},setFieldsSection:function(){var o={},n=a(".wpglobus-fields_settings_control_box").data("section-template"),s="",l="",i="";a.each(WPGlobusCustomize.controlInstances,function(t,e){void 0===o[e.section]&&(o[e.section]={}),o[e.section][t]=e}),a.each(o,function(t,e){l="<ul>",a.each(e,function(t,e){i=e.userControl.enabled?" checked ":"",l+='<li><input id="wpglobus-cb-control-'+t+'" data-control="'+t+'" class="wpglobus-customize-cb-control" type="checkbox"'+i+" /> "+e.title+"</li>"}),l+="</ul>",s=(s=(s=(s=n.replace("{{section_title}}",wp.customize.section(t).params.title)).replace(/{{section}}/g,t)).replace("{{section_id}}",'"'+t+'"')).replace("{{items}}",l),a(s).insertBefore(a("#"+WPGlobusCustomizeOptions.userControlSaveButton))}),a("#accordion-section-wpglobus_fields_settings_section").css({"margin-top":"15px"}),a(WPGlobusCustomizeOptions.helpButton).insertAfter(a("#accordion-section-wpglobus_fields_settings_section .customize-action")),a("#accordion-section-wpglobus_fields_settings_section .customize-section-description").addClass("hidden"),a("."+WPGlobusCustomizeOptions.userControlIconClass).on("click",function(t){var o=a(this).data("section");a(WPGlobusCustomizeOptions.userControlBoxSelector).each(function(t,e){o==a(e).data("section")?a(this).css({display:"block"}):a(this).css({display:"none"})}),wp.customize.control("wpglobus_fields_settings_section").expand()}),a(".wpglobus-customize-icon-help.customize-help-toggle").on("click",function(t){a("#accordion-section-wpglobus_fields_settings_section .customize-section-description").toggleClass("hidden")})},setUserControls:function(t,e){var o=e.controlSelector+" "+e.selector,n='<img class="'+WPGlobusCustomizeOptions.userControlIconClass+'" data-section="'+e.section+'" style="position:absolute;right:0px;" src="'+WPGlobusCustomizeOptions.userControlIcon+'" />';a(n).insertBefore(o),e.userControl.enabled||(1<a(o).length?a(o).each(function(t,e){a(e).removeClass(WPGlobusCustomize.controlClass)}):a(o).removeClass(WPGlobusCustomize.controlClass).val(e.setting))},ctrlMenuItemsCallback:function(t,e){},ctrlWidgetCallback:function(l,i){if(c.action=!1,void 0===c.controlWidgets[l].element){void 0===i&&(i=wp.customize.control.instance(l)),c.controlWidgets[l].element={},c.controlWidgets[l].control=i,c.controlWidgets[l].inWidgetTitle=i.container.find(".in-widget-title");var t=i.container.find("input[type=submit]");0!=t.length&&(t.css({display:"block"}),t.attr("data-widget",l),c.controlWidgets[l].submit=t,c.attachWidgetListeners(c.controlWidgets[l])),i.liveUpdateMode=!1,void 0===i.setting().title?c.controlWidgets[l].inWidgetTitle.text(""):c.controlWidgets[l].inWidgetTitle.text(": "+WPGlobusCore.TextFilter(i.setting().title,WPGlobusCustomize.languageAdmin)),a.each(WPGlobusCustomize.elementSelector,function(t,n){var s=i.container.find(n);0!=s.length&&a.each(s,function(t,e){if(void 0===e.id||""==e.id)return!0;var o=a(s[t]);void 0===c.controlWidgets[l].element[e.id]&&(c.controlWidgets[l].element[e.id]={}),o.addClass("wpglobus-customize-widget-control"),o.attr("data-widget",l),c.controlWidgets[l].element[e.id].element=o,c.controlWidgets[l].element[e.id].setting=i.setting(),c.controlWidgets[l].element[e.id].selector=n,c.controlWidgets[l].element[e.id].value=e.defaultValue,o.val(WPGlobusCore.TextFilter(e.defaultValue,WPGlobusCoreData.language,"RETURN_EMPTY"))})}),a(document).triggerHandler("wpglobus_customize_control_added_widget",[l])}},ctrlCallback:function(o,n,t){var s=!1;if(a.each(WPGlobusCustomize.disabledSections,function(t,e){if(o.section()==e)return!(s=!0)}),!s&&(a.each(WPGlobusCustomize.disabledSettingMask,function(t,e){if(0<=n.indexOf(e))return!(s=!0)}),!s)){var l=wp.customize.control.instance(n);if(0<=n.indexOf("widget"))return void 0===c.controlWidgets[n]&&(c.controlWidgets[n]={},c.action&&c.ctrlWidgetCallback(n,l)),c.controlWidgets[n].parent=l.selector,!1;if(void 0===c.controlInstances[n]){var i=!0;a.each(WPGlobusCustomize.elementSelector,function(t,e){var o=l.container.find(e);0!=o.length&&(c.controlInstances[n]={},c.controlInstances[n].element=o,c.controlInstances[n].setting=l.setting(),c.controlInstances[n].selector=e,c.controlInstances[n].controlSelector=l.selector,c.controlInstances[n].type="",c.controlInstances[n].section=l.section(),c.controlInstances[n].title=null,c.controlInstances[n].userControl=null,a.each(WPGlobusCustomize.setLinkBy,function(t,e){0<=n.indexOf(e)&&(c.controlInstances[n].type="link",""==c.controlInstances[n].setting&&(c.controlInstances[n].setting=o[0].defaultValue),o.addClass("wpglobus-control-link"))}),""===c.controlInstances[n].type&&(c.controlInstances[n].type="textarea"==e?"textarea":"text"),o.val(WPGlobusCore.TextFilter(c.controlInstances[n].setting,WPGlobusCoreData.language,"RETURN_EMPTY")),o.addClass("wpglobus-customize-control"),o.attr("data-wpglobus-customize-control",c.controlInstances[n].controlSelector.replace("#customize-control-","")),"link"==c.controlInstances[n].type&&(c.controlInstances[n].setting=c.convertString(o[0].defaultValue)),c.controlInstances[n].title=a(l.selector+" .customize-control-title").text(),null!==WPGlobusCustomizeOptions.userControl&&void 0!==WPGlobusCustomizeOptions.userControl[WPGlobusCustomizeOptions.themeName]&&void 0!==WPGlobusCustomizeOptions.userControl[WPGlobusCustomizeOptions.themeName][n]&&"disable"==WPGlobusCustomizeOptions.userControl[WPGlobusCustomizeOptions.themeName][n]&&(i=!1),c.controlInstances[n].userControl={},c.controlInstances[n].userControl.enabled=i,c.setUserControls(n,c.controlInstances[n]))})}}},setControlInstances:function(){wp.customize.control.each(c.ctrlCallback)},setTitle:function(){a(WPGlobusCoreData.customize.info.element).html(WPGlobusCoreData.customize.info.html)},convertString:function(t){if(void 0===t)return t;var o=[],e=WPGlobusCore.getTranslations(t),n=0,s=!0;return a.each(e,function(t,e){o[n]=""==e?"null":(s=!1,e),n++}),s?"":o.join("|||")},getTranslations:function(t){var o={},n=t.split("|||");return a.each(WPGlobusCoreData.enabled_languages,function(t,e){o[e]="undefined"===n[t]||"null"===n[t]?"":n[t]}),o},getString:function(t,o,n){if(void 0===t)return t;void 0===o&&(o=""),void 0===n&&(n=WPGlobusCoreData.language);var e=c.getTranslations(t),s=[],l=0;return a.each(e,function(t,e){s[l]=t==n?o:""==e?"null":e,l++}),s=s.join("|||")},addLanguageSelector:function(){a(WPGlobusCustomize.selectorButton).insertAfter(".customize-controls-preview-toggle"),a(".wpglobus-customize-selector").html(c.selectorHtml.replace("{{language}}",WPGlobusCoreData.language)),a(document).on("click",".wpglobus-customize-selector",function(t){c.index>c.length-1?c.index=0:c.index++,WPGlobusCoreData.language=c.languages[c.index],a(this).html(c.selectorHtml.replace("{{language}}",WPGlobusCoreData.language)),a(document).triggerHandler("wpglobus_customize_control_language",[WPGlobusCoreData.language]),a(".wpglobus-customize-control").each(function(t,e){var o=a(e),n=o.data("customize-setting-link");if(void 0!==WPGlobusCustomize.controlInstances[n]||(n=o.data("wpglobus-customize-control"),void 0!==WPGlobusCustomize.controlInstances[n]))if(o.hasClass("wpglobus-control-link")){var s=c.getTranslations(WPGlobusCustomize.controlInstances[n].setting);o.val(s[WPGlobusCoreData.language])}else o.val(WPGlobusCore.TextFilter(WPGlobusCustomize.controlInstances[n].setting,WPGlobusCoreData.language,"RETURN_EMPTY"))}),a(".wpglobus-customize-widget-control").each(function(t,e){var o=a(e),n=o.data("widget");if(void 0===o.attr("id"))return!0;o.val(WPGlobusCore.TextFilter(WPGlobusCustomize.controlWidgets[n].element[o.attr("id")].value,WPGlobusCoreData.language,"RETURN_EMPTY"))})})},updateElements:function(s){void 0===s&&(s=!0),a.each(WPGlobusCustomize.controlInstances,function(t,e){if(!e.userControl.enabled)return!0;var o=wp.customize.control.instance(t);if("link"==e.type){var n=c.getTranslations(WPGlobusCustomize.controlInstances[t].setting);s?(o.setting.set(n[WPGlobusCoreData.language]),e.element.val(o.setting())):e.element.val(n[WPGlobusCoreData.language])}else s?(o.setting.set(WPGlobusCore.TextFilter(WPGlobusCustomize.controlInstances[t].setting,WPGlobusCoreData.language,"RETURN_EMPTY")),e.element.val(o.setting())):e.element.val(WPGlobusCore.TextFilter(WPGlobusCustomize.controlInstances[t].setting,WPGlobusCoreData.language,"RETURN_EMPTY"))})},onSubmitEvents:function(t){"mouseenter"==t.type?a.each(c.controlWidgets[a(this).data("widget")].element,function(t,e){a("#"+t).val(e.value)}):"mouseleave"==t.type?c.widgetKeep||a.each(c.controlWidgets[a(this).data("widget")].element,function(t,e){a("#"+t).val(WPGlobusCore.TextFilter(e.value,WPGlobusCoreData.language,"RETURN_EMPTY"))}):"click"==t.type&&(c.widgetKeep=!0)},attachWidgetListeners:function(t){void 0!==t.submit[0].id&&a(document).on("mouseenter","#"+t.submit[0].id,c.onSubmitEvents).on("mouseleave","#"+t.submit[0].id,c.onSubmitEvents).on("click","#"+t.submit[0].id,c.onSubmitEvents)},attachListeners:function(){a(".wpglobus-customize-control").on("keyup",function(t){var e=a(this),o=e.data("customize-setting-link");void 0===WPGlobusCustomize.controlInstances[o]&&(o=e.data("wpglobus-customize-control"),void 0===WPGlobusCustomize.controlInstances[o])||("link"==WPGlobusCustomize.controlInstances[o].type?WPGlobusCustomize.controlInstances[o].setting=c.getString(WPGlobusCustomize.controlInstances[o].setting,e.val(),WPGlobusCoreData.language):WPGlobusCustomize.controlInstances[o].setting=WPGlobusCore.getString(WPGlobusCustomize.controlInstances[o].setting,e.val(),WPGlobusCoreData.language))}),a(document).on("keyup",".wpglobus-customize-widget-control",function(t){var e=a(this),o=e.data("widget");void 0!==WPGlobusCustomize.controlWidgets[o]&&(WPGlobusCustomize.controlWidgets[o].element[e.attr("id")].value=WPGlobusCore.getString(WPGlobusCustomize.controlWidgets[o].element[e.attr("id")].value,e.val(),WPGlobusCoreData.language))}),a("#save").on("mouseenter",function(t){a.each(WPGlobusCustomize.controlInstances,function(t,e){if(e.userControl.enabled){var o=wp.customize.control.instance(t);o.setting.set(e.setting),e.element.val(o.setting())}})}).on("mouseleave",function(t){c.instancesKeep||c.updateElements()}).on("click",function(t){c.instancesKeep=!0}),a(document).on("ajaxComplete",function(t,n){void 0!==n.responseText&&('{"success":true,"data":[]}'==n.responseText?c.updateElements(!1):(0<=n.responseText.indexOf("WP_CUSTOMIZER_SIGNATURE")&&(c.action="customizerAjaxComplete",c.setControlInstances()),a.each(WPGlobusCustomize.controlWidgets,function(t,e){var o=t.replace("_","-");if(0<=n.responseText.indexOf(o))return e.submit.css({display:"block"}),e.control.liveUpdateMode=!1,a.each(e.element,function(t,e){a("#"+t).val(WPGlobusCore.TextFilter(e.value,WPGlobusCoreData.language,"RETURN_EMPTY"))}),e.inWidgetTitle.text(": "+WPGlobusCore.TextFilter(e.control.setting().title,WPGlobusCustomize.languageAdmin)),c.widgetKeep=!1})))}),a(document).on("click",".widget-title, .widget-title-action",function(t){var o=a(this).parents(".customize-control-widget_form").attr("id");a.each(c.controlWidgets,function(t,e){if("#"+o==e.parent)return c.ctrlWidgetCallback(t),!1})})}};WPGlobusCustomize=a.extend({},WPGlobusCustomize,c),WPGlobusCustomize.init()});
includes/js/wpglobus-customize-control170.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(document).ready(function(c){"use strict";var u={languages:{},index:0,length:0,controlInstances:{},controlWidgets:{},instancesKeep:!1,widgetKeep:!1,action:!1,customizeSave:!1,selectorHtml:'<span style="margin-left:5px;" class="wpglobus-icon-globe"></span><span style="font-weight:bold;">{{language}}</span>',settingsSectionExpand:function(){c(document).triggerHandler("wpglobus_fields_settings_section_expand",[this,u])},init:function(t){u.setTitle(),"false"!=WPGlobusCustomizeOptions.themeEnabled&&(c.each(WPGlobusCoreData.enabled_languages,function(t,e){u.languages[t]=e,u.length=t}),u.addLanguageSelector(),u.setControlInstances(),u.setFieldsSection(),u.attachListeners(),u.setTinymce())},updateTinymce:function(t){"tinymce"==WPGlobusCustomize.controlInstances[this.id].type&&(WPGlobusCustomize.controlInstances[this.id].setting=WPGlobusCore.getString(WPGlobusCustomize.controlInstances[this.id].setting,t.target.textContent,WPGlobusCoreData.language))},setTinymce:function(t){c(document).on("tinymce-editor-init",function(t,e){"object"==typeof u.controlInstances[e.id]&&(u.controlInstances[e.id].type="tinymce",c(e.iframeElement).addClass("wpglobus-customize-control").css({width:"99%"}),e.on("input",_.debounce(u.updateTinymce,300)))})},getSize:function(t){return void 0===t?_.size(u.controlInstances):"widget"==t?_.size(u.controlWidgets):null},setFieldsSection:function(){var o={},n=c(".wpglobus-fields_settings_control_box").data("section-template"),s="",i="",l="";c.each(WPGlobusCustomize.controlInstances,function(t,e){void 0===o[e.section]&&(o[e.section]={}),o[e.section][t]=e}),c.each(o,function(t,e){if(i="<ul>",c.each(e,function(t,e){l=e.userControl.enabled?" checked ":"",i+='<li id="'+e.fieldSettings.itemID+'">',i+='<input id="'+e.fieldSettings.cbID+'" data-control="'+t+'" class="wpglobus-customize-cb-control" type="checkbox"'+l+' /> <span class="wpglobus-cb-control-title">'+e.title+"</span>",i+="</li>"}),i+="</ul>",void 0===wp.customize.section(t))return!0;s=(s=(s=(s=n.replace("{{section_title}}",wp.customize.section(t).params.title)).replace(/{{section}}/g,t)).replace("{{section_id}}",'"'+t+'"')).replace("{{items}}",i),c(s).insertBefore(c("#"+WPGlobusCustomizeOptions.userControlSaveButton))}),c("#accordion-section-wpglobus_fields_settings_section").css({"margin-top":"15px"}),c(WPGlobusCustomizeOptions.helpButton).insertAfter(c("#accordion-section-wpglobus_fields_settings_section .customize-action")),c("#accordion-section-wpglobus_fields_settings_section .customize-section-description").addClass("hidden"),c(document).on("click","."+WPGlobusCustomizeOptions.userControlIconClass,function(t){var o=c(this).data("section");c(WPGlobusCustomizeOptions.userControlBoxSelector).each(function(t,e){o==c(e).data("section")?c(this).css({display:"block"}):c(this).css({display:"none"})}),wp.customize.control("wpglobus_fields_settings_section").expand({completeCallback:u.settingsSectionExpand})}),c(".wpglobus-customize-icon-help.customize-help-toggle").on("click",function(t){c("#accordion-section-wpglobus_fields_settings_section .customize-section-description").toggleClass("hidden")})},setUserControls:function(t,e){var o=e.controlSelector+" "+e.selector,n='<img class="'+WPGlobusCustomizeOptions.userControlIconClass+'" data-section="'+e.section+'" style="position:absolute;right:0px;cursor:pointer;" src="'+WPGlobusCustomizeOptions.userControlIcon+'" />';c(n).insertBefore(o),e.userControl.enabled||(1<c(o).length?c(o).each(function(t,e){c(e).removeClass(WPGlobusCustomize.controlClass)}):c(o).removeClass(WPGlobusCustomize.controlClass).val(e.setting))},ctrlMenuItemsCallback:function(t,e){},ctrlWidgetCallback:function(i,l){if(u.action=!1,void 0===u.controlWidgets[i].element){void 0===l&&(l=wp.customize.control.instance(i)),u.controlWidgets[i].element={},u.controlWidgets[i].control=l,u.controlWidgets[i].inWidgetTitle=l.container.find(".in-widget-title"),u.controlWidgets[i].parent=l.selector;var t=l.container.find("input[type=submit]");0!=t.length&&(t.css({display:"block"}),t.attr("data-widget",i),u.controlWidgets[i].submit=t,u.attachWidgetListeners(u.controlWidgets[i])),l.liveUpdateMode=!1,void 0===l.setting().title?u.controlWidgets[i].inWidgetTitle.text(""):u.controlWidgets[i].inWidgetTitle.text(": "+WPGlobusCore.TextFilter(l.setting().title,WPGlobusCustomize.languageAdmin)),c.each(WPGlobusCustomize.elementSelector,function(t,n){var s=l.container.find(n);0!=s.length&&c.each(s,function(t,e){if(void 0===e.id||""==e.id)return!0;var o=c(s[t]);void 0===u.controlWidgets[i].element[e.id]&&(u.controlWidgets[i].element[e.id]={}),o.addClass("wpglobus-customize-widget-control"),o.attr("data-widget",i),u.controlWidgets[i].element[e.id].element=o,u.controlWidgets[i].element[e.id].setting=l.setting(),u.controlWidgets[i].element[e.id].selector=n,u.controlWidgets[i].element[e.id].value=e.defaultValue,o.val(WPGlobusCore.TextFilter(e.defaultValue,WPGlobusCoreData.language,"RETURN_EMPTY"))})}),c(document).triggerHandler("wpglobus_customize_control_added_widget",[i])}},ctrlCallback:function(o,i,t){var n=!1;if(c.each(WPGlobusCustomize.disabledSections,function(t,e){if(o.section()==e)return!(n=!0)}),!n&&(c.each(WPGlobusCustomize.disabledSettingMask,function(t,e){if(0<=i.indexOf(e))return!(n=!0)}),!n)){var l=wp.customize.control.instance(i);if(0<=i.indexOf("widget"))return void 0===u.controlWidgets[i]&&(u.controlWidgets[i]={},u.action&&u.ctrlWidgetCallback(i,l)),u.controlWidgets[i].parent=l.selector,1!=c(l.selector).length?u.controlWidgets[i].observer=null:(u.controlWidgets[i].observer=new MutationObserver(function(t){t.forEach(function(t){"class"==t.attributeName&&-1!=t.target.className.indexOf("expanding")&&u.ctrlWidgetCallback(i)})}),u.controlWidgets[i].observer.observe(document.querySelector(u.controlWidgets[i].parent),{attributes:!0,childList:!0,characterData:!0})),!1;if(void 0===u.controlInstances[i]){var a=!0;c.each(WPGlobusCustomize.elementSelector,function(t,e){var s=l.container.find(e);0!=s.length&&(u.controlInstances[i]={},u.controlInstances[i].element=s,u.controlInstances[i].elementID=s.attr("id")?"#"+s.attr("id"):void 0,u.controlInstances[i].setting=l.setting(),u.controlInstances[i].selector=e,u.controlInstances[i].controlSelector=l.selector,u.controlInstances[i].type="",u.controlInstances[i].section=l.section(),u.controlInstances[i].title=null,u.controlInstances[i].userControl=null,u.controlInstances[i].fieldSettings={},u.controlInstances[i].fieldSettings.itemID="item-wpglobus-cb-control-"+WPGlobusDialogApp.convertToId(i),u.controlInstances[i].fieldSettings.cbID="wpglobus-cb-control-"+WPGlobusDialogApp.convertToId(i),c.each(WPGlobusCustomize.setLinkBy,function(t,e){if(0<=i.indexOf(e)){if(u.controlInstances[i].type="link",""==u.controlInstances[i].setting&&(u.controlInstances[i].setting=s[0].defaultValue),WPGlobusCustomize.changeset_uuid){var o=wp.customize.control(i).setting();if(-1!==o.indexOf("|||")){var n=u.getTranslations(o);wp.customize.control(i).setting(n[WPGlobusCoreData.default_language]),c(WPGlobusCustomize.controlInstances[i].controlSelector+" "+WPGlobusCustomize.controlInstances[i].selector).val(n[WPGlobusCoreData.default_language])}}s.addClass("wpglobus-control-link")}}),""===u.controlInstances[i].type&&(u.controlInstances[i].type="textarea"==e?"textarea":"text"),s.val(WPGlobusCore.TextFilter(u.controlInstances[i].setting,WPGlobusCoreData.language,"RETURN_EMPTY")),s.addClass("wpglobus-customize-control"),s.attr("data-wpglobus-customize-control",u.controlInstances[i].controlSelector.replace("#customize-control-","")),"link"==u.controlInstances[i].type&&(u.controlInstances[i].setting=u.convertString(s[0].defaultValue)),u.controlInstances[i].title=l.params.label,null!==WPGlobusCustomizeOptions.userControl&&void 0!==WPGlobusCustomizeOptions.userControl[WPGlobusCustomizeOptions.themeName]&&void 0!==WPGlobusCustomizeOptions.userControl[WPGlobusCustomizeOptions.themeName][i]&&"disable"==WPGlobusCustomizeOptions.userControl[WPGlobusCustomizeOptions.themeName][i]&&(a=!1),u.controlInstances[i].userControl={},u.controlInstances[i].userControl.enabled=a,u.setUserControls(i,u.controlInstances[i]))})}}},setControlInstances:function(){wp.customize.control.each(u.ctrlCallback)},setTitle:function(){c(WPGlobusCoreData.customize.info.element).html(WPGlobusCoreData.customize.info.html)},convertString:function(t){if(void 0===t)return t;var o=[],e=WPGlobusCore.getTranslations(t),n=0,s=!0;return t==e[WPGlobusCoreData.default_language]?t:(c.each(e,function(t,e){""==e?o[n]="null":(s=!1,o[n]=e),n++}),s?"":o.join("|||"))},getTranslations:function(t){if(void 0===t)return t;var o={},n=t.split("|||");return c.each(WPGlobusCoreData.enabled_languages,function(t,e){o[e]=void 0===n[t]||"null"===n[t]?"":n[t]}),o},getString:function(t,o,n){if(void 0===t)return t;void 0===o&&(o=""),void 0===n&&(n=WPGlobusCoreData.language);var e=u.getTranslations(t),s=[],i=0,l=!0;return c.each(e,function(t,e){t==n?(o=o.trim(),s[i]=""==o?"null":o):s[i]=""==e?"null":e,t!=WPGlobusCoreData.default_language&&"null"!=s[i]&&(l=!1),i++}),s=l?s[0]:s.join("|||")},addLanguageSelector:function(){c(WPGlobusCustomize.selectorButton).insertAfter(".customize-controls-preview-toggle"),c(".wpglobus-customize-selector").html(u.selectorHtml.replace("{{language}}",WPGlobusCoreData.language)),c(document).on("click",".wpglobus-customize-selector",function(t){u.index>u.length-1?u.index=0:u.index++,WPGlobusCoreData.language=u.languages[u.index],c(this).html(u.selectorHtml.replace("{{language}}",WPGlobusCoreData.language)),c(document).triggerHandler("wpglobus_customize_control_language",[WPGlobusCoreData.language]),c(".wpglobus-customize-control").each(function(t,e){var o=c(e),n=o.data("customize-setting-link");if(void 0!==WPGlobusCustomize.controlInstances[n]||(n=o.data("wpglobus-customize-control"),void 0!==WPGlobusCustomize.controlInstances[n]))if(o.hasClass("wpglobus-control-link")){var s=u.getTranslations(WPGlobusCustomize.controlInstances[n].setting);o.val(s[WPGlobusCoreData.language])}else{s=WPGlobusCore.TextFilter(WPGlobusCustomize.controlInstances[n].setting,WPGlobusCoreData.language,"RETURN_EMPTY");"tinymce"==WPGlobusCustomize.controlInstances[n].type&&tinymce.get(n).setContent(s,{format:"raw"}),o.val(WPGlobusCore.TextFilter(s,"RETURN_EMPTY"))}}),c(".wpglobus-customize-widget-control").each(function(t,e){var o=c(e),n=o.data("widget");if(void 0===o.attr("id"))return!0;o.val(WPGlobusCore.TextFilter(WPGlobusCustomize.controlWidgets[n].element[o.attr("id")].value,WPGlobusCoreData.language,"RETURN_EMPTY"))})})},updateElements:function(s){void 0===s&&(s=!0),c.each(WPGlobusCustomize.controlInstances,function(t,e){if(!e.userControl.enabled)return!0;var o=wp.customize.control.instance(t);if("link"==e.type){var n=u.getTranslations(WPGlobusCustomize.controlInstances[t].setting);s?(o.setting.set(n[WPGlobusCoreData.language]),e.element.val(o.setting())):e.element.val(n[WPGlobusCoreData.language])}else if("tinymce"==e.type){n=WPGlobusCore.TextFilter(WPGlobusCustomize.controlInstances[t].setting,WPGlobusCoreData.language,"RETURN_EMPTY");tinymce.get(t).setContent(n,{format:"raw"}),e.element.val(n)}else s?(o.setting.set(WPGlobusCore.TextFilter(WPGlobusCustomize.controlInstances[t].setting,WPGlobusCoreData.language,"RETURN_EMPTY")),e.element.val(o.setting())):e.element.val(WPGlobusCore.TextFilter(WPGlobusCustomize.controlInstances[t].setting,WPGlobusCoreData.language,"RETURN_EMPTY"))})},onSubmitEvents:function(t){"mouseenter"==t.type?c.each(u.controlWidgets[c(this).data("widget")].element,function(t,e){c("#"+t).val(e.value)}):"mouseleave"==t.type?u.widgetKeep||c.each(u.controlWidgets[c(this).data("widget")].element,function(t,e){c("#"+t).val(WPGlobusCore.TextFilter(e.value,WPGlobusCoreData.language,"RETURN_EMPTY"))}):"click"==t.type&&(u.widgetKeep=!0)},attachWidgetListeners:function(t){void 0!==t.submit[0].id&&c(document).on("mouseenter","#"+t.submit[0].id,u.onSubmitEvents).on("mouseleave","#"+t.submit[0].id,u.onSubmitEvents).on("click","#"+t.submit[0].id,u.onSubmitEvents)},attachListeners:function(){c(".wpglobus-customize-control").on("keyup",function(t){var e=c(this),o=e.data("customize-setting-link");void 0===WPGlobusCustomize.controlInstances[o]&&(o=e.data("wpglobus-customize-control"),WPGlobusCustomize.controlInstances[o]),void 0===c(document).triggerHandler("wpglobus_customize_control_keyup",[e,o])&&("link"==WPGlobusCustomize.controlInstances[o].type?WPGlobusCustomize.controlInstances[o].setting=u.getString(WPGlobusCustomize.controlInstances[o].setting,e.val(),WPGlobusCoreData.language):WPGlobusCustomize.controlInstances[o].setting=WPGlobusCore.getString(WPGlobusCustomize.controlInstances[o].setting,e.val(),WPGlobusCoreData.language))}),c(document).on("keyup",".wpglobus-customize-widget-control",function(t){var e=c(this),o=e.data("widget");void 0!==WPGlobusCustomize.controlWidgets[o]&&(WPGlobusCustomize.controlWidgets[o].element[e.attr("id")].value=WPGlobusCore.getString(WPGlobusCustomize.controlWidgets[o].element[e.attr("id")].value,e.val(),WPGlobusCoreData.language))}),c(document).on("mouseenter","#save",function(t){c.each(WPGlobusCustomize.controlInstances,function(t,e){if(e.userControl.enabled){var o=wp.customize.control.instance(t);"tinymce"==e.type&&tinymce.get(t).setContent(e.setting,{format:"raw"}),o.setting.set(e.setting),e.element.val(o.setting())}})}).on("mouseleave","#save",function(t){u.instancesKeep||(u.updateElements(),wp.customize.previewer.refresh())}),c("#save").on("click",function(t){u.instancesKeep=!0}),c(document).on("ajaxSend",function(t,e,o){void 0!==o.data&&-1!=o.data.indexOf("wp_customize=on")&&-1!=o.data.indexOf("action=customize_save")&&(u.customizeSave=!0)}),c(document).on("ajaxComplete",function(t,n){void 0!==n.responseText&&(u.customizeSave?(u.updateElements(!1),u.instancesKeep&&(u.instancesKeep=!1)):(0<=n.responseText.indexOf("WP_CUSTOMIZER_SIGNATURE")&&(u.action="customizerAjaxComplete",u.setControlInstances()),c.each(WPGlobusCustomize.controlWidgets,function(t,e){var o=t.replace("_","-");if(0<=n.responseText.indexOf(o))return e.submit.css({display:"block"}),e.control.liveUpdateMode=!1,c.each(e.element,function(t,e){c("#"+t).val(WPGlobusCore.TextFilter(e.value,WPGlobusCoreData.language,"RETURN_EMPTY"))}),e.inWidgetTitle.text(": "+WPGlobusCore.TextFilter(e.control.setting().title,WPGlobusCustomize.languageAdmin)),u.widgetKeep=!1})),u.customizeSave=!1,wp.customize.previewer.refresh())})}};WPGlobusCustomize=c.extend({},WPGlobusCustomize,u),WPGlobusCustomize.init()});
1
+ jQuery(document).ready(function(c){"use strict";var u={languages:{},index:0,length:0,controlInstances:{},controlWidgets:{},instancesKeep:!1,widgetKeep:!1,action:!1,customizeSave:!1,selectorHtml:'<span style="margin-left:5px;" class="wpglobus-icon-globe"></span><span style="font-weight:bold;">{{language}}</span>',settingsSectionExpand:function(){c(document).triggerHandler("wpglobus_fields_settings_section_expand",[this,u])},init:function(t){u.setTitle(),"false"!=WPGlobusCustomizeOptions.themeEnabled&&(c.each(WPGlobusCoreData.enabled_languages,function(t,e){u.languages[t]=e,u.length=t}),u.addLanguageSelector(),u.setControlInstances(),u.setFieldsSection(),u.attachListeners(),u.setTinymce())},updateTinymce:function(t){"tinymce"==WPGlobusCustomize.controlInstances[this.id].type&&(WPGlobusCustomize.controlInstances[this.id].setting=WPGlobusCore.getString(WPGlobusCustomize.controlInstances[this.id].setting,t.target.textContent,WPGlobusCoreData.language))},setTinymce:function(t){c(document).on("tinymce-editor-init",function(t,e){"object"==typeof u.controlInstances[e.id]&&(u.controlInstances[e.id].type="tinymce",c(e.iframeElement).addClass("wpglobus-customize-control").css({width:"99%"}),e.on("input",_.debounce(u.updateTinymce,300)))})},getSize:function(t){return void 0===t?_.size(u.controlInstances):"widget"==t?_.size(u.controlWidgets):null},setFieldsSection:function(){var o={},n=c(".wpglobus-fields_settings_control_box").data("section-template"),s="",i="",l="";c.each(WPGlobusCustomize.controlInstances,function(t,e){void 0===o[e.section]&&(o[e.section]={}),o[e.section][t]=e}),c.each(o,function(t,e){if(i="<ul>",c.each(e,function(t,e){l=e.userControl.enabled?" checked ":"",i+='<li id="'+e.fieldSettings.itemID+'">',i+='<input id="'+e.fieldSettings.cbID+'" data-control="'+t+'" class="wpglobus-customize-cb-control" type="checkbox"'+l+' /> <span class="wpglobus-cb-control-title">'+e.title+"</span>",i+="</li>"}),i+="</ul>",void 0===wp.customize.section(t))return!0;s=(s=(s=(s=n.replace("{{section_title}}",wp.customize.section(t).params.title)).replace(/{{section}}/g,t)).replace("{{section_id}}",'"'+t+'"')).replace("{{items}}",i),c(s).insertBefore(c("#"+WPGlobusCustomizeOptions.userControlSaveButton))}),c("#accordion-section-wpglobus_fields_settings_section").css({"margin-top":"15px"}),c(WPGlobusCustomizeOptions.helpButton).insertAfter(c("#accordion-section-wpglobus_fields_settings_section .customize-action")),c("#accordion-section-wpglobus_fields_settings_section .customize-section-description").addClass("hidden"),c(document).on("click","."+WPGlobusCustomizeOptions.userControlIconClass,function(t){var o=c(this).data("section");c(WPGlobusCustomizeOptions.userControlBoxSelector).each(function(t,e){o==c(e).data("section")?c(this).css({display:"block"}):c(this).css({display:"none"})}),wp.customize.control("wpglobus_fields_settings_section").expand({completeCallback:u.settingsSectionExpand})}),c(".wpglobus-customize-icon-help.customize-help-toggle").on("click",function(t){c("#accordion-section-wpglobus_fields_settings_section .customize-section-description").toggleClass("hidden")})},setUserControls:function(t,e){var o=e.controlSelector+" "+e.selector,n='<img class="'+WPGlobusCustomizeOptions.userControlIconClass+'" data-section="'+e.section+'" style="position:absolute;right:0px;cursor:pointer;" src="'+WPGlobusCustomizeOptions.userControlIcon+'" />';c(n).insertBefore(o),e.userControl.enabled||(1<c(o).length?c(o).each(function(t,e){c(e).removeClass(WPGlobusCustomize.controlClass)}):c(o).removeClass(WPGlobusCustomize.controlClass).val(e.setting))},ctrlMenuItemsCallback:function(t,e){},ctrlWidgetCallback:function(i,l){if(u.action=!1,void 0===u.controlWidgets[i].element){void 0===l&&(l=wp.customize.control.instance(i)),u.controlWidgets[i].element={},u.controlWidgets[i].control=l,u.controlWidgets[i].inWidgetTitle=l.container.find(".in-widget-title"),u.controlWidgets[i].parent=l.selector;var t=l.container.find("input[type=submit]");0!=t.length&&(t.css({display:"block"}),t.attr("data-widget",i),u.controlWidgets[i].submit=t,u.attachWidgetListeners(u.controlWidgets[i])),l.liveUpdateMode=!1,void 0===l.setting().title?u.controlWidgets[i].inWidgetTitle.text(""):u.controlWidgets[i].inWidgetTitle.text(": "+WPGlobusCore.TextFilter(l.setting().title,WPGlobusCustomize.languageAdmin)),c.each(WPGlobusCustomize.elementSelector,function(t,n){var s=l.container.find(n);0!=s.length&&c.each(s,function(t,e){if(void 0===e.id||""==e.id)return!0;var o=c(s[t]);void 0===u.controlWidgets[i].element[e.id]&&(u.controlWidgets[i].element[e.id]={}),o.addClass("wpglobus-customize-widget-control"),o.attr("data-widget",i),u.controlWidgets[i].element[e.id].element=o,u.controlWidgets[i].element[e.id].setting=l.setting(),u.controlWidgets[i].element[e.id].selector=n,u.controlWidgets[i].element[e.id].value=e.defaultValue,o.val(WPGlobusCore.TextFilter(e.defaultValue,WPGlobusCoreData.language,"RETURN_EMPTY"))})}),c(document).triggerHandler("wpglobus_customize_control_added_widget",[i])}},ctrlCallback:function(o,i,t){var n=!1;if(c.each(WPGlobusCustomize.disabledSections,function(t,e){if(o.section()==e)return!(n=!0)}),!n&&(c.each(WPGlobusCustomize.disabledSettingMask,function(t,e){if(0<=i.indexOf(e))return!(n=!0)}),!n)){var l=wp.customize.control.instance(i);if(0<=i.indexOf("widget"))return void 0===u.controlWidgets[i]&&(u.controlWidgets[i]={},u.action&&u.ctrlWidgetCallback(i,l)),u.controlWidgets[i].parent=l.selector,1!=c(l.selector).length?u.controlWidgets[i].observer=null:(u.controlWidgets[i].observer=new MutationObserver(function(t){t.forEach(function(t){"class"==t.attributeName&&-1!=t.target.className.indexOf("expanding")&&u.ctrlWidgetCallback(i)})}),u.controlWidgets[i].observer.observe(document.querySelector(u.controlWidgets[i].parent),{attributes:!0,childList:!0,characterData:!0})),!1;if(void 0===u.controlInstances[i]){var a=!0;c.each(WPGlobusCustomize.elementSelector,function(t,e){var s=l.container.find(e);0!=s.length&&(u.controlInstances[i]={},u.controlInstances[i].element=s,u.controlInstances[i].elementID=s.attr("id")?"#"+s.attr("id"):void 0,u.controlInstances[i].setting=l.setting(),u.controlInstances[i].selector=e,u.controlInstances[i].controlSelector=l.selector,u.controlInstances[i].type="",u.controlInstances[i].section=l.section(),u.controlInstances[i].title=null,u.controlInstances[i].userControl=null,u.controlInstances[i].fieldSettings={},u.controlInstances[i].fieldSettings.itemID="item-wpglobus-cb-control-"+WPGlobusDialogApp.convertToId(i),u.controlInstances[i].fieldSettings.cbID="wpglobus-cb-control-"+WPGlobusDialogApp.convertToId(i),c.each(WPGlobusCustomize.setLinkBy,function(t,e){if(0<=i.indexOf(e)){if(u.controlInstances[i].type="link",""==u.controlInstances[i].setting&&(u.controlInstances[i].setting=s[0].defaultValue),WPGlobusCustomize.changeset_uuid){var o=wp.customize.control(i).setting();if(-1!==o.indexOf("|||")){var n=u.getTranslations(o);wp.customize.control(i).setting(n[WPGlobusCoreData.default_language]),c(WPGlobusCustomize.controlInstances[i].controlSelector+" "+WPGlobusCustomize.controlInstances[i].selector).val(n[WPGlobusCoreData.default_language])}}s.addClass("wpglobus-control-link")}}),""===u.controlInstances[i].type&&(u.controlInstances[i].type="textarea"==e?"textarea":"text"),s.val(WPGlobusCore.TextFilter(u.controlInstances[i].setting,WPGlobusCoreData.language,"RETURN_EMPTY")),s.addClass("wpglobus-customize-control"),s.attr("data-wpglobus-customize-control",u.controlInstances[i].controlSelector.replace("#customize-control-","")),"link"==u.controlInstances[i].type&&(u.controlInstances[i].setting=u.convertString(s[0].defaultValue)),u.controlInstances[i].title=l.params.label,null!==WPGlobusCustomizeOptions.userControl&&void 0!==WPGlobusCustomizeOptions.userControl[WPGlobusCustomizeOptions.themeName]&&void 0!==WPGlobusCustomizeOptions.userControl[WPGlobusCustomizeOptions.themeName][i]&&"disable"==WPGlobusCustomizeOptions.userControl[WPGlobusCustomizeOptions.themeName][i]&&(a=!1),u.controlInstances[i].userControl={},u.controlInstances[i].userControl.enabled=a,u.setUserControls(i,u.controlInstances[i]))})}}},setControlInstances:function(){wp.customize.control.each(u.ctrlCallback)},setTitle:function(){c(WPGlobusCoreData.customize.info.element).html(WPGlobusCoreData.customize.info.html)},convertString:function(t){if(void 0===t)return t;var o=[],e=WPGlobusCore.getTranslations(t),n=0,s=!0;return t==e[WPGlobusCoreData.default_language]?t:(c.each(e,function(t,e){o[n]=""==e?"null":(s=!1,e),n++}),s?"":o.join("|||"))},getTranslations:function(t){if(void 0===t)return t;var o={},n=t.split("|||");return c.each(WPGlobusCoreData.enabled_languages,function(t,e){o[e]=void 0===n[t]||"null"===n[t]?"":n[t]}),o},getString:function(t,o,n){if(void 0===t)return t;void 0===o&&(o=""),void 0===n&&(n=WPGlobusCoreData.language);var e=u.getTranslations(t),s=[],i=0,l=!0;return c.each(e,function(t,e){s[i]=t==n?""==(o=o.trim())?"null":o:""==e?"null":e,t!=WPGlobusCoreData.default_language&&"null"!=s[i]&&(l=!1),i++}),s=l?s[0]:s.join("|||")},addLanguageSelector:function(){c(WPGlobusCustomize.selectorButton).insertAfter(".customize-controls-preview-toggle"),c(".wpglobus-customize-selector").html(u.selectorHtml.replace("{{language}}",WPGlobusCoreData.language)),c(document).on("click",".wpglobus-customize-selector",function(t){u.index>u.length-1?u.index=0:u.index++,WPGlobusCoreData.language=u.languages[u.index],c(this).html(u.selectorHtml.replace("{{language}}",WPGlobusCoreData.language)),c(document).triggerHandler("wpglobus_customize_control_language",[WPGlobusCoreData.language]),c(".wpglobus-customize-control").each(function(t,e){var o=c(e),n=o.data("customize-setting-link");if(void 0!==WPGlobusCustomize.controlInstances[n]||(n=o.data("wpglobus-customize-control"),void 0!==WPGlobusCustomize.controlInstances[n]))if(o.hasClass("wpglobus-control-link")){var s=u.getTranslations(WPGlobusCustomize.controlInstances[n].setting);o.val(s[WPGlobusCoreData.language])}else{s=WPGlobusCore.TextFilter(WPGlobusCustomize.controlInstances[n].setting,WPGlobusCoreData.language,"RETURN_EMPTY");"tinymce"==WPGlobusCustomize.controlInstances[n].type&&tinymce.get(n).setContent(s,{format:"raw"}),o.val(WPGlobusCore.TextFilter(s,"RETURN_EMPTY"))}}),c(".wpglobus-customize-widget-control").each(function(t,e){var o=c(e),n=o.data("widget");if(void 0===o.attr("id"))return!0;o.val(WPGlobusCore.TextFilter(WPGlobusCustomize.controlWidgets[n].element[o.attr("id")].value,WPGlobusCoreData.language,"RETURN_EMPTY"))})})},updateElements:function(s){void 0===s&&(s=!0),c.each(WPGlobusCustomize.controlInstances,function(t,e){if(!e.userControl.enabled)return!0;var o=wp.customize.control.instance(t);if("link"==e.type){var n=u.getTranslations(WPGlobusCustomize.controlInstances[t].setting);s?(o.setting.set(n[WPGlobusCoreData.language]),e.element.val(o.setting())):e.element.val(n[WPGlobusCoreData.language])}else if("tinymce"==e.type){n=WPGlobusCore.TextFilter(WPGlobusCustomize.controlInstances[t].setting,WPGlobusCoreData.language,"RETURN_EMPTY");tinymce.get(t).setContent(n,{format:"raw"}),e.element.val(n)}else s?(o.setting.set(WPGlobusCore.TextFilter(WPGlobusCustomize.controlInstances[t].setting,WPGlobusCoreData.language,"RETURN_EMPTY")),e.element.val(o.setting())):e.element.val(WPGlobusCore.TextFilter(WPGlobusCustomize.controlInstances[t].setting,WPGlobusCoreData.language,"RETURN_EMPTY"))})},onSubmitEvents:function(t){"mouseenter"==t.type?c.each(u.controlWidgets[c(this).data("widget")].element,function(t,e){c("#"+t).val(e.value)}):"mouseleave"==t.type?u.widgetKeep||c.each(u.controlWidgets[c(this).data("widget")].element,function(t,e){c("#"+t).val(WPGlobusCore.TextFilter(e.value,WPGlobusCoreData.language,"RETURN_EMPTY"))}):"click"==t.type&&(u.widgetKeep=!0)},attachWidgetListeners:function(t){void 0!==t.submit[0].id&&c(document).on("mouseenter","#"+t.submit[0].id,u.onSubmitEvents).on("mouseleave","#"+t.submit[0].id,u.onSubmitEvents).on("click","#"+t.submit[0].id,u.onSubmitEvents)},attachListeners:function(){c(".wpglobus-customize-control").on("keyup",function(t){var e=c(this),o=e.data("customize-setting-link");void 0===WPGlobusCustomize.controlInstances[o]&&(o=e.data("wpglobus-customize-control"),WPGlobusCustomize.controlInstances[o]),void 0===c(document).triggerHandler("wpglobus_customize_control_keyup",[e,o])&&("link"==WPGlobusCustomize.controlInstances[o].type?WPGlobusCustomize.controlInstances[o].setting=u.getString(WPGlobusCustomize.controlInstances[o].setting,e.val(),WPGlobusCoreData.language):WPGlobusCustomize.controlInstances[o].setting=WPGlobusCore.getString(WPGlobusCustomize.controlInstances[o].setting,e.val(),WPGlobusCoreData.language))}),c(document).on("keyup",".wpglobus-customize-widget-control",function(t){var e=c(this),o=e.data("widget");void 0!==WPGlobusCustomize.controlWidgets[o]&&(WPGlobusCustomize.controlWidgets[o].element[e.attr("id")].value=WPGlobusCore.getString(WPGlobusCustomize.controlWidgets[o].element[e.attr("id")].value,e.val(),WPGlobusCoreData.language))}),c(document).on("mouseenter","#save",function(t){c.each(WPGlobusCustomize.controlInstances,function(t,e){if(e.userControl.enabled){var o=wp.customize.control.instance(t);"tinymce"==e.type&&tinymce.get(t).setContent(e.setting,{format:"raw"}),o.setting.set(e.setting),e.element.val(o.setting())}})}).on("mouseleave","#save",function(t){u.instancesKeep||(u.updateElements(),wp.customize.previewer.refresh())}),c("#save").on("click",function(t){u.instancesKeep=!0}),c(document).on("ajaxSend",function(t,e,o){void 0!==o.data&&-1!=o.data.indexOf("wp_customize=on")&&-1!=o.data.indexOf("action=customize_save")&&(u.customizeSave=!0)}),c(document).on("ajaxComplete",function(t,n){void 0!==n.responseText&&(u.customizeSave?(u.updateElements(!1),u.instancesKeep&&(u.instancesKeep=!1)):(0<=n.responseText.indexOf("WP_CUSTOMIZER_SIGNATURE")&&(u.action="customizerAjaxComplete",u.setControlInstances()),c.each(WPGlobusCustomize.controlWidgets,function(t,e){var o=t.replace("_","-");if(0<=n.responseText.indexOf(o))return e.submit.css({display:"block"}),e.control.liveUpdateMode=!1,c.each(e.element,function(t,e){c("#"+t).val(WPGlobusCore.TextFilter(e.value,WPGlobusCoreData.language,"RETURN_EMPTY"))}),e.inWidgetTitle.text(": "+WPGlobusCore.TextFilter(e.control.setting().title,WPGlobusCustomize.languageAdmin)),u.widgetKeep=!1})),u.customizeSave=!1,wp.customize.previewer.refresh())})}};WPGlobusCustomize=c.extend({},WPGlobusCustomize,u),WPGlobusCustomize.init()});
includes/js/wpglobus-customize-control190.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(document).ready(function(c){"use strict";var u={languages:{},index:0,length:0,controlInstances:{},controlWidgets:{},instancesKeep:!1,widgetKeep:!1,action:!1,customizeSave:!1,selectorHtml:'<span style="margin-left:5px;" class="wpglobus-icon-globe"></span><span class="current-language" style="font-weight:bold;">{{language}}</span>',settingsSectionExpand:function(){c(document).triggerHandler("wpglobus_fields_settings_section_expand",[this,u])},init:function(e){u.setTitle(),"false"!=WPGlobusCustomizeOptions.themeEnabled&&(c.each(WPGlobusCoreData.enabled_languages,function(e,t){u.languages[e]=t,u.length=e}),u.addLanguageSelector(),u.setControlInstances(),u.setFieldsSection(),u.attachListeners(),u.setTinymce())},updateTinymce:function(e){"tinymce"==WPGlobusCustomize.controlInstances[this.id].type&&(WPGlobusCustomize.controlInstances[this.id].setting=WPGlobusCore.getString(WPGlobusCustomize.controlInstances[this.id].setting,e.target.textContent,WPGlobusCoreData.language))},setTinymce:function(e){c(document).on("tinymce-editor-init",function(e,t){"object"==typeof u.controlInstances[t.id]&&(u.controlInstances[t.id].type="tinymce",c(t.iframeElement).addClass("wpglobus-customize-control").css({width:"99%"}),t.on("input",_.debounce(u.updateTinymce,300)))})},getSize:function(e){return void 0===e?_.size(u.controlInstances):"widget"==e?_.size(u.controlWidgets):null},setFieldsSection:function(){var o={},n=c(".wpglobus-fields_settings_control_box").data("section-template"),s="",l="",i="";c.each(WPGlobusCustomize.controlInstances,function(e,t){void 0===o[t.section]&&(o[t.section]={}),o[t.section][e]=t}),c.each(o,function(e,t){if(l="<ul>",c.each(t,function(e,t){i=t.userControl.enabled?" checked ":"",l+='<li id="'+t.fieldSettings.itemID+'">',l+='<input id="'+t.fieldSettings.cbID+'" data-control="'+e+'" class="wpglobus-customize-cb-control" type="checkbox"'+i+' /> <span class="wpglobus-cb-control-title">'+t.title+"</span>",l+="</li>"}),l+="</ul>",void 0===wp.customize.section(e))return!0;s=(s=(s=(s=n.replace("{{section_title}}",wp.customize.section(e).params.title)).replace(/{{section}}/g,e)).replace("{{section_id}}",'"'+e+'"')).replace("{{items}}",l),c(s).insertBefore(c("#"+WPGlobusCustomizeOptions.userControlSaveButton))}),c("#accordion-section-wpglobus_fields_settings_section").css({"margin-top":"15px"}),c(WPGlobusCustomizeOptions.helpButton).insertAfter(c("#accordion-section-wpglobus_fields_settings_section .customize-action")),c("#accordion-section-wpglobus_fields_settings_section .customize-section-description").addClass("hidden"),c(document).on("click","."+WPGlobusCustomizeOptions.userControlIconClass,function(e){var o=c(this).data("section");c(WPGlobusCustomizeOptions.userControlBoxSelector).each(function(e,t){o==c(t).data("section")?c(this).css({display:"block"}):c(this).css({display:"none"})}),wp.customize.control("wpglobus_fields_settings_section").expand({completeCallback:u.settingsSectionExpand})}),c(".wpglobus-customize-icon-help.customize-help-toggle").on("click",function(e){c("#accordion-section-wpglobus_fields_settings_section .customize-section-description").toggleClass("hidden")})},setUserControls:function(e,t){var o=t.controlSelector+" "+t.selector,n='<img class="'+WPGlobusCustomizeOptions.userControlIconClass+'" data-section="'+t.section+'" style="position:absolute;right:0px;cursor:pointer;" src="'+WPGlobusCustomizeOptions.userControlIcon+'" />';c(n).insertBefore(o),t.userControl.enabled||(1<c(o).length?c(o).each(function(e,t){c(t).removeClass(WPGlobusCustomize.controlClass)}):c(o).removeClass(WPGlobusCustomize.controlClass).val(t.setting))},ctrlMenuItemsCallback:function(e,t){},ctrlWidgetCallback:function(l,i){if(u.action=!1,void 0===u.controlWidgets[l].element){void 0===i&&(i=wp.customize.control.instance(l)),u.controlWidgets[l].element={},u.controlWidgets[l].control=i,u.controlWidgets[l].inWidgetTitle=i.container.find(".in-widget-title"),u.controlWidgets[l].parent=i.selector;var e=i.container.find("input[type=submit]");0!=e.length&&(e.css({display:"block"}),e.attr("data-widget",l),u.controlWidgets[l].submit=e,u.attachWidgetListeners(u.controlWidgets[l])),i.liveUpdateMode=!1,void 0===i.setting().title?u.controlWidgets[l].inWidgetTitle.text(""):u.controlWidgets[l].inWidgetTitle.text(": "+WPGlobusCore.TextFilter(i.setting().title,WPGlobusCustomize.languageAdmin)),c.each(WPGlobusCustomize.elementSelector,function(e,n){var s=i.container.find(n);0!=s.length&&c.each(s,function(e,t){if(void 0===t.id||""==t.id)return!0;var o=c(s[e]);void 0===u.controlWidgets[l].element[t.id]&&(u.controlWidgets[l].element[t.id]={}),o.addClass("wpglobus-customize-widget-control"),o.attr("data-widget",l),u.controlWidgets[l].element[t.id].element=o,u.controlWidgets[l].element[t.id].setting=i.setting(),u.controlWidgets[l].element[t.id].selector=n,u.controlWidgets[l].element[t.id].value=t.defaultValue,o.val(WPGlobusCore.TextFilter(t.defaultValue,WPGlobusCoreData.language,"RETURN_EMPTY"))})}),c(document).triggerHandler("wpglobus_customize_control_added_widget",[l])}},ctrlCallback:function(o,l,e){var n=!1;if(c.each(WPGlobusCustomize.disabledSections,function(e,t){if(o.section()==t)return!(n=!0)}),!n&&(c.each(WPGlobusCustomize.disabledSettingMask,function(e,t){if(0<=l.indexOf(t))return!(n=!0)}),!n)){var i=wp.customize.control.instance(l);if(0<=l.indexOf("widget"))return void 0===u.controlWidgets[l]&&(u.controlWidgets[l]={},u.action&&u.ctrlWidgetCallback(l,i)),u.controlWidgets[l].parent=i.selector,1!=c(i.selector).length?u.controlWidgets[l].observer=null:(u.controlWidgets[l].observer=new MutationObserver(function(e){e.forEach(function(e){"class"==e.attributeName&&-1!=e.target.className.indexOf("expanding")&&u.ctrlWidgetCallback(l)})}),u.controlWidgets[l].observer.observe(document.querySelector(u.controlWidgets[l].parent),{attributes:!0,childList:!0,characterData:!0})),!1;if(void 0===u.controlInstances[l]){var a=!0;c.each(WPGlobusCustomize.elementSelector,function(e,t){var s=i.container.find(t);if(0!=s.length){if("function"!=typeof i.setting)return!0;u.controlInstances[l]={},u.controlInstances[l].element=s,u.controlInstances[l].elementID=s.attr("id")?"#"+s.attr("id"):void 0,u.controlInstances[l].setting=i.setting(),u.controlInstances[l].settingType=typeof i.setting(),u.controlInstances[l].selector=t,u.controlInstances[l].controlSelector=i.selector,u.controlInstances[l].type="",u.controlInstances[l].section=i.section(),u.controlInstances[l].title=null,u.controlInstances[l].userControl=null,u.controlInstances[l].fieldSettings={},u.controlInstances[l].fieldSettings.itemID="item-wpglobus-cb-control-"+WPGlobusDialogApp.convertToId(l),u.controlInstances[l].fieldSettings.cbID="wpglobus-cb-control-"+WPGlobusDialogApp.convertToId(l),c.each(WPGlobusCustomize.setLinkBy,function(e,t){if(0<=l.indexOf(t)){if(u.controlInstances[l].type="link",""==u.controlInstances[l].setting&&(u.controlInstances[l].setting=s[0].defaultValue),WPGlobusCustomize.changeset_uuid){var o=wp.customize.control(l).setting();if(-1!==o.indexOf("|||")){var n=u.getTranslations(o);wp.customize.control(l).setting(n[WPGlobusCoreData.default_language]),c(WPGlobusCustomize.controlInstances[l].controlSelector+" "+WPGlobusCustomize.controlInstances[l].selector).val(n[WPGlobusCoreData.default_language])}}s.addClass("wpglobus-control-link")}}),""===u.controlInstances[l].type&&(u.controlInstances[l].type="textarea"==t?"textarea":"text"),"string"==u.controlInstances[l].settingType&&""!=u.controlInstances[l].setting&&s.val(WPGlobusCore.TextFilter(u.controlInstances[l].setting,WPGlobusCoreData.language,"RETURN_EMPTY")),s.addClass("wpglobus-customize-control"),s.attr("data-wpglobus-customize-control",u.controlInstances[l].controlSelector.replace("#customize-control-","")),s.attr("data-wpglobus-customize-control-setting-type",u.controlInstances[l].settingType),"link"==u.controlInstances[l].type&&(u.controlInstances[l].setting=u.convertString(s[0].defaultValue)),u.controlInstances[l].title=i.params.label,null!==WPGlobusCustomizeOptions.userControl&&void 0!==WPGlobusCustomizeOptions.userControl[WPGlobusCustomizeOptions.themeName]&&void 0!==WPGlobusCustomizeOptions.userControl[WPGlobusCustomizeOptions.themeName][l]&&"disable"==WPGlobusCustomizeOptions.userControl[WPGlobusCustomizeOptions.themeName][l]&&(a=!1),u.controlInstances[l].userControl={},u.controlInstances[l].userControl.enabled=a,u.setUserControls(l,u.controlInstances[l])}})}}},setControlInstances:function(){wp.customize.control.each(u.ctrlCallback)},setTitle:function(){c(WPGlobusCoreData.customize.info.element).html(WPGlobusCoreData.customize.info.html)},convertString:function(e){if(void 0===e)return e;var o=[],t=WPGlobusCore.getTranslations(e),n=0,s=!0;return e==t[WPGlobusCoreData.default_language]?e:(c.each(t,function(e,t){""==t?o[n]="null":(s=!1,o[n]=t),n++}),s?"":o.join("|||"))},getTranslations:function(e){if(void 0===e)return e;var o={},n=e.split("|||");return c.each(WPGlobusCoreData.enabled_languages,function(e,t){o[t]=void 0===n[e]||"null"===n[e]?"":n[e]}),o},getString:function(e,o,n){if(void 0===e)return e;void 0===o&&(o=""),void 0===n&&(n=WPGlobusCoreData.language);var t=u.getTranslations(e),s=[],l=0,i=!0;return c.each(t,function(e,t){e==n?(o=o.trim(),s[l]=""==o?"null":o):s[l]=""==t?"null":t,e!=WPGlobusCoreData.default_language&&"null"!=s[l]&&(i=!1),l++}),s=i?s[0]:s.join("|||")},addLanguageSelector:function(){"dropdown"!=WPGlobusCustomize.selectorType?(c(WPGlobusCustomize.selectorButton).insertAfter(".customize-controls-preview-toggle"),c(".wpglobus-customize-selector").html(u.selectorHtml.replace("{{language}}",WPGlobusCoreData.language)),c(document).on("click",".wpglobus-customize-selector",function(e){u.index>u.length-1?u.index=0:u.index++,WPGlobusCoreData.language=u.languages[u.index],c(this).html(u.selectorHtml.replace("{{language}}",WPGlobusCoreData.language)),c(document).triggerHandler("wpglobus_customize_control_language",[WPGlobusCoreData.language]),u.setControlsValue()})):u.addLanguageSelectorDropdown()},addLanguageSelectorDropdown:function(){c(WPGlobusCustomize.selectorButton).insertAfter(".customize-controls-preview-toggle"),c(".wpglobus-customize-selector").html(u.selectorHtml.replace("{{language}}",WPGlobusCoreData.language));var e=c(".wpglobus-customize-selector").offset(),t=e.top+46;t+="px;";var o=e.left+"px;",n=0,s='<ul class="wpglobus-customize-selector-dropdown" style="display:none;position:fixed;width:46px;border-left:1px solid #ddd;border-right:1px solid #ddd;background-color:#eee;margin:-1px 0 0;padding:0;top:'+t+"left:"+o+'">';c.each(WPGlobusCoreData.enabled_languages,function(e,t){s+='<li class="item" style="text-align:center;cursor:pointer;border-bottom:1px solid #ddd;margin:0;" data-language="'+t+'">',s+='<span class="value value-'+t+'" style="font-size:15px;">'+t+"</span>",s+="</li>"}),s+='<li class="item wpglobus-customize-item-settings" style="text-align:center;cursor:pointer;border-bottom:1px solid #ddd;margin:0;"><span style="padding-top:14px;" class="dashicons dashicons-admin-tools"></span></li>',s+="</ul>",c(".wpglobus-customize-selector").after(s),c(document).on("mouseenter",".wpglobus-customize-selector",function(e){c(".wpglobus-customize-selector-dropdown").css({display:"block"}),n=e.screenY}),c(document).on("mouseleave",".wpglobus-customize-selector",function(e){0!=n&&e.screenY-n<=0&&c(".wpglobus-customize-selector-dropdown").css({display:"none"})}),c(document).on("mouseleave",".wpglobus-customize-selector-dropdown",function(e){c(".wpglobus-customize-selector-dropdown").css({display:"none"})}),c(document).on("mouseenter",".wpglobus-customize-selector-dropdown .item",function(e){var t=c(this),o=t.data("language");t.addClass("active"),t.css({"background-color":"#fff"}),t.find(".value-"+o).css({"font-weight":"bold"})}),c(document).on("mouseleave",".wpglobus-customize-selector-dropdown .item",function(e){var t=c(this);t.removeClass("active"),t.css({"background-color":"#eee"}),c(this).find(".value").css({"font-weight":""})}),c(document).on("click",".wpglobus-customize-selector-dropdown .item",function(e){var t=c(this).data("language");void 0!==t&&t!=c(".wpglobus-customize-selector").data("language")&&u.languageChanged(t)}),c(document).on("click",".wpglobus-customize-item-settings",function(e){wp.customize.control("wpglobus_fields_settings_section").expand({completeCallback:u.settingsSectionExpand}),c(".wpglobus-customize-selector-dropdown").css({display:"none"})})},languageChanged:function(e){WPGlobusCoreData.language=e,c(".wpglobus-customize-selector").data("language",e),c(".wpglobus-customize-selector .current-language").text(e),c(document).triggerHandler("wpglobus_customize_control_language",[WPGlobusCoreData.language]),u.setControlsValue()},setControlsValue:function(){c(".wpglobus-customize-control").each(function(e,t){var o=c(t),n=o.data("customize-setting-link");if(void 0!==WPGlobusCustomize.controlInstances[n]||(n=o.data("wpglobus-customize-control"),void 0!==WPGlobusCustomize.controlInstances[n]))if(o.hasClass("wpglobus-control-link")){var s=u.getTranslations(WPGlobusCustomize.controlInstances[n].setting);o.val(s[WPGlobusCoreData.language])}else if("object"==WPGlobusCustomize.controlInstances[n].settingType);else if("number"==WPGlobusCustomize.controlInstances[n].settingType);else{s=WPGlobusCore.TextFilter(WPGlobusCustomize.controlInstances[n].setting,WPGlobusCoreData.language,"RETURN_EMPTY");"tinymce"==WPGlobusCustomize.controlInstances[n].type&&tinymce.get(n).setContent(s,{format:"raw"}),o.val(WPGlobusCore.TextFilter(s,"RETURN_EMPTY"))}}),c(".wpglobus-customize-widget-control").each(function(e,t){var o=c(t),n=o.data("widget");if(void 0===o.attr("id"))return!0;o.val(WPGlobusCore.TextFilter(WPGlobusCustomize.controlWidgets[n].element[o.attr("id")].value,WPGlobusCoreData.language,"RETURN_EMPTY"))})},updateElements:function(s){void 0===s&&(s=!0),c.each(WPGlobusCustomize.controlInstances,function(e,t){if(!t.userControl.enabled)return!0;var o=wp.customize.control.instance(e);if("link"==t.type){var n=u.getTranslations(WPGlobusCustomize.controlInstances[e].setting);s?(o.setting.set(n[WPGlobusCoreData.language]),t.element.val(o.setting())):t.element.val(n[WPGlobusCoreData.language])}else if("tinymce"==t.type){n=WPGlobusCore.TextFilter(WPGlobusCustomize.controlInstances[e].setting,WPGlobusCoreData.language,"RETURN_EMPTY");tinymce.get(e).setContent(n,{format:"raw"}),t.element.val(n)}else s?(o.setting.set(WPGlobusCore.TextFilter(WPGlobusCustomize.controlInstances[e].setting,WPGlobusCoreData.language,"RETURN_EMPTY")),t.element.val(o.setting())):t.element.val(WPGlobusCore.TextFilter(WPGlobusCustomize.controlInstances[e].setting,WPGlobusCoreData.language,"RETURN_EMPTY"))})},onSubmitEvents:function(e){"mouseenter"==e.type?c.each(u.controlWidgets[c(this).data("widget")].element,function(e,t){c("#"+e).val(t.value)}):"mouseleave"==e.type?u.widgetKeep||c.each(u.controlWidgets[c(this).data("widget")].element,function(e,t){c("#"+e).val(WPGlobusCore.TextFilter(t.value,WPGlobusCoreData.language,"RETURN_EMPTY"))}):"click"==e.type&&(u.widgetKeep=!0)},attachWidgetListeners:function(e){void 0!==e.submit[0].id&&c(document).on("mouseenter","#"+e.submit[0].id,u.onSubmitEvents).on("mouseleave","#"+e.submit[0].id,u.onSubmitEvents).on("click","#"+e.submit[0].id,u.onSubmitEvents)},attachListeners:function(){c(".wpglobus-customize-control").on("keyup",function(e){var t=c(this),o=t.data("customize-setting-link");void 0===WPGlobusCustomize.controlInstances[o]&&(o=t.data("wpglobus-customize-control"),WPGlobusCustomize.controlInstances[o]),void 0===c(document).triggerHandler("wpglobus_customize_control_keyup",[t,o])&&("link"==WPGlobusCustomize.controlInstances[o].type?WPGlobusCustomize.controlInstances[o].setting=u.getString(WPGlobusCustomize.controlInstances[o].setting,t.val(),WPGlobusCoreData.language):WPGlobusCustomize.controlInstances[o].setting=WPGlobusCore.getString(WPGlobusCustomize.controlInstances[o].setting,t.val(),WPGlobusCoreData.language))}),c(document).on("keyup",".wpglobus-customize-widget-control",function(e){var t=c(this),o=t.data("widget");void 0!==WPGlobusCustomize.controlWidgets[o]&&(WPGlobusCustomize.controlWidgets[o].element[t.attr("id")].value=WPGlobusCore.getString(WPGlobusCustomize.controlWidgets[o].element[t.attr("id")].value,t.val(),WPGlobusCoreData.language))}),c(document).on("mouseenter","#save",function(e){c.each(WPGlobusCustomize.controlInstances,function(e,t){if(t.userControl.enabled){var o=wp.customize.control.instance(e);"tinymce"==t.type&&tinymce.get(e).setContent(t.setting,{format:"raw"}),o.setting.set(t.setting),t.element.val(o.setting())}})}).on("mouseleave","#save",function(e){u.instancesKeep||(u.updateElements(),wp.customize.previewer.refresh())}),c("#save").on("click",function(e){u.instancesKeep=!0}),c(document).on("ajaxSend",function(e,t,o){void 0!==o.data&&-1!=o.data.indexOf("wp_customize=on")&&-1!=o.data.indexOf("action=customize_save")&&(u.customizeSave=!0)}),c(document).on("ajaxComplete",function(e,n){void 0!==n.responseText&&(u.customizeSave?(u.updateElements(!1),u.instancesKeep&&(u.instancesKeep=!1)):(0<=n.responseText.indexOf("WP_CUSTOMIZER_SIGNATURE")&&(u.action="customizerAjaxComplete",u.setControlInstances()),c.each(WPGlobusCustomize.controlWidgets,function(e,t){var o=e.replace("_","-");if(0<=n.responseText.indexOf(o))return t.submit.css({display:"block"}),t.control.liveUpdateMode=!1,c.each(t.element,function(e,t){c("#"+e).val(WPGlobusCore.TextFilter(t.value,WPGlobusCoreData.language,"RETURN_EMPTY"))}),t.inWidgetTitle.text(": "+WPGlobusCore.TextFilter(t.control.setting().title,WPGlobusCustomize.languageAdmin)),u.widgetKeep=!1})),u.customizeSave=!1,wp.customize.previewer.refresh())})}};WPGlobusCustomize=c.extend({},WPGlobusCustomize,u),WPGlobusCustomize.init()});
1
+ jQuery(document).ready(function(c){"use strict";var u={languages:{},index:0,length:0,controlInstances:{},controlWidgets:{},instancesKeep:!1,widgetKeep:!1,action:!1,customizeSave:!1,selectorHtml:'<span style="margin-left:5px;" class="wpglobus-icon-globe"></span><span class="current-language" style="font-weight:bold;">{{language}}</span>',settingsSectionExpand:function(){c(document).triggerHandler("wpglobus_fields_settings_section_expand",[this,u])},init:function(e){u.setTitle(),"false"!=WPGlobusCustomizeOptions.themeEnabled&&(c.each(WPGlobusCoreData.enabled_languages,function(e,t){u.languages[e]=t,u.length=e}),u.addLanguageSelector(),u.setControlInstances(),u.setFieldsSection(),u.attachListeners(),u.setTinymce())},updateTinymce:function(e){"tinymce"==WPGlobusCustomize.controlInstances[this.id].type&&(WPGlobusCustomize.controlInstances[this.id].setting=WPGlobusCore.getString(WPGlobusCustomize.controlInstances[this.id].setting,e.target.textContent,WPGlobusCoreData.language))},setTinymce:function(e){c(document).on("tinymce-editor-init",function(e,t){"object"==typeof u.controlInstances[t.id]&&(u.controlInstances[t.id].type="tinymce",c(t.iframeElement).addClass("wpglobus-customize-control").css({width:"99%"}),t.on("input",_.debounce(u.updateTinymce,300)))})},getSize:function(e){return void 0===e?_.size(u.controlInstances):"widget"==e?_.size(u.controlWidgets):null},setFieldsSection:function(){var o={},n=c(".wpglobus-fields_settings_control_box").data("section-template"),s="",l="",i="";c.each(WPGlobusCustomize.controlInstances,function(e,t){void 0===o[t.section]&&(o[t.section]={}),o[t.section][e]=t}),c.each(o,function(e,t){if(l="<ul>",c.each(t,function(e,t){i=t.userControl.enabled?" checked ":"",l+='<li id="'+t.fieldSettings.itemID+'">',l+='<input id="'+t.fieldSettings.cbID+'" data-control="'+e+'" class="wpglobus-customize-cb-control" type="checkbox"'+i+' /> <span class="wpglobus-cb-control-title">'+t.title+"</span>",l+="</li>"}),l+="</ul>",void 0===wp.customize.section(e))return!0;s=(s=(s=(s=n.replace("{{section_title}}",wp.customize.section(e).params.title)).replace(/{{section}}/g,e)).replace("{{section_id}}",'"'+e+'"')).replace("{{items}}",l),c(s).insertBefore(c("#"+WPGlobusCustomizeOptions.userControlSaveButton))}),c("#accordion-section-wpglobus_fields_settings_section").css({"margin-top":"15px"}),c(WPGlobusCustomizeOptions.helpButton).insertAfter(c("#accordion-section-wpglobus_fields_settings_section .customize-action")),c("#accordion-section-wpglobus_fields_settings_section .customize-section-description").addClass("hidden"),c(document).on("click","."+WPGlobusCustomizeOptions.userControlIconClass,function(e){var o=c(this).data("section");c(WPGlobusCustomizeOptions.userControlBoxSelector).each(function(e,t){o==c(t).data("section")?c(this).css({display:"block"}):c(this).css({display:"none"})}),wp.customize.control("wpglobus_fields_settings_section").expand({completeCallback:u.settingsSectionExpand})}),c(".wpglobus-customize-icon-help.customize-help-toggle").on("click",function(e){c("#accordion-section-wpglobus_fields_settings_section .customize-section-description").toggleClass("hidden")})},setUserControls:function(e,t){var o=t.controlSelector+" "+t.selector,n='<img class="'+WPGlobusCustomizeOptions.userControlIconClass+'" data-section="'+t.section+'" style="position:absolute;right:0px;cursor:pointer;" src="'+WPGlobusCustomizeOptions.userControlIcon+'" />';c(n).insertBefore(o),t.userControl.enabled||(1<c(o).length?c(o).each(function(e,t){c(t).removeClass(WPGlobusCustomize.controlClass)}):c(o).removeClass(WPGlobusCustomize.controlClass).val(t.setting))},ctrlMenuItemsCallback:function(e,t){},ctrlWidgetCallback:function(l,i){if(u.action=!1,void 0===u.controlWidgets[l].element){void 0===i&&(i=wp.customize.control.instance(l)),u.controlWidgets[l].element={},u.controlWidgets[l].control=i,u.controlWidgets[l].inWidgetTitle=i.container.find(".in-widget-title"),u.controlWidgets[l].parent=i.selector;var e=i.container.find("input[type=submit]");0!=e.length&&(e.css({display:"block"}),e.attr("data-widget",l),u.controlWidgets[l].submit=e,u.attachWidgetListeners(u.controlWidgets[l])),i.liveUpdateMode=!1,void 0===i.setting().title?u.controlWidgets[l].inWidgetTitle.text(""):u.controlWidgets[l].inWidgetTitle.text(": "+WPGlobusCore.TextFilter(i.setting().title,WPGlobusCustomize.languageAdmin)),c.each(WPGlobusCustomize.elementSelector,function(e,n){var s=i.container.find(n);0!=s.length&&c.each(s,function(e,t){if(void 0===t.id||""==t.id)return!0;var o=c(s[e]);void 0===u.controlWidgets[l].element[t.id]&&(u.controlWidgets[l].element[t.id]={}),o.addClass("wpglobus-customize-widget-control"),o.attr("data-widget",l),u.controlWidgets[l].element[t.id].element=o,u.controlWidgets[l].element[t.id].setting=i.setting(),u.controlWidgets[l].element[t.id].selector=n,u.controlWidgets[l].element[t.id].value=t.defaultValue,o.val(WPGlobusCore.TextFilter(t.defaultValue,WPGlobusCoreData.language,"RETURN_EMPTY"))})}),c(document).triggerHandler("wpglobus_customize_control_added_widget",[l])}},ctrlCallback:function(o,l,e){var n=!1;if(c.each(WPGlobusCustomize.disabledSections,function(e,t){if(o.section()==t)return!(n=!0)}),!n&&(c.each(WPGlobusCustomize.disabledSettingMask,function(e,t){if(0<=l.indexOf(t))return!(n=!0)}),!n)){var i=wp.customize.control.instance(l);if(0<=l.indexOf("widget"))return void 0===u.controlWidgets[l]&&(u.controlWidgets[l]={},u.action&&u.ctrlWidgetCallback(l,i)),u.controlWidgets[l].parent=i.selector,1!=c(i.selector).length?u.controlWidgets[l].observer=null:(u.controlWidgets[l].observer=new MutationObserver(function(e){e.forEach(function(e){"class"==e.attributeName&&-1!=e.target.className.indexOf("expanding")&&u.ctrlWidgetCallback(l)})}),u.controlWidgets[l].observer.observe(document.querySelector(u.controlWidgets[l].parent),{attributes:!0,childList:!0,characterData:!0})),!1;if(void 0===u.controlInstances[l]){var a=!0;c.each(WPGlobusCustomize.elementSelector,function(e,t){var s=i.container.find(t);if(0!=s.length){if("function"!=typeof i.setting)return!0;u.controlInstances[l]={},u.controlInstances[l].element=s,u.controlInstances[l].elementID=s.attr("id")?"#"+s.attr("id"):void 0,u.controlInstances[l].setting=i.setting(),u.controlInstances[l].settingType=typeof i.setting(),u.controlInstances[l].selector=t,u.controlInstances[l].controlSelector=i.selector,u.controlInstances[l].type="",u.controlInstances[l].section=i.section(),u.controlInstances[l].title=null,u.controlInstances[l].userControl=null,u.controlInstances[l].fieldSettings={},u.controlInstances[l].fieldSettings.itemID="item-wpglobus-cb-control-"+WPGlobusDialogApp.convertToId(l),u.controlInstances[l].fieldSettings.cbID="wpglobus-cb-control-"+WPGlobusDialogApp.convertToId(l),c.each(WPGlobusCustomize.setLinkBy,function(e,t){if(0<=l.indexOf(t)){if(u.controlInstances[l].type="link",""==u.controlInstances[l].setting&&(u.controlInstances[l].setting=s[0].defaultValue),WPGlobusCustomize.changeset_uuid){var o=wp.customize.control(l).setting();if(-1!==o.indexOf("|||")){var n=u.getTranslations(o);wp.customize.control(l).setting(n[WPGlobusCoreData.default_language]),c(WPGlobusCustomize.controlInstances[l].controlSelector+" "+WPGlobusCustomize.controlInstances[l].selector).val(n[WPGlobusCoreData.default_language])}}s.addClass("wpglobus-control-link")}}),""===u.controlInstances[l].type&&(u.controlInstances[l].type="textarea"==t?"textarea":"text"),"string"==u.controlInstances[l].settingType&&""!=u.controlInstances[l].setting&&s.val(WPGlobusCore.TextFilter(u.controlInstances[l].setting,WPGlobusCoreData.language,"RETURN_EMPTY")),s.addClass("wpglobus-customize-control"),s.attr("data-wpglobus-customize-control",u.controlInstances[l].controlSelector.replace("#customize-control-","")),s.attr("data-wpglobus-customize-control-setting-type",u.controlInstances[l].settingType),"link"==u.controlInstances[l].type&&(u.controlInstances[l].setting=u.convertString(s[0].defaultValue)),u.controlInstances[l].title=i.params.label,null!==WPGlobusCustomizeOptions.userControl&&void 0!==WPGlobusCustomizeOptions.userControl[WPGlobusCustomizeOptions.themeName]&&void 0!==WPGlobusCustomizeOptions.userControl[WPGlobusCustomizeOptions.themeName][l]&&"disable"==WPGlobusCustomizeOptions.userControl[WPGlobusCustomizeOptions.themeName][l]&&(a=!1),u.controlInstances[l].userControl={},u.controlInstances[l].userControl.enabled=a,u.setUserControls(l,u.controlInstances[l])}})}}},setControlInstances:function(){wp.customize.control.each(u.ctrlCallback)},setTitle:function(){c(WPGlobusCoreData.customize.info.element).html(WPGlobusCoreData.customize.info.html)},convertString:function(e){if(void 0===e)return e;var o=[],t=WPGlobusCore.getTranslations(e),n=0,s=!0;return e==t[WPGlobusCoreData.default_language]?e:(c.each(t,function(e,t){o[n]=""==t?"null":(s=!1,t),n++}),s?"":o.join("|||"))},getTranslations:function(e){if(void 0===e)return e;var o={},n=e.split("|||");return c.each(WPGlobusCoreData.enabled_languages,function(e,t){o[t]=void 0===n[e]||"null"===n[e]?"":n[e]}),o},getString:function(e,o,n){if(void 0===e)return e;void 0===o&&(o=""),void 0===n&&(n=WPGlobusCoreData.language);var t=u.getTranslations(e),s=[],l=0,i=!0;return c.each(t,function(e,t){s[l]=e==n?""==(o=o.trim())?"null":o:""==t?"null":t,e!=WPGlobusCoreData.default_language&&"null"!=s[l]&&(i=!1),l++}),s=i?s[0]:s.join("|||")},addLanguageSelector:function(){"dropdown"!=WPGlobusCustomize.selectorType?(c(WPGlobusCustomize.selectorButton).insertAfter(".customize-controls-preview-toggle"),c(".wpglobus-customize-selector").html(u.selectorHtml.replace("{{language}}",WPGlobusCoreData.language)),c(document).on("click",".wpglobus-customize-selector",function(e){u.index>u.length-1?u.index=0:u.index++,WPGlobusCoreData.language=u.languages[u.index],c(this).html(u.selectorHtml.replace("{{language}}",WPGlobusCoreData.language)),c(document).triggerHandler("wpglobus_customize_control_language",[WPGlobusCoreData.language]),u.setControlsValue()})):u.addLanguageSelectorDropdown()},addLanguageSelectorDropdown:function(){c(WPGlobusCustomize.selectorButton).insertAfter(".customize-controls-preview-toggle"),c(".wpglobus-customize-selector").html(u.selectorHtml.replace("{{language}}",WPGlobusCoreData.language));var e=c(".wpglobus-customize-selector").offset(),t=e.top+46;t+="px;";var o=e.left+"px;",n=0,s='<ul class="wpglobus-customize-selector-dropdown" style="display:none;position:fixed;width:46px;border-left:1px solid #ddd;border-right:1px solid #ddd;background-color:#eee;margin:-1px 0 0;padding:0;top:'+t+"left:"+o+'">';c.each(WPGlobusCoreData.enabled_languages,function(e,t){s+='<li class="item" style="text-align:center;cursor:pointer;border-bottom:1px solid #ddd;margin:0;" data-language="'+t+'">',s+='<span class="value value-'+t+'" style="font-size:15px;">'+t+"</span>",s+="</li>"}),s+='<li class="item wpglobus-customize-item-settings" style="text-align:center;cursor:pointer;border-bottom:1px solid #ddd;margin:0;"><span style="padding-top:14px;" class="dashicons dashicons-admin-tools"></span></li>',s+="</ul>",c(".wpglobus-customize-selector").after(s),c(document).on("mouseenter",".wpglobus-customize-selector",function(e){c(".wpglobus-customize-selector-dropdown").css({display:"block"}),n=e.screenY}),c(document).on("mouseleave",".wpglobus-customize-selector",function(e){0!=n&&e.screenY-n<=0&&c(".wpglobus-customize-selector-dropdown").css({display:"none"})}),c(document).on("mouseleave",".wpglobus-customize-selector-dropdown",function(e){c(".wpglobus-customize-selector-dropdown").css({display:"none"})}),c(document).on("mouseenter",".wpglobus-customize-selector-dropdown .item",function(e){var t=c(this),o=t.data("language");t.addClass("active"),t.css({"background-color":"#fff"}),t.find(".value-"+o).css({"font-weight":"bold"})}),c(document).on("mouseleave",".wpglobus-customize-selector-dropdown .item",function(e){var t=c(this);t.removeClass("active"),t.css({"background-color":"#eee"}),c(this).find(".value").css({"font-weight":""})}),c(document).on("click",".wpglobus-customize-selector-dropdown .item",function(e){var t=c(this).data("language");void 0!==t&&t!=c(".wpglobus-customize-selector").data("language")&&u.languageChanged(t)}),c(document).on("click",".wpglobus-customize-item-settings",function(e){wp.customize.control("wpglobus_fields_settings_section").expand({completeCallback:u.settingsSectionExpand}),c(".wpglobus-customize-selector-dropdown").css({display:"none"})})},languageChanged:function(e){WPGlobusCoreData.language=e,c(".wpglobus-customize-selector").data("language",e),c(".wpglobus-customize-selector .current-language").text(e),c(document).triggerHandler("wpglobus_customize_control_language",[WPGlobusCoreData.language]),u.setControlsValue()},setControlsValue:function(){c(".wpglobus-customize-control").each(function(e,t){var o=c(t),n=o.data("customize-setting-link");if(void 0!==WPGlobusCustomize.controlInstances[n]||(n=o.data("wpglobus-customize-control"),void 0!==WPGlobusCustomize.controlInstances[n]))if(o.hasClass("wpglobus-control-link")){var s=u.getTranslations(WPGlobusCustomize.controlInstances[n].setting);o.val(s[WPGlobusCoreData.language])}else if("object"==WPGlobusCustomize.controlInstances[n].settingType);else if("number"==WPGlobusCustomize.controlInstances[n].settingType);else{s=WPGlobusCore.TextFilter(WPGlobusCustomize.controlInstances[n].setting,WPGlobusCoreData.language,"RETURN_EMPTY");"tinymce"==WPGlobusCustomize.controlInstances[n].type&&tinymce.get(n).setContent(s,{format:"raw"}),o.val(WPGlobusCore.TextFilter(s,"RETURN_EMPTY"))}}),c(".wpglobus-customize-widget-control").each(function(e,t){var o=c(t),n=o.data("widget");if(void 0===o.attr("id"))return!0;o.val(WPGlobusCore.TextFilter(WPGlobusCustomize.controlWidgets[n].element[o.attr("id")].value,WPGlobusCoreData.language,"RETURN_EMPTY"))})},updateElements:function(s){void 0===s&&(s=!0),c.each(WPGlobusCustomize.controlInstances,function(e,t){if(!t.userControl.enabled)return!0;var o=wp.customize.control.instance(e);if("link"==t.type){var n=u.getTranslations(WPGlobusCustomize.controlInstances[e].setting);s?(o.setting.set(n[WPGlobusCoreData.language]),t.element.val(o.setting())):t.element.val(n[WPGlobusCoreData.language])}else if("tinymce"==t.type){n=WPGlobusCore.TextFilter(WPGlobusCustomize.controlInstances[e].setting,WPGlobusCoreData.language,"RETURN_EMPTY");tinymce.get(e).setContent(n,{format:"raw"}),t.element.val(n)}else s?(o.setting.set(WPGlobusCore.TextFilter(WPGlobusCustomize.controlInstances[e].setting,WPGlobusCoreData.language,"RETURN_EMPTY")),t.element.val(o.setting())):t.element.val(WPGlobusCore.TextFilter(WPGlobusCustomize.controlInstances[e].setting,WPGlobusCoreData.language,"RETURN_EMPTY"))})},onSubmitEvents:function(e){"mouseenter"==e.type?c.each(u.controlWidgets[c(this).data("widget")].element,function(e,t){c("#"+e).val(t.value)}):"mouseleave"==e.type?u.widgetKeep||c.each(u.controlWidgets[c(this).data("widget")].element,function(e,t){c("#"+e).val(WPGlobusCore.TextFilter(t.value,WPGlobusCoreData.language,"RETURN_EMPTY"))}):"click"==e.type&&(u.widgetKeep=!0)},attachWidgetListeners:function(e){void 0!==e.submit[0].id&&c(document).on("mouseenter","#"+e.submit[0].id,u.onSubmitEvents).on("mouseleave","#"+e.submit[0].id,u.onSubmitEvents).on("click","#"+e.submit[0].id,u.onSubmitEvents)},attachListeners:function(){c(".wpglobus-customize-control").on("keyup",function(e){var t=c(this),o=t.data("customize-setting-link");void 0===WPGlobusCustomize.controlInstances[o]&&(o=t.data("wpglobus-customize-control"),WPGlobusCustomize.controlInstances[o]),void 0===c(document).triggerHandler("wpglobus_customize_control_keyup",[t,o])&&("link"==WPGlobusCustomize.controlInstances[o].type?WPGlobusCustomize.controlInstances[o].setting=u.getString(WPGlobusCustomize.controlInstances[o].setting,t.val(),WPGlobusCoreData.language):WPGlobusCustomize.controlInstances[o].setting=WPGlobusCore.getString(WPGlobusCustomize.controlInstances[o].setting,t.val(),WPGlobusCoreData.language))}),c(document).on("keyup",".wpglobus-customize-widget-control",function(e){var t=c(this),o=t.data("widget");void 0!==WPGlobusCustomize.controlWidgets[o]&&(WPGlobusCustomize.controlWidgets[o].element[t.attr("id")].value=WPGlobusCore.getString(WPGlobusCustomize.controlWidgets[o].element[t.attr("id")].value,t.val(),WPGlobusCoreData.language))}),c(document).on("mouseenter","#save",function(e){c.each(WPGlobusCustomize.controlInstances,function(e,t){if(t.userControl.enabled){var o=wp.customize.control.instance(e);"tinymce"==t.type&&tinymce.get(e).setContent(t.setting,{format:"raw"}),o.setting.set(t.setting),t.element.val(o.setting())}})}).on("mouseleave","#save",function(e){u.instancesKeep||(u.updateElements(),wp.customize.previewer.refresh())}),c("#save").on("click",function(e){u.instancesKeep=!0}),c(document).on("ajaxSend",function(e,t,o){void 0!==o.data&&-1!=o.data.indexOf("wp_customize=on")&&-1!=o.data.indexOf("action=customize_save")&&(u.customizeSave=!0)}),c(document).on("ajaxComplete",function(e,n){void 0!==n.responseText&&(u.customizeSave?(u.updateElements(!1),u.instancesKeep&&(u.instancesKeep=!1)):(0<=n.responseText.indexOf("WP_CUSTOMIZER_SIGNATURE")&&(u.action="customizerAjaxComplete",u.setControlInstances()),c.each(WPGlobusCustomize.controlWidgets,function(e,t){var o=e.replace("_","-");if(0<=n.responseText.indexOf(o))return t.submit.css({display:"block"}),t.control.liveUpdateMode=!1,c.each(t.element,function(e,t){c("#"+e).val(WPGlobusCore.TextFilter(t.value,WPGlobusCoreData.language,"RETURN_EMPTY"))}),t.inWidgetTitle.text(": "+WPGlobusCore.TextFilter(t.control.setting().title,WPGlobusCustomize.languageAdmin)),u.widgetKeep=!1})),u.customizeSave=!1,wp.customize.previewer.refresh())})}};WPGlobusCustomize=c.extend({},WPGlobusCustomize,u),WPGlobusCustomize.init()});
includes/js/wpglobus-wpseo-21.min.js CHANGED
@@ -1 +1 @@
1
- var wpglobus_wpseo=function(){if("undefined"!=typeof wpseoMetaboxL10n){var l=function(e,s){var t="",o=jQuery("#"+wpseoMetaboxL10n.field_prefix+"title_"+s),n=jQuery("#"+wpseoMetaboxL10n.field_prefix+"title-length-warning_"+s),r=jQuery("<div />"),a=jQuery("#wpseosnippet_title_"+s);if(o.val()?t=o.val():(t=wpseoMetaboxL10n.wpseo_title_template,t=r.html(t).text()),""==t)return a.html(""),void n.hide();t=yst_clean(t),t=jQuery.trim(t),t=r.text(t).html(),e&&o.val(t),t=function(t,e,a){if(void 0===t)return"";if("undefined"==typeof replacedVars&&0==jQuery("#title").size())return t;var s="#title",o="#excerpt-"+e,n="#content";e!=WPGlobusAdmin.data.default_language&&(s="#title_"+e,n="#content_"+e),jQuery(s).length&&(t=t.replace(/%%title%%/g,jQuery(s).val())),t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace(/%%sitedesc%%/g,WPGlobusAdmin.data.blogdescription[e])).replace(/%%sitename%%/g,WPGlobusAdmin.data.blogname[e])).replace(/%%sep%%/g,wpseoMetaboxL10n.sep)).replace(/%%date%%/g,wpseoMetaboxL10n.date)).replace(/%%id%%/g,wpseoMetaboxL10n.id)).replace(/%%page%%/g,wpseoMetaboxL10n.page)).replace(/%%currenttime%%/g,wpseoMetaboxL10n.currenttime)).replace(/%%currentdate%%/g,wpseoMetaboxL10n.currentdate)).replace(/%%currentday%%/g,wpseoMetaboxL10n.currentday)).replace(/%%currentmonth%%/g,wpseoMetaboxL10n.currentmonth)).replace(/%%currentyear%%/g,wpseoMetaboxL10n.currentyear)).replace(/%%focuskw%%/g,jQuery("#yoast_wpseo_focuskw_"+e).val());var r="";jQuery(o).length&&(r=yst_clean(jQuery(o).val()),t=t.replace(/%%excerpt_only%%/g,r)),""==r&&jQuery(n).length&&(r=jQuery(n).val().replace(/(<([^>]+)>)/gi,"").substring(0,wpseoMetaboxL10n.wpseo_meta_desc_length-1)),t=t.replace(/%%excerpt%%/g,r),jQuery("#parent_id").length&&jQuery("#parent_id option:selected").text()!=wpseoMetaboxL10n.no_parent_text&&(t=t.replace(/%%parent_title%%/g,jQuery("#parent_id option:selected").text()));var l=yst_escapeFocusKw(wpseoMetaboxL10n.sep),p=new RegExp(l+" "+l,"g");if(-1!=(t=t.replace(p,wpseoMetaboxL10n.sep)).indexOf("%%")&&null!=t.match(/%%[a-z0-9_-]+%%/i))for(regex=/%%[a-z0-9_-]+%%/gi,matches=t.match(regex),i=0;i<matches.length;i++)null!=replacedVars[matches[i]]?t=t.replace(matches[i],replacedVars[matches[i]]):(replaceableVar=matches[i],replacedVars[replaceableVar]="",jQuery.post(ajaxurl,{action:"wpseo_replace_vars",string:matches[i],post_id:jQuery("#post_ID").val(),_wpnonce:wpseoMetaboxL10n.wpseo_replace_vars_nonce},function(e){e&&(replacedVars[replaceableVar]=e),yst_replaceVariables(t,a)}));a(t)}(t,s,function(e){var t=r.html(e).text();o.attr("placeholder",t),e=_(e=yst_clean(e),!1,s),jQuery("#wpseosnippet_title_"+s).html(e);var a=document.getElementById("wpseosnippet_title_"+s);null!=a&&(a.scrollWidth>a.clientWidth?n.show():n.hide()),y(s)})},p=function(e){l(!1,e),w(e)};jQuery("#wpglobus-wpseo-tabs").tabs();var e=jQuery("#wpglobus-wpseo-attr"),u=jQuery(".wpseotab.general .form-table"),c=e.data("ids"),d=e.data("names"),g="";c=(c=c+","+e.data("qtip")).split(","),d=d.split(","),jQuery("#wpglobus-wpseo-tabs").insertBefore(u),jQuery(".wpglobus-wpseo-general").each(function(e,t){var s=jQuery(t),o=s.data("language");if(s.html('<table class="form-table wpglobus-table-'+o+'" data-language="'+o+'">'+u.html()+"</table>"),jQuery.each(d,function(e,t){jQuery("#"+t).attr("name",t+"_"+o)}),jQuery.each(c,function(e,t){var a=jQuery("#"+t);"wpseosnippet"==t&&a.addClass("wpglobus-wpseosnippet"),"focuskwresults"==t&&a.addClass("wpglobus-focuskwresults"),wpseoMetaboxL10n.field_prefix+"metadesc"==t&&a.addClass("wpglobus-wpseo_metadesc").text(s.data("metadesc")),wpseoMetaboxL10n.field_prefix+"title"==t&&a.addClass("wpglobus-wpseo_title").val(s.data("wpseotitle")),wpseoMetaboxL10n.field_prefix+"focuskw"==t&&a.addClass("wpglobus-wpseo_focuskw").val(s.data("focuskw")),a.attr("id",t+"_"+o),jQuery("#"+t+"_"+o).attr("data-language",o)}),g="complete"==s.data("permalink")?s.data("url-"+o):s.data("url-"+o)+jQuery("#editable-post-name-full").text()+"/",jQuery("#wpseosnippet_"+o+" .url").text(g),p(o),void 0!==jQuery().autocomplete){var n,r={};jQuery("#"+wpseoMetaboxL10n.field_prefix+"focuskw_"+o).autocomplete({minLength:3,formatResult:function(e){return jQuery("<div/>").html(e).html()},source:function(e,s){var o=e.term;o in r?s(r[o]):(e._ajax_nonce=wpseoMetaboxL10n.wpseo_keyword_suggest_nonce,e.action="wpseo_get_suggest",n=jQuery.getJSON(ajaxurl,e,function(e,t,a){r[o]=e,a===n&&s(e)}))}})}jQuery("#"+wpseoMetaboxL10n.field_prefix+"title_"+o).keyup(function(){l(!1,jQuery(this).data("language"))}),jQuery("#title_"+o).keyup(function(){var e=jQuery(this).data("language")?jQuery(this).data("language"):WPGlobusAdmin.data.default_language;l(!1,e),w(e)}),0==e&&jQuery("#title").keyup(function(){l(!1,WPGlobusAdmin.data.default_language),w(WPGlobusAdmin.data.default_language)}),0==e&&jQuery("body").on("change","#parent_id",function(){jQuery.each(WPGlobusAdmin.data.enabled_languages,function(e,t){l(!1,t),w(t)})}),jQuery("#"+wpseoMetaboxL10n.field_prefix+"metadesc_"+o).keyup(function(){w(jQuery(this).data("language"))}),jQuery("body").on("keyup","#excerpt-"+o,function(){w(jQuery(this).data("language")?jQuery(this).data("language"):WPGlobusAdmin.data.default_language)}),0==e&&jQuery(".wpglobus-editor").focusout(function(){w(jQuery(this).data("language"))});var a=!1;jQuery(document).on("change","#"+wpseoMetaboxL10n.field_prefix+"focuskw_"+o,function(){var e=jQuery(this).data("language"),t=jQuery("#focuskwhelp_"+e);-1!=jQuery("#"+wpseoMetaboxL10n.field_prefix+"focuskw_"+e).val().search(",")?(t.click(),a=!0):a&&(t.qtip("hide"),a=!1),p(e)})}),u.addClass("hidden"),jQuery("body").on("change",".wpglobus-wpseo_metadesc",function(e){var t="#"+wpseoMetaboxL10n.field_prefix+"metadesc",a=jQuery(this);jQuery(t).val(WPGlobusCore.getString(jQuery(t).val(),a.val(),a.data("language")))}),jQuery("body").on("change",".wpglobus-wpseo_title",function(e){var t="#"+wpseoMetaboxL10n.field_prefix+"title",a=jQuery(this);jQuery(t).val(WPGlobusCore.getString(jQuery(t).val(),a.val(),a.data("language")))}),jQuery("body").on("change",".wpglobus-wpseo_focuskw",function(e){var t="#"+wpseoMetaboxL10n.field_prefix+"focuskw",a=jQuery(this);jQuery(t).val(WPGlobusCore.getString(jQuery(t).val(),a.val(),a.data("language")))}),jQuery("body").on("click",".wpglobus-post-body-tabs-list li",function(e){$this=jQuery(this),$this.hasClass("wpglobus-post-tab")&&jQuery("#wpglobus-wpseo-tabs").tabs("option","active",jQuery(this).data("order"))}),jQuery(".yoast_help").qtip({content:{attr:"alt"},position:{my:"bottom left",at:"top center"},style:{tip:{corner:!0},classes:"yoast-qtip qtip-rounded qtip-blue"},show:{when:{event:"mouseover"}},hide:{fixed:!0,when:{event:"mouseout"}}}),yst_updateSnippet()}function _(e,t,a){var s,o=yst_escapeFocusKw(jQuery.trim(jQuery("#"+wpseoMetaboxL10n.field_prefix+"focuskw_"+a).val()));if(""==o)return e;s=-1!=o.search(" ")?o.split(" "):new Array(o);for(var n=0;n<s.length;n++){var r=yst_clean(s[n]),l="";t?(r=r.replace(" ","-").toLowerCase(),l=new RegExp("([-/])("+r+")([-/])?")):l=new RegExp("(^|[ s\n\r\t.,'(\"+;!?:-]+)("+r+")($|[ s\n\r\t.,')\"+;!?:-]+)","gim"),null!=e&&(e=e.replace(l,"$1<strong>$2</strong>$3"))}return e}function w(a){var e=jQuery.trim(yst_clean(jQuery("#"+wpseoMetaboxL10n.field_prefix+"metadesc_"+a).val())),s=jQuery("<div />"),o=jQuery("#wpseosnippet_"+a);if(""==e&&""!=wpseoMetaboxL10n.wpseo_metadesc_template&&(e=wpseoMetaboxL10n.wpseo_metadesc_template),""!=e)e=yst_replaceVariables(e,function(e){var t;e=s.text(e).html(),e=yst_clean(e),t=(t=wpseoMetaboxL10n.wpseo_meta_desc_length-e.length)<0?'<span class="wrong">'+t+"</span>":'<span class="good">'+t+"</span>",jQuery("#"+wpseoMetaboxL10n.field_prefix+"metadesc-length_"+a).html(t),e=_(e=yst_trimDesc(e),!1),o.find(".desc span.autogen").html(""),o.find(".desc span.content").html(e),y(a)});else{jQuery("#"+wpseoMetaboxL10n.field_prefix+"metadesc-length_"+a).html(wpseoMetaboxL10n.wpseo_meta_desc_length),o.find(".desc span.content").html(""),y(a);var t="#content";a!=WPGlobusAdmin.data.default_language&&(t="#content_"+a),jQuery(t).length&&(e=jQuery(t).val(),e=yst_clean(e));var n=yst_escapeFocusKw(jQuery.trim(jQuery("#"+wpseoMetaboxL10n.field_prefix+"focuskw_"+a).val()));if(""!=n){var r=new RegExp(n,"gim");e=-1!=e.search(r)&&e.length>wpseoMetaboxL10n.wpseo_meta_desc_length?e.substr(e.search(r),wpseoMetaboxL10n.wpseo_meta_desc_length):e.substr(0,wpseoMetaboxL10n.wpseo_meta_desc_length)}else e=e.substr(0,wpseoMetaboxL10n.wpseo_meta_desc_length);e=_(e,!1),e=yst_trimDesc(e),o.find(".desc span.autogen").html(e)}}function y(e){var t=jQuery.trim(jQuery("#"+wpseoMetaboxL10n.field_prefix+"focuskw_"+e).val());t=yst_escapeFocusKw(t).toLowerCase();var a="#title",s="#content";e!=WPGlobusAdmin.data.default_language&&(a="#title_"+e,s="#content_"+e);var o=jQuery(document).triggerHandler("wpglobus_post_name_full",{postnamefull:"#editable-post-name-full",language:e})||"#editable-post-name-full";if(jQuery(o).length)var n=jQuery(o).text(),r=wpseoMetaboxL10n.wpseo_permalink_template.replace("%postname%",n).replace("http://","");var l=new RegExp("(^|[ s\n\r\t.,'(\"+;!?:-])"+t+"($|[ s\n\r\t.,')\"+!?:;-])","gim"),p=removeLowerCaseDiacritics(t),u=new RegExp(p.replace(/\s+/g,"[-_\\//]"),"gim"),i=jQuery("#focuskwresults_"+e),c=jQuery("#wpseosnippet_"+e).find(".desc span.content").text();if(""!=t){var d="<p>"+wpseoMetaboxL10n.keyword_header+"</p>";d+="<ul>",jQuery(a).length&&(d+="<li>"+wpseoMetaboxL10n.article_header_text+ptest(jQuery(a).val(),l)+"</li>"),d+="<li>"+wpseoMetaboxL10n.page_title_text+ptest(jQuery("#wpseosnippet_title_"+e).text(),l)+"</li>",d+="<li>"+wpseoMetaboxL10n.page_url_text+ptest(r,u)+"</li>",jQuery(s).length&&(d+="<li>"+wpseoMetaboxL10n.content_text+ptest(jQuery(s).val(),l)+"</li>"),d+="<li>"+wpseoMetaboxL10n.meta_description_text+ptest(c,l)+"</li>",d+="</ul>",i.html(d)}else i.html("")}};
1
+ var wpglobus_wpseo=function(){if("undefined"!=typeof wpseoMetaboxL10n){var l=function(e,s){var t="",o=jQuery("#"+wpseoMetaboxL10n.field_prefix+"title_"+s),n=jQuery("#"+wpseoMetaboxL10n.field_prefix+"title-length-warning_"+s),r=jQuery("<div />"),a=jQuery("#wpseosnippet_title_"+s);if(""==(t=o.val()?o.val():(t=wpseoMetaboxL10n.wpseo_title_template,r.html(t).text())))return a.html(""),void n.hide();t=yst_clean(t),t=jQuery.trim(t),t=r.text(t).html(),e&&o.val(t),t=function(t,e,a){if(void 0===t)return"";if("undefined"==typeof replacedVars&&0==jQuery("#title").size())return t;var s="#title",o="#excerpt-"+e,n="#content";e!=WPGlobusAdmin.data.default_language&&(s="#title_"+e,n="#content_"+e),jQuery(s).length&&(t=t.replace(/%%title%%/g,jQuery(s).val())),t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace(/%%sitedesc%%/g,WPGlobusAdmin.data.blogdescription[e])).replace(/%%sitename%%/g,WPGlobusAdmin.data.blogname[e])).replace(/%%sep%%/g,wpseoMetaboxL10n.sep)).replace(/%%date%%/g,wpseoMetaboxL10n.date)).replace(/%%id%%/g,wpseoMetaboxL10n.id)).replace(/%%page%%/g,wpseoMetaboxL10n.page)).replace(/%%currenttime%%/g,wpseoMetaboxL10n.currenttime)).replace(/%%currentdate%%/g,wpseoMetaboxL10n.currentdate)).replace(/%%currentday%%/g,wpseoMetaboxL10n.currentday)).replace(/%%currentmonth%%/g,wpseoMetaboxL10n.currentmonth)).replace(/%%currentyear%%/g,wpseoMetaboxL10n.currentyear)).replace(/%%focuskw%%/g,jQuery("#yoast_wpseo_focuskw_"+e).val());var r="";jQuery(o).length&&(r=yst_clean(jQuery(o).val()),t=t.replace(/%%excerpt_only%%/g,r)),""==r&&jQuery(n).length&&(r=jQuery(n).val().replace(/(<([^>]+)>)/gi,"").substring(0,wpseoMetaboxL10n.wpseo_meta_desc_length-1)),t=t.replace(/%%excerpt%%/g,r),jQuery("#parent_id").length&&jQuery("#parent_id option:selected").text()!=wpseoMetaboxL10n.no_parent_text&&(t=t.replace(/%%parent_title%%/g,jQuery("#parent_id option:selected").text()));var l=yst_escapeFocusKw(wpseoMetaboxL10n.sep),p=new RegExp(l+" "+l,"g");if(-1!=(t=t.replace(p,wpseoMetaboxL10n.sep)).indexOf("%%")&&null!=t.match(/%%[a-z0-9_-]+%%/i))for(regex=/%%[a-z0-9_-]+%%/gi,matches=t.match(regex),i=0;i<matches.length;i++)null!=replacedVars[matches[i]]?t=t.replace(matches[i],replacedVars[matches[i]]):(replaceableVar=matches[i],replacedVars[replaceableVar]="",jQuery.post(ajaxurl,{action:"wpseo_replace_vars",string:matches[i],post_id:jQuery("#post_ID").val(),_wpnonce:wpseoMetaboxL10n.wpseo_replace_vars_nonce},function(e){e&&(replacedVars[replaceableVar]=e),yst_replaceVariables(t,a)}));a(t)}(t,s,function(e){var t=r.html(e).text();o.attr("placeholder",t),e=_(e=yst_clean(e),!1,s),jQuery("#wpseosnippet_title_"+s).html(e);var a=document.getElementById("wpseosnippet_title_"+s);null!=a&&(a.scrollWidth>a.clientWidth?n.show():n.hide()),y(s)})},p=function(e){l(!1,e),w(e)};jQuery("#wpglobus-wpseo-tabs").tabs();var e=jQuery("#wpglobus-wpseo-attr"),u=jQuery(".wpseotab.general .form-table"),c=e.data("ids"),d=e.data("names"),g="";c=(c=c+","+e.data("qtip")).split(","),d=d.split(","),jQuery("#wpglobus-wpseo-tabs").insertBefore(u),jQuery(".wpglobus-wpseo-general").each(function(e,t){var s=jQuery(t),o=s.data("language");if(s.html('<table class="form-table wpglobus-table-'+o+'" data-language="'+o+'">'+u.html()+"</table>"),jQuery.each(d,function(e,t){jQuery("#"+t).attr("name",t+"_"+o)}),jQuery.each(c,function(e,t){var a=jQuery("#"+t);"wpseosnippet"==t&&a.addClass("wpglobus-wpseosnippet"),"focuskwresults"==t&&a.addClass("wpglobus-focuskwresults"),wpseoMetaboxL10n.field_prefix+"metadesc"==t&&a.addClass("wpglobus-wpseo_metadesc").text(s.data("metadesc")),wpseoMetaboxL10n.field_prefix+"title"==t&&a.addClass("wpglobus-wpseo_title").val(s.data("wpseotitle")),wpseoMetaboxL10n.field_prefix+"focuskw"==t&&a.addClass("wpglobus-wpseo_focuskw").val(s.data("focuskw")),a.attr("id",t+"_"+o),jQuery("#"+t+"_"+o).attr("data-language",o)}),g="complete"==s.data("permalink")?s.data("url-"+o):s.data("url-"+o)+jQuery("#editable-post-name-full").text()+"/",jQuery("#wpseosnippet_"+o+" .url").text(g),p(o),void 0!==jQuery().autocomplete){var n,r={};jQuery("#"+wpseoMetaboxL10n.field_prefix+"focuskw_"+o).autocomplete({minLength:3,formatResult:function(e){return jQuery("<div/>").html(e).html()},source:function(e,s){var o=e.term;o in r?s(r[o]):(e._ajax_nonce=wpseoMetaboxL10n.wpseo_keyword_suggest_nonce,e.action="wpseo_get_suggest",n=jQuery.getJSON(ajaxurl,e,function(e,t,a){r[o]=e,a===n&&s(e)}))}})}jQuery("#"+wpseoMetaboxL10n.field_prefix+"title_"+o).keyup(function(){l(!1,jQuery(this).data("language"))}),jQuery("#title_"+o).keyup(function(){var e=jQuery(this).data("language")?jQuery(this).data("language"):WPGlobusAdmin.data.default_language;l(!1,e),w(e)}),0==e&&jQuery("#title").keyup(function(){l(!1,WPGlobusAdmin.data.default_language),w(WPGlobusAdmin.data.default_language)}),0==e&&jQuery("body").on("change","#parent_id",function(){jQuery.each(WPGlobusAdmin.data.enabled_languages,function(e,t){l(!1,t),w(t)})}),jQuery("#"+wpseoMetaboxL10n.field_prefix+"metadesc_"+o).keyup(function(){w(jQuery(this).data("language"))}),jQuery("body").on("keyup","#excerpt-"+o,function(){w(jQuery(this).data("language")?jQuery(this).data("language"):WPGlobusAdmin.data.default_language)}),0==e&&jQuery(".wpglobus-editor").focusout(function(){w(jQuery(this).data("language"))});var a=!1;jQuery(document).on("change","#"+wpseoMetaboxL10n.field_prefix+"focuskw_"+o,function(){var e=jQuery(this).data("language"),t=jQuery("#focuskwhelp_"+e);-1!=jQuery("#"+wpseoMetaboxL10n.field_prefix+"focuskw_"+e).val().search(",")?(t.click(),a=!0):a&&(t.qtip("hide"),a=!1),p(e)})}),u.addClass("hidden"),jQuery("body").on("change",".wpglobus-wpseo_metadesc",function(e){var t="#"+wpseoMetaboxL10n.field_prefix+"metadesc",a=jQuery(this);jQuery(t).val(WPGlobusCore.getString(jQuery(t).val(),a.val(),a.data("language")))}),jQuery("body").on("change",".wpglobus-wpseo_title",function(e){var t="#"+wpseoMetaboxL10n.field_prefix+"title",a=jQuery(this);jQuery(t).val(WPGlobusCore.getString(jQuery(t).val(),a.val(),a.data("language")))}),jQuery("body").on("change",".wpglobus-wpseo_focuskw",function(e){var t="#"+wpseoMetaboxL10n.field_prefix+"focuskw",a=jQuery(this);jQuery(t).val(WPGlobusCore.getString(jQuery(t).val(),a.val(),a.data("language")))}),jQuery("body").on("click",".wpglobus-post-body-tabs-list li",function(e){$this=jQuery(this),$this.hasClass("wpglobus-post-tab")&&jQuery("#wpglobus-wpseo-tabs").tabs("option","active",jQuery(this).data("order"))}),jQuery(".yoast_help").qtip({content:{attr:"alt"},position:{my:"bottom left",at:"top center"},style:{tip:{corner:!0},classes:"yoast-qtip qtip-rounded qtip-blue"},show:{when:{event:"mouseover"}},hide:{fixed:!0,when:{event:"mouseout"}}}),yst_updateSnippet()}function _(e,t,a){var s,o=yst_escapeFocusKw(jQuery.trim(jQuery("#"+wpseoMetaboxL10n.field_prefix+"focuskw_"+a).val()));if(""==o)return e;s=-1!=o.search(" ")?o.split(" "):new Array(o);for(var n=0;n<s.length;n++){var r=yst_clean(s[n]),l="";l=t?(r=r.replace(" ","-").toLowerCase(),new RegExp("([-/])("+r+")([-/])?")):new RegExp("(^|[ s\n\r\t.,'(\"+;!?:-]+)("+r+")($|[ s\n\r\t.,')\"+;!?:-]+)","gim"),null!=e&&(e=e.replace(l,"$1<strong>$2</strong>$3"))}return e}function w(a){var e=jQuery.trim(yst_clean(jQuery("#"+wpseoMetaboxL10n.field_prefix+"metadesc_"+a).val())),s=jQuery("<div />"),o=jQuery("#wpseosnippet_"+a);if(""==e&&""!=wpseoMetaboxL10n.wpseo_metadesc_template&&(e=wpseoMetaboxL10n.wpseo_metadesc_template),""!=e)e=yst_replaceVariables(e,function(e){var t;e=s.text(e).html(),e=yst_clean(e),t=(t=wpseoMetaboxL10n.wpseo_meta_desc_length-e.length)<0?'<span class="wrong">'+t+"</span>":'<span class="good">'+t+"</span>",jQuery("#"+wpseoMetaboxL10n.field_prefix+"metadesc-length_"+a).html(t),e=_(e=yst_trimDesc(e),!1),o.find(".desc span.autogen").html(""),o.find(".desc span.content").html(e),y(a)});else{jQuery("#"+wpseoMetaboxL10n.field_prefix+"metadesc-length_"+a).html(wpseoMetaboxL10n.wpseo_meta_desc_length),o.find(".desc span.content").html(""),y(a);var t="#content";a!=WPGlobusAdmin.data.default_language&&(t="#content_"+a),jQuery(t).length&&(e=jQuery(t).val(),e=yst_clean(e));var n=yst_escapeFocusKw(jQuery.trim(jQuery("#"+wpseoMetaboxL10n.field_prefix+"focuskw_"+a).val()));if(""!=n){var r=new RegExp(n,"gim");e=-1!=e.search(r)&&e.length>wpseoMetaboxL10n.wpseo_meta_desc_length?e.substr(e.search(r),wpseoMetaboxL10n.wpseo_meta_desc_length):e.substr(0,wpseoMetaboxL10n.wpseo_meta_desc_length)}else e=e.substr(0,wpseoMetaboxL10n.wpseo_meta_desc_length);e=_(e,!1),e=yst_trimDesc(e),o.find(".desc span.autogen").html(e)}}function y(e){var t=jQuery.trim(jQuery("#"+wpseoMetaboxL10n.field_prefix+"focuskw_"+e).val());t=yst_escapeFocusKw(t).toLowerCase();var a="#title",s="#content";e!=WPGlobusAdmin.data.default_language&&(a="#title_"+e,s="#content_"+e);var o=jQuery(document).triggerHandler("wpglobus_post_name_full",{postnamefull:"#editable-post-name-full",language:e})||"#editable-post-name-full";if(jQuery(o).length)var n=jQuery(o).text(),r=wpseoMetaboxL10n.wpseo_permalink_template.replace("%postname%",n).replace("http://","");var l=new RegExp("(^|[ s\n\r\t.,'(\"+;!?:-])"+t+"($|[ s\n\r\t.,')\"+!?:;-])","gim"),p=removeLowerCaseDiacritics(t),u=new RegExp(p.replace(/\s+/g,"[-_\\//]"),"gim"),i=jQuery("#focuskwresults_"+e),c=jQuery("#wpseosnippet_"+e).find(".desc span.content").text();if(""!=t){var d="<p>"+wpseoMetaboxL10n.keyword_header+"</p>";d+="<ul>",jQuery(a).length&&(d+="<li>"+wpseoMetaboxL10n.article_header_text+ptest(jQuery(a).val(),l)+"</li>"),d+="<li>"+wpseoMetaboxL10n.page_title_text+ptest(jQuery("#wpseosnippet_title_"+e).text(),l)+"</li>",d+="<li>"+wpseoMetaboxL10n.page_url_text+ptest(r,u)+"</li>",jQuery(s).length&&(d+="<li>"+wpseoMetaboxL10n.content_text+ptest(jQuery(s).val(),l)+"</li>"),d+="<li>"+wpseoMetaboxL10n.meta_description_text+ptest(c,l)+"</li>",d+="</ul>",i.html(d)}else i.html("")}};
includes/js/wpglobus-wpseo-22.min.js CHANGED
@@ -1 +1 @@
1
- "use strict";var wpglobus_wpseo=function(){if("undefined"!=typeof wpseoMetaboxL10n){var r=function(e,s){var t="",n=jQuery("#"+wpseoMetaboxL10n.field_prefix+"title_"+s),o=jQuery("#"+wpseoMetaboxL10n.field_prefix+"title-length-warning_"+s),l=jQuery("<div />"),a=jQuery("#wpseosnippet_title_"+s);if(n.val()?t=n.val().replace(/(<([^>]+)>)/gi,""):(t=wpseoMetaboxL10n.wpseo_title_template,t=l.html(t).text()),""===t)return a.html(""),void o.hide();t=ystClean(t),t=jQuery.trim(t),t=l.text(t).html(),e&&n.val(t),t=function(e,t,a){if(void 0!==e){if("undefined"==typeof replacedVars&&0==jQuery("#title").size())return e;var s="#title",n="#excerpt-"+t,o="#content";t!=WPGlobusAdmin.data.default_language&&(s="#title_"+t,o="#content_"+t),jQuery(s).length&&(e=e.replace(/%%title%%/g,jQuery(s).val().replace(/(<([^>]+)>)/gi,""))),e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=e.replace(/%%sitedesc%%/g,WPGlobusAdmin.data.blogdescription[t])).replace(/%%sitename%%/g,WPGlobusAdmin.data.blogname[t])).replace(/%%sep%%/g,wpseoMetaboxL10n.sep)).replace(/%%date%%/g,wpseoMetaboxL10n.date)).replace(/%%id%%/g,wpseoMetaboxL10n.id)).replace(/%%page%%/g,wpseoMetaboxL10n.page)).replace(/%%currenttime%%/g,wpseoMetaboxL10n.currenttime)).replace(/%%currentdate%%/g,wpseoMetaboxL10n.currentdate)).replace(/%%currentday%%/g,wpseoMetaboxL10n.currentday)).replace(/%%currentmonth%%/g,wpseoMetaboxL10n.currentmonth)).replace(/%%currentyear%%/g,wpseoMetaboxL10n.currentyear)).replace(/%%focuskw%%/g,jQuery("#yoast_wpseo_focuskw_"+t).val().replace(/(<([^>]+)>)/gi,""));var l="";jQuery(n).length&&(l=ystClean(jQuery(n).val().replace(/(<([^>]+)>)/gi,"")),e=e.replace(/%%excerpt_only%%/g,l)),""===l&&jQuery(o).length&&(l=jQuery(o).val().replace(/(<([^>]+)>)/gi,"").substring(0,wpseoMetaboxL10n.wpseo_meta_desc_length-1)),e=e.replace(/%%excerpt%%/g,l),jQuery("#parent_id").length&&jQuery("#parent_id option:selected").text()!==wpseoMetaboxL10n.no_parent_text&&(e=e.replace(/%%parent_title%%/g,jQuery("#parent_id option:selected").text()));var r=ystEscapeFocusKw(wpseoMetaboxL10n.sep),u=new RegExp(r+" "+r,"g");if(-1!==(e=e.replace(u,wpseoMetaboxL10n.sep)).indexOf("%%")&&null!==e.match(/%%[a-z0-9_-]+%%/i))for(var p=e.match(/%%[a-z0-9_-]+%%/gi),i=0;i<p.length;i++)if(void 0===replacedVars[p[i]])e=e.replace(p[i],replacedVars[p[i]]);else{var c=p[i];replacedVars[c]="",ystAjaxReplaceVariables(c,a)}a(e)}}(t,s,function(e){e=ystSanitizeTitle(e),jQuery("#wpseosnippet_title_"+s).html(e);var t=l.html(e).text();n.attr("placeholder",t);var a=document.getElementById("wpseosnippet_title_"+s);null!==a&&(a.scrollWidth>a.clientWidth?o.show():o.hide()),w(s)})},u=function(e){r(!1,e),y(e)};jQuery("#wpglobus-wpseo-tabs").tabs();var e=jQuery("#wpglobus-wpseo-attr"),p=jQuery(".wpseotab.general .form-table"),i=e.data("ids"),c=e.data("names"),d="";i=(i=i+","+e.data("qtip")).split(","),c=c.split(","),jQuery("#wpglobus-wpseo-tabs").insertBefore(p),jQuery(".wpglobus-wpseo-general").each(function(e,t){var s=jQuery(t),n=s.data("language");if(s.html('<table class="form-table wpglobus-table-'+n+'" data-language="'+n+'">'+p.html()+"</table>"),jQuery.each(c,function(e,t){jQuery("#"+t).attr("name",t+"_"+n)}),jQuery.each(i,function(e,t){var a=jQuery("#"+t);"wpseosnippet"==t&&a.addClass("wpglobus-wpseosnippet"),"focuskwresults"==t&&a.addClass("wpglobus-focuskwresults"),wpseoMetaboxL10n.field_prefix+"metadesc"==t&&a.addClass("wpglobus-wpseo_metadesc").text(s.data("metadesc")),wpseoMetaboxL10n.field_prefix+"title"==t&&a.addClass("wpglobus-wpseo_title").val(s.data("wpseotitle")),wpseoMetaboxL10n.field_prefix+"focuskw"==t&&a.addClass("wpglobus-wpseo_focuskw").val(s.data("focuskw")),a.attr("id",t+"_"+n),jQuery("#"+t+"_"+n).attr("data-language",n)}),d="complete"==s.data("permalink")?s.data("url-"+n):s.data("url-"+n)+jQuery("#editable-post-name-full").text()+"/",jQuery("#wpseosnippet_"+n+" .url").text(d),u(n),void 0!==jQuery().autocomplete){var o,l={};jQuery("#"+wpseoMetaboxL10n.field_prefix+"focuskw_"+n).autocomplete({minLength:3,formatResult:function(e){return jQuery("<div/>").html(e).html()},source:function(e,s){var n=e.term;n in l?s(l[n]):(e._ajax_nonce=wpseoMetaboxL10n.wpseo_keyword_suggest_nonce,e.action="wpseo_get_suggest",o=jQuery.getJSON(ajaxurl,e,function(e,t,a){l[n]=e,a===o&&s(e)}))}})}jQuery("#"+wpseoMetaboxL10n.field_prefix+"title_"+n).keyup(function(){r(!1,jQuery(this).data("language"))}),jQuery("#title_"+n).keyup(function(){var e=jQuery(this).data("language")?jQuery(this).data("language"):WPGlobusAdmin.data.default_language;r(!1,e),y(e)}),0==e&&jQuery("#title").keyup(function(){r(!1,WPGlobusAdmin.data.default_language),y(WPGlobusAdmin.data.default_language)}),0==e&&jQuery("body").on("change","#parent_id",function(){jQuery.each(WPGlobusAdmin.data.enabled_languages,function(e,t){r(!1,t),y(t)})}),jQuery("#"+wpseoMetaboxL10n.field_prefix+"metadesc_"+n).keyup(function(){y(jQuery(this).data("language"))}),jQuery("body").on("keyup","#excerpt-"+n,function(){y(jQuery(this).data("language")?jQuery(this).data("language"):WPGlobusAdmin.data.default_language)}),0==e&&jQuery(".wpglobus-editor").focusout(function(){y(jQuery(this).data("language"))});var a=!1;jQuery(document).on("change","#"+wpseoMetaboxL10n.field_prefix+"focuskw_"+n,function(){var e=jQuery(this).data("language"),t=jQuery("#focuskwhelp_"+e);-1!=jQuery("#"+wpseoMetaboxL10n.field_prefix+"focuskw_"+e).val().search(",")?(t.click(),a=!0):a&&(t.qtip("hide"),a=!1),u(e)})}),p.addClass("hidden"),jQuery("body").on("change",".wpglobus-wpseo_metadesc",function(e){var t="#"+wpseoMetaboxL10n.field_prefix+"metadesc",a=jQuery(this);jQuery(t).val(WPGlobusCore.getString(jQuery(t).val(),a.val(),a.data("language")))}),jQuery("body").on("change",".wpglobus-wpseo_title",function(e){var t="#"+wpseoMetaboxL10n.field_prefix+"title",a=jQuery(this);jQuery(t).val(WPGlobusCore.getString(jQuery(t).val(),a.val(),a.data("language")))}),jQuery("body").on("change",".wpglobus-wpseo_focuskw",function(e){var t="#"+wpseoMetaboxL10n.field_prefix+"focuskw",a=jQuery(this);jQuery(t).val(WPGlobusCore.getString(jQuery(t).val(),a.val(),a.data("language")))}),jQuery("body").on("click",".wpglobus-post-body-tabs-list li",function(e){jQuery(this).hasClass("wpglobus-post-tab")&&jQuery("#wpglobus-wpseo-tabs").tabs("option","active",jQuery(this).data("order"))}),jQuery(".yoast_help").qtip({content:{attr:"alt"},position:{my:"bottom left",at:"top center"},style:{tip:{corner:!0},classes:"yoast-qtip qtip-rounded qtip-blue"},show:"click",hide:{fixed:!0,delay:500}}),ystUpdateSnippet()}function g(e,t,a){var s,n=ystEscapeFocusKw(jQuery.trim(jQuery("#"+wpseoMetaboxL10n.field_prefix+"focuskw_"+a).val()));if(""===n)return e;s=-1!==n.search(" ")?n.split(" "):new Array(n);for(var o=0;o<s.length;o++){var l=ystClean(s[o]),r="";t?(l=l.replace(" ","-").toLowerCase(),r=new RegExp("([-/])("+l+")([-/])?")):r=new RegExp("(^|[ \\s\n\r\t\\.,'\\(\"\\+;!?:\\-]+)("+l+")($|[ \\s\n\r\t\\.,'\\)\"\\+;!?:\\-]+)","gim"),void 0!==e&&(e=e.replace(r,"$1<strong>$2</strong>$3"))}return e}function y(a){var e=jQuery.trim(ystClean(jQuery("#"+wpseoMetaboxL10n.field_prefix+"metadesc_"+a).val())),s=jQuery("<div />"),n=jQuery("#wpseosnippet_"+a);if(""===e&&""!==wpseoMetaboxL10n.wpseo_metadesc_template&&(e=wpseoMetaboxL10n.wpseo_metadesc_template),""!==e)e=ystReplaceVariables(e,function(e){e=s.text(e).html(),e=ystClean(e);var t=wpseoMetaboxL10n.wpseo_meta_desc_length-e.length;t=t<0?'<span class="wrong">'+t+"</span>":'<span class="good">'+t+"</span>",jQuery("#"+wpseoMetaboxL10n.field_prefix+"metadesc-length_"+a).html(t),e=g(e=ystSanitizeDesc(e),!1),n.find(".desc span.autogen").html(""),n.find(".desc span.content").html(e),w(a)});else{jQuery("#"+wpseoMetaboxL10n.field_prefix+"metadesc-length_"+a).html(wpseoMetaboxL10n.wpseo_meta_desc_length),n.find(".desc span.content").html(""),w(a);var t="#content";a!=WPGlobusAdmin.data.default_language&&(t="#content_"+a),"undefined"!=typeof tinyMCE&&null!==tinyMCE.get("excerpt-"+a)&&(e=tinyMCE.get("excerpt-"+a).getContent(),e=ystClean(e)),"undefined"!=typeof tinyMCE&&null!==tinyMCE.get(t)&&0===e.length&&(e=tinyMCE.get(t).getContent(),e=ystClean(e));var o=ystEscapeFocusKw(jQuery.trim(jQuery("#"+wpseoMetaboxL10n.field_prefix+"focuskw_"+a).val()));if(""!==o){var l=new RegExp(o,"gim");e=-1!==e.search(l)&&e.length>wpseoMetaboxL10n.wpseo_meta_desc_length?e.substr(e.search(l),wpseoMetaboxL10n.wpseo_meta_desc_length):e.substr(0,wpseoMetaboxL10n.wpseo_meta_desc_length)}else e=e.substr(0,wpseoMetaboxL10n.wpseo_meta_desc_length);e=g(e,!1),e=ystSanitizeDesc(e),n.find(".desc span.autogen").html(e)}}function w(e){var t=jQuery.trim(jQuery("#"+wpseoMetaboxL10n.field_prefix+"focuskw_"+e).val());t=ystEscapeFocusKw(t).toLowerCase();var a,s,n="#title",o="#content";e!=WPGlobusAdmin.data.default_language&&(n="#title_"+e,o="#content_"+e);var l=jQuery(document).triggerHandler("wpglobus_post_name_full",{postnamefull:"#editable-post-name-full",language:e})||"#editable-post-name-full";jQuery(l).length&&(a=jQuery(l).text(),s=wpseoMetaboxL10n.wpseo_permalink_template.replace("%postname%",a).replace("http://",""));var r=new RegExp("(^|[ \\s\n\r\t\\.,'\\(\"\\+;!?:\\-])"+ystRemoveLowerCaseDiacritics(t)+"($|[\\s\n\r\t.,'\\)\"\\+!?:;\\-])","gim"),u=ystRemoveLowerCaseDiacritics(t),p=new RegExp(u.replace(/\s+/g,"[-_\\//]"),"gim"),i=jQuery("#focuskwresults_"+e),c=jQuery("#wpseosnippet_"+e).find(".desc span.content").text();if(""!==t){var d="<p>"+wpseoMetaboxL10n.keyword_header+"</p>";d+="<ul>",jQuery(n).length&&(d+="<li>"+wpseoMetaboxL10n.article_header_text+ystFocusKwTest(jQuery(n).val(),r)+"</li>"),d+="<li>"+wpseoMetaboxL10n.page_title_text+ystFocusKwTest(jQuery("#wpseosnippet_title_"+e).text(),r)+"</li>",d+="<li>"+wpseoMetaboxL10n.page_url_text+ystFocusKwTest(s,p)+"</li>",jQuery(o).length&&(d+="<li>"+wpseoMetaboxL10n.content_text+ystFocusKwTest(jQuery(o).val(),r)+"</li>"),d+="<li>"+wpseoMetaboxL10n.meta_description_text+ystFocusKwTest(c,r)+"</li>",d+="</ul>",i.html(d)}else i.html("")}};
1
+ "use strict";var wpglobus_wpseo=function(){if("undefined"!=typeof wpseoMetaboxL10n){var r=function(e,s){var t="",n=jQuery("#"+wpseoMetaboxL10n.field_prefix+"title_"+s),o=jQuery("#"+wpseoMetaboxL10n.field_prefix+"title-length-warning_"+s),l=jQuery("<div />"),a=jQuery("#wpseosnippet_title_"+s);if(""===(t=n.val()?n.val().replace(/(<([^>]+)>)/gi,""):(t=wpseoMetaboxL10n.wpseo_title_template,l.html(t).text())))return a.html(""),void o.hide();t=ystClean(t),t=jQuery.trim(t),t=l.text(t).html(),e&&n.val(t),t=function(e,t,a){if(void 0!==e){if("undefined"==typeof replacedVars&&0==jQuery("#title").size())return e;var s="#title",n="#excerpt-"+t,o="#content";t!=WPGlobusAdmin.data.default_language&&(s="#title_"+t,o="#content_"+t),jQuery(s).length&&(e=e.replace(/%%title%%/g,jQuery(s).val().replace(/(<([^>]+)>)/gi,""))),e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=e.replace(/%%sitedesc%%/g,WPGlobusAdmin.data.blogdescription[t])).replace(/%%sitename%%/g,WPGlobusAdmin.data.blogname[t])).replace(/%%sep%%/g,wpseoMetaboxL10n.sep)).replace(/%%date%%/g,wpseoMetaboxL10n.date)).replace(/%%id%%/g,wpseoMetaboxL10n.id)).replace(/%%page%%/g,wpseoMetaboxL10n.page)).replace(/%%currenttime%%/g,wpseoMetaboxL10n.currenttime)).replace(/%%currentdate%%/g,wpseoMetaboxL10n.currentdate)).replace(/%%currentday%%/g,wpseoMetaboxL10n.currentday)).replace(/%%currentmonth%%/g,wpseoMetaboxL10n.currentmonth)).replace(/%%currentyear%%/g,wpseoMetaboxL10n.currentyear)).replace(/%%focuskw%%/g,jQuery("#yoast_wpseo_focuskw_"+t).val().replace(/(<([^>]+)>)/gi,""));var l="";jQuery(n).length&&(l=ystClean(jQuery(n).val().replace(/(<([^>]+)>)/gi,"")),e=e.replace(/%%excerpt_only%%/g,l)),""===l&&jQuery(o).length&&(l=jQuery(o).val().replace(/(<([^>]+)>)/gi,"").substring(0,wpseoMetaboxL10n.wpseo_meta_desc_length-1)),e=e.replace(/%%excerpt%%/g,l),jQuery("#parent_id").length&&jQuery("#parent_id option:selected").text()!==wpseoMetaboxL10n.no_parent_text&&(e=e.replace(/%%parent_title%%/g,jQuery("#parent_id option:selected").text()));var r=ystEscapeFocusKw(wpseoMetaboxL10n.sep),u=new RegExp(r+" "+r,"g");if(-1!==(e=e.replace(u,wpseoMetaboxL10n.sep)).indexOf("%%")&&null!==e.match(/%%[a-z0-9_-]+%%/i))for(var p=e.match(/%%[a-z0-9_-]+%%/gi),i=0;i<p.length;i++)if(void 0===replacedVars[p[i]])e=e.replace(p[i],replacedVars[p[i]]);else{var c=p[i];replacedVars[c]="",ystAjaxReplaceVariables(c,a)}a(e)}}(t,s,function(e){e=ystSanitizeTitle(e),jQuery("#wpseosnippet_title_"+s).html(e);var t=l.html(e).text();n.attr("placeholder",t);var a=document.getElementById("wpseosnippet_title_"+s);null!==a&&(a.scrollWidth>a.clientWidth?o.show():o.hide()),w(s)})},u=function(e){r(!1,e),y(e)};jQuery("#wpglobus-wpseo-tabs").tabs();var e=jQuery("#wpglobus-wpseo-attr"),p=jQuery(".wpseotab.general .form-table"),i=e.data("ids"),c=e.data("names"),d="";i=(i=i+","+e.data("qtip")).split(","),c=c.split(","),jQuery("#wpglobus-wpseo-tabs").insertBefore(p),jQuery(".wpglobus-wpseo-general").each(function(e,t){var s=jQuery(t),n=s.data("language");if(s.html('<table class="form-table wpglobus-table-'+n+'" data-language="'+n+'">'+p.html()+"</table>"),jQuery.each(c,function(e,t){jQuery("#"+t).attr("name",t+"_"+n)}),jQuery.each(i,function(e,t){var a=jQuery("#"+t);"wpseosnippet"==t&&a.addClass("wpglobus-wpseosnippet"),"focuskwresults"==t&&a.addClass("wpglobus-focuskwresults"),wpseoMetaboxL10n.field_prefix+"metadesc"==t&&a.addClass("wpglobus-wpseo_metadesc").text(s.data("metadesc")),wpseoMetaboxL10n.field_prefix+"title"==t&&a.addClass("wpglobus-wpseo_title").val(s.data("wpseotitle")),wpseoMetaboxL10n.field_prefix+"focuskw"==t&&a.addClass("wpglobus-wpseo_focuskw").val(s.data("focuskw")),a.attr("id",t+"_"+n),jQuery("#"+t+"_"+n).attr("data-language",n)}),d="complete"==s.data("permalink")?s.data("url-"+n):s.data("url-"+n)+jQuery("#editable-post-name-full").text()+"/",jQuery("#wpseosnippet_"+n+" .url").text(d),u(n),void 0!==jQuery().autocomplete){var o,l={};jQuery("#"+wpseoMetaboxL10n.field_prefix+"focuskw_"+n).autocomplete({minLength:3,formatResult:function(e){return jQuery("<div/>").html(e).html()},source:function(e,s){var n=e.term;n in l?s(l[n]):(e._ajax_nonce=wpseoMetaboxL10n.wpseo_keyword_suggest_nonce,e.action="wpseo_get_suggest",o=jQuery.getJSON(ajaxurl,e,function(e,t,a){l[n]=e,a===o&&s(e)}))}})}jQuery("#"+wpseoMetaboxL10n.field_prefix+"title_"+n).keyup(function(){r(!1,jQuery(this).data("language"))}),jQuery("#title_"+n).keyup(function(){var e=jQuery(this).data("language")?jQuery(this).data("language"):WPGlobusAdmin.data.default_language;r(!1,e),y(e)}),0==e&&jQuery("#title").keyup(function(){r(!1,WPGlobusAdmin.data.default_language),y(WPGlobusAdmin.data.default_language)}),0==e&&jQuery("body").on("change","#parent_id",function(){jQuery.each(WPGlobusAdmin.data.enabled_languages,function(e,t){r(!1,t),y(t)})}),jQuery("#"+wpseoMetaboxL10n.field_prefix+"metadesc_"+n).keyup(function(){y(jQuery(this).data("language"))}),jQuery("body").on("keyup","#excerpt-"+n,function(){y(jQuery(this).data("language")?jQuery(this).data("language"):WPGlobusAdmin.data.default_language)}),0==e&&jQuery(".wpglobus-editor").focusout(function(){y(jQuery(this).data("language"))});var a=!1;jQuery(document).on("change","#"+wpseoMetaboxL10n.field_prefix+"focuskw_"+n,function(){var e=jQuery(this).data("language"),t=jQuery("#focuskwhelp_"+e);-1!=jQuery("#"+wpseoMetaboxL10n.field_prefix+"focuskw_"+e).val().search(",")?(t.click(),a=!0):a&&(t.qtip("hide"),a=!1),u(e)})}),p.addClass("hidden"),jQuery("body").on("change",".wpglobus-wpseo_metadesc",function(e){var t="#"+wpseoMetaboxL10n.field_prefix+"metadesc",a=jQuery(this);jQuery(t).val(WPGlobusCore.getString(jQuery(t).val(),a.val(),a.data("language")))}),jQuery("body").on("change",".wpglobus-wpseo_title",function(e){var t="#"+wpseoMetaboxL10n.field_prefix+"title",a=jQuery(this);jQuery(t).val(WPGlobusCore.getString(jQuery(t).val(),a.val(),a.data("language")))}),jQuery("body").on("change",".wpglobus-wpseo_focuskw",function(e){var t="#"+wpseoMetaboxL10n.field_prefix+"focuskw",a=jQuery(this);jQuery(t).val(WPGlobusCore.getString(jQuery(t).val(),a.val(),a.data("language")))}),jQuery("body").on("click",".wpglobus-post-body-tabs-list li",function(e){jQuery(this).hasClass("wpglobus-post-tab")&&jQuery("#wpglobus-wpseo-tabs").tabs("option","active",jQuery(this).data("order"))}),jQuery(".yoast_help").qtip({content:{attr:"alt"},position:{my:"bottom left",at:"top center"},style:{tip:{corner:!0},classes:"yoast-qtip qtip-rounded qtip-blue"},show:"click",hide:{fixed:!0,delay:500}}),ystUpdateSnippet()}function g(e,t,a){var s,n=ystEscapeFocusKw(jQuery.trim(jQuery("#"+wpseoMetaboxL10n.field_prefix+"focuskw_"+a).val()));if(""===n)return e;s=-1!==n.search(" ")?n.split(" "):new Array(n);for(var o=0;o<s.length;o++){var l=ystClean(s[o]),r="";r=t?(l=l.replace(" ","-").toLowerCase(),new RegExp("([-/])("+l+")([-/])?")):new RegExp("(^|[ \\s\n\r\t\\.,'\\(\"\\+;!?:\\-]+)("+l+")($|[ \\s\n\r\t\\.,'\\)\"\\+;!?:\\-]+)","gim"),void 0!==e&&(e=e.replace(r,"$1<strong>$2</strong>$3"))}return e}function y(a){var e=jQuery.trim(ystClean(jQuery("#"+wpseoMetaboxL10n.field_prefix+"metadesc_"+a).val())),s=jQuery("<div />"),n=jQuery("#wpseosnippet_"+a);if(""===e&&""!==wpseoMetaboxL10n.wpseo_metadesc_template&&(e=wpseoMetaboxL10n.wpseo_metadesc_template),""!==e)e=ystReplaceVariables(e,function(e){e=s.text(e).html(),e=ystClean(e);var t=wpseoMetaboxL10n.wpseo_meta_desc_length-e.length;t=t<0?'<span class="wrong">'+t+"</span>":'<span class="good">'+t+"</span>",jQuery("#"+wpseoMetaboxL10n.field_prefix+"metadesc-length_"+a).html(t),e=g(e=ystSanitizeDesc(e),!1),n.find(".desc span.autogen").html(""),n.find(".desc span.content").html(e),w(a)});else{jQuery("#"+wpseoMetaboxL10n.field_prefix+"metadesc-length_"+a).html(wpseoMetaboxL10n.wpseo_meta_desc_length),n.find(".desc span.content").html(""),w(a);var t="#content";a!=WPGlobusAdmin.data.default_language&&(t="#content_"+a),"undefined"!=typeof tinyMCE&&null!==tinyMCE.get("excerpt-"+a)&&(e=tinyMCE.get("excerpt-"+a).getContent(),e=ystClean(e)),"undefined"!=typeof tinyMCE&&null!==tinyMCE.get(t)&&0===e.length&&(e=tinyMCE.get(t).getContent(),e=ystClean(e));var o=ystEscapeFocusKw(jQuery.trim(jQuery("#"+wpseoMetaboxL10n.field_prefix+"focuskw_"+a).val()));if(""!==o){var l=new RegExp(o,"gim");e=-1!==e.search(l)&&e.length>wpseoMetaboxL10n.wpseo_meta_desc_length?e.substr(e.search(l),wpseoMetaboxL10n.wpseo_meta_desc_length):e.substr(0,wpseoMetaboxL10n.wpseo_meta_desc_length)}else e=e.substr(0,wpseoMetaboxL10n.wpseo_meta_desc_length);e=g(e,!1),e=ystSanitizeDesc(e),n.find(".desc span.autogen").html(e)}}function w(e){var t=jQuery.trim(jQuery("#"+wpseoMetaboxL10n.field_prefix+"focuskw_"+e).val());t=ystEscapeFocusKw(t).toLowerCase();var a,s,n="#title",o="#content";e!=WPGlobusAdmin.data.default_language&&(n="#title_"+e,o="#content_"+e);var l=jQuery(document).triggerHandler("wpglobus_post_name_full",{postnamefull:"#editable-post-name-full",language:e})||"#editable-post-name-full";jQuery(l).length&&(a=jQuery(l).text(),s=wpseoMetaboxL10n.wpseo_permalink_template.replace("%postname%",a).replace("http://",""));var r=new RegExp("(^|[ \\s\n\r\t\\.,'\\(\"\\+;!?:\\-])"+ystRemoveLowerCaseDiacritics(t)+"($|[\\s\n\r\t.,'\\)\"\\+!?:;\\-])","gim"),u=ystRemoveLowerCaseDiacritics(t),p=new RegExp(u.replace(/\s+/g,"[-_\\//]"),"gim"),i=jQuery("#focuskwresults_"+e),c=jQuery("#wpseosnippet_"+e).find(".desc span.content").text();if(""!==t){var d="<p>"+wpseoMetaboxL10n.keyword_header+"</p>";d+="<ul>",jQuery(n).length&&(d+="<li>"+wpseoMetaboxL10n.article_header_text+ystFocusKwTest(jQuery(n).val(),r)+"</li>"),d+="<li>"+wpseoMetaboxL10n.page_title_text+ystFocusKwTest(jQuery("#wpseosnippet_title_"+e).text(),r)+"</li>",d+="<li>"+wpseoMetaboxL10n.page_url_text+ystFocusKwTest(s,p)+"</li>",jQuery(o).length&&(d+="<li>"+wpseoMetaboxL10n.content_text+ystFocusKwTest(jQuery(o).val(),r)+"</li>"),d+="<li>"+wpseoMetaboxL10n.meta_description_text+ystFocusKwTest(c,r)+"</li>",d+="</ul>",i.html(d)}else i.html("")}};
includes/js/wpglobus-yoastseo-32.min.js CHANGED
@@ -1 +1 @@
1
- var WPGlobusYoastSeo;jQuery(document).ready(function(l){"use strict";var r;if("undefined"!=typeof wpseoReplaceVarsL10n&&("undefined"!=typeof WPGlobusCoreData&&"undefined"!=typeof WPGlobusVendor))if("edit-tags.php"==WPGlobusVendor.pagenow||"term.php"==WPGlobusVendor.pagenow){r=WPGlobusYoastSeo={editorIDs:["description"],editor:{},submitId:"#submit",preventChangeEditor:!1,observer:null,init:function(){r.attachListeners(),_.delay(r.start,1500)},submit:function(e){"mouseenter"===e.type?l.each(r.editor,function(e,t){!r.editor[e].contentEditor||r.editor[e].contentEditor.isHidden()?l("#"+e).val(r.editor[e].content):tinymce.get(e).setContent(r.editor[e].content)}):"mouseleave"===e.type?r.preventChangeEditor||(l.each(r.editor,function(e,t){!r.editor[e].contentEditor||r.editor[e].contentEditor.isHidden()?l("#"+e).val(WPGlobusCore.TextFilter(t.content,r.getCurrentTab(),"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,r.getCurrentTab(),"RETURN_EMPTY"))}),r.preventChangeEditor=!1):"click"===e.type&&(r.preventChangeEditor=!0,"tinymce"!=getUserSetting("editor")&&setUserSetting("editor","tinymce"))},attachListeners:function(){l(".wrap").on("tabsactivate",function(e,a){l.each(r.editor,function(e,t){!r.editor[e].contentEditor||r.editor[e].contentEditor.isHidden()?l("#"+e).val(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY"))})}),l(document).on("mouseenter",r.submitId,r.submit).on("mouseleave",r.submitId,r.submit).on("click",r.submitId,r.submit),l(document).on("tinymce-editor-init",function(e,t){if(-1!=_.indexOf(r.editorIDs,t.id)){var a=l("#"+t.id);r.editor[t.id]={},r.editor[t.id].contentEditor=t,r.editor[t.id].content=a.val(),t.setContent(WPGlobusCore.TextFilter(r.editor[t.id].content,WPGlobusCoreData.default_language,"RETURN_EMPTY")),l("#"+t.getContainer().id).find("iframe").addClass("wpglobus-translatable"),a.removeClass("hidden"),t.on("nodechange keyup",_.debounce(r.update,500)),a.on("input keyup",_.debounce(r.update,500))}})},update:function(e){var t,a;void 0!==e.target&&("tinymce"==(t=e.target.id)&&(t=e.target.dataset.id),void 0!==r.editor[t].contentEditor&&(a=!r.editor[t].contentEditor||r.editor[t].contentEditor.isHidden()?l("#"+t).val():r.editor[t].contentEditor.getContent({format:"raw"}),r.editor[t].content=WPGlobusCore.getString(r.editor[t].content,a,r.getCurrentTab())))},getCurrentTab:function(){return l(".wpglobus-taxonomy-tabs-list .ui-tabs-active").data("language")},start:function(){l(".wpglobus-element_description").css({display:"none"})}},WPGlobusYoastSeo.init();var s=function(){l(".wrap").on("tabsactivate",function(e,t){t.newTab[0].dataset.language==WPGlobusCoreData.default_language?l("#poststuff .inside").css({display:"block"}):l("#poststuff .inside").css({display:"none"})}),l.each(["category_description","sitedesc","sitename","tag_description","term_description","term_title"],function(e,t){wpseoReplaceVarsL10n.replace_vars[t]=WPGlobusCore.TextFilter(wpseoReplaceVarsL10n.replace_vars[t],WPGlobusCoreData.default_language)}),WPGlobusYoastSeo.observer=new MutationObserver(function(e){e.forEach(function(e){if("placeholder"==e.attributeName){WPGlobusYoastSeo.observer.disconnect();var t=l("#wpseo_focuskw");""==t.val()&&t.attr("placeholder",WPGlobusCore.TextFilter(t.attr("placeholder"),WPGlobusCoreData.default_language)),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0})}})}),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0})};window.WPGlobusYoastSeoPlugin=new s}else{var d;r=WPGlobusYoastSeo={wpseoTabSelector:"#wpglobus-wpseo-tabs",url:"",attrs:l("#wpglobus-wpseo-attr"),iB:l("#wpseo-meta-section-content"),t:l("#wpseo-meta-section-content"),ids:"",names:"",editSnippetButtonClass:"wpglobus-snippet-editor__edit-button",editSnippetFormClass:"wpglobus-snippet-editor__form",editSnippetSubmitClass:"wpglobus-snippet-editor__submit",editSnippetHeadingClass:"wpglobus-snippet-editor__heading-editor",yoastTitleProgress:"wpglobus-yoast-title-progress",yoastMetadescProgress:"wpglobus-yoast-metadesc-progress",init:function(){r.start()},initAddKeywordPopup:function(){1===l("#wpseo-add-keyword-popup").length&&l(".wpseo-add-keyword").on("click",r.addKeywordPopup)},addKeywordPopup:function(){var e=l("#wpseo-add-keyword-popup-button").text();tb_show(e,"#TB_inline?width=650&height=350&inlineId=wpseo-add-keyword-popup","group"),jQuery("#TB_window").css("height",235),jQuery("#TB_window").css("width",680)},qtip:function(){l(".yoast_help").qtip({content:{attr:"alt"},position:{my:"bottom left",at:"top center"},style:{tip:{corner:!0},classes:"yoast-qtip qtip-rounded qtip-blue"},show:"click",hide:{fixed:!0,delay:500}})},removeClasses:function(t,e){_.each(e,function(e){t.removeClass(e)})},updateProgressBar:function(e,t){if(void 0!==e&&(void 0!==t||("undefined"!==e.data("language")&&(t=e.data("language")),void 0!==t))){var a,s,o=["snippet-editor__progress--bad","snippet-editor__progress--ok","snippet-editor__progress--good"],i="",n=0,p=!1;s=e.val().length,e.hasClass("wpglobus-snippet-editor-title")?(n=(a=l("progress."+r.yoastTitleProgress+"_"+t)).attr("max"),i=o[2],0==s?i=o[1]:n<s?(i=o[1],p=!0):0<s&&s<35&&(i=o[1])):e.hasClass("wpglobus-snippet-editor-meta-description")&&(n=(a=l("progress."+r.yoastMetadescProgress+"_"+t)).attr("max"),i=o[2],0==s?i=o[1]:n<s?(i=o[1],p=!0):0<s&&s<121&&(i=o[1])),r.removeClasses(a,o),a.attr("value",s).addClass(i),p?e.css("color","#f00"):e.css("color","#000")}},updateWpseoKeyword:function(e,t){l("#wpseo-meta-section-content_"+t+" .wpseo_keyword").text(e)},start:function(){l(r.wpseoTabSelector).tabs(),r.ids=r.attrs.data("ids"),r.names=r.attrs.data("names"),r.ids=r.ids+","+r.attrs.data("qtip"),r.ids=r.ids.split(","),r.names=r.names.split(","),l("#wpglobus-wpseo-tabs").insertBefore(r.iB),l(".wpseo-metabox-tabs").css({height:"26px"}),l(".wpglobus-wpseo-general").each(function(e,t){var a=l(t),s=a.data("language"),o="wpseo-meta-section-content_"+s;a.html('<div id="'+o+'" class="wpseo-meta-section wpglobus-wpseo-meta-section" style="width:100%" data-language="'+s+'">'+r.t.html()+"</div>"),l("#"+o+" .wpseo-metabox-tabs").attr("id","wpseo-metabox-tabs_"+s),l("#"+o+" .wpseotab").attr("id","wpseo_content_"+s),l("#wpseo_content_"+s).css({float:"left"}),l("#"+o).css({display:"block"}),l("#wpseo_meta").css({overflow:"hidden"}),l("#"+o+" .snippet_container").addClass("wpglobus-snippet_container"),s!==WPGlobusCoreData.default_language&&l("#"+o+" .wpseo-add-keyword").addClass("hidden"),l.each(r.names,function(e,t){l("#"+t).attr("name",t+"_"+s)}),l.each(r.ids,function(e,t){var a=l("#"+t);"wpseosnippet"==t&&a.addClass("wpglobus-wpseosnippet"),"snippet_title"==t&&a.addClass("wpglobus-snippet_title"),"snippet_meta"==t&&a.addClass("wpglobus-snippet_meta"),"snippet_cite"==t&&a.addClass("wpglobus-snippet_cite"),"snippet_citeBase"==t&&a.addClass("wpglobus-snippet_citeBase"),"yoast_wpseo_focuskw_text_input"==t&&a.addClass("wpglobus-yoast_wpseo_focuskw_text_input"),"wpseo-pageanalysis"==t&&a.addClass("wpglobus-wpseo-pageanalysis"),"snippet_preview"==t&&a.addClass("wpglobus-snippet_preview"),"snippet-editor-title"==t&&(a.addClass("wpglobus-snippet-editor-title"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),a.val(l("#wpseo-tab-"+s).data("wpseotitle")),a.parent("label").find("progress").addClass(r.yoastTitleProgress).addClass(r.yoastTitleProgress+"_"+s),_.debounce(r.updateProgressBar(a,s),500)),"snippet-editor-slug"==t&&(a.addClass("wpglobus-snippet-editor-slug"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),WPGlobusCoreData.default_language!=s&&a.attr("disabled","disabled")),"snippet-editor-meta-description"==t&&(a.addClass("wpglobus-snippet-editor-meta-description"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),a.val(l("#wpseo-tab-"+s).data("metadesc")),a.parent("label").find("progress").addClass(r.yoastMetadescProgress).addClass(r.yoastMetadescProgress+"_"+s),_.debounce(r.updateProgressBar(a,s),500)),"snippetpreview-help-toggle"==t&&(a.addClass("wpglobus-snippetpreview-help-toggle_"+s),l(document).on("click",".wpglobus-snippetpreview-help-toggle_"+s,function(e){var t=l(this);"none"===l("#snippetpreview-help_"+t.data("language")).css("display")?l("#snippetpreview-help_"+t.data("language")).css({display:"block"}):l("#snippetpreview-help_"+t.data("language")).css({display:"none"})})),"focuskw_text_input-help-toggle"==t&&(a.addClass("wpglobus-focuskw_text_input-help-toggle_"+s),l(document).on("click",".wpglobus-focuskw_text_input-help-toggle_"+s,function(e){var t=l(this);"none"===l("#focuskw_text_input-help_"+t.data("language")).css("display")?l("#focuskw_text_input-help_"+t.data("language")).css({display:"block"}):l("#focuskw_text_input-help_"+t.data("language")).css({display:"none"})})),"pageanalysis-help-toggle"==t&&(a.addClass("wpglobus-pageanalysis-help-toggle_"+s),l(document).on("click",".wpglobus-pageanalysis-help-toggle_"+s,function(e){var t=l(this);"none"===l("#pageanalysis-help_"+t.data("language")).css("display")?l("#pageanalysis-help_"+t.data("language")).css({display:"block"}):l("#pageanalysis-help_"+t.data("language")).css({display:"none"})})),a.attr("id",t+"_"+s),l("#"+t+"_"+s).attr("data-language",s)});var i=WPGlobusCore.TextFilter(l("#yoast_wpseo_focuskw_text_input").val(),s,"RETURN_EMPTY");l("#yoast_wpseo_focuskw_text_input_"+s).val(i),l("#yoast_wpseo_focuskw_"+s).val(i),r.updateWpseoKeyword(i,s),s!==WPGlobusCoreData.default_language&&(l("#"+o+" #yoast_wpseo_focuskw_text_input_"+s).addClass("hidden").after('<div class="wpglobus-suggest" style="font-weight:bold;">'+WPGlobusVendor.i18n.yoastseo_plus_access+"</div>"),l("#"+o+" #wpseo-pageanalysis_"+s).addClass("hidden"))}),l(".wpglobus-wpseosnippet").each(function(e,t){var a=l(t),s=a.data("language");a.find("button.snippet-editor__button.snippet-editor__edit-button").addClass(r.editSnippetButtonClass).addClass(r.editSnippetButtonClass+"_"+s).attr("data-language",s),a.find(".snippet-editor__form").addClass(r.editSnippetFormClass).addClass(r.editSnippetFormClass+"_"+s),a.find(".snippet-editor__heading-editor").addClass(r.editSnippetHeadingClass).addClass(r.editSnippetHeadingClass+"_"+s),a.find(".snippet-editor__submit").addClass(r.editSnippetSubmitClass).addClass(r.editSnippetSubmitClass+"_"+s).attr("data-language",s)}),r.iB.addClass("hidden"),r.iB.css({height:0,overflow:"hidden"});var e=WPGlobusCore.TextFilter(l("#yoast_wpseo_focuskw_text_input").val(),WPGlobusCoreData.default_language,"RETURN_EMPTY");l("#yoast_wpseo_focuskw_text_input").val(e),l("#yoast_wpseo_focuskw").val(e),l(".wpseo-metabox-sidebar .wpseo-meta-section-link").on("click",function(e){"#wpseo-meta-section-content"==l(this).attr("href")?l("#wpglobus-wpseo-tabs").css({display:"block"}):l("#wpglobus-wpseo-tabs").css({display:"none"})}),l("body").on("click","."+r.editSnippetButtonClass,function(e){var t=l(this),a=t.data("language"),s=l("."+r.editSnippetFormClass+"_"+a),o=l("."+r.editSnippetSubmitClass+"_"+a),i=l("."+r.editSnippetHeadingClass+"_"+a);s.hasClass("snippet-editor--hidden")?(s.removeClass("snippet-editor--hidden"),i.removeClass("snippet-editor--hidden"),o.removeClass("snippet-editor--hidden")):(s.addClass("snippet-editor--hidden"),i.addClass("snippet-editor--hidden")),t.addClass("snippet-editor--hidden")}),l("body").on("click","."+r.editSnippetSubmitClass,function(e){var t=l(this).data("language"),a=l("."+r.editSnippetButtonClass+"_"+t),s=l("."+r.editSnippetFormClass+"_"+t),o=l("."+r.editSnippetSubmitClass+"_"+t),i=l("."+r.editSnippetHeadingClass+"_"+t);a.removeClass("snippet-editor--hidden"),s.addClass("snippet-editor--hidden"),o.addClass("snippet-editor--hidden"),i.addClass("snippet-editor--hidden")}),l(document).on("keyup","input.wpglobus-snippet-editor-title",function(e){var t=l(this),a=t.data("language"),s=WPGlobusCore.getString(l('input[name="yoast_wpseo_title"]').val(),t.val(),a);l("#snippet_title_"+a).html(d.replaceVariablesPlugin(t.val())),YoastSEO.app.rawData.pageTitle=s,l('input[name="yoast_wpseo_title"]').val(s),l("#snippet_title").text(s),_.debounce(r.updateProgressBar(t,a),500)}),l(document).on("keyup","input.wpglobus-snippet-editor-slug",function(e){var t=l(this),a=t.data("language");l("#snippet_cite_"+a).text(t.val()+"/"),l("#editable-post-name").text(t.val()),l("#editable-post-name-full").text(t.val())}),l(document).on("change","input.wpglobus-snippet-editor-slug",function(e){var t=l(this);l.post(ajaxurl,{action:"sample-permalink",post_id:l("#post_ID").val()||0,new_slug:t.val(),new_title:l("#title").val(),samplepermalinknonce:l("#samplepermalinknonce").val()})}),l(document).on("keyup","textarea.wpglobus-snippet-editor-meta-description",function(e){var t=l(this),a=t.data("language");l("#snippet_meta_"+a).text(t.val());var s=WPGlobusCore.getString(l("#yoast_wpseo_metadesc").val(),t.val(),t.data("language"));l("#yoast_wpseo_metadesc").val(s),l("#snippet_meta").text(s),_.debounce(r.updateProgressBar(t,a),500)}),l("body").on("click",".wpglobus-post-body-tabs-list li",function(e){var t=l(this);if(t.hasClass("wpglobus-post-tab")){l("#wpglobus-wpseo-tabs").tabs("option","active",t.data("order"));var a=l("#yoast_wpseo_focuskw_text_input_"+l(this).data("language")).val();YoastSEO.app.rawData.keyword=a,l("#yoast_wpseo_focuskw_text_input").val(a),l('input[name="yoast_wpseo_focuskw"]').val(a),s.prototype.analyze()}}),r.initAddKeywordPopup()}},(s=function(){this.replaceVars=wpseoReplaceVarsL10n.replace_vars,this.language=WPGlobusCoreData.default_language,this.tab=WPGlobusCoreData.default_language,this.wpseoTab=WPGlobusCoreData.default_language,this.title_template=wpseoPostScraperL10n.title_template,this.focuskw=l("#yoast_wpseo_focuskw_text_input"),this.focuskw_hidden=l('input[name="yoast_wpseo_focuskw"]'),this.focuskwKeep=!1,this.post_slug="#editable-post-name-full",YoastSEO.app.registerPlugin("wpglobusYoastSeoPlugin",{status:"ready"}),YoastSEO.app.registerModification("content",this.contentModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("title",this.titleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_title",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_meta",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_page_title",this.pageTitleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_meta_desc",this.metaDescModification,"wpglobusYoastSeoPlugin",0),s.prototype.setScoreIcon(),l(document).on("blur",".wpglobus-snippet_title",function(e){var t=l(this),a=WPGlobusCore.getString(l("#yoast_wpseo_title").val(),t.text(),t.data("language"));YoastSEO.app.rawData.pageTitle=a,l('input[name="yoast_wpseo_title"]').val(a),l("#snippet_title").text(a)}),l(document).on("blur",".wpglobus-snippet_meta",function(e){var t=l(this),a=WPGlobusCore.getString(l("#yoast_wpseo_metadesc").val(),t.text(),t.data("language"));l("#yoast_wpseo_metadesc").val(a),l("#snippet_meta").text(a)}),l(document).on("keyup",".wpglobus-yoast_wpseo_focuskw_text_input",function(e){var t=l(this),a=t.val();d.focuskw.val(a),d.focuskw_hidden.val(a),d.updateWpseoKeyword(a,t.data("language")),s.prototype.analyze()}),l("#publish,#save-post").on("mouseenter",function(e){var a,s="";l(".wpglobus-yoast_wpseo_focuskw_text_input").each(function(e,t){a=l(this),s=WPGlobusCore.getString(s,a.val(),a.data("language"))}),d.focuskw.val(s),d.focuskw_hidden.val(s)}).on("mouseleave",function(e){if(!d.focuskwKeep){d.wpseoTab=l(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language");l(this);d.focuskw.val(l("#yoast_wpseo_focuskw_text_input_"+d.wpseoTab).val()),d.focuskw_hidden.val(l("#yoast_wpseo_focuskw_text_input_"+d.wpseoTab).val())}}).on("click",function(e){d.focuskwKeep=!0}),l(WPGlobusYoastSeo.wpseoTabSelector).on("tabsactivate",function(e,t){if(d.language=t.newPanel.attr("data-language"),t.newPanel.attr("data-language")===WPGlobusCoreData.default_language){var a=l("#yoast_wpseo_focuskw_text_input_"+WPGlobusCoreData.default_language).val();YoastSEO.app.rawData.keyword=a,d.focuskw.val(a),d.focuskw_hidden.val(a)}s.prototype.analyze()}),d=this}).prototype.analyze=function(){var e=l(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language");e==WPGlobusCoreData.default_language?YoastSEO.app.snippetPreview.data.urlPath=l("#editable-post-name-full").text():0!=l("#editable-post-name-full-"+e).length?YoastSEO.app.snippetPreview.data.urlPath=l("#editable-post-name-full-"+e).text():YoastSEO.app.snippetPreview.data.urlPath=l("#editable-post-name-full").text(),YoastSEO.app.analyzeTimer(YoastSEO.app),s.prototype.setScoreIcon()},s.prototype.setScoreIcon=function(){var a;a=setInterval(function(){var e=l(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language"),t=l("#wpseo-metabox-tabs .wpseo-score-icon").attr("class");"bad"!=(t=t.replace("wpseo-score-icon ",""))&&"ok"!=t&&"good"!=t||(l("#wpseo-metabox-tabs_"+e+" .wpseo-score-icon").removeClass("bad ok good 100"),l("#wpseo-metabox-tabs_"+e+" .wpseo-score-icon").addClass(t),clearInterval(a))},700)},s.prototype.getWPseoTab=function(){return l(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language")},s.prototype.citeModification=function(e){var t="#snippet_citeBase_"+e,a="#snippet_cite_"+e,s=l("#wpseo-tab-"+e).data("yoast-cite-base");!1===l("#wpseo-tab-"+e).data("cite-contenteditable")&&l(a).attr("contenteditable","false"),l(t).text(s)},s.prototype.pageTitleModification=function(e){var a,s,o,i="#snippet_title_",n="",p="";if(d.title_template==e)l.each(WPGlobusCoreData.enabled_languages,function(e,t){s=l("#snippet-editor-title_"+t).val(),o=0==s.length?d.title_template:s,n=d.replaceVariablesPlugin(o),l(i+t).text(n),t==d.getWPseoTab()&&(p=n)});else{if(a=WPGlobusCore.getTranslations(e),d.getWPseoTab()!==WPGlobusCoreData.default_language&&a[WPGlobusCoreData.default_language]==e){var t=d.getWPseoTab();return s=l("#snippet-editor-title_"+t).val(),o=0<s.length?s:d.title_template,o=d.replaceVariablesPlugin(o),l(i+t).text(o),o}l.each(WPGlobusCoreData.enabled_languages,function(e,t){n=""===a[t]?d.replaceVariablesPlugin(d.title_template):d.replaceVariablesPlugin(a[t]),t==d.getWPseoTab()&&(p=n,0!=(s=l("#snippet-editor-title_"+t).val()).length?s!=p&&(p=d.replaceVariablesPlugin(s)):p=d.replaceVariablesPlugin(d.title_template)),l(i+t).html(p)})}return p},s.prototype.metaDescModification=function(a){var e,s="#snippet_meta_",t=WPGlobusCore.getTranslations(a),o="";if(e=l("#snippet-editor-meta-description_"+d.getWPseoTab()).val(),d.getWPseoTab()!==WPGlobusCoreData.default_language&&t[WPGlobusCoreData.default_language]==a){var i=d.getWPseoTab();return d.citeModification(i),0==e.length?l(s+i).text(""):e!=a&&l(s+i).text(e),a}return l.each(WPGlobusCoreData.enabled_languages,function(e,t){l(s+t).text(WPGlobusCore.TextFilter(a,t,"RETURN_EMPTY")),d.citeModification(t)}),e==t[d.getWPseoTab()]?0==(o=t[d.getWPseoTab()]).length&&l(s+d.getWPseoTab()).text(WPGlobusCore.TextFilter(YoastSEO.app.snippetPreview.data.metaDesc,WPGlobusCoreData.default_language,"RETURN_EMPTY")):0==(o=e).length?l(s+d.getWPseoTab()).text(WPGlobusCore.TextFilter(YoastSEO.app.snippetPreview.data.metaDesc,WPGlobusCoreData.default_language,"RETURN_EMPTY")):l(s+d.getWPseoTab()).text(o),l(s+d.getWPseoTab()).text(o),o},s.prototype.snippetModification=function(e){return WPGlobusCore.TextFilter(e,d.getWPseoTab(),"RETURN_EMPTY")},s.prototype.contentModification=function(e){return d.getWPseoTab()==WPGlobusCoreData.default_language?e:l("#content_"+d.getWPseoTab()).val()},s.prototype.titleModification=function(e){return setTimeout(d.updatePageAnalysis,1e3),d.getWPseoTab()==WPGlobusCoreData.default_language?e:l("#title_"+d.getWPseoTab()).val()},s.prototype.defaultReplace=function(e){var t=YoastSEO.app.rawData.keyword;return e.replace(/%%sitedesc%%/g,this.replaceVars.sitedesc).replace(/%%sitename%%/g,WPGlobusCore.TextFilter(this.replaceVars.sitename,d.getWPseoTab())).replace(/%%term_title%%/g,this.replaceVars.term_title).replace(/%%term_description%%/g,this.replaceVars.term_description).replace(/%%category_description%%/g,this.replaceVars.category_description).replace(/%%tag_description%%/g,this.replaceVars.tag_description).replace(/%%searchphrase%%/g,this.replaceVars.searchphrase).replace(/%%date%%/g,this.replaceVars.date).replace(/%%id%%/g,this.replaceVars.id).replace(/%%page%%/g,this.replaceVars.page).replace(/%%currenttime%%/g,this.replaceVars.currenttime).replace(/%%currentdate%%/g,this.replaceVars.currentdate).replace(/%%currentday%%/g,this.replaceVars.currentday).replace(/%%currentmonth%%/g,this.replaceVars.currentmonth).replace(/%%currentyear%%/g,this.replaceVars.currentyear).replace(/%%focuskw%%/g,t)},s.prototype.replaceVariablesPlugin=function(e){return void 0!==e&&(e=this.titleReplace(e),e=this.defaultReplace(e),e=this.replaceSeparators(e)),e},s.prototype.replaceSeparators=function(e){return e.replace(/%%sep%%(\s+%%sep%%)*/g,this.replaceVars.sep)},s.prototype.titleReplace=function(e){var t="";return void 0===(t=this.language==WPGlobusCoreData.default_language?l("#title").val():l("#title_"+this.language).val())&&(t=YoastSEO.app.rawData.pageTitle),this.language!=WPGlobusCoreData.default_language&&0==t.length&&(t=l("#title").val()),e=e.replace(/%%title%%/g,t)},s.prototype.doubleSepReplace=function(e){var t=YoastSEO.app.stringHelper.addEscapeChars(this.replaceVars.sep),a=new RegExp(t+" "+t,"g");return e=e.replace(a,this.replaceVars.sep)},s.prototype.updateWpseoKeyword=function(e,t){1==l("#wpseo-meta-section-content_"+t+" .wpseo_keyword").length&&l("#wpseo-meta-section-content_"+t+" .wpseo_keyword").removeClass("wpseo_keyword").addClass("wpglobus-wpseo_keyword_"+t),l(".wpglobus-wpseo_keyword_"+t).text(e)},s.prototype.updatePageAnalysis=function(){l("#wpseo-pageanalysis_"+d.getWPseoTab()).html(l("#wpseo-pageanalysis").html())},window.WPGlobusYoastSeoPlugin=new s}});
1
+ var WPGlobusYoastSeo;jQuery(document).ready(function(l){"use strict";var r;if("undefined"!=typeof wpseoReplaceVarsL10n&&("undefined"!=typeof WPGlobusCoreData&&"undefined"!=typeof WPGlobusVendor))if("edit-tags.php"==WPGlobusVendor.pagenow||"term.php"==WPGlobusVendor.pagenow){r=WPGlobusYoastSeo={editorIDs:["description"],editor:{},submitId:"#submit",preventChangeEditor:!1,observer:null,init:function(){r.attachListeners(),_.delay(r.start,1500)},submit:function(e){"mouseenter"===e.type?l.each(r.editor,function(e,t){!r.editor[e].contentEditor||r.editor[e].contentEditor.isHidden()?l("#"+e).val(r.editor[e].content):tinymce.get(e).setContent(r.editor[e].content)}):"mouseleave"===e.type?r.preventChangeEditor||(l.each(r.editor,function(e,t){!r.editor[e].contentEditor||r.editor[e].contentEditor.isHidden()?l("#"+e).val(WPGlobusCore.TextFilter(t.content,r.getCurrentTab(),"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,r.getCurrentTab(),"RETURN_EMPTY"))}),r.preventChangeEditor=!1):"click"===e.type&&(r.preventChangeEditor=!0,"tinymce"!=getUserSetting("editor")&&setUserSetting("editor","tinymce"))},attachListeners:function(){l(".wrap").on("tabsactivate",function(e,a){l.each(r.editor,function(e,t){!r.editor[e].contentEditor||r.editor[e].contentEditor.isHidden()?l("#"+e).val(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY"))})}),l(document).on("mouseenter",r.submitId,r.submit).on("mouseleave",r.submitId,r.submit).on("click",r.submitId,r.submit),l(document).on("tinymce-editor-init",function(e,t){if(-1!=_.indexOf(r.editorIDs,t.id)){var a=l("#"+t.id);r.editor[t.id]={},r.editor[t.id].contentEditor=t,r.editor[t.id].content=a.val(),t.setContent(WPGlobusCore.TextFilter(r.editor[t.id].content,WPGlobusCoreData.default_language,"RETURN_EMPTY")),l("#"+t.getContainer().id).find("iframe").addClass("wpglobus-translatable"),a.removeClass("hidden"),t.on("nodechange keyup",_.debounce(r.update,500)),a.on("input keyup",_.debounce(r.update,500))}})},update:function(e){var t,a;void 0!==e.target&&("tinymce"==(t=e.target.id)&&(t=e.target.dataset.id),void 0!==r.editor[t].contentEditor&&(a=!r.editor[t].contentEditor||r.editor[t].contentEditor.isHidden()?l("#"+t).val():r.editor[t].contentEditor.getContent({format:"raw"}),r.editor[t].content=WPGlobusCore.getString(r.editor[t].content,a,r.getCurrentTab())))},getCurrentTab:function(){return l(".wpglobus-taxonomy-tabs-list .ui-tabs-active").data("language")},start:function(){l(".wpglobus-element_description").css({display:"none"})}},WPGlobusYoastSeo.init();var s=function(){l(".wrap").on("tabsactivate",function(e,t){t.newTab[0].dataset.language==WPGlobusCoreData.default_language?l("#poststuff .inside").css({display:"block"}):l("#poststuff .inside").css({display:"none"})}),l.each(["category_description","sitedesc","sitename","tag_description","term_description","term_title"],function(e,t){wpseoReplaceVarsL10n.replace_vars[t]=WPGlobusCore.TextFilter(wpseoReplaceVarsL10n.replace_vars[t],WPGlobusCoreData.default_language)}),WPGlobusYoastSeo.observer=new MutationObserver(function(e){e.forEach(function(e){if("placeholder"==e.attributeName){WPGlobusYoastSeo.observer.disconnect();var t=l("#wpseo_focuskw");""==t.val()&&t.attr("placeholder",WPGlobusCore.TextFilter(t.attr("placeholder"),WPGlobusCoreData.default_language)),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0})}})}),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0})};window.WPGlobusYoastSeoPlugin=new s}else{var d;r=WPGlobusYoastSeo={wpseoTabSelector:"#wpglobus-wpseo-tabs",url:"",attrs:l("#wpglobus-wpseo-attr"),iB:l("#wpseo-meta-section-content"),t:l("#wpseo-meta-section-content"),ids:"",names:"",editSnippetButtonClass:"wpglobus-snippet-editor__edit-button",editSnippetFormClass:"wpglobus-snippet-editor__form",editSnippetSubmitClass:"wpglobus-snippet-editor__submit",editSnippetHeadingClass:"wpglobus-snippet-editor__heading-editor",yoastTitleProgress:"wpglobus-yoast-title-progress",yoastMetadescProgress:"wpglobus-yoast-metadesc-progress",init:function(){r.start()},initAddKeywordPopup:function(){1===l("#wpseo-add-keyword-popup").length&&l(".wpseo-add-keyword").on("click",r.addKeywordPopup)},addKeywordPopup:function(){var e=l("#wpseo-add-keyword-popup-button").text();tb_show(e,"#TB_inline?width=650&height=350&inlineId=wpseo-add-keyword-popup","group"),jQuery("#TB_window").css("height",235),jQuery("#TB_window").css("width",680)},qtip:function(){l(".yoast_help").qtip({content:{attr:"alt"},position:{my:"bottom left",at:"top center"},style:{tip:{corner:!0},classes:"yoast-qtip qtip-rounded qtip-blue"},show:"click",hide:{fixed:!0,delay:500}})},removeClasses:function(t,e){_.each(e,function(e){t.removeClass(e)})},updateProgressBar:function(e,t){if(void 0!==e&&(void 0!==t||("undefined"!==e.data("language")&&(t=e.data("language")),void 0!==t))){var a,s,o=["snippet-editor__progress--bad","snippet-editor__progress--ok","snippet-editor__progress--good"],i="",n=0,p=!1;s=e.val().length,e.hasClass("wpglobus-snippet-editor-title")?(n=(a=l("progress."+r.yoastTitleProgress+"_"+t)).attr("max"),i=o[2],0==s?i=o[1]:n<s?(i=o[1],p=!0):0<s&&s<35&&(i=o[1])):e.hasClass("wpglobus-snippet-editor-meta-description")&&(n=(a=l("progress."+r.yoastMetadescProgress+"_"+t)).attr("max"),i=o[2],0==s?i=o[1]:n<s?(i=o[1],p=!0):0<s&&s<121&&(i=o[1])),r.removeClasses(a,o),a.attr("value",s).addClass(i),p?e.css("color","#f00"):e.css("color","#000")}},updateWpseoKeyword:function(e,t){l("#wpseo-meta-section-content_"+t+" .wpseo_keyword").text(e)},start:function(){l(r.wpseoTabSelector).tabs(),r.ids=r.attrs.data("ids"),r.names=r.attrs.data("names"),r.ids=r.ids+","+r.attrs.data("qtip"),r.ids=r.ids.split(","),r.names=r.names.split(","),l("#wpglobus-wpseo-tabs").insertBefore(r.iB),l(".wpseo-metabox-tabs").css({height:"26px"}),l(".wpglobus-wpseo-general").each(function(e,t){var a=l(t),s=a.data("language"),o="wpseo-meta-section-content_"+s;a.html('<div id="'+o+'" class="wpseo-meta-section wpglobus-wpseo-meta-section" style="width:100%" data-language="'+s+'">'+r.t.html()+"</div>"),l("#"+o+" .wpseo-metabox-tabs").attr("id","wpseo-metabox-tabs_"+s),l("#"+o+" .wpseotab").attr("id","wpseo_content_"+s),l("#wpseo_content_"+s).css({float:"left"}),l("#"+o).css({display:"block"}),l("#wpseo_meta").css({overflow:"hidden"}),l("#"+o+" .snippet_container").addClass("wpglobus-snippet_container"),s!==WPGlobusCoreData.default_language&&l("#"+o+" .wpseo-add-keyword").addClass("hidden"),l.each(r.names,function(e,t){l("#"+t).attr("name",t+"_"+s)}),l.each(r.ids,function(e,t){var a=l("#"+t);"wpseosnippet"==t&&a.addClass("wpglobus-wpseosnippet"),"snippet_title"==t&&a.addClass("wpglobus-snippet_title"),"snippet_meta"==t&&a.addClass("wpglobus-snippet_meta"),"snippet_cite"==t&&a.addClass("wpglobus-snippet_cite"),"snippet_citeBase"==t&&a.addClass("wpglobus-snippet_citeBase"),"yoast_wpseo_focuskw_text_input"==t&&a.addClass("wpglobus-yoast_wpseo_focuskw_text_input"),"wpseo-pageanalysis"==t&&a.addClass("wpglobus-wpseo-pageanalysis"),"snippet_preview"==t&&a.addClass("wpglobus-snippet_preview"),"snippet-editor-title"==t&&(a.addClass("wpglobus-snippet-editor-title"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),a.val(l("#wpseo-tab-"+s).data("wpseotitle")),a.parent("label").find("progress").addClass(r.yoastTitleProgress).addClass(r.yoastTitleProgress+"_"+s),_.debounce(r.updateProgressBar(a,s),500)),"snippet-editor-slug"==t&&(a.addClass("wpglobus-snippet-editor-slug"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),WPGlobusCoreData.default_language!=s&&a.attr("disabled","disabled")),"snippet-editor-meta-description"==t&&(a.addClass("wpglobus-snippet-editor-meta-description"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),a.val(l("#wpseo-tab-"+s).data("metadesc")),a.parent("label").find("progress").addClass(r.yoastMetadescProgress).addClass(r.yoastMetadescProgress+"_"+s),_.debounce(r.updateProgressBar(a,s),500)),"snippetpreview-help-toggle"==t&&(a.addClass("wpglobus-snippetpreview-help-toggle_"+s),l(document).on("click",".wpglobus-snippetpreview-help-toggle_"+s,function(e){var t=l(this);"none"===l("#snippetpreview-help_"+t.data("language")).css("display")?l("#snippetpreview-help_"+t.data("language")).css({display:"block"}):l("#snippetpreview-help_"+t.data("language")).css({display:"none"})})),"focuskw_text_input-help-toggle"==t&&(a.addClass("wpglobus-focuskw_text_input-help-toggle_"+s),l(document).on("click",".wpglobus-focuskw_text_input-help-toggle_"+s,function(e){var t=l(this);"none"===l("#focuskw_text_input-help_"+t.data("language")).css("display")?l("#focuskw_text_input-help_"+t.data("language")).css({display:"block"}):l("#focuskw_text_input-help_"+t.data("language")).css({display:"none"})})),"pageanalysis-help-toggle"==t&&(a.addClass("wpglobus-pageanalysis-help-toggle_"+s),l(document).on("click",".wpglobus-pageanalysis-help-toggle_"+s,function(e){var t=l(this);"none"===l("#pageanalysis-help_"+t.data("language")).css("display")?l("#pageanalysis-help_"+t.data("language")).css({display:"block"}):l("#pageanalysis-help_"+t.data("language")).css({display:"none"})})),a.attr("id",t+"_"+s),l("#"+t+"_"+s).attr("data-language",s)});var i=WPGlobusCore.TextFilter(l("#yoast_wpseo_focuskw_text_input").val(),s,"RETURN_EMPTY");l("#yoast_wpseo_focuskw_text_input_"+s).val(i),l("#yoast_wpseo_focuskw_"+s).val(i),r.updateWpseoKeyword(i,s),s!==WPGlobusCoreData.default_language&&(l("#"+o+" #yoast_wpseo_focuskw_text_input_"+s).addClass("hidden").after('<div class="wpglobus-suggest" style="font-weight:bold;">'+WPGlobusVendor.i18n.yoastseo_plus_access+"</div>"),l("#"+o+" #wpseo-pageanalysis_"+s).addClass("hidden"))}),l(".wpglobus-wpseosnippet").each(function(e,t){var a=l(t),s=a.data("language");a.find("button.snippet-editor__button.snippet-editor__edit-button").addClass(r.editSnippetButtonClass).addClass(r.editSnippetButtonClass+"_"+s).attr("data-language",s),a.find(".snippet-editor__form").addClass(r.editSnippetFormClass).addClass(r.editSnippetFormClass+"_"+s),a.find(".snippet-editor__heading-editor").addClass(r.editSnippetHeadingClass).addClass(r.editSnippetHeadingClass+"_"+s),a.find(".snippet-editor__submit").addClass(r.editSnippetSubmitClass).addClass(r.editSnippetSubmitClass+"_"+s).attr("data-language",s)}),r.iB.addClass("hidden"),r.iB.css({height:0,overflow:"hidden"});var e=WPGlobusCore.TextFilter(l("#yoast_wpseo_focuskw_text_input").val(),WPGlobusCoreData.default_language,"RETURN_EMPTY");l("#yoast_wpseo_focuskw_text_input").val(e),l("#yoast_wpseo_focuskw").val(e),l(".wpseo-metabox-sidebar .wpseo-meta-section-link").on("click",function(e){"#wpseo-meta-section-content"==l(this).attr("href")?l("#wpglobus-wpseo-tabs").css({display:"block"}):l("#wpglobus-wpseo-tabs").css({display:"none"})}),l("body").on("click","."+r.editSnippetButtonClass,function(e){var t=l(this),a=t.data("language"),s=l("."+r.editSnippetFormClass+"_"+a),o=l("."+r.editSnippetSubmitClass+"_"+a),i=l("."+r.editSnippetHeadingClass+"_"+a);s.hasClass("snippet-editor--hidden")?(s.removeClass("snippet-editor--hidden"),i.removeClass("snippet-editor--hidden"),o.removeClass("snippet-editor--hidden")):(s.addClass("snippet-editor--hidden"),i.addClass("snippet-editor--hidden")),t.addClass("snippet-editor--hidden")}),l("body").on("click","."+r.editSnippetSubmitClass,function(e){var t=l(this).data("language"),a=l("."+r.editSnippetButtonClass+"_"+t),s=l("."+r.editSnippetFormClass+"_"+t),o=l("."+r.editSnippetSubmitClass+"_"+t),i=l("."+r.editSnippetHeadingClass+"_"+t);a.removeClass("snippet-editor--hidden"),s.addClass("snippet-editor--hidden"),o.addClass("snippet-editor--hidden"),i.addClass("snippet-editor--hidden")}),l(document).on("keyup","input.wpglobus-snippet-editor-title",function(e){var t=l(this),a=t.data("language"),s=WPGlobusCore.getString(l('input[name="yoast_wpseo_title"]').val(),t.val(),a);l("#snippet_title_"+a).html(d.replaceVariablesPlugin(t.val())),YoastSEO.app.rawData.pageTitle=s,l('input[name="yoast_wpseo_title"]').val(s),l("#snippet_title").text(s),_.debounce(r.updateProgressBar(t,a),500)}),l(document).on("keyup","input.wpglobus-snippet-editor-slug",function(e){var t=l(this),a=t.data("language");l("#snippet_cite_"+a).text(t.val()+"/"),l("#editable-post-name").text(t.val()),l("#editable-post-name-full").text(t.val())}),l(document).on("change","input.wpglobus-snippet-editor-slug",function(e){var t=l(this);l.post(ajaxurl,{action:"sample-permalink",post_id:l("#post_ID").val()||0,new_slug:t.val(),new_title:l("#title").val(),samplepermalinknonce:l("#samplepermalinknonce").val()})}),l(document).on("keyup","textarea.wpglobus-snippet-editor-meta-description",function(e){var t=l(this),a=t.data("language");l("#snippet_meta_"+a).text(t.val());var s=WPGlobusCore.getString(l("#yoast_wpseo_metadesc").val(),t.val(),t.data("language"));l("#yoast_wpseo_metadesc").val(s),l("#snippet_meta").text(s),_.debounce(r.updateProgressBar(t,a),500)}),l("body").on("click",".wpglobus-post-body-tabs-list li",function(e){var t=l(this);if(t.hasClass("wpglobus-post-tab")){l("#wpglobus-wpseo-tabs").tabs("option","active",t.data("order"));var a=l("#yoast_wpseo_focuskw_text_input_"+l(this).data("language")).val();YoastSEO.app.rawData.keyword=a,l("#yoast_wpseo_focuskw_text_input").val(a),l('input[name="yoast_wpseo_focuskw"]').val(a),s.prototype.analyze()}}),r.initAddKeywordPopup()}},(s=function(){this.replaceVars=wpseoReplaceVarsL10n.replace_vars,this.language=WPGlobusCoreData.default_language,this.tab=WPGlobusCoreData.default_language,this.wpseoTab=WPGlobusCoreData.default_language,this.title_template=wpseoPostScraperL10n.title_template,this.focuskw=l("#yoast_wpseo_focuskw_text_input"),this.focuskw_hidden=l('input[name="yoast_wpseo_focuskw"]'),this.focuskwKeep=!1,this.post_slug="#editable-post-name-full",YoastSEO.app.registerPlugin("wpglobusYoastSeoPlugin",{status:"ready"}),YoastSEO.app.registerModification("content",this.contentModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("title",this.titleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_title",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_meta",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_page_title",this.pageTitleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_meta_desc",this.metaDescModification,"wpglobusYoastSeoPlugin",0),s.prototype.setScoreIcon(),l(document).on("blur",".wpglobus-snippet_title",function(e){var t=l(this),a=WPGlobusCore.getString(l("#yoast_wpseo_title").val(),t.text(),t.data("language"));YoastSEO.app.rawData.pageTitle=a,l('input[name="yoast_wpseo_title"]').val(a),l("#snippet_title").text(a)}),l(document).on("blur",".wpglobus-snippet_meta",function(e){var t=l(this),a=WPGlobusCore.getString(l("#yoast_wpseo_metadesc").val(),t.text(),t.data("language"));l("#yoast_wpseo_metadesc").val(a),l("#snippet_meta").text(a)}),l(document).on("keyup",".wpglobus-yoast_wpseo_focuskw_text_input",function(e){var t=l(this),a=t.val();d.focuskw.val(a),d.focuskw_hidden.val(a),d.updateWpseoKeyword(a,t.data("language")),s.prototype.analyze()}),l("#publish,#save-post").on("mouseenter",function(e){var a,s="";l(".wpglobus-yoast_wpseo_focuskw_text_input").each(function(e,t){a=l(this),s=WPGlobusCore.getString(s,a.val(),a.data("language"))}),d.focuskw.val(s),d.focuskw_hidden.val(s)}).on("mouseleave",function(e){if(!d.focuskwKeep){d.wpseoTab=l(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language");l(this);d.focuskw.val(l("#yoast_wpseo_focuskw_text_input_"+d.wpseoTab).val()),d.focuskw_hidden.val(l("#yoast_wpseo_focuskw_text_input_"+d.wpseoTab).val())}}).on("click",function(e){d.focuskwKeep=!0}),l(WPGlobusYoastSeo.wpseoTabSelector).on("tabsactivate",function(e,t){if(d.language=t.newPanel.attr("data-language"),t.newPanel.attr("data-language")===WPGlobusCoreData.default_language){var a=l("#yoast_wpseo_focuskw_text_input_"+WPGlobusCoreData.default_language).val();YoastSEO.app.rawData.keyword=a,d.focuskw.val(a),d.focuskw_hidden.val(a)}s.prototype.analyze()}),d=this}).prototype.analyze=function(){var e=l(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language");e==WPGlobusCoreData.default_language?YoastSEO.app.snippetPreview.data.urlPath=l("#editable-post-name-full").text():0!=l("#editable-post-name-full-"+e).length?YoastSEO.app.snippetPreview.data.urlPath=l("#editable-post-name-full-"+e).text():YoastSEO.app.snippetPreview.data.urlPath=l("#editable-post-name-full").text(),YoastSEO.app.analyzeTimer(YoastSEO.app),s.prototype.setScoreIcon()},s.prototype.setScoreIcon=function(){var a;a=setInterval(function(){var e=l(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language"),t=l("#wpseo-metabox-tabs .wpseo-score-icon").attr("class");"bad"!=(t=t.replace("wpseo-score-icon ",""))&&"ok"!=t&&"good"!=t||(l("#wpseo-metabox-tabs_"+e+" .wpseo-score-icon").removeClass("bad ok good 100"),l("#wpseo-metabox-tabs_"+e+" .wpseo-score-icon").addClass(t),clearInterval(a))},700)},s.prototype.getWPseoTab=function(){return l(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language")},s.prototype.citeModification=function(e){var t="#snippet_citeBase_"+e,a="#snippet_cite_"+e,s=l("#wpseo-tab-"+e).data("yoast-cite-base");!1===l("#wpseo-tab-"+e).data("cite-contenteditable")&&l(a).attr("contenteditable","false"),l(t).text(s)},s.prototype.pageTitleModification=function(e){var a,s,o,i="#snippet_title_",n="",p="";if(d.title_template==e)l.each(WPGlobusCoreData.enabled_languages,function(e,t){s=l("#snippet-editor-title_"+t).val(),o=0==s.length?d.title_template:s,n=d.replaceVariablesPlugin(o),l(i+t).text(n),t==d.getWPseoTab()&&(p=n)});else{if(a=WPGlobusCore.getTranslations(e),d.getWPseoTab()!==WPGlobusCoreData.default_language&&a[WPGlobusCoreData.default_language]==e){var t=d.getWPseoTab();return s=l("#snippet-editor-title_"+t).val(),o=0<s.length?s:d.title_template,o=d.replaceVariablesPlugin(o),l(i+t).text(o),o}l.each(WPGlobusCoreData.enabled_languages,function(e,t){n=""===a[t]?d.replaceVariablesPlugin(d.title_template):d.replaceVariablesPlugin(a[t]),t==d.getWPseoTab()&&(p=n,0!=(s=l("#snippet-editor-title_"+t).val()).length?s!=p&&(p=d.replaceVariablesPlugin(s)):p=d.replaceVariablesPlugin(d.title_template)),l(i+t).html(p)})}return p},s.prototype.metaDescModification=function(a){var e,s="#snippet_meta_",t=WPGlobusCore.getTranslations(a),o="";if(e=l("#snippet-editor-meta-description_"+d.getWPseoTab()).val(),d.getWPseoTab()===WPGlobusCoreData.default_language||t[WPGlobusCoreData.default_language]!=a)return l.each(WPGlobusCoreData.enabled_languages,function(e,t){l(s+t).text(WPGlobusCore.TextFilter(a,t,"RETURN_EMPTY")),d.citeModification(t)}),e==t[d.getWPseoTab()]?0==(o=t[d.getWPseoTab()]).length&&l(s+d.getWPseoTab()).text(WPGlobusCore.TextFilter(YoastSEO.app.snippetPreview.data.metaDesc,WPGlobusCoreData.default_language,"RETURN_EMPTY")):0==(o=e).length?l(s+d.getWPseoTab()).text(WPGlobusCore.TextFilter(YoastSEO.app.snippetPreview.data.metaDesc,WPGlobusCoreData.default_language,"RETURN_EMPTY")):l(s+d.getWPseoTab()).text(o),l(s+d.getWPseoTab()).text(o),o;var i=d.getWPseoTab();return d.citeModification(i),0==e.length?l(s+i).text(""):e!=a&&l(s+i).text(e),a},s.prototype.snippetModification=function(e){return WPGlobusCore.TextFilter(e,d.getWPseoTab(),"RETURN_EMPTY")},s.prototype.contentModification=function(e){return d.getWPseoTab()==WPGlobusCoreData.default_language?e:l("#content_"+d.getWPseoTab()).val()},s.prototype.titleModification=function(e){return setTimeout(d.updatePageAnalysis,1e3),d.getWPseoTab()==WPGlobusCoreData.default_language?e:l("#title_"+d.getWPseoTab()).val()},s.prototype.defaultReplace=function(e){var t=YoastSEO.app.rawData.keyword;return e.replace(/%%sitedesc%%/g,this.replaceVars.sitedesc).replace(/%%sitename%%/g,WPGlobusCore.TextFilter(this.replaceVars.sitename,d.getWPseoTab())).replace(/%%term_title%%/g,this.replaceVars.term_title).replace(/%%term_description%%/g,this.replaceVars.term_description).replace(/%%category_description%%/g,this.replaceVars.category_description).replace(/%%tag_description%%/g,this.replaceVars.tag_description).replace(/%%searchphrase%%/g,this.replaceVars.searchphrase).replace(/%%date%%/g,this.replaceVars.date).replace(/%%id%%/g,this.replaceVars.id).replace(/%%page%%/g,this.replaceVars.page).replace(/%%currenttime%%/g,this.replaceVars.currenttime).replace(/%%currentdate%%/g,this.replaceVars.currentdate).replace(/%%currentday%%/g,this.replaceVars.currentday).replace(/%%currentmonth%%/g,this.replaceVars.currentmonth).replace(/%%currentyear%%/g,this.replaceVars.currentyear).replace(/%%focuskw%%/g,t)},s.prototype.replaceVariablesPlugin=function(e){return void 0!==e&&(e=this.titleReplace(e),e=this.defaultReplace(e),e=this.replaceSeparators(e)),e},s.prototype.replaceSeparators=function(e){return e.replace(/%%sep%%(\s+%%sep%%)*/g,this.replaceVars.sep)},s.prototype.titleReplace=function(e){var t="";return void 0===(t=this.language==WPGlobusCoreData.default_language?l("#title").val():l("#title_"+this.language).val())&&(t=YoastSEO.app.rawData.pageTitle),this.language!=WPGlobusCoreData.default_language&&0==t.length&&(t=l("#title").val()),e=e.replace(/%%title%%/g,t)},s.prototype.doubleSepReplace=function(e){var t=YoastSEO.app.stringHelper.addEscapeChars(this.replaceVars.sep),a=new RegExp(t+" "+t,"g");return e=e.replace(a,this.replaceVars.sep)},s.prototype.updateWpseoKeyword=function(e,t){1==l("#wpseo-meta-section-content_"+t+" .wpseo_keyword").length&&l("#wpseo-meta-section-content_"+t+" .wpseo_keyword").removeClass("wpseo_keyword").addClass("wpglobus-wpseo_keyword_"+t),l(".wpglobus-wpseo_keyword_"+t).text(e)},s.prototype.updatePageAnalysis=function(){l("#wpseo-pageanalysis_"+d.getWPseoTab()).html(l("#wpseo-pageanalysis").html())},window.WPGlobusYoastSeoPlugin=new s}});
includes/js/wpglobus-yoastseo-33.min.js CHANGED
@@ -1 +1 @@
1
- var WPGlobusYoastSeo;jQuery(document).ready(function(p){"use strict";var r;if("undefined"!=typeof wpseoReplaceVarsL10n&&("undefined"!=typeof WPGlobusCoreData&&"undefined"!=typeof WPGlobusVendor))if("edit-tags.php"==WPGlobusVendor.pagenow||"term.php"==WPGlobusVendor.pagenow){r=WPGlobusYoastSeo={editorIDs:["description"],editor:{},submitId:"#submit",preventChangeEditor:!1,observer:null,init:function(){r.attachListeners(),_.delay(r.start,1500)},submit:function(e){"mouseenter"===e.type?p.each(r.editor,function(e,t){!r.editor[e].contentEditor||r.editor[e].contentEditor.isHidden()?p("#"+e).val(r.editor[e].content):tinymce.get(e).setContent(r.editor[e].content)}):"mouseleave"===e.type?r.preventChangeEditor||(p.each(r.editor,function(e,t){!r.editor[e].contentEditor||r.editor[e].contentEditor.isHidden()?p("#"+e).val(WPGlobusCore.TextFilter(t.content,r.getCurrentTab(),"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,r.getCurrentTab(),"RETURN_EMPTY"))}),r.preventChangeEditor=!1):"click"===e.type&&(r.preventChangeEditor=!0,"tinymce"!=getUserSetting("editor")&&setUserSetting("editor","tinymce"))},attachListeners:function(){p(".wrap").on("tabsactivate",function(e,a){p.each(r.editor,function(e,t){!r.editor[e].contentEditor||r.editor[e].contentEditor.isHidden()?p("#"+e).val(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY"))})}),p(document).on("mouseenter",r.submitId,r.submit).on("mouseleave",r.submitId,r.submit).on("click",r.submitId,r.submit),p(document).on("tinymce-editor-init",function(e,t){if(-1!=_.indexOf(r.editorIDs,t.id)){var a=p("#"+t.id);r.editor[t.id]={},r.editor[t.id].contentEditor=t,r.editor[t.id].content=a.val(),t.setContent(WPGlobusCore.TextFilter(r.editor[t.id].content,WPGlobusCoreData.default_language,"RETURN_EMPTY")),p("#"+t.getContainer().id).find("iframe").addClass("wpglobus-translatable"),a.removeClass("hidden"),t.on("nodechange keyup",_.debounce(r.update,500)),a.on("input keyup",_.debounce(r.update,500))}})},update:function(e){var t,a;void 0!==e.target&&("tinymce"==(t=e.target.id)&&(t=e.target.dataset.id),void 0!==r.editor[t].contentEditor&&(a=!r.editor[t].contentEditor||r.editor[t].contentEditor.isHidden()?p("#"+t).val():r.editor[t].contentEditor.getContent({format:"raw"}),r.editor[t].content=WPGlobusCore.getString(r.editor[t].content,a,r.getCurrentTab())))},getCurrentTab:function(){return p(".wpglobus-taxonomy-tabs-list .ui-tabs-active").data("language")},start:function(){p(".wpglobus-element_description").css({display:"none"})}},WPGlobusYoastSeo.init();var s=function(){p(".wrap").on("tabsactivate",function(e,t){t.newTab[0].dataset.language==WPGlobusCoreData.default_language?p("#poststuff .inside").css({display:"block"}):p("#poststuff .inside").css({display:"none"})}),p.each(["category_description","sitedesc","sitename","tag_description","term_description","term_title"],function(e,t){wpseoReplaceVarsL10n.replace_vars[t]=WPGlobusCore.TextFilter(wpseoReplaceVarsL10n.replace_vars[t],WPGlobusCoreData.default_language)}),WPGlobusYoastSeo.observer=new MutationObserver(function(e){e.forEach(function(e){if("placeholder"==e.attributeName){WPGlobusYoastSeo.observer.disconnect();var t=p("#wpseo_focuskw");""==t.val()&&t.attr("placeholder",WPGlobusCore.TextFilter(t.attr("placeholder"),WPGlobusCoreData.default_language)),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0})}})}),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0})};window.WPGlobusYoastSeoPlugin=new s}else{var d;r=WPGlobusYoastSeo={wpseoTabSelector:"#wpglobus-wpseo-tabs",url:"",attrs:p("#wpglobus-wpseo-attr"),iB:p("#wpseo-meta-section-content"),t:p("#wpseo-meta-section-content"),ids:"",names:"",editSnippetButtonClass:"wpglobus-snippet-editor__edit-button",editSnippetFormClass:"wpglobus-snippet-editor__form",editSnippetSubmitClass:"wpglobus-snippet-editor__submit",editSnippetHeadingClass:"wpglobus-snippet-editor__heading-editor",yoastTitleProgress:"wpglobus-yoast-title-progress",yoastMetadescProgress:"wpglobus-yoast-metadesc-progress",init:function(){r.start()},initAddKeywordPopup:function(){1===p("#wpseo-add-keyword-popup").length&&p(".wpseo-add-keyword").on("click",r.addKeywordPopup)},addKeywordPopup:function(){var e=p("#wpseo-add-keyword-popup-button").text();tb_show(e,"#TB_inline?width=650&height=350&inlineId=wpseo-add-keyword-popup","group"),jQuery("#TB_window").css("height",235),jQuery("#TB_window").css("width",680)},qtip:function(){p(".yoast_help").qtip({content:{attr:"alt"},position:{my:"bottom left",at:"top center"},style:{tip:{corner:!0},classes:"yoast-qtip qtip-rounded qtip-blue"},show:"click",hide:{fixed:!0,delay:500}})},removeClasses:function(t,e){_.each(e,function(e){t.removeClass(e)})},updateProgressBar:function(e,t){if(void 0!==e&&(void 0!==t||("undefined"!==e.data("language")&&(t=e.data("language")),void 0!==t))){var a,s,o=["snippet-editor__progress--bad","snippet-editor__progress--ok","snippet-editor__progress--good"],i="",n=0,l=!1;s=e.val().length,e.hasClass("wpglobus-snippet-editor-title")?(n=(a=p("progress."+r.yoastTitleProgress+"_"+t)).attr("max"),i=o[2],0==s?i=o[1]:n<s?(i=o[1],l=!0):0<s&&s<35&&(i=o[1])):e.hasClass("wpglobus-snippet-editor-meta-description")&&(n=(a=p("progress."+r.yoastMetadescProgress+"_"+t)).attr("max"),i=o[2],0==s?i=o[1]:n<s?(i=o[1],l=!0):0<s&&s<121&&(i=o[1])),r.removeClasses(a,o),a.attr("value",s).addClass(i),l?e.css("color","#f00"):e.css("color","#000")}},updateWpseoKeyword:function(e,t){p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").eq(1).text(e)},start:function(){p(r.wpseoTabSelector).tabs(),r.ids=r.attrs.data("ids"),r.names=r.attrs.data("names"),r.ids=r.ids+","+r.attrs.data("qtip"),r.ids=r.ids.split(","),r.names=r.names.split(","),p("#wpglobus-wpseo-tabs").insertBefore(r.iB),p(".wpseo-metabox-tabs").css({height:"26px"}),p(".wpglobus-wpseo-general").each(function(e,t){var a=p(t),s=a.data("language"),o="wpseo-meta-section-content_"+s;a.html('<div id="'+o+'" class="wpseo-meta-section wpglobus-wpseo-meta-section" style="width:100%" data-language="'+s+'">'+r.t.html()+"</div>"),p("#"+o+" .wpseo-metabox-tabs").attr("id","wpseo-metabox-tabs_"+s).attr("data-language",s),p("#"+o+" .wpseotab").attr("id","wpseo_content_"+s),p("#wpseo_content_"+s).css({float:"left"}),p("#"+o).css({display:"block"}),p("#wpseo_meta").css({overflow:"hidden"}),p("#"+o+" .snippet_container").addClass("wpglobus-snippet_container"),s!==WPGlobusCoreData.default_language&&p("#"+o+" .wpseo-add-keyword").addClass("hidden"),p.each(r.names,function(e,t){p("#"+t).attr("name",t+"_"+s)}),p.each(r.ids,function(e,t){var a=p("#"+t);"wpseosnippet"==t&&a.addClass("wpglobus-wpseosnippet"),"snippet_title"==t&&a.addClass("wpglobus-snippet_title"),"snippet_meta"==t&&a.addClass("wpglobus-snippet_meta"),"snippet_cite"==t&&a.addClass("wpglobus-snippet_cite"),"snippet_citeBase"==t&&a.addClass("wpglobus-snippet_citeBase"),"url_container"==t&&a.css({height:"16px"}),"yoast_wpseo_focuskw_text_input"==t&&a.addClass("wpglobus-yoast_wpseo_focuskw_text_input"),"wpseo-pageanalysis"==t&&a.addClass("wpglobus-wpseo-pageanalysis"),"yoast-seo-content-analysis"==t&&a.addClass("wpglobus-yoast-seo-content-analysis"),"snippet_preview"==t&&a.addClass("wpglobus-snippet_preview"),"snippet-editor-title"==t&&(a.addClass("wpglobus-snippet-editor-title"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),a.val(p("#wpseo-tab-"+s).data("wpseotitle")),a.parent("label").next("progress").addClass(r.yoastTitleProgress).addClass(r.yoastTitleProgress+"_"+s),_.debounce(r.updateProgressBar(a,s),500)),"snippet-editor-slug"==t&&(a.addClass("wpglobus-snippet-editor-slug"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),WPGlobusCoreData.default_language!=s&&a.attr("disabled","disabled")),"snippet-editor-meta-description"==t&&(a.addClass("wpglobus-snippet-editor-meta-description"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),a.val(p("#wpseo-tab-"+s).data("metadesc")),a.parent("label").next("progress").addClass(r.yoastMetadescProgress).addClass(r.yoastMetadescProgress+"_"+s),_.debounce(r.updateProgressBar(a,s),500)),"snippetpreview-help-toggle"==t&&(a.addClass("wpglobus-snippetpreview-help-toggle_"+s),p(document).on("click",".wpglobus-snippetpreview-help-toggle_"+s,function(e){var t=p(this);"none"===p("#snippetpreview-help_"+t.data("language")).css("display")?p("#snippetpreview-help_"+t.data("language")).css({display:"block"}):p("#snippetpreview-help_"+t.data("language")).css({display:"none"})})),"focuskw_text_input-help-toggle"==t&&(a.addClass("wpglobus-focuskw_text_input-help-toggle_"+s),p(document).on("click",".wpglobus-focuskw_text_input-help-toggle_"+s,function(e){var t=p(this);"none"===p("#focuskw_text_input-help_"+t.data("language")).css("display")?p("#focuskw_text_input-help_"+t.data("language")).css({display:"block"}):p("#focuskw_text_input-help_"+t.data("language")).css({display:"none"})})),"pageanalysis-help-toggle"==t&&(a.addClass("wpglobus-pageanalysis-help-toggle_"+s),p(document).on("click",".wpglobus-pageanalysis-help-toggle_"+s,function(e){var t=p(this);"none"===p("#pageanalysis-help_"+t.data("language")).css("display")?p("#pageanalysis-help_"+t.data("language")).css({display:"block"}):p("#pageanalysis-help_"+t.data("language")).css({display:"none"})})),a.attr("id",t+"_"+s),p("#"+t+"_"+s).attr("data-language",s)});var i=WPGlobusCore.TextFilter(p("#yoast_wpseo_focuskw_text_input").val(),s,"RETURN_EMPTY");p("#yoast_wpseo_focuskw_text_input_"+s).val(i),p("#yoast_wpseo_focuskw_"+s).val(i),r.updateWpseoKeyword(i,s),s!==WPGlobusCoreData.default_language&&(p("#"+o+" #yoast_wpseo_focuskw_text_input_"+s).addClass("hidden").after('<div class="wpglobus-suggest" style="font-weight:bold;">'+WPGlobusVendor.i18n.yoastseo_plus_access+"</div>"),p("#"+o+" #wpseo-pageanalysis_"+s).addClass("hidden").css({display:"none"}))}),p(".wpglobus-wpseosnippet").each(function(e,t){var a=p(t),s=a.data("language");a.find("button.snippet-editor__button.snippet-editor__edit-button").addClass(r.editSnippetButtonClass).addClass(r.editSnippetButtonClass+"_"+s).attr("data-language",s),a.find(".snippet-editor__form").addClass(r.editSnippetFormClass).addClass(r.editSnippetFormClass+"_"+s),a.find(".snippet-editor__heading-editor").addClass(r.editSnippetHeadingClass).addClass(r.editSnippetHeadingClass+"_"+s),a.find(".snippet-editor__submit").addClass(r.editSnippetSubmitClass).addClass(r.editSnippetSubmitClass+"_"+s).attr("data-language",s)}),r.iB.addClass("hidden"),r.iB.css({height:0,overflow:"hidden"});var e=WPGlobusCore.TextFilter(p("#yoast_wpseo_focuskw_text_input").val(),WPGlobusCoreData.default_language,"RETURN_EMPTY");p("#yoast_wpseo_focuskw_text_input").val(e),p("#yoast_wpseo_focuskw").val(e),p(".wpglobus-wpseo-general .wpseo_tablink").on("click",function(e){e.preventDefault();var t=p(this),a=t.parents("ul").data("language"),s=t.parent("li");a!=WPGlobusCoreData.default_language&&void 0===p(document).triggerHandler("wpglobus_yoast_analysis",{language:a})||(s.hasClass("wpseo_content_tab")?(p("#wpseo-pageanalysis_"+a).css({display:"none"}),p("#yoast-seo-content-analysis_"+a).css({display:"block"}),p("#wpseo_content_"+a+" table tr").eq(0).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(1).css({display:"none"}),p("#yoast-seo-content-analysis_"+a+" li a").css({float:"none"})):s.hasClass("wpseo_keyword_tab")&&(p("#wpseo-pageanalysis_"+a).css({display:"block"}),p("#yoast-seo-content-analysis_"+a).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(0).css("display",""),p("#wpseo_content_"+a+" table tr").eq(1).css("display","")))}),p(".wpseo-metabox-sidebar .wpseo-meta-section-link").on("click",function(e){"#wpseo-meta-section-content"==p(this).attr("href")?p("#wpglobus-wpseo-tabs").css({display:"block"}):p("#wpglobus-wpseo-tabs").css({display:"none"})}),p("body").on("click","."+r.editSnippetButtonClass,function(e){var t=p(this),a=t.data("language"),s=p("."+r.editSnippetFormClass+"_"+a),o=p("."+r.editSnippetSubmitClass+"_"+a),i=p("."+r.editSnippetHeadingClass+"_"+a);s.hasClass("snippet-editor--hidden")?(s.removeClass("snippet-editor--hidden"),i.removeClass("snippet-editor--hidden"),o.removeClass("snippet-editor--hidden")):(s.addClass("snippet-editor--hidden"),i.addClass("snippet-editor--hidden")),t.addClass("snippet-editor--hidden")}),p("body").on("click","."+r.editSnippetSubmitClass,function(e){var t=p(this).data("language"),a=p("."+r.editSnippetButtonClass+"_"+t),s=p("."+r.editSnippetFormClass+"_"+t),o=p("."+r.editSnippetSubmitClass+"_"+t),i=p("."+r.editSnippetHeadingClass+"_"+t);a.removeClass("snippet-editor--hidden"),s.addClass("snippet-editor--hidden"),o.addClass("snippet-editor--hidden"),i.addClass("snippet-editor--hidden")}),p(document).on("keyup","input.wpglobus-snippet-editor-title",function(e){var t=p(this),a=t.data("language"),s=WPGlobusCore.getString(p('input[name="yoast_wpseo_title"]').val(),t.val(),a);p("#snippet_title_"+a).html(d.replaceVariablesPlugin(t.val())),YoastSEO.app.rawData.pageTitle=s,p('input[name="yoast_wpseo_title"]').val(s),p("#snippet_title").text(s),_.debounce(r.updateProgressBar(t,a),500)}),p(document).on("keyup","input.wpglobus-snippet-editor-slug",function(e){var t=p(this),a=t.data("language");p("#snippet_cite_"+a).text(t.val()+"/"),p("#editable-post-name").text(t.val()),p("#editable-post-name-full").text(t.val())}),p(document).on("change","input.wpglobus-snippet-editor-slug",function(e){var t=p(this);p.post(ajaxurl,{action:"sample-permalink",post_id:p("#post_ID").val()||0,new_slug:t.val(),new_title:p("#title").val(),samplepermalinknonce:p("#samplepermalinknonce").val()})}),p(document).on("keyup","textarea.wpglobus-snippet-editor-meta-description",function(e){var t=p(this),a=t.data("language");p("#snippet_meta_"+a).text(t.val());var s=WPGlobusCore.getString(p("#yoast_wpseo_metadesc").val(),t.val(),t.data("language"));p("#yoast_wpseo_metadesc").val(s),p("#snippet_meta").text(s),_.debounce(r.updateProgressBar(t,a),500)}),p("body").on("click",".wpglobus-post-body-tabs-list li",function(e){var t=p(this);if(t.hasClass("wpglobus-post-tab")){p("#wpglobus-wpseo-tabs").tabs("option","active",t.data("order"));var a=p("#yoast_wpseo_focuskw_text_input_"+p(this).data("language")).val();YoastSEO.app.rawData.keyword=a,p("#yoast_wpseo_focuskw_text_input").val(a),p('input[name="yoast_wpseo_focuskw"]').val(a),s.prototype.analyze()}}),r.initAddKeywordPopup()}},(s=function(){this.replaceVars=wpseoReplaceVarsL10n.replace_vars,this.language=WPGlobusCoreData.default_language,this.tab=WPGlobusCoreData.default_language,this.wpseoTab=WPGlobusCoreData.default_language,this.title_template=wpseoPostScraperL10n.title_template,this.focuskw=p("#yoast_wpseo_focuskw_text_input"),this.focuskw_hidden=p('input[name="yoast_wpseo_focuskw"]'),this.focuskwKeep=!1,this.post_slug="#editable-post-name-full",YoastSEO.app.registerPlugin("wpglobusYoastSeoPlugin",{status:"ready"}),YoastSEO.app.registerModification("content",this.contentModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("title",this.titleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_title",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_meta",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_page_title",this.pageTitleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_meta_desc",this.metaDescModification,"wpglobusYoastSeoPlugin",0),s.prototype.setScoreIcon(),p(document).on("blur",".wpglobus-snippet_title",function(e){var t=p(this),a=WPGlobusCore.getString(p("#yoast_wpseo_title").val(),t.text(),t.data("language"));YoastSEO.app.rawData.pageTitle=a,p('input[name="yoast_wpseo_title"]').val(a),p("#snippet_title").text(a)}),p(document).on("blur",".wpglobus-snippet_meta",function(e){var t=p(this),a=WPGlobusCore.getString(p("#yoast_wpseo_metadesc").val(),t.text(),t.data("language"));p("#yoast_wpseo_metadesc").val(a),p("#snippet_meta").text(a)}),p(document).on("keyup",".wpglobus-yoast_wpseo_focuskw_text_input",function(e){var t=p(this),a=t.val();d.focuskw.val(a),d.focuskw_hidden.val(a),d.updateWpseoKeyword(a,t.data("language")),s.prototype.analyze()}),p("#publish,#save-post").on("mouseenter",function(e){var a,s="";p(".wpglobus-yoast_wpseo_focuskw_text_input").each(function(e,t){a=p(this),s=WPGlobusCore.getString(s,a.val(),a.data("language"))}),d.focuskw.val(s),d.focuskw_hidden.val(s)}).on("mouseleave",function(e){if(!d.focuskwKeep){d.wpseoTab=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language");p(this);d.focuskw.val(p("#yoast_wpseo_focuskw_text_input_"+d.wpseoTab).val()),d.focuskw_hidden.val(p("#yoast_wpseo_focuskw_text_input_"+d.wpseoTab).val())}}).on("click",function(e){d.focuskwKeep=!0}),p(WPGlobusYoastSeo.wpseoTabSelector).on("tabsactivate",function(e,t){if(d.language=t.newPanel.attr("data-language"),t.newPanel.attr("data-language")===WPGlobusCoreData.default_language){var a=p("#yoast_wpseo_focuskw_text_input_"+WPGlobusCoreData.default_language).val();YoastSEO.app.rawData.keyword=a,d.focuskw.val(a),d.focuskw_hidden.val(a)}s.prototype.analyze()}),d=this}).prototype.analyze=function(){var e=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language");e==WPGlobusCoreData.default_language?YoastSEO.app.snippetPreview.data.urlPath=p("#editable-post-name-full").text():0!=p("#editable-post-name-full-"+e).length?YoastSEO.app.snippetPreview.data.urlPath=p("#editable-post-name-full-"+e).text():YoastSEO.app.snippetPreview.data.urlPath=p("#editable-post-name-full").text(),YoastSEO.app.analyzeTimer(YoastSEO.app),s.prototype.setScoreIcon()},s.prototype.setScoreIcon=function(){var a;a=setInterval(function(){var e=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language"),t=p("#wpseo-metabox-tabs .wpseo-score-icon").attr("class");"bad"!=(t=t.replace("wpseo-score-icon ",""))&&"ok"!=t&&"good"!=t||(p("#wpseo-metabox-tabs_"+e+" .wpseo-score-icon").removeClass("bad ok good 100"),p("#wpseo-metabox-tabs_"+e+" .wpseo-score-icon").addClass(t),clearInterval(a))},700)},s.prototype.getWPseoTab=function(){return p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language")},s.prototype.citeModification=function(e){var t="#snippet_citeBase_"+e,a="#snippet_cite_"+e,s=p("#wpseo-tab-"+e).data("yoast-cite-base");!1===p("#wpseo-tab-"+e).data("cite-contenteditable")&&p(a).attr("contenteditable","false"),p(t).text(s)},s.prototype.pageTitleModification=function(e){var a,s,o,i="#snippet_title_",n="",l="";if(d.title_template==e)p.each(WPGlobusCoreData.enabled_languages,function(e,t){s=p("#snippet-editor-title_"+t).val(),o=0==s.length?d.title_template:s,n=d.replaceVariablesPlugin(o),p(i+t).text(n),t==d.getWPseoTab()&&(l=n)});else{if(a=WPGlobusCore.getTranslations(e),d.getWPseoTab()!==WPGlobusCoreData.default_language&&a[WPGlobusCoreData.default_language]==e){var t=d.getWPseoTab();return s=p("#snippet-editor-title_"+t).val(),o=0<s.length?s:d.title_template,o=d.replaceVariablesPlugin(o),p(i+t).text(o),o}p.each(WPGlobusCoreData.enabled_languages,function(e,t){n=""===a[t]?d.replaceVariablesPlugin(d.title_template):d.replaceVariablesPlugin(a[t]),t==d.getWPseoTab()&&(l=n,0!=(s=p("#snippet-editor-title_"+t).val()).length?s!=l&&(l=d.replaceVariablesPlugin(s)):l=d.replaceVariablesPlugin(d.title_template)),p(i+t).html(l)})}return l},s.prototype.metaDescModification=function(a){var e,s="#snippet_meta_",t=WPGlobusCore.getTranslations(a),o="";if(e=p("#snippet-editor-meta-description_"+d.getWPseoTab()).val(),d.getWPseoTab()!==WPGlobusCoreData.default_language&&t[WPGlobusCoreData.default_language]==a){var i=d.getWPseoTab();return d.citeModification(i),0==e.length?p(s+i).text(""):e!=a&&p(s+i).text(e),a}return p.each(WPGlobusCoreData.enabled_languages,function(e,t){p(s+t).text(WPGlobusCore.TextFilter(a,t,"RETURN_EMPTY")),d.citeModification(t)}),e==t[d.getWPseoTab()]?0==(o=t[d.getWPseoTab()]).length&&p(s+d.getWPseoTab()).text(WPGlobusCore.TextFilter(YoastSEO.app.snippetPreview.data.metaDesc,WPGlobusCoreData.default_language,"RETURN_EMPTY")):0==(o=e).length?p(s+d.getWPseoTab()).text(WPGlobusCore.TextFilter(YoastSEO.app.snippetPreview.data.metaDesc,WPGlobusCoreData.default_language,"RETURN_EMPTY")):p(s+d.getWPseoTab()).text(o),p(s+d.getWPseoTab()).text(o),o},s.prototype.snippetModification=function(e){return WPGlobusCore.TextFilter(e,d.getWPseoTab(),"RETURN_EMPTY")},s.prototype.contentModification=function(e){return d.getWPseoTab()==WPGlobusCoreData.default_language?e:p("#content_"+d.getWPseoTab()).val()},s.prototype.titleModification=function(e){return setTimeout(d.updatePageAnalysis,1e3),d.getWPseoTab()==WPGlobusCoreData.default_language?e:p("#title_"+d.getWPseoTab()).val()},s.prototype.defaultReplace=function(e){var t=YoastSEO.app.rawData.keyword;return e.replace(/%%sitedesc%%/g,this.replaceVars.sitedesc).replace(/%%sitename%%/g,WPGlobusCore.TextFilter(this.replaceVars.sitename,d.getWPseoTab())).replace(/%%term_title%%/g,this.replaceVars.term_title).replace(/%%term_description%%/g,this.replaceVars.term_description).replace(/%%category_description%%/g,this.replaceVars.category_description).replace(/%%tag_description%%/g,this.replaceVars.tag_description).replace(/%%searchphrase%%/g,this.replaceVars.searchphrase).replace(/%%date%%/g,this.replaceVars.date).replace(/%%id%%/g,this.replaceVars.id).replace(/%%page%%/g,this.replaceVars.page).replace(/%%currenttime%%/g,this.replaceVars.currenttime).replace(/%%currentdate%%/g,this.replaceVars.currentdate).replace(/%%currentday%%/g,this.replaceVars.currentday).replace(/%%currentmonth%%/g,this.replaceVars.currentmonth).replace(/%%currentyear%%/g,this.replaceVars.currentyear).replace(/%%focuskw%%/g,t)},s.prototype.replaceVariablesPlugin=function(e){return void 0!==e&&(e=this.titleReplace(e),e=this.defaultReplace(e),e=this.replaceSeparators(e)),e},s.prototype.replaceSeparators=function(e){return e.replace(/%%sep%%(\s+%%sep%%)*/g,this.replaceVars.sep)},s.prototype.titleReplace=function(e){var t="";return void 0===(t=this.language==WPGlobusCoreData.default_language?p("#title").val():p("#title_"+this.language).val())&&(t=YoastSEO.app.rawData.pageTitle),this.language!=WPGlobusCoreData.default_language&&0==t.length&&(t=p("#title").val()),e=e.replace(/%%title%%/g,t)},s.prototype.doubleSepReplace=function(e){var t=YoastSEO.app.stringHelper.addEscapeChars(this.replaceVars.sep),a=new RegExp(t+" "+t,"g");return e=e.replace(a,this.replaceVars.sep)},s.prototype.updateWpseoKeyword=function(e,t){0<p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").length&&p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").eq(1).removeClass("wpseo-keyword").addClass("wpglobus-wpseo_keyword_"+t),p(".wpglobus-wpseo_keyword_"+t).text(e)},s.prototype.updatePageAnalysis=function(){p("#wpseo-pageanalysis_"+d.getWPseoTab()).html(p("#wpseo-pageanalysis").html()),p("#yoast-seo-content-analysis_"+d.getWPseoTab()).html(p("#yoast-seo-content-analysis").html()),p("#yoast-seo-content-analysis_"+d.getWPseoTab()+" li a").css({float:"none"})},window.WPGlobusYoastSeoPlugin=new s}});
1
+ var WPGlobusYoastSeo;jQuery(document).ready(function(p){"use strict";var r;if("undefined"!=typeof wpseoReplaceVarsL10n&&("undefined"!=typeof WPGlobusCoreData&&"undefined"!=typeof WPGlobusVendor))if("edit-tags.php"==WPGlobusVendor.pagenow||"term.php"==WPGlobusVendor.pagenow){r=WPGlobusYoastSeo={editorIDs:["description"],editor:{},submitId:"#submit",preventChangeEditor:!1,observer:null,init:function(){r.attachListeners(),_.delay(r.start,1500)},submit:function(e){"mouseenter"===e.type?p.each(r.editor,function(e,t){!r.editor[e].contentEditor||r.editor[e].contentEditor.isHidden()?p("#"+e).val(r.editor[e].content):tinymce.get(e).setContent(r.editor[e].content)}):"mouseleave"===e.type?r.preventChangeEditor||(p.each(r.editor,function(e,t){!r.editor[e].contentEditor||r.editor[e].contentEditor.isHidden()?p("#"+e).val(WPGlobusCore.TextFilter(t.content,r.getCurrentTab(),"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,r.getCurrentTab(),"RETURN_EMPTY"))}),r.preventChangeEditor=!1):"click"===e.type&&(r.preventChangeEditor=!0,"tinymce"!=getUserSetting("editor")&&setUserSetting("editor","tinymce"))},attachListeners:function(){p(".wrap").on("tabsactivate",function(e,a){p.each(r.editor,function(e,t){!r.editor[e].contentEditor||r.editor[e].contentEditor.isHidden()?p("#"+e).val(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY"))})}),p(document).on("mouseenter",r.submitId,r.submit).on("mouseleave",r.submitId,r.submit).on("click",r.submitId,r.submit),p(document).on("tinymce-editor-init",function(e,t){if(-1!=_.indexOf(r.editorIDs,t.id)){var a=p("#"+t.id);r.editor[t.id]={},r.editor[t.id].contentEditor=t,r.editor[t.id].content=a.val(),t.setContent(WPGlobusCore.TextFilter(r.editor[t.id].content,WPGlobusCoreData.default_language,"RETURN_EMPTY")),p("#"+t.getContainer().id).find("iframe").addClass("wpglobus-translatable"),a.removeClass("hidden"),t.on("nodechange keyup",_.debounce(r.update,500)),a.on("input keyup",_.debounce(r.update,500))}})},update:function(e){var t,a;void 0!==e.target&&("tinymce"==(t=e.target.id)&&(t=e.target.dataset.id),void 0!==r.editor[t].contentEditor&&(a=!r.editor[t].contentEditor||r.editor[t].contentEditor.isHidden()?p("#"+t).val():r.editor[t].contentEditor.getContent({format:"raw"}),r.editor[t].content=WPGlobusCore.getString(r.editor[t].content,a,r.getCurrentTab())))},getCurrentTab:function(){return p(".wpglobus-taxonomy-tabs-list .ui-tabs-active").data("language")},start:function(){p(".wpglobus-element_description").css({display:"none"})}},WPGlobusYoastSeo.init();var s=function(){p(".wrap").on("tabsactivate",function(e,t){t.newTab[0].dataset.language==WPGlobusCoreData.default_language?p("#poststuff .inside").css({display:"block"}):p("#poststuff .inside").css({display:"none"})}),p.each(["category_description","sitedesc","sitename","tag_description","term_description","term_title"],function(e,t){wpseoReplaceVarsL10n.replace_vars[t]=WPGlobusCore.TextFilter(wpseoReplaceVarsL10n.replace_vars[t],WPGlobusCoreData.default_language)}),WPGlobusYoastSeo.observer=new MutationObserver(function(e){e.forEach(function(e){if("placeholder"==e.attributeName){WPGlobusYoastSeo.observer.disconnect();var t=p("#wpseo_focuskw");""==t.val()&&t.attr("placeholder",WPGlobusCore.TextFilter(t.attr("placeholder"),WPGlobusCoreData.default_language)),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0})}})}),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0})};window.WPGlobusYoastSeoPlugin=new s}else{var d;r=WPGlobusYoastSeo={wpseoTabSelector:"#wpglobus-wpseo-tabs",url:"",attrs:p("#wpglobus-wpseo-attr"),iB:p("#wpseo-meta-section-content"),t:p("#wpseo-meta-section-content"),ids:"",names:"",editSnippetButtonClass:"wpglobus-snippet-editor__edit-button",editSnippetFormClass:"wpglobus-snippet-editor__form",editSnippetSubmitClass:"wpglobus-snippet-editor__submit",editSnippetHeadingClass:"wpglobus-snippet-editor__heading-editor",yoastTitleProgress:"wpglobus-yoast-title-progress",yoastMetadescProgress:"wpglobus-yoast-metadesc-progress",init:function(){r.start()},initAddKeywordPopup:function(){1===p("#wpseo-add-keyword-popup").length&&p(".wpseo-add-keyword").on("click",r.addKeywordPopup)},addKeywordPopup:function(){var e=p("#wpseo-add-keyword-popup-button").text();tb_show(e,"#TB_inline?width=650&height=350&inlineId=wpseo-add-keyword-popup","group"),jQuery("#TB_window").css("height",235),jQuery("#TB_window").css("width",680)},qtip:function(){p(".yoast_help").qtip({content:{attr:"alt"},position:{my:"bottom left",at:"top center"},style:{tip:{corner:!0},classes:"yoast-qtip qtip-rounded qtip-blue"},show:"click",hide:{fixed:!0,delay:500}})},removeClasses:function(t,e){_.each(e,function(e){t.removeClass(e)})},updateProgressBar:function(e,t){if(void 0!==e&&(void 0!==t||("undefined"!==e.data("language")&&(t=e.data("language")),void 0!==t))){var a,s,o=["snippet-editor__progress--bad","snippet-editor__progress--ok","snippet-editor__progress--good"],i="",n=0,l=!1;s=e.val().length,e.hasClass("wpglobus-snippet-editor-title")?(n=(a=p("progress."+r.yoastTitleProgress+"_"+t)).attr("max"),i=o[2],0==s?i=o[1]:n<s?(i=o[1],l=!0):0<s&&s<35&&(i=o[1])):e.hasClass("wpglobus-snippet-editor-meta-description")&&(n=(a=p("progress."+r.yoastMetadescProgress+"_"+t)).attr("max"),i=o[2],0==s?i=o[1]:n<s?(i=o[1],l=!0):0<s&&s<121&&(i=o[1])),r.removeClasses(a,o),a.attr("value",s).addClass(i),l?e.css("color","#f00"):e.css("color","#000")}},updateWpseoKeyword:function(e,t){p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").eq(1).text(e)},start:function(){p(r.wpseoTabSelector).tabs(),r.ids=r.attrs.data("ids"),r.names=r.attrs.data("names"),r.ids=r.ids+","+r.attrs.data("qtip"),r.ids=r.ids.split(","),r.names=r.names.split(","),p("#wpglobus-wpseo-tabs").insertBefore(r.iB),p(".wpseo-metabox-tabs").css({height:"26px"}),p(".wpglobus-wpseo-general").each(function(e,t){var a=p(t),s=a.data("language"),o="wpseo-meta-section-content_"+s;a.html('<div id="'+o+'" class="wpseo-meta-section wpglobus-wpseo-meta-section" style="width:100%" data-language="'+s+'">'+r.t.html()+"</div>"),p("#"+o+" .wpseo-metabox-tabs").attr("id","wpseo-metabox-tabs_"+s).attr("data-language",s),p("#"+o+" .wpseotab").attr("id","wpseo_content_"+s),p("#wpseo_content_"+s).css({float:"left"}),p("#"+o).css({display:"block"}),p("#wpseo_meta").css({overflow:"hidden"}),p("#"+o+" .snippet_container").addClass("wpglobus-snippet_container"),s!==WPGlobusCoreData.default_language&&p("#"+o+" .wpseo-add-keyword").addClass("hidden"),p.each(r.names,function(e,t){p("#"+t).attr("name",t+"_"+s)}),p.each(r.ids,function(e,t){var a=p("#"+t);"wpseosnippet"==t&&a.addClass("wpglobus-wpseosnippet"),"snippet_title"==t&&a.addClass("wpglobus-snippet_title"),"snippet_meta"==t&&a.addClass("wpglobus-snippet_meta"),"snippet_cite"==t&&a.addClass("wpglobus-snippet_cite"),"snippet_citeBase"==t&&a.addClass("wpglobus-snippet_citeBase"),"url_container"==t&&a.css({height:"16px"}),"yoast_wpseo_focuskw_text_input"==t&&a.addClass("wpglobus-yoast_wpseo_focuskw_text_input"),"wpseo-pageanalysis"==t&&a.addClass("wpglobus-wpseo-pageanalysis"),"yoast-seo-content-analysis"==t&&a.addClass("wpglobus-yoast-seo-content-analysis"),"snippet_preview"==t&&a.addClass("wpglobus-snippet_preview"),"snippet-editor-title"==t&&(a.addClass("wpglobus-snippet-editor-title"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),a.val(p("#wpseo-tab-"+s).data("wpseotitle")),a.parent("label").next("progress").addClass(r.yoastTitleProgress).addClass(r.yoastTitleProgress+"_"+s),_.debounce(r.updateProgressBar(a,s),500)),"snippet-editor-slug"==t&&(a.addClass("wpglobus-snippet-editor-slug"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),WPGlobusCoreData.default_language!=s&&a.attr("disabled","disabled")),"snippet-editor-meta-description"==t&&(a.addClass("wpglobus-snippet-editor-meta-description"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),a.val(p("#wpseo-tab-"+s).data("metadesc")),a.parent("label").next("progress").addClass(r.yoastMetadescProgress).addClass(r.yoastMetadescProgress+"_"+s),_.debounce(r.updateProgressBar(a,s),500)),"snippetpreview-help-toggle"==t&&(a.addClass("wpglobus-snippetpreview-help-toggle_"+s),p(document).on("click",".wpglobus-snippetpreview-help-toggle_"+s,function(e){var t=p(this);"none"===p("#snippetpreview-help_"+t.data("language")).css("display")?p("#snippetpreview-help_"+t.data("language")).css({display:"block"}):p("#snippetpreview-help_"+t.data("language")).css({display:"none"})})),"focuskw_text_input-help-toggle"==t&&(a.addClass("wpglobus-focuskw_text_input-help-toggle_"+s),p(document).on("click",".wpglobus-focuskw_text_input-help-toggle_"+s,function(e){var t=p(this);"none"===p("#focuskw_text_input-help_"+t.data("language")).css("display")?p("#focuskw_text_input-help_"+t.data("language")).css({display:"block"}):p("#focuskw_text_input-help_"+t.data("language")).css({display:"none"})})),"pageanalysis-help-toggle"==t&&(a.addClass("wpglobus-pageanalysis-help-toggle_"+s),p(document).on("click",".wpglobus-pageanalysis-help-toggle_"+s,function(e){var t=p(this);"none"===p("#pageanalysis-help_"+t.data("language")).css("display")?p("#pageanalysis-help_"+t.data("language")).css({display:"block"}):p("#pageanalysis-help_"+t.data("language")).css({display:"none"})})),a.attr("id",t+"_"+s),p("#"+t+"_"+s).attr("data-language",s)});var i=WPGlobusCore.TextFilter(p("#yoast_wpseo_focuskw_text_input").val(),s,"RETURN_EMPTY");p("#yoast_wpseo_focuskw_text_input_"+s).val(i),p("#yoast_wpseo_focuskw_"+s).val(i),r.updateWpseoKeyword(i,s),s!==WPGlobusCoreData.default_language&&(p("#"+o+" #yoast_wpseo_focuskw_text_input_"+s).addClass("hidden").after('<div class="wpglobus-suggest" style="font-weight:bold;">'+WPGlobusVendor.i18n.yoastseo_plus_access+"</div>"),p("#"+o+" #wpseo-pageanalysis_"+s).addClass("hidden").css({display:"none"}))}),p(".wpglobus-wpseosnippet").each(function(e,t){var a=p(t),s=a.data("language");a.find("button.snippet-editor__button.snippet-editor__edit-button").addClass(r.editSnippetButtonClass).addClass(r.editSnippetButtonClass+"_"+s).attr("data-language",s),a.find(".snippet-editor__form").addClass(r.editSnippetFormClass).addClass(r.editSnippetFormClass+"_"+s),a.find(".snippet-editor__heading-editor").addClass(r.editSnippetHeadingClass).addClass(r.editSnippetHeadingClass+"_"+s),a.find(".snippet-editor__submit").addClass(r.editSnippetSubmitClass).addClass(r.editSnippetSubmitClass+"_"+s).attr("data-language",s)}),r.iB.addClass("hidden"),r.iB.css({height:0,overflow:"hidden"});var e=WPGlobusCore.TextFilter(p("#yoast_wpseo_focuskw_text_input").val(),WPGlobusCoreData.default_language,"RETURN_EMPTY");p("#yoast_wpseo_focuskw_text_input").val(e),p("#yoast_wpseo_focuskw").val(e),p(".wpglobus-wpseo-general .wpseo_tablink").on("click",function(e){e.preventDefault();var t=p(this),a=t.parents("ul").data("language"),s=t.parent("li");a!=WPGlobusCoreData.default_language&&void 0===p(document).triggerHandler("wpglobus_yoast_analysis",{language:a})||(s.hasClass("wpseo_content_tab")?(p("#wpseo-pageanalysis_"+a).css({display:"none"}),p("#yoast-seo-content-analysis_"+a).css({display:"block"}),p("#wpseo_content_"+a+" table tr").eq(0).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(1).css({display:"none"}),p("#yoast-seo-content-analysis_"+a+" li a").css({float:"none"})):s.hasClass("wpseo_keyword_tab")&&(p("#wpseo-pageanalysis_"+a).css({display:"block"}),p("#yoast-seo-content-analysis_"+a).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(0).css("display",""),p("#wpseo_content_"+a+" table tr").eq(1).css("display","")))}),p(".wpseo-metabox-sidebar .wpseo-meta-section-link").on("click",function(e){"#wpseo-meta-section-content"==p(this).attr("href")?p("#wpglobus-wpseo-tabs").css({display:"block"}):p("#wpglobus-wpseo-tabs").css({display:"none"})}),p("body").on("click","."+r.editSnippetButtonClass,function(e){var t=p(this),a=t.data("language"),s=p("."+r.editSnippetFormClass+"_"+a),o=p("."+r.editSnippetSubmitClass+"_"+a),i=p("."+r.editSnippetHeadingClass+"_"+a);s.hasClass("snippet-editor--hidden")?(s.removeClass("snippet-editor--hidden"),i.removeClass("snippet-editor--hidden"),o.removeClass("snippet-editor--hidden")):(s.addClass("snippet-editor--hidden"),i.addClass("snippet-editor--hidden")),t.addClass("snippet-editor--hidden")}),p("body").on("click","."+r.editSnippetSubmitClass,function(e){var t=p(this).data("language"),a=p("."+r.editSnippetButtonClass+"_"+t),s=p("."+r.editSnippetFormClass+"_"+t),o=p("."+r.editSnippetSubmitClass+"_"+t),i=p("."+r.editSnippetHeadingClass+"_"+t);a.removeClass("snippet-editor--hidden"),s.addClass("snippet-editor--hidden"),o.addClass("snippet-editor--hidden"),i.addClass("snippet-editor--hidden")}),p(document).on("keyup","input.wpglobus-snippet-editor-title",function(e){var t=p(this),a=t.data("language"),s=WPGlobusCore.getString(p('input[name="yoast_wpseo_title"]').val(),t.val(),a);p("#snippet_title_"+a).html(d.replaceVariablesPlugin(t.val())),YoastSEO.app.rawData.pageTitle=s,p('input[name="yoast_wpseo_title"]').val(s),p("#snippet_title").text(s),_.debounce(r.updateProgressBar(t,a),500)}),p(document).on("keyup","input.wpglobus-snippet-editor-slug",function(e){var t=p(this),a=t.data("language");p("#snippet_cite_"+a).text(t.val()+"/"),p("#editable-post-name").text(t.val()),p("#editable-post-name-full").text(t.val())}),p(document).on("change","input.wpglobus-snippet-editor-slug",function(e){var t=p(this);p.post(ajaxurl,{action:"sample-permalink",post_id:p("#post_ID").val()||0,new_slug:t.val(),new_title:p("#title").val(),samplepermalinknonce:p("#samplepermalinknonce").val()})}),p(document).on("keyup","textarea.wpglobus-snippet-editor-meta-description",function(e){var t=p(this),a=t.data("language");p("#snippet_meta_"+a).text(t.val());var s=WPGlobusCore.getString(p("#yoast_wpseo_metadesc").val(),t.val(),t.data("language"));p("#yoast_wpseo_metadesc").val(s),p("#snippet_meta").text(s),_.debounce(r.updateProgressBar(t,a),500)}),p("body").on("click",".wpglobus-post-body-tabs-list li",function(e){var t=p(this);if(t.hasClass("wpglobus-post-tab")){p("#wpglobus-wpseo-tabs").tabs("option","active",t.data("order"));var a=p("#yoast_wpseo_focuskw_text_input_"+p(this).data("language")).val();YoastSEO.app.rawData.keyword=a,p("#yoast_wpseo_focuskw_text_input").val(a),p('input[name="yoast_wpseo_focuskw"]').val(a),s.prototype.analyze()}}),r.initAddKeywordPopup()}},(s=function(){this.replaceVars=wpseoReplaceVarsL10n.replace_vars,this.language=WPGlobusCoreData.default_language,this.tab=WPGlobusCoreData.default_language,this.wpseoTab=WPGlobusCoreData.default_language,this.title_template=wpseoPostScraperL10n.title_template,this.focuskw=p("#yoast_wpseo_focuskw_text_input"),this.focuskw_hidden=p('input[name="yoast_wpseo_focuskw"]'),this.focuskwKeep=!1,this.post_slug="#editable-post-name-full",YoastSEO.app.registerPlugin("wpglobusYoastSeoPlugin",{status:"ready"}),YoastSEO.app.registerModification("content",this.contentModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("title",this.titleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_title",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_meta",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_page_title",this.pageTitleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_meta_desc",this.metaDescModification,"wpglobusYoastSeoPlugin",0),s.prototype.setScoreIcon(),p(document).on("blur",".wpglobus-snippet_title",function(e){var t=p(this),a=WPGlobusCore.getString(p("#yoast_wpseo_title").val(),t.text(),t.data("language"));YoastSEO.app.rawData.pageTitle=a,p('input[name="yoast_wpseo_title"]').val(a),p("#snippet_title").text(a)}),p(document).on("blur",".wpglobus-snippet_meta",function(e){var t=p(this),a=WPGlobusCore.getString(p("#yoast_wpseo_metadesc").val(),t.text(),t.data("language"));p("#yoast_wpseo_metadesc").val(a),p("#snippet_meta").text(a)}),p(document).on("keyup",".wpglobus-yoast_wpseo_focuskw_text_input",function(e){var t=p(this),a=t.val();d.focuskw.val(a),d.focuskw_hidden.val(a),d.updateWpseoKeyword(a,t.data("language")),s.prototype.analyze()}),p("#publish,#save-post").on("mouseenter",function(e){var a,s="";p(".wpglobus-yoast_wpseo_focuskw_text_input").each(function(e,t){a=p(this),s=WPGlobusCore.getString(s,a.val(),a.data("language"))}),d.focuskw.val(s),d.focuskw_hidden.val(s)}).on("mouseleave",function(e){if(!d.focuskwKeep){d.wpseoTab=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language");p(this);d.focuskw.val(p("#yoast_wpseo_focuskw_text_input_"+d.wpseoTab).val()),d.focuskw_hidden.val(p("#yoast_wpseo_focuskw_text_input_"+d.wpseoTab).val())}}).on("click",function(e){d.focuskwKeep=!0}),p(WPGlobusYoastSeo.wpseoTabSelector).on("tabsactivate",function(e,t){if(d.language=t.newPanel.attr("data-language"),t.newPanel.attr("data-language")===WPGlobusCoreData.default_language){var a=p("#yoast_wpseo_focuskw_text_input_"+WPGlobusCoreData.default_language).val();YoastSEO.app.rawData.keyword=a,d.focuskw.val(a),d.focuskw_hidden.val(a)}s.prototype.analyze()}),d=this}).prototype.analyze=function(){var e=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language");e==WPGlobusCoreData.default_language?YoastSEO.app.snippetPreview.data.urlPath=p("#editable-post-name-full").text():0!=p("#editable-post-name-full-"+e).length?YoastSEO.app.snippetPreview.data.urlPath=p("#editable-post-name-full-"+e).text():YoastSEO.app.snippetPreview.data.urlPath=p("#editable-post-name-full").text(),YoastSEO.app.analyzeTimer(YoastSEO.app),s.prototype.setScoreIcon()},s.prototype.setScoreIcon=function(){var a;a=setInterval(function(){var e=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language"),t=p("#wpseo-metabox-tabs .wpseo-score-icon").attr("class");"bad"!=(t=t.replace("wpseo-score-icon ",""))&&"ok"!=t&&"good"!=t||(p("#wpseo-metabox-tabs_"+e+" .wpseo-score-icon").removeClass("bad ok good 100"),p("#wpseo-metabox-tabs_"+e+" .wpseo-score-icon").addClass(t),clearInterval(a))},700)},s.prototype.getWPseoTab=function(){return p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language")},s.prototype.citeModification=function(e){var t="#snippet_citeBase_"+e,a="#snippet_cite_"+e,s=p("#wpseo-tab-"+e).data("yoast-cite-base");!1===p("#wpseo-tab-"+e).data("cite-contenteditable")&&p(a).attr("contenteditable","false"),p(t).text(s)},s.prototype.pageTitleModification=function(e){var a,s,o,i="#snippet_title_",n="",l="";if(d.title_template==e)p.each(WPGlobusCoreData.enabled_languages,function(e,t){s=p("#snippet-editor-title_"+t).val(),o=0==s.length?d.title_template:s,n=d.replaceVariablesPlugin(o),p(i+t).text(n),t==d.getWPseoTab()&&(l=n)});else{if(a=WPGlobusCore.getTranslations(e),d.getWPseoTab()!==WPGlobusCoreData.default_language&&a[WPGlobusCoreData.default_language]==e){var t=d.getWPseoTab();return s=p("#snippet-editor-title_"+t).val(),o=0<s.length?s:d.title_template,o=d.replaceVariablesPlugin(o),p(i+t).text(o),o}p.each(WPGlobusCoreData.enabled_languages,function(e,t){n=""===a[t]?d.replaceVariablesPlugin(d.title_template):d.replaceVariablesPlugin(a[t]),t==d.getWPseoTab()&&(l=n,0!=(s=p("#snippet-editor-title_"+t).val()).length?s!=l&&(l=d.replaceVariablesPlugin(s)):l=d.replaceVariablesPlugin(d.title_template)),p(i+t).html(l)})}return l},s.prototype.metaDescModification=function(a){var e,s="#snippet_meta_",t=WPGlobusCore.getTranslations(a),o="";if(e=p("#snippet-editor-meta-description_"+d.getWPseoTab()).val(),d.getWPseoTab()===WPGlobusCoreData.default_language||t[WPGlobusCoreData.default_language]!=a)return p.each(WPGlobusCoreData.enabled_languages,function(e,t){p(s+t).text(WPGlobusCore.TextFilter(a,t,"RETURN_EMPTY")),d.citeModification(t)}),e==t[d.getWPseoTab()]?0==(o=t[d.getWPseoTab()]).length&&p(s+d.getWPseoTab()).text(WPGlobusCore.TextFilter(YoastSEO.app.snippetPreview.data.metaDesc,WPGlobusCoreData.default_language,"RETURN_EMPTY")):0==(o=e).length?p(s+d.getWPseoTab()).text(WPGlobusCore.TextFilter(YoastSEO.app.snippetPreview.data.metaDesc,WPGlobusCoreData.default_language,"RETURN_EMPTY")):p(s+d.getWPseoTab()).text(o),p(s+d.getWPseoTab()).text(o),o;var i=d.getWPseoTab();return d.citeModification(i),0==e.length?p(s+i).text(""):e!=a&&p(s+i).text(e),a},s.prototype.snippetModification=function(e){return WPGlobusCore.TextFilter(e,d.getWPseoTab(),"RETURN_EMPTY")},s.prototype.contentModification=function(e){return d.getWPseoTab()==WPGlobusCoreData.default_language?e:p("#content_"+d.getWPseoTab()).val()},s.prototype.titleModification=function(e){return setTimeout(d.updatePageAnalysis,1e3),d.getWPseoTab()==WPGlobusCoreData.default_language?e:p("#title_"+d.getWPseoTab()).val()},s.prototype.defaultReplace=function(e){var t=YoastSEO.app.rawData.keyword;return e.replace(/%%sitedesc%%/g,this.replaceVars.sitedesc).replace(/%%sitename%%/g,WPGlobusCore.TextFilter(this.replaceVars.sitename,d.getWPseoTab())).replace(/%%term_title%%/g,this.replaceVars.term_title).replace(/%%term_description%%/g,this.replaceVars.term_description).replace(/%%category_description%%/g,this.replaceVars.category_description).replace(/%%tag_description%%/g,this.replaceVars.tag_description).replace(/%%searchphrase%%/g,this.replaceVars.searchphrase).replace(/%%date%%/g,this.replaceVars.date).replace(/%%id%%/g,this.replaceVars.id).replace(/%%page%%/g,this.replaceVars.page).replace(/%%currenttime%%/g,this.replaceVars.currenttime).replace(/%%currentdate%%/g,this.replaceVars.currentdate).replace(/%%currentday%%/g,this.replaceVars.currentday).replace(/%%currentmonth%%/g,this.replaceVars.currentmonth).replace(/%%currentyear%%/g,this.replaceVars.currentyear).replace(/%%focuskw%%/g,t)},s.prototype.replaceVariablesPlugin=function(e){return void 0!==e&&(e=this.titleReplace(e),e=this.defaultReplace(e),e=this.replaceSeparators(e)),e},s.prototype.replaceSeparators=function(e){return e.replace(/%%sep%%(\s+%%sep%%)*/g,this.replaceVars.sep)},s.prototype.titleReplace=function(e){var t="";return void 0===(t=this.language==WPGlobusCoreData.default_language?p("#title").val():p("#title_"+this.language).val())&&(t=YoastSEO.app.rawData.pageTitle),this.language!=WPGlobusCoreData.default_language&&0==t.length&&(t=p("#title").val()),e=e.replace(/%%title%%/g,t)},s.prototype.doubleSepReplace=function(e){var t=YoastSEO.app.stringHelper.addEscapeChars(this.replaceVars.sep),a=new RegExp(t+" "+t,"g");return e=e.replace(a,this.replaceVars.sep)},s.prototype.updateWpseoKeyword=function(e,t){0<p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").length&&p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").eq(1).removeClass("wpseo-keyword").addClass("wpglobus-wpseo_keyword_"+t),p(".wpglobus-wpseo_keyword_"+t).text(e)},s.prototype.updatePageAnalysis=function(){p("#wpseo-pageanalysis_"+d.getWPseoTab()).html(p("#wpseo-pageanalysis").html()),p("#yoast-seo-content-analysis_"+d.getWPseoTab()).html(p("#yoast-seo-content-analysis").html()),p("#yoast-seo-content-analysis_"+d.getWPseoTab()+" li a").css({float:"none"})},window.WPGlobusYoastSeoPlugin=new s}});
includes/js/wpglobus-yoastseo-34.min.js CHANGED
@@ -1 +1 @@
1
- var WPGlobusYoastSeo;jQuery(document).ready(function(p){"use strict";var r;if("undefined"!=typeof wpseoReplaceVarsL10n&&("undefined"!=typeof WPGlobusCoreData&&"undefined"!=typeof WPGlobusVendor))if("edit-tags.php"==WPGlobusVendor.pagenow||"term.php"==WPGlobusVendor.pagenow){r=WPGlobusYoastSeo={editorIDs:["description"],editor:{},submitId:"#submit",preventChangeEditor:!1,observer:null,init:function(){r.attachListeners(),_.delay(r.start,1500)},submit:function(e){"mouseenter"===e.type?p.each(r.editor,function(e,t){!r.editor[e].contentEditor||r.editor[e].contentEditor.isHidden()?p("#"+e).val(r.editor[e].content):tinymce.get(e).setContent(r.editor[e].content)}):"mouseleave"===e.type?r.preventChangeEditor||(p.each(r.editor,function(e,t){!r.editor[e].contentEditor||r.editor[e].contentEditor.isHidden()?p("#"+e).val(WPGlobusCore.TextFilter(t.content,r.getCurrentTab(),"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,r.getCurrentTab(),"RETURN_EMPTY"))}),r.preventChangeEditor=!1):"click"===e.type&&(r.preventChangeEditor=!0,"tinymce"!=getUserSetting("editor")&&setUserSetting("editor","tinymce"))},attachListeners:function(){p(".wrap").on("tabsactivate",function(e,a){p.each(r.editor,function(e,t){!r.editor[e].contentEditor||r.editor[e].contentEditor.isHidden()?p("#"+e).val(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY"))})}),p(document).on("mouseenter",r.submitId,r.submit).on("mouseleave",r.submitId,r.submit).on("click",r.submitId,r.submit),p(document).on("tinymce-editor-init",function(e,t){if(-1!=_.indexOf(r.editorIDs,t.id)){var a=p("#"+t.id);r.editor[t.id]={},r.editor[t.id].contentEditor=t,r.editor[t.id].content=a.val(),t.setContent(WPGlobusCore.TextFilter(r.editor[t.id].content,WPGlobusCoreData.default_language,"RETURN_EMPTY")),p("#"+t.getContainer().id).find("iframe").addClass("wpglobus-translatable"),a.removeClass("hidden"),t.on("nodechange keyup",_.debounce(r.update,500)),a.on("input keyup",_.debounce(r.update,500))}})},update:function(e){var t,a;void 0!==e.target&&("tinymce"==(t=e.target.id)&&(t=e.target.dataset.id),void 0!==r.editor[t].contentEditor&&(a=!r.editor[t].contentEditor||r.editor[t].contentEditor.isHidden()?p("#"+t).val():r.editor[t].contentEditor.getContent({format:"raw"}),r.editor[t].content=WPGlobusCore.getString(r.editor[t].content,a,r.getCurrentTab())))},getCurrentTab:function(){return p(".wpglobus-taxonomy-tabs-list .ui-tabs-active").data("language")},start:function(){p(".wpglobus-element_description").css({display:"none"})}},WPGlobusYoastSeo.init();var s=function(){p(".wrap").on("tabsactivate",function(e,t){t.newTab[0].dataset.language==WPGlobusCoreData.default_language?p("#poststuff .inside").css({display:"block"}):p("#poststuff .inside").css({display:"none"})}),p.each(["category_description","sitedesc","sitename","tag_description","term_description","term_title"],function(e,t){wpseoReplaceVarsL10n.replace_vars[t]=WPGlobusCore.TextFilter(wpseoReplaceVarsL10n.replace_vars[t],WPGlobusCoreData.default_language)}),WPGlobusYoastSeo.observer=new MutationObserver(function(e){e.forEach(function(e){if("placeholder"==e.attributeName){WPGlobusYoastSeo.observer.disconnect();var t=p("#wpseo_focuskw");""==t.val()&&t.attr("placeholder",WPGlobusCore.TextFilter(t.attr("placeholder"),WPGlobusCoreData.default_language)),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0})}})}),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0})};window.WPGlobusYoastSeoPlugin=new s}else{var d;r=WPGlobusYoastSeo={wpseoTabSelector:"#wpglobus-wpseo-tabs",url:"",attrs:p("#wpglobus-wpseo-attr"),iB:p("#wpseo-meta-section-content"),t:p("#wpseo-meta-section-content"),ids:"",names:"",editSnippetButtonClass:"wpglobus-snippet-editor__edit-button",editSnippetFormClass:"wpglobus-snippet-editor__form",editSnippetSubmitClass:"wpglobus-snippet-editor__submit",editSnippetHeadingClass:"wpglobus-snippet-editor__heading-editor",yoastTitleProgress:"wpglobus-yoast-title-progress",yoastMetadescProgress:"wpglobus-yoast-metadesc-progress",init:function(){r.start()},initAddKeywordPopup:function(){1===p("#wpseo-add-keyword-popup").length&&p(".wpseo-add-keyword").on("click",r.addKeywordPopup)},addKeywordPopup:function(){var e=p("#wpseo-add-keyword-popup-button").text();tb_show(e,"#TB_inline?width=650&height=350&inlineId=wpseo-add-keyword-popup","group"),jQuery("#TB_window").css("height",235),jQuery("#TB_window").css("width",680)},qtip:function(){p(".yoast_help").qtip({content:{attr:"alt"},position:{my:"bottom left",at:"top center"},style:{tip:{corner:!0},classes:"yoast-qtip qtip-rounded qtip-blue"},show:"click",hide:{fixed:!0,delay:500}})},removeClasses:function(t,e){_.each(e,function(e){t.removeClass(e)})},updateProgressBar:function(e,t){if(void 0!==e&&(void 0!==t||("undefined"!==e.data("language")&&(t=e.data("language")),void 0!==t))){var a,s,o=["snippet-editor__progress--bad","snippet-editor__progress--ok","snippet-editor__progress--good"],i="",n=0,l=!1;s=e.val().length,e.hasClass("wpglobus-snippet-editor-title")?(n=(a=p("progress."+r.yoastTitleProgress+"_"+t)).attr("max"),i=o[2],0==s?i=o[1]:n<s?(i=o[1],l=!0):0<s&&s<35&&(i=o[1])):e.hasClass("wpglobus-snippet-editor-meta-description")&&(n=(a=p("progress."+r.yoastMetadescProgress+"_"+t)).attr("max"),i=o[2],0==s?i=o[1]:n<s?(i=o[1],l=!0):0<s&&s<121&&(i=o[1])),r.removeClasses(a,o),a.attr("value",s).addClass(i),l?e.css("color","#f00"):e.css("color","#000")}},updateWpseoKeyword:function(e,t){p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").text(e)},start:function(){p(r.wpseoTabSelector).tabs(),r.ids=r.attrs.data("ids"),r.names=r.attrs.data("names"),r.ids=r.ids+","+r.attrs.data("qtip"),r.ids=r.ids.split(","),r.names=r.names.split(","),p("#wpglobus-wpseo-tabs").insertBefore(r.iB),p(".wpseo-metabox-tabs").css({height:"26px"}),p(".wpglobus-wpseo-general").each(function(e,t){var a=p(t),s=a.data("language"),o="wpseo-meta-section-content_"+s;a.html('<div id="'+o+'" class="wpseo-meta-section wpglobus-wpseo-meta-section" style="width:100%" data-language="'+s+'">'+r.t.html()+"</div>"),p("#"+o+" .wpseo-metabox-tabs").attr("id","wpseo-metabox-tabs_"+s).attr("data-language",s),p("#"+o+" .wpseotab").attr("id","wpseo_content_"+s),p("#wpseo_content_"+s).css({float:"left"}),p("#"+o).css({display:"block"}),p("#wpseo_meta").css({overflow:"hidden"}),p("#"+o+" .snippet_container").addClass("wpglobus-snippet_container"),s!==WPGlobusCoreData.default_language&&p("#"+o+" .wpseo-add-keyword").addClass("hidden"),p.each(r.names,function(e,t){p("#"+t).attr("name",t+"_"+s)}),p.each(r.ids,function(e,t){var a=p("#"+t);"wpseosnippet"==t&&a.addClass("wpglobus-wpseosnippet"),"snippet_title"==t&&a.addClass("wpglobus-snippet_title"),"snippet_meta"==t&&a.addClass("wpglobus-snippet_meta"),"snippet_cite"==t&&a.addClass("wpglobus-snippet_cite"),"snippet_citeBase"==t&&a.addClass("wpglobus-snippet_citeBase"),"url_container"==t&&a.css({height:"16px"}),"yoast_wpseo_focuskw_text_input"==t&&a.addClass("wpglobus-yoast_wpseo_focuskw_text_input"),"wpseo-pageanalysis"==t&&a.addClass("wpglobus-wpseo-pageanalysis"),"yoast-seo-content-analysis"==t&&a.addClass("wpglobus-yoast-seo-content-analysis"),"snippet_preview"==t&&a.addClass("wpglobus-snippet_preview"),"snippet-editor-title"==t&&(a.addClass("wpglobus-snippet-editor-title"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),a.val(p("#wpseo-tab-"+s).data("wpseotitle")),a.parent("label").next("progress").addClass(r.yoastTitleProgress).addClass(r.yoastTitleProgress+"_"+s),_.debounce(r.updateProgressBar(a,s),500)),"snippet-editor-slug"==t&&(a.addClass("wpglobus-snippet-editor-slug"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),WPGlobusCoreData.default_language!=s&&a.attr("disabled","disabled")),"snippet-editor-meta-description"==t&&(a.addClass("wpglobus-snippet-editor-meta-description"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),a.val(p("#wpseo-tab-"+s).data("metadesc")),a.parent("label").next("progress").addClass(r.yoastMetadescProgress).addClass(r.yoastMetadescProgress+"_"+s),_.debounce(r.updateProgressBar(a,s),500)),"snippetpreview-help-toggle"==t&&(a.addClass("wpglobus-snippetpreview-help-toggle_"+s),p(document).on("click",".wpglobus-snippetpreview-help-toggle_"+s,function(e){var t=p(this);"none"===p("#snippetpreview-help_"+t.data("language")).css("display")?p("#snippetpreview-help_"+t.data("language")).css({display:"block"}):p("#snippetpreview-help_"+t.data("language")).css({display:"none"})})),"focuskw_text_input-help-toggle"==t&&(a.addClass("wpglobus-focuskw_text_input-help-toggle_"+s),p(document).on("click",".wpglobus-focuskw_text_input-help-toggle_"+s,function(e){var t=p(this);"none"===p("#focuskw_text_input-help_"+t.data("language")).css("display")?p("#focuskw_text_input-help_"+t.data("language")).css({display:"block"}):p("#focuskw_text_input-help_"+t.data("language")).css({display:"none"})})),"pageanalysis-help-toggle"==t&&(a.addClass("wpglobus-pageanalysis-help-toggle_"+s),p(document).on("click",".wpglobus-pageanalysis-help-toggle_"+s,function(e){var t=p(this);"none"===p("#pageanalysis-help_"+t.data("language")).css("display")?p("#pageanalysis-help_"+t.data("language")).css({display:"block"}):p("#pageanalysis-help_"+t.data("language")).css({display:"none"})})),a.attr("id",t+"_"+s),p("#"+t+"_"+s).attr("data-language",s)});var i=WPGlobusCore.TextFilter(p("#yoast_wpseo_focuskw_text_input").val(),s,"RETURN_EMPTY");p("#yoast_wpseo_focuskw_text_input_"+s).val(i),p("#yoast_wpseo_focuskw_"+s).val(i),r.updateWpseoKeyword(i,s),s!==WPGlobusCoreData.default_language&&(p("#"+o+" #yoast_wpseo_focuskw_text_input_"+s).addClass("hidden").after('<div class="wpglobus-suggest" style="font-weight:bold;">'+WPGlobusVendor.i18n.yoastseo_plus_access+"</div>"),p("#"+o+" #wpseo-pageanalysis_"+s).addClass("hidden").css({display:"none"}))}),p(".wpglobus-wpseosnippet").each(function(e,t){var a=p(t),s=a.data("language");a.find("button.snippet-editor__button.snippet-editor__edit-button").addClass(r.editSnippetButtonClass).addClass(r.editSnippetButtonClass+"_"+s).attr("data-language",s),a.find(".snippet-editor__form").addClass(r.editSnippetFormClass).addClass(r.editSnippetFormClass+"_"+s),a.find(".snippet-editor__heading-editor").addClass(r.editSnippetHeadingClass).addClass(r.editSnippetHeadingClass+"_"+s),a.find(".snippet-editor__submit").addClass(r.editSnippetSubmitClass).addClass(r.editSnippetSubmitClass+"_"+s).attr("data-language",s)}),r.iB.addClass("hidden"),r.iB.css({height:0,overflow:"hidden",display:"none"});var e=WPGlobusCore.TextFilter(p("#yoast_wpseo_focuskw_text_input").val(),WPGlobusCoreData.default_language,"RETURN_EMPTY");p("#yoast_wpseo_focuskw_text_input").val(e),p("#yoast_wpseo_focuskw").val(e),p(".wpglobus-wpseo-general .wpseo_tablink").on("click",function(e){e.preventDefault();var t=p(this),a=t.parents("ul").data("language"),s=t.parent("li");a!=WPGlobusCoreData.default_language&&void 0===p(document).triggerHandler("wpglobus_yoast_analysis",{language:a})||(s.hasClass("wpseo_generic_tab")?(p("#wpseo-pageanalysis_"+a).css({display:"none"}),p("#yoast-seo-content-analysis_"+a).css({display:"block"}),p("#wpseo_content_"+a+" table tr").eq(0).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(1).css({display:"none"}),p("#yoast-seo-content-analysis_"+a+" li a").css({float:"none"})):s.hasClass("wpseo_keyword_tab")&&(p("#wpseo-pageanalysis_"+a).css({display:"block"}),p("#yoast-seo-content-analysis_"+a).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(0).css("display",""),p("#wpseo_content_"+a+" table tr").eq(1).css("display","")))}),p(".wpseo-metabox-sidebar .wpseo-meta-section-link").on("click",function(e){"#wpseo-meta-section-content"==p(this).attr("href")?p("#wpglobus-wpseo-tabs").css({display:"block"}):p("#wpglobus-wpseo-tabs").css({display:"none"})}),p("body").on("click","."+r.editSnippetButtonClass,function(e){var t=p(this),a=t.data("language"),s=p("."+r.editSnippetFormClass+"_"+a),o=p("."+r.editSnippetSubmitClass+"_"+a),i=p("."+r.editSnippetHeadingClass+"_"+a);s.hasClass("snippet-editor--hidden")?(s.removeClass("snippet-editor--hidden"),i.removeClass("snippet-editor--hidden"),o.removeClass("snippet-editor--hidden")):(s.addClass("snippet-editor--hidden"),i.addClass("snippet-editor--hidden")),t.addClass("snippet-editor--hidden")}),p("body").on("click","."+r.editSnippetSubmitClass,function(e){var t=p(this).data("language"),a=p("."+r.editSnippetButtonClass+"_"+t),s=p("."+r.editSnippetFormClass+"_"+t),o=p("."+r.editSnippetSubmitClass+"_"+t),i=p("."+r.editSnippetHeadingClass+"_"+t);a.removeClass("snippet-editor--hidden"),s.addClass("snippet-editor--hidden"),o.addClass("snippet-editor--hidden"),i.addClass("snippet-editor--hidden")}),p(document).on("keyup","input.wpglobus-snippet-editor-title",function(e){var t=p(this),a=t.data("language"),s=WPGlobusCore.getString(p('input[name="yoast_wpseo_title"]').val(),t.val(),a);p("#snippet_title_"+a).html(d.replaceVariablesPlugin(t.val())),YoastSEO.app.rawData.pageTitle=s,p('input[name="yoast_wpseo_title"]').val(s),p("#snippet_title").text(s),_.debounce(r.updateProgressBar(t,a),500)}),p(document).on("keyup","input.wpglobus-snippet-editor-slug",function(e){var t=p(this),a=t.data("language");p("#snippet_cite_"+a).text(t.val()+"/"),p("#editable-post-name").text(t.val()),p("#editable-post-name-full").text(t.val())}),p(document).on("change","input.wpglobus-snippet-editor-slug",function(e){var t=p(this);p.post(ajaxurl,{action:"sample-permalink",post_id:p("#post_ID").val()||0,new_slug:t.val(),new_title:p("#title").val(),samplepermalinknonce:p("#samplepermalinknonce").val()})}),p(document).on("keyup","textarea.wpglobus-snippet-editor-meta-description",function(e){var t=p(this),a=t.data("language");p("#snippet_meta_"+a).text(t.val());var s=WPGlobusCore.getString(p("#yoast_wpseo_metadesc").val(),t.val(),t.data("language"));p("#yoast_wpseo_metadesc").val(s),p("#snippet_meta").text(s),_.debounce(r.updateProgressBar(t,a),500)}),p("body").on("click",".wpglobus-post-body-tabs-list li",function(e){var t=p(this);if(t.hasClass("wpglobus-post-tab")){p("#wpglobus-wpseo-tabs").tabs("option","active",t.data("order"));var a=p("#yoast_wpseo_focuskw_text_input_"+p(this).data("language")).val();YoastSEO.app.rawData.keyword=a,p("#yoast_wpseo_focuskw_text_input").val(a),p('input[name="yoast_wpseo_focuskw"]').val(a),s.prototype.analyze()}}),r.initAddKeywordPopup()}},(s=function(){this.replaceVars=wpseoReplaceVarsL10n.replace_vars,this.language=WPGlobusCoreData.default_language,this.tab=WPGlobusCoreData.default_language,this.wpseoTab=WPGlobusCoreData.default_language,this.title_template=wpseoPostScraperL10n.title_template,this.focuskw=p("#yoast_wpseo_focuskw_text_input"),this.focuskw_hidden=p('input[name="yoast_wpseo_focuskw"]'),this.focuskwKeep=!1,this.post_slug="#editable-post-name-full",YoastSEO.app.registerPlugin("wpglobusYoastSeoPlugin",{status:"ready"}),YoastSEO.app.registerModification("content",this.contentModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("title",this.titleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_title",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_meta",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_page_title",this.pageTitleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_meta_desc",this.metaDescModification,"wpglobusYoastSeoPlugin",0),s.prototype.setScoreIcon(),p(document).on("blur",".wpglobus-snippet_title",function(e){var t=p(this),a=WPGlobusCore.getString(p("#yoast_wpseo_title").val(),t.text(),t.data("language"));YoastSEO.app.rawData.pageTitle=a,p('input[name="yoast_wpseo_title"]').val(a),p("#snippet_title").text(a)}),p(document).on("blur",".wpglobus-snippet_meta",function(e){var t=p(this),a=WPGlobusCore.getString(p("#yoast_wpseo_metadesc").val(),t.text(),t.data("language"));p("#yoast_wpseo_metadesc").val(a),p("#snippet_meta").text(a)}),p(document).on("keyup",".wpglobus-yoast_wpseo_focuskw_text_input",function(e){var t=p(this),a=t.val();d.focuskw.val(a),d.focuskw_hidden.val(a),d.updateWpseoKeyword(a,t.data("language")),s.prototype.analyze()}),p("#publish,#save-post").on("mouseenter",function(e){var a,s="";p(".wpglobus-yoast_wpseo_focuskw_text_input").each(function(e,t){a=p(this),s=WPGlobusCore.getString(s,a.val(),a.data("language"))}),d.focuskw.val(s),d.focuskw_hidden.val(s)}).on("mouseleave",function(e){if(!d.focuskwKeep){d.wpseoTab=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language");p(this);d.focuskw.val(p("#yoast_wpseo_focuskw_text_input_"+d.wpseoTab).val()),d.focuskw_hidden.val(p("#yoast_wpseo_focuskw_text_input_"+d.wpseoTab).val())}}).on("click",function(e){d.focuskwKeep=!0}),p(WPGlobusYoastSeo.wpseoTabSelector).on("tabsactivate",function(e,t){if(d.language=t.newPanel.attr("data-language"),t.newPanel.attr("data-language")===WPGlobusCoreData.default_language){var a=p("#yoast_wpseo_focuskw_text_input_"+WPGlobusCoreData.default_language).val();YoastSEO.app.rawData.keyword=a,d.focuskw.val(a),d.focuskw_hidden.val(a)}s.prototype.analyze()}),d=this}).prototype.analyze=function(){var e=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language");e==WPGlobusCoreData.default_language?YoastSEO.app.snippetPreview.data.urlPath=p("#editable-post-name-full").text():0!=p("#editable-post-name-full-"+e).length?YoastSEO.app.snippetPreview.data.urlPath=p("#editable-post-name-full-"+e).text():YoastSEO.app.snippetPreview.data.urlPath=p("#editable-post-name-full").text(),YoastSEO.app.analyzeTimer(YoastSEO.app),s.prototype.setScoreIcon()},s.prototype.setScoreIcon=function(){var a;a=setInterval(function(){var e=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language"),t=p("#wpseo-metabox-tabs .wpseo-score-icon").attr("class");"bad"!=(t=t.replace("wpseo-score-icon ",""))&&"ok"!=t&&"good"!=t||(p("#wpseo-metabox-tabs_"+e+" .wpseo-score-icon").removeClass("bad ok good 100"),p("#wpseo-metabox-tabs_"+e+" .wpseo-score-icon").addClass(t),clearInterval(a))},700)},s.prototype.getWPseoTab=function(){return p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language")},s.prototype.citeModification=function(e){var t="#snippet_citeBase_"+e,a="#snippet_cite_"+e,s=p("#wpseo-tab-"+e).data("yoast-cite-base");!1===p("#wpseo-tab-"+e).data("cite-contenteditable")&&p(a).attr("contenteditable","false"),p(t).text(s)},s.prototype.pageTitleModification=function(e){var a,s,o,i="#snippet_title_",n="",l="";if(d.title_template==e)p.each(WPGlobusCoreData.enabled_languages,function(e,t){s=p("#snippet-editor-title_"+t).val(),o=0==s.length?d.title_template:s,n=d.replaceVariablesPlugin(o),p(i+t).text(n),t==d.getWPseoTab()&&(l=n)});else{if(a=WPGlobusCore.getTranslations(e),d.getWPseoTab()!==WPGlobusCoreData.default_language&&a[WPGlobusCoreData.default_language]==e){var t=d.getWPseoTab();return s=p("#snippet-editor-title_"+t).val(),o=0<s.length?s:d.title_template,o=d.replaceVariablesPlugin(o),p(i+t).text(o),o}p.each(WPGlobusCoreData.enabled_languages,function(e,t){n=""===a[t]?d.replaceVariablesPlugin(d.title_template):d.replaceVariablesPlugin(a[t]),t==d.getWPseoTab()&&(l=n,0!=(s=p("#snippet-editor-title_"+t).val()).length?s!=l&&(l=d.replaceVariablesPlugin(s)):l=d.replaceVariablesPlugin(d.title_template)),p(i+t).html(l)})}return l},s.prototype.metaDescModification=function(a){var e,s="#snippet_meta_",t=WPGlobusCore.getTranslations(a),o="";if(e=p("#snippet-editor-meta-description_"+d.getWPseoTab()).val(),d.getWPseoTab()!==WPGlobusCoreData.default_language&&t[WPGlobusCoreData.default_language]==a){var i=d.getWPseoTab();return d.citeModification(i),0==e.length?p(s+i).text(""):e!=a&&p(s+i).text(e),a}return p.each(WPGlobusCoreData.enabled_languages,function(e,t){p(s+t).text(WPGlobusCore.TextFilter(a,t,"RETURN_EMPTY")),d.citeModification(t)}),e==t[d.getWPseoTab()]?0==(o=t[d.getWPseoTab()]).length&&p(s+d.getWPseoTab()).text(WPGlobusCore.TextFilter(YoastSEO.app.snippetPreview.data.metaDesc,WPGlobusCoreData.default_language,"RETURN_EMPTY")):0==(o=e).length?p(s+d.getWPseoTab()).text(WPGlobusCore.TextFilter(YoastSEO.app.snippetPreview.data.metaDesc,WPGlobusCoreData.default_language,"RETURN_EMPTY")):p(s+d.getWPseoTab()).text(o),p(s+d.getWPseoTab()).text(o),o},s.prototype.snippetModification=function(e){return WPGlobusCore.TextFilter(e,d.getWPseoTab(),"RETURN_EMPTY")},s.prototype.contentModification=function(e){return d.getWPseoTab()==WPGlobusCoreData.default_language?e:p("#content_"+d.getWPseoTab()).val()},s.prototype.titleModification=function(e){return setTimeout(d.updatePageAnalysis,1e3),d.getWPseoTab()==WPGlobusCoreData.default_language?e:p("#title_"+d.getWPseoTab()).val()},s.prototype.defaultReplace=function(e){var t=YoastSEO.app.rawData.keyword;return e.replace(/%%sitedesc%%/g,this.replaceVars.sitedesc).replace(/%%sitename%%/g,WPGlobusCore.TextFilter(this.replaceVars.sitename,d.getWPseoTab())).replace(/%%term_title%%/g,this.replaceVars.term_title).replace(/%%term_description%%/g,this.replaceVars.term_description).replace(/%%category_description%%/g,this.replaceVars.category_description).replace(/%%tag_description%%/g,this.replaceVars.tag_description).replace(/%%searchphrase%%/g,this.replaceVars.searchphrase).replace(/%%date%%/g,this.replaceVars.date).replace(/%%id%%/g,this.replaceVars.id).replace(/%%page%%/g,this.replaceVars.page).replace(/%%currenttime%%/g,this.replaceVars.currenttime).replace(/%%currentdate%%/g,this.replaceVars.currentdate).replace(/%%currentday%%/g,this.replaceVars.currentday).replace(/%%currentmonth%%/g,this.replaceVars.currentmonth).replace(/%%currentyear%%/g,this.replaceVars.currentyear).replace(/%%focuskw%%/g,t)},s.prototype.replaceVariablesPlugin=function(e){return void 0!==e&&(e=this.titleReplace(e),e=this.defaultReplace(e),e=this.replaceSeparators(e)),e},s.prototype.replaceSeparators=function(e){return e.replace(/%%sep%%(\s+%%sep%%)*/g,this.replaceVars.sep)},s.prototype.titleReplace=function(e){var t="";return void 0===(t=this.language==WPGlobusCoreData.default_language?p("#title").val():p("#title_"+this.language).val())&&(t=YoastSEO.app.rawData.pageTitle),this.language!=WPGlobusCoreData.default_language&&0==t.length&&(t=p("#title").val()),e=e.replace(/%%title%%/g,t)},s.prototype.doubleSepReplace=function(e){var t=YoastSEO.app.stringHelper.addEscapeChars(this.replaceVars.sep),a=new RegExp(t+" "+t,"g");return e=e.replace(a,this.replaceVars.sep)},s.prototype.updateWpseoKeyword=function(e,t){0<p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").length&&p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").removeClass("wpseo-keyword").addClass("wpglobus-wpseo_keyword_"+t),p(".wpglobus-wpseo_keyword_"+t).text(e)},s.prototype.updatePageAnalysis=function(){p("#wpseo-pageanalysis_"+d.getWPseoTab()).html(p("#wpseo-pageanalysis").html()),p("#yoast-seo-content-analysis_"+d.getWPseoTab()).html(p("#yoast-seo-content-analysis").html()),p("#yoast-seo-content-analysis_"+d.getWPseoTab()+" li a").css({float:"none"})},window.WPGlobusYoastSeoPlugin=new s}});
1
+ var WPGlobusYoastSeo;jQuery(document).ready(function(p){"use strict";var r;if("undefined"!=typeof wpseoReplaceVarsL10n&&("undefined"!=typeof WPGlobusCoreData&&"undefined"!=typeof WPGlobusVendor))if("edit-tags.php"==WPGlobusVendor.pagenow||"term.php"==WPGlobusVendor.pagenow){r=WPGlobusYoastSeo={editorIDs:["description"],editor:{},submitId:"#submit",preventChangeEditor:!1,observer:null,init:function(){r.attachListeners(),_.delay(r.start,1500)},submit:function(e){"mouseenter"===e.type?p.each(r.editor,function(e,t){!r.editor[e].contentEditor||r.editor[e].contentEditor.isHidden()?p("#"+e).val(r.editor[e].content):tinymce.get(e).setContent(r.editor[e].content)}):"mouseleave"===e.type?r.preventChangeEditor||(p.each(r.editor,function(e,t){!r.editor[e].contentEditor||r.editor[e].contentEditor.isHidden()?p("#"+e).val(WPGlobusCore.TextFilter(t.content,r.getCurrentTab(),"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,r.getCurrentTab(),"RETURN_EMPTY"))}),r.preventChangeEditor=!1):"click"===e.type&&(r.preventChangeEditor=!0,"tinymce"!=getUserSetting("editor")&&setUserSetting("editor","tinymce"))},attachListeners:function(){p(".wrap").on("tabsactivate",function(e,a){p.each(r.editor,function(e,t){!r.editor[e].contentEditor||r.editor[e].contentEditor.isHidden()?p("#"+e).val(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY"))})}),p(document).on("mouseenter",r.submitId,r.submit).on("mouseleave",r.submitId,r.submit).on("click",r.submitId,r.submit),p(document).on("tinymce-editor-init",function(e,t){if(-1!=_.indexOf(r.editorIDs,t.id)){var a=p("#"+t.id);r.editor[t.id]={},r.editor[t.id].contentEditor=t,r.editor[t.id].content=a.val(),t.setContent(WPGlobusCore.TextFilter(r.editor[t.id].content,WPGlobusCoreData.default_language,"RETURN_EMPTY")),p("#"+t.getContainer().id).find("iframe").addClass("wpglobus-translatable"),a.removeClass("hidden"),t.on("nodechange keyup",_.debounce(r.update,500)),a.on("input keyup",_.debounce(r.update,500))}})},update:function(e){var t,a;void 0!==e.target&&("tinymce"==(t=e.target.id)&&(t=e.target.dataset.id),void 0!==r.editor[t].contentEditor&&(a=!r.editor[t].contentEditor||r.editor[t].contentEditor.isHidden()?p("#"+t).val():r.editor[t].contentEditor.getContent({format:"raw"}),r.editor[t].content=WPGlobusCore.getString(r.editor[t].content,a,r.getCurrentTab())))},getCurrentTab:function(){return p(".wpglobus-taxonomy-tabs-list .ui-tabs-active").data("language")},start:function(){p(".wpglobus-element_description").css({display:"none"})}},WPGlobusYoastSeo.init();var s=function(){p(".wrap").on("tabsactivate",function(e,t){t.newTab[0].dataset.language==WPGlobusCoreData.default_language?p("#poststuff .inside").css({display:"block"}):p("#poststuff .inside").css({display:"none"})}),p.each(["category_description","sitedesc","sitename","tag_description","term_description","term_title"],function(e,t){wpseoReplaceVarsL10n.replace_vars[t]=WPGlobusCore.TextFilter(wpseoReplaceVarsL10n.replace_vars[t],WPGlobusCoreData.default_language)}),WPGlobusYoastSeo.observer=new MutationObserver(function(e){e.forEach(function(e){if("placeholder"==e.attributeName){WPGlobusYoastSeo.observer.disconnect();var t=p("#wpseo_focuskw");""==t.val()&&t.attr("placeholder",WPGlobusCore.TextFilter(t.attr("placeholder"),WPGlobusCoreData.default_language)),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0})}})}),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0})};window.WPGlobusYoastSeoPlugin=new s}else{var d;r=WPGlobusYoastSeo={wpseoTabSelector:"#wpglobus-wpseo-tabs",url:"",attrs:p("#wpglobus-wpseo-attr"),iB:p("#wpseo-meta-section-content"),t:p("#wpseo-meta-section-content"),ids:"",names:"",editSnippetButtonClass:"wpglobus-snippet-editor__edit-button",editSnippetFormClass:"wpglobus-snippet-editor__form",editSnippetSubmitClass:"wpglobus-snippet-editor__submit",editSnippetHeadingClass:"wpglobus-snippet-editor__heading-editor",yoastTitleProgress:"wpglobus-yoast-title-progress",yoastMetadescProgress:"wpglobus-yoast-metadesc-progress",init:function(){r.start()},initAddKeywordPopup:function(){1===p("#wpseo-add-keyword-popup").length&&p(".wpseo-add-keyword").on("click",r.addKeywordPopup)},addKeywordPopup:function(){var e=p("#wpseo-add-keyword-popup-button").text();tb_show(e,"#TB_inline?width=650&height=350&inlineId=wpseo-add-keyword-popup","group"),jQuery("#TB_window").css("height",235),jQuery("#TB_window").css("width",680)},qtip:function(){p(".yoast_help").qtip({content:{attr:"alt"},position:{my:"bottom left",at:"top center"},style:{tip:{corner:!0},classes:"yoast-qtip qtip-rounded qtip-blue"},show:"click",hide:{fixed:!0,delay:500}})},removeClasses:function(t,e){_.each(e,function(e){t.removeClass(e)})},updateProgressBar:function(e,t){if(void 0!==e&&(void 0!==t||("undefined"!==e.data("language")&&(t=e.data("language")),void 0!==t))){var a,s,o=["snippet-editor__progress--bad","snippet-editor__progress--ok","snippet-editor__progress--good"],i="",n=0,l=!1;s=e.val().length,e.hasClass("wpglobus-snippet-editor-title")?(n=(a=p("progress."+r.yoastTitleProgress+"_"+t)).attr("max"),i=o[2],0==s?i=o[1]:n<s?(i=o[1],l=!0):0<s&&s<35&&(i=o[1])):e.hasClass("wpglobus-snippet-editor-meta-description")&&(n=(a=p("progress."+r.yoastMetadescProgress+"_"+t)).attr("max"),i=o[2],0==s?i=o[1]:n<s?(i=o[1],l=!0):0<s&&s<121&&(i=o[1])),r.removeClasses(a,o),a.attr("value",s).addClass(i),l?e.css("color","#f00"):e.css("color","#000")}},updateWpseoKeyword:function(e,t){p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").text(e)},start:function(){p(r.wpseoTabSelector).tabs(),r.ids=r.attrs.data("ids"),r.names=r.attrs.data("names"),r.ids=r.ids+","+r.attrs.data("qtip"),r.ids=r.ids.split(","),r.names=r.names.split(","),p("#wpglobus-wpseo-tabs").insertBefore(r.iB),p(".wpseo-metabox-tabs").css({height:"26px"}),p(".wpglobus-wpseo-general").each(function(e,t){var a=p(t),s=a.data("language"),o="wpseo-meta-section-content_"+s;a.html('<div id="'+o+'" class="wpseo-meta-section wpglobus-wpseo-meta-section" style="width:100%" data-language="'+s+'">'+r.t.html()+"</div>"),p("#"+o+" .wpseo-metabox-tabs").attr("id","wpseo-metabox-tabs_"+s).attr("data-language",s),p("#"+o+" .wpseotab").attr("id","wpseo_content_"+s),p("#wpseo_content_"+s).css({float:"left"}),p("#"+o).css({display:"block"}),p("#wpseo_meta").css({overflow:"hidden"}),p("#"+o+" .snippet_container").addClass("wpglobus-snippet_container"),s!==WPGlobusCoreData.default_language&&p("#"+o+" .wpseo-add-keyword").addClass("hidden"),p.each(r.names,function(e,t){p("#"+t).attr("name",t+"_"+s)}),p.each(r.ids,function(e,t){var a=p("#"+t);"wpseosnippet"==t&&a.addClass("wpglobus-wpseosnippet"),"snippet_title"==t&&a.addClass("wpglobus-snippet_title"),"snippet_meta"==t&&a.addClass("wpglobus-snippet_meta"),"snippet_cite"==t&&a.addClass("wpglobus-snippet_cite"),"snippet_citeBase"==t&&a.addClass("wpglobus-snippet_citeBase"),"url_container"==t&&a.css({height:"16px"}),"yoast_wpseo_focuskw_text_input"==t&&a.addClass("wpglobus-yoast_wpseo_focuskw_text_input"),"wpseo-pageanalysis"==t&&a.addClass("wpglobus-wpseo-pageanalysis"),"yoast-seo-content-analysis"==t&&a.addClass("wpglobus-yoast-seo-content-analysis"),"snippet_preview"==t&&a.addClass("wpglobus-snippet_preview"),"snippet-editor-title"==t&&(a.addClass("wpglobus-snippet-editor-title"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),a.val(p("#wpseo-tab-"+s).data("wpseotitle")),a.parent("label").next("progress").addClass(r.yoastTitleProgress).addClass(r.yoastTitleProgress+"_"+s),_.debounce(r.updateProgressBar(a,s),500)),"snippet-editor-slug"==t&&(a.addClass("wpglobus-snippet-editor-slug"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),WPGlobusCoreData.default_language!=s&&a.attr("disabled","disabled")),"snippet-editor-meta-description"==t&&(a.addClass("wpglobus-snippet-editor-meta-description"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),a.val(p("#wpseo-tab-"+s).data("metadesc")),a.parent("label").next("progress").addClass(r.yoastMetadescProgress).addClass(r.yoastMetadescProgress+"_"+s),_.debounce(r.updateProgressBar(a,s),500)),"snippetpreview-help-toggle"==t&&(a.addClass("wpglobus-snippetpreview-help-toggle_"+s),p(document).on("click",".wpglobus-snippetpreview-help-toggle_"+s,function(e){var t=p(this);"none"===p("#snippetpreview-help_"+t.data("language")).css("display")?p("#snippetpreview-help_"+t.data("language")).css({display:"block"}):p("#snippetpreview-help_"+t.data("language")).css({display:"none"})})),"focuskw_text_input-help-toggle"==t&&(a.addClass("wpglobus-focuskw_text_input-help-toggle_"+s),p(document).on("click",".wpglobus-focuskw_text_input-help-toggle_"+s,function(e){var t=p(this);"none"===p("#focuskw_text_input-help_"+t.data("language")).css("display")?p("#focuskw_text_input-help_"+t.data("language")).css({display:"block"}):p("#focuskw_text_input-help_"+t.data("language")).css({display:"none"})})),"pageanalysis-help-toggle"==t&&(a.addClass("wpglobus-pageanalysis-help-toggle_"+s),p(document).on("click",".wpglobus-pageanalysis-help-toggle_"+s,function(e){var t=p(this);"none"===p("#pageanalysis-help_"+t.data("language")).css("display")?p("#pageanalysis-help_"+t.data("language")).css({display:"block"}):p("#pageanalysis-help_"+t.data("language")).css({display:"none"})})),a.attr("id",t+"_"+s),p("#"+t+"_"+s).attr("data-language",s)});var i=WPGlobusCore.TextFilter(p("#yoast_wpseo_focuskw_text_input").val(),s,"RETURN_EMPTY");p("#yoast_wpseo_focuskw_text_input_"+s).val(i),p("#yoast_wpseo_focuskw_"+s).val(i),r.updateWpseoKeyword(i,s),s!==WPGlobusCoreData.default_language&&(p("#"+o+" #yoast_wpseo_focuskw_text_input_"+s).addClass("hidden").after('<div class="wpglobus-suggest" style="font-weight:bold;">'+WPGlobusVendor.i18n.yoastseo_plus_access+"</div>"),p("#"+o+" #wpseo-pageanalysis_"+s).addClass("hidden").css({display:"none"}))}),p(".wpglobus-wpseosnippet").each(function(e,t){var a=p(t),s=a.data("language");a.find("button.snippet-editor__button.snippet-editor__edit-button").addClass(r.editSnippetButtonClass).addClass(r.editSnippetButtonClass+"_"+s).attr("data-language",s),a.find(".snippet-editor__form").addClass(r.editSnippetFormClass).addClass(r.editSnippetFormClass+"_"+s),a.find(".snippet-editor__heading-editor").addClass(r.editSnippetHeadingClass).addClass(r.editSnippetHeadingClass+"_"+s),a.find(".snippet-editor__submit").addClass(r.editSnippetSubmitClass).addClass(r.editSnippetSubmitClass+"_"+s).attr("data-language",s)}),r.iB.addClass("hidden"),r.iB.css({height:0,overflow:"hidden",display:"none"});var e=WPGlobusCore.TextFilter(p("#yoast_wpseo_focuskw_text_input").val(),WPGlobusCoreData.default_language,"RETURN_EMPTY");p("#yoast_wpseo_focuskw_text_input").val(e),p("#yoast_wpseo_focuskw").val(e),p(".wpglobus-wpseo-general .wpseo_tablink").on("click",function(e){e.preventDefault();var t=p(this),a=t.parents("ul").data("language"),s=t.parent("li");a!=WPGlobusCoreData.default_language&&void 0===p(document).triggerHandler("wpglobus_yoast_analysis",{language:a})||(s.hasClass("wpseo_generic_tab")?(p("#wpseo-pageanalysis_"+a).css({display:"none"}),p("#yoast-seo-content-analysis_"+a).css({display:"block"}),p("#wpseo_content_"+a+" table tr").eq(0).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(1).css({display:"none"}),p("#yoast-seo-content-analysis_"+a+" li a").css({float:"none"})):s.hasClass("wpseo_keyword_tab")&&(p("#wpseo-pageanalysis_"+a).css({display:"block"}),p("#yoast-seo-content-analysis_"+a).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(0).css("display",""),p("#wpseo_content_"+a+" table tr").eq(1).css("display","")))}),p(".wpseo-metabox-sidebar .wpseo-meta-section-link").on("click",function(e){"#wpseo-meta-section-content"==p(this).attr("href")?p("#wpglobus-wpseo-tabs").css({display:"block"}):p("#wpglobus-wpseo-tabs").css({display:"none"})}),p("body").on("click","."+r.editSnippetButtonClass,function(e){var t=p(this),a=t.data("language"),s=p("."+r.editSnippetFormClass+"_"+a),o=p("."+r.editSnippetSubmitClass+"_"+a),i=p("."+r.editSnippetHeadingClass+"_"+a);s.hasClass("snippet-editor--hidden")?(s.removeClass("snippet-editor--hidden"),i.removeClass("snippet-editor--hidden"),o.removeClass("snippet-editor--hidden")):(s.addClass("snippet-editor--hidden"),i.addClass("snippet-editor--hidden")),t.addClass("snippet-editor--hidden")}),p("body").on("click","."+r.editSnippetSubmitClass,function(e){var t=p(this).data("language"),a=p("."+r.editSnippetButtonClass+"_"+t),s=p("."+r.editSnippetFormClass+"_"+t),o=p("."+r.editSnippetSubmitClass+"_"+t),i=p("."+r.editSnippetHeadingClass+"_"+t);a.removeClass("snippet-editor--hidden"),s.addClass("snippet-editor--hidden"),o.addClass("snippet-editor--hidden"),i.addClass("snippet-editor--hidden")}),p(document).on("keyup","input.wpglobus-snippet-editor-title",function(e){var t=p(this),a=t.data("language"),s=WPGlobusCore.getString(p('input[name="yoast_wpseo_title"]').val(),t.val(),a);p("#snippet_title_"+a).html(d.replaceVariablesPlugin(t.val())),YoastSEO.app.rawData.pageTitle=s,p('input[name="yoast_wpseo_title"]').val(s),p("#snippet_title").text(s),_.debounce(r.updateProgressBar(t,a),500)}),p(document).on("keyup","input.wpglobus-snippet-editor-slug",function(e){var t=p(this),a=t.data("language");p("#snippet_cite_"+a).text(t.val()+"/"),p("#editable-post-name").text(t.val()),p("#editable-post-name-full").text(t.val())}),p(document).on("change","input.wpglobus-snippet-editor-slug",function(e){var t=p(this);p.post(ajaxurl,{action:"sample-permalink",post_id:p("#post_ID").val()||0,new_slug:t.val(),new_title:p("#title").val(),samplepermalinknonce:p("#samplepermalinknonce").val()})}),p(document).on("keyup","textarea.wpglobus-snippet-editor-meta-description",function(e){var t=p(this),a=t.data("language");p("#snippet_meta_"+a).text(t.val());var s=WPGlobusCore.getString(p("#yoast_wpseo_metadesc").val(),t.val(),t.data("language"));p("#yoast_wpseo_metadesc").val(s),p("#snippet_meta").text(s),_.debounce(r.updateProgressBar(t,a),500)}),p("body").on("click",".wpglobus-post-body-tabs-list li",function(e){var t=p(this);if(t.hasClass("wpglobus-post-tab")){p("#wpglobus-wpseo-tabs").tabs("option","active",t.data("order"));var a=p("#yoast_wpseo_focuskw_text_input_"+p(this).data("language")).val();YoastSEO.app.rawData.keyword=a,p("#yoast_wpseo_focuskw_text_input").val(a),p('input[name="yoast_wpseo_focuskw"]').val(a),s.prototype.analyze()}}),r.initAddKeywordPopup()}},(s=function(){this.replaceVars=wpseoReplaceVarsL10n.replace_vars,this.language=WPGlobusCoreData.default_language,this.tab=WPGlobusCoreData.default_language,this.wpseoTab=WPGlobusCoreData.default_language,this.title_template=wpseoPostScraperL10n.title_template,this.focuskw=p("#yoast_wpseo_focuskw_text_input"),this.focuskw_hidden=p('input[name="yoast_wpseo_focuskw"]'),this.focuskwKeep=!1,this.post_slug="#editable-post-name-full",YoastSEO.app.registerPlugin("wpglobusYoastSeoPlugin",{status:"ready"}),YoastSEO.app.registerModification("content",this.contentModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("title",this.titleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_title",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_meta",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_page_title",this.pageTitleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_meta_desc",this.metaDescModification,"wpglobusYoastSeoPlugin",0),s.prototype.setScoreIcon(),p(document).on("blur",".wpglobus-snippet_title",function(e){var t=p(this),a=WPGlobusCore.getString(p("#yoast_wpseo_title").val(),t.text(),t.data("language"));YoastSEO.app.rawData.pageTitle=a,p('input[name="yoast_wpseo_title"]').val(a),p("#snippet_title").text(a)}),p(document).on("blur",".wpglobus-snippet_meta",function(e){var t=p(this),a=WPGlobusCore.getString(p("#yoast_wpseo_metadesc").val(),t.text(),t.data("language"));p("#yoast_wpseo_metadesc").val(a),p("#snippet_meta").text(a)}),p(document).on("keyup",".wpglobus-yoast_wpseo_focuskw_text_input",function(e){var t=p(this),a=t.val();d.focuskw.val(a),d.focuskw_hidden.val(a),d.updateWpseoKeyword(a,t.data("language")),s.prototype.analyze()}),p("#publish,#save-post").on("mouseenter",function(e){var a,s="";p(".wpglobus-yoast_wpseo_focuskw_text_input").each(function(e,t){a=p(this),s=WPGlobusCore.getString(s,a.val(),a.data("language"))}),d.focuskw.val(s),d.focuskw_hidden.val(s)}).on("mouseleave",function(e){if(!d.focuskwKeep){d.wpseoTab=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language");p(this);d.focuskw.val(p("#yoast_wpseo_focuskw_text_input_"+d.wpseoTab).val()),d.focuskw_hidden.val(p("#yoast_wpseo_focuskw_text_input_"+d.wpseoTab).val())}}).on("click",function(e){d.focuskwKeep=!0}),p(WPGlobusYoastSeo.wpseoTabSelector).on("tabsactivate",function(e,t){if(d.language=t.newPanel.attr("data-language"),t.newPanel.attr("data-language")===WPGlobusCoreData.default_language){var a=p("#yoast_wpseo_focuskw_text_input_"+WPGlobusCoreData.default_language).val();YoastSEO.app.rawData.keyword=a,d.focuskw.val(a),d.focuskw_hidden.val(a)}s.prototype.analyze()}),d=this}).prototype.analyze=function(){var e=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language");e==WPGlobusCoreData.default_language?YoastSEO.app.snippetPreview.data.urlPath=p("#editable-post-name-full").text():0!=p("#editable-post-name-full-"+e).length?YoastSEO.app.snippetPreview.data.urlPath=p("#editable-post-name-full-"+e).text():YoastSEO.app.snippetPreview.data.urlPath=p("#editable-post-name-full").text(),YoastSEO.app.analyzeTimer(YoastSEO.app),s.prototype.setScoreIcon()},s.prototype.setScoreIcon=function(){var a;a=setInterval(function(){var e=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language"),t=p("#wpseo-metabox-tabs .wpseo-score-icon").attr("class");"bad"!=(t=t.replace("wpseo-score-icon ",""))&&"ok"!=t&&"good"!=t||(p("#wpseo-metabox-tabs_"+e+" .wpseo-score-icon").removeClass("bad ok good 100"),p("#wpseo-metabox-tabs_"+e+" .wpseo-score-icon").addClass(t),clearInterval(a))},700)},s.prototype.getWPseoTab=function(){return p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language")},s.prototype.citeModification=function(e){var t="#snippet_citeBase_"+e,a="#snippet_cite_"+e,s=p("#wpseo-tab-"+e).data("yoast-cite-base");!1===p("#wpseo-tab-"+e).data("cite-contenteditable")&&p(a).attr("contenteditable","false"),p(t).text(s)},s.prototype.pageTitleModification=function(e){var a,s,o,i="#snippet_title_",n="",l="";if(d.title_template==e)p.each(WPGlobusCoreData.enabled_languages,function(e,t){s=p("#snippet-editor-title_"+t).val(),o=0==s.length?d.title_template:s,n=d.replaceVariablesPlugin(o),p(i+t).text(n),t==d.getWPseoTab()&&(l=n)});else{if(a=WPGlobusCore.getTranslations(e),d.getWPseoTab()!==WPGlobusCoreData.default_language&&a[WPGlobusCoreData.default_language]==e){var t=d.getWPseoTab();return s=p("#snippet-editor-title_"+t).val(),o=0<s.length?s:d.title_template,o=d.replaceVariablesPlugin(o),p(i+t).text(o),o}p.each(WPGlobusCoreData.enabled_languages,function(e,t){n=""===a[t]?d.replaceVariablesPlugin(d.title_template):d.replaceVariablesPlugin(a[t]),t==d.getWPseoTab()&&(l=n,0!=(s=p("#snippet-editor-title_"+t).val()).length?s!=l&&(l=d.replaceVariablesPlugin(s)):l=d.replaceVariablesPlugin(d.title_template)),p(i+t).html(l)})}return l},s.prototype.metaDescModification=function(a){var e,s="#snippet_meta_",t=WPGlobusCore.getTranslations(a),o="";if(e=p("#snippet-editor-meta-description_"+d.getWPseoTab()).val(),d.getWPseoTab()===WPGlobusCoreData.default_language||t[WPGlobusCoreData.default_language]!=a)return p.each(WPGlobusCoreData.enabled_languages,function(e,t){p(s+t).text(WPGlobusCore.TextFilter(a,t,"RETURN_EMPTY")),d.citeModification(t)}),e==t[d.getWPseoTab()]?0==(o=t[d.getWPseoTab()]).length&&p(s+d.getWPseoTab()).text(WPGlobusCore.TextFilter(YoastSEO.app.snippetPreview.data.metaDesc,WPGlobusCoreData.default_language,"RETURN_EMPTY")):0==(o=e).length?p(s+d.getWPseoTab()).text(WPGlobusCore.TextFilter(YoastSEO.app.snippetPreview.data.metaDesc,WPGlobusCoreData.default_language,"RETURN_EMPTY")):p(s+d.getWPseoTab()).text(o),p(s+d.getWPseoTab()).text(o),o;var i=d.getWPseoTab();return d.citeModification(i),0==e.length?p(s+i).text(""):e!=a&&p(s+i).text(e),a},s.prototype.snippetModification=function(e){return WPGlobusCore.TextFilter(e,d.getWPseoTab(),"RETURN_EMPTY")},s.prototype.contentModification=function(e){return d.getWPseoTab()==WPGlobusCoreData.default_language?e:p("#content_"+d.getWPseoTab()).val()},s.prototype.titleModification=function(e){return setTimeout(d.updatePageAnalysis,1e3),d.getWPseoTab()==WPGlobusCoreData.default_language?e:p("#title_"+d.getWPseoTab()).val()},s.prototype.defaultReplace=function(e){var t=YoastSEO.app.rawData.keyword;return e.replace(/%%sitedesc%%/g,this.replaceVars.sitedesc).replace(/%%sitename%%/g,WPGlobusCore.TextFilter(this.replaceVars.sitename,d.getWPseoTab())).replace(/%%term_title%%/g,this.replaceVars.term_title).replace(/%%term_description%%/g,this.replaceVars.term_description).replace(/%%category_description%%/g,this.replaceVars.category_description).replace(/%%tag_description%%/g,this.replaceVars.tag_description).replace(/%%searchphrase%%/g,this.replaceVars.searchphrase).replace(/%%date%%/g,this.replaceVars.date).replace(/%%id%%/g,this.replaceVars.id).replace(/%%page%%/g,this.replaceVars.page).replace(/%%currenttime%%/g,this.replaceVars.currenttime).replace(/%%currentdate%%/g,this.replaceVars.currentdate).replace(/%%currentday%%/g,this.replaceVars.currentday).replace(/%%currentmonth%%/g,this.replaceVars.currentmonth).replace(/%%currentyear%%/g,this.replaceVars.currentyear).replace(/%%focuskw%%/g,t)},s.prototype.replaceVariablesPlugin=function(e){return void 0!==e&&(e=this.titleReplace(e),e=this.defaultReplace(e),e=this.replaceSeparators(e)),e},s.prototype.replaceSeparators=function(e){return e.replace(/%%sep%%(\s+%%sep%%)*/g,this.replaceVars.sep)},s.prototype.titleReplace=function(e){var t="";return void 0===(t=this.language==WPGlobusCoreData.default_language?p("#title").val():p("#title_"+this.language).val())&&(t=YoastSEO.app.rawData.pageTitle),this.language!=WPGlobusCoreData.default_language&&0==t.length&&(t=p("#title").val()),e=e.replace(/%%title%%/g,t)},s.prototype.doubleSepReplace=function(e){var t=YoastSEO.app.stringHelper.addEscapeChars(this.replaceVars.sep),a=new RegExp(t+" "+t,"g");return e=e.replace(a,this.replaceVars.sep)},s.prototype.updateWpseoKeyword=function(e,t){0<p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").length&&p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").removeClass("wpseo-keyword").addClass("wpglobus-wpseo_keyword_"+t),p(".wpglobus-wpseo_keyword_"+t).text(e)},s.prototype.updatePageAnalysis=function(){p("#wpseo-pageanalysis_"+d.getWPseoTab()).html(p("#wpseo-pageanalysis").html()),p("#yoast-seo-content-analysis_"+d.getWPseoTab()).html(p("#yoast-seo-content-analysis").html()),p("#yoast-seo-content-analysis_"+d.getWPseoTab()+" li a").css({float:"none"})},window.WPGlobusYoastSeoPlugin=new s}});
includes/js/wpglobus-yoastseo-38.min.js CHANGED
@@ -1 +1 @@
1
- var WPGlobusYoastSeo;jQuery(document).ready(function(l){"use strict";var r;if("undefined"!=typeof wpseoReplaceVarsL10n&&("undefined"!=typeof WPGlobusCoreData&&"undefined"!=typeof WPGlobusVendor))if("edit-tags.php"==WPGlobusVendor.pagenow||"term.php"==WPGlobusVendor.pagenow){r=WPGlobusYoastSeo={editorIDs:["description"],editor:{},submitId:"#submit",preventChangeEditor:!1,observer:null,init:function(){r.attachListeners(),_.delay(r.start,1500)},submit:function(e){"mouseenter"===e.type?l.each(r.editor,function(e,t){!r.editor[e].contentEditor||r.editor[e].contentEditor.isHidden()?l("#"+e).val(r.editor[e].content):tinymce.get(e).setContent(r.editor[e].content)}):"mouseleave"===e.type?r.preventChangeEditor||(l.each(r.editor,function(e,t){!r.editor[e].contentEditor||r.editor[e].contentEditor.isHidden()?l("#"+e).val(WPGlobusCore.TextFilter(t.content,r.getCurrentTab(),"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,r.getCurrentTab(),"RETURN_EMPTY"))}),r.preventChangeEditor=!1):"click"===e.type&&(r.preventChangeEditor=!0,"tinymce"!=getUserSetting("editor")&&setUserSetting("editor","tinymce"))},attachListeners:function(){l(".wrap").on("tabsactivate",function(e,a){l.each(r.editor,function(e,t){!r.editor[e].contentEditor||r.editor[e].contentEditor.isHidden()?l("#"+e).val(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY"))})}),l(document).on("mouseenter",r.submitId,r.submit).on("mouseleave",r.submitId,r.submit).on("click",r.submitId,r.submit),l(document).on("tinymce-editor-init",function(e,t){if(-1!=_.indexOf(r.editorIDs,t.id)){var a=l("#"+t.id);r.editor[t.id]={},r.editor[t.id].contentEditor=t,r.editor[t.id].content=a.val(),t.setContent(WPGlobusCore.TextFilter(r.editor[t.id].content,WPGlobusCoreData.default_language,"RETURN_EMPTY")),l("#"+t.getContainer().id).find("iframe").addClass("wpglobus-translatable"),a.removeClass("hidden"),t.on("nodechange keyup",_.debounce(r.update,500)),a.on("input keyup",_.debounce(r.update,500))}})},update:function(e){var t,a;void 0!==e.target&&("tinymce"==(t=e.target.id)&&(t=e.target.dataset.id),void 0!==r.editor[t].contentEditor&&(a=!r.editor[t].contentEditor||r.editor[t].contentEditor.isHidden()?l("#"+t).val():r.editor[t].contentEditor.getContent({format:"raw"}),r.editor[t].content=WPGlobusCore.getString(r.editor[t].content,a,r.getCurrentTab())))},getCurrentTab:function(){return l(".wpglobus-taxonomy-tabs-list .ui-tabs-active").data("language")},start:function(){l(".wpglobus-element_description").css({display:"none"})}},WPGlobusYoastSeo.init();var s=function(){l(".wrap").on("tabsactivate",function(e,t){t.newTab[0].dataset.language==WPGlobusCoreData.default_language?l("#poststuff .inside").css({display:"block"}):l("#poststuff .inside").css({display:"none"})}),l.each(["category_description","sitedesc","sitename","tag_description","term_description","term_title"],function(e,t){wpseoReplaceVarsL10n.replace_vars[t]=WPGlobusCore.TextFilter(wpseoReplaceVarsL10n.replace_vars[t],WPGlobusCoreData.default_language)}),WPGlobusYoastSeo.observer=new MutationObserver(function(e){e.forEach(function(e){if("placeholder"==e.attributeName){WPGlobusYoastSeo.observer.disconnect();var t=l("#wpseo_focuskw");""==t.val()&&t.attr("placeholder",WPGlobusCore.TextFilter(t.attr("placeholder"),WPGlobusCoreData.default_language)),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0})}})}),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0})};window.WPGlobusYoastSeoPlugin=new s}else{var d;r=WPGlobusYoastSeo={wpseoTabSelector:"#wpglobus-wpseo-tabs",url:"",attrs:l("#wpglobus-wpseo-attr"),iB:l("#wpseo-meta-section-content"),t:l("#wpseo-meta-section-content"),ids:"",names:"",editSnippetButtonClass:"wpglobus-snippet-editor__edit-button",editSnippetFormClass:"wpglobus-snippet-editor__form",editSnippetSubmitClass:"wpglobus-snippet-editor__submit",editSnippetHeadingClass:"wpglobus-snippet-editor__heading-editor",yoastTitleProgress:"wpglobus-yoast-title-progress",yoastMetadescProgress:"wpglobus-yoast-metadesc-progress",init:function(){r.start()},initAddKeywordPopup:function(){1===l("#wpseo-add-keyword-popup").length&&l(".wpseo-add-keyword").on("click",r.addKeywordPopup)},addKeywordPopup:function(){var e=l("#wpseo-add-keyword-popup-button").text();tb_show(e,"#TB_inline?width=650&height=350&inlineId=wpseo-add-keyword-popup","group"),jQuery("#TB_window").css("height",235),jQuery("#TB_window").css("width",680)},qtip:function(){l(".yoast_help").qtip({content:{attr:"alt"},position:{my:"bottom left",at:"top center"},style:{tip:{corner:!0},classes:"yoast-qtip qtip-rounded qtip-blue"},show:"click",hide:{fixed:!0,delay:500}})},removeClasses:function(t,e){_.each(e,function(e){t.removeClass(e)})},updateProgressBar:function(e,t){if(void 0!==e&&(void 0!==t||("undefined"!==e.data("language")&&(t=e.data("language")),void 0!==t))){var a,s,o=["snippet-editor__progress--bad","snippet-editor__progress--ok","snippet-editor__progress--good"],i="",n=0,p=!1;s=e.val().length,e.hasClass("wpglobus-snippet-editor-title")?(n=(a=l("progress."+r.yoastTitleProgress+"_"+t)).attr("max"),i=o[2],0==s?i=o[1]:n<s?(i=o[1],p=!0):0<s&&s<35&&(i=o[1])):e.hasClass("wpglobus-snippet-editor-meta-description")&&(n=(a=l("progress."+r.yoastMetadescProgress+"_"+t)).attr("max"),i=o[2],0==s?i=o[1]:n<s?(i=o[1],p=!0):0<s&&s<121&&(i=o[1])),r.removeClasses(a,o),a.attr("value",s).addClass(i),p?e.css("color","#f00"):e.css("color","#000")}},updateWpseoKeyword:function(e,t){l("#wpseo-meta-section-content_"+t+" .wpseo-keyword").text(e)},start:function(){l(r.wpseoTabSelector).tabs(),r.ids=r.attrs.data("ids"),r.names=r.attrs.data("names"),r.ids=r.ids+","+r.attrs.data("qtip"),r.ids=r.ids.split(","),r.names=r.names.split(","),l("#wpglobus-wpseo-tabs").insertBefore(r.iB),l(".wpseo-metabox-tabs").css({height:"26px"}),l(".wpglobus-wpseo-general").each(function(e,t){var a=l(t),s=a.data("language"),o="wpseo-meta-section-content_"+s;a.html('<div id="'+o+'" class="wpseo-meta-section wpglobus-wpseo-meta-section" style="width:100%" data-language="'+s+'">'+r.t.html()+"</div>"),l("#"+o+" .wpseo-metabox-tabs").attr("id","wpseo-metabox-tabs_"+s).attr("data-language",s),l("#"+o+" .wpseotab").attr("id","wpseo_content_"+s),l("#wpseo_content_"+s).css({float:"left"}),l("#"+o).css({display:"block"}),l("#wpseo_meta").css({overflow:"hidden"}),l("#"+o+" .snippet_container").addClass("wpglobus-snippet_container"),s!==WPGlobusCoreData.default_language&&l("#"+o+" .wpseo-add-keyword").addClass("hidden"),l.each(r.names,function(e,t){l("#"+t).attr("name",t+"_"+s)}),l.each(r.ids,function(e,t){var a=l("#"+t);"wpseosnippet"==t&&a.addClass("wpglobus-wpseosnippet"),"snippet_title"==t&&a.addClass("wpglobus-snippet_title"),"snippet_meta"==t&&a.addClass("wpglobus-snippet_meta"),"snippet_cite"==t&&a.addClass("wpglobus-snippet_cite"),"snippet_citeBase"==t&&a.addClass("wpglobus-snippet_citeBase"),"url_container"==t&&a.css({height:"16px"}),"yoast_wpseo_focuskw_text_input"==t&&a.addClass("wpglobus-yoast_wpseo_focuskw_text_input"),"wpseo-pageanalysis"==t&&a.addClass("wpglobus-wpseo-pageanalysis"),"yoast-seo-content-analysis"==t&&a.addClass("wpglobus-yoast-seo-content-analysis"),"snippet_preview"==t&&a.addClass("wpglobus-snippet_preview"),"snippet-editor-title"==t&&(a.addClass("wpglobus-snippet-editor-title"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),a.val(l("#wpseo-tab-"+s).data("wpseotitle")),a.parent("label").next("progress").addClass(r.yoastTitleProgress).addClass(r.yoastTitleProgress+"_"+s),_.debounce(r.updateProgressBar(a,s),500)),"snippet-editor-slug"==t&&(a.addClass("wpglobus-snippet-editor-slug"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),WPGlobusCoreData.default_language!=s&&a.attr("disabled","disabled")),"snippet-editor-meta-description"==t&&(a.addClass("wpglobus-snippet-editor-meta-description"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),a.val(l("#wpseo-tab-"+s).data("metadesc")),a.parent("label").next("progress").addClass(r.yoastMetadescProgress).addClass(r.yoastMetadescProgress+"_"+s),_.debounce(r.updateProgressBar(a,s),500)),"snippetpreview-help-toggle"==t&&(a.addClass("wpglobus-snippetpreview-help-toggle_"+s),l(document).on("click",".wpglobus-snippetpreview-help-toggle_"+s,function(e){var t=l(this);"none"===l("#snippetpreview-help_"+t.data("language")).css("display")?l("#snippetpreview-help_"+t.data("language")).css({display:"block"}):l("#snippetpreview-help_"+t.data("language")).css({display:"none"})})),"focuskw_text_input-help-toggle"==t&&(a.addClass("wpglobus-focuskw_text_input-help-toggle_"+s),l(document).on("click",".wpglobus-focuskw_text_input-help-toggle_"+s,function(e){var t=l(this);"none"===l("#focuskw_text_input-help_"+t.data("language")).css("display")?l("#focuskw_text_input-help_"+t.data("language")).css({display:"block"}):l("#focuskw_text_input-help_"+t.data("language")).css({display:"none"})})),"pageanalysis-help-toggle"==t&&(a.addClass("wpglobus-pageanalysis-help-toggle_"+s),l(document).on("click",".wpglobus-pageanalysis-help-toggle_"+s,function(e){var t=l(this);"none"===l("#pageanalysis-help_"+t.data("language")).css("display")?l("#pageanalysis-help_"+t.data("language")).css({display:"block"}):l("#pageanalysis-help_"+t.data("language")).css({display:"none"})})),a.attr("id",t+"_"+s),l("#"+t+"_"+s).attr("data-language",s)});var i=WPGlobusCore.TextFilter(l("#yoast_wpseo_focuskw_text_input").val(),s,"RETURN_EMPTY");l("#yoast_wpseo_focuskw_text_input_"+s).val(i),l("#yoast_wpseo_focuskw_"+s).val(i),r.updateWpseoKeyword(i,s),s!==WPGlobusCoreData.default_language&&(l("#"+o+" #yoast_wpseo_focuskw_text_input_"+s).addClass("hidden").after('<div class="wpglobus-suggest" style="font-weight:bold;">'+WPGlobusVendor.i18n.yoastseo_plus_access+"</div>"),l("#"+o+" #wpseo-pageanalysis_"+s).addClass("hidden").css({display:"none"}))}),l(".wpglobus-wpseosnippet").each(function(e,t){var a=l(t),s=a.data("language");a.find("button.snippet-editor__button.snippet-editor__edit-button").addClass(r.editSnippetButtonClass).addClass(r.editSnippetButtonClass+"_"+s).attr("data-language",s),a.find(".snippet-editor__form").addClass(r.editSnippetFormClass).addClass(r.editSnippetFormClass+"_"+s),a.find(".snippet-editor__heading-editor").addClass(r.editSnippetHeadingClass).addClass(r.editSnippetHeadingClass+"_"+s),a.find(".snippet-editor__submit").addClass(r.editSnippetSubmitClass).addClass(r.editSnippetSubmitClass+"_"+s).attr("data-language",s)}),r.iB.addClass("hidden"),r.iB.css({height:0,overflow:"hidden",display:"none"});var e=WPGlobusCore.TextFilter(l("#yoast_wpseo_focuskw_text_input").val(),WPGlobusCoreData.default_language,"RETURN_EMPTY");l("#yoast_wpseo_focuskw_text_input").val(e),l("#yoast_wpseo_focuskw").val(e),l(".wpglobus-wpseo-general .wpseo_tablink").on("click",function(e){e.preventDefault();var t=l(this),a=t.parents("ul").data("language"),s=t.parent("li");a!=WPGlobusCoreData.default_language&&void 0===l(document).triggerHandler("wpglobus_yoast_analysis",{language:a})||(s.hasClass("wpseo_generic_tab")?(l("#wpseo-pageanalysis_"+a).css({display:"none"}),l("#yoast-seo-content-analysis_"+a).css({display:"block"}),l("#wpseo_content_"+a+" table tr").eq(0).css({display:"none"}),l("#wpseo_content_"+a+" table tr").eq(1).css({display:"none"}),l("#yoast-seo-content-analysis_"+a+" li a").css({float:"none"})):s.hasClass("wpseo_keyword_tab")&&(l("#wpseo-pageanalysis_"+a).css({display:"block"}),l("#yoast-seo-content-analysis_"+a).css({display:"none"}),l("#wpseo_content_"+a+" table tr").eq(0).css("display",""),l("#wpseo_content_"+a+" table tr").eq(1).css("display","")))}),l(".wpseo-metabox-sidebar .wpseo-meta-section-link").on("click",function(e){"#wpseo-meta-section-content"==l(this).attr("href")?l("#wpglobus-wpseo-tabs").css({display:"block"}):l("#wpglobus-wpseo-tabs").css({display:"none"})}),l("body").on("click","."+r.editSnippetButtonClass,function(e){var t=l(this),a=t.data("language"),s=l("."+r.editSnippetFormClass+"_"+a),o=l("."+r.editSnippetSubmitClass+"_"+a),i=l("."+r.editSnippetHeadingClass+"_"+a);s.hasClass("snippet-editor--hidden")?(s.removeClass("snippet-editor--hidden"),i.removeClass("snippet-editor--hidden"),o.removeClass("snippet-editor--hidden")):(s.addClass("snippet-editor--hidden"),i.addClass("snippet-editor--hidden")),t.addClass("snippet-editor--hidden")}),l("body").on("click","."+r.editSnippetSubmitClass,function(e){var t=l(this).data("language"),a=l("."+r.editSnippetButtonClass+"_"+t),s=l("."+r.editSnippetFormClass+"_"+t),o=l("."+r.editSnippetSubmitClass+"_"+t),i=l("."+r.editSnippetHeadingClass+"_"+t);a.removeClass("snippet-editor--hidden"),s.addClass("snippet-editor--hidden"),o.addClass("snippet-editor--hidden"),i.addClass("snippet-editor--hidden")}),l(document).on("keyup","input.wpglobus-snippet-editor-title",function(e){var t=l(this),a=t.data("language"),s=WPGlobusCore.getString(l('input[name="yoast_wpseo_title"]').val(),t.val(),a);l("#snippet_title_"+a).html(d.replaceVariablesPlugin(t.val())),YoastSEO.app.rawData.pageTitle=s,l('input[name="yoast_wpseo_title"]').val(s),l("#snippet_title").text(s),_.debounce(r.updateProgressBar(t,a),500)}),l(document).on("keyup","input.wpglobus-snippet-editor-slug",function(e){var t=l(this),a=t.data("language");l("#snippet_cite_"+a).text(t.val()+"/"),l("#editable-post-name").text(t.val()),l("#editable-post-name-full").text(t.val())}),l(document).on("change","input.wpglobus-snippet-editor-slug",function(e){var t=l(this);l.post(ajaxurl,{action:"sample-permalink",post_id:l("#post_ID").val()||0,new_slug:t.val(),new_title:l("#title").val(),samplepermalinknonce:l("#samplepermalinknonce").val()})}),l(document).on("keyup","textarea.wpglobus-snippet-editor-meta-description",function(e){var t=l(this),a=t.data("language");l("#snippet_meta_"+a).text(t.val());var s=WPGlobusCore.getString(l("#yoast_wpseo_metadesc").val(),t.val(),t.data("language"));l("#yoast_wpseo_metadesc").val(s),l("#snippet_meta").text(s),_.debounce(r.updateProgressBar(t,a),500)}),l("body").on("click",".wpglobus-post-body-tabs-list li",function(e){var t=l(this);if(t.hasClass("wpglobus-post-tab")){l("#wpglobus-wpseo-tabs").tabs("option","active",t.data("order"));var a=l("#yoast_wpseo_focuskw_text_input_"+l(this).data("language")).val();YoastSEO.app.rawData.keyword=a,l("#yoast_wpseo_focuskw_text_input").val(a),l('input[name="yoast_wpseo_focuskw"]').val(a),s.prototype.analyze()}}),r.initAddKeywordPopup()}},(s=function(){this.replaceVars=wpseoReplaceVarsL10n.replace_vars,this.language=WPGlobusCoreData.default_language,this.tab=WPGlobusCoreData.default_language,this.wpseoTab=WPGlobusCoreData.default_language,this.title_template=wpseoPostScraperL10n.title_template,this.focuskw=l("#yoast_wpseo_focuskw_text_input"),this.focuskw_hidden=l('input[name="yoast_wpseo_focuskw"]'),this.focuskwKeep=!1,this.post_slug="#editable-post-name-full",YoastSEO.app.registerPlugin("wpglobusYoastSeoPlugin",{status:"ready"}),YoastSEO.app.registerModification("content",this.contentModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("title",this.titleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_title",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_meta",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_page_title",this.pageTitleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_meta_desc",this.metaDescModification,"wpglobusYoastSeoPlugin",0),s.prototype.setScoreIcon(),l(document).on("blur",".wpglobus-snippet_title",function(e){var t=l(this),a=WPGlobusCore.getString(l("#yoast_wpseo_title").val(),t.text(),t.data("language"));YoastSEO.app.rawData.pageTitle=a,l('input[name="yoast_wpseo_title"]').val(a),l("#snippet_title").text(a)}),l(document).on("blur",".wpglobus-snippet_meta",function(e){var t=l(this),a=WPGlobusCore.getString(l("#yoast_wpseo_metadesc").val(),t.text(),t.data("language"));l("#yoast_wpseo_metadesc").val(a),l("#snippet_meta").text(a)}),l(document).on("keyup",".wpglobus-yoast_wpseo_focuskw_text_input",function(e){var t=l(this),a=t.val();d.focuskw.val(a),d.focuskw_hidden.val(a),d.updateWpseoKeyword(a,t.data("language")),s.prototype.analyze()}),l("#publish,#save-post").on("mouseenter",function(e){var a,s="";l(".wpglobus-yoast_wpseo_focuskw_text_input").each(function(e,t){a=l(this),s=WPGlobusCore.getString(s,a.val(),a.data("language"))}),d.focuskw.val(s),d.focuskw_hidden.val(s)}).on("mouseleave",function(e){if(!d.focuskwKeep){d.wpseoTab=l(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language");l(this);d.focuskw.val(l("#yoast_wpseo_focuskw_text_input_"+d.wpseoTab).val()),d.focuskw_hidden.val(l("#yoast_wpseo_focuskw_text_input_"+d.wpseoTab).val())}}).on("click",function(e){d.focuskwKeep=!0}),l(WPGlobusYoastSeo.wpseoTabSelector).on("tabsactivate",function(e,t){if(d.language=t.newPanel.attr("data-language"),t.newPanel.attr("data-language")===WPGlobusCoreData.default_language){var a=l("#yoast_wpseo_focuskw_text_input_"+WPGlobusCoreData.default_language).val();YoastSEO.app.rawData.keyword=a,d.focuskw.val(a),d.focuskw_hidden.val(a)}s.prototype.analyze()}),d=this}).prototype.analyze=function(){var e=l(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language");e==WPGlobusCoreData.default_language?YoastSEO.app.snippetPreview.data.urlPath=l("#editable-post-name-full").text():0!=l("#editable-post-name-full-"+e).length?YoastSEO.app.snippetPreview.data.urlPath=l("#editable-post-name-full-"+e).text():YoastSEO.app.snippetPreview.data.urlPath=l("#editable-post-name-full").text(),YoastSEO.app.analyzeTimer(YoastSEO.app),s.prototype.setScoreIcon()},s.prototype.setScoreIcon=function(){var s;s=setInterval(function(){var e=l(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language"),t=l("#wpseo-meta-section-content .wpseo_generic_tab a").data("score"),a=l("#wpseo-meta-section-content .wpseo_keyword_tab a").data("score");""!=t&&(l("#wpseo-metabox-tabs_"+e+" .wpseo_generic_tab .wpseo-score-icon").removeClass("bad ok good 100 na"),l("#wpseo-metabox-tabs_"+e+" .wpseo_generic_tab .wpseo-score-icon").addClass(t)),""!=a&&(l("#wpseo-metabox-tabs_"+e+" .wpseo_keyword_tab .wpseo-score-icon").removeClass("bad ok good 100 na"),l("#wpseo-metabox-tabs_"+e+" .wpseo_keyword_tab .wpseo-score-icon").addClass(a)),clearInterval(s)},1500)},s.prototype.getWPseoTab=function(){return l(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language")},s.prototype.citeModification=function(e){var t="#snippet_citeBase_"+e,a="#snippet_cite_"+e,s=l("#wpseo-tab-"+e).data("yoast-cite-base");!1===l("#wpseo-tab-"+e).data("cite-contenteditable")&&l(a).attr("contenteditable","false"),l(t).text(s)},s.prototype.pageTitleModification=function(e){var a,s,o,i="#snippet_title_",n="",p="";if(d.title_template==e)l.each(WPGlobusCoreData.enabled_languages,function(e,t){s=l("#snippet-editor-title_"+t).val(),o=0==s.length?d.title_template:s,n=d.replaceVariablesPlugin(o),l(i+t).text(n),t==d.getWPseoTab()&&(p=n)});else{if(a=WPGlobusCore.getTranslations(e),d.getWPseoTab()!==WPGlobusCoreData.default_language&&a[WPGlobusCoreData.default_language]==e){var t=d.getWPseoTab();return s=l("#snippet-editor-title_"+t).val(),o=0<s.length?s:d.title_template,o=d.replaceVariablesPlugin(o),l(i+t).text(o),o}l.each(WPGlobusCoreData.enabled_languages,function(e,t){n=""===a[t]?d.replaceVariablesPlugin(d.title_template):d.replaceVariablesPlugin(a[t]),t==d.getWPseoTab()&&(p=n,0!=(s=l("#snippet-editor-title_"+t).val()).length?s!=p&&(p=d.replaceVariablesPlugin(s)):p=d.replaceVariablesPlugin(d.title_template)),l(i+t).html(p)})}return p},s.prototype.metaDescModification=function(a){var e,s="#snippet_meta_",t=WPGlobusCore.getTranslations(a),o="";if(e=l("#snippet-editor-meta-description_"+d.getWPseoTab()).val(),d.getWPseoTab()!==WPGlobusCoreData.default_language&&t[WPGlobusCoreData.default_language]==a){var i=d.getWPseoTab();return d.citeModification(i),0==e.length?l(s+i).text(""):e!=a&&l(s+i).text(e),a}return l.each(WPGlobusCoreData.enabled_languages,function(e,t){l(s+t).text(WPGlobusCore.TextFilter(a,t,"RETURN_EMPTY")),d.citeModification(t)}),e==t[d.getWPseoTab()]?0==(o=t[d.getWPseoTab()]).length&&l(s+d.getWPseoTab()).text(WPGlobusCore.TextFilter(YoastSEO.app.snippetPreview.data.metaDesc,WPGlobusCoreData.default_language,"RETURN_EMPTY")):0==(o=e).length?l(s+d.getWPseoTab()).text(WPGlobusCore.TextFilter(YoastSEO.app.snippetPreview.data.metaDesc,WPGlobusCoreData.default_language,"RETURN_EMPTY")):l(s+d.getWPseoTab()).text(o),l(s+d.getWPseoTab()).text(o),o},s.prototype.snippetModification=function(e){return WPGlobusCore.TextFilter(e,d.getWPseoTab(),"RETURN_EMPTY")},s.prototype.contentModification=function(e){return d.getWPseoTab()==WPGlobusCoreData.default_language?e:l("#content_"+d.getWPseoTab()).val()},s.prototype.titleModification=function(e){return setTimeout(d.updatePageAnalysis,1e3),d.getWPseoTab()==WPGlobusCoreData.default_language?e:l("#title_"+d.getWPseoTab()).val()},s.prototype.defaultReplace=function(e){var t=YoastSEO.app.rawData.keyword;return e.replace(/%%sitedesc%%/g,this.replaceVars.sitedesc).replace(/%%sitename%%/g,WPGlobusCore.TextFilter(this.replaceVars.sitename,d.getWPseoTab())).replace(/%%term_title%%/g,this.replaceVars.term_title).replace(/%%term_description%%/g,this.replaceVars.term_description).replace(/%%category_description%%/g,this.replaceVars.category_description).replace(/%%tag_description%%/g,this.replaceVars.tag_description).replace(/%%searchphrase%%/g,this.replaceVars.searchphrase).replace(/%%date%%/g,this.replaceVars.date).replace(/%%id%%/g,this.replaceVars.id).replace(/%%page%%/g,this.replaceVars.page).replace(/%%currenttime%%/g,this.replaceVars.currenttime).replace(/%%currentdate%%/g,this.replaceVars.currentdate).replace(/%%currentday%%/g,this.replaceVars.currentday).replace(/%%currentmonth%%/g,this.replaceVars.currentmonth).replace(/%%currentyear%%/g,this.replaceVars.currentyear).replace(/%%focuskw%%/g,t)},s.prototype.replaceVariablesPlugin=function(e){return void 0!==e&&(e=this.titleReplace(e),e=this.defaultReplace(e),e=this.replaceSeparators(e)),e},s.prototype.replaceSeparators=function(e){return e.replace(/%%sep%%(\s+%%sep%%)*/g,this.replaceVars.sep)},s.prototype.titleReplace=function(e){var t="";return void 0===(t=this.language==WPGlobusCoreData.default_language?l("#title").val():l("#title_"+this.language).val())&&(t=YoastSEO.app.rawData.pageTitle),this.language!=WPGlobusCoreData.default_language&&0==t.length&&(t=l("#title").val()),e=e.replace(/%%title%%/g,t)},s.prototype.doubleSepReplace=function(e){var t=YoastSEO.app.stringHelper.addEscapeChars(this.replaceVars.sep),a=new RegExp(t+" "+t,"g");return e=e.replace(a,this.replaceVars.sep)},s.prototype.updateWpseoKeyword=function(e,t){0<l("#wpseo-meta-section-content_"+t+" .wpseo-keyword").length&&l("#wpseo-meta-section-content_"+t+" .wpseo-keyword").removeClass("wpseo-keyword").addClass("wpglobus-wpseo_keyword_"+t),l(".wpglobus-wpseo_keyword_"+t).text(e)},s.prototype.updatePageAnalysis=function(){l("#wpseo-pageanalysis_"+d.getWPseoTab()).html(l("#wpseo-pageanalysis").html()),l("#yoast-seo-content-analysis_"+d.getWPseoTab()).html(l("#yoast-seo-content-analysis").html()),l("#yoast-seo-content-analysis_"+d.getWPseoTab()+" li a").css({float:"none"})},window.WPGlobusYoastSeoPlugin=new s}});
1
+ var WPGlobusYoastSeo;jQuery(document).ready(function(l){"use strict";var r;if("undefined"!=typeof wpseoReplaceVarsL10n&&("undefined"!=typeof WPGlobusCoreData&&"undefined"!=typeof WPGlobusVendor))if("edit-tags.php"==WPGlobusVendor.pagenow||"term.php"==WPGlobusVendor.pagenow){r=WPGlobusYoastSeo={editorIDs:["description"],editor:{},submitId:"#submit",preventChangeEditor:!1,observer:null,init:function(){r.attachListeners(),_.delay(r.start,1500)},submit:function(e){"mouseenter"===e.type?l.each(r.editor,function(e,t){!r.editor[e].contentEditor||r.editor[e].contentEditor.isHidden()?l("#"+e).val(r.editor[e].content):tinymce.get(e).setContent(r.editor[e].content)}):"mouseleave"===e.type?r.preventChangeEditor||(l.each(r.editor,function(e,t){!r.editor[e].contentEditor||r.editor[e].contentEditor.isHidden()?l("#"+e).val(WPGlobusCore.TextFilter(t.content,r.getCurrentTab(),"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,r.getCurrentTab(),"RETURN_EMPTY"))}),r.preventChangeEditor=!1):"click"===e.type&&(r.preventChangeEditor=!0,"tinymce"!=getUserSetting("editor")&&setUserSetting("editor","tinymce"))},attachListeners:function(){l(".wrap").on("tabsactivate",function(e,a){l.each(r.editor,function(e,t){!r.editor[e].contentEditor||r.editor[e].contentEditor.isHidden()?l("#"+e).val(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY"))})}),l(document).on("mouseenter",r.submitId,r.submit).on("mouseleave",r.submitId,r.submit).on("click",r.submitId,r.submit),l(document).on("tinymce-editor-init",function(e,t){if(-1!=_.indexOf(r.editorIDs,t.id)){var a=l("#"+t.id);r.editor[t.id]={},r.editor[t.id].contentEditor=t,r.editor[t.id].content=a.val(),t.setContent(WPGlobusCore.TextFilter(r.editor[t.id].content,WPGlobusCoreData.default_language,"RETURN_EMPTY")),l("#"+t.getContainer().id).find("iframe").addClass("wpglobus-translatable"),a.removeClass("hidden"),t.on("nodechange keyup",_.debounce(r.update,500)),a.on("input keyup",_.debounce(r.update,500))}})},update:function(e){var t,a;void 0!==e.target&&("tinymce"==(t=e.target.id)&&(t=e.target.dataset.id),void 0!==r.editor[t].contentEditor&&(a=!r.editor[t].contentEditor||r.editor[t].contentEditor.isHidden()?l("#"+t).val():r.editor[t].contentEditor.getContent({format:"raw"}),r.editor[t].content=WPGlobusCore.getString(r.editor[t].content,a,r.getCurrentTab())))},getCurrentTab:function(){return l(".wpglobus-taxonomy-tabs-list .ui-tabs-active").data("language")},start:function(){l(".wpglobus-element_description").css({display:"none"})}},WPGlobusYoastSeo.init();var s=function(){l(".wrap").on("tabsactivate",function(e,t){t.newTab[0].dataset.language==WPGlobusCoreData.default_language?l("#poststuff .inside").css({display:"block"}):l("#poststuff .inside").css({display:"none"})}),l.each(["category_description","sitedesc","sitename","tag_description","term_description","term_title"],function(e,t){wpseoReplaceVarsL10n.replace_vars[t]=WPGlobusCore.TextFilter(wpseoReplaceVarsL10n.replace_vars[t],WPGlobusCoreData.default_language)}),WPGlobusYoastSeo.observer=new MutationObserver(function(e){e.forEach(function(e){if("placeholder"==e.attributeName){WPGlobusYoastSeo.observer.disconnect();var t=l("#wpseo_focuskw");""==t.val()&&t.attr("placeholder",WPGlobusCore.TextFilter(t.attr("placeholder"),WPGlobusCoreData.default_language)),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0})}})}),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0})};window.WPGlobusYoastSeoPlugin=new s}else{var d;r=WPGlobusYoastSeo={wpseoTabSelector:"#wpglobus-wpseo-tabs",url:"",attrs:l("#wpglobus-wpseo-attr"),iB:l("#wpseo-meta-section-content"),t:l("#wpseo-meta-section-content"),ids:"",names:"",editSnippetButtonClass:"wpglobus-snippet-editor__edit-button",editSnippetFormClass:"wpglobus-snippet-editor__form",editSnippetSubmitClass:"wpglobus-snippet-editor__submit",editSnippetHeadingClass:"wpglobus-snippet-editor__heading-editor",yoastTitleProgress:"wpglobus-yoast-title-progress",yoastMetadescProgress:"wpglobus-yoast-metadesc-progress",init:function(){r.start()},initAddKeywordPopup:function(){1===l("#wpseo-add-keyword-popup").length&&l(".wpseo-add-keyword").on("click",r.addKeywordPopup)},addKeywordPopup:function(){var e=l("#wpseo-add-keyword-popup-button").text();tb_show(e,"#TB_inline?width=650&height=350&inlineId=wpseo-add-keyword-popup","group"),jQuery("#TB_window").css("height",235),jQuery("#TB_window").css("width",680)},qtip:function(){l(".yoast_help").qtip({content:{attr:"alt"},position:{my:"bottom left",at:"top center"},style:{tip:{corner:!0},classes:"yoast-qtip qtip-rounded qtip-blue"},show:"click",hide:{fixed:!0,delay:500}})},removeClasses:function(t,e){_.each(e,function(e){t.removeClass(e)})},updateProgressBar:function(e,t){if(void 0!==e&&(void 0!==t||("undefined"!==e.data("language")&&(t=e.data("language")),void 0!==t))){var a,s,o=["snippet-editor__progress--bad","snippet-editor__progress--ok","snippet-editor__progress--good"],i="",n=0,p=!1;s=e.val().length,e.hasClass("wpglobus-snippet-editor-title")?(n=(a=l("progress."+r.yoastTitleProgress+"_"+t)).attr("max"),i=o[2],0==s?i=o[1]:n<s?(i=o[1],p=!0):0<s&&s<35&&(i=o[1])):e.hasClass("wpglobus-snippet-editor-meta-description")&&(n=(a=l("progress."+r.yoastMetadescProgress+"_"+t)).attr("max"),i=o[2],0==s?i=o[1]:n<s?(i=o[1],p=!0):0<s&&s<121&&(i=o[1])),r.removeClasses(a,o),a.attr("value",s).addClass(i),p?e.css("color","#f00"):e.css("color","#000")}},updateWpseoKeyword:function(e,t){l("#wpseo-meta-section-content_"+t+" .wpseo-keyword").text(e)},start:function(){l(r.wpseoTabSelector).tabs(),r.ids=r.attrs.data("ids"),r.names=r.attrs.data("names"),r.ids=r.ids+","+r.attrs.data("qtip"),r.ids=r.ids.split(","),r.names=r.names.split(","),l("#wpglobus-wpseo-tabs").insertBefore(r.iB),l(".wpseo-metabox-tabs").css({height:"26px"}),l(".wpglobus-wpseo-general").each(function(e,t){var a=l(t),s=a.data("language"),o="wpseo-meta-section-content_"+s;a.html('<div id="'+o+'" class="wpseo-meta-section wpglobus-wpseo-meta-section" style="width:100%" data-language="'+s+'">'+r.t.html()+"</div>"),l("#"+o+" .wpseo-metabox-tabs").attr("id","wpseo-metabox-tabs_"+s).attr("data-language",s),l("#"+o+" .wpseotab").attr("id","wpseo_content_"+s),l("#wpseo_content_"+s).css({float:"left"}),l("#"+o).css({display:"block"}),l("#wpseo_meta").css({overflow:"hidden"}),l("#"+o+" .snippet_container").addClass("wpglobus-snippet_container"),s!==WPGlobusCoreData.default_language&&l("#"+o+" .wpseo-add-keyword").addClass("hidden"),l.each(r.names,function(e,t){l("#"+t).attr("name",t+"_"+s)}),l.each(r.ids,function(e,t){var a=l("#"+t);"wpseosnippet"==t&&a.addClass("wpglobus-wpseosnippet"),"snippet_title"==t&&a.addClass("wpglobus-snippet_title"),"snippet_meta"==t&&a.addClass("wpglobus-snippet_meta"),"snippet_cite"==t&&a.addClass("wpglobus-snippet_cite"),"snippet_citeBase"==t&&a.addClass("wpglobus-snippet_citeBase"),"url_container"==t&&a.css({height:"16px"}),"yoast_wpseo_focuskw_text_input"==t&&a.addClass("wpglobus-yoast_wpseo_focuskw_text_input"),"wpseo-pageanalysis"==t&&a.addClass("wpglobus-wpseo-pageanalysis"),"yoast-seo-content-analysis"==t&&a.addClass("wpglobus-yoast-seo-content-analysis"),"snippet_preview"==t&&a.addClass("wpglobus-snippet_preview"),"snippet-editor-title"==t&&(a.addClass("wpglobus-snippet-editor-title"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),a.val(l("#wpseo-tab-"+s).data("wpseotitle")),a.parent("label").next("progress").addClass(r.yoastTitleProgress).addClass(r.yoastTitleProgress+"_"+s),_.debounce(r.updateProgressBar(a,s),500)),"snippet-editor-slug"==t&&(a.addClass("wpglobus-snippet-editor-slug"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),WPGlobusCoreData.default_language!=s&&a.attr("disabled","disabled")),"snippet-editor-meta-description"==t&&(a.addClass("wpglobus-snippet-editor-meta-description"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),a.val(l("#wpseo-tab-"+s).data("metadesc")),a.parent("label").next("progress").addClass(r.yoastMetadescProgress).addClass(r.yoastMetadescProgress+"_"+s),_.debounce(r.updateProgressBar(a,s),500)),"snippetpreview-help-toggle"==t&&(a.addClass("wpglobus-snippetpreview-help-toggle_"+s),l(document).on("click",".wpglobus-snippetpreview-help-toggle_"+s,function(e){var t=l(this);"none"===l("#snippetpreview-help_"+t.data("language")).css("display")?l("#snippetpreview-help_"+t.data("language")).css({display:"block"}):l("#snippetpreview-help_"+t.data("language")).css({display:"none"})})),"focuskw_text_input-help-toggle"==t&&(a.addClass("wpglobus-focuskw_text_input-help-toggle_"+s),l(document).on("click",".wpglobus-focuskw_text_input-help-toggle_"+s,function(e){var t=l(this);"none"===l("#focuskw_text_input-help_"+t.data("language")).css("display")?l("#focuskw_text_input-help_"+t.data("language")).css({display:"block"}):l("#focuskw_text_input-help_"+t.data("language")).css({display:"none"})})),"pageanalysis-help-toggle"==t&&(a.addClass("wpglobus-pageanalysis-help-toggle_"+s),l(document).on("click",".wpglobus-pageanalysis-help-toggle_"+s,function(e){var t=l(this);"none"===l("#pageanalysis-help_"+t.data("language")).css("display")?l("#pageanalysis-help_"+t.data("language")).css({display:"block"}):l("#pageanalysis-help_"+t.data("language")).css({display:"none"})})),a.attr("id",t+"_"+s),l("#"+t+"_"+s).attr("data-language",s)});var i=WPGlobusCore.TextFilter(l("#yoast_wpseo_focuskw_text_input").val(),s,"RETURN_EMPTY");l("#yoast_wpseo_focuskw_text_input_"+s).val(i),l("#yoast_wpseo_focuskw_"+s).val(i),r.updateWpseoKeyword(i,s),s!==WPGlobusCoreData.default_language&&(l("#"+o+" #yoast_wpseo_focuskw_text_input_"+s).addClass("hidden").after('<div class="wpglobus-suggest" style="font-weight:bold;">'+WPGlobusVendor.i18n.yoastseo_plus_access+"</div>"),l("#"+o+" #wpseo-pageanalysis_"+s).addClass("hidden").css({display:"none"}))}),l(".wpglobus-wpseosnippet").each(function(e,t){var a=l(t),s=a.data("language");a.find("button.snippet-editor__button.snippet-editor__edit-button").addClass(r.editSnippetButtonClass).addClass(r.editSnippetButtonClass+"_"+s).attr("data-language",s),a.find(".snippet-editor__form").addClass(r.editSnippetFormClass).addClass(r.editSnippetFormClass+"_"+s),a.find(".snippet-editor__heading-editor").addClass(r.editSnippetHeadingClass).addClass(r.editSnippetHeadingClass+"_"+s),a.find(".snippet-editor__submit").addClass(r.editSnippetSubmitClass).addClass(r.editSnippetSubmitClass+"_"+s).attr("data-language",s)}),r.iB.addClass("hidden"),r.iB.css({height:0,overflow:"hidden",display:"none"});var e=WPGlobusCore.TextFilter(l("#yoast_wpseo_focuskw_text_input").val(),WPGlobusCoreData.default_language,"RETURN_EMPTY");l("#yoast_wpseo_focuskw_text_input").val(e),l("#yoast_wpseo_focuskw").val(e),l(".wpglobus-wpseo-general .wpseo_tablink").on("click",function(e){e.preventDefault();var t=l(this),a=t.parents("ul").data("language"),s=t.parent("li");a!=WPGlobusCoreData.default_language&&void 0===l(document).triggerHandler("wpglobus_yoast_analysis",{language:a})||(s.hasClass("wpseo_generic_tab")?(l("#wpseo-pageanalysis_"+a).css({display:"none"}),l("#yoast-seo-content-analysis_"+a).css({display:"block"}),l("#wpseo_content_"+a+" table tr").eq(0).css({display:"none"}),l("#wpseo_content_"+a+" table tr").eq(1).css({display:"none"}),l("#yoast-seo-content-analysis_"+a+" li a").css({float:"none"})):s.hasClass("wpseo_keyword_tab")&&(l("#wpseo-pageanalysis_"+a).css({display:"block"}),l("#yoast-seo-content-analysis_"+a).css({display:"none"}),l("#wpseo_content_"+a+" table tr").eq(0).css("display",""),l("#wpseo_content_"+a+" table tr").eq(1).css("display","")))}),l(".wpseo-metabox-sidebar .wpseo-meta-section-link").on("click",function(e){"#wpseo-meta-section-content"==l(this).attr("href")?l("#wpglobus-wpseo-tabs").css({display:"block"}):l("#wpglobus-wpseo-tabs").css({display:"none"})}),l("body").on("click","."+r.editSnippetButtonClass,function(e){var t=l(this),a=t.data("language"),s=l("."+r.editSnippetFormClass+"_"+a),o=l("."+r.editSnippetSubmitClass+"_"+a),i=l("."+r.editSnippetHeadingClass+"_"+a);s.hasClass("snippet-editor--hidden")?(s.removeClass("snippet-editor--hidden"),i.removeClass("snippet-editor--hidden"),o.removeClass("snippet-editor--hidden")):(s.addClass("snippet-editor--hidden"),i.addClass("snippet-editor--hidden")),t.addClass("snippet-editor--hidden")}),l("body").on("click","."+r.editSnippetSubmitClass,function(e){var t=l(this).data("language"),a=l("."+r.editSnippetButtonClass+"_"+t),s=l("."+r.editSnippetFormClass+"_"+t),o=l("."+r.editSnippetSubmitClass+"_"+t),i=l("."+r.editSnippetHeadingClass+"_"+t);a.removeClass("snippet-editor--hidden"),s.addClass("snippet-editor--hidden"),o.addClass("snippet-editor--hidden"),i.addClass("snippet-editor--hidden")}),l(document).on("keyup","input.wpglobus-snippet-editor-title",function(e){var t=l(this),a=t.data("language"),s=WPGlobusCore.getString(l('input[name="yoast_wpseo_title"]').val(),t.val(),a);l("#snippet_title_"+a).html(d.replaceVariablesPlugin(t.val())),YoastSEO.app.rawData.pageTitle=s,l('input[name="yoast_wpseo_title"]').val(s),l("#snippet_title").text(s),_.debounce(r.updateProgressBar(t,a),500)}),l(document).on("keyup","input.wpglobus-snippet-editor-slug",function(e){var t=l(this),a=t.data("language");l("#snippet_cite_"+a).text(t.val()+"/"),l("#editable-post-name").text(t.val()),l("#editable-post-name-full").text(t.val())}),l(document).on("change","input.wpglobus-snippet-editor-slug",function(e){var t=l(this);l.post(ajaxurl,{action:"sample-permalink",post_id:l("#post_ID").val()||0,new_slug:t.val(),new_title:l("#title").val(),samplepermalinknonce:l("#samplepermalinknonce").val()})}),l(document).on("keyup","textarea.wpglobus-snippet-editor-meta-description",function(e){var t=l(this),a=t.data("language");l("#snippet_meta_"+a).text(t.val());var s=WPGlobusCore.getString(l("#yoast_wpseo_metadesc").val(),t.val(),t.data("language"));l("#yoast_wpseo_metadesc").val(s),l("#snippet_meta").text(s),_.debounce(r.updateProgressBar(t,a),500)}),l("body").on("click",".wpglobus-post-body-tabs-list li",function(e){var t=l(this);if(t.hasClass("wpglobus-post-tab")){l("#wpglobus-wpseo-tabs").tabs("option","active",t.data("order"));var a=l("#yoast_wpseo_focuskw_text_input_"+l(this).data("language")).val();YoastSEO.app.rawData.keyword=a,l("#yoast_wpseo_focuskw_text_input").val(a),l('input[name="yoast_wpseo_focuskw"]').val(a),s.prototype.analyze()}}),r.initAddKeywordPopup()}},(s=function(){this.replaceVars=wpseoReplaceVarsL10n.replace_vars,this.language=WPGlobusCoreData.default_language,this.tab=WPGlobusCoreData.default_language,this.wpseoTab=WPGlobusCoreData.default_language,this.title_template=wpseoPostScraperL10n.title_template,this.focuskw=l("#yoast_wpseo_focuskw_text_input"),this.focuskw_hidden=l('input[name="yoast_wpseo_focuskw"]'),this.focuskwKeep=!1,this.post_slug="#editable-post-name-full",YoastSEO.app.registerPlugin("wpglobusYoastSeoPlugin",{status:"ready"}),YoastSEO.app.registerModification("content",this.contentModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("title",this.titleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_title",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_meta",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_page_title",this.pageTitleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_meta_desc",this.metaDescModification,"wpglobusYoastSeoPlugin",0),s.prototype.setScoreIcon(),l(document).on("blur",".wpglobus-snippet_title",function(e){var t=l(this),a=WPGlobusCore.getString(l("#yoast_wpseo_title").val(),t.text(),t.data("language"));YoastSEO.app.rawData.pageTitle=a,l('input[name="yoast_wpseo_title"]').val(a),l("#snippet_title").text(a)}),l(document).on("blur",".wpglobus-snippet_meta",function(e){var t=l(this),a=WPGlobusCore.getString(l("#yoast_wpseo_metadesc").val(),t.text(),t.data("language"));l("#yoast_wpseo_metadesc").val(a),l("#snippet_meta").text(a)}),l(document).on("keyup",".wpglobus-yoast_wpseo_focuskw_text_input",function(e){var t=l(this),a=t.val();d.focuskw.val(a),d.focuskw_hidden.val(a),d.updateWpseoKeyword(a,t.data("language")),s.prototype.analyze()}),l("#publish,#save-post").on("mouseenter",function(e){var a,s="";l(".wpglobus-yoast_wpseo_focuskw_text_input").each(function(e,t){a=l(this),s=WPGlobusCore.getString(s,a.val(),a.data("language"))}),d.focuskw.val(s),d.focuskw_hidden.val(s)}).on("mouseleave",function(e){if(!d.focuskwKeep){d.wpseoTab=l(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language");l(this);d.focuskw.val(l("#yoast_wpseo_focuskw_text_input_"+d.wpseoTab).val()),d.focuskw_hidden.val(l("#yoast_wpseo_focuskw_text_input_"+d.wpseoTab).val())}}).on("click",function(e){d.focuskwKeep=!0}),l(WPGlobusYoastSeo.wpseoTabSelector).on("tabsactivate",function(e,t){if(d.language=t.newPanel.attr("data-language"),t.newPanel.attr("data-language")===WPGlobusCoreData.default_language){var a=l("#yoast_wpseo_focuskw_text_input_"+WPGlobusCoreData.default_language).val();YoastSEO.app.rawData.keyword=a,d.focuskw.val(a),d.focuskw_hidden.val(a)}s.prototype.analyze()}),d=this}).prototype.analyze=function(){var e=l(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language");e==WPGlobusCoreData.default_language?YoastSEO.app.snippetPreview.data.urlPath=l("#editable-post-name-full").text():0!=l("#editable-post-name-full-"+e).length?YoastSEO.app.snippetPreview.data.urlPath=l("#editable-post-name-full-"+e).text():YoastSEO.app.snippetPreview.data.urlPath=l("#editable-post-name-full").text(),YoastSEO.app.analyzeTimer(YoastSEO.app),s.prototype.setScoreIcon()},s.prototype.setScoreIcon=function(){var s;s=setInterval(function(){var e=l(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language"),t=l("#wpseo-meta-section-content .wpseo_generic_tab a").data("score"),a=l("#wpseo-meta-section-content .wpseo_keyword_tab a").data("score");""!=t&&(l("#wpseo-metabox-tabs_"+e+" .wpseo_generic_tab .wpseo-score-icon").removeClass("bad ok good 100 na"),l("#wpseo-metabox-tabs_"+e+" .wpseo_generic_tab .wpseo-score-icon").addClass(t)),""!=a&&(l("#wpseo-metabox-tabs_"+e+" .wpseo_keyword_tab .wpseo-score-icon").removeClass("bad ok good 100 na"),l("#wpseo-metabox-tabs_"+e+" .wpseo_keyword_tab .wpseo-score-icon").addClass(a)),clearInterval(s)},1500)},s.prototype.getWPseoTab=function(){return l(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language")},s.prototype.citeModification=function(e){var t="#snippet_citeBase_"+e,a="#snippet_cite_"+e,s=l("#wpseo-tab-"+e).data("yoast-cite-base");!1===l("#wpseo-tab-"+e).data("cite-contenteditable")&&l(a).attr("contenteditable","false"),l(t).text(s)},s.prototype.pageTitleModification=function(e){var a,s,o,i="#snippet_title_",n="",p="";if(d.title_template==e)l.each(WPGlobusCoreData.enabled_languages,function(e,t){s=l("#snippet-editor-title_"+t).val(),o=0==s.length?d.title_template:s,n=d.replaceVariablesPlugin(o),l(i+t).text(n),t==d.getWPseoTab()&&(p=n)});else{if(a=WPGlobusCore.getTranslations(e),d.getWPseoTab()!==WPGlobusCoreData.default_language&&a[WPGlobusCoreData.default_language]==e){var t=d.getWPseoTab();return s=l("#snippet-editor-title_"+t).val(),o=0<s.length?s:d.title_template,o=d.replaceVariablesPlugin(o),l(i+t).text(o),o}l.each(WPGlobusCoreData.enabled_languages,function(e,t){n=""===a[t]?d.replaceVariablesPlugin(d.title_template):d.replaceVariablesPlugin(a[t]),t==d.getWPseoTab()&&(p=n,0!=(s=l("#snippet-editor-title_"+t).val()).length?s!=p&&(p=d.replaceVariablesPlugin(s)):p=d.replaceVariablesPlugin(d.title_template)),l(i+t).html(p)})}return p},s.prototype.metaDescModification=function(a){var e,s="#snippet_meta_",t=WPGlobusCore.getTranslations(a),o="";if(e=l("#snippet-editor-meta-description_"+d.getWPseoTab()).val(),d.getWPseoTab()===WPGlobusCoreData.default_language||t[WPGlobusCoreData.default_language]!=a)return l.each(WPGlobusCoreData.enabled_languages,function(e,t){l(s+t).text(WPGlobusCore.TextFilter(a,t,"RETURN_EMPTY")),d.citeModification(t)}),e==t[d.getWPseoTab()]?0==(o=t[d.getWPseoTab()]).length&&l(s+d.getWPseoTab()).text(WPGlobusCore.TextFilter(YoastSEO.app.snippetPreview.data.metaDesc,WPGlobusCoreData.default_language,"RETURN_EMPTY")):0==(o=e).length?l(s+d.getWPseoTab()).text(WPGlobusCore.TextFilter(YoastSEO.app.snippetPreview.data.metaDesc,WPGlobusCoreData.default_language,"RETURN_EMPTY")):l(s+d.getWPseoTab()).text(o),l(s+d.getWPseoTab()).text(o),o;var i=d.getWPseoTab();return d.citeModification(i),0==e.length?l(s+i).text(""):e!=a&&l(s+i).text(e),a},s.prototype.snippetModification=function(e){return WPGlobusCore.TextFilter(e,d.getWPseoTab(),"RETURN_EMPTY")},s.prototype.contentModification=function(e){return d.getWPseoTab()==WPGlobusCoreData.default_language?e:l("#content_"+d.getWPseoTab()).val()},s.prototype.titleModification=function(e){return setTimeout(d.updatePageAnalysis,1e3),d.getWPseoTab()==WPGlobusCoreData.default_language?e:l("#title_"+d.getWPseoTab()).val()},s.prototype.defaultReplace=function(e){var t=YoastSEO.app.rawData.keyword;return e.replace(/%%sitedesc%%/g,this.replaceVars.sitedesc).replace(/%%sitename%%/g,WPGlobusCore.TextFilter(this.replaceVars.sitename,d.getWPseoTab())).replace(/%%term_title%%/g,this.replaceVars.term_title).replace(/%%term_description%%/g,this.replaceVars.term_description).replace(/%%category_description%%/g,this.replaceVars.category_description).replace(/%%tag_description%%/g,this.replaceVars.tag_description).replace(/%%searchphrase%%/g,this.replaceVars.searchphrase).replace(/%%date%%/g,this.replaceVars.date).replace(/%%id%%/g,this.replaceVars.id).replace(/%%page%%/g,this.replaceVars.page).replace(/%%currenttime%%/g,this.replaceVars.currenttime).replace(/%%currentdate%%/g,this.replaceVars.currentdate).replace(/%%currentday%%/g,this.replaceVars.currentday).replace(/%%currentmonth%%/g,this.replaceVars.currentmonth).replace(/%%currentyear%%/g,this.replaceVars.currentyear).replace(/%%focuskw%%/g,t)},s.prototype.replaceVariablesPlugin=function(e){return void 0!==e&&(e=this.titleReplace(e),e=this.defaultReplace(e),e=this.replaceSeparators(e)),e},s.prototype.replaceSeparators=function(e){return e.replace(/%%sep%%(\s+%%sep%%)*/g,this.replaceVars.sep)},s.prototype.titleReplace=function(e){var t="";return void 0===(t=this.language==WPGlobusCoreData.default_language?l("#title").val():l("#title_"+this.language).val())&&(t=YoastSEO.app.rawData.pageTitle),this.language!=WPGlobusCoreData.default_language&&0==t.length&&(t=l("#title").val()),e=e.replace(/%%title%%/g,t)},s.prototype.doubleSepReplace=function(e){var t=YoastSEO.app.stringHelper.addEscapeChars(this.replaceVars.sep),a=new RegExp(t+" "+t,"g");return e=e.replace(a,this.replaceVars.sep)},s.prototype.updateWpseoKeyword=function(e,t){0<l("#wpseo-meta-section-content_"+t+" .wpseo-keyword").length&&l("#wpseo-meta-section-content_"+t+" .wpseo-keyword").removeClass("wpseo-keyword").addClass("wpglobus-wpseo_keyword_"+t),l(".wpglobus-wpseo_keyword_"+t).text(e)},s.prototype.updatePageAnalysis=function(){l("#wpseo-pageanalysis_"+d.getWPseoTab()).html(l("#wpseo-pageanalysis").html()),l("#yoast-seo-content-analysis_"+d.getWPseoTab()).html(l("#yoast-seo-content-analysis").html()),l("#yoast-seo-content-analysis_"+d.getWPseoTab()+" li a").css({float:"none"})},window.WPGlobusYoastSeoPlugin=new s}});
includes/js/wpglobus-yoastseo-40.min.js CHANGED
@@ -1 +1 @@
1
- var WPGlobusYoastSeo,WPGlobusYoastSeoPremium=!1;jQuery(document).ready(function(p){"use strict";var r;if("undefined"!=typeof wpseoReplaceVarsL10n&&("undefined"!=typeof WPGlobusCoreData&&"undefined"!=typeof WPGlobusVendor))if("edit-tags.php"==WPGlobusVendor.pagenow||"term.php"==WPGlobusVendor.pagenow){r=WPGlobusYoastSeo={editorIDs:["description"],editor:{},submitId:"#submit",preventChangeEditor:!1,observer:null,init:function(){r.attachListeners(),_.delay(r.start,1500)},submit:function(e){"mouseenter"===e.type?p.each(r.editor,function(e,t){!r.editor[e].contentEditor||r.editor[e].contentEditor.isHidden()?p("#"+e).val(r.editor[e].content):tinymce.get(e).setContent(r.editor[e].content)}):"mouseleave"===e.type?r.preventChangeEditor||(p.each(r.editor,function(e,t){!r.editor[e].contentEditor||r.editor[e].contentEditor.isHidden()?p("#"+e).val(WPGlobusCore.TextFilter(t.content,r.getCurrentTab(),"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,r.getCurrentTab(),"RETURN_EMPTY"))}),r.preventChangeEditor=!1):"click"===e.type&&(r.preventChangeEditor=!0,"tinymce"!=getUserSetting("editor")&&setUserSetting("editor","tinymce"))},attachListeners:function(){p(".wrap").on("tabsactivate",function(e,a){p.each(r.editor,function(e,t){!r.editor[e].contentEditor||r.editor[e].contentEditor.isHidden()?p("#"+e).val(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY"))})}),p(document).on("mouseenter",r.submitId,r.submit).on("mouseleave",r.submitId,r.submit).on("click",r.submitId,r.submit),p(document).on("tinymce-editor-init",function(e,t){if(-1!=_.indexOf(r.editorIDs,t.id)){var a=p("#"+t.id);r.editor[t.id]={},r.editor[t.id].contentEditor=t,r.editor[t.id].content=a.val(),t.setContent(WPGlobusCore.TextFilter(r.editor[t.id].content,WPGlobusCoreData.default_language,"RETURN_EMPTY")),p("#"+t.getContainer().id).find("iframe").addClass("wpglobus-translatable"),a.removeClass("hidden"),t.on("nodechange keyup",_.debounce(r.update,500)),a.on("input keyup",_.debounce(r.update,500))}})},update:function(e){var t,a;void 0!==e.target&&("tinymce"==(t=e.target.id)&&(t=e.target.dataset.id),void 0!==r.editor[t].contentEditor&&(a=!r.editor[t].contentEditor||r.editor[t].contentEditor.isHidden()?p("#"+t).val():r.editor[t].contentEditor.getContent({format:"raw"}),r.editor[t].content=WPGlobusCore.getString(r.editor[t].content,a,r.getCurrentTab())))},getCurrentTab:function(){return p(".wpglobus-taxonomy-tabs-list .ui-tabs-active").data("language")},start:function(){p(".wpglobus-element_description").css({display:"none"})}},WPGlobusYoastSeo.init();var n=function(){p(".wrap").on("tabsactivate",function(e,t){t.newTab[0].dataset.language==WPGlobusCoreData.default_language?p("#poststuff .inside").css({display:"block"}):p("#poststuff .inside").css({display:"none"})}),p.each(["category_description","sitedesc","sitename","tag_description","term_description","term_title"],function(e,t){wpseoReplaceVarsL10n.replace_vars[t]=WPGlobusCore.TextFilter(wpseoReplaceVarsL10n.replace_vars[t],WPGlobusCoreData.default_language)}),WPGlobusYoastSeo.observer=new MutationObserver(function(e){e.forEach(function(e){if("placeholder"==e.attributeName){WPGlobusYoastSeo.observer.disconnect();var t=p("#wpseo_focuskw");""==t.val()&&t.attr("placeholder",WPGlobusCore.TextFilter(t.attr("placeholder"),WPGlobusCoreData.default_language)),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0})}})}),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0})};window.WPGlobusYoastSeoPlugin=new n}else{var d;r=WPGlobusYoastSeo={wpseoTabSelector:"#wpglobus-wpseo-tabs",url:"",attrs:p("#wpglobus-wpseo-attr"),iB:p("#wpseo-meta-section-content"),t:p("#wpseo-meta-section-content"),ids:"",names:"",wpseoTab:WPGlobusCoreData.default_language,editSnippetButtonClass:"wpglobus-snippet-editor__edit-button",editSnippetFormClass:"wpglobus-snippet-editor__form",editSnippetSubmitClass:"wpglobus-snippet-editor__submit",editSnippetHeadingClass:"wpglobus-snippet-editor__heading-editor",yoastTitleProgress:"wpglobus-yoast-title-progress",yoastMetadescProgress:"wpglobus-yoast-metadesc-progress",yoastPremium:WPGlobusVendor.vendor.WPSEO_PREMIUM,keywordIndex:{},init:function(){p.each(WPGlobusCoreData.enabled_languages,function(e,t){r.keywordIndex[t]=0}),r.start()},initAddKeywordPopup:function(){1==p("#wpseo-add-keyword-popup").length?p(".wpseo-add-keyword").on("click",r.addKeywordPopup):WPGlobusYoastSeoPremium&&WPGlobusYoastSeoPremium.addKeywordButton()},addKeywordPopup:function(){var e=p("#wpseo-add-keyword-popup-button").text();tb_show(e,"#TB_inline?width=650&height=350&inlineId=wpseo-add-keyword-popup","group"),p("#TB_window").css("height",235),p("#TB_window").css("width",680)},qtip:function(){p(".yoast_help").qtip({content:{attr:"alt"},position:{my:"bottom left",at:"top center"},style:{tip:{corner:!0},classes:"yoast-qtip qtip-rounded qtip-blue"},show:"click",hide:{fixed:!0,delay:500}})},removeClasses:function(t,e){_.each(e,function(e){t.removeClass(e)})},updateProgressBar:function(e,t){if(void 0!==e&&(void 0!==t||("undefined"!==e.data("language")&&(t=e.data("language")),void 0!==t))){var a,s,o=["snippet-editor__progress--bad","snippet-editor__progress--ok","snippet-editor__progress--good"],n="",i=0,l=!1;s=e.val().length,e.hasClass("wpglobus-snippet-editor-title")?(i=(a=p("progress."+r.yoastTitleProgress+"_"+t)).attr("max"),n=o[2],0==s?n=o[1]:i<s?(n=o[1],l=!0):0<s&&s<35&&(n=o[1])):e.hasClass("wpglobus-snippet-editor-meta-description")&&(i=(a=p("progress."+r.yoastMetadescProgress+"_"+t)).attr("max"),n=o[2],0==s?n=o[1]:i<s?(n=o[1],l=!0):0<s&&s<121&&(n=o[1])),r.removeClasses(a,o),a.attr("value",s).addClass(n),l?e.css("color","#f00"):e.css("color","#000")}},updateWpseoKeyword:function(e,t){p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").text(e)},start:function(){p(r.wpseoTabSelector).tabs(),r.ids=r.attrs.data("ids"),r.names=r.attrs.data("names"),r.ids=r.ids+","+r.attrs.data("qtip"),r.ids=r.ids.split(","),r.names=r.names.split(","),p("#wpglobus-wpseo-tabs").insertBefore(r.iB),p(".wpseo-metabox-tabs").css({height:"26px"}),p(".wpglobus-wpseo-general").each(function(e,t){var a=p(t),s=a.data("language"),o="wpseo-meta-section-content_"+s;a.html('<div id="'+o+'" class="wpseo-meta-section wpglobus-wpseo-meta-section" style="width:100%" data-language="'+s+'">'+r.t.html()+"</div>"),p("#"+o+" .wpseo-metabox-tabs").attr("id","wpseo-metabox-tabs_"+s).attr("data-language",s),p("#"+o+" .wpseotab").attr("id","wpseo_content_"+s),p("#wpseo_content_"+s).css({float:"left"}),p("#"+o).css({display:"block"}),p("#wpseo_meta").css({overflow:"hidden"}),p("#"+o+" .snippet_container").addClass("wpglobus-snippet_container"),s!==WPGlobusCoreData.default_language&&p("#"+o+" .wpseo-add-keyword").addClass("hidden"),p.each(r.names,function(e,t){p("#"+t).attr("name",t+"_"+s)}),p.each(r.ids,function(e,t){var a=p("#"+t);"wpseosnippet"==t&&a.addClass("wpglobus-wpseosnippet"),"snippet_title"==t&&a.addClass("wpglobus-snippet_title"),"snippet_meta"==t&&a.addClass("wpglobus-snippet_meta"),"snippet_cite"==t&&a.addClass("wpglobus-snippet_cite"),"snippet_citeBase"==t&&a.addClass("wpglobus-snippet_citeBase"),"url_container"==t&&a.css({height:"16px"}),"yoast_wpseo_focuskw_text_input"==t&&(a.addClass("wpglobus-yoast_wpseo_focuskw_text_input"),a.attr("data-value",""),a.parents("div#wpseofocuskeyword").attr("id","wpseofocuskeyword_"+s)),"yoast_wpseo_focuskeywords"==t&&a.addClass("wpglobus-yoast_wpseo_focuskeywords"),"wpseo-pageanalysis"==t&&a.addClass("wpglobus-wpseo-pageanalysis"),"yoast-seo-content-analysis"==t&&a.addClass("wpglobus-yoast-seo-content-analysis"),"snippet_preview"==t&&a.addClass("wpglobus-snippet_preview"),"snippet-editor-title"==t&&(a.addClass("wpglobus-snippet-editor-title"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),a.val(p("#wpseo-tab-"+s).data("wpseotitle")),a.parent("label").next("progress").addClass(r.yoastTitleProgress).addClass(r.yoastTitleProgress+"_"+s),_.debounce(r.updateProgressBar(a,s),500)),"snippet-editor-slug"==t&&(a.addClass("wpglobus-snippet-editor-slug"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),WPGlobusCoreData.default_language!=s&&a.attr("disabled","disabled")),"snippet-editor-meta-description"==t&&(a.addClass("wpglobus-snippet-editor-meta-description"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),a.val(p("#wpseo-tab-"+s).data("metadesc")),a.parent("label").next("progress").addClass(r.yoastMetadescProgress).addClass(r.yoastMetadescProgress+"_"+s),_.debounce(r.updateProgressBar(a,s),500)),"snippetpreview-help-toggle"==t&&(a.addClass("wpglobus-snippetpreview-help-toggle_"+s),p(document).on("click",".wpglobus-snippetpreview-help-toggle_"+s,function(e){var t=p(this);"none"===p("#snippetpreview-help_"+t.data("language")).css("display")?p("#snippetpreview-help_"+t.data("language")).css({display:"block"}):p("#snippetpreview-help_"+t.data("language")).css({display:"none"})})),"focuskw_text_input-help-toggle"==t&&(a.addClass("wpglobus-focuskw_text_input-help-toggle_"+s),p(document).on("click",".wpglobus-focuskw_text_input-help-toggle_"+s,function(e){var t=p(this);"none"===p("#focuskw_text_input-help_"+t.data("language")).css("display")?p("#focuskw_text_input-help_"+t.data("language")).css({display:"block"}):p("#focuskw_text_input-help_"+t.data("language")).css({display:"none"})})),"pageanalysis-help-toggle"==t&&(a.addClass("wpglobus-pageanalysis-help-toggle_"+s),p(document).on("click",".wpglobus-pageanalysis-help-toggle_"+s,function(e){var t=p(this);"none"===p("#pageanalysis-help_"+t.data("language")).css("display")?p("#pageanalysis-help_"+t.data("language")).css({display:"block"}):p("#pageanalysis-help_"+t.data("language")).css({display:"none"})})),a.attr("id",t+"_"+s),p("#"+t+"_"+s).attr("data-language",s)});var n=WPGlobusCore.TextFilter(p("#yoast_wpseo_focuskw_text_input").val(),s,"RETURN_EMPTY");p("#yoast_wpseo_focuskw_text_input_"+s).val(n).data("value",n),p("#yoast_wpseo_focuskw_"+s).val(n),r.updateWpseoKeyword(n,s),s!==WPGlobusCoreData.default_language&&(p("#"+o+" #yoast_wpseo_focuskw_text_input_"+s).addClass("hidden").after('<div class="wpglobus-suggest" style="font-weight:bold;">'+WPGlobusVendor.i18n.yoastseo_plus_access+"</div>"),p("#"+o+" #wpseo-pageanalysis_"+s).addClass("hidden").css({display:"none"})),WPGlobusYoastSeoPremium&&(s==WPGlobusCoreData.default_language||(p("#wpseo-metabox-tabs_"+s+" .wpseo_keyword_tab").removeClass("wpseo_keyword_tab").addClass("wpglobus-wpseo_keyword_tab"),p("#wpseo-meta-section-content_"+s+" .wpseo_keyword_tab_hideable").css({display:"none"}).attr("data-language",s)))}),p(".wpglobus-wpseosnippet").each(function(e,t){var a=p(t),s=a.data("language");a.find("button.snippet-editor__button.snippet-editor__edit-button").addClass(r.editSnippetButtonClass).addClass(r.editSnippetButtonClass+"_"+s).attr("data-language",s),a.find(".snippet-editor__form").addClass(r.editSnippetFormClass).addClass(r.editSnippetFormClass+"_"+s),a.find(".snippet-editor__heading-editor").addClass(r.editSnippetHeadingClass).addClass(r.editSnippetHeadingClass+"_"+s),a.find(".snippet-editor__submit").addClass(r.editSnippetSubmitClass).addClass(r.editSnippetSubmitClass+"_"+s).attr("data-language",s)}),r.iB.addClass("hidden"),r.iB.css({height:0,overflow:"hidden",display:"none"}),WPGlobusYoastSeoPremium&&p("#wpseo-meta-section-content .wpseo_keyword_tab").removeClass("wpseo_keyword_tab").addClass("wpseo_keyword_tab_original");var e=WPGlobusCore.TextFilter(p("#yoast_wpseo_focuskw_text_input").val(),WPGlobusCoreData.default_language,"RETURN_EMPTY");p("#yoast_wpseo_focuskw_text_input").val(e),p("#yoast_wpseo_focuskw").val(e),p(document).on("click",".wpglobus-wpseo-general .wpseo_tablink",function(e){e.preventDefault();var t=p(this),a=t.parents("ul").data("language"),s=t.parent("li");if(a==WPGlobusCoreData.default_language||void 0!==p(document).triggerHandler("wpglobus_yoast_analysis",{language:a}))if(s.hasClass("wpseo_generic_tab"))p("#wpseo-pageanalysis_"+a).css({display:"none"}),p("#yoast-seo-content-analysis_"+a).css({display:"block"}),p("#wpseo_content_"+a+" table tr").eq(0).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(1).css({display:"none"}),p("#yoast-seo-content-analysis_"+a+" li a").css({float:"none"});else if(s.hasClass("wpseo_keyword_tab")){WPGlobusYoastSeoPremium&&(p("#wpseo-meta-section-content_"+a+" .wpseo_keyword_tab").removeClass("active"),t.parent(".wpseo_keyword_tab").addClass("active"),p("#wpseo-metabox-tabs_"+a+" .wpseo_keyword_tab").each(function(e,t){if(p(t).hasClass("active"))return r.keywordIndex[a]=e,!1}));var o=r.getKeywordsOrig()[r.keywordIndex[a]].keyword;YoastSEO.app.rawData.keyword=o,p("#yoast_wpseo_focuskw_text_input").val(o),p("#yoast_wpseo_focuskw_text_input_"+a).val(o),p('input[name="yoast_wpseo_focuskw"]').val(o),n.prototype.analyze(),p("#wpseo-pageanalysis_"+a).css({display:"block"}),p("#yoast-seo-content-analysis_"+a).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(0).css("display",""),p("#wpseo_content_"+a+" table tr").eq(1).css("display","")}else s.hasClass("wpglobus-wpseo_keyword_tab")}),p(".wpseo-metabox-sidebar .wpseo-meta-section-link").on("click",function(e){"#wpseo-meta-section-content"==p(this).attr("href")?p("#wpglobus-wpseo-tabs").css({display:"block"}):p("#wpglobus-wpseo-tabs").css({display:"none"})}),p(document).on("click","."+r.editSnippetButtonClass,function(e){var t=p(this),a=t.data("language"),s=p("."+r.editSnippetFormClass+"_"+a),o=p("."+r.editSnippetSubmitClass+"_"+a),n=p("."+r.editSnippetHeadingClass+"_"+a);s.hasClass("snippet-editor--hidden")?(s.removeClass("snippet-editor--hidden"),n.removeClass("snippet-editor--hidden"),o.removeClass("snippet-editor--hidden")):(s.addClass("snippet-editor--hidden"),n.addClass("snippet-editor--hidden")),t.addClass("snippet-editor--hidden")}),p(document).on("click","."+r.editSnippetSubmitClass,function(e){var t=p(this).data("language"),a=p("."+r.editSnippetButtonClass+"_"+t),s=p("."+r.editSnippetFormClass+"_"+t),o=p("."+r.editSnippetSubmitClass+"_"+t),n=p("."+r.editSnippetHeadingClass+"_"+t);a.removeClass("snippet-editor--hidden"),s.addClass("snippet-editor--hidden"),o.addClass("snippet-editor--hidden"),n.addClass("snippet-editor--hidden")}),p(document).on("keyup","input.wpglobus-snippet-editor-title",function(e){var t=p(this),a=t.data("language"),s=WPGlobusCore.getString(p('input[name="yoast_wpseo_title"]').val(),t.val(),a);p("#snippet_title_"+a).html(d.replaceVariablesPlugin(t.val())),YoastSEO.app.rawData.pageTitle=s,p('input[name="yoast_wpseo_title"]').val(s),p("#snippet_title").text(s),_.debounce(r.updateProgressBar(t,a),500)}),p(document).on("keyup","input.wpglobus-snippet-editor-slug",function(e){var t=p(this),a=t.data("language");p("#snippet_cite_"+a).text(t.val()+"/"),p("#editable-post-name").text(t.val()),p("#editable-post-name-full").text(t.val())}),p(document).on("change","input.wpglobus-snippet-editor-slug",function(e){var t=p(this);p.post(ajaxurl,{action:"sample-permalink",post_id:p("#post_ID").val()||0,new_slug:t.val(),new_title:p("#title").val(),samplepermalinknonce:p("#samplepermalinknonce").val()})}),p(document).on("keyup","textarea.wpglobus-snippet-editor-meta-description",function(e){var t=p(this),a=t.data("language");p("#snippet_meta_"+a).text(t.val());var s=WPGlobusCore.getString(p("#yoast_wpseo_metadesc").val(),t.val(),t.data("language"));p("#yoast_wpseo_metadesc").val(s),p("#snippet_meta").text(s),_.debounce(r.updateProgressBar(t,a),500)}),p(document).on("click",".wpglobus-post-body-tabs-list li",function(e){var t=p(this);if(t.hasClass("wpglobus-post-tab")){p("#wpglobus-wpseo-tabs").tabs("option","active",t.data("order"));var a=p("#yoast_wpseo_focuskw_text_input_"+t.data("language")).val();YoastSEO.app.rawData.keyword=a,p("#yoast_wpseo_focuskw_text_input").val(a),p('input[name="yoast_wpseo_focuskw"]').val(a),n.prototype.analyze()}}),r.initAddKeywordPopup()},getKeywordsOrig:function(){return p(".wpseo_keyword_tab").map(function(e,t){return{keyword:(t=p(t).find(".wpseo_tablink")).data("keyword")+"",score:t.data("score")}}).get()}},(n=function(){this.replaceVars=wpseoReplaceVarsL10n.replace_vars,this.language=WPGlobusCoreData.default_language,this.tab=WPGlobusCoreData.default_language,this.wpseoTab=WPGlobusCoreData.default_language,this.title_template=wpseoPostScraperL10n.title_template,this.focuskw=p("#yoast_wpseo_focuskw_text_input"),this.focuskw_hidden=p('input[name="yoast_wpseo_focuskw"]'),this.focuskwKeep=!1,this.post_slug="#editable-post-name-full",YoastSEO.app.registerPlugin("wpglobusYoastSeoPlugin",{status:"ready"}),YoastSEO.app.registerModification("content",this.contentModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("title",this.titleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_title",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_meta",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_page_title",this.pageTitleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_meta_desc",this.metaDescModification,"wpglobusYoastSeoPlugin",0),n.prototype.setScoreIcon(),p(document).on("blur",".wpglobus-snippet_title",function(e){var t=p(this),a=WPGlobusCore.getString(p("#yoast_wpseo_title").val(),t.text(),t.data("language"));YoastSEO.app.rawData.pageTitle=a,p('input[name="yoast_wpseo_title"]').val(a),p("#snippet_title").text(a)}),p(document).on("blur",".wpglobus-snippet_meta",function(e){var t=p(this),a=WPGlobusCore.getString(p("#yoast_wpseo_metadesc").val(),t.text(),t.data("language"));p("#yoast_wpseo_metadesc").val(a),p("#snippet_meta").text(a)}),p(document).on("keyup",".wpglobus-yoast_wpseo_focuskw_text_input",function(e){var t=p(this),a=t.val(),s=t.data("language");d.focuskw.val(a),d.focuskw_hidden.val(a),d.updateWpseoKeyword(a,s),0==WPGlobusYoastSeo.keywordIndex[s]?p("#yoast_wpseo_focuskw_text_input_"+s).data("value",a):WPGlobusYoastSeoPremium&&WPGlobusYoastSeoPremium.setFocuskeyword(s),n.prototype.analyze()}),p("#publish,#save-post").on("mouseenter",function(e){var s,o="";p(".wpglobus-yoast_wpseo_focuskw_text_input").each(function(e,t){if((s=p(this)).data("language")==WPGlobusCoreData.default_language)if(WPGlobusYoastSeoPremium){var a=WPGlobusYoastSeo.getKeywordsOrig();o=WPGlobusCore.getString(o,a[0].keyword,s.data("language"))}else o=WPGlobusCore.getString(o,s.val(),s.data("language"));else o=WPGlobusCore.getString(o,s.val(),s.data("language"))}),d.focuskw.val(o),d.focuskw_hidden.val(o)}).on("mouseleave",function(e){if(!d.focuskwKeep){d.wpseoTab=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language");p(this);d.focuskw.val(p("#yoast_wpseo_focuskw_text_input_"+d.wpseoTab).val()),d.focuskw_hidden.val(p("#yoast_wpseo_focuskw_text_input_"+d.wpseoTab).val())}}).on("click",function(e){d.focuskwKeep=!0}),p(document).on("tabsactivate",WPGlobusYoastSeo.wpseoTabSelector,function(e,t){if(d.language=t.newPanel.attr("data-language"),WPGlobusYoastSeo.wpseoTab=d.language,t.newPanel.attr("data-language")===WPGlobusCoreData.default_language){var a;if(WPGlobusYoastSeoPremium)p("#wpseo-meta-section-content_"+WPGlobusYoastSeoPremium.dLang+" .wpseo_keyword_tab").removeClass("active"),p("#wpseo-meta-section-content_"+WPGlobusYoastSeoPremium.dLang+" .wpseo_keyword_tab").eq(WPGlobusYoastSeo.keywordIndex[WPGlobusYoastSeoPremium.dLang]).addClass("active"),a=p("#yoast_wpseo_focuskw_text_input_"+WPGlobusYoastSeoPremium.dLang).val();else a=p("#yoast_wpseo_focuskw_text_input_"+WPGlobusCoreData.default_language).val();YoastSEO.app.rawData.keyword=a,d.focuskw.val(a),d.focuskw_hidden.val(a)}p("#wpseo-metabox-tabs_"+d.language+" .wpseo_keyword_tab").each(function(e,t){if(p(t).hasClass("active"))return WPGlobusYoastSeo.keywordIndex[d.language]=e,!1}),n.prototype.analyze()}),d=this}).prototype.analyze=function(){var e=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language");e==WPGlobusCoreData.default_language?YoastSEO.app.snippetPreview.data.urlPath=p("#editable-post-name-full").text():0!=p("#editable-post-name-full-"+e).length?YoastSEO.app.snippetPreview.data.urlPath=p("#editable-post-name-full-"+e).text():YoastSEO.app.snippetPreview.data.urlPath=p("#editable-post-name-full").text(),YoastSEO.app.analyzeTimer(YoastSEO.app),n.prototype.setScoreIcon()},n.prototype.setScoreIcon=function(){var s;s=setInterval(function(){var e=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language"),t=p("#wpseo-meta-section-content .wpseo_generic_tab a").data("score"),a=p("#wpseo-meta-section-content .wpseo_keyword_tab a").data("score");""!=t&&(p("#wpseo-metabox-tabs_"+e+" .wpseo_generic_tab .wpseo-score-icon").removeClass("bad ok good 100 na"),p("#wpseo-metabox-tabs_"+e+" .wpseo_generic_tab .wpseo-score-icon").addClass(t)),""!=a&&(p("#wpseo-metabox-tabs_"+e+" .wpseo_keyword_tab .wpseo-score-icon").removeClass("bad ok good 100 na"),p("#wpseo-metabox-tabs_"+e+" .wpseo_keyword_tab .wpseo-score-icon").addClass(a)),clearInterval(s)},1500)},n.prototype.getWPseoTab=function(){return p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language")},n.prototype.citeModification=function(e){var t="#snippet_citeBase_"+e,a="#snippet_cite_"+e,s=p("#wpseo-tab-"+e).data("yoast-cite-base");!1===p("#wpseo-tab-"+e).data("cite-contenteditable")&&p(a).attr("contenteditable","false"),p(t).text(s)},n.prototype.pageTitleModification=function(e){var a,s,o,n="#snippet_title_",i="",l="";if(d.title_template==e)p.each(WPGlobusCoreData.enabled_languages,function(e,t){s=p("#snippet-editor-title_"+t).val(),o=0==s.length?d.title_template:s,i=d.replaceVariablesPlugin(o),p(n+t).text(i),t==d.getWPseoTab()&&(l=i)});else{if(a=WPGlobusCore.getTranslations(e),d.getWPseoTab()!==WPGlobusCoreData.default_language&&a[WPGlobusCoreData.default_language]==e){var t=d.getWPseoTab();return s=p("#snippet-editor-title_"+t).val(),o=0<s.length?s:d.title_template,o=d.replaceVariablesPlugin(o),p(n+t).text(o),o}p.each(WPGlobusCoreData.enabled_languages,function(e,t){i=""===a[t]?d.replaceVariablesPlugin(d.title_template):d.replaceVariablesPlugin(a[t]),t==d.getWPseoTab()&&(l=i,0!=(s=p("#snippet-editor-title_"+t).val()).length?s!=l&&(l=d.replaceVariablesPlugin(s)):l=d.replaceVariablesPlugin(d.title_template)),p(n+t).html(l)})}return l},n.prototype.metaDescModification=function(a){var e,s="#snippet_meta_",t=WPGlobusCore.getTranslations(a),o="";if(e=p("#snippet-editor-meta-description_"+d.getWPseoTab()).val(),d.getWPseoTab()!==WPGlobusCoreData.default_language&&t[WPGlobusCoreData.default_language]==a){var n=d.getWPseoTab();return d.citeModification(n),0==e.length?p(s+n).text(""):e!=a&&p(s+n).text(e),a}return p.each(WPGlobusCoreData.enabled_languages,function(e,t){p(s+t).text(WPGlobusCore.TextFilter(a,t,"RETURN_EMPTY")),d.citeModification(t)}),e==t[d.getWPseoTab()]?0==(o=t[d.getWPseoTab()]).length&&p(s+d.getWPseoTab()).text(WPGlobusCore.TextFilter(YoastSEO.app.snippetPreview.data.metaDesc,WPGlobusCoreData.default_language,"RETURN_EMPTY")):0==(o=e).length?p(s+d.getWPseoTab()).text(WPGlobusCore.TextFilter(YoastSEO.app.snippetPreview.data.metaDesc,WPGlobusCoreData.default_language,"RETURN_EMPTY")):p(s+d.getWPseoTab()).text(o),p(s+d.getWPseoTab()).text(o),o},n.prototype.snippetModification=function(e){return WPGlobusCore.TextFilter(e,d.getWPseoTab(),"RETURN_EMPTY")},n.prototype.contentModification=function(e){return d.getWPseoTab()==WPGlobusCoreData.default_language?e:p("#content_"+d.getWPseoTab()).val()},n.prototype.titleModification=function(e){return setTimeout(d.updatePageAnalysis,1e3),d.getWPseoTab()==WPGlobusCoreData.default_language?e:p("#title_"+d.getWPseoTab()).val()},n.prototype.defaultReplace=function(e){var t=YoastSEO.app.rawData.keyword;return e.replace(/%%sitedesc%%/g,this.replaceVars.sitedesc).replace(/%%sitename%%/g,WPGlobusCore.TextFilter(this.replaceVars.sitename,d.getWPseoTab())).replace(/%%term_title%%/g,this.replaceVars.term_title).replace(/%%term_description%%/g,this.replaceVars.term_description).replace(/%%category_description%%/g,this.replaceVars.category_description).replace(/%%tag_description%%/g,this.replaceVars.tag_description).replace(/%%searchphrase%%/g,this.replaceVars.searchphrase).replace(/%%date%%/g,this.replaceVars.date).replace(/%%id%%/g,this.replaceVars.id).replace(/%%page%%/g,this.replaceVars.page).replace(/%%currenttime%%/g,this.replaceVars.currenttime).replace(/%%currentdate%%/g,this.replaceVars.currentdate).replace(/%%currentday%%/g,this.replaceVars.currentday).replace(/%%currentmonth%%/g,this.replaceVars.currentmonth).replace(/%%currentyear%%/g,this.replaceVars.currentyear).replace(/%%focuskw%%/g,t)},n.prototype.replaceVariablesPlugin=function(e){return void 0!==e&&(e=this.titleReplace(e),e=this.defaultReplace(e),e=this.replaceSeparators(e)),e},n.prototype.replaceSeparators=function(e){return e.replace(/%%sep%%(\s+%%sep%%)*/g,this.replaceVars.sep)},n.prototype.titleReplace=function(e){var t="";return void 0===(t=this.language==WPGlobusCoreData.default_language?p("#title").val():p("#title_"+this.language).val())&&(t=YoastSEO.app.rawData.pageTitle),this.language!=WPGlobusCoreData.default_language&&0==t.length&&(t=p("#title").val()),e=e.replace(/%%title%%/g,t)},n.prototype.doubleSepReplace=function(e){var t=YoastSEO.app.stringHelper.addEscapeChars(this.replaceVars.sep),a=new RegExp(t+" "+t,"g");return e=e.replace(a,this.replaceVars.sep)},n.prototype.updateWpseoKeyword=function(e,t){0<p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").length&&p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").removeClass("wpseo-keyword").addClass("wpglobus-wpseo_keyword_"+t),p(".wpglobus-wpseo_keyword_"+t).text(e)},n.prototype.updatePageAnalysis=function(){p("#wpseo-pageanalysis_"+d.getWPseoTab()).html(p("#wpseo-pageanalysis").html()),p("#yoast-seo-content-analysis_"+d.getWPseoTab()).html(p("#yoast-seo-content-analysis").html()),p("#yoast-seo-content-analysis_"+d.getWPseoTab()+" li a").css({float:"none"})},window.WPGlobusYoastSeoPlugin=new n}});
1
+ var WPGlobusYoastSeo,WPGlobusYoastSeoPremium=!1;jQuery(document).ready(function(p){"use strict";var r;if("undefined"!=typeof wpseoReplaceVarsL10n&&("undefined"!=typeof WPGlobusCoreData&&"undefined"!=typeof WPGlobusVendor))if("edit-tags.php"==WPGlobusVendor.pagenow||"term.php"==WPGlobusVendor.pagenow){r=WPGlobusYoastSeo={editorIDs:["description"],editor:{},submitId:"#submit",preventChangeEditor:!1,observer:null,init:function(){r.attachListeners(),_.delay(r.start,1500)},submit:function(e){"mouseenter"===e.type?p.each(r.editor,function(e,t){!r.editor[e].contentEditor||r.editor[e].contentEditor.isHidden()?p("#"+e).val(r.editor[e].content):tinymce.get(e).setContent(r.editor[e].content)}):"mouseleave"===e.type?r.preventChangeEditor||(p.each(r.editor,function(e,t){!r.editor[e].contentEditor||r.editor[e].contentEditor.isHidden()?p("#"+e).val(WPGlobusCore.TextFilter(t.content,r.getCurrentTab(),"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,r.getCurrentTab(),"RETURN_EMPTY"))}),r.preventChangeEditor=!1):"click"===e.type&&(r.preventChangeEditor=!0,"tinymce"!=getUserSetting("editor")&&setUserSetting("editor","tinymce"))},attachListeners:function(){p(".wrap").on("tabsactivate",function(e,a){p.each(r.editor,function(e,t){!r.editor[e].contentEditor||r.editor[e].contentEditor.isHidden()?p("#"+e).val(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY"))})}),p(document).on("mouseenter",r.submitId,r.submit).on("mouseleave",r.submitId,r.submit).on("click",r.submitId,r.submit),p(document).on("tinymce-editor-init",function(e,t){if(-1!=_.indexOf(r.editorIDs,t.id)){var a=p("#"+t.id);r.editor[t.id]={},r.editor[t.id].contentEditor=t,r.editor[t.id].content=a.val(),t.setContent(WPGlobusCore.TextFilter(r.editor[t.id].content,WPGlobusCoreData.default_language,"RETURN_EMPTY")),p("#"+t.getContainer().id).find("iframe").addClass("wpglobus-translatable"),a.removeClass("hidden"),t.on("nodechange keyup",_.debounce(r.update,500)),a.on("input keyup",_.debounce(r.update,500))}})},update:function(e){var t,a;void 0!==e.target&&("tinymce"==(t=e.target.id)&&(t=e.target.dataset.id),void 0!==r.editor[t].contentEditor&&(a=!r.editor[t].contentEditor||r.editor[t].contentEditor.isHidden()?p("#"+t).val():r.editor[t].contentEditor.getContent({format:"raw"}),r.editor[t].content=WPGlobusCore.getString(r.editor[t].content,a,r.getCurrentTab())))},getCurrentTab:function(){return p(".wpglobus-taxonomy-tabs-list .ui-tabs-active").data("language")},start:function(){p(".wpglobus-element_description").css({display:"none"})}},WPGlobusYoastSeo.init();var n=function(){p(".wrap").on("tabsactivate",function(e,t){t.newTab[0].dataset.language==WPGlobusCoreData.default_language?p("#poststuff .inside").css({display:"block"}):p("#poststuff .inside").css({display:"none"})}),p.each(["category_description","sitedesc","sitename","tag_description","term_description","term_title"],function(e,t){wpseoReplaceVarsL10n.replace_vars[t]=WPGlobusCore.TextFilter(wpseoReplaceVarsL10n.replace_vars[t],WPGlobusCoreData.default_language)}),WPGlobusYoastSeo.observer=new MutationObserver(function(e){e.forEach(function(e){if("placeholder"==e.attributeName){WPGlobusYoastSeo.observer.disconnect();var t=p("#wpseo_focuskw");""==t.val()&&t.attr("placeholder",WPGlobusCore.TextFilter(t.attr("placeholder"),WPGlobusCoreData.default_language)),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0})}})}),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0})};window.WPGlobusYoastSeoPlugin=new n}else{var d;r=WPGlobusYoastSeo={wpseoTabSelector:"#wpglobus-wpseo-tabs",url:"",attrs:p("#wpglobus-wpseo-attr"),iB:p("#wpseo-meta-section-content"),t:p("#wpseo-meta-section-content"),ids:"",names:"",wpseoTab:WPGlobusCoreData.default_language,editSnippetButtonClass:"wpglobus-snippet-editor__edit-button",editSnippetFormClass:"wpglobus-snippet-editor__form",editSnippetSubmitClass:"wpglobus-snippet-editor__submit",editSnippetHeadingClass:"wpglobus-snippet-editor__heading-editor",yoastTitleProgress:"wpglobus-yoast-title-progress",yoastMetadescProgress:"wpglobus-yoast-metadesc-progress",yoastPremium:WPGlobusVendor.vendor.WPSEO_PREMIUM,keywordIndex:{},init:function(){p.each(WPGlobusCoreData.enabled_languages,function(e,t){r.keywordIndex[t]=0}),r.start()},initAddKeywordPopup:function(){1==p("#wpseo-add-keyword-popup").length?p(".wpseo-add-keyword").on("click",r.addKeywordPopup):WPGlobusYoastSeoPremium&&WPGlobusYoastSeoPremium.addKeywordButton()},addKeywordPopup:function(){var e=p("#wpseo-add-keyword-popup-button").text();tb_show(e,"#TB_inline?width=650&height=350&inlineId=wpseo-add-keyword-popup","group"),p("#TB_window").css("height",235),p("#TB_window").css("width",680)},qtip:function(){p(".yoast_help").qtip({content:{attr:"alt"},position:{my:"bottom left",at:"top center"},style:{tip:{corner:!0},classes:"yoast-qtip qtip-rounded qtip-blue"},show:"click",hide:{fixed:!0,delay:500}})},removeClasses:function(t,e){_.each(e,function(e){t.removeClass(e)})},updateProgressBar:function(e,t){if(void 0!==e&&(void 0!==t||("undefined"!==e.data("language")&&(t=e.data("language")),void 0!==t))){var a,s,o=["snippet-editor__progress--bad","snippet-editor__progress--ok","snippet-editor__progress--good"],n="",i=0,l=!1;s=e.val().length,e.hasClass("wpglobus-snippet-editor-title")?(i=(a=p("progress."+r.yoastTitleProgress+"_"+t)).attr("max"),n=o[2],0==s?n=o[1]:i<s?(n=o[1],l=!0):0<s&&s<35&&(n=o[1])):e.hasClass("wpglobus-snippet-editor-meta-description")&&(i=(a=p("progress."+r.yoastMetadescProgress+"_"+t)).attr("max"),n=o[2],0==s?n=o[1]:i<s?(n=o[1],l=!0):0<s&&s<121&&(n=o[1])),r.removeClasses(a,o),a.attr("value",s).addClass(n),l?e.css("color","#f00"):e.css("color","#000")}},updateWpseoKeyword:function(e,t){p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").text(e)},start:function(){p(r.wpseoTabSelector).tabs(),r.ids=r.attrs.data("ids"),r.names=r.attrs.data("names"),r.ids=r.ids+","+r.attrs.data("qtip"),r.ids=r.ids.split(","),r.names=r.names.split(","),p("#wpglobus-wpseo-tabs").insertBefore(r.iB),p(".wpseo-metabox-tabs").css({height:"26px"}),p(".wpglobus-wpseo-general").each(function(e,t){var a=p(t),s=a.data("language"),o="wpseo-meta-section-content_"+s;a.html('<div id="'+o+'" class="wpseo-meta-section wpglobus-wpseo-meta-section" style="width:100%" data-language="'+s+'">'+r.t.html()+"</div>"),p("#"+o+" .wpseo-metabox-tabs").attr("id","wpseo-metabox-tabs_"+s).attr("data-language",s),p("#"+o+" .wpseotab").attr("id","wpseo_content_"+s),p("#wpseo_content_"+s).css({float:"left"}),p("#"+o).css({display:"block"}),p("#wpseo_meta").css({overflow:"hidden"}),p("#"+o+" .snippet_container").addClass("wpglobus-snippet_container"),s!==WPGlobusCoreData.default_language&&p("#"+o+" .wpseo-add-keyword").addClass("hidden"),p.each(r.names,function(e,t){p("#"+t).attr("name",t+"_"+s)}),p.each(r.ids,function(e,t){var a=p("#"+t);"wpseosnippet"==t&&a.addClass("wpglobus-wpseosnippet"),"snippet_title"==t&&a.addClass("wpglobus-snippet_title"),"snippet_meta"==t&&a.addClass("wpglobus-snippet_meta"),"snippet_cite"==t&&a.addClass("wpglobus-snippet_cite"),"snippet_citeBase"==t&&a.addClass("wpglobus-snippet_citeBase"),"url_container"==t&&a.css({height:"16px"}),"yoast_wpseo_focuskw_text_input"==t&&(a.addClass("wpglobus-yoast_wpseo_focuskw_text_input"),a.attr("data-value",""),a.parents("div#wpseofocuskeyword").attr("id","wpseofocuskeyword_"+s)),"yoast_wpseo_focuskeywords"==t&&a.addClass("wpglobus-yoast_wpseo_focuskeywords"),"wpseo-pageanalysis"==t&&a.addClass("wpglobus-wpseo-pageanalysis"),"yoast-seo-content-analysis"==t&&a.addClass("wpglobus-yoast-seo-content-analysis"),"snippet_preview"==t&&a.addClass("wpglobus-snippet_preview"),"snippet-editor-title"==t&&(a.addClass("wpglobus-snippet-editor-title"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),a.val(p("#wpseo-tab-"+s).data("wpseotitle")),a.parent("label").next("progress").addClass(r.yoastTitleProgress).addClass(r.yoastTitleProgress+"_"+s),_.debounce(r.updateProgressBar(a,s),500)),"snippet-editor-slug"==t&&(a.addClass("wpglobus-snippet-editor-slug"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),WPGlobusCoreData.default_language!=s&&a.attr("disabled","disabled")),"snippet-editor-meta-description"==t&&(a.addClass("wpglobus-snippet-editor-meta-description"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),a.val(p("#wpseo-tab-"+s).data("metadesc")),a.parent("label").next("progress").addClass(r.yoastMetadescProgress).addClass(r.yoastMetadescProgress+"_"+s),_.debounce(r.updateProgressBar(a,s),500)),"snippetpreview-help-toggle"==t&&(a.addClass("wpglobus-snippetpreview-help-toggle_"+s),p(document).on("click",".wpglobus-snippetpreview-help-toggle_"+s,function(e){var t=p(this);"none"===p("#snippetpreview-help_"+t.data("language")).css("display")?p("#snippetpreview-help_"+t.data("language")).css({display:"block"}):p("#snippetpreview-help_"+t.data("language")).css({display:"none"})})),"focuskw_text_input-help-toggle"==t&&(a.addClass("wpglobus-focuskw_text_input-help-toggle_"+s),p(document).on("click",".wpglobus-focuskw_text_input-help-toggle_"+s,function(e){var t=p(this);"none"===p("#focuskw_text_input-help_"+t.data("language")).css("display")?p("#focuskw_text_input-help_"+t.data("language")).css({display:"block"}):p("#focuskw_text_input-help_"+t.data("language")).css({display:"none"})})),"pageanalysis-help-toggle"==t&&(a.addClass("wpglobus-pageanalysis-help-toggle_"+s),p(document).on("click",".wpglobus-pageanalysis-help-toggle_"+s,function(e){var t=p(this);"none"===p("#pageanalysis-help_"+t.data("language")).css("display")?p("#pageanalysis-help_"+t.data("language")).css({display:"block"}):p("#pageanalysis-help_"+t.data("language")).css({display:"none"})})),a.attr("id",t+"_"+s),p("#"+t+"_"+s).attr("data-language",s)});var n=WPGlobusCore.TextFilter(p("#yoast_wpseo_focuskw_text_input").val(),s,"RETURN_EMPTY");p("#yoast_wpseo_focuskw_text_input_"+s).val(n).data("value",n),p("#yoast_wpseo_focuskw_"+s).val(n),r.updateWpseoKeyword(n,s),s!==WPGlobusCoreData.default_language&&(p("#"+o+" #yoast_wpseo_focuskw_text_input_"+s).addClass("hidden").after('<div class="wpglobus-suggest" style="font-weight:bold;">'+WPGlobusVendor.i18n.yoastseo_plus_access+"</div>"),p("#"+o+" #wpseo-pageanalysis_"+s).addClass("hidden").css({display:"none"})),WPGlobusYoastSeoPremium&&(s==WPGlobusCoreData.default_language||(p("#wpseo-metabox-tabs_"+s+" .wpseo_keyword_tab").removeClass("wpseo_keyword_tab").addClass("wpglobus-wpseo_keyword_tab"),p("#wpseo-meta-section-content_"+s+" .wpseo_keyword_tab_hideable").css({display:"none"}).attr("data-language",s)))}),p(".wpglobus-wpseosnippet").each(function(e,t){var a=p(t),s=a.data("language");a.find("button.snippet-editor__button.snippet-editor__edit-button").addClass(r.editSnippetButtonClass).addClass(r.editSnippetButtonClass+"_"+s).attr("data-language",s),a.find(".snippet-editor__form").addClass(r.editSnippetFormClass).addClass(r.editSnippetFormClass+"_"+s),a.find(".snippet-editor__heading-editor").addClass(r.editSnippetHeadingClass).addClass(r.editSnippetHeadingClass+"_"+s),a.find(".snippet-editor__submit").addClass(r.editSnippetSubmitClass).addClass(r.editSnippetSubmitClass+"_"+s).attr("data-language",s)}),r.iB.addClass("hidden"),r.iB.css({height:0,overflow:"hidden",display:"none"}),WPGlobusYoastSeoPremium&&p("#wpseo-meta-section-content .wpseo_keyword_tab").removeClass("wpseo_keyword_tab").addClass("wpseo_keyword_tab_original");var e=WPGlobusCore.TextFilter(p("#yoast_wpseo_focuskw_text_input").val(),WPGlobusCoreData.default_language,"RETURN_EMPTY");p("#yoast_wpseo_focuskw_text_input").val(e),p("#yoast_wpseo_focuskw").val(e),p(document).on("click",".wpglobus-wpseo-general .wpseo_tablink",function(e){e.preventDefault();var t=p(this),a=t.parents("ul").data("language"),s=t.parent("li");if(a==WPGlobusCoreData.default_language||void 0!==p(document).triggerHandler("wpglobus_yoast_analysis",{language:a}))if(s.hasClass("wpseo_generic_tab"))p("#wpseo-pageanalysis_"+a).css({display:"none"}),p("#yoast-seo-content-analysis_"+a).css({display:"block"}),p("#wpseo_content_"+a+" table tr").eq(0).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(1).css({display:"none"}),p("#yoast-seo-content-analysis_"+a+" li a").css({float:"none"});else if(s.hasClass("wpseo_keyword_tab")){WPGlobusYoastSeoPremium&&(p("#wpseo-meta-section-content_"+a+" .wpseo_keyword_tab").removeClass("active"),t.parent(".wpseo_keyword_tab").addClass("active"),p("#wpseo-metabox-tabs_"+a+" .wpseo_keyword_tab").each(function(e,t){if(p(t).hasClass("active"))return r.keywordIndex[a]=e,!1}));var o=r.getKeywordsOrig()[r.keywordIndex[a]].keyword;YoastSEO.app.rawData.keyword=o,p("#yoast_wpseo_focuskw_text_input").val(o),p("#yoast_wpseo_focuskw_text_input_"+a).val(o),p('input[name="yoast_wpseo_focuskw"]').val(o),n.prototype.analyze(),p("#wpseo-pageanalysis_"+a).css({display:"block"}),p("#yoast-seo-content-analysis_"+a).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(0).css("display",""),p("#wpseo_content_"+a+" table tr").eq(1).css("display","")}else s.hasClass("wpglobus-wpseo_keyword_tab")}),p(".wpseo-metabox-sidebar .wpseo-meta-section-link").on("click",function(e){"#wpseo-meta-section-content"==p(this).attr("href")?p("#wpglobus-wpseo-tabs").css({display:"block"}):p("#wpglobus-wpseo-tabs").css({display:"none"})}),p(document).on("click","."+r.editSnippetButtonClass,function(e){var t=p(this),a=t.data("language"),s=p("."+r.editSnippetFormClass+"_"+a),o=p("."+r.editSnippetSubmitClass+"_"+a),n=p("."+r.editSnippetHeadingClass+"_"+a);s.hasClass("snippet-editor--hidden")?(s.removeClass("snippet-editor--hidden"),n.removeClass("snippet-editor--hidden"),o.removeClass("snippet-editor--hidden")):(s.addClass("snippet-editor--hidden"),n.addClass("snippet-editor--hidden")),t.addClass("snippet-editor--hidden")}),p(document).on("click","."+r.editSnippetSubmitClass,function(e){var t=p(this).data("language"),a=p("."+r.editSnippetButtonClass+"_"+t),s=p("."+r.editSnippetFormClass+"_"+t),o=p("."+r.editSnippetSubmitClass+"_"+t),n=p("."+r.editSnippetHeadingClass+"_"+t);a.removeClass("snippet-editor--hidden"),s.addClass("snippet-editor--hidden"),o.addClass("snippet-editor--hidden"),n.addClass("snippet-editor--hidden")}),p(document).on("keyup","input.wpglobus-snippet-editor-title",function(e){var t=p(this),a=t.data("language"),s=WPGlobusCore.getString(p('input[name="yoast_wpseo_title"]').val(),t.val(),a);p("#snippet_title_"+a).html(d.replaceVariablesPlugin(t.val())),YoastSEO.app.rawData.pageTitle=s,p('input[name="yoast_wpseo_title"]').val(s),p("#snippet_title").text(s),_.debounce(r.updateProgressBar(t,a),500)}),p(document).on("keyup","input.wpglobus-snippet-editor-slug",function(e){var t=p(this),a=t.data("language");p("#snippet_cite_"+a).text(t.val()+"/"),p("#editable-post-name").text(t.val()),p("#editable-post-name-full").text(t.val())}),p(document).on("change","input.wpglobus-snippet-editor-slug",function(e){var t=p(this);p.post(ajaxurl,{action:"sample-permalink",post_id:p("#post_ID").val()||0,new_slug:t.val(),new_title:p("#title").val(),samplepermalinknonce:p("#samplepermalinknonce").val()})}),p(document).on("keyup","textarea.wpglobus-snippet-editor-meta-description",function(e){var t=p(this),a=t.data("language");p("#snippet_meta_"+a).text(t.val());var s=WPGlobusCore.getString(p("#yoast_wpseo_metadesc").val(),t.val(),t.data("language"));p("#yoast_wpseo_metadesc").val(s),p("#snippet_meta").text(s),_.debounce(r.updateProgressBar(t,a),500)}),p(document).on("click",".wpglobus-post-body-tabs-list li",function(e){var t=p(this);if(t.hasClass("wpglobus-post-tab")){p("#wpglobus-wpseo-tabs").tabs("option","active",t.data("order"));var a=p("#yoast_wpseo_focuskw_text_input_"+t.data("language")).val();YoastSEO.app.rawData.keyword=a,p("#yoast_wpseo_focuskw_text_input").val(a),p('input[name="yoast_wpseo_focuskw"]').val(a),n.prototype.analyze()}}),r.initAddKeywordPopup()},getKeywordsOrig:function(){return p(".wpseo_keyword_tab").map(function(e,t){return{keyword:(t=p(t).find(".wpseo_tablink")).data("keyword")+"",score:t.data("score")}}).get()}},(n=function(){this.replaceVars=wpseoReplaceVarsL10n.replace_vars,this.language=WPGlobusCoreData.default_language,this.tab=WPGlobusCoreData.default_language,this.wpseoTab=WPGlobusCoreData.default_language,this.title_template=wpseoPostScraperL10n.title_template,this.focuskw=p("#yoast_wpseo_focuskw_text_input"),this.focuskw_hidden=p('input[name="yoast_wpseo_focuskw"]'),this.focuskwKeep=!1,this.post_slug="#editable-post-name-full",YoastSEO.app.registerPlugin("wpglobusYoastSeoPlugin",{status:"ready"}),YoastSEO.app.registerModification("content",this.contentModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("title",this.titleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_title",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_meta",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_page_title",this.pageTitleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_meta_desc",this.metaDescModification,"wpglobusYoastSeoPlugin",0),n.prototype.setScoreIcon(),p(document).on("blur",".wpglobus-snippet_title",function(e){var t=p(this),a=WPGlobusCore.getString(p("#yoast_wpseo_title").val(),t.text(),t.data("language"));YoastSEO.app.rawData.pageTitle=a,p('input[name="yoast_wpseo_title"]').val(a),p("#snippet_title").text(a)}),p(document).on("blur",".wpglobus-snippet_meta",function(e){var t=p(this),a=WPGlobusCore.getString(p("#yoast_wpseo_metadesc").val(),t.text(),t.data("language"));p("#yoast_wpseo_metadesc").val(a),p("#snippet_meta").text(a)}),p(document).on("keyup",".wpglobus-yoast_wpseo_focuskw_text_input",function(e){var t=p(this),a=t.val(),s=t.data("language");d.focuskw.val(a),d.focuskw_hidden.val(a),d.updateWpseoKeyword(a,s),0==WPGlobusYoastSeo.keywordIndex[s]?p("#yoast_wpseo_focuskw_text_input_"+s).data("value",a):WPGlobusYoastSeoPremium&&WPGlobusYoastSeoPremium.setFocuskeyword(s),n.prototype.analyze()}),p("#publish,#save-post").on("mouseenter",function(e){var s,o="";p(".wpglobus-yoast_wpseo_focuskw_text_input").each(function(e,t){if((s=p(this)).data("language")==WPGlobusCoreData.default_language)if(WPGlobusYoastSeoPremium){var a=WPGlobusYoastSeo.getKeywordsOrig();o=WPGlobusCore.getString(o,a[0].keyword,s.data("language"))}else o=WPGlobusCore.getString(o,s.val(),s.data("language"));else o=WPGlobusCore.getString(o,s.val(),s.data("language"))}),d.focuskw.val(o),d.focuskw_hidden.val(o)}).on("mouseleave",function(e){if(!d.focuskwKeep){d.wpseoTab=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language");p(this);d.focuskw.val(p("#yoast_wpseo_focuskw_text_input_"+d.wpseoTab).val()),d.focuskw_hidden.val(p("#yoast_wpseo_focuskw_text_input_"+d.wpseoTab).val())}}).on("click",function(e){d.focuskwKeep=!0}),p(document).on("tabsactivate",WPGlobusYoastSeo.wpseoTabSelector,function(e,t){if(d.language=t.newPanel.attr("data-language"),WPGlobusYoastSeo.wpseoTab=d.language,t.newPanel.attr("data-language")===WPGlobusCoreData.default_language){var a;if(WPGlobusYoastSeoPremium)p("#wpseo-meta-section-content_"+WPGlobusYoastSeoPremium.dLang+" .wpseo_keyword_tab").removeClass("active"),p("#wpseo-meta-section-content_"+WPGlobusYoastSeoPremium.dLang+" .wpseo_keyword_tab").eq(WPGlobusYoastSeo.keywordIndex[WPGlobusYoastSeoPremium.dLang]).addClass("active"),a=p("#yoast_wpseo_focuskw_text_input_"+WPGlobusYoastSeoPremium.dLang).val();else a=p("#yoast_wpseo_focuskw_text_input_"+WPGlobusCoreData.default_language).val();YoastSEO.app.rawData.keyword=a,d.focuskw.val(a),d.focuskw_hidden.val(a)}p("#wpseo-metabox-tabs_"+d.language+" .wpseo_keyword_tab").each(function(e,t){if(p(t).hasClass("active"))return WPGlobusYoastSeo.keywordIndex[d.language]=e,!1}),n.prototype.analyze()}),d=this}).prototype.analyze=function(){var e=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language");e==WPGlobusCoreData.default_language?YoastSEO.app.snippetPreview.data.urlPath=p("#editable-post-name-full").text():0!=p("#editable-post-name-full-"+e).length?YoastSEO.app.snippetPreview.data.urlPath=p("#editable-post-name-full-"+e).text():YoastSEO.app.snippetPreview.data.urlPath=p("#editable-post-name-full").text(),YoastSEO.app.analyzeTimer(YoastSEO.app),n.prototype.setScoreIcon()},n.prototype.setScoreIcon=function(){var s;s=setInterval(function(){var e=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language"),t=p("#wpseo-meta-section-content .wpseo_generic_tab a").data("score"),a=p("#wpseo-meta-section-content .wpseo_keyword_tab a").data("score");""!=t&&(p("#wpseo-metabox-tabs_"+e+" .wpseo_generic_tab .wpseo-score-icon").removeClass("bad ok good 100 na"),p("#wpseo-metabox-tabs_"+e+" .wpseo_generic_tab .wpseo-score-icon").addClass(t)),""!=a&&(p("#wpseo-metabox-tabs_"+e+" .wpseo_keyword_tab .wpseo-score-icon").removeClass("bad ok good 100 na"),p("#wpseo-metabox-tabs_"+e+" .wpseo_keyword_tab .wpseo-score-icon").addClass(a)),clearInterval(s)},1500)},n.prototype.getWPseoTab=function(){return p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language")},n.prototype.citeModification=function(e){var t="#snippet_citeBase_"+e,a="#snippet_cite_"+e,s=p("#wpseo-tab-"+e).data("yoast-cite-base");!1===p("#wpseo-tab-"+e).data("cite-contenteditable")&&p(a).attr("contenteditable","false"),p(t).text(s)},n.prototype.pageTitleModification=function(e){var a,s,o,n="#snippet_title_",i="",l="";if(d.title_template==e)p.each(WPGlobusCoreData.enabled_languages,function(e,t){s=p("#snippet-editor-title_"+t).val(),o=0==s.length?d.title_template:s,i=d.replaceVariablesPlugin(o),p(n+t).text(i),t==d.getWPseoTab()&&(l=i)});else{if(a=WPGlobusCore.getTranslations(e),d.getWPseoTab()!==WPGlobusCoreData.default_language&&a[WPGlobusCoreData.default_language]==e){var t=d.getWPseoTab();return s=p("#snippet-editor-title_"+t).val(),o=0<s.length?s:d.title_template,o=d.replaceVariablesPlugin(o),p(n+t).text(o),o}p.each(WPGlobusCoreData.enabled_languages,function(e,t){i=""===a[t]?d.replaceVariablesPlugin(d.title_template):d.replaceVariablesPlugin(a[t]),t==d.getWPseoTab()&&(l=i,0!=(s=p("#snippet-editor-title_"+t).val()).length?s!=l&&(l=d.replaceVariablesPlugin(s)):l=d.replaceVariablesPlugin(d.title_template)),p(n+t).html(l)})}return l},n.prototype.metaDescModification=function(a){var e,s="#snippet_meta_",t=WPGlobusCore.getTranslations(a),o="";if(e=p("#snippet-editor-meta-description_"+d.getWPseoTab()).val(),d.getWPseoTab()===WPGlobusCoreData.default_language||t[WPGlobusCoreData.default_language]!=a)return p.each(WPGlobusCoreData.enabled_languages,function(e,t){p(s+t).text(WPGlobusCore.TextFilter(a,t,"RETURN_EMPTY")),d.citeModification(t)}),e==t[d.getWPseoTab()]?0==(o=t[d.getWPseoTab()]).length&&p(s+d.getWPseoTab()).text(WPGlobusCore.TextFilter(YoastSEO.app.snippetPreview.data.metaDesc,WPGlobusCoreData.default_language,"RETURN_EMPTY")):0==(o=e).length?p(s+d.getWPseoTab()).text(WPGlobusCore.TextFilter(YoastSEO.app.snippetPreview.data.metaDesc,WPGlobusCoreData.default_language,"RETURN_EMPTY")):p(s+d.getWPseoTab()).text(o),p(s+d.getWPseoTab()).text(o),o;var n=d.getWPseoTab();return d.citeModification(n),0==e.length?p(s+n).text(""):e!=a&&p(s+n).text(e),a},n.prototype.snippetModification=function(e){return WPGlobusCore.TextFilter(e,d.getWPseoTab(),"RETURN_EMPTY")},n.prototype.contentModification=function(e){return d.getWPseoTab()==WPGlobusCoreData.default_language?e:p("#content_"+d.getWPseoTab()).val()},n.prototype.titleModification=function(e){return setTimeout(d.updatePageAnalysis,1e3),d.getWPseoTab()==WPGlobusCoreData.default_language?e:p("#title_"+d.getWPseoTab()).val()},n.prototype.defaultReplace=function(e){var t=YoastSEO.app.rawData.keyword;return e.replace(/%%sitedesc%%/g,this.replaceVars.sitedesc).replace(/%%sitename%%/g,WPGlobusCore.TextFilter(this.replaceVars.sitename,d.getWPseoTab())).replace(/%%term_title%%/g,this.replaceVars.term_title).replace(/%%term_description%%/g,this.replaceVars.term_description).replace(/%%category_description%%/g,this.replaceVars.category_description).replace(/%%tag_description%%/g,this.replaceVars.tag_description).replace(/%%searchphrase%%/g,this.replaceVars.searchphrase).replace(/%%date%%/g,this.replaceVars.date).replace(/%%id%%/g,this.replaceVars.id).replace(/%%page%%/g,this.replaceVars.page).replace(/%%currenttime%%/g,this.replaceVars.currenttime).replace(/%%currentdate%%/g,this.replaceVars.currentdate).replace(/%%currentday%%/g,this.replaceVars.currentday).replace(/%%currentmonth%%/g,this.replaceVars.currentmonth).replace(/%%currentyear%%/g,this.replaceVars.currentyear).replace(/%%focuskw%%/g,t)},n.prototype.replaceVariablesPlugin=function(e){return void 0!==e&&(e=this.titleReplace(e),e=this.defaultReplace(e),e=this.replaceSeparators(e)),e},n.prototype.replaceSeparators=function(e){return e.replace(/%%sep%%(\s+%%sep%%)*/g,this.replaceVars.sep)},n.prototype.titleReplace=function(e){var t="";return void 0===(t=this.language==WPGlobusCoreData.default_language?p("#title").val():p("#title_"+this.language).val())&&(t=YoastSEO.app.rawData.pageTitle),this.language!=WPGlobusCoreData.default_language&&0==t.length&&(t=p("#title").val()),e=e.replace(/%%title%%/g,t)},n.prototype.doubleSepReplace=function(e){var t=YoastSEO.app.stringHelper.addEscapeChars(this.replaceVars.sep),a=new RegExp(t+" "+t,"g");return e=e.replace(a,this.replaceVars.sep)},n.prototype.updateWpseoKeyword=function(e,t){0<p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").length&&p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").removeClass("wpseo-keyword").addClass("wpglobus-wpseo_keyword_"+t),p(".wpglobus-wpseo_keyword_"+t).text(e)},n.prototype.updatePageAnalysis=function(){p("#wpseo-pageanalysis_"+d.getWPseoTab()).html(p("#wpseo-pageanalysis").html()),p("#yoast-seo-content-analysis_"+d.getWPseoTab()).html(p("#yoast-seo-content-analysis").html()),p("#yoast-seo-content-analysis_"+d.getWPseoTab()+" li a").css({float:"none"})},window.WPGlobusYoastSeoPlugin=new n}});
includes/js/wpglobus-yoastseo-41.min.js CHANGED
@@ -1 +1 @@
1
- var WPGlobusYoastSeo,WPGlobusYoastSeoPremium=!1;jQuery(document).ready(function(p){"use strict";var r;if("undefined"!=typeof wpseoReplaceVarsL10n&&("undefined"!=typeof WPGlobusCoreData&&"undefined"!=typeof WPGlobusVendor))if("edit-tags.php"==WPGlobusVendor.pagenow||"term.php"==WPGlobusVendor.pagenow){r=WPGlobusYoastSeo={editorIDs:["description"],editor:{},submitId:"#submit",preventChangeEditor:!1,observer:null,init:function(){r.attachListeners(),_.delay(r.start,1500)},submit:function(e){"mouseenter"===e.type?p.each(r.editor,function(e,t){!r.editor[e].contentEditor||r.editor[e].contentEditor.isHidden()?p("#"+e).val(r.editor[e].content):tinymce.get(e).setContent(r.editor[e].content)}):"mouseleave"===e.type?r.preventChangeEditor||(p.each(r.editor,function(e,t){!r.editor[e].contentEditor||r.editor[e].contentEditor.isHidden()?p("#"+e).val(WPGlobusCore.TextFilter(t.content,r.getCurrentTab(),"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,r.getCurrentTab(),"RETURN_EMPTY"))}),r.preventChangeEditor=!1):"click"===e.type&&(r.preventChangeEditor=!0,"tinymce"!=getUserSetting("editor")&&setUserSetting("editor","tinymce"))},attachListeners:function(){p(".wrap").on("tabsactivate",function(e,a){p.each(r.editor,function(e,t){!r.editor[e].contentEditor||r.editor[e].contentEditor.isHidden()?p("#"+e).val(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY"))})}),p(document).on("mouseenter",r.submitId,r.submit).on("mouseleave",r.submitId,r.submit).on("click",r.submitId,r.submit),p(document).on("tinymce-editor-init",function(e,t){if(-1!=_.indexOf(r.editorIDs,t.id)){var a=p("#"+t.id);r.editor[t.id]={},r.editor[t.id].contentEditor=t,r.editor[t.id].content=a.val(),t.setContent(WPGlobusCore.TextFilter(r.editor[t.id].content,WPGlobusCoreData.default_language,"RETURN_EMPTY")),p("#"+t.getContainer().id).find("iframe").addClass("wpglobus-translatable"),a.removeClass("hidden"),t.on("nodechange keyup",_.debounce(r.update,500)),a.on("input keyup",_.debounce(r.update,500))}})},update:function(e){var t,a;void 0!==e.target&&("tinymce"==(t=e.target.id)&&(t=e.target.dataset.id),void 0!==r.editor[t].contentEditor&&(a=!r.editor[t].contentEditor||r.editor[t].contentEditor.isHidden()?p("#"+t).val():r.editor[t].contentEditor.getContent({format:"raw"}),r.editor[t].content=WPGlobusCore.getString(r.editor[t].content,a,r.getCurrentTab())))},getCurrentTab:function(){return p(".wpglobus-taxonomy-tabs-list .ui-tabs-active").data("language")},start:function(){p(".wpglobus-element_description").css({display:"none"})}},WPGlobusYoastSeo.init();var n=function(){p(".wrap").on("tabsactivate",function(e,t){t.newTab[0].dataset.language==WPGlobusCoreData.default_language?p("#poststuff .inside").css({display:"block"}):p("#poststuff .inside").css({display:"none"})}),p.each(["category_description","sitedesc","sitename","tag_description","term_description","term_title"],function(e,t){wpseoReplaceVarsL10n.replace_vars[t]=WPGlobusCore.TextFilter(wpseoReplaceVarsL10n.replace_vars[t],WPGlobusCoreData.default_language)}),WPGlobusYoastSeo.observer=new MutationObserver(function(e){e.forEach(function(e){if("placeholder"==e.attributeName){WPGlobusYoastSeo.observer.disconnect();var t=p("#wpseo_focuskw");""==t.val()&&t.attr("placeholder",WPGlobusCore.TextFilter(t.attr("placeholder"),WPGlobusCoreData.default_language)),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0})}})}),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0})};window.WPGlobusYoastSeoPlugin=new n}else{var d;r=WPGlobusYoastSeo={wpseoTabSelector:"#wpglobus-wpseo-tabs",url:"",attrs:p("#wpglobus-wpseo-attr"),iB:p("#wpseo-meta-section-content"),t:p("#wpseo-meta-section-content"),ids:"",names:"",wpseoTab:WPGlobusCoreData.default_language,editSnippetButtonClass:"wpglobus-snippet-editor__edit-button",editSnippetFormClass:"wpglobus-snippet-editor__form",editSnippetSubmitClass:"wpglobus-snippet-editor__submit",editSnippetHeadingClass:"wpglobus-snippet-editor__heading-editor",yoastTitleProgress:"wpglobus-yoast-title-progress",yoastMetadescProgress:"wpglobus-yoast-metadesc-progress",yoastPremium:WPGlobusVendor.vendor.WPSEO_PREMIUM,keywordIndex:{},init:function(){p.each(WPGlobusCoreData.enabled_languages,function(e,t){r.keywordIndex[t]=0}),r.start()},initAddKeywordPopup:function(){1==p("#wpseo-add-keyword-popup").length?p(".wpseo-add-keyword").on("click",r.addKeywordPopup):WPGlobusYoastSeoPremium&&WPGlobusYoastSeoPremium.addKeywordButton()},addKeywordPopup:function(){var e=p("#wpseo-add-keyword-popup-button").text();tb_show(e,"#TB_inline?width=650&height=350&inlineId=wpseo-add-keyword-popup","group"),p("#TB_window").css("height",235),p("#TB_window").css("width",680)},qtip:function(){p(".yoast_help").qtip({content:{attr:"alt"},position:{my:"bottom left",at:"top center"},style:{tip:{corner:!0},classes:"yoast-qtip qtip-rounded qtip-blue"},show:"click",hide:{fixed:!0,delay:500}})},removeClasses:function(t,e){_.each(e,function(e){t.removeClass(e)})},updateProgressBar:function(e,t){if(void 0!==e&&(void 0!==t||("undefined"!==e.data("language")&&(t=e.data("language")),void 0!==t))){var a,s,o=["snippet-editor__progress--bad","snippet-editor__progress--ok","snippet-editor__progress--good"],n="",i=0,l=!1;s=e.val().length,e.hasClass("wpglobus-snippet-editor-title")?(i=(a=p("progress."+r.yoastTitleProgress+"_"+t)).attr("max"),n=o[2],0==s?n=o[1]:i<s?(n=o[1],l=!0):0<s&&s<35&&(n=o[1])):e.hasClass("wpglobus-snippet-editor-meta-description")&&(i=(a=p("progress."+r.yoastMetadescProgress+"_"+t)).attr("max"),n=o[2],0==s?n=o[1]:i<s?(n=o[1],l=!0):0<s&&s<121&&(n=o[1])),r.removeClasses(a,o),a.attr("value",s).addClass(n),l?e.css("color","#f00"):e.css("color","#000")}},updateWpseoKeyword:function(e,t){p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").text(e)},start:function(){p(r.wpseoTabSelector).tabs(),r.ids=r.attrs.data("ids"),r.names=r.attrs.data("names"),r.ids=r.ids+","+r.attrs.data("qtip"),r.ids=r.ids.split(","),r.names=r.names.split(","),p("#wpglobus-wpseo-tabs").insertBefore(r.iB),p(".wpseo-metabox-tabs").css({height:"26px"}),p(".wpglobus-wpseo-general").each(function(e,t){var a=p(t),s=a.data("language"),o="wpseo-meta-section-content_"+s;a.html('<div id="'+o+'" class="wpseo-meta-section wpglobus-wpseo-meta-section" style="width:100%" data-language="'+s+'">'+r.t.html()+"</div>"),p("#"+o+" .wpseo-metabox-tabs").attr("id","wpseo-metabox-tabs_"+s).attr("data-language",s),p("#"+o+" .wpseotab").attr("id","wpseo_content_"+s),p("#wpseo_content_"+s).css({float:"left"}),p("#"+o).css({display:"block"}),p("#wpseo_meta").css({overflow:"hidden"}),p("#"+o+" .snippet_container").addClass("wpglobus-snippet_container"),s!==WPGlobusCoreData.default_language&&p("#"+o+" .wpseo-add-keyword").addClass("hidden"),p.each(r.names,function(e,t){p("#"+t).attr("name",t+"_"+s)}),p.each(r.ids,function(e,t){var a=p("#"+t);"wpseosnippet"==t&&a.addClass("wpglobus-wpseosnippet"),"snippet_title"==t&&a.addClass("wpglobus-snippet_title"),"snippet_meta"==t&&a.addClass("wpglobus-snippet_meta"),"snippet_cite"==t&&a.addClass("wpglobus-snippet_cite"),"snippet_citeBase"==t&&a.addClass("wpglobus-snippet_citeBase"),"url_container"==t&&a.css({height:"16px"}),"yoast_wpseo_focuskw_text_input"==t&&(a.addClass("wpglobus-yoast_wpseo_focuskw_text_input"),a.attr("data-value",""),a.parents("div#wpseofocuskeyword").attr("id","wpseofocuskeyword_"+s)),"yoast_wpseo_focuskeywords"==t&&a.addClass("wpglobus-yoast_wpseo_focuskeywords"),"wpseo-pageanalysis"==t&&a.addClass("wpglobus-wpseo-pageanalysis"),"yoast-seo-content-analysis"==t&&a.addClass("wpglobus-yoast-seo-content-analysis"),"snippet_preview"==t&&a.addClass("wpglobus-snippet_preview"),"snippet-editor-title"==t&&(a.addClass("wpglobus-snippet-editor-title"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),a.val(p("#wpseo-tab-"+s).data("wpseotitle")),a.parent("label").next("progress").addClass(r.yoastTitleProgress).addClass(r.yoastTitleProgress+"_"+s),_.debounce(r.updateProgressBar(a,s),500)),"snippet-editor-slug"==t&&(a.addClass("wpglobus-snippet-editor-slug"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),WPGlobusCoreData.default_language!=s&&a.attr("disabled","disabled")),"snippet-editor-meta-description"==t&&(a.addClass("wpglobus-snippet-editor-meta-description"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),a.val(p("#wpseo-tab-"+s).data("metadesc")),a.parent("label").next("progress").addClass(r.yoastMetadescProgress).addClass(r.yoastMetadescProgress+"_"+s),_.debounce(r.updateProgressBar(a,s),500)),"snippetpreview-help-toggle"==t&&(a.addClass("wpglobus-snippetpreview-help-toggle_"+s),p(document).on("click",".wpglobus-snippetpreview-help-toggle_"+s,function(e){var t=p(this);"none"===p("#snippetpreview-help_"+t.data("language")).css("display")?p("#snippetpreview-help_"+t.data("language")).css({display:"block"}):p("#snippetpreview-help_"+t.data("language")).css({display:"none"})})),"focuskw_text_input-help-toggle"==t&&(a.addClass("wpglobus-focuskw_text_input-help-toggle_"+s),p(document).on("click",".wpglobus-focuskw_text_input-help-toggle_"+s,function(e){var t=p(this);"none"===p("#focuskw_text_input-help_"+t.data("language")).css("display")?p("#focuskw_text_input-help_"+t.data("language")).css({display:"block"}):p("#focuskw_text_input-help_"+t.data("language")).css({display:"none"})})),"pageanalysis-help-toggle"==t&&(a.addClass("wpglobus-pageanalysis-help-toggle_"+s),p(document).on("click",".wpglobus-pageanalysis-help-toggle_"+s,function(e){var t=p(this);"none"===p("#pageanalysis-help_"+t.data("language")).css("display")?p("#pageanalysis-help_"+t.data("language")).css({display:"block"}):p("#pageanalysis-help_"+t.data("language")).css({display:"none"})})),a.attr("id",t+"_"+s),p("#"+t+"_"+s).attr("data-language",s)});var n=WPGlobusCore.TextFilter(p("#yoast_wpseo_focuskw_text_input").val(),s,"RETURN_EMPTY");p("#yoast_wpseo_focuskw_text_input_"+s).val(n).data("value",n),p("#yoast_wpseo_focuskw_"+s).val(n),WPGlobusYoastSeoPremium||p("#wpseo-metabox-tabs_"+s+" .wpseo_keyword_tab .wpseo_tablink").data("keyword",n),r.updateWpseoKeyword(n,s),s!==WPGlobusCoreData.default_language&&(p("#"+o+" #yoast_wpseo_focuskw_text_input_"+s).addClass("hidden").after('<div class="wpglobus-suggest" style="font-weight:bold;">'+WPGlobusVendor.i18n.yoastseo_plus_access+"</div>"),p("#"+o+" #wpseo-pageanalysis_"+s).addClass("hidden").css({display:"none"})),WPGlobusYoastSeoPremium&&(s==WPGlobusCoreData.default_language||(p("#wpseo-metabox-tabs_"+s+" .wpseo_keyword_tab").removeClass("wpseo_keyword_tab").addClass("wpglobus-wpseo_keyword_tab"),p("#wpseo-meta-section-content_"+s+" .wpseo_keyword_tab_hideable").css({display:"none"}).attr("data-language",s)))}),p(".wpglobus-wpseosnippet").each(function(e,t){var a=p(t),s=a.data("language");a.find("button.snippet-editor__button.snippet-editor__edit-button").addClass(r.editSnippetButtonClass).addClass(r.editSnippetButtonClass+"_"+s).attr("data-language",s),a.find(".snippet-editor__form").addClass(r.editSnippetFormClass).addClass(r.editSnippetFormClass+"_"+s),a.find(".snippet-editor__heading-editor").addClass(r.editSnippetHeadingClass).addClass(r.editSnippetHeadingClass+"_"+s),a.find(".snippet-editor__submit").addClass(r.editSnippetSubmitClass).addClass(r.editSnippetSubmitClass+"_"+s).attr("data-language",s)}),r.iB.addClass("hidden"),r.iB.css({height:0,overflow:"hidden",display:"none"}),WPGlobusYoastSeoPremium&&p("#wpseo-meta-section-content .wpseo_keyword_tab").removeClass("wpseo_keyword_tab").addClass("wpseo_keyword_tab_original");var e=WPGlobusCore.TextFilter(p("#yoast_wpseo_focuskw_text_input").val(),WPGlobusCoreData.default_language,"RETURN_EMPTY");p("#yoast_wpseo_focuskw_text_input").val(e),p("#yoast_wpseo_focuskw").val(e),p(document).on("click",".wpglobus-wpseo-general .wpseo_tablink",function(e){e.preventDefault();var t=p(this),a=t.parents("ul").data("language"),s=t.parent("li");if(a==WPGlobusCoreData.default_language||void 0!==p(document).triggerHandler("wpglobus_yoast_analysis",{language:a}))if(s.hasClass("wpseo_generic_tab"))p("#wpseo-pageanalysis_"+a).css({display:"none"}),p("#yoast-seo-content-analysis_"+a).css({display:"block"}),p("#wpseo_content_"+a+" table tr").eq(0).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(1).css({display:"none"}),p("#yoast-seo-content-analysis_"+a+" li a").css({float:"none"});else if(s.hasClass("wpseo_keyword_tab")){if(WPGlobusYoastSeoPremium&&(p("#wpseo-meta-section-content_"+a+" .wpseo_keyword_tab").removeClass("active"),t.parent(".wpseo_keyword_tab").addClass("active"),p("#wpseo-pageanalysis_"+a).css({display:"block"}),p("#yoast-seo-content-analysis_"+a).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(0).css("display",""),p("#wpseo_content_"+a+" table tr").eq(1).css("display",""),p("#wpseo-metabox-tabs_"+a+" .wpseo_keyword_tab").each(function(e,t){if(p(t).hasClass("active"))return r.keywordIndex[a]=e,!1})),!WPGlobusYoastSeoPremium&&a!=WPGlobusCoreData.default_language)return p("#wpseo-pageanalysis_"+a).css({display:"block"}),p("#yoast-seo-content-analysis_"+a).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(0).css("display",""),void p("#wpseo_content_"+a+" table tr").eq(1).css("display","");var o=r.getKeywordsOrig()[r.keywordIndex[a]].keyword;YoastSEO.app.rawData.keyword=o,p("#yoast_wpseo_focuskw_text_input").val(o),p("#yoast_wpseo_focuskw_text_input_"+a).val(o),p('input[name="yoast_wpseo_focuskw"]').val(o),n.prototype.analyze(),p("#wpseo-pageanalysis_"+a).css({display:"block"}),p("#yoast-seo-content-analysis_"+a).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(0).css("display",""),p("#wpseo_content_"+a+" table tr").eq(1).css("display","")}else s.hasClass("wpglobus-wpseo_keyword_tab")&&(p("#wpseo-pageanalysis_"+a).css({display:"block"}),p("#yoast-seo-content-analysis_"+a).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(0).css("display",""),p("#wpseo_content_"+a+" table tr").eq(1).css("display",""))}),p(".wpseo-metabox-sidebar .wpseo-meta-section-link").on("click",function(e){"#wpseo-meta-section-content"==p(this).attr("href")?p("#wpglobus-wpseo-tabs").css({display:"block"}):p("#wpglobus-wpseo-tabs").css({display:"none"})}),p(document).on("click","."+r.editSnippetButtonClass,function(e){var t=p(this),a=t.data("language"),s=p("."+r.editSnippetFormClass+"_"+a),o=p("."+r.editSnippetSubmitClass+"_"+a),n=p("."+r.editSnippetHeadingClass+"_"+a);s.hasClass("snippet-editor--hidden")?(s.removeClass("snippet-editor--hidden"),n.removeClass("snippet-editor--hidden"),o.removeClass("snippet-editor--hidden")):(s.addClass("snippet-editor--hidden"),n.addClass("snippet-editor--hidden")),t.addClass("snippet-editor--hidden")}),p(document).on("click","."+r.editSnippetSubmitClass,function(e){var t=p(this).data("language"),a=p("."+r.editSnippetButtonClass+"_"+t),s=p("."+r.editSnippetFormClass+"_"+t),o=p("."+r.editSnippetSubmitClass+"_"+t),n=p("."+r.editSnippetHeadingClass+"_"+t);a.removeClass("snippet-editor--hidden"),s.addClass("snippet-editor--hidden"),o.addClass("snippet-editor--hidden"),n.addClass("snippet-editor--hidden")}),p(document).on("keyup","input.wpglobus-snippet-editor-title",function(e){var t=p(this),a=t.data("language"),s=WPGlobusCore.getString(p('input[name="yoast_wpseo_title"]').val(),t.val(),a);p("#snippet_title_"+a).html(d.replaceVariablesPlugin(t.val())),YoastSEO.app.rawData.pageTitle=s,p('input[name="yoast_wpseo_title"]').val(s),p("#snippet_title").text(s),_.debounce(r.updateProgressBar(t,a),500)}),p(document).on("keyup","input.wpglobus-snippet-editor-slug",function(e){var t=p(this),a=t.data("language");p("#snippet_cite_"+a).text(t.val()+"/"),p("#editable-post-name").text(t.val()),p("#editable-post-name-full").text(t.val())}),p(document).on("change","input.wpglobus-snippet-editor-slug",function(e){var t=p(this);p.post(ajaxurl,{action:"sample-permalink",post_id:p("#post_ID").val()||0,new_slug:t.val(),new_title:p("#title").val(),samplepermalinknonce:p("#samplepermalinknonce").val()})}),p(document).on("keyup","textarea.wpglobus-snippet-editor-meta-description",function(e){var t=p(this),a=t.data("language");p("#snippet_meta_"+a).text(t.val());var s=WPGlobusCore.getString(p("#yoast_wpseo_metadesc").val(),t.val(),t.data("language"));p("#yoast_wpseo_metadesc").val(s),p("#snippet_meta").text(s),_.debounce(r.updateProgressBar(t,a),500)}),p(document).on("click",".wpglobus-post-body-tabs-list li",function(e){var t=p(this);if(t.hasClass("wpglobus-post-tab")){p("#wpglobus-wpseo-tabs").tabs("option","active",t.data("order"));var a=p("#yoast_wpseo_focuskw_text_input_"+t.data("language")).val();YoastSEO.app.rawData.keyword=a,p("#yoast_wpseo_focuskw_text_input").val(a),p('input[name="yoast_wpseo_focuskw"]').val(a),n.prototype.analyze()}}),r.initAddKeywordPopup()},getKeywordsOrig:function(){return p(".wpseo_keyword_tab").map(function(e,t){return{keyword:(t=p(t).find(".wpseo_tablink")).data("keyword")+"",score:t.data("score")}}).get()}},(n=function(){this.replaceVars=wpseoReplaceVarsL10n.replace_vars,this.language=WPGlobusCoreData.default_language,this.tab=WPGlobusCoreData.default_language,this.wpseoTab=WPGlobusCoreData.default_language,this.title_template=wpseoPostScraperL10n.title_template,this.focuskw=p("#yoast_wpseo_focuskw_text_input"),this.focuskw_hidden=p('input[name="yoast_wpseo_focuskw"]'),this.focuskwKeep=!1,this.post_slug="#editable-post-name-full",YoastSEO.app.registerPlugin("wpglobusYoastSeoPlugin",{status:"ready"}),YoastSEO.app.registerModification("content",this.contentModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("title",this.titleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_title",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_meta",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_page_title",this.pageTitleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_meta_desc",this.metaDescModification,"wpglobusYoastSeoPlugin",0),n.prototype.setScoreIcon(),p(document).on("blur",".wpglobus-snippet_title",function(e){var t=p(this),a=WPGlobusCore.getString(p("#yoast_wpseo_title").val(),t.text(),t.data("language"));YoastSEO.app.rawData.pageTitle=a,p('input[name="yoast_wpseo_title"]').val(a),p("#snippet_title").text(a)}),p(document).on("blur",".wpglobus-snippet_meta",function(e){var t=p(this),a=WPGlobusCore.getString(p("#yoast_wpseo_metadesc").val(),t.text(),t.data("language"));p("#yoast_wpseo_metadesc").val(a),p("#snippet_meta").text(a)}),p(document).on("keyup",".wpglobus-yoast_wpseo_focuskw_text_input",function(e){var t=p(this),a=t.val(),s=t.data("language");d.focuskw.val(a),d.focuskw_hidden.val(a),WPGlobusYoastSeoPremium||p("#wpseo-metabox-tabs_"+s+" .wpseo_keyword_tab .wpseo_tablink").data("keyword",a),d.updateWpseoKeyword(a,s),0==WPGlobusYoastSeo.keywordIndex[s]?p("#yoast_wpseo_focuskw_text_input_"+s).data("value",a):WPGlobusYoastSeoPremium&&WPGlobusYoastSeoPremium.setFocuskeyword(s),n.prototype.analyze()}),p("#publish,#save-post").on("mouseenter",function(e){var s,o="";p(".wpglobus-yoast_wpseo_focuskw_text_input").each(function(e,t){if((s=p(this)).data("language")==WPGlobusCoreData.default_language)if(WPGlobusYoastSeoPremium){var a=WPGlobusYoastSeo.getKeywordsOrig();o=WPGlobusCore.getString(o,a[0].keyword,s.data("language"))}else o=WPGlobusCore.getString(o,s.val(),s.data("language"));else o=WPGlobusCore.getString(o,s.val(),s.data("language"))}),d.focuskw.val(o),d.focuskw_hidden.val(o)}).on("mouseleave",function(e){if(!d.focuskwKeep){d.wpseoTab=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language");p(this);d.focuskw.val(p("#yoast_wpseo_focuskw_text_input_"+d.wpseoTab).val()),d.focuskw_hidden.val(p("#yoast_wpseo_focuskw_text_input_"+d.wpseoTab).val())}}).on("click",function(e){d.focuskwKeep=!0}),p(document).on("tabsactivate",WPGlobusYoastSeo.wpseoTabSelector,function(e,t){if(d.language=t.newPanel.attr("data-language"),WPGlobusYoastSeo.wpseoTab=d.language,t.newPanel.attr("data-language")===WPGlobusCoreData.default_language){var a;if(WPGlobusYoastSeoPremium)p("#wpseo-meta-section-content_"+WPGlobusYoastSeoPremium.dLang+" .wpseo_keyword_tab").removeClass("active"),p("#wpseo-meta-section-content_"+WPGlobusYoastSeoPremium.dLang+" .wpseo_keyword_tab").eq(WPGlobusYoastSeo.keywordIndex[WPGlobusYoastSeoPremium.dLang]).addClass("active"),a=p("#yoast_wpseo_focuskw_text_input_"+WPGlobusYoastSeoPremium.dLang).val();else a=p("#yoast_wpseo_focuskw_text_input_"+WPGlobusCoreData.default_language).val();YoastSEO.app.rawData.keyword=a,d.focuskw.val(a),d.focuskw_hidden.val(a)}p("#wpseo-metabox-tabs_"+d.language+" .wpseo_keyword_tab").each(function(e,t){if(p(t).hasClass("active"))return WPGlobusYoastSeo.keywordIndex[d.language]=e,!1}),n.prototype.analyze()}),d=this}).prototype.analyze=function(){var e=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language");e==WPGlobusCoreData.default_language?YoastSEO.app.snippetPreview.data.urlPath=p("#editable-post-name-full").text():0!=p("#editable-post-name-full-"+e).length?YoastSEO.app.snippetPreview.data.urlPath=p("#editable-post-name-full-"+e).text():YoastSEO.app.snippetPreview.data.urlPath=p("#editable-post-name-full").text(),YoastSEO.app.analyzeTimer(YoastSEO.app),n.prototype.setScoreIcon()},n.prototype.setScoreIcon=function(){var s;s=setInterval(function(){var e=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language"),t=p("#wpseo-meta-section-content .wpseo_generic_tab a").data("score"),a=p("#wpseo-meta-section-content .wpseo_keyword_tab a").data("score");""!=t&&(p("#wpseo-metabox-tabs_"+e+" .wpseo_generic_tab .wpseo-score-icon").removeClass("bad ok good 100 na"),p("#wpseo-metabox-tabs_"+e+" .wpseo_generic_tab .wpseo-score-icon").addClass(t)),void 0!==a&&""!=a&&(WPGlobusYoastSeoPremium&&e!=WPGlobusYoastSeoPremium.dLang?(p("#wpseo-metabox-tabs_"+e+" .wpglobus-wpseo_keyword_tab .wpseo-score-icon").removeClass("bad ok good 100 na"),p("#wpseo-metabox-tabs_"+e+" .wpglobus-wpseo_keyword_tab .wpseo-score-icon").addClass(a)):(p("#wpseo-metabox-tabs_"+e+" .wpseo_keyword_tab .wpseo-score-icon").removeClass("bad ok good 100 na"),p("#wpseo-metabox-tabs_"+e+" .wpseo_keyword_tab .wpseo-score-icon").addClass(a))),clearInterval(s)},1500)},n.prototype.getWPseoTab=function(){return p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language")},n.prototype.citeModification=function(e){var t="#snippet_citeBase_"+e,a="#snippet_cite_"+e,s=p("#wpseo-tab-"+e).data("yoast-cite-base");!1===p("#wpseo-tab-"+e).data("cite-contenteditable")&&p(a).attr("contenteditable","false"),p(t).text(s)},n.prototype.pageTitleModification=function(e){var a,s,o,n="#snippet_title_",i="",l="";if(d.title_template==e)p.each(WPGlobusCoreData.enabled_languages,function(e,t){s=p("#snippet-editor-title_"+t).val(),o=0==s.length?d.title_template:s,i=d.replaceVariablesPlugin(o),p(n+t).text(i),t==d.getWPseoTab()&&(l=i)});else{if(a=WPGlobusCore.getTranslations(e),d.getWPseoTab()!==WPGlobusCoreData.default_language&&a[WPGlobusCoreData.default_language]==e){var t=d.getWPseoTab();return s=p("#snippet-editor-title_"+t).val(),o=0<s.length?s:d.title_template,o=d.replaceVariablesPlugin(o),p(n+t).text(o),o}p.each(WPGlobusCoreData.enabled_languages,function(e,t){i=""===a[t]?d.replaceVariablesPlugin(d.title_template):d.replaceVariablesPlugin(a[t]),t==d.getWPseoTab()&&(l=i,0!=(s=p("#snippet-editor-title_"+t).val()).length?s!=l&&(l=d.replaceVariablesPlugin(s)):l=d.replaceVariablesPlugin(d.title_template)),p(n+t).html(l)})}return l},n.prototype.metaDescModification=function(a){var e,s="#snippet_meta_",t=WPGlobusCore.getTranslations(a),o="";if(e=p("#snippet-editor-meta-description_"+d.getWPseoTab()).val(),d.getWPseoTab()!==WPGlobusCoreData.default_language&&t[WPGlobusCoreData.default_language]==a){var n=d.getWPseoTab();return d.citeModification(n),0==e.length?p(s+n).text(""):e!=a&&p(s+n).text(e),a}return p.each(WPGlobusCoreData.enabled_languages,function(e,t){p(s+t).text(WPGlobusCore.TextFilter(a,t,"RETURN_EMPTY")),d.citeModification(t)}),e==t[d.getWPseoTab()]?0==(o=t[d.getWPseoTab()]).length&&p(s+d.getWPseoTab()).text(WPGlobusCore.TextFilter(YoastSEO.app.snippetPreview.data.metaDesc,WPGlobusCoreData.default_language,"RETURN_EMPTY")):0==(o=e).length?p(s+d.getWPseoTab()).text(WPGlobusCore.TextFilter(YoastSEO.app.snippetPreview.data.metaDesc,WPGlobusCoreData.default_language,"RETURN_EMPTY")):p(s+d.getWPseoTab()).text(o),p(s+d.getWPseoTab()).text(o),o},n.prototype.snippetModification=function(e){return WPGlobusCore.TextFilter(e,d.getWPseoTab(),"RETURN_EMPTY")},n.prototype.contentModification=function(e){return d.getWPseoTab()==WPGlobusCoreData.default_language?e:p("#content_"+d.getWPseoTab()).val()},n.prototype.titleModification=function(e){return setTimeout(d.updatePageAnalysis,1e3),d.getWPseoTab()==WPGlobusCoreData.default_language?e:p("#title_"+d.getWPseoTab()).val()},n.prototype.defaultReplace=function(e){var t=YoastSEO.app.rawData.keyword;return e.replace(/%%sitedesc%%/g,this.replaceVars.sitedesc).replace(/%%sitename%%/g,WPGlobusCore.TextFilter(this.replaceVars.sitename,d.getWPseoTab())).replace(/%%term_title%%/g,this.replaceVars.term_title).replace(/%%term_description%%/g,this.replaceVars.term_description).replace(/%%category_description%%/g,this.replaceVars.category_description).replace(/%%tag_description%%/g,this.replaceVars.tag_description).replace(/%%searchphrase%%/g,this.replaceVars.searchphrase).replace(/%%date%%/g,this.replaceVars.date).replace(/%%id%%/g,this.replaceVars.id).replace(/%%page%%/g,this.replaceVars.page).replace(/%%currenttime%%/g,this.replaceVars.currenttime).replace(/%%currentdate%%/g,this.replaceVars.currentdate).replace(/%%currentday%%/g,this.replaceVars.currentday).replace(/%%currentmonth%%/g,this.replaceVars.currentmonth).replace(/%%currentyear%%/g,this.replaceVars.currentyear).replace(/%%focuskw%%/g,t)},n.prototype.replaceVariablesPlugin=function(e){return void 0!==e&&(e=this.titleReplace(e),e=this.defaultReplace(e),e=this.replaceSeparators(e)),e},n.prototype.replaceSeparators=function(e){return e.replace(/%%sep%%(\s+%%sep%%)*/g,this.replaceVars.sep)},n.prototype.titleReplace=function(e){var t="";return void 0===(t=this.language==WPGlobusCoreData.default_language?p("#title").val():p("#title_"+this.language).val())&&(t=YoastSEO.app.rawData.pageTitle),this.language!=WPGlobusCoreData.default_language&&0==t.length&&(t=p("#title").val()),e=e.replace(/%%title%%/g,t)},n.prototype.doubleSepReplace=function(e){var t=YoastSEO.app.stringHelper.addEscapeChars(this.replaceVars.sep),a=new RegExp(t+" "+t,"g");return e=e.replace(a,this.replaceVars.sep)},n.prototype.updateWpseoKeyword=function(e,t){0<p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").length&&p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").removeClass("wpseo-keyword").addClass("wpglobus-wpseo_keyword_"+t),p(".wpglobus-wpseo_keyword_"+t).text(e)},n.prototype.updatePageAnalysis=function(){p("#wpseo-pageanalysis_"+d.getWPseoTab()).html(p("#wpseo-pageanalysis").html()),p("#yoast-seo-content-analysis_"+d.getWPseoTab()).html(p("#yoast-seo-content-analysis").html()),p("#yoast-seo-content-analysis_"+d.getWPseoTab()+" li a").css({float:"none"})},window.WPGlobusYoastSeoPlugin=new n}});
1
+ var WPGlobusYoastSeo,WPGlobusYoastSeoPremium=!1;jQuery(document).ready(function(p){"use strict";var r;if("undefined"!=typeof wpseoReplaceVarsL10n&&("undefined"!=typeof WPGlobusCoreData&&"undefined"!=typeof WPGlobusVendor))if("edit-tags.php"==WPGlobusVendor.pagenow||"term.php"==WPGlobusVendor.pagenow){r=WPGlobusYoastSeo={editorIDs:["description"],editor:{},submitId:"#submit",preventChangeEditor:!1,observer:null,init:function(){r.attachListeners(),_.delay(r.start,1500)},submit:function(e){"mouseenter"===e.type?p.each(r.editor,function(e,t){!r.editor[e].contentEditor||r.editor[e].contentEditor.isHidden()?p("#"+e).val(r.editor[e].content):tinymce.get(e).setContent(r.editor[e].content)}):"mouseleave"===e.type?r.preventChangeEditor||(p.each(r.editor,function(e,t){!r.editor[e].contentEditor||r.editor[e].contentEditor.isHidden()?p("#"+e).val(WPGlobusCore.TextFilter(t.content,r.getCurrentTab(),"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,r.getCurrentTab(),"RETURN_EMPTY"))}),r.preventChangeEditor=!1):"click"===e.type&&(r.preventChangeEditor=!0,"tinymce"!=getUserSetting("editor")&&setUserSetting("editor","tinymce"))},attachListeners:function(){p(".wrap").on("tabsactivate",function(e,a){p.each(r.editor,function(e,t){!r.editor[e].contentEditor||r.editor[e].contentEditor.isHidden()?p("#"+e).val(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY"))})}),p(document).on("mouseenter",r.submitId,r.submit).on("mouseleave",r.submitId,r.submit).on("click",r.submitId,r.submit),p(document).on("tinymce-editor-init",function(e,t){if(-1!=_.indexOf(r.editorIDs,t.id)){var a=p("#"+t.id);r.editor[t.id]={},r.editor[t.id].contentEditor=t,r.editor[t.id].content=a.val(),t.setContent(WPGlobusCore.TextFilter(r.editor[t.id].content,WPGlobusCoreData.default_language,"RETURN_EMPTY")),p("#"+t.getContainer().id).find("iframe").addClass("wpglobus-translatable"),a.removeClass("hidden"),t.on("nodechange keyup",_.debounce(r.update,500)),a.on("input keyup",_.debounce(r.update,500))}})},update:function(e){var t,a;void 0!==e.target&&("tinymce"==(t=e.target.id)&&(t=e.target.dataset.id),void 0!==r.editor[t].contentEditor&&(a=!r.editor[t].contentEditor||r.editor[t].contentEditor.isHidden()?p("#"+t).val():r.editor[t].contentEditor.getContent({format:"raw"}),r.editor[t].content=WPGlobusCore.getString(r.editor[t].content,a,r.getCurrentTab())))},getCurrentTab:function(){return p(".wpglobus-taxonomy-tabs-list .ui-tabs-active").data("language")},start:function(){p(".wpglobus-element_description").css({display:"none"})}},WPGlobusYoastSeo.init();var n=function(){p(".wrap").on("tabsactivate",function(e,t){t.newTab[0].dataset.language==WPGlobusCoreData.default_language?p("#poststuff .inside").css({display:"block"}):p("#poststuff .inside").css({display:"none"})}),p.each(["category_description","sitedesc","sitename","tag_description","term_description","term_title"],function(e,t){wpseoReplaceVarsL10n.replace_vars[t]=WPGlobusCore.TextFilter(wpseoReplaceVarsL10n.replace_vars[t],WPGlobusCoreData.default_language)}),WPGlobusYoastSeo.observer=new MutationObserver(function(e){e.forEach(function(e){if("placeholder"==e.attributeName){WPGlobusYoastSeo.observer.disconnect();var t=p("#wpseo_focuskw");""==t.val()&&t.attr("placeholder",WPGlobusCore.TextFilter(t.attr("placeholder"),WPGlobusCoreData.default_language)),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0})}})}),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0})};window.WPGlobusYoastSeoPlugin=new n}else{var d;r=WPGlobusYoastSeo={wpseoTabSelector:"#wpglobus-wpseo-tabs",url:"",attrs:p("#wpglobus-wpseo-attr"),iB:p("#wpseo-meta-section-content"),t:p("#wpseo-meta-section-content"),ids:"",names:"",wpseoTab:WPGlobusCoreData.default_language,editSnippetButtonClass:"wpglobus-snippet-editor__edit-button",editSnippetFormClass:"wpglobus-snippet-editor__form",editSnippetSubmitClass:"wpglobus-snippet-editor__submit",editSnippetHeadingClass:"wpglobus-snippet-editor__heading-editor",yoastTitleProgress:"wpglobus-yoast-title-progress",yoastMetadescProgress:"wpglobus-yoast-metadesc-progress",yoastPremium:WPGlobusVendor.vendor.WPSEO_PREMIUM,keywordIndex:{},init:function(){p.each(WPGlobusCoreData.enabled_languages,function(e,t){r.keywordIndex[t]=0}),r.start()},initAddKeywordPopup:function(){1==p("#wpseo-add-keyword-popup").length?p(".wpseo-add-keyword").on("click",r.addKeywordPopup):WPGlobusYoastSeoPremium&&WPGlobusYoastSeoPremium.addKeywordButton()},addKeywordPopup:function(){var e=p("#wpseo-add-keyword-popup-button").text();tb_show(e,"#TB_inline?width=650&height=350&inlineId=wpseo-add-keyword-popup","group"),p("#TB_window").css("height",235),p("#TB_window").css("width",680)},qtip:function(){p(".yoast_help").qtip({content:{attr:"alt"},position:{my:"bottom left",at:"top center"},style:{tip:{corner:!0},classes:"yoast-qtip qtip-rounded qtip-blue"},show:"click",hide:{fixed:!0,delay:500}})},removeClasses:function(t,e){_.each(e,function(e){t.removeClass(e)})},updateProgressBar:function(e,t){if(void 0!==e&&(void 0!==t||("undefined"!==e.data("language")&&(t=e.data("language")),void 0!==t))){var a,s,o=["snippet-editor__progress--bad","snippet-editor__progress--ok","snippet-editor__progress--good"],n="",i=0,l=!1;s=e.val().length,e.hasClass("wpglobus-snippet-editor-title")?(i=(a=p("progress."+r.yoastTitleProgress+"_"+t)).attr("max"),n=o[2],0==s?n=o[1]:i<s?(n=o[1],l=!0):0<s&&s<35&&(n=o[1])):e.hasClass("wpglobus-snippet-editor-meta-description")&&(i=(a=p("progress."+r.yoastMetadescProgress+"_"+t)).attr("max"),n=o[2],0==s?n=o[1]:i<s?(n=o[1],l=!0):0<s&&s<121&&(n=o[1])),r.removeClasses(a,o),a.attr("value",s).addClass(n),l?e.css("color","#f00"):e.css("color","#000")}},updateWpseoKeyword:function(e,t){p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").text(e)},start:function(){p(r.wpseoTabSelector).tabs(),r.ids=r.attrs.data("ids"),r.names=r.attrs.data("names"),r.ids=r.ids+","+r.attrs.data("qtip"),r.ids=r.ids.split(","),r.names=r.names.split(","),p("#wpglobus-wpseo-tabs").insertBefore(r.iB),p(".wpseo-metabox-tabs").css({height:"26px"}),p(".wpglobus-wpseo-general").each(function(e,t){var a=p(t),s=a.data("language"),o="wpseo-meta-section-content_"+s;a.html('<div id="'+o+'" class="wpseo-meta-section wpglobus-wpseo-meta-section" style="width:100%" data-language="'+s+'">'+r.t.html()+"</div>"),p("#"+o+" .wpseo-metabox-tabs").attr("id","wpseo-metabox-tabs_"+s).attr("data-language",s),p("#"+o+" .wpseotab").attr("id","wpseo_content_"+s),p("#wpseo_content_"+s).css({float:"left"}),p("#"+o).css({display:"block"}),p("#wpseo_meta").css({overflow:"hidden"}),p("#"+o+" .snippet_container").addClass("wpglobus-snippet_container"),s!==WPGlobusCoreData.default_language&&p("#"+o+" .wpseo-add-keyword").addClass("hidden"),p.each(r.names,function(e,t){p("#"+t).attr("name",t+"_"+s)}),p.each(r.ids,function(e,t){var a=p("#"+t);"wpseosnippet"==t&&a.addClass("wpglobus-wpseosnippet"),"snippet_title"==t&&a.addClass("wpglobus-snippet_title"),"snippet_meta"==t&&a.addClass("wpglobus-snippet_meta"),"snippet_cite"==t&&a.addClass("wpglobus-snippet_cite"),"snippet_citeBase"==t&&a.addClass("wpglobus-snippet_citeBase"),"url_container"==t&&a.css({height:"16px"}),"yoast_wpseo_focuskw_text_input"==t&&(a.addClass("wpglobus-yoast_wpseo_focuskw_text_input"),a.attr("data-value",""),a.parents("div#wpseofocuskeyword").attr("id","wpseofocuskeyword_"+s)),"yoast_wpseo_focuskeywords"==t&&a.addClass("wpglobus-yoast_wpseo_focuskeywords"),"wpseo-pageanalysis"==t&&a.addClass("wpglobus-wpseo-pageanalysis"),"yoast-seo-content-analysis"==t&&a.addClass("wpglobus-yoast-seo-content-analysis"),"snippet_preview"==t&&a.addClass("wpglobus-snippet_preview"),"snippet-editor-title"==t&&(a.addClass("wpglobus-snippet-editor-title"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),a.val(p("#wpseo-tab-"+s).data("wpseotitle")),a.parent("label").next("progress").addClass(r.yoastTitleProgress).addClass(r.yoastTitleProgress+"_"+s),_.debounce(r.updateProgressBar(a,s),500)),"snippet-editor-slug"==t&&(a.addClass("wpglobus-snippet-editor-slug"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),WPGlobusCoreData.default_language!=s&&a.attr("disabled","disabled")),"snippet-editor-meta-description"==t&&(a.addClass("wpglobus-snippet-editor-meta-description"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),a.val(p("#wpseo-tab-"+s).data("metadesc")),a.parent("label").next("progress").addClass(r.yoastMetadescProgress).addClass(r.yoastMetadescProgress+"_"+s),_.debounce(r.updateProgressBar(a,s),500)),"snippetpreview-help-toggle"==t&&(a.addClass("wpglobus-snippetpreview-help-toggle_"+s),p(document).on("click",".wpglobus-snippetpreview-help-toggle_"+s,function(e){var t=p(this);"none"===p("#snippetpreview-help_"+t.data("language")).css("display")?p("#snippetpreview-help_"+t.data("language")).css({display:"block"}):p("#snippetpreview-help_"+t.data("language")).css({display:"none"})})),"focuskw_text_input-help-toggle"==t&&(a.addClass("wpglobus-focuskw_text_input-help-toggle_"+s),p(document).on("click",".wpglobus-focuskw_text_input-help-toggle_"+s,function(e){var t=p(this);"none"===p("#focuskw_text_input-help_"+t.data("language")).css("display")?p("#focuskw_text_input-help_"+t.data("language")).css({display:"block"}):p("#focuskw_text_input-help_"+t.data("language")).css({display:"none"})})),"pageanalysis-help-toggle"==t&&(a.addClass("wpglobus-pageanalysis-help-toggle_"+s),p(document).on("click",".wpglobus-pageanalysis-help-toggle_"+s,function(e){var t=p(this);"none"===p("#pageanalysis-help_"+t.data("language")).css("display")?p("#pageanalysis-help_"+t.data("language")).css({display:"block"}):p("#pageanalysis-help_"+t.data("language")).css({display:"none"})})),a.attr("id",t+"_"+s),p("#"+t+"_"+s).attr("data-language",s)});var n=WPGlobusCore.TextFilter(p("#yoast_wpseo_focuskw_text_input").val(),s,"RETURN_EMPTY");p("#yoast_wpseo_focuskw_text_input_"+s).val(n).data("value",n),p("#yoast_wpseo_focuskw_"+s).val(n),WPGlobusYoastSeoPremium||p("#wpseo-metabox-tabs_"+s+" .wpseo_keyword_tab .wpseo_tablink").data("keyword",n),r.updateWpseoKeyword(n,s),s!==WPGlobusCoreData.default_language&&(p("#"+o+" #yoast_wpseo_focuskw_text_input_"+s).addClass("hidden").after('<div class="wpglobus-suggest" style="font-weight:bold;">'+WPGlobusVendor.i18n.yoastseo_plus_access+"</div>"),p("#"+o+" #wpseo-pageanalysis_"+s).addClass("hidden").css({display:"none"})),WPGlobusYoastSeoPremium&&(s==WPGlobusCoreData.default_language||(p("#wpseo-metabox-tabs_"+s+" .wpseo_keyword_tab").removeClass("wpseo_keyword_tab").addClass("wpglobus-wpseo_keyword_tab"),p("#wpseo-meta-section-content_"+s+" .wpseo_keyword_tab_hideable").css({display:"none"}).attr("data-language",s)))}),p(".wpglobus-wpseosnippet").each(function(e,t){var a=p(t),s=a.data("language");a.find("button.snippet-editor__button.snippet-editor__edit-button").addClass(r.editSnippetButtonClass).addClass(r.editSnippetButtonClass+"_"+s).attr("data-language",s),a.find(".snippet-editor__form").addClass(r.editSnippetFormClass).addClass(r.editSnippetFormClass+"_"+s),a.find(".snippet-editor__heading-editor").addClass(r.editSnippetHeadingClass).addClass(r.editSnippetHeadingClass+"_"+s),a.find(".snippet-editor__submit").addClass(r.editSnippetSubmitClass).addClass(r.editSnippetSubmitClass+"_"+s).attr("data-language",s)}),r.iB.addClass("hidden"),r.iB.css({height:0,overflow:"hidden",display:"none"}),WPGlobusYoastSeoPremium&&p("#wpseo-meta-section-content .wpseo_keyword_tab").removeClass("wpseo_keyword_tab").addClass("wpseo_keyword_tab_original");var e=WPGlobusCore.TextFilter(p("#yoast_wpseo_focuskw_text_input").val(),WPGlobusCoreData.default_language,"RETURN_EMPTY");p("#yoast_wpseo_focuskw_text_input").val(e),p("#yoast_wpseo_focuskw").val(e),p(document).on("click",".wpglobus-wpseo-general .wpseo_tablink",function(e){e.preventDefault();var t=p(this),a=t.parents("ul").data("language"),s=t.parent("li");if(a==WPGlobusCoreData.default_language||void 0!==p(document).triggerHandler("wpglobus_yoast_analysis",{language:a}))if(s.hasClass("wpseo_generic_tab"))p("#wpseo-pageanalysis_"+a).css({display:"none"}),p("#yoast-seo-content-analysis_"+a).css({display:"block"}),p("#wpseo_content_"+a+" table tr").eq(0).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(1).css({display:"none"}),p("#yoast-seo-content-analysis_"+a+" li a").css({float:"none"});else if(s.hasClass("wpseo_keyword_tab")){if(WPGlobusYoastSeoPremium&&(p("#wpseo-meta-section-content_"+a+" .wpseo_keyword_tab").removeClass("active"),t.parent(".wpseo_keyword_tab").addClass("active"),p("#wpseo-pageanalysis_"+a).css({display:"block"}),p("#yoast-seo-content-analysis_"+a).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(0).css("display",""),p("#wpseo_content_"+a+" table tr").eq(1).css("display",""),p("#wpseo-metabox-tabs_"+a+" .wpseo_keyword_tab").each(function(e,t){if(p(t).hasClass("active"))return r.keywordIndex[a]=e,!1})),!WPGlobusYoastSeoPremium&&a!=WPGlobusCoreData.default_language)return p("#wpseo-pageanalysis_"+a).css({display:"block"}),p("#yoast-seo-content-analysis_"+a).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(0).css("display",""),void p("#wpseo_content_"+a+" table tr").eq(1).css("display","");var o=r.getKeywordsOrig()[r.keywordIndex[a]].keyword;YoastSEO.app.rawData.keyword=o,p("#yoast_wpseo_focuskw_text_input").val(o),p("#yoast_wpseo_focuskw_text_input_"+a).val(o),p('input[name="yoast_wpseo_focuskw"]').val(o),n.prototype.analyze(),p("#wpseo-pageanalysis_"+a).css({display:"block"}),p("#yoast-seo-content-analysis_"+a).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(0).css("display",""),p("#wpseo_content_"+a+" table tr").eq(1).css("display","")}else s.hasClass("wpglobus-wpseo_keyword_tab")&&(p("#wpseo-pageanalysis_"+a).css({display:"block"}),p("#yoast-seo-content-analysis_"+a).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(0).css("display",""),p("#wpseo_content_"+a+" table tr").eq(1).css("display",""))}),p(".wpseo-metabox-sidebar .wpseo-meta-section-link").on("click",function(e){"#wpseo-meta-section-content"==p(this).attr("href")?p("#wpglobus-wpseo-tabs").css({display:"block"}):p("#wpglobus-wpseo-tabs").css({display:"none"})}),p(document).on("click","."+r.editSnippetButtonClass,function(e){var t=p(this),a=t.data("language"),s=p("."+r.editSnippetFormClass+"_"+a),o=p("."+r.editSnippetSubmitClass+"_"+a),n=p("."+r.editSnippetHeadingClass+"_"+a);s.hasClass("snippet-editor--hidden")?(s.removeClass("snippet-editor--hidden"),n.removeClass("snippet-editor--hidden"),o.removeClass("snippet-editor--hidden")):(s.addClass("snippet-editor--hidden"),n.addClass("snippet-editor--hidden")),t.addClass("snippet-editor--hidden")}),p(document).on("click","."+r.editSnippetSubmitClass,function(e){var t=p(this).data("language"),a=p("."+r.editSnippetButtonClass+"_"+t),s=p("."+r.editSnippetFormClass+"_"+t),o=p("."+r.editSnippetSubmitClass+"_"+t),n=p("."+r.editSnippetHeadingClass+"_"+t);a.removeClass("snippet-editor--hidden"),s.addClass("snippet-editor--hidden"),o.addClass("snippet-editor--hidden"),n.addClass("snippet-editor--hidden")}),p(document).on("keyup","input.wpglobus-snippet-editor-title",function(e){var t=p(this),a=t.data("language"),s=WPGlobusCore.getString(p('input[name="yoast_wpseo_title"]').val(),t.val(),a);p("#snippet_title_"+a).html(d.replaceVariablesPlugin(t.val())),YoastSEO.app.rawData.pageTitle=s,p('input[name="yoast_wpseo_title"]').val(s),p("#snippet_title").text(s),_.debounce(r.updateProgressBar(t,a),500)}),p(document).on("keyup","input.wpglobus-snippet-editor-slug",function(e){var t=p(this),a=t.data("language");p("#snippet_cite_"+a).text(t.val()+"/"),p("#editable-post-name").text(t.val()),p("#editable-post-name-full").text(t.val())}),p(document).on("change","input.wpglobus-snippet-editor-slug",function(e){var t=p(this);p.post(ajaxurl,{action:"sample-permalink",post_id:p("#post_ID").val()||0,new_slug:t.val(),new_title:p("#title").val(),samplepermalinknonce:p("#samplepermalinknonce").val()})}),p(document).on("keyup","textarea.wpglobus-snippet-editor-meta-description",function(e){var t=p(this),a=t.data("language");p("#snippet_meta_"+a).text(t.val());var s=WPGlobusCore.getString(p("#yoast_wpseo_metadesc").val(),t.val(),t.data("language"));p("#yoast_wpseo_metadesc").val(s),p("#snippet_meta").text(s),_.debounce(r.updateProgressBar(t,a),500)}),p(document).on("click",".wpglobus-post-body-tabs-list li",function(e){var t=p(this);if(t.hasClass("wpglobus-post-tab")){p("#wpglobus-wpseo-tabs").tabs("option","active",t.data("order"));var a=p("#yoast_wpseo_focuskw_text_input_"+t.data("language")).val();YoastSEO.app.rawData.keyword=a,p("#yoast_wpseo_focuskw_text_input").val(a),p('input[name="yoast_wpseo_focuskw"]').val(a),n.prototype.analyze()}}),r.initAddKeywordPopup()},getKeywordsOrig:function(){return p(".wpseo_keyword_tab").map(function(e,t){return{keyword:(t=p(t).find(".wpseo_tablink")).data("keyword")+"",score:t.data("score")}}).get()}},(n=function(){this.replaceVars=wpseoReplaceVarsL10n.replace_vars,this.language=WPGlobusCoreData.default_language,this.tab=WPGlobusCoreData.default_language,this.wpseoTab=WPGlobusCoreData.default_language,this.title_template=wpseoPostScraperL10n.title_template,this.focuskw=p("#yoast_wpseo_focuskw_text_input"),this.focuskw_hidden=p('input[name="yoast_wpseo_focuskw"]'),this.focuskwKeep=!1,this.post_slug="#editable-post-name-full",YoastSEO.app.registerPlugin("wpglobusYoastSeoPlugin",{status:"ready"}),YoastSEO.app.registerModification("content",this.contentModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("title",this.titleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_title",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_meta",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_page_title",this.pageTitleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_meta_desc",this.metaDescModification,"wpglobusYoastSeoPlugin",0),n.prototype.setScoreIcon(),p(document).on("blur",".wpglobus-snippet_title",function(e){var t=p(this),a=WPGlobusCore.getString(p("#yoast_wpseo_title").val(),t.text(),t.data("language"));YoastSEO.app.rawData.pageTitle=a,p('input[name="yoast_wpseo_title"]').val(a),p("#snippet_title").text(a)}),p(document).on("blur",".wpglobus-snippet_meta",function(e){var t=p(this),a=WPGlobusCore.getString(p("#yoast_wpseo_metadesc").val(),t.text(),t.data("language"));p("#yoast_wpseo_metadesc").val(a),p("#snippet_meta").text(a)}),p(document).on("keyup",".wpglobus-yoast_wpseo_focuskw_text_input",function(e){var t=p(this),a=t.val(),s=t.data("language");d.focuskw.val(a),d.focuskw_hidden.val(a),WPGlobusYoastSeoPremium||p("#wpseo-metabox-tabs_"+s+" .wpseo_keyword_tab .wpseo_tablink").data("keyword",a),d.updateWpseoKeyword(a,s),0==WPGlobusYoastSeo.keywordIndex[s]?p("#yoast_wpseo_focuskw_text_input_"+s).data("value",a):WPGlobusYoastSeoPremium&&WPGlobusYoastSeoPremium.setFocuskeyword(s),n.prototype.analyze()}),p("#publish,#save-post").on("mouseenter",function(e){var s,o="";p(".wpglobus-yoast_wpseo_focuskw_text_input").each(function(e,t){if((s=p(this)).data("language")==WPGlobusCoreData.default_language)if(WPGlobusYoastSeoPremium){var a=WPGlobusYoastSeo.getKeywordsOrig();o=WPGlobusCore.getString(o,a[0].keyword,s.data("language"))}else o=WPGlobusCore.getString(o,s.val(),s.data("language"));else o=WPGlobusCore.getString(o,s.val(),s.data("language"))}),d.focuskw.val(o),d.focuskw_hidden.val(o)}).on("mouseleave",function(e){if(!d.focuskwKeep){d.wpseoTab=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language");p(this);d.focuskw.val(p("#yoast_wpseo_focuskw_text_input_"+d.wpseoTab).val()),d.focuskw_hidden.val(p("#yoast_wpseo_focuskw_text_input_"+d.wpseoTab).val())}}).on("click",function(e){d.focuskwKeep=!0}),p(document).on("tabsactivate",WPGlobusYoastSeo.wpseoTabSelector,function(e,t){if(d.language=t.newPanel.attr("data-language"),WPGlobusYoastSeo.wpseoTab=d.language,t.newPanel.attr("data-language")===WPGlobusCoreData.default_language){var a;if(WPGlobusYoastSeoPremium)p("#wpseo-meta-section-content_"+WPGlobusYoastSeoPremium.dLang+" .wpseo_keyword_tab").removeClass("active"),p("#wpseo-meta-section-content_"+WPGlobusYoastSeoPremium.dLang+" .wpseo_keyword_tab").eq(WPGlobusYoastSeo.keywordIndex[WPGlobusYoastSeoPremium.dLang]).addClass("active"),a=p("#yoast_wpseo_focuskw_text_input_"+WPGlobusYoastSeoPremium.dLang).val();else a=p("#yoast_wpseo_focuskw_text_input_"+WPGlobusCoreData.default_language).val();YoastSEO.app.rawData.keyword=a,d.focuskw.val(a),d.focuskw_hidden.val(a)}p("#wpseo-metabox-tabs_"+d.language+" .wpseo_keyword_tab").each(function(e,t){if(p(t).hasClass("active"))return WPGlobusYoastSeo.keywordIndex[d.language]=e,!1}),n.prototype.analyze()}),d=this}).prototype.analyze=function(){var e=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language");e==WPGlobusCoreData.default_language?YoastSEO.app.snippetPreview.data.urlPath=p("#editable-post-name-full").text():0!=p("#editable-post-name-full-"+e).length?YoastSEO.app.snippetPreview.data.urlPath=p("#editable-post-name-full-"+e).text():YoastSEO.app.snippetPreview.data.urlPath=p("#editable-post-name-full").text(),YoastSEO.app.analyzeTimer(YoastSEO.app),n.prototype.setScoreIcon()},n.prototype.setScoreIcon=function(){var s;s=setInterval(function(){var e=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language"),t=p("#wpseo-meta-section-content .wpseo_generic_tab a").data("score"),a=p("#wpseo-meta-section-content .wpseo_keyword_tab a").data("score");""!=t&&(p("#wpseo-metabox-tabs_"+e+" .wpseo_generic_tab .wpseo-score-icon").removeClass("bad ok good 100 na"),p("#wpseo-metabox-tabs_"+e+" .wpseo_generic_tab .wpseo-score-icon").addClass(t)),void 0!==a&&""!=a&&(WPGlobusYoastSeoPremium&&e!=WPGlobusYoastSeoPremium.dLang?(p("#wpseo-metabox-tabs_"+e+" .wpglobus-wpseo_keyword_tab .wpseo-score-icon").removeClass("bad ok good 100 na"),p("#wpseo-metabox-tabs_"+e+" .wpglobus-wpseo_keyword_tab .wpseo-score-icon").addClass(a)):(p("#wpseo-metabox-tabs_"+e+" .wpseo_keyword_tab .wpseo-score-icon").removeClass("bad ok good 100 na"),p("#wpseo-metabox-tabs_"+e+" .wpseo_keyword_tab .wpseo-score-icon").addClass(a))),clearInterval(s)},1500)},n.prototype.getWPseoTab=function(){return p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language")},n.prototype.citeModification=function(e){var t="#snippet_citeBase_"+e,a="#snippet_cite_"+e,s=p("#wpseo-tab-"+e).data("yoast-cite-base");!1===p("#wpseo-tab-"+e).data("cite-contenteditable")&&p(a).attr("contenteditable","false"),p(t).text(s)},n.prototype.pageTitleModification=function(e){var a,s,o,n="#snippet_title_",i="",l="";if(d.title_template==e)p.each(WPGlobusCoreData.enabled_languages,function(e,t){s=p("#snippet-editor-title_"+t).val(),o=0==s.length?d.title_template:s,i=d.replaceVariablesPlugin(o),p(n+t).text(i),t==d.getWPseoTab()&&(l=i)});else{if(a=WPGlobusCore.getTranslations(e),d.getWPseoTab()!==WPGlobusCoreData.default_language&&a[WPGlobusCoreData.default_language]==e){var t=d.getWPseoTab();return s=p("#snippet-editor-title_"+t).val(),o=0<s.length?s:d.title_template,o=d.replaceVariablesPlugin(o),p(n+t).text(o),o}p.each(WPGlobusCoreData.enabled_languages,function(e,t){i=""===a[t]?d.replaceVariablesPlugin(d.title_template):d.replaceVariablesPlugin(a[t]),t==d.getWPseoTab()&&(l=i,0!=(s=p("#snippet-editor-title_"+t).val()).length?s!=l&&(l=d.replaceVariablesPlugin(s)):l=d.replaceVariablesPlugin(d.title_template)),p(n+t).html(l)})}return l},n.prototype.metaDescModification=function(a){var e,s="#snippet_meta_",t=WPGlobusCore.getTranslations(a),o="";if(e=p("#snippet-editor-meta-description_"+d.getWPseoTab()).val(),d.getWPseoTab()===WPGlobusCoreData.default_language||t[WPGlobusCoreData.default_language]!=a)return p.each(WPGlobusCoreData.enabled_languages,function(e,t){p(s+t).text(WPGlobusCore.TextFilter(a,t,"RETURN_EMPTY")),d.citeModification(t)}),e==t[d.getWPseoTab()]?0==(o=t[d.getWPseoTab()]).length&&p(s+d.getWPseoTab()).text(WPGlobusCore.TextFilter(YoastSEO.app.snippetPreview.data.metaDesc,WPGlobusCoreData.default_language,"RETURN_EMPTY")):0==(o=e).length?p(s+d.getWPseoTab()).text(WPGlobusCore.TextFilter(YoastSEO.app.snippetPreview.data.metaDesc,WPGlobusCoreData.default_language,"RETURN_EMPTY")):p(s+d.getWPseoTab()).text(o),p(s+d.getWPseoTab()).text(o),o;var n=d.getWPseoTab();return d.citeModification(n),0==e.length?p(s+n).text(""):e!=a&&p(s+n).text(e),a},n.prototype.snippetModification=function(e){return WPGlobusCore.TextFilter(e,d.getWPseoTab(),"RETURN_EMPTY")},n.prototype.contentModification=function(e){return d.getWPseoTab()==WPGlobusCoreData.default_language?e:p("#content_"+d.getWPseoTab()).val()},n.prototype.titleModification=function(e){return setTimeout(d.updatePageAnalysis,1e3),d.getWPseoTab()==WPGlobusCoreData.default_language?e:p("#title_"+d.getWPseoTab()).val()},n.prototype.defaultReplace=function(e){var t=YoastSEO.app.rawData.keyword;return e.replace(/%%sitedesc%%/g,this.replaceVars.sitedesc).replace(/%%sitename%%/g,WPGlobusCore.TextFilter(this.replaceVars.sitename,d.getWPseoTab())).replace(/%%term_title%%/g,this.replaceVars.term_title).replace(/%%term_description%%/g,this.replaceVars.term_description).replace(/%%category_description%%/g,this.replaceVars.category_description).replace(/%%tag_description%%/g,this.replaceVars.tag_description).replace(/%%searchphrase%%/g,this.replaceVars.searchphrase).replace(/%%date%%/g,this.replaceVars.date).replace(/%%id%%/g,this.replaceVars.id).replace(/%%page%%/g,this.replaceVars.page).replace(/%%currenttime%%/g,this.replaceVars.currenttime).replace(/%%currentdate%%/g,this.replaceVars.currentdate).replace(/%%currentday%%/g,this.replaceVars.currentday).replace(/%%currentmonth%%/g,this.replaceVars.currentmonth).replace(/%%currentyear%%/g,this.replaceVars.currentyear).replace(/%%focuskw%%/g,t)},n.prototype.replaceVariablesPlugin=function(e){return void 0!==e&&(e=this.titleReplace(e),e=this.defaultReplace(e),e=this.replaceSeparators(e)),e},n.prototype.replaceSeparators=function(e){return e.replace(/%%sep%%(\s+%%sep%%)*/g,this.replaceVars.sep)},n.prototype.titleReplace=function(e){var t="";return void 0===(t=this.language==WPGlobusCoreData.default_language?p("#title").val():p("#title_"+this.language).val())&&(t=YoastSEO.app.rawData.pageTitle),this.language!=WPGlobusCoreData.default_language&&0==t.length&&(t=p("#title").val()),e=e.replace(/%%title%%/g,t)},n.prototype.doubleSepReplace=function(e){var t=YoastSEO.app.stringHelper.addEscapeChars(this.replaceVars.sep),a=new RegExp(t+" "+t,"g");return e=e.replace(a,this.replaceVars.sep)},n.prototype.updateWpseoKeyword=function(e,t){0<p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").length&&p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").removeClass("wpseo-keyword").addClass("wpglobus-wpseo_keyword_"+t),p(".wpglobus-wpseo_keyword_"+t).text(e)},n.prototype.updatePageAnalysis=function(){p("#wpseo-pageanalysis_"+d.getWPseoTab()).html(p("#wpseo-pageanalysis").html()),p("#yoast-seo-content-analysis_"+d.getWPseoTab()).html(p("#yoast-seo-content-analysis").html()),p("#yoast-seo-content-analysis_"+d.getWPseoTab()+" li a").css({float:"none"})},window.WPGlobusYoastSeoPlugin=new n}});
includes/js/wpglobus-yoastseo-44.min.js CHANGED
@@ -1 +1 @@
1
- var WPGlobusYoastSeo,WPGlobusYoastSeoPremium=!1;jQuery(document).ready(function(p){"use strict";var r;if("undefined"!=typeof wpseoReplaceVarsL10n&&("undefined"!=typeof WPGlobusCoreData&&"undefined"!=typeof WPGlobusVendor))if("edit-tags.php"==WPGlobusVendor.pagenow||"term.php"==WPGlobusVendor.pagenow){r=WPGlobusYoastSeo={editorIDs:["description"],editor:{},submitId:"#submit",preventChangeEditor:!1,observer:null,init:function(){r.attachListeners(),_.delay(r.start,1500)},submit:function(e){"mouseenter"===e.type?p.each(r.editor,function(e,t){!r.editor[e].contentEditor||r.editor[e].contentEditor.isHidden()?p("#"+e).val(r.editor[e].content):tinymce.get(e).setContent(r.editor[e].content)}):"mouseleave"===e.type?r.preventChangeEditor||(p.each(r.editor,function(e,t){!r.editor[e].contentEditor||r.editor[e].contentEditor.isHidden()?p("#"+e).val(WPGlobusCore.TextFilter(t.content,r.getCurrentTab(),"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,r.getCurrentTab(),"RETURN_EMPTY"))}),r.preventChangeEditor=!1):"click"===e.type&&(r.preventChangeEditor=!0,"tinymce"!=getUserSetting("editor")&&setUserSetting("editor","tinymce"))},attachListeners:function(){p(".wrap").on("tabsactivate",function(e,a){p.each(r.editor,function(e,t){!r.editor[e].contentEditor||r.editor[e].contentEditor.isHidden()?p("#"+e).val(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY"))})}),p(document).on("mouseenter",r.submitId,r.submit).on("mouseleave",r.submitId,r.submit).on("click",r.submitId,r.submit),p(document).on("tinymce-editor-init",function(e,t){if(-1!=_.indexOf(r.editorIDs,t.id)){var a=p("#"+t.id);r.editor[t.id]={},r.editor[t.id].contentEditor=t,r.editor[t.id].content=a.val(),t.setContent(WPGlobusCore.TextFilter(r.editor[t.id].content,WPGlobusCoreData.default_language,"RETURN_EMPTY")),p("#"+t.getContainer().id).find("iframe").addClass("wpglobus-translatable"),a.removeClass("hidden"),t.on("nodechange keyup",_.debounce(r.update,500)),a.on("input keyup",_.debounce(r.update,500))}})},update:function(e){var t,a;void 0!==e.target&&("tinymce"==(t=e.target.id)&&(t=e.target.dataset.id),void 0!==r.editor[t].contentEditor&&(a=!r.editor[t].contentEditor||r.editor[t].contentEditor.isHidden()?p("#"+t).val():r.editor[t].contentEditor.getContent({format:"raw"}),r.editor[t].content=WPGlobusCore.getString(r.editor[t].content,a,r.getCurrentTab())))},getCurrentTab:function(){return p(".wpglobus-taxonomy-tabs-list .ui-tabs-active").data("language")},start:function(){p(".wpglobus-element_description").css({display:"none"})}},WPGlobusYoastSeo.init();var n=function(){p(".wrap").on("tabsactivate",function(e,t){t.newTab[0].dataset.language==WPGlobusCoreData.default_language?p("#poststuff .inside").css({display:"block"}):p("#poststuff .inside").css({display:"none"})}),p.each(["category_description","sitedesc","sitename","tag_description","term_description","term_title"],function(e,t){wpseoReplaceVarsL10n.replace_vars[t]=WPGlobusCore.TextFilter(wpseoReplaceVarsL10n.replace_vars[t],WPGlobusCoreData.default_language)}),WPGlobusYoastSeo.observer=new MutationObserver(function(e){e.forEach(function(e){if("placeholder"==e.attributeName){WPGlobusYoastSeo.observer.disconnect();var t=p("#wpseo_focuskw");""==t.val()&&t.attr("placeholder",WPGlobusCore.TextFilter(t.attr("placeholder"),WPGlobusCoreData.default_language)),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0})}})}),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0})};window.WPGlobusYoastSeoPlugin=new n}else{var d;r=WPGlobusYoastSeo={wpseoTabSelector:"#wpglobus-wpseo-tabs",url:"",attrs:p("#wpglobus-wpseo-attr"),iB:p("#wpseo-meta-section-content"),t:p("#wpseo-meta-section-content"),ids:"",names:"",wpseoTab:WPGlobusCoreData.default_language,editSnippetButtonClass:"wpglobus-snippet-editor__edit-button",editSnippetFormClass:"wpglobus-snippet-editor__form",editSnippetSubmitClass:"wpglobus-snippet-editor__submit",editSnippetHeadingClass:"wpglobus-snippet-editor__heading-editor",yoastTitleProgress:"wpglobus-yoast-title-progress",yoastMetadescProgress:"wpglobus-yoast-metadesc-progress",yoastPremium:WPGlobusVendor.vendor.WPSEO_PREMIUM,keywordIndex:{},init:function(){p.each(WPGlobusCoreData.enabled_languages,function(e,t){r.keywordIndex[t]=0}),r.start()},initAddKeywordPopup:function(){1==p("#wpseo-add-keyword-popup").length?p(".wpseo-add-keyword").on("click",r.addKeywordPopup):WPGlobusYoastSeoPremium&&WPGlobusYoastSeoPremium.addKeywordButton()},addKeywordPopup:function(){var e=p("#wpseo-add-keyword-popup-button").text();tb_show(e,"#TB_inline?width=650&height=350&inlineId=wpseo-add-keyword-popup","group"),p("#TB_window").css({width:"680px",height:"350px"})},qtip:function(){p(".yoast_help").qtip({content:{attr:"alt"},position:{my:"bottom left",at:"top center"},style:{tip:{corner:!0},classes:"yoast-qtip qtip-rounded qtip-blue"},show:"click",hide:{fixed:!0,delay:500}})},removeClasses:function(t,e){_.each(e,function(e){t.removeClass(e)})},updateProgressBar:function(e,t){if(void 0!==e&&(void 0!==t||("undefined"!==e.data("language")&&(t=e.data("language")),void 0!==t))){var a,s,o=["snippet-editor__progress--bad","snippet-editor__progress--ok","snippet-editor__progress--good"],n="",i=0,l=!1;s=e.val().length,e.hasClass("wpglobus-snippet-editor-title")?(i=(a=p("progress."+r.yoastTitleProgress+"_"+t)).attr("max"),n=o[2],0==s?n=o[1]:i<s?(n=o[1],l=!0):0<s&&s<35&&(n=o[1])):e.hasClass("wpglobus-snippet-editor-meta-description")&&(i=(a=p("progress."+r.yoastMetadescProgress+"_"+t)).attr("max"),n=o[2],0==s?n=o[1]:i<s?(n=o[1],l=!0):0<s&&s<121&&(n=o[1])),r.removeClasses(a,o),a.attr("value",s).addClass(n),l?e.css("color","#f00"):e.css("color","#000")}},updateWpseoKeyword:function(e,t){p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").text(e)},start:function(){p(r.wpseoTabSelector).tabs(),r.ids=r.attrs.data("ids"),r.names=r.attrs.data("names"),r.ids=r.ids+","+r.attrs.data("qtip"),r.ids=r.ids.split(","),r.names=r.names.split(","),p("#wpglobus-wpseo-tabs").insertBefore(r.iB),p(".wpseo-metabox-tabs").css({height:"26px"}),p(".wpglobus-wpseo-general").each(function(e,t){var a=p(t),s=a.data("language"),o="wpseo-meta-section-content_"+s;a.html('<div id="'+o+'" class="wpseo-meta-section wpglobus-wpseo-meta-section" style="width:100%" data-language="'+s+'">'+r.t.html()+"</div>"),p("#"+o+" .wpseo-metabox-tabs").attr("id","wpseo-metabox-tabs_"+s).attr("data-language",s),p("#"+o+" .wpseotab").attr("id","wpseo_content_"+s),p("#wpseo_content_"+s).css({float:"left"}),p("#"+o).css({display:"block"}),p("#wpseo_meta").css({overflow:"hidden"}),p("#"+o+" .snippet_container").addClass("wpglobus-snippet_container"),s!==WPGlobusCoreData.default_language&&p("#"+o+" .wpseo-add-keyword").addClass("hidden"),p.each(r.names,function(e,t){p("#"+t).attr("name",t+"_"+s)}),p.each(r.ids,function(e,t){var a=p("#"+t);"wpseosnippet"==t&&a.addClass("wpglobus-wpseosnippet"),"snippet_title"==t&&a.addClass("wpglobus-snippet_title"),"snippet_meta"==t&&a.addClass("wpglobus-snippet_meta"),"snippet_cite"==t&&a.addClass("wpglobus-snippet_cite"),"snippet_citeBase"==t&&a.addClass("wpglobus-snippet_citeBase"),"url_container"==t&&a.css({height:"16px"}),"yoast_wpseo_focuskw_text_input"==t&&(a.addClass("wpglobus-yoast_wpseo_focuskw_text_input"),a.attr("data-value",""),a.parents("div#wpseofocuskeyword").attr("id","wpseofocuskeyword_"+s)),"yoast_wpseo_focuskeywords"==t&&a.addClass("wpglobus-yoast_wpseo_focuskeywords"),"wpseo-pageanalysis"==t&&a.addClass("wpglobus-wpseo-pageanalysis"),"yoast-seo-content-analysis"==t&&a.addClass("wpglobus-yoast-seo-content-analysis"),"snippet_preview"==t&&a.addClass("wpglobus-snippet_preview"),"snippet-editor-title"==t&&(a.addClass("wpglobus-snippet-editor-title"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),a.val(p("#wpseo-tab-"+s).data("wpseotitle")),a.parent("label").next("progress").addClass(r.yoastTitleProgress).addClass(r.yoastTitleProgress+"_"+s),_.debounce(r.updateProgressBar(a,s),500)),"snippet-editor-slug"==t&&(a.addClass("wpglobus-snippet-editor-slug"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),WPGlobusCoreData.default_language!=s&&a.attr("disabled","disabled")),"snippet-editor-meta-description"==t&&(a.addClass("wpglobus-snippet-editor-meta-description"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),a.val(p("#wpseo-tab-"+s).data("metadesc")),a.parent("label").next("progress").addClass(r.yoastMetadescProgress).addClass(r.yoastMetadescProgress+"_"+s),_.debounce(r.updateProgressBar(a,s),500)),"snippetpreview-help-toggle"==t&&(a.addClass("wpglobus-snippetpreview-help-toggle_"+s),p(document).on("click",".wpglobus-snippetpreview-help-toggle_"+s,function(e){var t=p(this);"none"===p("#snippetpreview-help_"+t.data("language")).css("display")?p("#snippetpreview-help_"+t.data("language")).css({display:"block"}):p("#snippetpreview-help_"+t.data("language")).css({display:"none"})})),"focuskw_text_input-help-toggle"==t&&(a.addClass("wpglobus-focuskw_text_input-help-toggle_"+s),p(document).on("click",".wpglobus-focuskw_text_input-help-toggle_"+s,function(e){var t=p(this);"none"===p("#focuskw_text_input-help_"+t.data("language")).css("display")?p("#focuskw_text_input-help_"+t.data("language")).css({display:"block"}):p("#focuskw_text_input-help_"+t.data("language")).css({display:"none"})})),"pageanalysis-help-toggle"==t&&(a.addClass("wpglobus-pageanalysis-help-toggle_"+s),p(document).on("click",".wpglobus-pageanalysis-help-toggle_"+s,function(e){var t=p(this);"none"===p("#pageanalysis-help_"+t.data("language")).css("display")?p("#pageanalysis-help_"+t.data("language")).css({display:"block"}):p("#pageanalysis-help_"+t.data("language")).css({display:"none"})})),"snippet_preview"==t&&(WPGlobusYoastSeoPremium||a.css({"margin-bottom":"20px"})),"wpseo-focuskeyword-section"==t&&(WPGlobusYoastSeoPremium||a.css({"margin-bottom":"20px"})),"pageanalysis"==t&&(WPGlobusYoastSeoPremium||s==WPGlobusCoreData.default_language&&setTimeout(function(){var a=0,s=0,e=WPGlobusCoreData.default_language;p("#pageanalysis_"+e+" #wpseo-pageanalysis_"+e+" li.score").each(function(e,t){s+=p(t).outerHeight(!0)}),p.each(WPGlobusCoreData.enabled_languages,function(e,t){a=s+50,p("#pageanalysis_"+t).css({height:a+"px"})})},4e3)),"wpseo-pageanalysis-section"==t&&(WPGlobusYoastSeoPremium||a.css({height:"inherit"})),a.attr("id",t+"_"+s),p("#"+t+"_"+s).attr("data-language",s)});var n=WPGlobusCore.TextFilter(p("#yoast_wpseo_focuskw_text_input").val(),s,"RETURN_EMPTY");p("#yoast_wpseo_focuskw_text_input_"+s).val(n).data("value",n),p("#yoast_wpseo_focuskw_"+s).val(n),WPGlobusYoastSeoPremium||p("#wpseo-metabox-tabs_"+s+" .wpseo_keyword_tab .wpseo_tablink").data("keyword",n),r.updateWpseoKeyword(n,s),s!==WPGlobusCoreData.default_language&&(p("#"+o+" #yoast_wpseo_focuskw_text_input_"+s).addClass("hidden").after('<div class="wpglobus-suggest" style="font-weight:bold;">'+WPGlobusVendor.i18n.yoastseo_plus_access+"</div>"),p("#"+o+" #wpseo-pageanalysis_"+s).addClass("hidden").css({display:"none"})),WPGlobusYoastSeoPremium&&(s==WPGlobusCoreData.default_language||(p("#wpseo-metabox-tabs_"+s+" .wpseo_keyword_tab").removeClass("wpseo_keyword_tab").addClass("wpglobus-wpseo_keyword_tab"),p("#wpseo-meta-section-content_"+s+" .wpseo_keyword_tab_hideable").css({display:"none"}).attr("data-language",s)))}),p(".wpglobus-wpseosnippet").each(function(e,t){var a=p(t),s=a.data("language");a.find("button.snippet-editor__button.snippet-editor__edit-button").addClass(r.editSnippetButtonClass).addClass(r.editSnippetButtonClass+"_"+s).attr("data-language",s),a.find(".snippet-editor__form").addClass(r.editSnippetFormClass).addClass(r.editSnippetFormClass+"_"+s),a.find(".snippet-editor__heading-editor").addClass(r.editSnippetHeadingClass).addClass(r.editSnippetHeadingClass+"_"+s),a.find(".snippet-editor__submit").addClass(r.editSnippetSubmitClass).addClass(r.editSnippetSubmitClass+"_"+s).attr("data-language",s)}),r.iB.addClass("hidden"),r.iB.css({height:0,overflow:"hidden",display:"none"}),WPGlobusYoastSeoPremium&&p("#wpseo-meta-section-content .wpseo_keyword_tab").removeClass("wpseo_keyword_tab").addClass("wpseo_keyword_tab_original");var e=WPGlobusCore.TextFilter(p("#yoast_wpseo_focuskw_text_input").val(),WPGlobusCoreData.default_language,"RETURN_EMPTY");p("#yoast_wpseo_focuskw_text_input").val(e),p("#yoast_wpseo_focuskw").val(e),p(document).on("click",".wpglobus-wpseo-general .wpseo_tablink",function(e){e.preventDefault();var t=p(this),a=t.parents("ul").data("language"),s=t.parent("li");if(a==WPGlobusCoreData.default_language||void 0!==p(document).triggerHandler("wpglobus_yoast_analysis",{language:a}))if(s.hasClass("wpseo_generic_tab"))p("#wpseo-pageanalysis_"+a).css({display:"none"}),p("#yoast-seo-content-analysis_"+a).css({display:"block"}),p("#wpseo_content_"+a+" table tr").eq(0).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(1).css({display:"none"}),p("#yoast-seo-content-analysis_"+a+" li a").css({float:"none"});else if(s.hasClass("wpseo_keyword_tab")){if(WPGlobusYoastSeoPremium&&(p("#wpseo-meta-section-content_"+a+" .wpseo_keyword_tab").removeClass("active"),t.parent(".wpseo_keyword_tab").addClass("active"),p("#wpseo-pageanalysis_"+a).css({display:"block"}),p("#yoast-seo-content-analysis_"+a).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(0).css("display",""),p("#wpseo_content_"+a+" table tr").eq(1).css("display",""),p("#wpseo-metabox-tabs_"+a+" .wpseo_keyword_tab").each(function(e,t){if(p(t).hasClass("active"))return r.keywordIndex[a]=e,!1})),!WPGlobusYoastSeoPremium&&a!=WPGlobusCoreData.default_language)return p("#wpseo-pageanalysis_"+a).css({display:"block"}),p("#yoast-seo-content-analysis_"+a).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(0).css("display",""),void p("#wpseo_content_"+a+" table tr").eq(1).css("display","");var o=r.getKeywordsOrig()[r.keywordIndex[a]].keyword;YoastSEO.app.rawData.keyword=o,p("#yoast_wpseo_focuskw_text_input").val(o),p("#yoast_wpseo_focuskw_text_input_"+a).val(o),p('input[name="yoast_wpseo_focuskw"]').val(o),n.prototype.analyze(),p("#wpseo-pageanalysis_"+a).css({display:"block"}),p("#yoast-seo-content-analysis_"+a).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(0).css("display",""),p("#wpseo_content_"+a+" table tr").eq(1).css("display","")}else s.hasClass("wpglobus-wpseo_keyword_tab")&&(p("#wpseo-pageanalysis_"+a).css({display:"block"}),p("#yoast-seo-content-analysis_"+a).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(0).css("display",""),p("#wpseo_content_"+a+" table tr").eq(1).css("display",""))}),p(".wpseo-metabox-sidebar .wpseo-meta-section-link").on("click",function(e){"#wpseo-meta-section-content"==p(this).attr("href")?p("#wpglobus-wpseo-tabs").css({display:"block"}):p("#wpglobus-wpseo-tabs").css({display:"none"})}),p(document).on("click","."+r.editSnippetButtonClass,function(e){var t=p(this),a=t.data("language"),s=p("."+r.editSnippetFormClass+"_"+a),o=p("."+r.editSnippetSubmitClass+"_"+a),n=p("."+r.editSnippetHeadingClass+"_"+a);s.hasClass("snippet-editor--hidden")?(s.removeClass("snippet-editor--hidden"),n.removeClass("snippet-editor--hidden"),o.removeClass("snippet-editor--hidden")):(s.addClass("snippet-editor--hidden"),n.addClass("snippet-editor--hidden")),t.addClass("snippet-editor--hidden")}),p(document).on("click","."+r.editSnippetSubmitClass,function(e){var t=p(this).data("language"),a=p("."+r.editSnippetButtonClass+"_"+t),s=p("."+r.editSnippetFormClass+"_"+t),o=p("."+r.editSnippetSubmitClass+"_"+t),n=p("."+r.editSnippetHeadingClass+"_"+t);a.removeClass("snippet-editor--hidden"),s.addClass("snippet-editor--hidden"),o.addClass("snippet-editor--hidden"),n.addClass("snippet-editor--hidden")}),p(document).on("keyup","input.wpglobus-snippet-editor-title",function(e){var t=p(this),a=t.data("language"),s=WPGlobusCore.getString(p('input[name="yoast_wpseo_title"]').val(),t.val(),a);p("#snippet_title_"+a).html(d.replaceVariablesPlugin(t.val())),YoastSEO.app.rawData.pageTitle=s,p('input[name="yoast_wpseo_title"]').val(s),p("#snippet_title").text(s),_.debounce(r.updateProgressBar(t,a),500)}),p(document).on("keyup","input.wpglobus-snippet-editor-slug",function(e){var t=p(this),a=t.data("language");p("#snippet_cite_"+a).text(t.val()+"/"),p("#editable-post-name").text(t.val()),p("#editable-post-name-full").text(t.val())}),p(document).on("change","input.wpglobus-snippet-editor-slug",function(e){var t=p(this);p.post(ajaxurl,{action:"sample-permalink",post_id:p("#post_ID").val()||0,new_slug:t.val(),new_title:p("#title").val(),samplepermalinknonce:p("#samplepermalinknonce").val()})}),p(document).on("keyup","textarea.wpglobus-snippet-editor-meta-description",function(e){var t=p(this),a=t.data("language");p("#snippet_meta_"+a).text(t.val());var s=WPGlobusCore.getString(p("#yoast_wpseo_metadesc").val(),t.val(),t.data("language"));p("#yoast_wpseo_metadesc").val(s),p("#snippet_meta").text(s),_.debounce(r.updateProgressBar(t,a),500)}),p(document).on("click",".wpglobus-post-body-tabs-list li",function(e){var t=p(this);if(t.hasClass("wpglobus-post-tab")){p("#wpglobus-wpseo-tabs").tabs("option","active",t.data("order"));var a=p("#yoast_wpseo_focuskw_text_input_"+t.data("language")).val();YoastSEO.app.rawData.keyword=a,p("#yoast_wpseo_focuskw_text_input").val(a),p('input[name="yoast_wpseo_focuskw"]').val(a),n.prototype.analyze()}}),r.initAddKeywordPopup()},getKeywordsOrig:function(){return p(".wpseo_keyword_tab").map(function(e,t){return{keyword:(t=p(t).find(".wpseo_tablink")).data("keyword")+"",score:t.data("score")}}).get()}},(n=function(){this.replaceVars=wpseoReplaceVarsL10n.replace_vars,this.language=WPGlobusCoreData.default_language,this.tab=WPGlobusCoreData.default_language,this.wpseoTab=WPGlobusCoreData.default_language,this.title_template=wpseoPostScraperL10n.title_template,this.focuskw=p("#yoast_wpseo_focuskw_text_input"),this.focuskw_hidden=p('input[name="yoast_wpseo_focuskw"]'),this.focuskwKeep=!1,this.post_slug="#editable-post-name-full",YoastSEO.app.registerPlugin("wpglobusYoastSeoPlugin",{status:"ready"}),YoastSEO.app.registerModification("content",this.contentModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("title",this.titleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_title",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_meta",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_page_title",this.pageTitleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_meta_desc",this.metaDescModification,"wpglobusYoastSeoPlugin",0),n.prototype.setScoreIcon(),p(document).on("blur",".wpglobus-snippet_title",function(e){var t=p(this),a=WPGlobusCore.getString(p("#yoast_wpseo_title").val(),t.text(),t.data("language"));YoastSEO.app.rawData.pageTitle=a,p('input[name="yoast_wpseo_title"]').val(a),p("#snippet_title").text(a)}),p(document).on("blur",".wpglobus-snippet_meta",function(e){var t=p(this),a=WPGlobusCore.getString(p("#yoast_wpseo_metadesc").val(),t.text(),t.data("language"));p("#yoast_wpseo_metadesc").val(a),p("#snippet_meta").text(a)}),p(document).on("keyup",".wpglobus-yoast_wpseo_focuskw_text_input",function(e){var t=p(this),a=t.val(),s=t.data("language");d.focuskw.val(a),d.focuskw_hidden.val(a),WPGlobusYoastSeoPremium||p("#wpseo-metabox-tabs_"+s+" .wpseo_keyword_tab .wpseo_tablink").data("keyword",a),d.updateWpseoKeyword(a,s),0==WPGlobusYoastSeo.keywordIndex[s]?p("#yoast_wpseo_focuskw_text_input_"+s).data("value",a):WPGlobusYoastSeoPremium&&WPGlobusYoastSeoPremium.setFocuskeyword(s),n.prototype.analyze()}),p("#publish,#save-post").on("mouseenter",function(e){var s,o="";p(".wpglobus-yoast_wpseo_focuskw_text_input").each(function(e,t){if((s=p(this)).data("language")==WPGlobusCoreData.default_language)if(WPGlobusYoastSeoPremium){var a=WPGlobusYoastSeo.getKeywordsOrig();o=WPGlobusCore.getString(o,a[0].keyword,s.data("language"))}else o=WPGlobusCore.getString(o,s.val(),s.data("language"));else o=WPGlobusCore.getString(o,s.val(),s.data("language"))}),d.focuskw.val(o),d.focuskw_hidden.val(o)}).on("mouseleave",function(e){if(!d.focuskwKeep){d.wpseoTab=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language");p(this);d.focuskw.val(p("#yoast_wpseo_focuskw_text_input_"+d.wpseoTab).val()),d.focuskw_hidden.val(p("#yoast_wpseo_focuskw_text_input_"+d.wpseoTab).val())}}).on("click",function(e){d.focuskwKeep=!0}),p(document).on("tabsactivate",WPGlobusYoastSeo.wpseoTabSelector,function(e,t){if(d.language=t.newPanel.attr("data-language"),WPGlobusYoastSeo.wpseoTab=d.language,t.newPanel.attr("data-language")===WPGlobusCoreData.default_language){var a;if(WPGlobusYoastSeoPremium)p("#wpseo-meta-section-content_"+WPGlobusYoastSeoPremium.dLang+" .wpseo_keyword_tab").removeClass("active"),p("#wpseo-meta-section-content_"+WPGlobusYoastSeoPremium.dLang+" .wpseo_keyword_tab").eq(WPGlobusYoastSeo.keywordIndex[WPGlobusYoastSeoPremium.dLang]).addClass("active"),a=p("#yoast_wpseo_focuskw_text_input_"+WPGlobusYoastSeoPremium.dLang).val();else a=p("#yoast_wpseo_focuskw_text_input_"+WPGlobusCoreData.default_language).val();YoastSEO.app.rawData.keyword=a,d.focuskw.val(a),d.focuskw_hidden.val(a)}p("#wpseo-metabox-tabs_"+d.language+" .wpseo_keyword_tab").each(function(e,t){if(p(t).hasClass("active"))return WPGlobusYoastSeo.keywordIndex[d.language]=e,!1}),n.prototype.analyze()}),d=this}).prototype.analyze=function(){var e=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language");e==WPGlobusCoreData.default_language?YoastSEO.app.snippetPreview.data.urlPath=p("#editable-post-name-full").text():0!=p("#editable-post-name-full-"+e).length?YoastSEO.app.snippetPreview.data.urlPath=p("#editable-post-name-full-"+e).text():YoastSEO.app.snippetPreview.data.urlPath=p("#editable-post-name-full").text(),YoastSEO.app.analyzeTimer(YoastSEO.app),n.prototype.setScoreIcon()},n.prototype.setScoreIcon=function(){var s;s=setInterval(function(){var e=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language"),t=p("#wpseo-meta-section-content .wpseo_generic_tab a").data("score"),a=p("#wpseo-meta-section-content .wpseo_keyword_tab a").data("score");""!=t&&(p("#wpseo-metabox-tabs_"+e+" .wpseo_generic_tab .wpseo-score-icon").removeClass("bad ok good 100 na"),p("#wpseo-metabox-tabs_"+e+" .wpseo_generic_tab .wpseo-score-icon").addClass(t)),void 0!==a&&""!=a&&(WPGlobusYoastSeoPremium&&e!=WPGlobusYoastSeoPremium.dLang?(p("#wpseo-metabox-tabs_"+e+" .wpglobus-wpseo_keyword_tab .wpseo-score-icon").removeClass("bad ok good 100 na"),p("#wpseo-metabox-tabs_"+e+" .wpglobus-wpseo_keyword_tab .wpseo-score-icon").addClass(a)):(p("#wpseo-metabox-tabs_"+e+" .wpseo_keyword_tab .wpseo-score-icon").removeClass("bad ok good 100 na"),p("#wpseo-metabox-tabs_"+e+" .wpseo_keyword_tab .wpseo-score-icon").addClass(a))),clearInterval(s)},1500)},n.prototype.getWPseoTab=function(){return p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language")},n.prototype.citeModification=function(e){var t="#snippet_citeBase_"+e,a="#snippet_cite_"+e,s=p("#wpseo-tab-"+e).data("yoast-cite-base");!1===p("#wpseo-tab-"+e).data("cite-contenteditable")&&p(a).attr("contenteditable","false"),p(t).text(s)},n.prototype.pageTitleModification=function(e){var a,s,o,n="#snippet_title_",i="",l="";if(d.title_template==e)p.each(WPGlobusCoreData.enabled_languages,function(e,t){s=p("#snippet-editor-title_"+t).val(),o=0==s.length?d.title_template:s,i=d.replaceVariablesPlugin(o),p(n+t).text(i),t==d.getWPseoTab()&&(l=i)});else{if(a=WPGlobusCore.getTranslations(e),d.getWPseoTab()!==WPGlobusCoreData.default_language&&a[WPGlobusCoreData.default_language]==e){var t=d.getWPseoTab();return s=p("#snippet-editor-title_"+t).val(),o=0<s.length?s:d.title_template,o=d.replaceVariablesPlugin(o),p(n+t).text(o),o}p.each(WPGlobusCoreData.enabled_languages,function(e,t){i=""===a[t]?d.replaceVariablesPlugin(d.title_template):d.replaceVariablesPlugin(a[t]),t==d.getWPseoTab()&&(l=i,0!=(s=p("#snippet-editor-title_"+t).val()).length?s!=l&&(l=d.replaceVariablesPlugin(s)):l=d.replaceVariablesPlugin(d.title_template)),p(n+t).html(l)})}return l},n.prototype.metaDescModification=function(a){var e,s="#snippet_meta_",t=WPGlobusCore.getTranslations(a),o="";if(e=p("#snippet-editor-meta-description_"+d.getWPseoTab()).val(),d.getWPseoTab()!==WPGlobusCoreData.default_language&&t[WPGlobusCoreData.default_language]==a){var n=d.getWPseoTab();return d.citeModification(n),0==e.length?p(s+n).text(""):e!=a&&p(s+n).text(e),a}return p.each(WPGlobusCoreData.enabled_languages,function(e,t){p(s+t).text(WPGlobusCore.TextFilter(a,t,"RETURN_EMPTY")),d.citeModification(t)}),e==t[d.getWPseoTab()]?0==(o=t[d.getWPseoTab()]).length&&p(s+d.getWPseoTab()).text(WPGlobusCore.TextFilter(YoastSEO.app.snippetPreview.data.metaDesc,WPGlobusCoreData.default_language,"RETURN_EMPTY")):0==(o=e).length?p(s+d.getWPseoTab()).text(WPGlobusCore.TextFilter(YoastSEO.app.snippetPreview.data.metaDesc,WPGlobusCoreData.default_language,"RETURN_EMPTY")):p(s+d.getWPseoTab()).text(o),p(s+d.getWPseoTab()).text(o),o},n.prototype.snippetModification=function(e){return WPGlobusCore.TextFilter(e,d.getWPseoTab(),"RETURN_EMPTY")},n.prototype.contentModification=function(e){return d.getWPseoTab()==WPGlobusCoreData.default_language?e:p("#content_"+d.getWPseoTab()).val()},n.prototype.titleModification=function(e){return setTimeout(d.updatePageAnalysis,1e3),d.getWPseoTab()==WPGlobusCoreData.default_language?e:p("#title_"+d.getWPseoTab()).val()},n.prototype.defaultReplace=function(e){var t=YoastSEO.app.rawData.keyword;return e.replace(/%%sitedesc%%/g,this.replaceVars.sitedesc).replace(/%%sitename%%/g,WPGlobusCore.TextFilter(this.replaceVars.sitename,d.getWPseoTab())).replace(/%%term_title%%/g,this.replaceVars.term_title).replace(/%%term_description%%/g,this.replaceVars.term_description).replace(/%%category_description%%/g,this.replaceVars.category_description).replace(/%%tag_description%%/g,this.replaceVars.tag_description).replace(/%%searchphrase%%/g,this.replaceVars.searchphrase).replace(/%%date%%/g,this.replaceVars.date).replace(/%%id%%/g,this.replaceVars.id).replace(/%%page%%/g,this.replaceVars.page).replace(/%%currenttime%%/g,this.replaceVars.currenttime).replace(/%%currentdate%%/g,this.replaceVars.currentdate).replace(/%%currentday%%/g,this.replaceVars.currentday).replace(/%%currentmonth%%/g,this.replaceVars.currentmonth).replace(/%%currentyear%%/g,this.replaceVars.currentyear).replace(/%%focuskw%%/g,t)},n.prototype.replaceVariablesPlugin=function(e){return void 0!==e&&(e=this.titleReplace(e),e=this.defaultReplace(e),e=this.replaceSeparators(e)),e},n.prototype.replaceSeparators=function(e){return e.replace(/%%sep%%(\s+%%sep%%)*/g,this.replaceVars.sep)},n.prototype.titleReplace=function(e){var t="";return void 0===(t=this.language==WPGlobusCoreData.default_language?p("#title").val():p("#title_"+this.language).val())&&(t=YoastSEO.app.rawData.pageTitle),this.language!=WPGlobusCoreData.default_language&&0==t.length&&(t=p("#title").val()),e=e.replace(/%%title%%/g,t)},n.prototype.doubleSepReplace=function(e){var t=YoastSEO.app.stringHelper.addEscapeChars(this.replaceVars.sep),a=new RegExp(t+" "+t,"g");return e=e.replace(a,this.replaceVars.sep)},n.prototype.updateWpseoKeyword=function(e,t){0<p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").length&&p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").removeClass("wpseo-keyword").addClass("wpglobus-wpseo_keyword_"+t),p(".wpglobus-wpseo_keyword_"+t).text(e)},n.prototype.updatePageAnalysis=function(){p("#wpseo-pageanalysis_"+d.getWPseoTab()).html(p("#wpseo-pageanalysis").html()),p("#yoast-seo-content-analysis_"+d.getWPseoTab()).html(p("#yoast-seo-content-analysis").html()),p("#yoast-seo-content-analysis_"+d.getWPseoTab()+" li a").css({float:"none"})},window.WPGlobusYoastSeoPlugin=new n}});
1
+ var WPGlobusYoastSeo,WPGlobusYoastSeoPremium=!1;jQuery(document).ready(function(p){"use strict";var r;if("undefined"!=typeof wpseoReplaceVarsL10n&&("undefined"!=typeof WPGlobusCoreData&&"undefined"!=typeof WPGlobusVendor))if("edit-tags.php"==WPGlobusVendor.pagenow||"term.php"==WPGlobusVendor.pagenow){r=WPGlobusYoastSeo={editorIDs:["description"],editor:{},submitId:"#submit",preventChangeEditor:!1,observer:null,init:function(){r.attachListeners(),_.delay(r.start,1500)},submit:function(e){"mouseenter"===e.type?p.each(r.editor,function(e,t){!r.editor[e].contentEditor||r.editor[e].contentEditor.isHidden()?p("#"+e).val(r.editor[e].content):tinymce.get(e).setContent(r.editor[e].content)}):"mouseleave"===e.type?r.preventChangeEditor||(p.each(r.editor,function(e,t){!r.editor[e].contentEditor||r.editor[e].contentEditor.isHidden()?p("#"+e).val(WPGlobusCore.TextFilter(t.content,r.getCurrentTab(),"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,r.getCurrentTab(),"RETURN_EMPTY"))}),r.preventChangeEditor=!1):"click"===e.type&&(r.preventChangeEditor=!0,"tinymce"!=getUserSetting("editor")&&setUserSetting("editor","tinymce"))},attachListeners:function(){p(".wrap").on("tabsactivate",function(e,a){p.each(r.editor,function(e,t){!r.editor[e].contentEditor||r.editor[e].contentEditor.isHidden()?p("#"+e).val(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY"))})}),p(document).on("mouseenter",r.submitId,r.submit).on("mouseleave",r.submitId,r.submit).on("click",r.submitId,r.submit),p(document).on("tinymce-editor-init",function(e,t){if(-1!=_.indexOf(r.editorIDs,t.id)){var a=p("#"+t.id);r.editor[t.id]={},r.editor[t.id].contentEditor=t,r.editor[t.id].content=a.val(),t.setContent(WPGlobusCore.TextFilter(r.editor[t.id].content,WPGlobusCoreData.default_language,"RETURN_EMPTY")),p("#"+t.getContainer().id).find("iframe").addClass("wpglobus-translatable"),a.removeClass("hidden"),t.on("nodechange keyup",_.debounce(r.update,500)),a.on("input keyup",_.debounce(r.update,500))}})},update:function(e){var t,a;void 0!==e.target&&("tinymce"==(t=e.target.id)&&(t=e.target.dataset.id),void 0!==r.editor[t].contentEditor&&(a=!r.editor[t].contentEditor||r.editor[t].contentEditor.isHidden()?p("#"+t).val():r.editor[t].contentEditor.getContent({format:"raw"}),r.editor[t].content=WPGlobusCore.getString(r.editor[t].content,a,r.getCurrentTab())))},getCurrentTab:function(){return p(".wpglobus-taxonomy-tabs-list .ui-tabs-active").data("language")},start:function(){p(".wpglobus-element_description").css({display:"none"})}},WPGlobusYoastSeo.init();var n=function(){p(".wrap").on("tabsactivate",function(e,t){t.newTab[0].dataset.language==WPGlobusCoreData.default_language?p("#poststuff .inside").css({display:"block"}):p("#poststuff .inside").css({display:"none"})}),p.each(["category_description","sitedesc","sitename","tag_description","term_description","term_title"],function(e,t){wpseoReplaceVarsL10n.replace_vars[t]=WPGlobusCore.TextFilter(wpseoReplaceVarsL10n.replace_vars[t],WPGlobusCoreData.default_language)}),WPGlobusYoastSeo.observer=new MutationObserver(function(e){e.forEach(function(e){if("placeholder"==e.attributeName){WPGlobusYoastSeo.observer.disconnect();var t=p("#wpseo_focuskw");""==t.val()&&t.attr("placeholder",WPGlobusCore.TextFilter(t.attr("placeholder"),WPGlobusCoreData.default_language)),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0})}})}),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0})};window.WPGlobusYoastSeoPlugin=new n}else{var d;r=WPGlobusYoastSeo={wpseoTabSelector:"#wpglobus-wpseo-tabs",url:"",attrs:p("#wpglobus-wpseo-attr"),iB:p("#wpseo-meta-section-content"),t:p("#wpseo-meta-section-content"),ids:"",names:"",wpseoTab:WPGlobusCoreData.default_language,editSnippetButtonClass:"wpglobus-snippet-editor__edit-button",editSnippetFormClass:"wpglobus-snippet-editor__form",editSnippetSubmitClass:"wpglobus-snippet-editor__submit",editSnippetHeadingClass:"wpglobus-snippet-editor__heading-editor",yoastTitleProgress:"wpglobus-yoast-title-progress",yoastMetadescProgress:"wpglobus-yoast-metadesc-progress",yoastPremium:WPGlobusVendor.vendor.WPSEO_PREMIUM,keywordIndex:{},init:function(){p.each(WPGlobusCoreData.enabled_languages,function(e,t){r.keywordIndex[t]=0}),r.start()},initAddKeywordPopup:function(){1==p("#wpseo-add-keyword-popup").length?p(".wpseo-add-keyword").on("click",r.addKeywordPopup):WPGlobusYoastSeoPremium&&WPGlobusYoastSeoPremium.addKeywordButton()},addKeywordPopup:function(){var e=p("#wpseo-add-keyword-popup-button").text();tb_show(e,"#TB_inline?width=650&height=350&inlineId=wpseo-add-keyword-popup","group"),p("#TB_window").css({width:"680px",height:"350px"})},qtip:function(){p(".yoast_help").qtip({content:{attr:"alt"},position:{my:"bottom left",at:"top center"},style:{tip:{corner:!0},classes:"yoast-qtip qtip-rounded qtip-blue"},show:"click",hide:{fixed:!0,delay:500}})},removeClasses:function(t,e){_.each(e,function(e){t.removeClass(e)})},updateProgressBar:function(e,t){if(void 0!==e&&(void 0!==t||("undefined"!==e.data("language")&&(t=e.data("language")),void 0!==t))){var a,s,o=["snippet-editor__progress--bad","snippet-editor__progress--ok","snippet-editor__progress--good"],n="",i=0,l=!1;s=e.val().length,e.hasClass("wpglobus-snippet-editor-title")?(i=(a=p("progress."+r.yoastTitleProgress+"_"+t)).attr("max"),n=o[2],0==s?n=o[1]:i<s?(n=o[1],l=!0):0<s&&s<35&&(n=o[1])):e.hasClass("wpglobus-snippet-editor-meta-description")&&(i=(a=p("progress."+r.yoastMetadescProgress+"_"+t)).attr("max"),n=o[2],0==s?n=o[1]:i<s?(n=o[1],l=!0):0<s&&s<121&&(n=o[1])),r.removeClasses(a,o),a.attr("value",s).addClass(n),l?e.css("color","#f00"):e.css("color","#000")}},updateWpseoKeyword:function(e,t){p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").text(e)},start:function(){p(r.wpseoTabSelector).tabs(),r.ids=r.attrs.data("ids"),r.names=r.attrs.data("names"),r.ids=r.ids+","+r.attrs.data("qtip"),r.ids=r.ids.split(","),r.names=r.names.split(","),p("#wpglobus-wpseo-tabs").insertBefore(r.iB),p(".wpseo-metabox-tabs").css({height:"26px"}),p(".wpglobus-wpseo-general").each(function(e,t){var a=p(t),s=a.data("language"),o="wpseo-meta-section-content_"+s;a.html('<div id="'+o+'" class="wpseo-meta-section wpglobus-wpseo-meta-section" style="width:100%" data-language="'+s+'">'+r.t.html()+"</div>"),p("#"+o+" .wpseo-metabox-tabs").attr("id","wpseo-metabox-tabs_"+s).attr("data-language",s),p("#"+o+" .wpseotab").attr("id","wpseo_content_"+s),p("#wpseo_content_"+s).css({float:"left"}),p("#"+o).css({display:"block"}),p("#wpseo_meta").css({overflow:"hidden"}),p("#"+o+" .snippet_container").addClass("wpglobus-snippet_container"),s!==WPGlobusCoreData.default_language&&p("#"+o+" .wpseo-add-keyword").addClass("hidden"),p.each(r.names,function(e,t){p("#"+t).attr("name",t+"_"+s)}),p.each(r.ids,function(e,t){var a=p("#"+t);"wpseosnippet"==t&&a.addClass("wpglobus-wpseosnippet"),"snippet_title"==t&&a.addClass("wpglobus-snippet_title"),"snippet_meta"==t&&a.addClass("wpglobus-snippet_meta"),"snippet_cite"==t&&a.addClass("wpglobus-snippet_cite"),"snippet_citeBase"==t&&a.addClass("wpglobus-snippet_citeBase"),"url_container"==t&&a.css({height:"16px"}),"yoast_wpseo_focuskw_text_input"==t&&(a.addClass("wpglobus-yoast_wpseo_focuskw_text_input"),a.attr("data-value",""),a.parents("div#wpseofocuskeyword").attr("id","wpseofocuskeyword_"+s)),"yoast_wpseo_focuskeywords"==t&&a.addClass("wpglobus-yoast_wpseo_focuskeywords"),"wpseo-pageanalysis"==t&&a.addClass("wpglobus-wpseo-pageanalysis"),"yoast-seo-content-analysis"==t&&a.addClass("wpglobus-yoast-seo-content-analysis"),"snippet_preview"==t&&a.addClass("wpglobus-snippet_preview"),"snippet-editor-title"==t&&(a.addClass("wpglobus-snippet-editor-title"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),a.val(p("#wpseo-tab-"+s).data("wpseotitle")),a.parent("label").next("progress").addClass(r.yoastTitleProgress).addClass(r.yoastTitleProgress+"_"+s),_.debounce(r.updateProgressBar(a,s),500)),"snippet-editor-slug"==t&&(a.addClass("wpglobus-snippet-editor-slug"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),WPGlobusCoreData.default_language!=s&&a.attr("disabled","disabled")),"snippet-editor-meta-description"==t&&(a.addClass("wpglobus-snippet-editor-meta-description"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),a.val(p("#wpseo-tab-"+s).data("metadesc")),a.parent("label").next("progress").addClass(r.yoastMetadescProgress).addClass(r.yoastMetadescProgress+"_"+s),_.debounce(r.updateProgressBar(a,s),500)),"snippetpreview-help-toggle"==t&&(a.addClass("wpglobus-snippetpreview-help-toggle_"+s),p(document).on("click",".wpglobus-snippetpreview-help-toggle_"+s,function(e){var t=p(this);"none"===p("#snippetpreview-help_"+t.data("language")).css("display")?p("#snippetpreview-help_"+t.data("language")).css({display:"block"}):p("#snippetpreview-help_"+t.data("language")).css({display:"none"})})),"focuskw_text_input-help-toggle"==t&&(a.addClass("wpglobus-focuskw_text_input-help-toggle_"+s),p(document).on("click",".wpglobus-focuskw_text_input-help-toggle_"+s,function(e){var t=p(this);"none"===p("#focuskw_text_input-help_"+t.data("language")).css("display")?p("#focuskw_text_input-help_"+t.data("language")).css({display:"block"}):p("#focuskw_text_input-help_"+t.data("language")).css({display:"none"})})),"pageanalysis-help-toggle"==t&&(a.addClass("wpglobus-pageanalysis-help-toggle_"+s),p(document).on("click",".wpglobus-pageanalysis-help-toggle_"+s,function(e){var t=p(this);"none"===p("#pageanalysis-help_"+t.data("language")).css("display")?p("#pageanalysis-help_"+t.data("language")).css({display:"block"}):p("#pageanalysis-help_"+t.data("language")).css({display:"none"})})),"snippet_preview"==t&&(WPGlobusYoastSeoPremium||a.css({"margin-bottom":"20px"})),"wpseo-focuskeyword-section"==t&&(WPGlobusYoastSeoPremium||a.css({"margin-bottom":"20px"})),"pageanalysis"==t&&(WPGlobusYoastSeoPremium||s==WPGlobusCoreData.default_language&&setTimeout(function(){var a=0,s=0,e=WPGlobusCoreData.default_language;p("#pageanalysis_"+e+" #wpseo-pageanalysis_"+e+" li.score").each(function(e,t){s+=p(t).outerHeight(!0)}),p.each(WPGlobusCoreData.enabled_languages,function(e,t){a=s+50,p("#pageanalysis_"+t).css({height:a+"px"})})},4e3)),"wpseo-pageanalysis-section"==t&&(WPGlobusYoastSeoPremium||a.css({height:"inherit"})),a.attr("id",t+"_"+s),p("#"+t+"_"+s).attr("data-language",s)});var n=WPGlobusCore.TextFilter(p("#yoast_wpseo_focuskw_text_input").val(),s,"RETURN_EMPTY");p("#yoast_wpseo_focuskw_text_input_"+s).val(n).data("value",n),p("#yoast_wpseo_focuskw_"+s).val(n),WPGlobusYoastSeoPremium||p("#wpseo-metabox-tabs_"+s+" .wpseo_keyword_tab .wpseo_tablink").data("keyword",n),r.updateWpseoKeyword(n,s),s!==WPGlobusCoreData.default_language&&(p("#"+o+" #yoast_wpseo_focuskw_text_input_"+s).addClass("hidden").after('<div class="wpglobus-suggest" style="font-weight:bold;">'+WPGlobusVendor.i18n.yoastseo_plus_access+"</div>"),p("#"+o+" #wpseo-pageanalysis_"+s).addClass("hidden").css({display:"none"})),WPGlobusYoastSeoPremium&&(s==WPGlobusCoreData.default_language||(p("#wpseo-metabox-tabs_"+s+" .wpseo_keyword_tab").removeClass("wpseo_keyword_tab").addClass("wpglobus-wpseo_keyword_tab"),p("#wpseo-meta-section-content_"+s+" .wpseo_keyword_tab_hideable").css({display:"none"}).attr("data-language",s)))}),p(".wpglobus-wpseosnippet").each(function(e,t){var a=p(t),s=a.data("language");a.find("button.snippet-editor__button.snippet-editor__edit-button").addClass(r.editSnippetButtonClass).addClass(r.editSnippetButtonClass+"_"+s).attr("data-language",s),a.find(".snippet-editor__form").addClass(r.editSnippetFormClass).addClass(r.editSnippetFormClass+"_"+s),a.find(".snippet-editor__heading-editor").addClass(r.editSnippetHeadingClass).addClass(r.editSnippetHeadingClass+"_"+s),a.find(".snippet-editor__submit").addClass(r.editSnippetSubmitClass).addClass(r.editSnippetSubmitClass+"_"+s).attr("data-language",s)}),r.iB.addClass("hidden"),r.iB.css({height:0,overflow:"hidden",display:"none"}),WPGlobusYoastSeoPremium&&p("#wpseo-meta-section-content .wpseo_keyword_tab").removeClass("wpseo_keyword_tab").addClass("wpseo_keyword_tab_original");var e=WPGlobusCore.TextFilter(p("#yoast_wpseo_focuskw_text_input").val(),WPGlobusCoreData.default_language,"RETURN_EMPTY");p("#yoast_wpseo_focuskw_text_input").val(e),p("#yoast_wpseo_focuskw").val(e),p(document).on("click",".wpglobus-wpseo-general .wpseo_tablink",function(e){e.preventDefault();var t=p(this),a=t.parents("ul").data("language"),s=t.parent("li");if(a==WPGlobusCoreData.default_language||void 0!==p(document).triggerHandler("wpglobus_yoast_analysis",{language:a}))if(s.hasClass("wpseo_generic_tab"))p("#wpseo-pageanalysis_"+a).css({display:"none"}),p("#yoast-seo-content-analysis_"+a).css({display:"block"}),p("#wpseo_content_"+a+" table tr").eq(0).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(1).css({display:"none"}),p("#yoast-seo-content-analysis_"+a+" li a").css({float:"none"});else if(s.hasClass("wpseo_keyword_tab")){if(WPGlobusYoastSeoPremium&&(p("#wpseo-meta-section-content_"+a+" .wpseo_keyword_tab").removeClass("active"),t.parent(".wpseo_keyword_tab").addClass("active"),p("#wpseo-pageanalysis_"+a).css({display:"block"}),p("#yoast-seo-content-analysis_"+a).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(0).css("display",""),p("#wpseo_content_"+a+" table tr").eq(1).css("display",""),p("#wpseo-metabox-tabs_"+a+" .wpseo_keyword_tab").each(function(e,t){if(p(t).hasClass("active"))return r.keywordIndex[a]=e,!1})),!WPGlobusYoastSeoPremium&&a!=WPGlobusCoreData.default_language)return p("#wpseo-pageanalysis_"+a).css({display:"block"}),p("#yoast-seo-content-analysis_"+a).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(0).css("display",""),void p("#wpseo_content_"+a+" table tr").eq(1).css("display","");var o=r.getKeywordsOrig()[r.keywordIndex[a]].keyword;YoastSEO.app.rawData.keyword=o,p("#yoast_wpseo_focuskw_text_input").val(o),p("#yoast_wpseo_focuskw_text_input_"+a).val(o),p('input[name="yoast_wpseo_focuskw"]').val(o),n.prototype.analyze(),p("#wpseo-pageanalysis_"+a).css({display:"block"}),p("#yoast-seo-content-analysis_"+a).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(0).css("display",""),p("#wpseo_content_"+a+" table tr").eq(1).css("display","")}else s.hasClass("wpglobus-wpseo_keyword_tab")&&(p("#wpseo-pageanalysis_"+a).css({display:"block"}),p("#yoast-seo-content-analysis_"+a).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(0).css("display",""),p("#wpseo_content_"+a+" table tr").eq(1).css("display",""))}),p(".wpseo-metabox-sidebar .wpseo-meta-section-link").on("click",function(e){"#wpseo-meta-section-content"==p(this).attr("href")?p("#wpglobus-wpseo-tabs").css({display:"block"}):p("#wpglobus-wpseo-tabs").css({display:"none"})}),p(document).on("click","."+r.editSnippetButtonClass,function(e){var t=p(this),a=t.data("language"),s=p("."+r.editSnippetFormClass+"_"+a),o=p("."+r.editSnippetSubmitClass+"_"+a),n=p("."+r.editSnippetHeadingClass+"_"+a);s.hasClass("snippet-editor--hidden")?(s.removeClass("snippet-editor--hidden"),n.removeClass("snippet-editor--hidden"),o.removeClass("snippet-editor--hidden")):(s.addClass("snippet-editor--hidden"),n.addClass("snippet-editor--hidden")),t.addClass("snippet-editor--hidden")}),p(document).on("click","."+r.editSnippetSubmitClass,function(e){var t=p(this).data("language"),a=p("."+r.editSnippetButtonClass+"_"+t),s=p("."+r.editSnippetFormClass+"_"+t),o=p("."+r.editSnippetSubmitClass+"_"+t),n=p("."+r.editSnippetHeadingClass+"_"+t);a.removeClass("snippet-editor--hidden"),s.addClass("snippet-editor--hidden"),o.addClass("snippet-editor--hidden"),n.addClass("snippet-editor--hidden")}),p(document).on("keyup","input.wpglobus-snippet-editor-title",function(e){var t=p(this),a=t.data("language"),s=WPGlobusCore.getString(p('input[name="yoast_wpseo_title"]').val(),t.val(),a);p("#snippet_title_"+a).html(d.replaceVariablesPlugin(t.val())),YoastSEO.app.rawData.pageTitle=s,p('input[name="yoast_wpseo_title"]').val(s),p("#snippet_title").text(s),_.debounce(r.updateProgressBar(t,a),500)}),p(document).on("keyup","input.wpglobus-snippet-editor-slug",function(e){var t=p(this),a=t.data("language");p("#snippet_cite_"+a).text(t.val()+"/"),p("#editable-post-name").text(t.val()),p("#editable-post-name-full").text(t.val())}),p(document).on("change","input.wpglobus-snippet-editor-slug",function(e){var t=p(this);p.post(ajaxurl,{action:"sample-permalink",post_id:p("#post_ID").val()||0,new_slug:t.val(),new_title:p("#title").val(),samplepermalinknonce:p("#samplepermalinknonce").val()})}),p(document).on("keyup","textarea.wpglobus-snippet-editor-meta-description",function(e){var t=p(this),a=t.data("language");p("#snippet_meta_"+a).text(t.val());var s=WPGlobusCore.getString(p("#yoast_wpseo_metadesc").val(),t.val(),t.data("language"));p("#yoast_wpseo_metadesc").val(s),p("#snippet_meta").text(s),_.debounce(r.updateProgressBar(t,a),500)}),p(document).on("click",".wpglobus-post-body-tabs-list li",function(e){var t=p(this);if(t.hasClass("wpglobus-post-tab")){p("#wpglobus-wpseo-tabs").tabs("option","active",t.data("order"));var a=p("#yoast_wpseo_focuskw_text_input_"+t.data("language")).val();YoastSEO.app.rawData.keyword=a,p("#yoast_wpseo_focuskw_text_input").val(a),p('input[name="yoast_wpseo_focuskw"]').val(a),n.prototype.analyze()}}),r.initAddKeywordPopup()},getKeywordsOrig:function(){return p(".wpseo_keyword_tab").map(function(e,t){return{keyword:(t=p(t).find(".wpseo_tablink")).data("keyword")+"",score:t.data("score")}}).get()}},(n=function(){this.replaceVars=wpseoReplaceVarsL10n.replace_vars,this.language=WPGlobusCoreData.default_language,this.tab=WPGlobusCoreData.default_language,this.wpseoTab=WPGlobusCoreData.default_language,this.title_template=wpseoPostScraperL10n.title_template,this.focuskw=p("#yoast_wpseo_focuskw_text_input"),this.focuskw_hidden=p('input[name="yoast_wpseo_focuskw"]'),this.focuskwKeep=!1,this.post_slug="#editable-post-name-full",YoastSEO.app.registerPlugin("wpglobusYoastSeoPlugin",{status:"ready"}),YoastSEO.app.registerModification("content",this.contentModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("title",this.titleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_title",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_meta",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_page_title",this.pageTitleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_meta_desc",this.metaDescModification,"wpglobusYoastSeoPlugin",0),n.prototype.setScoreIcon(),p(document).on("blur",".wpglobus-snippet_title",function(e){var t=p(this),a=WPGlobusCore.getString(p("#yoast_wpseo_title").val(),t.text(),t.data("language"));YoastSEO.app.rawData.pageTitle=a,p('input[name="yoast_wpseo_title"]').val(a),p("#snippet_title").text(a)}),p(document).on("blur",".wpglobus-snippet_meta",function(e){var t=p(this),a=WPGlobusCore.getString(p("#yoast_wpseo_metadesc").val(),t.text(),t.data("language"));p("#yoast_wpseo_metadesc").val(a),p("#snippet_meta").text(a)}),p(document).on("keyup",".wpglobus-yoast_wpseo_focuskw_text_input",function(e){var t=p(this),a=t.val(),s=t.data("language");d.focuskw.val(a),d.focuskw_hidden.val(a),WPGlobusYoastSeoPremium||p("#wpseo-metabox-tabs_"+s+" .wpseo_keyword_tab .wpseo_tablink").data("keyword",a),d.updateWpseoKeyword(a,s),0==WPGlobusYoastSeo.keywordIndex[s]?p("#yoast_wpseo_focuskw_text_input_"+s).data("value",a):WPGlobusYoastSeoPremium&&WPGlobusYoastSeoPremium.setFocuskeyword(s),n.prototype.analyze()}),p("#publish,#save-post").on("mouseenter",function(e){var s,o="";p(".wpglobus-yoast_wpseo_focuskw_text_input").each(function(e,t){if((s=p(this)).data("language")==WPGlobusCoreData.default_language)if(WPGlobusYoastSeoPremium){var a=WPGlobusYoastSeo.getKeywordsOrig();o=WPGlobusCore.getString(o,a[0].keyword,s.data("language"))}else o=WPGlobusCore.getString(o,s.val(),s.data("language"));else o=WPGlobusCore.getString(o,s.val(),s.data("language"))}),d.focuskw.val(o),d.focuskw_hidden.val(o)}).on("mouseleave",function(e){if(!d.focuskwKeep){d.wpseoTab=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language");p(this);d.focuskw.val(p("#yoast_wpseo_focuskw_text_input_"+d.wpseoTab).val()),d.focuskw_hidden.val(p("#yoast_wpseo_focuskw_text_input_"+d.wpseoTab).val())}}).on("click",function(e){d.focuskwKeep=!0}),p(document).on("tabsactivate",WPGlobusYoastSeo.wpseoTabSelector,function(e,t){if(d.language=t.newPanel.attr("data-language"),WPGlobusYoastSeo.wpseoTab=d.language,t.newPanel.attr("data-language")===WPGlobusCoreData.default_language){var a;if(WPGlobusYoastSeoPremium)p("#wpseo-meta-section-content_"+WPGlobusYoastSeoPremium.dLang+" .wpseo_keyword_tab").removeClass("active"),p("#wpseo-meta-section-content_"+WPGlobusYoastSeoPremium.dLang+" .wpseo_keyword_tab").eq(WPGlobusYoastSeo.keywordIndex[WPGlobusYoastSeoPremium.dLang]).addClass("active"),a=p("#yoast_wpseo_focuskw_text_input_"+WPGlobusYoastSeoPremium.dLang).val();else a=p("#yoast_wpseo_focuskw_text_input_"+WPGlobusCoreData.default_language).val();YoastSEO.app.rawData.keyword=a,d.focuskw.val(a),d.focuskw_hidden.val(a)}p("#wpseo-metabox-tabs_"+d.language+" .wpseo_keyword_tab").each(function(e,t){if(p(t).hasClass("active"))return WPGlobusYoastSeo.keywordIndex[d.language]=e,!1}),n.prototype.analyze()}),d=this}).prototype.analyze=function(){var e=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language");e==WPGlobusCoreData.default_language?YoastSEO.app.snippetPreview.data.urlPath=p("#editable-post-name-full").text():0!=p("#editable-post-name-full-"+e).length?YoastSEO.app.snippetPreview.data.urlPath=p("#editable-post-name-full-"+e).text():YoastSEO.app.snippetPreview.data.urlPath=p("#editable-post-name-full").text(),YoastSEO.app.analyzeTimer(YoastSEO.app),n.prototype.setScoreIcon()},n.prototype.setScoreIcon=function(){var s;s=setInterval(function(){var e=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language"),t=p("#wpseo-meta-section-content .wpseo_generic_tab a").data("score"),a=p("#wpseo-meta-section-content .wpseo_keyword_tab a").data("score");""!=t&&(p("#wpseo-metabox-tabs_"+e+" .wpseo_generic_tab .wpseo-score-icon").removeClass("bad ok good 100 na"),p("#wpseo-metabox-tabs_"+e+" .wpseo_generic_tab .wpseo-score-icon").addClass(t)),void 0!==a&&""!=a&&(WPGlobusYoastSeoPremium&&e!=WPGlobusYoastSeoPremium.dLang?(p("#wpseo-metabox-tabs_"+e+" .wpglobus-wpseo_keyword_tab .wpseo-score-icon").removeClass("bad ok good 100 na"),p("#wpseo-metabox-tabs_"+e+" .wpglobus-wpseo_keyword_tab .wpseo-score-icon").addClass(a)):(p("#wpseo-metabox-tabs_"+e+" .wpseo_keyword_tab .wpseo-score-icon").removeClass("bad ok good 100 na"),p("#wpseo-metabox-tabs_"+e+" .wpseo_keyword_tab .wpseo-score-icon").addClass(a))),clearInterval(s)},1500)},n.prototype.getWPseoTab=function(){return p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language")},n.prototype.citeModification=function(e){var t="#snippet_citeBase_"+e,a="#snippet_cite_"+e,s=p("#wpseo-tab-"+e).data("yoast-cite-base");!1===p("#wpseo-tab-"+e).data("cite-contenteditable")&&p(a).attr("contenteditable","false"),p(t).text(s)},n.prototype.pageTitleModification=function(e){var a,s,o,n="#snippet_title_",i="",l="";if(d.title_template==e)p.each(WPGlobusCoreData.enabled_languages,function(e,t){s=p("#snippet-editor-title_"+t).val(),o=0==s.length?d.title_template:s,i=d.replaceVariablesPlugin(o),p(n+t).text(i),t==d.getWPseoTab()&&(l=i)});else{if(a=WPGlobusCore.getTranslations(e),d.getWPseoTab()!==WPGlobusCoreData.default_language&&a[WPGlobusCoreData.default_language]==e){var t=d.getWPseoTab();return s=p("#snippet-editor-title_"+t).val(),o=0<s.length?s:d.title_template,o=d.replaceVariablesPlugin(o),p(n+t).text(o),o}p.each(WPGlobusCoreData.enabled_languages,function(e,t){i=""===a[t]?d.replaceVariablesPlugin(d.title_template):d.replaceVariablesPlugin(a[t]),t==d.getWPseoTab()&&(l=i,0!=(s=p("#snippet-editor-title_"+t).val()).length?s!=l&&(l=d.replaceVariablesPlugin(s)):l=d.replaceVariablesPlugin(d.title_template)),p(n+t).html(l)})}return l},n.prototype.metaDescModification=function(a){var e,s="#snippet_meta_",t=WPGlobusCore.getTranslations(a),o="";if(e=p("#snippet-editor-meta-description_"+d.getWPseoTab()).val(),d.getWPseoTab()===WPGlobusCoreData.default_language||t[WPGlobusCoreData.default_language]!=a)return p.each(WPGlobusCoreData.enabled_languages,function(e,t){p(s+t).text(WPGlobusCore.TextFilter(a,t,"RETURN_EMPTY")),d.citeModification(t)}),e==t[d.getWPseoTab()]?0==(o=t[d.getWPseoTab()]).length&&p(s+d.getWPseoTab()).text(WPGlobusCore.TextFilter(YoastSEO.app.snippetPreview.data.metaDesc,WPGlobusCoreData.default_language,"RETURN_EMPTY")):0==(o=e).length?p(s+d.getWPseoTab()).text(WPGlobusCore.TextFilter(YoastSEO.app.snippetPreview.data.metaDesc,WPGlobusCoreData.default_language,"RETURN_EMPTY")):p(s+d.getWPseoTab()).text(o),p(s+d.getWPseoTab()).text(o),o;var n=d.getWPseoTab();return d.citeModification(n),0==e.length?p(s+n).text(""):e!=a&&p(s+n).text(e),a},n.prototype.snippetModification=function(e){return WPGlobusCore.TextFilter(e,d.getWPseoTab(),"RETURN_EMPTY")},n.prototype.contentModification=function(e){return d.getWPseoTab()==WPGlobusCoreData.default_language?e:p("#content_"+d.getWPseoTab()).val()},n.prototype.titleModification=function(e){return setTimeout(d.updatePageAnalysis,1e3),d.getWPseoTab()==WPGlobusCoreData.default_language?e:p("#title_"+d.getWPseoTab()).val()},n.prototype.defaultReplace=function(e){var t=YoastSEO.app.rawData.keyword;return e.replace(/%%sitedesc%%/g,this.replaceVars.sitedesc).replace(/%%sitename%%/g,WPGlobusCore.TextFilter(this.replaceVars.sitename,d.getWPseoTab())).replace(/%%term_title%%/g,this.replaceVars.term_title).replace(/%%term_description%%/g,this.replaceVars.term_description).replace(/%%category_description%%/g,this.replaceVars.category_description).replace(/%%tag_description%%/g,this.replaceVars.tag_description).replace(/%%searchphrase%%/g,this.replaceVars.searchphrase).replace(/%%date%%/g,this.replaceVars.date).replace(/%%id%%/g,this.replaceVars.id).replace(/%%page%%/g,this.replaceVars.page).replace(/%%currenttime%%/g,this.replaceVars.currenttime).replace(/%%currentdate%%/g,this.replaceVars.currentdate).replace(/%%currentday%%/g,this.replaceVars.currentday).replace(/%%currentmonth%%/g,this.replaceVars.currentmonth).replace(/%%currentyear%%/g,this.replaceVars.currentyear).replace(/%%focuskw%%/g,t)},n.prototype.replaceVariablesPlugin=function(e){return void 0!==e&&(e=this.titleReplace(e),e=this.defaultReplace(e),e=this.replaceSeparators(e)),e},n.prototype.replaceSeparators=function(e){return e.replace(/%%sep%%(\s+%%sep%%)*/g,this.replaceVars.sep)},n.prototype.titleReplace=function(e){var t="";return void 0===(t=this.language==WPGlobusCoreData.default_language?p("#title").val():p("#title_"+this.language).val())&&(t=YoastSEO.app.rawData.pageTitle),this.language!=WPGlobusCoreData.default_language&&0==t.length&&(t=p("#title").val()),e=e.replace(/%%title%%/g,t)},n.prototype.doubleSepReplace=function(e){var t=YoastSEO.app.stringHelper.addEscapeChars(this.replaceVars.sep),a=new RegExp(t+" "+t,"g");return e=e.replace(a,this.replaceVars.sep)},n.prototype.updateWpseoKeyword=function(e,t){0<p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").length&&p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").removeClass("wpseo-keyword").addClass("wpglobus-wpseo_keyword_"+t),p(".wpglobus-wpseo_keyword_"+t).text(e)},n.prototype.updatePageAnalysis=function(){p("#wpseo-pageanalysis_"+d.getWPseoTab()).html(p("#wpseo-pageanalysis").html()),p("#yoast-seo-content-analysis_"+d.getWPseoTab()).html(p("#yoast-seo-content-analysis").html()),p("#yoast-seo-content-analysis_"+d.getWPseoTab()+" li a").css({float:"none"})},window.WPGlobusYoastSeoPlugin=new n}});
includes/js/wpglobus-yoastseo-48.min.js CHANGED
@@ -1 +1 @@
1
- var WPGlobusYoastSeo,WPGlobusYoastSeoPremium=!1;jQuery(document).ready(function(p){"use strict";var r;if("undefined"!=typeof wpseoReplaceVarsL10n&&("undefined"!=typeof WPGlobusCoreData&&"undefined"!=typeof WPGlobusVendor))if("edit-tags.php"==WPGlobusVendor.pagenow||"term.php"==WPGlobusVendor.pagenow){r=WPGlobusYoastSeo={editorIDs:["description"],editor:{},submitId:"",preventChangeEditor:!1,observer:null,init:function(){r.attachListeners(),_.delay(r.start,1500)},setSubmitID:function(){1==p(".edit-tag-actions .button").length&&(r.submitId=".edit-tag-actions .button"),1==p("#submit").length&&(r.submitId="#submit")},submit:function(e){"mouseenter"===e.type?p.each(r.editor,function(e,t){!r.editor[e].contentEditor||r.editor[e].contentEditor.isHidden()?p("#"+e).val(r.editor[e].content):tinymce.get(e).setContent(r.editor[e].content)}):"mouseleave"===e.type?r.preventChangeEditor||(p.each(r.editor,function(e,t){!r.editor[e].contentEditor||r.editor[e].contentEditor.isHidden()?p("#"+e).val(WPGlobusCore.TextFilter(t.content,r.getCurrentTab(),"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,r.getCurrentTab(),"RETURN_EMPTY"))}),r.preventChangeEditor=!1):"click"===e.type&&(r.preventChangeEditor=!0,"tinymce"!=getUserSetting("editor")&&setUserSetting("editor","tinymce"))},attachListeners:function(){p(".wrap").on("tabsactivate",function(e,a){p.each(r.editor,function(e,t){!r.editor[e].contentEditor||r.editor[e].contentEditor.isHidden()?p("#"+e).val(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY"))})}),r.setSubmitID(),p(document).on("mouseenter",r.submitId,r.submit).on("mouseleave",r.submitId,r.submit).on("click",r.submitId,r.submit),p(document).on("tinymce-editor-init",function(e,t){if(-1!=_.indexOf(r.editorIDs,t.id)){var a=p("#"+t.id);r.editor[t.id]={},r.editor[t.id].contentEditor=t,r.editor[t.id].content=a.val(),t.setContent(WPGlobusCore.TextFilter(r.editor[t.id].content,WPGlobusCoreData.default_language,"RETURN_EMPTY")),p("#"+t.getContainer().id).find("iframe").addClass("wpglobus-translatable"),a.removeClass("hidden"),t.on("nodechange keyup",_.debounce(r.update,500)),a.on("input keyup",_.debounce(r.update,500))}})},update:function(e){var t,a;void 0!==e.target&&("tinymce"==(t=e.target.id)&&(t=e.target.dataset.id),void 0!==r.editor[t].contentEditor&&(a=!r.editor[t].contentEditor||r.editor[t].contentEditor.isHidden()?p("#"+t).val():r.editor[t].contentEditor.getContent({format:"raw"}),r.editor[t].content=WPGlobusCore.getString(r.editor[t].content,a,r.getCurrentTab())))},getCurrentTab:function(){return p(".wpglobus-taxonomy-tabs-list .ui-tabs-active").data("language")},start:function(){p(".wpglobus-element_description").css({display:"none"})}},WPGlobusYoastSeo.init();var i=function(){p(".wrap").on("tabsactivate",function(e,t){t.newTab[0].dataset.language==WPGlobusCoreData.default_language?p("#poststuff .inside").css({display:"block"}):p("#poststuff .inside").css({display:"none"})}),p.each(["category_description","sitedesc","sitename","tag_description","term_description","term_title"],function(e,t){wpseoReplaceVarsL10n.replace_vars[t]=WPGlobusCore.TextFilter(wpseoReplaceVarsL10n.replace_vars[t],WPGlobusCoreData.default_language)}),WPGlobusYoastSeo.observer=new MutationObserver(function(e){e.forEach(function(e){if("placeholder"==e.attributeName){WPGlobusYoastSeo.observer.disconnect();var t=p("#wpseo_focuskw");""==t.val()&&t.attr("placeholder",WPGlobusCore.TextFilter(t.attr("placeholder"),WPGlobusCoreData.default_language)),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0})}})}),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0})};window.WPGlobusYoastSeoPlugin=new i}else{var d;r=WPGlobusYoastSeo={wpseoTabSelector:"#wpglobus-wpseo-tabs",url:"",attrs:p("#wpglobus-wpseo-attr"),iB:p("#wpseo-meta-section-content"),t:p("#wpseo-meta-section-content"),ids:"",names:"",wpseoTab:WPGlobusCoreData.default_language,editSnippetButtonClass:"wpglobus-snippet-editor__edit-button",editSnippetFormClass:"wpglobus-snippet-editor__form",editSnippetSubmitClass:"wpglobus-snippet-editor__submit",editSnippetHeadingClass:"wpglobus-snippet-editor__heading-editor",yoastTitleProgress:"wpglobus-yoast-title-progress",yoastMetadescProgress:"wpglobus-yoast-metadesc-progress",yoastPremium:WPGlobusVendor.vendor.WPSEO_PREMIUM,keywordIndex:{},idsSpecial:"",init:function(){p.each(WPGlobusCoreData.enabled_languages,function(e,t){r.keywordIndex[t]=0}),r.start()},initAddKeywordPopup:function(){1==p("#wpseo-add-keyword-popup").length?p(".wpseo-add-keyword").on("click",r.addKeywordPopup):WPGlobusYoastSeoPremium&&WPGlobusYoastSeoPremium.addKeywordButton()},addKeywordPopup:function(){var e=p("#wpseo-add-keyword-popup-button").text();tb_show(e,"#TB_inline?width=650&height=350&inlineId=wpseo-add-keyword-popup","group"),p("#TB_window").css({width:"680px",height:"350px"})},qtip:function(){p(".yoast_help").qtip({content:{attr:"alt"},position:{my:"bottom left",at:"top center"},style:{tip:{corner:!0},classes:"yoast-qtip qtip-rounded qtip-blue"},show:"click",hide:{fixed:!0,delay:500}})},removeClasses:function(t,e){_.each(e,function(e){t.removeClass(e)})},updateProgressBar:function(e,t){if(void 0!==e&&(void 0!==t||("undefined"!==e.data("language")&&(t=e.data("language")),void 0!==t))){var a,s,o=["snippet-editor__progress--bad","snippet-editor__progress--ok","snippet-editor__progress--good"],i="",n=0,l=!1;s=e.val().length,e.hasClass("wpglobus-snippet-editor-title")?(n=(a=p("progress."+r.yoastTitleProgress+"_"+t)).attr("max"),i=o[2],0==s?i=o[1]:n<s?(i=o[1],l=!0):0<s&&s<35&&(i=o[1])):e.hasClass("wpglobus-snippet-editor-meta-description")&&(n=(a=p("progress."+r.yoastMetadescProgress+"_"+t)).attr("max"),i=o[2],0==s?i=o[1]:n<s?(i=o[1],l=!0):0<s&&s<121&&(i=o[1])),r.removeClasses(a,o),a.attr("value",s).addClass(i),l?e.css("color","#f00"):e.css("color","#000")}},updateWpseoKeyword:function(e,t){p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").text(e)},setSpecial:function(){r.idsSpecial=WPGlobusYoastSeo.attrs.data("ids-premium-special"),r.idsSpecial=r.idsSpecial.split(","),setTimeout(function(){if(1<p(".wpseo-cornerstone-checkbox").length&&p.each(WPGlobusCoreData.enabled_languages,function(e,t){if(t==WPGlobusCoreData.default_language){var a=p("#wpseofocuskeyword input#_yst_is_cornerstone");return p(a).attr("id","_yst_is_cornerstone_origin").attr("name","_yst_is_cornerstone_origin"),p(a).addClass("wpseo-cornerstone-checkbox_origin"),!0}p("#wpseo-tab-"+t+" .wpseo-cornerstone-checkbox").remove(),p("#wpseo-tab-"+t+' label[for="_yst_is_cornerstone"]').remove()}),1<p(".wpglobus-wpseometakeywords").length){var e=p(document).triggerHandler("wpglobus_meta_keywords");if(void 0!==e&&!0===e)return;p.each(WPGlobusCoreData.enabled_languages,function(e,t){if(t==WPGlobusCoreData.default_language){var a=p("#yoast_wpseo_metakeywords");return a.attr("id","yoast_wpseo_metakeywords_origin").attr("name","yoast_wpseo_metakeywords_origin"),a.addClass("metakeywords_origin"),p("#wpseometakeywords").attr("id","wpseometakeywords_origin"),p("#yoast_wpseo_metakeywords_"+t).attr("name","yoast_wpseo_metakeywords").attr("id","yoast_wpseo_metakeywords"),p("#wpseometakeywords_"+t).attr("id","wpseometakeywords"),!0}p("#wpseo-tab-"+t+" #wpseometakeywords_"+t+" .yoast-metabox__description").remove(),p("#wpseo-tab-"+t+" #yoast_wpseo_metakeywords_"+t).remove(),p("#wpseometakeywords_"+t+" .yoast-section").append('<div class="wpglobus-suggest" style="font-weight:bold;">'+WPGlobusVendor.i18n.yoastseo_plus_meta_keywords_access+"</div>")})}},2e3)},start:function(){p(r.wpseoTabSelector).tabs(),WPGlobusYoastSeoPremium||r.setSpecial(),r.ids=r.attrs.data("ids"),r.names=r.attrs.data("names"),r.ids=r.ids+","+r.attrs.data("qtip"),r.ids=r.ids.split(","),r.names=r.names.split(","),p("#wpglobus-wpseo-tabs").insertBefore(r.iB),p(".wpseo-metabox-tabs").css({height:"26px"}),p(".wpglobus-wpseo-general").each(function(e,t){var a=p(t),s=a.data("language"),o="wpseo-meta-section-content_"+s;a.html('<div id="'+o+'" class="wpseo-meta-section wpglobus-wpseo-meta-section" style="width:100%" data-language="'+s+'">'+r.t.html()+"</div>"),p("#"+o+" .wpseo-metabox-tabs").attr("id","wpseo-metabox-tabs_"+s).attr("data-language",s),p("#"+o+" .wpseotab").attr("id","wpseo_content_"+s),p("#wpseo_content_"+s).css({float:"left"}),p("#"+o).css({display:"block"}),p("#wpseo_meta").css({overflow:"hidden"}),p("#"+o+" .snippet_container").addClass("wpglobus-snippet_container"),s!==WPGlobusCoreData.default_language&&p("#"+o+" .wpseo-add-keyword").addClass("hidden"),p.each(r.names,function(e,t){p("#"+t).attr("name",t+"_"+s)}),p.each(r.ids,function(e,t){var a=p("#"+t);"wpseosnippet"==t&&a.addClass("wpglobus-wpseosnippet"),"snippet_title"==t&&a.addClass("wpglobus-snippet_title"),"snippet_meta"==t&&a.addClass("wpglobus-snippet_meta"),"snippet_cite"==t&&a.addClass("wpglobus-snippet_cite"),"snippet_citeBase"==t&&a.addClass("wpglobus-snippet_citeBase"),"url_container"==t&&a.css({height:"16px"}),"yoast_wpseo_focuskw_text_input"==t&&(a.addClass("wpglobus-yoast_wpseo_focuskw_text_input"),a.attr("data-value",""),a.parents("div#wpseofocuskeyword").attr("id","wpseofocuskeyword_"+s),p("#wpseofocuskeyword_"+s).addClass("wpglobus-wpseofocuskeyword")),"yoast_wpseo_focuskeywords"==t&&a.addClass("wpglobus-yoast_wpseo_focuskeywords"),"wpseo-pageanalysis"==t&&a.addClass("wpglobus-wpseo-pageanalysis"),"yoast-seo-content-analysis"==t&&a.addClass("wpglobus-yoast-seo-content-analysis"),"snippet_preview"==t&&a.addClass("wpglobus-snippet_preview"),"snippet-editor-title"==t&&(a.addClass("wpglobus-snippet-editor-title"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),a.val(p("#wpseo-tab-"+s).data("wpseotitle")),a.parent("label").next("progress").addClass(r.yoastTitleProgress).addClass(r.yoastTitleProgress+"_"+s),_.debounce(r.updateProgressBar(a,s),500)),"snippet-editor-slug"==t&&(a.addClass("wpglobus-snippet-editor-slug"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),WPGlobusCoreData.default_language!=s&&a.attr("disabled","disabled")),"snippet-editor-meta-description"==t&&(a.addClass("wpglobus-snippet-editor-meta-description"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),a.val(p("#wpseo-tab-"+s).data("metadesc")),a.parent("label").next("progress").addClass(r.yoastMetadescProgress).addClass(r.yoastMetadescProgress+"_"+s),_.debounce(r.updateProgressBar(a,s),500)),"snippetpreview-help-toggle"==t&&(a.addClass("wpglobus-snippetpreview-help-toggle_"+s),p(document).on("click",".wpglobus-snippetpreview-help-toggle_"+s,function(e){var t=p(this);"none"===p("#snippetpreview-help_"+t.data("language")).css("display")?p("#snippetpreview-help_"+t.data("language")).css({display:"block"}):p("#snippetpreview-help_"+t.data("language")).css({display:"none"})})),"focuskw_text_input-help-toggle"==t&&(a.addClass("wpglobus-focuskw_text_input-help-toggle_"+s),p(document).on("click",".wpglobus-focuskw_text_input-help-toggle_"+s,function(e){var t=p(this);"none"===p("#focuskw_text_input-help_"+t.data("language")).css("display")?p("#focuskw_text_input-help_"+t.data("language")).css({display:"block"}):p("#focuskw_text_input-help_"+t.data("language")).css({display:"none"})})),"pageanalysis-help-toggle"==t&&(a.addClass("wpglobus-pageanalysis-help-toggle_"+s),p(document).on("click",".wpglobus-pageanalysis-help-toggle_"+s,function(e){var t=p(this);"none"===p("#pageanalysis-help_"+t.data("language")).css("display")?p("#pageanalysis-help_"+t.data("language")).css({display:"block"}):p("#pageanalysis-help_"+t.data("language")).css({display:"none"})})),"snippet_preview"==t&&(WPGlobusYoastSeoPremium||a.css({"margin-bottom":"20px"})),"wpseo-focuskeyword-section"==t&&(WPGlobusYoastSeoPremium||a.css({"margin-bottom":"20px"})),"pageanalysis"==t&&(WPGlobusYoastSeoPremium||s==WPGlobusCoreData.default_language&&setTimeout(function(){var a=0,s=0,e=WPGlobusCoreData.default_language;p("#pageanalysis_"+e+" #wpseo-pageanalysis_"+e+" li.score").each(function(e,t){s+=p(t).outerHeight(!0)}),p.each(WPGlobusCoreData.enabled_languages,function(e,t){a=s+50,p("#pageanalysis_"+t).css({height:a+"px"})})},4e3)),"wpseo-pageanalysis-section"==t&&(WPGlobusYoastSeoPremium?a.css({overflow:"overlay"}):a.css({height:"inherit"})),"wpseometakeywords"==t&&(a.css({"margin-bottom":"2em"}),a.addClass("wpglobus-wpseometakeywords")),"yoast_wpseo_metakeywords"==t&&(a.addClass("wpglobus-metakeywords"),p('input[name="yoast_wpseo_metakeywords_'+s+'"]').val(WPGlobusCore.TextFilter(p("#yoast_wpseo_metakeywords").val(),s,"RETURN_EMPTY"))),a.attr("id",t+"_"+s),p("#"+t+"_"+s).attr("data-language",s)});var i=WPGlobusCore.TextFilter(p("#yoast_wpseo_focuskw_text_input").val(),s,"RETURN_EMPTY");p("#yoast_wpseo_focuskw_text_input_"+s).val(i).data("value",i),p("#yoast_wpseo_focuskw_"+s).val(i),WPGlobusYoastSeoPremium||p("#wpseo-metabox-tabs_"+s+" .wpseo_keyword_tab .wpseo_tablink").data("keyword",i),p("#wpseo-metabox-tabs_"+s+" .wpseo_keyword_tab").css({"min-width":"60px","min-height":"29px"}),r.updateWpseoKeyword(i,s),s!==WPGlobusCoreData.default_language&&(p("#"+o+" #yoast_wpseo_focuskw_text_input_"+s).addClass("hidden").after('<div class="wpglobus-suggest" style="font-weight:bold;">'+WPGlobusVendor.i18n.yoastseo_plus_page_analysis_access+"</div>"),p("#"+o+" #wpseo-pageanalysis_"+s).addClass("hidden").css({display:"none"})),WPGlobusYoastSeoPremium&&(s==WPGlobusCoreData.default_language||(p("#wpseo-metabox-tabs_"+s+" .wpseo_keyword_tab").removeClass("wpseo_keyword_tab").addClass("wpglobus-wpseo_keyword_tab"),p("#wpseo-meta-section-content_"+s+" .wpseo_keyword_tab_hideable").css({display:"none"}).attr("data-language",s)))}),p(".wpglobus-wpseosnippet").each(function(e,t){var a=p(t),s=a.data("language");a.find("button.snippet-editor__button.snippet-editor__edit-button").addClass(r.editSnippetButtonClass).addClass(r.editSnippetButtonClass+"_"+s).attr("data-language",s),a.find(".snippet-editor__form").addClass(r.editSnippetFormClass).addClass(r.editSnippetFormClass+"_"+s),a.find(".snippet-editor__heading-editor").addClass(r.editSnippetHeadingClass).addClass(r.editSnippetHeadingClass+"_"+s),a.find(".snippet-editor__submit").addClass(r.editSnippetSubmitClass).addClass(r.editSnippetSubmitClass+"_"+s).attr("data-language",s)}),r.iB.addClass("hidden"),r.iB.css({height:0,overflow:"hidden",display:"none"}),WPGlobusYoastSeoPremium&&p("#wpseo-meta-section-content .wpseo_keyword_tab").removeClass("wpseo_keyword_tab").addClass("wpseo_keyword_tab_original");var e=WPGlobusCore.TextFilter(p("#yoast_wpseo_focuskw_text_input").val(),WPGlobusCoreData.default_language,"RETURN_EMPTY");p("#yoast_wpseo_focuskw_text_input").val(e),p("#yoast_wpseo_focuskw").val(e),p(document).on("click",".wpglobus-wpseo-general .wpseo_tablink",function(e){e.preventDefault();var t=p(this),a=t.parents("ul").data("language"),s=t.parent("li");if(a==WPGlobusCoreData.default_language||void 0!==p(document).triggerHandler("wpglobus_yoast_analysis",{language:a}))if(s.hasClass("wpseo_generic_tab"))p("#wpseo-pageanalysis_"+a).css({display:"none"}),p("#yoast-seo-content-analysis_"+a).css({display:"block"}),p("#wpseo_content_"+a+" table tr").eq(0).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(1).css({display:"none"}),p("#yoast-seo-content-analysis_"+a+" li a").css({float:"none"}),p("#wpseosnippet_"+a).css({display:"none"}),p("#wpseofocuskeyword_"+a).css({display:"none"});else if(s.hasClass("wpseo_keyword_tab")){if(p("#wpseosnippet_"+a).css({display:""}),p("#wpseofocuskeyword_"+a).css({display:""}),WPGlobusYoastSeoPremium&&(p("#wpseo-meta-section-content_"+a+" .wpseo_keyword_tab").removeClass("active"),t.parent(".wpseo_keyword_tab").addClass("active"),p("#wpseo-pageanalysis_"+a).css({display:"block"}),p("#yoast-seo-content-analysis_"+a).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(0).css("display",""),p("#wpseo_content_"+a+" table tr").eq(1).css("display",""),p("#wpseo-metabox-tabs_"+a+" .wpseo_keyword_tab").each(function(e,t){if(p(t).hasClass("active"))return r.keywordIndex[a]=e,!1})),!WPGlobusYoastSeoPremium&&a!=WPGlobusCoreData.default_language)return p("#wpseo-pageanalysis_"+a).css({display:"block"}),p("#yoast-seo-content-analysis_"+a).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(0).css("display",""),void p("#wpseo_content_"+a+" table tr").eq(1).css("display","");var o=r.getKeywordsOrig()[r.keywordIndex[a]].keyword;YoastSEO.app.rawData.keyword=o,p("#yoast_wpseo_focuskw_text_input").val(o),p("#yoast_wpseo_focuskw_text_input_"+a).val(o),p('input[name="yoast_wpseo_focuskw"]').val(o),i.prototype.analyze(),p("#wpseo-pageanalysis_"+a).css({display:"block"}),p("#yoast-seo-content-analysis_"+a).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(0).css("display",""),p("#wpseo_content_"+a+" table tr").eq(1).css("display","")}else s.hasClass("wpglobus-wpseo_keyword_tab")&&(p("#wpseo-pageanalysis_"+a).css({display:"block"}),p("#yoast-seo-content-analysis_"+a).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(0).css("display",""),p("#wpseo_content_"+a+" table tr").eq(1).css("display",""))}),p(".wpseo-metabox-sidebar .wpseo-meta-section-link").on("click",function(e){"#wpseo-meta-section-content"==p(this).attr("href")?p("#wpglobus-wpseo-tabs").css({display:"block"}):p("#wpglobus-wpseo-tabs").css({display:"none"})}),p(document).on("click","."+r.editSnippetButtonClass,function(e){var t=p(this),a=t.data("language"),s=p("."+r.editSnippetFormClass+"_"+a),o=p("."+r.editSnippetSubmitClass+"_"+a),i=p("."+r.editSnippetHeadingClass+"_"+a);s.hasClass("snippet-editor--hidden")?(s.removeClass("snippet-editor--hidden"),i.removeClass("snippet-editor--hidden"),o.removeClass("snippet-editor--hidden")):(s.addClass("snippet-editor--hidden"),i.addClass("snippet-editor--hidden")),t.addClass("snippet-editor--hidden")}),p(document).on("click","."+r.editSnippetSubmitClass,function(e){var t=p(this).data("language"),a=p("."+r.editSnippetButtonClass+"_"+t),s=p("."+r.editSnippetFormClass+"_"+t),o=p("."+r.editSnippetSubmitClass+"_"+t),i=p("."+r.editSnippetHeadingClass+"_"+t);a.removeClass("snippet-editor--hidden"),s.addClass("snippet-editor--hidden"),o.addClass("snippet-editor--hidden"),i.addClass("snippet-editor--hidden")}),p(document).on("keyup","input.wpglobus-snippet-editor-title",function(e){var t=p(this),a=t.data("language"),s=WPGlobusCore.getString(p('input[name="yoast_wpseo_title"]').val(),t.val(),a);p("#snippet_title_"+a).html(d.replaceVariablesPlugin(t.val())),YoastSEO.app.rawData.pageTitle=s,p('input[name="yoast_wpseo_title"]').val(s),p("#snippet_title").text(s),_.debounce(r.updateProgressBar(t,a),500)}),p(document).on("keyup","input.wpglobus-snippet-editor-slug",function(e){var t=p(this),a=t.data("language");p("#snippet_cite_"+a).text(t.val()+"/"),p("#editable-post-name").text(t.val()),p("#editable-post-name-full").text(t.val())}),p(document).on("change","input.wpglobus-snippet-editor-slug",function(e){var t=p(this);p.post(ajaxurl,{action:"sample-permalink",post_id:p("#post_ID").val()||0,new_slug:t.val(),new_title:p("#title").val(),samplepermalinknonce:p("#samplepermalinknonce").val()})}),p(document).on("keyup","textarea.wpglobus-snippet-editor-meta-description",function(e){var t=p(this),a=t.data("language");p("#snippet_meta_"+a).text(t.val());var s=WPGlobusCore.getString(p("#yoast_wpseo_metadesc").val(),t.val(),t.data("language"));p("#yoast_wpseo_metadesc").val(s),p("#snippet_meta").text(s),_.debounce(r.updateProgressBar(t,a),500)}),p(document).on("click",".wpglobus-post-body-tabs-list li",function(e){var t=p(this);if(t.hasClass("wpglobus-post-tab")){p("#wpglobus-wpseo-tabs").tabs("option","active",t.data("order"));var a=p("#yoast_wpseo_focuskw_text_input_"+t.data("language")).val();YoastSEO.app.rawData.keyword=a,p("#yoast_wpseo_focuskw_text_input").val(a),p('input[name="yoast_wpseo_focuskw"]').val(a),i.prototype.analyze()}}),r.initAddKeywordPopup()},getKeywordsOrig:function(){return p(".wpseo_keyword_tab").map(function(e,t){return{keyword:(t=p(t).find(".wpseo_tablink")).data("keyword")+"",score:t.data("score")}}).get()}},(i=function(){this.replaceVars=wpseoReplaceVarsL10n.replace_vars,this.language=WPGlobusCoreData.default_language,this.tab=WPGlobusCoreData.default_language,this.wpseoTab=WPGlobusCoreData.default_language,this.title_template=wpseoPostScraperL10n.title_template,this.focuskw=p("#yoast_wpseo_focuskw_text_input"),this.focuskw_hidden=p('input[name="yoast_wpseo_focuskw"]'),this.focuskwKeep=!1,this.post_slug="#editable-post-name-full",YoastSEO.app.registerPlugin("wpglobusYoastSeoPlugin",{status:"ready"}),YoastSEO.app.registerModification("content",this.contentModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("title",this.titleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_title",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_meta",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_page_title",this.pageTitleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_meta_desc",this.metaDescModification,"wpglobusYoastSeoPlugin",0),i.prototype.setScoreIcon(),p(document).on("blur",".wpglobus-snippet_title",function(e){var t=p(this),a=WPGlobusCore.getString(p("#yoast_wpseo_title").val(),t.text(),t.data("language"));YoastSEO.app.rawData.pageTitle=a,p('input[name="yoast_wpseo_title"]').val(a),p("#snippet_title").text(a)}),p(document).on("blur",".wpglobus-snippet_meta",function(e){var t=p(this),a=WPGlobusCore.getString(p("#yoast_wpseo_metadesc").val(),t.text(),t.data("language"));p("#yoast_wpseo_metadesc").val(a),p("#snippet_meta").text(a)}),p(document).on("keyup",".wpglobus-yoast_wpseo_focuskw_text_input",function(e){var t=p(this),a=t.val(),s=t.data("language");d.focuskw.val(a),d.focuskw_hidden.val(a),WPGlobusYoastSeoPremium||p("#wpseo-metabox-tabs_"+s+" .wpseo_keyword_tab .wpseo_tablink").data("keyword",a),d.updateWpseoKeyword(a,s),0==WPGlobusYoastSeo.keywordIndex[s]?p("#yoast_wpseo_focuskw_text_input_"+s).data("value",a):WPGlobusYoastSeoPremium&&WPGlobusYoastSeoPremium.setFocuskeyword(s),i.prototype.analyze()}),p("#publish,#save-post").on("mouseenter",function(e){var s,o="";p(".wpglobus-yoast_wpseo_focuskw_text_input").each(function(e,t){if((s=p(this)).data("language")==WPGlobusCoreData.default_language)if(WPGlobusYoastSeoPremium){var a=WPGlobusYoastSeo.getKeywordsOrig();o=WPGlobusCore.getString(o,a[0].keyword,s.data("language"))}else o=WPGlobusCore.getString(o,s.val(),s.data("language"));else o=WPGlobusCore.getString(o,s.val(),s.data("language"))}),d.focuskw.val(o),d.focuskw_hidden.val(o)}).on("mouseleave",function(e){if(!d.focuskwKeep){d.wpseoTab=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language");p(this);d.focuskw.val(p("#yoast_wpseo_focuskw_text_input_"+d.wpseoTab).val()),d.focuskw_hidden.val(p("#yoast_wpseo_focuskw_text_input_"+d.wpseoTab).val())}}).on("click",function(e){d.focuskwKeep=!0}),p(document).on("tabsactivate",WPGlobusYoastSeo.wpseoTabSelector,function(e,t){if(d.language=t.newPanel.attr("data-language"),WPGlobusYoastSeo.wpseoTab=d.language,t.newPanel.attr("data-language")===WPGlobusCoreData.default_language){var a;if(WPGlobusYoastSeoPremium)p("#wpseo-meta-section-content_"+WPGlobusYoastSeoPremium.dLang+" .wpseo_keyword_tab").removeClass("active"),p("#wpseo-meta-section-content_"+WPGlobusYoastSeoPremium.dLang+" .wpseo_keyword_tab").eq(WPGlobusYoastSeo.keywordIndex[WPGlobusYoastSeoPremium.dLang]).addClass("active"),a=p("#yoast_wpseo_focuskw_text_input_"+WPGlobusYoastSeoPremium.dLang).val();else a=p("#yoast_wpseo_focuskw_text_input_"+WPGlobusCoreData.default_language).val();YoastSEO.app.rawData.keyword=a,d.focuskw.val(a),d.focuskw_hidden.val(a)}p("#wpseo-metabox-tabs_"+d.language+" .wpseo_keyword_tab").each(function(e,t){if(p(t).hasClass("active"))return WPGlobusYoastSeo.keywordIndex[d.language]=e,!1}),i.prototype.analyze()}),d=this}).prototype.analyze=function(){var e=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language");e==WPGlobusCoreData.default_language?YoastSEO.app.snippetPreview.data.urlPath=p("#editable-post-name-full").text():0!=p("#editable-post-name-full-"+e).length?YoastSEO.app.snippetPreview.data.urlPath=p("#editable-post-name-full-"+e).text():YoastSEO.app.snippetPreview.data.urlPath=p("#editable-post-name-full").text(),YoastSEO.app.analyzeTimer(YoastSEO.app),i.prototype.setScoreIcon()},i.prototype.setScoreIcon=function(){var s;s=setInterval(function(){var e=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language"),t=p("#wpseo-meta-section-content .wpseo_generic_tab a").data("score"),a=p("#wpseo-meta-section-content .wpseo_keyword_tab a").data("score");""!=t&&(p("#wpseo-metabox-tabs_"+e+" .wpseo_generic_tab .wpseo-score-icon").removeClass("bad ok good 100 na"),p("#wpseo-metabox-tabs_"+e+" .wpseo_generic_tab .wpseo-score-icon").addClass(t)),void 0!==a&&""!=a&&(WPGlobusYoastSeoPremium&&e!=WPGlobusYoastSeoPremium.dLang?(p("#wpseo-metabox-tabs_"+e+" .wpglobus-wpseo_keyword_tab .wpseo-score-icon").removeClass("bad ok good 100 na"),p("#wpseo-metabox-tabs_"+e+" .wpglobus-wpseo_keyword_tab .wpseo-score-icon").addClass(a)):(p("#wpseo-metabox-tabs_"+e+" .wpseo_keyword_tab .wpseo-score-icon").removeClass("bad ok good 100 na"),p("#wpseo-metabox-tabs_"+e+" .wpseo_keyword_tab .wpseo-score-icon").addClass(a))),clearInterval(s)},1500)},i.prototype.getWPseoTab=function(){return p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language")},i.prototype.citeModification=function(e){var t="#snippet_citeBase_"+e,a="#snippet_cite_"+e,s=p("#wpseo-tab-"+e).data("yoast-cite-base");!1===p("#wpseo-tab-"+e).data("cite-contenteditable")&&p(a).attr("contenteditable","false"),p(t).text(s)},i.prototype.pageTitleModification=function(e){var a,s,o,i="#snippet_title_",n="",l="";if(d.title_template==e)p.each(WPGlobusCoreData.enabled_languages,function(e,t){s=p("#snippet-editor-title_"+t).val(),o=0==s.length?d.title_template:s,n=d.replaceVariablesPlugin(o),p(i+t).text(n),t==d.getWPseoTab()&&(l=n)});else{if(a=WPGlobusCore.getTranslations(e),d.getWPseoTab()!==WPGlobusCoreData.default_language&&a[WPGlobusCoreData.default_language]==e){var t=d.getWPseoTab();return s=p("#snippet-editor-title_"+t).val(),o=0<s.length?s:d.title_template,o=d.replaceVariablesPlugin(o),p(i+t).text(o),o}p.each(WPGlobusCoreData.enabled_languages,function(e,t){n=""===a[t]?d.replaceVariablesPlugin(d.title_template):d.replaceVariablesPlugin(a[t]),t==d.getWPseoTab()&&(l=n,0!=(s=p("#snippet-editor-title_"+t).val()).length?s!=l&&(l=d.replaceVariablesPlugin(s)):l=d.replaceVariablesPlugin(d.title_template)),p(i+t).html(l)})}return l},i.prototype.metaDescModification=function(a){var e,s="#snippet_meta_",t=WPGlobusCore.getTranslations(a),o="";if(e=p("#snippet-editor-meta-description_"+d.getWPseoTab()).val(),d.getWPseoTab()!==WPGlobusCoreData.default_language&&t[WPGlobusCoreData.default_language]==a){var i=d.getWPseoTab();return d.citeModification(i),0==e.length?p(s+i).text(""):e!=a&&p(s+i).text(e),a}return p.each(WPGlobusCoreData.enabled_languages,function(e,t){p(s+t).text(WPGlobusCore.TextFilter(a,t,"RETURN_EMPTY")),d.citeModification(t)}),e==t[d.getWPseoTab()]?0==(o=t[d.getWPseoTab()]).length&&p(s+d.getWPseoTab()).text(WPGlobusCore.TextFilter(YoastSEO.app.snippetPreview.data.metaDesc,WPGlobusCoreData.default_language,"RETURN_EMPTY")):0==(o=e).length?p(s+d.getWPseoTab()).text(WPGlobusCore.TextFilter(YoastSEO.app.snippetPreview.data.metaDesc,WPGlobusCoreData.default_language,"RETURN_EMPTY")):p(s+d.getWPseoTab()).text(o),p(s+d.getWPseoTab()).text(o),o},i.prototype.snippetModification=function(e){return WPGlobusCore.TextFilter(e,d.getWPseoTab(),"RETURN_EMPTY")},i.prototype.contentModification=function(e){return d.getWPseoTab()==WPGlobusCoreData.default_language?e:p("#content_"+d.getWPseoTab()).val()},i.prototype.titleModification=function(e){return setTimeout(d.updatePageAnalysis,1e3),d.getWPseoTab()==WPGlobusCoreData.default_language?e:p("#title_"+d.getWPseoTab()).val()},i.prototype.defaultReplace=function(e){var t=YoastSEO.app.rawData.keyword;return e.replace(/%%sitedesc%%/g,this.replaceVars.sitedesc).replace(/%%sitename%%/g,WPGlobusCore.TextFilter(this.replaceVars.sitename,d.getWPseoTab())).replace(/%%term_title%%/g,this.replaceVars.term_title).replace(/%%term_description%%/g,this.replaceVars.term_description).replace(/%%category_description%%/g,this.replaceVars.category_description).replace(/%%tag_description%%/g,this.replaceVars.tag_description).replace(/%%searchphrase%%/g,this.replaceVars.searchphrase).replace(/%%date%%/g,this.replaceVars.date).replace(/%%id%%/g,this.replaceVars.id).replace(/%%page%%/g,this.replaceVars.page).replace(/%%currenttime%%/g,this.replaceVars.currenttime).replace(/%%currentdate%%/g,this.replaceVars.currentdate).replace(/%%currentday%%/g,this.replaceVars.currentday).replace(/%%currentmonth%%/g,this.replaceVars.currentmonth).replace(/%%currentyear%%/g,this.replaceVars.currentyear).replace(/%%focuskw%%/g,t)},i.prototype.replaceVariablesPlugin=function(e){return void 0!==e&&(e=this.titleReplace(e),e=this.defaultReplace(e),e=this.replaceSeparators(e)),e},i.prototype.replaceSeparators=function(e){return e.replace(/%%sep%%(\s+%%sep%%)*/g,this.replaceVars.sep)},i.prototype.titleReplace=function(e){var t="";return void 0===(t=this.language==WPGlobusCoreData.default_language?p("#title").val():p("#title_"+this.language).val())&&(t=YoastSEO.app.rawData.pageTitle),this.language!=WPGlobusCoreData.default_language&&0==t.length&&(t=p("#title").val()),e=e.replace(/%%title%%/g,t)},i.prototype.doubleSepReplace=function(e){var t=YoastSEO.app.stringHelper.addEscapeChars(this.replaceVars.sep),a=new RegExp(t+" "+t,"g");return e=e.replace(a,this.replaceVars.sep)},i.prototype.updateWpseoKeyword=function(e,t){0<p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").length&&p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").removeClass("wpseo-keyword").addClass("wpglobus-wpseo_keyword_"+t),p(".wpglobus-wpseo_keyword_"+t).text(e)},i.prototype.updatePageAnalysis=function(){p("#wpseo-pageanalysis_"+d.getWPseoTab()).html(p("#wpseo-pageanalysis").html()),p("#yoast-seo-content-analysis_"+d.getWPseoTab()).html(p("#yoast-seo-content-analysis").html()),p("#yoast-seo-content-analysis_"+d.getWPseoTab()+" li a").css({float:"none"})},window.WPGlobusYoastSeoPlugin=new i}});
1
+ var WPGlobusYoastSeo,WPGlobusYoastSeoPremium=!1;jQuery(document).ready(function(p){"use strict";var r;if("undefined"!=typeof wpseoReplaceVarsL10n&&("undefined"!=typeof WPGlobusCoreData&&"undefined"!=typeof WPGlobusVendor))if("edit-tags.php"==WPGlobusVendor.pagenow||"term.php"==WPGlobusVendor.pagenow){r=WPGlobusYoastSeo={editorIDs:["description"],editor:{},submitId:"",preventChangeEditor:!1,observer:null,init:function(){r.attachListeners(),_.delay(r.start,1500)},setSubmitID:function(){1==p(".edit-tag-actions .button").length&&(r.submitId=".edit-tag-actions .button"),1==p("#submit").length&&(r.submitId="#submit")},submit:function(e){"mouseenter"===e.type?p.each(r.editor,function(e,t){!r.editor[e].contentEditor||r.editor[e].contentEditor.isHidden()?p("#"+e).val(r.editor[e].content):tinymce.get(e).setContent(r.editor[e].content)}):"mouseleave"===e.type?r.preventChangeEditor||(p.each(r.editor,function(e,t){!r.editor[e].contentEditor||r.editor[e].contentEditor.isHidden()?p("#"+e).val(WPGlobusCore.TextFilter(t.content,r.getCurrentTab(),"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,r.getCurrentTab(),"RETURN_EMPTY"))}),r.preventChangeEditor=!1):"click"===e.type&&(r.preventChangeEditor=!0,"tinymce"!=getUserSetting("editor")&&setUserSetting("editor","tinymce"))},attachListeners:function(){p(".wrap").on("tabsactivate",function(e,a){p.each(r.editor,function(e,t){!r.editor[e].contentEditor||r.editor[e].contentEditor.isHidden()?p("#"+e).val(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY"))})}),r.setSubmitID(),p(document).on("mouseenter",r.submitId,r.submit).on("mouseleave",r.submitId,r.submit).on("click",r.submitId,r.submit),p(document).on("tinymce-editor-init",function(e,t){if(-1!=_.indexOf(r.editorIDs,t.id)){var a=p("#"+t.id);r.editor[t.id]={},r.editor[t.id].contentEditor=t,r.editor[t.id].content=a.val(),t.setContent(WPGlobusCore.TextFilter(r.editor[t.id].content,WPGlobusCoreData.default_language,"RETURN_EMPTY")),p("#"+t.getContainer().id).find("iframe").addClass("wpglobus-translatable"),a.removeClass("hidden"),t.on("nodechange keyup",_.debounce(r.update,500)),a.on("input keyup",_.debounce(r.update,500))}})},update:function(e){var t,a;void 0!==e.target&&("tinymce"==(t=e.target.id)&&(t=e.target.dataset.id),void 0!==r.editor[t].contentEditor&&(a=!r.editor[t].contentEditor||r.editor[t].contentEditor.isHidden()?p("#"+t).val():r.editor[t].contentEditor.getContent({format:"raw"}),r.editor[t].content=WPGlobusCore.getString(r.editor[t].content,a,r.getCurrentTab())))},getCurrentTab:function(){return p(".wpglobus-taxonomy-tabs-list .ui-tabs-active").data("language")},start:function(){p(".wpglobus-element_description").css({display:"none"})}},WPGlobusYoastSeo.init();var i=function(){p(".wrap").on("tabsactivate",function(e,t){t.newTab[0].dataset.language==WPGlobusCoreData.default_language?p("#poststuff .inside").css({display:"block"}):p("#poststuff .inside").css({display:"none"})}),p.each(["category_description","sitedesc","sitename","tag_description","term_description","term_title"],function(e,t){wpseoReplaceVarsL10n.replace_vars[t]=WPGlobusCore.TextFilter(wpseoReplaceVarsL10n.replace_vars[t],WPGlobusCoreData.default_language)}),WPGlobusYoastSeo.observer=new MutationObserver(function(e){e.forEach(function(e){if("placeholder"==e.attributeName){WPGlobusYoastSeo.observer.disconnect();var t=p("#wpseo_focuskw");""==t.val()&&t.attr("placeholder",WPGlobusCore.TextFilter(t.attr("placeholder"),WPGlobusCoreData.default_language)),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0})}})}),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0})};window.WPGlobusYoastSeoPlugin=new i}else{var d;r=WPGlobusYoastSeo={wpseoTabSelector:"#wpglobus-wpseo-tabs",url:"",attrs:p("#wpglobus-wpseo-attr"),iB:p("#wpseo-meta-section-content"),t:p("#wpseo-meta-section-content"),ids:"",names:"",wpseoTab:WPGlobusCoreData.default_language,editSnippetButtonClass:"wpglobus-snippet-editor__edit-button",editSnippetFormClass:"wpglobus-snippet-editor__form",editSnippetSubmitClass:"wpglobus-snippet-editor__submit",editSnippetHeadingClass:"wpglobus-snippet-editor__heading-editor",yoastTitleProgress:"wpglobus-yoast-title-progress",yoastMetadescProgress:"wpglobus-yoast-metadesc-progress",yoastPremium:WPGlobusVendor.vendor.WPSEO_PREMIUM,keywordIndex:{},idsSpecial:"",init:function(){p.each(WPGlobusCoreData.enabled_languages,function(e,t){r.keywordIndex[t]=0}),r.start()},initAddKeywordPopup:function(){1==p("#wpseo-add-keyword-popup").length?p(".wpseo-add-keyword").on("click",r.addKeywordPopup):WPGlobusYoastSeoPremium&&WPGlobusYoastSeoPremium.addKeywordButton()},addKeywordPopup:function(){var e=p("#wpseo-add-keyword-popup-button").text();tb_show(e,"#TB_inline?width=650&height=350&inlineId=wpseo-add-keyword-popup","group"),p("#TB_window").css({width:"680px",height:"350px"})},qtip:function(){p(".yoast_help").qtip({content:{attr:"alt"},position:{my:"bottom left",at:"top center"},style:{tip:{corner:!0},classes:"yoast-qtip qtip-rounded qtip-blue"},show:"click",hide:{fixed:!0,delay:500}})},removeClasses:function(t,e){_.each(e,function(e){t.removeClass(e)})},updateProgressBar:function(e,t){if(void 0!==e&&(void 0!==t||("undefined"!==e.data("language")&&(t=e.data("language")),void 0!==t))){var a,s,o=["snippet-editor__progress--bad","snippet-editor__progress--ok","snippet-editor__progress--good"],i="",n=0,l=!1;s=e.val().length,e.hasClass("wpglobus-snippet-editor-title")?(n=(a=p("progress."+r.yoastTitleProgress+"_"+t)).attr("max"),i=o[2],0==s?i=o[1]:n<s?(i=o[1],l=!0):0<s&&s<35&&(i=o[1])):e.hasClass("wpglobus-snippet-editor-meta-description")&&(n=(a=p("progress."+r.yoastMetadescProgress+"_"+t)).attr("max"),i=o[2],0==s?i=o[1]:n<s?(i=o[1],l=!0):0<s&&s<121&&(i=o[1])),r.removeClasses(a,o),a.attr("value",s).addClass(i),l?e.css("color","#f00"):e.css("color","#000")}},updateWpseoKeyword:function(e,t){p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").text(e)},setSpecial:function(){r.idsSpecial=WPGlobusYoastSeo.attrs.data("ids-premium-special"),r.idsSpecial=r.idsSpecial.split(","),setTimeout(function(){if(1<p(".wpseo-cornerstone-checkbox").length&&p.each(WPGlobusCoreData.enabled_languages,function(e,t){if(t==WPGlobusCoreData.default_language){var a=p("#wpseofocuskeyword input#_yst_is_cornerstone");return p(a).attr("id","_yst_is_cornerstone_origin").attr("name","_yst_is_cornerstone_origin"),p(a).addClass("wpseo-cornerstone-checkbox_origin"),!0}p("#wpseo-tab-"+t+" .wpseo-cornerstone-checkbox").remove(),p("#wpseo-tab-"+t+' label[for="_yst_is_cornerstone"]').remove()}),1<p(".wpglobus-wpseometakeywords").length){var e=p(document).triggerHandler("wpglobus_meta_keywords");if(void 0!==e&&!0===e)return;p.each(WPGlobusCoreData.enabled_languages,function(e,t){if(t==WPGlobusCoreData.default_language){var a=p("#yoast_wpseo_metakeywords");return a.attr("id","yoast_wpseo_metakeywords_origin").attr("name","yoast_wpseo_metakeywords_origin"),a.addClass("metakeywords_origin"),p("#wpseometakeywords").attr("id","wpseometakeywords_origin"),p("#yoast_wpseo_metakeywords_"+t).attr("name","yoast_wpseo_metakeywords").attr("id","yoast_wpseo_metakeywords"),p("#wpseometakeywords_"+t).attr("id","wpseometakeywords"),!0}p("#wpseo-tab-"+t+" #wpseometakeywords_"+t+" .yoast-metabox__description").remove(),p("#wpseo-tab-"+t+" #yoast_wpseo_metakeywords_"+t).remove(),p("#wpseometakeywords_"+t+" .yoast-section").append('<div class="wpglobus-suggest" style="font-weight:bold;">'+WPGlobusVendor.i18n.yoastseo_plus_meta_keywords_access+"</div>")})}},2e3)},start:function(){p(r.wpseoTabSelector).tabs(),WPGlobusYoastSeoPremium||r.setSpecial(),r.ids=r.attrs.data("ids"),r.names=r.attrs.data("names"),r.ids=r.ids+","+r.attrs.data("qtip"),r.ids=r.ids.split(","),r.names=r.names.split(","),p("#wpglobus-wpseo-tabs").insertBefore(r.iB),p(".wpseo-metabox-tabs").css({height:"26px"}),p(".wpglobus-wpseo-general").each(function(e,t){var a=p(t),s=a.data("language"),o="wpseo-meta-section-content_"+s;a.html('<div id="'+o+'" class="wpseo-meta-section wpglobus-wpseo-meta-section" style="width:100%" data-language="'+s+'">'+r.t.html()+"</div>"),p("#"+o+" .wpseo-metabox-tabs").attr("id","wpseo-metabox-tabs_"+s).attr("data-language",s),p("#"+o+" .wpseotab").attr("id","wpseo_content_"+s),p("#wpseo_content_"+s).css({float:"left"}),p("#"+o).css({display:"block"}),p("#wpseo_meta").css({overflow:"hidden"}),p("#"+o+" .snippet_container").addClass("wpglobus-snippet_container"),s!==WPGlobusCoreData.default_language&&p("#"+o+" .wpseo-add-keyword").addClass("hidden"),p.each(r.names,function(e,t){p("#"+t).attr("name",t+"_"+s)}),p.each(r.ids,function(e,t){var a=p("#"+t);"wpseosnippet"==t&&a.addClass("wpglobus-wpseosnippet"),"snippet_title"==t&&a.addClass("wpglobus-snippet_title"),"snippet_meta"==t&&a.addClass("wpglobus-snippet_meta"),"snippet_cite"==t&&a.addClass("wpglobus-snippet_cite"),"snippet_citeBase"==t&&a.addClass("wpglobus-snippet_citeBase"),"url_container"==t&&a.css({height:"16px"}),"yoast_wpseo_focuskw_text_input"==t&&(a.addClass("wpglobus-yoast_wpseo_focuskw_text_input"),a.attr("data-value",""),a.parents("div#wpseofocuskeyword").attr("id","wpseofocuskeyword_"+s),p("#wpseofocuskeyword_"+s).addClass("wpglobus-wpseofocuskeyword")),"yoast_wpseo_focuskeywords"==t&&a.addClass("wpglobus-yoast_wpseo_focuskeywords"),"wpseo-pageanalysis"==t&&a.addClass("wpglobus-wpseo-pageanalysis"),"yoast-seo-content-analysis"==t&&a.addClass("wpglobus-yoast-seo-content-analysis"),"snippet_preview"==t&&a.addClass("wpglobus-snippet_preview"),"snippet-editor-title"==t&&(a.addClass("wpglobus-snippet-editor-title"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),a.val(p("#wpseo-tab-"+s).data("wpseotitle")),a.parent("label").next("progress").addClass(r.yoastTitleProgress).addClass(r.yoastTitleProgress+"_"+s),_.debounce(r.updateProgressBar(a,s),500)),"snippet-editor-slug"==t&&(a.addClass("wpglobus-snippet-editor-slug"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),WPGlobusCoreData.default_language!=s&&a.attr("disabled","disabled")),"snippet-editor-meta-description"==t&&(a.addClass("wpglobus-snippet-editor-meta-description"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),a.val(p("#wpseo-tab-"+s).data("metadesc")),a.parent("label").next("progress").addClass(r.yoastMetadescProgress).addClass(r.yoastMetadescProgress+"_"+s),_.debounce(r.updateProgressBar(a,s),500)),"snippetpreview-help-toggle"==t&&(a.addClass("wpglobus-snippetpreview-help-toggle_"+s),p(document).on("click",".wpglobus-snippetpreview-help-toggle_"+s,function(e){var t=p(this);"none"===p("#snippetpreview-help_"+t.data("language")).css("display")?p("#snippetpreview-help_"+t.data("language")).css({display:"block"}):p("#snippetpreview-help_"+t.data("language")).css({display:"none"})})),"focuskw_text_input-help-toggle"==t&&(a.addClass("wpglobus-focuskw_text_input-help-toggle_"+s),p(document).on("click",".wpglobus-focuskw_text_input-help-toggle_"+s,function(e){var t=p(this);"none"===p("#focuskw_text_input-help_"+t.data("language")).css("display")?p("#focuskw_text_input-help_"+t.data("language")).css({display:"block"}):p("#focuskw_text_input-help_"+t.data("language")).css({display:"none"})})),"pageanalysis-help-toggle"==t&&(a.addClass("wpglobus-pageanalysis-help-toggle_"+s),p(document).on("click",".wpglobus-pageanalysis-help-toggle_"+s,function(e){var t=p(this);"none"===p("#pageanalysis-help_"+t.data("language")).css("display")?p("#pageanalysis-help_"+t.data("language")).css({display:"block"}):p("#pageanalysis-help_"+t.data("language")).css({display:"none"})})),"snippet_preview"==t&&(WPGlobusYoastSeoPremium||a.css({"margin-bottom":"20px"})),"wpseo-focuskeyword-section"==t&&(WPGlobusYoastSeoPremium||a.css({"margin-bottom":"20px"})),"pageanalysis"==t&&(WPGlobusYoastSeoPremium||s==WPGlobusCoreData.default_language&&setTimeout(function(){var a=0,s=0,e=WPGlobusCoreData.default_language;p("#pageanalysis_"+e+" #wpseo-pageanalysis_"+e+" li.score").each(function(e,t){s+=p(t).outerHeight(!0)}),p.each(WPGlobusCoreData.enabled_languages,function(e,t){a=s+50,p("#pageanalysis_"+t).css({height:a+"px"})})},4e3)),"wpseo-pageanalysis-section"==t&&(WPGlobusYoastSeoPremium?a.css({overflow:"overlay"}):a.css({height:"inherit"})),"wpseometakeywords"==t&&(a.css({"margin-bottom":"2em"}),a.addClass("wpglobus-wpseometakeywords")),"yoast_wpseo_metakeywords"==t&&(a.addClass("wpglobus-metakeywords"),p('input[name="yoast_wpseo_metakeywords_'+s+'"]').val(WPGlobusCore.TextFilter(p("#yoast_wpseo_metakeywords").val(),s,"RETURN_EMPTY"))),a.attr("id",t+"_"+s),p("#"+t+"_"+s).attr("data-language",s)});var i=WPGlobusCore.TextFilter(p("#yoast_wpseo_focuskw_text_input").val(),s,"RETURN_EMPTY");p("#yoast_wpseo_focuskw_text_input_"+s).val(i).data("value",i),p("#yoast_wpseo_focuskw_"+s).val(i),WPGlobusYoastSeoPremium||p("#wpseo-metabox-tabs_"+s+" .wpseo_keyword_tab .wpseo_tablink").data("keyword",i),p("#wpseo-metabox-tabs_"+s+" .wpseo_keyword_tab").css({"min-width":"60px","min-height":"29px"}),r.updateWpseoKeyword(i,s),s!==WPGlobusCoreData.default_language&&(p("#"+o+" #yoast_wpseo_focuskw_text_input_"+s).addClass("hidden").after('<div class="wpglobus-suggest" style="font-weight:bold;">'+WPGlobusVendor.i18n.yoastseo_plus_page_analysis_access+"</div>"),p("#"+o+" #wpseo-pageanalysis_"+s).addClass("hidden").css({display:"none"})),WPGlobusYoastSeoPremium&&(s==WPGlobusCoreData.default_language||(p("#wpseo-metabox-tabs_"+s+" .wpseo_keyword_tab").removeClass("wpseo_keyword_tab").addClass("wpglobus-wpseo_keyword_tab"),p("#wpseo-meta-section-content_"+s+" .wpseo_keyword_tab_hideable").css({display:"none"}).attr("data-language",s)))}),p(".wpglobus-wpseosnippet").each(function(e,t){var a=p(t),s=a.data("language");a.find("button.snippet-editor__button.snippet-editor__edit-button").addClass(r.editSnippetButtonClass).addClass(r.editSnippetButtonClass+"_"+s).attr("data-language",s),a.find(".snippet-editor__form").addClass(r.editSnippetFormClass).addClass(r.editSnippetFormClass+"_"+s),a.find(".snippet-editor__heading-editor").addClass(r.editSnippetHeadingClass).addClass(r.editSnippetHeadingClass+"_"+s),a.find(".snippet-editor__submit").addClass(r.editSnippetSubmitClass).addClass(r.editSnippetSubmitClass+"_"+s).attr("data-language",s)}),r.iB.addClass("hidden"),r.iB.css({height:0,overflow:"hidden",display:"none"}),WPGlobusYoastSeoPremium&&p("#wpseo-meta-section-content .wpseo_keyword_tab").removeClass("wpseo_keyword_tab").addClass("wpseo_keyword_tab_original");var e=WPGlobusCore.TextFilter(p("#yoast_wpseo_focuskw_text_input").val(),WPGlobusCoreData.default_language,"RETURN_EMPTY");p("#yoast_wpseo_focuskw_text_input").val(e),p("#yoast_wpseo_focuskw").val(e),p(document).on("click",".wpglobus-wpseo-general .wpseo_tablink",function(e){e.preventDefault();var t=p(this),a=t.parents("ul").data("language"),s=t.parent("li");if(a==WPGlobusCoreData.default_language||void 0!==p(document).triggerHandler("wpglobus_yoast_analysis",{language:a}))if(s.hasClass("wpseo_generic_tab"))p("#wpseo-pageanalysis_"+a).css({display:"none"}),p("#yoast-seo-content-analysis_"+a).css({display:"block"}),p("#wpseo_content_"+a+" table tr").eq(0).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(1).css({display:"none"}),p("#yoast-seo-content-analysis_"+a+" li a").css({float:"none"}),p("#wpseosnippet_"+a).css({display:"none"}),p("#wpseofocuskeyword_"+a).css({display:"none"});else if(s.hasClass("wpseo_keyword_tab")){if(p("#wpseosnippet_"+a).css({display:""}),p("#wpseofocuskeyword_"+a).css({display:""}),WPGlobusYoastSeoPremium&&(p("#wpseo-meta-section-content_"+a+" .wpseo_keyword_tab").removeClass("active"),t.parent(".wpseo_keyword_tab").addClass("active"),p("#wpseo-pageanalysis_"+a).css({display:"block"}),p("#yoast-seo-content-analysis_"+a).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(0).css("display",""),p("#wpseo_content_"+a+" table tr").eq(1).css("display",""),p("#wpseo-metabox-tabs_"+a+" .wpseo_keyword_tab").each(function(e,t){if(p(t).hasClass("active"))return r.keywordIndex[a]=e,!1})),!WPGlobusYoastSeoPremium&&a!=WPGlobusCoreData.default_language)return p("#wpseo-pageanalysis_"+a).css({display:"block"}),p("#yoast-seo-content-analysis_"+a).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(0).css("display",""),void p("#wpseo_content_"+a+" table tr").eq(1).css("display","");var o=r.getKeywordsOrig()[r.keywordIndex[a]].keyword;YoastSEO.app.rawData.keyword=o,p("#yoast_wpseo_focuskw_text_input").val(o),p("#yoast_wpseo_focuskw_text_input_"+a).val(o),p('input[name="yoast_wpseo_focuskw"]').val(o),i.prototype.analyze(),p("#wpseo-pageanalysis_"+a).css({display:"block"}),p("#yoast-seo-content-analysis_"+a).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(0).css("display",""),p("#wpseo_content_"+a+" table tr").eq(1).css("display","")}else s.hasClass("wpglobus-wpseo_keyword_tab")&&(p("#wpseo-pageanalysis_"+a).css({display:"block"}),p("#yoast-seo-content-analysis_"+a).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(0).css("display",""),p("#wpseo_content_"+a+" table tr").eq(1).css("display",""))}),p(".wpseo-metabox-sidebar .wpseo-meta-section-link").on("click",function(e){"#wpseo-meta-section-content"==p(this).attr("href")?p("#wpglobus-wpseo-tabs").css({display:"block"}):p("#wpglobus-wpseo-tabs").css({display:"none"})}),p(document).on("click","."+r.editSnippetButtonClass,function(e){var t=p(this),a=t.data("language"),s=p("."+r.editSnippetFormClass+"_"+a),o=p("."+r.editSnippetSubmitClass+"_"+a),i=p("."+r.editSnippetHeadingClass+"_"+a);s.hasClass("snippet-editor--hidden")?(s.removeClass("snippet-editor--hidden"),i.removeClass("snippet-editor--hidden"),o.removeClass("snippet-editor--hidden")):(s.addClass("snippet-editor--hidden"),i.addClass("snippet-editor--hidden")),t.addClass("snippet-editor--hidden")}),p(document).on("click","."+r.editSnippetSubmitClass,function(e){var t=p(this).data("language"),a=p("."+r.editSnippetButtonClass+"_"+t),s=p("."+r.editSnippetFormClass+"_"+t),o=p("."+r.editSnippetSubmitClass+"_"+t),i=p("."+r.editSnippetHeadingClass+"_"+t);a.removeClass("snippet-editor--hidden"),s.addClass("snippet-editor--hidden"),o.addClass("snippet-editor--hidden"),i.addClass("snippet-editor--hidden")}),p(document).on("keyup","input.wpglobus-snippet-editor-title",function(e){var t=p(this),a=t.data("language"),s=WPGlobusCore.getString(p('input[name="yoast_wpseo_title"]').val(),t.val(),a);p("#snippet_title_"+a).html(d.replaceVariablesPlugin(t.val())),YoastSEO.app.rawData.pageTitle=s,p('input[name="yoast_wpseo_title"]').val(s),p("#snippet_title").text(s),_.debounce(r.updateProgressBar(t,a),500)}),p(document).on("keyup","input.wpglobus-snippet-editor-slug",function(e){var t=p(this),a=t.data("language");p("#snippet_cite_"+a).text(t.val()+"/"),p("#editable-post-name").text(t.val()),p("#editable-post-name-full").text(t.val())}),p(document).on("change","input.wpglobus-snippet-editor-slug",function(e){var t=p(this);p.post(ajaxurl,{action:"sample-permalink",post_id:p("#post_ID").val()||0,new_slug:t.val(),new_title:p("#title").val(),samplepermalinknonce:p("#samplepermalinknonce").val()})}),p(document).on("keyup","textarea.wpglobus-snippet-editor-meta-description",function(e){var t=p(this),a=t.data("language");p("#snippet_meta_"+a).text(t.val());var s=WPGlobusCore.getString(p("#yoast_wpseo_metadesc").val(),t.val(),t.data("language"));p("#yoast_wpseo_metadesc").val(s),p("#snippet_meta").text(s),_.debounce(r.updateProgressBar(t,a),500)}),p(document).on("click",".wpglobus-post-body-tabs-list li",function(e){var t=p(this);if(t.hasClass("wpglobus-post-tab")){p("#wpglobus-wpseo-tabs").tabs("option","active",t.data("order"));var a=p("#yoast_wpseo_focuskw_text_input_"+t.data("language")).val();YoastSEO.app.rawData.keyword=a,p("#yoast_wpseo_focuskw_text_input").val(a),p('input[name="yoast_wpseo_focuskw"]').val(a),i.prototype.analyze()}}),r.initAddKeywordPopup()},getKeywordsOrig:function(){return p(".wpseo_keyword_tab").map(function(e,t){return{keyword:(t=p(t).find(".wpseo_tablink")).data("keyword")+"",score:t.data("score")}}).get()}},(i=function(){this.replaceVars=wpseoReplaceVarsL10n.replace_vars,this.language=WPGlobusCoreData.default_language,this.tab=WPGlobusCoreData.default_language,this.wpseoTab=WPGlobusCoreData.default_language,this.title_template=wpseoPostScraperL10n.title_template,this.focuskw=p("#yoast_wpseo_focuskw_text_input"),this.focuskw_hidden=p('input[name="yoast_wpseo_focuskw"]'),this.focuskwKeep=!1,this.post_slug="#editable-post-name-full",YoastSEO.app.registerPlugin("wpglobusYoastSeoPlugin",{status:"ready"}),YoastSEO.app.registerModification("content",this.contentModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("title",this.titleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_title",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_meta",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_page_title",this.pageTitleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_meta_desc",this.metaDescModification,"wpglobusYoastSeoPlugin",0),i.prototype.setScoreIcon(),p(document).on("blur",".wpglobus-snippet_title",function(e){var t=p(this),a=WPGlobusCore.getString(p("#yoast_wpseo_title").val(),t.text(),t.data("language"));YoastSEO.app.rawData.pageTitle=a,p('input[name="yoast_wpseo_title"]').val(a),p("#snippet_title").text(a)}),p(document).on("blur",".wpglobus-snippet_meta",function(e){var t=p(this),a=WPGlobusCore.getString(p("#yoast_wpseo_metadesc").val(),t.text(),t.data("language"));p("#yoast_wpseo_metadesc").val(a),p("#snippet_meta").text(a)}),p(document).on("keyup",".wpglobus-yoast_wpseo_focuskw_text_input",function(e){var t=p(this),a=t.val(),s=t.data("language");d.focuskw.val(a),d.focuskw_hidden.val(a),WPGlobusYoastSeoPremium||p("#wpseo-metabox-tabs_"+s+" .wpseo_keyword_tab .wpseo_tablink").data("keyword",a),d.updateWpseoKeyword(a,s),0==WPGlobusYoastSeo.keywordIndex[s]?p("#yoast_wpseo_focuskw_text_input_"+s).data("value",a):WPGlobusYoastSeoPremium&&WPGlobusYoastSeoPremium.setFocuskeyword(s),i.prototype.analyze()}),p("#publish,#save-post").on("mouseenter",function(e){var s,o="";p(".wpglobus-yoast_wpseo_focuskw_text_input").each(function(e,t){if((s=p(this)).data("language")==WPGlobusCoreData.default_language)if(WPGlobusYoastSeoPremium){var a=WPGlobusYoastSeo.getKeywordsOrig();o=WPGlobusCore.getString(o,a[0].keyword,s.data("language"))}else o=WPGlobusCore.getString(o,s.val(),s.data("language"));else o=WPGlobusCore.getString(o,s.val(),s.data("language"))}),d.focuskw.val(o),d.focuskw_hidden.val(o)}).on("mouseleave",function(e){if(!d.focuskwKeep){d.wpseoTab=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language");p(this);d.focuskw.val(p("#yoast_wpseo_focuskw_text_input_"+d.wpseoTab).val()),d.focuskw_hidden.val(p("#yoast_wpseo_focuskw_text_input_"+d.wpseoTab).val())}}).on("click",function(e){d.focuskwKeep=!0}),p(document).on("tabsactivate",WPGlobusYoastSeo.wpseoTabSelector,function(e,t){if(d.language=t.newPanel.attr("data-language"),WPGlobusYoastSeo.wpseoTab=d.language,t.newPanel.attr("data-language")===WPGlobusCoreData.default_language){var a;if(WPGlobusYoastSeoPremium)p("#wpseo-meta-section-content_"+WPGlobusYoastSeoPremium.dLang+" .wpseo_keyword_tab").removeClass("active"),p("#wpseo-meta-section-content_"+WPGlobusYoastSeoPremium.dLang+" .wpseo_keyword_tab").eq(WPGlobusYoastSeo.keywordIndex[WPGlobusYoastSeoPremium.dLang]).addClass("active"),a=p("#yoast_wpseo_focuskw_text_input_"+WPGlobusYoastSeoPremium.dLang).val();else a=p("#yoast_wpseo_focuskw_text_input_"+WPGlobusCoreData.default_language).val();YoastSEO.app.rawData.keyword=a,d.focuskw.val(a),d.focuskw_hidden.val(a)}p("#wpseo-metabox-tabs_"+d.language+" .wpseo_keyword_tab").each(function(e,t){if(p(t).hasClass("active"))return WPGlobusYoastSeo.keywordIndex[d.language]=e,!1}),i.prototype.analyze()}),d=this}).prototype.analyze=function(){var e=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language");e==WPGlobusCoreData.default_language?YoastSEO.app.snippetPreview.data.urlPath=p("#editable-post-name-full").text():0!=p("#editable-post-name-full-"+e).length?YoastSEO.app.snippetPreview.data.urlPath=p("#editable-post-name-full-"+e).text():YoastSEO.app.snippetPreview.data.urlPath=p("#editable-post-name-full").text(),YoastSEO.app.analyzeTimer(YoastSEO.app),i.prototype.setScoreIcon()},i.prototype.setScoreIcon=function(){var s;s=setInterval(function(){var e=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language"),t=p("#wpseo-meta-section-content .wpseo_generic_tab a").data("score"),a=p("#wpseo-meta-section-content .wpseo_keyword_tab a").data("score");""!=t&&(p("#wpseo-metabox-tabs_"+e+" .wpseo_generic_tab .wpseo-score-icon").removeClass("bad ok good 100 na"),p("#wpseo-metabox-tabs_"+e+" .wpseo_generic_tab .wpseo-score-icon").addClass(t)),void 0!==a&&""!=a&&(WPGlobusYoastSeoPremium&&e!=WPGlobusYoastSeoPremium.dLang?(p("#wpseo-metabox-tabs_"+e+" .wpglobus-wpseo_keyword_tab .wpseo-score-icon").removeClass("bad ok good 100 na"),p("#wpseo-metabox-tabs_"+e+" .wpglobus-wpseo_keyword_tab .wpseo-score-icon").addClass(a)):(p("#wpseo-metabox-tabs_"+e+" .wpseo_keyword_tab .wpseo-score-icon").removeClass("bad ok good 100 na"),p("#wpseo-metabox-tabs_"+e+" .wpseo_keyword_tab .wpseo-score-icon").addClass(a))),clearInterval(s)},1500)},i.prototype.getWPseoTab=function(){return p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language")},i.prototype.citeModification=function(e){var t="#snippet_citeBase_"+e,a="#snippet_cite_"+e,s=p("#wpseo-tab-"+e).data("yoast-cite-base");!1===p("#wpseo-tab-"+e).data("cite-contenteditable")&&p(a).attr("contenteditable","false"),p(t).text(s)},i.prototype.pageTitleModification=function(e){var a,s,o,i="#snippet_title_",n="",l="";if(d.title_template==e)p.each(WPGlobusCoreData.enabled_languages,function(e,t){s=p("#snippet-editor-title_"+t).val(),o=0==s.length?d.title_template:s,n=d.replaceVariablesPlugin(o),p(i+t).text(n),t==d.getWPseoTab()&&(l=n)});else{if(a=WPGlobusCore.getTranslations(e),d.getWPseoTab()!==WPGlobusCoreData.default_language&&a[WPGlobusCoreData.default_language]==e){var t=d.getWPseoTab();return s=p("#snippet-editor-title_"+t).val(),o=0<s.length?s:d.title_template,o=d.replaceVariablesPlugin(o),p(i+t).text(o),o}p.each(WPGlobusCoreData.enabled_languages,function(e,t){n=""===a[t]?d.replaceVariablesPlugin(d.title_template):d.replaceVariablesPlugin(a[t]),t==d.getWPseoTab()&&(l=n,0!=(s=p("#snippet-editor-title_"+t).val()).length?s!=l&&(l=d.replaceVariablesPlugin(s)):l=d.replaceVariablesPlugin(d.title_template)),p(i+t).html(l)})}return l},i.prototype.metaDescModification=function(a){var e,s="#snippet_meta_",t=WPGlobusCore.getTranslations(a),o="";if(e=p("#snippet-editor-meta-description_"+d.getWPseoTab()).val(),d.getWPseoTab()===WPGlobusCoreData.default_language||t[WPGlobusCoreData.default_language]!=a)return p.each(WPGlobusCoreData.enabled_languages,function(e,t){p(s+t).text(WPGlobusCore.TextFilter(a,t,"RETURN_EMPTY")),d.citeModification(t)}),e==t[d.getWPseoTab()]?0==(o=t[d.getWPseoTab()]).length&&p(s+d.getWPseoTab()).text(WPGlobusCore.TextFilter(YoastSEO.app.snippetPreview.data.metaDesc,WPGlobusCoreData.default_language,"RETURN_EMPTY")):0==(o=e).length?p(s+d.getWPseoTab()).text(WPGlobusCore.TextFilter(YoastSEO.app.snippetPreview.data.metaDesc,WPGlobusCoreData.default_language,"RETURN_EMPTY")):p(s+d.getWPseoTab()).text(o),p(s+d.getWPseoTab()).text(o),o;var i=d.getWPseoTab();return d.citeModification(i),0==e.length?p(s+i).text(""):e!=a&&p(s+i).text(e),a},i.prototype.snippetModification=function(e){return WPGlobusCore.TextFilter(e,d.getWPseoTab(),"RETURN_EMPTY")},i.prototype.contentModification=function(e){return d.getWPseoTab()==WPGlobusCoreData.default_language?e:p("#content_"+d.getWPseoTab()).val()},i.prototype.titleModification=function(e){return setTimeout(d.updatePageAnalysis,1e3),d.getWPseoTab()==WPGlobusCoreData.default_language?e:p("#title_"+d.getWPseoTab()).val()},i.prototype.defaultReplace=function(e){var t=YoastSEO.app.rawData.keyword;return e.replace(/%%sitedesc%%/g,this.replaceVars.sitedesc).replace(/%%sitename%%/g,WPGlobusCore.TextFilter(this.replaceVars.sitename,d.getWPseoTab())).replace(/%%term_title%%/g,this.replaceVars.term_title).replace(/%%term_description%%/g,this.replaceVars.term_description).replace(/%%category_description%%/g,this.replaceVars.category_description).replace(/%%tag_description%%/g,this.replaceVars.tag_description).replace(/%%searchphrase%%/g,this.replaceVars.searchphrase).replace(/%%date%%/g,this.replaceVars.date).replace(/%%id%%/g,this.replaceVars.id).replace(/%%page%%/g,this.replaceVars.page).replace(/%%currenttime%%/g,this.replaceVars.currenttime).replace(/%%currentdate%%/g,this.replaceVars.currentdate).replace(/%%currentday%%/g,this.replaceVars.currentday).replace(/%%currentmonth%%/g,this.replaceVars.currentmonth).replace(/%%currentyear%%/g,this.replaceVars.currentyear).replace(/%%focuskw%%/g,t)},i.prototype.replaceVariablesPlugin=function(e){return void 0!==e&&(e=this.titleReplace(e),e=this.defaultReplace(e),e=this.replaceSeparators(e)),e},i.prototype.replaceSeparators=function(e){return e.replace(/%%sep%%(\s+%%sep%%)*/g,this.replaceVars.sep)},i.prototype.titleReplace=function(e){var t="";return void 0===(t=this.language==WPGlobusCoreData.default_language?p("#title").val():p("#title_"+this.language).val())&&(t=YoastSEO.app.rawData.pageTitle),this.language!=WPGlobusCoreData.default_language&&0==t.length&&(t=p("#title").val()),e=e.replace(/%%title%%/g,t)},i.prototype.doubleSepReplace=function(e){var t=YoastSEO.app.stringHelper.addEscapeChars(this.replaceVars.sep),a=new RegExp(t+" "+t,"g");return e=e.replace(a,this.replaceVars.sep)},i.prototype.updateWpseoKeyword=function(e,t){0<p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").length&&p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").removeClass("wpseo-keyword").addClass("wpglobus-wpseo_keyword_"+t),p(".wpglobus-wpseo_keyword_"+t).text(e)},i.prototype.updatePageAnalysis=function(){p("#wpseo-pageanalysis_"+d.getWPseoTab()).html(p("#wpseo-pageanalysis").html()),p("#yoast-seo-content-analysis_"+d.getWPseoTab()).html(p("#yoast-seo-content-analysis").html()),p("#yoast-seo-content-analysis_"+d.getWPseoTab()+" li a").css({float:"none"})},window.WPGlobusYoastSeoPlugin=new i}});
includes/js/wpglobus-yoastseo-59.min.js CHANGED
@@ -1 +1 @@
1
- var WPGlobusYoastSeo,WPGlobusYoastSeoPremium=!1;jQuery(document).ready(function(p){"use strict";var r;if("undefined"!=typeof wpseoReplaceVarsL10n&&("undefined"!=typeof WPGlobusCoreData&&"undefined"!=typeof WPGlobusVendor))if("edit-tags.php"==WPGlobusVendor.pagenow||"term.php"==WPGlobusVendor.pagenow){r=WPGlobusYoastSeo={editorIDs:["description"],editor:{},submitId:"",preventChangeEditor:!1,observer:null,init:function(){r.attachListeners(),_.delay(r.start,1500)},setSubmitID:function(){1==p(".edit-tag-actions .button").length&&(r.submitId=".edit-tag-actions .button"),1==p("#submit").length&&(r.submitId="#submit")},submit:function(e){"mouseenter"===e.type?p.each(r.editor,function(e,t){!r.editor[e].contentEditor||r.editor[e].contentEditor.isHidden()?p("#"+e).val(r.editor[e].content):tinymce.get(e).setContent(r.editor[e].content)}):"mouseleave"===e.type?r.preventChangeEditor||(p.each(r.editor,function(e,t){!r.editor[e].contentEditor||r.editor[e].contentEditor.isHidden()?p("#"+e).val(WPGlobusCore.TextFilter(t.content,r.getCurrentTab(),"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,r.getCurrentTab(),"RETURN_EMPTY"))}),r.preventChangeEditor=!1):"click"===e.type&&(r.preventChangeEditor=!0,"tinymce"!=getUserSetting("editor")&&setUserSetting("editor","tinymce"))},attachListeners:function(){p(".wrap").on("tabsactivate",function(e,a){p.each(r.editor,function(e,t){!r.editor[e].contentEditor||r.editor[e].contentEditor.isHidden()?p("#"+e).val(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY"))})}),r.setSubmitID(),p(document).on("mouseenter",r.submitId,r.submit).on("mouseleave",r.submitId,r.submit).on("click",r.submitId,r.submit),p(document).on("tinymce-editor-init",function(e,t){if(-1!=_.indexOf(r.editorIDs,t.id)){var a=p("#"+t.id);r.editor[t.id]={},r.editor[t.id].contentEditor=t,r.editor[t.id].content=a.val(),t.setContent(WPGlobusCore.TextFilter(r.editor[t.id].content,WPGlobusCoreData.default_language,"RETURN_EMPTY")),p("#"+t.getContainer().id).find("iframe").addClass("wpglobus-translatable"),a.removeClass("hidden"),t.on("nodechange keyup",_.debounce(r.update,500)),a.on("input keyup",_.debounce(r.update,500))}})},update:function(e){var t,a;void 0!==e.target&&("tinymce"==(t=e.target.id)&&(t=e.target.dataset.id),void 0!==r.editor[t].contentEditor&&(a=!r.editor[t].contentEditor||r.editor[t].contentEditor.isHidden()?p("#"+t).val():r.editor[t].contentEditor.getContent({format:"raw"}),r.editor[t].content=WPGlobusCore.getString(r.editor[t].content,a,r.getCurrentTab())))},getCurrentTab:function(){return p(".wpglobus-taxonomy-tabs-list .ui-tabs-active").data("language")},start:function(){p(".wpglobus-element_description").css({display:"none"})}},WPGlobusYoastSeo.init();var i=function(){p(".wrap").on("tabsactivate",function(e,t){t.newTab[0].dataset.language==WPGlobusCoreData.default_language?p("#poststuff .inside").css({display:"block"}):p("#poststuff .inside").css({display:"none"})}),p.each(["category_description","sitedesc","sitename","tag_description","term_description","term_title"],function(e,t){wpseoReplaceVarsL10n.replace_vars[t]=WPGlobusCore.TextFilter(wpseoReplaceVarsL10n.replace_vars[t],WPGlobusCoreData.default_language)}),WPGlobusYoastSeo.observer=new MutationObserver(function(e){e.forEach(function(e){if("placeholder"==e.attributeName){WPGlobusYoastSeo.observer.disconnect();var t=p("#wpseo_focuskw");""==t.val()&&t.attr("placeholder",WPGlobusCore.TextFilter(t.attr("placeholder"),WPGlobusCoreData.default_language)),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0})}})}),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0})};window.WPGlobusYoastSeoPlugin=new i}else{var d;r=WPGlobusYoastSeo={wpseoTabSelector:"#wpglobus-wpseo-tabs",url:"",attrs:p("#wpglobus-wpseo-attr"),iB:p("#wpseo-meta-section-content"),t:p("#wpseo-meta-section-content"),ids:"",names:"",wpseoTab:WPGlobusCoreData.default_language,editSnippetButtonClass:"wpglobus-snippet-editor__edit-button",editSnippetFormClass:"wpglobus-snippet-editor__form",editSnippetSubmitClass:"wpglobus-snippet-editor__submit",editSnippetHeadingClass:"wpglobus-snippet-editor__heading-editor",yoastTitleProgress:"wpglobus-yoast-title-progress",yoastMetadescProgress:"wpglobus-yoast-metadesc-progress",yoastPremium:WPGlobusVendor.vendor.WPSEO_PREMIUM,keywordIndex:{},idsSpecial:"",init:function(){p.each(WPGlobusCoreData.enabled_languages,function(e,t){r.keywordIndex[t]=0}),r.start()},initAddKeywordPopup:function(){1==p("#wpseo-add-keyword-popup").length?p(".wpseo-add-keyword").on("click",r.addKeywordPopup):WPGlobusYoastSeoPremium&&WPGlobusYoastSeoPremium.addKeywordButton()},addKeywordPopup:function(){var e=p("#wpseo-add-keyword-popup-button").text();tb_show(e,"#TB_inline?width=650&height=350&inlineId=wpseo-add-keyword-popup","group"),p("#TB_window").css({width:"680px",height:"350px"})},qtip:function(){p(".yoast_help").qtip({content:{attr:"alt"},position:{my:"bottom left",at:"top center"},style:{tip:{corner:!0},classes:"yoast-qtip qtip-rounded qtip-blue"},show:"click",hide:{fixed:!0,delay:500}})},removeClasses:function(t,e){_.each(e,function(e){t.removeClass(e)})},updateProgressBar:function(e,t){if(void 0!==e&&(void 0!==t||("undefined"!==e.data("language")&&(t=e.data("language")),void 0!==t))){var a,s,o=["snippet-editor__progress--bad","snippet-editor__progress--ok","snippet-editor__progress--good"],i="",n=0,l=!1;s=e.val().length,e.hasClass("wpglobus-snippet-editor-title")?(n=(a=p("progress."+r.yoastTitleProgress+"_"+t)).attr("max"),i=o[2],0==s?i=o[1]:n<s?(i=o[1],l=!0):0<s&&s<35&&(i=o[1])):e.hasClass("wpglobus-snippet-editor-meta-description")&&(n=(a=p("progress."+r.yoastMetadescProgress+"_"+t)).attr("max"),i=o[2],0==s?i=o[1]:n<s?(i=o[1],l=!0):0<s&&s<121&&(i=o[1])),r.removeClasses(a,o),a.attr("value",s).addClass(i),l?e.css("color","#f00"):e.css("color","#000")}},updateWpseoKeyword:function(e,t){p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").text(e)},setSpecial:function(){r.idsSpecial=WPGlobusYoastSeo.attrs.data("ids-premium-special"),r.idsSpecial=r.idsSpecial.split(","),setTimeout(function(){if(1<p(".wpseo-cornerstone-checkbox").length&&p.each(WPGlobusCoreData.enabled_languages,function(e,t){if(t==WPGlobusCoreData.default_language){var a=p("#wpseofocuskeyword input#_yst_is_cornerstone");return p(a).attr("id","_yst_is_cornerstone_origin").attr("name","_yst_is_cornerstone_origin"),p(a).addClass("wpseo-cornerstone-checkbox_origin"),!0}p("#wpseo-tab-"+t+" .wpseo-cornerstone-checkbox").remove(),p("#wpseo-tab-"+t+' label[for="_yst_is_cornerstone"]').remove()}),1<p(".wpglobus-wpseometakeywords").length){var e=p(document).triggerHandler("wpglobus_meta_keywords");if(void 0!==e&&!0===e)return;p.each(WPGlobusCoreData.enabled_languages,function(e,t){if(t==WPGlobusCoreData.default_language){var a=p("#yoast_wpseo_metakeywords");return a.attr("id","yoast_wpseo_metakeywords_origin").attr("name","yoast_wpseo_metakeywords_origin"),a.addClass("metakeywords_origin"),p("#wpseometakeywords").attr("id","wpseometakeywords_origin"),p("#yoast_wpseo_metakeywords_"+t).attr("name","yoast_wpseo_metakeywords").attr("id","yoast_wpseo_metakeywords"),p("#wpseometakeywords_"+t).attr("id","wpseometakeywords"),!0}p("#wpseo-tab-"+t+" #wpseometakeywords_"+t+" .yoast-metabox__description").remove(),p("#wpseo-tab-"+t+" #yoast_wpseo_metakeywords_"+t).remove(),p("#wpseometakeywords_"+t+" .yoast-section").append('<div class="wpglobus-suggest" style="font-weight:bold;">'+WPGlobusVendor.i18n.yoastseo_plus_meta_keywords_access+"</div>")})}},2e3)},start:function(){p(r.wpseoTabSelector).tabs(),WPGlobusYoastSeoPremium||r.setSpecial(),r.ids=r.attrs.data("ids"),r.names=r.attrs.data("names"),r.ids=r.ids+","+r.attrs.data("qtip"),r.ids=r.ids.split(","),r.names=r.names.split(","),p("#wpglobus-wpseo-tabs").insertBefore(r.iB),p(".wpseo-metabox-tabs").css({height:"26px"}),p(".wpglobus-wpseo-general").each(function(e,t){var a=p(t),s=a.data("language"),o="wpseo-meta-section-content_"+s;a.html('<div id="'+o+'" class="wpseo-meta-section wpglobus-wpseo-meta-section" style="width:100%" data-language="'+s+'">'+r.t.html()+"</div>"),p("#"+o+" .wpseo-metabox-tabs").attr("id","wpseo-metabox-tabs_"+s).attr("data-language",s),p("#"+o+" .wpseotab").attr("id","wpseo_content_"+s),p("#wpseo_content_"+s).css({float:"left"}),p("#"+o).css({display:"block"}),p("#wpseo_meta").css({overflow:"hidden"}),p("#"+o+" .snippet_container").addClass("wpglobus-snippet_container"),s!==WPGlobusCoreData.default_language&&p("#"+o+" .wpseo-add-keyword").addClass("hidden"),p.each(r.names,function(e,t){p("#"+t).attr("name",t+"_"+s)}),p.each(r.ids,function(e,t){var a=p("#"+t);"wpseosnippet"==t&&a.addClass("wpglobus-wpseosnippet"),"snippet_title"==t&&a.addClass("wpglobus-snippet_title"),"snippet_meta"==t&&a.addClass("wpglobus-snippet_meta"),"snippet_cite"==t&&a.addClass("wpglobus-snippet_cite"),"snippet_citeBase"==t&&a.addClass("wpglobus-snippet_citeBase"),"url_container"==t&&a.css({height:"16px"}),"yoast_wpseo_focuskw_text_input"==t&&(a.addClass("wpglobus-yoast_wpseo_focuskw_text_input"),a.attr("data-value",""),a.parents("div#wpseofocuskeyword").attr("id","wpseofocuskeyword_"+s),p("#wpseofocuskeyword_"+s).addClass("wpglobus-wpseofocuskeyword")),"yoast_wpseo_focuskeywords"==t&&a.addClass("wpglobus-yoast_wpseo_focuskeywords"),"wpseo-pageanalysis"==t&&a.addClass("wpglobus-wpseo-pageanalysis"),"yoast-seo-content-analysis"==t&&a.addClass("wpglobus-yoast-seo-content-analysis"),"snippet_preview"==t&&a.addClass("wpglobus-snippet_preview"),"snippet-editor-title"==t&&(a.addClass("wpglobus-snippet-editor-title"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),a.val(p("#wpseo-tab-"+s).data("wpseotitle")),a.parent("label").next("progress").addClass(r.yoastTitleProgress).addClass(r.yoastTitleProgress+"_"+s),_.debounce(r.updateProgressBar(a,s),500)),"snippet-editor-slug"==t&&(a.addClass("wpglobus-snippet-editor-slug"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),WPGlobusCoreData.default_language!=s&&a.attr("disabled","disabled")),"snippet-editor-meta-description"==t&&(a.addClass("wpglobus-snippet-editor-meta-description"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),a.val(p("#wpseo-tab-"+s).data("metadesc")),a.parent("label").next("progress").addClass(r.yoastMetadescProgress).addClass(r.yoastMetadescProgress+"_"+s),_.debounce(r.updateProgressBar(a,s),500)),"snippetpreview-help-toggle"==t&&(a.addClass("wpglobus-snippetpreview-help-toggle_"+s),p(document).on("click",".wpglobus-snippetpreview-help-toggle_"+s,function(e){var t=p(this);"none"===p("#snippetpreview-help_"+t.data("language")).css("display")?p("#snippetpreview-help_"+t.data("language")).css({display:"block"}):p("#snippetpreview-help_"+t.data("language")).css({display:"none"})})),"focuskw_text_input-help-toggle"==t&&(a.addClass("wpglobus-focuskw_text_input-help-toggle_"+s),p(document).on("click",".wpglobus-focuskw_text_input-help-toggle_"+s,function(e){var t=p(this);"none"===p("#focuskw_text_input-help_"+t.data("language")).css("display")?p("#focuskw_text_input-help_"+t.data("language")).css({display:"block"}):p("#focuskw_text_input-help_"+t.data("language")).css({display:"none"})})),"pageanalysis-help-toggle"==t&&(a.addClass("wpglobus-pageanalysis-help-toggle_"+s),p(document).on("click",".wpglobus-pageanalysis-help-toggle_"+s,function(e){var t=p(this);"none"===p("#pageanalysis-help_"+t.data("language")).css("display")?p("#pageanalysis-help_"+t.data("language")).css({display:"block"}):p("#pageanalysis-help_"+t.data("language")).css({display:"none"})})),"snippet_preview"==t&&(WPGlobusYoastSeoPremium||a.css({"margin-bottom":"20px"})),"wpseo-focuskeyword-section"==t&&(WPGlobusYoastSeoPremium||a.css({"margin-bottom":"20px"})),"wpseo-pageanalysis-section"==t&&(WPGlobusYoastSeoPremium?a.css({overflow:"overlay"}):a.css({height:"inherit"})),"wpseometakeywords"==t&&(a.css({"margin-bottom":"2em"}),a.addClass("wpglobus-wpseometakeywords")),"yoast_wpseo_metakeywords"==t&&(a.addClass("wpglobus-metakeywords"),p('input[name="yoast_wpseo_metakeywords_'+s+'"]').val(WPGlobusCore.TextFilter(p("#yoast_wpseo_metakeywords").val(),s,"RETURN_EMPTY"))),a.attr("id",t+"_"+s),p("#"+t+"_"+s).attr("data-language",s)});var i=WPGlobusCore.TextFilter(p("#yoast_wpseo_focuskw_text_input").val(),s,"RETURN_EMPTY");p("#yoast_wpseo_focuskw_text_input_"+s).val(i).data("value",i),p("#yoast_wpseo_focuskw_"+s).val(i),WPGlobusYoastSeoPremium||p("#wpseo-metabox-tabs_"+s+" .wpseo_keyword_tab .wpseo_tablink").data("keyword",i),p("#wpseo-metabox-tabs_"+s+" .wpseo_keyword_tab").css({"min-width":"60px","min-height":"29px"}),r.updateWpseoKeyword(i,s),s!==WPGlobusCoreData.default_language&&(p("#"+o+" #yoast_wpseo_focuskw_text_input_"+s).addClass("hidden").after('<div class="wpglobus-suggest" style="font-weight:bold;">'+WPGlobusVendor.i18n.yoastseo_plus_page_analysis_access+"</div>"),p("#"+o+" #wpseo-pageanalysis_"+s).addClass("hidden").css({display:"none"})),WPGlobusYoastSeoPremium&&(s==WPGlobusCoreData.default_language||(p("#wpseo-metabox-tabs_"+s+" .wpseo_keyword_tab").removeClass("wpseo_keyword_tab").addClass("wpglobus-wpseo_keyword_tab"),p("#wpseo-meta-section-content_"+s+" .wpseo_keyword_tab_hideable").css({display:"none"}).attr("data-language",s)))}),p(".wpglobus-wpseosnippet").each(function(e,t){var a=p(t),s=a.data("language");a.find("button.snippet-editor__button.snippet-editor__edit-button").addClass(r.editSnippetButtonClass).addClass(r.editSnippetButtonClass+"_"+s).attr("data-language",s),a.find(".snippet-editor__form").addClass(r.editSnippetFormClass).addClass(r.editSnippetFormClass+"_"+s),a.find(".snippet-editor__heading-editor").addClass(r.editSnippetHeadingClass).addClass(r.editSnippetHeadingClass+"_"+s),a.find(".snippet-editor__submit").addClass(r.editSnippetSubmitClass).addClass(r.editSnippetSubmitClass+"_"+s).attr("data-language",s)}),r.iB.addClass("hidden"),r.iB.css({height:0,overflow:"hidden",display:"none"}),WPGlobusYoastSeoPremium&&p("#wpseo-meta-section-content .wpseo_keyword_tab").removeClass("wpseo_keyword_tab").addClass("wpseo_keyword_tab_original");var e=WPGlobusCore.TextFilter(p("#yoast_wpseo_focuskw_text_input").val(),WPGlobusCoreData.default_language,"RETURN_EMPTY");p("#yoast_wpseo_focuskw_text_input").val(e),p("#yoast_wpseo_focuskw").val(e),p(document).on("click",".wpglobus-wpseo-general .wpseo_tablink",function(e){e.preventDefault();var t=p(this),a=t.parents("ul").data("language"),s=t.parent("li");if(a==WPGlobusCoreData.default_language||void 0!==p(document).triggerHandler("wpglobus_yoast_analysis",{language:a}))if(s.hasClass("wpseo_generic_tab"))p("#wpseo-pageanalysis_"+a).css({display:"none"}),p("#yoast-seo-content-analysis_"+a).css({display:"block"}),p("#wpseo_content_"+a+" table tr").eq(0).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(1).css({display:"none"}),p("#yoast-seo-content-analysis_"+a+" li a").css({float:"none"}),p("#wpseosnippet_"+a).css({display:"none"}),p("#wpseofocuskeyword_"+a).css({display:"none"});else if(s.hasClass("wpseo_keyword_tab")){if(p("#wpseosnippet_"+a).css({display:""}),p("#wpseofocuskeyword_"+a).css({display:""}),WPGlobusYoastSeoPremium&&(p("#wpseo-meta-section-content_"+a+" .wpseo_keyword_tab").removeClass("active"),t.parent(".wpseo_keyword_tab").addClass("active"),p("#wpseo-pageanalysis_"+a).css({display:"block"}),p("#yoast-seo-content-analysis_"+a).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(0).css("display",""),p("#wpseo_content_"+a+" table tr").eq(1).css("display",""),p("#wpseo-metabox-tabs_"+a+" .wpseo_keyword_tab").each(function(e,t){if(p(t).hasClass("active"))return r.keywordIndex[a]=e,!1})),!WPGlobusYoastSeoPremium&&a!=WPGlobusCoreData.default_language)return p("#wpseo-pageanalysis_"+a).css({display:"block"}),p("#yoast-seo-content-analysis_"+a).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(0).css("display",""),void p("#wpseo_content_"+a+" table tr").eq(1).css("display","");var o=r.getKeywordsOrig()[r.keywordIndex[a]].keyword;YoastSEO.app.rawData.keyword=o,p("#yoast_wpseo_focuskw_text_input").val(o),p("#yoast_wpseo_focuskw_text_input_"+a).val(o),p('input[name="yoast_wpseo_focuskw"]').val(o),i.prototype.analyze(),p("#wpseo-pageanalysis_"+a).css({display:"block"}),p("#yoast-seo-content-analysis_"+a).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(0).css("display",""),p("#wpseo_content_"+a+" table tr").eq(1).css("display","")}else s.hasClass("wpglobus-wpseo_keyword_tab")&&(p("#wpseo-pageanalysis_"+a).css({display:"block"}),p("#yoast-seo-content-analysis_"+a).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(0).css("display",""),p("#wpseo_content_"+a+" table tr").eq(1).css("display",""))}),p(".wpseo-metabox-sidebar .wpseo-meta-section-link").on("click",function(e){"#wpseo-meta-section-content"==p(this).attr("href")?p("#wpglobus-wpseo-tabs").css({display:"block"}):p("#wpglobus-wpseo-tabs").css({display:"none"})}),p(document).on("click","."+r.editSnippetButtonClass,function(e){var t=p(this),a=t.data("language"),s=p("."+r.editSnippetFormClass+"_"+a),o=p("."+r.editSnippetSubmitClass+"_"+a),i=p("."+r.editSnippetHeadingClass+"_"+a);s.hasClass("snippet-editor--hidden")?(s.removeClass("snippet-editor--hidden"),i.removeClass("snippet-editor--hidden"),o.removeClass("snippet-editor--hidden")):(s.addClass("snippet-editor--hidden"),i.addClass("snippet-editor--hidden")),t.addClass("snippet-editor--hidden")}),p(document).on("click","."+r.editSnippetSubmitClass,function(e){var t=p(this).data("language"),a=p("."+r.editSnippetButtonClass+"_"+t),s=p("."+r.editSnippetFormClass+"_"+t),o=p("."+r.editSnippetSubmitClass+"_"+t),i=p("."+r.editSnippetHeadingClass+"_"+t);a.removeClass("snippet-editor--hidden"),s.addClass("snippet-editor--hidden"),o.addClass("snippet-editor--hidden"),i.addClass("snippet-editor--hidden")}),p(document).on("keyup","input.wpglobus-snippet-editor-title",function(e){var t=p(this),a=t.data("language"),s=WPGlobusCore.getString(p('input[name="yoast_wpseo_title"]').val(),t.val(),a);p("#snippet_title_"+a).html(d.replaceVariablesPlugin(t.val())),YoastSEO.app.rawData.pageTitle=s,p('input[name="yoast_wpseo_title"]').val(s),p("#snippet_title").text(s),_.debounce(r.updateProgressBar(t,a),500)}),p(document).on("keyup","input.wpglobus-snippet-editor-slug",function(e){var t=p(this),a=t.data("language");p("#snippet_cite_"+a).text(t.val()+"/"),p("#editable-post-name").text(t.val()),p("#editable-post-name-full").text(t.val())}),p(document).on("change","input.wpglobus-snippet-editor-slug",function(e){var t=p(this);p.post(ajaxurl,{action:"sample-permalink",post_id:p("#post_ID").val()||0,new_slug:t.val(),new_title:p("#title").val(),samplepermalinknonce:p("#samplepermalinknonce").val()})}),p(document).on("keyup","textarea.wpglobus-snippet-editor-meta-description",function(e){var t=p(this),a=t.data("language");p("#snippet_meta_"+a).text(t.val());var s=WPGlobusCore.getString(p("#yoast_wpseo_metadesc").val(),t.val(),t.data("language"));p("#yoast_wpseo_metadesc").val(s),p("#snippet_meta").text(s),_.debounce(r.updateProgressBar(t,a),500)}),p(document).on("click",".wpglobus-post-body-tabs-list li",function(e){var t=p(this);if(t.hasClass("wpglobus-post-tab")){p("#wpglobus-wpseo-tabs").tabs("option","active",t.data("order"));var a=p("#yoast_wpseo_focuskw_text_input_"+t.data("language")).val();YoastSEO.app.rawData.keyword=a,p("#yoast_wpseo_focuskw_text_input").val(a),p('input[name="yoast_wpseo_focuskw"]').val(a),i.prototype.analyze()}}),p(document).on("click",".wpglobus-wpseo-pageanalysis h4",function(e){p(this).next("ul").toggleClass("hidden")}),r.initAddKeywordPopup()},getKeywordsOrig:function(){return p(".wpseo_keyword_tab").map(function(e,t){return{keyword:(t=p(t).find(".wpseo_tablink")).data("keyword")+"",score:t.data("score")}}).get()}},(i=function(){this.replaceVars=wpseoReplaceVarsL10n.replace_vars,this.language=WPGlobusCoreData.default_language,this.tab=WPGlobusCoreData.default_language,this.wpseoTab=WPGlobusCoreData.default_language,this.title_template=wpseoPostScraperL10n.title_template,this.focuskw=p("#yoast_wpseo_focuskw_text_input"),this.focuskw_hidden=p('input[name="yoast_wpseo_focuskw"]'),this.focuskwKeep=!1,this.post_slug="#editable-post-name-full",YoastSEO.app.registerPlugin("wpglobusYoastSeoPlugin",{status:"ready"}),YoastSEO.app.registerModification("content",this.contentModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("title",this.titleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_title",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_meta",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_page_title",this.pageTitleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_meta_desc",this.metaDescModification,"wpglobusYoastSeoPlugin",0),i.prototype.setScoreIcon(),p(document).on("blur",".wpglobus-snippet_title",function(e){var t=p(this),a=WPGlobusCore.getString(p("#yoast_wpseo_title").val(),t.text(),t.data("language"));YoastSEO.app.rawData.pageTitle=a,p('input[name="yoast_wpseo_title"]').val(a),p("#snippet_title").text(a)}),p(document).on("blur",".wpglobus-snippet_meta",function(e){var t=p(this),a=WPGlobusCore.getString(p("#yoast_wpseo_metadesc").val(),t.text(),t.data("language"));p("#yoast_wpseo_metadesc").val(a),p("#snippet_meta").text(a)}),p(document).on("keyup",".wpglobus-yoast_wpseo_focuskw_text_input",function(e){var t=p(this),a=t.val(),s=t.data("language");d.focuskw.val(a),d.focuskw_hidden.val(a),WPGlobusYoastSeoPremium||p("#wpseo-metabox-tabs_"+s+" .wpseo_keyword_tab .wpseo_tablink").data("keyword",a),d.updateWpseoKeyword(a,s),0==WPGlobusYoastSeo.keywordIndex[s]?p("#yoast_wpseo_focuskw_text_input_"+s).data("value",a):WPGlobusYoastSeoPremium&&WPGlobusYoastSeoPremium.setFocuskeyword(s),i.prototype.analyze()}),p("#publish,#save-post").on("mouseenter",function(e){var s,o="";p(".wpglobus-yoast_wpseo_focuskw_text_input").each(function(e,t){if((s=p(this)).data("language")==WPGlobusCoreData.default_language)if(WPGlobusYoastSeoPremium){var a=WPGlobusYoastSeo.getKeywordsOrig();o=WPGlobusCore.getString(o,a[0].keyword,s.data("language"))}else o=WPGlobusCore.getString(o,s.val(),s.data("language"));else o=WPGlobusCore.getString(o,s.val(),s.data("language"))}),d.focuskw.val(o),d.focuskw_hidden.val(o)}).on("mouseleave",function(e){if(!d.focuskwKeep){d.wpseoTab=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language");p(this);d.focuskw.val(p("#yoast_wpseo_focuskw_text_input_"+d.wpseoTab).val()),d.focuskw_hidden.val(p("#yoast_wpseo_focuskw_text_input_"+d.wpseoTab).val())}}).on("click",function(e){d.focuskwKeep=!0}),p(document).on("tabsactivate",WPGlobusYoastSeo.wpseoTabSelector,function(e,t){if(d.language=t.newPanel.attr("data-language"),WPGlobusYoastSeo.wpseoTab=d.language,t.newPanel.attr("data-language")===WPGlobusCoreData.default_language){var a;if(WPGlobusYoastSeoPremium)p("#wpseo-meta-section-content_"+WPGlobusYoastSeoPremium.dLang+" .wpseo_keyword_tab").removeClass("active"),p("#wpseo-meta-section-content_"+WPGlobusYoastSeoPremium.dLang+" .wpseo_keyword_tab").eq(WPGlobusYoastSeo.keywordIndex[WPGlobusYoastSeoPremium.dLang]).addClass("active"),a=p("#yoast_wpseo_focuskw_text_input_"+WPGlobusYoastSeoPremium.dLang).val();else a=p("#yoast_wpseo_focuskw_text_input_"+WPGlobusCoreData.default_language).val();YoastSEO.app.rawData.keyword=a,d.focuskw.val(a),d.focuskw_hidden.val(a)}p("#wpseo-metabox-tabs_"+d.language+" .wpseo_keyword_tab").each(function(e,t){if(p(t).hasClass("active"))return WPGlobusYoastSeo.keywordIndex[d.language]=e,!1}),i.prototype.analyze()}),d=this}).prototype.analyze=function(){var e=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language");e==WPGlobusCoreData.default_language?YoastSEO.app.snippetPreview.data.urlPath=p("#editable-post-name-full").text():0!=p("#editable-post-name-full-"+e).length?YoastSEO.app.snippetPreview.data.urlPath=p("#editable-post-name-full-"+e).text():YoastSEO.app.snippetPreview.data.urlPath=p("#editable-post-name-full").text(),YoastSEO.app.analyzeTimer(YoastSEO.app),i.prototype.setScoreIcon()},i.prototype.setScoreIcon=function(){var s;s=setInterval(function(){var e=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language"),t=p("#wpseo-meta-section-content .wpseo_generic_tab a").data("score"),a=p("#wpseo-meta-section-content .wpseo_keyword_tab a").data("score");""!=t&&(p("#wpseo-metabox-tabs_"+e+" .wpseo_generic_tab .wpseo-score-icon").removeClass("bad ok good 100 na"),p("#wpseo-metabox-tabs_"+e+" .wpseo_generic_tab .wpseo-score-icon").addClass(t)),void 0!==a&&""!=a&&(WPGlobusYoastSeoPremium&&e!=WPGlobusYoastSeoPremium.dLang?(p("#wpseo-metabox-tabs_"+e+" .wpglobus-wpseo_keyword_tab .wpseo-score-icon").removeClass("bad ok good 100 na"),p("#wpseo-metabox-tabs_"+e+" .wpglobus-wpseo_keyword_tab .wpseo-score-icon").addClass(a)):(p("#wpseo-metabox-tabs_"+e+" .wpseo_keyword_tab .wpseo-score-icon").removeClass("bad ok good 100 na"),p("#wpseo-metabox-tabs_"+e+" .wpseo_keyword_tab .wpseo-score-icon").addClass(a))),clearInterval(s)},1500)},i.prototype.getWPseoTab=function(){return p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language")},i.prototype.citeModification=function(e){var t="#snippet_citeBase_"+e,a="#snippet_cite_"+e,s=p("#wpseo-tab-"+e).data("yoast-cite-base");!1===p("#wpseo-tab-"+e).data("cite-contenteditable")&&p(a).attr("contenteditable","false"),p(t).text(s)},i.prototype.pageTitleModification=function(e){var a,s,o,i="#snippet_title_",n="",l="";if(d.title_template==e)p.each(WPGlobusCoreData.enabled_languages,function(e,t){s=p("#snippet-editor-title_"+t).val(),o=0==s.length?d.title_template:s,n=d.replaceVariablesPlugin(o),p(i+t).text(n),t==d.getWPseoTab()&&(l=n)});else{if(a=WPGlobusCore.getTranslations(e),d.getWPseoTab()!==WPGlobusCoreData.default_language&&a[WPGlobusCoreData.default_language]==e){var t=d.getWPseoTab();return s=p("#snippet-editor-title_"+t).val(),o=0<s.length?s:d.title_template,o=d.replaceVariablesPlugin(o),p(i+t).text(o),o}p.each(WPGlobusCoreData.enabled_languages,function(e,t){n=""===a[t]?d.replaceVariablesPlugin(d.title_template):d.replaceVariablesPlugin(a[t]),t==d.getWPseoTab()&&(l=n,0!=(s=p("#snippet-editor-title_"+t).val()).length?s!=l&&(l=d.replaceVariablesPlugin(s)):l=d.replaceVariablesPlugin(d.title_template)),p(i+t).html(l)})}return l},i.prototype.metaDescModification=function(a){var e,s="#snippet_meta_",t=WPGlobusCore.getTranslations(a),o="";if(e=p("#snippet-editor-meta-description_"+d.getWPseoTab()).val(),d.getWPseoTab()!==WPGlobusCoreData.default_language&&t[WPGlobusCoreData.default_language]==a){var i=d.getWPseoTab();return d.citeModification(i),0==e.length?p(s+i).text(""):e!=a&&p(s+i).text(e),a}return p.each(WPGlobusCoreData.enabled_languages,function(e,t){p(s+t).text(WPGlobusCore.TextFilter(a,t,"RETURN_EMPTY")),d.citeModification(t)}),e==t[d.getWPseoTab()]?0==(o=t[d.getWPseoTab()]).length&&p(s+d.getWPseoTab()).text(WPGlobusCore.TextFilter(YoastSEO.app.snippetPreview.data.metaDesc,WPGlobusCoreData.default_language,"RETURN_EMPTY")):0==(o=e).length?p(s+d.getWPseoTab()).text(WPGlobusCore.TextFilter(YoastSEO.app.snippetPreview.data.metaDesc,WPGlobusCoreData.default_language,"RETURN_EMPTY")):p(s+d.getWPseoTab()).text(o),p(s+d.getWPseoTab()).text(o),o},i.prototype.snippetModification=function(e){return WPGlobusCore.TextFilter(e,d.getWPseoTab(),"RETURN_EMPTY")},i.prototype.contentModification=function(e){return d.getWPseoTab()==WPGlobusCoreData.default_language?e:p("#content_"+d.getWPseoTab()).val()},i.prototype.titleModification=function(e){return setTimeout(d.updatePageAnalysis,1e3),d.getWPseoTab()==WPGlobusCoreData.default_language?e:p("#title_"+d.getWPseoTab()).val()},i.prototype.defaultReplace=function(e){var t=YoastSEO.app.rawData.keyword;return e.replace(/%%sitedesc%%/g,this.replaceVars.sitedesc).replace(/%%sitename%%/g,WPGlobusCore.TextFilter(this.replaceVars.sitename,d.getWPseoTab())).replace(/%%term_title%%/g,this.replaceVars.term_title).replace(/%%term_description%%/g,this.replaceVars.term_description).replace(/%%category_description%%/g,this.replaceVars.category_description).replace(/%%tag_description%%/g,this.replaceVars.tag_description).replace(/%%searchphrase%%/g,this.replaceVars.searchphrase).replace(/%%date%%/g,this.replaceVars.date).replace(/%%id%%/g,this.replaceVars.id).replace(/%%page%%/g,this.replaceVars.page).replace(/%%currenttime%%/g,this.replaceVars.currenttime).replace(/%%currentdate%%/g,this.replaceVars.currentdate).replace(/%%currentday%%/g,this.replaceVars.currentday).replace(/%%currentmonth%%/g,this.replaceVars.currentmonth).replace(/%%currentyear%%/g,this.replaceVars.currentyear).replace(/%%focuskw%%/g,t)},i.prototype.replaceVariablesPlugin=function(e){return void 0!==e&&(e=this.titleReplace(e),e=this.defaultReplace(e),e=this.replaceSeparators(e)),e},i.prototype.replaceSeparators=function(e){return e.replace(/%%sep%%(\s+%%sep%%)*/g,this.replaceVars.sep)},i.prototype.titleReplace=function(e){var t="";return void 0===(t=this.language==WPGlobusCoreData.default_language?p("#title").val():p("#title_"+this.language).val())&&(t=YoastSEO.app.rawData.pageTitle),this.language!=WPGlobusCoreData.default_language&&0==t.length&&(t=p("#title").val()),e=e.replace(/%%title%%/g,t)},i.prototype.doubleSepReplace=function(e){var t=YoastSEO.app.stringHelper.addEscapeChars(this.replaceVars.sep),a=new RegExp(t+" "+t,"g");return e=e.replace(a,this.replaceVars.sep)},i.prototype.updateWpseoKeyword=function(e,t){0<p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").length&&p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").removeClass("wpseo-keyword").addClass("wpglobus-wpseo_keyword_"+t),p(".wpglobus-wpseo_keyword_"+t).text(e)},i.prototype.updatePageAnalysis=function(){_.delay(function(){p("#wpseo-pageanalysis button").each(function(e,t){"false"===p(t).attr("aria-expanded")&&p(t).click()}),p("#yoast-seo-content-analysis button").each(function(e,t){"false"===p(t).attr("aria-expanded")&&p(t).click()});var e=d.getWPseoTab();p("#wpseo-pageanalysis_"+e).html(p("#wpseo-pageanalysis").html()),p("#yoast-seo-content-analysis_"+e).html(p("#yoast-seo-content-analysis").html()),p("#yoast-seo-content-analysis_"+e+" li a").css({float:"none"});var t,a=0;p("#wpseo-pageanalysis_"+e+' ul[role="list"] li').each(function(e,t){a+=p(t).outerHeight(!0)}),t=a+170,p("#pageanalysis_"+e).css({height:t+"px"})},500)},window.WPGlobusYoastSeoPlugin=new i}});
1
+ var WPGlobusYoastSeo,WPGlobusYoastSeoPremium=!1;jQuery(document).ready(function(p){"use strict";var r;if("undefined"!=typeof wpseoReplaceVarsL10n&&("undefined"!=typeof WPGlobusCoreData&&"undefined"!=typeof WPGlobusVendor))if("edit-tags.php"==WPGlobusVendor.pagenow||"term.php"==WPGlobusVendor.pagenow){r=WPGlobusYoastSeo={editorIDs:["description"],editor:{},submitId:"",preventChangeEditor:!1,observer:null,init:function(){r.attachListeners(),_.delay(r.start,1500)},setSubmitID:function(){1==p(".edit-tag-actions .button").length&&(r.submitId=".edit-tag-actions .button"),1==p("#submit").length&&(r.submitId="#submit")},submit:function(e){"mouseenter"===e.type?p.each(r.editor,function(e,t){!r.editor[e].contentEditor||r.editor[e].contentEditor.isHidden()?p("#"+e).val(r.editor[e].content):tinymce.get(e).setContent(r.editor[e].content)}):"mouseleave"===e.type?r.preventChangeEditor||(p.each(r.editor,function(e,t){!r.editor[e].contentEditor||r.editor[e].contentEditor.isHidden()?p("#"+e).val(WPGlobusCore.TextFilter(t.content,r.getCurrentTab(),"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,r.getCurrentTab(),"RETURN_EMPTY"))}),r.preventChangeEditor=!1):"click"===e.type&&(r.preventChangeEditor=!0,"tinymce"!=getUserSetting("editor")&&setUserSetting("editor","tinymce"))},attachListeners:function(){p(".wrap").on("tabsactivate",function(e,a){p.each(r.editor,function(e,t){!r.editor[e].contentEditor||r.editor[e].contentEditor.isHidden()?p("#"+e).val(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY"))})}),r.setSubmitID(),p(document).on("mouseenter",r.submitId,r.submit).on("mouseleave",r.submitId,r.submit).on("click",r.submitId,r.submit),p(document).on("tinymce-editor-init",function(e,t){if(-1!=_.indexOf(r.editorIDs,t.id)){var a=p("#"+t.id);r.editor[t.id]={},r.editor[t.id].contentEditor=t,r.editor[t.id].content=a.val(),t.setContent(WPGlobusCore.TextFilter(r.editor[t.id].content,WPGlobusCoreData.default_language,"RETURN_EMPTY")),p("#"+t.getContainer().id).find("iframe").addClass("wpglobus-translatable"),a.removeClass("hidden"),t.on("nodechange keyup",_.debounce(r.update,500)),a.on("input keyup",_.debounce(r.update,500))}})},update:function(e){var t,a;void 0!==e.target&&("tinymce"==(t=e.target.id)&&(t=e.target.dataset.id),void 0!==r.editor[t].contentEditor&&(a=!r.editor[t].contentEditor||r.editor[t].contentEditor.isHidden()?p("#"+t).val():r.editor[t].contentEditor.getContent({format:"raw"}),r.editor[t].content=WPGlobusCore.getString(r.editor[t].content,a,r.getCurrentTab())))},getCurrentTab:function(){return p(".wpglobus-taxonomy-tabs-list .ui-tabs-active").data("language")},start:function(){p(".wpglobus-element_description").css({display:"none"})}},WPGlobusYoastSeo.init();var i=function(){p(".wrap").on("tabsactivate",function(e,t){t.newTab[0].dataset.language==WPGlobusCoreData.default_language?p("#poststuff .inside").css({display:"block"}):p("#poststuff .inside").css({display:"none"})}),p.each(["category_description","sitedesc","sitename","tag_description","term_description","term_title"],function(e,t){wpseoReplaceVarsL10n.replace_vars[t]=WPGlobusCore.TextFilter(wpseoReplaceVarsL10n.replace_vars[t],WPGlobusCoreData.default_language)}),WPGlobusYoastSeo.observer=new MutationObserver(function(e){e.forEach(function(e){if("placeholder"==e.attributeName){WPGlobusYoastSeo.observer.disconnect();var t=p("#wpseo_focuskw");""==t.val()&&t.attr("placeholder",WPGlobusCore.TextFilter(t.attr("placeholder"),WPGlobusCoreData.default_language)),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0})}})}),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0})};window.WPGlobusYoastSeoPlugin=new i}else{var d;r=WPGlobusYoastSeo={wpseoTabSelector:"#wpglobus-wpseo-tabs",url:"",attrs:p("#wpglobus-wpseo-attr"),iB:p("#wpseo-meta-section-content"),t:p("#wpseo-meta-section-content"),ids:"",names:"",wpseoTab:WPGlobusCoreData.default_language,editSnippetButtonClass:"wpglobus-snippet-editor__edit-button",editSnippetFormClass:"wpglobus-snippet-editor__form",editSnippetSubmitClass:"wpglobus-snippet-editor__submit",editSnippetHeadingClass:"wpglobus-snippet-editor__heading-editor",yoastTitleProgress:"wpglobus-yoast-title-progress",yoastMetadescProgress:"wpglobus-yoast-metadesc-progress",yoastPremium:WPGlobusVendor.vendor.WPSEO_PREMIUM,keywordIndex:{},idsSpecial:"",init:function(){p.each(WPGlobusCoreData.enabled_languages,function(e,t){r.keywordIndex[t]=0}),r.start()},initAddKeywordPopup:function(){1==p("#wpseo-add-keyword-popup").length?p(".wpseo-add-keyword").on("click",r.addKeywordPopup):WPGlobusYoastSeoPremium&&WPGlobusYoastSeoPremium.addKeywordButton()},addKeywordPopup:function(){var e=p("#wpseo-add-keyword-popup-button").text();tb_show(e,"#TB_inline?width=650&height=350&inlineId=wpseo-add-keyword-popup","group"),p("#TB_window").css({width:"680px",height:"350px"})},qtip:function(){p(".yoast_help").qtip({content:{attr:"alt"},position:{my:"bottom left",at:"top center"},style:{tip:{corner:!0},classes:"yoast-qtip qtip-rounded qtip-blue"},show:"click",hide:{fixed:!0,delay:500}})},removeClasses:function(t,e){_.each(e,function(e){t.removeClass(e)})},updateProgressBar:function(e,t){if(void 0!==e&&(void 0!==t||("undefined"!==e.data("language")&&(t=e.data("language")),void 0!==t))){var a,s,o=["snippet-editor__progress--bad","snippet-editor__progress--ok","snippet-editor__progress--good"],i="",n=0,l=!1;s=e.val().length,e.hasClass("wpglobus-snippet-editor-title")?(n=(a=p("progress."+r.yoastTitleProgress+"_"+t)).attr("max"),i=o[2],0==s?i=o[1]:n<s?(i=o[1],l=!0):0<s&&s<35&&(i=o[1])):e.hasClass("wpglobus-snippet-editor-meta-description")&&(n=(a=p("progress."+r.yoastMetadescProgress+"_"+t)).attr("max"),i=o[2],0==s?i=o[1]:n<s?(i=o[1],l=!0):0<s&&s<121&&(i=o[1])),r.removeClasses(a,o),a.attr("value",s).addClass(i),l?e.css("color","#f00"):e.css("color","#000")}},updateWpseoKeyword:function(e,t){p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").text(e)},setSpecial:function(){r.idsSpecial=WPGlobusYoastSeo.attrs.data("ids-premium-special"),r.idsSpecial=r.idsSpecial.split(","),setTimeout(function(){if(1<p(".wpseo-cornerstone-checkbox").length&&p.each(WPGlobusCoreData.enabled_languages,function(e,t){if(t==WPGlobusCoreData.default_language){var a=p("#wpseofocuskeyword input#_yst_is_cornerstone");return p(a).attr("id","_yst_is_cornerstone_origin").attr("name","_yst_is_cornerstone_origin"),p(a).addClass("wpseo-cornerstone-checkbox_origin"),!0}p("#wpseo-tab-"+t+" .wpseo-cornerstone-checkbox").remove(),p("#wpseo-tab-"+t+' label[for="_yst_is_cornerstone"]').remove()}),1<p(".wpglobus-wpseometakeywords").length){var e=p(document).triggerHandler("wpglobus_meta_keywords");if(void 0!==e&&!0===e)return;p.each(WPGlobusCoreData.enabled_languages,function(e,t){if(t==WPGlobusCoreData.default_language){var a=p("#yoast_wpseo_metakeywords");return a.attr("id","yoast_wpseo_metakeywords_origin").attr("name","yoast_wpseo_metakeywords_origin"),a.addClass("metakeywords_origin"),p("#wpseometakeywords").attr("id","wpseometakeywords_origin"),p("#yoast_wpseo_metakeywords_"+t).attr("name","yoast_wpseo_metakeywords").attr("id","yoast_wpseo_metakeywords"),p("#wpseometakeywords_"+t).attr("id","wpseometakeywords"),!0}p("#wpseo-tab-"+t+" #wpseometakeywords_"+t+" .yoast-metabox__description").remove(),p("#wpseo-tab-"+t+" #yoast_wpseo_metakeywords_"+t).remove(),p("#wpseometakeywords_"+t+" .yoast-section").append('<div class="wpglobus-suggest" style="font-weight:bold;">'+WPGlobusVendor.i18n.yoastseo_plus_meta_keywords_access+"</div>")})}},2e3)},start:function(){p(r.wpseoTabSelector).tabs(),WPGlobusYoastSeoPremium||r.setSpecial(),r.ids=r.attrs.data("ids"),r.names=r.attrs.data("names"),r.ids=r.ids+","+r.attrs.data("qtip"),r.ids=r.ids.split(","),r.names=r.names.split(","),p("#wpglobus-wpseo-tabs").insertBefore(r.iB),p(".wpseo-metabox-tabs").css({height:"26px"}),p(".wpglobus-wpseo-general").each(function(e,t){var a=p(t),s=a.data("language"),o="wpseo-meta-section-content_"+s;a.html('<div id="'+o+'" class="wpseo-meta-section wpglobus-wpseo-meta-section" style="width:100%" data-language="'+s+'">'+r.t.html()+"</div>"),p("#"+o+" .wpseo-metabox-tabs").attr("id","wpseo-metabox-tabs_"+s).attr("data-language",s),p("#"+o+" .wpseotab").attr("id","wpseo_content_"+s),p("#wpseo_content_"+s).css({float:"left"}),p("#"+o).css({display:"block"}),p("#wpseo_meta").css({overflow:"hidden"}),p("#"+o+" .snippet_container").addClass("wpglobus-snippet_container"),s!==WPGlobusCoreData.default_language&&p("#"+o+" .wpseo-add-keyword").addClass("hidden"),p.each(r.names,function(e,t){p("#"+t).attr("name",t+"_"+s)}),p.each(r.ids,function(e,t){var a=p("#"+t);"wpseosnippet"==t&&a.addClass("wpglobus-wpseosnippet"),"snippet_title"==t&&a.addClass("wpglobus-snippet_title"),"snippet_meta"==t&&a.addClass("wpglobus-snippet_meta"),"snippet_cite"==t&&a.addClass("wpglobus-snippet_cite"),"snippet_citeBase"==t&&a.addClass("wpglobus-snippet_citeBase"),"url_container"==t&&a.css({height:"16px"}),"yoast_wpseo_focuskw_text_input"==t&&(a.addClass("wpglobus-yoast_wpseo_focuskw_text_input"),a.attr("data-value",""),a.parents("div#wpseofocuskeyword").attr("id","wpseofocuskeyword_"+s),p("#wpseofocuskeyword_"+s).addClass("wpglobus-wpseofocuskeyword")),"yoast_wpseo_focuskeywords"==t&&a.addClass("wpglobus-yoast_wpseo_focuskeywords"),"wpseo-pageanalysis"==t&&a.addClass("wpglobus-wpseo-pageanalysis"),"yoast-seo-content-analysis"==t&&a.addClass("wpglobus-yoast-seo-content-analysis"),"snippet_preview"==t&&a.addClass("wpglobus-snippet_preview"),"snippet-editor-title"==t&&(a.addClass("wpglobus-snippet-editor-title"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),a.val(p("#wpseo-tab-"+s).data("wpseotitle")),a.parent("label").next("progress").addClass(r.yoastTitleProgress).addClass(r.yoastTitleProgress+"_"+s),_.debounce(r.updateProgressBar(a,s),500)),"snippet-editor-slug"==t&&(a.addClass("wpglobus-snippet-editor-slug"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),WPGlobusCoreData.default_language!=s&&a.attr("disabled","disabled")),"snippet-editor-meta-description"==t&&(a.addClass("wpglobus-snippet-editor-meta-description"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),a.val(p("#wpseo-tab-"+s).data("metadesc")),a.parent("label").next("progress").addClass(r.yoastMetadescProgress).addClass(r.yoastMetadescProgress+"_"+s),_.debounce(r.updateProgressBar(a,s),500)),"snippetpreview-help-toggle"==t&&(a.addClass("wpglobus-snippetpreview-help-toggle_"+s),p(document).on("click",".wpglobus-snippetpreview-help-toggle_"+s,function(e){var t=p(this);"none"===p("#snippetpreview-help_"+t.data("language")).css("display")?p("#snippetpreview-help_"+t.data("language")).css({display:"block"}):p("#snippetpreview-help_"+t.data("language")).css({display:"none"})})),"focuskw_text_input-help-toggle"==t&&(a.addClass("wpglobus-focuskw_text_input-help-toggle_"+s),p(document).on("click",".wpglobus-focuskw_text_input-help-toggle_"+s,function(e){var t=p(this);"none"===p("#focuskw_text_input-help_"+t.data("language")).css("display")?p("#focuskw_text_input-help_"+t.data("language")).css({display:"block"}):p("#focuskw_text_input-help_"+t.data("language")).css({display:"none"})})),"pageanalysis-help-toggle"==t&&(a.addClass("wpglobus-pageanalysis-help-toggle_"+s),p(document).on("click",".wpglobus-pageanalysis-help-toggle_"+s,function(e){var t=p(this);"none"===p("#pageanalysis-help_"+t.data("language")).css("display")?p("#pageanalysis-help_"+t.data("language")).css({display:"block"}):p("#pageanalysis-help_"+t.data("language")).css({display:"none"})})),"snippet_preview"==t&&(WPGlobusYoastSeoPremium||a.css({"margin-bottom":"20px"})),"wpseo-focuskeyword-section"==t&&(WPGlobusYoastSeoPremium||a.css({"margin-bottom":"20px"})),"wpseo-pageanalysis-section"==t&&(WPGlobusYoastSeoPremium?a.css({overflow:"overlay"}):a.css({height:"inherit"})),"wpseometakeywords"==t&&(a.css({"margin-bottom":"2em"}),a.addClass("wpglobus-wpseometakeywords")),"yoast_wpseo_metakeywords"==t&&(a.addClass("wpglobus-metakeywords"),p('input[name="yoast_wpseo_metakeywords_'+s+'"]').val(WPGlobusCore.TextFilter(p("#yoast_wpseo_metakeywords").val(),s,"RETURN_EMPTY"))),a.attr("id",t+"_"+s),p("#"+t+"_"+s).attr("data-language",s)});var i=WPGlobusCore.TextFilter(p("#yoast_wpseo_focuskw_text_input").val(),s,"RETURN_EMPTY");p("#yoast_wpseo_focuskw_text_input_"+s).val(i).data("value",i),p("#yoast_wpseo_focuskw_"+s).val(i),WPGlobusYoastSeoPremium||p("#wpseo-metabox-tabs_"+s+" .wpseo_keyword_tab .wpseo_tablink").data("keyword",i),p("#wpseo-metabox-tabs_"+s+" .wpseo_keyword_tab").css({"min-width":"60px","min-height":"29px"}),r.updateWpseoKeyword(i,s),s!==WPGlobusCoreData.default_language&&(p("#"+o+" #yoast_wpseo_focuskw_text_input_"+s).addClass("hidden").after('<div class="wpglobus-suggest" style="font-weight:bold;">'+WPGlobusVendor.i18n.yoastseo_plus_page_analysis_access+"</div>"),p("#"+o+" #wpseo-pageanalysis_"+s).addClass("hidden").css({display:"none"})),WPGlobusYoastSeoPremium&&(s==WPGlobusCoreData.default_language||(p("#wpseo-metabox-tabs_"+s+" .wpseo_keyword_tab").removeClass("wpseo_keyword_tab").addClass("wpglobus-wpseo_keyword_tab"),p("#wpseo-meta-section-content_"+s+" .wpseo_keyword_tab_hideable").css({display:"none"}).attr("data-language",s)))}),p(".wpglobus-wpseosnippet").each(function(e,t){var a=p(t),s=a.data("language");a.find("button.snippet-editor__button.snippet-editor__edit-button").addClass(r.editSnippetButtonClass).addClass(r.editSnippetButtonClass+"_"+s).attr("data-language",s),a.find(".snippet-editor__form").addClass(r.editSnippetFormClass).addClass(r.editSnippetFormClass+"_"+s),a.find(".snippet-editor__heading-editor").addClass(r.editSnippetHeadingClass).addClass(r.editSnippetHeadingClass+"_"+s),a.find(".snippet-editor__submit").addClass(r.editSnippetSubmitClass).addClass(r.editSnippetSubmitClass+"_"+s).attr("data-language",s)}),r.iB.addClass("hidden"),r.iB.css({height:0,overflow:"hidden",display:"none"}),WPGlobusYoastSeoPremium&&p("#wpseo-meta-section-content .wpseo_keyword_tab").removeClass("wpseo_keyword_tab").addClass("wpseo_keyword_tab_original");var e=WPGlobusCore.TextFilter(p("#yoast_wpseo_focuskw_text_input").val(),WPGlobusCoreData.default_language,"RETURN_EMPTY");p("#yoast_wpseo_focuskw_text_input").val(e),p("#yoast_wpseo_focuskw").val(e),p(document).on("click",".wpglobus-wpseo-general .wpseo_tablink",function(e){e.preventDefault();var t=p(this),a=t.parents("ul").data("language"),s=t.parent("li");if(a==WPGlobusCoreData.default_language||void 0!==p(document).triggerHandler("wpglobus_yoast_analysis",{language:a}))if(s.hasClass("wpseo_generic_tab"))p("#wpseo-pageanalysis_"+a).css({display:"none"}),p("#yoast-seo-content-analysis_"+a).css({display:"block"}),p("#wpseo_content_"+a+" table tr").eq(0).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(1).css({display:"none"}),p("#yoast-seo-content-analysis_"+a+" li a").css({float:"none"}),p("#wpseosnippet_"+a).css({display:"none"}),p("#wpseofocuskeyword_"+a).css({display:"none"});else if(s.hasClass("wpseo_keyword_tab")){if(p("#wpseosnippet_"+a).css({display:""}),p("#wpseofocuskeyword_"+a).css({display:""}),WPGlobusYoastSeoPremium&&(p("#wpseo-meta-section-content_"+a+" .wpseo_keyword_tab").removeClass("active"),t.parent(".wpseo_keyword_tab").addClass("active"),p("#wpseo-pageanalysis_"+a).css({display:"block"}),p("#yoast-seo-content-analysis_"+a).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(0).css("display",""),p("#wpseo_content_"+a+" table tr").eq(1).css("display",""),p("#wpseo-metabox-tabs_"+a+" .wpseo_keyword_tab").each(function(e,t){if(p(t).hasClass("active"))return r.keywordIndex[a]=e,!1})),!WPGlobusYoastSeoPremium&&a!=WPGlobusCoreData.default_language)return p("#wpseo-pageanalysis_"+a).css({display:"block"}),p("#yoast-seo-content-analysis_"+a).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(0).css("display",""),void p("#wpseo_content_"+a+" table tr").eq(1).css("display","");var o=r.getKeywordsOrig()[r.keywordIndex[a]].keyword;YoastSEO.app.rawData.keyword=o,p("#yoast_wpseo_focuskw_text_input").val(o),p("#yoast_wpseo_focuskw_text_input_"+a).val(o),p('input[name="yoast_wpseo_focuskw"]').val(o),i.prototype.analyze(),p("#wpseo-pageanalysis_"+a).css({display:"block"}),p("#yoast-seo-content-analysis_"+a).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(0).css("display",""),p("#wpseo_content_"+a+" table tr").eq(1).css("display","")}else s.hasClass("wpglobus-wpseo_keyword_tab")&&(p("#wpseo-pageanalysis_"+a).css({display:"block"}),p("#yoast-seo-content-analysis_"+a).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(0).css("display",""),p("#wpseo_content_"+a+" table tr").eq(1).css("display",""))}),p(".wpseo-metabox-sidebar .wpseo-meta-section-link").on("click",function(e){"#wpseo-meta-section-content"==p(this).attr("href")?p("#wpglobus-wpseo-tabs").css({display:"block"}):p("#wpglobus-wpseo-tabs").css({display:"none"})}),p(document).on("click","."+r.editSnippetButtonClass,function(e){var t=p(this),a=t.data("language"),s=p("."+r.editSnippetFormClass+"_"+a),o=p("."+r.editSnippetSubmitClass+"_"+a),i=p("."+r.editSnippetHeadingClass+"_"+a);s.hasClass("snippet-editor--hidden")?(s.removeClass("snippet-editor--hidden"),i.removeClass("snippet-editor--hidden"),o.removeClass("snippet-editor--hidden")):(s.addClass("snippet-editor--hidden"),i.addClass("snippet-editor--hidden")),t.addClass("snippet-editor--hidden")}),p(document).on("click","."+r.editSnippetSubmitClass,function(e){var t=p(this).data("language"),a=p("."+r.editSnippetButtonClass+"_"+t),s=p("."+r.editSnippetFormClass+"_"+t),o=p("."+r.editSnippetSubmitClass+"_"+t),i=p("."+r.editSnippetHeadingClass+"_"+t);a.removeClass("snippet-editor--hidden"),s.addClass("snippet-editor--hidden"),o.addClass("snippet-editor--hidden"),i.addClass("snippet-editor--hidden")}),p(document).on("keyup","input.wpglobus-snippet-editor-title",function(e){var t=p(this),a=t.data("language"),s=WPGlobusCore.getString(p('input[name="yoast_wpseo_title"]').val(),t.val(),a);p("#snippet_title_"+a).html(d.replaceVariablesPlugin(t.val())),YoastSEO.app.rawData.pageTitle=s,p('input[name="yoast_wpseo_title"]').val(s),p("#snippet_title").text(s),_.debounce(r.updateProgressBar(t,a),500)}),p(document).on("keyup","input.wpglobus-snippet-editor-slug",function(e){var t=p(this),a=t.data("language");p("#snippet_cite_"+a).text(t.val()+"/"),p("#editable-post-name").text(t.val()),p("#editable-post-name-full").text(t.val())}),p(document).on("change","input.wpglobus-snippet-editor-slug",function(e){var t=p(this);p.post(ajaxurl,{action:"sample-permalink",post_id:p("#post_ID").val()||0,new_slug:t.val(),new_title:p("#title").val(),samplepermalinknonce:p("#samplepermalinknonce").val()})}),p(document).on("keyup","textarea.wpglobus-snippet-editor-meta-description",function(e){var t=p(this),a=t.data("language");p("#snippet_meta_"+a).text(t.val());var s=WPGlobusCore.getString(p("#yoast_wpseo_metadesc").val(),t.val(),t.data("language"));p("#yoast_wpseo_metadesc").val(s),p("#snippet_meta").text(s),_.debounce(r.updateProgressBar(t,a),500)}),p(document).on("click",".wpglobus-post-body-tabs-list li",function(e){var t=p(this);if(t.hasClass("wpglobus-post-tab")){p("#wpglobus-wpseo-tabs").tabs("option","active",t.data("order"));var a=p("#yoast_wpseo_focuskw_text_input_"+t.data("language")).val();YoastSEO.app.rawData.keyword=a,p("#yoast_wpseo_focuskw_text_input").val(a),p('input[name="yoast_wpseo_focuskw"]').val(a),i.prototype.analyze()}}),p(document).on("click",".wpglobus-wpseo-pageanalysis h4",function(e){p(this).next("ul").toggleClass("hidden")}),r.initAddKeywordPopup()},getKeywordsOrig:function(){return p(".wpseo_keyword_tab").map(function(e,t){return{keyword:(t=p(t).find(".wpseo_tablink")).data("keyword")+"",score:t.data("score")}}).get()}},(i=function(){this.replaceVars=wpseoReplaceVarsL10n.replace_vars,this.language=WPGlobusCoreData.default_language,this.tab=WPGlobusCoreData.default_language,this.wpseoTab=WPGlobusCoreData.default_language,this.title_template=wpseoPostScraperL10n.title_template,this.focuskw=p("#yoast_wpseo_focuskw_text_input"),this.focuskw_hidden=p('input[name="yoast_wpseo_focuskw"]'),this.focuskwKeep=!1,this.post_slug="#editable-post-name-full",YoastSEO.app.registerPlugin("wpglobusYoastSeoPlugin",{status:"ready"}),YoastSEO.app.registerModification("content",this.contentModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("title",this.titleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_title",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_meta",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_page_title",this.pageTitleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_meta_desc",this.metaDescModification,"wpglobusYoastSeoPlugin",0),i.prototype.setScoreIcon(),p(document).on("blur",".wpglobus-snippet_title",function(e){var t=p(this),a=WPGlobusCore.getString(p("#yoast_wpseo_title").val(),t.text(),t.data("language"));YoastSEO.app.rawData.pageTitle=a,p('input[name="yoast_wpseo_title"]').val(a),p("#snippet_title").text(a)}),p(document).on("blur",".wpglobus-snippet_meta",function(e){var t=p(this),a=WPGlobusCore.getString(p("#yoast_wpseo_metadesc").val(),t.text(),t.data("language"));p("#yoast_wpseo_metadesc").val(a),p("#snippet_meta").text(a)}),p(document).on("keyup",".wpglobus-yoast_wpseo_focuskw_text_input",function(e){var t=p(this),a=t.val(),s=t.data("language");d.focuskw.val(a),d.focuskw_hidden.val(a),WPGlobusYoastSeoPremium||p("#wpseo-metabox-tabs_"+s+" .wpseo_keyword_tab .wpseo_tablink").data("keyword",a),d.updateWpseoKeyword(a,s),0==WPGlobusYoastSeo.keywordIndex[s]?p("#yoast_wpseo_focuskw_text_input_"+s).data("value",a):WPGlobusYoastSeoPremium&&WPGlobusYoastSeoPremium.setFocuskeyword(s),i.prototype.analyze()}),p("#publish,#save-post").on("mouseenter",function(e){var s,o="";p(".wpglobus-yoast_wpseo_focuskw_text_input").each(function(e,t){if((s=p(this)).data("language")==WPGlobusCoreData.default_language)if(WPGlobusYoastSeoPremium){var a=WPGlobusYoastSeo.getKeywordsOrig();o=WPGlobusCore.getString(o,a[0].keyword,s.data("language"))}else o=WPGlobusCore.getString(o,s.val(),s.data("language"));else o=WPGlobusCore.getString(o,s.val(),s.data("language"))}),d.focuskw.val(o),d.focuskw_hidden.val(o)}).on("mouseleave",function(e){if(!d.focuskwKeep){d.wpseoTab=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language");p(this);d.focuskw.val(p("#yoast_wpseo_focuskw_text_input_"+d.wpseoTab).val()),d.focuskw_hidden.val(p("#yoast_wpseo_focuskw_text_input_"+d.wpseoTab).val())}}).on("click",function(e){d.focuskwKeep=!0}),p(document).on("tabsactivate",WPGlobusYoastSeo.wpseoTabSelector,function(e,t){if(d.language=t.newPanel.attr("data-language"),WPGlobusYoastSeo.wpseoTab=d.language,t.newPanel.attr("data-language")===WPGlobusCoreData.default_language){var a;if(WPGlobusYoastSeoPremium)p("#wpseo-meta-section-content_"+WPGlobusYoastSeoPremium.dLang+" .wpseo_keyword_tab").removeClass("active"),p("#wpseo-meta-section-content_"+WPGlobusYoastSeoPremium.dLang+" .wpseo_keyword_tab").eq(WPGlobusYoastSeo.keywordIndex[WPGlobusYoastSeoPremium.dLang]).addClass("active"),a=p("#yoast_wpseo_focuskw_text_input_"+WPGlobusYoastSeoPremium.dLang).val();else a=p("#yoast_wpseo_focuskw_text_input_"+WPGlobusCoreData.default_language).val();YoastSEO.app.rawData.keyword=a,d.focuskw.val(a),d.focuskw_hidden.val(a)}p("#wpseo-metabox-tabs_"+d.language+" .wpseo_keyword_tab").each(function(e,t){if(p(t).hasClass("active"))return WPGlobusYoastSeo.keywordIndex[d.language]=e,!1}),i.prototype.analyze()}),d=this}).prototype.analyze=function(){var e=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language");e==WPGlobusCoreData.default_language?YoastSEO.app.snippetPreview.data.urlPath=p("#editable-post-name-full").text():0!=p("#editable-post-name-full-"+e).length?YoastSEO.app.snippetPreview.data.urlPath=p("#editable-post-name-full-"+e).text():YoastSEO.app.snippetPreview.data.urlPath=p("#editable-post-name-full").text(),YoastSEO.app.analyzeTimer(YoastSEO.app),i.prototype.setScoreIcon()},i.prototype.setScoreIcon=function(){var s;s=setInterval(function(){var e=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language"),t=p("#wpseo-meta-section-content .wpseo_generic_tab a").data("score"),a=p("#wpseo-meta-section-content .wpseo_keyword_tab a").data("score");""!=t&&(p("#wpseo-metabox-tabs_"+e+" .wpseo_generic_tab .wpseo-score-icon").removeClass("bad ok good 100 na"),p("#wpseo-metabox-tabs_"+e+" .wpseo_generic_tab .wpseo-score-icon").addClass(t)),void 0!==a&&""!=a&&(WPGlobusYoastSeoPremium&&e!=WPGlobusYoastSeoPremium.dLang?(p("#wpseo-metabox-tabs_"+e+" .wpglobus-wpseo_keyword_tab .wpseo-score-icon").removeClass("bad ok good 100 na"),p("#wpseo-metabox-tabs_"+e+" .wpglobus-wpseo_keyword_tab .wpseo-score-icon").addClass(a)):(p("#wpseo-metabox-tabs_"+e+" .wpseo_keyword_tab .wpseo-score-icon").removeClass("bad ok good 100 na"),p("#wpseo-metabox-tabs_"+e+" .wpseo_keyword_tab .wpseo-score-icon").addClass(a))),clearInterval(s)},1500)},i.prototype.getWPseoTab=function(){return p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language")},i.prototype.citeModification=function(e){var t="#snippet_citeBase_"+e,a="#snippet_cite_"+e,s=p("#wpseo-tab-"+e).data("yoast-cite-base");!1===p("#wpseo-tab-"+e).data("cite-contenteditable")&&p(a).attr("contenteditable","false"),p(t).text(s)},i.prototype.pageTitleModification=function(e){var a,s,o,i="#snippet_title_",n="",l="";if(d.title_template==e)p.each(WPGlobusCoreData.enabled_languages,function(e,t){s=p("#snippet-editor-title_"+t).val(),o=0==s.length?d.title_template:s,n=d.replaceVariablesPlugin(o),p(i+t).text(n),t==d.getWPseoTab()&&(l=n)});else{if(a=WPGlobusCore.getTranslations(e),d.getWPseoTab()!==WPGlobusCoreData.default_language&&a[WPGlobusCoreData.default_language]==e){var t=d.getWPseoTab();return s=p("#snippet-editor-title_"+t).val(),o=0<s.length?s:d.title_template,o=d.replaceVariablesPlugin(o),p(i+t).text(o),o}p.each(WPGlobusCoreData.enabled_languages,function(e,t){n=""===a[t]?d.replaceVariablesPlugin(d.title_template):d.replaceVariablesPlugin(a[t]),t==d.getWPseoTab()&&(l=n,0!=(s=p("#snippet-editor-title_"+t).val()).length?s!=l&&(l=d.replaceVariablesPlugin(s)):l=d.replaceVariablesPlugin(d.title_template)),p(i+t).html(l)})}return l},i.prototype.metaDescModification=function(a){var e,s="#snippet_meta_",t=WPGlobusCore.getTranslations(a),o="";if(e=p("#snippet-editor-meta-description_"+d.getWPseoTab()).val(),d.getWPseoTab()===WPGlobusCoreData.default_language||t[WPGlobusCoreData.default_language]!=a)return p.each(WPGlobusCoreData.enabled_languages,function(e,t){p(s+t).text(WPGlobusCore.TextFilter(a,t,"RETURN_EMPTY")),d.citeModification(t)}),e==t[d.getWPseoTab()]?0==(o=t[d.getWPseoTab()]).length&&p(s+d.getWPseoTab()).text(WPGlobusCore.TextFilter(YoastSEO.app.snippetPreview.data.metaDesc,WPGlobusCoreData.default_language,"RETURN_EMPTY")):0==(o=e).length?p(s+d.getWPseoTab()).text(WPGlobusCore.TextFilter(YoastSEO.app.snippetPreview.data.metaDesc,WPGlobusCoreData.default_language,"RETURN_EMPTY")):p(s+d.getWPseoTab()).text(o),p(s+d.getWPseoTab()).text(o),o;var i=d.getWPseoTab();return d.citeModification(i),0==e.length?p(s+i).text(""):e!=a&&p(s+i).text(e),a},i.prototype.snippetModification=function(e){return WPGlobusCore.TextFilter(e,d.getWPseoTab(),"RETURN_EMPTY")},i.prototype.contentModification=function(e){return d.getWPseoTab()==WPGlobusCoreData.default_language?e:p("#content_"+d.getWPseoTab()).val()},i.prototype.titleModification=function(e){return setTimeout(d.updatePageAnalysis,1e3),d.getWPseoTab()==WPGlobusCoreData.default_language?e:p("#title_"+d.getWPseoTab()).val()},i.prototype.defaultReplace=function(e){var t=YoastSEO.app.rawData.keyword;return e.replace(/%%sitedesc%%/g,this.replaceVars.sitedesc).replace(/%%sitename%%/g,WPGlobusCore.TextFilter(this.replaceVars.sitename,d.getWPseoTab())).replace(/%%term_title%%/g,this.replaceVars.term_title).replace(/%%term_description%%/g,this.replaceVars.term_description).replace(/%%category_description%%/g,this.replaceVars.category_description).replace(/%%tag_description%%/g,this.replaceVars.tag_description).replace(/%%searchphrase%%/g,this.replaceVars.searchphrase).replace(/%%date%%/g,this.replaceVars.date).replace(/%%id%%/g,this.replaceVars.id).replace(/%%page%%/g,this.replaceVars.page).replace(/%%currenttime%%/g,this.replaceVars.currenttime).replace(/%%currentdate%%/g,this.replaceVars.currentdate).replace(/%%currentday%%/g,this.replaceVars.currentday).replace(/%%currentmonth%%/g,this.replaceVars.currentmonth).replace(/%%currentyear%%/g,this.replaceVars.currentyear).replace(/%%focuskw%%/g,t)},i.prototype.replaceVariablesPlugin=function(e){return void 0!==e&&(e=this.titleReplace(e),e=this.defaultReplace(e),e=this.replaceSeparators(e)),e},i.prototype.replaceSeparators=function(e){return e.replace(/%%sep%%(\s+%%sep%%)*/g,this.replaceVars.sep)},i.prototype.titleReplace=function(e){var t="";return void 0===(t=this.language==WPGlobusCoreData.default_language?p("#title").val():p("#title_"+this.language).val())&&(t=YoastSEO.app.rawData.pageTitle),this.language!=WPGlobusCoreData.default_language&&0==t.length&&(t=p("#title").val()),e=e.replace(/%%title%%/g,t)},i.prototype.doubleSepReplace=function(e){var t=YoastSEO.app.stringHelper.addEscapeChars(this.replaceVars.sep),a=new RegExp(t+" "+t,"g");return e=e.replace(a,this.replaceVars.sep)},i.prototype.updateWpseoKeyword=function(e,t){0<p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").length&&p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").removeClass("wpseo-keyword").addClass("wpglobus-wpseo_keyword_"+t),p(".wpglobus-wpseo_keyword_"+t).text(e)},i.prototype.updatePageAnalysis=function(){_.delay(function(){p("#wpseo-pageanalysis button").each(function(e,t){"false"===p(t).attr("aria-expanded")&&p(t).click()}),p("#yoast-seo-content-analysis button").each(function(e,t){"false"===p(t).attr("aria-expanded")&&p(t).click()});var e=d.getWPseoTab();p("#wpseo-pageanalysis_"+e).html(p("#wpseo-pageanalysis").html()),p("#yoast-seo-content-analysis_"+e).html(p("#yoast-seo-content-analysis").html()),p("#yoast-seo-content-analysis_"+e+" li a").css({float:"none"});var t,a=0;p("#wpseo-pageanalysis_"+e+' ul[role="list"] li').each(function(e,t){a+=p(t).outerHeight(!0)}),t=a+170,p("#pageanalysis_"+e).css({height:t+"px"})},500)},window.WPGlobusYoastSeoPlugin=new i}});
includes/js/wpglobus-yoastseo-73.min.js CHANGED
@@ -1 +1 @@
1
- var WPGlobusYoastSeo,WPGlobusYoastSeoPremium=!1;jQuery(document).ready(function(p){"use strict";var r;if("undefined"!=typeof wpseoReplaceVarsL10n&&("undefined"!=typeof WPGlobusCoreData&&"undefined"!=typeof WPGlobusVendor))if("edit-tags.php"==WPGlobusVendor.pagenow||"term.php"==WPGlobusVendor.pagenow){r=WPGlobusYoastSeo={editorIDs:["description"],editor:{},submitId:"",preventChangeEditor:!1,observer:null,init:function(){r.attachListeners(),_.delay(r.start,1500)},setSubmitID:function(){1==p(".edit-tag-actions .button").length&&(r.submitId=".edit-tag-actions .button"),1==p("#submit").length&&(r.submitId="#submit")},submit:function(e){"mouseenter"===e.type?p.each(r.editor,function(e,t){!r.editor[e].contentEditor||r.editor[e].contentEditor.isHidden()?p("#"+e).val(r.editor[e].content):tinymce.get(e).setContent(r.editor[e].content)}):"mouseleave"===e.type?r.preventChangeEditor||(p.each(r.editor,function(e,t){!r.editor[e].contentEditor||r.editor[e].contentEditor.isHidden()?p("#"+e).val(WPGlobusCore.TextFilter(t.content,r.getCurrentTab(),"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,r.getCurrentTab(),"RETURN_EMPTY"))}),r.preventChangeEditor=!1):"click"===e.type&&(r.preventChangeEditor=!0,"tinymce"!=getUserSetting("editor")&&setUserSetting("editor","tinymce"))},attachListeners:function(){p(".wrap").on("tabsactivate",function(e,a){p.each(r.editor,function(e,t){!r.editor[e].contentEditor||r.editor[e].contentEditor.isHidden()?p("#"+e).val(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY"))})}),r.setSubmitID(),p(document).on("mouseenter",r.submitId,r.submit).on("mouseleave",r.submitId,r.submit).on("click",r.submitId,r.submit),p(document).on("tinymce-editor-init",function(e,t){if(-1!=_.indexOf(r.editorIDs,t.id)){var a=p("#"+t.id);r.editor[t.id]={},r.editor[t.id].contentEditor=t,r.editor[t.id].content=a.val(),t.setContent(WPGlobusCore.TextFilter(r.editor[t.id].content,WPGlobusCoreData.default_language,"RETURN_EMPTY")),p("#"+t.getContainer().id).find("iframe").addClass("wpglobus-translatable"),a.removeClass("hidden"),t.on("nodechange keyup",_.debounce(r.update,500)),a.on("input keyup",_.debounce(r.update,500))}})},update:function(e){var t,a;void 0!==e.target&&("tinymce"==(t=e.target.id)&&(t=e.target.dataset.id),void 0!==r.editor[t].contentEditor&&(a=!r.editor[t].contentEditor||r.editor[t].contentEditor.isHidden()?p("#"+t).val():r.editor[t].contentEditor.getContent({format:"raw"}),r.editor[t].content=WPGlobusCore.getString(r.editor[t].content,a,r.getCurrentTab())))},getCurrentTab:function(){return p(".wpglobus-taxonomy-tabs-list .ui-tabs-active").data("language")},start:function(){p(".wpglobus-element_description").css({display:"none"})}},WPGlobusYoastSeo.init();var n=function(){p(".wrap").on("tabsactivate",function(e,t){t.newTab[0].dataset.language==WPGlobusCoreData.default_language?p("#poststuff .inside").css({display:"block"}):p("#poststuff .inside").css({display:"none"})}),p.each(["category_description","sitedesc","sitename","tag_description","term_description","term_title"],function(e,t){wpseoReplaceVarsL10n.replace_vars[t]=WPGlobusCore.TextFilter(wpseoReplaceVarsL10n.replace_vars[t],WPGlobusCoreData.default_language)}),WPGlobusYoastSeo.observer=new MutationObserver(function(e){e.forEach(function(e){if("placeholder"==e.attributeName){WPGlobusYoastSeo.observer.disconnect();var t=p("#wpseo_focuskw");""==t.val()&&t.attr("placeholder",WPGlobusCore.TextFilter(t.attr("placeholder"),WPGlobusCoreData.default_language)),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0})}})}),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0})};window.WPGlobusYoastSeoPlugin=new n}else{var d;r=WPGlobusYoastSeo={wpseoTabSelector:"#wpglobus-wpseo-tabs",url:"",attrs:p("#wpglobus-wpseo-attr"),iB:p("#wpseo-meta-section-content"),t:p("#wpseo-meta-section-content"),ids:"",names:"",wpseoTab:WPGlobusCoreData.default_language,editSnippetButtonClass:"wpglobus-snippet-editor__edit-button",editSnippetFormClass:"wpglobus-snippet-editor__form",editSnippetSubmitClass:"wpglobus-snippet-editor__submit",editSnippetHeadingClass:"wpglobus-snippet-editor__heading-editor",yoastTitleProgress:"wpglobus-yoast-title-progress",yoastMetadescProgress:"wpglobus-yoast-metadesc-progress",yoastPremium:WPGlobusVendor.vendor.WPSEO_PREMIUM,keywordIndex:{},idsSpecial:"",init:function(){p.each(WPGlobusCoreData.enabled_languages,function(e,t){r.keywordIndex[t]=0}),r.start()},initAddKeywordPopup:function(){1==p("#wpseo-add-keyword-popup").length?p(".wpseo-add-keyword").on("click",r.addKeywordPopup):WPGlobusYoastSeoPremium&&WPGlobusYoastSeoPremium.addKeywordButton()},addKeywordPopup:function(){var e=p("#wpseo-add-keyword-popup-button").text();tb_show(e,"#TB_inline?width=650&height=350&inlineId=wpseo-add-keyword-popup","group"),p("#TB_window").css({width:"680px",height:"350px"})},qtip:function(){p(".yoast_help").qtip({content:{attr:"alt"},position:{my:"bottom left",at:"top center"},style:{tip:{corner:!0},classes:"yoast-qtip qtip-rounded qtip-blue"},show:"click",hide:{fixed:!0,delay:500}})},removeClasses:function(t,e){_.each(e,function(e){t.removeClass(e)})},updateProgressBar:function(e,t){if(void 0!==e&&(void 0!==t||("undefined"!==e.data("language")&&(t=e.data("language")),void 0!==t))){var a,s,o=["snippet-editor__progress--bad","snippet-editor__progress--ok","snippet-editor__progress--good"],n="",i=0,l=!1;s=e.val().length,e.hasClass("wpglobus-snippet-editor-title")?(i=(a=p("progress."+r.yoastTitleProgress+"_"+t)).attr("max"),n=o[2],0==s?n=o[1]:i<s?(n=o[1],l=!0):0<s&&s<35&&(n=o[1])):e.hasClass("wpglobus-snippet-editor-meta-description")&&(i=(a=p("progress."+r.yoastMetadescProgress+"_"+t)).attr("max"),n=o[2],0==s?n=o[1]:i<s?(n=o[1],l=!0):0<s&&s<121&&(n=o[1])),r.removeClasses(a,o),a.attr("value",s).addClass(n),l?e.css("color","#f00"):e.css("color","#000")}},updateWpseoKeyword:function(e,t){p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").text(e)},setSpecial:function(){r.idsSpecial=WPGlobusYoastSeo.attrs.data("ids-premium-special"),r.idsSpecial=r.idsSpecial.split(","),setTimeout(function(){if(1<p(".wpseo-cornerstone-checkbox").length&&p.each(WPGlobusCoreData.enabled_languages,function(e,t){if(t==WPGlobusCoreData.default_language){var a=p("#wpseofocuskeyword input#_yst_is_cornerstone");return p(a).attr("id","_yst_is_cornerstone_origin").attr("name","_yst_is_cornerstone_origin"),p(a).addClass("wpseo-cornerstone-checkbox_origin"),!0}p("#wpseo-tab-"+t+" .wpseo-cornerstone-checkbox").remove(),p("#wpseo-tab-"+t+' label[for="_yst_is_cornerstone"]').remove()}),1<p(".wpglobus-wpseometakeywords").length){var e=p(document).triggerHandler("wpglobus_meta_keywords");if(void 0!==e&&!0===e)return;p.each(WPGlobusCoreData.enabled_languages,function(e,t){if(t==WPGlobusCoreData.default_language){var a=p("#yoast_wpseo_metakeywords");return a.attr("id","yoast_wpseo_metakeywords_origin").attr("name","yoast_wpseo_metakeywords_origin"),a.addClass("metakeywords_origin"),p("#wpseometakeywords").attr("id","wpseometakeywords_origin"),p("#yoast_wpseo_metakeywords_"+t).attr("name","yoast_wpseo_metakeywords").attr("id","yoast_wpseo_metakeywords"),p("#wpseometakeywords_"+t).attr("id","wpseometakeywords"),!0}p("#wpseo-tab-"+t+" #wpseometakeywords_"+t+" .yoast-metabox__description").remove(),p("#wpseo-tab-"+t+" #yoast_wpseo_metakeywords_"+t).remove(),p("#wpseometakeywords_"+t+" .yoast-section").append('<div class="wpglobus-suggest" style="font-weight:bold;">'+WPGlobusVendor.i18n.yoastseo_plus_meta_keywords_access+"</div>")})}},2e3)},start:function(){p(r.wpseoTabSelector).tabs(),WPGlobusYoastSeoPremium||r.setSpecial(),r.ids=r.attrs.data("ids"),r.names=r.attrs.data("names"),r.ids=r.ids+","+r.attrs.data("qtip"),r.ids=r.ids.split(","),r.names=r.names.split(","),p("#wpglobus-wpseo-tabs").insertBefore(r.iB),p(".wpseo-metabox-tabs").css({height:"26px"}),p(".wpglobus-wpseo-general").each(function(e,t){var a=p(t),s=a.data("language"),o="wpseo-meta-section-content_"+s;a.html('<div id="'+o+'" class="wpseo-meta-section wpglobus-wpseo-meta-section" style="width:100%" data-language="'+s+'">'+r.t.html()+"</div>"),p("#"+o+" .wpseo-metabox-tabs").attr("id","wpseo-metabox-tabs_"+s).attr("data-language",s),p("#"+o+" .wpseotab").attr("id","wpseo_content_"+s),p("#wpseo_content_"+s).css({float:"left"}),p("#"+o).css({display:"block"}),p("#wpseo_meta").css({overflow:"hidden"}),p("#"+o+" .snippet_container").addClass("wpglobus-snippet_container"),s!==WPGlobusCoreData.default_language&&p("#"+o+" .wpseo-add-keyword").addClass("hidden"),p.each(r.names,function(e,t){p("#"+t).attr("name",t+"_"+s)}),p.each(r.ids,function(e,t){var a=p("#"+t);"wpseosnippet"==t&&a.addClass("wpglobus-wpseosnippet"),"snippet_title"==t&&a.addClass("wpglobus-snippet_title"),"snippet_meta"==t&&a.addClass("wpglobus-snippet_meta"),"snippet_cite"==t&&a.addClass("wpglobus-snippet_cite"),"snippet_citeBase"==t&&a.addClass("wpglobus-snippet_citeBase"),"url_container"==t&&a.css({height:"16px"}),"yoast_wpseo_focuskw_text_input"==t&&(a.addClass("wpglobus-yoast_wpseo_focuskw_text_input"),a.attr("data-value",""),a.parents("div#wpseofocuskeyword").attr("id","wpseofocuskeyword_"+s),p("#wpseofocuskeyword_"+s).addClass("wpglobus-wpseofocuskeyword")),"yoast_wpseo_focuskeywords"==t&&a.addClass("wpglobus-yoast_wpseo_focuskeywords"),"wpseo-pageanalysis"==t&&a.addClass("wpglobus-wpseo-pageanalysis"),"yoast-seo-content-analysis"==t&&a.addClass("wpglobus-yoast-seo-content-analysis"),"snippet_preview"==t&&a.addClass("wpglobus-snippet_preview"),"snippet-editor-title"==t&&(a.addClass("wpglobus-snippet-editor-title"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),a.val(p("#wpseo-tab-"+s).data("wpseotitle")),a.parent("label").next("progress").addClass(r.yoastTitleProgress).addClass(r.yoastTitleProgress+"_"+s),_.debounce(r.updateProgressBar(a,s),500)),"snippet-editor-slug"==t&&(a.addClass("wpglobus-snippet-editor-slug"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),WPGlobusCoreData.default_language!=s&&a.attr("disabled","disabled")),"snippet-editor-meta-description"==t&&(a.addClass("wpglobus-snippet-editor-meta-description"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),a.val(p("#wpseo-tab-"+s).data("metadesc")),a.parent("label").next("progress").addClass(r.yoastMetadescProgress).addClass(r.yoastMetadescProgress+"_"+s),_.debounce(r.updateProgressBar(a,s),500)),"snippetpreview-help-toggle"==t&&(a.addClass("wpglobus-snippetpreview-help-toggle_"+s),p(document).on("click",".wpglobus-snippetpreview-help-toggle_"+s,function(e){var t=p(this);"none"===p("#snippetpreview-help_"+t.data("language")).css("display")?p("#snippetpreview-help_"+t.data("language")).css({display:"block"}):p("#snippetpreview-help_"+t.data("language")).css({display:"none"})})),"focuskw_text_input-help-toggle"==t&&(a.addClass("wpglobus-focuskw_text_input-help-toggle_"+s),p(document).on("click",".wpglobus-focuskw_text_input-help-toggle_"+s,function(e){var t=p(this);"none"===p("#focuskw_text_input-help_"+t.data("language")).css("display")?p("#focuskw_text_input-help_"+t.data("language")).css({display:"block"}):p("#focuskw_text_input-help_"+t.data("language")).css({display:"none"})})),"pageanalysis-help-toggle"==t&&(a.addClass("wpglobus-pageanalysis-help-toggle_"+s),p(document).on("click",".wpglobus-pageanalysis-help-toggle_"+s,function(e){var t=p(this);"none"===p("#pageanalysis-help_"+t.data("language")).css("display")?p("#pageanalysis-help_"+t.data("language")).css({display:"block"}):p("#pageanalysis-help_"+t.data("language")).css({display:"none"})})),"snippet_preview"==t&&(WPGlobusYoastSeoPremium||a.css({"margin-bottom":"20px"})),"wpseo-focuskeyword-section"==t&&(WPGlobusYoastSeoPremium||a.css({"margin-bottom":"20px"})),"wpseo-pageanalysis-section"==t&&(WPGlobusYoastSeoPremium?a.css({overflow:"overlay"}):a.css({height:"inherit"})),"wpseometakeywords"==t&&(a.css({"margin-bottom":"2em"}),a.addClass("wpglobus-wpseometakeywords")),"yoast_wpseo_metakeywords"==t&&(a.addClass("wpglobus-metakeywords"),p('input[name="yoast_wpseo_metakeywords_'+s+'"]').val(WPGlobusCore.TextFilter(p("#yoast_wpseo_metakeywords").val(),s,"RETURN_EMPTY"))),a.attr("id",t+"_"+s),p("#"+t+"_"+s).attr("data-language",s)});var n=WPGlobusCore.TextFilter(p("#yoast_wpseo_focuskw_text_input").val(),s,"RETURN_EMPTY");p("#yoast_wpseo_focuskw_text_input_"+s).val(n).data("value",n),p("#yoast_wpseo_focuskw_"+s).val(n),WPGlobusYoastSeoPremium||p("#wpseo-metabox-tabs_"+s+" .wpseo_keyword_tab .wpseo_tablink").data("keyword",n),p("#wpseo-metabox-tabs_"+s+" .wpseo_keyword_tab").css({"min-width":"60px","min-height":"29px"}),r.updateWpseoKeyword(n,s),s!==WPGlobusCoreData.default_language&&(p("#"+o+" #yoast_wpseo_focuskw_text_input_"+s).addClass("hidden").after('<div class="wpglobus-suggest" style="font-weight:bold;">'+WPGlobusVendor.i18n.yoastseo_plus_page_analysis_access+"</div>"),p("#"+o+" #wpseo-pageanalysis_"+s).addClass("hidden").css({display:"none"})),WPGlobusYoastSeoPremium&&(s==WPGlobusCoreData.default_language||(p("#wpseo-metabox-tabs_"+s+" .wpseo_keyword_tab").removeClass("wpseo_keyword_tab").addClass("wpglobus-wpseo_keyword_tab"),p("#wpseo-meta-section-content_"+s+" .wpseo_keyword_tab_hideable").css({display:"none"}).attr("data-language",s)))}),p(".wpglobus-wpseosnippet").each(function(e,t){var a=p(t),s=a.data("language");a.find("button.snippet-editor__button.snippet-editor__edit-button").addClass(r.editSnippetButtonClass).addClass(r.editSnippetButtonClass+"_"+s).attr("data-language",s),a.find(".snippet-editor__form").addClass(r.editSnippetFormClass).addClass(r.editSnippetFormClass+"_"+s),a.find(".snippet-editor__heading-editor").addClass(r.editSnippetHeadingClass).addClass(r.editSnippetHeadingClass+"_"+s),a.find(".snippet-editor__submit").addClass(r.editSnippetSubmitClass).addClass(r.editSnippetSubmitClass+"_"+s).attr("data-language",s)}),r.iB.addClass("hidden"),r.iB.css({height:0,overflow:"hidden",display:"none"}),WPGlobusYoastSeoPremium&&p("#wpseo-meta-section-content .wpseo_keyword_tab").removeClass("wpseo_keyword_tab").addClass("wpseo_keyword_tab_original");var e=WPGlobusCore.TextFilter(p("#yoast_wpseo_focuskw_text_input").val(),WPGlobusCoreData.default_language,"RETURN_EMPTY");p("#yoast_wpseo_focuskw_text_input").val(e),p("#yoast_wpseo_focuskw").val(e),p(document).on("click",".wpglobus-wpseo-general .wpseo_tablink",function(e){e.preventDefault();var t=p(this),a=t.parents("ul").data("language"),s=t.parent("li");if(a==WPGlobusCoreData.default_language||void 0!==p(document).triggerHandler("wpglobus_yoast_analysis",{language:a}))if(s.hasClass("wpseo_generic_tab"))p("#wpseo-meta-section-content .wpseo_generic_tab").click(),p(".wpglobus-wp-admin .wpglobus-wpseo-meta-section .wpseotab").css({width:"80%"}),1==p("#wpseo-pageanalysis").length?p("#wpseo-pageanalysis_"+a).css({display:"none"}):1==p("#pageanalysis").length&&p("#pageanalysis_"+a).css({display:"none"}),p("#yoast-seo-content-analysis_"+a).css({display:"block"}),p("#wpseo_content_"+a+" table tr").eq(0).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(1).css({display:"none"}),p("#yoast-seo-content-analysis_"+a+" li a").css({float:"none"}),p("#wpseosnippet_"+a).css({display:"none"}),p("#wpseofocuskeyword_"+a).css({display:"none"});else if(s.hasClass("wpseo_keyword_tab")){if(p("#wpseo-meta-section-content .wpseo_keyword_tab").click(),p("#wpseosnippet_"+a).css({display:""}),p("#wpseofocuskeyword_"+a).css({display:""}),WPGlobusYoastSeoPremium&&(p("#wpseo-meta-section-content_"+a+" .wpseo_keyword_tab").removeClass("active"),t.parent(".wpseo_keyword_tab").addClass("active"),1==p("#wpseo-pageanalysis").length?p("#wpseo-pageanalysis_"+a).css({display:"block"}):1==p("#pageanalysis").length&&p("#pageanalysis_"+a).css({display:"block"}),p("#yoast-seo-content-analysis_"+a).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(0).css("display",""),p("#wpseo_content_"+a+" table tr").eq(1).css("display",""),p("#wpseo-metabox-tabs_"+a+" .wpseo_keyword_tab").each(function(e,t){if(p(t).hasClass("active"))return r.keywordIndex[a]=e,!1})),!WPGlobusYoastSeoPremium&&a!=WPGlobusCoreData.default_language)return 1==p("#wpseo-pageanalysis").length?p("#wpseo-pageanalysis_"+a).css({display:"block"}):1==p("#pageanalysis").length&&p("#pageanalysis_"+a).css({display:"block"}),p("#yoast-seo-content-analysis_"+a).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(0).css("display",""),void p("#wpseo_content_"+a+" table tr").eq(1).css("display","");var o=r.getKeywordsOrig()[r.keywordIndex[a]].keyword;YoastSEO.app.rawData.keyword=o,p("#yoast_wpseo_focuskw_text_input").val(o),p("#yoast_wpseo_focuskw_text_input_"+a).val(o),p('input[name="yoast_wpseo_focuskw"]').val(o),n.prototype.analyze(),1==p("#wpseo-pageanalysis").length?p("#wpseo-pageanalysis_"+a).css({display:"block"}):1==p("#pageanalysis").length&&p("#pageanalysis_"+a).css({display:"block"}),p("#yoast-seo-content-analysis_"+a).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(0).css("display",""),p("#wpseo_content_"+a+" table tr").eq(1).css("display","")}else s.hasClass("wpglobus-wpseo_keyword_tab")&&(1==p("#wpseo-pageanalysis").length?p("#wpseo-pageanalysis_"+a).css({display:"block"}):1==p("#pageanalysis").length&&p("#pageanalysis_"+a).css({display:"block"}),p("#yoast-seo-content-analysis_"+a).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(0).css("display",""),p("#wpseo_content_"+a+" table tr").eq(1).css("display",""))}),p(".wpseo-metabox-sidebar .wpseo-meta-section-link").on("click",function(e){"#wpseo-meta-section-content"==p(this).attr("href")?p("#wpglobus-wpseo-tabs").css({display:"block"}):p("#wpglobus-wpseo-tabs").css({display:"none"})}),p(document).on("click","."+r.editSnippetButtonClass,function(e){var t=p(this),a=t.data("language"),s=p("."+r.editSnippetFormClass+"_"+a),o=p("."+r.editSnippetSubmitClass+"_"+a),n=p("."+r.editSnippetHeadingClass+"_"+a);s.hasClass("snippet-editor--hidden")?(s.removeClass("snippet-editor--hidden"),n.removeClass("snippet-editor--hidden"),o.removeClass("snippet-editor--hidden")):(s.addClass("snippet-editor--hidden"),n.addClass("snippet-editor--hidden")),t.addClass("snippet-editor--hidden")}),p(document).on("click","."+r.editSnippetSubmitClass,function(e){var t=p(this).data("language"),a=p("."+r.editSnippetButtonClass+"_"+t),s=p("."+r.editSnippetFormClass+"_"+t),o=p("."+r.editSnippetSubmitClass+"_"+t),n=p("."+r.editSnippetHeadingClass+"_"+t);a.removeClass("snippet-editor--hidden"),s.addClass("snippet-editor--hidden"),o.addClass("snippet-editor--hidden"),n.addClass("snippet-editor--hidden")}),p(document).on("keyup","input.wpglobus-snippet-editor-title",function(e){var t=p(this),a=t.data("language"),s=WPGlobusCore.getString(p('input[name="yoast_wpseo_title"]').val(),t.val(),a);p("#snippet_title_"+a).html(d.replaceVariablesPlugin(t.val())),YoastSEO.app.rawData.pageTitle=s,p('input[name="yoast_wpseo_title"]').val(s),p("#snippet_title").text(s),_.debounce(r.updateProgressBar(t,a),500)}),p(document).on("keyup","input.wpglobus-snippet-editor-slug",function(e){var t=p(this),a=t.data("language");p("#snippet_cite_"+a).text(t.val()+"/"),p("#editable-post-name").text(t.val()),p("#editable-post-name-full").text(t.val())}),p(document).on("change","input.wpglobus-snippet-editor-slug",function(e){var t=p(this);p.post(ajaxurl,{action:"sample-permalink",post_id:p("#post_ID").val()||0,new_slug:t.val(),new_title:p("#title").val(),samplepermalinknonce:p("#samplepermalinknonce").val()})}),p(document).on("keyup","textarea.wpglobus-snippet-editor-meta-description",function(e){var t=p(this),a=t.data("language");p("#snippet_meta_"+a).text(t.val());var s=WPGlobusCore.getString(p("#yoast_wpseo_metadesc").val(),t.val(),t.data("language"));p("#yoast_wpseo_metadesc").val(s),p("#snippet_meta").text(s),_.debounce(r.updateProgressBar(t,a),500)}),p(document).on("click",".wpglobus-post-body-tabs-list li",function(e){var t=p(this);if(t.hasClass("wpglobus-post-tab")){p("#wpglobus-wpseo-tabs").tabs("option","active",t.data("order"));var a=p("#yoast_wpseo_focuskw_text_input_"+t.data("language")).val();YoastSEO.app.rawData.keyword=a,p("#yoast_wpseo_focuskw_text_input").val(a),p('input[name="yoast_wpseo_focuskw"]').val(a),n.prototype.analyze()}}),p(document).on("click",".wpglobus-wpseo-pageanalysis h4",function(e){p(this).next("ul").toggleClass("hidden")}),r.initAddKeywordPopup()},getKeywordsOrig:function(){return p(".wpseo_keyword_tab").map(function(e,t){return{keyword:(t=p(t).find(".wpseo_tablink")).data("keyword")+"",score:t.data("score")}}).get()}},(n=function(){this.replaceVars=wpseoReplaceVarsL10n.replace_vars,this.language=WPGlobusCoreData.default_language,this.tab=WPGlobusCoreData.default_language,this.wpseoTab=WPGlobusCoreData.default_language,this.title_template=wpseoPostScraperL10n.title_template,this.focuskw=p("#yoast_wpseo_focuskw_text_input"),this.focuskw_hidden=p('input[name="yoast_wpseo_focuskw"]'),this.focuskwKeep=!1,this.post_slug="#editable-post-name-full",YoastSEO.app.registerPlugin("wpglobusYoastSeoPlugin",{status:"ready"}),YoastSEO.app.registerModification("content",this.contentModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("title",this.titleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_title",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_meta",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_page_title",this.pageTitleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_meta_desc",this.metaDescModification,"wpglobusYoastSeoPlugin",0),p(document).on("blur",".wpglobus-snippet_title",function(e){var t=p(this),a=WPGlobusCore.getString(p("#yoast_wpseo_title").val(),t.text(),t.data("language"));YoastSEO.app.rawData.pageTitle=a,p('input[name="yoast_wpseo_title"]').val(a),p("#snippet_title").text(a)}),p(document).on("blur",".wpglobus-snippet_meta",function(e){var t=p(this),a=WPGlobusCore.getString(p("#yoast_wpseo_metadesc").val(),t.text(),t.data("language"));p("#yoast_wpseo_metadesc").val(a),p("#snippet_meta").text(a)}),p(document).on("keyup",".wpglobus-yoast_wpseo_focuskw_text_input",function(e){var t=p(this),a=t.val(),s=t.data("language");d.focuskw.val(a),d.focuskw_hidden.val(a),WPGlobusYoastSeoPremium||p("#wpseo-metabox-tabs_"+s+" .wpseo_keyword_tab .wpseo_tablink").data("keyword",a),d.updateWpseoKeyword(a,s),0==WPGlobusYoastSeo.keywordIndex[s]?p("#yoast_wpseo_focuskw_text_input_"+s).data("value",a):WPGlobusYoastSeoPremium&&WPGlobusYoastSeoPremium.setFocuskeyword(s),n.prototype.analyze()}),p("#publish,#save-post").on("mouseenter",function(e){var s,o="";p(".wpglobus-yoast_wpseo_focuskw_text_input").each(function(e,t){if((s=p(this)).data("language")==WPGlobusCoreData.default_language)if(WPGlobusYoastSeoPremium){var a=WPGlobusYoastSeo.getKeywordsOrig();o=WPGlobusCore.getString(o,a[0].keyword,s.data("language"))}else o=WPGlobusCore.getString(o,s.val(),s.data("language"));else o=WPGlobusCore.getString(o,s.val(),s.data("language"))}),d.focuskw.val(o),d.focuskw_hidden.val(o)}).on("mouseleave",function(e){if(!d.focuskwKeep){d.wpseoTab=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language");p(this);d.focuskw.val(p("#yoast_wpseo_focuskw_text_input_"+d.wpseoTab).val()),d.focuskw_hidden.val(p("#yoast_wpseo_focuskw_text_input_"+d.wpseoTab).val())}}).on("click",function(e){d.focuskwKeep=!0}),p(document).on("tabsactivate",WPGlobusYoastSeo.wpseoTabSelector,function(e,t){if(d.language=t.newPanel.attr("data-language"),WPGlobusYoastSeo.wpseoTab=d.language,t.newPanel.attr("data-language")===WPGlobusCoreData.default_language){var a;if(WPGlobusYoastSeoPremium)p("#wpseo-meta-section-content_"+WPGlobusYoastSeoPremium.dLang+" .wpseo_keyword_tab").removeClass("active"),p("#wpseo-meta-section-content_"+WPGlobusYoastSeoPremium.dLang+" .wpseo_keyword_tab").eq(WPGlobusYoastSeo.keywordIndex[WPGlobusYoastSeoPremium.dLang]).addClass("active"),a=p("#yoast_wpseo_focuskw_text_input_"+WPGlobusYoastSeoPremium.dLang).val();else a=p("#yoast_wpseo_focuskw_text_input_"+WPGlobusCoreData.default_language).val();YoastSEO.app.rawData.keyword=a,d.focuskw.val(a),d.focuskw_hidden.val(a)}p("#wpseo-metabox-tabs_"+d.language+" .wpseo_keyword_tab").each(function(e,t){if(p(t).hasClass("active"))return WPGlobusYoastSeo.keywordIndex[d.language]=e,!1}),n.prototype.analyze()}),d=this}).prototype.analyze=function(){var e=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language");e==WPGlobusCoreData.default_language?YoastSEO.app.snippetPreview.data.urlPath=p("#editable-post-name-full").text():0!=p("#editable-post-name-full-"+e).length?YoastSEO.app.snippetPreview.data.urlPath=p("#editable-post-name-full-"+e).text():YoastSEO.app.snippetPreview.data.urlPath=p("#editable-post-name-full").text(),YoastSEO.app.analyzeTimer(YoastSEO.app)},n.prototype.setScoreIcon=function(e){var s;void 0===e&&(e=1500);s=setInterval(function(){var e=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language"),t=p("#wpseo-meta-section-content .wpseo_generic_tab a").data("score"),a=p("#wpseo-meta-section-content .wpseo_keyword_tab a").data("score");""!=t&&(p("#wpseo-metabox-tabs_"+e+" .wpseo_generic_tab .wpseo-score-icon").removeClass("bad ok good 100 na"),p("#wpseo-metabox-tabs_"+e+" .wpseo_generic_tab .wpseo-score-icon").addClass(t)),void 0!==a&&""!=a&&(WPGlobusYoastSeoPremium&&e!=WPGlobusYoastSeoPremium.dLang?(p("#wpseo-metabox-tabs_"+e+" .wpglobus-wpseo_keyword_tab .wpseo-score-icon").removeClass("bad ok good 100 na"),p("#wpseo-metabox-tabs_"+e+" .wpglobus-wpseo_keyword_tab .wpseo-score-icon").addClass(a)):(p("#wpseo-metabox-tabs_"+e+" .wpseo_keyword_tab .wpseo-score-icon").removeClass("bad ok good 100 na"),p("#wpseo-metabox-tabs_"+e+" .wpseo_keyword_tab .wpseo-score-icon").addClass(a))),clearInterval(s)},e)},n.prototype.getWPseoTab=function(){return p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language")},n.prototype.citeModification=function(e){var t="#snippet_citeBase_"+e,a="#snippet_cite_"+e,s=p("#wpseo-tab-"+e).data("yoast-cite-base");!1===p("#wpseo-tab-"+e).data("cite-contenteditable")&&p(a).attr("contenteditable","false"),p(t).text(s)},n.prototype.pageTitleModification=function(e){var a,s,o,n="#snippet_title_",i="",l="";if(d.title_template==e)p.each(WPGlobusCoreData.enabled_languages,function(e,t){s=p("#snippet-editor-title_"+t).val(),o=0==s.length?d.title_template:s,i=d.replaceVariablesPlugin(o),p(n+t).text(i),t==d.getWPseoTab()&&(l=i)});else{if(a=WPGlobusCore.getTranslations(e),d.getWPseoTab()!==WPGlobusCoreData.default_language&&a[WPGlobusCoreData.default_language]==e){var t=d.getWPseoTab();return s=p("#snippet-editor-title_"+t).val(),o=0<s.length?s:d.title_template,o=d.replaceVariablesPlugin(o),p(n+t).text(o),o}p.each(WPGlobusCoreData.enabled_languages,function(e,t){i=""===a[t]?d.replaceVariablesPlugin(d.title_template):d.replaceVariablesPlugin(a[t]),t==d.getWPseoTab()&&(l=i,0!=(s=p("#snippet-editor-title_"+t).val()).length?s!=l&&(l=d.replaceVariablesPlugin(s)):l=d.replaceVariablesPlugin(d.title_template)),p(n+t).html(l)})}return l},n.prototype.metaDescModification=function(a){var e,s="#snippet_meta_",t=WPGlobusCore.getTranslations(a),o="";if(e=p("#snippet-editor-meta-description_"+d.getWPseoTab()).val(),d.getWPseoTab()!==WPGlobusCoreData.default_language&&t[WPGlobusCoreData.default_language]==a){var n=d.getWPseoTab();return d.citeModification(n),0==e.length?p(s+n).text(""):e!=a&&p(s+n).text(e),a}return p.each(WPGlobusCoreData.enabled_languages,function(e,t){p(s+t).text(WPGlobusCore.TextFilter(a,t,"RETURN_EMPTY")),d.citeModification(t)}),e==t[d.getWPseoTab()]?0==(o=t[d.getWPseoTab()]).length&&p(s+d.getWPseoTab()).text(WPGlobusCore.TextFilter(YoastSEO.app.snippetPreview.data.metaDesc,WPGlobusCoreData.default_language,"RETURN_EMPTY")):0==(o=e).length?p(s+d.getWPseoTab()).text(WPGlobusCore.TextFilter(YoastSEO.app.snippetPreview.data.metaDesc,WPGlobusCoreData.default_language,"RETURN_EMPTY")):p(s+d.getWPseoTab()).text(o),p(s+d.getWPseoTab()).text(o),o},n.prototype.snippetModification=function(e){return WPGlobusCore.TextFilter(e,d.getWPseoTab(),"RETURN_EMPTY")},n.prototype.contentModification=function(e){return d.getWPseoTab()==WPGlobusCoreData.default_language?e:p("#content_"+d.getWPseoTab()).val()},n.prototype.titleModification=function(e){return setTimeout(d.updatePageAnalysis,1e3),d.getWPseoTab()==WPGlobusCoreData.default_language?e:p("#title_"+d.getWPseoTab()).val()},n.prototype.defaultReplace=function(e){var t=YoastSEO.app.rawData.keyword;return e.replace(/%%sitedesc%%/g,this.replaceVars.sitedesc).replace(/%%sitename%%/g,WPGlobusCore.TextFilter(this.replaceVars.sitename,d.getWPseoTab())).replace(/%%term_title%%/g,this.replaceVars.term_title).replace(/%%term_description%%/g,this.replaceVars.term_description).replace(/%%category_description%%/g,this.replaceVars.category_description).replace(/%%tag_description%%/g,this.replaceVars.tag_description).replace(/%%searchphrase%%/g,this.replaceVars.searchphrase).replace(/%%date%%/g,this.replaceVars.date).replace(/%%id%%/g,this.replaceVars.id).replace(/%%page%%/g,this.replaceVars.page).replace(/%%currenttime%%/g,this.replaceVars.currenttime).replace(/%%currentdate%%/g,this.replaceVars.currentdate).replace(/%%currentday%%/g,this.replaceVars.currentday).replace(/%%currentmonth%%/g,this.replaceVars.currentmonth).replace(/%%currentyear%%/g,this.replaceVars.currentyear).replace(/%%focuskw%%/g,t)},n.prototype.replaceVariablesPlugin=function(e){return void 0!==e&&(e=this.titleReplace(e),e=this.defaultReplace(e),e=this.replaceSeparators(e)),e},n.prototype.replaceSeparators=function(e){return e.replace(/%%sep%%(\s+%%sep%%)*/g,this.replaceVars.sep)},n.prototype.titleReplace=function(e){var t="";return void 0===(t=this.language==WPGlobusCoreData.default_language?p("#title").val():p("#title_"+this.language).val())&&(t=YoastSEO.app.rawData.pageTitle),this.language!=WPGlobusCoreData.default_language&&0==t.length&&(t=p("#title").val()),e=e.replace(/%%title%%/g,t)},n.prototype.doubleSepReplace=function(e){var t=YoastSEO.app.stringHelper.addEscapeChars(this.replaceVars.sep),a=new RegExp(t+" "+t,"g");return e=e.replace(a,this.replaceVars.sep)},n.prototype.updateWpseoKeyword=function(e,t){0<p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").length&&p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").removeClass("wpseo-keyword").addClass("wpglobus-wpseo_keyword_"+t),p(".wpglobus-wpseo_keyword_"+t).text(e)},n.prototype.updatePageAnalysis=function(){_.delay(function(){p(".wpglobus-wp-admin .wpglobus-wpseo-meta-section .wpseotab").css({width:""}),p("#wpseo-pageanalysis button").each(function(e,t){"false"===p(t).attr("aria-expanded")&&p(t).click()}),p("#yoast-seo-content-analysis button").each(function(e,t){"false"===p(t).attr("aria-expanded")&&p(t).click()});var e=d.getWPseoTab();1==p("#wpseo-pageanalysis").length?p("#wpseo-pageanalysis_"+e).html(p("#wpseo-pageanalysis").html()):1==p("#pageanalysis").length&&p("#pageanalysis_"+e).html(p("#pageanalysis").html()),p("#yoast-seo-content-analysis_"+e).html(p("#yoast-seo-content-analysis").html()),p("#yoast-seo-content-analysis_"+e+" li a").css({float:"none"});var t=0,s=0;1==p("#wpseo-pageanalysis").length?(p("#wpseo-pageanalysis_"+e+' ul[role="list"] li').each(function(e,t){s+=p(t).outerHeight(!0)}),t=s+170):1==p("#pageanalysis").length&&(p("#pageanalysis_"+e+' ul[role="list"] li').each(function(e,t){var a=p(t).outerHeight(!0);0==a&&(a=40),s+=a}),t=s+120,p("#pageanalysis_"+e+" .yoast-section").css({height:t+"px"})),p("#pageanalysis_"+e).css({height:t+"px"}),p("#pageanalysis_"+e).css({display:"block"}),n.prototype.setScoreIcon(100)},2500)},window.WPGlobusYoastSeoPlugin=new n}});
1
+ var WPGlobusYoastSeo,WPGlobusYoastSeoPremium=!1;jQuery(document).ready(function(p){"use strict";var r;if("undefined"!=typeof wpseoReplaceVarsL10n&&("undefined"!=typeof WPGlobusCoreData&&"undefined"!=typeof WPGlobusVendor))if("edit-tags.php"==WPGlobusVendor.pagenow||"term.php"==WPGlobusVendor.pagenow){r=WPGlobusYoastSeo={editorIDs:["description"],editor:{},submitId:"",preventChangeEditor:!1,observer:null,init:function(){r.attachListeners(),_.delay(r.start,1500)},setSubmitID:function(){1==p(".edit-tag-actions .button").length&&(r.submitId=".edit-tag-actions .button"),1==p("#submit").length&&(r.submitId="#submit")},submit:function(e){"mouseenter"===e.type?p.each(r.editor,function(e,t){!r.editor[e].contentEditor||r.editor[e].contentEditor.isHidden()?p("#"+e).val(r.editor[e].content):tinymce.get(e).setContent(r.editor[e].content)}):"mouseleave"===e.type?r.preventChangeEditor||(p.each(r.editor,function(e,t){!r.editor[e].contentEditor||r.editor[e].contentEditor.isHidden()?p("#"+e).val(WPGlobusCore.TextFilter(t.content,r.getCurrentTab(),"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,r.getCurrentTab(),"RETURN_EMPTY"))}),r.preventChangeEditor=!1):"click"===e.type&&(r.preventChangeEditor=!0,"tinymce"!=getUserSetting("editor")&&setUserSetting("editor","tinymce"))},attachListeners:function(){p(".wrap").on("tabsactivate",function(e,a){p.each(r.editor,function(e,t){!r.editor[e].contentEditor||r.editor[e].contentEditor.isHidden()?p("#"+e).val(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY")):tinymce.get(e).setContent(WPGlobusCore.TextFilter(t.content,a.newTab[0].dataset.language,"RETURN_EMPTY"))})}),r.setSubmitID(),p(document).on("mouseenter",r.submitId,r.submit).on("mouseleave",r.submitId,r.submit).on("click",r.submitId,r.submit),p(document).on("tinymce-editor-init",function(e,t){if(-1!=_.indexOf(r.editorIDs,t.id)){var a=p("#"+t.id);r.editor[t.id]={},r.editor[t.id].contentEditor=t,r.editor[t.id].content=a.val(),t.setContent(WPGlobusCore.TextFilter(r.editor[t.id].content,WPGlobusCoreData.default_language,"RETURN_EMPTY")),p("#"+t.getContainer().id).find("iframe").addClass("wpglobus-translatable"),a.removeClass("hidden"),t.on("nodechange keyup",_.debounce(r.update,500)),a.on("input keyup",_.debounce(r.update,500))}})},update:function(e){var t,a;void 0!==e.target&&("tinymce"==(t=e.target.id)&&(t=e.target.dataset.id),void 0!==r.editor[t].contentEditor&&(a=!r.editor[t].contentEditor||r.editor[t].contentEditor.isHidden()?p("#"+t).val():r.editor[t].contentEditor.getContent({format:"raw"}),r.editor[t].content=WPGlobusCore.getString(r.editor[t].content,a,r.getCurrentTab())))},getCurrentTab:function(){return p(".wpglobus-taxonomy-tabs-list .ui-tabs-active").data("language")},start:function(){p(".wpglobus-element_description").css({display:"none"})}},WPGlobusYoastSeo.init();var n=function(){p(".wrap").on("tabsactivate",function(e,t){t.newTab[0].dataset.language==WPGlobusCoreData.default_language?p("#poststuff .inside").css({display:"block"}):p("#poststuff .inside").css({display:"none"})}),p.each(["category_description","sitedesc","sitename","tag_description","term_description","term_title"],function(e,t){wpseoReplaceVarsL10n.replace_vars[t]=WPGlobusCore.TextFilter(wpseoReplaceVarsL10n.replace_vars[t],WPGlobusCoreData.default_language)}),WPGlobusYoastSeo.observer=new MutationObserver(function(e){e.forEach(function(e){if("placeholder"==e.attributeName){WPGlobusYoastSeo.observer.disconnect();var t=p("#wpseo_focuskw");""==t.val()&&t.attr("placeholder",WPGlobusCore.TextFilter(t.attr("placeholder"),WPGlobusCoreData.default_language)),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0})}})}),WPGlobusYoastSeo.observer.observe(document.querySelector("#wpseo_focuskw"),{attributes:!0,childList:!0,characterData:!0})};window.WPGlobusYoastSeoPlugin=new n}else{var d;r=WPGlobusYoastSeo={wpseoTabSelector:"#wpglobus-wpseo-tabs",url:"",attrs:p("#wpglobus-wpseo-attr"),iB:p("#wpseo-meta-section-content"),t:p("#wpseo-meta-section-content"),ids:"",names:"",wpseoTab:WPGlobusCoreData.default_language,editSnippetButtonClass:"wpglobus-snippet-editor__edit-button",editSnippetFormClass:"wpglobus-snippet-editor__form",editSnippetSubmitClass:"wpglobus-snippet-editor__submit",editSnippetHeadingClass:"wpglobus-snippet-editor__heading-editor",yoastTitleProgress:"wpglobus-yoast-title-progress",yoastMetadescProgress:"wpglobus-yoast-metadesc-progress",yoastPremium:WPGlobusVendor.vendor.WPSEO_PREMIUM,keywordIndex:{},idsSpecial:"",init:function(){p.each(WPGlobusCoreData.enabled_languages,function(e,t){r.keywordIndex[t]=0}),r.start()},initAddKeywordPopup:function(){1==p("#wpseo-add-keyword-popup").length?p(".wpseo-add-keyword").on("click",r.addKeywordPopup):WPGlobusYoastSeoPremium&&WPGlobusYoastSeoPremium.addKeywordButton()},addKeywordPopup:function(){var e=p("#wpseo-add-keyword-popup-button").text();tb_show(e,"#TB_inline?width=650&height=350&inlineId=wpseo-add-keyword-popup","group"),p("#TB_window").css({width:"680px",height:"350px"})},qtip:function(){p(".yoast_help").qtip({content:{attr:"alt"},position:{my:"bottom left",at:"top center"},style:{tip:{corner:!0},classes:"yoast-qtip qtip-rounded qtip-blue"},show:"click",hide:{fixed:!0,delay:500}})},removeClasses:function(t,e){_.each(e,function(e){t.removeClass(e)})},updateProgressBar:function(e,t){if(void 0!==e&&(void 0!==t||("undefined"!==e.data("language")&&(t=e.data("language")),void 0!==t))){var a,s,o=["snippet-editor__progress--bad","snippet-editor__progress--ok","snippet-editor__progress--good"],n="",i=0,l=!1;s=e.val().length,e.hasClass("wpglobus-snippet-editor-title")?(i=(a=p("progress."+r.yoastTitleProgress+"_"+t)).attr("max"),n=o[2],0==s?n=o[1]:i<s?(n=o[1],l=!0):0<s&&s<35&&(n=o[1])):e.hasClass("wpglobus-snippet-editor-meta-description")&&(i=(a=p("progress."+r.yoastMetadescProgress+"_"+t)).attr("max"),n=o[2],0==s?n=o[1]:i<s?(n=o[1],l=!0):0<s&&s<121&&(n=o[1])),r.removeClasses(a,o),a.attr("value",s).addClass(n),l?e.css("color","#f00"):e.css("color","#000")}},updateWpseoKeyword:function(e,t){p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").text(e)},setSpecial:function(){r.idsSpecial=WPGlobusYoastSeo.attrs.data("ids-premium-special"),r.idsSpecial=r.idsSpecial.split(","),setTimeout(function(){if(1<p(".wpseo-cornerstone-checkbox").length&&p.each(WPGlobusCoreData.enabled_languages,function(e,t){if(t==WPGlobusCoreData.default_language){var a=p("#wpseofocuskeyword input#_yst_is_cornerstone");return p(a).attr("id","_yst_is_cornerstone_origin").attr("name","_yst_is_cornerstone_origin"),p(a).addClass("wpseo-cornerstone-checkbox_origin"),!0}p("#wpseo-tab-"+t+" .wpseo-cornerstone-checkbox").remove(),p("#wpseo-tab-"+t+' label[for="_yst_is_cornerstone"]').remove()}),1<p(".wpglobus-wpseometakeywords").length){var e=p(document).triggerHandler("wpglobus_meta_keywords");if(void 0!==e&&!0===e)return;p.each(WPGlobusCoreData.enabled_languages,function(e,t){if(t==WPGlobusCoreData.default_language){var a=p("#yoast_wpseo_metakeywords");return a.attr("id","yoast_wpseo_metakeywords_origin").attr("name","yoast_wpseo_metakeywords_origin"),a.addClass("metakeywords_origin"),p("#wpseometakeywords").attr("id","wpseometakeywords_origin"),p("#yoast_wpseo_metakeywords_"+t).attr("name","yoast_wpseo_metakeywords").attr("id","yoast_wpseo_metakeywords"),p("#wpseometakeywords_"+t).attr("id","wpseometakeywords"),!0}p("#wpseo-tab-"+t+" #wpseometakeywords_"+t+" .yoast-metabox__description").remove(),p("#wpseo-tab-"+t+" #yoast_wpseo_metakeywords_"+t).remove(),p("#wpseometakeywords_"+t+" .yoast-section").append('<div class="wpglobus-suggest" style="font-weight:bold;">'+WPGlobusVendor.i18n.yoastseo_plus_meta_keywords_access+"</div>")})}},2e3)},start:function(){p(r.wpseoTabSelector).tabs(),WPGlobusYoastSeoPremium||r.setSpecial(),r.ids=r.attrs.data("ids"),r.names=r.attrs.data("names"),r.ids=r.ids+","+r.attrs.data("qtip"),r.ids=r.ids.split(","),r.names=r.names.split(","),p("#wpglobus-wpseo-tabs").insertBefore(r.iB),p(".wpseo-metabox-tabs").css({height:"26px"}),p(".wpglobus-wpseo-general").each(function(e,t){var a=p(t),s=a.data("language"),o="wpseo-meta-section-content_"+s;a.html('<div id="'+o+'" class="wpseo-meta-section wpglobus-wpseo-meta-section" style="width:100%" data-language="'+s+'">'+r.t.html()+"</div>"),p("#"+o+" .wpseo-metabox-tabs").attr("id","wpseo-metabox-tabs_"+s).attr("data-language",s),p("#"+o+" .wpseotab").attr("id","wpseo_content_"+s),p("#wpseo_content_"+s).css({float:"left"}),p("#"+o).css({display:"block"}),p("#wpseo_meta").css({overflow:"hidden"}),p("#"+o+" .snippet_container").addClass("wpglobus-snippet_container"),s!==WPGlobusCoreData.default_language&&p("#"+o+" .wpseo-add-keyword").addClass("hidden"),p.each(r.names,function(e,t){p("#"+t).attr("name",t+"_"+s)}),p.each(r.ids,function(e,t){var a=p("#"+t);"wpseosnippet"==t&&a.addClass("wpglobus-wpseosnippet"),"snippet_title"==t&&a.addClass("wpglobus-snippet_title"),"snippet_meta"==t&&a.addClass("wpglobus-snippet_meta"),"snippet_cite"==t&&a.addClass("wpglobus-snippet_cite"),"snippet_citeBase"==t&&a.addClass("wpglobus-snippet_citeBase"),"url_container"==t&&a.css({height:"16px"}),"yoast_wpseo_focuskw_text_input"==t&&(a.addClass("wpglobus-yoast_wpseo_focuskw_text_input"),a.attr("data-value",""),a.parents("div#wpseofocuskeyword").attr("id","wpseofocuskeyword_"+s),p("#wpseofocuskeyword_"+s).addClass("wpglobus-wpseofocuskeyword")),"yoast_wpseo_focuskeywords"==t&&a.addClass("wpglobus-yoast_wpseo_focuskeywords"),"wpseo-pageanalysis"==t&&a.addClass("wpglobus-wpseo-pageanalysis"),"yoast-seo-content-analysis"==t&&a.addClass("wpglobus-yoast-seo-content-analysis"),"snippet_preview"==t&&a.addClass("wpglobus-snippet_preview"),"snippet-editor-title"==t&&(a.addClass("wpglobus-snippet-editor-title"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),a.val(p("#wpseo-tab-"+s).data("wpseotitle")),a.parent("label").next("progress").addClass(r.yoastTitleProgress).addClass(r.yoastTitleProgress+"_"+s),_.debounce(r.updateProgressBar(a,s),500)),"snippet-editor-slug"==t&&(a.addClass("wpglobus-snippet-editor-slug"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),WPGlobusCoreData.default_language!=s&&a.attr("disabled","disabled")),"snippet-editor-meta-description"==t&&(a.addClass("wpglobus-snippet-editor-meta-description"),a.parent("label").attr("for",a.parent("label").attr("for")+"_"+s),a.val(p("#wpseo-tab-"+s).data("metadesc")),a.parent("label").next("progress").addClass(r.yoastMetadescProgress).addClass(r.yoastMetadescProgress+"_"+s),_.debounce(r.updateProgressBar(a,s),500)),"snippetpreview-help-toggle"==t&&(a.addClass("wpglobus-snippetpreview-help-toggle_"+s),p(document).on("click",".wpglobus-snippetpreview-help-toggle_"+s,function(e){var t=p(this);"none"===p("#snippetpreview-help_"+t.data("language")).css("display")?p("#snippetpreview-help_"+t.data("language")).css({display:"block"}):p("#snippetpreview-help_"+t.data("language")).css({display:"none"})})),"focuskw_text_input-help-toggle"==t&&(a.addClass("wpglobus-focuskw_text_input-help-toggle_"+s),p(document).on("click",".wpglobus-focuskw_text_input-help-toggle_"+s,function(e){var t=p(this);"none"===p("#focuskw_text_input-help_"+t.data("language")).css("display")?p("#focuskw_text_input-help_"+t.data("language")).css({display:"block"}):p("#focuskw_text_input-help_"+t.data("language")).css({display:"none"})})),"pageanalysis-help-toggle"==t&&(a.addClass("wpglobus-pageanalysis-help-toggle_"+s),p(document).on("click",".wpglobus-pageanalysis-help-toggle_"+s,function(e){var t=p(this);"none"===p("#pageanalysis-help_"+t.data("language")).css("display")?p("#pageanalysis-help_"+t.data("language")).css({display:"block"}):p("#pageanalysis-help_"+t.data("language")).css({display:"none"})})),"snippet_preview"==t&&(WPGlobusYoastSeoPremium||a.css({"margin-bottom":"20px"})),"wpseo-focuskeyword-section"==t&&(WPGlobusYoastSeoPremium||a.css({"margin-bottom":"20px"})),"wpseo-pageanalysis-section"==t&&(WPGlobusYoastSeoPremium?a.css({overflow:"overlay"}):a.css({height:"inherit"})),"wpseometakeywords"==t&&(a.css({"margin-bottom":"2em"}),a.addClass("wpglobus-wpseometakeywords")),"yoast_wpseo_metakeywords"==t&&(a.addClass("wpglobus-metakeywords"),p('input[name="yoast_wpseo_metakeywords_'+s+'"]').val(WPGlobusCore.TextFilter(p("#yoast_wpseo_metakeywords").val(),s,"RETURN_EMPTY"))),a.attr("id",t+"_"+s),p("#"+t+"_"+s).attr("data-language",s)});var n=WPGlobusCore.TextFilter(p("#yoast_wpseo_focuskw_text_input").val(),s,"RETURN_EMPTY");p("#yoast_wpseo_focuskw_text_input_"+s).val(n).data("value",n),p("#yoast_wpseo_focuskw_"+s).val(n),WPGlobusYoastSeoPremium||p("#wpseo-metabox-tabs_"+s+" .wpseo_keyword_tab .wpseo_tablink").data("keyword",n),p("#wpseo-metabox-tabs_"+s+" .wpseo_keyword_tab").css({"min-width":"60px","min-height":"29px"}),r.updateWpseoKeyword(n,s),s!==WPGlobusCoreData.default_language&&(p("#"+o+" #yoast_wpseo_focuskw_text_input_"+s).addClass("hidden").after('<div class="wpglobus-suggest" style="font-weight:bold;">'+WPGlobusVendor.i18n.yoastseo_plus_page_analysis_access+"</div>"),p("#"+o+" #wpseo-pageanalysis_"+s).addClass("hidden").css({display:"none"})),WPGlobusYoastSeoPremium&&(s==WPGlobusCoreData.default_language||(p("#wpseo-metabox-tabs_"+s+" .wpseo_keyword_tab").removeClass("wpseo_keyword_tab").addClass("wpglobus-wpseo_keyword_tab"),p("#wpseo-meta-section-content_"+s+" .wpseo_keyword_tab_hideable").css({display:"none"}).attr("data-language",s)))}),p(".wpglobus-wpseosnippet").each(function(e,t){var a=p(t),s=a.data("language");a.find("button.snippet-editor__button.snippet-editor__edit-button").addClass(r.editSnippetButtonClass).addClass(r.editSnippetButtonClass+"_"+s).attr("data-language",s),a.find(".snippet-editor__form").addClass(r.editSnippetFormClass).addClass(r.editSnippetFormClass+"_"+s),a.find(".snippet-editor__heading-editor").addClass(r.editSnippetHeadingClass).addClass(r.editSnippetHeadingClass+"_"+s),a.find(".snippet-editor__submit").addClass(r.editSnippetSubmitClass).addClass(r.editSnippetSubmitClass+"_"+s).attr("data-language",s)}),r.iB.addClass("hidden"),r.iB.css({height:0,overflow:"hidden",display:"none"}),WPGlobusYoastSeoPremium&&p("#wpseo-meta-section-content .wpseo_keyword_tab").removeClass("wpseo_keyword_tab").addClass("wpseo_keyword_tab_original");var e=WPGlobusCore.TextFilter(p("#yoast_wpseo_focuskw_text_input").val(),WPGlobusCoreData.default_language,"RETURN_EMPTY");p("#yoast_wpseo_focuskw_text_input").val(e),p("#yoast_wpseo_focuskw").val(e),p(document).on("click",".wpglobus-wpseo-general .wpseo_tablink",function(e){e.preventDefault();var t=p(this),a=t.parents("ul").data("language"),s=t.parent("li");if(a==WPGlobusCoreData.default_language||void 0!==p(document).triggerHandler("wpglobus_yoast_analysis",{language:a}))if(s.hasClass("wpseo_generic_tab"))p("#wpseo-meta-section-content .wpseo_generic_tab").click(),p(".wpglobus-wp-admin .wpglobus-wpseo-meta-section .wpseotab").css({width:"80%"}),1==p("#wpseo-pageanalysis").length?p("#wpseo-pageanalysis_"+a).css({display:"none"}):1==p("#pageanalysis").length&&p("#pageanalysis_"+a).css({display:"none"}),p("#yoast-seo-content-analysis_"+a).css({display:"block"}),p("#wpseo_content_"+a+" table tr").eq(0).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(1).css({display:"none"}),p("#yoast-seo-content-analysis_"+a+" li a").css({float:"none"}),p("#wpseosnippet_"+a).css({display:"none"}),p("#wpseofocuskeyword_"+a).css({display:"none"});else if(s.hasClass("wpseo_keyword_tab")){if(p("#wpseo-meta-section-content .wpseo_keyword_tab").click(),p("#wpseosnippet_"+a).css({display:""}),p("#wpseofocuskeyword_"+a).css({display:""}),WPGlobusYoastSeoPremium&&(p("#wpseo-meta-section-content_"+a+" .wpseo_keyword_tab").removeClass("active"),t.parent(".wpseo_keyword_tab").addClass("active"),1==p("#wpseo-pageanalysis").length?p("#wpseo-pageanalysis_"+a).css({display:"block"}):1==p("#pageanalysis").length&&p("#pageanalysis_"+a).css({display:"block"}),p("#yoast-seo-content-analysis_"+a).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(0).css("display",""),p("#wpseo_content_"+a+" table tr").eq(1).css("display",""),p("#wpseo-metabox-tabs_"+a+" .wpseo_keyword_tab").each(function(e,t){if(p(t).hasClass("active"))return r.keywordIndex[a]=e,!1})),!WPGlobusYoastSeoPremium&&a!=WPGlobusCoreData.default_language)return 1==p("#wpseo-pageanalysis").length?p("#wpseo-pageanalysis_"+a).css({display:"block"}):1==p("#pageanalysis").length&&p("#pageanalysis_"+a).css({display:"block"}),p("#yoast-seo-content-analysis_"+a).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(0).css("display",""),void p("#wpseo_content_"+a+" table tr").eq(1).css("display","");var o=r.getKeywordsOrig()[r.keywordIndex[a]].keyword;YoastSEO.app.rawData.keyword=o,p("#yoast_wpseo_focuskw_text_input").val(o),p("#yoast_wpseo_focuskw_text_input_"+a).val(o),p('input[name="yoast_wpseo_focuskw"]').val(o),n.prototype.analyze(),1==p("#wpseo-pageanalysis").length?p("#wpseo-pageanalysis_"+a).css({display:"block"}):1==p("#pageanalysis").length&&p("#pageanalysis_"+a).css({display:"block"}),p("#yoast-seo-content-analysis_"+a).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(0).css("display",""),p("#wpseo_content_"+a+" table tr").eq(1).css("display","")}else s.hasClass("wpglobus-wpseo_keyword_tab")&&(1==p("#wpseo-pageanalysis").length?p("#wpseo-pageanalysis_"+a).css({display:"block"}):1==p("#pageanalysis").length&&p("#pageanalysis_"+a).css({display:"block"}),p("#yoast-seo-content-analysis_"+a).css({display:"none"}),p("#wpseo_content_"+a+" table tr").eq(0).css("display",""),p("#wpseo_content_"+a+" table tr").eq(1).css("display",""))}),p(".wpseo-metabox-sidebar .wpseo-meta-section-link").on("click",function(e){"#wpseo-meta-section-content"==p(this).attr("href")?p("#wpglobus-wpseo-tabs").css({display:"block"}):p("#wpglobus-wpseo-tabs").css({display:"none"})}),p(document).on("click","."+r.editSnippetButtonClass,function(e){var t=p(this),a=t.data("language"),s=p("."+r.editSnippetFormClass+"_"+a),o=p("."+r.editSnippetSubmitClass+"_"+a),n=p("."+r.editSnippetHeadingClass+"_"+a);s.hasClass("snippet-editor--hidden")?(s.removeClass("snippet-editor--hidden"),n.removeClass("snippet-editor--hidden"),o.removeClass("snippet-editor--hidden")):(s.addClass("snippet-editor--hidden"),n.addClass("snippet-editor--hidden")),t.addClass("snippet-editor--hidden")}),p(document).on("click","."+r.editSnippetSubmitClass,function(e){var t=p(this).data("language"),a=p("."+r.editSnippetButtonClass+"_"+t),s=p("."+r.editSnippetFormClass+"_"+t),o=p("."+r.editSnippetSubmitClass+"_"+t),n=p("."+r.editSnippetHeadingClass+"_"+t);a.removeClass("snippet-editor--hidden"),s.addClass("snippet-editor--hidden"),o.addClass("snippet-editor--hidden"),n.addClass("snippet-editor--hidden")}),p(document).on("keyup","input.wpglobus-snippet-editor-title",function(e){var t=p(this),a=t.data("language"),s=WPGlobusCore.getString(p('input[name="yoast_wpseo_title"]').val(),t.val(),a);p("#snippet_title_"+a).html(d.replaceVariablesPlugin(t.val())),YoastSEO.app.rawData.pageTitle=s,p('input[name="yoast_wpseo_title"]').val(s),p("#snippet_title").text(s),_.debounce(r.updateProgressBar(t,a),500)}),p(document).on("keyup","input.wpglobus-snippet-editor-slug",function(e){var t=p(this),a=t.data("language");p("#snippet_cite_"+a).text(t.val()+"/"),p("#editable-post-name").text(t.val()),p("#editable-post-name-full").text(t.val())}),p(document).on("change","input.wpglobus-snippet-editor-slug",function(e){var t=p(this);p.post(ajaxurl,{action:"sample-permalink",post_id:p("#post_ID").val()||0,new_slug:t.val(),new_title:p("#title").val(),samplepermalinknonce:p("#samplepermalinknonce").val()})}),p(document).on("keyup","textarea.wpglobus-snippet-editor-meta-description",function(e){var t=p(this),a=t.data("language");p("#snippet_meta_"+a).text(t.val());var s=WPGlobusCore.getString(p("#yoast_wpseo_metadesc").val(),t.val(),t.data("language"));p("#yoast_wpseo_metadesc").val(s),p("#snippet_meta").text(s),_.debounce(r.updateProgressBar(t,a),500)}),p(document).on("click",".wpglobus-post-body-tabs-list li",function(e){var t=p(this);if(t.hasClass("wpglobus-post-tab")){p("#wpglobus-wpseo-tabs").tabs("option","active",t.data("order"));var a=p("#yoast_wpseo_focuskw_text_input_"+t.data("language")).val();YoastSEO.app.rawData.keyword=a,p("#yoast_wpseo_focuskw_text_input").val(a),p('input[name="yoast_wpseo_focuskw"]').val(a),n.prototype.analyze()}}),p(document).on("click",".wpglobus-wpseo-pageanalysis h4",function(e){p(this).next("ul").toggleClass("hidden")}),r.initAddKeywordPopup()},getKeywordsOrig:function(){return p(".wpseo_keyword_tab").map(function(e,t){return{keyword:(t=p(t).find(".wpseo_tablink")).data("keyword")+"",score:t.data("score")}}).get()}},(n=function(){this.replaceVars=wpseoReplaceVarsL10n.replace_vars,this.language=WPGlobusCoreData.default_language,this.tab=WPGlobusCoreData.default_language,this.wpseoTab=WPGlobusCoreData.default_language,this.title_template=wpseoPostScraperL10n.title_template,this.focuskw=p("#yoast_wpseo_focuskw_text_input"),this.focuskw_hidden=p('input[name="yoast_wpseo_focuskw"]'),this.focuskwKeep=!1,this.post_slug="#editable-post-name-full",YoastSEO.app.registerPlugin("wpglobusYoastSeoPlugin",{status:"ready"}),YoastSEO.app.registerModification("content",this.contentModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("title",this.titleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_title",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("snippet_meta",this.snippetModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_page_title",this.pageTitleModification,"wpglobusYoastSeoPlugin",0),YoastSEO.app.registerModification("data_meta_desc",this.metaDescModification,"wpglobusYoastSeoPlugin",0),p(document).on("blur",".wpglobus-snippet_title",function(e){var t=p(this),a=WPGlobusCore.getString(p("#yoast_wpseo_title").val(),t.text(),t.data("language"));YoastSEO.app.rawData.pageTitle=a,p('input[name="yoast_wpseo_title"]').val(a),p("#snippet_title").text(a)}),p(document).on("blur",".wpglobus-snippet_meta",function(e){var t=p(this),a=WPGlobusCore.getString(p("#yoast_wpseo_metadesc").val(),t.text(),t.data("language"));p("#yoast_wpseo_metadesc").val(a),p("#snippet_meta").text(a)}),p(document).on("keyup",".wpglobus-yoast_wpseo_focuskw_text_input",function(e){var t=p(this),a=t.val(),s=t.data("language");d.focuskw.val(a),d.focuskw_hidden.val(a),WPGlobusYoastSeoPremium||p("#wpseo-metabox-tabs_"+s+" .wpseo_keyword_tab .wpseo_tablink").data("keyword",a),d.updateWpseoKeyword(a,s),0==WPGlobusYoastSeo.keywordIndex[s]?p("#yoast_wpseo_focuskw_text_input_"+s).data("value",a):WPGlobusYoastSeoPremium&&WPGlobusYoastSeoPremium.setFocuskeyword(s),n.prototype.analyze()}),p("#publish,#save-post").on("mouseenter",function(e){var s,o="";p(".wpglobus-yoast_wpseo_focuskw_text_input").each(function(e,t){if((s=p(this)).data("language")==WPGlobusCoreData.default_language)if(WPGlobusYoastSeoPremium){var a=WPGlobusYoastSeo.getKeywordsOrig();o=WPGlobusCore.getString(o,a[0].keyword,s.data("language"))}else o=WPGlobusCore.getString(o,s.val(),s.data("language"));else o=WPGlobusCore.getString(o,s.val(),s.data("language"))}),d.focuskw.val(o),d.focuskw_hidden.val(o)}).on("mouseleave",function(e){if(!d.focuskwKeep){d.wpseoTab=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language");p(this);d.focuskw.val(p("#yoast_wpseo_focuskw_text_input_"+d.wpseoTab).val()),d.focuskw_hidden.val(p("#yoast_wpseo_focuskw_text_input_"+d.wpseoTab).val())}}).on("click",function(e){d.focuskwKeep=!0}),p(document).on("tabsactivate",WPGlobusYoastSeo.wpseoTabSelector,function(e,t){if(d.language=t.newPanel.attr("data-language"),WPGlobusYoastSeo.wpseoTab=d.language,t.newPanel.attr("data-language")===WPGlobusCoreData.default_language){var a;if(WPGlobusYoastSeoPremium)p("#wpseo-meta-section-content_"+WPGlobusYoastSeoPremium.dLang+" .wpseo_keyword_tab").removeClass("active"),p("#wpseo-meta-section-content_"+WPGlobusYoastSeoPremium.dLang+" .wpseo_keyword_tab").eq(WPGlobusYoastSeo.keywordIndex[WPGlobusYoastSeoPremium.dLang]).addClass("active"),a=p("#yoast_wpseo_focuskw_text_input_"+WPGlobusYoastSeoPremium.dLang).val();else a=p("#yoast_wpseo_focuskw_text_input_"+WPGlobusCoreData.default_language).val();YoastSEO.app.rawData.keyword=a,d.focuskw.val(a),d.focuskw_hidden.val(a)}p("#wpseo-metabox-tabs_"+d.language+" .wpseo_keyword_tab").each(function(e,t){if(p(t).hasClass("active"))return WPGlobusYoastSeo.keywordIndex[d.language]=e,!1}),n.prototype.analyze()}),d=this}).prototype.analyze=function(){var e=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language");e==WPGlobusCoreData.default_language?YoastSEO.app.snippetPreview.data.urlPath=p("#editable-post-name-full").text():0!=p("#editable-post-name-full-"+e).length?YoastSEO.app.snippetPreview.data.urlPath=p("#editable-post-name-full-"+e).text():YoastSEO.app.snippetPreview.data.urlPath=p("#editable-post-name-full").text(),YoastSEO.app.analyzeTimer(YoastSEO.app)},n.prototype.setScoreIcon=function(e){var s;void 0===e&&(e=1500);s=setInterval(function(){var e=p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language"),t=p("#wpseo-meta-section-content .wpseo_generic_tab a").data("score"),a=p("#wpseo-meta-section-content .wpseo_keyword_tab a").data("score");""!=t&&(p("#wpseo-metabox-tabs_"+e+" .wpseo_generic_tab .wpseo-score-icon").removeClass("bad ok good 100 na"),p("#wpseo-metabox-tabs_"+e+" .wpseo_generic_tab .wpseo-score-icon").addClass(t)),void 0!==a&&""!=a&&(WPGlobusYoastSeoPremium&&e!=WPGlobusYoastSeoPremium.dLang?(p("#wpseo-metabox-tabs_"+e+" .wpglobus-wpseo_keyword_tab .wpseo-score-icon").removeClass("bad ok good 100 na"),p("#wpseo-metabox-tabs_"+e+" .wpglobus-wpseo_keyword_tab .wpseo-score-icon").addClass(a)):(p("#wpseo-metabox-tabs_"+e+" .wpseo_keyword_tab .wpseo-score-icon").removeClass("bad ok good 100 na"),p("#wpseo-metabox-tabs_"+e+" .wpseo_keyword_tab .wpseo-score-icon").addClass(a))),clearInterval(s)},e)},n.prototype.getWPseoTab=function(){return p(".wpglobus-wpseo-tabs-list .ui-tabs-active").data("language")},n.prototype.citeModification=function(e){var t="#snippet_citeBase_"+e,a="#snippet_cite_"+e,s=p("#wpseo-tab-"+e).data("yoast-cite-base");!1===p("#wpseo-tab-"+e).data("cite-contenteditable")&&p(a).attr("contenteditable","false"),p(t).text(s)},n.prototype.pageTitleModification=function(e){var a,s,o,n="#snippet_title_",i="",l="";if(d.title_template==e)p.each(WPGlobusCoreData.enabled_languages,function(e,t){s=p("#snippet-editor-title_"+t).val(),o=0==s.length?d.title_template:s,i=d.replaceVariablesPlugin(o),p(n+t).text(i),t==d.getWPseoTab()&&(l=i)});else{if(a=WPGlobusCore.getTranslations(e),d.getWPseoTab()!==WPGlobusCoreData.default_language&&a[WPGlobusCoreData.default_language]==e){var t=d.getWPseoTab();return s=p("#snippet-editor-title_"+t).val(),o=0<s.length?s:d.title_template,o=d.replaceVariablesPlugin(o),p(n+t).text(o),o}p.each(WPGlobusCoreData.enabled_languages,function(e,t){i=""===a[t]?d.replaceVariablesPlugin(d.title_template):d.replaceVariablesPlugin(a[t]),t==d.getWPseoTab()&&(l=i,0!=(s=p("#snippet-editor-title_"+t).val()).length?s!=l&&(l=d.replaceVariablesPlugin(s)):l=d.replaceVariablesPlugin(d.title_template)),p(n+t).html(l)})}return l},n.prototype.metaDescModification=function(a){var e,s="#snippet_meta_",t=WPGlobusCore.getTranslations(a),o="";if(e=p("#snippet-editor-meta-description_"+d.getWPseoTab()).val(),d.getWPseoTab()===WPGlobusCoreData.default_language||t[WPGlobusCoreData.default_language]!=a)return p.each(WPGlobusCoreData.enabled_languages,function(e,t){p(s+t).text(WPGlobusCore.TextFilter(a,t,"RETURN_EMPTY")),d.citeModification(t)}),e==t[d.getWPseoTab()]?0==(o=t[d.getWPseoTab()]).length&&p(s+d.getWPseoTab()).text(WPGlobusCore.TextFilter(YoastSEO.app.snippetPreview.data.metaDesc,WPGlobusCoreData.default_language,"RETURN_EMPTY")):0==(o=e).length?p(s+d.getWPseoTab()).text(WPGlobusCore.TextFilter(YoastSEO.app.snippetPreview.data.metaDesc,WPGlobusCoreData.default_language,"RETURN_EMPTY")):p(s+d.getWPseoTab()).text(o),p(s+d.getWPseoTab()).text(o),o;var n=d.getWPseoTab();return d.citeModification(n),0==e.length?p(s+n).text(""):e!=a&&p(s+n).text(e),a},n.prototype.snippetModification=function(e){return WPGlobusCore.TextFilter(e,d.getWPseoTab(),"RETURN_EMPTY")},n.prototype.contentModification=function(e){return d.getWPseoTab()==WPGlobusCoreData.default_language?e:p("#content_"+d.getWPseoTab()).val()},n.prototype.titleModification=function(e){return setTimeout(d.updatePageAnalysis,1e3),d.getWPseoTab()==WPGlobusCoreData.default_language?e:p("#title_"+d.getWPseoTab()).val()},n.prototype.defaultReplace=function(e){var t=YoastSEO.app.rawData.keyword;return e.replace(/%%sitedesc%%/g,this.replaceVars.sitedesc).replace(/%%sitename%%/g,WPGlobusCore.TextFilter(this.replaceVars.sitename,d.getWPseoTab())).replace(/%%term_title%%/g,this.replaceVars.term_title).replace(/%%term_description%%/g,this.replaceVars.term_description).replace(/%%category_description%%/g,this.replaceVars.category_description).replace(/%%tag_description%%/g,this.replaceVars.tag_description).replace(/%%searchphrase%%/g,this.replaceVars.searchphrase).replace(/%%date%%/g,this.replaceVars.date).replace(/%%id%%/g,this.replaceVars.id).replace(/%%page%%/g,this.replaceVars.page).replace(/%%currenttime%%/g,this.replaceVars.currenttime).replace(/%%currentdate%%/g,this.replaceVars.currentdate).replace(/%%currentday%%/g,this.replaceVars.currentday).replace(/%%currentmonth%%/g,this.replaceVars.currentmonth).replace(/%%currentyear%%/g,this.replaceVars.currentyear).replace(/%%focuskw%%/g,t)},n.prototype.replaceVariablesPlugin=function(e){return void 0!==e&&(e=this.titleReplace(e),e=this.defaultReplace(e),e=this.replaceSeparators(e)),e},n.prototype.replaceSeparators=function(e){return e.replace(/%%sep%%(\s+%%sep%%)*/g,this.replaceVars.sep)},n.prototype.titleReplace=function(e){var t="";return void 0===(t=this.language==WPGlobusCoreData.default_language?p("#title").val():p("#title_"+this.language).val())&&(t=YoastSEO.app.rawData.pageTitle),this.language!=WPGlobusCoreData.default_language&&0==t.length&&(t=p("#title").val()),e=e.replace(/%%title%%/g,t)},n.prototype.doubleSepReplace=function(e){var t=YoastSEO.app.stringHelper.addEscapeChars(this.replaceVars.sep),a=new RegExp(t+" "+t,"g");return e=e.replace(a,this.replaceVars.sep)},n.prototype.updateWpseoKeyword=function(e,t){0<p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").length&&p("#wpseo-meta-section-content_"+t+" .wpseo-keyword").removeClass("wpseo-keyword").addClass("wpglobus-wpseo_keyword_"+t),p(".wpglobus-wpseo_keyword_"+t).text(e)},n.prototype.updatePageAnalysis=function(){_.delay(function(){p(".wpglobus-wp-admin .wpglobus-wpseo-meta-section .wpseotab").css({width:""}),p("#wpseo-pageanalysis button").each(function(e,t){"false"===p(t).attr("aria-expanded")&&p(t).click()}),p("#yoast-seo-content-analysis button").each(function(e,t){"false"===p(t).attr("aria-expanded")&&p(t).click()});var e=d.getWPseoTab();1==p("#wpseo-pageanalysis").length?p("#wpseo-pageanalysis_"+e).html(p("#wpseo-pageanalysis").html()):1==p("#pageanalysis").length&&p("#pageanalysis_"+e).html(p("#pageanalysis").html()),p("#yoast-seo-content-analysis_"+e).html(p("#yoast-seo-content-analysis").html()),p("#yoast-seo-content-analysis_"+e+" li a").css({float:"none"});var t=0,s=0;1==p("#wpseo-pageanalysis").length?(p("#wpseo-pageanalysis_"+e+' ul[role="list"] li').each(function(e,t){s+=p(t).outerHeight(!0)}),t=s+170):1==p("#pageanalysis").length&&(p("#pageanalysis_"+e+' ul[role="list"] li').each(function(e,t){var a=p(t).outerHeight(!0);0==a&&(a=40),s+=a}),t=s+120,p("#pageanalysis_"+e+" .yoast-section").css({height:t+"px"})),p("#pageanalysis_"+e).css({height:t+"px"}),p("#pageanalysis_"+e).css({display:"block"}),n.prototype.setScoreIcon(100)},2500)},window.WPGlobusYoastSeoPlugin=new n}});
languages/wpglobus.pot CHANGED
@@ -1,8 +1,8 @@
1
- # Copyright (C) 2018 WPGlobus 1.9.19
2
- # This file is distributed under the same license as the WPGlobus 1.9.19 package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: WPGlobus 1.9.19\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) 2018 WPGlobus 1.9.20
2
+ # This file is distributed under the same license as the WPGlobus 1.9.20 package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: WPGlobus 1.9.20\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
@@ -218,6 +218,11 @@ This maintenance release introduces Gutenberg support in beta-stage.
218
 
219
  == Changelog ==
220
 
 
 
 
 
 
221
  = 1.9.19 =
222
 
223
  * FIXED:
218
 
219
  == Changelog ==
220
 
221
+ = 1.9.20 =
222
+
223
+ * FIXED:
224
+ * Missing some `*.min.js` files.
225
+
226
  = 1.9.19 =
227
 
228
  * FIXED:
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: 1.9.19
19
  * Author: WPGlobus
20
  * Author URI: https://wpglobus.com/
21
  * Network: false
@@ -42,7 +42,7 @@ if ( ! defined( 'ABSPATH' ) ) {
42
  exit;
43
  }
44
 
45
- define( 'WPGLOBUS_VERSION', '1.9.19' );
46
  define( 'WPGLOBUS_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
47
 
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: 1.9.20
19
  * Author: WPGlobus
20
  * Author URI: https://wpglobus.com/
21
  * Network: false
42
  exit;
43
  }
44
 
45
+ define( 'WPGLOBUS_VERSION', '1.9.20' );
46
  define( 'WPGLOBUS_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
47
 
48
  /**