Fix vendor asset loading, add initial newsletter data

This commit is contained in:
Tautvidas Sipavičius
2015-08-21 13:24:06 +03:00
parent 40507d2cad
commit c1d6f9ba44
22 changed files with 1147 additions and 129 deletions

View File

@@ -4,13 +4,12 @@
define('newsletter_editor/blocks/text', [
'newsletter_editor/App',
'backbone',
'backbone.supermodel',
'backbone.marionette',
'mailpoet',
'jquery',
//'tinymce',
//'jquery.tinymce',
], function(EditorApplication, Backbone, SuperModel, Marionette, MailPoet, jQuery, TinyMCE) {
], function(EditorApplication, Backbone, Marionette, MailPoet, jQuery, TinyMCE) {
EditorApplication.module("blocks.text", function(Module, App, Backbone, Marionette, $, _) {
"use strict";
@@ -51,43 +50,43 @@ define('newsletter_editor/blocks/text', [
attachTextEditor: function() {
var that = this;
if (!this.renderOptions.disableTextEditor) {
this.$('.mailpoet_content').tinymce({
inline: true,
//this.$('.mailpoet_content').tinymce({
//inline: true,
menubar: false,
toolbar1: "styleselect bold italic forecolor | link unlink",
toolbar2: "alignleft aligncenter alignright alignjustify | bullist numlist blockquote | code mailpoet_custom_fields",
//menubar: false,
//toolbar1: "styleselect bold italic forecolor | link unlink",
//toolbar2: "alignleft aligncenter alignright alignjustify | bullist numlist blockquote | code mailpoet_custom_fields",
//forced_root_block: 'p',
valid_elements: "p[class|style],span[class|style],a[href|class|title|target|style],h1[class|style],h2[class|style],h3[class|style],ol[class|style],ul[class|style],li[class|style],strong[class|style],em[class|style],strike,br,blockquote[class|style],table[class|style],tr[class|style],th[class|style],td[class|style]",
invalid_elements: "script",
style_formats: [
{title: 'Heading 1', block: 'h1'},
{title: 'Heading 2', block: 'h2'},
{title: 'Heading 3', block: 'h3'},
////forced_root_block: 'p',
//valid_elements: "p[class|style],span[class|style],a[href|class|title|target|style],h1[class|style],h2[class|style],h3[class|style],ol[class|style],ul[class|style],li[class|style],strong[class|style],em[class|style],strike,br,blockquote[class|style],table[class|style],tr[class|style],th[class|style],td[class|style]",
//invalid_elements: "script",
//style_formats: [
//{title: 'Heading 1', block: 'h1'},
//{title: 'Heading 2', block: 'h2'},
//{title: 'Heading 3', block: 'h3'},
{title: 'Paragraph', block: 'p'},
],
//{title: 'Paragraph', block: 'p'},
//],
plugins: "wplink code textcolor mailpoet_custom_fields",
//plugins: "wplink code textcolor mailpoet_custom_fields",
setup: function(editor) {
editor.on('change', function(e) {
that.model.set('text', editor.getContent());
});
//setup: function(editor) {
//editor.on('change', function(e) {
//that.model.set('text', editor.getContent());
//});
editor.on('focus', function(e) {
that.disableShowingTools();
});
//editor.on('focus', function(e) {
//that.disableShowingTools();
//});
editor.on('blur', function(e) {
that.enableShowingTools();
});
},
//editor.on('blur', function(e) {
//that.enableShowingTools();
//});
//},
mailpoet_custom_fields: App.getConfig().get('customFields').toJSON(),
mailpoet_custom_fields_window_title: App.getConfig().get('translations.customFieldsWindowTitle'),
});
//mailpoet_custom_fields: App.getConfig().get('customFields').toJSON(),
//mailpoet_custom_fields_window_title: App.getConfig().get('translations.customFieldsWindowTitle'),
//});
}
},
});