Ticket #27465: 27465.1.patch
File 27465.1.patch, 4.0 KB (added by , 11 years ago) |
---|
-
src/wp-admin/edit-form-advanced.php
475 475 476 476 <?php wp_editor( $post->post_content, 'content', array( 477 477 'dfw' => true, 478 'drag_drop_upload' => true, 478 479 'tabfocus_elements' => 'insert-media-button,save-post', 479 480 'editor_height' => 360, 480 481 'tinymce' => array( -
src/wp-includes/class-wp-editor.php
24 24 private static $has_quicktags = false; 25 25 private static $has_medialib = false; 26 26 private static $editor_buttons_css = true; 27 private static $drag_drop_upload = false; 27 28 28 29 private function __construct() {} 29 30 … … 38 39 * @type bool $media_buttons Whether to show the Add Media/other media buttons. 39 40 * @type string $default_editor When both TinyMCE and Quicktags are used, set which 40 41 * editor is shown on page load. Default empty. 42 * @type bool $drag_drop_upload Whether to enable drag & drop on the editor uploading. Default false. 43 * Requires the media modal. 41 44 * @type string $textarea_name Give the textarea a unique name here. Square brackets 42 45 * can be used here. Default $editor_id. 43 46 * @type int $textarea_rows Number rows in the editor textarea. Default 20. … … 63 66 'wpautop' => true, 64 67 'media_buttons' => true, 65 68 'default_editor' => '', 69 'drag_drop_upload' => false, 66 70 'textarea_name' => $editor_id, 67 71 'textarea_rows' => 20, 68 72 'tabindex' => '', … … 124 128 $switch_class = 'html-active'; 125 129 $toolbar = $buttons = $autocomplete = ''; 126 130 131 if ( $set['drag_drop_upload'] ) { 132 self::$drag_drop_upload = true; 133 } 134 127 135 if ( ! empty( $set['editor_height'] ) ) 128 136 $height = ' style="height: ' . $set['editor_height'] . 'px"'; 129 137 else … … 834 842 tinyMCEPreInit = { 835 843 baseURL: "<?php echo self::$baseurl; ?>", 836 844 suffix: "<?php echo $suffix; ?>", 845 <?php 846 847 if ( self::$drag_drop_upload ) { 848 echo 'dragDropUpload: true,'; 849 } 850 851 ?> 837 852 mceInit: <?php echo $mceInit; ?>, 838 853 qtInit: <?php echo $qtInit; ?>, 839 854 ref: <?php echo self::_parse_init( $ref ); ?>, -
src/wp-includes/js/media-views.js
3083 3083 3084 3084 this.initialized = false; 3085 3085 3086 // Bail if UA does not support drag'n'drop or File API.3087 if ( ! this.browserSupport() ) {3086 // Bail if not enabled or UA does not support drag'n'drop or File API. 3087 if ( ! window.tinyMCEPreInit || ! window.tinyMCEPreInit.dragDropUpload || ! this.browserSupport() ) { 3088 3088 return this; 3089 3089 } 3090 3090 -
src/wp-includes/js/tinymce/plugins/wordpress/plugin.js
310 310 window.jQuery( document ).triggerHandler( 'tinymce-editor-init', [editor] ); 311 311 } 312 312 313 dom.bind( doc, 'dragstart dragend dragover drop', function( event ) { 314 if ( typeof window.jQuery !== 'undefined' ) { 315 // Trigger the jQuery handlers. 316 window.jQuery( document ).triggerHandler( event.type ); 317 } 318 }); 313 if ( window.tinyMCEPreInit && window.tinyMCEPreInit.dragDropUpload ) { 314 dom.bind( doc, 'dragstart dragend dragover drop', function( event ) { 315 if ( typeof window.jQuery !== 'undefined' ) { 316 // Trigger the jQuery handlers. 317 window.jQuery( document ).triggerHandler( event.type ); 318 } 319 }); 320 } 319 321 }); 320 322 321 323 // Word count