ES5 space-infix-ops
This commit is contained in:
@ -56,7 +56,6 @@
|
|||||||
"strict": 0,
|
"strict": 0,
|
||||||
"vars-on-top": 0,
|
"vars-on-top": 0,
|
||||||
"no-var": 0,
|
"no-var": 0,
|
||||||
"space-infix-ops": 0,
|
|
||||||
"no-unused-vars": 0,
|
"no-unused-vars": 0,
|
||||||
"object-shorthand": 0,
|
"object-shorthand": 0,
|
||||||
"new-parens": 0,
|
"new-parens": 0,
|
||||||
|
@ -148,7 +148,7 @@ define('date',
|
|||||||
for(var index = 0, token = ''; format.charAt(index); index += 1) {
|
for(var index = 0, token = ''; format.charAt(index); index += 1) {
|
||||||
token = format.charAt(index);
|
token = format.charAt(index);
|
||||||
if (escapeToken === true) {
|
if (escapeToken === true) {
|
||||||
convertedFormat.push('['+token+']');
|
convertedFormat.push('[' + token + ']');
|
||||||
escapeToken = false;
|
escapeToken = false;
|
||||||
} else {
|
} else {
|
||||||
if (token === '\\') {
|
if (token === '\\') {
|
||||||
@ -158,7 +158,7 @@ define('date',
|
|||||||
} else if (replacements[token] !== undefined) {
|
} else if (replacements[token] !== undefined) {
|
||||||
convertedFormat.push(replacements[token]);
|
convertedFormat.push(replacements[token]);
|
||||||
} else {
|
} else {
|
||||||
convertedFormat.push('['+token+']');
|
convertedFormat.push('[' + token + ']');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -76,7 +76,7 @@ define(
|
|||||||
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[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];
|
cur = cur[key];
|
||||||
}
|
}
|
||||||
|
@ -79,30 +79,30 @@ define('modal', ['mailpoet', 'jquery'],
|
|||||||
options: {},
|
options: {},
|
||||||
templates: {
|
templates: {
|
||||||
overlay: '<div id="mailpoet_modal_overlay" style="display:none;"></div>',
|
overlay: '<div id="mailpoet_modal_overlay" style="display:none;"></div>',
|
||||||
popup: '<div id="mailpoet_popup" tabindex="-1">'+
|
popup: '<div id="mailpoet_popup" tabindex="-1">' +
|
||||||
'<div class="mailpoet_popup_wrapper">'+
|
'<div class="mailpoet_popup_wrapper">' +
|
||||||
'<a href="javascript:;" id="mailpoet_modal_close"></a>'+
|
'<a href="javascript:;" id="mailpoet_modal_close"></a>' +
|
||||||
'<div id="mailpoet_popup_title"><h2></h2></div>'+
|
'<div id="mailpoet_popup_title"><h2></h2></div>' +
|
||||||
'<div class="mailpoet_popup_body clearfix"></div>'+
|
'<div class="mailpoet_popup_body clearfix"></div>' +
|
||||||
'</div>'+
|
'</div>' +
|
||||||
'</div>',
|
'</div>',
|
||||||
loading: '<div id="mailpoet_loading" style="display:none;">'+
|
loading: '<div id="mailpoet_loading" style="display:none;">' +
|
||||||
'<div id="mailpoet_modal_loading_1" class="mailpoet_modal_loading"></div>'+
|
'<div id="mailpoet_modal_loading_1" class="mailpoet_modal_loading"></div>' +
|
||||||
'<div id="mailpoet_modal_loading_2" class="mailpoet_modal_loading"></div>'+
|
'<div id="mailpoet_modal_loading_2" class="mailpoet_modal_loading"></div>' +
|
||||||
'<div id="mailpoet_modal_loading_3" class="mailpoet_modal_loading"></div>'+
|
'<div id="mailpoet_modal_loading_3" class="mailpoet_modal_loading"></div>' +
|
||||||
'</div>',
|
'</div>',
|
||||||
panel: '<div id="mailpoet_panel">'+
|
panel: '<div id="mailpoet_panel">' +
|
||||||
'<a href="javascript:;" id="mailpoet_modal_close"></a>'+
|
'<a href="javascript:;" id="mailpoet_modal_close"></a>' +
|
||||||
'<div class="mailpoet_panel_wrapper" tabindex="-1">'+
|
'<div class="mailpoet_panel_wrapper" tabindex="-1">' +
|
||||||
'<div class="mailpoet_panel_body clearfix"></div>'+
|
'<div class="mailpoet_panel_body clearfix"></div>' +
|
||||||
'</div>'+
|
'</div>' +
|
||||||
'</div>',
|
'</div>',
|
||||||
subpanel: '<div class="mailpoet_panel_wrapper" tabindex="-1">'+
|
subpanel: '<div class="mailpoet_panel_wrapper" tabindex="-1">' +
|
||||||
'<div class="mailpoet_panel_body clearfix"></div>'+
|
'<div class="mailpoet_panel_body clearfix"></div>' +
|
||||||
'</div>'
|
'</div>'
|
||||||
},
|
},
|
||||||
getContentContainer: function () {
|
getContentContainer: function () {
|
||||||
return jQuery('.mailpoet_'+this.options.type+'_body');
|
return jQuery('.mailpoet_' + this.options.type + '_body');
|
||||||
},
|
},
|
||||||
setRenderer: function (renderer) {
|
setRenderer: function (renderer) {
|
||||||
this.renderer = renderer;
|
this.renderer = renderer;
|
||||||
@ -152,7 +152,7 @@ define('modal', ['mailpoet', 'jquery'],
|
|||||||
// add proper overlay class
|
// add proper overlay class
|
||||||
jQuery('#mailpoet_modal_overlay')
|
jQuery('#mailpoet_modal_overlay')
|
||||||
.removeClass('mailpoet_popup_overlay mailpoet_panel_overlay')
|
.removeClass('mailpoet_popup_overlay mailpoet_panel_overlay')
|
||||||
.addClass('mailpoet_'+this.options.type+'_overlay');
|
.addClass('mailpoet_' + this.options.type + '_overlay');
|
||||||
}
|
}
|
||||||
|
|
||||||
// set "success" callback if specified
|
// set "success" callback if specified
|
||||||
@ -249,14 +249,14 @@ define('modal', ['mailpoet', 'jquery'],
|
|||||||
loadTemplate: function () {
|
loadTemplate: function () {
|
||||||
if(this.subpanels.length > 0) {
|
if(this.subpanels.length > 0) {
|
||||||
// hide panel
|
// hide panel
|
||||||
jQuery('.mailpoet_'+this.options.type+'_wrapper').hide();
|
jQuery('.mailpoet_' + this.options.type + '_wrapper').hide();
|
||||||
|
|
||||||
// add sub panel wrapper
|
// add sub panel wrapper
|
||||||
jQuery('#mailpoet_'+this.options.type)
|
jQuery('#mailpoet_' + this.options.type)
|
||||||
.append(this.templates['subpanel']);
|
.append(this.templates['subpanel']);
|
||||||
|
|
||||||
// add sub panel content
|
// add sub panel content
|
||||||
jQuery('.mailpoet_'+this.options.type+'_body').last()
|
jQuery('.mailpoet_' + this.options.type + '_body').last()
|
||||||
.html(this.subpanels[(this.subpanels.length - 1)].element);
|
.html(this.subpanels[(this.subpanels.length - 1)].element);
|
||||||
|
|
||||||
// focus on sub panel
|
// focus on sub panel
|
||||||
@ -264,11 +264,11 @@ define('modal', ['mailpoet', 'jquery'],
|
|||||||
this.focus();
|
this.focus();
|
||||||
}
|
}
|
||||||
} else if (this.options.element) {
|
} else if (this.options.element) {
|
||||||
jQuery('.mailpoet_'+this.options.type+'_body').empty();
|
jQuery('.mailpoet_' + this.options.type + '_body').empty();
|
||||||
jQuery('.mailpoet_'+this.options.type+'_body')
|
jQuery('.mailpoet_' + this.options.type + '_body')
|
||||||
.append(this.options.element);
|
.append(this.options.element);
|
||||||
} else {
|
} else {
|
||||||
jQuery('.mailpoet_'+this.options.type+'_body')
|
jQuery('.mailpoet_' + this.options.type + '_body')
|
||||||
.html(
|
.html(
|
||||||
this.options.body_template(
|
this.options.body_template(
|
||||||
this.options.data
|
this.options.data
|
||||||
@ -347,8 +347,8 @@ define('modal', ['mailpoet', 'jquery'],
|
|||||||
case 'popup':
|
case 'popup':
|
||||||
var screenWidth = jQuery(window).width(),
|
var screenWidth = jQuery(window).width(),
|
||||||
screenHeight = jQuery(window).height(),
|
screenHeight = jQuery(window).height(),
|
||||||
modalWidth = jQuery('.mailpoet_'+ this.options.type +'_wrapper').width(),
|
modalWidth = jQuery('.mailpoet_' + this.options.type + '_wrapper').width(),
|
||||||
modalHeight = jQuery('.mailpoet_'+ this.options.type +'_wrapper').height();
|
modalHeight = jQuery('.mailpoet_' + this.options.type + '_wrapper').height();
|
||||||
|
|
||||||
var top = Math.max(48, parseInt((screenHeight / 2) - (modalHeight / 2))),
|
var top = Math.max(48, parseInt((screenHeight / 2) - (modalHeight / 2))),
|
||||||
left = Math.max(0, parseInt((screenWidth / 2) - (modalWidth / 2)));
|
left = Math.max(0, parseInt((screenWidth / 2) - (modalWidth / 2)));
|
||||||
@ -388,7 +388,7 @@ define('modal', ['mailpoet', 'jquery'],
|
|||||||
jQuery('body').addClass('mailpoet_modal_opened');
|
jQuery('body').addClass('mailpoet_modal_opened');
|
||||||
|
|
||||||
// show popup
|
// show popup
|
||||||
jQuery('#mailpoet_'+this.options.type).show();
|
jQuery('#mailpoet_' + this.options.type).show();
|
||||||
|
|
||||||
// display overlay
|
// display overlay
|
||||||
this.showOverlay();
|
this.showOverlay();
|
||||||
@ -419,10 +419,10 @@ define('modal', ['mailpoet', 'jquery'],
|
|||||||
},
|
},
|
||||||
focus: function () {
|
focus: function () {
|
||||||
if(this.options.type == 'popup') {
|
if(this.options.type == 'popup') {
|
||||||
jQuery('#mailpoet_'+this.options.type).focus();
|
jQuery('#mailpoet_' + this.options.type).focus();
|
||||||
} else {
|
} else {
|
||||||
// panel and subpanel
|
// panel and subpanel
|
||||||
jQuery('#mailpoet_'+this.options.type+' .mailpoet_panel_wrapper')
|
jQuery('#mailpoet_' + this.options.type + ' .mailpoet_panel_wrapper')
|
||||||
.filter(':visible').focus();
|
.filter(':visible').focus();
|
||||||
}
|
}
|
||||||
return this;
|
return this;
|
||||||
@ -441,7 +441,7 @@ define('modal', ['mailpoet', 'jquery'],
|
|||||||
this.opened = false;
|
this.opened = false;
|
||||||
|
|
||||||
// hide modal
|
// hide modal
|
||||||
jQuery('#mailpoet_'+this.options.type).hide();
|
jQuery('#mailpoet_' + this.options.type).hide();
|
||||||
|
|
||||||
// remove class on highlighted elements
|
// remove class on highlighted elements
|
||||||
this.highlightOff();
|
this.highlightOff();
|
||||||
@ -587,8 +587,8 @@ define('modal', ['mailpoet', 'jquery'],
|
|||||||
this.hideOverlay();
|
this.hideOverlay();
|
||||||
|
|
||||||
// remove extra modal
|
// remove extra modal
|
||||||
if(jQuery('#mailpoet_'+this.options.type).length > 0) {
|
if(jQuery('#mailpoet_' + this.options.type).length > 0) {
|
||||||
jQuery('#mailpoet_'+this.options.type).remove();
|
jQuery('#mailpoet_' + this.options.type).remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.initialized = false;
|
this.initialized = false;
|
||||||
@ -600,10 +600,10 @@ define('modal', ['mailpoet', 'jquery'],
|
|||||||
|
|
||||||
if(this.subpanels.length > 0) {
|
if(this.subpanels.length > 0) {
|
||||||
// close subpanel
|
// close subpanel
|
||||||
jQuery('.mailpoet_'+this.options.type+'_wrapper').last().remove();
|
jQuery('.mailpoet_' + this.options.type + '_wrapper').last().remove();
|
||||||
|
|
||||||
// show previous panel
|
// show previous panel
|
||||||
jQuery('.mailpoet_'+this.options.type+'_wrapper').last().show();
|
jQuery('.mailpoet_' + this.options.type + '_wrapper').last().show();
|
||||||
|
|
||||||
// remove last subpanels
|
// remove last subpanels
|
||||||
this.subpanels.pop();
|
this.subpanels.pop();
|
||||||
|
@ -150,7 +150,7 @@ define([
|
|||||||
// compensated for to position marker right in the middle of two
|
// compensated for to position marker right in the middle of two
|
||||||
// blocks
|
// blocks
|
||||||
if (dropPosition.position === 'before') {
|
if (dropPosition.position === 'before') {
|
||||||
$targetBlock = that.getChildren().findByModel(viewCollection.at(dropPosition.index-1)).$el;
|
$targetBlock = that.getChildren().findByModel(viewCollection.at(dropPosition.index - 1)).$el;
|
||||||
} else {
|
} else {
|
||||||
$targetBlock = that.getChildren().findByModel(viewCollection.at(dropPosition.index)).$el;
|
$targetBlock = that.getChildren().findByModel(viewCollection.at(dropPosition.index)).$el;
|
||||||
}
|
}
|
||||||
|
@ -61,7 +61,7 @@ define([
|
|||||||
},
|
},
|
||||||
templateContext: function () {
|
templateContext: function () {
|
||||||
return _.extend({
|
return _.extend({
|
||||||
totalHeight: parseInt(this.model.get('styles.block.padding'), 10)*2 + parseInt(this.model.get('styles.block.borderWidth')) + 'px'
|
totalHeight: parseInt(this.model.get('styles.block.padding'), 10) * 2 + parseInt(this.model.get('styles.block.borderWidth')) + 'px'
|
||||||
}, base.BlockView.prototype.templateContext.apply(this));
|
}, base.BlockView.prototype.templateContext.apply(this));
|
||||||
},
|
},
|
||||||
onRender: function () {
|
onRender: function () {
|
||||||
@ -75,7 +75,7 @@ define([
|
|||||||
changePadding: function () {
|
changePadding: function () {
|
||||||
this.$('.mailpoet_content').css('padding-top', this.model.get('styles.block.padding'));
|
this.$('.mailpoet_content').css('padding-top', this.model.get('styles.block.padding'));
|
||||||
this.$('.mailpoet_content').css('padding-bottom', this.model.get('styles.block.padding'));
|
this.$('.mailpoet_content').css('padding-bottom', this.model.get('styles.block.padding'));
|
||||||
this.$('.mailpoet_resize_handle_text').text(parseInt(this.model.get('styles.block.padding'), 10)*2 + parseInt(this.model.get('styles.block.borderWidth')) + 'px');
|
this.$('.mailpoet_resize_handle_text').text(parseInt(this.model.get('styles.block.padding'), 10) * 2 + parseInt(this.model.get('styles.block.borderWidth')) + 'px');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ define('notice', ['mailpoet', 'jquery'], function (mp, jQuery) {
|
|||||||
},
|
},
|
||||||
createNotice: function () {
|
createNotice: function () {
|
||||||
// clone element
|
// clone element
|
||||||
this.element = jQuery('#mailpoet_notice_'+this.options.type).clone();
|
this.element = jQuery('#mailpoet_notice_' + this.options.type).clone();
|
||||||
|
|
||||||
// add data-id to the element
|
// add data-id to the element
|
||||||
if (this.options.id) {
|
if (this.options.id) {
|
||||||
@ -68,7 +68,7 @@ define('notice', ['mailpoet', 'jquery'], function (mp, jQuery) {
|
|||||||
} else if (typeof this.options.positionAfter === 'string') {
|
} else if (typeof this.options.positionAfter === 'string') {
|
||||||
positionAfter = jQuery(this.options.positionAfter);
|
positionAfter = jQuery(this.options.positionAfter);
|
||||||
} else {
|
} else {
|
||||||
positionAfter = jQuery('#mailpoet_notice_'+this.options.type);
|
positionAfter = jQuery('#mailpoet_notice_' + this.options.type);
|
||||||
}
|
}
|
||||||
positionAfter.after(this.element);
|
positionAfter.after(this.element);
|
||||||
|
|
||||||
@ -99,7 +99,7 @@ define('notice', ['mailpoet', 'jquery'], function (mp, jQuery) {
|
|||||||
},
|
},
|
||||||
updateNotice: function () {
|
updateNotice: function () {
|
||||||
// update notice's message
|
// update notice's message
|
||||||
jQuery('[data-id="'+this.options.id+'"').first().trigger(
|
jQuery('[data-id="' + this.options.id + '"').first().trigger(
|
||||||
'setMessage', this.options.message
|
'setMessage', this.options.message
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@ -107,7 +107,7 @@ define('notice', ['mailpoet', 'jquery'], function (mp, jQuery) {
|
|||||||
var formattedMessage = 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>
|
||||||
formattedMessage = '<p>'+formattedMessage+'</p>';
|
formattedMessage = '<p>' + formattedMessage + '</p>';
|
||||||
// set message
|
// set message
|
||||||
return this.element.html(formattedMessage);
|
return this.element.html(formattedMessage);
|
||||||
},
|
},
|
||||||
@ -125,7 +125,7 @@ define('notice', ['mailpoet', 'jquery'], function (mp, jQuery) {
|
|||||||
if (
|
if (
|
||||||
this.options.id !== null
|
this.options.id !== null
|
||||||
&&
|
&&
|
||||||
jQuery('[data-id="'+this.options.id+'"]').length > 0
|
jQuery('[data-id="' + this.options.id + '"]').length > 0
|
||||||
) {
|
) {
|
||||||
this.updateNotice();
|
this.updateNotice();
|
||||||
} else {
|
} else {
|
||||||
|
@ -47,7 +47,7 @@ define(
|
|||||||
jQuery('.mailpoet_sending_methods, .mailpoet_sending_methods_help').hide();
|
jQuery('.mailpoet_sending_methods, .mailpoet_sending_methods_help').hide();
|
||||||
|
|
||||||
// display selected sending method's settings
|
// display selected sending method's settings
|
||||||
jQuery('.mailpoet_sending_method[data-group="'+ group +'"]').show();
|
jQuery('.mailpoet_sending_method[data-group="' + group + '"]').show();
|
||||||
jQuery('#mailpoet_sending_method_setup').fadeIn();
|
jQuery('#mailpoet_sending_method_setup').fadeIn();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -62,11 +62,11 @@ define(
|
|||||||
jQuery('.mailpoet_panel, .mailpoet_section').hide();
|
jQuery('.mailpoet_panel, .mailpoet_section').hide();
|
||||||
|
|
||||||
// set active tab
|
// set active tab
|
||||||
jQuery('a.nav-tab[href="#'+tab+'"]').addClass('nav-tab-active').blur();
|
jQuery('a.nav-tab[href="#' + tab + '"]').addClass('nav-tab-active').blur();
|
||||||
|
|
||||||
// show selected panel
|
// show selected panel
|
||||||
if(jQuery('.mailpoet_panel[data-tab="'+ tab +'"]').length > 0) {
|
if(jQuery('.mailpoet_panel[data-tab="' + tab + '"]').length > 0) {
|
||||||
jQuery('.mailpoet_panel[data-tab="'+ tab +'"]').show();
|
jQuery('.mailpoet_panel[data-tab="' + tab + '"]').show();
|
||||||
}
|
}
|
||||||
|
|
||||||
// show "save settings" button
|
// show "save settings" button
|
||||||
|
Reference in New Issue
Block a user