From a226da32d338a73441db4c466b3eb05a732e0318 Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Thu, 26 Feb 2015 19:32:24 +0000 Subject: [PATCH] TinyMCE: wpView improvements: introduce getText() and remove() methods, improved getInstance(), better docs. Props iseulde. See #31412. Built from https://develop.svn.wordpress.org/trunk@31559 git-svn-id: http://core.svn.wordpress.org/trunk@31540 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/js/mce-view.js | 117 +++++++++++------- wp-includes/js/mce-view.min.js | 2 +- .../js/tinymce/plugins/wpview/plugin.js | 6 +- .../js/tinymce/plugins/wpview/plugin.min.js | 2 +- wp-includes/js/tinymce/wp-tinymce.js.gz | Bin 136189 -> 136195 bytes wp-includes/version.php | 2 +- 6 files changed, 80 insertions(+), 49 deletions(-) diff --git a/wp-includes/js/mce-view.js b/wp-includes/js/mce-view.js index fc6284fd3e..f5c485770a 100644 --- a/wp-includes/js/mce-view.js +++ b/wp-includes/js/mce-view.js @@ -64,6 +64,8 @@ window.wp = window.wp || {}; * Returns the settings of a view type. * * @param {String} type The view type. + * + * @return {Function} The view constructor. */ get: function( type ) { return views[ type ]; @@ -142,6 +144,8 @@ window.wp = window.wp || {}; * @param {String} type The view type. * @param {String} text The textual representation of the view. * @param {Object} options Options. + * + * @return {wp.mce.View} The view instance. */ createInstance: function( type, text, options ) { var View = this.get( type ), @@ -163,10 +167,27 @@ window.wp = window.wp || {}; /** * Get a view instance. * - * @param {String} text The textual representation of the view. + * @param {(String|HTMLElement)} object The textual representation of the view or the view node. + * + * @return {wp.mce.View} The view instance or undefined. */ - getInstance: function( text ) { - return instances[ encodeURIComponent( text ) ]; + getInstance: function( object ) { + if ( typeof object === 'string' ) { + return instances[ encodeURIComponent( object ) ]; + } + + return instances[ $( object ).data( 'wpview-text' ) ]; + }, + + /** + * Given a view node, get the view's text. + * + * @param {HTMLElement} node The view node. + * + * @return {String} The textual representation of the view. + */ + getText: function( node ) { + return decodeURIComponent( $( node ).data( 'wpview-text' ) || '' ); }, /** @@ -188,8 +209,7 @@ window.wp = window.wp || {}; * @param {HTMLElement} node The view node to update. */ update: function( text, editor, node ) { - var oldText = decodeURIComponent( $( node ).data( 'wpview-text' ) ), - instance = this.getInstance( oldText ); + var instance = this.getInstance( node ); if ( instance ) { instance.update( text, editor, node ); @@ -203,14 +223,27 @@ window.wp = window.wp || {}; * @param {HTMLElement} node The view node to edit. */ edit: function( editor, node ) { - var text = decodeURIComponent( $( node ).data( 'wpview-text' ) ), - instance = this.getInstance( text ); + var instance = this.getInstance( node ); if ( instance && instance.edit ) { - instance.edit( text, function( text ) { + instance.edit( instance.text, function( text ) { instance.update( text, editor, node ); } ); } + }, + + /** + * Remove a given view node from the DOM. + * + * @param {tinymce.Editor} editor The TinyMCE editor instance the view node is in. + * @param {HTMLElement} node The view node to remove. + */ + remove: function( editor, node ) { + var instance = this.getInstance( node ); + + if ( instance ) { + instance.remove( editor, node ); + } } }; @@ -218,7 +251,7 @@ window.wp = window.wp || {}; * A Backbone-like View constructor intended for use when rendering a TinyMCE View. * The main difference is that the TinyMCE View is not tied to a particular DOM node. * - * @param {Object} Options. + * @param {Object} options Options. */ wp.mce.View = function( options ) { _.extend( this, options ); @@ -276,44 +309,23 @@ window.wp = window.wp || {}; if ( this.getContent() ) { this.setContent( this.getContent(), function( editor, node ) { - $( node ).data( 'rendered', true ); - this.bindNodes.apply( this, arguments ); + $( node ).data( 'rendered', true ).trigger( 'wp-mce-view-bind' ); }, force ? null : false ); } else { this.setLoader(); } }, - /** - * Binds a given rendered view node. - * Runs after a view node's content is added to the DOM. - * - * @param {tinymce.Editor} editor The TinyMCE editor instance the view node is in. - * @param {HTMLElement} node The view node. - * @param {HTMLElement} contentNode The view's content node. - */ - bindNodes: function( /* editor, node, contentNode */ ) {}, - /** * Unbinds all view nodes tied to this view instance. * Runs before their content is removed from the DOM. */ unbind: function() { - this.getNodes( function() { - this.unbindNodes.apply( this, arguments ); + this.getNodes( function( editor, node ) { + $( node ).trigger( 'wp-mce-view-unbind' ); }, true ); }, - /** - * Unbinds a given view node. - * Runs before the view node's content is removed from the DOM. - * - * @param {tinymce.Editor} editor The TinyMCE editor instance the view node is in. - * @param {HTMLElement} node The view node. - * @param {HTMLElement} contentNode The view's content node. - */ - unbindNodes: function( /* editor, node, contentNode */ ) {}, - /** * Gets all the TinyMCE editor instances that support views. * @@ -378,7 +390,7 @@ window.wp = window.wp || {}; */ replaceMarkers: function() { this.getMarkers( function( editor, node ) { - if ( $( node ).text() !== this.text ) { + if ( $( node ).html() !== this.text ) { editor.dom.setAttrib( node, 'data-wpview-marker', null ); return; } @@ -455,7 +467,7 @@ window.wp = window.wp || {}; var dom = editor.dom, styles = '', bodyClasses = editor.getBody().className || '', - iframe, iframeDoc, i, resize; + iframe, iframeDoc, observer, i, resize; content.innerHTML = ''; head = head || ''; @@ -547,10 +559,11 @@ window.wp = window.wp || {}; }; if ( MutationObserver ) { - new MutationObserver( _.debounce( function() { + observer = new MutationObserver( _.debounce( function() { resize(); - }, 100 ) ) - .observe( iframeDoc.body, { + }, 100 ) ); + + observer.observe( iframeDoc.body, { attributes: true, childList: true, subtree: true @@ -561,11 +574,18 @@ window.wp = window.wp || {}; } } - if ( importStyles ) { - editor.on( 'wp-body-class-change', function() { - iframeDoc.body.className = editor.getBody().className; - } ); + function classChange() { + iframeDoc.body.className = editor.getBody().className; } + + if ( importStyles ) { + editor.on( 'wp-body-class-change', classChange ); + } + + $( node ).one( 'wp-mce-view-unbind', function() { + observer.disconnect(); + editor.off( 'wp-body-class-change', classChange ); + } ); }, 50 ); callback && callback.apply( this, arguments ); @@ -631,6 +651,17 @@ window.wp = window.wp || {}; $( node ).data( 'rendered', false ); editor.dom.setAttrib( node, 'data-wpview-text', encodeURIComponent( text ) ); wp.mce.views.createInstance( this.type, text, this.match( text ).options ).render(); + }, + + /** + * Remove a given view node from the DOM. + * + * @param {tinymce.Editor} editor The TinyMCE editor instance the view node is in. + * @param {HTMLElement} node The view node to remove. + */ + remove: function( editor, node ) { + $( node ).trigger( 'wp-mce-view-unbind' ); + editor.dom.remove( node ); } } ); } )( window, window.wp, window.jQuery ); @@ -662,6 +693,8 @@ window.wp = window.wp || {}; frame.on( 'close', function() { frame.detach(); } ); + + frame.open(); } }; diff --git a/wp-includes/js/mce-view.min.js b/wp-includes/js/mce-view.min.js index 02734e7eef..7290044463 100644 --- a/wp-includes/js/mce-view.min.js +++ b/wp-includes/js/mce-view.min.js @@ -1 +1 @@ -window.wp=window.wp||{},function(a,b,c){"use strict";var d={},e={};b.mce=b.mce||{},b.mce.views={register:function(a,c){d[a]=b.mce.View.extend(_.extend(c,{type:a}))},unregister:function(a){delete d[a]},get:function(a){return d[a]},unbind:function(){_.each(e,function(a){a.unbind()})},setMarkers:function(a){var b,c=[{content:a}],e=this;return _.each(d,function(a,d){b=c.slice(),c=[],_.each(b,function(b){var f,g=b.content;if(b.processed)return void c.push(b);for(;g&&(f=a.prototype.match(g));)f.index&&c.push({content:g.substring(0,f.index)}),e.createInstance(d,f.content,f.options),c.push({content:'

