Skip to content

Commit b72fec3

Browse files
authored
Fix removal of spaces. Fixes #41 (#81)
* Fix removal of spaces. Fixes #41 * Fix removal of spaces. Fixes #41 * Fix removal of spaces. Fixes #41
1 parent 0578c70 commit b72fec3

File tree

9 files changed

+78
-55
lines changed

9 files changed

+78
-55
lines changed

assets/js/spa-app.js

Lines changed: 31 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
'use strict';
22

3-
var _typeof11 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
3+
var _typeof13 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
4+
5+
var _typeof12 = typeof Symbol === "function" && _typeof13(Symbol.iterator) === "symbol" ? function (obj) {
6+
return typeof obj === "undefined" ? "undefined" : _typeof13(obj);
7+
} : function (obj) {
8+
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof13(obj);
9+
};
10+
11+
var _typeof11 = typeof Symbol === "function" && _typeof12(Symbol.iterator) === "symbol" ? function (obj) {
12+
return typeof obj === "undefined" ? "undefined" : _typeof12(obj);
13+
} : function (obj) {
14+
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof12(obj);
15+
};
416

517
var _typeof10 = typeof Symbol === "function" && _typeof11(Symbol.iterator) === "symbol" ? function (obj) {
618
return typeof obj === "undefined" ? "undefined" : _typeof11(obj);
@@ -62,9 +74,9 @@ var _typeof = typeof Symbol === "function" && _typeof2(Symbol.iterator) === "sym
6274
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof2(obj);
6375
};
6476

65-
/*!
66-
weForms - v1.4.6
67-
Generated: 2020-03-06 (1583433044699)
77+
/*!
78+
weForms - v1.4.6
79+
Generated: 2020-03-06 (1583433044699)
6880
*/
6981

