lightbox-rails 0.0.2
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.
- data/MIT-LICENSE +20 -0
- data/README.md +4 -0
- data/Rakefile +25 -0
- data/lib/lightbox-rails.rb +6 -0
- data/lib/lightbox-rails/lightbox_helper.rb +60 -0
- data/lib/lightbox-rails/railtie.rb +9 -0
- data/lib/lightbox-rails/version.rb +4 -0
- data/lightbox-rails.gemspec +19 -0
- data/vendor/assets/javascripts/lightbox.js.coffee +321 -0
- data/vendor/assets/stylesheets/lightbox.css.sass +171 -0
- metadata +76 -0
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2012 Vinny Diehl
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
data/Rakefile
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
#!/usr/bin/env rake
|
2
|
+
|
3
|
+
begin
|
4
|
+
require "bundler/setup"
|
5
|
+
rescue LoadError
|
6
|
+
puts "You must `gem install bundler` and `bundle install` to run rake tasks"
|
7
|
+
end
|
8
|
+
|
9
|
+
begin
|
10
|
+
require "rdoc/task"
|
11
|
+
rescue LoadError
|
12
|
+
require "rdoc/rdoc"
|
13
|
+
require "rake/rdoctask"
|
14
|
+
RDoc::Task = Rake::RDocTask
|
15
|
+
end
|
16
|
+
|
17
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
18
|
+
rdoc.rdoc_dir = "doc"
|
19
|
+
rdoc.title = "Lightbox 2 Rails"
|
20
|
+
rdoc.options << "--line-numbers"
|
21
|
+
rdoc.rdoc_files.include("README.rdoc")
|
22
|
+
rdoc.rdoc_files.include("lib/**/*.rb")
|
23
|
+
end
|
24
|
+
|
25
|
+
Bundler::GemHelper.install_tasks
|
@@ -0,0 +1,60 @@
|
|
1
|
+
module LightboxRails
|
2
|
+
module LightboxHelper
|
3
|
+
# Takes the photo gallery at +dir+, with the name +name+, and creates a
|
4
|
+
# Lightbox 2 group from them. Within +dir+ there may be a directory named
|
5
|
+
# <tt>thumbs</tt> containing the respective thumbnails for each image.
|
6
|
+
def lightbox_group(name, dir)
|
7
|
+
images = Dir[File.join(dir, "*.{jpg,JPG,png,PNG,gif,GIF}")].
|
8
|
+
sort { |a, b| image_name(a).to_i <=> image_name(b).to_i }
|
9
|
+
|
10
|
+
singles = images.each_with_index.map do |f, i|
|
11
|
+
filename = File.join("/", "assets", f.split(File::SEPARATOR)[-3..-1])
|
12
|
+
thumbname = File.exists?(thumbs_path f) \
|
13
|
+
? thumbs_path(filename)
|
14
|
+
: filename
|
15
|
+
|
16
|
+
title = "#{i + 1} of #{images.size}"
|
17
|
+
cls =
|
18
|
+
"single#{i.zero? ? " first" : i == images.size - 1 ? " last" : ""}"
|
19
|
+
|
20
|
+
content_tag(:div, :class => cls) do
|
21
|
+
content_tag(:a,
|
22
|
+
:class => "lightbox[#{name.downcase.gsub(" ", "-")}]",
|
23
|
+
href: filename) do
|
24
|
+
image_tag thumbname, alt: title, size: "100x100"
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
lightbox_set singles
|
30
|
+
end
|
31
|
+
|
32
|
+
private
|
33
|
+
|
34
|
+
# Returns the basename of an image without its file extension.
|
35
|
+
#
|
36
|
+
# image_name "/path/to/name_of_image.jpg" # => "name_of_image"
|
37
|
+
def image_name(image)
|
38
|
+
File.basename image, "*.{jpg,JPG,png,PNG,gif,GIF}"
|
39
|
+
end
|
40
|
+
|
41
|
+
# Collects +singles+, an array of Lightbox 2 singles, into an image
|
42
|
+
# row/set.
|
43
|
+
def lightbox_set(singles)
|
44
|
+
content_tag(:div, :class => "image-row") do
|
45
|
+
content_tag(:div, :class => "set") do
|
46
|
+
singles.map { |s| concat s }
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
# Takes the image at +path+ and returns the path to the thumbnail for that
|
52
|
+
# image, assuming that the thumbnail has the same filename and resides in
|
53
|
+
# a child directory named <tt>thumbs</tt>.
|
54
|
+
#
|
55
|
+
# thumbs_path "/path/to/image.jpg" # => "/path/to/thumbs/image.jpg"
|
56
|
+
def thumbs_path(path)
|
57
|
+
File.join File.dirname(path), "thumbs", File.basename(path)
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require File.expand_path("../lib/lightbox-rails/version", __FILE__)
|
2
|
+
|
3
|
+
Gem::Specification.new do |gem|
|
4
|
+
gem.name = "lightbox-rails"
|
5
|
+
gem.version = LightboxRails::VERSION
|
6
|
+
|
7
|
+
gem.authors = "Vinny Diehl"
|
8
|
+
gem.email = "gbchaosmaster926@gmail.com"
|
9
|
+
gem.homepage = "https://github.com/gbchaosmaster/lightbox-rails"
|
10
|
+
|
11
|
+
gem.summary = "Rails plugin for Lightbox 2"
|
12
|
+
gem.description = "Adds helpers for easy creation of Lightbox 2 groups."
|
13
|
+
|
14
|
+
gem.files = Dir["{lib,vendor}/**/*"] + %w[
|
15
|
+
MIT-LICENSE Rakefile README.md lightbox-rails.gemspec
|
16
|
+
]
|
17
|
+
|
18
|
+
gem.add_dependency "rails", "~> 3.2.8"
|
19
|
+
end
|
@@ -0,0 +1,321 @@
|
|
1
|
+
# Lightbox v2.51 by Lokesh Dhakar - http://www.lokeshdhakar.com
|
2
|
+
# For more information, visit: http://lokeshdhakar.com/projects/lightbox2/
|
3
|
+
# Licensed under the Creative Commons Attribution 2.5 License
|
4
|
+
# Modified by Vinny Diehl for the PHS Student Council website
|
5
|
+
|
6
|
+
# Use local alias
|
7
|
+
$ = jQuery
|
8
|
+
|
9
|
+
class LightboxOptions
|
10
|
+
constructor: ->
|
11
|
+
# Image resources (next/previous arrows are in the CSS)
|
12
|
+
@fileLoadingImage = '/assets/lightbox/loading.gif'
|
13
|
+
@fileCloseImage = '/assets/lightbox/close.png'
|
14
|
+
|
15
|
+
# Transition settings
|
16
|
+
@resizeDuration = 700
|
17
|
+
@fadeDuration = 500
|
18
|
+
|
19
|
+
# Labels for "Image # of #"
|
20
|
+
@labelImage = "Image"
|
21
|
+
@labelOf = "of"
|
22
|
+
|
23
|
+
class Lightbox
|
24
|
+
constructor: (@options) ->
|
25
|
+
@album = []
|
26
|
+
@currentImageIndex = undefined
|
27
|
+
@init()
|
28
|
+
|
29
|
+
init: ->
|
30
|
+
@enable()
|
31
|
+
@build()
|
32
|
+
|
33
|
+
# Loop through anchors and areamaps looking for rel attributes that contain
|
34
|
+
# 'lightbox'. On clicking these, start lightbox.
|
35
|
+
enable: ->
|
36
|
+
$('body').on 'click', 'a[rel^=lightbox], area[rel^=lightbox]', (e) =>
|
37
|
+
@start $(e.currentTarget)
|
38
|
+
false
|
39
|
+
|
40
|
+
# Build HTML for the lightbox and the overlay.
|
41
|
+
# Attach event handlers to the new DOM elements. click click click
|
42
|
+
build: ->
|
43
|
+
$('<div>', id: 'lightboxOverlay' ).after(
|
44
|
+
$('<div/>', id: 'lightbox').append(
|
45
|
+
$('<div/>', class: 'lb-outerContainer').append(
|
46
|
+
$('<div/>', class: 'lb-container').append(
|
47
|
+
$('<img/>', class: 'lb-image'),
|
48
|
+
$('<div/>', class: 'lb-nav').append(
|
49
|
+
$('<a/>', class: 'lb-prev'),
|
50
|
+
$('<a/>', class: 'lb-next')
|
51
|
+
),
|
52
|
+
$('<div/>', class: 'lb-loader').append(
|
53
|
+
$('<a/>', class: 'lb-cancel').append(
|
54
|
+
$('<img/>', src: @options.fileLoadingImage)
|
55
|
+
)
|
56
|
+
)
|
57
|
+
)
|
58
|
+
),
|
59
|
+
$('<div/>', class: 'lb-dataContainer').append(
|
60
|
+
$('<div/>', class: 'lb-data').append(
|
61
|
+
$('<div/>', class: 'lb-details').append(
|
62
|
+
$('<span/>', class: 'lb-caption'),
|
63
|
+
$('<span/>', class: 'lb-number')
|
64
|
+
),
|
65
|
+
$('<div/>', class: 'lb-closeContainer').append(
|
66
|
+
$('<a/>', class: 'lb-close').append(
|
67
|
+
$('<img/>', src: @options.fileCloseImage)
|
68
|
+
)
|
69
|
+
)
|
70
|
+
)
|
71
|
+
)
|
72
|
+
)
|
73
|
+
).appendTo $('body')
|
74
|
+
|
75
|
+
# Attach event handlers to the newly minted DOM elements
|
76
|
+
$('#lightboxOverlay').hide().on 'click', (e) =>
|
77
|
+
@end()
|
78
|
+
return false
|
79
|
+
|
80
|
+
$lightbox = $('#lightbox')
|
81
|
+
|
82
|
+
$lightbox.hide().on 'click', (e) =>
|
83
|
+
@end() if $(e.target).attr('id') == 'lightbox'
|
84
|
+
return false
|
85
|
+
|
86
|
+
$lightbox.find('.lb-outerContainer').on 'click', (e) =>
|
87
|
+
@end() if $(e.target).attr('id') == 'lightbox'
|
88
|
+
return false
|
89
|
+
|
90
|
+
$lightbox.find('.lb-prev').on 'click', (e) =>
|
91
|
+
@changeImage @currentImageIndex - 1
|
92
|
+
return false
|
93
|
+
|
94
|
+
$lightbox.find('.lb-next').on 'click', (e) =>
|
95
|
+
@changeImage @currentImageIndex + 1
|
96
|
+
return false
|
97
|
+
|
98
|
+
$lightbox.find('.lb-loader, .lb-close').on 'click', (e) =>
|
99
|
+
@end()
|
100
|
+
return false
|
101
|
+
|
102
|
+
return
|
103
|
+
|
104
|
+
# Show overlay and lightbox. If the image is part of a set, add siblings to
|
105
|
+
# album array.
|
106
|
+
start: ($link) ->
|
107
|
+
$(window).on 'resize', @sizeOverlay
|
108
|
+
|
109
|
+
$('select, object, embed').css visibility: 'hidden'
|
110
|
+
$('#lightboxOverlay')
|
111
|
+
.width($(document).width())
|
112
|
+
.height($(document).height())
|
113
|
+
.fadeIn @options.fadeDuration
|
114
|
+
|
115
|
+
@album = []
|
116
|
+
imageNumber = 0
|
117
|
+
|
118
|
+
if $link.attr('rel') == 'lightbox'
|
119
|
+
# If image is not part of a set
|
120
|
+
@album.push link: $link.attr('href'), title: $link.attr('title')
|
121
|
+
else
|
122
|
+
# Image is part of a set
|
123
|
+
for a, i in $("#{$link.prop 'tagName'}[rel=\"#{$link.attr 'rel'}\"]")
|
124
|
+
@album.push link: $(a).attr('href'), title: $(a).attr('title')
|
125
|
+
if $(a).attr('href') == $link.attr('href')
|
126
|
+
imageNumber = i
|
127
|
+
|
128
|
+
# Position lightbox
|
129
|
+
$window = $(window)
|
130
|
+
top = $window.scrollTop() + $window.height() / 10
|
131
|
+
left = $window.scrollLeft()
|
132
|
+
$lightbox = $('#lightbox')
|
133
|
+
$lightbox
|
134
|
+
.css
|
135
|
+
top: "#{top}px"
|
136
|
+
left: "#{left}px"
|
137
|
+
.fadeIn @options.fadeDuration
|
138
|
+
|
139
|
+
@changeImage(imageNumber)
|
140
|
+
return
|
141
|
+
|
142
|
+
# Hide most UI elements in preparation for the animated resizing of the
|
143
|
+
# lightbox.
|
144
|
+
changeImage: (imageNumber) ->
|
145
|
+
@disableKeyboardNav()
|
146
|
+
$lightbox = $('#lightbox')
|
147
|
+
$image = $lightbox.find('.lb-image')
|
148
|
+
|
149
|
+
@sizeOverlay()
|
150
|
+
$('#lightboxOverlay').fadeIn(@options.fadeDuration)
|
151
|
+
|
152
|
+
$('.loader').fadeIn 'slow'
|
153
|
+
$lightbox.find('.lb-image, .lb-nav, .lb-prev, .lb-next, .lb-dataContainer, .lb-numbers, .lb-caption').hide()
|
154
|
+
|
155
|
+
$lightbox.find('.lb-outerContainer').addClass 'animating'
|
156
|
+
|
157
|
+
# When image to show is preloaded, we send the width and height to
|
158
|
+
# sizeContainer()
|
159
|
+
preloader = new Image
|
160
|
+
|
161
|
+
preloader.onload = () =>
|
162
|
+
$image.attr 'src', @album[imageNumber].link
|
163
|
+
$image.width = preloader.width
|
164
|
+
$image.height = preloader.height
|
165
|
+
@sizeContainer preloader.width, preloader.height
|
166
|
+
|
167
|
+
preloader.src = @album[imageNumber].link
|
168
|
+
@currentImageIndex = imageNumber
|
169
|
+
|
170
|
+
return
|
171
|
+
|
172
|
+
# Stretch overlay to fit the document
|
173
|
+
sizeOverlay: () ->
|
174
|
+
$('#lightboxOverlay')
|
175
|
+
.width($(document).width())
|
176
|
+
.height($(document).height())
|
177
|
+
|
178
|
+
# Animate the size of the lightbox to fit the image we are showing
|
179
|
+
sizeContainer: (imageWidth, imageHeight) ->
|
180
|
+
$lightbox = $('#lightbox')
|
181
|
+
|
182
|
+
$outerContainer = $lightbox.find('.lb-outerContainer')
|
183
|
+
oldWidth = $outerContainer.outerWidth()
|
184
|
+
oldHeight = $outerContainer.outerHeight()
|
185
|
+
|
186
|
+
$container = $lightbox.find('.lb-container')
|
187
|
+
containerTopPadding = parseInt $container.css('padding-top'), 10
|
188
|
+
containerRightPadding = parseInt $container.css('padding-right'), 10
|
189
|
+
containerBottomPadding = parseInt $container.css('padding-bottom'), 10
|
190
|
+
containerLeftPadding = parseInt $container.css('padding-left'), 10
|
191
|
+
|
192
|
+
newWidth = imageWidth + containerLeftPadding + containerRightPadding
|
193
|
+
newHeight = imageHeight + containerTopPadding + containerBottomPadding
|
194
|
+
|
195
|
+
# Animate just the width, just the height, or both, depending on what is
|
196
|
+
# different
|
197
|
+
if newWidth != oldWidth && newHeight != oldHeight
|
198
|
+
$outerContainer.animate
|
199
|
+
width: newWidth,
|
200
|
+
height: newHeight
|
201
|
+
, @options.resizeDuration, 'swing'
|
202
|
+
else if newWidth != oldWidth
|
203
|
+
$outerContainer.animate
|
204
|
+
width: newWidth
|
205
|
+
, @options.resizeDuration, 'swing'
|
206
|
+
else if newHeight != oldHeight
|
207
|
+
$outerContainer.animate
|
208
|
+
height: newHeight
|
209
|
+
, @options.resizeDuration, 'swing'
|
210
|
+
|
211
|
+
# Wait for resize animation to finsh before showing the image
|
212
|
+
setTimeout =>
|
213
|
+
$lightbox.find('.lb-dataContainer').width(newWidth)
|
214
|
+
$lightbox.find('.lb-prevLink').height(newHeight)
|
215
|
+
$lightbox.find('.lb-nextLink').height(newHeight)
|
216
|
+
@showImage()
|
217
|
+
return
|
218
|
+
, @options.resizeDuration
|
219
|
+
|
220
|
+
return
|
221
|
+
|
222
|
+
|
223
|
+
# Display the image and it's details and begin preload neighboring images.
|
224
|
+
showImage: ->
|
225
|
+
$lightbox = $('#lightbox')
|
226
|
+
$lightbox.find('.lb-loader').hide()
|
227
|
+
$lightbox.find('.lb-image').fadeIn 'slow'
|
228
|
+
|
229
|
+
@updateNav()
|
230
|
+
@updateDetails()
|
231
|
+
@preloadNeighboringImages()
|
232
|
+
@enableKeyboardNav()
|
233
|
+
|
234
|
+
return
|
235
|
+
|
236
|
+
# Display previous and next navigation if appropriate.
|
237
|
+
updateNav: ->
|
238
|
+
$lightbox = $('#lightbox')
|
239
|
+
$lightbox.find('.lb-nav').show()
|
240
|
+
$lightbox.find('.lb-prev').show() if @currentImageIndex > 0
|
241
|
+
$lightbox.find('.lb-next').show() if @currentImageIndex < @album.length - 1
|
242
|
+
return
|
243
|
+
|
244
|
+
# Display caption, image number, and closing button.
|
245
|
+
updateDetails: ->
|
246
|
+
$lightbox = $('#lightbox')
|
247
|
+
|
248
|
+
if typeof @album[@currentImageIndex].title != 'undefined' && @album[@currentImageIndex].title != ""
|
249
|
+
$lightbox.find('.lb-caption')
|
250
|
+
.html( @album[@currentImageIndex].title)
|
251
|
+
.fadeIn('fast')
|
252
|
+
|
253
|
+
if @album.length > 1
|
254
|
+
$lightbox
|
255
|
+
.find('.lb-number')
|
256
|
+
.html([
|
257
|
+
@options.labelImage, @currentImageIndex + 1,
|
258
|
+
@options.labelOf, @album.length
|
259
|
+
].join ' ')
|
260
|
+
.fadeIn 'fast'
|
261
|
+
else
|
262
|
+
$lightbox.find('.lb-number').hide()
|
263
|
+
|
264
|
+
$lightbox.find('.lb-outerContainer').removeClass 'animating'
|
265
|
+
|
266
|
+
$lightbox.find('.lb-dataContainer')
|
267
|
+
.fadeIn @resizeDuration, () =>
|
268
|
+
@sizeOverlay()
|
269
|
+
|
270
|
+
return
|
271
|
+
|
272
|
+
# Preload previos and next images in set.
|
273
|
+
preloadNeighboringImages: ->
|
274
|
+
if @album.length > @currentImageIndex + 1
|
275
|
+
preloadNext = new Image
|
276
|
+
preloadNext.src = @album[@currentImageIndex + 1].link
|
277
|
+
|
278
|
+
if @currentImageIndex > 0
|
279
|
+
preloadPrev = new Image
|
280
|
+
preloadPrev.src = @album[@currentImageIndex - 1].link
|
281
|
+
|
282
|
+
return
|
283
|
+
|
284
|
+
enableKeyboardNav: ->
|
285
|
+
$(document).on 'keyup.keyboard', $.proxy(@keyboardAction, this)
|
286
|
+
return
|
287
|
+
|
288
|
+
disableKeyboardNav: ->
|
289
|
+
$(document).off '.keyboard'
|
290
|
+
return
|
291
|
+
|
292
|
+
keyboardAction: (event) ->
|
293
|
+
KEYCODE_ESC = 27
|
294
|
+
KEYCODE_LEFTARROW = 37
|
295
|
+
KEYCODE_RIGHTARROW = 39
|
296
|
+
|
297
|
+
keycode = event.keyCode
|
298
|
+
key = String.fromCharCode(keycode).toLowerCase()
|
299
|
+
|
300
|
+
if keycode == KEYCODE_ESC || key.match(/x|o|c/)
|
301
|
+
@end()
|
302
|
+
else if key == 'p' || keycode == KEYCODE_LEFTARROW
|
303
|
+
if @currentImageIndex != 0
|
304
|
+
@changeImage @currentImageIndex - 1
|
305
|
+
else if key == 'n' || keycode == KEYCODE_RIGHTARROW
|
306
|
+
if @currentImageIndex != @album.length - 1
|
307
|
+
@changeImage @currentImageIndex + 1
|
308
|
+
|
309
|
+
return
|
310
|
+
|
311
|
+
# Closing time
|
312
|
+
end: ->
|
313
|
+
@disableKeyboardNav()
|
314
|
+
$(window).off 'resize', @sizeOverlay
|
315
|
+
$('#lightbox').fadeOut @options.fadeDuration
|
316
|
+
$('#lightboxOverlay').fadeOut @options.fadeDuration
|
317
|
+
$('select, object, embed').css visibility: 'visible'
|
318
|
+
|
319
|
+
$ ->
|
320
|
+
options = new LightboxOptions
|
321
|
+
lightbox = new Lightbox options
|
@@ -0,0 +1,171 @@
|
|
1
|
+
@import "compass/css3"
|
2
|
+
@import "compass/utilities/general/clearfix"
|
3
|
+
|
4
|
+
/** Variables **/
|
5
|
+
|
6
|
+
$thumbHoverColor: #08C
|
7
|
+
$gutter: 20px
|
8
|
+
$radius: 4px
|
9
|
+
|
10
|
+
/** Styles **/
|
11
|
+
|
12
|
+
#lightboxOverlay
|
13
|
+
position: absolute
|
14
|
+
top: 0
|
15
|
+
left: 0
|
16
|
+
z-index: 9999
|
17
|
+
background-color: #000
|
18
|
+
+opacity(0.85)
|
19
|
+
display: none
|
20
|
+
|
21
|
+
#lightbox
|
22
|
+
position: absolute
|
23
|
+
left: 0
|
24
|
+
width: 100%
|
25
|
+
z-index: 10000
|
26
|
+
text-align: center
|
27
|
+
line-height: 0
|
28
|
+
font-family: 'lucida grande', tahoma, verdana, arial, sans-serif
|
29
|
+
font-weight: normal
|
30
|
+
img
|
31
|
+
width: auto
|
32
|
+
height: auto
|
33
|
+
a img
|
34
|
+
border: none
|
35
|
+
|
36
|
+
.lb-outerContainer
|
37
|
+
position: relative
|
38
|
+
background-color: #fff
|
39
|
+
+pie-clearfix
|
40
|
+
width: 250px
|
41
|
+
height: 250px
|
42
|
+
margin: 0 auto
|
43
|
+
+border-radius($radius)
|
44
|
+
|
45
|
+
.lb-container
|
46
|
+
padding: 10px
|
47
|
+
|
48
|
+
.lb-loader
|
49
|
+
position: absolute
|
50
|
+
top: 40%
|
51
|
+
left: 0%
|
52
|
+
height: 25%
|
53
|
+
width: 100%
|
54
|
+
text-align: center
|
55
|
+
line-height: 0
|
56
|
+
|
57
|
+
.lb-nav
|
58
|
+
position: absolute
|
59
|
+
top: 0
|
60
|
+
left: 0
|
61
|
+
height: 100%
|
62
|
+
width: 100%
|
63
|
+
z-index: 10
|
64
|
+
|
65
|
+
.lb-container > .nav
|
66
|
+
left: 0
|
67
|
+
|
68
|
+
.lb-nav a
|
69
|
+
outline: none
|
70
|
+
|
71
|
+
.lb-prev, .lb-next
|
72
|
+
width: 49%
|
73
|
+
height: 100%
|
74
|
+
background-image: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7")
|
75
|
+
/* Trick IE into showing hover
|
76
|
+
display: block
|
77
|
+
|
78
|
+
.lb-prev
|
79
|
+
left: 0
|
80
|
+
float: left
|
81
|
+
|
82
|
+
.lb-next
|
83
|
+
right: 0
|
84
|
+
float: right
|
85
|
+
|
86
|
+
.lb-prev
|
87
|
+
&:hover
|
88
|
+
background: url(/assets/lightbox/prev.png) left 48% no-repeat
|
89
|
+
|
90
|
+
.lb-next
|
91
|
+
&:hover
|
92
|
+
background: url(/assets/lightbox/next.png) right 48% no-repeat
|
93
|
+
|
94
|
+
.lb-dataContainer
|
95
|
+
margin: 0 auto
|
96
|
+
padding-top: 5px
|
97
|
+
+pie-clearfix
|
98
|
+
width: 100%
|
99
|
+
+border-bottom-radius($radius)
|
100
|
+
|
101
|
+
.lb-data
|
102
|
+
padding: 0 10px
|
103
|
+
color: #bbb
|
104
|
+
.lb-details
|
105
|
+
width: 85%
|
106
|
+
float: left
|
107
|
+
text-align: left
|
108
|
+
line-height: 1.1em
|
109
|
+
.lb-caption
|
110
|
+
font-size: 13px
|
111
|
+
font-weight: bold
|
112
|
+
line-height: 1em
|
113
|
+
.lb-number
|
114
|
+
display: block
|
115
|
+
clear: left
|
116
|
+
padding-bottom: 1.0em
|
117
|
+
font-size: 11px
|
118
|
+
.lb-close
|
119
|
+
width: 35px
|
120
|
+
float: right
|
121
|
+
padding-bottom: 0.7em
|
122
|
+
outline: none
|
123
|
+
&:hover
|
124
|
+
cursor: pointer
|
125
|
+
|
126
|
+
/** Page Styles **/
|
127
|
+
|
128
|
+
.image-row
|
129
|
+
+pie-clearfix
|
130
|
+
margin: $gutter/2 0
|
131
|
+
.single
|
132
|
+
float: left
|
133
|
+
a
|
134
|
+
float: left
|
135
|
+
display: block
|
136
|
+
background: rgba(255, 255, 255, .1)
|
137
|
+
padding: 7px
|
138
|
+
line-height: 1em
|
139
|
+
+border-radius($radius)
|
140
|
+
+box-shadow(0 1px 4px 0 rgba(0, 0, 0, 0.5))
|
141
|
+
margin-right: $gutter
|
142
|
+
+transition(all .2s ease-out)
|
143
|
+
img
|
144
|
+
+border-radius($radius)
|
145
|
+
border: 1px solid rgba(0, 0, 0, 0.3)
|
146
|
+
&:hover
|
147
|
+
background-color: $thumbHoverColor
|
148
|
+
.set
|
149
|
+
float: left
|
150
|
+
margin-bottom: 5px
|
151
|
+
background: rgba(255, 255, 255, .1)
|
152
|
+
+border-radius($radius)
|
153
|
+
+box-shadow(0 1px 4px 0 rgba(0, 0, 0, 0.5))
|
154
|
+
+transition(all .2s ease-out)
|
155
|
+
&:hover
|
156
|
+
background: rgba(255, 255, 255, .2)
|
157
|
+
.single
|
158
|
+
a
|
159
|
+
background: none
|
160
|
+
+border-radius(0)
|
161
|
+
+box-shadow(none)
|
162
|
+
margin-right: 0
|
163
|
+
&:hover
|
164
|
+
background-color: $thumbHoverColor
|
165
|
+
+box-shadow(0 -1px 0 0 rgba(255, 255, 255, 0.2), 0 1px 4px 0 rgba(0, 0, 0, 0.5))
|
166
|
+
.single.first
|
167
|
+
a
|
168
|
+
+border-left-radius($radius)
|
169
|
+
.single.last
|
170
|
+
a
|
171
|
+
+border-right-radius($radius)
|
metadata
ADDED
@@ -0,0 +1,76 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: lightbox-rails
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.2
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Vinny Diehl
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-10-24 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rails
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 3.2.8
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 3.2.8
|
30
|
+
description: Adds helpers for easy creation of Lightbox 2 groups.
|
31
|
+
email: gbchaosmaster926@gmail.com
|
32
|
+
executables: []
|
33
|
+
extensions: []
|
34
|
+
extra_rdoc_files: []
|
35
|
+
files:
|
36
|
+
- lib/lightbox-rails.rb
|
37
|
+
- lib/lightbox-rails/version.rb
|
38
|
+
- lib/lightbox-rails/lightbox_helper.rb
|
39
|
+
- lib/lightbox-rails/railtie.rb
|
40
|
+
- vendor/assets/javascripts/lightbox.js.coffee
|
41
|
+
- vendor/assets/stylesheets/lightbox.css.sass
|
42
|
+
- MIT-LICENSE
|
43
|
+
- Rakefile
|
44
|
+
- README.md
|
45
|
+
- lightbox-rails.gemspec
|
46
|
+
homepage: https://github.com/gbchaosmaster/lightbox-rails
|
47
|
+
licenses: []
|
48
|
+
post_install_message:
|
49
|
+
rdoc_options: []
|
50
|
+
require_paths:
|
51
|
+
- lib
|
52
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
53
|
+
none: false
|
54
|
+
requirements:
|
55
|
+
- - ! '>='
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: '0'
|
58
|
+
segments:
|
59
|
+
- 0
|
60
|
+
hash: -2053133620550091799
|
61
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
62
|
+
none: false
|
63
|
+
requirements:
|
64
|
+
- - ! '>='
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: '0'
|
67
|
+
segments:
|
68
|
+
- 0
|
69
|
+
hash: -2053133620550091799
|
70
|
+
requirements: []
|
71
|
+
rubyforge_project:
|
72
|
+
rubygems_version: 1.8.24
|
73
|
+
signing_key:
|
74
|
+
specification_version: 3
|
75
|
+
summary: Rails plugin for Lightbox 2
|
76
|
+
test_files: []
|