'+f.content+"

",processed:!0}),g=g.slice(f.index+f.content.length);g&&c.push({content:g})})}),_.pluck(c,"content").join("")},createInstance:function(a,b,c){var d=this.get(a),f=encodeURIComponent(b),g=this.getInstance(f);return g?g:(c=_.extend(c||{},{text:b,encodedText:f}),e[f]=new d(c))},getInstance:function(a){return e[encodeURIComponent(a)]},render:function(a){_.each(e,function(b){b.render(a)})},update:function(a,b,d){var e=decodeURIComponent(c(d).data("wpview-text")),f=this.getInstance(e);f&&f.update(a,b,d)},edit:function(a,b){var d=decodeURIComponent(c(b).data("wpview-text")),e=this.getInstance(d);e&&e.edit&&e.edit(d,function(c){e.update(c,a,b)})}},b.mce.View=function(a){_.extend(this,a),this.initialize()},b.mce.View.extend=Backbone.View.extend,_.extend(b.mce.View.prototype,{content:null,loader:!0,initialize:function(){},getContent:function(){return this.content},render:function(a){(this.loader||this.getContent())&&(a&&this.unbind(),this.replaceMarkers(),this.getContent()?this.setContent(this.getContent(),function(a,b){c(b).data("rendered",!0),this.bindNodes.apply(this,arguments)},a?null:!1):this.setLoader())},bindNodes:function(){},unbind:function(){this.getNodes(function(){this.unbindNodes.apply(this,arguments)},!0)},unbindNodes:function(){},getEditors:function(a){_.each(tinymce.editors,function(b){b.plugins.wpview&&a.call(this,b)},this)},getNodes:function(a,b){this.getEditors(function(d){var e=this;c(d.getBody()).find('[data-wpview-text="'+e.encodedText+'"]').filter(function(){var a;return null==b?!0:(a=c(this).data("rendered")===!0,b?a:!a)}).each(function(){a.call(e,d,this,c(this).find(".wpview-content").get(0))})})},getMarkers:function(a){this.getEditors(function(b){var d=this;c(b.getBody()).find('[data-wpview-marker="'+this.encodedText+'"]').each(function(){a.call(d,b,this)})})},replaceMarkers:function(){this.getMarkers(function(a,b){return c(b).text()!==this.text?void a.dom.setAttrib(b,"data-wpview-marker",null):void a.dom.replace(a.dom.createFragment('

 

'+(this.edit?'
':"")+'

 

