| 1 |
/* global tinymce */ |
| 2 |
|
| 3 |
( function () { |
| 4 |
tinymce.PluginManager.add( 'beyondwords_player', function ( editor, url ) { |
| 5 |
editor.addCommand( 'beyondwords_insert_player', function () { |
| 6 |
const playerElement = |
| 7 |
'<div data-beyondwords-player="true" contenteditable="false"></div>\uFEFF'; |
| 8 |
|
| 9 |
editor.execCommand( 'mceInsertContent', false, playerElement ); |
| 10 |
} ); |
| 11 |
|
| 12 |
const image = url + '/tinymce-button.png'; |
| 13 |
|
| 14 |
editor.addButton( 'beyondwords_player', { |
| 15 |
title: 'Insert BeyondWords player', |
| 16 |
cmd: 'beyondwords_insert_player', |
| 17 |
image, |
| 18 |
} ); |
| 19 |
} ); |
| 20 |
} )(); |
| 21 |
|