WPGlobus – Multilingual Everything! - Version 2.3.0

Version Description

  • Added: (Builders/Pods) Support (partially - Standard and Custom Post Types) Pods Custom Content Types and Fields.
Download this release

Release Info

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

Code changes from version 2.2.35 to 2.3.0

configs/pods.json ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "post_meta_fields": {
3
+ "*":{"file":"vendor/pods/class-wpglobus-vendor-pods.php","class":"WPGlobus_Vendor_Pods"}
4
+ },
5
+ "post_ml_fields": {
6
+ "*":{"file":"vendor/pods/class-wpglobus-vendor-pods.php","class":"WPGlobus_Vendor_Pods"}
7
+ },
8
+ "wp_options": {
9
+ "blogname": {},
10
+ "blogdescription": null
11
+ }
12
+ }
includes/builders/class-wpglobus-builders.php CHANGED
@@ -135,6 +135,23 @@ if ( ! class_exists( 'WPGlobus_Builders' ) ) :
135
  'stage' => 'production',
136
  );
137
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
138
  /**
139
  * self::$add_on['wp-subtitle'] = array(
140
  * 'id' => 'wp-subtitle',
@@ -321,10 +338,25 @@ if ( ! class_exists( 'WPGlobus_Builders' ) ) :
321
  /**
322
  * @since 1.9.17
323
  */
324
- $builder = self::is_yoast_seo();
325
- if ( $builder ) {
326
- return $builder;
 
 
327
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
328
  }
329
 
330
  return self::$attrs;
@@ -1225,6 +1257,37 @@ if ( ! class_exists( 'WPGlobus_Builders' ) ) :
1225
 
1226
  }
1227
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1228
  /**
1229
  * Get attributes.
1230
  *
135
  'stage' => 'production',
136
  );
137
 
138
+ /**
139
+ * @since 2.3.0
140
+ */
141
+ self::$add_on['pods'] = array(
142
+ 'id' => 'pods',
143
+ 'role' => 'builder',
144
+ 'admin_bar_label' => 'Add-on',
145
+ 'config_file' => 'pods.json',
146
+ 'supported_min_version' => '2.7.16',
147
+ 'const' => 'PODS_VERSION',
148
+ 'plugin_name' => 'Pods-Custom Content Types and Fields',
149
+ 'plugin_uri' => 'https://wordpress.org/plugins/pods/',
150
+ 'path' => 'pods/init.php',
151
+ 'stage' => 'production',
152
+ 'admin_bar_builder_label' => 'Pods',
153
+ );
154
+
155
  /**
156
  * self::$add_on['wp-subtitle'] = array(
157
  * 'id' => 'wp-subtitle',
338
  /**
339
  * @since 1.9.17
340
  */
341
+ if ( ! $builder || ! $builder['builder_page'] ) {
342
+ $builder = self::is_yoast_seo();
343
+ if ( $builder && $builder['builder_page'] ) {
344
+ return $builder;
345
+ }
346
  }
347
+
348
+ /**
349
+ * Pods – Custom Content Types and Fields.
350
+ *
351
+ * @since 2.3.0
352
+ */
353
+ if ( ! $builder || ! $builder['builder_page'] ) {
354
+ $builder = self::is_pods();
355
+ if ( $builder && $builder['builder_page'] ) {
356
+ return $builder;
357
+ }
358
+
359
+ }
360
  }
361
 
362
  return self::$attrs;
1257
 
1258
  }
1259
 
