Changeset 2152249
- Timestamp:
- 09/06/2019 10:30:22 AM (7 years ago)
- Location:
- 2em/trunk
- Files:
-
- 5 added
- 3 edited
-
build (added)
-
build/index.deps.json (added)
-
build/index.js (added)
-
iw-2em.php (modified) (4 diffs)
-
readme.txt (modified) (3 diffs)
-
res/css (added)
-
res/css/index.css (added)
-
res/images/iw-2em.png (modified) (previous)
Legend:
- Unmodified
- Added
- Removed
-
2em/trunk/iw-2em.php
r1607079 r2152249 4 4 Plugin URI: https://wordpress.org/plugins/2em/ 5 5 Description: add "text-indent:2em" support to editor. 6 Version: 1. 0.16 Version: 1.1.0 7 7 Author: hewei 8 8 Author URI: http://blog.itfsw.com … … 28 28 */ 29 29 30 if ( is_admin()){30 if ( is_admin() ) { 31 31 32 32 /** … … 37 37 * @return mixed 38 38 */ 39 function iw_add_plugin($plugin_array) { 40 $plugin_array['iw_2em'] = plugins_url('res/js/iw-2em.js', __FILE__); 39 function iw_add_plugin( $plugin_array ) { 40 $plugin_array['iw_2em'] = plugins_url( 'res/js/iw-2em.js', __FILE__ ); 41 41 42 return $plugin_array; 42 43 } 43 add_filter('mce_external_plugins', 'iw_add_plugin'); 44 45 add_filter( 'mce_external_plugins', 'iw_add_plugin' ); 44 46 45 47 /** … … 50 52 * @return mixed 51 53 */ 52 function iw_register_buttons($buttons) { 53 array_push($buttons, 'separator', 'iw_2em'); 54 function iw_register_buttons( $buttons ) { 55 array_push( $buttons, 'separator', 'iw_2em' ); 56 54 57 return $buttons; 55 58 } 56 add_filter('mce_buttons', 'iw_register_buttons'); 59 60 add_filter( 'mce_buttons', 'iw_register_buttons' ); 61 62 63 /** 64 * Enqueue Gutenberg block assets for backend editor. 65 */ 66 function iw_2em_enqueue_block_editor_assets() { 67 // js 68 wp_enqueue_script( 'iw-2em-plugin-js', plugins_url( 'build/index.js', __FILE__ ), array( 'wp-block-library' ) ); 69 } 70 71 add_action( 'enqueue_block_editor_assets', 'iw_2em_enqueue_block_editor_assets' ); 57 72 } 73 74 /** 75 * 注册block 样式 76 */ 77 function iw_2em_enqueue_block_assets() { 78 wp_enqueue_style( 'iw-2em-plugin-css', plugins_url( 'res/css/index.css', __FILE__ )); 79 } 80 add_action( 'enqueue_block_assets', 'iw_2em_enqueue_block_assets' ); -
2em/trunk/readme.txt
r1607079 r2152249 1 1 === Plugin Name === 2 2 Contributors: He Wei 3 Donate link: http://blog.itfsw.com /4 Tags: tinymce, 2em, style, text-indent, 首行缩进3 Donate link: http://blog.itfsw.com 4 Tags: style, text-indent, 2em, 首行缩进, Gutenberg, tinymce 5 5 Requires at least: 3.5.0 6 Tested up to: 4.77 Stable tag: 1. 0.16 Tested up to: 5.2 7 Stable tag: 1.1.0 8 8 License: GPLv3 9 9 License URI: http://www.gnu.org/licenses/gpl-3.0.html 10 10 11 2em 主要是为官方编辑器增加首行缩进支持。11 首行缩进插件2em 主要是为官方编辑器增加首行缩进支持(text-indent:2em;)。 12 12 13 13 == Description == … … 16 16 17 17 Features: 18 1. 编辑器增加缩进按钮,点击切换缩进; 19 2. tab按键监听(tab增加,shift+tab缩减); 18 1. 经典编辑器(tinymce)支持 19 1.1. 编辑器增加缩进按钮,点击切换缩进; 20 1.2. tab按键监听(tab增加,shift+tab缩减); 21 2. 新版编辑器(Gutenberg)支持,选中或新增段落块 22 2.1. 右侧面板点击 区块=》式样=》首行缩进样式; 23 2.2. 直接点击工具栏首行缩进按钮; 20 24 21 25 == Installation == … … 33 37 * 增加编辑器的tab按键监听,tab增加,shift+tab缩减。 34 38 * 对文章常用块元素增加支持(DIV,P,H1,H2,H3,H4,H5,H6)。 39 40 = 1.1.0 = 41 * 增加对官方新编辑器(Gutenberg)的支持。 42 * 对段落块增加首行缩进样式(选中段落后右侧面板区块=》式样=》首行缩进),或者在段落块的操作栏上点击首行缩进按钮。
Note: See TracChangeset
for help on using the changeset viewer.