Ticket #28328: 28328.7.patch
File 28328.7.patch, 34.0 KB (added by , 11 years ago) |
---|
-
src/wp-admin/css/edit.css
37 37 38 38 #titlediv { 39 39 position: relative; 40 margin-bottom: 10px;41 40 } 42 41 43 42 #titlediv label { … … 337 336 background-color: #f7f7f7; 338 337 -webkit-box-shadow: 0 1px 1px rgba(0,0,0,0.04); 339 338 box-shadow: 0 1px 1px rgba(0,0,0,0.04); 340 cursor: row-resize;339 z-index: 999; 341 340 } 342 341 343 342 #post-status-info td { … … 345 344 } 346 345 347 346 .autosave-info { 348 padding: 2px ;347 padding: 2px 10px; 349 348 text-align: right; 350 349 } 351 350 … … 367 366 padding: 2px 10px; 368 367 } 369 368 369 #wp-content-editor-container { 370 position: relative; 371 } 372 373 #content-textarea-clone { 374 z-index: -1; 375 position: absolute; 376 top: 0; 377 visibility: hidden; 378 overflow: hidden; 379 } 380 370 381 #timestampdiv select { 371 382 height: 21px; 372 383 line-height: 14px; -
src/wp-admin/edit-form-advanced.php
11 11 die('-1'); 12 12 13 13 wp_enqueue_script('post'); 14 wp_enqueue_script('editor-expand'); 14 15 15 16 if ( wp_is_mobile() ) 16 17 wp_enqueue_script( 'jquery-touch-punch' ); -
src/wp-admin/js/common.js
179 179 }); 180 180 181 181 $('#collapse-menu').on('click.collapse-menu', function() { 182 var body = $( document.body ), respWidth ;182 var body = $( document.body ), respWidth, state; 183 183 184 184 // reset any compensation for submenus near the bottom of the screen 185 185 $('#adminmenu div.wp-submenu').css('margin-top', ''); … … 197 197 body.removeClass('auto-fold').removeClass('folded'); 198 198 setUserSetting('unfold', 1); 199 199 setUserSetting('mfold', 'o'); 200 state = 'open'; 200 201 } else { 201 202 body.addClass('auto-fold'); 202 203 setUserSetting('unfold', 0); 204 state = 'folded'; 203 205 } 204 206 } else { 205 207 if ( body.hasClass('folded') ) { 206 208 body.removeClass('folded'); 207 209 setUserSetting('mfold', 'o'); 210 state = 'open'; 208 211 } else { 209 212 body.addClass('folded'); 210 213 setUserSetting('mfold', 'f'); 214 state = 'folded'; 211 215 } 212 216 } 217 218 $( document ).trigger( 'wp-collapse-menu', { state: state } ); 213 219 }); 214 220 215 221 if ( 'ontouchstart' in window || /IEMobile\/[1-9]/.test(navigator.userAgent) ) { // touch screen device … … 721 727 window.wpResponsive.init(); 722 728 }); 723 729 724 // make Windows 8 devices playing along nicely730 // Make Windows 8 devices play along nicely. 725 731 (function(){ 726 732 if ( '-ms-user-select' in document.documentElement.style && navigator.userAgent.match(/IEMobile\/10\.0/) ) { 727 733 var msViewportStyle = document.createElement( 'style' ); -
src/wp-admin/js/editor-expand.js
1 2 window.wp = window.wp || {}; 3 4 jQuery( document ).ready( function($) { 5 var $window = $( window ), 6 $document = $( document ), 7 $adminBar = $( '#wpadminbar' ), 8 $contentWrap = $( '#wp-content-wrap' ), 9 $tools = $( '#wp-content-editor-tools' ), 10 $visualTop, 11 $visualEditor, 12 $textTop = $( '#ed_toolbar' ), 13 $textEditor = $( '#content' ), 14 $textEditorClone = $( '<div id="content-textarea-clone"></div>' ), 15 $bottom = $( '#post-status-info' ), 16 $statusBar, 17 buffer = 200, 18 adjust, 19 fullscreen = window.wp.editor && window.wp.editor.fullscreen, 20 editorInstance, 21 fixedTop = false, 22 fixedBottom = false; 23 24 $textEditorClone.insertAfter( $textEditor ); 25 26 // use to enable/disable 27 $contentWrap.addClass( 'wp-editor-expand' ); 28 $( '#content-resize-handle' ).hide(); 29 30 $textEditorClone.css( { 31 'font-family': $textEditor.css( 'font-family' ), 32 'font-size': $textEditor.css( 'font-size' ), 33 'line-height': $textEditor.css( 'line-height' ), 34 'padding': $textEditor.css( 'padding' ), 35 'padding-top': 37, 36 'white-space': 'pre-wrap', 37 'word-wrap': 'break-word' 38 } ); 39 40 $textEditor.on( 'focus input propertychange', function() { 41 textEditorResize(); 42 } ); 43 44 $textEditor.on( 'keyup', function() { 45 var range = document.createRange(), 46 start = $textEditor[0].selectionStart, 47 end = $textEditor[0].selectionEnd, 48 textNode = $textEditorClone[0].firstChild, 49 windowHeight = $window.height(), 50 offset, cursorTop, cursorBottom, editorTop, editorBottom; 51 52 if ( start && end && start !== end ) { 53 return; 54 } 55 56 range.setStart( textNode, start ); 57 range.setEnd( textNode, end + 1 ); 58 59 offset = range.getBoundingClientRect(); 60 61 if ( ! offset.height ) { 62 return; 63 } 64 65 cursorTop = offset.top; 66 cursorBottom = cursorTop + offset.height; 67 editorTop = $adminBar.outerHeight() + $textTop.outerHeight(); 68 editorBottom = windowHeight - $bottom.outerHeight(); 69 70 if ( cursorTop < editorTop || cursorBottom > editorBottom ) { 71 window.scrollTo( window.pageXOffset, cursorTop + window.pageYOffset - windowHeight / 2 ); 72 } 73 } ); 74 75 function textEditorResize() { 76 if ( editorInstance && ! editorInstance.isHidden() ) { 77 return; 78 } 79 80 var hiddenHeight = $textEditorClone.width( $textEditor.width() ).text( $textEditor.val() + ' ' ).height(), 81 textEditorHeight = $textEditor.height(); 82 83 if ( hiddenHeight < 300 ) { 84 hiddenHeight = 300; 85 } 86 87 if ( hiddenHeight === textEditorHeight ) { 88 return; 89 } 90 91 $textEditor.height( hiddenHeight ); 92 93 adjust( 'resize' ); 94 } 95 96 // We need to wait for TinyMCE to initialize. 97 $document.on( 'tinymce-editor-init.editor-expand', function( event, editor ) { 98 // Make sure it's the main editor. 99 if ( editor.id !== 'content' ) { 100 return; 101 } 102 103 // Copy the editor instance. 104 editorInstance = editor; 105 106 // Resizing will be handled by the autoresize plugin. 107 editor.theme.resizeTo = function() {}; 108 109 // Set the minimum height to the initial viewport height. 110 editor.settings.autoresize_min_height = 300; 111 112 // Get the necessary UI elements. 113 $visualTop = $contentWrap.find( '.mce-toolbar-grp' ); 114 $visualEditor = $contentWrap.find( '.mce-edit-area' ); 115 $statusBar = $contentWrap.find( '.mce-statusbar' ).filter( ':visible' ); 116 117 // Adjust when switching editor modes. 118 editor.on( 'show', function() { 119 setTimeout( function() { 120 editor.execCommand( 'mceAutoResize' ); 121 adjust( 'resize' ); 122 }, 200 ); 123 } ); 124 125 editor.on( 'keyup', function() { 126 var offset = getCursorOffset(), 127 windowHeight = $window.height(), 128 cursorTop, cursorBottom, editorTop, editorBottom; 129 130 if ( ! offset ) { 131 return; 132 } 133 134 cursorTop = offset.top + editor.getContentAreaContainer().getElementsByTagName( 'iframe' )[0].getBoundingClientRect().top; 135 cursorBottom = cursorTop + offset.height; 136 editorTop = $adminBar.outerHeight() + $tools.outerHeight() + $visualTop.outerHeight(); 137 editorBottom = $window.height() - $bottom.outerHeight(); 138 139 if ( cursorTop < editorTop || cursorBottom > editorBottom ) { 140 window.scrollTo( window.pageXOffset, cursorTop + window.pageYOffset - windowHeight / 2 ); 141 } 142 } ); 143 144 function getCursorOffset() { 145 var selection = editor.selection, 146 node = selection.getNode(), 147 range = selection.getRng(), 148 view, clone, right, offset; 149 150 if ( tinymce.Env.ie && tinymce.Env.ie < 9 ) { 151 return; 152 } 153 154 if ( editor.plugins.wpview && ( view = editor.plugins.wpview.getView( node ) ) ) { 155 offset = view.getBoundingClientRect(); 156 } else if ( selection.isCollapsed() ) { 157 clone = range.cloneRange(); 158 159 if ( clone.startContainer.length > 1 ) { 160 if ( clone.startContainer.length > clone.endOffset ) { 161 clone.setEnd( clone.startContainer, clone.endOffset + 1 ); 162 right = true; 163 } else { 164 clone.setStart( clone.startContainer, clone.endOffset - 1 ); 165 } 166 167 selection.setRng( clone ); 168 offset = selection.getRng().getBoundingClientRect(); 169 selection.setRng( range ); 170 } else { 171 offset = node.getBoundingClientRect(); 172 } 173 } else { 174 offset = range.getBoundingClientRect(); 175 } 176 177 if ( ! offset.height ) { 178 return false; 179 } 180 181 return offset; 182 } 183 184 editor.on( 'hide', function() { 185 textEditorResize(); 186 adjust( 'resize' ); 187 } ); 188 189 // Adjust when the editor resizes. 190 editor.on( 'nodechange setcontent keyup FullscreenStateChanged', function() { 191 adjust( 'resize' ); 192 } ); 193 194 editor.on( 'wp-toolbar-toggle', function() { 195 $visualEditor.css( { 196 paddingTop: $visualTop.outerHeight() 197 } ); 198 } ); 199 200 // And adjust "immediately". 201 // Allow some time to load CSS etc. 202 setTimeout( function() { 203 $visualEditor.css( { 204 paddingTop: $visualTop.outerHeight() 205 } ); 206 207 adjust( 'resize' ); 208 }, 500 ); 209 } ); 210 211 // Adjust when the window is scrolled or resized. 212 $window.on( 'scroll resize', function( event ) { 213 adjust( event.type ); 214 } ); 215 216 // Adjust when exiting fullscreen mode. 217 fullscreen && fullscreen.pubsub.subscribe( 'hidden', function() { 218 adjust( 'resize' ); 219 } ); 220 221 // Adjust when collapsing the menu. 222 $document.on( 'wp-collapse-menu.editor-expand', function() { 223 adjust( 'resize' ); 224 } ) 225 226 // Adjust when changing the columns. 227 .on( 'postboxes-columnchange.editor-expand', function() { 228 adjust( 'resize' ); 229 } ) 230 231 // Adjust when changing the body class. 232 .on( 'editor-classchange.editor-expand', function() { 233 adjust( 'resize' ); 234 } ); 235 236 // Adjust the toolbars based on the active editor mode. 237 function adjust( eventType ) { 238 // Make sure we're not in fullscreen mode. 239 if ( fullscreen && fullscreen.settings.visible ) { 240 return; 241 } 242 243 var adminBarHeight = $adminBar.height(), 244 bottomHeight = $bottom.outerHeight(), 245 windowPos = $window.scrollTop(), 246 windowHeight = $window.height(), 247 windowWidth = $window.width(), 248 $top, $editor, visual, 249 toolsHeight, topPos, topHeight, editorPos, editorHeight, editorWidth, statusBarHeight; 250 251 // Visual editor. 252 if ( editorInstance && ! editorInstance.isHidden() ) { 253 $top = $visualTop; 254 $editor = $visualEditor; 255 visual = true; 256 257 // Doesn't hide the panel of 'styleselect'. :( 258 tinymce.each( editorInstance.controlManager.buttons, function( button ) { 259 if ( button._active && ( button.type === 'colorbutton' || button.type === 'panelbutton' || button.type === 'menubutton' ) ) { 260 button.hidePanel(); 261 } 262 } ); 263 // Text editor. 264 } else { 265 $top = $textTop; 266 $editor = $textEditor; 267 } 268 269 toolsHeight = $tools.outerHeight(); 270 topPos = $top.parent().offset().top; 271 topHeight = $top.outerHeight(); 272 editorPos = $editor.offset().top; 273 editorHeight = $editor.outerHeight(); 274 editorWidth = $editor.outerWidth(); 275 statusBarHeight = visual ? $statusBar.outerHeight() : 0; 276 277 // Maybe pin the top. 278 if ( ( ! fixedTop || eventType === 'resize' ) && 279 // Handle scrolling down. 280 ( windowPos >= ( topPos - toolsHeight - adminBarHeight ) && 281 // Handle scrolling up. 282 windowPos <= ( topPos - toolsHeight - adminBarHeight + editorHeight - buffer ) ) ) { 283 fixedTop = true; 284 285 $top.css( { 286 position: 'fixed', 287 top: ( windowWidth > 600 ? adminBarHeight : 0 ) + toolsHeight, 288 width: editorWidth - ( visual ? 0 : 38 ), 289 borderTop: '1px solid #e5e5e5' 290 } ); 291 292 $tools.css( { 293 position: 'fixed', 294 top: ( windowWidth > 600 ? adminBarHeight : 0 ), 295 width: editorWidth + 2 296 } ); 297 // Maybe unpin the top. 298 } else if ( fixedTop || eventType === 'resize' ) { 299 // Handle scrolling up. 300 if ( windowPos <= ( topPos - toolsHeight - adminBarHeight ) ) { 301 fixedTop = false; 302 303 $top.css( { 304 position: 'absolute', 305 top: 0, 306 borderTop: 'none', 307 width: $editor.parent().width() - ( $top.outerWidth() - $top.width() ) 308 } ); 309 310 $tools.css( { 311 position: 'absolute', 312 top: 0, 313 borderTop: 'none', 314 width: $contentWrap.width() 315 } ); 316 // Handle scrolling down. 317 } else if ( windowPos >= ( topPos - toolsHeight - adminBarHeight + editorHeight - buffer ) ) { 318 fixedTop = false; 319 320 $top.css( { 321 position: 'absolute', 322 top: window.pageYOffset - $editor.offset().top + adminBarHeight + $tools.outerHeight(), 323 borderTop: 'none' 324 } ); 325 326 $tools.css( { 327 position: 'absolute', 328 top: window.pageYOffset - $contentWrap.offset().top + adminBarHeight, 329 borderTop: 'none', 330 width: $contentWrap.width() 331 } ); 332 } 333 } 334 335 // Maybe adjust the bottom bar. 336 if ( ( ! fixedBottom || eventType === 'resize' ) && 337 // + 1 for the border around the .wp-editor-container. 338 ( windowPos + windowHeight ) <= ( editorPos + editorHeight + bottomHeight + statusBarHeight + 1 ) ) { 339 fixedBottom = true; 340 341 $bottom.css( { 342 position: 'fixed', 343 bottom: 0, 344 width: editorWidth + 2, 345 borderTop: '1px solid #dedede' 346 } ); 347 } else if ( fixedBottom && 348 ( windowPos + windowHeight ) > ( editorPos + editorHeight + bottomHeight + statusBarHeight - 1 ) ) { 349 fixedBottom = false; 350 351 $bottom.css( { 352 position: 'relative', 353 bottom: 'auto', 354 width: '100%', 355 borderTop: 'none' 356 } ); 357 } 358 } 359 360 textEditorResize(); 361 362 $tools.css( { 363 position: 'absolute', 364 top: 0, 365 width: $contentWrap.width() 366 } ); 367 368 $contentWrap.css( { 369 paddingTop: $tools.outerHeight() 370 } ); 371 372 // This needs to execute after quicktags is ready or a button is added... 373 setTimeout( function() { 374 $textEditor.css( { 375 paddingTop: $textTop.outerHeight() + parseInt( $textEditor.css( 'padding-top' ), 10 ) 376 } ); 377 }, 500 ); 378 }); -
src/wp-admin/js/post.js
Property changes on: src/wp-admin/js/editor-expand.js ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property
1004 1004 ( function() { 1005 1005 var editor, offset, mce, 1006 1006 $textarea = $('textarea#content'), 1007 $handle = $('#post-status-info'); 1007 $handle = $('#post-status-info'), 1008 $contentWrap = $('#wp-content-wrap'); 1008 1009 1009 1010 // No point for touch devices 1010 1011 if ( ! $textarea.length || 'ontouchstart' in window ) { … … 1012 1013 } 1013 1014 1014 1015 function dragging( event ) { 1016 if ( $contentWrap.hasClass( 'wp-editor-expand' ) ) { 1017 return; 1018 } 1019 1015 1020 if ( mce ) { 1016 1021 editor.theme.resizeTo( null, offset + event.pageY ); 1017 1022 } else { … … 1024 1029 function endDrag() { 1025 1030 var height, toolbarHeight; 1026 1031 1032 if ( $contentWrap.hasClass( 'wp-editor-expand' ) ) { 1033 return; 1034 } 1035 1027 1036 if ( mce ) { 1028 1037 editor.focus(); 1029 1038 toolbarHeight = parseInt( $( '#wp-content-editor-container .mce-toolbar-grp' ).height(), 10 ); … … 1074 1083 $( '#post-formats-select input.post-format' ).on( 'change.set-editor-class', function() { 1075 1084 var editor, body, format = this.id; 1076 1085 1077 if ( format && $( this ).prop('checked') ) { 1078 editor = tinymce.get( 'content' ); 1079 1080 if ( editor ) { 1081 body = editor.getBody(); 1082 body.className = body.className.replace( /\bpost-format-[^ ]+/, '' ); 1083 editor.dom.addClass( body, format == 'post-format-0' ? 'post-format-standard' : format ); 1084 } 1086 if ( format && $( this ).prop( 'checked' ) && ( editor = tinymce.get( 'content' ) ) ) { 1087 body = editor.getBody(); 1088 body.className = body.className.replace( /\bpost-format-[^ ]+/, '' ); 1089 editor.dom.addClass( body, format == 'post-format-0' ? 'post-format-standard' : format ); 1090 $( document ).trigger( 'editor-classchange' ); 1085 1091 } 1086 1092 }); 1087 1093 } -
src/wp-admin/js/postbox.js
159 159 if ( el ) { 160 160 el.className = el.className.replace(/columns-\d+/, 'columns-' + n); 161 161 } 162 163 $( document ).trigger( 'postboxes-columnchange' ); 162 164 }, 163 165 164 166 _pb_change : function() { -
src/wp-includes/class-wp-editor.php
339 339 $mce_external_plugins = apply_filters( 'mce_external_plugins', array() ); 340 340 341 341 $plugins = array( 342 'autoresize', 342 343 'charmap', 343 344 'hr', 344 345 'media', -
src/wp-includes/css/editor.css
148 148 div.mce-toolbar-grp { 149 149 border-bottom: 1px solid #dedede; 150 150 background: #f5f5f5; 151 padding: 3px;151 padding: 0; 152 152 position: relative; 153 z-index: 999; 153 154 } 154 155 156 div.mce-toolbar-grp > div { 157 padding: 3px; 158 } 159 155 160 .has-dfw div.mce-toolbar-grp .mce-toolbar.mce-first { 156 161 padding-right: 32px; 157 162 } … … 161 166 } 162 167 163 168 div.mce-statusbar { 164 border-top: 1px solid #e ee;169 border-top: 1px solid #e5e5e5; 165 170 } 166 171 167 172 div.mce-path { 168 padding: 0 8px 2px;173 padding: 2px 10px; 169 174 margin: 0; 170 175 } 171 176 177 .mce-path, 178 .mce-path-item, 179 .mce-path .mce-divider { 180 font-size: 12px; 181 line-height: 18px; 182 } 183 184 .mce-path-item:focus { 185 background: none; 186 color: inherit; 187 } 188 172 189 .mce-toolbar .mce-btn, 173 190 .qt-fullscreen { 174 191 border-color: transparent; … … 731 748 } 732 749 733 750 .mce-i-wp_code:before { 734 content: '\ e017';751 content: '\f475'; 735 752 } 736 753 737 754 /* Editors */ … … 740 757 } 741 758 742 759 .wp-editor-tools { 760 background-color: #f1f1f1; 761 padding-top: 20px; 743 762 position: relative; 744 z-index: 1 ;763 z-index: 1000; 745 764 } 746 765 766 .wp-editor-tools:after { 767 clear: both; 768 content: ''; 769 display: table; 770 } 771 747 772 .wp-editor-container { 748 773 clear: both; 749 774 } … … 763 788 box-sizing: border-box; 764 789 } 765 790 766 .wp-editor-tools {767 padding: 0;768 }769 770 791 .wp-editor-container textarea.wp-editor-area { 771 792 width: 100%; 772 793 margin: 0; -
src/wp-includes/js/tinymce/plugins/autoresize/plugin.js
1 /** 2 * plugin.js 3 * 4 * Copyright, Moxiecode Systems AB 5 * Released under LGPL License. 6 * 7 * License: http://www.tinymce.com/license 8 * Contributing: http://www.tinymce.com/contributing 9 */ 10 11 /*global tinymce:true */ 12 /*eslint no-nested-ternary:0 */ 13 14 /** 15 * Auto Resize 16 * 17 * This plugin automatically resizes the content area to fit its content height. 18 * It will retain a minimum height, which is the height of the content area when 19 * it's initialized. 20 */ 21 tinymce.PluginManager.add('autoresize', function(editor) { 22 var settings = editor.settings, oldSize = 0; 23 24 function isFullscreen() { 25 return editor.plugins.fullscreen && editor.plugins.fullscreen.isFullscreen(); 26 } 27 28 if (editor.settings.inline) { 29 return; 30 } 31 32 /** 33 * This method gets executed each time the editor needs to resize. 34 */ 35 function resize(e) { 36 var deltaSize, doc, body, docElm, DOM = tinymce.DOM, resizeHeight, myHeight, marginTop, marginBottom; 37 38 doc = editor.getDoc(); 39 if (!doc) { 40 return; 41 } 42 43 body = doc.body; 44 docElm = doc.documentElement; 45 resizeHeight = settings.autoresize_min_height; 46 47 if (!body || (e && e.type === "setcontent" && e.initial) || isFullscreen()) { 48 if (body && docElm) { 49 body.style.overflowY = "auto"; 50 docElm.style.overflowY = "auto"; // Old IE 51 } 52 53 return; 54 } 55 56 // Calculate outer height of the body element using CSS styles 57 marginTop = editor.dom.getStyle(body, 'margin-top', true); 58 marginBottom = editor.dom.getStyle(body, 'margin-bottom', true); 59 myHeight = body.offsetHeight + parseInt(marginTop, 10) + parseInt(marginBottom, 10); 60 61 // Make sure we have a valid height 62 if (isNaN(myHeight) || myHeight <= 0) { 63 // Get height differently depending on the browser used 64 myHeight = tinymce.Env.ie ? body.scrollHeight : (tinymce.Env.webkit && body.clientHeight === 0 ? 0 : body.offsetHeight); 65 } 66 67 // Don't make it smaller than the minimum height 68 if (myHeight > settings.autoresize_min_height) { 69 resizeHeight = myHeight; 70 } 71 72 // If a maximum height has been defined don't exceed this height 73 if (settings.autoresize_max_height && myHeight > settings.autoresize_max_height) { 74 resizeHeight = settings.autoresize_max_height; 75 body.style.overflowY = "auto"; 76 docElm.style.overflowY = "auto"; // Old IE 77 } else { 78 body.style.overflowY = "hidden"; 79 docElm.style.overflowY = "hidden"; // Old IE 80 body.scrollTop = 0; 81 } 82 83 // Resize content element 84 if (resizeHeight !== oldSize) { 85 deltaSize = resizeHeight - oldSize; 86 DOM.setStyle(DOM.get(editor.id + '_ifr'), 'height', resizeHeight + 'px'); 87 oldSize = resizeHeight; 88 89 // WebKit doesn't decrease the size of the body element until the iframe gets resized 90 // So we need to continue to resize the iframe down until the size gets fixed 91 if (tinymce.isWebKit && deltaSize < 0) { 92 resize(e); 93 } 94 } 95 } 96 97 /** 98 * Calls the resize x times in 100ms intervals. We can't wait for load events since 99 * the CSS files might load async. 100 */ 101 function wait(times, interval, callback) { 102 setTimeout(function() { 103 resize({}); 104 105 if (times--) { 106 wait(times, interval, callback); 107 } else if (callback) { 108 callback(); 109 } 110 }, interval); 111 } 112 113 // Define minimum height 114 settings.autoresize_min_height = parseInt(editor.getParam('autoresize_min_height', editor.getElement().offsetHeight), 10); 115 116 // Define maximum height 117 settings.autoresize_max_height = parseInt(editor.getParam('autoresize_max_height', 0), 10); 118 119 // Add padding at the bottom for better UX 120 editor.on("init", function() { 121 var overflowPadding = editor.getParam('autoresize_overflow_padding', 1); 122 123 editor.dom.setStyles(editor.getBody(), { 124 paddingBottom: editor.getParam('autoresize_bottom_margin', 50), 125 paddingLeft: overflowPadding, 126 paddingRight: overflowPadding 127 }); 128 }); 129 130 // Add appropriate listeners for resizing content area 131 editor.on("nodechange setcontent keyup FullscreenStateChanged", resize); 132 133 if (editor.getParam('autoresize_on_init', true)) { 134 editor.on('init', function() { 135 // Hit it 20 times in 100 ms intervals 136 wait(20, 100, function() { 137 // Hit it 5 times in 1 sec intervals 138 wait(5, 1000); 139 }); 140 }); 141 } 142 143 // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample'); 144 editor.addCommand('mceAutoResize', resize); 145 }); -
src/wp-includes/js/tinymce/plugins/autoresize/plugin.min.js
Property changes on: src/wp-includes/js/tinymce/plugins/autoresize/plugin.js ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property
1 tinymce.PluginManager.add("autoresize",function(e){function t(){return e.plugins.fullscreen&&e.plugins.fullscreen.isFullscreen()}function i(n){var s,r,g,u,l,m,h,d,f=tinymce.DOM;if(r=e.getDoc()){if(g=r.body,u=r.documentElement,l=o.autoresize_min_height,!g||n&&"setcontent"===n.type&&n.initial||t())return void(g&&u&&(g.style.overflowY="auto",u.style.overflowY="auto"));h=e.dom.getStyle(g,"margin-top",!0),d=e.dom.getStyle(g,"margin-bottom",!0),m=g.offsetHeight+parseInt(h,10)+parseInt(d,10),(isNaN(m)||0>=m)&&(m=tinymce.Env.ie?g.scrollHeight:tinymce.Env.webkit&&0===g.clientHeight?0:g.offsetHeight),m>o.autoresize_min_height&&(l=m),o.autoresize_max_height&&m>o.autoresize_max_height?(l=o.autoresize_max_height,g.style.overflowY="auto",u.style.overflowY="auto"):(g.style.overflowY="hidden",u.style.overflowY="hidden",g.scrollTop=0),l!==a&&(s=l-a,f.setStyle(f.get(e.id+"_ifr"),"height",l+"px"),a=l,tinymce.isWebKit&&0>s&&i(n))}}function n(e,t,o){setTimeout(function(){i({}),e--?n(e,t,o):o&&o()},t)}var o=e.settings,a=0;e.settings.inline||(o.autoresize_min_height=parseInt(e.getParam("autoresize_min_height",e.getElement().offsetHeight),10),o.autoresize_max_height=parseInt(e.getParam("autoresize_max_height",0),10),e.on("init",function(){var t=e.getParam("autoresize_overflow_padding",1);e.dom.setStyles(e.getBody(),{paddingBottom:e.getParam("autoresize_bottom_margin",50),paddingLeft:t,paddingRight:t})}),e.on("nodechange setcontent keyup FullscreenStateChanged",i),e.getParam("autoresize_on_init",!0)&&e.on("init",function(){n(20,100,function(){n(5,1e3)})}),e.addCommand("mceAutoResize",i))}); 2 No newline at end of file -
src/wp-includes/js/tinymce/plugins/autoresize/plugin.js
Property changes on: src/wp-includes/js/tinymce/plugins/autoresize/plugin.min.js ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property
1 /** 2 * plugin.js 3 * 4 * Copyright, Moxiecode Systems AB 5 * Released under LGPL License. 6 * 7 * License: http://www.tinymce.com/license 8 * Contributing: http://www.tinymce.com/contributing 9 */ 10 11 /*global tinymce:true */ 12 /*eslint no-nested-ternary:0 */ 13 14 /** 15 * Auto Resize 16 * 17 * This plugin automatically resizes the content area to fit its content height. 18 * It will retain a minimum height, which is the height of the content area when 19 * it's initialized. 20 */ 21 tinymce.PluginManager.add('autoresize', function(editor) { 22 var settings = editor.settings, oldSize = 0; 23 24 function isFullscreen() { 25 return editor.plugins.fullscreen && editor.plugins.fullscreen.isFullscreen(); 26 } 27 28 if (editor.settings.inline) { 29 return; 30 } 31 32 /** 33 * This method gets executed each time the editor needs to resize. 34 */ 35 function resize(e) { 36 var deltaSize, doc, body, docElm, DOM = tinymce.DOM, resizeHeight, myHeight, marginTop, marginBottom; 37 38 doc = editor.getDoc(); 39 if (!doc) { 40 return; 41 } 42 43 body = doc.body; 44 docElm = doc.documentElement; 45 resizeHeight = settings.autoresize_min_height; 46 47 if (!body || (e && e.type === "setcontent" && e.initial) || isFullscreen()) { 48 if (body && docElm) { 49 body.style.overflowY = "auto"; 50 docElm.style.overflowY = "auto"; // Old IE 51 } 52 53 return; 54 } 55 56 // Calculate outer height of the body element using CSS styles 57 marginTop = editor.dom.getStyle(body, 'margin-top', true); 58 marginBottom = editor.dom.getStyle(body, 'margin-bottom', true); 59 myHeight = body.offsetHeight + parseInt(marginTop, 10) + parseInt(marginBottom, 10); 60 61 // Make sure we have a valid height 62 if (isNaN(myHeight) || myHeight <= 0) { 63 // Get height differently depending on the browser used 64 myHeight = tinymce.Env.ie ? body.scrollHeight : (tinymce.Env.webkit && body.clientHeight === 0 ? 0 : body.offsetHeight); 65 } 66 67 // Don't make it smaller than the minimum height 68 if (myHeight > settings.autoresize_min_height) { 69 resizeHeight = myHeight; 70 } 71 72 // If a maximum height has been defined don't exceed this height 73 if (settings.autoresize_max_height && myHeight > settings.autoresize_max_height) { 74 resizeHeight = settings.autoresize_max_height; 75 body.style.overflowY = "auto"; 76 docElm.style.overflowY = "auto"; // Old IE 77 } else { 78 body.style.overflowY = "hidden"; 79 docElm.style.overflowY = "hidden"; // Old IE 80 body.scrollTop = 0; 81 } 82 83 // Resize content element 84 if (resizeHeight !== oldSize) { 85 deltaSize = resizeHeight - oldSize; 86 DOM.setStyle(DOM.get(editor.id + '_ifr'), 'height', resizeHeight + 'px'); 87 oldSize = resizeHeight; 88 89 // WebKit doesn't decrease the size of the body element until the iframe gets resized 90 // So we need to continue to resize the iframe down until the size gets fixed 91 if (tinymce.isWebKit && deltaSize < 0) { 92 resize(e); 93 } 94 } 95 } 96 97 /** 98 * Calls the resize x times in 100ms intervals. We can't wait for load events since 99 * the CSS files might load async. 100 */ 101 function wait(times, interval, callback) { 102 setTimeout(function() { 103 resize({}); 104 105 if (times--) { 106 wait(times, interval, callback); 107 } else if (callback) { 108 callback(); 109 } 110 }, interval); 111 } 112 113 // Define minimum height 114 settings.autoresize_min_height = parseInt(editor.getParam('autoresize_min_height', editor.getElement().offsetHeight), 10); 115 116 // Define maximum height 117 settings.autoresize_max_height = parseInt(editor.getParam('autoresize_max_height', 0), 10); 118 119 // Add padding at the bottom for better UX 120 editor.on("init", function() { 121 var overflowPadding = editor.getParam('autoresize_overflow_padding', 1); 122 123 editor.dom.setStyles(editor.getBody(), { 124 paddingBottom: editor.getParam('autoresize_bottom_margin', 50), 125 paddingLeft: overflowPadding, 126 paddingRight: overflowPadding 127 }); 128 }); 129 130 // Add appropriate listeners for resizing content area 131 editor.on("nodechange setcontent keyup FullscreenStateChanged", resize); 132 133 if (editor.getParam('autoresize_on_init', true)) { 134 editor.on('init', function() { 135 // Hit it 20 times in 100 ms intervals 136 wait(20, 100, function() { 137 // Hit it 5 times in 1 sec intervals 138 wait(5, 1000); 139 }); 140 }); 141 } 142 143 // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample'); 144 editor.addCommand('mceAutoResize', resize); 145 }); -
src/wp-includes/js/tinymce/plugins/autoresize/plugin.min.js
Property changes on: src/wp-includes/js/tinymce/plugins/autoresize/plugin.js ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property
1 tinymce.PluginManager.add("autoresize",function(e){function t(){return e.plugins.fullscreen&&e.plugins.fullscreen.isFullscreen()}function i(n){var s,r,g,u,l,m,h,d,f=tinymce.DOM;if(r=e.getDoc()){if(g=r.body,u=r.documentElement,l=o.autoresize_min_height,!g||n&&"setcontent"===n.type&&n.initial||t())return void(g&&u&&(g.style.overflowY="auto",u.style.overflowY="auto"));h=e.dom.getStyle(g,"margin-top",!0),d=e.dom.getStyle(g,"margin-bottom",!0),m=g.offsetHeight+parseInt(h,10)+parseInt(d,10),(isNaN(m)||0>=m)&&(m=tinymce.Env.ie?g.scrollHeight:tinymce.Env.webkit&&0===g.clientHeight?0:g.offsetHeight),m>o.autoresize_min_height&&(l=m),o.autoresize_max_height&&m>o.autoresize_max_height?(l=o.autoresize_max_height,g.style.overflowY="auto",u.style.overflowY="auto"):(g.style.overflowY="hidden",u.style.overflowY="hidden",g.scrollTop=0),l!==a&&(s=l-a,f.setStyle(f.get(e.id+"_ifr"),"height",l+"px"),a=l,tinymce.isWebKit&&0>s&&i(n))}}function n(e,t,o){setTimeout(function(){i({}),e--?n(e,t,o):o&&o()},t)}var o=e.settings,a=0;e.settings.inline||(o.autoresize_min_height=parseInt(e.getParam("autoresize_min_height",e.getElement().offsetHeight),10),o.autoresize_max_height=parseInt(e.getParam("autoresize_max_height",0),10),e.on("init",function(){var t=e.getParam("autoresize_overflow_padding",1);e.dom.setStyles(e.getBody(),{paddingBottom:e.getParam("autoresize_bottom_margin",50),paddingLeft:t,paddingRight:t})}),e.on("nodechange setcontent keyup FullscreenStateChanged",i),e.getParam("autoresize_on_init",!0)&&e.on("init",function(){n(20,100,function(){n(5,1e3)})}),e.addCommand("mceAutoResize",i))}); 2 No newline at end of file -
src/wp-includes/js/tinymce/plugins/wordpress/plugin.js
Property changes on: src/wp-includes/js/tinymce/plugins/autoresize/plugin.min.js ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property
52 52 wpAdvButton && wpAdvButton.active( true ); 53 53 } 54 54 } 55 56 editor.fire( 'wp-toolbar-toggle' ); 55 57 } 56 58 57 59 // Add the kitchen sink button :) -
src/wp-includes/js/tinymce/plugins/wpview/plugin.js
646 646 647 647 return { 648 648 getViewText: getViewText, 649 setViewText: setViewText 649 setViewText: setViewText, 650 getView: getView 650 651 }; 651 652 }); -
src/wp-includes/js/tinymce/skins/wordpress/wp-content.css
14 14 font-size: 13px; 15 15 line-height: 19px; 16 16 color: #333; 17 margin: 10px; 17 margin: 9px 10px; 18 max-width: 100%; 19 overflow: visible !important; 20 /* The padding ensures margins of the children are contained in the body. */ 21 padding-top: 1px !important; 22 padding-bottom: 1px !important; 23 padding-left: 0 !important; 24 padding-right: 0 !important; 18 25 } 19 26 20 27 /* When font-weight is different than the default browser style, -
src/wp-includes/script-loader.php
459 459 'savingText' => __('Saving Draft…'), 460 460 ) ); 461 461 462 $scripts->add( 'editor-expand', "/wp-admin/js/editor-expand$suffix.js", array( 'jquery' ), false, 1 ); 463 462 464 $scripts->add( 'link', "/wp-admin/js/link$suffix.js", array( 'wp-lists', 'postbox' ), false, 1 ); 463 465 464 466 $scripts->add( 'comment', "/wp-admin/js/comment$suffix.js", array( 'jquery', 'postbox' ) );