1260
+ /**
1261
+ * Check for Pods – Custom Content Types and Fields.
1262
+ *
1263
+ * @since 2.3.0
1264
+ */
1265
+ protected static function is_pods() {
1266
+
1267
+ if ( ! defined( 'PODS_VERSION' ) ) {
1268
+ return false;
1269
+ }
1270
+
1271
+ $post_type = self::get_post_type_2();
1272
+
1273
+ $_attrs = array(
1274
+ 'id' => 'pods',
1275
+ 'version' => PODS_VERSION,
1276
+ 'class' => 'WPGlobus_Pods',
1277
+ 'builder_page' => false,
1278
+ 'post_type' => empty( $post_type ) ? '' : $post_type,
1279
+ );
1280
+
1281
+ require_once 'pods/class-wpglobus-builder-pods.php';
1282
+ $_attrs = WPGlobus_Builder_Pods::get_attrs( self::get_attrs( $_attrs ) );
1283
+
1284
+ if ( ! $_attrs ) {
1285
+ return false;
1286
+ }
1287
+
1288
+ return $_attrs;
1289
+ }
1290
+
1291
  /**
1292
  * Get attributes.
1293
  *
includes/builders/gutenberg/assets/js/wpglobus-gutenberg.min.js CHANGED
@@ -1 +1 @@
1
- "use strict";jQuery(document).ready(function(D){var I={counter:0,noticeOn:!1,initDone:!1,languageSelectorBoxDelta:0,oldLanguageSelector:!1,languageSelectorEnabled:!0,parseBool:function(e){return!/^(false|0)$/i.test(e)&&!!e},getCounter:function(){return I.counter},getOptionKey:function(e){return e=e||"",WPGlobusGutenberg.keyOption[e]},getOptions:function(){return WPGlobusGutenberg.options},isOldLanguageSelector:function(){return I.oldLanguageSelector},isPostDisabled:function(){return WPGlobusGutenberg.__post.disabled},isEnabledTab:function(e){void 0===e&&(e="options");var t=!1;return"options"==e&&I.parseBool(WPGlobusGutenberg.enabledOptionsTab)&&(t=!0),t},init:function(){WPGlobusGutenberg.yoastSeo=I.parseBool(WPGlobusGutenberg.yoastSeo),I.isPostDisabled()||(I.initListeners(),I.setTabs(),I.formHandler(),I.attachListeners())},initListeners:function(){WPGlobusGutenberg.yoastSeo&&1==D(".yoast.wpseo-metabox").length&&D(window).on("beforeunload",function(e){e.stopImmediatePropagation()})},formHandler:function(){var e=D(".metabox-base-form #referredby").attr("value");void 0!==e&&(e=-1==e.indexOf("language=en")?e+"&language="+WPGlobusGutenberg.language:e.replace("language=en","language="+WPGlobusGutenberg.language),D(".metabox-base-form #referredby").attr("value",e)),void 0!==(e=D('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),D('input[name="_wp_original_http_referer"]').attr("value",e))},setTabs:function(){if(0!=WPGlobusGutenberg.tabs.length){I.oldLanguageSelector=!0;var t=setInterval(function(){var e=D(".edit-post-header__settings");1==e.length&&(e.before(WPGlobusGutenberg.tabs),clearInterval(t))},200)}else I.WPGlobusSwitcherPlugin()},setSelectorStatus:function(){if(I.isOldLanguageSelector()){D(".wpglobus-gutenberg-selector-box").css({opacity:"0.2"}).attr("onclick","return false;"),I.languageSelectorEnabled=!1;var e=setInterval(function(){if(0==D(".is-saving").length){if(clearInterval(e),WPGlobusGutenberg.pagenow==WPGlobusGutenberg.postNewPage&&-1!=location.pathname.indexOf(WPGlobusGutenberg.postEditPage))return WPGlobusGutenberg.pagenow=WPGlobusGutenberg.postEditPage,D(".wpglobus-gutenberg-selector-box").css({opacity:"1"}).attr("onclick",""),void I.reloadPage();I.languageSelectorEnabled=!0,D(".wpglobus-gutenberg-selector-box").css({opacity:"1"}).attr("onclick","")}},400)}},reloadPage:function(){D(".wpglobus-selector-grid").css({"grid-template-columns":"10% 90%"}),D(".wpglobus-gutenberg-selector-text").text(WPGlobusGutenberg.i18n.reload),function e(){D(".wpglobus-gutenberg-selector").fadeOut(500).fadeIn(500,e)}(),setTimeout(function(){location.reload()},500)},attachListeners:function(){I.isOldLanguageSelector()&&(D(document).on("mouseenter",".wpglobus-gutenberg-selector",function(e){I.languageSelectorEnabled&&(D(".wpglobus-gutenberg-selector-dropdown").css({display:"block"}),I.languageSelectorBoxDelta=e.screenY,D(".edit-post-header").css({"z-index":"100000"}),D(".wpglobus-gutenberg-selector-box").css({"z-index":"100001"}))}),D(document).on("mouseleave",".wpglobus-gutenberg-selector",function(e){0!=I.languageSelectorBoxDelta&&e.screenY-I.languageSelectorBoxDelta<=0&&(D(".wpglobus-gutenberg-selector-dropdown").css({display:"none"}),D(".edit-post-header").css({"z-index":"9989"}),D(".wpglobus-gutenberg-selector-box").css({"z-index":"100"}))}),D(document).on("mouseleave",".wpglobus-gutenberg-selector-dropdown",function(e){D(".wpglobus-gutenberg-selector-dropdown").css({display:"none"}),D(".edit-post-header").css({"z-index":"9989"}),D(".wpglobus-gutenberg-selector-box").css({"z-index":"10000"})}),D(document).on("click",".editor-post-save-draft",function(){I.setSelectorStatus()}),D(document).on("click",".editor-post-publish-button",function(){I.setSelectorStatus()}))},WPGlobusSwitcherPlugin:function(){if(void 0!==wp.editPost&&void 0!==wp.plugins){var e=WPGlobusGutenberg.language,t=WPGlobusCoreData.enabled_languages,n=WPGlobusCoreData.en_language_name,o=WPGlobusGutenberg.flags_url,a="WPGlobus Switcher",s=location.href,l={};for(var u in t)-1==s.indexOf("language="+e)?l[t[u]]=s+"&language="+t[u]:l[t[u]]=s.replace("language="+e,"language="+t[u]);var r=wp.i18n.__,i=wp.element.createElement,g=wp.element.Fragment,c=wp.components.TabPanel,b=wp.compose.withState,p=wp.components.RadioControl,d=wp.components.Notice,w=wp.components.Button,m=wp.editPost.PluginSidebarMoreMenuItem,f=wp.components.PanelBody,G=wp.editPost.PluginSidebar,h=wp.plugins.registerPlugin,P=D(".components-panel__header.edit-post-sidebar-header button.components-icon-button").eq(0),v={flagOnly:'<img height="20px" width="20px" src="'+WPGlobusGutenberg.flags_url[WPGlobusGutenberg.language]+'" />',flagLanguage:'<img height="20px" width="20px" src="'+WPGlobusGutenberg.flags_url[WPGlobusGutenberg.language]+'" />&nbsp;'+WPGlobusAdmin.data.en_language_name[WPGlobusGutenberg.language],flagCode:'<img height="20px" width="20px" src="'+WPGlobusGutenberg.flags_url[WPGlobusGutenberg.language]+'" />&nbsp;'+WPGlobusGutenberg.language,languageOnly:"&nbsp;"+WPGlobusAdmin.data.en_language_name[WPGlobusGutenberg.language],languageCode:"&nbsp;"+WPGlobusGutenberg.language},_="",W="",x=I.getOptionKey("switcherButtonType");S(WPGlobusGutenberg.options[x]),W=L(),D(document).on("click",P,function(){B()});var y=b({value:W})(function(e){e.value;var t=e.setState;return i(p,{label:"",help:"Select type of switcher language button.",selected:W,className:"wpglobus-switcher-components-radio-control",options:[{label:"Flag only",value:"flagOnly"},{label:"Flag with language",value:"flagLanguage"},{label:"Flag with language code",value:"flagCode"},{label:"Language only",value:"languageOnly"},{label:"Language code",value:"languageCode"}],onChange:function(e){t({value:W=e}),T(x,e)}})});h("wpglobus-switcher",{icon:"",render:function(){return B(),i(g,{},i(m,{target:"wpglobus-switcher-sidebar",icon:"admin-site"},r("WPGlobus")),i(G,{name:"wpglobus-switcher-sidebar",title:O(),className:"wpglobus-switcher-components-panel"},i("div",{className:"wpglobus-switcher-message wpglobus-switcher-error-message hidden",style:{}},""),i(f,{className:"wpglobus-switcher-panel__body"},function(){var e=[{name:"switcher",title:"Languages",className:"wpglobus-panel-tab wpglobus-panel-tab-selector edit-post-sidebar__panel-tab"}];return WPGlobusGutenberg.isEnabledTab("options")&&e.push({name:"options",title:"Options",className:"wpglobus-panel-tab wpglobus-panel-tab-options edit-post-sidebar__panel-tab"}),i(c,{name:"WPGlobusSwitcherTabPanel",className:"wpglobus-tab-panel",activeClass:"is-active",tabs:e},C)}())))}})}function S(e){_=e=e||"flagLanguage"}function L(){return _}function O(){return a}function N(e){void 0===e&&(e=!0);var t=document.querySelectorAll(".wpglobus-switcher-components-radio-control .components-radio-control__input");0!=t.length&&(e?(t.forEach(function(e){e.classList.add(e.value),e.classList.remove("wpglobus-switcher-pulsate-radio")}),document.querySelector(".wpglobus-switcher-components-radio-control ."+W).classList.add("wpglobus-switcher-pulsate-radio")):t.forEach(function(e){e.classList.remove("wpglobus-switcher-pulsate-radio")}))}function k(e,t){void 0===e||I.noticeOn||(I.noticeOn=!0,e.innerText=t,e.classList.remove("hidden"),setTimeout(function(){e.classList.add("hidden"),I.noticeOn=!1},3e3))}function T(e,t){t=t||"",x==(e=e||"")&&(N(!0),function(e,t){if(""==(e=e||""))return;var n={sender:"WPGlobusGutenberg",_action:"saveOption",is_admin:1};return n.counter=I.counter++,n.options={},n.options[e]=t,wp.ajax.post(WPGlobusGutenberg.wpglobusAjax,{data:n})}(e,t).then(function(e){"success"==e.result&&(S(t),B(WPGlobusGutenberg.options[x]=t))}).fail(function(e){var t=document.getElementsByClassName("wpglobus-switcher-error-message");void 0!==t[0]&&("error"==e.result?k(t[0],e.message):400==e.status&&k(t[0],"Error: "+e.status+" ("+e.statusText+")"),W=L());var n=document.getElementsByClassName("wpglobus-panel-tab-options");void 0!==n[0]&&-1!=n[0].classList.value.indexOf("is-active")&&n[0].click()}).always(function(){N(!1)}))}function E(e){return void 0===v[e]&&(e=_),v[e]}function B(n){void 0!==n&&void 0!==v[n]||(n=_),setTimeout(function(){var e=document.querySelector('[aria-label="'+O()+'"]');if(null!=e)if(void 0===e.dataset.status){var t=e.innerHTML;e.innerHTML=t+E(n),e.dataset.status="init"}else e.innerHTML=E(n),e.dataset.status="changed"},300)}function C(e){return"switcher"==e.name?i("div",{className:"wpglobus-tab-content wpglobus-selector-tab-content"},i(d,{className:"wpglobus-switcher-panel__notice",status:"informational",isDismissible:!1},r("Select language")),i("div",{className:"wpglobus-switcher-panel__switcher-box"},WPGlobusGutenberg.pagenow==WPGlobusGutenberg.postNewPage?i("div",{style:{marginBottom:"20px"},className:"wpglobus-switcher-panel__switcher-notice"},WPGlobusGutenberg.i18n.save_post):i("ul",{className:"language-list"},t.map(function(e){return i("li",{key:e,className:"language-item"},i("img",{style:{marginRight:"7px"},className:"wpglobus-switcher-panel__flag",height:"20px",width:"20px",src:o[e]}),i(w,{href:l[e],isSmall:!0,isPrimary:!0},n[e]))}))),i(w,{className:"wpglobus-switcher-panel__button-link wpglobus-switcher-panel__info",href:WPGlobusGutenberg.store_link,isLink:!0,target:"_blank"},r("WPGlobus Premium Add-ons")),i(w,{className:"wpglobus-switcher-panel__button-link wpglobus-switcher-panel__settings-link",href:WPGlobusGutenberg.block_editor_tab_url,isLink:!0},r("Settings"))):"options"==e.name?i("div",{className:"wpglobus-tab-content wpglobus-options-tab-content"},i(d,{className:"wpglobus-switcher-panel__notice",status:"informational",isDismissible:!1},r("Select type")),i(y,null)):void 0}}};WPGlobusGutenberg=D.extend({},WPGlobusGutenberg,I),WPGlobusGutenberg.init()});
1
+ "use strict";jQuery(document).ready(function(D){var I={counter:0,noticeOn:!1,initDone:!1,languageSelectorBoxDelta:0,oldLanguageSelector:!1,languageSelectorEnabled:!0,parseBool:function(e){return!/^(false|0)$/i.test(e)&&!!e},getCounter:function(){return I.counter},getOptionKey:function(e){return e=e||"",WPGlobusGutenberg.keyOption[e]},getOptions:function(){return WPGlobusGutenberg.options},isOldLanguageSelector:function(){return I.oldLanguageSelector},isPostDisabled:function(){return WPGlobusGutenberg.__post.disabled},isEnabledTab:function(e){void 0===e&&(e="options");var t=!1;return"options"==e&&I.parseBool(WPGlobusGutenberg.enabledOptionsTab)&&(t=!0),t},init:function(){WPGlobusGutenberg.yoastSeo=I.parseBool(WPGlobusGutenberg.yoastSeo),I.isPostDisabled()||(I.initListeners(),I.setTabs(),I.formHandler(),I.attachListeners())},initListeners:function(){WPGlobusGutenberg.yoastSeo&&1==D(".yoast.wpseo-metabox").length&&D(window).on("beforeunload",function(e){e.stopImmediatePropagation()})},formHandler:function(){var e=D(".metabox-base-form #referredby").attr("value");void 0!==e&&(e=-1==e.indexOf("language=en")?e+"&language="+WPGlobusGutenberg.language:e.replace("language=en","language="+WPGlobusGutenberg.language),D(".metabox-base-form #referredby").attr("value",e)),void 0!==(e=D('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),D('input[name="_wp_original_http_referer"]').attr("value",e))},setTabs:function(){if(0!=WPGlobusGutenberg.tabs.length){I.oldLanguageSelector=!0;var t=setInterval(function(){var e=D(".edit-post-header__settings");1==e.length&&(e.before(WPGlobusGutenberg.tabs),clearInterval(t))},200)}else I.WPGlobusSwitcherPlugin()},setSelectorStatus:function(){if(I.isOldLanguageSelector()){D(".wpglobus-gutenberg-selector-box").css({opacity:"0.2"}).attr("onclick","return false;"),I.languageSelectorEnabled=!1;var e=setInterval(function(){if(0==D(".is-saving").length){if(clearInterval(e),WPGlobusGutenberg.pagenow==WPGlobusGutenberg.postNewPage&&-1!=location.pathname.indexOf(WPGlobusGutenberg.postEditPage))return WPGlobusGutenberg.pagenow=WPGlobusGutenberg.postEditPage,D(".wpglobus-gutenberg-selector-box").css({opacity:"1"}).attr("onclick",""),void I.reloadPage();I.languageSelectorEnabled=!0,D(".wpglobus-gutenberg-selector-box").css({opacity:"1"}).attr("onclick","")}},400)}},reloadPage:function(){D(".wpglobus-selector-grid").css({"grid-template-columns":"10% 90%"}),D(".wpglobus-gutenberg-selector-text").text(WPGlobusGutenberg.i18n.reload),function e(){D(".wpglobus-gutenberg-selector").fadeOut(500).fadeIn(500,e)}(),setTimeout(function(){location.reload()},500)},attachListeners:function(){I.isOldLanguageSelector()&&(D(document).on("mouseenter",".wpglobus-gutenberg-selector",function(e){I.languageSelectorEnabled&&(D(".wpglobus-gutenberg-selector-dropdown").css({display:"block"}),I.languageSelectorBoxDelta=e.screenY,D(".edit-post-header").css({"z-index":"100000"}),D(".wpglobus-gutenberg-selector-box").css({"z-index":"100001"}))}),D(document).on("mouseleave",".wpglobus-gutenberg-selector",function(e){0!=I.languageSelectorBoxDelta&&e.screenY-I.languageSelectorBoxDelta<=0&&(D(".wpglobus-gutenberg-selector-dropdown").css({display:"none"}),D(".edit-post-header").css({"z-index":"9989"}),D(".wpglobus-gutenberg-selector-box").css({"z-index":"100"}))}),D(document).on("mouseleave",".wpglobus-gutenberg-selector-dropdown",function(e){D(".wpglobus-gutenberg-selector-dropdown").css({display:"none"}),D(".edit-post-header").css({"z-index":"9989"}),D(".wpglobus-gutenberg-selector-box").css({"z-index":"10000"})}),D(document).on("click",".editor-post-save-draft",function(){I.setSelectorStatus()}),D(document).on("click",".editor-post-publish-button",function(){I.setSelectorStatus()}))},WPGlobusSwitcherPlugin:function(){if(void 0!==wp.editPost&&void 0!==wp.plugins){var e=WPGlobusGutenberg.language,t=WPGlobusCoreData.enabled_languages,n=WPGlobusCoreData.en_language_name,o=WPGlobusGutenberg.flags_url,a="WPGlobus Switcher",s=location.href,l={};for(var u in t)-1==s.indexOf("language="+e)?l[t[u]]=s+"&language="+t[u]:l[t[u]]=s.replace("language="+e,"language="+t[u]);var r=wp.i18n.__,i=wp.element.createElement,g=wp.element.Fragment,c=wp.components.TabPanel,b=wp.compose.withState,p=wp.components.RadioControl,d=wp.components.Notice,w=wp.components.Button,m=wp.editPost.PluginSidebarMoreMenuItem,f=wp.components.PanelBody,G=wp.editPost.PluginSidebar,h=wp.plugins.registerPlugin,P=D(".components-panel__header.edit-post-sidebar-header button.components-icon-button").eq(0),v={flagOnly:'<img height="20px" width="20px" src="'+WPGlobusGutenberg.flags_url[WPGlobusGutenberg.language]+'" />',flagLanguage:'<img height="20px" width="20px" src="'+WPGlobusGutenberg.flags_url[WPGlobusGutenberg.language]+'" />&nbsp;'+WPGlobusAdmin.data.en_language_name[WPGlobusGutenberg.language],flagCode:'<img height="20px" width="20px" src="'+WPGlobusGutenberg.flags_url[WPGlobusGutenberg.language]+'" />&nbsp;'+WPGlobusGutenberg.language,languageOnly:"&nbsp;"+WPGlobusAdmin.data.en_language_name[WPGlobusGutenberg.language],languageCode:"&nbsp;"+WPGlobusGutenberg.language},_="",W="",x=I.getOptionKey("switcherButtonType");S(WPGlobusGutenberg.options[x]),W=L(),D(document).on("click",P,function(){B()});var y=b({value:W})(function(e){e.value;var t=e.setState;return i(p,{label:"",help:"Select type of switcher language button.",selected:W,className:"wpglobus-switcher-components-radio-control",options:[{label:"Flag only",value:"flagOnly"},{label:"Flag with language",value:"flagLanguage"},{label:"Flag with language code",value:"flagCode"},{label:"Language only",value:"languageOnly"},{label:"Language code",value:"languageCode"}],onChange:function(e){t({value:W=e}),T(x,e)}})});h("wpglobus-switcher",{icon:"",render:function(){return B(),i(g,{},i(m,{target:"wpglobus-switcher-sidebar",icon:"admin-site"},r("WPGlobus")),i(G,{name:"wpglobus-switcher-sidebar",title:O(),className:"wpglobus-switcher-components-panel"},i("div",{className:"wpglobus-switcher-message wpglobus-switcher-error-message hidden",style:{}},""),i(f,{className:"wpglobus-switcher-panel__body"},(e=[{name:"switcher",title:"Languages",className:"wpglobus-panel-tab wpglobus-panel-tab-selector edit-post-sidebar__panel-tab"}],WPGlobusGutenberg.isEnabledTab("options")&&e.push({name:"options",title:"Options",className:"wpglobus-panel-tab wpglobus-panel-tab-options edit-post-sidebar__panel-tab"}),i(c,{name:"WPGlobusSwitcherTabPanel",className:"wpglobus-tab-panel",activeClass:"is-active",tabs:e},C)))));var e}})}function S(e){_=e=e||"flagLanguage"}function L(){return _}function O(){return a}function N(e){void 0===e&&(e=!0);var t=document.querySelectorAll(".wpglobus-switcher-components-radio-control .components-radio-control__input");0!=t.length&&(e?(t.forEach(function(e){e.classList.add(e.value),e.classList.remove("wpglobus-switcher-pulsate-radio")}),document.querySelector(".wpglobus-switcher-components-radio-control ."+W).classList.add("wpglobus-switcher-pulsate-radio")):t.forEach(function(e){e.classList.remove("wpglobus-switcher-pulsate-radio")}))}function k(e,t){void 0===e||I.noticeOn||(I.noticeOn=!0,e.innerText=t,e.classList.remove("hidden"),setTimeout(function(){e.classList.add("hidden"),I.noticeOn=!1},3e3))}function T(e,t){t=t||"",x==(e=e||"")&&(N(!0),function(e,t){if(""==(e=e||""))return;var n={sender:"WPGlobusGutenberg",_action:"saveOption",is_admin:1};return n.counter=I.counter++,n.options={},n.options[e]=t,wp.ajax.post(WPGlobusGutenberg.wpglobusAjax,{data:n})}(e,t).then(function(e){"success"==e.result&&(S(t),B(WPGlobusGutenberg.options[x]=t))}).fail(function(e){var t=document.getElementsByClassName("wpglobus-switcher-error-message");void 0!==t[0]&&("error"==e.result?k(t[0],e.message):400==e.status&&k(t[0],"Error: "+e.status+" ("+e.statusText+")"),W=L());var n=document.getElementsByClassName("wpglobus-panel-tab-options");void 0!==n[0]&&-1!=n[0].classList.value.indexOf("is-active")&&n[0].click()}).always(function(){N(!1)}))}function E(e){return void 0===v[e]&&(e=_),v[e]}function B(n){void 0!==n&&void 0!==v[n]||(n=_),setTimeout(function(){var e=document.querySelector('[aria-label="'+O()+'"]');if(null!=e)if(void 0===e.dataset.status){var t=e.innerHTML;e.innerHTML=t+E(n),e.dataset.status="init"}else e.innerHTML=E(n),e.dataset.status="changed"},300)}function C(e){return"switcher"==e.name?i("div",{className:"wpglobus-tab-content wpglobus-selector-tab-content"},i(d,{className:"wpglobus-switcher-panel__notice",status:"informational",isDismissible:!1},r("Select language")),i("div",{className:"wpglobus-switcher-panel__switcher-box"},WPGlobusGutenberg.pagenow==WPGlobusGutenberg.postNewPage?i("div",{style:{marginBottom:"20px"},className:"wpglobus-switcher-panel__switcher-notice"},WPGlobusGutenberg.i18n.save_post):i("ul",{className:"language-list"},t.map(function(e){return i("li",{key:e,className:"language-item"},i("img",{style:{marginRight:"7px"},className:"wpglobus-switcher-panel__flag",height:"20px",width:"20px",src:o[e]}),i(w,{href:l[e],isSmall:!0,isPrimary:!0},n[e]))}))),i(w,{className:"wpglobus-switcher-panel__button-link wpglobus-switcher-panel__info",href:WPGlobusGutenberg.store_link,isLink:!0,target:"_blank"},r("WPGlobus Premium Add-ons")),i(w,{className:"wpglobus-switcher-panel__button-link wpglobus-switcher-panel__settings-link",href:WPGlobusGutenberg.block_editor_tab_url,isLink:!0},r("Settings"))):"options"==e.name?i("div",{className:"wpglobus-tab-content wpglobus-options-tab-content"},i(d,{className:"wpglobus-switcher-panel__notice",status:"informational",isDismissible:!1},r("Select type")),i(y,null)):void 0}}};WPGlobusGutenberg=D.extend({},WPGlobusGutenberg,I),WPGlobusGutenberg.init()});
includes/builders/pods/class-wpglobus-builder-pods.php ADDED
@@ -0,0 +1,110 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * File: class-wpglobus-builder-pods.php
4
+ *
5
+ * @since 2.3.0
6
+ *
7
+ * @package WPGlobus\Builders\Pods.
8
+ * @author Alex Gor(alexgff)
9
+ */
10
+
11
+ if ( ! class_exists( 'WPGlobus_Builder_Pods' ) ) :
12
+
13
+ /**
14
+ * Class WPGlobus_Builder_Pods.
15
+ */
16
+ class WPGlobus_Builder_Pods {
17
+
18
+ /**
19
+ * Default Pods post type.
20
+ */
21
+ protected static $post_type = '_pods_pod';
22
+
23
+ /**
24
+ * Type of Pods: `post_type` or `settings`.
25
+ */
26
+ protected static $pods_type = '';
27
+
28
+ /**
29
+ * Get attributes.
30
+ */
31
+ public static function get_attrs($attrs) {
32
+
33
+ if ( ! function_exists('pods_api') ) {
34
+ return false;
35
+ }
36
+
37
+ /** @global string $pagenow */
38
+ /** @global string $wpdb */
39
+ global $pagenow, $wpdb;
40
+
41
+ $result = true;
42
+
43
+ if ( 'post.php' === $pagenow ) {
44
+
45
+ /**
46
+ * @see pods\includes\classes.php
47
+ */
48
+ $pods = pods_api()->load_pods( array( 'type' => 'post_type', 'fields' => true ) );
49
+
50
+ self::$pods_type = 'post_type';
51
+
52
+ $post_id = $attrs['post_id'];
53
+
54
+ if ( $post_id > 0 ) {
55
+
56
+ $pods_pod = $wpdb->get_results( $wpdb->prepare(
57
+ "SELECT p.post_name AS name, p.ID, p.post_title AS title, p.post_parent AS parent, pm.meta_value AS type FROM $wpdb->posts as p
58
+ LEFT JOIN $wpdb->postmeta AS pm ON pm.post_id = p.ID WHERE p.post_type = %s AND p.post_status = 'publish'
59
+ AND pm.meta_key = 'type' AND pm.meta_value = %s",
60
+ self::$post_type,
61
+ self::$pods_type
62
+ ), OBJECT_K );
63
+
64
+ if ( ! empty($pods_pod) ) {
65
+
66
+ foreach ( $pods_pod as $_pod_key => $_pod ) :
67
+
68
+ if ( $attrs['post_type'] != $_pod_key ) {
69
+ continue;
70
+ }
71
+
72
+ if ( empty($pods[ $_pod->ID ]['fields']) ) {
73
+ /**
74
+ * Pods_pod is attached to post type (e.g. for post) but has no fields.
75
+ */
76
+ $result = false;
77
+ break;
78
+ }
79
+
80
+ endforeach;
81
+ }
82
+ }
83
+
84
+ if ( ! $result ) {
85
+ return false;
86
+ }
87
+
88
+ $attrs['builder_page'] = true;
89
+ return $attrs;
90
+
91
+ } else {
92
+ /**
93
+ * @todo W.I.P @since 2.3.0
94
+ */
95
+ //
96
+ //if ( ! empty($_GET['page']) && false !== strpos( $_GET['page'], 'pods-settings' ) ) {
97
+ // $attrs['builder_page'] = true;
98
+ // return $attrs;
99
+ //}
100
+ }
101
+
102
+
103
+
104
+ return false;
105
+ }
106
+ }
107
+
108
+ endif;
109
+
110
+ # --- EOF
includes/builders/pods/class-wpglobus-pods-update-post.php ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * File: class-wpglobus-pods-update-post.php
4
+ *
5
+ * @since 2.3.0
6
+ *
7
+ * @package WPGlobus\Builders\Pods.
8
+ * @author Alex Gor(alexgff)
9
+ */
10
+
11
+ /**
12
+ * Class WPGlobus_pods_Update_Post.
13
+ */
14
+ if ( ! class_exists( 'WPGlobus_pods_Update_Post' ) ) :
15
+
16
+ // phpcs:ignore PEAR.NamingConventions
17
+ class WPGlobus_pods_Update_Post extends WPGlobus_Builder_Update_Post {
18
+
19
+ /**
20
+ * Constructor.
21
+ */
22
+ public function __construct() {
23
+
24
+ parent::__construct( 'pods' );
25
+
26
+ /**
27
+ * @see_file wpglobus\includes\class-wpglobus.php
28
+ */
29
+ remove_action( 'wp_insert_post_data', array( 'WPGlobus', 'on_save_post_data' ), 10 );
30
+
31
+ /**
32
+ * @todo incorrect the saving post in extra languages with priority = 10
33
+ */
34
+ add_filter( 'wp_insert_post_data', array( $this, 'filter__wp_insert_post_data' ), 100, 2 );
35
+
36
+ }
37
+
38
+ /**
39
+ * Callback for 'wp_insert_post_data'.
40
+ *
41
+ * @param array $data
42
+ * @param array $postarr
43
+ *
44
+ * @return mixed
45
+ */
46
+ public function filter__wp_insert_post_data( $data, $postarr ) {
47
+
48
+ /**
49
+ * Prevent to filter disabled post type.
50
+ */
51
+ if ( in_array( $data['post_type'], WPGlobus::Config()->disabled_entities, true ) ) {
52
+ return $data;
53
+ }
54
+
55
+ global $wpdb;
56
+ $_post = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->posts WHERE ID = %d AND post_type = %s LIMIT 1", $postarr['ID'], $postarr['post_type'] ) );
57
+
58
+ $fields = array();
59
+ if ( isset( $postarr['post_title'] ) ) {
60
+ $fields['post_title'] = $postarr['post_title'];
61
+ }
62
+
63
+ if ( isset( $postarr['post_content'] ) ) {
64
+ $fields['post_content'] = $postarr['post_content'];
65
+ }
66
+
67
+ if ( isset( $postarr['post_excerpt'] ) ) {
68
+ $fields['post_excerpt'] = $postarr['post_excerpt'];
69
+ }
70
+
71
+ $builder_language = WPGlobus::Config()->builder->get_language();
72
+
73
+ if ( empty( $builder_language ) ) {
74
+
75
+ if ( empty( $postarr[ WPGlobus::get_language_meta_key() ] ) ) {
76
+ $builder_language = WPGlobus::Config()->default_language;
77
+ } else {
78
+ $builder_language = $postarr[ WPGlobus::get_language_meta_key() ];
79
+ }
80
+ }
81
+
82
+ foreach ( $fields as $field => $value ) {
83
+
84
+ $tr = array();
85
+
86
+ foreach ( WPGlobus::Config()->enabled_languages as $lang ) :
87
+
88
+ if ( $lang === $builder_language ) {
89
+
90
+ $text = $value;
91
+ if ( WPGlobus_Core::has_translations( $value ) ) {
92
+ $text = WPGlobus_Core::text_filter( $value, $lang, WPGlobus::RETURN_EMPTY );
93
+ }
94
+ if ( ! empty( $text ) ) {
95
+ $tr[ $lang ] = $text;
96
+ }
97
+ } else {
98
+ if ( isset( $_post->$field ) ) {
99
+ $text = WPGlobus_Core::text_filter( $_post->$field, $lang, WPGlobus::RETURN_EMPTY );
100
+ if ( ! empty( $text ) ) {
101
+ $tr[ $lang ] = $text;
102
+ }
103
+ }
104
+ }
105
+
106
+ endforeach;
107
+
108
+ $data[ $field ] = WPGlobus_Utils::build_multilingual_string( $tr );
109
+
110
+ }
111
+
112
+ return $data;
113
+
114
+ }
115
+
116
+ }
117
+
118
+ endif;
119
+
120
+ # --- EOF
includes/builders/pods/class-wpglobus-pods.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * File: class-wpglobus-pods.php
4
+ *
5
+ * @since 2.3.0
6
+ *
7
+ * @package WPGlobus\Builders\Pods.
8
+ * @author Alex Gor(alexgff)
9
+ */
10
+
11
+ if ( ! class_exists( 'WPGlobus_Pods' ) ) :
12
+
13
+ /**
14
+ * Class WPGlobus_Pods.
15
+ */
16
+ class WPGlobus_Pods extends WPGlobus_Builder {
17
+
18
+ /**
19
+ * Constructor.
20
+ */
21
+ public function __construct() {
22
+
23
+ parent::__construct( 'pods' );
24
+
25
+ }
26
+
27
+ }
28
+
29
+ endif;
30
+
31
+ # --- EOF
includes/class-wpglobus-config-vendor.php CHANGED
@@ -185,6 +185,15 @@ if ( ! class_exists( 'WPGlobus_Config_Vendor' ) ) :
185
  }
186
  }
187
 
 
 
 
 
 
 
 
 
 
188
  /**
189
  * Page Builder by SiteOrigin.
190
  * https://wordpress.org/plugins/siteorigin-panels/
@@ -318,11 +327,20 @@ if ( ! class_exists( 'WPGlobus_Config_Vendor' ) ) :
318
  * @since 2.1.3 Added post type parameter.
319
  */
320
  $_post_meta_fields = $class::get_post_meta_fields( self::$builder->get( 'post_id' ), self::$builder->get( 'post_type' ) );
 
 
 
 
 
321
  }
 
 
 
 
 
322
  }
323
 
324
  return $_post_meta_fields;
325
-
326
  }
327
 
328
  /**
@@ -406,3 +424,5 @@ if ( ! class_exists( 'WPGlobus_Config_Vendor' ) ) :
406
  }
407
 
408
  endif;
 
 
185
  }
186
  }
187
 
188
+ /**
189
+ * Pods – Custom Content Types and Fields.
190
+ * https://wordpress.org/plugins/pods/
191
+ * @since 2.3.0
192
+ */
193
+ if ( defined( 'PODS_VERSION' ) ) {
194
+ self::$vendors[] = 'pods.json';
195
+ }
196
+
197
  /**
198
  * Page Builder by SiteOrigin.
199
  * https://wordpress.org/plugins/siteorigin-panels/
327
  * @since 2.1.3 Added post type parameter.
328
  */
329
  $_post_meta_fields = $class::get_post_meta_fields( self::$builder->get( 'post_id' ), self::$builder->get( 'post_type' ) );
330
+ } else {
331
+ /**
332
+ * Mark as being incorrectly called.
333
+ */
334
+ _doing_it_wrong( 'Class `' . $class . '` (in ' . __FILE__ . ')', 'Check out `configs\*.json` files.', '2.3.0' );
335
  }
336
+ } else {
337
+ /**
338
+ * Mark as being incorrectly called.
339
+ */
340
+ _doing_it_wrong( 'File `' . $file . '` (in ' . __FILE__ . ')', 'Check out `configs\*.json` files.', '2.3.0' );
341
  }
342
 
343
  return $_post_meta_fields;
 
344
  }
345
 
346
  /**
424
  }
425
 
426
  endif;
427
+
428
+ # --- EOF
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,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,e){c.each(a,function(t,a){!function(t,a){var e,o=c("#"+t),n=o.clone(),i=o.attr("name"),l="wpglobus-element wpglobus-element_"+t+" wpglobus-element_"+a+" wpglobus-translatable";e=(e=document.getElementById(t)).nodeName,c(n).attr("id",t+"_"+a),c(n).attr("name",i+"_"+a),a!==WPGlobusCoreData.default_language&&(l+=" hidden"),c(n).attr("class",l),c(n).attr("data-save-to",t),c(n).attr("data-language",a),"INPUT"==e?c(n).attr("value",c("#wpglobus-link-tab-"+a).data(t)):"TEXTAREA"==e&&c(n).text(c("#wpglobus-link-tab-"+a).data(t)),o.addClass("hidden"),0==c(".wpglobus-element_"+t).length?c(n).insertAfter(o):c(n).insertAfter(c(".wpglobus-element_"+t).last())}(a,e)})}),c(".wpglobus-taxonomy-tabs").insertAfter("#ajax-response"),c(".wrap").tabs(),c("body").on("click",".wpglobus-taxonomy-tabs li",function(t){var a=c(this).data("language");c(".wpglobus-element").addClass("hidden"),c(".wpglobus-element_"+a).removeClass("hidden")}),c(".wpglobus-element").on("change",function(){var n=c(this).data("save-to"),i="";c(".wpglobus-element").each(function(t,a){var e=c(a),o=e.val();e.data("save-to")==n&&""!==o&&(i+=WPGlobusCore.addLocaleMarks(o,e.data("language")))}),c("#"+n).val(i)}),c(WPGlobusAdmin.data.multilingualSlug.title).insertAfter(".term-slug-wrap th label")},navMenus:function(){function e(){n!==c(i).length&&(clearInterval(o),c(i).each(function(t,a){var 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")}}))}var o,n,i="#menu-to-edit .menu-item";c.ajaxSetup({beforeSend:function(t,a){void 0!==a.data&&0<=a.data.indexOf("action=add-menu-item")&&(n=c(i).length,o=setInterval(e,500))}}),c(i).each(function(t,a){var e=c(a).attr("id"),u=e.replace("menu-item-","");c.each(["input.edit-menu-item-title","input.edit-menu-item-attr-title"],function(n,i){var l=c("#"+e+" "+i);l.val()!=WPGlobusAdmin.data.items[u][i].source&&l.val(WPGlobusAdmin.data.items[u][i].source);var s=c("#"+e+" "+i).parents("p"),d=0;c.each(WPGlobusAdmin.data.open_languages,function(t,a){var e=l.clone();e.attr("id",l.attr("id")+"-"+a),e.attr("name",l.attr("id")+"-"+a),e.attr("data-language",a),e.attr("data-item-id",u),e.attr("placeholder",WPGlobusAdmin.data.en_language_name[a]);var o=WPGlobusAdmin.data.items[u][a][i].class;0===n&&a===WPGlobusAdmin.data.default_language?e.attr("class",o+" edit-menu-item-title"):e.attr("class",o),""!=WPGlobusAdmin.data.items[u][a][i].caption?e.attr("value",WPGlobusAdmin.data.items[u][a][i].caption):e.attr("value",""),e.css("margin-bottom","0.6em"),c(s).append(e),d=t}),d=40*(d+1),l.css("display","none").attr("class","").addClass("widefat wpglobus-hidden"),c(s).css("height",d+"px").addClass("wpglobus-menu-item-box")}),c(a).addClass("wpglobus-menu-item")}),c(".menus-move-left, .menus-move-right").each(function(t,a){var e,o=c(a),n=(o.parents("li").attr("id").replace("menu-item-",""),o.attr("title"));void 0!==n&&c.each(WPGlobusAdmin.data.post_titles,function(t,a){0<=n.indexOf(t)&&(e=n.replace(t,a),o.attr("title",e),o.text(e))})}),c(".edit-menu-item-title").trigger("change"),wpNavMenu.refreshAdvancedAccessibility(),wpNavMenu.menusChanged=!1,c(".wpglobus-menu-item").on("change",function(){var t,a,e=c(this),o=e.data("item-id");e.hasClass("wpglobus-item-title")&&(t=WPGlobusCore.getString(c("input#edit-menu-item-title-"+o).val(),e.val(),e.data("language")),void 0!==(a=c(document).triggerHandler("wpglobus_get_menu_translations",{string:t,lang:WPGlobusCoreData.open_languages,id:o,type:"input.edit-menu-item-title"}))&&(t=a),c("input#edit-menu-item-title-"+o).val(t)),e.hasClass("wpglobus-item-attr")&&(t=WPGlobusCore.getString(c("input#edit-menu-item-attr-title-"+o).val(),e.val(),e.data("language")),void 0!==(a=c(document).triggerHandler("wpglobus_get_menu_translations",{string:t,lang:WPGlobusCoreData.open_languages,id:o,type:"input.edit-menu-item-attr-title"}))&&(t=a),c("input#edit-menu-item-attr-title-"+o).val(t))})},postEdit:function(){c(document).on("heartbeat-send",function(t,o){void 0!==o.wp_autosave&&(o.wpglobus_heartbeat="wpglobus",c.each(WPGlobusAdmin.data.open_languages,function(t,a){var e=c("#title_"+a).val()||"";""!=(e=c.trim(e))&&(o.wp_autosave["post_title_"+a]=e),e=c("#content_"+a).val()||"",""!=(e=c.trim(e))&&(o.wp_autosave["content_"+a]=e)}))});var 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="";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?!0:(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(){function e(){n!==c(i).length&&(clearInterval(o),c(i).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")}}))}var o,n,i="#menu-to-edit .menu-item";c.ajaxSetup({beforeSend:function(t,a){void 0!==a.data&&0<=a.data.indexOf("action=add-menu-item")&&(n=c(i).length,o=setInterval(e,500))}}),c(i).each(function(t,a){var e=c(a).attr("id"),u=e.replace("menu-item-","");c.each(["input.edit-menu-item-title","input.edit-menu-item-attr-title"],function(n,i){var l=c("#"+e+" "+i);l.val()!=WPGlobusAdmin.data.items[u][i].source&&l.val(WPGlobusAdmin.data.items[u][i].source);var s=c("#"+e+" "+i).parents("p"),d=0;c.each(WPGlobusAdmin.data.open_languages,function(t,a){var e=l.clone();e.attr("id",l.attr("id")+"-"+a),e.attr("name",l.attr("id")+"-"+a),e.attr("data-language",a),e.attr("data-item-id",u),e.attr("placeholder",WPGlobusAdmin.data.en_language_name[a]);var o=WPGlobusAdmin.data.items[u][a][i].class;0===n&&a===WPGlobusAdmin.data.default_language?e.attr("class",o+" edit-menu-item-title"):e.attr("class",o),""!=WPGlobusAdmin.data.items[u][a][i].caption?e.attr("value",WPGlobusAdmin.data.items[u][a][i].caption):e.attr("value",""),e.css("margin-bottom","0.6em"),c(s).append(e),d=t}),d=40*(d+1),l.css("display","none").attr("class","").addClass("widefat wpglobus-hidden"),c(s).css("height",d+"px").addClass("wpglobus-menu-item-box")}),c(a).addClass("wpglobus-menu-item")}),c(".menus-move-left, .menus-move-right").each(function(t,a){var e,o=c(a),n=(o.parents("li").attr("id").replace("menu-item-",""),o.attr("title"));void 0!==n&&c.each(WPGlobusAdmin.data.post_titles,function(t,a){0<=n.indexOf(t)&&(e=n.replace(t,a),o.attr("title",e),o.text(e))})}),c(".edit-menu-item-title").trigger("change"),wpNavMenu.refreshAdvancedAccessibility(),wpNavMenu.menusChanged=!1,c(".wpglobus-menu-item").on("change",function(){var t,a,e=c(this),o=e.data("item-id");e.hasClass("wpglobus-item-title")&&(t=WPGlobusCore.getString(c("input#edit-menu-item-title-"+o).val(),e.val(),e.data("language")),void 0!==(a=c(document).triggerHandler("wpglobus_get_menu_translations",{string:t,lang:WPGlobusCoreData.open_languages,id:o,type:"input.edit-menu-item-title"}))&&(t=a),c("input#edit-menu-item-title-"+o).val(t)),e.hasClass("wpglobus-item-attr")&&(t=WPGlobusCore.getString(c("input#edit-menu-item-attr-title-"+o).val(),e.val(),e.data("language")),void 0!==(a=c(document).triggerHandler("wpglobus_get_menu_translations",{string:t,lang:WPGlobusCoreData.open_languages,id:o,type:"input.edit-menu-item-attr-title"}))&&(t=a),c("input#edit-menu-item-attr-title-"+o).val(t))})},postEdit:function(){c(document).on("heartbeat-send",function(t,o){void 0!==o.wp_autosave&&(o.wpglobus_heartbeat="wpglobus",c.each(WPGlobusAdmin.data.open_languages,function(t,a){var e=c("#title_"+a).val()||"";""!=(e=c.trim(e))&&(o.wp_autosave["post_title_"+a]=e),e=c("#content_"+a).val()||"",""!=(e=c.trim(e))&&(o.wp_autosave["content_"+a]=e)}))});var 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="";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,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,e){c.each(a,function(t,a){!function(t,a){var e,o=c("#"+t),n=o.clone(),i=o.attr("name"),l="wpglobus-element wpglobus-element_"+t+" wpglobus-element_"+a+" wpglobus-translatable";e=(e=document.getElementById(t)).nodeName,c(n).attr("id",t+"_"+a),c(n).attr("name",i+"_"+a),a!==WPGlobusCoreData.default_language&&(l+=" hidden"),c(n).attr("class",l),c(n).attr("data-save-to",t),c(n).attr("data-language",a),"INPUT"==e?c(n).attr("value",c("#wpglobus-link-tab-"+a).data(t)):"TEXTAREA"==e&&c(n).text(c("#wpglobus-link-tab-"+a).data(t)),o.addClass("hidden"),0==c(".wpglobus-element_"+t).length?c(n).insertAfter(o):c(n).insertAfter(c(".wpglobus-element_"+t).last())}(a,e)})}),c(".wpglobus-taxonomy-tabs").insertAfter("#ajax-response"),c(".wrap").tabs(),c("body").on("click",".wpglobus-taxonomy-tabs li",function(t){var a=c(this).data("language");c(".wpglobus-element").addClass("hidden"),c(".wpglobus-element_"+a).removeClass("hidden")}),c(".wpglobus-element").on("change",function(){var n=c(this).data("save-to"),i="";c(".wpglobus-element").each(function(t,a){var e=c(a),o=e.val();e.data("save-to")==n&&""!==o&&(i+=WPGlobusCore.addLocaleMarks(o,e.data("language")))}),c("#"+n).val(i)}),c(WPGlobusAdmin.data.multilingualSlug.title).insertAfter(".term-slug-wrap th label")},navMenus:function(){function e(){n!==c(i).length&&(clearInterval(o),c(i).each(function(t,a){var 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")}}))}var o,n,i="#menu-to-edit .menu-item";c.ajaxSetup({beforeSend:function(t,a){void 0!==a.data&&0<=a.data.indexOf("action=add-menu-item")&&(n=c(i).length,o=setInterval(e,500))}}),c(i).each(function(t,a){var e=c(a).attr("id"),u=e.replace("menu-item-","");c.each(["input.edit-menu-item-title","input.edit-menu-item-attr-title"],function(n,i){var l=c("#"+e+" "+i);l.val()!=WPGlobusAdmin.data.items[u][i].source&&l.val(WPGlobusAdmin.data.items[u][i].source);var s=c("#"+e+" "+i).parents("p"),d=0;c.each(WPGlobusAdmin.data.open_languages,function(t,a){var e=l.clone();e.attr("id",l.attr("id")+"-"+a),e.attr("name",l.attr("id")+"-"+a),e.attr("data-language",a),e.attr("data-item-id",u),e.attr("placeholder",WPGlobusAdmin.data.en_language_name[a]);var o=WPGlobusAdmin.data.items[u][a][i].class;0===n&&a===WPGlobusAdmin.data.default_language?e.attr("class",o+" edit-menu-item-title"):e.attr("class",o),""!=WPGlobusAdmin.data.items[u][a][i].caption?e.attr("value",WPGlobusAdmin.data.items[u][a][i].caption):e.attr("value",""),e.css("margin-bottom","0.6em"),c(s).append(e),d=t}),d=40*(d+1),l.css("display","none").attr("class","").addClass("widefat wpglobus-hidden"),c(s).css("height",d+"px").addClass("wpglobus-menu-item-box")}),c(a).addClass("wpglobus-menu-item")}),c(".menus-move-left, .menus-move-right").each(function(t,a){var e,o=c(a),n=(o.parents("li").attr("id").replace("menu-item-",""),o.attr("title"));void 0!==n&&c.each(WPGlobusAdmin.data.post_titles,function(t,a){0<=n.indexOf(t)&&(e=n.replace(t,a),o.attr("title",e),o.text(e))})}),c(".edit-menu-item-title").trigger("change"),wpNavMenu.refreshAdvancedAccessibility(),wpNavMenu.menusChanged=!1,c(".wpglobus-menu-item").on("change",function(){var t,a,e=c(this),o=e.data("item-id");e.hasClass("wpglobus-item-title")&&(t=WPGlobusCore.getString(c("input#edit-menu-item-title-"+o).val(),e.val(),e.data("language")),void 0!==(a=c(document).triggerHandler("wpglobus_get_menu_translations",{string:t,lang:WPGlobusCoreData.open_languages,id:o,type:"input.edit-menu-item-title"}))&&(t=a),c("input#edit-menu-item-title-"+o).val(t)),e.hasClass("wpglobus-item-attr")&&(t=WPGlobusCore.getString(c("input#edit-menu-item-attr-title-"+o).val(),e.val(),e.data("language")),void 0!==(a=c(document).triggerHandler("wpglobus_get_menu_translations",{string:t,lang:WPGlobusCoreData.open_languages,id:o,type:"input.edit-menu-item-attr-title"}))&&(t=a),c("input#edit-menu-item-attr-title-"+o).val(t))});var a=[];setTimeout(function(){c(".edit-menu-item-description").each(function(){var t=c(this).attr("id");a.push(t),WPGlobusDialogApp.addElement(t)}),c(".wpglobus_dialog_start").each(function(){c(this).css({"font-style":"normal"}),c(this).after("<br />")});var t={action:"getNavMenuItemsDescription"};t.menuItems=a,c.ajax({type:"POST",url:WPGlobusAdmin.ajaxurl,data:{action:WPGlobusAdmin.process_ajax,order:t},dataType:"json"}).done(function(t){"object"==typeof t&&c.each(t,function(t,a){""!=a&&(c("#"+t).val(a),c("#wpglobus-"+t).val(WPGlobusCore.TextFilter(a,WPGlobus.language,"RETURN_EMPTY")))})}).fail(function(t){}).always(function(t,a){})},1e3)},postEdit:function(){c(document).on("heartbeat-send",function(t,o){void 0!==o.wp_autosave&&(o.wpglobus_heartbeat="wpglobus",c.each(WPGlobusAdmin.data.open_languages,function(t,a){var e=c("#title_"+a).val()||"";""!=(e=c.trim(e))&&(o.wp_autosave["post_title_"+a]=e),e=c("#content_"+a).val()||"",""!=(e=c.trim(e))&&(o.wp_autosave["content_"+a]=e)}))});var 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="";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?!0:(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(){function e(){n!==c(i).length&&(clearInterval(o),c(i).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")}}))}var o,n,i="#menu-to-edit .menu-item";c.ajaxSetup({beforeSend:function(t,a){void 0!==a.data&&0<=a.data.indexOf("action=add-menu-item")&&(n=c(i).length,o=setInterval(e,500))}}),c(i).each(function(t,a){var e=c(a).attr("id"),u=e.replace("menu-item-","");c.each(["input.edit-menu-item-title","input.edit-menu-item-attr-title"],function(n,i){var l=c("#"+e+" "+i);l.val()!=WPGlobusAdmin.data.items[u][i].source&&l.val(WPGlobusAdmin.data.items[u][i].source);var s=c("#"+e+" "+i).parents("p"),d=0;c.each(WPGlobusAdmin.data.open_languages,function(t,a){var e=l.clone();e.attr("id",l.attr("id")+"-"+a),e.attr("name",l.attr("id")+"-"+a),e.attr("data-language",a),e.attr("data-item-id",u),e.attr("placeholder",WPGlobusAdmin.data.en_language_name[a]);var o=WPGlobusAdmin.data.items[u][a][i].class;0===n&&a===WPGlobusAdmin.data.default_language?e.attr("class",o+" edit-menu-item-title"):e.attr("class",o),""!=WPGlobusAdmin.data.items[u][a][i].caption?e.attr("value",WPGlobusAdmin.data.items[u][a][i].caption):e.attr("value",""),e.css("margin-bottom","0.6em"),c(s).append(e),d=t}),d=40*(d+1),l.css("display","none").attr("class","").addClass("widefat wpglobus-hidden"),c(s).css("height",d+"px").addClass("wpglobus-menu-item-box")}),c(a).addClass("wpglobus-menu-item")}),c(".menus-move-left, .menus-move-right").each(function(t,a){var e,o=c(a),n=(o.parents("li").attr("id").replace("menu-item-",""),o.attr("title"));void 0!==n&&c.each(WPGlobusAdmin.data.post_titles,function(t,a){0<=n.indexOf(t)&&(e=n.replace(t,a),o.attr("title",e),o.text(e))})}),c(".edit-menu-item-title").trigger("change"),wpNavMenu.refreshAdvancedAccessibility(),wpNavMenu.menusChanged=!1,c(".wpglobus-menu-item").on("change",function(){var t,a,e=c(this),o=e.data("item-id");e.hasClass("wpglobus-item-title")&&(t=WPGlobusCore.getString(c("input#edit-menu-item-title-"+o).val(),e.val(),e.data("language")),void 0!==(a=c(document).triggerHandler("wpglobus_get_menu_translations",{string:t,lang:WPGlobusCoreData.open_languages,id:o,type:"input.edit-menu-item-title"}))&&(t=a),c("input#edit-menu-item-title-"+o).val(t)),e.hasClass("wpglobus-item-attr")&&(t=WPGlobusCore.getString(c("input#edit-menu-item-attr-title-"+o).val(),e.val(),e.data("language")),void 0!==(a=c(document).triggerHandler("wpglobus_get_menu_translations",{string:t,lang:WPGlobusCoreData.open_languages,id:o,type:"input.edit-menu-item-attr-title"}))&&(t=a),c("input#edit-menu-item-attr-title-"+o).val(t))});var a=[];setTimeout(function(){c(".edit-menu-item-description").each(function(){var t=c(this).attr("id");a.push(t),WPGlobusDialogApp.addElement(t)}),c(".wpglobus_dialog_start").each(function(){c(this).css({"font-style":"normal"}),c(this).after("<br />")});var t={action:"getNavMenuItemsDescription"};t.menuItems=a,c.ajax({type:"POST",url:WPGlobusAdmin.ajaxurl,data:{action:WPGlobusAdmin.process_ajax,order:t},dataType:"json"}).done(function(t){"object"==typeof t&&c.each(t,function(t,a){""!=a&&(c("#"+t).val(a),c("#wpglobus-"+t).val(WPGlobusCore.TextFilter(a,WPGlobus.language,"RETURN_EMPTY")))})}).fail(function(t){}).always(function(t,a){})},1e3)},postEdit:function(){c(document).on("heartbeat-send",function(t,o){void 0!==o.wp_autosave&&(o.wpglobus_heartbeat="wpglobus",c.each(WPGlobusAdmin.data.open_languages,function(t,a){var e=c("#title_"+a).val()||"";""!=(e=c.trim(e))&&(o.wp_autosave["post_title_"+a]=e),e=c("#content_"+a).val()||"",""!=(e=c.trim(e))&&(o.wp_autosave["content_"+a]=e)}))});var 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="";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-51.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(){},afterSave:function(){},close:function(){}},dialog:{}},form:void 0,element:void 0,element_by:"id",id:"",clone_id:"",wpglobus_id:"",type:"textarea",source:"",order:{},value:{},request:"core",attrs:{},dialogTitle:"",trClass:"wpglobus-translatable",startButton:['<span id="wpglobus-dialog-start-{{clone_id}}" ','style="{{style}}" ','data-type="control" data-dialog-title="{{title}}" ','data-source-type="" data-source-id="{{id}}" data-source-name="{{name}}" ','data-nodename="{{nodename}}"',"{{sbTitle}} ",'class="{{classes}}"></span>'].join(""),startButtonClass:"wpglobus_dialog_start wpglobus_dialog_icon",clicks:0,init:function(t){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),f.runCallback(f.option.dialog.afterSave)},dialog:m("#wpglobus-dialog-wrapper").dialog({autoOpen:!1,width:650,modal:!0,dialogClass:"wpglobus-dialog",buttons:[{text:"Save",class:"wpglobus-button-save",click:function(){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),m(this).removeClass("hidden")},close:function(){m(this).addClass("hidden"),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]():"function"==typeof t&&t()}}}(jQuery),jQuery(document).ready(function(){"use strict";var t,c;window.WPGlobusAdminApp=(t=window.WPGlobusAdminApp||{},c=jQuery,t.App=function(t){void 0===window.WPGlobusAdminApp&&(this.config={debug:!1,version:WPGlobusAdmin.version},this.status="ok","undefined"==typeof WPGlobusAdmin?(this.status="error",this.config.debug&&console.log("WPGlobus: error options loading")):this.config.debug&&console.dir(WPGlobusAdmin),this.config.disable_first_language=['<div id="disable_first_language" style="display:block;" class="redux-field-errors notice-red">',"<strong>","<span>&nbsp;</span>",WPGlobusAdmin.i18n.cannot_disable_language,"</strong>","</div>"].join(""),c.extend(this.config,t),"ok"===this.status&&this.init())},t.App.prototype={$document:c(document),init:function(){WPGlobusCoreData.multisite=this.parseBool(WPGlobusCoreData.multisite),this.adminInit(),c("#content").addClass("wpglobus-editor").attr("data-language",WPGlobusAdmin.data.default_language),c("textarea[id^=content_]").each(function(t,a){var e=c(a).attr("id").replace("content_","");c(a).attr("data-language",e)}),"post.php"===WPGlobusAdmin.page?(this.postEdit(),this.set_dialog(),"undefined"!=typeof WPGlobusAioseop&&WPGlobusAioseop.init()):"menu-edit"===WPGlobusAdmin.page?(WPGlobusDialogApp.init({dialogTitle:"Edit description"}),this.navMenus()):"taxonomy-edit"===WPGlobusAdmin.page?WPGlobusAdmin.data.tag_id&&this.taxonomyEdit():"taxonomy-quick-edit"===WPGlobusAdmin.page?this.quickEdit("taxonomy"):"edit.php"===WPGlobusAdmin.page?(this.quickEdit("post"),0<_.size(WPGlobusAdmin.$_get)&&WPGlobusDialogApp.init()):"options-general.php"==WPGlobusAdmin.page?(this.optionsGeneral(),WPGlobusDialogApp.init({customData:WPGlobusCoreData.page_custom_data})):"widgets.php"==WPGlobusAdmin.page?(WPGlobusWidgets.init(),WPGlobusDialogApp.init({dialogTitle:"Edit text"})):"wpglobus_options"==WPGlobusAdmin.page?this.start():"wpglobusAdminCentral"==WPGlobusAdmin.page?this.adminCentral():WPGlobusDialogApp.init({customData:WPGlobusCoreData.page_custom_data})},parseBool:function(t){return!/^(false|0)$/i.test(t)&&!!t},getCurrentTab:function(){return c(".wpglobus-post-body-tabs-list .ui-tabs-active").data("language")},adminInit:function(){var t=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",".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,e){c.each(a,function(t,a){!function(t,a){var e,o=c("#"+t),n=o.clone(),i=o.attr("name"),l="wpglobus-element wpglobus-element_"+t+" wpglobus-element_"+a+" wpglobus-translatable";e=(e=document.getElementById(t)).nodeName,c(n).attr("id",t+"_"+a),c(n).attr("name",i+"_"+a),a!==WPGlobusCoreData.default_language&&(l+=" hidden"),c(n).attr("class",l),c(n).attr("data-save-to",t),c(n).attr("data-language",a),"INPUT"==e?c(n).attr("value",c("#wpglobus-link-tab-"+a).data(t)):"TEXTAREA"==e&&c(n).text(c("#wpglobus-link-tab-"+a).data(t)),o.addClass("hidden"),0==c(".wpglobus-element_"+t).length?c(n).insertAfter(o):c(n).insertAfter(c(".wpglobus-element_"+t).last())}(a,e)})}),c(".wpglobus-taxonomy-tabs").insertAfter("#ajax-response"),c(".wrap").tabs(),c("body").on("click",".wpglobus-taxonomy-tabs li",function(t){var a=c(this).data("language");c(".wpglobus-element").addClass("hidden"),c(".wpglobus-element_"+a).removeClass("hidden")}),c(".wpglobus-element").on("change",function(){var n=c(this).data("save-to"),i="";c(".wpglobus-element").each(function(t,a){var e=c(a),o=e.val();e.data("save-to")==n&&""!==o&&(i+=WPGlobusCore.addLocaleMarks(o,e.data("language")))}),c("#"+n).val(i)}),c(WPGlobusAdmin.data.multilingualSlug.title).insertAfter(".term-slug-wrap th label")},navMenus:function(){function e(){n!==c(i).length&&(clearInterval(o),c(i).each(function(t,a){var 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")}}))}var o,n,i="#menu-to-edit .menu-item";c.ajaxSetup({beforeSend:function(t,a){void 0!==a.data&&0<=a.data.indexOf("action=add-menu-item")&&(n=c(i).length,o=setInterval(e,500))}}),c(i).each(function(t,a){var e=c(a).attr("id"),u=e.replace("menu-item-","");c.each(["input.edit-menu-item-title","input.edit-menu-item-attr-title"],function(n,i){var l=c("#"+e+" "+i);l.val()!=WPGlobusAdmin.data.items[u][i].source&&l.val(WPGlobusAdmin.data.items[u][i].source);var s=c("#"+e+" "+i).parents("p"),d=0;c.each(WPGlobusAdmin.data.open_languages,function(t,a){var e=l.clone();e.attr("id",l.attr("id")+"-"+a),e.attr("name",l.attr("id")+"-"+a),e.attr("data-language",a),e.attr("data-item-id",u),e.attr("placeholder",WPGlobusAdmin.data.en_language_name[a]);var o=WPGlobusAdmin.data.items[u][a][i].class;0===n&&a===WPGlobusAdmin.data.default_language?e.attr("class",o+" edit-menu-item-title"):e.attr("class",o),""!=WPGlobusAdmin.data.items[u][a][i].caption?e.attr("value",WPGlobusAdmin.data.items[u][a][i].caption):e.attr("value",""),e.css("margin-bottom","0.6em"),c(s).append(e),d=t}),d=40*(d+1),l.css("display","none").attr("class","").addClass("widefat wpglobus-hidden"),c(s).css("height",d+"px").addClass("wpglobus-menu-item-box")}),c(a).addClass("wpglobus-menu-item")}),c(".menus-move-left, .menus-move-right").each(function(t,a){var e,o=c(a),n=(o.parents("li").attr("id").replace("menu-item-",""),o.attr("title"));void 0!==n&&c.each(WPGlobusAdmin.data.post_titles,function(t,a){0<=n.indexOf(t)&&(e=n.replace(t,a),o.attr("title",e),o.text(e))})}),c(".edit-menu-item-title").trigger("change"),wpNavMenu.refreshAdvancedAccessibility(),wpNavMenu.menusChanged=!1,c(".wpglobus-menu-item").on("change",function(){var t,a,e=c(this),o=e.data("item-id");e.hasClass("wpglobus-item-title")&&(t=WPGlobusCore.getString(c("input#edit-menu-item-title-"+o).val(),e.val(),e.data("language")),void 0!==(a=c(document).triggerHandler("wpglobus_get_menu_translations",{string:t,lang:WPGlobusCoreData.open_languages,id:o,type:"input.edit-menu-item-title"}))&&(t=a),c("input#edit-menu-item-title-"+o).val(t)),e.hasClass("wpglobus-item-attr")&&(t=WPGlobusCore.getString(c("input#edit-menu-item-attr-title-"+o).val(),e.val(),e.data("language")),void 0!==(a=c(document).triggerHandler("wpglobus_get_menu_translations",{string:t,lang:WPGlobusCoreData.open_languages,id:o,type:"input.edit-menu-item-attr-title"}))&&(t=a),c("input#edit-menu-item-attr-title-"+o).val(t))});var a=[];setTimeout(function(){c(".edit-menu-item-description").each(function(){var t=c(this).attr("id");a.push(t),WPGlobusDialogApp.addElement(t)}),c(".wpglobus_dialog_start").each(function(){c(this).css({"font-style":"normal"}),c(this).after("<br />")});var t={action:"getNavMenuItemsDescription"};t.menuItems=a,c.ajax({type:"POST",url:WPGlobusAdmin.ajaxurl,data:{action:WPGlobusAdmin.process_ajax,order:t},dataType:"json"}).done(function(t){"object"==typeof t&&c.each(t,function(t,a){""!=a&&(c("#"+t).val(a),c("#wpglobus-"+t).val(WPGlobusCore.TextFilter(a,WPGlobus.language,"RETURN_EMPTY")))})}).fail(function(t){}).always(function(t,a){})},1e3)},postEdit:function(){c(document).on("heartbeat-send",function(t,o){void 0!==o.wp_autosave&&(o.wpglobus_heartbeat="wpglobus",c.each(WPGlobusAdmin.data.open_languages,function(t,a){var e=c("#title_"+a).val()||"";""!=(e=c.trim(e))&&(o.wp_autosave["post_title_"+a]=e),e=c("#content_"+a).val()||"",""!=(e=c.trim(e))&&(o.wp_autosave["content_"+a]=e)}))});var 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))}),setTimeout(function(){var i=!1;c(a).addClass("wpglobus-post-body-tabs").tabs({beforeActivate:function(t,a){!function(){if(!i){var t=c("#wp-content-editor-container .mce-btn-group").eq(0),a=t.children("div");if(0!=t.length&&0!=a.length){var l=t.attr("style"),s=a.attr("style");c.each(WPGlobusCoreData.enabled_languages,function(t,a){if(a!=WPGlobusCoreData.default_language){var e=c("#wp-content_"+a+"-editor-container .mce-btn-group").eq(0),o=e.children("div");if(0==e.length||0==o.length)return!0;var n=e.attr("style"),i=o.attr("style");l!=n&&e.attr("style",l),s!=i&&o.attr("style",s)}}),i=!0}}}();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)}})},500),c("#title").val(WPGlobusAdmin.title),c("#content").text(WPGlobusAdmin.content),"undefined"!=typeof WPGlobusVendor&&WPGlobusVendor.vendor.WPSEO&&("undefined"!=typeof wpglobus_wpseo?wpglobus_wpseo():"undefined"!=typeof WPGlobusYoastSeo&&("undefined"!=typeof WPGlobusYoastSeoPremium&&WPGlobusYoastSeoPremium&&"function"==typeof WPGlobusYoastSeoPremium.init&&WPGlobusYoastSeoPremium.init(),"function"==typeof WPGlobusYoastSeo.init&&WPGlobusYoastSeo.init())),WPGlobusAdmin.data.modify_excerpt){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="";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(){},afterSave:function(){},close:function(){}},dialog:{}},form:void 0,element:void 0,element_by:"id",id:"",clone_id:"",wpglobus_id:"",type:"textarea",source:"",order:{},value:{},request:"core",attrs:{},dialogTitle:"",trClass:"wpglobus-translatable",startButton:['<span id="wpglobus-dialog-start-{{clone_id}}" ','style="{{style}}" ','data-type="control" data-dialog-title="{{title}}" ','data-source-type="" data-source-id="{{id}}" data-source-name="{{name}}" ','data-nodename="{{nodename}}"',"{{sbTitle}} ",'class="{{classes}}"></span>'].join(""),startButtonClass:"wpglobus_dialog_start wpglobus_dialog_icon",clicks:0,init:function(t){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?!0:(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),f.runCallback(f.option.dialog.afterSave)},dialog:m("#wpglobus-dialog-wrapper").dialog({autoOpen:!1,width:650,modal:!0,dialogClass:"wpglobus-dialog",buttons:[{text:"Save",class:"wpglobus-button-save",click:function(){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),m(this).removeClass("hidden")},close:function(){m(this).addClass("hidden"),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]():"function"==typeof t&&t()}}}(jQuery),jQuery(document).ready(function(){"use strict";var t,c;window.WPGlobusAdminApp=(t=window.WPGlobusAdminApp||{},c=jQuery,t.App=function(t){void 0===window.WPGlobusAdminApp&&(this.config={debug:!1,version:WPGlobusAdmin.version},this.status="ok","undefined"==typeof WPGlobusAdmin?(this.status="error",this.config.debug&&console.log("WPGlobus: error options loading")):this.config.debug&&console.dir(WPGlobusAdmin),this.config.disable_first_language=['<div id="disable_first_language" style="display:block;" class="redux-field-errors notice-red">',"<strong>","<span>&nbsp;</span>",WPGlobusAdmin.i18n.cannot_disable_language,"</strong>","</div>"].join(""),c.extend(this.config,t),"ok"===this.status&&this.init())},t.App.prototype={$document:c(document),init:function(){WPGlobusCoreData.multisite=this.parseBool(WPGlobusCoreData.multisite),this.adminInit(),c("#content").addClass("wpglobus-editor").attr("data-language",WPGlobusAdmin.data.default_language),c("textarea[id^=content_]").each(function(t,a){var e=c(a).attr("id").replace("content_","");c(a).attr("data-language",e)}),"post.php"===WPGlobusAdmin.page?(this.postEdit(),this.set_dialog(),"undefined"!=typeof WPGlobusAioseop&&WPGlobusAioseop.init()):"menu-edit"===WPGlobusAdmin.page?(WPGlobusDialogApp.init({dialogTitle:"Edit description"}),this.navMenus()):"taxonomy-edit"===WPGlobusAdmin.page?WPGlobusAdmin.data.tag_id&&this.taxonomyEdit():"taxonomy-quick-edit"===WPGlobusAdmin.page?this.quickEdit("taxonomy"):"edit.php"===WPGlobusAdmin.page?(this.quickEdit("post"),0<_.size(WPGlobusAdmin.$_get)&&WPGlobusDialogApp.init()):"options-general.php"==WPGlobusAdmin.page?(this.optionsGeneral(),WPGlobusDialogApp.init({customData:WPGlobusCoreData.page_custom_data})):"widgets.php"==WPGlobusAdmin.page?(WPGlobusWidgets.init(),WPGlobusDialogApp.init({dialogTitle:"Edit text"})):"wpglobus_options"==WPGlobusAdmin.page?this.start():"wpglobusAdminCentral"==WPGlobusAdmin.page?this.adminCentral():WPGlobusDialogApp.init({customData:WPGlobusCoreData.page_custom_data})},parseBool:function(t){return!/^(false|0)$/i.test(t)&&!!t},getCurrentTab:function(){return c(".wpglobus-post-body-tabs-list .ui-tabs-active").data("language")},adminInit:function(){var t=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",".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(){function e(){n!==c(i).length&&(clearInterval(o),c(i).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")}}))}var o,n,i="#menu-to-edit .menu-item";c.ajaxSetup({beforeSend:function(t,a){void 0!==a.data&&0<=a.data.indexOf("action=add-menu-item")&&(n=c(i).length,o=setInterval(e,500))}}),c(i).each(function(t,a){var e=c(a).attr("id"),u=e.replace("menu-item-","");c.each(["input.edit-menu-item-title","input.edit-menu-item-attr-title"],function(n,i){var l=c("#"+e+" "+i);l.val()!=WPGlobusAdmin.data.items[u][i].source&&l.val(WPGlobusAdmin.data.items[u][i].source);var s=c("#"+e+" "+i).parents("p"),d=0;c.each(WPGlobusAdmin.data.open_languages,function(t,a){var e=l.clone();e.attr("id",l.attr("id")+"-"+a),e.attr("name",l.attr("id")+"-"+a),e.attr("data-language",a),e.attr("data-item-id",u),e.attr("placeholder",WPGlobusAdmin.data.en_language_name[a]);var o=WPGlobusAdmin.data.items[u][a][i].class;0===n&&a===WPGlobusAdmin.data.default_language?e.attr("class",o+" edit-menu-item-title"):e.attr("class",o),""!=WPGlobusAdmin.data.items[u][a][i].caption?e.attr("value",WPGlobusAdmin.data.items[u][a][i].caption):e.attr("value",""),e.css("margin-bottom","0.6em"),c(s).append(e),d=t}),d=40*(d+1),l.css("display","none").attr("class","").addClass("widefat wpglobus-hidden"),c(s).css("height",d+"px").addClass("wpglobus-menu-item-box")}),c(a).addClass("wpglobus-menu-item")}),c(".menus-move-left, .menus-move-right").each(function(t,a){var e,o=c(a),n=(o.parents("li").attr("id").replace("menu-item-",""),o.attr("title"));void 0!==n&&c.each(WPGlobusAdmin.data.post_titles,function(t,a){0<=n.indexOf(t)&&(e=n.replace(t,a),o.attr("title",e),o.text(e))})}),c(".edit-menu-item-title").trigger("change"),wpNavMenu.refreshAdvancedAccessibility(),wpNavMenu.menusChanged=!1,c(".wpglobus-menu-item").on("change",function(){var t,a,e=c(this),o=e.data("item-id");e.hasClass("wpglobus-item-title")&&(t=WPGlobusCore.getString(c("input#edit-menu-item-title-"+o).val(),e.val(),e.data("language")),void 0!==(a=c(document).triggerHandler("wpglobus_get_menu_translations",{string:t,lang:WPGlobusCoreData.open_languages,id:o,type:"input.edit-menu-item-title"}))&&(t=a),c("input#edit-menu-item-title-"+o).val(t)),e.hasClass("wpglobus-item-attr")&&(t=WPGlobusCore.getString(c("input#edit-menu-item-attr-title-"+o).val(),e.val(),e.data("language")),void 0!==(a=c(document).triggerHandler("wpglobus_get_menu_translations",{string:t,lang:WPGlobusCoreData.open_languages,id:o,type:"input.edit-menu-item-attr-title"}))&&(t=a),c("input#edit-menu-item-attr-title-"+o).val(t))});var a=[];setTimeout(function(){c(".edit-menu-item-description").each(function(){var t=c(this).attr("id");a.push(t),WPGlobusDialogApp.addElement(t)}),c(".wpglobus_dialog_start").each(function(){c(this).css({"font-style":"normal"}),c(this).after("<br />")});var t={action:"getNavMenuItemsDescription"};t.menuItems=a,c.ajax({type:"POST",url:WPGlobusAdmin.ajaxurl,data:{action:WPGlobusAdmin.process_ajax,order:t},dataType:"json"}).done(function(t){"object"==typeof t&&c.each(t,function(t,a){""!=a&&(c("#"+t).val(a),c("#wpglobus-"+t).val(WPGlobusCore.TextFilter(a,WPGlobus.language,"RETURN_EMPTY")))})}).fail(function(t){}).always(function(t,a){})},1e3)},postEdit:function(){c(document).on("heartbeat-send",function(t,o){void 0!==o.wp_autosave&&(o.wpglobus_heartbeat="wpglobus",c.each(WPGlobusAdmin.data.open_languages,function(t,a){var e=c("#title_"+a).val()||"";""!=(e=c.trim(e))&&(o.wp_autosave["post_title_"+a]=e),e=c("#content_"+a).val()||"",""!=(e=c.trim(e))&&(o.wp_autosave["content_"+a]=e)}))});var 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))}),setTimeout(function(){var i=!1;c(a).addClass("wpglobus-post-body-tabs").tabs({beforeActivate:function(t,a){!function(){if(!i){var t=c("#wp-content-editor-container .mce-btn-group").eq(0),a=t.children("div");if(0!=t.length&&0!=a.length){var l=t.attr("style"),s=a.attr("style");c.each(WPGlobusCoreData.enabled_languages,function(t,a){if(a!=WPGlobusCoreData.default_language){var e=c("#wp-content_"+a+"-editor-container .mce-btn-group").eq(0),o=e.children("div");if(0==e.length||0==o.length)return!0;var n=e.attr("style"),i=o.attr("style");l!=n&&e.attr("style",l),s!=i&&o.attr("style",s)}}),i=!0}}}();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)}})},500),c("#title").val(WPGlobusAdmin.title),c("#content").text(WPGlobusAdmin.content),"undefined"!=typeof WPGlobusVendor&&WPGlobusVendor.vendor.WPSEO&&("undefined"!=typeof wpglobus_wpseo?wpglobus_wpseo():"undefined"!=typeof WPGlobusYoastSeo&&("undefined"!=typeof WPGlobusYoastSeoPremium&&WPGlobusYoastSeoPremium&&"function"==typeof WPGlobusYoastSeoPremium.init&&WPGlobusYoastSeoPremium.init(),"function"==typeof WPGlobusYoastSeo.init&&WPGlobusYoastSeo.init())),WPGlobusAdmin.data.modify_excerpt){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="";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-debug.min.js CHANGED
@@ -1 +1 @@
1
- !function(u){"use strict";if("undefined"!=typeof WPGlobusAdminDebug){var e={init:function(e){setTimeout(function(){u('<a name="debug-box"></a>').appendTo("#wpwrap"),u("#wpglobus-admin-debug-box").detach().appendTo("#wpwrap"),u("#wpglobus-admin-debug-box").css({display:"block"})},1e3),setTimeout(function(){var e=0,u=0,n=jQuery("#wpglobus-admin-debug-box .table1");1==n.length&&(e=(u=1*n.css("height").replace("px",""))+50);var b=jQuery("#wpglobus-admin-debug-box .table2");1==b.length&&(b.css({"margin-top":e+"px"}),e=u+1*b.css("height").replace("px","")+100);var i=jQuery("#wpglobus-admin-debug-box .table3");1==i.length&&i.css({"margin-top":e+"px"})},1200)}};WPGlobusAdminDebug=u.extend({},WPGlobusAdminDebug,e),WPGlobusAdminDebug.init()}}(jQuery);
1
+ !function(u){"use strict";if("undefined"!=typeof WPGlobusAdminDebug){var e={init:function(e){setTimeout(function(){u('<a name="debug-box"></a>').appendTo("#wpwrap"),u("#wpglobus-admin-debug-box").detach().appendTo("#wpwrap"),u("#wpglobus-admin-debug-box").css({display:"block"})},1e3),setTimeout(function(){var e=0,u=0,n=jQuery("#wpglobus-admin-debug-box .table1");1==n.length&&(e=(u=+n.css("height").replace("px",""))+50);var b=jQuery("#wpglobus-admin-debug-box .table2");1==b.length&&(b.css({"margin-top":e+"px"}),e=u+ +b.css("height").replace("px","")+100);var i=jQuery("#wpglobus-admin-debug-box .table3");1==i.length&&i.css({"margin-top":e+"px"})},1200)}};WPGlobusAdminDebug=u.extend({},WPGlobusAdminDebug,e),WPGlobusAdminDebug.init()}}(jQuery);
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,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,e){c.each(a,function(t,a){!function(t,a){var e,o=c("#"+t),n=o.clone(),i=o.attr("name"),l="wpglobus-element wpglobus-element_"+t+" wpglobus-element_"+a+" wpglobus-translatable";e=(e=document.getElementById(t)).nodeName,c(n).attr("id",t+"_"+a),c(n).attr("name",i+"_"+a),a!==WPGlobusCoreData.default_language&&(l+=" hidden"),c(n).attr("class",l),c(n).attr("data-save-to",t),c(n).attr("data-language",a),"INPUT"==e?c(n).attr("value",c("#wpglobus-link-tab-"+a).data(t)):"TEXTAREA"==e&&c(n).text(c("#wpglobus-link-tab-"+a).data(t)),o.addClass("hidden"),0==c(".wpglobus-element_"+t).size()?c(n).insertAfter(o):c(n).insertAfter(c(".wpglobus-element_"+t).last())}(a,e)})}),c(".wpglobus-taxonomy-tabs").insertAfter("#ajax-response"),c(".wrap").tabs(),c("body").on("click",".wpglobus-taxonomy-tabs li",function(t){var a=c(this).data("language");c(".wpglobus-element").addClass("hidden"),c(".wpglobus-element_"+a).removeClass("hidden")}),c(".wpglobus-element").on("change",function(){var n=c(this).data("save-to"),i="";c(".wpglobus-element").each(function(t,a){var e=c(a),o=e.val();e.data("save-to")==n&&""!==o&&(i+=WPGlobusCore.addLocaleMarks(o,e.data("language")))}),c("#"+n).val(i)})},nav_menus:function(){function e(){n!==c(i).size()&&(clearInterval(o),c(i).each(function(t,a){var 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")}}))}var o,n,i="#menu-to-edit .menu-item";c.ajaxSetup({beforeSend:function(t,a){void 0!==a.data&&0<=a.data.indexOf("action=add-menu-item")&&(n=c(i).size(),o=setInterval(e,500))}}),c(i).each(function(t,a){var e=c(a).attr("id"),u=e.replace("menu-item-","");c.each(["input.edit-menu-item-title","input.edit-menu-item-attr-title"],function(n,i){var l=c("#"+e+" "+i);l.val()!=WPGlobusAdmin.data.items[u][i].source&&l.val(WPGlobusAdmin.data.items[u][i].source);var s=c("#"+e+" "+i).parents("p"),d=0;c.each(WPGlobusAdmin.data.open_languages,function(t,a){var e=l.clone();e.attr("id",l.attr("id")+"-"+a),e.attr("name",l.attr("id")+"-"+a),e.attr("data-language",a),e.attr("data-item-id",u),e.attr("placeholder",WPGlobusAdmin.data.en_language_name[a]);var o=WPGlobusAdmin.data.items[u][a][i].class;0===n&&a===WPGlobusAdmin.data.default_language?e.attr("class",o+" edit-menu-item-title"):e.attr("class",o),""!=WPGlobusAdmin.data.items[u][a][i].caption?e.attr("value",WPGlobusAdmin.data.items[u][a][i].caption):e.attr("value",""),e.css("margin-bottom","0.6em"),c(s).append(e),d=t}),d=40*(d+1),l.css("display","none").attr("class","").addClass("widefat wpglobus-hidden"),c(s).css("height",d+"px").addClass("wpglobus-menu-item-box")}),c(a).addClass("wpglobus-menu-item")}),c(".menus-move-left, .menus-move-right").each(function(t,a){var e,o=c(a),n=(o.parents("li").attr("id").replace("menu-item-",""),o.attr("title"));void 0!==n&&c.each(WPGlobusAdmin.data.post_titles,function(t,a){0<=n.indexOf(t)&&(e=n.replace(t,a),o.attr("title",e),o.text(e))})}),c(".edit-menu-item-title").trigger("change"),wpNavMenu.refreshAdvancedAccessibility(),wpNavMenu.menusChanged=!1,c(".wpglobus-menu-item").on("change",function(){var t,a,e=c(this),o=e.data("item-id");e.hasClass("wpglobus-item-title")&&(t=WPGlobusCore.getString(c("input#edit-menu-item-title-"+o).val(),e.val(),e.data("language")),void 0!==(a=c(document).triggerHandler("wpglobus_get_menu_translations",{string:t,lang:WPGlobusCoreData.open_languages,id:o,type:"input.edit-menu-item-title"}))&&(t=a),c("input#edit-menu-item-title-"+o).val(t)),e.hasClass("wpglobus-item-attr")&&(t=WPGlobusCore.getString(c("input#edit-menu-item-attr-title-"+o).val(),e.val(),e.data("language")),void 0!==(a=c(document).triggerHandler("wpglobus_get_menu_translations",{string:t,lang:WPGlobusCoreData.open_languages,id:o,type:"input.edit-menu-item-attr-title"}))&&(t=a),c("input#edit-menu-item-attr-title-"+o).val(t))})},post_edit:function(){c(document).on("heartbeat-send",function(t,o){void 0!==o.wp_autosave&&(o.wpglobus_heartbeat="wpglobus",c.each(WPGlobusAdmin.data.open_languages,function(t,a){var e=c("#title_"+a).val()||"";""!=(e=c.trim(e))&&(o.wp_autosave["post_title_"+a]=e),e=c("#content_"+a).val()||"",""!=(e=c.trim(e))&&(o.wp_autosave["content_"+a]=e)}))});var 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="";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(){function e(){n!==c(i).size()&&(clearInterval(o),c(i).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")}}))}var o,n,i="#menu-to-edit .menu-item";c.ajaxSetup({beforeSend:function(t,a){void 0!==a.data&&0<=a.data.indexOf("action=add-menu-item")&&(n=c(i).size(),o=setInterval(e,500))}}),c(i).each(function(t,a){var e=c(a).attr("id"),u=e.replace("menu-item-","");c.each(["input.edit-menu-item-title","input.edit-menu-item-attr-title"],function(n,i){var l=c("#"+e+" "+i);l.val()!=WPGlobusAdmin.data.items[u][i].source&&l.val(WPGlobusAdmin.data.items[u][i].source);var s=c("#"+e+" "+i).parents("p"),d=0;c.each(WPGlobusAdmin.data.open_languages,function(t,a){var e=l.clone();e.attr("id",l.attr("id")+"-"+a),e.attr("name",l.attr("id")+"-"+a),e.attr("data-language",a),e.attr("data-item-id",u),e.attr("placeholder",WPGlobusAdmin.data.en_language_name[a]);var o=WPGlobusAdmin.data.items[u][a][i].class;0===n&&a===WPGlobusAdmin.data.default_language?e.attr("class",o+" edit-menu-item-title"):e.attr("class",o),""!=WPGlobusAdmin.data.items[u][a][i].caption?e.attr("value",WPGlobusAdmin.data.items[u][a][i].caption):e.attr("value",""),e.css("margin-bottom","0.6em"),c(s).append(e),d=t}),d=40*(d+1),l.css("display","none").attr("class","").addClass("widefat wpglobus-hidden"),c(s).css("height",d+"px").addClass("wpglobus-menu-item-box")}),c(a).addClass("wpglobus-menu-item")}),c(".menus-move-left, .menus-move-right").each(function(t,a){var e,o=c(a),n=(o.parents("li").attr("id").replace("menu-item-",""),o.attr("title"));void 0!==n&&c.each(WPGlobusAdmin.data.post_titles,function(t,a){0<=n.indexOf(t)&&(e=n.replace(t,a),o.attr("title",e),o.text(e))})}),c(".edit-menu-item-title").trigger("change"),wpNavMenu.refreshAdvancedAccessibility(),wpNavMenu.menusChanged=!1,c(".wpglobus-menu-item").on("change",function(){var t,a,e=c(this),o=e.data("item-id");e.hasClass("wpglobus-item-title")&&(t=WPGlobusCore.getString(c("input#edit-menu-item-title-"+o).val(),e.val(),e.data("language")),void 0!==(a=c(document).triggerHandler("wpglobus_get_menu_translations",{string:t,lang:WPGlobusCoreData.open_languages,id:o,type:"input.edit-menu-item-title"}))&&(t=a),c("input#edit-menu-item-title-"+o).val(t)),e.hasClass("wpglobus-item-attr")&&(t=WPGlobusCore.getString(c("input#edit-menu-item-attr-title-"+o).val(),e.val(),e.data("language")),void 0!==(a=c(document).triggerHandler("wpglobus_get_menu_translations",{string:t,lang:WPGlobusCoreData.open_languages,id:o,type:"input.edit-menu-item-attr-title"}))&&(t=a),c("input#edit-menu-item-attr-title-"+o).val(t))})},post_edit:function(){c(document).on("heartbeat-send",function(t,o){void 0!==o.wp_autosave&&(o.wpglobus_heartbeat="wpglobus",c.each(WPGlobusAdmin.data.open_languages,function(t,a){var e=c("#title_"+a).val()||"";""!=(e=c.trim(e))&&(o.wp_autosave["post_title_"+a]=e),e=c("#content_"+a).val()||"",""!=(e=c.trim(e))&&(o.wp_autosave["content_"+a]=e)}))});var 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="";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-form.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(document).ready(function(e){"use strict";var u=/^[a-z]{2}$/,t=e("#wpglobus_language_code"),a=e("#wpglobus_language_name"),n=e("#wpglobus_en_language_name"),o=e([]).add(t).add(a).add(n);e("#wpglobus_edit_form").on("submit",function(e){var a=!0;o.removeClass("wpglobus-state-error"),(a=a&&function(e,a){return!!a.test(e.val())||(e.addClass("wpglobus-state-error"),!1)}(t,u))||e.preventDefault()})});
1
+ jQuery(document).ready(function(a){"use strict";var u=/^[a-z]{2}$/,o=a("#wpglobus_language_code"),e=a("#wpglobus_language_name"),s=a("#wpglobus_en_language_name"),t=a([]).add(o).add(e).add(s);a("#wpglobus_edit_form").on("submit",function(a){var e,s=!0;t.removeClass("wpglobus-state-error"),(s=s&&(!!u.test((e=o).val())||(e.addClass("wpglobus-state-error"),!1)))||a.preventDefault()})});
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)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}});
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&&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)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}});
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&&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)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}});
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&&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)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}});
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&&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)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}});
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&&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)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}});
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&&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)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}});
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&&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)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}});
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&&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)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}});
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&&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)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}});
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&&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}});
includes/vendor/pods/class-wpglobus-vendor-pods-front.php ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * class-wpglobus-vendor-pods-front.php
4
+ *
5
+ * @since 2.3.0
6
+ *
7
+ * @package WPGlobus\Vendor\Pods.
8
+ * @author Alex Gor(alexgff)
9
+ */
10
+
11
+ /**
12
+ * Class WPGlobus_Vendor_Pods_Front.
13
+ */
14
+
15
+ if ( ! class_exists( 'WPGlobus_Vendor_Pods_Front' ) ) :
16
+
17
+ class WPGlobus_Vendor_Pods_Front {
18
+
19
+ public static function controller() {
20
+
21
+ /**
22
+ * @scope front.
23
+ */
24
+ add_filter( 'wpglobus_multilingual_meta_keys', array( __CLASS__, 'filter__multilingual_meta_keys' ), 5 );
25
+ }
26
+
27
+ /**
28
+ * Specify meta keys where the meta data can be multilingual.
29
+ */
30
+ public static function filter__multilingual_meta_keys( $multilingual_meta_keys ) {
31
+
32
+ $pods = pods_api()->load_pods( array( 'type' => 'post_type', 'fields' => true ) );
33
+
34
+ if ( empty( $pods ) ) {
35
+ return $multilingual_meta_keys;
36
+ }
37
+
38
+ foreach( $pods as $key=>$pod ) {
39
+
40
+ if ( ! empty( $pod ) ) {
41
+ $_fields = $pod['fields'];
42
+ if ( ! empty( $_fields ) ) {
43
+ foreach( $_fields as $_key=>$_attrs ) {
44
+ $multilingual_meta_keys[$_key] = true;
45
+ }
46
+ }
47
+ }
48
+ }
49
+
50
+ return $multilingual_meta_keys;
51
+ }
52
+
53
+ }
54
+
55
+ endif;
56
+
57
+ # --- EOF
includes/vendor/pods/class-wpglobus-vendor-pods.php ADDED
@@ -0,0 +1,141 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * File: class-wpglobus-vendor-pods.php
4
+ *
5
+ * @since 2.3.0
6
+ *
7
+ * @package WPGlobus\Vendor\Pods.
8
+ * @author Alex Gor(alexgff)
9
+ */
10
+ /**
11
+ * Class WPGlobus_Vendor_Pods.
12
+ */
13
+ if ( ! class_exists( 'WPGlobus_Vendor_Pods' ) ) :
14
+
15
+ class WPGlobus_Vendor_Pods {
16
+
17
+ protected static $post_meta_fields = null;
18
+
19
+ /**
20
+ * List of fields to add `wpglobus-translatable` class.
21
+ */
22
+ protected static $post_multilingual_fields = null;
23
+
24
+ protected static $field_type = '_pods_field';
25
+
26
+ protected static $meta_field_name_prefix = 'pods_meta_';
27
+
28
+ /**
29
+ * @var object Instance of this class.
30
+ */
31
+ protected static $instance;
32
+
33
+ /**
34
+ * Constructor.
35
+ */
36
+ protected function __construct() {}
37
+
38
+ /**
39
+ * Get instance of this class.
40
+ *
41
+ * @return WPGlobus_Vendor_Pods
42
+ */
43
+ public static function get_instance() {
44
+ if ( ! ( self::$instance instanceof WPGlobus_Vendor_Pods ) ) {
45
+ self::$instance = new self();
46
+ }
47
+
48
+ return self::$instance;
49
+ }
50
+
51
+ /**
52
+ * Get multilingual fields.
53
+ */
54
+ public static function get_post_multilingual_fields() {
55
+ if ( is_null( self::$post_multilingual_fields ) ) {
56
+ return false;
57
+ }
58
+
59
+ return self::$post_multilingual_fields;
60
+ }
61
+
62
+ /**
63
+ * Get post meta.
64
+ *
65
+ * Don't call WPGlobus::Config() inside function to prevent the resetting of `meta` property.
66
+ *
67
+ * @param $post_id
68
+ * @param string $post_type
69
+ *
70
+ * @return array
71
+ */
72
+ public static function get_post_meta_fields( $post_id, $post_type = 'post' ) {
73
+
74
+ global $wpdb;
75
+
76
+ $post_id = (int) $post_id;
77
+
78
+ $default_fields = array(
79
+ 'paragraph',
80
+ 'text',
81
+ 'website',
82
+ );
83
+
84
+ if ( $post_id > 0 ) {
85
+
86
+ /**
87
+ * @todo may be use pods_api() @see includes\builders\pods\class-wpglobus-builder-pods.php
88
+ * @since 2.3.0
89
+ */
90
+
91
+ $fields = $wpdb->get_results( $wpdb->prepare(
92
+ "SELECT p.post_name AS name, p.ID, p.post_title AS title, p.post_parent AS parent, pm.meta_value AS type FROM $wpdb->posts as p
93
+ LEFT JOIN $wpdb->postmeta AS pm ON pm.post_id = p.ID WHERE p.post_type = %s AND p.post_status = 'publish' AND pm.meta_key = 'type'",
94
+ self::$field_type
95
+ ), OBJECT_K );
96
+
97
+ if ( ! empty( $fields ) ) {
98
+
99
+ self::$post_meta_fields = array();
100
+ self::$post_multilingual_fields = array();
101
+
102
+ foreach ( $fields as $key => $field ) :
103
+
104
+ if ( 'wysiwyg' == $field->type ) {
105
+ // wysiwyg field is enabled be default.
106
+ if ( true ) {
107
+ self::$post_meta_fields[$key] = $key;
108
+ }
109
+ } else if ( '____some_value____' == $field->type ) {
110
+ // @todo W.I.P.
111
+ } else if ( in_array( $field->type, $default_fields ) ) {
112
+ self::$post_meta_fields[$key] = $key;
113
+ self::$post_multilingual_fields[$key] = self::$meta_field_name_prefix . $key;
114
+ } else {
115
+ //
116
+ }
117
+
118
+ endforeach;
119
+ }
120
+ }
121
+
122
+ return self::$post_meta_fields;
123
+ }
124
+
125
+ /**
126
+ * Check 3rd party plugin to enable/disable field.
127
+ *
128
+ * @param array $field
129
+ *
130
+ * @return bool
131
+ */
132
+ protected static function get_3rd_party_field_status( $field ) {
133
+ // @see wpglobus\includes\vendor\acf\class-wpglobus-acf.php for example.
134
+ return true;
135
+ }
136
+
137
+ }
138
+
139
+ endif;
140
+
141
+ # --- EOF
includes/vendor/wpglobus-vendors.php CHANGED
@@ -1,7 +1,8 @@
1
  <?php
