Make WordPress Core

Changeset 32795


Ignore:
Timestamp:
06/16/2015 01:51:37 PM (10 years ago)
Author:
iseulde
Message:

TinyMCE: wptextpattern: Add blockquote and headings

As discussed in the editor meeting 9 June.
We should re-evaluate these additions towards the end of the release.

See #31441.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/tinymce/plugins/wptextpattern/plugin.js

    r32703 r32795  
    3838        add( /^1[.)]\s/, function() {
    3939            this.execCommand( 'InsertOrderedList' );
     40        } );
     41
     42        add( /^>\s/, function() {
     43            this.formatter.toggle( 'blockquote' );
     44        } );
     45
     46        add( /^(#{2,6})\s/, function() {
     47            this.formatter.toggle( 'h' + arguments[1].length );
    4048        } );
    4149
     
    8593
    8694            tinymce.each( patterns, function( pattern ) {
    87                 var replace = text.replace( pattern.regExp, '' );
     95                var args,
     96                    replace = text.replace( pattern.regExp, function() {
     97                        args = arguments;
     98                        return '';
     99                    } );
    88100
    89101                if ( text === replace ) {
     
    106118                    editor.selection.setCursorLocation( parent );
    107119
    108                     pattern.callback.apply( editor );
     120                    pattern.callback.apply( editor, args );
    109121                } );
    110122
Note: See TracChangeset for help on using the changeset viewer.