wp-seo-featured-image-350.min.js 2.33 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(a){}function e(){}function f(){}!function(a){function b(){a("#yst_opengraph_image_warning").remove(),a("#postimagediv").css("border","none")}function c(c){var d=c.state().get("selection").first().toJSON();if(d.width<200||d.height<200){if(0===a("#yst_opengraph_image_warning").length){var e=a("#postimagediv");a('<div id="yst_opengraph_image_warning"><p>'+wpseoFeaturedImageL10n.featured_image_notice+"</p></div>").insertBefore(e),e.css({border:"solid #dd3d36",borderWidth:"3px 4px 4px 4px"})}}else b()}var d,e,f=function(a){this._app=a,this.featuredImage=null,this.pluginName="addFeaturedImagePlugin",this.registerPlugin(),this.registerModifications()};f.prototype.setFeaturedImage=function(a){this.featuredImage=a,this._app.pluginReloaded(this.pluginName)},f.prototype.removeFeaturedImage=function(){this.setFeaturedImage(null)},f.prototype.registerPlugin=function(){this._app.registerPlugin(this.pluginName,{status:"ready"})},f.prototype.registerModifications=function(){this._app.registerModification("content",this.addImageToContent.bind(this),this.pluginName,10)},f.prototype.addImageToContent=function(a){return null!==this.featuredImage&&(a+=this.featuredImage),a},a(document).ready(function(){var g=wp.media.featuredImage.frame();d=new f(YoastSEO.app),g.on("select",function(){var a,b,e;c(g),b=g.state().get("selection").first(),e=b.get("alt"),""===e&&(e=b.get("title")),a='<img src="'+b.get("url")+'" width="'+b.get("width")+'" height="'+b.get("height")+'" alt="'+e+'"/>',d.setFeaturedImage(a)}),a("#postimagediv").on("click","#remove-post-thumbnail",function(){d.removeFeaturedImage(),b()}),e=a("#set-post-thumbnail > img"),"undefined"!=typeof e.prop("src")&&d.setFeaturedImage(a("#set-post-thumbnail ").html())})}(jQuery);var g,h=0;window.yst_checkFeaturedImage=d,window.thumbIdCounter=h,window.removeThumb=g,window.yst_overrideElemFunction=e,window.yst_removeOpengraphWarning=f},{}]},{},[1]);