'),b)})},removeMarkers:function(){this.getMarkers(function(a,b){a.dom.setAttrib(b,"data-wpview-marker",null)})},setContent:function(a,b,c){_.isObject(a)&&-1!==a.body.indexOf("'),e.innerHTML="",e.appendChild(_.isString(a)?c.dom.createFragment(a):a),b&&b.apply(this,arguments)},c)},setIframes:function(d,e,f,g){var h=a.MutationObserver||a.WebKitMutationObserver||a.MozMutationObserver,i="video"===this.type||"audio"===this.type||"playlist"===this.type;this.getNodes(function(a,g,j){var k,l,m,n,o=a.dom,p="",q=a.getBody().className||"";j.innerHTML="",d=d||"",i&&(b.mce.views.sandboxStyles?p=b.mce.views.sandboxStyles:(tinymce.each(o.$('link[rel="stylesheet"]',a.getDoc().head),function(a){a.href&&-1===a.href.indexOf("skins/lightgray/content.min.css")&&-1===a.href.indexOf("skins/wordpress/wp-content.css")&&(p+=o.getOuterHTML(a)+"\n")}),b.mce.views.sandboxStyles=p)),setTimeout(function(){if(k=o.add(j,"iframe",{src:tinymce.Env.ie?'javascript:""':"",frameBorder:"0",allowTransparency:"true",scrolling:"no","class":"wpview-sandbox",style:{width:"100%",display:"block"}}),o.add(j,"div",{"class":"wpview-overlay"}),l=k.contentWindow.document,l.open(),l.write(''+d+p+''+e+""),l.close(),n=function(){var b,d;k.contentWindow&&(b=c(k),d=c(l.body).height(),b.height()!==d&&(b.height(d),a.nodeChanged()))},h)new h(_.debounce(function(){n()},100)).observe(l.body,{attributes:!0,childList:!0,subtree:!0});else for(m=1;6>m;m++)setTimeout(n,700*m);i&&a.on("wp-body-class-change",function(){l.body.className=a.getBody().className})},50),f&&f.apply(this,arguments)},g)},setLoader:function(){this.setContent('
')},setError:function(a,b){this.setContent('

'+a+"

")},match:function(a){var c=b.shortcode.next(this.type,a);return c?{index:c.index,content:c.content,options:{shortcode:c.shortcode}}:void 0},update:function(a,d,e){c(e).data("rendered",!1),d.dom.setAttrib(e,"data-wpview-text",encodeURIComponent(a)),b.mce.views.createInstance(this.type,a,this.match(a).options).render()}})}(window,window.wp,window.jQuery),function(a,b,c){var d,e,f,g,h=c("#post_ID").val()||0;d={state:[],edit:function(a,b){var c=wp.media[this.type],d=c.edit(a);this.pausePlayers&&this.pausePlayers(),_.each(this.state,function(a){d.state(a).on("update",function(a){b(c.shortcode(a).string())})}),d.on("close",function(){d.detach()})}},e=_.extend({},d,{state:["gallery-edit"],template:wp.media.template("editor-gallery"),initialize:function(){var a=wp.media.gallery.attachments(this.shortcode,h),b=this.shortcode.attrs.named,c=this;a.more().done(function(){a=a.toJSON(),_.each(a,function(a){a.sizes&&(b.size&&a.sizes[b.size]?a.thumbnail=a.sizes[b.size]:a.sizes.thumbnail?a.thumbnail=a.sizes.thumbnail:a.sizes.full&&(a.thumbnail=a.sizes.full))}),c.content=c.template({attachments:a,columns:b.columns?parseInt(b.columns,10):wp.media.galleryDefaults.columns}),c.render()}).fail(function(a,b){c.setError(b)})}}),f=_.extend({},d,{action:"parse-media-shortcode",initialize:function(){var a=this;this.url&&(this.loader=!1,this.shortcode=wp.media.embed.shortcode({url:this.url})),wp.ajax.send(this.action,{data:{post_ID:h,type:this.shortcode.tag,shortcode:this.shortcode.string()}}).done(function(b){a.content=b,a.render()}).fail(function(b){a.url?a.removeMarkers():a.setError(b.message||b.statusText,"admin-media")}),this.getEditors(function(b){b.on("wpview-selected",function(){a.pausePlayers()})})},pausePlayers:function(){this.getNodes(function(a,b,d){var e=c("iframe.wpview-sandbox",d).get(0);e&&(e=e.contentWindow)&&e.mejs&&_.each(e.mejs.players,function(a){try{a.pause()}catch(b){}})})}}),g=_.extend({},f,{action:"parse-embed",edit:function(a,b){var c=wp.media.embed,d=c.edit(a,!!this.url),e=this;this.pausePlayers(),d.state("embed").props.on("change:url",function(a,b){b&&(d.state("embed").metadata=a.toJSON())}),d.state("embed").on("select",function(){b(e.url?d.state("embed").metadata.url:c.shortcode(d.state("embed").metadata).string())}),d.on("close",function(){d.detach()}),d.open()}}),b.register("gallery",_.extend({},e)),b.register("audio",_.extend({},f,{state:["audio-details"]})),b.register("video",_.extend({},f,{state:["video-details"]})),b.register("playlist",_.extend({},f,{state:["playlist-edit","video-playlist-edit"]})),b.register("embed",_.extend({},g)),b.register("embedURL",_.extend({},g,{match:function(a){var b=/(^|

)(https?:\/\/[^\s"]+?)(<\/p>\s*|$)/gi,c=b.exec(a);return c?{index:c.index+c[1].length,content:c[2],options:{url:c[2]}}:void 0}}))}(window,window.wp.mce.views,window.jQuery); \ No newline at end of file +window.wp=window.wp||{},function(a,b,c){"use strict";var d={},e={};b.mce=b.mce||{},b.mce.views={register:function(a,c){d[a]=b.mce.View.extend(_.extend(c,{type:a}))},unregister:function(a){delete d[a]},get:function(a){return d[a]},unbind:function(){_.each(e,function(a){a.unbind()})},setMarkers:function(a){var b,c=[{content:a}],e=this;return _.each(d,function(a,d){b=c.slice(),c=[],_.each(b,function(b){var f,g=b.content;if(b.processed)return void c.push(b);for(;g&&(f=a.prototype.match(g));)f.index&&c.push({content:g.substring(0,f.index)}),e.createInstance(d,f.content,f.options),c.push({content:'

'+f.content+"

",processed:!0}),g=g.slice(f.index+f.content.length);g&&c.push({content:g})})}),_.pluck(c,"content").join("")},createInstance:function(a,b,c){var d=this.get(a),f=encodeURIComponent(b),g=this.getInstance(f);return g?g:(c=_.extend(c||{},{text:b,encodedText:f}),e[f]=new d(c))},getInstance:function(a){return"string"==typeof a?e[encodeURIComponent(a)]:e[c(a).data("wpview-text")]},getText:function(a){return decodeURIComponent(c(a).data("wpview-text")||"")},render:function(a){_.each(e,function(b){b.render(a)})},update:function(a,b,c){var d=this.getInstance(c);d&&d.update(a,b,c)},edit:function(a,b){var c=this.getInstance(b);c&&c.edit&&c.edit(c.text,function(d){c.update(d,a,b)})},remove:function(a,b){var c=this.getInstance(b);c&&c.remove(a,b)}},b.mce.View=function(a){_.extend(this,a),this.initialize()},b.mce.View.extend=Backbone.View.extend,_.extend(b.mce.View.prototype,{content:null,loader:!0,initialize:function(){},getContent:function(){return this.content},render:function(a){(this.loader||this.getContent())&&(a&&this.unbind(),this.replaceMarkers(),this.getContent()?this.setContent(this.getContent(),function(a,b){c(b).data("rendered",!0).trigger("wp-mce-view-bind")},a?null:!1):this.setLoader())},unbind:function(){this.getNodes(function(a,b){c(b).trigger("wp-mce-view-unbind")},!0)},getEditors:function(a){_.each(tinymce.editors,function(b){b.plugins.wpview&&a.call(this,b)},this)},getNodes:function(a,b){this.getEditors(function(d){var e=this;c(d.getBody()).find('[data-wpview-text="'+e.encodedText+'"]').filter(function(){var a;return null==b?!0:(a=c(this).data("rendered")===!0,b?a:!a)}).each(function(){a.call(e,d,this,c(this).find(".wpview-content").get(0))})})},getMarkers:function(a){this.getEditors(function(b){var d=this;c(b.getBody()).find('[data-wpview-marker="'+this.encodedText+'"]').each(function(){a.call(d,b,this)})})},replaceMarkers:function(){this.getMarkers(function(a,b){return c(b).html()!==this.text?void a.dom.setAttrib(b,"data-wpview-marker",null):void a.dom.replace(a.dom.createFragment('

 

'+(this.edit?'
':"")+'

 

'),b)})},removeMarkers:function(){this.getMarkers(function(a,b){a.dom.setAttrib(b,"data-wpview-marker",null)})},setContent:function(a,b,c){_.isObject(a)&&-1!==a.body.indexOf("'),e.innerHTML="",e.appendChild(_.isString(a)?c.dom.createFragment(a):a),b&&b.apply(this,arguments)},c)},setIframes:function(d,e,f,g){var h=a.MutationObserver||a.WebKitMutationObserver||a.MozMutationObserver,i="video"===this.type||"audio"===this.type||"playlist"===this.type;this.getNodes(function(a,g,j){var k,l,m,n,o,p=a.dom,q="",r=a.getBody().className||"";j.innerHTML="",d=d||"",i&&(b.mce.views.sandboxStyles?q=b.mce.views.sandboxStyles:(tinymce.each(p.$('link[rel="stylesheet"]',a.getDoc().head),function(a){a.href&&-1===a.href.indexOf("skins/lightgray/content.min.css")&&-1===a.href.indexOf("skins/wordpress/wp-content.css")&&(q+=p.getOuterHTML(a)+"\n")}),b.mce.views.sandboxStyles=q)),setTimeout(function(){function b(){l.body.className=a.getBody().className}if(k=p.add(j,"iframe",{src:tinymce.Env.ie?'javascript:""':"",frameBorder:"0",allowTransparency:"true",scrolling:"no","class":"wpview-sandbox",style:{width:"100%",display:"block"}}),p.add(j,"div",{"class":"wpview-overlay"}),l=k.contentWindow.document,l.open(),l.write(''+d+q+''+e+""),l.close(),o=function(){var b,d;k.contentWindow&&(b=c(k),d=c(l.body).height(),b.height()!==d&&(b.height(d),a.nodeChanged()))},h)m=new h(_.debounce(function(){o()},100)),m.observe(l.body,{attributes:!0,childList:!0,subtree:!0});else for(n=1;6>n;n++)setTimeout(o,700*n);i&&a.on("wp-body-class-change",b),c(g).one("wp-mce-view-unbind",function(){m.disconnect(),a.off("wp-body-class-change",b)})},50),f&&f.apply(this,arguments)},g)},setLoader:function(){this.setContent('
')},setError:function(a,b){this.setContent('

'+a+"

")},match:function(a){var c=b.shortcode.next(this.type,a);return c?{index:c.index,content:c.content,options:{shortcode:c.shortcode}}:void 0},update:function(a,d,e){c(e).data("rendered",!1),d.dom.setAttrib(e,"data-wpview-text",encodeURIComponent(a)),b.mce.views.createInstance(this.type,a,this.match(a).options).render()},remove:function(a,b){c(b).trigger("wp-mce-view-unbind"),a.dom.remove(b)}})}(window,window.wp,window.jQuery),function(a,b,c){var d,e,f,g,h=c("#post_ID").val()||0;d={state:[],edit:function(a,b){var c=wp.media[this.type],d=c.edit(a);this.pausePlayers&&this.pausePlayers(),_.each(this.state,function(a){d.state(a).on("update",function(a){b(c.shortcode(a).string())})}),d.on("close",function(){d.detach()}),d.open()}},e=_.extend({},d,{state:["gallery-edit"],template:wp.media.template("editor-gallery"),initialize:function(){var a=wp.media.gallery.attachments(this.shortcode,h),b=this.shortcode.attrs.named,c=this;a.more().done(function(){a=a.toJSON(),_.each(a,function(a){a.sizes&&(b.size&&a.sizes[b.size]?a.thumbnail=a.sizes[b.size]:a.sizes.thumbnail?a.thumbnail=a.sizes.thumbnail:a.sizes.full&&(a.thumbnail=a.sizes.full))}),c.content=c.template({attachments:a,columns:b.columns?parseInt(b.columns,10):wp.media.galleryDefaults.columns}),c.render()}).fail(function(a,b){c.setError(b)})}}),f=_.extend({},d,{action:"parse-media-shortcode",initialize:function(){var a=this;this.url&&(this.loader=!1,this.shortcode=wp.media.embed.shortcode({url:this.url})),wp.ajax.send(this.action,{data:{post_ID:h,type:this.shortcode.tag,shortcode:this.shortcode.string()}}).done(function(b){a.content=b,a.render()}).fail(function(b){a.url?a.removeMarkers():a.setError(b.message||b.statusText,"admin-media")}),this.getEditors(function(b){b.on("wpview-selected",function(){a.pausePlayers()})})},pausePlayers:function(){this.getNodes(function(a,b,d){var e=c("iframe.wpview-sandbox",d).get(0);e&&(e=e.contentWindow)&&e.mejs&&_.each(e.mejs.players,function(a){try{a.pause()}catch(b){}})})}}),g=_.extend({},f,{action:"parse-embed",edit:function(a,b){var c=wp.media.embed,d=c.edit(a,!!this.url),e=this;this.pausePlayers(),d.state("embed").props.on("change:url",function(a,b){b&&(d.state("embed").metadata=a.toJSON())}),d.state("embed").on("select",function(){b(e.url?d.state("embed").metadata.url:c.shortcode(d.state("embed").metadata).string())}),d.on("close",function(){d.detach()}),d.open()}}),b.register("gallery",_.extend({},e)),b.register("audio",_.extend({},f,{state:["audio-details"]})),b.register("video",_.extend({},f,{state:["video-details"]})),b.register("playlist",_.extend({},f,{state:["playlist-edit","video-playlist-edit"]})),b.register("embed",_.extend({},g)),b.register("embedURL",_.extend({},g,{match:function(a){var b=/(^|

)(https?:\/\/[^\s"]+?)(<\/p>\s*|$)/gi,c=b.exec(a);return c?{index:c.index+c[1].length,content:c[2],options:{url:c[2]}}:void 0}}))}(window,window.wp.mce.views,window.jQuery); \ No newline at end of file diff --git a/wp-includes/js/tinymce/plugins/wpview/plugin.js b/wp-includes/js/tinymce/plugins/wpview/plugin.js index 78b52cb19b..e89915f5aa 100644 --- a/wp-includes/js/tinymce/plugins/wpview/plugin.js +++ b/wp-includes/js/tinymce/plugins/wpview/plugin.js @@ -72,11 +72,9 @@ tinymce.PluginManager.add( 'wpview', function( editor ) { } function removeView( view ) { - // TODO: trigger an event to run a clean up function. - // Maybe `jQuery( view ).trigger( 'remove' );`? editor.undoManager.transact( function() { handleEnter( view ); - editor.dom.remove( view ); + wp.mce.views.remove( editor, view ); }); } @@ -107,7 +105,7 @@ tinymce.PluginManager.add( 'wpview', function( editor ) { clipboard = dom.create( 'div', { 'class': 'wpview-clipboard', 'contenteditable': 'true' - }, decodeURIComponent( editor.dom.getAttrib( viewNode, 'data-wpview-text' ) ) ); + }, wp.mce.views.getText( viewNode ) ); editor.dom.select( '.wpview-body', viewNode )[0].appendChild( clipboard ); diff --git a/wp-includes/js/tinymce/plugins/wpview/plugin.min.js b/wp-includes/js/tinymce/plugins/wpview/plugin.min.js index cde1635c9b..3e13877f97 100644 --- a/wp-includes/js/tinymce/plugins/wpview/plugin.min.js +++ b/wp-includes/js/tinymce/plugins/wpview/plugin.min.js @@ -1 +1 @@ -tinymce.PluginManager.add("wpview",function(a){function b(a){return c(a,"wpview-wrap")}function c(a,b){for(;a&&a.parentNode;){if(a.className&&-1!==(" "+a.className+" ").indexOf(" "+b+" "))return a;a=a.parentNode}return!1}function d(a){a.stopPropagation()}function e(b,c){var d=b?"before":"after",e=b?0:1;j(),a.selection.setCursorLocation(a.dom.select(".wpview-selection-"+d,c)[0],e),a.nodeChanged()}function f(b,c,d){var f=a.dom,g=f.create("p");t.ie&&t.ie<11||(g.innerHTML='
'),c?b.parentNode.insertBefore(g,b):f.insertAfter(g,b),j(),c&&d===u.ENTER?e(c,b):a.selection.setCursorLocation(g,0),a.nodeChanged()}function g(b){a.undoManager.transact(function(){f(b),a.dom.remove(b)})}function h(b){var c,e=a.dom;if(b){if(b===m)return void i(b);a.getBody().focus(),j(),m=b,e.setAttrib(b,"data-mce-selected",1),i(b),c=e.create("div",{"class":"wpview-clipboard",contenteditable:"true"},decodeURIComponent(a.dom.getAttrib(b,"data-wpview-text"))),a.dom.select(".wpview-body",b)[0].appendChild(c),e.bind(c,"beforedeactivate focusin focusout",d),e.bind(m,"beforedeactivate focusin focusout",d),z?a.selection.select(c):a.selection.select(c,!0),a.nodeChanged(),a.fire("wpview-selected",b)}}function i(b){var c=0,d=a.$(b).find(".toolbar"),e=tinymce.$(a.editorContainer).find(".mce-toolbar-grp")[0],f=e&&e.getBoundingClientRect().bottom||0;d.length&&a.iframeElement&&(c=b.getBoundingClientRect().top+a.iframeElement.getBoundingClientRect().top-f-48),0>c?d.removeClass("mce-arrow-down").css({top:-43+-1*c}):c>0&&!d.hasClass("mce-arrow-down")&&d.addClass("mce-arrow-down").css({top:""})}function j(){var b,c=a.dom;m&&(b=a.dom.select(".wpview-clipboard",m)[0],c.unbind(b),c.remove(b),c.unbind(m,"beforedeactivate focusin focusout click mouseup",d),c.setAttrib(m,"data-mce-selected",null)),m=null}function k(a){return a.replace(/]+data-wpview-text=\"([^"]+)"[^>]*>[\s\S]+?wpview-selection-after[^>]+>(?: |\u00a0)*<\/p><\/div>/g,"$1")}function l(a){return 47>=a&&a!==u.SPACEBAR&&a!==u.ENTER&&a!==u.DELETE&&a!==u.BACKSPACE&&(37>a||a>40)||a>=224||a>=144&&150>=a||a>=91&&93>=a||a>=112&&135>=a}var m,n,o,p,q,r,s,t=tinymce.Env,u=tinymce.util.VK,v=tinymce.dom.TreeWalker,w=!1,x=!0,y=function(){return!1},z=/iPad|iPod|iPhone/.test(navigator.userAgent);return"undefined"!=typeof wp&&wp.mce?(a.on("BeforeAddUndo",function(a){a.lastLevel&&k(a.level.content)===k(a.lastLevel.content)&&a.preventDefault()}),a.on("BeforeSetContent",function(b){var c;b.content&&(m&&g(m),c=a.selection.getNode(),(!b.content.match(/^\s*(https?:\/\/[^\s"]+)\s*$/i)||"P"===c.nodeName&&c.parentNode===a.getBody()&&a.dom.isEmpty(c))&&(b.content=wp.mce.views.setMarkers(b.content)))}),a.on("SetContent",function(){wp.mce.views.render()}),a.on("click",function(c){var d,f=c.clientX,g=c.clientY,h=a.getBody(),i=h.getBoundingClientRect(),j=h.firstChild,k=j.getBoundingClientRect(),l=h.lastChild,m=l.getBoundingClientRect();gm.bottom&&(d=b(l))?(e(!1,d),c.preventDefault()):(fi.right)&&tinymce.each(a.dom.select(".wpview-wrap"),function(a){var b=a.getBoundingClientRect();return g=b.top&&g<=b.bottom?(fi.right&&(e(!1,a),c.preventDefault()),!1):void 0})}),a.on("init",function(){var c=!1,d=a.selection,e=window.MutationObserver||window.WebKitMutationObserver;a.on("BeforeSetContent",function(){var c,e,f=b(d.getNode());f&&(!f.nextSibling||b(f.nextSibling)?(e=a.getDoc().createTextNode(""),a.dom.insertAfter(e,f)):(c=new v(f.nextSibling,f.nextSibling),e=c.next()),d.select(e),d.collapse(!0))}),a.dom.bind(a.getDoc(),"touchmove",function(){c=!0}),a.on("mousedown mouseup click touchend",function(d){var e=b(d.target);if(x=!1,e){if(d.stopImmediatePropagation(),d.preventDefault(),!("touchend"!==d.type&&"mousedown"!==d.type||d.metaKey||d.ctrlKey)){if(a.dom.hasClass(d.target,"edit"))return t.ie&&a.focus(),wp.mce.views.edit(a,e),!1;if(a.dom.hasClass(d.target,"remove"))return g(e),!1}return"touchend"===d.type&&c?c=!1:h(e),!1}("touchend"===d.type||"mousedown"===d.type)&&j(),"touchend"===d.type&&c&&(c=!1)},!0),e&&new e(function(){a.fire("wp-body-class-change")}).observe(a.getBody(),{attributes:!0,attributeFilter:["class"]})}),a.on("PreProcess",function(b){tinymce.each(a.dom.select("div[data-wpview-text]",b.node),function(a){a.textContent=a.innerText=" "})}),a.on("PostProcess",function(a){a.content&&(a.content=a.content.replace(/

]*?data-wpview-text="([^"]*)"[^>]*>[\s\S]*?<\/div>/g,function(a,b){return b?"

