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 +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +1 -0
- data/lib/assets/javascripts/lighter_box.coffee +8 -2
- data/lib/lighter_box/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c03be2653f35a74bccc7498a9062c7b1336db780
|
|
4
|
+
data.tar.gz: 2d67a7d6d9ff3dd4db28649711563ac7757e3872
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 81746e803a4368fc944cb0708142c6dc59059d388bd669c6a212e51a8cb9839e7abd8a63491287ad50f6e6232afc10330e7df2cc194d06f43b2c51d7060e0856
|
|
7
|
+
data.tar.gz: 37b281309eb47c133c02e9219779a9f22cd170f60ac0b740539dbcf3c9cf5db8fd7852470e606bdcef3d04dd569f23ea0ec1ce1dfd7aaf78fdaddb212e09832d
|
data/CHANGELOG.md
CHANGED
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
|
-
@
|
|
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) ->
|
data/lib/lighter_box/version.rb
CHANGED
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.
|
|
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-
|
|
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.
|
|
107
|
+
rubygems_version: 2.5.1
|
|
108
108
|
signing_key:
|
|
109
109
|
specification_version: 4
|
|
110
110
|
summary: Lightweight accessible lightbox.
|