refinerycms-6hoursdaily-photo-gallery 0.0.4.dev
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +27 -0
- data/LICENSE.md +8 -0
- data/README.md +224 -0
- data/app/assets/images/refinery/photo_gallery/admin/chosen-sprite.png +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/icons/album.png +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/icons/album_add.png +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/icons/album_edit.png +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/icons/cog.png +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/icons/down.gif +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/icons/folder.png +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/icons/folder_add.png +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/icons/folder_edit.png +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/icons/loading.gif +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/icons/page_copy.png +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/icons/photo.png +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/icons/photo_add.png +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/icons/photo_edit.png +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/icons/up.gif +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/plupload/jquery.plupload.queue/backgrounds.gif +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/plupload/jquery.plupload.queue/buttons-disabled.png +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/plupload/jquery.plupload.queue/buttons.png +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/plupload/jquery.plupload.queue/delete.gif +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/plupload/jquery.plupload.queue/done.gif +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/plupload/jquery.plupload.queue/error.gif +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/plupload/jquery.plupload.queue/throbber.gif +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/plupload/jquery.plupload.queue/transp50.png +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/plupload/jquery.ui.plupload/plupload-bw.png +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/plupload/jquery.ui.plupload/plupload.png +0 -0
- data/app/assets/images/refinery/photo_gallery/admin/rss-feed.png +0 -0
- data/app/assets/images/refinery/photo_gallery/fancybox/blank.gif +0 -0
- data/app/assets/images/refinery/photo_gallery/fancybox/fancybox_loading.gif +0 -0
- data/app/assets/images/refinery/photo_gallery/fancybox/fancybox_sprite.png +0 -0
- data/app/assets/images/refinery/photo_gallery/fancybox/helpers/fancybox_buttons.png +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/jquery.chosen.min.js +10 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/photo_gallery.js +28 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/changelog.txt +218 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/cs.js +14 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/da.js +12 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/de.js +24 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/el.js +14 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/es.js +25 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/et.js +33 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/fi.js +33 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/fr-ca.js +35 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/fr.js +25 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/hr.js +25 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/hu.js +33 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/it.js +24 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/ja.js +37 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/ko.js +36 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/lv.js +33 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/nl.js +21 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/pl.js +24 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/pt-br.js +35 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/ro.js +24 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/ru.js +21 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/sk.js +37 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/sr.js +14 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/i18n/sv.js +12 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/jquery.plupload.queue.js +195 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/jquery.ui.plupload.js +383 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/license.txt +339 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.browserplus.js +1 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.flash.js +226 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.flash.swf +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.full.js +2525 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.full.js.default +2525 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.gears.js +1 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.html4.js +1 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.html5.js +765 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.html5.js.default +765 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.js +618 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.silverlight.js +1 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/plupload.silverlight.xap +0 -0
- data/app/assets/javascripts/refinery/photo_gallery/admin/plupload/readme.md +46 -0
- data/app/assets/javascripts/refinery/photo_gallery/fancybox/CHANGELOG.md +68 -0
- data/app/assets/javascripts/refinery/photo_gallery/fancybox/README.md +212 -0
- data/app/assets/javascripts/refinery/photo_gallery/fancybox/helpers/jquery.fancybox-buttons.js +115 -0
- data/app/assets/javascripts/refinery/photo_gallery/fancybox/helpers/jquery.fancybox-media.js +85 -0
- data/app/assets/javascripts/refinery/photo_gallery/fancybox/helpers/jquery.fancybox-thumbs.js +157 -0
- data/app/assets/javascripts/refinery/photo_gallery/fancybox/jquery.fancybox.js +1463 -0
- data/app/assets/javascripts/refinery/photo_gallery/fancybox/jquery.fancybox.pack.js +35 -0
- data/app/assets/javascripts/refinery/photo_gallery/fancybox/lib/jquery.mousewheel-3.0.6.pack.js +13 -0
- data/app/assets/stylesheets/refinery/photo_gallery/admin/chosen.css.scss +396 -0
- data/app/assets/stylesheets/refinery/photo_gallery/admin/photo_gallery.css.scss +109 -0
- data/app/assets/stylesheets/refinery/photo_gallery/admin/plupload/jquery.plupload.queue.css.scss +177 -0
- data/app/assets/stylesheets/refinery/photo_gallery/admin/plupload/jquery.ui.plupload.css.scss +147 -0
- data/app/assets/stylesheets/refinery/photo_gallery/fancybox/helpers/jquery.fancybox-buttons.css.scss +85 -0
- data/app/assets/stylesheets/refinery/photo_gallery/fancybox/helpers/jquery.fancybox-thumbs.css +54 -0
- data/app/assets/stylesheets/refinery/photo_gallery/fancybox/jquery.fancybox.css.scss +234 -0
- data/app/controllers/refinery/photo_gallery/admin/albums_controller.rb +23 -0
- data/app/controllers/refinery/photo_gallery/admin/collections_controller.rb +10 -0
- data/app/controllers/refinery/photo_gallery/admin/photos_controller.rb +67 -0
- data/app/controllers/refinery/photo_gallery/albums_controller.rb +23 -0
- data/app/controllers/refinery/photo_gallery/collections_controller.rb +28 -0
- data/app/helpers/refinery/photo_gallery/admin/photos_helper.rb +10 -0
- data/app/helpers/refinery/photo_gallery/albums_helper.rb +11 -0
- data/app/helpers/refinery/photo_gallery/photo_gallery_helper.rb +113 -0
- data/app/middleware/refinery/photo_gallery/admin/flash_session_cookie_middleware.rb +27 -0
- data/app/models/refinery/photo_gallery/album.rb +63 -0
- data/app/models/refinery/photo_gallery/collection.rb +29 -0
- data/app/models/refinery/photo_gallery/collection_album.rb +8 -0
- data/app/models/refinery/photo_gallery/photo.rb +63 -0
- data/app/uploaders/refinery/photo_gallery/admin/file_uploader.rb +122 -0
- data/app/views/refinery/photo_gallery/admin/_submenu.html.erb +44 -0
- data/app/views/refinery/photo_gallery/admin/albums/_album.html.erb +31 -0
- data/app/views/refinery/photo_gallery/admin/albums/_form.html.erb +78 -0
- data/app/views/refinery/photo_gallery/admin/albums/_sortable_list.html.erb +7 -0
- data/app/views/refinery/photo_gallery/admin/albums/edit.html.erb +2 -0
- data/app/views/refinery/photo_gallery/admin/albums/index.html.erb +28 -0
- data/app/views/refinery/photo_gallery/admin/albums/new.html.erb +2 -0
- data/app/views/refinery/photo_gallery/admin/collections/_collection.html.erb +23 -0
- data/app/views/refinery/photo_gallery/admin/collections/_form.html.erb +32 -0
- data/app/views/refinery/photo_gallery/admin/collections/_sortable_list.html.erb +7 -0
- data/app/views/refinery/photo_gallery/admin/collections/edit.html.erb +2 -0
- data/app/views/refinery/photo_gallery/admin/collections/index.html.erb +28 -0
- data/app/views/refinery/photo_gallery/admin/collections/new.html.erb +2 -0
- data/app/views/refinery/photo_gallery/admin/collections/test.html.erb +39 -0
- data/app/views/refinery/photo_gallery/admin/photos/_destroy.js.erb +15 -0
- data/app/views/refinery/photo_gallery/admin/photos/_form.html.erb +7 -0
- data/app/views/refinery/photo_gallery/admin/photos/_form_actions.html.erb +6 -0
- data/app/views/refinery/photo_gallery/admin/photos/_form_fields.html.erb +31 -0
- data/app/views/refinery/photo_gallery/admin/photos/_form_fields_actions.html.erb +15 -0
- data/app/views/refinery/photo_gallery/admin/photos/edit_multiple.html.erb +9 -0
- data/app/views/refinery/photo_gallery/admin/photos/upload.html.erb +87 -0
- data/app/views/refinery/photo_gallery/albums/show.html.erb +49 -0
- data/app/views/refinery/photo_gallery/collections/index.html.erb +13 -0
- data/app/views/refinery/photo_gallery/collections/show.html.erb +33 -0
- data/app/views/refinery/photo_gallery/shared/_layout.html.erb +22 -0
- data/app/views/refinery/photo_gallery/shared/_submenu.html.erb +5 -0
- data/config/initializers/carrierwave.rb +5 -0
- data/config/initializers/form_builder.rb +26 -0
- data/config/initializers/refinery/core.rb +10 -0
- data/config/initializers/s3.rb +11 -0
- data/config/initializers/session_store.rb +10 -0
- data/config/locales/en.yml +95 -0
- data/config/locales/sk.yml +94 -0
- data/config/routes.rb +37 -0
- data/db/migrate/20120804063842_create_albums.rb +18 -0
- data/db/migrate/20120805131321_create_collections.rb +14 -0
- data/db/migrate/20120805131547_create_collection_albums.rb +12 -0
- data/db/migrate/20120805165238_create_photos.rb +19 -0
- data/db/migrate/20120805222125_add_indexes.rb +24 -0
- data/db/seeds.rb +21 -0
- data/lib/generators/refinery/photo_gallery_generator.rb +25 -0
- data/lib/generators/refinery/templates/config/initializers/refinery/photo_gallery.rb.erb +40 -0
- data/lib/refinery/photo_gallery/configuration.rb +33 -0
- data/lib/refinery/photo_gallery/engine.rb +33 -0
- data/lib/refinery/photo_gallery/version.rb +17 -0
- data/lib/refinery/photo_gallery.rb +30 -0
- data/lib/refinerycms-photo-gallery.rb +1 -0
- data/refinerycms-6hoursdaily-photo-gallery.gemspec +38 -0
- data/screenshots/01_collections#index.png +0 -0
- data/screenshots/02_albums#create.png +0 -0
- data/screenshots/03_photos#upload.png +0 -0
- data/screenshots/04_photos#upload- chooser.png +0 -0
- data/screenshots/05_photo#upoad-queue.png +0 -0
- data/screenshots/06_photos#upload-uploading.png +0 -0
- data/screenshots/07_photos#upload-uploading_2.png +0 -0
- data/screenshots/08_photos#edit_multiple.png +0 -0
- data/screenshots/09_albums#index.png +0 -0
- data/screenshots/10_albums_EXIF_reading.png +0 -0
- data/screenshots/11_frontend_show.png +0 -0
- data/screenshots/12_show_photo_using_fancybox.png +0 -0
- metadata +353 -0
@@ -0,0 +1,68 @@
|
|
1
|
+
fancyBox - Changelog
|
2
|
+
=========
|
3
|
+
|
4
|
+
### Version 2.0.6 - April 16, 2012
|
5
|
+
|
6
|
+
* Fixed #188 - keystrokes in contenteditable
|
7
|
+
* Fixed #171 - non-images should not be preloaded
|
8
|
+
* Fixed #158 - 'closeClick: true' breaks gallery navigation
|
9
|
+
* New "media" helper - detects and displays various media types
|
10
|
+
* New option "groupAttr" - name of group selector attribute, default is "data-fancybox-group"
|
11
|
+
* New feature - selector expressions in URLs, see #170
|
12
|
+
* Improved 'overlay' helper to use "position: fixed"
|
13
|
+
* Improved autoSize, fixed wrong height in some cases
|
14
|
+
* Improved centering and iframe scrolling for iOS
|
15
|
+
* Updated markup, new element '.fancybox-skin' is now used for styling
|
16
|
+
|
17
|
+
### Version 2.0.5 - February 21, 2012
|
18
|
+
|
19
|
+
* Fixed #155 - easing for prev/next animations
|
20
|
+
* Fixed #153 - overriding "keys" options
|
21
|
+
* Fixed #147 - IE7 problem with #hash links
|
22
|
+
* Fixed #130 - changing dynamically data-fancybox-group
|
23
|
+
* Fixed #126 - obey minWidth/minHeight
|
24
|
+
* Fixed #118 - placement of loading icon and navigation arrows
|
25
|
+
* Fixed #101 - "index" option not working
|
26
|
+
* Fixed #94 - "orig" option not working
|
27
|
+
* Fixed #80 - does not work on IE6
|
28
|
+
* Fixed #72 - can't set overlay opacity to 0
|
29
|
+
* Fixed #63 - properly set gallery index
|
30
|
+
* New option "autoCenter" - toggles centering on window resize or scroll, disabled for mobile devices by default
|
31
|
+
* New option "autoResize" - toggles responsivity, disabled for mobile devices by default
|
32
|
+
* New option "preload" - number of images to preload
|
33
|
+
* New feature to target mobile/desktop browsers using CSS, see #108
|
34
|
+
* Changed ajax option defaults to "{ dataType: 'html', headers: { 'X-fancyBox': true } }", see #150 and #128
|
35
|
+
* Updated loading icon for IE7, IE8
|
36
|
+
* Calculates height of the iframe if 'autoSize' is set to 'true' and the iframe is on the same domain as the main page
|
37
|
+
|
38
|
+
### Version 2.0.4 - December 12, 2011
|
39
|
+
|
40
|
+
* Fixed #47 - fix overriding properties
|
41
|
+
* New option "position" to thumbnail and button helpers
|
42
|
+
|
43
|
+
|
44
|
+
### Version 2.0.3 - November 29, 2011
|
45
|
+
|
46
|
+
* Fixed #29 - broken elastic transitions
|
47
|
+
|
48
|
+
|
49
|
+
### Version 2.0.2 - November 28, 2011
|
50
|
+
|
51
|
+
* Fixed slidshow
|
52
|
+
* Fixed scrollbar issue when displayed a very tall image
|
53
|
+
* New option "nextClick" - navigate to next gallery item when user clicks the content
|
54
|
+
* New option "modal" - to disable navigation and closing
|
55
|
+
* Add 'metadata' plugin support
|
56
|
+
* Add ability to create groups using 'data-fancybox-group' attribute
|
57
|
+
* Updated manual usage to match earlier releases
|
58
|
+
|
59
|
+
|
60
|
+
### Version 2.0.1 - November 23, 2011
|
61
|
+
|
62
|
+
* Fixed keyboard events inside form elements
|
63
|
+
* Fixed manual usage
|
64
|
+
|
65
|
+
|
66
|
+
### Version 2.0.0 - November 21, 2011
|
67
|
+
|
68
|
+
First release - completely rewritten, many new features and updated graphics.
|
@@ -0,0 +1,212 @@
|
|
1
|
+
fancyBox
|
2
|
+
========
|
3
|
+
|
4
|
+
fancyBox is a tool that offers a nice and elegant way to add zooming functionality for images, html content and multi-media on your webpages.
|
5
|
+
|
6
|
+
More information and examples: http://www.fancyapps.com/fancybox/
|
7
|
+
|
8
|
+
License: http://www.fancyapps.com/fancybox/#license
|
9
|
+
|
10
|
+
Copyright (c) 2012 Janis Skarnelis - janis@fancyapps.com
|
11
|
+
|
12
|
+
|
13
|
+
How to use
|
14
|
+
----------
|
15
|
+
|
16
|
+
To get started, download the plugin, unzip it and copy files to your website/application directory.
|
17
|
+
Load files in the <head> section of your HTML document. Make sure you also add the jQuery library.
|
18
|
+
|
19
|
+
<head>
|
20
|
+
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>
|
21
|
+
<link rel="stylesheet" href="/fancybox/jquery.fancybox.css" type="text/css" media="screen" />
|
22
|
+
<script type="text/javascript" src="/fancybox/jquery.fancybox.pack.js"></script>
|
23
|
+
</head>
|
24
|
+
|
25
|
+
Create your links with a `title` if you want a title to be shown, and add a class:
|
26
|
+
|
27
|
+
<a href="large_image.jpg" class="fancybox" title="Sample title"><img src="small_image.jpg" /></a>
|
28
|
+
|
29
|
+
If you have a set of related items that you would like to group,
|
30
|
+
additionally include a group name in the `rel` (or `data-fancybox-group`) attribute:
|
31
|
+
|
32
|
+
<a href="large_1.jpg" class="fancybox" rel="gallery" title="Sample title 1"><img src="small_1.jpg" /></a>
|
33
|
+
<a href="large_2.jpg" class="fancybox" rel="gallery" title="Sample title 1"><img src="small_2.jpg" /></a>
|
34
|
+
|
35
|
+
Initialise the script like this:
|
36
|
+
|
37
|
+
<script>
|
38
|
+
$(document).ready(function() {
|
39
|
+
$('.fancybox').fancybox();
|
40
|
+
});
|
41
|
+
</script>
|
42
|
+
|
43
|
+
May also be passed an optional options object which will extend the default values. Example:
|
44
|
+
|
45
|
+
<script>
|
46
|
+
$(document).ready(function() {
|
47
|
+
$('.fancybox').fancybox({
|
48
|
+
padding : 0,
|
49
|
+
openEffect : 'elastic'
|
50
|
+
});
|
51
|
+
});
|
52
|
+
</script>
|
53
|
+
|
54
|
+
Tip: Automatically group and apply fancyBox to all images:
|
55
|
+
|
56
|
+
$("a[href$='.jpg'],a[href$='.jpeg'],a[href$='.png'],a[href$='.gif']").attr('rel', 'gallery').fancybox();
|
57
|
+
|
58
|
+
Script uses the `href` attribute of the matched elements to obtain the location of the content and to figure out content type you want to display.
|
59
|
+
You can specify type directly by adding classname (fancybox.image, fancybox.iframe, etc) or `data-fancybox-group` attribute:
|
60
|
+
|
61
|
+
//Ajax:
|
62
|
+
<a href="/example.html" class="fancybox fancybox.ajax">Example</a>
|
63
|
+
//or
|
64
|
+
<a href="/example.html" class="fancybox" data-fancybox-type="ajax">Example</a>
|
65
|
+
|
66
|
+
//Iframe:
|
67
|
+
<a href="example.html" class="fancybox fancybox.iframe">Example</a>
|
68
|
+
|
69
|
+
//Inline (will display an element with `id="example"`)
|
70
|
+
<a href="#example" class="fancybox">Example</a>
|
71
|
+
|
72
|
+
//SWF:
|
73
|
+
<a href="example.swf" class="fancybox">Example</a>
|
74
|
+
|
75
|
+
//Image:
|
76
|
+
<a href="example.jpg" class="fancybox">Example</a>
|
77
|
+
|
78
|
+
Note, ajax requests are subject to the [same origin policy](http://en.wikipedia.org/wiki/Same_origin_policy).
|
79
|
+
If fancyBox will not be able to get content type, error message will be displayed (this is different from previsous versions where 'ajax' was used as default type).
|
80
|
+
|
81
|
+
Advanced
|
82
|
+
--------
|
83
|
+
|
84
|
+
### Helpers
|
85
|
+
|
86
|
+
Helpers provide a simple mechanism to extend the capabilities of fancyBox. There are two built-in helpers - 'overlay' and 'title'.
|
87
|
+
You can disable them, set custom options or enable other helpers. Examples:
|
88
|
+
|
89
|
+
//Disable title helper
|
90
|
+
$(".fancybox").fancybox({
|
91
|
+
helpers: {
|
92
|
+
title: null
|
93
|
+
}
|
94
|
+
});
|
95
|
+
|
96
|
+
//Disable overlay helper
|
97
|
+
$(".fancybox").fancybox({
|
98
|
+
helpers: {
|
99
|
+
overlay : null
|
100
|
+
}
|
101
|
+
});
|
102
|
+
|
103
|
+
//Change title position and overlay color
|
104
|
+
$(".fancybox").fancybox({
|
105
|
+
helpers: {
|
106
|
+
title : {
|
107
|
+
type : 'inside'
|
108
|
+
},
|
109
|
+
overlay : {
|
110
|
+
css : {
|
111
|
+
'background-color' : '#fff'
|
112
|
+
}
|
113
|
+
}
|
114
|
+
}
|
115
|
+
});
|
116
|
+
|
117
|
+
//Enable thumbnail helper and set custom options
|
118
|
+
$(".fancybox").fancybox({
|
119
|
+
helpers: {
|
120
|
+
thumbs : {
|
121
|
+
width: 50,
|
122
|
+
height: 50
|
123
|
+
}
|
124
|
+
}
|
125
|
+
});
|
126
|
+
|
127
|
+
|
128
|
+
### API
|
129
|
+
|
130
|
+
Also available are event driven callback methods. The `this` keyword refers to the current or upcoming object (depends on callback method). Here is how you can change title:
|
131
|
+
|
132
|
+
$(".fancybox").fancybox({
|
133
|
+
beforeLoad : function() {
|
134
|
+
this.title = 'Image ' + (this.index + 1) + ' of ' + this.group.length + (this.title ? ' - ' + this.title : '');
|
135
|
+
|
136
|
+
/*
|
137
|
+
"this.element" refers to current element, so you can, for example, use the "alt" attribute of the image to store the title:
|
138
|
+
this.title = $(this.element).find('img').attr('alt');
|
139
|
+
*/
|
140
|
+
}
|
141
|
+
});
|
142
|
+
|
143
|
+
It`s possible to open fancyBox programmatically in various ways:
|
144
|
+
|
145
|
+
//HTML content:
|
146
|
+
$.fancybox( '<div><h1>Lorem Lipsum</h1><p>Lorem lipsum</p></div>', {
|
147
|
+
title : 'Custom Title'
|
148
|
+
});
|
149
|
+
|
150
|
+
//DOM element:
|
151
|
+
$.fancybox( $("#inline"), {
|
152
|
+
title : 'Custom Title'
|
153
|
+
});
|
154
|
+
|
155
|
+
//Custom object:
|
156
|
+
$.fancybox({
|
157
|
+
href: 'example.jpg',
|
158
|
+
title : 'Custom Title'
|
159
|
+
});
|
160
|
+
|
161
|
+
//Array of objects:
|
162
|
+
$.fancybox([
|
163
|
+
{
|
164
|
+
href: 'example1.jpg',
|
165
|
+
title : 'Custom Title 1'
|
166
|
+
},
|
167
|
+
{
|
168
|
+
href: 'example2.jpg',
|
169
|
+
title : 'Custom Title 2'
|
170
|
+
}
|
171
|
+
], {
|
172
|
+
padding: 0
|
173
|
+
});
|
174
|
+
|
175
|
+
There are several methods that allow you to interact with and manipulate fancyBox, example:
|
176
|
+
|
177
|
+
//Close fancybox:
|
178
|
+
$.fancybox.close();
|
179
|
+
|
180
|
+
There is a simply way to access wrapping elements using JS:
|
181
|
+
|
182
|
+
$.fancybox.wrap
|
183
|
+
$.fancybox.skin
|
184
|
+
$.fancybox.outer
|
185
|
+
$.fancybox.inner
|
186
|
+
|
187
|
+
You can override CSS to customize the look. For example, make navigation arrows always visible
|
188
|
+
and move them outside of area (use this snippet after including fancybox.css):
|
189
|
+
|
190
|
+
.fancybox-nav span {
|
191
|
+
visibility: visible;
|
192
|
+
}
|
193
|
+
|
194
|
+
.fancybox-prev {
|
195
|
+
left: -80px;
|
196
|
+
}
|
197
|
+
|
198
|
+
.fancybox-next {
|
199
|
+
right: -80px;
|
200
|
+
}
|
201
|
+
|
202
|
+
In that case, you might want to increase space around box:
|
203
|
+
|
204
|
+
$(".fancybox").fancybox({
|
205
|
+
margin : [20, 60, 20, 60]
|
206
|
+
});
|
207
|
+
|
208
|
+
|
209
|
+
Bug tracker
|
210
|
+
-----------
|
211
|
+
|
212
|
+
Have a bug? Please create an issue on GitHub at https://github.com/fancyapps/fancyBox/issues
|
data/app/assets/javascripts/refinery/photo_gallery/fancybox/helpers/jquery.fancybox-buttons.js
ADDED
@@ -0,0 +1,115 @@
|
|
1
|
+
/*!
|
2
|
+
* Buttons helper for fancyBox
|
3
|
+
* version: 1.0.2
|
4
|
+
* @requires fancyBox v2.0 or later
|
5
|
+
*
|
6
|
+
* Usage:
|
7
|
+
* $(".fancybox").fancybox({
|
8
|
+
* buttons: {
|
9
|
+
* position : 'top'
|
10
|
+
* }
|
11
|
+
* });
|
12
|
+
*
|
13
|
+
* Options:
|
14
|
+
* tpl - HTML template
|
15
|
+
* position - 'top' or 'bottom'
|
16
|
+
*
|
17
|
+
*/
|
18
|
+
(function ($) {
|
19
|
+
//Shortcut for fancyBox object
|
20
|
+
var F = $.fancybox;
|
21
|
+
|
22
|
+
//Add helper object
|
23
|
+
F.helpers.buttons = {
|
24
|
+
tpl: '<div id="fancybox-buttons"><ul><li><a class="btnPrev" title="Previous" href="javascript:;"></a></li><li><a class="btnPlay" title="Start slideshow" href="javascript:;"></a></li><li><a class="btnNext" title="Next" href="javascript:;"></a></li><li><a class="btnToggle" title="Toggle size" href="javascript:;"></a></li><li><a class="btnClose" title="Close" href="javascript:jQuery.fancybox.close();"></a></li></ul></div>',
|
25
|
+
list: null,
|
26
|
+
buttons: {},
|
27
|
+
|
28
|
+
update: function () {
|
29
|
+
var toggle = this.buttons.toggle.removeClass('btnDisabled btnToggleOn');
|
30
|
+
|
31
|
+
//Size toggle button
|
32
|
+
if (F.current.canShrink) {
|
33
|
+
toggle.addClass('btnToggleOn');
|
34
|
+
|
35
|
+
} else if (!F.current.canExpand) {
|
36
|
+
toggle.addClass('btnDisabled');
|
37
|
+
}
|
38
|
+
},
|
39
|
+
|
40
|
+
beforeLoad: function (opts) {
|
41
|
+
//Remove self if gallery do not have at least two items
|
42
|
+
if (F.group.length < 2) {
|
43
|
+
F.coming.helpers.buttons = false;
|
44
|
+
F.coming.closeBtn = true;
|
45
|
+
|
46
|
+
return;
|
47
|
+
}
|
48
|
+
|
49
|
+
//Increase top margin to give space for buttons
|
50
|
+
F.coming.margin[ opts.position === 'bottom' ? 2 : 0 ] += 30;
|
51
|
+
},
|
52
|
+
|
53
|
+
onPlayStart: function () {
|
54
|
+
if (this.list) {
|
55
|
+
this.buttons.play.attr('title', 'Pause slideshow').addClass('btnPlayOn');
|
56
|
+
}
|
57
|
+
},
|
58
|
+
|
59
|
+
onPlayEnd: function () {
|
60
|
+
if (this.list) {
|
61
|
+
this.buttons.play.attr('title', 'Start slideshow').removeClass('btnPlayOn');
|
62
|
+
}
|
63
|
+
},
|
64
|
+
|
65
|
+
afterShow: function (opts) {
|
66
|
+
var buttons;
|
67
|
+
|
68
|
+
if (!this.list) {
|
69
|
+
this.list = $(opts.tpl || this.tpl).addClass(opts.position || 'top').appendTo('body');
|
70
|
+
|
71
|
+
this.buttons = {
|
72
|
+
prev : this.list.find('.btnPrev').click( F.prev ),
|
73
|
+
next : this.list.find('.btnNext').click( F.next ),
|
74
|
+
play : this.list.find('.btnPlay').click( F.play ),
|
75
|
+
toggle : this.list.find('.btnToggle').click( F.toggle )
|
76
|
+
}
|
77
|
+
}
|
78
|
+
|
79
|
+
buttons = this.buttons;
|
80
|
+
|
81
|
+
//Prev
|
82
|
+
if (F.current.index > 0 || F.current.loop) {
|
83
|
+
buttons.prev.removeClass('btnDisabled');
|
84
|
+
} else {
|
85
|
+
buttons.prev.addClass('btnDisabled');
|
86
|
+
}
|
87
|
+
|
88
|
+
//Next / Play
|
89
|
+
if (F.current.loop || F.current.index < F.group.length - 1) {
|
90
|
+
buttons.next.removeClass('btnDisabled');
|
91
|
+
buttons.play.removeClass('btnDisabled');
|
92
|
+
|
93
|
+
} else {
|
94
|
+
buttons.next.addClass('btnDisabled');
|
95
|
+
buttons.play.addClass('btnDisabled');
|
96
|
+
}
|
97
|
+
|
98
|
+
this.update();
|
99
|
+
},
|
100
|
+
|
101
|
+
onUpdate: function () {
|
102
|
+
this.update();
|
103
|
+
},
|
104
|
+
|
105
|
+
beforeClose: function () {
|
106
|
+
if (this.list) {
|
107
|
+
this.list.remove();
|
108
|
+
}
|
109
|
+
|
110
|
+
this.list = null;
|
111
|
+
this.buttons = {};
|
112
|
+
}
|
113
|
+
};
|
114
|
+
|
115
|
+
}(jQuery));
|
@@ -0,0 +1,85 @@
|
|
1
|
+
/*!
|
2
|
+
* Media helper for fancyBox
|
3
|
+
* version: 1.0.0
|
4
|
+
* @requires fancyBox v2.0 or later
|
5
|
+
*
|
6
|
+
* Usage:
|
7
|
+
* $(".fancybox").fancybox({
|
8
|
+
* media: {}
|
9
|
+
* });
|
10
|
+
*
|
11
|
+
* Supports:
|
12
|
+
* Youtube
|
13
|
+
* http://www.youtube.com/watch?v=opj24KnzrWo
|
14
|
+
* http://youtu.be/opj24KnzrWo
|
15
|
+
* Vimeo
|
16
|
+
* http://vimeo.com/25634903
|
17
|
+
* Metacafe
|
18
|
+
* http://www.metacafe.com/watch/7635964/dr_seuss_the_lorax_movie_trailer/
|
19
|
+
* http://www.metacafe.com/watch/7635964/
|
20
|
+
* Dailymotion
|
21
|
+
* http://www.dailymotion.com/video/xoytqh_dr-seuss-the-lorax-premiere_people
|
22
|
+
* Twitvid
|
23
|
+
* http://twitvid.com/QY7MD
|
24
|
+
* Twitpic
|
25
|
+
* http://twitpic.com/7p93st
|
26
|
+
* Instagram
|
27
|
+
* http://instagr.am/p/IejkuUGxQn/
|
28
|
+
* http://instagram.com/p/IejkuUGxQn/
|
29
|
+
* Google maps
|
30
|
+
* http://maps.google.com/maps?q=Eiffel+Tower,+Avenue+Gustave+Eiffel,+Paris,+France&t=h&z=17
|
31
|
+
* http://maps.google.com/?ll=48.857995,2.294297&spn=0.007666,0.021136&t=m&z=16
|
32
|
+
* http://maps.google.com/?ll=48.859463,2.292626&spn=0.000965,0.002642&t=m&z=19&layer=c&cbll=48.859524,2.292532&panoid=YJ0lq28OOy3VT2IqIuVY0g&cbp=12,151.58,,0,-15.56
|
33
|
+
*/
|
34
|
+
(function ($) {
|
35
|
+
//Shortcut for fancyBox object
|
36
|
+
var F = $.fancybox;
|
37
|
+
|
38
|
+
//Add helper object
|
39
|
+
F.helpers.media = {
|
40
|
+
beforeLoad : function(opts, obj) {
|
41
|
+
var href = obj.href || '',
|
42
|
+
type = false,
|
43
|
+
rez;
|
44
|
+
|
45
|
+
if ((rez = href.match(/(youtube\.com|youtu\.be)\/(v\/|u\/|embed\/|watch\?v=)?([^#\&\?]*).*/i))) {
|
46
|
+
href = '//www.youtube.com/embed/' + rez[3] + '?autoplay=1&autohide=1&fs=1&rel=0&enablejsapi=1';
|
47
|
+
type = 'iframe';
|
48
|
+
|
49
|
+
} else if ((rez = href.match(/vimeo.com\/(\d+)\/?(.*)/))) {
|
50
|
+
href = '//player.vimeo.com/video/' + rez[1] + '?hd=1&autoplay=1&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1';
|
51
|
+
type = 'iframe';
|
52
|
+
|
53
|
+
} else if ((rez = href.match(/metacafe.com\/watch\/(\d+)\/?(.*)/))) {
|
54
|
+
href = '//www.metacafe.com/fplayer/' + rez[1] + '/.swf?playerVars=autoPlay=yes';
|
55
|
+
type = 'swf';
|
56
|
+
|
57
|
+
} else if ((rez = href.match(/dailymotion.com\/video\/(.*)\/?(.*)/))) {
|
58
|
+
href = '//www.dailymotion.com/swf/video/' + rez[1] + '?additionalInfos=0&autoStart=1';
|
59
|
+
type = 'swf';
|
60
|
+
|
61
|
+
} else if ((rez = href.match(/twitvid\.com\/([a-zA-Z0-9_\-\?\=]+)/i))) {
|
62
|
+
href = '//www.twitvid.com/embed.php?autoplay=0&guid=' + rez[1];
|
63
|
+
type = 'iframe';
|
64
|
+
|
65
|
+
} else if ((rez = href.match(/twitpic\.com\/(?!(?:place|photos|events)\/)([a-zA-Z0-9\?\=\-]+)/i))) {
|
66
|
+
href = '//twitpic.com/show/full/' + rez[1];
|
67
|
+
type = 'image';
|
68
|
+
|
69
|
+
} else if ((rez = href.match(/(instagr\.am|instagram\.com)\/p\/([a-zA-Z0-9_\-]+)\/?/i))) {
|
70
|
+
href = '//' + rez[1] + '/p/' + rez[2] + '/media/?size=l';
|
71
|
+
type = 'image';
|
72
|
+
|
73
|
+
} else if ((rez = href.match(/maps\.google\.com\/(\?ll=|maps\/?\?q=)(.*)/i))) {
|
74
|
+
href = '//maps.google.com/' + rez[1] + '' + rez[2] + '&output=' + (rez[2].indexOf('layer=c') ? 'svembed' : 'embed');
|
75
|
+
type = 'iframe';
|
76
|
+
}
|
77
|
+
|
78
|
+
if (type) {
|
79
|
+
obj.href = href;
|
80
|
+
obj.type = type;
|
81
|
+
}
|
82
|
+
}
|
83
|
+
}
|
84
|
+
|
85
|
+
}(jQuery));
|
@@ -0,0 +1,157 @@
|
|
1
|
+
/*!
|
2
|
+
* Thumbnail helper for fancyBox
|
3
|
+
* version: 1.0.4
|
4
|
+
* @requires fancyBox v2.0 or later
|
5
|
+
*
|
6
|
+
* Usage:
|
7
|
+
* $(".fancybox").fancybox({
|
8
|
+
* thumbs: {
|
9
|
+
* width : 50,
|
10
|
+
* height : 50
|
11
|
+
* }
|
12
|
+
* });
|
13
|
+
*
|
14
|
+
* Options:
|
15
|
+
* width - thumbnail width
|
16
|
+
* height - thumbnail height
|
17
|
+
* source - function to obtain the URL of the thumbnail image
|
18
|
+
* position - 'top' or 'bottom'
|
19
|
+
*
|
20
|
+
*/
|
21
|
+
(function ($) {
|
22
|
+
//Shortcut for fancyBox object
|
23
|
+
var F = $.fancybox;
|
24
|
+
|
25
|
+
//Add helper object
|
26
|
+
F.helpers.thumbs = {
|
27
|
+
wrap: null,
|
28
|
+
list: null,
|
29
|
+
width: 0,
|
30
|
+
|
31
|
+
//Default function to obtain the URL of the thumbnail image
|
32
|
+
source: function (el) {
|
33
|
+
var img;
|
34
|
+
|
35
|
+
if ($.type(el) === 'string') {
|
36
|
+
return el;
|
37
|
+
}
|
38
|
+
|
39
|
+
img = $(el).find('img');
|
40
|
+
|
41
|
+
return img.length ? img.attr('src') : el.href;
|
42
|
+
},
|
43
|
+
|
44
|
+
init: function (opts) {
|
45
|
+
var that = this,
|
46
|
+
list,
|
47
|
+
thumbWidth = opts.width || 50,
|
48
|
+
thumbHeight = opts.height || 50,
|
49
|
+
thumbSource = opts.source || this.source;
|
50
|
+
|
51
|
+
//Build list structure
|
52
|
+
list = '';
|
53
|
+
|
54
|
+
for (var n = 0; n < F.group.length; n++) {
|
55
|
+
list += '<li><a style="width:' + thumbWidth + 'px;height:' + thumbHeight + 'px;" href="javascript:jQuery.fancybox.jumpto(' + n + ');"></a></li>';
|
56
|
+
}
|
57
|
+
|
58
|
+
this.wrap = $('<div id="fancybox-thumbs"></div>').addClass(opts.position || 'bottom').appendTo('body');
|
59
|
+
this.list = $('<ul>' + list + '</ul>').appendTo(this.wrap);
|
60
|
+
|
61
|
+
//Load each thumbnail
|
62
|
+
$.each(F.group, function (i) {
|
63
|
+
$("<img />").load(function () {
|
64
|
+
var width = this.width,
|
65
|
+
height = this.height,
|
66
|
+
widthRatio, heightRatio, parent;
|
67
|
+
|
68
|
+
if (!that.list || !width || !height) {
|
69
|
+
return;
|
70
|
+
}
|
71
|
+
|
72
|
+
//Calculate thumbnail width/height and center it
|
73
|
+
widthRatio = width / thumbWidth;
|
74
|
+
heightRatio = height / thumbHeight;
|
75
|
+
parent = that.list.children().eq(i).find('a');
|
76
|
+
|
77
|
+
if (widthRatio >= 1 && heightRatio >= 1) {
|
78
|
+
if (widthRatio > heightRatio) {
|
79
|
+
width = Math.floor(width / heightRatio);
|
80
|
+
height = thumbHeight;
|
81
|
+
|
82
|
+
} else {
|
83
|
+
width = thumbWidth;
|
84
|
+
height = Math.floor(height / widthRatio);
|
85
|
+
}
|
86
|
+
}
|
87
|
+
|
88
|
+
$(this).css({
|
89
|
+
width: width,
|
90
|
+
height: height,
|
91
|
+
top: Math.floor(thumbHeight / 2 - height / 2),
|
92
|
+
left: Math.floor(thumbWidth / 2 - width / 2)
|
93
|
+
});
|
94
|
+
|
95
|
+
parent.width(thumbWidth).height(thumbHeight);
|
96
|
+
|
97
|
+
$(this).hide().appendTo(parent).fadeIn(300);
|
98
|
+
|
99
|
+
}).attr('src', thumbSource( F.group[ i ] ));
|
100
|
+
});
|
101
|
+
|
102
|
+
//Set initial width
|
103
|
+
this.width = this.list.children().eq(0).outerWidth(true);
|
104
|
+
|
105
|
+
this.list.width(this.width * (F.group.length + 1)).css('left', Math.floor($(window).width() * 0.5 - (F.current.index * this.width + this.width * 0.5)));
|
106
|
+
},
|
107
|
+
|
108
|
+
//Center list
|
109
|
+
update: function (opts) {
|
110
|
+
if (this.list) {
|
111
|
+
this.list.stop(true).animate({
|
112
|
+
'left': Math.floor($(window).width() * 0.5 - (F.current.index * this.width + this.width * 0.5))
|
113
|
+
}, 150);
|
114
|
+
}
|
115
|
+
},
|
116
|
+
|
117
|
+
beforeLoad: function (opts) {
|
118
|
+
//Remove self if gallery do not have at least two items
|
119
|
+
if (F.group.length < 2) {
|
120
|
+
F.coming.helpers.thumbs = false;
|
121
|
+
|
122
|
+
return;
|
123
|
+
}
|
124
|
+
|
125
|
+
//Increase bottom margin to give space for thumbs
|
126
|
+
F.coming.margin[ opts.position === 'top' ? 0 : 2 ] = opts.height + 30;
|
127
|
+
},
|
128
|
+
|
129
|
+
afterShow: function (opts) {
|
130
|
+
//Check if exists and create or update list
|
131
|
+
if (this.list) {
|
132
|
+
this.update(opts);
|
133
|
+
|
134
|
+
} else {
|
135
|
+
this.init(opts);
|
136
|
+
}
|
137
|
+
|
138
|
+
//Set active element
|
139
|
+
this.list.children().removeClass('active').eq(F.current.index).addClass('active');
|
140
|
+
},
|
141
|
+
|
142
|
+
onUpdate: function () {
|
143
|
+
this.update();
|
144
|
+
},
|
145
|
+
|
146
|
+
beforeClose: function () {
|
147
|
+
if (this.wrap) {
|
148
|
+
this.wrap.remove();
|
149
|
+
}
|
150
|
+
|
151
|
+
this.wrap = null;
|
152
|
+
this.list = null;
|
153
|
+
this.width = 0;
|
154
|
+
}
|
155
|
+
}
|
156
|
+
|
157
|
+
}(jQuery));
|