Skip to content
Browse files

fancyBox added

  • Loading branch information...
1 parent bc8f762 commit ce0eb5abaa208d5e76aa429707c2a568be36530a @zlorfi committed Mar 26, 2013
View
4 README.md
@@ -7,6 +7,7 @@
- [Dragonfly](https://github.com/markevans/dragonfly)
- [Mongoid](https://github.com/mongoid/mongoid)
- [jQuery-File-Upload](https://github.com/blueimp/jQuery-File-Upload)
+- [fancyBox](https://github.com/fancyapps/fancyBox)
## !!WORK STILL IN PROGRESS!!
@@ -19,5 +20,4 @@
## TODO
- image handler exception
-- show flash message with xhr request
-- add jQuery gallery function
+- don't load all images at once
View
25 app.rb
@@ -98,18 +98,6 @@ def protected!
#halt haml :index unless admin?
end
- def flash_display
- response = ""
- unless flash.nil?
- flash.now[:success] = "Upload successful of"
- #flash.each do |name, msg|
- # response = response + content_tag(:div, msg, :id => "flash_#{name}")
- #end
- #flash.discard
- #response
- end
- end
-
def raw(text)
Rack::Utils.escape_html(text)
end
@@ -122,6 +110,15 @@ def raw(text)
scss :"sass/#{path}"
end
+ get '/notification/:type/:message' do
+ if request.xhr?
+ flash.now[:"#{params[:type]}"] = params[:message].split('_').join(' ')
+ haml :notification, :layout => !request.xhr?
+ else
+ redirect '/'
+ end
+ end
+
post '/login' do
if params['username']==settings.username && params['password']==settings.password
response.set_cookie(settings.username, {:value => settings.token, :expires => Time.now + (60*60*24*2)})
@@ -158,13 +155,11 @@ def raw(text)
image_date: Time.now
)
- flash[:success] = "Upload successful of #{filename}" if !request.xhr?
+ flash[:success] = "Upload successful of #{filename}"
redirect "/i/#{picture.id}" if !request.xhr?
- #flash.keep unless request.xhr?
picture.to_json
else
flash[:alert] = 'You have to choose a file first'
- #flash.keep unless request.xhr?
redirect "/upload"
end
View
173 public/elastislide.css
@@ -1,173 +0,0 @@
-/* Elastislide Style */
-.gallery {
- width: 100%;
- max-width: 520px;
- margin: 0 auto;
- border-radius: 20px;
- position: relative;
- /* background: #000 url(/image/black_denim.png); */
- box-shadow: 0 2px 1px rgba(255,255,255,0.9), 0 -2px 1px rgba(255,255,255,0.9);
-}
-
-
-.elastislide-list {
- list-style-type: none;
- display: none;
-}
-
-.no-js .elastislide-list {
- display: block;
-}
-
-.elastislide-carousel ul li {
- min-width: 20px; /* minimum width of the image (min width + border) */
-}
-
-.elastislide-wrapper {
- position: relative;
- background-color: #fff;
- margin: 0 auto;
- min-height: 60px;
- box-shadow: 1px 1px 3px rgba(0,0,0,0.2);
-}
-
-.elastislide-wrapper.elastislide-loading {
- background-image: url(/image/loading.gif);
- background-repeat: no-repeat;
- background-position: center center;
-}
-
-.elastislide-horizontal {
- padding: 10px 40px;
-}
-
-.elastislide-vertical {
- padding: 40px 10px;
-}
-
-.elastislide-carousel {
- overflow: hidden;
- position: relative;
-}
-
-.elastislide-carousel ul {
- position: relative;
- display: block;
- list-style-type: none;
- padding: 0;
- margin: 0;
- -webkit-backface-visibility: hidden;
- -webkit-transform: translateX(0px);
- -moz-transform: translateX(0px);
- -ms-transform: translateX(0px);
- -o-transform: translateX(0px);
- transform: translateX(0px);
-}
-
-.elastislide-horizontal ul {
- white-space: nowrap;
-}
-
-.elastislide-carousel ul li {
- margin: 0;
- -webkit-backface-visibility: hidden;
-}
-
-.elastislide-horizontal ul li {
- height: 100%;
- display: inline-block;
-}
-
-.elastislide-vertical ul li {
- display: block;
-}
-
-.elastislide-carousel ul li a {
- display: inline-block;
- width: 100%;
-}
-
-.elastislide-carousel ul li a img {
- display: block;
- border: 2px solid white;
- max-width: 100%;
-}
-
-/* Navigation Arrows */
-
-.elastislide-wrapper nav span {
- position: absolute;
- background: #ddd url(/image/nav.png) no-repeat 4px 3px;
- width: 23px;
- height: 23px;
- border-radius: 50%;
- text-indent: -9000px;
- cursor: pointer;
- opacity: 0.8;
-}
-
-.elastislide-wrapper nav span:hover {
- opacity: 1.0
-}
-
-.elastislide-horizontal nav span {
- top: 50%;
- left: 10px;
- margin-top: -11px;
-}
-
-.elastislide-vertical nav span {
- top: 10px;
- left: 50%;
- margin-left: -11px;
- background-position: -17px 5px;
-}
-
-.elastislide-horizontal nav span.elastislide-next {
- right: 10px;
- left: auto;
- background-position: 4px -17px;
-}
-
-.elastislide-vertical nav span.elastislide-next {
- bottom: 10px;
- top: auto;
- background-position: -17px -18px;
-}
-
-// Additional CSS
-
-.elastislide-horizontal {
- background-color: transparent;
- border-radius: 20px 20px 0 0;
-}
-
-//.elastislide-horizontal.elastislide-loading {
-// background-image: url(/image/loading_dark.gif);
-//}
-
-.elastislide-carousel ul li a{
- padding: 2px;
-}
-
-.elastislide-carousel ul li a img {
- border-radius: 10px;
- border: none;
- box-shadow: 0 1px 2px #000;
-}
-
-//.elastislide-wrapper nav span {
-// background-color: #666;
-// box-shadow: inset 0 1px 1px rgba(0,0,0,0.2);
-//}
-
-//.image-preview img {
-// border-radius: 0 0 20px 20px;
-// max-width: 100%;
-// display: block;
-//}
-
-//.elastislide-carousel ul li.current-img a img {
-// box-shadow: 0 0 3px 2px rgba(62,235,255,0.8);
-//}
-
View
BIN public/image/ajax-loader.gif
Deleted file not rendered
View
BIN public/image/arrow_small_blue.gif
Deleted file not rendered
View
BIN public/image/bg_direction_nav.png
Deleted file not rendered
View
BIN public/image/fancybox_loading.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN public/image/fancybox_overlay.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN public/image/fancybox_sprite.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN public/image/nav.png
Deleted file not rendered
View
BIN public/image/nav_thumbs.png
Deleted file not rendered
View
850 public/javascripts/vendor/jquery.elastislide.js
@@ -1,850 +0,0 @@
-/**
- * jquery.elastislide.js v1.1.0
- * http://www.codrops.com
- *
- * Licensed under the MIT license.
- * http://www.opensource.org/licenses/mit-license.php
- *
- * Copyright 2012, Codrops
- * http://www.codrops.com
- */
-
-;( function( $, window, undefined ) {
-
- 'use strict';
-
- /*
- * debouncedresize: special jQuery event that happens once after a window resize
- *
- * latest version and complete README available on Github:
- * https://github.com/louisremi/jquery-smartresize/blob/master/jquery.debouncedresize.js
- *
- * Copyright 2011 @louis_remi
- * Licensed under the MIT license.
- */
- var $event = $.event,
- $special,
- resizeTimeout;
-
- $special = $event.special.debouncedresize = {
- setup: function() {
- $( this ).on( "resize", $special.handler );
- },
- teardown: function() {
- $( this ).off( "resize", $special.handler );
- },
- handler: function( event, execAsap ) {
- // Save the context
- var context = this,
- args = arguments,
- dispatch = function() {
- // set correct event type
- event.type = "debouncedresize";
- $event.dispatch.apply( context, args );
- };
-
- if ( resizeTimeout ) {
- clearTimeout( resizeTimeout );
- }
-
- execAsap ?
- dispatch() :
- resizeTimeout = setTimeout( dispatch, $special.threshold );
- },
- threshold: 150
- };
-
- // ======================= imagesLoaded Plugin ===============================
- // https://github.com/desandro/imagesloaded
-
- // $('#my-container').imagesLoaded(myFunction)
- // execute a callback when all images have loaded.
- // needed because .load() doesn't work on cached images
-
- // callback function gets image collection as argument
- // this is the container
-
- // original: mit license. paul irish. 2010.
- // contributors: Oren Solomianik, David DeSandro, Yiannis Chatzikonstantinou
-
- // blank image data-uri bypasses webkit log warning (thx doug jones)
- var BLANK = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==';
-
- $.fn.imagesLoaded = function( callback ) {
- var $this = this,
- deferred = $.isFunction($.Deferred) ? $.Deferred() : 0,
- hasNotify = $.isFunction(deferred.notify),
- $images = $this.find('img').add( $this.filter('img') ),
- loaded = [],
- proper = [],
- broken = [];
-
- // Register deferred callbacks
- if ($.isPlainObject(callback)) {
- $.each(callback, function (key, value) {
- if (key === 'callback') {
- callback = value;
- } else if (deferred) {
- deferred[key](value);
- }
- });
- }
-
- function doneLoading() {
- var $proper = $(proper),
- $broken = $(broken);
-
- if ( deferred ) {
- if ( broken.length ) {
- deferred.reject( $images, $proper, $broken );
- } else {
- deferred.resolve( $images );
- }
- }
-
- if ( $.isFunction( callback ) ) {
- callback.call( $this, $images, $proper, $broken );
- }
- }
-
- function imgLoaded( img, isBroken ) {
- // don't proceed if BLANK image, or image is already loaded
- if ( img.src === BLANK || $.inArray( img, loaded ) !== -1 ) {
- return;
- }
-
- // store element in loaded images array
- loaded.push( img );
-
- // keep track of broken and properly loaded images
- if ( isBroken ) {
- broken.push( img );
- } else {
- proper.push( img );
- }
-
- // cache image and its state for future calls
- $.data( img, 'imagesLoaded', { isBroken: isBroken, src: img.src } );
-
- // trigger deferred progress method if present
- if ( hasNotify ) {
- deferred.notifyWith( $(img), [ isBroken, $images, $(proper), $(broken) ] );
- }
-
- // call doneLoading and clean listeners if all images are loaded
- if ( $images.length === loaded.length ){
- setTimeout( doneLoading );
- $images.unbind( '.imagesLoaded' );
- }
- }
-
- // if no images, trigger immediately
- if ( !$images.length ) {
- doneLoading();
- } else {
- $images.bind( 'load.imagesLoaded error.imagesLoaded', function( event ){
- // trigger imgLoaded
- imgLoaded( event.target, event.type === 'error' );
- }).each( function( i, el ) {
- var src = el.src;
-
- // find out if this image has been already checked for status
- // if it was, and src has not changed, call imgLoaded on it
- var cached = $.data( el, 'imagesLoaded' );
- if ( cached && cached.src === src ) {
- imgLoaded( el, cached.isBroken );
- return;
- }
-
- // if complete is true and browser supports natural sizes, try
- // to check for image status manually
- if ( el.complete && el.naturalWidth !== undefined ) {
- imgLoaded( el, el.naturalWidth === 0 || el.naturalHeight === 0 );
- return;
- }
-
- // cached images don't fire load sometimes, so we reset src, but only when
- // dealing with IE, or image is complete (loaded) and failed manual check
- // webkit hack from http://groups.google.com/group/jquery-dev/browse_thread/thread/eee6ab7b2da50e1f
- if ( el.readyState || el.complete ) {
- el.src = BLANK;
- el.src = src;
- }
- });
- }
-
- return deferred ? deferred.promise( $this ) : $this;
- };
-
- // global
- var $window = $( window ),
- Modernizr = window.Modernizr;
-
- $.Elastislide = function( options, element ) {
-
- this.$el = $( element );
- this._init( options );
-
- };
-
- $.Elastislide.defaults = {
- // orientation 'horizontal' || 'vertical'
- orientation : 'horizontal',
- // sliding speed
- speed : 500,
- // sliding easing
- easing : 'ease-in-out',
- // the minimum number of items to show.
- // when we resize the window, this will make sure minItems are always shown
- // (unless of course minItems is higher than the total number of elements)
- minItems : 3,
- // optionally specify a selector rather than using the img element to read the image sizes
- // (we only use the first matching element within our items)
- imgSizeItemSelector : 'img',
- // index of the current item (left most item of the carousel)
- start : 0,
- // click item callback
- onClick : function( el, position, evt ) { return false; },
- onReady : function() { return false; },
- onBeforeSlide : function() { return false; },
- onAfterSlide : function() { return false; }
- };
-
- $.Elastislide.prototype = {
-
- _init : function( options ) {
-
- // options
- this.options = $.extend( true, {}, $.Elastislide.defaults, options );
-
- // https://github.com/twitter/bootstrap/issues/2870
- var self = this,
- transEndEventNames = {
- 'WebkitTransition' : 'webkitTransitionEnd',
- 'MozTransition' : 'transitionend',
- 'OTransition' : 'oTransitionEnd',
- 'msTransition' : 'MSTransitionEnd',
- 'transition' : 'transitionend'
- };
-
- this.transEndEventName = transEndEventNames[ Modernizr.prefixed( 'transition' ) ];
-
- // suport for css transforms and css transitions
- this.support = Modernizr.csstransitions && Modernizr.csstransforms;
-
- // current item's index
- this.current = this.options.start;
-
- // control if it's sliding
- this.isSliding = false;
-
- this.$items = this.$el.children( 'li' );
- // total number of items
- this.itemsCount = this.$items.length;
- if( this.itemsCount === 0 ) {
-
- return false;
-
- }
- this._validate();
- // remove white space
- this.$items.detach();
- this.$el.empty();
- this.$el.append( this.$items );
-
- // main wrapper
- this.$el.wrap( '<div class="elastislide-wrapper elastislide-loading elastislide-' + this.options.orientation + '"></div>' );
-
- // check if we applied a transition to the <ul>
- this.hasTransition = false;
-
- // add transition for the <ul>
- this.hasTransitionTimeout = setTimeout( function() {
-
- self._addTransition();
-
- }, 100 );
-
- // preload the images
-
- this.$el.imagesLoaded( function() {
-
- self.$el.show();
-
- self._layout();
- self._configure();
-
- if( self.hasTransition ) {
-
- // slide to current's position
- self._removeTransition();
- self._slideToItem( self.current );
-
- self.$el.on( self.transEndEventName, function() {
-
- self.$el.off( self.transEndEventName );
- self._setWrapperSize();
- // add transition for the <ul>
- self._addTransition();
- self._initEvents();
-
- } );
-
- }
- else {
-
- clearTimeout( self.hasTransitionTimeout );
- self._setWrapperSize();
- self._initEvents();
- // slide to current's position
- self._slideToItem( self.current );
- setTimeout( function() { self._addTransition(); }, 25 );
-
- }
-
- self.options.onReady();
-
- } );
-
- },
- _validate : function() {
-
-
- if( this.options.minItems instanceof Function ) {
-
- this._minItemsFn = this.options.minItems;
- this.options.minItems = this.options.minItems( document.documentElement.clientWidth );
-
- }
-
-
-
- if( this.options.speed < 0 ) {
-
- this.options.speed = 500;
-
- }
- if( this.options.minItems < 1 || this.options.minItems > this.itemsCount ) {
-
- this.options.minItems = 1;
-
- }
- if( this.options.start < 0 || this.options.start > this.itemsCount - 1 ) {
-
- this.options.start = 0;
-
- }
- if( this.options.orientation != 'horizontal' && this.options.orientation != 'vertical' ) {
-
- this.options.orientation = 'horizontal';
-
- }
-
- },
- _layout : function() {
-
- this.$el.wrap( '<div class="elastislide-carousel"></div>' );
-
- this.$carousel = this.$el.parent();
- this.$wrapper = this.$carousel.parent().removeClass( 'elastislide-loading' );
-
- // save original image sizes
- var $img = this.$items.find( this.options.imgSizeItemSelector ).first();
- this.imgSize = { width : $img.outerWidth( true ), height : $img.outerHeight( true ) };
-
- this._setItemsSize();
- this.options.orientation === 'horizontal' ? this.$el.css( 'max-height', this.imgSize.height ) : this.$el.css( 'height', this.options.minItems * this.imgSize.height );
-
- // add the controls
- this._addControls();
-
- },
- _addTransition : function() {
-
- if( this.support ) {
-
- this.$el.css( 'transition', 'all ' + this.options.speed + 'ms ' + this.options.easing );
-
- }
- this.hasTransition = true;
-
- },
- _removeTransition : function() {
-
- if( this.support ) {
-
- this.$el.css( 'transition', 'all 0s' );
-
- }
- this.hasTransition = false;
-
- },
- _addControls : function() {
-
- var self = this;
-
- // add navigation elements
- this.$navigation = $( '<nav><span class="elastislide-prev">Previous</span><span class="elastislide-next">Next</span></nav>' )
- .appendTo( this.$wrapper );
-
-
- this.$navPrev = this.$navigation.find( 'span.elastislide-prev' ).on( 'mousedown.elastislide', function( event ) {
-
- self._slide( 'prev' );
- return false;
-
- } );
-
- this.$navNext = this.$navigation.find( 'span.elastislide-next' ).on( 'mousedown.elastislide', function( event ) {
-
- self._slide( 'next' );
- return false;
-
- } );
-
- },
- _setItemsSize : function() {
-
- // width for the items (%)
- var w = this.options.orientation === 'horizontal' ? ( Math.floor( this.$carousel.width() / this.options.minItems ) * 100 ) / this.$carousel.width() : 100;
-
- this.$items.css( {
- 'width' : w + '%',
- 'max-width' : this.imgSize.width,
- 'max-height' : this.imgSize.height
- } );
-
- if( this.options.orientation === 'vertical' ) {
-
- this.$wrapper.css( 'max-width', this.imgSize.width + parseInt( this.$wrapper.css( 'padding-left' ) ) + parseInt( this.$wrapper.css( 'padding-right' ) ) );
-
- }
-
- },
- _setWrapperSize : function() {
-
- if( this.options.orientation === 'vertical' ) {
-
- this.$wrapper.css( {
- 'height' : this.options.minItems * this.imgSize.height + parseInt( this.$wrapper.css( 'padding-top' ) ) + parseInt( this.$wrapper.css( 'padding-bottom' ) )
- } );
-
- }
-
- },
- _configure : function() {
-
- // check how many items fit in the carousel (visible area -> this.$carousel.width() )
- this.fitCount = this.options.orientation === 'horizontal' ?
- this.$carousel.width() < this.options.minItems * this.imgSize.width ? this.options.minItems : Math.floor( this.$carousel.width() / this.imgSize.width ) :
- this.$carousel.height() < this.options.minItems * this.imgSize.height ? this.options.minItems : Math.floor( this.$carousel.height() / this.imgSize.height );
-
- },
- _initEvents : function() {
-
- var self = this;
-
- $window.on( 'debouncedresize.elastislide', function() {
-
- if( self._minItemsFn ) {
- self.options.minItems = self._minItemsFn( document.documentElement.clientWidth );
- }
-
-
- self._setItemsSize();
- self._configure();
- self._slideToItem( self.current );
-
- } );
-
- this.$el.on( this.transEndEventName, function() {
-
- self._onEndTransition();
-
- } );
-
- if( this.options.orientation === 'horizontal' ) {
-
- this.$el.on( {
- swipeleft : function() {
-
- self._slide( 'next' );
-
- },
- swiperight : function() {
-
- self._slide( 'prev' );
-
- }
- } );
-
- }
- else {
-
- this.$el.on( {
- swipeup : function() {
-
- self._slide( 'next' );
-
- },
- swipedown : function() {
-
- self._slide( 'prev' );
-
- }
- } );
-
- }
-
- // item click event
- this.$el.on( 'click.elastislide', 'li', function( event ) {
-
- var $item = $( this );
-
- self.options.onClick( $item, $item.index(), event );
-
- });
-
- },
- _destroy : function( callback ) {
-
- this.$el.off( this.transEndEventName ).off( 'swipeleft swiperight swipeup swipedown .elastislide' );
- $window.off( '.elastislide' );
-
- this.$el.css( {
- 'max-height' : 'none',
- 'transition' : 'none'
- } ).unwrap( this.$carousel ).unwrap( this.$wrapper );
-
- this.$items.css( {
- 'width' : 'auto',
- 'max-width' : 'none',
- 'max-height' : 'none'
- } );
-
- this.$navigation.remove();
- this.$wrapper.remove();
-
- if( callback ) {
-
- callback.call();
-
- }
-
- },
- _toggleControls : function( dir, display ) {
-
- if( display ) {
-
- ( dir === 'next' ) ? this.$navNext.show() : this.$navPrev.show();
-
- }
- else {
-
- ( dir === 'next' ) ? this.$navNext.hide() : this.$navPrev.hide();
-
- }
-
- },
- _slide : function( dir, tvalue ) {
-
- if( this.isSliding ) {
-
- return false;
-
- }
-
- this.options.onBeforeSlide();
-
- this.isSliding = true;
-
- var self = this,
- translation = this.translation || 0,
- // width/height of an item ( <li> )
- itemSpace = this.options.orientation === 'horizontal' ? this.$items.outerWidth( true ) : this.$items.outerHeight( true ),
- // total width/height of the <ul>
- totalSpace = this.itemsCount * itemSpace,
- // visible width/height
- visibleSpace = this.options.orientation === 'horizontal' ? this.$carousel.width() : this.$carousel.height();
-
- if( tvalue === undefined ) {
-
- var amount = this.fitCount * itemSpace;
-
- if( amount < 0 ) {
-
- return false;
-
- }
-
- if( dir === 'next' && totalSpace - ( Math.abs( translation ) + amount ) < visibleSpace ) {
-
- amount = totalSpace - ( Math.abs( translation ) + visibleSpace );
-
- // show / hide navigation buttons
- this._toggleControls( 'next', false );
- this._toggleControls( 'prev', true );
-
- }
- else if( dir === 'prev' && Math.abs( translation ) - amount < 0 ) {
-
- amount = Math.abs( translation );
-
- // show / hide navigation buttons
- this._toggleControls( 'next', true );
- this._toggleControls( 'prev', false );
-
- }
- else {
-
- // future translation value
- var ftv = dir === 'next' ? Math.abs( translation ) + Math.abs( amount ) : Math.abs( translation ) - Math.abs( amount );
-
- // show / hide navigation buttons
- ftv > 0 ? this._toggleControls( 'prev', true ) : this._toggleControls( 'prev', false );
- ftv < totalSpace - visibleSpace ? this._toggleControls( 'next', true ) : this._toggleControls( 'next', false );
-
- }
-
- tvalue = dir === 'next' ? translation - amount : translation + amount;
-
- }
- else {
-
- var amount = Math.abs( tvalue );
-
- if( Math.max( totalSpace, visibleSpace ) - amount < visibleSpace ) {
-
- tvalue = - ( Math.max( totalSpace, visibleSpace ) - visibleSpace );
-
- }
-
- // show / hide navigation buttons
- amount > 0 ? this._toggleControls( 'prev', true ) : this._toggleControls( 'prev', false );
- Math.max( totalSpace, visibleSpace ) - visibleSpace > amount ? this._toggleControls( 'next', true ) : this._toggleControls( 'next', false );
-
- }
-
- this.translation = tvalue;
-
- if( translation === tvalue ) {
-
- this._onEndTransition();
- return false;
-
- }
-
- if( this.support ) {
-
- if (this.options.orientation === 'horizontal') {
- this.$el.css( '-webkit-transform', 'translateX(' + tvalue + 'px)' );
- this.$el.css( '-o-transform', 'translateX(' + tvalue + 'px)' );
- this.$el.css( '-ms-transform', 'translateX(' + tvalue + 'px)' );
- this.$el.css( '-moz-transform', 'translateX(' + tvalue + 'px)' );
- this.$el.css( 'transform', 'translateX(' + tvalue + 'px)' );
- } else {
- this.$el.css( '-webkit-transform', 'translateY(' + tvalue + 'px)' );
- this.$el.css( '-o-transform', 'translateY(' + tvalue + 'px)' );
- this.$el.css( '-ms-transform', 'translateY(' + tvalue + 'px)' );
- this.$el.css( '-moz-transform', 'translateY(' + tvalue + 'px)' );
- this.$el.css( 'transform', 'translateY(' + tvalue + 'px)' );
- }
-
- }
- else {
-
- $.fn.applyStyle = this.hasTransition ? $.fn.animate : $.fn.css;
- var styleCSS = this.options.orientation === 'horizontal' ? { left : tvalue } : { top : tvalue };
-
- this.$el.stop().applyStyle( styleCSS, $.extend( true, [], { duration : this.options.speed, complete : function() {
-
- self._onEndTransition();
-
- } } ) );
-
- }
-
- if( !this.hasTransition ) {
-
- this._onEndTransition();
-
- }
-
- },
- _onEndTransition : function() {
-
- this.isSliding = false;
- this.options.onAfterSlide();
-
- },
- _slideTo : function( pos ) {
-
- var pos = pos || this.current,
- translation = Math.abs( this.translation ) || 0,
- itemSpace = this.options.orientation === 'horizontal' ? this.$items.outerWidth( true ) : this.$items.outerHeight( true ),
- posR = translation + this.$carousel.width(),
- ftv = Math.abs( pos * itemSpace );
-
- if( ftv + itemSpace > posR || ftv < translation ) {
-
- this._slideToItem( pos );
-
- }
-
- },
- _slideToItem : function( pos ) {
-
- // how much to slide?
- var amount = this.options.orientation === 'horizontal' ? pos * this.$items.outerWidth( true ) : pos * this.$items.outerHeight( true );
- this._slide( '', -amount );
-
- },
- // public method: adds new items to the carousel
- /*
-
- how to use:
- var carouselEl = $( '#carousel' ),
- carousel = carouselEl.elastislide();
- ...
-
- // append or prepend new items:
- carouselEl.prepend('<li><a href="#"><img src="images/large/2.jpg" alt="image02" /></a></li>');
-
- // call the add method:
- es.add();
-
- */
- add : function( callback ) {
-
- var self = this,
- oldcurrent = this.current,
- $currentItem = this.$items.eq( this.current );
-
- // adds new items to the carousel
- this.$items = this.$el.children( 'li' );
- this.itemsCount = this.$items.length;
- this.current = $currentItem.index();
- this._setItemsSize();
- this._configure();
- this._removeTransition();
- oldcurrent < this.current ? this._slideToItem( this.current ) : this._slide( 'next', this.translation );
- setTimeout( function() { self._addTransition(); }, 25 );
-
- if ( callback ) {
-
- callback.call();
-
- }
-
- },
- // public method: sets a new element as the current. slides to that position
- setCurrent : function( idx, callback ) {
-
- this.current = idx;
-
- this._slideTo();
-
- if ( callback ) {
-
- callback.call();
-
- }
-
- },
- // public method: slides to the next set of items
- next : function() {
-
- self._slide( 'next' );
-
- },
- // public method: slides to the previous set of items
- previous : function() {
-
- self._slide( 'prev' );
-
- },
- // public method: slides to the first item
- slideStart : function() {
-
- this._slideTo( 0 );
-
- },
- // public method: slides to the last item
- slideEnd : function() {
-
- this._slideTo( this.itemsCount - 1 );
-
- },
- // public method: destroys the elastislide instance
- destroy : function( callback ) {
-
- this._destroy( callback );
-
- }
-
- };
-
- var logError = function( message ) {
-
- if ( window.console ) {
-
- window.console.error( message );
-
- }
-
- };
-
- $.fn.elastislide = function( options ) {
-
- var self = $.data( this, 'elastislide' );
-
- if ( typeof options === 'string' ) {
-
- var args = Array.prototype.slice.call( arguments, 1 );
-
- this.each(function() {
-
- if ( !self ) {
-
- logError( "cannot call methods on elastislide prior to initialization; " +
- "attempted to call method '" + options + "'" );
- return;
-
- }
-
- if ( !$.isFunction( self[options] ) || options.charAt(0) === "_" ) {
-
- logError( "no such method '" + options + "' for elastislide self" );
- return;
-
- }
-
- self[ options ].apply( self, args );
-
- });
-
- }
- else {
-
- this.each(function() {
-
- if ( self ) {
-
- self._init();
-
- }
- else {
-
- self = $.data( this, 'elastislide', new $.Elastislide( options, this ) );
-
- }
-
- });
-
- }
-
- return self;
-
- };
-
-} )( jQuery, window );
View
45 public/javascripts/vendor/jquery.fancybox.pack.js
@@ -0,0 +1,45 @@
+/*! fancyBox v2.1.4 fancyapps.com | fancyapps.com/fancybox/#license */
+(function(C,z,f,r){var q=f(C),n=f(z),b=f.fancybox=function(){b.open.apply(this,arguments)},H=navigator.userAgent.match(/msie/),w=null,s=z.createTouch!==r,t=function(a){return a&&a.hasOwnProperty&&a instanceof f},p=function(a){return a&&"string"===f.type(a)},F=function(a){return p(a)&&0<a.indexOf("%")},l=function(a,d){var e=parseInt(a,10)||0;d&&F(a)&&(e*=b.getViewport()[d]/100);return Math.ceil(e)},x=function(a,b){return l(a,b)+"px"};f.extend(b,{version:"2.1.4",defaults:{padding:15,margin:20,width:800,
+height:600,minWidth:100,minHeight:100,maxWidth:9999,maxHeight:9999,autoSize:!0,autoHeight:!1,autoWidth:!1,autoResize:!0,autoCenter:!s,fitToView:!0,aspectRatio:!1,topRatio:0.5,leftRatio:0.5,scrolling:"auto",wrapCSS:"",arrows:!0,closeBtn:!0,closeClick:!1,nextClick:!1,mouseWheel:!0,autoPlay:!1,playSpeed:3E3,preload:3,modal:!1,loop:!0,ajax:{dataType:"html",headers:{"X-fancyBox":!0}},iframe:{scrolling:"auto",preload:!0},swf:{wmode:"transparent",allowfullscreen:"true",allowscriptaccess:"always"},keys:{next:{13:"left",
+34:"up",39:"left",40:"up"},prev:{8:"right",33:"down",37:"right",38:"down"},close:[27],play:[32],toggle:[70]},direction:{next:"left",prev:"right"},scrollOutside:!0,index:0,type:null,href:null,content:null,title:null,tpl:{wrap:'<div class="fancybox-wrap" tabIndex="-1"><div class="fancybox-skin"><div class="fancybox-outer"><div class="fancybox-inner"></div></div></div></div>',image:'<img class="fancybox-image" src="{href}" alt="" />',iframe:'<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" frameborder="0" vspace="0" hspace="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen'+
+(H?' allowtransparency="true"':"")+"></iframe>",error:'<p class="fancybox-error">The requested content cannot be loaded.<br/>Please try again later.</p>',closeBtn:'<a title="Close" class="fancybox-item fancybox-close" href="javascript:;"></a>',next:'<a title="Next" class="fancybox-nav fancybox-next" href="javascript:;"><span></span></a>',prev:'<a title="Previous" class="fancybox-nav fancybox-prev" href="javascript:;"><span></span></a>'},openEffect:"fade",openSpeed:250,openEasing:"swing",openOpacity:!0,
+openMethod:"zoomIn",closeEffect:"fade",closeSpeed:250,closeEasing:"swing",closeOpacity:!0,closeMethod:"zoomOut",nextEffect:"elastic",nextSpeed:250,nextEasing:"swing",nextMethod:"changeIn",prevEffect:"elastic",prevSpeed:250,prevEasing:"swing",prevMethod:"changeOut",helpers:{overlay:!0,title:!0},onCancel:f.noop,beforeLoad:f.noop,afterLoad:f.noop,beforeShow:f.noop,afterShow:f.noop,beforeChange:f.noop,beforeClose:f.noop,afterClose:f.noop},group:{},opts:{},previous:null,coming:null,current:null,isActive:!1,
+isOpen:!1,isOpened:!1,wrap:null,skin:null,outer:null,inner:null,player:{timer:null,isActive:!1},ajaxLoad:null,imgPreload:null,transitions:{},helpers:{},open:function(a,d){if(a&&(f.isPlainObject(d)||(d={}),!1!==b.close(!0)))return f.isArray(a)||(a=t(a)?f(a).get():[a]),f.each(a,function(e,c){var k={},g,h,j,m,l;"object"===f.type(c)&&(c.nodeType&&(c=f(c)),t(c)?(k={href:c.data("fancybox-href")||c.attr("href"),title:c.data("fancybox-title")||c.attr("title"),isDom:!0,element:c},f.metadata&&f.extend(!0,k,
+c.metadata())):k=c);g=d.href||k.href||(p(c)?c:null);h=d.title!==r?d.title:k.title||"";m=(j=d.content||k.content)?"html":d.type||k.type;!m&&k.isDom&&(m=c.data("fancybox-type"),m||(m=(m=c.prop("class").match(/fancybox\.(\w+)/))?m[1]:null));p(g)&&(m||(b.isImage(g)?m="image":b.isSWF(g)?m="swf":"#"===g.charAt(0)?m="inline":p(c)&&(m="html",j=c)),"ajax"===m&&(l=g.split(/\s+/,2),g=l.shift(),l=l.shift()));j||("inline"===m?g?j=f(p(g)?g.replace(/.*(?=#[^\s]+$)/,""):g):k.isDom&&(j=c):"html"===m?j=g:!m&&(!g&&
+k.isDom)&&(m="inline",j=c));f.extend(k,{href:g,type:m,content:j,title:h,selector:l});a[e]=k}),b.opts=f.extend(!0,{},b.defaults,d),d.keys!==r&&(b.opts.keys=d.keys?f.extend({},b.defaults.keys,d.keys):!1),b.group=a,b._start(b.opts.index)},cancel:function(){var a=b.coming;a&&!1!==b.trigger("onCancel")&&(b.hideLoading(),b.ajaxLoad&&b.ajaxLoad.abort(),b.ajaxLoad=null,b.imgPreload&&(b.imgPreload.onload=b.imgPreload.onerror=null),a.wrap&&a.wrap.stop(!0,!0).trigger("onReset").remove(),b.coming=null,b.current||
+b._afterZoomOut(a))},close:function(a){b.cancel();!1!==b.trigger("beforeClose")&&(b.unbindEvents(),b.isActive&&(!b.isOpen||!0===a?(f(".fancybox-wrap").stop(!0).trigger("onReset").remove(),b._afterZoomOut()):(b.isOpen=b.isOpened=!1,b.isClosing=!0,f(".fancybox-item, .fancybox-nav").remove(),b.wrap.stop(!0,!0).removeClass("fancybox-opened"),b.transitions[b.current.closeMethod]())))},play:function(a){var d=function(){clearTimeout(b.player.timer)},e=function(){d();b.current&&b.player.isActive&&(b.player.timer=
+setTimeout(b.next,b.current.playSpeed))},c=function(){d();f("body").unbind(".player");b.player.isActive=!1;b.trigger("onPlayEnd")};if(!0===a||!b.player.isActive&&!1!==a){if(b.current&&(b.current.loop||b.current.index<b.group.length-1))b.player.isActive=!0,f("body").bind({"afterShow.player onUpdate.player":e,"onCancel.player beforeClose.player":c,"beforeLoad.player":d}),e(),b.trigger("onPlayStart")}else c()},next:function(a){var d=b.current;d&&(p(a)||(a=d.direction.next),b.jumpto(d.index+1,a,"next"))},
+prev:function(a){var d=b.current;d&&(p(a)||(a=d.direction.prev),b.jumpto(d.index-1,a,"prev"))},jumpto:function(a,d,e){var c=b.current;c&&(a=l(a),b.direction=d||c.direction[a>=c.index?"next":"prev"],b.router=e||"jumpto",c.loop&&(0>a&&(a=c.group.length+a%c.group.length),a%=c.group.length),c.group[a]!==r&&(b.cancel(),b._start(a)))},reposition:function(a,d){var e=b.current,c=e?e.wrap:null,k;c&&(k=b._getPosition(d),a&&"scroll"===a.type?(delete k.position,c.stop(!0,!0).animate(k,200)):(c.css(k),e.pos=f.extend({},
+e.dim,k)))},update:function(a){var d=a&&a.type,e=!d||"orientationchange"===d;e&&(clearTimeout(w),w=null);b.isOpen&&!w&&(w=setTimeout(function(){var c=b.current;c&&!b.isClosing&&(b.wrap.removeClass("fancybox-tmp"),(e||"load"===d||"resize"===d&&c.autoResize)&&b._setDimension(),"scroll"===d&&c.canShrink||b.reposition(a),b.trigger("onUpdate"),w=null)},e&&!s?0:300))},toggle:function(a){b.isOpen&&(b.current.fitToView="boolean"===f.type(a)?a:!b.current.fitToView,s&&(b.wrap.removeAttr("style").addClass("fancybox-tmp"),
+b.trigger("onUpdate")),b.update())},hideLoading:function(){n.unbind(".loading");f("#fancybox-loading").remove()},showLoading:function(){var a,d;b.hideLoading();a=f('<div id="fancybox-loading"><div></div></div>').click(b.cancel).appendTo("body");n.bind("keydown.loading",function(a){if(27===(a.which||a.keyCode))a.preventDefault(),b.cancel()});b.defaults.fixed||(d=b.getViewport(),a.css({position:"absolute",top:0.5*d.h+d.y,left:0.5*d.w+d.x}))},getViewport:function(){var a=b.current&&b.current.locked||
+!1,d={x:q.scrollLeft(),y:q.scrollTop()};a?(d.w=a[0].clientWidth,d.h=a[0].clientHeight):(d.w=s&&C.innerWidth?C.innerWidth:q.width(),d.h=s&&C.innerHeight?C.innerHeight:q.height());return d},unbindEvents:function(){b.wrap&&t(b.wrap)&&b.wrap.unbind(".fb");n.unbind(".fb");q.unbind(".fb")},bindEvents:function(){var a=b.current,d;a&&(q.bind("orientationchange.fb"+(s?"":" resize.fb")+(a.autoCenter&&!a.locked?" scroll.fb":""),b.update),(d=a.keys)&&n.bind("keydown.fb",function(e){var c=e.which||e.keyCode,k=
+e.target||e.srcElement;if(27===c&&b.coming)return!1;!e.ctrlKey&&(!e.altKey&&!e.shiftKey&&!e.metaKey&&(!k||!k.type&&!f(k).is("[contenteditable]")))&&f.each(d,function(d,k){if(1<a.group.length&&k[c]!==r)return b[d](k[c]),e.preventDefault(),!1;if(-1<f.inArray(c,k))return b[d](),e.preventDefault(),!1})}),f.fn.mousewheel&&a.mouseWheel&&b.wrap.bind("mousewheel.fb",function(d,c,k,g){for(var h=f(d.target||null),j=!1;h.length&&!j&&!h.is(".fancybox-skin")&&!h.is(".fancybox-wrap");)j=h[0]&&!(h[0].style.overflow&&
+"hidden"===h[0].style.overflow)&&(h[0].clientWidth&&h[0].scrollWidth>h[0].clientWidth||h[0].clientHeight&&h[0].scrollHeight>h[0].clientHeight),h=f(h).parent();if(0!==c&&!j&&1<b.group.length&&!a.canShrink){if(0<g||0<k)b.prev(0<g?"down":"left");else if(0>g||0>k)b.next(0>g?"up":"right");d.preventDefault()}}))},trigger:function(a,d){var e,c=d||b.coming||b.current;if(c){f.isFunction(c[a])&&(e=c[a].apply(c,Array.prototype.slice.call(arguments,1)));if(!1===e)return!1;c.helpers&&f.each(c.helpers,function(d,
+e){e&&(b.helpers[d]&&f.isFunction(b.helpers[d][a]))&&(e=f.extend(!0,{},b.helpers[d].defaults,e),b.helpers[d][a](e,c))});f.event.trigger(a+".fb")}},isImage:function(a){return p(a)&&a.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp)((\?|#).*)?$)/i)},isSWF:function(a){return p(a)&&a.match(/\.(swf)((\?|#).*)?$/i)},_start:function(a){var d={},e,c;a=l(a);e=b.group[a]||null;if(!e)return!1;d=f.extend(!0,{},b.opts,e);e=d.margin;c=d.padding;"number"===f.type(e)&&(d.margin=[e,e,e,e]);"number"===f.type(c)&&
+(d.padding=[c,c,c,c]);d.modal&&f.extend(!0,d,{closeBtn:!1,closeClick:!1,nextClick:!1,arrows:!1,mouseWheel:!1,keys:null,helpers:{overlay:{closeClick:!1}}});d.autoSize&&(d.autoWidth=d.autoHeight=!0);"auto"===d.width&&(d.autoWidth=!0);"auto"===d.height&&(d.autoHeight=!0);d.group=b.group;d.index=a;b.coming=d;if(!1===b.trigger("beforeLoad"))b.coming=null;else{c=d.type;e=d.href;if(!c)return b.coming=null,b.current&&b.router&&"jumpto"!==b.router?(b.current.index=a,b[b.router](b.direction)):!1;b.isActive=
+!0;if("image"===c||"swf"===c)d.autoHeight=d.autoWidth=!1,d.scrolling="visible";"image"===c&&(d.aspectRatio=!0);"iframe"===c&&s&&(d.scrolling="scroll");d.wrap=f(d.tpl.wrap).addClass("fancybox-"+(s?"mobile":"desktop")+" fancybox-type-"+c+" fancybox-tmp "+d.wrapCSS).appendTo(d.parent||"body");f.extend(d,{skin:f(".fancybox-skin",d.wrap),outer:f(".fancybox-outer",d.wrap),inner:f(".fancybox-inner",d.wrap)});f.each(["Top","Right","Bottom","Left"],function(a,b){d.skin.css("padding"+b,x(d.padding[a]))});b.trigger("onReady");
+if("inline"===c||"html"===c){if(!d.content||!d.content.length)return b._error("content")}else if(!e)return b._error("href");"image"===c?b._loadImage():"ajax"===c?b._loadAjax():"iframe"===c?b._loadIframe():b._afterLoad()}},_error:function(a){f.extend(b.coming,{type:"html",autoWidth:!0,autoHeight:!0,minWidth:0,minHeight:0,scrolling:"no",hasError:a,content:b.coming.tpl.error});b._afterLoad()},_loadImage:function(){var a=b.imgPreload=new Image;a.onload=function(){this.onload=this.onerror=null;b.coming.width=
+this.width;b.coming.height=this.height;b._afterLoad()};a.onerror=function(){this.onload=this.onerror=null;b._error("image")};a.src=b.coming.href;!0!==a.complete&&b.showLoading()},_loadAjax:function(){var a=b.coming;b.showLoading();b.ajaxLoad=f.ajax(f.extend({},a.ajax,{url:a.href,error:function(a,e){b.coming&&"abort"!==e?b._error("ajax",a):b.hideLoading()},success:function(d,e){"success"===e&&(a.content=d,b._afterLoad())}}))},_loadIframe:function(){var a=b.coming,d=f(a.tpl.iframe.replace(/\{rnd\}/g,
+(new Date).getTime())).attr("scrolling",s?"auto":a.iframe.scrolling).attr("src",a.href);f(a.wrap).bind("onReset",function(){try{f(this).find("iframe").hide().attr("src","//about:blank").end().empty()}catch(a){}});a.iframe.preload&&(b.showLoading(),d.one("load",function(){f(this).data("ready",1);s||f(this).bind("load.fb",b.update);f(this).parents(".fancybox-wrap").width("100%").removeClass("fancybox-tmp").show();b._afterLoad()}));a.content=d.appendTo(a.inner);a.iframe.preload||b._afterLoad()},_preloadImages:function(){var a=
+b.group,d=b.current,e=a.length,c=d.preload?Math.min(d.preload,e-1):0,f,g;for(g=1;g<=c;g+=1)f=a[(d.index+g)%e],"image"===f.type&&f.href&&((new Image).src=f.href)},_afterLoad:function(){var a=b.coming,d=b.current,e,c,k,g,h;b.hideLoading();if(a&&!1!==b.isActive)if(!1===b.trigger("afterLoad",a,d))a.wrap.stop(!0).trigger("onReset").remove(),b.coming=null;else{d&&(b.trigger("beforeChange",d),d.wrap.stop(!0).removeClass("fancybox-opened").find(".fancybox-item, .fancybox-nav").remove());b.unbindEvents();
+e=a.content;c=a.type;k=a.scrolling;f.extend(b,{wrap:a.wrap,skin:a.skin,outer:a.outer,inner:a.inner,current:a,previous:d});g=a.href;switch(c){case "inline":case "ajax":case "html":a.selector?e=f("<div>").html(e).find(a.selector):t(e)&&(e.data("fancybox-placeholder")||e.data("fancybox-placeholder",f('<div class="fancybox-placeholder"></div>').insertAfter(e).hide()),e=e.show().detach(),a.wrap.bind("onReset",function(){f(this).find(e).length&&e.hide().replaceAll(e.data("fancybox-placeholder")).data("fancybox-placeholder",
+!1)}));break;case "image":e=a.tpl.image.replace("{href}",g);break;case "swf":e='<object id="fancybox-swf" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%"><param name="movie" value="'+g+'"></param>',h="",f.each(a.swf,function(a,b){e+='<param name="'+a+'" value="'+b+'"></param>';h+=" "+a+'="'+b+'"'}),e+='<embed src="'+g+'" type="application/x-shockwave-flash" width="100%" height="100%"'+h+"></embed></object>"}(!t(e)||!e.parent().is(a.inner))&&a.inner.append(e);b.trigger("beforeShow");
+a.inner.css("overflow","yes"===k?"scroll":"no"===k?"hidden":k);b._setDimension();b.reposition();b.isOpen=!1;b.coming=null;b.bindEvents();if(b.isOpened){if(d.prevMethod)b.transitions[d.prevMethod]()}else f(".fancybox-wrap").not(a.wrap).stop(!0).trigger("onReset").remove();b.transitions[b.isOpened?a.nextMethod:a.openMethod]();b._preloadImages()}},_setDimension:function(){var a=b.getViewport(),d=0,e=!1,c=!1,e=b.wrap,k=b.skin,g=b.inner,h=b.current,c=h.width,j=h.height,m=h.minWidth,u=h.minHeight,n=h.maxWidth,
+v=h.maxHeight,s=h.scrolling,q=h.scrollOutside?h.scrollbarWidth:0,y=h.margin,p=l(y[1]+y[3]),r=l(y[0]+y[2]),z,A,t,D,B,G,C,E,w;e.add(k).add(g).width("auto").height("auto").removeClass("fancybox-tmp");y=l(k.outerWidth(!0)-k.width());z=l(k.outerHeight(!0)-k.height());A=p+y;t=r+z;D=F(c)?(a.w-A)*l(c)/100:c;B=F(j)?(a.h-t)*l(j)/100:j;if("iframe"===h.type){if(w=h.content,h.autoHeight&&1===w.data("ready"))try{w[0].contentWindow.document.location&&(g.width(D).height(9999),G=w.contents().find("body"),q&&G.css("overflow-x",
+"hidden"),B=G.height())}catch(H){}}else if(h.autoWidth||h.autoHeight)g.addClass("fancybox-tmp"),h.autoWidth||g.width(D),h.autoHeight||g.height(B),h.autoWidth&&(D=g.width()),h.autoHeight&&(B=g.height()),g.removeClass("fancybox-tmp");c=l(D);j=l(B);E=D/B;m=l(F(m)?l(m,"w")-A:m);n=l(F(n)?l(n,"w")-A:n);u=l(F(u)?l(u,"h")-t:u);v=l(F(v)?l(v,"h")-t:v);G=n;C=v;h.fitToView&&(n=Math.min(a.w-A,n),v=Math.min(a.h-t,v));A=a.w-p;r=a.h-r;h.aspectRatio?(c>n&&(c=n,j=l(c/E)),j>v&&(j=v,c=l(j*E)),c<m&&(c=m,j=l(c/E)),j<u&&
+(j=u,c=l(j*E))):(c=Math.max(m,Math.min(c,n)),h.autoHeight&&"iframe"!==h.type&&(g.width(c),j=g.height()),j=Math.max(u,Math.min(j,v)));if(h.fitToView)if(g.width(c).height(j),e.width(c+y),a=e.width(),p=e.height(),h.aspectRatio)for(;(a>A||p>r)&&(c>m&&j>u)&&!(19<d++);)j=Math.max(u,Math.min(v,j-10)),c=l(j*E),c<m&&(c=m,j=l(c/E)),c>n&&(c=n,j=l(c/E)),g.width(c).height(j),e.width(c+y),a=e.width(),p=e.height();else c=Math.max(m,Math.min(c,c-(a-A))),j=Math.max(u,Math.min(j,j-(p-r)));q&&("auto"===s&&j<B&&c+y+
+q<A)&&(c+=q);g.width(c).height(j);e.width(c+y);a=e.width();p=e.height();e=(a>A||p>r)&&c>m&&j>u;c=h.aspectRatio?c<G&&j<C&&c<D&&j<B:(c<G||j<C)&&(c<D||j<B);f.extend(h,{dim:{width:x(a),height:x(p)},origWidth:D,origHeight:B,canShrink:e,canExpand:c,wPadding:y,hPadding:z,wrapSpace:p-k.outerHeight(!0),skinSpace:k.height()-j});!w&&(h.autoHeight&&j>u&&j<v&&!c)&&g.height("auto")},_getPosition:function(a){var d=b.current,e=b.getViewport(),c=d.margin,f=b.wrap.width()+c[1]+c[3],g=b.wrap.height()+c[0]+c[2],c={position:"absolute",
+top:c[0],left:c[3]};d.autoCenter&&d.fixed&&!a&&g<=e.h&&f<=e.w?c.position="fixed":d.locked||(c.top+=e.y,c.left+=e.x);c.top=x(Math.max(c.top,c.top+(e.h-g)*d.topRatio));c.left=x(Math.max(c.left,c.left+(e.w-f)*d.leftRatio));return c},_afterZoomIn:function(){var a=b.current;a&&(b.isOpen=b.isOpened=!0,b.wrap.css("overflow","visible").addClass("fancybox-opened"),b.update(),(a.closeClick||a.nextClick&&1<b.group.length)&&b.inner.css("cursor","pointer").bind("click.fb",function(d){!f(d.target).is("a")&&!f(d.target).parent().is("a")&&
+(d.preventDefault(),b[a.closeClick?"close":"next"]())}),a.closeBtn&&f(a.tpl.closeBtn).appendTo(b.skin).bind("click.fb",function(a){a.preventDefault();b.close()}),a.arrows&&1<b.group.length&&((a.loop||0<a.index)&&f(a.tpl.prev).appendTo(b.outer).bind("click.fb",b.prev),(a.loop||a.index<b.group.length-1)&&f(a.tpl.next).appendTo(b.outer).bind("click.fb",b.next)),b.trigger("afterShow"),!a.loop&&a.index===a.group.length-1?b.play(!1):b.opts.autoPlay&&!b.player.isActive&&(b.opts.autoPlay=!1,b.play()))},_afterZoomOut:function(a){a=
+a||b.current;f(".fancybox-wrap").trigger("onReset").remove();f.extend(b,{group:{},opts:{},router:!1,current:null,isActive:!1,isOpened:!1,isOpen:!1,isClosing:!1,wrap:null,skin:null,outer:null,inner:null});b.trigger("afterClose",a)}});b.transitions={getOrigPosition:function(){var a=b.current,d=a.element,e=a.orig,c={},f=50,g=50,h=a.hPadding,j=a.wPadding,m=b.getViewport();!e&&(a.isDom&&d.is(":visible"))&&(e=d.find("img:first"),e.length||(e=d));t(e)?(c=e.offset(),e.is("img")&&(f=e.outerWidth(),g=e.outerHeight())):
+(c.top=m.y+(m.h-g)*a.topRatio,c.left=m.x+(m.w-f)*a.leftRatio);if("fixed"===b.wrap.css("position")||a.locked)c.top-=m.y,c.left-=m.x;return c={top:x(c.top-h*a.topRatio),left:x(c.left-j*a.leftRatio),width:x(f+j),height:x(g+h)}},step:function(a,d){var e,c,f=d.prop;c=b.current;var g=c.wrapSpace,h=c.skinSpace;if("width"===f||"height"===f)e=d.end===d.start?1:(a-d.start)/(d.end-d.start),b.isClosing&&(e=1-e),c="width"===f?c.wPadding:c.hPadding,c=a-c,b.skin[f](l("width"===f?c:c-g*e)),b.inner[f](l("width"===
+f?c:c-g*e-h*e))},zoomIn:function(){var a=b.current,d=a.pos,e=a.openEffect,c="elastic"===e,k=f.extend({opacity:1},d);delete k.position;c?(d=this.getOrigPosition(),a.openOpacity&&(d.opacity=0.1)):"fade"===e&&(d.opacity=0.1);b.wrap.css(d).animate(k,{duration:"none"===e?0:a.openSpeed,easing:a.openEasing,step:c?this.step:null,complete:b._afterZoomIn})},zoomOut:function(){var a=b.current,d=a.closeEffect,e="elastic"===d,c={opacity:0.1};e&&(c=this.getOrigPosition(),a.closeOpacity&&(c.opacity=0.1));b.wrap.animate(c,
+{duration:"none"===d?0:a.closeSpeed,easing:a.closeEasing,step:e?this.step:null,complete:b._afterZoomOut})},changeIn:function(){var a=b.current,d=a.nextEffect,e=a.pos,c={opacity:1},f=b.direction,g;e.opacity=0.1;"elastic"===d&&(g="down"===f||"up"===f?"top":"left","down"===f||"right"===f?(e[g]=x(l(e[g])-200),c[g]="+=200px"):(e[g]=x(l(e[g])+200),c[g]="-=200px"));"none"===d?b._afterZoomIn():b.wrap.css(e).animate(c,{duration:a.nextSpeed,easing:a.nextEasing,complete:b._afterZoomIn})},changeOut:function(){var a=
+b.previous,d=a.prevEffect,e={opacity:0.1},c=b.direction;"elastic"===d&&(e["down"===c||"up"===c?"top":"left"]=("up"===c||"left"===c?"-":"+")+"=200px");a.wrap.animate(e,{duration:"none"===d?0:a.prevSpeed,easing:a.prevEasing,complete:function(){f(this).trigger("onReset").remove()}})}};b.helpers.overlay={defaults:{closeClick:!0,speedOut:200,showEarly:!0,css:{},locked:!s,fixed:!0},overlay:null,fixed:!1,create:function(a){a=f.extend({},this.defaults,a);this.overlay&&this.close();this.overlay=f('<div class="fancybox-overlay"></div>').appendTo("body");
+this.fixed=!1;a.fixed&&b.defaults.fixed&&(this.overlay.addClass("fancybox-overlay-fixed"),this.fixed=!0)},open:function(a){var d=this;a=f.extend({},this.defaults,a);this.overlay?this.overlay.unbind(".overlay").width("auto").height("auto"):this.create(a);this.fixed||(q.bind("resize.overlay",f.proxy(this.update,this)),this.update());a.closeClick&&this.overlay.bind("click.overlay",function(a){f(a.target).hasClass("fancybox-overlay")&&(b.isActive?b.close():d.close())});this.overlay.css(a.css).show()},
+close:function(){f(".fancybox-overlay").remove();q.unbind("resize.overlay");this.overlay=null;!1!==this.margin&&(f("body").css("margin-right",this.margin),this.margin=!1);this.el&&this.el.removeClass("fancybox-lock")},update:function(){var a="100%",b;this.overlay.width(a).height("100%");H?(b=Math.max(z.documentElement.offsetWidth,z.body.offsetWidth),n.width()>b&&(a=n.width())):n.width()>q.width()&&(a=n.width());this.overlay.width(a).height(n.height())},onReady:function(a,b){f(".fancybox-overlay").stop(!0,
+!0);this.overlay||(this.margin=n.height()>q.height()||"scroll"===f("body").css("overflow-y")?f("body").css("margin-right"):!1,this.el=z.all&&!z.querySelector?f("html"):f("body"),this.create(a));a.locked&&this.fixed&&(b.locked=this.overlay.append(b.wrap),b.fixed=!1);!0===a.showEarly&&this.beforeShow.apply(this,arguments)},beforeShow:function(a,b){b.locked&&(this.el.addClass("fancybox-lock"),!1!==this.margin&&f("body").css("margin-right",l(this.margin)+b.scrollbarWidth));this.open(a)},onUpdate:function(){this.fixed||
+this.update()},afterClose:function(a){this.overlay&&!b.isActive&&this.overlay.fadeOut(a.speedOut,f.proxy(this.close,this))}};b.helpers.title={defaults:{type:"float",position:"bottom"},beforeShow:function(a){var d=b.current,e=d.title,c=a.type;f.isFunction(e)&&(e=e.call(d.element,d));if(p(e)&&""!==f.trim(e)){d=f('<div class="fancybox-title fancybox-title-'+c+'-wrap">'+e+"</div>");switch(c){case "inside":c=b.skin;break;case "outside":c=b.wrap;break;case "over":c=b.inner;break;default:c=b.skin,d.appendTo("body"),
+H&&d.width(d.width()),d.wrapInner('<span class="child"></span>'),b.current.margin[2]+=Math.abs(l(d.css("margin-bottom")))}d["top"===a.position?"prependTo":"appendTo"](c)}}};f.fn.fancybox=function(a){var d,e=f(this),c=this.selector||"",k=function(g){var h=f(this).blur(),j=d,k,l;!g.ctrlKey&&(!g.altKey&&!g.shiftKey&&!g.metaKey)&&!h.is(".fancybox-wrap")&&(k=a.groupAttr||"data-fancybox-group",l=h.attr(k),l||(k="rel",l=h.get(0)[k]),l&&(""!==l&&"nofollow"!==l)&&(h=c.length?f(c):e,h=h.filter("["+k+'="'+l+
+'"]'),j=h.index(this)),a.index=j,!1!==b.open(h,a)&&g.preventDefault())};a=a||{};d=a.index||0;!c||!1===a.live?e.unbind("click.fb-start").bind("click.fb-start",k):n.undelegate(c,"click.fb-start").delegate(c+":not('.fancybox-item, .fancybox-nav')","click.fb-start",k);this.filter("[data-fancybox-start=1]").trigger("click");return this};n.ready(function(){f.scrollbarWidth===r&&(f.scrollbarWidth=function(){var a=f('<div style="width:50px;height:50px;overflow:auto"><div/></div>').appendTo("body"),b=a.children(),
+b=b.innerWidth()-b.height(99).innerWidth();a.remove();return b});if(f.support.fixedPosition===r){var a=f.support,d=f('<div style="position:fixed;top:20px;"></div>').appendTo("body"),e=20===d[0].offsetTop||15===d[0].offsetTop;d.remove();a.fixedPosition=e}f.extend(b.defaults,{scrollbarWidth:f.scrollbarWidth(),fixed:f.support.fixedPosition,parent:f("body")})})})(window,document,jQuery);
View
117 public/javascripts/vendor/jquery.mousewheel.js
@@ -0,0 +1,117 @@
+/*! Copyright (c) 2013 Brandon Aaron (http://brandonaaron.net)
+ * Licensed under the MIT License (LICENSE.txt).
+ *
+ * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
+ * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
+ * Thanks to: Seamus Leahy for adding deltaX and deltaY
+ *
+ * Version: 3.1.3
+ *
+ * Requires: 1.2.2+
+ */
+
+(function (factory) {
+ if ( typeof define === 'function' && define.amd ) {
+ // AMD. Register as an anonymous module.
+ define(['jquery'], factory);
+ } else if (typeof exports === 'object') {
+ // Node/CommonJS style for Browserify
+ module.exports = factory;
+ } else {
+ // Browser globals
+ factory(jQuery);
+ }
+}(function ($) {
+
+ var toFix = ['wheel', 'mousewheel', 'DOMMouseScroll', 'MozMousePixelScroll'];
+ var toBind = 'onwheel' in document || document.documentMode >= 9 ? ['wheel'] : ['mousewheel', 'DomMouseScroll', 'MozMousePixelScroll'];
+ var lowestDelta, lowestDeltaXY;
+
+ if ( $.event.fixHooks ) {
+ for ( var i = toFix.length; i; ) {
+ $.event.fixHooks[ toFix[--i] ] = $.event.mouseHooks;
+ }
+ }
+
+ $.event.special.mousewheel = {
+ setup: function() {
+ if ( this.addEventListener ) {
+ for ( var i = toBind.length; i; ) {
+ this.addEventListener( toBind[--i], handler, false );
+ }
+ } else {
+ this.onmousewheel = handler;
+ }
+ },
+
+ teardown: function() {
+ if ( this.removeEventListener ) {
+ for ( var i = toBind.length; i; ) {
+ this.removeEventListener( toBind[--i], handler, false );
+ }
+ } else {
+ this.onmousewheel = null;
+ }
+ }
+ };
+
+ $.fn.extend({
+ mousewheel: function(fn) {
+ return fn ? this.bind("mousewheel", fn) : this.trigger("mousewheel");
+ },
+
+ unmousewheel: function(fn) {
+ return this.unbind("mousewheel", fn);
+ }
+ });
+
+
+ function handler(event) {
+ var orgEvent = event || window.event,
+ args = [].slice.call(arguments, 1),
+ delta = 0,
+ deltaX = 0,
+ deltaY = 0,
+ absDelta = 0,
+ absDeltaXY = 0,
+ fn;
+ event = $.event.fix(orgEvent);
+ event.type = "mousewheel";
+
+ // Old school scrollwheel delta
+ if ( orgEvent.wheelDelta ) { delta = orgEvent.wheelDelta; }
+ if ( orgEvent.detail ) { delta = orgEvent.detail * -1; }
+
+ // New school wheel delta (wheel event)
+ if ( orgEvent.deltaY ) {
+ deltaY = orgEvent.deltaY * -1;
+ delta = deltaY;
+ }
+ if ( orgEvent.deltaX ) {
+ deltaX = orgEvent.deltaX;
+ delta = deltaX * -1;
+ }
+
+ // Webkit
+ if ( orgEvent.wheelDeltaY !== undefined ) { deltaY = orgEvent.wheelDeltaY; }
+ if ( orgEvent.wheelDeltaX !== undefined ) { deltaX = orgEvent.wheelDeltaX * -1; }
+
+ // Look for lowest delta to normalize the delta values
+ absDelta = Math.abs(delta);
+ if ( !lowestDelta || absDelta < lowestDelta ) { lowestDelta = absDelta; }
+ absDeltaXY = Math.max(Math.abs(deltaY), Math.abs(deltaX));
+ if ( !lowestDeltaXY || absDeltaXY < lowestDeltaXY ) { lowestDeltaXY = absDeltaXY; }
+
+ // Get a whole value for the deltas
+ fn = delta > 0 ? 'floor' : 'ceil';
+ delta = Math[fn](delta / lowestDelta);
+ deltaX = Math[fn](deltaX / lowestDeltaXY);
+ deltaY = Math[fn](deltaY / lowestDeltaXY);
+
+ // Add event and delta to the front of the arguments
+ args.unshift(event, delta, deltaX, deltaY);
+
+ return ($.event.dispatch || $.event.handle).apply(this, args);
+ }
+
+}));
View
301 public/javascripts/vendor/jquerypp.custom.js
@@ -1,301 +0,0 @@
-(function() {
-
- var event = jQuery.event,
-
- //helper that finds handlers by type and calls back a function, this is basically handle
- // events - the events object
- // types - an array of event types to look for
- // callback(type, handlerFunc, selector) - a callback
- // selector - an optional selector to filter with, if there, matches by selector
- // if null, matches anything, otherwise, matches with no selector
- findHelper = function( events, types, callback, selector ) {
- var t, type, typeHandlers, all, h, handle,
- namespaces, namespace,
- match;
- for ( t = 0; t < types.length; t++ ) {
- type = types[t];
- all = type.indexOf(".") < 0;
- if (!all ) {
- namespaces = type.split(".");
- type = namespaces.shift();
- namespace = new RegExp("(^|\\.)" + namespaces.slice(0).sort().join("\\.(?:.*\\.)?") + "(\\.|$)");
- }
- typeHandlers = (events[type] || []).slice(0);
-
- for ( h = 0; h < typeHandlers.length; h++ ) {
- handle = typeHandlers[h];
-
- match = (all || namespace.test(handle.namespace));
-
- if(match){
- if(selector){
- if (handle.selector === selector ) {
- callback(type, handle.origHandler || handle.handler);
- }
- } else if (selector === null){
- callback(type, handle.origHandler || handle.handler, handle.selector);
- }
- else if (!handle.selector ) {
- callback(type, handle.origHandler || handle.handler);
-
- }
- }
-
-
- }
- }
- };
-
- /**
- * Finds event handlers of a given type on an element.
- * @param {HTMLElement} el
- * @param {Array} types an array of event names
- * @param {String} [selector] optional selector
- * @return {Array} an array of event handlers
- */
- event.find = function( el, types, selector ) {
- var events = ( $._data(el) || {} ).events,
- handlers = [],
- t, liver, live;
-
- if (!events ) {
- return handlers;
- }
- findHelper(events, types, function( type, handler ) {
- handlers.push(handler);
- }, selector);
- return handlers;
- };
- /**
- * Finds all events. Group by selector.
- * @param {HTMLElement} el the element
- * @param {Array} types event types
- */
- event.findBySelector = function( el, types ) {
- var events = $._data(el).events,
- selectors = {},
- //adds a handler for a given selector and event
- add = function( selector, event, handler ) {
- var select = selectors[selector] || (selectors[selector] = {}),
- events = select[event] || (select[event] = []);
- events.push(handler);
- };
-
- if (!events ) {
- return selectors;
- }
- //first check live:
- /*$.each(events.live || [], function( i, live ) {
- if ( $.inArray(live.origType, types) !== -1 ) {
- add(live.selector, live.origType, live.origHandler || live.handler);
- }
- });*/
- //then check straight binds
- findHelper(events, types, function( type, handler, selector ) {
- add(selector || "", type, handler);
- }, null);
-
- return selectors;
- };
- event.supportTouch = "ontouchend" in document;
-
- $.fn.respondsTo = function( events ) {
- if (!this.length ) {
- return false;
- } else {
- //add default ?
- return event.find(this[0], $.isArray(events) ? events : [events]).length > 0;
- }
- };
- $.fn.triggerHandled = function( event, data ) {
- event = (typeof event == "string" ? $.Event(event) : event);
- this.trigger(event, data);
- return event.handled;
- };
- /**
- * Only attaches one event handler for all types ...
- * @param {Array} types llist of types that will delegate here
- * @param {Object} startingEvent the first event to start listening to
- * @param {Object} onFirst a function to call
- */
- event.setupHelper = function( types, startingEvent, onFirst ) {
- if (!onFirst ) {
- onFirst = startingEvent;
- startingEvent = null;
- }
- var add = function( handleObj ) {
-
- var bySelector, selector = handleObj.selector || "";
- if ( selector ) {
- bySelector = event.find(this, types, selector);
- if (!bySelector.length ) {
- $(this).delegate(selector, startingEvent, onFirst);
- }
- }
- else {
- //var bySelector = event.find(this, types, selector);
- if (!event.find(this, types, selector).length ) {
- event.add(this, startingEvent, onFirst, {
- selector: selector,
- delegate: this
- });
- }
-
- }
-
- },
- remove = function( handleObj ) {
- var bySelector, selector = handleObj.selector || "";
- if ( selector ) {
- bySelector = event.find(this, types, selector);
- if (!bySelector.length ) {
- $(this).undelegate(selector, startingEvent, onFirst);
- }
- }
- else {
- if (!event.find(this, types, selector).length ) {
- event.remove(this, startingEvent, onFirst, {
- selector: selector,
- delegate: this
- });
- }
- }
- };
- $.each(types, function() {
- event.special[this] = {
- add: add,
- remove: remove,
- setup: function() {},
- teardown: function() {}
- };
- });
- };
-})(jQuery);
-(function($){
-var isPhantom = /Phantom/.test(navigator.userAgent),
- supportTouch = !isPhantom && "ontouchend" in document,
- scrollEvent = "touchmove scroll",
- // Use touch events or map it to mouse events
- touchStartEvent = supportTouch ? "touchstart" : "mousedown",
- touchStopEvent = supportTouch ? "touchend" : "mouseup",
- touchMoveEvent = supportTouch ? "touchmove" : "mousemove",
- data = function(event){
- var d = event.originalEvent.touches ?
- event.originalEvent.touches[ 0 ] :
- event;
- return {
- time: (new Date).getTime(),
- coords: [ d.pageX, d.pageY ],
- origin: $( event.target )
- };
- };
-
-/**
- * @add jQuery.event.swipe
- */
-var swipe = $.event.swipe = {
- /**
- * @attribute delay
- * Delay is the upper limit of time the swipe motion can take in milliseconds. This defaults to 500.
- *
- * A user must perform the swipe motion in this much time.
- */
- delay : 500,
- /**
- * @attribute max
- * The maximum distance the pointer must travel in pixels. The default is 75 pixels.
- */
- max : 75,
- /**
- * @attribute min
- * The minimum distance the pointer must travel in pixels. The default is 30 pixels.
- */
- min : 30
-};
-
-$.event.setupHelper( [
-
-/**
- * @hide
- * @attribute swipe
- */
-"swipe",
-/**
- * @hide
- * @attribute swipeleft
- */
-'swipeleft',
-/**
- * @hide
- * @attribute swiperight
- */
-'swiperight',
-/**
- * @hide
- * @attribute swipeup
- */
-'swipeup',
-/**
- * @hide
- * @attribute swipedown
- */
-'swipedown'], touchStartEvent, function(ev){
- var
- // update with data when the event was started
- start = data(ev),
- stop,
- delegate = ev.delegateTarget || ev.currentTarget,
- selector = ev.handleObj.selector,
- entered = this;
-
- function moveHandler(event){
- if ( !start ) {
- return;
- }
- // update stop with the data from the current event
- stop = data(event);
-
- // prevent scrolling
- if ( Math.abs( start.coords[0] - stop.coords[0] ) > 10 ) {
- event.preventDefault();
- }
- };
-
- // Attach to the touch move events
- $(document.documentElement).bind(touchMoveEvent, moveHandler)
- .one(touchStopEvent, function(event){
- $(this).unbind( touchMoveEvent, moveHandler);
- // if start and stop contain data figure out if we have a swipe event
- if ( start && stop ) {
- // calculate the distance between start and stop data
- var deltaX = Math.abs(start.coords[0] - stop.coords[0]),
- deltaY = Math.abs(start.coords[1] - stop.coords[1]),
- distance = Math.sqrt(deltaX*deltaX+deltaY*deltaY);
-
- // check if the delay and distance are matched
- if ( stop.time - start.time < swipe.delay && distance >= swipe.min ) {
- var events = ['swipe'];
- // check if we moved horizontally
- if( deltaX >= swipe.min && deltaY < swipe.min) {
- // based on the x coordinate check if we moved left or right
- events.push( start.coords[0] > stop.coords[0] ? "swipeleft" : "swiperight" );
- } else
- // check if we moved vertically
- if(deltaY >= swipe.min && deltaX < swipe.min){
- // based on the y coordinate check if we moved up or down
- events.push( start.coords[1] < stop.coords[1] ? "swipedown" : "swipeup" );
- }
-
- // trigger swipe events on this guy
- $.each($.event.find(delegate, events, selector), function(){
- this.call(entered, ev, {start : start, end: stop})
- })
-
- }
- }
- // reset start and stop
- start = stop = undefined;
- })
-});
-
-})(jQuery)
View
71 views/index.haml
@@ -1,67 +1,44 @@
-
-
.row
.large-8.columns
- =# @pictures.count
- -#%ul{"data-options" => "timer_speed:2500;", "data-orbit" => ""}
+ %ul.small-block-grid-4.large-block-grid-6
- @pictures.each do |key|
%li
- %img{:src => "#{key.image.thumb('600x600').url}"}/
- .orbit-caption "Taken on #{key.image_date} with #{key.image_model} (#{key.id})"
-
- -#%ul.small-block-grid-2.large-block-grid-4
- - @pictures.each do |key|
- %li
- %a{:href => "#{key.image.thumb('800x800').url}"}
- %img{:src => "#{key.image.thumb('200x200#').url}", :alt => "#{key.image_name}"}
+ %a{:href => "#{key.image.thumb('800x800').url}", :class => 'fancybox', 'data-fancybox-group' => 'button', :title => "#{key.image_title}"}
+ %img{:src => "#{key.image.thumb('100x100#').url}"}
-if admin?
%form(action="/delete/#{key.id}" method="post")
%input{:type => :hidden, :name => "_method", :value => "delete"}
%a.tiny.button.info.radius{:href => "/i/#{key.id}"} Show
%input.tiny.button.alert.radius{:type => "submit", :value => "Delete"}
- .gallery
- %ul#carousel.elastislide-list
- - @pictures.each do |key|
- %li{'data-preview' => "#{key.image.thumb('800x800').url}"}
- %a{:href => '#'}
- %img{:src => "#{key.image.thumb('100x100#').url}", :alt => "#{key.image_name}"}
-
- .image-preview
- %img#preview{:src => '#'}
= haml :sidebar
--#%script{:type => "text/javascript", :src => "/javascripts/vendor/modernizr.all.js"}
--#%script{:type => "text/javascript", :src => "/javascripts/vendor/modernizr.custom.17475.js"}
-%script{:type => "text/javascript", :src => "/javascripts/vendor/jquerypp.custom.js"}
-%script{:type => "text/javascript", :src => "/javascripts/vendor/jquery.elastislide.js"}
+%script{:type => "text/javascript", :src => "/javascripts/vendor/jquery.mousewheel.js"}
+%script{:type => "text/javascript", :src => "/javascripts/vendor/jquery.fancybox.pack.js"}
:javascript
- var current = 0,
- $preview = $( '#preview' ),
- $carouselEl = $( '#carousel' ),
- $carouselItems = $carouselEl.children(),
- carousel = $carouselEl.elastislide( {
- current : current,
- minItems : 4,
- onClick : function( el, pos, evt ) {
+ $(document).ready(function() {
- changeImage( el, pos );
- evt.preventDefault();
+ $('.fancybox').fancybox({
+ openEffect: 'none',
+ closeEffect: 'none',
- },
- onReady : function() {
+ prevEffect: 'none',
+ nextEffect: 'none',
- changeImage( $carouselItems.eq( current ), current );
-
- }
- } );
+ //autoPlay: true,
+ loop: false,
- function changeImage( el, pos ) {
+ //closeBtn : false,
- $preview.attr( 'src', el.data( 'preview' ) ).hide().fadeIn('slow');
- $carouselItems.removeClass( 'current-img' );
- el.addClass( 'current-img' );
- carousel.setCurrent( pos );
+ helpers: {
+ title: {
+ type: 'inside'
+ }
+ },
- }
+ afterLoad : function() {
+ this.title = 'Bild ' + (this.index + 1) + ' von ' + this.group.length + (this.title ? ' - ' + this.title : '');
+ }
+ });
+ });
View
9 views/layout.haml
@@ -15,10 +15,10 @@
%link{:href => asset_stylesheet('normalize'), :rel => "stylesheet"}
%link{:href => asset_stylesheet('app'), :rel => "stylesheet"}
%link{:href => asset_stylesheet('font-awesome'), :rel => "stylesheet"}
- %link{:href => '/elastislide.css', :rel => "stylesheet"}
+ %link{:href => asset_stylesheet('fancybox'), :rel => "stylesheet"}
- %script{:src => "/javascripts/vendor/jquery.min.js"}
- %script{:src => "/javascripts/vendor/modernizr.custom.js"}
+ %script{:src => "/javascripts/vendor/jquery.min.js", :type => 'text/javascript'}
+ %script{:src => "/javascripts/vendor/modernizr.custom.js", :type => 'text/javascript'}
%script{:src => asset_javascript('app'), :type => 'text/javascript'}
/:javascript
/ document.write('<script src=' +
@@ -31,7 +31,8 @@
.row
.large-12.columns
= haml :top_nav
- = haml :notification
+ #flash_notice
+ = haml :notification
=yield
View
11 views/notification.haml
@@ -1,6 +1,5 @@
-#flash_notice
- - %w[alert success notice].each do |key|
- - if flash[key]
- %div{:class => "alert-box #{key}", "data-alert" => ""}
- = flash[key]
- %a.close{:href => "#"} &times;
+- %w[alert success notice].each do |key|
+ - if flash[key]
+ %div{:class => "alert-box #{key}", "data-alert" => ""}
+ = flash[key]
+ %a.close{:href => "#"} &times;
View
5 views/sass/app.scss
@@ -45,8 +45,3 @@
// @import "foundation/components/thumbs";
// @import "foundation/components/tooltips";
// @import "foundation/components/dropdown";
-
-//.bar {
-// height: 18px;
-// background: green;
-//}
View
275 views/sass/fancybox.scss
@@ -0,0 +1,275 @@
+/*! fancyBox v2.1.4 fancyapps.com | fancyapps.com/fancybox/#license */
+
+$assetPath : "/image";
+
+.fancybox-wrap, .fancybox-skin, .fancybox-outer, .fancybox-inner, .fancybox-image {
+ padding: 0;
+ margin: 0;
+ border: 0;
+ outline: none;
+ vertical-align: top;
+}
+
+.fancybox-wrap {
+ iframe, object {
+ padding: 0;
+ margin: 0;
+ border: 0;
+ outline: none;
+ vertical-align: top;
+ }
+}
+
+.fancybox-nav {
+ padding: 0;
+ margin: 0;
+ border: 0;
+ outline: none;
+ vertical-align: top;
+ span {
+ padding: 0;
+ margin: 0;
+ border: 0;
+ outline: none;
+ vertical-align: top;
+ }
+}
+
+.fancybox-tmp {
+ padding: 0;
+ margin: 0;
+ border: 0;
+ outline: none;
+ vertical-align: top;
+}
+
+.fancybox-wrap {
+ position: absolute;
+ top: 0;
+ left: 0;
+ z-index: 8020;
+}
+
+.fancybox-skin {
+ position: relative;
+ background: #f9f9f9;
+ color: #444;
+ text-shadow: none;
+ -webkit-border-radius: 4px;
+ -moz-border-radius: 4px;
+ border-radius: 4px;
+}
+
+.fancybox-opened {
+ z-index: 8030;
+ .fancybox-skin {
+ -webkit-box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
+ -moz-box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
+ box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
+ }
+}
+
+.fancybox-outer {
+ position: relative;
+}
+
+.fancybox-inner {
+ position: relative;
+ overflow: hidden;
+}
+
+.fancybox-type-iframe .fancybox-inner {
+ -webkit-overflow-scrolling: touch;
+}
+
+.fancybox-error {
+ color: #444;
+ font: 14px / 20px "Helvetica Neue", Helvetica, Arial, sans-serif;
+ margin: 0;
+ padding: 15px;
+ white-space: nowrap;
+}
+
+.fancybox-image, .fancybox-iframe {
+ display: block;
+ width: 100%;
+ height: 100%;
+}
+
+.fancybox-image {
+ max-width: 100%;
+ max-height: 100%;
+}
+
+#fancybox-loading, .fancybox-close, .fancybox-prev span, .fancybox-next span {
+ background-image: url('#{$assetPath}/fancybox_sprite.png');
+}
+
+#fancybox-loading {
+ position: fixed;
+ top: 50%;
+ left: 50%;
+ margin-top: -22px;
+ margin-left: -22px;
+ background-position: 0 -108px;
+ opacity: 0.8;
+ cursor: pointer;
+ z-index: 8060;
+ div {
+ width: 44px;
+ height: 44px;
+ background: url('#{$assetPath}/fancybox_loading.gif') center center no-repeat;
+ }
+}
+
+.fancybox-close {
+ position: absolute;
+ top: -18px;
+ right: -18px;
+ width: 36px;
+ height: 36px;
+ cursor: pointer;
+ z-index: 8040;
+}
+
+.fancybox-nav {
+ position: absolute;
+ top: 0;
+ width: 40%;
+ height: 100%;
+ cursor: pointer;
+ text-decoration: none;
+ background: transparent url('#{$assetPath}/blank.gif');
+ /* helps IE */
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
+ z-index: 8040;
+}
+
+.fancybox-prev {
+ left: 0;
+}
+
+.fancybox-next {
+ right: 0;
+}
+
+.fancybox-nav span {
+ position: absolute;
+ top: 50%;
+ width: 36px;
+ height: 34px;
+ margin-top: -18px;
+ cursor: pointer;
+ z-index: 8040;
+ visibility: hidden;
+}
+
+.fancybox-prev span {
+ left: 10px;
+ background-position: 0 -36px;
+}
+
+.fancybox-next span {
+ right: 10px;
+ background-position: 0 -72px;
+}
+
+.fancybox-nav:hover span {
+ visibility: visible;
+}
+
+.fancybox-tmp {
+ position: absolute;
+ top: -99999px;
+ left: -99999px;
+ visibility: hidden;
+ max-width: 99999px;
+ max-height: 99999px;
+ overflow: visible !important;
+}
+
+/* Overlay helper */
+
+.fancybox-lock {
+ overflow: hidden;
+}
+
+.fancybox-overlay {
+ position: absolute;
+ top: 0;
+ left: 0;