Easy Image Gallery - Version 1.0.1

Version Description

  • Tweak: Images now link to the "large" image size by default, rather than the original image
  • Tweak: Removed "remove" links underneath each image and added a [-] on hover to be consistent with WordPress' media manager styling
  • New: linked_image_size filter for specifying which image size the thumbnails should link to
  • New: 2 new filters added for overriding the JS for prettyPhoto and fancyBox. easy_image_gallery_prettyphoto_js and easy_image_gallery_fancybox_js
Download this release

Release Info

Developer sumobi
Plugin Icon 128x128 Easy Image Gallery
Version 1.0.1
Comparing to
See all releases

Version 1.0.1

Files changed (69) hide show
  1. easy-image-gallery.php +84 -0
  2. includes/admin-page.php +160 -0
  3. includes/css/easy-image-gallery.css +77 -0
  4. includes/fonts/easy-image-gallery.eot +0 -0
  5. includes/fonts/easy-image-gallery.svg +19 -0
  6. includes/fonts/easy-image-gallery.ttf +0 -0
  7. includes/fonts/easy-image-gallery.woff +0 -0
  8. includes/lib/fancybox/blank.gif +0 -0
  9. includes/lib/fancybox/fancybox_loading.gif +0 -0
  10. includes/lib/fancybox/fancybox_loading@2x.gif +0 -0
  11. includes/lib/fancybox/fancybox_overlay.png +0 -0
  12. includes/lib/fancybox/fancybox_sprite.png +0 -0
  13. includes/lib/fancybox/fancybox_sprite@2x.png +0 -0
  14. includes/lib/fancybox/helpers/fancybox_buttons.png +0 -0
  15. includes/lib/fancybox/helpers/jquery.fancybox-buttons.css +97 -0
  16. includes/lib/fancybox/helpers/jquery.fancybox-buttons.js +122 -0
  17. includes/lib/fancybox/helpers/jquery.fancybox-media.js +199 -0
  18. includes/lib/fancybox/helpers/jquery.fancybox-thumbs.css +55 -0
  19. includes/lib/fancybox/helpers/jquery.fancybox-thumbs.js +162 -0
  20. includes/lib/fancybox/jquery.fancybox.css +274 -0
  21. includes/lib/fancybox/jquery.fancybox.js +2020 -0
  22. includes/lib/fancybox/jquery.fancybox.pack.js +46 -0
  23. includes/lib/images/prettyPhoto/dark_rounded/btnNext.png +0 -0
  24. includes/lib/images/prettyPhoto/dark_rounded/btnPrevious.png +0 -0
  25. includes/lib/images/prettyPhoto/dark_rounded/contentPattern.png +0 -0
  26. includes/lib/images/prettyPhoto/dark_rounded/default_thumbnail.gif +0 -0
  27. includes/lib/images/prettyPhoto/dark_rounded/loader.gif +0 -0
  28. includes/lib/images/prettyPhoto/dark_rounded/sprite.png +0 -0
  29. includes/lib/images/prettyPhoto/dark_square/btnNext.png +0 -0
  30. includes/lib/images/prettyPhoto/dark_square/btnPrevious.png +0 -0
  31. includes/lib/images/prettyPhoto/dark_square/contentPattern.png +0 -0
  32. includes/lib/images/prettyPhoto/dark_square/default_thumbnail.gif +0 -0
  33. includes/lib/images/prettyPhoto/dark_square/loader.gif +0 -0
  34. includes/lib/images/prettyPhoto/dark_square/sprite.png +0 -0
  35. includes/lib/images/prettyPhoto/default/default_thumb.png +0 -0
  36. includes/lib/images/prettyPhoto/default/loader.gif +0 -0
  37. includes/lib/images/prettyPhoto/default/sprite.png +0 -0
  38. includes/lib/images/prettyPhoto/default/sprite_next.png +0 -0
  39. includes/lib/images/prettyPhoto/default/sprite_prev.png +0 -0
  40. includes/lib/images/prettyPhoto/default/sprite_x.png +0 -0
  41. includes/lib/images/prettyPhoto/default/sprite_y.png +0 -0
  42. includes/lib/images/prettyPhoto/facebook/btnNext.png +0 -0
  43. includes/lib/images/prettyPhoto/facebook/btnPrevious.png +0 -0
  44. includes/lib/images/prettyPhoto/facebook/contentPatternBottom.png +0 -0
  45. includes/lib/images/prettyPhoto/facebook/contentPatternLeft.png +0 -0
  46. includes/lib/images/prettyPhoto/facebook/contentPatternRight.png +0 -0
  47. includes/lib/images/prettyPhoto/facebook/contentPatternTop.png +0 -0
  48. includes/lib/images/prettyPhoto/facebook/default_thumbnail.gif +0 -0
  49. includes/lib/images/prettyPhoto/facebook/loader.gif +0 -0
  50. includes/lib/images/prettyPhoto/facebook/sprite.png +0 -0
  51. includes/lib/images/prettyPhoto/light_rounded/btnNext.png +0 -0
  52. includes/lib/images/prettyPhoto/light_rounded/btnPrevious.png +0 -0
  53. includes/lib/images/prettyPhoto/light_rounded/default_thumbnail.gif +0 -0
  54. includes/lib/images/prettyPhoto/light_rounded/loader.gif +0 -0
  55. includes/lib/images/prettyPhoto/light_rounded/sprite.png +0 -0
  56. includes/lib/images/prettyPhoto/light_square/btnNext.png +0 -0
  57. includes/lib/images/prettyPhoto/light_square/btnPrevious.png +0 -0
  58. includes/lib/images/prettyPhoto/light_square/default_thumbnail.gif +0 -0
  59. includes/lib/images/prettyPhoto/light_square/loader.gif +0 -0
  60. includes/lib/images/prettyPhoto/light_square/sprite.png +0 -0
  61. includes/lib/prettyphoto/jquery.prettyPhoto.js +7 -0
  62. includes/lib/prettyphoto/prettyPhoto.css +170 -0
  63. includes/metabox.php +253 -0
  64. includes/scripts.php +203 -0
  65. includes/template-functions.php +382 -0
  66. languages/default.mo +0 -0
  67. languages/default.po +71 -0
  68. readme.txt +109 -0
  69. uninstall.php +7 -0
