wp-seo-premium-quickedit-notification-352.min.js 2.87 KB
!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){"use strict";function d(){jQuery.post(ajaxurl,{action:"yoast_get_notifications"},function(a){if(""!==a){var b=jQuery(".wrap").children().eq(0);jQuery(a).insertAfter(b),m=0}m<20&&""===a&&(m++,setTimeout(d,500))})}function e(){return jQuery(location).attr("pathname").split("/").pop()}function f(){var a=i(),b=e();return"edit.php"===b?jQuery("#inline_"+a).find(".post_name").html():"edit-tags.php"===b?jQuery("#inline_"+a).find(".slug").html():""}function g(){var a=h(),b=f(),c=a.find("input[name=post_name]").val();return b!==c}function h(){return jQuery("tr.inline-editor")}function i(){var a=h();return""===a?"":a.attr("id").replace("edit-","")}function j(a){13===a.which&&g()&&d()}function k(a){"save-order"!==jQuery(a.target).attr("id")&&g()&&d()}var l=a("./redirects/functions"),m=0;window.wpseo_show_notification=d,window.wpseo_get_current_page=e,window.wpseo_get_current_slug=f,window.wpseo_slug_changed=g,window.wpseo_get_active_editor=h,window.wpseo_get_item_id=i,window.wpseo_handle_key_events=j,window.wpseo_handle_button_events=k,window.wpseo_undo_redirect=l.wpseo_undo_redirect,window.wpseo_create_redirect=l.wpseo_create_redirect,jQuery(function(){var a=e();"edit.php"!==a&&"edit-tags.php"!==a||(jQuery("#inline-edit input").on("keydown",function(a){j(a)}),jQuery(".button-primary").click(function(a){k(a)}))})},{"./redirects/functions":2}],2:[function(a,b,c){"use strict";function d(a,b,c,d,e){jQuery.post(ajaxurl,{action:"wpseo_delete_redirect_plain",ajax_nonce:d,redirect:{origin:a,target:b,type:c}},function(){jQuery(e).closest(".yoast-alert").fadeOut("slow")})}function e(a,b,c,d){var e="";return 410!==parseInt(b,10)&&(e=window.prompt(wpseo_premium_strings.enter_new_url.replace("%s",a)),""===e)?void window.alert(wpseo_premium_strings.error_new_url):void jQuery.post(ajaxurl,{action:"wpseo_add_redirect_plain",ajax_nonce:c,redirect:{origin:a,target:e,type:b}},function(a){var c=jQuery(d).closest(".yoast-alert");if(jQuery(c).removeClass("updated").removeClass("error"),jQuery(c).find(".redirect_error").remove(),a.error)return void jQuery(c).addClass("error").prepend('<p class="redirect_error">'+a.error.message+"</p>");var e="";e=410===parseInt(b,10)?wpseo_premium_strings.redirect_saved_no_target:wpseo_premium_strings.redirect_saved.replace("%2$s","<code>"+a.target+"</code>"),e=e.replace("%1$s","<code>"+a.origin+"</code>"),jQuery(c).addClass("updated").html("<p>"+e+"</p>")},"json")}b.exports={wpseo_create_redirect:e,wpseo_undo_redirect:d}},{}]},{},[1]);