text: tinymce.PluginManager.add('fontawesome', function(editor, url) {
  	var openDialog = function () {
  		return editor.windowManager.openUrl({
  			title: 'Choose Icon',
  			url: '/admin/tinymce/plugins/fontawesome/url/icons.html',
  			onAction: function(instance, trigger) {
  				instance.sendMessage({
  					mceAction: "customInsertAndClose"
  				});
  			},
  			buttons: [
  				{
  					type: 'cancel',
  					text: 'Close'
  				},
  				{
  					type: 'custom',
  					text: 'Add',
  					primary: true
  				}
  			],
  			// onSubmit: function (api) {
  			// 	console.log(api)
  			// 	// var data = api.getData();
  			// 	var f = $('.f-w-button.btn-primary').data('name').trim();
  			//
  			// 	// Insert content when the window form is submitted
  			// 	editor.insertContent(`<span class="fa ${f}">&nbsp;</span>`);
  			// 	api.close();
  			// },
  		});
  	};
  
  	// Add a button that opens a window
  	editor.ui.registry.addButton('fontawesome', {
  		icon: 'new-tab',
  		// text: 'Embed',
  		// text: '<i class="fa fa-file-code-o" aria-hidden="true"></i>',
  		onAction: function () {
  			// Open window
  			openDialog();
  		}
  	});
  
  	editor.addCommand("iframeCommand", function(ui, value) {
  		editor.insertContent(
  				`<p><span class="${value}">&nbsp;</span>
  				<span>&nbsp;</span></p>`,
  				{paste: true, merge: false}
  		);
  	});
  
  	// Adds a menu item, which can then be included in any menu via the menu/menubar configuration
  	editor.ui.registry.addMenuItem('fontawesome', {
  		text: 'Fonts',
  		onAction: function() {
  			// Open window
  			openDialog();
  		}
  	});
  
  	return {
  		getMetadata: function () {
  			return  {
  				name: 'Fonts',
  			};
  		}
  	};
  });
  