-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #118 from WordPress/tinymce-logger
Add logger to TinyMCE to test, learn and debug.
- Loading branch information
Showing
3 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// For testing, learning and debugging. Feel free to add. | ||
// See https://www.tinymce.com/docs/advanced/events/ | ||
window.tinymce.PluginManager.add( 'logger', function( editor ) { | ||
var types = { | ||
selectionChange: 'fires when the selection changes.', | ||
nodeChange: 'fires when the selection and the node changes. Use `event.element`.', | ||
beforePastePreProcess: 'gives raw paste content before processing.', | ||
pastePostProcess: 'gives paste content after processing. Use `event.node.innerHTML`.', | ||
beforeSetContent: 'fires before content is set in the editor. Can be used for manipulation.', | ||
setContent: 'fires after content is set in the editor.', | ||
beforeExecCommand: 'fires before commands are executed.', | ||
execCommand: 'fires after commands are executed.' | ||
}; | ||
|
||
window.tinymce.each( types, function( info, type ) { | ||
editor.on( type, function( event ) { | ||
console.log( type, info, event ); | ||
} ); | ||
} ); | ||
} ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters