!function(a){a.ajaxPrefilter(function(t,n,e){-1!==t.url.indexOf("action=ajax-tag-search")&&((lang=a(".post_lang_choice").val())||(lang=a(':input[name="inline_lang_choice"]').val()))&&(t.data="lang="+lang+"&"+t.data)})}(jQuery),function(a){tagBox.get=function(t){var n=t.substr(t.indexOf("-")+1),e={action:"get-tagcloud",lang:a(".post_lang_choice").val(),tax:n};a.post(ajaxurl,e,function(e,i){(0==e||"success"!=i)&&(e=wpAjax.broken),e=a('
'+e+"
"),a("a",e).click(function(){return tagBox.flushTags(a(this).closest(".inside").children(".tagsdiv"),this),!1}),(v=a(".the-tagcloud").css("display"))?(a(".the-tagcloud").replaceWith(e),a(".the-tagcloud").css("display",v)):a("#"+t).after(e)})}}(jQuery),function(a){a(document).bind("DOMNodeInserted",function(t){function n(t){"undefined"!=typeof pll_term_languages&&a.each(pll_term_languages,function(n,e){a.each(e,function(e,i){a.each(i,function(i){id="#"+e+"-"+pll_term_languages[n][e][i],t==n?a(id).show():a(id).hide()})})})}function e(t){"undefined"!=typeof pll_page_languages&&a.each(pll_page_languages,function(n,e){a.each(e,function(e){v=a('#post_parent option[value="'+pll_page_languages[n][e]+'"]'),t==n?v.show():v.hide()})})}var i=a(t.target);if("inline-edit"==i.attr("id")){var l=i.prev().attr("id").replace("post-","");if(l>0){var s=i.find(':input[name="inline_lang_choice"]'),o=a("#lang_"+l).html();s.val(o),n(o),e(o),s.change(function(){n(a(this).val()),e(a(this).val())})}}})}(jQuery),function(a){a(document).ajaxSuccess(function(t,n,e){function i(t){var n=new Array;a(".translation_"+t).each(function(){n.push(a(this).parent().parent().attr("id").substring(5))});var e={action:"pll_update_post_rows",post_id:t,translations:n.join(","),post_type:a("input[name='post_type']").val(),screen:a("input[name='screen']").val(),_pll_nonce:a("input[name='_inline_edit']").val()};a.post(ajaxurl,e,function(t){if(t){var n=wpAjax.parseAjaxResponse(t,"ajax-response");a.each(n.responses,function(){"row"==this.what&&a("#post-"+this.supplemental.post_id).replaceWith(this.data)})}})}var l=wpAjax.unserialize(e.data);"undefined"!=typeof l.action&&"inline-save"==l.action&&i(l.post_ID)})}(jQuery),jQuery(document).ready(function(a){function t(){a(".tr_lang").each(function(){var t=a(this).attr("id").substring(8),n=a(this).parent().siblings(".pll-edit-column");a(this).autocomplete({minLength:0,source:ajaxurl+"?action=pll_posts_not_translated&post_language="+a(".post_lang_choice").val()+"&translation_language="+t+"&post_type="+a("#post_type").val()+"&_pll_nonce="+a("#_pll_nonce").val(),select:function(e,i){a("#htr_lang_"+t).val(i.item.id),n.html(i.item.link)}}),a(this).blur(function(){a(this).val()||(a("#htr_lang_"+t).val(0),n.html(n.siblings(".hidden").children().clone()))})})}var n=new Array;a(".categorydiv").each(function(){var t,e,i=a(this).attr("id");t=i.split("-"),t.shift(),e=t.join("-"),n.push(e),a("#"+e+"-add-submit").before(a("").attr("type","hidden").attr("id",e+"-lang").attr("name","term_lang_choice").attr("value",a(".post_lang_choice").val()))}),a(".post_lang_choice").change(function(){var e={action:"post_lang_choice",lang:a(this).val(),post_type:a("#post_type").val(),taxonomies:n,post_id:a("#post_ID").val(),_pll_nonce:a("#_pll_nonce").val()};a.post(ajaxurl,e,function(n){var e=wpAjax.parseAjaxResponse(n,"ajax-response");a.each(e.responses,function(){switch(this.what){case"translations":a(".translations").html(this.data),t();break;case"taxonomy":var n=this.data;a("#"+n+"checklist").html(this.supplemental.all),a("#"+n+"checklist-pop").html(this.supplemental.populars),a("#new"+n+"_parent").replaceWith(this.supplemental.dropdown),a("#"+n+"-lang").val(a(".post_lang_choice").val());break;case"pages":a("#parent_id").html(this.data);break;case"flag":a(".pll-select-flag").html(this.data);break;case"permalink":var e=a("#edit-slug-box");"-1"!=this.data&&e.children().length&&e.html(this.data)}}),a(".tagcloud-link").each(function(){var t=a(this).attr("id");tagBox.get(t)})})}),t()});