From d16c8cf1fc3d5330aa07e07351de3ddc44185964 Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Tue, 2 Dec 2014 00:26:22 +0000 Subject: [PATCH] TinyMCE: update the wpView toolbar to look the same as the new image toolbar. Fixes #30561. Built from https://develop.svn.wordpress.org/trunk@30694 git-svn-id: http://core.svn.wordpress.org/trunk@30684 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/js/mce-view.js | 4 +- wp-includes/js/mce-view.min.js | 2 +- .../js/tinymce/plugins/wpview/plugin.js | 28 +++- .../js/tinymce/plugins/wpview/plugin.min.js | 2 +- .../skins/wordpress/images/dashicon-edit.png | Bin 251 -> 368 bytes .../wordpress/images/dashicon-no-alt.png | Bin 164 -> 0 bytes .../skins/wordpress/images/dashicon-no.png | Bin 0 -> 339 bytes .../js/tinymce/skins/wordpress/wp-content.css | 145 ++++++++++-------- wp-includes/js/tinymce/wp-tinymce.js.gz | Bin 136017 -> 136145 bytes wp-includes/version.php | 2 +- 10 files changed, 112 insertions(+), 71 deletions(-) delete mode 100644 wp-includes/js/tinymce/skins/wordpress/images/dashicon-no-alt.png create mode 100644 wp-includes/js/tinymce/skins/wordpress/images/dashicon-no.png diff --git a/wp-includes/js/mce-view.js b/wp-includes/js/mce-view.js index ab33cb4bcf..da1ce6aed2 100644 --- a/wp-includes/js/mce-view.js +++ b/wp-includes/js/mce-view.js @@ -56,9 +56,9 @@ window.wp = window.wp || {}; this.setContent( '

\u00a0

' + '
' + - '
' + + '
' + ( _.isFunction( views[ this.type ].edit ) ? '
' : '' ) + - '
' + + '
' + '
' + '
' + ( this.getHtml() || this.loadingPlaceholder() ) + diff --git a/wp-includes/js/mce-view.min.js b/wp-includes/js/mce-view.min.js index 3c809ff4e2..697251e9da 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){"use strict";var b={},c={},d=wp.media,e=[],f=0,g=50,h=["encodedText"];wp.mce=wp.mce||{},wp.mce.View=function(a){a=a||{},this.type=a.type,_.extend(this,_.pick(a,h)),this.initialize.apply(this,arguments)},_.extend(wp.mce.View.prototype,{initialize:function(){},getHtml:function(){return""},loadingPlaceholder:function(){return'
'},render:function(c){(c||!this.rendered())&&(this.unbind(),this.setContent('

 

'+(_.isFunction(b[this.type].edit)?'
':"")+'
'+(this.getHtml()||this.loadingPlaceholder())+"
"+(this.overlay?'
':"")+'

 

