MailPoet Newsletters (New) - Version 3.0.0-rc.1.0.0

Version Description

  • 2017-08-01 =
  • Improved: MailPoet 3 is no longer in Beta!
  • Improved: blockquotes in posts are now displayed in emails; Thanks @newslines!
  • Improved: a bottom padding is added to every last element of a column, except if it's full width image;
  • Fixed: recommended sending limit values are properly updated when the sending method is modified;
  • Fixed: welcome newsletter listings page now loads faster; Thanks Luc!
  • Fixed: [newsletter:post_title] properly displays titles of custom post types; Thanks Adrian!
  • Fixed: post images are displayed in expected positions; Thanks Gary!
Download this release

Release Info

Developer wysija
Plugin Icon 128x128 MailPoet Newsletters (New)
Version 3.0.0-rc.1.0.0
Comparing to
See all releases

Code changes from version 3.0.0-beta.37.0.0 to 3.0.0-rc.1.0.0

Files changed (48) hide show
  1. assets/css/manifest.json +1 -1
  2. assets/css/{newsletter_editor.aace9f8f.css → newsletter_editor.6d7c53db.css} +0 -3
  3. assets/js/{admin.607dbf77.js → admin.54487ca1.js} +2 -2
  4. assets/js/{admin_vendor.ea8adfbb.js → admin_vendor.b4e04a53.js} +36 -45
  5. assets/js/{form_editor.81d8f2a0.js → form_editor.4ee01c41.js} +0 -0
  6. assets/js/lib/mailpoet_shortcodes/plugin.js +3 -3
  7. assets/js/{mailpoet.5fb06233.js → mailpoet.02188613.js} +2 -2
  8. assets/js/manifest.json +7 -7
  9. assets/js/{newsletter_editor.1d7ae8a6.js → newsletter_editor.8195eca1.js} +349 -349
  10. assets/js/{public.5a1e5874.js → public.0bba05b8.js} +1 -1
  11. assets/js/{vendor.25e2ce6a.js → vendor.e62e72d5.js} +1 -1
  12. lang/index.php +0 -3
  13. lang/mailpoet-de_DE.mo +0 -0
  14. lang/mailpoet-en_GB.mo +0 -0
  15. lang/mailpoet-es_ES.mo +0 -0
  16. lang/mailpoet-fa_IR.mo +0 -0
  17. lang/mailpoet-fr_FR.mo +0 -0
  18. lang/mailpoet-it_IT.mo +0 -0
  19. lang/mailpoet-ja.mo +0 -0
  20. lang/mailpoet-nl_NL.mo +0 -0
  21. lang/mailpoet-pl_PL.mo +0 -0
  22. lang/mailpoet-pt_BR.mo +0 -0
  23. lang/mailpoet-pt_PT.mo +0 -0
  24. lang/mailpoet-ru_RU.mo +0 -0
  25. lang/mailpoet.pot +53 -58
  26. lib/API/JSON/v1/Services.php +3 -3
  27. lib/Config/Migrator.php +58 -58
  28. lib/Config/ServicesChecker.php +3 -3
  29. lib/Cron/Workers/SendingQueue/Tasks/Newsletter.php +8 -1
  30. lib/Cron/Workers/SendingQueue/Tasks/Shortcodes.php +3 -2
  31. lib/Models/Newsletter.php +22 -31
  32. lib/Newsletter/Editor/PostContentManager.php +3 -2
  33. lib/Newsletter/Editor/StructureTransformer.php +6 -12
  34. lib/Newsletter/Renderer/Columns/Renderer.php +0 -5
  35. lib/Newsletter/Shortcodes/Categories/Newsletter.php +3 -1
  36. lib/Newsletter/Shortcodes/Shortcodes.php +8 -2
  37. lib/Services/Bridge.php +5 -30
  38. lib/Util/DOM.php +40 -0
  39. mailpoet.php +4 -4
  40. readme.txt +14 -5
  41. vendor/autoload.php +1 -1
  42. vendor/composer/ClassLoader.php +38 -8
  43. vendor/composer/autoload_classmap.php +1 -0
  44. vendor/composer/autoload_real.php +8 -8
  45. vendor/composer/autoload_static.php +6 -5
  46. vendor/composer/installed.json +13 -13
  47. views/settings/mta.html +19 -29
  48. views/update.html +2 -2
assets/css/manifest.json CHANGED
@@ -1,7 +1,7 @@
1
  {
2
  "admin.css": "admin.71690c62.css",
3
  "importExport.css": "importExport.b3745466.css",
4
- "newsletter_editor.css": "newsletter_editor.aace9f8f.css",
5
  "public.css": "public.cae357df.css",
6
  "rtl.css": "rtl.d41d8cd9.css"
7
  }
1
  {
2
  "admin.css": "admin.71690c62.css",
3
  "importExport.css": "importExport.b3745466.css",
4
+ "newsletter_editor.css": "newsletter_editor.6d7c53db.css",
5
  "public.css": "public.cae357df.css",
6
  "rtl.css": "rtl.d41d8cd9.css"
7
  }
