jQuery Colorbox - Version 4.6.2

Version Description

Download this release

Release Info

Developer grimmdude
Plugin Icon 128x128 jQuery Colorbox
Version 4.6.2
Comparing to
See all releases

Code changes from version 4.5 to 4.6.2

Files changed (86) hide show
  1. .gitignore +0 -3
  2. LICENSE +20 -0
  3. README.md +13 -3
  4. includes/settings-page.php +20 -4
  5. includes/settings-page/sp-colorbox-settings.php +1 -3
  6. includes/settings-page/sp-delete-settings.php +1 -2
  7. includes/settings-page/sp-left-column.php +1 -1
  8. includes/settings-page/sp-plugin-settings.php +1 -2
  9. jquery-colorbox.json +31 -0
  10. jquery-colorbox.php +7 -6
  11. js/jquery-colorbox-wrapper-min.js +1 -1
  12. js/jquery-colorbox-wrapper.js +66 -50
  13. js/jquery.colorbox-min.js +7 -4
  14. js/jquery.colorbox.js +407 -265
  15. localization/jquery-colorbox-cs_CZ.mo +0 -0
  16. localization/jquery-colorbox-cs_CZ.po +646 -0
  17. localization/jquery-colorbox-sk_SK.mo +0 -0
  18. localization/jquery-colorbox-sk_SK.po +147 -144
  19. readme.txt +20 -5
  20. themes/theme1/colorbox.css +18 -33
  21. themes/theme1/images/border.png +0 -0
  22. themes/theme1/images/controls.png +0 -0
  23. themes/theme1/images/ie6/borderBottomCenter.png +0 -0
  24. themes/theme1/images/ie6/borderBottomLeft.png +0 -0
  25. themes/theme1/images/ie6/borderBottomRight.png +0 -0
  26. themes/theme1/images/ie6/borderMiddleLeft.png +0 -0
  27. themes/theme1/images/ie6/borderMiddleRight.png +0 -0
  28. themes/theme1/images/ie6/borderTopCenter.png +0 -0
  29. themes/theme1/images/ie6/borderTopLeft.png +0 -0
  30. themes/theme1/images/ie6/borderTopRight.png +0 -0
  31. themes/theme1/images/loading.gif +0 -0
  32. themes/theme1/images/loading_background.png +0 -0
  33. themes/theme1/images/overlay.png +0 -0
  34. themes/theme10/colorbox.css +7 -5
  35. themes/theme11/colorbox.css +22 -37
  36. themes/theme11/images/ie6/borderBottomCenter.png +0 -0
  37. themes/theme11/images/ie6/borderBottomLeft.png +0 -0
  38. themes/theme11/images/ie6/borderBottomRight.png +0 -0
  39. themes/theme11/images/ie6/borderMiddleLeft.png +0 -0
  40. themes/theme11/images/ie6/borderMiddleRight.png +0 -0
  41. themes/theme11/images/ie6/borderTopCenter.png +0 -0
  42. themes/theme11/images/ie6/borderTopLeft.png +0 -0
  43. themes/theme11/images/ie6/borderTopRight.png +0 -0
  44. themes/theme2/colorbox.css +16 -8
  45. themes/theme2/images/controls.png +0 -0
  46. themes/theme2/images/loading.gif +0 -0
  47. themes/theme3/colorbox.css +18 -10
  48. themes/theme3/images/controls.png +0 -0
  49. themes/theme3/images/loading.gif +0 -0
  50. themes/theme4/colorbox.css +17 -32
  51. themes/theme4/images/border1.png +0 -0
  52. themes/theme4/images/border2.png +0 -0
  53. themes/theme4/images/ie6/borderBottomCenter.png +0 -0
  54. themes/theme4/images/ie6/borderBottomLeft.png +0 -0
  55. themes/theme4/images/ie6/borderBottomRight.png +0 -0
  56. themes/theme4/images/ie6/borderMiddleLeft.png +0 -0
  57. themes/theme4/images/ie6/borderMiddleRight.png +0 -0
  58. themes/theme4/images/ie6/borderTopCenter.png +0 -0
  59. themes/theme4/images/ie6/borderTopLeft.png +0 -0
  60. themes/theme4/images/ie6/borderTopRight.png +0 -0
  61. themes/theme4/images/loading.gif +0 -0
  62. themes/theme5/colorbox.css +15 -8
  63. themes/theme5/images/border.png +0 -0
  64. themes/theme5/images/controls.png +0 -0
  65. themes/theme5/images/loading.gif +0 -0
  66. themes/theme5/images/loading_background.png +0 -0
  67. themes/theme6/colorbox.css +18 -9
  68. themes/theme7/colorbox.css +19 -34
  69. themes/theme7/images/ie6/borderBottomCenter.png +0 -0
  70. themes/theme7/images/ie6/borderBottomLeft.png +0 -0
  71. themes/theme7/images/ie6/borderBottomRight.png +0 -0
  72. themes/theme7/images/ie6/borderMiddleLeft.png +0 -0
  73. themes/theme7/images/ie6/borderMiddleRight.png +0 -0
  74. themes/theme7/images/ie6/borderTopCenter.png +0 -0
  75. themes/theme7/images/ie6/borderTopLeft.png +0 -0
  76. themes/theme7/images/ie6/borderTopRight.png +0 -0
  77. themes/theme8/colorbox.css +19 -10
  78. themes/theme9/colorbox.css +22 -46
  79. themes/theme9/images/ie6/borderBottomCenter.png +0 -0
  80. themes/theme9/images/ie6/borderBottomLeft.png +0 -0
  81. themes/theme9/images/ie6/borderBottomRight.png +0 -0
  82. themes/theme9/images/ie6/borderMiddleLeft.png +0 -0
  83. themes/theme9/images/ie6/borderMiddleRight.png +0 -0
  84. themes/theme9/images/ie6/borderTopCenter.png +0 -0
  85. themes/theme9/images/ie6/borderTopLeft.png +0 -0
  86. themes/theme9/images/ie6/borderTopRight.png +0 -0
