var editPermalink,makeSlugeditClickable;(function(a){if(!a("#edit-slug-box").length){return}editPermalink=function(d){var f,j=0,h=a("#editable-post-name"),k=h.html(),n=a("#post_name"),o=n.val(),l=a("#edit-slug-buttons"),m=l.html(),g=a("#editable-post-name-full").html();a("#view-post-btn").hide();l.html(''+samplePermalinkL10n.ok+' '+samplePermalinkL10n.cancel+"");l.children(".save").click(function(){var b=h.children("input").val();if(b==a("#editable-post-name-full").text()){return a(".cancel","#edit-slug-buttons").click()}a.post(ajaxurl,{action:"sample-permalink",post_id:d,new_slug:b,new_title:a("#title").val(),screen:pagenow,samplepermalinknonce:a("#samplepermalinknonce").val()},function(c){a("#edit-slug-box").html(c);l.html(m);n.val(b);makeSlugeditClickable();a("#view-post-btn").show()});return false});a(".cancel","#edit-slug-buttons").click(function(){a("#view-post-btn").show();h.html(k);l.html(m);n.val(o);return false});for(f=0;fg.length/4)?"":g;h.html('').children("input").keypress(function(c){var b=c.keyCode||0;if(13==b){l.children(".save").click();return false}if(27==b){l.children(".cancel").click();return false}n.val(this.value)}).focus()};makeSlugeditClickable=function(){a("#editable-post-name").click(function(){a("#edit-slug-buttons").children(".edit-slug").click()})};makeSlugeditClickable()})(jQuery);