Changeset 41067
- Timestamp:
- 07/18/2017 01:54:14 AM (7 years ago)
- Location:
- branches/4.8
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.8
-
branches/4.8/src/wp-admin/js/widgets/text-widgets.js
r41053 r41067 179 179 // Abort building if the textarea is gone, likely due to the widget having been deleted entirely. 180 180 if ( ! document.getElementById( id ) ) { 181 return; 182 } 183 184 // The user has disabled TinyMCE. 185 if ( typeof window.tinymce === 'undefined' ) { 186 wp.editor.initialize( id, { 187 quicktags: true 188 }); 189 181 190 return; 182 191 } -
branches/4.8/src/wp-includes/class-wp-editor.php
r41066 r41067 820 820 */ 821 821 public static function print_default_editor_scripts() { 822 $settings = self::default_settings(); 823 824 $settings['toolbar1'] = 'bold,italic,bullist,numlist,link'; 825 $settings['wpautop'] = false; 826 $settings['indent'] = true; 827 $settings['elementpath'] = false; 828 829 if ( is_rtl() ) { 830 $settings['directionality'] = 'rtl'; 831 } 832 833 // In production all plugins are loaded (they are in wp-editor.js.gz) 834 // but only these will be initialized by default. 835 $settings['plugins'] = implode( ',', array( 836 'charmap', 837 'colorpicker', 838 'hr', 839 'lists', 840 // 'media', 841 'paste', 842 'tabfocus', 843 'textcolor', 844 'fullscreen', 845 'wordpress', 846 'wpautoresize', 847 'wpeditimage', 848 'wpemoji', 849 'wpgallery', 850 'wplink', 851 // 'wpdialogs', 852 'wptextpattern', 853 // 'wpview', 854 ) ); 855 856 $settings = self::_parse_init( $settings ); 857 858 $suffix = SCRIPT_DEBUG ? '' : '.min'; 859 $baseurl = self::get_baseurl(); 822 $user_can_richedit = user_can_richedit(); 823 824 if ( $user_can_richedit ) { 825 $settings = self::default_settings(); 826 827 $settings['toolbar1'] = 'bold,italic,bullist,numlist,link'; 828 $settings['wpautop'] = false; 829 $settings['indent'] = true; 830 $settings['elementpath'] = false; 831 832 if ( is_rtl() ) { 833 $settings['directionality'] = 'rtl'; 834 } 835 836 // In production all plugins are loaded (they are in wp-editor.js.gz). 837 // The 'wpview', 'wpdialogs', and 'media' TinyMCE plugins are not initialized by default. 838 // Can be added from js by using the 'wp-before-tinymce-init' event. 839 $settings['plugins'] = implode( ',', array( 840 'charmap', 841 'colorpicker', 842 'hr', 843 'lists', 844 'paste', 845 'tabfocus', 846 'textcolor', 847 'fullscreen', 848 'wordpress', 849 'wpautoresize', 850 'wpeditimage', 851 'wpemoji', 852 'wpgallery', 853 'wplink', 854 'wptextpattern', 855 ) ); 856 857 $settings = self::_parse_init( $settings ); 858 } else { 859 $settings = '{}'; 860 } 860 861 861 862 ?> … … 872 873 }; 873 874 874 var tinyMCEPreInit = { 875 baseURL: "<?php echo $baseurl; ?>", 876 suffix: "<?php echo $suffix; ?>", 877 mceInit: {}, 878 qtInit: {}, 879 load_ext: function(url,lang){var sl=tinymce.ScriptLoader;sl.markDone(url+'/langs/'+lang+'.js');sl.markDone(url+'/langs/'+lang+'_dlg.js');} 880 }; 875 <?php 876 877 if ( $user_can_richedit ) { 878 $suffix = SCRIPT_DEBUG ? '' : '.min'; 879 $baseurl = self::get_baseurl(); 880 881 ?> 882 var tinyMCEPreInit = { 883 baseURL: "<?php echo $baseurl; ?>", 884 suffix: "<?php echo $suffix; ?>", 885 mceInit: {}, 886 qtInit: {}, 887 load_ext: function(url,lang){var sl=tinymce.ScriptLoader;sl.markDone(url+'/langs/'+lang+'.js');sl.markDone(url+'/langs/'+lang+'_dlg.js');} 888 }; 889 <?php 890 } 891 ?> 881 892 </script> 882 893 <?php 883 894 884 self::print_tinymce_scripts(); 895 if ( $user_can_richedit ) { 896 self::print_tinymce_scripts(); 897 } 885 898 886 899 /**
Note: See TracChangeset
for help on using the changeset viewer.