lighter_box 0.1.1 → 0.2.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: 0f78cd89ebd3392ebfb5289c1815c4a1e05bc2b1
4
- data.tar.gz: 2505e4aaf48c161b6a2f11749ce92a3be31921e3
3
+ metadata.gz: c03be2653f35a74bccc7498a9062c7b1336db780
4
+ data.tar.gz: 2d67a7d6d9ff3dd4db28649711563ac7757e3872
5
5
  SHA512:
6
- metadata.gz: 0b399a9810ccaf9d391f8f6fd90eebb09bbc66ab3b74b809fcfcb84f6a03154d058b11205e4c7b4fee3e907992a8341b3396112a771b7214474990dd3addc205
7
- data.tar.gz: cb7ab0452f48c83174bc92c832aa2e84e34f3f9a8a7397b1ed7b17ac6c22763c3dadcae144fe16eff0c4e9aa971d21831ec5e51a5942900bfc67321211b04e4b
6
+ metadata.gz: 81746e803a4368fc944cb0708142c6dc59059d388bd669c6a212e51a8cb9839e7abd8a63491287ad50f6e6232afc10330e7df2cc194d06f43b2c51d7060e0856
7
+ data.tar.gz: 37b281309eb47c133c02e9219779a9f22cd170f60ac0b740539dbcf3c9cf5db8fd7852470e606bdcef3d04dd569f23ea0ec1ce1dfd7aaf78fdaddb212e09832d
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # v0.2.0
2
+
3
+ * New option `data-lightbox-caption-allow-html` for image lightboxes: Allows the image caption to be interpreted as HTML.
4
+
1
5
  # v0.1.1
2
6
 
3
7
  * Fix “fragment” feature of ajax lightbox not always working.
data/README.md CHANGED
@@ -54,6 +54,7 @@ The following attributes on the source element (link) can be used to customize L
54
54
  Image lightbox only:
55
55
 
56
56
  * `data-lightbox-caption`: Image caption. If not set, the image’s alt text is used as caption.
57
+ * `data-lightbox-caption-allow-html`: If present, the image caption is interpreted as HTML.
57
58
 
58
59
  Ajax lightbox only:
59
60
 
@@ -221,7 +221,7 @@ class ImageLighterBox extends LighterBox
221
221
  caption = @srcEl.data("lightbox-caption") || @srcEl.find("img").attr("alt") || ""
222
222
  newImg = $("<img>").attr(src: href).one "load", =>
223
223
  @modal.find("img").attr(src: newImg.attr("src"))
224
- @modal.find("figcaption").text(caption).toggleClass("empty-caption", caption.trim() == "")
224
+ @_setCaption(caption)
225
225
  @resizer.run()
226
226
  deferred.resolve()
227
227
 
@@ -229,7 +229,13 @@ class ImageLighterBox extends LighterBox
229
229
  super()
230
230
  @resizer.run()
231
231
 
232
-
232
+ _setCaption: (caption) =>
233
+ figcaptionEl = @modal.find("figcaption")
234
+ if @srcEl.data("lightbox-caption-allow-html")
235
+ figcaptionEl.html(caption)
236
+ else
237
+ figcaptionEl.text(caption)
238
+ figcaptionEl.toggleClass("empty-caption", caption.trim() == "")
233
239
 
234
240
  class AjaxLighterBox extends LighterBox
235
241
  constructor: (srcEl) ->
@@ -1,3 +1,3 @@
1
1
  module LighterBox
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lighter_box
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Daschek
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-03-25 00:00:00.000000000 Z
11
+ date: 2016-12-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: coffee-script
@@ -104,7 +104,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
104
104
  version: '0'
105
105
  requirements: []
106
106
  rubyforge_project:
107
- rubygems_version: 2.2.3
107
+ rubygems_version: 2.5.1
108
108
  signing_key:
109
109
  specification_version: 4
110
110
  summary: Lightweight accessible lightbox.