.gitignore DELETED
@@ -1,3 +0,0 @@
1
- .idea
2
- target
3
- *.iml
LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2009 Arne Franken
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software is furnished to do so,
10
+ subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
README.md CHANGED
@@ -1,10 +1,9 @@
1
# Plugin Name #
2
Contributors: techotronic
3
- Donate link: http://www.techotronic.de/donate/
4
Tags: jquery, colorbox, lightbox, images, pictures, photos, gallery, javascript, overlay, nextgen gallery, nextgen-gallery, image, picture, photo, media, slideshow, ngg, mu
5
Requires at least: 2.8
6
- Tested up to: 3.4
7
- Stable tag: 4.5
8
9
Adds Colorbox/Lightbox functionality to images, grouped by post or page. Works for WordPress and NextGEN galleries. Comes with different themes.
10
@@ -140,6 +139,17 @@ Do not forget to activate auto Colorbox if you want the Lightbox/Colorbox to wor
140
I'll include new FAQs in newer versions.
141
142
## Changelog ##
143
### 4.5 (2012-11-03) ###
144
* NEW: Bulgarian translation by Nikolay Zaynelov
145
* BUGFIX: Zoom overlay does not break floating images any more
1
# Plugin Name #
2
Contributors: techotronic
3
Tags: jquery, colorbox, lightbox, images, pictures, photos, gallery, javascript, overlay, nextgen gallery, nextgen-gallery, image, picture, photo, media, slideshow, ngg, mu
4
Requires at least: 2.8
5
+ Tested up to: 4.6.1
6
+ Stable tag: 4.6.2
7
8
Adds Colorbox/Lightbox functionality to images, grouped by post or page. Works for WordPress and NextGEN galleries. Comes with different themes.
9
139
I'll include new FAQs in newer versions.
140
141
## Changelog ##
142
+
143
+ ### 4.6.2 (2016-11-14) ###
144
+ * BUGFIX: use __construct() to support newer PHP versions
145
+ * CHANGE: Add some graphix
146
+
147
+ ### 4.6 (2012-01-21) ###
148
+ * NEW: Czech translation by David Weis
149
+ * CHANGE: Update of the Slovak translation by B. Radenovich
150
+ * CHANGE: update Colorbox version to 1.3.21
151
+ * CHANGE: update jQuery version to 1.9.0 (if selected on settings page)
152
+
153
### 4.5 (2012-11-03) ###
154
* NEW: Bulgarian translation by Nikolay Zaynelov
155
* BUGFIX: Zoom overlay does not break floating images any more
includes/settings-page.php CHANGED
@@ -13,17 +13,33 @@
13
require_once 'settings-page/sp-javascript-header.php';
14
?>
15
<div class="wrap">
16
<div>
17
- <?php screen_icon(); ?>
18
- <h2><?php printf(__('%1$s Settings', JQUERYCOLORBOX_TEXTDOMAIN), JQUERYCOLORBOX_NAME); ?></h2>
19
<br class="clear"/>
20
21
<?php settings_fields(JQUERYCOLORBOX_SETTINGSNAME); ?>
22
23
<?php
24
require_once 'settings-page/sp-left-column.php';
25
- require_once 'settings-page/sp-right-column.php';
26
- ?>
27
</div>
28
<?php
29
require_once 'settings-page/sp-footer.php';
13
require_once 'settings-page/sp-javascript-header.php';
14
?>
15
<div class="wrap">
16
+ <?php
17
+ if (!is_plugin_active( 'sumome/sumome.php' ))
18
+ {
19
+ add_thickbox();
20
+ ?>
21
+ <style type="text/css">
22
+ #aio_global_notification a.button:active {vertical-align:baseline;}
23
+ </style>
24
+ <div id="aio_global_notification" style="border:3px solid #31964D;position:relative;background:#6AB07B;color:#ffffff;height:70px;margin:5px 0 15px;padding:1px 12px;">
25
+ <p style="font-size:16px;line-height:40px;">
26
+ <?php _e('Tools to grow your Email List, Social Sharing and Analytics.'); ?> &nbsp;<a style="background-color: #6267BE;border-color: #3C3F76;" href="<?php echo admin_url('plugin-install.php?tab=plugin-information&plugin=sumome&TB_iframe=true&width=743&height=500'); ?>" class="thickbox button button-primary">Get SumoMe WordPress Plugin</a>
27
+ </p>
28
+ </div>
29
+ <?php
30
+ }
31
+ ?>
32
+
33
<div>
34
+ <h1><?php printf(__('%1$s Settings', JQUERYCOLORBOX_TEXTDOMAIN), JQUERYCOLORBOX_NAME); ?></h1>
35
<br class="clear"/>
36
37
<?php settings_fields(JQUERYCOLORBOX_SETTINGSNAME); ?>
38
39
<?php
40
require_once 'settings-page/sp-left-column.php';
41
+ //require_once 'settings-page/sp-right-column.php';
42
+ ?>
43
</div>
44
<?php
45
require_once 'settings-page/sp-footer.php';
includes/settings-page/sp-colorbox-settings.php CHANGED
@@ -10,10 +10,8 @@
10
*/
11
?>
12
<div id="jquery-colorbox-plugin-settings" class="postbox">
13
- <h3 id="colorbox-settings"><?php _e('Colorbox settings', JQUERYCOLORBOX_TEXTDOMAIN); ?></h3>
14
-
15
<div class="inside">
16
-
17
<table class="form-table">
18
<tr valign="top">
19
<th scope="row">
10
*/
11
?>
12
<div id="jquery-colorbox-plugin-settings" class="postbox">
13
<div class="inside">
14
+ <h3 id="colorbox-settings"><?php _e('Colorbox settings', JQUERYCOLORBOX_TEXTDOMAIN); ?></h3>
15
<table class="form-table">
16
<tr valign="top">
17
<th scope="row">
includes/settings-page/sp-delete-settings.php CHANGED
@@ -11,9 +11,8 @@
11
?>
12
<div id="poststuff">
13
<div id="jquery-colorbox-delete_settings" class="postbox">
14
- <h3 id="delete_options"><?php _e('Delete Settings', JQUERYCOLORBOX_TEXTDOMAIN); ?></h3>
15
-
16
<div class="inside">
17
<p><?php _e('Check the box and click this button to delete settings of this plugin.', JQUERYCOLORBOX_TEXTDOMAIN); ?></p>
18
19
<form name="delete_settings" method="post" action="admin-post.php">
11
?>
12
<div id="poststuff">
13
<div id="jquery-colorbox-delete_settings" class="postbox">
14
<div class="inside">
15
+ <h3 id="delete_options"><?php _e('Delete Settings', JQUERYCOLORBOX_TEXTDOMAIN); ?></h3>
16
<p><?php _e('Check the box and click this button to delete settings of this plugin.', JQUERYCOLORBOX_TEXTDOMAIN); ?></p>
17
18
<form name="delete_settings" method="post" action="admin-post.php">
includes/settings-page/sp-left-column.php CHANGED
@@ -9,7 +9,7 @@
9
* Left column for settings page
10
*/
11
?>
12
- <div class="postbox-container" style="width: 69%;">
13
<form name="jquery-colorbox-settings-update" method="post" action="admin-post.php">
14
<?php if (function_exists('wp_nonce_field') === true) wp_nonce_field('jquery-colorbox-settings-form'); ?>
15
<div id="poststuff">
9
* Left column for settings page
10
*/
11
?>
12
+ <div class="postbox-container">
13
<form name="jquery-colorbox-settings-update" method="post" action="admin-post.php">
14
<?php if (function_exists('wp_nonce_field') === true) wp_nonce_field('jquery-colorbox-settings-form'); ?>
15
<div id="poststuff">
includes/settings-page/sp-plugin-settings.php CHANGED
@@ -10,10 +10,9 @@
10
*/
11
?>
12
<div id="jquery-colorbox-settings" class="postbox">
13
- <h3 id="plugin-settings"><?php _e('Plugin settings', JQUERYCOLORBOX_TEXTDOMAIN); ?></h3>
14
15
<div class="inside">
16
-
17
<table class="form-table">
18
<tr>
19
<th scope="row">
10
*/
11
?>
12
<div id="jquery-colorbox-settings" class="postbox">
13
14
<div class="inside">
15
+ <h3 id="plugin-settings"><?php _e('Plugin settings', JQUERYCOLORBOX_TEXTDOMAIN); ?></h3>
16
<table class="form-table">
17
<tr>
18
<th scope="row">
jquery-colorbox.json ADDED
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "jquery-colorbox",
3
+ "title": "jQuery Colorbox",
4
+ "description": "Add jQuery lightbox for images automatically in WordPress",
5
+ "version": "1.4.33",
6
+ "dependencies": {
7
+ "jquery": ">=1.3.2",
8
+ "colorbox": "1.4.33"
9
+ },
10
+ "keywords": [
11
+ "modal",
12
+ "lightbox",
13
+ "window",
14
+ "popup",
15
+ "ui",
16
+ "jQuery"
17
+ ],
18
+ "author": {
19
+ "name": "Arne Frnaken",
20
+ "url": "http://www.techotronic.de",
21
+ "email": "colorbox@techotronic.de"
22
+ },
23
+ "licenses": [
24
+ {
25
+ "type": "MIT",
26
+ "url": "http://www.opensource.org/licenses/mit-license.php"
27
+ }
28
+ ],
29
+ "homepage": "http://www.techotronic.de/plugins/jquery-colorbox/",
30
+ "demo": "http://www.techotronic.de/plugins/jquery-colorbox/"
31
+ }
jquery-colorbox.php CHANGED
@@ -6,7 +6,7 @@
6
* Plugin Name: jQuery Colorbox
7
* Plugin URI: http://www.techotronic.de/plugins/jquery-colorbox/
8
* Description: Used to overlay images on the current page. Images in one post are grouped automatically.
9
- * Version: 4.5
10
* Author: Arne Franken
11
* Author URI: http://www.techotronic.de/
12
* License: GPL
@@ -19,8 +19,8 @@
19
?>
20
<?php
21
//define constants
22
- define('JQUERYCOLORBOX_VERSION', '4.5');
23
- define('COLORBOXLIBRARY_VERSION', '1.3.20.1');
24
25
if (!defined('JQUERYCOLORBOX_PLUGIN_BASENAME')) {
26
//jquery-colorbox/jquery-colorbox.php
@@ -48,7 +48,7 @@ if (!defined('JQUERYCOLORBOX_SETTINGSNAME')) {
48
define('JQUERYCOLORBOX_SETTINGSNAME', 'jquery-colorbox_settings');
49
}
50
if (!defined('JQUERYLIBRARY_VERSION')) {
51
- define('JQUERYLIBRARY_VERSION', '1.8.2');
52
}
53
if (!defined('JQUERYCOLORBOX_USERAGENT')) {
54
define('JQUERYCOLORBOX_USERAGENT', 'jQuery Colorbox V' . JQUERYCOLORBOX_VERSION . '; (' . get_bloginfo('url') . ')');
@@ -72,7 +72,7 @@ class JQueryColorbox {
72
* @author Arne Franken
73
*/
74
//public static function JQueryColorbox() {
75
- function JQueryColorbox() {
76
if (!function_exists('plugins_url')) {
77
return;
78
}
@@ -133,7 +133,8 @@ class JQueryColorbox {
133
if (is_admin()) {
134
require_once 'includes/jquery-colorbox-backend.php';
135
new JQueryColorboxBackend($this->colorboxSettings, $this->colorboxThemes, $this->colorboxUnits, $this->colorboxTransitions, $this->jQueryColorboxDefaultSettings());
136
- } else {
137
require_once 'includes/jquery-colorbox-frontend.php';
138
new JQueryColorboxFrontend($this->colorboxSettings);
139
}
6
* Plugin Name: jQuery Colorbox
7
* Plugin URI: http://www.techotronic.de/plugins/jquery-colorbox/
8
* Description: Used to overlay images on the current page. Images in one post are grouped automatically.
9
+ * Version: 4.6.2
10
* Author: Arne Franken
11
* Author URI: http://www.techotronic.de/
12
* License: GPL
19
?>
20
<?php
21
//define constants
22
+ define('JQUERYCOLORBOX_VERSION', '4.6.2');
23
+ define('COLORBOXLIBRARY_VERSION', '1.4.33');
24
25
if (!defined('JQUERYCOLORBOX_PLUGIN_BASENAME')) {
26
//jquery-colorbox/jquery-colorbox.php
48
define('JQUERYCOLORBOX_SETTINGSNAME', 'jquery-colorbox_settings');
49
}
50
if (!defined('JQUERYLIBRARY_VERSION')) {
51
+ define('JQUERYLIBRARY_VERSION', '1.10.1');
52
}
53
if (!defined('JQUERYCOLORBOX_USERAGENT')) {
54
define('JQUERYCOLORBOX_USERAGENT', 'jQuery Colorbox V' . JQUERYCOLORBOX_VERSION . '; (' . get_bloginfo('url') . ')');
72
* @author Arne Franken
73
*/
74
//public static function JQueryColorbox() {
75
+ function __construct() {
76
if (!function_exists('plugins_url')) {
77
return;
78
}
133
if (is_admin()) {
134
require_once 'includes/jquery-colorbox-backend.php';
135
new JQueryColorboxBackend($this->colorboxSettings, $this->colorboxThemes, $this->colorboxUnits, $this->colorboxTransitions, $this->jQueryColorboxDefaultSettings());
136
+ }
137
+ else {
138
require_once 'includes/jquery-colorbox-frontend.php';
139
new JQueryColorboxFrontend($this->colorboxSettings);
140
}
js/jquery-colorbox-wrapper-min.js CHANGED
@@ -1 +1 @@
1
- var COLORBOX_INTERNAL_LINK_PATTERN=/^#.*/;var COLORBOX_SUFFIX_PATTERN=/\.(?:jpe?g|gif|png|bmp)/i;var COLORBOX_MANUAL="colorbox-manual";var COLORBOX_OFF_CLASS=".colorbox-off";var COLORBOX_LINK_CLASS=".colorbox-link";var COLORBOX_OFF="colorbox-off";var COLORBOX_CLASS_PATTERN="colorbox-[0-9]+";var COLORBOX_LINK_CLASS_PATTERN="colorbox-link-[0-9]+";jQuery(document).ready(function(){if(typeof jQueryColorboxSettingsArray!=="object"){jQueryColorboxSettingsArray=getColorboxConfigDefaults()}if(jQueryColorboxSettingsArray.autoColorboxJavaScript==="true"){colorboxAddManualClass()}if(jQueryColorboxSettingsArray.colorboxAddClassToLinks==="true"){colorboxAddClassToLinks()}if(jQueryColorboxSettingsArray.autoHideFlash==="true"){colorboxHideFlash();colorboxShowFlash()}colorboxSelector()});(function(a){colorboxShowFlash=function(){a(document).bind("cbox_closed",function(){var c=document.getElementsByTagName("object");for(i=0;i<c.length;i++){c[i].style.visibility="visible"}var b=document.getElementsByTagName("embed");for(i=0;i<b.length;i++){b[i].style.visibility="visible"}})}})(jQuery);(function(a){colorboxHideFlash=function(){a(document).bind("cbox_open",function(){var c=document.getElementsByTagName("object");for(i=0;i<c.length;i++){c[i].style.visibility="hidden"}var b=document.getElementsByTagName("embed");for(i=0;i<b.length;i++){b[i].style.visibility="hidden"}})}})(jQuery);(function(a){colorboxAddClassToLinks=function(){a("a:not(:contains(img))").each(function(d,f){var c=a(f);var b=c.attr("class");if(b!==undefined&&!b.match("colorbox")){var e=c.attr("href");if(e!==undefined&&a(f).attr("href").match(COLORBOX_SUFFIX_PATTERN)){c.addClass("colorbox-link")}}})}})(jQuery);(function(a){colorboxAddManualClass=function(){a("img").each(function(c,e){var d=a(e);var b=d.attr("class");if(b===undefined||!b.match("colorbox")){d.addClass("colorbox-manual")}})}})(jQuery);(function(a){colorboxSelector=function(){a("a:has(img[class*=colorbox-]):not(.colorbox-off)").each(function(b,d){ColorboxLocal=a.extend(true,{},jQueryColorboxSettingsArray);ColorboxLocal.colorboxMaxWidth=ColorboxLocal.colorboxImageMaxWidth;ColorboxLocal.colorboxMaxHeight=ColorboxLocal.colorboxImageMaxHeight;ColorboxLocal.colorboxHeight=ColorboxLocal.colorboxImageHeight;ColorboxLocal.colorboxWidth=ColorboxLocal.colorboxImageWidth;var c=a(d).attr("href");if(c!==undefined&&c.match(COLORBOX_SUFFIX_PATTERN)){colorboxImage(b,d)}});a("a[class*=colorbox-link]").each(function(b,d){ColorboxLocal=a.extend(true,{},jQueryColorboxSettingsArray);var c=a(d).attr("href");if(c!==undefined){colorboxLink(b,d,c)}})}})(jQuery);(function(a){colorboxImage=function(b,f){var d=a(f).find("img:first");var e=a(f).attr("class");if(e!==undefined){ColorboxLocal.colorboxGroupId=e.match(COLORBOX_CLASS_PATTERN)||e.match(COLORBOX_MANUAL)}if(!ColorboxLocal.colorboxGroupId){var g=d.attr("class");if(g!==undefined&&!g.match(COLORBOX_OFF)){ColorboxLocal.colorboxGroupId=g.match(COLORBOX_CLASS_PATTERN)||g.match(COLORBOX_MANUAL)}if(ColorboxLocal.colorboxGroupId){ColorboxLocal.colorboxGroupId=ColorboxLocal.colorboxGroupId.toString().split("-")[1];if(ColorboxLocal.colorboxGroupId==="manual"){ColorboxLocal.colorboxGroupId="nofollow"}var c=d.attr("title");if(c!==undefined){ColorboxLocal.colorboxTitle=c}if(jQueryColorboxSettingsArray.addZoomOverlay==="true"){colorboxAddZoomOverlayToImages(a(f),d)}colorboxWrapper(f)}}}})(jQuery);(function(a){colorboxLink=function(c,e,f){ColorboxLocal.colorboxGroupId=a(e).attr("class").match(COLORBOX_LINK_CLASS_PATTERN);if(ColorboxLocal.colorboxGroupId!==undefined&&ColorboxLocal.colorboxGroupId!==null){ColorboxLocal.colorboxGroupId=ColorboxLocal.colorboxGroupId.toString().split("-")[2]}else{ColorboxLocal.colorboxGroupId="nofollow"}var b=a(e);var d=b.attr("title");if(d!==undefined){ColorboxLocal.colorboxTitle=d}else{ColorboxLocal.colorboxTitle=""}if(f.match(COLORBOX_SUFFIX_PATTERN)){ColorboxLocal.colorboxMaxWidth=ColorboxLocal.colorboxImageMaxWidth;ColorboxLocal.colorboxMaxHeight=ColorboxLocal.colorboxImageMaxHeight;ColorboxLocal.colorboxHeight=ColorboxLocal.colorboxImageHeight;ColorboxLocal.colorboxWidth=ColorboxLocal.colorboxImageWidth}else{ColorboxLocal.colorboxMaxWidth=false;ColorboxLocal.colorboxMaxHeight=false;ColorboxLocal.colorboxHeight=ColorboxLocal.colorboxLinkHeight;ColorboxLocal.colorboxWidth=ColorboxLocal.colorboxLinkWidth;if(f.match(COLORBOX_INTERNAL_LINK_PATTERN)){ColorboxLocal.colorboxInline=true}else{ColorboxLocal.colorboxIframe=true}}colorboxWrapper(e)}})(jQuery);(function(a){colorboxWrapper=function(b){a.each(ColorboxLocal,function(c,d){if(d==="false"){ColorboxLocal[c]=false}else{if(d==="true"){ColorboxLocal[c]=true}}});a(b).colorbox({transition:ColorboxLocal.colorboxTransition,speed:parseInt(ColorboxLocal.colorboxSpeed),title:ColorboxLocal.colorboxTitle,rel:ColorboxLocal.colorboxGroupId,scalePhotos:ColorboxLocal.colorboxScalePhotos,scrolling:ColorboxLocal.colorboxScrolling,opacity:ColorboxLocal.colorboxOpacity,preloading:ColorboxLocal.colorboxPreloading,overlayClose:ColorboxLocal.colorboxOverlayClose,escKey:ColorboxLocal.colorboxEscKey,arrowKey:ColorboxLocal.colorboxArrowKey,loop:ColorboxLocal.colorboxLoop,current:ColorboxLocal.colorboxCurrent,previous:ColorboxLocal.colorboxPrevious,next:ColorboxLocal.colorboxNext,close:ColorboxLocal.colorboxClose,xhrError:ColorboxLocal.colorboxXhrError,imgError:ColorboxLocal.colorboxImgError,iframe:ColorboxLocal.colorboxIframe,inline:ColorboxLocal.colorboxInline,width:ColorboxLocal.colorboxWidth,height:ColorboxLocal.colorboxHeight,initialWidth:ColorboxLocal.colorboxInitialWidth,initialHeight:ColorboxLocal.colorboxInitialHeight,maxWidth:ColorboxLocal.colorboxMaxWidth,maxHeight:ColorboxLocal.colorboxMaxHeight,slideshow:ColorboxLocal.colorboxSlideshow,slideshowSpeed:parseInt(ColorboxLocal.colorboxSlideshowSpeed),slideshowAuto:ColorboxLocal.colorboxSlideshowAuto,slideshowStart:ColorboxLocal.colorboxSlideshowStart,slideshowStop:ColorboxLocal.colorboxSlideshowStop})}})(jQuery);(function(a){colorboxAddZoomOverlayToImages=function(c,d){var b=a('<span class="zoomHover" style="opacity: 0;"></span>');c.css("float",d.css("float"));a(b).css("margin",d.css("margin"));b.css("padding",d.css("padding"));var e=a("-top","-left","-right","-bottom");a.each(e,function(f,g){b.css("margin"+g,d.css("margin"+g));b.css("padding"+g,d.css("padding"+g))});c.append(b);c.addClass("zoomLink");c.hover(function(){b.stop().animate({opacity:0.8},300);d.stop().animate({opacity:0.6},300)},function(){b.stop().animate({opacity:0},300);d.stop().animate({opacity:1},300)})}})(jQuery);(function(a){getColorboxConfigDefaults=function(){return{colorboxInline:false,colorboxIframe:false,colorboxGroupId:"",colorboxTitle:"",colorboxWidth:false,colorboxHeight:false,colorboxMaxWidth:false,colorboxMaxHeight:false,colorboxSlideshow:false,colorboxSlideshowAuto:false,colorboxScalePhotos:false,colorboxPreloading:false,colorboxOverlayClose:false,colorboxLoop:false,colorboxEscKey:true,colorboxArrowKey:true,colorboxScrolling:false,colorboxOpacity:"0.85",colorboxTransition:"elastic",colorboxSpeed:"350",colorboxSlideshowSpeed:"2500",colorboxClose:"close",colorboxNext:"next",colorboxPrevious:"previous",colorboxSlideshowStart:"start slideshow",colorboxSlideshowStop:"stop slideshow",colorboxCurrent:"{current} of {total} images",colorboxXhrError:"This content failed to load.",colorboxImgError:"This image failed to load.",colorboxImageMaxWidth:false,colorboxImageMaxHeight:false,colorboxImageHeight:false,colorboxImageWidth:false,colorboxLinkHeight:false,colorboxLinkWidth:false,colorboxInitialHeight:100,colorboxInitialWidth:300,autoColorboxJavaScript:false,autoHideFlash:false,autoColorbox:false,autoColorboxGalleries:false,colorboxAddClassToLinks:false,useGoogleJQuery:false,addZoomOverlay:false}}})(jQuery);(function(a){printArray=function(h,g){var b="";if(!g){g=0}var f="";for(var c=0;c<g+1;c++){f+=" "}if(typeof(h)==="object"){for(var d in h){var e=h[d];if(typeof(e)==="object"){b+=f+"'"+d+"' ...\n";b+=printArray(e,g+1)}else{b+=f+"'"+d+"' = \""+e+'"\n'}}}else{b="===>"+h+"<===("+typeof(h)+")"}return b}})(jQuery);
1
+ var COLORBOX_INTERNAL_LINK_PATTERN=/^#.*/;var COLORBOX_SUFFIX_PATTERN=/\.(?:jpe?g|gif|png|bmp)/i;var COLORBOX_MANUAL="colorbox-manual";var COLORBOX_OFF_CLASS=".colorbox-off";var COLORBOX_LINK_CLASS=".colorbox-link";var COLORBOX_OFF="colorbox-off";var COLORBOX_CLASS_PATTERN="colorbox-[0-9]+";var COLORBOX_LINK_CLASS_PATTERN="colorbox-link-[0-9]+";jQuery(document).ready(function(){emulateConsoleForIE();console.group("jQuery Colorbox log messages");if(typeof jQueryColorboxSettingsArray!=="object"){jQueryColorboxSettingsArray=getColorboxConfigDefaults()}if(jQueryColorboxSettingsArray.autoColorboxJavaScript==="true"){colorboxAddManualClass()}if(jQueryColorboxSettingsArray.colorboxAddClassToLinks==="true"){colorboxAddClassToLinks()}if(jQueryColorboxSettingsArray.autoHideFlash==="true"){colorboxHideFlash();colorboxShowFlash()}colorboxSelector();console.groupEnd()});(function(a){emulateConsoleForIE=function(){if(!console){console={}}var b=["log","info","warn","error","debug","trace","dir","group","groupCollapsed","groupEnd","time","timeEnd","profile","profileEnd","dirxml","assert","count","markTimeline","timeStamp","clear"];for(var c=0;c<b.length;c++){if(!console[b[c]]){console[b[c]]=function(){}}}}})(jQuery);(function(a){colorboxShowFlash=function(){a(document).bind("cbox_closed",function(){console.group("Showing flash objects");var e=document.getElementsByTagName("object");for(var d=0;d<e.length;d++){console.debug("Show object %o",e[d]);e[d].style.visibility="visible"}var b=document.getElementsByTagName("embed");for(var c=0;c<b.length;c++){console.debug("Show embed %o",b[c]);b[c].style.visibility="visible"}console.groupEnd()})}})(jQuery);(function(a){colorboxHideFlash=function(){a(document).bind("cbox_open",function(){console.group("Hiding flash objects");var e=document.getElementsByTagName("object");for(var d=0;d<e.length;d++){console.debug("Hide object %o",e[d]);e[d].style.visibility="hidden"}var b=document.getElementsByTagName("embed");for(var c=0;c<b.length;c++){console.debug("Hide embed %o",b[c]);b[c].style.visibility="hidden"}console.groupEnd()})}})(jQuery);(function(a){colorboxAddClassToLinks=function(){console.group("Add colorbox-link class to links pointing to images");a("a:not(:contains(img))").each(function(d,f){var c=a(f);var b=c.attr("class");if(b!==undefined&&!b.match("colorbox")){var e=c.attr("href");if(e!==undefined&&a(f).attr("href").match(COLORBOX_SUFFIX_PATTERN)){console.debug("Add colorbox-link class to %o.",c);c.addClass("colorbox-link")}}});console.groupEnd()}})(jQuery);(function(a){colorboxAddManualClass=function(){console.group("Add colorbox-manual class to images");a("img").each(function(c,e){var d=a(e);var b=d.attr("class");if(b===undefined||!b.match("colorbox")){console.debug("Add colorbox-manual class to image %o",d);d.addClass("colorbox-manual")}});console.groupEnd()}})(jQuery);(function(a){colorboxSelector=function(){console.group("Find image links and apply colorbox effect.");a("a:has(img[class*=colorbox-]):not(.colorbox-off)").each(function(b,d){console.group("Found link %o.",d);ColorboxLocal=a.extend(true,{},jQueryColorboxSettingsArray);ColorboxLocal.colorboxMaxWidth=ColorboxLocal.colorboxImageMaxWidth;ColorboxLocal.colorboxMaxHeight=ColorboxLocal.colorboxImageMaxHeight;ColorboxLocal.colorboxHeight=ColorboxLocal.colorboxImageHeight;ColorboxLocal.colorboxWidth=ColorboxLocal.colorboxImageWidth;var c=a(d).attr("href");if(c!==undefined&&c.match(COLORBOX_SUFFIX_PATTERN)){colorboxImage(b,d)}console.groupEnd()});console.groupEnd();console.group("Find links and apply colorbox effect.");a("a[class*=colorbox-link]").each(function(b,d){console.group("Found link %o.",d);ColorboxLocal=a.extend(true,{},jQueryColorboxSettingsArray);var c=a(d).attr("href");if(c!==undefined){colorboxLink(b,d,c)}console.groupEnd()});console.groupEnd()}})(jQuery);(function(a){colorboxImage=function(b,g){var d=a(g).find("img:first");var f=a(g).attr("class");if(f!==undefined){ColorboxLocal.colorboxGroupId=f.match(COLORBOX_CLASS_PATTERN)||f.match(COLORBOX_MANUAL)}if(!ColorboxLocal.colorboxGroupId){var h=d.attr("class");if(h!==undefined&&!h.match(COLORBOX_OFF)){ColorboxLocal.colorboxGroupId=h.match(COLORBOX_CLASS_PATTERN)||h.match(COLORBOX_MANUAL)}if(ColorboxLocal.colorboxGroupId){ColorboxLocal.colorboxGroupId=ColorboxLocal.colorboxGroupId.toString().split("-")[1];if(ColorboxLocal.colorboxGroupId==="manual"){ColorboxLocal.colorboxGroupId="nofollow"}var c=d.attr("title");if(c!==undefined){ColorboxLocal.colorboxTitle=c}else{var e=d.attr("alt");if(e!==undefined){ColorboxLocal.colorboxTitle=e}}if(jQueryColorboxSettingsArray.addZoomOverlay==="true"){colorboxAddZoomOverlayToImages(a(g),d)}console.debug("Call colorbox for image %o.",d);colorboxWrapper(g)}}}})(jQuery);(function(a){colorboxLink=function(c,e,f){ColorboxLocal.colorboxGroupId=a(e).attr("class").match(COLORBOX_LINK_CLASS_PATTERN);if(ColorboxLocal.colorboxGroupId!==undefined&&ColorboxLocal.colorboxGroupId!==null){ColorboxLocal.colorboxGroupId=ColorboxLocal.colorboxGroupId.toString().split("-")[2]}else{ColorboxLocal.colorboxGroupId="nofollow"}var b=a(e);var d=b.attr("title");if(d!==undefined){ColorboxLocal.colorboxTitle=d}else{ColorboxLocal.colorboxTitle=""}if(f.match(COLORBOX_SUFFIX_PATTERN)){ColorboxLocal.colorboxMaxWidth=ColorboxLocal.colorboxImageMaxWidth;ColorboxLocal.colorboxMaxHeight=ColorboxLocal.colorboxImageMaxHeight;ColorboxLocal.colorboxHeight=ColorboxLocal.colorboxImageHeight;ColorboxLocal.colorboxWidth=ColorboxLocal.colorboxImageWidth}else{ColorboxLocal.colorboxMaxWidth=false;ColorboxLocal.colorboxMaxHeight=false;ColorboxLocal.colorboxHeight=ColorboxLocal.colorboxLinkHeight;ColorboxLocal.colorboxWidth=ColorboxLocal.colorboxLinkWidth;if(f.match(COLORBOX_INTERNAL_LINK_PATTERN)){ColorboxLocal.colorboxInline=true}else{ColorboxLocal.colorboxIframe=true}}console.debug("Call colorbox for link %o.",e);colorboxWrapper(e)}})(jQuery);(function(a){colorboxWrapper=function(b){a.each(ColorboxLocal,function(c,d){if(d==="false"){ColorboxLocal[c]=false}else{if(d==="true"){ColorboxLocal[c]=true}}});console.debug("Apply colorbox to link %o with values %o",b,ColorboxLocal);a(b).colorbox({transition:ColorboxLocal.colorboxTransition,speed:parseInt(ColorboxLocal.colorboxSpeed),title:ColorboxLocal.colorboxTitle,rel:ColorboxLocal.colorboxGroupId,scalePhotos:ColorboxLocal.colorboxScalePhotos,scrolling:ColorboxLocal.colorboxScrolling,opacity:ColorboxLocal.colorboxOpacity,preloading:ColorboxLocal.colorboxPreloading,overlayClose:ColorboxLocal.colorboxOverlayClose,escKey:ColorboxLocal.colorboxEscKey,arrowKey:ColorboxLocal.colorboxArrowKey,loop:ColorboxLocal.colorboxLoop,current:ColorboxLocal.colorboxCurrent,previous:ColorboxLocal.colorboxPrevious,next:ColorboxLocal.colorboxNext,close:ColorboxLocal.colorboxClose,xhrError:ColorboxLocal.colorboxXhrError,imgError:ColorboxLocal.colorboxImgError,iframe:ColorboxLocal.colorboxIframe,inline:ColorboxLocal.colorboxInline,width:ColorboxLocal.colorboxWidth,height:ColorboxLocal.colorboxHeight,initialWidth:ColorboxLocal.colorboxInitialWidth,initialHeight:ColorboxLocal.colorboxInitialHeight,maxWidth:ColorboxLocal.colorboxMaxWidth,maxHeight:ColorboxLocal.colorboxMaxHeight,slideshow:ColorboxLocal.colorboxSlideshow,slideshowSpeed:parseInt(ColorboxLocal.colorboxSlideshowSpeed),slideshowAuto:ColorboxLocal.colorboxSlideshowAuto,slideshowStart:ColorboxLocal.colorboxSlideshowStart,slideshowStop:ColorboxLocal.colorboxSlideshowStop})}})(jQuery);(function(a){colorboxAddZoomOverlayToImages=function(c,d){console.debug("Add zoom hover to link %o",c);var b=a('<span class="zoomHover" style="opacity: 0; margin: 0; padding: 0;"></span>');c.css("float",d.css("float"));c.append(b);c.addClass("zoomLink");c.hover(function(){b.stop().animate({opacity:0.8},300);d.stop().animate({opacity:0.6},300)},function(){b.stop().animate({opacity:0},300);d.stop().animate({opacity:1},300)})}})(jQuery);(function(a){getColorboxConfigDefaults=function(){return{colorboxInline:false,colorboxIframe:false,colorboxGroupId:"",colorboxTitle:"",colorboxWidth:false,colorboxHeight:false,colorboxMaxWidth:false,colorboxMaxHeight:false,colorboxSlideshow:false,colorboxSlideshowAuto:false,colorboxScalePhotos:false,colorboxPreloading:false,colorboxOverlayClose:false,colorboxLoop:false,colorboxEscKey:true,colorboxArrowKey:true,colorboxScrolling:false,colorboxOpacity:"0.85",colorboxTransition:"elastic",colorboxSpeed:"350",colorboxSlideshowSpeed:"2500",colorboxClose:"close",colorboxNext:"next",colorboxPrevious:"previous",colorboxSlideshowStart:"start slideshow",colorboxSlideshowStop:"stop slideshow",colorboxCurrent:"{current} of {total} images",colorboxXhrError:"This content failed to load.",colorboxImgError:"This image failed to load.",colorboxImageMaxWidth:false,colorboxImageMaxHeight:false,colorboxImageHeight:false,colorboxImageWidth:false,colorboxLinkHeight:false,colorboxLinkWidth:false,colorboxInitialHeight:100,colorboxInitialWidth:300,autoColorboxJavaScript:false,autoHideFlash:false,autoColorbox:false,autoColorboxGalleries:false,colorboxAddClassToLinks:false,useGoogleJQuery:false,addZoomOverlay:false}}})(jQuery);
js/jquery-colorbox-wrapper.js CHANGED
@@ -23,6 +23,9 @@ var COLORBOX_LINK_CLASS_PATTERN = "colorbox-link-[0-9]+";
23
*/
24
jQuery(document).ready(function() {
25
26
//check if config JavaScript was successfully inserted. Load defaults otherwise.
27
if(typeof jQueryColorboxSettingsArray !== 'object') {
28
jQueryColorboxSettingsArray = getColorboxConfigDefaults();
@@ -39,8 +42,37 @@ jQuery(document).ready(function() {
39
colorboxShowFlash();
40
}
41
colorboxSelector();
42
});
43
44
/**
45
* colorboxShowFlash
46
*
@@ -49,14 +81,18 @@ jQuery(document).ready(function() {
49
(function(jQuery) {
50
colorboxShowFlash = function() {
51
jQuery(document).bind('cbox_closed', function() {
52
var flashObjects = document.getElementsByTagName("object");
53
for (var i = 0; i < flashObjects.length; i++) {
54
flashObjects[i].style.visibility = "visible";
55
}
56
var flashEmbeds = document.getElementsByTagName("embed");
57
for (var j = 0; j < flashEmbeds.length; j++) {
58
flashEmbeds[j].style.visibility = "visible";
59
}
60
});
61
};
62
})(jQuery);
@@ -71,14 +107,18 @@ jQuery(document).ready(function() {
71
(function(jQuery) {
72
colorboxHideFlash = function() {
73
jQuery(document).bind('cbox_open', function() {
74
var flashObjects = document.getElementsByTagName("object");
75
for (var i = 0; i < flashObjects.length; i++) {
76
flashObjects[i].style.visibility = "hidden";
77
}
78
var flashEmbeds = document.getElementsByTagName("embed");
79
for (var j = 0; j < flashEmbeds.length; j++) {
80
flashEmbeds[j].style.visibility = "hidden";
81
}
82
});
83
};
84
})(jQuery);
@@ -92,16 +132,19 @@ jQuery(document).ready(function() {
92
*/
93
(function(jQuery) {
94
colorboxAddClassToLinks = function() {
95
jQuery("a:not(:contains(img))").each(function(index, link) {
96
var $link = jQuery(link);
97
var $linkClass = $link.attr("class");
98
if ($linkClass !== undefined && !$linkClass.match('colorbox')) {
99
var $linkHref = $link.attr("href");
100
if ($linkHref !== undefined && jQuery(link).attr("href").match(COLORBOX_SUFFIX_PATTERN)) {
101
$link.addClass('colorbox-link');
102
}
103
}
104
});
105
};
106
})(jQuery);
107
@@ -114,13 +157,16 @@ jQuery(document).ready(function() {
114
*/
115
(function(jQuery) {
116
colorboxAddManualClass = function() {
117
jQuery("img").each(function(index, image) {
118
var $img = jQuery(image);
119
var $imgClass = $img.attr("class");
120
if ($imgClass === undefined || !$imgClass.match('colorbox')) {
121
$img.addClass('colorbox-manual');
122
}
123
});
124
};
125
})(jQuery);
126
@@ -133,8 +179,9 @@ jQuery(document).ready(function() {
133
*/
134
(function(jQuery) {
135
colorboxSelector = function() {
136
-
137
jQuery("a:has(img[class*=colorbox-]):not(.colorbox-off)").each(function(index, link) {
138
//create local copy of Colorbox array so that modifications can be made for every link
139
ColorboxLocal = jQuery.extend(true,{},jQueryColorboxSettingsArray);
140
@@ -151,9 +198,13 @@ jQuery(document).ready(function() {
151
//TODO: does not work, every link from an image will be opened in a colorbox...
152
//colorboxLink(index, link,$linkHref)
153
//}
154
});
155
156
jQuery("a[class*=colorbox-link]").each(function(index, link) {
157
//create local copy of Colorbox array so that modifications can be made for every link
158
ColorboxLocal = jQuery.extend(true,{},jQueryColorboxSettingsArray);
159
@@ -161,7 +212,9 @@ jQuery(document).ready(function() {
161
if ($linkHref !== undefined) {
162
colorboxLink(index, link,$linkHref);
163
}
164
});
165
};
166
})(jQuery);
167
@@ -201,11 +254,18 @@ jQuery(document).ready(function() {
201
if ($imageTitle !== undefined) {
202
ColorboxLocal.colorboxTitle = $imageTitle;
203
}
204
205
if (jQueryColorboxSettingsArray.addZoomOverlay === "true") {
206
colorboxAddZoomOverlayToImages(jQuery(link), $image);
207
}
208
-
209
colorboxWrapper(link);
210
}
211
}
@@ -268,7 +328,7 @@ jQuery(document).ready(function() {
268
ColorboxLocal.colorboxIframe = true;
269
}
270
}
271
-
272
colorboxWrapper(link);
273
};
274
})(jQuery);
@@ -294,12 +354,7 @@ jQuery(document).ready(function() {
294
}
295
});
296
297
- //for debugging purposes: print current array to title attribute
298
- // var currentArray;
299
- // currentArray = '<!--';
300
- // currentArray = currentArray + printArray(ColorboxLocal);
301
- // currentArray = currentArray + '-->';
302
- // ColorboxLocal.colorboxTitle += ColorboxLocal.colorboxTitle + currentArray;
303
304
//finally call Colorbox library
305
jQuery(link).colorbox({
@@ -379,7 +434,8 @@ jQuery(document).ready(function() {
379
*/
380
(function (jQuery) {
381
colorboxAddZoomOverlayToImages = function ($link, $image) {
382
- var $zoomHover = jQuery('<span class="zoomHover" style="opacity: 0;"></span>');
383
384
//add float from image to link, otherwise the zoom overlay would not be visible
385
$link.css("float",$image.css("float"));
@@ -464,43 +520,3 @@ jQuery(document).ready(function() {
464
})(jQuery);
465
466
// getColorboxConfigDefaults()
467
-
468
- /**
469
- * Print given array
470
- */
471
- (function (jQuery) {
472
- printArray = function(array, level) {
473
- var output = "";
474
- if (!level) {
475
- level = 0;
476
- }
477
-
478
- //The padding given at the beginning of the line.
479
- var padding = "";
480
- for (var j = 0; j < level + 1; j++) {
481
- padding += " ";
482
- }
483
-
484
- if (typeof(array) === 'object') { //Array/Hashes/Objects
485
- for (var item in array) {
486
-
487
- var value = array[item];
488
-
489
- if (typeof(value) === 'object') { //If it is an array,
490
- output += padding + "'" + item + "' ...\n";
491
- output += printArray(value, level + 1);
492
- }
493
- else {
494
- output += padding + "'" + item + "' = \"" + value + "\"\n";
495
- }
496
- }
497
- }
498
- else { //Stings/Chars/Numbers etc.
499
- output = "===>" + array + "<===(" + typeof(array) + ")";
500
- }
501
-
502
- return output;
503
- };
504
- })(jQuery);
505
-
506
- // printArray()
23
*/
24
jQuery(document).ready(function() {
25
26
+ emulateConsoleForIE();
27
+
28
+ console.group('jQuery Colorbox log messages');
29
//check if config JavaScript was successfully inserted. Load defaults otherwise.
30
if(typeof jQueryColorboxSettingsArray !== 'object') {
31
jQueryColorboxSettingsArray = getColorboxConfigDefaults();
42
colorboxShowFlash();
43
}
44
colorboxSelector();
45
+ console.groupEnd();
46
});
47
48
+ /**
49
+ * Make console.log do nothing in IE 9 and below, otherwise JavaScript would break
50
+ *
51
+ * @since 4.3
52
+ * @author Arne Franken
53
+ */
54
+ (function(jQuery) {
55
+ emulateConsoleForIE = function() {
56
+
57
+ if (!console) {
58
+ console = {};
59
+ }
60
+ // union of Chrome, FF, IE, and Safari console methods
61
+ var m = [
62
+ "log", "info", "warn", "error", "debug", "trace", "dir", "group",
63
+ "groupCollapsed", "groupEnd", "time", "timeEnd", "profile", "profileEnd",
64
+ "dirxml", "assert", "count", "markTimeline", "timeStamp", "clear"
65
+ ];
66
+ // define undefined methods as noops to prevent errors
67
+ for (var i = 0; i < m.length; i++) {
68
+ if (!console[m[i]]) {
69
+ console[m[i]] = function() {};
70
+ }
71
+ }
72
+
73
+ }
74
+ })(jQuery);
75
+
76
/**
77
* colorboxShowFlash
78
*
81
(function(jQuery) {
82
colorboxShowFlash = function() {
83
jQuery(document).bind('cbox_closed', function() {
84
+ console.group('Showing flash objects');
85
var flashObjects = document.getElementsByTagName("object");
86
for (var i = 0; i < flashObjects.length; i++) {
87
+ console.debug('Show object %o',flashObjects[i]);
88
flashObjects[i].style.visibility = "visible";
89
}
90
var flashEmbeds = document.getElementsByTagName("embed");
91
for (var j = 0; j < flashEmbeds.length; j++) {
92
+ console.debug('Show embed %o',flashEmbeds[j]);
93
flashEmbeds[j].style.visibility = "visible";
94
}
95
+ console.groupEnd();
96
});
97
};
98
})(jQuery);
107
(function(jQuery) {
108
colorboxHideFlash = function() {
109
jQuery(document).bind('cbox_open', function() {
110
+ console.group('Hiding flash objects');
111
var flashObjects = document.getElementsByTagName("object");
112
for (var i = 0; i < flashObjects.length; i++) {
113
+ console.debug('Hide object %o',flashObjects[i]);
114
flashObjects[i].style.visibility = "hidden";
115
}
116
var flashEmbeds = document.getElementsByTagName("embed");
117
for (var j = 0; j < flashEmbeds.length; j++) {
118
+ console.debug('Hide embed %o',flashEmbeds[j]);
119
flashEmbeds[j].style.visibility = "hidden";
120
}
121
+ console.groupEnd();
122
});
123
};
124
})(jQuery);
132
*/
133
(function(jQuery) {
134
colorboxAddClassToLinks = function() {
135
+ console.group('Add colorbox-link class to links pointing to images');
136
jQuery("a:not(:contains(img))").each(function(index, link) {
137
var $link = jQuery(link);
138
var $linkClass = $link.attr("class");
139
if ($linkClass !== undefined && !$linkClass.match('colorbox')) {
140
var $linkHref = $link.attr("href");
141
if ($linkHref !== undefined && jQuery(link).attr("href").match(COLORBOX_SUFFIX_PATTERN)) {
142
+ console.debug("Add colorbox-link class to %o.",$link);
143
$link.addClass('colorbox-link');
144
}
145
}
146
});
147
+ console.groupEnd();
148
};
149
})(jQuery);
150
157
*/
158
(function(jQuery) {
159
colorboxAddManualClass = function() {
160
+ console.group('Add colorbox-manual class to images');
161
jQuery("img").each(function(index, image) {
162
var $img = jQuery(image);
163
var $imgClass = $img.attr("class");
164
if ($imgClass === undefined || !$imgClass.match('colorbox')) {
165
+ console.debug('Add colorbox-manual class to image %o',$img);
166
$img.addClass('colorbox-manual');
167
}
168
});
169
+ console.groupEnd();
170
};
171
})(jQuery);
172
179
*/
180
(function(jQuery) {
181
colorboxSelector = function() {
182
+ console.group('Find image links and apply colorbox effect.');
183
jQuery("a:has(img[class*=colorbox-]):not(.colorbox-off)").each(function(index, link) {
184
+ console.group("Found link %o.",link);
185
//create local copy of Colorbox array so that modifications can be made for every link
186
ColorboxLocal = jQuery.extend(true,{},jQueryColorboxSettingsArray);
187
198
//TODO: does not work, every link from an image will be opened in a colorbox...
199
//colorboxLink(index, link,$linkHref)
200
//}
201
+ console.groupEnd();
202
});
203
+ console.groupEnd();
204
205
+ console.group('Find links and apply colorbox effect.');
206
jQuery("a[class*=colorbox-link]").each(function(index, link) {
207
+ console.group("Found link %o.",link);
208
//create local copy of Colorbox array so that modifications can be made for every link
209
ColorboxLocal = jQuery.extend(true,{},jQueryColorboxSettingsArray);
210
212
if ($linkHref !== undefined) {
213
colorboxLink(index, link,$linkHref);
214
}
215
+ console.groupEnd();
216
});
217
+ console.groupEnd();
218
};
219
})(jQuery);
220
254
if ($imageTitle !== undefined) {
255
ColorboxLocal.colorboxTitle = $imageTitle;
256
}
257
+ else {
258
+ //try to use the alt of the img as the title for the Colorbox.
259
+ var $imageAlt = $image.attr("alt");
260
+ if ($imageAlt !== undefined) {
261
+ ColorboxLocal.colorboxTitle = $imageAlt;
262
+ }
263
+ }
264
265
if (jQueryColorboxSettingsArray.addZoomOverlay === "true") {
266
colorboxAddZoomOverlayToImages(jQuery(link), $image);
267
}
268
+ console.debug("Call colorbox for image %o.",$image);
269
colorboxWrapper(link);
270
}
271
}
328
ColorboxLocal.colorboxIframe = true;
329
}
330
}
331
+ console.debug("Call colorbox for link %o.",link);
332
colorboxWrapper(link);
333
};
334
})(jQuery);
354
}
355
});
356
357
+ console.debug("Apply colorbox to link %o with values %o",link,ColorboxLocal);
358
359
//finally call Colorbox library
360
jQuery(link).colorbox({
434
*/
435
(function (jQuery) {
436
colorboxAddZoomOverlayToImages = function ($link, $image) {
437
+ console.debug("Add zoom hover to link %o",$link);
438
+ var $zoomHover = jQuery('<span class="zoomHover" style="opacity: 0; margin: 0; padding: 0;"></span>');
439
440
//add float from image to link, otherwise the zoom overlay would not be visible
441
$link.css("float",$image.css("float"));
520
})(jQuery);
521
522
// getColorboxConfigDefaults()
js/jquery.colorbox-min.js CHANGED
@@ -1,4 +1,7 @@
1
- // ColorBox v1.3.20.1 - jQuery lightbox plugin
2
- // (c) 2012 Jack Moore - jacklmoore.com
3
- // License: http://www.opensource.org/licenses/mit-license.php
4
- (function(e,t,n){function G(n,r,i){var o=t.createElement(n);return r&&(o.id=s+r),i&&(o.style.cssText=i),e(o)}function Y(e){var t=T.length,n=(U+e)%t;return n<0?t+n:n}function Z(e,t){return Math.round((/%/.test(e)?(t==="x"?tt():nt())/100:1)*parseInt(e,10))}function et(e){return B.photo||/\.(gif|png|jp(e|g|eg)|bmp|ico)((#|\?).*)?#x2F;i.test(e)}function tt(){return n.innerWidth||N.width()}function nt(){return n.innerHeight||N.height()}function rt(){var t,n=e.data(R,i);n==null?(B=e.extend({},r),console&&console.log&&console.log("Error: cboxElement missing settings object")):B=e.extend({},n);for(t in B)e.isFunction(B[t])&&t.slice(0,2)!=="on"&&(B[t]=B[t].call(R));B.rel=B.rel||R.rel||"nofollow",B.href=B.href||e(R).attr("href"),B.title=B.title||R.title,typeof B.href=="string"&&(B.href=e.trim(B.href))}function it(t,n){e.event.trigger(t),n&&n.call(R)}function st(){var e,t=s+"Slideshow_",n="click."+s,r,i,o;B.slideshow&&T[1]?(r=function(){M.text(B.slideshowStop).unbind(n).bind(f,function(){if(B.loop||T[U+1])e=setTimeout(J.next,B.slideshowSpeed)}).bind(a,function(){clearTimeout(e)}).one(n+" "+l,i),g.removeClass(t+"off").addClass(t+"on"),e=setTimeout(J.next,B.slideshowSpeed)},i=function(){clearTimeout(e),M.text(B.slideshowStart).unbind([f,a,l,n].join(" ")).one(n,function(){J.next(),r()}),g.removeClass(t+"on").addClass(t+"off")},B.slideshowAuto?r():i()):g.removeClass(t+"off "+t+"on")}function ot(t){V||(R=t,rt(),T=e(R),U=0,B.rel!=="nofollow"&&(T=e("."+o).filter(function(){var t=e.data(this,i),n;return t&&(n=t.rel||this.rel),n===B.rel}),U=T.index(R),U===-1&&(T=T.add(R),U=T.length-1)),W||(W=X=!0,g.show(),B.returnFocus&&e(R).blur().one(c,function(){e(this).focus()}),m.css({opacity:+B.opacity,cursor:B.overlayClose?"pointer":"auto"}).show(),B.w=Z(B.initialWidth,"x"),B.h=Z(B.initialHeight,"y"),J.position(),d&&N.bind("resize."+v+" scroll."+v,function(){m.css({width:tt(),height:nt(),top:N.scrollTop(),left:N.scrollLeft()})}).trigger("resize."+v),it(u,B.onOpen),H.add(A).hide(),P.html(B.close).show()),J.load(!0))}function ut(){!g&&t.body&&(Q=!1,N=e(n),g=G(K).attr({id:i,"class":p?s+(d?"IE6":"IE"):""}).hide(),m=G(K,"Overlay",d?"position:absolute":"").hide(),L=G(K,"LoadingOverlay").add(G(K,"LoadingGraphic")),y=G(K,"Wrapper"),b=G(K,"Content").append(C=G(K,"LoadedContent","width:0; height:0; overflow:hidden"),A=G(K,"Title"),O=G(K,"Current"),_=G(K,"Next"),D=G(K,"Previous"),M=G(K,"Slideshow").bind(u,st),P=G(K,"Close")),y.append(G(K).append(G(K,"TopLeft"),w=G(K,"TopCenter"),G(K,"TopRight")),G(K,!1,"clear:left").append(E=G(K,"MiddleLeft"),b,S=G(K,"MiddleRight")),G(K,!1,"clear:left").append(G(K,"BottomLeft"),x=G(K,"BottomCenter"),G(K,"BottomRight"))).find("div div").css({"float":"left"}),k=G(K,!1,"position:absolute; width:9999px; visibility:hidden; display:none"),H=_.add(D).add(O).add(M),e(t.body).append(m,g.append(y,k)))}function at(){return g?(Q||(Q=!0,j=w.height()+x.height()+b.outerHeight(!0)-b.height(),F=E.width()+S.width()+b.outerWidth(!0)-b.width(),I=C.outerHeight(!0),q=C.outerWidth(!0),g.css({"padding-bottom":j,"padding-right":F}),_.click(function(){J.next()}),D.click(function(){J.prev()}),P.click(function(){J.close()}),m.click(function(){B.overlayClose&&J.close()}),e(t).bind("keydown."+s,function(e){var t=e.keyCode;W&&B.escKey&&t===27&&(e.preventDefault(),J.close()),W&&B.arrowKey&&T[1]&&(t===37?(e.preventDefault(),D.click()):t===39&&(e.preventDefault(),_.click()))}),e("."+o,t).live("click",function(e){e.which>1||e.shiftKey||e.altKey||e.metaKey||(e.preventDefault(),ot(this))})),!0):!1}var r={transition:"elastic",speed:300,width:!1,initialWidth:"600",innerWidth:!1,maxWidth:!1,height:!1,initialHeight:"450",innerHeight:!1,maxHeight:!1,scalePhotos:!0,scrolling:!0,inline:!1,html:!1,iframe:!1,fastIframe:!0,photo:!1,href:!1,title:!1,rel:!1,opacity:.9,preloading:!0,current:"image {current} of {total}",previous:"previous",next:"next",close:"close",xhrError:"This content failed to load.",imgError:"This image failed to load.",open:!1,returnFocus:!0,reposition:!0,loop:!0,slideshow:!1,slideshowAuto:!0,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",onOpen:!1,onLoad:!1,onComplete:!1,onCleanup:!1,onClosed:!1,overlayClose:!0,escKey:!0,arrowKey:!0,top:!1,bottom:!1,left:!1,right:!1,fixed:!1,data:undefined},i="colorbox",s="cbox",o=s+"Element",u=s+"_open",a=s+"_load",f=s+"_complete",l=s+"_cleanup",c=s+"_closed",h=s+"_purge",p=!e.support.opacity&&!e.support.style,d=p&&!n.XMLHttpRequest,v=s+"_IE6",m,g,y,b,w,E,S,x,T,N,C,k,L,A,O,M,_,D,P,H,B,j,F,I,q,R,U,z,W,X,V,$,J,K="div",Q;if(e.colorbox)return;e(ut),J=e.fn[i]=e[i]=function(t,n){var s=this;t=t||{},ut();if(at()){if(!s[0]){if(s.selector)return s;s=e("<a/>"),t.open=!0}n&&(t.onComplete=n),s.each(function(){e.data(this,i,e.extend({},e.data(this,i)||r,t))}).addClass(o),(e.isFunction(t.open)&&t.open.call(s)||t.open)&&ot(s[0])}return s},J.position=function(e,t){function f(e){w[0].style.width=x[0].style.width=b[0].style.width=e.style.width,b[0].style.height=E[0].style.height=S[0].style.height=e.style.height}var n,r=0,i=0,o=g.offset(),u,a;N.unbind("resize."+s),g.css({top:-9e4,left:-9e4}),u=N.scrollTop(),a=N.scrollLeft(),B.fixed&&!d?(o.top-=u,o.left-=a,g.css({position:"fixed"})):(r=u,i=a,g.css({position:"absolute"})),B.right!==!1?i+=Math.max(tt()-B.w-q-F-Z(B.right,"x"),0):B.left!==!1?i+=Z(B.left,"x"):i+=Math.round(Math.max(tt()-B.w-q-F,0)/2),B.bottom!==!1?r+=Math.max(nt()-B.h-I-j-Z(B.bottom,"y"),0):B.top!==!1?r+=Z(B.top,"y"):r+=Math.round(Math.max(nt()-B.h-I-j,0)/2),g.css({top:o.top,left:o.left}),e=g.width()===B.w+q&&g.height()===B.h+I?0:e||0,y[0].style.width=y[0].style.height="9999px",n={width:B.w+q,height:B.h+I,top:r,left:i},e===0&&g.css(n),g.dequeue().animate(n,{duration:e,complete:function(){f(this),X=!1,y[0].style.width=B.w+q+F+"px",y[0].style.height=B.h+I+j+"px",B.reposition&&setTimeout(function(){N.bind("resize."+s,J.position)},1),t&&t()},step:function(){f(this)}})},J.resize=function(e){W&&(e=e||{},e.width&&(B.w=Z(e.width,"x")-q-F),e.innerWidth&&(B.w=Z(e.innerWidth,"x")),C.css({width:B.w}),e.height&&(B.h=Z(e.height,"y")-I-j),e.innerHeight&&(B.h=Z(e.innerHeight,"y")),!e.innerHeight&&!e.height&&(C.css({height:"auto"}),B.h=C.height()),C.css({height:B.h}),J.position(B.transition==="none"?0:B.speed))},J.prep=function(t){function o(){return B.w=B.w||C.width(),B.w=B.mw&&B.mw<B.w?B.mw:B.w,B.w}function u(){return B.h=B.h||C.height(),B.h=B.mh&&B.mh<B.h?B.mh:B.h,B.h}if(!W)return;var n,r=B.transition==="none"?0:B.speed;C.remove(),C=G(K,"LoadedContent").append(t),C.hide().appendTo(k.show()).css({width:o(),overflow:B.scrolling?"auto":"hidden"}).css({height:u()}).prependTo(b),k.hide(),e(z).css({"float":"none"}),d&&e("select").not(g.find("select")).filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one(l,function(){this.style.visibility="inherit"}),n=function(){function y(){p&&g[0].style.removeAttribute("filter")}var t,n,o=T.length,u,a="frameBorder",l="allowTransparency",c,d,v,m;if(!W)return;c=function(){clearTimeout($),L.detach().hide(),it(f,B.onComplete)},p&&z&&C.fadeIn(100),A.html(B.title).add(C).show();if(o>1){typeof B.current=="string"&&O.html(B.current.replace("{current}",U+1).replace("{total}",o)).show(),_[B.loop||U<o-1?"show":"hide"]().html(B.next),D[B.loop||U?"show":"hide"]().html(B.previous),B.slideshow&&M.show();if(B.preloading){t=[Y(-1),Y(1)];while(n=T[t.pop()])m=e.data(n,i),m&&m.href?(d=m.href,e.isFunction(d)&&(d=d.call(n))):d=n.href,et(d)&&(v=new Image,v.src=d)}}else H.hide();B.iframe?(u=G("iframe")[0],a in u&&(u[a]=0),l in u&&(u[l]="true"),u.name=s+ +(new Date),B.fastIframe?c():e(u).one("load",c),u.src=B.href,B.scrolling||(u.scrolling="no"),e(u).addClass(s+"Iframe").appendTo(C).one(h,function(){u.src="//about:blank"})):c(),B.transition==="fade"?g.fadeTo(r,1,y):y()},B.transition==="fade"?g.fadeTo(r,0,function(){J.position(0,n)}):J.position(r,n)},J.load=function(t){var n,r,i=J.prep;X=!0,z=!1,R=T[U],t||rt(),it(h),it(a,B.onLoad),B.h=B.height?Z(B.height,"y")-I-j:B.innerHeight&&Z(B.innerHeight,"y"),B.w=B.width?Z(B.width,"x")-q-F:B.innerWidth&&Z(B.innerWidth,"x"),B.mw=B.w,B.mh=B.h,B.maxWidth&&(B.mw=Z(B.maxWidth,"x")-q-F,B.mw=B.w&&B.w<B.mw?B.w:B.mw),B.maxHeight&&(B.mh=Z(B.maxHeight,"y")-I-j,B.mh=B.h&&B.h<B.mh?B.h:B.mh),n=B.href,$=setTimeout(function(){L.show().appendTo(b)},100),B.inline?(G(K).hide().insertBefore(e(n)[0]).one(h,function(){e(this).replaceWith(C.children())}),i(e(n))):B.iframe?i(" "):B.html?i(B.html):et(n)?(e(z=new Image).addClass(s+"Photo").error(function(){B.title=!1,i(G(K,"Error").html(B.imgError))}).load(function(){var e;z.onload=null,B.scalePhotos&&(r=function(){z.height-=z.height*e,z.width-=z.width*e},B.mw&&z.width>B.mw&&(e=(z.width-B.mw)/z.width,r()),B.mh&&z.height>B.mh&&(e=(z.height-B.mh)/z.height,r())),B.h&&(z.style.marginTop=Math.max(B.h-z.height,0)/2+"px"),T[1]&&(B.loop||T[U+1])&&(z.style.cursor="pointer",z.onclick=function(){J.next()}),p&&(z.style.msInterpolationMode="bicubic"),setTimeout(function(){i(z)},1)}),setTimeout(function(){z.src=n},1)):n&&k.load(n,B.data,function(t,n,r){i(n==="error"?G(K,"Error").html(B.xhrError):e(this).contents())})},J.next=function(){!X&&T[1]&&(B.loop||T[U+1])&&(U=Y(1),J.load())},J.prev=function(){!X&&T[1]&&(B.loop||U)&&(U=Y(-1),J.load())},J.close=function(){W&&!V&&(V=!0,W=!1,it(l,B.onCleanup),N.unbind("."+s+" ."+v),m.fadeTo(200,0),g.stop().fadeTo(300,0,function(){g.add(m).css({opacity:1,cursor:"auto"}).hide(),it(h),C.remove(),setTimeout(function(){V=!1,it(c,B.onClosed)},1)}))},J.remove=function(){e([]).add(g).add(m).remove(),g=null,e("."+o).removeData(i).removeClass(o).die()},J.element=function(){return e(R)},J.settings=r})(jQuery,document,this);
1
+ /*!
2
+ Colorbox v1.4.33 - 2013-10-31
3
+ jQuery lightbox and modal window plugin
4
+ (c) 2013 Jack Moore - http://www.jacklmoore.com/colorbox
5
+ license: http://www.opensource.org/licenses/mit-license.php
6
+ */
7
+ (function(e,t,i){function o(i,o,n){var r=t.createElement(i);return o&&(r.id=Z+o),n&&(r.style.cssText=n),e(r)}function n(){return i.innerHeight?i.innerHeight:e(i).height()}function r(e){var t=k.length,i=(z+e)%t;return 0>i?t+i:i}function h(e,t){return Math.round((/%/.test(e)?("x"===t?E.width():n())/100:1)*parseInt(e,10))}function l(e,t){return e.photo||e.photoRegex.test(t)}function s(e,t){return e.retinaUrl&&i.devicePixelRatio>1?t.replace(e.photoRegex,e.retinaSuffix):t}function a(e){"contains"in g[0]&&!g[0].contains(e.target)&&(e.stopPropagation(),g.focus())}function d(){var t,i=e.data(N,Y);null==i?(B=e.extend({},X),console&&console.log&&console.log("Error: cboxElement missing settings object")):B=e.extend({},i);for(t in B)e.isFunction(B[t])&&"on"!==t.slice(0,2)&&(B[t]=B[t].call(N));B.rel=B.rel||N.rel||e(N).data("rel")||"nofollow",B.href=B.href||e(N).attr("href"),B.title=B.title||N.title,"string"==typeof B.href&&(B.href=e.trim(B.href))}function c(i,o){e(t).trigger(i),lt.triggerHandler(i),e.isFunction(o)&&o.call(N)}function u(i){q||(N=i,d(),k=e(N),z=0,"nofollow"!==B.rel&&(k=e("."+et).filter(function(){var t,i=e.data(this,Y);return i&&(t=e(this).data("rel")||i.rel||this.rel),t===B.rel}),z=k.index(N),-1===z&&(k=k.add(N),z=k.length-1)),w.css({opacity:parseFloat(B.opacity),cursor:B.overlayClose?"pointer":"auto",visibility:"visible"}).show(),J&&g.add(w).removeClass(J),B.className&&g.add(w).addClass(B.className),J=B.className,B.closeButton?K.html(B.close).appendTo(y):K.appendTo("<div/>"),U||(U=$=!0,g.css({visibility:"hidden",display:"block"}),H=o(st,"LoadedContent","width:0; height:0; overflow:hidden"),y.css({width:"",height:""}).append(H),O=x.height()+C.height()+y.outerHeight(!0)-y.height(),_=b.width()+T.width()+y.outerWidth(!0)-y.width(),D=H.outerHeight(!0),A=H.outerWidth(!0),B.w=h(B.initialWidth,"x"),B.h=h(B.initialHeight,"y"),H.css({width:"",height:B.h}),Q.position(),c(tt,B.onOpen),P.add(L).hide(),g.focus(),B.trapFocus&&t.addEventListener&&(t.addEventListener("focus",a,!0),lt.one(rt,function(){t.removeEventListener("focus",a,!0)})),B.returnFocus&&lt.one(rt,function(){e(N).focus()})),m())}function f(){!g&&t.body&&(V=!1,E=e(i),g=o(st).attr({id:Y,"class":e.support.opacity===!1?Z+"IE":"",role:"dialog",tabindex:"-1"}).hide(),w=o(st,"Overlay").hide(),F=e([o(st,"LoadingOverlay")[0],o(st,"LoadingGraphic")[0]]),v=o(st,"Wrapper"),y=o(st,"Content").append(L=o(st,"Title"),S=o(st,"Current"),I=e('<button type="button"/>').attr({id:Z+"Previous"}),R=e('<button type="button"/>').attr({id:Z+"Next"}),M=o("button","Slideshow"),F),K=e('<button type="button"/>').attr({id:Z+"Close"}),v.append(o(st).append(o(st,"TopLeft"),x=o(st,"TopCenter"),o(st,"TopRight")),o(st,!1,"clear:left").append(b=o(st,"MiddleLeft"),y,T=o(st,"MiddleRight")),o(st,!1,"clear:left").append(o(st,"BottomLeft"),C=o(st,"BottomCenter"),o(st,"BottomRight"))).find("div div").css({"float":"left"}),W=o(st,!1,"position:absolute; width:9999px; visibility:hidden; display:none; max-width:none;"),P=R.add(I).add(S).add(M),e(t.body).append(w,g.append(v,W)))}function p(){function i(e){e.which>1||e.shiftKey||e.altKey||e.metaKey||e.ctrlKey||(e.preventDefault(),u(this))}return g?(V||(V=!0,R.click(function(){Q.next()}),I.click(function(){Q.prev()}),K.click(function(){Q.close()}),w.click(function(){B.overlayClose&&Q.close()}),e(t).bind("keydown."+Z,function(e){var t=e.keyCode;U&&B.escKey&&27===t&&(e.preventDefault(),Q.close()),U&&B.arrowKey&&k[1]&&!e.altKey&&(37===t?(e.preventDefault(),I.click()):39===t&&(e.preventDefault(),R.click()))}),e.isFunction(e.fn.on)?e(t).on("click."+Z,"."+et,i):e("."+et).live("click."+Z,i)),!0):!1}function m(){var n,r,a,u=Q.prep,f=++at;$=!0,j=!1,N=k[z],d(),c(ht),c(it,B.onLoad),B.h=B.height?h(B.height,"y")-D-O:B.innerHeight&&h(B.innerHeight,"y"),B.w=B.width?h(B.width,"x")-A-_:B.innerWidth&&h(B.innerWidth,"x"),B.mw=B.w,B.mh=B.h,B.maxWidth&&(B.mw=h(B.maxWidth,"x")-A-_,B.mw=B.w&&B.w<B.mw?B.w:B.mw),B.maxHeight&&(B.mh=h(B.maxHeight,"y")-D-O,B.mh=B.h&&B.h<B.mh?B.h:B.mh),n=B.href,G=setTimeout(function(){F.show()},100),B.inline?(a=o(st).hide().insertBefore(e(n)[0]),lt.one(ht,function(){a.replaceWith(H.children())}),u(e(n))):B.iframe?u(" "):B.html?u(B.html):l(B,n)?(n=s(B,n),j=t.createElement("img"),e(j).addClass(Z+"Photo").bind("error",function(){B.title=!1,u(o(st,"Error").html(B.imgError))}).one("load",function(){var t;f===at&&(e.each(["alt","longdesc","aria-describedby"],function(t,i){var o=e(N).attr(i)||e(N).attr("data-"+i);o&&j.setAttribute(i,o)}),B.retinaImage&&i.devicePixelRatio>1&&(j.height=j.height/i.devicePixelRatio,j.width=j.width/i.devicePixelRatio),B.scalePhotos&&(r=function(){j.height-=j.height*t,j.width-=j.width*t},B.mw&&j.width>B.mw&&(t=(j.width-B.mw)/j.width,r()),B.mh&&j.height>B.mh&&(t=(j.height-B.mh)/j.height,r())),B.h&&(j.style.marginTop=Math.max(B.mh-j.height,0)/2+"px"),k[1]&&(B.loop||k[z+1])&&(j.style.cursor="pointer",j.onclick=function(){Q.next()}),j.style.width=j.width+"px",j.style.height=j.height+"px",setTimeout(function(){u(j)},1))}),setTimeout(function(){j.src=n},1)):n&&W.load(n,B.data,function(t,i){f===at&&u("error"===i?o(st,"Error").html(B.xhrError):e(this).contents())})}var w,g,v,y,x,b,T,C,k,E,H,W,F,L,S,M,R,I,K,P,B,O,_,D,A,N,z,j,U,$,q,G,Q,J,V,X={html:!1,photo:!1,iframe:!1,inline:!1,transition:"elastic",speed:300,fadeOut:300,width:!1,initialWidth:"600",innerWidth:!1,maxWidth:!1,height:!1,initialHeight:"450",innerHeight:!1,maxHeight:!1,scalePhotos:!0,scrolling:!0,href:!1,title:!1,rel:!1,opacity:.9,preloading:!0,className:!1,overlayClose:!0,escKey:!0,arrowKey:!0,top:!1,bottom:!1,left:!1,right:!1,fixed:!1,data:void 0,closeButton:!0,fastIframe:!0,open:!1,reposition:!0,loop:!0,slideshow:!1,slideshowAuto:!0,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",photoRegex:/\.(gif|png|jp(e|g|eg)|bmp|ico|webp)((#|\?).*)?#x2F;i,retinaImage:!1,retinaUrl:!1,retinaSuffix:"@2x.$1",current:"image {current} of {total}",previous:"previous",next:"next",close:"close",xhrError:"This content failed to load.",imgError:"This image failed to load.",returnFocus:!0,trapFocus:!0,onOpen:!1,onLoad:!1,onComplete:!1,onCleanup:!1,onClosed:!1},Y="colorbox",Z="cbox",et=Z+"Element",tt=Z+"_open",it=Z+"_load",ot=Z+"_complete",nt=Z+"_cleanup",rt=Z+"_closed",ht=Z+"_purge",lt=e("<a/>"),st="div",at=0,dt={},ct=function(){function e(){clearTimeout(h)}function t(){(B.loop||k[z+1])&&(e(),h=setTimeout(Q.next,B.slideshowSpeed))}function i(){M.html(B.slideshowStop).unbind(s).one(s,o),lt.bind(ot,t).bind(it,e),g.removeClass(l+"off").addClass(l+"on")}function o(){e(),lt.unbind(ot,t).unbind(it,e),M.html(B.slideshowStart).unbind(s).one(s,function(){Q.next(),i()}),g.removeClass(l+"on").addClass(l+"off")}function n(){r=!1,M.hide(),e(),lt.unbind(ot,t).unbind(it,e),g.removeClass(l+"off "+l+"on")}var r,h,l=Z+"Slideshow_",s="click."+Z;return function(){r?B.slideshow||(lt.unbind(nt,n),n()):B.slideshow&&k[1]&&(r=!0,lt.one(nt,n),B.slideshowAuto?i():o(),M.show())}}();e.colorbox||(e(f),Q=e.fn[Y]=e[Y]=function(t,i){var o=this;if(t=t||{},f(),p()){if(e.isFunction(o))o=e("<a/>"),t.open=!0;else if(!o[0])return o;i&&(t.onComplete=i),o.each(function(){e.data(this,Y,e.extend({},e.data(this,Y)||X,t))}).addClass(et),(e.isFunction(t.open)&&t.open.call(o)||t.open)&&u(o[0])}return o},Q.position=function(t,i){function o(){x[0].style.width=C[0].style.width=y[0].style.width=parseInt(g[0].style.width,10)-_+"px",y[0].style.height=b[0].style.height=T[0].style.height=parseInt(g[0].style.height,10)-O+"px"}var r,l,s,a=0,d=0,c=g.offset();if(E.unbind("resize."+Z),g.css({top:-9e4,left:-9e4}),l=E.scrollTop(),s=E.scrollLeft(),B.fixed?(c.top-=l,c.left-=s,g.css({position:"fixed"})):(a=l,d=s,g.css({position:"absolute"})),d+=B.right!==!1?Math.max(E.width()-B.w-A-_-h(B.right,"x"),0):B.left!==!1?h(B.left,"x"):Math.round(Math.max(E.width()-B.w-A-_,0)/2),a+=B.bottom!==!1?Math.max(n()-B.h-D-O-h(B.bottom,"y"),0):B.top!==!1?h(B.top,"y"):Math.round(Math.max(n()-B.h-D-O,0)/2),g.css({top:c.top,left:c.left,visibility:"visible"}),v[0].style.width=v[0].style.height="9999px",r={width:B.w+A+_,height:B.h+D+O,top:a,left:d},t){var u=0;e.each(r,function(e){return r[e]!==dt[e]?(u=t,void 0):void 0}),t=u}dt=r,t||g.css(r),g.dequeue().animate(r,{duration:t||0,complete:function(){o(),$=!1,v[0].style.width=B.w+A+_+"px",v[0].style.height=B.h+D+O+"px",B.reposition&&setTimeout(function(){E.bind("resize."+Z,Q.position)},1),i&&i()},step:o})},Q.resize=function(e){var t;U&&(e=e||{},e.width&&(B.w=h(e.width,"x")-A-_),e.innerWidth&&(B.w=h(e.innerWidth,"x")),H.css({width:B.w}),e.height&&(B.h=h(e.height,"y")-D-O),e.innerHeight&&(B.h=h(e.innerHeight,"y")),e.innerHeight||e.height||(t=H.scrollTop(),H.css({height:"auto"}),B.h=H.height()),H.css({height:B.h}),t&&H.scrollTop(t),Q.position("none"===B.transition?0:B.speed))},Q.prep=function(i){function n(){return B.w=B.w||H.width(),B.w=B.mw&&B.mw<B.w?B.mw:B.w,B.w}function h(){return B.h=B.h||H.height(),B.h=B.mh&&B.mh<B.h?B.mh:B.h,B.h}if(U){var a,d="none"===B.transition?0:B.speed;H.empty().remove(),H=o(st,"LoadedContent").append(i),H.hide().appendTo(W.show()).css({width:n(),overflow:B.scrolling?"auto":"hidden"}).css({height:h()}).prependTo(y),W.hide(),e(j).css({"float":"none"}),a=function(){function i(){e.support.opacity===!1&&g[0].style.removeAttribute("filter")}var n,h,a=k.length,u="frameBorder",f="allowTransparency";U&&(h=function(){clearTimeout(G),F.hide(),c(ot,B.onComplete)},L.html(B.title).add(H).show(),a>1?("string"==typeof B.current&&S.html(B.current.replace("{current}",z+1).replace("{total}",a)).show(),R[B.loop||a-1>z?"show":"hide"]().html(B.next),I[B.loop||z?"show":"hide"]().html(B.previous),ct(),B.preloading&&e.each([r(-1),r(1)],function(){var i,o,n=k[this],r=e.data(n,Y);r&&r.href?(i=r.href,e.isFunction(i)&&(i=i.call(n))):i=e(n).attr("href"),i&&l(r,i)&&(i=s(r,i),o=t.createElement("img"),o.src=i)})):P.hide(),B.iframe?(n=o("iframe")[0],u in n&&(n[u]=0),f in n&&(n[f]="true"),B.scrolling||(n.scrolling="no"),e(n).attr({src:B.href,name:(new Date).getTime(),"class":Z+"Iframe",allowFullScreen:!0,webkitAllowFullScreen:!0,mozallowfullscreen:!0}).one("load",h).appendTo(H),lt.one(ht,function(){n.src="//about:blank"}),B.fastIframe&&e(n).trigger("load")):h(),"fade"===B.transition?g.fadeTo(d,1,i):i())},"fade"===B.transition?g.fadeTo(d,0,function(){Q.position(0,a)}):Q.position(d,a)}},Q.next=function(){!amp;&k[1]&&(B.loop||k[z+1])&&(z=r(1),u(k[z]))},Q.prev=function(){!amp;&k[1]&&(B.loop||z)&&(z=r(-1),u(k[z]))},Q.close=function(){U&&!q&&(q=!0,U=!1,c(nt,B.onCleanup),E.unbind("."+Z),w.fadeTo(B.fadeOut||0,0),g.stop().fadeTo(B.fadeOut||0,0,function(){g.add(w).css({opacity:1,cursor:"auto"}).hide(),c(ht),H.empty().remove(),setTimeout(function(){q=!1,c(rt,B.onClosed)},1)}))},Q.remove=function(){g&&(g.stop(),e.colorbox.close(),g.stop().remove(),w.remove(),q=!1,g=null,e("."+et).removeData(Y).removeClass(et),e(t).unbind("click."+Z))},Q.element=function(){return e(N)},Q.settings=X)})(jQuery,document,window);
js/jquery.colorbox.js CHANGED
@@ -1,13 +1,24 @@
1
- // ColorBox v1.3.20.1 - jQuery lightbox plugin
2
- // (c) 2012 Jack Moore - jacklmoore.com
3
- // License: http://www.opensource.org/licenses/mit-license.php
4
(function ($, document, window) {
5
var
6
// Default settings object.
7
// See http://jacklmoore.com/colorbox for details.
8
defaults = {
9
transition: "elastic",
10
speed: 300,
11
width: false,
12
initialWidth: "600",
13
innerWidth: false,
@@ -18,17 +29,39 @@
18
maxHeight: false,
19
scalePhotos: true,
20
scrolling: true,
21
- inline: false,
22
- html: false,
23
- iframe: false,
24
- fastIframe: true,
25
- photo: false,
26
href: false,
27
title: false,
28
rel: false,
29
opacity: 0.9,
30
preloading: true,
31
32
current: "image {current} of {total}",
33
previous: "previous",
34
next: "next",
@@ -36,29 +69,16 @@
36
xhrError: "This content failed to load.",
37
imgError: "This image failed to load.",
38
39
- open: false,
40
returnFocus: true,
41
- reposition: true,
42
- loop: true,
43
- slideshow: false,
44
- slideshowAuto: true,
45
- slideshowSpeed: 2500,
46
- slideshowStart: "start slideshow",
47
- slideshowStop: "stop slideshow",
48
onOpen: false,
49
onLoad: false,
50
onComplete: false,
51
onCleanup: false,
52
- onClosed: false,
53
- overlayClose: true,
54
- escKey: true,
55
- arrowKey: true,
56
- top: false,
57
- bottom: false,
58
- left: false,
59
- right: false,
60
- fixed: false,
61
- data: undefined
62
},
63
64
// Abstracting the HTML and event identifiers for easy rebranding
@@ -73,11 +93,6 @@
73
event_cleanup = prefix + '_cleanup',
74
event_closed = prefix + '_closed',
75
event_purge = prefix + '_purge',
76
-
77
- // Special Handling for IE
78
- isIE = !$.support.opacity && !$.support.style, // IE7 & IE8
79
- isIE6 = isIE && !window.XMLHttpRequest, // IE6
80
- event_ie6 = prefix + '_IE6',
81
82
// Cached jQuery Object Variables
83
$overlay,
@@ -100,6 +115,7 @@
100
$prev,
101
$close,
102
$groupControls,
103
104
// Variables for cached values or use across multiple functions
105
settings,
@@ -116,13 +132,16 @@
116
loadingTimer,
117
publicMethod,
118
div = "div",
119
init;
120
121
// ****************
122
// HELPER FUNCTIONS
123
// ****************
124
125
- // Convience function for creating new jQuery objects
126
function $tag(tag, id, css) {
127
var element = document.createElement(tag);
128
@@ -136,6 +155,12 @@
136
137
return $(element);
138
}
139
140
// Determine the next and previous members in a group.
141
function getIndex(increment) {
@@ -148,23 +173,24 @@
148
149
// Convert '%' and 'px' values to integers
150
function setSize(size, dimension) {
151
- return Math.round((/%/.test(size) ? ((dimension === 'x' ? winWidth() : winHeight()) / 100) : 1) * parseInt(size, 10));
152
}
153
154
// Checks an href to see if it is a photo.
155
- // There is a force photo option (photo: true) for hrefs that cannot be matched by this regex.
156
- function isImage(url) {
157
- return settings.photo || /\.(gif|png|jp(e|g|eg)|bmp|ico)((#|\?).*)?#x2F;i.test(url);
158
}
159
-
160
- function winWidth() {
161
- // $(window).width() is incorrect for some mobile browsers, but
162
- // window.innerWidth is unsupported in IE8 and lower.
163
- return window.innerWidth || $window.width();
164
}
165
166
- function winHeight() {
167
- return window.innerHeight || $window.height();
168
}
169
170
// Assigns function results to their respective properties
@@ -187,7 +213,7 @@
187
}
188
}
189
190
- settings.rel = settings.rel || element.rel || 'nofollow';
191
settings.href = settings.href || $(element).attr('href');
192
settings.title = settings.title || element.title;
193
@@ -197,61 +223,98 @@
197
}
198
199
function trigger(event, callback) {
200
- $.event.trigger(event);
201
- if (callback) {
202
callback.call(element);
203
}
204
}
205
206
- // Slideshow functionality
207
- function slideshow() {
208
- var
209
- timeOut,
210
- className = prefix + "Slideshow_",
211
- click = "click." + prefix,
212
- start,
213
- stop,
214
- clear;
215
-
216
- if (settings.slideshow && $related[1]) {
217
- start = function () {
218
- $slideshow
219
- .text(settings.slideshowStop)
220
- .unbind(click)
221
- .bind(event_complete, function () {
222
- if (settings.loop || $related[index + 1]) {
223
- timeOut = setTimeout(publicMethod.next, settings.slideshowSpeed);
224
- }
225
- })
226
- .bind(event_load, function () {
227
- clearTimeout(timeOut);
228
- })
229
- .one(click + ' ' + event_cleanup, stop);
230
- $box.removeClass(className + "off").addClass(className + "on");
231
timeOut = setTimeout(publicMethod.next, settings.slideshowSpeed);
232
- };
233
-
234
- stop = function () {
235
- clearTimeout(timeOut);
236
- $slideshow
237
- .text(settings.slideshowStart)
238
- .unbind([event_complete, event_load, event_cleanup, click].join(' '))
239
- .one(click, function () {
240
- publicMethod.next();
241
- start();
242
- });
243
- $box.removeClass(className + "on").addClass(className + "off");
244
- };
245
-
246
- if (settings.slideshowAuto) {
247
- start();
248
- } else {
249
- stop();
250
}
251
- } else {
252
$box.removeClass(className + "off " + className + "on");
253
}
254
- }
255
256
function launch(target) {
257
if (!closing) {
@@ -270,78 +333,119 @@
270
relRelated;
271
272
if (data) {
273
- relRelated = data.rel || this.rel;
274
}
275
276
return (relRelated === settings.rel);
277
});
278
index = $related.index(element);
279
280
- // Check direct calls to ColorBox.
281
if (index === -1) {
282
$related = $related.add(element);
283
index = $related.length - 1;
284
}
285
}
286
287
if (!open) {
288
open = active = true; // Prevents the page-change action from queuing up if the visitor holds down the left or right keys.
289
290
- $box.show();
291
292
- if (settings.returnFocus) {
293
- $(element).blur().one(event_closed, function () {
294
- $(this).focus();
295
- });
296
- }
297
-
298
- // +settings.opacity avoids a problem in IE when using non-zero-prefixed-string-values, like '.5'
299
- $overlay.css({"opacity": +settings.opacity, "cursor": settings.overlayClose ? "pointer" : "auto"}).show();
300
-
301
- // Opens inital empty ColorBox prior to content being loaded.
302
settings.w = setSize(settings.initialWidth, 'x');
303
settings.h = setSize(settings.initialHeight, 'y');
304
publicMethod.position();
305
-
306
- if (isIE6) {
307
- $window.bind('resize.' + event_ie6 + ' scroll.' + event_ie6, function () {
308
- $overlay.css({width: winWidth(), height: winHeight(), top: $window.scrollTop(), left: $window.scrollLeft()});
309
- }).trigger('resize.' + event_ie6);
310
- }
311
-
312
trigger(event_open, settings.onOpen);
313
314
$groupControls.add($title).hide();
315
316
- $close.html(settings.close).show();
317
}
318
-
319
- publicMethod.load(true);
320
}
321
}
322
323
- // ColorBox's markup needs to be added to the DOM prior to being called
324
// so that the browser will go ahead and load the CSS background images.
325
function appendHTML() {
326
if (!$box && document.body) {
327
init = false;
328
-
329
$window = $(window);
330
- $box = $tag(div).attr({id: colorbox, 'class': isIE ? prefix + (isIE6 ? 'IE6' : 'IE') : ''}).hide();
331
- $overlay = $tag(div, "Overlay", isIE6 ? 'position:absolute' : '').hide();
332
- $loadingOverlay = $tag(div, "LoadingOverlay").add($tag(div, "LoadingGraphic"));
333
$wrap = $tag(div, "Wrapper");
334
$content = $tag(div, "Content").append(
335
- $loaded = $tag(div, "LoadedContent", 'width:0; height:0; overflow:hidden'),
336
$title = $tag(div, "Title"),
337
$current = $tag(div, "Current"),
338
- $next = $tag(div, "Next"),
339
- $prev = $tag(div, "Previous"),
340
- $slideshow = $tag(div, "Slideshow").bind(event_open, slideshow),
341
- $close = $tag(div, "Close")
342
);
343
344
- $wrap.append( // The 3x3 Grid that makes up ColorBox
345
$tag(div).append(
346
$tag(div, "TopLeft"),
347
$topBorder = $tag(div, "TopCenter"),
@@ -359,7 +463,7 @@
359
)
360
).find('div div').css({'float': 'left'});
361
362
- $loadingBay = $tag(div, false, 'position:absolute; width:9999px; visibility:hidden; display:none');
363
364
$groupControls = $next.add($prev).add($current).add($slideshow);
365
@@ -367,21 +471,21 @@
367
}
368
}
369
370
- // Add ColorBox's event bindings
371
function addBindings() {
372
if ($box) {
373
if (!init) {
374
init = true;
375
376
- // Cache values needed for size calculations
377
- interfaceHeight = $topBorder.height() + $bottomBorder.height() + $content.outerHeight(true) - $content.height();//Subtraction needed for IE6
378
- interfaceWidth = $leftBorder.width() + $rightBorder.width() + $content.outerWidth(true) - $content.width();
379
- loadedHeight = $loaded.outerHeight(true);
380
- loadedWidth = $loaded.outerWidth(true);
381
-
382
- // Setting padding to remove the need to do size conversions during the animation step.
383
- $box.css({"padding-bottom": interfaceHeight, "padding-right": interfaceWidth});
384
-
385
// Anonymous functions here keep the public method from being cached, thereby allowing them to be redefined on the fly.
386
$next.click(function () {
387
publicMethod.next();
@@ -405,7 +509,7 @@
405
e.preventDefault();
406
publicMethod.close();
407
}
408
- if (open && settings.arrowKey && $related[1]) {
409
if (key === 37) {
410
e.preventDefault();
411
$prev.click();
@@ -416,21 +520,22 @@
416
}
417
});
418
419
- $('.' + boxElement, document).live('click', function (e) {
420
- // ignore non-left-mouse-clicks and clicks modified with ctrl / command, shift, or alt.
421
- // See: http://jacklmoore.com/notes/click-events/
422
- if (!(e.which > 1 || e.shiftKey || e.altKey || e.metaKey)) {
423
- e.preventDefault();
424
- launch(this);
425
- }
426
- });
427
}
428
return true;
429
}
430
return false;
431
}
432
433
- // Don't do anything if ColorBox already exists.
434
if ($.colorbox) {
435
return;
436
}
@@ -441,8 +546,8 @@
441
442
// ****************
443
// PUBLIC FUNCTIONS
444
- // Usage format: $.fn.colorbox.close();
445
- // Usage from within an iframe: parent.$.fn.colorbox.close();
446
// ****************
447
448
publicMethod = $.fn[colorbox] = $[colorbox] = function (options, callback) {
@@ -453,13 +558,11 @@
453
appendHTML();
454
455
if (addBindings()) {
456
- if (!$this[0]) {
457
- if ($this.selector) { // if a selector was given and it didn't match any elements, go ahead and exit.
458
- return $this;
459
- }
460
- // if no selector was given (ie. $.colorbox()), create a temporary element to work with
461
$this = $('<a/>');
462
- options.open = true; // assume an immediate open
463
}
464
465
if (callback) {
@@ -495,7 +598,7 @@
495
scrollTop = $window.scrollTop();
496
scrollLeft = $window.scrollLeft();
497
498
- if (settings.fixed && !isIE6) {
499
offset.top -= scrollTop;
500
offset.left -= scrollLeft;
501
$box.css({position: 'fixed'});
@@ -507,44 +610,57 @@
507
508
// keeps the top and left positions within the browser's viewport.
509
if (settings.right !== false) {
510
- left += Math.max(winWidth() - settings.w - loadedWidth - interfaceWidth - setSize(settings.right, 'x'), 0);
511
} else if (settings.left !== false) {
512
left += setSize(settings.left, 'x');
513
} else {
514
- left += Math.round(Math.max(winWidth() - settings.w - loadedWidth - interfaceWidth, 0) / 2);
515
}
516
517
if (settings.bottom !== false) {
518
- top += Math.max(winHeight() - settings.h - loadedHeight - interfaceHeight - setSize(settings.bottom, 'y'), 0);
519
} else if (settings.top !== false) {
520
top += setSize(settings.top, 'y');
521
} else {
522
- top += Math.round(Math.max(winHeight() - settings.h - loadedHeight - interfaceHeight, 0) / 2);
523
}
524
525
- $box.css({top: offset.top, left: offset.left});
526
-
527
- // setting the speed to 0 to reduce the delay between same-sized content.
528
- speed = ($box.width() === settings.w + loadedWidth && $box.height() === settings.h + loadedHeight) ? 0 : speed || 0;
529
530
// this gives the wrapper plenty of breathing room so it's floated contents can move around smoothly,
531
// but it has to be shrank down around the size of div#colorbox when it's done. If not,
532
// it can invoke an obscure IE bug when using iframes.
533
$wrap[0].style.width = $wrap[0].style.height = "9999px";
534
535
- function modalDimensions(that) {
536
- $topBorder[0].style.width = $bottomBorder[0].style.width = $content[0].style.width = that.style.width;
537
- $content[0].style.height = $leftBorder[0].style.height = $rightBorder[0].style.height = that.style.height;
538
}
539
540
- css = {width: settings.w + loadedWidth, height: settings.h + loadedHeight, top: top, left: left};
541
- if(speed===0){ // temporary workaround to side-step jQuery-UI 1.8 bug (http://bugs.jquery.com/ticket/12273)
542
$box.css(css);
543
}
544
$box.dequeue().animate(css, {
545
- duration: speed,
546
complete: function () {
547
- modalDimensions(this);
548
549
active = false;
550
@@ -562,35 +678,45 @@
562
loadedCallback();
563
}
564
},
565
- step: function () {
566
- modalDimensions(this);
567
- }
568
});
569
};
570
571
publicMethod.resize = function (options) {
572
if (open) {
573
options = options || {};
574
575
if (options.width) {
576
settings.w = setSize(options.width, 'x') - loadedWidth - interfaceWidth;
577
}
578
if (options.innerWidth) {
579
settings.w = setSize(options.innerWidth, 'x');
580
}
581
$loaded.css({width: settings.w});
582
583
if (options.height) {
584
settings.h = setSize(options.height, 'y') - loadedHeight - interfaceHeight;
585
}
586
if (options.innerHeight) {
587
settings.h = setSize(options.innerHeight, 'y');
588
}
589
if (!options.innerHeight && !options.height) {
590
$loaded.css({height: "auto"});
591
settings.h = $loaded.height();
592
}
593
$loaded.css({height: settings.h});
594
595
publicMethod.position(settings.transition === "none" ? 0 : settings.speed);
596
}
@@ -602,8 +728,9 @@
602
}
603
604
var callback, speed = settings.transition === "none" ? 0 : settings.speed;
605
-
606
- $loaded.remove();
607
$loaded = $tag(div, 'LoadedContent').append(object);
608
609
function getWidth() {
@@ -626,54 +753,32 @@
626
$loadingBay.hide();
627
628
// floating the IMG removes the bottom line-height and fixed a problem where IE miscalculates the width of the parent element as 100% of the document width.
629
- //$(photo).css({'float': 'none', marginLeft: 'auto', marginRight: 'auto'});
630
631
$(photo).css({'float': 'none'});
632
-
633
- // Hides SELECT elements in IE6 because they would otherwise sit on top of the overlay.
634
- if (isIE6) {
635
- $('select').not($box.find('select')).filter(function () {
636
- return this.style.visibility !== 'hidden';
637
- }).css({'visibility': 'hidden'}).one(event_cleanup, function () {
638
- this.style.visibility = 'inherit';
639
- });
640
- }
641
-
642
callback = function () {
643
- var preload,
644
- i,
645
- total = $related.length,
646
iframe,
647
frameBorder = 'frameBorder',
648
allowTransparency = 'allowTransparency',
649
- complete,
650
- src,
651
- img,
652
- data;
653
654
if (!open) {
655
return;
656
}
657
658
- function removeFilter() {
659
- if (isIE) {
660
$box[0].style.removeAttribute('filter');
661
}
662
}
663
664
complete = function () {
665
clearTimeout(loadingTimer);
666
- // Detaching forces Andriod stock browser to redraw the area underneat the loading overlay. Hiding alone isn't enough.
667
- $loadingOverlay.detach().hide();
668
trigger(event_complete, settings.onComplete);
669
};
670
-
671
- if (isIE) {
672
- //This fadeIn helps the bicubic resampling to kick-in.
673
- if (photo) {
674
- $loaded.fadeIn(100);
675
- }
676
- }
677
678
$title.html(settings.title).add($loaded).show();
679
@@ -685,33 +790,31 @@
685
$next[(settings.loop || index < total - 1) ? "show" : "hide"]().html(settings.next);
686
$prev[(settings.loop || index) ? "show" : "hide"]().html(settings.previous);
687
688
- if (settings.slideshow) {
689
- $slideshow.show();
690
- }
691
692
// Preloads images within a rel group
693
if (settings.preloading) {
694
- preload = [
695
- getIndex(-1),
696
- getIndex(1)
697
- ];
698
- while (i = $related[preload.pop()]) {
699
- data = $.data(i, colorbox);
700
-
701
if (data && data.href) {
702
src = data.href;
703
if ($.isFunction(src)) {
704
src = src.call(i);
705
}
706
} else {
707
- src = i.href;
708
}
709
710
- if (isImage(src)) {
711
- img = new Image();
712
img.src = src;
713
}
714
- }
715
}
716
} else {
717
$groupControls.hide();
@@ -723,23 +826,34 @@
723
if (frameBorder in iframe) {
724
iframe[frameBorder] = 0;
725
}
726
if (allowTransparency in iframe) {
727
iframe[allowTransparency] = "true";
728
}
729
- // give the iframe a unique name to prevent caching
730
- iframe.name = prefix + (+new Date());
731
- if (settings.fastIframe) {
732
- complete();
733
- } else {
734
- $(iframe).one('load', complete);
735
- }
736
- iframe.src = settings.href;
737
if (!settings.scrolling) {
738
iframe.scrolling = "no";
739
}
740
- $(iframe).addClass(prefix + 'Iframe').appendTo($loaded).one(event_purge, function () {
741
iframe.src = "//about:blank";
742
});
743
} else {
744
complete();
745
}
@@ -760,8 +874,8 @@
760
}
761
};
762
763
- publicMethod.load = function (launched) {
764
- var href, setResize, prep = publicMethod.prep;
765
766
active = true;
767
@@ -769,9 +883,7 @@
769
770
element = $related[index];
771
772
- if (!launched) {
773
- makeSettings();
774
- }
775
776
trigger(event_purge);
777
@@ -803,15 +915,18 @@
803
href = settings.href;
804
805
loadingTimer = setTimeout(function () {
806
- $loadingOverlay.show().appendTo($content);
807
}, 100);
808
809
if (settings.inline) {
810
// Inserts an empty placeholder where inline content is being pulled from.
811
- // An event is bound to put inline content back when ColorBox closes or loads new content.
812
- $tag(div).hide().insertBefore($(href)[0]).one(event_purge, function () {
813
- $(this).replaceWith($loaded.children());
814
});
815
prep($(href));
816
} else if (settings.iframe) {
817
// IFrame element won't be added to the DOM until it is ready to be displayed,
@@ -819,17 +934,37 @@
819
prep(" ");
820
} else if (settings.html) {
821
prep(settings.html);
822
- } else if (isImage(href)) {
823
- $(photo = new Image())
824
.addClass(prefix + 'Photo')
825
- .error(function () {
826
settings.title = false;
827
prep($tag(div, 'Error').html(settings.imgError));
828
})
829
- .load(function () {
830
var percent;
831
- photo.onload = null; //stops animated gifs from firing the onload repeatedly.
832
-
833
if (settings.scalePhotos) {
834
setResize = function () {
835
photo.height -= photo.height * percent;
@@ -846,7 +981,7 @@
846
}
847
848
if (settings.h) {
849
- photo.style.marginTop = Math.max(settings.h - photo.height, 0) / 2 + 'px';
850
}
851
852
if ($related[1] && (settings.loop || $related[index + 1])) {
@@ -855,11 +990,10 @@
855
publicMethod.next();
856
};
857
}
858
-
859
- if (isIE) {
860
- photo.style.msInterpolationMode = 'bicubic';
861
- }
862
-
863
setTimeout(function () { // A pause because Chrome will sometimes report a 0 by 0 size otherwise.
864
prep(photo);
865
}, 1);
@@ -869,28 +1003,30 @@
869
photo.src = href;
870
}, 1);
871
} else if (href) {
872
- $loadingBay.load(href, settings.data, function (data, status, xhr) {
873
- prep(status === 'error' ? $tag(div, 'Error').html(settings.xhrError) : $(this).contents());
874
});
875
}
876
- };
877
878
// Navigates to the next page/image in a set.
879
publicMethod.next = function () {
880
if (!active && $related[1] && (settings.loop || $related[index + 1])) {
881
index = getIndex(1);
882
- publicMethod.load();
883
}
884
};
885
886
publicMethod.prev = function () {
887
if (!active && $related[1] && (settings.loop || index)) {
888
index = getIndex(-1);
889
- publicMethod.load();
890
}
891
};
892
893
- // Note: to use this within an iframe use the following format: parent.$.fn.colorbox.close();
894
publicMethod.close = function () {
895
if (open && !closing) {
896
@@ -900,17 +1036,17 @@
900
901
trigger(event_cleanup, settings.onCleanup);
902
903
- $window.unbind('.' + prefix + ' .' + event_ie6);
904
905
- $overlay.fadeTo(200, 0);
906
907
- $box.stop().fadeTo(300, 0, function () {
908
909
$box.add($overlay).css({'opacity': 1, cursor: 'auto'}).hide();
910
911
trigger(event_purge);
912
913
- $loaded.remove();
914
915
setTimeout(function () {
916
closing = false;
@@ -920,18 +1056,24 @@
920
}
921
};
922
923
- // Removes changes ColorBox made to the document, but does not remove the plugin
924
- // from jQuery.
925
publicMethod.remove = function () {
926
- $([]).add($box).add($overlay).remove();
927
$box = null;
928
$('.' + boxElement)
929
.removeData(colorbox)
930
- .removeClass(boxElement)
931
- .die();
932
};
933
934
- // A method for fetching the current element ColorBox is referencing.
935
// returns a jQuery object.
936
publicMethod.element = function () {
937
return $(element);
@@ -939,4 +1081,4 @@
939
940
publicMethod.settings = defaults;
941
942
- }(jQuery, document, this));
1
+ /*!
2
+ Colorbox v1.4.33 - 2013-10-31
3
+ jQuery lightbox and modal window plugin
4
+ (c) 2013 Jack Moore - http://www.jacklmoore.com/colorbox
5
+ license: http://www.opensource.org/licenses/mit-license.php
6
+ */
7
(function ($, document, window) {
8
var
9
// Default settings object.
10
// See http://jacklmoore.com/colorbox for details.
11
defaults = {
12
+ // data sources
13
+ html: false,
14
+ photo: false,
15
+ iframe: false,
16
+ inline: false,
17
+
18
+ // behavior and appearance
19
transition: "elastic",
20
speed: 300,
21
+ fadeOut: 300,
22
width: false,
23
initialWidth: "600",
24
innerWidth: false,
29
maxHeight: false,
30
scalePhotos: true,
31
scrolling: true,
32
href: false,
33
title: false,
34
rel: false,
35
opacity: 0.9,
36
preloading: true,
37
+ className: false,
38
+ overlayClose: true,
39
+ escKey: true,
40
+ arrowKey: true,
41
+ top: false,
42
+ bottom: false,
43
+ left: false,
44
+ right: false,
45
+ fixed: false,
46
+ data: undefined,
47
+ closeButton: true,
48
+ fastIframe: true,
49
+ open: false,
50
+ reposition: true,
51
+ loop: true,
52
+ slideshow: false,
53
+ slideshowAuto: true,
54
+ slideshowSpeed: 2500,
55
+ slideshowStart: "start slideshow",
56
+ slideshowStop: "stop slideshow",
57
+ photoRegex: /\.(gif|png|jp(e|g|eg)|bmp|ico|webp)((#|\?).*)?#x2F;i,
58
+
59
+ // alternate image paths for high-res displays
60
+ retinaImage: false,
61
+ retinaUrl: false,
62
+ retinaSuffix: '@2x.$1',
63
64
+ // internationalization
65
current: "image {current} of {total}",
66
previous: "previous",
67
next: "next",
69
xhrError: "This content failed to load.",
70
imgError: "This image failed to load.",
71
72
+ // accessbility
73
returnFocus: true,
74
+ trapFocus: true,
75
+
76
+ // callbacks
77
onOpen: false,
78
onLoad: false,
79
onComplete: false,
80
onCleanup: false,
81
+ onClosed: false
82
},
83
84
// Abstracting the HTML and event identifiers for easy rebranding
93
event_cleanup = prefix + '_cleanup',
94
event_closed = prefix + '_closed',
95
event_purge = prefix + '_purge',
96
97
// Cached jQuery Object Variables
98
$overlay,
115
$prev,
116
$close,
117
$groupControls,
118
+ $events = $('<a/>'), // $([]) would be prefered, but there is an issue with jQuery 1.4.2
119
120
// Variables for cached values or use across multiple functions
121
settings,
132
loadingTimer,
133
publicMethod,
134
div = "div",
135
+ className,
136
+ requests = 0,
137
+ previousCSS = {},
138
init;
139
140
// ****************
141
// HELPER FUNCTIONS
142
// ****************
143
144
+ // Convenience function for creating new jQuery objects
145
function $tag(tag, id, css) {
146
var element = document.createElement(tag);
147
155
156
return $(element);
157
}
158
+
159
+ // Get the window height using innerHeight when available to avoid an issue with iOS
160
+ // http://bugs.jquery.com/ticket/6724
161
+ function winheight() {
162
+ return window.innerHeight ? window.innerHeight : $(window).height();
163
+ }
164
165
// Determine the next and previous members in a group.
166
function getIndex(increment) {
173
174
// Convert '%' and 'px' values to integers
175
function setSize(size, dimension) {
176
+ return Math.round((/%/.test(size) ? ((dimension === 'x' ? $window.width() : winheight()) / 100) : 1) * parseInt(size, 10));
177
}
178
179
// Checks an href to see if it is a photo.
180
+ // There is a force photo option (photo: true) for hrefs that cannot be matched by the regex.
181
+ function isImage(settings, url) {
182
+ return settings.photo || settings.photoRegex.test(url);
183
}
184
+
185
+ function retinaUrl(settings, url) {
186
+ return settings.retinaUrl && window.devicePixelRatio > 1 ? url.replace(settings.photoRegex, settings.retinaSuffix) : url;
187
}
188
189
+ function trapFocus(e) {
190
+ if ('contains' in $box[0] && !$box[0].contains(e.target)) {
191
+ e.stopPropagation();
192
+ $box.focus();
193
+ }
194
}
195
196
// Assigns function results to their respective properties
213
}
214
}
215
216
+ settings.rel = settings.rel || element.rel || $(element).data('rel') || 'nofollow';
217
settings.href = settings.href || $(element).attr('href');
218
settings.title = settings.title || element.title;
219
223
}
224
225
function trigger(event, callback) {
226
+ // for external use
227
+ $(document).trigger(event);
228
+
229
+ // for internal use
230
+ $events.triggerHandler(event);
231
+
232
+ if ($.isFunction(callback)) {
233
callback.call(element);
234
}
235
}
236
237
+
238
+ var slideshow = (function(){
239
+ var active,
240
+ className = prefix + "Slideshow_",
241
+ click = "click." + prefix,
242
+ timeOut;
243
+
244
+ function clear () {
245
+ clearTimeout(timeOut);
246
+ }
247
+
248
+ function set() {
249
+ if (settings.loop || $related[index + 1]) {
250
+ clear();
251
timeOut = setTimeout(publicMethod.next, settings.slideshowSpeed);
252
}
253
+ }
254
+
255
+ function start() {
256
+ $slideshow
257
+ .html(settings.slideshowStop)
258
+ .unbind(click)
259
+ .one(click, stop);
260
+
261
+ $events
262
+ .bind(event_complete, set)
263
+ .bind(event_load, clear);
264
+
265
+ $box.removeClass(className + "off").addClass(className + "on");
266
+ }
267
+
268
+ function stop() {
269
+ clear();
270
+
271
+ $events
272
+ .unbind(event_complete, set)
273
+ .unbind(event_load, clear);
274
+
275
+ $slideshow
276
+ .html(settings.slideshowStart)
277
+ .unbind(click)
278
+ .one(click, function () {
279
+ publicMethod.next();
280
+ start();
281
+ });
282
+
283
+ $box.removeClass(className + "on").addClass(className + "off");
284
+ }
285
+
286
+ function reset() {
287
+ active = false;
288
+ $slideshow.hide();
289
+ clear();
290
+ $events
291
+ .unbind(event_complete, set)
292
+ .unbind(event_load, clear);
293
$box.removeClass(className + "off " + className + "on");
294
}
295
+
296
+ return function(){
297
+ if (active) {
298
+ if (!settings.slideshow) {
299
+ $events.unbind(event_cleanup, reset);
300
+ reset();
301
+ }
302
+ } else {
303
+ if (settings.slideshow && $related[1]) {
304
+ active = true;
305
+ $events.one(event_cleanup, reset);
306
+ if (settings.slideshowAuto) {
307
+ start();
308
+ } else {
309
+ stop();
310
+ }
311
+ $slideshow.show();
312
+ }
313
+ }
314
+ };
315
+
316
+ }());
317
+
318
319
function launch(target) {
320
if (!closing) {
333
relRelated;
334
335
if (data) {
336
+ relRelated = $(this).data('rel') || data.rel || this.rel;
337
}
338
339
return (relRelated === settings.rel);
340
});
341
index = $related.index(element);
342
343
+ // Check direct calls to Colorbox.
344
if (index === -1) {
345
$related = $related.add(element);
346
index = $related.length - 1;
347
}
348
}
349
350
+ $overlay.css({
351
+ opacity: parseFloat(settings.opacity),
352
+ cursor: settings.overlayClose ? "pointer" : "auto",
353
+ visibility: 'visible'
354
+ }).show();
355
+
356
+
357
+ if (className) {
358
+ $box.add($overlay).removeClass(className);
359
+ }
360
+ if (settings.className) {
361
+ $box.add($overlay).addClass(settings.className);
362
+ }
363
+ className = settings.className;
364
+
365
+ if (settings.closeButton) {
366
+ $close.html(settings.close).appendTo($content);
367
+ } else {
368
+ $close.appendTo('<div/>');
369
+ }
370
+
371
if (!open) {
372
open = active = true; // Prevents the page-change action from queuing up if the visitor holds down the left or right keys.
373
374
+ // Show colorbox so the sizes can be calculated in older versions of jQuery
375
+ $box.css({visibility:'hidden', display:'block'});
376
377
+ $loaded = $tag(div, 'LoadedContent', 'width:0; height:0; overflow:hidden');
378
+ $content.css({width:'', height:''}).append($loaded);
379
+
380
+ // Cache values needed for size calculations
381
+ interfaceHeight = $topBorder.height() + $bottomBorder.height() + $content.outerHeight(true) - $content.height();
382
+ interfaceWidth = $leftBorder.width() + $rightBorder.width() + $content.outerWidth(true) - $content.width();
383
+ loadedHeight = $loaded.outerHeight(true);
384
+ loadedWidth = $loaded.outerWidth(true);
385
+
386
+ // Opens inital empty Colorbox prior to content being loaded.
387
settings.w = setSize(settings.initialWidth, 'x');
388
settings.h = setSize(settings.initialHeight, 'y');
389
+ $loaded.css({width:'', height:settings.h});
390
publicMethod.position();
391
+
392
trigger(event_open, settings.onOpen);
393
394
$groupControls.add($title).hide();
395
+
396
+ $box.focus();
397
398
+ if (settings.trapFocus) {
399
+ // Confine focus to the modal
400
+ // Uses event capturing that is not supported in IE8-
401
+ if (document.addEventListener) {
402
+
403
+ document.addEventListener('focus', trapFocus, true);
404
+
405
+ $events.one(event_closed, function () {
406
+ document.removeEventListener('focus', trapFocus, true);
407
+ });
408
+ }
409
+ }
410
+
411
+ // Return focus on closing
412
+ if (settings.returnFocus) {
413
+ $events.one(event_closed, function () {
414
+ $(element).focus();
415
+ });
416
+ }
417
}
418
+ load();
419
}
420
}
421
422
+ // Colorbox's markup needs to be added to the DOM prior to being called
423
// so that the browser will go ahead and load the CSS background images.
424
function appendHTML() {
425
if (!$box && document.body) {
426
init = false;
427
$window = $(window);
428
+ $box = $tag(div).attr({
429
+ id: colorbox,
430
+ 'class': $.support.opacity === false ? prefix + 'IE' : '', // class for optional IE8 & lower targeted CSS.
431
+ role: 'dialog',
432
+ tabindex: '-1'
433
+ }).hide();
434
+ $overlay = $tag(div, "Overlay").hide();
435
+ $loadingOverlay = $([$tag(div, "LoadingOverlay")[0],$tag(div, "LoadingGraphic")[0]]);
436
$wrap = $tag(div, "Wrapper");
437
$content = $tag(div, "Content").append(
438
$title = $tag(div, "Title"),
439
$current = $tag(div, "Current"),
440
+ $prev = $('<button type="button"/>').attr({id:prefix+'Previous'}),
441
+ $next = $('<button type="button"/>').attr({id:prefix+'Next'}),
442
+ $slideshow = $tag('button', "Slideshow"),
443
+ $loadingOverlay
444
);
445
+
446
+ $close = $('<button type="button"/>').attr({id:prefix+'Close'});
447
448
+ $wrap.append( // The 3x3 Grid that makes up Colorbox
449
$tag(div).append(
450
$tag(div, "TopLeft"),
451
$topBorder = $tag(div, "TopCenter"),
463
)
464
).find('div div').css({'float': 'left'});
465
466
+ $loadingBay = $tag(div, false, 'position:absolute; width:9999px; visibility:hidden; display:none; max-width:none;');
467
468
$groupControls = $next.add($prev).add($current).add($slideshow);
469
471
}
472
}
473
474
+ // Add Colorbox's event bindings
475
function addBindings() {
476
+ function clickHandler(e) {
477
+ // ignore non-left-mouse-clicks and clicks modified with ctrl / command, shift, or alt.
478
+ // See: http://jacklmoore.com/notes/click-events/
479
+ if (!(e.which > 1 || e.shiftKey || e.altKey || e.metaKey || e.ctrlKey)) {
480
+ e.preventDefault();
481
+ launch(this);
482
+ }
483
+ }
484
+
485
if ($box) {
486
if (!init) {
487
init = true;
488
489
// Anonymous functions here keep the public method from being cached, thereby allowing them to be redefined on the fly.
490
$next.click(function () {
491
publicMethod.next();
509
e.preventDefault();
510
publicMethod.close();
511
}
512
+ if (open && settings.arrowKey && $related[1] && !e.altKey) {
513
if (key === 37) {
514
e.preventDefault();
515
$prev.click();
520
}
521
});
522
523
+ if ($.isFunction($.fn.on)) {
524
+ // For jQuery 1.7+
525
+ $(document).on('click.'+prefix, '.'+boxElement, clickHandler);
526
+ } else {
527
+ // For jQuery 1.3.x -> 1.6.x
528
+ // This code is never reached in jQuery 1.9, so do not contact me about 'live' being removed.
529
+ // This is not here for jQuery 1.9, it's here for legacy users.
530
+ $('.'+boxElement).live('click.'+prefix, clickHandler);
531
+ }
532
}
533
return true;
534
}
535
return false;
536
}
537
538
+ // Don't do anything if Colorbox already exists.
539
if ($.colorbox) {
540
return;
541
}
546
547
// ****************
548
// PUBLIC FUNCTIONS
549
+ // Usage format: $.colorbox.close();
550
+ // Usage from within an iframe: parent.jQuery.colorbox.close();
551
// ****************
552
553
publicMethod = $.fn[colorbox] = $[colorbox] = function (options, callback) {
558
appendHTML();
559
560
if (addBindings()) {
561
+ if ($.isFunction($this)) { // assume a call to $.colorbox
562
$this = $('<a/>');
563
+ options.open = true;
564
+ } else if (!$this[0]) { // colorbox being applied to empty collection
565
+ return $this;
566
}
567
568
if (callback) {
598
scrollTop = $window.scrollTop();
599
scrollLeft = $window.scrollLeft();
600
601
+ if (settings.fixed) {
602
offset.top -= scrollTop;
603
offset.left -= scrollLeft;
604
$box.css({position: 'fixed'});
610
611
// keeps the top and left positions within the browser's viewport.
612
if (settings.right !== false) {
613
+ left += Math.max($window.width() - settings.w - loadedWidth - interfaceWidth - setSize(settings.right, 'x'), 0);
614
} else if (settings.left !== false) {
615
left += setSize(settings.left, 'x');
616
} else {
617
+ left += Math.round(Math.max($window.width() - settings.w - loadedWidth - interfaceWidth, 0) / 2);
618
}
619
620
if (settings.bottom !== false) {
621
+ top += Math.max(winheight() - settings.h - loadedHeight - interfaceHeight - setSize(settings.bottom, 'y'), 0);
622
} else if (settings.top !== false) {
623
top += setSize(settings.top, 'y');
624
} else {
625
+ top += Math.round(Math.max(winheight() - settings.h - loadedHeight - interfaceHeight, 0) / 2);
626
}
627
628
+ $box.css({top: offset.top, left: offset.left, visibility:'visible'});
629
630
// this gives the wrapper plenty of breathing room so it's floated contents can move around smoothly,
631
// but it has to be shrank down around the size of div#colorbox when it's done. If not,
632
// it can invoke an obscure IE bug when using iframes.
633
$wrap[0].style.width = $wrap[0].style.height = "9999px";
634
635
+ function modalDimensions() {
636
+ $topBorder[0].style.width = $bottomBorder[0].style.width = $content[0].style.width = (parseInt($box[0].style.width,10) - interfaceWidth)+'px';
637
+ $content[0].style.height = $leftBorder[0].style.height = $rightBorder[0].style.height = (parseInt($box[0].style.height,10) - interfaceHeight)+'px';
638
}
639
640
+ css = {width: settings.w + loadedWidth + interfaceWidth, height: settings.h + loadedHeight + interfaceHeight, top: top, left: left};
641
+
642
+ // setting the speed to 0 if the content hasn't changed size or position
643
+ if (speed) {
644
+ var tempSpeed = 0;
645
+ $.each(css, function(i){
646
+ if (css[i] !== previousCSS[i]) {
647
+ tempSpeed = speed;
648
+ return;
649
+ }
650
+ });
651
+ speed = tempSpeed;
652
+ }
653
+
654
+ previousCSS = css;
655
+
656
+ if (!speed) {
657
$box.css(css);
658
}
659
+
660
$box.dequeue().animate(css, {
661
+ duration: speed || 0,
662
complete: function () {
663
+ modalDimensions();
664
665
active = false;
666
678
loadedCallback();
679
}
680
},
681
+ step: modalDimensions
682
});
683
};
684
685
publicMethod.resize = function (options) {
686
+ var scrolltop;
687
+
688
if (open) {
689
options = options || {};
690
691
if (options.width) {
692
settings.w = setSize(options.width, 'x') - loadedWidth - interfaceWidth;
693
}
694
+
695
if (options.innerWidth) {
696
settings.w = setSize(options.innerWidth, 'x');
697
}
698
+
699
$loaded.css({width: settings.w});
700
701
if (options.height) {
702
settings.h = setSize(options.height, 'y') - loadedHeight - interfaceHeight;
703
}
704
+
705
if (options.innerHeight) {
706
settings.h = setSize(options.innerHeight, 'y');
707
}
708
+
709
if (!options.innerHeight && !options.height) {
710
+ scrolltop = $loaded.scrollTop();
711
$loaded.css({height: "auto"});
712
settings.h = $loaded.height();
713
}
714
+
715
$loaded.css({height: settings.h});
716
+
717
+ if(scrolltop) {
718
+ $loaded.scrollTop(scrolltop);
719
+ }
720
721
publicMethod.position(settings.transition === "none" ? 0 : settings.speed);
722
}
728
}
729
730
var callback, speed = settings.transition === "none" ? 0 : settings.speed;
731
+
732
+ $loaded.empty().remove(); // Using empty first may prevent some IE7 issues.
733
+
734
$loaded = $tag(div, 'LoadedContent').append(object);
735
736
function getWidth() {
753
$loadingBay.hide();
754
755
// floating the IMG removes the bottom line-height and fixed a problem where IE miscalculates the width of the parent element as 100% of the document width.
756
757
$(photo).css({'float': 'none'});
758
+
759
callback = function () {
760
+ var total = $related.length,
761
iframe,
762
frameBorder = 'frameBorder',
763
allowTransparency = 'allowTransparency',
764
+ complete;
765
766
if (!open) {
767
return;
768
}
769
770
+ function removeFilter() { // Needed for IE7 & IE8 in versions of jQuery prior to 1.7.2
771
+ if ($.support.opacity === false) {
772
$box[0].style.removeAttribute('filter');
773
}
774
}
775
776
complete = function () {
777
clearTimeout(loadingTimer);
778
+ $loadingOverlay.hide();
779
trigger(event_complete, settings.onComplete);
780
};
781
+
782
783
$title.html(settings.title).add($loaded).show();
784
790
$next[(settings.loop || index < total - 1) ? "show" : "hide"]().html(settings.next);
791
$prev[(settings.loop || index) ? "show" : "hide"]().html(settings.previous);
792
793
+ slideshow();
794
795
// Preloads images within a rel group
796
if (settings.preloading) {
797
+ $.each([getIndex(-1), getIndex(1)], function(){
798
+ var src,
799
+ img,
800
+ i = $related[this],
801
+ data = $.data(i, colorbox);
802
+
803
if (data && data.href) {
804
src = data.href;
805
if ($.isFunction(src)) {
806
src = src.call(i);
807
}
808
} else {
809
+ src = $(i).attr('href');
810
}
811
812
+ if (src && isImage(data, src)) {
813
+ src = retinaUrl(data, src);
814
+ img = document.createElement('img');
815
img.src = src;
816
}
817
+ });
818
}
819
} else {
820
$groupControls.hide();
826
if (frameBorder in iframe) {
827
iframe[frameBorder] = 0;
828
}
829
+
830
if (allowTransparency in iframe) {
831
iframe[allowTransparency] = "true";
832
}
833
+
834
if (!settings.scrolling) {
835
iframe.scrolling = "no";
836
}
837
+
838
+ $(iframe)
839
+ .attr({
840
+ src: settings.href,
841
+ name: (new Date()).getTime(), // give the iframe a unique name to prevent caching
842
+ 'class': prefix + 'Iframe',
843
+ allowFullScreen : true, // allow HTML5 video to go fullscreen
844
+ webkitAllowFullScreen : true,
845
+ mozallowfullscreen : true
846
+ })
847
+ .one('load', complete)
848
+ .appendTo($loaded);
849
+
850
+ $events.one(event_purge, function () {
851
iframe.src = "//about:blank";
852
});
853
+
854
+ if (settings.fastIframe) {
855
+ $(iframe).trigger('load');
856
+ }
857
} else {
858
complete();
859
}
874
}
875
};
876
877
+ function load () {
878
+ var href, setResize, prep = publicMethod.prep, $inline, request = ++requests;
879
880
active = true;
881
883
884
element = $related[index];
885
886
+ makeSettings();
887
888
trigger(event_purge);
889
915
href = settings.href;
916
917
loadingTimer = setTimeout(function () {
918
+ $loadingOverlay.show();
919
}, 100);
920
921
if (settings.inline) {
922
// Inserts an empty placeholder where inline content is being pulled from.
923
+ // An event is bound to put inline content back when Colorbox closes or loads new content.
924
+ $inline = $tag(div).hide().insertBefore($(href)[0]);
925
+
926
+ $events.one(event_purge, function () {
927
+ $inline.replaceWith($loaded.children());
928
});
929
+
930
prep($(href));
931
} else if (settings.iframe) {
932
// IFrame element won't be added to the DOM until it is ready to be displayed,
934
prep(" ");
935
} else if (settings.html) {
936
prep(settings.html);
937
+ } else if (isImage(settings, href)) {
938
+
939
+ href = retinaUrl(settings, href);
940
+
941
+ photo = document.createElement('img');
942
+
943
+ $(photo)
944
.addClass(prefix + 'Photo')
945
+ .bind('error',function () {
946
settings.title = false;
947
prep($tag(div, 'Error').html(settings.imgError));
948
})
949
+ .one('load', function () {
950
var percent;
951
+
952
+ if (request !== requests) {
953
+ return;
954
+ }
955
+
956
+ $.each(['alt', 'longdesc', 'aria-describedby'], function(i,val){
957
+ var attr = $(element).attr(val) || $(element).attr('data-'+val);
958
+ if (attr) {
959
+ photo.setAttribute(val, attr);
960
+ }
961
+ });
962
+
963
+ if (settings.retinaImage && window.devicePixelRatio > 1) {
964
+ photo.height = photo.height / window.devicePixelRatio;
965
+ photo.width = photo.width / window.devicePixelRatio;
966
+ }
967
+
968
if (settings.scalePhotos) {
969
setResize = function () {
970
photo.height -= photo.height * percent;
981
}
982
983
if (settings.h) {
984
+ photo.style.marginTop = Math.max(settings.mh - photo.height, 0) / 2 + 'px';
985
}
986
987
if ($related[1] && (settings.loop || $related[index + 1])) {
990
publicMethod.next();
991
};
992
}
993
+
994
+ photo.style.width = photo.width + 'px';
995
+ photo.style.height = photo.height + 'px';
996
+
997
setTimeout(function () { // A pause because Chrome will sometimes report a 0 by 0 size otherwise.
998
prep(photo);
999
}, 1);
1003
photo.src = href;
1004
}, 1);
1005
} else if (href) {
1006
+ $loadingBay.load(href, settings.data, function (data, status) {
1007
+ if (request === requests) {
1008
+ prep(status === 'error' ? $tag(div, 'Error').html(settings.xhrError) : $(this).contents());
1009
+ }
1010
});
1011
}
1012
+ }
1013
1014
// Navigates to the next page/image in a set.
1015
publicMethod.next = function () {
1016
if (!active && $related[1] && (settings.loop || $related[index + 1])) {
1017
index = getIndex(1);
1018
+ launch($related[index]);
1019
}
1020
};
1021
1022
publicMethod.prev = function () {
1023
if (!active && $related[1] && (settings.loop || index)) {
1024
index = getIndex(-1);
1025
+ launch($related[index]);
1026
}
1027
};
1028
1029
+ // Note: to use this within an iframe use the following format: parent.jQuery.colorbox.close();
1030
publicMethod.close = function () {
1031
if (open && !closing) {
1032
1036
1037
trigger(event_cleanup, settings.onCleanup);
1038
1039
+ $window.unbind('.' + prefix);
1040
1041
+ $overlay.fadeTo(settings.fadeOut || 0, 0);
1042
1043
+ $box.stop().fadeTo(settings.fadeOut || 0, 0, function () {
1044
1045
$box.add($overlay).css({'opacity': 1, cursor: 'auto'}).hide();
1046
1047
trigger(event_purge);
1048
1049
+ $loaded.empty().remove(); // Using empty first may prevent some IE7 issues.
1050
1051
setTimeout(function () {
1052
closing = false;
1056
}
1057
};
1058
1059
+ // Removes changes Colorbox made to the document, but does not remove the plugin.
1060
publicMethod.remove = function () {
1061
+ if (!$box) { return; }
1062
+
1063
+ $box.stop();
1064
+ $.colorbox.close();
1065
+ $box.stop().remove();
1066
+ $overlay.remove();
1067
+ closing = false;
1068
$box = null;
1069
$('.' + boxElement)
1070
.removeData(colorbox)
1071
+ .removeClass(boxElement);
1072
+
1073
+ $(document).unbind('click.'+prefix);
1074
};
1075
1076
+ // A method for fetching the current element Colorbox is referencing.
1077
// returns a jQuery object.
1078
publicMethod.element = function () {
1079
return $(element);
1081
1082
publicMethod.settings = defaults;
1083
1084
+ }(jQuery, document, window));
localization/jquery-colorbox-cs_CZ.mo ADDED
Binary file
localization/jquery-colorbox-cs_CZ.po ADDED
@@ -0,0 +1,646 @@