',"wrap"),a(this).trigger("ready"),this.rendered(!0))},unbind:function(){},getEditors:function(a){var b=[];return _.each(tinymce.editors,function(c){c.plugins.wpview&&(a&&a(c),b.push(c))},this),b},getNodes:function(b){var c=[],d=this;return this.getEditors(function(e){a(e.getBody()).find('[data-wpview-text="'+d.encodedText+'"]').each(function(d,f){b&&b(e,f,a(f).find(".wpview-content").get(0)),c.push(f)})}),c},setContent:function(a,b){this.getNodes(function(c,d,e){var f="wrap"===b||"replace"===b?d:e,g=a;_.isString(g)&&(g=c.dom.createFragment(g)),"replace"===b?c.dom.replace(g,f):(f.innerHTML="",f.appendChild(g))})},setIframes:function(b,c){var d=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver,e="video"===this.type||"audio"===this.type||"playlist"===this.type;b||-1!==c.indexOf("'+b+o+''+c+""),k.close(),m=function(){j.contentWindow&&a(j).height(a(k.body).height())},d)new d(_.debounce(function(){m()},100)).observe(k.body,{attributes:!0,childList:!0,subtree:!0});else for(l=1;6>l;l++)setTimeout(m,700*l);e&&f.on("wp-body-class-change",function(){k.body.className=f.getBody().className})},g)}):this.setContent(c)},setError:function(a,b){this.setContent('

'+a+"

")},rendered:function(b){var c;return this.getNodes(function(d,e){null!=b?a(e).data("rendered",b===!0):c=c||!a(e).data("rendered")}),!c}}),wp.mce.View.extend=Backbone.View.extend,wp.mce.views={register:function(a,c){var d={type:a,View:{},toView:function(a){var b=wp.shortcode.next(this.type,a);if(b)return{index:b.index,content:b.content,options:{shortcode:b.shortcode}}}};c=_.defaults(c,d),c.View=wp.mce.View.extend(c.View),b[a]=c},get:function(a){return b[a]},unregister:function(a){delete b[a]},unbind:function(){_.each(c,function(a){a.unbind()})},toViews:function(a){var c,d=[{content:a}];return _.each(b,function(a,b){c=d.slice(),d=[],_.each(c,function(c){var e,f=c.content;if(c.processed)return void d.push(c);for(;f&&(e=a.toView(f));)e.index&&d.push({content:f.substring(0,e.index)}),d.push({content:wp.mce.views.toView(b,e.content,e.options),processed:!0}),f=f.slice(e.index+e.content.length);f&&d.push({content:f})})}),_.pluck(d,"content").join("")},toView:function(a,b,d){var e,f,g=wp.mce.views.get(a),h=window.encodeURIComponent(b);return g?(wp.mce.views.getInstance(h)||(f=d,f.type=a,f.encodedText=h,e=new g.View(f),c[h]=e),wp.html.string({tag:"div",attrs:{"class":"wpview-wrap","data-wpview-text":h,"data-wpview-type":a},content:" "})):b},refreshView:function(a,b,d){var e,f,g,h=window.encodeURIComponent(b);g=wp.mce.views.getInstance(h),g||(f=a.toView(b),e=f.options,e.type=a.type,e.encodedText=h,g=new a.View(e),c[h]=g),g.render(d)},getInstance:function(a){return c[a]},render:function(a){_.each(c,function(b){b.render(a)})},edit:function(b){var c=a(b).data("wpview-type"),d=wp.mce.views.get(c);d&&d.edit(b)}},wp.mce.views.register("gallery",{View:{template:d.template("editor-gallery"),postID:a("#post_ID").val(),initialize:function(a){this.shortcode=a.shortcode,this.fetch()},fetch:function(){var a=this;this.attachments=wp.media.gallery.attachments(this.shortcode,this.postID),this.dfd=this.attachments.more().done(function(){a.render(!0)})},getHtml:function(){var a,b=this.shortcode.attrs.named,c=!1;return this.dfd&&"pending"===this.dfd.state()&&!this.attachments.length?"":(this.attachments.length&&(c=this.attachments.toJSON(),_.each(c,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))})),a={attachments:c,columns:b.columns?parseInt(b.columns,10):wp.media.galleryDefaults.columns},this.template(a))}},edit:function(b){var c,d,e=wp.media.gallery,f=this;d=window.decodeURIComponent(a(b).attr("data-wpview-text")),c=e.edit(d),c.state("gallery-edit").on("update",function(c){var g,h=e.shortcode(c).string();a(b).attr("data-wpview-text",window.encodeURIComponent(h)),g=d!==h,wp.mce.views.refreshView(f,h,g)}),c.on("close",function(){c.detach()})}}),wp.mce.av={View:{overlay:!0,action:"parse-media-shortcode",initialize:function(b){var c=this;this.shortcode=b.shortcode,_.bindAll(this,"setIframes","setNodes","fetch","stopPlayers"),a(this).on("ready",this.setNodes),a(document).on("media:edit",this.stopPlayers),this.fetch(),this.getEditors(function(a){a.on("hide",function(){e=[],f=0,c.stopPlayers()})})},pauseOtherWindows:function(a){_.each(e,function(b){b.sandboxId!==a.sandboxId&&_.each(b.mejs.players,function(a){a.pause()})})},iframeLoaded:function(b){return _.bind(function(){var c;b.mejs&&!_.isEmpty(b.mejs.players)&&(b.sandboxId=f,f++,e.push(b),c=_.bind(function(){this.pauseOtherWindows(b)},this),_.isEmpty(b.mejs.MediaPluginBridge.pluginMediaElements)||_.each(b.mejs.MediaPluginBridge.pluginMediaElements,function(a){a.addEventListener("play",c)}),_.each(b.mejs.players,function(b){a(b.node).on("play",c)},this))},this)},listenToSandboxes:function(){_.each(this.getNodes(),function(b){var c,d=a(".wpview-sandbox",b).get(0);d&&(c=d.contentWindow)&&a(c).load(_.bind(this.iframeLoaded(c),this))},this)},deferredListen:function(){window.setTimeout(_.bind(this.listenToSandboxes,this),this.getNodes().length*g)},setNodes:function(){this.parsed?(this.setIframes(this.parsed.head,this.parsed.body),this.deferredListen()):this.fail()},fetch:function(){var b=this;wp.ajax.send(this.action,{data:{post_ID:a("#post_ID").val()||0,type:this.shortcode.tag,shortcode:this.shortcode.string()}}).done(function(a){a?(b.parsed=a,b.setIframes(a.head,a.body),b.deferredListen()):b.fail(!0)}).fail(function(a){b.fail(a||!0)})},fail:function(a){if(!this.error){if(!a)return;this.error=a}this.error.message?"not-embeddable"===this.error.type&&"embed"===this.type||"not-ssl"===this.error.type||"no-items"===this.error.type?this.setError(this.error.message,"admin-media"):this.setContent("

"+this.original+"

","replace"):this.error.statusText?this.setError(this.error.statusText,"admin-media"):this.original&&this.setContent("

"+this.original+"

","replace")},stopPlayers:function(b){var c="remove"===b;this.getNodes(function(b,d,e){var f,g,h=a("iframe.wpview-sandbox",e).get(0);if(h&&(g=h.contentWindow)&&g.mejs)try{for(f in g.mejs.players)g.mejs.players[f].pause(),c&&g.mejs.players[f].remove()}catch(i){}})},unbind:function(){this.stopPlayers("remove")}},edit:function(b){var c,d,e,f=wp.media[this.type],g=this;a(document).trigger("media:edit"),d=window.decodeURIComponent(a(b).attr("data-wpview-text")),c=f.edit(d),c.on("close",function(){c.detach()}),e=function(d){var e=wp.media[g.type].shortcode(d).string();a(b).attr("data-wpview-text",window.encodeURIComponent(e)),wp.mce.views.refreshView(g,e),c.detach()},_.isArray(g.state)?_.each(g.state,function(a){c.state(a).on("update",e)}):c.state(g.state).on("update",e),c.open()}},wp.mce.views.register("video",_.extend({},wp.mce.av,{state:"video-details"})),wp.mce.views.register("audio",_.extend({},wp.mce.av,{state:"audio-details"})),wp.mce.views.register("playlist",_.extend({},wp.mce.av,{state:["playlist-edit","video-playlist-edit"]})),wp.mce.embedMixin={View:_.extend({},wp.mce.av.View,{overlay:!0,action:"parse-embed",initialize:function(b){this.content=b.content,this.original=b.url||b.shortcode.string(),this.shortcode=b.url?d.embed.shortcode({url:b.url}):b.shortcode,_.bindAll(this,"setIframes","setNodes","fetch"),a(this).on("ready",this.setNodes),this.fetch()}}),edit:function(b){var c,e,f=d.embed,g=this,h="embedURL"===this.type;a(document).trigger("media:edit"),e=window.decodeURIComponent(a(b).attr("data-wpview-text")),c=f.edit(e,h),c.on("close",function(){c.detach()}),c.state("embed").props.on("change:url",function(a,b){b&&(c.state("embed").metadata=a.toJSON())}),c.state("embed").on("select",function(){var d;d=h?c.state("embed").metadata.url:f.shortcode(c.state("embed").metadata).string(),a(b).attr("data-wpview-text",window.encodeURIComponent(d)),wp.mce.views.refreshView(g,d),c.detach()}),c.open()}},wp.mce.views.register("embed",_.extend({},wp.mce.embedMixin)),wp.mce.views.register("embedURL",_.extend({},wp.mce.embedMixin,{toView:function(a){var b=/(?:^|

)(https?:\/\/[^\s"]+?)(?:<\/p>\s*|$)/gi,c=b.exec(tinymce.trim(a));if(c)return{index:c.index,content:c[0],options:{url:c[1]}}}}))}(jQuery); \ No newline at end of file +window.wp=window.wp||{},function(a){"use strict";var b={},c={},d=wp.media,e=[],f=0,g=50,h=["encodedText"];wp.mce=wp.mce||{},wp.mce.View=function(a){a=a||{},this.type=a.type,_.extend(this,_.pick(a,h)),this.initialize.apply(this,arguments)},_.extend(wp.mce.View.prototype,{initialize:function(){},getHtml:function(){return""},loadingPlaceholder:function(){return'

'},render:function(c){(c||!this.rendered())&&(this.unbind(),this.setContent('

 

'+(_.isFunction(b[this.type].edit)?'
':"")+'
'+(this.getHtml()||this.loadingPlaceholder())+"
"+(this.overlay?'
':"")+'

 

',"wrap"),a(this).trigger("ready"),this.rendered(!0))},unbind:function(){},getEditors:function(a){var b=[];return _.each(tinymce.editors,function(c){c.plugins.wpview&&(a&&a(c),b.push(c))},this),b},getNodes:function(b){var c=[],d=this;return this.getEditors(function(e){a(e.getBody()).find('[data-wpview-text="'+d.encodedText+'"]').each(function(d,f){b&&b(e,f,a(f).find(".wpview-content").get(0)),c.push(f)})}),c},setContent:function(a,b){this.getNodes(function(c,d,e){var f="wrap"===b||"replace"===b?d:e,g=a;_.isString(g)&&(g=c.dom.createFragment(g)),"replace"===b?c.dom.replace(g,f):(f.innerHTML="",f.appendChild(g))})},setIframes:function(b,c){var d=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver,e="video"===this.type||"audio"===this.type||"playlist"===this.type;b||-1!==c.indexOf("'+b+o+''+c+""),k.close(),m=function(){j.contentWindow&&a(j).height(a(k.body).height())},d)new d(_.debounce(function(){m()},100)).observe(k.body,{attributes:!0,childList:!0,subtree:!0});else for(l=1;6>l;l++)setTimeout(m,700*l);e&&f.on("wp-body-class-change",function(){k.body.className=f.getBody().className})},g)}):this.setContent(c)},setError:function(a,b){this.setContent('

'+a+"

")},rendered:function(b){var c;return this.getNodes(function(d,e){null!=b?a(e).data("rendered",b===!0):c=c||!a(e).data("rendered")}),!c}}),wp.mce.View.extend=Backbone.View.extend,wp.mce.views={register:function(a,c){var d={type:a,View:{},toView:function(a){var b=wp.shortcode.next(this.type,a);if(b)return{index:b.index,content:b.content,options:{shortcode:b.shortcode}}}};c=_.defaults(c,d),c.View=wp.mce.View.extend(c.View),b[a]=c},get:function(a){return b[a]},unregister:function(a){delete b[a]},unbind:function(){_.each(c,function(a){a.unbind()})},toViews:function(a){var c,d=[{content:a}];return _.each(b,function(a,b){c=d.slice(),d=[],_.each(c,function(c){var e,f=c.content;if(c.processed)return void d.push(c);for(;f&&(e=a.toView(f));)e.index&&d.push({content:f.substring(0,e.index)}),d.push({content:wp.mce.views.toView(b,e.content,e.options),processed:!0}),f=f.slice(e.index+e.content.length);f&&d.push({content:f})})}),_.pluck(d,"content").join("")},toView:function(a,b,d){var e,f,g=wp.mce.views.get(a),h=window.encodeURIComponent(b);return g?(wp.mce.views.getInstance(h)||(f=d,f.type=a,f.encodedText=h,e=new g.View(f),c[h]=e),wp.html.string({tag:"div",attrs:{"class":"wpview-wrap","data-wpview-text":h,"data-wpview-type":a},content:" "})):b},refreshView:function(a,b,d){var e,f,g,h=window.encodeURIComponent(b);g=wp.mce.views.getInstance(h),g||(f=a.toView(b),e=f.options,e.type=a.type,e.encodedText=h,g=new a.View(e),c[h]=g),g.render(d)},getInstance:function(a){return c[a]},render:function(a){_.each(c,function(b){b.render(a)})},edit:function(b){var c=a(b).data("wpview-type"),d=wp.mce.views.get(c);d&&d.edit(b)}},wp.mce.views.register("gallery",{View:{template:d.template("editor-gallery"),postID:a("#post_ID").val(),initialize:function(a){this.shortcode=a.shortcode,this.fetch()},fetch:function(){var a=this;this.attachments=wp.media.gallery.attachments(this.shortcode,this.postID),this.dfd=this.attachments.more().done(function(){a.render(!0)})},getHtml:function(){var a,b=this.shortcode.attrs.named,c=!1;return this.dfd&&"pending"===this.dfd.state()&&!this.attachments.length?"":(this.attachments.length&&(c=this.attachments.toJSON(),_.each(c,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))})),a={attachments:c,columns:b.columns?parseInt(b.columns,10):wp.media.galleryDefaults.columns},this.template(a))}},edit:function(b){var c,d,e=wp.media.gallery,f=this;d=window.decodeURIComponent(a(b).attr("data-wpview-text")),c=e.edit(d),c.state("gallery-edit").on("update",function(c){var g,h=e.shortcode(c).string();a(b).attr("data-wpview-text",window.encodeURIComponent(h)),g=d!==h,wp.mce.views.refreshView(f,h,g)}),c.on("close",function(){c.detach()})}}),wp.mce.av={View:{overlay:!0,action:"parse-media-shortcode",initialize:function(b){var c=this;this.shortcode=b.shortcode,_.bindAll(this,"setIframes","setNodes","fetch","stopPlayers"),a(this).on("ready",this.setNodes),a(document).on("media:edit",this.stopPlayers),this.fetch(),this.getEditors(function(a){a.on("hide",function(){e=[],f=0,c.stopPlayers()})})},pauseOtherWindows:function(a){_.each(e,function(b){b.sandboxId!==a.sandboxId&&_.each(b.mejs.players,function(a){a.pause()})})},iframeLoaded:function(b){return _.bind(function(){var c;b.mejs&&!_.isEmpty(b.mejs.players)&&(b.sandboxId=f,f++,e.push(b),c=_.bind(function(){this.pauseOtherWindows(b)},this),_.isEmpty(b.mejs.MediaPluginBridge.pluginMediaElements)||_.each(b.mejs.MediaPluginBridge.pluginMediaElements,function(a){a.addEventListener("play",c)}),_.each(b.mejs.players,function(b){a(b.node).on("play",c)},this))},this)},listenToSandboxes:function(){_.each(this.getNodes(),function(b){var c,d=a(".wpview-sandbox",b).get(0);d&&(c=d.contentWindow)&&a(c).load(_.bind(this.iframeLoaded(c),this))},this)},deferredListen:function(){window.setTimeout(_.bind(this.listenToSandboxes,this),this.getNodes().length*g)},setNodes:function(){this.parsed?(this.setIframes(this.parsed.head,this.parsed.body),this.deferredListen()):this.fail()},fetch:function(){var b=this;wp.ajax.send(this.action,{data:{post_ID:a("#post_ID").val()||0,type:this.shortcode.tag,shortcode:this.shortcode.string()}}).done(function(a){a?(b.parsed=a,b.setIframes(a.head,a.body),b.deferredListen()):b.fail(!0)}).fail(function(a){b.fail(a||!0)})},fail:function(a){if(!this.error){if(!a)return;this.error=a}this.error.message?"not-embeddable"===this.error.type&&"embed"===this.type||"not-ssl"===this.error.type||"no-items"===this.error.type?this.setError(this.error.message,"admin-media"):this.setContent("

"+this.original+"

","replace"):this.error.statusText?this.setError(this.error.statusText,"admin-media"):this.original&&this.setContent("

"+this.original+"

","replace")},stopPlayers:function(b){var c="remove"===b;this.getNodes(function(b,d,e){var f,g,h=a("iframe.wpview-sandbox",e).get(0);if(h&&(g=h.contentWindow)&&g.mejs)try{for(f in g.mejs.players)g.mejs.players[f].pause(),c&&g.mejs.players[f].remove()}catch(i){}})},unbind:function(){this.stopPlayers("remove")}},edit:function(b){var c,d,e,f=wp.media[this.type],g=this;a(document).trigger("media:edit"),d=window.decodeURIComponent(a(b).attr("data-wpview-text")),c=f.edit(d),c.on("close",function(){c.detach()}),e=function(d){var e=wp.media[g.type].shortcode(d).string();a(b).attr("data-wpview-text",window.encodeURIComponent(e)),wp.mce.views.refreshView(g,e),c.detach()},_.isArray(g.state)?_.each(g.state,function(a){c.state(a).on("update",e)}):c.state(g.state).on("update",e),c.open()}},wp.mce.views.register("video",_.extend({},wp.mce.av,{state:"video-details"})),wp.mce.views.register("audio",_.extend({},wp.mce.av,{state:"audio-details"})),wp.mce.views.register("playlist",_.extend({},wp.mce.av,{state:["playlist-edit","video-playlist-edit"]})),wp.mce.embedMixin={View:_.extend({},wp.mce.av.View,{overlay:!0,action:"parse-embed",initialize:function(b){this.content=b.content,this.original=b.url||b.shortcode.string(),this.shortcode=b.url?d.embed.shortcode({url:b.url}):b.shortcode,_.bindAll(this,"setIframes","setNodes","fetch"),a(this).on("ready",this.setNodes),this.fetch()}}),edit:function(b){var c,e,f=d.embed,g=this,h="embedURL"===this.type;a(document).trigger("media:edit"),e=window.decodeURIComponent(a(b).attr("data-wpview-text")),c=f.edit(e,h),c.on("close",function(){c.detach()}),c.state("embed").props.on("change:url",function(a,b){b&&(c.state("embed").metadata=a.toJSON())}),c.state("embed").on("select",function(){var d;d=h?c.state("embed").metadata.url:f.shortcode(c.state("embed").metadata).string(),a(b).attr("data-wpview-text",window.encodeURIComponent(d)),wp.mce.views.refreshView(g,d),c.detach()}),c.open()}},wp.mce.views.register("embed",_.extend({},wp.mce.embedMixin)),wp.mce.views.register("embedURL",_.extend({},wp.mce.embedMixin,{toView:function(a){var b=/(?:^|

)(https?:\/\/[^\s"]+?)(?:<\/p>\s*|$)/gi,c=b.exec(tinymce.trim(a));if(c)return{index:c.index,content:c[0],options:{url:c[1]}}}}))}(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 3de4949f86..6016e3bdc2 100644 --- a/wp-includes/js/tinymce/plugins/wpview/plugin.js +++ b/wp-includes/js/tinymce/plugins/wpview/plugin.js @@ -115,8 +115,13 @@ tinymce.PluginManager.add( 'wpview', function( editor ) { var clipboard, dom = editor.dom; - // Bail if node is already selected. - if ( ! viewNode || viewNode === selected ) { + if ( ! viewNode ) { + return; + } + + // Adjust the toolbar position and bail if node is already selected. + if ( viewNode === selected ) { + adjustToolbarPosition( viewNode ); return; } @@ -128,6 +133,7 @@ tinymce.PluginManager.add( 'wpview', function( editor ) { deselect(); selected = viewNode; dom.setAttrib( viewNode, 'data-mce-selected', 1 ); + adjustToolbarPosition( viewNode ); clipboard = dom.create( 'div', { 'class': 'wpview-clipboard', @@ -151,6 +157,24 @@ tinymce.PluginManager.add( 'wpview', function( editor ) { editor.fire( 'wpview-selected', viewNode ); } + function adjustToolbarPosition( viewNode ) { + var delta = 0, + toolbar = editor.$( viewNode ).find( '.toolbar' ), + editorToolbar = tinymce.$( editor.editorContainer ).find( '.mce-toolbar-grp' )[0], + editorToolbarBottom = ( editorToolbar && editorToolbar.getBoundingClientRect().bottom ) || 0; + + if ( toolbar.length && editor.iframeElement ) { + // 48 = 43 for the toolbar + 5 buffer + delta = viewNode.getBoundingClientRect().top + editor.iframeElement.getBoundingClientRect().top - editorToolbarBottom - 48; + } + + if ( delta < 0 ) { + toolbar.removeClass( 'mce-arrow-down' ).css({ top: ( -43 + delta * -1 ) }); + } else if ( delta > 0 && ! toolbar.hasClass( 'mce-arrow-down' ) ) { + toolbar.addClass( 'mce-arrow-down' ).css({ top: '' }); + } + } + /** * Deselect a selected view and remove clipboard */ diff --git a/wp-includes/js/tinymce/plugins/wpview/plugin.min.js b/wp-includes/js/tinymce/plugins/wpview/plugin.min.js index 4e0d998ac2..6cdef61e81 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(c){return(c=b(c))?window.decodeURIComponent(a.dom.getAttrib(c,"data-wpview-text")||""):""}function e(c,d){return c=b(c),c?(a.dom.setAttrib(c,"data-wpview-text",window.encodeURIComponent(d||"")),!0):!1}function f(a){a.stopPropagation()}function g(b,c){var d=b?"before":"after",e=b?0:1;k(),a.selection.setCursorLocation(a.dom.select(".wpview-selection-"+d,c)[0],e),a.nodeChanged()}function h(b,c,d){var e=a.dom,f=e.create("p");u.ie&&u.ie<11||(f.innerHTML='
'),c?b.parentNode.insertBefore(f,b):e.insertAfter(f,b),k(),c&&d===v.ENTER?g(c,b):a.selection.setCursorLocation(f,0),a.nodeChanged()}function i(b){a.undoManager.transact(function(){h(b),a.dom.remove(b)})}function j(b){var c,e=a.dom;b&&b!==n&&(a.getBody().focus(),k(),n=b,e.setAttrib(b,"data-mce-selected",1),c=e.create("div",{"class":"wpview-clipboard",contenteditable:"true"},d(b)),a.dom.select(".wpview-body",b)[0].appendChild(c),e.bind(c,"beforedeactivate focusin focusout",f),e.bind(n,"beforedeactivate focusin focusout",f),A?a.selection.select(c):a.selection.select(c,!0),a.nodeChanged(),a.fire("wpview-selected",b))}function k(){var b,c=a.dom;n&&(b=a.dom.select(".wpview-clipboard",n)[0],c.unbind(b),c.remove(b),c.unbind(n,"beforedeactivate focusin focusout click mouseup",f),c.setAttrib(n,"data-mce-selected",null)),n=null}function l(a){return a.replace(/]+data-wpview-text=\"([^"]+)"[^>]*>[\s\S]+?wpview-selection-after[^>]+>(?: |\u00a0)*<\/p><\/div>/g,"$1")}function m(a){return 47>=a&&a!==v.SPACEBAR&&a!==v.ENTER&&a!==v.DELETE&&a!==v.BACKSPACE&&(37>a||a>40)||a>=224||a>=144&&150>=a||a>=91&&93>=a||a>=112&&135>=a}var n,o,p,q,r,s,t,u=tinymce.Env,v=tinymce.util.VK,w=tinymce.dom.TreeWalker,x=!1,y=!0,z=function(){return!1},A=/iPad|iPod|iPhone/.test(navigator.userAgent);return"undefined"!=typeof wp&&wp.mce?(a.on("BeforeAddUndo",function(a){a.lastLevel&&l(a.level.content)===l(a.lastLevel.content)&&a.preventDefault()}),a.on("BeforeSetContent",function(b){var c;b.content&&(n&&i(n),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.toViews(b.content)))}),a.on("SetContent",function(){wp.mce.views.render()}),a.on("click",function(c){var d,e=c.clientX,f=c.clientY,h=a.getBody(),i=h.getBoundingClientRect(),j=h.firstChild,k=j.getBoundingClientRect(),l=h.lastChild,m=l.getBoundingClientRect();fm.bottom&&(d=b(l))?(g(!1,d),c.preventDefault()):tinymce.each(a.dom.select(".wpview-wrap"),function(a){var b=a.getBoundingClientRect();return f>=b.top&&f<=b.bottom?void(ei.right&&(g(!1,a),c.preventDefault())):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 w(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(y=!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 wp.mce.views.edit(e),a.focus(),!1;if(a.dom.hasClass(d.target,"remove"))return i(e),!1}return"touchend"===d.type&&c?c=!1:j(e),!1}("touchend"===d.type||"mousedown"===d.type)&&k(),"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,e,f,l,o,q,r,s=c.keyCode,t=a.dom,u=a.selection;if(n){if((c.metaKey||c.ctrlKey)&&s!==v.BACKSPACE&&86!==s||s>=112&&123>=s)return void((c.metaKey||c.ctrlKey)&&88===s&&(x=n));if(e=b(u.getNode()),e!==n)return void k();s===v.LEFT?(g(!0,e),c.preventDefault()):s===v.UP?(e.previousSibling?b(e.previousSibling)?g(!0,e.previousSibling):(k(),u.select(e.previousSibling,!0),u.collapse()):g(!0,e),c.preventDefault()):s===v.RIGHT?(g(!1,e),c.preventDefault()):s===v.DOWN?(e.nextSibling?b(e.nextSibling)?g(!1,e.nextSibling):(k(),u.setCursorLocation(e.nextSibling,0)):g(!1,e),c.preventDefault()):m(s)||(i(n),(s===v.ENTER||s===v.DELETE||s===v.BACKSPACE)&&c.preventDefault())}else{if(c.metaKey||c.ctrlKey||s>=112&&123>=s)return;if(d=u.getNode(),p=d,e=b(d),u.isCollapsed()||(o=u.getRng(),(e=b(o.endContainer))?(q=o.cloneRange(),u.select(e.previousSibling,!0),u.collapse(),r=u.getRng(),q.setEnd(r.endContainer,r.endOffset),u.setRng(q)):(e=b(o.startContainer))&&(q=o.cloneRange(),q.setStart(e.nextSibling,0),u.setRng(q))),!e)return void(c.keyCode===v.BACKSPACE&&(a.dom.isEmpty(d)?(e=b(d.previousSibling))&&(g(!1,e),a.dom.remove(d),c.preventDefault()):(o=u.getRng())&&0===o.startOffset&&0===o.endOffset&&(e=b(d.previousSibling))&&(g(!1,e),c.preventDefault())));if(!(f=t.hasClass(e,"wpview-selection-before"))&&!(l=t.hasClass(e,"wpview-selection-after")))return;if(m(s))return;l&&s===v.UP||f&&s===v.BACKSPACE?(e.previousSibling?b(e.previousSibling)?g(!1,e.previousSibling):t.isEmpty(e.previousSibling)&&s===v.BACKSPACE?t.remove(e.previousSibling):(u.select(e.previousSibling,!0),u.collapse()):g(!0,e),c.preventDefault()):!l||s!==v.DOWN&&s!==v.RIGHT?!f||s!==v.UP&&s!==v.LEFT?f&&s===v.DOWN?(e.nextSibling?b(e.nextSibling)?g(!0,e.nextSibling):u.setCursorLocation(e.nextSibling,0):g(!1,e),c.preventDefault()):l&&s===v.LEFT||f&&s===v.RIGHT?(j(e),c.preventDefault()):l&&s===v.BACKSPACE?(i(e),c.preventDefault()):l?h(e):f&&h(e,!0,s):(e.previousSibling&&(b(e.previousSibling)?g(s===v.UP,e.previousSibling):(u.select(e.previousSibling,!0),u.collapse())),c.preventDefault()):(e.nextSibling&&(b(e.nextSibling)?g(s===v.RIGHT,e.nextSibling):u.setCursorLocation(e.nextSibling,0)),c.preventDefault()),s===v.ENTER&&c.preventDefault()}}),a.on("keyup",function(){x&&(i(x),x=!1)}),a.on("focus",function(){var c;r=!0,a.dom.addClass(a.getBody(),"has-focus"),y&&(c=b(a.getBody().firstChild))&&g(!0,c),y=!1}),a.on("blur",function(){r=!1,a.dom.removeClass(a.getBody(),"has-focus")}),a.on("NodeChange",function(d){var e=a.dom,f=a.dom.select(".wpview-wrap"),h=d.element.className,i=b(d.element),j=p;if(p=!1,clearInterval(o),tinymce.each(f,function(a){a.className&&(a.className=a.className.replace(/ ?\bwpview-(?:selection-before|selection-after|cursor-hide)\b/g,""))}),r&&i)if("wpview-selection-before"!==h&&"wpview-selection-after"!==h||!a.selection.isCollapsed())c(d.element,"wpview-clipboard")||q||(k(),q++,g(!0,i));else{if(q=0,k(),j===i.previousSibling)return void g(!0,i);if(j===i.nextSibling)return void g(!1,i);e.addClass(i,h),o=setInterval(function(){e.hasClass(i,"wpview-cursor-hide")?e.removeClass(i,"wpview-cursor-hide"):e.addClass(i,"wpview-cursor-hide")},500)}}),a.on("BeforeExecCommand",function(){var c,d=a.selection.getNode();d&&((t="wpview-selection-before"===d.className)||"wpview-selection-after"===d.className)&&(c=b(d))&&(h(c,t),s=c)}),a.on("ExecCommand",function(){var b,c;n&&(b=n,k(),j(b)),s&&(c=s[t?"previousSibling":"nextSibling"],c&&"P"===c.nodeName&&a.dom.isEmpty(c)&&(a.dom.remove(c),g(t,s)),s=!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())}),{getViewText:d,setViewText:e,getView:b}):{getViewText:z,setViewText:z,getView:z}}); \ 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(c){return(c=b(c))?window.decodeURIComponent(a.dom.getAttrib(c,"data-wpview-text")||""):""}function e(c,d){return c=b(c),c?(a.dom.setAttrib(c,"data-wpview-text",window.encodeURIComponent(d||"")),!0):!1}function f(a){a.stopPropagation()}function g(b,c){var d=b?"before":"after",e=b?0:1;l(),a.selection.setCursorLocation(a.dom.select(".wpview-selection-"+d,c)[0],e),a.nodeChanged()}function h(b,c,d){var e=a.dom,f=e.create("p");v.ie&&v.ie<11||(f.innerHTML='
'),c?b.parentNode.insertBefore(f,b):e.insertAfter(f,b),l(),c&&d===w.ENTER?g(c,b):a.selection.setCursorLocation(f,0),a.nodeChanged()}function i(b){a.undoManager.transact(function(){h(b),a.dom.remove(b)})}function j(b){var c,e=a.dom;if(b){if(b===o)return void k(b);a.getBody().focus(),l(),o=b,e.setAttrib(b,"data-mce-selected",1),k(b),c=e.create("div",{"class":"wpview-clipboard",contenteditable:"true"},d(b)),a.dom.select(".wpview-body",b)[0].appendChild(c),e.bind(c,"beforedeactivate focusin focusout",f),e.bind(o,"beforedeactivate focusin focusout",f),B?a.selection.select(c):a.selection.select(c,!0),a.nodeChanged(),a.fire("wpview-selected",b)}}function k(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 l(){var b,c=a.dom;o&&(b=a.dom.select(".wpview-clipboard",o)[0],c.unbind(b),c.remove(b),c.unbind(o,"beforedeactivate focusin focusout click mouseup",f),c.setAttrib(o,"data-mce-selected",null)),o=null}function m(a){return a.replace(/]+data-wpview-text=\"([^"]+)"[^>]*>[\s\S]+?wpview-selection-after[^>]+>(?: |\u00a0)*<\/p><\/div>/g,"$1")}function n(a){return 47>=a&&a!==w.SPACEBAR&&a!==w.ENTER&&a!==w.DELETE&&a!==w.BACKSPACE&&(37>a||a>40)||a>=224||a>=144&&150>=a||a>=91&&93>=a||a>=112&&135>=a}var o,p,q,r,s,t,u,v=tinymce.Env,w=tinymce.util.VK,x=tinymce.dom.TreeWalker,y=!1,z=!0,A=function(){return!1},B=/iPad|iPod|iPhone/.test(navigator.userAgent);return"undefined"!=typeof wp&&wp.mce?(a.on("BeforeAddUndo",function(a){a.lastLevel&&m(a.level.content)===m(a.lastLevel.content)&&a.preventDefault()}),a.on("BeforeSetContent",function(b){var c;b.content&&(o&&i(o),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.toViews(b.content)))}),a.on("SetContent",function(){wp.mce.views.render()}),a.on("click",function(c){var d,e=c.clientX,f=c.clientY,h=a.getBody(),i=h.getBoundingClientRect(),j=h.firstChild,k=j.getBoundingClientRect(),l=h.lastChild,m=l.getBoundingClientRect();fm.bottom&&(d=b(l))?(g(!1,d),c.preventDefault()):tinymce.each(a.dom.select(".wpview-wrap"),function(a){var b=a.getBoundingClientRect();return f>=b.top&&f<=b.bottom?void(ei.right&&(g(!1,a),c.preventDefault())):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 x(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(z=!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 wp.mce.views.edit(e),a.focus(),!1;if(a.dom.hasClass(d.target,"remove"))return i(e),!1}return"touchend"===d.type&&c?c=!1:j(e),!1}("touchend"===d.type||"mousedown"===d.type)&&l(),"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,e,f,k,m,p,r,s=c.keyCode,t=a.dom,u=a.selection;if(o){if((c.metaKey||c.ctrlKey)&&s!==w.BACKSPACE&&86!==s||s>=112&&123>=s)return void((c.metaKey||c.ctrlKey)&&88===s&&(y=o));if(e=b(u.getNode()),e!==o)return void l();s===w.LEFT?(g(!0,e),c.preventDefault()):s===w.UP?(e.previousSibling?b(e.previousSibling)?g(!0,e.previousSibling):(l(),u.select(e.previousSibling,!0),u.collapse()):g(!0,e),c.preventDefault()):s===w.RIGHT?(g(!1,e),c.preventDefault()):s===w.DOWN?(e.nextSibling?b(e.nextSibling)?g(!1,e.nextSibling):(l(),u.setCursorLocation(e.nextSibling,0)):g(!1,e),c.preventDefault()):n(s)||(i(o),(s===w.ENTER||s===w.DELETE||s===w.BACKSPACE)&&c.preventDefault())}else{if(c.metaKey||c.ctrlKey||s>=112&&123>=s)return;if(d=u.getNode(),q=d,e=b(d),u.isCollapsed()||(m=u.getRng(),(e=b(m.endContainer))?(p=m.cloneRange(),u.select(e.previousSibling,!0),u.collapse(),r=u.getRng(),p.setEnd(r.endContainer,r.endOffset),u.setRng(p)):(e=b(m.startContainer))&&(p=m.cloneRange(),p.setStart(e.nextSibling,0),u.setRng(p))),!e)return void(c.keyCode===w.BACKSPACE&&(a.dom.isEmpty(d)?(e=b(d.previousSibling))&&(g(!1,e),a.dom.remove(d),c.preventDefault()):(m=u.getRng())&&0===m.startOffset&&0===m.endOffset&&(e=b(d.previousSibling))&&(g(!1,e),c.preventDefault())));if(!(f=t.hasClass(e,"wpview-selection-before"))&&!(k=t.hasClass(e,"wpview-selection-after")))return;if(n(s))return;k&&s===w.UP||f&&s===w.BACKSPACE?(e.previousSibling?b(e.previousSibling)?g(!1,e.previousSibling):t.isEmpty(e.previousSibling)&&s===w.BACKSPACE?t.remove(e.previousSibling):(u.select(e.previousSibling,!0),u.collapse()):g(!0,e),c.preventDefault()):!k||s!==w.DOWN&&s!==w.RIGHT?!f||s!==w.UP&&s!==w.LEFT?f&&s===w.DOWN?(e.nextSibling?b(e.nextSibling)?g(!0,e.nextSibling):u.setCursorLocation(e.nextSibling,0):g(!1,e),c.preventDefault()):k&&s===w.LEFT||f&&s===w.RIGHT?(j(e),c.preventDefault()):k&&s===w.BACKSPACE?(i(e),c.preventDefault()):k?h(e):f&&h(e,!0,s):(e.previousSibling&&(b(e.previousSibling)?g(s===w.UP,e.previousSibling):(u.select(e.previousSibling,!0),u.collapse())),c.preventDefault()):(e.nextSibling&&(b(e.nextSibling)?g(s===w.RIGHT,e.nextSibling):u.setCursorLocation(e.nextSibling,0)),c.preventDefault()),s===w.ENTER&&c.preventDefault()}}),a.on("keyup",function(){y&&(i(y),y=!1)}),a.on("focus",function(){var c;s=!0,a.dom.addClass(a.getBody(),"has-focus"),z&&(c=b(a.getBody().firstChild))&&g(!0,c),z=!1}),a.on("blur",function(){s=!1,a.dom.removeClass(a.getBody(),"has-focus")}),a.on("NodeChange",function(d){var e=a.dom,f=a.dom.select(".wpview-wrap"),h=d.element.className,i=b(d.element),j=q;if(q=!1,clearInterval(p),tinymce.each(f,function(a){a.className&&(a.className=a.className.replace(/ ?\bwpview-(?:selection-before|selection-after|cursor-hide)\b/g,""))}),s&&i)if("wpview-selection-before"!==h&&"wpview-selection-after"!==h||!a.selection.isCollapsed())c(d.element,"wpview-clipboard")||r||(l(),r++,g(!0,i));else{if(r=0,l(),j===i.previousSibling)return void g(!0,i);if(j===i.nextSibling)return void g(!1,i);e.addClass(i,h),p=setInterval(function(){e.hasClass(i,"wpview-cursor-hide")?e.removeClass(i,"wpview-cursor-hide"):e.addClass(i,"wpview-cursor-hide")},500)}}),a.on("BeforeExecCommand",function(){var c,d=a.selection.getNode();d&&((u="wpview-selection-before"===d.className)||"wpview-selection-after"===d.className)&&(c=b(d))&&(h(c,u),t=c)}),a.on("ExecCommand",function(){var b,c;o&&(b=o,l(),j(b)),t&&(c=t[u?"previousSibling":"nextSibling"],c&&"P"===c.nodeName&&a.dom.isEmpty(c)&&(a.dom.remove(c),g(u,t)),t=!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())}),{getViewText:d,setViewText:e,getView:b}):{getViewText:A,setViewText:A,getView:A}}); \ No newline at end of file diff --git a/wp-includes/js/tinymce/skins/wordpress/images/dashicon-edit.png b/wp-includes/js/tinymce/skins/wordpress/images/dashicon-edit.png index 9b2c54de4206ee3e9518a0e0befddffd760953f7..7c47b1cf28fcc0d62b1b29f1db119334dfb09869 100644 GIT binary patch literal 368 zcmV-$0gwKPP)mKin4c#xp$7PcaE}mj=6V|!G4mif_Ha{hIf*ls+!5|o_BYietM#U zccPM}riOQ>lB%Z3&8nKJu8w!Eo~pUU(Y=z2!IpQ)vX0H|_0ght(e3fk?e*E^?b+@1 z-Li_^@%7>L_36Qq>Gk#T_4W1HuJ!4~_3h2|?a}q^+4c3w_4VQP_38EX_1bef5dZ)H zl1W5CR49?v%-I&fFc?MQ)0$GVG^nWriRn*~_kTE7qLFgnefzDoVgH0$Bk^Yb3yA}b zyc&rEC53Nn0|0FuBJo7uCIGtU0Es7>(%lhE1zRJSqEs5;?1M%yMN`ilKG!W}=Ca62 z=I}m_XA4Lgk!{z>BZ6#J$FMI)gzl*FtksBHS O0000yHtgEWIxwyu~#nRHz-rn8m>FMyiA%gX%Q~ejtA{lGpuzw;_iNg9-x`0RZ?JOq6)YF>L?<002ovPDHLkV1k)7 BZxH|h diff --git a/wp-includes/js/tinymce/skins/wordpress/images/dashicon-no-alt.png b/wp-includes/js/tinymce/skins/wordpress/images/dashicon-no-alt.png deleted file mode 100644 index cc0f927350fc00597fec4558c7478add58df14d7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 164 zcmeAS@N?(olHy`uVBq!ia0vp^av;pY3?xs=ZJr3E_yc@GT)Eg7Vxl8n{UR?EyX^uH_(5RbF0K-nSD-RrT$x z19GMvtebVTZXOVwtebbXY1!4jO;`JNKAd&*>9UI-H}#e8>?_~9^X$QCbw_8_ot#&9 z7KqmMo!zawP*S6|-!`1Rq=zK37GK0P|?>D8-GzkYrB_3PWOUq4=4_VFu_y8HDj zND?j#6sv!F;y=hqo-U3d8t3m$@)l}x;Bk=_5jYy?z$nTl@RQ@t{~Er;nN!#om`Cn; z<+n>~#($3JmdDD=Bd^NT3BTDgb7^&!#Gf4v%bzFlv*>o~@_sdD@Y9nCX?T+PF=|nJ z)Ec8Z;wz45{mtzSWqRYpe2z0AUSiI?hNUO+;%657oV?_2v9ERRdQ-c+ZGY98>Xgi@ V5*1Gg&jvb)!PC{xWt~$(69DO8uHOIv literal 0 HcmV?d00001 diff --git a/wp-includes/js/tinymce/skins/wordpress/wp-content.css b/wp-includes/js/tinymce/skins/wordpress/wp-content.css index ea19a0e6a8..47a820baa8 100644 --- a/wp-includes/js/tinymce/skins/wordpress/wp-content.css +++ b/wp-includes/js/tinymce/skins/wordpress/wp-content.css @@ -224,9 +224,7 @@ audio { /* delegate the handling of the selection to the wpview tinymce plugin */ .wpview-wrap, -.wpview-wrap *, -#wp-image-toolbar, -#wp-image-toolbar * { +.wpview-wrap * { -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; @@ -323,16 +321,89 @@ audio { .wpview-wrap .toolbar { position: absolute; - top: 0; - left: 0; + top: -43px; + left: 45%; + left: calc(50% - 32px); display: none; z-index: 100; + background-color: #f5f5f5; + border: 1px solid #aaa; + padding: 1px; + cursor: default; + -webkit-border-radius: 2px; + border-radius: 2px; + -webkit-box-shadow: 0 1px 4px rgba( 0, 0, 0, 0.2 ); + box-shadow: 0 1px 4px rgba( 0, 0, 0, 0.2 ); + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + margin-bottom: 8px; } .wpview-wrap[data-mce-selected] .toolbar { display: block; } +.wpview-wrap .toolbar:before, +.wpview-wrap .toolbar:after { + position: absolute; + left: 50%; + display: block; + width: 0; + height: 0; + border-style: solid; + border-color: transparent; + border-width: 9px; + margin-left: -9px; + content: ''; +} + +.wpview-wrap .toolbar:after { + border-width: 8px; + margin-left: -8px; +} + +.wpview-wrap .toolbar.mce-arrow-down:before { + bottom: -18px; + border-top-color: #aaa; +} + +.wpview-wrap .toolbar.mce-arrow-down:after { + bottom: -16px; + border-top-color: #f5f5f5; +} + +.wpview-wrap .toolbar.mce-arrow-up:before { + top: -18px; + border-bottom-color: #aaa; +} + +.wpview-wrap .toolbar.mce-arrow-up:after { + top: -16px; + border-bottom-color: #f5f5f5; +} + +.wpview-wrap .toolbar div { + margin: 2px; + padding: 2px 3px; + width: 20px; + height: 20px; + color: #777; + cursor: pointer; + font-size: 20px; + border: 1px solid transparent; + border-radius: 2px; +} + +.wpview-wrap .toolbar div:hover { + background-color: #fafafa; + border-color: #999; + color: #222; + -webkit-box-shadow: inset 0 1px 0 #fff, 0 1px 0 rgba( 0, 0, 0, 0.08 ); + box-shadow: inset 0 1px 0 #fff, 0 1px 0 rgba( 0, 0, 0, 0.08 ); + outline: none; +} + .wpview-wrap .loading-placeholder { border: 1px dashed #ccc; padding: 10px; @@ -384,32 +455,10 @@ audio { background: transparent; } -#wp-image-toolbar { - position: absolute; - margin: 0; -} - -.wpview-wrap .toolbar div, -#wp-image-toolbar i { - margin-top: 7px; - margin-left: 7px; - padding: 2px; - width: 30px; - height: 30px; - box-shadow: 0 1px 3px rgba(0,0,0,0.5); - background-color: #000; - background-color: rgba(0,0,0,0.9); - cursor: pointer; - color: white; - font-size: 30px; -} - .ie8 .wpview-wrap .toolbar div, -.ie7 .wpview-wrap .toolbar div, -.ie8 #wp-image-toolbar i, -.ie7 #wp-image-toolbar i { +.ie7 .wpview-wrap .toolbar div { display: inline; - padding: 0; + padding: 4px; } .ie8 .dashicons-edit, @@ -417,9 +466,9 @@ audio { background-image: url(images/dashicon-edit.png); } -.ie8 .dashicons-no-alt, -.ie7 .dashicons-no-alt { - background-image: url(images/dashicon-no-alt.png); +.ie8 .dashicons-no, +.ie7 .dashicons-no { + background-image: url(images/dashicon-no.png); } .wpview-error { @@ -448,27 +497,6 @@ audio { font-family: 'Open Sans', sans-serif; } -.wpview-wrap .toolbar div:hover, -#wp-image-toolbar i:hover { - box-shadow: 0 1px 3px rgba(0,0,0,0.8); - background-color: #000; - color: #2ea2cc; -} - -/* Audio player is short; therefore let's put the toolbar above */ -.wpview-wrap[data-wpview-type="audio"] .toolbar { - top: auto; - bottom: -34px; -} - -.wpview-wrap[data-wpview-type="audio"] .toolbar div { - margin-top: 0; -} - -.wpview-wrap[data-wpview-type="audio"] .toolbar div:first-child { - margin-left: 0; -} - .wont-play { padding: 4px 0; } @@ -595,17 +623,6 @@ img.wp-oembed { float: right; } -.rtl .wpview-wrap .toolbar { - left: auto; - right: 0; -} - -.rtl .wpview-wrap .toolbar div, -.rtl #wp-image-toolbar i { - margin-left: auto; - margin-right: 7px; -} - @media print, (-o-min-device-pixel-ratio: 5/4), (-webkit-min-device-pixel-ratio: 1.25), diff --git a/wp-includes/js/tinymce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YUA zS7?wiTY}}1Y_;(@V_Juem3sqrD`hWd{}Y7JVrjc0j#F@$3?wxre}8le8`h&WVxk$& z&>N%jd*&ec;l$V>g25A}&|;bL<8J_L7)GCCQuS!*hJHu(1izN=oe5mQHL_ctEZ2L|MhMpGUV50xgkZ8 z#HMIwF{=8r7w{VYf7l;I6UT$PcI93p;MKUw`eD!X%UrZB>ZLBvT{&!ZRS+fJMU+2q zdw85G5StDUhcV&+nwU4^D+7Wl4sz=j1p>4hE!lBl!Vh`6WhO1$GJyeN((UnaLIf}r zZq<-cZnIOe6MSGKJ@i(oDV2&xDVZ)+HW!mqv4e`0CfOn4f6XQtTW@NrtW;NO*Ba_B z=;4IVh((DFwNmSg!7A(Id*Dy(m}^>iP&LF^!G%9sWR3Gmhf@vPMA00M6m?Z4(jz5b$Ej8Et5xx)JI|cwVQA*JO diff --git a/wp-includes/version.php b/wp-includes/version.php index c3de3afcdd..7b9ee9f7cd 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.1-beta2-30693'; +$wp_version = '4.1-beta2-30694'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.