diff --git a/wp-admin/js/editor.js b/wp-admin/js/editor.js index e718716355..c0d3ba0454 100644 --- a/wp-admin/js/editor.js +++ b/wp-admin/js/editor.js @@ -60,7 +60,8 @@ window.switchEditors = { if ( ed ) { ed.show(); - if ( editorHeight ) { + // No point resizing the iframe in iOS + if ( ! tinymce.Env.iOS && editorHeight ) { toolbarHeight = getToolbarHeight(); editorHeight = editorHeight - toolbarHeight + 14; @@ -84,16 +85,18 @@ window.switchEditors = { } if ( ed ) { - iframe = DOM.get( id + '_ifr' ); - editorHeight = iframe ? parseInt( iframe.style.height, 10 ) : 0; + if ( ! tinymce.Env.iOS ) { + iframe = DOM.get( id + '_ifr' ); + editorHeight = iframe ? parseInt( iframe.style.height, 10 ) : 0; - if ( editorHeight ) { - toolbarHeight = getToolbarHeight(); - editorHeight = editorHeight + toolbarHeight - 14; + if ( editorHeight ) { + toolbarHeight = getToolbarHeight(); + editorHeight = editorHeight + toolbarHeight - 14; - // height cannot be under 50 or over 5000 - if ( editorHeight > 50 && editorHeight < 5000 ) { - txtarea_el.style.height = editorHeight + 'px'; + // height cannot be under 50 or over 5000 + if ( editorHeight > 50 && editorHeight < 5000 ) { + txtarea_el.style.height = editorHeight + 'px'; + } } } diff --git a/wp-admin/js/editor.min.js b/wp-admin/js/editor.min.js index 9babf7bdf1..c8b7409c31 100644 --- a/wp-admin/js/editor.min.js +++ b/wp-admin/js/editor.min.js @@ -1 +1 @@ -window.switchEditors={switchto:function(a){var b=a.id,c=b.length,d=b.substr(0,c-5),e=b.substr(c-4);this.go(d,e)},go:function(a,b){function c(){var a=k.select(".mce-toolbar-grp",d.getContainer())[0],b=a&&a.clientHeight;return b&&b>10&&200>b?parseInt(b,10):30}var d,e,f,g,h,i,j=this,k=tinymce.DOM;if(a=a||"content",b=b||"toggle",d=tinymce.get(a),e="wp-"+a+"-wrap",f=k.get(a),"toggle"===b&&(b=d&&!d.isHidden()?"html":"tmce"),"tmce"===b||"tinymce"===b){if(d&&!d.isHidden())return!1;"undefined"!=typeof QTags&&QTags.closeAllTags(a),h=f?parseInt(f.style.height,10):0,tinyMCEPreInit.mceInit[a]&&tinyMCEPreInit.mceInit[a].wpautop&&(f.value=j.wpautop(f.value)),d?(d.show(),h&&(i=c(),h=h-i+14,h>50&&5e3>h&&d.theme.resizeTo(null,h))):tinymce.init(tinyMCEPreInit.mceInit[a]),k.removeClass(e,"html-active"),k.addClass(e,"tmce-active"),setUserSetting("editor","tinymce")}else if("html"===b){if(d&&d.isHidden())return!1;d?(g=k.get(a+"_ifr"),h=g?parseInt(g.style.height,10):0,h&&(i=c(),h=h+i-14,h>50&&5e3>h&&(f.style.height=h+"px")),d.hide()):(tinyMCEPreInit.mceInit[a]&&tinyMCEPreInit.mceInit[a].wpautop&&(f.value=j.pre_wpautop(f.value)),k.setStyles(f,{display:"",visibility:""})),k.removeClass(e,"tmce-active"),k.addClass(e,"html-active"),setUserSetting("editor","html")}return!1},_wp_Nop:function(a){var b,c,d=!1,e=!1;return(-1!==a.indexOf("]*>[\s\S]+?<\/\1>/g,function(a){return a=a.replace(/
(\r\n|\n)?/g,""),a=a.replace(/<\/?p( [^>]*)?>(\r\n|\n)?/g,""),a.replace(/\r?\n/g,"")})),-1!==a.indexOf("[caption")&&(e=!0,a=a.replace(/\[caption[\s\S]+?\[\/caption\]/g,function(a){return a.replace(/]*)>/g,"").replace(/[\r\n\t]+/,"")})),b="blockquote|ul|ol|li|table|thead|tbody|tfoot|tr|th|td|div|h[1-6]|p|fieldset",a=a.replace(new RegExp("\\s*\\s*","g"),"\n"),a=a.replace(new RegExp("\\s*<((?:"+b+")(?: [^>]*)?)>","g"),"\n<$1>"),a=a.replace(/(

]+>.*?)<\/p>/g,"$1"),a=a.replace(/]*)?>\s*

