Version Description
- 29 April 2019 =
- Image: Fix images vertical stretching.
- Image: Fix widths for images wrapped in links.
- Google Maps Location Field: Remove some unnecessary use of jQuery to avoid
$ is not a function
errors. - Google Maps Location Field: Check if matchError exists before accessing.
Download this release
Release Info
Developer | gpriday |
Plugin | SiteOrigin Widgets Bundle |
Version | 1.15.6 |
Comparing to | |
See all releases |
Code changes from version 1.15.5 to 1.15.6
readme.txt
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
=== SiteOrigin Widgets Bundle ===
|
2 |
Tags: bundle, widget, button, slider, image, carousel, price table, google maps, tinymce, social links
|
3 |
Requires at least: 4.2
|
4 |
-
Tested up to: 5.
|
5 |
-
Stable tag: 1.15.
|
6 |
-
Build time: 2019-04-
|
7 |
License: GPLv3 or later
|
8 |
Contributors: gpriday, braam-genis
|
9 |
Donate link: https://siteorigin.com/downloads/premium/
|
@@ -65,6 +65,12 @@ The SiteOrigin Widgets Bundle is the perfect platform to build widgets for your
|
|
65 |
|
66 |
== Changelog ==
|
67 |
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
= 1.15.5 - 25 April 2019 =
|
69 |
* Removed admin notice for new widgets.
|
70 |
* Slider Base Widget: Removed unused background videos height setting.
|
1 |
=== SiteOrigin Widgets Bundle ===
|
2 |
Tags: bundle, widget, button, slider, image, carousel, price table, google maps, tinymce, social links
|
3 |
Requires at least: 4.2
|
4 |
+
Tested up to: 5.2
|
5 |
+
Stable tag: 1.15.6
|
6 |
+
Build time: 2019-04-29T11:24:58-07:00
|
7 |
License: GPLv3 or later
|
8 |
Contributors: gpriday, braam-genis
|
9 |
Donate link: https://siteorigin.com/downloads/premium/
|
65 |
|
66 |
== Changelog ==
|
67 |
|
68 |
+
= 1.15.6 - 29 April 2019 =
|
69 |
+
* Image: Fix images vertical stretching.
|
70 |
+
* Image: Fix widths for images wrapped in links.
|
71 |
+
* Google Maps Location Field: Remove some unnecessary use of jQuery to avoid `$ is not a function` errors.
|
72 |
+
* Google Maps Location Field: Check if matchError exists before accessing.
|
73 |
+
|
74 |
= 1.15.5 - 25 April 2019 =
|
75 |
* Removed admin notice for new widgets.
|
76 |
* Slider Base Widget: Removed unused background videos height setting.
|
so-widgets-bundle.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/*
|
3 |
Plugin Name: SiteOrigin Widgets Bundle
|
4 |
Description: A collection of all widgets, neatly bundled into a single plugin. It's also a framework to code your own widgets on top of.
|
5 |
-
Version: 1.15.
|
6 |
Text Domain: so-widgets-bundle
|
7 |
Domain Path: /lang
|
8 |
Author: SiteOrigin
|
@@ -12,7 +12,7 @@ License: GPL3
|
|
12 |
License URI: https://www.gnu.org/licenses/gpl-3.0.txt
|
13 |
*/
|
14 |
|
15 |
-
define('SOW_BUNDLE_VERSION', '1.15.
|
16 |
define('SOW_BUNDLE_BASE_FILE', __FILE__);
|
17 |
|
18 |
// Allow JS suffix to be pre-set
|
2 |
/*
|
3 |
Plugin Name: SiteOrigin Widgets Bundle
|
4 |
Description: A collection of all widgets, neatly bundled into a single plugin. It's also a framework to code your own widgets on top of.
|
5 |
+
Version: 1.15.6
|
6 |
Text Domain: so-widgets-bundle
|
7 |
Domain Path: /lang
|
8 |
Author: SiteOrigin
|
12 |
License URI: https://www.gnu.org/licenses/gpl-3.0.txt
|
13 |
*/
|
14 |
|
15 |
+
define('SOW_BUNDLE_VERSION', '1.15.6');
|
16 |
define('SOW_BUNDLE_BASE_FILE', __FILE__);
|
17 |
|
18 |
// Allow JS suffix to be pre-set
|
widgets/google-map/fields/js/location-field.js
CHANGED
@@ -11,57 +11,58 @@ sowbForms.LocationField = function () {
|
|
11 |
return;
|
12 |
}
|
13 |
|
14 |
-
var
|
15 |
-
var
|
16 |
-
var autocomplete = new google.maps.places.Autocomplete(
|
17 |
|
18 |
var getSimplePlace = function ( place ) {
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
};
|
39 |
|
40 |
var onPlaceChanged = function () {
|
41 |
var place = autocomplete.getPlace();
|
42 |
|
43 |
getSimplePlace( place )
|
44 |
-
.
|
45 |
-
|
46 |
-
|
47 |
} )
|
48 |
-
.
|
49 |
console.warn( 'SiteOrigin Google Maps Widget: Geocoding failed for "' + place.name + '" with status: ' + status );
|
50 |
} );
|
51 |
};
|
52 |
|
53 |
autocomplete.addListener( 'place_changed', onPlaceChanged );
|
54 |
|
55 |
-
|
56 |
-
|
57 |
-
|
|
|
58 |
} );
|
59 |
|
60 |
-
if (
|
61 |
// Attempt automatic migration
|
62 |
var place = {};
|
63 |
try {
|
64 |
-
var parsed = JSON.parse(
|
65 |
if ( ! parsed.hasOwnProperty( 'location' ) ) {
|
66 |
if ( parsed.hasOwnProperty( 'address' ) ) {
|
67 |
place.name = parsed.address;
|
@@ -69,7 +70,7 @@ sowbForms.LocationField = function () {
|
|
69 |
}
|
70 |
} catch ( error ) {
|
71 |
// Let's just try use the value directly.
|
72 |
-
place.name =
|
73 |
}
|
74 |
if ( place.hasOwnProperty( 'name' ) && place.name !== 'null') {
|
75 |
if ( ! sowbForms.mapsMigrationLogged ) {
|
@@ -79,9 +80,9 @@ sowbForms.LocationField = function () {
|
|
79 |
var delay = 100;
|
80 |
function callGetSimplePlace( place, field ) {
|
81 |
getSimplePlace( place )
|
82 |
-
.
|
83 |
-
field.
|
84 |
-
|
85 |
sowbForms._geocodeQueue.shift();
|
86 |
if ( sowbForms._geocodeQueue.length > 0 ) {
|
87 |
var next = sowbForms._geocodeQueue[ 0 ];
|
@@ -92,7 +93,7 @@ sowbForms.LocationField = function () {
|
|
92 |
console.info( 'SiteOrigin Google Maps Widget: Location fields updated. Please save the post to complete the migration.' );
|
93 |
}
|
94 |
} )
|
95 |
-
.
|
96 |
if ( status === google.maps.GeocoderStatus.OVER_QUERY_LIMIT ) {
|
97 |
if ( ! sowbForms.hasOwnProperty( 'overQueryLimitCount' ) ) {
|
98 |
sowbForms.overQueryLimitCount = 1;
|
@@ -116,10 +117,10 @@ sowbForms.LocationField = function () {
|
|
116 |
}
|
117 |
} );
|
118 |
}
|
119 |
-
sowbForms._geocodeQueue.push( { place: place, field:
|
120 |
if ( sowbForms._geocodeQueue.length === 1 ) {
|
121 |
setTimeout( function () {
|
122 |
-
callGetSimplePlace( place,
|
123 |
}, delay );
|
124 |
}
|
125 |
}
|
@@ -130,10 +131,10 @@ sowbForms.LocationField = function () {
|
|
130 |
|
131 |
sowbForms.setupLocationFields = function () {
|
132 |
if ( google && google.maps && google.maps.places ) {
|
133 |
-
|
134 |
-
if (
|
135 |
new sowbForms.LocationField().init( element );
|
136 |
-
|
137 |
}
|
138 |
} );
|
139 |
}
|
@@ -146,7 +147,7 @@ function sowbAdminGoogleMapInit() {
|
|
146 |
sowbForms.setupLocationFields();
|
147 |
}
|
148 |
|
149 |
-
( function (
|
150 |
|
151 |
$( document ).on( 'sowsetupformfield', '.siteorigin-widget-field-type-location', function () {
|
152 |
|
@@ -199,10 +200,12 @@ function sowbAdminGoogleMapInit() {
|
|
199 |
// This occurs when the API key has been restricted to prevent use of certain APIs.
|
200 |
matchError = error.match( /^This API project is not authorized to use this API/ );
|
201 |
}
|
202 |
-
if ( matchError
|
203 |
-
|
204 |
-
|
205 |
-
matchError
|
|
|
|
|
206 |
}
|
207 |
}
|
208 |
if ( matchError ) {
|
@@ -243,4 +246,4 @@ function sowbAdminGoogleMapInit() {
|
|
243 |
$( 'body' ).append( '<script async type="text/javascript" src="' + apiUrl + '">' );
|
244 |
} );
|
245 |
|
246 |
-
}
|
11 |
return;
|
12 |
}
|
13 |
|
14 |
+
var inputField = element.querySelector( '.siteorigin-widget-location-input' );
|
15 |
+
var valueField = element.querySelector( '.siteorigin-widget-input' );
|
16 |
+
var autocomplete = new google.maps.places.Autocomplete( inputField );
|
17 |
|
18 |
var getSimplePlace = function ( place ) {
|
19 |
+
return new Promise(function (resolve, reject) {
|
20 |
+
var simplePlace = {name: place.name};
|
21 |
+
simplePlace.address = place.hasOwnProperty('formatted_address') ? place.formatted_address : '';
|
22 |
+
if (place.hasOwnProperty('geometry')) {
|
23 |
+
simplePlace.location = place.geometry.location.toString();
|
24 |
+
resolve(simplePlace);
|
25 |
+
} else {
|
26 |
+
var addr = {address: place.hasOwnProperty('formatted_address') ? place.formatted_address : place.name};
|
27 |
+
new google.maps.Geocoder().geocode(addr,
|
28 |
+
function (results, status) {
|
29 |
+
if (status === google.maps.GeocoderStatus.OK) {
|
30 |
+
simplePlace.location = results[0].geometry.location.toString();
|
31 |
+
resolve(simplePlace);
|
32 |
+
} else {
|
33 |
+
reject(status);
|
34 |
+
}
|
35 |
+
});
|
36 |
+
}
|
37 |
+
});
|
38 |
};
|
39 |
|
40 |
var onPlaceChanged = function () {
|
41 |
var place = autocomplete.getPlace();
|
42 |
|
43 |
getSimplePlace( place )
|
44 |
+
.then( function ( simplePlace ) {
|
45 |
+
valueField.value = JSON.stringify(simplePlace);
|
46 |
+
valueField.dispatchEvent(new Event('change', {bubbles: true, cancelable: true}));
|
47 |
} )
|
48 |
+
.catch( function ( status ) {
|
49 |
console.warn( 'SiteOrigin Google Maps Widget: Geocoding failed for "' + place.name + '" with status: ' + status );
|
50 |
} );
|
51 |
};
|
52 |
|
53 |
autocomplete.addListener( 'place_changed', onPlaceChanged );
|
54 |
|
55 |
+
inputField.addEventListener( 'change', function () {
|
56 |
+
|
57 |
+
valueField.value = JSON.stringify({name: inputField.value});
|
58 |
+
valueField.dispatchEvent(new Event('change', {bubbles: true, cancelable: true}));
|
59 |
} );
|
60 |
|
61 |
+
if ( valueField.value ) {
|
62 |
// Attempt automatic migration
|
63 |
var place = {};
|
64 |
try {
|
65 |
+
var parsed = JSON.parse( valueField.value );
|
66 |
if ( ! parsed.hasOwnProperty( 'location' ) ) {
|
67 |
if ( parsed.hasOwnProperty( 'address' ) ) {
|
68 |
place.name = parsed.address;
|
70 |
}
|
71 |
} catch ( error ) {
|
72 |
// Let's just try use the value directly.
|
73 |
+
place.name = valueField.value;
|
74 |
}
|
75 |
if ( place.hasOwnProperty( 'name' ) && place.name !== 'null') {
|
76 |
if ( ! sowbForms.mapsMigrationLogged ) {
|
80 |
var delay = 100;
|
81 |
function callGetSimplePlace( place, field ) {
|
82 |
getSimplePlace( place )
|
83 |
+
.then( function ( simplePlace ) {
|
84 |
+
field.value = JSON.stringify( simplePlace );
|
85 |
+
valueField.dispatchEvent(new Event('change', {bubbles: true, cancelable: true}));
|
86 |
sowbForms._geocodeQueue.shift();
|
87 |
if ( sowbForms._geocodeQueue.length > 0 ) {
|
88 |
var next = sowbForms._geocodeQueue[ 0 ];
|
93 |
console.info( 'SiteOrigin Google Maps Widget: Location fields updated. Please save the post to complete the migration.' );
|
94 |
}
|
95 |
} )
|
96 |
+
.catch( function ( status ) {
|
97 |
if ( status === google.maps.GeocoderStatus.OVER_QUERY_LIMIT ) {
|
98 |
if ( ! sowbForms.hasOwnProperty( 'overQueryLimitCount' ) ) {
|
99 |
sowbForms.overQueryLimitCount = 1;
|
117 |
}
|
118 |
} );
|
119 |
}
|
120 |
+
sowbForms._geocodeQueue.push( { place: place, field: valueField } );
|
121 |
if ( sowbForms._geocodeQueue.length === 1 ) {
|
122 |
setTimeout( function () {
|
123 |
+
callGetSimplePlace( place, valueField );
|
124 |
}, delay );
|
125 |
}
|
126 |
}
|
131 |
|
132 |
sowbForms.setupLocationFields = function () {
|
133 |
if ( google && google.maps && google.maps.places ) {
|
134 |
+
document.querySelectorAll( '.siteorigin-widget-field-type-location' ).forEach( function ( element ) {
|
135 |
+
if ( element.getAttribute( 'data-initialized' ) !== 'true' ) {
|
136 |
new sowbForms.LocationField().init( element );
|
137 |
+
element.setAttribute('data-initialized', 'true');
|
138 |
}
|
139 |
} );
|
140 |
}
|
147 |
sowbForms.setupLocationFields();
|
148 |
}
|
149 |
|
150 |
+
window.addEventListener('DOMContentLoaded', function () {
|
151 |
|
152 |
$( document ).on( 'sowsetupformfield', '.siteorigin-widget-field-type-location', function () {
|
153 |
|
200 |
// This occurs when the API key has been restricted to prevent use of certain APIs.
|
201 |
matchError = error.match( /^This API project is not authorized to use this API/ );
|
202 |
}
|
203 |
+
if ( matchError ) {
|
204 |
+
if ( matchError.length === 3 ) {
|
205 |
+
matchError = matchError[ 2 ];
|
206 |
+
} else if ( matchError.length === 1 ) {
|
207 |
+
matchError = 'ApiNotActivatedMapError';
|
208 |
+
}
|
209 |
}
|
210 |
}
|
211 |
if ( matchError ) {
|
246 |
$( 'body' ).append( '<script async type="text/javascript" src="' + apiUrl + '">' );
|
247 |
} );
|
248 |
|
249 |
+
});
|
widgets/google-map/fields/js/location-field.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
function sowbAdminGoogleMapInit(){sowbForms.mapsInitializing=!1,sowbForms.mapsInitialized=!0,sowbForms.setupLocationFields()}window.sowbForms=window.sowbForms||{},sowbForms.LocationField=function(){return{init:function(o){if(void 0!==google.maps.places){var e
|
1 |
+
function sowbAdminGoogleMapInit(){sowbForms.mapsInitializing=!1,sowbForms.mapsInitialized=!0,sowbForms.setupLocationFields()}window.sowbForms=window.sowbForms||{},sowbForms.LocationField=function(){return{init:function(o){if(void 0!==google.maps.places){var e=o.querySelector(".siteorigin-widget-location-input"),s=o.querySelector(".siteorigin-widget-input"),i=new google.maps.places.Autocomplete(e),n=function(e){return new Promise(function(i,t){var s={name:e.name};if(s.address=e.hasOwnProperty("formatted_address")?e.formatted_address:"",e.hasOwnProperty("geometry"))s.location=e.geometry.location.toString(),i(s);else{var o={address:e.hasOwnProperty("formatted_address")?e.formatted_address:e.name};(new google.maps.Geocoder).geocode(o,function(o,e){e===google.maps.GeocoderStatus.OK?(s.location=o[0].geometry.location.toString(),i(s)):t(e)})}})};if(i.addListener("place_changed",function(){var e=i.getPlace();n(e).then(function(o){s.value=JSON.stringify(o),s.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0}))}).catch(function(o){console.warn('SiteOrigin Google Maps Widget: Geocoding failed for "'+e.name+'" with status: '+o)})}),e.addEventListener("change",function(){s.value=JSON.stringify({name:e.value}),s.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0}))}),s.value){var t={};try{var a=JSON.parse(s.value);a.hasOwnProperty("location")||a.hasOwnProperty("address")&&(t.name=a.address)}catch(o){t.name=s.value}if(t.hasOwnProperty("name")&&"null"!==t.name){sowbForms.mapsMigrationLogged||(console.info("SiteOrigin Google Maps Widget: Starting automatic migration of location. Please wait a moment..."),sowbForms.mapsMigrationLogged=!0);var r=100;sowbForms._geocodeQueue.push({place:t,field:s}),1===sowbForms._geocodeQueue.length&&setTimeout(function(){!function i(o,t){n(o).then(function(o){if(t.value=JSON.stringify(o),s.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0})),sowbForms._geocodeQueue.shift(),0<sowbForms._geocodeQueue.length){var e=sowbForms._geocodeQueue[0];setTimeout(function(){i(e.place,e.field)},r)}else console.info("SiteOrigin Google Maps Widget: Location fields updated. Please save the post to complete the migration.")}).catch(function(o){if(o===google.maps.GeocoderStatus.OVER_QUERY_LIMIT)if(sowbForms.hasOwnProperty("overQueryLimitCount")?sowbForms.overQueryLimitCount++:sowbForms.overQueryLimitCount=1,sowbForms.overQueryLimitCount<3){var e=sowbForms._geocodeQueue[0];r*=10,setTimeout(function(){i(e.place,e.field)},r)}else console.warn("SiteOrigin Google Maps Widget: Automatic migration of old address failed with status: "+o),console.info("SiteOrigin Google Maps Widget: Please save this post and open the form to try again.")})}(t,s)},r)}}}else console.error("SiteOrigin Google Maps Widget: Failed to load the places library.")}}},sowbForms.setupLocationFields=function(){google&&google.maps&&google.maps.places&&document.querySelectorAll(".siteorigin-widget-field-type-location").forEach(function(o){"true"!==o.getAttribute("data-initialized")&&((new sowbForms.LocationField).init(o),o.setAttribute("data-initialized","true"))})},window.addEventListener("DOMContentLoaded",function(){$(document).on("sowsetupformfield",".siteorigin-widget-field-type-location",function(){sowbForms._geocodeQueue=sowbForms._geocodeQueue||[];var i=$(this);if(!i.is(":not(:visible)")&&!sowbForms.mapsInitializing)if(sowbForms.mapsInitialized)sowbForms.setupLocationFields();else{sowbForms.mapsInitializing=!0;var o=i.find(".location-field-data").data("apiKey");if(o||(sowbForms.displayNotice($(this).closest(".siteorigin-widget-form"),soLocationField.missingApiKey,"",[{label:soLocationField.globalSettingsButtonLabel,url:soLocationField.globalSettingsButtonUrl}],i),console.warn("SiteOrigin Google Maps Widget: Could not find API key. Google Maps API key is required."),o=""),window.console&&window.console.error){var t=window.console.error;sowbForms.checkMapsApiInvalidKeyError=function(o){var e;if("string"==typeof o&&(null===(e=o.match(/^Google Maps.*API (error|warning): (.*)/))&&(e=o.match(/^This API project is not authorized to use this API/)),e&&(3===e.length?e=e[2]:1===e.length&&(e="ApiNotActivatedMapError"))),e)switch(e){case"InvalidKeyMapError":sowbForms.displayNotice($(this).closest(".siteorigin-widget-form"),soLocationField.invalidApiKey,"",[{label:soLocationField.globalSettingsButtonLabel,url:soLocationField.globalSettingsButtonUrl}],i);break;case"ApiNotActivatedMapError":sowbForms.displayNotice($(this).closest(".siteorigin-widget-form"),soLocationField.apiNotEnabled,"",[],i)}t.apply(window.console,arguments)}.bind(this),window.console.error=sowbForms.checkMapsApiInvalidKeyError}var e="https://maps.googleapis.com/maps/api/js?key="+o+"&libraries=places&callback=sowbAdminGoogleMapInit";$("body").append('<script async type="text/javascript" src="'+e+'">')}})});
|
widgets/image/styles/default.less
CHANGED
@@ -11,6 +11,7 @@
|
|
11 |
|
12 |
.sow-image-container {
|
13 |
display: flex;
|
|
|
14 |
& when( @image_alignment = left ) {
|
15 |
justify-content: flex-start;
|
16 |
}
|
@@ -21,6 +22,10 @@
|
|
21 |
justify-content: center;
|
22 |
}
|
23 |
|
|
|
|
|
|
|
|
|
24 |
.so-widget-image {
|
25 |
display: block;
|
26 |
max-width: @image_max_width;
|
11 |
|
12 |
.sow-image-container {
|
13 |
display: flex;
|
14 |
+
align-items: flex-start;
|
15 |
& when( @image_alignment = left ) {
|
16 |
justify-content: flex-start;
|
17 |
}
|
22 |
justify-content: center;
|
23 |
}
|
24 |
|
25 |
+
> a {
|
26 |
+
width: @image_width;
|
27 |
+
}
|
28 |
+
|
29 |
.so-widget-image {
|
30 |
display: block;
|
31 |
max-width: @image_max_width;
|