Changeset 32677
- Timestamp:
- 06/01/2015 05:37:14 PM (9 years ago)
- Location:
- trunk/src
- Files:
-
- 1 deleted
- 12 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/admin-ajax.php
r32116 r32677 57 57 'menu-locations-save', 'menu-quick-search', 'meta-box-order', 'get-permalink', 58 58 'sample-permalink', 'inline-save', 'inline-save-tax', 'find_posts', 'widgets-order', 59 'save-widget', 'set-post-thumbnail', 'date_format', 'time_format', 'wp-fullscreen-save-post',59 'save-widget', 'set-post-thumbnail', 'date_format', 'time_format', 60 60 'wp-remove-post-lock', 'dismiss-wp-pointer', 'upload-attachment', 'get-attachment', 61 61 'query-attachments', 'save-attachment', 'save-attachment-compat', 'send-link-to-editor', … … 65 65 'press-this-add-category', 66 66 ); 67 68 // Deprecated 69 $core_actions_post[] = 'wp-fullscreen-save-post'; 67 70 68 71 // Register core Ajax calls. -
trunk/src/wp-admin/css/edit.css
r32071 r32677 71 71 } 72 72 73 #wp-fullscreen-save .fs-saved {74 color: #999;75 float: right;76 margin-top: 4px;77 }78 79 73 #poststuff .inside-submitbox, 80 74 #side-sortables .inside-submitbox { … … 390 384 border: 1px solid transparent; 391 385 } 392 393 .wp-fullscreen-wrap #content-textarea-clone {394 display: none;395 }396 397 /* editor-expand.js override */398 .wp-fullscreen-wrap {399 padding-top: 0 !important;400 }401 402 .wp-fullscreen-wrap .wp-editor-area {403 margin-top: 0 !important;404 }405 406 .wp-fullscreen-wrap .mce-edit-area {407 padding-top: 0 !important;408 }409 /* end editor-expand.js override */410 386 411 387 .wp-editor-expand #wp-content-editor-tools { -
trunk/src/wp-admin/css/ie.css
r32051 r32677 49 49 .welcome-panel .welcome-panel-column:first-child { 50 50 width: 35%; 51 }52 53 .wp-fullscreen-title {54 width: 97%;55 }56 57 #wp_mce_fullscreen_ifr {58 background-color: #f9f9f9;59 }60 61 #wp-fullscreen-tagline {62 color: #82878c;63 font-size: 14px;64 51 } 65 52 -
trunk/src/wp-admin/css/l10n.css
r31843 r32677 55 55 .locale-zh-cn form.upgrade .hint { font-style: normal; font-size: 100%; } 56 56 57 /* Zn_CH: Distraction-free writing.58 * More beautiful font for "Just write."59 * Larger text for HTML/Visual mode.60 */61 .locale-zh-cn #wp-fullscreen-tagline { font-family: KaiTi, "楷体", sans-serif; }62 .locale-zh-cn #wp-fullscreen-modes a { font-size: 12px; }63 64 57 /* zh_CN: Enlarge font-size. */ 65 58 .locale-zh-cn #sort-buttons { font-size: 1em !important; } -
trunk/src/wp-admin/includes/ajax-actions.php
r32652 r32677 2103 2103 * 2104 2104 * @since 3.1.0 2105 * @deprecated 4.3.0 2105 2106 */ 2106 2107 function wp_ajax_wp_fullscreen_save_post() { -
trunk/src/wp-admin/js/wp-fullscreen-stub.js
r32676 r32677 1 /* global deleteUserSetting, setUserSetting, switchEditors, tinymce, tinyMCEPreInit */2 1 /** 3 * Distraction-Free Writing 4 * (wp-fullscreen)2 * Distraction-Free Writing (wp-fullscreen) backwards compatibility stub. 3 * Todo: remove at the end of 2016. 5 4 * 6 * Access the API globally using the window.wp.editor.fullscreen variable.5 * Original was deprecated in 4.1, removed in 4.3. 7 6 */ 8 ( function( $, window ) { 9 var api, ps, s, toggleUI, uiTimer, PubSub, 10 uiScrollTop = 0, 11 transitionend = 'transitionend webkitTransitionEnd', 12 $body = $( document.body ), 13 $document = $( document ); 7 ( function() { 8 var noop = function(){}; 14 9 15 /** 16 * PubSub 17 * 18 * A lightweight publish/subscribe implementation. 19 * 20 * @access private 21 */ 22 PubSub = function() { 23 this.topics = {}; 10 window.wp = window.wp || {}; 11 window.wp.editor = window.wp.editor || {}; 12 window.wp.editor.fullscreen = { 13 bind_resize: noop, 14 dfwWidth: noop, 15 off: noop, 16 on: noop, 17 refreshButtons: noop, 18 resizeTextarea: noop, 19 save: noop, 20 switchmode: noop, 21 toggleUI: noop, 24 22 25 this.subscribe = function( topic, callback ) { 26 if ( ! this.topics[ topic ] ) 27 this.topics[ topic ] = []; 28 29 this.topics[ topic ].push( callback ); 30 return callback; 31 }; 32 33 this.unsubscribe = function( topic, callback ) { 34 var i, l, 35 topics = this.topics[ topic ]; 36 37 if ( ! topics ) 38 return callback || []; 39 40 // Clear matching callbacks 41 if ( callback ) { 42 for ( i = 0, l = topics.length; i < l; i++ ) { 43 if ( callback == topics[i] ) 44 topics.splice( i, 1 ); 45 } 46 return callback; 47 48 // Clear all callbacks 49 } else { 50 this.topics[ topic ] = []; 51 return topics; 52 } 53 }; 54 55 this.publish = function( topic, args ) { 56 var i, l, broken, 57 topics = this.topics[ topic ]; 58 59 if ( ! topics ) 60 return; 61 62 args = args || []; 63 64 for ( i = 0, l = topics.length; i < l; i++ ) { 65 broken = ( topics[i].apply( null, args ) === false || broken ); 66 } 67 return ! broken; 68 }; 69 }; 70 71 // Initialize the fullscreen/api object 72 api = {}; 73 74 // Create the PubSub (publish/subscribe) interface. 75 ps = api.pubsub = new PubSub(); 76 77 s = api.settings = { // Settings 78 visible: false, 79 mode: 'tinymce', 80 id: '', 81 title_id: '', 82 timer: 0, 83 toolbar_shown: false 84 }; 85 86 function _hideUI() { 87 $body.removeClass('wp-dfw-show-ui'); 88 } 89 90 /** 91 * toggleUI 92 * 93 * Toggle the CSS class to show/hide the toolbar, borders and statusbar. 94 */ 95 toggleUI = api.toggleUI = function( show ) { 96 clearTimeout( uiTimer ); 97 98 if ( ! $body.hasClass('wp-dfw-show-ui') || show === 'show' ) { 99 $body.addClass('wp-dfw-show-ui'); 100 } else if ( show !== 'autohide' ) { 101 $body.removeClass('wp-dfw-show-ui'); 102 } 103 104 if ( show === 'autohide' ) { 105 uiTimer = setTimeout( _hideUI, 2000 ); 23 settings: {}, 24 pubsub: { 25 publish: noop, 26 subscribe: noop, 27 unsubscribe: noop, 28 topics: {} 29 }, 30 fade: { 31 In: noop, 32 Out: noop 33 }, 34 ui: { 35 fade: noop, 36 init: noop 106 37 } 107 38 }; 108 109 function resetCssPosition( add ) { 110 s.$dfwWrap.parents().each( function( i, parent ) { 111 var cssPosition, $parent = $(parent); 112 113 if ( add ) { 114 if ( parent.style.position ) { 115 $parent.data( 'wp-dfw-css-position', parent.style.position ); 116 } 117 118 $parent.css( 'position', 'static' ); 119 } else { 120 cssPosition = $parent.data( 'wp-dfw-css-position' ); 121 cssPosition = cssPosition || ''; 122 $parent.css( 'position', cssPosition ); 123 } 124 125 if ( parent.nodeName === 'BODY' ) { 126 return false; 127 } 128 }); 129 } 130 131 /** 132 * on() 133 * 134 * Turns fullscreen on. 135 * 136 * @param string mode Optional. Switch to the given mode before opening. 137 */ 138 api.on = function() { 139 var id, $dfwWrap, titleId; 140 141 if ( s.visible ) { 142 return; 143 } 144 145 if ( ! s.$fullscreenFader ) { 146 api.ui.init(); 147 } 148 149 // Settings can be added or changed by defining "wp_fullscreen_settings" JS object. 150 if ( typeof window.wp_fullscreen_settings === 'object' ) 151 $.extend( s, window.wp_fullscreen_settings ); 152 153 id = s.id || window.wpActiveEditor; 154 155 if ( ! id ) { 156 if ( s.hasTinymce ) { 157 id = tinymce.activeEditor.id; 158 } else { 159 return; 160 } 161 } 162 163 s.id = id; 164 $dfwWrap = s.$dfwWrap = $( '#wp-' + id + '-wrap' ); 165 166 if ( ! $dfwWrap.length ) { 167 return; 168 } 169 170 s.$dfwTextarea = $( '#' + id ); 171 s.$editorContainer = $dfwWrap.find( '.wp-editor-container' ); 172 uiScrollTop = $document.scrollTop(); 173 174 if ( s.hasTinymce ) { 175 s.editor = tinymce.get( id ); 176 } 177 178 if ( s.editor && ! s.editor.isHidden() ) { 179 s.origHeight = $( '#' + id + '_ifr' ).height(); 180 s.mode = 'tinymce'; 181 } else { 182 s.origHeight = s.$dfwTextarea.height(); 183 s.mode = 'html'; 184 } 185 186 // Try to find title field 187 if ( typeof window.adminpage !== 'undefined' && 188 ( window.adminpage === 'post-php' || window.adminpage === 'post-new-php' ) ) { 189 190 titleId = 'title'; 191 } else { 192 titleId = id + '-title'; 193 } 194 195 s.$dfwTitle = $( '#' + titleId ); 196 197 if ( ! s.$dfwTitle.length ) { 198 s.$dfwTitle = null; 199 } 200 201 api.ui.fade( 'show', 'showing', 'shown' ); 202 }; 203 204 /** 205 * off() 206 * 207 * Turns fullscreen off. 208 */ 209 api.off = function() { 210 if ( ! s.visible ) 211 return; 212 213 api.ui.fade( 'hide', 'hiding', 'hidden' ); 214 }; 215 216 /** 217 * switchmode() 218 * 219 * @return string - The current mode. 220 * 221 * @param string to - The fullscreen mode to switch to. 222 * @event switchMode 223 * @eventparam string to - The new mode. 224 * @eventparam string from - The old mode. 225 */ 226 api.switchmode = function( to ) { 227 var from = s.mode; 228 229 if ( ! to || ! s.visible || ! s.hasTinymce || typeof switchEditors === 'undefined' ) { 230 return from; 231 } 232 233 // Don't switch if the mode is the same. 234 if ( from == to ) 235 return from; 236 237 if ( to === 'tinymce' && ! s.editor ) { 238 s.editor = tinymce.get( s.id ); 239 240 if ( ! s.editor && typeof tinyMCEPreInit !== 'undefined' && 241 tinyMCEPreInit.mceInit && tinyMCEPreInit.mceInit[ s.id ] ) { 242 243 // If the TinyMCE instance hasn't been created, set the "wp_fulscreen" flag on creating it 244 tinyMCEPreInit.mceInit[ s.id ].wp_fullscreen = true; 245 } 246 } 247 248 s.mode = to; 249 switchEditors.go( s.id, to ); 250 api.refreshButtons( true ); 251 252 if ( to === 'html' ) { 253 setTimeout( api.resizeTextarea, 200 ); 254 } 255 256 return to; 257 }; 258 259 /** 260 * General 261 */ 262 263 api.save = function() { 264 var $hidden = $('#hiddenaction'), 265 oldVal = $hidden.val(), 266 $spinner = $('#wp-fullscreen-save .spinner'), 267 $saveMessage = $('#wp-fullscreen-save .wp-fullscreen-saved-message'), 268 $errorMessage = $('#wp-fullscreen-save .wp-fullscreen-error-message'); 269 270 $spinner.addClass( 'is-active' ); 271 $errorMessage.hide(); 272 $saveMessage.hide(); 273 $hidden.val('wp-fullscreen-save-post'); 274 275 if ( s.editor && ! s.editor.isHidden() ) { 276 s.editor.save(); 277 } 278 279 $.ajax({ 280 url: window.ajaxurl, 281 type: 'post', 282 data: $('form#post').serialize(), 283 dataType: 'json' 284 }).done( function( response ) { 285 $spinner.removeClass( 'is-active' ); 286 287 if ( response && response.success ) { 288 $saveMessage.show(); 289 290 setTimeout( function() { 291 $saveMessage.fadeOut(300); 292 }, 3000 ); 293 294 if ( response.data && response.data.last_edited ) { 295 $('#wp-fullscreen-save input').attr( 'title', response.data.last_edited ); 296 } 297 } else { 298 $errorMessage.show(); 299 } 300 }).fail( function() { 301 $spinner.removeClass( 'is-active' ); 302 $errorMessage.show(); 303 }); 304 305 $hidden.val( oldVal ); 306 }; 307 308 api.dfwWidth = function( pixels, total ) { 309 var width; 310 311 if ( pixels && pixels.toString().indexOf('%') !== -1 ) { 312 s.$editorContainer.css( 'width', pixels ); 313 s.$statusbar.css( 'width', pixels ); 314 315 if ( s.$dfwTitle ) { 316 s.$dfwTitle.css( 'width', pixels ); 317 } 318 return; 319 } 320 321 if ( ! pixels ) { 322 // Reset to theme width 323 width = $('#wp-fullscreen-body').data('theme-width') || 800; 324 s.$editorContainer.width( width ); 325 s.$statusbar.width( width ); 326 327 if ( s.$dfwTitle ) { 328 s.$dfwTitle.width( width - 16 ); 329 } 330 331 deleteUserSetting('dfw_width'); 332 return; 333 } 334 335 if ( total ) { 336 width = pixels; 337 } else { 338 width = s.$editorContainer.width(); 339 width += pixels; 340 } 341 342 if ( width < 200 || width > 1200 ) { 343 // sanity check 344 return; 345 } 346 347 s.$editorContainer.width( width ); 348 s.$statusbar.width( width ); 349 350 if ( s.$dfwTitle ) { 351 s.$dfwTitle.width( width - 16 ); 352 } 353 354 setUserSetting( 'dfw_width', width ); 355 }; 356 357 // This event occurs before the overlay blocks the UI. 358 ps.subscribe( 'show', function() { 359 var title = $('#last-edit').text(); 360 361 if ( title ) { 362 $('#wp-fullscreen-save input').attr( 'title', title ); 363 } 364 }); 365 366 // This event occurs while the overlay blocks the UI. 367 ps.subscribe( 'showing', function() { 368 $body.addClass( 'wp-fullscreen-active' ); 369 s.$dfwWrap.addClass( 'wp-fullscreen-wrap' ); 370 371 if ( s.$dfwTitle ) { 372 s.$dfwTitle.after( '<span id="wp-fullscreen-title-placeholder">' ); 373 s.$dfwWrap.prepend( s.$dfwTitle.addClass('wp-fullscreen-title') ); 374 } 375 376 api.refreshButtons(); 377 resetCssPosition( true ); 378 $('#wpadminbar').hide(); 379 380 // Show the UI for 2 sec. when opening 381 toggleUI('autohide'); 382 383 api.bind_resize(); 384 385 if ( s.editor ) { 386 s.editor.execCommand( 'wpFullScreenOn' ); 387 } 388 389 if ( 'ontouchstart' in window ) { 390 api.dfwWidth( '90%' ); 391 } else { 392 api.dfwWidth( $( '#wp-fullscreen-body' ).data('dfw-width') || 800, true ); 393 } 394 395 // scroll to top so the user is not disoriented 396 scrollTo(0, 0); 397 }); 398 399 // This event occurs after the overlay unblocks the UI 400 ps.subscribe( 'shown', function() { 401 s.visible = true; 402 403 if ( s.editor && ! s.editor.isHidden() ) { 404 s.editor.execCommand( 'wpAutoResize' ); 405 } else { 406 api.resizeTextarea( 'force' ); 407 } 408 }); 409 410 ps.subscribe( 'hide', function() { // This event occurs before the overlay blocks DFW. 411 $document.unbind( '.fullscreen' ); 412 s.$dfwTextarea.unbind('.wp-dfw-resize'); 413 }); 414 415 ps.subscribe( 'hiding', function() { // This event occurs while the overlay blocks the DFW UI. 416 $body.removeClass( 'wp-fullscreen-active' ); 417 418 if ( s.$dfwTitle ) { 419 $( '#wp-fullscreen-title-placeholder' ).before( s.$dfwTitle.removeClass('wp-fullscreen-title').css( 'width', '' ) ).remove(); 420 } 421 422 s.$dfwWrap.removeClass( 'wp-fullscreen-wrap' ); 423 s.$editorContainer.css( 'width', '' ); 424 s.$dfwTextarea.add( '#' + s.id + '_ifr' ).height( s.origHeight ); 425 426 if ( s.editor ) { 427 s.editor.execCommand( 'wpFullScreenOff' ); 428 } 429 430 resetCssPosition( false ); 431 432 window.scrollTo( 0, uiScrollTop ); 433 $('#wpadminbar').show(); 434 }); 435 436 // This event occurs after DFW is removed. 437 ps.subscribe( 'hidden', function() { 438 s.visible = false; 439 }); 440 441 api.refreshButtons = function( fade ) { 442 if ( s.mode === 'html' ) { 443 $('#wp-fullscreen-mode-bar').removeClass('wp-tmce-mode').addClass('wp-html-mode') 444 .find('a').removeClass( 'active' ).filter('.wp-fullscreen-mode-html').addClass( 'active' ); 445 446 if ( fade ) { 447 $('#wp-fullscreen-button-bar').fadeOut( 150, function(){ 448 $(this).addClass('wp-html-mode').fadeIn( 150 ); 449 }); 450 } else { 451 $('#wp-fullscreen-button-bar').addClass('wp-html-mode'); 452 } 453 } else if ( s.mode === 'tinymce' ) { 454 $('#wp-fullscreen-mode-bar').removeClass('wp-html-mode').addClass('wp-tmce-mode') 455 .find('a').removeClass( 'active' ).filter('.wp-fullscreen-mode-tinymce').addClass( 'active' ); 456 457 if ( fade ) { 458 $('#wp-fullscreen-button-bar').fadeOut( 150, function(){ 459 $(this).removeClass('wp-html-mode').fadeIn( 150 ); 460 }); 461 } else { 462 $('#wp-fullscreen-button-bar').removeClass('wp-html-mode'); 463 } 464 } 465 }; 466 467 /** 468 * UI Elements 469 * 470 * Used for transitioning between states. 471 */ 472 api.ui = { 473 init: function() { 474 var toolbar; 475 476 s.toolbar = toolbar = $('#fullscreen-topbar'); 477 s.$fullscreenFader = $('#fullscreen-fader'); 478 s.$statusbar = $('#wp-fullscreen-status'); 479 s.hasTinymce = typeof tinymce !== 'undefined'; 480 481 if ( ! s.hasTinymce ) 482 $('#wp-fullscreen-mode-bar').hide(); 483 484 $document.keyup( function(e) { 485 var c = e.keyCode || e.charCode, modKey; 486 487 if ( ! s.visible ) { 488 return; 489 } 490 491 if ( navigator.platform && navigator.platform.indexOf('Mac') !== -1 ) { 492 modKey = e.ctrlKey; // Ctrl key for Mac 493 } else { 494 modKey = e.altKey; // Alt key for Win & Linux 495 } 496 497 if ( modKey && ( 61 === c || 107 === c || 187 === c ) ) { // + 498 api.dfwWidth( 25 ); 499 e.preventDefault(); 500 } 501 502 if ( modKey && ( 45 === c || 109 === c || 189 === c ) ) { // - 503 api.dfwWidth( -25 ); 504 e.preventDefault(); 505 } 506 507 if ( modKey && 48 === c ) { // 0 508 api.dfwWidth( 0 ); 509 e.preventDefault(); 510 } 511 }); 512 513 $( window ).on( 'keydown.wp-fullscreen', function( event ) { 514 // Turn fullscreen off when Esc is pressed. 515 if ( 27 === event.keyCode && s.visible ) { 516 api.off(); 517 event.stopImmediatePropagation(); 518 } 519 }); 520 521 if ( 'ontouchstart' in window ) { 522 $body.addClass('wp-dfw-touch'); 523 } 524 525 toolbar.on( 'mouseenter', function() { 526 toggleUI('show'); 527 }).on( 'mouseleave', function() { 528 toggleUI('autohide'); 529 }); 530 531 // Bind buttons 532 $('#wp-fullscreen-buttons').on( 'click.wp-fullscreen', 'button', function( event ) { 533 var command = event.currentTarget.id ? event.currentTarget.id.substr(6) : null; 534 535 if ( s.editor && 'tinymce' === s.mode ) { 536 switch( command ) { 537 case 'bold': 538 s.editor.execCommand('Bold'); 539 break; 540 case 'italic': 541 s.editor.execCommand('Italic'); 542 break; 543 case 'bullist': 544 s.editor.execCommand('InsertUnorderedList'); 545 break; 546 case 'numlist': 547 s.editor.execCommand('InsertOrderedList'); 548 break; 549 case 'link': 550 s.editor.execCommand('WP_Link'); 551 break; 552 case 'unlink': 553 s.editor.execCommand('unlink'); 554 break; 555 case 'help': 556 s.editor.execCommand('WP_Help'); 557 break; 558 case 'blockquote': 559 s.editor.execCommand('mceBlockQuote'); 560 break; 561 } 562 } else if ( command === 'link' && window.wpLink ) { 563 window.wpLink.open(); 564 } 565 566 if ( command === 'wp-media-library' && typeof wp !== 'undefined' && wp.media && wp.media.editor ) { 567 wp.media.editor.open( s.id ); 568 } 569 }); 570 }, 571 572 fade: function( before, during, after ) { 573 if ( ! s.$fullscreenFader ) { 574 api.ui.init(); 575 } 576 577 // If any callback bound to before returns false, bail. 578 if ( before && ! ps.publish( before ) ) { 579 return; 580 } 581 582 api.fade.In( s.$fullscreenFader, 200, function() { 583 if ( during ) { 584 ps.publish( during ); 585 } 586 587 api.fade.Out( s.$fullscreenFader, 200, function() { 588 if ( after ) { 589 ps.publish( after ); 590 } 591 }); 592 }); 593 } 594 }; 595 596 api.fade = { 597 // Sensitivity to allow browsers to render the blank element before animating. 598 sensitivity: 100, 599 600 In: function( element, speed, callback, stop ) { 601 602 callback = callback || $.noop; 603 speed = speed || 400; 604 stop = stop || false; 605 606 if ( api.fade.transitions ) { 607 if ( element.is(':visible') ) { 608 element.addClass( 'fade-trigger' ); 609 return element; 610 } 611 612 element.show(); 613 element.first().one( transitionend, function() { 614 callback(); 615 }); 616 617 setTimeout( function() { element.addClass( 'fade-trigger' ); }, this.sensitivity ); 618 } else { 619 if ( stop ) { 620 element.stop(); 621 } 622 623 element.css( 'opacity', 1 ); 624 element.first().fadeIn( speed, callback ); 625 626 if ( element.length > 1 ) { 627 element.not(':first').fadeIn( speed ); 628 } 629 } 630 631 return element; 632 }, 633 634 Out: function( element, speed, callback, stop ) { 635 636 callback = callback || $.noop; 637 speed = speed || 400; 638 stop = stop || false; 639 640 if ( ! element.is(':visible') ) { 641 return element; 642 } 643 644 if ( api.fade.transitions ) { 645 element.first().one( transitionend, function() { 646 if ( element.hasClass('fade-trigger') ) { 647 return; 648 } 649 650 element.hide(); 651 callback(); 652 }); 653 setTimeout( function() { element.removeClass( 'fade-trigger' ); }, this.sensitivity ); 654 } else { 655 if ( stop ) { 656 element.stop(); 657 } 658 659 element.first().fadeOut( speed, callback ); 660 661 if ( element.length > 1 ) { 662 element.not(':first').fadeOut( speed ); 663 } 664 } 665 666 return element; 667 }, 668 669 // Check if the browser supports CSS 3.0 transitions 670 transitions: ( function() { 671 var style = document.documentElement.style; 672 673 return ( typeof style.WebkitTransition === 'string' || 674 typeof style.MozTransition === 'string' || 675 typeof style.OTransition === 'string' || 676 typeof style.transition === 'string' ); 677 })() 678 }; 679 680 /** 681 * Resize API 682 * 683 * Automatically updates textarea height. 684 */ 685 api.bind_resize = function() { 686 s.$dfwTextarea.on( 'keydown.wp-dfw-resize click.wp-dfw-resize paste.wp-dfw-resize', function() { 687 api.resizeTextarea(); 688 }); 689 }; 690 691 api.resizeTextarea = function() { 692 var node = s.$dfwTextarea[0]; 693 694 if ( node.scrollHeight > node.clientHeight ) { 695 node.style.height = node.scrollHeight + 50 + 'px'; 696 } 697 }; 698 699 // Export 700 window.wp = window.wp || {}; 701 window.wp.editor = window.wp.editor || {}; 702 window.wp.editor.fullscreen = api; 703 704 })( jQuery, window ); 39 }()); -
trunk/src/wp-includes/class-wp-editor.php
r32543 r32677 26 26 private static $editor_buttons_css = true; 27 27 private static $drag_drop_upload = false; 28 private static $old_dfw_compat = false; 28 29 29 30 private function __construct() {} … … 54 55 * @type bool $teeny Whether to output the minimal editor config. Examples include 55 56 * Press This and the Comment editor. Default false. 56 * @type bool $dfw Whether to replace the default fullscreen with "Distraction Free 57 * Writing". DFW requires specific DOM elements and css). Default false. 57 * @type bool $dfw Deprecated in 4.1. Since 4.3 used only to enqueue wp-fullscreen-stub.js for backwards compatibility. 58 58 * @type bool|array $tinymce Whether to load TinyMCE. Can be used to pass settings directly to 59 59 * TinyMCE using an array. Default true. … … 112 112 self::$has_quicktags = true; 113 113 114 if ( $set['dfw'] ) { 115 self::$old_dfw_compat = true; 116 } 117 114 118 if ( empty( $set['editor_height'] ) ) 115 119 return $set; … … 283 287 if ( empty($qtInit['buttons']) ) 284 288 $qtInit['buttons'] = 'strong,em,link,block,del,ins,img,ul,ol,li,code,more,close'; 285 286 if ( $set['dfw'] )287 $qtInit['buttons'] .= ',fullscreen';288 289 289 290 if ( $set['_content_editor_dfw'] ) { … … 469 470 } 470 471 } 471 472 if ( $set['dfw'] )473 $plugins[] = 'wpfullscreen';474 472 475 473 self::$plugins = $plugins; … … 638 636 } 639 637 640 if ( $set['dfw'] ) {641 // replace the first 'fullscreen' with 'wp_fullscreen'642 if ( ($key = array_search('fullscreen', $mce_buttons)) !== false )643 $mce_buttons[$key] = 'wp_fullscreen';644 elseif ( ($key = array_search('fullscreen', $mce_buttons_2)) !== false )645 $mce_buttons_2[$key] = 'wp_fullscreen';646 elseif ( ($key = array_search('fullscreen', $mce_buttons_3)) !== false )647 $mce_buttons_3[$key] = 'wp_fullscreen';648 elseif ( ($key = array_search('fullscreen', $mce_buttons_4)) !== false )649 $mce_buttons_4[$key] = 'wp_fullscreen';650 }651 652 638 $mceInit = array ( 653 639 'selector' => "#$editor_id", … … 754 740 } 755 741 756 if ( in_array('wpfullscreen', self::$plugins, true) || in_array('fullscreen', self::$qt_buttons, true) ) 757 wp_enqueue_script('wp-fullscreen'); 742 if ( self::$old_dfw_compat ) { 743 wp_enqueue_script('wp-fullscreen-stub'); 744 } 758 745 759 746 if ( self::$has_medialib ) { … … 1253 1240 self::wp_link_dialog(); 1254 1241 1255 if ( in_array( 'wpfullscreen', self::$plugins, true ) || in_array( 'fullscreen', self::$qt_buttons, true ) )1256 self::wp_fullscreen_html();1257 1258 1242 /** 1259 1243 * Fires after any core TinyMCE editor instances are created. … … 1272 1256 */ 1273 1257 public static function wp_fullscreen_html() { 1274 global $content_width; 1275 $post = get_post(); 1276 1277 $width = isset( $content_width ) && 800 > $content_width ? $content_width : 800; 1278 $width = $width + 22; // compensate for the padding and border 1279 $dfw_width = get_user_setting( 'dfw_width', $width ); 1280 $save = $post && $post->post_status == 'publish' ? __('Update') : __('Save'); 1281 1282 ?> 1283 <div id="wp-fullscreen-body" class="wp-core-ui<?php if ( is_rtl() ) echo ' rtl'; ?>" data-theme-width="<?php echo (int) $width; ?>" data-dfw-width="<?php echo (int) $dfw_width; ?>"> 1284 <div id="fullscreen-topbar"> 1285 <div id="wp-fullscreen-toolbar"> 1286 <div id="wp-fullscreen-close"><a href="#" onclick="wp.editor.fullscreen.off();return false;"><?php _e('Exit fullscreen'); ?></a></div> 1287 <div id="wp-fullscreen-central-toolbar" style="width:<?php echo $width; ?>px;"> 1288 1289 <div id="wp-fullscreen-mode-bar"> 1290 <div id="wp-fullscreen-modes" class="button-group"> 1291 <a class="button wp-fullscreen-mode-tinymce" href="#" onclick="wp.editor.fullscreen.switchmode( 'tinymce' ); return false;"><?php _e( 'Visual' ); ?></a> 1292 <a class="button wp-fullscreen-mode-html" href="#" onclick="wp.editor.fullscreen.switchmode( 'html' ); return false;"><?php _ex( 'Text', 'Name for the Text editor tab (formerly HTML)' ); ?></a> 1293 </div> 1294 </div> 1295 1296 <div id="wp-fullscreen-button-bar"><div id="wp-fullscreen-buttons" class="mce-toolbar"> 1297 <?php 1298 1299 $buttons = array( 1300 // format: title, onclick, show in both editors 1301 'bold' => array( 'title' => __('Bold (Ctrl + B)'), 'both' => false ), 1302 'italic' => array( 'title' => __('Italic (Ctrl + I)'), 'both' => false ), 1303 'bullist' => array( 'title' => __('Unordered list (Alt + Shift + U)'), 'both' => false ), 1304 'numlist' => array( 'title' => __('Ordered list (Alt + Shift + O)'), 'both' => false ), 1305 'blockquote' => array( 'title' => __('Blockquote (Alt + Shift + Q)'), 'both' => false ), 1306 'wp-media-library' => array( 'title' => __('Media library (Alt + Shift + M)'), 'both' => true ), 1307 'link' => array( 'title' => __('Insert/edit link (Alt + Shift + A)'), 'both' => true ), 1308 'unlink' => array( 'title' => __('Unlink (Alt + Shift + S)'), 'both' => false ), 1309 'help' => array( 'title' => __('Help (Alt + Shift + H)'), 'both' => false ), 1310 ); 1311 1312 /** 1313 * Filter the list of TinyMCE buttons for the fullscreen 1314 * 'Distraction-Free Writing' editor. 1315 * 1316 * @since 3.2.0 1317 * 1318 * @param array $buttons An array of TinyMCE buttons for the DFW editor. 1319 */ 1320 $buttons = apply_filters( 'wp_fullscreen_buttons', $buttons ); 1321 1322 foreach ( $buttons as $button => $args ) { 1323 if ( 'separator' == $args ) { 1324 continue; 1325 } 1326 1327 $onclick = ! empty( $args['onclick'] ) ? ' onclick="' . $args['onclick'] . '"' : ''; 1328 $title = esc_attr( $args['title'] ); 1329 ?> 1330 1331 <div class="mce-widget mce-btn<?php if ( $args['both'] ) { ?> wp-fullscreen-both<?php } ?>"> 1332 <button type="button" aria-label="<?php echo $title; ?>" title="<?php echo $title; ?>"<?php echo $onclick; ?> id="wp_fs_<?php echo $button; ?>"> 1333 <i class="mce-ico mce-i-<?php echo $button; ?>"></i> 1334 </button> 1335 </div> 1336 <?php 1337 } 1338 1339 ?> 1340 1341 </div></div> 1342 1343 <div id="wp-fullscreen-save"> 1344 <input type="button" class="button button-primary right" value="<?php echo $save; ?>" onclick="wp.editor.fullscreen.save();" /> 1345 <span class="wp-fullscreen-saved-message"><?php if ( $post && $post->post_status == 'publish' ) _e('Updated.'); else _e('Saved.'); ?></span> 1346 <span class="wp-fullscreen-error-message"><?php _e('Save failed.'); ?></span> 1347 <span class="spinner"></span> 1348 </div> 1349 1350 </div> 1351 </div> 1352 </div> 1353 <div id="wp-fullscreen-statusbar"> 1354 <div id="wp-fullscreen-status"> 1355 <div id="wp-fullscreen-count"><?php printf( __( 'Word count: %s' ), '<span class="word-count">0</span>' ); ?></div> 1356 <div id="wp-fullscreen-tagline"><?php _e('Just write.'); ?></div> 1357 </div> 1358 </div> 1359 </div> 1360 1361 <div class="fullscreen-overlay" id="fullscreen-overlay"></div> 1362 <div class="fullscreen-overlay fullscreen-fader fade-300" id="fullscreen-fader"></div> 1363 <?php 1258 _deprecated_function( __FUNCTION__, '4.3' ); 1364 1259 } 1365 1260 -
trunk/src/wp-includes/css/editor.css
r32051 r32677 300 300 } 301 301 302 #wp-fullscreen-buttons .mce-btn,303 302 .mce-toolbar .mce-btn-group .mce-btn, 304 303 .qt-dfw { … … 312 311 } 313 312 314 #wp-fullscreen-buttons .mce-btn:hover,315 313 .mce-toolbar .mce-btn-group .mce-btn:hover, 316 #wp-fullscreen-buttons .mce-btn:focus,317 314 .mce-toolbar .mce-btn-group .mce-btn:focus, 318 315 .qt-dfw:hover, … … 327 324 328 325 .mce-toolbar .mce-btn-group .mce-btn.mce-active, 329 #wp-fullscreen-buttons .mce-btn.mce-active,330 326 .mce-toolbar .mce-btn-group .mce-btn:active, 331 #wp-fullscreen-buttons .mce-btn:active,332 327 .qt-dfw.active { 333 328 background: #ebebeb; … … 346 341 347 342 .mce-toolbar .mce-btn-group .mce-btn.mce-disabled:hover, 348 #wp-fullscreen-buttons .mce-btn.mce-disabled:hover, 349 .mce-toolbar .mce-btn-group .mce-btn.mce-disabled:focus, 350 #wp-fullscreen-buttons .mce-btn.mce-disabled:focus { 343 .mce-toolbar .mce-btn-group .mce-btn.mce-disabled:focus { 351 344 color: #a0a5aa; 352 345 background: none; … … 1112 1105 } 1113 1106 1114 #wp-fullscreen-buttons .mce-btn,1115 1107 .mce-toolbar .mce-btn-group .mce-btn { 1116 1108 margin: 1px; … … 1608 1600 } 1609 1601 1610 /* Old TinyMCE 3.x modal */1611 /*1612 .clearlooks2 .mceTop {1613 border-bottom: 1px solid #ccc;1614 }1615 1616 .clearlooks2 .mceTop span {1617 font: 13px/24px "Open Sans", sans-serif;1618 color: #e5e5e5;1619 }1620 1621 .clearlooks2 .mceTop .mceLeft {1622 background: #444444;1623 border-color: transparent;1624 }1625 1626 .clearlooks2 .mceTop .mceRight {1627 background: #444444;1628 border-color: transparent;1629 }1630 1631 .clearlooks2 .mceMiddle {1632 clip: rect(24px auto auto auto);1633 }1634 1635 .clearlooks2 .mceMiddle .mceLeft {1636 background: #f1f1f1;1637 border-color: transparent;1638 }1639 1640 .clearlooks2 .mceMiddle .mceRight {1641 background: #f1f1f1;1642 border-color: transparent;1643 }1644 1645 .clearlooks2 .mceBottom {1646 background: #f1f1f1;1647 border-color: transparent;1648 }1649 1650 .clearlooks2 .mceBottom .mceLeft {1651 background: #f1f1f1;1652 border-color: transparent;1653 }1654 1655 .clearlooks2 .mceBottom .mceCenter {1656 background: #f1f1f1;1657 border-color: transparent;1658 }1659 1660 .clearlooks2 .mceBottom .mceRight {1661 background: #f1f1f1;1662 border-color: transparent;1663 }1664 1665 .clearlooks2 .mceClose,1666 .clearlooks2 .mceFocus .mceClose,1667 .clearlooks2 .mceFocus .mceClose:hover {1668 background-image: none;1669 }1670 .clearlooks2 .mceClose:before {1671 content: '\f158';1672 font: normal 20px/1 'dashicons';1673 speak: none;1674 -webkit-font-smoothing: antialiased;1675 -moz-osx-font-smoothing: grayscale;1676 color: #999;1677 padding-left: 12px;1678 }1679 1680 /* from colors.css1681 .clearlooks2 {1682 box-shadow: 0 5px 15px rgba(0,0,0,0.7);1683 }1684 1685 .clearlooks2 .mceMiddle span,1686 .clearlooks2 .mceMiddle .mceLeft,1687 .clearlooks2 .mceMiddle .mceRight,1688 .clearlooks2 .mceBottom,1689 .clearlooks2 .mceBottom .mceLeft,1690 .clearlooks2 .mceBottom .mceCenter,1691 .clearlooks2 .mceBottom .mceRight {1692 background-color: #fcfcfc;1693 }1694 1695 .clearlooks2 .mceTop span,1696 .clearlooks2 .mceFocus .mceTop span {1697 color: #23282d;1698 }1699 1700 .clearlooks2 .mceClose:before {1701 color: #999;1702 }1703 1704 .clearlooks2 .mceClose:hover:before {1705 color: #00a0d2;1706 }1707 */1708 /* Distraction-Free Writing mode1709 * =Overlay Styles1710 -------------------------------------------------------------- */1711 .fullscreen-overlay {1712 z-index: 100005;1713 display: none;1714 position: fixed;1715 top: 0;1716 bottom: 0;1717 left: 0;1718 right: 0;1719 -webkit-filter: inherit;1720 filter: inherit;1721 }1722 1723 .wp-fullscreen-active .fullscreen-overlay,1724 .wp-fullscreen-active #wp-fullscreen-body {1725 display: block;1726 }1727 1728 .fullscreen-fader {1729 z-index: 200000;1730 }1731 1732 .wp-fullscreen-active .fullscreen-fader,1733 .wp-core-ui.wp-fullscreen-active .postbox-container {1734 display: none;1735 }1736 1737 1602 /* =Overlay Body 1738 1603 -------------------------------------------------------------- */ 1739 1604 1740 #wp-fullscreen-body,1741 1605 .mce-fullscreen { 1742 1606 z-index: 100010; 1743 }1744 1745 #wp-fullscreen-body {1746 display: none;1747 }1748 1749 .wp-fullscreen-wrap {1750 margin: 0;1751 padding: 0;1752 position: absolute;1753 left: 0;1754 right: 0;1755 bottom: 30px;1756 top: 60px;1757 z-index: 100015;1758 }1759 1760 .wp-fullscreen-wrap .wp-editor-container,1761 .wp-fullscreen-title,1762 #wp-fullscreen-central-toolbar {1763 -webkit-box-sizing: border-box;1764 -moz-box-sizing: border-box;1765 box-sizing: border-box;1766 max-width: 100%;1767 }1768 1769 .wp-fullscreen-active .wp-editor-tools,1770 .wp-fullscreen-active .quicktags-toolbar,1771 .wp-fullscreen-active .mce-toolbar-grp,1772 .wp-fullscreen-active .mce-statusbar {1773 display: none;1774 }1775 1776 #wp-fullscreen-statusbar {1777 position: fixed;1778 left: 0;1779 right: 0;1780 bottom: 0;1781 height: 30px;1782 z-index: 100020;1783 background: #fff;1784 -webkit-transition: height 0.2s;1785 transition: height 0.2s;1786 }1787 1788 #wp-fullscreen-status {1789 margin: 0 auto;1790 padding: 0;1791 }1792 1793 .wp-fullscreen-active .wp-fullscreen-title,1794 .wp-fullscreen-active .wp-fullscreen-title:focus,1795 .wp-fullscreen-active .wp-editor-container {1796 -webkit-border-radius: 0;1797 border-radius: 0;1798 border: 1px dashed transparent;1799 background: transparent;1800 -webkit-box-shadow: none;1801 box-shadow: none;1802 -webkit-transition: border-color 0.4s;1803 transition: border-color 0.4s;1804 }1805 1806 .wp-fullscreen-active .wp-editor-container {1807 margin: 0 auto 40px;1808 }1809 1810 .wp-fullscreen-active .wp-fullscreen-title {1811 font-size: 1.7em;1812 line-height: 100%;1813 outline: medium none;1814 padding: 3px 7px;1815 margin: 10px auto 30px;1816 display: block;1817 }1818 1819 #wp-fullscreen-tagline {1820 color: #82878c;1821 font-size: 18px;1822 float: right;1823 padding: 4px 0 0;1824 }1825 1826 /* =Top bar1827 -------------------------------------------------------------- */1828 #fullscreen-topbar {1829 background: #f5f5f5;1830 border-bottom: 1px solid #dedede;1831 height: 45px;1832 position: fixed;1833 left: 0;1834 right: 0;1835 top: 0;1836 width: 100%;1837 z-index: 100020;1838 -webkit-transition: opacity 0.4s;1839 transition: opacity 0.4s;1840 }1841 1842 #wp-fullscreen-toolbar {1843 padding: 6px 10px 0;1844 clear: both;1845 max-width: 1100px;1846 margin: 0 auto;1847 }1848 1849 #wp-fullscreen-mode-bar,1850 #wp-fullscreen-button-bar,1851 #wp-fullscreen-close {1852 float: left;1853 }1854 1855 #wp-fullscreen-count,1856 #wp-fullscreen-tagline {1857 display: inline-block;1858 }1859 1860 #wp-fullscreen-button-bar {1861 margin-top: 2px;1862 }1863 1864 #wp-fullscreen-save {1865 float: right;1866 padding: 2px 0 0;1867 min-width: 95px;1868 }1869 1870 #wp-fullscreen-count,1871 #wp-fullscreen-close {1872 padding: 5px 0 0;1873 }1874 1875 #wp-fullscreen-central-toolbar {1876 margin: auto;1877 padding: 0;1878 min-width: 620px;1879 }1880 1881 #wp-fullscreen-buttons > div {1882 float: left;1883 }1884 1885 #wp-fullscreen-mode-bar {1886 padding: 3px 14px 0 0;1887 }1888 1889 #wp-fullscreen-buttons .hidden {1890 display: none;1891 }1892 1893 #wp-fullscreen-buttons .disabled {1894 opacity: 0.5;1895 }1896 1897 #wp-fullscreen-buttons .mce-btn button {1898 margin: 0;1899 outline: 0 none;1900 border: 0 none;1901 white-space: nowrap;1902 width: auto;1903 background: none;1904 color: #32373c;1905 cursor: pointer;1906 font-size: 18px;1907 line-height: 20px;1908 overflow: visible;1909 text-align: center;1910 -webkit-box-sizing: border-box;1911 -moz-box-sizing: border-box;1912 box-sizing: border-box;1913 }1914 1915 .wp-html-mode #wp-fullscreen-buttons div {1916 display: none;1917 }1918 1919 .wp-html-mode #wp-fullscreen-buttons div.wp-fullscreen-both {1920 display: block;1921 }1922 1923 #wp-fullscreen-save img {1924 vertical-align: middle;1925 }1926 1927 #wp-fullscreen-save span {1928 display: none;1929 margin: 5px 6px 0;1930 float: left;1931 }1932 1933 /* =Thickbox Adjustments1934 -------------------------------------------------------------- */1935 .wp-fullscreen-active #TB_overlay {1936 z-index: 100050;1937 }1938 1939 .wp-fullscreen-active #TB_window {1940 z-index: 100051;1941 }1942 1943 /* Colors */1944 .fullscreen-overlay {1945 background: #fff;1946 }1947 1948 /* =CSS 3 transitions1949 -------------------------------------------------------------- */1950 1951 .wp-fullscreen-active #fullscreen-topbar {1952 -webkit-transition-duration: 0.8s;1953 transition-duration: 0.8s;1954 opacity: 0;1955 filter: alpha(opacity=0);1956 }1957 1958 .wp-fullscreen-active #wp-fullscreen-statusbar {1959 height: 0;1960 }1961 1962 .wp-fullscreen-active.wp-dfw-show-ui #fullscreen-topbar {1963 -webkit-transition-duration: 0.4s;1964 transition-duration: 0.4s;1965 opacity: 1;1966 filter: alpha(opacity=100);1967 }1968 1969 .wp-fullscreen-active.wp-dfw-show-ui #wp-fullscreen-statusbar {1970 height: 29px;1971 background: #f8f8f8;1972 border-top: 1px solid #eee;1973 }1974 1975 .wp-fullscreen-active .wp-fullscreen-title,1976 .wp-fullscreen-active .wp-editor-container {1977 -webkit-transition-duration: 0.8s;1978 transition-duration: 0.8s;1979 border-color: transparent;1980 }1981 1982 .wp-fullscreen-active.wp-dfw-show-ui .wp-fullscreen-title,1983 .wp-fullscreen-active.wp-dfw-show-ui .wp-editor-container {1984 -webkit-transition-duration: 0.4s;1985 transition-duration: 0.4s;1986 border-color: #ccc;1987 }1988 1989 .fade-1000,1990 .fade-600,1991 .fade-400,1992 .fade-300 {1993 opacity: 0;1994 -webkit-transition-property: opacity;1995 transition-property: opacity;1996 }1997 1998 .fade-1000 {1999 -webkit-transition-duration: 1s;2000 transition-duration: 1s;2001 }2002 2003 .fade-600 {2004 -webkit-transition-duration: 0.6s;2005 transition-duration: 0.6s;2006 }2007 2008 .fade-400 {2009 -webkit-transition-duration: 0.4s;2010 transition-duration: 0.4s;2011 }2012 2013 .fade-300 {2014 -webkit-transition-duration: 0.3s;2015 transition-duration: 0.3s;2016 }2017 2018 .fade-trigger {2019 opacity: 1;2020 }2021 2022 /* DFW on touch screen devices */2023 .wp-dfw-touch #fullscreen-topbar {2024 position: absolute;2025 opacity: 1;2026 }2027 2028 .wp-dfw-touch .wp-fullscreen-wrap .wp-editor-container,2029 .wp-dfw-touch .wp-fullscreen-title {2030 max-width: 700px;2031 }2032 2033 .wp-fullscreen-active.wp-dfw-touch .wp-fullscreen-title,2034 .wp-fullscreen-active.wp-dfw-touch .wp-editor-container {2035 border-color: #ccc;2036 }2037 2038 .wp-dfw-touch #wp-fullscreen-statusbar {2039 height: 30px;2040 }2041 2042 @media screen and ( max-width: 782px ) {2043 #wp-fullscreen-close,2044 #wp-fullscreen-central-toolbar,2045 #wp-fullscreen-mode-bar,2046 #wp-fullscreen-button-bar,2047 #wp-fullscreen-save {2048 display: inline-block;2049 }2050 2051 #fullscreen-topbar {2052 height: 85px;2053 }2054 2055 #wp-fullscreen-central-toolbar {2056 width: auto !important;2057 min-width: 0;2058 }2059 2060 #wp-fullscreen-close {2061 line-height: 30px;2062 vertical-align: top;2063 padding: 0 12px;2064 }2065 2066 #wp-fullscreen-button-bar {2067 position: absolute;2068 top: 45px;2069 left: 0;2070 }2071 2072 .wp-fullscreen-wrap {2073 top: 95px;2074 }2075 2076 #wp-fullscreen-save {2077 position: absolute;2078 right: 10px;2079 }2080 }2081 2082 @media screen and ( max-width: 480px ) {2083 #wp_fs_help {2084 display: none;2085 }2086 2087 .wp-fullscreen-wrap .wp-editor-container,2088 .wp-fullscreen-title {2089 width: 480px !important;2090 }2091 2092 body.wp-fullscreen-active {2093 width: 480px;2094 overflow: auto;2095 }2096 2097 #fullscreen-topbar,2098 .wp-fullscreen-wrap {2099 width: 480px;2100 }2101 2102 #fullscreen-topbar {2103 position: absolute;2104 }2105 2106 #wp-fullscreen-status {2107 width: auto !important;2108 max-width: 100%;2109 padding: 0 10px;2110 }2111 1607 } 2112 1608 … … 2137 1633 (-webkit-min-device-pixel-ratio: 1.25), 2138 1634 (min-resolution: 120dpi) { 2139 .wp-media-buttons .add_media span.wp-media-buttons-icon, 2140 #wp-fullscreen-buttons #wp_fs_image span.mce_image { 1635 .wp-media-buttons .add_media span.wp-media-buttons-icon { 2141 1636 background: none; 2142 1637 } -
trunk/src/wp-includes/css/media-views.css
r32508 r32677 2043 2043 2044 2044 /* Drag & drop on the editor upload */ 2045 #wp-fullscreen-body .uploader-editor,2046 2045 .wp-editor-wrap .uploader-editor { 2047 2046 background: rgba( 150, 150, 150, 0.9 ); … … 2056 2055 } 2057 2056 2058 #wp-fullscreen-body .uploader-editor {2059 background: rgba( 0, 86, 132, 0.9 );2060 position: fixed;2061 z-index: 100050; /* above the editor toolbar */2062 }2063 2064 .wp-editor-wrap.wp-fullscreen-wrap .uploader-editor {2065 opacity: 0;2066 }2067 2068 #wp-fullscreen-body .uploader-editor-content,2069 2057 .wp-editor-wrap .uploader-editor-content { 2070 2058 border: 1px dashed #fff; … … 2076 2064 } 2077 2065 2078 #wp-fullscreen-body .uploader-editor .uploader-editor-title,2079 2066 .wp-editor-wrap .uploader-editor .uploader-editor-title { 2080 2067 position: absolute; … … 2098 2085 } 2099 2086 2100 #wp-fullscreen-body .uploader-editor .uploader-editor-title,2101 2087 .wp-editor-wrap .uploader-editor.droppable .uploader-editor-title { 2102 2088 display: block; -
trunk/src/wp-includes/js/media/views/uploader/editor.js
r31935 r32677 2 2 3 3 /** 4 * Creates a dropzone on WP editor instances (elements with .wp-editor-wrap 5 * or #wp-fullscreen-body)and relays drag'n'dropped files to a media workflow.4 * Creates a dropzone on WP editor instances (elements with .wp-editor-wrap) 5 * and relays drag'n'dropped files to a media workflow. 6 6 * 7 7 * wp.media.view.EditorUploader … … 110 110 111 111 View.prototype.render.apply( this, arguments ); 112 $( '.wp-editor-wrap , #wp-fullscreen-body' ).each( _.bind( this.attach, this ) );112 $( '.wp-editor-wrap' ).each( _.bind( this.attach, this ) ); 113 113 return this; 114 114 }, -
trunk/src/wp-includes/js/quicktags.js
r30573 r32677 282 282 } 283 283 } 284 }285 286 if ( use && use.indexOf(',fullscreen,') !== -1 ) {287 theButtons.fullscreen = new qt.FullscreenButton();288 html += theButtons.fullscreen.html(name + '_');289 284 } 290 285 … … 624 619 }; 625 620 626 qt.FullscreenButton = function() {627 qt.Button.call(this, 'fullscreen', quicktagsL10n.fullscreen, 'f', quicktagsL10n.toggleFullscreen);628 };629 qt.FullscreenButton.prototype = new qt.Button();630 qt.FullscreenButton.prototype.callback = function(e, c) {631 if ( ! c.id || typeof wp === 'undefined' || ! wp.editor || ! wp.editor.fullscreen ) {632 return;633 }634 635 wp.editor.fullscreen.on();636 };637 638 621 qt.DFWButton = function() { 639 622 qt.Button.call( this, 'dfw', '', 'f', quicktagsL10n.dfw ); -
trunk/src/wp-includes/js/tinymce/skins/wordpress/wp-content.css
r31822 r32677 70 70 -webkit-box-shadow: none !important; 71 71 box-shadow: none !important; 72 }73 74 /* DFW mode */75 html.wp-fullscreen,76 html.wp-fullscreen body#tinymce {77 width: auto;78 max-width: none;79 min-height: 0;80 overflow: hidden;81 color: #333;82 background: transparent;83 72 } 84 73 -
trunk/src/wp-includes/script-loader.php
r32676 r32677 95 95 'enterImageURL' => __( 'Enter the URL of the image' ), 96 96 'enterImageDescription' => __( 'Enter a description of the image' ), 97 'fullscreen' => __( 'fullscreen' ),98 'toggleFullscreen' => esc_attr__( 'Toggle fullscreen mode' ),99 97 'textdirection' => esc_attr__( 'text direction' ), 100 98 'toggleTextdirection' => esc_attr__( 'Toggle Editor Text Direction' ), … … 106 104 $scripts->add( 'editor', "/wp-admin/js/editor$suffix.js", array('utils','jquery'), false, 1 ); 107 105 108 $scripts->add( 'wp-fullscreen', "/wp-admin/js/wp-fullscreen$suffix.js", array('jquery'), false, 1 ); 106 // Back-compat for old DFW. To-do: remove at the end of 2016. 107 $scripts->add( 'wp-fullscreen-stub', "/wp-admin/js/wp-fullscreen-stub$suffix.js", array(), false, 1 ); 109 108 110 109 $scripts->add( 'wp-ajax-response', "/wp-includes/js/wp-ajax-response$suffix.js", array('jquery'), false, 1 );
Note: See TracChangeset
for help on using the changeset viewer.