Make WordPress Core

Ticket #31441: 31441.15.patch

File 31441.15.patch, 1012 bytes (added by iseulde, 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 */
    17( function( tinymce, setTimeout ) {
    28        tinymce.PluginManager.add( 'wptextpattern', function( editor ) {
    39                var $$ = editor.$,
    410                        patterns = [],
    511                        canUndo = false;
    612
     13                /**
     14                 * Add a pattern to format with a callback.
     15                 *
     16                 * @param {RegExp}   regExp
     17                 * @param {Function} callback
     18                 */
    719                function add( regExp, callback ) {
    820                        patterns.push( {
    921                                regExp: regExp,