7082
;(function ($) {
@@ -323,9 +335,9 @@ Generated: 2020-03-06 (1583433044699)
323335

324336
this.$store.commit('panel_add_show_prop');
325337

326-
/**
327-
* This is the event hub we'll use in every
328-
* component to communicate between them
338+
/**
339+
* This is the event hub we'll use in every
340+
* component to communicate between them
329341
*/
330342
wpuf_form_builder.event_hub = new Vue();
331343
},
@@ -482,7 +494,7 @@ Generated: 2020-03-06 (1583433044699)
482494

483495
wp.ajax.send('wpuf_form_builder_save_form', {
484496
data: {
485-
form_data: $('#wpuf-form-builder').serialize(),
497+
form_data: $('#wpuf-form-builder').weSerialize(),
486498
form_fields: JSON.stringify(self.form_fields),
487499
notifications: JSON.stringify(self.notifications),
488500
settings: JSON.stringify(self.settings),
@@ -1458,8 +1470,8 @@ Generated: 2020-03-06 (1583433044699)
14581470
;
14591471
}
14601472

1461-
/**
1462-
* Vuex Store data
1473+
/**
1474+
* Vuex Store data
14631475
*/
14641476
var wpuf_form_builder_store = new Vuex.Store({
14651477
state: {
@@ -1795,15 +1807,15 @@ Generated: 2020-03-06 (1583433044699)
17951807
template: '<div><router-view class="grand-child"></router-view></div>'
17961808
};
17971809

1798-
/**
1799-
* Parse the route array and bind required components
1800-
*
1801-
* This changes the weForms.routes array and changes the components
1802-
* so we can use weForms.routeComponents.{compontent} component.
1803-
*
1804-
* @param {array} routes
1805-
*
1806-
* @return {void}
1810+
/**
1811+
* Parse the route array and bind required components
1812+
*
1813+
* This changes the weForms.routes array and changes the components
1814+
* so we can use weForms.routeComponents.{compontent} component.
1815+
*
1816+
* @param {array} routes
1817+
*
1818+
* @return {void}
18071819
*/
18081820
function parseRouteComponent(routes) {
18091821

assets/js/spa-app.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/js/vendor.js

Lines changed: 36 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* assets/wpuf/vendor/vue/vue.js */
1+
/* assets/wpuf/vendor/vue/vue.js */
22
/*!
33
* Vue.js v2.2.4
44
* (c) 2014-2017 Evan You
@@ -9242,8 +9242,8 @@ Vue$3.compile = compileToFunctions;
92429242
return Vue$3;
92439243

92449244
})));
9245-
9246-
/* assets/wpuf/vendor/vuex/vuex.js */
9245+
9246+
/* assets/wpuf/vendor/vuex/vuex.js */
92479247
/**
92489248
* vuex v2.2.1
92499249
* (c) 2017 Evan You
@@ -10055,8 +10055,8 @@ var index = {
1005510055
return index;
1005610056

1005710057
})));
10058-
10059-
/* assets/js/vendor/vue-router.js */
10058+
10059+
/* assets/js/vendor/vue-router.js */
1006010060
/**
1006110061
* vue-router v2.3.1
1006210062
* (c) 2017 Evan You
@@ -12346,8 +12346,8 @@ if (inBrowser && window.Vue) {
1234612346
return VueRouter;
1234712347

1234812348
})));
12349-
12350-
/* assets/js/vendor/nprogress.js */
12349+
12350+
/* assets/js/vendor/nprogress.js */
1235112351
/* NProgress, (c) 2013, 2014 Rico Sta. Cruz - http://ricostacruz.com/nprogress
1235212352
* @license MIT */
1235312353

@@ -12828,8 +12828,8 @@ return VueRouter;
1282812828

1282912829
return NProgress;
1283012830
});
12831-
12832-
/* assets/wpuf/js/jquery-ui-timepicker-addon.js */
12831+
12832+
/* assets/wpuf/js/jquery-ui-timepicker-addon.js */
1283312833
/*
1283412834
* jQuery timepicker addon
1283512835
* By: Trent Richardson [http://trentrichardson.com]
@@ -13772,6 +13772,17 @@ return VueRouter;
1377213772
});
1377313773

1377413774
$.fn.extend({
13775+
/**
13776+
* Custom jQuery serialize wrapper.
13777+
*
13778+
* When WordPress 5.6 increased the jQuery version to 3.5.1, the serialize function changed. Instead of
13779+
* sending spaces as "+", they are sent as "%20". This wrapper is for backwards compatibility.
13780+
*
13781+
* @since ###
13782+
*/
13783+
weSerialize: function() {
13784+
return $( this ).serialize().replaceAll( '%20', '+' );
13785+
},
1377513786
/*
1377613787
* shorthand just to use timepicker..
1377713788
*/
@@ -14749,8 +14760,8 @@ return VueRouter;
1474914760
$.timepicker.version = "1.2";
1475014761

1475114762
})(jQuery);
14752-
14753-
/* assets/wpuf/vendor/sweetalert2/dist/sweetalert2.js */
14763+
14764+
/* assets/wpuf/vendor/sweetalert2/dist/sweetalert2.js */
1475414765
/*!
1475514766
* sweetalert2 v6.6.4
1475614767
* Released under the MIT License.
@@ -16392,8 +16403,8 @@ return sweetAlert;
1639216403

1639316404
})));
1639416405
if (window.Sweetalert2) window.sweetAlert = window.swal = window.Sweetalert2;
16395-
16396-
/* assets/wpuf/vendor/jquery.scrollTo/jquery.scrollTo.js */
16406+
16407+
/* assets/wpuf/vendor/jquery.scrollTo/jquery.scrollTo.js */
1639716408
/*!
1639816409
* jQuery.scrollTo
1639916410
* Copyright (c) 2007-2015 Ariel Flesler - aflesler ○ gmail • com | http://flesler.blogspot.com
@@ -16604,8 +16615,8 @@ if (window.Sweetalert2) window.sweetAlert = window.swal = window.Sweetalert2;
1660416615
// AMD requirement
1660516616
return $scrollTo;
1660616617
});
16607-
16608-
/* assets/wpuf/vendor/selectize/js/standalone/selectize.js */
16618+
16619+
/* assets/wpuf/vendor/selectize/js/standalone/selectize.js */
1660916620
/**
1661016621
* sifter.js
1661116622
* Copyright (c) 2013 Brian Reavis & contributors
@@ -20434,8 +20445,8 @@ if (window.Sweetalert2) window.sweetAlert = window.swal = window.Sweetalert2;
2043420445

2043520446

2043620447
return Selectize;
20437-
}));
20438-
/* assets/wpuf/vendor/toastr/toastr.js */
20448+
}));
20449+
/* assets/wpuf/vendor/toastr/toastr.js */
2043920450
/*
2044020451
* Toastr
2044120452
* Copyright 2012-2015
@@ -20912,8 +20923,8 @@ if (window.Sweetalert2) window.sweetAlert = window.swal = window.Sweetalert2;
2091220923
window.toastr = factory(window.jQuery);
2091320924
}
2091420925
}));
20915-
20916-
/* assets/wpuf/vendor/clipboard/clipboard.js */
20926+
20927+
/* assets/wpuf/vendor/clipboard/clipboard.js */
2091720928
/*!
2091820929
* clipboard.js v1.6.0
2091920930
* https://zenorocha.github.io/clipboard.js
@@ -21691,8 +21702,8 @@ module.exports = E;
2169121702
});
2169221703

2169321704
},{"./clipboard-action":7,"good-listener":4,"tiny-emitter":6}]},{},[8])(8)
21694-
});
21695-
/* assets/wpuf/vendor/tooltip/tooltip.js */
21705+
});
21706+
/* assets/wpuf/vendor/tooltip/tooltip.js */
2169621707
/* ========================================================================
2169721708
* Bootstrap: tooltip.js v3.3.7
2169821709
* http://getbootstrap.com/javascript/#tooltip
@@ -22213,8 +22224,8 @@ module.exports = E;
2221322224
}
2221422225

2221522226
}(jQuery);
22216-
22217-
/* assets/js/vendor/tinymce/plugins/code/plugin.min.js */
22218-
tinymce.PluginManager.add("code",function(a){function b(){var b=a.windowManager.open({title:"Source code",body:{type:"textbox",name:"code",multiline:!0,minWidth:a.getParam("code_dialog_width",600),minHeight:a.getParam("code_dialog_height",Math.min(tinymce.DOM.getViewPort().h-200,500)),spellcheck:!1,style:"direction: ltr; text-align: left"},onSubmit:function(b){a.focus(),a.undoManager.transact(function(){a.setContent(b.data.code)}),a.selection.setCursorLocation(),a.nodeChanged()}});b.find("#code").value(a.getContent({source_view:!0}))}a.addCommand("mceCodeEditor",b),a.addButton("code",{icon:"code",tooltip:"Source code",onclick:b}),a.addMenuItem("code",{icon:"code",text:"Source code",context:"tools",onclick:b})});
22219-
/* assets/js/vendor/tinymce/plugins/hr/plugin.min.js */
22227+
22228+
/* assets/js/vendor/tinymce/plugins/code/plugin.min.js */
22229+
tinymce.PluginManager.add("code",function(a){function b(){var b=a.windowManager.open({title:"Source code",body:{type:"textbox",name:"code",multiline:!0,minWidth:a.getParam("code_dialog_width",600),minHeight:a.getParam("code_dialog_height",Math.min(tinymce.DOM.getViewPort().h-200,500)),spellcheck:!1,style:"direction: ltr; text-align: left"},onSubmit:function(b){a.focus(),a.undoManager.transact(function(){a.setContent(b.data.code)}),a.selection.setCursorLocation(),a.nodeChanged()}});b.find("#code").value(a.getContent({source_view:!0}))}a.addCommand("mceCodeEditor",b),a.addButton("code",{icon:"code",tooltip:"Source code",onclick:b}),a.addMenuItem("code",{icon:"code",text:"Source code",context:"tools",onclick:b})});
22230+
/* assets/js/vendor/tinymce/plugins/hr/plugin.min.js */
2222022231
tinymce.PluginManager.add("hr",function(a){a.addCommand("InsertHorizontalRule",function(){a.execCommand("mceInsertContent",!1,"<hr />")}),a.addButton("hr",{icon:"hr",tooltip:"Horizontal line",cmd:"InsertHorizontalRule"}),a.addMenuItem("hr",{icon:"hr",text:"Horizontal line",cmd:"InsertHorizontalRule",context:"insert"})});

