Easy FancyBox - Version 1.5.2

Version Description

  • BUGFIX: easy_fancybox_handler() in combo with trigger('click') causes Uncaught Exception script error
Download this release

Release Info

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

Code changes from version 1.5.0 to 1.5.2

easy-fancybox-class.php CHANGED
@@ -21,6 +21,7 @@ class easyFancyBox {
21
  <!-- Easy FancyBox ' . EASY_FANCYBOX_VERSION . ' using FancyBox ' . FANCYBOX_VERSION . ' - RavanH (http://status301.net/wordpress-plugins/easy-fancybox/) -->';
22
 
23
  // check for any enabled sections
 
24
  foreach (self::$options['Global']['options']['Enable']['options'] as $value) {
25
  // anything enabled?
26
  if ( isset($value['id']) && '1' == get_option($value['id'],$value['default']) ) {
@@ -31,13 +32,13 @@ class easyFancyBox {
31
  // and abort when none are active
32
  if (!self::$add_scripts) {
33
  echo '
34
- <!-- Nothing enabled under Settings > Media > FancyBox, please disable the plugin if you are not using it. -->
35
 
36
  ';
37
  return;
38
  }
39
 
40
- wp_print_scripts('jquery'); // using print_scripts here instead of enqueue because else the order will be wrong... TODO find a way to include jquery before the main script while leaving the fancybox.js for last...
41
 
42
  // begin output FancyBox settings
43
  echo '
@@ -421,7 +422,7 @@ class easyFancyBox {
421
  wp_deregister_script('jquery_fancybox');
422
  wp_deregister_script('jquery-fancybox');
423
  // register main fancybox script
424
- wp_register_script('jquery-fancybox', EASY_FANCYBOX_PLUGINURL.'fancybox/jquery.fancybox-'.FANCYBOX_VERSION.'.pack.js', array('jquery'), FANCYBOX_VERSION, true);
425
 
426
  // easing in IMG settings?
427
  if ( ( '' == get_option( self::$options['IMG']['options']['easingIn']['id'], self::$options['IMG']['options']['easingIn']['default']) || 'linear' == get_option( self::$options['IMG']['options']['easingIn']['id'], self::$options['IMG']['options']['easingIn']['default']) ) && ( '' == get_option( self::$options['IMG']['options']['easingOut']['id'], self::$options['IMG']['options']['easingOut']['default']) || 'linear' == get_option( self::$options['IMG']['options']['easingOut']['id'], self::$options['IMG']['options']['easingOut']['default']) ) ) {
@@ -469,20 +470,9 @@ class easyFancyBox {
469
  wp_enqueue_style('easy-fancybox-css', EASY_FANCYBOX_PLUGINURL.'easy-fancybox.css.php', false, FANCYBOX_VERSION, 'screen');
470
  }
471
 
472
- static function enqueue_header_scripts() {
473
- // TODO: google hosted jquery optional ++ safemode
474
- //wp_deregister_script('jquery');
475
- //wp_register_script('jquery', "http" . ($_SERVER['SERVER_PORT'] == 443 ? "s" : "") . "://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js", false, null);
476
- //wp_enqueue_script('jquery');
477
-
478
- wp_enqueue_script('jquery-fancybox');
479
- }
480
-
481
  static function enqueue_footer_scripts() {
482
- if (!self::$add_scripts) { // abort mission, there is no need for any script files
483
- echo '<!-- no fancybox scripts needed -->';
484
  return;
485
- }
486
 
487
  wp_enqueue_script('jquery-fancybox');
488
  wp_enqueue_script('jquery-easing');
@@ -493,9 +483,12 @@ class easyFancyBox {
493
  function on_ready() {
494
  if (!self::$add_scripts) // abort mission, there is no need for any script files
495
  return;
 
 
 
496
  echo '
497
  <script type="text/javascript">
498
- jQuery(document).on(\'ready gform_post_render\', easy_fancybox_handler );
499
  </script>
500
  ';
501
  }
@@ -510,8 +503,8 @@ jQuery(document).on(\'ready gform_post_render\', easy_fancybox_handler );
510
 
511
  self::register_settings( self::$options );
512
 
513
- // test with media upload resize...
514
- add_action( 'pre-upload-ui', 'media_upload_max_image_resize' );
515
  }
516
 
517
  // Hack to fix missing wmode in Youtube oEmbed code based on David C's code in the comments on
@@ -531,8 +524,8 @@ jQuery(document).on(\'ready gform_post_render\', easy_fancybox_handler );
531
 
532
  static function init() {
533
 
534
- if ( is_admin() ) {
535
- }
536
 
537
  require_once(EASY_FANCYBOX_PLUGINDIR . 'easy-fancybox-settings.php');
538
 
@@ -559,8 +552,6 @@ jQuery(document).on(\'ready gform_post_render\', easy_fancybox_handler );
559
 
560
  add_filter( 'get_user_option_closedpostboxes_'.self::$pagehook, array(__CLASS__, 'closed_meta_boxes') );
561
 
562
- //add_thickbox(); // do we need that?
563
-
564
  add_meta_box('submitdiv', __('Sections','easy-fancybox'), array(__CLASS__.'_Admin', 'meta_box_submit'), self::$pagehook, 'side', 'high');
565
  add_meta_box('globaldiv', __('Global settings', 'easy-fancybox'), array(__CLASS__.'_Admin', 'meta_box_global'), self::$pagehook, 'normal', 'high');
566
  add_meta_box('imgdiv', __('Images', 'easy-fancybox'), array(__CLASS__.'_Admin', 'meta_box_img'), self::$pagehook, 'normal', 'normal');
@@ -596,7 +587,7 @@ jQuery(document).on(\'ready gform_post_render\', easy_fancybox_handler );
596
  wp_enqueue_script('postbox');
597
 
598
  //add several metaboxes now, all metaboxes registered during load page can be switched off/on at "Screen Options" automatically, nothing special to do therefore
599
- //add_meta_box('advanceddiv', __('Advanced Options', 'skype-online-status'), array(__CLASS__.'_Admin', 'meta_box_advanced'), self::$pagehook, 'normal', 'core'); // make these pro options???
600
 
601
  add_meta_box('supportdiv', __('Support','easy-fancybox'), array(__CLASS__.'_Admin', 'meta_box_support'), self::$pagehook, 'side', 'core');
602
  add_meta_box('resourcesdiv', __('Resources','skype-online-status'), array(__CLASS__.'_Admin', 'meta_box_resources'), self::$pagehook, 'side', 'low');
@@ -617,9 +608,9 @@ jQuery(document).on(\'ready gform_post_render\', easy_fancybox_handler );
617
  add_action('admin_init', array(__CLASS__, 'admin_init'));
618
 
619
  add_action('init', array(__CLASS__, 'init'));
620
- add_action('wp_print_scripts', array(__CLASS__, 'register_scripts'), 999);
621
  add_action('wp_enqueue_scripts', array(__CLASS__, 'enqueue_styles'));
622
  add_action('wp_head', array(__CLASS__, 'main_script'), 999);
 
623
  add_action('wp_footer', array(__CLASS__, 'enqueue_footer_scripts'));
624
  add_action('wp_footer', array(__CLASS__, 'on_ready'), 999);
625
  }
21
  <!-- Easy FancyBox ' . EASY_FANCYBOX_VERSION . ' using FancyBox ' . FANCYBOX_VERSION . ' - RavanH (http://status301.net/wordpress-plugins/easy-fancybox/) -->';
22
 
23
  // check for any enabled sections
24
+ //if(!empty(self::$options['Global']['options']['Enable']['options']))
25
  foreach (self::$options['Global']['options']['Enable']['options'] as $value) {
26
  // anything enabled?
27
  if ( isset($value['id']) && '1' == get_option($value['id'],$value['default']) ) {
32
  // and abort when none are active
33
  if (!self::$add_scripts) {
34
  echo '
35
+ <!-- Nothing enabled under Settings > Media > FancyBox. -->
36
 
37
  ';
38
  return;
39
  }
40
 
41
+ //wp_print_scripts('jquery'); // using print_scripts here instead of enqueue because else the order will be wrong...
42
 
43
  // begin output FancyBox settings
44
  echo '
422
  wp_deregister_script('jquery_fancybox');
423
  wp_deregister_script('jquery-fancybox');
424
  // register main fancybox script
425
+ wp_register_script('jquery-fancybox', EASY_FANCYBOX_PLUGINURL.'fancybox/jquery.fancybox-'.FANCYBOX_VERSION.'.pack.js', array('jquery'), EASY_FANCYBOX_VERSION, true);
426
 
427
  // easing in IMG settings?
428
  if ( ( '' == get_option( self::$options['IMG']['options']['easingIn']['id'], self::$options['IMG']['options']['easingIn']['default']) || 'linear' == get_option( self::$options['IMG']['options']['easingIn']['id'], self::$options['IMG']['options']['easingIn']['default']) ) && ( '' == get_option( self::$options['IMG']['options']['easingOut']['id'], self::$options['IMG']['options']['easingOut']['default']) || 'linear' == get_option( self::$options['IMG']['options']['easingOut']['id'], self::$options['IMG']['options']['easingOut']['default']) ) ) {
470
  wp_enqueue_style('easy-fancybox-css', EASY_FANCYBOX_PLUGINURL.'easy-fancybox.css.php', false, FANCYBOX_VERSION, 'screen');
471
  }
472
 
 
 
 
 
 
 
 
 
 
473
  static function enqueue_footer_scripts() {
474
+ if (!self::$add_scripts)
 
475
  return;
 
476
 
477
  wp_enqueue_script('jquery-fancybox');
478
  wp_enqueue_script('jquery-easing');
483
  function on_ready() {
484
  if (!self::$add_scripts) // abort mission, there is no need for any script files
485
  return;
486
+
487
+ // 'gform_post_render' for gForms content triggers an error... Why?
488
+ // 'post-load' is for Infinite Scroll by JetPack
489
  echo '
490
  <script type="text/javascript">
491
+ jQuery(document).on(\'ready post-load\', easy_fancybox_handler );
492
  </script>
493
  ';
494
  }
503
 
504
  self::register_settings( self::$options );
505
 
506
+ // test with media upload resize... TODO : fix - because does not work anymore in the new uploader
507
+ //add_action( 'pre-upload-ui', 'media_upload_max_image_resize' );
508
  }
509
 
510
  // Hack to fix missing wmode in Youtube oEmbed code based on David C's code in the comments on
524
 
525
  static function init() {
526
 
527
+ // if ( is_admin() ) {
528
+ // }
529
 
530
  require_once(EASY_FANCYBOX_PLUGINDIR . 'easy-fancybox-settings.php');
531
 
552
 
553
  add_filter( 'get_user_option_closedpostboxes_'.self::$pagehook, array(__CLASS__, 'closed_meta_boxes') );
554
 
 
 
555
  add_meta_box('submitdiv', __('Sections','easy-fancybox'), array(__CLASS__.'_Admin', 'meta_box_submit'), self::$pagehook, 'side', 'high');
556
  add_meta_box('globaldiv', __('Global settings', 'easy-fancybox'), array(__CLASS__.'_Admin', 'meta_box_global'), self::$pagehook, 'normal', 'high');
557
  add_meta_box('imgdiv', __('Images', 'easy-fancybox'), array(__CLASS__.'_Admin', 'meta_box_img'), self::$pagehook, 'normal', 'normal');
587
  wp_enqueue_script('postbox');
588
 
589
  //add several metaboxes now, all metaboxes registered during load page can be switched off/on at "Screen Options" automatically, nothing special to do therefore
590
+ //add_meta_box('advanceddiv', __('Advanced Options', 'skype-online-status'), array(__CLASS__.'_Admin', 'meta_box_advanced'), self::$pagehook, 'normal', 'core');
591
 
592
  add_meta_box('supportdiv', __('Support','easy-fancybox'), array(__CLASS__.'_Admin', 'meta_box_support'), self::$pagehook, 'side', 'core');
593
  add_meta_box('resourcesdiv', __('Resources','skype-online-status'), array(__CLASS__.'_Admin', 'meta_box_resources'), self::$pagehook, 'side', 'low');
608
  add_action('admin_init', array(__CLASS__, 'admin_init'));
609
 
610
  add_action('init', array(__CLASS__, 'init'));
 
611
  add_action('wp_enqueue_scripts', array(__CLASS__, 'enqueue_styles'));
612
  add_action('wp_head', array(__CLASS__, 'main_script'), 999);
613
+ add_action('wp_print_scripts', array(__CLASS__, 'register_scripts'), 999);
614
  add_action('wp_footer', array(__CLASS__, 'enqueue_footer_scripts'));
615
  add_action('wp_footer', array(__CLASS__, 'on_ready'), 999);
616
  }
easy-fancybox-settings.php CHANGED
@@ -170,9 +170,9 @@ class easyFancyBox_Options extends easyFancyBox {
170
  'id' => '',
171
  'input' => 'checkbox',
172
  'hide' => true,
173
- 'status' => 'disabled',
174
  'default' => '',
175
- 'description' => __('Spotlight effect','easy-fancybox') . '. <em><a href="http://status301.net/wordpress-plugins/easy-fancybox-pro/">' . __('Make available &raquo;','easy-fancybox') . '</a></em>'
176
  )
177
  )
178
  ),
170
  'id' => '',
171
  'input' => 'checkbox',
172
  'hide' => true,
173
+ //'status' => 'disabled',
174
  'default' => '',
175
+ 'description' => __('Spotlight effect','easy-fancybox') //. '. <em><a href="http://status301.net/wordpress-plugins/easy-fancybox-pro/">' . __('Make available &raquo;','easy-fancybox') . '</a></em>'
176
  )
177
  )
178
  ),
easy-fancybox.css.php CHANGED
@@ -27,42 +27,52 @@ function iepathfix_compress($buffer) {
27
  return $buffer;
28
  }
29
 
30
- /* our original stylesheet
31
- $version = preg_match( '`^\d{1,2}\.\d{1,2}(\.\d{1,2})?$`' , $_GET['ver'] ) ? $_GET['ver'] : '1.3.4';
32
- $file = dirname(__FILE__) . '/fancybox/jquery.fancybox-' . htmlspecialchars( $version , ENT_QUOTES) . '.css'; */
33
  $file = dirname(__FILE__) . '/fancybox/jquery.fancybox-1.3.5.css';
34
 
35
  /* set up response headers, allowing browser caching */
36
  $expires = 60*60*24*30; // seconds, minutes, hours, days
37
  $last_modified_time = ( filemtime($file) < filemtime(__FILE__) ) ? filemtime(__FILE__) : filemtime($file);
38
- $etag = md5_file($file);
 
 
 
39
 
40
  header('Content-type: text/css; charset=utf-8', true);
41
  header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $last_modified_time) . ' GMT');
42
- header('Etag: ' . $etag);
43
-
44
- if (@strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) == $last_modified_time || @trim($_SERVER['HTTP_IF_NONE_MATCH']) == $etag) {
45
- // if we've got an etag match, answer not modified header and hang up
46
- header('HTTP/1.1 304 Not Modified');
47
- exit;
48
- }
49
  header('Accept-Ranges: bytes');
50
  header('Pragma: public');
51
  header('Cache-Control: maxage=' . $expires);
52
  header('Expires: ' . gmdate('D, d M Y H:i:s', time()+$expires) . ' GMT');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
 
54
  /* generate content */
55
  ob_start("iepathfix_compress");
56
 
57
  if (!file_exists($file)) {
58
- echo '/* stylesheet not found */';
59
  } else {
60
  /* the css file */
61
  include( $file );
62
  }
63
-
64
- /* extras */
65
- //echo '.fancybox-hidden{display:none}';
66
 
67
  ob_end_flush();
68
 
27
  return $buffer;
28
  }
29
 
30
+ /* our original stylesheet */
 
 
31
  $file = dirname(__FILE__) . '/fancybox/jquery.fancybox-1.3.5.css';
32
 
33
  /* set up response headers, allowing browser caching */
34
  $expires = 60*60*24*30; // seconds, minutes, hours, days
35
  $last_modified_time = ( filemtime($file) < filemtime(__FILE__) ) ? filemtime(__FILE__) : filemtime($file);
36
+ $if_modified_since = isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) ? stripslashes($_SERVER['HTTP_IF_MODIFIED_SINCE'])
37
+ : false;
38
+ $if_none_match = isset($_SERVER['HTTP_IF_NONE_MATCH']) ? stripslashes($_SERVER['HTTP_IF_NONE_MATCH'])
39
+ : false;
40
 
41
  header('Content-type: text/css; charset=utf-8', true);
42
  header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $last_modified_time) . ' GMT');
 
 
 
 
 
 
 
43
  header('Accept-Ranges: bytes');
44
  header('Pragma: public');
45
  header('Cache-Control: maxage=' . $expires);
46
  header('Expires: ' . gmdate('D, d M Y H:i:s', time()+$expires) . ' GMT');
47
+ if ( function_exists('md5_file') ) {
48
+ $etag = md5_file($file);
49
+ header('Etag: ' . $etag);
50
+ if ( $if_none_match ) {
51
+ $tags = split( ", ", $if_none_match );
52
+ foreach( $tags as $tag ) {
53
+ if( $tag == $etag ) {
54
+ // if we've got an etag match, answer not modified header and hang up
55
+ header('HTTP/1.1 304 Not Modified');
56
+ exit;
57
+ }
58
+ }
59
+ }
60
+ }
61
+ if ( $if_modified_since && $last_modified_time && strtotime($if_modified_since) == $last_modified_time ) {
62
+ // if we've got a not modified since match, answer not modified header and hang up
63
+ header('HTTP/1.1 304 Not Modified');
64
+ exit;
65
+ }
66
 
67
  /* generate content */
68
  ob_start("iepathfix_compress");
69
 
70
  if (!file_exists($file)) {
71
+ echo '/* Warning: stylesheet not found! */';
72
  } else {
73
  /* the css file */
74
  include( $file );
75
  }
 
 
 
76
 
77
  ob_end_flush();
78
 
easy-fancybox.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://status301.net/wordpress-plugins/easy-fancybox/
5
  Description: Easily enable the <a href="http://fancybox.net/">FancyBox jQuery extension</a> on all image, SWF, PDF, YouTube, Dailymotion and Vimeo links. Also supports iFrame and inline content.
6
  Text Domain: easy-fancybox
7
  Domain Path: languages
8
- Version: 1.5.0
9
  Author: RavanH
10
  Author URI: http://status301.net/
11
  */
@@ -36,7 +36,7 @@ Author URI: http://status301.net/
36
  * CONSTANTS
37
  **************/
38
 
39
- define( 'EASY_FANCYBOX_VERSION', '1.5.0' );
40
  define( 'FANCYBOX_VERSION', '1.3.5' );
41
  //define( 'FANCYBOX2_VERSION', '2.0.6' );
42
  define( 'MOUSEWHEEL_VERSION', '3.1.3' );
5
  Description: Easily enable the <a href="http://fancybox.net/">FancyBox jQuery extension</a> on all image, SWF, PDF, YouTube, Dailymotion and Vimeo links. Also supports iFrame and inline content.
6
  Text Domain: easy-fancybox
7
  Domain Path: languages
8
+ Version: 1.5.2
9
  Author: RavanH
10
  Author URI: http://status301.net/
11
  */
36
  * CONSTANTS
37
  **************/
38
 
39
+ define( 'EASY_FANCYBOX_VERSION', '1.5.1' );
40
  define( 'FANCYBOX_VERSION', '1.3.5' );
41
  //define( 'FANCYBOX2_VERSION', '2.0.6' );
42
  define( 'MOUSEWHEEL_VERSION', '3.1.3' );
fancybox/jquery.fancybox-1.3.5.js CHANGED
@@ -18,9 +18,9 @@
18
  *
19
  * Line 818: qouted attribute selector, RavanH ravanhagen@gmail.com
20
  * Line 39, 620 and 1123: added isTouch variable and autoResize parameter, RavanH ravanhagen@gmail.com
21
- * Line 37: patched for jQuery 1.9+ compat, JFK on http://stackoverflow.com/questions/14344289/
22
  *
23
- * Added SVG support. Patch by Simon Maillard simon@ogesta.fr
24
  */
25
  ;(function($) {
26
  var tmp, loading, overlay, wrap, outer, content, close, title, nav_left, nav_right,
@@ -33,7 +33,6 @@
33
 
34
  titleHeight = 0, titleStr = '', start_pos, final_pos, busy = false, fx = $.extend($('<div/>')[0], { prop: 0 }),
35
 
36
- /* patched for jQuery 1.9+ according to JFK's method on http://stackoverflow.com/questions/14344289/ */
37
  isIE6 = navigator.userAgent.match(/msie [6]/i) && !window.XMLHttpRequest,
38
 
39
  isTouch = document.createTouch !== undefined,
@@ -345,7 +344,7 @@
345
  loading.hide();
346
 
347
  if (wrap.is(":visible") && false === currentOpts.onCleanup(currentArray, currentIndex, currentOpts)) {
348
- $.event.trigger('fancybox-cancel');
349
 
350
  busy = false;
351
  return;
@@ -412,7 +411,7 @@
412
  content.html( tmp.contents() ).fadeTo(currentOpts.changeFade, 1, _finish);
413
  };
414
 
415
- $.event.trigger('fancybox-change');
416
 
417
  content
418
  .empty()
@@ -937,7 +936,7 @@
937
 
938
  busy = true;
939
 
940
- $.event.trigger('fancybox-cancel');
941
 
942
  _abort();
943
 
@@ -982,7 +981,7 @@
982
  title.empty().hide();
983
  wrap.hide();
984
 
985
- $.event.trigger('fancybox-cleanup');
986
 
987
  content.empty();
988
 
18
  *
19
  * Line 818: qouted attribute selector, RavanH ravanhagen@gmail.com
20
  * Line 39, 620 and 1123: added isTouch variable and autoResize parameter, RavanH ravanhagen@gmail.com
21
+ * Patched for jQuery 1.9+ compat by Sabel http://sabel.bluegfx.de/wordpress/wp-content/uploads/2013/03/jquery.fancybox-1.3.4.js
22
  *
23
+ * Added SVG support by Simon Maillard simon@ogesta.fr
24
  */
25
  ;(function($) {
26
  var tmp, loading, overlay, wrap, outer, content, close, title, nav_left, nav_right,
33
 
34
  titleHeight = 0, titleStr = '', start_pos, final_pos, busy = false, fx = $.extend($('<div/>')[0], { prop: 0 }),
35
 
 
36
  isIE6 = navigator.userAgent.match(/msie [6]/i) && !window.XMLHttpRequest,
37
 
38
  isTouch = document.createTouch !== undefined,
344
  loading.hide();
345
 
346
  if (wrap.is(":visible") && false === currentOpts.onCleanup(currentArray, currentIndex, currentOpts)) {
347
+ $('.fancybox-inline-tmp').trigger('fancybox-cancel');
348
 
349
  busy = false;
350
  return;
411
  content.html( tmp.contents() ).fadeTo(currentOpts.changeFade, 1, _finish);
412
  };
413
 
414
+ $('.fancybox-inline-tmp').trigger('fancybox-change');
415
 
416
  content
417
  .empty()
936
 
937
  busy = true;
938
 
939
+ $('.fancybox-inline-tmp').trigger('fancybox-cancel');
940
 
941
  _abort();
942
 
981
  title.empty().hide();
982
  wrap.hide();
983
 
984
+ $('.fancybox-inline-tmp').trigger('fancybox-cleanup');
985
 
986
  content.empty();
987
 
fancybox/jquery.fancybox-1.3.5.pack.js CHANGED
@@ -17,7 +17,7 @@
17
  * Patches applied for Easy FancyBox WordPress plugin integration:
18
  * Quoted attribute selector, RavanH ravanhagen@gmail.com
19
  * Added isTouch variable and autoResize parameter, RavanH ravanhagen@gmail.com
20
- * jQuery 1.9+ compat, JFK http://stackoverflow.com/questions/14344289/
21
- * Added SVG support. Patch by Simon Maillard simon@ogesta.fr
22
  */
23
- (function(a){var b,c,d,e,f,g,h,i,j,k,w,A,B,l=0,m={},n=[],o=0,p={},q=[],r=null,s=new Image,t=/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i,u=/[^\.]\.(swf)\s*$/i,v=/[^\.]\.(svg)\s*$/i,x=1,y=0,z="",C=!1,D=a.extend(a("<div/>")[0],{prop:0}),E=navigator.userAgent.match(/msie [6]/i)&&!window.XMLHttpRequest,F=void 0!==document.createTouch,G=function(){c.hide(),s.onerror=s.onload=null,r&&r.abort(),b.empty()},H=function(){return!1===m.onError(n,l,m)?(c.hide(),C=!1,void 0):(m.titleShow=!1,m.width="auto",m.height="auto",b.html('<p id="fancybox-error">The requested content cannot be loaded.<br />Please try again later.</p>'),J(),void 0)},I=function(){var e,f,h,i,j,k,d=n[l];if(G(),m=a.extend({},a.fn.fancybox.defaults,a(d).data("fancybox")===void 0?m:a(d).data("fancybox")),k=m.onStart(n,l,m),k===!1)return C=!1,void 0;if("object"==typeof k&&(m=a.extend(m,k)),h=m.title||(d.nodeName?a(d).attr("title"):d.title)||"",d.nodeName&&!m.orig&&(m.orig=a(d).children("img:first").length?a(d).children("img:first"):a(d)),""===h&&m.orig&&m.titleFromAlt&&(h=m.orig.attr("alt")),e=m.href||(d.nodeName?a(d).attr("href"):d.href)||null,(/^(?:javascript)/i.test(e)||"#"==e)&&(e=null),m.type?(f=m.type,e||(e=m.content)):m.content?f="html":e&&(f=e.match(t)?"image":e.match(u)?"swf":e.match(v)?"svg":a(d).hasClass("iframe")?"iframe":0===e.indexOf("#")?"inline":"ajax"),!f)return H(),void 0;switch("inline"==f&&(d=e.substr(e.indexOf("#")),f=a(d).length>0?"inline":"ajax"),m.type=f,m.href=e,m.title=h,m.autoDimensions&&("html"==m.type||"inline"==m.type||"ajax"==m.type?(m.width="auto",m.height="auto"):m.autoDimensions=!1),m.modal&&(m.overlayShow=!0,m.hideOnOverlayClick=!1,m.hideOnContentClick=!1,m.enableEscapeButton=!1,m.showCloseButton=!1),m.padding=parseInt(m.padding,10),m.margin=parseInt(m.margin,10),b.css("padding",m.padding+m.margin),a(".fancybox-inline-tmp").unbind("fancybox-cancel").bind("fancybox-change",function(){a(this).replaceWith(g.children())}),f){case"html":b.html(m.content),J();break;case"inline":if(a(d).parent().is("#fancybox-content")===!0)return C=!1,void 0;a('<div class="fancybox-inline-tmp" />').hide().insertBefore(a(d)).bind("fancybox-cleanup",function(){a(this).replaceWith(g.children())}).bind("fancybox-cancel",function(){a(this).replaceWith(b.children())}),a(d).appendTo(b),J();break;case"image":C=!1,a.fancybox.showActivity(),s=new Image,s.onerror=function(){H()},s.onload=function(){C=!0,s.onerror=s.onload=null,K()},s.src=e;break;case"swf":m.scrolling="no",i='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+m.width+'" height="'+m.height+'"><param name="movie" value="'+e+'"></param>',j="",a.each(m.swf,function(a,b){i+='<param name="'+a+'" value="'+b+'"></param>',j+=" "+a+'="'+b+'"'}),i+='<embed src="'+e+'" type="application/x-shockwave-flash" width="'+m.width+'" height="'+m.height+'"'+j+"></embed></object>",b.html(i),J();break;case"svg":m.scrolling="no",i='<object width="'+m.width+'" height="'+m.height+'" data="'+e+'"></object>',b.html(i),J();break;case"ajax":C=!1,a.fancybox.showActivity(),m.ajax.win=m.ajax.success,r=a.ajax(a.extend({},m.ajax,{url:e,data:m.ajax.data||{},error:function(a){a.status>0&&H()},success:function(a,d,f){var g="object"==typeof f?f:r;if(200==g.status){if("function"==typeof m.ajax.win){if(k=m.ajax.win(e,a,d,f),k===!1)return c.hide(),void 0;("string"==typeof k||"object"==typeof k)&&(a=k)}b.html(a),J()}}}));break;case"iframe":L()}},J=function(){var c=m.width,d=m.height;c=(""+c).indexOf("%")>-1?parseInt((a(window).width()-2*m.margin)*parseFloat(c)/100,10)+"px":"auto"==c?"auto":c+"px",d=(""+d).indexOf("%")>-1?parseInt((a(window).height()-2*m.margin)*parseFloat(d)/100,10)+"px":"auto"==d?"auto":d+"px",b.wrapInner('<div style="width:'+c+";height:"+d+";overflow: "+("auto"==m.scrolling?"auto":"yes"==m.scrolling?"scroll":"hidden")+';position:relative;"></div>'),m.width=b.width(),m.height=b.height(),L()},K=function(){m.width=s.width,m.height=s.height,a("<img />").attr({id:"fancybox-img",src:s.src,alt:m.title}).appendTo(b),L()},L=function(){var f,r;return c.hide(),e.is(":visible")&&!1===p.onCleanup(q,o,p)?(a.event.trigger("fancybox-cancel"),C=!1,void 0):(C=!0,a(g.add(d)).unbind(),a(window).unbind("resize.fb scroll.fb"),a(document).unbind("keydown.fb"),e.is(":visible")&&"outside"!==p.titlePosition&&e.css("height",e.height()),q=n,o=l,p=m,p.overlayShow?(d.css({"background-color":p.overlayColor,opacity:p.overlayOpacity,cursor:p.hideOnOverlayClick?"pointer":"auto",height:a(document).height()}),d.is(":visible")||(E&&a("select:not(#fancybox-tmp select)").filter(function(){return"hidden"!==this.style.visibility}).css({visibility:"hidden"}).one("fancybox-cleanup",function(){this.style.visibility="inherit"}),d.show())):d.hide(),B=T(),N(),e.is(":visible")?(a(h.add(j).add(k)).hide(),f=e.position(),A={top:f.top,left:f.left,width:e.width(),height:e.height()},r=A.width==B.width&&A.height==B.height,g.fadeTo(p.changeFade,.3,function(){var c=function(){g.html(b.contents()).fadeTo(p.changeFade,1,P)};a.event.trigger("fancybox-change"),g.empty().removeAttr("filter").css({"border-width":p.padding,width:B.width-2*p.padding,height:m.autoDimensions?"auto":B.height-y-2*p.padding}),r?c():(D.prop=0,a(D).animate({prop:1},{duration:p.changeSpeed,easing:p.easingChange,step:R,complete:c}))}),void 0):(e.removeAttr("style"),g.css("border-width",p.padding),"elastic"==p.transitionIn?(A=V(),g.html(b.contents()),e.show(),p.opacity&&(B.opacity=0),D.prop=0,a(D).animate({prop:1},{duration:p.speedIn,easing:p.easingIn,step:R,complete:P}),void 0):("inside"==p.titlePosition&&y>0&&i.show(),g.css({width:B.width-2*p.padding,height:m.autoDimensions?"auto":B.height-y-2*p.padding}).html(b.contents()),e.css(B).fadeIn("none"==p.transitionIn?0:p.speedIn,P),void 0)))},M=function(a){return a&&a.length?"float"==p.titlePosition?'<table id="fancybox-title-float-wrap" cellpadding="0" cellspacing="0"><tr><td id="fancybox-title-float-left"></td><td id="fancybox-title-float-main">'+a+'</td><td id="fancybox-title-float-right"></td></tr></table>':'<div id="fancybox-title-'+p.titlePosition+'">'+a+"</div>":!1},N=function(){if(z=p.title||"",y=0,i.empty().removeAttr("style").removeClass(),p.titleShow===!1)return i.hide(),void 0;if(z=a.isFunction(p.titleFormat)?p.titleFormat(z,q,o,p):M(z),!z||""===z)return i.hide(),void 0;switch(i.addClass("fancybox-title-"+p.titlePosition).html(z).appendTo("body").show(),p.titlePosition){case"inside":i.css({width:B.width-2*p.padding,marginLeft:p.padding,marginRight:p.padding}),y=i.outerHeight(!0),i.appendTo(f),B.height+=y;break;case"over":i.css({marginLeft:p.padding,width:B.width-2*p.padding,bottom:p.padding}).appendTo(f);break;case"float":i.css("left",-1*parseInt((i.width()-B.width-40)/2,10)).appendTo(e);break;default:i.css({width:B.width-2*p.padding,paddingLeft:p.padding,paddingRight:p.padding}).appendTo(e)}i.hide()},O=function(){return(p.enableEscapeButton||p.enableKeyboardNav)&&a(document).bind("keydown.fb",function(b){27==b.keyCode&&p.enableEscapeButton?(b.preventDefault(),a.fancybox.close()):37!=b.keyCode&&39!=b.keyCode||!p.enableKeyboardNav||"INPUT"===b.target.tagName||"TEXTAREA"===b.target.tagName||"SELECT"===b.target.tagName||(b.preventDefault(),a.fancybox[37==b.keyCode?"prev":"next"]())}),p.showNavArrows?((p.cyclic&&q.length>1||0!==o)&&j.show(),(p.cyclic&&q.length>1||o!=q.length-1)&&k.show(),void 0):(j.hide(),k.hide(),void 0)},P=function(){a.support.opacity||(g.get(0).style.removeAttribute("filter"),e.get(0).style.removeAttribute("filter")),m.autoDimensions&&g.css("height","auto"),e.css("height","auto"),z&&z.length&&i.show(),p.showCloseButton&&h.show(),O(),p.hideOnContentClick&&g.bind("click",a.fancybox.close),p.hideOnOverlayClick&&d.bind("click",a.fancybox.close),p.autoResize&&a(window).bind("resize.fb",a.fancybox.resize),p.centerOnScroll&&a(window).bind("scroll.fb",a.fancybox.center),"iframe"==p.type&&a('<iframe id="fancybox-frame" name="fancybox-frame'+(new Date).getTime()+'" frameborder="0" hspace="0" '+(navigator.userAgent.match(/msie [6]/i)?'allowtransparency="true""':"")+' scrolling="'+m.scrolling+'" src="'+p.href+'"></iframe>').appendTo(g),e.show(),C=!1,a.fancybox.center(),p.onComplete(q,o,p),Q()},Q=function(){var a,b;q.length-1>o&&(a=q[o+1].href,a!==void 0&&a.match(t)&&(b=new Image,b.src=a)),o>0&&(a=q[o-1].href,a!==void 0&&a.match(t)&&(b=new Image,b.src=a))},R=function(a){var b={width:parseInt(A.width+(B.width-A.width)*a,10),height:parseInt(A.height+(B.height-A.height)*a,10),top:parseInt(A.top+(B.top-A.top)*a,10),left:parseInt(A.left+(B.left-A.left)*a,10)};B.opacity!==void 0&&(b.opacity=.5>a?.5:a),e.css(b),g.css({width:b.width-2*p.padding,height:b.height-y*a-2*p.padding})},S=function(){return[a(window).width()-2*p.margin,a(window).height()-2*p.margin,a(document).scrollLeft()+p.margin,a(document).scrollTop()+p.margin]},T=function(){var e,a=S(),b={},c=p.autoScale,d=2*p.padding;return b.width=(""+p.width).indexOf("%")>-1?parseInt(a[0]*parseFloat(p.width)/100,10):p.width+d,b.height=(""+p.height).indexOf("%")>-1?parseInt(a[1]*parseFloat(p.height)/100,10):p.height+d,c&&(b.width>a[0]||b.height>a[1])&&("image"==m.type||"svg"==m.type||"swf"==m.type?(e=p.width/p.height,b.width>a[0]&&(b.width=a[0],b.height=parseInt((b.width-d)/e+d,10)),b.height>a[1]&&(b.height=a[1],b.width=parseInt((b.height-d)*e+d,10))):(b.width=Math.min(b.width,a[0]),b.height=Math.min(b.height,a[1]))),b.top=parseInt(Math.max(a[3]-20,a[3]+.5*(a[1]-b.height-40)),10),b.left=parseInt(Math.max(a[2]-20,a[2]+.5*(a[0]-b.width-40)),10),b},U=function(a){var b=a.offset();return b.top+=parseInt(a.css("paddingTop"),10)||0,b.left+=parseInt(a.css("paddingLeft"),10)||0,b.top+=parseInt(a.css("border-top-width"),10)||0,b.left+=parseInt(a.css("border-left-width"),10)||0,b.width=a.width(),b.height=a.height(),b},V=function(){var d,e,b=m.orig?a(m.orig):!1,c={};return b&&b.length?(d=U(b),c={width:d.width+2*p.padding,height:d.height+2*p.padding,top:d.top-p.padding-20,left:d.left-p.padding-20}):(e=S(),c={width:2*p.padding,height:2*p.padding,top:parseInt(e[3]+.5*e[1],10),left:parseInt(e[2]+.5*e[0],10)}),c},W=function(){return c.is(":visible")?(a("div",c).css("top",-40*x+"px"),x=(x+1)%12,void 0):(clearInterval(w),void 0)};a.fn.fancybox=function(b){return a(this).length?(a(this).data("fancybox",a.extend({},b,a.metadata?a(this).metadata():{})).unbind("click.fb").bind("click.fb",function(b){if(b.preventDefault(),!C){C=!0,a(this).blur(),n=[],l=0;var c=a(this).attr("rel")||"";c&&""!=c&&"nofollow"!==c?(n=a('a[rel="'+c+'"], area[rel="'+c+'"]'),l=n.index(this)):n.push(this),I()}}),this):this},a.fancybox=function(b){var c;if(!C){if(C=!0,c=arguments[1]!==void 0?arguments[1]:{},n=[],l=parseInt(c.index,10)||0,a.isArray(b)){for(var d=0,e=b.length;e>d;d++)"object"==typeof b[d]?a(b[d]).data("fancybox",a.extend({},c,b[d])):b[d]=a({}).data("fancybox",a.extend({content:b[d]},c));n=jQuery.merge(n,b)}else"object"==typeof b?a(b).data("fancybox",a.extend({},c,b)):b=a({}).data("fancybox",a.extend({content:b},c)),n.push(b);(l>n.length||0>l)&&(l=0),I()}},a.fancybox.showActivity=function(){clearInterval(w),c.show(),w=setInterval(W,66)},a.fancybox.hideActivity=function(){c.hide()},a.fancybox.next=function(){return a.fancybox.pos(o+1)},a.fancybox.prev=function(){return a.fancybox.pos(o-1)},a.fancybox.pos=function(a){C||(a=parseInt(a),n=q,a>-1&&q.length>a?(l=a,I()):p.cyclic&&q.length>1&&(l=a>=q.length?0:q.length-1,I()))},a.fancybox.cancel=function(){C||(C=!0,a.event.trigger("fancybox-cancel"),G(),m.onCancel(n,l,m),C=!1)},a.fancybox.close=function(){function b(){d.fadeOut("fast"),i.empty().hide(),e.hide(),a.event.trigger("fancybox-cleanup"),g.empty(),p.onClosed(q,o,p),q=m=[],o=l=0,p=m={},C=!1}if(!C&&!e.is(":hidden")){if(C=!0,p&&!1===p.onCleanup(q,o,p))return C=!1,void 0;if(G(),a(h.add(j).add(k)).hide(),a(g.add(d)).unbind(),a(window).unbind("resize.fb scroll.fb"),a(document).unbind("keydown.fb"),g.find("iframe#fancybox-frame").attr("src",E&&/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank"),"inside"!==p.titlePosition&&i.empty(),e.stop(),"elastic"==p.transitionOut){A=V();var c=e.position();B={top:c.top,left:c.left,width:e.width(),height:e.height()},p.opacity&&(B.opacity=1),i.empty().hide(),D.prop=1,a(D).animate({prop:0},{duration:p.speedOut,easing:p.easingOut,step:R,complete:b})}else e.fadeOut("none"==p.transitionOut?0:p.speedOut,b)}},a.fancybox.resize=function(){d.is(":visible")&&d.css("height",a(document).height()),a.fancybox.center(!0)},a.fancybox.center=function(){var a,b;C||(b=arguments[0]===!0?1:0,a=S(),(b||!(e.width()>a[0]||e.height()>a[1]))&&e.stop().animate({top:parseInt(Math.max(a[3]-20,a[3]+.5*(a[1]-g.height()-40)-p.padding)),left:parseInt(Math.max(a[2]-20,a[2]+.5*(a[0]-g.width()-40)-p.padding))},"number"==typeof arguments[0]?arguments[0]:200))},a.fancybox.init=function(){a("#fancybox-wrap").length||(a("body").append(b=a('<div id="fancybox-tmp"></div>'),c=a('<div id="fancybox-loading"><div></div></div>'),d=a('<div id="fancybox-overlay"></div>'),e=a('<div id="fancybox-wrap"></div>')),f=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(e),f.append(g=a('<div id="fancybox-content"></div>'),h=a('<a id="fancybox-close"></a>'),i=a('<div id="fancybox-title"></div>'),j=a('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'),k=a('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>')),h.click(a.fancybox.close),c.click(a.fancybox.cancel),j.click(function(b){b.preventDefault(),a.fancybox.prev()}),k.click(function(b){b.preventDefault(),a.fancybox.next()}),a.fn.mousewheel&&e.bind("mousewheel.fb",function(b,c){C?b.preventDefault():(0==a(b.target).get(0).clientHeight||a(b.target).get(0).scrollHeight===a(b.target).get(0).clientHeight)&&(b.preventDefault(),a.fancybox[c>0?"prev":"next"]())}),a.support.opacity||e.addClass("fancybox-ie"),E&&(c.addClass("fancybox-ie6"),e.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(f)))},a.fn.fancybox.defaults={padding:10,margin:40,opacity:!1,modal:!1,cyclic:!1,scrolling:"auto",width:560,height:340,autoScale:!0,autoDimensions:!0,centerOnScroll:!F,autoResize:!F,ajax:{},swf:{wmode:"transparent"},svg:{wmode:"transparent"},hideOnOverlayClick:!0,hideOnContentClick:!1,overlayShow:!0,overlayOpacity:.7,overlayColor:"#777",titleShow:!0,titlePosition:"float",titleFormat:null,titleFromAlt:!1,transitionIn:"fade",transitionOut:"fade",speedIn:300,speedOut:300,changeSpeed:300,changeFade:"fast",easingIn:"swing",easingOut:"swing",showCloseButton:!0,showNavArrows:!0,enableEscapeButton:!0,enableKeyboardNav:!0,onStart:function(){},onCancel:function(){},onComplete:function(){},onCleanup:function(){},onClosed:function(){},onError:function(){}},a(document).ready(function(){a.fancybox.init()})})(jQuery);
17
  * Patches applied for Easy FancyBox WordPress plugin integration:
18
  * Quoted attribute selector, RavanH ravanhagen@gmail.com
19
  * Added isTouch variable and autoResize parameter, RavanH ravanhagen@gmail.com
20
+ * jQuery 1.9+ compat. by Sabel http://sabel.bluegfx.de/wordpress/wp-content/uploads/2013/03/jquery.fancybox-1.3.4.js
21
+ * Added SVG support by Simon Maillard simon@ogesta.fr
22
  */
23
+ (function(a){var b,c,d,e,f,g,h,i,j,k,w,A,B,l=0,m={},n=[],o=0,p={},q=[],r=null,s=new Image,t=/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i,u=/[^\.]\.(swf)\s*$/i,v=/[^\.]\.(svg)\s*$/i,x=1,y=0,z="",C=!1,D=a.extend(a("<div/>")[0],{prop:0}),E=navigator.userAgent.match(/msie [6]/i)&&!window.XMLHttpRequest,F=void 0!==document.createTouch,G=function(){c.hide(),s.onerror=s.onload=null,r&&r.abort(),b.empty()},H=function(){return!1===m.onError(n,l,m)?(c.hide(),C=!1,void 0):(m.titleShow=!1,m.width="auto",m.height="auto",b.html('<p id="fancybox-error">The requested content cannot be loaded.<br />Please try again later.</p>'),J(),void 0)},I=function(){var e,f,h,i,j,k,d=n[l];if(G(),m=a.extend({},a.fn.fancybox.defaults,a(d).data("fancybox")===void 0?m:a(d).data("fancybox")),k=m.onStart(n,l,m),k===!1)return C=!1,void 0;if("object"==typeof k&&(m=a.extend(m,k)),h=m.title||(d.nodeName?a(d).attr("title"):d.title)||"",d.nodeName&&!m.orig&&(m.orig=a(d).children("img:first").length?a(d).children("img:first"):a(d)),""===h&&m.orig&&m.titleFromAlt&&(h=m.orig.attr("alt")),e=m.href||(d.nodeName?a(d).attr("href"):d.href)||null,(/^(?:javascript)/i.test(e)||"#"==e)&&(e=null),m.type?(f=m.type,e||(e=m.content)):m.content?f="html":e&&(f=e.match(t)?"image":e.match(u)?"swf":e.match(v)?"svg":a(d).hasClass("iframe")?"iframe":0===e.indexOf("#")?"inline":"ajax"),!f)return H(),void 0;switch("inline"==f&&(d=e.substr(e.indexOf("#")),f=a(d).length>0?"inline":"ajax"),m.type=f,m.href=e,m.title=h,m.autoDimensions&&("html"==m.type||"inline"==m.type||"ajax"==m.type?(m.width="auto",m.height="auto"):m.autoDimensions=!1),m.modal&&(m.overlayShow=!0,m.hideOnOverlayClick=!1,m.hideOnContentClick=!1,m.enableEscapeButton=!1,m.showCloseButton=!1),m.padding=parseInt(m.padding,10),m.margin=parseInt(m.margin,10),b.css("padding",m.padding+m.margin),a(".fancybox-inline-tmp").unbind("fancybox-cancel").bind("fancybox-change",function(){a(this).replaceWith(g.children())}),f){case"html":b.html(m.content),J();break;case"inline":if(a(d).parent().is("#fancybox-content")===!0)return C=!1,void 0;a('<div class="fancybox-inline-tmp" />').hide().insertBefore(a(d)).bind("fancybox-cleanup",function(){a(this).replaceWith(g.children())}).bind("fancybox-cancel",function(){a(this).replaceWith(b.children())}),a(d).appendTo(b),J();break;case"image":C=!1,a.fancybox.showActivity(),s=new Image,s.onerror=function(){H()},s.onload=function(){C=!0,s.onerror=s.onload=null,K()},s.src=e;break;case"swf":m.scrolling="no",i='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+m.width+'" height="'+m.height+'"><param name="movie" value="'+e+'"></param>',j="",a.each(m.swf,function(a,b){i+='<param name="'+a+'" value="'+b+'"></param>',j+=" "+a+'="'+b+'"'}),i+='<embed src="'+e+'" type="application/x-shockwave-flash" width="'+m.width+'" height="'+m.height+'"'+j+"></embed></object>",b.html(i),J();break;case"svg":m.scrolling="no",i='<object width="'+m.width+'" height="'+m.height+'" data="'+e+'"></object>',b.html(i),J();break;case"ajax":C=!1,a.fancybox.showActivity(),m.ajax.win=m.ajax.success,r=a.ajax(a.extend({},m.ajax,{url:e,data:m.ajax.data||{},error:function(a){a.status>0&&H()},success:function(a,d,f){var g="object"==typeof f?f:r;if(200==g.status){if("function"==typeof m.ajax.win){if(k=m.ajax.win(e,a,d,f),k===!1)return c.hide(),void 0;("string"==typeof k||"object"==typeof k)&&(a=k)}b.html(a),J()}}}));break;case"iframe":L()}},J=function(){var c=m.width,d=m.height;c=(""+c).indexOf("%")>-1?parseInt((a(window).width()-2*m.margin)*parseFloat(c)/100,10)+"px":"auto"==c?"auto":c+"px",d=(""+d).indexOf("%")>-1?parseInt((a(window).height()-2*m.margin)*parseFloat(d)/100,10)+"px":"auto"==d?"auto":d+"px",b.wrapInner('<div style="width:'+c+";height:"+d+";overflow: "+("auto"==m.scrolling?"auto":"yes"==m.scrolling?"scroll":"hidden")+';position:relative;"></div>'),m.width=b.width(),m.height=b.height(),L()},K=function(){m.width=s.width,m.height=s.height,a("<img />").attr({id:"fancybox-img",src:s.src,alt:m.title}).appendTo(b),L()},L=function(){var f,r;return c.hide(),e.is(":visible")&&!1===p.onCleanup(q,o,p)?(a(".fancybox-inline-tmp").trigger("fancybox-cancel"),C=!1,void 0):(C=!0,a(g.add(d)).unbind(),a(window).unbind("resize.fb scroll.fb"),a(document).unbind("keydown.fb"),e.is(":visible")&&"outside"!==p.titlePosition&&e.css("height",e.height()),q=n,o=l,p=m,p.overlayShow?(d.css({"background-color":p.overlayColor,opacity:p.overlayOpacity,cursor:p.hideOnOverlayClick?"pointer":"auto",height:a(document).height()}),d.is(":visible")||(E&&a("select:not(#fancybox-tmp select)").filter(function(){return"hidden"!==this.style.visibility}).css({visibility:"hidden"}).one("fancybox-cleanup",function(){this.style.visibility="inherit"}),d.show())):d.hide(),B=T(),N(),e.is(":visible")?(a(h.add(j).add(k)).hide(),f=e.position(),A={top:f.top,left:f.left,width:e.width(),height:e.height()},r=A.width==B.width&&A.height==B.height,g.fadeTo(p.changeFade,.3,function(){var c=function(){g.html(b.contents()).fadeTo(p.changeFade,1,P)};a(".fancybox-inline-tmp").trigger("fancybox-change"),g.empty().removeAttr("filter").css({"border-width":p.padding,width:B.width-2*p.padding,height:m.autoDimensions?"auto":B.height-y-2*p.padding}),r?c():(D.prop=0,a(D).animate({prop:1},{duration:p.changeSpeed,easing:p.easingChange,step:R,complete:c}))}),void 0):(e.removeAttr("style"),g.css("border-width",p.padding),"elastic"==p.transitionIn?(A=V(),g.html(b.contents()),e.show(),p.opacity&&(B.opacity=0),D.prop=0,a(D).animate({prop:1},{duration:p.speedIn,easing:p.easingIn,step:R,complete:P}),void 0):("inside"==p.titlePosition&&y>0&&i.show(),g.css({width:B.width-2*p.padding,height:m.autoDimensions?"auto":B.height-y-2*p.padding}).html(b.contents()),e.css(B).fadeIn("none"==p.transitionIn?0:p.speedIn,P),void 0)))},M=function(a){return a&&a.length?"float"==p.titlePosition?'<table id="fancybox-title-float-wrap" cellpadding="0" cellspacing="0"><tr><td id="fancybox-title-float-left"></td><td id="fancybox-title-float-main">'+a+'</td><td id="fancybox-title-float-right"></td></tr></table>':'<div id="fancybox-title-'+p.titlePosition+'">'+a+"</div>":!1},N=function(){if(z=p.title||"",y=0,i.empty().removeAttr("style").removeClass(),p.titleShow===!1)return i.hide(),void 0;if(z=a.isFunction(p.titleFormat)?p.titleFormat(z,q,o,p):M(z),!z||""===z)return i.hide(),void 0;switch(i.addClass("fancybox-title-"+p.titlePosition).html(z).appendTo("body").show(),p.titlePosition){case"inside":i.css({width:B.width-2*p.padding,marginLeft:p.padding,marginRight:p.padding}),y=i.outerHeight(!0),i.appendTo(f),B.height+=y;break;case"over":i.css({marginLeft:p.padding,width:B.width-2*p.padding,bottom:p.padding}).appendTo(f);break;case"float":i.css("left",-1*parseInt((i.width()-B.width-40)/2,10)).appendTo(e);break;default:i.css({width:B.width-2*p.padding,paddingLeft:p.padding,paddingRight:p.padding}).appendTo(e)}i.hide()},O=function(){return(p.enableEscapeButton||p.enableKeyboardNav)&&a(document).bind("keydown.fb",function(b){27==b.keyCode&&p.enableEscapeButton?(b.preventDefault(),a.fancybox.close()):37!=b.keyCode&&39!=b.keyCode||!p.enableKeyboardNav||"INPUT"===b.target.tagName||"TEXTAREA"===b.target.tagName||"SELECT"===b.target.tagName||(b.preventDefault(),a.fancybox[37==b.keyCode?"prev":"next"]())}),p.showNavArrows?((p.cyclic&&q.length>1||0!==o)&&j.show(),(p.cyclic&&q.length>1||o!=q.length-1)&&k.show(),void 0):(j.hide(),k.hide(),void 0)},P=function(){a.support.opacity||(g.get(0).style.removeAttribute("filter"),e.get(0).style.removeAttribute("filter")),m.autoDimensions&&g.css("height","auto"),e.css("height","auto"),z&&z.length&&i.show(),p.showCloseButton&&h.show(),O(),p.hideOnContentClick&&g.bind("click",a.fancybox.close),p.hideOnOverlayClick&&d.bind("click",a.fancybox.close),p.autoResize&&a(window).bind("resize.fb",a.fancybox.resize),p.centerOnScroll&&a(window).bind("scroll.fb",a.fancybox.center),"iframe"==p.type&&a('<iframe id="fancybox-frame" name="fancybox-frame'+(new Date).getTime()+'" frameborder="0" hspace="0" '+(navigator.userAgent.match(/msie [6]/i)?'allowtransparency="true""':"")+' scrolling="'+m.scrolling+'" src="'+p.href+'"></iframe>').appendTo(g),e.show(),C=!1,a.fancybox.center(),p.onComplete(q,o,p),Q()},Q=function(){var a,b;q.length-1>o&&(a=q[o+1].href,a!==void 0&&a.match(t)&&(b=new Image,b.src=a)),o>0&&(a=q[o-1].href,a!==void 0&&a.match(t)&&(b=new Image,b.src=a))},R=function(a){var b={width:parseInt(A.width+(B.width-A.width)*a,10),height:parseInt(A.height+(B.height-A.height)*a,10),top:parseInt(A.top+(B.top-A.top)*a,10),left:parseInt(A.left+(B.left-A.left)*a,10)};B.opacity!==void 0&&(b.opacity=.5>a?.5:a),e.css(b),g.css({width:b.width-2*p.padding,height:b.height-y*a-2*p.padding})},S=function(){return[a(window).width()-2*p.margin,a(window).height()-2*p.margin,a(document).scrollLeft()+p.margin,a(document).scrollTop()+p.margin]},T=function(){var e,a=S(),b={},c=p.autoScale,d=2*p.padding;return b.width=(""+p.width).indexOf("%")>-1?parseInt(a[0]*parseFloat(p.width)/100,10):p.width+d,b.height=(""+p.height).indexOf("%")>-1?parseInt(a[1]*parseFloat(p.height)/100,10):p.height+d,c&&(b.width>a[0]||b.height>a[1])&&("image"==m.type||"svg"==m.type||"swf"==m.type?(e=p.width/p.height,b.width>a[0]&&(b.width=a[0],b.height=parseInt((b.width-d)/e+d,10)),b.height>a[1]&&(b.height=a[1],b.width=parseInt((b.height-d)*e+d,10))):(b.width=Math.min(b.width,a[0]),b.height=Math.min(b.height,a[1]))),b.top=parseInt(Math.max(a[3]-20,a[3]+.5*(a[1]-b.height-40)),10),b.left=parseInt(Math.max(a[2]-20,a[2]+.5*(a[0]-b.width-40)),10),b},U=function(a){var b=a.offset();return b.top+=parseInt(a.css("paddingTop"),10)||0,b.left+=parseInt(a.css("paddingLeft"),10)||0,b.top+=parseInt(a.css("border-top-width"),10)||0,b.left+=parseInt(a.css("border-left-width"),10)||0,b.width=a.width(),b.height=a.height(),b},V=function(){var d,e,b=m.orig?a(m.orig):!1,c={};return b&&b.length?(d=U(b),c={width:d.width+2*p.padding,height:d.height+2*p.padding,top:d.top-p.padding-20,left:d.left-p.padding-20}):(e=S(),c={width:2*p.padding,height:2*p.padding,top:parseInt(e[3]+.5*e[1],10),left:parseInt(e[2]+.5*e[0],10)}),c},W=function(){return c.is(":visible")?(a("div",c).css("top",-40*x+"px"),x=(x+1)%12,void 0):(clearInterval(w),void 0)};a.fn.fancybox=function(b){return a(this).length?(a(this).data("fancybox",a.extend({},b,a.metadata?a(this).metadata():{})).unbind("click.fb").bind("click.fb",function(b){if(b.preventDefault(),!C){C=!0,a(this).blur(),n=[],l=0;var c=a(this).attr("rel")||"";c&&""!=c&&"nofollow"!==c?(n=a('a[rel="'+c+'"], area[rel="'+c+'"]'),l=n.index(this)):n.push(this),I()}}),this):this},a.fancybox=function(b){var c;if(!C){if(C=!0,c=arguments[1]!==void 0?arguments[1]:{},n=[],l=parseInt(c.index,10)||0,a.isArray(b)){for(var d=0,e=b.length;e>d;d++)"object"==typeof b[d]?a(b[d]).data("fancybox",a.extend({},c,b[d])):b[d]=a({}).data("fancybox",a.extend({content:b[d]},c));n=jQuery.merge(n,b)}else"object"==typeof b?a(b).data("fancybox",a.extend({},c,b)):b=a({}).data("fancybox",a.extend({content:b},c)),n.push(b);(l>n.length||0>l)&&(l=0),I()}},a.fancybox.showActivity=function(){clearInterval(w),c.show(),w=setInterval(W,66)},a.fancybox.hideActivity=function(){c.hide()},a.fancybox.next=function(){return a.fancybox.pos(o+1)},a.fancybox.prev=function(){return a.fancybox.pos(o-1)},a.fancybox.pos=function(a){C||(a=parseInt(a),n=q,a>-1&&q.length>a?(l=a,I()):p.cyclic&&q.length>1&&(l=a>=q.length?0:q.length-1,I()))},a.fancybox.cancel=function(){C||(C=!0,a(".fancybox-inline-tmp").trigger("fancybox-cancel"),G(),m.onCancel(n,l,m),C=!1)},a.fancybox.close=function(){function b(){d.fadeOut("fast"),i.empty().hide(),e.hide(),a(".fancybox-inline-tmp").trigger("fancybox-cleanup"),g.empty(),p.onClosed(q,o,p),q=m=[],o=l=0,p=m={},C=!1}if(!C&&!e.is(":hidden")){if(C=!0,p&&!1===p.onCleanup(q,o,p))return C=!1,void 0;if(G(),a(h.add(j).add(k)).hide(),a(g.add(d)).unbind(),a(window).unbind("resize.fb scroll.fb"),a(document).unbind("keydown.fb"),g.find("iframe#fancybox-frame").attr("src",E&&/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank"),"inside"!==p.titlePosition&&i.empty(),e.stop(),"elastic"==p.transitionOut){A=V();var c=e.position();B={top:c.top,left:c.left,width:e.width(),height:e.height()},p.opacity&&(B.opacity=1),i.empty().hide(),D.prop=1,a(D).animate({prop:0},{duration:p.speedOut,easing:p.easingOut,step:R,complete:b})}else e.fadeOut("none"==p.transitionOut?0:p.speedOut,b)}},a.fancybox.resize=function(){d.is(":visible")&&d.css("height",a(document).height()),a.fancybox.center(!0)},a.fancybox.center=function(){var a,b;C||(b=arguments[0]===!0?1:0,a=S(),(b||!(e.width()>a[0]||e.height()>a[1]))&&e.stop().animate({top:parseInt(Math.max(a[3]-20,a[3]+.5*(a[1]-g.height()-40)-p.padding)),left:parseInt(Math.max(a[2]-20,a[2]+.5*(a[0]-g.width()-40)-p.padding))},"number"==typeof arguments[0]?arguments[0]:200))},a.fancybox.init=function(){a("#fancybox-wrap").length||(a("body").append(b=a('<div id="fancybox-tmp"></div>'),c=a('<div id="fancybox-loading"><div></div></div>'),d=a('<div id="fancybox-overlay"></div>'),e=a('<div id="fancybox-wrap"></div>')),f=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(e),f.append(g=a('<div id="fancybox-content"></div>'),h=a('<a id="fancybox-close"></a>'),i=a('<div id="fancybox-title"></div>'),j=a('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'),k=a('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>')),h.click(a.fancybox.close),c.click(a.fancybox.cancel),j.click(function(b){b.preventDefault(),a.fancybox.prev()}),k.click(function(b){b.preventDefault(),a.fancybox.next()}),a.fn.mousewheel&&e.bind("mousewheel.fb",function(b,c){C?b.preventDefault():(0==a(b.target).get(0).clientHeight||a(b.target).get(0).scrollHeight===a(b.target).get(0).clientHeight)&&(b.preventDefault(),a.fancybox[c>0?"prev":"next"]())}),a.support.opacity||e.addClass("fancybox-ie"),E&&(c.addClass("fancybox-ie6"),e.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(f)))},a.fn.fancybox.defaults={padding:10,margin:40,opacity:!1,modal:!1,cyclic:!1,scrolling:"auto",width:560,height:340,autoScale:!0,autoDimensions:!0,centerOnScroll:!F,autoResize:!F,ajax:{},swf:{wmode:"transparent"},svg:{wmode:"transparent"},hideOnOverlayClick:!0,hideOnContentClick:!1,overlayShow:!0,overlayOpacity:.7,overlayColor:"#777",titleShow:!0,titlePosition:"float",titleFormat:null,titleFromAlt:!1,transitionIn:"fade",transitionOut:"fade",speedIn:300,speedOut:300,changeSpeed:300,changeFade:"fast",easingIn:"swing",easingOut:"swing",showCloseButton:!0,showNavArrows:!0,enableEscapeButton:!0,enableKeyboardNav:!0,onStart:function(){},onCancel:function(){},onComplete:function(){},onCleanup:function(){},onClosed:function(){},onError:function(){}},a(document).ready(function(){a.fancybox.init()})})(jQuery);
languages/easy-fancybox-sr_RS.mo ADDED
Binary file
languages/easy-fancybox-tr_TR.mo CHANGED
Binary file
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=ravan
4
  Tags: fancybox, lightbox, gallery, image, photo, video, flash, nextgen, overlay, youtube, vimeo, dailymotion, pdf, svg, iframe, swf, jquery
5
  Requires at least: 3.3
6
  Tested up to: 3.6
7
- Stable tag: 1.5.0
8
 
9
  Easily enable the FancyBox jQuery extension on just about all media links. Multi-Site compatible. Supports iFrame and Flash movies.
10
 
@@ -42,18 +42,19 @@ Visit [FancyBox](http://fancybox.net/) for more information, examples and the Fa
42
 
43
  = Translators =
44
 
45
- - **Dutch** * Author: [R.A. van Hagen](http://status301.net) (version 1.5.0)
46
- - **French** * Author: Emmanuel Maillard (version 1.3.4.9)
47
- - **Gujarati** * Author: [Apoto Team](http://www.apoto.com) (version 1.5.0)
48
- - **Hindi** * Author: [Outshine Solutions](http://outshinesolutions.com) (version 1.3.4.9)
49
- - **Indonesian** * Author: [Nasrulhaq Muiz](http://al-badar.net) (version 1.3.4.9)
50
- - **Lithuanian** * Author: [Vincent G](http://www.host1free.com) (version 1.3.4.9)
51
- - **Polish** * Author: Kamil Szymański (version 1.3.4.9)
52
- - **Romanian** * Author: [Web Geek Sciense](http://webhostinggeeks.com/) (version 1.3.4.9)
53
- - **Slovak** Author: [Branco Radenovich (WebHostingGeeks.com)](http://webhostinggeeks.com/blog/) (version: 1.3.4.9)
54
- - **Spanish** * Author: [David Pérez](http://www.closemarketing.es) (version 1.3.4.9)
55
- - **Turkish** * Author: [Hakan Er](http://hakanertr.wordpress.com/) (version: 1.5.0)
56
- - **Ukrainian** * Author: [Cmd Software](http://www.cmd-soft.com) (version: 1.3.4.9)
 
57
 
58
  == Installation ==
59
 
@@ -449,11 +450,19 @@ If you still do not get to see your images in FancyBox, ask on the [Easy FancyBo
449
 
450
  == Upgrade Notice ==
451
 
452
- = 1.5.0 =
453
- Many new options. Speed improvements: stylesheet browser caching, metadata.js compression. Security fix. Dutch, Indonesian and Polish translations.
454
 
455
  == Changelog ==
456
 
 
 
 
 
 
 
 
 
457
  = 1.5.0 =
458
  * FIX: CSS3 box-sizing issue (Twenty Thirteen) misplacing close button
459
  * NEW: Added SVG support. Thanks to Simon Maillard.
4
  Tags: fancybox, lightbox, gallery, image, photo, video, flash, nextgen, overlay, youtube, vimeo, dailymotion, pdf, svg, iframe, swf, jquery
5
  Requires at least: 3.3
6
  Tested up to: 3.6
7
+ Stable tag: 1.5.2
8
 
9
  Easily enable the FancyBox jQuery extension on just about all media links. Multi-Site compatible. Supports iFrame and Flash movies.
10
 
42
 
43
  = Translators =
44
 
45
+ - **Dutch** * R.A. van Hagen http://status301.net (version 1.5.0)
46
+ - **French** * Emmanuel Maillard (version 1.3.4.9)
47
+ - **Gujarati** * Apoto Team http://www.apoto.com (version 1.5.0)
48
+ - **Hindi** * Outshine Solutions http://outshinesolutions.com (version 1.3.4.9)
49
+ - **Indonesian** * Nasrulhaq Muiz http://al-badar.net (version 1.3.4.9)
50
+ - **Lithuanian** * Vincent G http://www.host1free.com (version 1.3.4.9)
51
+ - **Polish** * Kamil Szymański (version 1.3.4.9)
52
+ - **Romanian** * Web Geek Sciense http://webhostinggeeks.com/ (version 1.3.4.9)
53
+ - **Serbo-Croatian** Andrijana Nikolic http://webhostinggeeks.com/wordpresshosting.html (version 1.5.2) + translation of this page on http://science.webhostinggeeks.com/easy-fancybox
54
+ - **Slovak** Branco Radenovich http://webhostinggeeks.com/blog/ (version: 1.3.4.9)
55
+ - **Spanish** * David Pérez http://www.closemarketing.es (version 1.3.4.9)
56
+ - **Turkish** * Hakan Er http://hakanertr.wordpress.com/ (version: 1.5.2)
57
+ - **Ukrainian** * Cmd Software http://www.cmd-soft.com (version: 1.3.4.9)
58
 
59
  == Installation ==
60
 
450
 
451
  == Upgrade Notice ==
452
 
453
+ = 1.5.1 =
454
+ jQuery 1.9+ compatibility plus Jetpack's Infinite Scroll support.
455
 
456
  == Changelog ==
457
 
458
+ = 1.5.2 =
459
+ * BUGFIX: easy_fancybox_handler() in combo with trigger('click') causes Uncaught Exception script error
460
+
461
+ = 1.5.1 =
462
+ * FIX: jQuery 1.9+ compatibility
463
+ * Dropping support for gForms again -- "Cannot convert 'c' to object" error in combinaition with some older gForms version :(
464
+ * NEW: support for Infinite Scroll by Jetpack
465
+
466
  = 1.5.0 =
467
  * FIX: CSS3 box-sizing issue (Twenty Thirteen) misplacing close button
468
  * NEW: Added SVG support. Thanks to Simon Maillard.