WordPress.org

Make WordPress Core

Changeset 36807


Ignore:
Timestamp:
03/02/2016 10:09:51 PM (5 years ago)
Author:
azaozz
Message:

TinyMCE: then toggling the paste in plain text mode disable the warning message after the second time.

Fixes #28612.

File:
1 edited

Legend:

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

    r36762 r36807  
    567567            }
    568568        } );
     569
     570        if ( window.getUserSetting( 'editor_plain_text_paste_warning' ) > 1 ) {
     571            editor.settings.paste_plaintext_inform = false;
     572        }
    569573    } );
     574
     575    editor.on( 'PastePlainTextToggle', function( event ) {
     576        // Warn twice, then stop.
     577        if ( event.state === true ) {
     578            var times = parseInt( window.getUserSetting( 'editor_plain_text_paste_warning' ), 10 ) || 0;
     579
     580            if ( times < 2 ) {
     581                window.setUserSetting( 'editor_plain_text_paste_warning', ++times );
     582            }
     583        }
     584    });
    570585
    571586    /**
Note: See TracChangeset for help on using the changeset viewer.