assets/css/{newsletter_editor.aace9f8f.css → newsletter_editor.6d7c53db.css} RENAMED
@@ -1928,9 +1928,6 @@ input.mailpoet_option_offset_left_small {
1928
  .mailpoet_block.mailpoet_highlight > .mailpoet_block_highlight {
1929
  border: 1px dashed #0074a2;
1930
  }
1931
- .mailpoet_block:last-child {
1932
- margin-bottom: 0;
1933
- }
1934
  .mailpoet_content {
1935
  position: relative;
1936
  line-height: 1.6em;
1928
  .mailpoet_block.mailpoet_highlight > .mailpoet_block_highlight {
1929
  border: 1px dashed #0074a2;
1930
  }
 
 
 
1931
  .mailpoet_content {
1932
  position: relative;
1933
  line-height: 1.6em;
assets/js/{admin.607dbf77.js → admin.54487ca1.js} RENAMED
@@ -29962,7 +29962,7 @@ webpackJsonp([0],[
29962
  routes: {
29963
  '': 'sendingMethodGroup', // the default tab is currently mta, needs its own method
29964
  'mta(/:group)': 'sendingMethodGroup',
29965
- '(:tab)': 'tabs',
29966
  },
29967
  sendingMethodGroup: function(group) {
29968
  // display mta tab
@@ -33711,7 +33711,7 @@ webpackJsonp([0],[
33711
  /***/ function(module, exports, __webpack_require__) {
33712
 
33713
  var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function() {
33714
- !function(e,o,n){window.HSCW=o,window.HS=n,n.beacon=n.beacon||{};var t=n.beacon;t.userConfig={},t.readyQueue=[],t.config=function(e){this.userConfig=e},t.ready=function(e){this.readyQueue.push(e)},o.config={docs:{enabled:!0,baseUrl:"//mailpoet3.helpscoutdocs.com/"},contact:{enabled:!0,formId:"aa21ca80-a4f5-11e6-91aa-0a5fecc78a4d"}};var r=e.getElementsByTagName("script")[0],c=e.createElement("script");c.type="text/javascript",c.async=!0,c.src="https://djtflbt20bdde.cloudfront.net/",r.parentNode.insertBefore(c,r)}(document,window.HSCW||{},window.HS||{});
33715
  }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
33716
 
33717
 
29962
  routes: {
29963
  '': 'sendingMethodGroup', // the default tab is currently mta, needs its own method
29964
  'mta(/:group)': 'sendingMethodGroup',
29965
+ '(:tab)': 'tabs'
29966
  },
29967
  sendingMethodGroup: function(group) {
29968
  // display mta tab
33711
  /***/ function(module, exports, __webpack_require__) {
33712
 
33713
  var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function() {
33714
+ !function(e, o, n){window.HSCW=o, window.HS=n, n.beacon=n.beacon||{};var t=n.beacon;t.userConfig={}, t.readyQueue=[], t.config=function(e){this.userConfig=e}, t.ready=function(e){this.readyQueue.push(e)}, o.config={docs:{enabled:!0, baseUrl:"//mailpoet3.helpscoutdocs.com/"}, contact:{enabled:!0, formId:"aa21ca80-a4f5-11e6-91aa-0a5fecc78a4d"}};var r=e.getElementsByTagName("script")[0], c=e.createElement("script");c.type="text/javascript", c.async=!0, c.src="https://djtflbt20bdde.cloudfront.net/", r.parentNode.insertBefore(c, r)}(document, window.HSCW||{}, window.HS||{});
33715
  }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
33716
 
33717
 
assets/js/{admin_vendor.ea8adfbb.js → admin_vendor.b4e04a53.js} RENAMED
@@ -1235,45 +1235,43 @@ webpackJsonp([1],[
1235
  var warning = emptyFunction;
1236
 
1237
  if (process.env.NODE_ENV !== 'production') {
1238
- (function () {
1239
- var printWarning = function printWarning(format) {
1240
- for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
1241
- args[_key - 1] = arguments[_key];
1242
- }
1243
-
1244
- var argIndex = 0;
1245
- var message = 'Warning: ' + format.replace(/%s/g, function () {
1246
- return args[argIndex++];
1247
- });
1248
- if (typeof console !== 'undefined') {
1249
- console.error(message);
1250
- }
1251
- try {
1252
- // --- Welcome to debugging React ---
1253
- // This error was thrown as a convenience so that you can use this stack
1254
- // to find the callsite that caused this warning to fire.
1255
- throw new Error(message);
1256
- } catch (x) {}
1257
- };
1258
 
1259
- warning = function warning(condition, format) {
1260
- if (format === undefined) {
1261
- throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
1262
- }
 
 
 
 
 
 
 
 
 
 
1263
 
1264
- if (format.indexOf('Failed Composite propType: ') === 0) {
1265
- return; // Ignore CompositeComponent proptype check.
1266
- }
 
1267
 
1268
- if (!condition) {
1269
- for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
1270
- args[_key2 - 2] = arguments[_key2];
1271
- }
1272
 
1273
- printWarning.apply(undefined, [format].concat(args));
 
 
1274
  }
1275
- };
1276
- })();
 
 
1277
  }
1278
 
1279
  module.exports = warning;
@@ -18150,18 +18148,11 @@ webpackJsonp([1],[
18150
 
18151
  /**
18152
  * Copyright (c) 2013-present, Facebook, Inc.
 
18153
  *
18154
- * Licensed under the Apache License, Version 2.0 (the "License");
18155
- * you may not use this file except in compliance with the License.
18156
- * You may obtain a copy of the License at
18157
- *
18158
- * http://www.apache.org/licenses/LICENSE-2.0
18159
- *
18160
- * Unless required by applicable law or agreed to in writing, software
18161
- * distributed under the License is distributed on an "AS IS" BASIS,
18162
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18163
- * See the License for the specific language governing permissions and
18164
- * limitations under the License.
18165
  *
18166
  * @typechecks
18167
  */
1235
  var warning = emptyFunction;
1236
 
1237
  if (process.env.NODE_ENV !== 'production') {
1238
+ var printWarning = function printWarning(format) {
1239
+ for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
1240
+ args[_key - 1] = arguments[_key];
1241
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1242
 
1243
+ var argIndex = 0;
1244
+ var message = 'Warning: ' + format.replace(/%s/g, function () {
1245
+ return args[argIndex++];
1246
+ });
1247
+ if (typeof console !== 'undefined') {
1248
+ console.error(message);
1249
+ }
1250
+ try {
1251
+ // --- Welcome to debugging React ---
1252
+ // This error was thrown as a convenience so that you can use this stack
1253
+ // to find the callsite that caused this warning to fire.
1254
+ throw new Error(message);
1255
+ } catch (x) {}
1256
+ };
1257
 
1258
+ warning = function warning(condition, format) {
1259
+ if (format === undefined) {
1260
+ throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
1261
+ }
1262
 
1263
+ if (format.indexOf('Failed Composite propType: ') === 0) {
1264
+ return; // Ignore CompositeComponent proptype check.
1265
+ }
 
1266
 
1267
+ if (!condition) {
1268
+ for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
1269
+ args[_key2 - 2] = arguments[_key2];
1270
  }
1271
+
1272
+ printWarning.apply(undefined, [format].concat(args));
1273
+ }
1274
+ };
1275
  }
1276
 
1277
  module.exports = warning;
18148
 
18149
  /**
18150
  * Copyright (c) 2013-present, Facebook, Inc.
18151
+ * All rights reserved.
18152
  *
18153
+ * This source code is licensed under the BSD-style license found in the
18154
+ * LICENSE file in the root directory of this source tree. An additional grant
18155
+ * of patent rights can be found in the PATENTS file in the same directory.
 
 
 
 
 
 
 
 
18156
  *
18157
  * @typechecks
18158
  */
assets/js/{form_editor.81d8f2a0.js → form_editor.4ee01c41.js} RENAMED
File without changes
assets/js/lib/mailpoet_shortcodes/plugin.js CHANGED
@@ -31,7 +31,7 @@ tinymce.PluginManager.add('mailpoet_shortcodes', function(editor, url) {
31
  if (configShortcodes.hasOwnProperty(segment)) {
32
  shortcodes.push({
33
  type: 'label',
34
- text: segment,
35
  });
36
 
37
  for (var i = 0; i < configShortcodes[segment].length; i += 1) {
@@ -51,8 +51,8 @@ tinymce.PluginManager.add('mailpoet_shortcodes', function(editor, url) {
51
  autoScroll: true,
52
  title: editor.settings.mailpoet_shortcodes_window_title,
53
  body: shortcodes,
54
- buttons: [],
55
  });
56
- },
57
  });
58
  });
31
  if (configShortcodes.hasOwnProperty(segment)) {
32
  shortcodes.push({
33
  type: 'label',
34
+ text: segment
35
  });
36
 
37
  for (var i = 0; i < configShortcodes[segment].length; i += 1) {
51
  autoScroll: true,
52
  title: editor.settings.mailpoet_shortcodes_window_title,
53
  body: shortcodes,
54
+ buttons: []
55
  });
56
+ }
57
  });
58
  });
assets/js/{mailpoet.5fb06233.js → mailpoet.02188613.js} RENAMED
@@ -18988,7 +18988,7 @@ webpackJsonp([3],[
18988
  coerce_types = { 'true': !0, 'false': !1, 'null': null };
18989
 
18990
  // Iterate over all name=value pairs.
18991
- $.each( this.serializeArray(), function(j,v){
18992
  var key = v.name,
18993
  val = v.value,
18994
  cur = obj,
@@ -21596,7 +21596,7 @@ webpackJsonp([3],[
21596
  eventsCache.push({
21597
  name: name,
21598
  data: data,
21599
- forced: forced,
21600
  });
21601
  }
21602
 
18988
  coerce_types = { 'true': !0, 'false': !1, 'null': null };
18989
 
18990
  // Iterate over all name=value pairs.
18991
+ $.each( this.serializeArray(), function(j, v){
18992
  var key = v.name,
18993
  val = v.value,
18994
  cur = obj,
21596
  eventsCache.push({
21597
  name: name,
21598
  data: data,
21599
+ forced: forced
21600
  });
21601
  }
21602
 
assets/js/manifest.json CHANGED
@@ -1,10 +1,10 @@
1
  {
2
  "mp2migrator.js": "mp2migrator.f7fa3be5.js",
3
- "public.js": "public.5a1e5874.js",
4
- "admin.js": "admin.607dbf77.js",
5
- "admin_vendor.js": "admin_vendor.ea8adfbb.js",
6
- "form_editor.js": "form_editor.81d8f2a0.js",
7
- "mailpoet.js": "mailpoet.5fb06233.js",
8
- "newsletter_editor.js": "newsletter_editor.1d7ae8a6.js",
9
- "vendor.js": "vendor.25e2ce6a.js"
10
  }
1
  {
2
  "mp2migrator.js": "mp2migrator.f7fa3be5.js",
3
+ "public.js": "public.0bba05b8.js",
4
+ "admin.js": "admin.54487ca1.js",
5
+ "admin_vendor.js": "admin_vendor.b4e04a53.js",
6
+ "form_editor.js": "form_editor.4ee01c41.js",
7
+ "mailpoet.js": "mailpoet.02188613.js",
8
+ "newsletter_editor.js": "newsletter_editor.8195eca1.js",
9
+ "vendor.js": "vendor.e62e72d5.js"
10
  }
assets/js/{newsletter_editor.1d7ae8a6.js → newsletter_editor.8195eca1.js} RENAMED
@@ -27618,8 +27618,8 @@ webpackJsonp([4],{
27618
  contentRegion: '#mailpoet_editor_content',
27619
  sidebarRegion: '#mailpoet_editor_sidebar',
27620
  bottomRegion: '#mailpoet_editor_bottom',
27621
- headingRegion: '#mailpoet_editor_heading',
27622
- },
27623
  });
27624
 
27625
  var EditorApplication = Marionette.Application.extend({
@@ -27663,8 +27663,8 @@ webpackJsonp([4],{
27663
  blockDefaults: {},
27664
  sidepanelWidth: '331px',
27665
  validation: {},
27666
- urls: {},
27667
- },
27668
  });
27669
 
27670
  // Global and available styles for access in blocks and their settings
@@ -27707,7 +27707,7 @@ webpackJsonp([4],{
27707
  text: {
27708
  fontColor: '#000000',
27709
  fontFamily: 'Arial',
27710
- fontSize: '16px',
27711
  },
27712
  h1: {
27713
  fontColor: '#111111',
@@ -27717,33 +27717,33 @@ webpackJsonp([4],{
27717
  h2: {
27718
  fontColor: '#222222',
27719
  fontFamily: 'Tahoma',
27720
- fontSize: '32px',
27721
  },
27722
  h3: {
27723
  fontColor: '#333333',
27724
  fontFamily: 'Verdana',
27725
- fontSize: '24px',
27726
  },
27727
  link: {
27728
  fontColor: '#21759B',
27729
- textDecoration: 'underline',
27730
  },
27731
  wrapper: {
27732
- backgroundColor: '#ffffff',
27733
  },
27734
  body: {
27735
- backgroundColor: '#cccccc',
27736
- },
27737
  },
27738
  initialize: function() {
27739
  this.on('change', function() { App.getChannel().trigger('autoSave'); });
27740
- },
27741
  });
27742
 
27743
  Module.StylesView = Marionette.View.extend({
27744
  getTemplate: function() { return templates.styles; },
27745
  modelEvents: {
27746
- 'change': 'render',
27747
  },
27748
  serializeData: function() {
27749
  return this.model.toJSON();
@@ -27819,10 +27819,10 @@ webpackJsonp([4],{
27819
  defaults: {
27820
  name: '',
27821
  priority: 100,
27822
- widgetView: undefined,
27823
- },
27824
  }),
27825
- comparator: 'priority',
27826
  }))();
27827
  Module.registerWidget = function(widget) { return Module._contentWidgets.add(widget); };
27828
  Module.getWidgets = function() { return Module._contentWidgets; };
@@ -27833,10 +27833,10 @@ webpackJsonp([4],{
27833
  defaults: {
27834
  name: '',
27835
  priority: 100,
27836
- widgetView: undefined,
27837
- },
27838
  }),
27839
- comparator: 'priority',
27840
  }))();
27841
  Module.registerLayoutWidget = function(widget) { return Module._layoutWidgets.add(widget); };
27842
  Module.getLayoutWidgets = function() { return Module._layoutWidgets; };
@@ -27847,7 +27847,7 @@ webpackJsonp([4],{
27847
  contentRegion: '.mailpoet_content_region',
27848
  layoutRegion: '.mailpoet_layout_region',
27849
  stylesRegion: '.mailpoet_styles_region',
27850
- previewRegion: '.mailpoet_preview_region',
27851
  },
27852
  events: {
27853
  'click .mailpoet_sidebar_region h3, .mailpoet_sidebar_region .handlediv': function(event) {
@@ -27873,11 +27873,11 @@ webpackJsonp([4],{
27873
  easing: "easeIn",
27874
  complete: function() {
27875
  $targetRegion.removeClass('closed');
27876
- },
27877
  }
27878
  );
27879
  }
27880
- },
27881
  },
27882
  initialize: function(options) {
27883
  jQuery(window)
@@ -27893,7 +27893,7 @@ webpackJsonp([4],{
27893
  ));
27894
  this.showChildView('stylesRegion', new Module.SidebarStylesView({
27895
  model: App.getGlobalStyles(),
27896
- availableStyles: App.getAvailableStyles(),
27897
  }));
27898
  this.showChildView('previewRegion', new Module.SidebarPreviewView());
27899
  },
@@ -27916,13 +27916,13 @@ webpackJsonp([4],{
27916
  },
27917
  onDomRefresh: function() {
27918
  this.$el.parent().stick_in_parent({
27919
- offset_top: 32,
27920
  });
27921
  this.$el.parent().on('sticky_kit:stick', this.updateHorizontalScroll.bind(this));
27922
  this.$el.parent().on('sticky_kit:unstick', this.updateHorizontalScroll.bind(this));
27923
  this.$el.parent().on('sticky_kit:bottom', this.updateHorizontalScroll.bind(this));
27924
  this.$el.parent().on('sticky_kit:unbottom', this.updateHorizontalScroll.bind(this));
27925
- },
27926
  });
27927
 
27928
  /**
@@ -27956,7 +27956,7 @@ webpackJsonp([4],{
27956
  * Responsible for rendering draggable layout widgets
27957
  */
27958
  Module.SidebarLayoutWidgetsView = Module.SidebarWidgetsView.extend({
27959
- getTemplate: function() { return templates.sidebarLayout; },
27960
  });
27961
 
27962
  /**
@@ -27965,7 +27965,7 @@ webpackJsonp([4],{
27965
  Module.SidebarStylesView = Marionette.View.extend({
27966
  getTemplate: function() { return templates.sidebarStyles; },
27967
  behaviors: {
27968
- ColorPickerBehavior: {},
27969
  },
27970
  events: function() {
27971
  return {
@@ -28002,13 +28002,13 @@ webpackJsonp([4],{
28002
  this.model.set('link.textDecoration', (event.target.checked) ? event.target.value : 'none');
28003
  },
28004
  "change #mailpoet_newsletter_background_color": _.partial(this.changeColorField, 'wrapper.backgroundColor'),
28005
- "change #mailpoet_background_color": _.partial(this.changeColorField, 'body.backgroundColor'),
28006
  };
28007
  },
28008
  templateContext: function() {
28009
  return {
28010
  model: this.model.toJSON(),
28011
- availableStyles: this.availableStyles.toJSON(),
28012
  };
28013
  },
28014
  initialize: function(options) {
@@ -28023,14 +28023,14 @@ webpackJsonp([4],{
28023
  value = 'transparent';
28024
  }
28025
  this.model.set(field, value);
28026
- },
28027
  });
28028
 
28029
  Module.SidebarPreviewView = Marionette.View.extend({
28030
  getTemplate: function() { return templates.sidebarPreview; },
28031
  events: {
28032
  'click .mailpoet_show_preview': 'showPreview',
28033
- 'click #mailpoet_send_preview': 'sendPreview',
28034
  },
28035
  onBeforeDestroy: function() {
28036
  if (this.previewView) {
@@ -28052,7 +28052,7 @@ webpackJsonp([4],{
28052
  api_version: window.mailpoet_api_version,
28053
  endpoint: 'newsletters',
28054
  action: 'showPreview',
28055
- data: json,
28056
  }).always(function() {
28057
  MailPoet.Modal.loading(false);
28058
  }).done(function(response) {
@@ -28085,7 +28085,7 @@ webpackJsonp([4],{
28085
  var $emailField = this.$('#mailpoet_preview_to_email');
28086
  var data = {
28087
  subscriber: $emailField.val(),
28088
- id: App.getNewsletter().get('id'),
28089
  };
28090
 
28091
  if (data.subscriber.length <= 0) {
@@ -28093,7 +28093,7 @@ webpackJsonp([4],{
28093
  MailPoet.I18n.t('newsletterPreviewEmailMissing'),
28094
  {
28095
  positionAfter: $emailField,
28096
- scroll: true,
28097
  }
28098
  );
28099
  return false;
@@ -28122,7 +28122,7 @@ webpackJsonp([4],{
28122
  }
28123
  });
28124
  });
28125
- },
28126
  });
28127
 
28128
  Module.NewsletterPreviewView = Marionette.View.extend({
@@ -28136,7 +28136,7 @@ webpackJsonp([4],{
28136
  return {
28137
  previewUrl: this.previewUrl,
28138
  width: this.width,
28139
- height: this.height,
28140
  };
28141
  }
28142
  });
@@ -28195,7 +28195,7 @@ webpackJsonp([4],{
28195
  // Use only whitelisted properties to ensure properties editor
28196
  // doesn't control don't change.
28197
  return _.pick(SuperModel.prototype.toJSON.call(this), this.whitelisted);
28198
- },
28199
  });
28200
 
28201
  // Content block view and model handlers for different content types
@@ -28221,13 +28221,13 @@ webpackJsonp([4],{
28221
  Module.getBody = function() {
28222
  return {
28223
  content: App._contentContainer.toJSON(),
28224
- globalStyles: App.getGlobalStyles().toJSON(),
28225
  };
28226
  };
28227
 
28228
  Module.toJSON = function() {
28229
  return _.extend({
28230
- body: Module.getBody(),
28231
  }, App.getNewsletter().toJSON());
28232
  };
28233
 
@@ -28267,7 +28267,7 @@ webpackJsonp([4],{
28267
  App._contentContainer = new (App.getBlockTypeModel('container'))(content, {parse: true});
28268
  App._contentContainerView = new (App.getBlockTypeView('container'))({
28269
  model: App._contentContainer,
28270
- renderOptions: { depth: 0 },
28271
  });
28272
 
28273
  App._appView.showChildView('contentRegion', App._contentContainerView);
@@ -28299,18 +28299,18 @@ webpackJsonp([4],{
28299
  getTemplate: function() { return templates.heading; },
28300
  templateContext: function() {
28301
  return {
28302
- model: this.model.toJSON(),
28303
  };
28304
  },
28305
  events: function() {
28306
  return {
28307
  'keyup .mailpoet_input_title': _.partial(this.changeField, "subject"),
28308
- 'keyup .mailpoet_input_preheader': _.partial(this.changeField, "preheader"),
28309
  };
28310
  },
28311
  changeField: function(field, event) {
28312
  this.model.set(field, jQuery(event.target).val());
28313
- },
28314
  });
28315
 
28316
  App.on('start', function(App, options) {
@@ -28377,7 +28377,7 @@ webpackJsonp([4],{
28377
  MailPoet.Notice.error(
28378
  MailPoet.I18n.t('templateSaveFailed'),
28379
  {
28380
- scroll: true,
28381
  }
28382
  );
28383
  } else {
@@ -28433,7 +28433,7 @@ webpackJsonp([4],{
28433
  promise.then(function(thumbnail) {
28434
  var data = _.extend(options || {}, {
28435
  thumbnail: thumbnail.toDataURL('image/jpeg'),
28436
- body: JSON.stringify(App.getBody()),
28437
  });
28438
 
28439
  return MailPoet.Ajax.post({
@@ -28460,7 +28460,7 @@ webpackJsonp([4],{
28460
  ).then(function(thumbnail) {
28461
  var data = _.extend(options || {}, {
28462
  thumbnail: thumbnail.toDataURL('image/jpeg'),
28463
- body: App.getBody(),
28464
  });
28465
  var blob = new Blob(
28466
  [JSON.stringify(data)],
@@ -28482,7 +28482,7 @@ webpackJsonp([4],{
28482
  'click .mailpoet_save_as_template': 'saveAsTemplate',
28483
  /* Export template */
28484
  'click .mailpoet_save_export': 'toggleExportTemplate',
28485
- 'click .mailpoet_export_template': 'exportTemplate',
28486
  },
28487
  initialize: function(options) {
28488
  App.getChannel().on('beforeEditorSave', this.beforeSave, this);
@@ -28530,7 +28530,7 @@ webpackJsonp([4],{
28530
  MailPoet.I18n.t('templateNameMissing'),
28531
  {
28532
  positionAfter: that.$el,
28533
- scroll: true,
28534
  }
28535
  );
28536
  } else if (templateDescription === '') {
@@ -28538,19 +28538,19 @@ webpackJsonp([4],{
28538
  MailPoet.I18n.t('templateDescriptionMissing'),
28539
  {
28540
  positionAfter: that.$el,
28541
- scroll: true,
28542
  }
28543
  );
28544
  } else {
28545
  Module.saveTemplate({
28546
  name: templateName,
28547
- description: templateDescription,
28548
  }).done(function() {
28549
  MailPoet.Notice.success(
28550
  MailPoet.I18n.t('templateSaved'),
28551
  {
28552
  positionAfter: that.$el,
28553
- scroll: true,
28554
  }
28555
  );
28556
  }).fail(function() {
@@ -28558,7 +28558,7 @@ webpackJsonp([4],{
28558
  MailPoet.I18n.t('templateSaveFailed'),
28559
  {
28560
  positionAfter: that.$el,
28561
- scroll: true,
28562
  }
28563
  );
28564
  });
@@ -28583,7 +28583,7 @@ webpackJsonp([4],{
28583
  MailPoet.I18n.t('templateNameMissing'),
28584
  {
28585
  positionAfter: that.$el,
28586
- scroll: true,
28587
  }
28588
  );
28589
  } else if (templateDescription === '') {
@@ -28591,13 +28591,13 @@ webpackJsonp([4],{
28591
  MailPoet.I18n.t('templateDescriptionMissing'),
28592
  {
28593
  positionAfter: that.$el,
28594
- scroll: true,
28595
  }
28596
  );
28597
  } else {
28598
  Module.exportTemplate({
28599
  name: templateName,
28600
- description: templateDescription,
28601
  });
28602
  this.hideExportTemplate();
28603
  }
@@ -28639,7 +28639,7 @@ webpackJsonp([4],{
28639
  hideValidationError: function() {
28640
  this.$('.mailpoet_save_error').addClass('mailpoet_hidden');
28641
  this.$('.mailpoet_save_next').removeClass('button-disabled');
28642
- },
28643
  });
28644
 
28645
  Module.autoSave = function() {
@@ -33290,7 +33290,7 @@ webpackJsonp([4],{
33290
  chooseText: MailPoet.I18n.t('selectColor'),
33291
  cancelText: MailPoet.I18n.t('cancelColorSelection')
33292
  });
33293
- },
33294
  });
33295
  }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
33296
 
@@ -33317,7 +33317,7 @@ webpackJsonp([4],{
33317
 
33318
  BehaviorsLookup.ContainerDropZoneBehavior = Marionette.Behavior.extend({
33319
  defaults: {
33320
- columnLimit: 3,
33321
  },
33322
  onRender: function() {
33323
  var dragAndDropDisabled = _.isObject(this.view.options.renderOptions) && this.view.options.renderOptions.disableDragAndDrop === true;
@@ -33497,7 +33497,7 @@ webpackJsonp([4],{
33497
  if (view.model.get('orientation') === 'horizontal' && droppableModel.get('type') !== 'container') {
33498
  // Regular blocks always need to be inserted into columns - vertical containers
33499
  tempCollection = new (EditorApplication.getBlockTypeModel('container'))({
33500
- orientation: 'vertical',
33501
  });
33502
  tempCollection.get('blocks').add(droppableModel);
33503
  viewCollection.add(tempCollection, {at: index});
@@ -33512,7 +33512,7 @@ webpackJsonp([4],{
33512
  var tempModel = viewCollection.at(dropPosition.index);
33513
 
33514
  tempCollection = new (EditorApplication.getBlockTypeModel('container'))({
33515
- orientation: (view.model.get('orientation') === 'vertical') ? 'horizontal' : 'vertical',
33516
  });
33517
 
33518
  viewCollection.remove(tempModel);
@@ -33520,19 +33520,19 @@ webpackJsonp([4],{
33520
  if (tempCollection.get('orientation') === 'horizontal') {
33521
  if (dropPosition.position === 'before') {
33522
  tempCollection2 = new (EditorApplication.getBlockTypeModel('container'))({
33523
- orientation: 'vertical',
33524
  });
33525
  tempCollection2.get('blocks').add(droppableModel);
33526
  tempCollection.get('blocks').add(tempCollection2);
33527
  }
33528
  tempCollection2 = new (EditorApplication.getBlockTypeModel('container'))({
33529
- orientation: 'vertical',
33530
  });
33531
  tempCollection2.get('blocks').add(tempModel);
33532
  tempCollection.get('blocks').add(tempCollection2);
33533
  if (dropPosition.position === 'after') {
33534
  tempCollection2 = new (EditorApplication.getBlockTypeModel('container'))({
33535
- orientation: 'vertical',
33536
  });
33537
  tempCollection2.get('blocks').add(droppableModel);
33538
  tempCollection.get('blocks').add(tempCollection2);
@@ -33556,11 +33556,11 @@ webpackJsonp([4],{
33556
  event.draggable.onDrop({
33557
  dropBehavior: that,
33558
  droppedModel: droppableModel,
33559
- droppedView: droppedView,
33560
  });
33561
 
33562
  that.cleanup();
33563
- },
33564
  });
33565
  },
33566
  cleanup: function() {
@@ -33598,7 +33598,7 @@ webpackJsonp([4],{
33598
  return {
33599
  insertionType: 'normal',
33600
  index: 0,
33601
- position: 'inside',
33602
  };
33603
  }
33604
 
@@ -33649,7 +33649,7 @@ webpackJsonp([4],{
33649
  return {
33650
  insertionType: insertionType, // 'normal'|'special'
33651
  index: index,
33652
- position: position, // 'inside'|'before'|'after'
33653
  };
33654
  },
33655
  _computeNormalIndex: function(eventX, eventY) {
@@ -33679,13 +33679,13 @@ webpackJsonp([4],{
33679
  // First half of the element
33680
  return {
33681
  index: index,
33682
- position: 'before',
33683
  };
33684
  } else {
33685
  // Second half of the element
33686
  return {
33687
  index: index,
33688
- position: 'after',
33689
  };
33690
  }
33691
  },
@@ -33776,7 +33776,7 @@ webpackJsonp([4],{
33776
  },
33777
 
33778
  onDrop: function(model, view) {},
33779
- testAttachToInstance: function(model, view) { return true; },
33780
  },
33781
  onRender: function() {
33782
  var that = this,
@@ -33786,7 +33786,7 @@ webpackJsonp([4],{
33786
  if (!this.options.testAttachToInstance(this.view.model, this.view)) return;
33787
 
33788
  interactable = interact(this.$el.get(0), {
33789
- ignoreFrom: this.options.ignoreSelector,
33790
  }).draggable({
33791
  // allow dragging of multple elements at the same time
33792
  max: Infinity,
@@ -33859,7 +33859,7 @@ webpackJsonp([4],{
33859
  that.view.$el.removeClass('mailpoet_hidden');
33860
  }
33861
  }
33862
- },
33863
  })
33864
  .preventDefault('auto')
33865
  .styleCursor(false)
@@ -33885,7 +33885,7 @@ webpackJsonp([4],{
33885
  // Delegate to view's event handler
33886
  that.options.onDrop.apply(that, [options]);
33887
  };
33888
- },
33889
  });
33890
  }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
33891
 
@@ -33902,20 +33902,20 @@ webpackJsonp([4],{
33902
  */
33903
  !(__WEBPACK_AMD_DEFINE_ARRAY__ = [
33904
  __webpack_require__(493),
33905
- __webpack_require__(516),
33906
  ], __WEBPACK_AMD_DEFINE_RESULT__ = function(Marionette, BehaviorsLookup) {
33907
 
33908
  BehaviorsLookup.HighlightEditingBehavior = Marionette.Behavior.extend({
33909
  modelEvents: {
33910
  'startEditing': 'enableHighlight',
33911
- 'stopEditing': 'disableHighlight',
33912
  },
33913
  enableHighlight: function() {
33914
  this.$el.addClass('mailpoet_highlight');
33915
  },
33916
  disableHighlight: function() {
33917
  this.$el.removeClass('mailpoet_highlight');
33918
- },
33919
  });
33920
  }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
33921
 
@@ -33942,11 +33942,11 @@ webpackJsonp([4],{
33942
  resizeHandleSelector: true, // true will use edges of the element itself
33943
  transformationFunction: function(y) { return y; },
33944
  minLength: 0,
33945
- modelField: 'styles.block.height',
33946
  },
33947
  events: {
33948
  "mouseenter": 'showResizeHandle',
33949
- "mouseleave": 'hideResizeHandle',
33950
  },
33951
  onRender: function() {
33952
  this.attachResize();
@@ -33964,8 +33964,8 @@ webpackJsonp([4],{
33964
  top: false,
33965
  left: false,
33966
  right: false,
33967
- bottom: (typeof this.options.resizeHandleSelector === 'string') ? this.view.$(this.options.resizeHandleSelector).get(0) : this.options.resizeHandleSelector,
33968
- },
33969
  }).on('resizestart', function(event) {
33970
  that.isBeingResized = true;
33971
  that.$el.addClass('mailpoet_resize_active');
@@ -33990,7 +33990,7 @@ webpackJsonp([4],{
33990
  if (typeof this.options.resizeHandleSelector === 'string') {
33991
  this.view.$(this.options.resizeHandleSelector).addClass('mailpoet_hidden');
33992
  }
33993
- },
33994
  });
33995
  }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
33996
 
@@ -34034,7 +34034,7 @@ webpackJsonp([4],{
34034
  collection.remove(model);
34035
  collection.add(model, { at: newIndex });
34036
  },
34037
- items: this.options.items,
34038
  });
34039
  }
34040
  }
@@ -34055,15 +34055,15 @@ webpackJsonp([4],{
34055
  !(__WEBPACK_AMD_DEFINE_ARRAY__ = [
34056
  __webpack_require__(493),
34057
  __webpack_require__(273),
34058
- __webpack_require__(516),
34059
  ], __WEBPACK_AMD_DEFINE_RESULT__ = function(Marionette, jQuery, BehaviorsLookup) {
34060
 
34061
  BehaviorsLookup.ShowSettingsBehavior = Marionette.Behavior.extend({
34062
  defaults: {
34063
- ignoreFrom: '', // selector
34064
  },
34065
  events: {
34066
- 'click .mailpoet_content': 'showSettings',
34067
  },
34068
  showSettings: function(event) {
34069
  if(!this.isIgnoredElement(event.target)) {
@@ -34074,7 +34074,7 @@ webpackJsonp([4],{
34074
  return this.options.ignoreFrom
34075
  && this.options.ignoreFrom.length > 0
34076
  && jQuery(element).is(this.options.ignoreFrom);
34077
- },
34078
  });
34079
  }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
34080
 
@@ -34105,7 +34105,7 @@ webpackJsonp([4],{
34105
  invalidElements: "script",
34106
  blockFormats: 'Paragraph=p',
34107
  plugins: "link textcolor colorpicker mailpoet_shortcodes",
34108
- configurationFilter: function(originalConfig) { return originalConfig; },
34109
  },
34110
  onDomRefresh: function() {
34111
  var that = this;
@@ -34163,7 +34163,7 @@ webpackJsonp([4],{
34163
  editor.on('blur', function(e) {
34164
  that.view.triggerMethod('text:editor:blur');
34165
  });
34166
- },
34167
  }));
34168
  }
34169
  });
@@ -34219,21 +34219,21 @@ webpackJsonp([4],{
34219
  },
34220
  getChildren: function() {
34221
  return [];
34222
- },
34223
  });
34224
 
34225
  Module.BlockView = AugmentedView.extend({
34226
  regions: {
34227
- toolsRegion: '> .mailpoet_tools',
34228
  },
34229
  modelEvents: {
34230
  'change': 'render',
34231
  'delete': 'deleteBlock',
34232
- 'duplicate': 'duplicateBlock',
34233
  },
34234
  events: {
34235
  "mouseenter": "showTools",
34236
- "mouseleave": "hideTools",
34237
  },
34238
  behaviors: {
34239
  DraggableBehavior: {
@@ -34256,14 +34256,14 @@ webpackJsonp([4],{
34256
  WidgetView.destroy();
34257
  return node;
34258
  }
34259
- },
34260
  },
34261
- HighlightEditingBehavior: {},
34262
  },
34263
  templateContext: function() {
34264
  return {
34265
  model: this.model.toJSON(),
34266
- viewCid: this.cid,
34267
  };
34268
  },
34269
  constructor: function() {
@@ -34339,19 +34339,19 @@ webpackJsonp([4],{
34339
  easing: easing,
34340
  complete: function() {
34341
  promise.resolve();
34342
- }.bind(this),
34343
  }
34344
  ).velocity(
34345
  fadeDirection,
34346
  {
34347
  duration: 250,
34348
  easing: easing,
34349
- queue: false, // Do not enqueue, trigger animation in parallel
34350
  }
34351
  );
34352
 
34353
  return promise;
34354
- },
34355
  });
34356
 
34357
  Module.BlockToolsView = AugmentedView.extend({
@@ -34361,14 +34361,14 @@ webpackJsonp([4],{
34361
  "click .mailpoet_delete_block_activate": "showDeletionConfirmation",
34362
  "click .mailpoet_delete_block_cancel": "hideDeletionConfirmation",
34363
  "click .mailpoet_delete_block_confirm": "deleteBlock",
34364
- "click .mailpoet_duplicate_block": "duplicateBlock",
34365
  },
34366
  // Markers of whether these particular tools will be used for this instance
34367
  tools: {
34368
  settings: true,
34369
  delete: true,
34370
  duplicate: true,
34371
- move: true,
34372
  },
34373
  getSettingsView: function() { return Module.BlockSettingsView; },
34374
  initialize: function(options) {
@@ -34386,7 +34386,7 @@ webpackJsonp([4],{
34386
  return {
34387
  model: this.model.toJSON(),
34388
  viewCid: this.cid,
34389
- tools: this.tools,
34390
  };
34391
  },
34392
  changeSettings: function(options) {
@@ -34408,13 +34408,13 @@ webpackJsonp([4],{
34408
  event.preventDefault();
34409
  this.model.trigger('duplicate');
34410
  return false;
34411
- },
34412
  });
34413
 
34414
  Module.BlockSettingsView = Marionette.View.extend({
34415
  className: 'mailpoet_editor_settings',
34416
  behaviors: {
34417
- ColorPickerBehavior: {},
34418
  },
34419
  initialize: function(params) {
34420
  this.model.trigger('startEditing');
@@ -34425,7 +34425,7 @@ webpackJsonp([4],{
34425
  width: App.getConfig().get('sidepanelWidth'),
34426
  onCancel: function() {
34427
  this.destroy();
34428
- }.bind(this),
34429
  };
34430
  this.renderOptions = params.renderOptions || {};
34431
  if (this.renderOptions.displayFormat === 'subpanel') {
@@ -34467,7 +34467,7 @@ webpackJsonp([4],{
34467
  onBeforeDestroy: function() {
34468
  MailPoet.Modal.close();
34469
  this.model.trigger('stopEditing');
34470
- },
34471
  });
34472
 
34473
  Module.WidgetView = Marionette.View.extend({
@@ -34478,7 +34478,7 @@ webpackJsonp([4],{
34478
  throw "Unsupported operation";
34479
  }
34480
  }
34481
- },
34482
  });
34483
 
34484
  return Module;
@@ -34522,12 +34522,12 @@ webpackJsonp([4],{
34522
  // TODO: If type has no registered model, use a backup one
34523
  return new Type(block, {parse: true});
34524
  });
34525
- },
34526
  });
34527
 
34528
  Module.ContainerBlockModel = base.BlockModel.extend({
34529
  relations: {
34530
- blocks: BlockCollection,
34531
  },
34532
  defaults: function() {
34533
  return this._getDefaults({
@@ -34535,10 +34535,10 @@ webpackJsonp([4],{
34535
  orientation: 'vertical',
34536
  styles: {
34537
  block: {
34538
- backgroundColor: 'transparent',
34539
- },
34540
  },
34541
- blocks: new BlockCollection(),
34542
  }, App.getConfig().get('blockDefaults.container'));
34543
  },
34544
  validate: function() {
@@ -34552,7 +34552,7 @@ webpackJsonp([4],{
34552
  // If container has any blocks - add them to a collection
34553
  if (response.type === 'container' && _.has(response, 'blocks')) {
34554
  response.blocks = new BlockCollection(response.blocks, {
34555
- parse: true,
34556
  });
34557
  }
34558
  return response;
@@ -34563,7 +34563,7 @@ webpackJsonp([4],{
34563
  });
34564
 
34565
  return _.flatten(models);
34566
- },
34567
  });
34568
 
34569
  Module.ContainerBlocksView = Marionette.CollectionView.extend({
@@ -34592,12 +34592,12 @@ webpackJsonp([4],{
34592
  blocks: {
34593
  el: '> .mailpoet_container',
34594
  replaceElement: true
34595
- },
34596
  }),
34597
  className: 'mailpoet_block mailpoet_container_block mailpoet_droppable_block mailpoet_droppable_layout_block',
34598
  getTemplate: function() { return templates.containerBlock; },
34599
  events: _.extend({}, base.BlockView.prototype.events, {
34600
- "click .mailpoet_newsletter_layer_selector": "toggleEditingLayer",
34601
  }),
34602
  ui: {
34603
  tools: '> .mailpoet_tools'
@@ -34629,8 +34629,8 @@ webpackJsonp([4],{
34629
  // Attach Draggable only to layout containers and disable it
34630
  // for root and column containers.
34631
  return view.renderOptions.depth === 1;
34632
- },
34633
- },
34634
  }),
34635
  onDragSubstituteBy: function() {
34636
  // For two and three column layouts display their respective widgets,
@@ -34655,8 +34655,8 @@ webpackJsonp([4],{
34655
  delete: this.renderOptions.depth === 1,
34656
  duplicate: true,
34657
  move: this.renderOptions.depth === 1,
34658
- layerSelector: false,
34659
- },
34660
  });
34661
  this.showChildView('toolsRegion', this.toolsView);
34662
  this.showChildView('blocks', new Module.ContainerBlocksView({
@@ -34705,7 +34705,7 @@ webpackJsonp([4],{
34705
  enableContainerLayer();
34706
  }
34707
  event.stopPropagation();
34708
- },
34709
  });
34710
 
34711
  Module.ContainerBlockEmptyView = Marionette.View.extend({
@@ -34716,13 +34716,13 @@ webpackJsonp([4],{
34716
  templateContext: function() {
34717
  return {
34718
  isRoot: this.renderOptions.depth === 0,
34719
- emptyContainerMessage: this.renderOptions.emptyContainerMessage || '',
34720
  };
34721
- },
34722
  });
34723
 
34724
  Module.ContainerBlockToolsView = base.BlockToolsView.extend({
34725
- getSettingsView: function() { return Module.ContainerBlockSettingsView; },
34726
  });
34727
 
34728
  Module.ContainerBlockSettingsView = base.BlockSettingsView.extend({
@@ -34730,31 +34730,31 @@ webpackJsonp([4],{
34730
  events: function() {
34731
  return {
34732
  "change .mailpoet_field_container_background_color": _.partial(this.changeColorField, "styles.block.backgroundColor"),
34733
- "click .mailpoet_done_editing": "close",
34734
  };
34735
  },
34736
  regions: {
34737
- columnsSettingsRegion: '.mailpoet_container_columns_settings',
34738
  },
34739
  initialize: function() {
34740
  base.BlockSettingsView.prototype.initialize.apply(this, arguments);
34741
 
34742
  this._columnsSettingsView = new (Module.ContainerBlockColumnsSettingsView)({
34743
- collection: this.model.get('blocks'),
34744
  });
34745
  },
34746
  onRender: function() {
34747
  this.showChildView('columnsSettingsRegion', this._columnsSettingsView);
34748
- },
34749
  });
34750
 
34751
  Module.ContainerBlockColumnsSettingsView = Marionette.CollectionView.extend({
34752
  childView: function() { return Module.ContainerBlockColumnSettingsView; },
34753
  childViewOptions: function(model, index) {
34754
  return {
34755
- columnIndex: index,
34756
  };
34757
- },
34758
  });
34759
 
34760
  Module.ContainerBlockColumnSettingsView = Marionette.View.extend({
@@ -34765,9 +34765,9 @@ webpackJsonp([4],{
34765
  templateContext: function() {
34766
  return {
34767
  model: this.model.toJSON(),
34768
- columnNumber: this.columnNumber,
34769
  };
34770
- },
34771
  });
34772
 
34773
  Module.OneColumnContainerWidgetView = base.WidgetView.extend({
@@ -34780,12 +34780,12 @@ webpackJsonp([4],{
34780
  return new Module.ContainerBlockModel({
34781
  orientation: 'horizontal',
34782
  blocks: [
34783
- new Module.ContainerBlockModel(),
34784
  ]
34785
  });
34786
  }
34787
  }
34788
- },
34789
  });
34790
 
34791
  Module.TwoColumnContainerWidgetView = base.WidgetView.extend({
@@ -34799,12 +34799,12 @@ webpackJsonp([4],{
34799
  orientation: 'horizontal',
34800
  blocks: [
34801
  new Module.ContainerBlockModel(),
34802
- new Module.ContainerBlockModel(),
34803
  ]
34804
  });
34805
  }
34806
  }
34807
- },
34808
  });
34809
 
34810
  Module.ThreeColumnContainerWidgetView = base.WidgetView.extend({
@@ -34819,36 +34819,36 @@ webpackJsonp([4],{
34819
  blocks: [
34820
  new Module.ContainerBlockModel(),
34821
  new Module.ContainerBlockModel(),
34822
- new Module.ContainerBlockModel(),
34823
  ]
34824
  });
34825
  }
34826
  }
34827
- },
34828
  });
34829
 
34830
  App.on('before:start', function(App, options) {
34831
  App.registerBlockType('container', {
34832
  blockModel: Module.ContainerBlockModel,
34833
- blockView: Module.ContainerBlockView,
34834
  });
34835
 
34836
  App.registerLayoutWidget({
34837
  name: 'oneColumnLayout',
34838
  priority: 100,
34839
- widgetView: Module.OneColumnContainerWidgetView,
34840
  });
34841
 
34842
  App.registerLayoutWidget({
34843
  name: 'twoColumnLayout',
34844
  priority: 100,
34845
- widgetView: Module.TwoColumnContainerWidgetView,
34846
  });
34847
 
34848
  App.registerLayoutWidget({
34849
  name: 'threeColumnLayout',
34850
  priority: 100,
34851
- widgetView: Module.ThreeColumnContainerWidgetView,
34852
  });
34853
  });
34854
 
@@ -34896,11 +34896,11 @@ webpackJsonp([4],{
34896
  fontFamily: 'Arial',
34897
  fontSize: '16px',
34898
  fontWeight: 'normal', // 'normal'|'bold'
34899
- textAlign: 'center',
34900
- },
34901
- },
34902
  }, App.getConfig().get('blockDefaults.button'));
34903
- },
34904
  });
34905
 
34906
  Module.ButtonBlockView = base.BlockView.extend({
@@ -34908,7 +34908,7 @@ webpackJsonp([4],{
34908
  getTemplate: function() { return templates.buttonBlock; },
34909
  onDragSubstituteBy: function() { return Module.ButtonWidgetView; },
34910
  behaviors: _.extend({}, base.BlockView.prototype.behaviors, {
34911
- ShowSettingsBehavior: {},
34912
  }),
34913
  initialize: function() {
34914
  base.BlockView.prototype.initialize.apply(this, arguments);
@@ -34920,11 +34920,11 @@ webpackJsonp([4],{
34920
  onRender: function() {
34921
  this.toolsView = new Module.ButtonBlockToolsView({ model: this.model });
34922
  this.showChildView('toolsRegion', this.toolsView);
34923
- },
34924
  });
34925
 
34926
  Module.ButtonBlockToolsView = base.BlockToolsView.extend({
34927
- getSettingsView: function() { return Module.ButtonBlockSettingsView; },
34928
  });
34929
 
34930
  Module.ButtonBlockSettingsView = base.BlockSettingsView.extend({
@@ -34958,13 +34958,13 @@ webpackJsonp([4],{
34958
  "input .mailpoet_field_button_line_height_input": _.partial(this.updateValueAndCall, '.mailpoet_field_button_line_height', _.partial(this.changePixelField, "styles.block.lineHeight").bind(this)),
34959
 
34960
  "click .mailpoet_field_button_replace_all_styles": "applyToAll",
34961
- "click .mailpoet_done_editing": "close",
34962
  };
34963
  },
34964
  templateContext: function() {
34965
  return _.extend({}, base.BlockView.prototype.templateContext.apply(this, arguments), {
34966
  availableStyles: App.getAvailableStyles().toJSON(),
34967
- renderOptions: this.renderOptions,
34968
  });
34969
  },
34970
  applyToAll: function() {
@@ -34990,21 +34990,21 @@ webpackJsonp([4],{
34990
  cloneOriginal: true,
34991
  drop: function() {
34992
  return new Module.ButtonBlockModel();
34993
- },
34994
  }
34995
- },
34996
  });
34997
 
34998
  App.on('before:start', function(App, options) {
34999
  App.registerBlockType('button', {
35000
  blockModel: Module.ButtonBlockModel,
35001
- blockView: Module.ButtonBlockView,
35002
  });
35003
 
35004
  App.registerWidget({
35005
  name: 'button',
35006
  widgetView: Module.ButtonWidgetView,
35007
- priority: 92,
35008
  });
35009
  });
35010
 
@@ -35044,11 +35044,11 @@ webpackJsonp([4],{
35044
  height: '64px',
35045
  styles: {
35046
  block: {
35047
- textAlign: 'center',
35048
- },
35049
- },
35050
  }, App.getConfig().get('blockDefaults.image'));
35051
- },
35052
  });
35053
 
35054
  Module.ImageBlockView = base.BlockView.extend({
@@ -35057,11 +35057,11 @@ webpackJsonp([4],{
35057
  onDragSubstituteBy: function() { return Module.ImageWidgetView; },
35058
  templateContext: function() {
35059
  return _.extend({
35060
- imageMissingSrc: App.getConfig().get('urls.imageMissing'),
35061
  }, base.BlockView.prototype.templateContext.apply(this));
35062
  },
35063
  behaviors: _.extend({}, base.BlockView.prototype.behaviors, {
35064
- ShowSettingsBehavior: {},
35065
  }),
35066
  onRender: function() {
35067
  this.toolsView = new Module.ImageBlockToolsView({ model: this.model });
@@ -35072,11 +35072,11 @@ webpackJsonp([4],{
35072
  } else {
35073
  this.$el.removeClass('mailpoet_full_image');
35074
  }
35075
- },
35076
  });
35077
 
35078
  Module.ImageBlockToolsView = base.BlockToolsView.extend({
35079
- getSettingsView: function() { return Module.ImageBlockSettingsView; },
35080
  });
35081
 
35082
  Module.ImageBlockSettingsView = base.BlockSettingsView.extend({
@@ -35089,7 +35089,7 @@ webpackJsonp([4],{
35089
  "change .mailpoet_field_image_full_width": _.partial(this.changeBoolCheckboxField, "fullWidth"),
35090
  "change .mailpoet_field_image_alignment": _.partial(this.changeField, "styles.block.textAlign"),
35091
  "click .mailpoet_field_image_select_another_image": "showMediaManager",
35092
- "click .mailpoet_done_editing": "close",
35093
  };
35094
  },
35095
  initialize: function(options) {
@@ -35160,7 +35160,7 @@ webpackJsonp([4],{
35160
  // Update user settings when users adjust the
35161
  // attachment display settings.
35162
  displayUserSettings: false
35163
- }),
35164
  ]);
35165
 
35166
  if(wp.media.view.settings.post.featuredImageId) {
@@ -35304,8 +35304,8 @@ webpackJsonp([4],{
35304
  },
35305
  displaySettings: false,
35306
  button: {
35307
- text: 'Select',
35308
- },
35309
  }),
35310
  that = this;
35311
 
@@ -35337,7 +35337,7 @@ webpackJsonp([4],{
35337
  height: mainSize.height + 'px',
35338
  width: mainSize.width + 'px',
35339
  src: mainSize.url,
35340
- alt: (attachment.get('alt') !== "" && attachment.get('alt') !== undefined) ? attachment.get('alt') : attachment.get('title'),
35341
  });
35342
  // Rerender settings view due to changes from outside of settings view
35343
  that.render();
@@ -35365,7 +35365,7 @@ webpackJsonp([4],{
35365
  if (typeof this._mediaManager === 'object') {
35366
  this._mediaManager.remove();
35367
  }
35368
- },
35369
  });
35370
 
35371
  ImageWidgetView = base.WidgetView.extend({
@@ -35378,22 +35378,22 @@ webpackJsonp([4],{
35378
  },
35379
  onDrop: function(options) {
35380
  options.droppedView.triggerMethod('showSettings', { showImageManager: true });
35381
- },
35382
  }
35383
- },
35384
  });
35385
  Module.ImageWidgetView = ImageWidgetView;
35386
 
35387
  App.on('before:start', function(App, options) {
35388
  App.registerBlockType('image', {
35389
  blockModel: Module.ImageBlockModel,
35390
- blockView: Module.ImageBlockView,
35391
  });
35392
 
35393
  App.registerWidget({
35394
  name: 'image',
35395
  widgetView: Module.ImageWidgetView,
35396
- priority: 91,
35397
  });
35398
  });
35399
 
@@ -35432,11 +35432,11 @@ webpackJsonp([4],{
35432
  padding: '12px',
35433
  borderStyle: 'solid',
35434
  borderWidth: '1px',
35435
- borderColor: '#000000',
35436
- },
35437
- },
35438
  }, App.getConfig().get('blockDefaults.divider'));
35439
- },
35440
  });
35441
 
35442
  Module.DividerBlockView = base.BlockView.extend({
@@ -35449,11 +35449,11 @@ webpackJsonp([4],{
35449
  resizeHandleSelector: '.mailpoet_resize_handle',
35450
  transformationFunction: function(y) { return y / 2; },
35451
  minLength: 0, // TODO: Move this number to editor configuration
35452
- modelField: 'styles.block.padding',
35453
  },
35454
  ShowSettingsBehavior: {
35455
  ignoreFrom: '.mailpoet_resize_handle'
35456
- },
35457
  }, base.BlockView.prototype.behaviors),
35458
  onDragSubstituteBy: function() { return Module.DividerWidgetView; },
35459
  initialize: function() {
@@ -35469,7 +35469,7 @@ webpackJsonp([4],{
35469
  },
35470
  templateContext: function() {
35471
  return _.extend({
35472
- totalHeight: parseInt(this.model.get('styles.block.padding'), 10)*2 + parseInt(this.model.get('styles.block.borderWidth')) + 'px',
35473
  }, base.BlockView.prototype.templateContext.apply(this));
35474
  },
35475
  onRender: function() {
@@ -35484,11 +35484,11 @@ webpackJsonp([4],{
35484
  this.$('.mailpoet_content').css('padding-top', this.model.get('styles.block.padding'));
35485
  this.$('.mailpoet_content').css('padding-bottom', this.model.get('styles.block.padding'));
35486
  this.$('.mailpoet_resize_handle_text').text(parseInt(this.model.get('styles.block.padding'), 10)*2 + parseInt(this.model.get('styles.block.borderWidth')) + 'px');
35487
- },
35488
  });
35489
 
35490
  Module.DividerBlockToolsView = base.BlockToolsView.extend({
35491
- getSettingsView: function() { return Module.DividerBlockSettingsView; },
35492
  });
35493
 
35494
  Module.DividerBlockSettingsView = base.BlockSettingsView.extend({
@@ -35504,18 +35504,18 @@ webpackJsonp([4],{
35504
  "change .mailpoet_field_divider_border_color": _.partial(this.changeColorField, "styles.block.borderColor"),
35505
  "change .mailpoet_field_divider_background_color": _.partial(this.changeColorField, "styles.block.backgroundColor"),
35506
  "click .mailpoet_button_divider_apply_to_all": "applyToAll",
35507
- "click .mailpoet_done_editing": "close",
35508
  };
35509
  },
35510
  modelEvents: function() {
35511
  return {
35512
- 'change:styles.block.borderColor': 'repaintDividerStyleOptions',
35513
  };
35514
  },
35515
  templateContext: function() {
35516
  return _.extend({}, base.BlockView.prototype.templateContext.apply(this, arguments), {
35517
  availableStyles: App.getAvailableStyles().toJSON(),
35518
- renderOptions: this.renderOptions,
35519
  });
35520
  },
35521
  changeStyle: function(event) {
@@ -35533,7 +35533,7 @@ webpackJsonp([4],{
35533
  updateValueAndCall: function(fieldToUpdate, callable, event) {
35534
  this.$(fieldToUpdate).val(jQuery(event.target).val());
35535
  callable(event);
35536
- },
35537
  });
35538
 
35539
  Module.DividerWidgetView = base.WidgetView.extend({
@@ -35543,20 +35543,20 @@ webpackJsonp([4],{
35543
  cloneOriginal: true,
35544
  drop: function() {
35545
  return new Module.DividerBlockModel();
35546
- },
35547
  }
35548
- },
35549
  });
35550
  App.on('before:start', function(App, options) {
35551
  App.registerBlockType('divider', {
35552
  blockModel: Module.DividerBlockModel,
35553
- blockView: Module.DividerBlockView,
35554
  });
35555
 
35556
  App.registerWidget({
35557
  name: 'divider',
35558
  widgetView: Module.DividerWidgetView,
35559
- priority: 93,
35560
  });
35561
  });
35562
 
@@ -35587,9 +35587,9 @@ webpackJsonp([4],{
35587
  defaults: function() {
35588
  return this._getDefaults({
35589
  type: 'text',
35590
- text: 'Edit this to insert text',
35591
  }, App.getConfig().get('blockDefaults.text'));
35592
- },
35593
  });
35594
 
35595
  Module.TextBlockView = base.BlockView.extend({
@@ -35607,16 +35607,16 @@ webpackJsonp([4],{
35607
  configurationFilter: function(originalSettings) {
35608
  return _.extend({}, originalSettings, {
35609
  mailpoet_shortcodes: App.getConfig().get('shortcodes').toJSON(),
35610
- mailpoet_shortcodes_window_title: MailPoet.I18n.t('shortcodesWindowTitle'),
35611
  });
35612
  }
35613
- },
35614
  }),
35615
  initialize: function(options) {
35616
  base.BlockView.prototype.initialize.apply(this, arguments);
35617
 
35618
  this.renderOptions = _.defaults(options.renderOptions || {}, {
35619
- disableTextEditor: false,
35620
  });
35621
 
35622
  this.disableTextEditor = this.renderOptions.disableTextEditor;
@@ -35626,8 +35626,8 @@ webpackJsonp([4],{
35626
  this.toolsView = new Module.TextBlockToolsView({
35627
  model: this.model,
35628
  tools: {
35629
- settings: false,
35630
- },
35631
  });
35632
  this.showChildView('toolsRegion', this.toolsView);
35633
  },
@@ -35641,15 +35641,15 @@ webpackJsonp([4],{
35641
  onTextEditorBlur: function() {
35642
  this.enableDragging();
35643
  this.enableShowingTools();
35644
- },
35645
  });
35646
 
35647
  Module.TextBlockToolsView = base.BlockToolsView.extend({
35648
- getSettingsView: function() { return Module.TextBlockSettingsView; },
35649
  });
35650
 
35651
  Module.TextBlockSettingsView = base.BlockSettingsView.extend({
35652
- getTemplate: function() { return templates.textBlockSettings; },
35653
  });
35654
 
35655
  Module.TextWidgetView = base.WidgetView.extend({
@@ -35659,21 +35659,21 @@ webpackJsonp([4],{
35659
  cloneOriginal: true,
35660
  drop: function() {
35661
  return new Module.TextBlockModel();
35662
- },
35663
  }
35664
- },
35665
  });
35666
 
35667
  App.on('before:start', function(App, options) {
35668
  App.registerBlockType('text', {
35669
  blockModel: Module.TextBlockModel,
35670
- blockView: Module.TextBlockView,
35671
  });
35672
 
35673
  App.registerWidget({
35674
  name: 'text',
35675
  widgetView: Module.TextWidgetView,
35676
- priority: 90,
35677
  });
35678
  });
35679
 
@@ -35708,11 +35708,11 @@ webpackJsonp([4],{
35708
  styles: {
35709
  block: {
35710
  backgroundColor: 'transparent',
35711
- height: '40px',
35712
- },
35713
- },
35714
  }, App.getConfig().get('blockDefaults.spacer'));
35715
- },
35716
  });
35717
 
35718
  Module.SpacerBlockView = base.BlockView.extend({
@@ -35723,11 +35723,11 @@ webpackJsonp([4],{
35723
  elementSelector: '.mailpoet_spacer',
35724
  resizeHandleSelector: '.mailpoet_resize_handle',
35725
  minLength: 20, // TODO: Move this number to editor configuration
35726
- modelField: 'styles.block.height',
35727
  },
35728
  ShowSettingsBehavior: {
35729
  ignoreFrom: '.mailpoet_resize_handle'
35730
- },
35731
  }, base.BlockView.prototype.behaviors),
35732
  modelEvents: _.omit(base.BlockView.prototype.modelEvents, 'change'),
35733
  onDragSubstituteBy: function() { return Module.SpacerWidgetView; },
@@ -35747,11 +35747,11 @@ webpackJsonp([4],{
35747
  },
35748
  onBeforeDestroy: function() {
35749
  this.stopListening(this.model);
35750
- },
35751
  });
35752
 
35753
  Module.SpacerBlockToolsView = base.BlockToolsView.extend({
35754
- getSettingsView: function() { return Module.SpacerBlockSettingsView; },
35755
  });
35756
 
35757
  Module.SpacerBlockSettingsView = base.BlockSettingsView.extend({
@@ -35759,9 +35759,9 @@ webpackJsonp([4],{
35759
  events: function() {
35760
  return {
35761
  "change .mailpoet_field_spacer_background_color": _.partial(this.changeColorField, "styles.block.backgroundColor"),
35762
- "click .mailpoet_done_editing": "close",
35763
  };
35764
- },
35765
  });
35766
 
35767
  Module.SpacerWidgetView = base.WidgetView.extend({
@@ -35771,21 +35771,21 @@ webpackJsonp([4],{
35771
  cloneOriginal: true,
35772
  drop: function() {
35773
  return new Module.SpacerBlockModel();
35774
- },
35775
  }
35776
- },
35777
  });
35778
 
35779
  App.on('before:start', function(App, options) {
35780
  App.registerBlockType('spacer', {
35781
  blockModel: Module.SpacerBlockModel,
35782
- blockView: Module.SpacerBlockView,
35783
  });
35784
 
35785
  App.registerWidget({
35786
  name: 'spacer',
35787
  widgetView: Module.SpacerWidgetView,
35788
- priority: 94,
35789
  });
35790
  });
35791
 
@@ -35819,38 +35819,38 @@ webpackJsonp([4],{
35819
  text: '<a href="[link:subscription_unsubscribe_url]">Unsubscribe</a> | <a href="[link:subscription_manage_url]">Manage subscription</a><br /><b>Add your postal address here!</b>',
35820
  styles: {
35821
  block: {
35822
- backgroundColor: 'transparent',
35823
  },
35824
  text: {
35825
  fontColor: '#000000',
35826
  fontFamily: 'Arial',
35827
  fontSize: '12px',
35828
- textAlign: 'center',
35829
  },
35830
  link: {
35831
  fontColor: '#0000ff',
35832
- textDecoration: 'none',
35833
- },
35834
- },
35835
  }, App.getConfig().get('blockDefaults.footer'));
35836
- },
35837
  });
35838
 
35839
  Module.FooterBlockView = base.BlockView.extend({
35840
  className: "mailpoet_block mailpoet_footer_block mailpoet_droppable_block",
35841
  getTemplate: function() { return templates.footerBlock; },
35842
  modelEvents: _.extend({
35843
- 'change:styles.block.backgroundColor change:styles.text.fontColor change:styles.text.fontFamily change:styles.text.fontSize change:styles.text.textAlign change:styles.link.fontColor change:styles.link.textDecoration': 'render',
35844
  }, _.omit(base.BlockView.prototype.modelEvents, 'change')),
35845
  behaviors: _.extend({}, base.BlockView.prototype.behaviors, {
35846
  TextEditorBehavior: {
35847
  configurationFilter: function(originalSettings) {
35848
  return _.extend({}, originalSettings, {
35849
  mailpoet_shortcodes: App.getConfig().get('shortcodes').toJSON(),
35850
- mailpoet_shortcodes_window_title: MailPoet.I18n.t('shortcodesWindowTitle'),
35851
  });
35852
  }
35853
- },
35854
  }),
35855
  onDragSubstituteBy: function() { return Module.FooterWidgetView; },
35856
  onRender: function() {
@@ -35867,11 +35867,11 @@ webpackJsonp([4],{
35867
  onTextEditorBlur: function() {
35868
  this.enableDragging();
35869
  this.enableShowingTools();
35870
- },
35871
  });
35872
 
35873
  Module.FooterBlockToolsView = base.BlockToolsView.extend({
35874
- getSettingsView: function() { return Module.FooterBlockSettingsView; },
35875
  });
35876
 
35877
  Module.FooterBlockSettingsView = base.BlockSettingsView.extend({
@@ -35887,14 +35887,14 @@ webpackJsonp([4],{
35887
  },
35888
  "change .mailpoet_field_footer_background_color": _.partial(this.changeColorField, "styles.block.backgroundColor"),
35889
  "change .mailpoet_field_footer_alignment": _.partial(this.changeField, "styles.text.textAlign"),
35890
- "click .mailpoet_done_editing": "close",
35891
  };
35892
  },
35893
  templateContext: function() {
35894
  return _.extend({}, base.BlockView.prototype.templateContext.apply(this, arguments), {
35895
- availableStyles: App.getAvailableStyles().toJSON(),
35896
  });
35897
- },
35898
  });
35899
 
35900
  Module.FooterWidgetView = base.WidgetView.extend({
@@ -35904,21 +35904,21 @@ webpackJsonp([4],{
35904
  cloneOriginal: true,
35905
  drop: function() {
35906
  return new Module.FooterBlockModel();
35907
- },
35908
  }
35909
- },
35910
  });
35911
 
35912
  App.on('before:start', function(App, options) {
35913
  App.registerBlockType('footer', {
35914
  blockModel: Module.FooterBlockModel,
35915
- blockView: Module.FooterBlockView,
35916
  });
35917
 
35918
  App.registerWidget({
35919
  name: 'footer',
35920
  widgetView: Module.FooterWidgetView,
35921
- priority: 99,
35922
  });
35923
  });
35924
 
@@ -35952,38 +35952,38 @@ webpackJsonp([4],{
35952
  text: 'Display problems? <a href="[link:newsletter_view_in_browser_url]">View it in your browser</a>',
35953
  styles: {
35954
  block: {
35955
- backgroundColor: 'transparent',
35956
  },
35957
  text: {
35958
  fontColor: '#000000',
35959
  fontFamily: 'Arial',
35960
  fontSize: '12px',
35961
- textAlign: 'center',
35962
  },
35963
  link: {
35964
  fontColor: '#0000ff',
35965
- textDecoration: 'underline',
35966
- },
35967
- },
35968
  }, App.getConfig().get('blockDefaults.header'));
35969
- },
35970
  });
35971
 
35972
  Module.HeaderBlockView = base.BlockView.extend({
35973
  className: "mailpoet_block mailpoet_header_block mailpoet_droppable_block",
35974
  getTemplate: function() { return templates.headerBlock; },
35975
  modelEvents: _.extend({
35976
- 'change:styles.block.backgroundColor change:styles.text.fontColor change:styles.text.fontFamily change:styles.text.fontSize change:styles.text.textAlign change:styles.link.fontColor change:styles.link.textDecoration': 'render',
35977
  }, _.omit(base.BlockView.prototype.modelEvents, 'change')),
35978
  behaviors: _.extend({}, base.BlockView.prototype.behaviors, {
35979
  TextEditorBehavior: {
35980
  configurationFilter: function(originalSettings) {
35981
  return _.extend({}, originalSettings, {
35982
  mailpoet_shortcodes: App.getConfig().get('shortcodes').toJSON(),
35983
- mailpoet_shortcodes_window_title: MailPoet.I18n.t('shortcodesWindowTitle'),
35984
  });
35985
  }
35986
- },
35987
  }),
35988
  onDragSubstituteBy: function() { return Module.HeaderWidgetView; },
35989
  onRender: function() {
@@ -36000,11 +36000,11 @@ webpackJsonp([4],{
36000
  onTextEditorBlur: function() {
36001
  this.enableDragging();
36002
  this.enableShowingTools();
36003
- },
36004
  });
36005
 
36006
  Module.HeaderBlockToolsView = base.BlockToolsView.extend({
36007
- getSettingsView: function() { return Module.HeaderBlockSettingsView; },
36008
  });
36009
 
36010
  Module.HeaderBlockSettingsView = base.BlockSettingsView.extend({
@@ -36020,14 +36020,14 @@ webpackJsonp([4],{
36020
  },
36021
  "change .mailpoet_field_header_background_color": _.partial(this.changeColorField, "styles.block.backgroundColor"),
36022
  "change .mailpoet_field_header_alignment": _.partial(this.changeField, "styles.text.textAlign"),
36023
- "click .mailpoet_done_editing": "close",
36024
  };
36025
  },
36026
  templateContext: function() {
36027
  return _.extend({}, base.BlockView.prototype.templateContext.apply(this, arguments), {
36028
- availableStyles: App.getAvailableStyles().toJSON(),
36029
  });
36030
- },
36031
  });
36032
 
36033
  Module.HeaderWidgetView = base.WidgetView.extend({
@@ -36037,21 +36037,21 @@ webpackJsonp([4],{
36037
  cloneOriginal: true,
36038
  drop: function() {
36039
  return new Module.HeaderBlockModel();
36040
- },
36041
  }
36042
- },
36043
  });
36044
 
36045
  App.on('before:start', function(App, options) {
36046
  App.registerBlockType('header', {
36047
  blockModel: Module.HeaderBlockModel,
36048
- blockView: Module.HeaderBlockView,
36049
  });
36050
 
36051
  App.registerWidget({
36052
  name: 'header',
36053
  widgetView: Module.HeaderWidgetView,
36054
- priority: 98,
36055
  });
36056
  });
36057
 
@@ -36119,7 +36119,7 @@ webpackJsonp([4],{
36119
  });
36120
 
36121
  CommunicationComponent.getBulkTransformedPosts({
36122
- blocks: blocks,
36123
  }).then(_.partial(this.refreshBlocks, models));
36124
  },
36125
  refreshBlocks: function(models, renderedBlocks) {
@@ -36131,7 +36131,7 @@ webpackJsonp([4],{
36131
  model.trigger('refreshPosts', contents);
36132
  }
36133
  );
36134
- },
36135
  });
36136
 
36137
  Module.AutomatedLatestContentBlockModel = base.BlockModel.extend({
@@ -36163,14 +36163,14 @@ webpackJsonp([4],{
36163
  sortBy: 'newest', // 'newest'|'oldest',
36164
  showDivider: true, // true|false
36165
  divider: {},
36166
- _container: new (App.getBlockTypeModel('container'))(),
36167
  }, App.getConfig().get('blockDefaults.automatedLatestContent'));
36168
  },
36169
  relations: function() {
36170
  return {
36171
  readMoreButton: App.getBlockTypeModel('button'),
36172
  divider: App.getBlockTypeModel('divider'),
36173
- _container: App.getBlockTypeModel('container'),
36174
  };
36175
  },
36176
  initialize: function() {
@@ -36190,7 +36190,7 @@ webpackJsonp([4],{
36190
  */
36191
  _scheduleFetchPosts: function() {
36192
  App.getChannel().trigger('automatedLatestContentRefresh');
36193
- },
36194
  });
36195
 
36196
  Module.AutomatedLatestContentBlockView = base.BlockView.extend({
@@ -36204,15 +36204,15 @@ webpackJsonp([4],{
36204
  getTemplate: function() { return templates.automatedLatestContentBlock; },
36205
  regions: {
36206
  toolsRegion: '.mailpoet_tools',
36207
- postsRegion: '.mailpoet_automated_latest_content_block_posts',
36208
  },
36209
  modelEvents: _.extend(
36210
  _.omit(base.BlockView.prototype.modelEvents, 'change'),
36211
  {
36212
- 'postsChanged': 'render',
36213
  }),
36214
  events: _.extend(base.BlockView.prototype.events, {
36215
- 'click .mailpoet_automated_latest_content_block_overlay': 'showSettings',
36216
  }),
36217
  onDragSubstituteBy: function() { return Module.AutomatedLatestContentWidgetView; },
36218
  onRender: function() {
@@ -36220,16 +36220,16 @@ webpackJsonp([4],{
36220
  renderOptions = {
36221
  disableTextEditor: true,
36222
  disableDragAndDrop: true,
36223
- emptyContainerMessage: MailPoet.I18n.t('noPostsToDisplay'),
36224
  };
36225
  this.toolsView = new Module.AutomatedLatestContentBlockToolsView({ model: this.model });
36226
  this.showChildView('toolsRegion', this.toolsView);
36227
  this.showChildView('postsRegion', new ContainerView({ model: this.model.get('_container'), renderOptions: renderOptions }));
36228
- },
36229
  });
36230
 
36231
  Module.AutomatedLatestContentBlockToolsView = base.BlockToolsView.extend({
36232
- getSettingsView: function() { return Module.AutomatedLatestContentBlockSettingsView; },
36233
  });
36234
 
36235
  // Sidebar view container
@@ -36258,7 +36258,7 @@ webpackJsonp([4],{
36258
  "input .mailpoet_automated_latest_content_categories": _.partial(this.changeField, "categoriesPrecededBy"),
36259
  "input .mailpoet_automated_latest_content_read_more_text": _.partial(this.changeField, "readMoreText"),
36260
  "change .mailpoet_automated_latest_content_sort_by": _.partial(this.changeField, "sortBy"),
36261
- "click .mailpoet_done_editing": "close",
36262
  };
36263
  },
36264
  onRender: function() {
@@ -36313,8 +36313,8 @@ webpackJsonp([4],{
36313
  }
36314
  )
36315
  };
36316
- },
36317
- },
36318
  }).on({
36319
  'select2:select': function(event) {
36320
  var terms = that.model.get('terms');
@@ -36327,7 +36327,7 @@ webpackJsonp([4],{
36327
  terms.remove(event.params.data);
36328
  // Reset whole model in order for change events to propagate properly
36329
  that.model.set('terms', terms.toJSON());
36330
- },
36331
  }).trigger( 'change' );
36332
  },
36333
  toggleDisplayOptions: function(event) {
@@ -36348,8 +36348,8 @@ webpackJsonp([4],{
36348
  renderOptions: {
36349
  displayFormat: 'subpanel',
36350
  hideLink: true,
36351
- hideApplyToAll: true,
36352
- },
36353
  })).render();
36354
  },
36355
  showDividerSettings: function(event) {
@@ -36358,8 +36358,8 @@ webpackJsonp([4],{
36358
  model: this.model.get('divider'),
36359
  renderOptions: {
36360
  displayFormat: 'subpanel',
36361
- hideApplyToAll: true,
36362
- },
36363
  })).render();
36364
  },
36365
  changeReadMoreType: function(event) {
@@ -36422,11 +36422,11 @@ webpackJsonp([4],{
36422
  _.each(postTypes, function(type) {
36423
  select.append(jQuery('<option>', {
36424
  value: type.name,
36425
- text: type.label,
36426
  }));
36427
  });
36428
  select.val(selectedValue);
36429
- },
36430
  });
36431
 
36432
  Module.AutomatedLatestContentWidgetView = base.WidgetView.extend({
@@ -36439,21 +36439,21 @@ webpackJsonp([4],{
36439
  },
36440
  onDrop: function(options) {
36441
  options.droppedView.triggerMethod('showSettings');
36442
- },
36443
  }
36444
- },
36445
  });
36446
 
36447
  App.on('before:start', function(App, options) {
36448
  App.registerBlockType('automatedLatestContent', {
36449
  blockModel: Module.AutomatedLatestContentBlockModel,
36450
- blockView: Module.AutomatedLatestContentBlockView,
36451
  });
36452
 
36453
  App.registerWidget({
36454
  name: 'automatedLatestContent',
36455
  widgetView: Module.AutomatedLatestContentWidgetView,
36456
- priority: 97,
36457
  });
36458
  });
36459
 
@@ -36549,7 +36549,7 @@ webpackJsonp([4],{
36549
  divider: {},
36550
  _selectedPosts: [],
36551
  _availablePosts: [],
36552
- _transformedPosts: new (App.getBlockTypeModel('container'))(),
36553
  }, App.getConfig().get('blockDefaults.posts'));
36554
  },
36555
  relations: function() {
@@ -36558,7 +36558,7 @@ webpackJsonp([4],{
36558
  divider: App.getBlockTypeModel('divider'),
36559
  _selectedPosts: Backbone.Collection,
36560
  _availablePosts: Backbone.Collection,
36561
- _transformedPosts: App.getBlockTypeModel('container'),
36562
  };
36563
  },
36564
  initialize: function() {
@@ -36645,7 +36645,7 @@ webpackJsonp([4],{
36645
  }).fail(function() {
36646
  MailPoet.Notice.error(MailPoet.I18n.t('failedToFetchRenderedPosts'));
36647
  });
36648
- },
36649
  });
36650
 
36651
  Module.PostsBlockView = base.BlockView.extend({
@@ -36653,7 +36653,7 @@ webpackJsonp([4],{
36653
  getTemplate: function() { return templates.postsBlock; },
36654
  modelEvents: {}, // Forcefully disable all events
36655
  regions: _.extend({
36656
- postsRegion: '.mailpoet_posts_block_posts',
36657
  }, base.BlockView.prototype.regions),
36658
  onDragSubstituteBy: function() { return Module.PostsWidgetView; },
36659
  initialize: function() {
@@ -36672,7 +36672,7 @@ webpackJsonp([4],{
36672
  renderOptions = {
36673
  disableTextEditor: true,
36674
  disableDragAndDrop: true,
36675
- emptyContainerMessage: MailPoet.I18n.t('noPostsToDisplay'),
36676
  };
36677
  this.showChildView('postsRegion', new ContainerView({ model: this.model.get('_transformedPosts'), renderOptions: renderOptions }));
36678
  },
@@ -36681,27 +36681,27 @@ webpackJsonp([4],{
36681
  },
36682
  onBeforeDestroy: function() {
36683
  this.model.stopReplying('blockView', this.notifyAboutSelf, this);
36684
- },
36685
  });
36686
 
36687
  Module.PostsBlockToolsView = base.BlockToolsView.extend({
36688
- getSettingsView: function() { return Module.PostsBlockSettingsView; },
36689
  });
36690
 
36691
  Module.PostsBlockSettingsView = base.BlockSettingsView.extend({
36692
  getTemplate: function() { return templates.postsBlockSettings; },
36693
  regions: {
36694
  selectionRegion: '.mailpoet_settings_posts_selection',
36695
- displayOptionsRegion: '.mailpoet_settings_posts_display_options',
36696
  },
36697
  events: {
36698
  'click .mailpoet_settings_posts_show_display_options': 'switchToDisplayOptions',
36699
  'click .mailpoet_settings_posts_show_post_selection': 'switchToPostSelection',
36700
- 'click .mailpoet_settings_posts_insert_selected': 'insertPosts',
36701
  },
36702
  templateContext: function() {
36703
  return {
36704
- model: this.model.toJSON(),
36705
  };
36706
  },
36707
  initialize: function() {
@@ -36724,7 +36724,7 @@ webpackJsonp([4],{
36724
  onCancel: function() {
36725
  // Self destroy the block if the user closes settings modal
36726
  that.model.destroy();
36727
- },
36728
  });
36729
 
36730
  // Inform child views that they have been attached to document
@@ -36753,7 +36753,7 @@ webpackJsonp([4],{
36753
  this.model.trigger('insertSelectedPosts');
36754
  this.model.destroy();
36755
  this.close();
36756
- },
36757
  });
36758
 
36759
  var PostsSelectionCollectionView = Marionette.CollectionView.extend({
@@ -36762,14 +36762,14 @@ webpackJsonp([4],{
36762
  emptyView: function() { return EmptyPostSelectionSettingsView; },
36763
  childViewOptions: function() {
36764
  return {
36765
- blockModel: this.blockModel,
36766
  };
36767
  },
36768
  initialize: function(options) {
36769
  this.blockModel = options.blockModel;
36770
  },
36771
  events: {
36772
- 'scroll': 'onPostsScroll',
36773
  },
36774
  onPostsScroll: function(event) {
36775
  var $postsBox = jQuery(event.target);
@@ -36777,19 +36777,19 @@ webpackJsonp([4],{
36777
  // Load more posts if scrolled to bottom
36778
  this.blockModel.trigger('loadMorePosts');
36779
  }
36780
- },
36781
  });
36782
 
36783
  var PostSelectionSettingsView = Marionette.View.extend({
36784
  getTemplate: function() { return templates.postSelectionPostsBlockSettings; },
36785
  regions: {
36786
- posts: '.mailpoet_post_selection_container',
36787
  },
36788
  events: function() {
36789
  return {
36790
  'change .mailpoet_settings_posts_content_type': _.partial(this.changeField, 'contentType'),
36791
  'change .mailpoet_posts_post_status': _.partial(this.changeField, 'postStatus'),
36792
- 'input .mailpoet_posts_search_term': _.partial(this.changeField, 'search'),
36793
  };
36794
  },
36795
  modelEvents: {
@@ -36865,8 +36865,8 @@ webpackJsonp([4],{
36865
  }
36866
  )
36867
  };
36868
- },
36869
- },
36870
  }).on({
36871
  'select2:select': function(event) {
36872
  var terms = that.model.get('terms');
@@ -36879,7 +36879,7 @@ webpackJsonp([4],{
36879
  terms.remove(event.params.data);
36880
  // Reset whole model in order for change events to propagate properly
36881
  that.model.set('terms', terms.toJSON());
36882
- },
36883
  }).trigger( 'change' );
36884
  },
36885
  changeField: function(field, event) {
@@ -36893,28 +36893,28 @@ webpackJsonp([4],{
36893
  _.each(postTypes, function(type) {
36894
  select.append(jQuery('<option>', {
36895
  value: type.name,
36896
- text: type.label,
36897
  }));
36898
  });
36899
  select.val(selectedValue);
36900
- },
36901
  });
36902
 
36903
  var EmptyPostSelectionSettingsView = Marionette.View.extend({
36904
- getTemplate: function() { return templates.emptyPostPostsBlockSettings; },
36905
  });
36906
 
36907
  var SinglePostSelectionSettingsView = Marionette.View.extend({
36908
  getTemplate: function() { return templates.singlePostPostsBlockSettings; },
36909
  events: function() {
36910
  return {
36911
- 'change .mailpoet_select_post_checkbox': 'postSelectionChange',
36912
  };
36913
  },
36914
  templateContext: function() {
36915
  return {
36916
  model: this.model.toJSON(),
36917
- index: this._index,
36918
  };
36919
  },
36920
  initialize: function(options) {
@@ -36928,7 +36928,7 @@ webpackJsonp([4],{
36928
  } else {
36929
  selectedPostsCollection.remove(this.model);
36930
  }
36931
- },
36932
  });
36933
 
36934
  var PostsDisplayOptionsSettingsView = base.BlockSettingsView.extend({
@@ -36953,12 +36953,12 @@ webpackJsonp([4],{
36953
  "change .mailpoet_posts_show_categories": _.partial(this.changeField, "showCategories"),
36954
  "input .mailpoet_posts_categories": _.partial(this.changeField, "categoriesPrecededBy"),
36955
  "input .mailpoet_posts_read_more_text": _.partial(this.changeField, "readMoreText"),
36956
- "change .mailpoet_posts_sort_by": _.partial(this.changeField, "sortBy"),
36957
  };
36958
  },
36959
  templateContext: function() {
36960
  return {
36961
- model: this.model.toJSON(),
36962
  };
36963
  },
36964
  showButtonSettings: function(event) {
@@ -36968,8 +36968,8 @@ webpackJsonp([4],{
36968
  renderOptions: {
36969
  displayFormat: 'subpanel',
36970
  hideLink: true,
36971
- hideApplyToAll: true,
36972
- },
36973
  })).render();
36974
  },
36975
  showDividerSettings: function(event) {
@@ -36978,8 +36978,8 @@ webpackJsonp([4],{
36978
  model: this.model.get('divider'),
36979
  renderOptions: {
36980
  displayFormat: 'subpanel',
36981
- hideApplyToAll: true,
36982
- },
36983
  })).render();
36984
  },
36985
  changeReadMoreType: function(event) {
@@ -37033,7 +37033,7 @@ webpackJsonp([4],{
37033
  this.$('.mailpoet_posts_title_as_link').removeClass('mailpoet_hidden');
37034
  }
37035
  this.changeField('titleFormat', event);
37036
- },
37037
  });
37038
 
37039
  Module.PostsWidgetView = base.WidgetView.extend({
@@ -37045,19 +37045,19 @@ webpackJsonp([4],{
37045
  return new Module.PostsBlockModel({}, { parse: true });
37046
  }
37047
  }
37048
- },
37049
  });
37050
 
37051
  App.on('before:start', function(App, options) {
37052
  App.registerBlockType('posts', {
37053
  blockModel: Module.PostsBlockModel,
37054
- blockView: Module.PostsBlockView,
37055
  });
37056
 
37057
  App.registerWidget({
37058
  name: 'posts',
37059
  widgetView: Module.PostsWidgetView,
37060
- priority: 96,
37061
  });
37062
  });
37063
 
@@ -37102,7 +37102,7 @@ webpackJsonp([4],{
37102
  image: App.getAvailableStyles().get('socialIconSets.default.custom'),
37103
  height: '32px',
37104
  width: '32px',
37105
- text: defaultValues.get('title'),
37106
  };
37107
  },
37108
  initialize: function(options) {
@@ -37114,11 +37114,11 @@ webpackJsonp([4],{
37114
  this.set({
37115
  link: defaultValues.get('defaultLink'),
37116
  image: iconSet.get(that.get('iconType')),
37117
- text: defaultValues.get('title'),
37118
  });
37119
  }, this);
37120
  this.on('change', function() { App.getChannel().trigger('autoSave'); });
37121
- },
37122
  });
37123
 
37124
  Module.SocialIconCollectionModel = Backbone.Collection.extend({
@@ -37131,11 +37131,11 @@ webpackJsonp([4],{
37131
  return this._getDefaults({
37132
  type: 'social',
37133
  iconSet: 'default',
37134
- icons: new Module.SocialIconCollectionModel(),
37135
  }, App.getConfig().get('blockDefaults.social'));
37136
  },
37137
  relations: {
37138
- icons: Module.SocialIconCollectionModel,
37139
  },
37140
  initialize: function() {
37141
  this.get('icons').on('add remove change', this._iconsChanged, this);
@@ -37152,27 +37152,27 @@ webpackJsonp([4],{
37152
  },
37153
  _iconsChanged: function() {
37154
  App.getChannel().trigger('autoSave');
37155
- },
37156
  });
37157
 
37158
  var SocialIconView = Marionette.View.extend({
37159
  tagName: 'span',
37160
  getTemplate: function() { return templates.socialIconBlock; },
37161
  modelEvents: {
37162
- 'change': 'render',
37163
  },
37164
  templateContext: function() {
37165
  var allIconSets = App.getAvailableStyles().get('socialIconSets');
37166
  return {
37167
  model: this.model.toJSON(),
37168
  allIconSets: allIconSets.toJSON(),
37169
- imageMissingSrc: App.getConfig().get('urls.imageMissing'),
37170
  };
37171
- },
37172
  });
37173
 
37174
  Module.SocialIconCollectionView = Marionette.CollectionView.extend({
37175
- childView: SocialIconView,
37176
  });
37177
 
37178
  Module.SocialBlockView = base.BlockView.extend({
@@ -37185,7 +37185,7 @@ webpackJsonp([4],{
37185
  tools: '> .mailpoet_tools'
37186
  },
37187
  behaviors: _.extend({}, base.BlockView.prototype.behaviors, {
37188
- ShowSettingsBehavior: {},
37189
  }),
37190
  onDragSubstituteBy: function() { return Module.SocialWidgetView; },
37191
  onRender: function() {
@@ -37194,11 +37194,11 @@ webpackJsonp([4],{
37194
  this.showChildView('icons', new Module.SocialIconCollectionView({
37195
  collection: this.model.get('icons')
37196
  }))
37197
- },
37198
  });
37199
 
37200
  Module.SocialBlockToolsView = base.BlockToolsView.extend({
37201
- getSettingsView: function() { return Module.SocialBlockSettingsView; },
37202
  });
37203
 
37204
  // Sidebar view container
@@ -37206,11 +37206,11 @@ webpackJsonp([4],{
37206
  getTemplate: function() { return templates.socialBlockSettings; },
37207
  regions: {
37208
  iconRegion: '#mailpoet_social_icons_selection',
37209
- stylesRegion: '#mailpoet_social_icons_styles',
37210
  },
37211
  events: function() {
37212
  return {
37213
- "click .mailpoet_done_editing": "close",
37214
  };
37215
  },
37216
  initialize: function() {
@@ -37234,7 +37234,7 @@ webpackJsonp([4],{
37234
  "change .mailpoet_social_icon_field_type": _.partial(this.changeField, "iconType"),
37235
  "input .mailpoet_social_icon_field_image": _.partial(this.changeField, "image"),
37236
  "input .mailpoet_social_icon_field_link": this.changeLink,
37237
- "input .mailpoet_social_icon_field_text": _.partial(this.changeField, "text"),
37238
  };
37239
  },
37240
  modelEvents: {
@@ -37244,7 +37244,7 @@ webpackJsonp([4],{
37244
  },
37245
  'change:text': function() {
37246
  this.$('.mailpoet_social_icon_image').attr('alt', this.model.get('text'));
37247
- },
37248
  },
37249
  templateContext: function() {
37250
  var icons = App.getConfig().get('socialIcons'),
@@ -37254,7 +37254,7 @@ webpackJsonp([4],{
37254
  return _.extend({}, base.BlockView.prototype.templateContext.apply(this, arguments), {
37255
  iconTypes: availableIconTypes,
37256
  currentType: icons.get(this.model.get('iconType')).toJSON(),
37257
- allIconSets: allIconSets.toJSON(),
37258
  });
37259
  },
37260
  deleteIcon: function() {
@@ -37269,17 +37269,17 @@ webpackJsonp([4],{
37269
  },
37270
  changeField: function(field, event) {
37271
  this.model.set(field, jQuery(event.target).val());
37272
- },
37273
  });
37274
 
37275
  SocialBlockSettingsIconCollectionView = Marionette.CollectionView.extend({
37276
  behaviors: {
37277
  SortableBehavior: {
37278
- items: '> div',
37279
- },
37280
  },
37281
  childViewContainer: '#mailpoet_social_icon_selector_contents',
37282
- childView: SocialBlockSettingsIconView,
37283
  });
37284
 
37285
  // Select icons section container view
@@ -37289,10 +37289,10 @@ webpackJsonp([4],{
37289
  'icons': '#mailpoet_social_icon_selector_contents'
37290
  },
37291
  events: {
37292
- 'click .mailpoet_add_social_icon': 'addSocialIcon',
37293
  },
37294
  modelEvents: {
37295
- 'change:iconSet': 'render',
37296
  },
37297
  addSocialIcon: function() {
37298
  // Add a social icon with default values
@@ -37309,10 +37309,10 @@ webpackJsonp([4],{
37309
  SocialBlockSettingsStylesView = Marionette.View.extend({
37310
  getTemplate: function() { return templates.socialSettingsStyles; },
37311
  modelEvents: {
37312
- 'change': 'render',
37313
  },
37314
  events: {
37315
- 'click .mailpoet_social_icon_set': 'changeSocialIconSet',
37316
  },
37317
  initialize: function() {
37318
  this.listenTo(this.model.get('icons'), 'add remove change', this.render);
@@ -37323,7 +37323,7 @@ webpackJsonp([4],{
37323
  activeSet: this.model.get('iconSet'),
37324
  socialIconSets: allIconSets.toJSON(),
37325
  availableSets: _.keys(allIconSets.toJSON()),
37326
- availableSocialIcons: this.model.get('icons').pluck('iconType'),
37327
  };
37328
  },
37329
  changeSocialIconSet: function(event) {
@@ -37331,7 +37331,7 @@ webpackJsonp([4],{
37331
  },
37332
  onBeforeDestroy: function() {
37333
  this.model.get('icons').off('add remove', this.render, this);
37334
- },
37335
  });
37336
 
37337
  Module.SocialWidgetView = base.WidgetView.extend({
@@ -37351,7 +37351,7 @@ webpackJsonp([4],{
37351
  image: App.getAvailableStyles().get('socialIconSets.default.facebook'),
37352
  height: '32px',
37353
  width: '32px',
37354
- text: 'Facebook',
37355
  },
37356
  {
37357
  type: 'socialIcon',
@@ -37360,25 +37360,25 @@ webpackJsonp([4],{
37360
  image: App.getAvailableStyles().get('socialIconSets.default.twitter'),
37361
  height: '32px',
37362
  width: '32px',
37363
- text: 'Twitter',
37364
- },
37365
- ],
37366
  }, { parse: true });
37367
  }
37368
  }
37369
- },
37370
  });
37371
 
37372
  App.on('before:start', function(App, options) {
37373
  App.registerBlockType('social', {
37374
  blockModel: Module.SocialBlockModel,
37375
- blockView: Module.SocialBlockView,
37376
  });
37377
 
37378
  App.registerWidget({
37379
  name: 'social',
37380
  widgetView: Module.SocialWidgetView,
37381
- priority: 95,
37382
  });
37383
  });
37384
 
27618
  contentRegion: '#mailpoet_editor_content',
27619
  sidebarRegion: '#mailpoet_editor_sidebar',
27620
  bottomRegion: '#mailpoet_editor_bottom',
27621
+ headingRegion: '#mailpoet_editor_heading'
27622
+ }
27623
  });
27624
 
27625
  var EditorApplication = Marionette.Application.extend({
27663
  blockDefaults: {},
27664
  sidepanelWidth: '331px',
27665
  validation: {},
27666
+ urls: {}
27667
+ }
27668
  });
27669
 
27670
  // Global and available styles for access in blocks and their settings
27707
  text: {
27708
  fontColor: '#000000',
27709
  fontFamily: 'Arial',
27710
+ fontSize: '16px'
27711
  },
27712
  h1: {
27713
  fontColor: '#111111',
27717
  h2: {
27718
  fontColor: '#222222',
27719
  fontFamily: 'Tahoma',
27720
+ fontSize: '32px'
27721
  },
27722
  h3: {
27723
  fontColor: '#333333',
27724
  fontFamily: 'Verdana',
27725
+ fontSize: '24px'
27726
  },
27727
  link: {
27728
  fontColor: '#21759B',
27729
+ textDecoration: 'underline'
27730
  },
27731
  wrapper: {
27732
+ backgroundColor: '#ffffff'
27733
  },
27734
  body: {
27735
+ backgroundColor: '#cccccc'
27736
+ }
27737
  },
27738
  initialize: function() {
27739
  this.on('change', function() { App.getChannel().trigger('autoSave'); });
27740
+ }
27741
  });
27742
 
27743
  Module.StylesView = Marionette.View.extend({
27744
  getTemplate: function() { return templates.styles; },
27745
  modelEvents: {
27746
+ 'change': 'render'
27747
  },
27748
  serializeData: function() {
27749
  return this.model.toJSON();
27819
  defaults: {
27820
  name: '',
27821
  priority: 100,
27822
+ widgetView: undefined
27823
+ }
27824
  }),
27825
+ comparator: 'priority'
27826
  }))();
27827
  Module.registerWidget = function(widget) { return Module._contentWidgets.add(widget); };
27828
  Module.getWidgets = function() { return Module._contentWidgets; };
27833
  defaults: {
27834
  name: '',
27835
  priority: 100,
27836
+ widgetView: undefined
27837
+ }
27838
  }),
27839
+ comparator: 'priority'
27840
  }))();
27841
  Module.registerLayoutWidget = function(widget) { return Module._layoutWidgets.add(widget); };
27842
  Module.getLayoutWidgets = function() { return Module._layoutWidgets; };
27847
  contentRegion: '.mailpoet_content_region',
27848
  layoutRegion: '.mailpoet_layout_region',
27849
  stylesRegion: '.mailpoet_styles_region',
27850
+ previewRegion: '.mailpoet_preview_region'
27851
  },
27852
  events: {
27853
  'click .mailpoet_sidebar_region h3, .mailpoet_sidebar_region .handlediv': function(event) {
27873
  easing: "easeIn",
27874
  complete: function() {
27875
  $targetRegion.removeClass('closed');
27876
+ }
27877
  }
27878
  );
27879
  }
27880
+ }
27881
  },
27882
  initialize: function(options) {
27883
  jQuery(window)
27893
  ));
27894
  this.showChildView('stylesRegion', new Module.SidebarStylesView({
27895
  model: App.getGlobalStyles(),
27896
+ availableStyles: App.getAvailableStyles()
27897
  }));
27898
  this.showChildView('previewRegion', new Module.SidebarPreviewView());
27899
  },
27916
  },
27917
  onDomRefresh: function() {
27918
  this.$el.parent().stick_in_parent({
27919
+ offset_top: 32
27920
  });
27921
  this.$el.parent().on('sticky_kit:stick', this.updateHorizontalScroll.bind(this));
27922
  this.$el.parent().on('sticky_kit:unstick', this.updateHorizontalScroll.bind(this));
27923
  this.$el.parent().on('sticky_kit:bottom', this.updateHorizontalScroll.bind(this));
27924
  this.$el.parent().on('sticky_kit:unbottom', this.updateHorizontalScroll.bind(this));
27925
+ }
27926
  });
27927
 
27928
  /**
27956
  * Responsible for rendering draggable layout widgets
27957
  */
27958
  Module.SidebarLayoutWidgetsView = Module.SidebarWidgetsView.extend({
27959
+ getTemplate: function() { return templates.sidebarLayout; }
27960
  });
27961
 
27962
  /**
27965
  Module.SidebarStylesView = Marionette.View.extend({
27966
  getTemplate: function() { return templates.sidebarStyles; },
27967
  behaviors: {
27968
+ ColorPickerBehavior: {}
27969
  },
27970
  events: function() {
27971
  return {
28002
  this.model.set('link.textDecoration', (event.target.checked) ? event.target.value : 'none');
28003
  },
28004
  "change #mailpoet_newsletter_background_color": _.partial(this.changeColorField, 'wrapper.backgroundColor'),
28005
+ "change #mailpoet_background_color": _.partial(this.changeColorField, 'body.backgroundColor')
28006
  };
28007
  },
28008
  templateContext: function() {
28009
  return {
28010
  model: this.model.toJSON(),
28011
+ availableStyles: this.availableStyles.toJSON()
28012
  };
28013
  },
28014
  initialize: function(options) {
28023
  value = 'transparent';
28024
  }
28025
  this.model.set(field, value);
28026
+ }
28027
  });
28028
 
28029
  Module.SidebarPreviewView = Marionette.View.extend({
28030
  getTemplate: function() { return templates.sidebarPreview; },
28031
  events: {
28032
  'click .mailpoet_show_preview': 'showPreview',
28033
+ 'click #mailpoet_send_preview': 'sendPreview'
28034
  },
28035
  onBeforeDestroy: function() {
28036
  if (this.previewView) {
28052
  api_version: window.mailpoet_api_version,
28053
  endpoint: 'newsletters',
28054
  action: 'showPreview',
28055
+ data: json
28056
  }).always(function() {
28057
  MailPoet.Modal.loading(false);
28058
  }).done(function(response) {
28085
  var $emailField = this.$('#mailpoet_preview_to_email');
28086
  var data = {
28087
  subscriber: $emailField.val(),
28088
+ id: App.getNewsletter().get('id')
28089
  };
28090
 
28091
  if (data.subscriber.length <= 0) {
28093
  MailPoet.I18n.t('newsletterPreviewEmailMissing'),
28094
  {
28095
  positionAfter: $emailField,
28096
+ scroll: true
28097
  }
28098
  );
28099
  return false;
28122
  }
28123
  });
28124
  });
28125
+ }
28126
  });
28127
 
28128
  Module.NewsletterPreviewView = Marionette.View.extend({
28136
  return {
28137
  previewUrl: this.previewUrl,
28138
  width: this.width,
28139
+ height: this.height
28140
  };
28141
  }
28142
  });
28195
  // Use only whitelisted properties to ensure properties editor
28196
  // doesn't control don't change.
28197
  return _.pick(SuperModel.prototype.toJSON.call(this), this.whitelisted);
28198
+ }
28199
  });
28200
 
28201
  // Content block view and model handlers for different content types
28221
  Module.getBody = function() {
28222
  return {
28223
  content: App._contentContainer.toJSON(),
28224
+ globalStyles: App.getGlobalStyles().toJSON()
28225
  };
28226
  };
28227
 
28228
  Module.toJSON = function() {
28229
  return _.extend({
28230
+ body: Module.getBody()
28231
  }, App.getNewsletter().toJSON());
28232
  };
28233
 
28267
  App._contentContainer = new (App.getBlockTypeModel('container'))(content, {parse: true});
28268
  App._contentContainerView = new (App.getBlockTypeView('container'))({
28269
  model: App._contentContainer,
28270
+ renderOptions: { depth: 0 }
28271
  });
28272
 
28273
  App._appView.showChildView('contentRegion', App._contentContainerView);
28299
  getTemplate: function() { return templates.heading; },
28300
  templateContext: function() {
28301
  return {
28302
+ model: this.model.toJSON()
28303
  };
28304
  },
28305
  events: function() {
28306
  return {
28307
  'keyup .mailpoet_input_title': _.partial(this.changeField, "subject"),
28308
+ 'keyup .mailpoet_input_preheader': _.partial(this.changeField, "preheader")
28309
  };
28310
  },
28311
  changeField: function(field, event) {
28312
  this.model.set(field, jQuery(event.target).val());
28313
+ }
28314
  });
28315
 
28316
  App.on('start', function(App, options) {
28377
  MailPoet.Notice.error(
28378
  MailPoet.I18n.t('templateSaveFailed'),
28379
  {
28380
+ scroll: true
28381
  }
28382
  );
28383
  } else {
28433
  promise.then(function(thumbnail) {
28434
  var data = _.extend(options || {}, {
28435
  thumbnail: thumbnail.toDataURL('image/jpeg'),
28436
+ body: JSON.stringify(App.getBody())
28437
  });
28438
 
28439
  return MailPoet.Ajax.post({
28460
  ).then(function(thumbnail) {
28461
  var data = _.extend(options || {}, {
28462
  thumbnail: thumbnail.toDataURL('image/jpeg'),
28463
+ body: App.getBody()
28464
  });
28465
  var blob = new Blob(
28466
  [JSON.stringify(data)],
28482
  'click .mailpoet_save_as_template': 'saveAsTemplate',
28483
  /* Export template */
28484
  'click .mailpoet_save_export': 'toggleExportTemplate',
28485
+ 'click .mailpoet_export_template': 'exportTemplate'
28486
  },
28487
  initialize: function(options) {
28488
  App.getChannel().on('beforeEditorSave', this.beforeSave, this);
28530
  MailPoet.I18n.t('templateNameMissing'),
28531
  {
28532
  positionAfter: that.$el,
28533
+ scroll: true
28534
  }
28535
  );
28536
  } else if (templateDescription === '') {
28538
  MailPoet.I18n.t('templateDescriptionMissing'),
28539
  {
28540
  positionAfter: that.$el,
28541
+ scroll: true
28542
  }
28543
  );
28544
  } else {
28545
  Module.saveTemplate({
28546
  name: templateName,
28547
+ description: templateDescription
28548
  }).done(function() {
28549
  MailPoet.Notice.success(
28550
  MailPoet.I18n.t('templateSaved'),
28551
  {
28552
  positionAfter: that.$el,
28553
+ scroll: true
28554
  }
28555
  );
28556
  }).fail(function() {
28558
  MailPoet.I18n.t('templateSaveFailed'),
28559
  {
28560
  positionAfter: that.$el,
28561
+ scroll: true
28562
  }
28563
  );
28564
  });
28583
  MailPoet.I18n.t('templateNameMissing'),
28584
  {
28585
  positionAfter: that.$el,
28586
+ scroll: true
28587
  }
28588
  );
28589
  } else if (templateDescription === '') {
28591
  MailPoet.I18n.t('templateDescriptionMissing'),
28592
  {
28593
  positionAfter: that.$el,
28594
+ scroll: true
28595
  }
28596
  );
28597
  } else {
28598
  Module.exportTemplate({
28599
  name: templateName,
28600
+ description: templateDescription
28601
  });
28602
  this.hideExportTemplate();
28603
  }
28639
  hideValidationError: function() {
28640
  this.$('.mailpoet_save_error').addClass('mailpoet_hidden');
28641
  this.$('.mailpoet_save_next').removeClass('button-disabled');
28642
+ }
28643
  });
28644
 
28645
  Module.autoSave = function() {
33290
  chooseText: MailPoet.I18n.t('selectColor'),
33291
  cancelText: MailPoet.I18n.t('cancelColorSelection')
33292
  });
33293
+ }
33294
  });
33295
  }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
33296
 
33317
 
33318
  BehaviorsLookup.ContainerDropZoneBehavior = Marionette.Behavior.extend({
33319
  defaults: {
33320
+ columnLimit: 3
33321
  },
33322
  onRender: function() {
33323
  var dragAndDropDisabled = _.isObject(this.view.options.renderOptions) && this.view.options.renderOptions.disableDragAndDrop === true;
33497
  if (view.model.get('orientation') === 'horizontal' && droppableModel.get('type') !== 'container') {
33498
  // Regular blocks always need to be inserted into columns - vertical containers
33499
  tempCollection = new (EditorApplication.getBlockTypeModel('container'))({
33500
+ orientation: 'vertical'
33501
  });
33502
  tempCollection.get('blocks').add(droppableModel);
33503
  viewCollection.add(tempCollection, {at: index});
33512
  var tempModel = viewCollection.at(dropPosition.index);
33513
 
33514
  tempCollection = new (EditorApplication.getBlockTypeModel('container'))({
33515
+ orientation: (view.model.get('orientation') === 'vertical') ? 'horizontal' : 'vertical'
33516
  });
33517
 
33518
  viewCollection.remove(tempModel);
33520
  if (tempCollection.get('orientation') === 'horizontal') {
33521
  if (dropPosition.position === 'before') {
33522
  tempCollection2 = new (EditorApplication.getBlockTypeModel('container'))({
33523
+ orientation: 'vertical'
33524
  });
33525
  tempCollection2.get('blocks').add(droppableModel);
33526
  tempCollection.get('blocks').add(tempCollection2);
33527
  }
33528
  tempCollection2 = new (EditorApplication.getBlockTypeModel('container'))({
33529
+ orientation: 'vertical'
33530
  });
33531
  tempCollection2.get('blocks').add(tempModel);
33532
  tempCollection.get('blocks').add(tempCollection2);
33533
  if (dropPosition.position === 'after') {
33534
  tempCollection2 = new (EditorApplication.getBlockTypeModel('container'))({
33535
+ orientation: 'vertical'
33536
  });
33537
  tempCollection2.get('blocks').add(droppableModel);
33538
  tempCollection.get('blocks').add(tempCollection2);
33556
  event.draggable.onDrop({
33557
  dropBehavior: that,
33558
  droppedModel: droppableModel,
33559
+ droppedView: droppedView
33560
  });
33561
 
33562
  that.cleanup();
33563
+ }
33564
  });
33565
  },
33566
  cleanup: function() {
33598
  return {
33599
  insertionType: 'normal',
33600
  index: 0,
33601
+ position: 'inside'
33602
  };
33603
  }
33604
 
33649
  return {
33650
  insertionType: insertionType, // 'normal'|'special'
33651
  index: index,
33652
+ position: position // 'inside'|'before'|'after'
33653
  };
33654
  },
33655
  _computeNormalIndex: function(eventX, eventY) {
33679
  // First half of the element
33680
  return {
33681
  index: index,
33682
+ position: 'before'
33683
  };
33684
  } else {
33685
  // Second half of the element
33686
  return {
33687
  index: index,
33688
+ position: 'after'
33689
  };
33690
  }
33691
  },
33776
  },
33777
 
33778
  onDrop: function(model, view) {},
33779
+ testAttachToInstance: function(model, view) { return true; }
33780
  },
33781
  onRender: function() {
33782
  var that = this,
33786
  if (!this.options.testAttachToInstance(this.view.model, this.view)) return;
33787
 
33788
  interactable = interact(this.$el.get(0), {
33789
+ ignoreFrom: this.options.ignoreSelector
33790
  }).draggable({
33791
  // allow dragging of multple elements at the same time
33792
  max: Infinity,
33859
  that.view.$el.removeClass('mailpoet_hidden');
33860
  }
33861
  }
33862
+ }
33863
  })
33864
  .preventDefault('auto')
33865
  .styleCursor(false)
33885
  // Delegate to view's event handler
33886
  that.options.onDrop.apply(that, [options]);
33887
  };
33888
+ }
33889
  });
33890
  }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
33891
 
33902
  */
33903
  !(__WEBPACK_AMD_DEFINE_ARRAY__ = [
33904
  __webpack_require__(493),
33905
+ __webpack_require__(516)
33906
  ], __WEBPACK_AMD_DEFINE_RESULT__ = function(Marionette, BehaviorsLookup) {
33907
 
33908
  BehaviorsLookup.HighlightEditingBehavior = Marionette.Behavior.extend({
33909
  modelEvents: {
33910
  'startEditing': 'enableHighlight',
33911
+ 'stopEditing': 'disableHighlight'
33912
  },
33913
  enableHighlight: function() {
33914
  this.$el.addClass('mailpoet_highlight');
33915
  },
33916
  disableHighlight: function() {
33917
  this.$el.removeClass('mailpoet_highlight');
33918
+ }
33919
  });
33920
  }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
33921
 
33942
  resizeHandleSelector: true, // true will use edges of the element itself
33943
  transformationFunction: function(y) { return y; },
33944
  minLength: 0,
33945
+ modelField: 'styles.block.height'
33946
  },
33947
  events: {
33948
  "mouseenter": 'showResizeHandle',
33949
+ "mouseleave": 'hideResizeHandle'
33950
  },
33951
  onRender: function() {
33952
  this.attachResize();
33964
  top: false,
33965
  left: false,
33966
  right: false,
33967
+ bottom: (typeof this.options.resizeHandleSelector === 'string') ? this.view.$(this.options.resizeHandleSelector).get(0) : this.options.resizeHandleSelector
33968
+ }
33969
  }).on('resizestart', function(event) {
33970
  that.isBeingResized = true;
33971
  that.$el.addClass('mailpoet_resize_active');
33990
  if (typeof this.options.resizeHandleSelector === 'string') {
33991
  this.view.$(this.options.resizeHandleSelector).addClass('mailpoet_hidden');
33992
  }
33993
+ }
33994
  });
33995
  }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
33996
 
34034
  collection.remove(model);
34035
  collection.add(model, { at: newIndex });
34036
  },
34037
+ items: this.options.items
34038
  });
34039
  }
34040
  }
34055
  !(__WEBPACK_AMD_DEFINE_ARRAY__ = [
34056
  __webpack_require__(493),
34057
  __webpack_require__(273),
34058
+ __webpack_require__(516)
34059
  ], __WEBPACK_AMD_DEFINE_RESULT__ = function(Marionette, jQuery, BehaviorsLookup) {
34060
 
34061
  BehaviorsLookup.ShowSettingsBehavior = Marionette.Behavior.extend({
34062
  defaults: {
34063
+ ignoreFrom: '' // selector
34064
  },
34065
  events: {
34066
+ 'click .mailpoet_content': 'showSettings'
34067
  },
34068
  showSettings: function(event) {
34069
  if(!this.isIgnoredElement(event.target)) {
34074
  return this.options.ignoreFrom
34075
  && this.options.ignoreFrom.length > 0
34076
  && jQuery(element).is(this.options.ignoreFrom);
34077
+ }
34078
  });
34079
  }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
34080
 
34105
  invalidElements: "script",
34106
  blockFormats: 'Paragraph=p',
34107
  plugins: "link textcolor colorpicker mailpoet_shortcodes",
34108
+ configurationFilter: function(originalConfig) { return originalConfig; }
34109
  },
34110
  onDomRefresh: function() {
34111
  var that = this;
34163
  editor.on('blur', function(e) {
34164
  that.view.triggerMethod('text:editor:blur');
34165
  });
34166
+ }
34167
  }));
34168
  }
34169
  });
34219
  },
34220
  getChildren: function() {
34221
  return [];
34222
+ }
34223
  });
34224
 
34225
  Module.BlockView = AugmentedView.extend({
34226
  regions: {
34227
+ toolsRegion: '> .mailpoet_tools'
34228
  },
34229
  modelEvents: {
34230
  'change': 'render',
34231
  'delete': 'deleteBlock',
34232
+ 'duplicate': 'duplicateBlock'
34233
  },
34234
  events: {
34235
  "mouseenter": "showTools",
34236
+ "mouseleave": "hideTools"
34237
  },
34238
  behaviors: {
34239
  DraggableBehavior: {
34256
  WidgetView.destroy();
34257
  return node;
34258
  }
34259
+ }
34260
  },
34261
+ HighlightEditingBehavior: {}
34262
  },
34263
  templateContext: function() {
34264
  return {
34265
  model: this.model.toJSON(),
34266
+ viewCid: this.cid
34267
  };
34268
  },
34269
  constructor: function() {
34339
  easing: easing,
34340
  complete: function() {
34341
  promise.resolve();
34342
+ }.bind(this)
34343
  }
34344
  ).velocity(
34345
  fadeDirection,
34346
  {
34347
  duration: 250,
34348
  easing: easing,
34349
+ queue: false // Do not enqueue, trigger animation in parallel
34350
  }
34351
  );
