jekyll-maps 2.3.0 → 2.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e26fa740a142e97113f43ab66748b40750dfaf4d8b33f84cb1ff43d20a827ea5
4
- data.tar.gz: 70eac67645b3e5a4cc59075382a5d86620bd74e92e30346255411db432b45a88
3
+ metadata.gz: e1f7764e330ca8398f9b8ac424b3ab6dafa38d6bd0a8b91f39f1f8dc85fef981
4
+ data.tar.gz: 699cdb8682423e5508a5aa4fed846c6017a2a4b1fecc6878c9de369d1392a521
5
5
  SHA512:
6
- metadata.gz: 9ec488a7c7638c64a6cb07c8d93aba74a62168d3c0afe23f981cf0ee13082105b874de1cdd34e61da356fe4a9c7761ea79002d45a3621163d7447fa03e45af4f
7
- data.tar.gz: 76232fd2b19eb1f942fdb4a78ff3ebdcbfcdfbee5d3d06974c5ecd470b9c1caa6607eff6eee22429eca172813a796f395c16badfcd80384ef1c1e48242e84ac0
6
+ metadata.gz: 88ff121fe971e8676931c22bfb1610d70aeb93023dbc9e216fd975fa6331eed665fccb26726f538001557e5cb32e5069b376ddb7a34655f88e8fc3ccbeacca43
7
+ data.tar.gz: 1ae331ad6d9afa9689e5ba27a8dcc778289cef50ee339bbd4a0cf9c8051ab1048c2c6713bf6c423c6fa3012cc1d6ffb6c89da5154e12e496aab2312895b474c1
File without changes
data/.gitignore CHANGED
@@ -7,3 +7,4 @@ coverage
7
7
  _site
8
8
  node_modules
9
9
  .DS_store
10
+ .#*
File without changes
File without changes
data/Gemfile CHANGED
File without changes
data/History.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 2.3.0 / 2018-03-17
2
+
3
+ * customize popup link text (#34)
4
+ * do not use page url for multiple on page locations (#33)
5
+
1
6
  ## 2.2.0 / 2018-03-07
2
7
 
3
8
  * implement custom marker icon (#30)
data/LICENSE CHANGED
File without changes
data/README.md CHANGED
File without changes
data/Rakefile CHANGED
File without changes
File without changes
File without changes
@@ -79,6 +79,7 @@ var jekyllMaps = (function() {
79
79
  position: position,
80
80
  title: location.title,
81
81
  image: location.image,
82
+ popup_html: location.popup_html,
82
83
  icon: location.icon || mapOptions.markerIcon,
83
84
  url: markerUrl(mapOptions.baseUrl, location.url),
84
85
  url_text: location.url_text,
@@ -97,14 +98,19 @@ var jekyllMaps = (function() {
97
98
 
98
99
  function markerPopup() {
99
100
  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 + '"/>'
103
- if (this.url.length > 0) {
104
- var linkContent = imageTag || this.url_text || 'View'
105
- content += '<a href="' + this.url + '">' + linkContent + '</a>'
106
- } else if (imageTag) {
107
- content += imageTag
101
+ if (this.popup_html.length > 0) {
102
+ content += this.popup_html
103
+ }
104
+ else {
105
+ var imageTag =
106
+ this.image.length > 0 &&
107
+ '<img src="' + this.image + '" alt="' + this.title + '"/>'
108
+ if (this.url.length > 0) {
109
+ var linkContent = imageTag || this.url_text || 'View'
110
+ content += '<a href="' + this.url + '">' + linkContent + '</a>'
111
+ } else if (imageTag) {
112
+ content += imageTag
113
+ }
108
114
  }
109
115
  content += '</div>'
110
116
  infoWindow.setContent(content)
File without changes
File without changes
@@ -22,12 +22,13 @@ module Jekyll
22
22
  private
23
23
  def location_from_options(page)
24
24
  {
25
- :latitude => @options[:attributes][:latitude],
26
- :longitude => @options[:attributes][:longitude],
27
- :title => @options[:attributes][:marker_title] || page["title"],
28
- :icon => @options[:attributes][:marker_icon] || page["marker_icon"],
29
- :url => @options[:attributes][:marker_url] || fetch_url(page),
30
- :image => @options[:attributes][:marker_img] || page["image"] || ""
25
+ :latitude => @options[:attributes][:latitude],
26
+ :longitude => @options[:attributes][:longitude],
27
+ :title => @options[:attributes][:marker_title] || page["title"],
28
+ :icon => @options[:attributes][:marker_icon] || page["marker_icon"],
29
+ :url => @options[:attributes][:marker_url] || fetch_url(page),
30
+ :image => @options[:attributes][:marker_img] || page["image"] || "",
31
+ :popup_html => @options[:attributes][:marker_popup_html] || ""
31
32
  }
32
33
  end
33
34
 
@@ -75,12 +76,14 @@ module Jekyll
75
76
  def match_filters?(doc)
76
77
  @options[:filters].each do |filter, value|
77
78
  if filter == "src"
78
- return true unless doc.respond_to?(:relative_path)
79
- return false unless doc.relative_path.start_with?(value)
79
+ if doc.respond_to?(:relative_path)
80
+ return false unless doc.relative_path.start_with?(value)
81
+ end
80
82
  elsif doc[filter].nil? || doc[filter] != value
81
83
  return false
82
84
  end
83
85
  end
86
+ return true
84
87
  end
85
88
 
86
89
  private
@@ -103,13 +106,15 @@ module Jekyll
103
106
  private
104
107
  def convert(document, location)
105
108
  {
106
- :latitude => location["latitude"],
107
- :longitude => location["longitude"],
108
- :title => location["title"] || document["title"],
109
- :icon => location["marker_icon"] || document["marker_icon"],
110
- :url => location["url"] || fetch_url(document),
111
- :url_text => location["url_text"],
112
- :image => location["image"] || document["image"] || ""
109
+ :latitude => location["latitude"],
110
+ :longitude => location["longitude"],
111
+ :title => location["title"] || document["title"],
112
+ :icon => location["marker_icon"] || document["marker_icon"],
113
+ :url => location["url"] || fetch_url(document),
114
+ :url_text => location["url_text"],
115
+ :image => location["image"] || document["image"] || "",
116
+ :popup_html => location["marker_popup_html"] \
117
+ || document["marker_popup_html"] || ""
113
118
  }
114
119
  end
115
120
 
@@ -19,6 +19,7 @@ module Jekyll
19
19
  marker_icon
20
20
  marker_img
21
21
  marker_url
22
+ marker_popup_html
22
23
  ).freeze
23
24
 
24
25
  class << self
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module Maps
3
- VERSION = "2.3.0".freeze
3
+ VERSION = "2.3.1".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.3.0
4
+ version: 2.3.1
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-17 00:00:00.000000000 Z
11
+ date: 2019-03-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -112,7 +112,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
112
112
  version: '0'
113
113
  requirements: []
114
114
  rubyforge_project:
115
- rubygems_version: 2.7.3
115
+ rubygems_version: 2.7.6
116
116
  signing_key:
117
117
  specification_version: 4
118
118
  summary: Jekyll Google Maps integration