2
  /**
3
  * @package WPGlobus\Vendor
4
- *
 
5
  * @since 1.9.17
6
  */
7
 
@@ -13,6 +14,15 @@ if ( defined( 'AIOSEOP_VERSION' ) ) {
13
  WPGlobus_All_in_One_SEO_Pack::get_instance();
14
  }
15
 
 
 
 
 
 
 
 
 
 
16
  /**
17
  * ACF.
18
  * https://wordpress.org/plugins/advanced-custom-fields/
@@ -25,5 +35,4 @@ if ( $this->is_script_active('ACF') || $this->is_script_active('ACFPRO') ) {
25
  }
26
  // */
27
 
28
-
29
  # --- EOF
1
  <?php
2
  /**
3
  * @package WPGlobus\Vendor
4
+ *
5
+ * We start this file to support the plugins/add-ons in builder mode.
6
  * @since 1.9.17
7
  */
8
 
14
  WPGlobus_All_in_One_SEO_Pack::get_instance();
15
  }
16
 
17
+ /**
18
+ * Pods.
19
+ * @since 2.3.0
20
+ */
21
+ if ( defined( 'PODS_VERSION' ) ) {
22
+ require_once( dirname( __FILE__ ) . '/pods/class-wpglobus-vendor-pods.php' );
23
+ WPGlobus_Vendor_Pods::get_instance();
24
+ }
25
+
26
  /**
27
  * ACF.
28
  * https://wordpress.org/plugins/advanced-custom-fields/
35
  }
36
  // */
