Easy FancyBox - Version 1.3.4.5

Version Description

FancyBox version 1.3.4 plus added PDF support and LOTS more options like border, overlay color, Easing, Title and adjustable YouTube, Vimeo and iFrame sizes! Missing WordPress auto-embed wmode fix.

=

Download this release

Release Info

Developer RavanH
Plugin Icon 128x128 Easy FancyBox
Version 1.3.4.5
Comparing to
See all releases

Code changes from version 1.3.3.4.2 to 1.3.4.5

easy-fancybox.css.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /* -------------------------------------
3
+ Easy Fancybox Styleheet Conversion
4
+ ------------------------------------- */
5
+
6
+ header('Content-type: text/css; charset=utf-8', true);
7
+ ob_start("iepathfix_compress");
8
+ function iepathfix_compress($buffer) {
9
+ $prefix = ( isset($_SERVER['HTTPS']) ) ? "https://" : "http://";
10
+ /* Relative path fix : add 'fancybox/'
11
+ * IE6 path fix : replace relative with full path */
12
+ $buffer = str_replace(array("url('", "AlphaImageLoader(src='fancybox/"), array("url('fancybox/", "AlphaImageLoader(src='" . ( ( isset($_SERVER['HTTPS']) ) ? "https://" : "http://" ) . htmlspecialchars( $_SERVER['SERVER_NAME'] . dirname($_SERVER['SCRIPT_NAME']), ENT_QUOTES) . "/fancybox/"), $buffer);
13
+ /* remove comments */
14
+ $buffer = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $buffer);
15
+ /* remove tabs, spaces, newlines, etc. */
16
+ $buffer = str_replace(array("\r\n", "\r", "\n", "\t", ' ', ' ', ' '), '', $buffer);
17
+ /* and squeeze some more */
18
+ $buffer = str_replace(array(", ", ": ", " {", "{ ", " }", "} ", ";}", " 0;"), array(",", ":", "{", "{", "}", "}", "}", ";"), $buffer);
19
+ return $buffer;
20
+ }
21
+
22
+ /* the css file */
23
+ include( 'fancybox/jquery.fancybox-' . htmlspecialchars( $_GET['ver'] , ENT_QUOTES) . '.css' );
24
+
25
+ ob_end_flush();
26
+ ?>
easy-fancybox.php CHANGED
@@ -2,240 +2,1030 @@
2
  /*
3
  Plugin Name: Easy FancyBox
4
  Plugin URI: http://4visions.nl/en/wordpress-plugins/easy-fancybox/
5
- Description: Easily enable the <a href="http://fancybox.net/">FancyBox 1.3.3 jQuery extension</a> on all image, SWF, YouTube and Vimeo links. Multi-Site compatible and supports iFrame and Flash movies in overlay viewport. Happy with it? Please leave me a small <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=ravanhagen%40gmail%2ecom&item_name=Easy%20FancyBox&amp;item_number=1%2e3%2e3&no_shipping=0&tax=0&bn=PP%2dDonationsBF&charset=UTF%2d8&lc=us">TIP</a> for development and support on this plugin and please consider a DONATION to the <a href="http://fancybox.net/">FancyBox project</a>.
6
- Version: 1.3.3.4.2
7
  Author: RavanH
8
  Author URI: http://4visions.nl/
9
  */
10
 
 
 
 
 
 
 
11
  // FUNCTIONS //
12
 
