jekyll-maps 2.2.0 → 2.3.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
  SHA256:
3
- metadata.gz: 5d5dffc1c1df660cb9f9c4c0df61c45474a1f6f104f0071f029c361b3249199b
4
- data.tar.gz: 25ff1ed47a8eda9b6c7d47b234b6241738709b084b3cf9bb637aeb81ef4f0abd
3
+ metadata.gz: e26fa740a142e97113f43ab66748b40750dfaf4d8b33f84cb1ff43d20a827ea5
4
+ data.tar.gz: 70eac67645b3e5a4cc59075382a5d86620bd74e92e30346255411db432b45a88
5
5
  SHA512:
6
- metadata.gz: b798ed260312306b4a3ceee2a331d21bd2213e868787e98812b1c641ae0e7e4ce6df7b3202a578fa0b01c3307a89318fcbb86c96705c2408437555db0824863c
7
- data.tar.gz: 3647aa55db8ec0bfa68a1bf088552c78d6e634aaa3b0af0282340b13623b3df6c8b399e1a2e5762f5835d0158e9e9a4371369341b0bb6e62aa665205c292ea00
6
+ metadata.gz: 9ec488a7c7638c64a6cb07c8d93aba74a62168d3c0afe23f981cf0ee13082105b874de1cdd34e61da356fe4a9c7761ea79002d45a3621163d7447fa03e45af4f
7
+ data.tar.gz: 76232fd2b19eb1f942fdb4a78ff3ebdcbfcdfbee5d3d06974c5ecd470b9c1caa6607eff6eee22429eca172813a796f395c16badfcd80384ef1c1e48242e84ac0
data/History.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 2.2.0 / 2018-03-07
2
+
3
+ * implement custom marker icon (#30)
4
+ * fix external URL in marker
5
+
1
6
  ## 2.1.1 / 2018-01-25
2
7
 
3
8
  * fixed JS lib injection in header (fix #31)
@@ -81,6 +81,7 @@ var jekyllMaps = (function() {
81
81
  image: location.image,
82
82
  icon: location.icon || mapOptions.markerIcon,
83
83
  url: markerUrl(mapOptions.baseUrl, location.url),
84
+ url_text: location.url_text,
84
85
  map: map
85
86
  })
86
87
  if (mapOptions.showMarkerPopup) marker.addListener('click', markerPopup)
@@ -95,16 +96,18 @@ var jekyllMaps = (function() {
95
96
  }
96
97
 
97
98
  function markerPopup() {
98
- var contentHtml =
99
- '<div class="map-info-window"><h5>' + this.title + '</h5>'
100
- var imageHtml = '<img src="' + this.image + '" alt="' + this.title + '"/>'
99
+ var content = '<div class="map-info-window"><h5>' + this.title + '</h5>'
100
+ var imageTag =
101
+ this.image.length > 0 &&
102
+ '<img src="' + this.image + '" alt="' + this.title + '"/>'
101
103
  if (this.url.length > 0) {
102
- var linkText = this.image.length > 0 ? imageHtml : 'View'
103
- contentHtml += '<a href="' + this.url + '">' + linkText + '</a></div>'
104
- } else if (this.image.length > 0) {
105
- contentHtml += imageHtml
104
+ var linkContent = imageTag || this.url_text || 'View'
105
+ content += '<a href="' + this.url + '">' + linkContent + '</a>'
106
+ } else if (imageTag) {
107
+ content += imageTag
106
108
  }
107
- infoWindow.setContent(contentHtml)
109
+ content += '</div>'
110
+ infoWindow.setContent(content)
108
111
  infoWindow.open(map, this)
109
112
  }
110
113
  }
@@ -89,7 +89,9 @@ module Jekyll
89
89
  @documents.each do |document|
90
90
  if document["location"].is_a?(Array)
91
91
  document["location"].each do |location|
92
- locations.push(convert(document, location))
92
+ point = convert(document, location)
93
+ point[:url] = "" if point[:url] == fetch_url(document)
94
+ locations.push(point)
93
95
  end
94
96
  else
95
97
  locations.push(convert(document, document["location"]))
@@ -106,6 +108,7 @@ module Jekyll
106
108
  :title => location["title"] || document["title"],
107
109
  :icon => location["marker_icon"] || document["marker_icon"],
108
110
  :url => location["url"] || fetch_url(document),
111
+ :url_text => location["url_text"],
109
112
  :image => location["image"] || document["image"] || ""
110
113
  }
111
114
  end
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module Maps
3
- VERSION = "2.2.0".freeze
3
+ VERSION = "2.3.0".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-maps
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anatoliy Yastreb
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-07 00:00:00.000000000 Z
11
+ date: 2018-03-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll