Merge pull request #1047 from mailpoet/eslint-assignment
Eslint assignment [MAILPOET-1033]
This commit is contained in:
@ -33,10 +33,8 @@
|
|||||||
"no-useless-return": 0,
|
"no-useless-return": 0,
|
||||||
"array-callback-return": 0,
|
"array-callback-return": 0,
|
||||||
"new-cap": 0,
|
"new-cap": 0,
|
||||||
"no-return-assign": 0,
|
|
||||||
"no-continue": 0,
|
"no-continue": 0,
|
||||||
"no-new": 0,
|
"no-new": 0,
|
||||||
"no-cond-assign": 0,
|
|
||||||
"space-unary-ops": 0,
|
"space-unary-ops": 0,
|
||||||
"no-redeclare": 0,
|
"no-redeclare": 0,
|
||||||
"no-console": 0,
|
"no-console": 0,
|
||||||
@ -60,7 +58,6 @@
|
|||||||
"space-in-parens": 0,
|
"space-in-parens": 0,
|
||||||
"semi": 0,
|
"semi": 0,
|
||||||
"max-len": 0,
|
"max-len": 0,
|
||||||
"no-multi-assign": 0,
|
|
||||||
"no-trailing-spaces": 0,
|
"no-trailing-spaces": 0,
|
||||||
"global-require": 0,
|
"global-require": 0,
|
||||||
"no-throw-literal": 0,
|
"no-throw-literal": 0,
|
||||||
@ -85,7 +82,6 @@
|
|||||||
"no-unused-vars": 0,
|
"no-unused-vars": 0,
|
||||||
"object-shorthand": 0,
|
"object-shorthand": 0,
|
||||||
"new-parens": 0,
|
"new-parens": 0,
|
||||||
"no-param-reassign": 0,
|
|
||||||
"keyword-spacing": 0,
|
"keyword-spacing": 0,
|
||||||
"eol-last": 0,
|
"eol-last": 0,
|
||||||
"dot-notation": 0,
|
"dot-notation": 0,
|
||||||
|
@ -80,7 +80,6 @@
|
|||||||
"no-sequences": 0,
|
"no-sequences": 0,
|
||||||
"no-extra-boolean-cast": 0,
|
"no-extra-boolean-cast": 0,
|
||||||
"dot-notation": 0,
|
"dot-notation": 0,
|
||||||
"no-param-reassign": 0,
|
|
||||||
"no-shadow": 0,
|
"no-shadow": 0,
|
||||||
"one-var": 0,
|
"one-var": 0,
|
||||||
"no-alert": 0,
|
"no-alert": 0,
|
||||||
|
@ -22,7 +22,6 @@
|
|||||||
"semi": 0,
|
"semi": 0,
|
||||||
"keyword-spacing": 0,
|
"keyword-spacing": 0,
|
||||||
"no-bitwise": 0,
|
"no-bitwise": 0,
|
||||||
"no-multi-assign": 0,
|
|
||||||
"newline-per-chained-call": 0,
|
"newline-per-chained-call": 0,
|
||||||
"no-spaced-func": 0,
|
"no-spaced-func": 0,
|
||||||
"func-call-spacing": 0,
|
"func-call-spacing": 0,
|
||||||
@ -38,7 +37,6 @@
|
|||||||
"vars-on-top": 0,
|
"vars-on-top": 0,
|
||||||
"space-before-blocks": 0,
|
"space-before-blocks": 0,
|
||||||
"object-curly-spacing": 0,
|
"object-curly-spacing": 0,
|
||||||
"no-param-reassign": 0,
|
|
||||||
"one-var-declaration-per-line": 0,
|
"one-var-declaration-per-line": 0,
|
||||||
"func-names": 0,
|
"func-names": 0,
|
||||||
"space-before-function-paren": 0
|
"space-before-function-paren": 0
|
||||||
|
@ -12,7 +12,8 @@ function requestFailed(errorMessage, xhr) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
define('ajax', ['mailpoet', 'jquery', 'underscore'], function(MailPoet, jQuery, _) {
|
define('ajax', ['mailpoet', 'jquery', 'underscore'], function(mp, jQuery, _) {
|
||||||
|
var MailPoet = mp;
|
||||||
|
|
||||||
MailPoet.Ajax = {
|
MailPoet.Ajax = {
|
||||||
version: 0.5,
|
version: 0.5,
|
||||||
|
@ -24,7 +24,8 @@ function track(name, data){
|
|||||||
window.mixpanel.track(name, data);
|
window.mixpanel.track(name, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
function exportMixpanel(MailPoet) {
|
function exportMixpanel(mp) {
|
||||||
|
var MailPoet = mp;
|
||||||
MailPoet.forceTrackEvent = track;
|
MailPoet.forceTrackEvent = track;
|
||||||
|
|
||||||
if (window.mailpoet_analytics_enabled) {
|
if (window.mailpoet_analytics_enabled) {
|
||||||
@ -61,7 +62,8 @@ function cacheEvent(forced, name, data) {
|
|||||||
|
|
||||||
define(
|
define(
|
||||||
['mailpoet', 'underscore'],
|
['mailpoet', 'underscore'],
|
||||||
function(MailPoet, _) {
|
function(mp, _) {
|
||||||
|
var MailPoet = mp;
|
||||||
|
|
||||||
MailPoet.trackEvent = _.partial(cacheEvent, false);
|
MailPoet.trackEvent = _.partial(cacheEvent, false);
|
||||||
MailPoet.forceTrackEvent = _.partial(cacheEvent, true);
|
MailPoet.forceTrackEvent = _.partial(cacheEvent, true);
|
||||||
|
@ -4,12 +4,14 @@ define('date',
|
|||||||
'jquery',
|
'jquery',
|
||||||
'moment'
|
'moment'
|
||||||
], function(
|
], function(
|
||||||
MailPoet,
|
mp,
|
||||||
jQuery,
|
jQuery,
|
||||||
Moment
|
Moment
|
||||||
) {
|
) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
var MailPoet = mp;
|
||||||
|
|
||||||
MailPoet.Date = {
|
MailPoet.Date = {
|
||||||
version: 0.1,
|
version: 0.1,
|
||||||
options: {},
|
options: {},
|
||||||
@ -17,8 +19,8 @@ define('date',
|
|||||||
offset: 0,
|
offset: 0,
|
||||||
format: 'F, d Y H:i:s'
|
format: 'F, d Y H:i:s'
|
||||||
},
|
},
|
||||||
init: function(options) {
|
init: function (opts) {
|
||||||
options = options || {};
|
var options = opts || {};
|
||||||
|
|
||||||
// set UTC offset
|
// set UTC offset
|
||||||
if (
|
if (
|
||||||
@ -39,16 +41,16 @@ define('date',
|
|||||||
|
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
format: function(date, options) {
|
format: function(date, opts) {
|
||||||
options = options || {};
|
var options = opts || {};
|
||||||
this.init(options);
|
this.init(options);
|
||||||
|
|
||||||
var date = Moment(date, this.convertFormat(options.parseFormat));
|
var momentDate = Moment(date, this.convertFormat(options.parseFormat));
|
||||||
if (options.offset === 0) date = date.utc();
|
if (options.offset === 0) momentDate = momentDate.utc();
|
||||||
return date.format(this.convertFormat(this.options.format));
|
return momentDate.format(this.convertFormat(this.options.format));
|
||||||
},
|
},
|
||||||
toDate: function(date, options) {
|
toDate: function(date, opts) {
|
||||||
options = options || {};
|
var options = opts || {};
|
||||||
this.init(options);
|
this.init(options);
|
||||||
|
|
||||||
return Moment(date, this.convertFormat(options.parseFormat)).toDate();
|
return Moment(date, this.convertFormat(options.parseFormat)).toDate();
|
||||||
@ -143,7 +145,8 @@ define('date',
|
|||||||
var convertedFormat = [];
|
var convertedFormat = [];
|
||||||
var escapeToken = false;
|
var escapeToken = false;
|
||||||
|
|
||||||
for(var index = 0, token = ''; token = format.charAt(index); index++){
|
for(var index = 0, token = ''; format.charAt(index); index += 1){
|
||||||
|
token = format.charAt(index);
|
||||||
if (escapeToken === true) {
|
if (escapeToken === true) {
|
||||||
convertedFormat.push('['+token+']');
|
convertedFormat.push('['+token+']');
|
||||||
escapeToken = false;
|
escapeToken = false;
|
||||||
|
@ -28,12 +28,13 @@ define([
|
|||||||
}
|
}
|
||||||
|
|
||||||
let field = false;
|
let field = false;
|
||||||
|
let dataField = data.field;
|
||||||
|
|
||||||
if(data.field['field'] !== undefined) {
|
if(data.field['field'] !== undefined) {
|
||||||
data.field = jQuery.merge(data.field, data.field.field);
|
dataField = jQuery.merge(dataField, data.field.field);
|
||||||
}
|
}
|
||||||
|
|
||||||
switch(data.field.type) {
|
switch(dataField.type) {
|
||||||
case 'text':
|
case 'text':
|
||||||
field = (<FormFieldText {...data} />);
|
field = (<FormFieldText {...data} />);
|
||||||
break;
|
break;
|
||||||
|
@ -11,12 +11,14 @@ Object.extend(document, (function() {
|
|||||||
var cache = Event.cacheDelegated;
|
var cache = Event.cacheDelegated;
|
||||||
|
|
||||||
function getCacheForSelector(selector) {
|
function getCacheForSelector(selector) {
|
||||||
return cache[selector] = cache[selector] || {};
|
cache[selector] = cache[selector] || {};
|
||||||
|
return cache[selector];
|
||||||
}
|
}
|
||||||
|
|
||||||
function getWrappersForSelector(selector, eventName) {
|
function getWrappersForSelector(selector, eventName) {
|
||||||
var c = getCacheForSelector(selector);
|
var c = getCacheForSelector(selector);
|
||||||
return c[eventName] = c[eventName] || [];
|
c[eventName] = c[eventName] || [];
|
||||||
|
return c[eventName];
|
||||||
}
|
}
|
||||||
|
|
||||||
function findWrapper(selector, eventName, handler) {
|
function findWrapper(selector, eventName, handler) {
|
||||||
@ -79,8 +81,8 @@ Object.extend(document, (function() {
|
|||||||
})());
|
})());
|
||||||
|
|
||||||
var Observable = (function() {
|
var Observable = (function() {
|
||||||
function getEventName(name, namespace) {
|
function getEventName(nameA, namespace) {
|
||||||
name = name.substring(2);
|
var name = nameA.substring(2);
|
||||||
if(namespace) name = namespace + ':' + name;
|
if(namespace) name = namespace + ':' + name;
|
||||||
return name.underscore().split('_').join(':');
|
return name.underscore().split('_').join(':');
|
||||||
}
|
}
|
||||||
@ -574,7 +576,8 @@ var WysijaForm = {
|
|||||||
WysijaForm.locks.showingTools = false;
|
WysijaForm.locks.showingTools = false;
|
||||||
},
|
},
|
||||||
instances: {},
|
instances: {},
|
||||||
get: function(element, type) {
|
get: function(element, typ) {
|
||||||
|
var type = typ;
|
||||||
if(type === undefined) type = 'block';
|
if(type === undefined) type = 'block';
|
||||||
// identify element
|
// identify element
|
||||||
var id = element.identify();
|
var id = element.identify();
|
||||||
@ -893,7 +896,8 @@ WysijaForm.Block = Class.create({
|
|||||||
});
|
});
|
||||||
|
|
||||||
/* Invoked on item dropped */
|
/* Invoked on item dropped */
|
||||||
WysijaForm.Block.create = function(block, target) {
|
WysijaForm.Block.create = function(createBlock, target) {
|
||||||
|
var block = createBlock;
|
||||||
if($('form_template_' + block.type) === null) {
|
if($('form_template_' + block.type) === null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -1050,7 +1054,8 @@ function info(value) {
|
|||||||
var noop = function() {};
|
var noop = function() {};
|
||||||
var methods = ['assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error', 'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log', 'markTimeline', 'profile', 'profileEnd', 'markTimeline', 'table', 'time', 'timeEnd', 'timeStamp', 'trace', 'warn'];
|
var methods = ['assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error', 'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log', 'markTimeline', 'profile', 'profileEnd', 'markTimeline', 'table', 'time', 'timeEnd', 'timeStamp', 'trace', 'warn'];
|
||||||
var length = methods.length;
|
var length = methods.length;
|
||||||
var console = window.console = {};
|
window.console = {};
|
||||||
|
var console = {};
|
||||||
while(length--) {
|
while(length--) {
|
||||||
console[methods[length]] = noop;
|
console[methods[length]] = noop;
|
||||||
}
|
}
|
||||||
|
@ -125,12 +125,13 @@ define('handlebars_helpers', ['handlebars'], function(Handlebars) {
|
|||||||
* @return {String} The truncated string.
|
* @return {String} The truncated string.
|
||||||
*/
|
*/
|
||||||
Handlebars.registerHelper('ellipsis', function (str, limit, append) {
|
Handlebars.registerHelper('ellipsis', function (str, limit, append) {
|
||||||
if (append === undefined) {
|
var strAppend = append;
|
||||||
append = '';
|
if (strAppend === undefined) {
|
||||||
|
strAppend = '';
|
||||||
}
|
}
|
||||||
var sanitized = str.replace(/(<([^>]+)>)/g, '');
|
var sanitized = str.replace(/(<([^>]+)>)/g, '');
|
||||||
if (sanitized.length > limit) {
|
if (sanitized.length > limit) {
|
||||||
return sanitized.substr(0, limit - append.length) + append;
|
return sanitized.substr(0, limit - strAppend.length) + strAppend;
|
||||||
} else {
|
} else {
|
||||||
return sanitized;
|
return sanitized;
|
||||||
}
|
}
|
||||||
|
@ -2,9 +2,10 @@ define('i18n',
|
|||||||
[
|
[
|
||||||
'mailpoet'
|
'mailpoet'
|
||||||
], function(
|
], function(
|
||||||
MailPoet
|
mp
|
||||||
) {
|
) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
var MailPoet = mp;
|
||||||
|
|
||||||
var translations = {};
|
var translations = {};
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
define('iframe', ['mailpoet', 'jquery'], function(MailPoet, jQuery) {
|
define('iframe', ['mailpoet'], function(mp) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
var MailPoet = mp;
|
||||||
MailPoet.Iframe = {
|
MailPoet.Iframe = {
|
||||||
marginY: 20,
|
marginY: 20,
|
||||||
autoSize: function(iframe) {
|
autoSize: function(iframe) {
|
||||||
@ -10,11 +11,12 @@ define('iframe', ['mailpoet', 'jquery'], function(MailPoet, jQuery) {
|
|||||||
iframe.contentWindow.document.body.scrollHeight
|
iframe.contentWindow.document.body.scrollHeight
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
setSize: function(iframe, i) {
|
setSize: function(sizeIframe, i) {
|
||||||
|
var iframe = sizeIframe;
|
||||||
if(!iframe) return;
|
if(!iframe) return;
|
||||||
|
|
||||||
iframe.style.height = (
|
iframe.style.height = (
|
||||||
parseInt(i) + this.marginY
|
parseInt(i, 10) + this.marginY
|
||||||
) + "px";
|
) + "px";
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -3,8 +3,9 @@ define(
|
|||||||
'jquery'
|
'jquery'
|
||||||
],
|
],
|
||||||
function(
|
function(
|
||||||
$
|
jQuery
|
||||||
) {
|
) {
|
||||||
|
var $ = jQuery;
|
||||||
// Combination of jQuery.deparam and jQuery.serializeObject by Ben Alman.
|
// Combination of jQuery.deparam and jQuery.serializeObject by Ben Alman.
|
||||||
/*!
|
/*!
|
||||||
* jQuery BBQ: Back Button & Query Library - v1.2.1 - 2/17/2010
|
* jQuery BBQ: Back Button & Query Library - v1.2.1 - 2/17/2010
|
||||||
@ -74,9 +75,10 @@ define(
|
|||||||
// * Rinse & repeat.
|
// * Rinse & repeat.
|
||||||
for ( ; i <= keys_last; i++ ) {
|
for ( ; i <= keys_last; i++ ) {
|
||||||
key = keys[i] === '' ? cur.length : keys[i];
|
key = keys[i] === '' ? cur.length : keys[i];
|
||||||
cur = cur[key] = i < keys_last
|
cur[key] = i < keys_last
|
||||||
? cur[key] || ( keys[i+1] && isNaN( keys[i+1] ) ? {} : [] )
|
? cur[key] || ( keys[i+1] && isNaN( keys[i+1] ) ? {} : [] )
|
||||||
: val;
|
: val;
|
||||||
|
cur = cur[key];
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
@ -10,8 +10,9 @@ const ListingHeader = React.createClass({
|
|||||||
},
|
},
|
||||||
render: function () {
|
render: function () {
|
||||||
const columns = this.props.columns.map((column, index) => {
|
const columns = this.props.columns.map((column, index) => {
|
||||||
column.is_primary = (index === 0);
|
const renderColumn = column;
|
||||||
column.sorted = (this.props.sort_by === column.name)
|
renderColumn.is_primary = (index === 0);
|
||||||
|
renderColumn.sorted = (this.props.sort_by === column.name)
|
||||||
? this.props.sort_order
|
? this.props.sort_order
|
||||||
: 'desc';
|
: 'desc';
|
||||||
return (
|
return (
|
||||||
@ -19,7 +20,7 @@ const ListingHeader = React.createClass({
|
|||||||
onSort={this.props.onSort}
|
onSort={this.props.onSort}
|
||||||
sort_by={this.props.sort_by}
|
sort_by={this.props.sort_by}
|
||||||
key={ 'column-' + index }
|
key={ 'column-' + index }
|
||||||
column={column} />
|
column={renderColumn} />
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -260,8 +260,9 @@ const ListingItems = React.createClass({
|
|||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
{this.props.items.map((item, index) => {
|
{this.props.items.map((item, index) => {
|
||||||
item.id = parseInt(item.id, 10);
|
const renderItem = item;
|
||||||
item.selected = (this.props.selected_ids.indexOf(item.id) !== -1);
|
renderItem.id = parseInt(item.id, 10);
|
||||||
|
renderItem.selected = (this.props.selected_ids.indexOf(renderItem.id) !== -1);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ListingItem
|
<ListingItem
|
||||||
@ -276,8 +277,8 @@ const ListingItems = React.createClass({
|
|||||||
is_selectable={ this.props.is_selectable }
|
is_selectable={ this.props.is_selectable }
|
||||||
item_actions={ this.props.item_actions }
|
item_actions={ this.props.item_actions }
|
||||||
group={ this.props.group }
|
group={ this.props.group }
|
||||||
key={ `item-${item.id}-${index}` }
|
key={ `item-${renderItem.id}-${index}` }
|
||||||
item={ item } />
|
item={ renderItem } />
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</tbody>
|
</tbody>
|
||||||
@ -418,16 +419,17 @@ const Listing = React.createClass({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
setBaseUrlParams: function (base_url) {
|
setBaseUrlParams: function (base_url) {
|
||||||
if (base_url.indexOf(':') !== -1) {
|
let ret = base_url;
|
||||||
|
if (ret.indexOf(':') !== -1) {
|
||||||
const params = this.getParams();
|
const params = this.getParams();
|
||||||
Object.keys(params).map((key) => {
|
Object.keys(params).map((key) => {
|
||||||
if (base_url.indexOf(':'+key) !== -1) {
|
if (ret.indexOf(':'+key) !== -1) {
|
||||||
base_url = base_url.replace(':'+key, params[key]);
|
ret = ret.replace(':'+key, params[key]);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return base_url;
|
return ret;
|
||||||
},
|
},
|
||||||
componentDidMount: function () {
|
componentDidMount: function () {
|
||||||
if (this.isMounted()) {
|
if (this.isMounted()) {
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
define('modal', ['mailpoet', 'jquery'],
|
define('modal', ['mailpoet', 'jquery'],
|
||||||
function(MailPoet, jQuery) {
|
function(mp, jQuery) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
var MailPoet = mp;
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
MailPoet Modal:
|
MailPoet Modal:
|
||||||
|
|
||||||
@ -459,9 +460,9 @@ define('modal', ['mailpoet', 'jquery'],
|
|||||||
jQuery('#mailpoet_modal_overlay').hide();
|
jQuery('#mailpoet_modal_overlay').hide();
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
popup: function(options) {
|
popup: function(opts) {
|
||||||
// get options
|
// get options
|
||||||
options = options || {};
|
var options = opts || {};
|
||||||
// set modal type
|
// set modal type
|
||||||
options.type = 'popup';
|
options.type = 'popup';
|
||||||
// set overlay state
|
// set overlay state
|
||||||
@ -473,9 +474,9 @@ define('modal', ['mailpoet', 'jquery'],
|
|||||||
|
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
panel: function(options) {
|
panel: function(opts) {
|
||||||
// get options
|
// get options
|
||||||
options = options || {};
|
var options = opts || {};
|
||||||
// reset subpanels
|
// reset subpanels
|
||||||
this.subpanels = [];
|
this.subpanels = [];
|
||||||
// set modal type
|
// set modal type
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
define('mp2migrator', ['mailpoet', 'jquery'], function(MailPoet, jQuery) {
|
define('mp2migrator', ['mailpoet', 'jquery'], function(mp, jQuery) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
var MailPoet = mp;
|
||||||
MailPoet.MP2Migrator = {
|
MailPoet.MP2Migrator = {
|
||||||
|
|
||||||
fatal_error: '',
|
fatal_error: '',
|
||||||
@ -28,7 +29,8 @@ define('mp2migrator', ['mailpoet', 'jquery'], function(MailPoet, jQuery) {
|
|||||||
cache: false
|
cache: false
|
||||||
}).done(function (result) {
|
}).done(function (result) {
|
||||||
jQuery("#logger").html('');
|
jQuery("#logger").html('');
|
||||||
result.split("\n").forEach(function (row) {
|
result.split("\n").forEach(function (resultRow) {
|
||||||
|
var row = resultRow;
|
||||||
if(row.substr(0, 7) === '[ERROR]' || row.substr(0, 9) === '[WARNING]' || row === MailPoet.I18n.t('import_stopped_by_user')) {
|
if(row.substr(0, 7) === '[ERROR]' || row.substr(0, 9) === '[WARNING]' || row === MailPoet.I18n.t('import_stopped_by_user')) {
|
||||||
row = '<span class="error_msg">' + row + '</span>'; // Mark the errors in red
|
row = '<span class="error_msg">' + row + '</span>'; // Mark the errors in red
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,8 @@ define([
|
|||||||
'underscore',
|
'underscore',
|
||||||
'handlebars',
|
'handlebars',
|
||||||
'handlebars_helpers'
|
'handlebars_helpers'
|
||||||
], function(Backbone, Marionette, Radio, jQuery, _, Handlebars) {
|
], function(Backbone, Marionette, BackboneRadio, jQuery, _, Handlebars) {
|
||||||
|
var Radio = BackboneRadio;
|
||||||
|
|
||||||
var AppView = Marionette.View.extend({
|
var AppView = Marionette.View.extend({
|
||||||
el: '#mailpoet_editor',
|
el: '#mailpoet_editor',
|
||||||
@ -28,7 +29,9 @@ define([
|
|||||||
},
|
},
|
||||||
|
|
||||||
getChannel: function(channel) {
|
getChannel: function(channel) {
|
||||||
if (channel === undefined) channel = 'global';
|
if (channel === undefined) {
|
||||||
|
return Radio.channel('global');
|
||||||
|
}
|
||||||
return Radio.channel(channel);
|
return Radio.channel(channel);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
*/
|
*/
|
||||||
define([
|
define([
|
||||||
'backbone.marionette'
|
'backbone.marionette'
|
||||||
], function(Marionette) {
|
], function(BackboneMarionette) {
|
||||||
|
var Marionette = BackboneMarionette;
|
||||||
var BehaviorsLookup = {};
|
var BehaviorsLookup = {};
|
||||||
Marionette.Behaviors.behaviorsLookup = function() {
|
Marionette.Behaviors.behaviorsLookup = function() {
|
||||||
return BehaviorsLookup;
|
return BehaviorsLookup;
|
||||||
|
@ -9,8 +9,9 @@ define([
|
|||||||
'mailpoet',
|
'mailpoet',
|
||||||
'spectrum'
|
'spectrum'
|
||||||
], function(Marionette, BehaviorsLookup, MailPoet, Spectrum) {
|
], function(Marionette, BehaviorsLookup, MailPoet, Spectrum) {
|
||||||
|
var BL = BehaviorsLookup;
|
||||||
|
|
||||||
BehaviorsLookup.ColorPickerBehavior = Marionette.Behavior.extend({
|
BL.ColorPickerBehavior = Marionette.Behavior.extend({
|
||||||
onRender: function() {
|
onRender: function() {
|
||||||
this.view.$('.mailpoet_color').spectrum({
|
this.view.$('.mailpoet_color').spectrum({
|
||||||
clickoutFiresChange: true,
|
clickoutFiresChange: true,
|
||||||
|
@ -11,7 +11,8 @@ define([
|
|||||||
'jquery',
|
'jquery',
|
||||||
'newsletter_editor/behaviors/BehaviorsLookup',
|
'newsletter_editor/behaviors/BehaviorsLookup',
|
||||||
'interact'
|
'interact'
|
||||||
], function(Marionette, _, jQuery, BehaviorsLookup, interact) {
|
], function(Marionette, _, jQuery, BL, interact) {
|
||||||
|
var BehaviorsLookup = BL;
|
||||||
|
|
||||||
BehaviorsLookup.ContainerDropZoneBehavior = Marionette.Behavior.extend({
|
BehaviorsLookup.ContainerDropZoneBehavior = Marionette.Behavior.extend({
|
||||||
defaults: {
|
defaults: {
|
||||||
@ -268,7 +269,7 @@ define([
|
|||||||
// 2. Remove visual markings of drop position visualization
|
// 2. Remove visual markings of drop position visualization
|
||||||
this.view.$('.mailpoet_drop_marker').remove();
|
this.view.$('.mailpoet_drop_marker').remove();
|
||||||
},
|
},
|
||||||
getDropPosition: function(eventX, eventY, unsafe) {
|
getDropPosition: function(eventX, eventY, is_unsafe) {
|
||||||
var SPECIAL_AREA_INSERTION_WIDTH = 0.00, // Disable special insertion. Default: 0.3
|
var SPECIAL_AREA_INSERTION_WIDTH = 0.00, // Disable special insertion. Default: 0.3
|
||||||
|
|
||||||
element = this.view.$el,
|
element = this.view.$el,
|
||||||
@ -290,7 +291,7 @@ define([
|
|||||||
|
|
||||||
insertionType, index, position, indexAndPosition;
|
insertionType, index, position, indexAndPosition;
|
||||||
|
|
||||||
unsafe = !!unsafe;
|
unsafe = !!is_unsafe;
|
||||||
|
|
||||||
if (this.getCollection().length === 0) {
|
if (this.getCollection().length === 0) {
|
||||||
return {
|
return {
|
||||||
|
@ -11,8 +11,9 @@ define([
|
|||||||
'newsletter_editor/behaviors/BehaviorsLookup',
|
'newsletter_editor/behaviors/BehaviorsLookup',
|
||||||
'interact'
|
'interact'
|
||||||
], function(Marionette, _, jQuery, BehaviorsLookup, interact) {
|
], function(Marionette, _, jQuery, BehaviorsLookup, interact) {
|
||||||
|
var BL = BehaviorsLookup;
|
||||||
|
|
||||||
BehaviorsLookup.DraggableBehavior = Marionette.Behavior.extend({
|
BL.DraggableBehavior = Marionette.Behavior.extend({
|
||||||
defaults: {
|
defaults: {
|
||||||
cloneOriginal: false,
|
cloneOriginal: false,
|
||||||
hideOriginal: false,
|
hideOriginal: false,
|
||||||
@ -46,7 +47,8 @@ define([
|
|||||||
// Scroll when dragging near edges of a window
|
// Scroll when dragging near edges of a window
|
||||||
autoScroll: true,
|
autoScroll: true,
|
||||||
|
|
||||||
onstart: function(event) {
|
onstart: function(startEvent) {
|
||||||
|
var event = startEvent;
|
||||||
|
|
||||||
if (that.options.cloneOriginal === true) {
|
if (that.options.cloneOriginal === true) {
|
||||||
// Use substitution instead of a clone
|
// Use substitution instead of a clone
|
||||||
@ -89,9 +91,8 @@ define([
|
|||||||
y = (parseFloat(target.getAttribute('data-y')) || 0) + event.dy;
|
y = (parseFloat(target.getAttribute('data-y')) || 0) + event.dy;
|
||||||
|
|
||||||
// translate the element
|
// translate the element
|
||||||
target.style.webkitTransform =
|
target.style.transform = 'translate(' + x + 'px, ' + y + 'px)';
|
||||||
target.style.transform =
|
target.style.webkitTransform = target.style.transform;
|
||||||
'translate(' + x + 'px, ' + y + 'px)';
|
|
||||||
|
|
||||||
// update the posiion attributes
|
// update the posiion attributes
|
||||||
target.setAttribute('data-x', x);
|
target.setAttribute('data-x', x);
|
||||||
@ -99,7 +100,8 @@ define([
|
|||||||
},
|
},
|
||||||
onend: function (event) {
|
onend: function (event) {
|
||||||
var target = event.target;
|
var target = event.target;
|
||||||
target.style.webkitTransform = target.style.transform = '';
|
target.style.transform = '';
|
||||||
|
target.style.webkitTransform = target.style.transform;
|
||||||
target.removeAttribute('data-x');
|
target.removeAttribute('data-x');
|
||||||
target.removeAttribute('data-y');
|
target.removeAttribute('data-y');
|
||||||
jQuery(event.interaction.element).addClass('mailpoet_droppable_active');
|
jQuery(event.interaction.element).addClass('mailpoet_droppable_active');
|
||||||
@ -129,7 +131,8 @@ define([
|
|||||||
} else {
|
} else {
|
||||||
interactable.getDropModel = this.view.getDropFunc();
|
interactable.getDropModel = this.view.getDropFunc();
|
||||||
}
|
}
|
||||||
interactable.onDrop = function(options) {
|
interactable.onDrop = function(opts) {
|
||||||
|
var options = opts;
|
||||||
if (_.isObject(options)) {
|
if (_.isObject(options)) {
|
||||||
// Inject Draggable behavior if possible
|
// Inject Draggable behavior if possible
|
||||||
options.dragBehavior = that;
|
options.dragBehavior = that;
|
||||||
|
@ -7,8 +7,9 @@ define([
|
|||||||
'backbone.marionette',
|
'backbone.marionette',
|
||||||
'newsletter_editor/behaviors/BehaviorsLookup'
|
'newsletter_editor/behaviors/BehaviorsLookup'
|
||||||
], function(Marionette, BehaviorsLookup) {
|
], function(Marionette, BehaviorsLookup) {
|
||||||
|
var BL = BehaviorsLookup;
|
||||||
|
|
||||||
BehaviorsLookup.HighlightEditingBehavior = Marionette.Behavior.extend({
|
BL.HighlightEditingBehavior = Marionette.Behavior.extend({
|
||||||
modelEvents: {
|
modelEvents: {
|
||||||
'startEditing': 'enableHighlight',
|
'startEditing': 'enableHighlight',
|
||||||
'stopEditing': 'disableHighlight'
|
'stopEditing': 'disableHighlight'
|
||||||
|
@ -8,8 +8,9 @@ define([
|
|||||||
'newsletter_editor/behaviors/BehaviorsLookup',
|
'newsletter_editor/behaviors/BehaviorsLookup',
|
||||||
'interact'
|
'interact'
|
||||||
], function(Marionette, BehaviorsLookup, interact) {
|
], function(Marionette, BehaviorsLookup, interact) {
|
||||||
|
var BL = BehaviorsLookup;
|
||||||
|
|
||||||
BehaviorsLookup.ResizableBehavior = Marionette.Behavior.extend({
|
BL.ResizableBehavior = Marionette.Behavior.extend({
|
||||||
defaults: {
|
defaults: {
|
||||||
elementSelector: null,
|
elementSelector: null,
|
||||||
resizeHandleSelector: true, // true will use edges of the element itself
|
resizeHandleSelector: true, // true will use edges of the element itself
|
||||||
|
@ -8,8 +8,9 @@ define([
|
|||||||
'jquery',
|
'jquery',
|
||||||
'newsletter_editor/behaviors/BehaviorsLookup'
|
'newsletter_editor/behaviors/BehaviorsLookup'
|
||||||
], function(Marionette, jQuery, BehaviorsLookup) {
|
], function(Marionette, jQuery, BehaviorsLookup) {
|
||||||
|
var BL = BehaviorsLookup;
|
||||||
|
|
||||||
BehaviorsLookup.ShowSettingsBehavior = Marionette.Behavior.extend({
|
BL.ShowSettingsBehavior = Marionette.Behavior.extend({
|
||||||
defaults: {
|
defaults: {
|
||||||
ignoreFrom: '' // selector
|
ignoreFrom: '' // selector
|
||||||
},
|
},
|
||||||
|
@ -8,8 +8,9 @@ define([
|
|||||||
'underscore',
|
'underscore',
|
||||||
'newsletter_editor/behaviors/BehaviorsLookup'
|
'newsletter_editor/behaviors/BehaviorsLookup'
|
||||||
], function(Marionette, _, BehaviorsLookup) {
|
], function(Marionette, _, BehaviorsLookup) {
|
||||||
|
var BL = BehaviorsLookup;
|
||||||
|
|
||||||
BehaviorsLookup.SortableBehavior = Marionette.Behavior.extend({
|
BL.SortableBehavior = Marionette.Behavior.extend({
|
||||||
onRender: function() {
|
onRender: function() {
|
||||||
var collection = this.view.collection;
|
var collection = this.view.collection;
|
||||||
|
|
||||||
|
@ -8,8 +8,9 @@ define([
|
|||||||
'underscore',
|
'underscore',
|
||||||
'newsletter_editor/behaviors/BehaviorsLookup'
|
'newsletter_editor/behaviors/BehaviorsLookup'
|
||||||
], function(Marionette, _, BehaviorsLookup) {
|
], function(Marionette, _, BehaviorsLookup) {
|
||||||
|
var BL = BehaviorsLookup;
|
||||||
|
|
||||||
BehaviorsLookup.TextEditorBehavior = Marionette.Behavior.extend({
|
BL.TextEditorBehavior = Marionette.Behavior.extend({
|
||||||
defaults: {
|
defaults: {
|
||||||
selector: '.mailpoet_content',
|
selector: '.mailpoet_content',
|
||||||
toolbar1: "bold italic link unlink forecolor mailpoet_shortcodes",
|
toolbar1: "bold italic link unlink forecolor mailpoet_shortcodes",
|
||||||
|
@ -392,8 +392,9 @@ define([
|
|||||||
});
|
});
|
||||||
|
|
||||||
App.on('start', function(App, options) {
|
App.on('start', function(App, options) {
|
||||||
App._ALCSupervisor = new Module.ALCSupervisor();
|
var Application = App;
|
||||||
App._ALCSupervisor.refresh();
|
Application._ALCSupervisor = new Module.ALCSupervisor();
|
||||||
|
Application._ALCSupervisor.refresh();
|
||||||
});
|
});
|
||||||
|
|
||||||
return Module;
|
return Module;
|
||||||
|
@ -194,8 +194,8 @@ define([
|
|||||||
move: true
|
move: true
|
||||||
},
|
},
|
||||||
getSettingsView: function() { return Module.BlockSettingsView; },
|
getSettingsView: function() { return Module.BlockSettingsView; },
|
||||||
initialize: function(options) {
|
initialize: function(opts) {
|
||||||
options = options || {};
|
var options = opts || {};
|
||||||
if (!_.isUndefined(options.tools)) {
|
if (!_.isUndefined(options.tools)) {
|
||||||
// Make a new block specific tool config object
|
// Make a new block specific tool config object
|
||||||
this.tools = jQuery.extend({}, this.tools, options.tools || {});
|
this.tools = jQuery.extend({}, this.tools, options.tools || {});
|
||||||
|
@ -277,7 +277,8 @@ define([
|
|||||||
},
|
},
|
||||||
|
|
||||||
mainEmbedToolbar: function(toolbar) {
|
mainEmbedToolbar: function(toolbar) {
|
||||||
toolbar.view = new wp.media.view.Toolbar.Embed({
|
var tbar = toolbar;
|
||||||
|
tbar.view = new wp.media.view.Toolbar.Embed({
|
||||||
controller: this,
|
controller: this,
|
||||||
text: 'Add images'
|
text: 'Add images'
|
||||||
});
|
});
|
||||||
@ -285,7 +286,7 @@ define([
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
var theFrame = this._mediaManager = new MediaManager({
|
var theFrame = new MediaManager({
|
||||||
id: 'mailpoet-media-manager',
|
id: 'mailpoet-media-manager',
|
||||||
frame: 'select',
|
frame: 'select',
|
||||||
title: 'Select image',
|
title: 'Select image',
|
||||||
@ -300,6 +301,7 @@ define([
|
|||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
that = this;
|
that = this;
|
||||||
|
this._mediaManager = theFrame;
|
||||||
|
|
||||||
this._mediaManager.on('insert', function() {
|
this._mediaManager.on('insert', function() {
|
||||||
// Append media manager image selections to Images tab
|
// Append media manager image selections to Images tab
|
||||||
|
@ -23,8 +23,8 @@
|
|||||||
}
|
}
|
||||||
}(this, function(Marionette, Radio, _) {
|
}(this, function(Marionette, Radio, _) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
var MarionetteApplication = Marionette.Application;
|
||||||
Marionette.Application.prototype._initChannel = function () {
|
MarionetteApplication.prototype._initChannel = function () {
|
||||||
this.channelName = _.result(this, 'channelName') || 'global';
|
this.channelName = _.result(this, 'channelName') || 'global';
|
||||||
this.channel = _.result(this, 'channel') || Radio.channel(this.channelName);
|
this.channel = _.result(this, 'channel') || Radio.channel(this.channelName);
|
||||||
};
|
};
|
||||||
|
@ -25,11 +25,12 @@ define([
|
|||||||
};
|
};
|
||||||
|
|
||||||
App.on('before:start', function(App, options) {
|
App.on('before:start', function(App, options) {
|
||||||
|
var Application = App;
|
||||||
// Expose config methods globally
|
// Expose config methods globally
|
||||||
App.getConfig = Module.getConfig;
|
Application.getConfig = Module.getConfig;
|
||||||
App.setConfig = Module.setConfig;
|
Application.setConfig = Module.setConfig;
|
||||||
|
|
||||||
App.setConfig(options.config);
|
Application.setConfig(options.config);
|
||||||
});
|
});
|
||||||
|
|
||||||
return Module;
|
return Module;
|
||||||
|
@ -67,7 +67,8 @@ define([
|
|||||||
return _.filter(blocks, predicate);
|
return _.filter(blocks, predicate);
|
||||||
};
|
};
|
||||||
|
|
||||||
App.on('before:start', function(App, options) {
|
App.on('before:start', function(Application, options) {
|
||||||
|
var App = Application;
|
||||||
// Expose block methods globally
|
// Expose block methods globally
|
||||||
App.registerBlockType = Module.registerBlockType;
|
App.registerBlockType = Module.registerBlockType;
|
||||||
App.getBlockTypeModel = Module.getBlockTypeModel;
|
App.getBlockTypeModel = Module.getBlockTypeModel;
|
||||||
@ -80,7 +81,8 @@ define([
|
|||||||
Module.newsletter = new Module.NewsletterModel(_.omit(_.clone(options.newsletter), ['body']));
|
Module.newsletter = new Module.NewsletterModel(_.omit(_.clone(options.newsletter), ['body']));
|
||||||
});
|
});
|
||||||
|
|
||||||
App.on('start', function(App, options) {
|
App.on('start', function(Application, options) {
|
||||||
|
var App = Application;
|
||||||
var body = options.newsletter.body;
|
var body = options.newsletter.body;
|
||||||
var content = (_.has(body, 'content')) ? body.content : {};
|
var content = (_.has(body, 'content')) ? body.content : {};
|
||||||
|
|
||||||
|
@ -67,9 +67,10 @@ define([
|
|||||||
|
|
||||||
// For getting a promise after triggering save event
|
// For getting a promise after triggering save event
|
||||||
Module.saveAndProvidePromise = function(saveResult) {
|
Module.saveAndProvidePromise = function(saveResult) {
|
||||||
|
var result = saveResult;
|
||||||
var promise = Module.save();
|
var promise = Module.save();
|
||||||
if (saveResult !== undefined) {
|
if (saveResult !== undefined) {
|
||||||
saveResult.promise = promise;
|
result.promise = promise;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -337,10 +338,10 @@ define([
|
|||||||
Module.beforeExitWithUnsavedChanges = function(e) {
|
Module.beforeExitWithUnsavedChanges = function(e) {
|
||||||
if (saveTimeout) {
|
if (saveTimeout) {
|
||||||
var message = MailPoet.I18n.t('unsavedChangesWillBeLost');
|
var message = MailPoet.I18n.t('unsavedChangesWillBeLost');
|
||||||
e = e || window.event;
|
var event = e || window.event;
|
||||||
|
|
||||||
if (e) {
|
if (event) {
|
||||||
e.returnValue = message;
|
event.returnValue = message;
|
||||||
}
|
}
|
||||||
|
|
||||||
return message;
|
return message;
|
||||||
@ -348,12 +349,13 @@ define([
|
|||||||
};
|
};
|
||||||
|
|
||||||
App.on('before:start', function(App, options) {
|
App.on('before:start', function(App, options) {
|
||||||
App.save = Module.saveAndProvidePromise;
|
var Application = App;
|
||||||
App.getChannel().on('autoSave', Module.autoSave);
|
Application.save = Module.saveAndProvidePromise;
|
||||||
|
Application.getChannel().on('autoSave', Module.autoSave);
|
||||||
|
|
||||||
window.onbeforeunload = Module.beforeExitWithUnsavedChanges;
|
window.onbeforeunload = Module.beforeExitWithUnsavedChanges;
|
||||||
|
|
||||||
App.getChannel().on('save', function(saveResult) { App.save(saveResult); });
|
Application.getChannel().on('save', function(saveResult) { Application.save(saveResult); });
|
||||||
});
|
});
|
||||||
|
|
||||||
App.on('start', function(App, options) {
|
App.on('start', function(App, options) {
|
||||||
|
@ -367,10 +367,11 @@ define([
|
|||||||
});
|
});
|
||||||
|
|
||||||
App.on('before:start', function(App, options) {
|
App.on('before:start', function(App, options) {
|
||||||
App.registerWidget = Module.registerWidget;
|
var Application = App;
|
||||||
App.getWidgets = Module.getWidgets;
|
Application.registerWidget = Module.registerWidget;
|
||||||
App.registerLayoutWidget = Module.registerLayoutWidget;
|
Application.getWidgets = Module.getWidgets;
|
||||||
App.getLayoutWidgets = Module.getLayoutWidgets;
|
Application.registerLayoutWidget = Module.registerLayoutWidget;
|
||||||
|
Application.getLayoutWidgets = Module.getLayoutWidgets;
|
||||||
});
|
});
|
||||||
|
|
||||||
App.on('start', function(App, options) {
|
App.on('start', function(App, options) {
|
||||||
|
@ -69,10 +69,11 @@ define([
|
|||||||
};
|
};
|
||||||
|
|
||||||
App.on('before:start', function(App, options) {
|
App.on('before:start', function(App, options) {
|
||||||
|
var Application = App;
|
||||||
// Expose style methods to global application
|
// Expose style methods to global application
|
||||||
App.getGlobalStyles = Module.getGlobalStyles;
|
Application.getGlobalStyles = Module.getGlobalStyles;
|
||||||
App.setGlobalStyles = Module.setGlobalStyles;
|
Application.setGlobalStyles = Module.setGlobalStyles;
|
||||||
App.getAvailableStyles = Module.getAvailableStyles;
|
Application.getAvailableStyles = Module.getAvailableStyles;
|
||||||
|
|
||||||
var body = options.newsletter.body;
|
var body = options.newsletter.body;
|
||||||
var globalStyles = (_.has(body, 'globalStyles')) ? body.globalStyles : {};
|
var globalStyles = (_.has(body, 'globalStyles')) ? body.globalStyles : {};
|
||||||
|
@ -145,13 +145,14 @@ const _QueueMixin = {
|
|||||||
|
|
||||||
const _StatisticsMixin = {
|
const _StatisticsMixin = {
|
||||||
renderStatistics: function (newsletter, is_sent, current_time) {
|
renderStatistics: function (newsletter, is_sent, current_time) {
|
||||||
if (is_sent === undefined) {
|
let sent = is_sent;
|
||||||
|
if (sent === undefined) {
|
||||||
// condition for standard and post notification listings
|
// condition for standard and post notification listings
|
||||||
is_sent = newsletter.statistics
|
sent = newsletter.statistics
|
||||||
&& newsletter.queue
|
&& newsletter.queue
|
||||||
&& newsletter.queue.status !== 'scheduled';
|
&& newsletter.queue.status !== 'scheduled';
|
||||||
}
|
}
|
||||||
if (!is_sent) {
|
if (!sent) {
|
||||||
return (
|
return (
|
||||||
<span>{MailPoet.I18n.t('notSentYet')}</span>
|
<span>{MailPoet.I18n.t('notSentYet')}</span>
|
||||||
);
|
);
|
||||||
|
@ -8,12 +8,14 @@ define(
|
|||||||
],
|
],
|
||||||
(
|
(
|
||||||
React,
|
React,
|
||||||
jQuery,
|
jq,
|
||||||
_,
|
_,
|
||||||
MailPoet,
|
MailPoet,
|
||||||
Hooks
|
Hooks
|
||||||
) => {
|
) => {
|
||||||
|
|
||||||
|
const jQuery = jq;
|
||||||
|
|
||||||
const currentTime = window.mailpoet_current_time || '00:00';
|
const currentTime = window.mailpoet_current_time || '00:00';
|
||||||
const defaultDateTime = window.mailpoet_current_date + ' ' + '00:00:00';
|
const defaultDateTime = window.mailpoet_current_date + ' ' + '00:00:00';
|
||||||
const timeOfDayItems = window.mailpoet_schedule_time_of_day;
|
const timeOfDayItems = window.mailpoet_schedule_time_of_day;
|
||||||
@ -84,12 +86,13 @@ define(
|
|||||||
|
|
||||||
const DateText = React.createClass({
|
const DateText = React.createClass({
|
||||||
onChange: function (event) {
|
onChange: function (event) {
|
||||||
|
const changeEvent = event;
|
||||||
// Swap display format to storage format
|
// Swap display format to storage format
|
||||||
const displayDate = event.target.value;
|
const displayDate = changeEvent.target.value;
|
||||||
const storageDate = this.getStorageDate(displayDate);
|
const storageDate = this.getStorageDate(displayDate);
|
||||||
|
|
||||||
event.target.value = storageDate;
|
changeEvent.target.value = storageDate;
|
||||||
this.props.onChange(event);
|
this.props.onChange(changeEvent);
|
||||||
},
|
},
|
||||||
componentDidMount: function () {
|
componentDidMount: function () {
|
||||||
const $element = jQuery(this.refs.dateInput);
|
const $element = jQuery(this.refs.dateInput);
|
||||||
@ -273,8 +276,9 @@ define(
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleCheckboxChange: function (event) {
|
handleCheckboxChange: function (event) {
|
||||||
event.target.value = this.refs.isScheduled.checked ? '1' : '0';
|
const changeEvent = event;
|
||||||
return this.handleValueChange(event);
|
changeEvent.target.value = this.refs.isScheduled.checked ? '1' : '0';
|
||||||
|
return this.handleValueChange(changeEvent);
|
||||||
},
|
},
|
||||||
isScheduled: function () {
|
isScheduled: function () {
|
||||||
return this._getCurrentValue().isScheduled === '1';
|
return this._getCurrentValue().isScheduled === '1';
|
||||||
@ -419,11 +423,11 @@ define(
|
|||||||
return fields;
|
return fields;
|
||||||
},
|
},
|
||||||
getSendButtonOptions: function (newsletter) {
|
getSendButtonOptions: function (newsletter) {
|
||||||
newsletter = newsletter || {};
|
const newsletterOptions = newsletter || {};
|
||||||
|
|
||||||
const isScheduled = (
|
const isScheduled = (
|
||||||
typeof newsletter.options === 'object'
|
typeof newsletterOptions.options === 'object'
|
||||||
&& newsletter.options.isScheduled === '1'
|
&& newsletterOptions.options.isScheduled === '1'
|
||||||
);
|
);
|
||||||
const options = {
|
const options = {
|
||||||
value: (isScheduled
|
value: (isScheduled
|
||||||
@ -431,8 +435,8 @@ define(
|
|||||||
: MailPoet.I18n.t('send')),
|
: MailPoet.I18n.t('send')),
|
||||||
};
|
};
|
||||||
|
|
||||||
if (newsletter.status === 'sent'
|
if (newsletterOptions.status === 'sent'
|
||||||
|| newsletter.status === 'sending') {
|
|| newsletterOptions.status === 'sending') {
|
||||||
options['disabled'] = 'disabled';
|
options['disabled'] = 'disabled';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,7 +19,8 @@ define(
|
|||||||
) => {
|
) => {
|
||||||
|
|
||||||
const ImportTemplate = React.createClass({
|
const ImportTemplate = React.createClass({
|
||||||
saveTemplate: function (template) {
|
saveTemplate: function (saveTemplate) {
|
||||||
|
const template = saveTemplate;
|
||||||
|
|
||||||
// Stringify to enable transmission of primitive non-string value types
|
// Stringify to enable transmission of primitive non-string value types
|
||||||
if (!_.isUndefined(template.body)) {
|
if (!_.isUndefined(template.body)) {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
define('notice', ['mailpoet', 'jquery'], function(MailPoet, jQuery) {
|
define('notice', ['mailpoet', 'jquery'], function(mp, jQuery) {
|
||||||
"use strict";
|
"use strict";
|
||||||
/*==================================================================================================
|
/*==================================================================================================
|
||||||
|
|
||||||
@ -22,7 +22,7 @@ define('notice', ['mailpoet', 'jquery'], function(MailPoet, jQuery) {
|
|||||||
MailPoet.Notice.system('You need to updated ASAP!');
|
MailPoet.Notice.system('You need to updated ASAP!');
|
||||||
|
|
||||||
==================================================================================================*/
|
==================================================================================================*/
|
||||||
|
var MailPoet = mp;
|
||||||
MailPoet.Notice = {
|
MailPoet.Notice = {
|
||||||
version: 1.0,
|
version: 1.0,
|
||||||
// default options
|
// default options
|
||||||
@ -103,12 +103,12 @@ define('notice', ['mailpoet', 'jquery'], function(MailPoet, jQuery) {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
setMessage: function(message) {
|
setMessage: function(message) {
|
||||||
message = this.formatMessage(message);
|
var formattedMessage = this.formatMessage(message);
|
||||||
|
|
||||||
// let's sugar coat the message with a fancy <p>
|
// let's sugar coat the message with a fancy <p>
|
||||||
message = '<p>'+message+'</p>';
|
formattedMessage = '<p>'+formattedMessage+'</p>';
|
||||||
// set message
|
// set message
|
||||||
return this.element.html(message);
|
return this.element.html(formattedMessage);
|
||||||
},
|
},
|
||||||
formatMessage: function(message) {
|
formatMessage: function(message) {
|
||||||
if (Array.isArray(message)) {
|
if (Array.isArray(message)) {
|
||||||
|
@ -2,13 +2,14 @@ define('num',
|
|||||||
[
|
[
|
||||||
'mailpoet'
|
'mailpoet'
|
||||||
], function(
|
], function(
|
||||||
MailPoet
|
mp
|
||||||
) {
|
) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
var MailPoet = mp;
|
||||||
MailPoet.Num = {
|
MailPoet.Num = {
|
||||||
toLocaleFixed: function (num, precision) {
|
toLocaleFixed: function (num, precisionOpts) {
|
||||||
precision = precision || 0;
|
var precision = precisionOpts || 0;
|
||||||
var factor = Math.pow(10, precision);
|
var factor = Math.pow(10, precision);
|
||||||
return (Math.round(num * factor) / factor)
|
return (Math.round(num * factor) / factor)
|
||||||
.toLocaleString(
|
.toLocaleString(
|
||||||
|
@ -7,8 +7,9 @@ define(
|
|||||||
function(
|
function(
|
||||||
Backbone,
|
Backbone,
|
||||||
jQuery,
|
jQuery,
|
||||||
MailPoet
|
mp
|
||||||
) {
|
) {
|
||||||
|
var MailPoet = mp;
|
||||||
if(jQuery('#mailpoet_settings').length === 0) {
|
if(jQuery('#mailpoet_settings').length === 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -50,9 +51,9 @@ define(
|
|||||||
jQuery('#mailpoet_sending_method_setup').fadeIn();
|
jQuery('#mailpoet_sending_method_setup').fadeIn();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
tabs: function(tab, section) {
|
tabs: function(tabStr, section) {
|
||||||
// set default tab
|
// set default tab
|
||||||
tab = tab || 'mta';
|
var tab = tabStr || 'mta';
|
||||||
|
|
||||||
// reset all active tabs
|
// reset all active tabs
|
||||||
jQuery('.nav-tab-wrapper a').removeClass('nav-tab-active');
|
jQuery('.nav-tab-wrapper a').removeClass('nav-tab-active');
|
||||||
|
@ -52,8 +52,9 @@ define(
|
|||||||
router.on('route:step1', function () {
|
router.on('route:step1', function () {
|
||||||
// set or reset temporary validation rule on all columns
|
// set or reset temporary validation rule on all columns
|
||||||
mailpoetColumns = jQuery.map(mailpoetColumns, function (column, columnIndex) {
|
mailpoetColumns = jQuery.map(mailpoetColumns, function (column, columnIndex) {
|
||||||
column.validation_rule = false;
|
var col = column;
|
||||||
return column;
|
col.validation_rule = false;
|
||||||
|
return col;
|
||||||
});
|
});
|
||||||
|
|
||||||
if (typeof (importData.step1) !== 'undefined') {
|
if (typeof (importData.step1) !== 'undefined') {
|
||||||
@ -302,10 +303,10 @@ define(
|
|||||||
advancedOptionComments = false,
|
advancedOptionComments = false,
|
||||||
// trim spaces, commas, periods,
|
// trim spaces, commas, periods,
|
||||||
// single/double quotes and convert to lowercase
|
// single/double quotes and convert to lowercase
|
||||||
detectAndCleanupEmail = function (email) {
|
detectAndCleanupEmail = function (emailString) {
|
||||||
var test;
|
var test;
|
||||||
// decode HTML entities
|
// decode HTML entities
|
||||||
email = jQuery('<div />').html(email).text();
|
var email = jQuery('<div />').html(emailString).text();
|
||||||
email = email
|
email = email
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
// left/right trim spaces, punctuation (e.g., " 'email@email.com'; ")
|
// left/right trim spaces, punctuation (e.g., " 'email@email.com'; ")
|
||||||
@ -315,11 +316,13 @@ define(
|
|||||||
// remove urlencoded characters
|
// remove urlencoded characters
|
||||||
.replace(/\s+|%\d+|,+/g, '');
|
.replace(/\s+|%\d+|,+/g, '');
|
||||||
// detect e-mails that will be otherwise rejected by email regex
|
// detect e-mails that will be otherwise rejected by email regex
|
||||||
if (test = /<(.*?)>/.exec(email)) {
|
test = /<(.*?)>/.exec(email);
|
||||||
|
if (test) {
|
||||||
// is the email inside angle brackets (e.g., 'some@email.com <some@email.com>')?
|
// is the email inside angle brackets (e.g., 'some@email.com <some@email.com>')?
|
||||||
email = test[1].trim();
|
email = test[1].trim();
|
||||||
}
|
}
|
||||||
if (test = /mailto:(?:\s+)?(.*)/.exec(email)) {
|
test = /mailto:(?:\s+)?(.*)/.exec(email);
|
||||||
|
if (test) {
|
||||||
// is the email in 'mailto:email' format?
|
// is the email in 'mailto:email' format?
|
||||||
email = test[1].trim();
|
email = test[1].trim();
|
||||||
}
|
}
|
||||||
@ -534,12 +537,14 @@ define(
|
|||||||
data: segments,
|
data: segments,
|
||||||
width: '20em',
|
width: '20em',
|
||||||
templateResult: function (item) {
|
templateResult: function (item) {
|
||||||
item.subscriberCount = parseInt(item.subscriberCount);
|
var i = item;
|
||||||
return item.name + ' (' + item.subscriberCount.toLocaleString() + ')';
|
i.subscriberCount = parseInt(i.subscriberCount, 10);
|
||||||
|
return i.name + ' (' + i.subscriberCount.toLocaleString() + ')';
|
||||||
},
|
},
|
||||||
templateSelection: function (item) {
|
templateSelection: function (item) {
|
||||||
item.subscriberCount = parseInt(item.subscriberCount);
|
var i = item;
|
||||||
return item.name + ' (' + item.subscriberCount.toLocaleString() + ')';
|
i.subscriberCount = parseInt(i.subscriberCount, 10);
|
||||||
|
return i.name + ' (' + i.subscriberCount.toLocaleString() + ')';
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.change(function () {
|
.change(function () {
|
||||||
@ -894,7 +899,8 @@ define(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
jQuery.map(subscribersClone.subscribers, function (data, index) {
|
jQuery.map(subscribersClone.subscribers, function (dataSubscribers, index) {
|
||||||
|
var data = dataSubscribers;
|
||||||
var rowData = data[matchedColumn.index];
|
var rowData = data[matchedColumn.index];
|
||||||
if (index === fillerPosition || rowData.trim() === '') return;
|
if (index === fillerPosition || rowData.trim() === '') return;
|
||||||
var date = Moment(rowData, testedFormat, true);
|
var date = Moment(rowData, testedFormat, true);
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"lint": "npm run lint6 && npm run lint5 && npm run lint-tests",
|
"lint": "npm run lint6 && npm run lint5 && npm run lint-tests",
|
||||||
"lint6": "eslint -c .eslintrc.es6.json --max-warnings 0 'assets/js/src/**/*.jsx'",
|
"lint6": "eslint -c .eslintrc.es6.json --max-warnings 0 'assets/js/src/**/*.jsx'",
|
||||||
"lint5": "eslint -c .eslintrc.es5.json --max-warnings 0 'assets/js/src/**/*.js'",
|
"lint5": "eslint -c .eslintrc.es5.json --ignore-pattern helpscout.js --max-warnings 0 'assets/js/src/**/*.js'",
|
||||||
"lint-tests": "eslint -c .eslintrc.tests.json --max-warnings 0 'tests/javascript'"
|
"lint-tests": "eslint -c .eslintrc.tests.json --max-warnings 0 'tests/javascript'"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
module.exports = {
|
module.exports = {
|
||||||
loadFileToContainer: function (path, window, containerTagName, options) {
|
loadFileToContainer: function (path, window, containerTagName, opts) {
|
||||||
var contents = fs.readFileSync(path),
|
var contents = fs.readFileSync(path),
|
||||||
container = window.document.createElement(containerTagName);
|
container = window.document.createElement(containerTagName);
|
||||||
options = options || {};
|
var options = opts || {};
|
||||||
container.innerHTML = contents;
|
container.innerHTML = contents;
|
||||||
|
|
||||||
if (options.type) {
|
if (options.type) {
|
||||||
@ -17,9 +17,9 @@ module.exports = {
|
|||||||
loadScript: function (scriptPath, window, options) {
|
loadScript: function (scriptPath, window, options) {
|
||||||
this.loadFileToContainer(scriptPath, window, 'script', options);
|
this.loadFileToContainer(scriptPath, window, 'script', options);
|
||||||
},
|
},
|
||||||
loadTemplate: function (path, window, options) {
|
loadTemplate: function (path, window, opts) {
|
||||||
var w = window || global.window;
|
var w = window || global.window;
|
||||||
options = options || {};
|
var options = opts || {};
|
||||||
options.type = "text/x-handlebars-template";
|
options.type = "text/x-handlebars-template";
|
||||||
|
|
||||||
this.loadScript("views/newsletter/templates/" + path, w, options);
|
this.loadScript("views/newsletter/templates/" + path, w, options);
|
||||||
|
@ -28,7 +28,9 @@ if (!global.document || !global.window) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
global.testHelpers = require('./loadHelpers.js');
|
global.testHelpers = require('./loadHelpers.js');
|
||||||
global.$ = global.jQuery = global.window.jQuery = require('jquery');
|
global.$ = require('jquery');
|
||||||
|
global.jQuery = require('jquery');
|
||||||
|
global.window.jQuery = require('jquery');
|
||||||
|
|
||||||
testHelpers.loadScript('tests/javascript/testBundles/vendor.js', global.window);
|
testHelpers.loadScript('tests/javascript/testBundles/vendor.js', global.window);
|
||||||
global.Handlebars = global.window.Handlebars;
|
global.Handlebars = global.window.Handlebars;
|
||||||
@ -46,27 +48,28 @@ global.interact = function () {
|
|||||||
styleCursor: global.interact
|
styleCursor: global.interact
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
global.spectrum = function() { return this; };
|
||||||
jQuery.fn.spectrum = global.spectrum = function() { return this; };
|
jQuery.fn.spectrum = global.spectrum;
|
||||||
jQuery.fn.stick_in_parent = function() { return this; };
|
jQuery.fn.stick_in_parent = function() { return this; };
|
||||||
|
|
||||||
// Add global stubs for convenience
|
// Add global stubs for convenience
|
||||||
// TODO: Extract those to a separate file
|
// TODO: Extract those to a separate file
|
||||||
global.stubChannel = function (EditorApplication, returnObject) {
|
global.stubChannel = function (EditorApplication, returnObject) {
|
||||||
EditorApplication.getChannel = sinon.stub().returns(_.defaults(returnObject || {}, {
|
var App = EditorApplication;
|
||||||
|
App.getChannel = sinon.stub().returns(_.defaults(returnObject || {}, {
|
||||||
trigger: function () {
|
trigger: function () {
|
||||||
},
|
},
|
||||||
on: function () {
|
on: function () {
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
};
|
};
|
||||||
global.stubConfig = function (EditorApplication, config) {
|
global.stubConfig = function (EditorApplication, opts) {
|
||||||
config = config || {};
|
var App = EditorApplication;
|
||||||
EditorApplication.getConfig = sinon.stub().returns(new Backbone.SuperModel(config));
|
App.getConfig = sinon.stub().returns(new Backbone.SuperModel(opts || {}));
|
||||||
};
|
};
|
||||||
global.stubAvailableStyles = function (EditorApplication, styles) {
|
global.stubAvailableStyles = function (EditorApplication, styles) {
|
||||||
styles = styles || {};
|
var App = EditorApplication;
|
||||||
EditorApplication.getAvailableStyles = sinon.stub().returns(new Backbone.SuperModel(styles));
|
App.getAvailableStyles = sinon.stub().returns(new Backbone.SuperModel(styles || {}));
|
||||||
};
|
};
|
||||||
|
|
||||||
global.stubImage = function(defaultWidth, defaultHeight) {
|
global.stubImage = function(defaultWidth, defaultHeight) {
|
||||||
|
@ -5,12 +5,14 @@ define([
|
|||||||
'amd-inject-loader!newsletter_editor/blocks/automatedLatestContent',
|
'amd-inject-loader!newsletter_editor/blocks/automatedLatestContent',
|
||||||
'newsletter_editor/components/communication'
|
'newsletter_editor/components/communication'
|
||||||
], function(
|
], function(
|
||||||
EditorApplication,
|
App,
|
||||||
AutomatedLatestContentBlock,
|
AutomatedLatestContentBlock,
|
||||||
ContainerBlock,
|
ContainerBlock,
|
||||||
AutomatedLatestContentInjector,
|
AutomatedLatestContentInjector,
|
||||||
CommunicationComponent
|
Communication
|
||||||
) {
|
) {
|
||||||
|
var EditorApplication = App;
|
||||||
|
var CommunicationComponent = Communication;
|
||||||
|
|
||||||
describe('Automated Latest Content Supervisor', function() {
|
describe('Automated Latest Content Supervisor', function() {
|
||||||
var model;
|
var model;
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
define([
|
define([
|
||||||
'newsletter_editor/App',
|
'newsletter_editor/App',
|
||||||
'newsletter_editor/blocks/button'
|
'newsletter_editor/blocks/button'
|
||||||
], function(EditorApplication, ButtonBlock) {
|
], function(App, ButtonBlock) {
|
||||||
|
var EditorApplication = App;
|
||||||
|
|
||||||
describe("Button", function () {
|
describe("Button", function () {
|
||||||
describe("model", function () {
|
describe("model", function () {
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
define([
|
define([
|
||||||
'newsletter_editor/App',
|
'newsletter_editor/App',
|
||||||
'newsletter_editor/blocks/container'
|
'newsletter_editor/blocks/container'
|
||||||
], function(EditorApplication, ContainerBlock) {
|
], function(App, ContainerBlock) {
|
||||||
|
var EditorApplication = App;
|
||||||
|
|
||||||
describe('Container', function () {
|
describe('Container', function () {
|
||||||
var ModelClass = ContainerBlock.ContainerBlockModel;
|
var ModelClass = ContainerBlock.ContainerBlockModel;
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
define([
|
define([
|
||||||
'newsletter_editor/App',
|
'newsletter_editor/App',
|
||||||
'newsletter_editor/blocks/divider'
|
'newsletter_editor/blocks/divider'
|
||||||
], function(EditorApplication, DividerBlock) {
|
], function(App, DividerBlock) {
|
||||||
|
var EditorApplication = App;
|
||||||
|
|
||||||
describe("Divider", function () {
|
describe("Divider", function () {
|
||||||
describe("model", function () {
|
describe("model", function () {
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
define([
|
define([
|
||||||
'newsletter_editor/App',
|
'newsletter_editor/App',
|
||||||
'newsletter_editor/blocks/footer'
|
'newsletter_editor/blocks/footer'
|
||||||
], function(EditorApplication, FooterBlock) {
|
], function(App, FooterBlock) {
|
||||||
|
var EditorApplication = App;
|
||||||
|
|
||||||
describe('Footer', function () {
|
describe('Footer', function () {
|
||||||
describe('model', function () {
|
describe('model', function () {
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
define([
|
define([
|
||||||
'newsletter_editor/App',
|
'newsletter_editor/App',
|
||||||
'newsletter_editor/blocks/header'
|
'newsletter_editor/blocks/header'
|
||||||
], function(EditorApplication, HeaderBlock) {
|
], function(App, HeaderBlock) {
|
||||||
|
var EditorApplication = App;
|
||||||
|
|
||||||
describe('Header', function () {
|
describe('Header', function () {
|
||||||
describe('model', function () {
|
describe('model', function () {
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
define([
|
define([
|
||||||
'newsletter_editor/App',
|
'newsletter_editor/App',
|
||||||
'newsletter_editor/blocks/image'
|
'newsletter_editor/blocks/image'
|
||||||
], function(EditorApplication, ImageBlock) {
|
], function(App, ImageBlock) {
|
||||||
|
var EditorApplication = App;
|
||||||
|
|
||||||
describe('Image', function () {
|
describe('Image', function () {
|
||||||
describe('model', function () {
|
describe('model', function () {
|
||||||
|
@ -3,7 +3,9 @@ define([
|
|||||||
'newsletter_editor/components/communication',
|
'newsletter_editor/components/communication',
|
||||||
'newsletter_editor/blocks/posts',
|
'newsletter_editor/blocks/posts',
|
||||||
'newsletter_editor/blocks/container'
|
'newsletter_editor/blocks/container'
|
||||||
], function(EditorApplication, CommunicationComponent, PostsBlock, ContainerBlock) {
|
], function(App, Communication, PostsBlock, ContainerBlock) {
|
||||||
|
var EditorApplication = App;
|
||||||
|
var CommunicationComponent = Communication;
|
||||||
|
|
||||||
describe('Posts', function () {
|
describe('Posts', function () {
|
||||||
Backbone.Radio = {
|
Backbone.Radio = {
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
define([
|
define([
|
||||||
'newsletter_editor/App',
|
'newsletter_editor/App',
|
||||||
'newsletter_editor/blocks/spacer'
|
'newsletter_editor/blocks/spacer'
|
||||||
], function(EditorApplication, SpacerBlock) {
|
], function(App, SpacerBlock) {
|
||||||
|
var EditorApplication = App;
|
||||||
|
|
||||||
describe('Spacer', function () {
|
describe('Spacer', function () {
|
||||||
describe('model', function () {
|
describe('model', function () {
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
define([
|
define([
|
||||||
'newsletter_editor/App',
|
'newsletter_editor/App',
|
||||||
'newsletter_editor/components/content'
|
'newsletter_editor/components/content'
|
||||||
], function(EditorApplication, ContentComponent) {
|
], function(App, ContentComponent) {
|
||||||
|
var EditorApplication = App;
|
||||||
|
|
||||||
describe('Content', function() {
|
describe('Content', function() {
|
||||||
describe('newsletter model', function() {
|
describe('newsletter model', function() {
|
||||||
|
@ -3,7 +3,8 @@ define([
|
|||||||
'newsletter_editor/components/save',
|
'newsletter_editor/components/save',
|
||||||
'amd-inject-loader!newsletter_editor/components/save',
|
'amd-inject-loader!newsletter_editor/components/save',
|
||||||
'jquery'
|
'jquery'
|
||||||
], function(EditorApplication, SaveComponent, SaveInjector, jQuery) {
|
], function(App, SaveComponent, SaveInjector, jQuery) {
|
||||||
|
var EditorApplication = App;
|
||||||
|
|
||||||
describe('Save', function() {
|
describe('Save', function() {
|
||||||
describe('save method', function() {
|
describe('save method', function() {
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
define([
|
define([
|
||||||
'newsletter_editor/App',
|
'newsletter_editor/App',
|
||||||
'newsletter_editor/components/styles'
|
'newsletter_editor/components/styles'
|
||||||
], function(EditorApplication, StylesComponent) {
|
], function(App, StylesComponent) {
|
||||||
|
var EditorApplication = App;
|
||||||
|
|
||||||
describe('Styles', function () {
|
describe('Styles', function () {
|
||||||
it('loads and stores globally available styles', function() {
|
it('loads and stores globally available styles', function() {
|
||||||
|
Reference in New Issue
Block a user