13
  function easy_fancybox_settings(){
14
- return array(
15
- 'autoAttribute' => array (
16
- 'id' => 'fancybox_autoAttribute',
17
- 'title' => __('Auto-enable','easy-fancybox'),
18
- 'label_for' => 'fancybox_autoAttribute',
19
- 'input' => 'text',
20
- 'class' => 'regular-text',
21
- 'options' => array(),
22
- 'hide' => 'true',
23
- 'default' => 'jpg gif png bmp jpeg jpe swf',
24
- 'description' => __('Enter file types FancyBox should be automatically enabled for. Clear field to switch off auto-enabling.','easy-fancybox')
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  ),
26
- 'autoDetect' => array (
27
- 'id' => 'fancybox_autoDetect',
28
- 'title' => __('Auto-detect','easy-fancybox'),
29
- 'label_for' => '',
30
  'input' => 'multiple',
31
- 'class' => '',
32
  'options' => array(
33
- 'autoAttributeYoutube' => array (
34
- 'id' => 'fancybox_autoAttributeYoutube',
35
- 'label_for' => '',
36
- 'input' => 'checkbox',
37
- 'class' => '',
38
- 'options' => array(),
39
- 'hide' => 'true',
40
- 'default' => '1',
41
- 'description' => __('YouTube links.','easy-fancybox')
42
  ),
43
- 'autoAttributeYoutubeShortURL' => array (
44
- 'id' => 'fancybox_autoAttributeYoutubeShortURL',
45
- 'label_for' => '',
46
- 'input' => 'checkbox',
47
- 'class' => '',
48
- 'options' => array(),
49
- 'hide' => 'true',
50
- 'default' => '',
51
- 'description' => __('Short URL YouTube links.','easy-fancybox')
52
  ),
53
- 'autoAttributeVimeo' => array (
54
- 'id' => 'fancybox_autoAttributeVimeo',
55
- 'label_for' => '',
56
- 'input' => 'checkbox',
57
- 'class' => '',
58
- 'options' => array(),
59
- 'hide' => 'true',
60
- 'default' => '1',
61
- 'description' => __('Vimeo links.','easy-fancybox')
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
62
  )
63
- ),
64
- 'hide' => 'true',
65
- 'description' => __('Select which external video content sites links should automatically be detected and FancyBox enabled.','easy-fancybox')
66
  ),
67
- 'titlePosition' => array (
68
- 'id' => 'fancybox_titlePosition',
69
- 'title' => __('Title Position','easy-fancybox'),
70
- 'label_for' => 'fancybox_titlePosition',
71
- 'input' => 'select',
72
- 'class' => '',
73
  'options' => array(
74
- 'over' => __('Overlay','easy-fancybox'),
75
- 'inside' => __('Inside','easy-fancybox'),
76
- 'outside' => __('Outside','easy-fancybox')
77
- ),
78
- 'default' => 'over',
79
- 'description' => __('Position of the overlay content title.','easy-fancybox')
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
80
  ),
81
- 'transitionIn' => array (
82
- 'id' => 'fancybox_transitionIn',
83
- 'title' => __('Transition In','easy-fancybox'),
84
- 'label_for' => 'fancybox_transitionIn',
85
- 'input' => 'select',
86
- 'class' => '',
87
  'options' => array(
88
- 'elastic' => __('Elastic','easy-fancybox'),
89
- 'fade' => __('Fade in','easy-fancybox'),
90
- 'none' => __('None','easy-fancybox')
91
- ),
92
- 'default' => 'elastic',
93
- 'description' => __('Transition effect when opening the overlay.','easy-fancybox')
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
94
  ),
95
- 'transitionOut' => array (
96
- 'id' => 'fancybox_transitionOut',
97
- 'title' => __('Transition Out','easy-fancybox'),
98
- 'label_for' => 'fancybox_transitionOut',
99
- 'input' => 'select',
100
- 'class' => '',
101
  'options' => array(
102
- 'elastic' => __('Elastic','easy-fancybox'),
103
- 'fade' => __('Fade out','easy-fancybox'),
104
- 'none' => __('None','easy-fancybox')
105
- ),
106
- 'default' => 'elastic',
107
- 'description' => __('Transition effect when closing the overlay.','easy-fancybox')
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
108
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
109
  );
110
  }
111
 
112
  function easy_fancybox() {
113
  $easy_fancybox_array = easy_fancybox_settings();
114
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
115
  // begin output FancyBox settings
116
  echo "
117
- <!-- Easy FancyBox plugin for WordPress - RavanH (http://4visions.nl/en/wordpress-plugins/easy-fancybox/) -->
118
  <script type=\"text/javascript\">
119
  jQuery(document).ready(function($){";
120
-
121
- $file_types = array_filter( explode( ' ', get_option( 'fancybox_autoAttribute', $easy_fancybox_array['autoAttribute']['default']) ) );
122
-
123
- // add auto-detection image/swf links
124
- if(!empty($file_types)) {
125
- echo "
126
- $('";
127
- foreach ($file_types as $type)
128
- echo 'a[href$=".'.$type.'"],a[href$=".'.strtoupper($type).'"],';
129
- echo "')
130
- .attr('rel', 'gallery')
131
- .addClass('fancybox');";
 
 
 
 
 
 
 
 
 
 
 
132
  }
 
 
 
 
 
 
133
 
134
- // add auto-attribution for Youtube links
135
- if( "1" == get_option("fancybox_autoAttributeYoutube", $easy_fancybox_array['autoDetect']['options']['autoAttributeYoutube']['default']) )
136
- echo "
137
- $('a[href*=\"youtube.com/watch\"]').addClass('fancybox-youtube');";
 
 
138
 
139
- // add auto-attribution for Vimeo links
140
- if( "1" == get_option("fancybox_autoAttributeVimeo", $easy_fancybox_array['autoDetect']['options']['autoAttributeVimeo']['default']) )
141
- echo "
142
- $('a[href*=\"vimeo.com/\"]').addClass('fancybox-vimeo');
143
- ";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
144
 
145
- // image/swf fancybox settings
146
- echo "
147
- $('a.fancybox').fancybox({";
148
- foreach ($easy_fancybox_array as $key => $values)
149
- if('true'!=$values['hide'])
150
- echo "
151
- '".$key."' : '".get_option($values['id'], $values['default'])."',";
152
-
153
- if( "over" == get_option("fancybox_titlePosition", $easy_fancybox_array['titlePosition']['default']) )
154
- echo"
155
- 'onComplete' : function() {
156
- $('#fancybox-wrap').hover(function() {
157
- $('#fancybox-title').show();
158
- }, function() {
159
- $('#fancybox-title').hide();
160
- });
161
- },";
162
  echo"
163
- 'autoDimensions': false,
164
- 'titleFromAlt' : true
165
- });
166
- ";
167
-
168
- // iframe/swf/youtube/vimeo settings
169
- echo"
170
- var fb_opts = {
171
- 'titleShow' : false,
172
- 'padding' : 0,
173
- 'autoScale' : false,
174
- 'transitionIn' : 'none',
175
- 'transitionOut' : 'none',
176
- 'swf' : {
177
- 'wmode' : 'opacity',
178
- 'allowfullscreen' : 'true'
179
- }
180
- };
181
- $('a.fancybox-iframe').fancybox(
182
- $.extend(fb_opts, {
183
- 'type' : 'iframe',
184
- 'height' : '90%',
185
- 'width' : '70%'
186
- })
187
- );
188
- $('a.fancybox-swf').fancybox(
189
- $.extend(fb_opts, {
190
- 'width' : 680,
191
- 'height' : 495,
192
- 'type' : 'swf'
193
- })
194
- );
195
- $('a.fancybox-youtube').click(function(){
196
- $.fancybox(
197
- $.extend(fb_opts, {
198
- 'type' : 'swf',
199
- 'width' : 640,
200
- 'height' : 385,
201
- 'href' : this.href.replace(new RegExp('watch\\\?v=', 'i'), 'v/')
202
- })
203
- );
204
- return false;
205
- });";
206
- if( "1" == get_option("fancybox_autoAttributeYoutubeShortURL", $easy_fancybox_array['autoDetect']['options']['autoAttributeYoutubeShortURL']['default']) )
207
- echo "
208
- $('a[href*=\"youtu.be/\"]').click(function(){
209
- $.fancybox(
210
- $.extend(fb_opts, {
211
- 'type' : 'swf',
212
- 'width' : 640,
213
- 'height' : 385,
214
- 'href' : this.href.replace(new RegExp('youtu.be', 'i'), 'www.youtube.com/v')
215
- })
216
- );
217
- return false;
218
- });";
219
- echo "
220
- $('a.fancybox-vimeo').click(function() {
221
- $.fancybox(
222
- $.extend(fb_opts, {
223
- 'width' : 640,
224
- 'height' : 360,
225
- 'href' : this.href.replace(new RegExp('([0-9])', 'i'), 'moogaloop.swf?clip_id=$1')
226
- })
227
- );
228
- return false;
229
- });
230
  });
231
  </script>
 
232
  ";
233
  }
234
 
235
  // FancyBox Media Settings Section on Settings > Media admin page
236
  function easy_fancybox_settings_section() {
237
- echo '<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=ravanhagen%40gmail%2ecom&item_name=Easy%20FancyBox&item_number=&no_shipping=0&tax=0&bn=PP%2dDonationsBF&charset=UTF%2d8&lc=us" title="'.__('Donate to Easy FancyBox plugin development with PayPal - it\'s fast, free and secure!','easy-fancybox').'"><img src="https://www.paypal.com/en_US/i/btn/x-click-but7.gif" style="border:none;float:right;margin:0 0 10px 10px" alt="'.__('Donate to Easy FancyBox plugin development with PayPal - it\'s fast, free and secure!','easy-fancybox').'" /></a><p>'.__('To manualy enable FancyBox for a link to an attached image or swf movie file, you can use the tags class="fancybox" or class="fancybox-swf". To make a link to any web page show in a FancyBox overlay, use class="fancybox-iframe". Use the tags class="fancybox-youtube" on a YouTube link and class="fancybox-vimeo" on a Vimeo link to manually enable FancyBox for it. Read more on <a href="http://4visions.nl/en/wordpress-plugins/easy-fancybox/">Easy FancyBox for WordPress</a>.','easy-fancybox').'</p><p>'.__('The settings listed below determine the image overlay behaviour controlled by FancyBox.','easy-fancybox').' '.__('Some setting like Title Position and Transition are ignored for swf video and iframe content overlays to improve browser compatibility and readability.','easy-fancybox').'</p>';
238
  }
 
239
  // FancyBox Media Settings Fields
240
  function easy_fancybox_settings_fields($args){
241
  switch($args['input']) {
@@ -245,6 +1035,10 @@ function easy_fancybox_settings_fields($args){
245
  echo $args['description'];
246
  break;
247
  case 'select':
 
 
 
 
248
  echo '
249
  <select name="'.$args['id'].'" id="'.$args['id'].'">';
250
  foreach ($args['options'] as $optionkey => $optionvalue) {
@@ -255,11 +1049,15 @@ function easy_fancybox_settings_fields($args){
255
  echo '
256
  </select> ';
257
  if( empty($args['label_for']) )
258
- echo '<label for="'.$args['id'].'">'.$args['description'].'</label> <em>'.__('Default:','easy-fancybox').' '.$args['options'][$args['default']].'</em>';
259
  else
260
- echo $args['description'].' <em>'.__('Default:','easy-fancybox').' '.$args['options'][$args['default']].'</em>';
261
  break;
262
  case 'checkbox':
 
 
 
 
263
  $value = esc_attr( get_option($args['id'], $args['default']) );
264
  if ($value == "1")
265
  $checked = ' checked="checked"';
@@ -269,16 +1067,24 @@ function easy_fancybox_settings_fields($args){
269
  $default = __('Checked','easy-fancybox');
270
  else
271
  $default = __('Unchecked','easy-fancybox');
272
- echo '
273
- <label><input type="checkbox" name="'.$args['id'].'" id="'.$args['id'].'" value="1" '.$checked.'/> '.$args['description'].'</label> <em>'.__('Default:','easy-fancybox').' '.$default.'</em><br />';
 
 
 
 
274
  break;
275
  case 'text':
 
 
 
 
276
  echo '
277
- <input type="text" name="'.$args['id'].'" id="'.$args['id'].'" value="'.esc_attr( get_option($args['id'], $args['default']) ).'" class="'.$args['class'].'"/><br />';
278
  if( empty($args['label_for']) )
279
- echo '<label for="'.$args['id'].'">'.$args['description'].'</label> <em>'.__('Default:','easy-fancybox').' '.$args['default'].'</em>';
280
  else
281
- echo $args['description'].' <em>'.__('Default:','easy-fancybox').' '.$args['default'].'</em>';
282
  break;
283
  default:
284
  echo $args['description'];
@@ -295,30 +1101,53 @@ function easy_fancybox_admin_init(){
295
  foreach ($easy_fancybox_array as $key => $value) {
296
  add_settings_field( 'fancybox_'.$key, $value['title'], 'easy_fancybox_settings_fields', 'media', 'fancybox_section', $value);
297
  if ($value['input']=='multiple')
298
- foreach ($value['options'] as $_key => $_value)
299
- register_setting( 'media', 'fancybox_'.$_key );
300
  else
301
- register_setting( 'media', 'fancybox_'.$key );
302
  }
303
  }
304
 
305
  function easy_fancybox_enqueue() {
306
- // check if fancy.php is moved one dir up like in WPMU's /mu-plugins/
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
307
  // NOTE: don't use WP_PLUGIN_URL to avoid problems when installed in /mu-plugins/
308
  $efb_subdir = (file_exists(dirname(__FILE__).'/easy-fancybox')) ? 'easy-fancybox' : '';
309
 
310
  // ENQUEUE
311
  // register main fancybox script
312
- wp_enqueue_script('jquery.fancybox', plugins_url($efb_subdir, __FILE__).'/fancybox/jquery.fancybox-1.3.3.pack.js', array('jquery'), '1.3.3');
313
 
314
- if( "none" != get_option("fancybox_transitionIn") || "none" != get_option("fancybox_transitionOut") ) {
 
 
 
 
 
 
315
  // first get rid of previously registered variants of jquery.easing (by other plugins)
316
  wp_deregister_script('jquery.easing');
317
  wp_deregister_script('jqueryeasing');
318
  wp_deregister_script('jquery-easing');
319
  wp_deregister_script('easing');
320
  // then register our version
321
- wp_enqueue_script('jquery.easing', plugins_url($efb_subdir, __FILE__).'/fancybox/jquery.easing-1.3.pack.js', array('jquery'), '1.3');
322
  }
323
 
324
  // first get rid of previously registered variants of jquery.mousewheel (by other plugins)
@@ -327,14 +1156,30 @@ function easy_fancybox_enqueue() {
327
  wp_deregister_script('jquery-mousewheel');
328
  wp_deregister_script('mousewheel');
329
  // then register our version
330
- wp_enqueue_script('jquery.mousewheel', plugins_url($efb_subdir, __FILE__).'/fancybox/jquery.mousewheel-3.0.4.pack.js', array('jquery'), '3.0.4');
331
 
332
  // register style
333
- wp_enqueue_style('jquery.fancybox', plugins_url($efb_subdir, __FILE__).'/jquery.fancybox.css.php', false, '1.3.3');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
334
  }
335
 
336
  // HOOKS //
337
 
 
 
338
  add_action('wp_enqueue_scripts', 'easy_fancybox_enqueue', 999);
339
  add_action('wp_head', 'easy_fancybox');
340
 
2
  /*
3
  Plugin Name: Easy FancyBox
4
  Plugin URI: http://4visions.nl/en/wordpress-plugins/easy-fancybox/
5
+ Description: Easily enable the <a href="http://fancybox.net/">FancyBox jQuery extension</a> on all image, SWF, YouTube and Vimeo links. Multi-Site compatible and supports iFrame and Flash movies in overlay viewport. Happy with it? Please leave me a small <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=ravanhagen%40gmail%2ecom&item_name=Easy%20FancyBox&amp;item_number=1%2e3%2e4&no_shipping=0&tax=0&bn=PP%2dDonationsBF&charset=UTF%2d8&lc=us">TIP</a> for development and support on this plugin and please consider a DONATION to the <a href="http://fancybox.net/">FancyBox project</a>.
6
+ Version: 1.3.4.5
7
  Author: RavanH
8
  Author URI: http://4visions.nl/
9
  */
10
 
11
+ // DEF
12
+
13
+ define( 'FANCYBOX_VERSION', '1.3.4' );
14
+ define( 'MOUSEWHEEL_VERSION', '3.0.4' );
15
+ define( 'EASING_VERSION', '1.3' );
16
+
17
  // FUNCTIONS //
18
 
19
  function easy_fancybox_settings(){
20
+
21
+ if (function_exists('is_plugin_active_for_network') && is_plugin_active_for_network(plugin_basename( __FILE__ )))
22
+ $no_network_activate = '';
23
+ else
24
+ $no_network_activate = '1';
25
+
26
+ return array (
27
+ 'Global' => array(
28
+ 'title' => __('Global settings','easy-fancybox'),
29
+ 'input' => 'multiple',
30
+ 'hide' => true,
31
+ 'options' => array(
32
+ 'intro' => array (
33
+ 'hide' => true,
34
+ 'description' => __('These settings determine the global overlay appearance and behaviour controlled by FancyBox.','easy-fancybox') . '<br />'
35
+ ),
36
+ 'p0' => array (
37
+ 'hide' => true,
38
+ 'description' => '<br /><strong>' . __('Links') . '</strong><br />'
39
+ ),
40
+ 'attributeLimit' => array (
41
+ 'id' => 'fancybox_attributeLimit',
42
+ 'title' => __('Exclude','easy-fancybox'),
43
+ 'label_for' => 'fancybox_attributeLimit',
44
+ 'hide' => true,
45
+ 'input' => 'select',
46
+ 'options' => array(
47
+ '' => __('None'),
48
+ '.not(\':empty\')' => __('Empty (hidden)','easy-fancybox'),
49
+ '.has(\'img\')' => __('Without thumbnail image','easy-fancybox'),
50
+ ),
51
+ 'default' => '.not(\':empty\')'
52
+ ),
53
+ 'p1' => array (
54
+ 'hide' => true,
55
+ 'description' => '<br /><br /><strong>' . __('Overlay','easy-fancybox') . '</strong><br />'
56
+ ),
57
+ 'overlayShow' => array (
58
+ 'id' => 'fancybox_overlayShow',
59
+ 'input' => 'checkbox',
60
+ 'default' => '1',
61
+ 'description' => __('Show the overlay around content opened in FancyBox.','easy-fancybox')
62
+ ),
63
+ 'overlayOpacity' => array (
64
+ 'id' => 'fancybox_overlayOpacity',
65
+ 'title' => __('Overlay opacity','easy-fancybox'),
66
+ 'label_for' => 'fancybox_overlayOpacity',
67
+ 'input' => 'text',
68
+ 'class' => 'small-text',
69
+ 'default' => '',
70
+ 'description' => __('Value between 0 and 1. ','easy-fancybox') . ' <em>' . __('Default:','easy-fancybox') . ' 0.7</em><br />'
71
+ ),
72
+ 'overlayColor' => array (
73
+ 'id' => 'fancybox_overlayColor',
74
+ 'title' => __('Overlay color','easy-fancybox'),
75
+ 'label_for' => 'fancybox_overlayColor',
76
+ 'input' => 'text',
77
+ 'class' => 'small-text',
78
+ 'default' => '',
79
+ 'description' => __('Enter a HTML color value.','easy-fancybox') . ' <em>' . __('Default:','easy-fancybox') . ' #777</em><br />'
80
+ ),
81
+ 'p2' => array (
82
+ 'hide' => true,
83
+ 'description' => '<br /><strong>' . __('Overlay window','easy-fancybox') . '</strong><br />'
84
+ ),
85
+ 'width' => array (
86
+ 'id' => 'fancybox_width',
87
+ 'title' => __('Width'),
88
+ 'label_for' => 'fancybox_width',
89
+ 'input' => 'text',
90
+ 'class' => 'small-text',
91
+ 'default' => '',
92
+ 'description' => ' '
93
+ ),
94
+ 'height' => array (
95
+ 'id' => 'fancybox_height',
96
+ 'title' => __('Height'),
97
+ 'label_for' => 'fancybox_height',
98
+ 'input' => 'text',
99
+ 'class' => 'small-text',
100
+ 'default' => ''
101
+ ),
102
+ 'padding' => array (
103
+ 'id' => 'fancybox_padding',
104
+ 'title' => __('Border'),
105
+ 'label_for' => 'fancybox_padding',
106
+ 'input' => 'text',
107
+ 'class' => 'small-text',
108
+ 'default' => '',
109
+ 'description' => '<br />' . __('Change default width, heigth and border of the overlay window.','easy-fancybox') . ' ' . __('Set Border 0 to remove it.','easy-fancybox') . ' <em>' . __('Default:','easy-fancybox') . ' 560 x 340 x 10</em><br />'
110
+ ),
111
+ 'centerOnScroll' => array (
112
+ 'id' => 'fancybox_centerOnScroll',
113
+ 'input' => 'checkbox',
114
+ 'default' => '1',
115
+ 'description' => __('Center while scrolling.','easy-fancybox')
116
+ ),
117
+ 'showCloseButton' => array (
118
+ 'id' => 'fancybox_showCloseButton',
119
+ 'input' => 'checkbox',
120
+ 'default' => '1',
121
+ 'description' => __('Show the (X) close button.','easy-fancybox')
122
+ ),
123
+ 'showNavArrows' => array (
124
+ 'id' => 'fancybox_showNavArrows',
125
+ 'input' => 'checkbox',
126
+ 'default' => '1',
127
+ 'description' => __('Show the gallery navigation arrows.','easy-fancybox')
128
+ ),
129
+ 'titleShow' => array (
130
+ 'id' => 'fancybox_titleShow',
131
+ 'input' => 'checkbox',
132
+ 'default' => '1',
133
+ 'description' => __('Show title','easy-fancybox')
134
+ ),
135
+ 'titlePosition' => array (
136
+ 'id' => 'fancybox_titlePosition',
137
+ 'title' => __('Title Position','easy-fancybox'),
138
+ 'label_for' => 'fancybox_titlePosition',
139
+ 'input' => 'select',
140
+ 'options' => array(
141
+ '' => __('Float','easy-fancybox'), // same as 'float'
142
+ 'outside' => __('Outside','easy-fancybox'),
143
+ 'inside' => __('Inside','easy-fancybox'),
144
+ 'over' => __('Overlay','easy-fancybox')
145
+ ),
146
+ 'default' => 'over',
147
+ ),
148
+ 'titleFromAlt' => array (
149
+ 'id' => 'fancybox_titleFromAlt',
150
+ 'input' => 'checkbox',
151
+ 'default' => '1',
152
+ 'description' => __('Get title from the thumbnail alt tag','easy-fancybox')
153
+ ),
154
+ 'p3' => array (
155
+ 'hide' => true,
156
+ 'description' => '<br /><strong>' . __('Transition','easy-fancybox') . '</strong><br />'
157
+ ),
158
+ 'transitionIn' => array (
159
+ 'id' => 'fancybox_transitionIn',
160
+ 'title' => __('Transition In','easy-fancybox'),
161
+ 'label_for' => 'fancybox_transitionIn',
162
+ 'input' => 'select',
163
+ 'options' => array(
164
+ '' => __('Fade','easy-fancybox'),
165
+ 'elastic' => __('Elastic','easy-fancybox'),
166
+ 'none' => __('None','easy-fancybox')
167
+ ),
168
+ 'default' => 'elastic',
169
+ 'description' => ' '
170
+ ),
171
+ 'easingIn' => array (
172
+ 'id' => 'fancybox_easingIn',
173
+ 'title' => __('Easing In','easy-fancybox'),
174
+ 'label_for' => 'fancybox_easingIn',
175
+ 'input' => 'select',
176
+ 'options' => array(
177
+ '' => __('Swing','easy-fancybox'),
178
+ 'easeOutBack' => __('Back','easy-fancybox'),
179
+ 'easeOutQuad' => __('Quad','easy-fancybox'),
180
+ 'easeOutExpo' => __('Expo','easy-fancybox'),
181
+ ),
182
+ 'default' => 'easeOutBack',
183
+ 'description' => '<br />'
184
+ ),
185
+ 'transitionOut' => array (
186
+ 'id' => 'fancybox_transitionOut',
187
+ 'title' => __('Transition Out','easy-fancybox'),
188
+ 'label_for' => 'fancybox_transitionOut',
189
+ 'input' => 'select',
190
+ 'options' => array(
191
+ '' => __('Fade','easy-fancybox'),
192
+ 'elastic' => __('Elastic','easy-fancybox'),
193
+ 'none' => __('None','easy-fancybox')
194
+ ),
195
+ 'default' => 'elastic',
196
+ 'description' => ' '
197
+ ),
198
+ 'easingOut' => array (
199
+ 'id' => 'fancybox_easingOut',
200
+ 'title' => __('Easing Out','easy-fancybox'),
201
+ 'label_for' => 'fancybox_easingOut',
202
+ 'input' => 'select',
203
+ 'options' => array(
204
+ '' => __('Swing','easy-fancybox'),
205
+ 'easeInBack' => __('Back','easy-fancybox'),
206
+ 'easeInQuad' => __('Quad','easy-fancybox'),
207
+ 'easeInExpo' => __('Expo','easy-fancybox'),
208
+ ),
209
+ 'default' => 'easeInBack',
210
+ 'description' => '<br />' . __('Easing effects only apply when Transition is set to Elastic. ','easy-fancybox') . '<br /><br />'
211
+ ),
212
+ 'opacity' => array (
213
+ 'id' => 'fancybox_opacity',
214
+ 'input' => 'checkbox',
215
+ 'default' => '',
216
+ 'description' => __('Transparency fade during elastic transition.','easy-fancybox')
217
+ ),
218
+ 'speedIn' => array (
219
+ 'id' => 'fancybox_speedIn',
220
+ 'title' => __('Opening speed','easy-fancybox'),
221
+ 'label_for' => 'fancybox_speedIn',
222
+ 'input' => 'text',
223
+ 'class' => 'small-text',
224
+ 'default' => '',
225
+ ),
226
+ 'speedOut' => array (
227
+ 'id' => 'fancybox_speedIn',
228
+ 'title' => __('Closing speed','easy-fancybox'),
229
+ 'label_for' => 'fancybox_speedOut',
230
+ 'input' => 'text',
231
+ 'class' => 'small-text',
232
+ 'default' => '',
233
+ ),
234
+ 'changeFade' => array (
235
+ 'id' => 'fancybox_changeFade',
236
+ 'title' => __('Fade speed','easy-fancybox'),
237
+ 'label_for' => 'fancybox_changeFade',
238
+ 'input' => 'text',
239
+ 'class' => 'small-text',
240
+ 'default' => '',
241
+ 'description' => '<br />' . __('Duration in milliseconds. Higher is slower.','easy-fancybox') . ' <em>' . __('Default:','easy-fancybox') . ' 300</em>'
242
+ )
243
+ )
244
  ),
245
+ 'IMG' => array(
246
+ 'title' => __('Images','easy-fancybox'),
 
 
247
  'input' => 'multiple',
 
248
  'options' => array(
249
+ 'enable' => array (
250
+ 'id' => 'fancybox_enableImg',
251
+ 'input' => 'checkbox',
252
+ 'hide' => true,
253
+ 'default' => ( function_exists('is_plugin_active_for_network') && is_plugin_active_for_network(plugin_basename( __FILE__ )) ) ? '' : '1',
254
+ 'description' => '<strong>' . __('Enable FancyBox for','easy-fancybox') . ' ' . __('Images','easy-fancybox') . '</strong>'
 
 
 
255
  ),
256
+ 'intro' => array (
257
+ 'hide' => true,
258
+ 'description' => __('To make any image file open in an overlay, add its extension to the auto-detect field or use the tag class="fancybox" for its link.','easy-fancybox') . '<br />'
 
 
 
 
 
 
259
  ),
260
+ 'autoAttribute' => array (
261
+ 'id' => 'fancybox_autoAttribute',
262
+ 'title' => __('Auto-detect','easy-fancybox'),
263
+ 'label_for' => 'fancybox_autoAttribute',
264
+ 'input' => 'text',
265
+ 'class' => 'regular-text',
266
+ 'hide' => true,
267
+ 'default' => 'jpg gif png',
268
+ 'selector' => 'href$=',
269
+ 'description' => '<br />' . __('Enter file types FancyBox should be automatically enabled for. Clear field to switch off auto-enabling.','easy-fancybox') . ' <em>' . __('Default:','easy-fancybox') . ' jpg gif png</em>'
270
+ ),
271
+ 'class' => array (
272
+ 'hide' => true,
273
+ 'default' => 'fancybox'
274
+ )
275
+ /* TODO : only use this parm when 'titlePosition' : 'over'
276
+ ,'onComplete' => array (
277
+ 'noquotes' => true,
278
+ 'default' => 'function() { $(\'#fancybox-wrap\').hover(function() { $(\'#fancybox-title\').show(); }, function() { $(\'#fancybox-title\').hide(); }); }'
279
+ )*/
280
+ )
281
+ ),
282
+
283
+ 'PDF' => array(
284
+ 'title' => __('PDF','easy-fancybox'),
285
+ 'input' => 'multiple',
286
+ 'options' => array(
287
+ 'enable' => array (
288
+ 'id' => 'fancybox_enablePDF',
289
+ 'input' => 'checkbox',
290
+ 'hide' => true,
291
+ 'default' => '',
292
+ 'description' => '<strong>' . __('Enable FancyBox for','easy-fancybox') . ' ' . __('PDF','easy-fancybox') . '</strong>'
293
+ ),
294
+ 'autoAttribute' => array (
295
+ 'id' => 'fancybox_autoAttributePDF',
296
+ 'input' => 'checkbox',
297
+ 'hide' => true,
298
+ 'default' => '',
299
+ 'selector' => 'href$=".pdf"',
300
+ 'description' => __('Auto-detect','easy-fancybox')
301
+ ),
302
+ 'class' => array (
303
+ 'hide' => true,
304
+ 'default' => 'fancybox-pdf'
305
+ ),
306
+ 'intro' => array (
307
+ 'hide' => true,
308
+ 'description' => __('To make any PDF document file open in an overlay, switch on auto-detect or use the tag class="fancybox-pdf" for its link.','easy-fancybox') . ' ' . __('Adjust its specific settings below.','easy-fancybox') . '<br /><br />'
309
+ ),
310
+ 'type' => array (
311
+ 'default' => 'html'
312
+ ),
313
+ 'width' => array (
314
+ 'id' => 'fancybox_PDFwidth',
315
+ 'title' => __('Width'),
316
+ 'label_for' => 'fancybox_PDFwidth',
317
+ 'input' => 'text',
318
+ 'class' => 'small-text',
319
+ 'default' => '90%',
320
+ 'description' => ' '
321
+ ),
322
+ 'height' => array (
323
+ 'id' => 'fancybox_PDFheight',
324
+ 'title' => __('Height'),
325
+ 'label_for' => 'fancybox_PDFheight',
326
+ 'input' => 'text',
327
+ 'class' => 'small-text',
328
+ 'default' => '90%'
329
+ ),
330
+ 'margin' => array (
331
+ 'default' => '0'
332
+ ),
333
+ 'padding' => array (
334
+ 'id' => 'fancybox_PDFpadding',
335
+ 'title' => __('Border'),
336
+ 'label_for' => 'fancybox_PDFpadding',
337
+ 'input' => 'text',
338
+ 'class' => 'small-text',
339
+ 'default' => '0',
340
+ 'description' => '<br />' . __('Width and height can be relative (%) or absolute sizes.','easy-fancybox') . ' ' . __('Set Border 0 to remove it.','easy-fancybox') . '<br />'
341
+ ),
342
+ 'autoScale' => array (
343
+ 'noquotes' => true,
344
+ 'default' => 'false'
345
+ ),
346
+ 'titleShow' => array (
347
+ 'id' => 'fancybox_PDFtitleShow',
348
+ 'input' => 'checkbox',
349
+ 'default' => '',
350
+ 'description' => __('Show title','easy-fancybox')
351
+ ),
352
+ 'titlePosition' => array (
353
+ 'id' => 'fancybox_PDFtitlePosition',
354
+ 'title' => __('Title Position','easy-fancybox'),
355
+ 'label_for' => 'fancybox_PDFtitlePosition',
356
+ 'input' => 'select',
357
+ 'options' => array(
358
+ 'float' => __('Float','easy-fancybox'), // same as 'float'
359
+ 'outside' => __('Outside','easy-fancybox'),
360
+ 'inside' => __('Inside','easy-fancybox')
361
+ //,'over' => __('Overlay','easy-fancybox')
362
+ ),
363
+ 'default' => 'float',
364
+ ),
365
+ 'titleFromAlt' => array (
366
+ 'id' => 'fancybox_PDFtitleFromAlt',
367
+ 'input' => 'checkbox',
368
+ 'default' => '',
369
+ 'description' => __('Get title from the thumbnail alt tag','easy-fancybox')
370
+ ),
371
+ 'transitionOut' => array (
372
+ 'id' => 'fancybox_PDFtransitionOut',
373
+ 'title' => __('Transition Out','easy-fancybox'),
374
+ 'label_for' => 'fancybox_PDFtransitionOut',
375
+ 'input' => 'select',
376
+ 'class' => '',
377
+ 'options' => array(
378
+ 'fade' => __('Fade','easy-fancybox'),
379
+ //'elastic' => __('Elastic','easy-fancybox'),
380
+ 'none' => __('None','easy-fancybox')
381
+ ),
382
+ 'default' => 'fade',
383
+ ),
384
+ 'easingIn' => array (
385
+ 'default' => 'swing'
386
+ ),
387
+ 'autoDimensions' => array (
388
+ 'noquotes' => true,
389
+ 'default' => 'false'
390
+ ),
391
+ 'scrolling' => array (
392
+ 'default' => 'no',
393
+ ),
394
+ 'onStart' => array (
395
+ 'noquotes' => true,
396
+ 'default' => 'function(selectedArray, selectedIndex, selectedOpts) { selectedOpts.content = \'<embed src="\' + selectedArray[selectedIndex].href + \'#nameddest=self&page=1&view=FitH,0&zoom=80,0,0" type="application/pdf" height="100%" width="100%" />\' }'
397
  )
398
+ )
 
 
399
  ),
400
+
401
+ 'SWF' => array(
402
+ 'title' => __('SWF','easy-fancybox'),
403
+ 'input' => 'multiple',
 
 
404
  'options' => array(
405
+ 'enable' => array (
406
+ 'id' => 'fancybox_enableSWF',
407
+ 'input' => 'checkbox',
408
+ 'hide' => true,
409
+ 'default' => '',
410
+ 'description' => '<strong>' . __('Enable FancyBox for','easy-fancybox') . ' ' . __('SWF','easy-fancybox') . '</strong>'
411
+ ),
412
+ 'autoAttribute' => array (
413
+ 'id' => 'fancybox_autoAttributeSWF',
414
+ 'input' => 'checkbox',
415
+ 'hide' => true,
416
+ 'default' => '',
417
+ 'selector' => 'href$=".swf"',
418
+ 'description' => __('Auto-detect','easy-fancybox')
419
+ ),
420
+ 'class' => array (
421
+ 'hide' => true,
422
+ 'default' => 'fancybox-swf'
423
+ ),
424
+ 'intro' => array (
425
+ 'hide' => true,
426
+ 'description' => __('To make any Flash (.swf) file open in an overlay, switch on auto-detect or use the tag class="fancybox-swf" for its link.','easy-fancybox') . ' ' . __('Adjust its specific settings below.','easy-fancybox') . '<br /><br />'
427
+ ),
428
+ 'type' => array(
429
+ 'default' => 'swf'
430
+ ),
431
+ 'width' => array (
432
+ 'id' => 'fancybox_SWFWidth',
433
+ 'title' => __('Width'),
434
+ 'label_for' => 'fancybox_SWFWidth',
435
+ 'input' => 'text',
436
+ 'class' => 'small-text',
437
+ 'options' => array(),
438
+ 'default' => '680',
439
+ 'description' => ' '
440
+ ),
441
+ 'height' => array (
442
+ 'id' => 'fancybox_SWFHeight',
443
+ 'title' => __('Height'),
444
+ 'label_for' => 'fancybox_SWFHeight',
445
+ 'input' => 'text',
446
+ 'class' => 'small-text',
447
+ 'options' => array(),
448
+ 'default' => '495',
449
+ ),
450
+ 'padding' => array (
451
+ 'id' => 'fancybox_SWFpadding',
452
+ 'title' => __('Border'),
453
+ 'label_for' => 'fancybox_SWFpadding',
454
+ 'input' => 'text',
455
+ 'class' => 'small-text',
456
+ 'default' => '0',
457
+ 'description' => '<br />' . __('Width and height can be relative (%) or absolute sizes.','easy-fancybox') . ' ' . __('Set Border 0 to remove it.','easy-fancybox') . '<br />'
458
+ ),
459
+ 'autoScale' => array (
460
+ 'noquotes' => true,
461
+ 'default' => 'false'
462
+ ),
463
+ 'titleShow' => array (
464
+ 'id' => 'fancybox_SWFtitleShow',
465
+ 'input' => 'checkbox',
466
+ 'default' => '',
467
+ 'description' => __('Show title','easy-fancybox')
468
+ ),
469
+ 'titlePosition' => array (
470
+ 'id' => 'fancybox_SWFtitlePosition',
471
+ 'title' => __('Title Position','easy-fancybox'),
472
+ 'label_for' => 'fancybox_SWFtitlePosition',
473
+ 'input' => 'select',
474
+ 'options' => array(
475
+ 'float' => __('Float','easy-fancybox'), // same as 'float'
476
+ 'outside' => __('Outside','easy-fancybox'),
477
+ 'inside' => __('Inside','easy-fancybox')
478
+ //,'over' => __('Overlay','easy-fancybox')
479
+ ),
480
+ 'default' => 'float',
481
+ ),
482
+ 'titleFromAlt' => array (
483
+ 'id' => 'fancybox_SWFtitleFromAlt',
484
+ 'input' => 'checkbox',
485
+ 'default' => '',
486
+ 'description' => __('Get title from the thumbnail alt tag','easy-fancybox')
487
+ ),
488
+ 'transitionOut' => array (
489
+ 'id' => 'fancybox_SWFtransitionOut',
490
+ 'title' => __('Transition Out','easy-fancybox'),
491
+ 'label_for' => 'fancybox_SWFtransitionOut',
492
+ 'input' => 'select',
493
+ 'class' => '',
494
+ 'options' => array(
495
+ 'fade' => __('Fade','easy-fancybox'),
496
+ //'elastic' => __('Elastic','easy-fancybox'),
497
+ 'none' => __('None','easy-fancybox')
498
+ ),
499
+ 'default' => 'fade',
500
+ ),
501
+ 'easingIn' => array (
502
+ 'default' => 'swing'
503
+ ),
504
+ 'swf' => array (
505
+ 'noquotes' => true,
506
+ 'default' => '{\'wmode\':\'opaque\',\'allowfullscreen\':true}'
507
+ )
508
+ )
509
  ),
510
+
511
+ 'YouTube' => array(
512
+ 'title' => __('YouTube','easy-fancybox'),
513
+ 'input' => 'multiple',
 
 
514
  'options' => array(
515
+ 'enable' => array (
516
+ 'id' => 'fancybox_enableYoutube',
517
+ 'input' => 'checkbox',
518
+ 'hide' => true,
519
+ 'default' => '',
520
+ 'description' => '<strong>' . __('Enable FancyBox for','easy-fancybox') . ' ' . __('YouTube','easy-fancybox') . '</strong>'
521
+ ),
522
+ 'autoAttribute' => array (
523
+ 'id' => 'fancybox_autoAttributeYoutube',
524
+ 'input' => 'checkbox',
525
+ 'hide' => true,
526
+ 'default' => '',
527
+ 'selector' => 'href*="youtube.com/"',
528
+ //'href-replace' => "return attr.replace(new RegExp('watch\\\?v=', 'i'), 'v/')",
529
+ 'description' => __('Auto-detect','easy-fancybox')
530
+ ),
531
+ 'autoAttributeAlt' => array (
532
+ 'id' => 'fancybox_autoAttributeYoutubeShortURL',
533
+ 'input' => 'checkbox',
534
+ 'hide' => true,
535
+ 'default' => '',
536
+ 'selector' => 'href*="youtu.be/"',
537
+ //'href-replace' => "return attr.replace(new RegExp('youtu.be', 'i'), 'www.youtube.com/v')",
538
+ 'description' => __('Auto-detect Short links','easy-fancybox')
539
+ ),
540
+ 'class' => array (
541
+ 'hide' => true,
542
+ 'default' => 'fancybox-youtube'
543
+ ),
544
+ 'intro' => array (
545
+ 'hide' => true,
546
+ 'description' => __('To make any YouTube movie open in an overlay, switch on auto-detect or use the tag class="fancybox-youtube" for its link.','easy-fancybox') . ' ' . __('Adjust its specific settings below.','easy-fancybox') . '<br /><br />'
547
+ ),
548
+ 'type' => array(
549
+ 'default' => 'swf'
550
+ ),
551
+ 'width' => array (
552
+ 'id' => 'fancybox_YoutubeWidth',
553
+ 'title' => __('Width'),
554
+ 'label_for' => 'fancybox_YoutubeWidth',
555
+ 'input' => 'text',
556
+ 'class' => 'small-text',
557
+ 'default' => '640',
558
+ 'description' => ' '
559
+ ),
560
+ 'height' => array (
561
+ 'id' => 'fancybox_YoutubeHeight',
562
+ 'title' => __('Height'),
563
+ 'label_for' => 'fancybox_YoutubeHeight',
564
+ 'input' => 'text',
565
+ 'class' => 'small-text',
566
+ 'default' => '385',
567
+ ),
568
+ 'padding' => array (
569
+ 'id' => 'fancybox_Youtubepadding',
570
+ 'title' => __('Border'),
571
+ 'label_for' => 'fancybox_Youtubepadding',
572
+ 'input' => 'text',
573
+ 'class' => 'small-text',
574
+ 'default' => '0',
575
+ 'description' => '<br />' . __('Width and height can be relative (%) or absolute sizes.','easy-fancybox') . ' ' . __('Set Border 0 to remove it.','easy-fancybox') . '<br />'
576
+ ),
577
+ 'autoScale' => array (
578
+ 'noquotes' => true,
579
+ 'default' => 'false'
580
+ ),
581
+ 'titleShow' => array (
582
+ 'id' => 'fancybox_YoutubetitleShow',
583
+ 'input' => 'checkbox',
584
+ 'default' => '',
585
+ 'description' => __('Show title','easy-fancybox')
586
+ ),
587
+ 'titlePosition' => array (
588
+ 'id' => 'fancybox_YoutubetitlePosition',
589
+ 'title' => __('Title Position','easy-fancybox'),
590
+ 'label_for' => 'fancybox_YoutubetitlePosition',
591
+ 'input' => 'select',
592
+ 'options' => array(
593
+ 'float' => __('Float','easy-fancybox'), // same as 'float'
594
+ 'outside' => __('Outside','easy-fancybox'),
595
+ 'inside' => __('Inside','easy-fancybox')
596
+ //,'over' => __('Overlay','easy-fancybox')
597
+ ),
598
+ 'default' => 'float',
599
+ ),
600
+ 'titleFromAlt' => array (
601
+ 'id' => 'fancybox_YoutubetitleFromAlt',
602
+ 'input' => 'checkbox',
603
+ 'default' => '',
604
+ 'description' => __('Get title from the thumbnail alt tag','easy-fancybox')
605
+ ),
606
+ 'transitionOut' => array (
607
+ 'id' => 'fancybox_YoutubetransitionOut',
608
+ 'title' => __('Transition Out','easy-fancybox'),
609
+ 'label_for' => 'fancybox_YoutubetransitionOut',
610
+ 'input' => 'select',
611
+ 'options' => array(
612
+ 'fade' => __('Fade','easy-fancybox'),
613
+ //'elastic' => __('Elastic','easy-fancybox'),
614
+ 'none' => __('None','easy-fancybox')
615
+ ),
616
+ 'default' => 'fade'
617
+ ),
618
+ 'easingIn' => array (
619
+ 'default' => 'swing'
620
+ ),
621
+ 'swf' => array (
622
+ 'noquotes' => true,
623
+ 'default' => '{\'wmode\':\'opaque\',\'allowfullscreen\':true}'
624
+ ),
625
+ 'onStart' => array (
626
+ 'noquotes' => true,
627
+ 'default' => 'function(selectedArray, selectedIndex, selectedOpts) { selectedOpts.href = selectedArray[selectedIndex].href.replace(new RegExp(\'youtu.be\', \'i\'), \'www.youtube.com/v\').replace(new RegExp(\'watch\\\?v=\', \'i\'), \'v/\') }'
628
+ )
629
+ )
630
  ),
631
+
632
+ 'Vimeo' => array(
633
+ 'title' => __('Vimeo','easy-fancybox'),
634
+ 'input' => 'multiple',
 
 
635
  'options' => array(
636
+ 'enable' => array (
637
+ 'id' => 'fancybox_enableVimeo',
638
+ 'input' => 'checkbox',
639
+ 'hide' => true,
640
+ 'default' => '',
641
+ 'description' => '<strong>' . __('Enable FancyBox for','easy-fancybox') . ' ' . __('Vimeo','easy-fancybox') . '</strong>'
642
+ ),
643
+ 'autoAttribute' => array (
644
+ 'id' => 'fancybox_autoAttributeVimeo',
645
+ 'input' => 'checkbox',
646
+ 'hide' => true,
647
+ 'default' => '',
648
+ 'selector' => 'href*="vimeo.com/"',
649
+ //'href-replace' => "return attr.replace(new RegExp('/([0-9])', 'i'), '/moogaloop.swf?clip_id=$1')",
650
+ 'description' => __('Auto-detect','easy-fancybox')
651
+ ),
652
+ 'class' => array (
653
+ 'hide' => true,
654
+ 'default' => 'fancybox-vimeo'
655
+ ),
656
+ 'intro' => array (
657
+ 'hide' => true,
658
+ 'description' => __('To make any Vimeo movie open in an overlay, switch on auto-detect or use the tag class="fancybox-vimeo" for its link.','easy-fancybox') . ' ' . __('Adjust its specific settings below.','easy-fancybox') . '<br /><br />'
659
+ ),
660
+ 'type' => array(
661
+ 'default' => 'swf'
662
+ ),
663
+ 'width' => array (
664
+ 'id' => 'fancybox_VimeoWidth',
665
+ 'title' => __('Width'),
666
+ 'label_for' => 'fancybox_VimeoWidth',
667
+ 'input' => 'text',
668
+ 'class' => 'small-text',
669
+ 'default' => '640',
670
+ 'description' => ' '
671
+ ),
672
+ 'height' => array (
673
+ 'id' => 'fancybox_VimeoHeight',
674
+ 'title' => __('Height'),
675
+ 'label_for' => 'fancybox_VimeoHeight',
676
+ 'input' => 'text',
677
+ 'class' => 'small-text',
678
+ 'default' => '360'
679
+ ),
680
+ 'padding' => array (
681
+ 'id' => 'fancybox_Vimeopadding',
682
+ 'title' => __('Border'),
683
+ 'label_for' => 'fancybox_Vimeopadding',
684
+ 'input' => 'text',
685
+ 'class' => 'small-text',
686
+ 'default' => '0',
687
+ 'description' => '<br />' . __('Width and height can be relative (%) or absolute sizes.','easy-fancybox') . ' ' . __('Set Border 0 to remove it.','easy-fancybox') . '<br />'
688
+ ),
689
+ 'autoScale' => array (
690
+ 'noquotes' => true,
691
+ 'default' => 'false'
692
+ ),
693
+ 'transitionOut' => array (
694
+ 'id' => 'fancybox_VimeotransitionOut',
695
+ 'title' => __('Transition Out','easy-fancybox'),
696
+ 'label_for' => 'fancybox_VimeotransitionOut',
697
+ 'input' => 'select',
698
+ 'options' => array(
699
+ 'fade' => __('Fade','easy-fancybox'),
700
+ //'elastic' => __('Elastic','easy-fancybox'),
701
+ 'none' => __('None','easy-fancybox')
702
+ ),
703
+ 'default' => 'fade',
704
+ 'description' => __('Transition effect when closing the overlay.','easy-fancybox')
705
+ ),
706
+ 'easingIn' => array (
707
+ 'default' => 'swing'
708
+ ),
709
+ 'titleShow' => array (
710
+ 'id' => 'fancybox_VimeotitleShow',
711
+ 'input' => 'checkbox',
712
+ 'default' => '',
713
+ 'description' => __('Show title','easy-fancybox')
714
+ ),
715
+ 'titlePosition' => array (
716
+ 'id' => 'fancybox_VimeotitlePosition',
717
+ 'title' => __('Title Position','easy-fancybox'),
718
+ 'label_for' => 'fancybox_VimeotitlePosition',
719
+ 'input' => 'select',
720
+ 'options' => array(
721
+ 'float' => __('Float','easy-fancybox'), // same as 'float'
722
+ 'outside' => __('Outside','easy-fancybox'),
723
+ 'inside' => __('Inside','easy-fancybox')
724
+ //,'over' => __('Overlay','easy-fancybox')
725
+ ),
726
+ 'default' => 'float',
727
+ ),
728
+ 'titleFromAlt' => array (
729
+ 'id' => 'fancybox_VimeotitleFromAlt',
730
+ 'input' => 'checkbox',
731
+ 'default' => '',
732
+ 'description' => __('Get title from the thumbnail alt tag','easy-fancybox')
733
+ ),
734
+ 'transitionOut' => array (
735
+ 'id' => 'fancybox_VimeotransitionOut',
736
+ 'title' => __('Transition Out','easy-fancybox'),
737
+ 'label_for' => 'fancybox_VimeotransitionOut',
738
+ 'input' => 'select',
739
+ 'options' => array(
740
+ 'fade' => __('Fade','easy-fancybox'),
741
+ //'elastic' => __('Elastic','easy-fancybox'),
742
+ 'none' => __('None','easy-fancybox')
743
+ ),
744
+ 'default' => 'fade',
745
+ 'description' => __('Transition effect when closing the overlay.','easy-fancybox')
746
+ ),
747
+ 'easingIn' => array (
748
+ 'default' => 'swing'
749
+ ),
750
+ 'swf' => array (
751
+ 'noquotes' => true,
752
+ 'default' => '{\'wmode\':\'opaque\',\'allowfullscreen\':true}'
753
+ ),
754
+ 'onStart' => array (
755
+ 'noquotes' => true,
756
+ 'default' => 'function(selectedArray, selectedIndex, selectedOpts) { selectedOpts.href = selectedArray[selectedIndex].href.replace(new RegExp(\'/([0-9])\', \'i\'), \'/moogaloop.swf?clip_id=$1\') }'
757
+ )
758
+ )
759
  ),
760
+
761
+ /* 'Tudou' => array(
762
+ 'id' => 'fancybox_Tudou',
763
+ 'title' => __('Tudou','easy-fancybox'),
764
+ 'label_for' => '',
765
+ 'input' => 'multiple',
766
+ 'class' => '', 'description' => '',
767
+ 'options' => array(
768
+ 'autoAttributeTudou' => array (
769
+ 'id' => 'fancybox_autoAttributeTudou',
770
+ 'label_for' => '',
771
+ 'input' => 'checkbox',
772
+ 'class' => '',
773
+ 'options' => array(),
774
+ 'hide' => true,
775
+ 'default' => '1',
776
+ 'description' => __('Tudou links','easy-fancybox')
777
+ )
778
+ )
779
+ ),*/
780
+
781
+ /* 'Animoto' => array(),
782
+
783
+ Example ANIMOTO page link http://animoto.com/play/Kf9POzQMSOGWyu41gtOtsw should become
784
+ http://static.animoto.com/swf/w.swf?w=swf/vp1&f=Kf9POzQMSOGWyu41gtOtsw&i=m
785
+
786
+ */
787
+
788
+ 'iFrame' => array(
789
+ 'title' => __('iFrames','easy-fancybox'),
790
+ 'input' => 'multiple',
791
+ 'options' => array(
792
+ 'enable' => array (
793
+ 'id' => 'fancybox_enableiFrame',
794
+ 'input' => 'checkbox',
795
+ 'hide' => true,
796
+ 'default' => '',
797
+ 'description' => '<strong>' . __('Enable FancyBox for','easy-fancybox') . ' ' . __('iFrames','easy-fancybox') . '</strong>'
798
+ ),
799
+ 'class' => array (
800
+ 'hide' => true,
801
+ 'default' => 'fancybox-iframe'
802
+ ),
803
+ 'intro' => array (
804
+ 'hide' => true,
805
+ 'description' => __('To make a website or HTML document open in an overlay, use the tag class="fancybox-iframe" or class="fancybox iframe" for its link.','easy-fancybox') . ' ' . __('Adjust its specific settings below.','easy-fancybox') . '<br /><br />'
806
+ ),
807
+ 'type' => array (
808
+ 'default' => 'iframe'
809
+ ),
810
+ 'width' => array (
811
+ 'id' => 'fancybox_iFramewidth',
812
+ 'title' => __('Width'),
813
+ 'label_for' => 'fancybox_iFramewidth',
814
+ 'input' => 'text',
815
+ 'class' => 'small-text',
816
+ 'default' => '70%',
817
+ 'description' => ' '
818
+ ),
819
+ 'height' => array (
820
+ 'id' => 'fancybox_iFrameheight',
821
+ 'title' => __('Height'),
822
+ 'label_for' => 'fancybox_iFrameheight',
823
+ 'input' => 'text',
824
+ 'class' => 'small-text',
825
+ 'default' => '90%',
826
+ ),
827
+ 'padding' => array (
828
+ 'id' => 'fancybox_iFramepadding',
829
+ 'title' => __('Border'),
830
+ 'label_for' => 'fancybox_iFramepadding',
831
+ 'input' => 'text',
832
+ 'class' => 'small-text',
833
+ 'default' => '0',
834
+ 'description' => '<br />' . __('Width and height can be relative (%) or absolute sizes.','easy-fancybox') . ' ' . __('Set Border 0 to remove it.','easy-fancybox') . '<br />'
835
+ ),
836
+ 'scrolling' => array (
837
+ 'default' => 'auto'
838
+ ),
839
+ 'autoScale' => array (
840
+ 'noquotes' => true,
841
+ 'default' => 'false'
842
+ ),
843
+ 'titleShow' => array (
844
+ 'id' => 'fancybox_iFrametitleShow',
845
+ 'input' => 'checkbox',
846
+ 'default' => '',
847
+ 'description' => __('Show title','easy-fancybox')
848
+ ),
849
+ 'titlePosition' => array (
850
+ 'id' => 'fancybox_iFrametitlePosition',
851
+ 'title' => __('Title Position','easy-fancybox'),
852
+ 'label_for' => 'fancybox_iFrametitlePosition',
853
+ 'input' => 'select',
854
+ 'options' => array(
855
+ 'float' => __('Float','easy-fancybox'), // same as 'float'
856
+ 'outside' => __('Outside','easy-fancybox'),
857
+ 'inside' => __('Inside','easy-fancybox')
858
+ //,'over' => __('Overlay','easy-fancybox')
859
+ ),
860
+ 'default' => 'float',
861
+ ),
862
+ 'titleFromAlt' => array (
863
+ 'id' => 'fancybox_iFrametitleFromAlt',
864
+ 'input' => 'checkbox',
865
+ 'default' => '',
866
+ 'description' => __('Get title from the thumbnail alt tag','easy-fancybox')
867
+ ),
868
+ 'transitionOut' => array (
869
+ 'id' => 'fancybox_iFrametransitionOut',
870
+ 'title' => __('Transition Out','easy-fancybox'),
871
+ 'label_for' => 'fancybox_iFrametransitionOut',
872
+ 'input' => 'select',
873
+ 'options' => array(
874
+ 'fade' => __('Fade','easy-fancybox'),
875
+ //'elastic' => __('Elastic','easy-fancybox'),
876
+ 'none' => __('None','easy-fancybox')
877
+ ),
878
+ 'default' => 'fade'
879
+ ),
880
+ 'easingIn' => array (
881
+ 'default' => 'swing'
882
+ )
883
+ )
884
+ )
885
+
886
  );
887
  }
888
 
889
  function easy_fancybox() {
890
  $easy_fancybox_array = easy_fancybox_settings();
891
 
892
+ echo "
893
+ <!-- Easy FancyBox plugin for WordPress using FancyBox ".FANCYBOX_VERSION." - RavanH (http://4visions.nl/en/wordpress-plugins/easy-fancybox/) -->";
894
+
895
+ // check for any enabled sections
896
+ $do_fancybox = false;
897
+ foreach ($easy_fancybox_array as $value) {
898
+ if ( '1' == get_option($value['options']['enable']['id'],$value['options']['enable']['default']) ) {
899
+ $do_fancybox = true;
900
+ break;
901
+ }
902
+ }
903
+ if (!$do_fancybox) {
904
+ echo "
905
+ <!-- No sections enabled under Settings > Media > FancyBox -->
906
+
907
+ ";
908
+ return;
909
+ }
910
+
911
  // begin output FancyBox settings
912
  echo "
 
913
  <script type=\"text/javascript\">
914
  jQuery(document).ready(function($){";
915
+
916
+ /*
917
+ * Global settings routine
918
+ */
919
+ $more=0;
920
+ echo '
921
+ var fb_opts = {';
922
+ foreach ($easy_fancybox_array['Global']['options'] as $_key => $_values) {
923
+ $parm = ($_values['id']) ? get_option($_values['id'], $_values['default']) : $_values['default'];
924
+ $parm = ('checkbox'==$_values['input'] && ''==$parm) ? '0' : $parm;
925
+ if(!$_values['hide'] && $parm!='') {
926
+ $quote = (is_numeric($parm) || $_values['noquotes']) ? '' : '\'';
927
+ if ($more>0)
928
+ echo ',';
929
+ echo ' \''.$_key.'\' : ';
930
+ if ('checkbox'==$_values['input'])
931
+ echo ( '1' == $parm ) ? 'true' : 'false';
932
+ else
933
+ echo $quote.$parm.$quote;
934
+ $more++;
935
+ } else {
936
+ $$_key = $parm;
937
+ }
938
  }
939
+ echo ' };';
940
+
941
+ foreach ($easy_fancybox_array as $key => $value) {
942
+ // check if not enabled or hide=true then skip
943
+ if ( !get_option($value['options']['enable']['id'], $value['options']['enable']['default']) || $value['hide'] )
944
+ continue;
945
 
946
+ echo '
947
+ /* ' . $key . ' */';
948
+ /*
949
+ * Auto-detection routines (2x)
950
+ */
951
+ $autoAttribute = get_option( $value['options']['autoAttribute']['id'], $value['options']['autoAttribute']['default'] );
952
 
953
+ if(!empty($autoAttribute)) {
954
+ if(is_numeric($autoAttribute)) {
955
+ echo '
956
+ $(\'a['.$value['options']['autoAttribute']['selector'].']\')';
957
+ if ($value['options']['autoAttribute']['href-replace'])
958
+ echo '.attr(\'href\', function(index, attr){'.$value['options']['autoAttribute']['href-replace'].'})';
959
+ echo '.addClass(\''.$value['options']['class']['default'].'\');';
960
+ } else {
961
+ $file_types = array_filter( explode( ' ', $autoAttribute) );
962
+ $more=0;
963
+ echo '
964
+ var fb_'.$key.'_selector = \'';
965
+ foreach ($file_types as $type) {
966
+ if ($more>0)
967
+ echo ',';
968
+ echo 'a['.$value['options']['autoAttribute']['selector'].'".'.$type.'"],a['.$value['options']['autoAttribute']['selector'].'".'.strtoupper($type).'"]';
969
+ $more++;
970
+ }
971
+ echo '\';';
972
+ if ( is_single() || is_page() ) {
973
+ echo '
974
+ $(fb_'.$key.'_selector)'.$attributeLimit.'.addClass(\''.$value['options']['class']['default'].'\').attr(\'rel\', \'gallery\');';
975
+ } else {
976
+ echo '
977
+ var fb_'.$key.'_posts = jQuery(\'div.post\');
978
+ fb_'.$key.'_posts.each(function() { jQuery(this).find(fb_'.$key.'_selector)'.$attributeLimit.'.addClass(\''.$value['options']['class']['default'].'\').attr(\'rel\', \'gallery-\' + fb_'.$key.'_posts.index(this)); });';
979
+ }
980
+ }
981
+ }
982
+
983
+ $autoAttributeAlt = get_option( $value['options']['autoAttributeAlt']['id'], $value['options']['autoAttributeAlt']['default'] );
984
+ if(!empty($autoAttributeAlt) && is_numeric($autoAttributeAlt)) {
985
+ echo '
986
+ $(\'a['.$value['options']['autoAttributeAlt']['selector'].']\')';
987
+ if ($value['options']['autoAttributeAlt']['href-replace'])
988
+ echo '.attr(\'href\', function(index, attr){'.$value['options']['autoAttributeAlt']['href-replace']. '})';
989
+ echo '.addClass(\''.$value['options']['class']['default'].'\');';
990
+ }
991
+
992
+ /*
993
+ * Append .fancybox() routine
994
+ */
995
+ $more=0;
996
+ echo '
997
+ $(\'a.'.$value['options']['class']['default'].'\')'.$attributeLimit.'.fancybox( $.extend(fb_opts, {';
998
+ foreach ($value['options'] as $_key => $_values) {
999
+ $parm = ($_values['id']) ? get_option($_values['id'], $_values['default']) : $_values['default'];
1000
+ $parm = ('checkbox'==$_values['input'] && ''==$parm) ? '0' : $parm;
1001
+ if(!$_values['hide'] && $parm!='') {
1002
+ $quote = (is_numeric($parm) || $_values['noquotes']) ? '' : '\'';
1003
+ if ($more>0)
1004
+ echo ',';
1005
+ echo ' \''.$_key.'\' : ';
1006
+ if ('checkbox'==$_values['input'])
1007
+ echo ( '1' == $parm ) ? 'true' : 'false';
1008
+ else
1009
+ echo $quote.$parm.$quote;
1010
+ $more++;
1011
+ }
1012
+ }
1013
+ echo ' }) );';
1014
+
1015
+ }
1016
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1017
  echo"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1018
  });
1019
  </script>
1020
+
1021
  ";
1022
  }
1023
 
1024
  // FancyBox Media Settings Section on Settings > Media admin page
1025
  function easy_fancybox_settings_section() {
1026
+ echo '<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=ravanhagen%40gmail%2ecom&item_name=Easy%20FancyBox&item_number=&no_shipping=0&tax=0&bn=PP%2dDonationsBF&charset=UTF%2d8&lc=us" title="'.__('Donate to Easy FancyBox plugin development with PayPal - it\'s fast, free and secure!','easy-fancybox').'"><img src="https://www.paypal.com/en_US/i/btn/x-click-but7.gif" style="border:none;float:right;margin:0 0 10px 10px" alt="'.__('Donate to Easy FancyBox plugin development with PayPal - it\'s fast, free and secure!','easy-fancybox').'" width="72" height="29" /></a><p>'.__('The options in this section are provided by the plugin <strong><a href="http://4visions.nl/en/wordpress-plugins/easy-fancybox/">Easy FancyBox</a></strong> and determine the <strong>Media Lightbox</strong> overlay appearance and behaviour controlled by <strong><a href="http://fancybox.net/">FancyBox</a></strong>.','easy-fancybox').' '.__('First adjust the <strong>Global settings</strong>, then enable each of the other sub-sections that you need and adjust its specific settings.','easy-fancybox').'</p><p>'.__('Note: Each additional sub-section and features like <em>Auto-detection</em>, <em>Elastic transitions</em> and all <em>Easing effects</em> (except Swing) will have some extra impact on client-side page speed. Enable only those sub-sections and options that you actually need on your site.','easy-fancybox').' '.__('Some setting for Title Position and Transition are unavailable for swf, video, pdf and iframe content to ensure browser compatibility and readability.','easy-fancybox').'</p>';
1027
  }
1028
+
1029
  // FancyBox Media Settings Fields
1030
  function easy_fancybox_settings_fields($args){
1031
  switch($args['input']) {
1035
  echo $args['description'];
1036
  break;
1037
  case 'select':
1038
+ if( !empty($args['label_for']) )
1039
+ echo '<label for="'.$args['label_for'].'">'.$args['title'].'</label> ';
1040
+ else
1041
+ echo $args['title'];
1042
  echo '
1043
  <select name="'.$args['id'].'" id="'.$args['id'].'">';
1044
  foreach ($args['options'] as $optionkey => $optionvalue) {
1049
  echo '
1050
  </select> ';
1051
  if( empty($args['label_for']) )
1052
+ echo '<label for="'.$args['id'].'">'.$args['description'].'</label> ';
1053
  else
1054
+ echo $args['description'];
1055
  break;
1056
  case 'checkbox':
1057
+ if( !empty($args['label_for']) )
1058
+ echo '<label for="'.$args['label_for'].'">'.$args['title'].'</label> ';
1059
+ else
1060
+ echo $args['title'];
1061
  $value = esc_attr( get_option($args['id'], $args['default']) );
1062
  if ($value == "1")
1063
  $checked = ' checked="checked"';
1067
  $default = __('Checked','easy-fancybox');
1068
  else
1069
  $default = __('Unchecked','easy-fancybox');
1070
+ if( empty($args['label_for']) )
1071
+ echo '
1072
+ <label><input type="checkbox" name="'.$args['id'].'" id="'.$args['id'].'" value="1" '.$checked.'/> '.$args['description'].'</label><br />';
1073
+ else
1074
+ echo '
1075
+ <input type="checkbox" name="'.$args['id'].'" id="'.$args['id'].'" value="1" '.$checked.'/> '.$args['description'].'<br />';
1076
  break;
1077
  case 'text':
1078
+ if( !empty($args['label_for']) )
1079
+ echo '<label for="'.$args['label_for'].'">'.$args['title'].'</label> ';
1080
+ else
1081
+ echo $args['title'];
1082
  echo '
1083
+ <input type="text" name="'.$args['id'].'" id="'.$args['id'].'" value="'.esc_attr( get_option($args['id'], $args['default']) ).'" class="'.$args['class'].'"/> ';
1084
  if( empty($args['label_for']) )
1085
+ echo '<label for="'.$args['id'].'">'.$args['description'].'</label> ';
1086
  else
1087
+ echo $args['description'];
1088
  break;
1089
  default:
1090
  echo $args['description'];
1101
  foreach ($easy_fancybox_array as $key => $value) {
1102
  add_settings_field( 'fancybox_'.$key, $value['title'], 'easy_fancybox_settings_fields', 'media', 'fancybox_section', $value);
1103
  if ($value['input']=='multiple')
1104
+ foreach ($value['options'] as $_value)
1105
+ if ($_value['id']) register_setting( 'media', $_value['id'] );
1106
  else
1107
+ if ($value['id']) register_setting( 'media', 'fancybox_'.$key );
1108
  }
1109
  }
1110
 
1111
  function easy_fancybox_enqueue() {
1112
+ $easy_fancybox_array = easy_fancybox_settings();
1113
+
1114
+ // check for any enabled sections plus the need for easing script
1115
+ $do_fancybox = false;
1116
+ $easing = false;
1117
+ foreach ($easy_fancybox_array as $value) {
1118
+ // anything enabled?
1119
+ if ( '1' == get_option($value['options']['enable']['id'],$value['options']['enable']['default']) )
1120
+ $do_fancybox = true;
1121
+ // easing anyone?
1122
+ if ( ( 'elastic' == get_option($value['options']['transitionIn']['id'],$value['options']['transitionIn']['default']) || 'elastic' == get_option($value['options']['transitionOut']['id'],$value['options']['transitionOut']['default']) ) && ( '' != get_option($value['options']['easingIn']['id'],$value['options']['easingIn']['default']) || '' != get_option($value['options']['easingOut']['id'],$value['options']['easingOut']['default']) ) )
1123
+ $easing = true;
1124
+ }
1125
+ if (!$do_fancybox)
1126
+ return;
1127
+
1128
+
1129
+ // check if easy-fancybox.php is moved one dir up like in WPMU's /mu-plugins/
1130
  // NOTE: don't use WP_PLUGIN_URL to avoid problems when installed in /mu-plugins/
1131
  $efb_subdir = (file_exists(dirname(__FILE__).'/easy-fancybox')) ? 'easy-fancybox' : '';
1132
 
1133
  // ENQUEUE
1134
  // register main fancybox script
1135
+ wp_enqueue_script('jquery.fancybox', plugins_url($efb_subdir, __FILE__).'/fancybox/jquery.fancybox-'.FANCYBOX_VERSION.'.pack.js', array('jquery'), FANCYBOX_VERSION);
1136
 
1137
+ foreach ($easy_fancybox_array as $value) {
1138
+ if( ( 'elastic' == get_option($value['options']['transitionIn']['id'],$value['options']['transitionIn']['default']) || 'elastic' == get_option($value['options']['transitionOut']['id'],$value['options']['transitionOut']['default']) ) && ( '' != get_option($value['options']['easingIn']['id'],$value['options']['easingIn']['default']) || '' != get_option($value['options']['easingOut']['id'],$value['options']['easingOut']['default']) ) ) {
1139
+ $easing = true;
1140
+ break;
1141
+ }
1142
+ }
1143
+ if ( $easing ) {
1144
  // first get rid of previously registered variants of jquery.easing (by other plugins)
1145
  wp_deregister_script('jquery.easing');
1146
  wp_deregister_script('jqueryeasing');
1147
  wp_deregister_script('jquery-easing');
1148
  wp_deregister_script('easing');
1149
  // then register our version
1150
+ wp_enqueue_script('jquery.easing', plugins_url($efb_subdir, __FILE__).'/fancybox/jquery.easing-'.EASING_VERSION.'.pack.js', array('jquery'), EASING_VERSION);
1151
  }
1152
 
1153
  // first get rid of previously registered variants of jquery.mousewheel (by other plugins)
1156
  wp_deregister_script('jquery-mousewheel');
1157
  wp_deregister_script('mousewheel');
1158
  // then register our version
1159
+ wp_enqueue_script('jquery.mousewheel', plugins_url($efb_subdir, __FILE__).'/fancybox/jquery.mousewheel-'.MOUSEWHEEL_VERSION.'.pack.js', array('jquery'), MOUSEWHEEL_VERSION);
1160
 
1161
  // register style
1162
+ wp_enqueue_style('easy-fancybox.css', plugins_url($efb_subdir, __FILE__).'/easy-fancybox.css.php', false, FANCYBOX_VERSION, 'screen');
1163
+
1164
+ }
1165
+
1166
+ // Hack to fix missing wmode in (auto)embed code based on Crantea Mihaita's work-around on
1167
+ // http://www.mehigh.biz/wordpress/adding-wmode-transparent-to-wordpress-3-media-embeds.html
1168
+ if(!function_exists('add_video_wmode_opaque')) {
1169
+ function add_video_wmode_opaque($html, $url, $attr) {
1170
+ if (strpos($html, "<embed src=" ) !== false) {
1171
+ $html = str_replace('</param><embed', '</param><param name="wmode" value="opaque"></param><embed wmode="opaque" ', $html);
1172
+ return $html;
1173
+ } else {
1174
+ return $html;
1175
+ }
1176
+ }
1177
  }
1178
 
1179
  // HOOKS //
1180
 
1181
+ add_filter('embed_oembed_html', 'add_video_wmode_opaque', 10, 3);
1182
+
1183
  add_action('wp_enqueue_scripts', 'easy_fancybox_enqueue', 999);
1184
  add_action('wp_head', 'easy_fancybox');
1185
 
fancybox/jquery.fancybox-1.3.3.pack.js DELETED
@@ -1,46 +0,0 @@
1
- /*
2
- * FancyBox - jQuery Plugin
3
- * Simple and fancy lightbox alternative
4
- *
5
- * Examples and documentation at: http://fancybox.net
6
- *
7
- * Copyright (c) 2008 - 2010 Janis Skarnelis
8
- * That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated.
9
- *
10
- * Version: 1.3.3 (04/11/2010)
11
- * Requires: jQuery v1.3+
12
- *
13
- * Dual licensed under the MIT and GPL licenses:
14
- * http://www.opensource.org/licenses/mit-license.php
15
- * http://www.gnu.org/licenses/gpl.html
16
- */
17
-
18
- ;(function(a){var m,t,u,f,D,j,E,n,z,A,q=0,e={},o=[],p=0,c={},l=[],G=null,v=new Image,J=/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i,W=/[^\.]\.(swf)\s*$/i,K,L=1,y=0,s="",r,i,h=false,B=a.extend(a("<div/>")[0],{prop:0}),M=a.browser.msie&&a.browser.version<7&&!window.XMLHttpRequest,N=function(){t.hide();v.onerror=v.onload=null;G&&G.abort();m.empty()},O=function(){if(false===e.onError(o,q,e)){t.hide();h=false}else{e.titleShow=false;e.width="auto";e.height="auto";m.html('<p id="fancybox-error">The requested content cannot be loaded.<br />Please try again later.</p>');
19
- F()}},I=function(){var b=o[q],d,g,k,C,P,w;N();e=a.extend({},a.fn.fancybox.defaults,typeof a(b).data("fancybox")=="undefined"?e:a(b).data("fancybox"));w=e.onStart(o,q,e);if(w===false)h=false;else{if(typeof w=="object")e=a.extend(e,w);k=e.title||(b.nodeName?a(b).attr("title"):b.title)||"";if(b.nodeName&&!e.orig)e.orig=a(b).children("img:first").length?a(b).children("img:first"):a(b);if(k===""&&e.orig&&e.titleFromAlt)k=e.orig.attr("alt");d=e.href||(b.nodeName?a(b).attr("href"):b.href)||null;if(/^(?:javascript)/i.test(d)||
20
- d=="#")d=null;if(e.type){g=e.type;if(!d)d=e.content}else if(e.content)g="html";else if(d)g=d.match(J)?"image":d.match(W)?"swf":a(b).hasClass("iframe")?"iframe":d.indexOf("#")===0?"inline":"ajax";if(g){if(g=="inline"){b=d.substr(d.indexOf("#"));g=a(b).length>0?"inline":"ajax"}e.type=g;e.href=d;e.title=k;if(e.autoDimensions&&e.type!=="iframe"&&e.type!=="swf"){e.width="auto";e.height="auto"}if(e.modal){e.overlayShow=true;e.hideOnOverlayClick=false;e.hideOnContentClick=false;e.enableEscapeButton=false;
21
- e.showCloseButton=false}e.padding=parseInt(e.padding,10);e.margin=parseInt(e.margin,10);m.css("padding",e.padding+e.margin);a(".fancybox-inline-tmp").unbind("fancybox-cancel").bind("fancybox-change",function(){a(this).replaceWith(j.children())});switch(g){case "html":m.html(e.content);F();break;case "inline":if(a(b).parent().is("#fancybox-content")===true){h=false;break}a('<div class="fancybox-inline-tmp" />').hide().insertBefore(a(b)).bind("fancybox-cleanup",function(){a(this).replaceWith(j.children())}).bind("fancybox-cancel",
22
- function(){a(this).replaceWith(m.children())});a(b).appendTo(m);F();break;case "image":h=false;a.fancybox.showActivity();v=new Image;v.onerror=function(){O()};v.onload=function(){h=true;v.onerror=v.onload=null;e.width=v.width;e.height=v.height;a("<img />").attr({id:"fancybox-img",src:v.src,alt:e.title}).appendTo(m);Q()};v.src=d;break;case "swf":e.scrolling="no";e.autoDimensions=false;C='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+e.width+'" height="'+e.height+'"><param name="movie" value="'+
23
- d+'"></param>';P="";a.each(e.swf,function(x,H){C+='<param name="'+x+'" value="'+H+'"></param>';P+=" "+x+'="'+H+'"'});C+='<embed src="'+d+'" type="application/x-shockwave-flash" width="'+e.width+'" height="'+e.height+'"'+P+"></embed></object>";m.html(C);F();break;case "ajax":h=false;a.fancybox.showActivity();e.ajax.win=e.ajax.success;G=a.ajax(a.extend({},e.ajax,{url:d,data:e.ajax.data||{},error:function(x){x.status>0&&O()},success:function(x,H,R){if((typeof R=="object"?R:G).status==200){if(typeof e.ajax.win==
24
- "function"){w=e.ajax.win(d,x,H,R);if(w===false){t.hide();return}else if(typeof w=="string"||typeof w=="object")x=w}m.html(x);F()}}}));break;case "iframe":e.autoDimensions=false;Q()}}else O()}},F=function(){m.wrapInner('<div style="width:'+(e.width=="auto"?"auto":e.width+"px")+";height:"+(e.height=="auto"?"auto":e.height+"px")+";overflow: "+(e.scrolling=="auto"?"auto":e.scrolling=="yes"?"scroll":"hidden")+'"></div>');e.width=m.width();e.height=m.height();Q()},Q=function(){var b,d;t.hide();if(f.is(":visible")&&
25
- false===c.onCleanup(l,p,c)){a.event.trigger("fancybox-cancel");h=false}else{h=true;a(j.add(u)).unbind();a(window).unbind("resize.fb scroll.fb");a(document).unbind("keydown.fb");f.is(":visible")&&c.titlePosition!=="outside"&&f.css("height",f.height());l=o;p=q;c=e;if(c.overlayShow){u.css({"background-color":c.overlayColor,opacity:c.overlayOpacity,cursor:c.hideOnOverlayClick?"pointer":"auto",height:a(document).height()});if(!u.is(":visible")){M&&a("select:not(#fancybox-tmp select)").filter(function(){return this.style.visibility!==
26
- "hidden"}).css({visibility:"hidden"}).one("fancybox-cleanup",function(){this.style.visibility="inherit"});u.show()}}else u.hide();i=X();s=c.title||"";y=0;n.empty().removeAttr("style").removeClass();if(c.titleShow!==false){if(a.isFunction(c.titleFormat))b=c.titleFormat(s,l,p,c);else b=s&&s.length?c.titlePosition=="float"?'<table id="fancybox-title-float-wrap" cellpadding="0" cellspacing="0"><tr><td id="fancybox-title-float-left"></td><td id="fancybox-title-float-main">'+s+'</td><td id="fancybox-title-float-right"></td></tr></table>':
27
- '<div id="fancybox-title-'+c.titlePosition+'">'+s+"</div>":false;s=b;if(!(!s||s==="")){n.addClass("fancybox-title-"+c.titlePosition).html(s).appendTo("body").show();switch(c.titlePosition){case "inside":n.css({width:i.width-c.padding*2,marginLeft:c.padding,marginRight:c.padding});y=n.outerHeight(true);n.appendTo(D);i.height+=y;break;case "over":n.css({marginLeft:c.padding,width:i.width-c.padding*2,bottom:c.padding}).appendTo(D);break;case "float":n.css("left",parseInt((n.width()-i.width-40)/2,10)*
28
- -1).appendTo(f);break;default:n.css({width:i.width-c.padding*2,paddingLeft:c.padding,paddingRight:c.padding}).appendTo(f)}}}n.hide();if(f.is(":visible")){a(E.add(z).add(A)).hide();b=f.position();r={top:b.top,left:b.left,width:f.width(),height:f.height()};d=r.width==i.width&&r.height==i.height;j.fadeTo(c.changeFade,0.3,function(){var g=function(){j.html(m.contents()).fadeTo(c.changeFade,1,S)};a.event.trigger("fancybox-change");j.empty().removeAttr("filter").css({"border-width":c.padding,width:i.width-
29
- c.padding*2,height:e.autoDimensions?"auto":i.height-y-c.padding*2});if(d)g();else{B.prop=0;a(B).animate({prop:1},{duration:c.changeSpeed,easing:c.easingChange,step:T,complete:g})}})}else{f.removeAttr("style");j.css("border-width",c.padding);if(c.transitionIn=="elastic"){r=V();j.html(m.contents());f.show();if(c.opacity)i.opacity=0;B.prop=0;a(B).animate({prop:1},{duration:c.speedIn,easing:c.easingIn,step:T,complete:S})}else{c.titlePosition=="inside"&&y>0&&n.show();j.css({width:i.width-c.padding*2,height:e.autoDimensions?
30
- "auto":i.height-y-c.padding*2}).html(m.contents());f.css(i).fadeIn(c.transitionIn=="none"?0:c.speedIn,S)}}}},Y=function(){if(c.enableEscapeButton||c.enableKeyboardNav)a(document).bind("keydown.fb",function(b){if(b.keyCode==27&&c.enableEscapeButton){b.preventDefault();a.fancybox.close()}else if((b.keyCode==37||b.keyCode==39)&&c.enableKeyboardNav&&b.target.tagName!=="INPUT"&&b.target.tagName!=="TEXTAREA"&&b.target.tagName!=="SELECT"){b.preventDefault();a.fancybox[b.keyCode==37?"prev":"next"]()}});if(c.showNavArrows){if(c.cyclic&&
31
- l.length>1||p!==0)z.show();if(c.cyclic&&l.length>1||p!=l.length-1)A.show()}else{z.hide();A.hide()}},S=function(){if(!a.support.opacity){j.get(0).style.removeAttribute("filter");f.get(0).style.removeAttribute("filter")}if(e.autoDimensions){f.css("height","auto");j.css("height","auto")}s&&s.length&&n.show();c.showCloseButton&&E.show();Y();c.hideOnContentClick&&j.bind("click",a.fancybox.close);c.hideOnOverlayClick&&u.bind("click",a.fancybox.close);a(window).bind("resize.fb",a.fancybox.resize);c.centerOnScroll&&
32
- a(window).bind("scroll.fb",a.fancybox.center);if(c.type=="iframe")a('<iframe id="fancybox-frame" name="fancybox-frame'+(new Date).getTime()+'" frameborder="0" hspace="0" '+(a.browser.msie?'allowtransparency="true""':"")+' scrolling="'+e.scrolling+'" src="'+c.href+'"></iframe>').appendTo(j);f.show();h=false;a.fancybox.center();c.onComplete(l,p,c);var b,d;if(l.length-1>p){b=l[p+1].href;if(typeof b!=="undefined"&&b.match(J)){d=new Image;d.src=b}}if(p>0){b=l[p-1].href;if(typeof b!=="undefined"&&b.match(J)){d=
33
- new Image;d.src=b}}},T=function(b){var d={width:parseInt(r.width+(i.width-r.width)*b,10),height:parseInt(r.height+(i.height-r.height)*b,10),top:parseInt(r.top+(i.top-r.top)*b,10),left:parseInt(r.left+(i.left-r.left)*b,10)};if(typeof i.opacity!=="undefined")d.opacity=b<0.5?0.5:b;f.css(d);j.css({width:d.width-c.padding*2,height:d.height-y*b-c.padding*2})},U=function(){return[a(window).width()-c.margin*2,a(window).height()-c.margin*2,a(document).scrollLeft()+c.margin,a(document).scrollTop()+c.margin]},
34
- X=function(){var b=U(),d={},g=c.autoScale,k=c.padding*2;d.width=c.width.toString().indexOf("%")>-1?parseInt(b[0]*parseFloat(c.width)/100,10):c.width+k;d.height=c.height.toString().indexOf("%")>-1?parseInt(b[1]*parseFloat(c.height)/100,10):c.height+k;if(g&&(d.width>b[0]||d.height>b[1]))if(e.type=="image"||e.type=="swf"){g=c.width/c.height;if(d.width>b[0]){d.width=b[0];d.height=parseInt((d.width-k)/g+k,10)}if(d.height>b[1]){d.height=b[1];d.width=parseInt((d.height-k)*g+k,10)}}else{d.width=Math.min(d.width,
35
- b[0]);d.height=Math.min(d.height,b[1])}d.top=parseInt(Math.max(b[3]-20,b[3]+(b[1]-d.height-40)*0.5),10);d.left=parseInt(Math.max(b[2]-20,b[2]+(b[0]-d.width-40)*0.5),10);return d},V=function(){var b=e.orig?a(e.orig):false,d={};if(b&&b.length){d=b.offset();d.top+=parseInt(b.css("paddingTop"),10)||0;d.left+=parseInt(b.css("paddingLeft"),10)||0;d.top+=parseInt(b.css("border-top-width"),10)||0;d.left+=parseInt(b.css("border-left-width"),10)||0;d.width=b.width();d.height=b.height();d={width:d.width+c.padding*
36
- 2,height:d.height+c.padding*2,top:d.top-c.padding-20,left:d.left-c.padding-20}}else{b=U();d={width:c.padding*2,height:c.padding*2,top:parseInt(b[3]+b[1]*0.5,10),left:parseInt(b[2]+b[0]*0.5,10)}}return d},Z=function(){if(t.is(":visible")){a("div",t).css("top",L*-40+"px");L=(L+1)%12}else clearInterval(K)};a.fn.fancybox=function(b){if(!a(this).length)return this;a(this).data("fancybox",a.extend({},b,a.metadata?a(this).metadata():{})).unbind("click.fb").bind("click.fb",function(d){d.preventDefault();
37
- if(!h){h=true;a(this).blur();o=[];q=0;d=a(this).attr("rel")||"";if(!d||d==""||d==="nofollow")o.push(this);else{o=a("a[rel="+d+"], area[rel="+d+"]");q=o.index(this)}I()}});return this};a.fancybox=function(b,d){var g;if(!h){h=true;g=typeof d!=="undefined"?d:{};o=[];q=parseInt(g.index,10)||0;if(a.isArray(b)){for(var k=0,C=b.length;k<C;k++)if(typeof b[k]=="object")a(b[k]).data("fancybox",a.extend({},g,b[k]));else b[k]=a({}).data("fancybox",a.extend({content:b[k]},g));o=jQuery.merge(o,b)}else{if(typeof b==
38
- "object")a(b).data("fancybox",a.extend({},g,b));else b=a({}).data("fancybox",a.extend({content:b},g));o.push(b)}if(q>o.length||q<0)q=0;I()}};a.fancybox.showActivity=function(){clearInterval(K);t.show();K=setInterval(Z,66)};a.fancybox.hideActivity=function(){t.hide()};a.fancybox.next=function(){return a.fancybox.pos(p+1)};a.fancybox.prev=function(){return a.fancybox.pos(p-1)};a.fancybox.pos=function(b){if(!h){b=parseInt(b);o=l;if(b>-1&&b<l.length){q=b;I()}else if(c.cyclic&&l.length>1){q=b>=l.length?
39
- 0:l.length-1;I()}}};a.fancybox.cancel=function(){if(!h){h=true;a.event.trigger("fancybox-cancel");N();e.onCancel(o,q,e);h=false}};a.fancybox.close=function(){function b(){u.fadeOut("fast");n.empty().hide();f.hide();a.event.trigger("fancybox-cleanup");j.empty();c.onClosed(l,p,c);l=e=[];p=q=0;c=e={};h=false}if(!(h||f.is(":hidden"))){h=true;if(c&&false===c.onCleanup(l,p,c))h=false;else{N();a(E.add(z).add(A)).hide();a(j.add(u)).unbind();a(window).unbind("resize.fb scroll.fb");a(document).unbind("keydown.fb");
40
- j.find("iframe").attr("src",M&&/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank");c.titlePosition!=="inside"&&n.empty();f.stop();if(c.transitionOut=="elastic"){r=V();var d=f.position();i={top:d.top,left:d.left,width:f.width(),height:f.height()};if(c.opacity)i.opacity=1;n.empty().hide();B.prop=1;a(B).animate({prop:0},{duration:c.speedOut,easing:c.easingOut,step:T,complete:b})}else f.fadeOut(c.transitionOut=="none"?0:c.speedOut,b)}}};a.fancybox.resize=function(){u.is(":visible")&&
41
- u.css("height",a(document).height());a.fancybox.center(true)};a.fancybox.center=function(b){var d,g;if(!h){g=b===true?1:0;d=U();!g&&(f.width()>d[0]||f.height()>d[1])||f.stop().animate({top:parseInt(Math.max(d[3]-20,d[3]+(d[1]-j.height()-40)*0.5-c.padding)),left:parseInt(Math.max(d[2]-20,d[2]+(d[0]-j.width()-40)*0.5-c.padding))},typeof b=="number"?b:200)}};a.fancybox.init=function(){if(!a("#fancybox-wrap").length){a("body").append(m=a('<div id="fancybox-tmp"></div>'),t=a('<div id="fancybox-loading"><div></div></div>'),
42
- u=a('<div id="fancybox-overlay"></div>'),f=a('<div id="fancybox-wrap"></div>'));D=a('<div id="fancybox-outer"></div>').append('<div class="fancybox-bg" id="fancybox-bg-n"></div><div class="fancybox-bg" id="fancybox-bg-ne"></div><div class="fancybox-bg" id="fancybox-bg-e"></div><div class="fancybox-bg" id="fancybox-bg-se"></div><div class="fancybox-bg" id="fancybox-bg-s"></div><div class="fancybox-bg" id="fancybox-bg-sw"></div><div class="fancybox-bg" id="fancybox-bg-w"></div><div class="fancybox-bg" id="fancybox-bg-nw"></div>').appendTo(f);
43
- D.append(j=a('<div id="fancybox-content"></div>'),E=a('<a id="fancybox-close"></a>'),n=a('<div id="fancybox-title"></div>'),z=a('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'),A=a('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>'));E.click(a.fancybox.close);t.click(a.fancybox.cancel);z.click(function(b){b.preventDefault();a.fancybox.prev()});A.click(function(b){b.preventDefault();a.fancybox.next()});
44
- a.fn.mousewheel&&f.bind("mousewheel.fb",function(b,d){if(h||c.type=="image")b.preventDefault();a.fancybox[d>0?"prev":"next"]()});a.support.opacity||f.addClass("fancybox-ie");if(M){t.addClass("fancybox-ie6");f.addClass("fancybox-ie6");a('<iframe id="fancybox-hide-sel-frame" src="'+(/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank")+'" scrolling="no" border="0" frameborder="0" tabindex="-1"></iframe>').prependTo(D)}}};a.fn.fancybox.defaults={padding:10,margin:40,opacity:false,
45
- modal:false,cyclic:false,scrolling:"auto",width:560,height:340,autoScale:true,autoDimensions:true,centerOnScroll:false,ajax:{},swf:{wmode:"transparent"},hideOnOverlayClick:true,hideOnContentClick:false,overlayShow:true,overlayOpacity:0.7,overlayColor:"#777",titleShow:true,titlePosition:"float",titleFormat:null,titleFromAlt:false,transitionIn:"fade",transitionOut:"fade",speedIn:300,speedOut:300,changeSpeed:300,changeFade:"fast",easingIn:"swing",easingOut:"swing",showCloseButton:true,showNavArrows:true,
46
- enableEscapeButton:true,enableKeyboardNav:true,onStart:function(){},onCancel:function(){},onComplete:function(){},onCleanup:function(){},onClosed:function(){},onError:function(){}};a(document).ready(function(){a.fancybox.init()})})(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fancybox/{jquery.fancybox-1.3.3.css → jquery.fancybox-1.3.4.css} RENAMED
@@ -7,7 +7,7 @@
7
  * Copyright (c) 2008 - 2010 Janis Skarnelis
8
  * That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated.
9
  *
10
- * Version: 1.3.3 (04/11/2010)
11
  * Requires: jQuery v1.3+
12
  *
13
  * Dual licensed under the MIT and GPL licenses:
7
  * Copyright (c) 2008 - 2010 Janis Skarnelis
8
  * That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated.
9
  *
10
+ * Version: 1.3.4 (11/11/2010)
11
  * Requires: jQuery v1.3+
12
  *
13
  * Dual licensed under the MIT and GPL licenses:
fancybox/{jquery.fancybox-1.3.3.js → jquery.fancybox-1.3.4.js} RENAMED
@@ -3,11 +3,11 @@
3
  * Simple and fancy lightbox alternative
4
  *
5
  * Examples and documentation at: http://fancybox.net
6
- *
7
  * Copyright (c) 2008 - 2010 Janis Skarnelis
8
  * That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated.
9
- *
10
- * Version: 1.3.3 (04/11/2010)
11
  * Requires: jQuery v1.3+
12
  *
13
  * Dual licensed under the MIT and GPL licenses:
@@ -141,9 +141,13 @@
141
  selectedOpts.href = href;
142
  selectedOpts.title = title;
143
 
144
- if (selectedOpts.autoDimensions && selectedOpts.type !== 'iframe' && selectedOpts.type !== 'swf') {
145
- selectedOpts.width = 'auto';
146
- selectedOpts.height = 'auto';
 
 
 
 
147
  }
148
 
149
  if (selectedOpts.modal) {
@@ -213,7 +217,6 @@
213
 
214
  case 'swf':
215
  selectedOpts.scrolling = 'no';
216
- selectedOpts.autoDimensions = false;
217
 
218
  str = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="' + selectedOpts.width + '" height="' + selectedOpts.height + '"><param name="movie" value="' + href + '"></param>';
219
  emb = '';
@@ -268,14 +271,31 @@
268
  break;
269
 
270
  case 'iframe':
271
- selectedOpts.autoDimensions = false;
272
  _show();
273
  break;
274
  }
275
  },
276
 
277
  _process_inline = function() {
278
- tmp.wrapInner('<div style="width:' + (selectedOpts.width == 'auto' ? 'auto' : selectedOpts.width + 'px') + ';height:' + (selectedOpts.height == 'auto' ? 'auto' : selectedOpts.height + 'px') + ';overflow: ' + (selectedOpts.scrolling == 'auto' ? 'auto' : (selectedOpts.scrolling == 'yes' ? 'scroll' : 'hidden')) + '"></div>');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
279
 
280
  selectedOpts.width = tmp.width();
281
  selectedOpts.height = tmp.height();
@@ -351,7 +371,6 @@
351
  _process_title();
352
 
353
  if (wrap.is(":visible")) {
354
-
355
  $( close.add( nav_left ).add( nav_right ) ).hide();
356
 
357
  pos = wrap.position(),
@@ -379,7 +398,6 @@
379
  'border-width' : currentOpts.padding,
380
  'width' : final_pos.width - currentOpts.padding * 2,
381
  'height' : selectedOpts.autoDimensions ? 'auto' : final_pos.height - titleHeight - currentOpts.padding * 2
382
- //'height' : currentOpts.type == 'image' || currentOpts.type == 'swf' || currentOpts.type == 'iframe' ? final_pos.height - titleHeight - currentOpts.padding * 2 : 'auto'
383
  });
384
 
385
  if (equal) {
@@ -435,12 +453,10 @@
435
  .css({
436
  'width' : final_pos.width - currentOpts.padding * 2,
437
  'height' : selectedOpts.autoDimensions ? 'auto' : final_pos.height - titleHeight - currentOpts.padding * 2
438
- //'height' : currentOpts.type == 'image' || currentOpts.type == 'swf' || currentOpts.type == 'iframe' ? final_pos.height - titleHeight - currentOpts.padding * 2 : 'auto'
439
  })
440
  .html( tmp.contents() );
441
 
442
  wrap
443
- //.hide()
444
  .css(final_pos)
445
  .fadeIn( currentOpts.transitionIn == 'none' ? 0 : currentOpts.speedIn, _finish );
446
  },
@@ -566,13 +582,10 @@
566
  }
567
 
568
  if (selectedOpts.autoDimensions) {
569
- wrap.css('height', 'auto');
570
  content.css('height', 'auto');
571
  }
572
 
573
- //if (currentOpts.type !== 'image' && currentOpts.type !== 'swf' && currentOpts.type !== 'iframe') {
574
- //content.css('height', 'auto');
575
- //}
576
 
577
  if (titleStr && titleStr.length) {
578
  title.show();
@@ -583,7 +596,7 @@
583
  }
584
 
585
  _set_navigation();
586
-
587
  if (currentOpts.hideOnContentClick) {
588
  content.bind('click', $.fancybox.close);
589
  }
@@ -1059,11 +1072,13 @@
1059
 
1060
  if ($.fn.mousewheel) {
1061
  wrap.bind('mousewheel.fb', function(e, delta) {
1062
- if (busy || currentOpts.type == 'image') {
1063
  e.preventDefault();
1064
- }
1065
 
1066
- $.fancybox[ delta > 0 ? 'prev' : 'next']();
 
 
 
1067
  });
1068
  }
1069
 
3
  * Simple and fancy lightbox alternative
4
  *
5
  * Examples and documentation at: http://fancybox.net
6
+ *
7
  * Copyright (c) 2008 - 2010 Janis Skarnelis
8
  * That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated.
9
+ *
10
+ * Version: 1.3.4 (11/11/2010)
11
  * Requires: jQuery v1.3+
12
  *
13
  * Dual licensed under the MIT and GPL licenses:
141
  selectedOpts.href = href;
142
  selectedOpts.title = title;
143
 
144
+ if (selectedOpts.autoDimensions) {
145
+ if (selectedOpts.type == 'html' || selectedOpts.type == 'inline' || selectedOpts.type == 'ajax') {
146
+ selectedOpts.width = 'auto';
147
+ selectedOpts.height = 'auto';
148
+ } else {
149
+ selectedOpts.autoDimensions = false;
150
+ }
151
  }
152
 
153
  if (selectedOpts.modal) {
217
 
218
  case 'swf':
219
  selectedOpts.scrolling = 'no';
 
220
 
221
  str = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="' + selectedOpts.width + '" height="' + selectedOpts.height + '"><param name="movie" value="' + href + '"></param>';
222
  emb = '';
271
  break;
272
 
273
  case 'iframe':
 
274
  _show();
275
  break;
276
  }
277
  },
278
 
279
  _process_inline = function() {
280
+ var
281
+ w = selectedOpts.width,
282
+ h = selectedOpts.height;
283
+
284
+ if (w.toString().indexOf('%') > -1) {
285
+ w = parseInt( ($(window).width() - (selectedOpts.margin * 2)) * parseFloat(w) / 100, 10) + 'px';
286
+
287
+ } else {
288
+ w = w == 'auto' ? 'auto' : w + 'px';
289
+ }
290
+
291
+ if (h.toString().indexOf('%') > -1) {
292
+ h = parseInt( ($(window).height() - (selectedOpts.margin * 2)) * parseFloat(h) / 100, 10) + 'px';
293
+
294
+ } else {
295
+ h = h == 'auto' ? 'auto' : h + 'px';
296
+ }
297
+
298
+ tmp.wrapInner('<div style="width:' + w + ';height:' + h + ';overflow: ' + (selectedOpts.scrolling == 'auto' ? 'auto' : (selectedOpts.scrolling == 'yes' ? 'scroll' : 'hidden')) + ';position:relative;"></div>');
299
 
300
  selectedOpts.width = tmp.width();
301
  selectedOpts.height = tmp.height();
371
  _process_title();
372
 
373
  if (wrap.is(":visible")) {
 
374
  $( close.add( nav_left ).add( nav_right ) ).hide();
375
 
376
  pos = wrap.position(),
398
  'border-width' : currentOpts.padding,
399
  'width' : final_pos.width - currentOpts.padding * 2,
400
  'height' : selectedOpts.autoDimensions ? 'auto' : final_pos.height - titleHeight - currentOpts.padding * 2
 
401
  });
402
 
403
  if (equal) {
453
  .css({
454
  'width' : final_pos.width - currentOpts.padding * 2,
455
  'height' : selectedOpts.autoDimensions ? 'auto' : final_pos.height - titleHeight - currentOpts.padding * 2
 
456
  })
457
  .html( tmp.contents() );
458
 
459
  wrap
 
460
  .css(final_pos)
461
  .fadeIn( currentOpts.transitionIn == 'none' ? 0 : currentOpts.speedIn, _finish );
462
  },
582
  }
583
 
584
  if (selectedOpts.autoDimensions) {
 
585
  content.css('height', 'auto');
586
  }
587
 
588
+ wrap.css('height', 'auto');
 
 
589
 
590
  if (titleStr && titleStr.length) {
591
  title.show();
596
  }
597
 
598
  _set_navigation();
599
+
600
  if (currentOpts.hideOnContentClick) {
601
  content.bind('click', $.fancybox.close);
602
  }
1072
 
1073
  if ($.fn.mousewheel) {
1074
  wrap.bind('mousewheel.fb', function(e, delta) {
1075
+ if (busy) {
1076
  e.preventDefault();
 
1077
 
1078
+ } else if ($(e.target).get(0).clientHeight == 0 || $(e.target).get(0).scrollHeight === $(e.target).get(0).clientHeight) {
1079
+ e.preventDefault();
1080
+ $.fancybox[ delta > 0 ? 'prev' : 'next']();
1081
+ }
1082
  });
1083
  }
1084
 
fancybox/jquery.fancybox-1.3.4.pack.js ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * FancyBox - jQuery Plugin
3
+ * Simple and fancy lightbox alternative
4
+ *
5
+ * Examples and documentation at: http://fancybox.net
6
+ *
7
+ * Copyright (c) 2008 - 2010 Janis Skarnelis
8
+ * That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated.
9
+ *
10
+ * Version: 1.3.4 (11/11/2010)
11
+ * Requires: jQuery v1.3+
12
+ *
13
+ * Dual licensed under the MIT and GPL licenses:
14
+ * http://www.opensource.org/licenses/mit-license.php
15
+ * http://www.gnu.org/licenses/gpl.html
16
+ */
17
+
18
+ ;(function(b){var m,t,u,f,D,j,E,n,z,A,q=0,e={},o=[],p=0,d={},l=[],G=null,v=new Image,J=/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i,W=/[^\.]\.(swf)\s*$/i,K,L=1,y=0,s="",r,i,h=false,B=b.extend(b("<div/>")[0],{prop:0}),M=b.browser.msie&&b.browser.version<7&&!window.XMLHttpRequest,N=function(){t.hide();v.onerror=v.onload=null;G&&G.abort();m.empty()},O=function(){if(false===e.onError(o,q,e)){t.hide();h=false}else{e.titleShow=false;e.width="auto";e.height="auto";m.html('<p id="fancybox-error">The requested content cannot be loaded.<br />Please try again later.</p>');
19
+ F()}},I=function(){var a=o[q],c,g,k,C,P,w;N();e=b.extend({},b.fn.fancybox.defaults,typeof b(a).data("fancybox")=="undefined"?e:b(a).data("fancybox"));w=e.onStart(o,q,e);if(w===false)h=false;else{if(typeof w=="object")e=b.extend(e,w);k=e.title||(a.nodeName?b(a).attr("title"):a.title)||"";if(a.nodeName&&!e.orig)e.orig=b(a).children("img:first").length?b(a).children("img:first"):b(a);if(k===""&&e.orig&&e.titleFromAlt)k=e.orig.attr("alt");c=e.href||(a.nodeName?b(a).attr("href"):a.href)||null;if(/^(?:javascript)/i.test(c)||
20
+ c=="#")c=null;if(e.type){g=e.type;if(!c)c=e.content}else if(e.content)g="html";else if(c)g=c.match(J)?"image":c.match(W)?"swf":b(a).hasClass("iframe")?"iframe":c.indexOf("#")===0?"inline":"ajax";if(g){if(g=="inline"){a=c.substr(c.indexOf("#"));g=b(a).length>0?"inline":"ajax"}e.type=g;e.href=c;e.title=k;if(e.autoDimensions)if(e.type=="html"||e.type=="inline"||e.type=="ajax"){e.width="auto";e.height="auto"}else e.autoDimensions=false;if(e.modal){e.overlayShow=true;e.hideOnOverlayClick=false;e.hideOnContentClick=
21
+ false;e.enableEscapeButton=false;e.showCloseButton=false}e.padding=parseInt(e.padding,10);e.margin=parseInt(e.margin,10);m.css("padding",e.padding+e.margin);b(".fancybox-inline-tmp").unbind("fancybox-cancel").bind("fancybox-change",function(){b(this).replaceWith(j.children())});switch(g){case "html":m.html(e.content);F();break;case "inline":if(b(a).parent().is("#fancybox-content")===true){h=false;break}b('<div class="fancybox-inline-tmp" />').hide().insertBefore(b(a)).bind("fancybox-cleanup",function(){b(this).replaceWith(j.children())}).bind("fancybox-cancel",
22
+ function(){b(this).replaceWith(m.children())});b(a).appendTo(m);F();break;case "image":h=false;b.fancybox.showActivity();v=new Image;v.onerror=function(){O()};v.onload=function(){h=true;v.onerror=v.onload=null;e.width=v.width;e.height=v.height;b("<img />").attr({id:"fancybox-img",src:v.src,alt:e.title}).appendTo(m);Q()};v.src=c;break;case "swf":e.scrolling="no";C='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+e.width+'" height="'+e.height+'"><param name="movie" value="'+c+
23
+ '"></param>';P="";b.each(e.swf,function(x,H){C+='<param name="'+x+'" value="'+H+'"></param>';P+=" "+x+'="'+H+'"'});C+='<embed src="'+c+'" type="application/x-shockwave-flash" width="'+e.width+'" height="'+e.height+'"'+P+"></embed></object>";m.html(C);F();break;case "ajax":h=false;b.fancybox.showActivity();e.ajax.win=e.ajax.success;G=b.ajax(b.extend({},e.ajax,{url:c,data:e.ajax.data||{},error:function(x){x.status>0&&O()},success:function(x,H,R){if((typeof R=="object"?R:G).status==200){if(typeof e.ajax.win==
24
+ "function"){w=e.ajax.win(c,x,H,R);if(w===false){t.hide();return}else if(typeof w=="string"||typeof w=="object")x=w}m.html(x);F()}}}));break;case "iframe":Q()}}else O()}},F=function(){var a=e.width,c=e.height;a=a.toString().indexOf("%")>-1?parseInt((b(window).width()-e.margin*2)*parseFloat(a)/100,10)+"px":a=="auto"?"auto":a+"px";c=c.toString().indexOf("%")>-1?parseInt((b(window).height()-e.margin*2)*parseFloat(c)/100,10)+"px":c=="auto"?"auto":c+"px";m.wrapInner('<div style="width:'+a+";height:"+c+
25
+ ";overflow: "+(e.scrolling=="auto"?"auto":e.scrolling=="yes"?"scroll":"hidden")+';position:relative;"></div>');e.width=m.width();e.height=m.height();Q()},Q=function(){var a,c;t.hide();if(f.is(":visible")&&false===d.onCleanup(l,p,d)){b.event.trigger("fancybox-cancel");h=false}else{h=true;b(j.add(u)).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");f.is(":visible")&&d.titlePosition!=="outside"&&f.css("height",f.height());l=o;p=q;d=e;if(d.overlayShow){u.css({"background-color":d.overlayColor,
26
+ opacity:d.overlayOpacity,cursor:d.hideOnOverlayClick?"pointer":"auto",height:b(document).height()});if(!u.is(":visible")){M&&b("select:not(#fancybox-tmp select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one("fancybox-cleanup",function(){this.style.visibility="inherit"});u.show()}}else u.hide();i=X();s=d.title||"";y=0;n.empty().removeAttr("style").removeClass();if(d.titleShow!==false){if(b.isFunction(d.titleFormat))a=d.titleFormat(s,l,p,d);else a=s&&s.length?
27
+ d.titlePosition=="float"?'<table id="fancybox-title-float-wrap" cellpadding="0" cellspacing="0"><tr><td id="fancybox-title-float-left"></td><td id="fancybox-title-float-main">'+s+'</td><td id="fancybox-title-float-right"></td></tr></table>':'<div id="fancybox-title-'+d.titlePosition+'">'+s+"</div>":false;s=a;if(!(!s||s==="")){n.addClass("fancybox-title-"+d.titlePosition).html(s).appendTo("body").show();switch(d.titlePosition){case "inside":n.css({width:i.width-d.padding*2,marginLeft:d.padding,marginRight:d.padding});
28
+ y=n.outerHeight(true);n.appendTo(D);i.height+=y;break;case "over":n.css({marginLeft:d.padding,width:i.width-d.padding*2,bottom:d.padding}).appendTo(D);break;case "float":n.css("left",parseInt((n.width()-i.width-40)/2,10)*-1).appendTo(f);break;default:n.css({width:i.width-d.padding*2,paddingLeft:d.padding,paddingRight:d.padding}).appendTo(f)}}}n.hide();if(f.is(":visible")){b(E.add(z).add(A)).hide();a=f.position();r={top:a.top,left:a.left,width:f.width(),height:f.height()};c=r.width==i.width&&r.height==
29
+ i.height;j.fadeTo(d.changeFade,0.3,function(){var g=function(){j.html(m.contents()).fadeTo(d.changeFade,1,S)};b.event.trigger("fancybox-change");j.empty().removeAttr("filter").css({"border-width":d.padding,width:i.width-d.padding*2,height:e.autoDimensions?"auto":i.height-y-d.padding*2});if(c)g();else{B.prop=0;b(B).animate({prop:1},{duration:d.changeSpeed,easing:d.easingChange,step:T,complete:g})}})}else{f.removeAttr("style");j.css("border-width",d.padding);if(d.transitionIn=="elastic"){r=V();j.html(m.contents());
30
+ f.show();if(d.opacity)i.opacity=0;B.prop=0;b(B).animate({prop:1},{duration:d.speedIn,easing:d.easingIn,step:T,complete:S})}else{d.titlePosition=="inside"&&y>0&&n.show();j.css({width:i.width-d.padding*2,height:e.autoDimensions?"auto":i.height-y-d.padding*2}).html(m.contents());f.css(i).fadeIn(d.transitionIn=="none"?0:d.speedIn,S)}}}},Y=function(){if(d.enableEscapeButton||d.enableKeyboardNav)b(document).bind("keydown.fb",function(a){if(a.keyCode==27&&d.enableEscapeButton){a.preventDefault();b.fancybox.close()}else if((a.keyCode==
31
+ 37||a.keyCode==39)&&d.enableKeyboardNav&&a.target.tagName!=="INPUT"&&a.target.tagName!=="TEXTAREA"&&a.target.tagName!=="SELECT"){a.preventDefault();b.fancybox[a.keyCode==37?"prev":"next"]()}});if(d.showNavArrows){if(d.cyclic&&l.length>1||p!==0)z.show();if(d.cyclic&&l.length>1||p!=l.length-1)A.show()}else{z.hide();A.hide()}},S=function(){if(!b.support.opacity){j.get(0).style.removeAttribute("filter");f.get(0).style.removeAttribute("filter")}e.autoDimensions&&j.css("height","auto");f.css("height","auto");
32
+ s&&s.length&&n.show();d.showCloseButton&&E.show();Y();d.hideOnContentClick&&j.bind("click",b.fancybox.close);d.hideOnOverlayClick&&u.bind("click",b.fancybox.close);b(window).bind("resize.fb",b.fancybox.resize);d.centerOnScroll&&b(window).bind("scroll.fb",b.fancybox.center);if(d.type=="iframe")b('<iframe id="fancybox-frame" name="fancybox-frame'+(new Date).getTime()+'" frameborder="0" hspace="0" '+(b.browser.msie?'allowtransparency="true""':"")+' scrolling="'+e.scrolling+'" src="'+d.href+'"></iframe>').appendTo(j);
33
+ f.show();h=false;b.fancybox.center();d.onComplete(l,p,d);var a,c;if(l.length-1>p){a=l[p+1].href;if(typeof a!=="undefined"&&a.match(J)){c=new Image;c.src=a}}if(p>0){a=l[p-1].href;if(typeof a!=="undefined"&&a.match(J)){c=new Image;c.src=a}}},T=function(a){var c={width:parseInt(r.width+(i.width-r.width)*a,10),height:parseInt(r.height+(i.height-r.height)*a,10),top:parseInt(r.top+(i.top-r.top)*a,10),left:parseInt(r.left+(i.left-r.left)*a,10)};if(typeof i.opacity!=="undefined")c.opacity=a<0.5?0.5:a;f.css(c);
34
+ j.css({width:c.width-d.padding*2,height:c.height-y*a-d.padding*2})},U=function(){return[b(window).width()-d.margin*2,b(window).height()-d.margin*2,b(document).scrollLeft()+d.margin,b(document).scrollTop()+d.margin]},X=function(){var a=U(),c={},g=d.autoScale,k=d.padding*2;c.width=d.width.toString().indexOf("%")>-1?parseInt(a[0]*parseFloat(d.width)/100,10):d.width+k;c.height=d.height.toString().indexOf("%")>-1?parseInt(a[1]*parseFloat(d.height)/100,10):d.height+k;if(g&&(c.width>a[0]||c.height>a[1]))if(e.type==
35
+ "image"||e.type=="swf"){g=d.width/d.height;if(c.width>a[0]){c.width=a[0];c.height=parseInt((c.width-k)/g+k,10)}if(c.height>a[1]){c.height=a[1];c.width=parseInt((c.height-k)*g+k,10)}}else{c.width=Math.min(c.width,a[0]);c.height=Math.min(c.height,a[1])}c.top=parseInt(Math.max(a[3]-20,a[3]+(a[1]-c.height-40)*0.5),10);c.left=parseInt(Math.max(a[2]-20,a[2]+(a[0]-c.width-40)*0.5),10);return c},V=function(){var a=e.orig?b(e.orig):false,c={};if(a&&a.length){c=a.offset();c.top+=parseInt(a.css("paddingTop"),
36
+ 10)||0;c.left+=parseInt(a.css("paddingLeft"),10)||0;c.top+=parseInt(a.css("border-top-width"),10)||0;c.left+=parseInt(a.css("border-left-width"),10)||0;c.width=a.width();c.height=a.height();c={width:c.width+d.padding*2,height:c.height+d.padding*2,top:c.top-d.padding-20,left:c.left-d.padding-20}}else{a=U();c={width:d.padding*2,height:d.padding*2,top:parseInt(a[3]+a[1]*0.5,10),left:parseInt(a[2]+a[0]*0.5,10)}}return c},Z=function(){if(t.is(":visible")){b("div",t).css("top",L*-40+"px");L=(L+1)%12}else clearInterval(K)};
37
+ b.fn.fancybox=function(a){if(!b(this).length)return this;b(this).data("fancybox",b.extend({},a,b.metadata?b(this).metadata():{})).unbind("click.fb").bind("click.fb",function(c){c.preventDefault();if(!h){h=true;b(this).blur();o=[];q=0;c=b(this).attr("rel")||"";if(!c||c==""||c==="nofollow")o.push(this);else{o=b("a[rel="+c+"], area[rel="+c+"]");q=o.index(this)}I()}});return this};b.fancybox=function(a,c){var g;if(!h){h=true;g=typeof c!=="undefined"?c:{};o=[];q=parseInt(g.index,10)||0;if(b.isArray(a)){for(var k=
38
+ 0,C=a.length;k<C;k++)if(typeof a[k]=="object")b(a[k]).data("fancybox",b.extend({},g,a[k]));else a[k]=b({}).data("fancybox",b.extend({content:a[k]},g));o=jQuery.merge(o,a)}else{if(typeof a=="object")b(a).data("fancybox",b.extend({},g,a));else a=b({}).data("fancybox",b.extend({content:a},g));o.push(a)}if(q>o.length||q<0)q=0;I()}};b.fancybox.showActivity=function(){clearInterval(K);t.show();K=setInterval(Z,66)};b.fancybox.hideActivity=function(){t.hide()};b.fancybox.next=function(){return b.fancybox.pos(p+
39
+ 1)};b.fancybox.prev=function(){return b.fancybox.pos(p-1)};b.fancybox.pos=function(a){if(!h){a=parseInt(a);o=l;if(a>-1&&a<l.length){q=a;I()}else if(d.cyclic&&l.length>1){q=a>=l.length?0:l.length-1;I()}}};b.fancybox.cancel=function(){if(!h){h=true;b.event.trigger("fancybox-cancel");N();e.onCancel(o,q,e);h=false}};b.fancybox.close=function(){function a(){u.fadeOut("fast");n.empty().hide();f.hide();b.event.trigger("fancybox-cleanup");j.empty();d.onClosed(l,p,d);l=e=[];p=q=0;d=e={};h=false}if(!(h||f.is(":hidden"))){h=
40
+ true;if(d&&false===d.onCleanup(l,p,d))h=false;else{N();b(E.add(z).add(A)).hide();b(j.add(u)).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");j.find("iframe").attr("src",M&&/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank");d.titlePosition!=="inside"&&n.empty();f.stop();if(d.transitionOut=="elastic"){r=V();var c=f.position();i={top:c.top,left:c.left,width:f.width(),height:f.height()};if(d.opacity)i.opacity=1;n.empty().hide();B.prop=1;
41
+ b(B).animate({prop:0},{duration:d.speedOut,easing:d.easingOut,step:T,complete:a})}else f.fadeOut(d.transitionOut=="none"?0:d.speedOut,a)}}};b.fancybox.resize=function(){u.is(":visible")&&u.css("height",b(document).height());b.fancybox.center(true)};b.fancybox.center=function(a){var c,g;if(!h){g=a===true?1:0;c=U();!g&&(f.width()>c[0]||f.height()>c[1])||f.stop().animate({top:parseInt(Math.max(c[3]-20,c[3]+(c[1]-j.height()-40)*0.5-d.padding)),left:parseInt(Math.max(c[2]-20,c[2]+(c[0]-j.width()-40)*0.5-
42
+ d.padding))},typeof a=="number"?a:200)}};b.fancybox.init=function(){if(!b("#fancybox-wrap").length){b("body").append(m=b('<div id="fancybox-tmp"></div>'),t=b('<div id="fancybox-loading"><div></div></div>'),u=b('<div id="fancybox-overlay"></div>'),f=b('<div id="fancybox-wrap"></div>'));D=b('<div id="fancybox-outer"></div>').append('<div class="fancybox-bg" id="fancybox-bg-n"></div><div class="fancybox-bg" id="fancybox-bg-ne"></div><div class="fancybox-bg" id="fancybox-bg-e"></div><div class="fancybox-bg" id="fancybox-bg-se"></div><div class="fancybox-bg" id="fancybox-bg-s"></div><div class="fancybox-bg" id="fancybox-bg-sw"></div><div class="fancybox-bg" id="fancybox-bg-w"></div><div class="fancybox-bg" id="fancybox-bg-nw"></div>').appendTo(f);
43
+ D.append(j=b('<div id="fancybox-content"></div>'),E=b('<a id="fancybox-close"></a>'),n=b('<div id="fancybox-title"></div>'),z=b('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'),A=b('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>'));E.click(b.fancybox.close);t.click(b.fancybox.cancel);z.click(function(a){a.preventDefault();b.fancybox.prev()});A.click(function(a){a.preventDefault();b.fancybox.next()});
44
+ b.fn.mousewheel&&f.bind("mousewheel.fb",function(a,c){if(h)a.preventDefault();else if(b(a.target).get(0).clientHeight==0||b(a.target).get(0).scrollHeight===b(a.target).get(0).clientHeight){a.preventDefault();b.fancybox[c>0?"prev":"next"]()}});b.support.opacity||f.addClass("fancybox-ie");if(M){t.addClass("fancybox-ie6");f.addClass("fancybox-ie6");b('<iframe id="fancybox-hide-sel-frame" src="'+(/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank")+'" scrolling="no" border="0" frameborder="0" tabindex="-1"></iframe>').prependTo(D)}}};
45
+ b.fn.fancybox.defaults={padding:10,margin:40,opacity:false,modal:false,cyclic:false,scrolling:"auto",width:560,height:340,autoScale:true,autoDimensions:true,centerOnScroll:false,ajax:{},swf:{wmode:"transparent"},hideOnOverlayClick:true,hideOnContentClick:false,overlayShow:true,overlayOpacity:0.7,overlayColor:"#777",titleShow:true,titlePosition:"float",titleFormat:null,titleFromAlt:false,transitionIn:"fade",transitionOut:"fade",speedIn:300,speedOut:300,changeSpeed:300,changeFade:"fast",easingIn:"swing",
46
+ easingOut:"swing",showCloseButton:true,showNavArrows:true,enableEscapeButton:true,enableKeyboardNav:true,onStart:function(){},onCancel:function(){},onComplete:function(){},onCleanup:function(){},onClosed:function(){},onError:function(){}};b(document).ready(function(){b.fancybox.init()})})(jQuery);
jquery.fancybox.css.php DELETED
@@ -1,28 +0,0 @@
1
- <?php
2
- /* -------------------------------------
3
- Easy Fancybox Styleheet Template
4
- ------------------------------------- */
5
-
6
- header('Content-Type: text/css; charset=utf-8', true);
7
-
8
- $url = dirname($_SERVER['SCRIPT_NAME']);
9
- ?>
10
- /*
11
- * FancyBox - jQuery Plugin
12
- * Simple and fancy lightbox alternative
13
- *
14
- * Copyright (c) 2008 - 2010 Janis Skarnelis
15
- *
16
- * Version: 1.3.3 (04/11/2010)
17
- *
18
- * Dual licensed under the MIT and GPL licenses:
19
- * http://www.opensource.org/licenses/mit-license.php
20
- * http://www.gnu.org/licenses/gpl.html
21
- *
22
- * Adapted for Easy Fancybox - WordPress Plugin
23
- */
24
- #fancybox-loading{position:fixed;top:50%;left:50%;width:40px;height:40px;margin-top:-20px;margin-left:-20px;cursor:pointer;overflow:hidden;z-index:1104;display:none}#fancybox-loading div{position:absolute;top:0;left:0;width:40px;height:480px;background-image:url('fancybox/fancybox.png')}#fancybox-overlay{position:absolute;top:0;left:0;width:100%;z-index:1100;display:none}#fancybox-tmp{padding:0;margin:0;border:0;overflow:auto;display:none}#fancybox-wrap{position:absolute;top:0;left:0;padding:20px;z-index:1101;outline:none;display:none}#fancybox-outer{position:relative;width:100%;height:100%;background:#fff}#fancybox-content{width:0;height:0;padding:0;outline:none;position:relative;overflow:hidden;z-index:1102;border:0px solid #fff}#fancybox-hide-sel-frame{position:absolute;top:0;left:0;width:100%;height:100%;background:transparent;z-index:1101}#fancybox-close{position:absolute;top:-15px;right:-15px;width:30px;height:30px;background:transparent url('fancybox/fancybox.png') -40px 0px;cursor:pointer;z-index:1103;display:none}#fancybox-error{color:#444;font:normal 12px/20px Arial;padding:14px;margin:0}#fancybox-img{width:100%;height:100%;padding:0;margin:0;border:none;outline:none;line-height:0;vertical-align:top}#fancybox-frame{width:100%;height:100%;border:none;display:block}#fancybox-left,#fancybox-right{position:absolute;bottom:0px;height:100%;width:35%;cursor:pointer;outline:none;background:transparent url('fancybox/blank.gif');z-index:1102;display:none}#fancybox-left{left:0px}#fancybox-right{right:0px}#fancybox-left-ico,#fancybox-right-ico{position:absolute;top:50%;left:-9999px;width:30px;height:30px;margin-top:-15px;cursor:pointer;z-index:1102;display:block}#fancybox-left-ico{background-image:url('fancybox/fancybox.png');background-position:-40px -30px}#fancybox-right-ico{background-image:url('fancybox/fancybox.png');background-position:-40px -60px}#fancybox-left:hover,#fancybox-right:hover{visibility:visible}#fancybox-left:hover span{left:20px}#fancybox-right:hover span{left:auto;right:20px}.fancybox-bg{position:absolute;padding:0;margin:0;border:0;width:20px;height:20px;z-index:1001}#fancybox-bg-n{top:-20px;left:0;width:100%;background-image:url('fancybox/fancybox-x.png')}#fancybox-bg-ne{top:-20px;right:-20px;background-image:url('fancybox/fancybox.png');background-position:-40px -162px}#fancybox-bg-e{top:0;right:-20px;height:100%;background-image:url('fancybox/fancybox-y.png');background-position:-20px 0px}#fancybox-bg-se{bottom:-20px;right:-20px;background-image:url('fancybox/fancybox.png');background-position:-40px -182px}#fancybox-bg-s{bottom:-20px;left:0;width:100%;background-image:url('fancybox/fancybox-x.png');background-position:0px -20px}#fancybox-bg-sw{bottom:-20px;left:-20px;background-image:url('fancybox/fancybox.png');background-position:-40px -142px}#fancybox-bg-w{top:0;left:-20px;height:100%;background-image:url('fancybox/fancybox-y.png')}#fancybox-bg-nw{top:-20px;left:-20px;background-image:url('fancybox/fancybox.png');background-position:-40px -122px}#fancybox-title{font-family:Helvetica;font-size:12px;z-index:1102}.fancybox-title-inside{padding-bottom:10px;text-align:center;color:#333;background:#fff;position:relative}.fancybox-title-outside{padding-top:10px;color:#fff}.fancybox-title-over{position:absolute;bottom:0;left:0;color:#FFF;text-align:left}#fancybox-title-over{padding:10px;background-image:url('fancybox/fancy_title_over.png');display:block}.fancybox-title-float{position:absolute;left:0;bottom:-20px;height:32px}#fancybox-title-float-wrap{border:none;border-collapse:collapse;width:auto}#fancybox-title-float-wrap td{border:none;white-space:nowrap}#fancybox-title-float-left{padding-left:15px;background:url('fancybox/fancybox.png') -40px -90px no-repeat}#fancybox-title-float-main{color:#FFF;line-height:29px;font-weight:bold;padding:0 0 3px 0;background:url('fancybox/fancybox-x.png') 0px -40px}#fancybox-title-float-right{padding:0 0 0 15px;background:url('fancybox/fancybox.png') -55px -90px no-repeat}
25
- /* IE6 */
26
- .fancybox-ie6 #fancybox-close{background:transparent;filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='<?php echo $url ?>/fancybox/fancy_close.png', sizingMethod='scale');}.fancybox-ie6 #fancybox-left-ico{background:transparent;filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='<?php echo $url ?>/fancybox/fancy_nav_left.png', sizingMethod='scale');}.fancybox-ie6 #fancybox-right-ico{background:transparent;filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='<?php echo $url ?>/fancybox/fancy_nav_right.png', sizingMethod='scale');}.fancybox-ie6 #fancybox-title-over{background:transparent;filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='<?php echo $url ?>/fancybox/fancy_title_over.png', sizingMethod='scale');zoom:1}.fancybox-ie6 #fancybox-title-float-left{background:transparent;filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='<?php echo $url ?>/fancybox/fancy_title_left.png', sizingMethod='scale');}.fancybox-ie6 #fancybox-title-float-main{background:transparent;filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='<?php echo $url ?>/fancybox/fancy_title_main.png', sizingMethod='scale');}.fancybox-ie6 #fancybox-title-float-right{background:transparent;filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='<?php echo $url ?>/fancybox/fancy_title_right.png', sizingMethod='scale');}.fancybox-ie6 #fancybox-bg-w,.fancybox-ie6 #fancybox-bg-e,.fancybox-ie6 #fancybox-left,.fancybox-ie6 #fancybox-right,#fancybox-hide-sel-frame{height: expression(this.parentNode.clientHeight + "px");}#fancybox-loading.fancybox-ie6{position:absolute;margin-top:0;top: expression( (-20 + (document.documentElement.clientHeight ? document.documentElement.clientHeight/2 : document.body.clientHeight/2 ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop )) + 'px');}#fancybox-loading.fancybox-ie6 div{background:transparent;filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='<?php echo $url ?>/fancybox/fancy_loading.png', sizingMethod='scale');}
27
- /* IE6, IE7, IE8 */
28
- .fancybox-ie .fancybox-bg{background:transparent !important;}.fancybox-ie #fancybox-bg-n{filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='<?php echo $url ?>/fancybox/fancy_shadow_n.png', sizingMethod='scale');}.fancybox-ie #fancybox-bg-ne{filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='<?php echo $url ?>/fancybox/fancy_shadow_ne.png', sizingMethod='scale');}.fancybox-ie #fancybox-bg-e{filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='<?php echo $url ?>/fancybox/fancy_shadow_e.png', sizingMethod='scale');}.fancybox-ie #fancybox-bg-se{filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='<?php echo $url ?>/fancybox/fancy_shadow_se.png', sizingMethod='scale');}.fancybox-ie #fancybox-bg-s{filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='<?php echo $url ?>/fancybox/fancy_shadow_s.png', sizingMethod='scale');}.fancybox-ie #fancybox-bg-sw{filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='<?php echo $url ?>/fancybox/fancy_shadow_sw.png', sizingMethod='scale');}.fancybox-ie #fancybox-bg-w{filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='<?php echo $url ?>/fancybox/fancy_shadow_w.png', sizingMethod='scale');}.fancybox-ie #fancybox-bg-nw{filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='<?php echo $url ?>/fancybox/fancy_shadow_nw.png', sizingMethod='scale');}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
readme.txt CHANGED
@@ -1,18 +1,18 @@
1
  === Easy FancyBox ===
2
  Contributors: RavanH
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=ravanhagen%40gmail%2ecom&item_name=Easy%20FancyBox&item_number=1%2e3%2e1&no_shipping=0&tax=0&bn=PP%2dDonationsBF&charset=UTF%2d8&lc=us
4
- Tags: fancybox, jquery, images, flash, lightbox, gallery, image overlay, youtube, vimeo, gallery
5
  Requires at least: 2.7
6
- Tested up to: 3.0.1
7
- Stable tag: 1.3.3.4.2
8
 
9
- Easily enable the FancyBox 1.3.3 jQuery extension on all image, SWF, YouTube and Vimeo links. Multi-Site compatible. Supports iFrame and Flash movies.
10
 
11
  == Description ==
12
 
13
- No options to be set. No new configuration pages. It just gives you FancyBox-in-a-Box for all links to images (.jpg/.bmp/.gif/.png) _and_ Flash movie (.swf) files _and_ Youtube / Vimeo movies _and_ WordPress Galleries. Easy FancyBox uses the packed FancyBox jQuery extension, is WP 3.0 Multi-Site compatible and supports iFrame and Flash movies -including YouTube and others- in an overlay.
14
 
15
- See the [Screenshot](http://wordpress.org/extend/plugins/easy-fancybox/screenshots/) for an impression on how images and YouTube movies will be presented on your site as soon as you have installed and (network) activated this simple plugin.
16
 
17
  Looking for some basic control? You can find a new section **FancyBox** on your **Settings > Media** admin page:
18
 
@@ -65,11 +65,11 @@ The plugin works best from the **/mu-plugins/** folder where it runs quietly in
65
 
66
  = What's FancyBox? =
67
 
68
- Basically, it is a fancy way of presenting images on your website. If you have scaled-down images in your posts which are linked to the original large version, instead of opening them in a blanc page, FancyBox opens those in a smooth overlay. Visit [FancyBox](http://fancybox.net/) for more information and examples.
69
 
70
  = Why EASY FancyBox? =
71
 
72
- Instead of bothering you with the HUGE amount of configuration options that FancyBox can handle, this plugin requires NO configuration. Easy, isn't it? ;)
73
 
74
  If you *do* want configuration options to tweak and fiddle for days, check out some of the other FancyBox plugins available.
75
 
@@ -83,36 +83,78 @@ There is no new settings page but there are a few options you can change. You wi
83
 
84
  = Will a WordPress generated gallery be displayed in a FancyBox overlay? =
85
 
86
- Yes, but _only_ if you used the option **Link thumbnails to: Image File** when inserting the gallery!
87
 
88
  = Can I display web pages or HTML files in a FancyBox overlay? =
89
 
90
  Yes. Place a link with either `class="fancybox-iframe"` or `class="fancybox iframe"` (notice the space instead of the hyphen) to any web page or .htm(l) file in your content.
91
 
92
- NOTE: The difference between these two classes (- or space) is in size of the overlay viewport. Try it out and use the one that works best :)
 
 
 
 
 
 
93
 
94
  = Can I play SWF files in a FancyBox overlay? =
95
 
96
  Yes. Just place a link _with the URL ending in .swf_ to your Flash file in the page content.
97
 
98
- If you do not have **swf** included in the *Auto-enable* option on Settings > Media admin page, you will need to add either `class="fancybox"` or `class="fancybox-swf"` (to force swf content recognition) to the link to enable FancyBox for it.
99
 
100
  = Can I play YouTube and Vimeo movies in a FancyBox overlay? =
101
 
102
  Yes.
103
 
104
- For YouTube, just place a link to the YouTube page in your content. If you have disabled Auto-detection, use it with `class="fancybox-youtube"` to manually enable FancyBox for it. (Note: For shortened YouTube URLs, the class does not work. Auto auto-detection needs to be enabled seperately.)
 
 
 
 
 
 
 
 
 
105
 
106
- For Vimeo, just place a link to the Vimeo page in your content. If you have disabled Auto-detection, use it with `class="fancybox-vimeo"` to manually enable FancyBox for it.
107
 
108
- These are actually a special case of SWF files. The URL for these movies do not end in .swf so the FancyBox script will not be able to auto-detect the Flash content. This can be forced with `class="fancybox-youtube"`, `class="fancybox-swf"` or alternatively `class="fancybox-iframe"`. The difference between the three are mainly in transition effect and size of the overlay viewport. Just choose the one that works best for you or...
109
 
110
- Just let the plugin auto-detect and auto-enable it for you :)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
111
 
112
  = Is Easy FancyBox multi-site compatible? =
113
 
114
  Yes. Designed to work with **Network Activate** and does not require manual activation on each site in your network. You can even install it in mu-plugins: upload the complete /easy-fancybox/ directory to /wp-content/mu-plugins/ and move the file easy-fancybox.php one dir up.
115
 
 
 
 
 
 
 
 
 
116
  == Screenshots ==
117
 
118
  1. Example image with **Overlay** caption. This is the default way Easy FancyBox displays images. Other options are **Inside** and the old **Outside**.
@@ -121,11 +163,18 @@ Yes. Designed to work with **Network Activate** and does not require manual acti
121
 
122
  == Upgrade Notice ==
123
 
124
- = 1.3.3.4.2 =
125
- Size issue with fancybox-swf and iframe classes. Quick fix for image overlay size in Google Chrome browser issue with FancyBox 1.3.3
126
 
127
  == Changelog ==
128
 
 
 
 
 
 
 
 
129
  = 1.3.3.4.2 =
130
  * Fix: iframe width
131
  * Fix: image overlay size in Google Chrome browser issue (FancyBox 1.3.3)
1
  === Easy FancyBox ===
2
  Contributors: RavanH
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=ravanhagen%40gmail%2ecom&item_name=Easy%20FancyBox&item_number=1%2e3%2e1&no_shipping=0&tax=0&bn=PP%2dDonationsBF&charset=UTF%2d8&lc=us
4
+ Tags: fancybox, jquery, images, flash, lightbox, gallery, image overlay, youtube, vimeo, gallery, pdf
5
  Requires at least: 2.7
6
+ Tested up to: 3.1
7
+ Stable tag: 1.3.4.5
8
 
9
+ Easily enable the FancyBox 1.3.4 jQuery extension on all image, SWF, YouTube and Vimeo links. Multi-Site compatible. Supports iFrame and Flash movies.
10
 
11
  == Description ==
12
 
13
+ No new configuration pages. It just gives you FancyBox-in-a-Box for all links to images (.jpg/.bmp/.gif/.png) _and_ WordPress Galleries _and_ (after enabling the options) for Flash movie (.swf) files _and_ Youtube / Vimeo movies _and_ iFrames _and_ PDF documents! Easy FancyBox uses the packed FancyBox jQuery extension and is WP 3.0 Multi-Site compatible.
14
 
15
+ See [Screenshots](http://wordpress.org/extend/plugins/easy-fancybox/screenshots/) for an impression on how images and YouTube movies will be presented on your site as soon as you have installed and (network) activated this simple plugin.
16
 
17
  Looking for some basic control? You can find a new section **FancyBox** on your **Settings > Media** admin page:
18
 
65
 
66
  = What's FancyBox? =
67
 
68
+ Basically, it is a fancy way of presenting images, movies, portable documents and inline content on your website. For example, if you have scaled-down images in your posts which are linked to the original large version, instead of opening them on a blanc page, FancyBox opens those in a smooth overlay. Visit [FancyBox](http://fancybox.net/) for more information and examples.
69
 
70
  = Why EASY FancyBox? =
71
 
72
+ Instead of bothering you with the HUGE amount of configuration options that FancyBox can handle, this plugin requires almost NO configuration. Easy, isn't it? ;)
73
 
74
  If you *do* want configuration options to tweak and fiddle for days, check out some of the other FancyBox plugins available.
75
 
83
 
84
  = Will a WordPress generated gallery be displayed in a FancyBox overlay? =
85
 
86
+ Yes, but _only_ if you used the option **Link thumbnails to: Image File** when inserting the gallery! The gallery quicktag/shortcode should look something like `[gallery link="file"]`.
87
 
88
  = Can I display web pages or HTML files in a FancyBox overlay? =
89
 
90
  Yes. Place a link with either `class="fancybox-iframe"` or `class="fancybox iframe"` (notice the space instead of the hyphen) to any web page or .htm(l) file in your content.
91
 
92
+ NOTE: The difference between these two classes (- or space) is in size of the overlay window. Try it out and use the one that works best :)
93
+
94
+ = Can I show PDF files in a FancyBox overlay? =
95
+
96
+ Yes. Just place a link _with the URL ending in .pdf_ to your Portable Document file in the page content.
97
+
98
+ If you do'nt have *Auto-detect* checked under **PDF** on Settings > Media admin page, you will need to add `class="fancybox-pdf"` (to force pdf content recognition) to the link to enable FancyBox for it.
99
 
100
  = Can I play SWF files in a FancyBox overlay? =
101
 
102
  Yes. Just place a link _with the URL ending in .swf_ to your Flash file in the page content.
103
 
104
+ If you do'nt have *Auto-detect* checked under **SWF** on Settings > Media admin page, you will need to add either `class="fancybox"` or `class="fancybox-swf"` (to force swf content recognition) to the link to enable FancyBox for it.
105
 
106
  = Can I play YouTube and Vimeo movies in a FancyBox overlay? =
107
 
108
  Yes.
109
 
110
+ These are actually a special case of SWF files. The URL for these movies do not end in .swf so the FancyBox script will not be able to auto-detect the Flash content. This can be forced with `class="fancybox-youtube"`, `class="fancybox-swf"` or alternatively `class="fancybox-iframe"`. The difference between the three is mainly in size of the overlay window. Just choose the one that works best for you or... Just let the plugin auto-detect and auto-enable it for you! :)
111
+
112
+ For **YouTube**, place the Share URL (the plain Page URL, the Short URL or even with the HD option) to the YouTube page in your content. Add `&fs=1` to the URL so show the 'Full screen' button. If you have disabled Auto-detection, use it with `class="fancybox-youtube"` to manually enable FancyBox for it. (Note: For shortened YouTube URLs, the class does not work. Auto auto-detection needs to be enabled seperately.)
113
+
114
+ For **Vimeo**, just place a link to the Vimeo page in your content. If you have disabled Auto-detection, use it with `class="fancybox-vimeo"` to manually enable FancyBox for it.
115
+
116
+ Both YouTube and Vimeo movies can be made to auto-start when they are opened by adding the paramer `autoplay=1` to the URL. For example, a short-url YouTube link that should play in HD mode, have the full screen button and auto-start on open, would look like:
117
+ `
118
+ <a href="http://youtu.be/N_tONWXYviM?hd=1&fs=1&autoplay=1">text/thumbnail</a>
119
+ `
120
 
121
+ = I want that 'Show in full-screen' button on my YouTube movies =
122
 
123
+ Append `&fs=1` to your YouTube share URL. If you use the Short URL without the `?hd=1` switch, append `?fs=1` to it.
124
 
125
+ = The flash movie in the overlay shows BELOW some other flash content that is on the same page! =
126
+
127
+ Make sure the OTHER flash content as a **wmode** set, preferably to 'opaque' or else 'transparent' but not 'window' or missing. For example, if your embedded object looks something like:
128
+ `
129
+ <object type="application/x-shockwave-flash" width="200" height="300" data="...url...">
130
+ <param name="allowfullscreen" value="true" />
131
+ <param name="allowscriptaccess" value="always" />
132
+ <param name="movie" value="...url..." />
133
+ </object>
134
+ `
135
+ just add `<param name="wmode" value="opaque" />` among the other parameters. Or if you are using an embed like:
136
+ `
137
+ <object width="640" height="385">
138
+ <param name="movie" value="...url..."></param>
139
+ <param name="allowFullScreen" value="true"></param>
140
+ <param name="allowscriptaccess" value="always"></param>
141
+ <embed src="...url..." type="application/x-shockwave-flash" width="640" height="385" allowscriptaccess="always" allowfullscreen="true" wmode="window"></embed>
142
+ </object>
143
+ `
144
+ just change that `wmode="window"` to `wmode="opaque"` or add the tag if it is missing.
145
 
146
  = Is Easy FancyBox multi-site compatible? =
147
 
148
  Yes. Designed to work with **Network Activate** and does not require manual activation on each site in your network. You can even install it in mu-plugins: upload the complete /easy-fancybox/ directory to /wp-content/mu-plugins/ and move the file easy-fancybox.php one dir up.
149
 
150
+ == Other Notes ==
151
+
152
+ = Known Issues =
153
+
154
+ - There is a conflict between the WP Slimstat plugin and the Easy FancyBox script for YouTube url conversion. When clicking a Youtube link, the movie opens in an overlay as it is supposed to but immediately after that, the complete page gets redirected to the original YouTube page. Adding a `class="noslimstat"` to the link is reported to work around the issue.
155
+ - In FancyBox 1.3.3 there is a problem with image stretching in the Google Chrome browser. This is worked around in Easy FancyBox 1.3.3.4.2 by disabling the autoDimensions feature. Since version 1.3.4, this has been resolved.
156
+ - Embedded flash content that has no wmode or wmode 'window', is displayed above the overlay and other javascript rendered content like dropdown menus. WordPress does NOT check for missing wmode in oEmbed generated Auto-embeds. Since version 1.3.4.5, the wmode is added by this plugin for WP (auto-)embeds but not for other user-embedded content. Please make sure you set the wmode parameter to 'opaque' or 'transparent' (when you need transparency) for your embedded content.
157
+
158
  == Screenshots ==
159
 
160
  1. Example image with **Overlay** caption. This is the default way Easy FancyBox displays images. Other options are **Inside** and the old **Outside**.
163
 
164
  == Upgrade Notice ==
165
 
166
+ = 1.3.4.5 =
167
+ FancyBox version 1.3.4 plus added PDF support and LOTS more options like border, overlay color, Easing, Title and adjustable YouTube, Vimeo and iFrame sizes! Missing WordPress auto-embed wmode fix.
168
 
169
  == Changelog ==
170
 
171
+ = 1.3.4.5 =
172
+ * Added Support for PDF
173
+ * Added Easing options
174
+ * YouTube, Vimeo and iFrame options adjustable
175
+ * lots and lots of more options!
176
+ * BIGFIX: work-around for missing wmode in WordPress (auto-)embedded movies (credits: Crantea Mihaita)
177
+
178
  = 1.3.3.4.2 =
179
  * Fix: iframe width
180
  * Fix: image overlay size in Google Chrome browser issue (FancyBox 1.3.3)