scrivito_google_maps_widget 0.1.5 → 0.1.6

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: 130fd0f60e93856770442f642c1a3ae7e78864c0
4
- data.tar.gz: c3a25e1532f76ddc16ec1015e1ff425440d3d55e
3
+ metadata.gz: df16f2d97b5824af6a5da28457b5eb6650a16772
4
+ data.tar.gz: 75b8e919b1943d64eacd143f76b04fbd7d0e25f4
5
5
  SHA512:
6
- metadata.gz: 122004dadd7da0ab08c3e2305d2cd88b368b3412efc68c7cfe13ae45a516dc76386efe14cf6341ebad434c6ab0acb788424f3b3b9d2a93f8ac97e20b17b903e2
7
- data.tar.gz: 4fd7895ea13433fb204ff83e8f8b9e4591e317d3656f8602d65e055284b16cbe59491fb3ee9851d6afa2844d14cb3db263dd8ac6176ebbe2c33f0fd3c596e528
6
+ metadata.gz: 1c98f1e1255c609bf2ad084eb4aada6895b01574f58b80d33791b2acc74acaa390beb80f114d42f288a1bdf7ba716c25bf91ee7de5f3bc4f4ca9c228b1a5c118
7
+ data.tar.gz: ca8645728bb315c3e93b417459c21b01e04849d1d5c97493877d964970dd56541776be1d537fa0bbb578619966355c72426776833e5472ff0fac248d050367eb
data/README.md CHANGED
@@ -1,13 +1,8 @@
1
- # Scrivito: Google Maps Widget
1
+ # ScrivitoGoogleMapsWidget
2
2
 
3
- [![Gem Version](https://badge.fury.io/rb/scrivito_google_maps_widget.svg)](http://badge.fury.io/rb/scrivito_google_maps_widget)
4
- [![Code Climate](https://codeclimate.com/github/Scrivito/scrivito_google_maps_widget.png)](https://codeclimate.com/github/Scrivito/scrivito_google_maps_widget)
5
- [![Dependency Status](https://gemnasium.com/Scrivito/scrivito_google_maps_widget.png)](https://gemnasium.com/Scrivito/scrivito_google_maps_widget)
6
-
7
- The google maps widget is based on the
3
+ The Google Maps widget is based on the
8
4
  [Google Places JavaScript API](https://developers.google.com/maps/documentation/javascript/places).
9
- It displays a single location marker for an adress that editors can configure in an easy to use
10
- input field with location suggestions.
5
+ It displays a single location marker for an address that can be specified using an input field supporting location suggestions.
11
6
 
12
7
  ## Installation
13
8
 
@@ -15,56 +10,18 @@ Add this line to your application's `Gemfile`:
15
10
 
16
11
  gem 'scrivito_google_maps_widget'
17
12
 
18
- Include the Google Maps Places JavaScript library in your application layout:
19
- Do not forget to add this load this line in your scrivito_dialog view.
13
+ Include the Google Maps Places JavaScript library in your application.html.erb:
20
14
 
21
15
  javascript_include_tag('//maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&libraries=places')
22
16
 
23
- Add this line to your application JavaScript manifest:
24
-
25
- //= require google_maps_widget/application
26
-
27
- Add this line to your editing JavaScript manifest:
28
-
29
- //= require google_maps_widget/editing
30
-
31
- Add this line to your application Stylesheet manifest:
32
-
33
- *= require google_maps_widget/application
34
-
35
- Add this line to your editing Stylesheet manifest:
36
-
37
- *= require google_maps_widget/editing
17
+ Include the Google Maps Places JavaScript library in your scrivito_dialog.html.erb:
38
18
 
39
- And then execute:
40
-
41
- $ bundle
42
- $ rake scrivito:migrate:install
43
- $ rake scrivito:migrate
44
- $ rake scrivito:migrate:publish
45
-
46
-
47
- ## Usage
48
-
49
- If you followed the installation instructions, you have now successfully integrated the Google Maps
50
- widget into your project und published the new CMS object class. Editors of your webpage can now
51
- select the widget from the **Widget Browser** and immediately choose a location.
52
-
53
- In case you want to adopt the styles of the widget, feel free to redefine the `.google-maps .map`
54
- CSS class, which is the container the map gets rendered to.
55
-
56
-
57
- ## Contributing
19
+ javascript_include_tag('//maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&libraries=places')
58
20
 
59
- 1. Fork it ( https://github.com/Scrivito/scrivito_google_maps/merge_tags/fork )
60
- 2. Create your feature branch (`git checkout -b my-new-feature`)
61
- 3. Commit your changes (`git commit -am 'Add some feature'`)
62
- 4. Push to the branch (`git push origin my-new-feature`)
63
- 5. Create a new Pull Request
21
+ Also, add this line to your application stylesheet manifest:
64
22
 
23
+ *= require scrivito_google_maps_widget
65
24
 
66
- ## License
67
- Copyright (c) 2009 - 2014 Infopark AG (http://www.infopark.com)
25
+ Finally, add this line to your application JavaScript manifest:
68
26
 
69
- This software can be used and modified under the LGPL-3.0. Please refer to
70
- http://www.gnu.org/licenses/lgpl-3.0.html for the license text.
27
+ //= require scrivito_google_maps_widget
@@ -8,7 +8,6 @@ $ ->
8
8
  return
9
9
 
10
10
  map.setCenter(place.geometry.location)
11
- map.setZoom(17)
12
11
 
13
12
  marker.setPosition(place.geometry.location)
14
13
  marker.setVisible(true)
@@ -31,7 +30,7 @@ $ ->
31
30
 
32
31
  mapOptions =
33
32
  center: new google.maps.LatLng(-33.8688, 151.2195)
34
- zoom: 13
33
+ zoom: parseInt(canvas.data('zoom'))
35
34
  scrollwheel: false
36
35
 
37
36
  map = new google.maps.Map(canvas[0], mapOptions)
@@ -1,5 +1,4 @@
1
1
  .google-maps input {
2
- display: none;
3
2
  background-color: #fff;
4
3
  border: 1px solid transparent;
5
4
  border-radius: 2px 0 0 2px;
@@ -1,4 +1,5 @@
1
1
  class GoogleMapsWidget < Widget
2
2
  attribute :address, :string
3
3
  attribute :height, :string, default: '50vh'
4
+ attribute :zoom, :enum, values: (0..21).to_a.map {|e| e.to_s}, default: '13'
4
5
  end
@@ -1,13 +1,17 @@
1
+ <%= scrivito_details_for 'Height' do %>
2
+ <%= scrivito_tag(:div, widget, :height) %>
3
+ <% end %>
4
+
5
+ <%= scrivito_details_for 'Initial zoom' do %>
6
+ <%= scrivito_tag(:div, widget, :zoom) %>
7
+ <% end %>
8
+
1
9
  <%= scrivito_details_for 'Address' do %>
2
10
  <div class="google-maps" style="height: 320px">
3
11
  <% if scrivito_in_editable_view? %>
4
- <%= scrivito_tag(:input, widget, :address, type: 'text', data: { editor: 'google-maps' }) %>
12
+ <%= scrivito_tag(:input, widget, :address, type: 'text') %>
5
13
  <% end %>
6
14
 
7
15
  <div class="map" data-location="<%= widget.address %>"></div>
8
16
  </div>
9
17
  <% end %>
10
-
11
- <%= scrivito_details_for 'Height' do %>
12
- <%= scrivito_tag(:div, widget, :height) %>
13
- <% end %>
@@ -1,7 +1,7 @@
1
1
  <div class="google-maps" style="height: <%= widget.height %>">
2
2
  <% if scrivito_in_editable_view? %>
3
- <%= scrivito_tag(:input, widget, :address, type: 'text', data: { editor: 'google-maps' }) %>
3
+ <%= scrivito_tag(:input, widget, :address, type: 'text') %>
4
4
  <% end %>
5
5
 
6
- <div class="map" data-location="<%= widget.address %>"></div>
6
+ <div class="map" data-zoom="<%= widget.zoom %>" data-location="<%= widget.address %>"></div>
7
7
  </div>
@@ -1,3 +1,3 @@
1
1
  module ScrivitoGoogleMapsWidget
2
- VERSION = '0.1.5'
2
+ VERSION = '0.1.6'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scrivito_google_maps_widget
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scrivito
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-02 00:00:00.000000000 Z
11
+ date: 2016-02-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler