cck_forms 3.4.5 → 3.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: efe3b0f1241b517381cbfa1aa2e5d96e0ad99c75
|
|
4
|
+
data.tar.gz: 235413f814b0fb67d658d3893647e44512720610
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 92ad5f9840789a07eb5673322f0e48b5b71a9411119d303d38c69729f98bf7ec576ae5789520c71337c39522827567ef15f2996d268c0be8da834419a64fe92f
|
|
7
|
+
data.tar.gz: 016b972bbfdc29278dbe32c147c6e16755daa0755e9ffb3a3e93ab0fa4df6e7ab6816c4059ce2907869413c62805082dba1c2b8d85bc60ebec8d7ed842e02896
|
|
@@ -11,6 +11,7 @@ class CckForms::ParameterTypeClass::Map
|
|
|
11
11
|
@@map_providers = [MAP_TYPE_YANDEX, MAP_TYPE_GOOGLE]
|
|
12
12
|
|
|
13
13
|
mattr_accessor :google_maps_api_key
|
|
14
|
+
mattr_accessor :yandex_maps_api_key
|
|
14
15
|
|
|
15
16
|
# In MongoDB: {latlon: [x, y], zoom: z}
|
|
16
17
|
#
|
|
@@ -197,7 +198,8 @@ class CckForms::ParameterTypeClass::Map
|
|
|
197
198
|
map_html_containers.push %Q|<div id="#{id}_#{map}" data-id=#{id} class="map_widget" style="display: none; width: #{options[:width]}px; height: #{options[:height]}px"></div>|
|
|
198
199
|
end
|
|
199
200
|
|
|
200
|
-
|
|
201
|
+
google_api_key = @@google_maps_api_key.present? ? "&key=#{@@google_maps_api_key}" : nil
|
|
202
|
+
yandex_api_key = @@yandex_maps_api_key.present? ? "&apikey=#{@@yandex_maps_api_key}" : nil
|
|
201
203
|
|
|
202
204
|
%Q|
|
|
203
205
|
<div class="map-canvas">
|
|
@@ -218,12 +220,12 @@ class CckForms::ParameterTypeClass::Map
|
|
|
218
220
|
var script;
|
|
219
221
|
script = document.createElement('script');
|
|
220
222
|
script.type = 'text/javascript';
|
|
221
|
-
script.src = 'https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&callback=googleMapReady#{
|
|
223
|
+
script.src = 'https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&callback=googleMapReady#{google_api_key}';
|
|
222
224
|
document.body.appendChild(script);
|
|
223
225
|
|
|
224
226
|
script = document.createElement('script');
|
|
225
227
|
script.type = 'text/javascript';
|
|
226
|
-
script.src = 'https://api-maps.yandex.ru/2.0/?coordorder=longlat&load=package.full&wizard=constructor&lang=ru-RU&onload=yandexMapReady';
|
|
228
|
+
script.src = 'https://api-maps.yandex.ru/2.0/?coordorder=longlat&load=package.full&wizard=constructor&lang=ru-RU&onload=yandexMapReady#{yandex_api_key}';
|
|
227
229
|
document.body.appendChild(script);
|
|
228
230
|
}
|
|
229
231
|
|
data/lib/cck_forms/version.rb
CHANGED
|
@@ -35,12 +35,12 @@ class CckFormsMap.AbstractMap
|
|
|
35
35
|
@internalMapAPI.setZoom zoom
|
|
36
36
|
setMarkerToPoint: (latitudeAndLongitude) ->
|
|
37
37
|
|
|
38
|
-
setCenterByGeocode: (geocode) ->
|
|
38
|
+
setCenterByGeocode: (geocode, apikey) ->
|
|
39
39
|
|
|
40
40
|
options = {
|
|
41
41
|
url: 'https://geocode-maps.yandex.ru/1.x/'
|
|
42
42
|
dataType: 'json'
|
|
43
|
-
data: {format: 'json', geocode: geocode, results: 1}
|
|
43
|
+
data: {format: 'json', geocode: geocode, results: 1, apikey: apikey}
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
xhr = $.ajax options
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: cck_forms
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.
|
|
4
|
+
version: 3.5.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ilya Konanykhin
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-
|
|
11
|
+
date: 2019-11-08 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|