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