Browse Source

remove trailing spaces

master
XhmikosR 8 years ago
parent
commit
ce79871fc7
6 changed files with 77 additions and 80 deletions
  1. +3
    -3
      README.markdown
  2. +40
    -40
      coffee/lightbox.coffee
  3. +6
    -6
      css/screen.css
  4. +4
    -4
      sass/_variables.sass
  5. +1
    -1
      sass/lightbox.sass
  6. +23
    -26
      sass/screen.sass

+ 3
- 3
README.markdown View File

@ -1,11 +1,11 @@
##Lightbox2
by Lokesh Dhakar | [lokeshdhakar.com](http://www.lokeshdhakar.com) | [twitter.com/lokeshdhakar](http://twitter.com/lokeshdhakar)
by Lokesh Dhakar | [lokeshdhakar.com](http://www.lokeshdhakar.com) | [twitter.com/lokeshdhakar](http://twitter.com/lokeshdhakar)
###Information and support
For examples, downloads, and information on using Lightbox, visit the Lightbox2 homepage:
For examples, downloads, and information on using Lightbox, visit the Lightbox2 homepage:
[http://lokeshdhakar.com/projects/lightbox2/](http://lokeshdhakar.com/projects/lightbox2/)
For personal support issues and feature requests, visit the Lightbox forums:
For personal support issues and feature requests, visit the Lightbox forums:
[http://lokeshdhakar.com/forums/](http://lokeshdhakar.com/forums/)
###License


+ 40
- 40
coffee/lightbox.coffee View File

@ -8,7 +8,7 @@ http://lokeshdhakar.com/projects/lightbox2/
Licensed under the Creative Commons Attribution 2.5 License - http://creativecommons.org/licenses/by/2.5/
- free for use in both personal and commercial projects
- attribution requires leaving author name, author link, and the license info intact
Thanks
- Scott Upton(uptonic.com), Peter-Paul Koch(quirksmode.com), and Thomas Fuchs(mir.aculo.us) for ideas, libs, and snippets.
- Artemy Tregubenko (arty.name) for cleanup and help in updating to latest proto-aculous in v2.05.
@ -45,7 +45,7 @@ $ = jQuery
class LightboxOptions
constructor: ->
@fileLoadingImage = 'images/loading.gif'
@fileLoadingImage = 'images/loading.gif'
@fileCloseImage = 'images/close.png'
@resizeDuration = 700
@fadeDuration = 500
@ -58,8 +58,8 @@ class Lightbox
@album = []
@currentImageIndex = undefined
@init()
init: ->
@enable()
@build()
@ -86,21 +86,21 @@ class Lightbox
return false
$lightbox = $('#lightbox')
$lightbox
.hide()
.on 'click', (e) =>
if $(e.target).attr('id') == 'lightbox' then @end()
return false
$lightbox.find('.lb-outerContainer').on 'click', (e) =>
if $(e.target).attr('id') == 'lightbox' then @end()
return false
$lightbox.find('.lb-prev').on 'click', (e) =>
@changeImage @currentImageIndex - 1
return false
$lightbox.find('.lb-next').on 'click', (e) =>
@changeImage @currentImageIndex + 1
return false
@ -134,7 +134,7 @@ class Lightbox
if $(a).attr('href') == $link.attr('href')
imageNumber = i
# Position lightbox
# Position lightbox
$window = $(window)
top = $window.scrollTop() + $window.height()/10
left = $window.scrollLeft()
@ -144,31 +144,31 @@ class Lightbox
top: top + 'px'
left: left + 'px'
.fadeIn( @options.fadeDuration)
@changeImage(imageNumber)
return
# Hide most UI elements in preparation for the animated resizing of the lightbox.
changeImage: (imageNumber) ->
@disableKeyboardNav()
@disableKeyboardNav()
$lightbox = $('#lightbox')
$image = $lightbox.find('.lb-image')
@sizeOverlay()
$('#lightboxOverlay').fadeIn( @options.fadeDuration )
$('.loader').fadeIn 'slow'
$lightbox.find('.lb-image, .lb-nav, .lb-prev, .lb-next, .lb-dataContainer, .lb-numbers, .lb-caption').hide()
$lightbox.find('.lb-outerContainer').addClass 'animating'
# When image to show is preloaded, we send the width and height to sizeContainer()
preloader = new Image
preloader.onload = () =>
$image.attr 'src', @album[imageNumber].link
# Bug fix by Andy Scott
# Bug fix by Andy Scott
$image.width = preloader.width
$image.height = preloader.height
# End of bug fix
@ -176,7 +176,7 @@ class Lightbox
preloader.src = @album[imageNumber].link
@currentImageIndex = imageNumber
return
return
# Stretch overlay to fit the document
@ -184,8 +184,8 @@ class Lightbox
$('#lightboxOverlay')
.width( $(document).width())
.height( $(document).height() )
# Animate the size of the lightbox to fit the image we are showing
sizeContainer: (imageWidth, imageHeight) ->
$lightbox = $('#lightbox')
@ -198,11 +198,11 @@ class Lightbox
containerTopPadding = parseInt $container.css('padding-top'), 10
containerRightPadding = parseInt $container.css('padding-right'), 10
containerBottomPadding = parseInt $container.css('padding-bottom'), 10
containerLeftPadding = parseInt $container.css('padding-left'), 10
containerLeftPadding = parseInt $container.css('padding-left'), 10
newWidth = imageWidth + containerLeftPadding + containerRightPadding
newHeight = imageHeight + containerTopPadding + containerBottomPadding
# Animate just the width, just the height, or both, depending on what is different
if newWidth != oldWidth && newHeight != oldHeight
$outerContainer.animate
@ -225,11 +225,11 @@ class Lightbox
$lightbox.find('.lb-nextLink').height(newHeight)
@showImage()
return
, @options.resizeDuration
, @options.resizeDuration
return
# Display the image and it's details and begin preload neighboring images.
showImage: ->
$lightbox = $('#lightbox')
@ -251,11 +251,11 @@ class Lightbox
if @currentImageIndex > 0 then $lightbox.find('.lb-prev').show();
if @currentImageIndex < @album.length - 1 then $lightbox.find('.lb-next').show();
return
# Display caption, image number, and closing button.
# Display caption, image number, and closing button.
updateDetails: ->
$lightbox = $('#lightbox')
if typeof @album[@currentImageIndex].title != 'undefined' && @album[@currentImageIndex].title != ""
$lightbox.find('.lb-caption')
.html( @album[@currentImageIndex].title)
@ -265,18 +265,18 @@ class Lightbox
$lightbox.find('.lb-number')
.html( @options.labelImage + ' ' + (@currentImageIndex + 1) + ' ' + @options.labelOf + ' ' + @album.length)
.fadeIn('fast')
else
else
$lightbox.find('.lb-number').hide()
$lightbox.find('.lb-outerContainer').removeClass 'animating'
$lightbox.find('.lb-dataContainer')
.fadeIn @resizeDuration, () =>
@sizeOverlay()
return
# Preload previos and next images in set.
# Preload previos and next images in set.
preloadNeighboringImages: ->
if @album.length > @currentImageIndex + 1
preloadNext = new Image
@ -284,7 +284,7 @@ class Lightbox
if @currentImageIndex > 0
preloadPrev = new Image
preloadPrev.src = @album[@currentImageIndex - 1].link
preloadPrev.src = @album[@currentImageIndex - 1].link
return
@ -292,12 +292,12 @@ class Lightbox
$(document).on 'keyup.keyboard', $.proxy( @keyboardAction, this)
return
disableKeyboardNav: ->
$(document).off '.keyboard'
return
keyboardAction: (event) ->
KEYCODE_ESC = 27
KEYCODE_LEFTARROW = 37
@ -316,7 +316,7 @@ class Lightbox
@changeImage @currentImageIndex + 1
return
# Closing time. :-(
end: ->
@disableKeyboardNav()
@ -324,8 +324,8 @@ class Lightbox
$('#lightbox').fadeOut @options.fadeDuration
$('#lightboxOverlay').fadeOut @options.fadeDuration
$('select, object, embed').css visibility: "visible"
$ ->
options = new LightboxOptions
lightbox = new Lightbox options

+ 6
- 6
css/screen.css View File

@ -1,9 +1,9 @@
/* Lightbox v2 Project page styles
* Author: Lokesh Dhakar http://www.lokeshdhakar.com
* Created: a long time ago (2006 I think)
* Table of Contents:
* layout
* typography
/* Lightbox v2 Project page styles
* Author: Lokesh Dhakar http://www.lokeshdhakar.com
* Created: a long time ago (2006 I think)
* Table of Contents:
* layout
* typography
* content */
/* line 17, ../../../../.rvm/gems/ruby-1.9.2-p320/gems/compass-0.12.2/frameworks/compass/stylesheets/compass/reset/_utilities.scss */
html, body, div, span, applet, object, iframe,


+ 4
- 4
sass/_variables.sass View File

@ -1,9 +1,9 @@
// COLORS & BACKGROUNDS
// -----------
$lightGray: #eeeeee
$blue: #5182ff
$blue: #5182ff
$green: #74d494
$yellow: #fe7
$yellow: #fe7
$orange : #e7931a
$red: #c43c35
@ -19,7 +19,7 @@ $borderColor: #d5d5d5
$darkBorderColor: darken($borderColor, 10%)
$darkerBorderColor: darken($borderColor, 20%)
$lightBorderColor: lighten($borderColor, 5%)
$lighterBorderColor: lighten($borderColor, 10%)
$lighterBorderColor: lighten($borderColor, 10%)
$bodyBg: #222
@ -30,7 +30,7 @@ $bodyBg: #222
$fontFamily: "Open Sans", "lucida grande", tahoma, sans-serif
$headingFontFamily: "Fredoka One", "lucida grande", tahoma, sans-serif
$fontSize: 16px
$fontSize: 16px
$lineHeight: 1.625em


+ 1
- 1
sass/lightbox.sass View File

@ -74,7 +74,7 @@
float: left
.lb-next
right: 0
right: 0
float: right
.lb-prev


+ 23
- 26
sass/screen.sass View File

@ -1,10 +1,10 @@
/*
* Lightbox v2 Project page styles
* Author: Lokesh Dhakar http://www.lokeshdhakar.com
* Created: a long time ago (2006 I think)
* Table of Contents:
* layout
* typography
/*
* Lightbox v2 Project page styles
* Author: Lokesh Dhakar http://www.lokeshdhakar.com
* Created: a long time ago (2006 I think)
* Table of Contents:
* layout
* typography
* content
@import "compass/reset"
@ -76,7 +76,7 @@ h4
/* Text elements */
p
margin: 0 0 1.25em 0
line-height: $lineHeight
line-height: $lineHeight
ul, ol
margin: 0 0 1.25em 0
@ -109,7 +109,7 @@ code, kbd
background: rgba(0,0,0,0.4)
+box-shadow( 0 1px 0 0 rgba(255,255,255,0.1), inset 0 2px 6px 2px rgba(0,0,0,1))
padding: 5px
+border-radius($radius)
+border-radius($radius)
color: $orange
pre code
@ -124,13 +124,13 @@ a
text-decoration: none
&:hover
color: darken($linkColor, 20%)
::-moz-selection,
::selection
background: $orange
color: white
/* sidebar
*----------------------------------------------- */
@ -159,7 +159,7 @@ a
color: #4d9ed8
em
color: #4d9ed8
#nav
list-style: none
margin: 1.5em 0 1em 0
@ -216,7 +216,7 @@ a
.version
font-size: 24px
color: $linkColor
.filelist
float: left
@ -309,7 +309,7 @@ p.lead
color: darken( $color, 10%)
line-height: 1.4em
margin-bottom: 0
hr
height: 6px
@ -325,7 +325,7 @@ hr
.imageRow
+pie-clearfix
margin: $gutter/2 0
margin: $gutter/2 0
.single
float: left
a
@ -358,7 +358,7 @@ hr
+box-shadow(none)
margin-right: 0
&:hover
background-color: $linkColor
background-color: $linkColor
+box-shadow( 0 -1px 0 0 rgba(255,255,255,0.2), 0 1px 4px 0 rgba(0,0,0,0.5))
.single.first
a
@ -366,7 +366,7 @@ hr
.single.last
a
+border-right-radius($radius)
// Drop comments below content
@media only screen and (max-width: 1000px)
@ -375,13 +375,13 @@ hr
body
padding-top: 20px
.section
padding: 20px 0
p.lead
font-size: $fontSize + 4
h1
font-size: 30px
@ -390,16 +390,16 @@ hr
h3
font-size: 16px
code, kbd
font-size: 13px
pre code
font-size: 12px
pre
padding: .75em
#sidebar
width: $sidebarWidth - 40
left: 20px
@ -464,7 +464,7 @@ hr
padding-left: 0
.box, .file
float: none
.forums
text-align: center
width: 95%
@ -473,7 +473,4 @@ hr
padding-left: 0
.speech, .link
float: none

Loading…
Cancel
Save