assets/js/weforms.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@
308308

309309
var self = $(this),
310310
form = $(this).closest('form'),
311-
form_data = form.serialize() + '&action=wpuf_draft_post',
311+
form_data = form.weSerialize() + '&action=wpuf_draft_post',
312312
post_id = form.find('input[type="hidden"][name="post_id"]').val();
313313

314314
var rich_texts = [],
@@ -354,7 +354,7 @@
354354
e.preventDefault();
355355
var form = $(this).closest('form');
356356

357-
$.post(wpuf_frontend.ajaxurl, form.serialize(), function (res) {
357+
$.post(wpuf_frontend.ajaxurl, form.weSerialize(), function (res) {
358358
if (res.success) {
359359
form.find('.wpuf-error').hide();
360360
form.find('.wpuf-success').show();
@@ -646,7 +646,7 @@
646646
return false;
647647
}
648648

649-
var form_data = self.serialize(),
649+
var form_data = self.weSerialize(),
650650
rich_texts = [];
651651

652652
// grab rich texts from tinyMCE

assets/js/weforms.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/spa/components/form-builder/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ weForms.routeComponents.FormEditComponent = {
223223

224224
wp.ajax.send('wpuf_form_builder_save_form', {
225225
data: {
226-
form_data: $('#wpuf-form-builder').serialize(),
226+
form_data: $('#wpuf-form-builder').weSerialize(),
227227
form_fields: JSON.stringify(self.form_fields),
228228
notifications: JSON.stringify(self.notifications),
229229
settings: JSON.stringify(self.settings),

assets/wpuf/js/frontend-form.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@
307307

308308
var self = $(this),
309309
form = $(this).closest('form'),
310-
form_data = form.serialize() + '&action=wpuf_draft_post',
310+
form_data = form.weSerialize() + '&action=wpuf_draft_post',
311311
post_id = form.find('input[type="hidden"][name="post_id"]').val();
312312

313313
var rich_texts = [],
@@ -353,7 +353,7 @@
353353
e.preventDefault();
354354
var form = $(this).closest('form');
355355

356-
$.post(wpuf_frontend.ajaxurl, form.serialize(), function (res) {
356+
$.post(wpuf_frontend.ajaxurl, form.weSerialize(), function (res) {
357357
if (res.success) {
358358
form.find('.wpuf-error').hide();
359359
form.find('.wpuf-success').show();
@@ -645,7 +645,7 @@
645645
return false;
646646
}
647647

648-
var form_data = self.serialize(),
648+
var form_data = self.weSerialize(),
649649
rich_texts = [];
650650

651651
// grab rich texts from tinyMCE

assets/wpuf/js/frontend-form.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)