Ticket #31441: 31441.16.patch
File 31441.16.patch, 1.1 KB (added by , 9 years ago) |
---|
-
src/wp-includes/js/tinymce/plugins/wptextpattern/plugin.js
1 /** 2 * WP Text Pattern plugin for TinyMCE 3 * 4 * @since 4.3.0 5 * 6 * This plugin can automatically format text patterns as you type. It includes two patterns: 7 * - unordered (`* ` and `- `) 8 * - ordered list (`1. ` and `1) `) 9 * 10 * If the transformation in unwanted, the user can undo the change by pressing backspace, 11 * using the undo shortcut, or the undo button in the toolbar. 12 */ 13 14 /* global tinymce */ 1 15 ( function( tinymce, setTimeout ) { 2 16 tinymce.PluginManager.add( 'wptextpattern', function( editor ) { 3 17 var $$ = editor.$, … … 4 18 patterns = [], 5 19 canUndo = false; 6 20 21 /** 22 * Add a pattern to format with a callback. 23 * 24 * @since 4.3.0 25 * 26 * @param {RegExp} regExp 27 * @param {Function} callback 28 */ 7 29 function add( regExp, callback ) { 8 30 patterns.push( { 9 31 regExp: regExp,