/gi,"\n\n"),a=a.replace(/\s*

/gi,""),a=a.replace(/\s*<\/p>\s*/gi,"\n\n"),a=a.replace(/\n[\s\u00a0]+\n/g,"\n\n"),a=a.replace(/\s*
\s*/gi,"\n"),a=a.replace(/\s*

\s*/g,"
\n"),a=a.replace(/\s*\[caption([^\[]+)\[\/caption\]\s*/gi,"\n\n[caption$1[/caption]\n\n"),a=a.replace(/caption\]\n\n+\[caption/g,"caption]\n\n[caption"),c="blockquote|ul|ol|li|table|thead|tbody|tfoot|tr|th|td|h[1-6]|pre|fieldset",a=a.replace(new RegExp("\\s*<((?:"+c+")(?: [^>]*)?)\\s*>","g"),"\n<$1>"),a=a.replace(new RegExp("\\s*\\s*","g"),"\n"),a=a.replace(/]*)>/g," "),-1!==a.indexOf("]*)?>\s*/g,"\n\n\n\n")),-1!==a.indexOf("/g,function(a){return a.replace(/[\r\n]+/g,"")})),a=a.replace(/<\/p#>/g,"

\n"),a=a.replace(/\s*(

]+>[\s\S]*?<\/p>)/g,"\n$1"),a=a.replace(/^\s+/,""),a=a.replace(/[\s\u00a0]+$/,""),d&&(a=a.replace(//g,"\n")),e&&(a=a.replace(/]*)>/g,"")),a},_wp_Autop:function(a){var b=!1,c=!1,d="table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|noscript|legend|section|article|aside|hgroup|header|footer|nav|figure|details|menu|summary";return-1!==a.indexOf("/g,function(a){return a.replace(/[\r\n]+/g,"")})),a=a.replace(/<[^<>]+>/g,function(a){return a.replace(/[\r\n]+/g," ")}),(-1!==a.indexOf("]*>[\s\S]+?<\/\1>/g,function(a){return a.replace(/(\r\n|\n)/g,"")})),-1!==a.indexOf("[caption")&&(c=!0,a=a.replace(/\[caption[\s\S]+?\[\/caption\]/g,function(a){return a=a.replace(/]*)>/g,""),a=a.replace(/<[a-zA-Z0-9]+( [^<>]+)?>/g,function(a){return a.replace(/[\r\n\t]+/," ")}),a.replace(/\s*\n\s*/g,"")})),a+="\n\n",a=a.replace(/
\s*
/gi,"\n\n"),a=a.replace(new RegExp("(<(?:"+d+")(?: [^>]*)?>)","gi"),"\n$1"),a=a.replace(new RegExp("()","gi"),"$1\n\n"),a=a.replace(/]*)?>/gi,"\n\n"),a=a.replace(/\r\n|\r/g,"\n"),a=a.replace(/\n\s*\n+/g,"\n\n"),a=a.replace(/([\s\S]+?)\n\n/g,"

$1

\n"),a=a.replace(/

\s*?<\/p>/gi,""),a=a.replace(new RegExp("

\\s*(]*)?>)\\s*

","gi"),"$1"),a=a.replace(/

(/gi,"$1"),a=a.replace(/

\s*]*)>/gi,"

"),a=a.replace(/<\/blockquote>\s*<\/p>/gi,"

"),a=a.replace(new RegExp("

\\s*(]*)?>)","gi"),"$1"),a=a.replace(new RegExp("(]*)?>)\\s*

","gi"),"$1"),a=a.replace(/\s*\n/gi,"
\n"),a=a.replace(new RegExp("(]*>)\\s*
","gi"),"$1"),a=a.replace(/
(\s*<\/?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)>)/gi,"$1"),a=a.replace(/(?:

|
)*\s*\[caption([^\[]+)\[\/caption\]\s*(?:<\/p>|
)*/gi,"[caption$1[/caption]"),a=a.replace(/(<(?:div|th|td|form|fieldset|dd)[^>]*>)(.*?)<\/p>/g,function(a,b,c){return c.match(/]*)?>/)?a:b+"

"+c+"

"}),b&&(a=a.replace(//g,"\n")),c&&(a=a.replace(/]*)>/g,"")),a},pre_wpautop:function(a){var b=this,c={o:b,data:a,unfiltered:a},d="undefined"!=typeof jQuery;return d&&jQuery("body").trigger("beforePreWpautop",[c]),c.data=b._wp_Nop(c.data),d&&jQuery("body").trigger("afterPreWpautop",[c]),c.data},wpautop:function(a){var b=this,c={o:b,data:a,unfiltered:a},d="undefined"!=typeof jQuery;return d&&jQuery("body").trigger("beforeWpautop",[c]),c.data=b._wp_Autop(c.data),d&&jQuery("body").trigger("afterWpautop",[c]),c.data}}; \ No newline at end of file +window.switchEditors={switchto:function(a){var b=a.id,c=b.length,d=b.substr(0,c-5),e=b.substr(c-4);this.go(d,e)},go:function(a,b){function c(){var a=k.select(".mce-toolbar-grp",d.getContainer())[0],b=a&&a.clientHeight;return b&&b>10&&200>b?parseInt(b,10):30}var d,e,f,g,h,i,j=this,k=tinymce.DOM;if(a=a||"content",b=b||"toggle",d=tinymce.get(a),e="wp-"+a+"-wrap",f=k.get(a),"toggle"===b&&(b=d&&!d.isHidden()?"html":"tmce"),"tmce"===b||"tinymce"===b){if(d&&!d.isHidden())return!1;"undefined"!=typeof QTags&&QTags.closeAllTags(a),h=f?parseInt(f.style.height,10):0,tinyMCEPreInit.mceInit[a]&&tinyMCEPreInit.mceInit[a].wpautop&&(f.value=j.wpautop(f.value)),d?(d.show(),!tinymce.Env.iOS&&h&&(i=c(),h=h-i+14,h>50&&5e3>h&&d.theme.resizeTo(null,h))):tinymce.init(tinyMCEPreInit.mceInit[a]),k.removeClass(e,"html-active"),k.addClass(e,"tmce-active"),setUserSetting("editor","tinymce")}else if("html"===b){if(d&&d.isHidden())return!1;d?(tinymce.Env.iOS||(g=k.get(a+"_ifr"),h=g?parseInt(g.style.height,10):0,h&&(i=c(),h=h+i-14,h>50&&5e3>h&&(f.style.height=h+"px"))),d.hide()):(tinyMCEPreInit.mceInit[a]&&tinyMCEPreInit.mceInit[a].wpautop&&(f.value=j.pre_wpautop(f.value)),k.setStyles(f,{display:"",visibility:""})),k.removeClass(e,"tmce-active"),k.addClass(e,"html-active"),setUserSetting("editor","html")}return!1},_wp_Nop:function(a){var b,c,d=!1,e=!1;return(-1!==a.indexOf("]*>[\s\S]+?<\/\1>/g,function(a){return a=a.replace(/
(\r\n|\n)?/g,""),a=a.replace(/<\/?p( [^>]*)?>(\r\n|\n)?/g,""),a.replace(/\r?\n/g,"")})),-1!==a.indexOf("[caption")&&(e=!0,a=a.replace(/\[caption[\s\S]+?\[\/caption\]/g,function(a){return a.replace(/]*)>/g,"").replace(/[\r\n\t]+/,"")})),b="blockquote|ul|ol|li|table|thead|tbody|tfoot|tr|th|td|div|h[1-6]|p|fieldset",a=a.replace(new RegExp("\\s*\\s*","g"),"\n"),a=a.replace(new RegExp("\\s*<((?:"+b+")(?: [^>]*)?)>","g"),"\n<$1>"),a=a.replace(/(

]+>.*?)<\/p>/g,"$1"),a=a.replace(/]*)?>\s*

/gi,"\n\n"),a=a.replace(/\s*

/gi,""),a=a.replace(/\s*<\/p>\s*/gi,"\n\n"),a=a.replace(/\n[\s\u00a0]+\n/g,"\n\n"),a=a.replace(/\s*
\s*/gi,"\n"),a=a.replace(/\s*

\s*/g,"
\n"),a=a.replace(/\s*\[caption([^\[]+)\[\/caption\]\s*/gi,"\n\n[caption$1[/caption]\n\n"),a=a.replace(/caption\]\n\n+\[caption/g,"caption]\n\n[caption"),c="blockquote|ul|ol|li|table|thead|tbody|tfoot|tr|th|td|h[1-6]|pre|fieldset",a=a.replace(new RegExp("\\s*<((?:"+c+")(?: [^>]*)?)\\s*>","g"),"\n<$1>"),a=a.replace(new RegExp("\\s*\\s*","g"),"\n"),a=a.replace(/]*)>/g," "),-1!==a.indexOf("]*)?>\s*/g,"\n\n\n\n")),-1!==a.indexOf("/g,function(a){return a.replace(/[\r\n]+/g,"")})),a=a.replace(/<\/p#>/g,"

\n"),a=a.replace(/\s*(

]+>[\s\S]*?<\/p>)/g,"\n$1"),a=a.replace(/^\s+/,""),a=a.replace(/[\s\u00a0]+$/,""),d&&(a=a.replace(//g,"\n")),e&&(a=a.replace(/]*)>/g,"")),a},_wp_Autop:function(a){var b=!1,c=!1,d="table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|noscript|legend|section|article|aside|hgroup|header|footer|nav|figure|details|menu|summary";return-1!==a.indexOf("/g,function(a){return a.replace(/[\r\n]+/g,"")})),a=a.replace(/<[^<>]+>/g,function(a){return a.replace(/[\r\n]+/g," ")}),(-1!==a.indexOf("]*>[\s\S]+?<\/\1>/g,function(a){return a.replace(/(\r\n|\n)/g,"")})),-1!==a.indexOf("[caption")&&(c=!0,a=a.replace(/\[caption[\s\S]+?\[\/caption\]/g,function(a){return a=a.replace(/]*)>/g,""),a=a.replace(/<[a-zA-Z0-9]+( [^<>]+)?>/g,function(a){return a.replace(/[\r\n\t]+/," ")}),a.replace(/\s*\n\s*/g,"")})),a+="\n\n",a=a.replace(/
\s*
/gi,"\n\n"),a=a.replace(new RegExp("(<(?:"+d+")(?: [^>]*)?>)","gi"),"\n$1"),a=a.replace(new RegExp("()","gi"),"$1\n\n"),a=a.replace(/]*)?>/gi,"\n\n"),a=a.replace(/\r\n|\r/g,"\n"),a=a.replace(/\n\s*\n+/g,"\n\n"),a=a.replace(/([\s\S]+?)\n\n/g,"

$1

\n"),a=a.replace(/

\s*?<\/p>/gi,""),a=a.replace(new RegExp("

\\s*(]*)?>)\\s*

","gi"),"$1"),a=a.replace(/

(/gi,"$1"),a=a.replace(/

\s*]*)>/gi,"

"),a=a.replace(/<\/blockquote>\s*<\/p>/gi,"

"),a=a.replace(new RegExp("

\\s*(]*)?>)","gi"),"$1"),a=a.replace(new RegExp("(]*)?>)\\s*

","gi"),"$1"),a=a.replace(/\s*\n/gi,"
\n"),a=a.replace(new RegExp("(]*>)\\s*
","gi"),"$1"),a=a.replace(/
(\s*<\/?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)>)/gi,"$1"),a=a.replace(/(?:

|
)*\s*\[caption([^\[]+)\[\/caption\]\s*(?:<\/p>|
)*/gi,"[caption$1[/caption]"),a=a.replace(/(<(?:div|th|td|form|fieldset|dd)[^>]*>)(.*?)<\/p>/g,function(a,b,c){return c.match(/]*)?>/)?a:b+"

"+c+"

"}),b&&(a=a.replace(//g,"\n")),c&&(a=a.replace(/]*)>/g,"")),a},pre_wpautop:function(a){var b=this,c={o:b,data:a,unfiltered:a},d="undefined"!=typeof jQuery;return d&&jQuery("body").trigger("beforePreWpautop",[c]),c.data=b._wp_Nop(c.data),d&&jQuery("body").trigger("afterPreWpautop",[c]),c.data},wpautop:function(a){var b=this,c={o:b,data:a,unfiltered:a},d="undefined"!=typeof jQuery;return d&&jQuery("body").trigger("beforeWpautop",[c]),c.data=b._wp_Autop(c.data),d&&jQuery("body").trigger("afterWpautop",[c]),c.data}}; \ No newline at end of file diff --git a/wp-includes/js/tinymce/plugins/wordpress/plugin.js b/wp-includes/js/tinymce/plugins/wordpress/plugin.js index b14d6f42a0..62c786783b 100644 --- a/wp-includes/js/tinymce/plugins/wordpress/plugin.js +++ b/wp-includes/js/tinymce/plugins/wordpress/plugin.js @@ -37,9 +37,12 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) { } }); - if ( pixels && ! initial ) { - iframe = editor.getContentAreaContainer().firstChild; - DOM.setStyle( iframe, 'height', iframe.clientHeight + pixels ); // Resize iframe + if ( pixels && ! initial ) { + // Resize iframe, not needed in iOS + if ( ! tinymce.Env.iOS ) { + iframe = editor.getContentAreaContainer().firstChild; + DOM.setStyle( iframe, 'height', iframe.clientHeight + pixels ); + } if ( state === 'hide' ) { setUserSetting('hidetb', '0'); @@ -277,6 +280,10 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) { doc = editor.getDoc(), dom = editor.dom; + if ( tinymce.Env.iOS ) { + dom.addClass( doc.documentElement, 'ios' ); + } + if ( editor.getParam( 'directionality' ) === 'rtl' ) { bodyClass.push('rtl'); dom.setAttrib( doc.documentElement, 'dir', 'rtl' ); @@ -358,6 +365,10 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) { editor.on( 'preInit', function() { // Don't replace with and with and don't remove them when empty editor.schema.addValidElements( '@[id|accesskey|class|dir|lang|style|tabindex|title|contenteditable|draggable|dropzone|hidden|spellcheck|translate],i,b' ); + + if ( tinymce.Env.iOS ) { + editor.settings.height = 300; + } }); // Add custom shortcuts diff --git a/wp-includes/js/tinymce/plugins/wordpress/plugin.min.js b/wp-includes/js/tinymce/plugins/wordpress/plugin.min.js index 6f211d53fb..933861b6db 100644 --- a/wp-includes/js/tinymce/plugins/wordpress/plugin.min.js +++ b/wp-includes/js/tinymce/plugins/wordpress/plugin.min.js @@ -1 +1 @@ -tinymce.ui.FloatPanel.zIndex=100100,tinymce.PluginManager.add("wordpress",function(a){function b(b){var c,d,e,f=0;d="hide"===b,a.theme.panel&&(e=a.theme.panel.find(".toolbar:not(.menubar)")),!e||e.length<2||"hide"===b&&!e[1].visible()||(!b&&e[1].visible()&&(b="hide"),tinymce.each(e,function(a,c){c>0&&("hide"===b?(a.hide(),f+=30):(a.show(),f-=30))}),f&&!d&&(c=a.getContentAreaContainer().firstChild,j.setStyle(c,"height",c.clientHeight+f),"hide"===b?(setUserSetting("hidetb","0"),g&&g.active(!1)):(setUserSetting("hidetb","1"),g&&g.active(!0))))}function c(a){return a.replace(/\[embed\]([\s\S]+?)\[\/embed\][\s\u00a0]*/g,function(a,b){return''+b+''})}function d(a){return a.replace(/]+>/g,function(a){if(-1!==a.indexOf('class="wp-oembed')){var b=a.match(/alt="([^\"]+)"/);b[1]&&(a="[embed]"+b[1]+"[/embed]")}return a})}function e(b,c){var d,e,f,g,h;f=a.dom.getViewPort(a.getWin()),d=j.getPos(a.getContentAreaContainer()),e=a.dom.getPos(b),g=Math.max(e.x-f.x,0)+d.x,h=Math.max(e.y-f.y,0)+d.y,j.setStyles(c,{top:h+5+"px",left:g+5+"px",display:"block"})}function f(){j.hide(j.select("#wp_editbtns, #wp_gallerybtns"))}var g,h,i,j=tinymce.DOM,k=0;return a.addButton("wp_adv",{tooltip:"Toolbar Toggle",cmd:"WP_Adv",onPostRender:function(){g=this,g.active("1"===getUserSetting("hidetb")?!0:!1)}}),a.on("PostRender",function(){a.getParam("wordpress_adv_hidden",!0)&&"0"===getUserSetting("hidetb","0")&&b("hide")}),a.addCommand("WP_Adv",function(){b()}),a.on("focus",function(){window.wpActiveEditor=a.id}),a.on("BeforeSetContent",function(a){a.content&&(-1!==a.content.indexOf("/g,function(a,b){return''})),-1!==a.content.indexOf("")&&(a.content=a.content.replace(//g,'')))}),a.on("PostProcess",function(a){a.get&&(a.content=a.content.replace(/]+>/g,function(a){var b,c="";return-1!==a.indexOf("wp-more-tag")&&(-1!==a.indexOf("mce-wp-more")?((b=a.match(/data-wp-more="([^"]+)"/))&&(c=b[1]),a=""):-1!==a.indexOf("mce-wp-nextpage")&&(a="")),a}))}),a.on("ResolveName",function(b){var c=a.dom,d=b.target;"IMG"===d.nodeName&&c.hasClass(d,"wp-more-tag")&&(c.hasClass(d,"mce-wp-more")?b.name="more":c.hasClass(d,"mce-wp-nextpage")&&(b.name="nextpage"))}),a.addCommand("WP_More",function(b){var c,d,e,f="wp-more-tag",g=a.dom,h=a.selection.getNode();return b=b||"more",f+=" mce-wp-"+b,e="more"===b?"More...":"Next Page",d='',"BODY"===h.nodeName||"P"===h.nodeName&&"BODY"===h.parentNode.nodeName?void a.insertContent(d):(c=g.getParent(h,function(a){return a.parentNode&&"BODY"===a.parentNode.nodeName?!0:!1},a.getBody()),void(c&&("P"===c.nodeName?c.appendChild(g.create("p",null,d).firstChild):g.insertAfter(g.create("p",null,d),c),a.nodeChanged())))}),a.addCommand("WP_Code",function(){a.formatter.toggle("code")}),a.addCommand("WP_Page",function(){a.execCommand("WP_More","nextpage")}),a.addCommand("WP_Help",function(){a.windowManager.open({url:tinymce.baseURL+"/wp-mce-help.php",title:"Keyboard Shortcuts",width:450,height:420,inline:1,classes:"wp-help"})}),a.addCommand("WP_Medialib",function(){"undefined"!=typeof wp&&wp.media&&wp.media.editor&&wp.media.editor.open(a.id)}),a.addButton("wp_more",{tooltip:"Insert Read More tag",onclick:function(){a.execCommand("WP_More","more")}}),a.addButton("wp_page",{tooltip:"Page break",onclick:function(){a.execCommand("WP_More","nextpage")}}),a.addButton("wp_help",{tooltip:"Keyboard Shortcuts",cmd:"WP_Help"}),a.addButton("wp_code",{tooltip:"Code",cmd:"WP_Code",stateSelector:"code"}),"undefined"!=typeof wp&&wp.media&&wp.media.editor&&a.addMenuItem("add_media",{text:"Add Media",icon:"wp-media-library",context:"insert",cmd:"WP_Medialib"}),a.addMenuItem("wp_more",{text:"Insert Read More tag",icon:"wp_more",context:"insert",onclick:function(){a.execCommand("WP_More","more")}}),a.addMenuItem("wp_page",{text:"Page break",icon:"wp_page",context:"insert",onclick:function(){a.execCommand("WP_More","nextpage")}}),a.on("BeforeExecCommand",function(b){!tinymce.Env.webkit||"InsertUnorderedList"!==b.command&&"InsertOrderedList"!==b.command||(i||(i=a.dom.create("style",{type:"text/css"},"#tinymce,#tinymce span,#tinymce li,#tinymce li>span,#tinymce p,#tinymce p>span{font:medium sans-serif;color:#000;line-height:normal;}")),a.getDoc().head.appendChild(i))}),a.on("ExecCommand",function(b){tinymce.Env.webkit&&i&&("InsertUnorderedList"===b.command||"InsertOrderedList"===b.command)&&a.dom.remove(i)}),a.on("init",function(){var b=tinymce.Env,c=["mceContentBody"],d=a.getDoc(),e=a.dom;"rtl"===a.getParam("directionality")&&(c.push("rtl"),e.setAttrib(d.documentElement,"dir","rtl")),b.ie&&(9===parseInt(b.ie,10)?c.push("ie9"):8===parseInt(b.ie,10)?c.push("ie8"):b.ie<8&&c.push("ie7")),c.push("wp-editor"),tinymce.each(c,function(a){a&&e.addClass(d.body,a)}),a.on("BeforeSetContent",function(a){a.content&&(a.content=a.content.replace(/

\s*<(p|div|ul|ol|dl|table|blockquote|h[1-6]|fieldset|pre|address)( [^>]*)?>/gi,"<$1$2>"),a.content=a.content.replace(/<\/(p|div|ul|ol|dl|table|blockquote|h[1-6]|fieldset|pre|address)>\s*<\/p>/gi,""))}),"undefined"!=typeof window.jQuery&&window.jQuery(document).triggerHandler("tinymce-editor-init",[a]),window.tinyMCEPreInit&&window.tinyMCEPreInit.dragDropUpload&&e.bind(d,"dragstart dragend dragover drop",function(a){"undefined"!=typeof window.jQuery&&window.jQuery(document).trigger(new window.jQuery.Event(a))})}),"undefined"!=typeof window.jQuery&&a.on("keyup",function(b){var c=b.keyCode||b.charCode;c!==k&&((13===c||8===k||46===k)&&window.jQuery(document).triggerHandler("wpcountwords",[a.getContent({format:"raw"})]),k=c)}),a.on("SaveContent",function(b){return!a.inline&&a.isHidden()?void(b.content=b.element.value):(b.content=b.content.replace(/

(
|\u00a0|\uFEFF)?<\/p>/g,"

 

"),void(a.getParam("wpautop",!0)&&"undefined"!=typeof window.switchEditors&&(b.content=window.switchEditors.pre_wpautop(b.content))))}),a.on("preInit",function(){a.schema.addValidElements("@[id|accesskey|class|dir|lang|style|tabindex|title|contenteditable|draggable|dropzone|hidden|spellcheck|translate],i,b")}),h="alt+shift",a.addShortcut(h+"+c","","JustifyCenter"),a.addShortcut(h+"+r","","JustifyRight"),a.addShortcut(h+"+l","","JustifyLeft"),a.addShortcut(h+"+j","","JustifyFull"),a.addShortcut(h+"+q","","mceBlockQuote"),a.addShortcut(h+"+u","","InsertUnorderedList"),a.addShortcut(h+"+o","","InsertOrderedList"),a.addShortcut(h+"+n","","mceSpellCheck"),a.addShortcut(h+"+s","","unlink"),a.addShortcut(h+"+m","","WP_Medialib"),a.addShortcut(h+"+z","","WP_Adv"),a.addShortcut(h+"+t","","WP_More"),a.addShortcut(h+"+d","","Strikethrough"),a.addShortcut(h+"+h","","WP_Help"),a.addShortcut(h+"+p","","WP_Page"),a.addShortcut(h+"+x","","WP_Code"),a.addShortcut("ctrl+s","",function(){"undefined"!=typeof wp&&wp.autosave&&wp.autosave.server.triggerSave()}),a.on("init",function(){a.dom.bind(a.getWin(),"scroll",function(){f()}),a.dom.bind(a.getBody(),"dragstart",function(){f()})}),a.on("BeforeExecCommand",function(){f()}),a.on("SaveContent",function(){f()}),a.on("MouseDown",function(a){"IMG"!==a.target.nodeName&&f()}),a.on("keydown",function(a){(a.which===tinymce.util.VK.DELETE||a.which===tinymce.util.VK.BACKSPACE)&&f()}),{_showButtons:e,_hideButtons:f,_setEmbed:c,_getEmbed:d}}); \ No newline at end of file +tinymce.ui.FloatPanel.zIndex=100100,tinymce.PluginManager.add("wordpress",function(a){function b(b){var c,d,e,f=0;d="hide"===b,a.theme.panel&&(e=a.theme.panel.find(".toolbar:not(.menubar)")),!e||e.length<2||"hide"===b&&!e[1].visible()||(!b&&e[1].visible()&&(b="hide"),tinymce.each(e,function(a,c){c>0&&("hide"===b?(a.hide(),f+=30):(a.show(),f-=30))}),f&&!d&&(tinymce.Env.iOS||(c=a.getContentAreaContainer().firstChild,j.setStyle(c,"height",c.clientHeight+f)),"hide"===b?(setUserSetting("hidetb","0"),g&&g.active(!1)):(setUserSetting("hidetb","1"),g&&g.active(!0))))}function c(a){return a.replace(/\[embed\]([\s\S]+?)\[\/embed\][\s\u00a0]*/g,function(a,b){return''+b+''})}function d(a){return a.replace(/]+>/g,function(a){if(-1!==a.indexOf('class="wp-oembed')){var b=a.match(/alt="([^\"]+)"/);b[1]&&(a="[embed]"+b[1]+"[/embed]")}return a})}function e(b,c){var d,e,f,g,h;f=a.dom.getViewPort(a.getWin()),d=j.getPos(a.getContentAreaContainer()),e=a.dom.getPos(b),g=Math.max(e.x-f.x,0)+d.x,h=Math.max(e.y-f.y,0)+d.y,j.setStyles(c,{top:h+5+"px",left:g+5+"px",display:"block"})}function f(){j.hide(j.select("#wp_editbtns, #wp_gallerybtns"))}var g,h,i,j=tinymce.DOM,k=0;return a.addButton("wp_adv",{tooltip:"Toolbar Toggle",cmd:"WP_Adv",onPostRender:function(){g=this,g.active("1"===getUserSetting("hidetb")?!0:!1)}}),a.on("PostRender",function(){a.getParam("wordpress_adv_hidden",!0)&&"0"===getUserSetting("hidetb","0")&&b("hide")}),a.addCommand("WP_Adv",function(){b()}),a.on("focus",function(){window.wpActiveEditor=a.id}),a.on("BeforeSetContent",function(a){a.content&&(-1!==a.content.indexOf("/g,function(a,b){return''})),-1!==a.content.indexOf("")&&(a.content=a.content.replace(//g,'')))}),a.on("PostProcess",function(a){a.get&&(a.content=a.content.replace(/]+>/g,function(a){var b,c="";return-1!==a.indexOf("wp-more-tag")&&(-1!==a.indexOf("mce-wp-more")?((b=a.match(/data-wp-more="([^"]+)"/))&&(c=b[1]),a=""):-1!==a.indexOf("mce-wp-nextpage")&&(a="")),a}))}),a.on("ResolveName",function(b){var c=a.dom,d=b.target;"IMG"===d.nodeName&&c.hasClass(d,"wp-more-tag")&&(c.hasClass(d,"mce-wp-more")?b.name="more":c.hasClass(d,"mce-wp-nextpage")&&(b.name="nextpage"))}),a.addCommand("WP_More",function(b){var c,d,e,f="wp-more-tag",g=a.dom,h=a.selection.getNode();return b=b||"more",f+=" mce-wp-"+b,e="more"===b?"More...":"Next Page",d='',"BODY"===h.nodeName||"P"===h.nodeName&&"BODY"===h.parentNode.nodeName?void a.insertContent(d):(c=g.getParent(h,function(a){return a.parentNode&&"BODY"===a.parentNode.nodeName?!0:!1},a.getBody()),void(c&&("P"===c.nodeName?c.appendChild(g.create("p",null,d).firstChild):g.insertAfter(g.create("p",null,d),c),a.nodeChanged())))}),a.addCommand("WP_Code",function(){a.formatter.toggle("code")}),a.addCommand("WP_Page",function(){a.execCommand("WP_More","nextpage")}),a.addCommand("WP_Help",function(){a.windowManager.open({url:tinymce.baseURL+"/wp-mce-help.php",title:"Keyboard Shortcuts",width:450,height:420,inline:1,classes:"wp-help"})}),a.addCommand("WP_Medialib",function(){"undefined"!=typeof wp&&wp.media&&wp.media.editor&&wp.media.editor.open(a.id)}),a.addButton("wp_more",{tooltip:"Insert Read More tag",onclick:function(){a.execCommand("WP_More","more")}}),a.addButton("wp_page",{tooltip:"Page break",onclick:function(){a.execCommand("WP_More","nextpage")}}),a.addButton("wp_help",{tooltip:"Keyboard Shortcuts",cmd:"WP_Help"}),a.addButton("wp_code",{tooltip:"Code",cmd:"WP_Code",stateSelector:"code"}),"undefined"!=typeof wp&&wp.media&&wp.media.editor&&a.addMenuItem("add_media",{text:"Add Media",icon:"wp-media-library",context:"insert",cmd:"WP_Medialib"}),a.addMenuItem("wp_more",{text:"Insert Read More tag",icon:"wp_more",context:"insert",onclick:function(){a.execCommand("WP_More","more")}}),a.addMenuItem("wp_page",{text:"Page break",icon:"wp_page",context:"insert",onclick:function(){a.execCommand("WP_More","nextpage")}}),a.on("BeforeExecCommand",function(b){!tinymce.Env.webkit||"InsertUnorderedList"!==b.command&&"InsertOrderedList"!==b.command||(i||(i=a.dom.create("style",{type:"text/css"},"#tinymce,#tinymce span,#tinymce li,#tinymce li>span,#tinymce p,#tinymce p>span{font:medium sans-serif;color:#000;line-height:normal;}")),a.getDoc().head.appendChild(i))}),a.on("ExecCommand",function(b){tinymce.Env.webkit&&i&&("InsertUnorderedList"===b.command||"InsertOrderedList"===b.command)&&a.dom.remove(i)}),a.on("init",function(){var b=tinymce.Env,c=["mceContentBody"],d=a.getDoc(),e=a.dom;tinymce.Env.iOS&&e.addClass(d.documentElement,"ios"),"rtl"===a.getParam("directionality")&&(c.push("rtl"),e.setAttrib(d.documentElement,"dir","rtl")),b.ie&&(9===parseInt(b.ie,10)?c.push("ie9"):8===parseInt(b.ie,10)?c.push("ie8"):b.ie<8&&c.push("ie7")),c.push("wp-editor"),tinymce.each(c,function(a){a&&e.addClass(d.body,a)}),a.on("BeforeSetContent",function(a){a.content&&(a.content=a.content.replace(/

\s*<(p|div|ul|ol|dl|table|blockquote|h[1-6]|fieldset|pre|address)( [^>]*)?>/gi,"<$1$2>"),a.content=a.content.replace(/<\/(p|div|ul|ol|dl|table|blockquote|h[1-6]|fieldset|pre|address)>\s*<\/p>/gi,""))}),"undefined"!=typeof window.jQuery&&window.jQuery(document).triggerHandler("tinymce-editor-init",[a]),window.tinyMCEPreInit&&window.tinyMCEPreInit.dragDropUpload&&e.bind(d,"dragstart dragend dragover drop",function(a){"undefined"!=typeof window.jQuery&&window.jQuery(document).trigger(new window.jQuery.Event(a))})}),"undefined"!=typeof window.jQuery&&a.on("keyup",function(b){var c=b.keyCode||b.charCode;c!==k&&((13===c||8===k||46===k)&&window.jQuery(document).triggerHandler("wpcountwords",[a.getContent({format:"raw"})]),k=c)}),a.on("SaveContent",function(b){return!a.inline&&a.isHidden()?void(b.content=b.element.value):(b.content=b.content.replace(/

(
|\u00a0|\uFEFF)?<\/p>/g,"

 

"),void(a.getParam("wpautop",!0)&&"undefined"!=typeof window.switchEditors&&(b.content=window.switchEditors.pre_wpautop(b.content))))}),a.on("preInit",function(){a.schema.addValidElements("@[id|accesskey|class|dir|lang|style|tabindex|title|contenteditable|draggable|dropzone|hidden|spellcheck|translate],i,b"),tinymce.Env.iOS&&(a.settings.height=300)}),h="alt+shift",a.addShortcut(h+"+c","","JustifyCenter"),a.addShortcut(h+"+r","","JustifyRight"),a.addShortcut(h+"+l","","JustifyLeft"),a.addShortcut(h+"+j","","JustifyFull"),a.addShortcut(h+"+q","","mceBlockQuote"),a.addShortcut(h+"+u","","InsertUnorderedList"),a.addShortcut(h+"+o","","InsertOrderedList"),a.addShortcut(h+"+n","","mceSpellCheck"),a.addShortcut(h+"+s","","unlink"),a.addShortcut(h+"+m","","WP_Medialib"),a.addShortcut(h+"+z","","WP_Adv"),a.addShortcut(h+"+t","","WP_More"),a.addShortcut(h+"+d","","Strikethrough"),a.addShortcut(h+"+h","","WP_Help"),a.addShortcut(h+"+p","","WP_Page"),a.addShortcut(h+"+x","","WP_Code"),a.addShortcut("ctrl+s","",function(){"undefined"!=typeof wp&&wp.autosave&&wp.autosave.server.triggerSave()}),a.on("init",function(){a.dom.bind(a.getWin(),"scroll",function(){f()}),a.dom.bind(a.getBody(),"dragstart",function(){f()})}),a.on("BeforeExecCommand",function(){f()}),a.on("SaveContent",function(){f()}),a.on("MouseDown",function(a){"IMG"!==a.target.nodeName&&f()}),a.on("keydown",function(a){(a.which===tinymce.util.VK.DELETE||a.which===tinymce.util.VK.BACKSPACE)&&f()}),{_showButtons:e,_hideButtons:f,_setEmbed:c,_getEmbed:d}}); \ No newline at end of file diff --git a/wp-includes/js/tinymce/skins/wordpress/wp-content.css b/wp-includes/js/tinymce/skins/wordpress/wp-content.css index 56bee77d6e..4ada8310d0 100644 --- a/wp-includes/js/tinymce/skins/wordpress/wp-content.css +++ b/wp-includes/js/tinymce/skins/wordpress/wp-content.css @@ -1,4 +1,14 @@ /* Additional default styles for the editor */ + +html.ios { + height: 100%; +} + +.ios body#tinymce { + height: 200%; + max-width: none; +} + body { font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif; font-size: 13px; diff --git a/wp-includes/js/tinymce/wp-tinymce.js.gz b/wp-includes/js/tinymce/wp-tinymce.js.gz index 7f0cebf9b1..0f29a3cbae 100644 Binary files a/wp-includes/js/tinymce/wp-tinymce.js.gz and b/wp-includes/js/tinymce/wp-tinymce.js.gz differ diff --git a/wp-includes/version.php b/wp-includes/version.php index 387ac8cf9a..3d55bc29c3 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.0-alpha-20140529'; +$wp_version = '4.0-alpha-20140530'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.