TinyMCE: then toggling the paste in plain text mode disable the warning message after the second time.
Fixes #28612. git-svn-id: https://develop.svn.wordpress.org/trunk@36807 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
bc41261ba4
commit
ecc0b97857
@ -566,8 +566,23 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) {
|
||||
wp.autosave.server.triggerSave();
|
||||
}
|
||||
} );
|
||||
|
||||
if ( window.getUserSetting( 'editor_plain_text_paste_warning' ) > 1 ) {
|
||||
editor.settings.paste_plaintext_inform = false;
|
||||
}
|
||||
} );
|
||||
|
||||
editor.on( 'PastePlainTextToggle', function( event ) {
|
||||
// Warn twice, then stop.
|
||||
if ( event.state === true ) {
|
||||
var times = parseInt( window.getUserSetting( 'editor_plain_text_paste_warning' ), 10 ) || 0;
|
||||
|
||||
if ( times < 2 ) {
|
||||
window.setUserSetting( 'editor_plain_text_paste_warning', ++times );
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Experimental: create a floating toolbar.
|
||||
* This functionality will change in the next releases. Not recommended for use by plugins.
|
||||
|
Loading…
Reference in New Issue
Block a user