mirror of
https://github.com/WordPress/WordPress.git
synced 2024-08-22 05:43:45 +02:00
This updates the 4.8 branch to support the latest LTS version of NodeJS (currently 14.x), allowing the same version to be used across all WordPress branches that receive security updates as a courtesy. This also replaces the `npm-shrinkwrap.json` with a `package-lock.json` file. Lock files were not supported in earlier versions of NPM, but can now be used. In addition to backporting the package updates that happened after branching 4.8, dependencies that were removed in future releases have also been updated to their latest versions. Props desrosj, dd32, netweb, jorbin. Merges [42460-42461,42463,42887,43320,43323,43977,44219,44233,44728,45321,45765,46404,46408-46409,47404,47867-47869,47872-47873,48705,49636,49933,49937,49939,50017,50126,50176,50185,50192] to the 4.8 branch. See #52341. Built from https://develop.svn.wordpress.org/branches/4.8@50203 git-svn-id: http://core.svn.wordpress.org/branches/4.8@49877 1a063a9b-81f0-0310-95a4-ce76da25c4cd
1 line
1.6 KiB
JavaScript
1 line
1.6 KiB
JavaScript
!function(o,a){"use strict";var e=o.MediaWidgetModel.extend({}),t=o.MediaWidgetControl.extend({renderPreview:function(){var e,t,o=this;(o.model.get("attachment_id")||o.model.get("url"))&&(e=o.$el.find(".media-widget-preview"),t=wp.template("wp-media-widget-image-preview"),e.html(t(_.extend(o.previewTemplateProps.toJSON()))))},editMedia:function(){var t,e,o=this,i=o.mapModelToMediaFrameProps(o.model.toJSON());"none"===i.link&&(i.linkUrl=""),(t=wp.media({frame:"image",state:"image-details",metadata:i})).$el.addClass("media-widget"),i=function(){var e=t.state().attributes.image.toJSON();o.selectedAttachment.set(e),o.model.set(_.extend(o.mapMediaToModelProps(e),{error:!1}))},t.state("image-details").on("update",i),t.state("replace-image").on("replace",i),e=wp.media.model.Attachment.prototype.sync,wp.media.model.Attachment.prototype.sync=function(){return a.Deferred().rejectWith(this).promise()},t.on("close",function(){t.detach(),wp.media.model.Attachment.prototype.sync=e}),t.open()},getEmbedResetProps:function(){return _.extend(o.MediaWidgetControl.prototype.getEmbedResetProps.call(this),{size:"full",width:0,height:0})},getModelPropsFromMediaFrame:function(e){return _.omit(o.MediaWidgetControl.prototype.getModelPropsFromMediaFrame.call(this,e),"image_title")},mapModelToPreviewTemplateProps:function(){var e=this.model.get("url"),t=o.MediaWidgetControl.prototype.mapModelToPreviewTemplateProps.call(this);return t.currentFilename=e?e.replace(/\?.*$/,"").replace(/^.+\//,""):"",t}});o.controlConstructors.media_image=t,o.modelConstructors.media_image=e}(wp.mediaWidgets,jQuery); |