|
3 | 3 | * Plugin Name: FancyBox for WordPress |
4 | 4 | * Plugin URI: https://wordpress.org/plugins/fancybox-for-wordpress/ |
5 | 5 | * Description: Integrates <a href="http://fancyapps.com/fancybox/3/">FancyBox 3</a> into WordPress. |
6 | | -* Version: 3.2.5 |
| 6 | +* Version: 3.2.6 |
7 | 7 | * Author: Colorlib |
8 | 8 | * Author URI: https://colorlib.com/wp/ |
9 | | -* Tested up to: 5.2 |
| 9 | +* Tested up to: 5.3 |
10 | 10 | * Requires: 4.6 or higher |
11 | 11 | * License: GPLv3 or later |
12 | 12 | * License URI: http://www.gnu.org/licenses/gpl-3.0.html |
|
36 | 36 | * Plugin Init |
37 | 37 | */ |
38 | 38 | // Constants |
39 | | -define( 'FBFW_VERSION', '3.2.5' ); |
| 39 | +define( 'FBFW_VERSION', '3.2.6' ); |
40 | 40 | define( 'FBFW_PATH', plugin_dir_path( __FILE__ ) ); |
41 | 41 | define( 'FBFW_URL', plugin_dir_url( __FILE__ ) ); |
42 | 42 | define( 'FBFW_PLUGIN_BASE', plugin_basename( __FILE__ ) ); |
@@ -75,60 +75,61 @@ function mfbfw_defaults() { |
75 | 75 |
|
76 | 76 | $default_settings = array( |
77 | 77 | // Appearance |
78 | | - 'border' => '', |
79 | | - 'borderColor' => '#BBBBBB', |
80 | | - 'paddingColor' => '#FFFFFF', |
81 | | - 'padding' => '10', |
82 | | - 'overlayShow' => 'on', |
83 | | - 'overlayColor' => '#666666', |
84 | | - 'overlayOpacity' => '0.3', |
85 | | - 'titleShow' => 'on', |
86 | | - 'titlePosition' => 'inside', |
87 | | - 'titleColor' => '#333333', |
88 | | - 'showNavArrows' => 'on', |
89 | | - 'titleSize' => '14', |
90 | | - 'showCloseButton' => '', |
91 | | - 'showToolbar' => 'on', |
92 | | - // Animations |
93 | | - 'zoomOpacity' => 'on', |
94 | | - 'zoomSpeedIn' => '500', |
95 | | - 'zoomSpeedChange' => '300', |
96 | | - 'transitionIn' => 'fade', |
97 | | - 'transitionEffect' => 'fade', |
98 | | - // Behaviour |
99 | | - 'hideOnOverlayClick' => 'function(current, event) { |
| 78 | + 'border' => '', |
| 79 | + 'borderColor' => '#BBBBBB', |
| 80 | + 'paddingColor' => '#FFFFFF', |
| 81 | + 'padding' => '10', |
| 82 | + 'overlayShow' => 'on', |
| 83 | + 'overlayColor' => '#666666', |
| 84 | + 'overlayOpacity' => '0.3', |
| 85 | + 'titleShow' => 'on', |
| 86 | + 'captionShow' => '', |
| 87 | + 'titlePosition' => 'inside', |
| 88 | + 'titleColor' => '#333333', |
| 89 | + 'showNavArrows' => 'on', |
| 90 | + 'titleSize' => '14', |
| 91 | + 'showCloseButton' => '', |
| 92 | + 'showToolbar' => 'on', |
| 93 | + // Animations |
| 94 | + 'zoomOpacity' => 'on', |
| 95 | + 'zoomSpeedIn' => '500', |
| 96 | + 'zoomSpeedChange' => '300', |
| 97 | + 'transitionIn' => 'fade', |
| 98 | + 'transitionEffect' => 'fade', |
| 99 | + // Behaviour |
| 100 | + 'hideOnOverlayClick' => 'function(current, event) { |
100 | 101 | return current.type === "image" ? "close" : false; |
101 | 102 | },', |
102 | | - 'hideOnContentClick' => '', |
103 | | - 'enableEscapeButton' => 'on', |
104 | | - 'cyclic' => '', |
105 | | - 'mouseWheel' => '', |
106 | | - 'disableWoocommercePages' => '', |
107 | | - 'disableWoocommerceProducts' => '', |
108 | | - // Gallery Type |
109 | | - 'galleryType' => 'all', |
110 | | - 'customExpression' => 'jQuery(thumbnails).attr("data-fancybox","gallery").getTitle();', |
111 | | - // Misc |
112 | | - 'autoDimensions' => 'on', |
113 | | - 'frameWidth' => '560', |
114 | | - 'frameHeight' => '340', |
115 | | - 'loadAtFooter' => '', |
116 | | - 'callbackEnable' => '', |
117 | | - 'callbackOnStart' => 'function() { alert("Start!"); }', |
118 | | - 'callbackOnCancel' => 'function() { alert("Cancel!"); }', |
119 | | - 'callbackOnComplete' => 'function() { alert("Complete!"); }', |
120 | | - 'callbackOnCleanup' => 'function() { alert("CleanUp!"); }', |
121 | | - 'callbackOnClose' => 'function() { alert("Close!"); }', |
122 | | - 'copyTitleFunction' => 'var arr = jQuery("a[data-fancybox]"); |
| 103 | + 'hideOnContentClick' => '', |
| 104 | + 'enableEscapeButton' => 'on', |
| 105 | + 'cyclic' => '', |
| 106 | + 'mouseWheel' => '', |
| 107 | + 'disableWoocommercePages' => '', |
| 108 | + 'disableWoocommerceProducts' => '', |
| 109 | + // Gallery Type |
| 110 | + 'galleryType' => 'all', |
| 111 | + 'customExpression' => 'jQuery(thumbnails).attr("data-fancybox","gallery").getTitle();', |
| 112 | + // Misc |
| 113 | + 'autoDimensions' => 'on', |
| 114 | + 'frameWidth' => '560', |
| 115 | + 'frameHeight' => '340', |
| 116 | + 'loadAtFooter' => '', |
| 117 | + 'callbackEnable' => '', |
| 118 | + 'callbackOnStart' => 'function() { alert("Start!"); }', |
| 119 | + 'callbackOnCancel' => 'function() { alert("Cancel!"); }', |
| 120 | + 'callbackOnComplete' => 'function() { alert("Complete!"); }', |
| 121 | + 'callbackOnCleanup' => 'function() { alert("CleanUp!"); }', |
| 122 | + 'callbackOnClose' => 'function() { alert("Close!"); }', |
| 123 | + 'copyTitleFunction' => 'var arr = jQuery("a[data-fancybox]"); |
123 | 124 | jQuery.each(arr, function() { |
124 | 125 | var title = jQuery(this).children("img").attr("title"); |
125 | 126 | var caption = jQuery(this).next("figcaption").html(); |
126 | 127 | if(caption.length){jQuery(this).attr("title",title+" " + caption)}else{ jQuery(this).attr("title",title);}; |
127 | 128 | }); ', |
128 | | - 'nojQuery' => '', |
129 | | - 'extraCallsEnable' => '', |
130 | | - 'extraCallsData' => '', |
131 | | - 'uninstall' => '', |
| 129 | + 'nojQuery' => '', |
| 130 | + 'extraCallsEnable' => '', |
| 131 | + 'extraCallsData' => '', |
| 132 | + 'uninstall' => '', |
132 | 133 | ); |
133 | 134 |
|
134 | 135 | return $default_settings; |
@@ -214,12 +215,22 @@ function mfbfw_init() { |
214 | 215 |
|
215 | 216 | // fix undefined index copyTitleFunction. $mfbfw array misses this index. |
216 | 217 |
|
217 | | - $mfbfw['copyTitleFunction'] = 'var arr = jQuery("a[data-fancybox]"); |
| 218 | + if (isset($mfbfw['captionShow']) && 'on' == $mfbfw['captionShow']) { |
| 219 | + $mfbfw['copyTitleFunction'] = 'var arr = jQuery("a[data-fancybox]"); |
| 220 | + jQuery.each(arr, function() { |
| 221 | + var title = jQuery(this).children("img").attr("title"); |
| 222 | + if(title){jQuery(this).attr("title",title)} |
| 223 | + }); '; |
| 224 | + } else { |
| 225 | + $mfbfw['copyTitleFunction'] = 'var arr = jQuery("a[data-fancybox]"); |
218 | 226 | jQuery.each(arr, function() { |
219 | 227 | var title = jQuery(this).children("img").attr("title"); |
220 | 228 | var caption = jQuery(this).next("figcaption").html(); |
221 | 229 | if(caption && title){jQuery(this).attr("title",title+" " + caption)}else if(title){ jQuery(this).attr("title",title);}else if(caption){jQuery(this).attr("title",caption);} |
222 | 230 | }); '; |
| 231 | + } |
| 232 | + |
| 233 | + |
223 | 234 |
|
224 | 235 | $afterLoad = ''; |
225 | 236 | if ( $mfbfw['titlePosition'] == 'inside' ) { |
|
0 commit comments