easy-image-gallery.php ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Plugin Name: Easy Image Gallery
4
+ Plugin URI: http://sumobi.com/shop/easy-image-gallery/
5
+ Description: An easy to use image gallery with drag & drop re-ordering
6
+ Version: 1.0.1
7
+ Author: Andrew Munro, Sumobi
8
+ Author URI: http://sumobi.com
9
+ License: GPL-2.0+
10
+ License URI: http://www.opensource.org/licenses/gpl-license.php
11
+ */
12
+
13
+ // Exit if accessed directly
14
+ if ( ! defined( 'ABSPATH' ) ) exit;
15
+
16
+ if ( !class_exists( 'Easy_Image_Gallery' ) ) {
17
+
18
+ /**
19
+ * PHP5 constructor method.
20
+ *
21
+ * @since 1.0
22
+ */
23
+ class Easy_Image_Gallery {
24
+
25
+ public function __construct() {
26
+ add_action( 'plugins_loaded', array( $this, 'load_textdomain' ) );
27
+ add_action( 'plugins_loaded', array( $this, 'constants' ));
28
+ add_action( 'plugins_loaded', array( $this, 'includes' ) );
29
+ add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), 'easy_image_gallery_plugin_action_links' );
30
+ }
31
+
32
+
33
+ /**
34
+ * Internationalization
35
+ *
36
+ * @since 1.0
37
+ */
38
+ public function load_textdomain() {
39
+ load_plugin_textdomain( 'easy-image-gallery', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
40
+ }
41
+
42
+
43
+ /**
44
+ * Constants
45
+ *
46
+ * @since 1.0
47
+ */
48
+ public function constants() {
49
+
50
+ if ( !defined( 'EASY_IMAGE_GALLERY_DIR' ) )
51
+ define( 'EASY_IMAGE_GALLERY_DIR', trailingslashit( plugin_dir_path( __FILE__ ) ) );
52
+
53
+ if ( !defined( 'EASY_IMAGE_GALLERY_URL' ) )
54
+ define( 'EASY_IMAGE_GALLERY_URL', trailingslashit( plugin_dir_url( __FILE__ ) ) );
55
+
56
+ if ( ! defined( 'EASY_IMAGE_GALLERY_VERSION' ) )
57
+ define( 'EASY_IMAGE_GALLERY_VERSION', '1.0' );
58
+
59
+ if ( ! defined( 'EASY_IMAGE_GALLERY_INCLUDES' ) )
60
+ define( 'EASY_IMAGE_GALLERY_INCLUDES', EASY_IMAGE_GALLERY_DIR . trailingslashit( 'includes' ) );
61
+
62
+ }
63
+
64
+
65
+ /**
66
+ * Loads the initial files needed by the plugin.
67
+ *
68
+ * @since 1.0
69
+ */
70
+ public function includes() {
71
+
72
+ require_once( EASY_IMAGE_GALLERY_INCLUDES . 'template-functions.php' );
73
+ require_once( EASY_IMAGE_GALLERY_INCLUDES . 'scripts.php' );
74
+ require_once( EASY_IMAGE_GALLERY_INCLUDES . 'metabox.php' );
75
+ require_once( EASY_IMAGE_GALLERY_INCLUDES . 'admin-page.php' );
76
+
77
+ }
78
+
79
+
80
+
81
+ }
82
+ }
83
+
84
+ $Easy_Image_Gallery = new Easy_Image_Gallery();
includes/admin-page.php ADDED
@@ -0,0 +1,160 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Admin options
4
+ *
5
+ * @since 1.0
6
+ */
7
+ function easy_image_gallery_menu() {
8
+ add_plugins_page( __( 'Easy Image Gallery', 'easy-image-gallery' ), __( 'Easy Image Gallery', 'easy-image-gallery' ), 'manage_options', 'easy-image-gallery', 'easy_image_gallery_admin_page' );
9
+ }
10
+ add_action( 'admin_menu', 'easy_image_gallery_menu' );
11
+
12
+
13
+ /**
14
+ * Admin page
15
+ *
16
+ * @since 1.0
17
+ */
18
+
19
+ function easy_image_gallery_admin_page() { ?>
20
+ <div class="wrap">
21
+ <?php screen_icon( 'plugins' ); ?>
22
+ <h2><?php _e( 'Easy Image Gallery', 'easy-image-gallery' ); ?></h2>
23
+
24
+ <form action="options.php" method="POST">
25
+
26
+ <?php settings_errors(); ?>
27
+
28
+ <?php settings_fields( 'my-settings-group' ); ?>
29
+
30
+ <?php do_settings_sections( 'easy-image-gallery-settings' ); ?>
31
+
32
+ <?php submit_button(); ?>
33
+ </form>
34
+
35
+ </div>
36
+ <?php
37
+ }
38
+
39
+
40
+ /**
41
+ * Admin init
42
+ *
43
+ * @since 1.0
44
+ */
45
+ function easy_image_gallery_admin_init() {
46
+
47
+ register_setting( 'my-settings-group', 'easy-image-gallery', 'easy_image_gallery_settings_sanitize' );
48
+
49
+ // sections
50
+ add_settings_section( 'general', __( 'General', 'easy-image-gallery' ), '', 'easy-image-gallery-settings' );
51
+
52
+ // settings
53
+ add_settings_field( 'lightbox', __( 'Lightbox', 'easy-image-gallery' ), 'lightbox_callback', 'easy-image-gallery-settings', 'general' );
54
+ add_settings_field( 'post-types', __( 'Post Types', 'easy-image-gallery' ), 'post_types_callback', 'easy-image-gallery-settings', 'general' );
55
+
56
+ }
57
+ add_action( 'admin_init', 'easy_image_gallery_admin_init' );
58
+
59
+
60
+ /**
61
+ * Lightbox callback
62
+ *
63
+ * @since 1.0
64
+ */
65
+ function lightbox_callback() {
66
+
67
+ // default option when settings have not been saved
68
+ $defaults['lightbox'] = 'prettyphoto';
69
+
70
+ $settings = (array) get_option( 'easy-image-gallery', $defaults );
71
+
72
+ $lightbox = esc_attr( $settings['lightbox'] );
73
+ ?>
74
+ <select name="easy-image-gallery[lightbox]">
75
+ <?php foreach ( easy_image_gallery_lightbox() as $key => $label ) { ?>
76
+ <option value="<?php echo $key; ?>" <?php selected( $lightbox, $key ); ?>><?php echo $label; ?></option>
77
+ <?php } ?>
78
+ </select>
79
+
80
+ <?php if ( 'fancybox' == $lightbox ) : ?>
81
+ <p class="description"><?php printf( __( 'Please note: fancyBox requires a %s for commercial use', 'easy-image-gallery' ), '<a title="fancyBox" href="http://fancyapps.com/fancybox/#license" target="_blank">license</a>' ); ?></p>
82
+ <?php endif; ?>
83
+
84
+ <?php
85
+
86
+ }
87
+
88
+ /**
89
+ * Post Types callback
90
+ *
91
+ * @since 1.0
92
+ */
93
+
94
+ function post_types_callback() {
95
+
96
+ // post and page defaults
97
+ $defaults['post_types']['post'] = 'on';
98
+ $defaults['post_types']['page'] = 'on';
99
+
100
+ $settings = (array) get_option( 'easy-image-gallery', $defaults );
101
+
102
+ ?>
103
+ <?php foreach ( easy_image_gallery_get_post_types() as $key => $label ) {
104
+
105
+ $post_types = isset( $settings['post_types'][ $key ] ) ? esc_attr( $settings['post_types'][ $key ] ) : '';
106
+
107
+ ?>
108
+ <p>
109
+ <input type="checkbox" id="<?php echo $key; ?>" name="easy-image-gallery[post_types][<?php echo $key; ?>]" <?php checked( $post_types, 'on' ); ?>/><label for="<?php echo $key; ?>"> <?php echo $label; ?></label>
110
+ </p>
111
+ <?php } ?>
112
+ <?php
113
+
114
+ }
115
+
116
+
117
+ /**
118
+ * Sanitization
119
+ *
120
+ * @since 1.0
121
+ */
122
+ function easy_image_gallery_settings_sanitize( $input ) {
123
+
124
+ // Create our array for storing the validated options
125
+ $output = array();
126
+
127
+ // lightbox
128
+ $valid = easy_image_gallery_lightbox();
129
+
130
+ if ( array_key_exists( $input['lightbox'], $valid ) )
131
+ $output['lightbox'] = $input['lightbox'];
132
+
133
+ // post types
134
+ $post_types = isset( $input['post_types'] ) ? $input['post_types'] : '';
135
+
136
+ // only loop through if there are post types in the array
137
+ if ( $post_types ) {
138
+ foreach ( $post_types as $post_type => $value )
139
+ $output[ 'post_types' ][ $post_type ] = isset( $input[ 'post_types' ][ $post_type ] ) ? 'on' : '';
140
+ }
141
+
142
+
143
+
144
+ return apply_filters( 'sandbox_theme_validate_input_examples', $output, $input );
145
+
146
+ }
147
+
148
+
149
+ /**
150
+ * Action Links
151
+ *
152
+ * @since 1.0
153
+ */
154
+ function easy_image_gallery_plugin_action_links( $links ) {
155
+
156
+ $settings_link = '<a href="' . get_bloginfo( 'wpurl' ) . '/wp-admin/plugins.php?page=easy-image-gallery">'. __( 'Settings', 'easy-image-gallery' ) .'</a>';
157
+ array_unshift( $links, $settings_link );
158
+
159
+ return $links;
160
+ }
includes/css/easy-image-gallery.css ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @font-face {
2
+ font-family: 'easy-image-gallery';
3
+ src: url('../fonts/easy-image-gallery.eot');
4
+ src: url('../fonts/easy-image-gallery.eot?#iefix') format('embedded-opentype'), url('../fonts/easy-image-gallery.woff') format('woff'), url('../fonts/easy-image-gallery.ttf') format('truetype'), url('../fonts/easy-image-gallery.svg#easy-image-gallery') format('svg');
5
+ font-weight: normal;
6
+ font-style: normal;
7
+ }
8
+ .popup {
9
+ display: block;
10
+ }
11
+ .popup .icon-view:before {
12
+ content: "\e005";
13
+ }
14
+ .popup .icon-view {
15
+ font-family: 'easy-image-gallery';
16
+ speak: none;
17
+ font-style: normal;
18
+ font-weight: normal;
19
+ font-variant: normal;
20
+ text-transform: none;
21
+ line-height: 1;
22
+ -webkit-font-smoothing: antialiased;
23
+ font-size: 48px;
24
+ margin-left: -24px;
25
+ margin-top: -24px;
26
+ position: absolute;
27
+ left: 50%;
28
+ top: 50%;
29
+ color: #fff;
30
+ opacity: 0;
31
+ visibility: visible;
32
+ -webkit-transition: opacity 0.1s linear;
33
+ -moz-transition: opacity 0.1s linear;
34
+ -ms-transition: opacity 0.1s linear;
35
+ -o-transition: opacity 0.1s linear;
36
+ transition: opacity 0.1s linear;
37
+ z-index: 1;
38
+ }
39
+ .popup .overlay {
40
+ visibility: hidden;
41
+ display: block;
42
+ height: 100%;
43
+ width: 100%;
44
+ position: absolute;
45
+ opacity: 0.4;
46
+ -webkit-transition: all 0.1s linear;
47
+ -moz-transition: all 0.1s linear;
48
+ -ms-transition: all 0.1s linear;
49
+ -o-transition: all 0.1s linear;
50
+ transition: all 0.1s linear;
51
+ }
52
+ .popup:hover .overlay {
53
+ visibility: visible;
54
+ background: #000;
55
+ }
56
+ .popup:hover .icon-view {
57
+ opacity: 0.8;
58
+ }
59
+ .image-gallery {
60
+ margin: 0;
61
+ padding: 0;
62
+ }
63
+ .image-gallery li {
64
+ display: inline-block;
65
+ padding: 0 20px 20px 0;
66
+ margin: 0;
67
+ }
68
+ .image-gallery a {
69
+ position: relative;
70
+ display: block;
71
+ }
72
+ .image-gallery a img {
73
+ display: block;
74
+ }
75
+ .image-gallery ul {
76
+ margin-bottom: 0;
77
+ }
includes/fonts/easy-image-gallery.eot ADDED
Binary file
includes/fonts/easy-image-gallery.svg ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" standalone="no"?>
2
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
3
+ <svg xmlns="http://www.w3.org/2000/svg">
4
+ <metadata>
5
+ This is a custom SVG font generated by IcoMoon.
6
+
7
+ </metadata>
8
+ <defs>
9
+ <font id="icomoon" horiz-adv-x="512" >
10
+ <font-face units-per-em="512" ascent="480" descent="-32" />
11
+ <missing-glyph horiz-adv-x="512" />
12
+ <glyph class="hidden" unicode="&#xf000;" d="M0,480L 512 -32L0 -32 z" horiz-adv-x="0" />
13
+ <glyph unicode="&#xe005;" d="M 256.736,340.896c 56.306,0, 110.001-38.105, 145.131-70.071c 19.087-17.367, 34.995-34.96, 46.649-48.949
14
+ c-11.747-13.973-27.782-31.549-47.005-48.906c-35.37-31.937-89.373-70.004-145.776-70.004
15
+ c-56.401,0-110.404,38.069-145.774,70.004c-19.119,17.261-35.084,34.743-46.813,48.678c 11.832,14.004, 27.956,31.6, 47.252,48.974
16
+ C 146.004,302.681, 200.293,340.896, 256.736,340.896 M 256.736,391.092C 115.285,391.092-0.383,221.721-0.383,221.721
17
+ s 114.669-168.953, 256.118-168.953c 141.452,0, 256.12,168.953, 256.12,168.953S 398.186,391.092, 256.736,391.092L 256.736,391.092zM 198.82,222.493A56.915,56.915 180 1 1 312.65,222.493A56.915,56.915 180 1 1 198.82,222.493z" />
18
+ <glyph unicode="&#x20;" horiz-adv-x="256" />
19
+ </font></defs></svg>
includes/fonts/easy-image-gallery.ttf ADDED
Binary file
includes/fonts/easy-image-gallery.woff ADDED
Binary file
includes/lib/fancybox/blank.gif ADDED
Binary file
includes/lib/fancybox/fancybox_loading.gif ADDED
Binary file
includes/lib/fancybox/fancybox_loading@2x.gif ADDED
Binary file
includes/lib/fancybox/fancybox_overlay.png ADDED
Binary file
includes/lib/fancybox/fancybox_sprite.png ADDED
Binary file
includes/lib/fancybox/fancybox_sprite@2x.png ADDED
Binary file
includes/lib/fancybox/helpers/fancybox_buttons.png ADDED
Binary file
includes/lib/fancybox/helpers/jquery.fancybox-buttons.css ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #fancybox-buttons {
2
+ position: fixed;
3
+ left: 0;
4
+ width: 100%;
5
+ z-index: 8050;
6
+ }
7
+
8
+ #fancybox-buttons.top {
9
+ top: 10px;
10
+ }
11
+
12
+ #fancybox-buttons.bottom {
13
+ bottom: 10px;
14
+ }
15
+
16
+ #fancybox-buttons ul {
17
+ display: block;
18
+ width: 166px;
19
+ height: 30px;
20
+ margin: 0 auto;
21
+ padding: 0;
22
+ list-style: none;
23
+ border: 1px solid #111;
24
+ border-radius: 3px;
25
+ -webkit-box-shadow: inset 0 0 0 1px rgba(255,255,255,.05);
26
+ -moz-box-shadow: inset 0 0 0 1px rgba(255,255,255,.05);
27
+ box-shadow: inset 0 0 0 1px rgba(255,255,255,.05);
28
+ background: rgb(50,50,50);
29
+ background: -moz-linear-gradient(top, rgb(68,68,68) 0%, rgb(52,52,52) 50%, rgb(41,41,41) 50%, rgb(51,51,51) 100%);
30
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgb(68,68,68)), color-stop(50%,rgb(52,52,52)), color-stop(50%,rgb(41,41,41)), color-stop(100%,rgb(51,51,51)));
31
+ background: -webkit-linear-gradient(top, rgb(68,68,68) 0%,rgb(52,52,52) 50%,rgb(41,41,41) 50%,rgb(51,51,51) 100%);
32
+ background: -o-linear-gradient(top, rgb(68,68,68) 0%,rgb(52,52,52) 50%,rgb(41,41,41) 50%,rgb(51,51,51) 100%);
33
+ background: -ms-linear-gradient(top, rgb(68,68,68) 0%,rgb(52,52,52) 50%,rgb(41,41,41) 50%,rgb(51,51,51) 100%);
34
+ background: linear-gradient(top, rgb(68,68,68) 0%,rgb(52,52,52) 50%,rgb(41,41,41) 50%,rgb(51,51,51) 100%);
35
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#444444', endColorstr='#222222',GradientType=0 );
36
+ }
37
+
38
+ #fancybox-buttons ul li {
39
+ float: left;
40
+ margin: 0;
41
+ padding: 0;
42
+ }
43
+
44
+ #fancybox-buttons a {
45
+ display: block;
46
+ width: 30px;
47
+ height: 30px;
48
+ text-indent: -9999px;
49
+ background-color: transparent;
50
+ background-image: url('fancybox_buttons.png');
51
+ background-repeat: no-repeat;
52
+ outline: none;
53
+ opacity: 0.8;
54
+ }
55
+
56
+ #fancybox-buttons a:hover {
57
+ opacity: 1;
58
+ }
59
+
60
+ #fancybox-buttons a.btnPrev {
61
+ background-position: 5px 0;
62
+ }
63
+
64
+ #fancybox-buttons a.btnNext {
65
+ background-position: -33px 0;
66
+ border-right: 1px solid #3e3e3e;
67
+ }
68
+
69
+ #fancybox-buttons a.btnPlay {
70
+ background-position: 0 -30px;
71
+ }
72
+
73
+ #fancybox-buttons a.btnPlayOn {
74
+ background-position: -30px -30px;
75
+ }
76
+
77
+ #fancybox-buttons a.btnToggle {
78
+ background-position: 3px -60px;
79
+ border-left: 1px solid #111;
80
+ border-right: 1px solid #3e3e3e;
81
+ width: 35px
82
+ }
83
+
84
+ #fancybox-buttons a.btnToggleOn {
85
+ background-position: -27px -60px;
86
+ }
87
+
88
+ #fancybox-buttons a.btnClose {
89
+ border-left: 1px solid #111;
90
+ width: 35px;
91
+ background-position: -56px 0px;
92
+ }
93
+
94
+ #fancybox-buttons a.btnDisabled {
95
+ opacity : 0.4;
96
+ cursor: default;
97
+ }
includes/lib/fancybox/helpers/jquery.fancybox-buttons.js ADDED
@@ -0,0 +1,122 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * Buttons helper for fancyBox
3
+ * version: 1.0.5 (Mon, 15 Oct 2012)
4
+ * @requires fancyBox v2.0 or later
5
+ *
6
+ * Usage:
7
+ * $(".fancybox").fancybox({
8
+ * helpers : {
9
+ * buttons: {
10
+ * position : 'top'
11
+ * }
12
+ * }
13
+ * });
14
+ *
15
+ */
16
+ (function ($) {
17
+ //Shortcut for fancyBox object
18
+ var F = $.fancybox;
19
+
20
+ //Add helper object
21
+ F.helpers.buttons = {
22
+ defaults : {
23
+ skipSingle : false, // disables if gallery contains single image
24
+ position : 'top', // 'top' or 'bottom'
25
+ tpl : '<div id="fancybox-buttons"><ul><li><a class="btnPrev" title="Previous" href="javascript:;"></a></li><li><a class="btnPlay" title="Start slideshow" href="javascript:;"></a></li><li><a class="btnNext" title="Next" href="javascript:;"></a></li><li><a class="btnToggle" title="Toggle size" href="javascript:;"></a></li><li><a class="btnClose" title="Close" href="javascript:;"></a></li></ul></div>'
26
+ },
27
+
28
+ list : null,
29
+ buttons: null,
30
+
31
+ beforeLoad: function (opts, obj) {
32
+ //Remove self if gallery do not have at least two items
33
+
34
+ if (opts.skipSingle && obj.group.length < 2) {
35
+ obj.helpers.buttons = false;
36
+ obj.closeBtn = true;
37
+
38
+ return;
39
+ }
40
+
41
+ //Increase top margin to give space for buttons
42
+ obj.margin[ opts.position === 'bottom' ? 2 : 0 ] += 30;
43
+ },
44
+
45
+ onPlayStart: function () {
46
+ if (this.buttons) {
47
+ this.buttons.play.attr('title', 'Pause slideshow').addClass('btnPlayOn');
48
+ }
49
+ },
50
+
51
+ onPlayEnd: function () {
52
+ if (this.buttons) {
53
+ this.buttons.play.attr('title', 'Start slideshow').removeClass('btnPlayOn');
54
+ }
55
+ },
56
+
57
+ afterShow: function (opts, obj) {
58
+ var buttons = this.buttons;
59
+
60
+ if (!buttons) {
61
+ this.list = $(opts.tpl).addClass(opts.position).appendTo('body');
62
+
63
+ buttons = {
64
+ prev : this.list.find('.btnPrev').click( F.prev ),
65
+ next : this.list.find('.btnNext').click( F.next ),
66
+ play : this.list.find('.btnPlay').click( F.play ),
67
+ toggle : this.list.find('.btnToggle').click( F.toggle ),
68
+ close : this.list.find('.btnClose').click( F.close )
69
+ }
70
+ }
71
+
72
+ //Prev
73
+ if (obj.index > 0 || obj.loop) {
74
+ buttons.prev.removeClass('btnDisabled');
75
+ } else {
76
+ buttons.prev.addClass('btnDisabled');
77
+ }
78
+
79
+ //Next / Play
80
+ if (obj.loop || obj.index < obj.group.length - 1) {
81
+ buttons.next.removeClass('btnDisabled');
82
+ buttons.play.removeClass('btnDisabled');
83
+
84
+ } else {
85
+ buttons.next.addClass('btnDisabled');
86
+ buttons.play.addClass('btnDisabled');
87
+ }
88
+
89
+ this.buttons = buttons;
90
+
91
+ this.onUpdate(opts, obj);
92
+ },
93
+
94
+ onUpdate: function (opts, obj) {
95
+ var toggle;
96
+
97
+ if (!this.buttons) {
98
+ return;
99
+ }
100
+
101
+ toggle = this.buttons.toggle.removeClass('btnDisabled btnToggleOn');
102
+
103
+ //Size toggle button
104
+ if (obj.canShrink) {
105
+ toggle.addClass('btnToggleOn');
106
+
107
+ } else if (!obj.canExpand) {
108
+ toggle.addClass('btnDisabled');
109
+ }
110
+ },
111
+
112
+ beforeClose: function () {
113
+ if (this.list) {
114
+ this.list.remove();
115
+ }
116
+
117
+ this.list = null;
118
+ this.buttons = null;
119
+ }
120
+ };
121
+
122
+ }(jQuery));
includes/lib/fancybox/helpers/jquery.fancybox-media.js ADDED
@@ -0,0 +1,199 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * Media helper for fancyBox
3
+ * version: 1.0.6 (Fri, 14 Jun 2013)
4
+ * @requires fancyBox v2.0 or later
5
+ *
6
+ * Usage:
7
+ * $(".fancybox").fancybox({
8
+ * helpers : {
9
+ * media: true
10
+ * }
11
+ * });
12
+ *
13
+ * Set custom URL parameters:
14
+ * $(".fancybox").fancybox({
15
+ * helpers : {
16
+ * media: {
17
+ * youtube : {
18
+ * params : {
19
+ * autoplay : 0
20
+ * }
21
+ * }
22
+ * }
23
+ * }
24
+ * });
25
+ *
26
+ * Or:
27
+ * $(".fancybox").fancybox({,
28
+ * helpers : {
29
+ * media: true
30
+ * },
31
+ * youtube : {
32
+ * autoplay: 0
33
+ * }
34
+ * });
35
+ *
36
+ * Supports:
37
+ *
38
+ * Youtube
39
+ * http://www.youtube.com/watch?v=opj24KnzrWo
40
+ * http://www.youtube.com/embed/opj24KnzrWo
41
+ * http://youtu.be/opj24KnzrWo
42
+ * http://www.youtube-nocookie.com/embed/opj24KnzrWo
43
+ * Vimeo
44
+ * http://vimeo.com/40648169
45
+ * http://vimeo.com/channels/staffpicks/38843628
46
+ * http://vimeo.com/groups/surrealism/videos/36516384
47
+ * http://player.vimeo.com/video/45074303
48
+ * Metacafe
49
+ * http://www.metacafe.com/watch/7635964/dr_seuss_the_lorax_movie_trailer/
50
+ * http://www.metacafe.com/watch/7635964/
51
+ * Dailymotion
52
+ * http://www.dailymotion.com/video/xoytqh_dr-seuss-the-lorax-premiere_people
53
+ * Twitvid
54
+ * http://twitvid.com/QY7MD
55
+ * Twitpic
56
+ * http://twitpic.com/7p93st
57
+ * Instagram
58
+ * http://instagr.am/p/IejkuUGxQn/
59
+ * http://instagram.com/p/IejkuUGxQn/
60
+ * Google maps
61
+ * http://maps.google.com/maps?q=Eiffel+Tower,+Avenue+Gustave+Eiffel,+Paris,+France&t=h&z=17
62
+ * http://maps.google.com/?ll=48.857995,2.294297&spn=0.007666,0.021136&t=m&z=16
63
+ * http://maps.google.com/?ll=48.859463,2.292626&spn=0.000965,0.002642&t=m&z=19&layer=c&cbll=48.859524,2.292532&panoid=YJ0lq28OOy3VT2IqIuVY0g&cbp=12,151.58,,0,-15.56
64
+ */
65
+ (function ($) {
66
+ "use strict";
67
+
68
+ //Shortcut for fancyBox object
69
+ var F = $.fancybox,
70
+ format = function( url, rez, params ) {
71
+ params = params || '';
72
+
73
+ if ( $.type( params ) === "object" ) {
74
+ params = $.param(params, true);
75
+ }
76
+
77
+ $.each(rez, function(key, value) {
78
+ url = url.replace( '$' + key, value || '' );
79
+ });
80
+
81
+ if (params.length) {
82
+ url += ( url.indexOf('?') > 0 ? '&' : '?' ) + params;
83
+ }
84
+
85
+ return url;
86
+ };
87
+
88
+ //Add helper object
89
+ F.helpers.media = {
90
+ defaults : {
91
+ youtube : {
92
+ matcher : /(youtube\.com|youtu\.be|youtube-nocookie\.com)\/(watch\?v=|v\/|u\/|embed\/?)?(videoseries\?list=(.*)|[\w-]{11}|\?listType=(.*)&list=(.*)).*/i,
93
+ params : {
94
+ autoplay : 1,
95
+ autohide : 1,
96
+ fs : 1,
97
+ rel : 0,
98
+ hd : 1,
99
+ wmode : 'opaque',
100
+ enablejsapi : 1
101
+ },
102
+ type : 'iframe',
103
+ url : '//www.youtube.com/embed/$3'
104
+ },
105
+ vimeo : {
106
+ matcher : /(?:vimeo(?:pro)?.com)\/(?:[^\d]+)?(\d+)(?:.*)/,
107
+ params : {
108
+ autoplay : 1,
109
+ hd : 1,
110
+ show_title : 1,
111
+ show_byline : 1,
112
+ show_portrait : 0,
113
+ fullscreen : 1
114
+ },
115
+ type : 'iframe',
116
+ url : '//player.vimeo.com/video/$1'
117
+ },
118
+ metacafe : {
119
+ matcher : /metacafe.com\/(?:watch|fplayer)\/([\w\-]{1,10})/,
120
+ params : {
121
+ autoPlay : 'yes'
122
+ },
123
+ type : 'swf',
124
+ url : function( rez, params, obj ) {
125
+ obj.swf.flashVars = 'playerVars=' + $.param( params, true );
126
+
127
+ return '//www.metacafe.com/fplayer/' + rez[1] + '/.swf';
128
+ }
129
+ },
130
+ dailymotion : {
131
+ matcher : /dailymotion.com\/video\/(.*)\/?(.*)/,
132
+ params : {
133
+ additionalInfos : 0,
134
+ autoStart : 1
135
+ },
136
+ type : 'swf',
137
+ url : '//www.dailymotion.com/swf/video/$1'
138
+ },
139
+ twitvid : {
140
+ matcher : /twitvid\.com\/([a-zA-Z0-9_\-\?\=]+)/i,
141
+ params : {
142
+ autoplay : 0
143
+ },
144
+ type : 'iframe',
145
+ url : '//www.twitvid.com/embed.php?guid=$1'
146
+ },
147
+ twitpic : {
148
+ matcher : /twitpic\.com\/(?!(?:place|photos|events)\/)([a-zA-Z0-9\?\=\-]+)/i,
149
+ type : 'image',
150
+ url : '//twitpic.com/show/full/$1/'
151
+ },
152
+ instagram : {
153
+ matcher : /(instagr\.am|instagram\.com)\/p\/([a-zA-Z0-9_\-]+)\/?/i,
154
+ type : 'image',
155
+ url : '//$1/p/$2/media/?size=l'
156
+ },
157
+ google_maps : {
158
+ matcher : /maps\.google\.([a-z]{2,3}(\.[a-z]{2})?)\/(\?ll=|maps\?)(.*)/i,
159
+ type : 'iframe',
160
+ url : function( rez ) {
161
+ return '//maps.google.' + rez[1] + '/' + rez[3] + '' + rez[4] + '&output=' + (rez[4].indexOf('layer=c') > 0 ? 'svembed' : 'embed');
162
+ }
163
+ }
164
+ },
165
+
166
+ beforeLoad : function(opts, obj) {
167
+ var url = obj.href || '',
168
+ type = false,
169
+ what,
170
+ item,
171
+ rez,
172
+ params;
173
+
174
+ for (what in opts) {
175
+ if (opts.hasOwnProperty(what)) {
176
+ item = opts[ what ];
177
+ rez = url.match( item.matcher );
178
+
179
+ if (rez) {
180
+ type = item.type;
181
+ params = $.extend(true, {}, item.params, obj[ what ] || ($.isPlainObject(opts[ what ]) ? opts[ what ].params : null));
182
+
183
+ url = $.type( item.url ) === "function" ? item.url.call( this, rez, params, obj ) : format( item.url, rez, params );
184
+
185
+ break;
186
+ }
187
+ }
188
+ }
189
+
190
+ if (type) {
191
+ obj.href = url;
192
+ obj.type = type;
193
+
194
+ obj.autoHeight = false;
195
+ }
196
+ }
197
+ };
198
+
199
+ }(jQuery));
includes/lib/fancybox/helpers/jquery.fancybox-thumbs.css ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #fancybox-thumbs {
2
+ position: fixed;
3
+ left: 0;
4
+ width: 100%;
5
+ overflow: hidden;
6
+ z-index: 8050;
7
+ }
8
+
9
+ #fancybox-thumbs.bottom {
10
+ bottom: 2px;
11
+ }
12
+
13
+ #fancybox-thumbs.top {
14
+ top: 2px;
15
+ }
16
+
17
+ #fancybox-thumbs ul {
18
+ position: relative;
19
+ list-style: none;
20
+ margin: 0;
21
+ padding: 0;
22
+ }
23
+
24
+ #fancybox-thumbs ul li {
25
+ float: left;
26
+ padding: 1px;
27
+ opacity: 0.5;
28
+ }
29
+
30
+ #fancybox-thumbs ul li.active {
31
+ opacity: 0.75;
32
+ padding: 0;
33
+ border: 1px solid #fff;
34
+ }
35
+
36
+ #fancybox-thumbs ul li:hover {
37
+ opacity: 1;
38
+ }
39
+
40
+ #fancybox-thumbs ul li a {
41
+ display: block;
42
+ position: relative;
43
+ overflow: hidden;
44
+ border: 1px solid #222;
45
+ background: #111;
46
+ outline: none;
47
+ }
48
+
49
+ #fancybox-thumbs ul li img {
50
+ display: block;
51
+ position: relative;
52
+ border: 0;
53
+ padding: 0;
54
+ max-width: none;
55
+ }
includes/lib/fancybox/helpers/jquery.fancybox-thumbs.js ADDED
@@ -0,0 +1,162 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * Thumbnail helper for fancyBox
3
+ * version: 1.0.7 (Mon, 01 Oct 2012)
4
+ * @requires fancyBox v2.0 or later
5
+ *
6
+ * Usage:
7
+ * $(".fancybox").fancybox({
8
+ * helpers : {
9
+ * thumbs: {
10
+ * width : 50,
11
+ * height : 50
12
+ * }
13
+ * }
14
+ * });
15
+ *
16
+ */
17
+ (function ($) {
18
+ //Shortcut for fancyBox object
19
+ var F = $.fancybox;
20
+
21
+ //Add helper object
22
+ F.helpers.thumbs = {
23
+ defaults : {
24
+ width : 50, // thumbnail width
25
+ height : 50, // thumbnail height
26
+ position : 'bottom', // 'top' or 'bottom'
27
+ source : function ( item ) { // function to obtain the URL of the thumbnail image
28
+ var href;
29
+
30
+ if (item.element) {
31
+ href = $(item.element).find('img').attr('src');
32
+ }
33
+
34
+ if (!href && item.type === 'image' && item.href) {
35
+ href = item.href;
36
+ }
37
+
38
+ return href;
39
+ }
40
+ },
41
+
42
+ wrap : null,
43
+ list : null,
44
+ width : 0,
45
+
46
+ init: function (opts, obj) {
47
+ var that = this,
48
+ list,
49
+ thumbWidth = opts.width,
50
+ thumbHeight = opts.height,
51
+ thumbSource = opts.source;
52
+
53
+ //Build list structure
54
+ list = '';
55
+
56
+ for (var n = 0; n < obj.group.length; n++) {
57
+ list += '<li><a style="width:' + thumbWidth + 'px;height:' + thumbHeight + 'px;" href="javascript:jQuery.fancybox.jumpto(' + n + ');"></a></li>';
58
+ }
59
+
60
+ this.wrap = $('<div id="fancybox-thumbs"></div>').addClass(opts.position).appendTo('body');
61
+ this.list = $('<ul>' + list + '</ul>').appendTo(this.wrap);
62
+
63
+ //Load each thumbnail
64
+ $.each(obj.group, function (i) {
65
+ var href = thumbSource( obj.group[ i ] );
66
+
67
+ if (!href) {
68
+ return;
69
+ }
70
+
71
+ $("<img />").load(function () {
72
+ var width = this.width,
73
+ height = this.height,
74
+ widthRatio, heightRatio, parent;
75
+
76
+ if (!that.list || !width || !height) {
77
+ return;
78
+ }
79
+
80
+ //Calculate thumbnail width/height and center it
81
+ widthRatio = width / thumbWidth;
82
+ heightRatio = height / thumbHeight;
83
+
84
+ parent = that.list.children().eq(i).find('a');
85
+
86
+ if (widthRatio >= 1 && heightRatio >= 1) {
87
+ if (widthRatio > heightRatio) {
88
+ width = Math.floor(width / heightRatio);
89
+ height = thumbHeight;
90
+
91
+ } else {
92
+ width = thumbWidth;
93
+ height = Math.floor(height / widthRatio);
94
+ }
95
+ }
96
+
97
+ $(this).css({
98
+ width : width,
99
+ height : height,
100
+ top : Math.floor(thumbHeight / 2 - height / 2),
101
+ left : Math.floor(thumbWidth / 2 - width / 2)
102
+ });
103
+
104
+ parent.width(thumbWidth).height(thumbHeight);
105
+
106
+ $(this).hide().appendTo(parent).fadeIn(300);
107
+
108
+ }).attr('src', href);
109
+ });
110
+
111
+ //Set initial width
112
+ this.width = this.list.children().eq(0).outerWidth(true);
113
+
114
+ this.list.width(this.width * (obj.group.length + 1)).css('left', Math.floor($(window).width() * 0.5 - (obj.index * this.width + this.width * 0.5)));
115
+ },
116
+
117
+ beforeLoad: function (opts, obj) {
118
+ //Remove self if gallery do not have at least two items
119
+ if (obj.group.length < 2) {
120
+ obj.helpers.thumbs = false;
121
+
122
+ return;
123
+ }
124
+
125
+ //Increase bottom margin to give space for thumbs
126
+ obj.margin[ opts.position === 'top' ? 0 : 2 ] += ((opts.height) + 15);
127
+ },
128
+
129
+ afterShow: function (opts, obj) {
130
+ //Check if exists and create or update list
131
+ if (this.list) {
132
+ this.onUpdate(opts, obj);
133
+
134
+ } else {
135
+ this.init(opts, obj);
136
+ }
137
+
138
+ //Set active element
139
+ this.list.children().removeClass('active').eq(obj.index).addClass('active');
140
+ },
141
+
142
+ //Center list
143
+ onUpdate: function (opts, obj) {
144
+ if (this.list) {
145
+ this.list.stop(true).animate({
146
+ 'left': Math.floor($(window).width() * 0.5 - (obj.index * this.width + this.width * 0.5))
147
+ }, 150);
148
+ }
149
+ },
150
+
151
+ beforeClose: function () {
152
+ if (this.wrap) {
153
+ this.wrap.remove();
154
+ }
155
+
156
+ this.wrap = null;
157
+ this.list = null;
158
+ this.width = 0;
159
+ }
160
+ }
161
+
162
+ }(jQuery));
includes/lib/fancybox/jquery.fancybox.css ADDED
@@ -0,0 +1,274 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*! fancyBox v2.1.5 fancyapps.com | fancyapps.com/fancybox/#license */
2
+ .fancybox-wrap,
3
+ .fancybox-skin,
4
+ .fancybox-outer,
5
+ .fancybox-inner,
6
+ .fancybox-image,
7
+ .fancybox-wrap iframe,
8
+ .fancybox-wrap object,
9
+ .fancybox-nav,
10
+ .fancybox-nav span,
11
+ .fancybox-tmp
12
+ {
13
+ padding: 0;
14
+ margin: 0;
15
+ border: 0;
16
+ outline: none;
17
+ vertical-align: top;
18
+ }
19
+
20
+ .fancybox-wrap {
21
+ position: absolute;
22
+ top: 0;
23
+ left: 0;
24
+ z-index: 8020;
25
+ }
26
+
27
+ .fancybox-skin {
28
+ position: relative;
29
+ background: #f9f9f9;
30
+ color: #444;
31
+ text-shadow: none;
32
+ -webkit-border-radius: 4px;
33
+ -moz-border-radius: 4px;
34
+ border-radius: 4px;
35
+ }
36
+
37
+ .fancybox-opened {
38
+ z-index: 8030;
39
+ }
40
+
41
+ .fancybox-opened .fancybox-skin {
42
+ -webkit-box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
43
+ -moz-box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
44
+ box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
45
+ }
46
+
47
+ .fancybox-outer, .fancybox-inner {
48
+ position: relative;
49
+ }
50
+
51
+ .fancybox-inner {
52
+ overflow: hidden;
53
+ }
54
+
55
+ .fancybox-type-iframe .fancybox-inner {
56
+ -webkit-overflow-scrolling: touch;
57
+ }
58
+
59
+ .fancybox-error {
60
+ color: #444;
61
+ font: 14px/20px "Helvetica Neue",Helvetica,Arial,sans-serif;
62
+ margin: 0;
63
+ padding: 15px;
64
+ white-space: nowrap;
65
+ }
66
+
67
+ .fancybox-image, .fancybox-iframe {
68
+ display: block;
69
+ width: 100%;
70
+ height: 100%;
71
+ }
72
+
73
+ .fancybox-image {
74
+ max-width: 100%;
75
+ max-height: 100%;
76
+ }
77
+
78
+ #fancybox-loading, .fancybox-close, .fancybox-prev span, .fancybox-next span {
79
+ background-image: url('fancybox_sprite.png');
80
+ }
81
+
82
+ #fancybox-loading {
83
+ position: fixed;
84
+ top: 50%;
85
+ left: 50%;
86
+ margin-top: -22px;
87
+ margin-left: -22px;
88
+ background-position: 0 -108px;
89
+ opacity: 0.8;
90
+ cursor: pointer;
91
+ z-index: 8060;
92
+ }
93
+
94
+ #fancybox-loading div {
95
+ width: 44px;
96
+ height: 44px;
97
+ background: url('fancybox_loading.gif') center center no-repeat;
98
+ }
99
+
100
+ .fancybox-close {
101
+ position: absolute;
102
+ top: -18px;
103
+ right: -18px;
104
+ width: 36px;
105
+ height: 36px;
106
+ cursor: pointer;
107
+ z-index: 8040;
108
+ }
109
+
110
+ .fancybox-nav {
111
+ position: absolute;
112
+ top: 0;
113
+ width: 40%;
114
+ height: 100%;
115
+ cursor: pointer;
116
+ text-decoration: none;
117
+ background: transparent url('blank.gif'); /* helps IE */
118
+ -webkit-tap-highlight-color: rgba(0,0,0,0);
119
+ z-index: 8040;
120
+ }
121
+
122
+ .fancybox-prev {
123
+ left: 0;
124
+ }
125
+
126
+ .fancybox-next {
127
+ right: 0;
128
+ }
129
+
130
+ .fancybox-nav span {
131
+ position: absolute;
132
+ top: 50%;
133
+ width: 36px;
134
+ height: 34px;
135
+ margin-top: -18px;
136
+ cursor: pointer;
137
+ z-index: 8040;
138
+ visibility: hidden;
139
+ }
140
+
141
+ .fancybox-prev span {
142
+ left: 10px;
143
+ background-position: 0 -36px;
144
+ }
145
+
146
+ .fancybox-next span {
147
+ right: 10px;
148
+ background-position: 0 -72px;
149
+ }
150
+
151
+ .fancybox-nav:hover span {
152
+ visibility: visible;
153
+ }
154
+
155
+ .fancybox-tmp {
156
+ position: absolute;
157
+ top: -99999px;
158
+ left: -99999px;
159
+ visibility: hidden;
160
+ max-width: 99999px;
161
+ max-height: 99999px;
162
+ overflow: visible !important;
163
+ }
164
+
165
+ /* Overlay helper */
166
+
167
+ .fancybox-lock {
168
+ overflow: hidden !important;
169
+ width: auto;
170
+ }
171
+
172
+ .fancybox-lock body {
173
+ overflow: hidden !important;
174
+ }
175
+
176
+ .fancybox-lock-test {
177
+ overflow-y: hidden !important;
178
+ }
179
+
180
+ .fancybox-overlay {
181
+ position: absolute;
182
+ top: 0;
183
+ left: 0;
184
+ overflow: hidden;
185
+ display: none;
186
+ z-index: 8010;
187
+ background: url('fancybox_overlay.png');
188
+ }
189
+
190
+ .fancybox-overlay-fixed {
191
+ position: fixed;
192
+ bottom: 0;
193
+ right: 0;
194
+ }
195
+
196
+ .fancybox-lock .fancybox-overlay {
197
+ overflow: auto;
198
+ overflow-y: scroll;
199
+ }
200
+
201
+ /* Title helper */
202
+
203
+ .fancybox-title {
204
+ visibility: hidden;
205
+ font: normal 13px/20px "Helvetica Neue",Helvetica,Arial,sans-serif;
206
+ position: relative;
207
+ text-shadow: none;
208
+ z-index: 8050;
209
+ }
210
+
211
+ .fancybox-opened .fancybox-title {
212
+ visibility: visible;
213
+ }
214
+
215
+ .fancybox-title-float-wrap {
216
+ position: absolute;
217
+ bottom: 0;
218
+ right: 50%;
219
+ margin-bottom: -35px;
220
+ z-index: 8050;
221
+ text-align: center;
222
+ }
223
+
224
+ .fancybox-title-float-wrap .child {
225
+ display: inline-block;
226
+ margin-right: -100%;
227
+ padding: 2px 20px;
228
+ background: transparent; /* Fallback for web browsers that doesn't support RGBa */
229
+ background: rgba(0, 0, 0, 0.8);
230
+ -webkit-border-radius: 15px;
231
+ -moz-border-radius: 15px;
232
+ border-radius: 15px;
233
+ text-shadow: 0 1px 2px #222;
234
+ color: #FFF;
235
+ font-weight: bold;
236
+ line-height: 24px;
237
+ white-space: nowrap;
238
+ }
239
+
240
+ .fancybox-title-outside-wrap {
241
+ position: relative;
242
+ margin-top: 10px;
243
+ color: #fff;
244
+ }
245
+
246
+ .fancybox-title-inside-wrap {
247
+ padding-top: 10px;
248
+ }
249
+
250
+ .fancybox-title-over-wrap {
251
+ position: absolute;
252
+ bottom: 0;
253
+ left: 0;
254
+ color: #fff;
255
+ padding: 10px;
256
+ background: #000;
257
+ background: rgba(0, 0, 0, .8);
258
+ }
259
+
260
+ /*Retina graphics!*/
261
+ @media only screen and (-webkit-min-device-pixel-ratio: 1.5),
262
+ only screen and (min--moz-device-pixel-ratio: 1.5),
263
+ only screen and (min-device-pixel-ratio: 1.5){
264
+
265
+ #fancybox-loading, .fancybox-close, .fancybox-prev span, .fancybox-next span {
266
+ background-image: url('fancybox_sprite@2x.png');
267
+ background-size: 44px 152px; /*The size of the normal image, half the size of the hi-res image*/
268
+ }
269
+
270
+ #fancybox-loading div {
271
+ background-image: url('fancybox_loading@2x.gif');
272
+ background-size: 24px 24px; /*The size of the normal image, half the size of the hi-res image*/
273
+ }
274
+ }
includes/lib/fancybox/jquery.fancybox.js ADDED
@@ -0,0 +1,2020 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * fancyBox - jQuery Plugin
3
+ * version: 2.1.5 (Fri, 14 Jun 2013)
4
+ * @requires jQuery v1.6 or later
5
+ *
6
+ * Examples at http://fancyapps.com/fancybox/
7
+ * License: www.fancyapps.com/fancybox/#license
8
+ *
9
+ * Copyright 2012 Janis Skarnelis - janis@fancyapps.com
10
+ *
11
+ */
12
+
13
+ (function (window, document, $, undefined) {
14
+ "use strict";
15
+
16
+ var H = $("html"),
17
+ W = $(window),
18
+ D = $(document),
19
+ F = $.fancybox = function () {
20
+ F.open.apply( this, arguments );
21
+ },
22
+ IE = navigator.userAgent.match(/msie/i),
23
+ didUpdate = null,
24
+ isTouch = document.createTouch !== undefined,
25
+
26
+ isQuery = function(obj) {
27
+ return obj && obj.hasOwnProperty && obj instanceof $;
28
+ },
29
+ isString = function(str) {
30
+ return str && $.type(str) === "string";
31
+ },
32
+ isPercentage = function(str) {
33
+ return isString(str) && str.indexOf('%') > 0;
34
+ },
35
+ isScrollable = function(el) {
36
+ return (el && !(el.style.overflow && el.style.overflow === 'hidden') && ((el.clientWidth && el.scrollWidth > el.clientWidth) || (el.clientHeight && el.scrollHeight > el.clientHeight)));
37
+ },
38
+ getScalar = function(orig, dim) {
39
+ var value = parseInt(orig, 10) || 0;
40
+
41
+ if (dim && isPercentage(orig)) {
42
+ value = F.getViewport()[ dim ] / 100 * value;
43
+ }
44
+
45
+ return Math.ceil(value);
46
+ },
47
+ getValue = function(value, dim) {
48
+ return getScalar(value, dim) + 'px';
49
+ };
50
+
51
+ $.extend(F, {
52
+ // The current version of fancyBox
53
+ version: '2.1.5',
54
+
55
+ defaults: {
56
+ padding : 15,
57
+ margin : 20,
58
+
59
+ width : 800,
60
+ height : 600,
61
+ minWidth : 100,
62
+ minHeight : 100,
63
+ maxWidth : 9999,
64
+ maxHeight : 9999,
65
+ pixelRatio: 1, // Set to 2 for retina display support
66
+
67
+ autoSize : true,
68
+ autoHeight : false,
69
+ autoWidth : false,
70
+
71
+ autoResize : true,
72
+ autoCenter : !isTouch,
73
+ fitToView : true,
74
+ aspectRatio : false,
75
+ topRatio : 0.5,
76
+ leftRatio : 0.5,
77
+
78
+ scrolling : 'auto', // 'auto', 'yes' or 'no'
79
+ wrapCSS : '',
80
+
81
+ arrows : true,
82
+ closeBtn : true,
83
+ closeClick : false,
84
+ nextClick : false,
85
+ mouseWheel : true,
86
+ autoPlay : false,
87
+ playSpeed : 3000,
88
+ preload : 3,
89
+ modal : false,
90
+ loop : true,
91
+
92
+ ajax : {
93
+ dataType : 'html',
94
+ headers : { 'X-fancyBox': true }
95
+ },
96
+ iframe : {
97
+ scrolling : 'auto',
98
+ preload : true
99
+ },
100
+ swf : {
101
+ wmode: 'transparent',
102
+ allowfullscreen : 'true',
103
+ allowscriptaccess : 'always'
104
+ },
105
+
106
+ keys : {
107
+ next : {
108
+ 13 : 'left', // enter
109
+ 34 : 'up', // page down
110
+ 39 : 'left', // right arrow
111
+ 40 : 'up' // down arrow
112
+ },
113
+ prev : {
114
+ 8 : 'right', // backspace
115
+ 33 : 'down', // page up
116
+ 37 : 'right', // left arrow
117
+ 38 : 'down' // up arrow
118
+ },
119
+ close : [27], // escape key
120
+ play : [32], // space - start/stop slideshow
121
+ toggle : [70] // letter "f" - toggle fullscreen
122
+ },
123
+
124
+ direction : {
125
+ next : 'left',
126
+ prev : 'right'
127
+ },
128
+
129
+ scrollOutside : true,
130
+
131
+ // Override some properties
132
+ index : 0,
133
+ type : null,
134
+ href : null,
135
+ content : null,
136
+ title : null,
137
+
138
+ // HTML templates
139
+ tpl: {
140
+ wrap : '<div class="fancybox-wrap" tabIndex="-1"><div class="fancybox-skin"><div class="fancybox-outer"><div class="fancybox-inner"></div></div></div></div>',
141
+ image : '<img class="fancybox-image" src="{href}" alt="" />',
142
+ iframe : '<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" frameborder="0" vspace="0" hspace="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen' + (IE ? ' allowtransparency="true"' : '') + '></iframe>',
143
+ error : '<p class="fancybox-error">The requested content cannot be loaded.<br/>Please try again later.</p>',
144
+ closeBtn : '<a title="Close" class="fancybox-item fancybox-close" href="javascript:;"></a>',
145
+ next : '<a title="Next" class="fancybox-nav fancybox-next" href="javascript:;"><span></span></a>',
146
+ prev : '<a title="Previous" class="fancybox-nav fancybox-prev" href="javascript:;"><span></span></a>'
147
+ },
148
+
149
+ // Properties for each animation type
150
+ // Opening fancyBox
151
+ openEffect : 'fade', // 'elastic', 'fade' or 'none'
152
+ openSpeed : 250,
153
+ openEasing : 'swing',
154
+ openOpacity : true,
155
+ openMethod : 'zoomIn',
156
+
157
+ // Closing fancyBox
158
+ closeEffect : 'fade', // 'elastic', 'fade' or 'none'
159
+ closeSpeed : 250,
160
+ closeEasing : 'swing',
161
+ closeOpacity : true,
162
+ closeMethod : 'zoomOut',
163
+
164
+ // Changing next gallery item
165
+ nextEffect : 'elastic', // 'elastic', 'fade' or 'none'
166
+ nextSpeed : 250,
167
+ nextEasing : 'swing',
168
+ nextMethod : 'changeIn',
169
+
170
+ // Changing previous gallery item
171
+ prevEffect : 'elastic', // 'elastic', 'fade' or 'none'
172
+ prevSpeed : 250,
173
+ prevEasing : 'swing',
174
+ prevMethod : 'changeOut',
175
+
176
+ // Enable default helpers
177
+ helpers : {
178
+ overlay : true,
179
+ title : true
180
+ },
181
+
182
+ // Callbacks
183
+ onCancel : $.noop, // If canceling
184
+ beforeLoad : $.noop, // Before loading
185
+ afterLoad : $.noop, // After loading
186
+ beforeShow : $.noop, // Before changing in current item
187
+ afterShow : $.noop, // After opening
188
+ beforeChange : $.noop, // Before changing gallery item
189
+ beforeClose : $.noop, // Before closing
190
+ afterClose : $.noop // After closing
191
+ },
192
+
193
+ //Current state
194
+ group : {}, // Selected group
195
+ opts : {}, // Group options
196
+ previous : null, // Previous element
197
+ coming : null, // Element being loaded
198
+ current : null, // Currently loaded element
199
+ isActive : false, // Is activated
200
+ isOpen : false, // Is currently open
201
+ isOpened : false, // Have been fully opened at least once
202
+
203
+ wrap : null,
204
+ skin : null,
205
+ outer : null,
206
+ inner : null,
207
+
208
+ player : {
209
+ timer : null,
210
+ isActive : false
211
+ },
212
+
213
+ // Loaders
214
+ ajaxLoad : null,
215
+ imgPreload : null,
216
+
217
+ // Some collections
218
+ transitions : {},
219
+ helpers : {},
220
+
221
+ /*
222
+ * Static methods
223
+ */
224
+
225
+ open: function (group, opts) {
226
+ if (!group) {
227
+ return;
228
+ }
229
+
230
+ if (!$.isPlainObject(opts)) {
231
+ opts = {};
232
+ }
233
+
234
+ // Close if already active
235
+ if (false === F.close(true)) {
236
+ return;
237
+ }
238
+
239
+ // Normalize group
240
+ if (!$.isArray(group)) {
241
+ group = isQuery(group) ? $(group).get() : [group];
242
+ }
243
+
244
+ // Recheck if the type of each element is `object` and set content type (image, ajax, etc)
245
+ $.each(group, function(i, element) {
246
+ var obj = {},
247
+ href,
248
+ title,
249
+ content,
250
+ type,
251
+ rez,
252
+ hrefParts,
253
+ selector;
254
+
255
+ if ($.type(element) === "object") {
256
+ // Check if is DOM element
257
+ if (element.nodeType) {
258
+ element = $(element);
259
+ }
260
+
261
+ if (isQuery(element)) {
262
+ obj = {
263
+ href : element.data('fancybox-href') || element.attr('href'),
264
+ title : element.data('fancybox-title') || element.attr('title'),
265
+ isDom : true,
266
+ element : element
267
+ };
268
+
269
+ if ($.metadata) {
270
+ $.extend(true, obj, element.metadata());
271
+ }
272
+
273
+ } else {
274
+ obj = element;
275
+ }
276
+ }
277
+
278
+ href = opts.href || obj.href || (isString(element) ? element : null);
279
+ title = opts.title !== undefined ? opts.title : obj.title || '';
280
+
281
+ content = opts.content || obj.content;
282
+ type = content ? 'html' : (opts.type || obj.type);
283
+
284
+ if (!type && obj.isDom) {
285
+ type = element.data('fancybox-type');
286
+
287
+ if (!type) {
288
+ rez = element.prop('class').match(/fancybox\.(\w+)/);
289
+ type = rez ? rez[1] : null;
290
+ }
291
+ }
292
+
293
+ if (isString(href)) {
294
+ // Try to guess the content type
295
+ if (!type) {
296
+ if (F.isImage(href)) {
297
+ type = 'image';
298
+
299
+ } else if (F.isSWF(href)) {
300
+ type = 'swf';
301
+
302
+ } else if (href.charAt(0) === '#') {
303
+ type = 'inline';
304
+
305
+ } else if (isString(element)) {
306
+ type = 'html';
307
+ content = element;
308
+ }
309
+ }
310
+
311
+ // Split url into two pieces with source url and content selector, e.g,
312
+ // "/mypage.html #my_id" will load "/mypage.html" and display element having id "my_id"
313
+ if (type === 'ajax') {
314
+ hrefParts = href.split(/\s+/, 2);
315
+ href = hrefParts.shift();
316
+ selector = hrefParts.shift();
317
+ }
318
+ }
319
+
320
+ if (!content) {
321
+ if (type === 'inline') {
322
+ if (href) {
323
+ content = $( isString(href) ? href.replace(/.*(?=#[^\s]+$)/, '') : href ); //strip for ie7
324
+
325
+ } else if (obj.isDom) {
326
+ content = element;
327
+ }
328
+
329
+ } else if (type === 'html') {
330
+ content = href;
331
+
332
+ } else if (!type && !href && obj.isDom) {
333
+ type = 'inline';
334
+ content = element;
335
+ }
336
+ }
337
+
338
+ $.extend(obj, {
339
+ href : href,
340
+ type : type,
341
+ content : content,
342
+ title : title,
343
+ selector : selector
344
+ });
345
+
346
+ group[ i ] = obj;
347
+ });
348
+
349
+ // Extend the defaults
350
+ F.opts = $.extend(true, {}, F.defaults, opts);
351
+
352
+ // All options are merged recursive except keys
353
+ if (opts.keys !== undefined) {
354
+ F.opts.keys = opts.keys ? $.extend({}, F.defaults.keys, opts.keys) : false;
355
+ }
356
+
357
+ F.group = group;
358
+
359
+ return F._start(F.opts.index);
360
+ },
361
+
362
+ // Cancel image loading or abort ajax request
363
+ cancel: function () {
364
+ var coming = F.coming;
365
+
366
+ if (!coming || false === F.trigger('onCancel')) {
367
+ return;
368
+ }
369
+
370
+ F.hideLoading();
371
+
372
+ if (F.ajaxLoad) {
373
+ F.ajaxLoad.abort();
374
+ }
375
+
376
+ F.ajaxLoad = null;
377
+
378
+ if (F.imgPreload) {
379
+ F.imgPreload.onload = F.imgPreload.onerror = null;
380
+ }
381
+
382
+ if (coming.wrap) {
383
+ coming.wrap.stop(true, true).trigger('onReset').remove();
384
+ }
385
+
386
+ F.coming = null;
387
+
388
+ // If the first item has been canceled, then clear everything
389
+ if (!F.current) {
390
+ F._afterZoomOut( coming );
391
+ }
392
+ },
393
+
394
+ // Start closing animation if is open; remove immediately if opening/closing
395
+ close: function (event) {
396
+ F.cancel();
397
+
398
+ if (false === F.trigger('beforeClose')) {
399
+ return;
400
+ }
401
+
402
+ F.unbindEvents();
403
+
404
+ if (!F.isActive) {
405
+ return;
406
+ }
407
+
408
+ if (!F.isOpen || event === true) {
409
+ $('.fancybox-wrap').stop(true).trigger('onReset').remove();
410
+
411
+ F._afterZoomOut();
412
+
413
+ } else {
414
+ F.isOpen = F.isOpened = false;
415
+ F.isClosing = true;
416
+
417
+ $('.fancybox-item, .fancybox-nav').remove();
418
+
419
+ F.wrap.stop(true, true).removeClass('fancybox-opened');
420
+
421
+ F.transitions[ F.current.closeMethod ]();
422
+ }
423
+ },
424
+
425
+ // Manage slideshow:
426
+ // $.fancybox.play(); - toggle slideshow
427
+ // $.fancybox.play( true ); - start
428
+ // $.fancybox.play( false ); - stop
429
+ play: function ( action ) {
430
+ var clear = function () {
431
+ clearTimeout(F.player.timer);
432
+ },
433
+ set = function () {
434
+ clear();
435
+
436
+ if (F.current && F.player.isActive) {
437
+ F.player.timer = setTimeout(F.next, F.current.playSpeed);
438
+ }
439
+ },
440
+ stop = function () {
441
+ clear();
442
+
443
+ D.unbind('.player');
444
+
445
+ F.player.isActive = false;
446
+
447
+ F.trigger('onPlayEnd');
448
+ },
449
+ start = function () {
450
+ if (F.current && (F.current.loop || F.current.index < F.group.length - 1)) {
451
+ F.player.isActive = true;
452
+
453
+ D.bind({
454
+ 'onCancel.player beforeClose.player' : stop,
455
+ 'onUpdate.player' : set,
456
+ 'beforeLoad.player' : clear
457
+ });
458
+
459
+ set();
460
+
461
+ F.trigger('onPlayStart');
462
+ }
463
+ };
464
+
465
+ if (action === true || (!F.player.isActive && action !== false)) {
466
+ start();
467
+ } else {
468
+ stop();
469
+ }
470
+ },
471
+
472
+ // Navigate to next gallery item
473
+ next: function ( direction ) {
474
+ var current = F.current;
475
+
476
+ if (current) {
477
+ if (!isString(direction)) {
478
+ direction = current.direction.next;
479
+ }
480
+
481
+ F.jumpto(current.index + 1, direction, 'next');
482
+ }
483
+ },
484
+
485
+ // Navigate to previous gallery item
486
+ prev: function ( direction ) {
487
+ var current = F.current;
488
+
489
+ if (current) {
490
+ if (!isString(direction)) {
491
+ direction = current.direction.prev;
492
+ }
493
+
494
+ F.jumpto(current.index - 1, direction, 'prev');
495
+ }
496
+ },
497
+
498
+ // Navigate to gallery item by index
499
+ jumpto: function ( index, direction, router ) {
500
+ var current = F.current;
501
+
502
+ if (!current) {
503
+ return;
504
+ }
505
+
506
+ index = getScalar(index);
507
+
508
+ F.direction = direction || current.direction[ (index >= current.index ? 'next' : 'prev') ];
509
+ F.router = router || 'jumpto';
510
+
511
+ if (current.loop) {
512
+ if (index < 0) {
513
+ index = current.group.length + (index % current.group.length);
514
+ }
515
+
516
+ index = index % current.group.length;
517
+ }
518
+
519
+ if (current.group[ index ] !== undefined) {
520
+ F.cancel();
521
+
522
+ F._start(index);
523
+ }
524
+ },
525
+
526
+ // Center inside viewport and toggle position type to fixed or absolute if needed
527
+ reposition: function (e, onlyAbsolute) {
528
+ var current = F.current,
529
+ wrap = current ? current.wrap : null,
530
+ pos;
531
+
532
+ if (wrap) {
533
+ pos = F._getPosition(onlyAbsolute);
534
+
535
+ if (e && e.type === 'scroll') {
536
+ delete pos.position;
537
+
538
+ wrap.stop(true, true).animate(pos, 200);
539
+
540
+ } else {
541
+ wrap.css(pos);
542
+
543
+ current.pos = $.extend({}, current.dim, pos);
544
+ }
545
+ }
546
+ },
547
+
548
+ update: function (e) {
549
+ var type = (e && e.type),
550
+ anyway = !type || type === 'orientationchange';
551
+
552
+ if (anyway) {
553
+ clearTimeout(didUpdate);
554
+
555
+ didUpdate = null;
556
+ }
557
+
558
+ if (!F.isOpen || didUpdate) {
559
+ return;
560
+ }
561
+
562
+ didUpdate = setTimeout(function() {
563
+ var current = F.current;
564
+
565
+ if (!current || F.isClosing) {
566
+ return;
567
+ }
568
+
569
+ F.wrap.removeClass('fancybox-tmp');
570
+
571
+ if (anyway || type === 'load' || (type === 'resize' && current.autoResize)) {
572
+ F._setDimension();
573
+ }
574
+
575
+ if (!(type === 'scroll' && current.canShrink)) {
576
+ F.reposition(e);
577
+ }
578
+
579
+ F.trigger('onUpdate');
580
+
581
+ didUpdate = null;
582
+
583
+ }, (anyway && !isTouch ? 0 : 300));
584
+ },
585
+
586
+ // Shrink content to fit inside viewport or restore if resized
587
+ toggle: function ( action ) {
588
+ if (F.isOpen) {
589
+ F.current.fitToView = $.type(action) === "boolean" ? action : !F.current.fitToView;
590
+
591
+ // Help browser to restore document dimensions
592
+ if (isTouch) {
593
+ F.wrap.removeAttr('style').addClass('fancybox-tmp');
594
+
595
+ F.trigger('onUpdate');
596
+ }
597
+
598
+ F.update();
599
+ }
600
+ },
601
+
602
+ hideLoading: function () {
603
+ D.unbind('.loading');
604
+
605
+ $('#fancybox-loading').remove();
606
+ },
607
+
608
+ showLoading: function () {
609
+ var el, viewport;
610
+
611
+ F.hideLoading();
612
+
613
+ el = $('<div id="fancybox-loading"><div></div></div>').click(F.cancel).appendTo('body');
614
+
615
+ // If user will press the escape-button, the request will be canceled
616
+ D.bind('keydown.loading', function(e) {
617
+ if ((e.which || e.keyCode) === 27) {
618
+ e.preventDefault();
619
+
620
+ F.cancel();
621
+ }
622
+ });
623
+
624
+ if (!F.defaults.fixed) {
625
+ viewport = F.getViewport();
626
+
627
+ el.css({
628
+ position : 'absolute',
629
+ top : (viewport.h * 0.5) + viewport.y,
630
+ left : (viewport.w * 0.5) + viewport.x
631
+ });
632
+ }
633
+ },
634
+
635
+ getViewport: function () {
636
+ var locked = (F.current && F.current.locked) || false,
637
+ rez = {
638
+ x: W.scrollLeft(),
639
+ y: W.scrollTop()
640
+ };
641
+
642
+ if (locked) {
643
+ rez.w = locked[0].clientWidth;
644
+ rez.h = locked[0].clientHeight;
645
+
646
+ } else {
647
+ // See http://bugs.jquery.com/ticket/6724
648
+ rez.w = isTouch && window.innerWidth ? window.innerWidth : W.width();
649
+ rez.h = isTouch && window.innerHeight ? window.innerHeight : W.height();
650
+ }
651
+
652
+ return rez;
653
+ },
654
+
655
+ // Unbind the keyboard / clicking actions
656
+ unbindEvents: function () {
657
+ if (F.wrap && isQuery(F.wrap)) {
658
+ F.wrap.unbind('.fb');
659
+ }
660
+
661
+ D.unbind('.fb');
662
+ W.unbind('.fb');
663
+ },
664
+
665
+ bindEvents: function () {
666
+ var current = F.current,
667
+ keys;
668
+
669
+ if (!current) {
670
+ return;
671
+ }
672
+
673
+ // Changing document height on iOS devices triggers a 'resize' event,
674
+ // that can change document height... repeating infinitely
675
+ W.bind('orientationchange.fb' + (isTouch ? '' : ' resize.fb') + (current.autoCenter && !current.locked ? ' scroll.fb' : ''), F.update);
676
+
677
+ keys = current.keys;
678
+
679
+ if (keys) {
680
+ D.bind('keydown.fb', function (e) {
681
+ var code = e.which || e.keyCode,
682
+ target = e.target || e.srcElement;
683
+
684
+ // Skip esc key if loading, because showLoading will cancel preloading
685
+ if (code === 27 && F.coming) {
686
+ return false;
687
+ }
688
+
689
+ // Ignore key combinations and key events within form elements
690
+ if (!e.ctrlKey && !e.altKey && !e.shiftKey && !e.metaKey && !(target && (target.type || $(target).is('[contenteditable]')))) {
691
+ $.each(keys, function(i, val) {
692
+ if (current.group.length > 1 && val[ code ] !== undefined) {
693
+ F[ i ]( val[ code ] );
694
+
695
+ e.preventDefault();
696
+ return false;
697
+ }
698
+
699
+ if ($.inArray(code, val) > -1) {
700
+ F[ i ] ();
701
+
702
+ e.preventDefault();
703
+ return false;
704
+ }
705
+ });
706
+ }
707
+ });
708
+ }
709
+
710
+ if ($.fn.mousewheel && current.mouseWheel) {
711
+ F.wrap.bind('mousewheel.fb', function (e, delta, deltaX, deltaY) {
712
+ var target = e.target || null,
713
+ parent = $(target),
714
+ canScroll = false;
715
+
716
+ while (parent.length) {
717
+ if (canScroll || parent.is('.fancybox-skin') || parent.is('.fancybox-wrap')) {
718
+ break;
719
+ }
720
+
721
+ canScroll = isScrollable( parent[0] );
722
+ parent = $(parent).parent();
723
+ }
724
+
725
+ if (delta !== 0 && !canScroll) {
726
+ if (F.group.length > 1 && !current.canShrink) {
727
+ if (deltaY > 0 || deltaX > 0) {
728
+ F.prev( deltaY > 0 ? 'down' : 'left' );
729
+
730
+ } else if (deltaY < 0 || deltaX < 0) {
731
+ F.next( deltaY < 0 ? 'up' : 'right' );
732
+ }
733
+
734
+ e.preventDefault();
735
+ }
736
+ }
737
+ });
738
+ }
739
+ },
740
+
741
+ trigger: function (event, o) {
742
+ var ret, obj = o || F.coming || F.current;
743
+
744
+ if (!obj) {
745
+ return;
746
+ }
747
+
748
+ if ($.isFunction( obj[event] )) {
749
+ ret = obj[event].apply(obj, Array.prototype.slice.call(arguments, 1));
750
+ }
751
+
752
+ if (ret === false) {
753
+ return false;
754
+ }
755
+
756
+ if (obj.helpers) {
757
+ $.each(obj.helpers, function (helper, opts) {
758
+ if (opts && F.helpers[helper] && $.isFunction(F.helpers[helper][event])) {
759
+ F.helpers[helper][event]($.extend(true, {}, F.helpers[helper].defaults, opts), obj);
760
+ }
761
+ });
762
+ }
763
+
764
+ D.trigger(event);
765
+ },
766
+
767
+ isImage: function (str) {
768
+ return isString(str) && str.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i);
769
+ },
770
+
771
+ isSWF: function (str) {
772
+ return isString(str) && str.match(/\.(swf)((\?|#).*)?$/i);
773
+ },
774
+
775
+ _start: function (index) {
776
+ var coming = {},
777
+ obj,
778
+ href,
779
+ type,
780
+ margin,
781
+ padding;
782
+
783
+ index = getScalar( index );
784
+ obj = F.group[ index ] || null;
785
+
786
+ if (!obj) {
787
+ return false;
788
+ }
789
+
790
+ coming = $.extend(true, {}, F.opts, obj);
791
+
792
+ // Convert margin and padding properties to array - top, right, bottom, left
793
+ margin = coming.margin;
794
+ padding = coming.padding;
795
+
796
+ if ($.type(margin) === 'number') {
797
+ coming.margin = [margin, margin, margin, margin];
798
+ }
799
+
800
+ if ($.type(padding) === 'number') {
801
+ coming.padding = [padding, padding, padding, padding];
802
+ }
803
+
804
+ // 'modal' propery is just a shortcut
805
+ if (coming.modal) {
806
+ $.extend(true, coming, {
807
+ closeBtn : false,
808
+ closeClick : false,
809
+ nextClick : false,
810
+ arrows : false,
811
+ mouseWheel : false,
812
+ keys : null,
813
+ helpers: {
814
+ overlay : {
815
+ closeClick : false
816
+ }
817
+ }
818
+ });
819
+ }
820
+
821
+ // 'autoSize' property is a shortcut, too
822
+ if (coming.autoSize) {
823
+ coming.autoWidth = coming.autoHeight = true;
824
+ }
825
+
826
+ if (coming.width === 'auto') {
827
+ coming.autoWidth = true;
828
+ }
829
+
830
+ if (coming.height === 'auto') {
831
+ coming.autoHeight = true;
832
+ }
833
+
834
+ /*
835
+ * Add reference to the group, so it`s possible to access from callbacks, example:
836
+ * afterLoad : function() {
837
+ * this.title = 'Image ' + (this.index + 1) + ' of ' + this.group.length + (this.title ? ' - ' + this.title : '');
838
+ * }
839
+ */
840
+
841
+ coming.group = F.group;
842
+ coming.index = index;
843
+
844
+ // Give a chance for callback or helpers to update coming item (type, title, etc)
845
+ F.coming = coming;
846
+
847
+ if (false === F.trigger('beforeLoad')) {
848
+ F.coming = null;
849
+
850
+ return;
851
+ }
852
+
853
+ type = coming.type;
854
+ href = coming.href;
855
+
856
+ if (!type) {
857
+ F.coming = null;
858
+
859
+ //If we can not determine content type then drop silently or display next/prev item if looping through gallery
860
+ if (F.current && F.router && F.router !== 'jumpto') {
861
+ F.current.index = index;
862
+
863
+ return F[ F.router ]( F.direction );
864
+ }
865
+
866
+ return false;
867
+ }
868
+
869
+ F.isActive = true;
870
+
871
+ if (type === 'image' || type === 'swf') {
872
+ coming.autoHeight = coming.autoWidth = false;
873
+ coming.scrolling = 'visible';
874
+ }
875
+
876
+ if (type === 'image') {
877
+ coming.aspectRatio = true;
878
+ }
879
+
880
+ if (type === 'iframe' && isTouch) {
881
+ coming.scrolling = 'scroll';
882
+ }
883
+
884
+ // Build the neccessary markup
885
+ coming.wrap = $(coming.tpl.wrap).addClass('fancybox-' + (isTouch ? 'mobile' : 'desktop') + ' fancybox-type-' + type + ' fancybox-tmp ' + coming.wrapCSS).appendTo( coming.parent || 'body' );
886
+
887
+ $.extend(coming, {
888
+ skin : $('.fancybox-skin', coming.wrap),
889
+ outer : $('.fancybox-outer', coming.wrap),
890
+ inner : $('.fancybox-inner', coming.wrap)
891
+ });
892
+
893
+ $.each(["Top", "Right", "Bottom", "Left"], function(i, v) {
894
+ coming.skin.css('padding' + v, getValue(coming.padding[ i ]));
895
+ });
896
+
897
+ F.trigger('onReady');
898
+
899
+ // Check before try to load; 'inline' and 'html' types need content, others - href
900
+ if (type === 'inline' || type === 'html') {
901
+ if (!coming.content || !coming.content.length) {
902
+ return F._error( 'content' );
903
+ }
904
+
905
+ } else if (!href) {
906
+ return F._error( 'href' );
907
+ }
908
+
909
+ if (type === 'image') {
910
+ F._loadImage();
911
+
912
+ } else if (type === 'ajax') {
913
+ F._loadAjax();
914
+
915
+ } else if (type === 'iframe') {
916
+ F._loadIframe();
917
+
918
+ } else {
919
+ F._afterLoad();
920
+ }
921
+ },
922
+
923
+ _error: function ( type ) {
924
+ $.extend(F.coming, {
925
+ type : 'html',
926
+ autoWidth : true,
927
+ autoHeight : true,
928
+ minWidth : 0,
929
+ minHeight : 0,
930
+ scrolling : 'no',
931
+ hasError : type,
932
+ content : F.coming.tpl.error
933
+ });
934
+
935
+ F._afterLoad();
936
+ },
937
+
938
+ _loadImage: function () {
939
+ // Reset preload image so it is later possible to check "complete" property
940
+ var img = F.imgPreload = new Image();
941
+
942
+ img.onload = function () {
943
+ this.onload = this.onerror = null;
944
+
945
+ F.coming.width = this.width / F.opts.pixelRatio;
946
+ F.coming.height = this.height / F.opts.pixelRatio;
947
+
948
+ F._afterLoad();
949
+ };
950
+
951
+ img.onerror = function () {
952
+ this.onload = this.onerror = null;
953
+
954
+ F._error( 'image' );
955
+ };
956
+
957
+ img.src = F.coming.href;
958
+
959
+ if (img.complete !== true) {
960
+ F.showLoading();
961
+ }
962
+ },
963
+
964
+ _loadAjax: function () {
965
+ var coming = F.coming;
966
+
967
+ F.showLoading();
968
+
969
+ F.ajaxLoad = $.ajax($.extend({}, coming.ajax, {
970
+ url: coming.href,
971
+ error: function (jqXHR, textStatus) {
972
+ if (F.coming && textStatus !== 'abort') {
973
+ F._error( 'ajax', jqXHR );
974
+
975
+ } else {
976
+ F.hideLoading();
977
+ }
978
+ },
979
+ success: function (data, textStatus) {
980
+ if (textStatus === 'success') {
981
+ coming.content = data;
982
+
983
+ F._afterLoad();
984
+ }
985
+ }
986
+ }));
987
+ },
988
+
989
+ _loadIframe: function() {
990
+ var coming = F.coming,
991
+ iframe = $(coming.tpl.iframe.replace(/\{rnd\}/g, new Date().getTime()))
992
+ .attr('scrolling', isTouch ? 'auto' : coming.iframe.scrolling)
993
+ .attr('src', coming.href);
994
+
995
+ // This helps IE
996
+ $(coming.wrap).bind('onReset', function () {
997
+ try {
998
+ $(this).find('iframe').hide().attr('src', '//about:blank').end().empty();
999
+ } catch (e) {}
1000
+ });
1001
+
1002
+ if (coming.iframe.preload) {
1003
+ F.showLoading();
1004
+
1005
+ iframe.one('load', function() {
1006
+ $(this).data('ready', 1);
1007
+
1008
+ // iOS will lose scrolling if we resize
1009
+ if (!isTouch) {
1010
+ $(this).bind('load.fb', F.update);
1011
+ }
1012
+
1013
+ // Without this trick:
1014
+ // - iframe won't scroll on iOS devices
1015
+ // - IE7 sometimes displays empty iframe
1016
+ $(this).parents('.fancybox-wrap').width('100%').removeClass('fancybox-tmp').show();
1017
+
1018
+ F._afterLoad();
1019
+ });
1020
+ }
1021
+
1022
+ coming.content = iframe.appendTo( coming.inner );
1023
+
1024
+ if (!coming.iframe.preload) {
1025
+ F._afterLoad();
1026
+ }
1027
+ },
1028
+
1029
+ _preloadImages: function() {
1030
+ var group = F.group,
1031
+ current = F.current,
1032
+ len = group.length,
1033
+ cnt = current.preload ? Math.min(current.preload, len - 1) : 0,
1034
+ item,
1035
+ i;
1036
+
1037
+ for (i = 1; i <= cnt; i += 1) {
1038
+ item = group[ (current.index + i ) % len ];
1039
+
1040
+ if (item.type === 'image' && item.href) {
1041
+ new Image().src = item.href;
1042
+ }
1043
+ }
1044
+ },
1045
+
1046
+ _afterLoad: function () {
1047
+ var coming = F.coming,
1048
+ previous = F.current,
1049
+ placeholder = 'fancybox-placeholder',
1050
+ current,
1051
+ content,
1052
+ type,
1053
+ scrolling,
1054
+ href,
1055
+ embed;
1056
+
1057
+ F.hideLoading();
1058
+
1059
+ if (!coming || F.isActive === false) {
1060
+ return;
1061
+ }
1062
+
1063
+ if (false === F.trigger('afterLoad', coming, previous)) {
1064
+ coming.wrap.stop(true).trigger('onReset').remove();
1065
+
1066
+ F.coming = null;
1067
+
1068
+ return;
1069
+ }
1070
+
1071
+ if (previous) {
1072
+ F.trigger('beforeChange', previous);
1073
+
1074
+ previous.wrap.stop(true).removeClass('fancybox-opened')
1075
+ .find('.fancybox-item, .fancybox-nav')
1076
+ .remove();
1077
+ }
1078
+
1079
+ F.unbindEvents();
1080
+
1081
+ current = coming;
1082
+ content = coming.content;
1083
+ type = coming.type;
1084
+ scrolling = coming.scrolling;
1085
+
1086
+ $.extend(F, {
1087
+ wrap : current.wrap,
1088
+ skin : current.skin,
1089
+ outer : current.outer,
1090
+ inner : current.inner,
1091
+ current : current,
1092
+ previous : previous
1093
+ });
1094
+
1095
+ href = current.href;
1096
+
1097
+ switch (type) {
1098
+ case 'inline':
1099
+ case 'ajax':
1100
+ case 'html':
1101
+ if (current.selector) {
1102
+ content = $('<div>').html(content).find(current.selector);
1103
+
1104
+ } else if (isQuery(content)) {
1105
+ if (!content.data(placeholder)) {
1106
+ content.data(placeholder, $('<div class="' + placeholder + '"></div>').insertAfter( content ).hide() );
1107
+ }
1108
+
1109
+ content = content.show().detach();
1110
+
1111
+ current.wrap.bind('onReset', function () {
1112
+ if ($(this).find(content).length) {
1113
+ content.hide().replaceAll( content.data(placeholder) ).data(placeholder, false);
1114
+ }
1115
+ });
1116
+ }
1117
+ break;
1118
+
1119
+ case 'image':
1120
+ content = current.tpl.image.replace('{href}', href);
1121
+ break;
1122
+
1123
+ case 'swf':
1124
+ content = '<object id="fancybox-swf" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%"><param name="movie" value="' + href + '"></param>';
1125
+ embed = '';
1126
+
1127
+ $.each(current.swf, function(name, val) {
1128
+ content += '<param name="' + name + '" value="' + val + '"></param>';
1129
+ embed += ' ' + name + '="' + val + '"';
1130
+ });
1131
+
1132
+ content += '<embed src="' + href + '" type="application/x-shockwave-flash" width="100%" height="100%"' + embed + '></embed></object>';
1133
+ break;
1134
+ }
1135
+
1136
+ if (!(isQuery(content) && content.parent().is(current.inner))) {
1137
+ current.inner.append( content );
1138
+ }
1139
+
1140
+ // Give a chance for helpers or callbacks to update elements
1141
+ F.trigger('beforeShow');
1142
+
1143
+ // Set scrolling before calculating dimensions
1144
+ current.inner.css('overflow', scrolling === 'yes' ? 'scroll' : (scrolling === 'no' ? 'hidden' : scrolling));
1145
+
1146
+ // Set initial dimensions and start position
1147
+ F._setDimension();
1148
+
1149
+ F.reposition();
1150
+
1151
+ F.isOpen = false;
1152
+ F.coming = null;
1153
+
1154
+ F.bindEvents();
1155
+
1156
+ if (!F.isOpened) {
1157
+ $('.fancybox-wrap').not( current.wrap ).stop(true).trigger('onReset').remove();
1158
+
1159
+ } else if (previous.prevMethod) {
1160
+ F.transitions[ previous.prevMethod ]();
1161
+ }
1162
+
1163
+ F.transitions[ F.isOpened ? current.nextMethod : current.openMethod ]();
1164
+
1165
+ F._preloadImages();
1166
+ },
1167
+
1168
+ _setDimension: function () {
1169
+ var viewport = F.getViewport(),
1170
+ steps = 0,
1171
+ canShrink = false,
1172
+ canExpand = false,
1173
+ wrap = F.wrap,
1174
+ skin = F.skin,
1175
+ inner = F.inner,
1176
+ current = F.current,
1177
+ width = current.width,
1178
+ height = current.height,
1179
+ minWidth = current.minWidth,
1180
+ minHeight = current.minHeight,
1181
+ maxWidth = current.maxWidth,
1182
+ maxHeight = current.maxHeight,
1183
+ scrolling = current.scrolling,
1184
+ scrollOut = current.scrollOutside ? current.scrollbarWidth : 0,
1185
+ margin = current.margin,
1186
+ wMargin = getScalar(margin[1] + margin[3]),
1187
+ hMargin = getScalar(margin[0] + margin[2]),
1188
+ wPadding,
1189
+ hPadding,
1190
+ wSpace,
1191
+ hSpace,
1192
+ origWidth,
1193
+ origHeight,
1194
+ origMaxWidth,
1195
+ origMaxHeight,
1196
+ ratio,
1197
+ width_,
1198
+ height_,
1199
+ maxWidth_,
1200
+ maxHeight_,
1201
+ iframe,
1202
+ body;
1203
+
1204
+ // Reset dimensions so we could re-check actual size
1205
+ wrap.add(skin).add(inner).width('auto').height('auto').removeClass('fancybox-tmp');
1206
+
1207
+ wPadding = getScalar(skin.outerWidth(true) - skin.width());
1208
+ hPadding = getScalar(skin.outerHeight(true) - skin.height());
1209
+
1210
+ // Any space between content and viewport (margin, padding, border, title)
1211
+ wSpace = wMargin + wPadding;
1212
+ hSpace = hMargin + hPadding;
1213
+
1214
+ origWidth = isPercentage(width) ? (viewport.w - wSpace) * getScalar(width) / 100 : width;
1215
+ origHeight = isPercentage(height) ? (viewport.h - hSpace) * getScalar(height) / 100 : height;
1216
+
1217
+ if (current.type === 'iframe') {
1218
+ iframe = current.content;
1219
+
1220
+ if (current.autoHeight && iframe.data('ready') === 1) {
1221
+ try {
1222
+ if (iframe[0].contentWindow.document.location) {
1223
+ inner.width( origWidth ).height(9999);
1224
+
1225
+ body = iframe.contents().find('body');
1226
+
1227
+ if (scrollOut) {
1228
+ body.css('overflow-x', 'hidden');
1229
+ }
1230
+
1231
+ origHeight = body.outerHeight(true);
1232
+ }
1233
+
1234
+ } catch (e) {}
1235
+ }
1236
+
1237
+ } else if (current.autoWidth || current.autoHeight) {
1238
+ inner.addClass( 'fancybox-tmp' );
1239
+
1240
+ // Set width or height in case we need to calculate only one dimension
1241
+ if (!current.autoWidth) {
1242
+ inner.width( origWidth );
1243
+ }
1244
+
1245
+ if (!current.autoHeight) {
1246
+ inner.height( origHeight );
1247
+ }
1248
+
1249
+ if (current.autoWidth) {
1250
+ origWidth = inner.width();
1251
+ }
1252
+
1253
+ if (current.autoHeight) {
1254
+ origHeight = inner.height();
1255
+ }
1256
+
1257
+ inner.removeClass( 'fancybox-tmp' );
1258
+ }
1259
+
1260
+ width = getScalar( origWidth );
1261
+ height = getScalar( origHeight );
1262
+
1263
+ ratio = origWidth / origHeight;
1264
+
1265
+ // Calculations for the content
1266
+ minWidth = getScalar(isPercentage(minWidth) ? getScalar(minWidth, 'w') - wSpace : minWidth);
1267
+ maxWidth = getScalar(isPercentage(maxWidth) ? getScalar(maxWidth, 'w') - wSpace : maxWidth);
1268
+
1269
+ minHeight = getScalar(isPercentage(minHeight) ? getScalar(minHeight, 'h') - hSpace : minHeight);
1270
+ maxHeight = getScalar(isPercentage(maxHeight) ? getScalar(maxHeight, 'h') - hSpace : maxHeight);
1271
+
1272
+ // These will be used to determine if wrap can fit in the viewport
1273
+ origMaxWidth = maxWidth;
1274
+ origMaxHeight = maxHeight;
1275
+
1276
+ if (current.fitToView) {
1277
+ maxWidth = Math.min(viewport.w - wSpace, maxWidth);
1278
+ maxHeight = Math.min(viewport.h - hSpace, maxHeight);
1279
+ }
1280
+
1281
+ maxWidth_ = viewport.w - wMargin;
1282
+ maxHeight_ = viewport.h - hMargin;
1283
+
1284
+ if (current.aspectRatio) {
1285
+ if (width > maxWidth) {
1286
+ width = maxWidth;
1287
+ height = getScalar(width / ratio);
1288
+ }
1289
+
1290
+ if (height > maxHeight) {
1291
+ height = maxHeight;
1292
+ width = getScalar(height * ratio);
1293
+ }
1294
+
1295
+ if (width < minWidth) {
1296
+ width = minWidth;
1297
+ height = getScalar(width / ratio);
1298
+ }
1299
+
1300
+ if (height < minHeight) {
1301
+ height = minHeight;
1302
+ width = getScalar(height * ratio);
1303
+ }
1304
+
1305
+ } else {
1306
+ width = Math.max(minWidth, Math.min(width, maxWidth));
1307
+
1308
+ if (current.autoHeight && current.type !== 'iframe') {
1309
+ inner.width( width );
1310
+
1311
+ height = inner.height();
1312
+ }
1313
+
1314
+ height = Math.max(minHeight, Math.min(height, maxHeight));
1315
+ }
1316
+
1317
+ // Try to fit inside viewport (including the title)
1318
+ if (current.fitToView) {
1319
+ inner.width( width ).height( height );
1320
+
1321
+ wrap.width( width + wPadding );
1322
+
1323
+ // Real wrap dimensions
1324
+ width_ = wrap.width();
1325
+ height_ = wrap.height();
1326
+
1327
+ if (current.aspectRatio) {
1328
+ while ((width_ > maxWidth_ || height_ > maxHeight_) && width > minWidth && height > minHeight) {
1329
+ if (steps++ > 19) {
1330
+ break;
1331
+ }
1332
+
1333
+ height = Math.max(minHeight, Math.min(maxHeight, height - 10));
1334
+ width = getScalar(height * ratio);
1335
+
1336
+ if (width < minWidth) {
1337
+ width = minWidth;
1338
+ height = getScalar(width / ratio);
1339
+ }
1340
+
1341
+ if (width > maxWidth) {
1342
+ width = maxWidth;
1343
+ height = getScalar(width / ratio);
1344
+ }
1345
+
1346
+ inner.width( width ).height( height );
1347
+
1348
+ wrap.width( width + wPadding );
1349
+
1350
+ width_ = wrap.width();
1351
+ height_ = wrap.height();
1352
+ }
1353
+
1354
+ } else {
1355
+ width = Math.max(minWidth, Math.min(width, width - (width_ - maxWidth_)));
1356
+ height = Math.max(minHeight, Math.min(height, height - (height_ - maxHeight_)));
1357
+ }
1358
+ }
1359
+
1360
+ if (scrollOut && scrolling === 'auto' && height < origHeight && (width + wPadding + scrollOut) < maxWidth_) {
1361
+ width += scrollOut;
1362
+ }
1363
+
1364
+ inner.width( width ).height( height );
1365
+
1366
+ wrap.width( width + wPadding );
1367
+
1368
+ width_ = wrap.width();
1369
+ height_ = wrap.height();
1370
+
1371
+ canShrink = (width_ > maxWidth_ || height_ > maxHeight_) && width > minWidth && height > minHeight;
1372
+ canExpand = current.aspectRatio ? (width < origMaxWidth && height < origMaxHeight && width < origWidth && height < origHeight) : ((width < origMaxWidth || height < origMaxHeight) && (width < origWidth || height < origHeight));
1373
+
1374
+ $.extend(current, {
1375
+ dim : {
1376
+ width : getValue( width_ ),
1377
+ height : getValue( height_ )
1378
+ },
1379
+ origWidth : origWidth,
1380
+ origHeight : origHeight,
1381
+ canShrink : canShrink,
1382
+ canExpand : canExpand,
1383
+ wPadding : wPadding,
1384
+ hPadding : hPadding,
1385
+ wrapSpace : height_ - skin.outerHeight(true),
1386
+ skinSpace : skin.height() - height
1387
+ });
1388
+
1389
+ if (!iframe && current.autoHeight && height > minHeight && height < maxHeight && !canExpand) {
1390
+ inner.height('auto');
1391
+ }
1392
+ },
1393
+
1394
+ _getPosition: function (onlyAbsolute) {
1395
+ var current = F.current,
1396
+ viewport = F.getViewport(),
1397
+ margin = current.margin,
1398
+ width = F.wrap.width() + margin[1] + margin[3],
1399
+ height = F.wrap.height() + margin[0] + margin[2],
1400
+ rez = {
1401
+ position: 'absolute',
1402
+ top : margin[0],
1403
+ left : margin[3]
1404
+ };
1405
+
1406
+ if (current.autoCenter && current.fixed && !onlyAbsolute && height <= viewport.h && width <= viewport.w) {
1407
+ rez.position = 'fixed';
1408
+
1409
+ } else if (!current.locked) {
1410
+ rez.top += viewport.y;
1411
+ rez.left += viewport.x;
1412
+ }
1413
+
1414
+ rez.top = getValue(Math.max(rez.top, rez.top + ((viewport.h - height) * current.topRatio)));
1415
+ rez.left = getValue(Math.max(rez.left, rez.left + ((viewport.w - width) * current.leftRatio)));
1416
+
1417
+ return rez;
1418
+ },
1419
+
1420
+ _afterZoomIn: function () {
1421
+ var current = F.current;
1422
+
1423
+ if (!current) {
1424
+ return;
1425
+ }
1426
+
1427
+ F.isOpen = F.isOpened = true;
1428
+
1429
+ F.wrap.css('overflow', 'visible').addClass('fancybox-opened');
1430
+
1431
+ F.update();
1432
+
1433
+ // Assign a click event
1434
+ if ( current.closeClick || (current.nextClick && F.group.length > 1) ) {
1435
+ F.inner.css('cursor', 'pointer').bind('click.fb', function(e) {
1436
+ if (!$(e.target).is('a') && !$(e.target).parent().is('a')) {
1437
+ e.preventDefault();
1438
+
1439
+ F[ current.closeClick ? 'close' : 'next' ]();
1440
+ }
1441
+ });
1442
+ }
1443
+
1444
+ // Create a close button
1445
+ if (current.closeBtn) {
1446
+ $(current.tpl.closeBtn).appendTo(F.skin).bind('click.fb', function(e) {
1447
+ e.preventDefault();
1448
+
1449
+ F.close();
1450
+ });
1451
+ }
1452
+
1453
+ // Create navigation arrows
1454
+ if (current.arrows && F.group.length > 1) {
1455
+ if (current.loop || current.index > 0) {
1456
+ $(current.tpl.prev).appendTo(F.outer).bind('click.fb', F.prev);
1457
+ }
1458
+
1459
+ if (current.loop || current.index < F.group.length - 1) {
1460
+ $(current.tpl.next).appendTo(F.outer).bind('click.fb', F.next);
1461
+ }
1462
+ }
1463
+
1464
+ F.trigger('afterShow');
1465
+
1466
+ // Stop the slideshow if this is the last item
1467
+ if (!current.loop && current.index === current.group.length - 1) {
1468
+ F.play( false );
1469
+
1470
+ } else if (F.opts.autoPlay && !F.player.isActive) {
1471
+ F.opts.autoPlay = false;
1472
+
1473
+ F.play();
1474
+ }
1475
+ },
1476
+
1477
+ _afterZoomOut: function ( obj ) {
1478
+ obj = obj || F.current;
1479
+
1480
+ $('.fancybox-wrap').trigger('onReset').remove();
1481
+
1482
+ $.extend(F, {
1483
+ group : {},
1484
+ opts : {},
1485
+ router : false,
1486
+ current : null,
1487
+ isActive : false,
1488
+ isOpened : false,
1489
+ isOpen : false,
1490
+ isClosing : false,
1491
+ wrap : null,
1492
+ skin : null,
1493
+ outer : null,
1494
+ inner : null
1495
+ });
1496
+
1497
+ F.trigger('afterClose', obj);
1498
+ }
1499
+ });
1500
+
1501
+ /*
1502
+ * Default transitions
1503
+ */
1504
+
1505
+ F.transitions = {
1506
+ getOrigPosition: function () {
1507
+ var current = F.current,
1508
+ element = current.element,
1509
+ orig = current.orig,
1510
+ pos = {},
1511
+ width = 50,
1512
+ height = 50,
1513
+ hPadding = current.hPadding,
1514
+ wPadding = current.wPadding,
1515
+ viewport = F.getViewport();
1516
+
1517
+ if (!orig && current.isDom && element.is(':visible')) {
1518
+ orig = element.find('img:first');
1519
+
1520
+ if (!orig.length) {
1521
+ orig = element;
1522
+ }
1523
+ }
1524
+
1525
+ if (isQuery(orig)) {
1526
+ pos = orig.offset();
1527
+
1528
+ if (orig.is('img')) {
1529
+ width = orig.outerWidth();
1530
+ height = orig.outerHeight();
1531
+ }
1532
+
1533
+ } else {
1534
+ pos.top = viewport.y + (viewport.h - height) * current.topRatio;
1535
+ pos.left = viewport.x + (viewport.w - width) * current.leftRatio;
1536
+ }
1537
+
1538
+ if (F.wrap.css('position') === 'fixed' || current.locked) {
1539
+ pos.top -= viewport.y;
1540
+ pos.left -= viewport.x;
1541
+ }
1542
+
1543
+ pos = {
1544
+ top : getValue(pos.top - hPadding * current.topRatio),
1545
+ left : getValue(pos.left - wPadding * current.leftRatio),
1546
+ width : getValue(width + wPadding),
1547
+ height : getValue(height + hPadding)
1548
+ };
1549
+
1550
+ return pos;
1551
+ },
1552
+
1553
+ step: function (now, fx) {
1554
+ var ratio,
1555
+ padding,
1556
+ value,
1557
+ prop = fx.prop,
1558
+ current = F.current,
1559
+ wrapSpace = current.wrapSpace,
1560
+ skinSpace = current.skinSpace;
1561
+
1562
+ if (prop === 'width' || prop === 'height') {
1563
+ ratio = fx.end === fx.start ? 1 : (now - fx.start) / (fx.end - fx.start);
1564
+
1565
+ if (F.isClosing) {
1566
+ ratio = 1 - ratio;
1567
+ }
1568
+
1569
+ padding = prop === 'width' ? current.wPadding : current.hPadding;
1570
+ value = now - padding;
1571
+
1572
+ F.skin[ prop ]( getScalar( prop === 'width' ? value : value - (wrapSpace * ratio) ) );
1573
+ F.inner[ prop ]( getScalar( prop === 'width' ? value : value - (wrapSpace * ratio) - (skinSpace * ratio) ) );
1574
+ }
1575
+ },
1576
+
1577
+ zoomIn: function () {
1578
+ var current = F.current,
1579
+ startPos = current.pos,
1580
+ effect = current.openEffect,
1581
+ elastic = effect === 'elastic',
1582
+ endPos = $.extend({opacity : 1}, startPos);
1583
+
1584
+ // Remove "position" property that breaks older IE
1585
+ delete endPos.position;
1586
+
1587
+ if (elastic) {
1588
+ startPos = this.getOrigPosition();
1589
+
1590
+ if (current.openOpacity) {
1591
+ startPos.opacity = 0.1;
1592
+ }
1593
+
1594
+ } else if (effect === 'fade') {
1595
+ startPos.opacity = 0.1;
1596
+ }
1597
+
1598
+ F.wrap.css(startPos).animate(endPos, {
1599
+ duration : effect === 'none' ? 0 : current.openSpeed,
1600
+ easing : current.openEasing,
1601
+ step : elastic ? this.step : null,
1602
+ complete : F._afterZoomIn
1603
+ });
1604
+ },
1605
+
1606
+ zoomOut: function () {
1607
+ var current = F.current,
1608
+ effect = current.closeEffect,
1609
+ elastic = effect === 'elastic',
1610
+ endPos = {opacity : 0.1};
1611
+
1612
+ if (elastic) {
1613
+ endPos = this.getOrigPosition();
1614
+
1615
+ if (current.closeOpacity) {
1616
+ endPos.opacity = 0.1;
1617
+ }
1618
+ }
1619
+
1620
+ F.wrap.animate(endPos, {
1621
+ duration : effect === 'none' ? 0 : current.closeSpeed,
1622
+ easing : current.closeEasing,
1623
+ step : elastic ? this.step : null,
1624
+ complete : F._afterZoomOut
1625
+ });
1626
+ },
1627
+
1628
+ changeIn: function () {
1629
+ var current = F.current,
1630
+ effect = current.nextEffect,
1631
+ startPos = current.pos,
1632
+ endPos = { opacity : 1 },
1633
+ direction = F.direction,
1634
+ distance = 200,
1635
+ field;
1636
+
1637
+ startPos.opacity = 0.1;
1638
+
1639
+ if (effect === 'elastic') {
1640
+ field = direction === 'down' || direction === 'up' ? 'top' : 'left';
1641
+
1642
+ if (direction === 'down' || direction === 'right') {
1643
+ startPos[ field ] = getValue(getScalar(startPos[ field ]) - distance);
1644
+ endPos[ field ] = '+=' + distance + 'px';
1645
+
1646
+ } else {
1647
+ startPos[ field ] = getValue(getScalar(startPos[ field ]) + distance);
1648
+ endPos[ field ] = '-=' + distance + 'px';
1649
+ }
1650
+ }
1651
+
1652
+ // Workaround for http://bugs.jquery.com/ticket/12273
1653
+ if (effect === 'none') {
1654
+ F._afterZoomIn();
1655
+
1656
+ } else {
1657
+ F.wrap.css(startPos).animate(endPos, {
1658
+ duration : current.nextSpeed,
1659
+ easing : current.nextEasing,
1660
+ complete : F._afterZoomIn
1661
+ });
1662
+ }
1663
+ },
1664
+
1665
+ changeOut: function () {
1666
+ var previous = F.previous,
1667
+ effect = previous.prevEffect,
1668
+ endPos = { opacity : 0.1 },
1669
+ direction = F.direction,
1670
+ distance = 200;
1671
+
1672
+ if (effect === 'elastic') {
1673
+ endPos[ direction === 'down' || direction === 'up' ? 'top' : 'left' ] = ( direction === 'up' || direction === 'left' ? '-' : '+' ) + '=' + distance + 'px';
1674
+ }
1675
+
1676
+ previous.wrap.animate(endPos, {
1677
+ duration : effect === 'none' ? 0 : previous.prevSpeed,
1678
+ easing : previous.prevEasing,
1679
+ complete : function () {
1680
+ $(this).trigger('onReset').remove();
1681
+ }
1682
+ });
1683
+ }
1684
+ };
1685
+
1686
+ /*
1687
+ * Overlay helper
1688
+ */
1689
+
1690
+ F.helpers.overlay = {
1691
+ defaults : {
1692
+ closeClick : true, // if true, fancyBox will be closed when user clicks on the overlay
1693
+ speedOut : 200, // duration of fadeOut animation
1694
+ showEarly : true, // indicates if should be opened immediately or wait until the content is ready
1695
+ css : {}, // custom CSS properties
1696
+ locked : !isTouch, // if true, the content will be locked into overlay
1697
+ fixed : true // if false, the overlay CSS position property will not be set to "fixed"
1698
+ },
1699
+
1700
+ overlay : null, // current handle
1701
+ fixed : false, // indicates if the overlay has position "fixed"
1702
+ el : $('html'), // element that contains "the lock"
1703
+
1704
+ // Public methods
1705
+ create : function(opts) {
1706
+ opts = $.extend({}, this.defaults, opts);
1707
+
1708
+ if (this.overlay) {
1709
+ this.close();
1710
+ }
1711
+
1712
+ this.overlay = $('<div class="fancybox-overlay"></div>').appendTo( F.coming ? F.coming.parent : opts.parent );
1713
+ this.fixed = false;
1714
+
1715
+ if (opts.fixed && F.defaults.fixed) {
1716
+ this.overlay.addClass('fancybox-overlay-fixed');
1717
+
1718
+ this.fixed = true;
1719
+ }
1720
+ },
1721
+
1722
+ open : function(opts) {
1723
+ var that = this;
1724
+
1725
+ opts = $.extend({}, this.defaults, opts);
1726
+
1727
+ if (this.overlay) {
1728
+ this.overlay.unbind('.overlay').width('auto').height('auto');
1729
+
1730
+ } else {
1731
+ this.create(opts);
1732
+ }
1733
+
1734
+ if (!this.fixed) {
1735
+ W.bind('resize.overlay', $.proxy( this.update, this) );
1736
+
1737
+ this.update();
1738
+ }
1739
+
1740
+ if (opts.closeClick) {
1741
+ this.overlay.bind('click.overlay', function(e) {
1742
+ if ($(e.target).hasClass('fancybox-overlay')) {
1743
+ if (F.isActive) {
1744
+ F.close();
1745
+ } else {
1746
+ that.close();
1747
+ }
1748
+
1749
+ return false;
1750
+ }
1751
+ });
1752
+ }
1753
+
1754
+ this.overlay.css( opts.css ).show();
1755
+ },
1756
+
1757
+ close : function() {
1758
+ var scrollV, scrollH;
1759
+
1760
+ W.unbind('resize.overlay');
1761
+
1762
+ if (this.el.hasClass('fancybox-lock')) {
1763
+ $('.fancybox-margin').removeClass('fancybox-margin');
1764
+
1765
+ scrollV = W.scrollTop();
1766
+ scrollH = W.scrollLeft();
1767
+
1768
+ this.el.removeClass('fancybox-lock');
1769
+
1770
+ W.scrollTop( scrollV ).scrollLeft( scrollH );
1771
+ }
1772
+
1773
+ $('.fancybox-overlay').remove().hide();
1774
+
1775
+ $.extend(this, {
1776
+ overlay : null,
1777
+ fixed : false
1778
+ });
1779
+ },
1780
+
1781
+ // Private, callbacks
1782
+
1783
+ update : function () {
1784
+ var width = '100%', offsetWidth;
1785
+
1786
+ // Reset width/height so it will not mess
1787
+ this.overlay.width(width).height('100%');
1788
+
1789
+ // jQuery does not return reliable result for IE
1790
+ if (IE) {
1791
+ offsetWidth = Math.max(document.documentElement.offsetWidth, document.body.offsetWidth);
1792
+
1793
+ if (D.width() > offsetWidth) {
1794
+ width = D.width();
1795
+ }
1796
+
1797
+ } else if (D.width() > W.width()) {
1798
+ width = D.width();
1799
+ }
1800
+
1801
+ this.overlay.width(width).height(D.height());
1802
+ },
1803
+
1804
+ // This is where we can manipulate DOM, because later it would cause iframes to reload
1805
+ onReady : function (opts, obj) {
1806
+ var overlay = this.overlay;
1807
+
1808
+ $('.fancybox-overlay').stop(true, true);
1809
+
1810
+ if (!overlay) {
1811
+ this.create(opts);
1812
+ }
1813
+
1814
+ if (opts.locked && this.fixed && obj.fixed) {
1815
+ if (!overlay) {
1816
+ this.margin = D.height() > W.height() ? $('html').css('margin-right').replace("px", "") : false;
1817
+ }
1818
+
1819
+ obj.locked = this.overlay.append( obj.wrap );
1820
+ obj.fixed = false;
1821
+ }
1822
+
1823
+ if (opts.showEarly === true) {
1824
+ this.beforeShow.apply(this, arguments);
1825
+ }
1826
+ },
1827
+
1828
+ beforeShow : function(opts, obj) {
1829
+ var scrollV, scrollH;
1830
+
1831
+ if (obj.locked) {
1832
+ if (this.margin !== false) {
1833
+ $('*').filter(function(){
1834
+ return ($(this).css('position') === 'fixed' && !$(this).hasClass("fancybox-overlay") && !$(this).hasClass("fancybox-wrap") );
1835
+ }).addClass('fancybox-margin');
1836
+
1837
+ this.el.addClass('fancybox-margin');
1838
+ }
1839
+
1840
+ scrollV = W.scrollTop();
1841
+ scrollH = W.scrollLeft();
1842
+
1843
+ this.el.addClass('fancybox-lock');
1844
+
1845
+ W.scrollTop( scrollV ).scrollLeft( scrollH );
1846
+ }
1847
+
1848
+ this.open(opts);
1849
+ },
1850
+
1851
+ onUpdate : function() {
1852
+ if (!this.fixed) {
1853
+ this.update();
1854
+ }
1855
+ },
1856
+
1857
+ afterClose: function (opts) {
1858
+ // Remove overlay if exists and fancyBox is not opening
1859
+ // (e.g., it is not being open using afterClose callback)
1860
+ //if (this.overlay && !F.isActive) {
1861
+ if (this.overlay && !F.coming) {
1862
+ this.overlay.fadeOut(opts.speedOut, $.proxy( this.close, this ));
1863
+ }
1864
+ }
1865
+ };
1866
+
1867
+ /*
1868
+ * Title helper
1869
+ */
1870
+
1871
+ F.helpers.title = {
1872
+ defaults : {
1873
+ type : 'float', // 'float', 'inside', 'outside' or 'over',
1874
+ position : 'bottom' // 'top' or 'bottom'
1875
+ },
1876
+
1877
+ beforeShow: function (opts) {
1878
+ var current = F.current,
1879
+ text = current.title,
1880
+ type = opts.type,
1881
+ title,
1882
+ target;
1883
+
1884
+ if ($.isFunction(text)) {
1885
+ text = text.call(current.element, current);
1886
+ }
1887
+
1888
+ if (!isString(text) || $.trim(text) === '') {
1889
+ return;
1890
+ }
1891
+
1892
+ title = $('<div class="fancybox-title fancybox-title-' + type + '-wrap">' + text + '</div>');
1893
+
1894
+ switch (type) {
1895
+ case 'inside':
1896
+ target = F.skin;
1897
+ break;
1898
+
1899
+ case 'outside':
1900
+ target = F.wrap;
1901
+ break;
1902
+
1903
+ case 'over':
1904
+ target = F.inner;
1905
+ break;
1906
+
1907
+ default: // 'float'
1908
+ target = F.skin;
1909
+
1910
+ title.appendTo('body');
1911
+
1912
+ if (IE) {
1913
+ title.width( title.width() );
1914
+ }
1915
+
1916
+ title.wrapInner('<span class="child"></span>');
1917
+
1918
+ //Increase bottom margin so this title will also fit into viewport
1919
+ F.current.margin[2] += Math.abs( getScalar(title.css('margin-bottom')) );
1920
+ break;
1921
+ }
1922
+
1923
+ title[ (opts.position === 'top' ? 'prependTo' : 'appendTo') ](target);
1924
+ }
1925
+ };
1926
+
1927
+ // jQuery plugin initialization
1928
+ $.fn.fancybox = function (options) {
1929
+ var index,
1930
+ that = $(this),
1931
+ selector = this.selector || '',
1932
+ run = function(e) {
1933
+ var what = $(this).blur(), idx = index, relType, relVal;
1934
+
1935
+ if (!(e.ctrlKey || e.altKey || e.shiftKey || e.metaKey) && !what.is('.fancybox-wrap')) {
1936
+ relType = options.groupAttr || 'data-fancybox-group';
1937
+ relVal = what.attr(relType);
1938
+
1939
+ if (!relVal) {
1940
+ relType = 'rel';
1941
+ relVal = what.get(0)[ relType ];
1942
+ }
1943
+
1944
+ if (relVal && relVal !== '' && relVal !== 'nofollow') {
1945
+ what = selector.length ? $(selector) : that;
1946
+ what = what.filter('[' + relType + '="' + relVal + '"]');
1947
+ idx = what.index(this);
1948
+ }
1949
+
1950
+ options.index = idx;
1951
+
1952
+ // Stop an event from bubbling if everything is fine
1953
+ if (F.open(what, options) !== false) {
1954
+ e.preventDefault();
1955
+ }
1956
+ }
1957
+ };
1958
+
1959
+ options = options || {};
1960
+ index = options.index || 0;
1961
+
1962
+ if (!selector || options.live === false) {
1963
+ that.unbind('click.fb-start').bind('click.fb-start', run);
1964
+
1965
+ } else {
1966
+ D.undelegate(selector, 'click.fb-start').delegate(selector + ":not('.fancybox-item, .fancybox-nav')", 'click.fb-start', run);
1967
+ }
1968
+
1969
+ this.filter('[data-fancybox-start=1]').trigger('click');
1970
+
1971
+ return this;
1972
+ };
1973
+
1974
+ // Tests that need a body at doc ready
1975
+ D.ready(function() {
1976
+ var w1, w2;
1977
+
1978
+ if ( $.scrollbarWidth === undefined ) {
1979
+ // http://benalman.com/projects/jquery-misc-plugins/#scrollbarwidth
1980
+ $.scrollbarWidth = function() {
1981
+ var parent = $('<div style="width:50px;height:50px;overflow:auto"><div/></div>').appendTo('body'),
1982
+ child = parent.children(),
1983
+ width = child.innerWidth() - child.height( 99 ).innerWidth();
1984
+
1985
+ parent.remove();
1986
+
1987
+ return width;
1988
+ };
1989
+ }
1990
+
1991
+ if ( $.support.fixedPosition === undefined ) {
1992
+ $.support.fixedPosition = (function() {
1993
+ var elem = $('<div style="position:fixed;top:20px;"></div>').appendTo('body'),
1994
+ fixed = ( elem[0].offsetTop === 20 || elem[0].offsetTop === 15 );
1995
+
1996
+ elem.remove();
1997
+
1998
+ return fixed;
1999
+ }());
2000
+ }
2001
+
2002
+ $.extend(F.defaults, {
2003
+ scrollbarWidth : $.scrollbarWidth(),
2004
+ fixed : $.support.fixedPosition,
2005
+ parent : $('body')
2006
+ });
2007
+
2008
+ //Get real width of page scroll-bar
2009
+ w1 = $(window).width();
2010
+
2011
+ H.addClass('fancybox-lock-test');
2012
+
2013
+ w2 = $(window).width();
2014
+
2015
+ H.removeClass('fancybox-lock-test');
2016
+
2017
+ $("<style type='text/css'>.fancybox-margin{margin-right:" + (w2 - w1) + "px;}</style>").appendTo("head");
2018
+ });
2019
+
2020
+ }(window, document, jQuery));
includes/lib/fancybox/jquery.fancybox.pack.js ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*! fancyBox v2.1.5 fancyapps.com | fancyapps.com/fancybox/#license */
2
+ (function(r,G,f,v){var J=f("html"),n=f(r),p=f(G),b=f.fancybox=function(){b.open.apply(this,arguments)},I=navigator.userAgent.match(/msie/i),B=null,s=G.createTouch!==v,t=function(a){return a&&a.hasOwnProperty&&a instanceof f},q=function(a){return a&&"string"===f.type(a)},E=function(a){return q(a)&&0<a.indexOf("%")},l=function(a,d){var e=parseInt(a,10)||0;d&&E(a)&&(e*=b.getViewport()[d]/100);return Math.ceil(e)},w=function(a,b){return l(a,b)+"px"};f.extend(b,{version:"2.1.5",defaults:{padding:15,margin:20,
3
+ width:800,height:600,minWidth:100,minHeight:100,maxWidth:9999,maxHeight:9999,pixelRatio:1,autoSize:!0,autoHeight:!1,autoWidth:!1,autoResize:!0,autoCenter:!s,fitToView:!0,aspectRatio:!1,topRatio:0.5,leftRatio:0.5,scrolling:"auto",wrapCSS:"",arrows:!0,closeBtn:!0,closeClick:!1,nextClick:!1,mouseWheel:!0,autoPlay:!1,playSpeed:3E3,preload:3,modal:!1,loop:!0,ajax:{dataType:"html",headers:{"X-fancyBox":!0}},iframe:{scrolling:"auto",preload:!0},swf:{wmode:"transparent",allowfullscreen:"true",allowscriptaccess:"always"},
4
+ keys:{next:{13:"left",34:"up",39:"left",40:"up"},prev:{8:"right",33:"down",37:"right",38:"down"},close:[27],play:[32],toggle:[70]},direction:{next:"left",prev:"right"},scrollOutside:!0,index:0,type:null,href:null,content:null,title:null,tpl:{wrap:'<div class="fancybox-wrap" tabIndex="-1"><div class="fancybox-skin"><div class="fancybox-outer"><div class="fancybox-inner"></div></div></div></div>',image:'<img class="fancybox-image" src="{href}" alt="" />',iframe:'<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" frameborder="0" vspace="0" hspace="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen'+
5
+ (I?' allowtransparency="true"':"")+"></iframe>",error:'<p class="fancybox-error">The requested content cannot be loaded.<br/>Please try again later.</p>',closeBtn:'<a title="Close" class="fancybox-item fancybox-close" href="javascript:;"></a>',next:'<a title="Next" class="fancybox-nav fancybox-next" href="javascript:;"><span></span></a>',prev:'<a title="Previous" class="fancybox-nav fancybox-prev" href="javascript:;"><span></span></a>'},openEffect:"fade",openSpeed:250,openEasing:"swing",openOpacity:!0,
6
+ openMethod:"zoomIn",closeEffect:"fade",closeSpeed:250,closeEasing:"swing",closeOpacity:!0,closeMethod:"zoomOut",nextEffect:"elastic",nextSpeed:250,nextEasing:"swing",nextMethod:"changeIn",prevEffect:"elastic",prevSpeed:250,prevEasing:"swing",prevMethod:"changeOut",helpers:{overlay:!0,title:!0},onCancel:f.noop,beforeLoad:f.noop,afterLoad:f.noop,beforeShow:f.noop,afterShow:f.noop,beforeChange:f.noop,beforeClose:f.noop,afterClose:f.noop},group:{},opts:{},previous:null,coming:null,current:null,isActive:!1,
7
+ isOpen:!1,isOpened:!1,wrap:null,skin:null,outer:null,inner:null,player:{timer:null,isActive:!1},ajaxLoad:null,imgPreload:null,transitions:{},helpers:{},open:function(a,d){if(a&&(f.isPlainObject(d)||(d={}),!1!==b.close(!0)))return f.isArray(a)||(a=t(a)?f(a).get():[a]),f.each(a,function(e,c){var k={},g,h,j,m,l;"object"===f.type(c)&&(c.nodeType&&(c=f(c)),t(c)?(k={href:c.data("fancybox-href")||c.attr("href"),title:c.data("fancybox-title")||c.attr("title"),isDom:!0,element:c},f.metadata&&f.extend(!0,k,
8
+ c.metadata())):k=c);g=d.href||k.href||(q(c)?c:null);h=d.title!==v?d.title:k.title||"";m=(j=d.content||k.content)?"html":d.type||k.type;!m&&k.isDom&&(m=c.data("fancybox-type"),m||(m=(m=c.prop("class").match(/fancybox\.(\w+)/))?m[1]:null));q(g)&&(m||(b.isImage(g)?m="image":b.isSWF(g)?m="swf":"#"===g.charAt(0)?m="inline":q(c)&&(m="html",j=c)),"ajax"===m&&(l=g.split(/\s+/,2),g=l.shift(),l=l.shift()));j||("inline"===m?g?j=f(q(g)?g.replace(/.*(?=#[^\s]+$)/,""):g):k.isDom&&(j=c):"html"===m?j=g:!m&&(!g&&
9
+ k.isDom)&&(m="inline",j=c));f.extend(k,{href:g,type:m,content:j,title:h,selector:l});a[e]=k}),b.opts=f.extend(!0,{},b.defaults,d),d.keys!==v&&(b.opts.keys=d.keys?f.extend({},b.defaults.keys,d.keys):!1),b.group=a,b._start(b.opts.index)},cancel:function(){var a=b.coming;a&&!1!==b.trigger("onCancel")&&(b.hideLoading(),b.ajaxLoad&&b.ajaxLoad.abort(),b.ajaxLoad=null,b.imgPreload&&(b.imgPreload.onload=b.imgPreload.onerror=null),a.wrap&&a.wrap.stop(!0,!0).trigger("onReset").remove(),b.coming=null,b.current||
10
+ b._afterZoomOut(a))},close:function(a){b.cancel();!1!==b.trigger("beforeClose")&&(b.unbindEvents(),b.isActive&&(!b.isOpen||!0===a?(f(".fancybox-wrap").stop(!0).trigger("onReset").remove(),b._afterZoomOut()):(b.isOpen=b.isOpened=!1,b.isClosing=!0,f(".fancybox-item, .fancybox-nav").remove(),b.wrap.stop(!0,!0).removeClass("fancybox-opened"),b.transitions[b.current.closeMethod]())))},play:function(a){var d=function(){clearTimeout(b.player.timer)},e=function(){d();b.current&&b.player.isActive&&(b.player.timer=
11
+ setTimeout(b.next,b.current.playSpeed))},c=function(){d();p.unbind(".player");b.player.isActive=!1;b.trigger("onPlayEnd")};if(!0===a||!b.player.isActive&&!1!==a){if(b.current&&(b.current.loop||b.current.index<b.group.length-1))b.player.isActive=!0,p.bind({"onCancel.player beforeClose.player":c,"onUpdate.player":e,"beforeLoad.player":d}),e(),b.trigger("onPlayStart")}else c()},next:function(a){var d=b.current;d&&(q(a)||(a=d.direction.next),b.jumpto(d.index+1,a,"next"))},prev:function(a){var d=b.current;
12
+ d&&(q(a)||(a=d.direction.prev),b.jumpto(d.index-1,a,"prev"))},jumpto:function(a,d,e){var c=b.current;c&&(a=l(a),b.direction=d||c.direction[a>=c.index?"next":"prev"],b.router=e||"jumpto",c.loop&&(0>a&&(a=c.group.length+a%c.group.length),a%=c.group.length),c.group[a]!==v&&(b.cancel(),b._start(a)))},reposition:function(a,d){var e=b.current,c=e?e.wrap:null,k;c&&(k=b._getPosition(d),a&&"scroll"===a.type?(delete k.position,c.stop(!0,!0).animate(k,200)):(c.css(k),e.pos=f.extend({},e.dim,k)))},update:function(a){var d=
13
+ a&&a.type,e=!d||"orientationchange"===d;e&&(clearTimeout(B),B=null);b.isOpen&&!B&&(B=setTimeout(function(){var c=b.current;c&&!b.isClosing&&(b.wrap.removeClass("fancybox-tmp"),(e||"load"===d||"resize"===d&&c.autoResize)&&b._setDimension(),"scroll"===d&&c.canShrink||b.reposition(a),b.trigger("onUpdate"),B=null)},e&&!s?0:300))},toggle:function(a){b.isOpen&&(b.current.fitToView="boolean"===f.type(a)?a:!b.current.fitToView,s&&(b.wrap.removeAttr("style").addClass("fancybox-tmp"),b.trigger("onUpdate")),
14
+ b.update())},hideLoading:function(){p.unbind(".loading");f("#fancybox-loading").remove()},showLoading:function(){var a,d;b.hideLoading();a=f('<div id="fancybox-loading"><div></div></div>').click(b.cancel).appendTo("body");p.bind("keydown.loading",function(a){if(27===(a.which||a.keyCode))a.preventDefault(),b.cancel()});b.defaults.fixed||(d=b.getViewport(),a.css({position:"absolute",top:0.5*d.h+d.y,left:0.5*d.w+d.x}))},getViewport:function(){var a=b.current&&b.current.locked||!1,d={x:n.scrollLeft(),
15
+ y:n.scrollTop()};a?(d.w=a[0].clientWidth,d.h=a[0].clientHeight):(d.w=s&&r.innerWidth?r.innerWidth:n.width(),d.h=s&&r.innerHeight?r.innerHeight:n.height());return d},unbindEvents:function(){b.wrap&&t(b.wrap)&&b.wrap.unbind(".fb");p.unbind(".fb");n.unbind(".fb")},bindEvents:function(){var a=b.current,d;a&&(n.bind("orientationchange.fb"+(s?"":" resize.fb")+(a.autoCenter&&!a.locked?" scroll.fb":""),b.update),(d=a.keys)&&p.bind("keydown.fb",function(e){var c=e.which||e.keyCode,k=e.target||e.srcElement;
16
+ if(27===c&&b.coming)return!1;!e.ctrlKey&&(!e.altKey&&!e.shiftKey&&!e.metaKey&&(!k||!k.type&&!f(k).is("[contenteditable]")))&&f.each(d,function(d,k){if(1<a.group.length&&k[c]!==v)return b[d](k[c]),e.preventDefault(),!1;if(-1<f.inArray(c,k))return b[d](),e.preventDefault(),!1})}),f.fn.mousewheel&&a.mouseWheel&&b.wrap.bind("mousewheel.fb",function(d,c,k,g){for(var h=f(d.target||null),j=!1;h.length&&!j&&!h.is(".fancybox-skin")&&!h.is(".fancybox-wrap");)j=h[0]&&!(h[0].style.overflow&&"hidden"===h[0].style.overflow)&&
17
+ (h[0].clientWidth&&h[0].scrollWidth>h[0].clientWidth||h[0].clientHeight&&h[0].scrollHeight>h[0].clientHeight),h=f(h).parent();if(0!==c&&!j&&1<b.group.length&&!a.canShrink){if(0<g||0<k)b.prev(0<g?"down":"left");else if(0>g||0>k)b.next(0>g?"up":"right");d.preventDefault()}}))},trigger:function(a,d){var e,c=d||b.coming||b.current;if(c){f.isFunction(c[a])&&(e=c[a].apply(c,Array.prototype.slice.call(arguments,1)));if(!1===e)return!1;c.helpers&&f.each(c.helpers,function(d,e){if(e&&b.helpers[d]&&f.isFunction(b.helpers[d][a]))b.helpers[d][a](f.extend(!0,
18
+ {},b.helpers[d].defaults,e),c)});p.trigger(a)}},isImage:function(a){return q(a)&&a.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i)},isSWF:function(a){return q(a)&&a.match(/\.(swf)((\?|#).*)?$/i)},_start:function(a){var d={},e,c;a=l(a);e=b.group[a]||null;if(!e)return!1;d=f.extend(!0,{},b.opts,e);e=d.margin;c=d.padding;"number"===f.type(e)&&(d.margin=[e,e,e,e]);"number"===f.type(c)&&(d.padding=[c,c,c,c]);d.modal&&f.extend(!0,d,{closeBtn:!1,closeClick:!1,nextClick:!1,arrows:!1,
19
+ mouseWheel:!1,keys:null,helpers:{overlay:{closeClick:!1}}});d.autoSize&&(d.autoWidth=d.autoHeight=!0);"auto"===d.width&&(d.autoWidth=!0);"auto"===d.height&&(d.autoHeight=!0);d.group=b.group;d.index=a;b.coming=d;if(!1===b.trigger("beforeLoad"))b.coming=null;else{c=d.type;e=d.href;if(!c)return b.coming=null,b.current&&b.router&&"jumpto"!==b.router?(b.current.index=a,b[b.router](b.direction)):!1;b.isActive=!0;if("image"===c||"swf"===c)d.autoHeight=d.autoWidth=!1,d.scrolling="visible";"image"===c&&(d.aspectRatio=
20
+ !0);"iframe"===c&&s&&(d.scrolling="scroll");d.wrap=f(d.tpl.wrap).addClass("fancybox-"+(s?"mobile":"desktop")+" fancybox-type-"+c+" fancybox-tmp "+d.wrapCSS).appendTo(d.parent||"body");f.extend(d,{skin:f(".fancybox-skin",d.wrap),outer:f(".fancybox-outer",d.wrap),inner:f(".fancybox-inner",d.wrap)});f.each(["Top","Right","Bottom","Left"],function(a,b){d.skin.css("padding"+b,w(d.padding[a]))});b.trigger("onReady");if("inline"===c||"html"===c){if(!d.content||!d.content.length)return b._error("content")}else if(!e)return b._error("href");
21
+ "image"===c?b._loadImage():"ajax"===c?b._loadAjax():"iframe"===c?b._loadIframe():b._afterLoad()}},_error:function(a){f.extend(b.coming,{type:"html",autoWidth:!0,autoHeight:!0,minWidth:0,minHeight:0,scrolling:"no",hasError:a,content:b.coming.tpl.error});b._afterLoad()},_loadImage:function(){var a=b.imgPreload=new Image;a.onload=function(){this.onload=this.onerror=null;b.coming.width=this.width/b.opts.pixelRatio;b.coming.height=this.height/b.opts.pixelRatio;b._afterLoad()};a.onerror=function(){this.onload=
22
+ this.onerror=null;b._error("image")};a.src=b.coming.href;!0!==a.complete&&b.showLoading()},_loadAjax:function(){var a=b.coming;b.showLoading();b.ajaxLoad=f.ajax(f.extend({},a.ajax,{url:a.href,error:function(a,e){b.coming&&"abort"!==e?b._error("ajax",a):b.hideLoading()},success:function(d,e){"success"===e&&(a.content=d,b._afterLoad())}}))},_loadIframe:function(){var a=b.coming,d=f(a.tpl.iframe.replace(/\{rnd\}/g,(new Date).getTime())).attr("scrolling",s?"auto":a.iframe.scrolling).attr("src",a.href);
23
+ f(a.wrap).bind("onReset",function(){try{f(this).find("iframe").hide().attr("src","//about:blank").end().empty()}catch(a){}});a.iframe.preload&&(b.showLoading(),d.one("load",function(){f(this).data("ready",1);s||f(this).bind("load.fb",b.update);f(this).parents(".fancybox-wrap").width("100%").removeClass("fancybox-tmp").show();b._afterLoad()}));a.content=d.appendTo(a.inner);a.iframe.preload||b._afterLoad()},_preloadImages:function(){var a=b.group,d=b.current,e=a.length,c=d.preload?Math.min(d.preload,
24
+ e-1):0,f,g;for(g=1;g<=c;g+=1)f=a[(d.index+g)%e],"image"===f.type&&f.href&&((new Image).src=f.href)},_afterLoad:function(){var a=b.coming,d=b.current,e,c,k,g,h;b.hideLoading();if(a&&!1!==b.isActive)if(!1===b.trigger("afterLoad",a,d))a.wrap.stop(!0).trigger("onReset").remove(),b.coming=null;else{d&&(b.trigger("beforeChange",d),d.wrap.stop(!0).removeClass("fancybox-opened").find(".fancybox-item, .fancybox-nav").remove());b.unbindEvents();e=a.content;c=a.type;k=a.scrolling;f.extend(b,{wrap:a.wrap,skin:a.skin,
25
+ outer:a.outer,inner:a.inner,current:a,previous:d});g=a.href;switch(c){case "inline":case "ajax":case "html":a.selector?e=f("<div>").html(e).find(a.selector):t(e)&&(e.data("fancybox-placeholder")||e.data("fancybox-placeholder",f('<div class="fancybox-placeholder"></div>').insertAfter(e).hide()),e=e.show().detach(),a.wrap.bind("onReset",function(){f(this).find(e).length&&e.hide().replaceAll(e.data("fancybox-placeholder")).data("fancybox-placeholder",!1)}));break;case "image":e=a.tpl.image.replace("{href}",
26
+ g);break;case "swf":e='<object id="fancybox-swf" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%"><param name="movie" value="'+g+'"></param>',h="",f.each(a.swf,function(a,b){e+='<param name="'+a+'" value="'+b+'"></param>';h+=" "+a+'="'+b+'"'}),e+='<embed src="'+g+'" type="application/x-shockwave-flash" width="100%" height="100%"'+h+"></embed></object>"}(!t(e)||!e.parent().is(a.inner))&&a.inner.append(e);b.trigger("beforeShow");a.inner.css("overflow","yes"===k?"scroll":
27
+ "no"===k?"hidden":k);b._setDimension();b.reposition();b.isOpen=!1;b.coming=null;b.bindEvents();if(b.isOpened){if(d.prevMethod)b.transitions[d.prevMethod]()}else f(".fancybox-wrap").not(a.wrap).stop(!0).trigger("onReset").remove();b.transitions[b.isOpened?a.nextMethod:a.openMethod]();b._preloadImages()}},_setDimension:function(){var a=b.getViewport(),d=0,e=!1,c=!1,e=b.wrap,k=b.skin,g=b.inner,h=b.current,c=h.width,j=h.height,m=h.minWidth,u=h.minHeight,n=h.maxWidth,p=h.maxHeight,s=h.scrolling,q=h.scrollOutside?
28
+ h.scrollbarWidth:0,x=h.margin,y=l(x[1]+x[3]),r=l(x[0]+x[2]),v,z,t,C,A,F,B,D,H;e.add(k).add(g).width("auto").height("auto").removeClass("fancybox-tmp");x=l(k.outerWidth(!0)-k.width());v=l(k.outerHeight(!0)-k.height());z=y+x;t=r+v;C=E(c)?(a.w-z)*l(c)/100:c;A=E(j)?(a.h-t)*l(j)/100:j;if("iframe"===h.type){if(H=h.content,h.autoHeight&&1===H.data("ready"))try{H[0].contentWindow.document.location&&(g.width(C).height(9999),F=H.contents().find("body"),q&&F.css("overflow-x","hidden"),A=F.outerHeight(!0))}catch(G){}}else if(h.autoWidth||
29
+ h.autoHeight)g.addClass("fancybox-tmp"),h.autoWidth||g.width(C),h.autoHeight||g.height(A),h.autoWidth&&(C=g.width()),h.autoHeight&&(A=g.height()),g.removeClass("fancybox-tmp");c=l(C);j=l(A);D=C/A;m=l(E(m)?l(m,"w")-z:m);n=l(E(n)?l(n,"w")-z:n);u=l(E(u)?l(u,"h")-t:u);p=l(E(p)?l(p,"h")-t:p);F=n;B=p;h.fitToView&&(n=Math.min(a.w-z,n),p=Math.min(a.h-t,p));z=a.w-y;r=a.h-r;h.aspectRatio?(c>n&&(c=n,j=l(c/D)),j>p&&(j=p,c=l(j*D)),c<m&&(c=m,j=l(c/D)),j<u&&(j=u,c=l(j*D))):(c=Math.max(m,Math.min(c,n)),h.autoHeight&&
30
+ "iframe"!==h.type&&(g.width(c),j=g.height()),j=Math.max(u,Math.min(j,p)));if(h.fitToView)if(g.width(c).height(j),e.width(c+x),a=e.width(),y=e.height(),h.aspectRatio)for(;(a>z||y>r)&&(c>m&&j>u)&&!(19<d++);)j=Math.max(u,Math.min(p,j-10)),c=l(j*D),c<m&&(c=m,j=l(c/D)),c>n&&(c=n,j=l(c/D)),g.width(c).height(j),e.width(c+x),a=e.width(),y=e.height();else c=Math.max(m,Math.min(c,c-(a-z))),j=Math.max(u,Math.min(j,j-(y-r)));q&&("auto"===s&&j<A&&c+x+q<z)&&(c+=q);g.width(c).height(j);e.width(c+x);a=e.width();
31
+ y=e.height();e=(a>z||y>r)&&c>m&&j>u;c=h.aspectRatio?c<F&&j<B&&c<C&&j<A:(c<F||j<B)&&(c<C||j<A);f.extend(h,{dim:{width:w(a),height:w(y)},origWidth:C,origHeight:A,canShrink:e,canExpand:c,wPadding:x,hPadding:v,wrapSpace:y-k.outerHeight(!0),skinSpace:k.height()-j});!H&&(h.autoHeight&&j>u&&j<p&&!c)&&g.height("auto")},_getPosition:function(a){var d=b.current,e=b.getViewport(),c=d.margin,f=b.wrap.width()+c[1]+c[3],g=b.wrap.height()+c[0]+c[2],c={position:"absolute",top:c[0],left:c[3]};d.autoCenter&&d.fixed&&
32
+ !a&&g<=e.h&&f<=e.w?c.position="fixed":d.locked||(c.top+=e.y,c.left+=e.x);c.top=w(Math.max(c.top,c.top+(e.h-g)*d.topRatio));c.left=w(Math.max(c.left,c.left+(e.w-f)*d.leftRatio));return c},_afterZoomIn:function(){var a=b.current;a&&(b.isOpen=b.isOpened=!0,b.wrap.css("overflow","visible").addClass("fancybox-opened"),b.update(),(a.closeClick||a.nextClick&&1<b.group.length)&&b.inner.css("cursor","pointer").bind("click.fb",function(d){!f(d.target).is("a")&&!f(d.target).parent().is("a")&&(d.preventDefault(),
33
+ b[a.closeClick?"close":"next"]())}),a.closeBtn&&f(a.tpl.closeBtn).appendTo(b.skin).bind("click.fb",function(a){a.preventDefault();b.close()}),a.arrows&&1<b.group.length&&((a.loop||0<a.index)&&f(a.tpl.prev).appendTo(b.outer).bind("click.fb",b.prev),(a.loop||a.index<b.group.length-1)&&f(a.tpl.next).appendTo(b.outer).bind("click.fb",b.next)),b.trigger("afterShow"),!a.loop&&a.index===a.group.length-1?b.play(!1):b.opts.autoPlay&&!b.player.isActive&&(b.opts.autoPlay=!1,b.play()))},_afterZoomOut:function(a){a=
34
+ a||b.current;f(".fancybox-wrap").trigger("onReset").remove();f.extend(b,{group:{},opts:{},router:!1,current:null,isActive:!1,isOpened:!1,isOpen:!1,isClosing:!1,wrap:null,skin:null,outer:null,inner:null});b.trigger("afterClose",a)}});b.transitions={getOrigPosition:function(){var a=b.current,d=a.element,e=a.orig,c={},f=50,g=50,h=a.hPadding,j=a.wPadding,m=b.getViewport();!e&&(a.isDom&&d.is(":visible"))&&(e=d.find("img:first"),e.length||(e=d));t(e)?(c=e.offset(),e.is("img")&&(f=e.outerWidth(),g=e.outerHeight())):
35
+ (c.top=m.y+(m.h-g)*a.topRatio,c.left=m.x+(m.w-f)*a.leftRatio);if("fixed"===b.wrap.css("position")||a.locked)c.top-=m.y,c.left-=m.x;return c={top:w(c.top-h*a.topRatio),left:w(c.left-j*a.leftRatio),width:w(f+j),height:w(g+h)}},step:function(a,d){var e,c,f=d.prop;c=b.current;var g=c.wrapSpace,h=c.skinSpace;if("width"===f||"height"===f)e=d.end===d.start?1:(a-d.start)/(d.end-d.start),b.isClosing&&(e=1-e),c="width"===f?c.wPadding:c.hPadding,c=a-c,b.skin[f](l("width"===f?c:c-g*e)),b.inner[f](l("width"===
36
+ f?c:c-g*e-h*e))},zoomIn:function(){var a=b.current,d=a.pos,e=a.openEffect,c="elastic"===e,k=f.extend({opacity:1},d);delete k.position;c?(d=this.getOrigPosition(),a.openOpacity&&(d.opacity=0.1)):"fade"===e&&(d.opacity=0.1);b.wrap.css(d).animate(k,{duration:"none"===e?0:a.openSpeed,easing:a.openEasing,step:c?this.step:null,complete:b._afterZoomIn})},zoomOut:function(){var a=b.current,d=a.closeEffect,e="elastic"===d,c={opacity:0.1};e&&(c=this.getOrigPosition(),a.closeOpacity&&(c.opacity=0.1));b.wrap.animate(c,
37
+ {duration:"none"===d?0:a.closeSpeed,easing:a.closeEasing,step:e?this.step:null,complete:b._afterZoomOut})},changeIn:function(){var a=b.current,d=a.nextEffect,e=a.pos,c={opacity:1},f=b.direction,g;e.opacity=0.1;"elastic"===d&&(g="down"===f||"up"===f?"top":"left","down"===f||"right"===f?(e[g]=w(l(e[g])-200),c[g]="+=200px"):(e[g]=w(l(e[g])+200),c[g]="-=200px"));"none"===d?b._afterZoomIn():b.wrap.css(e).animate(c,{duration:a.nextSpeed,easing:a.nextEasing,complete:b._afterZoomIn})},changeOut:function(){var a=
38
+ b.previous,d=a.prevEffect,e={opacity:0.1},c=b.direction;"elastic"===d&&(e["down"===c||"up"===c?"top":"left"]=("up"===c||"left"===c?"-":"+")+"=200px");a.wrap.animate(e,{duration:"none"===d?0:a.prevSpeed,easing:a.prevEasing,complete:function(){f(this).trigger("onReset").remove()}})}};b.helpers.overlay={defaults:{closeClick:!0,speedOut:200,showEarly:!0,css:{},locked:!s,fixed:!0},overlay:null,fixed:!1,el:f("html"),create:function(a){a=f.extend({},this.defaults,a);this.overlay&&this.close();this.overlay=
39
+ f('<div class="fancybox-overlay"></div>').appendTo(b.coming?b.coming.parent:a.parent);this.fixed=!1;a.fixed&&b.defaults.fixed&&(this.overlay.addClass("fancybox-overlay-fixed"),this.fixed=!0)},open:function(a){var d=this;a=f.extend({},this.defaults,a);this.overlay?this.overlay.unbind(".overlay").width("auto").height("auto"):this.create(a);this.fixed||(n.bind("resize.overlay",f.proxy(this.update,this)),this.update());a.closeClick&&this.overlay.bind("click.overlay",function(a){if(f(a.target).hasClass("fancybox-overlay"))return b.isActive?
40
+ b.close():d.close(),!1});this.overlay.css(a.css).show()},close:function(){var a,b;n.unbind("resize.overlay");this.el.hasClass("fancybox-lock")&&(f(".fancybox-margin").removeClass("fancybox-margin"),a=n.scrollTop(),b=n.scrollLeft(),this.el.removeClass("fancybox-lock"),n.scrollTop(a).scrollLeft(b));f(".fancybox-overlay").remove().hide();f.extend(this,{overlay:null,fixed:!1})},update:function(){var a="100%",b;this.overlay.width(a).height("100%");I?(b=Math.max(G.documentElement.offsetWidth,G.body.offsetWidth),
41
+ p.width()>b&&(a=p.width())):p.width()>n.width()&&(a=p.width());this.overlay.width(a).height(p.height())},onReady:function(a,b){var e=this.overlay;f(".fancybox-overlay").stop(!0,!0);e||this.create(a);a.locked&&(this.fixed&&b.fixed)&&(e||(this.margin=p.height()>n.height()?f("html").css("margin-right").replace("px",""):!1),b.locked=this.overlay.append(b.wrap),b.fixed=!1);!0===a.showEarly&&this.beforeShow.apply(this,arguments)},beforeShow:function(a,b){var e,c;b.locked&&(!1!==this.margin&&(f("*").filter(function(){return"fixed"===
42
+ f(this).css("position")&&!f(this).hasClass("fancybox-overlay")&&!f(this).hasClass("fancybox-wrap")}).addClass("fancybox-margin"),this.el.addClass("fancybox-margin")),e=n.scrollTop(),c=n.scrollLeft(),this.el.addClass("fancybox-lock"),n.scrollTop(e).scrollLeft(c));this.open(a)},onUpdate:function(){this.fixed||this.update()},afterClose:function(a){this.overlay&&!b.coming&&this.overlay.fadeOut(a.speedOut,f.proxy(this.close,this))}};b.helpers.title={defaults:{type:"float",position:"bottom"},beforeShow:function(a){var d=
43
+ b.current,e=d.title,c=a.type;f.isFunction(e)&&(e=e.call(d.element,d));if(q(e)&&""!==f.trim(e)){d=f('<div class="fancybox-title fancybox-title-'+c+'-wrap">'+e+"</div>");switch(c){case "inside":c=b.skin;break;case "outside":c=b.wrap;break;case "over":c=b.inner;break;default:c=b.skin,d.appendTo("body"),I&&d.width(d.width()),d.wrapInner('<span class="child"></span>'),b.current.margin[2]+=Math.abs(l(d.css("margin-bottom")))}d["top"===a.position?"prependTo":"appendTo"](c)}}};f.fn.fancybox=function(a){var d,
44
+ e=f(this),c=this.selector||"",k=function(g){var h=f(this).blur(),j=d,k,l;!g.ctrlKey&&(!g.altKey&&!g.shiftKey&&!g.metaKey)&&!h.is(".fancybox-wrap")&&(k=a.groupAttr||"data-fancybox-group",l=h.attr(k),l||(k="rel",l=h.get(0)[k]),l&&(""!==l&&"nofollow"!==l)&&(h=c.length?f(c):e,h=h.filter("["+k+'="'+l+'"]'),j=h.index(this)),a.index=j,!1!==b.open(h,a)&&g.preventDefault())};a=a||{};d=a.index||0;!c||!1===a.live?e.unbind("click.fb-start").bind("click.fb-start",k):p.undelegate(c,"click.fb-start").delegate(c+
45
+ ":not('.fancybox-item, .fancybox-nav')","click.fb-start",k);this.filter("[data-fancybox-start=1]").trigger("click");return this};p.ready(function(){var a,d;f.scrollbarWidth===v&&(f.scrollbarWidth=function(){var a=f('<div style="width:50px;height:50px;overflow:auto"><div/></div>').appendTo("body"),b=a.children(),b=b.innerWidth()-b.height(99).innerWidth();a.remove();return b});if(f.support.fixedPosition===v){a=f.support;d=f('<div style="position:fixed;top:20px;"></div>').appendTo("body");var e=20===
46
+ d[0].offsetTop||15===d[0].offsetTop;d.remove();a.fixedPosition=e}f.extend(b.defaults,{scrollbarWidth:f.scrollbarWidth(),fixed:f.support.fixedPosition,parent:f("body")});a=f(r).width();J.addClass("fancybox-lock-test");d=f(r).width();J.removeClass("fancybox-lock-test");f("<style type='text/css'>.fancybox-margin{margin-right:"+(d-a)+"px;}</style>").appendTo("head")})})(window,document,jQuery);
includes/lib/images/prettyPhoto/dark_rounded/btnNext.png ADDED
Binary file
includes/lib/images/prettyPhoto/dark_rounded/btnPrevious.png ADDED
Binary file
includes/lib/images/prettyPhoto/dark_rounded/contentPattern.png ADDED
Binary file
includes/lib/images/prettyPhoto/dark_rounded/default_thumbnail.gif ADDED
Binary file
includes/lib/images/prettyPhoto/dark_rounded/loader.gif ADDED
Binary file
includes/lib/images/prettyPhoto/dark_rounded/sprite.png ADDED
Binary file
includes/lib/images/prettyPhoto/dark_square/btnNext.png ADDED
Binary file
includes/lib/images/prettyPhoto/dark_square/btnPrevious.png ADDED
Binary file
includes/lib/images/prettyPhoto/dark_square/contentPattern.png ADDED
Binary file
includes/lib/images/prettyPhoto/dark_square/default_thumbnail.gif ADDED
Binary file
includes/lib/images/prettyPhoto/dark_square/loader.gif ADDED
Binary file
includes/lib/images/prettyPhoto/dark_square/sprite.png ADDED
Binary file
includes/lib/images/prettyPhoto/default/default_thumb.png ADDED
Binary file
includes/lib/images/prettyPhoto/default/loader.gif ADDED
Binary file
includes/lib/images/prettyPhoto/default/sprite.png ADDED
Binary file
includes/lib/images/prettyPhoto/default/sprite_next.png ADDED
Binary file
includes/lib/images/prettyPhoto/default/sprite_prev.png ADDED
Binary file
includes/lib/images/prettyPhoto/default/sprite_x.png ADDED
Binary file
includes/lib/images/prettyPhoto/default/sprite_y.png ADDED
Binary file
includes/lib/images/prettyPhoto/facebook/btnNext.png ADDED
Binary file
includes/lib/images/prettyPhoto/facebook/btnPrevious.png ADDED
Binary file
includes/lib/images/prettyPhoto/facebook/contentPatternBottom.png ADDED
Binary file
includes/lib/images/prettyPhoto/facebook/contentPatternLeft.png ADDED
Binary file
includes/lib/images/prettyPhoto/facebook/contentPatternRight.png ADDED
Binary file
includes/lib/images/prettyPhoto/facebook/contentPatternTop.png ADDED
Binary file
includes/lib/images/prettyPhoto/facebook/default_thumbnail.gif ADDED
Binary file
includes/lib/images/prettyPhoto/facebook/loader.gif ADDED
Binary file
includes/lib/images/prettyPhoto/facebook/sprite.png ADDED
Binary file
includes/lib/images/prettyPhoto/light_rounded/btnNext.png ADDED
Binary file
includes/lib/images/prettyPhoto/light_rounded/btnPrevious.png ADDED
Binary file
includes/lib/images/prettyPhoto/light_rounded/default_thumbnail.gif ADDED
Binary file
includes/lib/images/prettyPhoto/light_rounded/loader.gif ADDED
Binary file
includes/lib/images/prettyPhoto/light_rounded/sprite.png ADDED
Binary file
includes/lib/images/prettyPhoto/light_square/btnNext.png ADDED
Binary file
includes/lib/images/prettyPhoto/light_square/btnPrevious.png ADDED
Binary file
includes/lib/images/prettyPhoto/light_square/default_thumbnail.gif ADDED
Binary file
includes/lib/images/prettyPhoto/light_square/loader.gif ADDED
Binary file
includes/lib/images/prettyPhoto/light_square/sprite.png ADDED
Binary file
includes/lib/prettyphoto/jquery.prettyPhoto.js ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ /* ------------------------------------------------------------------------
2
+ Class: prettyPhoto
3
+ Use: Lightbox clone for jQuery
4
+ Author: Stephane Caron (http://www.no-margin-for-errors.com)
5
+ Version: 3.1.5
6
+ ------------------------------------------------------------------------- */
7
+ (function(e){function t(){var e=location.href;hashtag=e.indexOf("#prettyPhoto")!==-1?decodeURI(e.substring(e.indexOf("#prettyPhoto")+1,e.length)):false;return hashtag}function n(){if(typeof theRel=="undefined")return;location.hash=theRel+"/"+rel_index+"/"}function r(){if(location.href.indexOf("#prettyPhoto")!==-1)location.hash="prettyPhoto"}function i(e,t){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var n="[\\?&]"+e+"=([^&#]*)";var r=new RegExp(n);var i=r.exec(t);return i==null?"":i[1]}e.prettyPhoto={version:"3.1.5"};e.fn.prettyPhoto=function(s){function g(){e(".pp_loaderIcon").hide();projectedTop=scroll_pos["scrollTop"]+(d/2-a["containerHeight"]/2);if(projectedTop<0)projectedTop=0;$ppt.fadeTo(settings.animation_speed,1);$pp_pic_holder.find(".pp_content").animate({height:a["contentHeight"],width:a["contentWidth"]},settings.animation_speed);$pp_pic_holder.animate({top:projectedTop,left:v/2-a["containerWidth"]/2<0?0:v/2-a["containerWidth"]/2,width:a["containerWidth"]},settings.animation_speed,function(){$pp_pic_holder.find(".pp_hoverContainer,#fullResImage").height(a["height"]).width(a["width"]);$pp_pic_holder.find(".pp_fade").fadeIn(settings.animation_speed);if(isSet&&S(pp_images[set_position])=="image"){$pp_pic_holder.find(".pp_hoverContainer").show()}else{$pp_pic_holder.find(".pp_hoverContainer").hide()}if(settings.allow_expand){if(a["resized"]){e("a.pp_expand,a.pp_contract").show()}else{e("a.pp_expand").hide()}}if(settings.autoplay_slideshow&&!m&&!f)e.prettyPhoto.startSlideshow();settings.changepicturecallback();f=true});C();s.ajaxcallback()}function y(t){$pp_pic_holder.find("#pp_full_res object,#pp_full_res embed").css("visibility","hidden");$pp_pic_holder.find(".pp_fade").fadeOut(settings.animation_speed,function(){e(".pp_loaderIcon").show();t()})}function b(t){t>1?e(".pp_nav").show():e(".pp_nav").hide()}function w(e,t){resized=false;E(e,t);imageWidth=e,imageHeight=t;if((p>v||h>d)&&doresize&&settings.allow_resize&&!u){resized=true,fitting=false;while(!fitting){if(p>v){imageWidth=v-200;imageHeight=t/e*imageWidth}else if(h>d){imageHeight=d-200;imageWidth=e/t*imageHeight}else{fitting=true}h=imageHeight,p=imageWidth}if(p>v||h>d){w(p,h)}E(imageWidth,imageHeight)}return{width:Math.floor(imageWidth),height:Math.floor(imageHeight),containerHeight:Math.floor(h),containerWidth:Math.floor(p)+settings.horizontal_padding*2,contentHeight:Math.floor(l),contentWidth:Math.floor(c),resized:resized}}function E(t,n){t=parseFloat(t);n=parseFloat(n);$pp_details=$pp_pic_holder.find(".pp_details");$pp_details.width(t);detailsHeight=parseFloat($pp_details.css("marginTop"))+parseFloat($pp_details.css("marginBottom"));$pp_details=$pp_details.clone().addClass(settings.theme).width(t).appendTo(e("body")).css({position:"absolute",top:-1e4});detailsHeight+=$pp_details.height();detailsHeight=detailsHeight<=34?36:detailsHeight;$pp_details.remove();$pp_title=$pp_pic_holder.find(".ppt");$pp_title.width(t);titleHeight=parseFloat($pp_title.css("marginTop"))+parseFloat($pp_title.css("marginBottom"));$pp_title=$pp_title.clone().appendTo(e("body")).css({position:"absolute",top:-1e4});titleHeight+=$pp_title.height();$pp_title.remove();l=n+detailsHeight;c=t;h=l+titleHeight+$pp_pic_holder.find(".pp_top").height()+$pp_pic_holder.find(".pp_bottom").height();p=t}function S(e){if(e.match(/youtube\.com\/watch/i)||e.match(/youtu\.be/i)){return"youtube"}else if(e.match(/vimeo\.com/i)){return"vimeo"}else if(e.match(/\b.mov\b/i)){return"quicktime"}else if(e.match(/\b.swf\b/i)){return"flash"}else if(e.match(/\biframe=true\b/i)){return"iframe"}else if(e.match(/\bajax=true\b/i)){return"ajax"}else if(e.match(/\bcustom=true\b/i)){return"custom"}else if(e.substr(0,1)=="#"){return"inline"}else{return"image"}}function x(){if(doresize&&typeof $pp_pic_holder!="undefined"){scroll_pos=T();contentHeight=$pp_pic_holder.height(),contentwidth=$pp_pic_holder.width();projectedTop=d/2+scroll_pos["scrollTop"]-contentHeight/2;if(projectedTop<0)projectedTop=0;if(contentHeight>d)return;$pp_pic_holder.css({top:projectedTop,left:v/2+scroll_pos["scrollLeft"]-contentwidth/2})}}function T(){if(self.pageYOffset){return{scrollTop:self.pageYOffset,scrollLeft:self.pageXOffset}}else if(document.documentElement&&document.documentElement.scrollTop){return{scrollTop:document.documentElement.scrollTop,scrollLeft:document.documentElement.scrollLeft}}else if(document.body){return{scrollTop:document.body.scrollTop,scrollLeft:document.body.scrollLeft}}}function N(){d=e(window).height(),v=e(window).width();if(typeof $pp_overlay!="undefined")$pp_overlay.height(e(document).height()).width(v)}function C(){if(isSet&&settings.overlay_gallery&&S(pp_images[set_position])=="image"){itemWidth=52+5;navWidth=settings.theme=="facebook"||settings.theme=="pp_default"?50:30;itemsPerPage=Math.floor((a["containerWidth"]-100-navWidth)/itemWidth);itemsPerPage=itemsPerPage<pp_images.length?itemsPerPage:pp_images.length;totalPage=Math.ceil(pp_images.length/itemsPerPage)-1;if(totalPage==0){navWidth=0;$pp_gallery.find(".pp_arrow_next,.pp_arrow_previous").hide()}else{$pp_gallery.find(".pp_arrow_next,.pp_arrow_previous").show()}galleryWidth=itemsPerPage*itemWidth;fullGalleryWidth=pp_images.length*itemWidth;$pp_gallery.css("margin-left",-(galleryWidth/2+navWidth/2)).find("div:first").width(galleryWidth+5).find("ul").width(fullGalleryWidth).find("li.selected").removeClass("selected");goToPage=Math.floor(set_position/itemsPerPage)<totalPage?Math.floor(set_position/itemsPerPage):totalPage;e.prettyPhoto.changeGalleryPage(goToPage);$pp_gallery_li.filter(":eq("+set_position+")").addClass("selected")}else{$pp_pic_holder.find(".pp_content").unbind("mouseenter mouseleave")}}function k(t){if(settings.social_tools)facebook_like_link=settings.social_tools.replace("{location_href}",encodeURIComponent(location.href));settings.markup=settings.markup.replace("{pp_social}","");e("body").append(settings.markup);$pp_pic_holder=e(".pp_pic_holder"),$ppt=e(".ppt"),$pp_overlay=e("div.pp_overlay");if(isSet&&settings.overlay_gallery){currentGalleryPage=0;toInject="";for(var n=0;n<pp_images.length;n++){if(!pp_images[n].match(/\b(jpg|jpeg|png|gif)\b/gi)){classname="default";img_src=""}else{classname="";img_src=pp_images[n]}toInject+="<li class='"+classname+"'><a href='#'><img src='"+img_src+"' width='50' alt='' /></a></li>"}toInject=settings.gallery_markup.replace(/{gallery}/g,toInject);$pp_pic_holder.find("#pp_full_res").after(toInject);$pp_gallery=e(".pp_pic_holder .pp_gallery"),$pp_gallery_li=$pp_gallery.find("li");$pp_gallery.find(".pp_arrow_next").click(function(){e.prettyPhoto.changeGalleryPage("next");e.prettyPhoto.stopSlideshow();return false});$pp_gallery.find(".pp_arrow_previous").click(function(){e.prettyPhoto.changeGalleryPage("previous");e.prettyPhoto.stopSlideshow();return false});$pp_pic_holder.find(".pp_content").hover(function(){$pp_pic_holder.find(".pp_gallery:not(.disabled)").fadeIn()},function(){$pp_pic_holder.find(".pp_gallery:not(.disabled)").fadeOut()});itemWidth=52+5;$pp_gallery_li.each(function(t){e(this).find("a").click(function(){e.prettyPhoto.changePage(t);e.prettyPhoto.stopSlideshow();return false})})}if(settings.slideshow){$pp_pic_holder.find(".pp_nav").prepend('<a href="#" class="pp_play">Play</a>');$pp_pic_holder.find(".pp_nav .pp_play").click(function(){e.prettyPhoto.startSlideshow();return false})}$pp_pic_holder.attr("class","pp_pic_holder "+settings.theme);$pp_overlay.css({opacity:0,height:e(document).height(),width:e(window).width()}).bind("click",function(){if(!settings.modal)e.prettyPhoto.close()});e("a.pp_close").bind("click",function(){e.prettyPhoto.close();return false});if(settings.allow_expand){e("a.pp_expand").bind("click",function(t){if(e(this).hasClass("pp_expand")){e(this).removeClass("pp_expand").addClass("pp_contract");doresize=false}else{e(this).removeClass("pp_contract").addClass("pp_expand");doresize=true}y(function(){e.prettyPhoto.open()});return false})}$pp_pic_holder.find(".pp_previous, .pp_nav .pp_arrow_previous").bind("click",function(){e.prettyPhoto.changePage("previous");e.prettyPhoto.stopSlideshow();return false});$pp_pic_holder.find(".pp_next, .pp_nav .pp_arrow_next").bind("click",function(){e.prettyPhoto.changePage("next");e.prettyPhoto.stopSlideshow();return false});x()}s=jQuery.extend({hook:"rel",animation_speed:"fast",ajaxcallback:function(){},slideshow:5e3,autoplay_slideshow:false,opacity:.8,show_title:true,allow_resize:true,allow_expand:true,default_width:500,default_height:344,counter_separator_label:"/",theme:"pp_default",horizontal_padding:20,hideflash:false,wmode:"opaque",autoplay:true,modal:false,deeplinking:true,overlay_gallery:true,overlay_gallery_max:30,keyboard_shortcuts:true,changepicturecallback:function(){},callback:function(){},ie6_fallback:true,markup:'<div class="pp_pic_holder"> <div class="ppt"> </div> <div class="pp_top"> <div class="pp_left"></div> <div class="pp_middle"></div> <div class="pp_right"></div> </div> <div class="pp_content_container"> <div class="pp_left"> <div class="pp_right"> <div class="pp_content"> <div class="pp_loaderIcon"></div> <div class="pp_fade"> <a href="#" class="pp_expand" title="Expand the image">Expand</a> <div class="pp_hoverContainer"> <a class="pp_next" href="#">next</a> <a class="pp_previous" href="#">previous</a> </div> <div id="pp_full_res"></div> <div class="pp_details"> <div class="pp_nav"> <a href="#" class="pp_arrow_previous">Previous</a> <p class="currentTextHolder">0/0</p> <a href="#" class="pp_arrow_next">Next</a> </div> <p class="pp_description"></p> <div class="pp_social">{pp_social}</div> <a class="pp_close" href="#">Close</a> </div> </div> </div> </div> </div> </div> <div class="pp_bottom"> <div class="pp_left"></div> <div class="pp_middle"></div> <div class="pp_right"></div> </div> </div> <div class="pp_overlay"></div>',gallery_markup:'<div class="pp_gallery"> <a href="#" class="pp_arrow_previous">Previous</a> <div> <ul> {gallery} </ul> </div> <a href="#" class="pp_arrow_next">Next</a> </div>',image_markup:'<img id="fullResImage" src="{path}" />',flash_markup:'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="{width}" height="{height}"><param name="wmode" value="{wmode}" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="{path}" /><embed src="{path}" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="{width}" height="{height}" wmode="{wmode}"></embed></object>',quicktime_markup:'<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" height="{height}" width="{width}"><param name="src" value="{path}"><param name="autoplay" value="{autoplay}"><param name="type" value="video/quicktime"><embed src="{path}" height="{height}" width="{width}" autoplay="{autoplay}" type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/"></embed></object>',iframe_markup:'<iframe src ="{path}" width="{width}" height="{height}" frameborder="no"></iframe>',inline_markup:'<div class="pp_inline">{content}</div>',custom_markup:"",social_tools:'<div class="twitter"><a href="http://twitter.com/share" class="twitter-share-button" data-count="none">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div class="facebook"><iframe src="//www.facebook.com/plugins/like.php?locale=en_US&href={location_href}&layout=button_count&show_faces=true&width=500&action=like&font&colorscheme=light&height=23" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:500px; height:23px;" allowTransparency="true"></iframe></div>'},s);var o=this,u=false,a,f,l,c,h,p,d=e(window).height(),v=e(window).width(),m;doresize=true,scroll_pos=T();e(window).unbind("resize.prettyphoto").bind("resize.prettyphoto",function(){x();N()});if(s.keyboard_shortcuts){e(document).unbind("keydown.prettyphoto").bind("keydown.prettyphoto",function(t){if(typeof $pp_pic_holder!="undefined"){if($pp_pic_holder.is(":visible")){switch(t.keyCode){case 37:e.prettyPhoto.changePage("previous");t.preventDefault();break;case 39:e.prettyPhoto.changePage("next");t.preventDefault();break;case 27:if(!settings.modal)e.prettyPhoto.close();t.preventDefault();break}}}})}e.prettyPhoto.initialize=function(){settings=s;if(settings.theme=="pp_default")settings.horizontal_padding=16;theRel=e(this).attr(settings.hook);galleryRegExp=/\[(?:.*)\]/;isSet=galleryRegExp.exec(theRel)?true:false;pp_images=isSet?jQuery.map(o,function(t,n){if(e(t).attr(settings.hook).indexOf(theRel)!=-1)return e(t).attr("href")}):e.makeArray(e(this).attr("href"));pp_titles=isSet?jQuery.map(o,function(t,n){if(e(t).attr(settings.hook).indexOf(theRel)!=-1)return e(t).find("img").attr("alt")?e(t).find("img").attr("alt"):""}):e.makeArray(e(this).find("img").attr("alt"));pp_descriptions=isSet?jQuery.map(o,function(t,n){if(e(t).attr(settings.hook).indexOf(theRel)!=-1)return e(t).attr("title")?e(t).attr("title"):""}):e.makeArray(e(this).attr("title"));if(pp_images.length>settings.overlay_gallery_max)settings.overlay_gallery=false;set_position=jQuery.inArray(e(this).attr("href"),pp_images);rel_index=isSet?set_position:e("a["+settings.hook+"^='"+theRel+"']").index(e(this));k(this);if(settings.allow_resize)e(window).bind("scroll.prettyphoto",function(){x()});e.prettyPhoto.open();return false};e.prettyPhoto.open=function(t){if(typeof settings=="undefined"){settings=s;pp_images=e.makeArray(arguments[0]);pp_titles=arguments[1]?e.makeArray(arguments[1]):e.makeArray("");pp_descriptions=arguments[2]?e.makeArray(arguments[2]):e.makeArray("");isSet=pp_images.length>1?true:false;set_position=arguments[3]?arguments[3]:0;k(t.target)}if(settings.hideflash)e("object,embed,iframe[src*=youtube],iframe[src*=vimeo]").css("visibility","hidden");b(e(pp_images).size());e(".pp_loaderIcon").show();if(settings.deeplinking)n();if(settings.social_tools){facebook_like_link=settings.social_tools.replace("{location_href}",encodeURIComponent(location.href));$pp_pic_holder.find(".pp_social").html(facebook_like_link)}if($ppt.is(":hidden"))$ppt.css("opacity",0).show();$pp_overlay.show().fadeTo(settings.animation_speed,settings.opacity);$pp_pic_holder.find(".currentTextHolder").text(set_position+1+settings.counter_separator_label+e(pp_images).size());if(typeof pp_descriptions[set_position]!="undefined"&&pp_descriptions[set_position]!=""){$pp_pic_holder.find(".pp_description").show().html(unescape(pp_descriptions[set_position]))}else{$pp_pic_holder.find(".pp_description").hide()}movie_width=parseFloat(i("width",pp_images[set_position]))?i("width",pp_images[set_position]):settings.default_width.toString();movie_height=parseFloat(i("height",pp_images[set_position]))?i("height",pp_images[set_position]):settings.default_height.toString();u=false;if(movie_height.indexOf("%")!=-1){movie_height=parseFloat(e(window).height()*parseFloat(movie_height)/100-150);u=true}if(movie_width.indexOf("%")!=-1){movie_width=parseFloat(e(window).width()*parseFloat(movie_width)/100-150);u=true}$pp_pic_holder.fadeIn(function(){settings.show_title&&pp_titles[set_position]!=""&&typeof pp_titles[set_position]!="undefined"?$ppt.html(unescape(pp_titles[set_position])):$ppt.html(" ");imgPreloader="";skipInjection=false;switch(S(pp_images[set_position])){case"image":imgPreloader=new Image;nextImage=new Image;if(isSet&&set_position<e(pp_images).size()-1)nextImage.src=pp_images[set_position+1];prevImage=new Image;if(isSet&&pp_images[set_position-1])prevImage.src=pp_images[set_position-1];$pp_pic_holder.find("#pp_full_res")[0].innerHTML=settings.image_markup.replace(/{path}/g,pp_images[set_position]);imgPreloader.onload=function(){a=w(imgPreloader.width,imgPreloader.height);g()};imgPreloader.onerror=function(){alert("Image cannot be loaded. Make sure the path is correct and image exist.");e.prettyPhoto.close()};imgPreloader.src=pp_images[set_position];break;case"youtube":a=w(movie_width,movie_height);movie_id=i("v",pp_images[set_position]);if(movie_id==""){movie_id=pp_images[set_position].split("youtu.be/");movie_id=movie_id[1];if(movie_id.indexOf("?")>0)movie_id=movie_id.substr(0,movie_id.indexOf("?"));if(movie_id.indexOf("&")>0)movie_id=movie_id.substr(0,movie_id.indexOf("&"))}movie="http://www.youtube.com/embed/"+movie_id;i("rel",pp_images[set_position])?movie+="?rel="+i("rel",pp_images[set_position]):movie+="?rel=1";if(settings.autoplay)movie+="&autoplay=1";toInject=settings.iframe_markup.replace(/{width}/g,a["width"]).replace(/{height}/g,a["height"]).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,movie);break;case"vimeo":a=w(movie_width,movie_height);movie_id=pp_images[set_position];var t=/http(s?):\/\/(www\.)?vimeo.com\/(\d+)/;var n=movie_id.match(t);movie="http://player.vimeo.com/video/"+n[3]+"?title=0&byline=0&portrait=0";if(settings.autoplay)movie+="&autoplay=1;";vimeo_width=a["width"]+"/embed/?moog_width="+a["width"];toInject=settings.iframe_markup.replace(/{width}/g,vimeo_width).replace(/{height}/g,a["height"]).replace(/{path}/g,movie);break;case"quicktime":a=w(movie_width,movie_height);a["height"]+=15;a["contentHeight"]+=15;a["containerHeight"]+=15;toInject=settings.quicktime_markup.replace(/{width}/g,a["width"]).replace(/{height}/g,a["height"]).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,pp_images[set_position]).replace(/{autoplay}/g,settings.autoplay);break;case"flash":a=w(movie_width,movie_height);flash_vars=pp_images[set_position];flash_vars=flash_vars.substring(pp_images[set_position].indexOf("flashvars")+10,pp_images[set_position].length);filename=pp_images[set_position];filename=filename.substring(0,filename.indexOf("?"));toInject=settings.flash_markup.replace(/{width}/g,a["width"]).replace(/{height}/g,a["height"]).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,filename+"?"+flash_vars);break;case"iframe":a=w(movie_width,movie_height);frame_url=pp_images[set_position];frame_url=frame_url.substr(0,frame_url.indexOf("iframe")-1);toInject=settings.iframe_markup.replace(/{width}/g,a["width"]).replace(/{height}/g,a["height"]).replace(/{path}/g,frame_url);break;case"ajax":doresize=false;a=w(movie_width,movie_height);doresize=true;skipInjection=true;e.get(pp_images[set_position],function(e){toInject=settings.inline_markup.replace(/{content}/g,e);$pp_pic_holder.find("#pp_full_res")[0].innerHTML=toInject;g()});break;case"custom":a=w(movie_width,movie_height);toInject=settings.custom_markup;break;case"inline":myClone=e(pp_images[set_position]).clone().append('<br clear="all" />').css({width:settings.default_width}).wrapInner('<div id="pp_full_res"><div class="pp_inline"></div></div>').appendTo(e("body")).show();doresize=false;a=w(e(myClone).width(),e(myClone).height());doresize=true;e(myClone).remove();toInject=settings.inline_markup.replace(/{content}/g,e(pp_images[set_position]).html());break}if(!imgPreloader&&!skipInjection){$pp_pic_holder.find("#pp_full_res")[0].innerHTML=toInject;g()}});return false};e.prettyPhoto.changePage=function(t){currentGalleryPage=0;if(t=="previous"){set_position--;if(set_position<0)set_position=e(pp_images).size()-1}else if(t=="next"){set_position++;if(set_position>e(pp_images).size()-1)set_position=0}else{set_position=t}rel_index=set_position;if(!doresize)doresize=true;if(settings.allow_expand){e(".pp_contract").removeClass("pp_contract").addClass("pp_expand")}y(function(){e.prettyPhoto.open()})};e.prettyPhoto.changeGalleryPage=function(e){if(e=="next"){currentGalleryPage++;if(currentGalleryPage>totalPage)currentGalleryPage=0}else if(e=="previous"){currentGalleryPage--;if(currentGalleryPage<0)currentGalleryPage=totalPage}else{currentGalleryPage=e}slide_speed=e=="next"||e=="previous"?settings.animation_speed:0;slide_to=currentGalleryPage*itemsPerPage*itemWidth;$pp_gallery.find("ul").animate({left:-slide_to},slide_speed)};e.prettyPhoto.startSlideshow=function(){if(typeof m=="undefined"){$pp_pic_holder.find(".pp_play").unbind("click").removeClass("pp_play").addClass("pp_pause").click(function(){e.prettyPhoto.stopSlideshow();return false});m=setInterval(e.prettyPhoto.startSlideshow,settings.slideshow)}else{e.prettyPhoto.changePage("next")}};e.prettyPhoto.stopSlideshow=function(){$pp_pic_holder.find(".pp_pause").unbind("click").removeClass("pp_pause").addClass("pp_play").click(function(){e.prettyPhoto.startSlideshow();return false});clearInterval(m);m=undefined};e.prettyPhoto.close=function(){if($pp_overlay.is(":animated"))return;e.prettyPhoto.stopSlideshow();$pp_pic_holder.stop().find("object,embed").css("visibility","hidden");e("div.pp_pic_holder,div.ppt,.pp_fade").fadeOut(settings.animation_speed,function(){e(this).remove()});$pp_overlay.fadeOut(settings.animation_speed,function(){if(settings.hideflash)e("object,embed,iframe[src*=youtube],iframe[src*=vimeo]").css("visibility","visible");e(this).remove();e(window).unbind("scroll.prettyphoto");r();settings.callback();doresize=true;f=false;delete settings})};if(!pp_alreadyInitialized&&t()){pp_alreadyInitialized=true;hashIndex=t();hashRel=hashIndex;hashIndex=hashIndex.substring(hashIndex.indexOf("/")+1,hashIndex.length-1);hashRel=hashRel.substring(0,hashRel.indexOf("/"));setTimeout(function(){e("a["+s.hook+"^='"+hashRel+"']:eq("+hashIndex+")").trigger("click")},50)}return this.unbind("click.prettyphoto").bind("click.prettyphoto",e.prettyPhoto.initialize)};})(jQuery);var pp_alreadyInitialized=false
includes/lib/prettyphoto/prettyPhoto.css ADDED
@@ -0,0 +1,170 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ div.pp_default .pp_top,div.pp_default .pp_top .pp_middle,div.pp_default .pp_top .pp_left,div.pp_default .pp_top .pp_right,div.pp_default .pp_bottom,div.pp_default .pp_bottom .pp_left,div.pp_default .pp_bottom .pp_middle,div.pp_default .pp_bottom .pp_right{height:13px}
2
+ div.pp_default .pp_top .pp_left{background:url(../images/prettyPhoto/default/sprite.png) -78px -93px no-repeat}
3
+ div.pp_default .pp_top .pp_middle{background:url(../images/prettyPhoto/default/sprite_x.png) top left repeat-x}
4
+ div.pp_default .pp_top .pp_right{background:url(../images/prettyPhoto/default/sprite.png) -112px -93px no-repeat}
5
+ div.pp_default .pp_content .ppt{color:#f8f8f8}
6
+ div.pp_default .pp_content_container .pp_left{background:url(../images/prettyPhoto/default/sprite_y.png) -7px 0 repeat-y;padding-left:13px}
7
+ div.pp_default .pp_content_container .pp_right{background:url(../images/prettyPhoto/default/sprite_y.png) top right repeat-y;padding-right:13px}
8
+ div.pp_default .pp_next:hover{background:url(../images/prettyPhoto/default/sprite_next.png) center right no-repeat;cursor:pointer}
9
+ div.pp_default .pp_previous:hover{background:url(../images/prettyPhoto/default/sprite_prev.png) center left no-repeat;cursor:pointer}
10
+ div.pp_default .pp_expand{background:url(../images/prettyPhoto/default/sprite.png) 0 -29px no-repeat;cursor:pointer;width:28px;height:28px}
11
+ div.pp_default .pp_expand:hover{background:url(../images/prettyPhoto/default/sprite.png) 0 -56px no-repeat;cursor:pointer}
12
+ div.pp_default .pp_contract{background:url(../images/prettyPhoto/default/sprite.png) 0 -84px no-repeat;cursor:pointer;width:28px;height:28px}
13
+ div.pp_default .pp_contract:hover{background:url(../images/prettyPhoto/default/sprite.png) 0 -113px no-repeat;cursor:pointer}
14
+ div.pp_default .pp_close{width:30px;height:30px;background:url(../images/prettyPhoto/default/sprite.png) 2px 1px no-repeat;cursor:pointer}
15
+ div.pp_default .pp_gallery ul li a{background:url(../images/prettyPhoto/default/default_thumb.png) center center #f8f8f8;border:1px solid #aaa}
16
+ div.pp_default .pp_social{margin-top:7px}
17
+ div.pp_default .pp_gallery a.pp_arrow_previous,div.pp_default .pp_gallery a.pp_arrow_next{position:static;left:auto}
18
+ div.pp_default .pp_nav .pp_play,div.pp_default .pp_nav .pp_pause{background:url(../images/prettyPhoto/default/sprite.png) -51px 1px no-repeat;height:30px;width:30px}
19
+ div.pp_default .pp_nav .pp_pause{background-position:-51px -29px}
20
+ div.pp_default a.pp_arrow_previous,div.pp_default a.pp_arrow_next{background:url(../images/prettyPhoto/default/sprite.png) -31px -3px no-repeat;height:20px;width:20px;margin:4px 0 0}
21
+ div.pp_default a.pp_arrow_next{left:52px;background-position:-82px -3px}
22
+ div.pp_default .pp_content_container .pp_details{margin-top:5px}
23
+ div.pp_default .pp_nav{clear:none;height:30px;width:110px;position:relative}
24
+ div.pp_default .pp_nav .currentTextHolder{font-family:Georgia;font-style:italic;color:#999;font-size:11px;left:75px;line-height:25px;position:absolute;top:2px;margin:0;padding:0 0 0 10px}
25
+ div.pp_default .pp_close:hover,div.pp_default .pp_nav .pp_play:hover,div.pp_default .pp_nav .pp_pause:hover,div.pp_default .pp_arrow_next:hover,div.pp_default .pp_arrow_previous:hover{opacity:0.7}
26
+ div.pp_default .pp_description{font-size:11px;font-weight:700;line-height:14px;margin:5px 50px 5px 0}
27
+ div.pp_default .pp_bottom .pp_left{background:url(../images/prettyPhoto/default/sprite.png) -78px -127px no-repeat}
28
+ div.pp_default .pp_bottom .pp_middle{background:url(../images/prettyPhoto/default/sprite_x.png) bottom left repeat-x}
29
+ div.pp_default .pp_bottom .pp_right{background:url(../images/prettyPhoto/default/sprite.png) -112px -127px no-repeat}
30
+ div.pp_default .pp_loaderIcon{background:url(../images/prettyPhoto/default/loader.gif) center center no-repeat}
31
+ div.light_rounded .pp_top .pp_left{background:url(../images/prettyPhoto/light_rounded/sprite.png) -88px -53px no-repeat}
32
+ div.light_rounded .pp_top .pp_right{background:url(../images/prettyPhoto/light_rounded/sprite.png) -110px -53px no-repeat}
33
+ div.light_rounded .pp_next:hover{background:url(../images/prettyPhoto/light_rounded/btnNext.png) center right no-repeat;cursor:pointer}
34
+ div.light_rounded .pp_previous:hover{background:url(../images/prettyPhoto/light_rounded/btnPrevious.png) center left no-repeat;cursor:pointer}
35
+ div.light_rounded .pp_expand{background:url(../images/prettyPhoto/light_rounded/sprite.png) -31px -26px no-repeat;cursor:pointer}
36
+ div.light_rounded .pp_expand:hover{background:url(../images/prettyPhoto/light_rounded/sprite.png) -31px -47px no-repeat;cursor:pointer}
37
+ div.light_rounded .pp_contract{background:url(../images/prettyPhoto/light_rounded/sprite.png) 0 -26px no-repeat;cursor:pointer}
38
+ div.light_rounded .pp_contract:hover{background:url(../images/prettyPhoto/light_rounded/sprite.png) 0 -47px no-repeat;cursor:pointer}
39
+ div.light_rounded .pp_close{width:75px;height:22px;background:url(../images/prettyPhoto/light_rounded/sprite.png) -1px -1px no-repeat;cursor:pointer}
40
+ div.light_rounded .pp_nav .pp_play{background:url(../images/prettyPhoto/light_rounded/sprite.png) -1px -100px no-repeat;height:15px;width:14px}
41
+ div.light_rounded .pp_nav .pp_pause{background:url(../images/prettyPhoto/light_rounded/sprite.png) -24px -100px no-repeat;height:15px;width:14px}
42
+ div.light_rounded .pp_arrow_previous{background:url(../images/prettyPhoto/light_rounded/sprite.png) 0 -71px no-repeat}
43
+ div.light_rounded .pp_arrow_next{background:url(../images/prettyPhoto/light_rounded/sprite.png) -22px -71px no-repeat}
44
+ div.light_rounded .pp_bottom .pp_left{background:url(../images/prettyPhoto/light_rounded/sprite.png) -88px -80px no-repeat}
45
+ div.light_rounded .pp_bottom .pp_right{background:url(../images/prettyPhoto/light_rounded/sprite.png) -110px -80px no-repeat}
46
+ div.dark_rounded .pp_top .pp_left{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -88px -53px no-repeat}
47
+ div.dark_rounded .pp_top .pp_right{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -110px -53px no-repeat}
48
+ div.dark_rounded .pp_content_container .pp_left{background:url(../images/prettyPhoto/dark_rounded/contentPattern.png) top left repeat-y}
49
+ div.dark_rounded .pp_content_container .pp_right{background:url(../images/prettyPhoto/dark_rounded/contentPattern.png) top right repeat-y}
50
+ div.dark_rounded .pp_next:hover{background:url(../images/prettyPhoto/dark_rounded/btnNext.png) center right no-repeat;cursor:pointer}
51
+ div.dark_rounded .pp_previous:hover{background:url(../images/prettyPhoto/dark_rounded/btnPrevious.png) center left no-repeat;cursor:pointer}
52
+ div.dark_rounded .pp_expand{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -31px -26px no-repeat;cursor:pointer}
53
+ div.dark_rounded .pp_expand:hover{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -31px -47px no-repeat;cursor:pointer}
54
+ div.dark_rounded .pp_contract{background:url(../images/prettyPhoto/dark_rounded/sprite.png) 0 -26px no-repeat;cursor:pointer}
55
+ div.dark_rounded .pp_contract:hover{background:url(../images/prettyPhoto/dark_rounded/sprite.png) 0 -47px no-repeat;cursor:pointer}
56
+ div.dark_rounded .pp_close{width:75px;height:22px;background:url(../images/prettyPhoto/dark_rounded/sprite.png) -1px -1px no-repeat;cursor:pointer}
57
+ div.dark_rounded .pp_description{margin-right:85px;color:#fff}
58
+ div.dark_rounded .pp_nav .pp_play{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -1px -100px no-repeat;height:15px;width:14px}
59
+ div.dark_rounded .pp_nav .pp_pause{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -24px -100px no-repeat;height:15px;width:14px}
60
+ div.dark_rounded .pp_arrow_previous{background:url(../images/prettyPhoto/dark_rounded/sprite.png) 0 -71px no-repeat}
61
+ div.dark_rounded .pp_arrow_next{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -22px -71px no-repeat}
62
+ div.dark_rounded .pp_bottom .pp_left{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -88px -80px no-repeat}
63
+ div.dark_rounded .pp_bottom .pp_right{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -110px -80px no-repeat}
64
+ div.dark_rounded .pp_loaderIcon{background:url(../images/prettyPhoto/dark_rounded/loader.gif) center center no-repeat}
65
+ div.dark_square .pp_left,div.dark_square .pp_middle,div.dark_square .pp_right,div.dark_square .pp_content{background:#000}
66
+ div.dark_square .pp_description{color:#fff;margin:0 85px 0 0}
67
+ div.dark_square .pp_loaderIcon{background:url(../images/prettyPhoto/dark_square/loader.gif) center center no-repeat}
68
+ div.dark_square .pp_expand{background:url(../images/prettyPhoto/dark_square/sprite.png) -31px -26px no-repeat;cursor:pointer}
69
+ div.dark_square .pp_expand:hover{background:url(../images/prettyPhoto/dark_square/sprite.png) -31px -47px no-repeat;cursor:pointer}
70
+ div.dark_square .pp_contract{background:url(../images/prettyPhoto/dark_square/sprite.png) 0 -26px no-repeat;cursor:pointer}
71
+ div.dark_square .pp_contract:hover{background:url(../images/prettyPhoto/dark_square/sprite.png) 0 -47px no-repeat;cursor:pointer}
72
+ div.dark_square .pp_close{width:75px;height:22px;background:url(../images/prettyPhoto/dark_square/sprite.png) -1px -1px no-repeat;cursor:pointer}
73
+ div.dark_square .pp_nav{clear:none}
74
+ div.dark_square .pp_nav .pp_play{background:url(../images/prettyPhoto/dark_square/sprite.png) -1px -100px no-repeat;height:15px;width:14px}
75
+ div.dark_square .pp_nav .pp_pause{background:url(../images/prettyPhoto/dark_square/sprite.png) -24px -100px no-repeat;height:15px;width:14px}
76
+ div.dark_square .pp_arrow_previous{background:url(../images/prettyPhoto/dark_square/sprite.png) 0 -71px no-repeat}
77
+ div.dark_square .pp_arrow_next{background:url(../images/prettyPhoto/dark_square/sprite.png) -22px -71px no-repeat}
78
+ div.dark_square .pp_next:hover{background:url(../images/prettyPhoto/dark_square/btnNext.png) center right no-repeat;cursor:pointer}
79
+ div.dark_square .pp_previous:hover{background:url(../images/prettyPhoto/dark_square/btnPrevious.png) center left no-repeat;cursor:pointer}
80
+ div.light_square .pp_expand{background:url(../images/prettyPhoto/light_square/sprite.png) -31px -26px no-repeat;cursor:pointer}
81
+ div.light_square .pp_expand:hover{background:url(../images/prettyPhoto/light_square/sprite.png) -31px -47px no-repeat;cursor:pointer}
82
+ div.light_square .pp_contract{background:url(../images/prettyPhoto/light_square/sprite.png) 0 -26px no-repeat;cursor:pointer}
83
+ div.light_square .pp_contract:hover{background:url(../images/prettyPhoto/light_square/sprite.png) 0 -47px no-repeat;cursor:pointer}
84
+ div.light_square .pp_close{width:75px;height:22px;background:url(../images/prettyPhoto/light_square/sprite.png) -1px -1px no-repeat;cursor:pointer}
85
+ div.light_square .pp_nav .pp_play{background:url(../images/prettyPhoto/light_square/sprite.png) -1px -100px no-repeat;height:15px;width:14px}
86
+ div.light_square .pp_nav .pp_pause{background:url(../images/prettyPhoto/light_square/sprite.png) -24px -100px no-repeat;height:15px;width:14px}
87
+ div.light_square .pp_arrow_previous{background:url(../images/prettyPhoto/light_square/sprite.png) 0 -71px no-repeat}
88
+ div.light_square .pp_arrow_next{background:url(../images/prettyPhoto/light_square/sprite.png) -22px -71px no-repeat}
89
+ div.light_square .pp_next:hover{background:url(../images/prettyPhoto/light_square/btnNext.png) center right no-repeat;cursor:pointer}
90
+ div.light_square .pp_previous:hover{background:url(../images/prettyPhoto/light_square/btnPrevious.png) center left no-repeat;cursor:pointer}
91
+ div.facebook .pp_top .pp_left{background:url(../images/prettyPhoto/facebook/sprite.png) -88px -53px no-repeat}
92
+ div.facebook .pp_top .pp_middle{background:url(../images/prettyPhoto/facebook/contentPatternTop.png) top left repeat-x}
93
+ div.facebook .pp_top .pp_right{background:url(../images/prettyPhoto/facebook/sprite.png) -110px -53px no-repeat}
94
+ div.facebook .pp_content_container .pp_left{background:url(../images/prettyPhoto/facebook/contentPatternLeft.png) top left repeat-y}
95
+ div.facebook .pp_content_container .pp_right{background:url(../images/prettyPhoto/facebook/contentPatternRight.png) top right repeat-y}
96
+ div.facebook .pp_expand{background:url(../images/prettyPhoto/facebook/sprite.png) -31px -26px no-repeat;cursor:pointer}
97
+ div.facebook .pp_expand:hover{background:url(../images/prettyPhoto/facebook/sprite.png) -31px -47px no-repeat;cursor:pointer}
98
+ div.facebook .pp_contract{background:url(../images/prettyPhoto/facebook/sprite.png) 0 -26px no-repeat;cursor:pointer}
99
+ div.facebook .pp_contract:hover{background:url(../images/prettyPhoto/facebook/sprite.png) 0 -47px no-repeat;cursor:pointer}
100
+ div.facebook .pp_close{width:22px;height:22px;background:url(../images/prettyPhoto/facebook/sprite.png) -1px -1px no-repeat;cursor:pointer}
101
+ div.facebook .pp_description{margin:0 37px 0 0}
102
+ div.facebook .pp_loaderIcon{background:url(../images/prettyPhoto/facebook/loader.gif) center center no-repeat}
103
+ div.facebook .pp_arrow_previous{background:url(../images/prettyPhoto/facebook/sprite.png) 0 -71px no-repeat;height:22px;margin-top:0;width:22px}
104
+ div.facebook .pp_arrow_previous.disabled{background-position:0 -96px;cursor:default}
105
+ div.facebook .pp_arrow_next{background:url(../images/prettyPhoto/facebook/sprite.png) -32px -71px no-repeat;height:22px;margin-top:0;width:22px}
106
+ div.facebook .pp_arrow_next.disabled{background-position:-32px -96px;cursor:default}
107
+ div.facebook .pp_nav{margin-top:0}
108
+ div.facebook .pp_nav p{font-size:15px;padding:0 3px 0 4px}
109
+ div.facebook .pp_nav .pp_play{background:url(../images/prettyPhoto/facebook/sprite.png) -1px -123px no-repeat;height:22px;width:22px}
110
+ div.facebook .pp_nav .pp_pause{background:url(../images/prettyPhoto/facebook/sprite.png) -32px -123px no-repeat;height:22px;width:22px}
111
+ div.facebook .pp_next:hover{background:url(../images/prettyPhoto/facebook/btnNext.png) center right no-repeat;cursor:pointer}
112
+ div.facebook .pp_previous:hover{background:url(../images/prettyPhoto/facebook/btnPrevious.png) center left no-repeat;cursor:pointer}
113
+ div.facebook .pp_bottom .pp_left{background:url(../images/prettyPhoto/facebook/sprite.png) -88px -80px no-repeat}
114
+ div.facebook .pp_bottom .pp_middle{background:url(../images/prettyPhoto/facebook/contentPatternBottom.png) top left repeat-x}
115
+ div.facebook .pp_bottom .pp_right{background:url(../images/prettyPhoto/facebook/sprite.png) -110px -80px no-repeat}
116
+ div.pp_pic_holder a:focus{outline:none}
117
+ div.pp_overlay{background:#000;display:none;left:0;position:absolute;top:0;width:100%;z-index:9500}
118
+ div.pp_pic_holder{display:none;position:absolute;width:100px;z-index:10000}
119
+ .pp_content{height:40px;min-width:40px}
120
+ * html .pp_content{width:40px}
121
+ .pp_content_container{position:relative;text-align:left;width:100%}
122
+ .pp_content_container .pp_left{padding-left:20px}
123
+ .pp_content_container .pp_right{padding-right:20px}
124
+ .pp_content_container .pp_details{float:left;margin:10px 0 2px}
125
+ .pp_description{display:none;margin:0}
126
+ .pp_social{float:left;margin:0}
127
+ .pp_social .facebook{float:left;margin-left:5px;width:55px;overflow:hidden}
128
+ .pp_social .twitter{float:left}
129
+ .pp_nav{clear:right;float:left;margin:3px 10px 0 0}
130
+ .pp_nav p{float:left;white-space:nowrap;margin:2px 4px}
131
+ .pp_nav .pp_play,.pp_nav .pp_pause{float:left;margin-right:4px;text-indent:-10000px}
132
+ a.pp_arrow_previous,a.pp_arrow_next{display:block;float:left;height:15px;margin-top:3px;overflow:hidden;text-indent:-10000px;width:14px}
133
+ .pp_hoverContainer{position:absolute;top:0;width:100%;z-index:2000}
134
+ .pp_gallery{display:none;left:50%;margin-top:-50px;position:absolute;z-index:10000}
135
+ .pp_gallery div{float:left;overflow:hidden;position:relative}
136
+ .pp_gallery ul{float:left;height:35px;position:relative;white-space:nowrap;margin:0 0 0 5px;padding:0}
137
+ .pp_gallery ul a{border:1px rgba(0,0,0,0.5) solid;display:block;float:left;height:33px;overflow:hidden}
138
+ .pp_gallery ul a img{border:0}
139
+ .pp_gallery li{display:block;float:left;margin:0 5px 0 0;padding:0}
140
+ .pp_gallery li.default a{background:url(../images/prettyPhoto/facebook/default_thumbnail.gif) 0 0 no-repeat;display:block;height:33px;width:50px}
141
+ .pp_gallery .pp_arrow_previous,.pp_gallery .pp_arrow_next{margin-top:7px!important}
142
+ a.pp_next{background:url(../images/prettyPhoto/light_rounded/btnNext.png) 10000px 10000px no-repeat;display:block;float:right;height:100%;text-indent:-10000px;width:49%}
143
+ a.pp_previous{background:url(../images/prettyPhoto/light_rounded/btnNext.png) 10000px 10000px no-repeat;display:block;float:left;height:100%;text-indent:-10000px;width:49%}
144
+ a.pp_expand,a.pp_contract{cursor:pointer;display:none;height:20px;position:absolute;right:30px;text-indent:-10000px;top:10px;width:20px;z-index:20000}
145
+ a.pp_close{position:absolute;right:0;top:0;display:block;line-height:22px;text-indent:-10000px}
146
+ .pp_loaderIcon{display:block;height:24px;left:50%;position:absolute;top:50%;width:24px;margin:-12px 0 0 -12px}
147
+ #pp_full_res{line-height:1!important}
148
+ #pp_full_res .pp_inline{text-align:left}
149
+ #pp_full_res .pp_inline p{margin:0 0 15px}
150
+ div.ppt{color:#fff;display:none;font-size:17px;z-index:9999;margin:0 0 5px 15px}
151
+ div.pp_default .pp_content,div.light_rounded .pp_content{background-color:#fff}
152
+ div.pp_default #pp_full_res .pp_inline,div.light_rounded .pp_content .ppt,div.light_rounded #pp_full_res .pp_inline,div.light_square .pp_content .ppt,div.light_square #pp_full_res .pp_inline,div.facebook .pp_content .ppt,div.facebook #pp_full_res .pp_inline{color:#000}
153
+ div.pp_default .pp_gallery ul li a:hover,div.pp_default .pp_gallery ul li.selected a,.pp_gallery ul a:hover,.pp_gallery li.selected a{border-color:#fff}
154
+ div.pp_default .pp_details,div.light_rounded .pp_details,div.dark_rounded .pp_details,div.dark_square .pp_details,div.light_square .pp_details,div.facebook .pp_details{position:relative}
155
+ div.light_rounded .pp_top .pp_middle,div.light_rounded .pp_content_container .pp_left,div.light_rounded .pp_content_container .pp_right,div.light_rounded .pp_bottom .pp_middle,div.light_square .pp_left,div.light_square .pp_middle,div.light_square .pp_right,div.light_square .pp_content,div.facebook .pp_content{background:#fff}
156
+ div.light_rounded .pp_description,div.light_square .pp_description{margin-right:85px}
157
+ div.light_rounded .pp_gallery a.pp_arrow_previous,div.light_rounded .pp_gallery a.pp_arrow_next,div.dark_rounded .pp_gallery a.pp_arrow_previous,div.dark_rounded .pp_gallery a.pp_arrow_next,div.dark_square .pp_gallery a.pp_arrow_previous,div.dark_square .pp_gallery a.pp_arrow_next,div.light_square .pp_gallery a.pp_arrow_previous,div.light_square .pp_gallery a.pp_arrow_next{margin-top:12px!important}
158
+ div.light_rounded .pp_arrow_previous.disabled,div.dark_rounded .pp_arrow_previous.disabled,div.dark_square .pp_arrow_previous.disabled,div.light_square .pp_arrow_previous.disabled{background-position:0 -87px;cursor:default}
159
+ div.light_rounded .pp_arrow_next.disabled,div.dark_rounded .pp_arrow_next.disabled,div.dark_square .pp_arrow_next.disabled,div.light_square .pp_arrow_next.disabled{background-position:-22px -87px;cursor:default}
160
+ div.light_rounded .pp_loaderIcon,div.light_square .pp_loaderIcon{background:url(../images/prettyPhoto/light_rounded/loader.gif) center center no-repeat}
161
+ div.dark_rounded .pp_top .pp_middle,div.dark_rounded .pp_content,div.dark_rounded .pp_bottom .pp_middle{background:url(../images/prettyPhoto/dark_rounded/contentPattern.png) top left repeat}
162
+ div.dark_rounded .currentTextHolder,div.dark_square .currentTextHolder{color:#c4c4c4}
163
+ div.dark_rounded #pp_full_res .pp_inline,div.dark_square #pp_full_res .pp_inline{color:#fff}
164
+ .pp_top,.pp_bottom{height:20px;position:relative}
165
+ * html .pp_top,* html .pp_bottom{padding:0 20px}
166
+ .pp_top .pp_left,.pp_bottom .pp_left{height:20px;left:0;position:absolute;width:20px}
167
+ .pp_top .pp_middle,.pp_bottom .pp_middle{height:20px;left:20px;position:absolute;right:20px}
168
+ * html .pp_top .pp_middle,* html .pp_bottom .pp_middle{left:0;position:static}
169
+ .pp_top .pp_right,.pp_bottom .pp_right{height:20px;left:auto;position:absolute;right:0;top:0;width:20px}
170
+ .pp_fade,.pp_gallery li.default a img{display:none}
includes/metabox.php ADDED
@@ -0,0 +1,253 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly.
4
+
5
+
6
+ /**
7
+ * Add meta boxes to selected post types
8
+ *
9
+ * @since 1.0
10
+ */
11
+ function easy_image_gallery_add_meta_box() {
12
+
13
+ $post_types = easy_image_gallery_allowed_post_types();
14
+
15
+ if ( ! $post_types )
16
+ return;
17
+
18
+ foreach ( $post_types as $post_type => $status ) {
19
+ add_meta_box( 'easy_image_gallery', apply_filters( 'easy_image_gallery_meta_box_title', __( 'Image Gallery', 'easy-image-gallery' ) ), 'easy_image_gallery_metabox', $post_type, apply_filters( 'easy_image_gallery_meta_box_context', 'normal' ), apply_filters( 'easy_image_gallery_meta_box_priority', 'low' ) );
20
+ }
21
+
22
+ }
23
+ add_action( 'add_meta_boxes', 'easy_image_gallery_add_meta_box' );
24
+
25
+
26
+ /**
27
+ * Render gallery metabox
28
+ *
29
+ * @since 1.0
30
+ */
31
+ function easy_image_gallery_metabox() {
32
+
33
+ global $post;
34
+ ?>
35
+
36
+ <div id="gallery_images_container">
37
+
38
+ <ul class="gallery_images">
39
+ <?php
40
+
41
+ $image_gallery = get_post_meta( $post->ID, '_easy_image_gallery', true );
42
+ $attachments = array_filter( explode( ',', $image_gallery ) );
43
+
44
+ if ( $attachments )
45
+ foreach ( $attachments as $attachment_id ) {
46
+ echo '<li class="image attachment details" data-attachment_id="' . $attachment_id . '"><div class="attachment-preview"><div class="thumbnail">
47
+ ' . wp_get_attachment_image( $attachment_id, 'thumbnail' ) . '</div>
48
+ <a href="#" class="delete check" title="' . __( 'Remove image', 'easy-image-gallery' ) . '"><div class="media-modal-icon"></div></a>
49
+
50
+ </div></li>';
51
+ }
52
+ ?>
53
+ </ul>
54
+
55
+
56
+ <input type="hidden" id="image_gallery" name="image_gallery" value="<?php echo esc_attr( $image_gallery ); ?>" />
57
+ <?php wp_nonce_field( 'easy_image_gallery', 'easy_image_gallery' ); ?>
58
+
59
+ </div>
60
+
61
+ <p class="add_gallery_images hide-if-no-js">
62
+ <a href="#"><?php _e( 'Add gallery images', 'easy-image-gallery' ); ?></a>
63
+ </p>
64
+
65
+ <?php
66
+
67
+ // options don't exist yet, set to checked by default
68
+ if ( ! get_post_meta( get_the_ID(), '_easy_image_gallery_link_images', true ) )
69
+ $checked = ' checked="checked"';
70
+ else
71
+ $checked = easy_image_gallery_has_linked_images() ? checked( get_post_meta( get_the_ID(), '_easy_image_gallery_link_images', true ), 'on', false ) : '';
72
+
73
+ ?>
74
+
75
+ <p>
76
+ <label for="easy_image_gallery_link_images">
77
+ <input type="checkbox" id="easy_image_gallery_link_images" value="on" name="easy_image_gallery_link_images"<?php echo $checked; ?> /> <?php _e( 'Link images to larger sizes', 'easy-image-gallery' )?>
78
+ </label>
79
+ </p>
80
+
81
+
82
+ <?php
83
+ /**
84
+ * Props to WooCommerce for the following JS code
85
+ */
86
+ ?>
87
+ <script type="text/javascript">
88
+ jQuery(document).ready(function($){
89
+
90
+ // Uploading files
91
+ var image_gallery_frame;
92
+ var $image_gallery_ids = $('#image_gallery');
93
+ var $gallery_images = $('#gallery_images_container ul.gallery_images');
94
+
95
+ jQuery('.add_gallery_images').on( 'click', 'a', function( event ) {
96
+
97
+ var $el = $(this);
98
+ var attachment_ids = $image_gallery_ids.val();
99
+
100
+ event.preventDefault();
101
+
102
+ // If the media frame already exists, reopen it.
103
+ if ( image_gallery_frame ) {
104
+ image_gallery_frame.open();
105
+ return;
106
+ }
107
+
108
+ // Create the media frame.
109
+ image_gallery_frame = wp.media.frames.downloadable_file = wp.media({
110
+ // Set the title of the modal.
111
+ title: '<?php _e( 'Add Images to Gallery', 'easy-image-gallery' ); ?>',
112
+ button: {
113
+ text: '<?php _e( 'Add to gallery', 'easy-image-gallery' ); ?>',
114
+ },
115
+ multiple: true
116
+ });
117
+
118
+ // When an image is selected, run a callback.
119
+ image_gallery_frame.on( 'select', function() {
120
+
121
+ var selection = image_gallery_frame.state().get('selection');
122
+
123
+ selection.map( function( attachment ) {
124
+
125
+ attachment = attachment.toJSON();
126
+
127
+ if ( attachment.id ) {
128
+ attachment_ids = attachment_ids ? attachment_ids + "," + attachment.id : attachment.id;
129
+
130
+ $gallery_images.append('\
131
+ <li class="image attachment details" data-attachment_id="' + attachment.id + '">\
132
+ <div class="attachment-preview">\
133
+ <div class="thumbnail">\
134
+ <img src="' + attachment.url + '" />\
135
+ </div>\
136
+ <a href="#" class="delete check" title="<?php _e( 'Remove image', 'easy-image-gallery' ); ?>"><div class="media-modal-icon"></div></a>\
137
+ </div>\
138
+ </li>');
139
+
140
+ }
141
+
142
+ } );
143
+
144
+ $image_gallery_ids.val( attachment_ids );
145
+ });
146
+
147
+ // Finally, open the modal.
148
+ image_gallery_frame.open();
149
+ });
150
+
151
+ // Image ordering
152
+ $gallery_images.sortable({
153
+ items: 'li.image',
154
+ cursor: 'move',
155
+ scrollSensitivity:40,
156
+ forcePlaceholderSize: true,
157
+ forceHelperSize: false,
158
+ helper: 'clone',
159
+ opacity: 0.65,
160
+ placeholder: 'wc-metabox-sortable-placeholder',
161
+ start:function(event,ui){
162
+ ui.item.css('background-color','#f6f6f6');
163
+ },
164
+ stop:function(event,ui){
165
+ ui.item.removeAttr('style');
166
+ },
167
+ update: function(event, ui) {
168
+ var attachment_ids = '';
169
+
170
+ $('#gallery_images_container ul li.image').css('cursor','default').each(function() {
171
+ var attachment_id = jQuery(this).attr( 'data-attachment_id' );
172
+ attachment_ids = attachment_ids + attachment_id + ',';
173
+ });
174
+
175
+ $image_gallery_ids.val( attachment_ids );
176
+ }
177
+ });
178
+
179
+ // Remove images
180
+ $('#gallery_images_container').on( 'click', 'a.delete', function() {
181
+
182
+ $(this).closest('li.image').remove();
183
+
184
+ var attachment_ids = '';
185
+
186
+ $('#gallery_images_container ul li.image').css('cursor','default').each(function() {
187
+ var attachment_id = jQuery(this).attr( 'data-attachment_id' );
188
+ attachment_ids = attachment_ids + attachment_id + ',';
189
+ });
190
+
191
+ $image_gallery_ids.val( attachment_ids );
192
+
193
+ return false;
194
+ } );
195
+
196
+ });
197
+ </script>
198
+ <?php
199
+ }
200
+
201
+
202
+ /**
203
+ * Save function
204
+ *
205
+ * @since 1.0
206
+ */
207
+ function easy_image_gallery_save_post( $post_id ) {
208
+
209
+ if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
210
+ return;
211
+
212
+ $post_types = easy_image_gallery_allowed_post_types();
213
+
214
+ // check user permissions
215
+ if ( isset( $_POST[ 'post_type' ] ) && !array_key_exists( $_POST[ 'post_type' ], $post_types ) ) {
216
+ if ( !current_user_can( 'edit_page', $post_id ) )
217
+ return;
218
+ }
219
+ else {
220
+ if ( !current_user_can( 'edit_post', $post_id ) )
221
+ return;
222
+ }
223
+
224
+ if ( ! isset( $_POST[ 'easy_image_gallery' ] ) || ! wp_verify_nonce( $_POST[ 'easy_image_gallery' ], 'easy_image_gallery' ) )
225
+ return;
226
+
227
+ if ( isset( $_POST[ 'image_gallery' ] ) && !empty( $_POST[ 'image_gallery' ] ) ) {
228
+
229
+ $attachment_ids = sanitize_text_field( $_POST['image_gallery'] );
230
+
231
+ // turn comma separated values into array
232
+ $attachment_ids = explode( ',', $attachment_ids );
233
+
234
+ // clean the array
235
+ $attachment_ids = array_filter( $attachment_ids );
236
+
237
+ // return back to comma separated list with no trailing comma. This is common when deleting the images
238
+ $attachment_ids = implode( ',', $attachment_ids );
239
+
240
+ update_post_meta( $post_id, '_easy_image_gallery', $attachment_ids );
241
+ } else {
242
+ delete_post_meta( $post_id, '_easy_image_gallery' );
243
+ }
244
+
245
+ // link to larger images
246
+ if ( isset( $_POST[ 'easy_image_gallery_link_images' ] ) )
247
+ update_post_meta( $post_id, '_easy_image_gallery_link_images', $_POST[ 'easy_image_gallery_link_images' ] );
248
+ else
249
+ update_post_meta( $post_id, '_easy_image_gallery_link_images', 'off' );
250
+
251
+ do_action( 'easy_image_gallery_save_post', $post_id );
252
+ }
253
+ add_action( 'save_post', 'easy_image_gallery_save_post' );
includes/scripts.php ADDED
@@ -0,0 +1,203 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly.
4
+
5
+ /**
6
+ * Scripts
7
+ *
8
+ * @since 1.0
9
+ */
10
+ function easy_image_gallery_scripts() {
11
+
12
+ global $post;
13
+
14
+ // return if post object is not set
15
+ if ( !isset( $post->ID ) )
16
+ return;
17
+
18
+ // JS
19
+ wp_register_script( 'pretty-photo', EASY_IMAGE_GALLERY_URL . 'includes/lib/prettyphoto/jquery.prettyPhoto.js', array( 'jquery' ), EASY_IMAGE_GALLERY_VERSION, true );
20
+ wp_register_script( 'fancybox', EASY_IMAGE_GALLERY_URL . 'includes/lib/fancybox/jquery.fancybox.pack.js', array( 'jquery' ), EASY_IMAGE_GALLERY_VERSION, true );
21
+
22
+ // CSS
23
+ wp_register_style( 'pretty-photo', EASY_IMAGE_GALLERY_URL . 'includes/lib/prettyphoto/prettyPhoto.css', '', EASY_IMAGE_GALLERY_VERSION, 'screen' );
24
+ wp_register_style( 'fancybox', EASY_IMAGE_GALLERY_URL . 'includes/lib/fancybox/jquery.fancybox.css', '', EASY_IMAGE_GALLERY_VERSION, 'screen' );
25
+
26
+ // create a new 'css/easy-image-gallery.css' in your child theme to override CSS file completely
27
+ if ( file_exists( get_stylesheet_directory() . '/css/easy-image-gallery.css' ) )
28
+ wp_register_style( 'easy-image-gallery', get_stylesheet_directory_uri() . 'css/easy-image-gallery.css', '', EASY_IMAGE_GALLERY_VERSION, 'screen' );
29
+ else
30
+ wp_register_style( 'easy-image-gallery', EASY_IMAGE_GALLERY_URL . 'includes/css/easy-image-gallery.css', '', EASY_IMAGE_GALLERY_VERSION, 'screen' );
31
+
32
+ // post type is not allowed, return
33
+ if ( ! easy_image_gallery_allowed_post_type() )
34
+ return;
35
+
36
+ // needs to load only when there is a gallery
37
+ if ( easy_image_gallery_is_gallery() )
38
+ wp_enqueue_style( 'easy-image-gallery' );
39
+
40
+ // only load the JS if gallery images are linked or the featured image is linked
41
+ if ( easy_image_gallery_has_linked_images() ) {
42
+
43
+ $lightbox = easy_image_gallery_get_lightbox();
44
+
45
+ switch ( $lightbox ) {
46
+
47
+ case 'prettyphoto':
48
+
49
+ // CSS
50
+ wp_enqueue_style( 'pretty-photo' );
51
+
52
+ // JS
53
+ wp_enqueue_script( 'pretty-photo' );
54
+
55
+ break;
56
+
57
+ case 'fancybox':
58
+
59
+ // CSS
60
+ wp_enqueue_style( 'fancybox' );
61
+
62
+ // JS
63
+ wp_enqueue_script( 'fancybox' );
64
+
65
+ break;
66
+
67
+ default:
68
+
69
+
70
+ break;
71
+ }
72
+
73
+ // allow developers to load their own scripts here
74
+ do_action( 'easy_image_gallery_scripts' );
75
+
76
+ }
77
+
78
+ }
79
+ add_action( 'wp_enqueue_scripts', 'easy_image_gallery_scripts', 20 );
80
+
81
+
82
+ /**
83
+ * JS
84
+ *
85
+ * @since 1.0
86
+ */
87
+ function easy_image_gallery_js() {
88
+
89
+ if ( ! easy_image_gallery_allowed_post_type() )
90
+ return;
91
+
92
+ if ( is_singular() && easy_image_gallery_has_linked_images() ) : ?>
93
+
94
+ <?php
95
+
96
+ $lightbox = easy_image_gallery_get_lightbox();
97
+
98
+ switch ( $lightbox ) {
99
+
100
+ case 'prettyphoto': ob_start(); ?>
101
+
102
+ <script>
103
+ jQuery(document).ready(function() {
104
+ jQuery("a[rel^='prettyPhoto']").prettyPhoto({
105
+ social_tools : false,
106
+ show_title : false
107
+ });
108
+ });
109
+ </script>
110
+
111
+ <?php
112
+ $js = ob_get_clean();
113
+ echo apply_filters( 'easy_image_gallery_prettyphoto_js', $js );
114
+ ?>
115
+
116
+ <?php break;
117
+
118
+ case 'fancybox': ob_start(); ?>
119
+
120
+ <script>
121
+ jQuery(document).ready(function() {
122
+ jQuery("a[rel^='fancybox']").fancybox({
123
+ openEffect: 'elastic',
124
+ closeEffect: 'elastic'
125
+ });
126
+ });
127
+ </script>
128
+
129
+ <?php
130
+ $js = ob_get_clean();
131
+ echo apply_filters( 'easy_image_gallery_fancybox_js', $js );
132
+ ?>
133
+
134
+ <?php break;
135
+
136
+
137
+ default:
138
+
139
+ break;
140
+ }
141
+
142
+ // allow developers to add/modify JS
143
+ do_action( 'easy_image_gallery_js', $lightbox );
144
+ ?>
145
+
146
+ <?php endif; ?>
147
+
148
+ <?php }
149
+ add_action( 'wp_footer', 'easy_image_gallery_js', 20 );
150
+
151
+
152
+ /**
153
+ * CSS for admin
154
+ *
155
+ * @since 1.0
156
+ */
157
+ function easy_image_gallery_admin_css() { ?>
158
+
159
+ <style>
160
+ .attachment.details .check div {
161
+ background-position: -60px 0;
162
+ }
163
+
164
+ .attachment.details .check:hover div {
165
+ background-position: -60px 0;
166
+ }
167
+
168
+ .gallery_images .details.attachment {
169
+ box-shadow: none;
170
+ }
171
+
172
+ .gallery_images .attachment.details > div {
173
+ width: 150px;
174
+ height: 150px;
175
+ box-shadow: none;
176
+ }
177
+
178
+ .gallery_images .attachment-preview .thumbnail {
179
+ cursor: move;
180
+ }
181
+
182
+ .attachment.details div:hover .check {
183
+ display:block;
184
+ }
185
+
186
+ .gallery_images:after,
187
+ #gallery_images_container:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
188
+
189
+ .gallery_images > li {
190
+ float: left;
191
+ cursor: move;
192
+ margin: 0 20px 20px 0;
193
+ }
194
+
195
+ .gallery_images li.image img {
196
+ width: 150px;
197
+ height: auto;
198
+ }
199
+
200
+ </style>
201
+
202
+ <?php }
203
+ add_action( 'admin_head', 'easy_image_gallery_admin_css' );
includes/template-functions.php ADDED
@@ -0,0 +1,382 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Template functions
4
+ *
5
+ * @since 1.0
6
+ */
7
+
8
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly.
9
+
10
+
11
+ /**
12
+ * Is gallery
13
+ *
14
+ * @since 1.0
15
+ * @return boolean
16
+ */
17
+ function easy_image_gallery_is_gallery() {
18
+
19
+ $attachment_ids = get_post_meta( get_the_ID(), '_easy_image_gallery', true );
20
+
21
+ if ( $attachment_ids )
22
+ return true;
23
+ }
24
+
25
+
26
+ /**
27
+ * Check the current post for the existence of a short code
28
+ *
29
+ * @since 1.0
30
+ * @return boolean
31
+ */
32
+ function easy_image_gallery_has_shortcode( $shortcode = '' ) {
33
+ global $post;
34
+
35
+ // false because we have to search through the post content first
36
+ $found = false;
37
+
38
+ // if no short code was provided, return false
39
+ if ( !$shortcode ) {
40
+ return $found;
41
+ }
42
+
43
+ if ( is_object( $post ) && stripos( $post->post_content, '[' . $shortcode ) !== false ) {
44
+ // we have found the short code
45
+ $found = true;
46
+ }
47
+
48
+ // return our final results
49
+ return $found;
50
+ }
51
+
52
+
53
+ /**
54
+ * Setup Lightbox array
55
+ *
56
+ * @since 1.0
57
+ * @return array
58
+ */
59
+ function easy_image_gallery_lightbox() {
60
+
61
+ $lightboxes = array(
62
+ 'fancybox' => __( 'fancyBox', 'easy-image-gallery' ),
63
+ 'prettyphoto' => __( 'prettyPhoto', 'easy-image-gallery' ),
64
+ );
65
+
66
+ return apply_filters( 'easy_image_gallery_lightbox', $lightboxes );
67
+
68
+ }
69
+
70
+ /**
71
+ * Get lightbox from settings
72
+ *
73
+ * @since 1.0
74
+ * @return string
75
+ */
76
+
77
+ if ( !function_exists( 'easy_image_gallery_get_lightbox' ) ) :
78
+ function easy_image_gallery_get_lightbox() {
79
+
80
+ $settings = (array) get_option( 'easy-image-gallery' );
81
+
82
+ // set fancybox as default for when the settings page hasn't been saved
83
+ $lightbox = isset( $settings['lightbox'] ) ? esc_attr( $settings['lightbox'] ) : 'prettyphoto';
84
+
85
+ return $lightbox;
86
+
87
+ }
88
+ endif;
89
+
90
+
91
+ /**
92
+ * Returns the correct rel attribute for the anchor links
93
+ *
94
+ * @since 1.0
95
+ * @return string
96
+ */
97
+
98
+ function easy_image_gallery_lightbox_rel() {
99
+
100
+ $lightbox = easy_image_gallery_get_lightbox();
101
+
102
+ switch ( $lightbox ) {
103
+
104
+ case 'prettyphoto':
105
+
106
+ $rel = 'prettyPhoto';
107
+
108
+ break;
109
+
110
+ case 'fancybox':
111
+
112
+ $rel = 'fancybox';
113
+
114
+ default:
115
+
116
+ $rel = 'prettyPhoto';
117
+
118
+ break;
119
+ }
120
+
121
+ return $rel;
122
+ }
123
+
124
+
125
+ /**
126
+ * Has linked images
127
+ *
128
+ * @since 1.0
129
+ * @return boolean true
130
+ */
131
+ function easy_image_gallery_has_linked_images() {
132
+
133
+ $link_images = get_post_meta( get_the_ID(), '_easy_image_gallery_link_images', true );
134
+
135
+ if ( 'on' == $link_images )
136
+ return true;
137
+ }
138
+
139
+
140
+ /**
141
+ * Get list of post types for populating the checkboxes on the admin page
142
+ *
143
+ * @since 1.0
144
+ * @return array
145
+ */
146
+ function easy_image_gallery_get_post_types() {
147
+
148
+ $args = array(
149
+ 'public' => true
150
+ );
151
+
152
+ $post_types = array_map( 'ucfirst', get_post_types( $args ) );
153
+
154
+ // remove attachment
155
+ unset( $post_types[ 'attachment' ] );
156
+
157
+ return apply_filters( 'easy_image_gallery_get_post_types', $post_types );
158
+
159
+ }
160
+
161
+ /**
162
+ * Retrieve the allowed post types from the option row
163
+ * Defaults to post and page when the settings have not been saved
164
+ *
165
+ * @return array
166
+ * @since 1.0
167
+ */
168
+ function easy_image_gallery_allowed_post_types() {
169
+
170
+ $defaults['post_types']['post'] = 'on';
171
+ $defaults['post_types']['page'] = 'on';
172
+
173
+ // get the allowed post type from the DB
174
+ $settings = ( array ) get_option( 'easy-image-gallery', $defaults );
175
+ $post_types = isset( $settings['post_types'] ) ? $settings['post_types'] : '';
176
+
177
+ // post types don't exist, bail
178
+ if ( ! $post_types )
179
+ return;
180
+
181
+ return $post_types;
182
+
183
+ }
184
+
185
+
186
+ /**
187
+ * Is the currently viewed post type allowed?
188
+ * For use on the front-end when loading scripts etc
189
+ *
190
+ * @since 1.0
191
+ * @return boolean
192
+ */
193
+ function easy_image_gallery_allowed_post_type() {
194
+
195
+ // post and page defaults
196
+ $defaults['post_types']['post'] = 'on';
197
+ $defaults['post_types']['page'] = 'on';
198
+
199
+ // get currently viewed post type
200
+ $post_type = ( string ) get_post_type();
201
+
202
+ //echo $post_type; exit; // download
203
+
204
+ // get the allowed post type from the DB
205
+ $settings = ( array ) get_option( 'easy-image-gallery', $defaults );
206
+ $post_types = isset( $settings['post_types'] ) ? $settings['post_types'] : '';
207
+
208
+ // post types don't exist, bail
209
+ if ( ! $post_types )
210
+ return;
211
+
212
+ // check the two against each other
213
+ if ( array_key_exists( $post_type, $post_types ) )
214
+ return true;
215
+ }
216
+
217
+
218
+ /**
219
+ * Retrieve attachment IDs
220
+ *
221
+ * @since 1.0
222
+ * @return string
223
+ */
224
+ function easy_image_gallery_get_image_ids() {
225
+ global $post;
226
+
227
+ if( ! isset( $post->ID) )
228
+ return;
229
+
230
+ $attachment_ids = get_post_meta( $post->ID, '_easy_image_gallery', true );
231
+ $attachment_ids = explode( ',', $attachment_ids );
232
+
233
+ return array_filter( $attachment_ids );
234
+ }
235
+
236
+
237
+ /**
238
+ * Shortcode
239
+ *
240
+ * @since 1.0
241
+ */
242
+
243
+ function easy_image_gallery_shortcode() {
244
+
245
+ // return early if the post type is not allowed to have a gallery
246
+ if ( ! easy_image_gallery_allowed_post_type() )
247
+ return;
248
+
249
+ return easy_image_gallery();
250
+ }
251
+ add_shortcode( 'easy_image_gallery', 'easy_image_gallery_shortcode' );
252
+
253
+
254
+ /**
255
+ * Count number of images in array
256
+ *
257
+ * @since 1.0
258
+ * @return integer
259
+ */
260
+ function easy_image_gallery_count_images() {
261
+
262
+ $images = get_post_meta( get_the_ID(), '_easy_image_gallery', true );
263
+ $images = explode( ',', $images );
264
+
265
+ $number = count( $images );
266
+
267
+ return $number;
268
+ }
269
+
270
+
271
+ /**
272
+ * Output gallery
273
+ *
274
+ * @since 1.0
275
+ */
276
+ function easy_image_gallery() {
277
+
278
+ $attachment_ids = easy_image_gallery_get_image_ids();
279
+
280
+ global $post;
281
+
282
+ if ( $attachment_ids ) { ?>
283
+
284
+ <?php
285
+ global $post;
286
+
287
+ $has_gallery_images = get_post_meta( get_the_ID(), '_easy_image_gallery', true );
288
+
289
+ if ( !$has_gallery_images )
290
+ return;
291
+
292
+ // convert string into array
293
+ $has_gallery_images = explode( ',', get_post_meta( get_the_ID(), '_easy_image_gallery', true ) );
294
+
295
+ // clean the array (remove empty values)
296
+ $has_gallery_images = array_filter( $has_gallery_images );
297
+
298
+ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'feature' );
299
+ $image_title = esc_attr( get_the_title( get_post_thumbnail_id( $post->ID ) ) );
300
+
301
+ // css classes array
302
+ $classes = array();
303
+
304
+ // thumbnail count
305
+ $classes[] = $has_gallery_images ? 'thumbnails-' . easy_image_gallery_count_images() : '';
306
+
307
+ // linked images
308
+ $classes[] = easy_image_gallery_has_linked_images() ? 'linked' : '';
309
+
310
+ $classes = implode( ' ', $classes );
311
+
312
+ ob_start();
313
+ ?>
314
+
315
+ <ul class="image-gallery <?php echo $classes; ?>">
316
+ <?php
317
+ foreach ( $attachment_ids as $attachment_id ) {
318
+
319
+ $classes = array( 'popup' );
320
+
321
+ // get original image
322
+ $image_link = wp_get_attachment_image_src( $attachment_id, apply_filters( 'linked_image_size', 'large' ) );
323
+ $image_link = $image_link[0];
324
+
325
+ $image = wp_get_attachment_image( $attachment_id, apply_filters( 'thumbnail_image_size', 'thumbnail' ), '', array( 'alt' => trim( strip_tags( get_post_meta( $attachment_id, '_wp_attachment_image_alt', true ) ) ) ) );
326
+
327
+ $image_title = esc_attr( get_the_title( $attachment_id ) );
328
+ $image_class = esc_attr( implode( ' ', $classes ) );
329
+
330
+ $lightbox = easy_image_gallery_get_lightbox();
331
+
332
+ $rel = easy_image_gallery_count_images() > 1 ? 'rel="'. $lightbox .'[group]"' : 'rel="'. $lightbox .'"';
333
+
334
+ if ( easy_image_gallery_has_linked_images() )
335
+ $html = sprintf( '<li><a %s href="%s" class="%s" title="%s"><i class="icon-view"></i><span class="overlay"></span>%s</a></li>', $rel, $image_link, $image_class, $image_title, $image );
336
+ else
337
+ $html = sprintf( '<li>%s</li>', $image );
338
+
339
+ echo apply_filters( 'easy_image_gallery_html', $html, $rel, $image_link, $image_class, $image_title, $image, $attachment_id, $post->ID );
340
+ }
341
+ ?>
342
+ </ul>
343
+
344
+ <?php
345
+ $gallery = ob_get_clean();
346
+
347
+ return apply_filters( 'easy_image_gallery', $gallery );
348
+ ?>
349
+
350
+ <?php }
351
+ }
352
+
353
+ /**
354
+ * Append gallery images to page automatically
355
+ *
356
+ * @since 1.0
357
+ */
358
+ function easy_image_gallery_append_to_content( $content ) {
359
+
360
+ if ( is_singular() && is_main_query() && easy_image_gallery_allowed_post_type() ) {
361
+ $new_content = easy_image_gallery();
362
+ $content .= $new_content;
363
+ }
364
+
365
+ return $content;
366
+
367
+ }
368
+ add_filter( 'the_content', 'easy_image_gallery_append_to_content' );
369
+
370
+
371
+ /**
372
+ * Remove the_content filter if shortcode is detected on page
373
+ *
374
+ * @since 1.0
375
+ */
376
+ function easy_image_gallery_template_redirect() {
377
+
378
+ if ( easy_image_gallery_has_shortcode( 'easy_image_gallery' ) )
379
+ remove_filter( 'the_content', 'easy_image_gallery_append_to_content' );
380
+
381
+ }
382
+ add_action( 'template_redirect', 'easy_image_gallery_template_redirect' );
languages/default.mo ADDED
Binary file
languages/default.po ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Easy Image Gallery\n"
4
+ "POT-Creation-Date: 2013-07-05 20:00+1200\n"
5
+ "PO-Revision-Date: 2013-07-05 20:00+1200\n"
6
+ "Last-Translator: \n"
7
+ "Language-Team: Sumobi <andrew@sumobi.com>\n"
8
+ "MIME-Version: 1.0\n"
9
+ "Content-Type: text/plain; charset=UTF-8\n"
10
+ "Content-Transfer-Encoding: 8bit\n"
11
+ "X-Generator: Poedit 1.5.5\n"
12
+ "X-Poedit-KeywordsList: __;_e;esc_attr_e\n"
13
+ "X-Poedit-Basepath: .\n"
14
+ "X-Poedit-SearchPath-0: ..\n"
15
+
16
+ #: ../includes/admin-page.php:8 ../includes/admin-page.php:22
17
+ msgid "Easy Image Gallery"
18
+ msgstr ""
19
+
20
+ #: ../includes/admin-page.php:50
21
+ msgid "General"
22
+ msgstr ""
23
+
24
+ #: ../includes/admin-page.php:53
25
+ msgid "Lightbox"
26
+ msgstr ""
27
+
28
+ #: ../includes/admin-page.php:54
29
+ msgid "Post Types"
30
+ msgstr ""
31
+
32
+ #: ../includes/admin-page.php:81
33
+ #, php-format
34
+ msgid "Please note: fancyBox requires a %s for commercial use"
35
+ msgstr ""
36
+
37
+ #: ../includes/admin-page.php:156
38
+ msgid "Settings"
39
+ msgstr ""
40
+
41
+ #: ../includes/metabox.php:19
42
+ msgid "Image Gallery"
43
+ msgstr ""
44
+
45
+ #: ../includes/metabox.php:48 ../includes/metabox.php:136
46
+ msgid "Remove image"
47
+ msgstr ""
48
+
49
+ #: ../includes/metabox.php:62
50
+ msgid "Add gallery images"
51
+ msgstr ""
52
+
53
+ #: ../includes/metabox.php:77
54
+ msgid "Link images to larger sizes"
55
+ msgstr ""
56
+
57
+ #: ../includes/metabox.php:111
58
+ msgid "Add Images to Gallery"
59
+ msgstr ""
60
+
61
+ #: ../includes/metabox.php:113
62
+ msgid "Add to gallery"
63
+ msgstr ""
64
+
65
+ #: ../includes/template-functions.php:62
66
+ msgid "fancyBox"
67
+ msgstr ""
68
+
69
+ #: ../includes/template-functions.php:63
70
+ msgid "prettyPhoto"
71
+ msgstr ""
readme.txt ADDED
@@ -0,0 +1,109 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Easy Image Gallery ===
2
+ Contributors: sumobi
3
+ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=EFUPMPEZPGW7L
4
+ Tags: image gallery, image, galleries, simple, easy, sumobi
5
+ Requires at least: 3.5
6
+ Tested up to: 3.6
7
+ Stable tag: 1.0.1
8
+ License: GPLv2 or later
9
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
+
11
+ Easily create an image gallery on your posts, pages or any custom post type
12
+
13
+ == Description ==
14
+
15
+ There comes a time when you need more flexibility than the standard WP gallery offers, That's when this plugin steps in. This plugin's goal to to make it easy to create a gallery and place it wherever you need. A perfect example would be to create a product gallery for an ecommerce website and then have the flexibility to position it where you wanted to match your theme's design.
16
+
17
+ This plugin allows you to easily create an image gallery on any post, page or custom post type. Images are can be added and previewed from the metabox. Images can be re-ordered by drag and drop.
18
+
19
+ Features:
20
+
21
+ 1. Drag and drop re-ordering
22
+ 1. Add gallery to any post, page or custom post type
23
+ 1. If more than one image is added to the gallery, the images become grouped in the lightbox so you can easily view the next one
24
+ 1. CSS and JS are only loaded on pages where needed
25
+ 1. Images link to larger versions (can be turned off)
26
+ 1. Fully Localized (translation ready) with .mo and .po files
27
+ 1. Add multiple images to the gallery at once
28
+ 1. Uses the thumbnail size specified in Settings -> Media
29
+ 1. Custom webfont icon for hover effect
30
+ 1. Support for fancyBox and prettyPhoto (developers can easily add their preferred lightbox via hooks and filters)
31
+ 1. Uses the new WP 3.5+ media manager for a familiar and intuitive way to add your images
32
+ 1. WordPress 3.6 Ready
33
+
34
+ = Usage =
35
+
36
+ Galleries are automatically appended to the bottom of your post/page unless you use the shortcode below. Using the shortcode will give you finer control over placement within the content area.
37
+
38
+ = Note =
39
+
40
+ fancyBox requires a [license for commercial use](http://fancyapps.com/fancybox/#license "fancyBox"). It's free to use for personal websites however.
41
+
42
+ = Shortcode Usage =
43
+
44
+ Use the following shortcode anywhere in the content area to display the gallery
45
+
46
+ [easy_image_gallery]
47
+
48
+ = Template Tag Usage =
49
+
50
+ The following template tag is available to display the gallery
51
+
52
+ if( function_exists( 'easy_image_gallery' ) ) {
53
+ echo easy_image_gallery();
54
+ }
55
+
56
+ If you use the template tag above, you will need remove the default content filter:
57
+
58
+ remove_filter( 'the_content', 'easy_image_gallery_append_to_content' );
59
+
60
+ = Developer Friendly =
61
+
62
+ 1. Modify the gallery HTML using filters
63
+ 1. Developed with WP Coding Standards
64
+ 1. Easily add your preferred lightbox script via hooks and filters
65
+ 1. Easily unhook CSS and add your own styling
66
+ 1. Pass in a different image size for the thumbnails via filter
67
+ 1. Minimalistic markup and styling
68
+
69
+ **Stay up to date**
70
+
71
+ *Become a fan on Facebook*
72
+ [http://www.facebook.com/sumobicom](http://www.facebook.com/sumobicom "Facebook")
73
+
74
+ *Follow me on Twitter*
75
+ [http://twitter.com/sumobi_](http://twitter.com/sumobi_ "Twitter")
76
+
77
+ == Installation ==
78
+
79
+ 1. Upload the entire `easy-image-gallery` folder to the `/wp-content/plugins/` directory, or just upload the ZIP package via 'Plugins > Add New > Upload' in your WP Admin
80
+ 1. Activate Easy Image Gallery from the 'Plugins' page in WordPress
81
+ 1. Configure the plugin's settings from plugins > Easy Image Gallery
82
+ 1. Create a gallery on any post or page from the added 'Image Gallery' metabox.
83
+
84
+ == Screenshots ==
85
+
86
+ 1. The plugin's simple configuration screen. Any existing custom post types will appear here
87
+ 1. The plugin's simple metabox that is added to the publish/edit screens
88
+ 1. WordPress 3.5's new media manager is launched when you click "Add gallery images". You can select multiple images to insert into the gallery
89
+ 1. The plugin's Image Gallery metabox after images have been inserted and the post has been saved
90
+ 1. The front-end of the website showing the gallery which has been automatically appended to the content
91
+ 1. Clicking on an image launches the lightbox. Here it's shown with prettyPhoto
92
+
93
+ == Changelog ==
94
+
95
+ = 1.0.1 =
96
+
97
+ * Tweak: Images now link to the "large" image size by default, rather than the original image
98
+ * Tweak: Removed "remove" links underneath each image and added a [-] on hover to be consistent with WordPress' media manager styling
99
+ * New: linked_image_size filter for specifying which image size the thumbnails should link to
100
+ * New: 2 new filters added for overriding the JS for prettyPhoto and fancyBox. easy_image_gallery_prettyphoto_js and easy_image_gallery_fancybox_js
101
+
102
+ = 1.0 =
103
+
104
+ * Initial release
105
+
106
+ == Upgrade Notice ==
107
+
108
+ = 1.0.1 =
109
+ More consistent styling with WordPress' Media Manager
uninstall.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ //if uninstall not called from WordPress exit
4
+ if ( !defined( 'WP_UNINSTALL_PLUGIN' ) )
5
+ exit ();
6
+
7
+ delete_option( 'easy-image-gallery' );