Use mailpoet_shortcodes TinyMCE plugin as a module
This commit is contained in:
@@ -1 +0,0 @@
|
|||||||
../src/newsletter_editor/tinymce/mailpoet_shortcodes
|
|
@@ -7,6 +7,7 @@ import Marionette from 'backbone.marionette';
|
|||||||
import BehaviorsLookup from 'newsletter_editor/behaviors/BehaviorsLookup';
|
import BehaviorsLookup from 'newsletter_editor/behaviors/BehaviorsLookup';
|
||||||
import App from 'newsletter_editor/App';
|
import App from 'newsletter_editor/App';
|
||||||
import tinymce from 'tinymce/tinymce';
|
import tinymce from 'tinymce/tinymce';
|
||||||
|
import tinymceMailpoetShortcodes from 'newsletter_editor/tinymce/mailpoet_shortcodes.js';
|
||||||
|
|
||||||
// TinyMCE theme and plugins
|
// TinyMCE theme and plugins
|
||||||
import 'tinymce/themes/modern';
|
import 'tinymce/themes/modern';
|
||||||
@@ -44,7 +45,8 @@ BL.TextEditorBehavior = Marionette.Behavior.extend({
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$(this.options.selector).tinymce(this.options.configurationFilter({
|
tinymce.PluginManager.add('mailpoet_shortcodes', tinymceMailpoetShortcodes);
|
||||||
|
|
||||||
tinymce.init(this.options.configurationFilter({
|
tinymce.init(this.options.configurationFilter({
|
||||||
target: this.el.querySelector(this.options.selector),
|
target: this.el.querySelector(this.options.selector),
|
||||||
inline: true,
|
inline: true,
|
||||||
|
@@ -8,9 +8,8 @@
|
|||||||
* its placeholder into editor text.
|
* its placeholder into editor text.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* jshint unused:false */
|
|
||||||
/* global tinymce:true */
|
function tinyMceAdd(editor) {
|
||||||
tinymce.PluginManager.add('mailpoet_shortcodes', function tinyMceAdd(editor) {
|
|
||||||
var appendLabelAndClose = function appendLabelAndCLose(shortcode) {
|
var appendLabelAndClose = function appendLabelAndCLose(shortcode) {
|
||||||
editor.insertContent(shortcode);
|
editor.insertContent(shortcode);
|
||||||
editor.windowManager.close();
|
editor.windowManager.close();
|
||||||
@@ -56,4 +55,6 @@ tinymce.PluginManager.add('mailpoet_shortcodes', function tinyMceAdd(editor) {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
});
|
}
|
||||||
|
|
||||||
|
export default tinyMceAdd;
|
@@ -424,7 +424,6 @@
|
|||||||
|
|
||||||
<% block after_javascript %>
|
<% block after_javascript %>
|
||||||
<%= javascript(
|
<%= javascript(
|
||||||
'lib/mailpoet_shortcodes/plugin.js',
|
|
||||||
'lib/wplink/plugin.js',
|
'lib/wplink/plugin.js',
|
||||||
'newsletter_editor.js'
|
'newsletter_editor.js'
|
||||||
) %>
|
) %>
|
||||||
|
Reference in New Issue
Block a user