Skip to content

Commit

Permalink
Updated to v2.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
fancyapps committed Oct 1, 2012
1 parent 0705030 commit f4bf523
Show file tree
Hide file tree
Showing 11 changed files with 160 additions and 141 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
fancyBox - Changelog
=========

### Version 2.1.1 - October 01, 2012

* Fixed #357 - Converting values like 'auto' in getScalar()
* Fixed #358 - Updated overlay background image
* New "fancybox-href" and "fancybox-title" HTML5 data-attributes (#317)
* Improved helpers:
* - now they can have a property 'defaults' that contains default settings
* - updated vimeo and youtube parsers for media helper
* Content locking now can be turned off

### Version 2.1.0 - August 20, 2012

* Fixed #103 - DOM element re-injection after closing
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ You can specify type directly by adding classname (fancybox.image, fancybox.ifra
<a href="example.jpg" class="fancybox">Example</a>

Note, ajax requests are subject to the [same origin policy](http://en.wikipedia.org/wiki/Same_origin_policy).
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).
If fancyBox will not be able to get content type, it will try to guess based on 'href' and will quit silently if would not succeed.
(this is different from previsous versions where 'ajax' was used as default type or an error message was displayed).

Advanced
--------
Expand Down
16 changes: 8 additions & 8 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,25 @@
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

<!-- Add jQuery library -->
<script type="text/javascript" src="../lib/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="../lib/jquery-1.8.2.min.js"></script>

<!-- Add mousewheel plugin (this is optional) -->
<script type="text/javascript" src="../lib/jquery.mousewheel-3.0.6.pack.js"></script>

<!-- Add fancyBox main JS and CSS files -->
<script type="text/javascript" src="../source/jquery.fancybox.js?v=2.1.0"></script>
<link rel="stylesheet" type="text/css" href="../source/jquery.fancybox.css?v=2.1.0" media="screen" />
<script type="text/javascript" src="../source/jquery.fancybox.js?v=2.1.1"></script>
<link rel="stylesheet" type="text/css" href="../source/jquery.fancybox.css?v=2.1.1" media="screen" />

<!-- Add Button helper (this is optional) -->
<link rel="stylesheet" type="text/css" href="../source/helpers/jquery.fancybox-buttons.css?v=1.0.3" />
<script type="text/javascript" src="../source/helpers/jquery.fancybox-buttons.js?v=1.0.3"></script>
<link rel="stylesheet" type="text/css" href="../source/helpers/jquery.fancybox-buttons.css?v=1.0.4" />
<script type="text/javascript" src="../source/helpers/jquery.fancybox-buttons.js?v=1.0.4"></script>

<!-- Add Thumbnail helper (this is optional) -->
<link rel="stylesheet" type="text/css" href="../source/helpers/jquery.fancybox-thumbs.css?v=1.0.6" />
<script type="text/javascript" src="../source/helpers/jquery.fancybox-thumbs.js?v=1.0.6"></script>
<link rel="stylesheet" type="text/css" href="../source/helpers/jquery.fancybox-thumbs.css?v=1.0.7" />
<script type="text/javascript" src="../source/helpers/jquery.fancybox-thumbs.js?v=1.0.7"></script>

<!-- Add Media helper (this is optional) -->
<script type="text/javascript" src="../source/helpers/jquery.fancybox-media.js?v=1.0.3"></script>
<script type="text/javascript" src="../source/helpers/jquery.fancybox-media.js?v=1.0.4"></script>

<script type="text/javascript">
$(document).ready(function() {
Expand Down
2 changes: 0 additions & 2 deletions lib/jquery-1.8.0.min.js

This file was deleted.

2 changes: 2 additions & 0 deletions lib/jquery-1.8.2.min.js

Large diffs are not rendered by default.

Binary file modified source/fancybox_overlay.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 8 additions & 7 deletions source/helpers/jquery.fancybox-buttons.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* Buttons helper for fancyBox
* version: 1.0.3
* version: 1.0.4 (Mon, 01 Oct 2012)
* @requires fancyBox v2.0 or later
*
* Usage:
Expand All @@ -12,18 +12,19 @@
* }
* });
*
* Options:
* tpl - HTML template
* position - 'top' or 'bottom'
*
*/
(function ($) {
//Shortcut for fancyBox object
var F = $.fancybox;

//Add helper object
F.helpers.buttons = {
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>',
defaults : {
skipSingle : false, // disables if gallery contains single image
position : 'top', // 'top' or 'bottom'
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>',
},

list : null,
buttons: null,

Expand Down Expand Up @@ -57,7 +58,7 @@
var buttons = this.buttons;

if (!buttons) {
this.list = $(opts.tpl || this.tpl).addClass(opts.position || 'top').appendTo('body');
this.list = $(opts.tpl).addClass(opts.position).appendTo('body');

buttons = {
prev : this.list.find('.btnPrev').click( F.prev ),
Expand Down
12 changes: 6 additions & 6 deletions source/helpers/jquery.fancybox-media.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* Media helper for fancyBox
* version: 1.0.3 (Mon, 13 Aug 2012)
* version: 1.0.4 (Mon, 01 Oct 2012)
* @requires fancyBox v2.0 or later
*
* Usage:
Expand Down Expand Up @@ -37,6 +37,7 @@
*
* Youtube
* http://www.youtube.com/watch?v=opj24KnzrWo
* http://www.youtube.com/embed/opj24KnzrWo
* http://youtu.be/opj24KnzrWo
* Vimeo
* http://vimeo.com/40648169
Expand Down Expand Up @@ -85,9 +86,9 @@

//Add helper object
F.helpers.media = {
types : {
defaults : {
youtube : {
matcher : /(youtube\.com|youtu\.be)\/(watch\?v=|v\/|u\/|embed)?([\w-]{11}|\?listType=(.*)&list=(.*)).*/i,
matcher : /(youtube\.com|youtu\.be)\/(watch\?v=|v\/|u\/|embed\/?)?([\w-]{11}|\?listType=(.*)&list=(.*)).*/i,
params : {
autoplay : 1,
autohide : 1,
Expand All @@ -108,7 +109,6 @@
show_title : 1,
show_byline : 1,
show_portrait : 0,
color : '',
fullscreen : 1
},
type : 'iframe',
Expand Down Expand Up @@ -170,8 +170,8 @@
rez,
params;

for (what in this.types) {
item = this.types[ what ];
for (what in opts) {
item = opts[ what ];
rez = url.match( item.matcher );

if (rez) {
Expand Down
50 changes: 24 additions & 26 deletions source/helpers/jquery.fancybox-thumbs.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* Thumbnail helper for fancyBox
* version: 1.0.6
* version: 1.0.7 (Mon, 01 Oct 2012)
* @requires fancyBox v2.0 or later
*
* Usage:
Expand All @@ -13,44 +13,42 @@
* }
* });
*
* Options:
* width - thumbnail width
* height - thumbnail height
* source - function to obtain the URL of the thumbnail image
* position - 'top' or 'bottom'
*
*/
(function ($) {
//Shortcut for fancyBox object
var F = $.fancybox;

//Add helper object
F.helpers.thumbs = {
wrap : null,
list : null,
width : 0,

//Default function to obtain the URL of the thumbnail image
source: function ( item ) {
var href;
defaults : {
width : 50, // thumbnail width
height : 50, // thumbnail height
position : 'bottom', // 'top' or 'bottom'
source : function ( item ) { // function to obtain the URL of the thumbnail image
var href;

if (item.element) {
href = $(item.element).find('img').attr('src');
}

if (item.element) {
href = $(item.element).find('img').attr('src');
}
if (!href && item.type === 'image' && item.href) {
href = item.href;
}

if (!href && item.type === 'image' && item.href) {
href = item.href;
return href;
}

return href;
},

wrap : null,
list : null,
width : 0,

init: function (opts, obj) {
var that = this,
list,
thumbWidth = opts.width || 50,
thumbHeight = opts.height || 50,
thumbSource = opts.source || this.source;
thumbWidth = opts.width,
thumbHeight = opts.height,
thumbSource = opts.source;

//Build list structure
list = '';
Expand All @@ -59,7 +57,7 @@
list += '<li><a style="width:' + thumbWidth + 'px;height:' + thumbHeight + 'px;" href="javascript:jQuery.fancybox.jumpto(' + n + ');"></a></li>';
}

this.wrap = $('<div id="fancybox-thumbs"></div>').addClass(opts.position || 'bottom').appendTo('body');
this.wrap = $('<div id="fancybox-thumbs"></div>').addClass(opts.position).appendTo('body');
this.list = $('<ul>' + list + '</ul>').appendTo(this.wrap);

//Load each thumbnail
Expand Down Expand Up @@ -125,7 +123,7 @@
}

//Increase bottom margin to give space for thumbs
obj.margin[ opts.position === 'top' ? 0 : 2 ] += ((opts.height || 50) + 15);
obj.margin[ opts.position === 'top' ? 0 : 2 ] += ((opts.height) + 15);
},

afterShow: function (opts, obj) {
Expand Down
Loading

0 comments on commit f4bf523

Please sign in to comment.