"+window.decodeURIComponent(b)+"

":""}))}),a.on("keydown",function(c){var d,i,k,n,p,q,r,s=c.keyCode,t=a.dom,v=a.selection;if(m){if((c.metaKey||c.ctrlKey)&&s!==u.BACKSPACE&&86!==s||s>=112&&123>=s)return void((c.metaKey||c.ctrlKey)&&88===s&&(w=m));if(i=b(v.getNode()),i!==m)return void j();s===u.LEFT?(e(!0,i),c.preventDefault()):s===u.UP?(i.previousSibling?b(i.previousSibling)?e(!0,i.previousSibling):(j(),v.select(i.previousSibling,!0),v.collapse()):e(!0,i),c.preventDefault()):s===u.RIGHT?(e(!1,i),c.preventDefault()):s===u.DOWN?(i.nextSibling?b(i.nextSibling)?e(!1,i.nextSibling):(j(),v.setCursorLocation(i.nextSibling,0)):e(!1,i),c.preventDefault()):l(s)||(g(m),(s===u.ENTER||s===u.DELETE||s===u.BACKSPACE)&&c.preventDefault())}else{if(c.metaKey||c.ctrlKey||s>=112&&123>=s)return;if(d=v.getNode(),o=d,i=b(d),v.isCollapsed()||(p=v.getRng(),(i=b(p.endContainer))?(q=p.cloneRange(),v.select(i.previousSibling,!0),v.collapse(),r=v.getRng(),q.setEnd(r.endContainer,r.endOffset),v.setRng(q)):(i=b(p.startContainer))&&(q=p.cloneRange(),q.setStart(i.nextSibling,0),v.setRng(q))),!i)return void(c.keyCode===u.BACKSPACE&&(a.dom.isEmpty(d)?(i=b(d.previousSibling))&&(e(!1,i),a.dom.remove(d),c.preventDefault()):(p=v.getRng())&&0===p.startOffset&&0===p.endOffset&&(i=b(d.previousSibling))&&(e(!1,i),c.preventDefault())));if(!(k=t.hasClass(i,"wpview-selection-before"))&&!(n=t.hasClass(i,"wpview-selection-after")))return;if(l(s))return;n&&s===u.UP||k&&s===u.BACKSPACE?(i.previousSibling?b(i.previousSibling)?e(!1,i.previousSibling):t.isEmpty(i.previousSibling)&&s===u.BACKSPACE?t.remove(i.previousSibling):(v.select(i.previousSibling,!0),v.collapse()):e(!0,i),c.preventDefault()):!n||s!==u.DOWN&&s!==u.RIGHT?!k||s!==u.UP&&s!==u.LEFT?k&&s===u.DOWN?(i.nextSibling?b(i.nextSibling)?e(!0,i.nextSibling):v.setCursorLocation(i.nextSibling,0):e(!1,i),c.preventDefault()):n&&s===u.LEFT||k&&s===u.RIGHT?(h(i),c.preventDefault()):n&&s===u.BACKSPACE?(g(i),c.preventDefault()):n?f(i):k&&f(i,!0,s):(i.previousSibling&&(b(i.previousSibling)?e(s===u.UP,i.previousSibling):(v.select(i.previousSibling,!0),v.collapse())),c.preventDefault()):(i.nextSibling&&(b(i.nextSibling)?e(s===u.RIGHT,i.nextSibling):v.setCursorLocation(i.nextSibling,0)),c.preventDefault()),s===u.ENTER&&c.preventDefault()}}),a.on("keyup",function(){w&&(g(w),w=!1)}),a.on("focus",function(){var c;q=!0,a.dom.addClass(a.getBody(),"has-focus"),x&&(c=b(a.getBody().firstChild))&&e(!0,c),x=!1}),a.on("blur",function(){q=!1,a.dom.removeClass(a.getBody(),"has-focus")}),a.on("NodeChange",function(d){var f=a.dom,g=a.dom.select(".wpview-wrap"),h=d.element.className,i=b(d.element),k=o;if(o=!1,clearInterval(n),tinymce.each(g,function(a){a.className&&(a.className=a.className.replace(/ ?\bwpview-(?:selection-before|selection-after|cursor-hide)\b/g,""))}),q&&i)if("wpview-selection-before"!==h&&"wpview-selection-after"!==h||!a.selection.isCollapsed())c(d.element,"wpview-clipboard")||p||(j(),p++,e(!0,i));else{if(p=0,j(),k===i.previousSibling)return void e(!0,i);if(k===i.nextSibling)return void e(!1,i);f.addClass(i,h),n=setInterval(function(){f.hasClass(i,"wpview-cursor-hide")?f.removeClass(i,"wpview-cursor-hide"):f.addClass(i,"wpview-cursor-hide")},500)}}),a.on("BeforeExecCommand",function(){var c,d=a.selection.getNode();d&&((s="wpview-selection-before"===d.className)||"wpview-selection-after"===d.className)&&(c=b(d))&&(f(c,s),r=c)}),a.on("ExecCommand",function(){var b,c;m&&(b=m,j(),h(b)),r&&(c=r[s?"previousSibling":"nextSibling"],c&&"P"===c.nodeName&&a.dom.isEmpty(c)&&(a.dom.remove(c),e(s,r)),r=!1)}),a.on("ResolveName",function(c){a.dom.hasClass(c.target,"wpview-wrap")?(c.name=a.dom.getAttrib(c.target,"data-wpview-type")||"wpview",c.stopPropagation()):b(c.target)&&(c.preventDefault(),c.stopPropagation())}),{getView:b}):{getView:y}}); \ No newline at end of file +tinymce.PluginManager.add("wpview",function(a){function b(a){return c(a,"wpview-wrap")}function c(a,b){for(;a&&a.parentNode;){if(a.className&&-1!==(" "+a.className+" ").indexOf(" "+b+" "))return a;a=a.parentNode}return!1}function d(a){a.stopPropagation()}function e(b,c){var d=b?"before":"after",e=b?0:1;j(),a.selection.setCursorLocation(a.dom.select(".wpview-selection-"+d,c)[0],e),a.nodeChanged()}function f(b,c,d){var f=a.dom,g=f.create("p");t.ie&&t.ie<11||(g.innerHTML='
'),c?b.parentNode.insertBefore(g,b):f.insertAfter(g,b),j(),c&&d===u.ENTER?e(c,b):a.selection.setCursorLocation(g,0),a.nodeChanged()}function g(b){a.undoManager.transact(function(){f(b),wp.mce.views.remove(a,b)})}function h(b){var c,e=a.dom;if(b){if(b===m)return void i(b);a.getBody().focus(),j(),m=b,e.setAttrib(b,"data-mce-selected",1),i(b),c=e.create("div",{"class":"wpview-clipboard",contenteditable:"true"},wp.mce.views.getText(b)),a.dom.select(".wpview-body",b)[0].appendChild(c),e.bind(c,"beforedeactivate focusin focusout",d),e.bind(m,"beforedeactivate focusin focusout",d),z?a.selection.select(c):a.selection.select(c,!0),a.nodeChanged(),a.fire("wpview-selected",b)}}function i(b){var c=0,d=a.$(b).find(".toolbar"),e=tinymce.$(a.editorContainer).find(".mce-toolbar-grp")[0],f=e&&e.getBoundingClientRect().bottom||0;d.length&&a.iframeElement&&(c=b.getBoundingClientRect().top+a.iframeElement.getBoundingClientRect().top-f-48),0>c?d.removeClass("mce-arrow-down").css({top:-43+-1*c}):c>0&&!d.hasClass("mce-arrow-down")&&d.addClass("mce-arrow-down").css({top:""})}function j(){var b,c=a.dom;m&&(b=a.dom.select(".wpview-clipboard",m)[0],c.unbind(b),c.remove(b),c.unbind(m,"beforedeactivate focusin focusout click mouseup",d),c.setAttrib(m,"data-mce-selected",null)),m=null}function k(a){return a.replace(/]+data-wpview-text=\"([^"]+)"[^>]*>[\s\S]+?wpview-selection-after[^>]+>(?: |\u00a0)*<\/p><\/div>/g,"$1")}function l(a){return 47>=a&&a!==u.SPACEBAR&&a!==u.ENTER&&a!==u.DELETE&&a!==u.BACKSPACE&&(37>a||a>40)||a>=224||a>=144&&150>=a||a>=91&&93>=a||a>=112&&135>=a}var m,n,o,p,q,r,s,t=tinymce.Env,u=tinymce.util.VK,v=tinymce.dom.TreeWalker,w=!1,x=!0,y=function(){return!1},z=/iPad|iPod|iPhone/.test(navigator.userAgent);return"undefined"!=typeof wp&&wp.mce?(a.on("BeforeAddUndo",function(a){a.lastLevel&&k(a.level.content)===k(a.lastLevel.content)&&a.preventDefault()}),a.on("BeforeSetContent",function(b){var c;b.content&&(m&&g(m),c=a.selection.getNode(),(!b.content.match(/^\s*(https?:\/\/[^\s"]+)\s*$/i)||"P"===c.nodeName&&c.parentNode===a.getBody()&&a.dom.isEmpty(c))&&(b.content=wp.mce.views.setMarkers(b.content)))}),a.on("SetContent",function(){wp.mce.views.render()}),a.on("click",function(c){var d,f=c.clientX,g=c.clientY,h=a.getBody(),i=h.getBoundingClientRect(),j=h.firstChild,k=j.getBoundingClientRect(),l=h.lastChild,m=l.getBoundingClientRect();gm.bottom&&(d=b(l))?(e(!1,d),c.preventDefault()):(fi.right)&&tinymce.each(a.dom.select(".wpview-wrap"),function(a){var b=a.getBoundingClientRect();return g=b.top&&g<=b.bottom?(fi.right&&(e(!1,a),c.preventDefault()),!1):void 0})}),a.on("init",function(){var c=!1,d=a.selection,e=window.MutationObserver||window.WebKitMutationObserver;a.on("BeforeSetContent",function(){var c,e,f=b(d.getNode());f&&(!f.nextSibling||b(f.nextSibling)?(e=a.getDoc().createTextNode(""),a.dom.insertAfter(e,f)):(c=new v(f.nextSibling,f.nextSibling),e=c.next()),d.select(e),d.collapse(!0))}),a.dom.bind(a.getDoc(),"touchmove",function(){c=!0}),a.on("mousedown mouseup click touchend",function(d){var e=b(d.target);if(x=!1,e){if(d.stopImmediatePropagation(),d.preventDefault(),!("touchend"!==d.type&&"mousedown"!==d.type||d.metaKey||d.ctrlKey)){if(a.dom.hasClass(d.target,"edit"))return t.ie&&a.focus(),wp.mce.views.edit(a,e),!1;if(a.dom.hasClass(d.target,"remove"))return g(e),!1}return"touchend"===d.type&&c?c=!1:h(e),!1}("touchend"===d.type||"mousedown"===d.type)&&j(),"touchend"===d.type&&c&&(c=!1)},!0),e&&new e(function(){a.fire("wp-body-class-change")}).observe(a.getBody(),{attributes:!0,attributeFilter:["class"]})}),a.on("PreProcess",function(b){tinymce.each(a.dom.select("div[data-wpview-text]",b.node),function(a){a.textContent=a.innerText=" "})}),a.on("PostProcess",function(a){a.content&&(a.content=a.content.replace(/
]*?data-wpview-text="([^"]*)"[^>]*>[\s\S]*?<\/div>/g,function(a,b){return b?"