34352
 
34353
  return promise;
34354
+ }
34355
  });
34356
 
34357
  Module.BlockToolsView = AugmentedView.extend({
34361
  "click .mailpoet_delete_block_activate": "showDeletionConfirmation",
34362
  "click .mailpoet_delete_block_cancel": "hideDeletionConfirmation",
34363
  "click .mailpoet_delete_block_confirm": "deleteBlock",
34364
+ "click .mailpoet_duplicate_block": "duplicateBlock"
34365
  },
34366
  // Markers of whether these particular tools will be used for this instance
34367
  tools: {
34368
  settings: true,
34369
  delete: true,
34370
  duplicate: true,
34371
+ move: true
34372
  },
34373
  getSettingsView: function() { return Module.BlockSettingsView; },
34374
  initialize: function(options) {
34386
  return {
34387
  model: this.model.toJSON(),
34388
  viewCid: this.cid,
34389
+ tools: this.tools
34390
  };
34391
  },
34392
  changeSettings: function(options) {
34408
  event.preventDefault();
34409
  this.model.trigger('duplicate');
34410
  return false;
34411
+ }
34412
  });
34413
 
34414
  Module.BlockSettingsView = Marionette.View.extend({
34415
  className: 'mailpoet_editor_settings',
34416
  behaviors: {
34417
+ ColorPickerBehavior: {}
34418
  },
34419
  initialize: function(params) {
34420
  this.model.trigger('startEditing');
34425
  width: App.getConfig().get('sidepanelWidth'),
34426
  onCancel: function() {
34427
  this.destroy();
34428
+ }.bind(this)
34429
  };
34430
  this.renderOptions = params.renderOptions || {};
34431
  if (this.renderOptions.displayFormat === 'subpanel') {
34467
  onBeforeDestroy: function() {
34468
  MailPoet.Modal.close();
34469
  this.model.trigger('stopEditing');
34470
+ }
34471
  });
34472
 
34473
  Module.WidgetView = Marionette.View.extend({
34478
  throw "Unsupported operation";
34479
  }
34480
  }
34481
+ }
34482
  });
34483
 
34484
  return Module;
34522
  // TODO: If type has no registered model, use a backup one
34523
  return new Type(block, {parse: true});
34524
  });
34525
+ }
34526
  });
34527
 
34528
  Module.ContainerBlockModel = base.BlockModel.extend({
34529
  relations: {
34530
+ blocks: BlockCollection
34531
  },
34532
  defaults: function() {
34533
  return this._getDefaults({
34535
  orientation: 'vertical',
34536
  styles: {
34537
  block: {
34538
+ backgroundColor: 'transparent'
34539
+ }
34540
  },
34541
+ blocks: new BlockCollection()
34542
  }, App.getConfig().get('blockDefaults.container'));
34543
  },
34544
  validate: function() {
34552
  // If container has any blocks - add them to a collection
34553
  if (response.type === 'container' && _.has(response, 'blocks')) {
34554
  response.blocks = new BlockCollection(response.blocks, {
34555
+ parse: true
34556
  });
34557
  }
34558
  return response;
34563
  });
34564
 
34565
  return _.flatten(models);
34566
+ }
34567
  });
34568
 
34569
  Module.ContainerBlocksView = Marionette.CollectionView.extend({
34592
  blocks: {
34593
  el: '> .mailpoet_container',
34594
  replaceElement: true
34595
+ }
34596
  }),
34597
  className: 'mailpoet_block mailpoet_container_block mailpoet_droppable_block mailpoet_droppable_layout_block',
34598
  getTemplate: function() { return templates.containerBlock; },
34599
  events: _.extend({}, base.BlockView.prototype.events, {
34600
+ "click .mailpoet_newsletter_layer_selector": "toggleEditingLayer"
34601
  }),
34602
  ui: {
34603
  tools: '> .mailpoet_tools'
34629
  // Attach Draggable only to layout containers and disable it
34630
  // for root and column containers.
34631
  return view.renderOptions.depth === 1;
34632
+ }
34633
+ }
34634
  }),
34635
  onDragSubstituteBy: function() {
34636
  // For two and three column layouts display their respective widgets,
34655
  delete: this.renderOptions.depth === 1,
34656
  duplicate: true,
34657
  move: this.renderOptions.depth === 1,
34658
+ layerSelector: false
34659
+ }
34660
  });
34661
  this.showChildView('toolsRegion', this.toolsView);
34662
  this.showChildView('blocks', new Module.ContainerBlocksView({
34705
  enableContainerLayer();
34706
  }
34707
  event.stopPropagation();
34708
+ }
34709
  });
34710
 
34711
  Module.ContainerBlockEmptyView = Marionette.View.extend({
34716
  templateContext: function() {
34717
  return {
34718
  isRoot: this.renderOptions.depth === 0,
34719
+ emptyContainerMessage: this.renderOptions.emptyContainerMessage || ''
34720
  };
34721
+ }
34722
  });
34723
 
34724
  Module.ContainerBlockToolsView = base.BlockToolsView.extend({
34725
+ getSettingsView: function() { return Module.ContainerBlockSettingsView; }
34726
  });
34727
 
34728
  Module.ContainerBlockSettingsView = base.BlockSettingsView.extend({
34730
  events: function() {
34731
  return {
34732
  "change .mailpoet_field_container_background_color": _.partial(this.changeColorField, "styles.block.backgroundColor"),
34733
+ "click .mailpoet_done_editing": "close"
34734
  };
34735
  },
34736
  regions: {
34737
+ columnsSettingsRegion: '.mailpoet_container_columns_settings'
34738
  },
34739
  initialize: function() {
34740
  base.BlockSettingsView.prototype.initialize.apply(this, arguments);
34741
 
34742
  this._columnsSettingsView = new (Module.ContainerBlockColumnsSettingsView)({
34743
+ collection: this.model.get('blocks')
34744
  });
34745
  },
34746
  onRender: function() {
34747
  this.showChildView('columnsSettingsRegion', this._columnsSettingsView);
34748
+ }
34749
  });
34750
 
34751
  Module.ContainerBlockColumnsSettingsView = Marionette.CollectionView.extend({
34752
  childView: function() { return Module.ContainerBlockColumnSettingsView; },
34753
  childViewOptions: function(model, index) {
34754
  return {
34755
+ columnIndex: index
34756
  };
34757
+ }
34758
  });
34759
 
34760
  Module.ContainerBlockColumnSettingsView = Marionette.View.extend({
34765
  templateContext: function() {
34766
  return {
34767
  model: this.model.toJSON(),
34768
+ columnNumber: this.columnNumber
34769
  };
34770
+ }
34771
  });
34772
 
34773
  Module.OneColumnContainerWidgetView = base.WidgetView.extend({
34780
  return new Module.ContainerBlockModel({
34781
  orientation: 'horizontal',
34782
  blocks: [
34783
+ new Module.ContainerBlockModel()
34784
  ]
34785
  });
34786
  }
34787
  }
34788
+ }
34789
  });
34790
 
34791
  Module.TwoColumnContainerWidgetView = base.WidgetView.extend({
34799
  orientation: 'horizontal',
34800
  blocks: [
34801
  new Module.ContainerBlockModel(),
34802
+ new Module.ContainerBlockModel()
34803
  ]
34804
  });
34805
  }
34806
  }
34807
+ }
34808
  });
34809
 
34810
  Module.ThreeColumnContainerWidgetView = base.WidgetView.extend({
34819
  blocks: [
34820
  new Module.ContainerBlockModel(),
34821
  new Module.ContainerBlockModel(),
34822
+ new Module.ContainerBlockModel()
34823
  ]
34824
  });
34825
  }
34826
  }
34827
+ }
34828
  });
34829
 
34830
  App.on('before:start', function(App, options) {
34831
  App.registerBlockType('container', {
34832
  blockModel: Module.ContainerBlockModel,
34833
+ blockView: Module.ContainerBlockView
34834
  });
34835
 
34836
  App.registerLayoutWidget({
34837
  name: 'oneColumnLayout',
34838
  priority: 100,
34839
+ widgetView: Module.OneColumnContainerWidgetView
34840
  });
34841
 
34842
  App.registerLayoutWidget({
34843
  name: 'twoColumnLayout',
34844
  priority: 100,
34845
+ widgetView: Module.TwoColumnContainerWidgetView
34846
  });
34847
 
34848
  App.registerLayoutWidget({
34849
  name: 'threeColumnLayout',
34850
  priority: 100,
34851
+ widgetView: Module.ThreeColumnContainerWidgetView
34852
  });
34853
  });
34854
 
34896
  fontFamily: 'Arial',
34897
  fontSize: '16px',
34898
  fontWeight: 'normal', // 'normal'|'bold'
34899
+ textAlign: 'center'
34900
+ }
34901
+ }
34902
  }, App.getConfig().get('blockDefaults.button'));
34903
+ }
34904
  });
34905
 
34906
  Module.ButtonBlockView = base.BlockView.extend({
34908
  getTemplate: function() { return templates.buttonBlock; },
34909
  onDragSubstituteBy: function() { return Module.ButtonWidgetView; },
34910
  behaviors: _.extend({}, base.BlockView.prototype.behaviors, {
34911
+ ShowSettingsBehavior: {}
34912
  }),
34913
  initialize: function() {
34914
  base.BlockView.prototype.initialize.apply(this, arguments);
34920
  onRender: function() {
34921
  this.toolsView = new Module.ButtonBlockToolsView({ model: this.model });
34922
  this.showChildView('toolsRegion', this.toolsView);
34923
+ }
34924
  });
34925
 
34926
  Module.ButtonBlockToolsView = base.BlockToolsView.extend({
34927
+ getSettingsView: function() { return Module.ButtonBlockSettingsView; }
34928
  });
34929
 
34930
  Module.ButtonBlockSettingsView = base.BlockSettingsView.extend({
34958
  "input .mailpoet_field_button_line_height_input": _.partial(this.updateValueAndCall, '.mailpoet_field_button_line_height', _.partial(this.changePixelField, "styles.block.lineHeight").bind(this)),
34959
 
34960
  "click .mailpoet_field_button_replace_all_styles": "applyToAll",
34961
+ "click .mailpoet_done_editing": "close"
34962
  };
34963
  },
34964
  templateContext: function() {
34965
  return _.extend({}, base.BlockView.prototype.templateContext.apply(this, arguments), {
34966
  availableStyles: App.getAvailableStyles().toJSON(),
34967
+ renderOptions: this.renderOptions
34968
  });
34969
  },
34970
  applyToAll: function() {
34990
  cloneOriginal: true,
34991
  drop: function() {
34992
  return new Module.ButtonBlockModel();
34993
+ }
34994
  }
34995
+ }
34996
  });
34997
 
34998
  App.on('before:start', function(App, options) {
34999
  App.registerBlockType('button', {
35000
  blockModel: Module.ButtonBlockModel,
35001
+ blockView: Module.ButtonBlockView
35002
  });
35003
 
35004
  App.registerWidget({
35005
  name: 'button',
35006
  widgetView: Module.ButtonWidgetView,
35007
+ priority: 92
35008
  });
35009
  });
35010
 
35044
  height: '64px',
35045
  styles: {
35046
  block: {
35047
+ textAlign: 'center'
35048
+ }
35049
+ }
35050
  }, App.getConfig().get('blockDefaults.image'));
35051
+ }
35052
  });
35053
 
35054
  Module.ImageBlockView = base.BlockView.extend({
35057
  onDragSubstituteBy: function() { return Module.ImageWidgetView; },
35058
  templateContext: function() {
35059
  return _.extend({
35060
+ imageMissingSrc: App.getConfig().get('urls.imageMissing')
35061
  }, base.BlockView.prototype.templateContext.apply(this));
35062
  },
35063
  behaviors: _.extend({}, base.BlockView.prototype.behaviors, {
35064
+ ShowSettingsBehavior: {}
35065
  }),
35066
  onRender: function() {
35067
  this.toolsView = new Module.ImageBlockToolsView({ model: this.model });
35072
  } else {
35073
  this.$el.removeClass('mailpoet_full_image');
35074
  }
35075
+ }
35076
  });
35077
 
35078
  Module.ImageBlockToolsView = base.BlockToolsView.extend({
35079
+ getSettingsView: function() { return Module.ImageBlockSettingsView; }
35080
  });
35081
 
35082
  Module.ImageBlockSettingsView = base.BlockSettingsView.extend({
35089
  "change .mailpoet_field_image_full_width": _.partial(this.changeBoolCheckboxField, "fullWidth"),
35090
  "change .mailpoet_field_image_alignment": _.partial(this.changeField, "styles.block.textAlign"),
35091
  "click .mailpoet_field_image_select_another_image": "showMediaManager",
35092
+ "click .mailpoet_done_editing": "close"
35093
  };
35094
  },
35095
  initialize: function(options) {
35160
  // Update user settings when users adjust the
35161
  // attachment display settings.
35162
  displayUserSettings: false
35163
+ })
35164
  ]);
35165
 
35166
  if(wp.media.view.settings.post.featuredImageId) {
35304
  },
35305
  displaySettings: false,
35306
  button: {
35307
+ text: 'Select'
35308
+ }
35309
  }),
35310
  that = this;
35311
 
35337
  height: mainSize.height + 'px',
35338
  width: mainSize.width + 'px',
35339
  src: mainSize.url,
35340
+ alt: (attachment.get('alt') !== "" && attachment.get('alt') !== undefined) ? attachment.get('alt') : attachment.get('title')
35341
  });
35342
  // Rerender settings view due to changes from outside of settings view
35343
  that.render();
35365
  if (typeof this._mediaManager === 'object') {
35366
  this._mediaManager.remove();
35367
  }
35368
+ }
35369
  });
35370
 
35371
  ImageWidgetView = base.WidgetView.extend({
35378
  },
35379
  onDrop: function(options) {
35380
  options.droppedView.triggerMethod('showSettings', { showImageManager: true });
35381
+ }
35382
  }
35383
+ }
35384
  });
35385
  Module.ImageWidgetView = ImageWidgetView;
35386
 
35387
  App.on('before:start', function(App, options) {
35388
  App.registerBlockType('image', {
35389
  blockModel: Module.ImageBlockModel,
35390
+ blockView: Module.ImageBlockView
35391
  });
35392
 
35393
  App.registerWidget({
35394
  name: 'image',
35395
  widgetView: Module.ImageWidgetView,
35396
+ priority: 91
35397
  });
35398
  });
35399
 
35432
  padding: '12px',
35433
  borderStyle: 'solid',