37
 
 
38
  # --- EOF
includes/wpglobus-controller.php CHANGED
@@ -489,4 +489,18 @@ if ( function_exists( '__mc4wp_flush' ) || function_exists( '_mc4wp_load_plugin'
489
  WPGlobus_MailChimp_For_WP::controller();
490
  }
491
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
492
  /*EOF*/
489
  WPGlobus_MailChimp_For_WP::controller();
490
  }
491
 
492
+ if ( function_exists('pods_api') ) {
493
+
494
+ /**
495
+ * Pods – Custom Content Types and Fields.
496
+ * https://wordpress.org/plugins/pods/
497
+ *
498
+ * @since 2.3.0
499
+ */
500
+ if ( ! is_admin() ) {
501
+ require_once dirname( __FILE__ ) . '/vendor/pods/class-wpglobus-vendor-pods-front.php';
502
+ WPGlobus_Vendor_Pods_Front::controller();
503
+ }
504
+ }
505
+
506
  /*EOF*/
languages/wpglobus.pot CHANGED
@@ -1,8 +1,8 @@
1
- # Copyright (C) 2020 WPGlobus 2.2.35
2
- # This file is distributed under the same license as the WPGlobus 2.2.35 package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: WPGlobus 2.2.35\n"
6
  "MIME-Version: 1.0\n"
