Rename jQuery Serialize Object function to prevent conflicts [MAILPOET-1190]
This commit is contained in:
@ -44,7 +44,7 @@ define(
|
|||||||
this.loadItem(this.props.params.id);
|
this.loadItem(this.props.params.id);
|
||||||
} else {
|
} else {
|
||||||
this.setState({
|
this.setState({
|
||||||
item: jQuery('.mailpoet_form').serializeObject(),
|
item: jQuery('.mailpoet_form').mailpoetSerializeObject(),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1060,7 +1060,7 @@ WysijaForm.Widget = window.Class.create(WysijaForm.Block, {
|
|||||||
template: window.jQuery('#form_template_field_settings').html(),
|
template: window.jQuery('#form_template_field_settings').html(),
|
||||||
data: this.getData(),
|
data: this.getData(),
|
||||||
onSuccess: function () {
|
onSuccess: function () {
|
||||||
var data = window.jQuery('#form_field_settings').serializeObject();
|
var data = window.jQuery('#form_field_settings').mailpoetSerializeObject();
|
||||||
this.redraw(data);
|
this.redraw(data);
|
||||||
}.bind(this)
|
}.bind(this)
|
||||||
});
|
});
|
||||||
|
@ -23,7 +23,7 @@ define(
|
|||||||
* Dual licensed under the MIT and GPL licenses.
|
* Dual licensed under the MIT and GPL licenses.
|
||||||
* http://benalman.com/about/license/
|
* http://benalman.com/about/license/
|
||||||
*/
|
*/
|
||||||
$.fn.serializeObject = function (coerce) {
|
$.fn.mailpoetSerializeObject = function (coerce) {
|
||||||
var obj = {};
|
var obj = {};
|
||||||
var coerce_types = { true: !0, false: !1, null: null };
|
var coerce_types = { true: !0, false: !1, null: null };
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ function (
|
|||||||
});
|
});
|
||||||
|
|
||||||
form.parsley().on('form:submit', function (parsley) {
|
form.parsley().on('form:submit', function (parsley) {
|
||||||
var form_data = form.serializeObject() || {};
|
var form_data = form.mailpoetSerializeObject() || {};
|
||||||
// check if we're on the same domain
|
// check if we're on the same domain
|
||||||
if (isSameDomain(window.MailPoetForm.ajax_url) === false) {
|
if (isSameDomain(window.MailPoetForm.ajax_url) === false) {
|
||||||
// non ajax post request
|
// non ajax post request
|
||||||
|
@ -771,7 +771,7 @@ define(
|
|||||||
});
|
});
|
||||||
jQuery('#form_field_new').parsley().on('form:submit', function () {
|
jQuery('#form_field_new').parsley().on('form:submit', function () {
|
||||||
// get data
|
// get data
|
||||||
var data = jQuery(this.$element).serializeObject();
|
var data = jQuery(this.$element).mailpoetSerializeObject();
|
||||||
|
|
||||||
// save custom field
|
// save custom field
|
||||||
MailPoet.Ajax.post({
|
MailPoet.Ajax.post({
|
||||||
|
@ -70,7 +70,7 @@
|
|||||||
|
|
||||||
$('#form_field_new').parsley().on('form:submit', function(parsley) {
|
$('#form_field_new').parsley().on('form:submit', function(parsley) {
|
||||||
// get data
|
// get data
|
||||||
var data = $(this.$element).serializeObject();
|
var data = $(this.$element).mailpoetSerializeObject();
|
||||||
|
|
||||||
// save custom field
|
// save custom field
|
||||||
MailPoet.Ajax.post({
|
MailPoet.Ajax.post({
|
||||||
|
@ -80,7 +80,7 @@
|
|||||||
|
|
||||||
function saveSettings() {
|
function saveSettings() {
|
||||||
// serialize form data
|
// serialize form data
|
||||||
var settings_data = $('#mailpoet_settings_form').serializeObject();
|
var settings_data = $('#mailpoet_settings_form').mailpoetSerializeObject();
|
||||||
|
|
||||||
// show loading screen
|
// show loading screen
|
||||||
MailPoet.Modal.loading(true);
|
MailPoet.Modal.loading(true);
|
||||||
|
@ -699,7 +699,7 @@
|
|||||||
// get test email and include it in data
|
// get test email and include it in data
|
||||||
var recipient = $('#mailpoet_mta_test_email').val();
|
var recipient = $('#mailpoet_mta_test_email').val();
|
||||||
|
|
||||||
var settings = jQuery('#mailpoet_settings_form').serializeObject();
|
var settings = jQuery('#mailpoet_settings_form').mailpoetSerializeObject();
|
||||||
var mailer = settings.mta;
|
var mailer = settings.mta;
|
||||||
|
|
||||||
mailer.method = getMethodFromGroup($('#mta_group').val());
|
mailer.method = getMethodFromGroup($('#mta_group').val());
|
||||||
|
Reference in New Issue
Block a user