35434
  borderWidth: '1px',
35435
+ borderColor: '#000000'
35436
+ }
35437
+ }
35438
  }, App.getConfig().get('blockDefaults.divider'));
35439
+ }
35440
  });
35441
 
35442
  Module.DividerBlockView = base.BlockView.extend({
35449
  resizeHandleSelector: '.mailpoet_resize_handle',
35450
  transformationFunction: function(y) { return y / 2; },
35451
  minLength: 0, // TODO: Move this number to editor configuration
35452
+ modelField: 'styles.block.padding'
35453
  },
35454
  ShowSettingsBehavior: {
35455
  ignoreFrom: '.mailpoet_resize_handle'
35456
+ }
35457
  }, base.BlockView.prototype.behaviors),
35458
  onDragSubstituteBy: function() { return Module.DividerWidgetView; },
35459
  initialize: function() {
35469
  },
35470
  templateContext: function() {
35471
  return _.extend({
35472
+ totalHeight: parseInt(this.model.get('styles.block.padding'), 10)*2 + parseInt(this.model.get('styles.block.borderWidth')) + 'px'
35473
  }, base.BlockView.prototype.templateContext.apply(this));
35474
  },
35475
  onRender: function() {
35484
  this.$('.mailpoet_content').css('padding-top', this.model.get('styles.block.padding'));
35485
  this.$('.mailpoet_content').css('padding-bottom', this.model.get('styles.block.padding'));
35486
  this.$('.mailpoet_resize_handle_text').text(parseInt(this.model.get('styles.block.padding'), 10)*2 + parseInt(this.model.get('styles.block.borderWidth')) + 'px');
35487
+ }
35488
  });
35489
 
35490
  Module.DividerBlockToolsView = base.BlockToolsView.extend({
35491
+ getSettingsView: function() { return Module.DividerBlockSettingsView; }
35492
  });
35493
 
35494
  Module.DividerBlockSettingsView = base.BlockSettingsView.extend({
35504
  "change .mailpoet_field_divider_border_color": _.partial(this.changeColorField, "styles.block.borderColor"),
35505
  "change .mailpoet_field_divider_background_color": _.partial(this.changeColorField, "styles.block.backgroundColor"),
35506
  "click .mailpoet_button_divider_apply_to_all": "applyToAll",
35507
+ "click .mailpoet_done_editing": "close"
35508
  };
35509
  },
35510
  modelEvents: function() {
35511
  return {
35512
+ 'change:styles.block.borderColor': 'repaintDividerStyleOptions'
35513
  };
35514
  },
35515
  templateContext: function() {
35516
  return _.extend({}, base.BlockView.prototype.templateContext.apply(this, arguments), {
35517
  availableStyles: App.getAvailableStyles().toJSON(),
35518
+ renderOptions: this.renderOptions
35519
  });
35520
  },
35521
  changeStyle: function(event) {
35533
  updateValueAndCall: function(fieldToUpdate, callable, event) {
35534
  this.$(fieldToUpdate).val(jQuery(event.target).val());
35535
  callable(event);
35536
+ }
35537
  });
35538
 
35539
  Module.DividerWidgetView = base.WidgetView.extend({
35543
  cloneOriginal: true,
35544
  drop: function() {
35545
  return new Module.DividerBlockModel();
35546
+ }
35547
  }
35548
+ }
35549
  });
35550
  App.on('before:start', function(App, options) {
35551
  App.registerBlockType('divider', {
35552
  blockModel: Module.DividerBlockModel,
35553
+ blockView: Module.DividerBlockView
35554
  });
35555
 
35556
  App.registerWidget({
35557
  name: 'divider',
35558
  widgetView: Module.DividerWidgetView,
35559
+ priority: 93
35560
  });
35561
  });
35562
 
35587
  defaults: function() {
35588
  return this._getDefaults({
35589
  type: 'text',
35590
+ text: 'Edit this to insert text'
35591
  }, App.getConfig().get('blockDefaults.text'));
35592
+ }
35593
  });
35594
 
35595
  Module.TextBlockView = base.BlockView.extend({
35607
  configurationFilter: function(originalSettings) {
35608
  return _.extend({}, originalSettings, {
35609
  mailpoet_shortcodes: App.getConfig().get('shortcodes').toJSON(),
35610
+ mailpoet_shortcodes_window_title: MailPoet.I18n.t('shortcodesWindowTitle')
35611
  });
35612
  }
35613
+ }
35614
  }),
35615
  initialize: function(options) {
35616
  base.BlockView.prototype.initialize.apply(this, arguments);
35617
 
35618
  this.renderOptions = _.defaults(options.renderOptions || {}, {
35619
+ disableTextEditor: false
35620
  });
35621
 
35622
  this.disableTextEditor = this.renderOptions.disableTextEditor;
35626
  this.toolsView = new Module.TextBlockToolsView({
35627
  model: this.model,
35628
  tools: {
35629
+ settings: false
35630
+ }
35631
  });
35632
  this.showChildView('toolsRegion', this.toolsView);
35633
  },
35641
  onTextEditorBlur: function() {
35642
  this.enableDragging();
35643
  this.enableShowingTools();
35644
+ }
35645
  });
35646
 
35647
  Module.TextBlockToolsView = base.BlockToolsView.extend({
35648
+ getSettingsView: function() { return Module.TextBlockSettingsView; }
35649
  });
35650
 
35651
  Module.TextBlockSettingsView = base.BlockSettingsView.extend({
35652
+ getTemplate: function() { return templates.textBlockSettings; }
35653
  });
35654
 
35655
  Module.TextWidgetView = base.WidgetView.extend({
35659
  cloneOriginal: true,
35660
  drop: function() {
35661
  return new Module.TextBlockModel();
35662
+ }
35663
  }
35664
+ }
35665
  });
35666
 
35667
  App.on('before:start', function(App, options) {
35668
  App.registerBlockType('text', {
35669
  blockModel: Module.TextBlockModel,
35670
+ blockView: Module.TextBlockView
35671
  });
35672
 
35673
  App.registerWidget({
35674
  name: 'text',
35675
  widgetView: Module.TextWidgetView,
35676
+ priority: 90
35677
  });
35678
  });
35679
 
35708
  styles: {
35709
  block: {
35710
  backgroundColor: 'transparent',
35711
+ height: '40px'
35712
+ }
35713
+ }
35714
  }, App.getConfig().get('blockDefaults.spacer'));
35715
+ }
35716
  });
35717
 
35718
  Module.SpacerBlockView = base.BlockView.extend({
35723
  elementSelector: '.mailpoet_spacer',
35724
  resizeHandleSelector: '.mailpoet_resize_handle',
35725
  minLength: 20, // TODO: Move this number to editor configuration
35726
+ modelField: 'styles.block.height'
35727
  },
35728
  ShowSettingsBehavior: {
35729
  ignoreFrom: '.mailpoet_resize_handle'
35730
+ }
35731
  }, base.BlockView.prototype.behaviors),
35732
  modelEvents: _.omit(base.BlockView.prototype.modelEvents, 'change'),
35733
  onDragSubstituteBy: function() { return Module.SpacerWidgetView; },
35747
  },
35748
  onBeforeDestroy: function() {
35749
  this.stopListening(this.model);
35750
+ }
35751
  });
35752
 
35753
  Module.SpacerBlockToolsView = base.BlockToolsView.extend({
35754
+ getSettingsView: function() { return Module.SpacerBlockSettingsView; }
35755
  });
35756
 
35757
  Module.SpacerBlockSettingsView = base.BlockSettingsView.extend({
35759
  events: function() {
35760
  return {
35761
  "change .mailpoet_field_spacer_background_color": _.partial(this.changeColorField, "styles.block.backgroundColor"),
35762
+ "click .mailpoet_done_editing": "close"
35763
  };
35764
+ }
35765
  });
35766
 
35767
  Module.SpacerWidgetView = base.WidgetView.extend({
35771
  cloneOriginal: true,
35772
  drop: function() {
35773
  return new Module.SpacerBlockModel();
35774
+ }
35775
  }
35776
+ }
35777
  });
35778
 
35779
  App.on('before:start', function(App, options) {
35780
  App.registerBlockType('spacer', {
35781
  blockModel: Module.SpacerBlockModel,
35782
+ blockView: Module.SpacerBlockView
35783
  });
35784
 
35785
  App.registerWidget({
35786
  name: 'spacer',
35787
  widgetView: Module.SpacerWidgetView,
35788
+ priority: 94
35789
  });
35790
  });
35791
 
35819
  text: '<a href="[link:subscription_unsubscribe_url]">Unsubscribe</a> | <a href="[link:subscription_manage_url]">Manage subscription</a><br /><b>Add your postal address here!</b>',
35820
  styles: {
35821
  block: {
35822
+ backgroundColor: 'transparent'
35823
  },
35824
  text: {
35825
  fontColor: '#000000',
35826
  fontFamily: 'Arial',
35827
  fontSize: '12px',
35828
+ textAlign: 'center'
35829
  },
35830
  link: {
35831
  fontColor: '#0000ff',
35832
+ textDecoration: 'none'
35833
+ }
35834
+ }
35835
  }, App.getConfig().get('blockDefaults.footer'));
35836
+ }
35837
  });
35838
 
35839
  Module.FooterBlockView = base.BlockView.extend({
35840
  className: "mailpoet_block mailpoet_footer_block mailpoet_droppable_block",
35841
  getTemplate: function() { return templates.footerBlock; },
35842
  modelEvents: _.extend({
35843
+ 'change:styles.block.backgroundColor change:styles.text.fontColor change:styles.text.fontFamily change:styles.text.fontSize change:styles.text.textAlign change:styles.link.fontColor change:styles.link.textDecoration': 'render'
35844
  }, _.omit(base.BlockView.prototype.modelEvents, 'change')),
35845
  behaviors: _.extend({}, base.BlockView.prototype.behaviors, {
35846
  TextEditorBehavior: {
35847
  configurationFilter: function(originalSettings) {
35848
  return _.extend({}, originalSettings, {
35849
  mailpoet_shortcodes: App.getConfig().get('shortcodes').toJSON(),
35850
+ mailpoet_shortcodes_window_title: MailPoet.I18n.t('shortcodesWindowTitle')
35851
  });
35852
  }
35853
+ }
35854
  }),
35855
  onDragSubstituteBy: function() { return Module.FooterWidgetView; },
35856
  onRender: function() {
35867
  onTextEditorBlur: function() {
35868
  this.enableDragging();
35869
  this.enableShowingTools();
35870
+ }
35871
  });
35872
 
35873
  Module.FooterBlockToolsView = base.BlockToolsView.extend({
35874
+ getSettingsView: function() { return Module.FooterBlockSettingsView; }
35875
  });
35876
 
35877
  Module.FooterBlockSettingsView = base.BlockSettingsView.extend({
35887
  },
35888
  "change .mailpoet_field_footer_background_color": _.partial(this.changeColorField, "styles.block.backgroundColor"),
35889
  "change .mailpoet_field_footer_alignment": _.partial(this.changeField, "styles.text.textAlign"),
35890
+ "click .mailpoet_done_editing": "close"
35891
  };
35892
  },
35893
  templateContext: function() {
35894
  return _.extend({}, base.BlockView.prototype.templateContext.apply(this, arguments), {
35895
+ availableStyles: App.getAvailableStyles().toJSON()
35896
  });
35897
+ }
35898
  });
35899
 
35900
  Module.FooterWidgetView = base.WidgetView.extend({
35904
  cloneOriginal: true,
35905
  drop: function() {
35906
  return new Module.FooterBlockModel();
35907
+ }
35908
  }
35909
+ }
35910
  });
35911
 
35912
  App.on('before:start', function(App, options) {
35913
  App.registerBlockType('footer', {
35914
  blockModel: Module.FooterBlockModel,
35915
+ blockView: Module.FooterBlockView
35916
  });
35917
 
35918
  App.registerWidget({
35919
  name: 'footer',
35920
  widgetView: Module.FooterWidgetView,
35921
+ priority: 99
35922
  });
35923
  });
35924
 
35952
  text: 'Display problems? <a href="[link:newsletter_view_in_browser_url]">View it in your browser</a>',
35953
  styles: {
35954
  block: {
35955
+ backgroundColor: 'transparent'
35956
  },
35957
  text: {
35958
  fontColor: '#000000',
35959
  fontFamily: 'Arial',
35960
  fontSize: '12px',
35961
+ textAlign: 'center'
35962
  },
35963
  link: {
35964
  fontColor: '#0000ff',
35965
+ textDecoration: 'underline'
35966
+ }
35967
+ }
35968
  }, App.getConfig().get('blockDefaults.header'));
35969
+ }
35970
  });
35971
 
35972
  Module.HeaderBlockView = base.BlockView.extend({
35973
  className: "mailpoet_block mailpoet_header_block mailpoet_droppable_block",
35974
  getTemplate: function() { return templates.headerBlock; },
35975
  modelEvents: _.extend({
35976
+ 'change:styles.block.backgroundColor change:styles.text.fontColor change:styles.text.fontFamily change:styles.text.fontSize change:styles.text.textAlign change:styles.link.fontColor change:styles.link.textDecoration': 'render'
35977
  }, _.omit(base.BlockView.prototype.modelEvents, 'change')),
35978
  behaviors: _.extend({}, base.BlockView.prototype.behaviors, {
35979
  TextEditorBehavior: {
35980
  configurationFilter: function(originalSettings) {
35981
  return _.extend({}, originalSettings, {
35982
  mailpoet_shortcodes: App.getConfig().get('shortcodes').toJSON(),
35983
+ mailpoet_shortcodes_window_title: MailPoet.I18n.t('shortcodesWindowTitle')
35984
  });
35985
  }
35986
+ }
35987
  }),
35988
  onDragSubstituteBy: function() { return Module.HeaderWidgetView; },
35989
  onRender: function() {
36000
  onTextEditorBlur: function() {
36001
  this.enableDragging();
36002
  this.enableShowingTools();
36003
+ }
36004
  });
36005
 
36006
  Module.HeaderBlockToolsView = base.BlockToolsView.extend({
36007
+ getSettingsView: function() { return Module.HeaderBlockSettingsView; }
36008
  });
36009
 
36010
  Module.HeaderBlockSettingsView = base.BlockSettingsView.extend({
36020
  },
36021
  "change .mailpoet_field_header_background_color": _.partial(this.changeColorField, "styles.block.backgroundColor"),
36022
  "change .mailpoet_field_header_alignment": _.partial(this.changeField, "styles.text.textAlign"),
36023
+ "click .mailpoet_done_editing": "close"
36024
  };
36025
  },
36026
  templateContext: function() {
36027
  return _.extend({}, base.BlockView.prototype.templateContext.apply(this, arguments), {
36028
+ availableStyles: App.getAvailableStyles().toJSON()
36029
  });
36030
+ }
36031
  });
36032
 
36033
  Module.HeaderWidgetView = base.WidgetView.extend({
36037
  cloneOriginal: true,
36038
  drop: function() {
36039
  return new Module.HeaderBlockModel();
36040
+ }
36041
  }
36042
+ }
36043
  });
36044
 
36045
  App.on('before:start', function(App, options) {
36046
  App.registerBlockType('header', {
36047
  blockModel: Module.HeaderBlockModel,
36048
+ blockView: Module.HeaderBlockView
36049
  });
36050
 
36051
  App.registerWidget({
36052
  name: 'header',
36053
  widgetView: Module.HeaderWidgetView,
36054
+ priority: 98
36055
  });
36056
  });
36057
 
36119
  });
36120
 
36121
  CommunicationComponent.getBulkTransformedPosts({
36122
+ blocks: blocks
36123
  }).then(_.partial(this.refreshBlocks, models));
36124
  },
36125
  refreshBlocks: function(models, renderedBlocks) {
36131
  model.trigger('refreshPosts', contents);
36132
  }
36133
  );
36134
+ }
36135
  });
36136
 
36137
  Module.AutomatedLatestContentBlockModel = base.BlockModel.extend({
36163
  sortBy: 'newest', // 'newest'|'oldest',
36164
  showDivider: true, // true|false
36165
  divider: {},
36166
+ _container: new (App.getBlockTypeModel('container'))()
36167
  }, App.getConfig().get('blockDefaults.automatedLatestContent'));
36168
  },
36169
  relations: function() {
36170
  return {
36171
  readMoreButton: App.getBlockTypeModel('button'),
36172
  divider: App.getBlockTypeModel('divider'),
36173
+ _container: App.getBlockTypeModel('container')
36174
  };
36175
  },
36176
  initialize: function() {
36190
  */
36191
  _scheduleFetchPosts: function() {
36192
  App.getChannel().trigger('automatedLatestContentRefresh');
36193
+ }
36194
  });
36195
 
36196
  Module.AutomatedLatestContentBlockView = base.BlockView.extend({
36204
  getTemplate: function() { return templates.automatedLatestContentBlock; },
36205
  regions: {
36206
  toolsRegion: '.mailpoet_tools',
36207
+ postsRegion: '.mailpoet_automated_latest_content_block_posts'
36208
  },
36209
  modelEvents: _.extend(
36210
  _.omit(base.BlockView.prototype.modelEvents, 'change'),
36211
  {
36212
+ 'postsChanged': 'render'
36213
  }),
36214
  events: _.extend(base.BlockView.prototype.events, {
36215
+ 'click .mailpoet_automated_latest_content_block_overlay': 'showSettings'
36216
  }),
36217
  onDragSubstituteBy: function() { return Module.AutomatedLatestContentWidgetView; },
36218
  onRender: function() {
36220
  renderOptions = {
36221
  disableTextEditor: true,
36222
  disableDragAndDrop: true,
36223
+ emptyContainerMessage: MailPoet.I18n.t('noPostsToDisplay')
36224
  };
36225
  this.toolsView = new Module.AutomatedLatestContentBlockToolsView({ model: this.model });
36226
  this.showChildView('toolsRegion', this.toolsView);
36227
  this.showChildView('postsRegion', new ContainerView({ model: this.model.get('_container'), renderOptions: renderOptions }));
36228
+ }
36229
  });
36230
 
36231
  Module.AutomatedLatestContentBlockToolsView = base.BlockToolsView.extend({
36232
+ getSettingsView: function() { return Module.AutomatedLatestContentBlockSettingsView; }
36233
  });
36234
 
36235
  // Sidebar view container
36258
  "input .mailpoet_automated_latest_content_categories": _.partial(this.changeField, "categoriesPrecededBy"),
36259
  "input .mailpoet_automated_latest_content_read_more_text": _.partial(this.changeField, "readMoreText"),
36260
  "change .mailpoet_automated_latest_content_sort_by": _.partial(this.changeField, "sortBy"),
36261
+ "click .mailpoet_done_editing": "close"
36262
  };
36263
  },
36264
  onRender: function() {
36313
  }
36314
  )
36315
  };
36316
+ }
36317
+ }
36318
  }).on({
36319
  'select2:select': function(event) {
36320
  var terms = that.model.get('terms');
36327
  terms.remove(event.params.data);
36328
  // Reset whole model in order for change events to propagate properly
36329
  that.model.set('terms', terms.toJSON());
36330
+ }
36331
  }).trigger( 'change' );
36332
  },
36333
  toggleDisplayOptions: function(event) {
36348
  renderOptions: {
36349
  displayFormat: 'subpanel',
36350
  hideLink: true,
36351
+ hideApplyToAll: true
36352
+ }
36353
  })).render();
36354
  },
36355
  showDividerSettings: function(event) {
36358
  model: this.model.get('divider'),
36359
  renderOptions: {
36360
  displayFormat: 'subpanel',
36361
+ hideApplyToAll: true
36362
+ }
36363
  })).render();
36364
  },
36365
  changeReadMoreType: function(event) {
36422
  _.each(postTypes, function(type) {
36423
  select.append(jQuery('<option>', {
36424
  value: type.name,
36425
+ text: type.label
36426
  }));
36427
  });
36428
  select.val(selectedValue);
36429
+ }
36430
  });
36431
 
36432
  Module.AutomatedLatestContentWidgetView = base.WidgetView.extend({
36439
  },
36440
  onDrop: function(options) {
36441
  options.droppedView.triggerMethod('showSettings');
36442
+ }
36443
  }
36444
+ }
36445
  });
36446
 
36447
  App.on('before:start', function(App, options) {
36448
  App.registerBlockType('automatedLatestContent', {
36449
  blockModel: Module.AutomatedLatestContentBlockModel,
36450
+ blockView: Module.AutomatedLatestContentBlockView
36451
  });
36452
 
36453
  App.registerWidget({
36454
  name: 'automatedLatestContent',
36455
  widgetView: Module.AutomatedLatestContentWidgetView,
36456
+ priority: 97
36457
  });
36458
  });
36459
 
36549
  divider: {},
36550
  _selectedPosts: [],
36551
  _availablePosts: [],
36552
+ _transformedPosts: new (App.getBlockTypeModel('container'))()
36553
  }, App.getConfig().get('blockDefaults.posts'));
36554
  },
36555
  relations: function() {
36558
  divider: App.getBlockTypeModel('divider'),
36559
  _selectedPosts: Backbone.Collection,
36560
  _availablePosts: Backbone.Collection,
36561
+ _transformedPosts: App.getBlockTypeModel('container')
36562
  };
36563
  },
36564
  initialize: function() {
36645
  }).fail(function() {
36646
  MailPoet.Notice.error(MailPoet.I18n.t('failedToFetchRenderedPosts'));
36647
  });
36648
+ }
36649
  });
36650
 
36651
  Module.PostsBlockView = base.BlockView.extend({
36653
  getTemplate: function() { return templates.postsBlock; },
36654
  modelEvents: {}, // Forcefully disable all events
36655
  regions: _.extend({
36656
+ postsRegion: '.mailpoet_posts_block_posts'
36657
  }, base.BlockView.prototype.regions),
36658
  onDragSubstituteBy: function() { return Module.PostsWidgetView; },
36659
  initialize: function() {
36672
  renderOptions = {
36673
  disableTextEditor: true,
36674
  disableDragAndDrop: true,
36675
+ emptyContainerMessage: MailPoet.I18n.t('noPostsToDisplay')
36676
  };
36677
  this.showChildView('postsRegion', new ContainerView({ model: this.model.get('_transformedPosts'), renderOptions: renderOptions }));
36678
  },
36681
  },
36682
  onBeforeDestroy: function() {
36683
  this.model.stopReplying('blockView', this.notifyAboutSelf, this);
36684
+ }
36685
  });
36686
 
36687
  Module.PostsBlockToolsView = base.BlockToolsView.extend({
36688
+ getSettingsView: function() { return Module.PostsBlockSettingsView; }
36689
  });
36690
 
36691
  Module.PostsBlockSettingsView = base.BlockSettingsView.extend({
36692
  getTemplate: function() { return templates.postsBlockSettings; },
36693
  regions: {
36694
  selectionRegion: '.mailpoet_settings_posts_selection',
36695
+ displayOptionsRegion: '.mailpoet_settings_posts_display_options'
36696
  },
36697
  events: {
36698
  'click .mailpoet_settings_posts_show_display_options': 'switchToDisplayOptions',
36699
  'click .mailpoet_settings_posts_show_post_selection': 'switchToPostSelection',
36700
+ 'click .mailpoet_settings_posts_insert_selected': 'insertPosts'
36701
  },
36702
  templateContext: function() {
36703
  return {
36704
+ model: this.model.toJSON()
36705
  };
36706
  },
36707
  initialize: function() {
36724
  onCancel: function() {
36725
  // Self destroy the block if the user closes settings modal
36726
  that.model.destroy();
36727
+ }
36728
  });
36729
 
36730
  // Inform child views that they have been attached to document
36753
  this.model.trigger('insertSelectedPosts');
36754
  this.model.destroy();
36755
  this.close();
36756
+ }
36757
  });
36758
 
36759
  var PostsSelectionCollectionView = Marionette.CollectionView.extend({
36762
  emptyView: function() { return EmptyPostSelectionSettingsView; },
36763
  childViewOptions: function() {
36764
  return {
36765
+ blockModel: this.blockModel
36766
  };
36767
  },
36768
  initialize: function(options) {
36769
  this.blockModel = options.blockModel;
36770
  },
36771
  events: {
36772
+ 'scroll': 'onPostsScroll'
36773
  },
36774
  onPostsScroll: function(event) {
36775
  var $postsBox = jQuery(event.target);
36777
  // Load more posts if scrolled to bottom
36778
  this.blockModel.trigger('loadMorePosts');
36779
  }
36780
+ }
36781
  });
36782
 
36783
  var PostSelectionSettingsView = Marionette.View.extend({
36784
  getTemplate: function() { return templates.postSelectionPostsBlockSettings; },
36785
  regions: {
36786
+ posts: '.mailpoet_post_selection_container'
36787
  },
36788
  events: function() {
36789
  return {
36790
  'change .mailpoet_settings_posts_content_type': _.partial(this.changeField, 'contentType'),
36791
  'change .mailpoet_posts_post_status': _.partial(this.changeField, 'postStatus'),
36792
+ 'input .mailpoet_posts_search_term': _.partial(this.changeField, 'search')
36793
  };
36794
  },
36795
  modelEvents: {
36865
  }
36866
  )
36867
  };
36868
+ }
36869
+ }
36870
  }).on({
36871
  'select2:select': function(event) {
36872
  var terms = that.model.get('terms');
36879
  terms.remove(event.params.data);
36880
  // Reset whole model in order for change events to propagate properly
36881
  that.model.set('terms', terms.toJSON());
36882
+ }
36883
  }).trigger( 'change' );
36884
  },
36885
  changeField: function(field, event) {
36893
  _.each(postTypes, function(type) {
36894
  select.append(jQuery('<option>', {
36895
  value: type.name,
36896
+ text: type.label
36897
  }));
36898
  });
36899
  select.val(selectedValue);
36900
+ }
36901
  });
36902
 
36903
  var EmptyPostSelectionSettingsView = Marionette.View.extend({
36904
+ getTemplate: function() { return templates.emptyPostPostsBlockSettings; }
36905
  });
36906
 
36907
  var SinglePostSelectionSettingsView = Marionette.View.extend({
36908
  getTemplate: function() { return templates.singlePostPostsBlockSettings; },
36909
  events: function() {
36910
  return {
36911
+ 'change .mailpoet_select_post_checkbox': 'postSelectionChange'
36912
  };
36913
  },
36914
  templateContext: function() {
36915
  return {
36916
  model: this.model.toJSON(),
36917
+ index: this._index
36918
  };
36919
  },
36920
  initialize: function(options) {
36928
  } else {
36929
  selectedPostsCollection.remove(this.model);
36930
  }
36931
+ }
36932
  });
36933
 
36934
  var PostsDisplayOptionsSettingsView = base.BlockSettingsView.extend({
36953
  "change .mailpoet_posts_show_categories": _.partial(this.changeField, "showCategories"),
36954
  "input .mailpoet_posts_categories": _.partial(this.changeField, "categoriesPrecededBy"),
36955
  "input .mailpoet_posts_read_more_text": _.partial(this.changeField, "readMoreText"),
36956
+ "change .mailpoet_posts_sort_by": _.partial(this.changeField, "sortBy")
36957
  };
36958
  },
36959
  templateContext: function() {
36960
  return {
36961
+ model: this.model.toJSON()
36962
  };
36963
  },
36964
  showButtonSettings: function(event) {
36968
  renderOptions: {
36969
  displayFormat: 'subpanel',
36970
  hideLink: true,
36971
+ hideApplyToAll: true
36972
+ }
36973
  })).render();
36974
  },
36975
  showDividerSettings: function(event) {
36978
  model: this.model.get('divider'),
36979
  renderOptions: {
36980
  displayFormat: 'subpanel',
36981
+ hideApplyToAll: true
36982
+ }
36983
  })).render();
36984
  },
36985
  changeReadMoreType: function(event) {
37033
  this.$('.mailpoet_posts_title_as_link').removeClass('mailpoet_hidden');
37034
  }
37035
  this.changeField('titleFormat', event);
37036
+ }
37037
  });
37038
 
37039
  Module.PostsWidgetView = base.WidgetView.extend({
37045
  return new Module.PostsBlockModel({}, { parse: true });
37046
  }
37047
  }
37048
+ }
37049
  });
37050
 
37051
  App.on('before:start', function(App, options) {
37052
  App.registerBlockType('posts', {
37053
  blockModel: Module.PostsBlockModel,
37054
+ blockView: Module.PostsBlockView
37055
  });
37056
 
37057
  App.registerWidget({
37058
  name: 'posts',
37059
  widgetView: Module.PostsWidgetView,
37060
+ priority: 96
37061
  });
37062
  });
37063
 
37102
  image: App.getAvailableStyles().get('socialIconSets.default.custom'),
37103
  height: '32px',
37104
  width: '32px',
37105
+ text: defaultValues.get('title')
37106
  };
37107
  },
37108
  initialize: function(options) {
37114
  this.set({
37115
  link: defaultValues.get('defaultLink'),
37116
  image: iconSet.get(that.get('iconType')),
37117
+ text: defaultValues.get('title')
37118
  });
37119
  }, this);
37120
  this.on('change', function() { App.getChannel().trigger('autoSave'); });
37121
+ }
37122
  });
37123
 
37124
  Module.SocialIconCollectionModel = Backbone.Collection.extend({
37131
  return this._getDefaults({
37132
  type: 'social',
37133
  iconSet: 'default',
37134
+ icons: new Module.SocialIconCollectionModel()
37135
  }, App.getConfig().get('blockDefaults.social'));
37136
  },
37137
  relations: {
37138
+ icons: Module.SocialIconCollectionModel
37139
  },
37140
  initialize: function() {
37141
  this.get('icons').on('add remove change', this._iconsChanged, this);
37152
  },
37153
  _iconsChanged: function() {
37154
  App.getChannel().trigger('autoSave');
37155
+ }
37156
  });
37157
 
37158
  var SocialIconView = Marionette.View.extend({
37159
  tagName: 'span',
37160
  getTemplate: function() { return templates.socialIconBlock; },
37161
  modelEvents: {
37162
+ 'change': 'render'
37163
  },
37164
  templateContext: function() {
37165
  var allIconSets = App.getAvailableStyles().get('socialIconSets');
37166
  return {
37167
  model: this.model.toJSON(),
37168
  allIconSets: allIconSets.toJSON(),
37169
+ imageMissingSrc: App.getConfig().get('urls.imageMissing')
37170
  };
37171
+ }
37172
  });
37173
 
37174
  Module.SocialIconCollectionView = Marionette.CollectionView.extend({
37175
+ childView: SocialIconView
37176
  });
37177
 
37178
  Module.SocialBlockView = base.BlockView.extend({
37185
  tools: '> .mailpoet_tools'
37186
  },
37187
  behaviors: _.extend({}, base.BlockView.prototype.behaviors, {
37188
+ ShowSettingsBehavior: {}
37189
  }),
37190
  onDragSubstituteBy: function() { return Module.SocialWidgetView; },
37191
  onRender: function() {
37194
  this.showChildView('icons', new Module.SocialIconCollectionView({
37195
  collection: this.model.get('icons')
37196
  }))
37197
+ }
37198
  });
37199
 
37200
  Module.SocialBlockToolsView = base.BlockToolsView.extend({
37201
+ getSettingsView: function() { return Module.SocialBlockSettingsView; }
37202
  });
37203
 
37204
  // Sidebar view container
37206
  getTemplate: function() { return templates.socialBlockSettings; },
37207
  regions: {
37208
  iconRegion: '#mailpoet_social_icons_selection',
37209
+ stylesRegion: '#mailpoet_social_icons_styles'
37210
  },
37211
  events: function() {
37212
  return {
37213
+ "click .mailpoet_done_editing": "close"
37214
  };
37215
  },
37216
  initialize: function() {
37234
  "change .mailpoet_social_icon_field_type": _.partial(this.changeField, "iconType"),
37235
  "input .mailpoet_social_icon_field_image": _.partial(this.changeField, "image"),
37236
  "input .mailpoet_social_icon_field_link": this.changeLink,
37237
+ "input .mailpoet_social_icon_field_text": _.partial(this.changeField, "text")
37238
  };
37239
  },
37240
  modelEvents: {
37244
  },
37245
  'change:text': function() {
37246
  this.$('.mailpoet_social_icon_image').attr('alt', this.model.get('text'));
37247
+ }
37248
  },
37249
  templateContext: function() {
37250
  var icons = App.getConfig().get('socialIcons'),
37254
  return _.extend({}, base.BlockView.prototype.templateContext.apply(this, arguments), {
37255
  iconTypes: availableIconTypes,
37256
  currentType: icons.get(this.model.get('iconType')).toJSON(),
37257
+ allIconSets: allIconSets.toJSON()
37258
  });
37259
  },
37260
  deleteIcon: function() {
37269
  },
37270
  changeField: function(field, event) {
37271
  this.model.set(field, jQuery(event.target).val());
37272
+ }
37273
  });
37274
 
37275
  SocialBlockSettingsIconCollectionView = Marionette.CollectionView.extend({
37276
  behaviors: {
37277
  SortableBehavior: {
37278
+ items: '> div'
37279
+ }
37280
  },
37281
  childViewContainer: '#mailpoet_social_icon_selector_contents',
37282
+ childView: SocialBlockSettingsIconView
37283
  });
37284
 