7
  "Content-Type: text/plain; charset=UTF-8\n"
8
  "Content-Transfer-Encoding: 8bit\n"
1
+ # Copyright (C) 2020 WPGlobus 2.3.0
2
+ # This file is distributed under the same license as the WPGlobus 2.3.0 package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: WPGlobus 2.3.0\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,10 @@ WPGlobus Version 2 supports WordPress 5.x, with Gutenberg.
218
 
219
  == Changelog ==
220
 
 
 
 
 
221
  = 2.2.35 =
222
 
223
  * Added: (Core/Builders) `WPGlobus_Builder_Update_Post` class.
218
 
219
  == Changelog ==
220
 
221
+ = 2.3.0 =
222
+
223
+ * Added: (Builders/Pods) Support (partially - Standard and Custom Post Types) `Pods – Custom Content Types and Fields`.
224
+
225
  = 2.2.35 =
226
 
227
  * Added: (Core/Builders) `WPGlobus_Builder_Update_Post` class.
wpglobus.php CHANGED
@@ -15,7 +15,7 @@
15
  * Description: A WordPress Globalization / Multilingual Plugin. Posts, pages, menus, widgets and even custom fields - in multiple languages!
16
  * Text Domain: wpglobus
17
  * Domain Path: /languages/
18
- * Version: 2.2.35
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', '2.2.35' );
46
  define( 'WPGLOBUS_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
47
  define( 'WPGLOBUS_AJAX', 'wpglobus-ajax' );
48
 
15
  * Description: A WordPress Globalization / Multilingual Plugin. Posts, pages, menus, widgets and even custom fields - in multiple languages!
16
  * Text Domain: wpglobus
17
  * Domain Path: /languages/
18
+ * Version: 2.3.0
19
  * Author: WPGlobus
20
  * Author URI: https://wpglobus.com/
21
  * Network: false
42
  exit;
43
  }
44
 
45
+ define( 'WPGLOBUS_VERSION', '2.3.0' );
46
  define( 'WPGLOBUS_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
47
  define( 'WPGLOBUS_AJAX', 'wpglobus-ajax' );
48