mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-08 11:50:03 +01:00
0e21d32900
This upgrades a number of devDependencies. Some of these include changes to how the tasks are configured. Uglify: There are deprecated options from 2.x to 4.x, see: https://github.com/gruntjs/grunt-contrib-uglify#options Autoprefixer: Browserslist now warns when passing in the browser list, so that is put into package.json As with most changes to uglify, this changes every minified JS file. Fixes #48203. Built from https://develop.svn.wordpress.org/trunk@46408 git-svn-id: http://core.svn.wordpress.org/trunk@46206 1a063a9b-81f0-0310-95a4-ce76da25c4cd
1 line
1.6 KiB
JavaScript
1 line
1.6 KiB
JavaScript
tinymce.PluginManager.add("wpgallery",function(d){function t(e){return e.replace(/\[gallery([^\]]*)\]/g,function(e){return function(e,t){return t=window.encodeURIComponent(t),'<img src="'+tinymce.Env.transparentSrc+'" class="wp-media mceItem '+e+'" data-wp-media="'+t+'" data-mce-resize="false" data-mce-placeholder="1" alt="" />'}("wp-gallery",e)})}function n(e){return e.replace(/(?:<p(?: [^>]+)?>)*(<img [^>]+>)(?:<\/p>)*/g,function(e,t){var n=function(e,t){return(t=new RegExp(t+'="([^"]+)"').exec(e))?window.decodeURIComponent(t[1]):""}(t,"data-wp-media");return n?"<p>"+n+"</p>":e})}function o(n){var a,o,e;"IMG"===n.nodeName&&"undefined"!=typeof wp&&wp.media&&(e=window.decodeURIComponent(d.dom.getAttrib(n,"data-wp-media")),d.dom.hasClass(n,"wp-gallery")&&wp.media.gallery&&(a=wp.media.gallery,(o=a.edit(e)).state("gallery-edit").on("update",function(e){var t=a.shortcode(e).string();d.dom.setAttrib(n,"data-wp-media",window.encodeURIComponent(t)),o.detach()})))}d.addCommand("WP_Gallery",function(){o(d.selection.getNode())}),d.on("mouseup",function(e){var t=d.dom,n=e.target;function a(){t.removeClass(t.select("img.wp-media-selected"),"wp-media-selected")}"IMG"===n.nodeName&&t.getAttrib(n,"data-wp-media")?2!==e.button&&(t.hasClass(n,"wp-media-selected")?o(n):(a(),t.addClass(n,"wp-media-selected"))):a()}),d.on("ResolveName",function(e){var t=d.dom,n=e.target;"IMG"===n.nodeName&&t.getAttrib(n,"data-wp-media")&&t.hasClass(n,"wp-gallery")&&(e.name="gallery")}),d.on("BeforeSetContent",function(e){d.plugins.wpview&&"undefined"!=typeof wp&&wp.mce||(e.content=t(e.content))}),d.on("PostProcess",function(e){e.get&&(e.content=n(e.content))})}); |