"+window.decodeURIComponent(b)+"

":""}))}),a.on("keydown",function(c){var d,i,k,n,p,q,r,s=c.keyCode,t=a.dom,v=a.selection;if(m){if((c.metaKey||c.ctrlKey)&&s!==u.BACKSPACE&&86!==s||s>=112&&123>=s)return void((c.metaKey||c.ctrlKey)&&88===s&&(w=m));if(i=b(v.getNode()),i!==m)return void j();s===u.LEFT?(e(!0,i),c.preventDefault()):s===u.UP?(i.previousSibling?b(i.previousSibling)?e(!0,i.previousSibling):(j(),v.select(i.previousSibling,!0),v.collapse()):e(!0,i),c.preventDefault()):s===u.RIGHT?(e(!1,i),c.preventDefault()):s===u.DOWN?(i.nextSibling?b(i.nextSibling)?e(!1,i.nextSibling):(j(),v.setCursorLocation(i.nextSibling,0)):e(!1,i),c.preventDefault()):l(s)||(g(m),(s===u.ENTER||s===u.DELETE||s===u.BACKSPACE)&&c.preventDefault())}else{if(c.metaKey||c.ctrlKey||s>=112&&123>=s)return;if(d=v.getNode(),o=d,i=b(d),v.isCollapsed()||(p=v.getRng(),(i=b(p.endContainer))?(q=p.cloneRange(),v.select(i.previousSibling,!0),v.collapse(),r=v.getRng(),q.setEnd(r.endContainer,r.endOffset),v.setRng(q)):(i=b(p.startContainer))&&(q=p.cloneRange(),q.setStart(i.nextSibling,0),v.setRng(q))),!i)return void(c.keyCode===u.BACKSPACE&&(a.dom.isEmpty(d)?(i=b(d.previousSibling))&&(e(!1,i),a.dom.remove(d),c.preventDefault()):(p=v.getRng())&&0===p.startOffset&&0===p.endOffset&&(i=b(d.previousSibling))&&(e(!1,i),c.preventDefault())));if(!(k=t.hasClass(i,"wpview-selection-before"))&&!(n=t.hasClass(i,"wpview-selection-after")))return;if(l(s))return;n&&s===u.UP||k&&s===u.BACKSPACE?(i.previousSibling?b(i.previousSibling)?e(!1,i.previousSibling):t.isEmpty(i.previousSibling)&&s===u.BACKSPACE?t.remove(i.previousSibling):(v.select(i.previousSibling,!0),v.collapse()):e(!0,i),c.preventDefault()):!n||s!==u.DOWN&&s!==u.RIGHT?!k||s!==u.UP&&s!==u.LEFT?k&&s===u.DOWN?(i.nextSibling?b(i.nextSibling)?e(!0,i.nextSibling):v.setCursorLocation(i.nextSibling,0):e(!1,i),c.preventDefault()):n&&s===u.LEFT||k&&s===u.RIGHT?(h(i),c.preventDefault()):n&&s===u.BACKSPACE?(g(i),c.preventDefault()):n?f(i):k&&f(i,!0,s):(i.previousSibling&&(b(i.previousSibling)?e(s===u.UP,i.previousSibling):(v.select(i.previousSibling,!0),v.collapse())),c.preventDefault()):(i.nextSibling&&(b(i.nextSibling)?e(s===u.RIGHT,i.nextSibling):v.setCursorLocation(i.nextSibling,0)),c.preventDefault()),s===u.ENTER&&c.preventDefault()}}),a.on("keyup",function(){w&&(g(w),w=!1)}),a.on("focus",function(){var c;q=!0,a.dom.addClass(a.getBody(),"has-focus"),x&&(c=b(a.getBody().firstChild))&&e(!0,c),x=!1}),a.on("blur",function(){q=!1,a.dom.removeClass(a.getBody(),"has-focus")}),a.on("NodeChange",function(d){var f=a.dom,g=a.dom.select(".wpview-wrap"),h=d.element.className,i=b(d.element),k=o;if(o=!1,clearInterval(n),tinymce.each(g,function(a){a.className&&(a.className=a.className.replace(/ ?\bwpview-(?:selection-before|selection-after|cursor-hide)\b/g,""))}),q&&i)if("wpview-selection-before"!==h&&"wpview-selection-after"!==h||!a.selection.isCollapsed())c(d.element,"wpview-clipboard")||p||(j(),p++,e(!0,i));else{if(p=0,j(),k===i.previousSibling)return void e(!0,i);if(k===i.nextSibling)return void e(!1,i);f.addClass(i,h),n=setInterval(function(){f.hasClass(i,"wpview-cursor-hide")?f.removeClass(i,"wpview-cursor-hide"):f.addClass(i,"wpview-cursor-hide")},500)}}),a.on("BeforeExecCommand",function(){var c,d=a.selection.getNode();d&&((s="wpview-selection-before"===d.className)||"wpview-selection-after"===d.className)&&(c=b(d))&&(f(c,s),r=c)}),a.on("ExecCommand",function(){var b,c;m&&(b=m,j(),h(b)),r&&(c=r[s?"previousSibling":"nextSibling"],c&&"P"===c.nodeName&&a.dom.isEmpty(c)&&(a.dom.remove(c),e(s,r)),r=!1)}),a.on("ResolveName",function(c){a.dom.hasClass(c.target,"wpview-wrap")?(c.name=a.dom.getAttrib(c.target,"data-wpview-type")||"wpview",c.stopPropagation()):b(c.target)&&(c.preventDefault(),c.stopPropagation())}),{getView:b}):{getView:y}}); \ No newline at end of file diff --git a/wp-includes/js/tinymce/wp-tinymce.js.gz b/wp-includes/js/tinymce/wp-tinymce.js.gz index 8a9b664945bccb5ad2c5cb54c4ae7b745219b4ae..468bf7c641c20c031104493e3e1275ac1c8227d7 100644 GIT binary patch delta 4363 zcmV+m5%li;rwD_n2!MnEv;rpse01kjTdU|?#zW&;HlkBtRcQL1VJWX^w&QyVG3-;Kx0cRqo(!VCY5Z~WTyiKFc8w z;U=Sk%0A1k&w5>atIHBISz-_|SlX;=X0=7tGMBj}^=A;%D>~3VBy;(8UYysyQSR;3 z3+;yUr$jzqC5mq-e_o4)2AvzqZIC zMaX3ino#RCtGmeNOHyIilp3HbQ;1IH6ql<;vG00Ou=S!;8;@LWJPO7U5$?(mEN6@J8Ouin zMchPwVV}HGSXrG04C}dGn+#&+Jx)KyZ|dhM)JEJp*LanX_nw1SuK1zKH|Q}vpWTbo zmdHK+u%#w)eN&hsibr1eGi2S#1f{+-7emPJD>FSsC1#&PKOOnN6TDCKO}Me+Rq0^WufY%wO4tGy#@ttgj;S z*jXdbbSz*xs_DnOT9A9OE1k$IF#BJi4RrCZbUD|M26>Vxq(SB)4KfF5kQqpW=CKaZ zal_pbo*}=61vNrcs+-hZc;s;nYAuR0TWx(O>ZOvh0Lr@a|UVn3fEJGgzpvZ9K8?fAG?NN>rl;N3veUK}tMINCJ+tjR%-( zu$sP2MT5jVKhx95Rg=10HCh4Ws>zy4bl4uXmj943NYN?EP&-ATriCoHo`=%QVs`zp{xm8Y9f;@=#SP^PiA7ctBQNAw)?YP@Em*lCJq zb>WmXyx2w#7uZzKmgqIXTSU8rU~PhThmA-+~<#0s$mPkT%z<<@bCWlw(HhcD`QcfB4@CMwYGD zgvC}+QN*9oFKnu0eP?!`o6QU#khnp88aW3%RCzKbD?Ywn8<(CeW{P}Va^N2gB~AIc zkEET^l#jiIgbl}r=z$qR?83^9_82v5i~Zy?jh?IQTdX7M;J+DTB5Xi)4Ka-^a>fai z*2cwob3%GiWpQZ%&3S#Pe`2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@V8+ zh;AWm-JlKbZpFH{+fqET`F_G54x`W9BO4g5f8_uG9f6{le}&+V>KJqY#;0!^kddD6 zsuwj8A?XvI#?AYX@FZytY_3D)k!3VWrl7i}P|fV7=+9pRPXDfd6HF}Z`M|b&Nr*AI zO8Wj-fa_G$F6hO!&Rtt-b)BIkodB-_kS+1ZVAeOchlf=Nkr#E!o9UGyl1qEFbqhl; zTD2$tVMaNle;hwFP?$sDIvcau@o^+nAqS*`jWSEl@K|WXMB1ID)G8H^LeKNUbTU~5 zL2Y$QEwU9v_)QWv-_%gi(=XquMY^*c_DVw%Yf8n&7rjL`(bvGyvSWsDfjFy)Y=hv3 z0I`4mamCH4=Gwye8SfBV1;s4J2^%mgl4)ILk7atEcQsWvjWTgUF~)J_X`ANw&iRK$ zuWb!6+h&n*Y=49^P}hTMdr6g%rD*?{WG$jOe9F*keuPuzWV)pxaYP>go$iEBQ1iS{ zmp3-1UuKvYSDox!&%>h2w_tJp}-JiPA|oVXQ8`0J#2tJ1j9>Og#nwT9ABf diff --git a/wp-includes/version.php b/wp-includes/version.php index cd37f225d6..d04abe055b 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.2-alpha-31558'; +$wp_version = '4.2-alpha-31559'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.