37285
  // Select icons section container view
37289
  'icons': '#mailpoet_social_icon_selector_contents'
37290
  },
37291
  events: {
37292
+ 'click .mailpoet_add_social_icon': 'addSocialIcon'
37293
  },
37294
  modelEvents: {
37295
+ 'change:iconSet': 'render'
37296
  },
37297
  addSocialIcon: function() {
37298
  // Add a social icon with default values
37309
  SocialBlockSettingsStylesView = Marionette.View.extend({
37310
  getTemplate: function() { return templates.socialSettingsStyles; },
37311
  modelEvents: {
37312
+ 'change': 'render'
37313
  },
37314
  events: {
37315
+ 'click .mailpoet_social_icon_set': 'changeSocialIconSet'
37316
  },
37317
  initialize: function() {
37318
  this.listenTo(this.model.get('icons'), 'add remove change', this.render);
37323
  activeSet: this.model.get('iconSet'),
37324
  socialIconSets: allIconSets.toJSON(),
37325
  availableSets: _.keys(allIconSets.toJSON()),
37326
+ availableSocialIcons: this.model.get('icons').pluck('iconType')
37327
  };
37328
  },
37329
  changeSocialIconSet: function(event) {
37331
  },
37332
  onBeforeDestroy: function() {
37333
  this.model.get('icons').off('add remove', this.render, this);
37334
+ }
37335
  });
37336
 
37337
  Module.SocialWidgetView = base.WidgetView.extend({
37351
  image: App.getAvailableStyles().get('socialIconSets.default.facebook'),
37352
  height: '32px',
37353
  width: '32px',
37354
+ text: 'Facebook'
37355
  },
37356
  {
37357
  type: 'socialIcon',
37360
  image: App.getAvailableStyles().get('socialIconSets.default.twitter'),
37361
  height: '32px',
37362
  width: '32px',
37363
+ text: 'Twitter'
37364
+ }
37365
+ ]
37366
  }, { parse: true });
37367
  }
37368
  }
37369
+ }
37370
  });
37371
 
37372
  App.on('before:start', function(App, options) {
37373
  App.registerBlockType('social', {
37374
  blockModel: Module.SocialBlockModel,
37375
+ blockView: Module.SocialBlockView
37376
  });
37377
 
37378
  App.registerWidget({
37379
  name: 'social',
37380
  widgetView: Module.SocialWidgetView,
37381
+ priority: 95
37382
  });
37383
  });
37384
 
assets/js/{public.5a1e5874.js → public.0bba05b8.js} RENAMED
@@ -1813,7 +1813,7 @@
1813
  coerce_types = { 'true': !0, 'false': !1, 'null': null };
1814
 
1815
  // Iterate over all name=value pairs.
1816
- $.each( this.serializeArray(), function(j,v){
1817
  var key = v.name,
1818
  val = v.value,
1819
  cur = obj,
1813
  coerce_types = { 'true': !0, 'false': !1, 'null': null };
1814
 
1815
  // Iterate over all name=value pairs.
1816
+ $.each( this.serializeArray(), function(j, v){
1817
  var key = v.name,
1818
  val = v.value,
1819
  cur = obj,
assets/js/{vendor.25e2ce6a.js → vendor.e62e72d5.js} RENAMED
@@ -76,7 +76,7 @@
76
  /******/ script.charset = 'utf-8';
77
  /******/ script.async = true;
78
 
79
- /******/ script.src = __webpack_require__.p + "" + ({"0":"admin","1":"admin_vendor","2":"form_editor","3":"mailpoet","4":"newsletter_editor"}[chunkId]||chunkId) + "." + {"0":"607dbf77","1":"ea8adfbb","2":"81d8f2a0","3":"5fb06233","4":"1d7ae8a6"}[chunkId] + ".chunk.js";
80
  /******/ head.appendChild(script);
81
  /******/ }
82
  /******/ };
76
  /******/ script.charset = 'utf-8';
77
  /******/ script.async = true;
78
 
79
+ /******/ script.src = __webpack_require__.p + "" + ({"0":"admin","1":"admin_vendor","2":"form_editor","3":"mailpoet","4":"newsletter_editor"}[chunkId]||chunkId) + "." + {"0":"54487ca1","1":"b4e04a53","2":"4ee01c41","3":"02188613","4":"8195eca1"}[chunkId] + ".chunk.js";
80
  /******/ head.appendChild(script);
81
  /******/ }
82
  /******/ };
lang/index.php CHANGED
@@ -1,3 +0,0 @@
1
- <?php
2
-
3
- // Silence is golden
 
 
 
lang/mailpoet-de_DE.mo DELETED
Binary file
lang/mailpoet-en_GB.mo DELETED
Binary file
lang/mailpoet-es_ES.mo DELETED
Binary file
lang/mailpoet-fa_IR.mo DELETED
Binary file
lang/mailpoet-fr_FR.mo DELETED
Binary file
lang/mailpoet-it_IT.mo DELETED
Binary file
lang/mailpoet-ja.mo DELETED
Binary file
lang/mailpoet-nl_NL.mo DELETED
Binary file
lang/mailpoet-pl_PL.mo DELETED
Binary file
lang/mailpoet-pt_BR.mo DELETED
Binary file
lang/mailpoet-pt_PT.mo DELETED
Binary file
lang/mailpoet-ru_RU.mo DELETED
Binary file
lang/mailpoet.pot CHANGED
@@ -4,7 +4,7 @@ msgid ""
4
  msgstr ""
5
  "Project-Id-Version: \n"
6
  "Report-Msgid-Bugs-To: http://support.mailpoet.com/\n"
7
- "POT-Creation-Date: 2017-07-25 12:53:09+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
@@ -1023,7 +1023,7 @@ msgstr ""
1023
  msgid "Daemon does not exist."
1024
  msgstr ""
1025
 
1026
- #: lib/Cron/Workers/SendingQueue/Tasks/Newsletter.php:168
1027
  msgid ""
1028
  "There was an error processing your newsletter during sending. If possible, "
1029
  "please contact us and report this issue."
@@ -1233,12 +1233,12 @@ msgstr ""
1233
  msgid "Please specify a type."
1234
  msgstr ""
1235
 
1236
- #: lib/Models/Form.php:93 lib/Models/Newsletter.php:649
1237
  #: lib/Models/Segment.php:133 lib/Models/Subscriber.php:342
1238
  msgid "All"
1239
  msgstr ""
1240
 
1241
- #: lib/Models/Form.php:98 lib/Models/Newsletter.php:719
1242
  #: lib/Models/Segment.php:138 lib/Models/Subscriber.php:367 views/forms.html:66
1243
  #: views/newsletters.html:77 views/segments.html:50
1244
  #: views/subscribers/subscribers.html:37
@@ -1253,34 +1253,34 @@ msgstr ""
1253
  msgid "Deleted list"
1254
  msgstr ""
1255
 
1256
- #: lib/Models/Newsletter.php:550 lib/Models/Subscriber.php:278
1257
  #: lib/Subscribers/ImportExport/Export/Export.php:170
1258
  msgid "All Lists"
1259
  msgstr ""
1260
 
1261
- #: lib/Models/Newsletter.php:661
1262
  #: views/newsletter/templates/blocks/posts/settingsSelection.hbs:12
1263
  msgid "Draft"
1264
  msgstr ""
1265
 
1266
- #: lib/Models/Newsletter.php:669
1267
  #: views/newsletter/templates/blocks/posts/settingsSelection.hbs:11
1268
  msgid "Scheduled"
1269
  msgstr ""
1270
 
1271
- #: lib/Models/Newsletter.php:677
1272
  msgid "Sending"
1273
  msgstr ""
1274
 
1275
- #: lib/Models/Newsletter.php:685
1276
  msgid "Sent"
1277
  msgstr ""
1278
 
1279
- #: lib/Models/Newsletter.php:699 views/newsletters.html:85
1280
  msgid "Active"
1281
  msgstr ""
1282
 
1283
- #: lib/Models/Newsletter.php:707
1284
  msgid "Not active"
1285
  msgstr ""
1286
 
@@ -1364,7 +1364,7 @@ msgstr ""
1364
  msgid "Bounced"
1365
  msgstr ""
1366
 
1367
- #: lib/Newsletter/Editor/PostContentManager.php:81
1368
  msgid "Click here to view media."
1369
  msgstr ""
1370
 
@@ -1641,19 +1641,19 @@ msgstr ""
1641
  msgid "Accidentally unsubscribed?"
1642
  msgstr ""
1643
 
1644
- #: lib/Twig/Functions.php:93 views/settings/mta.html:1075
1645
  msgid "every minute"
1646
  msgstr ""
1647
 
1648
- #: lib/Twig/Functions.php:94 views/settings/mta.html:1076
1649
  msgid "every %1$d minutes"
1650
  msgstr ""
1651
 
1652
- #: lib/Twig/Functions.php:95 views/settings/mta.html:1077
1653
  msgid "every hour"
1654
  msgstr ""
1655
 
1656
- #: lib/Twig/Functions.php:96 views/settings/mta.html:1078
1657
  msgid "every %1$d hours"
1658
  msgstr ""
1659
 
@@ -1847,7 +1847,7 @@ msgstr ""
1847
  #: views/newsletter/templates/blocks/posts/settingsDisplayOptions.hbs:221
1848
  #: views/premium.html:56 views/settings/advanced.html:90
1849
  #: views/settings/advanced.html:130 views/settings/bounce.html:190
1850
- #: views/settings/mta.html:589 views/settings/signup.html:34
1851
  #: views/subscribers/importExport/export.html:33
1852
  #: views/subscribers/importExport/import/step2.html:63
1853
  msgid "Yes"
@@ -1866,8 +1866,8 @@ msgstr ""
1866
  #: views/newsletter/templates/blocks/posts/settingsDisplayOptions.hbs:227
1867
  #: views/premium.html:62 views/premium.html:63 views/settings/advanced.html:101
1868
  #: views/settings/advanced.html:141 views/settings/bounce.html:148
1869
- #: views/settings/bounce.html:179 views/settings/mta.html:546
1870
- #: views/settings/mta.html:600 views/settings/signup.html:46
1871
  #: views/subscribers/importExport/export.html:38
1872
  #: views/subscribers/importExport/import/step2.html:67
1873
  msgid "No"
@@ -3299,7 +3299,7 @@ msgid ""
3299
  msgstr ""
3300
 
3301
  #: views/newsletters.html:131 views/settings/mta.html:109
3302
- #: views/settings/mta.html:655
3303
  msgid "Activate"
3304
  msgstr ""
3305
 
@@ -4140,11 +4140,11 @@ msgstr ""
4140
  msgid "Hostname"
4141
  msgstr ""
4142
 
4143
- #: views/settings/bounce.html:50 views/settings/mta.html:495
4144
  msgid "Login"
4145
  msgstr ""
4146
 
4147
- #: views/settings/bounce.html:67 views/settings/mta.html:518
4148
  msgid "Password"
4149
  msgstr ""
4150
 
@@ -4301,130 +4301,125 @@ msgid "Your web host"
4301
  msgstr ""
4302
 
4303
  #: views/settings/mta.html:221
4304
- msgid "Select your web host"
4305
  msgstr ""
4306
 
4307
- #: views/settings/mta.html:244
4308
  msgid "Sending frequency"
4309
  msgstr ""
4310
 
4311
- #: views/settings/mta.html:255
4312
  msgid "Recommended"
4313
  msgstr ""
4314
 
4315
- #: views/settings/mta.html:264
4316
  msgid "I'll set my own frequency"
4317
  msgstr ""
4318
 
4319
- #: views/settings/mta.html:288
4320
  msgid "emails"
4321
  msgstr ""
4322
 
4323
- #: views/settings/mta.html:305
4324
  msgid "recommended"
4325
  msgstr ""
4326
 
4327
- #: views/settings/mta.html:314
4328
- msgid ""
4329
- "<strong>Warning!</strong> Sending more than the recommended amount of "
4330
- "emails? You may break the terms of your web host or provider!"
4331
- msgstr ""
4332
-
4333
- #: views/settings/mta.html:316
4334
  msgid ""
4335
- "Please ask your host for the maximum number of emails you are allowed to "
4336
- "send per day."
 
4337
  msgstr ""
4338
 
4339
- #: views/settings/mta.html:330
4340
  msgid "SMTP Hostname"
4341
  msgstr ""
4342
 
4343
- #: views/settings/mta.html:333
4344
  msgid "e.g.: smtp.mydomain.com"
4345
  msgstr ""
4346
 
4347
- #: views/settings/mta.html:355
4348
  msgid "SMTP Port"
4349
  msgstr ""
4350
 
4351
- #: views/settings/mta.html:382
4352
  msgid "Region"
4353
  msgstr ""
4354
 
4355
- #: views/settings/mta.html:417
4356
  msgid "Access Key"
4357
  msgstr ""
4358
 
4359
- #: views/settings/mta.html:444
4360
  msgid "Secret Key"
4361
  msgstr ""
4362
 
4363
- #: views/settings/mta.html:471
4364
  msgid "API Key"
4365
  msgstr ""
4366
 
4367
- #: views/settings/mta.html:541
4368
  msgid "Secure Connection"
4369
  msgstr ""
4370
 
4371
- #: views/settings/mta.html:572
4372
  msgid "Authentication"
4373
  msgstr ""
4374
 
4375
- #: views/settings/mta.html:575
4376
  msgid ""
4377
  "Leave this option set to Yes. Only a tiny portion of SMTP services prefer "
4378
  "Authentication to be turned off."
4379
  msgstr ""
4380
 
4381
- #: views/settings/mta.html:614
4382
  msgid "SPF Signature (Highly recommended!)"
4383
  msgstr ""
4384
 
4385
- #: views/settings/mta.html:617
4386
  msgid ""
4387
  "This improves your delivery rate by verifying that you're allowed to send "
4388
  "emails from your domain."
4389
  msgstr ""
4390
 
4391
- #: views/settings/mta.html:622
4392
  msgid ""
4393
  "SPF is set up in your DNS. Read your host's support documentation for more "
4394
  "information."
4395
  msgstr ""
4396
 
4397
- #: views/settings/mta.html:630
4398
  msgid "Test the sending method"
4399
  msgstr ""
4400
 
4401
- #: views/settings/mta.html:644
4402
  msgid "Send a test email"
4403
  msgstr ""
4404
 
4405
- #: views/settings/mta.html:660
4406
  msgid "or Cancel"
4407
  msgstr ""
4408
 
4409
- #: views/settings/mta.html:699
4410
  msgid ""
4411
  "The email could not be sent. Make sure the option \"Email notifications\" "
4412
  "has a FROM email address in the Basics tab."
4413
  msgstr ""
4414
 
4415
- #: views/settings/mta.html:712
4416
  msgid "This is a Sending Method Test"
4417
  msgstr ""
4418
 
4419
- #: views/settings/mta.html:714 views/settings/mta.html:715
4420
  msgid "Yup, it works! You can start blasting away emails to the moon."
4421
  msgstr ""
4422
 
4423
- #: views/settings/mta.html:724
4424
  msgid "The email has been sent! Check your inbox."
4425
  msgstr ""
4426
 
4427
- #: views/settings/mta.html:770
4428
  msgid "You have selected an invalid sending method."
4429
  msgstr ""
4430
 
4
  msgstr ""
5
  "Project-Id-Version: \n"
6
  "Report-Msgid-Bugs-To: http://support.mailpoet.com/\n"
7
+ "POT-Creation-Date: 2017-08-01 16:25:22+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
1023
  msgid "Daemon does not exist."
1024
  msgstr ""
1025
 
1026
+ #: lib/Cron/Workers/SendingQueue/Tasks/Newsletter.php:175
1027
  msgid ""
1028
  "There was an error processing your newsletter during sending. If possible, "
1029
  "please contact us and report this issue."
1233
  msgid "Please specify a type."
1234
  msgstr ""
1235
 
1236
+ #: lib/Models/Form.php:93 lib/Models/Newsletter.php:640
1237
  #: lib/Models/Segment.php:133 lib/Models/Subscriber.php:342
1238
  msgid "All"
1239
  msgstr ""
1240
 
1241
+ #: lib/Models/Form.php:98 lib/Models/Newsletter.php:710
1242
  #: lib/Models/Segment.php:138 lib/Models/Subscriber.php:367 views/forms.html:66
1243
  #: views/newsletters.html:77 views/segments.html:50
1244
  #: views/subscribers/subscribers.html:37
1253
  msgid "Deleted list"
1254
  msgstr ""
1255
 
1256
+ #: lib/Models/Newsletter.php:541 lib/Models/Subscriber.php:278
1257
  #: lib/Subscribers/ImportExport/Export/Export.php:170
1258
  msgid "All Lists"
1259
  msgstr ""
1260
 
1261
+ #: lib/Models/Newsletter.php:652
1262
  #: views/newsletter/templates/blocks/posts/settingsSelection.hbs:12
1263
  msgid "Draft"
1264
  msgstr ""
1265
 
1266
+ #: lib/Models/Newsletter.php:660
1267
  #: views/newsletter/templates/blocks/posts/settingsSelection.hbs:11
1268
  msgid "Scheduled"
1269
  msgstr ""
1270
 
1271
+ #: lib/Models/Newsletter.php:668
1272
  msgid "Sending"
1273
  msgstr ""
1274
 
1275
+ #: lib/Models/Newsletter.php:676
1276
  msgid "Sent"
1277
  msgstr ""
1278
 
1279
+ #: lib/Models/Newsletter.php:690 views/newsletters.html:85
1280
  msgid "Active"
1281
  msgstr ""
1282
 
1283
+ #: lib/Models/Newsletter.php:698
1284
  msgid "Not active"
1285
  msgstr ""
1286
 
1364
  msgid "Bounced"
1365
  msgstr ""
1366
 
1367
+ #: lib/Newsletter/Editor/PostContentManager.php:82
1368
  msgid "Click here to view media."
1369
  msgstr ""
1370
 
1641
  msgid "Accidentally unsubscribed?"
1642
  msgstr ""
1643
 
1644
+ #: lib/Twig/Functions.php:93 views/settings/mta.html:1068
1645
  msgid "every minute"
1646
  msgstr ""
1647
 
1648
+ #: lib/Twig/Functions.php:94 views/settings/mta.html:1069
1649
  msgid "every %1$d minutes"
1650
  msgstr ""
1651
 
1652
+ #: lib/Twig/Functions.php:95 views/settings/mta.html:1070
1653
  msgid "every hour"
1654
  msgstr ""
1655
 
1656
+ #: lib/Twig/Functions.php:96 views/settings/mta.html:1071
1657
  msgid "every %1$d hours"
1658
  msgstr ""
1659
 
1847
  #: views/newsletter/templates/blocks/posts/settingsDisplayOptions.hbs:221
1848
  #: views/premium.html:56 views/settings/advanced.html:90
1849
  #: views/settings/advanced.html:130 views/settings/bounce.html:190
1850
+ #: views/settings/mta.html:584 views/settings/signup.html:34
1851
  #: views/subscribers/importExport/export.html:33
1852
  #: views/subscribers/importExport/import/step2.html:63
1853
  msgid "Yes"
1866
  #: views/newsletter/templates/blocks/posts/settingsDisplayOptions.hbs:227
1867
  #: views/premium.html:62 views/premium.html:63 views/settings/advanced.html:101
1868
  #: views/settings/advanced.html:141 views/settings/bounce.html:148
1869
+ #: views/settings/bounce.html:179 views/settings/mta.html:541
1870
+ #: views/settings/mta.html:595 views/settings/signup.html:46
1871
  #: views/subscribers/importExport/export.html:38
1872
  #: views/subscribers/importExport/import/step2.html:67
1873
  msgid "No"
3299
  msgstr ""
3300
 
3301
  #: views/newsletters.html:131 views/settings/mta.html:109
3302
+ #: views/settings/mta.html:650
3303
  msgid "Activate"
3304
  msgstr ""
3305
 
4140
  msgid "Hostname"
4141
  msgstr ""
4142
 
4143
+ #: views/settings/bounce.html:50 views/settings/mta.html:490
4144
  msgid "Login"
4145
  msgstr ""
4146
 
4147
+ #: views/settings/bounce.html:67 views/settings/mta.html:513
4148
  msgid "Password"
4149
  msgstr ""
4150
 
4301
  msgstr ""
4302
 
4303
  #: views/settings/mta.html:221
4304
+ msgid "Not listed (default)"
4305
  msgstr ""
4306
 
4307
+ #: views/settings/mta.html:241
4308
  msgid "Sending frequency"
4309
  msgstr ""
4310
 
4311
+ #: views/settings/mta.html:252
4312
  msgid "Recommended"
4313
  msgstr ""
4314
 
4315
+ #: views/settings/mta.html:261
4316
  msgid "I'll set my own frequency"
4317
  msgstr ""
4318
 
4319
+ #: views/settings/mta.html:285
4320
  msgid "emails"
4321
  msgstr ""
4322
 
4323
+ #: views/settings/mta.html:302
4324
  msgid "recommended"
4325
  msgstr ""
4326
 
4327
+ #: views/settings/mta.html:311
 
 
 
 
 
 
4328
  msgid ""
4329
+ "<strong>Warning!</strong> You may break the terms of your web host or "
4330
+ "provider by sending more than the recommended emails per day. Contact your "
4331
+ "host if you want to send more."
4332
  msgstr ""
4333
 
4334
+ #: views/settings/mta.html:325
4335
  msgid "SMTP Hostname"
4336
  msgstr ""
4337
 
4338
+ #: views/settings/mta.html:328
4339
  msgid "e.g.: smtp.mydomain.com"
4340
  msgstr ""
4341
 
4342
+ #: views/settings/mta.html:350
4343
  msgid "SMTP Port"
4344
  msgstr ""
4345
 
4346
+ #: views/settings/mta.html:377
4347
  msgid "Region"
4348
  msgstr ""
4349
 
4350
+ #: views/settings/mta.html:412
4351
  msgid "Access Key"
4352
  msgstr ""
4353
 
4354
+ #: views/settings/mta.html:439
4355
  msgid "Secret Key"
4356
  msgstr ""
4357
 
4358
+ #: views/settings/mta.html:466
4359
  msgid "API Key"
4360
  msgstr ""
4361
 
4362
+ #: views/settings/mta.html:536
4363
  msgid "Secure Connection"
4364
  msgstr ""
4365
 
4366
+ #: views/settings/mta.html:567
4367
  msgid "Authentication"
4368
  msgstr ""
4369
 
4370
+ #: views/settings/mta.html:570
4371
  msgid ""
4372
  "Leave this option set to Yes. Only a tiny portion of SMTP services prefer "
4373
  "Authentication to be turned off."
4374
  msgstr ""
4375
 
4376
+ #: views/settings/mta.html:609
4377
  msgid "SPF Signature (Highly recommended!)"
4378
  msgstr ""
4379
 
4380
+ #: views/settings/mta.html:612
4381
  msgid ""
4382
  "This improves your delivery rate by verifying that you're allowed to send "
4383
  "emails from your domain."
4384
  msgstr ""
4385
 
4386
+ #: views/settings/mta.html:617
4387
  msgid ""
4388
  "SPF is set up in your DNS. Read your host's support documentation for more "
4389
  "information."
4390
  msgstr ""
4391
 
4392
+ #: views/settings/mta.html:625
4393
  msgid "Test the sending method"
4394
  msgstr ""
4395
 
4396
+ #: views/settings/mta.html:639
4397
  msgid "Send a test email"
4398
  msgstr ""
4399
 
4400
+ #: views/settings/mta.html:655
4401
  msgid "or Cancel"
4402
  msgstr ""
4403
 
4404
+ #: views/settings/mta.html:695
4405
  msgid ""
4406
  "The email could not be sent. Make sure the option \"Email notifications\" "
4407
  "has a FROM email address in the Basics tab."
4408
  msgstr ""
4409
 
4410
+ #: views/settings/mta.html:708
4411
  msgid "This is a Sending Method Test"
4412
  msgstr ""
4413
 
4414
+ #: views/settings/mta.html:710 views/settings/mta.html:711
4415
  msgid "Yup, it works! You can start blasting away emails to the moon."
4416
  msgstr ""
4417
 
4418
+ #: views/settings/mta.html:720
4419
  msgid "The email has been sent! Check your inbox."
4420
  msgstr ""
4421
 
4422
+ #: views/settings/mta.html:769
4423
  msgid "You have selected an invalid sending method."
4424
  msgstr ""
4425
 
lib/API/JSON/v1/Services.php CHANGED
@@ -40,9 +40,9 @@ class Services extends APIEndpoint {
40
  $state = !empty($result['state']) ? $result['state'] : null;
41
 
42
  $success_message = null;
43
- if($state == Bridge::MAILPOET_KEY_VALID) {
44
  $success_message = __('Your MailPoet Sending Service key has been successfully validated.', 'mailpoet');
45
- } elseif($state == Bridge::MAILPOET_KEY_EXPIRING) {
46
  $success_message = sprintf(
47
  __('Your MailPoet Sending Service key expires on %s!', 'mailpoet'),
48
  $this->date_time->formatDate(strtotime($result['data']['expire_at']))
@@ -54,7 +54,7 @@ class Services extends APIEndpoint {
54
  }
55
 
56
  switch($state) {
57
- case Bridge::MAILPOET_KEY_INVALID:
58
  $error = __('Your MailPoet Sending Service key is invalid.', 'mailpoet');
59
  break;
60
  default:
40
  $state = !empty($result['state']) ? $result['state'] : null;
41
 
42
  $success_message = null;
43
+ if($state == Bridge::PREMIUM_KEY_VALID) {
44
  $success_message = __('Your MailPoet Sending Service key has been successfully validated.', 'mailpoet');
45
+ } elseif($state == Bridge::PREMIUM_KEY_EXPIRING) {
46
  $success_message = sprintf(
47
  __('Your MailPoet Sending Service key expires on %s!', 'mailpoet'),
48
  $this->date_time->formatDate(strtotime($result['data']['expire_at']))
54
  }
55
 
56
  switch($state) {
57
+ case Bridge::PREMIUM_KEY_INVALID:
58
  $error = __('Your MailPoet Sending Service key is invalid.', 'mailpoet');
59
  break;
60
  default:
lib/Config/Migrator.php CHANGED
@@ -66,7 +66,7 @@ class Migrator {
66
 
67
  function segments() {
68
  $attributes = array(
69
- 'id mediumint(9) NOT NULL AUTO_INCREMENT,',
70
  'name varchar(90) NOT NULL,',
71
  'type varchar(90) NOT NULL DEFAULT "default",',
72
  'description varchar(250) NOT NULL DEFAULT "",',
@@ -81,7 +81,7 @@ class Migrator {
81
 
82
  function settings() {
83
  $attributes = array(
84
- 'id mediumint(9) NOT NULL AUTO_INCREMENT,',
85
  'name varchar(50) NOT NULL,',
86
  'value longtext,',
87
  'created_at TIMESTAMP NULL,',
@@ -94,7 +94,7 @@ class Migrator {
94
 
95
  function customFields() {
96
  $attributes = array(
97
- 'id mediumint(9) NOT NULL AUTO_INCREMENT,',
98
  'name varchar(90) NOT NULL,',
99
  'type varchar(90) NOT NULL,',
100
  'params longtext NOT NULL,',
@@ -108,7 +108,7 @@ class Migrator {
108
 
109
  function scheduledTasks() {
110
  $attributes = array(
111
- 'id mediumint(9) NOT NULL AUTO_INCREMENT,',
112
  'type varchar(90) NULL DEFAULT NULL,',
113
  'status varchar(12) NULL DEFAULT NULL,',
114
  'priority mediumint(9) NOT NULL DEFAULT 0,',
@@ -124,8 +124,8 @@ class Migrator {
124
 
125
  function scheduledTaskSubscribers() {
126
  $attributes = array(
127
- 'task_id mediumint(9) NOT NULL,',
128
- 'subscriber_id mediumint(9) NOT NULL,',
129
  'processed int(1) NOT NULL,',
130
  'created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,',
131
  'PRIMARY KEY (task_id, subscriber_id)',
@@ -135,17 +135,17 @@ class Migrator {
135
 
136
  function sendingQueues() {
137
  $attributes = array(
138
- 'id mediumint(9) NOT NULL AUTO_INCREMENT,',
139
  'type varchar(90) NULL DEFAULT NULL,',
140
- 'newsletter_id mediumint(9) NOT NULL,',
141
  'newsletter_rendered_body longtext,',
142
  'newsletter_rendered_subject varchar(250) NULL DEFAULT NULL,',
143
  'subscribers longtext,',
144
  'status varchar(12) NULL DEFAULT NULL,',
145
  'priority mediumint(9) NOT NULL DEFAULT 0,',
146
- 'count_total mediumint(9) NOT NULL DEFAULT 0,',
147
- 'count_processed mediumint(9) NOT NULL DEFAULT 0,',
148
- 'count_to_process mediumint(9) NOT NULL DEFAULT 0,',
149
  'scheduled_at TIMESTAMP NULL,',
150
  'processed_at TIMESTAMP NULL,',
151
  'created_at TIMESTAMP NULL,',
@@ -158,7 +158,7 @@ class Migrator {
158
 
159
  function subscribers() {
160
  $attributes = array(
161
- 'id mediumint(9) NOT NULL AUTO_INCREMENT,',
162
  'wp_user_id bigint(20) NULL,',
163
  'first_name tinytext NOT NULL DEFAULT "",',
164
  'last_name tinytext NOT NULL DEFAULT "",',
@@ -179,9 +179,9 @@ class Migrator {
179
 
180
  function subscriberSegment() {
181
  $attributes = array(
182
- 'id mediumint(9) NOT NULL AUTO_INCREMENT,',
183
- 'subscriber_id mediumint(9) NOT NULL,',
184
- 'segment_id mediumint(9) NOT NULL,',
185
  'status varchar(12) NOT NULL DEFAULT "' . Subscriber::STATUS_SUBSCRIBED . '",',
186
  'created_at TIMESTAMP NULL,',
187
  'updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,',
@@ -193,9 +193,9 @@ class Migrator {
193
 
194
  function subscriberCustomField() {
195
  $attributes = array(
196
- 'id mediumint(9) NOT NULL AUTO_INCREMENT,',
197
- 'subscriber_id mediumint(9) NOT NULL,',
198
- 'custom_field_id mediumint(9) NOT NULL,',
199
  'value varchar(255) NOT NULL DEFAULT "",',
200
  'created_at TIMESTAMP NULL,',
201
  'updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,',
@@ -207,9 +207,9 @@ class Migrator {
207
 
208
  function newsletters() {
209
  $attributes = array(
210
- 'id mediumint(9) NOT NULL AUTO_INCREMENT,',
211
  'hash varchar(150) NULL DEFAULT NULL,',
212
- 'parent_id mediumint(9) NULL,',
213
  'subject varchar(250) NOT NULL DEFAULT "",',
214
  'type varchar(20) NOT NULL DEFAULT "standard",',
215
  'sender_address varchar(150) NOT NULL DEFAULT "",',
@@ -230,7 +230,7 @@ class Migrator {
230
 
231
  function newsletterTemplates() {
232
  $attributes = array(
233
- 'id mediumint(9) NOT NULL AUTO_INCREMENT,',
234
  'name varchar(250) NOT NULL,',
235
  'description varchar(250) NOT NULL,',
236
  'body LONGTEXT,',
@@ -245,7 +245,7 @@ class Migrator {
245
 
246
  function newsletterOptionFields() {
247
  $attributes = array(
248
- 'id mediumint(9) NOT NULL AUTO_INCREMENT,',
249
  'name varchar(90) NOT NULL,',
250
  'newsletter_type varchar(90) NOT NULL,',
251
  'created_at TIMESTAMP NULL,',
@@ -258,9 +258,9 @@ class Migrator {
258
 
259
  function newsletterOption() {
260
  $attributes = array(
261
- 'id mediumint(9) NOT NULL AUTO_INCREMENT,',
262
- 'newsletter_id mediumint(9) NOT NULL,',
263
- 'option_field_id mediumint(9) NOT NULL,',
264
  'value varchar(255) NOT NULL DEFAULT "",',
265
  'created_at TIMESTAMP NULL,',
266
  'updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,',
@@ -272,9 +272,9 @@ class Migrator {
272
 
273
  function newsletterSegment() {
274
  $attributes = array(
275
- 'id mediumint(9) NOT NULL AUTO_INCREMENT,',
276
- 'newsletter_id mediumint(9) NOT NULL,',
277
- 'segment_id mediumint(9) NOT NULL,',
278
  'created_at TIMESTAMP NULL,',
279
  'updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,',
280
  'PRIMARY KEY (id),',
@@ -285,9 +285,9 @@ class Migrator {
285
 
286
  function newsletterLinks() {
287
  $attributes = array(
288
- 'id mediumint(9) NOT NULL AUTO_INCREMENT,',
289
- 'newsletter_id mediumint(9) NOT NULL,',
290
- 'queue_id mediumint(9) NOT NULL,',
291
  'url varchar(255) NOT NULL,',
292
  'hash varchar(20) NOT NULL,',
293
  'created_at TIMESTAMP NULL,',
@@ -299,9 +299,9 @@ class Migrator {
299
 
300
  function newsletterPosts() {
301
  $attributes = array(
302
- 'id mediumint(9) NOT NULL AUTO_INCREMENT,',
303
- 'newsletter_id mediumint(9) NOT NULL,',
304
- 'post_id mediumint(9) NOT NULL,',
305
  'created_at TIMESTAMP NULL,',
306
  'updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,',
307
  'PRIMARY KEY (id)',
@@ -311,7 +311,7 @@ class Migrator {
311
 
312
  function forms() {
313
  $attributes = array(
314
- 'id mediumint(9) NOT NULL AUTO_INCREMENT,',
315
  'name varchar(90) NOT NULL,',
316
  'body longtext,',
317
  'settings longtext,',
@@ -326,10 +326,10 @@ class Migrator {
326
 
327
  function statisticsNewsletters() {
328
  $attributes = array(
329
- 'id mediumint(9) NOT NULL AUTO_INCREMENT,',
330
- 'newsletter_id mediumint(9) NOT NULL,',
331
- 'subscriber_id mediumint(9) NOT NULL,',
332
- 'queue_id mediumint(9) NOT NULL,',
333
  'sent_at TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,',
334
  'PRIMARY KEY (id),',
335
  'KEY newsletter_id (newsletter_id)',
@@ -339,12 +339,12 @@ class Migrator {
339
 
340
  function statisticsClicks() {
341
  $attributes = array(
342
- 'id mediumint(9) NOT NULL AUTO_INCREMENT,',
343
- 'newsletter_id mediumint(9) NOT NULL,',
344
- 'subscriber_id mediumint(9) NOT NULL,',
345
- 'queue_id mediumint(9) NOT NULL,',
346
- 'link_id mediumint(9) NOT NULL,',
347
- 'count mediumint(9) NOT NULL,',
348
  'created_at TIMESTAMP NULL,',
349
  'updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,',
350
  'PRIMARY KEY (id),',
@@ -357,10 +357,10 @@ class Migrator {
357
 
358
  function statisticsOpens() {
359
  $attributes = array(
360
- 'id mediumint(9) NOT NULL AUTO_INCREMENT,',
361
- 'newsletter_id mediumint(9) NOT NULL,',
362
- 'subscriber_id mediumint(9) NOT NULL,',
363
- 'queue_id mediumint(9) NOT NULL,',
364
  'created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,',
365
  'PRIMARY KEY (id),',
366
  'KEY newsletter_id (newsletter_id),',
@@ -372,10 +372,10 @@ class Migrator {
372
 
373
  function statisticsUnsubscribes() {
374
  $attributes = array(
375
- 'id mediumint(9) NOT NULL AUTO_INCREMENT,',
376
- 'newsletter_id mediumint(9) NOT NULL,',
377
- 'subscriber_id mediumint(9) NOT NULL,',
378
- 'queue_id mediumint(9) NOT NULL,',
379
  'created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,',
380
  'PRIMARY KEY (id),',
381
  'KEY newsletter_id (newsletter_id),',
@@ -387,9 +387,9 @@ class Migrator {
387
 
388
  function statisticsForms() {
389
  $attributes = array(
390
- 'id mediumint(9) NOT NULL AUTO_INCREMENT,',
391
- 'form_id mediumint(9) NOT NULL,',
392
- 'subscriber_id mediumint(9) NOT NULL,',
393
  'created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,',
394
  'PRIMARY KEY (id),',
395
  'UNIQUE KEY form_subscriber (form_id,subscriber_id)'
@@ -399,9 +399,9 @@ class Migrator {
399
 
400
  function mappingToExternalEntities() {
401
  $attributes = array(
402
- 'old_id mediumint(9) NOT NULL,',
403
  'type varchar(50) NOT NULL,',
404
- 'new_id mediumint(9) NOT NULL,',
405
  'created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,',
406
  'PRIMARY KEY (old_id, type),',
407
  'KEY new_id (new_id)'
66
 
67
  function segments() {
68
  $attributes = array(
69
+ 'id int(11) unsigned NOT NULL AUTO_INCREMENT,',
70
  'name varchar(90) NOT NULL,',
71
  'type varchar(90) NOT NULL DEFAULT "default",',
72
  'description varchar(250) NOT NULL DEFAULT "",',
81
 
82
  function settings() {
83
  $attributes = array(
84
+ 'id int(11) unsigned NOT NULL AUTO_INCREMENT,',
85
  'name varchar(50) NOT NULL,',
86
  'value longtext,',
87
  'created_at TIMESTAMP NULL,',
94
 
95
  function customFields() {
96
  $attributes = array(
97
+ 'id int(11) unsigned NOT NULL AUTO_INCREMENT,',
98
  'name varchar(90) NOT NULL,',
99
  'type varchar(90) NOT NULL,',
100
  'params longtext NOT NULL,',
108
 
109
  function scheduledTasks() {
110
  $attributes = array(
111
+ 'id int(11) unsigned NOT NULL AUTO_INCREMENT,',
112
  'type varchar(90) NULL DEFAULT NULL,',
113
  'status varchar(12) NULL DEFAULT NULL,',
114
  'priority mediumint(9) NOT NULL DEFAULT 0,',
124
 
125
  function scheduledTaskSubscribers() {
126
  $attributes = array(
127
+ 'task_id int(11) unsigned NOT NULL,',
128
+ 'subscriber_id int(11) unsigned NOT NULL,',
129
  'processed int(1) NOT NULL,',
130
  'created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,',
131
  'PRIMARY KEY (task_id, subscriber_id)',
135
 
136
  function sendingQueues() {
137
  $attributes = array(
138
+ 'id int(11) unsigned NOT NULL AUTO_INCREMENT,',
139
  'type varchar(90) NULL DEFAULT NULL,',
140
+ 'newsletter_id int(11) unsigned NOT NULL,',
141
  'newsletter_rendered_body longtext,',
142
  'newsletter_rendered_subject varchar(250) NULL DEFAULT NULL,',
143
  'subscribers longtext,',
144
  'status varchar(12) NULL DEFAULT NULL,',
145
  'priority mediumint(9) NOT NULL DEFAULT 0,',
146
+ 'count_total int(11) unsigned NOT NULL DEFAULT 0,',
147
+ 'count_processed int(11) unsigned NOT NULL DEFAULT 0,',
148
+ 'count_to_process int(11) unsigned NOT NULL DEFAULT 0,',
149
  'scheduled_at TIMESTAMP NULL,',
150
  'processed_at TIMESTAMP NULL,',
151
  'created_at TIMESTAMP NULL,',
158
 
159
  function subscribers() {
160
  $attributes = array(
161
+ 'id int(11) unsigned NOT NULL AUTO_INCREMENT,',
162
  'wp_user_id bigint(20) NULL,',
163
  'first_name tinytext NOT NULL DEFAULT "",',
164
  'last_name tinytext NOT NULL DEFAULT "",',
179
 
180
  function subscriberSegment() {
181
  $attributes = array(
182
+ 'id int(11) unsigned NOT NULL AUTO_INCREMENT,',
183
+ 'subscriber_id int(11) unsigned NOT NULL,',
184
+ 'segment_id int(11) unsigned NOT NULL,',
185
  'status varchar(12) NOT NULL DEFAULT "' . Subscriber::STATUS_SUBSCRIBED . '",',
186
  'created_at TIMESTAMP NULL,',
187
  'updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,',
193
 
194
  function subscriberCustomField() {
195
  $attributes = array(
196
+ 'id int(11) unsigned NOT NULL AUTO_INCREMENT,',
197
+ 'subscriber_id int(11) unsigned NOT NULL,',
198
+ 'custom_field_id int(11) unsigned NOT NULL,',
199
  'value varchar(255) NOT NULL DEFAULT "",',
200
  'created_at TIMESTAMP NULL,',
201
  'updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,',
207
 
208
  function newsletters() {
209
  $attributes = array(
210
+ 'id int(11) unsigned NOT NULL AUTO_INCREMENT,',
211
  'hash varchar(150) NULL DEFAULT NULL,',
212
+ 'parent_id int(11) unsigned NULL,',
213
  'subject varchar(250) NOT NULL DEFAULT "",',
214
  'type varchar(20) NOT NULL DEFAULT "standard",',
215
  'sender_address varchar(150) NOT NULL DEFAULT "",',
230
 
231
  function newsletterTemplates() {
232
  $attributes = array(
233
+ 'id int(11) unsigned NOT NULL AUTO_INCREMENT,',
234
  'name varchar(250) NOT NULL,',
235
  'description varchar(250) NOT NULL,',
236
  'body LONGTEXT,',
245
 
246
  function newsletterOptionFields() {
247
  $attributes = array(
248
+ 'id int(11) unsigned NOT NULL AUTO_INCREMENT,',
249
  'name varchar(90) NOT NULL,',
250
  'newsletter_type varchar(90) NOT NULL,',
251
  'created_at TIMESTAMP NULL,',
258
 
259
  function newsletterOption() {
260
  $attributes = array(
261
+ 'id int(11) unsigned NOT NULL AUTO_INCREMENT,',
262
+ 'newsletter_id int(11) unsigned NOT NULL,',
263
+ 'option_field_id int(11) unsigned NOT NULL,',
264
  'value varchar(255) NOT NULL DEFAULT "",',
265
  'created_at TIMESTAMP NULL,',
266
  'updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,',
272
 
273
  function newsletterSegment() {
274
  $attributes = array(
275
+ 'id int(11) unsigned NOT NULL AUTO_INCREMENT,',
276
+ 'newsletter_id int(11) unsigned NOT NULL,',
277
+ 'segment_id int(11) unsigned NOT NULL,',
278
  'created_at TIMESTAMP NULL,',
279
  'updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,',
280
  'PRIMARY KEY (id),',
285
 
286
  function newsletterLinks() {
287
  $attributes = array(
288
+ 'id int(11) unsigned NOT NULL AUTO_INCREMENT,',
289
+ 'newsletter_id int(11) unsigned NOT NULL,',
290
+ 'queue_id int(11) unsigned NOT NULL,',
291
  'url varchar(255) NOT NULL,',
292
  'hash varchar(20) NOT NULL,',
293
  'created_at TIMESTAMP NULL,',
299
 
300
  function newsletterPosts() {
301
  $attributes = array(
302
+ 'id int(11) unsigned NOT NULL AUTO_INCREMENT,',
303
+ 'newsletter_id int(11) unsigned NOT NULL,',
304
+ 'post_id int(11) unsigned NOT NULL,',
305
  'created_at TIMESTAMP NULL,',
306
  'updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,',
307
  'PRIMARY KEY (id)',
311
 
312
  function forms() {
313
  $attributes = array(
314
+ 'id int(11) unsigned NOT NULL AUTO_INCREMENT,',
315
  'name varchar(90) NOT NULL,',
316
  'body longtext,',
317
  'settings longtext,',
326
 
327
  function statisticsNewsletters() {
328
  $attributes = array(
329
+ 'id int(11) unsigned NOT NULL AUTO_INCREMENT,',
330
+ 'newsletter_id int(11) unsigned NOT NULL,',
331
+ 'subscriber_id int(11) unsigned NOT NULL,',
332
+ 'queue_id int(11) unsigned NOT NULL,',
333
  'sent_at TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,',
334
  'PRIMARY KEY (id),',
335
  'KEY newsletter_id (newsletter_id)',
339
 
340
  function statisticsClicks() {
341
  $attributes = array(
342
+ 'id int(11) unsigned NOT NULL AUTO_INCREMENT,',
343
+ 'newsletter_id int(11) unsigned NOT NULL,',
344
+ 'subscriber_id int(11) unsigned NOT NULL,',
345
+ 'queue_id int(11) unsigned NOT NULL,',
346
+ 'link_id int(11) unsigned NOT NULL,',
347
+ 'count int(11) unsigned NOT NULL,',
348
  'created_at TIMESTAMP NULL,',
349
  'updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,',
350
  'PRIMARY KEY (id),',
357
 
358
  function statisticsOpens() {
359
  $attributes = array(
360
+ 'id int(11) unsigned NOT NULL AUTO_INCREMENT,',
361
+ 'newsletter_id int(11) unsigned NOT NULL,',
362
+ 'subscriber_id int(11) unsigned NOT NULL,',
363
+ 'queue_id int(11) unsigned NOT NULL,',
364
  'created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,',
365
  'PRIMARY KEY (id),',
366
  'KEY newsletter_id (newsletter_id),',
372
 
373
  function statisticsUnsubscribes() {
374
  $attributes = array(
375
+ 'id int(11) unsigned NOT NULL AUTO_INCREMENT,',
376
+ 'newsletter_id int(11) unsigned NOT NULL,',
377
+ 'subscriber_id int(11) unsigned NOT NULL,',
378
+ 'queue_id int(11) unsigned NOT NULL,',
379
  'created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,',
380
  'PRIMARY KEY (id),',
381
  'KEY newsletter_id (newsletter_id),',
387
 
388
  function statisticsForms() {
389
  $attributes = array(
390
+ 'id int(11) unsigned NOT NULL AUTO_INCREMENT,',
391
+ 'form_id int(11) unsigned NOT NULL,',
392
+ 'subscriber_id int(11) unsigned NOT NULL,',
393
  'created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,',
394
  'PRIMARY KEY (id),',
395
  'UNIQUE KEY form_subscriber (form_id,subscriber_id)'
399
 
400
  function mappingToExternalEntities() {
401
  $attributes = array(
402
+ 'old_id int(11) unsigned NOT NULL,',
403
  'type varchar(50) NOT NULL,',
404
+ 'new_id int(11) unsigned NOT NULL,',
405
  'created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,',
406
  'PRIMARY KEY (old_id, type),',
407
  'KEY new_id (new_id)'
lib/Config/ServicesChecker.php CHANGED
@@ -22,7 +22,7 @@ class ServicesChecker {
22
 
23
  if(!$mss_key_specified
24
  || empty($mss_key['state'])
25
- || $mss_key['state'] == Bridge::MAILPOET_KEY_INVALID
26
  ) {
27
  if($display_error_notice) {
28
  $error = Helpers::replaceLinkTags(
@@ -33,7 +33,7 @@ class ServicesChecker {
33
  WPNotice::displayError($error);
34
  }
35
  return false;
36
- } elseif($mss_key['state'] == Bridge::MAILPOET_KEY_EXPIRING
37
  && !empty($mss_key['data']['expire_at'])
38
  ) {
39
  if($display_error_notice) {
@@ -48,7 +48,7 @@ class ServicesChecker {
48
  WPNotice::displayWarning($error);
49
  }
50
  return true;
51
- } elseif($mss_key['state'] == Bridge::MAILPOET_KEY_VALID) {
52
  return true;
53
  }
54
 
22
 
23
  if(!$mss_key_specified
24
  || empty($mss_key['state'])
25
+ || $mss_key['state'] == Bridge::PREMIUM_KEY_INVALID
26
  ) {
27
  if($display_error_notice) {
28
  $error = Helpers::replaceLinkTags(
33
  WPNotice::displayError($error);
34
  }
35
  return false;
36
+ } elseif($mss_key['state'] == Bridge::PREMIUM_KEY_EXPIRING
37
  && !empty($mss_key['data']['expire_at'])
38
  ) {
39
  if($display_error_notice) {
48
  WPNotice::displayWarning($error);
49
  }
50
  return true;
51
+ } elseif($mss_key['state'] == Bridge::PREMIUM_KEY_VALID) {
52
  return true;
53
  }
54
 
lib/Cron/Workers/SendingQueue/Tasks/Newsletter.php CHANGED
@@ -94,7 +94,13 @@ class Newsletter {
94
  // extract and save newsletter posts
95
  PostsTask::extractAndSave($rendered_newsletter, $newsletter);
96
  // update queue with the rendered and pre-processed newsletter
97
- $queue->newsletter_rendered_subject = Shortcodes::process($newsletter->subject, $newsletter, null, $queue);
 
 
 
 
 
 
98
  $queue->newsletter_rendered_body = $rendered_newsletter;
99
  $queue->save();
100
  // catch DB errors
@@ -123,6 +129,7 @@ class Newsletter {
123
  );
124
  $prepared_newsletter = ShortcodesTask::process(
125
  $prepared_newsletter,
 
126
  $newsletter,
127
  $subscriber,
128
  $queue
94
  // extract and save newsletter posts
95
  PostsTask::extractAndSave($rendered_newsletter, $newsletter);
96
  // update queue with the rendered and pre-processed newsletter
97
+ $queue->newsletter_rendered_subject = ShortcodesTask::process(
98
+ $newsletter->subject,
99
+ $rendered_newsletter['html'],
100
+ $newsletter,
101
+ null,
102
+ $queue
103
+ );
104
  $queue->newsletter_rendered_body = $rendered_newsletter;
105
  $queue->save();
106
  // catch DB errors
129
  );
130
  $prepared_newsletter = ShortcodesTask::process(
131
  $prepared_newsletter,
132
+ null,
133
  $newsletter,
134
  $subscriber,
135
  $queue
lib/Cron/Workers/SendingQueue/Tasks/Shortcodes.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  namespace MailPoet\Cron\Workers\SendingQueue\Tasks;
3
 
4
  use MailPoet\Newsletter\Shortcodes\Shortcodes as NewsletterShortcodes;
@@ -6,8 +7,8 @@ use MailPoet\Newsletter\Shortcodes\Shortcodes as NewsletterShortcodes;
6
  if(!defined('ABSPATH')) exit;
7
 
8
  class Shortcodes {
9
- static function process($content, $newsletter, $subscriber, $queue) {
10
  $shortcodes = new NewsletterShortcodes($newsletter, $subscriber, $queue);
11
- return $shortcodes->replace($content);
12
  }
13
  }
1
  <?php
2
+
3
  namespace MailPoet\Cron\Workers\SendingQueue\Tasks;
4
 
5
  use MailPoet\Newsletter\Shortcodes\Shortcodes as NewsletterShortcodes;
7
  if(!defined('ABSPATH')) exit;
8
 
9
  class Shortcodes {
10
+ static function process($content, $content_source = null, $newsletter = null, $subscriber = null, $queue = null) {
11
  $shortcodes = new NewsletterShortcodes($newsletter, $subscriber, $queue);
12
+ return $shortcodes->replace($content, $content_source);
13
  }
14
  }
lib/Models/Newsletter.php CHANGED
@@ -458,42 +458,33 @@ class Newsletter extends Model {
458
  }
459
 
460
  function getStatistics() {
461
- if($this->type === self::TYPE_WELCOME) {
462
- $where = '`queue_id` IN (SELECT `id` FROM ' . MP_SENDING_QUEUES_TABLE . '
463
- WHERE `newsletter_id` = ? AND `status` = ?)';
464
- $where_params = array($this->id, SendingQueue::STATUS_COMPLETED);
465
- } else {
466
- if($this->queue === false) {
467
- return false;
468
- } else {
469
- $where = '`queue_id` = ?';
470
- $where_params = array($this->queue['id']);
471
- }
472
  }
473
 
474
- $clicks = StatisticsClicks::selectExpr(
475
- 'COUNT(DISTINCT subscriber_id) as cnt'
476
- )
477
- ->whereRaw($where, $where_params)
478
- ->findOne();
 
479
 
480
- $opens = StatisticsOpens::selectExpr(
481
- 'COUNT(DISTINCT subscriber_id) as cnt'
482
- )
483
- ->whereRaw($where, $where_params)
484
- ->findOne();
 
 
 
 
 
 
485
 
486
- $unsubscribes = StatisticsUnsubscribes::selectExpr(
487
- 'COUNT(DISTINCT subscriber_id) as cnt'
488
- )
489
- ->whereRaw($where, $where_params)
490
- ->findOne();
491
 
492
- return array(
493
- 'clicked' => !empty($clicks->cnt) ? $clicks->cnt : 0,
494
- 'opened' => !empty($opens->cnt) ? $opens->cnt : 0,
495
- 'unsubscribed' => !empty($unsubscribes->cnt) ? $unsubscribes->cnt : 0
496
- );
497
  }
498
 
499
  static function getAnalytics() {
458
  }
459
 
460
  function getStatistics() {
461
+ if(($this->type !== self::TYPE_WELCOME) && ($this->queue === false)) {
462
+ return false;
 
 
 
 
 
 
 
 
 
463
  }
464
 
465
+ $statisticsExprs = array(
466
+ 'clicked' => StatisticsClicks::selectExpr('COUNT(DISTINCT subscriber_id) as cnt')->tableAlias("stat"),
467
+ 'opened' => StatisticsOpens::selectExpr('COUNT(DISTINCT subscriber_id) as cnt')->tableAlias("stat"),
468
+ 'unsubscribed' => StatisticsUnsubscribes::selectExpr('COUNT(DISTINCT subscriber_id) as cnt')->tableAlias("stat"),
469
+ );
470
+ $result = array();
471
 
472
+ foreach($statisticsExprs as $name => $statisticsExpr) {
473
+ if($this->type !== self::TYPE_WELCOME) {
474
+ $row = $statisticsExpr->whereRaw('`queue_id` = ?', array($this->queue['id']))->findOne();
475
+ } else {
476
+ $row = $statisticsExpr
477
+ ->join(MP_SENDING_QUEUES_TABLE, array("queue_id", "=", "qt.id"), "qt")
478
+ ->where(array(
479
+ "qt.status" => SendingQueue::STATUS_COMPLETED,
480
+ "stat.newsletter_id" => $this->id,
481
+ ))->findOne();
482
+ }
483
 
484
+ $result[$name] = !empty($row->cnt) ? $row->cnt : 0;
485
+ }
 
 
 
486
 
487
+ return $result;
 
 
 
 
488
  }
489
 
490
  static function getAnalytics() {
lib/Newsletter/Editor/PostContentManager.php CHANGED
@@ -40,10 +40,11 @@ class PostContentManager {
40
  // strip useless tags
41
  $tags_not_being_stripped = array(
42
  '<img>', '<p>', '<em>', '<span>', '<b>', '<strong>', '<i>', '<h1>',
43
- '<h2>', '<h3>', '<a>', '<ul>', '<ol>', '<li>', '<br>'
44
  );
45
  $content = strip_tags($content, implode('', $tags_not_being_stripped));
46
  $content = str_replace('<p', '<p class="' . self::WP_POST_CLASS .'"', wpautop($content));
 
47
 
48
  return $content;
49
  }
@@ -92,4 +93,4 @@ class PostContentManager {
92
  return $content;
93
  }
94
 
95
- }
40
  // strip useless tags
41
  $tags_not_being_stripped = array(
42
  '<img>', '<p>', '<em>', '<span>', '<b>', '<strong>', '<i>', '<h1>',
43
+ '<h2>', '<h3>', '<a>', '<ul>', '<ol>', '<li>', '<br>', '<blockquote>'
44
  );
45
  $content = strip_tags($content, implode('', $tags_not_being_stripped));
46
  $content = str_replace('<p', '<p class="' . self::WP_POST_CLASS .'"', wpautop($content));
47
+ $content = trim($content);
48
 
49
  return $content;
50
  }
93
  return $content;
94
  }
95
 
96
+ }
lib/Newsletter/Editor/StructureTransformer.php CHANGED
@@ -2,6 +2,7 @@
2
  namespace MailPoet\Newsletter\Editor;
3
 
4
  use pQuery;
 
5
 
6
  if(!defined('ABSPATH')) exit;
7
 
@@ -17,29 +18,22 @@ class StructureTransformer {
17
  }
18
 
19
  /**
20
- * Hoists images to root level, preserves order
21
- * and inserts tags before top ancestor
22
  */
23
- private function hoistImagesToRoot($root) {
24
  foreach($root->query('img') as $item) {
25
- $top_ancestor = $this->findTopAncestor($item);
26
  $offset = $top_ancestor->index();
27
 
28
  if($item->hasParent('a')) {
29
  $item = $item->parent;
30
  }
31
 
32
- $item->changeParent($root, $offset);
33
  }
34
  }
35
 
36
- private static function findTopAncestor($item) {
37
- while($item->parent->parent !== null) {
38
- $item = $item->parent;
39
- }
40
- return $item;
41
- }
42
-
43
  /**
44
  * Transforms HTML tags into their respective JSON objects,
45
  * turns other root children into text blocks
2
  namespace MailPoet\Newsletter\Editor;
3
 
4
  use pQuery;
5
+ use MailPoet\Util\DOM as DOMUtil;
6
 
7
  if(!defined('ABSPATH')) exit;
8
 
18
  }
19
 
20
  /**
21
+ * Hoists images to root level, preserves order by splitting neighboring
22
+ * elements and inserts tags as children of top ancestor
23
  */
24
+ protected function hoistImagesToRoot($root) {
25
  foreach($root->query('img') as $item) {
26
+ $top_ancestor = DOMUtil::findTopAncestor($item);
27
  $offset = $top_ancestor->index();
28
 
29
  if($item->hasParent('a')) {
30
  $item = $item->parent;
31
  }
32
 
33
+ DOMUtil::splitOn($item->getRoot(), $item);
34
  }
35
  }
36
 
 
 
 
 
 
 
 
37
  /**
38
  * Transforms HTML tags into their respective JSON objects,
39
  * turns other root children into text blocks
lib/Newsletter/Renderer/Columns/Renderer.php CHANGED
@@ -11,7 +11,6 @@ class Renderer {
11
  $this->getOneColumnTemplate($styles, $class) :
12
  $this->getMultipleColumnsTemplate($styles, $width, $alignment, $class);
13
  $result = array_map(function($content) use ($template) {
14
- $content = Renderer::removePaddingFromLastElement($content);
15
  return $template['content_start'] . $content . $template['content_end'];
16
  }, $columns_data);
17
  $result = implode('', $result);
@@ -79,10 +78,6 @@ class Renderer {
79
  return $template;
80
  }
81
 
82
- function removePaddingFromLastElement($element) {
83
- return preg_replace('/mailpoet_padded_bottom(?!.*mailpoet_padded_bottom)/ism', '', $element);
84
- }
85
-
86
  function getBackgroundColor($styles) {
87
  if(!isset($styles['backgroundColor'])) return false;
88
  $background_color = $styles['backgroundColor'];
11
  $this->getOneColumnTemplate($styles, $class) :
12
  $this->getMultipleColumnsTemplate($styles, $width, $alignment, $class);
13
  $result = array_map(function($content) use ($template) {
 
14
  return $template['content_start'] . $content . $template['content_end'];
15
  }, $columns_data);
16
  $result = implode('', $result);
78
  return $template;
79
  }
80
 
 
 
 
 
81
  function getBackgroundColor($styles) {
82
  if(!isset($styles['backgroundColor'])) return false;
83
  $background_color = $styles['backgroundColor'];
lib/Newsletter/Shortcodes/Categories/Newsletter.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  namespace MailPoet\Newsletter\Shortcodes\Categories;
3
 
4
  use MailPoet\Models\Newsletter as NewsletterModel;
@@ -25,7 +26,7 @@ class Newsletter {
25
  case 'post_title':
26
  preg_match_all('/data-post-id="(\d+)"/ism', $content, $posts);
27
  $post_ids = array_unique($posts[1]);
28
- $latest_post = self::getLatestWPPost($post_ids);
29
  return ($latest_post) ? $latest_post['post_title'] : false;
30
 
31
  case 'number':
@@ -44,6 +45,7 @@ class Newsletter {
44
  private static function getLatestWPPost($post_ids) {
45
  $posts = new \WP_Query(
46
  array(
 
47
  'post__in' => $post_ids,
48
  'posts_per_page' => 1,
49
  'ignore_sticky_posts' => true,
1
  <?php
2
+
3
  namespace MailPoet\Newsletter\Shortcodes\Categories;
4
 
5
  use MailPoet\Models\Newsletter as NewsletterModel;
26
  case 'post_title':
27
  preg_match_all('/data-post-id="(\d+)"/ism', $content, $posts);
28
  $post_ids = array_unique($posts[1]);
29
+ $latest_post = (!empty($post_ids)) ? self::getLatestWPPost($post_ids) : false;
30
  return ($latest_post) ? $latest_post['post_title'] : false;
31
 
32
  case 'number':
45
  private static function getLatestWPPost($post_ids) {
46
  $posts = new \WP_Query(
47
  array(
48
+ 'post_type' => get_post_types(),
49
  'post__in' => $post_ids,
50
  'posts_per_page' => 1,
51
  'ignore_sticky_posts' => true,
lib/Newsletter/Shortcodes/Shortcodes.php CHANGED
@@ -91,12 +91,18 @@ class Shortcodes {
91
  return $processed_shortcodes;
92
  }
93
 
94
- function replace($content, $categories = false) {
95
  $shortcodes = $this->extract($content, $categories);
96
  if(!$shortcodes) {
97
  return $content;
98
  }
99
- $processed_shortcodes = $this->process($shortcodes, $content);
 
 
 
 
 
 
100
  $shortcodes = array_intersect_key($shortcodes, $processed_shortcodes);
101
  return str_replace($shortcodes, $processed_shortcodes, $content);
102
  }
91
  return $processed_shortcodes;
92
  }
93
 
94
+ function replace($content, $content_source = null, $categories = null) {
95
  $shortcodes = $this->extract($content, $categories);
96
  if(!$shortcodes) {
97
  return $content;
98
  }
99
+ // if content contains only shortcodes (e.g., [newsletter:post_title]) but their processing
100
+ // depends on some other content (e.g., "post_id" inside a rendered newsletter),
101
+ // then we should use that content source when processing shortcodes
102
+ $processed_shortcodes = $this->process(
103
+ $shortcodes,
104
+ ($content_source) ? $content_source : $content
105
+ );
106
  $shortcodes = array_intersect_key($shortcodes, $processed_shortcodes);
107
  return str_replace($shortcodes, $processed_shortcodes, $content);
108
  }
lib/Services/Bridge.php CHANGED
@@ -14,12 +14,6 @@ class Bridge {
14
  const PREMIUM_KEY_SETTING_NAME = 'premium.premium_key';
15
  const PREMIUM_KEY_STATE_SETTING_NAME = 'premium.premium_key_state';
16
 
17
- const MAILPOET_KEY_VALID = 'valid';
18
- const MAILPOET_KEY_INVALID = 'invalid';
19
- const MAILPOET_KEY_EXPIRING = 'expiring';
20
-
21
- const MAILPOET_KEY_CHECK_ERROR = 'check_error';
22
-
23
  const PREMIUM_KEY_VALID = 'valid';
24
  const PREMIUM_KEY_INVALID = 'invalid';
25
  const PREMIUM_KEY_EXPIRING = 'expiring';
@@ -63,31 +57,12 @@ class Bridge {
63
  function checkMSSKey($api_key) {
64
  $this->initApi($api_key);
65
  $result = $this->api->checkMSSKey();
66
- return $this->processMSSKeyCheckResult($result);
67
- }
68
-
69
- private function processMSSKeyCheckResult(array $result) {
70
- $state_map = array(
71
- 200 => self::MAILPOET_KEY_VALID,
72
- 401 => self::MAILPOET_KEY_INVALID,
73
- 402 => self::MAILPOET_KEY_EXPIRING
74
- );
75
-
76
- if(!empty($result['code']) && isset($state_map[$result['code']])) {
77
- $key_state = $state_map[$result['code']];
78
- } else {
79
- $key_state = self::MAILPOET_KEY_CHECK_ERROR;
80
- }
81
-
82
- return $this->buildKeyState(
83
- $key_state,
84
- $result
85
- );
86
  }
87
 
88
  function storeMSSKeyAndState($key, $state) {
89
  if(empty($state['state'])
90
- || $state['state'] === self::MAILPOET_KEY_CHECK_ERROR
91
  ) {
92
  return false;
93
  }
@@ -168,8 +143,8 @@ class Bridge {
168
 
169
  function updateSubscriberCount($result) {
170
  if(!empty($result['state'])
171
- && ($result['state'] === self::MAILPOET_KEY_VALID
172
- || $result['state'] === self::MAILPOET_KEY_EXPIRING)
173
  ) {
174
  return $this->api->updateSubscriberCount(Subscriber::getTotalSubscribers());
175
  }
@@ -179,7 +154,7 @@ class Bridge {
179
  static function invalidateKey() {
180
  Setting::setValue(
181
  self::API_KEY_STATE_SETTING_NAME,
182
- array('state' => self::MAILPOET_KEY_INVALID)
183
  );
184
  }
185
 
14
  const PREMIUM_KEY_SETTING_NAME = 'premium.premium_key';
15
  const PREMIUM_KEY_STATE_SETTING_NAME = 'premium.premium_key_state';
16
 
 
 
 
 
 
 
17
  const PREMIUM_KEY_VALID = 'valid';
18
  const PREMIUM_KEY_INVALID = 'invalid';
19
  const PREMIUM_KEY_EXPIRING = 'expiring';
57
  function checkMSSKey($api_key) {
58
  $this->initApi($api_key);
59
  $result = $this->api->checkMSSKey();
60
+ return $this->processPremiumKeyCheckResult($result);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
  }
62
 
63
  function storeMSSKeyAndState($key, $state) {
64
  if(empty($state['state'])
65
+ || $state['state'] === self::PREMIUM_KEY_CHECK_ERROR
66
  ) {
67
  return false;
68
  }
143
 
144
  function updateSubscriberCount($result) {
145
  if(!empty($result['state'])
146
+ && ($result['state'] === self::PREMIUM_KEY_VALID
147
+ || $result['state'] === self::PREMIUM_KEY_EXPIRING)
148
  ) {
149
  return $this->api->updateSubscriberCount(Subscriber::getTotalSubscribers());
150
  }
154
  static function invalidateKey() {
155
  Setting::setValue(
156
  self::API_KEY_STATE_SETTING_NAME,
157
+ array('state' => self::PREMIUM_KEY_INVALID)
158
  );
159
  }
160
 
lib/Util/DOM.php ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace MailPoet\Util;
3
+ use pQuery\DomNode;
4
+
5
+ class DOM {
6
+
7
+ /**
8
+ * Splits a DOM tree around the cut element, bringing it up to bound
9
+ * ancestor and splitting left and right siblings into subtrees along
10
+ * the way, retaining order and nesting level.
11
+ */
12
+ static function splitOn(DomNode $bound, DomNode $cut_element) {
13
+ $ignore_text_and_comment_nodes = false;
14
+ for($parent = $cut_element->parent; $bound != $parent; $parent = $grandparent) {
15
+ // Clone parent node without children, but with attributes
16
+ $parent->after($parent->toString());
17
+ $right = $parent->getNextSibling($ignore_text_and_comment_nodes);
18
+ $right->clear();
19
+
20
+ while($sibling = $cut_element->getNextSibling($ignore_text_and_comment_nodes)) {
21
+ $sibling->move($right);
22
+ }
23
+
24
+ // Reattach cut_element and right siblings to grandparent
25
+ $grandparent = $parent->parent;
26
+ $index_after_parent = $parent->index() + 1;
27
+ $right->move($grandparent, $index_after_parent);
28
+ $index_after_parent = $parent->index() + 1;
29
+ $cut_element->move($grandparent, $index_after_parent);
30
+ }
31
+ }
32
+
33
+ static function findTopAncestor(DomNode $item) {
34
+ while($item->parent->parent !== null) {
35
+ $item = $item->parent;
36
+ }
37
+ return $item;
38
+ }
39
+
40
+ }
mailpoet.php CHANGED
@@ -3,10 +3,10 @@
3
  if(!defined('ABSPATH')) exit;
4
 
5
  /*
6
- * Plugin Name: MailPoet
7
- * Version: 3.0.0-beta.37.0.0
8
  * Plugin URI: http://www.mailpoet.com
9
- * Description: Create and send beautiful email newsletters, autoresponders, and post notifications without leaving WordPress. This is a beta version of our brand new plugin!
10
  * Author: MailPoet
11
  * Author URI: http://www.mailpoet.com
12
  * Requires at least: 4.6
@@ -21,7 +21,7 @@ if(!defined('ABSPATH')) exit;
21
  */
22
 
23
  $mailpoet_plugin = array(
24
- 'version' => '3.0.0-beta.37.0.0',
25
  'filename' => __FILE__,
26
  'path' => dirname(__FILE__),
27
  'autoloader' => dirname(__FILE__) . '/vendor/autoload.php',
3
  if(!defined('ABSPATH')) exit;
4
 
5
  /*
6
+ * Plugin Name: MailPoet 3 (new)
7
+ * Version: 3.0.0-rc.1.0.0
8
  * Plugin URI: http://www.mailpoet.com
9
+ * Description: Create and send newsletters, post notifications and welcome emails from your WordPress.
10
  * Author: MailPoet
11
  * Author URI: http://www.mailpoet.com
12
  * Requires at least: 4.6
21
  */
22
 
23
  $mailpoet_plugin = array(
24
+ 'version' => '3.0.0-rc.1.0.0',
25
  'filename' => __FILE__,
26
  'path' => dirname(__FILE__),
27
  'autoloader' => dirname(__FILE__) . '/vendor/autoload.php',
readme.txt CHANGED
@@ -1,14 +1,14 @@
1
- === MailPoet 3 - Beta Version ===
2
  Contributors: mailpoet, wysija
3
  Tags: newsletter, email, welcome email, post notification, autoresponder, signup, subscription, SMTP
4
  Requires at least: 4.6
5
  Tested up to: 4.8
6
- Stable tag: 3.0.0-beta.37.0.0
7
  Create and send beautiful emails and newsletters from WordPress.
8
 
9
  == Description ==
10
 
11
- Try the new MailPoet! This is a beta version of our completely new email newsletter plugin.
12
 
13
  = What's new? =
14
 
@@ -24,9 +24,9 @@ Try the new MailPoet! This is a beta version of our completely new email newslet
24
  [Test the demo](http://demo3.mailpoet.com/launch/) or [see the 2 min. video](https://vimeo.com/223581490)
25
  [vimeo https://vimeo.com/223581490]
26
 
27
- = What is a beta? =
28
 
29
- We consider this version to be a release candidate. In other words, it's pretty solid. Use [the current stable MailPoet](https://wordpress.org/plugins/wysija-newsletters/) instead of this beta version if you are not comfortable in reporting issues.
30
 
31
  * Weekly releases with bug fixes and improvements
32
  * Report bugs directly from the user interface
@@ -93,6 +93,15 @@ Our [support site](https://beta.docs.mailpoet.com) has plenty of articles. You c
93
 
94
  == Changelog ==
95
 
 
 
 
 
 
 
 
 
 
96
  = 3.0.0-beta.37.0.0 - 2017-07-25 =
97
  * Improved: we collect more informative data from those who share it with us in order to improve the plugin. You should share too!
98
  * Fixed: deleted WordPress users are removed from the WordPress Users list as well;
1
+ === MailPoet 3 (new) ===
2
  Contributors: mailpoet, wysija
3
  Tags: newsletter, email, welcome email, post notification, autoresponder, signup, subscription, SMTP
4
  Requires at least: 4.6
5
  Tested up to: 4.8
6
+ Stable tag: 3.0.0-rc.1.0.0
7
  Create and send beautiful emails and newsletters from WordPress.
8
 
9
  == Description ==
10
 
11
+ This is the release candidate of our completely new email newsletter plugin.
12
 
13
  = What's new? =
14
 
24
  [Test the demo](http://demo3.mailpoet.com/launch/) or [see the 2 min. video](https://vimeo.com/223581490)
25
  [vimeo https://vimeo.com/223581490]
26
 
27
+ = What is a release candidate? =
28
 
29
+ MailPoet version 3 is considered production ready and will soon replace version 2 officially. It's fully featured, stable and supported. We only expect minor issues. Further notes:
30
 
31
  * Weekly releases with bug fixes and improvements
32
  * Report bugs directly from the user interface
93
 
94
  == Changelog ==
95
 
96
+ = 3.0.0-rc.1.0.0 - 2017-08-01 =
97
+ * Improved: MailPoet 3 is no longer in Beta!
98
+ * Improved: blockquotes in posts are now displayed in emails; Thanks @newslines!
99
+ * Improved: a bottom padding is added to every last element of a column, except if it's full width image;
100
+ * Fixed: recommended sending limit values are properly updated when the sending method is modified;
101
+ * Fixed: welcome newsletter listings page now loads faster; Thanks Luc!
102
+ * Fixed: [newsletter:post_title] properly displays titles of custom post types; Thanks Adrian!
103
+ * Fixed: post images are displayed in expected positions; Thanks Gary!
104
+
105
  = 3.0.0-beta.37.0.0 - 2017-07-25 =
106
  * Improved: we collect more informative data from those who share it with us in order to improve the plugin. You should share too!
107
  * Fixed: deleted WordPress users are removed from the WordPress Users list as well;
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInitc1e89694b49645f6e943193c78aeabbb::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInit846cc924824f3e1e42a87e0f9f65377d::getLoader();
vendor/composer/ClassLoader.php CHANGED
@@ -55,6 +55,7 @@ class ClassLoader
55
  private $classMap = array();
56
  private $classMapAuthoritative = false;
57
  private $missingClasses = array();
 
58
 
59
  public function getPrefixes()
60
  {
@@ -271,6 +272,26 @@ class ClassLoader
271
  return $this->classMapAuthoritative;
272
  }
273
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
274
  /**
275
  * Registers this instance as an autoloader.
276
  *
@@ -313,11 +334,6 @@ class ClassLoader
313
  */
314
  public function findFile($class)
315
  {
316
- // work around for PHP 5.3.0 - 5.3.2 https://bugs.php.net/50731
317
- if ('\\' == $class[0]) {
318
- $class = substr($class, 1);
319
- }
320
-
321
  // class map lookup
322
  if (isset($this->classMap[$class])) {
323
  return $this->classMap[$class];
@@ -325,6 +341,12 @@ class ClassLoader
325
  if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
326
  return false;
327
  }
 
 
 
 
 
 
328
 
329
  $file = $this->findFileWithExtension($class, '.php');
330
 
@@ -333,6 +355,10 @@ class ClassLoader
333
  $file = $this->findFileWithExtension($class, '.hh');
334
  }
335
 
 
 
 
 
336
  if (false === $file) {
337
  // Remember that this class does not exist.
338
  $this->missingClasses[$class] = true;
@@ -348,9 +374,13 @@ class ClassLoader
348
 
349
  $first = $class[0];
350
  if (isset($this->prefixLengthsPsr4[$first])) {
351
- foreach ($this->prefixLengthsPsr4[$first] as $prefix => $length) {
352
- if (0 === strpos($class, $prefix)) {
353
- foreach ($this->prefixDirsPsr4[$prefix] as $dir) {
 
 
 
 
354
  if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) {
355
  return $file;
356
  }
55
  private $classMap = array();
56
  private $classMapAuthoritative = false;
57
  private $missingClasses = array();
58
+ private $apcuPrefix;
59
 
60
  public function getPrefixes()
61
  {
272
  return $this->classMapAuthoritative;
273
  }
274
 
275
+ /**
276
+ * APCu prefix to use to cache found/not-found classes, if the extension is enabled.
277
+ *
278
+ * @param string|null $apcuPrefix
279
+ */
280
+ public function setApcuPrefix($apcuPrefix)
281
+ {
282
+ $this->apcuPrefix = function_exists('apcu_fetch') && ini_get('apc.enabled') ? $apcuPrefix : null;
283
+ }
284
+
285
+ /**
286
+ * The APCu prefix in use, or null if APCu caching is not enabled.
287
+ *
288
+ * @return string|null
289
+ */
290
+ public function getApcuPrefix()
291
+ {
292
+ return $this->apcuPrefix;
293
+ }
294
+
295
  /**
296
  * Registers this instance as an autoloader.
297
  *
334
  */
335
  public function findFile($class)
336
  {
 
 
 
 
 
337
  // class map lookup
338
  if (isset($this->classMap[$class])) {
339
  return $this->classMap[$class];
341
  if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
342
  return false;
343
  }
344
+ if (null !== $this->apcuPrefix) {
345
+ $file = apcu_fetch($this->apcuPrefix.$class, $hit);
346
+ if ($hit) {
347
+ return $file;
348
+ }
349
+ }
350
 
351
  $file = $this->findFileWithExtension($class, '.php');
352
 
355
  $file = $this->findFileWithExtension($class, '.hh');
356
  }
357
 
358
+ if (null !== $this->apcuPrefix) {
359
+ apcu_add($this->apcuPrefix.$class, $file);
360
+ }
361
+
362
  if (false === $file) {
363
  // Remember that this class does not exist.
364
  $this->missingClasses[$class] = true;
374
 
375
  $first = $class[0];
376
  if (isset($this->prefixLengthsPsr4[$first])) {
377
+ $subPath = $class;
378
+ while (false !== $lastPos = strrpos($subPath, '\\')) {
379
+ $subPath = substr($subPath, 0, $lastPos);
380
+ $search = $subPath.'\\';
381
+ if (isset($this->prefixDirsPsr4[$search])) {
382
+ foreach ($this->prefixDirsPsr4[$search] as $dir) {
383
+ $length = $this->prefixLengthsPsr4[$first][$search];
384
  if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) {
385
  return $file;
386
  }
vendor/composer/autoload_classmap.php CHANGED
@@ -232,6 +232,7 @@ return array(
232
  'MailPoet\\Twig\\I18n' => $baseDir . '/lib/Twig/I18n.php',
233
  'MailPoet\\Util\\CSS' => $baseDir . '/lib/Util/CSS.php',
234
  'MailPoet\\Util\\ConflictResolver' => $baseDir . '/lib/Util/ConflictResolver.php',
 
235
  'MailPoet\\Util\\Helpers' => $baseDir . '/lib/Util/Helpers.php',
236
  'MailPoet\\Util\\License\\Features\\Subscribers' => $baseDir . '/lib/Util/License/Features/Subscribers.php',
237
  'MailPoet\\Util\\License\\License' => $baseDir . '/lib/Util/License/License.php',
232
  'MailPoet\\Twig\\I18n' => $baseDir . '/lib/Twig/I18n.php',
233
  'MailPoet\\Util\\CSS' => $baseDir . '/lib/Util/CSS.php',
234
  'MailPoet\\Util\\ConflictResolver' => $baseDir . '/lib/Util/ConflictResolver.php',
235
+ 'MailPoet\\Util\\DOM' => $baseDir . '/lib/Util/DOM.php',
236
  'MailPoet\\Util\\Helpers' => $baseDir . '/lib/Util/Helpers.php',
237
  'MailPoet\\Util\\License\\Features\\Subscribers' => $baseDir . '/lib/Util/License/Features/Subscribers.php',
238
  'MailPoet\\Util\\License\\License' => $baseDir . '/lib/Util/License/License.php',
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInitc1e89694b49645f6e943193c78aeabbb
6
  {
7
  private static $loader;
8
 
@@ -19,15 +19,15 @@ class ComposerAutoloaderInitc1e89694b49645f6e943193c78aeabbb
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInitc1e89694b49645f6e943193c78aeabbb', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInitc1e89694b49645f6e943193c78aeabbb', 'loadClassLoader'));
25
 
26
- $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION');
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
- call_user_func(\Composer\Autoload\ComposerStaticInitc1e89694b49645f6e943193c78aeabbb::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
@@ -48,19 +48,19 @@ class ComposerAutoloaderInitc1e89694b49645f6e943193c78aeabbb
48
  $loader->register(true);
49
 
50
  if ($useStaticLoader) {
51
- $includeFiles = Composer\Autoload\ComposerStaticInitc1e89694b49645f6e943193c78aeabbb::$files;
52
  } else {
53
  $includeFiles = require __DIR__ . '/autoload_files.php';
54
  }
55
  foreach ($includeFiles as $fileIdentifier => $file) {
56
- composerRequirec1e89694b49645f6e943193c78aeabbb($fileIdentifier, $file);
57
  }
58
 
59
  return $loader;
60
  }
61
  }
62
 
63
- function composerRequirec1e89694b49645f6e943193c78aeabbb($fileIdentifier, $file)
64
  {
65
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
66
  require $file;
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInit846cc924824f3e1e42a87e0f9f65377d
6
  {
7
  private static $loader;
8
 
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInit846cc924824f3e1e42a87e0f9f65377d', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInit846cc924824f3e1e42a87e0f9f65377d', 'loadClassLoader'));
25
 
26
+ $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
+ call_user_func(\Composer\Autoload\ComposerStaticInit846cc924824f3e1e42a87e0f9f65377d::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
48
  $loader->register(true);
49
 
50
  if ($useStaticLoader) {
51
+ $includeFiles = Composer\Autoload\ComposerStaticInit846cc924824f3e1e42a87e0f9f65377d::$files;
52
  } else {
53
  $includeFiles = require __DIR__ . '/autoload_files.php';
54
  }
55
  foreach ($includeFiles as $fileIdentifier => $file) {
56
+ composerRequire846cc924824f3e1e42a87e0f9f65377d($fileIdentifier, $file);
57
  }
58
 
59
  return $loader;
60
  }
61
  }
62
 
63
+ function composerRequire846cc924824f3e1e42a87e0f9f65377d($fileIdentifier, $file)
64
  {
65
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
66
  require $file;
vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInitc1e89694b49645f6e943193c78aeabbb
8
  {
9
  public static $files = array (
10
  '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
@@ -314,6 +314,7 @@ class ComposerStaticInitc1e89694b49645f6e943193c78aeabbb
314
  'MailPoet\\Twig\\I18n' => __DIR__ . '/../..' . '/lib/Twig/I18n.php',
315
  'MailPoet\\Util\\CSS' => __DIR__ . '/../..' . '/lib/Util/CSS.php',
316
  'MailPoet\\Util\\ConflictResolver' => __DIR__ . '/../..' . '/lib/Util/ConflictResolver.php',
 
317
  'MailPoet\\Util\\Helpers' => __DIR__ . '/../..' . '/lib/Util/Helpers.php',
318
  'MailPoet\\Util\\License\\Features\\Subscribers' => __DIR__ . '/../..' . '/lib/Util/License/Features/Subscribers.php',
319
  'MailPoet\\Util\\License\\License' => __DIR__ . '/../..' . '/lib/Util/License/License.php',
@@ -653,10 +654,10 @@ class ComposerStaticInitc1e89694b49645f6e943193c78aeabbb
653
  public static function getInitializer(ClassLoader $loader)
654
  {
655
  return \Closure::bind(function () use ($loader) {
656
- $loader->prefixLengthsPsr4 = ComposerStaticInitc1e89694b49645f6e943193c78aeabbb::$prefixLengthsPsr4;
657
- $loader->prefixDirsPsr4 = ComposerStaticInitc1e89694b49645f6e943193c78aeabbb::$prefixDirsPsr4;
658
- $loader->prefixesPsr0 = ComposerStaticInitc1e89694b49645f6e943193c78aeabbb::$prefixesPsr0;
659
- $loader->classMap = ComposerStaticInitc1e89694b49645f6e943193c78aeabbb::$classMap;
660
 
661
  }, null, ClassLoader::class);
662
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInit846cc924824f3e1e42a87e0f9f65377d
8
  {
9
  public static $files = array (
10
  '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
314
  'MailPoet\\Twig\\I18n' => __DIR__ . '/../..' . '/lib/Twig/I18n.php',
315
  'MailPoet\\Util\\CSS' => __DIR__ . '/../..' . '/lib/Util/CSS.php',
316
  'MailPoet\\Util\\ConflictResolver' => __DIR__ . '/../..' . '/lib/Util/ConflictResolver.php',
317
+ 'MailPoet\\Util\\DOM' => __DIR__ . '/../..' . '/lib/Util/DOM.php',
318
  'MailPoet\\Util\\Helpers' => __DIR__ . '/../..' . '/lib/Util/Helpers.php',
319
  'MailPoet\\Util\\License\\Features\\Subscribers' => __DIR__ . '/../..' . '/lib/Util/License/Features/Subscribers.php',
320
  'MailPoet\\Util\\License\\License' => __DIR__ . '/../..' . '/lib/Util/License/License.php',
654
  public static function getInitializer(ClassLoader $loader)
655
  {
656
  return \Closure::bind(function () use ($loader) {
657
+ $loader->prefixLengthsPsr4 = ComposerStaticInit846cc924824f3e1e42a87e0f9f65377d::$prefixLengthsPsr4;
658
+ $loader->prefixDirsPsr4 = ComposerStaticInit846cc924824f3e1e42a87e0f9f65377d::$prefixDirsPsr4;
659
+ $loader->prefixesPsr0 = ComposerStaticInit846cc924824f3e1e42a87e0f9f65377d::$prefixesPsr0;
660
+ $loader->classMap = ComposerStaticInit846cc924824f3e1e42a87e0f9f65377d::$classMap;
661
 
662
  }, null, ClassLoader::class);
663
  }
vendor/composer/installed.json CHANGED
@@ -14,7 +14,7 @@
14
  "reference": "b0c1bda3be5a35da44ba1ac28cc61c67d2ada465",
15
  "shasum": ""
16
  },
17
- "time": "2015-11-28 21:47:43",
18
  "type": "library",
19
  "installation-source": "dist",
20
  "autoload": {
@@ -55,7 +55,7 @@
55
  "require-dev": {
56
  "phpunit/phpunit": "^5.6"
57
  },
58
- "time": "2016-12-14 06:28:26",
59
  "type": "library",
60
  "installation-source": "dist",
61
  "autoload": {
@@ -116,7 +116,7 @@
116
  "j4mie/idiorm": "1.5.*",
117
  "php": ">=5.2.0"
118
  },
119
- "time": "2014-09-23 10:49:36",
120
  "type": "library",
121
  "installation-source": "dist",
122
  "autoload": {
@@ -180,7 +180,7 @@
180
  "require-dev": {
181
  "phpunit/phpunit": "~4.0|~5.0"
182
  },
183
- "time": "2017-01-23 04:29:33",
184
  "type": "library",
185
  "installation-source": "dist",
186
  "autoload": {
@@ -226,7 +226,7 @@
226
  "suggest": {
227
  "ext-mbstring": "For best performance"
228
  },
229
- "time": "2016-11-14 01:06:16",
230
  "type": "library",
231
  "extra": {
232
  "branch-alias": {
@@ -299,7 +299,7 @@
299
  "symfony/config": "",
300
  "symfony/yaml": ""
301
  },
302
- "time": "2017-03-04 12:20:59",
303
  "type": "library",
304
  "extra": {
305
  "branch-alias": {
@@ -355,7 +355,7 @@
355
  "friendsofphp/php-cs-fixer": "~2",
356
  "phpunit/phpunit": "~4.0 || ~5.0"
357
  },
358
- "time": "2017-01-16 07:55:07",
359
  "type": "library",
360
  "extra": {
361
  "branch-alias": {
@@ -408,7 +408,7 @@
408
  "require-dev": {
409
  "phpunit/phpunit": "*"
410
  },
411
- "time": "2016-07-19 19:14:21",
412
  "type": "library",
413
  "installation-source": "dist",
414
  "autoload": {
@@ -457,7 +457,7 @@
457
  "phpunit/phpunit": ">=4.0",
458
  "soundasleep/component-tests": "dev-master"
459
  },
460
- "time": "2016-06-09 04:56:16",
461
  "type": "library",
462
  "installation-source": "dist",
463
  "autoload": {
@@ -510,7 +510,7 @@
510
  "mockery/mockery": "~0.9.1",
511
  "symfony/phpunit-bridge": "~3.2"
512
  },
513
- "time": "2017-02-13 07:52:53",
514
  "type": "library",
515
  "extra": {
516
  "branch-alias": {
@@ -565,7 +565,7 @@
565
  "suggest": {
566
  "ext-xml": "For best performance"
567
  },
568
- "time": "2016-11-14 01:06:16",
569
  "type": "library",
570
  "extra": {
571
  "branch-alias": {
@@ -625,7 +625,7 @@
625
  "require-dev": {
626
  "htmlawed/htmlawed": "dev-master"
627
  },
628
- "time": "2016-01-14 20:55:00",
629
  "type": "library",
630
  "installation-source": "dist",
631
  "autoload": {
@@ -681,7 +681,7 @@
681
  "symfony/debug": "~2.7",
682
  "symfony/phpunit-bridge": "~3.2"
683
  },
684
- "time": "2017-02-27 00:07:03",
685
  "type": "library",
686
  "extra": {
687
  "branch-alias": {
14
  "reference": "b0c1bda3be5a35da44ba1ac28cc61c67d2ada465",
15
  "shasum": ""
16
  },
17
+ "time": "2015-11-28T21:47:43+00:00",
18
  "type": "library",
19
  "installation-source": "dist",
20
  "autoload": {
55
  "require-dev": {
56
  "phpunit/phpunit": "^5.6"
57
  },
58
+ "time": "2016-12-14T06:28:26+00:00",
59
  "type": "library",
60
  "installation-source": "dist",
61
  "autoload": {
116
  "j4mie/idiorm": "1.5.*",
117
  "php": ">=5.2.0"
118
  },
119
+ "time": "2014-09-23T10:49:36+00:00",
120
  "type": "library",
121
  "installation-source": "dist",
122
  "autoload": {
180
  "require-dev": {
181
  "phpunit/phpunit": "~4.0|~5.0"
182
  },
183
+ "time": "2017-01-23T04:29:33+00:00",
184
  "type": "library",
185
  "installation-source": "dist",
186
  "autoload": {
226
  "suggest": {
227
  "ext-mbstring": "For best performance"
228
  },
229
+ "time": "2016-11-14T01:06:16+00:00",
230
  "type": "library",
231
  "extra": {
232
  "branch-alias": {
299
  "symfony/config": "",
300
  "symfony/yaml": ""
301
  },
302
+ "time": "2017-03-04T12:20:59+00:00",
303
  "type": "library",
304
  "extra": {
305
  "branch-alias": {
355
  "friendsofphp/php-cs-fixer": "~2",
356
  "phpunit/phpunit": "~4.0 || ~5.0"
357
  },
358
+ "time": "2017-01-16T07:55:07+00:00",
359
  "type": "library",
360
  "extra": {
361
  "branch-alias": {
408
  "require-dev": {
409
  "phpunit/phpunit": "*"
410
  },
411
+ "time": "2016-07-19T19:14:21+00:00",
412
  "type": "library",
413
  "installation-source": "dist",
414
  "autoload": {
457
  "phpunit/phpunit": ">=4.0",
458
  "soundasleep/component-tests": "dev-master"
459
  },
460
+ "time": "2016-06-09T04:56:16+00:00",
461
  "type": "library",
462
  "installation-source": "dist",
463
  "autoload": {
510
  "mockery/mockery": "~0.9.1",
511
  "symfony/phpunit-bridge": "~3.2"
512
  },
513
+ "time": "2017-02-13T07:52:53+00:00",
514
  "type": "library",
515
  "extra": {
516
  "branch-alias": {
565
  "suggest": {
566
  "ext-xml": "For best performance"
567
  },
568
+ "time": "2016-11-14T01:06:16+00:00",
569
  "type": "library",
570
  "extra": {
571
  "branch-alias": {
625
  "require-dev": {
626
  "htmlawed/htmlawed": "dev-master"
627
  },
628
+ "time": "2016-01-14T20:55:00+00:00",
629
  "type": "library",
630
  "installation-source": "dist",
631
  "autoload": {
681
  "symfony/debug": "~2.7",
682
  "symfony/phpunit-bridge": "~3.2"
683
  },
684
+ "time": "2017-02-27T00:07:03+00:00",
685
  "type": "library",
686
  "extra": {
687
  "branch-alias": {
views/settings/mta.html CHANGED
@@ -215,10 +215,10 @@
215
 
216
  <!-- web hosts -->
217
  <option
218
- value=""
219
  data-emails="25"
220
  data-interval="5"
221
- label="<%= __('Select your web host') %>"
222
  >
223
  <% for host_key, host in hosts.web %>
224
  <option
@@ -231,9 +231,6 @@
231
  ><%= host.name %></option>
232
  <% endfor %>
233
  </select>
234
- &nbsp;
235
- <!-- website: sending frequency -->
236
- <span id="mailpoet_website_sending_frequency"></span>
237
  </p>
238
 
239
  </td>
@@ -311,9 +308,7 @@
311
  </p>
312
  <br />
313
  <p>
314
- <%= __('<strong>Warning!</strong> Sending more than the recommended amount of emails? You may break the terms of your web host or provider!') %>'
315
- <br />
316
- <%= __('Please ask your host for the maximum number of emails you are allowed to send per day.') %>
317
  </p>
318
  </div>
319
  </td>
@@ -690,6 +685,7 @@
690
 
691
  var settings = jQuery('#mailpoet_settings_form').serializeObject();
692
  var mailer = settings.mta;
 
693
  mailer.method = getMethodFromGroup($('#mta_group').val());
694
 
695
  // check that we have a from address
@@ -972,19 +968,20 @@
972
  } else {
973
  $('.mailpoet_sendgrid_field').hide();
974
  }
 
 
 
 
 
 
975
  const frequencyMethod = $('#mailpoet_sending_frequency').find('option:selected').first().val();
976
  if(frequencyMethod === "manual") {
977
  $('#mailpoet_recommended_daily_emails').hide();
 
 
978
  } else {
979
  $('#mailpoet_recommended_daily_emails').show();
980
  }
981
- var emails = method.data('emails');
982
- var interval = method.data('interval');
983
- if(val === "server") {
984
-
985
- var emails = $('#mailpoet_web_host').find('option:selected').first().data('emails');
986
- var interval = $('#mailpoet_web_host').find('option:selected').first().data('interval');
987
- }
988
  setSendingFrequency({
989
  output: '#mailpoet_recommended_daily_emails',
990
  only_daily: false,
@@ -998,6 +995,8 @@
998
  function renderHostSendingFrequency() {
999
 
1000
  var host = $(this).find('option:selected').first();
 
 
1001
  var emails =
1002
  host.data('emails') || <%= default_frequency.website.emails %>;
1003
  var interval =
@@ -1005,26 +1004,17 @@
1005
  var fields =
1006
  host.data('fields') || '';
1007
 
1008
- if(host.val() === 'manual' ) {
1009
- // set sending frequency
1010
- setSendingFrequency({
1011
- output: '#mailpoet_website_daily_emails',
1012
- only_daily: true,
1013
- emails: $('#website_frequency_emails').val(),
1014
- interval: $('#website_frequency_interval').val()
1015
- });
1016
  } else {
1017
-
1018
- $('#website_frequency_emails').val(emails);
1019
- $('#website_frequency_interval').val(interval);
1020
-
1021
- // set sending frequency
1022
  setSendingFrequency({
1023
- output: '#mailpoet_website_sending_frequency',
 
1024
  emails: emails,
1025
  interval: interval
1026
  });
1027
  }
 
1028
  $('#mta_frequency_emails').val(emails);
1029
  $('#mta_frequency_interval').val(interval);
1030
  }
215
 
216
  <!-- web hosts -->
217
  <option
218
+ value="manual"
219
  data-emails="25"
220
  data-interval="5"
221
+ label="<%= __('Not listed (default)') %>"
222
  >
223
  <% for host_key, host in hosts.web %>
224
  <option
231
  ><%= host.name %></option>
232
  <% endfor %>
233
  </select>
 
 
 
234
  </p>
235
 
236
  </td>
308
  </p>
309
  <br />
310
  <p>
311
+ <%= __('<strong>Warning!</strong> You may break the terms of your web host or provider by sending more than the recommended emails per day. Contact your host if you want to send more.') %>
 
 
312
  </p>
313
  </div>
314
  </td>
685
 
686
  var settings = jQuery('#mailpoet_settings_form').serializeObject();
687
  var mailer = settings.mta;
688
+
689
  mailer.method = getMethodFromGroup($('#mta_group').val());
690
 
691
  // check that we have a from address
968
  } else {
969
  $('.mailpoet_sendgrid_field').hide();
970
  }
971
+ var emails = method.data('emails');
972
+ var interval = method.data('interval');
973
+ if(val === "server") {
974
+ emails = $('#mailpoet_web_host').find('option:selected').first().data('emails');
975
+ interval = $('#mailpoet_web_host').find('option:selected').first().data('interval');
976
+ }
977
  const frequencyMethod = $('#mailpoet_sending_frequency').find('option:selected').first().val();
978
  if(frequencyMethod === "manual") {
979
  $('#mailpoet_recommended_daily_emails').hide();
980
+ emails = $('#other_frequency_emails').val();
981
+ interval = $('#other_frequency_interval').val();
982
  } else {
983
  $('#mailpoet_recommended_daily_emails').show();
984
  }
 
 
 
 
 
 
 
985
  setSendingFrequency({
986
  output: '#mailpoet_recommended_daily_emails',
987
  only_daily: false,
995
  function renderHostSendingFrequency() {
996
 
997
  var host = $(this).find('option:selected').first();
998
+ var frequencyType = $("#mailpoet_sending_frequency").find('option:selected').first().val();
999
+
1000
  var emails =
1001
  host.data('emails') || <%= default_frequency.website.emails %>;
1002
  var interval =
1004
  var fields =
1005
  host.data('fields') || '';
1006
 
1007
+ if (frequencyType === "manual") {
1008
+ return;
 
 
 
 
 
 
1009
  } else {
 
 
 
 
 
1010
  setSendingFrequency({
1011
+ output: '#mailpoet_recommended_daily_emails',
1012
+ only_daily: false,
1013
  emails: emails,
1014
  interval: interval
1015
  });
1016
  }
1017
+
1018
  $('#mta_frequency_emails').val(emails);
1019
  $('#mta_frequency_interval').val(interval);
1020
  }
views/update.html CHANGED
@@ -60,8 +60,8 @@
60
  <div class="feature-section one-col mailpoet_centered">
61
  <h2><%= __('Care to Give Your Opinion?') %></h2>
62
 
63
- <script type="text/javascript" charset="utf-8" src="http://static.polldaddy.com/p/9792509.js"></script>
64
- <noscript><a href="http://polldaddy.com/poll/9792509/">Did you ever have issues with the emails sent from your WordPress (ie password reset, new comment notifications, WooCommerce emails, etc.)?</a></noscript>
65
  </div>
66
 
67
  <hr>
60
  <div class="feature-section one-col mailpoet_centered">
61
  <h2><%= __('Care to Give Your Opinion?') %></h2>
62
 
63
+ <script type="text/javascript" charset="utf-8" src="//static.polldaddy.com/p/9601216.js"></script>
64
+ <noscript><a href="//polldaddy.com/poll/9601216/">You're using MailPoet version 3. But have you ever used version 2 before?</a></noscript>
65
  </div>
66
 
67
  <hr>