Version Description
- Added: Gallery, Gallery group, Tag edit links in widget for Elementor.
- Improved: Add gallery images to the XML generated with Yoast or Seo by 10Web.
- Updated: jQuery File Upload framework.
- Fixed: Shortcode buttons behaviour in Text widget of Divi Builder.
- Fixed: Vulnerabilities.
- Fixed: Opening shared URLs.
- Fixed: Click action on image title click.
- Fixed: Filmstrip arrows alignment.
- Fixed: Masonry layout after closing lightbox.
- Fixed: Do not reset shortcode options on 'Use default options' enable/disable.
- Fixed: Titles on masonry view.
- Fixed: Images ordering in lightbox.
- Fixed: Don't delete tags on deleting all images.
- Removed: Webinar banner.
Download this release
Release Info
Developer | 10web |
Plugin | Photo Gallery by WD – Responsive Photo Gallery |
Version | 1.5.35 |
Comparing to | |
See all releases |
Code changes from version 1.5.34 to 1.5.35
- admin/controllers/Albumsgalleries.php +1 -1
- admin/controllers/Options.php +7 -3
- admin/controllers/elementorWidget.php +83 -22
- admin/models/Galleries.php +7 -6
- admin/views/Options.php +2 -2
- admin/views/Shortcode.php +9 -10
- css/bwg_frontend.css +7 -1
- css/styles.min.css +1 -1
- filemanager/js/jq_uploader/jquery.fileupload.js +1554 -1445
- filemanager/js/jq_uploader/jquery.iframe-transport.js +202 -205
- filemanager/view.php +2 -2
- framework/WDWLibrary.php +17 -16
- framework/WDWSitemap.php +97 -0
- framework/howto/data.php +6 -6
- frontend/controllers/controller.php +158 -163
- frontend/models/model.php +2 -0
- frontend/views/BWGViewGalleryBox.php +7 -7
- frontend/views/BWGViewSlideshow.php +5 -5
- frontend/views/view.php +25 -25
- js/bwg.js +20 -1
- js/bwg_elementor_widget.js +68 -0
- js/bwg_frontend.js +54 -51
- js/bwg_shortcode.js +7 -2
- js/scripts.min.js +1 -1
- photo-gallery.php +28 -8
- readme.txt +43 -23
admin/controllers/Albumsgalleries.php
CHANGED
@@ -49,7 +49,7 @@ class AlbumsgalleriesController_bwg {
|
|
49 |
$params = array();
|
50 |
$params['page_title'] = __('Galleries / Gallery groups', BWG()->prefix);
|
51 |
$params['page_url'] = $this->page;
|
52 |
-
$params['album_id'] = WDWLibrary::get('album_id', 0);
|
53 |
$params['order'] = WDWLibrary::get('order', 'asc');
|
54 |
$params['orderby'] = WDWLibrary::get('orderby', 'is_album');
|
55 |
// To prevent SQL injections.
|
49 |
$params = array();
|
50 |
$params['page_title'] = __('Galleries / Gallery groups', BWG()->prefix);
|
51 |
$params['page_url'] = $this->page;
|
52 |
+
$params['album_id'] = WDWLibrary::get('album_id', 0, 'intval');
|
53 |
$params['order'] = WDWLibrary::get('order', 'asc');
|
54 |
$params['orderby'] = WDWLibrary::get('orderby', 'is_album');
|
55 |
// To prevent SQL injections.
|
admin/controllers/Options.php
CHANGED
@@ -25,8 +25,12 @@ class OptionsController_bwg {
|
|
25 |
);
|
26 |
$built_in_watermark_fonts = array();
|
27 |
foreach (scandir(path_join(BWG()->plugin_dir, 'fonts')) as $filename) {
|
28 |
-
if (strpos($filename, '.') === 0)
|
29 |
-
|
|
|
|
|
|
|
|
|
30 |
}
|
31 |
$params['built_in_watermark_fonts'] = $built_in_watermark_fonts;
|
32 |
$params['watermark_fonts'] = array(
|
@@ -224,7 +228,7 @@ class OptionsController_bwg {
|
|
224 |
'built_in_watermark_position' => WDWLibrary::get('built_in_watermark_position')
|
225 |
);
|
226 |
if ( $update_options['built_in_watermark_type'] == 'text' ){
|
227 |
-
$update_options['built_in_watermark_text'] = WDWLibrary::get('built_in_watermark_text');
|
228 |
$update_options['built_in_watermark_font_size'] = WDWLibrary::get('built_in_watermark_font_size');
|
229 |
$update_options['built_in_watermark_font'] = WDWLibrary::get('built_in_watermark_font');
|
230 |
$update_options['built_in_watermark_color'] = WDWLibrary::get('built_in_watermark_color');
|
25 |
);
|
26 |
$built_in_watermark_fonts = array();
|
27 |
foreach (scandir(path_join(BWG()->plugin_dir, 'fonts')) as $filename) {
|
28 |
+
if ( strpos($filename, '.') === 0 || strpos($filename, 'twbb') !== FALSE ) {
|
29 |
+
continue;
|
30 |
+
}
|
31 |
+
else {
|
32 |
+
$built_in_watermark_fonts[] = $filename;
|
33 |
+
}
|
34 |
}
|
35 |
$params['built_in_watermark_fonts'] = $built_in_watermark_fonts;
|
36 |
$params['watermark_fonts'] = array(
|
228 |
'built_in_watermark_position' => WDWLibrary::get('built_in_watermark_position')
|
229 |
);
|
230 |
if ( $update_options['built_in_watermark_type'] == 'text' ){
|
231 |
+
$update_options['built_in_watermark_text'] = WDWLibrary::get('built_in_watermark_text', '', 'sanitize_text_field');
|
232 |
$update_options['built_in_watermark_font_size'] = WDWLibrary::get('built_in_watermark_font_size');
|
233 |
$update_options['built_in_watermark_font'] = WDWLibrary::get('built_in_watermark_font');
|
234 |
$update_options['built_in_watermark_color'] = WDWLibrary::get('built_in_watermark_color');
|
admin/controllers/elementorWidget.php
CHANGED
@@ -41,6 +41,73 @@ class BWGElementor extends \Elementor\Widget_Base {
|
|
41 |
* Register widget controls.
|
42 |
*/
|
43 |
protected function _register_controls() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
$this->start_controls_section(
|
45 |
'bwg_general',
|
46 |
[
|
@@ -73,29 +140,22 @@ class BWGElementor extends \Elementor\Widget_Base {
|
|
73 |
'bwg_gallery_view_type',
|
74 |
[
|
75 |
'label_block' => true,
|
76 |
-
'description' => __('Select the gallery view type.', BWG()->prefix) . '<a target="_balnk" href="' .
|
77 |
'type' => \Elementor\Controls_Manager::SELECT,
|
78 |
'default' => 'thumbnails',
|
79 |
-
'options' =>
|
80 |
-
'thumbnails' => __('Thumbnails', BWG()->prefix),
|
81 |
-
'thumbnails_masonry' => __('Masonry', BWG()->prefix),
|
82 |
-
'thumbnails_mosaic' => __('Mosaic', BWG()->prefix),
|
83 |
-
'slideshow' => __('Slideshow', BWG()->prefix),
|
84 |
-
'image_browser' => __('Image browser', BWG()->prefix),
|
85 |
-
'blog_style' => __('Blog style', BWG()->prefix),
|
86 |
-
'carousel' => __('Carousel', BWG()->prefix),
|
87 |
-
],
|
88 |
'condition' => [
|
89 |
'bwg_view_type_tabs' => 'gallery',
|
90 |
],
|
91 |
]
|
92 |
);
|
|
|
93 |
$this->add_control(
|
94 |
'bwg_galleries',
|
95 |
[
|
96 |
'label' => __('Gallery', BWG()->prefix),
|
97 |
'label_block' => true,
|
98 |
-
'description' => __('Select the gallery to display.', BWG()->prefix) . '<a target="_balnk" href="' .
|
99 |
'type' => \Elementor\Controls_Manager::SELECT,
|
100 |
'default' => 0,
|
101 |
'options' => WDWLibrary::get_galleries(),
|
@@ -109,7 +169,7 @@ class BWGElementor extends \Elementor\Widget_Base {
|
|
109 |
[
|
110 |
'label' => __('Tag', BWG()->prefix),
|
111 |
'label_block' => true,
|
112 |
-
'description' => __('Filter gallery images by this tag.', BWG()->prefix) . '<a target="_balnk" href="' .
|
113 |
'type' => \Elementor\Controls_Manager::SELECT,
|
114 |
'default' => 0,
|
115 |
'options' => WDWLibrary::get_tags(),
|
@@ -123,14 +183,10 @@ class BWGElementor extends \Elementor\Widget_Base {
|
|
123 |
'bwg_gallery_group_view_type',
|
124 |
[
|
125 |
'label_block' => true,
|
126 |
-
'description' => __('Select the gallery group type.', BWG()->prefix) . '<a target="_balnk" href="' .
|
127 |
'type' => \Elementor\Controls_Manager::SELECT,
|
128 |
'default' => 'album_compact_preview',
|
129 |
-
'options' =>
|
130 |
-
'album_compact_preview' => __('Compact', BWG()->prefix),
|
131 |
-
'album_masonry_preview' => __('Masonry', BWG()->prefix),
|
132 |
-
'album_extended_preview' => __('Extended', BWG()->prefix),
|
133 |
-
],
|
134 |
'condition' => [
|
135 |
'bwg_view_type_tabs' => 'gallery_group',
|
136 |
],
|
@@ -141,7 +197,7 @@ class BWGElementor extends \Elementor\Widget_Base {
|
|
141 |
[
|
142 |
'label' => __('Gallery group', BWG()->prefix),
|
143 |
'label_block' => true,
|
144 |
-
'description' => __('Select the gallery group to display.', BWG()->prefix) . '<a target="_balnk" href="' .
|
145 |
'type' => \Elementor\Controls_Manager::SELECT,
|
146 |
'default' => 0,
|
147 |
'options' => WDWLibrary::get_gallery_groups(),
|
@@ -156,7 +212,7 @@ class BWGElementor extends \Elementor\Widget_Base {
|
|
156 |
[
|
157 |
'label' => __('Theme', BWG()->prefix),
|
158 |
'label_block' => true,
|
159 |
-
'description' => __('Choose the theme for your gallery.', BWG()->prefix) . '<a target="_balnk" href="' .
|
160 |
'type' => \Elementor\Controls_Manager::SELECT,
|
161 |
'default' => WDWLibrary::get_default_theme(),
|
162 |
'options' => WDWLibrary::get_theme_rows_data(),
|
@@ -184,8 +240,13 @@ class BWGElementor extends \Elementor\Widget_Base {
|
|
184 |
}
|
185 |
$params['theme_id'] = $settings['bwg_theme'];
|
186 |
|
187 |
-
|
|
|
|
|
|
|
|
|
|
|
188 |
}
|
189 |
}
|
190 |
|
191 |
-
\Elementor\Plugin::instance()->widgets_manager->register_widget_type(new BWGElementor());
|
41 |
* Register widget controls.
|
42 |
*/
|
43 |
protected function _register_controls() {
|
44 |
+
if(BWG()->is_pro){
|
45 |
+
$bwg_gallery_view_type_options = array(
|
46 |
+
'thumbnails' => __('Thumbnails', BWG()->prefix),
|
47 |
+
'thumbnails_masonry' => __('Masonry', BWG()->prefix),
|
48 |
+
'thumbnails_mosaic' => __('Mosaic', BWG()->prefix),
|
49 |
+
'slideshow' => __('Slideshow', BWG()->prefix),
|
50 |
+
'image_browser' => __('Image browser', BWG()->prefix),
|
51 |
+
'blog_style' => __('Blog style', BWG()->prefix),
|
52 |
+
'carousel' => __('Carousel', BWG()->prefix),
|
53 |
+
);
|
54 |
+
$bwg_gallery_group_view_type_options = array(
|
55 |
+
'album_compact_preview' => __('Compact', BWG()->prefix),
|
56 |
+
'album_masonry_preview' => __('Masonry', BWG()->prefix),
|
57 |
+
'album_extended_preview' => __('Extended', BWG()->prefix),
|
58 |
+
);
|
59 |
+
}else{
|
60 |
+
$bwg_gallery_view_type_options = array(
|
61 |
+
'thumbnails' => __('Thumbnails', BWG()->prefix),
|
62 |
+
'slideshow' => __('Slideshow', BWG()->prefix),
|
63 |
+
'image_browser' => __('Image browser', BWG()->prefix),
|
64 |
+
);
|
65 |
+
$bwg_gallery_group_view_type_options = array(
|
66 |
+
'album_compact_preview' => __('Compact', BWG()->prefix),
|
67 |
+
'album_extended_preview' => __('Extended', BWG()->prefix),
|
68 |
+
);
|
69 |
+
}
|
70 |
+
$bwg_view_type = add_query_arg(array( 'page' => 'options_' . BWG()->prefix, 'active_tab' => 1, 'gallery_type'=>'thumbnails' ), admin_url('admin.php'));
|
71 |
+
$bwg_group_view_type = add_query_arg(array( 'page' => 'options_' . BWG()->prefix, 'active_tab' => 2, 'album_type'=>'album_compact_preview' ), admin_url('admin.php'));
|
72 |
+
$bwg_edit_link = add_query_arg(array( 'page' => 'galleries_' . BWG()->prefix ), admin_url('admin.php'));
|
73 |
+
$bwd_tag_link= add_query_arg(array( 'taxonomy' => BWG()->prefix . '_tag' ), admin_url('edit-tags.php'));
|
74 |
+
$bwd_theme_link = add_query_arg(array( 'page' => 'themes_' . BWG()->prefix ), admin_url('admin.php'));
|
75 |
+
$bwd_group_link = add_query_arg(array( 'page' => 'albums_' . BWG()->prefix ), admin_url('admin.php'));
|
76 |
+
$default_theme = WDWLibrary::get_default_theme();
|
77 |
+
if(isset($default_theme) && intval($default_theme)>0){
|
78 |
+
$bwd_theme_link = add_query_arg(array( 'page' => 'themes_' . BWG()->prefix, 'task'=>'edit','current_id'=> $default_theme), admin_url('admin.php'));
|
79 |
+
}
|
80 |
+
if($this->get_id() !== null){
|
81 |
+
$settings = $this->get_init_settings();
|
82 |
+
}
|
83 |
+
if(isset($settings) && is_array($settings)){
|
84 |
+
if(isset($settings["bwg_gallery_view_type"])){
|
85 |
+
$bwg_view_type = add_query_arg(array( 'page' => 'options_' . BWG()->prefix, 'active_tab' => 1, 'gallery_type'=>$settings["bwg_gallery_view_type"] ), admin_url('admin.php'));
|
86 |
+
}
|
87 |
+
if(isset($settings["bwg_gallery_group_view_type"])){
|
88 |
+
$bwg_group_view_type = add_query_arg(array( 'page' => 'options_' . BWG()->prefix, 'active_tab' => 2, 'album_type'=>$settings["bwg_gallery_group_view_type"] ), admin_url('admin.php'));
|
89 |
+
}
|
90 |
+
if(isset($settings["bwg_galleries"]) && $settings["bwg_galleries"] !== "0"){
|
91 |
+
$bwg_galleries_id = intval($settings["bwg_galleries"]);
|
92 |
+
$bwg_edit_link = add_query_arg(array( 'page' => 'galleries_' . BWG()->prefix, 'task'=>'edit', 'current_id'=> $bwg_galleries_id), admin_url('admin.php'));
|
93 |
+
}
|
94 |
+
if(isset($settings["bwg_tags"]) && $settings["bwg_tags"] !== "0"){
|
95 |
+
$bwg_tags_id = intval($settings["bwg_tags"]);
|
96 |
+
$bwd_tag_link= add_query_arg(array( 'taxonomy' => BWG()->prefix . '_tag', 'tag_ID'=> $bwg_tags_id), admin_url('term.php'));
|
97 |
+
|
98 |
+
}
|
99 |
+
if(isset($settings["bwg_theme"]) && $settings["bwg_theme"] !== "0"){
|
100 |
+
$bwg_theme_id = intval($settings["bwg_theme"]);
|
101 |
+
$bwd_theme_link = add_query_arg(array( 'page' => 'themes_' . BWG()->prefix, 'task'=>'edit','current_id'=> $bwg_theme_id), admin_url('admin.php'));
|
102 |
+
|
103 |
+
}
|
104 |
+
if(isset($settings["bwg_gallery_group"]) && $settings["bwg_gallery_group"] !== "0"){
|
105 |
+
$bwg_group_id = intval($settings["bwg_gallery_group"]);
|
106 |
+
$bwd_group_link = add_query_arg(array( 'page' => 'albums_' . BWG()->prefix, 'task'=>'edit', 'current_id'=>$bwg_group_id ), admin_url('admin.php'));
|
107 |
+
}
|
108 |
+
}
|
109 |
+
|
110 |
+
|
111 |
$this->start_controls_section(
|
112 |
'bwg_general',
|
113 |
[
|
140 |
'bwg_gallery_view_type',
|
141 |
[
|
142 |
'label_block' => true,
|
143 |
+
'description' => __('Select the gallery view type.', BWG()->prefix) . '<a target="_balnk" href="' . $bwg_view_type . '">' . __('Edit options', BWG()->prefix) . '</a>',
|
144 |
'type' => \Elementor\Controls_Manager::SELECT,
|
145 |
'default' => 'thumbnails',
|
146 |
+
'options' => $bwg_gallery_view_type_options,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
147 |
'condition' => [
|
148 |
'bwg_view_type_tabs' => 'gallery',
|
149 |
],
|
150 |
]
|
151 |
);
|
152 |
+
|
153 |
$this->add_control(
|
154 |
'bwg_galleries',
|
155 |
[
|
156 |
'label' => __('Gallery', BWG()->prefix),
|
157 |
'label_block' => true,
|
158 |
+
'description' => __('Select the gallery to display.', BWG()->prefix) . '<a target="_balnk" href="' . $bwg_edit_link . '">' . __('Edit gallery', BWG()->prefix) . '</a>',
|
159 |
'type' => \Elementor\Controls_Manager::SELECT,
|
160 |
'default' => 0,
|
161 |
'options' => WDWLibrary::get_galleries(),
|
169 |
[
|
170 |
'label' => __('Tag', BWG()->prefix),
|
171 |
'label_block' => true,
|
172 |
+
'description' => __('Filter gallery images by this tag.', BWG()->prefix) . '<a target="_balnk" href="' .$bwd_tag_link . '">' . __('Edit tag', BWG()->prefix) . '</a>',
|
173 |
'type' => \Elementor\Controls_Manager::SELECT,
|
174 |
'default' => 0,
|
175 |
'options' => WDWLibrary::get_tags(),
|
183 |
'bwg_gallery_group_view_type',
|
184 |
[
|
185 |
'label_block' => true,
|
186 |
+
'description' => __('Select the gallery group type.', BWG()->prefix) . '<a target="_balnk" href="' . $bwg_group_view_type . '">' . __('Edit options', BWG()->prefix) . '</a>',
|
187 |
'type' => \Elementor\Controls_Manager::SELECT,
|
188 |
'default' => 'album_compact_preview',
|
189 |
+
'options' => $bwg_gallery_group_view_type_options,
|
|
|
|
|
|
|
|
|
190 |
'condition' => [
|
191 |
'bwg_view_type_tabs' => 'gallery_group',
|
192 |
],
|
197 |
[
|
198 |
'label' => __('Gallery group', BWG()->prefix),
|
199 |
'label_block' => true,
|
200 |
+
'description' => __('Select the gallery group to display.', BWG()->prefix) . '<a target="_balnk" href="' . $bwd_group_link . '">' . __('Edit gallery group', BWG()->prefix) . '</a>',
|
201 |
'type' => \Elementor\Controls_Manager::SELECT,
|
202 |
'default' => 0,
|
203 |
'options' => WDWLibrary::get_gallery_groups(),
|
212 |
[
|
213 |
'label' => __('Theme', BWG()->prefix),
|
214 |
'label_block' => true,
|
215 |
+
'description' => (BWG()->is_pro ? __('Choose the theme for your gallery.', BWG()->prefix) . '<a target="_balnk" href="' . $bwd_theme_link . '">' . __('Edit theme', BWG()->prefix). '</a>' : __('You can\'t edit theme in free version.', BWG()->prefix)),
|
216 |
'type' => \Elementor\Controls_Manager::SELECT,
|
217 |
'default' => WDWLibrary::get_default_theme(),
|
218 |
'options' => WDWLibrary::get_theme_rows_data(),
|
240 |
}
|
241 |
$params['theme_id'] = $settings['bwg_theme'];
|
242 |
|
243 |
+
if ( doing_filter('wd_seo_sitemap_images') ) {
|
244 |
+
WDWSitemap::instance()->shortcode($params);
|
245 |
+
}
|
246 |
+
else {
|
247 |
+
echo BWG()->shortcode($params);
|
248 |
+
}
|
249 |
}
|
250 |
}
|
251 |
|
252 |
+
\Elementor\Plugin::instance()->widgets_manager->register_widget_type( new BWGElementor() );
|
admin/models/Galleries.php
CHANGED
@@ -445,9 +445,9 @@ class GalleriesModel_bwg {
|
|
445 |
continue;
|
446 |
}
|
447 |
$thumb_url = WDWLibrary::get('thumb_url_' . $image_id, '');
|
448 |
-
$description = str_replace(array('\\', '\t'), '', WDWLibrary::get('image_description_' . $image_id, ''));
|
449 |
-
$alt = str_replace(array('\\', '\t'), '', WDWLibrary::get('image_alt_text_' . $image_id, '',
|
450 |
-
$alt =
|
451 |
$date = WDWLibrary::get('input_date_modified_' . $image_id, '');
|
452 |
$size = WDWLibrary::get('input_size_' . $image_id, '');
|
453 |
$filetype = WDWLibrary::get('input_filetype_' . $image_id, '');
|
@@ -502,8 +502,9 @@ class GalleriesModel_bwg {
|
|
502 |
$image_id = $new_image_id;
|
503 |
}
|
504 |
else {
|
505 |
-
$resolution_thumb
|
506 |
-
|
|
|
507 |
$save = $wpdb->update($wpdb->prefix . 'bwg_image', $data, array( 'id' => $image_id ));
|
508 |
}
|
509 |
|
@@ -654,7 +655,7 @@ class GalleriesModel_bwg {
|
|
654 |
if ( $search ) {
|
655 |
$where .= ' AND `filename` LIKE "%' . $search . '%"';
|
656 |
}
|
657 |
-
$image_where = ($all ? '' : ' WHERE image_id=' . $id);
|
658 |
|
659 |
$delete = $wpdb->query('DELETE FROM `' . $wpdb->prefix . 'bwg_image`' . $where);
|
660 |
$wpdb->query('DELETE FROM `' . $wpdb->prefix . 'bwg_image_comment`' . $image_where);
|
445 |
continue;
|
446 |
}
|
447 |
$thumb_url = WDWLibrary::get('thumb_url_' . $image_id, '');
|
448 |
+
$description = str_replace(array('\\', '\t'), '', WDWLibrary::get('image_description_' . $image_id, 'wp_filter_post_kses'));
|
449 |
+
$alt = str_replace(array('\\', '\t'), '', WDWLibrary::get('image_alt_text_' . $image_id, '', 'wp_filter_post_kses'));
|
450 |
+
$alt = preg_replace("/<a[^>]*>|<\/a>/", '', $alt);
|
451 |
$date = WDWLibrary::get('input_date_modified_' . $image_id, '');
|
452 |
$size = WDWLibrary::get('input_size_' . $image_id, '');
|
453 |
$filetype = WDWLibrary::get('input_filetype_' . $image_id, '');
|
502 |
$image_id = $new_image_id;
|
503 |
}
|
504 |
else {
|
505 |
+
if($data['resolution_thumb'] == '') {
|
506 |
+
unset($data['resolution_thumb']);
|
507 |
+
}
|
508 |
$save = $wpdb->update($wpdb->prefix . 'bwg_image', $data, array( 'id' => $image_id ));
|
509 |
}
|
510 |
|
655 |
if ( $search ) {
|
656 |
$where .= ' AND `filename` LIKE "%' . $search . '%"';
|
657 |
}
|
658 |
+
$image_where = ($all ? 'WHERE gallery_id=' . $gallery_id : ' WHERE image_id=' . $id);
|
659 |
|
660 |
$delete = $wpdb->query('DELETE FROM `' . $wpdb->prefix . 'bwg_image`' . $where);
|
661 |
$wpdb->query('DELETE FROM `' . $wpdb->prefix . 'bwg_image_comment`' . $image_where);
|
admin/views/Options.php
CHANGED
@@ -219,7 +219,7 @@ class OptionsView_bwg extends AdminView_bwg {
|
|
219 |
</div>
|
220 |
<div class="wd-box-content wd-width-100">
|
221 |
<div class="wd-group">
|
222 |
-
<label class="wd-label"><?php _e('Search
|
223 |
<div class="bwg-flex">
|
224 |
<input type="radio" name="noindex_custom_post" id="noindex_custom_post_1" value="1" <?php if ($row->noindex_custom_post) echo 'checked="checked"'; ?> /><label for="noindex_custom_post_1" class="wd-radio-label"><?php _e('Yes', BWG()->prefix); ?></label>
|
225 |
<input type="radio" name="noindex_custom_post" id="noindex_custom_post_0" value="0" <?php if (!$row->noindex_custom_post) echo 'checked="checked"'; ?> /><label for="noindex_custom_post_0" class="wd-radio-label"><?php _e('No', BWG()->prefix); ?></label>
|
@@ -860,7 +860,7 @@ class OptionsView_bwg extends AdminView_bwg {
|
|
860 |
<div class="wd-group">
|
861 |
<label class="wd-label" for="built_in_watermark_text"><?php _e('Watermark text', BWG()->prefix); ?></label>
|
862 |
<div class="bwg-flex">
|
863 |
-
<input type="text" name="built_in_watermark_text" id="built_in_watermark_text" style="width: 100%;" value="<?php echo $row->built_in_watermark_text; ?>" onchange="preview_built_in_watermark()" onkeypress="preview_built_in_watermark()" />
|
864 |
</div>
|
865 |
<p class="description"><?php _e('Provide the text to add to images as watermark.', BWG()->prefix) ?></p>
|
866 |
</div>
|
219 |
</div>
|
220 |
<div class="wd-box-content wd-width-100">
|
221 |
<div class="wd-group">
|
222 |
+
<label class="wd-label"><?php _e('Discourage Search Engine Visibility', BWG()->prefix); ?></label>
|
223 |
<div class="bwg-flex">
|
224 |
<input type="radio" name="noindex_custom_post" id="noindex_custom_post_1" value="1" <?php if ($row->noindex_custom_post) echo 'checked="checked"'; ?> /><label for="noindex_custom_post_1" class="wd-radio-label"><?php _e('Yes', BWG()->prefix); ?></label>
|
225 |
<input type="radio" name="noindex_custom_post" id="noindex_custom_post_0" value="0" <?php if (!$row->noindex_custom_post) echo 'checked="checked"'; ?> /><label for="noindex_custom_post_0" class="wd-radio-label"><?php _e('No', BWG()->prefix); ?></label>
|
860 |
<div class="wd-group">
|
861 |
<label class="wd-label" for="built_in_watermark_text"><?php _e('Watermark text', BWG()->prefix); ?></label>
|
862 |
<div class="bwg-flex">
|
863 |
+
<input type="text" name="built_in_watermark_text" id="built_in_watermark_text" style="width: 100%;" value="<?php echo esc_attr($row->built_in_watermark_text); ?>" onchange="preview_built_in_watermark()" onkeypress="preview_built_in_watermark()" />
|
864 |
</div>
|
865 |
<p class="description"><?php _e('Provide the text to add to images as watermark.', BWG()->prefix) ?></p>
|
866 |
</div>
|
admin/views/Shortcode.php
CHANGED
@@ -586,10 +586,9 @@ class ShortcodeView_bwg extends AdminView_bwg {
|
|
586 |
jQuery("select[id=album] option[value='" + short_code['album_id'] + "']").attr('selected', 'selected');
|
587 |
jQuery("select[id=tag] option[value='" + short_code['tag'] + "']").attr('selected', 'selected');
|
588 |
bwg_gallery_type(short_code['gallery_type']);
|
589 |
-
if (short_code['use_option_defaults']
|
590 |
-
|
591 |
}
|
592 |
-
jQuery("#use_option_defaults").prop('checked', false).trigger('change');
|
593 |
switch (short_code['gallery_type']) {
|
594 |
case 'thumbnails': {
|
595 |
jQuery("#thumb_width").val(short_code['thumb_width']);
|
@@ -1039,7 +1038,7 @@ class ShortcodeView_bwg extends AdminView_bwg {
|
|
1039 |
}
|
1040 |
jQuery("select[id=blog_style_sort_by] option[value='" + short_code['sort_by'] + "']").attr('selected', 'selected');
|
1041 |
jQuery("select[id=blog_style_order_by] option[value='" + short_code['order_by'] + "']").attr('selected', 'selected');
|
1042 |
-
|
1043 |
jQuery("#blog_style_thumb_name_yes").attr('checked', 'checked');
|
1044 |
}
|
1045 |
else {
|
@@ -1144,7 +1143,7 @@ class ShortcodeView_bwg extends AdminView_bwg {
|
|
1144 |
jQuery("#album_images_per_page").val(short_code['compuct_album_images_per_page']);
|
1145 |
jQuery("select[id=compact_album_sort_by] option[value='" + short_code['all_album_sort_by'] + "']").attr('selected', 'selected');
|
1146 |
jQuery("select[id=compact_album_order_by] option[value='" + short_code['all_album_order_by'] + "']").attr('selected', 'selected');
|
1147 |
-
|
1148 |
jQuery("select[id=album_order_by] option[value='" + short_code['order_by'] + "']").attr('selected', 'selected');
|
1149 |
|
1150 |
if (short_code['show_search_box'] == 1) {
|
@@ -1184,8 +1183,8 @@ class ShortcodeView_bwg extends AdminView_bwg {
|
|
1184 |
jQuery("#album_show_gallery_description_0").attr('checked', 'checked');
|
1185 |
}
|
1186 |
jQuery("input[name=album_title_show_hover][value=" + short_code['compuct_album_title'] + "]").attr('checked', 'checked');
|
1187 |
-
|
1188 |
-
|
1189 |
jQuery("input[name='album_image_title_show_hover'][value='" + short_code['compuct_album_image_title'] + "']").attr('checked', 'checked');
|
1190 |
if (short_code['compuct_album_mosaic_hor_ver'] == "vertical") {
|
1191 |
jQuery("#album_mosaic_0").attr('checked', 'checked');
|
@@ -1347,8 +1346,8 @@ class ShortcodeView_bwg extends AdminView_bwg {
|
|
1347 |
else {
|
1348 |
jQuery("#album_extended_show_gallery_description_0").attr('checked', 'checked');
|
1349 |
}
|
1350 |
-
|
1351 |
-
|
1352 |
jQuery("input[name='album_extended_image_title_show_hover'][value='" + short_code['extended_album_image_title'] + "']").attr('checked', 'checked');
|
1353 |
if (short_code['extended_album_mosaic_hor_ver'] == "vertical") {
|
1354 |
jQuery("#album_extended_mosaic_0").attr('checked', 'checked');
|
@@ -2113,7 +2112,7 @@ class ShortcodeView_bwg extends AdminView_bwg {
|
|
2113 |
return;
|
2114 |
}
|
2115 |
function bwg_before_shortcode_add_builder_editor() {
|
2116 |
-
if ( top.jQuery('body').hasClass('elementor-editor-active') || top.jQuery('body').hasClass('fl-builder') ) {
|
2117 |
return true;
|
2118 |
}
|
2119 |
return false;
|
586 |
jQuery("select[id=album] option[value='" + short_code['album_id'] + "']").attr('selected', 'selected');
|
587 |
jQuery("select[id=tag] option[value='" + short_code['tag'] + "']").attr('selected', 'selected');
|
588 |
bwg_gallery_type(short_code['gallery_type']);
|
589 |
+
if (short_code['use_option_defaults'] != 1) {
|
590 |
+
jQuery("#use_option_defaults").prop('checked', false).trigger('change');
|
591 |
}
|
|
|
592 |
switch (short_code['gallery_type']) {
|
593 |
case 'thumbnails': {
|
594 |
jQuery("#thumb_width").val(short_code['thumb_width']);
|
1038 |
}
|
1039 |
jQuery("select[id=blog_style_sort_by] option[value='" + short_code['sort_by'] + "']").attr('selected', 'selected');
|
1040 |
jQuery("select[id=blog_style_order_by] option[value='" + short_code['order_by'] + "']").attr('selected', 'selected');
|
1041 |
+
if (short_code['showthumbs_name'] == 1) {
|
1042 |
jQuery("#blog_style_thumb_name_yes").attr('checked', 'checked');
|
1043 |
}
|
1044 |
else {
|
1143 |
jQuery("#album_images_per_page").val(short_code['compuct_album_images_per_page']);
|
1144 |
jQuery("select[id=compact_album_sort_by] option[value='" + short_code['all_album_sort_by'] + "']").attr('selected', 'selected');
|
1145 |
jQuery("select[id=compact_album_order_by] option[value='" + short_code['all_album_order_by'] + "']").attr('selected', 'selected');
|
1146 |
+
jQuery("select[id=album_sort_by] option[value='" + short_code['sort_by'] + "']").attr('selected', 'selected');
|
1147 |
jQuery("select[id=album_order_by] option[value='" + short_code['order_by'] + "']").attr('selected', 'selected');
|
1148 |
|
1149 |
if (short_code['show_search_box'] == 1) {
|
1183 |
jQuery("#album_show_gallery_description_0").attr('checked', 'checked');
|
1184 |
}
|
1185 |
jQuery("input[name=album_title_show_hover][value=" + short_code['compuct_album_title'] + "]").attr('checked', 'checked');
|
1186 |
+
jQuery('#album_view_type').find('option').removeAttr("selected");
|
1187 |
+
jQuery("#album_view_type option[value='"+ short_code['compuct_album_view_type'] +"']").attr('selected', 'selected');
|
1188 |
jQuery("input[name='album_image_title_show_hover'][value='" + short_code['compuct_album_image_title'] + "']").attr('checked', 'checked');
|
1189 |
if (short_code['compuct_album_mosaic_hor_ver'] == "vertical") {
|
1190 |
jQuery("#album_mosaic_0").attr('checked', 'checked');
|
1346 |
else {
|
1347 |
jQuery("#album_extended_show_gallery_description_0").attr('checked', 'checked');
|
1348 |
}
|
1349 |
+
jQuery('#album_extended_view_type').find('option').removeAttr("selected");
|
1350 |
+
jQuery("#album_extended_view_type option[value='"+ short_code['extended_album_view_type'] +"']").attr('selected', 'selected');
|
1351 |
jQuery("input[name='album_extended_image_title_show_hover'][value='" + short_code['extended_album_image_title'] + "']").attr('checked', 'checked');
|
1352 |
if (short_code['extended_album_mosaic_hor_ver'] == "vertical") {
|
1353 |
jQuery("#album_extended_mosaic_0").attr('checked', 'checked');
|
2112 |
return;
|
2113 |
}
|
2114 |
function bwg_before_shortcode_add_builder_editor() {
|
2115 |
+
if ( top.jQuery('body').hasClass('elementor-editor-active') || top.jQuery('body').hasClass('fl-builder') || top.jQuery('body').hasClass('et_divi_theme') ) {
|
2116 |
return true;
|
2117 |
}
|
2118 |
return false;
|
css/bwg_frontend.css
CHANGED
@@ -561,7 +561,7 @@ div[id^="bwg_container"] .bwg-border-box * {
|
|
561 |
z-index: 115;
|
562 |
text-align: center;
|
563 |
vertical-align: middle;
|
564 |
-
position:
|
565 |
height: 30px;
|
566 |
}
|
567 |
.bwg_loading_div_2 {
|
@@ -1747,12 +1747,14 @@ body .bwg_thumbnail.bwg_container .search_line.bwg-search-line-responsive .SumoS
|
|
1747 |
cursor: pointer;
|
1748 |
vertical-align: middle;
|
1749 |
z-index: 10106;
|
|
|
1750 |
}
|
1751 |
|
1752 |
.bwg_filmstrip_right {
|
1753 |
cursor: pointer;
|
1754 |
vertical-align: middle;
|
1755 |
z-index: 10106;
|
|
|
1756 |
}
|
1757 |
|
1758 |
.bwg_none_selectable {
|
@@ -2335,3 +2337,7 @@ div[id^='bwg_container1_'] div[id^='bwg_container2_'] span[class^='bwg_mosaic_pl
|
|
2335 |
background-repeat: no-repeat;
|
2336 |
background-position: 50% 50%;
|
2337 |
}
|
|
|
|
|
|
|
|
561 |
z-index: 115;
|
562 |
text-align: center;
|
563 |
vertical-align: middle;
|
564 |
+
position: relative;
|
565 |
height: 30px;
|
566 |
}
|
567 |
.bwg_loading_div_2 {
|
1747 |
cursor: pointer;
|
1748 |
vertical-align: middle;
|
1749 |
z-index: 10106;
|
1750 |
+
line-height: 0;
|
1751 |
}
|
1752 |
|
1753 |
.bwg_filmstrip_right {
|
1754 |
cursor: pointer;
|
1755 |
vertical-align: middle;
|
1756 |
z-index: 10106;
|
1757 |
+
line-height: 0;
|
1758 |
}
|
1759 |
|
1760 |
.bwg_none_selectable {
|
2337 |
background-repeat: no-repeat;
|
2338 |
background-position: 50% 50%;
|
2339 |
}
|
2340 |
+
|
2341 |
+
#bwg_thumbnails_masonry_0 {
|
2342 |
+
overflow: hidden;
|
2343 |
+
}
|
css/styles.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
div[id^=bwg_container] p{padding:0!important;margin:0!important}div[id^=bwg_container] img{box-shadow:none!important}div[id^=bwg_container] *{margin:0}div[id^=bwg_container] .SumoSelect.open>.CaptionCont,div[id^=bwg_container] .SumoSelect:focus>.CaptionCont,div[id^=bwg_container] .SumoSelect:hover>.CaptionCont,div[id^=bwg_container] .SumoSelect>.CaptionCont{border:none;box-shadow:none}#bwg_tag_wrap{background-color:#fff;width:100%;font-family:inherit;margin:0 -5px 20px 0;z-index:200;position:relative}.bwg_search_loupe_container,.bwg_search_reset_container{font-size:18px;color:#ccc;cursor:pointer;position:relative}#bwg_tag_container p{text-align:center}#bwg_tag_container{border:1px solid #ccc;box-shadow:0 0 3px 1px #ccc;border-radius:4px;width:256px;float:right}#spider_popup_wrap a{border:none;box-shadow:none}div[id^=bwg_container].bwg_container .bwg-a{border:none;box-shadow:none!important;outline:0;font-size:0;cursor:pointer;text-decoration:none}div[id^=bwg_container] div[id^=bwg_container] .bwg_img_clear{max-height:none!important;max-width:none!important;padding:0!important}.tag_cloud_link{font-size:inherit!important}@media print{#spider_popup_left,#spider_popup_right,.bwg_image_info,[class^=bwg_slideshow_title_text_],[id^=bwg_slideshow_play_pause_],[id^=spider_slideshow_left_],[id^=spider_slideshow_right_]{background:0 0}}.bwg_spider_popup_loading,.footer-list-block .bwp_gallery .bwg_spider_popup_loading,.footer-list-block .bwp_gallery_tags .bwg_spider_popup_loading{background-image:url(../images/ajax_loader.png);background-color:rgba(0,0,0,0);background-repeat:no-repeat;background-position:0 0;background-size:30px 30px;border:none!important;display:none;height:30px;left:50%;margin-left:-20px;margin-top:-20px;overflow:hidden;position:fixed;top:50%;width:30px;z-index:10102}.bwg_filmstrip_thumbnail_img{max-width:none!important}.dashicons-arrow-down-alt2:before{content:"\f347";height:100%;display:inline-block}.footer-list-block .bwp_gallery .spider_popup_overlay,.footer-list-block .bwp_gallery_tags .spider_popup_overlay,.spider_popup_overlay{cursor:pointer;display:none;height:100%;left:0;position:fixed;top:0;width:100%;z-index:10100}.bwp_gallery_tags div[id^=bwg_container] li{border:none}.spider_popup_close,.spider_popup_close_fullscreen{-moz-box-sizing:content-box!important;box-sizing:content-box!important;cursor:pointer;display:table;line-height:0;position:absolute;z-index:11100}#spider_popup_left{left:0}#spider_popup_right{right:0}#spider_popup_left:hover,#spider_popup_right:hover{visibility:visible}#spider_popup_left:hover span{left:20px}#spider_popup_right:hover span{left:auto;right:20px}#spider_popup_left,#spider_popup_right{background:transparent url(../images/blank.gif) repeat scroll 0 0;bottom:35%;cursor:pointer;display:inline;height:30%;outline:medium none;position:absolute;width:35%;z-index:10130}#bwg_image_container #spider_popup_left,#bwg_image_container #spider_popup_right{width:25%}#spider_popup_left-ico,#spider_popup_right-ico{-moz-box-sizing:border-box;box-sizing:border-box;cursor:pointer;display:table;line-height:0;margin-top:-15px;position:absolute;top:50%;z-index:10135}.bwg_captcha_refresh{background-image:url(../images/captcha_refresh.png);background-position:center center;background-repeat:no-repeat;background-size:100% 100%;border-width:0;cursor:pointer;display:inline-block;height:20px;width:20px;margin:0;padding:0;vertical-align:middle}.bwg_captcha_input{vertical-align:middle;width:75px!important}.bwg_captcha_img{cursor:pointer;margin:0 5px 0 5px;vertical-align:middle}.bwg_comment_error{color:red;display:block}.bwg_comment_waiting_message{display:none}.bwg_image_hit_container1,.bwg_image_info_container1,.bwg_image_rate_container1{height:100%;margin:0 auto;position:absolute;width:100%}.bwg_image_rate_container1{display:none}.bwg_image_hit_container2,.bwg_image_info_container2,.bwg_image_rate_container2{display:table;height:100%;margin:0 auto;position:absolute;width:100%}.bwg_image_hit_spun,.bwg_image_info_spun,.bwg_image_rate_spun{display:table-cell;height:100%;left:0;top:0;width:100%;overflow:hidden;position:relative}.bwg_image_hit,.bwg_image_info,.bwg_image_rate{display:inline-block;position:relative;text-decoration:none;word-wrap:break-word;z-index:11}.bwg_image_rate{z-index:999!important}@media screen and (max-width:465px){.bwg_ctrl_btn_container{height:auto!important}}.bwg_search_container_1{display:inline-block;width:100%;text-align:right;margin:0 5px 20px 0;background-color:rgba(0,0,0,0)}.bwg_search_container_2{display:inline-block;position:relative;border-radius:4px;box-shadow:0 0 3px 1px #ccc;background-color:#fff;border:1px solid #ccc;max-width:100%}div[id^=bwg_search_container_1_] div[id^=bwg_search_container_2_] .bwg_search_input_container{display:block;margin-right:45px}div[id^=bwg_search_container_1_] div[id^=bwg_search_container_2_] .bwg_search_loupe_container{display:inline-block;margin-right:1px;vertical-align:middle;float:right}div[id^=bwg_search_container_1_] div[id^=bwg_search_container_2_] .bwg_search_reset_container{margin-right:5px;vertical-align:middle;float:right}.bwg_thumbnail div[id^=bwg_search_container_1_] div[id^=bwg_search_container_2_] .bwg_reset,.bwg_thumbnail div[id^=bwg_search_container_1_] div[id^=bwg_search_container_2_] .bwg_search{display:block;font-size:10px;color:#323a45;cursor:pointer;line-height:inherit!important}.bwg_thumbnail div[id^=bwg_search_container_1_] div[id^=bwg_search_container_2_] .bwg_search{font-size:12px}div[id^=bwg_search_container_1_] div[id^=bwg_search_container_2_] .bwg_search_input,div[id^=bwg_search_container_1_] div[id^=bwg_search_container_2_] .bwg_search_input:focus{color:#070707;outline:0;border:none;box-shadow:none;background:0 0;padding:3px 5px;font-family:inherit;width:100%}.bwg_order_cont .SumoSelect{background-color:#fff;border:1px solid #ccc;box-shadow:0 0 3px 1px #ccc;border-radius:4px;height:initial;max-width:100%;padding:0 10px}.SumoSelect>.optWrapper>.options li.opt{border:none;text-align:left}.bwg_order_cont .SumoSelect .CaptionCont{text-align:left}.bwg_order_cont{background-color:rgba(0,0,0,0);display:block;text-align:right;width:100%;margin:0 5px 20px 0}#bwg_tag_container .SumoSelect,.bwg_order_cont .SumoSelect{display:inline-table}#bwg_tag_container .SumoSelect ul.options,.bwg_order_cont .SumoSelect ul.options{margin:0;padding:0!important}#bwg_tag_container .SumoSelect li,.bwg_order_cont .SumoSelect li{list-style:none}#bwg_tag_container .SumoSelect.open .search-txt{padding:0 8px;height:100%}#bwg_tag_container .SumoSelect>.optWrapper>.options li label{margin:0}.bwg_order_label{border:none;box-shadow:none;color:#bbb;font-family:inherit;font-weight:700;outline:0}.bwg_order{background-color:#fff;border:1px solid #ccc;box-shadow:0 0 3px 1px #ccc;border-radius:4px;height:initial;max-width:100%;text-align:left}.wd_error{color:#ccc;font-size:initial}div[id^=bwg_container] .bwg_download_gallery{text-align:right;margin-top:10px}div[id^=bwg_container] .bwg_download_gallery a{color:#4a4a4a;font-size:25px;text-decoration:none}div[id^=bwg_container] .bwg_download_gallery a:hover{color:#7d7d7d}div[id^=bwg_container] .bwg-border-box *{-moz-box-sizing:border-box;box-sizing:border-box}.bwg-flex{display:flex}.bwg-width-100{width:100%;max-width:100%}.bwg-flex-column{flex-direction:column}.bwg-flex-row{flex-direction:row;flex-wrap:wrap}.bwg-container{font-size:0;width:100%;max-width:100%;display:flex;flex-direction:row;flex-wrap:wrap}.bwg-item{display:flex;flex-direction:column;cursor:pointer}.bwg-item0{overflow:hidden;z-index:100}.bwg-item0:hover{background:0 0!important;backface-visibility:hidden;-webkit-backface-visibility:hidden;-moz-backface-visibility:hidden;-ms-backface-visibility:hidden;opacity:1;z-index:102;position:relative}.bwg-item1{overflow:hidden;width:100%;position:relative}.bwg-item2{top:0;left:0;bottom:0;right:0;width:100%;height:100%}.bwg-item2{position:absolute}.bwg-ecommerce1,.bwg-title1{opacity:1;text-align:center;width:100%}.bwg-ecommerce1{text-align:right}.bwg-title2{width:100%;word-wrap:break-word}.bwg-item0:hover .bwg-ecommerce1,.bwg-item0:hover .bwg-title1{left:0!important;opacity:1!important}.bwg-play-icon1{display:flex;height:100%;opacity:1;position:absolute;top:0;width:100%;z-index:100;justify-content:center;align-content:center;flex-direction:column;text-align:center}.bwg_loading_div_1{position:absolute;width:100%;height:100%;z-index:115;text-align:center;vertical-align:middle;top:0}.bwg_load_more_ajax_loading{width:100%;z-index:115;text-align:center;vertical-align:middle;position:absolute;height:30px}.bwg_loading_div_2{display:table;vertical-align:middle;width:100%;height:100%;background-color:#fff;opacity:.95}.bwg_loading_div_3{display:table-cell;text-align:center;position:relative;vertical-align:middle}.bwg_spider_ajax_loading{border:none!important;display:inline-block;text-align:center;position:relative;vertical-align:middle;background-image:url(../images/ajax_loader.png);float:none;width:30px;height:30px;background-size:30px 30px}.bwg-hidden{visibility:hidden}.bwg_container{position:relative;margin:20px 0}.bwg_inst_play_btn_cont,.bwg_inst_play_btn_cont .bwg_inst_play{display:block}.hidden{display:none}.bwg-loading{width:100%;height:100%;opacity:.95;position:absolute;background-color:#fff;background-image:url(../images/ajax_loader.png);background-position:center;background-repeat:no-repeat;background-size:50px;z-index:100100;top:0;left:0}#bwg_download{display:inline-block}#bwg_download.hidden{display:none}.bwg_thumbnail.bwg_container .search_line{min-height:50px;-webkit-box-shadow:0 5px 7px -5px rgba(0,0,0,.16);-moz-box-shadow:0 5px 7px -5px rgba(0,0,0,.16);box-shadow:0 5px 7px -5px rgba(0,0,0,.16);margin-bottom:10px;display:inline-block;width:100%}.bwg_thumbnail.bwg_container .search_line #bwg_tag_wrap,.bwg_thumbnail.bwg_container .search_line .bwg_order_cont,.bwg_thumbnail.bwg_container .search_line .bwg_search_container_1{float:left;display:table-cell;text-align:left;vertical-align:middle}.bwg_thumbnail.bwg_container .search_line #bwg_tag_wrap #bwg_tag_container,.bwg_thumbnail.bwg_container .search_line .bwg_order_cont select{border:.5px solid rgba(0,0,0,.15);box-shadow:none;border-radius:15px}.bwg_thumbnail.bwg_container .search_line .bwg_order_cont,.bwg_thumbnail.bwg_container .search_line .search_tags_container{width:25%;min-width:120px;max-width:180px;margin-right:20px;margin-bottom:10px;border:.5px solid rgba(0,0,0,.15);box-shadow:none;border-radius:15px;float:left;height:30px;padding:0;cursor:pointer;background:#fff}.bwg_thumbnail.bwg_container .search_line .bwg_order_cont select,.bwg_thumbnail.bwg_container .search_line .placeholder,.bwg_thumbnail.bwg_container .search_line .search-txt,.bwg_thumbnail.bwg_container .search_line .select-all,.bwg_thumbnail.bwg_container .search_line.SumoSelect .opt label{color:#323a45;font-size:12px;text-transform:uppercase;font-weight:400;font-family:Ubuntu;margin:0;border:none}.bwg_thumbnail.bwg_container .search_line .select-all label{margin-bottom:0;line-height:13px}.bwg_thumbnail.bwg_container .search_line .SumoSelect ul.options:not(:empty){padding:15px 0 0 10px!important}.bwg_thumbnail.bwg_container .search_line .SumoSelect{padding:0 10px;width:initial;height:inherit;cursor:pointer;display:block;border:none;box-shadow:none;border-radius:0;max-width:100%;background-color:transparent;line-height:inherit;vertical-align:bottom}.bwg_thumbnail.bwg_container .search_line .bwg_search_input_container{height:30px;text-align:center;font-size:12px;font-family:Ubuntu;border-radius:15px;text-align:left;width:calc(100%);margin:0;overflow:hidden}.bwg_thumbnail div[id^=bwg_search_container_1_] div[id^=bwg_search_container_2_] .bwg_search_input,.bwg_thumbnail div[id^=bwg_search_container_1_] div[id^=bwg_search_container_2_] .bwg_search_input:focus{height:30px;padding:0 10px;text-align:center;font-size:12px;font-family:Ubuntu;border-radius:15px;text-align:left;width:calc(100% - 64px);display:inline-table}.bwg_thumbnail.bwg_container .search_line .CaptionCont span{display:block!important;vertical-align:middle;color:#323a45!important;font-size:12px;text-transform:uppercase;font-family:Ubuntu;cursor:pointer;line-height:29px;max-width:calc(100% - 20px)}.bwg_thumbnail .search_tags{cursor:pointer}.bwg_thumbnail.bwg_container .search_line .SumoSelect .select-all>span,.bwg_thumbnail.bwg_container .search_line .SumoSelect>.optWrapper.multiple>.options li.opt span{margin-left:-35px}.bwg_thumbnail.bwg_container .search_line .SumoSelect>.optWrapper.multiple>.options li.opt{padding-left:25px}.bwg_thumbnail .bwg_search_input::-webkit-input-placeholder{color:#ccc;font-size:12px;text-transform:uppercase;font-family:Ubuntu}.bwg_thumbnail .bwg_search_input::-moz-placeholder{color:#ccc;font-size:12px;text-transform:uppercase;text-align:left;font-family:Ubuntu;line-height:30px}.bwg_thumbnail .bwg_search_input:-ms-input-placeholder{color:#ccc;font-size:12px;text-transform:uppercase;text-align:left;font-family:Ubuntu}.bwg_thumbnail .bwg_search_input:-moz-placeholder{color:#ccc;font-size:12px;text-transform:uppercase;text-align:left;font-family:Ubuntu}.bwg_thumbnail .search-txt::-webkit-input-placeholder{text-align:left;color:#323a45;opacity:.5;font-size:12px!important}.bwg_thumbnail .search-txt::-moz-placeholder{text-align:left;color:#323a45;opacity:.5;font-size:12px!important}.bwg_thumbnail .search-txt::-ms-input-placeholder{text-align:left;color:#323a45;opacity:.5;font-size:12px}.bwg_thumbnail .search-txt:-ms-input-placeholder{text-align:left;color:#323a45;opacity:.5;font-size:12px}.bwg_thumbnail .search-txt:-moz-placeholder{text-align:left;color:#323a45;opacity:.5;font-size:12px}.bwg_thumbnail .bwg_search_input_container .search_placeholder_title{width:calc(100% - 20px);height:29px;text-align:center;display:inline-block;background:#fff;position:absolute;top:.5px;left:10px;white-space:nowrap;border-radius:15px;color:#4e4e4e;text-transform:uppercase;overflow:hidden}.bwg_thumbnail .bwg_search_input_container .search_placeholder_title span{line-height:28px}.bwg_thumbnail.bwg_container .search_line .bwg_search_loupe_container{line-height:29px;display:inline-block;top:0;margin-right:10px;vertical-align:middle;float:none;padding-top:0;font-size:12px;font-family:Ubuntug}.bwg_thumbnail.bwg_container .search_line .bwg_search_loupe_container1{margin-left:0;float:left;top:0;line-height:30px;width:auto;height:30px;margin-left:10px}.bwg_thumbnail.bwg_container .search_line .bwg_search_reset_container{right:0;top:0;line-height:30px;width:11px;height:30px;margin-right:10px}.bwg_thumbnail.bwg_container .search_line .bwg_search_container_1{float:right;width:30%;min-width:120px}.bwg_thumbnail.bwg_container .search_line .bwg_search_container_1 .bwg_search_container_2{width:100%!important;float:right}.bwg_thumbnail.bwg_container .search_line .SumoSelect .select-all{padding:0 0 3px 35px!important;height:13px;line-height:13px;margin-bottom:15px!important}.bwg_thumbnail.bwg_container .search_line .SumoSelect>.optWrapper>.options li.opt{margin-bottom:15px;padding:0;list-style:none;color:#323a45;font-size:12px;text-transform:uppercase;font-family:Ubuntu;line-height:12px}.bwg_thumbnail.bwg_container .search_line .SumoSelect>.optWrapper.multiple>.MultiControls>p.btnCancel,.bwg_thumbnail.bwg_container .search_line .SumoSelect>.optWrapper.multiple>.MultiControls>p.btnOk{font-family:Ubuntu;font-size:12px;line-height:12px}.bwg_thumbnail.bwg_container .search_line .SumoSelect>.optWrapper.multiple>.MultiControls>p:hover{background:0 0}.bwg_thumbnail.bwg_container .search_line .SumoSelect>.optWrapper>.options li.opt label{color:#323a45;font-size:12px;text-transform:uppercase;font-family:Ubuntu;font-weight:400;margin-bottom:0}.bwg_thumbnail.bwg_container .search_line .SumoSelect>.CaptionCont{height:inherit;border:transparent;background:inherit;width:100%;cursor:pointer;max-height:calc(100% - 2px)}.bwg_thumbnail.bwg_container .search_line .SumoSelect>.CaptionCont>label{margin:0;line-height:100%;cursor:pointer;width:20px}.bwg_thumbnail.bwg_container .search_line .SumoSelect>.CaptionCont>label>i{line-height:100%;height:100%}.bwg_thumbnail.bwg_container .search_line .SumoSelect>.CaptionCont>label>i.closed:before,.bwg_thumbnail.bwg_container .search_line .SumoSelect>.CaptionCont>label>i.opened:before{color:#323a45;font-size:10px;line-height:30px}.bwg_thumbnail.bwg_container .search_line .bwg_reset{position:absolute}.bwg_thumbnail.bwg_container .search_line .no-match{font-family:Ubuntu;font-size:12px;color:#323a45;padding:5px 25px!important;text-align:center}.bwg_thumbnail.bwg_container .search_line .search-txt{border:transparent;background:0 0;padding:4px 0!important;height:100%}.bwg_thumbnail.bwg_container .search_line .search-txt:focus{box-shadow:none}.bwg_thumbnail.bwg_container .search_line .bwg_order.SumoUnder{display:none}.bwg_slideshow_image_container{position:absolute}.bwg_slideshow_image_container>div>div{display:table;margin:0 auto}div[id^=bwg_container1_] div[id^=bwg_container2_] div[class^=bwg_slide_container_] img[id^=bwg_slideshow_image_]{display:inline-block}.bwg_thumbnail #bwg_tag_container p{text-align:left}.bwg_thumbnail .bwg_search_container_2{display:inline-block;position:relative;border-radius:4px;background-color:#fff;max-width:100%;box-shadow:none;border:.5px solid rgba(0,0,0,.15);border-radius:15px}.bwg_thumbnail .bwg_order_cont{background-color:rgba(0,0,0,0);display:block;text-align:right;width:100%;margin:0 5px 20px 5px}.bwg_thumbnail div[id^=bwg_search_container_1_] div[id^=bwg_search_container_2_] .bwg_search_input_container{display:block;text-align:center}.bwg_thumbnail .SumoSelect>.optWrapper>.options li.opt:hover{background-color:transparent}.bwg-zoom-effect .bwg-zoom-effect-overlay{position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden;opacity:0;-webkit-transition:all .45s ease-in-out;transition:all .45s ease-in-out}.bwg-zoom-effect:hover .bwg-zoom-effect-overlay{opacity:1}.bwg-zoom-effect img{-webkit-transition:all .3s;transition:all .3s}.bwg-zoom-effect .bwg-title1{-webkit-transition:all .3s ease-in-out;transition:all .3s ease-in-out}.bwg_container div[id^=bwg_container2_] img{height:initial}.bwg-masonry-vertical{flex-direction:column}.bwg-masonry-horizontal{flex-direction:row}.bwg-masonry-horizontal-parent{overflow-x:scroll;overflow-y:hidden}.bwg-masonry-horizontal-container{width:fit-content}.bwg-item.bwg-empty-item{border:0!important;padding:0!important}.bwg-background{background-color:rgba(0,0,0,0);position:relative;width:100%}.bwg-background .wd_error{color:#323a45;font-weight:700}div[id^=bwg_container] .bwg-carousel{margin:0 auto}.bwg_carousel_preload{background-image:url(../images/ajax_loader.png);background-size:50px!important;background-repeat:no-repeat;background-color:#fff;background-position:center}.bwg_container.bwg_carousel *{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.bwg_container.bwg_carousel [id^=bwg_container2_] *{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.bwg_container.bwg_carousel [id^=bwg_container2_] [class^=bwg_carousel_watermark_]{position:relative;z-index:15}.bwg_container.bwg_carousel [id^=bwg_container2_] [class^=bwg_carousel_image_container_]{display:inline-block;position:absolute;text-align:center;vertical-align:middle}.bwg_container.bwg_carousel [id^=bwg_container2_] [class^=bwg_carousel_watermark_container_]{display:table-cell;margin:0 auto;position:relative;vertical-align:middle}.bwg_container.bwg_carousel [id^=bwg_container2_] [class^=bwg_carousel_watermark_container_] div{display:table;margin:0 auto}.bwg_container.bwg_carousel [id^=bwg_container2_] [class^=bwg_carousel_watermark_spun_]{display:table-cell;overflow:hidden;position:relative}.bwg_container.bwg_carousel [id^=bwg_container2_] [class^=bwg_carousel_watermark_image_]{padding:0!important;display:inline-block;float:none!important;margin:4px!important;position:relative;z-index:15}.bwg_container.bwg_carousel [id^=bwg_container2_] [class^=bwg_carousel_watermark_text_],.bwg_container.bwg_carousel [id^=bwg_container2_] [class^=bwg_carousel_watermark_text_]:hover{text-decoration:none;margin:4px;display:block;position:relative;z-index:17}.bwg_container.bwg_carousel [id^=bwg_container2_] .bwg_carousel-cont-child{max-width:100%;position:relative;overflow:hidden;height:100%;width:100%}.bwg_container.bwg_carousel [id^=bwg_container2_] .bwg-carousel-image{border:0;position:absolute;display:block;max-width:none;padding:0!important;margin:0!important;float:none!important;vertical-align:middle;height:100%;width:100%;background-position:center center;background-repeat:no-repeat;background-size:cover;vertical-align:middle}.bwg_container.bwg_carousel [id^=bwg_container2_] .bwg-carousel{position:relative;max-width:100%;width:100%}.bwg_container.bwg_carousel [id^=bwg_container2_] [class^=bwg_carousel-feature]{position:absolute;display:block;overflow:hidden;cursor:pointer}.bwg_container.bwg_carousel [id^=bwg_container2_] [class^=bwg_carousel-feature] [class^=bwg_carousel-caption] [class^=bwg_carousel_title_text_]{text-decoration:none;position:absolute;z-index:15;display:inline-block;width:75%;top:0;text-align:center;word-wrap:break-word;word-break:break-word}.bwg_container.bwg_carousel [id^=bwg_container2_] [id^=bwg_carousel-left],.bwg_container.bwg_carousel [id^=bwg_container2_] [id^=bwg_carousel-right]{bottom:38%;cursor:pointer;display:inline;height:30%;outline:medium none;position:absolute;width:0%;z-index:13;visibility:visible}.bwg_container.bwg_carousel [id^=bwg_container2_] [id^=bwg_carousel-right]{right:0;left:auto;z-index:999}.bwg_container.bwg_carousel [id^=bwg_container2_] [id^=bwg_carousel-left]{left:20px;z-index:999}.bwg_container.bwg_carousel [id^=bwg_container2_] [class^=bwg_video_hide]{width:100%;height:100%;position:absolute;z-index:22}.bwg_container.bwg_carousel [id^=bwg_container2_] [id^=spider_carousel_left-ico_] span,.bwg_container.bwg_carousel [id^=bwg_container2_] [id^=spider_carousel_right-ico_] span{display:table-cell;text-align:center;vertical-align:middle;z-index:13}.bwg_container.bwg_carousel [id^=bwg_container2_] [id^=spider_carousel_left-ico_],.bwg_container.bwg_carousel [id^=bwg_container2_] [id^=spider_carousel_right-ico_]{z-index:13;-moz-box-sizing:content-box;box-sizing:content-box;cursor:pointer;display:inline-table;line-height:0;margin-top:-15px;position:absolute;top:55%}.bwg_container.bwg_carousel [id^=bwg_container2_] [id^=spider_carousel_left-ico_]:hover,.bwg_container.bwg_carousel [id^=bwg_container2_] [id^=spider_carousel_right-ico_]:hover{cursor:pointer}.bwg_container.bwg_carousel [id^=bwg_container2_] [id^=bwg_carousel_play_pause_]{bottom:0;cursor:pointer;display:inline-table;outline:medium none;position:absolute;height:inherit;width:30%;left:35%;z-index:13}.bwg_container.bwg_carousel .bwg_carousel_play_pause:hover .bwg_carousel_play_pause-ico{display:inline-block!important}.bwg_container.bwg_carousel [id^=bwg_container2_] [id^=bwg_carousel_play_pause_]:hover span{position:relative;z-index:13}.bwg_container.bwg_carousel [id^=bwg_container2_] [id^=bwg_carousel_play_pause_] span{display:table-cell;text-align:center;vertical-align:middle}.bwg_container.bwg_carousel [id^=bwg_container2_] .bwg_carousel_play_pause-ico{display:none!important;cursor:pointer;position:relative;z-index:13}.bwg_container.bwg_carousel [id^=bwg_container2_] .bwg_carousel_play_pause-ico:hover{display:inline-block;position:relative;z-index:13}.bwg_container.bwg_carousel [id^=bwg_container2_] [class^=bwg_carousel_embed_]{padding:0!important;float:none!important;width:100%;height:100%;vertical-align:middle;position:relative;display:table;background-color:#000;text-align:center}.bwg_container.bwg_carousel [id^=bwg_container2_] [class^=bwg_carousel_embed_video_]{padding:0!important;margin:0!important;float:none!important;vertical-align:middle;position:relative;display:table-cell;background-color:#000;text-align:center}.bwg_thumbnail.bwg_container{padding:0 1px}.bwg_thumbnail.bwg_container .search_line.bwg-search-line-responsive{display:inline-block}body .bwg_thumbnail.bwg_container .search_line.bwg-search-line-responsive .bwg_order_cont,body .bwg_thumbnail.bwg_container .search_line.bwg-search-line-responsive .bwg_search_container_1,body .bwg_thumbnail.bwg_container .search_line.bwg-search-line-responsive .search_tags_container{width:100%;margin:0 0 10px 0;text-align:center;max-width:100%}.search_line .SumoSelect>.optWrapper.multiple.isFloating{padding-bottom:26px}.bwg_container.bwg_blog_style .fluid-width-video-wrapper,.bwg_container.bwg_carousel .fluid-width-video-wrapper,.bwg_container.bwg_image_browser .fluid-width-video-wrapper{width:100%;position:unset!important;padding:0!important}.bwg_inst_play_btn_cont{width:100%;height:100%;position:absolute;z-index:1;cursor:pointer;top:0}.bwg_inst_play{position:absolute;width:50px;height:50px;background-position:center center;background-repeat:no-repeat;background-size:cover;transition:background-image .2s ease-out;-ms-transition:background-image .2s ease-out;-moz-transition:background-image .2s ease-out;-webkit-transition:background-image .2s ease-out;top:0;left:0;right:0;bottom:0;margin:auto}.bwg_inst_play:hover{background-position:center center;background-repeat:no-repeat;background-size:cover}.spider_popup_wrap *{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.spider_popup_wrap{display:inline-block;left:50%;outline:medium none;position:fixed;text-align:center;top:50%;z-index:100000}.bwg_popup_image{vertical-align:middle;display:inline-block}.bwg_popup_embed{width:100%;height:100%;vertical-align:middle;text-align:center;display:table}.bwg_btn_container{bottom:0;left:0;overflow:hidden;position:absolute;right:0;top:0}.bwg_toggle_btn{margin:0;padding:0}.bwg_ctrl_btn_container{position:absolute;width:100%;z-index:10150}.bwg_toggle_container{cursor:pointer;left:50%;line-height:0;position:absolute;text-align:center;z-index:10150}#spider_popup_left-ico span,#spider_popup_right-ico span,.spider_popup_close span{display:table-cell;text-align:center;vertical-align:middle}.bwg_image_wrap{height:inherit;display:table;position:absolute;text-align:center;width:inherit}.bwg_image_wrap *{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.bwg_comment_wrap,.bwg_ecommerce_wrap{bottom:0;left:0;overflow:hidden;position:absolute;right:0;top:0;z-index:-1}.bwg_comment_container,.bwg_ecommerce_container{-moz-box-sizing:border-box;height:100%;overflow:hidden;position:absolute;top:0;z-index:10103}#bwg_ecommerce{padding:10px}.bwg_ecommerce_body{background:0 0!important;border:none!important}.pge_tabs{list-style-type:none;margin:0;padding:0;background:0 0!important}.pge_tabs li a,.pge_tabs li a:hover,.pge_tabs li.pge_active a{text-decoration:none;display:block;width:100%;outline:0!important;padding:8px 5px!important;font-weight:700;font-size:13px}.pge_add_to_cart a{padding:5px 10px;text-decoration:none!important;display:block}.pge_add_to_cart{margin:5px 0 15px}.pge_add_to_cart_title{font-size:17px;padding:5px}.pge_add_to_cart div:first-child{float:left}.pge_add_to_cart div:last-child{float:right;margin-top:4px}.pge_add_to_cart:after,.pge_tabs:after{clear:both;content:"";display:table}#downloads table tr td,#downloads table tr th{padding:6px 10px!important;text-transform:none!important}.bwg_comments input[type=submit],.bwg_ecommerce_panel input[type=button]{cursor:pointer;font-size:15px;width:100%;margin-bottom:5px}.bwg_comments,.bwg_ecommerce_panel{bottom:0;height:100%;left:0;overflow-x:hidden;overflow-y:auto;position:absolute;top:0;width:100%;z-index:10101}.bwg_comments{height:100%}.bwg_comment_body_p,.bwg_comments p{margin:5px!important;text-align:left;word-wrap:break-word;word-break:break-all}.bwg_ecommerce_panel p{padding:5px!important;text-align:left;word-wrap:break-word;word-break:break-all;margin:0!important}.bwg_comments .bwg-submit-disabled{opacity:.5}.bwg_comments textarea{height:120px;resize:vertical}.bwg_comment_delete_btn{color:#7a7a7a;cursor:pointer;float:right;font-size:14px;margin:2px}.bwg_comments_close,.bwg_ecommerce_close{cursor:pointer;line-height:0;position:relative;font-size:13px;margin:5px;z-index:10150}.bwg_ecommerce_panel a:hover{text-decoration:underline}.bwg_comment_textarea::-webkit-scrollbar{width:4px}.bwg_comment_textarea::-webkit-scrollbar-thumb{background-color:rgba(255,255,255,.55);border-radius:2px}.bwg_comment_textarea::-webkit-scrollbar-thumb:hover{background-color:#d9d9d9}.bwg_ctrl_btn_container a,.bwg_ctrl_btn_container a:hover{text-decoration:none}.bwg_facebook:hover{color:#3b5998}.bwg_twitter:hover{color:#4099fb}.bwg_pinterest:hover{color:#cb2027}.bwg_tumblr:hover{color:#2f5070}.bwg_image_container{display:table;position:absolute;text-align:center;vertical-align:middle;width:100%}.bwg_filmstrip_container{position:absolute;z-index:10150}.bwg_filmstrip{overflow:hidden;position:absolute;z-index:10106}.bwg_filmstrip_thumbnails{margin:0 auto;overflow:hidden;position:relative}.bwg_filmstrip_thumbnail{position:relative;background:0 0;float:left;cursor:pointer;overflow:hidden}.bwg_filmstrip_thumbnail .bwg_filmstrip_thumbnail_img_wrap{overflow:hidden}.bwg_thumb_active{opacity:1}.bwg_filmstrip_thumbnail_img{display:block;opacity:1}.bwg_filmstrip_left{cursor:pointer;vertical-align:middle;z-index:10106}.bwg_filmstrip_right{cursor:pointer;vertical-align:middle;z-index:10106}.bwg_none_selectable{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.bwg_watermark_container{display:table-cell;margin:0 auto;position:relative;vertical-align:middle}.bwg_watermark_container>div{display:table;margin:0 auto}.bwg_watermark_spun{display:table-cell;overflow:hidden;position:relative}.bwg_watermark_image{margin:4px;position:relative;z-index:10141}.bwg_watermark_text,.bwg_watermark_text:hover{text-decoration:none;margin:4px;position:relative;z-index:10141}.bwg_slide_container{display:table-cell;position:absolute;vertical-align:middle;width:100%;height:100%}.bwg_slide_bg{margin:0 auto;width:inherit;height:inherit}.bwg_slider{height:inherit;width:inherit}.bwg_popup_image_spun{height:inherit;display:table-cell;opacity:1;position:absolute;vertical-align:middle;width:inherit;z-index:2}.bwg_popup_image_second_spun{width:inherit;height:inherit;display:table-cell;opacity:0;position:absolute;vertical-align:middle;z-index:1}.bwg_grid{display:none;height:100%;overflow:hidden;position:absolute;width:100%}.bwg_gridlet{opacity:1;position:absolute}.bwg_image_info::-webkit-scrollbar{width:4px}.bwg_image_info::-webkit-scrollbar-thumb{background-color:rgba(255,255,255,.55);border-radius:2px}.bwg_image_info::-webkit-scrollbar-thumb:hover{background-color:#d9d9d9}#bwg_rate_form .bwg_hint{margin:0 5px;display:none}.bwg_star{display:inline-block;width:unset!important}.bwg_image_count_container{left:0;line-height:1;position:absolute;vertical-align:middle}#bwg_comment_form label{display:block;font-weight:700;margin-top:17px;text-transform:uppercase}#bwg_comment_form .bwg-privacy-policy-box label{text-transform:unset;word-break:break-word}.bwg_popup_image_spun .bwg_popup_image_spun1{width:inherit;height:inherit}.bwg_popup_image_spun1 .bwg_popup_image_spun2{vertical-align:middle;text-align:center;height:100%}#embed_conteiner{table-layout:fixed;height:100%}#opacity_div{background-color:rgba(255,255,255,.2);position:absolute;z-index:10150}#loading_div{text-align:center;position:relative;vertical-align:middle;z-index:10170;float:none;width:30px;height:30px;background-size:30px 30px;background-repeat:no-repeat;background-position:50% 50%}#ecommerce_ajax_loading{position:absolute}#ecommerce_opacity_div{display:none;background-color:rgba(255,255,255,.2);position:absolute;z-index:10150}#ecommerce_loading_div{display:none;text-align:center;position:relative;vertical-align:middle;z-index:10170;float:none;width:30px;height:30px;background-size:30px 30px;background-repeat:no-repeat;background-position:50% 50%}.bwg_ecommerce_panel.bwg_popup_sidebar_panel.bwg_popup_sidebar{text-align:left}#ajax_loading{position:absolute}@media (max-width:480px){.bwg_image_count_container{display:none}.bwg_image_title,.bwg_image_title *{font-size:12px}.bwg_image_description,.bwg_image_description *{font-size:10px}}div[id^=bwg_container1_] div[id^=bwg_container2_] div[class^=bwg_slideshow_image_wrap_] *{box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box}div[id^=bwg_container1_] div[id^=bwg_container2_] div[class^=bwg_slideshow_image_wrap_]{border-collapse:collapse;display:table;position:relative;text-align:center;margin:auto}div[id^=bwg_container1_] div[id^=bwg_container2_] img[class^=bwg_slideshow_image_]{display:inline-block;padding:0!important;margin:0!important;float:none!important;vertical-align:middle}div[id^=bwg_container1_] div[id^=bwg_container2_] span[class^=bwg_slideshow_embed_]{padding:0!important;margin:0!important;float:none!important;vertical-align:middle;display:inline-block;text-align:center}div[id^=bwg_container1_] div[id^=bwg_container2_] img[class^=bwg_slideshow_watermark_]{position:relative;z-index:15}div[id^=bwg_container1_] div[id^=bwg_container2_] span.bwg_slideshow_play_pause{bottom:0;cursor:pointer;display:table;height:inherit;outline:medium none;position:absolute;width:30%;left:35%;z-index:13}div[id^=bwg_container1_] div[id^=bwg_container2_] span.bwg_slideshow_play_pause:hover span[id^=bwg_slideshow_play_pause-ico_]{display:inline-block!important}div[id^=bwg_container1_] div[id^=bwg_container2_] span.bwg_slideshow_play_pause:hover span{position:relative;z-index:13}div[id^=bwg_container1_] div[id^=bwg_container2_] span.bwg_slideshow_play_pause span{display:table-cell;text-align:center;vertical-align:middle;z-index:13}div[id^=bwg_container1_] div[id^=bwg_container2_] span[id^=bwg_slideshow_play_pause-ico_]{display:none!important;cursor:pointer;position:relative;z-index:13}div[id^=bwg_container1_] div[id^=bwg_container2_] span[id^=bwg_slideshow_play_pause-ico_]:hover{display:inline-block;position:relative;z-index:13}div[id^=bwg_container1_] div[id^=bwg_container2_] a[id^=spider_slideshow_left_],div[id^=bwg_container1_] div[id^=bwg_container2_] a[id^=spider_slideshow_right_]{bottom:35%;cursor:pointer;display:inline;height:30%;outline:medium none;position:absolute;width:35%;z-index:13}div[id^=bwg_container1_] div[id^=bwg_container2_] a[id^=spider_slideshow_left_]{left:0}div[id^=bwg_container1_] div[id^=bwg_container2_] a[id^=spider_slideshow_right_]{right:0}div[id^=bwg_container1_] div[id^=bwg_container2_] a[id^=spider_slideshow_left_]:hover,div[id^=bwg_container1_] div[id^=bwg_container2_] a[id^=spider_slideshow_right_]:hover{visibility:visible}div[id^=bwg_container1_] div[id^=bwg_container2_] a[id^=spider_slideshow_left_]:hover,div[id^=bwg_container1_] div[id^=bwg_container2_] a[id^=spider_slideshow_right_]:hover{visibility:visible}div[id^=bwg_container1_] div[id^=bwg_container2_] a[id^=spider_slideshow_right_]:hover span{left:auto!important;right:20px!important}div[id^=bwg_container1_] div[id^=bwg_container2_] a[id^=spider_slideshow_left_]:hover span{left:20px!important}div[id^=bwg_container1_] div[id^=bwg_container2_] span[id^=spider_slideshow_left-ico_] span,div[id^=bwg_container1_] div[id^=bwg_container2_] span[id^=spider_slideshow_right-ico_] span{display:table-cell;text-align:center;vertical-align:middle;z-index:13}div[id^=bwg_container1_] div[id^=bwg_container2_] span[id^=spider_slideshow_left-ico_],div[id^=bwg_container1_] div[id^=bwg_container2_] span[id^=spider_slideshow_right-ico_]{z-index:13;-moz-box-sizing:content-box;box-sizing:content-box;cursor:pointer;display:table;line-height:0;margin-top:-15px;position:absolute;top:50%}div[id^=bwg_container1_] div[id^=bwg_container2_] span[id^=spider_slideshow_left-ico_]:hover,div[id^=bwg_container1_] div[id^=bwg_container2_] span[id^=spider_slideshow_right-ico_]:hover{cursor:pointer}div[id^=bwg_container1_] div[id^=bwg_container2_] div[class^=bwg_slideshow_image_container_]{display:table;position:absolute;text-align:center;vertical-align:middle}div[id^=bwg_container1_] div[id^=bwg_container2_] div[class^=bwg_slideshow_filmstrip_container_]{position:absolute}div[id^=bwg_container1_] div[id^=bwg_container2_] .bwg_slideshow_filmstrip{overflow:hidden;position:absolute}div[id^=bwg_container1_] div[id^=bwg_container2_] div[class^=bwg_slideshow_filmstrip_thumbnails_]{margin:0 auto;overflow:hidden;position:relative}div[id^=bwg_container1_] div[id^=bwg_container2_] div[class^=bwg_slideshow_filmstrip_thumbnail_]{position:relative;background:0 0;cursor:pointer;float:left;overflow:hidden}div[id^=bwg_container1_] div[id^=bwg_container2_] div[class^=bwg_slideshow_thumb_active_]{opacity:1}div[id^=bwg_container1_] div[id^=bwg_container2_] img[class^=bwg_slideshow_filmstrip_thumbnail_img_]{display:block;opacity:1;padding:0!important}div[id^=bwg_container1_] div[id^=bwg_container2_] div[class^=bwg_slideshow_filmstrip_left_]{cursor:pointer;vertical-align:middle}div[id^=bwg_container1_] div[id^=bwg_container2_] div[class^=bwg_slideshow_filmstrip_right_]{cursor:pointer;vertical-align:middle}div[id^=bwg_container1_] div[id^=bwg_container2_] a[class^=bwg_none_selectable_]{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}div[id^=bwg_container1_] div[id^=bwg_container2_] div[class^=bwg_slideshow_watermark_container_]{display:table-cell;margin:0 auto;position:relative;vertical-align:middle}div[id^=bwg_container1_] div[id^=bwg_container2_] span[class^=bwg_slideshow_watermark_spun_]{display:table-cell;overflow:hidden;position:relative}div[id^=bwg_container1_] div[id^=bwg_container2_] span[class^=bwg_slideshow_title_spun_]{display:table-cell;overflow:hidden;position:relative}div[id^=bwg_container1_] div[id^=bwg_container2_] span[class^=bwg_slideshow_description_spun_]{display:table-cell;overflow:hidden;position:relative}div[id^=bwg_container1_] div[id^=bwg_container2_] img[class^=bwg_slideshow_watermark_image_]{padding:0!important;float:none!important;margin:4px!important;position:relative;z-index:15}div[id^=bwg_container1_] div[id^=bwg_container2_] a[class^=bwg_slideshow_watermark_text_],div[id^=bwg_container1_] div[id^=bwg_container2_] a[class^=bwg_slideshow_watermark_text_]:hover{text-decoration:none;margin:4px;position:relative;z-index:15}div[id^=bwg_container1_] div[id^=bwg_container2_] div[class^=bwg_slideshow_title_text_]{text-decoration:none;position:relative;z-index:11;display:inline-block;word-wrap:break-word;word-break:break-word}div[id^=bwg_container1_] div[id^=bwg_container2_] div[class^=bwg_slideshow_description_text_]{text-decoration:none;position:relative;z-index:15;margin:5px;display:inline-block;word-wrap:break-word;word-break:break-word}div[id^=bwg_container1_] div[id^=bwg_container2_] div[class^=bwg_slide_container_]{display:table-cell;margin:0 auto;position:absolute;vertical-align:middle;width:100%;height:100%}div[id^=bwg_container1_] div[id^=bwg_container2_] div[class^=bwg_slide_bg_]{margin:0 auto;width:inherit;height:inherit}div[id^=bwg_container1_] div[id^=bwg_container2_] div[class^=bwg_slider_]{height:inherit;width:inherit}div[id^=bwg_container1_] div[id^=bwg_container2_] span[class^=bwg_slideshow_image_spun_]{width:inherit;height:inherit;display:table-cell;opacity:1;position:absolute;vertical-align:middle;z-index:2}div[id^=bwg_container1_] div[id^=bwg_container2_] span[class^=bwg_slideshow_image_second_spun_]{width:inherit;height:inherit;display:table-cell;opacity:0;position:absolute;vertical-align:middle;z-index:1}div[id^=bwg_container1_] div[id^=bwg_container2_] span[class^=bwg_grid_]{display:none;height:100%;overflow:hidden;position:absolute;width:100%}div[id^=bwg_container1_] div[id^=bwg_container2_] span[class^=bwg_gridlet_]{opacity:1;position:absolute}div[id^=bwg_container1_] div[id^=bwg_container2_] span[class^=bwg_slideshow_dots_]{display:inline-block;position:relative;cursor:pointer;overflow:hidden;z-index:17}div[id^=bwg_container1_] div[id^=bwg_container2_] div[class^=bwg_slideshow_dots_container_]{display:block;overflow:hidden;position:absolute;z-index:17}div[id^=bwg_container1_] div[id^=bwg_container2_] div[class^=bwg_slideshow_dots_thumbnails_]{left:0;font-size:0;margin:0 auto;overflow:hidden;position:relative}div[id^=bwg_container1_] div[id^=bwg_container2_] span[class^=bwg_slideshow_dots_active_]{opacity:1}div[id^=bwg_container1_] div[id^=bwg_container2_] span[class^=bwg_slideshow_image_spun1_]{display:table;width:inherit;height:inherit}div[id^=bwg_container1_] div[id^=bwg_container2_] span[class^=bwg_slideshow_image_spun2_]{display:table-cell;vertical-align:middle;text-align:center}div[id^=bwg_container1_] div[id^=bwg_container2_] span[class^=bwg_mosaic_play_icon_spun_]{display:flex;height:100%;opacity:1;position:absolute;top:0;width:100%;z-index:100;justify-content:center;align-content:center;flex-direction:column;text-align:center;left:0}.lazy_loader{background-image:url(../images/ajax_loader.png);background-size:30px 30px;background-repeat:no-repeat;background-position:50% 50%}
|
1 |
+
div[id^=bwg_container] p{padding:0!important;margin:0!important}div[id^=bwg_container] img{box-shadow:none!important}div[id^=bwg_container] *{margin:0}div[id^=bwg_container] .SumoSelect.open>.CaptionCont,div[id^=bwg_container] .SumoSelect:focus>.CaptionCont,div[id^=bwg_container] .SumoSelect:hover>.CaptionCont,div[id^=bwg_container] .SumoSelect>.CaptionCont{border:none;box-shadow:none}#bwg_tag_wrap{background-color:#fff;width:100%;font-family:inherit;margin:0 -5px 20px 0;z-index:200;position:relative}.bwg_search_loupe_container,.bwg_search_reset_container{font-size:18px;color:#ccc;cursor:pointer;position:relative}#bwg_tag_container p{text-align:center}#bwg_tag_container{border:1px solid #ccc;box-shadow:0 0 3px 1px #ccc;border-radius:4px;width:256px;float:right}#spider_popup_wrap a{border:none;box-shadow:none}div[id^=bwg_container].bwg_container .bwg-a{border:none;box-shadow:none!important;outline:0;font-size:0;cursor:pointer;text-decoration:none}div[id^=bwg_container] div[id^=bwg_container] .bwg_img_clear{max-height:none!important;max-width:none!important;padding:0!important}.tag_cloud_link{font-size:inherit!important}@media print{#spider_popup_left,#spider_popup_right,.bwg_image_info,[class^=bwg_slideshow_title_text_],[id^=bwg_slideshow_play_pause_],[id^=spider_slideshow_left_],[id^=spider_slideshow_right_]{background:0 0}}.bwg_spider_popup_loading,.footer-list-block .bwp_gallery .bwg_spider_popup_loading,.footer-list-block .bwp_gallery_tags .bwg_spider_popup_loading{background-image:url(../images/ajax_loader.png);background-color:rgba(0,0,0,0);background-repeat:no-repeat;background-position:0 0;background-size:30px 30px;border:none!important;display:none;height:30px;left:50%;margin-left:-20px;margin-top:-20px;overflow:hidden;position:fixed;top:50%;width:30px;z-index:10102}.bwg_filmstrip_thumbnail_img{max-width:none!important}.dashicons-arrow-down-alt2:before{content:"\f347";height:100%;display:inline-block}.footer-list-block .bwp_gallery .spider_popup_overlay,.footer-list-block .bwp_gallery_tags .spider_popup_overlay,.spider_popup_overlay{cursor:pointer;display:none;height:100%;left:0;position:fixed;top:0;width:100%;z-index:10100}.bwp_gallery_tags div[id^=bwg_container] li{border:none}.spider_popup_close,.spider_popup_close_fullscreen{-moz-box-sizing:content-box!important;box-sizing:content-box!important;cursor:pointer;display:table;line-height:0;position:absolute;z-index:11100}#spider_popup_left{left:0}#spider_popup_right{right:0}#spider_popup_left:hover,#spider_popup_right:hover{visibility:visible}#spider_popup_left:hover span{left:20px}#spider_popup_right:hover span{left:auto;right:20px}#spider_popup_left,#spider_popup_right{background:transparent url(../images/blank.gif) repeat scroll 0 0;bottom:35%;cursor:pointer;display:inline;height:30%;outline:medium none;position:absolute;width:35%;z-index:10130}#bwg_image_container #spider_popup_left,#bwg_image_container #spider_popup_right{width:25%}#spider_popup_left-ico,#spider_popup_right-ico{-moz-box-sizing:border-box;box-sizing:border-box;cursor:pointer;display:table;line-height:0;margin-top:-15px;position:absolute;top:50%;z-index:10135}.bwg_captcha_refresh{background-image:url(../images/captcha_refresh.png);background-position:center center;background-repeat:no-repeat;background-size:100% 100%;border-width:0;cursor:pointer;display:inline-block;height:20px;width:20px;margin:0;padding:0;vertical-align:middle}.bwg_captcha_input{vertical-align:middle;width:75px!important}.bwg_captcha_img{cursor:pointer;margin:0 5px 0 5px;vertical-align:middle}.bwg_comment_error{color:red;display:block}.bwg_comment_waiting_message{display:none}.bwg_image_hit_container1,.bwg_image_info_container1,.bwg_image_rate_container1{height:100%;margin:0 auto;position:absolute;width:100%}.bwg_image_rate_container1{display:none}.bwg_image_hit_container2,.bwg_image_info_container2,.bwg_image_rate_container2{display:table;height:100%;margin:0 auto;position:absolute;width:100%}.bwg_image_hit_spun,.bwg_image_info_spun,.bwg_image_rate_spun{display:table-cell;height:100%;left:0;top:0;width:100%;overflow:hidden;position:relative}.bwg_image_hit,.bwg_image_info,.bwg_image_rate{display:inline-block;position:relative;text-decoration:none;word-wrap:break-word;z-index:11}.bwg_image_rate{z-index:999!important}@media screen and (max-width:465px){.bwg_ctrl_btn_container{height:auto!important}}.bwg_search_container_1{display:inline-block;width:100%;text-align:right;margin:0 5px 20px 0;background-color:rgba(0,0,0,0)}.bwg_search_container_2{display:inline-block;position:relative;border-radius:4px;box-shadow:0 0 3px 1px #ccc;background-color:#fff;border:1px solid #ccc;max-width:100%}div[id^=bwg_search_container_1_] div[id^=bwg_search_container_2_] .bwg_search_input_container{display:block;margin-right:45px}div[id^=bwg_search_container_1_] div[id^=bwg_search_container_2_] .bwg_search_loupe_container{display:inline-block;margin-right:1px;vertical-align:middle;float:right}div[id^=bwg_search_container_1_] div[id^=bwg_search_container_2_] .bwg_search_reset_container{margin-right:5px;vertical-align:middle;float:right}.bwg_thumbnail div[id^=bwg_search_container_1_] div[id^=bwg_search_container_2_] .bwg_reset,.bwg_thumbnail div[id^=bwg_search_container_1_] div[id^=bwg_search_container_2_] .bwg_search{display:block;font-size:10px;color:#323a45;cursor:pointer;line-height:inherit!important}.bwg_thumbnail div[id^=bwg_search_container_1_] div[id^=bwg_search_container_2_] .bwg_search{font-size:12px}div[id^=bwg_search_container_1_] div[id^=bwg_search_container_2_] .bwg_search_input,div[id^=bwg_search_container_1_] div[id^=bwg_search_container_2_] .bwg_search_input:focus{color:#070707;outline:0;border:none;box-shadow:none;background:0 0;padding:3px 5px;font-family:inherit;width:100%}.bwg_order_cont .SumoSelect{background-color:#fff;border:1px solid #ccc;box-shadow:0 0 3px 1px #ccc;border-radius:4px;height:initial;max-width:100%;padding:0 10px}.SumoSelect>.optWrapper>.options li.opt{border:none;text-align:left}.bwg_order_cont .SumoSelect .CaptionCont{text-align:left}.bwg_order_cont{background-color:rgba(0,0,0,0);display:block;text-align:right;width:100%;margin:0 5px 20px 0}#bwg_tag_container .SumoSelect,.bwg_order_cont .SumoSelect{display:inline-table}#bwg_tag_container .SumoSelect ul.options,.bwg_order_cont .SumoSelect ul.options{margin:0;padding:0!important}#bwg_tag_container .SumoSelect li,.bwg_order_cont .SumoSelect li{list-style:none}#bwg_tag_container .SumoSelect.open .search-txt{padding:0 8px;height:100%}#bwg_tag_container .SumoSelect>.optWrapper>.options li label{margin:0}.bwg_order_label{border:none;box-shadow:none;color:#bbb;font-family:inherit;font-weight:700;outline:0}.bwg_order{background-color:#fff;border:1px solid #ccc;box-shadow:0 0 3px 1px #ccc;border-radius:4px;height:initial;max-width:100%;text-align:left}.wd_error{color:#ccc;font-size:initial}div[id^=bwg_container] .bwg_download_gallery{text-align:right;margin-top:10px}div[id^=bwg_container] .bwg_download_gallery a{color:#4a4a4a;font-size:25px;text-decoration:none}div[id^=bwg_container] .bwg_download_gallery a:hover{color:#7d7d7d}div[id^=bwg_container] .bwg-border-box *{-moz-box-sizing:border-box;box-sizing:border-box}.bwg-flex{display:flex}.bwg-width-100{width:100%;max-width:100%}.bwg-flex-column{flex-direction:column}.bwg-flex-row{flex-direction:row;flex-wrap:wrap}.bwg-container{font-size:0;width:100%;max-width:100%;display:flex;flex-direction:row;flex-wrap:wrap}.bwg-item{display:flex;flex-direction:column;cursor:pointer}.bwg-item0{overflow:hidden;z-index:100}.bwg-item0:hover{background:0 0!important;backface-visibility:hidden;-webkit-backface-visibility:hidden;-moz-backface-visibility:hidden;-ms-backface-visibility:hidden;opacity:1;z-index:102;position:relative}.bwg-item1{overflow:hidden;width:100%;position:relative}.bwg-item2{top:0;left:0;bottom:0;right:0;width:100%;height:100%}.bwg-item2{position:absolute}.bwg-ecommerce1,.bwg-title1{opacity:1;text-align:center;width:100%}.bwg-ecommerce1{text-align:right}.bwg-title2{width:100%;word-wrap:break-word}.bwg-item0:hover .bwg-ecommerce1,.bwg-item0:hover .bwg-title1{left:0!important;opacity:1!important}.bwg-play-icon1{display:flex;height:100%;opacity:1;position:absolute;top:0;width:100%;z-index:100;justify-content:center;align-content:center;flex-direction:column;text-align:center}.bwg_loading_div_1{position:absolute;width:100%;height:100%;z-index:115;text-align:center;vertical-align:middle;top:0}.bwg_load_more_ajax_loading{width:100%;z-index:115;text-align:center;vertical-align:middle;position:relative;height:30px}.bwg_loading_div_2{display:table;vertical-align:middle;width:100%;height:100%;background-color:#fff;opacity:.95}.bwg_loading_div_3{display:table-cell;text-align:center;position:relative;vertical-align:middle}.bwg_spider_ajax_loading{border:none!important;display:inline-block;text-align:center;position:relative;vertical-align:middle;background-image:url(../images/ajax_loader.png);float:none;width:30px;height:30px;background-size:30px 30px}.bwg-hidden{visibility:hidden}.bwg_container{position:relative;margin:20px 0}.bwg_inst_play_btn_cont,.bwg_inst_play_btn_cont .bwg_inst_play{display:block}.hidden{display:none}.bwg-loading{width:100%;height:100%;opacity:.95;position:absolute;background-color:#fff;background-image:url(../images/ajax_loader.png);background-position:center;background-repeat:no-repeat;background-size:50px;z-index:100100;top:0;left:0}#bwg_download{display:inline-block}#bwg_download.hidden{display:none}.bwg_thumbnail.bwg_container .search_line{min-height:50px;-webkit-box-shadow:0 5px 7px -5px rgba(0,0,0,.16);-moz-box-shadow:0 5px 7px -5px rgba(0,0,0,.16);box-shadow:0 5px 7px -5px rgba(0,0,0,.16);margin-bottom:10px;display:inline-block;width:100%}.bwg_thumbnail.bwg_container .search_line #bwg_tag_wrap,.bwg_thumbnail.bwg_container .search_line .bwg_order_cont,.bwg_thumbnail.bwg_container .search_line .bwg_search_container_1{float:left;display:table-cell;text-align:left;vertical-align:middle}.bwg_thumbnail.bwg_container .search_line #bwg_tag_wrap #bwg_tag_container,.bwg_thumbnail.bwg_container .search_line .bwg_order_cont select{border:.5px solid rgba(0,0,0,.15);box-shadow:none;border-radius:15px}.bwg_thumbnail.bwg_container .search_line .bwg_order_cont,.bwg_thumbnail.bwg_container .search_line .search_tags_container{width:25%;min-width:120px;max-width:180px;margin-right:20px;margin-bottom:10px;border:.5px solid rgba(0,0,0,.15);box-shadow:none;border-radius:15px;float:left;height:30px;padding:0;cursor:pointer;background:#fff}.bwg_thumbnail.bwg_container .search_line .bwg_order_cont select,.bwg_thumbnail.bwg_container .search_line .placeholder,.bwg_thumbnail.bwg_container .search_line .search-txt,.bwg_thumbnail.bwg_container .search_line .select-all,.bwg_thumbnail.bwg_container .search_line.SumoSelect .opt label{color:#323a45;font-size:12px;text-transform:uppercase;font-weight:400;font-family:Ubuntu;margin:0;border:none}.bwg_thumbnail.bwg_container .search_line .select-all label{margin-bottom:0;line-height:13px}.bwg_thumbnail.bwg_container .search_line .SumoSelect ul.options:not(:empty){padding:15px 0 0 10px!important}.bwg_thumbnail.bwg_container .search_line .SumoSelect{padding:0 10px;width:initial;height:inherit;cursor:pointer;display:block;border:none;box-shadow:none;border-radius:0;max-width:100%;background-color:transparent;line-height:inherit;vertical-align:bottom}.bwg_thumbnail.bwg_container .search_line .bwg_search_input_container{height:30px;text-align:center;font-size:12px;font-family:Ubuntu;border-radius:15px;text-align:left;width:calc(100%);margin:0;overflow:hidden}.bwg_thumbnail div[id^=bwg_search_container_1_] div[id^=bwg_search_container_2_] .bwg_search_input,.bwg_thumbnail div[id^=bwg_search_container_1_] div[id^=bwg_search_container_2_] .bwg_search_input:focus{height:30px;padding:0 10px;text-align:center;font-size:12px;font-family:Ubuntu;border-radius:15px;text-align:left;width:calc(100% - 64px);display:inline-table}.bwg_thumbnail.bwg_container .search_line .CaptionCont span{display:block!important;vertical-align:middle;color:#323a45!important;font-size:12px;text-transform:uppercase;font-family:Ubuntu;cursor:pointer;line-height:29px;max-width:calc(100% - 20px)}.bwg_thumbnail .search_tags{cursor:pointer}.bwg_thumbnail.bwg_container .search_line .SumoSelect .select-all>span,.bwg_thumbnail.bwg_container .search_line .SumoSelect>.optWrapper.multiple>.options li.opt span{margin-left:-35px}.bwg_thumbnail.bwg_container .search_line .SumoSelect>.optWrapper.multiple>.options li.opt{padding-left:25px}.bwg_thumbnail .bwg_search_input::-webkit-input-placeholder{color:#ccc;font-size:12px;text-transform:uppercase;font-family:Ubuntu}.bwg_thumbnail .bwg_search_input::-moz-placeholder{color:#ccc;font-size:12px;text-transform:uppercase;text-align:left;font-family:Ubuntu;line-height:30px}.bwg_thumbnail .bwg_search_input:-ms-input-placeholder{color:#ccc;font-size:12px;text-transform:uppercase;text-align:left;font-family:Ubuntu}.bwg_thumbnail .bwg_search_input:-moz-placeholder{color:#ccc;font-size:12px;text-transform:uppercase;text-align:left;font-family:Ubuntu}.bwg_thumbnail .search-txt::-webkit-input-placeholder{text-align:left;color:#323a45;opacity:.5;font-size:12px!important}.bwg_thumbnail .search-txt::-moz-placeholder{text-align:left;color:#323a45;opacity:.5;font-size:12px!important}.bwg_thumbnail .search-txt::-ms-input-placeholder{text-align:left;color:#323a45;opacity:.5;font-size:12px}.bwg_thumbnail .search-txt:-ms-input-placeholder{text-align:left;color:#323a45;opacity:.5;font-size:12px}.bwg_thumbnail .search-txt:-moz-placeholder{text-align:left;color:#323a45;opacity:.5;font-size:12px}.bwg_thumbnail .bwg_search_input_container .search_placeholder_title{width:calc(100% - 20px);height:29px;text-align:center;display:inline-block;background:#fff;position:absolute;top:.5px;left:10px;white-space:nowrap;border-radius:15px;color:#4e4e4e;text-transform:uppercase;overflow:hidden}.bwg_thumbnail .bwg_search_input_container .search_placeholder_title span{line-height:28px}.bwg_thumbnail.bwg_container .search_line .bwg_search_loupe_container{line-height:29px;display:inline-block;top:0;margin-right:10px;vertical-align:middle;float:none;padding-top:0;font-size:12px;font-family:Ubuntug}.bwg_thumbnail.bwg_container .search_line .bwg_search_loupe_container1{margin-left:0;float:left;top:0;line-height:30px;width:auto;height:30px;margin-left:10px}.bwg_thumbnail.bwg_container .search_line .bwg_search_reset_container{right:0;top:0;line-height:30px;width:11px;height:30px;margin-right:10px}.bwg_thumbnail.bwg_container .search_line .bwg_search_container_1{float:right;width:30%;min-width:120px}.bwg_thumbnail.bwg_container .search_line .bwg_search_container_1 .bwg_search_container_2{width:100%!important;float:right}.bwg_thumbnail.bwg_container .search_line .SumoSelect .select-all{padding:0 0 3px 35px!important;height:13px;line-height:13px;margin-bottom:15px!important}.bwg_thumbnail.bwg_container .search_line .SumoSelect>.optWrapper>.options li.opt{margin-bottom:15px;padding:0;list-style:none;color:#323a45;font-size:12px;text-transform:uppercase;font-family:Ubuntu;line-height:12px}.bwg_thumbnail.bwg_container .search_line .SumoSelect>.optWrapper.multiple>.MultiControls>p.btnCancel,.bwg_thumbnail.bwg_container .search_line .SumoSelect>.optWrapper.multiple>.MultiControls>p.btnOk{font-family:Ubuntu;font-size:12px;line-height:12px}.bwg_thumbnail.bwg_container .search_line .SumoSelect>.optWrapper.multiple>.MultiControls>p:hover{background:0 0}.bwg_thumbnail.bwg_container .search_line .SumoSelect>.optWrapper>.options li.opt label{color:#323a45;font-size:12px;text-transform:uppercase;font-family:Ubuntu;font-weight:400;margin-bottom:0}.bwg_thumbnail.bwg_container .search_line .SumoSelect>.CaptionCont{height:inherit;border:transparent;background:inherit;width:100%;cursor:pointer;max-height:calc(100% - 2px)}.bwg_thumbnail.bwg_container .search_line .SumoSelect>.CaptionCont>label{margin:0;line-height:100%;cursor:pointer;width:20px}.bwg_thumbnail.bwg_container .search_line .SumoSelect>.CaptionCont>label>i{line-height:100%;height:100%}.bwg_thumbnail.bwg_container .search_line .SumoSelect>.CaptionCont>label>i.closed:before,.bwg_thumbnail.bwg_container .search_line .SumoSelect>.CaptionCont>label>i.opened:before{color:#323a45;font-size:10px;line-height:30px}.bwg_thumbnail.bwg_container .search_line .bwg_reset{position:absolute}.bwg_thumbnail.bwg_container .search_line .no-match{font-family:Ubuntu;font-size:12px;color:#323a45;padding:5px 25px!important;text-align:center}.bwg_thumbnail.bwg_container .search_line .search-txt{border:transparent;background:0 0;padding:4px 0!important;height:100%}.bwg_thumbnail.bwg_container .search_line .search-txt:focus{box-shadow:none}.bwg_thumbnail.bwg_container .search_line .bwg_order.SumoUnder{display:none}.bwg_slideshow_image_container{position:absolute}.bwg_slideshow_image_container>div>div{display:table;margin:0 auto}div[id^=bwg_container1_] div[id^=bwg_container2_] div[class^=bwg_slide_container_] img[id^=bwg_slideshow_image_]{display:inline-block}.bwg_thumbnail #bwg_tag_container p{text-align:left}.bwg_thumbnail .bwg_search_container_2{display:inline-block;position:relative;border-radius:4px;background-color:#fff;max-width:100%;box-shadow:none;border:.5px solid rgba(0,0,0,.15);border-radius:15px}.bwg_thumbnail .bwg_order_cont{background-color:rgba(0,0,0,0);display:block;text-align:right;width:100%;margin:0 5px 20px 5px}.bwg_thumbnail div[id^=bwg_search_container_1_] div[id^=bwg_search_container_2_] .bwg_search_input_container{display:block;text-align:center}.bwg_thumbnail .SumoSelect>.optWrapper>.options li.opt:hover{background-color:transparent}.bwg-zoom-effect .bwg-zoom-effect-overlay{position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden;opacity:0;-webkit-transition:all .45s ease-in-out;transition:all .45s ease-in-out}.bwg-zoom-effect:hover .bwg-zoom-effect-overlay{opacity:1}.bwg-zoom-effect img{-webkit-transition:all .3s;transition:all .3s}.bwg-zoom-effect .bwg-title1{-webkit-transition:all .3s ease-in-out;transition:all .3s ease-in-out}.bwg_container div[id^=bwg_container2_] img{height:initial}.bwg-masonry-vertical{flex-direction:column}.bwg-masonry-horizontal{flex-direction:row}.bwg-masonry-horizontal-parent{overflow-x:scroll;overflow-y:hidden}.bwg-masonry-horizontal-container{width:fit-content}.bwg-item.bwg-empty-item{border:0!important;padding:0!important}.bwg-background{background-color:rgba(0,0,0,0);position:relative;width:100%}.bwg-background .wd_error{color:#323a45;font-weight:700}div[id^=bwg_container] .bwg-carousel{margin:0 auto}.bwg_carousel_preload{background-image:url(../images/ajax_loader.png);background-size:50px!important;background-repeat:no-repeat;background-color:#fff;background-position:center}.bwg_container.bwg_carousel *{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.bwg_container.bwg_carousel [id^=bwg_container2_] *{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.bwg_container.bwg_carousel [id^=bwg_container2_] [class^=bwg_carousel_watermark_]{position:relative;z-index:15}.bwg_container.bwg_carousel [id^=bwg_container2_] [class^=bwg_carousel_image_container_]{display:inline-block;position:absolute;text-align:center;vertical-align:middle}.bwg_container.bwg_carousel [id^=bwg_container2_] [class^=bwg_carousel_watermark_container_]{display:table-cell;margin:0 auto;position:relative;vertical-align:middle}.bwg_container.bwg_carousel [id^=bwg_container2_] [class^=bwg_carousel_watermark_container_] div{display:table;margin:0 auto}.bwg_container.bwg_carousel [id^=bwg_container2_] [class^=bwg_carousel_watermark_spun_]{display:table-cell;overflow:hidden;position:relative}.bwg_container.bwg_carousel [id^=bwg_container2_] [class^=bwg_carousel_watermark_image_]{padding:0!important;display:inline-block;float:none!important;margin:4px!important;position:relative;z-index:15}.bwg_container.bwg_carousel [id^=bwg_container2_] [class^=bwg_carousel_watermark_text_],.bwg_container.bwg_carousel [id^=bwg_container2_] [class^=bwg_carousel_watermark_text_]:hover{text-decoration:none;margin:4px;display:block;position:relative;z-index:17}.bwg_container.bwg_carousel [id^=bwg_container2_] .bwg_carousel-cont-child{max-width:100%;position:relative;overflow:hidden;height:100%;width:100%}.bwg_container.bwg_carousel [id^=bwg_container2_] .bwg-carousel-image{border:0;position:absolute;display:block;max-width:none;padding:0!important;margin:0!important;float:none!important;vertical-align:middle;height:100%;width:100%;background-position:center center;background-repeat:no-repeat;background-size:cover;vertical-align:middle}.bwg_container.bwg_carousel [id^=bwg_container2_] .bwg-carousel{position:relative;max-width:100%;width:100%}.bwg_container.bwg_carousel [id^=bwg_container2_] [class^=bwg_carousel-feature]{position:absolute;display:block;overflow:hidden;cursor:pointer}.bwg_container.bwg_carousel [id^=bwg_container2_] [class^=bwg_carousel-feature] [class^=bwg_carousel-caption] [class^=bwg_carousel_title_text_]{text-decoration:none;position:absolute;z-index:15;display:inline-block;width:75%;top:0;text-align:center;word-wrap:break-word;word-break:break-word}.bwg_container.bwg_carousel [id^=bwg_container2_] [id^=bwg_carousel-left],.bwg_container.bwg_carousel [id^=bwg_container2_] [id^=bwg_carousel-right]{bottom:38%;cursor:pointer;display:inline;height:30%;outline:medium none;position:absolute;width:0%;z-index:13;visibility:visible}.bwg_container.bwg_carousel [id^=bwg_container2_] [id^=bwg_carousel-right]{right:0;left:auto;z-index:999}.bwg_container.bwg_carousel [id^=bwg_container2_] [id^=bwg_carousel-left]{left:20px;z-index:999}.bwg_container.bwg_carousel [id^=bwg_container2_] [class^=bwg_video_hide]{width:100%;height:100%;position:absolute;z-index:22}.bwg_container.bwg_carousel [id^=bwg_container2_] [id^=spider_carousel_left-ico_] span,.bwg_container.bwg_carousel [id^=bwg_container2_] [id^=spider_carousel_right-ico_] span{display:table-cell;text-align:center;vertical-align:middle;z-index:13}.bwg_container.bwg_carousel [id^=bwg_container2_] [id^=spider_carousel_left-ico_],.bwg_container.bwg_carousel [id^=bwg_container2_] [id^=spider_carousel_right-ico_]{z-index:13;-moz-box-sizing:content-box;box-sizing:content-box;cursor:pointer;display:inline-table;line-height:0;margin-top:-15px;position:absolute;top:55%}.bwg_container.bwg_carousel [id^=bwg_container2_] [id^=spider_carousel_left-ico_]:hover,.bwg_container.bwg_carousel [id^=bwg_container2_] [id^=spider_carousel_right-ico_]:hover{cursor:pointer}.bwg_container.bwg_carousel [id^=bwg_container2_] [id^=bwg_carousel_play_pause_]{bottom:0;cursor:pointer;display:inline-table;outline:medium none;position:absolute;height:inherit;width:30%;left:35%;z-index:13}.bwg_container.bwg_carousel .bwg_carousel_play_pause:hover .bwg_carousel_play_pause-ico{display:inline-block!important}.bwg_container.bwg_carousel [id^=bwg_container2_] [id^=bwg_carousel_play_pause_]:hover span{position:relative;z-index:13}.bwg_container.bwg_carousel [id^=bwg_container2_] [id^=bwg_carousel_play_pause_] span{display:table-cell;text-align:center;vertical-align:middle}.bwg_container.bwg_carousel [id^=bwg_container2_] .bwg_carousel_play_pause-ico{display:none!important;cursor:pointer;position:relative;z-index:13}.bwg_container.bwg_carousel [id^=bwg_container2_] .bwg_carousel_play_pause-ico:hover{display:inline-block;position:relative;z-index:13}.bwg_container.bwg_carousel [id^=bwg_container2_] [class^=bwg_carousel_embed_]{padding:0!important;float:none!important;width:100%;height:100%;vertical-align:middle;position:relative;display:table;background-color:#000;text-align:center}.bwg_container.bwg_carousel [id^=bwg_container2_] [class^=bwg_carousel_embed_video_]{padding:0!important;margin:0!important;float:none!important;vertical-align:middle;position:relative;display:table-cell;background-color:#000;text-align:center}.bwg_thumbnail.bwg_container{padding:0 1px}.bwg_thumbnail.bwg_container .search_line.bwg-search-line-responsive{display:inline-block}body .bwg_thumbnail.bwg_container .search_line.bwg-search-line-responsive .bwg_order_cont,body .bwg_thumbnail.bwg_container .search_line.bwg-search-line-responsive .bwg_search_container_1,body .bwg_thumbnail.bwg_container .search_line.bwg-search-line-responsive .search_tags_container{width:100%;margin:0 0 10px 0;text-align:center;max-width:100%}.search_line .SumoSelect>.optWrapper.multiple.isFloating{padding-bottom:26px}.bwg_container.bwg_blog_style .fluid-width-video-wrapper,.bwg_container.bwg_carousel .fluid-width-video-wrapper,.bwg_container.bwg_image_browser .fluid-width-video-wrapper{width:100%;position:unset!important;padding:0!important}.bwg_inst_play_btn_cont{width:100%;height:100%;position:absolute;z-index:1;cursor:pointer;top:0}.bwg_inst_play{position:absolute;width:50px;height:50px;background-position:center center;background-repeat:no-repeat;background-size:cover;transition:background-image .2s ease-out;-ms-transition:background-image .2s ease-out;-moz-transition:background-image .2s ease-out;-webkit-transition:background-image .2s ease-out;top:0;left:0;right:0;bottom:0;margin:auto}.bwg_inst_play:hover{background-position:center center;background-repeat:no-repeat;background-size:cover}.spider_popup_wrap *{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.spider_popup_wrap{display:inline-block;left:50%;outline:medium none;position:fixed;text-align:center;top:50%;z-index:100000}.bwg_popup_image{vertical-align:middle;display:inline-block}.bwg_popup_embed{width:100%;height:100%;vertical-align:middle;text-align:center;display:table}.bwg_btn_container{bottom:0;left:0;overflow:hidden;position:absolute;right:0;top:0}.bwg_toggle_btn{margin:0;padding:0}.bwg_ctrl_btn_container{position:absolute;width:100%;z-index:10150}.bwg_toggle_container{cursor:pointer;left:50%;line-height:0;position:absolute;text-align:center;z-index:10150}#spider_popup_left-ico span,#spider_popup_right-ico span,.spider_popup_close span{display:table-cell;text-align:center;vertical-align:middle}.bwg_image_wrap{height:inherit;display:table;position:absolute;text-align:center;width:inherit}.bwg_image_wrap *{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.bwg_comment_wrap,.bwg_ecommerce_wrap{bottom:0;left:0;overflow:hidden;position:absolute;right:0;top:0;z-index:-1}.bwg_comment_container,.bwg_ecommerce_container{-moz-box-sizing:border-box;height:100%;overflow:hidden;position:absolute;top:0;z-index:10103}#bwg_ecommerce{padding:10px}.bwg_ecommerce_body{background:0 0!important;border:none!important}.pge_tabs{list-style-type:none;margin:0;padding:0;background:0 0!important}.pge_tabs li a,.pge_tabs li a:hover,.pge_tabs li.pge_active a{text-decoration:none;display:block;width:100%;outline:0!important;padding:8px 5px!important;font-weight:700;font-size:13px}.pge_add_to_cart a{padding:5px 10px;text-decoration:none!important;display:block}.pge_add_to_cart{margin:5px 0 15px}.pge_add_to_cart_title{font-size:17px;padding:5px}.pge_add_to_cart div:first-child{float:left}.pge_add_to_cart div:last-child{float:right;margin-top:4px}.pge_add_to_cart:after,.pge_tabs:after{clear:both;content:"";display:table}#downloads table tr td,#downloads table tr th{padding:6px 10px!important;text-transform:none!important}.bwg_comments input[type=submit],.bwg_ecommerce_panel input[type=button]{cursor:pointer;font-size:15px;width:100%;margin-bottom:5px}.bwg_comments,.bwg_ecommerce_panel{bottom:0;height:100%;left:0;overflow-x:hidden;overflow-y:auto;position:absolute;top:0;width:100%;z-index:10101}.bwg_comments{height:100%}.bwg_comment_body_p,.bwg_comments p{margin:5px!important;text-align:left;word-wrap:break-word;word-break:break-all}.bwg_ecommerce_panel p{padding:5px!important;text-align:left;word-wrap:break-word;word-break:break-all;margin:0!important}.bwg_comments .bwg-submit-disabled{opacity:.5}.bwg_comments textarea{height:120px;resize:vertical}.bwg_comment_delete_btn{color:#7a7a7a;cursor:pointer;float:right;font-size:14px;margin:2px}.bwg_comments_close,.bwg_ecommerce_close{cursor:pointer;line-height:0;position:relative;font-size:13px;margin:5px;z-index:10150}.bwg_ecommerce_panel a:hover{text-decoration:underline}.bwg_comment_textarea::-webkit-scrollbar{width:4px}.bwg_comment_textarea::-webkit-scrollbar-thumb{background-color:rgba(255,255,255,.55);border-radius:2px}.bwg_comment_textarea::-webkit-scrollbar-thumb:hover{background-color:#d9d9d9}.bwg_ctrl_btn_container a,.bwg_ctrl_btn_container a:hover{text-decoration:none}.bwg_facebook:hover{color:#3b5998}.bwg_twitter:hover{color:#4099fb}.bwg_pinterest:hover{color:#cb2027}.bwg_tumblr:hover{color:#2f5070}.bwg_image_container{display:table;position:absolute;text-align:center;vertical-align:middle;width:100%}.bwg_filmstrip_container{position:absolute;z-index:10150}.bwg_filmstrip{overflow:hidden;position:absolute;z-index:10106}.bwg_filmstrip_thumbnails{margin:0 auto;overflow:hidden;position:relative}.bwg_filmstrip_thumbnail{position:relative;background:0 0;float:left;cursor:pointer;overflow:hidden}.bwg_filmstrip_thumbnail .bwg_filmstrip_thumbnail_img_wrap{overflow:hidden}.bwg_thumb_active{opacity:1}.bwg_filmstrip_thumbnail_img{display:block;opacity:1}.bwg_filmstrip_left{cursor:pointer;vertical-align:middle;z-index:10106;line-height:0}.bwg_filmstrip_right{cursor:pointer;vertical-align:middle;z-index:10106;line-height:0}.bwg_none_selectable{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.bwg_watermark_container{display:table-cell;margin:0 auto;position:relative;vertical-align:middle}.bwg_watermark_container>div{display:table;margin:0 auto}.bwg_watermark_spun{display:table-cell;overflow:hidden;position:relative}.bwg_watermark_image{margin:4px;position:relative;z-index:10141}.bwg_watermark_text,.bwg_watermark_text:hover{text-decoration:none;margin:4px;position:relative;z-index:10141}.bwg_slide_container{display:table-cell;position:absolute;vertical-align:middle;width:100%;height:100%}.bwg_slide_bg{margin:0 auto;width:inherit;height:inherit}.bwg_slider{height:inherit;width:inherit}.bwg_popup_image_spun{height:inherit;display:table-cell;opacity:1;position:absolute;vertical-align:middle;width:inherit;z-index:2}.bwg_popup_image_second_spun{width:inherit;height:inherit;display:table-cell;opacity:0;position:absolute;vertical-align:middle;z-index:1}.bwg_grid{display:none;height:100%;overflow:hidden;position:absolute;width:100%}.bwg_gridlet{opacity:1;position:absolute}.bwg_image_info::-webkit-scrollbar{width:4px}.bwg_image_info::-webkit-scrollbar-thumb{background-color:rgba(255,255,255,.55);border-radius:2px}.bwg_image_info::-webkit-scrollbar-thumb:hover{background-color:#d9d9d9}#bwg_rate_form .bwg_hint{margin:0 5px;display:none}.bwg_star{display:inline-block;width:unset!important}.bwg_image_count_container{left:0;line-height:1;position:absolute;vertical-align:middle}#bwg_comment_form label{display:block;font-weight:700;margin-top:17px;text-transform:uppercase}#bwg_comment_form .bwg-privacy-policy-box label{text-transform:unset;word-break:break-word}.bwg_popup_image_spun .bwg_popup_image_spun1{width:inherit;height:inherit}.bwg_popup_image_spun1 .bwg_popup_image_spun2{vertical-align:middle;text-align:center;height:100%}#embed_conteiner{table-layout:fixed;height:100%}#opacity_div{background-color:rgba(255,255,255,.2);position:absolute;z-index:10150}#loading_div{text-align:center;position:relative;vertical-align:middle;z-index:10170;float:none;width:30px;height:30px;background-size:30px 30px;background-repeat:no-repeat;background-position:50% 50%}#ecommerce_ajax_loading{position:absolute}#ecommerce_opacity_div{display:none;background-color:rgba(255,255,255,.2);position:absolute;z-index:10150}#ecommerce_loading_div{display:none;text-align:center;position:relative;vertical-align:middle;z-index:10170;float:none;width:30px;height:30px;background-size:30px 30px;background-repeat:no-repeat;background-position:50% 50%}.bwg_ecommerce_panel.bwg_popup_sidebar_panel.bwg_popup_sidebar{text-align:left}#ajax_loading{position:absolute}@media (max-width:480px){.bwg_image_count_container{display:none}.bwg_image_title,.bwg_image_title *{font-size:12px}.bwg_image_description,.bwg_image_description *{font-size:10px}}div[id^=bwg_container1_] div[id^=bwg_container2_] div[class^=bwg_slideshow_image_wrap_] *{box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box}div[id^=bwg_container1_] div[id^=bwg_container2_] div[class^=bwg_slideshow_image_wrap_]{border-collapse:collapse;display:table;position:relative;text-align:center;margin:auto}div[id^=bwg_container1_] div[id^=bwg_container2_] img[class^=bwg_slideshow_image_]{display:inline-block;padding:0!important;margin:0!important;float:none!important;vertical-align:middle}div[id^=bwg_container1_] div[id^=bwg_container2_] span[class^=bwg_slideshow_embed_]{padding:0!important;margin:0!important;float:none!important;vertical-align:middle;display:inline-block;text-align:center}div[id^=bwg_container1_] div[id^=bwg_container2_] img[class^=bwg_slideshow_watermark_]{position:relative;z-index:15}div[id^=bwg_container1_] div[id^=bwg_container2_] span.bwg_slideshow_play_pause{bottom:0;cursor:pointer;display:table;height:inherit;outline:medium none;position:absolute;width:30%;left:35%;z-index:13}div[id^=bwg_container1_] div[id^=bwg_container2_] span.bwg_slideshow_play_pause:hover span[id^=bwg_slideshow_play_pause-ico_]{display:inline-block!important}div[id^=bwg_container1_] div[id^=bwg_container2_] span.bwg_slideshow_play_pause:hover span{position:relative;z-index:13}div[id^=bwg_container1_] div[id^=bwg_container2_] span.bwg_slideshow_play_pause span{display:table-cell;text-align:center;vertical-align:middle;z-index:13}div[id^=bwg_container1_] div[id^=bwg_container2_] span[id^=bwg_slideshow_play_pause-ico_]{display:none!important;cursor:pointer;position:relative;z-index:13}div[id^=bwg_container1_] div[id^=bwg_container2_] span[id^=bwg_slideshow_play_pause-ico_]:hover{display:inline-block;position:relative;z-index:13}div[id^=bwg_container1_] div[id^=bwg_container2_] a[id^=spider_slideshow_left_],div[id^=bwg_container1_] div[id^=bwg_container2_] a[id^=spider_slideshow_right_]{bottom:35%;cursor:pointer;display:inline;height:30%;outline:medium none;position:absolute;width:35%;z-index:13}div[id^=bwg_container1_] div[id^=bwg_container2_] a[id^=spider_slideshow_left_]{left:0}div[id^=bwg_container1_] div[id^=bwg_container2_] a[id^=spider_slideshow_right_]{right:0}div[id^=bwg_container1_] div[id^=bwg_container2_] a[id^=spider_slideshow_left_]:hover,div[id^=bwg_container1_] div[id^=bwg_container2_] a[id^=spider_slideshow_right_]:hover{visibility:visible}div[id^=bwg_container1_] div[id^=bwg_container2_] a[id^=spider_slideshow_left_]:hover,div[id^=bwg_container1_] div[id^=bwg_container2_] a[id^=spider_slideshow_right_]:hover{visibility:visible}div[id^=bwg_container1_] div[id^=bwg_container2_] a[id^=spider_slideshow_right_]:hover span{left:auto!important;right:20px!important}div[id^=bwg_container1_] div[id^=bwg_container2_] a[id^=spider_slideshow_left_]:hover span{left:20px!important}div[id^=bwg_container1_] div[id^=bwg_container2_] span[id^=spider_slideshow_left-ico_] span,div[id^=bwg_container1_] div[id^=bwg_container2_] span[id^=spider_slideshow_right-ico_] span{display:table-cell;text-align:center;vertical-align:middle;z-index:13}div[id^=bwg_container1_] div[id^=bwg_container2_] span[id^=spider_slideshow_left-ico_],div[id^=bwg_container1_] div[id^=bwg_container2_] span[id^=spider_slideshow_right-ico_]{z-index:13;-moz-box-sizing:content-box;box-sizing:content-box;cursor:pointer;display:table;line-height:0;margin-top:-15px;position:absolute;top:50%}div[id^=bwg_container1_] div[id^=bwg_container2_] span[id^=spider_slideshow_left-ico_]:hover,div[id^=bwg_container1_] div[id^=bwg_container2_] span[id^=spider_slideshow_right-ico_]:hover{cursor:pointer}div[id^=bwg_container1_] div[id^=bwg_container2_] div[class^=bwg_slideshow_image_container_]{display:table;position:absolute;text-align:center;vertical-align:middle}div[id^=bwg_container1_] div[id^=bwg_container2_] div[class^=bwg_slideshow_filmstrip_container_]{position:absolute}div[id^=bwg_container1_] div[id^=bwg_container2_] .bwg_slideshow_filmstrip{overflow:hidden;position:absolute}div[id^=bwg_container1_] div[id^=bwg_container2_] div[class^=bwg_slideshow_filmstrip_thumbnails_]{margin:0 auto;overflow:hidden;position:relative}div[id^=bwg_container1_] div[id^=bwg_container2_] div[class^=bwg_slideshow_filmstrip_thumbnail_]{position:relative;background:0 0;cursor:pointer;float:left;overflow:hidden}div[id^=bwg_container1_] div[id^=bwg_container2_] div[class^=bwg_slideshow_thumb_active_]{opacity:1}div[id^=bwg_container1_] div[id^=bwg_container2_] img[class^=bwg_slideshow_filmstrip_thumbnail_img_]{display:block;opacity:1;padding:0!important}div[id^=bwg_container1_] div[id^=bwg_container2_] div[class^=bwg_slideshow_filmstrip_left_]{cursor:pointer;vertical-align:middle}div[id^=bwg_container1_] div[id^=bwg_container2_] div[class^=bwg_slideshow_filmstrip_right_]{cursor:pointer;vertical-align:middle}div[id^=bwg_container1_] div[id^=bwg_container2_] a[class^=bwg_none_selectable_]{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}div[id^=bwg_container1_] div[id^=bwg_container2_] div[class^=bwg_slideshow_watermark_container_]{display:table-cell;margin:0 auto;position:relative;vertical-align:middle}div[id^=bwg_container1_] div[id^=bwg_container2_] span[class^=bwg_slideshow_watermark_spun_]{display:table-cell;overflow:hidden;position:relative}div[id^=bwg_container1_] div[id^=bwg_container2_] span[class^=bwg_slideshow_title_spun_]{display:table-cell;overflow:hidden;position:relative}div[id^=bwg_container1_] div[id^=bwg_container2_] span[class^=bwg_slideshow_description_spun_]{display:table-cell;overflow:hidden;position:relative}div[id^=bwg_container1_] div[id^=bwg_container2_] img[class^=bwg_slideshow_watermark_image_]{padding:0!important;float:none!important;margin:4px!important;position:relative;z-index:15}div[id^=bwg_container1_] div[id^=bwg_container2_] a[class^=bwg_slideshow_watermark_text_],div[id^=bwg_container1_] div[id^=bwg_container2_] a[class^=bwg_slideshow_watermark_text_]:hover{text-decoration:none;margin:4px;position:relative;z-index:15}div[id^=bwg_container1_] div[id^=bwg_container2_] div[class^=bwg_slideshow_title_text_]{text-decoration:none;position:relative;z-index:11;display:inline-block;word-wrap:break-word;word-break:break-word}div[id^=bwg_container1_] div[id^=bwg_container2_] div[class^=bwg_slideshow_description_text_]{text-decoration:none;position:relative;z-index:15;margin:5px;display:inline-block;word-wrap:break-word;word-break:break-word}div[id^=bwg_container1_] div[id^=bwg_container2_] div[class^=bwg_slide_container_]{display:table-cell;margin:0 auto;position:absolute;vertical-align:middle;width:100%;height:100%}div[id^=bwg_container1_] div[id^=bwg_container2_] div[class^=bwg_slide_bg_]{margin:0 auto;width:inherit;height:inherit}div[id^=bwg_container1_] div[id^=bwg_container2_] div[class^=bwg_slider_]{height:inherit;width:inherit}div[id^=bwg_container1_] div[id^=bwg_container2_] span[class^=bwg_slideshow_image_spun_]{width:inherit;height:inherit;display:table-cell;opacity:1;position:absolute;vertical-align:middle;z-index:2}div[id^=bwg_container1_] div[id^=bwg_container2_] span[class^=bwg_slideshow_image_second_spun_]{width:inherit;height:inherit;display:table-cell;opacity:0;position:absolute;vertical-align:middle;z-index:1}div[id^=bwg_container1_] div[id^=bwg_container2_] span[class^=bwg_grid_]{display:none;height:100%;overflow:hidden;position:absolute;width:100%}div[id^=bwg_container1_] div[id^=bwg_container2_] span[class^=bwg_gridlet_]{opacity:1;position:absolute}div[id^=bwg_container1_] div[id^=bwg_container2_] span[class^=bwg_slideshow_dots_]{display:inline-block;position:relative;cursor:pointer;overflow:hidden;z-index:17}div[id^=bwg_container1_] div[id^=bwg_container2_] div[class^=bwg_slideshow_dots_container_]{display:block;overflow:hidden;position:absolute;z-index:17}div[id^=bwg_container1_] div[id^=bwg_container2_] div[class^=bwg_slideshow_dots_thumbnails_]{left:0;font-size:0;margin:0 auto;overflow:hidden;position:relative}div[id^=bwg_container1_] div[id^=bwg_container2_] span[class^=bwg_slideshow_dots_active_]{opacity:1}div[id^=bwg_container1_] div[id^=bwg_container2_] span[class^=bwg_slideshow_image_spun1_]{display:table;width:inherit;height:inherit}div[id^=bwg_container1_] div[id^=bwg_container2_] span[class^=bwg_slideshow_image_spun2_]{display:table-cell;vertical-align:middle;text-align:center}div[id^=bwg_container1_] div[id^=bwg_container2_] span[class^=bwg_mosaic_play_icon_spun_]{display:flex;height:100%;opacity:1;position:absolute;top:0;width:100%;z-index:100;justify-content:center;align-content:center;flex-direction:column;text-align:center;left:0}.lazy_loader{background-image:url(../images/ajax_loader.png);background-size:30px 30px;background-repeat:no-repeat;background-position:50% 50%}#bwg_thumbnails_masonry_0{overflow:hidden}
|
filemanager/js/jq_uploader/jquery.fileupload.js
CHANGED
@@ -9,1494 +9,1603 @@
|
|
9 |
* https://opensource.org/licenses/MIT
|
10 |
*/
|
11 |
|
12 |
-
/*
|
13 |
-
/*
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
// Handle devices which give false positives for the feature detection:
|
40 |
-
'(Android (1\\.[0156]|2\\.[01]))' +
|
41 |
-
'|(Windows Phone (OS 7|8\\.0))|(XBLWP)|(ZuneWP)|(WPDesktop)' +
|
42 |
-
'|(w(eb)?OSBrowser)|(webOS)' +
|
43 |
-
'|(Kindle/(1\\.0|2\\.[05]|3\\.0))'
|
44 |
).test(window.navigator.userAgent) ||
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
|
79 |
-
|
80 |
-
// via fileInput setting and paste or drop events of the given dropZone.
|
81 |
-
// In addition to the default jQuery Widget methods, the fileupload widget
|
82 |
-
// exposes the "add" and "send" methods, to add or directly send files using
|
83 |
-
// the fileupload API.
|
84 |
-
// By default, files added via file input selection, paste, drag & drop or
|
85 |
-
// "add" method are uploaded immediately, but it is possible to override
|
86 |
-
// the "add" callback option to queue file uploads.
|
87 |
-
$.widget('blueimp.fileupload', {
|
88 |
-
|
89 |
-
options: {
|
90 |
-
// The drop target element(s), by the default the complete document.
|
91 |
-
// Set to null to disable drag & drop support:
|
92 |
-
dropZone: $(document),
|
93 |
-
// The paste target element(s), by the default undefined.
|
94 |
-
// Set to a DOM node or jQuery object to enable file pasting:
|
95 |
-
pasteZone: undefined,
|
96 |
-
// The file input field(s), that are listened to for change events.
|
97 |
-
// If undefined, it is set to the file input fields inside
|
98 |
-
// of the widget element on plugin initialization.
|
99 |
-
// Set to null to disable the change listener.
|
100 |
-
fileInput: undefined,
|
101 |
-
// By default, the file input field is replaced with a clone after
|
102 |
-
// each input field change event. This is required for iframe transport
|
103 |
-
// queues and allows change events to be fired for the same file
|
104 |
-
// selection, but can be disabled by setting the following option to false:
|
105 |
-
replaceFileInput: true,
|
106 |
-
// The parameter name for the file form data (the request argument name).
|
107 |
-
// If undefined or empty, the name property of the file input field is
|
108 |
-
// used, or "files[]" if the file input name property is also empty,
|
109 |
-
// can be a string or an array of strings:
|
110 |
-
paramName: undefined,
|
111 |
-
// By default, each file of a selection is uploaded using an individual
|
112 |
-
// request for XHR type uploads. Set to false to upload file
|
113 |
-
// selections in one request each:
|
114 |
-
singleFileUploads: true,
|
115 |
-
// To limit the number of files uploaded with one XHR request,
|
116 |
-
// set the following option to an integer greater than 0:
|
117 |
-
limitMultiFileUploads: undefined,
|
118 |
-
// The following option limits the number of files uploaded with one
|
119 |
-
// XHR request to keep the request size under or equal to the defined
|
120 |
-
// limit in bytes:
|
121 |
-
limitMultiFileUploadSize: undefined,
|
122 |
-
// Multipart file uploads add a number of bytes to each uploaded file,
|
123 |
-
// therefore the following option adds an overhead for each file used
|
124 |
-
// in the limitMultiFileUploadSize configuration:
|
125 |
-
limitMultiFileUploadSizeOverhead: 512,
|
126 |
-
// Set the following option to true to issue all file upload requests
|
127 |
-
// in a sequential order:
|
128 |
-
sequentialUploads: false,
|
129 |
-
// To limit the number of concurrent uploads,
|
130 |
-
// set the following option to an integer greater than 0:
|
131 |
-
limitConcurrentUploads: undefined,
|
132 |
-
// Set the following option to true to force iframe transport uploads:
|
133 |
-
forceIframeTransport: false,
|
134 |
-
// Set the following option to the location of a redirect url on the
|
135 |
-
// origin server, for cross-domain iframe transport uploads:
|
136 |
-
redirect: undefined,
|
137 |
-
// The parameter name for the redirect url, sent as part of the form
|
138 |
-
// data and set to 'redirect' if this option is empty:
|
139 |
-
redirectParamName: undefined,
|
140 |
-
// Set the following option to the location of a postMessage window,
|
141 |
-
// to enable postMessage transport uploads:
|
142 |
-
postMessage: undefined,
|
143 |
-
// By default, XHR file uploads are sent as multipart/form-data.
|
144 |
-
// The iframe transport is always using multipart/form-data.
|
145 |
-
// Set to false to enable non-multipart XHR uploads:
|
146 |
-
multipart: true,
|
147 |
-
// To upload large files in smaller chunks, set the following option
|
148 |
-
// to a preferred maximum chunk size. If set to 0, null or undefined,
|
149 |
-
// or the browser does not support the required Blob API, files will
|
150 |
-
// be uploaded as a whole.
|
151 |
-
maxChunkSize: undefined,
|
152 |
-
// When a non-multipart upload or a chunked multipart upload has been
|
153 |
-
// aborted, this option can be used to resume the upload by setting
|
154 |
-
// it to the size of the already uploaded bytes. This option is most
|
155 |
-
// useful when modifying the options object inside of the "add" or
|
156 |
-
// "send" callbacks, as the options are cloned for each file upload.
|
157 |
-
uploadedBytes: undefined,
|
158 |
-
// By default, failed (abort or error) file uploads are removed from the
|
159 |
-
// global progress calculation. Set the following option to false to
|
160 |
-
// prevent recalculating the global progress data:
|
161 |
-
recalculateProgress: true,
|
162 |
-
// Interval in milliseconds to calculate and trigger progress events:
|
163 |
-
progressInterval: 100,
|
164 |
-
// Interval in milliseconds to calculate progress bitrate:
|
165 |
-
bitrateInterval: 500,
|
166 |
-
// By default, uploads are started automatically when adding files:
|
167 |
-
autoUpload: true,
|
168 |
-
|
169 |
-
// Error and info messages:
|
170 |
-
messages: {
|
171 |
-
uploadedBytes: 'Uploaded bytes exceed file size'
|
172 |
-
},
|
173 |
-
|
174 |
-
// Translation function, gets the message key to be translated
|
175 |
-
// and an object with context specific data as arguments:
|
176 |
-
i18n: function (message, context) {
|
177 |
-
message = this.messages[message] || message.toString();
|
178 |
-
if (context) {
|
179 |
-
$.each(context, function (key, value) {
|
180 |
-
message = message.replace('{' + key + '}', value);
|
181 |
-
});
|
182 |
-
}
|
183 |
-
return message;
|
184 |
-
},
|
185 |
-
|
186 |
-
// Additional form data to be sent along with the file uploads can be set
|
187 |
-
// using this option, which accepts an array of objects with name and
|
188 |
-
// value properties, a function returning such an array, a FormData
|
189 |
-
// object (for XHR file uploads), or a simple object.
|
190 |
-
// The form of the first fileInput is given as parameter to the function:
|
191 |
-
formData: function (form) {
|
192 |
-
return form.serializeArray();
|
193 |
-
},
|
194 |
-
|
195 |
-
// The add callback is invoked as soon as files are added to the fileupload
|
196 |
-
// widget (via file input selection, drag & drop, paste or add API call).
|
197 |
-
// If the singleFileUploads option is enabled, this callback will be
|
198 |
-
// called once for each file in the selection for XHR file uploads, else
|
199 |
-
// once for each file selection.
|
200 |
-
//
|
201 |
-
// The upload starts when the submit method is invoked on the data parameter.
|
202 |
-
// The data object contains a files property holding the added files
|
203 |
-
// and allows you to override plugin options as well as define ajax settings.
|
204 |
-
//
|
205 |
-
// Listeners for this callback can also be bound the following way:
|
206 |
-
// .bind('fileuploadadd', func);
|
207 |
-
//
|
208 |
-
// data.submit() returns a Promise object and allows to attach additional
|
209 |
-
// handlers using jQuery's Deferred callbacks:
|
210 |
-
// data.submit().done(func).fail(func).always(func);
|
211 |
-
add: function (e, data) {
|
212 |
-
if (e.isDefaultPrevented()) {
|
213 |
-
return false;
|
214 |
-
}
|
215 |
-
if (data.autoUpload || (data.autoUpload !== false &&
|
216 |
-
$(this).fileupload('option', 'autoUpload'))) {
|
217 |
-
data.process().done(function () {
|
218 |
-
data.submit();
|
219 |
-
});
|
220 |
-
}
|
221 |
-
},
|
222 |
|
223 |
-
|
|
|
224 |
|
225 |
-
|
226 |
-
|
227 |
|
228 |
-
|
229 |
-
|
230 |
|
231 |
-
|
232 |
-
|
233 |
|
234 |
-
|
235 |
-
|
236 |
|
237 |
-
|
238 |
-
|
239 |
|
240 |
-
|
241 |
-
|
242 |
|
243 |
-
|
244 |
-
|
245 |
|
246 |
-
|
247 |
-
|
248 |
|
249 |
-
|
250 |
-
|
251 |
|
252 |
-
|
253 |
-
|
254 |
|
255 |
-
|
256 |
-
|
257 |
|
258 |
-
|
259 |
-
|
260 |
|
261 |
-
|
262 |
-
|
263 |
|
264 |
-
|
265 |
-
|
266 |
|
267 |
-
|
268 |
-
|
269 |
|
270 |
-
|
271 |
-
|
272 |
|
273 |
-
|
274 |
-
|
275 |
|
276 |
-
|
277 |
-
|
|
|
|
|
|
|
|
|
|
|
278 |
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
|
|
|
|
286 |
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
'multipart',
|
294 |
-
'forceIframeTransport'
|
295 |
-
],
|
296 |
-
|
297 |
-
_blobSlice: $.support.blobSlice && function () {
|
298 |
-
var slice = this.slice || this.webkitSlice || this.mozSlice;
|
299 |
-
return slice.apply(this, arguments);
|
300 |
-
},
|
301 |
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
345 |
});
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
if (obj._progress) {
|
356 |
-
$.extend(obj._progress, progress);
|
357 |
-
} else {
|
358 |
-
obj._progress = progress;
|
359 |
-
}
|
360 |
-
},
|
361 |
-
|
362 |
-
_initResponseObject: function (obj) {
|
363 |
-
var prop;
|
364 |
-
if (obj._response) {
|
365 |
-
for (prop in obj._response) {
|
366 |
-
if (obj._response.hasOwnProperty(prop)) {
|
367 |
-
delete obj._response[prop];
|
368 |
-
}
|
369 |
-
}
|
370 |
-
} else {
|
371 |
-
obj._response = {};
|
372 |
-
}
|
373 |
-
},
|
374 |
-
|
375 |
-
_onProgress: function (e, data) {
|
376 |
-
if (e.lengthComputable) {
|
377 |
-
var now = ((Date.now) ? Date.now() : (new Date()).getTime()),
|
378 |
-
loaded;
|
379 |
-
if (data._time && data.progressInterval &&
|
380 |
-
(now - data._time < data.progressInterval) &&
|
381 |
-
e.loaded !== e.total) {
|
382 |
-
return;
|
383 |
-
}
|
384 |
-
data._time = now;
|
385 |
-
loaded = Math.floor(
|
386 |
-
e.loaded / e.total * (data.chunkSize || data._progress.total)
|
387 |
-
) + (data.uploadedBytes || 0);
|
388 |
-
// Add the difference from the previously loaded state
|
389 |
-
// to the global loaded counter:
|
390 |
-
this._progress.loaded += (loaded - data._progress.loaded);
|
391 |
-
this._progress.bitrate = this._bitrateTimer.getBitrate(
|
392 |
-
now,
|
393 |
-
this._progress.loaded,
|
394 |
-
data.bitrateInterval
|
395 |
-
);
|
396 |
-
data._progress.loaded = data.loaded = loaded;
|
397 |
-
data._progress.bitrate = data.bitrate = data._bitrateTimer.getBitrate(
|
398 |
-
now,
|
399 |
-
loaded,
|
400 |
-
data.bitrateInterval
|
401 |
-
);
|
402 |
-
// Trigger a custom progress event with a total data property set
|
403 |
-
// to the file size(s) of the current upload and a loaded data
|
404 |
-
// property calculated accordingly:
|
405 |
-
this._trigger(
|
406 |
-
'progress',
|
407 |
-
$.Event('progress', {delegatedEvent: e}),
|
408 |
-
data
|
409 |
-
);
|
410 |
-
// Trigger a global progress event for all current file uploads,
|
411 |
-
// including ajax calls queued for sequential file uploads:
|
412 |
-
this._trigger(
|
413 |
-
'progressall',
|
414 |
-
$.Event('progressall', {delegatedEvent: e}),
|
415 |
-
this._progress
|
416 |
-
);
|
417 |
-
}
|
418 |
-
},
|
419 |
-
|
420 |
-
_initProgressListener: function (options) {
|
421 |
-
var that = this,
|
422 |
-
xhr = options.xhr ? options.xhr() : $.ajaxSettings.xhr();
|
423 |
-
// Accesss to the native XHR object is required to add event listeners
|
424 |
-
// for the upload progress event:
|
425 |
-
if (xhr.upload) {
|
426 |
-
$(xhr.upload).bind('progress', function (e) {
|
427 |
-
var oe = e.originalEvent;
|
428 |
-
// Make sure the progress event properties get copied over:
|
429 |
-
e.lengthComputable = oe.lengthComputable;
|
430 |
-
e.loaded = oe.loaded;
|
431 |
-
e.total = oe.total;
|
432 |
-
that._onProgress(e, options);
|
433 |
-
});
|
434 |
-
options.xhr = function () {
|
435 |
-
return xhr;
|
436 |
-
};
|
437 |
-
}
|
438 |
-
},
|
439 |
-
|
440 |
-
_deinitProgressListener: function (options) {
|
441 |
-
var xhr = options.xhr ? options.xhr() : $.ajaxSettings.xhr();
|
442 |
-
if (xhr.upload) {
|
443 |
-
$(xhr.upload).unbind('progress');
|
444 |
-
}
|
445 |
-
},
|
446 |
-
|
447 |
-
_isInstanceOf: function (type, obj) {
|
448 |
-
// Cross-frame instanceof check
|
449 |
-
return Object.prototype.toString.call(obj) === '[object ' + type + ']';
|
450 |
-
},
|
451 |
-
|
452 |
-
_initXHRData: function (options) {
|
453 |
-
var that = this,
|
454 |
-
formData,
|
455 |
-
file = options.files[0],
|
456 |
-
// Ignore non-multipart setting if not supported:
|
457 |
-
multipart = options.multipart || !$.support.xhrFileUpload,
|
458 |
-
paramName = $.type(options.paramName) === 'array' ?
|
459 |
-
options.paramName[0] : options.paramName;
|
460 |
-
options.headers = $.extend({}, options.headers);
|
461 |
-
if (options.contentRange) {
|
462 |
-
options.headers['Content-Range'] = options.contentRange;
|
463 |
-
}
|
464 |
-
if (!multipart || options.blob || !this._isInstanceOf('File', file)) {
|
465 |
-
options.headers['Content-Disposition'] = 'attachment; filename="' +
|
466 |
-
encodeURI(file.uploadName || file.name) + '"';
|
467 |
-
}
|
468 |
-
if (!multipart) {
|
469 |
-
options.contentType = file.type || 'application/octet-stream';
|
470 |
-
options.data = options.blob || file;
|
471 |
-
} else if ($.support.xhrFormDataFileUpload) {
|
472 |
-
if (options.postMessage) {
|
473 |
-
// window.postMessage does not allow sending FormData
|
474 |
-
// objects, so we just add the File/Blob objects to
|
475 |
-
// the formData array and let the postMessage window
|
476 |
-
// create the FormData object out of this array:
|
477 |
-
formData = this._getFormData(options);
|
478 |
-
if (options.blob) {
|
479 |
-
formData.push({
|
480 |
-
name: paramName,
|
481 |
-
value: options.blob
|
482 |
-
});
|
483 |
-
} else {
|
484 |
-
$.each(options.files, function (index, file) {
|
485 |
-
formData.push({
|
486 |
-
name: ($.type(options.paramName) === 'array' &&
|
487 |
-
options.paramName[index]) || paramName,
|
488 |
-
value: file
|
489 |
-
});
|
490 |
-
});
|
491 |
-
}
|
492 |
-
} else {
|
493 |
-
if (that._isInstanceOf('FormData', options.formData)) {
|
494 |
-
formData = options.formData;
|
495 |
-
} else {
|
496 |
-
formData = new FormData();
|
497 |
-
$.each(this._getFormData(options), function (index, field) {
|
498 |
-
formData.append(field.name, field.value);
|
499 |
-
});
|
500 |
-
}
|
501 |
-
if (options.blob) {
|
502 |
-
formData.append(
|
503 |
-
paramName,
|
504 |
-
options.blob,
|
505 |
-
file.uploadName || file.name
|
506 |
-
);
|
507 |
-
} else {
|
508 |
-
$.each(options.files, function (index, file) {
|
509 |
-
// This check allows the tests to run with
|
510 |
-
// dummy objects:
|
511 |
-
if (that._isInstanceOf('File', file) ||
|
512 |
-
that._isInstanceOf('Blob', file)) {
|
513 |
-
formData.append(
|
514 |
-
($.type(options.paramName) === 'array' &&
|
515 |
-
options.paramName[index]) || paramName,
|
516 |
-
file,
|
517 |
-
file.uploadName || file.name
|
518 |
-
);
|
519 |
-
}
|
520 |
-
});
|
521 |
-
}
|
522 |
-
}
|
523 |
-
options.data = formData;
|
524 |
-
}
|
525 |
-
// Blob reference is not needed anymore, free memory:
|
526 |
-
options.blob = null;
|
527 |
-
},
|
528 |
-
|
529 |
-
_initIframeSettings: function (options) {
|
530 |
-
var targetHost = $('<a></a>').prop('href', options.url).prop('host');
|
531 |
-
// Setting the dataType to iframe enables the iframe transport:
|
532 |
-
options.dataType = 'iframe ' + (options.dataType || '');
|
533 |
-
// The iframe transport accepts a serialized array as form data:
|
534 |
-
options.formData = this._getFormData(options);
|
535 |
-
// Add redirect url to form data on cross-domain uploads:
|
536 |
-
if (options.redirect && targetHost && targetHost !== location.host) {
|
537 |
-
options.formData.push({
|
538 |
-
name: options.redirectParamName || 'redirect',
|
539 |
-
value: options.redirect
|
540 |
-
});
|
541 |
-
}
|
542 |
-
},
|
543 |
-
|
544 |
-
_initDataSettings: function (options) {
|
545 |
-
if (this._isXHRUpload(options)) {
|
546 |
-
if (!this._chunkedUpload(options, true)) {
|
547 |
-
if (!options.data) {
|
548 |
-
this._initXHRData(options);
|
549 |
-
}
|
550 |
-
this._initProgressListener(options);
|
551 |
-
}
|
552 |
-
if (options.postMessage) {
|
553 |
-
// Setting the dataType to postmessage enables the
|
554 |
-
// postMessage transport:
|
555 |
-
options.dataType = 'postmessage ' + (options.dataType || '');
|
556 |
-
}
|
557 |
-
} else {
|
558 |
-
this._initIframeSettings(options);
|
559 |
-
}
|
560 |
-
},
|
561 |
-
|
562 |
-
_getParamName: function (options) {
|
563 |
-
var fileInput = $(options.fileInput),
|
564 |
-
paramName = options.paramName;
|
565 |
-
if (!paramName) {
|
566 |
-
paramName = [];
|
567 |
-
fileInput.each(function () {
|
568 |
-
var input = $(this),
|
569 |
-
name = input.prop('name') || 'files[]',
|
570 |
-
i = (input.prop('files') || [1]).length;
|
571 |
-
while (i) {
|
572 |
-
paramName.push(name);
|
573 |
-
i -= 1;
|
574 |
-
}
|
575 |
-
});
|
576 |
-
if (!paramName.length) {
|
577 |
-
paramName = [fileInput.prop('name') || 'files[]'];
|
578 |
-
}
|
579 |
-
} else if (!$.isArray(paramName)) {
|
580 |
-
paramName = [paramName];
|
581 |
-
}
|
582 |
-
return paramName;
|
583 |
-
},
|
584 |
-
|
585 |
-
_initFormSettings: function (options) {
|
586 |
-
// Retrieve missing options from the input field and the
|
587 |
-
// associated form, if available:
|
588 |
-
if (!options.form || !options.form.length) {
|
589 |
-
options.form = $(options.fileInput.prop('form'));
|
590 |
-
// If the given file input doesn't have an associated form,
|
591 |
-
// use the default widget file input's form:
|
592 |
-
if (!options.form.length) {
|
593 |
-
options.form = $(this.options.fileInput.prop('form'));
|
594 |
-
}
|
595 |
-
}
|
596 |
-
options.paramName = this._getParamName(options);
|
597 |
-
if (!options.url) {
|
598 |
-
options.url = options.form.prop('action') || location.href;
|
599 |
-
}
|
600 |
-
// The HTTP request method must be "POST" or "PUT":
|
601 |
-
options.type = (options.type ||
|
602 |
-
($.type(options.form.prop('method')) === 'string' &&
|
603 |
-
options.form.prop('method')) || ''
|
604 |
-
).toUpperCase();
|
605 |
-
if (options.type !== 'POST' && options.type !== 'PUT' &&
|
606 |
-
options.type !== 'PATCH') {
|
607 |
-
options.type = 'POST';
|
608 |
-
}
|
609 |
-
if (!options.formAcceptCharset) {
|
610 |
-
options.formAcceptCharset = options.form.attr('accept-charset');
|
611 |
-
}
|
612 |
-
},
|
613 |
-
|
614 |
-
_getAJAXSettings: function (data) {
|
615 |
-
var options = $.extend({}, this.options, data);
|
616 |
-
this._initFormSettings(options);
|
617 |
-
this._initDataSettings(options);
|
618 |
-
return options;
|
619 |
-
},
|
620 |
-
|
621 |
-
// jQuery 1.6 doesn't provide .state(),
|
622 |
-
// while jQuery 1.8+ removed .isRejected() and .isResolved():
|
623 |
-
_getDeferredState: function (deferred) {
|
624 |
-
if (deferred.state) {
|
625 |
-
return deferred.state();
|
626 |
-
}
|
627 |
-
if (deferred.isResolved()) {
|
628 |
-
return 'resolved';
|
629 |
-
}
|
630 |
-
if (deferred.isRejected()) {
|
631 |
-
return 'rejected';
|
632 |
-
}
|
633 |
-
return 'pending';
|
634 |
-
},
|
635 |
-
|
636 |
-
// Maps jqXHR callbacks to the equivalent
|
637 |
-
// methods of the given Promise object:
|
638 |
-
_enhancePromise: function (promise) {
|
639 |
-
promise.success = promise.done;
|
640 |
-
promise.error = promise.fail;
|
641 |
-
promise.complete = promise.always;
|
642 |
-
return promise;
|
643 |
-
},
|
644 |
-
|
645 |
-
// Creates and returns a Promise object enhanced with
|
646 |
-
// the jqXHR methods abort, success, error and complete:
|
647 |
-
_getXHRPromise: function (resolveOrReject, context, args) {
|
648 |
-
var dfd = $.Deferred(),
|
649 |
-
promise = dfd.promise();
|
650 |
-
context = context || this.options.context || promise;
|
651 |
-
if (resolveOrReject === true) {
|
652 |
-
dfd.resolveWith(context, args);
|
653 |
-
} else if (resolveOrReject === false) {
|
654 |
-
dfd.rejectWith(context, args);
|
655 |
-
}
|
656 |
-
promise.abort = dfd.promise;
|
657 |
-
return this._enhancePromise(promise);
|
658 |
-
},
|
659 |
-
|
660 |
-
// Adds convenience methods to the data callback argument:
|
661 |
-
_addConvenienceMethods: function (e, data) {
|
662 |
-
var that = this,
|
663 |
-
getPromise = function (args) {
|
664 |
-
return $.Deferred().resolveWith(that, args).promise();
|
665 |
-
};
|
666 |
-
data.process = function (resolveFunc, rejectFunc) {
|
667 |
-
if (resolveFunc || rejectFunc) {
|
668 |
-
data._processQueue = this._processQueue =
|
669 |
-
(this._processQueue || getPromise([this])).then(
|
670 |
-
function () {
|
671 |
-
if (data.errorThrown) {
|
672 |
-
return $.Deferred()
|
673 |
-
.rejectWith(that, [data]).promise();
|
674 |
-
}
|
675 |
-
return getPromise(arguments);
|
676 |
-
}
|
677 |
-
).then(resolveFunc, rejectFunc);
|
678 |
-
}
|
679 |
-
return this._processQueue || getPromise([this]);
|
680 |
-
};
|
681 |
-
data.submit = function () {
|
682 |
-
if (this.state() !== 'pending') {
|
683 |
-
data.jqXHR = this.jqXHR =
|
684 |
-
(that._trigger(
|
685 |
-
'submit',
|
686 |
-
$.Event('submit', {delegatedEvent: e}),
|
687 |
-
this
|
688 |
-
) !== false) && that._onSend(e, this);
|
689 |
-
}
|
690 |
-
return this.jqXHR || that._getXHRPromise();
|
691 |
-
};
|
692 |
-
data.abort = function () {
|
693 |
-
if (this.jqXHR) {
|
694 |
-
return this.jqXHR.abort();
|
695 |
-
}
|
696 |
-
this.errorThrown = 'abort';
|
697 |
-
that._trigger('fail', null, this);
|
698 |
-
return that._getXHRPromise(false);
|
699 |
-
};
|
700 |
-
data.state = function () {
|
701 |
-
if (this.jqXHR) {
|
702 |
-
return that._getDeferredState(this.jqXHR);
|
703 |
-
}
|
704 |
-
if (this._processQueue) {
|
705 |
-
return that._getDeferredState(this._processQueue);
|
706 |
-
}
|
707 |
-
};
|
708 |
-
data.processing = function () {
|
709 |
-
return !this.jqXHR && this._processQueue && that
|
710 |
-
._getDeferredState(this._processQueue) === 'pending';
|
711 |
-
};
|
712 |
-
data.progress = function () {
|
713 |
-
return this._progress;
|
714 |
-
};
|
715 |
-
data.response = function () {
|
716 |
-
return this._response;
|
717 |
-
};
|
718 |
-
},
|
719 |
-
|
720 |
-
// Parses the Range header from the server response
|
721 |
-
// and returns the uploaded bytes:
|
722 |
-
_getUploadedBytes: function (jqXHR) {
|
723 |
-
var range = jqXHR.getResponseHeader('Range'),
|
724 |
-
parts = range && range.split('-'),
|
725 |
-
upperBytesPos = parts && parts.length > 1 &&
|
726 |
-
parseInt(parts[1], 10);
|
727 |
-
return upperBytesPos && upperBytesPos + 1;
|
728 |
-
},
|
729 |
-
|
730 |
-
// Uploads a file in multiple, sequential requests
|
731 |
-
// by splitting the file up in multiple blob chunks.
|
732 |
-
// If the second parameter is true, only tests if the file
|
733 |
-
// should be uploaded in chunks, but does not invoke any
|
734 |
-
// upload requests:
|
735 |
-
_chunkedUpload: function (options, testOnly) {
|
736 |
-
options.uploadedBytes = options.uploadedBytes || 0;
|
737 |
-
var that = this,
|
738 |
-
file = options.files[0],
|
739 |
-
fs = file.size,
|
740 |
-
ub = options.uploadedBytes,
|
741 |
-
mcs = options.maxChunkSize || fs,
|
742 |
-
slice = this._blobSlice,
|
743 |
-
dfd = $.Deferred(),
|
744 |
-
promise = dfd.promise(),
|
745 |
-
jqXHR,
|
746 |
-
upload;
|
747 |
-
if (!(this._isXHRUpload(options) && slice && (ub || ($.type(mcs) === 'function' ? mcs(options) : mcs) < fs)) ||
|
748 |
-
options.data) {
|
749 |
-
return false;
|
750 |
-
}
|
751 |
-
if (testOnly) {
|
752 |
-
return true;
|
753 |
-
}
|
754 |
-
if (ub >= fs) {
|
755 |
-
file.error = options.i18n('uploadedBytes');
|
756 |
-
return this._getXHRPromise(
|
757 |
-
false,
|
758 |
-
options.context,
|
759 |
-
[null, 'error', file.error]
|
760 |
-
);
|
761 |
-
}
|
762 |
-
// The chunk upload method:
|
763 |
-
upload = function () {
|
764 |
-
// Clone the options object for each chunk upload:
|
765 |
-
var o = $.extend({}, options),
|
766 |
-
currentLoaded = o._progress.loaded;
|
767 |
-
o.blob = slice.call(
|
768 |
-
file,
|
769 |
-
ub,
|
770 |
-
ub + ($.type(mcs) === 'function' ? mcs(o) : mcs),
|
771 |
-
file.type
|
772 |
-
);
|
773 |
-
// Store the current chunk size, as the blob itself
|
774 |
-
// will be dereferenced after data processing:
|
775 |
-
o.chunkSize = o.blob.size;
|
776 |
-
// Expose the chunk bytes position range:
|
777 |
-
o.contentRange = 'bytes ' + ub + '-' +
|
778 |
-
(ub + o.chunkSize - 1) + '/' + fs;
|
779 |
-
// Trigger chunkbeforesend to allow form data to be updated for this chunk
|
780 |
-
that._trigger('chunkbeforesend', null, o);
|
781 |
-
// Process the upload data (the blob and potential form data):
|
782 |
-
that._initXHRData(o);
|
783 |
-
// Add progress listeners for this chunk upload:
|
784 |
-
that._initProgressListener(o);
|
785 |
-
jqXHR = ((that._trigger('chunksend', null, o) !== false && $.ajax(o)) ||
|
786 |
-
that._getXHRPromise(false, o.context))
|
787 |
-
.done(function (result, textStatus, jqXHR) {
|
788 |
-
ub = that._getUploadedBytes(jqXHR) ||
|
789 |
-
(ub + o.chunkSize);
|
790 |
-
// Create a progress event if no final progress event
|
791 |
-
// with loaded equaling total has been triggered
|
792 |
-
// for this chunk:
|
793 |
-
if (currentLoaded + o.chunkSize - o._progress.loaded) {
|
794 |
-
that._onProgress($.Event('progress', {
|
795 |
-
lengthComputable: true,
|
796 |
-
loaded: ub - o.uploadedBytes,
|
797 |
-
total: ub - o.uploadedBytes
|
798 |
-
}), o);
|
799 |
-
}
|
800 |
-
options.uploadedBytes = o.uploadedBytes = ub;
|
801 |
-
o.result = result;
|
802 |
-
o.textStatus = textStatus;
|
803 |
-
o.jqXHR = jqXHR;
|
804 |
-
that._trigger('chunkdone', null, o);
|
805 |
-
that._trigger('chunkalways', null, o);
|
806 |
-
if (ub < fs) {
|
807 |
-
// File upload not yet complete,
|
808 |
-
// continue with the next chunk:
|
809 |
-
upload();
|
810 |
-
} else {
|
811 |
-
dfd.resolveWith(
|
812 |
-
o.context,
|
813 |
-
[result, textStatus, jqXHR]
|
814 |
-
);
|
815 |
-
}
|
816 |
-
})
|
817 |
-
.fail(function (jqXHR, textStatus, errorThrown) {
|
818 |
-
o.jqXHR = jqXHR;
|
819 |
-
o.textStatus = textStatus;
|
820 |
-
o.errorThrown = errorThrown;
|
821 |
-
that._trigger('chunkfail', null, o);
|
822 |
-
that._trigger('chunkalways', null, o);
|
823 |
-
dfd.rejectWith(
|
824 |
-
o.context,
|
825 |
-
[jqXHR, textStatus, errorThrown]
|
826 |
-
);
|
827 |
-
})
|
828 |
-
.always(function () {
|
829 |
-
that._deinitProgressListener(o);
|
830 |
-
});
|
831 |
-
};
|
832 |
-
this._enhancePromise(promise);
|
833 |
-
promise.abort = function () {
|
834 |
-
return jqXHR.abort();
|
835 |
-
};
|
836 |
-
upload();
|
837 |
-
return promise;
|
838 |
-
},
|
839 |
-
|
840 |
-
_beforeSend: function (e, data) {
|
841 |
-
if (this._active === 0) {
|
842 |
-
// the start callback is triggered when an upload starts
|
843 |
-
// and no other uploads are currently running,
|
844 |
-
// equivalent to the global ajaxStart event:
|
845 |
-
this._trigger('start');
|
846 |
-
// Set timer for global bitrate progress calculation:
|
847 |
-
this._bitrateTimer = new this._BitrateTimer();
|
848 |
-
// Reset the global progress values:
|
849 |
-
this._progress.loaded = this._progress.total = 0;
|
850 |
-
this._progress.bitrate = 0;
|
851 |
-
}
|
852 |
-
// Make sure the container objects for the .response() and
|
853 |
-
// .progress() methods on the data object are available
|
854 |
-
// and reset to their initial state:
|
855 |
-
this._initResponseObject(data);
|
856 |
-
this._initProgressObject(data);
|
857 |
-
data._progress.loaded = data.loaded = data.uploadedBytes || 0;
|
858 |
-
data._progress.total = data.total = this._getTotal(data.files) || 1;
|
859 |
-
data._progress.bitrate = data.bitrate = 0;
|
860 |
-
this._active += 1;
|
861 |
-
// Initialize the global progress values:
|
862 |
-
this._progress.loaded += data.loaded;
|
863 |
-
this._progress.total += data.total;
|
864 |
-
},
|
865 |
-
|
866 |
-
_onDone: function (result, textStatus, jqXHR, options) {
|
867 |
-
var total = options._progress.total,
|
868 |
-
response = options._response;
|
869 |
-
if (options._progress.loaded < total) {
|
870 |
-
// Create a progress event if no final progress event
|
871 |
-
// with loaded equaling total has been triggered:
|
872 |
-
this._onProgress($.Event('progress', {
|
873 |
-
lengthComputable: true,
|
874 |
-
loaded: total,
|
875 |
-
total: total
|
876 |
-
}), options);
|
877 |
-
}
|
878 |
-
response.result = options.result = result;
|
879 |
-
response.textStatus = options.textStatus = textStatus;
|
880 |
-
response.jqXHR = options.jqXHR = jqXHR;
|
881 |
-
this._trigger('done', null, options);
|
882 |
-
},
|
883 |
-
|
884 |
-
_onFail: function (jqXHR, textStatus, errorThrown, options) {
|
885 |
-
var response = options._response;
|
886 |
-
if (options.recalculateProgress) {
|
887 |
-
// Remove the failed (error or abort) file upload from
|
888 |
-
// the global progress calculation:
|
889 |
-
this._progress.loaded -= options._progress.loaded;
|
890 |
-
this._progress.total -= options._progress.total;
|
891 |
-
}
|
892 |
-
response.jqXHR = options.jqXHR = jqXHR;
|
893 |
-
response.textStatus = options.textStatus = textStatus;
|
894 |
-
response.errorThrown = options.errorThrown = errorThrown;
|
895 |
-
this._trigger('fail', null, options);
|
896 |
-
},
|
897 |
-
|
898 |
-
_onAlways: function (jqXHRorResult, textStatus, jqXHRorError, options) {
|
899 |
-
// jqXHRorResult, textStatus and jqXHRorError are added to the
|
900 |
-
// options object via done and fail callbacks
|
901 |
-
this._trigger('always', null, options);
|
902 |
-
},
|
903 |
-
|
904 |
-
_onSend: function (e, data) {
|
905 |
-
if (!data.submit) {
|
906 |
-
this._addConvenienceMethods(e, data);
|
907 |
-
}
|
908 |
-
var that = this,
|
909 |
-
jqXHR,
|
910 |
-
aborted,
|
911 |
-
slot,
|
912 |
-
pipe,
|
913 |
-
options = that._getAJAXSettings(data),
|
914 |
-
send = function () {
|
915 |
-
that._sending += 1;
|
916 |
-
// Set timer for bitrate progress calculation:
|
917 |
-
options._bitrateTimer = new that._BitrateTimer();
|
918 |
-
jqXHR = jqXHR || (
|
919 |
-
((aborted || that._trigger(
|
920 |
-
'send',
|
921 |
-
$.Event('send', {delegatedEvent: e}),
|
922 |
-
options
|
923 |
-
) === false) &&
|
924 |
-
that._getXHRPromise(false, options.context, aborted)) ||
|
925 |
-
that._chunkedUpload(options) || $.ajax(options)
|
926 |
-
).done(function (result, textStatus, jqXHR) {
|
927 |
-
that._onDone(result, textStatus, jqXHR, options);
|
928 |
-
}).fail(function (jqXHR, textStatus, errorThrown) {
|
929 |
-
that._onFail(jqXHR, textStatus, errorThrown, options);
|
930 |
-
}).always(function (jqXHRorResult, textStatus, jqXHRorError) {
|
931 |
-
that._deinitProgressListener(options);
|
932 |
-
that._onAlways(
|
933 |
-
jqXHRorResult,
|
934 |
-
textStatus,
|
935 |
-
jqXHRorError,
|
936 |
-
options
|
937 |
-
);
|
938 |
-
that._sending -= 1;
|
939 |
-
that._active -= 1;
|
940 |
-
if (options.limitConcurrentUploads &&
|
941 |
-
options.limitConcurrentUploads > that._sending) {
|
942 |
-
// Start the next queued upload,
|
943 |
-
// that has not been aborted:
|
944 |
-
var nextSlot = that._slots.shift();
|
945 |
-
while (nextSlot) {
|
946 |
-
if (that._getDeferredState(nextSlot) === 'pending') {
|
947 |
-
nextSlot.resolve();
|
948 |
-
break;
|
949 |
-
}
|
950 |
-
nextSlot = that._slots.shift();
|
951 |
-
}
|
952 |
-
}
|
953 |
-
if (that._active === 0) {
|
954 |
-
// The stop callback is triggered when all uploads have
|
955 |
-
// been completed, equivalent to the global ajaxStop event:
|
956 |
-
that._trigger('stop');
|
957 |
-
}
|
958 |
-
});
|
959 |
-
return jqXHR;
|
960 |
-
};
|
961 |
-
this._beforeSend(e, options);
|
962 |
-
if (this.options.sequentialUploads ||
|
963 |
-
(this.options.limitConcurrentUploads &&
|
964 |
-
this.options.limitConcurrentUploads <= this._sending)) {
|
965 |
-
if (this.options.limitConcurrentUploads > 1) {
|
966 |
-
slot = $.Deferred();
|
967 |
-
this._slots.push(slot);
|
968 |
-
pipe = slot.then(send);
|
969 |
-
} else {
|
970 |
-
this._sequence = this._sequence.then(send, send);
|
971 |
-
pipe = this._sequence;
|
972 |
-
}
|
973 |
-
// Return the piped Promise object, enhanced with an abort method,
|
974 |
-
// which is delegated to the jqXHR object of the current upload,
|
975 |
-
// and jqXHR callbacks mapped to the equivalent Promise methods:
|
976 |
-
pipe.abort = function () {
|
977 |
-
aborted = [undefined, 'abort', 'abort'];
|
978 |
-
if (!jqXHR) {
|
979 |
-
if (slot) {
|
980 |
-
slot.rejectWith(options.context, aborted);
|
981 |
-
}
|
982 |
-
return send();
|
983 |
-
}
|
984 |
-
return jqXHR.abort();
|
985 |
-
};
|
986 |
-
return this._enhancePromise(pipe);
|
987 |
-
}
|
988 |
-
return send();
|
989 |
-
},
|
990 |
-
|
991 |
-
_onAdd: function (e, data) {
|
992 |
-
var that = this,
|
993 |
-
result = true,
|
994 |
-
options = $.extend({}, this.options, data),
|
995 |
-
files = data.files,
|
996 |
-
filesLength = files.length,
|
997 |
-
limit = options.limitMultiFileUploads,
|
998 |
-
limitSize = options.limitMultiFileUploadSize,
|
999 |
-
overhead = options.limitMultiFileUploadSizeOverhead,
|
1000 |
-
batchSize = 0,
|
1001 |
-
paramName = this._getParamName(options),
|
1002 |
-
paramNameSet,
|
1003 |
-
paramNameSlice,
|
1004 |
-
fileSet,
|
1005 |
-
i,
|
1006 |
-
j = 0;
|
1007 |
-
if (!filesLength) {
|
1008 |
-
return false;
|
1009 |
-
}
|
1010 |
-
if (limitSize && files[0].size === undefined) {
|
1011 |
-
limitSize = undefined;
|
1012 |
-
}
|
1013 |
-
if (!(options.singleFileUploads || limit || limitSize) ||
|
1014 |
-
!this._isXHRUpload(options)) {
|
1015 |
-
fileSet = [files];
|
1016 |
-
paramNameSet = [paramName];
|
1017 |
-
} else if (!(options.singleFileUploads || limitSize) && limit) {
|
1018 |
-
fileSet = [];
|
1019 |
-
paramNameSet = [];
|
1020 |
-
for (i = 0; i < filesLength; i += limit) {
|
1021 |
-
fileSet.push(files.slice(i, i + limit));
|
1022 |
-
paramNameSlice = paramName.slice(i, i + limit);
|
1023 |
-
if (!paramNameSlice.length) {
|
1024 |
-
paramNameSlice = paramName;
|
1025 |
-
}
|
1026 |
-
paramNameSet.push(paramNameSlice);
|
1027 |
-
}
|
1028 |
-
} else if (!options.singleFileUploads && limitSize) {
|
1029 |
-
fileSet = [];
|
1030 |
-
paramNameSet = [];
|
1031 |
-
for (i = 0; i < filesLength; i = i + 1) {
|
1032 |
-
batchSize += files[i].size + overhead;
|
1033 |
-
if (i + 1 === filesLength ||
|
1034 |
-
((batchSize + files[i + 1].size + overhead) > limitSize) ||
|
1035 |
-
(limit && i + 1 - j >= limit)) {
|
1036 |
-
fileSet.push(files.slice(j, i + 1));
|
1037 |
-
paramNameSlice = paramName.slice(j, i + 1);
|
1038 |
-
if (!paramNameSlice.length) {
|
1039 |
-
paramNameSlice = paramName;
|
1040 |
-
}
|
1041 |
-
paramNameSet.push(paramNameSlice);
|
1042 |
-
j = i + 1;
|
1043 |
-
batchSize = 0;
|
1044 |
-
}
|
1045 |
-
}
|
1046 |
-
} else {
|
1047 |
-
paramNameSet = paramName;
|
1048 |
-
}
|
1049 |
-
data.originalFiles = files;
|
1050 |
-
$.each(fileSet || files, function (index, element) {
|
1051 |
-
var newData = $.extend({}, data);
|
1052 |
-
newData.files = fileSet ? element : [element];
|
1053 |
-
newData.paramName = paramNameSet[index];
|
1054 |
-
that._initResponseObject(newData);
|
1055 |
-
that._initProgressObject(newData);
|
1056 |
-
that._addConvenienceMethods(e, newData);
|
1057 |
-
result = that._trigger(
|
1058 |
-
'add',
|
1059 |
-
$.Event('add', {delegatedEvent: e}),
|
1060 |
-
newData
|
1061 |
-
);
|
1062 |
-
return result;
|
1063 |
});
|
1064 |
-
|
1065 |
-
}
|
1066 |
-
|
1067 |
-
|
1068 |
-
|
1069 |
-
|
1070 |
-
|
1071 |
-
|
1072 |
-
data.fileInputClone = inputClone;
|
1073 |
-
$('<form></form>').append(inputClone)[0].reset();
|
1074 |
-
// Detaching allows to insert the fileInput on another form
|
1075 |
-
// without loosing the file input value:
|
1076 |
-
input.after(inputClone).detach();
|
1077 |
-
// If the fileInput had focus before it was detached,
|
1078 |
-
// restore focus to the inputClone.
|
1079 |
-
if (restoreFocus) {
|
1080 |
-
inputClone.focus();
|
1081 |
-
}
|
1082 |
-
// Avoid memory leaks with the detached file input:
|
1083 |
-
$.cleanData(input.unbind('remove'));
|
1084 |
-
// Replace the original file input element in the fileInput
|
1085 |
-
// elements set with the clone, which has been copied including
|
1086 |
-
// event handlers:
|
1087 |
-
this.options.fileInput = this.options.fileInput.map(function (i, el) {
|
1088 |
-
if (el === input[0]) {
|
1089 |
-
return inputClone[0];
|
1090 |
-
}
|
1091 |
-
return el;
|
1092 |
});
|
1093 |
-
|
1094 |
-
|
1095 |
-
|
1096 |
-
|
1097 |
-
|
1098 |
-
|
1099 |
-
|
1100 |
-
|
1101 |
-
|
1102 |
-
|
1103 |
-
|
1104 |
-
|
1105 |
-
|
1106 |
-
|
1107 |
-
|
1108 |
-
|
1109 |
-
|
1110 |
-
|
1111 |
-
|
1112 |
-
|
1113 |
-
|
1114 |
-
},
|
1115 |
-
successHandler = function (entries) {
|
1116 |
-
that._handleFileTreeEntries(
|
1117 |
-
entries,
|
1118 |
-
path + entry.name + '/'
|
1119 |
-
).done(function (files) {
|
1120 |
-
dfd.resolve(files);
|
1121 |
-
}).fail(errorHandler);
|
1122 |
-
},
|
1123 |
-
readEntries = function () {
|
1124 |
-
dirReader.readEntries(function (results) {
|
1125 |
-
if (!results.length) {
|
1126 |
-
successHandler(entries);
|
1127 |
-
} else {
|
1128 |
-
entries = entries.concat(results);
|
1129 |
-
readEntries();
|
1130 |
-
}
|
1131 |
-
}, errorHandler);
|
1132 |
-
};
|
1133 |
-
path = path || '';
|
1134 |
-
if (entry.isFile) {
|
1135 |
-
if (entry._file) {
|
1136 |
-
// Workaround for Chrome bug #149735
|
1137 |
-
entry._file.relativePath = path;
|
1138 |
-
dfd.resolve(entry._file);
|
1139 |
-
} else {
|
1140 |
-
entry.file(function (file) {
|
1141 |
-
file.relativePath = path;
|
1142 |
-
dfd.resolve(file);
|
1143 |
-
}, errorHandler);
|
1144 |
}
|
1145 |
-
|
1146 |
-
|
1147 |
-
|
1148 |
-
|
1149 |
-
|
1150 |
-
|
1151 |
-
dfd.resolve([]);
|
1152 |
-
}
|
1153 |
-
return dfd.promise();
|
1154 |
-
},
|
1155 |
-
|
1156 |
-
_handleFileTreeEntries: function (entries, path) {
|
1157 |
-
var that = this;
|
1158 |
-
return $.when.apply(
|
1159 |
-
$,
|
1160 |
-
$.map(entries, function (entry) {
|
1161 |
-
return that._handleFileTreeEntry(entry, path);
|
1162 |
-
})
|
1163 |
-
).then(function () {
|
1164 |
-
return Array.prototype.concat.apply(
|
1165 |
-
[],
|
1166 |
-
arguments
|
1167 |
);
|
|
|
1168 |
});
|
1169 |
-
|
1170 |
-
|
1171 |
-
|
1172 |
-
|
1173 |
-
|
1174 |
-
|
1175 |
-
|
1176 |
-
|
1177 |
-
|
1178 |
-
|
1179 |
-
|
1180 |
-
|
1181 |
-
|
1182 |
-
|
1183 |
-
|
1184 |
-
|
1185 |
-
|
1186 |
-
|
1187 |
-
|
1188 |
-
|
1189 |
-
|
1190 |
-
|
1191 |
-
|
1192 |
-
|
1193 |
-
|
1194 |
-
|
1195 |
-
|
1196 |
-
|
1197 |
-
|
1198 |
-
|
1199 |
-
|
1200 |
-
|
1201 |
-
|
1202 |
-
|
1203 |
-
|
1204 |
-
|
1205 |
-
|
1206 |
-
|
1207 |
-
|
1208 |
-
|
1209 |
-
|
1210 |
-
|
1211 |
-
|
1212 |
-
|
1213 |
-
|
1214 |
-
|
1215 |
-
|
1216 |
-
|
1217 |
-
|
1218 |
-
|
1219 |
-
|
1220 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1221 |
}
|
1222 |
-
|
1223 |
-
|
1224 |
-
|
1225 |
-
|
1226 |
-
|
1227 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
1228 |
}
|
1229 |
-
|
1230 |
-
|
1231 |
-
|
1232 |
-
|
1233 |
-
|
1234 |
-
|
1235 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1236 |
);
|
1237 |
-
|
1238 |
-
|
1239 |
-
|
1240 |
-
|
1241 |
-
|
1242 |
-
|
1243 |
-
|
1244 |
-
|
1245 |
-
|
1246 |
-
|
1247 |
-
|
1248 |
-
|
1249 |
-
|
1250 |
-
}
|
1251 |
-
if (that._trigger(
|
1252 |
-
'change',
|
1253 |
-
$.Event('change', {delegatedEvent: e}),
|
1254 |
-
data
|
1255 |
-
) !== false) {
|
1256 |
-
that._onAdd(e, data);
|
1257 |
-
}
|
1258 |
-
});
|
1259 |
-
},
|
1260 |
-
|
1261 |
-
_onPaste: function (e) {
|
1262 |
-
var items = e.originalEvent && e.originalEvent.clipboardData &&
|
1263 |
-
e.originalEvent.clipboardData.items,
|
1264 |
-
data = {files: []};
|
1265 |
-
if (items && items.length) {
|
1266 |
-
$.each(items, function (index, item) {
|
1267 |
-
var file = item.getAsFile && item.getAsFile();
|
1268 |
-
if (file) {
|
1269 |
-
data.files.push(file);
|
1270 |
}
|
1271 |
-
|
1272 |
-
|
1273 |
-
'paste',
|
1274 |
-
$.Event('paste', {delegatedEvent: e}),
|
1275 |
-
data
|
1276 |
-
) !== false) {
|
1277 |
-
this._onAdd(e, data);
|
1278 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1279 |
}
|
1280 |
-
|
1281 |
-
|
1282 |
-
|
1283 |
-
|
1284 |
-
|
1285 |
-
|
1286 |
-
|
1287 |
-
|
1288 |
-
|
1289 |
-
|
1290 |
-
|
1291 |
-
|
1292 |
-
|
1293 |
-
|
1294 |
-
|
1295 |
-
|
1296 |
-
|
1297 |
-
|
1298 |
-
|
1299 |
-
|
1300 |
-
|
1301 |
-
|
1302 |
-
|
1303 |
-
|
1304 |
-
|
1305 |
-
|
1306 |
-
|
1307 |
-
|
1308 |
-
|
1309 |
-
|
1310 |
-
|
1311 |
-
|
1312 |
-
|
1313 |
-
|
1314 |
-
|
1315 |
-
|
1316 |
-
|
1317 |
-
|
1318 |
-
|
1319 |
-
|
1320 |
-
|
1321 |
-
|
1322 |
-
|
1323 |
-
|
1324 |
-
|
1325 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1326 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1327 |
},
|
1328 |
-
|
1329 |
-
|
1330 |
-
|
1331 |
-
|
1332 |
-
|
1333 |
-
|
1334 |
-
|
1335 |
-
_destroy: function () {
|
1336 |
-
this._destroyEventHandlers();
|
1337 |
},
|
1338 |
-
|
1339 |
-
|
1340 |
-
|
1341 |
-
|
1342 |
-
|
|
|
|
|
1343 |
}
|
1344 |
-
|
1345 |
-
|
1346 |
-
|
1347 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1348 |
}
|
1349 |
-
|
1350 |
-
|
1351 |
-
|
1352 |
-
|
1353 |
-
|
1354 |
-
|
1355 |
-
|
1356 |
-
|
1357 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1358 |
}
|
1359 |
-
|
1360 |
-
|
|
|
|
|
|
|
|
|
1361 |
}
|
1362 |
-
if (!
|
1363 |
-
|
|
|
1364 |
}
|
1365 |
-
|
1366 |
-
|
1367 |
-
|
1368 |
-
|
1369 |
-
|
1370 |
-
|
1371 |
-
|
1372 |
-
|
1373 |
-
|
1374 |
-
_isRegExpOption: function (key, value) {
|
1375 |
-
return key !== 'url' && $.type(value) === 'string' &&
|
1376 |
-
/^\/.*\/[igm]{0,3}$/.test(value);
|
1377 |
-
},
|
1378 |
-
|
1379 |
-
_initDataAttributes: function () {
|
1380 |
-
var that = this,
|
1381 |
-
options = this.options,
|
1382 |
-
data = this.element.data();
|
1383 |
-
// Initialize options set via HTML5 data-attributes:
|
1384 |
-
$.each(
|
1385 |
-
this.element[0].attributes,
|
1386 |
-
function (index, attr) {
|
1387 |
-
var key = attr.name.toLowerCase(),
|
1388 |
-
value;
|
1389 |
-
if (/^data-/.test(key)) {
|
1390 |
-
// Convert hyphen-ated key to camelCase:
|
1391 |
-
key = key.slice(5).replace(/-[a-z]/g, function (str) {
|
1392 |
-
return str.charAt(1).toUpperCase();
|
1393 |
-
});
|
1394 |
-
value = data[key];
|
1395 |
-
if (that._isRegExpOption(key, value)) {
|
1396 |
-
value = that._getRegExp(value);
|
1397 |
-
}
|
1398 |
-
options[key] = value;
|
1399 |
-
}
|
1400 |
-
}
|
1401 |
);
|
1402 |
-
|
1403 |
-
|
1404 |
-
_create: function () {
|
1405 |
-
this._initDataAttributes();
|
1406 |
-
this._initSpecialOptions();
|
1407 |
-
this._slots = [];
|
1408 |
-
this._sequence = this._getXHRPromise(true);
|
1409 |
-
this._sending = this._active = 0;
|
1410 |
-
this._initProgressObject(this);
|
1411 |
-
this._initEventHandlers();
|
1412 |
-
},
|
1413 |
-
|
1414 |
-
// This method is exposed to the widget API and allows to query
|
1415 |
-
// the number of active uploads:
|
1416 |
-
active: function () {
|
1417 |
-
return this._active;
|
1418 |
-
},
|
1419 |
-
|
1420 |
-
// This method is exposed to the widget API and allows to query
|
1421 |
-
// the widget upload progress.
|
1422 |
-
// It returns an object with loaded, total and bitrate properties
|
1423 |
-
// for the running uploads:
|
1424 |
-
progress: function () {
|
1425 |
-
return this._progress;
|
1426 |
-
},
|
1427 |
-
|
1428 |
-
// This method is exposed to the widget API and allows adding files
|
1429 |
-
// using the fileupload API. The data parameter accepts an object which
|
1430 |
-
// must have a files property and can contain additional options:
|
1431 |
-
// .fileupload('add', {files: filesList});
|
1432 |
-
add: function (data) {
|
1433 |
-
var that = this;
|
1434 |
-
if (!data || this.options.disabled) {
|
1435 |
-
return;
|
1436 |
-
}
|
1437 |
-
if (data.fileInput && !data.files) {
|
1438 |
-
this._getFileInputFiles(data.fileInput).always(function (files) {
|
1439 |
-
data.files = files;
|
1440 |
-
that._onAdd(null, data);
|
1441 |
-
});
|
1442 |
-
} else {
|
1443 |
-
data.files = $.makeArray(data.files);
|
1444 |
-
this._onAdd(null, data);
|
1445 |
-
}
|
1446 |
-
},
|
1447 |
-
|
1448 |
-
// This method is exposed to the widget API and allows sending files
|
1449 |
-
// using the fileupload API. The data parameter accepts an object which
|
1450 |
-
// must have a files or fileInput property and can contain additional options:
|
1451 |
-
// .fileupload('send', {files: filesList});
|
1452 |
-
// The method returns a Promise object for the file upload call.
|
1453 |
-
send: function (data) {
|
1454 |
-
if (data && !this.options.disabled) {
|
1455 |
-
if (data.fileInput && !data.files) {
|
1456 |
-
var that = this,
|
1457 |
-
dfd = $.Deferred(),
|
1458 |
-
promise = dfd.promise(),
|
1459 |
-
jqXHR,
|
1460 |
-
aborted;
|
1461 |
-
promise.abort = function () {
|
1462 |
-
aborted = true;
|
1463 |
-
if (jqXHR) {
|
1464 |
-
return jqXHR.abort();
|
1465 |
-
}
|
1466 |
-
dfd.reject(null, 'abort', 'abort');
|
1467 |
-
return promise;
|
1468 |
-
};
|
1469 |
-
this._getFileInputFiles(data.fileInput).always(
|
1470 |
-
function (files) {
|
1471 |
-
if (aborted) {
|
1472 |
-
return;
|
1473 |
-
}
|
1474 |
-
if (!files.length) {
|
1475 |
-
dfd.reject();
|
1476 |
-
return;
|
1477 |
-
}
|
1478 |
-
data.files = files;
|
1479 |
-
jqXHR = that._onSend(null, data);
|
1480 |
-
jqXHR.then(
|
1481 |
-
function (result, textStatus, jqXHR) {
|
1482 |
-
dfd.resolve(result, textStatus, jqXHR);
|
1483 |
-
},
|
1484 |
-
function (jqXHR, textStatus, errorThrown) {
|
1485 |
-
dfd.reject(jqXHR, textStatus, errorThrown);
|
1486 |
-
}
|
1487 |
-
);
|
1488 |
-
}
|
1489 |
-
);
|
1490 |
-
return this._enhancePromise(promise);
|
1491 |
-
}
|
1492 |
-
data.files = $.makeArray(data.files);
|
1493 |
-
if (data.files.length) {
|
1494 |
-
return this._onSend(null, data);
|
1495 |
-
}
|
1496 |
-
}
|
1497 |
-
return this._getXHRPromise(false, data && data.context);
|
1498 |
}
|
1499 |
-
|
1500 |
-
|
1501 |
-
|
1502 |
-
}
|
|
|
|
|
|
|
|
|
|
9 |
* https://opensource.org/licenses/MIT
|
10 |
*/
|
11 |
|
12 |
+
/* global define, require */
|
13 |
+
/* eslint-disable new-cap */
|
14 |
+
|
15 |
+
(function(factory) {
|
16 |
+
'use strict';
|
17 |
+
if (typeof define === 'function' && define.amd) {
|
18 |
+
// Register as an anonymous AMD module:
|
19 |
+
define(['jquery', 'jquery-ui/ui/widget'], factory);
|
20 |
+
} else if (typeof exports === 'object') {
|
21 |
+
// Node/CommonJS:
|
22 |
+
factory(require('jquery'), require('./vendor/jquery.ui.widget'));
|
23 |
+
} else {
|
24 |
+
// Browser globals:
|
25 |
+
factory(window.jQuery);
|
26 |
+
}
|
27 |
+
})(function($) {
|
28 |
+
'use strict';
|
29 |
+
|
30 |
+
// Detect file input support, based on
|
31 |
+
// https://viljamis.com/2012/file-upload-support-on-mobile/
|
32 |
+
$.support.fileInput = !(
|
33 |
+
new RegExp(
|
34 |
+
// Handle devices which give false positives for the feature detection:
|
35 |
+
'(Android (1\\.[0156]|2\\.[01]))' +
|
36 |
+
'|(Windows Phone (OS 7|8\\.0))|(XBLWP)|(ZuneWP)|(WPDesktop)' +
|
37 |
+
'|(w(eb)?OSBrowser)|(webOS)' +
|
38 |
+
'|(Kindle/(1\\.0|2\\.[05]|3\\.0))'
|
|
|
|
|
|
|
|
|
|
|
39 |
).test(window.navigator.userAgent) ||
|
40 |
+
// Feature detection for all other devices:
|
41 |
+
$('<input type="file"/>').prop('disabled')
|
42 |
+
);
|
43 |
+
|
44 |
+
// The FileReader API is not actually used, but works as feature detection,
|
45 |
+
// as some Safari versions (5?) support XHR file uploads via the FormData API,
|
46 |
+
// but not non-multipart XHR file uploads.
|
47 |
+
// window.XMLHttpRequestUpload is not available on IE10, so we check for
|
48 |
+
// window.ProgressEvent instead to detect XHR2 file upload capability:
|
49 |
+
$.support.xhrFileUpload = !!(window.ProgressEvent && window.FileReader);
|
50 |
+
$.support.xhrFormDataFileUpload = !!window.FormData;
|
51 |
+
|
52 |
+
// Detect support for Blob slicing (required for chunked uploads):
|
53 |
+
$.support.blobSlice =
|
54 |
+
window.Blob &&
|
55 |
+
(Blob.prototype.slice ||
|
56 |
+
Blob.prototype.webkitSlice ||
|
57 |
+
Blob.prototype.mozSlice);
|
58 |
+
|
59 |
+
/**
|
60 |
+
* Helper function to create drag handlers for dragover/dragenter/dragleave
|
61 |
+
*
|
62 |
+
* @param {string} type Event type
|
63 |
+
* @returns {Function} Drag handler
|
64 |
+
*/
|
65 |
+
function getDragHandler(type) {
|
66 |
+
var isDragOver = type === 'dragover';
|
67 |
+
return function(e) {
|
68 |
+
e.dataTransfer = e.originalEvent && e.originalEvent.dataTransfer;
|
69 |
+
var dataTransfer = e.dataTransfer;
|
70 |
+
if (
|
71 |
+
dataTransfer &&
|
72 |
+
$.inArray('Files', dataTransfer.types) !== -1 &&
|
73 |
+
this._trigger(type, $.Event(type, { delegatedEvent: e })) !== false
|
74 |
+
) {
|
75 |
+
e.preventDefault();
|
76 |
+
if (isDragOver) {
|
77 |
+
dataTransfer.dropEffect = 'copy';
|
78 |
+
}
|
79 |
+
}
|
80 |
+
};
|
81 |
+
}
|
82 |
+
|
83 |
+
// The fileupload widget listens for change events on file input fields defined
|
84 |
+
// via fileInput setting and paste or drop events of the given dropZone.
|
85 |
+
// In addition to the default jQuery Widget methods, the fileupload widget
|
86 |
+
// exposes the "add" and "send" methods, to add or directly send files using
|
87 |
+
// the fileupload API.
|
88 |
+
// By default, files added via file input selection, paste, drag & drop or
|
89 |
+
// "add" method are uploaded immediately, but it is possible to override
|
90 |
+
// the "add" callback option to queue file uploads.
|
91 |
+
$.widget('blueimp.fileupload', {
|
92 |
+
options: {
|
93 |
+
// The drop target element(s), by the default the complete document.
|
94 |
+
// Set to null to disable drag & drop support:
|
95 |
+
dropZone: $(document),
|
96 |
+
// The paste target element(s), by the default undefined.
|
97 |
+
// Set to a DOM node or jQuery object to enable file pasting:
|
98 |
+
pasteZone: undefined,
|
99 |
+
// The file input field(s), that are listened to for change events.
|
100 |
+
// If undefined, it is set to the file input fields inside
|
101 |
+
// of the widget element on plugin initialization.
|
102 |
+
// Set to null to disable the change listener.
|
103 |
+
fileInput: undefined,
|
104 |
+
// By default, the file input field is replaced with a clone after
|
105 |
+
// each input field change event. This is required for iframe transport
|
106 |
+
// queues and allows change events to be fired for the same file
|
107 |
+
// selection, but can be disabled by setting the following option to false:
|
108 |
+
replaceFileInput: true,
|
109 |
+
// The parameter name for the file form data (the request argument name).
|
110 |
+
// If undefined or empty, the name property of the file input field is
|
111 |
+
// used, or "files[]" if the file input name property is also empty,
|
112 |
+
// can be a string or an array of strings:
|
113 |
+
paramName: undefined,
|
114 |
+
// By default, each file of a selection is uploaded using an individual
|
115 |
+
// request for XHR type uploads. Set to false to upload file
|
116 |
+
// selections in one request each:
|
117 |
+
singleFileUploads: true,
|
118 |
+
// To limit the number of files uploaded with one XHR request,
|
119 |
+
// set the following option to an integer greater than 0:
|
120 |
+
limitMultiFileUploads: undefined,
|
121 |
+
// The following option limits the number of files uploaded with one
|
122 |
+
// XHR request to keep the request size under or equal to the defined
|
123 |
+
// limit in bytes:
|
124 |
+
limitMultiFileUploadSize: undefined,
|
125 |
+
// Multipart file uploads add a number of bytes to each uploaded file,
|
126 |
+
// therefore the following option adds an overhead for each file used
|
127 |
+
// in the limitMultiFileUploadSize configuration:
|
128 |
+
limitMultiFileUploadSizeOverhead: 512,
|
129 |
+
// Set the following option to true to issue all file upload requests
|
130 |
+
// in a sequential order:
|
131 |
+
sequentialUploads: false,
|
132 |
+
// To limit the number of concurrent uploads,
|
133 |
+
// set the following option to an integer greater than 0:
|
134 |
+
limitConcurrentUploads: undefined,
|
135 |
+
// Set the following option to true to force iframe transport uploads:
|
136 |
+
forceIframeTransport: false,
|
137 |
+
// Set the following option to the location of a redirect url on the
|
138 |
+
// origin server, for cross-domain iframe transport uploads:
|
139 |
+
redirect: undefined,
|
140 |
+
// The parameter name for the redirect url, sent as part of the form
|
141 |
+
// data and set to 'redirect' if this option is empty:
|
142 |
+
redirectParamName: undefined,
|
143 |
+
// Set the following option to the location of a postMessage window,
|
144 |
+
// to enable postMessage transport uploads:
|
145 |
+
postMessage: undefined,
|
146 |
+
// By default, XHR file uploads are sent as multipart/form-data.
|
147 |
+
// The iframe transport is always using multipart/form-data.
|
148 |
+
// Set to false to enable non-multipart XHR uploads:
|
149 |
+
multipart: true,
|
150 |
+
// To upload large files in smaller chunks, set the following option
|
151 |
+
// to a preferred maximum chunk size. If set to 0, null or undefined,
|
152 |
+
// or the browser does not support the required Blob API, files will
|
153 |
+
// be uploaded as a whole.
|
154 |
+
maxChunkSize: undefined,
|
155 |
+
// When a non-multipart upload or a chunked multipart upload has been
|
156 |
+
// aborted, this option can be used to resume the upload by setting
|
157 |
+
// it to the size of the already uploaded bytes. This option is most
|
158 |
+
// useful when modifying the options object inside of the "add" or
|
159 |
+
// "send" callbacks, as the options are cloned for each file upload.
|
160 |
+
uploadedBytes: undefined,
|
161 |
+
// By default, failed (abort or error) file uploads are removed from the
|
162 |
+
// global progress calculation. Set the following option to false to
|
163 |
+
// prevent recalculating the global progress data:
|
164 |
+
recalculateProgress: true,
|
165 |
+
// Interval in milliseconds to calculate and trigger progress events:
|
166 |
+
progressInterval: 100,
|
167 |
+
// Interval in milliseconds to calculate progress bitrate:
|
168 |
+
bitrateInterval: 500,
|
169 |
+
// By default, uploads are started automatically when adding files:
|
170 |
+
autoUpload: true,
|
171 |
+
// By default, duplicate file names are expected to be handled on
|
172 |
+
// the server-side. If this is not possible (e.g. when uploading
|
173 |
+
// files directly to Amazon S3), the following option can be set to
|
174 |
+
// an empty object or an object mapping existing filenames, e.g.:
|
175 |
+
// { "image.jpg": true, "image (1).jpg": true }
|
176 |
+
// If it is set, all files will be uploaded with unique filenames,
|
177 |
+
// adding increasing number suffixes if necessary, e.g.:
|
178 |
+
// "image (2).jpg"
|
179 |
+
uniqueFilenames: undefined,
|
180 |
+
|
181 |
+
// Error and info messages:
|
182 |
+
messages: {
|
183 |
+
uploadedBytes: 'Uploaded bytes exceed file size'
|
184 |
+
},
|
185 |
+
|
186 |
+
// Translation function, gets the message key to be translated
|
187 |
+
// and an object with context specific data as arguments:
|
188 |
+
i18n: function(message, context) {
|
189 |
+
// eslint-disable-next-line no-param-reassign
|
190 |
+
message = this.messages[message] || message.toString();
|
191 |
+
if (context) {
|
192 |
+
$.each(context, function(key, value) {
|
193 |
+
// eslint-disable-next-line no-param-reassign
|
194 |
+
message = message.replace('{' + key + '}', value);
|
195 |
+
});
|
196 |
+
}
|
197 |
+
return message;
|
198 |
+
},
|
199 |
+
|
200 |
+
// Additional form data to be sent along with the file uploads can be set
|
201 |
+
// using this option, which accepts an array of objects with name and
|
202 |
+
// value properties, a function returning such an array, a FormData
|
203 |
+
// object (for XHR file uploads), or a simple object.
|
204 |
+
// The form of the first fileInput is given as parameter to the function:
|
205 |
+
formData: function(form) {
|
206 |
+
return form.serializeArray();
|
207 |
+
},
|
208 |
+
|
209 |
+
// The add callback is invoked as soon as files are added to the fileupload
|
210 |
+
// widget (via file input selection, drag & drop, paste or add API call).
|
211 |
+
// If the singleFileUploads option is enabled, this callback will be
|
212 |
+
// called once for each file in the selection for XHR file uploads, else
|
213 |
+
// once for each file selection.
|
214 |
+
//
|
215 |
+
// The upload starts when the submit method is invoked on the data parameter.
|
216 |
+
// The data object contains a files property holding the added files
|
217 |
+
// and allows you to override plugin options as well as define ajax settings.
|
218 |
+
//
|
219 |
+
// Listeners for this callback can also be bound the following way:
|
220 |
+
// .bind('fileuploadadd', func);
|
221 |
+
//
|
222 |
+
// data.submit() returns a Promise object and allows to attach additional
|
223 |
+
// handlers using jQuery's Deferred callbacks:
|
224 |
+
// data.submit().done(func).fail(func).always(func);
|
225 |
+
add: function(e, data) {
|
226 |
+
if (e.isDefaultPrevented()) {
|
227 |
+
return false;
|
228 |
+
}
|
229 |
+
if (
|
230 |
+
data.autoUpload ||
|
231 |
+
(data.autoUpload !== false &&
|
232 |
+
$(this).fileupload('option', 'autoUpload'))
|
233 |
+
) {
|
234 |
+
data.process().done(function() {
|
235 |
+
data.submit();
|
236 |
+
});
|
237 |
+
}
|
238 |
+
},
|
239 |
|
240 |
+
// Other callbacks:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
241 |
|
242 |
+
// Callback for the submit event of each file upload:
|
243 |
+
// submit: function (e, data) {}, // .bind('fileuploadsubmit', func);
|
244 |
|
245 |
+
// Callback for the start of each file upload request:
|
246 |
+
// send: function (e, data) {}, // .bind('fileuploadsend', func);
|
247 |
|
248 |
+
// Callback for successful uploads:
|
249 |
+
// done: function (e, data) {}, // .bind('fileuploaddone', func);
|
250 |
|
251 |
+
// Callback for failed (abort or error) uploads:
|
252 |
+
// fail: function (e, data) {}, // .bind('fileuploadfail', func);
|
253 |
|
254 |
+
// Callback for completed (success, abort or error) requests:
|
255 |
+
// always: function (e, data) {}, // .bind('fileuploadalways', func);
|
256 |
|
257 |
+
// Callback for upload progress events:
|
258 |
+
// progress: function (e, data) {}, // .bind('fileuploadprogress', func);
|
259 |
|
260 |
+
// Callback for global upload progress events:
|
261 |
+
// progressall: function (e, data) {}, // .bind('fileuploadprogressall', func);
|
262 |
|
263 |
+
// Callback for uploads start, equivalent to the global ajaxStart event:
|
264 |
+
// start: function (e) {}, // .bind('fileuploadstart', func);
|
265 |
|
266 |
+
// Callback for uploads stop, equivalent to the global ajaxStop event:
|
267 |
+
// stop: function (e) {}, // .bind('fileuploadstop', func);
|
268 |
|
269 |
+
// Callback for change events of the fileInput(s):
|
270 |
+
// change: function (e, data) {}, // .bind('fileuploadchange', func);
|
271 |
|
272 |
+
// Callback for paste events to the pasteZone(s):
|
273 |
+
// paste: function (e, data) {}, // .bind('fileuploadpaste', func);
|
274 |
|
275 |
+
// Callback for drop events of the dropZone(s):
|
276 |
+
// drop: function (e, data) {}, // .bind('fileuploaddrop', func);
|
277 |
|
278 |
+
// Callback for dragover events of the dropZone(s):
|
279 |
+
// dragover: function (e) {}, // .bind('fileuploaddragover', func);
|
280 |
|
281 |
+
// Callback before the start of each chunk upload request (before form data initialization):
|
282 |
+
// chunkbeforesend: function (e, data) {}, // .bind('fileuploadchunkbeforesend', func);
|
283 |
|
284 |
+
// Callback for the start of each chunk upload request:
|
285 |
+
// chunksend: function (e, data) {}, // .bind('fileuploadchunksend', func);
|
286 |
|
287 |
+
// Callback for successful chunk uploads:
|
288 |
+
// chunkdone: function (e, data) {}, // .bind('fileuploadchunkdone', func);
|
289 |
|
290 |
+
// Callback for failed (abort or error) chunk uploads:
|
291 |
+
// chunkfail: function (e, data) {}, // .bind('fileuploadchunkfail', func);
|
292 |
|
293 |
+
// Callback for completed (success, abort or error) chunk upload requests:
|
294 |
+
// chunkalways: function (e, data) {}, // .bind('fileuploadchunkalways', func);
|
295 |
|
296 |
+
// The plugin options are used as settings object for the ajax calls.
|
297 |
+
// The following are jQuery ajax settings required for the file uploads:
|
298 |
+
processData: false,
|
299 |
+
contentType: false,
|
300 |
+
cache: false,
|
301 |
+
timeout: 0
|
302 |
+
},
|
303 |
|
304 |
+
// A list of options that require reinitializing event listeners and/or
|
305 |
+
// special initialization code:
|
306 |
+
_specialOptions: [
|
307 |
+
'fileInput',
|
308 |
+
'dropZone',
|
309 |
+
'pasteZone',
|
310 |
+
'multipart',
|
311 |
+
'forceIframeTransport'
|
312 |
+
],
|
313 |
|
314 |
+
_blobSlice:
|
315 |
+
$.support.blobSlice &&
|
316 |
+
function() {
|
317 |
+
var slice = this.slice || this.webkitSlice || this.mozSlice;
|
318 |
+
return slice.apply(this, arguments);
|
319 |
+
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
320 |
|
321 |
+
_BitrateTimer: function() {
|
322 |
+
this.timestamp = Date.now ? Date.now() : new Date().getTime();
|
323 |
+
this.loaded = 0;
|
324 |
+
this.bitrate = 0;
|
325 |
+
this.getBitrate = function(now, loaded, interval) {
|
326 |
+
var timeDiff = now - this.timestamp;
|
327 |
+
if (!this.bitrate || !interval || timeDiff > interval) {
|
328 |
+
this.bitrate = (loaded - this.loaded) * (1000 / timeDiff) * 8;
|
329 |
+
this.loaded = loaded;
|
330 |
+
this.timestamp = now;
|
331 |
+
}
|
332 |
+
return this.bitrate;
|
333 |
+
};
|
334 |
+
},
|
335 |
+
|
336 |
+
_isXHRUpload: function(options) {
|
337 |
+
return (
|
338 |
+
!options.forceIframeTransport &&
|
339 |
+
((!options.multipart && $.support.xhrFileUpload) ||
|
340 |
+
$.support.xhrFormDataFileUpload)
|
341 |
+
);
|
342 |
+
},
|
343 |
+
|
344 |
+
_getFormData: function(options) {
|
345 |
+
var formData;
|
346 |
+
if ($.type(options.formData) === 'function') {
|
347 |
+
return options.formData(options.form);
|
348 |
+
}
|
349 |
+
if ($.isArray(options.formData)) {
|
350 |
+
return options.formData;
|
351 |
+
}
|
352 |
+
if ($.type(options.formData) === 'object') {
|
353 |
+
formData = [];
|
354 |
+
$.each(options.formData, function(name, value) {
|
355 |
+
formData.push({ name: name, value: value });
|
356 |
+
});
|
357 |
+
return formData;
|
358 |
+
}
|
359 |
+
return [];
|
360 |
+
},
|
361 |
+
|
362 |
+
_getTotal: function(files) {
|
363 |
+
var total = 0;
|
364 |
+
$.each(files, function(index, file) {
|
365 |
+
total += file.size || 1;
|
366 |
+
});
|
367 |
+
return total;
|
368 |
+
},
|
369 |
+
|
370 |
+
_initProgressObject: function(obj) {
|
371 |
+
var progress = {
|
372 |
+
loaded: 0,
|
373 |
+
total: 0,
|
374 |
+
bitrate: 0
|
375 |
+
};
|
376 |
+
if (obj._progress) {
|
377 |
+
$.extend(obj._progress, progress);
|
378 |
+
} else {
|
379 |
+
obj._progress = progress;
|
380 |
+
}
|
381 |
+
},
|
382 |
+
|
383 |
+
_initResponseObject: function(obj) {
|
384 |
+
var prop;
|
385 |
+
if (obj._response) {
|
386 |
+
for (prop in obj._response) {
|
387 |
+
if (Object.prototype.hasOwnProperty.call(obj._response, prop)) {
|
388 |
+
delete obj._response[prop];
|
389 |
+
}
|
390 |
+
}
|
391 |
+
} else {
|
392 |
+
obj._response = {};
|
393 |
+
}
|
394 |
+
},
|
395 |
+
|
396 |
+
_onProgress: function(e, data) {
|
397 |
+
if (e.lengthComputable) {
|
398 |
+
var now = Date.now ? Date.now() : new Date().getTime(),
|
399 |
+
loaded;
|
400 |
+
if (
|
401 |
+
data._time &&
|
402 |
+
data.progressInterval &&
|
403 |
+
now - data._time < data.progressInterval &&
|
404 |
+
e.loaded !== e.total
|
405 |
+
) {
|
406 |
+
return;
|
407 |
+
}
|
408 |
+
data._time = now;
|
409 |
+
loaded =
|
410 |
+
Math.floor(
|
411 |
+
(e.loaded / e.total) * (data.chunkSize || data._progress.total)
|
412 |
+
) + (data.uploadedBytes || 0);
|
413 |
+
// Add the difference from the previously loaded state
|
414 |
+
// to the global loaded counter:
|
415 |
+
this._progress.loaded += loaded - data._progress.loaded;
|
416 |
+
this._progress.bitrate = this._bitrateTimer.getBitrate(
|
417 |
+
now,
|
418 |
+
this._progress.loaded,
|
419 |
+
data.bitrateInterval
|
420 |
+
);
|
421 |
+
data._progress.loaded = data.loaded = loaded;
|
422 |
+
data._progress.bitrate = data.bitrate = data._bitrateTimer.getBitrate(
|
423 |
+
now,
|
424 |
+
loaded,
|
425 |
+
data.bitrateInterval
|
426 |
+
);
|
427 |
+
// Trigger a custom progress event with a total data property set
|
428 |
+
// to the file size(s) of the current upload and a loaded data
|
429 |
+
// property calculated accordingly:
|
430 |
+
this._trigger(
|
431 |
+
'progress',
|
432 |
+
$.Event('progress', { delegatedEvent: e }),
|
433 |
+
data
|
434 |
+
);
|
435 |
+
// Trigger a global progress event for all current file uploads,
|
436 |
+
// including ajax calls queued for sequential file uploads:
|
437 |
+
this._trigger(
|
438 |
+
'progressall',
|
439 |
+
$.Event('progressall', { delegatedEvent: e }),
|
440 |
+
this._progress
|
441 |
+
);
|
442 |
+
}
|
443 |
+
},
|
444 |
+
|
445 |
+
_initProgressListener: function(options) {
|
446 |
+
var that = this,
|
447 |
+
xhr = options.xhr ? options.xhr() : $.ajaxSettings.xhr();
|
448 |
+
// Accesss to the native XHR object is required to add event listeners
|
449 |
+
// for the upload progress event:
|
450 |
+
if (xhr.upload) {
|
451 |
+
$(xhr.upload).bind('progress', function(e) {
|
452 |
+
var oe = e.originalEvent;
|
453 |
+
// Make sure the progress event properties get copied over:
|
454 |
+
e.lengthComputable = oe.lengthComputable;
|
455 |
+
e.loaded = oe.loaded;
|
456 |
+
e.total = oe.total;
|
457 |
+
that._onProgress(e, options);
|
458 |
+
});
|
459 |
+
options.xhr = function() {
|
460 |
+
return xhr;
|
461 |
+
};
|
462 |
+
}
|
463 |
+
},
|
464 |
+
|
465 |
+
_deinitProgressListener: function(options) {
|
466 |
+
var xhr = options.xhr ? options.xhr() : $.ajaxSettings.xhr();
|
467 |
+
if (xhr.upload) {
|
468 |
+
$(xhr.upload).unbind('progress');
|
469 |
+
}
|
470 |
+
},
|
471 |
+
|
472 |
+
_isInstanceOf: function(type, obj) {
|
473 |
+
// Cross-frame instanceof check
|
474 |
+
return Object.prototype.toString.call(obj) === '[object ' + type + ']';
|
475 |
+
},
|
476 |
+
|
477 |
+
_getUniqueFilename: function(name, map) {
|
478 |
+
// eslint-disable-next-line no-param-reassign
|
479 |
+
name = String(name);
|
480 |
+
if (map[name]) {
|
481 |
+
// eslint-disable-next-line no-param-reassign
|
482 |
+
name = name.replace(/(?: \(([\d]+)\))?(\.[^.]+)?$/, function(
|
483 |
+
_,
|
484 |
+
p1,
|
485 |
+
p2
|
486 |
+
) {
|
487 |
+
var index = p1 ? Number(p1) + 1 : 1;
|
488 |
+
var ext = p2 || '';
|
489 |
+
return ' (' + index + ')' + ext;
|
490 |
+
});
|
491 |
+
return this._getUniqueFilename(name, map);
|
492 |
+
}
|
493 |
+
map[name] = true;
|
494 |
+
return name;
|
495 |
+
},
|
496 |
+
|
497 |
+
_initXHRData: function(options) {
|
498 |
+
var that = this,
|
499 |
+
formData,
|
500 |
+
file = options.files[0],
|
501 |
+
// Ignore non-multipart setting if not supported:
|
502 |
+
multipart = options.multipart || !$.support.xhrFileUpload,
|
503 |
+
paramName =
|
504 |
+
$.type(options.paramName) === 'array'
|
505 |
+
? options.paramName[0]
|
506 |
+
: options.paramName;
|
507 |
+
options.headers = $.extend({}, options.headers);
|
508 |
+
if (options.contentRange) {
|
509 |
+
options.headers['Content-Range'] = options.contentRange;
|
510 |
+
}
|
511 |
+
if (!multipart || options.blob || !this._isInstanceOf('File', file)) {
|
512 |
+
options.headers['Content-Disposition'] =
|
513 |
+
'attachment; filename="' +
|
514 |
+
encodeURI(file.uploadName || file.name) +
|
515 |
+
'"';
|
516 |
+
}
|
517 |
+
if (!multipart) {
|
518 |
+
options.contentType = file.type || 'application/octet-stream';
|
519 |
+
options.data = options.blob || file;
|
520 |
+
} else if ($.support.xhrFormDataFileUpload) {
|
521 |
+
if (options.postMessage) {
|
522 |
+
// window.postMessage does not allow sending FormData
|
523 |
+
// objects, so we just add the File/Blob objects to
|
524 |
+
// the formData array and let the postMessage window
|
525 |
+
// create the FormData object out of this array:
|
526 |
+
formData = this._getFormData(options);
|
527 |
+
if (options.blob) {
|
528 |
+
formData.push({
|
529 |
+
name: paramName,
|
530 |
+
value: options.blob
|
531 |
});
|
532 |
+
} else {
|
533 |
+
$.each(options.files, function(index, file) {
|
534 |
+
formData.push({
|
535 |
+
name:
|
536 |
+
($.type(options.paramName) === 'array' &&
|
537 |
+
options.paramName[index]) ||
|
538 |
+
paramName,
|
539 |
+
value: file
|
540 |
+
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
541 |
});
|
542 |
+
}
|
543 |
+
} else {
|
544 |
+
if (that._isInstanceOf('FormData', options.formData)) {
|
545 |
+
formData = options.formData;
|
546 |
+
} else {
|
547 |
+
formData = new FormData();
|
548 |
+
$.each(this._getFormData(options), function(index, field) {
|
549 |
+
formData.append(field.name, field.value);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
550 |
});
|
551 |
+
}
|
552 |
+
if (options.blob) {
|
553 |
+
formData.append(
|
554 |
+
paramName,
|
555 |
+
options.blob,
|
556 |
+
file.uploadName || file.name
|
557 |
+
);
|
558 |
+
} else {
|
559 |
+
$.each(options.files, function(index, file) {
|
560 |
+
// This check allows the tests to run with
|
561 |
+
// dummy objects:
|
562 |
+
if (
|
563 |
+
that._isInstanceOf('File', file) ||
|
564 |
+
that._isInstanceOf('Blob', file)
|
565 |
+
) {
|
566 |
+
var fileName = file.uploadName || file.name;
|
567 |
+
if (options.uniqueFilenames) {
|
568 |
+
fileName = that._getUniqueFilename(
|
569 |
+
fileName,
|
570 |
+
options.uniqueFilenames
|
571 |
+
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
572 |
}
|
573 |
+
formData.append(
|
574 |
+
($.type(options.paramName) === 'array' &&
|
575 |
+
options.paramName[index]) ||
|
576 |
+
paramName,
|
577 |
+
file,
|
578 |
+
fileName
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
579 |
);
|
580 |
+
}
|
581 |
});
|
582 |
+
}
|
583 |
+
}
|
584 |
+
options.data = formData;
|
585 |
+
}
|
586 |
+
// Blob reference is not needed anymore, free memory:
|
587 |
+
options.blob = null;
|
588 |
+
},
|
589 |
+
|
590 |
+
_initIframeSettings: function(options) {
|
591 |
+
var targetHost = $('<a></a>')
|
592 |
+
.prop('href', options.url)
|
593 |
+
.prop('host');
|
594 |
+
// Setting the dataType to iframe enables the iframe transport:
|
595 |
+
options.dataType = 'iframe ' + (options.dataType || '');
|
596 |
+
// The iframe transport accepts a serialized array as form data:
|
597 |
+
options.formData = this._getFormData(options);
|
598 |
+
// Add redirect url to form data on cross-domain uploads:
|
599 |
+
if (options.redirect && targetHost && targetHost !== location.host) {
|
600 |
+
options.formData.push({
|
601 |
+
name: options.redirectParamName || 'redirect',
|
602 |
+
value: options.redirect
|
603 |
+
});
|
604 |
+
}
|
605 |
+
},
|
606 |
+
|
607 |
+
_initDataSettings: function(options) {
|
608 |
+
if (this._isXHRUpload(options)) {
|
609 |
+
if (!this._chunkedUpload(options, true)) {
|
610 |
+
if (!options.data) {
|
611 |
+
this._initXHRData(options);
|
612 |
+
}
|
613 |
+
this._initProgressListener(options);
|
614 |
+
}
|
615 |
+
if (options.postMessage) {
|
616 |
+
// Setting the dataType to postmessage enables the
|
617 |
+
// postMessage transport:
|
618 |
+
options.dataType = 'postmessage ' + (options.dataType || '');
|
619 |
+
}
|
620 |
+
} else {
|
621 |
+
this._initIframeSettings(options);
|
622 |
+
}
|
623 |
+
},
|
624 |
+
|
625 |
+
_getParamName: function(options) {
|
626 |
+
var fileInput = $(options.fileInput),
|
627 |
+
paramName = options.paramName;
|
628 |
+
if (!paramName) {
|
629 |
+
paramName = [];
|
630 |
+
fileInput.each(function() {
|
631 |
+
var input = $(this),
|
632 |
+
name = input.prop('name') || 'files[]',
|
633 |
+
i = (input.prop('files') || [1]).length;
|
634 |
+
while (i) {
|
635 |
+
paramName.push(name);
|
636 |
+
i -= 1;
|
637 |
+
}
|
638 |
+
});
|
639 |
+
if (!paramName.length) {
|
640 |
+
paramName = [fileInput.prop('name') || 'files[]'];
|
641 |
+
}
|
642 |
+
} else if (!$.isArray(paramName)) {
|
643 |
+
paramName = [paramName];
|
644 |
+
}
|
645 |
+
return paramName;
|
646 |
+
},
|
647 |
+
|
648 |
+
_initFormSettings: function(options) {
|
649 |
+
// Retrieve missing options from the input field and the
|
650 |
+
// associated form, if available:
|
651 |
+
if (!options.form || !options.form.length) {
|
652 |
+
options.form = $(options.fileInput.prop('form'));
|
653 |
+
// If the given file input doesn't have an associated form,
|
654 |
+
// use the default widget file input's form:
|
655 |
+
if (!options.form.length) {
|
656 |
+
options.form = $(this.options.fileInput.prop('form'));
|
657 |
+
}
|
658 |
+
}
|
659 |
+
options.paramName = this._getParamName(options);
|
660 |
+
if (!options.url) {
|
661 |
+
options.url = options.form.prop('action') || location.href;
|
662 |
+
}
|
663 |
+
// The HTTP request method must be "POST" or "PUT":
|
664 |
+
options.type = (
|
665 |
+
options.type ||
|
666 |
+
($.type(options.form.prop('method')) === 'string' &&
|
667 |
+
options.form.prop('method')) ||
|
668 |
+
''
|
669 |
+
).toUpperCase();
|
670 |
+
if (
|
671 |
+
options.type !== 'POST' &&
|
672 |
+
options.type !== 'PUT' &&
|
673 |
+
options.type !== 'PATCH'
|
674 |
+
) {
|
675 |
+
options.type = 'POST';
|
676 |
+
}
|
677 |
+
if (!options.formAcceptCharset) {
|
678 |
+
options.formAcceptCharset = options.form.attr('accept-charset');
|
679 |
+
}
|
680 |
+
},
|
681 |
+
|
682 |
+
_getAJAXSettings: function(data) {
|
683 |
+
var options = $.extend({}, this.options, data);
|
684 |
+
this._initFormSettings(options);
|
685 |
+
this._initDataSettings(options);
|
686 |
+
return options;
|
687 |
+
},
|
688 |
+
|
689 |
+
// jQuery 1.6 doesn't provide .state(),
|
690 |
+
// while jQuery 1.8+ removed .isRejected() and .isResolved():
|
691 |
+
_getDeferredState: function(deferred) {
|
692 |
+
if (deferred.state) {
|
693 |
+
return deferred.state();
|
694 |
+
}
|
695 |
+
if (deferred.isResolved()) {
|
696 |
+
return 'resolved';
|
697 |
+
}
|
698 |
+
if (deferred.isRejected()) {
|
699 |
+
return 'rejected';
|
700 |
+
}
|
701 |
+
return 'pending';
|
702 |
+
},
|
703 |
+
|
704 |
+
// Maps jqXHR callbacks to the equivalent
|
705 |
+
// methods of the given Promise object:
|
706 |
+
_enhancePromise: function(promise) {
|
707 |
+
promise.success = promise.done;
|
708 |
+
promise.error = promise.fail;
|
709 |
+
promise.complete = promise.always;
|
710 |
+
return promise;
|
711 |
+
},
|
712 |
+
|
713 |
+
// Creates and returns a Promise object enhanced with
|
714 |
+
// the jqXHR methods abort, success, error and complete:
|
715 |
+
_getXHRPromise: function(resolveOrReject, context, args) {
|
716 |
+
var dfd = $.Deferred(),
|
717 |
+
promise = dfd.promise();
|
718 |
+
// eslint-disable-next-line no-param-reassign
|
719 |
+
context = context || this.options.context || promise;
|
720 |
+
if (resolveOrReject === true) {
|
721 |
+
dfd.resolveWith(context, args);
|
722 |
+
} else if (resolveOrReject === false) {
|
723 |
+
dfd.rejectWith(context, args);
|
724 |
+
}
|
725 |
+
promise.abort = dfd.promise;
|
726 |
+
return this._enhancePromise(promise);
|
727 |
+
},
|
728 |
+
|
729 |
+
// Adds convenience methods to the data callback argument:
|
730 |
+
_addConvenienceMethods: function(e, data) {
|
731 |
+
var that = this,
|
732 |
+
getPromise = function(args) {
|
733 |
+
return $.Deferred()
|
734 |
+
.resolveWith(that, args)
|
735 |
+
.promise();
|
736 |
+
};
|
737 |
+
data.process = function(resolveFunc, rejectFunc) {
|
738 |
+
if (resolveFunc || rejectFunc) {
|
739 |
+
data._processQueue = this._processQueue = (
|
740 |
+
this._processQueue || getPromise([this])
|
741 |
+
)
|
742 |
+
.then(function() {
|
743 |
+
if (data.errorThrown) {
|
744 |
+
return $.Deferred()
|
745 |
+
.rejectWith(that, [data])
|
746 |
+
.promise();
|
747 |
+
}
|
748 |
+
return getPromise(arguments);
|
749 |
+
})
|
750 |
+
.then(resolveFunc, rejectFunc);
|
751 |
+
}
|
752 |
+
return this._processQueue || getPromise([this]);
|
753 |
+
};
|
754 |
+
data.submit = function() {
|
755 |
+
if (this.state() !== 'pending') {
|
756 |
+
data.jqXHR = this.jqXHR =
|
757 |
+
that._trigger(
|
758 |
+
'submit',
|
759 |
+
$.Event('submit', { delegatedEvent: e }),
|
760 |
+
this
|
761 |
+
) !== false && that._onSend(e, this);
|
762 |
+
}
|
763 |
+
return this.jqXHR || that._getXHRPromise();
|
764 |
+
};
|
765 |
+
data.abort = function() {
|
766 |
+
if (this.jqXHR) {
|
767 |
+
return this.jqXHR.abort();
|
768 |
+
}
|
769 |
+
this.errorThrown = 'abort';
|
770 |
+
that._trigger('fail', null, this);
|
771 |
+
return that._getXHRPromise(false);
|
772 |
+
};
|
773 |
+
data.state = function() {
|
774 |
+
if (this.jqXHR) {
|
775 |
+
return that._getDeferredState(this.jqXHR);
|
776 |
+
}
|
777 |
+
if (this._processQueue) {
|
778 |
+
return that._getDeferredState(this._processQueue);
|
779 |
+
}
|
780 |
+
};
|
781 |
+
data.processing = function() {
|
782 |
+
return (
|
783 |
+
!this.jqXHR &&
|
784 |
+
this._processQueue &&
|
785 |
+
that._getDeferredState(this._processQueue) === 'pending'
|
786 |
+
);
|
787 |
+
};
|
788 |
+
data.progress = function() {
|
789 |
+
return this._progress;
|
790 |
+
};
|
791 |
+
data.response = function() {
|
792 |
+
return this._response;
|
793 |
+
};
|
794 |
+
},
|
795 |
+
|
796 |
+
// Parses the Range header from the server response
|
797 |
+
// and returns the uploaded bytes:
|
798 |
+
_getUploadedBytes: function(jqXHR) {
|
799 |
+
var range = jqXHR.getResponseHeader('Range'),
|
800 |
+
parts = range && range.split('-'),
|
801 |
+
upperBytesPos = parts && parts.length > 1 && parseInt(parts[1], 10);
|
802 |
+
return upperBytesPos && upperBytesPos + 1;
|
803 |
+
},
|
804 |
+
|
805 |
+
// Uploads a file in multiple, sequential requests
|
806 |
+
// by splitting the file up in multiple blob chunks.
|
807 |
+
// If the second parameter is true, only tests if the file
|
808 |
+
// should be uploaded in chunks, but does not invoke any
|
809 |
+
// upload requests:
|
810 |
+
_chunkedUpload: function(options, testOnly) {
|
811 |
+
options.uploadedBytes = options.uploadedBytes || 0;
|
812 |
+
var that = this,
|
813 |
+
file = options.files[0],
|
814 |
+
fs = file.size,
|
815 |
+
ub = options.uploadedBytes,
|
816 |
+
mcs = options.maxChunkSize || fs,
|
817 |
+
slice = this._blobSlice,
|
818 |
+
dfd = $.Deferred(),
|
819 |
+
promise = dfd.promise(),
|
820 |
+
jqXHR,
|
821 |
+
upload;
|
822 |
+
if (
|
823 |
+
!(
|
824 |
+
this._isXHRUpload(options) &&
|
825 |
+
slice &&
|
826 |
+
(ub || ($.type(mcs) === 'function' ? mcs(options) : mcs) < fs)
|
827 |
+
) ||
|
828 |
+
options.data
|
829 |
+
) {
|
830 |
+
return false;
|
831 |
+
}
|
832 |
+
if (testOnly) {
|
833 |
+
return true;
|
834 |
+
}
|
835 |
+
if (ub >= fs) {
|
836 |
+
file.error = options.i18n('uploadedBytes');
|
837 |
+
return this._getXHRPromise(false, options.context, [
|
838 |
+
null,
|
839 |
+
'error',
|
840 |
+
file.error
|
841 |
+
]);
|
842 |
+
}
|
843 |
+
// The chunk upload method:
|
844 |
+
upload = function() {
|
845 |
+
// Clone the options object for each chunk upload:
|
846 |
+
var o = $.extend({}, options),
|
847 |
+
currentLoaded = o._progress.loaded;
|
848 |
+
o.blob = slice.call(
|
849 |
+
file,
|
850 |
+
ub,
|
851 |
+
ub + ($.type(mcs) === 'function' ? mcs(o) : mcs),
|
852 |
+
file.type
|
853 |
+
);
|
854 |
+
// Store the current chunk size, as the blob itself
|
855 |
+
// will be dereferenced after data processing:
|
856 |
+
o.chunkSize = o.blob.size;
|
857 |
+
// Expose the chunk bytes position range:
|
858 |
+
o.contentRange =
|
859 |
+
'bytes ' + ub + '-' + (ub + o.chunkSize - 1) + '/' + fs;
|
860 |
+
// Trigger chunkbeforesend to allow form data to be updated for this chunk
|
861 |
+
that._trigger('chunkbeforesend', null, o);
|
862 |
+
// Process the upload data (the blob and potential form data):
|
863 |
+
that._initXHRData(o);
|
864 |
+
// Add progress listeners for this chunk upload:
|
865 |
+
that._initProgressListener(o);
|
866 |
+
jqXHR = (
|
867 |
+
(that._trigger('chunksend', null, o) !== false && $.ajax(o)) ||
|
868 |
+
that._getXHRPromise(false, o.context)
|
869 |
+
)
|
870 |
+
.done(function(result, textStatus, jqXHR) {
|
871 |
+
ub = that._getUploadedBytes(jqXHR) || ub + o.chunkSize;
|
872 |
+
// Create a progress event if no final progress event
|
873 |
+
// with loaded equaling total has been triggered
|
874 |
+
// for this chunk:
|
875 |
+
if (currentLoaded + o.chunkSize - o._progress.loaded) {
|
876 |
+
that._onProgress(
|
877 |
+
$.Event('progress', {
|
878 |
+
lengthComputable: true,
|
879 |
+
loaded: ub - o.uploadedBytes,
|
880 |
+
total: ub - o.uploadedBytes
|
881 |
+
}),
|
882 |
+
o
|
883 |
+
);
|
884 |
}
|
885 |
+
options.uploadedBytes = o.uploadedBytes = ub;
|
886 |
+
o.result = result;
|
887 |
+
o.textStatus = textStatus;
|
888 |
+
o.jqXHR = jqXHR;
|
889 |
+
that._trigger('chunkdone', null, o);
|
890 |
+
that._trigger('chunkalways', null, o);
|
891 |
+
if (ub < fs) {
|
892 |
+
// File upload not yet complete,
|
893 |
+
// continue with the next chunk:
|
894 |
+
upload();
|
895 |
+
} else {
|
896 |
+
dfd.resolveWith(o.context, [result, textStatus, jqXHR]);
|
897 |
}
|
898 |
+
})
|
899 |
+
.fail(function(jqXHR, textStatus, errorThrown) {
|
900 |
+
o.jqXHR = jqXHR;
|
901 |
+
o.textStatus = textStatus;
|
902 |
+
o.errorThrown = errorThrown;
|
903 |
+
that._trigger('chunkfail', null, o);
|
904 |
+
that._trigger('chunkalways', null, o);
|
905 |
+
dfd.rejectWith(o.context, [jqXHR, textStatus, errorThrown]);
|
906 |
+
})
|
907 |
+
.always(function() {
|
908 |
+
that._deinitProgressListener(o);
|
909 |
+
});
|
910 |
+
};
|
911 |
+
this._enhancePromise(promise);
|
912 |
+
promise.abort = function() {
|
913 |
+
return jqXHR.abort();
|
914 |
+
};
|
915 |
+
upload();
|
916 |
+
return promise;
|
917 |
+
},
|
918 |
+
|
919 |
+
_beforeSend: function(e, data) {
|
920 |
+
if (this._active === 0) {
|
921 |
+
// the start callback is triggered when an upload starts
|
922 |
+
// and no other uploads are currently running,
|
923 |
+
// equivalent to the global ajaxStart event:
|
924 |
+
this._trigger('start');
|
925 |
+
// Set timer for global bitrate progress calculation:
|
926 |
+
this._bitrateTimer = new this._BitrateTimer();
|
927 |
+
// Reset the global progress values:
|
928 |
+
this._progress.loaded = this._progress.total = 0;
|
929 |
+
this._progress.bitrate = 0;
|
930 |
+
}
|
931 |
+
// Make sure the container objects for the .response() and
|
932 |
+
// .progress() methods on the data object are available
|
933 |
+
// and reset to their initial state:
|
934 |
+
this._initResponseObject(data);
|
935 |
+
this._initProgressObject(data);
|
936 |
+
data._progress.loaded = data.loaded = data.uploadedBytes || 0;
|
937 |
+
data._progress.total = data.total = this._getTotal(data.files) || 1;
|
938 |
+
data._progress.bitrate = data.bitrate = 0;
|
939 |
+
this._active += 1;
|
940 |
+
// Initialize the global progress values:
|
941 |
+
this._progress.loaded += data.loaded;
|
942 |
+
this._progress.total += data.total;
|
943 |
+
},
|
944 |
+
|
945 |
+
_onDone: function(result, textStatus, jqXHR, options) {
|
946 |
+
var total = options._progress.total,
|
947 |
+
response = options._response;
|
948 |
+
if (options._progress.loaded < total) {
|
949 |
+
// Create a progress event if no final progress event
|
950 |
+
// with loaded equaling total has been triggered:
|
951 |
+
this._onProgress(
|
952 |
+
$.Event('progress', {
|
953 |
+
lengthComputable: true,
|
954 |
+
loaded: total,
|
955 |
+
total: total
|
956 |
+
}),
|
957 |
+
options
|
958 |
+
);
|
959 |
+
}
|
960 |
+
response.result = options.result = result;
|
961 |
+
response.textStatus = options.textStatus = textStatus;
|
962 |
+
response.jqXHR = options.jqXHR = jqXHR;
|
963 |
+
this._trigger('done', null, options);
|
964 |
+
},
|
965 |
+
|
966 |
+
_onFail: function(jqXHR, textStatus, errorThrown, options) {
|
967 |
+
var response = options._response;
|
968 |
+
if (options.recalculateProgress) {
|
969 |
+
// Remove the failed (error or abort) file upload from
|
970 |
+
// the global progress calculation:
|
971 |
+
this._progress.loaded -= options._progress.loaded;
|
972 |
+
this._progress.total -= options._progress.total;
|
973 |
+
}
|
974 |
+
response.jqXHR = options.jqXHR = jqXHR;
|
975 |
+
response.textStatus = options.textStatus = textStatus;
|
976 |
+
response.errorThrown = options.errorThrown = errorThrown;
|
977 |
+
this._trigger('fail', null, options);
|
978 |
+
},
|
979 |
+
|
980 |
+
_onAlways: function(jqXHRorResult, textStatus, jqXHRorError, options) {
|
981 |
+
// jqXHRorResult, textStatus and jqXHRorError are added to the
|
982 |
+
// options object via done and fail callbacks
|
983 |
+
this._trigger('always', null, options);
|
984 |
+
},
|
985 |
+
|
986 |
+
_onSend: function(e, data) {
|
987 |
+
if (!data.submit) {
|
988 |
+
this._addConvenienceMethods(e, data);
|
989 |
+
}
|
990 |
+
var that = this,
|
991 |
+
jqXHR,
|
992 |
+
aborted,
|
993 |
+
slot,
|
994 |
+
pipe,
|
995 |
+
options = that._getAJAXSettings(data),
|
996 |
+
send = function() {
|
997 |
+
that._sending += 1;
|
998 |
+
// Set timer for bitrate progress calculation:
|
999 |
+
options._bitrateTimer = new that._BitrateTimer();
|
1000 |
+
jqXHR =
|
1001 |
+
jqXHR ||
|
1002 |
+
(
|
1003 |
+
((aborted ||
|
1004 |
+
that._trigger(
|
1005 |
+
'send',
|
1006 |
+
$.Event('send', { delegatedEvent: e }),
|
1007 |
+
options
|
1008 |
+
) === false) &&
|
1009 |
+
that._getXHRPromise(false, options.context, aborted)) ||
|
1010 |
+
that._chunkedUpload(options) ||
|
1011 |
+
$.ajax(options)
|
1012 |
+
)
|
1013 |
+
.done(function(result, textStatus, jqXHR) {
|
1014 |
+
that._onDone(result, textStatus, jqXHR, options);
|
1015 |
+
})
|
1016 |
+
.fail(function(jqXHR, textStatus, errorThrown) {
|
1017 |
+
that._onFail(jqXHR, textStatus, errorThrown, options);
|
1018 |
+
})
|
1019 |
+
.always(function(jqXHRorResult, textStatus, jqXHRorError) {
|
1020 |
+
that._deinitProgressListener(options);
|
1021 |
+
that._onAlways(
|
1022 |
+
jqXHRorResult,
|
1023 |
+
textStatus,
|
1024 |
+
jqXHRorError,
|
1025 |
+
options
|
1026 |
);
|
1027 |
+
that._sending -= 1;
|
1028 |
+
that._active -= 1;
|
1029 |
+
if (
|
1030 |
+
options.limitConcurrentUploads &&
|
1031 |
+
options.limitConcurrentUploads > that._sending
|
1032 |
+
) {
|
1033 |
+
// Start the next queued upload,
|
1034 |
+
// that has not been aborted:
|
1035 |
+
var nextSlot = that._slots.shift();
|
1036 |
+
while (nextSlot) {
|
1037 |
+
if (that._getDeferredState(nextSlot) === 'pending') {
|
1038 |
+
nextSlot.resolve();
|
1039 |
+
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1040 |
}
|
1041 |
+
nextSlot = that._slots.shift();
|
1042 |
+
}
|
|
|
|
|
|
|
|
|
|
|
1043 |
}
|
1044 |
+
if (that._active === 0) {
|
1045 |
+
// The stop callback is triggered when all uploads have
|
1046 |
+
// been completed, equivalent to the global ajaxStop event:
|
1047 |
+
that._trigger('stop');
|
1048 |
+
}
|
1049 |
+
});
|
1050 |
+
return jqXHR;
|
1051 |
+
};
|
1052 |
+
this._beforeSend(e, options);
|
1053 |
+
if (
|
1054 |
+
this.options.sequentialUploads ||
|
1055 |
+
(this.options.limitConcurrentUploads &&
|
1056 |
+
this.options.limitConcurrentUploads <= this._sending)
|
1057 |
+
) {
|
1058 |
+
if (this.options.limitConcurrentUploads > 1) {
|
1059 |
+
slot = $.Deferred();
|
1060 |
+
this._slots.push(slot);
|
1061 |
+
pipe = slot.then(send);
|
1062 |
+
} else {
|
1063 |
+
this._sequence = this._sequence.then(send, send);
|
1064 |
+
pipe = this._sequence;
|
1065 |
+
}
|
1066 |
+
// Return the piped Promise object, enhanced with an abort method,
|
1067 |
+
// which is delegated to the jqXHR object of the current upload,
|
1068 |
+
// and jqXHR callbacks mapped to the equivalent Promise methods:
|
1069 |
+
pipe.abort = function() {
|
1070 |
+
aborted = [undefined, 'abort', 'abort'];
|
1071 |
+
if (!jqXHR) {
|
1072 |
+
if (slot) {
|
1073 |
+
slot.rejectWith(options.context, aborted);
|
1074 |
}
|
1075 |
+
return send();
|
1076 |
+
}
|
1077 |
+
return jqXHR.abort();
|
1078 |
+
};
|
1079 |
+
return this._enhancePromise(pipe);
|
1080 |
+
}
|
1081 |
+
return send();
|
1082 |
+
},
|
1083 |
+
|
1084 |
+
_onAdd: function(e, data) {
|
1085 |
+
var that = this,
|
1086 |
+
result = true,
|
1087 |
+
options = $.extend({}, this.options, data),
|
1088 |
+
files = data.files,
|
1089 |
+
filesLength = files.length,
|
1090 |
+
limit = options.limitMultiFileUploads,
|
1091 |
+
limitSize = options.limitMultiFileUploadSize,
|
1092 |
+
overhead = options.limitMultiFileUploadSizeOverhead,
|
1093 |
+
batchSize = 0,
|
1094 |
+
paramName = this._getParamName(options),
|
1095 |
+
paramNameSet,
|
1096 |
+
paramNameSlice,
|
1097 |
+
fileSet,
|
1098 |
+
i,
|
1099 |
+
j = 0;
|
1100 |
+
if (!filesLength) {
|
1101 |
+
return false;
|
1102 |
+
}
|
1103 |
+
if (limitSize && files[0].size === undefined) {
|
1104 |
+
limitSize = undefined;
|
1105 |
+
}
|
1106 |
+
if (
|
1107 |
+
!(options.singleFileUploads || limit || limitSize) ||
|
1108 |
+
!this._isXHRUpload(options)
|
1109 |
+
) {
|
1110 |
+
fileSet = [files];
|
1111 |
+
paramNameSet = [paramName];
|
1112 |
+
} else if (!(options.singleFileUploads || limitSize) && limit) {
|
1113 |
+
fileSet = [];
|
1114 |
+
paramNameSet = [];
|
1115 |
+
for (i = 0; i < filesLength; i += limit) {
|
1116 |
+
fileSet.push(files.slice(i, i + limit));
|
1117 |
+
paramNameSlice = paramName.slice(i, i + limit);
|
1118 |
+
if (!paramNameSlice.length) {
|
1119 |
+
paramNameSlice = paramName;
|
1120 |
+
}
|
1121 |
+
paramNameSet.push(paramNameSlice);
|
1122 |
+
}
|
1123 |
+
} else if (!options.singleFileUploads && limitSize) {
|
1124 |
+
fileSet = [];
|
1125 |
+
paramNameSet = [];
|
1126 |
+
for (i = 0; i < filesLength; i = i + 1) {
|
1127 |
+
batchSize += files[i].size + overhead;
|
1128 |
+
if (
|
1129 |
+
i + 1 === filesLength ||
|
1130 |
+
batchSize + files[i + 1].size + overhead > limitSize ||
|
1131 |
+
(limit && i + 1 - j >= limit)
|
1132 |
+
) {
|
1133 |
+
fileSet.push(files.slice(j, i + 1));
|
1134 |
+
paramNameSlice = paramName.slice(j, i + 1);
|
1135 |
+
if (!paramNameSlice.length) {
|
1136 |
+
paramNameSlice = paramName;
|
1137 |
}
|
1138 |
+
paramNameSet.push(paramNameSlice);
|
1139 |
+
j = i + 1;
|
1140 |
+
batchSize = 0;
|
1141 |
+
}
|
1142 |
+
}
|
1143 |
+
} else {
|
1144 |
+
paramNameSet = paramName;
|
1145 |
+
}
|
1146 |
+
data.originalFiles = files;
|
1147 |
+
$.each(fileSet || files, function(index, element) {
|
1148 |
+
var newData = $.extend({}, data);
|
1149 |
+
newData.files = fileSet ? element : [element];
|
1150 |
+
newData.paramName = paramNameSet[index];
|
1151 |
+
that._initResponseObject(newData);
|
1152 |
+
that._initProgressObject(newData);
|
1153 |
+
that._addConvenienceMethods(e, newData);
|
1154 |
+
result = that._trigger(
|
1155 |
+
'add',
|
1156 |
+
$.Event('add', { delegatedEvent: e }),
|
1157 |
+
newData
|
1158 |
+
);
|
1159 |
+
return result;
|
1160 |
+
});
|
1161 |
+
return result;
|
1162 |
+
},
|
1163 |
+
|
1164 |
+
_replaceFileInput: function(data) {
|
1165 |
+
var input = data.fileInput,
|
1166 |
+
inputClone = input.clone(true),
|
1167 |
+
restoreFocus = input.is(document.activeElement);
|
1168 |
+
// Add a reference for the new cloned file input to the data argument:
|
1169 |
+
data.fileInputClone = inputClone;
|
1170 |
+
$('<form></form>')
|
1171 |
+
.append(inputClone)[0]
|
1172 |
+
.reset();
|
1173 |
+
// Detaching allows to insert the fileInput on another form
|
1174 |
+
// without loosing the file input value:
|
1175 |
+
input.after(inputClone).detach();
|
1176 |
+
// If the fileInput had focus before it was detached,
|
1177 |
+
// restore focus to the inputClone.
|
1178 |
+
if (restoreFocus) {
|
1179 |
+
inputClone.focus();
|
1180 |
+
}
|
1181 |
+
// Avoid memory leaks with the detached file input:
|
1182 |
+
$.cleanData(input.unbind('remove'));
|
1183 |
+
// Replace the original file input element in the fileInput
|
1184 |
+
// elements set with the clone, which has been copied including
|
1185 |
+
// event handlers:
|
1186 |
+
this.options.fileInput = this.options.fileInput.map(function(i, el) {
|
1187 |
+
if (el === input[0]) {
|
1188 |
+
return inputClone[0];
|
1189 |
+
}
|
1190 |
+
return el;
|
1191 |
+
});
|
1192 |
+
// If the widget has been initialized on the file input itself,
|
1193 |
+
// override this.element with the file input clone:
|
1194 |
+
if (input[0] === this.element[0]) {
|
1195 |
+
this.element = inputClone;
|
1196 |
+
}
|
1197 |
+
},
|
1198 |
+
|
1199 |
+
_handleFileTreeEntry: function(entry, path) {
|
1200 |
+
var that = this,
|
1201 |
+
dfd = $.Deferred(),
|
1202 |
+
entries = [],
|
1203 |
+
dirReader,
|
1204 |
+
errorHandler = function(e) {
|
1205 |
+
if (e && !e.entry) {
|
1206 |
+
e.entry = entry;
|
1207 |
+
}
|
1208 |
+
// Since $.when returns immediately if one
|
1209 |
+
// Deferred is rejected, we use resolve instead.
|
1210 |
+
// This allows valid files and invalid items
|
1211 |
+
// to be returned together in one set:
|
1212 |
+
dfd.resolve([e]);
|
1213 |
},
|
1214 |
+
successHandler = function(entries) {
|
1215 |
+
that
|
1216 |
+
._handleFileTreeEntries(entries, path + entry.name + '/')
|
1217 |
+
.done(function(files) {
|
1218 |
+
dfd.resolve(files);
|
1219 |
+
})
|
1220 |
+
.fail(errorHandler);
|
|
|
|
|
1221 |
},
|
1222 |
+
readEntries = function() {
|
1223 |
+
dirReader.readEntries(function(results) {
|
1224 |
+
if (!results.length) {
|
1225 |
+
successHandler(entries);
|
1226 |
+
} else {
|
1227 |
+
entries = entries.concat(results);
|
1228 |
+
readEntries();
|
1229 |
}
|
1230 |
+
}, errorHandler);
|
1231 |
+
};
|
1232 |
+
// eslint-disable-next-line no-param-reassign
|
1233 |
+
path = path || '';
|
1234 |
+
if (entry.isFile) {
|
1235 |
+
if (entry._file) {
|
1236 |
+
// Workaround for Chrome bug #149735
|
1237 |
+
entry._file.relativePath = path;
|
1238 |
+
dfd.resolve(entry._file);
|
1239 |
+
} else {
|
1240 |
+
entry.file(function(file) {
|
1241 |
+
file.relativePath = path;
|
1242 |
+
dfd.resolve(file);
|
1243 |
+
}, errorHandler);
|
1244 |
+
}
|
1245 |
+
} else if (entry.isDirectory) {
|
1246 |
+
dirReader = entry.createReader();
|
1247 |
+
readEntries();
|
1248 |
+
} else {
|
1249 |
+
// Return an empty list for file system items
|
1250 |
+
// other than files or directories:
|
1251 |
+
dfd.resolve([]);
|
1252 |
+
}
|
1253 |
+
return dfd.promise();
|
1254 |
+
},
|
1255 |
+
|
1256 |
+
_handleFileTreeEntries: function(entries, path) {
|
1257 |
+
var that = this;
|
1258 |
+
return $.when
|
1259 |
+
.apply(
|
1260 |
+
$,
|
1261 |
+
$.map(entries, function(entry) {
|
1262 |
+
return that._handleFileTreeEntry(entry, path);
|
1263 |
+
})
|
1264 |
+
)
|
1265 |
+
.then(function() {
|
1266 |
+
return Array.prototype.concat.apply([], arguments);
|
1267 |
+
});
|
1268 |
+
},
|
1269 |
+
|
1270 |
+
_getDroppedFiles: function(dataTransfer) {
|
1271 |
+
// eslint-disable-next-line no-param-reassign
|
1272 |
+
dataTransfer = dataTransfer || {};
|
1273 |
+
var items = dataTransfer.items;
|
1274 |
+
if (
|
1275 |
+
items &&
|
1276 |
+
items.length &&
|
1277 |
+
(items[0].webkitGetAsEntry || items[0].getAsEntry)
|
1278 |
+
) {
|
1279 |
+
return this._handleFileTreeEntries(
|
1280 |
+
$.map(items, function(item) {
|
1281 |
+
var entry;
|
1282 |
+
if (item.webkitGetAsEntry) {
|
1283 |
+
entry = item.webkitGetAsEntry();
|
1284 |
+
if (entry) {
|
1285 |
+
// Workaround for Chrome bug #149735:
|
1286 |
+
entry._file = item.getAsFile();
|
1287 |
+
}
|
1288 |
+
return entry;
|
1289 |
}
|
1290 |
+
return item.getAsEntry();
|
1291 |
+
})
|
1292 |
+
);
|
1293 |
+
}
|
1294 |
+
return $.Deferred()
|
1295 |
+
.resolve($.makeArray(dataTransfer.files))
|
1296 |
+
.promise();
|
1297 |
+
},
|
1298 |
+
|
1299 |
+
_getSingleFileInputFiles: function(fileInput) {
|
1300 |
+
// eslint-disable-next-line no-param-reassign
|
1301 |
+
fileInput = $(fileInput);
|
1302 |
+
var entries =
|
1303 |
+
fileInput.prop('webkitEntries') || fileInput.prop('entries'),
|
1304 |
+
files,
|
1305 |
+
value;
|
1306 |
+
if (entries && entries.length) {
|
1307 |
+
return this._handleFileTreeEntries(entries);
|
1308 |
+
}
|
1309 |
+
files = $.makeArray(fileInput.prop('files'));
|
1310 |
+
if (!files.length) {
|
1311 |
+
value = fileInput.prop('value');
|
1312 |
+
if (!value) {
|
1313 |
+
return $.Deferred()
|
1314 |
+
.resolve([])
|
1315 |
+
.promise();
|
1316 |
+
}
|
1317 |
+
// If the files property is not available, the browser does not
|
1318 |
+
// support the File API and we add a pseudo File object with
|
1319 |
+
// the input value as name with path information removed:
|
1320 |
+
files = [{ name: value.replace(/^.*\\/, '') }];
|
1321 |
+
} else if (files[0].name === undefined && files[0].fileName) {
|
1322 |
+
// File normalization for Safari 4 and Firefox 3:
|
1323 |
+
$.each(files, function(index, file) {
|
1324 |
+
file.name = file.fileName;
|
1325 |
+
file.size = file.fileSize;
|
1326 |
+
});
|
1327 |
+
}
|
1328 |
+
return $.Deferred()
|
1329 |
+
.resolve(files)
|
1330 |
+
.promise();
|
1331 |
+
},
|
1332 |
+
|
1333 |
+
_getFileInputFiles: function(fileInput) {
|
1334 |
+
if (!(fileInput instanceof $) || fileInput.length === 1) {
|
1335 |
+
return this._getSingleFileInputFiles(fileInput);
|
1336 |
+
}
|
1337 |
+
return $.when
|
1338 |
+
.apply($, $.map(fileInput, this._getSingleFileInputFiles))
|
1339 |
+
.then(function() {
|
1340 |
+
return Array.prototype.concat.apply([], arguments);
|
1341 |
+
});
|
1342 |
+
},
|
1343 |
+
|
1344 |
+
_onChange: function(e) {
|
1345 |
+
var that = this,
|
1346 |
+
data = {
|
1347 |
+
fileInput: $(e.target),
|
1348 |
+
form: $(e.target.form)
|
1349 |
+
};
|
1350 |
+
this._getFileInputFiles(data.fileInput).always(function(files) {
|
1351 |
+
data.files = files;
|
1352 |
+
if (that.options.replaceFileInput) {
|
1353 |
+
that._replaceFileInput(data);
|
1354 |
+
}
|
1355 |
+
if (
|
1356 |
+
that._trigger(
|
1357 |
+
'change',
|
1358 |
+
$.Event('change', { delegatedEvent: e }),
|
1359 |
+
data
|
1360 |
+
) !== false
|
1361 |
+
) {
|
1362 |
+
that._onAdd(e, data);
|
1363 |
+
}
|
1364 |
+
});
|
1365 |
+
},
|
1366 |
+
|
1367 |
+
_onPaste: function(e) {
|
1368 |
+
var items =
|
1369 |
+
e.originalEvent &&
|
1370 |
+
e.originalEvent.clipboardData &&
|
1371 |
+
e.originalEvent.clipboardData.items,
|
1372 |
+
data = { files: [] };
|
1373 |
+
if (items && items.length) {
|
1374 |
+
$.each(items, function(index, item) {
|
1375 |
+
var file = item.getAsFile && item.getAsFile();
|
1376 |
+
if (file) {
|
1377 |
+
data.files.push(file);
|
1378 |
+
}
|
1379 |
+
});
|
1380 |
+
if (
|
1381 |
+
this._trigger(
|
1382 |
+
'paste',
|
1383 |
+
$.Event('paste', { delegatedEvent: e }),
|
1384 |
+
data
|
1385 |
+
) !== false
|
1386 |
+
) {
|
1387 |
+
this._onAdd(e, data);
|
1388 |
+
}
|
1389 |
+
}
|
1390 |
+
},
|
1391 |
+
|
1392 |
+
_onDrop: function(e) {
|
1393 |
+
e.dataTransfer = e.originalEvent && e.originalEvent.dataTransfer;
|
1394 |
+
var that = this,
|
1395 |
+
dataTransfer = e.dataTransfer,
|
1396 |
+
data = {};
|
1397 |
+
if (dataTransfer && dataTransfer.files && dataTransfer.files.length) {
|
1398 |
+
e.preventDefault();
|
1399 |
+
this._getDroppedFiles(dataTransfer).always(function(files) {
|
1400 |
+
data.files = files;
|
1401 |
+
if (
|
1402 |
+
that._trigger(
|
1403 |
+
'drop',
|
1404 |
+
$.Event('drop', { delegatedEvent: e }),
|
1405 |
+
data
|
1406 |
+
) !== false
|
1407 |
+
) {
|
1408 |
+
that._onAdd(e, data);
|
1409 |
+
}
|
1410 |
+
});
|
1411 |
+
}
|
1412 |
+
},
|
1413 |
+
|
1414 |
+
_onDragOver: getDragHandler('dragover'),
|
1415 |
+
|
1416 |
+
_onDragEnter: getDragHandler('dragenter'),
|
1417 |
+
|
1418 |
+
_onDragLeave: getDragHandler('dragleave'),
|
1419 |
+
|
1420 |
+
_initEventHandlers: function() {
|
1421 |
+
if (this._isXHRUpload(this.options)) {
|
1422 |
+
this._on(this.options.dropZone, {
|
1423 |
+
dragover: this._onDragOver,
|
1424 |
+
drop: this._onDrop,
|
1425 |
+
// event.preventDefault() on dragenter is required for IE10+:
|
1426 |
+
dragenter: this._onDragEnter,
|
1427 |
+
// dragleave is not required, but added for completeness:
|
1428 |
+
dragleave: this._onDragLeave
|
1429 |
+
});
|
1430 |
+
this._on(this.options.pasteZone, {
|
1431 |
+
paste: this._onPaste
|
1432 |
+
});
|
1433 |
+
}
|
1434 |
+
if ($.support.fileInput) {
|
1435 |
+
this._on(this.options.fileInput, {
|
1436 |
+
change: this._onChange
|
1437 |
+
});
|
1438 |
+
}
|
1439 |
+
},
|
1440 |
+
|
1441 |
+
_destroyEventHandlers: function() {
|
1442 |
+
this._off(this.options.dropZone, 'dragenter dragleave dragover drop');
|
1443 |
+
this._off(this.options.pasteZone, 'paste');
|
1444 |
+
this._off(this.options.fileInput, 'change');
|
1445 |
+
},
|
1446 |
+
|
1447 |
+
_destroy: function() {
|
1448 |
+
this._destroyEventHandlers();
|
1449 |
+
},
|
1450 |
+
|
1451 |
+
_setOption: function(key, value) {
|
1452 |
+
var reinit = $.inArray(key, this._specialOptions) !== -1;
|
1453 |
+
if (reinit) {
|
1454 |
+
this._destroyEventHandlers();
|
1455 |
+
}
|
1456 |
+
this._super(key, value);
|
1457 |
+
if (reinit) {
|
1458 |
+
this._initSpecialOptions();
|
1459 |
+
this._initEventHandlers();
|
1460 |
+
}
|
1461 |
+
},
|
1462 |
+
|
1463 |
+
_initSpecialOptions: function() {
|
1464 |
+
var options = this.options;
|
1465 |
+
if (options.fileInput === undefined) {
|
1466 |
+
options.fileInput = this.element.is('input[type="file"]')
|
1467 |
+
? this.element
|
1468 |
+
: this.element.find('input[type="file"]');
|
1469 |
+
} else if (!(options.fileInput instanceof $)) {
|
1470 |
+
options.fileInput = $(options.fileInput);
|
1471 |
+
}
|
1472 |
+
if (!(options.dropZone instanceof $)) {
|
1473 |
+
options.dropZone = $(options.dropZone);
|
1474 |
+
}
|
1475 |
+
if (!(options.pasteZone instanceof $)) {
|
1476 |
+
options.pasteZone = $(options.pasteZone);
|
1477 |
+
}
|
1478 |
+
},
|
1479 |
+
|
1480 |
+
_getRegExp: function(str) {
|
1481 |
+
var parts = str.split('/'),
|
1482 |
+
modifiers = parts.pop();
|
1483 |
+
parts.shift();
|
1484 |
+
return new RegExp(parts.join('/'), modifiers);
|
1485 |
+
},
|
1486 |
+
|
1487 |
+
_isRegExpOption: function(key, value) {
|
1488 |
+
return (
|
1489 |
+
key !== 'url' &&
|
1490 |
+
$.type(value) === 'string' &&
|
1491 |
+
/^\/.*\/[igm]{0,3}$/.test(value)
|
1492 |
+
);
|
1493 |
+
},
|
1494 |
+
|
1495 |
+
_initDataAttributes: function() {
|
1496 |
+
var that = this,
|
1497 |
+
options = this.options,
|
1498 |
+
data = this.element.data();
|
1499 |
+
// Initialize options set via HTML5 data-attributes:
|
1500 |
+
$.each(this.element[0].attributes, function(index, attr) {
|
1501 |
+
var key = attr.name.toLowerCase(),
|
1502 |
+
value;
|
1503 |
+
if (/^data-/.test(key)) {
|
1504 |
+
// Convert hyphen-ated key to camelCase:
|
1505 |
+
key = key.slice(5).replace(/-[a-z]/g, function(str) {
|
1506 |
+
return str.charAt(1).toUpperCase();
|
1507 |
+
});
|
1508 |
+
value = data[key];
|
1509 |
+
if (that._isRegExpOption(key, value)) {
|
1510 |
+
value = that._getRegExp(value);
|
1511 |
+
}
|
1512 |
+
options[key] = value;
|
1513 |
+
}
|
1514 |
+
});
|
1515 |
+
},
|
1516 |
+
|
1517 |
+
_create: function() {
|
1518 |
+
this._initDataAttributes();
|
1519 |
+
this._initSpecialOptions();
|
1520 |
+
this._slots = [];
|
1521 |
+
this._sequence = this._getXHRPromise(true);
|
1522 |
+
this._sending = this._active = 0;
|
1523 |
+
this._initProgressObject(this);
|
1524 |
+
this._initEventHandlers();
|
1525 |
+
},
|
1526 |
+
|
1527 |
+
// This method is exposed to the widget API and allows to query
|
1528 |
+
// the number of active uploads:
|
1529 |
+
active: function() {
|
1530 |
+
return this._active;
|
1531 |
+
},
|
1532 |
+
|
1533 |
+
// This method is exposed to the widget API and allows to query
|
1534 |
+
// the widget upload progress.
|
1535 |
+
// It returns an object with loaded, total and bitrate properties
|
1536 |
+
// for the running uploads:
|
1537 |
+
progress: function() {
|
1538 |
+
return this._progress;
|
1539 |
+
},
|
1540 |
+
|
1541 |
+
// This method is exposed to the widget API and allows adding files
|
1542 |
+
// using the fileupload API. The data parameter accepts an object which
|
1543 |
+
// must have a files property and can contain additional options:
|
1544 |
+
// .fileupload('add', {files: filesList});
|
1545 |
+
add: function(data) {
|
1546 |
+
var that = this;
|
1547 |
+
if (!data || this.options.disabled) {
|
1548 |
+
return;
|
1549 |
+
}
|
1550 |
+
if (data.fileInput && !data.files) {
|
1551 |
+
this._getFileInputFiles(data.fileInput).always(function(files) {
|
1552 |
+
data.files = files;
|
1553 |
+
that._onAdd(null, data);
|
1554 |
+
});
|
1555 |
+
} else {
|
1556 |
+
data.files = $.makeArray(data.files);
|
1557 |
+
this._onAdd(null, data);
|
1558 |
+
}
|
1559 |
+
},
|
1560 |
+
|
1561 |
+
// This method is exposed to the widget API and allows sending files
|
1562 |
+
// using the fileupload API. The data parameter accepts an object which
|
1563 |
+
// must have a files or fileInput property and can contain additional options:
|
1564 |
+
// .fileupload('send', {files: filesList});
|
1565 |
+
// The method returns a Promise object for the file upload call.
|
1566 |
+
send: function(data) {
|
1567 |
+
if (data && !this.options.disabled) {
|
1568 |
+
if (data.fileInput && !data.files) {
|
1569 |
+
var that = this,
|
1570 |
+
dfd = $.Deferred(),
|
1571 |
+
promise = dfd.promise(),
|
1572 |
+
jqXHR,
|
1573 |
+
aborted;
|
1574 |
+
promise.abort = function() {
|
1575 |
+
aborted = true;
|
1576 |
+
if (jqXHR) {
|
1577 |
+
return jqXHR.abort();
|
1578 |
}
|
1579 |
+
dfd.reject(null, 'abort', 'abort');
|
1580 |
+
return promise;
|
1581 |
+
};
|
1582 |
+
this._getFileInputFiles(data.fileInput).always(function(files) {
|
1583 |
+
if (aborted) {
|
1584 |
+
return;
|
1585 |
}
|
1586 |
+
if (!files.length) {
|
1587 |
+
dfd.reject();
|
1588 |
+
return;
|
1589 |
}
|
1590 |
+
data.files = files;
|
1591 |
+
jqXHR = that._onSend(null, data);
|
1592 |
+
jqXHR.then(
|
1593 |
+
function(result, textStatus, jqXHR) {
|
1594 |
+
dfd.resolve(result, textStatus, jqXHR);
|
1595 |
+
},
|
1596 |
+
function(jqXHR, textStatus, errorThrown) {
|
1597 |
+
dfd.reject(jqXHR, textStatus, errorThrown);
|
1598 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1599 |
);
|
1600 |
+
});
|
1601 |
+
return this._enhancePromise(promise);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1602 |
}
|
1603 |
+
data.files = $.makeArray(data.files);
|
1604 |
+
if (data.files.length) {
|
1605 |
+
return this._onSend(null, data);
|
1606 |
+
}
|
1607 |
+
}
|
1608 |
+
return this._getXHRPromise(false, data && data.context);
|
1609 |
+
}
|
1610 |
+
});
|
1611 |
+
});
|
filemanager/js/jq_uploader/jquery.iframe-transport.js
CHANGED
@@ -9,216 +9,213 @@
|
|
9 |
* https://opensource.org/licenses/MIT
|
10 |
*/
|
11 |
|
12 |
-
/* global define, require
|
13 |
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
}(function
|
27 |
-
|
28 |
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
} catch (e) {
|
101 |
-
response = undefined;
|
102 |
-
}
|
103 |
-
// The complete callback returns the
|
104 |
-
// iframe content document as response object:
|
105 |
-
completeCallback(
|
106 |
-
200,
|
107 |
-
'success',
|
108 |
-
{'iframe': response}
|
109 |
-
);
|
110 |
-
// Fix for IE endless progress bar activity bug
|
111 |
-
// (happens on form submits to iframe targets):
|
112 |
-
$('<iframe src="' + initialIframeSrc + '"></iframe>')
|
113 |
-
.appendTo(form);
|
114 |
-
window.setTimeout(function () {
|
115 |
-
// Removing the form in a setTimeout call
|
116 |
-
// allows Chrome's developer tools to display
|
117 |
-
// the response result
|
118 |
-
form.remove();
|
119 |
-
}, 0);
|
120 |
-
});
|
121 |
-
form
|
122 |
-
.prop('target', iframe.prop('name'))
|
123 |
-
.prop('action', options.url)
|
124 |
-
.prop('method', options.type);
|
125 |
-
if (options.formData) {
|
126 |
-
$.each(options.formData, function (index, field) {
|
127 |
-
$('<input type="hidden"/>')
|
128 |
-
.prop('name', field.name)
|
129 |
-
.val(field.value)
|
130 |
-
.appendTo(form);
|
131 |
-
});
|
132 |
-
}
|
133 |
-
if (options.fileInput && options.fileInput.length &&
|
134 |
-
options.type === 'POST') {
|
135 |
-
fileInputClones = options.fileInput.clone();
|
136 |
-
// Insert a clone for each file input field:
|
137 |
-
options.fileInput.after(function (index) {
|
138 |
-
return fileInputClones[index];
|
139 |
-
});
|
140 |
-
if (options.paramName) {
|
141 |
-
options.fileInput.each(function (index) {
|
142 |
-
$(this).prop(
|
143 |
-
'name',
|
144 |
-
paramNames[index] || options.paramName
|
145 |
-
);
|
146 |
-
});
|
147 |
-
}
|
148 |
-
// Appending the file input fields to the hidden form
|
149 |
-
// removes them from their original location:
|
150 |
-
form
|
151 |
-
.append(options.fileInput)
|
152 |
-
.prop('enctype', 'multipart/form-data')
|
153 |
-
// enctype must be set as encoding for IE:
|
154 |
-
.prop('encoding', 'multipart/form-data');
|
155 |
-
// Remove the HTML5 form attribute from the input(s):
|
156 |
-
options.fileInput.removeAttr('form');
|
157 |
-
}
|
158 |
-
form.submit();
|
159 |
-
// Insert the file input fields at their original location
|
160 |
-
// by replacing the clones with the originals:
|
161 |
-
if (fileInputClones && fileInputClones.length) {
|
162 |
-
options.fileInput.each(function (index, input) {
|
163 |
-
var clone = $(fileInputClones[index]);
|
164 |
-
// Restore the original name and form properties:
|
165 |
-
$(input)
|
166 |
-
.prop('name', clone.prop('name'))
|
167 |
-
.attr('form', clone.attr('form'));
|
168 |
-
clone.replaceWith(input);
|
169 |
-
});
|
170 |
-
}
|
171 |
-
});
|
172 |
-
form.append(iframe).appendTo(document.body);
|
173 |
-
},
|
174 |
-
abort: function () {
|
175 |
-
if (iframe) {
|
176 |
-
// javascript:false as iframe src aborts the request
|
177 |
-
// and prevents warning popups on HTTPS in IE6.
|
178 |
-
// concat is used to avoid the "Script URL" JSLint error:
|
179 |
-
iframe
|
180 |
-
.unbind('load')
|
181 |
-
.prop('src', initialIframeSrc);
|
182 |
-
}
|
183 |
-
if (form) {
|
184 |
-
form.remove();
|
185 |
-
}
|
186 |
}
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
$(xmlDoc.body).html());
|
217 |
-
},
|
218 |
-
'iframe script': function (iframe) {
|
219 |
-
return iframe && $.globalEval($(iframe[0].body).text());
|
220 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
221 |
}
|
222 |
-
|
|
|
|
|
223 |
|
224 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
* https://opensource.org/licenses/MIT
|
10 |
*/
|
11 |
|
12 |
+
/* global define, require */
|
13 |
|
14 |
+
(function(factory) {
|
15 |
+
'use strict';
|
16 |
+
if (typeof define === 'function' && define.amd) {
|
17 |
+
// Register as an anonymous AMD module:
|
18 |
+
define(['jquery'], factory);
|
19 |
+
} else if (typeof exports === 'object') {
|
20 |
+
// Node/CommonJS:
|
21 |
+
factory(require('jquery'));
|
22 |
+
} else {
|
23 |
+
// Browser globals:
|
24 |
+
factory(window.jQuery);
|
25 |
+
}
|
26 |
+
})(function($) {
|
27 |
+
'use strict';
|
28 |
|
29 |
+
// Helper variable to create unique names for the transport iframes:
|
30 |
+
var counter = 0,
|
31 |
+
jsonAPI = $,
|
32 |
+
jsonParse = 'parseJSON';
|
33 |
|
34 |
+
if ('JSON' in window && 'parse' in JSON) {
|
35 |
+
jsonAPI = JSON;
|
36 |
+
jsonParse = 'parse';
|
37 |
+
}
|
38 |
|
39 |
+
// The iframe transport accepts four additional options:
|
40 |
+
// options.fileInput: a jQuery collection of file input fields
|
41 |
+
// options.paramName: the parameter name for the file form data,
|
42 |
+
// overrides the name property of the file input field(s),
|
43 |
+
// can be a string or an array of strings.
|
44 |
+
// options.formData: an array of objects with name and value properties,
|
45 |
+
// equivalent to the return data of .serializeArray(), e.g.:
|
46 |
+
// [{name: 'a', value: 1}, {name: 'b', value: 2}]
|
47 |
+
// options.initialIframeSrc: the URL of the initial iframe src,
|
48 |
+
// by default set to "javascript:false;"
|
49 |
+
$.ajaxTransport('iframe', function(options) {
|
50 |
+
if (options.async) {
|
51 |
+
// javascript:false as initial iframe src
|
52 |
+
// prevents warning popups on HTTPS in IE6:
|
53 |
+
// eslint-disable-next-line no-script-url
|
54 |
+
var initialIframeSrc = options.initialIframeSrc || 'javascript:false;',
|
55 |
+
form,
|
56 |
+
iframe,
|
57 |
+
addParamChar;
|
58 |
+
return {
|
59 |
+
send: function(_, completeCallback) {
|
60 |
+
form = $('<form style="display:none;"></form>');
|
61 |
+
form.attr('accept-charset', options.formAcceptCharset);
|
62 |
+
addParamChar = /\?/.test(options.url) ? '&' : '?';
|
63 |
+
// XDomainRequest only supports GET and POST:
|
64 |
+
if (options.type === 'DELETE') {
|
65 |
+
options.url = options.url + addParamChar + '_method=DELETE';
|
66 |
+
options.type = 'POST';
|
67 |
+
} else if (options.type === 'PUT') {
|
68 |
+
options.url = options.url + addParamChar + '_method=PUT';
|
69 |
+
options.type = 'POST';
|
70 |
+
} else if (options.type === 'PATCH') {
|
71 |
+
options.url = options.url + addParamChar + '_method=PATCH';
|
72 |
+
options.type = 'POST';
|
73 |
+
}
|
74 |
+
// IE versions below IE8 cannot set the name property of
|
75 |
+
// elements that have already been added to the DOM,
|
76 |
+
// so we set the name along with the iframe HTML markup:
|
77 |
+
counter += 1;
|
78 |
+
iframe = $(
|
79 |
+
'<iframe src="' +
|
80 |
+
initialIframeSrc +
|
81 |
+
'" name="iframe-transport-' +
|
82 |
+
counter +
|
83 |
+
'"></iframe>'
|
84 |
+
).bind('load', function() {
|
85 |
+
var fileInputClones,
|
86 |
+
paramNames = $.isArray(options.paramName)
|
87 |
+
? options.paramName
|
88 |
+
: [options.paramName];
|
89 |
+
iframe.unbind('load').bind('load', function() {
|
90 |
+
var response;
|
91 |
+
// Wrap in a try/catch block to catch exceptions thrown
|
92 |
+
// when trying to access cross-domain iframe contents:
|
93 |
+
try {
|
94 |
+
response = iframe.contents();
|
95 |
+
// Google Chrome and Firefox do not throw an
|
96 |
+
// exception when calling iframe.contents() on
|
97 |
+
// cross-domain requests, so we unify the response:
|
98 |
+
if (!response.length || !response[0].firstChild) {
|
99 |
+
throw new Error();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
100 |
}
|
101 |
+
} catch (e) {
|
102 |
+
response = undefined;
|
103 |
+
}
|
104 |
+
// The complete callback returns the
|
105 |
+
// iframe content document as response object:
|
106 |
+
completeCallback(200, 'success', { iframe: response });
|
107 |
+
// Fix for IE endless progress bar activity bug
|
108 |
+
// (happens on form submits to iframe targets):
|
109 |
+
$('<iframe src="' + initialIframeSrc + '"></iframe>').appendTo(
|
110 |
+
form
|
111 |
+
);
|
112 |
+
window.setTimeout(function() {
|
113 |
+
// Removing the form in a setTimeout call
|
114 |
+
// allows Chrome's developer tools to display
|
115 |
+
// the response result
|
116 |
+
form.remove();
|
117 |
+
}, 0);
|
118 |
+
});
|
119 |
+
form
|
120 |
+
.prop('target', iframe.prop('name'))
|
121 |
+
.prop('action', options.url)
|
122 |
+
.prop('method', options.type);
|
123 |
+
if (options.formData) {
|
124 |
+
$.each(options.formData, function(index, field) {
|
125 |
+
$('<input type="hidden"/>')
|
126 |
+
.prop('name', field.name)
|
127 |
+
.val(field.value)
|
128 |
+
.appendTo(form);
|
129 |
+
});
|
|
|
|
|
|
|
|
|
130 |
}
|
131 |
+
if (
|
132 |
+
options.fileInput &&
|
133 |
+
options.fileInput.length &&
|
134 |
+
options.type === 'POST'
|
135 |
+
) {
|
136 |
+
fileInputClones = options.fileInput.clone();
|
137 |
+
// Insert a clone for each file input field:
|
138 |
+
options.fileInput.after(function(index) {
|
139 |
+
return fileInputClones[index];
|
140 |
+
});
|
141 |
+
if (options.paramName) {
|
142 |
+
options.fileInput.each(function(index) {
|
143 |
+
$(this).prop('name', paramNames[index] || options.paramName);
|
144 |
+
});
|
145 |
+
}
|
146 |
+
// Appending the file input fields to the hidden form
|
147 |
+
// removes them from their original location:
|
148 |
+
form
|
149 |
+
.append(options.fileInput)
|
150 |
+
.prop('enctype', 'multipart/form-data')
|
151 |
+
// enctype must be set as encoding for IE:
|
152 |
+
.prop('encoding', 'multipart/form-data');
|
153 |
+
// Remove the HTML5 form attribute from the input(s):
|
154 |
+
options.fileInput.removeAttr('form');
|
155 |
+
}
|
156 |
+
form.submit();
|
157 |
+
// Insert the file input fields at their original location
|
158 |
+
// by replacing the clones with the originals:
|
159 |
+
if (fileInputClones && fileInputClones.length) {
|
160 |
+
options.fileInput.each(function(index, input) {
|
161 |
+
var clone = $(fileInputClones[index]);
|
162 |
+
// Restore the original name and form properties:
|
163 |
+
$(input)
|
164 |
+
.prop('name', clone.prop('name'))
|
165 |
+
.attr('form', clone.attr('form'));
|
166 |
+
clone.replaceWith(input);
|
167 |
+
});
|
168 |
+
}
|
169 |
+
});
|
170 |
+
form.append(iframe).appendTo(document.body);
|
171 |
+
},
|
172 |
+
abort: function() {
|
173 |
+
if (iframe) {
|
174 |
+
// javascript:false as iframe src aborts the request
|
175 |
+
// and prevents warning popups on HTTPS in IE6.
|
176 |
+
iframe.unbind('load').prop('src', initialIframeSrc);
|
177 |
+
}
|
178 |
+
if (form) {
|
179 |
+
form.remove();
|
180 |
+
}
|
181 |
}
|
182 |
+
};
|
183 |
+
}
|
184 |
+
});
|
185 |
|
186 |
+
// The iframe transport returns the iframe content document as response.
|
187 |
+
// The following adds converters from iframe to text, json, html, xml
|
188 |
+
// and script.
|
189 |
+
// Please note that the Content-Type for JSON responses has to be text/plain
|
190 |
+
// or text/html, if the browser doesn't include application/json in the
|
191 |
+
// Accept header, else IE will show a download dialog.
|
192 |
+
// The Content-Type for XML responses on the other hand has to be always
|
193 |
+
// application/xml or text/xml, so IE properly parses the XML response.
|
194 |
+
// See also
|
195 |
+
// https://github.com/blueimp/jQuery-File-Upload/wiki/Setup#content-type-negotiation
|
196 |
+
$.ajaxSetup({
|
197 |
+
converters: {
|
198 |
+
'iframe text': function(iframe) {
|
199 |
+
return iframe && $(iframe[0].body).text();
|
200 |
+
},
|
201 |
+
'iframe json': function(iframe) {
|
202 |
+
return iframe && jsonAPI[jsonParse]($(iframe[0].body).text());
|
203 |
+
},
|
204 |
+
'iframe html': function(iframe) {
|
205 |
+
return iframe && $(iframe[0].body).html();
|
206 |
+
},
|
207 |
+
'iframe xml': function(iframe) {
|
208 |
+
var xmlDoc = iframe && iframe[0];
|
209 |
+
return xmlDoc && $.isXMLDoc(xmlDoc)
|
210 |
+
? xmlDoc
|
211 |
+
: $.parseXML(
|
212 |
+
(xmlDoc.XMLDocument && xmlDoc.XMLDocument.xml) ||
|
213 |
+
$(xmlDoc.body).html()
|
214 |
+
);
|
215 |
+
},
|
216 |
+
'iframe script': function(iframe) {
|
217 |
+
return iframe && $.globalEval($(iframe[0].body).text());
|
218 |
+
}
|
219 |
+
}
|
220 |
+
});
|
221 |
+
});
|
filemanager/view.php
CHANGED
@@ -59,8 +59,8 @@ class FilemanagerView {
|
|
59 |
wp_print_styles('wp-auth-check');
|
60 |
wp_print_styles('wp-pointer');
|
61 |
?>
|
62 |
-
<script src="<?php echo BWG()->plugin_url; ?>/filemanager/js/jq_uploader/jquery.iframe-transport.js?v=
|
63 |
-
<script src="<?php echo BWG()->plugin_url; ?>/filemanager/js/jq_uploader/jquery.fileupload.js?v=
|
64 |
<script>
|
65 |
var DS = "<?php echo addslashes('/'); ?>";
|
66 |
var demo_message = "<?php echo addslashes(__('This option is disabled in demo.', BWG()->prefix)); ?>";
|
59 |
wp_print_styles('wp-auth-check');
|
60 |
wp_print_styles('wp-pointer');
|
61 |
?>
|
62 |
+
<script src="<?php echo BWG()->plugin_url; ?>/filemanager/js/jq_uploader/jquery.iframe-transport.js?v=10.0.0"></script>
|
63 |
+
<script src="<?php echo BWG()->plugin_url; ?>/filemanager/js/jq_uploader/jquery.fileupload.js?v=10.0.0"></script>
|
64 |
<script>
|
65 |
var DS = "<?php echo addslashes('/'); ?>";
|
66 |
var demo_message = "<?php echo addslashes(__('This option is disabled in demo.', BWG()->prefix)); ?>";
|
framework/WDWLibrary.php
CHANGED
@@ -10,11 +10,11 @@ class WDWLibrary {
|
|
10 |
*
|
11 |
* @param string $key
|
12 |
* @param string $default_value
|
13 |
-
* @param
|
14 |
*
|
15 |
* @return string|array
|
16 |
*/
|
17 |
-
public static function get($key, $default_value = '', $
|
18 |
if (isset($_GET[$key])) {
|
19 |
$value = $_GET[$key];
|
20 |
}
|
@@ -28,11 +28,12 @@ class WDWLibrary {
|
|
28 |
$value = $default_value;
|
29 |
}
|
30 |
if (is_array($value)) {
|
31 |
-
array_walk_recursive($value, array('self', 'validate_data'), $
|
32 |
}
|
33 |
else {
|
34 |
-
self::validate_data($value, $
|
35 |
}
|
|
|
36 |
return $value;
|
37 |
}
|
38 |
|
@@ -40,12 +41,12 @@ class WDWLibrary {
|
|
40 |
* Validate data.
|
41 |
*
|
42 |
* @param $value
|
43 |
-
* @param $
|
44 |
*/
|
45 |
-
private static function validate_data(&$value, $
|
46 |
$value = stripslashes($value);
|
47 |
-
if ($
|
48 |
-
$value =
|
49 |
}
|
50 |
}
|
51 |
|
@@ -617,8 +618,8 @@ class WDWLibrary {
|
|
617 |
}
|
618 |
?>
|
619 |
<span class="pagination-links">
|
620 |
-
<a class="<?php echo $first_page; ?>" title="Go to the first page" onclick="spider_page(<?php echo $page_number; ?>,-2)">«</a>
|
621 |
-
<a class="<?php echo $prev_page; ?>" title="Go to the previous page" onclick="spider_page(<?php echo $page_number; ?>,-1)">‹</a>
|
622 |
<span class="paging-input">
|
623 |
<span class="total-pages">
|
624 |
<input class="current_page" id="current_page" name="current_page" value="<?php echo $page_number; ?>" onkeypress="return check_enter_key(event, this)" title="Go to the page" type="text" size="1" />
|
@@ -627,8 +628,8 @@ class WDWLibrary {
|
|
627 |
<?php echo $items_county; ?>
|
628 |
</span>
|
629 |
</span>
|
630 |
-
<a class="<?php echo $next_page ?>" title="Go to the next page" onclick="spider_page(<?php echo $page_number; ?>,1)">›</a>
|
631 |
-
<a class="<?php echo $last_page ?>" title="Go to the last page" onclick="spider_page(<?php echo $page_number; ?>,2)">»</a>
|
632 |
<?php
|
633 |
}
|
634 |
?>
|
@@ -1782,7 +1783,7 @@ class WDWLibrary {
|
|
1782 |
$use_option_defaults = (isset($params['use_option_defaults']) && $params['use_option_defaults'] == 1) ? TRUE : FALSE;
|
1783 |
$from = (isset($params['from']) && $params['from'] == 'widget' ) ? TRUE : FALSE;
|
1784 |
$defaults = array(
|
1785 |
-
'gallery_type' => $params['gallery_type'],
|
1786 |
'gallery_id' => isset($params['gallery_id']) ? $params['gallery_id'] : 0,
|
1787 |
'gal_title' => isset($params['gal_title']) ? $params['gal_title'] : '',
|
1788 |
'album_id' => isset($params['album_id']) ? $params['album_id'] : 0,
|
@@ -1840,7 +1841,7 @@ class WDWLibrary {
|
|
1840 |
$defaults['popup_enable_tumblr'] = (bool) self::get_option_value('popup_enable_tumblr', 'popup_enable_tumblr', 'popup_enable_tumblr', $from || $use_option_defaults, $params);
|
1841 |
$defaults['popup_enable_ecommerce'] = (bool) self::get_option_value('popup_enable_ecommerce', 'popup_enable_ecommerce', 'popup_enable_ecommerce', $from || $use_option_defaults, $params);
|
1842 |
|
1843 |
-
switch ($
|
1844 |
case 'thumbnails': {
|
1845 |
$defaults['thumb_width'] = self::get_option_value('thumb_width', 'thumb_width', 'thumb_width', $use_option_defaults, $params);
|
1846 |
$defaults['thumb_height'] = self::get_option_value('thumb_height', 'thumb_height', 'thumb_height', $use_option_defaults, $params);
|
@@ -1867,7 +1868,7 @@ class WDWLibrary {
|
|
1867 |
$defaults['masonry_hor_ver'] = self::get_option_value('masonry_hor_ver', 'masonry_hor_ver', 'masonry', $use_option_defaults, $params);
|
1868 |
$defaults['show_masonry_thumb_description'] = self::get_option_value('show_masonry_thumb_description', 'show_masonry_thumb_description', 'show_masonry_thumb_description', $use_option_defaults, $params);
|
1869 |
$defaults['thumb_width'] = self::get_option_value('masonry_thumb_size', 'thumb_width', 'masonry_thumb_size', $use_option_defaults, $params);
|
1870 |
-
$defaults['thumb_height'] = self::get_option_value('
|
1871 |
$defaults['image_column_number'] = abs(intval(self::get_option_value('masonry_image_column_number', 'image_column_number', 'masonry_image_column_number', $use_option_defaults, $params)));
|
1872 |
$defaults['image_enable_page'] = self::get_option_value('masonry_image_enable_page', 'image_enable_page', 'masonry_image_enable_page', $use_option_defaults, $params);
|
1873 |
$defaults['images_per_page'] = abs(intval(self::get_option_value('masonry_images_per_page', 'images_per_page', 'masonry_images_per_page', $use_option_defaults, $params)));
|
@@ -2660,7 +2661,7 @@ class WDWLibrary {
|
|
2660 |
<ul class="bwg-breadcrumbs">
|
2661 |
<?php
|
2662 |
foreach ( $menus as $key => $item ) {
|
2663 |
-
if (
|
2664 |
continue;
|
2665 |
}
|
2666 |
?>
|
10 |
*
|
11 |
* @param string $key
|
12 |
* @param string $default_value
|
13 |
+
* @param string $callback
|
14 |
*
|
15 |
* @return string|array
|
16 |
*/
|
17 |
+
public static function get($key, $default_value = '', $callback = 'esc_html') {
|
18 |
if (isset($_GET[$key])) {
|
19 |
$value = $_GET[$key];
|
20 |
}
|
28 |
$value = $default_value;
|
29 |
}
|
30 |
if (is_array($value)) {
|
31 |
+
array_walk_recursive($value, array('self', 'validate_data'), $callback);
|
32 |
}
|
33 |
else {
|
34 |
+
self::validate_data($value, $callback);
|
35 |
}
|
36 |
+
|
37 |
return $value;
|
38 |
}
|
39 |
|
41 |
* Validate data.
|
42 |
*
|
43 |
* @param $value
|
44 |
+
* @param $callback
|
45 |
*/
|
46 |
+
private static function validate_data(&$value, $callback) {
|
47 |
$value = stripslashes($value);
|
48 |
+
if ( $callback ) {
|
49 |
+
$value = $callback($value);
|
50 |
}
|
51 |
}
|
52 |
|
618 |
}
|
619 |
?>
|
620 |
<span class="pagination-links">
|
621 |
+
<a class="bwg-a <?php echo $first_page; ?>" title="Go to the first page" onclick="spider_page(<?php echo $page_number; ?>,-2)">«</a>
|
622 |
+
<a class="bwg-a <?php echo $prev_page; ?>" title="Go to the previous page" onclick="spider_page(<?php echo $page_number; ?>,-1)">‹</a>
|
623 |
<span class="paging-input">
|
624 |
<span class="total-pages">
|
625 |
<input class="current_page" id="current_page" name="current_page" value="<?php echo $page_number; ?>" onkeypress="return check_enter_key(event, this)" title="Go to the page" type="text" size="1" />
|
628 |
<?php echo $items_county; ?>
|
629 |
</span>
|
630 |
</span>
|
631 |
+
<a class="bwg-a <?php echo $next_page ?>" title="Go to the next page" onclick="spider_page(<?php echo $page_number; ?>,1)">›</a>
|
632 |
+
<a class="bwg-a <?php echo $last_page ?>" title="Go to the last page" onclick="spider_page(<?php echo $page_number; ?>,2)">»</a>
|
633 |
<?php
|
634 |
}
|
635 |
?>
|
1783 |
$use_option_defaults = (isset($params['use_option_defaults']) && $params['use_option_defaults'] == 1) ? TRUE : FALSE;
|
1784 |
$from = (isset($params['from']) && $params['from'] == 'widget' ) ? TRUE : FALSE;
|
1785 |
$defaults = array(
|
1786 |
+
'gallery_type' => isset($params['gallery_type']) ? $params['gallery_type'] : 'thumbnails',
|
1787 |
'gallery_id' => isset($params['gallery_id']) ? $params['gallery_id'] : 0,
|
1788 |
'gal_title' => isset($params['gal_title']) ? $params['gal_title'] : '',
|
1789 |
'album_id' => isset($params['album_id']) ? $params['album_id'] : 0,
|
1841 |
$defaults['popup_enable_tumblr'] = (bool) self::get_option_value('popup_enable_tumblr', 'popup_enable_tumblr', 'popup_enable_tumblr', $from || $use_option_defaults, $params);
|
1842 |
$defaults['popup_enable_ecommerce'] = (bool) self::get_option_value('popup_enable_ecommerce', 'popup_enable_ecommerce', 'popup_enable_ecommerce', $from || $use_option_defaults, $params);
|
1843 |
|
1844 |
+
switch ($defaults['gallery_type']) {
|
1845 |
case 'thumbnails': {
|
1846 |
$defaults['thumb_width'] = self::get_option_value('thumb_width', 'thumb_width', 'thumb_width', $use_option_defaults, $params);
|
1847 |
$defaults['thumb_height'] = self::get_option_value('thumb_height', 'thumb_height', 'thumb_height', $use_option_defaults, $params);
|
1868 |
$defaults['masonry_hor_ver'] = self::get_option_value('masonry_hor_ver', 'masonry_hor_ver', 'masonry', $use_option_defaults, $params);
|
1869 |
$defaults['show_masonry_thumb_description'] = self::get_option_value('show_masonry_thumb_description', 'show_masonry_thumb_description', 'show_masonry_thumb_description', $use_option_defaults, $params);
|
1870 |
$defaults['thumb_width'] = self::get_option_value('masonry_thumb_size', 'thumb_width', 'masonry_thumb_size', $use_option_defaults, $params);
|
1871 |
+
$defaults['thumb_height'] = self::get_option_value('thumb_height', 'thumb_height', 'thumb_height', $use_option_defaults, $params);
|
1872 |
$defaults['image_column_number'] = abs(intval(self::get_option_value('masonry_image_column_number', 'image_column_number', 'masonry_image_column_number', $use_option_defaults, $params)));
|
1873 |
$defaults['image_enable_page'] = self::get_option_value('masonry_image_enable_page', 'image_enable_page', 'masonry_image_enable_page', $use_option_defaults, $params);
|
1874 |
$defaults['images_per_page'] = abs(intval(self::get_option_value('masonry_images_per_page', 'images_per_page', 'masonry_images_per_page', $use_option_defaults, $params)));
|
2661 |
<ul class="bwg-breadcrumbs">
|
2662 |
<?php
|
2663 |
foreach ( $menus as $key => $item ) {
|
2664 |
+
if ( BWG()->is_pro && $key == 'pricing' ) {
|
2665 |
continue;
|
2666 |
}
|
2667 |
?>
|
framework/WDWSitemap.php
ADDED
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
|
4 |
+
final class WDWSitemap {
|
5 |
+
/**
|
6 |
+
* The single instance of the class.
|
7 |
+
*/
|
8 |
+
protected static $_instance = null;
|
9 |
+
|
10 |
+
private $images;
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Main WDWSitemap Instance.
|
14 |
+
*
|
15 |
+
* Ensures only one instance is loaded or can be loaded.
|
16 |
+
*
|
17 |
+
* @static
|
18 |
+
* @return BWG - Main instance.
|
19 |
+
*/
|
20 |
+
public static function instance() {
|
21 |
+
if ( is_null( self::$_instance ) ) {
|
22 |
+
self::$_instance = new self();
|
23 |
+
}
|
24 |
+
return self::$_instance;
|
25 |
+
}
|
26 |
+
|
27 |
+
public function add_wpseo_xml_sitemap_images( $images, $post_id ) {
|
28 |
+
$this->images = $images;
|
29 |
+
|
30 |
+
$post = get_post($post_id);
|
31 |
+
|
32 |
+
remove_all_shortcodes();
|
33 |
+
add_shortcode('Best_Wordpress_Gallery', array($this, 'shortcode'));
|
34 |
+
do_shortcode($post->post_content);
|
35 |
+
if ( defined('ELEMENTOR_VERSION') ) {
|
36 |
+
\Elementor\Plugin::instance()->frontend->get_builder_content($post->ID);
|
37 |
+
}
|
38 |
+
|
39 |
+
return $this->images;
|
40 |
+
}
|
41 |
+
|
42 |
+
public function shortcode( $params = array() ) {
|
43 |
+
if ( isset($params['id']) && $params['id'] ) {
|
44 |
+
global $wpdb;
|
45 |
+
$shortcode = $wpdb->get_var($wpdb->prepare("SELECT tagtext FROM " . $wpdb->prefix . "bwg_shortcode WHERE id='%d'", $params['id']));
|
46 |
+
if ($shortcode) {
|
47 |
+
$shortcode_params = explode('" ', $shortcode);
|
48 |
+
foreach ($shortcode_params as $shortcode_param) {
|
49 |
+
$shortcode_param = str_replace('"', '', $shortcode_param);
|
50 |
+
$shortcode_elem = explode('=', $shortcode_param);
|
51 |
+
$params[str_replace(' ', '', $shortcode_elem[0])] = $shortcode_elem[1];
|
52 |
+
}
|
53 |
+
}
|
54 |
+
else {
|
55 |
+
return;
|
56 |
+
}
|
57 |
+
}
|
58 |
+
|
59 |
+
// 'gallery_type' is the only parameter not being checked.
|
60 |
+
// Checking for incomplete shortcodes.
|
61 |
+
$gallery_allowed_types = array(
|
62 |
+
'thumbnails',
|
63 |
+
'thumbnails_masonry',
|
64 |
+
'thumbnails_mosaic',
|
65 |
+
'slideshow',
|
66 |
+
'image_browser',
|
67 |
+
'blog_style',
|
68 |
+
'carousel',
|
69 |
+
'album_compact_preview',
|
70 |
+
'album_masonry_preview',
|
71 |
+
'album_extended_preview',
|
72 |
+
);
|
73 |
+
if ( isset($params['gallery_type']) && in_array($params['gallery_type'], $gallery_allowed_types) ) {
|
74 |
+
$pairs = WDWLibrary::get_shortcode_option_params( $params );
|
75 |
+
if ( isset($params['ajax']) ) {
|
76 |
+
$pairs['ajax'] = $params['ajax'];
|
77 |
+
}
|
78 |
+
$images = $this->get_shortcode_images( $pairs );
|
79 |
+
foreach ( $images as $image ) {
|
80 |
+
if ( strpos($image->filetype, 'EMBED') === FALSE ) {
|
81 |
+
$this->images[] = array(
|
82 |
+
'src' => BWG()->upload_url . $image->image_url_raw,
|
83 |
+
'title' => $image->alt,
|
84 |
+
'alt' => $image->alt
|
85 |
+
);
|
86 |
+
}
|
87 |
+
}
|
88 |
+
}
|
89 |
+
}
|
90 |
+
|
91 |
+
private function get_shortcode_images( $params ) {
|
92 |
+
require_once(BWG()->plugin_dir . '/framework/WDWLibraryEmbed.php');
|
93 |
+
require_once(BWG()->plugin_dir . '/frontend/controllers/controller.php');
|
94 |
+
$controller = new BWGControllerSite( ucfirst( $params[ 'gallery_type' ] ) );
|
95 |
+
return $controller->execute($params, 'xml_sitemap');
|
96 |
+
}
|
97 |
+
}
|
framework/howto/data.php
CHANGED
@@ -53,20 +53,20 @@ $howto = array(
|
|
53 |
'description' => '',
|
54 |
'content' => array(
|
55 |
1 => array(
|
56 |
-
'title' => __('Click Photo Gallery Button', BWG()->prefix),
|
57 |
-
'content' => __('
|
58 |
'screenshot' => BWG()->plugin_url . '/framework/howto/screenshots/2_1.png',
|
59 |
'function' => ''
|
60 |
),
|
61 |
2 => array(
|
62 |
-
'title' => __('Configure and Insert', BWG()->prefix),
|
63 |
-
'content' => __('
|
64 |
'screenshot' => BWG()->plugin_url . '/framework/howto/screenshots/2_2.png',
|
65 |
'function' => ''
|
66 |
),
|
67 |
3 => array(
|
68 |
-
'title' => __('Congrats
|
69 |
-
'content' => __('You
|
70 |
'screenshot' => BWG()->plugin_url . '/framework/howto/screenshots/2_3.png',
|
71 |
'function' => ''
|
72 |
),
|
53 |
'description' => '',
|
54 |
'content' => array(
|
55 |
1 => array(
|
56 |
+
'title' => __('Click the Photo Gallery Button', BWG()->prefix),
|
57 |
+
'content' => __('Head to the page/post you want to insert a gallery in. In the Gutenberg editor, click “add block” then click the Photo Gallery button.', BWG()->prefix),
|
58 |
'screenshot' => BWG()->plugin_url . '/framework/howto/screenshots/2_1.png',
|
59 |
'function' => ''
|
60 |
),
|
61 |
2 => array(
|
62 |
+
'title' => __('Configure and Insert Gallery', BWG()->prefix),
|
63 |
+
'content' => __('From the window that follows, select which gallery to insert, its layout, and configure its options. Click “Insert Into Post” to add your selected gallery to the post/page.', BWG()->prefix),
|
64 |
'screenshot' => BWG()->plugin_url . '/framework/howto/screenshots/2_2.png',
|
65 |
'function' => ''
|
66 |
),
|
67 |
3 => array(
|
68 |
+
'title' => __('Congrats!', BWG()->prefix),
|
69 |
+
'content' => __('You’ve successfully inserted your gallery to your post/page. Click the Photo Gallery icon in your editor to make any further changes to your gallery.', BWG()->prefix),
|
70 |
'screenshot' => BWG()->plugin_url . '/framework/howto/screenshots/2_3.png',
|
71 |
'function' => ''
|
72 |
),
|
frontend/controllers/controller.php
CHANGED
@@ -20,26 +20,25 @@ class BWGControllerSite {
|
|
20 |
public function execute( $params = array(), $from_shortcode = 0, $bwg = 0 ) {
|
21 |
$theme_id = $params['theme_id'];
|
22 |
$theme_row = $this->model->get_theme_row_data($theme_id);
|
23 |
-
|
24 |
|
25 |
-
if (
|
26 |
$params['type'] = '';
|
27 |
}
|
28 |
|
29 |
-
if (
|
30 |
$sort_by = esc_html($_POST['sortImagesByValue_' . $bwg]);
|
31 |
-
if (
|
32 |
$params['sort_by'] = 'RAND()';
|
33 |
-
}
|
34 |
-
|
35 |
-
if ( in_array($sort_by, array('default', 'filename', 'size')) ) {
|
36 |
$params['sort_by'] = $sort_by;
|
37 |
}
|
38 |
}
|
39 |
}
|
40 |
|
41 |
if ( strpos($params['gallery_type'], 'album') !== FALSE ) { //Album views (compact/masonry/extended).
|
42 |
-
|
43 |
$params['view_type'] = 'album';
|
44 |
|
45 |
// Type in album view (album or gallery).
|
@@ -49,7 +48,7 @@ class BWGControllerSite {
|
|
49 |
$params['album_gallery_id'] = (isset($_REQUEST['album_gallery_id_' . $bwg]) ? esc_html($_REQUEST['album_gallery_id_' . $bwg]) : $params['album_id']);
|
50 |
$params['cur_alb_gal_id'] = $params['album_gallery_id'];
|
51 |
|
52 |
-
if (
|
53 |
// Gallery type in album (thumbnail/masonry/mosaic).
|
54 |
$params['gallery_view_type'] = $params['compuct_album_view_type'];
|
55 |
$params['image_enable_page'] = $params['compuct_album_enable_page'];
|
@@ -60,8 +59,7 @@ class BWGControllerSite {
|
|
60 |
$theme_row->back_font_style = $theme_row->album_compact_back_font_style;
|
61 |
$theme_row->back_font_weight = $theme_row->album_compact_back_font_weight;
|
62 |
$theme_row->back_font_color = $theme_row->album_compact_back_font_color;
|
63 |
-
}
|
64 |
-
elseif ( isset($params['extended_album_image_thumb_width']) ) { // Extended album view.
|
65 |
// Gallery type in album (thumbnail/masonry/mosaic).
|
66 |
$params['gallery_view_type'] = $params['extended_album_view_type'];
|
67 |
$params['image_enable_page'] = $params['extended_album_enable_page'];
|
@@ -72,8 +70,7 @@ class BWGControllerSite {
|
|
72 |
$theme_row->back_font_style = $theme_row->album_extended_back_font_style;
|
73 |
$theme_row->back_font_weight = $theme_row->album_extended_back_font_weight;
|
74 |
$theme_row->back_font_color = $theme_row->album_extended_back_font_color;
|
75 |
-
}
|
76 |
-
elseif ( isset($params['masonry_album_thumb_width']) ) {
|
77 |
$params['gallery_view_type'] = 'masonry';
|
78 |
$params['image_enable_page'] = $params['masonry_album_enable_page'];
|
79 |
$params['container_id'] = 'bwg_album_masonry_' . $bwg;
|
@@ -86,14 +83,14 @@ class BWGControllerSite {
|
|
86 |
}
|
87 |
|
88 |
$params['showthumbs_name'] = $params['show_album_name'];
|
89 |
-
if (
|
90 |
$from = (isset($params['from']) ? esc_html($params['from']) : 0);
|
91 |
-
$album_row = $this->model->get_album_row_data(
|
92 |
$params['album_row'] = $album_row;
|
93 |
-
if (
|
94 |
return;
|
95 |
}
|
96 |
-
if (
|
97 |
echo WDWLibrary::message(__('There is no album selected or the gallery was deleted.', BWG()->prefix), 'wd_error');
|
98 |
return;
|
99 |
}
|
@@ -103,38 +100,32 @@ class BWGControllerSite {
|
|
103 |
$params['show_sort_images'] = FALSE;
|
104 |
$params['show_tag_box'] = FALSE;
|
105 |
$params['gallery_id'] = 0;
|
106 |
-
if (
|
107 |
$params['gallery_type'] = 'slideshow';
|
108 |
-
}
|
109 |
-
elseif ( $params['gallery_view_type'] == 'image_browser' ) {
|
110 |
$params['gallery_type'] = 'image_browser';
|
111 |
-
|
112 |
-
}
|
113 |
-
elseif ( $params['gallery_view_type'] == 'blog_style' ) {
|
114 |
$params['gallery_type'] = 'blog_style';
|
115 |
-
}
|
116 |
-
elseif ( $params['gallery_view_type'] == 'carousel' ) {
|
117 |
$params['gallery_type'] = 'carousel';
|
118 |
}
|
119 |
|
120 |
-
if (
|
121 |
$params['image_enable_page'] = $params['compuct_album_enable_page'];
|
122 |
$params['images_per_page'] = $params['compuct_albums_per_page'];
|
123 |
$params['items_col_num'] = $params['compuct_album_column_number'];
|
124 |
-
}
|
125 |
-
elseif ( isset($params['extended_album_image_thumb_width']) ) { // Extended album view.
|
126 |
$params['image_enable_page'] = $params['extended_album_enable_page'];
|
127 |
$params['images_per_page'] = $params['extended_albums_per_page'];
|
128 |
$params['items_col_num'] = $params['extended_album_image_column_number'];
|
129 |
$params['image_column_number'] = $params['extended_album_image_column_number'];
|
130 |
-
}
|
131 |
-
elseif ( isset($params['masonry_album_thumb_width']) ) {
|
132 |
$params['image_enable_page'] = $params['masonry_album_enable_page'];
|
133 |
$params['images_per_page'] = $params['masonry_albums_per_page'];
|
134 |
$params['items_col_num'] = $params['masonry_album_column_number'];
|
135 |
$params['image_column_number'] = $params['masonry_album_image_column_number'];
|
136 |
-
}
|
137 |
-
else {
|
138 |
$params['image_enable_page'] = $params['compuct_album_enable_page'];
|
139 |
$params['images_per_page'] = $params['compuct_albums_per_page'];
|
140 |
$params['items_col_num'] = $params['compuct_album_column_number'];
|
@@ -143,13 +134,12 @@ class BWGControllerSite {
|
|
143 |
$params['album_gallery_div_class'] = 'bwg_album_thumbnails_' . $bwg;
|
144 |
$params['load_more_image_count'] = $params['images_per_page'];
|
145 |
$params['items_per_page'] = array('images_per_page' => $params['images_per_page'], 'load_more_image_count' => $params['load_more_image_count']);
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
if ( isset($params['compuct_album_image_thumb_width']) ) { // Compact album view.
|
153 |
$params['thumb_width'] = $params['compuct_album_image_thumb_width'];
|
154 |
$params['thumb_height'] = $params['compuct_album_image_thumb_height'];
|
155 |
$params['image_title'] = $params['compuct_album_image_title'];
|
@@ -161,9 +151,8 @@ class BWGControllerSite {
|
|
161 |
$params['resizable_mosaic'] = $params['compuct_album_resizable_mosaic'];
|
162 |
$params['mosaic_total_width'] = $params['compuct_album_mosaic_total_width'];
|
163 |
|
164 |
-
|
165 |
-
}
|
166 |
-
elseif ( isset($params['extended_album_image_thumb_width']) ) { // Extended album view.
|
167 |
$params['thumb_width'] = $params['extended_album_image_thumb_width'];
|
168 |
$params['thumb_height'] = $params['extended_album_image_thumb_height'];
|
169 |
$params['image_title'] = $params['extended_album_image_title'];
|
@@ -174,180 +163,183 @@ class BWGControllerSite {
|
|
174 |
$params['mosaic_hor_ver'] = $params['extended_album_mosaic_hor_ver'];
|
175 |
$params['resizable_mosaic'] = $params['extended_album_resizable_mosaic'];
|
176 |
$params['mosaic_total_width'] = $params['extended_album_mosaic_total_width'];
|
177 |
-
}
|
178 |
-
elseif ( isset($params['masonry_album_thumb_width']) ) {
|
179 |
$params['thumb_width'] = $params['masonry_album_image_thumb_width'];
|
180 |
$params['image_column_number'] = $params['masonry_album_image_column_number'];
|
181 |
$params['images_per_page'] = $params['masonry_album_images_per_page'];
|
182 |
$params['play_icon'] = BWG()->options->masonry_play_icon;
|
183 |
}
|
184 |
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
$params['items_per_page'] = array('images_per_page' => $params['images_per_page'], 'load_more_image_count' => $params['load_more_image_count']);
|
280 |
|
281 |
-
|
282 |
$params['masonry_hor_ver'] = BWG()->options->masonry;
|
283 |
$params['show_masonry_thumb_description'] = BWG()->options->show_masonry_thumb_description;
|
284 |
|
285 |
$gallery_row = $this->model->get_gallery_row_data($params['gallery_id']);
|
286 |
|
287 |
-
if (
|
288 |
echo WDWLibrary::message(__('There is no gallery selected or the gallery was deleted.', BWG()->prefix), 'wd_error');
|
289 |
return;
|
290 |
-
}
|
291 |
-
else {
|
292 |
$params['gallery_row'] = $gallery_row;
|
293 |
}
|
294 |
|
295 |
-
|
296 |
-
|
297 |
$this->thumb_urls = $params['image_rows']['thumb_urls'];
|
298 |
-
if (
|
299 |
-
add_filter(
|
300 |
}
|
301 |
|
302 |
$params['tags_rows'] = $this->model->get_tags_rows_data($params['gallery_id']);
|
303 |
}
|
304 |
-
}
|
305 |
-
else { // View type gallery.
|
306 |
$params['view_type'] = 'gallery';
|
307 |
$params['album_view_type'] = '';
|
308 |
$params['album_gallery_id'] = 0;
|
309 |
$params['container_id'] = 'bwg_' . $params['gallery_type'] . '_' . $bwg;
|
310 |
$params['cur_alb_gal_id'] = 0;
|
311 |
-
$gallery_row = $this->model->get_gallery_row_data(
|
312 |
|
313 |
-
if(
|
314 |
return;
|
315 |
}
|
316 |
-
if (
|
317 |
echo WDWLibrary::message(__('There is no gallery selected or the gallery was deleted.', BWG()->prefix), 'wd_error');
|
318 |
return;
|
319 |
-
}
|
320 |
-
else {
|
321 |
$params['gallery_row'] = $gallery_row;
|
322 |
}
|
323 |
|
324 |
$params['load_more_image_count'] = (isset($params['load_more_image_count']) && ($params['image_enable_page'] == 2)) ? $params['load_more_image_count'] : $params['images_per_page'];
|
325 |
$params['items_per_page'] = array('images_per_page' => $params['images_per_page'], 'load_more_image_count' => $params['load_more_image_count']);
|
326 |
|
327 |
-
|
328 |
$params['image_enable_page'] = 1;
|
329 |
$params['images_per_page'] = 1;
|
330 |
$params['load_more_image_count'] = 1;
|
331 |
}
|
332 |
-
if (
|
333 |
$params['image_enable_page'] = $params['blog_style_enable_page'];
|
334 |
-
$params['images_per_page'] =
|
335 |
$params['load_more_image_count'] = (isset($params['blog_style_load_more_image_count']) && ($params['image_enable_page'] == 2)) ? $params['blog_style_load_more_image_count'] : $params['images_per_page'];
|
336 |
$params['items_per_page'] = array('images_per_page' => $params['images_per_page'], 'load_more_image_count' => $params['load_more_image_count']);
|
337 |
}
|
338 |
|
339 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
340 |
// Disable Jetpack Photon module for gallery images.
|
341 |
$this->thumb_urls = $params['image_rows']['thumb_urls'];
|
342 |
-
if (
|
343 |
-
add_filter(
|
344 |
}
|
345 |
|
346 |
$params['tags_rows'] = $this->model->get_tags_rows_data($params['gallery_id']);
|
347 |
}
|
348 |
|
349 |
-
$params['current_url']
|
350 |
-
|
|
|
351 |
$params_array = array(
|
352 |
'action' => 'GalleryBox',
|
353 |
'current_view' => $bwg,
|
@@ -355,12 +347,15 @@ class BWGControllerSite {
|
|
355 |
'tag' => (isset($params['tag']) ? $params['tag'] : 0),
|
356 |
'theme_id' => $params['theme_id'],
|
357 |
'shortcode_id' => isset($params['id']) ? $params['id'] : 0,
|
|
|
|
|
|
|
358 |
);
|
359 |
$params['params_array'] = $params_array;
|
360 |
|
361 |
-
$params[
|
362 |
|
363 |
-
|
364 |
}
|
365 |
|
366 |
public function display($params = array(), $from_shortcode = 0, $bwg = 0) {
|
20 |
public function execute( $params = array(), $from_shortcode = 0, $bwg = 0 ) {
|
21 |
$theme_id = $params['theme_id'];
|
22 |
$theme_row = $this->model->get_theme_row_data($theme_id);
|
23 |
+
$params['pagination_default_style'] = 0;
|
24 |
|
25 |
+
if (!isset($params['type'])) {
|
26 |
$params['type'] = '';
|
27 |
}
|
28 |
|
29 |
+
if (isset($_POST['sortImagesByValue_' . $bwg])) {
|
30 |
$sort_by = esc_html($_POST['sortImagesByValue_' . $bwg]);
|
31 |
+
if ($sort_by == 'random') {
|
32 |
$params['sort_by'] = 'RAND()';
|
33 |
+
} else {
|
34 |
+
if (in_array($sort_by, array('default', 'filename', 'size'))) {
|
|
|
35 |
$params['sort_by'] = $sort_by;
|
36 |
}
|
37 |
}
|
38 |
}
|
39 |
|
40 |
if ( strpos($params['gallery_type'], 'album') !== FALSE ) { //Album views (compact/masonry/extended).
|
41 |
+
// View type.
|
42 |
$params['view_type'] = 'album';
|
43 |
|
44 |
// Type in album view (album or gallery).
|
48 |
$params['album_gallery_id'] = (isset($_REQUEST['album_gallery_id_' . $bwg]) ? esc_html($_REQUEST['album_gallery_id_' . $bwg]) : $params['album_id']);
|
49 |
$params['cur_alb_gal_id'] = $params['album_gallery_id'];
|
50 |
|
51 |
+
if (isset($params['compuct_album_image_thumb_width'])) { // Compact album view.
|
52 |
// Gallery type in album (thumbnail/masonry/mosaic).
|
53 |
$params['gallery_view_type'] = $params['compuct_album_view_type'];
|
54 |
$params['image_enable_page'] = $params['compuct_album_enable_page'];
|
59 |
$theme_row->back_font_style = $theme_row->album_compact_back_font_style;
|
60 |
$theme_row->back_font_weight = $theme_row->album_compact_back_font_weight;
|
61 |
$theme_row->back_font_color = $theme_row->album_compact_back_font_color;
|
62 |
+
} elseif (isset($params['extended_album_image_thumb_width'])) { // Extended album view.
|
|
|
63 |
// Gallery type in album (thumbnail/masonry/mosaic).
|
64 |
$params['gallery_view_type'] = $params['extended_album_view_type'];
|
65 |
$params['image_enable_page'] = $params['extended_album_enable_page'];
|
70 |
$theme_row->back_font_style = $theme_row->album_extended_back_font_style;
|
71 |
$theme_row->back_font_weight = $theme_row->album_extended_back_font_weight;
|
72 |
$theme_row->back_font_color = $theme_row->album_extended_back_font_color;
|
73 |
+
} elseif (isset($params['masonry_album_thumb_width'])) {
|
|
|
74 |
$params['gallery_view_type'] = 'masonry';
|
75 |
$params['image_enable_page'] = $params['masonry_album_enable_page'];
|
76 |
$params['container_id'] = 'bwg_album_masonry_' . $bwg;
|
83 |
}
|
84 |
|
85 |
$params['showthumbs_name'] = $params['show_album_name'];
|
86 |
+
if ($params['album_view_type'] == 'album') { // Album in album.
|
87 |
$from = (isset($params['from']) ? esc_html($params['from']) : 0);
|
88 |
+
$album_row = $this->model->get_album_row_data($params['album_gallery_id'], $from === "widget");
|
89 |
$params['album_row'] = $album_row;
|
90 |
+
if (isset($album_row->published) && $album_row->published == 0) {
|
91 |
return;
|
92 |
}
|
93 |
+
if (!$params['album_row']) {
|
94 |
echo WDWLibrary::message(__('There is no album selected or the gallery was deleted.', BWG()->prefix), 'wd_error');
|
95 |
return;
|
96 |
}
|
100 |
$params['show_sort_images'] = FALSE;
|
101 |
$params['show_tag_box'] = FALSE;
|
102 |
$params['gallery_id'] = 0;
|
103 |
+
if ($params['gallery_view_type'] == 'slideshow') {
|
104 |
$params['gallery_type'] = 'slideshow';
|
105 |
+
} elseif ($params['gallery_view_type'] == 'image_browser') {
|
|
|
106 |
$params['gallery_type'] = 'image_browser';
|
107 |
+
$params['pagination_default_style'] = 1;
|
108 |
+
} elseif ($params['gallery_view_type'] == 'blog_style') {
|
|
|
109 |
$params['gallery_type'] = 'blog_style';
|
110 |
+
} elseif ($params['gallery_view_type'] == 'carousel') {
|
|
|
111 |
$params['gallery_type'] = 'carousel';
|
112 |
}
|
113 |
|
114 |
+
if (isset($params['compuct_album_image_thumb_width'])) { // Compact album view.
|
115 |
$params['image_enable_page'] = $params['compuct_album_enable_page'];
|
116 |
$params['images_per_page'] = $params['compuct_albums_per_page'];
|
117 |
$params['items_col_num'] = $params['compuct_album_column_number'];
|
118 |
+
} elseif (isset($params['extended_album_image_thumb_width'])) { // Extended album view.
|
|
|
119 |
$params['image_enable_page'] = $params['extended_album_enable_page'];
|
120 |
$params['images_per_page'] = $params['extended_albums_per_page'];
|
121 |
$params['items_col_num'] = $params['extended_album_image_column_number'];
|
122 |
$params['image_column_number'] = $params['extended_album_image_column_number'];
|
123 |
+
} elseif (isset($params['masonry_album_thumb_width'])) {
|
|
|
124 |
$params['image_enable_page'] = $params['masonry_album_enable_page'];
|
125 |
$params['images_per_page'] = $params['masonry_albums_per_page'];
|
126 |
$params['items_col_num'] = $params['masonry_album_column_number'];
|
127 |
$params['image_column_number'] = $params['masonry_album_image_column_number'];
|
128 |
+
} else {
|
|
|
129 |
$params['image_enable_page'] = $params['compuct_album_enable_page'];
|
130 |
$params['images_per_page'] = $params['compuct_albums_per_page'];
|
131 |
$params['items_col_num'] = $params['compuct_album_column_number'];
|
134 |
$params['album_gallery_div_class'] = 'bwg_album_thumbnails_' . $bwg;
|
135 |
$params['load_more_image_count'] = $params['images_per_page'];
|
136 |
$params['items_per_page'] = array('images_per_page' => $params['images_per_page'], 'load_more_image_count' => $params['load_more_image_count']);
|
137 |
+
$album_gallery_rows = $this->model->get_alb_gals_row($bwg, $params['album_gallery_id'], $params['images_per_page'], $params['album_sort_by'], $params['album_order_by'], $params['image_enable_page'], $from);
|
138 |
+
$params['album_gallery_rows'] = $album_gallery_rows;
|
139 |
+
} else { // Gallery views (thumbnail/masonry/mosaic).
|
140 |
+
/* Set parameters for gallery view from album shortcode.*/
|
141 |
+
/* album used all parmas for view */
|
142 |
+
if (isset($params['compuct_album_image_thumb_width'])) { // Compact album view.
|
|
|
143 |
$params['thumb_width'] = $params['compuct_album_image_thumb_width'];
|
144 |
$params['thumb_height'] = $params['compuct_album_image_thumb_height'];
|
145 |
$params['image_title'] = $params['compuct_album_image_title'];
|
151 |
$params['resizable_mosaic'] = $params['compuct_album_resizable_mosaic'];
|
152 |
$params['mosaic_total_width'] = $params['compuct_album_mosaic_total_width'];
|
153 |
|
154 |
+
$params['items_col_num'] = $params['compuct_album_column_number'];
|
155 |
+
} elseif (isset($params['extended_album_image_thumb_width'])) { // Extended album view.
|
|
|
156 |
$params['thumb_width'] = $params['extended_album_image_thumb_width'];
|
157 |
$params['thumb_height'] = $params['extended_album_image_thumb_height'];
|
158 |
$params['image_title'] = $params['extended_album_image_title'];
|
163 |
$params['mosaic_hor_ver'] = $params['extended_album_mosaic_hor_ver'];
|
164 |
$params['resizable_mosaic'] = $params['extended_album_resizable_mosaic'];
|
165 |
$params['mosaic_total_width'] = $params['extended_album_mosaic_total_width'];
|
166 |
+
} elseif (isset($params['masonry_album_thumb_width'])) {
|
|
|
167 |
$params['thumb_width'] = $params['masonry_album_image_thumb_width'];
|
168 |
$params['image_column_number'] = $params['masonry_album_image_column_number'];
|
169 |
$params['images_per_page'] = $params['masonry_album_images_per_page'];
|
170 |
$params['play_icon'] = BWG()->options->masonry_play_icon;
|
171 |
}
|
172 |
|
173 |
+
$params['gallery_type'] = 'thumbnails';
|
174 |
+
if ($params['gallery_view_type'] == 'slideshow') {
|
175 |
+
$params['gallery_type'] = 'slideshow';
|
176 |
+
$params['slideshow_effect'] = BWG()->options->slideshow_type;
|
177 |
+
$params['slideshow_interval'] = BWG()->options->slideshow_interval;
|
178 |
+
$params['slideshow_width'] = BWG()->options->slideshow_width;
|
179 |
+
$params['slideshow_height'] = BWG()->options->slideshow_height;
|
180 |
+
$params['slideshow_sort_by'] = BWG()->options->slideshow_sort_by;
|
181 |
+
$params['slideshow_order_by'] = BWG()->options->slideshow_order_by;
|
182 |
+
$params['enable_slideshow_autoplay'] = BWG()->options->slideshow_enable_autoplay;
|
183 |
+
$params['enable_slideshow_shuffle'] = BWG()->options->slideshow_enable_shuffle;
|
184 |
+
$params['enable_slideshow_ctrl'] = BWG()->options->slideshow_enable_ctrl;
|
185 |
+
$params['autohide_slideshow_navigation'] = BWG()->options->autohide_slideshow_navigation;
|
186 |
+
$params['enable_slideshow_filmstrip'] = BWG()->options->slideshow_enable_filmstrip;
|
187 |
+
$params['slideshow_filmstrip_height'] = BWG()->options->slideshow_filmstrip_height;
|
188 |
+
$params['slideshow_enable_title'] = BWG()->options->slideshow_enable_title;
|
189 |
+
$params['slideshow_title_position'] = BWG()->options->slideshow_title_position;
|
190 |
+
$params['slideshow_title_full_width'] = BWG()->options->slideshow_title_full_width;
|
191 |
+
$params['slideshow_enable_description'] = BWG()->options->slideshow_enable_description;
|
192 |
+
$params['slideshow_description_position'] = BWG()->options->slideshow_description_position;
|
193 |
+
$params['enable_slideshow_music'] = BWG()->options->slideshow_enable_music;
|
194 |
+
$params['slideshow_music_url'] = BWG()->options->slideshow_audio_url;
|
195 |
+
$params['slideshow_effect_duration'] = BWG()->options->slideshow_effect_duration;
|
196 |
+
$params['slideshow_gallery_download'] = BWG()->options->slideshow_gallery_download;
|
197 |
+
$params['image_column_number'] = 0;
|
198 |
+
$params['images_per_page'] = 0;
|
199 |
+
}
|
200 |
+
if ($params['gallery_view_type'] == 'image_browser') {
|
201 |
+
$params['gallery_type'] = 'image_browser';
|
202 |
+
$params['image_enable_page'] = BWG()->options->image_enable_page;
|
203 |
+
$params['image_browser_width'] = BWG()->options->image_browser_width;
|
204 |
+
$params['image_browser_title_enable'] = BWG()->options->image_browser_title_enable;
|
205 |
+
$params['image_browser_description_enable'] = BWG()->options->image_browser_description_enable;
|
206 |
+
$params['image_browser_sort_by'] = BWG()->options->image_browser_sort_by;
|
207 |
+
$params['image_browser_order_by'] = BWG()->options->image_browser_order_by;
|
208 |
+
$params['image_browser_show_gallery_title'] = BWG()->options->image_browser_show_gallery_title;
|
209 |
+
$params['image_browser_show_gallery_description'] = BWG()->options->image_browser_show_gallery_description;
|
210 |
+
$params['image_browser_show_search_box'] = BWG()->options->image_browser_show_search_box;
|
211 |
+
$params['image_browser_show_sort_images'] = BWG()->options->image_browser_show_sort_images;
|
212 |
+
$params['image_browser_show_tag_box'] = BWG()->options->image_browser_show_tag_box;
|
213 |
+
$params['image_browser_placeholder'] = BWG()->options->image_browser_placeholder;
|
214 |
+
$params['image_browser_search_box_width'] = BWG()->options->image_browser_search_box_width;
|
215 |
+
$params['image_browser_gallery_download'] = BWG()->options->image_browser_gallery_download;
|
216 |
+
$params['compuct_album_image_column_number'] = 1;
|
217 |
+
$params['compuct_album_images_per_page'] = 1;
|
218 |
+
$params['extended_album_image_column_number'] = 1;
|
219 |
+
$params['extended_album_images_per_page'] = 1;
|
220 |
+
$params['load_more_image_count'] = 1;
|
221 |
+
$params['images_per_page'] = 1;
|
222 |
+
}
|
223 |
+
if ($params['gallery_view_type'] == 'blog_style') {
|
224 |
+
$params['gallery_type'] = 'blog_style';
|
225 |
+
$params['blog_style_width'] = BWG()->options->blog_style_width;
|
226 |
+
$params['blog_style_title_enable'] = BWG()->options->blog_style_title_enable;
|
227 |
+
$params['blog_style_images_per_page'] = BWG()->options->blog_style_images_per_page;
|
228 |
+
$params['blog_style_load_more_image_count'] = BWG()->options->blog_style_load_more_image_count;
|
229 |
+
$params['blog_style_enable_page'] = BWG()->options->blog_style_enable_page;
|
230 |
+
$params['blog_style_description_enable'] = BWG()->options->blog_style_description_enable;
|
231 |
+
$params['blog_style_sort_by'] = BWG()->options->blog_style_sort_by;
|
232 |
+
$params['blog_style_order_by'] = BWG()->options->blog_style_order_by;
|
233 |
+
$params['blog_style_show_gallery_title'] = BWG()->options->blog_style_show_gallery_title;
|
234 |
+
$params['blog_style_show_gallery_description'] = BWG()->options->blog_style_show_gallery_description;
|
235 |
+
$params['blog_style_show_search_box'] = BWG()->options->blog_style_show_search_box;
|
236 |
+
$params['blog_style_placeholder'] = BWG()->options->blog_style_placeholder;
|
237 |
+
$params['blog_style_search_box_width'] = BWG()->options->blog_style_search_box_width;
|
238 |
+
$params['blog_style_show_sort_images'] = BWG()->options->blog_style_show_sort_images;
|
239 |
+
$params['blog_style_show_tag_box'] = BWG()->options->blog_style_show_tag_box;
|
240 |
+
$params['blog_style_gallery_download'] = BWG()->options->blog_style_gallery_download;
|
241 |
+
}
|
242 |
+
if ($params['gallery_view_type'] == 'carousel') {
|
243 |
+
$params['gallery_type'] = 'carousel';
|
244 |
+
$params['carousel_interval'] = BWG()->options->carousel_interval;
|
245 |
+
$params['carousel_width'] = BWG()->options->carousel_width;
|
246 |
+
$params['carousel_height'] = BWG()->options->carousel_height;
|
247 |
+
$params['carousel_image_column_number'] = BWG()->options->carousel_image_column_number;
|
248 |
+
$params['carousel_image_par'] = BWG()->options->carousel_image_par;
|
249 |
+
$params['enable_carousel_title'] = BWG()->options->carousel_enable_title;
|
250 |
+
$params['enable_carousel_autoplay'] = BWG()->options->carousel_enable_autoplay;
|
251 |
+
$params['carousel_r_width'] = BWG()->options->carousel_r_width;
|
252 |
+
$params['carousel_fit_containerWidth'] = BWG()->options->carousel_fit_containerWidth;
|
253 |
+
$params['carousel_prev_next_butt'] = BWG()->options->carousel_prev_next_butt;
|
254 |
+
$params['carousel_play_pause_butt'] = BWG()->options->carousel_play_pause_butt;
|
255 |
+
$params['image_column_number'] = 0;
|
256 |
+
$params['images_per_page'] = 0;
|
257 |
+
}
|
258 |
+
if ($params['gallery_view_type'] == 'masonry') {
|
259 |
+
$params['gallery_type'] = 'thumbnails_masonry';
|
260 |
+
}
|
261 |
+
if ($params['gallery_view_type'] == 'mosaic') {
|
262 |
+
$params['gallery_type'] = 'thumbnails_mosaic';
|
263 |
+
}
|
264 |
+
|
265 |
+
$params['gallery_id'] = $params['album_gallery_id'];
|
266 |
+
$params['load_more_image_count'] = $params['images_per_page'];
|
267 |
$params['items_per_page'] = array('images_per_page' => $params['images_per_page'], 'load_more_image_count' => $params['load_more_image_count']);
|
268 |
|
269 |
+
$params['container_id'] = 'bwg_' . $params['gallery_type'] . '_' . $bwg;
|
270 |
$params['masonry_hor_ver'] = BWG()->options->masonry;
|
271 |
$params['show_masonry_thumb_description'] = BWG()->options->show_masonry_thumb_description;
|
272 |
|
273 |
$gallery_row = $this->model->get_gallery_row_data($params['gallery_id']);
|
274 |
|
275 |
+
if (empty($gallery_row) && $params['type'] == '' && $params["tag"] == 0) {
|
276 |
echo WDWLibrary::message(__('There is no gallery selected or the gallery was deleted.', BWG()->prefix), 'wd_error');
|
277 |
return;
|
278 |
+
} else {
|
|
|
279 |
$params['gallery_row'] = $gallery_row;
|
280 |
}
|
281 |
|
282 |
+
$params['image_rows'] = $this->model->get_image_rows_data($params['gallery_id'], $bwg, $params['type'], 'bwg_tag_id_bwg_' . $params['gallery_type'] . '_' . $bwg, $params['tag'], $params['images_per_page'], $params['load_more_image_count'], $params['sort_by'], $params['order_by']);
|
283 |
+
// Disable Jetpack Photon module for gallery images.
|
284 |
$this->thumb_urls = $params['image_rows']['thumb_urls'];
|
285 |
+
if (class_exists('Jetpack') && Jetpack::is_module_active('photon')) {
|
286 |
+
add_filter('jetpack_photon_skip_image', array($this, 'disable_jetpack'), 11, 3);
|
287 |
}
|
288 |
|
289 |
$params['tags_rows'] = $this->model->get_tags_rows_data($params['gallery_id']);
|
290 |
}
|
291 |
+
} else { // View type gallery.
|
|
|
292 |
$params['view_type'] = 'gallery';
|
293 |
$params['album_view_type'] = '';
|
294 |
$params['album_gallery_id'] = 0;
|
295 |
$params['container_id'] = 'bwg_' . $params['gallery_type'] . '_' . $bwg;
|
296 |
$params['cur_alb_gal_id'] = 0;
|
297 |
+
$gallery_row = $this->model->get_gallery_row_data($params['gallery_id']);
|
298 |
|
299 |
+
if (!empty($gallery_row) && isset($gallery_row->published) && $gallery_row->published == 0) {
|
300 |
return;
|
301 |
}
|
302 |
+
if (empty($gallery_row) && $params['type'] == '' && $params["tag"] == 0) {
|
303 |
echo WDWLibrary::message(__('There is no gallery selected or the gallery was deleted.', BWG()->prefix), 'wd_error');
|
304 |
return;
|
305 |
+
} else {
|
|
|
306 |
$params['gallery_row'] = $gallery_row;
|
307 |
}
|
308 |
|
309 |
$params['load_more_image_count'] = (isset($params['load_more_image_count']) && ($params['image_enable_page'] == 2)) ? $params['load_more_image_count'] : $params['images_per_page'];
|
310 |
$params['items_per_page'] = array('images_per_page' => $params['images_per_page'], 'load_more_image_count' => $params['load_more_image_count']);
|
311 |
|
312 |
+
if ($params['gallery_type'] == 'image_browser') {
|
313 |
$params['image_enable_page'] = 1;
|
314 |
$params['images_per_page'] = 1;
|
315 |
$params['load_more_image_count'] = 1;
|
316 |
}
|
317 |
+
if ($params['gallery_type'] == 'blog_style') {
|
318 |
$params['image_enable_page'] = $params['blog_style_enable_page'];
|
319 |
+
$params['images_per_page'] = $params['blog_style_images_per_page'];
|
320 |
$params['load_more_image_count'] = (isset($params['blog_style_load_more_image_count']) && ($params['image_enable_page'] == 2)) ? $params['blog_style_load_more_image_count'] : $params['images_per_page'];
|
321 |
$params['items_per_page'] = array('images_per_page' => $params['images_per_page'], 'load_more_image_count' => $params['load_more_image_count']);
|
322 |
}
|
323 |
|
324 |
+
if ('xml_sitemap' == $from_shortcode) {
|
325 |
+
$params['images_per_page'] = 0;
|
326 |
+
}
|
327 |
+
$params['image_rows'] = $this->model->get_image_rows_data($params['gallery_id'], $bwg, $params['type'], 'bwg_tag_id_bwg_' . $params['gallery_type'] . '_' . $bwg, $params['tag'], $params['images_per_page'], $params['load_more_image_count'], $params['sort_by'], $params['order_by']);
|
328 |
+
if ('xml_sitemap' == $from_shortcode) {
|
329 |
+
return $params['image_rows']['images'];
|
330 |
+
}
|
331 |
// Disable Jetpack Photon module for gallery images.
|
332 |
$this->thumb_urls = $params['image_rows']['thumb_urls'];
|
333 |
+
if (class_exists('Jetpack') && Jetpack::is_module_active('photon')) {
|
334 |
+
add_filter('jetpack_photon_skip_image', array($this, 'disable_jetpack'), 11, 3);
|
335 |
}
|
336 |
|
337 |
$params['tags_rows'] = $this->model->get_tags_rows_data($params['gallery_id']);
|
338 |
}
|
339 |
|
340 |
+
if ( !isset( $params['current_url'] ) ) {
|
341 |
+
$params['current_url'] = trim((is_ssl() ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
|
342 |
+
}
|
343 |
$params_array = array(
|
344 |
'action' => 'GalleryBox',
|
345 |
'current_view' => $bwg,
|
347 |
'tag' => (isset($params['tag']) ? $params['tag'] : 0),
|
348 |
'theme_id' => $params['theme_id'],
|
349 |
'shortcode_id' => isset($params['id']) ? $params['id'] : 0,
|
350 |
+
'sort_by' => $params['sort_by'], // For widgets.
|
351 |
+
'order_by' => $params['order_by'], // For widgets.
|
352 |
+
'current_url' => urlencode( $params['current_url'] ),
|
353 |
);
|
354 |
$params['params_array'] = $params_array;
|
355 |
|
356 |
+
$params['theme_row'] = $theme_row;
|
357 |
|
358 |
+
$this->display($params, $from_shortcode, $bwg);
|
359 |
}
|
360 |
|
361 |
public function display($params = array(), $from_shortcode = 0, $bwg = 0) {
|
frontend/models/model.php
CHANGED
@@ -161,7 +161,9 @@ class BWGModelSite {
|
|
161 |
$thumb_urls = array();
|
162 |
if ( !empty($rows) ) {
|
163 |
foreach ( $rows as $row ) {
|
|
|
164 |
if ( strpos($row->filetype, 'EMBED') === FALSE ) {
|
|
|
165 |
$row->image_url = WDWLibrary::image_url_version($row->image_url, $row->modified_date);
|
166 |
$row->thumb_url = WDWLibrary::image_url_version($row->thumb_url, $row->modified_date);
|
167 |
// To disable Jetpack Photon module.
|
161 |
$thumb_urls = array();
|
162 |
if ( !empty($rows) ) {
|
163 |
foreach ( $rows as $row ) {
|
164 |
+
$row->alt = esc_html($row->alt);
|
165 |
if ( strpos($row->filetype, 'EMBED') === FALSE ) {
|
166 |
+
$row->image_url_raw = $row->image_url;
|
167 |
$row->image_url = WDWLibrary::image_url_version($row->image_url, $row->modified_date);
|
168 |
$row->thumb_url = WDWLibrary::image_url_version($row->thumb_url, $row->modified_date);
|
169 |
// To disable Jetpack Photon module.
|
frontend/views/BWGViewGalleryBox.php
CHANGED
@@ -29,10 +29,10 @@ class BWGViewGalleryBox {
|
|
29 |
$data[str_replace(' ', '', $shortcode_elem[0])] = $shortcode_elem[1];
|
30 |
}
|
31 |
}
|
|
|
32 |
$params = WDWLibrary::get_shortcode_option_params( $data );
|
33 |
-
|
34 |
-
|
35 |
-
}
|
36 |
$params['watermark_position'] = explode('-', $params['watermark_position']);
|
37 |
|
38 |
if ( !BWG()->is_pro ) {
|
@@ -622,7 +622,7 @@ class BWGViewGalleryBox {
|
|
622 |
if ($image_row->id == $current_image_id) {
|
623 |
$current_image_alt = $image_row->alt;
|
624 |
$current_image_hit_count = $image_row->hit_count;
|
625 |
-
$current_image_description = str_replace(array("\r\n", "\n", "\r"), esc_html('<br />'), $image_row->description);
|
626 |
$current_image_url = $image_row->pure_image_url;
|
627 |
$current_thumb_url = $image_row->pure_thumb_url;
|
628 |
$current_filetype = $image_row->filetype;
|
@@ -639,7 +639,7 @@ class BWGViewGalleryBox {
|
|
639 |
$data[$key]["number"] = $key + 1;
|
640 |
$data[$key]["id"] = $image_row->id;
|
641 |
$data[$key]["alt"] = str_replace(array("\r\n", "\n", "\r"), esc_html('<br />'), $image_row->alt);
|
642 |
-
$data[$key]["description"] = str_replace(array("\r\n", "\n", "\r"), esc_html('<br />'), $image_row->description);
|
643 |
|
644 |
$image_resolution = explode(' x ', $image_row->resolution);
|
645 |
if (is_array($image_resolution)) {
|
@@ -1376,8 +1376,8 @@ class BWGViewGalleryBox {
|
|
1376 |
'filmstrip_thumb_right_left_space' => $filmstrip_thumb_right_left_space,
|
1377 |
'all_images_right_left_space' => $all_images_right_left_space,
|
1378 |
'image_right_click' => $image_right_click,
|
1379 |
-
'open_comment' => $params['open_comment'],
|
1380 |
-
'open_ecommerce' => $params['open_ecommerce'],
|
1381 |
);
|
1382 |
$gallery_box_data = json_encode( $bwg_gallery_box_params );
|
1383 |
?>
|
29 |
$data[str_replace(' ', '', $shortcode_elem[0])] = $shortcode_elem[1];
|
30 |
}
|
31 |
}
|
32 |
+
|
33 |
$params = WDWLibrary::get_shortcode_option_params( $data );
|
34 |
+
$params['sort_by'] = WDWLibrary::esc_script('get', 'sort_by', 'RAND()');
|
35 |
+
$params['order_by'] = WDWLibrary::esc_script('get', 'order_by', 'asc');
|
|
|
36 |
$params['watermark_position'] = explode('-', $params['watermark_position']);
|
37 |
|
38 |
if ( !BWG()->is_pro ) {
|
622 |
if ($image_row->id == $current_image_id) {
|
623 |
$current_image_alt = $image_row->alt;
|
624 |
$current_image_hit_count = $image_row->hit_count;
|
625 |
+
$current_image_description = str_replace(array("\r\n", "\n", "\r"), esc_html('<br />'), preg_replace('/[\x01-\x09\x0B-\x0C\x0E-\x1F]+/', '', $image_row->description));
|
626 |
$current_image_url = $image_row->pure_image_url;
|
627 |
$current_thumb_url = $image_row->pure_thumb_url;
|
628 |
$current_filetype = $image_row->filetype;
|
639 |
$data[$key]["number"] = $key + 1;
|
640 |
$data[$key]["id"] = $image_row->id;
|
641 |
$data[$key]["alt"] = str_replace(array("\r\n", "\n", "\r"), esc_html('<br />'), $image_row->alt);
|
642 |
+
$data[$key]["description"] = str_replace(array("\r\n", "\n", "\r"), esc_html('<br />'), preg_replace('/[\x01-\x09\x0B-\x0C\x0E-\x1F]+/', '', $image_row->description));
|
643 |
|
644 |
$image_resolution = explode(' x ', $image_row->resolution);
|
645 |
if (is_array($image_resolution)) {
|
1376 |
'filmstrip_thumb_right_left_space' => $filmstrip_thumb_right_left_space,
|
1377 |
'all_images_right_left_space' => $all_images_right_left_space,
|
1378 |
'image_right_click' => $image_right_click,
|
1379 |
+
'open_comment' => isset($params['open_comment']) ? $params['open_comment'] : FALSE,
|
1380 |
+
'open_ecommerce' => isset($params['open_ecommerce']) ? $params['open_ecommerce'] : FALSE,
|
1381 |
);
|
1382 |
$gallery_box_data = json_encode( $bwg_gallery_box_params );
|
1383 |
?>
|
frontend/views/BWGViewSlideshow.php
CHANGED
@@ -307,7 +307,7 @@ public function display($params = array(), $bwg = 0) {
|
|
307 |
<?php
|
308 |
if ( !$is_embed ) {
|
309 |
?>
|
310 |
-
<a <?php echo($params['thumb_click_action'] == 'open_lightbox' ? (' class="bwg_lightbox"' . (BWG()->options->enable_seo ? ' href="' . ($is_embed ? $image_row->thumb_url : BWG()->upload_url . $image_row->image_url) . '"' : '') . ' data-image-id="' . $image_row->id . '"') : ($params['thumb_click_action'] == 'redirect_to_url' && $image_row->redirect_url ? 'href="' . $image_row->redirect_url . '" target="' . ($params['thumb_link_target'] ? '_blank' : '') . '"' : '')) ?>>
|
311 |
<img id="bwg_slideshow_image_<?php echo $bwg; ?>"
|
312 |
class="skip-lazy bwg_slide bwg_slideshow_image_<?php echo $bwg; ?> <?php if( $lazyload ) { ?> bwg_lazyload <?php } ?>"
|
313 |
src="<?php if( !$lazyload ) { echo BWG()->upload_url . $image_row->image_url; } else { echo BWG()->plugin_url."/images/lazy_placeholder.gif"; } ?>"
|
@@ -376,7 +376,7 @@ public function display($params = array(), $bwg = 0) {
|
|
376 |
<?php
|
377 |
if ( !$is_embed ) {
|
378 |
?>
|
379 |
-
<a <?php echo($params['thumb_click_action'] == 'open_lightbox' ? (' class="bwg_lightbox_' . $bwg . '"' . (BWG()->options->enable_seo ? ' href="' . ($is_embed ? $image_row->thumb_url : BWG()->upload_url . $image_row->image_url) . '"' : '') . ' data-image-id="' . $image_row->id . '"') : ($params['thumb_click_action'] == 'redirect_to_url' && $image_row->redirect_url ? 'href="' . $image_row->redirect_url . '" target="' . ($params['thumb_link_target'] ? '_blank' : '') . '"' : '')) ?>>
|
380 |
<img id="bwg_slideshow_image_<?php echo $bwg; ?>"
|
381 |
class="skip-lazy bwg_slide bwg_slideshow_image_<?php echo $bwg; ?> <?php if( $lazyload ) { ?> bwg_lazyload lazy_loader <?php } ?>"
|
382 |
src="<?php if( !$lazyload ) { echo BWG()->upload_url . $image_row->image_url; } else { echo BWG()->plugin_url."/images/lazy_placeholder.gif"; } ?>"
|
@@ -440,9 +440,9 @@ public function display($params = array(), $bwg = 0) {
|
|
440 |
<?php
|
441 |
if ( $enable_slideshow_ctrl ) {
|
442 |
?>
|
443 |
-
<a id="spider_slideshow_left_<?php echo $bwg; ?>" onclick="bwg_change_image(parseInt(jQuery('#bwg_current_image_key_<?php echo $bwg; ?>').val()), (parseInt(jQuery('#bwg_current_image_key_<?php echo $bwg; ?>').val()) + <?php echo count($data[$bwg]); ?> - bwg_iterator(<?php echo $bwg; ?>)) % <?php echo count($data[$bwg]); ?>, '', '', <?php echo $bwg; ?>); return false;"><span id="spider_slideshow_left-ico_<?php echo $bwg; ?>"><span><i class="<?php echo $theme_row->slideshow_rl_btn_style; ?>-left bwg_slideshow_prev_btn_<?php echo $bwg; ?>"></i></span></span></a>
|
444 |
<span id="bwg_slideshow_play_pause_<?php echo $bwg; ?>" class="bwg_slideshow_play_pause" style="display: <?php echo $play_pause_button_display; ?>;"><span><span id="bwg_slideshow_play_pause-ico_<?php echo $bwg; ?>"><i class="bwg-icon-play bwg_ctrl_btn_<?php echo $bwg; ?> bwg_slideshow_play_pause_<?php echo $bwg; ?>"></i></span></span></span>
|
445 |
-
<a id="spider_slideshow_right_<?php echo $bwg; ?>" onclick="bwg_change_image(parseInt(jQuery('#bwg_current_image_key_<?php echo $bwg; ?>').val()), (parseInt(jQuery('#bwg_current_image_key_<?php echo $bwg; ?>').val()) + bwg_iterator(<?php echo $bwg; ?>)) % <?php echo count($data[$bwg]); ?>, '', '', <?php echo $bwg; ?>); return false;"><span id="spider_slideshow_right-ico_<?php echo $bwg; ?>"><span><i class="<?php echo $theme_row->slideshow_rl_btn_style; ?>-right bwg_slideshow_next_btn_<?php echo $bwg; ?>"></i></span></span></a>
|
446 |
<?php
|
447 |
}
|
448 |
?>
|
@@ -457,7 +457,7 @@ public function display($params = array(), $bwg = 0) {
|
|
457 |
<?php
|
458 |
if ( $params['watermark_type'] == 'image' ) {
|
459 |
?>
|
460 |
-
<a href="<?php echo urldecode($watermark_link); ?>" target="_blank">
|
461 |
<img class="bwg_slideshow_watermark_image_<?php echo $bwg; ?> bwg_slideshow_watermark_<?php echo $bwg; ?>" src="<?php echo urldecode($watermark_url); ?>" />
|
462 |
</a>
|
463 |
<?php
|
307 |
<?php
|
308 |
if ( !$is_embed ) {
|
309 |
?>
|
310 |
+
<a <?php echo($params['thumb_click_action'] == 'open_lightbox' ? (' class="bwg-a bwg_lightbox"' . (BWG()->options->enable_seo ? ' href="' . ($is_embed ? $image_row->thumb_url : BWG()->upload_url . $image_row->image_url) . '"' : '') . ' data-image-id="' . $image_row->id . '"') : ('class="bwg-a" ' . ($params['thumb_click_action'] == 'redirect_to_url' && $image_row->redirect_url ? 'href="' . $image_row->redirect_url . '" target="' . ($params['thumb_link_target'] ? '_blank' : '') . '"' : ''))); ?>>
|
311 |
<img id="bwg_slideshow_image_<?php echo $bwg; ?>"
|
312 |
class="skip-lazy bwg_slide bwg_slideshow_image_<?php echo $bwg; ?> <?php if( $lazyload ) { ?> bwg_lazyload <?php } ?>"
|
313 |
src="<?php if( !$lazyload ) { echo BWG()->upload_url . $image_row->image_url; } else { echo BWG()->plugin_url."/images/lazy_placeholder.gif"; } ?>"
|
376 |
<?php
|
377 |
if ( !$is_embed ) {
|
378 |
?>
|
379 |
+
<a <?php echo($params['thumb_click_action'] == 'open_lightbox' ? (' class="bwg-a bwg_lightbox_' . $bwg . '"' . (BWG()->options->enable_seo ? ' href="' . ($is_embed ? $image_row->thumb_url : BWG()->upload_url . $image_row->image_url) . '"' : '') . ' data-image-id="' . $image_row->id . '"') : ('class="bwg-a" ' . ($params['thumb_click_action'] == 'redirect_to_url' && $image_row->redirect_url ? 'href="' . $image_row->redirect_url . '" target="' . ($params['thumb_link_target'] ? '_blank' : '') . '"' : ''))) ?>>
|
380 |
<img id="bwg_slideshow_image_<?php echo $bwg; ?>"
|
381 |
class="skip-lazy bwg_slide bwg_slideshow_image_<?php echo $bwg; ?> <?php if( $lazyload ) { ?> bwg_lazyload lazy_loader <?php } ?>"
|
382 |
src="<?php if( !$lazyload ) { echo BWG()->upload_url . $image_row->image_url; } else { echo BWG()->plugin_url."/images/lazy_placeholder.gif"; } ?>"
|
440 |
<?php
|
441 |
if ( $enable_slideshow_ctrl ) {
|
442 |
?>
|
443 |
+
<a class="bwg-a" id="spider_slideshow_left_<?php echo $bwg; ?>" onclick="bwg_change_image(parseInt(jQuery('#bwg_current_image_key_<?php echo $bwg; ?>').val()), (parseInt(jQuery('#bwg_current_image_key_<?php echo $bwg; ?>').val()) + <?php echo count($data[$bwg]); ?> - bwg_iterator(<?php echo $bwg; ?>)) % <?php echo count($data[$bwg]); ?>, '', '', <?php echo $bwg; ?>); return false;"><span id="spider_slideshow_left-ico_<?php echo $bwg; ?>"><span><i class="<?php echo $theme_row->slideshow_rl_btn_style; ?>-left bwg_slideshow_prev_btn_<?php echo $bwg; ?>"></i></span></span></a>
|
444 |
<span id="bwg_slideshow_play_pause_<?php echo $bwg; ?>" class="bwg_slideshow_play_pause" style="display: <?php echo $play_pause_button_display; ?>;"><span><span id="bwg_slideshow_play_pause-ico_<?php echo $bwg; ?>"><i class="bwg-icon-play bwg_ctrl_btn_<?php echo $bwg; ?> bwg_slideshow_play_pause_<?php echo $bwg; ?>"></i></span></span></span>
|
445 |
+
<a class="bwg-a" id="spider_slideshow_right_<?php echo $bwg; ?>" onclick="bwg_change_image(parseInt(jQuery('#bwg_current_image_key_<?php echo $bwg; ?>').val()), (parseInt(jQuery('#bwg_current_image_key_<?php echo $bwg; ?>').val()) + bwg_iterator(<?php echo $bwg; ?>)) % <?php echo count($data[$bwg]); ?>, '', '', <?php echo $bwg; ?>); return false;"><span id="spider_slideshow_right-ico_<?php echo $bwg; ?>"><span><i class="<?php echo $theme_row->slideshow_rl_btn_style; ?>-right bwg_slideshow_next_btn_<?php echo $bwg; ?>"></i></span></span></a>
|
446 |
<?php
|
447 |
}
|
448 |
?>
|
457 |
<?php
|
458 |
if ( $params['watermark_type'] == 'image' ) {
|
459 |
?>
|
460 |
+
<a class="bwg-a" href="<?php echo urldecode($watermark_link); ?>" target="_blank">
|
461 |
<img class="bwg_slideshow_watermark_image_<?php echo $bwg; ?> bwg_slideshow_watermark_<?php echo $bwg; ?>" src="<?php echo urldecode($watermark_url); ?>" />
|
462 |
</a>
|
463 |
<?php
|
frontend/views/view.php
CHANGED
@@ -46,12 +46,12 @@ class BWGViewSite {
|
|
46 |
class="bwg_container bwg_thumbnail bwg_<?php echo $params['gallery_type']; ?>"
|
47 |
data-right-click-protection="<?php echo BWG()->options->image_right_click; ?>"
|
48 |
data-bwg="<?php echo $bwg; ?>"
|
|
|
49 |
data-lightbox-url="<?php echo addslashes(add_query_arg($params_array, admin_url('admin-ajax.php'))); ?>"
|
50 |
data-gallery-id="<?php echo $params_array['gallery_id']; ?>"
|
51 |
data-popup-width="<?php echo $params["popup_width"]; ?>"
|
52 |
data-popup-height="<?php echo $params["popup_height"]; ?>"
|
53 |
-
data-buttons-position="<?php echo $theme_row->lightbox_ctrl_btn_pos; ?>"
|
54 |
-
data-bwg="<?php echo $bwg; ?>">
|
55 |
<div id="bwg_container2_<?php echo $bwg; ?>">
|
56 |
<?php $this->loading($bwg, $params["image_enable_page"], $params['gallery_type'] ); ?>
|
57 |
<form id="gal_front_form_<?php echo $bwg; ?>"
|
@@ -72,7 +72,7 @@ class BWGViewSite {
|
|
72 |
if ( BWG()->options->front_ajax == "1" && isset($get_album_gallery_id) && intval($get_album_gallery_id) > 0 ) {
|
73 |
$this->back($params, $bwg);
|
74 |
}
|
75 |
-
|
76 |
if ( (!isset($params['from']) || $params['from'] !== 'widget')
|
77 |
&& ((isset($params['show_sort_images']) && $params['show_sort_images'])
|
78 |
|| (isset($params['show_tag_box']) && $params['show_tag_box'])
|
@@ -143,27 +143,27 @@ class BWGViewSite {
|
|
143 |
}
|
144 |
|
145 |
public function ajax_content($params, $bwg, $content) {
|
146 |
-
|
147 |
$this->back($params, $bwg);
|
148 |
}
|
149 |
if ( BWG()->options->front_ajax != "1" ) {
|
150 |
$this->title_description($params, $bwg);
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
|
160 |
-
|
161 |
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
}
|
168 |
|
169 |
if ( isset($params['image_rows']) && !count($params['image_rows']['images']) ) {
|
@@ -197,10 +197,10 @@ class BWGViewSite {
|
|
197 |
|
198 |
public function loading($bwg = 0, $image_enable_page = 0, $gallery_type = '' ) {
|
199 |
$load_type_class = "bwg_loading_div_1";
|
200 |
-
|
201 |
$load_type_class = "bwg_load_more_ajax_loading";
|
202 |
}
|
203 |
-
|
204 |
<div id="ajax_loading_<?php echo $bwg; ?>" class="<?php echo $load_type_class; ?>">
|
205 |
<div class="bwg_loading_div_2">
|
206 |
<div class="bwg_loading_div_3">
|
@@ -656,16 +656,16 @@ class BWGViewSite {
|
|
656 |
}
|
657 |
?>
|
658 |
<span class="pagination-links_<?php echo $current_view; ?>">
|
659 |
-
<a class="<?php echo $first_page; ?>" title="<?php echo __('Go to the first page', BWG()->prefix); ?>" <?php echo BWG()->options->front_ajax == "1" && $page_number > 1 && $enable_seo ? 'href="' . esc_url(add_query_arg(array( "page_number_" . $current_view => 1 ), $_SERVER['REQUEST_URI'])) . '"' : ""; ?>><?php echo $first_button; ?></a>
|
660 |
-
<a class="<?php echo $prev_page; ?>" title="<?php echo __('Go to the previous page', BWG()->prefix); ?>" <?php echo $page_number > 1 && $enable_seo ? 'href="' . esc_url(add_query_arg(array( "page_number_" . $current_view => $page_number - 1 ), $_SERVER['REQUEST_URI'])) . '"' : ""; ?>><?php echo $previous_button; ?></a>
|
661 |
<span class="paging-input_<?php echo $current_view; ?>">
|
662 |
<span class="total-pages_<?php echo $current_view; ?>"><?php echo $page_number; ?></span> <?php echo __('of', BWG()->prefix); ?>
|
663 |
<span class="total-pages_<?php echo $current_view; ?>">
|
664 |
<?php echo $items_county; ?>
|
665 |
</span>
|
666 |
</span>
|
667 |
-
<a class="<?php echo $next_page ?>" title="<?php echo __('Go to the next page', BWG()->prefix); ?>" <?php echo $page_number + 1 <= $items_county && $enable_seo ? 'href="' . esc_url(add_query_arg(array( "page_number_" . $current_view => $page_number + 1 ), $_SERVER['REQUEST_URI'])) . '"' : ""; ?>><?php echo $next_button; ?></a>
|
668 |
-
<a class="<?php echo $last_page ?>" title="<?php echo __('Go to the last page', BWG()->prefix); ?>" <?php echo BWG()->options->front_ajax == "1" && $page_number < $items_county && $enable_seo ? 'href="' . esc_url(add_query_arg(array( "page_number_" . $current_view => $items_county ), $_SERVER['REQUEST_URI'])) . '"' : ""; ?>><?php echo $last_button; ?></a>
|
669 |
</span>
|
670 |
<?php
|
671 |
}
|
@@ -677,7 +677,7 @@ class BWGViewSite {
|
|
677 |
if ($count_items > ($limit * ($page_number - 1)) + $items_per_page['images_per_page']) {
|
678 |
?>
|
679 |
<div id="bwg_load_<?php echo $current_view; ?>" class="tablenav-pages_<?php echo $current_view; ?>">
|
680 |
-
<a class="bwg_load_btn_<?php echo $current_view; ?> bwg_load_btn" href="javascript:void(0);"><?php echo __('Load More...', BWG()->prefix); ?></a>
|
681 |
<input type="hidden" id="bwg_load_more_<?php echo $current_view; ?>" name="bwg_load_more_<?php echo $current_view; ?>" value="on" />
|
682 |
</div>
|
683 |
<?php
|
46 |
class="bwg_container bwg_thumbnail bwg_<?php echo $params['gallery_type']; ?>"
|
47 |
data-right-click-protection="<?php echo BWG()->options->image_right_click; ?>"
|
48 |
data-bwg="<?php echo $bwg; ?>"
|
49 |
+
data-current-url="<?php echo addslashes(urldecode($params_array['current_url'])); ?>"
|
50 |
data-lightbox-url="<?php echo addslashes(add_query_arg($params_array, admin_url('admin-ajax.php'))); ?>"
|
51 |
data-gallery-id="<?php echo $params_array['gallery_id']; ?>"
|
52 |
data-popup-width="<?php echo $params["popup_width"]; ?>"
|
53 |
data-popup-height="<?php echo $params["popup_height"]; ?>"
|
54 |
+
data-buttons-position="<?php echo $theme_row->lightbox_ctrl_btn_pos; ?>">
|
|
|
55 |
<div id="bwg_container2_<?php echo $bwg; ?>">
|
56 |
<?php $this->loading($bwg, $params["image_enable_page"], $params['gallery_type'] ); ?>
|
57 |
<form id="gal_front_form_<?php echo $bwg; ?>"
|
72 |
if ( BWG()->options->front_ajax == "1" && isset($get_album_gallery_id) && intval($get_album_gallery_id) > 0 ) {
|
73 |
$this->back($params, $bwg);
|
74 |
}
|
75 |
+
$this->title_description($params, $bwg);
|
76 |
if ( (!isset($params['from']) || $params['from'] !== 'widget')
|
77 |
&& ((isset($params['show_sort_images']) && $params['show_sort_images'])
|
78 |
|| (isset($params['show_tag_box']) && $params['show_tag_box'])
|
143 |
}
|
144 |
|
145 |
public function ajax_content($params, $bwg, $content) {
|
146 |
+
if ( isset($params['breadcrumb_arr']) && count($params['breadcrumb_arr']) > 1 ) { /* If not first album.*/
|
147 |
$this->back($params, $bwg);
|
148 |
}
|
149 |
if ( BWG()->options->front_ajax != "1" ) {
|
150 |
$this->title_description($params, $bwg);
|
151 |
+
if((!isset($params['from']) || $params['from'] !== 'widget')
|
152 |
+
&& ((isset($params['show_sort_images']) && $params['show_sort_images'])
|
153 |
+
|| (isset($params['show_tag_box']) && $params['show_tag_box'])
|
154 |
+
|| (isset($params['show_search_box']) && $params['show_search_box']))) {
|
155 |
+
?>
|
156 |
+
<div class="search_line">
|
157 |
+
<?php
|
158 |
+
$this->ajax_html_frontend_sort_box($params, $bwg);
|
159 |
|
160 |
+
$this->ajax_html_frontend_search_tags($params, $bwg);
|
161 |
|
162 |
+
$this->ajax_html_frontend_search_box($params, $bwg);
|
163 |
+
?>
|
164 |
+
</div>
|
165 |
+
<?php
|
166 |
+
}
|
167 |
}
|
168 |
|
169 |
if ( isset($params['image_rows']) && !count($params['image_rows']['images']) ) {
|
197 |
|
198 |
public function loading($bwg = 0, $image_enable_page = 0, $gallery_type = '' ) {
|
199 |
$load_type_class = "bwg_loading_div_1";
|
200 |
+
if( ($image_enable_page == 2 || $image_enable_page == 3) ) {
|
201 |
$load_type_class = "bwg_load_more_ajax_loading";
|
202 |
}
|
203 |
+
?>
|
204 |
<div id="ajax_loading_<?php echo $bwg; ?>" class="<?php echo $load_type_class; ?>">
|
205 |
<div class="bwg_loading_div_2">
|
206 |
<div class="bwg_loading_div_3">
|
656 |
}
|
657 |
?>
|
658 |
<span class="pagination-links_<?php echo $current_view; ?>">
|
659 |
+
<a class="bwg-a <?php echo $first_page; ?>" title="<?php echo __('Go to the first page', BWG()->prefix); ?>" <?php echo BWG()->options->front_ajax == "1" && $page_number > 1 && $enable_seo ? 'href="' . esc_url(add_query_arg(array( "page_number_" . $current_view => 1 ), $_SERVER['REQUEST_URI'])) . '"' : ""; ?>><?php echo $first_button; ?></a>
|
660 |
+
<a class="bwg-a <?php echo $prev_page; ?>" title="<?php echo __('Go to the previous page', BWG()->prefix); ?>" <?php echo $page_number > 1 && $enable_seo ? 'href="' . esc_url(add_query_arg(array( "page_number_" . $current_view => $page_number - 1 ), $_SERVER['REQUEST_URI'])) . '"' : ""; ?>><?php echo $previous_button; ?></a>
|
661 |
<span class="paging-input_<?php echo $current_view; ?>">
|
662 |
<span class="total-pages_<?php echo $current_view; ?>"><?php echo $page_number; ?></span> <?php echo __('of', BWG()->prefix); ?>
|
663 |
<span class="total-pages_<?php echo $current_view; ?>">
|
664 |
<?php echo $items_county; ?>
|
665 |
</span>
|
666 |
</span>
|
667 |
+
<a class="bwg-a <?php echo $next_page ?>" title="<?php echo __('Go to the next page', BWG()->prefix); ?>" <?php echo $page_number + 1 <= $items_county && $enable_seo ? 'href="' . esc_url(add_query_arg(array( "page_number_" . $current_view => $page_number + 1 ), $_SERVER['REQUEST_URI'])) . '"' : ""; ?>><?php echo $next_button; ?></a>
|
668 |
+
<a class="bwg-a <?php echo $last_page ?>" title="<?php echo __('Go to the last page', BWG()->prefix); ?>" <?php echo BWG()->options->front_ajax == "1" && $page_number < $items_county && $enable_seo ? 'href="' . esc_url(add_query_arg(array( "page_number_" . $current_view => $items_county ), $_SERVER['REQUEST_URI'])) . '"' : ""; ?>><?php echo $last_button; ?></a>
|
669 |
</span>
|
670 |
<?php
|
671 |
}
|
677 |
if ($count_items > ($limit * ($page_number - 1)) + $items_per_page['images_per_page']) {
|
678 |
?>
|
679 |
<div id="bwg_load_<?php echo $current_view; ?>" class="tablenav-pages_<?php echo $current_view; ?>">
|
680 |
+
<a class="bwg-a bwg_load_btn_<?php echo $current_view; ?> bwg_load_btn" href="javascript:void(0);"><?php echo __('Load More...', BWG()->prefix); ?></a>
|
681 |
<input type="hidden" id="bwg_load_more_<?php echo $current_view; ?>" name="bwg_load_more_<?php echo $current_view; ?>" value="on" />
|
682 |
</div>
|
683 |
<?php
|
js/bwg.js
CHANGED
@@ -921,11 +921,30 @@ function preview_watermark() {
|
|
921 |
}, 50);
|
922 |
}
|
923 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
924 |
function preview_built_in_watermark() {
|
925 |
setTimeout(function(){
|
926 |
watermark_type = window.parent.document.getElementById('built_in_watermark_type_text').checked;
|
927 |
if (watermark_type) {
|
928 |
-
watermark_text = document.getElementById('built_in_watermark_text').value;
|
929 |
watermark_font_size = document.getElementById('built_in_watermark_font_size').value * 400 / 500;
|
930 |
watermark_font = 'bwg_' + document.getElementById('built_in_watermark_font').value.replace('.TTF', '').replace('.ttf', '');
|
931 |
watermark_color = document.getElementById('built_in_watermark_color').value;
|
921 |
}, 50);
|
922 |
}
|
923 |
|
924 |
+
/* Escape a string for HTML.*/
|
925 |
+
function tw_escape(string) {
|
926 |
+
/* List of HTML entities for escaping.*/
|
927 |
+
var htmlEscapes = {
|
928 |
+
'&': '&',
|
929 |
+
'<': '<',
|
930 |
+
'>': '>',
|
931 |
+
'"': '"',
|
932 |
+
"'": ''',
|
933 |
+
'/': '/'
|
934 |
+
};
|
935 |
+
/* Regex containing the keys.*/
|
936 |
+
var htmlEscaper = /[&<>"'\/]/g;
|
937 |
+
|
938 |
+
return ('' + string).replace(htmlEscaper, function(match) {
|
939 |
+
return htmlEscapes[match];
|
940 |
+
});
|
941 |
+
};
|
942 |
+
|
943 |
function preview_built_in_watermark() {
|
944 |
setTimeout(function(){
|
945 |
watermark_type = window.parent.document.getElementById('built_in_watermark_type_text').checked;
|
946 |
if (watermark_type) {
|
947 |
+
watermark_text = tw_escape(document.getElementById('built_in_watermark_text').value);
|
948 |
watermark_font_size = document.getElementById('built_in_watermark_font_size').value * 400 / 500;
|
949 |
watermark_font = 'bwg_' + document.getElementById('built_in_watermark_font').value.replace('.TTF', '').replace('.ttf', '');
|
950 |
watermark_color = document.getElementById('built_in_watermark_color').value;
|
js/bwg_elementor_widget.js
ADDED
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
jQuery("document").ready(function () {
|
2 |
+
elementor.hooks.addAction( 'panel/open_editor/widget/bwg-elementor', function( panel, model, view ) {
|
3 |
+
var bwg_view_type = jQuery('select[data-setting="bwg_gallery_view_type"]',window.parent.document);
|
4 |
+
var bwg_group_view_type = jQuery('select[data-setting="bwg_gallery_group_view_type"]',window.parent.document);
|
5 |
+
var bwg_galleries = jQuery('select[data-setting="bwg_galleries"]',window.parent.document);
|
6 |
+
var bwg_tags = jQuery('select[data-setting="bwg_tags"]',window.parent.document);
|
7 |
+
var bwg_theme = jQuery('select[data-setting="bwg_theme"]',window.parent.document);
|
8 |
+
var bwg_gallery_group = jQuery('select[data-setting="bwg_gallery_group"]',window.parent.document);
|
9 |
+
|
10 |
+
bwg_add_edit_link(bwg_view_type, 'view_type');
|
11 |
+
bwg_add_edit_link(bwg_group_view_type, 'group_view_type');
|
12 |
+
bwg_add_edit_link(bwg_galleries, 'galleries');
|
13 |
+
bwg_add_edit_link(bwg_tags, 'tag');
|
14 |
+
bwg_add_edit_link(bwg_theme, 'theme');
|
15 |
+
bwg_add_edit_link(bwg_gallery_group, 'group');
|
16 |
+
});
|
17 |
+
jQuery('body').on('change', 'select[data-setting="bwg_gallery_view_type"]',window.parent.document, function (){
|
18 |
+
bwg_add_edit_link(jQuery(this), 'view_type');
|
19 |
+
});
|
20 |
+
jQuery('body').on('change', 'select[data-setting="bwg_gallery_group_view_type"]',window.parent.document, function (){
|
21 |
+
bwg_add_edit_link(jQuery(this), 'group_view_type');
|
22 |
+
});
|
23 |
+
jQuery('body').on('change', 'select[data-setting="bwg_galleries"]',window.parent.document, function (){
|
24 |
+
bwg_add_edit_link(jQuery(this), 'galleries');
|
25 |
+
});
|
26 |
+
jQuery('body').on('change', 'select[data-setting="bwg_tags"]',window.parent.document, function (){
|
27 |
+
bwg_add_edit_link(jQuery(this), 'tag');
|
28 |
+
});
|
29 |
+
jQuery('body').on('change', 'select[data-setting="bwg_theme"]',window.parent.document, function (){
|
30 |
+
bwg_add_edit_link(jQuery(this), 'theme');
|
31 |
+
});
|
32 |
+
jQuery('body').on('change', 'select[data-setting="bwg_gallery_group"]',window.parent.document, function (){
|
33 |
+
bwg_add_edit_link(jQuery(this), 'group');
|
34 |
+
});
|
35 |
+
});
|
36 |
+
|
37 |
+
function bwg_add_edit_link(el , type) {
|
38 |
+
var bwg_el = el;
|
39 |
+
var bwg_id = bwg_el.val();
|
40 |
+
var a_link = bwg_el.closest('.elementor-control-content').find('.elementor-control-field-description').find('a');
|
41 |
+
var link = "";
|
42 |
+
var edit_link = "";
|
43 |
+
if(type === "view_type"){
|
44 |
+
link = "admin.php?page=options_bwg&active_tab=1&gallery_type=thumbnails";
|
45 |
+
edit_link = "admin.php?page=options_bwg&active_tab=1&gallery_type={1}";
|
46 |
+
}
|
47 |
+
else if (type === "group_view_type"){
|
48 |
+
link = "admin.php?page=options_bwg&active_tab=2&album_type=album_extended_preview"
|
49 |
+
edit_link = "admin.php?page=options_bwg&active_tab=2&album_type={1}"
|
50 |
+
}
|
51 |
+
else if(type === "galleries"){
|
52 |
+
link = "admin.php?page=galleries_bwg";
|
53 |
+
edit_link = "admin.php?page=galleries_bwg&task=edit¤t_id={1}";
|
54 |
+
}else if(type === "tag"){
|
55 |
+
link = "edit-tags.php?taxonomy=bwg_tag";
|
56 |
+
edit_link = "term.php?taxonomy=bwg_tag&tag_ID={1}";
|
57 |
+
}else if(type === "theme"){
|
58 |
+
link = "admin.php?page=themes_bwg";
|
59 |
+
edit_link = "admin.php?page=themes_bwg&task=edit¤t_id={1}";
|
60 |
+
}else if(type === "group"){
|
61 |
+
link = "admin.php?page=albums_bwg";
|
62 |
+
edit_link = "admin.php?page=albums_bwg&task=edit¤t_id={1}";
|
63 |
+
}
|
64 |
+
if(bwg_id !== '0'){
|
65 |
+
link = edit_link.replace("{1}", bwg_id);
|
66 |
+
}
|
67 |
+
a_link.attr( 'href', link);
|
68 |
+
}
|
js/bwg_frontend.js
CHANGED
@@ -9,13 +9,6 @@ var bwg_params_ib = [];
|
|
9 |
/* Carousel params */
|
10 |
var bwg_params_carousel = [];
|
11 |
|
12 |
-
/* Execute on ajax complete.*/
|
13 |
-
jQuery(document).ajaxComplete(function () {
|
14 |
-
setTimeout(function () {
|
15 |
-
bwg_main_ready();
|
16 |
-
});
|
17 |
-
});
|
18 |
-
|
19 |
jQuery(document).ready(function () {
|
20 |
|
21 |
document.addEventListener("visibilitychange", function() {
|
@@ -194,7 +187,7 @@ function bwg_blog_style_resize() {
|
|
194 |
function bwg_blog_style_onload() {
|
195 |
jQuery(".bwg_blog_style").each(function () {
|
196 |
bwg = jQuery(this).attr('data-bwg');
|
197 |
-
|
198 |
jQuery('.bwg_embed_frame_16x9_'+bwg).each(function (e) {
|
199 |
/* Conflict with Sydney Theme */
|
200 |
if ( jQuery('.bwg_blog_style_image_' + bwg).find('.fluid-width-video-wrapper').length ) {
|
@@ -991,7 +984,9 @@ function bwg_thumbnail_masonry(that) {
|
|
991 |
if ( jQuery( this ).find("img").attr("data-width").length > 0 && jQuery( this ).find("img").attr("data-height").length > 0 ) {
|
992 |
scale = jQuery( this ).find("img").data("width")/jQuery( this ).find("img").data("height");
|
993 |
scaleHeight = jQuery( this ).width()/scale;
|
994 |
-
|
|
|
|
|
995 |
}
|
996 |
/* Use getBoundingClientRect instead of jQuery.height() to avoid rounding. */
|
997 |
column_heights[order] += jQuery( this )[0].getBoundingClientRect().height;
|
@@ -1295,6 +1290,7 @@ function bwg_thumbnail_mosaic(that) {
|
|
1295 |
});
|
1296 |
}
|
1297 |
/*IMPORTANT!*/
|
|
|
1298 |
jQuery(".bwg_mosaic_thumbnails_" + bwg).css({visibility: 'visible'});
|
1299 |
jQuery(".tablenav-pages_" + bwg).css({visibility: 'visible'});
|
1300 |
bwg_container_loaded(bwg);
|
@@ -1305,7 +1301,10 @@ function bwg_thumbnail_mosaic(that) {
|
|
1305 |
dfd.resolve(container);
|
1306 |
|
1307 |
if (container.attr('data-image-title') == 'hover') {
|
1308 |
-
|
|
|
|
|
|
|
1309 |
}
|
1310 |
if (container.attr('data-ecommerce-icon') == 'hover') {
|
1311 |
jQuery(".bwg_mosaic_thumb_spun_" + bwg).on("mouseenter", function() {
|
@@ -1401,10 +1400,10 @@ function bwg_add_album() {
|
|
1401 |
|
1402 |
function bwg_add_lightbox() {
|
1403 |
var bwg_touch_flag = false;
|
1404 |
-
jQuery( ".bwg_lightbox .bwg-item0, .bwg_lightbox .bwg_slide, .bwg_lightbox .bwg-carousel-image" ).on("click", function ( event ) {
|
1405 |
event.stopPropagation();
|
1406 |
event.preventDefault();
|
1407 |
-
var that = jQuery(this).
|
1408 |
if ( !bwg_touch_flag ) {
|
1409 |
bwg_touch_flag = true;
|
1410 |
setTimeout( function () {
|
@@ -1636,7 +1635,7 @@ function bwg_ajax(form_id, current_view, id, album_gallery_id, cur_album_id, typ
|
|
1636 |
}
|
1637 |
/* Show loading.*/
|
1638 |
jQuery("#ajax_loading_" + current_view).removeClass('bwg-hidden');
|
1639 |
-
jQuery(".bwg_load_more_ajax_loading").css({top: jQuery('#' +
|
1640 |
/* Disable scroll to prevent bugs with load more.*/
|
1641 |
if (typeof bwg_scroll_load_action === "function") {
|
1642 |
jQuery(window).off("scroll", bwg_scroll_load_action);
|
@@ -1687,6 +1686,7 @@ function bwg_ajax(form_id, current_view, id, album_gallery_id, cur_album_id, typ
|
|
1687 |
|
1688 |
post_data['shortcode_id'] = jQuery('#' + form_id).data("shortcode-id");
|
1689 |
post_data['bwg'] = current_view;
|
|
|
1690 |
|
1691 |
if ( srch_btn ) { /* Start search. */
|
1692 |
page_number = 1;
|
@@ -1727,7 +1727,7 @@ function bwg_ajax(form_id, current_view, id, album_gallery_id, cur_album_id, typ
|
|
1727 |
|
1728 |
/* Loading.*/
|
1729 |
jQuery("#ajax_loading_" + current_view).removeClass('bwg-hidden');
|
1730 |
-
jQuery(".bwg_load_more_ajax_loading").css({top: jQuery('#' +
|
1731 |
jQuery.ajax({
|
1732 |
type: "POST",
|
1733 |
url: ajax_url,
|
@@ -1935,13 +1935,15 @@ function bwg_cube(tz, ntx, nty, nrx, nry, wrx, wry, current_image_class, next_im
|
|
1935 |
bwg_params[bwg]['bwg_trans_in_progress'] = false;
|
1936 |
var data = bwg_params[bwg]['data'];
|
1937 |
var event_stack = bwg_params[bwg]['event_stack'];
|
1938 |
-
}
|
|
|
|
|
1939 |
gallery_box_data['bwg_trans_in_progress'] = false;
|
1940 |
var event_stack = gallery_box_data['event_stack'];
|
1941 |
}
|
1942 |
if (typeof event_stack !== 'undefined') {
|
1943 |
if (event_stack.length > 0) {
|
1944 |
-
key = event_stack[0].split("-");
|
1945 |
event_stack.shift();
|
1946 |
bwg_change_image(key[0], key[1], data, true, bwg);
|
1947 |
}
|
@@ -1975,44 +1977,45 @@ function bwg_fade(current_image_class, next_image_class, direction, bwg) {
|
|
1975 |
jQuery(".bwg_filmstrip_thumbnail").removeClass("bwg_thumb_active").addClass("bwg_thumb_deactive");
|
1976 |
jQuery("#bwg_filmstrip_thumbnail_" + gallery_box_data['bwg_current_key']).removeClass("bwg_thumb_deactive").addClass("bwg_thumb_active");
|
1977 |
}
|
1978 |
-
|
1979 |
-
|
1980 |
-
|
1981 |
-
|
1982 |
-
|
1983 |
-
} else {
|
1984 |
-
gallery_box_data['bwg_trans_in_progress'] = false;
|
1985 |
-
}
|
1986 |
-
}
|
1987 |
-
if (bwg_testBrowser_cssTransitions()) {
|
1988 |
-
jQuery(next_image_class).css('transition', 'opacity ' + bwg_transition_dur + 'ms linear');
|
1989 |
-
jQuery(current_image_class).css({'opacity' : 0, 'z-index': 1});
|
1990 |
-
jQuery(next_image_class).css({'opacity' : 1, 'z-index' : 2});
|
1991 |
-
jQuery(next_image_class).one('webkitTransitionEnd transitionend otransitionend oTransitionEnd mstransitionend', jQuery.proxy(bwg_after_trans));
|
1992 |
}
|
1993 |
else {
|
1994 |
-
|
1995 |
-
jQuery(next_image_class).animate({
|
1996 |
-
'opacity' : 1,
|
1997 |
-
'z-index': 2
|
1998 |
-
}, {
|
1999 |
-
duration: bwg_transition_dur,
|
2000 |
-
complete: function () {
|
2001 |
-
if( type_slideshow ) {
|
2002 |
-
bwg_params[bwg]['bwg_trans_in_progress'] = false;
|
2003 |
-
} else {
|
2004 |
-
gallery_box_data['bwg_trans_in_progress'] = false;
|
2005 |
-
}
|
2006 |
-
jQuery(current_image_class).html('');
|
2007 |
-
bwg_after_trans();
|
2008 |
-
}
|
2009 |
-
});
|
2010 |
-
/* For IE.*/
|
2011 |
-
jQuery(current_image_class).fadeTo(bwg_transition_dur, 0);
|
2012 |
-
jQuery(next_image_class).fadeTo(bwg_transition_dur, 1);
|
2013 |
}
|
2014 |
-
|
2015 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016 |
}
|
2017 |
}
|
2018 |
|
9 |
/* Carousel params */
|
10 |
var bwg_params_carousel = [];
|
11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
jQuery(document).ready(function () {
|
13 |
|
14 |
document.addEventListener("visibilitychange", function() {
|
187 |
function bwg_blog_style_onload() {
|
188 |
jQuery(".bwg_blog_style").each(function () {
|
189 |
bwg = jQuery(this).attr('data-bwg');
|
190 |
+
var data_right_click = jQuery("#bwg_blog_style_"+bwg);
|
191 |
jQuery('.bwg_embed_frame_16x9_'+bwg).each(function (e) {
|
192 |
/* Conflict with Sydney Theme */
|
193 |
if ( jQuery('.bwg_blog_style_image_' + bwg).find('.fluid-width-video-wrapper').length ) {
|
984 |
if ( jQuery( this ).find("img").attr("data-width").length > 0 && jQuery( this ).find("img").attr("data-height").length > 0 ) {
|
985 |
scale = jQuery( this ).find("img").data("width")/jQuery( this ).find("img").data("height");
|
986 |
scaleHeight = jQuery( this ).width()/scale;
|
987 |
+
/* calculating height of image title and description */
|
988 |
+
var k = + ( jQuery(this).find( '.bwg-title1' ).height() + jQuery(this).find( '.bwg-masonry-thumb-description' ).height() );
|
989 |
+
jQuery(this).height( scaleHeight + k );
|
990 |
}
|
991 |
/* Use getBoundingClientRect instead of jQuery.height() to avoid rounding. */
|
992 |
column_heights[order] += jQuery( this )[0].getBoundingClientRect().height;
|
1290 |
});
|
1291 |
}
|
1292 |
/*IMPORTANT!*/
|
1293 |
+
var bwg = container.data('bwg');
|
1294 |
jQuery(".bwg_mosaic_thumbnails_" + bwg).css({visibility: 'visible'});
|
1295 |
jQuery(".tablenav-pages_" + bwg).css({visibility: 'visible'});
|
1296 |
bwg_container_loaded(bwg);
|
1301 |
dfd.resolve(container);
|
1302 |
|
1303 |
if (container.attr('data-image-title') == 'hover') {
|
1304 |
+
var padding_px = parseInt(container.attr('data-thumb-padding')) / 2;
|
1305 |
+
var border_px = parseInt(container.attr('data-thumb-border'));
|
1306 |
+
var border_and_padding = border_px + padding_px;
|
1307 |
+
bwg_mosaic_title_on_hover(bwg, container, border_and_padding);
|
1308 |
}
|
1309 |
if (container.attr('data-ecommerce-icon') == 'hover') {
|
1310 |
jQuery(".bwg_mosaic_thumb_spun_" + bwg).on("mouseenter", function() {
|
1400 |
|
1401 |
function bwg_add_lightbox() {
|
1402 |
var bwg_touch_flag = false;
|
1403 |
+
jQuery( ".bwg_lightbox .bwg-item0, .bwg_lightbox .bwg_slide, .bwg_lightbox .bwg-carousel-image, .bwg_lightbox .bwg-title1" ).on("click", function ( event ) {
|
1404 |
event.stopPropagation();
|
1405 |
event.preventDefault();
|
1406 |
+
var that = jQuery(this).closest('a');
|
1407 |
if ( !bwg_touch_flag ) {
|
1408 |
bwg_touch_flag = true;
|
1409 |
setTimeout( function () {
|
1635 |
}
|
1636 |
/* Show loading.*/
|
1637 |
jQuery("#ajax_loading_" + current_view).removeClass('bwg-hidden');
|
1638 |
+
jQuery(".bwg_load_more_ajax_loading").css({top: jQuery('#bwg_container1_' + bwg).height() - jQuery(".bwg_load_more_ajax_loading").height() });
|
1639 |
/* Disable scroll to prevent bugs with load more.*/
|
1640 |
if (typeof bwg_scroll_load_action === "function") {
|
1641 |
jQuery(window).off("scroll", bwg_scroll_load_action);
|
1686 |
|
1687 |
post_data['shortcode_id'] = jQuery('#' + form_id).data("shortcode-id");
|
1688 |
post_data['bwg'] = current_view;
|
1689 |
+
post_data['current_url'] = encodeURI(jQuery('#bwg_container1_' + current_view).data("current-url"));
|
1690 |
|
1691 |
if ( srch_btn ) { /* Start search. */
|
1692 |
page_number = 1;
|
1727 |
|
1728 |
/* Loading.*/
|
1729 |
jQuery("#ajax_loading_" + current_view).removeClass('bwg-hidden');
|
1730 |
+
jQuery(".bwg_load_more_ajax_loading").css({top: jQuery('#bwg_container1_' + bwg).height() - jQuery(".bwg_load_more_ajax_loading").height()});
|
1731 |
jQuery.ajax({
|
1732 |
type: "POST",
|
1733 |
url: ajax_url,
|
1935 |
bwg_params[bwg]['bwg_trans_in_progress'] = false;
|
1936 |
var data = bwg_params[bwg]['data'];
|
1937 |
var event_stack = bwg_params[bwg]['event_stack'];
|
1938 |
+
}
|
1939 |
+
else {
|
1940 |
+
var data = '';
|
1941 |
gallery_box_data['bwg_trans_in_progress'] = false;
|
1942 |
var event_stack = gallery_box_data['event_stack'];
|
1943 |
}
|
1944 |
if (typeof event_stack !== 'undefined') {
|
1945 |
if (event_stack.length > 0) {
|
1946 |
+
var key = event_stack[0].split("-");
|
1947 |
event_stack.shift();
|
1948 |
bwg_change_image(key[0], key[1], data, true, bwg);
|
1949 |
}
|
1977 |
jQuery(".bwg_filmstrip_thumbnail").removeClass("bwg_thumb_active").addClass("bwg_thumb_deactive");
|
1978 |
jQuery("#bwg_filmstrip_thumbnail_" + gallery_box_data['bwg_current_key']).removeClass("bwg_thumb_deactive").addClass("bwg_thumb_active");
|
1979 |
}
|
1980 |
+
function bwg_after_trans() {
|
1981 |
+
jQuery(".bwg_image_info").show();
|
1982 |
+
bwg_change_watermark_container( bwg );
|
1983 |
+
if ( type_slideshow ) {
|
1984 |
+
bwg_params[bwg]['bwg_trans_in_progress'] = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1985 |
}
|
1986 |
else {
|
1987 |
+
gallery_box_data['bwg_trans_in_progress'] = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1988 |
}
|
1989 |
+
}
|
1990 |
+
if (bwg_testBrowser_cssTransitions()) {
|
1991 |
+
jQuery(next_image_class).css('transition', 'opacity ' + bwg_transition_dur + 'ms linear');
|
1992 |
+
jQuery(current_image_class).css({'opacity' : 0, 'z-index': 1});
|
1993 |
+
jQuery(next_image_class).css({'opacity' : 1, 'z-index' : 2});
|
1994 |
+
jQuery(next_image_class).one('webkitTransitionEnd transitionend otransitionend oTransitionEnd mstransitionend', jQuery.proxy(bwg_after_trans));
|
1995 |
+
}
|
1996 |
+
else {
|
1997 |
+
jQuery(current_image_class).animate({'opacity' : 0, 'z-index' : 1}, bwg_transition_dur);
|
1998 |
+
jQuery(next_image_class).animate({
|
1999 |
+
'opacity' : 1,
|
2000 |
+
'z-index': 2
|
2001 |
+
}, {
|
2002 |
+
duration: bwg_transition_dur,
|
2003 |
+
complete: function () {
|
2004 |
+
if( type_slideshow ) {
|
2005 |
+
bwg_params[bwg]['bwg_trans_in_progress'] = false;
|
2006 |
+
} else {
|
2007 |
+
gallery_box_data['bwg_trans_in_progress'] = false;
|
2008 |
+
}
|
2009 |
+
jQuery(current_image_class).html('');
|
2010 |
+
bwg_after_trans();
|
2011 |
+
}
|
2012 |
+
});
|
2013 |
+
/* For IE.*/
|
2014 |
+
jQuery(current_image_class).fadeTo(bwg_transition_dur, 0);
|
2015 |
+
jQuery(next_image_class).fadeTo(bwg_transition_dur, 1);
|
2016 |
+
}
|
2017 |
+
if (bwg_transition_dur == 0) {
|
2018 |
+
bwg_after_trans();
|
2019 |
}
|
2020 |
}
|
2021 |
|
js/bwg_shortcode.js
CHANGED
@@ -240,7 +240,7 @@ function bwg_shortcode_hide_show_params() {
|
|
240 |
jQuery("#tr_album_extended_resizable_mosaic").show();
|
241 |
jQuery("#tr_album_extended_mosaic_total_width").show();
|
242 |
}
|
243 |
-
if (jQuery('#
|
244 |
jQuery("#tr_show_masonry_thumb_description").show();
|
245 |
}
|
246 |
bwg_pagination_description(jQuery('input[name=image_enable_page]:checked'));
|
@@ -376,7 +376,12 @@ function bwg_gallery_type(gallery_type) {
|
|
376 |
jQuery("#tr_gallery").css('display', 'none');
|
377 |
jQuery("#tr_album").css('display', 'none');
|
378 |
var basic_metabox_title = jQuery('#bwg_basic_metabox_title');
|
379 |
-
|
|
|
|
|
|
|
|
|
|
|
380 |
jQuery("#tr_ecommerce_icon_hover").css('display', 'none');
|
381 |
jQuery("#tr_ecommerce_icon_hover .ecommerce_icon_show").css('display', 'none');
|
382 |
jQuery("#tr_tag").css('display', 'none');
|
240 |
jQuery("#tr_album_extended_resizable_mosaic").show();
|
241 |
jQuery("#tr_album_extended_mosaic_total_width").show();
|
242 |
}
|
243 |
+
if (jQuery('#thumbnails_masonry').is(':checked')) {
|
244 |
jQuery("#tr_show_masonry_thumb_description").show();
|
245 |
}
|
246 |
bwg_pagination_description(jQuery('input[name=image_enable_page]:checked'));
|
376 |
jQuery("#tr_gallery").css('display', 'none');
|
377 |
jQuery("#tr_album").css('display', 'none');
|
378 |
var basic_metabox_title = jQuery('#bwg_basic_metabox_title');
|
379 |
+
if( jQuery("#" + gallery_type).attr('class') == 'album_type_radio' ) {
|
380 |
+
basic_metabox_title.text(basic_metabox_title.attr('data-title-album'));
|
381 |
+
}
|
382 |
+
else {
|
383 |
+
basic_metabox_title.text(basic_metabox_title.attr('data-title-gallery'));
|
384 |
+
}
|
385 |
jQuery("#tr_ecommerce_icon_hover").css('display', 'none');
|
386 |
jQuery("#tr_ecommerce_icon_hover .ecommerce_icon_show").css('display', 'none');
|
387 |
jQuery("#tr_tag").css('display', 'none');
|
js/scripts.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var bwg_current_filmstrip_pos,total_thumbnail_count,key,startPoint,endPoint,bwg_image_info_pos,filmstrip_width,preloadCount,filmstrip_thumbnail_width,filmstrip_thumbnail_height,addthis_share,lightbox_comment_pos,bwg_transition_duration,bwg_playInterval,isPopUpOpened=!1,bwg_overflow_initial_value=!1,bwg_overflow_x_initial_value=!1,bwg_overflow_y_initial_value=!1;function gallery_box_ready(){filmstrip_thumbnail_width=jQuery(".bwg_filmstrip_thumbnail").width(),filmstrip_thumbnail_height=jQuery(".bwg_filmstrip_thumbnail").height(),1==gallery_box_data.open_with_fullscreen?(filmstrip_width=jQuery(window).width(),filmstrip_height=jQuery(window).height()):(filmstrip_width=jQuery(".bwg_filmstrip_container").width(),filmstrip_height=jQuery(".bwg_filmstrip_container").height()),preloadCount="horizontal"==gallery_box_data.filmstrip_direction?parseInt(filmstrip_width/filmstrip_thumbnail_width)+gallery_box_data.preload_images_count:parseInt(filmstrip_height/filmstrip_thumbnail_height)+gallery_box_data.preload_images_count,total_thumbnail_count=jQuery(".bwg_filmstrip_thumbnail").length,key=parseInt(jQuery("#bwg_current_image_key").val()),startPoint=0,endPoint=key+preloadCount,jQuery(document).ready(function(){bwg_load_visible_images(key,preloadCount,total_thumbnail_count),jQuery(".pge_tabs li a").on("click",function(){return jQuery(".pge_tabs_container > div").hide(),jQuery(".pge_tabs li").removeClass("pge_active"),jQuery(jQuery(this).attr("href")).show(),jQuery(this).closest("li").addClass("pge_active"),jQuery("[name=type]").val(jQuery(this).attr("href").substr(1)),!1});var e=jQuery("#bwg_rated").attr("data-params");bwg_rating((e=JSON.parse(e)).current_rate,e.current_rate_count,e.current_avg_rating,e.current_image_key)}),1==gallery_box_data.is_pro&&1==gallery_box_data.enable_addthis&&gallery_box_data.addthis_profile_id&&(addthis_share={url:gallery_box_data.share_url}),lightbox_comment_pos=gallery_box_data.lightbox_comment_pos,bwg_image_info_pos=jQuery(".bwg_ctrl_btn_container").length?jQuery(".bwg_ctrl_btn_container").height():0,bwg_transition_duration=gallery_box_data.slideshow_interval<4*gallery_box_data.slideshow_effect_duration&&0!=gallery_box_data.slideshow_interval?1e3*gallery_box_data.slideshow_interval/4:1e3*gallery_box_data.slideshow_effect_duration,gallery_box_data.bwg_transition_duration=bwg_transition_duration,gallery_box_data.bwg_trans_in_progress=!1,(jQuery("#spider_popup_wrap").width()>=jQuery(window).width()||jQuery("#spider_popup_wrap").height()>=jQuery(window).height())&&jQuery(".spider_popup_close").attr("class","bwg_ctrl_btn spider_popup_close_fullscreen"),window.clearInterval(bwg_playInterval),bwg_current_filmstrip_pos=gallery_box_data.current_pos,jQuery(document).on("keydown",function(e){jQuery("#bwg_name").is(":focus")||jQuery("#bwg_email").is(":focus")||jQuery("#bwg_comment").is(":focus")||jQuery("#bwg_captcha_input").is(":focus")||(39===e.keyCode?bwg_change_image(parseInt(jQuery("#bwg_current_image_key").val()),parseInt(jQuery("#bwg_current_image_key").val())+1):37===e.keyCode?bwg_change_image(parseInt(jQuery("#bwg_current_image_key").val()),parseInt(jQuery("#bwg_current_image_key").val())-1):27===e.keyCode?spider_destroypopup(1e3):32===e.keyCode&&jQuery(".bwg_play_pause").trigger("click"))}),jQuery(window).resize(function(){void 0!==jQuery().fullscreen&&jQuery.isFunction(jQuery().fullscreen)&&(jQuery.fullscreen.isFullScreen()||bwg_popup_resize())});var r=gallery_box_data.image_width,_=gallery_box_data.image_height;if(1==gallery_box_data.is_pro){1==gallery_box_data.enable_addthis&&gallery_box_data.addthis_profile_id&&jQuery(".at4-share-outer").show(),spider_set_input_value("rate_ajax_task","save_hit_count"),spider_rate_ajax_save("bwg_rate_form");var e=gallery_box_data.data,t=gallery_box_data.current_image_key;jQuery(".bwg_image_hits span").html(++e[t].hit_count);var i=window.location.hash;i&&"-1"!=i.indexOf("bwg")||(location.replace("#bwg"+gallery_box_data.gallery_id+"/"+gallery_box_data.current_image_id),history.replaceState(void 0,void 0,"#bwg"+gallery_box_data.gallery_id+"/"+gallery_box_data.current_image_id))}1==gallery_box_data.image_right_click&&(jQuery(".bwg_image_wrap").bind("contextmenu",function(e){return!1}),jQuery(".bwg_image_wrap").css("webkitTouchCallout","none")),jQuery("#spider_popup_wrap").bind("touchmove",function(e){e.preventDefault()}),void 0!==jQuery().swiperight&&jQuery.isFunction(jQuery().swiperight)&&jQuery("#spider_popup_wrap .bwg_image_wrap").swiperight(function(){return bwg_change_image(parseInt(jQuery("#bwg_current_image_key").val()),(parseInt(jQuery("#bwg_current_image_key").val())+gallery_box_data.data.length-1)%gallery_box_data.data.length),!1}),void 0!==jQuery().swipeleft&&jQuery.isFunction(jQuery().swipeleft)&&jQuery("#spider_popup_wrap .bwg_image_wrap").swipeleft(function(){return bwg_change_image(parseInt(jQuery("#bwg_current_image_key").val()),(parseInt(jQuery("#bwg_current_image_key").val())+1)%gallery_box_data.data.length),!1}),bwg_reset_zoom();var a=/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase())?"touchend":"click";jQuery("#spider_popup_left").on(a,function(){return bwg_change_image(parseInt(jQuery("#bwg_current_image_key").val()),(parseInt(jQuery("#bwg_current_image_key").val())+gallery_box_data.data.length-1)%gallery_box_data.data.length),!1}),jQuery("#spider_popup_right").on(a,function(){return bwg_change_image(parseInt(jQuery("#bwg_current_image_key").val()),(parseInt(jQuery("#bwg_current_image_key").val())+1)%gallery_box_data.data.length),!1}),-1!=navigator.appVersion.indexOf("MSIE 10")||-1!=navigator.appVersion.indexOf("MSIE 9")?setTimeout(function(){bwg_popup_resize()},1):bwg_popup_resize(),jQuery(".bwg_watermark").css({display:"none"}),setTimeout(function(){bwg_change_watermark_container()},500),void 0!==jQuery().fullscreen&&jQuery.isFunction(jQuery().fullscreen)&&(jQuery.fullscreen.isNativelySupported()||jQuery(".bwg_fullscreen").hide()),"horizontal"==gallery_box_data.filmstrip_direction?(jQuery(".bwg_image_container").height(jQuery(".bwg_image_wrap").height()-gallery_box_data.image_filmstrip_height),jQuery(".bwg_image_container").width(jQuery(".bwg_image_wrap").width())):(jQuery(".bwg_image_container").height(jQuery(".bwg_image_wrap").height()),jQuery(".bwg_image_container").width(jQuery(".bwg_image_wrap").width()-gallery_box_data.image_filmstrip_width)),void 0!==jQuery().mCustomScrollbar&&jQuery.isFunction(jQuery().mCustomScrollbar)&&jQuery(".bwg_comments,.bwg_ecommerce_panel, .bwg_image_info").mCustomScrollbar({scrollInertia:150,advanced:{updateOnContentResize:!0}});var s=/Firefox/i.test(navigator.userAgent)?"DOMMouseScroll":"mousewheel";jQuery(".bwg_filmstrip").on(s,function(e){var t=window.event||e,i=(t=t.originalEvent?t.originalEvent:t).detail?-40*t.detail:t.wheelDelta,a=/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase());0<i?jQuery(".bwg_filmstrip_left").trigger(a?"touchend":"click"):jQuery(".bwg_filmstrip_right").trigger(a?"touchend":"click")}),jQuery(".bwg_filmstrip_right").on(a,function(){jQuery(".bwg_filmstrip_thumbnails").stop(!0,!1),"left"==gallery_box_data.left_or_top?"width"==gallery_box_data.width_or_height?(jQuery(".bwg_filmstrip_thumbnails").position().left>=-(jQuery(".bwg_filmstrip_thumbnails").width()-jQuery(".bwg_filmstrip").width())&&(jQuery(".bwg_filmstrip_left").css({opacity:1}),jQuery(".bwg_filmstrip_thumbnails").position().left<-(jQuery(".bwg_filmstrip_thumbnails").width()-jQuery(".bwg_filmstrip").width()-(gallery_box_data.filmstrip_thumb_right_left_space+gallery_box_data.image_filmstrip_width+gallery_box_data.all_images_right_left_space))?jQuery(".bwg_filmstrip_thumbnails").animate({left:-(jQuery(".bwg_filmstrip_thumbnails").width()-jQuery(".bwg_filmstrip").width()-gallery_box_data.all_images_right_left_space)},500,"linear"):jQuery(".bwg_filmstrip_thumbnails").animate({left:jQuery(".bwg_filmstrip_thumbnails").position().left-(gallery_box_data.filmstrip_thumb_right_left_space+gallery_box_data.image_filmstrip_width)},500,"linear")),window.setTimeout(function(){jQuery(".bwg_filmstrip_thumbnails").position().left==-(jQuery(".bwg_filmstrip_thumbnails").width()-jQuery(".bwg_filmstrip").width())&&jQuery(".bwg_filmstrip_right").css({opacity:.3})},500)):(jQuery(".bwg_filmstrip_thumbnails").position().left>=-(jQuery(".bwg_filmstrip_thumbnails").height()-jQuery(".bwg_filmstrip").height())&&(jQuery(".bwg_filmstrip_left").css({opacity:1}),jQuery(".bwg_filmstrip_thumbnails").position().left<-(jQuery(".bwg_filmstrip_thumbnails").height()-jQuery(".bwg_filmstrip").height()-(gallery_box_data.filmstrip_thumb_right_left_space+gallery_box_data.image_filmstrip_width+gallery_box_data.all_images_right_left_space))?jQuery(".bwg_filmstrip_thumbnails").animate({left:-(jQuery(".bwg_filmstrip_thumbnails").height()-jQuery(".bwg_filmstrip").height()-gallery_box_data.all_images_right_left_space)},500,"linear"):jQuery(".bwg_filmstrip_thumbnails").animate({left:jQuery(".bwg_filmstrip_thumbnails").position().left-(gallery_box_data.filmstrip_thumb_right_left_space+gallery_box_data.image_filmstrip_width)},500,"linear")),window.setTimeout(function(){jQuery(".bwg_filmstrip_thumbnails").position().left==-(jQuery(".bwg_filmstrip_thumbnails").height()-jQuery(".bwg_filmstrip").height())&&jQuery(".bwg_filmstrip_right").css({opacity:.3})},500)):"width"==gallery_box_data.width_or_height?(jQuery(".bwg_filmstrip_thumbnails").position().top>=-(jQuery(".bwg_filmstrip_thumbnails").width()-jQuery(".bwg_filmstrip").width())&&(jQuery(".bwg_filmstrip_left").css({opacity:1}),jQuery(".bwg_filmstrip_thumbnails").position().top<-(jQuery(".bwg_filmstrip_thumbnails").width()-jQuery(".bwg_filmstrip").width()-(gallery_box_data.filmstrip_thumb_right_left_space+gallery_box_data.image_filmstrip_width+gallery_box_data.all_images_right_left_space))?jQuery(".bwg_filmstrip_thumbnails").animate({left:-(jQuery(".bwg_filmstrip_thumbnails").width()-jQuery(".bwg_filmstrip").width()-gallery_box_data.all_images_right_left_space)},500,"linear"):jQuery(".bwg_filmstrip_thumbnails").animate({left:jQuery(".bwg_filmstrip_thumbnails").position().top-(gallery_box_data.filmstrip_thumb_right_left_space+gallery_box_data.image_filmstrip_width)},500,"linear")),window.setTimeout(function(){jQuery(".bwg_filmstrip_thumbnails").position().left==-(jQuery(".bwg_filmstrip_thumbnails").width()-jQuery(".bwg_filmstrip").width())&&jQuery(".bwg_filmstrip_right").css({opacity:.3})},500)):(jQuery(".bwg_filmstrip_thumbnails").position().top>=-(jQuery(".bwg_filmstrip_thumbnails").height()-jQuery(".bwg_filmstrip").height())&&(jQuery(".bwg_filmstrip_left").css({opacity:1}),jQuery(".bwg_filmstrip_thumbnails").position().top<-(jQuery(".bwg_filmstrip_thumbnails").height()-jQuery(".bwg_filmstrip").height()-(gallery_box_data.filmstrip_thumb_right_left_space+gallery_box_data.image_filmstrip_width+gallery_box_data.all_images_right_left_space))?jQuery(".bwg_filmstrip_thumbnails").animate({top:-(jQuery(".bwg_filmstrip_thumbnails").height()-jQuery(".bwg_filmstrip").height()-gallery_box_data.all_images_right_left_space)},500,"linear"):jQuery(".bwg_filmstrip_thumbnails").animate({top:jQuery(".bwg_filmstrip_thumbnails").position().top-(gallery_box_data.filmstrip_thumb_right_left_space+gallery_box_data.image_filmstrip_width)},500,"linear")),window.setTimeout(function(){jQuery(".bwg_filmstrip_thumbnails").position().left==-(jQuery(".bwg_filmstrip_thumbnails").height()-jQuery(".bwg_filmstrip").height())&&jQuery(".bwg_filmstrip_right").css({opacity:.3})},500))}),"left"==gallery_box_data.left_or_top?jQuery(".bwg_filmstrip_left").on(a,function(){jQuery(".bwg_filmstrip_thumbnails").stop(!0,!1),jQuery(".bwg_filmstrip_thumbnails").position().left<0&&(jQuery(".bwg_filmstrip_right").css({opacity:1}),jQuery(".bwg_filmstrip_thumbnails").position().left>-(gallery_box_data.filmstrip_thumb_right_left_space+gallery_box_data.image_filmstrip_width)?jQuery(".bwg_filmstrip_thumbnails").animate({left:0},500,"linear"):jQuery(".bwg_filmstrip_thumbnails").animate({left:jQuery(".bwg_filmstrip_thumbnails").position().left+gallery_box_data.image_filmstrip_width+gallery_box_data.filmstrip_thumb_right_left_space},500,"linear")),window.setTimeout(function(){0==jQuery(".bwg_filmstrip_thumbnails").position().left&&jQuery(".bwg_filmstrip_left").css({opacity:.3})},500)}):jQuery(".bwg_filmstrip_left").on(a,function(){jQuery(".bwg_filmstrip_thumbnails").stop(!0,!1),jQuery(".bwg_filmstrip_thumbnails").position().top<0&&(jQuery(".bwg_filmstrip_right").css({opacity:1}),jQuery(".bwg_filmstrip_thumbnails").position().top>-(gallery_box_data.filmstrip_thumb_right_left_space+gallery_box_data.image_filmstrip_width)?jQuery(".bwg_filmstrip_thumbnails").animate({top:0},500,"linear"):jQuery(".bwg_filmstrip_thumbnails").animate({top:jQuery(".bwg_filmstrip_thumbnails").position().top+gallery_box_data.image_filmstrip_width+gallery_box_data.filmstrip_thumb_right_left_space},500,"linear")),window.setTimeout(function(){0==jQuery(".bwg_filmstrip_thumbnails").position().top&&jQuery(".bwg_filmstrip_left").css({opacity:.3})},500)}),"width"==gallery_box_data.width_or_height?bwg_set_filmstrip_pos(jQuery(".bwg_filmstrip").width(),"",gallery_box_data):bwg_set_filmstrip_pos(jQuery(".bwg_filmstrip").height(),"",gallery_box_data),jQuery(".bwg_info").on(a,function(){if("none"==jQuery(".bwg_image_info_container1").css("display")){jQuery(".bwg_image_info_container1").css("display","table-cell"),jQuery(".bwg_info").attr("title",bwg_objectsL10n.bwg_hide_info);jQuery(".bwg_ctrl_btn_container").length&&jQuery(".bwg_ctrl_btn_container").height();jQuery(".bwg_image_info").css("height","auto"),bwg_info_height_set()}else jQuery(".bwg_image_info_container1").css("display","none"),jQuery(".bwg_info").attr("title",bwg_objectsL10n.bwg_show_info)}),jQuery(".bwg_rate").on(a,function(){"none"==jQuery(".bwg_image_rate_container1").css("display")?(jQuery(".bwg_image_rate_container1").css("display","table-cell"),jQuery(".bwg_rate").attr("title",bwg_objectsL10n.bwg_hide_rating)):(jQuery(".bwg_image_rate_container1").css("display","none"),jQuery(".bwg_rate").attr("title",bwg_objectsL10n.bwg_show_rating))}),jQuery(".bwg_comment, .bwg_comments_close_btn").on(a,function(){bwg_comment()}),jQuery(".bwg_ecommerce, .bwg_ecommerce_close_btn").on(a,function(){bwg_ecommerce()}),jQuery(".bwg_toggle_container").on(a,function(){var e="top"==gallery_box_data.lightbox_ctrl_btn_pos?"bwg-icon-caret-up":"bwg-icon-caret-down",t="top"==gallery_box_data.lightbox_ctrl_btn_pos?"bwg-icon-caret-down":"bwg-icon-caret-up";jQuery(".bwg_toggle_container i").hasClass(e)?(gallery_box_data.enable_image_filmstrip&&"bottom"==gallery_box_data.lightbox_filmstrip_pos||"bottom"!=gallery_box_data.lightbox_ctrl_btn_pos||"bottom"!=gallery_box_data.lightbox_rate_pos?gallery_box_data.enable_image_filmstrip&&"top"==gallery_box_data.lightbox_filmstrip_pos||"top"!=gallery_box_data.lightbox_ctrl_btn_pos||"top"!=gallery_box_data.lightbox_rate_pos||jQuery(".bwg_image_rate").animate({top:0},500):jQuery(".bwg_image_rate").animate({bottom:0},500),gallery_box_data.enable_image_filmstrip&&"bottom"==gallery_box_data.lightbox_filmstrip_pos||"bottom"!=gallery_box_data.lightbox_ctrl_btn_pos||"bottom"!=gallery_box_data.lightbox_hit_pos?gallery_box_data.enable_image_filmstrip&&"top"==gallery_box_data.lightbox_filmstrip_pos||"top"!=gallery_box_data.lightbox_ctrl_btn_pos||"top"!=gallery_box_data.lightbox_hit_pos||jQuery(".bwg_image_hit").animate({top:0},500):jQuery(".bwg_image_hit").animate({bottom:0},500),"bottom"==gallery_box_data.lightbox_ctrl_btn_pos?(jQuery(".bwg_ctrl_btn_container").animate({bottom:"-"+jQuery(".bwg_ctrl_btn_container").height()},500).addClass("closed"),jQuery(".bwg_toggle_container").animate({bottom:0},{duration:500,complete:function(){jQuery(".bwg_toggle_container i").attr("class","bwg_toggle_btn "+t)}})):(jQuery(".bwg_ctrl_btn_container").animate({top:"-"+jQuery(".bwg_ctrl_btn_container").height()},500).addClass("closed"),jQuery(".bwg_toggle_container").animate({top:0},{duration:500,complete:function(){jQuery(".bwg_toggle_container i").attr("class","bwg_toggle_btn "+t)}}))):(gallery_box_data.enable_image_filmstrip&&"bottom"==gallery_box_data.lightbox_filmstrip_pos||"bottom"!=gallery_box_data.lightbox_ctrl_btn_pos||"bottom"!=gallery_box_data.lightbox_rate_pos?gallery_box_data.enable_image_filmstrip&&"top"==gallery_box_data.lightbox_filmstrip_pos||"top"!=gallery_box_data.lightbox_ctrl_btn_pos||"top"!=gallery_box_data.lightbox_rate_pos||jQuery(".bwg_image_rate").animate({top:jQuery(".bwg_ctrl_btn_container").height()},500):jQuery(".bwg_image_rate").animate({bottom:jQuery(".bwg_ctrl_btn_container").height()},500),gallery_box_data.enable_image_filmstrip&&"bottom"==gallery_box_data.lightbox_filmstrip_pos||"bottom"!=gallery_box_data.lightbox_ctrl_btn_pos||"bottom"!=gallery_box_data.lightbox_hit_pos?gallery_box_data.enable_image_filmstrip&&"top"==gallery_box_data.lightbox_filmstrip_pos||"top"!=gallery_box_data.lightbox_ctrl_btn_pos||"top"!=gallery_box_data.lightbox_hit_pos||jQuery(".bwg_image_hit").animate({top:jQuery(".bwg_ctrl_btn_container").height()},500):jQuery(".bwg_image_hit").animate({bottom:jQuery(".bwg_ctrl_btn_container").height()},500),"bottom"==gallery_box_data.lightbox_ctrl_btn_pos?(jQuery(".bwg_ctrl_btn_container").animate({bottom:0},500).removeClass("closed"),jQuery(".bwg_toggle_container").animate({bottom:jQuery(".bwg_ctrl_btn_container").height()},{duration:500,complete:function(){jQuery(".bwg_toggle_container i").attr("class","bwg_toggle_btn "+e)}})):(jQuery(".bwg_ctrl_btn_container").animate({top:0},500).removeClass("closed"),jQuery(".bwg_toggle_container").animate({top:jQuery(".bwg_ctrl_btn_container").height()},{duration:500,complete:function(){jQuery(".bwg_toggle_container i").attr("class","bwg_toggle_btn "+e)}}))),bwg_info_position(!0)});var o=window.innerHeight;jQuery(".bwg_resize-full").on(a,function(){bwg_resize_full()}),jQuery(".bwg_fullscreen").on(a,function(){jQuery(".bwg_watermark").css({display:"none"});var e,t=0;if((jQuery(".bwg_comment_container").hasClass("bwg_open")||jQuery(".bwg_ecommerce_container").hasClass("bwg_open"))&&(t=jQuery(".bwg_comment_container").width()||jQuery(".bwg_ecommerce_container").width()),void 0!==jQuery().fullscreen&&jQuery.isFunction(jQuery().fullscreen))if(jQuery.fullscreen.isFullScreen())jQuery.fullscreen.exit(),e=o,jQuery(window).width()>gallery_box_data.image_width&&(r=gallery_box_data.image_width),window.innerHeight>gallery_box_data.image_height&&(_=gallery_box_data.image_height),gallery_box_data.open_with_fullscreen&&(r=jQuery(window).width(),_=e),jQuery("#spider_popup_wrap").on("fscreenclose",function(){jQuery("#spider_popup_wrap").css({width:r,height:_,left:"50%",top:"50%",marginLeft:-r/2,marginTop:-_/2,zIndex:1e5}),jQuery(".bwg_image_wrap").css({width:r-t}),jQuery(".bwg_image_container").css({height:_-("horizontal"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_height:0),width:r-t-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0)}),jQuery(".bwg_image_info").css("height","auto"),bwg_info_height_set(),jQuery(".bwg_popup_image").css({maxWidth:r-t-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0),maxHeight:_-("horizontal"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_height:0)}),jQuery(".bwg_popup_embed > .bwg_embed_frame > img, .bwg_popup_embed > .bwg_embed_frame > video").css({maxWidth:r-t-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0),maxHeight:_-("horizontal"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_height:0)}),bwg_resize_instagram_post(),bwg_change_watermark_container(),"width"==gallery_box_data.width_or_height?(jQuery(".bwg_filmstrip_container").css({width:r-("horizontal"==gallery_box_data.filmstrip_direction?"comment_container_width":0)}),jQuery(".bwg_filmstrip").css({width:r-("horizontal"==gallery_box_data.filmstrip_direction?"comment_container_width":0)-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height())}),bwg_set_filmstrip_pos(r-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height()),"",gallery_box_data)):(jQuery(".bwg_filmstrip_container").css({height:_-("horizontal"==gallery_box_data.filmstrip_direction?"comment_container_width":0)}),jQuery(".bwg_filmstrip").css({height:_-("horizontal"==gallery_box_data.filmstrip_direction?"comment_container_width":0)-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height())}),bwg_set_filmstrip_pos(_-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height()),"",gallery_box_data),"horizontal"!=gallery_box_data.filmstrip_direction&&jQuery(".bwg_filmstrip_right").css({top:_-jQuery(".bwg_filmstrip_right").height()})),jQuery(".bwg_resize-full").show(),jQuery(".bwg_resize-full").attr("class","bwg-icon-expand bwg_ctrl_btn bwg_resize-full"),jQuery(".bwg_resize-full").attr("title",bwg_objectsL10n.bwg_maximize),jQuery(".bwg_fullscreen").attr("class","bwg-icon-arrows-out bwg_ctrl_btn bwg_fullscreen"),jQuery(".bwg_fullscreen").attr("title",bwg_objectsL10n.bwg_fullscreen),jQuery("#spider_popup_wrap").width()<jQuery(window).width()&&jQuery("#spider_popup_wrap").height()<window.innerHeight&&jQuery(".spider_popup_close_fullscreen").attr("class","spider_popup_close")});else{jQuery("#spider_popup_wrap").fullscreen();var i=screen.width,a=screen.height;jQuery("#spider_popup_wrap").css({width:i,height:a,left:0,top:0,margin:0,zIndex:1e5}),jQuery(".bwg_image_wrap").css({width:i-t}),jQuery(".bwg_image_container").css({height:a-("horizontal"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_height:0),width:i-t-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0)}),jQuery(".bwg_image_info").css("height","auto"),bwg_info_height_set(),jQuery(".bwg_popup_image").css({maxWidth:i-t-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0),maxHeight:a-("horizontal"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_height:0)}),jQuery(".bwg_popup_embed > .bwg_embed_frame > img, .bwg_popup_embed > .bwg_embed_frame > video").css({maxWidth:i-t-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0),maxHeight:a-("horizontal"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_height:0)}),bwg_resize_instagram_post(),bwg_change_watermark_container(),"width"==gallery_box_data.width_or_height?(jQuery(".bwg_filmstrip_container").css({width:i-("horizontal"==gallery_box_data.filmstrip_direction?t:0)},500),jQuery(".bwg_filmstrip").css({width:i-("horizontal"==gallery_box_data.filmstrip_direction?t:0)-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height())},500),bwg_set_filmstrip_pos(i-("horizontal"==gallery_box_data.filmstrip_direction?t:0)-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height()),"",gallery_box_data)):(jQuery(".bwg_filmstrip_container").css({height:a-("horizontal"==gallery_box_data.filmstrip_direction)?"comment_container_width":0}),jQuery(".bwg_filmstrip").css({height:a-("horizontal"==gallery_box_data.filmstrip_direction?"comment_container_width":0)-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height())}),bwg_set_filmstrip_pos(a-("horizontal"==gallery_box_data.filmstrip_direction?"comment_container_width":0)-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height()),"",gallery_box_data),"horizontal"!=gallery_box_data.filmstrip_direction&&jQuery(".bwg_filmstrip_right").css({top:a-jQuery(".bwg_filmstrip_right").height()})),jQuery(".bwg_resize-full").hide(),jQuery(".bwg_fullscreen").attr("class","bwg-icon-compress bwg_ctrl_btn bwg_fullscreen"),jQuery(".bwg_fullscreen").attr("title",bwg_objectsL10n.bwg_exit_fullscreen),jQuery(".spider_popup_close").attr("class","bwg_ctrl_btn spider_popup_close_fullscreen")}return!1}),jQuery(".bwg_play_pause, .bwg_popup_image").on(a,function(){jQuery(".bwg_play_pause").length&&jQuery(".bwg_play_pause").hasClass("bwg-icon-play")&&!jQuery(".bwg_comment_container").hasClass("bwg_open")?(bwg_play(gallery_box_data.data),jQuery(".bwg_play_pause").attr("title",bwg_objectsL10n.bwg_pause),jQuery(".bwg_play_pause").attr("class","bwg-icon-pause bwg_ctrl_btn bwg_play_pause")):(window.clearInterval(bwg_playInterval),jQuery(".bwg_play_pause").attr("title",bwg_objectsL10n.bwg_play),jQuery(".bwg_play_pause").attr("class","bwg-icon-play bwg_ctrl_btn bwg_play_pause"))}),gallery_box_data.open_with_autoplay&&(bwg_play(gallery_box_data.data),jQuery(".bwg_play_pause").attr("title",bwg_objectsL10n.bwg_pause),jQuery(".bwg_play_pause").attr("class","bwg-icon-pause bwg_ctrl_btn bwg_play_pause")),gallery_box_data.open_with_fullscreen&&bwg_open_with_fullscreen(),jQuery(".bwg_popup_image").removeAttr("width"),jQuery(".bwg_popup_image").removeAttr("height"),jQuery(window).focus(function(){jQuery(".bwg_play_pause").length&&!jQuery(".bwg_play_pause").hasClass("bwg-icon-play")&&bwg_play(gallery_box_data.data)}),jQuery(window).blur(function(){event_stack=[],window.clearInterval(bwg_playInterval)});gallery_box_data.lightbox_ctrl_btn_pos;1==gallery_box_data.open_ecommerce&&setTimeout(function(){bwg_ecommerce()},400),1==gallery_box_data.open_comment&&bwg_comment()}function spider_createpopup(e,t,i,a,r,_,s,o){e=e.replace(/&/g,"&"),isPopUpOpened||(isPopUpOpened=!0,spider_hasalreadyreceivedpopup(_)||spider_isunsupporteduseragent()||(bwg_overflow_initial_value=jQuery("html").css("overflow"),bwg_overflow_x_initial_value=jQuery("html").css("overflow-x"),bwg_overflow_y_initial_value=jQuery("html").css("overflow-y"),jQuery("html").attr("style","overflow:hidden !important;"),jQuery("#bwg_spider_popup_loading_"+t).show(),jQuery("#spider_popup_overlay_"+t).css({display:"block"}),jQuery.ajax({type:"GET",url:e,success:function(e){var t=jQuery('<div id="spider_popup_wrap" class="spider_popup_wrap" style=" width:'+i+"px; height:"+a+"px; margin-top:-"+a/2+"px; margin-left: -"+i/2+'px; ">'+e+"</div>").hide().appendTo("body");gallery_box_ready(),spider_showpopup(_,s,t,r,o)},beforeSend:function(){},complete:function(){}})))}function spider_showpopup(e,t,i,a,r){var _=gallery_box_data.data,s=parseInt(jQuery("#bwg_current_image_key").val());void 0!==_[s]&&(isPopUpOpened=!0,-1<_[s].filetype.indexOf("EMBED_")?bwg_first_image_load(i):jQuery("#spider_popup_wrap .bwg_popup_image_spun img").prop("complete")?bwg_first_image_load(i):jQuery("#spider_popup_wrap .bwg_popup_image_spun img").on("load error",function(){bwg_first_image_load(i)}),spider_receivedpopup(e,t,r))}function bwg_first_image_load(e){e.show(),jQuery(".bwg_spider_popup_loading").hide(),1==gallery_box_data.preload_images&&bwg_preload_images(parseInt(jQuery("#bwg_current_image_key").val())),bwg_load_filmstrip(),bwg_info_height_set()}function spider_hasalreadyreceivedpopup(e){return-1<document.cookie.indexOf(e)&&delete document.cookie[document.cookie.indexOf(e)],!1}function spider_receivedpopup(e,t,i){var a=new Date;a.setDate(a.getDate()+t),document.cookie=e+"=true;expires="+a.toUTCString()+";path=/";var r=gallery_box_data.bwg_ctrl_btn_container_height;"bottom"==i?jQuery(".bwg_toggle_container").css("bottom",r+"px"):"top"==i&&jQuery(".bwg_toggle_container").css("top",r+"px")}function spider_isunsupporteduseragent(){return!window.XMLHttpRequest}function spider_destroypopup(e){null!=document.getElementById("spider_popup_wrap")&&(void 0!==jQuery().fullscreen&&jQuery.isFunction(jQuery().fullscreen)&&jQuery.fullscreen.isFullScreen()&&jQuery.fullscreen.exit(),"undefined"!=typeof enable_addthis&&enable_addthis&&jQuery(".at4-share-outer").hide(),setTimeout(function(){jQuery(".spider_popup_wrap").remove(),jQuery(".bwg_spider_popup_loading").css({display:"none"}),jQuery(".spider_popup_overlay").css({display:"none"}),jQuery(document).off("keydown"),!1!==bwg_overflow_initial_value&&jQuery("html").css("overflow",bwg_overflow_initial_value),!1!==bwg_overflow_x_initial_value&&jQuery("html").css("overflow-x",bwg_overflow_x_initial_value),!1!==bwg_overflow_y_initial_value&&jQuery("html").css("overflow-y",bwg_overflow_y_initial_value)},20)),isPopUpOpened=!1;var t=/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()),i=document.querySelector('meta[name="viewport"]');t&&i&&(i.content="width=device-width, initial-scale=1");var a=jQuery(document).scrollTop();bwg_objectsL10n.is_pro&&location.replace("#"),jQuery(document).scrollTop(a),void 0!==gallery_box_data.bwg_playInterval&&clearInterval(gallery_box_data.bwg_playInterval)}function get_ajax_pricelist(){var e={};return jQuery(".add_to_cart_msg").html(""),e.ajax_task="display",e.image_id=jQuery("#bwg_popup_image").attr("image_id"),jQuery("#ecommerce_ajax_loading").css("height",jQuery(".bwg_ecommerce_panel").css("height")),jQuery("#ecommerce_opacity_div").css("width",jQuery(".bwg_ecommerce_panel").css("width")),jQuery("#ecommerce_opacity_div").css("height",jQuery(".bwg_ecommerce_panel").css("height")),jQuery("#ecommerce_loading_div").css("width",jQuery(".bwg_ecommerce_panel").css("width")),jQuery("#ecommerce_loading_div").css("height",jQuery(".bwg_ecommerce_panel").css("height")),jQuery("#ecommerce_opacity_div").css("display","block"),jQuery("#ecommerce_loading_div").css("display","table-cell"),jQuery.ajax({type:"POST",url:jQuery("#bwg_ecommerce_form").attr("action"),data:e,success:function(e){jQuery(".pge_tabs li a").on("click",function(){return jQuery(".pge_tabs_container > div").hide(),jQuery(".pge_tabs li").removeClass("pge_active"),jQuery(jQuery(this).attr("href")).show(),jQuery(this).closest("li").addClass("pge_active"),jQuery("[name=type]").val(jQuery(this).attr("href").substr(1)),!1});var t=jQuery(e).find(".manual").html();jQuery(".manual").html(t);var i=jQuery(e).find(".downloads").html();jQuery(".downloads").html(i);var a=jQuery(e).find(".pge_options").html();jQuery(".pge_options").html(a);var r=jQuery(e).find(".pge_add_to_cart").html();jQuery(".pge_add_to_cart").html(r)},beforeSend:function(){},complete:function(){jQuery("#ecommerce_opacity_div").css("display","none"),jQuery("#ecommerce_loading_div").css("display","none")}}),!1}function spider_ajax_save(e){var t={};return t.bwg_name=jQuery("#bwg_name").val(),t.bwg_comment=jQuery("#bwg_comment").val(),t.bwg_email=jQuery("#bwg_email").val(),t.bwg_captcha_input=jQuery("#bwg_captcha_input").val(),t.ajax_task=jQuery("#ajax_task").val(),t.image_id=jQuery("#image_id").val(),t.comment_id=jQuery("#comment_id").val(),jQuery("#ajax_loading").css("height",jQuery(".bwg_comments").css("height")),jQuery("#opacity_div").css("width",jQuery(".bwg_comments").css("width")),jQuery("#opacity_div").css("height",jQuery(".bwg_comments").css("height")),jQuery("#loading_div").css("width",jQuery(".bwg_comments").css("width")),jQuery("#loading_div").css("height",jQuery(".bwg_comments").css("height")),document.getElementById("opacity_div").style.display="",document.getElementById("loading_div").style.display="table-cell",jQuery.ajax({type:"POST",url:jQuery("#"+e).attr("action"),data:t,success:function(e){var t=jQuery(e).find(".bwg_comments").html();jQuery(".bwg_comments").html(t)},beforeSend:function(){},complete:function(){document.getElementById("opacity_div").style.display="none",document.getElementById("loading_div").style.display="none",jQuery(".bwg_comments").mCustomScrollbar({scrollInertia:150,advanced:{updateOnContentResize:!0}}),jQuery(".bwg_comments_close_btn").click(bwg_comment),bwg_captcha_refresh("bwg_captcha")}}),!1}function spider_rate_ajax_save(i){var e={};return e.image_id=jQuery("#"+i+" input[name='image_id']").val(),e.rate=jQuery("#"+i+" input[name='score']").val(),e.ajax_task=jQuery("#rate_ajax_task").val(),jQuery.ajax({type:"POST",url:jQuery("#"+i).attr("action"),data:e,success:function(e){var t=jQuery(e).find("#"+i).html();jQuery("#"+i).html(t)},beforeSend:function(){},complete:function(){}})}function spider_set_input_value(e,t){document.getElementById(e)&&(document.getElementById(e).value=t)}function spider_form_submit(e,t){document.getElementById(t)&&document.getElementById(t).submit(),e.preventDefault?e.preventDefault():e.returnValue=!1}function spider_check_required(e,t){return""==jQuery("#"+e).val()&&(alert(t+" "+bwg_objectsL10n.bwg_field_required),jQuery("#"+e).attr("style","border-color: #FF0000;"),jQuery("#"+e).focus(),!0)}function comment_check_privacy_policy(){var e=jQuery("#bwg_submit");e.removeClass("bwg-submit-disabled"),e.removeAttr("disabled"),jQuery("#bwg_comment_privacy_policy").is(":checked")||(e.addClass("bwg-submit-disabled"),e.attr("disabled","disabled"))}function spider_check_email(e){if(""!=jQuery("#"+e).val())return-1==jQuery("#"+e).val().replace(/^\s+|\s+$/g,"").search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/)&&(alert(bwg_objectsL10n.bwg_mail_validation),!0)}function bwg_captcha_refresh(e){document.getElementById(e+"_img")&&document.getElementById(e+"_input")&&(srcArr=document.getElementById(e+"_img").src.split("&r="),document.getElementById(e+"_img").src=srcArr[0]+"&r="+Math.floor(100*Math.random()),document.getElementById(e+"_img").style.display="inline-block",document.getElementById(e+"_input").value="")}function bwg_play_instagram_video(e,t){jQuery(e).parent().find("video").each(function(){jQuery(this).get(0).paused?(jQuery(this).get(0).play(),jQuery(e).children().hide()):(jQuery(this).get(0).pause(),jQuery(e).children().show())})}function bwg_add_comment(){var t=jQuery("#bwg_comment_form"),e=t.attr("action"),i={ajax_task:"add_comment"};return i.comment_name=t.find("#bwg_name").val(),i.comment_email=t.find("#bwg_email").val(),i.comment_text=t.find("#bwg_comment").val(),i.comment_captcha=t.find("#bwg_captcha_input").val(),i.privacy_policy=t.find("#bwg_comment_privacy_policy").is(":checked")?1:0,i.comment_image_id=jQuery("#bwg_popup_image").attr("image_id"),i.comment_moderation=t.find("#bwg_comment_moderation").val(),jQuery(".bwg_spider_ajax_loading").hide(),jQuery.ajax({url:e,type:"POST",dataType:"json",data:i,success:function(e){jQuery(".bwg_comment_error").text(""),1==e.error?jQuery.each(e.error_messages,function(e,t){t&&jQuery(".bwg_comment_"+e+"_error").text(t)}):(t.find("#bwg_comment").val(""),jQuery(".bwg_comment_waiting_message").hide(),0==e.published&&jQuery(".bwg_comment_waiting_message").show(),""!=e.html_comments_block&&jQuery("#bwg_added_comments").html(e.html_comments_block).show())},beforeSend:function(){jQuery(".bwg_spider_ajax_loading").show()},complete:function(){0<t.find("#bwg_comment_privacy_policy").length&&(t.find("#bwg_comment_privacy_policy").prop("checked",!1),comment_check_privacy_policy()),bwg_captcha_refresh("bwg_captcha"),jQuery(".bwg_spider_ajax_loading").hide()},error:function(){}}),!1}function bwg_remove_comment(t){var e=jQuery("#bwg_comment_form").attr("action"),i={ajax_task:"delete_comment"};return i.id_image=jQuery("#bwg_popup_image").attr("image_id"),i.id_comment=t,jQuery.ajax({url:e,type:"POST",dataType:"json",data:i,success:function(e){0==e.error&&jQuery("#bwg_comment_block_"+t).fadeOut("slow").remove()},beforeSend:function(){},complete:function(){},error:function(){}}),!1}function bwg_gallery_box(e,t,i,a){jQuery(".bwg-validate").each(function(){jQuery(this).on("keypress change",function(){jQuery(this).parent().next().find(".bwg_comment_error").html("")})}),void 0===i&&(i=!1);var r,_=t.data("bwg");r=t.find(".bwg-container").data("lightbox-url")?t.find(".bwg-container").data("lightbox-url"):t.data("lightbox-url");var s=jQuery("#bwg_tag_id_"+_).val();s=s||0;var o=1==i?"&open_ecommerce=1":"",l=jQuery("#bwg_search_input_"+_).val(),n=jQuery("#bwg_order_"+_).val()?"&filtersortby="+jQuery("#bwg_order_"+_).val():"";l=l||"",void 0!==a&&(r+="&gallery_id="+a);var g="",w=jQuery("#bwg_blog_style_share_buttons_"+e).attr("data-open-comment");void 0!==w&&!1!==w&&(g="&open_comment=1"),spider_createpopup(r+"&bwg_random_seed="+jQuery("#bwg_random_seed_"+_).val()+"&image_id="+e+"&filter_tag="+s+o+g+"&filter_search_name="+l+n,_,t.data("popup-width"),t.data("popup-height"),1,"testpopup",5,t.data("buttons-position"))}function bwg_change_image_lightbox(e,a,r,t){if(bwg_current_key=gallery_box_data.bwg_current_key,jQuery(".bwg_image_info").css("height","auto"),setTimeout(function(){bwg_info_height_set(),jQuery(".bwg_image_description").height()>jQuery(".bwg_image_info").height()&&jQuery(".mCSB_container").hasClass("mCS_no_scrollbar")&&jQuery(".bwg_image_info").mCustomScrollbar("destroy"),jQuery(".bwg_image_info").hasClass("mCustomScrollbar")||void 0!==jQuery().mCustomScrollbar&&jQuery.isFunction(jQuery().mCustomScrollbar)&&jQuery(".bwg_image_info").mCustomScrollbar({scrollInertia:150,advanced:{updateOnContentResize:!0}})},200),jQuery("#spider_popup_left").show(),jQuery("#spider_popup_right").show(),jQuery(".bwg_image_info").hide(),0==gallery_box_data.enable_loop&&(a==parseInt(r.length)-1&&jQuery("#spider_popup_right").hide(),0==a&&jQuery("#spider_popup_left").hide()),1==gallery_box_data.ecommerceACtive&&1==gallery_box_data.enable_image_ecommerce)if(0==gallery_box_data.data[a].pricelist)jQuery(".bwg_ecommerce").hide();else{jQuery(".bwg_ecommerce").show(),jQuery(".pge_tabs li").hide(),jQuery("#downloads").hide(),jQuery("#manual").hide();var i=gallery_box_data.data[a].pricelist_sections.split(",");if(i)if(jQuery("#"+i[0]).show(),jQuery("[name=type]").val(i[0]),1<i.length)for(jQuery(".pge_tabs").show(),k=0;k<i.length;k++)jQuery("#"+i[k]+"_li").show();else jQuery(".pge_tabs").hide();else jQuery("[name=type]").val("")}if(jQuery("#bwg_image_container").find("iframe").each(function(){jQuery(this)[0].contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}',"*"),jQuery(this)[0].contentWindow.postMessage('{ "method": "pause" }',"*"),jQuery(this)[0].contentWindow.postMessage("pause","*")}),jQuery("#bwg_image_container").find("video").each(function(){jQuery(this).trigger("pause")}),void 0===r&&(r=gallery_box_data.data),void 0!==r[a]&&void 0!==r[e]){if(jQuery(".bwg_play_pause").length&&!jQuery(".bwg_play_pause").hasClass("bwg-icon-play")&&bwg_play(r),t||jQuery("#bwg_current_image_key").val(a),gallery_box_data.bwg_trans_in_progress)return void gallery_box_data.event_stack.push(e+"-"+a);var _="right";if(bwg_current_key>a)_="left";else if(bwg_current_key==a)return;jQuery(".bwg_image_count").html(r[a].number),jQuery(".bwg_watermark").css({display:"none"}),"width"==gallery_box_data.width_or_height?bwg_current_filmstrip_pos=a*(jQuery(".bwg_filmstrip_thumbnail").width()+2+2*gallery_box_data.lightbox_filmstrip_thumb_border_width):"height"==gallery_box_data.width_or_height&&(bwg_current_filmstrip_pos=a*(jQuery(".bwg_filmstrip_thumbnail").height()+2+2*gallery_box_data.lightbox_filmstrip_thumb_border_width)),gallery_box_data.bwg_current_key=a,bwg_objectsL10n.is_pro&&(location.replace("#bwg"+gallery_box_data.gallery_id+"/"+r[a].id),history.replaceState(void 0,void 0,"#bwg"+gallery_box_data.gallery_id+"/"+r[a].id)),gallery_box_data.popup_enable_rate&&(jQuery("#bwg_rate_form input[name='image_id']").val(r[a].id),jQuery("#bwg_star").attr("data-score",r[a].avg_rating),jQuery("#bwg_star").removeAttr("title"),r[a].cur_key=a,bwg_rating(r[a].rate,r[a].rate_count,r[a].avg_rating,a)),spider_set_input_value("rate_ajax_task","save_hit_count"),spider_rate_ajax_save("bwg_rate_form"),jQuery(".bwg_image_hits span").html(++r[a].hit_count),jQuery("#bwg_popup_image").attr("image_id",r[a].id),jQuery(".bwg_image_title").html(jQuery("<span />").html(r[a].alt).text()),jQuery(".bwg_image_description").html(jQuery("<span />").html(r[a].description).text()),jQuery(".bwg_filmstrip_thumbnail").removeClass("bwg_thumb_active").addClass("bwg_thumb_deactive"),jQuery("#bwg_filmstrip_thumbnail_"+a).removeClass("bwg_thumb_deactive").addClass("bwg_thumb_active"),jQuery(".bwg_image_info").css("opacity",1),""==r[a].alt.trim()&&""==r[a].description.trim()&&jQuery(".bwg_image_info").css("opacity",0),"none"!=jQuery(".bwg_image_info_container1").css("display")?jQuery(".bwg_image_info_container1").css("display","table-cell"):jQuery(".bwg_image_info_container1").css("display","none"),"none"!=jQuery(".bwg_image_rate_container1").css("display")?jQuery(".bwg_image_rate_container1").css("display","table-cell"):jQuery(".bwg_image_rate_container1").css("display","none");var s=2==jQuery(".bwg_popup_image_spun").css("zIndex")?".bwg_popup_image_spun":".bwg_popup_image_second_spun",o=".bwg_popup_image_second_spun"==s?".bwg_popup_image_spun":".bwg_popup_image_second_spun",l=-1<r[a].filetype.indexOf("EMBED_"),n=-1<r[a].filetype.indexOf("INSTAGRAM_POST"),g=-1<r[a].filetype.indexOf("INSTAGRAM_VIDEO"),w=-1!==jQuery.inArray(r[a].filetype,["EMBED_OEMBED_YOUTUBE_VIDEO","EMBED_OEMBED_VIMEO_VIDEO","EMBED_OEMBED_FACEBOOK_VIDEO","EMBED_OEMBED_DAILYMOTION_VIDEO"]),b=jQuery(s).height(),u=jQuery(s).width(),d='<span class="bwg_popup_image_spun1" style="display: '+(l?"block":"table")+'; width: inherit; height: inherit;"><span class="bwg_popup_image_spun2" style="display:'+(l?"block":"table-cell")+'; vertical-align: middle;text-align: center;height: 100%;">';if(l){if(jQuery("#bwg_download").addClass("hidden"),d+='<span class="bwg_popup_embed bwg_popup_watermark" style="display: '+(w?"block":"table")+'; table-layout: fixed; height: 100%;">'+(g?'<div class="bwg_inst_play_btn_cont" onclick="bwg_play_instagram_video(this)" ><div class="bwg_inst_play"></div></div>':" "),n){var h=0,m=0;b<u+88?h=(m=b)-88:m=(h=u)+88,d+=spider_display_embed(r[a].filetype,r[a].image_url,r[a].filename,{class:"bwg_embed_frame","data-width":r[a].image_width,"data-height":r[a].image_height,frameborder:"0",allowfullscreen:"allowfullscreen",style:"width:"+h+"px; height:"+m+"px; vertical-align:middle; display:inline-block; position:relative;"})}else d+=spider_display_embed(r[a].filetype,r[a].image_url,r[a].filename,{class:"bwg_embed_frame",frameborder:"0",allowfullscreen:"allowfullscreen",style:"display:"+(w?"block":"table-cell")+"; width:inherit; height:inherit; vertical-align:middle;"});d+="</span>"}else jQuery(".bwg-loading").removeClass("hidden"),jQuery("#bwg_download").removeClass("hidden"),d+='<img style="max-height: '+b+"px; max-width: "+u+'px;" class="bwg_popup_image bwg_popup_watermark" src="'+gallery_box_data.site_url+jQuery("<span />").html(r[a].image_url).text()+'" alt="'+r[a].alt+'" />';function p(){gallery_box_data.preload_images&&bwg_preload_images(a),window["bwg_"+gallery_box_data.bwg_image_effect](s,o,_),jQuery(s).find(".bwg_fb_video").each(function(){jQuery(this).attr("src","")}),l?jQuery("#bwg_fullsize_image").attr("href",r[a].image_url):(jQuery("#bwg_fullsize_image").attr("href",gallery_box_data.site_url+r[a].image_url),jQuery("#bwg_download").attr("href",gallery_box_data.site_url+r[a].thumb_url.replace("/thumb/","/.original/")));var e=r[a].image_url.split("/");jQuery("#bwg_download").attr("download",e[e.length-1].replace(/\?bwg=(\d+)$/,""));var t=encodeURIComponent(gallery_box_data.bwg_share_url)+"="+r[a].id+encodeURIComponent("#bwg"+gallery_box_data.gallery_id+"/")+r[a].id;if(l)var i=encodeURIComponent(r[a].thumb_url);else i=gallery_box_data.bwg_share_image_url+encodeURIComponent(encodeURIComponent(r[a].image_url));i=i.replace(/%252F/g,"%2F"),void 0!==addthis_share&&(addthis_share.url=t),jQuery("#bwg_facebook_a").attr("href","https://www.facebook.com/sharer/sharer.php?u="+t),jQuery("#bwg_twitter_a").attr("href","https://twitter.com/share?url="+t),jQuery("#bwg_pinterest_a").attr("href","http://pinterest.com/pin/create/button/?s=100&url="+t+"&media="+i+"&description="+r[a].alt+"%0A"+r[a].description),jQuery("#bwg_tumblr_a").attr("href","https://www.tumblr.com/share/photo?source="+i+"&caption="+r[a].alt+"&clickthru="+t),jQuery(".bwg_comment_container").hasClass("bwg_open")&&(jQuery(".bwg_comments .mCSB_container").css("top","0"),0==r[a].comment_count?jQuery("#bwg_added_comments").hide():(jQuery("#bwg_added_comments").show(),spider_set_input_value("ajax_task","display"),spider_set_input_value("image_id",jQuery("#bwg_popup_image").attr("image_id")),spider_ajax_save("bwg_comment_form"))),jQuery(".bwg_ecommerce_container").hasClass("bwg_open")&&(0==r[a].pricelist?(bwg_popup_sidebar_close(jQuery(".bwg_ecommerce_container")),bwg_animate_image_box_for_hide_sidebar(),jQuery(".bwg_ecommerce_container").attr("class","bwg_ecommerce_container bwg_close"),jQuery(".bwg_ecommerce").attr("title",bwg_objectsL10n.bwg_show_ecommerce),jQuery(".spider_popup_close_fullscreen").show()):get_ajax_pricelist()),void 0!==jQuery().mCustomScrollbar&&jQuery.isFunction(jQuery().mCustomScrollbar)&&jQuery(".bwg_comments").mCustomScrollbar({advanced:{updateOnContentResize:!0}}),jQuery(".bwg_comments .mCSB_scrollTools").hide(),gallery_box_data.enable_image_filmstrip&&bwg_move_filmstrip(),bwg_resize_instagram_post()}if(d+="</span></span>",jQuery(o).html(d),jQuery(o).find("img").on("load error",function(){jQuery(".bwg-loading").addClass("hidden")}),jQuery(".bwg_popup_embed > .bwg_embed_frame > img, .bwg_popup_embed > .bwg_embed_frame > video").css({maxWidth:u,maxHeight:b,height:"auto"}),l)p();else jQuery(o).find("img").one("load",function(){p()}).each(function(){this.complete&&jQuery(this).load()})}}function bwg_preload_images_lightbox(e){for(var t=gallery_box_data.data,i=t.length,a=0==gallery_box_data.preload_images_count||gallery_box_data.preload_images_count>=i?i:gallery_box_data.preload_images_count,r=0,_=1;r<a;_++){var s=1;do{var o=(e+_*s+i)%i;if(void 0!==t[o])-1<t[o].filetype.indexOf("EMBED_")||jQuery("<img/>").attr("src",gallery_box_data.site_url+jQuery("<span />").html(t[o].image_url).text());s*=-1,r++}while(1!=s)}}function bwg_popup_sidebar_open(e){var t=gallery_box_data.lightbox_comment_width,i=gallery_box_data.lightbox_comment_pos;if(t>jQuery(window).width()){if(t=jQuery(window).width(),e.css({width:t}),jQuery(".spider_popup_close_fullscreen").hide(),jQuery(".spider_popup_close").hide(),jQuery(".bwg_ctrl_btn").hasClass("bwg-icon-pause")){var a=/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase());jQuery(".bwg_play_pause").trigger(a?"touchend":"click")}}else jQuery(".spider_popup_close_fullscreen").show();"left"==i?e.animate({left:0},100):e.animate({right:0},100)}function bwg_comment(){if(jQuery(".bwg_watermark").css({display:"none"}),jQuery(".bwg_ecommerce_wrap").css("z-index","-1"),jQuery(".bwg_comment_wrap").css("z-index","25"),jQuery(".bwg_ecommerce_container").hasClass("bwg_open")&&(bwg_popup_sidebar_close(jQuery(".bwg_ecommerce_container")),jQuery(".bwg_ecommerce_container").attr("class","bwg_ecommerce_container bwg_close"),jQuery(".bwg_ecommerce").attr("title",bwg_objectsL10n.bwg_show_ecommerce)),jQuery(".bwg_comment_container").hasClass("bwg_open"))"1"==jQuery(".bwg_comment_container").attr("data-play-status")&&jQuery(".bwg_ctrl_btn.bwg_play_pause").removeClass("bwg-icon-play").addClass("bwg-icon-pause").attr("title",bwg_objectsL10n.bwg_pause),bwg_popup_sidebar_close(jQuery(".bwg_comment_container")),bwg_animate_image_box_for_hide_sidebar(),jQuery(".bwg_comment_wrap").css("z-index","-1"),jQuery(".bwg_comment_container").attr("class","bwg_comment_container bwg_close"),jQuery(".bwg_comment").attr("title",bwg_objectsL10n.bwg_show_comments),jQuery(".spider_popup_close_fullscreen").show();else{jQuery(".bwg_play_pause").hasClass("bwg-icon-pause")?jQuery(".bwg_comment_container").attr("data-play-status","1"):jQuery(".bwg_comment_container").attr("data-play-status","0"),jQuery(".bwg_ctrl_btn.bwg_play_pause").removeClass("bwg-icon-pause").addClass("bwg-icon-play").attr("title",bwg_objectsL10n.bwg_play),bwg_popup_sidebar_open(jQuery(".bwg_comment_container")),bwg_animate_image_box_for_show_sidebar(),jQuery(".bwg_comment_container").attr("class","bwg_comment_container bwg_open"),jQuery(".bwg_comment").attr("title",bwg_objectsL10n.bwg_hide_comments);var e=parseInt(jQuery("#bwg_current_image_key").val());void 0!==gallery_box_data[e]&&0!=gallery_box_data[e].comment_count&&(jQuery("#bwg_added_comments").show(),spider_set_input_value("ajax_task","display"),spider_set_input_value("image_id",jQuery("#bwg_popup_image").attr("image_id")),spider_ajax_save("bwg_comment_form"))}jQuery(".bwg_comments").mCustomScrollbar("update",{scrollInertia:150,advanced:{updateOnContentResize:!0}})}function bwg_ecommerce(){jQuery(".bwg_watermark").css({display:"none"}),jQuery(".bwg_ecommerce_wrap").css("z-index","25"),jQuery(".bwg_comment_wrap").css("z-index","-1"),jQuery(".bwg_comment_container").hasClass("bwg_open")&&(bwg_popup_sidebar_close(jQuery(".bwg_comment_container")),jQuery(".bwg_comment_container").attr("class","bwg_comment_container bwg_close"),jQuery(".bwg_comment").attr("title",bwg_objectsL10n.bwg_show_comments)),jQuery(".bwg_ecommerce_container").hasClass("bwg_open")?(bwg_popup_sidebar_close(jQuery(".bwg_ecommerce_container")),bwg_animate_image_box_for_hide_sidebar(),jQuery(".bwg_ecommerce_container").attr("class","bwg_ecommerce_container bwg_close"),jQuery(".bwg_ecommerce").attr("title",bwg_objectsL10n.bwg_show_ecommerce)):(bwg_popup_sidebar_open(jQuery(".bwg_ecommerce_container")),bwg_animate_image_box_for_show_sidebar(),jQuery(".bwg_ecommerce_container").attr("class","bwg_ecommerce_container bwg_open"),jQuery(".bwg_ecommerce").attr("title",bwg_objectsL10n.bwg_hide_ecommerce),get_ajax_pricelist())}function bwg_popup_sidebar_close(e){var t=parseInt(e.css("borderRightWidth"));t||(t=0),"left"==lightbox_comment_pos?e.animate({left:-e.width()-t},100):"right"==lightbox_comment_pos&&e.animate({right:-e.width()-t},100)}function bwg_animate_image_box_for_hide_sidebar(){"left"==lightbox_comment_pos?jQuery(".bwg_image_wrap").animate({left:0,width:jQuery("#spider_popup_wrap").width()},100):"right"==lightbox_comment_pos&&jQuery(".bwg_image_wrap").animate({right:0,width:jQuery("#spider_popup_wrap").width()},100),jQuery(".bwg_image_container").animate({width:jQuery("#spider_popup_wrap").width()-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0)},100),jQuery(".bwg_popup_image").animate({maxWidth:jQuery("#spider_popup_wrap").width()-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0)},{duration:100,complete:function(){bwg_change_watermark_container()}}),jQuery(".bwg_popup_embed").animate({width:jQuery("#spider_popup_wrap").width()-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0)},{duration:100,complete:function(){bwg_resize_instagram_post(),bwg_change_watermark_container()}}),"width"==gallery_box_data.width_or_height?(jQuery(".bwg_filmstrip_container").animate({width:jQuery(".spider_popup_wrap").width()},100),jQuery(".bwg_filmstrip").animate({width:jQuery(".spider_popup_wrap").width()-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height())},100)):"height"==gallery_box_data.width_or_height&&(jQuery(".bwg_filmstrip_container").animate({height:jQuery(".spider_popup_wrap").width()},100),jQuery(".bwg_filmstrip").animate({height:jQuery(".spider_popup_wrap").width()-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height())},100)),bwg_set_filmstrip_pos(jQuery(".spider_popup_wrap").width()-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height()),"",gallery_box_data),jQuery(".spider_popup_close_fullscreen").show(100)}function bwg_animate_image_box_for_show_sidebar(){var e=jQuery(".bwg_comment_container").width()||jQuery(".bwg_ecommerce_container").width();"left"==lightbox_comment_pos?jQuery(".bwg_image_wrap").animate({left:e,width:jQuery("#spider_popup_wrap").width()-e},100):"right"==lightbox_comment_pos&&jQuery(".bwg_image_wrap").animate({right:e,width:jQuery("#spider_popup_wrap").width()-e},100),jQuery(".bwg_image_container").animate({width:jQuery("#spider_popup_wrap").width()-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0)-e},100),jQuery(".bwg_popup_image").animate({maxWidth:jQuery("#spider_popup_wrap").width()-e-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0)},{duration:100,complete:function(){bwg_change_watermark_container()}}),jQuery(".bwg_popup_embed > .bwg_embed_frame > img, .bwg_popup_embed > .bwg_embed_frame > video").animate({maxWidth:jQuery("#spider_popup_wrap").width()-e-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0)},{duration:100,complete:function(){bwg_resize_instagram_post(),bwg_change_watermark_container()}}),"width"==gallery_box_data.width_or_height&&(jQuery(".bwg_filmstrip_container").css({width:jQuery("#spider_popup_wrap").width()-("vertical"==gallery_box_data.filmstrip_direction?0:e)}),jQuery(".bwg_filmstrip").animate({width:jQuery(".bwg_filmstrip_container").width()-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height())},100),bwg_set_filmstrip_pos(jQuery(".bwg_filmstrip_container").width()-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height()),"",gallery_box_data))}function bwg_reset_zoom(){var e=/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()),t=document.querySelector('meta[name="viewport"]');e&&t&&(t.content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=0")}function bwg_open_with_fullscreen(){jQuery(".bwg_watermark").css({display:"none"});var e=0;(jQuery(".bwg_comment_container").hasClass("bwg_open")||jQuery(".bwg_ecommerce_container").hasClass("bwg_open"))&&(e=jQuery(".bwg_comment_container").width()||jQuery(".bwg_ecommerce_container").width()),bwg_popup_current_width=jQuery(window).width(),bwg_popup_current_height=window.innerHeight,jQuery("#spider_popup_wrap").css({width:jQuery(window).width(),height:window.innerHeight,left:0,top:0,margin:0,zIndex:100002}),jQuery(".bwg_image_wrap").css({width:jQuery(window).width()-e}),jQuery(".bwg_image_container").css({height:bwg_popup_current_height-("horizontal"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_height:0),width:bwg_popup_current_width-e-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0)}),jQuery(".bwg_popup_image").css({maxWidth:jQuery(window).width()-e-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0),maxHeight:window.innerHeight-("horizontal"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_height:0)},{complete:function(){bwg_change_watermark_container()}}),jQuery(".bwg_popup_video").css({width:jQuery(window).width()-e-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0),height:window.innerHeight-("horizontal"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_height:0)},{complete:function(){bwg_change_watermark_container()}}),jQuery(".bwg_popup_embed > .bwg_embed_frame > img, .bwg_popup_embed > .bwg_embed_frame > video").css({maxWidth:jQuery(window).width()-e-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0),maxHeight:window.innerHeight-("horizontal"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_height:0)},{complete:function(){bwg_resize_instagram_post(),bwg_change_watermark_container()}}),"width"==gallery_box_data.width_or_height?(jQuery(".bwg_filmstrip_container").css({width:jQuery(window).width()-("horizontal"==gallery_box_data.filmstrip_direction?"comment_container_width":0)}),jQuery(".bwg_filmstrip").css({width:jQuery(window).width()-("horizontal"==gallery_box_data.filmstrip_direction?"comment_container_width":0)-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height())}),bwg_set_filmstrip_pos(jQuery(window).width()-("horizontal"==gallery_box_data.filmstrip_direction?"comment_container_width":0)-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height()),"",gallery_box_data)):(jQuery(".bwg_filmstrip_container").css({height:window.innerHeight-("horizontal"==gallery_box_data.filmstrip_direction?"comment_container_width":0)}),jQuery(".bwg_filmstrip").css({height:window.innerHeight-("horizontal"==gallery_box_data.filmstrip_direction?"comment_container_width":0)-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height())}),bwg_set_filmstrip_pos(window.innerHeight-("horizontal"==gallery_box_data.filmstrip_direction?"comment_container_width":0)-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height()),"",gallery_box_data)),jQuery(".bwg_resize-full").attr("class","bwg-icon-compress bwg_ctrl_btn bwg_resize-full"),jQuery(".bwg_resize-full").attr("title",bwg_objectsL10n.bwg_restore),jQuery(".spider_popup_close").attr("class","bwg_ctrl_btn spider_popup_close_fullscreen")}function bwg_resize_full(){jQuery(".bwg_watermark").css({display:"none"});var e=0;(jQuery(".bwg_comment_container").hasClass("bwg_open")||jQuery(".bwg_ecommerce_container").hasClass("bwg_open"))&&(e=jQuery(".bwg_comment_container").width()||jQuery(".bwg_ecommerce_container").width()),jQuery(".bwg_resize-full").hasClass("bwg-icon-compress")?(jQuery(window).width()>gallery_box_data.image_width&&(bwg_popup_current_width=gallery_box_data.image_width),window.innerHeight>gallery_box_data.image_height&&(bwg_popup_current_height=gallery_box_data.image_height),jQuery("#spider_popup_wrap").animate({width:bwg_popup_current_width,height:bwg_popup_current_height,left:"50%",top:"50%",marginLeft:-bwg_popup_current_width/2,marginTop:-bwg_popup_current_height/2,zIndex:100002},500),jQuery(".bwg_image_wrap").animate({width:bwg_popup_current_width-e},500),jQuery(".bwg_image_container").animate({height:bwg_popup_current_height-("horizontal"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_height:0),width:bwg_popup_current_width-e-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0)},500),jQuery(".bwg_popup_image").animate({maxWidth:bwg_popup_current_width-e-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0),maxHeight:bwg_popup_current_height-("horizontal"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_height:0)},{duration:500,complete:function(){bwg_change_watermark_container(),jQuery("#spider_popup_wrap").width()<jQuery(window).width()&&jQuery("#spider_popup_wrap").height()<window.innerHeight&&jQuery(".spider_popup_close_fullscreen").attr("class","spider_popup_close")}}),jQuery(".bwg_popup_embed > .bwg_embed_frame > img, .bwg_popup_embed > .bwg_embed_frame > video").animate({maxWidth:bwg_popup_current_width-e-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0),maxHeight:bwg_popup_current_height-("horizontal"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_height:0)},{duration:500,complete:function(){bwg_resize_instagram_post(),bwg_change_watermark_container(),jQuery("#spider_popup_wrap").width()<jQuery(window).width()&&jQuery("#spider_popup_wrap").height()<window.innerHeight&&jQuery(".spider_popup_close_fullscreen").attr("class","spider_popup_close")}}),"width"==gallery_box_data.width_or_height?(jQuery(".bwg_filmstrip_container").animate({width:bwg_popup_current_width-("horizontal"==gallery_box_data.filmstrip_direction?e:0)},500),jQuery(".bwg_filmstrip").animate({width:bwg_popup_current_width-("horizontal"==gallery_box_data.filmstrip_direction?e:0)-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height())},500),bwg_set_filmstrip_pos(bwg_popup_current_width-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height()),"",gallery_box_data)):(jQuery(".bwg_filmstrip_container").animate({height:bwg_popup_current_height-("horizontal"==gallery_box_data.filmstrip_direction?e:0)},500),jQuery(".bwg_filmstrip").animate({height:bwg_popup_current_height-("horizontal"==gallery_box_data.filmstrip_direction?e:0)-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height())},500),bwg_set_filmstrip_pos(bwg_popup_current_height-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height()),"",gallery_box_data),"horizontal"!=gallery_box_data.filmstrip_direction&&jQuery(".bwg_filmstrip_right").css({top:bwg_popup_current_height-jQuery(".bwg_filmstrip_right").height()})),jQuery(".bwg_resize-full").attr("class","bwg-icon-expand bwg_ctrl_btn bwg_resize-full"),jQuery(".bwg_resize-full").attr("title",bwg_objectsL10n.bwg_maximize),setTimeout(function(){bwg_info_height_set()},500)):(bwg_popup_current_width=jQuery(window).width(),bwg_popup_current_height=window.innerHeight,jQuery("#spider_popup_wrap").animate({width:jQuery(window).width(),height:window.innerHeight,left:0,top:0,margin:0,zIndex:100002},500),jQuery(".bwg_image_wrap").animate({width:jQuery(window).width()-e},500),jQuery(".bwg_image_container").animate({height:bwg_popup_current_height-("horizontal"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_height:0),width:bwg_popup_current_width-e-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0)},500),jQuery(".bwg_popup_image").animate({maxWidth:jQuery(window).width()-e-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0),maxHeight:window.innerHeight-("horizontal"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_height:0)},{duration:500,complete:function(){bwg_change_watermark_container()}}),jQuery(".bwg_popup_embed > .bwg_embed_frame > img, .bwg_popup_embed > .bwg_embed_frame > video").animate({maxWidth:jQuery(window).width()-e-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0),maxHeight:window.innerHeight-("horizontal"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_height:0)},{duration:500,complete:function(){bwg_resize_instagram_post(),bwg_change_watermark_container()}}),"width"==gallery_box_data.width_or_height?(jQuery(".bwg_filmstrip_container").animate({width:jQuery(window).width()-("horizontal"==gallery_box_data.filmstrip_direction?e:0)},500),jQuery(".bwg_filmstrip").animate({width:jQuery(window).width()-("horizontal"==gallery_box_data.filmstrip_direction?e:0)-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height())},500),bwg_set_filmstrip_pos(jQuery(window).width()-("horizontal"==gallery_box_data.filmstrip_direction?e:0)-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height()),"",gallery_box_data)):(jQuery(".bwg_filmstrip_container").animate({height:window.innerHeight-("horizontal"==gallery_box_data.filmstrip_direction?e:0)},500),jQuery(".bwg_filmstrip").animate({height:window.innerHeight-("horizontal"==gallery_box_data.filmstrip_direction?e:0)-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height())},500),bwg_set_filmstrip_pos(window.innerHeight-("horizontal"==gallery_box_data.filmstrip_direction?e:0)-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height()),"",gallery_box_data),"horizontal"!=gallery_box_data.filmstrip_direction&&jQuery(".bwg_filmstrip_right").css({top:window.innerHeight-jQuery(".bwg_filmstrip_right").height()})),jQuery(".bwg_resize-full").attr("class","bwg-icon-compress bwg_ctrl_btn bwg_resize-full"),jQuery(".bwg_resize-full").attr("title",bwg_objectsL10n.bwg_restore),jQuery(".spider_popup_close").attr("class","bwg_ctrl_btn spider_popup_close_fullscreen")),setTimeout(function(){bwg_info_height_set()},500)}function bwg_popup_resize_lightbox(){void 0!==jQuery().fullscreen&&jQuery.isFunction(jQuery().fullscreen)&&(jQuery.fullscreen.isFullScreen()||(jQuery(".bwg_resize-full").show(),jQuery(".bwg_resize-full").hasClass("bwg-icon-compress")||jQuery(".bwg_resize-full").attr("class","bwg-icon-expand bwg_ctrl_btn bwg_resize-full"),jQuery(".bwg_resize-full").attr("title",bwg_objectsL10n.bwg_maximize),jQuery(".bwg_fullscreen").attr("class","bwg-icon-arrows-out bwg_ctrl_btn bwg_fullscreen"),jQuery(".bwg_fullscreen").attr("title",bwg_objectsL10n.fullscreen)));var e=0;(jQuery(".bwg_comment_container").hasClass("bwg_open")||jQuery(".bwg_ecommerce_container").hasClass("bwg_open"))&&(e=gallery_box_data.lightbox_comment_width),e>jQuery(window).width()?(e=jQuery(window).width(),jQuery(".bwg_comment_container").css({width:e}),jQuery(".bwg_ecommerce_container").css({width:e}),jQuery(".spider_popup_close_fullscreen").hide()):jQuery(".spider_popup_close_fullscreen").show(),window.innerHeight>gallery_box_data.image_height&&1!=gallery_box_data.open_with_fullscreen&&!jQuery(".bwg_resize-full").hasClass("bwg-icon-compress")?(jQuery("#spider_popup_wrap").css({height:gallery_box_data.image_height,top:"50%",marginTop:-gallery_box_data.image_height/2,zIndex:100002}),jQuery(".bwg_image_container").css({height:gallery_box_data.image_height-("horizontal"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_height:0)}),jQuery(".bwg_image_info").css("height","auto"),bwg_info_height_set(),jQuery(".bwg_popup_image").css({maxHeight:gallery_box_data.image_height-("horizontal"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_height:0)}),jQuery(".bwg_popup_embed > .bwg_embed_frame > img, .bwg_popup_embed > .bwg_embed_frame > video").css({maxHeight:gallery_box_data.image_height-("horizontal"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_height:0)}),"vertical"==gallery_box_data.filmstrip_direction&&(jQuery(".bwg_filmstrip_container").css({height:gallery_box_data.image_height}),jQuery(".bwg_filmstrip").css({height:gallery_box_data.image_height-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height())})),bwg_popup_current_height=gallery_box_data.image_height):(jQuery("#spider_popup_wrap").css({height:window.innerHeight,top:0,marginTop:0,zIndex:100002}),jQuery(".bwg_image_container").css({height:window.innerHeight-("horizontal"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_height:0)}),jQuery(".bwg_image_info").css("height","auto"),bwg_info_height_set(),jQuery(".bwg_popup_image").css({maxHeight:window.innerHeight-("horizontal"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_height:0)}),jQuery(".bwg_popup_embed > .bwg_embed_frame > img, .bwg_popup_embed > .bwg_embed_frame > video").css({maxHeight:window.innerHeight-("horizontal"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_height:0)}),"vertical"==gallery_box_data.filmstrip_direction&&(jQuery(".bwg_filmstrip_container").css({height:window.innerHeight}),jQuery(".bwg_filmstrip").css({height:window.innerHeight-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height())})),bwg_popup_current_height=window.innerHeight),jQuery(window).width()>=gallery_box_data.image_width&&1!=gallery_box_data.open_with_fullscreen?(jQuery("#spider_popup_wrap").css({width:gallery_box_data.image_width,left:"50%",marginLeft:-gallery_box_data.image_width/2,zIndex:100002}),jQuery(".bwg_image_wrap").css({width:gallery_box_data.image_width-e}),jQuery(".bwg_image_container").css({width:gallery_box_data.image_width-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0)-e}),jQuery(".bwg_image_info").css("height","auto"),bwg_info_height_set(),jQuery(".bwg_popup_image").css({maxWidth:gallery_box_data.image_width-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0)-e}),jQuery(".bwg_popup_embed > .bwg_embed_frame > img, .bwg_popup_embed > .bwg_embed_frame > video").css({maxWidth:gallery_box_data.image_width-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0)-e}),"horizontal"==gallery_box_data.filmstrip_direction&&(jQuery(".bwg_filmstrip_container").css({width:gallery_box_data.image_width-e}),jQuery(".bwg_filmstrip").css({width:gallery_box_data.image_width-e-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height())})),bwg_popup_current_width=gallery_box_data.image_width):(jQuery("#spider_popup_wrap").css({width:jQuery(window).width(),left:0,marginLeft:0,zIndex:100002}),jQuery(".bwg_image_wrap").css({width:jQuery(window).width()-e}),jQuery(".bwg_image_container").css({width:jQuery(window).width()-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0)-e}),jQuery(".bwg_popup_image").css({maxWidth:jQuery(window).width()-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0)-e}),jQuery(".bwg_popup_embed > .bwg_embed_frame > img, .bwg_popup_embed > .bwg_embed_frame > video").css({maxWidth:jQuery(window).width()-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0)-e}),"horizontal"==gallery_box_data.filmstrip_direction&&(jQuery(".bwg_filmstrip_container").css({width:jQuery(window).width()-e}),jQuery(".bwg_filmstrip").css({width:jQuery(window).width()-e-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height())})),bwg_popup_current_width=jQuery(window).width()),bwg_resize_instagram_post(),bwg_change_watermark_container(),window.innerHeight>gallery_box_data.image_height-2*gallery_box_data.lightbox_close_btn_top&&jQuery(window).width()>=gallery_box_data.image_width-2*gallery_box_data.lightbox_close_btn_right&&1!=gallery_box_data.open_with_fullscreen?jQuery(".spider_popup_close_fullscreen").attr("class","spider_popup_close"):jQuery("#spider_popup_wrap").width()<jQuery(window).width()&&jQuery("#spider_popup_wrap").height()<jQuery(window).height()&&jQuery(".spider_popup_close").attr("class","bwg_ctrl_btn spider_popup_close_fullscreen");var t=gallery_box_data.bwg_ctrl_btn_container_height;"bottom"==gallery_box_data.lightbox_ctrl_btn_pos&&jQuery(".bwg_toggle_container i").hasClass("bwg-icon-caret-down")&&jQuery(".bwg_toggle_container").css("bottom",t+"px"),"top"==gallery_box_data.lightbox_ctrl_btn_pos&&jQuery(".bwg_toggle_container i").hasClass("bwg-icon-caret-up")&&jQuery(".bwg_toggle_container").css("top",t+"px")}function bwg_rating(e,t,i,a){lightbox_rate_stars_count=gallery_box_data.lightbox_rate_stars_count,lightbox_rate_size=gallery_box_data.lightbox_rate_size,lightbox_rate_icon=gallery_box_data.lightbox_rate_icon;var r="Not rated yet.";0!=i&&""!=i&&(r=parseFloat(i).toFixed(1)+"\n Votes: "+t),void 0!==jQuery().raty&&jQuery.isFunction(jQuery().raty)&&jQuery("#bwg_star").raty({score:function(){return jQuery(this).attr("data-score")},starType:"i",number:lightbox_rate_stars_count,size:lightbox_rate_size,readOnly:function(){return!!e},noRatedMsg:"Not rated yet.",click:function(t,e){jQuery("#bwg_star").hide(),jQuery("#bwg_rated").show(),spider_set_input_value("rate_ajax_task","save_rate"),jQuery.when(spider_rate_ajax_save("bwg_rate_form")).then(function(){gallery_box_data.data[a].rate=t,++gallery_box_data.data[a].rate_count;var e=parseFloat(jQuery("#bwg_star").attr("data-score"));gallery_box_data.data[a].avg_rating=e?((e+t)/2).toFixed(1):t.toFixed(1),bwg_rating(gallery_box_data.data[a].rate,gallery_box_data.data[a].rate_count,gallery_box_data.data[a].avg_rating,gallery_box_data.current_image_key)})},starHalf:"bwg-icon-"+lightbox_rate_icon+("star"==lightbox_rate_icon?"-half":"")+"-o",starOff:"bwg-icon-"+lightbox_rate_icon+"-o",starOn:"bwg-icon-"+lightbox_rate_icon,cancelOff:"bwg-icon-minus-square-o",cancelOn:"bwg-icon-minus-square-o",cancel:!1,cancelHint:"Cancel your rating.",hints:[r,r,r,r,r],alreadyRatedMsg:parseFloat(i).toFixed(1)+"\nYou have already rated.\nVotes: "+t})}function changeDownloadsTotal(e){var t=0;0==jQuery("[name=option_show_digital_items_count]").val()?jQuery("[name=selected_download_item]:checked").each(function(){t+=Number(jQuery(this).closest("tr").attr("data-price"))}):jQuery(".digital_image_count").each(function(){0!=Number(jQuery(this).val())&&(t+=Number(jQuery(this).closest("tr").attr("data-price"))*Number(jQuery(this).val()))}),t=t.toFixed(2).toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1,"),jQuery(".product_downloads_price").html(t)}function changeMenualTotal(e){Number(jQuery(e).val())<=0&&jQuery(e).val("1");var t=Number(jQuery(e).val()),i=Number(jQuery(".product_manual_price").attr("data-actual-price"));i=(i*=t).toFixed(2).toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1,"),jQuery(".product_manual_price").html(i)}function onSelectableParametersChange(e){var t=0,i=gallery_box_data.data[jQuery("#bwg_current_image_key").val()].pricelist_manual_price?gallery_box_data.data[jQuery("#bwg_current_image_key").val()].pricelist_manual_price:"0";i=parseFloat(i.replace(",",""));var a=jQuery(e).closest(".image_selected_parameter").attr("data-parameter-type"),r=jQuery(e).val();r=r.split("*");var _=parseFloat(r[1]),s=r[0],o=Number(jQuery(e).closest(".image_selected_parameter").find(".already_selected_values").val());if("4"==a||"5"==a){var l=parseFloat(s+_);jQuery(e).closest(".image_selected_parameter").find(".already_selected_values").val(l)}else if("6"==a){if(0==jQuery(e).is(":checked"))var n=o-parseFloat(s+_);else n=o+parseFloat(s+_);jQuery(e).closest(".image_selected_parameter").find(".already_selected_values").val(n)}jQuery(".already_selected_values").each(function(){t+=Number(jQuery(this).val())}),i+=t,jQuery(".product_manual_price").attr("data-actual-price",i),i=(i*=Number(jQuery(".image_count").val())<=0?1:Number(jQuery(".image_count").val())).toFixed(2).toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1,"),jQuery(".product_manual_price").html(i)}function onBtnClickAddToCart(){var e=jQuery("[name=type]").val();if(""!=e){var t={};if("manual"==e){var i=jQuery(".image_count").val(),a={};jQuery(".manual").find(".image_selected_parameter").each(function(){var e=jQuery(this).attr("data-parameter-id"),t="";switch(jQuery(this).attr("data-parameter-type")){case"2":t=jQuery(this).find("input").val();break;case"3":t=jQuery(this).find("textarea").val();break;case"4":t=jQuery(this).find("select :selected").val();break;case"5":t=jQuery(this).find("[type=radio]:checked").val();break;case"6":var i=[];jQuery(this).find("[type=checkbox]:checked").each(function(){i.push(jQuery(this).val())}),t=i}a[e]=t}),t.count=i,t.parameters=a,t.price=jQuery(".product_manual_price").attr("data-price").replace(",","")}else{var r=[];if(0==jQuery("[name=option_show_digital_items_count]").val()){if(0==jQuery("[name=selected_download_item]:checked").length)return void jQuery(".add_to_cart_msg").html("You must select at least one item.");jQuery("[name=selected_download_item]:checked").each(function(){var e={};e.id=jQuery(this).val(),e.count=1,e.price=jQuery(this).closest("tr").attr("data-price"),r.push(e)})}else jQuery(".digital_image_count").each(function(){var e={};0<jQuery(this).val()&&(e.id=jQuery(this).closest("tr").attr("data-id"),e.price=jQuery(this).closest("tr").attr("data-price"),e.count=jQuery(this).val(),r.push(e))});if(0==(t.downloadItems=r).length)return void jQuery(".add_to_cart_msg").html("Please select at least one item")}var _=jQuery("#ajax_url").val(),s={action:"add_cart",task:"add_cart",controller:"checkout",image_id:jQuery("#bwg_popup_image").attr("image_id"),type:e,data:JSON.stringify(t)};jQuery.ajax({type:"POST",url:_,data:s,success:function(e){responseData=JSON.parse(e),jQuery(".add_to_cart_msg").html(responseData.msg),jQuery(".products_in_cart").html(responseData.products_in_cart),1==responseData.redirect&&(window.location.href="<?php echo get_permalink($options->checkout_page);?>")},beforeSend:function(){},complete:function(){}})}else jQuery(".add_to_cart_msg").html("Please select Prints and products or Downloads")}function onBtnViewCart(){var e=jQuery("[name=option_checkout_page]").val();jQuery("#bwg_ecommerce_form").attr("action",e),jQuery("#bwg_ecommerce_form").submit()}function bwg_load_visible_images(e,t,i){0<=e-t&&(startPoint=e-t),i<e+t&&(endPoint=i);for(var a=startPoint;a<=endPoint;a++){var r=jQuery("#bwg_filmstrip_thumbnail_"+a+" img");r.removeClass("hidden"),r.attr("src",r.data("url"))}}function bwg_load_filmstrip(){for(var e=1;e<=total_thumbnail_count;e++){var t;if(leftIndex=startPoint-e,rightIndex=endPoint+e,rightIndex<total_thumbnail_count)(t=jQuery("#bwg_filmstrip_thumbnail_"+rightIndex+" img")).removeClass("hidden"),t.attr("src",t.data("url"));if(0<=leftIndex)(t=jQuery("#bwg_filmstrip_thumbnail_"+leftIndex+" img")).removeClass("hidden"),t.attr("src",t.data("url"))}jQuery(".bwg_filmstrip_thumbnail").each(function(){var e=jQuery(this).find("img");void 0===e.attr("style")&&(0==e.width()?e.on("load",function(){jQuery(this).find(".bwg_filmstrip_thumbnail_img_wrap"),bwg_filmstrip_thumb_view(e)}):(jQuery(this).find(".bwg_filmstrip_thumbnail_img_wrap"),bwg_filmstrip_thumb_view(e)))})}function bwg_filmstrip_thumb_view(e){var t=gallery_box_data.image_filmstrip_height,i=gallery_box_data.image_filmstrip_width,a=i-gallery_box_data.filmstrip_thumb_right_left_space,r=t,_=Math.max(i/e.width(),t/e.height()),s=e.width()*_,o=e.height()*_;e.css({width:s,height:o,marginLeft:(a-s)/2,marginTop:(r-o)/2})}function bwg_info_height_set(){bwg_info_position(!1),jQuery(".mCustomScrollBox").length&&jQuery(".bwg_image_info_container1").height()<jQuery(".mCustomScrollBox").height()+jQuery(".bwg_toggle_container").height()+bwg_image_info_pos+2*parseInt(gallery_box_data.lightbox_info_margin)&&jQuery(".bwg_image_info").css({height:jQuery(".bwg_image_info_container1").height()-jQuery(".bwg_toggle_container").height()-bwg_image_info_pos-2*parseInt(gallery_box_data.lightbox_info_margin)})}function bwg_info_position(e){var t=0,i="none";"top"==gallery_box_data.lightbox_ctrl_btn_pos?"top"==gallery_box_data.lightbox_info_pos&&(i="top"):"bottom"==gallery_box_data.lightbox_info_pos&&(i="bottom"),jQuery(".bwg_ctrl_btn_container").hasClass("closed")||("top"==gallery_box_data.lightbox_ctrl_btn_pos?"top"==gallery_box_data.lightbox_info_pos&&(t=jQuery(".bwg_ctrl_btn_container").height()):"bottom"==gallery_box_data.lightbox_info_pos&&(t=jQuery(".bwg_ctrl_btn_container").height())),"top"==i?0==e?jQuery(".bwg_image_info").css("top",t):jQuery(".bwg_image_info").animate({top:t+"px"},500):"bottom"==i&&(0==e?jQuery(".bwg_image_info").css("bottom",t):jQuery(".bwg_image_info").animate({bottom:t+"px"},500))}function spider_display_embed(e,t,i,a){var r="";switch(e){case"EMBED_OEMBED_YOUTUBE_VIDEO":var _="<iframe ";for(attr in""!=i&&(_+=' src="//www.youtube.com/embed/'+i+'?enablejsapi=1&wmode=transparent"'),a)/src/i.test(attr)||""!=attr&&""!=a[attr]&&(_+=" "+attr+'="'+a[attr]+'"');r+=_+=" ></iframe>";break;case"EMBED_OEMBED_VIMEO_VIDEO":var s="<iframe ";for(attr in""!=i&&(s+=' src="//player.vimeo.com/video/'+i+'?enablejsapi=1"'),a)/src/i.test(attr)||""!=attr&&""!=a[attr]&&(s+=" "+attr+'="'+a[attr]+'"');r+=s+=" ></iframe>";break;case"EMBED_OEMBED_FLICKR_IMAGE":var o="<div ";for(attr in a)/src/i.test(attr)||""!=attr&&""!=a[attr]&&(o+=" "+attr+'="'+a[attr]+'"');o+=" >",""!=i&&(o+='<img src="'+i+'" style="max-width:100% !important; max-height:100% !important; width:auto !important; height:auto !important;">'),r+=o+="</div>";break;case"EMBED_OEMBED_FLICKR_VIDEO":break;case"EMBED_OEMBED_INSTAGRAM_VIDEO":var l="<div ";for(attr in a)/src/i.test(attr)||""!=attr&&""!=a[attr]&&(l+=" "+attr+'="'+a[attr]+'"');l+=" >",""!=i&&(l+='<video style="width:auto !important; height:auto !important; max-width:100% !important; max-height:100% !important; margin:0 !important;" controls><source src="'+i+'" type="video/mp4"> Your browser does not support the video tag. </video>'),r+=l+="</div>";break;case"EMBED_OEMBED_INSTAGRAM_IMAGE":l="<div ";for(attr in a)/src/i.test(attr)||""!=attr&&""!=a[attr]&&(l+=" "+attr+'="'+a[attr]+'"');l+=" >",""!=i&&(l+='<img src="//instagram.com/p/'+i+'/media/?size=l" style=" max-width:100% !important; max-height:100% !important; width:auto; height:auto;">'),r+=l+="</div>";break;case"EMBED_OEMBED_INSTAGRAM_POST":l="<div ";for(attr in a)/src/i.test(attr)||""!=attr&&""!=a[attr]&&(l+=" "+attr+'="'+a[attr]+'"',"CLASS"!=attr&&"class"!=attr&&"Class"!=attr||(obj_class=a[attr]));l+=" >",""!=i&&(l+='<iframe class="inner_instagram_iframe_'+obj_class+'" src="//instagr.am/p/'+i+'/embed/?enablejsapi=1" style="max-width:100% !important; max-height:100% !important; width:100%; height:100%; margin:0; display:table-cell; vertical-align:middle;"frameborder="0" scrolling="no" allowtransparency="false" allowfullscreen></iframe>'),r+=l+="</div>";break;case"EMBED_OEMBED_FACEBOOK_IMAGE":var n="<span ";for(attr in a)/src/i.test(attr)||""!=attr&&""!=a[attr]&&(n+=" "+attr+'="'+a[attr]+'"');n+=" >",""!=i&&(n+='<img src="'+t+'" style=" max-width:100% !important; max-height:100% !important; width:auto; height:100%;">'),r+=n+="</span>";break;case"EMBED_OEMBED_FACEBOOK_VIDEO":var g="<div ";for(attr in a)/src/i.test(attr)||""!=attr&&""!=a[attr]&&(g+=" "+attr+'="'+a[attr]+'"');g+=" >",""!=i&&(g+='<iframe src="//www.facebook.com/video/embed?video_id='+t+'&enablejsapi=1&wmode=transparent" style="max-width:100% !important; max-height:100% !important; width:100%; height:100%; margin:0; display:table-cell; vertical-align:middle;"frameborder="0" class="bwg_fb_video" scrolling="no" allowtransparency="false" allowfullscreen></iframe>'),r+=g+="</div>";break;case"EMBED_OEMBED_DAILYMOTION_VIDEO":var w="<iframe ";for(attr in""!=i&&(w+=' src="//www.dailymotion.com/embed/video/'+i+'?api=postMessage"'),a)/src/i.test(attr)||""!=attr&&""!=a[attr]&&(w+=" "+attr+'="'+a[attr]+'"');r+=w+=" ></iframe>";break;case"EMBED_OEMBED_IMGUR":var b="<div ";for(attr in a)/src/i.test(attr)||""!=attr&&""!=a[attr]&&(l+=" "+attr+'="'+a[attr]+'"');b+=" >",""!=i&&(b+='<img src="'+i+'" style="max-width:100% !important; max-height:100% !important; width:auto; height:auto !important;">'),r+=b+="</div>";break;case"EMBED_OEMBED_GOOGLE_PHOTO_IMAGE":var u="<div ";for(attr in a)/src/i.test(attr)||""!=attr&&""!=a[attr]&&(u+=" "+attr+'="'+a[attr]+'"');u+=" >",""!=i&&(u+='<img src="'+t+'" style=" max-width:100% !important; max-height:100% !important; width:auto; height:auto;">'),r+=u+="</div>";break;default:var d={content:""};jQuery(document).trigger("bwg_display_embed",[d,e,t,i,a]),r=d.content}return r}function bwg_add_instagram_gallery(e,s){if(!0===(s=void 0!==s&&s)){if(bwg_check_instagram_gallery_input(e,s))return!1;var t="0";1==jQuery("input[name=popup_instagram_post_gallery]:checked").val()&&(t="1");var i=encodeURI(jQuery("#popup_instagram_gallery_source").val()),a=encodeURI(jQuery("#popup_instagram_image_number").val())}else{if(bwg_check_instagram_gallery_input(e,s))return!1;if(!bwg_check_gallery_empty(!1,!0))return!1;t="0";1==jQuery("input[name=instagram_post_gallery]:checked").val()&&(t="1");i=encodeURI(jQuery("#gallery_source").val());var r=jQuery("input[name=update_flag]:checked").val();a=encodeURI(jQuery("#autogallery_image_number").val())}jQuery("#bulk_embed").hide(),jQuery("#loading_div").show();var o=[],_={action:"addInstagramGallery",instagram_user:i,instagram_access_token:e,whole_post:t,autogallery_image_number:a,update_flag:r,async:!0};jQuery.post(ajax_url,_,function(e){if(0==e)return alert("Error: cannot get response from the server."),jQuery("#loading_div").hide(),s&&jQuery("#bulk_embed").show(),!1;var t=e.indexOf("WD_delimiter_start"),i=e.indexOf("WD_delimiter_end");if(-1==t||-1==i)return jQuery("#loading_div").hide(),s&&jQuery("#bulk_embed").show(),!1;if(e=e.substring(t+18,i),response_JSON=jQuery.parseJSON(e),response_JSON){if("error"==response_JSON[0])return alert("Error: "+jQuery.parseJSON(e)[1]),jQuery("#loading_div").hide(),s&&jQuery("#bulk_embed").show(),!1;for(var a=response_JSON.length,r=1;r<=a;r++)if(0!=response_JSON[a-r]){var _=response_JSON[a-r];o.push(_)}return bwg_add_image(o),s||(bwg_gallery_update_flag(),jQuery("#tr_instagram_gallery_add_button").hide()),jQuery("#loading_div").hide(),s&&jQuery(".opacity_bulk_embed").hide(),"ok"}return alert("There is some error. Cannot add Instagram gallery."),jQuery("#loading_div").hide(),s&&jQuery("#bulk_embed").show(),!1})}var bwg=0,isMobile=/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()),bwg_click=isMobile?"touchend":"click",bwg_params=[],bwg_params_ib=[],bwg_params_carousel=[];function bwg_main_ready(){1==bwg_objectsL10n.lazy_load&&jQuery(function(){jQuery("img.bwg_lazyload").lazy({onFinishedAll:function(){jQuery(".lazy_loader").removeClass("lazy_loader")}})}),jQuery(".bwg_container").each(function(){0<jQuery(this).find(".wd_error").length&&bwg_container_loaded(jQuery(this).data("bwg"))}),bwg_document_ready(),jQuery(".bwg-thumbnails, .bwg-masonry-thumbnails, .bwg-album-thumbnails").each(function(){bwg_all_thumnails_loaded(this)}),jQuery(".bwg-mosaic-thumbnails").each(function(){bwg_thumbnail_mosaic(this)}),bwg_slideshow_ready(),bwg_carousel_ready(),bwg_carousel_onload(),bwg_image_browser_ready()}function bwg_resize_search_line(){jQuery(".search_line").each(function(){var e=jQuery(this);e.width()<410?e.addClass("bwg-search-line-responsive"):e.removeClass("bwg-search-line-responsive")})}function bwg_slideshow_resize(){jQuery(".bwg_slideshow").each(function(){bwg=jQuery(this).attr("data-bwg"),jQuery("#bwg_slideshow_image_container_"+bwg).length&&(bwg_params[bwg]=JSON.parse(jQuery("#bwg_slideshow_image_container_"+bwg).attr("data-params")),bwg_params[bwg].event_stack=[],bwg_popup_resize(bwg))})}function bwg_blog_style_resize(){jQuery(".bwg_blog_style").each(function(){bwg=jQuery(this).attr("data-bwg"),jQuery(".bwg_embed_frame_16x9_"+bwg).each(function(e){jQuery(this).width(jQuery(this).parent().width()),jQuery(this).height(.5625*jQuery(this).width())}),jQuery(".bwg_embed_frame_instapost_"+bwg).each(function(e){jQuery(this).width(jQuery(this).parent().width()),jQuery(this).height((jQuery(this).width()-16)*jQuery(this).attr("data-height")/jQuery(this).attr("data-width")+96)})})}function bwg_blog_style_onload(){jQuery(".bwg_blog_style").each(function(){bwg=jQuery(this).attr("data-bwg");jQuery("#bwg_blog_style_"+bwg);jQuery(".bwg_embed_frame_16x9_"+bwg).each(function(e){if(jQuery(".bwg_blog_style_image_"+bwg).find(".fluid-width-video-wrapper").length){jQuery(".fluid-width-video-wrapper").removeAttr("style");var t=jQuery(this).parents(".bwg_blog_style_image_"+bwg).find(".fluid-width-video-wrapper").contents();jQuery(this).parents(".fluid-width-video-wrapper").replaceWith(t)}jQuery(this).width(jQuery(this).parents(".bwg_blog_style_image_"+bwg).width()),jQuery(this).height(.5625*jQuery(this).width())}),jQuery(".bwg_embed_frame_instapost_"+bwg).each(function(e){jQuery(this).width(jQuery(this).parents(".bwg_blog_style_image_"+bwg).width()),jQuery(this).height((jQuery(this).width()-16)*jQuery(this).attr("data-height")/jQuery(this).attr("data-width")+96)}),bwg_container_loaded(bwg)})}function bwg_blog_style_ready(){jQuery(".bwg_blog_style").each(function(){var e=jQuery(this).attr("data-bwg");bwg_container_loaded(e);var t=!1;jQuery(this).find(".bwg_lightbox_"+e).on("click",function(){var e=jQuery(this).attr("data-image-id");if(jQuery("#bwg_blog_style_share_buttons_"+e).removeAttr("data-open-comment"),!t)return t=!0,setTimeout(function(){t=!1},100),bwg_gallery_box(e,jQuery(this).closest(".bwg_container")),!1}),jQuery(".bwg_lightbox_"+e+" .bwg_ecommerce").on("click",function(e){if(e.stopPropagation(),!t)return t=!0,setTimeout(function(){t=!1},100),bwg_gallery_box(jQuery(this).attr("data-image-id"),jQuery(this).closest(".bwg_container"),!0),!1});var i=window.location.hash.substring(1);i&&"-1"!=i.indexOf("bwg")&&(bwg_hash_array=i.replace("bwg","").split("/"),"<?php echo $params_array['gallery_id']; ?>"==bwg_hash_array[0]&&bwg_gallery_box(bwg_hash_array[1]))})}function bwg_slideshow_focus(){jQuery(".bwg_slideshow").each(function(){bwg=jQuery(this).attr("data-bwg"),jQuery("#bwg_slideshow_image_container_"+bwg).length&&(bwg_params[bwg]=JSON.parse(jQuery("#bwg_slideshow_image_container_"+bwg).attr("data-params")),bwg_params[bwg].event_stack=[],window.clearInterval(window["bwg_playInterval"+bwg]),jQuery(".bwg_ctrl_btn_"+bwg).hasClass("bwg-icon-play")||bwg_play(bwg_params[bwg].data,bwg))})}function bwg_slideshow_blur(){jQuery(".bwg_slideshow").each(function(){bwg=jQuery(this).attr("data-bwg"),jQuery("#bwg_slideshow_image_container_"+bwg).length&&(bwg_params[bwg]=JSON.parse(jQuery("#bwg_slideshow_image_container_"+bwg).attr("data-params")),bwg_params[bwg].event_stack=[],window.clearInterval(window["bwg_playInterval"+bwg]))})}function bwg_carousel_ready(){jQuery(".bwg-carousel").each(function(){var t=jQuery(this).data("bwg");bwg_params_carousel[t]=[],bwg_params_carousel[t].bwg_currentCenterNum=1,bwg_params_carousel[t].bwg_currentlyMoving=!1,bwg_params_carousel[t].data=[],jQuery("#spider_carousel_left-ico_"+t).on("click",function(){bwg_params_carousel[t].carousel.prev()}),jQuery("#spider_carousel_right-ico_"+t).on("click",function(){bwg_params_carousel[t].carousel.next()}),parseInt(bwg_params_carousel[t].carousel_enable_autoplay)&&(jQuery(".bwg_carousel_play_pause_"+t).attr("title",bwg_objectsL10n.pause),jQuery(".bwg_carousel_play_pause_"+t).attr("class","bwg-icon-pause bwg_ctrl_btn_"+t+" bwg_carousel_play_pause_"+t)),jQuery(".bwg_carousel_play_pause_"+t).on(bwg_click,function(e){jQuery(".bwg_ctrl_btn_"+t).hasClass("bwg-icon-play")?(jQuery(".bwg_carousel_play_pause_"+t).attr("title",bwg_objectsL10n.pause),jQuery(".bwg_carousel_play_pause_"+t).attr("class","bwg-icon-pause bwg_ctrl_btn_"+t+" bwg_carousel_play_pause_"+t),bwg_params_carousel[t].bwg_currentlyMoving=!1,bwg_params_carousel[t].carousel.start()):(jQuery(".bwg_carousel_play_pause_"+t).attr("title",bwg_objectsL10n.play),jQuery(".bwg_carousel_play_pause_"+t).attr("class","bwg-icon-play bwg_ctrl_btn_"+t+" bwg_carousel_play_pause_"+t),bwg_params_carousel[t].bwg_currentlyMoving=!0,bwg_params_carousel[t].carousel.pause()),e.stopPropagation(),e.stopImmediatePropagation()}),void 0!==jQuery().swiperight&&jQuery.isFunction(jQuery().swiperight)&&jQuery("#bwg_container1_"+t).swiperight(function(){bwg_params_carousel[t].carousel.prev()}),void 0!==jQuery().swipeleft&&jQuery.isFunction(jQuery().swipeleft)&&jQuery("#bwg_container1_"+t).swipeleft(function(){bwg_params_carousel[t].carousel.next()})})}function bwg_carousel_resize(){jQuery(".bwg-carousel").each(function(){var e=jQuery(this).data("bwg");bwg_carousel_params(e),bwg_params_carousel[e].carousel.pause(),bwg_carousel_watermark(e),jQuery(".bwg_ctrl_btn_"+e).hasClass("bwg-icon-play")||bwg_params_carousel[e].carousel.start()})}function bwg_carousel_onload(){jQuery(".bwg-carousel").each(function(){var e=jQuery(this).data("bwg");bwg_params_carousel[e]=jQuery(this).data("params"),bwg_carousel_watermark(e),bwg_carousel_params(e),bwg_container_loaded(e)})}function bwg_carousel_params(t){var e=jQuery("#bwg_container1_"+t).parent().width(),i=1;e<bwg_params_carousel[t].carousel_r_width?i=e/bwg_params_carousel[t].carousel_r_width:e=bwg_params_carousel[t].carousel_r_width,bwg_params_carousel[t].carousel_image_column_number>bwg_params_carousel[t].count&&(bwg_params_carousel[t].carousel_image_column_number=bwg_params_carousel[t].count),jQuery(".bwg_carousel_play_pause_"+t).css({display:parseInt(bwg_params_carousel[t].carousel_play_pause_butt)?"":"none"}),parseInt(bwg_params_carousel[t].carousel_prev_next_butt)?(jQuery("#bwg_carousel-right"+t).css({display:""}),jQuery("#bwg_carousel-left"+t).css({display:""})):(jQuery("#bwg_carousel-left"+t).css({display:"none"}),jQuery("#bwg_carousel-right"+t).css({display:"none"})),jQuery(".inner_instagram_iframe_bwg_embed_frame_"+t).each(function(){var e=jQuery(this).parent();bwg_params_carousel[t].image_height/(parseInt(e.attr("data-height"))+96)<bwg_params_carousel[t].image_width/parseInt(e.attr("data-width"))?(e.height(bwg_params_carousel[t].image_height*i),e.width((e.height()-96)*e.attr("data-width")/e.attr("data-height")+16)):(e.width(bwg_params_carousel[t].image_width*i),e.height((e.width()-16)*e.attr("data-height")/e.attr("data-width")+96))}),jQuery(".bwg_carousel_image_container_"+t).css({width:bwg_params_carousel[t].image_width*i,height:bwg_params_carousel[t].image_height*i}),jQuery(".bwg_carousel_watermark_text_"+t+", .bwg_carousel_watermark_text_"+t+":hover").css({fontSize:e*(bwg_params_carousel[t].watermark_font_size/bwg_params_carousel[t].image_width)*i}),jQuery(".bwg_carousel-image "+t).css({width:bwg_params_carousel[t].image_width*i,height:bwg_params_carousel[t].image_height*i}),jQuery(".bwg_carousel_watermark_container_"+t).css({width:bwg_params_carousel[t].image_width*i,height:bwg_params_carousel[t].image_height*i}),jQuery(".bwg_carousel_embed_video_"+t).css({width:bwg_params_carousel[t].image_width*i,height:bwg_params_carousel[t].image_height*i}),jQuery(".bwg_carousel_watermark_spun_"+t).css({width:bwg_params_carousel[t].image_width*i,height:bwg_params_carousel[t].image_height*i}),jQuery(".bwg_carousel-container"+t).css({width:e,height:bwg_params_carousel[t].image_height*i}),jQuery(".bwg_video_hide"+t).css({width:bwg_params_carousel[t].image_width*i,height:bwg_params_carousel[t].image_height*i}),bwg_params_carousel[t].carousel=jQuery("#bwg_carousel"+t).featureCarousel({containerWidth:e*i,containerHeight:bwg_params_carousel[t].image_height*i,fit_containerWidth:bwg_params_carousel[t].carousel_fit_containerWidth,largeFeatureWidth:bwg_params_carousel[t].image_width*i,largeFeatureHeight:bwg_params_carousel[t].image_height*i,smallFeaturePar:bwg_params_carousel[t].carousel_image_par,currentlyMoving:!1,startingFeature:bwg_params_carousel[t].bwg_currentCenterNum,featuresArray:[],timeoutVar:null,rotationsRemaining:0,autoPlay:1e3*bwg_params_carousel[t].car_inter,interval:1e3*bwg_params_carousel[t].carousel_interval,imagecount:bwg_params_carousel[t].carousel_image_column_number,bwg_number:t,enable_image_title:bwg_params_carousel[t].enable_image_title,borderWidth:0})}function bwg_carousel_watermark(e){var t=1,i=jQuery("#bwg_container1_"+e).parent().width();if(i<bwg_params_carousel[e].carousel_r_width&&(t=i/bwg_params_carousel[e].carousel_r_width),i>=bwg_params_carousel[e].image_width)bwg_carousel_change_watermark_container(e),jQuery("#bwg_carousel_play_pause-ico_"+e).css({fontSize:bwg_params_carousel[e].carousel_play_pause_btn_size}),jQuery(".bwg_carousel_watermark_image_"+e).css({maxWidth:bwg_params_carousel[e].watermark_width*t,maxHeight:bwg_params_carousel[e].watermark_height*t}),jQuery(".bwg_carousel_watermark_text_"+e+", .bwg_carousel_watermark_text_"+e+":hover").css({fontSize:t*bwg_params_carousel[e].watermark_font_size});else{var a=bwg_params_carousel[e].image_width/t;bwg_carousel_change_watermark_container(e),jQuery("#bwg_carousel_play_pause-ico_"+e).css({fontSize:i*bwg_params_carousel[e].carousel_play_pause_btn_size/a}),jQuery(".bwg_carousel_watermark_image_"+e).css({maxWidth:i*bwg_params_carousel[e].watermark_width/a,maxHeight:i*bwg_params_carousel[e].watermark_height/a}),jQuery(".bwg_carousel_watermark_text_"+e+", .bwg_carousel_watermark_text_"+e+":hover").css({fontSize:i*bwg_params_carousel[e].watermark_font_size/a})}}function bwg_carousel_change_watermark_container(a){jQuery(".bwg_carousel"+a).children().each(function(){if(2==jQuery(this).css("zIndex")){var e=jQuery(this).find("img");e.length||(e=jQuery(this).find("iframe"));var t=e.width(),i=e.height();jQuery(".bwg_carousel_watermark_spun_"+a).width(t),jQuery(".bwg_carousel_watermark_spun_"+a).height(i),jQuery(".bwg_carousel_title_spun_"+a).width(t),jQuery(".bwg_carouel_title_spun_"+a).height(i),jQuery(".bwg_carousel_watermark_"+a).css({display:"none"})}})}function bwg_carousel_preload(e,t){var i=jQuery(".bwg_carousel_preload").get();t||i.reverse();var a=0;jQuery(i).each(function(){if(1<++a)return!1;jQuery(this).parent().hasClass("bwg_carousel_embed_video_"+e)||jQuery(this).parent().hasClass("bwg_embed_frame_"+e)||jQuery(this).parent().hasClass("bwg_carousel_video")?(jQuery(this).attr("src",jQuery(this).attr("data-src")),jQuery(this).on("load",function(){jQuery(this).removeClass("bwg_carousel_preload")}),jQuery(this).parent().hasClass("bwg_carousel_video")&&(jQuery(".bwg_carousel_video")[0].load(),jQuery(this).parent().parent().removeClass("bwg_carousel_preload")),jQuery(this).removeAttr("data-src")):(jQuery(this).css({"background-image":"url('"+jQuery(this).attr("data-background")+"')",height:"100%"}),jQuery(this).removeClass("bwg_carousel_preload"),jQuery(this).removeAttr("data-background"))})}function bwg_slideshow_ready(){jQuery(".bwg_slideshow").each(function(){var i=jQuery(this).data("bwg");if(jQuery("#bwg_slideshow_image_container_"+i).length){bwg_params[i]=JSON.parse(jQuery("#bwg_slideshow_image_container_"+i).attr("data-params")),bwg_params[i].event_stack=[],bwg_container_loaded(i);var e=bwg_params[i].data;void 0!==jQuery().swiperight&&jQuery.isFunction(jQuery().swiperight)&&jQuery("#bwg_container1_"+i).swiperight(function(){return bwg_change_image(parseInt(jQuery("#bwg_current_image_key_"+i).val()),0<=parseInt(jQuery("#bwg_current_image_key_"+i).val())-bwg_iterator(i)?(parseInt(jQuery("#bwg_current_image_key_"+i).val())-bwg_iterator(i))%e.length:e.length-1,e,"",i),!1}),void 0!==jQuery().swipeleft&&jQuery.isFunction(jQuery().swipeleft)&&jQuery("#bwg_container1_"+i).swipeleft(function(){return bwg_change_image(parseInt(jQuery("#bwg_current_image_key_"+i).val()),parseInt(jQuery("#bwg_current_image_key_"+i).val())+bwg_iterator(i)%e.length,e,"",i),!1});var t=/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase())?"touchend":"click";bwg_popup_resize(i),jQuery(".bwg_slideshow_watermark_"+i).css({display:"none"}),jQuery(".bwg_slideshow_title_text_"+i).css({display:"none"}),jQuery(".bwg_slideshow_description_text_"+i).css({display:"none"}),setTimeout(function(){bwg_change_watermark_container(i)},500),"horizontal"==bwg_params[i].filmstrip_direction?jQuery(".bwg_slideshow_image_container_"+i).height(jQuery(".bwg_slideshow_image_wrap_"+i).height()-bwg_params[i].slideshow_filmstrip_height):jQuery(".bwg_slideshow_image_container_"+i).width(jQuery(".bwg_slideshow_image_wrap_"+i).width()-bwg_params[i].slideshow_filmstrip_width);var a=/Firefox/i.test(navigator.userAgent)?"DOMMouseScroll":"mousewheel";jQuery(".bwg_slideshow_filmstrip_"+i).bind(a,function(e){var t=window.event||e;return 0<((t=t.originalEvent?t.originalEvent:t).detail?-40*t.detail:t.wheelDelta)?jQuery(".bwg_slideshow_filmstrip_left_"+i).trigger("click"):jQuery(".bwg_slideshow_filmstrip_right_"+i).trigger("click"),!1}),jQuery(".bwg_slideshow_filmstrip_right_"+i).on(t,function(){jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).stop(!0,!1),"left"==bwg_params[i].left_or_top?"width"==bwg_params[i].width_or_height?(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).position().left>=-(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).width()-jQuery(".bwg_slideshow_filmstrip_"+i).width())&&(jQuery(".bwg_slideshow_filmstrip_left_"+i).css({opacity:1}),jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).position().left<-(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).width()-jQuery(".bwg_slideshow_filmstrip_"+i).width()-(parseInt(bwg_params[i].filmstrip_thumb_margin_hor)+parseInt(bwg_params[i].slideshow_filmstrip_width)))?jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).animate({left:-(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).width()-jQuery(".bwg_slideshow_filmstrip_"+i).width())},500,"linear"):jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).animate({left:jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).position().left-(parseInt(bwg_params[i].filmstrip_thumb_margin_hor)+parseInt(bwg_params[i].slideshow_filmstrip_width))},500,"linear")),window.setTimeout(function(){jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).position().left==-(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).width()-jQuery(".bwg_slideshow_filmstrip_"+i).width())&&jQuery(".bwg_slideshow_filmstrip_right_"+i).css({opacity:.3})},500)):(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).position().left>=-(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).height()-jQuery(".bwg_slideshow_filmstrip_"+i).height())&&(jQuery(".bwg_slideshow_filmstrip_left_"+i).css({opacity:1}),jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).position().left<-(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).height()-jQuery(".bwg_slideshow_filmstrip_"+i).height()-(parseInt(bwg_params[i].filmstrip_thumb_margin_hor)+parseInt(bwg_params[i].slideshow_filmstrip_width)))?jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).animate({left:-(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).height()-jQuery(".bwg_slideshow_filmstrip_"+i).height())},500,"linear"):jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).animate({left:jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).position().left-(parseInt(bwg_params[i].filmstrip_thumb_margin_hor)+parseInt(bwg_params[i].slideshow_filmstrip_width))},500,"linear")),window.setTimeout(function(){jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).position().left==-(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).height()-jQuery(".bwg_slideshow_filmstrip_"+i).height())&&jQuery(".bwg_slideshow_filmstrip_right_"+i).css({opacity:.3})},500)):"width"==bwg_params[i].width_or_height?(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).position().top>=-(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).width()-jQuery(".bwg_slideshow_filmstrip_"+i).width())&&(jQuery(".bwg_slideshow_filmstrip_left_"+i).css({opacity:1}),jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).position().top<-(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).width()-jQuery(".bwg_slideshow_filmstrip_"+i).width()-parseInt(bwg_params[i].filmstrip_thumb_margin_hor)+parseInt(bwg_params[i].slideshow_filmstrip_width))?jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).animate({top:-(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).width()-jQuery(".bwg_slideshow_filmstrip_"+i).width())},500,"linear"):jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).animate({top:jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).position().top-parseInt(bwg_params[i].filmstrip_thumb_margin_hor)+parseInt(bwg_params[i].slideshow_filmstrip_width)},500,"linear")),window.setTimeout(function(){jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).position().top==-(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).width()-jQuery(".bwg_slideshow_filmstrip_"+i).width())&&jQuery(".bwg_slideshow_filmstrip_right_"+i).css({opacity:.3})},500)):(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).position().top>=-(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).height()-jQuery(".bwg_slideshow_filmstrip_"+i).height())&&(jQuery(".bwg_slideshow_filmstrip_left_"+i).css({opacity:1}),jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).position().top<-(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).height()-jQuery(".bwg_slideshow_filmstrip_"+i).height()-(parseInt(bwg_params[i].filmstrip_thumb_margin_hor)+parseInt(bwg_params[i].slideshow_filmstrip_width)))?jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).animate({top:-(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).height()-jQuery(".bwg_slideshow_filmstrip_"+i).height())},500,"linear"):jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).animate({top:jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).position().top-(parseInt(bwg_params[i].filmstrip_thumb_margin_hor)+parseInt(bwg_params[i].slideshow_filmstrip_width))},500,"linear")),window.setTimeout(function(){jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).position().top==-(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).height()-jQuery(".bwg_slideshow_filmstrip_"+i).height())&&jQuery(".bwg_slideshow_filmstrip_right_"+i).css({opacity:.3})},500))}),jQuery(".bwg_slideshow_filmstrip_left_"+i).on(t,function(){jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).stop(!0,!1),"left"==bwg_params[i].left_or_top?(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).position().left<0&&(jQuery(".bwg_slideshow_filmstrip_right_"+i).css({opacity:1}),jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).position().left>-(bwg_params[i].filmstrip_thumb_margin_hor+bwg_params[i].slideshow_filmstrip_width)?jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).animate({left:0},500,"linear"):jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).animate({left:jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).position().left+parseInt(bwg_params[i].filmstrip_thumb_margin_hor)+parseInt(bwg_params[i].slideshow_filmstrip_width)},500,"linear")),window.setTimeout(function(){0==jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).position().left&&jQuery(".bwg_slideshow_filmstrip_left_"+i).css({opacity:.3})},500)):(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).position().top<0&&(jQuery(".bwg_slideshow_filmstrip_right_"+i).css({opacity:1}),jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).position().top>-(bwg_params[i].filmstrip_thumb_margin_hor+bwg_params[i].slideshow_filmstrip_width)?jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).animate({top:0},500,"linear"):jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).animate({top:jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).position().top+parseInt(bwg_params[i].filmstrip_thumb_margin_hor)+parseInt(bwg_params[i].slideshow_filmstrip_width)},500,"linear")),window.setTimeout(function(){0==jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).position().top&&jQuery(".bwg_slideshow_filmstrip_left_"+i).css({opacity:.3})},500))}),"width"==bwg_params[i].width_or_height?bwg_set_filmstrip_pos(jQuery(".bwg_slideshow_filmstrip_"+i).width(),i):bwg_set_filmstrip_pos(jQuery(".bwg_slideshow_filmstrip_"+i).height(),i),jQuery("#bwg_slideshow_play_pause_"+i).off(t).on(t,function(){jQuery(".bwg_ctrl_btn_"+i).hasClass("bwg-icon-play")?(bwg_play(bwg_params[i].data,i),jQuery(".bwg_slideshow_play_pause_"+i).attr("title",bwg_objectsL10n.pause),jQuery(".bwg_slideshow_play_pause_"+i).attr("class","bwg-icon-pause bwg_ctrl_btn_"+i+" bwg_slideshow_play_pause_"+i),1==bwg_params[i].enable_slideshow_music&&document.getElementById("bwg_audio_"+i).play()):(window.clearInterval(window["bwg_playInterval"+i]),jQuery(".bwg_slideshow_play_pause_"+i).attr("title","Play"),jQuery(".bwg_slideshow_play_pause_"+i).attr("class","bwg-icon-play bwg_ctrl_btn_"+i+" bwg_slideshow_play_pause_"+i),1==bwg_params[i].enable_slideshow_music&&document.getElementById("bwg_audio_"+i).pause())}),0!=bwg_params[i].enable_slideshow_autoplay&&(bwg_play(bwg_params[i].data,i),jQuery(".bwg_slideshow_play_pause_"+i).attr("title",bwg_objectsL10n.pause),jQuery(".bwg_slideshow_play_pause_"+i).attr("class","bwg-icon-pause bwg_ctrl_btn_"+i+" bwg_slideshow_play_pause_"+i),1==bwg_params[i].enable_slideshow_music&&jQuery("#bwg_audio_"+i).length&&document.getElementById("bwg_audio_"+i).play()),bwg_params[i].preload_images&&bwg_preload_images(parseInt(jQuery("#bwg_current_image_key_".$bwg).val()),i),jQuery(".bwg_slideshow_image_"+i).removeAttr("width"),jQuery(".bwg_slideshow_image_"+i).removeAttr("height")}})}function bwg_image_browser_resize(){jQuery(".bwg_image_browser").each(function(){var e=jQuery(this).attr("data-bwg");jQuery(".image_browser_images_conteiner_"+e).length&&(bwg_params_ib[e]=JSON.parse(jQuery("#bwg_container1_"+e+" .image_browser_images_conteiner_"+e).attr("data-params")),bwg_image_browser(e))})}function bwg_image_browser_ready(){jQuery(".bwg_image_browser").each(function(){var e=jQuery(this).attr("data-bwg");bwg_container_loaded(e),jQuery(".image_browser_images_conteiner_"+e).length&&(bwg_params_ib[e]=JSON.parse(jQuery(".image_browser_images_conteiner_"+e).attr("data-params")),setTimeout(function(){bwg_image_browser(e)},3))})}function bwg_search_focus(e){jQuery(e).parent().find(".bwg_search_input").focus(),jQuery(e).hide()}function bwg_key_press(e){jQuery(e).parent().find(".bwg_search_reset_container").removeClass("hidden"),jQuery(e).parent().find(".bwg_search_loupe_container1").removeClass("hidden")}function bwg_all_thumnails_loaded(t){var i=0,a=jQuery(t).find("img").length;return 0==a?bwg_all_thumbnails_loaded_callback(t):jQuery(t).find("img").each(function(){var e=jQuery(this).attr("src");jQuery("<img/>").attr("src",e).on("load error",function(){++i>=a&&bwg_all_thumbnails_loaded_callback(t)})}),0==a}function bwg_all_thumbnails_loaded_callback(e){jQuery(e).hasClass("bwg-thumbnails")&&!jQuery(e).hasClass("bwg-masonry-thumbnails")&&bwg_thumbnail(e),jQuery(e).hasClass("bwg-masonry-thumbnails")&&bwg_thumbnail_masonry(e),jQuery(e).hasClass("bwg-album-extended")&&bwg_album_extended(e)}function bwg_container_loaded(e){jQuery("#gal_front_form_"+e).removeClass("bwg-hidden"),jQuery("#ajax_loading_"+e).addClass("bwg-hidden")}function bwg_album_thumbnail(e){bwg_container_loaded(jQuery(e).data("bwg"))}function bwg_album_extended(e){var t=jQuery(e).width(),i=jQuery(e).data("thumbnail-width"),a=jQuery(e).data("spacing"),r=jQuery(e).data("max-count"),_=parseInt(t/(2*i));_<1&&(_=1),r<_&&(_=r);var s=100/_,o=jQuery(e).find(".bwg-extended-item"),l=parseInt(o.css("margin-left")),n=parseInt(o.css("margin-right"));o.css({width:"calc("+s+"% - "+(l+n)+"px)"}),o.width()<i?o.find(".bwg-extended-item0, .bwg-extended-item1").css({width:"calc(100% - "+a+"px)"}):o.width()>2*i?(o.find(".bwg-extended-item0").css({width:"calc(50% - "+a+"px)"}),o.find(".bwg-extended-item1").css({width:"calc(100% - "+(i+2*a)+"px)"})):o.find(".bwg-extended-item0, .bwg-extended-item1").css({width:"calc(50% - "+a+"px)"}),jQuery(e).children(".bwg-extended-item").each(function(){var e=jQuery(this).find("img"),t=jQuery(this).find(".bwg-item0"),i=jQuery(this).find(".bwg-item2"),a=e.data("width"),r=e.data("height");""!=a&&""!=r||(a=e.width(),r=e.height());var _=a/r;i.width()/i.height()>a/r?(i.width()>a?e.css({width:"100%",height:i.width()/_}):e.css({maxWidth:"100%",height:i.width()/_}),a=i.width(),r=i.width()/_):(i.height()>r?e.css({height:"100%",width:i.height()*_,maxWidth:"initial"}):e.css({maxHeight:"100%",width:i.height()*_,maxWidth:"initial"}),r=i.height(),a=i.height()*_),jQuery(this).find(".bwg-item2").css({marginLeft:(t.width()-a)/2,marginTop:(t.height()-r)/2})}),bwg_container_loaded(jQuery(e).data("bwg"))}function bwg_thumbnail(e){var t=jQuery(e).width(),i=jQuery(e).data("thumbnail-width"),a=jQuery(e).data("max-count"),r=parseInt(t/i)+1;a<r&&(r=a);var _=100/r;jQuery(e).find(".bwg-item").css({width:_+"%"}),jQuery(e).children(".bwg-item").each(function(){var e=jQuery(this).find("img"),t=jQuery(this).find(".bwg-item2"),i=jQuery(this).find(".bwg-item1"),a=0<t.width()?t.width():i.width(),r=0<t.height()?t.height():i.height(),_=e.data("width"),s=e.data("height");""!=_&&""!=s&&void 0!==_&&void 0!==s||(_=e.width(),s=e.height());var o=_/s;e.removeAttr("style"),o<a/r?(_<a?e.css({width:"100%",height:a/o}):e.css({maxWidth:"100%",height:Math.ceil(a/o)}),s=(_=a)/o):(r>e.height()?e.css({height:"100%",width:r*o,maxWidth:"initial"}):e.css({maxHeight:"100%",width:r*o,maxWidth:"initial"}),_=(s=r)*o),jQuery(this).find(".bwg-item2").css({marginLeft:(a-_)/2,marginTop:(r-s)/2})}),bwg_container_loaded(jQuery(e).data("bwg"))}function bwg_thumbnail_masonry(e){var t=jQuery(e);if(t.find(".bwg-empty-item").remove(),"horizontal"==t.data("masonry-type")){var a=t.data("thumbnail-height"),r=t.data("max-count"),_=[];for(i=0;i<r;i++)_.push(0);t.find(".bwg-item").each(function(){var e=_.indexOf(Math.min.apply(Math,_));jQuery(this).css({height:a,order:e+1}),_[e]+=jQuery(this)[0].getBoundingClientRect().width});var s=Math.max.apply(Math,_);for(t.width(s),i=0;i<r;i++)_[i]<s&&t.append(jQuery('<div class="bwg-item bwg-empty-item"></div>').css({height:a,order:i+1,width:s-_[i]}))}else{t.removeAttr("style");s=t.width();var o=t.data("thumbnail-width"),l=(r=t.data("max-count"),parseInt(s/o)+("0"==t.data("resizable-thumbnails")?0:1));r<l&&(l=r);var n=t.find(".bwg-item").length;n<l&&(l=n);var g,w,b=100/l,u=[];for(i=0;i<l;i++)u.push(0);t.find(".bwg-item").each(function(){var e=u.indexOf(Math.min.apply(Math,u));jQuery(this).css({width:b+"%",order:e+1}),0<jQuery(this).find("img").attr("data-width").length&&0<jQuery(this).find("img").attr("data-height").length&&(w=jQuery(this).find("img").data("width")/jQuery(this).find("img").data("height"),g=jQuery(this).width()/w,jQuery(this).height(g)),u[e]+=jQuery(this)[0].getBoundingClientRect().height});var d=Math.max.apply(Math,u);for(i=0;i<l;i++)u[i]<d&&t.append(jQuery('<div class="bwg-item bwg-empty-item"></div>').css({width:b+"%",order:i+1,height:d-u[i]}));t.outerWidth(l*o),t.height(d)}bwg_container_loaded(t.data("bwg"))}function bwg_thumbnail_mosaic_logic(e){var t=e.attr("data-bwg"),i=e.attr("data-block-id"),a=parseInt(e.attr("data-thumb-padding"))/2,r=parseInt(e.attr("data-thumb-border"))+a;if("horizontal"==e.attr("data-mosaic-direction")){var _=parseInt(e.attr("data-height"));if("1"==e.attr("data-resizable"))if(1920<=jQuery(window).width())var s=(1+jQuery(window).width()/1920)*_;else if(jQuery(window).width()<=640)s=jQuery(window).width()/640*_;else s=_;else s=_;(c=jQuery(".bwg_mosaic_thumb_"+t)).each(function(e){var t=jQuery(this).data("width"),i=jQuery(this).data("height");""!=t&&""!=i&&void 0!==t&&void 0!==i||(t=c.get(e).naturalWidth,i=c.get(e).naturalHeight),t=t*s/i,c.eq(e).height(s),c.eq(e).width(t)});var o=jQuery("#bwg_mosaic_thumbnails_div_"+t).width()/100*parseInt(e.attr("data-total-width"));jQuery("#"+i).width(o);var l=s+2*r,n=0,g=[];g[0]=0;var w=[],b=w[0]=0;c.each(function(e){row_cum_width2=b+c.eq(e).width()+2*r,row_cum_width2-o<0?(b=row_cum_width2,g[e]=n,w[n]++):e!==c.length-1?Math.abs(b-o)>Math.abs(row_cum_width2-o)||Math.abs(b-o)<=Math.abs(row_cum_width2-o)&&0==w[n]?e!==c.length-2?(b=row_cum_width2,g[e]=n,w[n]++,w[++n]=0,b=0):(b=row_cum_width2,g[e]=n,w[n]++):(w[++n]=1,g[e]=n,b=row_cum_width2-b):(b=row_cum_width2,g[e]=n,w[n]++)});for(var u=[],d=[],h=0;h<=n;h++)u[h]=1,d[h]=l;for(h=0;h<=n;h++)b=0,c.each(function(e){g[e]==h&&(b+=c.eq(e).width())}),u[h]=z=(o-2*w[h]*r)/b,d[h]=(l-2*r)*u[h]+2*r;(S=[])[0]=0;var m=[],p=[];m[0]=0,p[0]=0;for(h=1;h<=n;h++)m[h]=m[0],p[h]=p[h-1]+d[h-1];c.each(function(e){var t=c.eq(e).width(),i=c.eq(e).height();c.eq(e).width(t*u[g[e]]),c.eq(e).height(i*u[g[e]]),c.eq(e).parent().css({top:p[g[e]],left:m[g[e]]}),m[g[e]]+=t*u[g[e]]+2*r,S[g[e]]=e}),jQuery("#"+i).height(p[n]+d[n]-p[0])}else{var c,y=parseInt(e.attr("data-width"));if("1"==e.attr("data-resizable")){if(1920<=jQuery(window).width())var f=(1+jQuery(window).width()/1920)*y;else if(jQuery(window).width()<=640)f=jQuery(window).width()/640*y;else f=y;if(0<jQuery(".header-content-with_tab").length)f=jQuery(".header-content-with_tab").width()/4-10}else f=y;(c=jQuery(".bwg_mosaic_thumb_"+t)).each(function(e){var t=jQuery(this).data("width"),i=jQuery(this).data("height");""!=t&&""!=i&&void 0!==t&&void 0!==i||(t=c.get(e).naturalWidth,i=c.get(e).naturalHeight),c.eq(e).height(i*f/t),c.eq(e).width(f)});o=jQuery("#bwg_mosaic_thumbnails_div_"+t).width()/100*parseInt(e.attr("data-total-width"));jQuery("#"+i).width(o);var j=f+2*r<o?f:o-2*r,Q=Math.floor(o/(j+2*r)),v=[];v[0]=0;for(var x=[],k=[],z=0;z<Q;z++)k[z]=0,x[z]=0;c.each(function(e){for(var t=0,i=k[0],a=0;a<Q;a++)i>k[a]&&(i=k[a],t=a);v[e]=t,x[t]++,B=i,T=0+t*(j+2*r),c.eq(e).parent().css({top:B,left:T}),k[t]+=c.eq(e).height()+2*r}),(u=[])[0]=1;var C=0,I=[],E=0,O=0;for(z=0;z<Q;z++)C+=j,I[z]=0,c.each(function(e){v[e]==z&&(I[z]+=c.eq(e).height())}),0!=I[z]&&(E+=j/I[z],O+=j*x[z]*2*r/I[z]);var M=0;0!=E&&(M=(C+O)/E);for(z=0;z<Q;z++)0!=I[z]&&(u[z]=(M-2*x[z]*r)/I[z]);var S,T=[];T[0]=0;for(z=1;z<=Q;z++)T[z]=T[z-1]+j*u[z-1]+2*r;var B=[];for(z=0;z<Q;z++)B[z]=0;(S=[])[0]=0,c.each(function(e){var t=c.eq(e).width(),i=c.eq(e).height();c.eq(e).width(t*u[v[e]]),c.eq(e).height(i*u[v[e]]),c.eq(e).parent().css({top:B[v[e]],left:T[v[e]]}),B[v[e]]+=i*u[v[e]]+2*r,S[v[e]]=e}),jQuery("#"+i).width(T[Q]).height(B[0])}}function bwg_thumbnail_mosaic(e){var t=jQuery(e),i=jQuery.Deferred();i.done([bwg_thumbnail_mosaic_logic]).done(function(e){"1"!=e.data("mosaic-thumb-transition")&&jQuery(".bwg_mosaic_thumb_spun_"+bwg).css({transition:"all 0.3s ease 0s","-webkit-transition":"all 0.3s ease 0s"}),jQuery(".bwg_mosaic_thumbnails_"+bwg).css({visibility:"visible"}),jQuery(".tablenav-pages_"+bwg).css({visibility:"visible"}),bwg_container_loaded(bwg),jQuery(".bwg_mosaic_thumb_"+bwg).removeClass("bwg-hidden"),jQuery("#bwg_mosaic_thumbnails_div_"+bwg).removeClass("bwg-hidden")}),i.resolve(t),"hover"==t.attr("data-image-title")&&bwg_mosaic_title_on_hover(bwg,t,border_and_padding),"hover"==t.attr("data-ecommerce-icon")&&(jQuery(".bwg_mosaic_thumb_spun_"+bwg).on("mouseenter",function(){var e=jQuery(this).parents(".bwg-mosaic-thumb-span").children(".bwg_mosaic_thumb_"+bwg).width(),t=jQuery(this).parents(".bwg-mosaic-thumb-span").children(".bwg_mosaic_thumb_"+bwg).height();jQuery(this).children(".bwg_ecommerce_spun1_"+bwg).width(e);var i=jQuery(this).children(".bwg_ecommerce_spun1_"+bwg).width(),a=jQuery(this).children(".bwg_ecommerce_spun1_"+bwg).height();jQuery(this).children(".bwg_ecommerce_spun1_"+bwg).css({top:border_and_padding+.5*t-.5*a,left:border_and_padding+.5*e-.5*i,opacity:1})}),jQuery(".bwg_mosaic_thumb_spun_"+bwg).on("mouseleave",function(){jQuery(this).children(".bwg_ecommerce_spun1_"+bwg).css({top:0,left:-1e4,opacity:0,padding:t.attr("data-title-margin")})}))}function bwg_mosaic_title_on_hover(r,e,_){jQuery(".bwg-mosaic-thumb-span").on("mouseenter",function(){var e=jQuery(this).children(".bwg_mosaic_thumb_"+r).width(),t=jQuery(this).children(".bwg_mosaic_thumb_"+r).height();jQuery(this).find(".bwg_mosaic_title_spun1_"+r).width(e);var i=jQuery(this).find(".bwg_mosaic_title_spun1_"+r).width(),a=jQuery(this).find(".bwg_mosaic_title_spun1_"+r).height();jQuery(this).find(".bwg_mosaic_title_spun1_"+r).css({top:_+.5*t-.5*a<0?_:_+.5*t-.5*a,left:_+.5*e-.5*i,opacity:1,"max-height":"calc(100% - "+2*_+"px)",overflow:"hidden"})}),jQuery(".bwg-mosaic-thumb-span").on("mouseleave",function(){jQuery(this).find(".bwg_mosaic_title_spun1_"+r).css({top:0,left:-1e4,opacity:0,padding:e.attr("data-title-margin"),"max-height":"calc(100% - "+2*_+"px)",overflow:"hidden"})})}function bwg_mosaic_ajax(e,t){var i=0;jQuery(".bwg_mosaic_thumb_spun_"+e+" img").on("load",function(){++i>=t&&bwg_thumbnail_mosaic(jQuery(".bwg-mosaic-thumbnails[data-bwg="+e+"]"))}),jQuery(".bwg_mosaic_thumb_spun_"+e+" img").on("error",function(){jQuery(this).height(100),jQuery(this).width(100),++i>=t&&bwg_thumbnail_mosaic(jQuery(".bwg-mosaic-thumbnails[data-bwg="+e+"]"))})}function bwg_add_album(){var t=!1;"1"!=bwg_objectsL10n.front_ajax&&jQuery(".bwg-album").off("click").on("click",function(){if(!t){var e=jQuery(this).attr("data-bwg");return t=!0,setTimeout(function(){t=!1},100),bwg_ajax("gal_front_form_"+e,e,jQuery(this).attr("data-container_id"),jQuery(this).attr("data-alb_gal_id"),jQuery(this).attr("data-album_gallery_id"),jQuery(this).attr("data-def_type"),"",jQuery(this).attr("data-title")),!1}}),jQuery(".bwg_description_more").on("click",function(){jQuery(this).hasClass("bwg_more")?(jQuery(this).parent().find(".bwg_description_full").show(),jQuery(this).addClass("bwg_hide").removeClass("bwg_more"),jQuery(this).html(jQuery(this).data("hide-msg"))):(jQuery(this).parent().find(".bwg_description_full").hide(),jQuery(this).addClass("bwg_more").removeClass("bwg_hide"),jQuery(this).html(jQuery(this).data("more-msg")))})}function bwg_add_lightbox(){var i=!1;jQuery(".bwg_lightbox .bwg-item0, .bwg_lightbox .bwg_slide, .bwg_lightbox .bwg-carousel-image").on("click",function(e){e.stopPropagation(),e.preventDefault();var t=jQuery(this).parent();if(!i)return i=!0,setTimeout(function(){i=!1},100),bwg_gallery_box(jQuery(t).attr("data-image-id"),jQuery(t).closest(".bwg_container")),!1}),jQuery(".bwg_lightbox .bwg_ecommerce").on("click",function(e){if(e.stopPropagation(),!i)return i=!0,setTimeout(function(){i=!1},100),bwg_gallery_box(jQuery(this).closest(".bwg_lightbox").attr("data-image-id"),jQuery(this).closest(".bwg_container"),!0),!1})}function bwg_filter_by_tag(e){var t="",i=jQuery(e).parent().parent(),a=i.find(".current_view").val(),r=i.find(".form_id").val(),_=i.find(".cur_gal_id").val(),s=i.find(".album_gallery_id").val(),o=i.find(".type").val();jQuery(e).parent().find(".opt.selected").each(function(){t=t+jQuery(e).text()+","}),""==(t=t.slice(0,-1))&&(t=bwg_objectsL10n.bwg_select_tag),jQuery(e).parent().find(".CaptionCont").attr("title",t),jQuery(e).parent().find(".CaptionCont .placeholder").html(t),jQuery("#bwg_tag_id_"+a).val(jQuery("#bwg_tag_id_"+_).val()),bwg_select_tag(a,r,_,s,o,!1)}function bwg_document_ready(){bwg_add_lightbox(),jQuery('div[id^="bwg_container1_"]').each(function(){var e=jQuery(this);e.data("right-click-protection")&&bwg_disable_right_click(e),jQuery(".SumoSelect > .CaptionCont > label > i").addClass("bwg-icon-angle-down closed");var t=e.find(".search_tags");if("1"==bwg_objectsL10n.front_ajax&&t.length)for(var i=0;i<t[0].length;i++)void 0===t[0][i].attributes.selected&&(t[0][i].selected=!1);t.length&&(t.SumoSelect({triggerChangeCombined:!0,placeholder:bwg_objectsL10n.bwg_select_tag,search:!0,searchText:bwg_objectsL10n.bwg_search,forceCustomRendering:!0,noMatch:bwg_objectsL10n.bwg_tag_no_match,captionFormatAllSelected:bwg_objectsL10n.bwg_all_tags_selected,captionFormat:"{0} "+bwg_objectsL10n.bwg_tags_selected,okCancelInMulti:!0,locale:[bwg_objectsL10n.ok,bwg_objectsL10n.cancel,bwg_objectsL10n.select_all]}),t.off("change").on("change",function(){bwg_filter_by_tag(this)}));var a=e.find(".bwg_order");a.length&&a.SumoSelect({triggerChangeCombined:!0,forceCustomRendering:!0}),jQuery(this).find("search_placeholder_title").hide(),""==jQuery(this).find(".bwg_search_input").val()&&jQuery(this).find("search_placeholder_title").show(),jQuery(".bwg_thumbnail .bwg_search_container_2").focusout(function(e){""==jQuery(this).find(".bwg_search_input").val()&&(jQuery(this).find(".search_placeholder_title").show(),jQuery(this).find(".bwg_search_loupe_container1").addClass("hidden"),jQuery(this).find(".bwg_search_reset_container").addClass("hidden"))})}),jQuery(".search_tags").on("sumo:opened",function(){0==jQuery(this).parent().find("ul li").length&&(jQuery(".no-match").html(bwg_objectsL10n.bwg_tag_no_match),jQuery(".no-match").show())}),jQuery(".bwg_thumbnail .SumoSelect").on("sumo:closed",function(){jQuery(this).find("label i").removeClass("bwg-icon-angle-up opened"),jQuery(this).find("label i").addClass("bwg-icon-angle-down closed")}),jQuery(".bwg_thumbnail .SumoSelect").on("sumo:opened",function(){jQuery(this).find("label i").removeClass("bwg-icon-angle-down closed"),jQuery(this).find("label i").addClass("bwg-icon-angle-up opened")}),bwg_add_album();var e=window.location.hash.substring(1);if(e&&"-1"!=e.indexOf("bwg")){bwg_hash_array=e.replace("bwg","").split("/");var t=jQuery(".bwg_container");t&&bwg_gallery_box(bwg_hash_array[1],t,!1,bwg_hash_array[0])}bwg_blog_style_ready(),bwg_image_browser_ready(),bwg_resize_search_line()}function bwg_clear_search_input(e){if("1"!=bwg_objectsL10n.front_ajax)jQuery("#bwg_search_input_"+e).val(""),jQuery("#bwg_search_container_1_"+e+" .bwg_search_loupe_container1").addClass("hidden"),jQuery("#bwg_search_container_1_"+e+" .bwg_search_reset_container").addClass("hidden");else{var t=window.location.href,i=bwg_remove_url_parameter("bwg_search_"+e,t,t);window.location.replace(i)}}function bwg_check_search_input_enter(e,t){return 13!=(t.which||t.keyCode)||(jQuery(e).closest(".bwg_search_container_1").find(".bwg_search").trigger("click"),!1)}function bwg_ajax(t,i,a,r,e,_,s,o,l,n,g){if("1"!=bwg_objectsL10n.front_ajax||!0===n){jQuery("#ajax_loading_"+i).removeClass("bwg-hidden"),jQuery(".bwg_load_more_ajax_loading").css({top:jQuery("#"+a).height()}),"function"==typeof bwg_scroll_load_action&&jQuery(window).off("scroll",bwg_scroll_load_action),jQuery(".bwg_thumbnail .search_tags").off("sumo:closed");var w=jQuery("#"+t).data("ajax-url"),b=0;if(void 0===n)n=!1;var u=jQuery("#page_number_"+i).val(),d=jQuery("#bwg_search_input_"+i).val(),h={},m=jQuery("#bwg_album_breadcrumb_"+i).val();if(m&&!0!==n){var p=JSON.parse(m);if("back"==r){p.splice(-1,1);var c=p.slice(-1)[0];r=c.id,u=c.page,h["action_"+i]="back"}else"numeric"===n||s?(p.splice(-1,1),p.push({id:r,page:u,search:d})):(p.push({id:r,page:1}),u=1);h["bwg_album_breadcrumb_"+i]=JSON.stringify(p)}if(h.gallery_type=jQuery("#"+t).data("gallery-type"),h.gallery_id=jQuery("#"+t).data("gallery-id"),h.tag=jQuery("#"+t).data("tag"),h.album_id=jQuery("#"+t).data("album-id"),h.theme_id=jQuery("#"+t).data("theme-id"),h.shortcode_id=jQuery("#"+t).data("shortcode-id"),h.bwg=i,s&&(u=1),void 0===o||""==o)o="";if(void 0===g||""==g)g="";if(void 0===l||""==l)l=jQuery(".bwg_order_"+i).val();if(h["page_number_"+i]=u,h["bwg_load_more_"+i]=jQuery("#bwg_load_more_"+i).val(),h["album_gallery_id_"+i]=r,h["type_"+i]=_,h["title_"+i]=o,h["description_"+i]=g,h["sortImagesByValue_"+i]=l,0<jQuery("#bwg_search_input_"+i).length&&(h["bwg_search_"+i]=jQuery("#bwg_search_input_"+i).val()),void 0!==h["bwg_album_breadcrumb_"+i]){var y=jQuery.parseJSON(h["bwg_album_breadcrumb_"+i]);jQuery.each(y,function(e,t){h["bwg_search_"+i]="",r==t.id&&(h["bwg_search_"+i]=t.search)})}return h["bwg_tag_id_"+a]=jQuery("#bwg_tag_id_"+a).val(),jQuery("#ajax_loading_"+i).removeClass("bwg-hidden"),jQuery(".bwg_load_more_ajax_loading").css({top:jQuery("#"+a).height()}),jQuery.ajax({type:"POST",url:w,data:h,success:function(e){jQuery(e).find(".bwg_masonry_thumb_spun_"+i+" img").length,b=jQuery(e).find(".bwg_mosaic_thumb_spun_"+i+" img").length,!0===n?(a=="bwg_thumbnails_mosaic_"+i?jQuery("#"+a).append(jQuery(e).closest(".bwg-container-"+i).find("#"+a).html()):a=="bwg_album_compact_"+i?jQuery("#"+a).append(jQuery(e).closest(".bwg-album-thumbnails").html()):jQuery("#"+a).append(jQuery(e).closest(".bwg-container-"+i).html()),jQuery(".bwg_nav_cont_"+i).html(jQuery(e).closest(".bwg_nav_cont_"+i).html())):jQuery("#bwg_container3_"+i).html(e)},complete:function(){jQuery("div[id^='bwg_container1_'] img").each(function(){null!=jQuery(this).attr("data-lazy-src")&&""!=jQuery(this).attr("data-lazy-src")?jQuery(this).attr("src",jQuery(this).attr("data-lazy-src")):null!=jQuery(this).attr("data-src")&&""!=jQuery(this).attr("data-src")&&jQuery(this).attr("src",jQuery(this).attr("data-src"))}),jQuery(".blog_style_image_buttons_conteiner_"+i).find(jQuery(".bwg_blog_style_img_"+i)).on("load",function(){jQuery(".bwg_blog_style_img_"+i).closest(jQuery(".blog_style_image_buttons_conteiner_"+i)).show()}),jQuery("#bwg_tags_id_"+a).val(jQuery("#bwg_tag_id_"+a).val()),jQuery(".pagination-links_"+i).length&&jQuery("html, body").animate({scrollTop:jQuery("#"+t).offset().top-150},500),bwg_document_ready(),bwg_mosaic_ajax(i,b),bwg_all_thumnails_loaded(".bwg-container-"+i)&&bwg_container_loaded(i),jQuery(".blog_style_images_conteiner_"+i+" .bwg_embed_frame_16x9_"+i).each(function(e){jQuery(this).width(jQuery(this).parent().width()),jQuery(this).height(.5625*jQuery(this).width())}),jQuery(".blog_style_images_conteiner_"+i+" .bwg_embed_frame_instapost_"+i).each(function(e){jQuery(this).width(jQuery(this).parent().width()),jQuery(this).height((jQuery(this).width()-16)*jQuery(this).attr("data-height")/jQuery(this).attr("data-width")+96)}),jQuery("#bwg_embed_frame_16x9_"+i).width(jQuery("#bwg_embed_frame_16x9_"+i).parent().width()),jQuery("#bwg_embed_frame_16x9_"+i).height(.5625*jQuery("#bwg_embed_frame_16x9_"+i).width()),jQuery("#bwg_embed_frame_instapost_"+i).width(jQuery("#bwg_embed_frame_16x9_"+i).parent().width()),jQuery(".bwg_embed_frame_instapost_"+i).height((jQuery(".bwg_embed_frame_instapost_"+i).width()-16)*jQuery(".bwg_embed_frame_instapost_"+i).attr("data-height")/jQuery(".bwg_embed_frame_instapost_"+i).attr("data-width")+96),jQuery("#bwg_search_input_"+i).val(h["bwg_search_"+i]),""!=jQuery("#bwg_search_input_"+i).val()?(jQuery("#bwg_search_input_"+i).parent().find(".search_placeholder_title").hide(),jQuery("#bwg_search_input_"+i).parent().parent().find(".bwg_search_reset_container").show(),jQuery("#bwg_search_input_"+i).parent().parent().find(".bwg_search_loupe_container1").show()):jQuery("#bwg_search_input_"+i).parent().find(".search_placeholder_title").show();var e=jQuery("#bwg_container2_"+i+" .cur_gal_id").val();jQuery("#bwg_tag_id_"+i).val(jQuery("#bwg_tag_id_"+e).val())}}),!1}if("back"!==r){var f=jQuery("#bwg_search_input_"+i).val(),j=window.location.href,Q="",v=jQuery("#bwg_tag_id_"+a).val();if(""!==window.location.hash&&(j=j.replace("#","")),""!==f?!1!==(Q=bwg_add_url_parameter(Q=bwg_remove_url_parameter("page_number_"+i,j),"bwg_search_"+i,f))&&(j=Q):!1!==(Q=bwg_remove_url_parameter("bwg_search_"+i,j))&&(j=Q),void 0!==l&&""!==l&&!1!==(Q=bwg_add_url_parameter(j,"sort_by_"+i,l))&&(j=Q),null!=v&&0<v.length){var x="";jQuery.each(v,function(e){var t=",";e===v.length-1&&(t=""),x+=v[e]+t}),""!==x&&!1!==(Q=bwg_add_url_parameter(j,"filter_tag_"+i,x))&&(j=Q)}else!1!==(Q=bwg_remove_url_parameter("filter_tag_"+i,Q))&&(j=Q);window.location.href=j}else window.history.back()}function bwg_add_url_parameter(e,t,i){var a=new RegExp("([?&])"+t+"=.*?(&|$)","i"),r=-1!==e.indexOf("?")?"&":"?";return e.match(a)?e.replace(a,"$1"+t+"="+i+"$2"):e+r+t+"="+i}function bwg_remove_url_parameter(e,t){var i=t.split("?"),a=i[0]+"?",r="";if(void 0!==i[1]&&(r=i[1]),""===r)return t;var _,s,o=decodeURIComponent(r).split("&");for(s=0;s<o.length;s++)(_=o[s].split("="))[0]!=e&&(a=a+_[0]+"="+_[1]+"&");return a.substring(0,a.length-1)}function bwg_select_tag(e,t,i,a,r,_){_&&jQuery("#bwg_tag_id_"+i).val(""),bwg_ajax(t,e,i,a,"",r,1,"")}function bwg_cube(e,t,i,a,r,_,s,o,l,n,g){var w,b=!1,u="";if(void 0!==g&&""!==g){b=!0,bwg_params[g].bwg_trans_in_progress=!0,u="_"+g,w=bwg_params[g].bwg_transition_duration;bwg_params[g].event_stack}else w=bwg_transition_duration;if(!bwg_testBrowser_cssTransitions(g))return bwg_fallback(o,l,n,g);if(!bwg_testBrowser_cssTransforms3d(g))return bwg_fallback3d(o,l,n,g);function d(){if(jQuery(o).removeAttr("style"),jQuery(l).removeAttr("style"),jQuery(".bwg_slider"+u).removeAttr("style"),jQuery(o).css({opacity:0,"z-index":1}),jQuery(l).css({opacity:1,"z-index":2}),jQuery(".bwg_image_info").show(),jQuery(o).html(""),b){bwg_change_watermark_container(g),bwg_params[g].bwg_trans_in_progress=!1;var e=bwg_params[g].data,t=bwg_params[g].event_stack}else{gallery_box_data.bwg_trans_in_progress=!1;t=gallery_box_data.event_stack}void 0!==t&&0<t.length&&(key=t[0].split("-"),t.shift(),bwg_change_image(key[0],key[1],e,!0,g)),bwg_change_watermark_container()}b?(jQuery(".bwg_slideshow_filmstrip_thumbnail_"+g).removeClass("bwg_slideshow_thumb_active_"+g).addClass("bwg_slideshow_thumb_deactive_"+g),jQuery("#bwg_filmstrip_thumbnail_"+bwg_params[g].bwg_current_key+"_"+g).removeClass("bwg_slideshow_thumb_deactive_"+g).addClass("bwg_slideshow_thumb_active_"+g),jQuery(".bwg_slideshow_dots_"+g).removeClass("bwg_slideshow_dots_active_"+g).addClass("bwg_slideshow_dots_deactive_"+g),jQuery("#bwg_dots_"+bwg_params[g].bwg_current_key+"_"+g).removeClass("bwg_slideshow_dots_deactive_"+g).addClass("bwg_slideshow_dots_active_"+g),jQuery(".bwg_slide_bg_"+g).css("perspective",1e3)):(gallery_box_data.bwg_trans_in_progress=!0,jQuery(".bwg_filmstrip_thumbnail").removeClass("bwg_thumb_active").addClass("bwg_thumb_deactive"),jQuery("#bwg_filmstrip_thumbnail_"+gallery_box_data.bwg_current_key).removeClass("bwg_thumb_deactive").addClass("bwg_thumb_active"),jQuery(".bwg_slide_bg").css("perspective",1e3)),jQuery(o).css({transform:"translateZ("+e+"px)",backfaceVisibility:"hidden"}),jQuery(l).css({opacity:1,backfaceVisibility:"hidden",transform:"translateY("+i+"px) translateX("+t+"px) rotateY("+r+"deg) rotateX("+a+"deg)"}),jQuery(".bwg_slider"+u).css({transform:"translateZ(-"+e+"px)",transformStyle:"preserve-3d"}),setTimeout(function(){jQuery(".bwg_slider"+u).css({transition:"all "+w+"ms ease-in-out",transform:"translateZ(-"+e+"px) rotateX("+_+"deg) rotateY("+s+"deg)"})},20),jQuery(".bwg_slider"+u).one("webkitTransitionEnd transitionend otransitionend oTransitionEnd mstransitionend",jQuery.proxy(d)),0==w&&d()}function bwg_fade(e,t,i,a){var r,_=!1;function s(){jQuery(".bwg_image_info").show(),bwg_change_watermark_container(a),_?bwg_params[a].bwg_trans_in_progress=!1:gallery_box_data.bwg_trans_in_progress=!1}r=void 0!==a&&""!==a?(_=!0,bwg_params[a].bwg_trans_in_progress=!0,bwg_params[a].bwg_transition_duration):(gallery_box_data.bwg_trans_in_progress=!0,gallery_box_data.bwg_transition_duration),_?(jQuery(".bwg_slideshow_filmstrip_thumbnail_"+a).removeClass("bwg_slideshow_thumb_active_"+a).addClass("bwg_slideshow_thumb_deactive_"+a),jQuery("#bwg_filmstrip_thumbnail_"+bwg_params[a].bwg_current_key+"_"+a).removeClass("bwg_slideshow_thumb_deactive_"+a).addClass("bwg_slideshow_thumb_active_"+a),jQuery(".bwg_slideshow_dots_"+a).removeClass("bwg_slideshow_dots_active_"+a).addClass("bwg_slideshow_dots_deactive_"+a),jQuery("#bwg_dots_"+bwg_params[a].bwg_current_key+"_"+a).removeClass("bwg_slideshow_dots_deactive_"+a).addClass("bwg_slideshow_dots_active_"+a)):(jQuery(".bwg_filmstrip_thumbnail").removeClass("bwg_thumb_active").addClass("bwg_thumb_deactive"),jQuery("#bwg_filmstrip_thumbnail_"+gallery_box_data.bwg_current_key).removeClass("bwg_thumb_deactive").addClass("bwg_thumb_active")),bwg_testBrowser_cssTransitions()?(jQuery(t).css("transition","opacity "+r+"ms linear"),jQuery(e).css({opacity:0,"z-index":1}),jQuery(t).css({opacity:1,"z-index":2}),jQuery(t).one("webkitTransitionEnd transitionend otransitionend oTransitionEnd mstransitionend",jQuery.proxy(s))):(jQuery(e).animate({opacity:0,"z-index":1},r),jQuery(t).animate({opacity:1,"z-index":2},{duration:r,complete:function(){_?bwg_params[a].bwg_trans_in_progress=!1:gallery_box_data.bwg_trans_in_progress=!1,jQuery(e).html(""),s()}}),jQuery(e).fadeTo(r,0),jQuery(t).fadeTo(r,1)),0==r&&s()}function bwg_change_watermark_container(t){jQuery(".bwg_slider"+(void 0!==t&&""!==t?"_"+t:"")).children().each(function(){if(2==jQuery(this).css("zIndex")){var e=jQuery(this).find("img");if(e.length)if(e.prop("complete"))bwg_change_each_watermark_container(e.width(),e.height(),t);else e.on("load",function(){bwg_change_each_watermark_container(e.width(),e.height(),t)});else(e=jQuery(this).find("iframe")).length||(e=jQuery(this).find("video")),bwg_change_each_watermark_container(e.width(),e.height(),t)}})}function bwg_change_each_watermark_container(e,t,i){var a=void 0!==i&&""!==i?"_"+i:"",r=void 0!==i&&""!==i?"_slideshow":"";if(jQuery(".bwg"+r+"_watermark_spun"+a).width(e),jQuery(".bwg"+r+"_watermark_spun"+a).height(t),jQuery(".bwg"+r+"_watermark"+a).css({display:""}),void 0===i||""===i){var _=0;(jQuery(".bwg_comment_container").hasClass("bwg_open")||jQuery(".bwg_ecommerce_container").hasClass("bwg_open"))&&(_=gallery_box_data.lightbox_comment_width),e<=jQuery(window).width()-_&&(jQuery(".bwg_watermark_image").css({width:(jQuery(".spider_popup_wrap").width()-_)*gallery_box_data.watermark_font_size/gallery_box_data.image_width}),jQuery(".bwg_watermark_text, .bwg_watermark_text:hover").css({fontSize:(jQuery(".spider_popup_wrap").width()-_)*gallery_box_data.watermark_font_size/gallery_box_data.image_width}))}else jQuery(".bwg"+r+"_title_spun"+a).width(e),jQuery(".bwg"+r+"_title_spun"+a).height(t),jQuery(".bwg"+r+"_description_spun"+a).width(e),jQuery(".bwg"+r+"_description_spun"+a).height(t);jQuery.trim(jQuery(".bwg"+r+"_title_text"+a).text())&&jQuery(".bwg_slideshow_title_text"+a).css({display:""}),jQuery.trim(jQuery(".bwg"+r+"_description_text"+a).text())&&jQuery(".bwg"+r+"_description_text"+a).css({display:""})}function bwg_set_filmstrip_pos(e,t,i){var a,r=void 0!==t&&""!==t?"_"+t:"",_=void 0!==t&&""!==t?"_slideshow":"";a=void 0!==t&&""!==t?bwg_params[t].left_or_top:gallery_box_data.left_or_top;var s=parseInt(jQuery(".bwg_filmstrip_thumbnails").attr("data-all-images-top-bottom-space")),o=parseInt(jQuery(".bwg_filmstrip_thumbnails").attr("data-all-images-right-left-space"));if(void 0===t||""===t){if("outerWidth"==gallery_box_data.outerWidth_or_outerHeight)var l=-bwg_current_filmstrip_pos-jQuery(".bwg_filmstrip_thumbnail").outerWidth(!0)/2;else if("outerHeight"==gallery_box_data.outerWidth_or_outerHeight)l=-bwg_current_filmstrip_pos-jQuery(".bwg_filmstrip_thumbnail").outerHeight(!0)/2;if("width"==gallery_box_data.width_or_height)var n=Math.min(0,Math.max(e-jQuery(".bwg_filmstrip_thumbnails").width(),l+e/2));else if("height"==gallery_box_data.width_or_height)n=Math.min(0,Math.max(e-jQuery(".bwg_filmstrip_thumbnails").height(),l+e/2))}else if("width"==bwg_params[t].width_or_height)l=-bwg_params[t].bwg_current_filmstrip_pos-(jQuery(".bwg_slideshow_filmstrip_thumbnail"+r).width()+bwg_params[t].filmstrip_thumb_margin_hor)/2,n=Math.min(0,Math.max(e-jQuery(".bwg_slideshow_filmstrip_thumbnails"+r).width(),l+e/2));else l=-bwg_params[t].bwg_current_filmstrip_pos-(jQuery(".bwg_slideshow_filmstrip_thumbnail"+r).height()+bwg_params[t].filmstrip_thumb_margin_hor)/2,n=Math.min(0,Math.max(e-jQuery(".bwg_slideshow_filmstrip_thumbnails"+r).height(),l+e/2));0<n+o&&(o=0),0<n+s&&(s=0),"left"==a?jQuery(".bwg"+_+"_filmstrip_thumbnails"+r).animate({left:n+o},{duration:500,complete:function(){bwg_filmstrip_arrows(t)}}):jQuery(".bwg"+_+"_filmstrip_thumbnails"+r).animate({top:n+s},{duration:500,complete:function(){bwg_filmstrip_arrows(t)}})}function bwg_filmstrip_arrows(e){var t=void 0!==e&&""!==e?"_"+e:"",i=void 0!==e&&""!==e?"_slideshow":"";if("width"==(void 0!==e&&""!==e?bwg_params[e].width_or_heigh:gallery_box_data.width_or_height))var a=jQuery(".bwg"+i+"_filmstrip_thumbnails"+t).width(),r=jQuery(".bwg"+i+"_filmstrip"+t).width();else a=jQuery(".bwg"+i+"_filmstrip_thumbnails"+t).height(),r=jQuery(".bwg"+i+"_filmstrip"+t).height();a<r?(jQuery(".bwg"+i+"_filmstrip_left"+t).hide(),jQuery(".bwg"+i+"_filmstrip_right"+t).hide()):(jQuery(".bwg"+i+"_filmstrip_left"+t).show(),jQuery(".bwg"+i+"_filmstrip_right"+t).show())}function bwg_move_filmstrip(e){var t,i,a,r,_,s,o=void 0!==e&&""!==e?"_"+e:"",l=void 0!==e&&""!==e?"_slideshow":"",n=void 0!==e&&""!==e?bwg_params[e].outerWidth_or_outerHeight:gallery_box_data.outerWidth_or_outerHeight,g=void 0!==e&&""!==e?bwg_params[e].left_or_top:gallery_box_data.left_or_top;i="outerWidth"==n?(t=jQuery(".bwg"+l+"_filmstrip"+o).outerWidth(!0),jQuery(".bwg"+l+"_filmstrip_thumbnails"+o).outerWidth(!0)):(t=jQuery(".bwg"+l+"_filmstrip"+o).outerHeight(!0),jQuery(".bwg"+l+"_filmstrip_thumbnails"+o).outerHeight(!0)),s="left"==g?(a=jQuery(".bwg"+l+"_thumb_active"+o).position().left,r="outerWidth"==n?jQuery(".bwg"+l+"_thumb_active"+o).position().left+jQuery(".bwg"+l+"_thumb_active"+o).outerWidth(!0):jQuery(".bwg"+l+"_thumb_active"+o).position().left+jQuery(".bwg"+l+"_thumb_active"+o).outerHeight(!0),_=jQuery(".bwg"+l+"_filmstrip_thumbnails"+o).position().left,Math.abs(jQuery(".bwg"+l+"_filmstrip_thumbnails"+o).position().left)+t):(a=jQuery(".bwg"+l+"_thumb_active"+o).position().top,r="outerWidth"==n?jQuery(".bwg"+l+"_thumb_active"+o).position().top+jQuery(".bwg"+l+"_thumb_active"+o).outerWidth(!0):jQuery(".bwg"+l+"_thumb_active"+o).position().top+jQuery(".bwg"+l+"_thumb_active"+o).outerHeight(!0),_=jQuery(".bwg"+l+"_filmstrip_thumbnails"+o).position().top,Math.abs(jQuery(".bwg"+l+"_filmstrip_thumbnails"+o).position().top)+t),i<t||(a<Math.abs(_)?"left"==g?jQuery(".bwg"+l+"_filmstrip_thumbnails"+o).animate({left:-a},{duration:500,complete:function(){bwg_filmstrip_arrows(e)}}):jQuery(".bwg"+l+"_filmstrip_thumbnails"+o).animate({top:-a},{duration:500,complete:function(){bwg_filmstrip_arrows(e)}}):s<r&&("left"==g?jQuery(".bwg"+l+"_filmstrip_thumbnails"+o).animate({left:-(r-t)},{duration:500,complete:function(){bwg_filmstrip_arrows(e)}}):jQuery(".bwg"+l+"_filmstrip_thumbnails"+o).animate({top:-(r-t)},{duration:500,complete:function(){bwg_filmstrip_arrows(e)}})))}function bwg_move_dots(e){var t=jQuery(".bwg_slideshow_dots_active_"+e).position().left,i=jQuery(".bwg_slideshow_dots_active_"+e).position().left+jQuery(".bwg_slideshow_dots_active_"+e).outerWidth(!0),a=jQuery(".bwg_slideshow_dots_container_"+e).outerWidth(!0),r=jQuery(".bwg_slideshow_dots_thumbnails_"+e).outerWidth(!1),_=jQuery(".bwg_slideshow_dots_thumbnails_"+e).position().left,s=Math.abs(jQuery(".bwg_slideshow_dots_thumbnails_"+e).position().left)+a;r<a||(t<Math.abs(_)?jQuery(".bwg_slideshow_dots_thumbnails_"+e).animate({left:-t},{duration:500,complete:function(){}}):s<i&&jQuery(".bwg_slideshow_dots_thumbnails_"+e).animate({left:-(i-a)},{duration:500,complete:function(){}}))}function bwg_testBrowser_cssTransitions(e){return bwg_testDom("Transition",e)}function bwg_testBrowser_cssTransforms3d(e){return bwg_testDom("Perspective",e)}function bwg_testDom(e,t){for(var i=["","Webkit","Moz","ms","O","Khtml"],a=i.length;a--;)if(void 0!==document.body.style[i[a]+e])return!0;return!1}function bwg_fallback(e,t,i,a){bwg_fade(e,t,i,a)}function bwg_fallback3d(e,t,i,a){bwg_sliceV(e,t,i,a)}function bwg_none(e,t,i,a){var r=void 0!==a&&""!==a?"_"+a:"";if(jQuery(e).css({opacity:0,"z-index":1}),jQuery(t).css({opacity:1,"z-index":2}),void 0!==a&&""!==a){var _=bwg_params[a].bwg_current_key;bwg_change_watermark_container(a),jQuery(".bwg_slideshow_filmstrip_thumbnail"+r).removeClass("bwg_slideshow_thumb_active"+r).addClass("bwg_slideshow_thumb_deactive"+r),jQuery("#bwg_filmstrip_thumbnail_"+_+r).removeClass("bwg_slideshow_thumb_deactive"+r).addClass("bwg_slideshow_thumb_active"+r),jQuery(".bwg_slideshow_dots"+r).removeClass("bwg_slideshow_dots_active"+r).addClass("bwg_slideshow_dots_deactive"+r),jQuery("#bwg_dots_"+_+r).removeClass("bwg_slideshow_dots_deactive"+r).addClass("bwg_slideshow_dots_active"+r)}else jQuery(".bwg_image_info").show(),gallery_box_data.bwg_trans_in_progress=!1,jQuery(e).html(""),bwg_change_watermark_container()}function bwg_iterator(e){var t=1;return void 0!==e&&""!==e&&void 0!==bwg_params[e]&&1==bwg_params[e].enable_slideshow_shuffle&&(t=Math.floor((bwg_params[e].data.length-1)*Math.random()+1)),t}function bwg_change_image_slideshow(e,t,i,a,r){i=bwg_params[r].data;if(jQuery("#bwg_slideshow_image_container_"+r).find("iframe").each(function(){jQuery(this)[0].contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}',"*"),jQuery(this)[0].contentWindow.postMessage('{ "method": "pause" }',"*"),jQuery(this)[0].contentWindow.postMessage("pause","*")}),jQuery("#image_id_"+r+"_"+i[e].id).find(".bwg_fb_video").each(function(){jQuery(this).attr("src",jQuery(this).attr("src"))}),i[t]){if(jQuery(".bwg_ctrl_btn_"+r).hasClass("bwg-icon-pause")&&bwg_play(bwg_params[r].data,r),a||(jQuery("#bwg_current_image_key_"+r).val(t),"-1"==e?e=jQuery(".bwg_slideshow_thumb_active_"+r).children("img").attr("image_key"):"-2"==e&&(e=jQuery(".bwg_slideshow_dots_active_"+r).attr("image_key"))),bwg_params[r].bwg_trans_in_progress)return void bwg_params[r].event_stack.push(e+"-"+t);var _="right";if(t<e)_="left";else if(e==t)return;jQuery(".bwg_slideshow_watermark_"+r).css({display:"none"}),jQuery(".bwg_slideshow_title_text_"+r).css({display:"none"}),jQuery(".bwg_slideshow_description_text_"+r).css({display:"none"}),"width"==bwg_params[r].width_or_height?bwg_params[r].bwg_current_filmstrip_pos=t*(jQuery(".bwg_slideshow_filmstrip_thumbnail_"+r).width()+2+2*bwg_params[r].lightbox_filmstrip_thumb_border_width):bwg_params[r].bwg_current_filmstrip_pos=t*(jQuery(".bwg_slideshow_filmstrip_thumbnail_"+r).height()+2+2*bwg_params[r].lightbox_filmstrip_thumb_border_width),e=t,bwg_params[r].bwg_current_key=e,jQuery("#bwg_slideshow_image_"+r).attr("image_id",i[t].id),jQuery(".bwg_slideshow_title_text_"+r).html(jQuery('<span style="display: block;" />').html(i[t].alt).text()),jQuery(".bwg_slideshow_description_text_"+r).html(jQuery('<span style="display: block;" />').html(i[t].description).text());var s=2==jQuery(".bwg_slideshow_image_spun_"+r).css("zIndex")?".bwg_slideshow_image_spun_"+r:".bwg_slideshow_image_second_spun_"+r,o=s==".bwg_slideshow_image_second_spun_"+r?".bwg_slideshow_image_spun_"+r:".bwg_slideshow_image_second_spun_"+r,l=-1<i[t].filetype.indexOf("EMBED_"),n=-1<i[t].filetype.indexOf("INSTAGRAM_POST"),g=-1<i[t].filetype.indexOf("INSTAGRAM_VIDEO"),w=jQuery(s).height(),b=jQuery(s).width(),u='<span class="bwg_slideshow_image_spun1_'+r+'" style="display: '+(l?"block":"table")+' ;width: inherit; height: inherit;"><span class="bwg_slideshow_image_spun2_'+r+'" style="display: '+(l?"block":"table-cell")+'; vertical-align: middle; text-align: center; ">';if(l){if(u+='<span style="height: '+w+"px; width: "+b+'px;" class="bwg_popup_embed bwg_popup_watermark">',g&&(u+='<span class="bwg_inst_play_btn_cont" onclick="bwg_play_instagram_video(this)"><span class="bwg_inst_play"></span></span>'),n){var d=0,h=0;w<b+88?d=(h=w)-88:h=(d=b)+88,u+=spider_display_embed(i[t].filetype,i[t].image_url,i[t].filename,{class:"bwg_embed_frame","data-width":i[t].image_width,"data-height":i[t].image_height,frameborder:"0",allowfullscreen:"allowfullscreen",style:"width:"+d+"px; height:"+h+"px; vertical-align:middle; display:inline-block; position:relative;"})}else u+=spider_display_embed(i[t].filetype,i[t].image_url,i[t].filename,{class:"bwg_embed_frame",frameborder:"0",allowfullscreen:"allowfullscreen",style:"width:inherit; height:inherit; vertical-align:middle; display:table-cell;"});u+="</span>"}else{if("do_nothing"!=bwg_params[r].thumb_click_action){var m="";"open_lightbox"==bwg_params[r].thumb_click_action?m+=' class="bwg_lightbox" data-image-id="'+i[t].id+'"':"redirect_to_url"==bwg_params[r].thumb_click_action&&i[t].redirect_url&&(m+='href="'+i[t].redirect_url+'"'+(bwg_params[r].thumb_link_target&&1==bwg_params[r].thumb_link_target?' target="_blank"':"")),u+="<a "+m+">"}u+='<img style="max-height: '+w+"px !important; max-width: "+b+'px !important; display:inline-block;" ',u+=' class="bwg_slide bwg_slideshow_image_'+r+'" ',u+=' id="bwg_slideshow_image_'+r+'" ',u+=' src="'+bwg_params[r].upload_url+jQuery("<span style='display: block;' />").html(i[t].image_url).text()+'" alt="'+i[t].alt+'" image_id="'+i[t].id+'" /></a>'}u+="</span></span>",jQuery(o).html(u),bwg_params[r].preload_images&&bwg_preload_images(t,r),window["bwg_"+bwg_params[r].slideshow_effect](s,o,_,r),0<bwg_params[r].enable_slideshow_filmstrip?bwg_move_filmstrip(r):bwg_move_dots(r),i[t].is_embed_video?jQuery("#bwg_slideshow_play_pause_"+r).css({display:"none"}):jQuery("#bwg_slideshow_play_pause_"+r).css({display:""})}bwg_add_lightbox()}function bwg_preload_images_slideshow(e,t){var i=bwg_params[t].data;count=bwg_params[t].preload_images_count/2;var a=i.length;if(a<bwg_params[t].preload_images_count&&(count=0),0!=count)for(var r=e-count;r<e+count;r++){var _=parseInt((r+a)%a),s=-1<i[_].filetype.indexOf("EMBED_");void 0!==i[_]&&(s||jQuery("<img/>").attr("src",bwg_params[t].upload_url+jQuery('<span style="display: block;" />').html(i[_].image_url).text()))}else for(r=0;r<i.length;r++){s=-1<i[r].filetype.indexOf("EMBED_");void 0!==i[r]&&(s||jQuery("<img/>").attr("src",bwg_params[t].upload_url+jQuery('<span style="display: block;" />').html(i[r].image_url).text()))}}function bwg_preload_images(e,t){void 0!==t&&""!==t?bwg_preload_images_slideshow(e,t):bwg_preload_images_lightbox(e)}function bwg_popup_resize_slidshow(e){var t=jQuery(".bwg_slideshow_image_wrap_"+e).parent().width(),i=bwg_params[e].data;if(t>=bwg_params[e].image_width){jQuery(".bwg_slideshow_image_wrap_"+e).css({width:bwg_params[e].image_width}),jQuery(".bwg_slideshow_image_wrap_"+e).css({height:bwg_params[e].image_height}),jQuery(".bwg_slideshow_image_container_"+e).css({width:"horizontal"==bwg_params[e].filmstrip_direction?bwg_params[e].image_width:bwg_params[e].image_width-bwg_params[e].slideshow_filmstrip_width}),jQuery(".bwg_slideshow_image_container_"+e).css({height:"horizontal"==bwg_params[e].filmstrip_direction?bwg_params[e].image_height-bwg_params[e].slideshow_filmstrip_height:bwg_params[e].image_height}),jQuery(".bwg_slideshow_image_"+e).css({cssText:(bwg_params[e].filmstrip_direction,bwg_params[e].image_width)}),jQuery(".bwg_slideshow_embed_"+e).css({cssText:(bwg_params[e].filmstrip_direction,bwg_params[e].image_width)}),bwg_resize_instagram_post(e),bwg_change_watermark_container(e);var a="horizontal"==bwg_params[e].filmstrip_direction?"width: "+bwg_params[e].image_width:"height: "+bwg_params[e].image_height,r="horizontal"==bwg_params[e].filmstrip_direction?"width: "+(bwg_params[e].image_width-40):"height: "+(bwg_params[e].image_height-40);jQuery(".bwg_slideshow_filmstrip_container_"+e).css({cssText:a}),jQuery(".bwg_slideshow_filmstrip_"+e).css({cssText:r}),jQuery(".bwg_slideshow_dots_container_"+e).css({width:bwg_params[e].image_width}),jQuery("#bwg_slideshow_play_pause-ico_"+e).css({fontSize:bwg_params[e].slideshow_play_pause_btn_size}),"image"==bwg_params[e].watermark_type&&jQuery(".bwg_slideshow_watermark_image_"+e).css({maxWidth:bwg_params[e].watermark_width,maxHeight:bwg_params[e].watermark_height}),"text"==bwg_params[e].watermark_type&&jQuery(".bwg_slideshow_watermark_text_"+e+", .bwg_slideshow_watermark_text_"+e+" : hover").css({fontSize:bwg_params[e].watermark_font_size}),jQuery(".bwg_slideshow_title_text_"+e).css({fontSize:2*bwg_params[e].slideshow_title_font_size}),jQuery(".bwg_slideshow_description_text_"+e).css({fontSize:2*bwg_params[e].slideshow_description_font_size})}else jQuery(".bwg_slideshow_image_wrap_"+e).css({width:t}),jQuery(".bwg_slideshow_image_wrap_"+e).css({height:t*bwg_params[e].image_height/bwg_params[e].image_width}),jQuery(".bwg_slideshow_image_container_"+e).css({width:t-("horizontal"==bwg_params[e].filmstrip_direction?0:bwg_params[e].slideshow_filmstrip_width)}),jQuery(".bwg_slideshow_image_container_"+e).css({height:t*bwg_params[e].image_height/bwg_params[e].image_width-("horizontal"==bwg_params[e].filmstrip_direction?bwg_params[e].slideshow_filmstrip_height:0)}),jQuery(".bwg_slideshow_image_"+e).css({cssText:"max-width: "+(t-("horizontal"==bwg_params[e].filmstrip_direction?0:bwg_params[e].slideshow_filmstrip_width))+"px !important; max-height: "+(t*(bwg_params[e].image_height/bwg_params[e].image_width)-("horizontal"==bwg_params[e].filmstrip_direction?bwg_params[e].slideshow_filmstrip_height:0)-1)+"px !important;"}),jQuery(".bwg_slideshow_embed_"+e).css({cssText:"width: "+(t-("horizontal"==bwg_params[e].filmstrip_direction?0:bwg_params[e].slideshow_filmstrip_width))+"px !important; height: "+(t*(bwg_params[e].image_height/bwg_params[e].image_width)-("horizontal"==bwg_params[e].filmstrip_direction?bwg_params[e].slideshow_filmstrip_height:0)-1)+"px !important;"}),bwg_resize_instagram_post(e),bwg_change_watermark_container(e),"horizontal"==bwg_params[e].filmstrip_direction?(jQuery(".bwg_slideshow_filmstrip_container_"+e).css({width:t}),jQuery(".bwg_slideshow_filmstrip_"+e).css({width:t-40})):(jQuery(".bwg_slideshow_filmstrip_container_"+e).css({height:t*bwg_params[e].image_height/bwg_params[e].image_width}),jQuery(".bwg_slideshow_filmstrip_"+e).css({height:t*bwg_params[e].image_height/bwg_params[e].image_width-40})),jQuery(".bwg_slideshow_dots_container_"+e).css({width:t}),jQuery("#bwg_slideshow_play_pause-ico_"+e).css({fontSize:t*bwg_params[e].slideshow_play_pause_btn_size/bwg_params[e].image_width}),jQuery(".bwg_slideshow_watermark_image_"+e).css({maxWidth:t*bwg_params[e].watermark_width/bwg_params[e].image_width,maxHeight:t*bwg_params[e].watermark_height/bwg_params[e].image_width}),jQuery(".bwg_slideshow_watermark_text_"+e+", .bwg_slideshow_watermark_text_"+e+":hover").css({fontSize:t*bwg_params[e].watermark_font_size/bwg_params[e].image_width}),jQuery(".bwg_slideshow_title_text_"+e).css({fontSize:2*t*bwg_params[e].slideshow_title_font_size/bwg_params[e].image_width}),jQuery(".bwg_slideshow_description_text_"+e).css({fontSize:2*t*bwg_params[e].slideshow_description_font_size/bwg_params[e].image_width}),jQuery(".bwg_slideshow_image_"+e).css({display:"inline-block"});i[parseInt(jQuery("#bwg_current_image_key_"+e).val())].is_embed_video?jQuery("#bwg_slideshow_play_pause_"+e).css({display:"none"}):jQuery("#bwg_slideshow_play_pause_"+e).css({display:""})}function bwg_popup_resize(e){void 0!==e&&""!==e?bwg_popup_resize_slidshow(e):bwg_popup_resize_lightbox()}function bwg_change_image(e,t,i,a,r){void 0!==r&&""!==r?bwg_change_image_slideshow(e,t,i,a,r):bwg_change_image_lightbox(e,t,i=gallery_box_data.data,a)}function bwg_resize_instagram_post(e){if(void 0!==e&&""!==e){if(jQuery(".inner_instagram_iframe_bwg_embed_frame_"+e).length){var t=jQuery(".bwg_slideshow_embed_"+e).width(),i=jQuery(".bwg_slideshow_embed_").height();jQuery(".inner_instagram_iframe_bwg_embed_frame_"+e).each(function(){var e=jQuery(this).parent();i/(parseInt(e.attr("data-height"))+96)<t/parseInt(e.attr("data-width"))?(e.height(i),e.width((e.height()-96)*e.attr("data-width")/e.attr("data-height")+16)):(e.width(t),e.height((e.width()-16)*e.attr("data-height")/e.attr("data-width")+96))}),bwg_change_watermark_container(e)}}else if(jQuery(".inner_instagram_iframe_bwg_embed_frame").length){t=jQuery(".bwg_image_container").width(),i=jQuery(".bwg_image_container").height();jQuery(".inner_instagram_iframe_bwg_embed_frame").each(function(){var e=jQuery(this).parent();i/(parseInt(e.attr("data-height"))+176)<t/parseInt(e.attr("data-width"))?(e.height(i),e.width((e.height()-176)*e.attr("data-width")/e.attr("data-height")+16)):(e.width(t),e.height((e.width()-16)*e.attr("data-height")/e.attr("data-width")+96)),e.css({top:.5*(i-e.height())})}),bwg_change_watermark_container()}}function bwg_play(t,i){if(void 0!==i&&""!==i)t=bwg_params[i].data;void 0!==i&&""!==i?(window.clearInterval(window["bwg_playInterval"+i]),window["bwg_playInterval"+i]=setInterval(function(){var e=1;1==bwg_params[i].enable_slideshow_shuffle&&(e=Math.floor((t.length-1)*Math.random()+1)),bwg_change_image(parseInt(jQuery("#bwg_current_image_key_"+i).val()),(parseInt(jQuery("#bwg_current_image_key_"+i).val())+e)%t.length,t,"",i)},1e3*bwg_params[i].slideshow_interval)):(window.clearInterval(gallery_box_data.bwg_playInterval),gallery_box_data.bwg_playInterval=setInterval(function(){jQuery(".bwg_comment_container").hasClass("bwg_open")||jQuery(".bwg_play_pause").length&&jQuery(".bwg_play_pause").hasClass("bwg-icon-play")||(void 0===t||void 0!==t[parseInt(jQuery("#bwg_current_image_key").val())+1]?bwg_change_image(parseInt(jQuery("#bwg_current_image_key").val()),parseInt(jQuery("#bwg_current_image_key").val())+1):1==gallery_box_data.enable_loop&&bwg_change_image(parseInt(jQuery("#bwg_current_image_key").val()),0))},1e3*gallery_box_data.slideshow_interval))}function bwg_image_browser(e){if(jQuery("#bwg_embed_frame_16x9_"+e).width(jQuery("#bwg_embed_frame_16x9_"+e).parents(".image_browser_image_buttons_"+e).width()),jQuery("#bwg_embed_frame_16x9_"+e).height(.5625*jQuery("#bwg_embed_frame_16x9_"+e).width()),jQuery("#bwg_embed_frame_instapost_"+e).width(jQuery("#bwg_embed_frame_16x9_"+e).parents(".image_browser_image_buttons_"+e).width()),jQuery(".image_browser_images_conteiner_"+e).find(".fluid-width-video-wrapper").length){var t=jQuery(".image_browser_images_conteiner_"+e).find(".fluid-width-video-wrapper").contents();jQuery(".image_browser_images_conteiner_"+e).find(".fluid-width-video-wrapper").replaceWith(t)}jQuery(".bwg_embed_frame_instapost_"+e).height((jQuery(".bwg_embed_frame_instapost_"+e).width()-16)*jQuery(".bwg_embed_frame_instapost_"+e).attr("data-height")/jQuery(".bwg_embed_frame_instapost_"+e).attr("data-width")+96);var i=jQuery(".image_browser_images_"+e).width();i<=108?jQuery(".paging-input_"+e).css("display","none"):(i<=200?(jQuery(".paging-input_"+e).css("margin","0% 0% 0% 0%"),jQuery(".paging-input_"+e).css("display","inline")):i<=580?(jQuery(".paging-input_"+e).css("display","inline"),jQuery(".tablenav-pages_"+e+" a").css("font-size","13px"),jQuery(".paging-input_"+e).css("margin","0% 7% 0% 7%")):(jQuery(".tablenav-pages_"+e+" a").css("font-size","15px"),jQuery(".paging-input_"+e).css("margin","0% 14% 0% 14%"),jQuery(".paging-input_"+e).css("display","inline")),jQuery(".tablenav-pages_"+e+" .next-page").css("margin","0% 0% 0% 0%"),jQuery(".tablenav-pages_"+e+" .prev-page").css("margin","0% 0% 0% 0%"))}function bwg_disable_right_click(e){e.bind("contextmenu",function(){return!1}),e.css("webkitTouchCallout","none")}jQuery(document).ajaxComplete(function(){setTimeout(function(){bwg_main_ready()})}),jQuery(document).ready(function(){document.addEventListener("visibilitychange",function(){var e=!1;jQuery(".bwg_container").each(function(){0<jQuery(this).find(".wd_error").length&&(e=!0)}),e||("visible"==document.visibilityState&&bwg_slideshow_focus(),"hidden"==document.visibilityState&&bwg_slideshow_blur())}),bwg_main_ready(),jQuery.fn.extend({hideShow:function(e){return this.checkForVisiblilityChange(e),this},checkForVisiblilityChange:function(e){if(this.length>>>0){for(var t,i,a,r=0;t=this[r++];){var _=jQuery(t).is(":visible");void 0===t.lastVisibility&&(t.lastVisibility=_),_!==t.lastVisibility&&(t.lastVisibility=_,"function"==typeof e&&e.apply(this,[new jQuery.Event("visibilityChanged"),_?"shown":"hidden"]),function(e,t){setTimeout(function(){jQuery(e).trigger("visibilityChanged",[t?"shown":"hidden"])},10)}(t,_))}i=this,a=arguments,setTimeout(function(){i.checkForVisiblilityChange.apply(i,a)},10)}}}),jQuery(this).hideShow(function(e,t){"shown"==t&&bwg_main_ready()})}),jQuery(window).on("resize",function(){var e=!1;jQuery(".bwg_container").each(function(){0<jQuery(this).find(".wd_error").length&&(e=!0)}),e||(jQuery(".bwg-thumbnails, .bwg-masonry-thumbnails, .bwg-album-thumbnails").each(function(){bwg_all_thumnails_loaded(this)}),bwg_slideshow_resize(),bwg_image_browser_resize(),bwg_carousel_resize(),bwg_blog_style_resize(),jQuery(".bwg-mosaic-thumbnails").each(function(){bwg_thumbnail_mosaic(this)})),bwg_resize_search_line()}),jQuery(window).on("load",function(){var e=!1;jQuery(".bwg_container").each(function(){0<jQuery(this).find(".wd_error").length&&(e=!0)}),e||(bwg_blog_style_onload(),jQuery(".bwg-mosaic-thumbnails").each(function(){bwg_thumbnail_mosaic(this)}))}),jQuery(".bwg-masonry-thumb-span img, .bwg-mosaic-thumb-span img").on("error",function(){jQuery(this).height(100),jQuery(this).width(100)});
|
1 |
+
var bwg_current_filmstrip_pos,total_thumbnail_count,key,startPoint,endPoint,bwg_image_info_pos,filmstrip_width,preloadCount,filmstrip_thumbnail_width,filmstrip_thumbnail_height,addthis_share,lightbox_comment_pos,bwg_transition_duration,bwg_playInterval,isPopUpOpened=!1,bwg_overflow_initial_value=!1,bwg_overflow_x_initial_value=!1,bwg_overflow_y_initial_value=!1;function gallery_box_ready(){filmstrip_thumbnail_width=jQuery(".bwg_filmstrip_thumbnail").width(),filmstrip_thumbnail_height=jQuery(".bwg_filmstrip_thumbnail").height(),1==gallery_box_data.open_with_fullscreen?(filmstrip_width=jQuery(window).width(),filmstrip_height=jQuery(window).height()):(filmstrip_width=jQuery(".bwg_filmstrip_container").width(),filmstrip_height=jQuery(".bwg_filmstrip_container").height()),preloadCount="horizontal"==gallery_box_data.filmstrip_direction?parseInt(filmstrip_width/filmstrip_thumbnail_width)+gallery_box_data.preload_images_count:parseInt(filmstrip_height/filmstrip_thumbnail_height)+gallery_box_data.preload_images_count,total_thumbnail_count=jQuery(".bwg_filmstrip_thumbnail").length,key=parseInt(jQuery("#bwg_current_image_key").val()),startPoint=0,endPoint=key+preloadCount,jQuery(document).ready(function(){bwg_load_visible_images(key,preloadCount,total_thumbnail_count),jQuery(".pge_tabs li a").on("click",function(){return jQuery(".pge_tabs_container > div").hide(),jQuery(".pge_tabs li").removeClass("pge_active"),jQuery(jQuery(this).attr("href")).show(),jQuery(this).closest("li").addClass("pge_active"),jQuery("[name=type]").val(jQuery(this).attr("href").substr(1)),!1});var e=jQuery("#bwg_rated").attr("data-params");bwg_rating((e=JSON.parse(e)).current_rate,e.current_rate_count,e.current_avg_rating,e.current_image_key)}),1==gallery_box_data.is_pro&&1==gallery_box_data.enable_addthis&&gallery_box_data.addthis_profile_id&&(addthis_share={url:gallery_box_data.share_url}),lightbox_comment_pos=gallery_box_data.lightbox_comment_pos,bwg_image_info_pos=jQuery(".bwg_ctrl_btn_container").length?jQuery(".bwg_ctrl_btn_container").height():0,bwg_transition_duration=gallery_box_data.slideshow_interval<4*gallery_box_data.slideshow_effect_duration&&0!=gallery_box_data.slideshow_interval?1e3*gallery_box_data.slideshow_interval/4:1e3*gallery_box_data.slideshow_effect_duration,gallery_box_data.bwg_transition_duration=bwg_transition_duration,gallery_box_data.bwg_trans_in_progress=!1,(jQuery("#spider_popup_wrap").width()>=jQuery(window).width()||jQuery("#spider_popup_wrap").height()>=jQuery(window).height())&&jQuery(".spider_popup_close").attr("class","bwg_ctrl_btn spider_popup_close_fullscreen"),window.clearInterval(bwg_playInterval),bwg_current_filmstrip_pos=gallery_box_data.current_pos,jQuery(document).on("keydown",function(e){jQuery("#bwg_name").is(":focus")||jQuery("#bwg_email").is(":focus")||jQuery("#bwg_comment").is(":focus")||jQuery("#bwg_captcha_input").is(":focus")||(39===e.keyCode?bwg_change_image(parseInt(jQuery("#bwg_current_image_key").val()),parseInt(jQuery("#bwg_current_image_key").val())+1):37===e.keyCode?bwg_change_image(parseInt(jQuery("#bwg_current_image_key").val()),parseInt(jQuery("#bwg_current_image_key").val())-1):27===e.keyCode?spider_destroypopup(1e3):32===e.keyCode&&jQuery(".bwg_play_pause").trigger("click"))}),jQuery(window).resize(function(){void 0!==jQuery().fullscreen&&jQuery.isFunction(jQuery().fullscreen)&&(jQuery.fullscreen.isFullScreen()||bwg_popup_resize())});var r=gallery_box_data.image_width,_=gallery_box_data.image_height;if(1==gallery_box_data.is_pro){1==gallery_box_data.enable_addthis&&gallery_box_data.addthis_profile_id&&jQuery(".at4-share-outer").show(),spider_set_input_value("rate_ajax_task","save_hit_count"),spider_rate_ajax_save("bwg_rate_form");var e=gallery_box_data.data,t=gallery_box_data.current_image_key;jQuery(".bwg_image_hits span").html(++e[t].hit_count);var i=window.location.hash;i&&"-1"!=i.indexOf("bwg")||(location.replace("#bwg"+gallery_box_data.gallery_id+"/"+gallery_box_data.current_image_id),history.replaceState(void 0,void 0,"#bwg"+gallery_box_data.gallery_id+"/"+gallery_box_data.current_image_id))}1==gallery_box_data.image_right_click&&(jQuery(".bwg_image_wrap").bind("contextmenu",function(e){return!1}),jQuery(".bwg_image_wrap").css("webkitTouchCallout","none")),jQuery("#spider_popup_wrap").bind("touchmove",function(e){e.preventDefault()}),void 0!==jQuery().swiperight&&jQuery.isFunction(jQuery().swiperight)&&jQuery("#spider_popup_wrap .bwg_image_wrap").swiperight(function(){return bwg_change_image(parseInt(jQuery("#bwg_current_image_key").val()),(parseInt(jQuery("#bwg_current_image_key").val())+gallery_box_data.data.length-1)%gallery_box_data.data.length),!1}),void 0!==jQuery().swipeleft&&jQuery.isFunction(jQuery().swipeleft)&&jQuery("#spider_popup_wrap .bwg_image_wrap").swipeleft(function(){return bwg_change_image(parseInt(jQuery("#bwg_current_image_key").val()),(parseInt(jQuery("#bwg_current_image_key").val())+1)%gallery_box_data.data.length),!1}),bwg_reset_zoom();var a=/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase())?"touchend":"click";jQuery("#spider_popup_left").on(a,function(){return bwg_change_image(parseInt(jQuery("#bwg_current_image_key").val()),(parseInt(jQuery("#bwg_current_image_key").val())+gallery_box_data.data.length-1)%gallery_box_data.data.length),!1}),jQuery("#spider_popup_right").on(a,function(){return bwg_change_image(parseInt(jQuery("#bwg_current_image_key").val()),(parseInt(jQuery("#bwg_current_image_key").val())+1)%gallery_box_data.data.length),!1}),-1!=navigator.appVersion.indexOf("MSIE 10")||-1!=navigator.appVersion.indexOf("MSIE 9")?setTimeout(function(){bwg_popup_resize()},1):bwg_popup_resize(),jQuery(".bwg_watermark").css({display:"none"}),setTimeout(function(){bwg_change_watermark_container()},500),void 0!==jQuery().fullscreen&&jQuery.isFunction(jQuery().fullscreen)&&(jQuery.fullscreen.isNativelySupported()||jQuery(".bwg_fullscreen").hide()),"horizontal"==gallery_box_data.filmstrip_direction?(jQuery(".bwg_image_container").height(jQuery(".bwg_image_wrap").height()-gallery_box_data.image_filmstrip_height),jQuery(".bwg_image_container").width(jQuery(".bwg_image_wrap").width())):(jQuery(".bwg_image_container").height(jQuery(".bwg_image_wrap").height()),jQuery(".bwg_image_container").width(jQuery(".bwg_image_wrap").width()-gallery_box_data.image_filmstrip_width)),void 0!==jQuery().mCustomScrollbar&&jQuery.isFunction(jQuery().mCustomScrollbar)&&jQuery(".bwg_comments,.bwg_ecommerce_panel, .bwg_image_info").mCustomScrollbar({scrollInertia:150,advanced:{updateOnContentResize:!0}});var s=/Firefox/i.test(navigator.userAgent)?"DOMMouseScroll":"mousewheel";jQuery(".bwg_filmstrip").on(s,function(e){var t=window.event||e,i=(t=t.originalEvent?t.originalEvent:t).detail?-40*t.detail:t.wheelDelta,a=/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase());0<i?jQuery(".bwg_filmstrip_left").trigger(a?"touchend":"click"):jQuery(".bwg_filmstrip_right").trigger(a?"touchend":"click")}),jQuery(".bwg_filmstrip_right").on(a,function(){jQuery(".bwg_filmstrip_thumbnails").stop(!0,!1),"left"==gallery_box_data.left_or_top?"width"==gallery_box_data.width_or_height?(jQuery(".bwg_filmstrip_thumbnails").position().left>=-(jQuery(".bwg_filmstrip_thumbnails").width()-jQuery(".bwg_filmstrip").width())&&(jQuery(".bwg_filmstrip_left").css({opacity:1}),jQuery(".bwg_filmstrip_thumbnails").position().left<-(jQuery(".bwg_filmstrip_thumbnails").width()-jQuery(".bwg_filmstrip").width()-(gallery_box_data.filmstrip_thumb_right_left_space+gallery_box_data.image_filmstrip_width+gallery_box_data.all_images_right_left_space))?jQuery(".bwg_filmstrip_thumbnails").animate({left:-(jQuery(".bwg_filmstrip_thumbnails").width()-jQuery(".bwg_filmstrip").width()-gallery_box_data.all_images_right_left_space)},500,"linear"):jQuery(".bwg_filmstrip_thumbnails").animate({left:jQuery(".bwg_filmstrip_thumbnails").position().left-(gallery_box_data.filmstrip_thumb_right_left_space+gallery_box_data.image_filmstrip_width)},500,"linear")),window.setTimeout(function(){jQuery(".bwg_filmstrip_thumbnails").position().left==-(jQuery(".bwg_filmstrip_thumbnails").width()-jQuery(".bwg_filmstrip").width())&&jQuery(".bwg_filmstrip_right").css({opacity:.3})},500)):(jQuery(".bwg_filmstrip_thumbnails").position().left>=-(jQuery(".bwg_filmstrip_thumbnails").height()-jQuery(".bwg_filmstrip").height())&&(jQuery(".bwg_filmstrip_left").css({opacity:1}),jQuery(".bwg_filmstrip_thumbnails").position().left<-(jQuery(".bwg_filmstrip_thumbnails").height()-jQuery(".bwg_filmstrip").height()-(gallery_box_data.filmstrip_thumb_right_left_space+gallery_box_data.image_filmstrip_width+gallery_box_data.all_images_right_left_space))?jQuery(".bwg_filmstrip_thumbnails").animate({left:-(jQuery(".bwg_filmstrip_thumbnails").height()-jQuery(".bwg_filmstrip").height()-gallery_box_data.all_images_right_left_space)},500,"linear"):jQuery(".bwg_filmstrip_thumbnails").animate({left:jQuery(".bwg_filmstrip_thumbnails").position().left-(gallery_box_data.filmstrip_thumb_right_left_space+gallery_box_data.image_filmstrip_width)},500,"linear")),window.setTimeout(function(){jQuery(".bwg_filmstrip_thumbnails").position().left==-(jQuery(".bwg_filmstrip_thumbnails").height()-jQuery(".bwg_filmstrip").height())&&jQuery(".bwg_filmstrip_right").css({opacity:.3})},500)):"width"==gallery_box_data.width_or_height?(jQuery(".bwg_filmstrip_thumbnails").position().top>=-(jQuery(".bwg_filmstrip_thumbnails").width()-jQuery(".bwg_filmstrip").width())&&(jQuery(".bwg_filmstrip_left").css({opacity:1}),jQuery(".bwg_filmstrip_thumbnails").position().top<-(jQuery(".bwg_filmstrip_thumbnails").width()-jQuery(".bwg_filmstrip").width()-(gallery_box_data.filmstrip_thumb_right_left_space+gallery_box_data.image_filmstrip_width+gallery_box_data.all_images_right_left_space))?jQuery(".bwg_filmstrip_thumbnails").animate({left:-(jQuery(".bwg_filmstrip_thumbnails").width()-jQuery(".bwg_filmstrip").width()-gallery_box_data.all_images_right_left_space)},500,"linear"):jQuery(".bwg_filmstrip_thumbnails").animate({left:jQuery(".bwg_filmstrip_thumbnails").position().top-(gallery_box_data.filmstrip_thumb_right_left_space+gallery_box_data.image_filmstrip_width)},500,"linear")),window.setTimeout(function(){jQuery(".bwg_filmstrip_thumbnails").position().left==-(jQuery(".bwg_filmstrip_thumbnails").width()-jQuery(".bwg_filmstrip").width())&&jQuery(".bwg_filmstrip_right").css({opacity:.3})},500)):(jQuery(".bwg_filmstrip_thumbnails").position().top>=-(jQuery(".bwg_filmstrip_thumbnails").height()-jQuery(".bwg_filmstrip").height())&&(jQuery(".bwg_filmstrip_left").css({opacity:1}),jQuery(".bwg_filmstrip_thumbnails").position().top<-(jQuery(".bwg_filmstrip_thumbnails").height()-jQuery(".bwg_filmstrip").height()-(gallery_box_data.filmstrip_thumb_right_left_space+gallery_box_data.image_filmstrip_width+gallery_box_data.all_images_right_left_space))?jQuery(".bwg_filmstrip_thumbnails").animate({top:-(jQuery(".bwg_filmstrip_thumbnails").height()-jQuery(".bwg_filmstrip").height()-gallery_box_data.all_images_right_left_space)},500,"linear"):jQuery(".bwg_filmstrip_thumbnails").animate({top:jQuery(".bwg_filmstrip_thumbnails").position().top-(gallery_box_data.filmstrip_thumb_right_left_space+gallery_box_data.image_filmstrip_width)},500,"linear")),window.setTimeout(function(){jQuery(".bwg_filmstrip_thumbnails").position().left==-(jQuery(".bwg_filmstrip_thumbnails").height()-jQuery(".bwg_filmstrip").height())&&jQuery(".bwg_filmstrip_right").css({opacity:.3})},500))}),"left"==gallery_box_data.left_or_top?jQuery(".bwg_filmstrip_left").on(a,function(){jQuery(".bwg_filmstrip_thumbnails").stop(!0,!1),jQuery(".bwg_filmstrip_thumbnails").position().left<0&&(jQuery(".bwg_filmstrip_right").css({opacity:1}),jQuery(".bwg_filmstrip_thumbnails").position().left>-(gallery_box_data.filmstrip_thumb_right_left_space+gallery_box_data.image_filmstrip_width)?jQuery(".bwg_filmstrip_thumbnails").animate({left:0},500,"linear"):jQuery(".bwg_filmstrip_thumbnails").animate({left:jQuery(".bwg_filmstrip_thumbnails").position().left+gallery_box_data.image_filmstrip_width+gallery_box_data.filmstrip_thumb_right_left_space},500,"linear")),window.setTimeout(function(){0==jQuery(".bwg_filmstrip_thumbnails").position().left&&jQuery(".bwg_filmstrip_left").css({opacity:.3})},500)}):jQuery(".bwg_filmstrip_left").on(a,function(){jQuery(".bwg_filmstrip_thumbnails").stop(!0,!1),jQuery(".bwg_filmstrip_thumbnails").position().top<0&&(jQuery(".bwg_filmstrip_right").css({opacity:1}),jQuery(".bwg_filmstrip_thumbnails").position().top>-(gallery_box_data.filmstrip_thumb_right_left_space+gallery_box_data.image_filmstrip_width)?jQuery(".bwg_filmstrip_thumbnails").animate({top:0},500,"linear"):jQuery(".bwg_filmstrip_thumbnails").animate({top:jQuery(".bwg_filmstrip_thumbnails").position().top+gallery_box_data.image_filmstrip_width+gallery_box_data.filmstrip_thumb_right_left_space},500,"linear")),window.setTimeout(function(){0==jQuery(".bwg_filmstrip_thumbnails").position().top&&jQuery(".bwg_filmstrip_left").css({opacity:.3})},500)}),"width"==gallery_box_data.width_or_height?bwg_set_filmstrip_pos(jQuery(".bwg_filmstrip").width(),"",gallery_box_data):bwg_set_filmstrip_pos(jQuery(".bwg_filmstrip").height(),"",gallery_box_data),jQuery(".bwg_info").on(a,function(){if("none"==jQuery(".bwg_image_info_container1").css("display")){jQuery(".bwg_image_info_container1").css("display","table-cell"),jQuery(".bwg_info").attr("title",bwg_objectsL10n.bwg_hide_info);jQuery(".bwg_ctrl_btn_container").length&&jQuery(".bwg_ctrl_btn_container").height();jQuery(".bwg_image_info").css("height","auto"),bwg_info_height_set()}else jQuery(".bwg_image_info_container1").css("display","none"),jQuery(".bwg_info").attr("title",bwg_objectsL10n.bwg_show_info)}),jQuery(".bwg_rate").on(a,function(){"none"==jQuery(".bwg_image_rate_container1").css("display")?(jQuery(".bwg_image_rate_container1").css("display","table-cell"),jQuery(".bwg_rate").attr("title",bwg_objectsL10n.bwg_hide_rating)):(jQuery(".bwg_image_rate_container1").css("display","none"),jQuery(".bwg_rate").attr("title",bwg_objectsL10n.bwg_show_rating))}),jQuery(".bwg_comment, .bwg_comments_close_btn").on(a,function(){bwg_comment()}),jQuery(".bwg_ecommerce, .bwg_ecommerce_close_btn").on(a,function(){bwg_ecommerce()}),jQuery(".bwg_toggle_container").on(a,function(){var e="top"==gallery_box_data.lightbox_ctrl_btn_pos?"bwg-icon-caret-up":"bwg-icon-caret-down",t="top"==gallery_box_data.lightbox_ctrl_btn_pos?"bwg-icon-caret-down":"bwg-icon-caret-up";jQuery(".bwg_toggle_container i").hasClass(e)?(gallery_box_data.enable_image_filmstrip&&"bottom"==gallery_box_data.lightbox_filmstrip_pos||"bottom"!=gallery_box_data.lightbox_ctrl_btn_pos||"bottom"!=gallery_box_data.lightbox_rate_pos?gallery_box_data.enable_image_filmstrip&&"top"==gallery_box_data.lightbox_filmstrip_pos||"top"!=gallery_box_data.lightbox_ctrl_btn_pos||"top"!=gallery_box_data.lightbox_rate_pos||jQuery(".bwg_image_rate").animate({top:0},500):jQuery(".bwg_image_rate").animate({bottom:0},500),gallery_box_data.enable_image_filmstrip&&"bottom"==gallery_box_data.lightbox_filmstrip_pos||"bottom"!=gallery_box_data.lightbox_ctrl_btn_pos||"bottom"!=gallery_box_data.lightbox_hit_pos?gallery_box_data.enable_image_filmstrip&&"top"==gallery_box_data.lightbox_filmstrip_pos||"top"!=gallery_box_data.lightbox_ctrl_btn_pos||"top"!=gallery_box_data.lightbox_hit_pos||jQuery(".bwg_image_hit").animate({top:0},500):jQuery(".bwg_image_hit").animate({bottom:0},500),"bottom"==gallery_box_data.lightbox_ctrl_btn_pos?(jQuery(".bwg_ctrl_btn_container").animate({bottom:"-"+jQuery(".bwg_ctrl_btn_container").height()},500).addClass("closed"),jQuery(".bwg_toggle_container").animate({bottom:0},{duration:500,complete:function(){jQuery(".bwg_toggle_container i").attr("class","bwg_toggle_btn "+t)}})):(jQuery(".bwg_ctrl_btn_container").animate({top:"-"+jQuery(".bwg_ctrl_btn_container").height()},500).addClass("closed"),jQuery(".bwg_toggle_container").animate({top:0},{duration:500,complete:function(){jQuery(".bwg_toggle_container i").attr("class","bwg_toggle_btn "+t)}}))):(gallery_box_data.enable_image_filmstrip&&"bottom"==gallery_box_data.lightbox_filmstrip_pos||"bottom"!=gallery_box_data.lightbox_ctrl_btn_pos||"bottom"!=gallery_box_data.lightbox_rate_pos?gallery_box_data.enable_image_filmstrip&&"top"==gallery_box_data.lightbox_filmstrip_pos||"top"!=gallery_box_data.lightbox_ctrl_btn_pos||"top"!=gallery_box_data.lightbox_rate_pos||jQuery(".bwg_image_rate").animate({top:jQuery(".bwg_ctrl_btn_container").height()},500):jQuery(".bwg_image_rate").animate({bottom:jQuery(".bwg_ctrl_btn_container").height()},500),gallery_box_data.enable_image_filmstrip&&"bottom"==gallery_box_data.lightbox_filmstrip_pos||"bottom"!=gallery_box_data.lightbox_ctrl_btn_pos||"bottom"!=gallery_box_data.lightbox_hit_pos?gallery_box_data.enable_image_filmstrip&&"top"==gallery_box_data.lightbox_filmstrip_pos||"top"!=gallery_box_data.lightbox_ctrl_btn_pos||"top"!=gallery_box_data.lightbox_hit_pos||jQuery(".bwg_image_hit").animate({top:jQuery(".bwg_ctrl_btn_container").height()},500):jQuery(".bwg_image_hit").animate({bottom:jQuery(".bwg_ctrl_btn_container").height()},500),"bottom"==gallery_box_data.lightbox_ctrl_btn_pos?(jQuery(".bwg_ctrl_btn_container").animate({bottom:0},500).removeClass("closed"),jQuery(".bwg_toggle_container").animate({bottom:jQuery(".bwg_ctrl_btn_container").height()},{duration:500,complete:function(){jQuery(".bwg_toggle_container i").attr("class","bwg_toggle_btn "+e)}})):(jQuery(".bwg_ctrl_btn_container").animate({top:0},500).removeClass("closed"),jQuery(".bwg_toggle_container").animate({top:jQuery(".bwg_ctrl_btn_container").height()},{duration:500,complete:function(){jQuery(".bwg_toggle_container i").attr("class","bwg_toggle_btn "+e)}}))),bwg_info_position(!0)});var o=window.innerHeight;jQuery(".bwg_resize-full").on(a,function(){bwg_resize_full()}),jQuery(".bwg_fullscreen").on(a,function(){jQuery(".bwg_watermark").css({display:"none"});var e,t=0;if((jQuery(".bwg_comment_container").hasClass("bwg_open")||jQuery(".bwg_ecommerce_container").hasClass("bwg_open"))&&(t=jQuery(".bwg_comment_container").width()||jQuery(".bwg_ecommerce_container").width()),void 0!==jQuery().fullscreen&&jQuery.isFunction(jQuery().fullscreen))if(jQuery.fullscreen.isFullScreen())jQuery.fullscreen.exit(),e=o,jQuery(window).width()>gallery_box_data.image_width&&(r=gallery_box_data.image_width),window.innerHeight>gallery_box_data.image_height&&(_=gallery_box_data.image_height),gallery_box_data.open_with_fullscreen&&(r=jQuery(window).width(),_=e),jQuery("#spider_popup_wrap").on("fscreenclose",function(){jQuery("#spider_popup_wrap").css({width:r,height:_,left:"50%",top:"50%",marginLeft:-r/2,marginTop:-_/2,zIndex:1e5}),jQuery(".bwg_image_wrap").css({width:r-t}),jQuery(".bwg_image_container").css({height:_-("horizontal"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_height:0),width:r-t-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0)}),jQuery(".bwg_image_info").css("height","auto"),bwg_info_height_set(),jQuery(".bwg_popup_image").css({maxWidth:r-t-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0),maxHeight:_-("horizontal"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_height:0)}),jQuery(".bwg_popup_embed > .bwg_embed_frame > img, .bwg_popup_embed > .bwg_embed_frame > video").css({maxWidth:r-t-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0),maxHeight:_-("horizontal"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_height:0)}),bwg_resize_instagram_post(),bwg_change_watermark_container(),"width"==gallery_box_data.width_or_height?(jQuery(".bwg_filmstrip_container").css({width:r-("horizontal"==gallery_box_data.filmstrip_direction?"comment_container_width":0)}),jQuery(".bwg_filmstrip").css({width:r-("horizontal"==gallery_box_data.filmstrip_direction?"comment_container_width":0)-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height())}),bwg_set_filmstrip_pos(r-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height()),"",gallery_box_data)):(jQuery(".bwg_filmstrip_container").css({height:_-("horizontal"==gallery_box_data.filmstrip_direction?"comment_container_width":0)}),jQuery(".bwg_filmstrip").css({height:_-("horizontal"==gallery_box_data.filmstrip_direction?"comment_container_width":0)-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height())}),bwg_set_filmstrip_pos(_-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height()),"",gallery_box_data),"horizontal"!=gallery_box_data.filmstrip_direction&&jQuery(".bwg_filmstrip_right").css({top:_-jQuery(".bwg_filmstrip_right").height()})),jQuery(".bwg_resize-full").show(),jQuery(".bwg_resize-full").attr("class","bwg-icon-expand bwg_ctrl_btn bwg_resize-full"),jQuery(".bwg_resize-full").attr("title",bwg_objectsL10n.bwg_maximize),jQuery(".bwg_fullscreen").attr("class","bwg-icon-arrows-out bwg_ctrl_btn bwg_fullscreen"),jQuery(".bwg_fullscreen").attr("title",bwg_objectsL10n.bwg_fullscreen),jQuery("#spider_popup_wrap").width()<jQuery(window).width()&&jQuery("#spider_popup_wrap").height()<window.innerHeight&&jQuery(".spider_popup_close_fullscreen").attr("class","spider_popup_close")});else{jQuery("#spider_popup_wrap").fullscreen();var i=screen.width,a=screen.height;jQuery("#spider_popup_wrap").css({width:i,height:a,left:0,top:0,margin:0,zIndex:1e5}),jQuery(".bwg_image_wrap").css({width:i-t}),jQuery(".bwg_image_container").css({height:a-("horizontal"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_height:0),width:i-t-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0)}),jQuery(".bwg_image_info").css("height","auto"),bwg_info_height_set(),jQuery(".bwg_popup_image").css({maxWidth:i-t-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0),maxHeight:a-("horizontal"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_height:0)}),jQuery(".bwg_popup_embed > .bwg_embed_frame > img, .bwg_popup_embed > .bwg_embed_frame > video").css({maxWidth:i-t-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0),maxHeight:a-("horizontal"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_height:0)}),bwg_resize_instagram_post(),bwg_change_watermark_container(),"width"==gallery_box_data.width_or_height?(jQuery(".bwg_filmstrip_container").css({width:i-("horizontal"==gallery_box_data.filmstrip_direction?t:0)},500),jQuery(".bwg_filmstrip").css({width:i-("horizontal"==gallery_box_data.filmstrip_direction?t:0)-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height())},500),bwg_set_filmstrip_pos(i-("horizontal"==gallery_box_data.filmstrip_direction?t:0)-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height()),"",gallery_box_data)):(jQuery(".bwg_filmstrip_container").css({height:a-("horizontal"==gallery_box_data.filmstrip_direction)?"comment_container_width":0}),jQuery(".bwg_filmstrip").css({height:a-("horizontal"==gallery_box_data.filmstrip_direction?"comment_container_width":0)-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height())}),bwg_set_filmstrip_pos(a-("horizontal"==gallery_box_data.filmstrip_direction?"comment_container_width":0)-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height()),"",gallery_box_data),"horizontal"!=gallery_box_data.filmstrip_direction&&jQuery(".bwg_filmstrip_right").css({top:a-jQuery(".bwg_filmstrip_right").height()})),jQuery(".bwg_resize-full").hide(),jQuery(".bwg_fullscreen").attr("class","bwg-icon-compress bwg_ctrl_btn bwg_fullscreen"),jQuery(".bwg_fullscreen").attr("title",bwg_objectsL10n.bwg_exit_fullscreen),jQuery(".spider_popup_close").attr("class","bwg_ctrl_btn spider_popup_close_fullscreen")}return!1}),jQuery(".bwg_play_pause, .bwg_popup_image").on(a,function(){jQuery(".bwg_play_pause").length&&jQuery(".bwg_play_pause").hasClass("bwg-icon-play")&&!jQuery(".bwg_comment_container").hasClass("bwg_open")?(bwg_play(gallery_box_data.data),jQuery(".bwg_play_pause").attr("title",bwg_objectsL10n.bwg_pause),jQuery(".bwg_play_pause").attr("class","bwg-icon-pause bwg_ctrl_btn bwg_play_pause")):(window.clearInterval(bwg_playInterval),jQuery(".bwg_play_pause").attr("title",bwg_objectsL10n.bwg_play),jQuery(".bwg_play_pause").attr("class","bwg-icon-play bwg_ctrl_btn bwg_play_pause"))}),gallery_box_data.open_with_autoplay&&(bwg_play(gallery_box_data.data),jQuery(".bwg_play_pause").attr("title",bwg_objectsL10n.bwg_pause),jQuery(".bwg_play_pause").attr("class","bwg-icon-pause bwg_ctrl_btn bwg_play_pause")),gallery_box_data.open_with_fullscreen&&bwg_open_with_fullscreen(),jQuery(".bwg_popup_image").removeAttr("width"),jQuery(".bwg_popup_image").removeAttr("height"),jQuery(window).focus(function(){jQuery(".bwg_play_pause").length&&!jQuery(".bwg_play_pause").hasClass("bwg-icon-play")&&bwg_play(gallery_box_data.data)}),jQuery(window).blur(function(){event_stack=[],window.clearInterval(bwg_playInterval)});gallery_box_data.lightbox_ctrl_btn_pos;1==gallery_box_data.open_ecommerce&&setTimeout(function(){bwg_ecommerce()},400),1==gallery_box_data.open_comment&&bwg_comment()}function spider_createpopup(e,t,i,a,r,_,s,o){e=e.replace(/&/g,"&"),isPopUpOpened||(isPopUpOpened=!0,spider_hasalreadyreceivedpopup(_)||spider_isunsupporteduseragent()||(bwg_overflow_initial_value=jQuery("html").css("overflow"),bwg_overflow_x_initial_value=jQuery("html").css("overflow-x"),bwg_overflow_y_initial_value=jQuery("html").css("overflow-y"),jQuery("html").attr("style","overflow:hidden !important;"),jQuery("#bwg_spider_popup_loading_"+t).show(),jQuery("#spider_popup_overlay_"+t).css({display:"block"}),jQuery.ajax({type:"GET",url:e,success:function(e){var t=jQuery('<div id="spider_popup_wrap" class="spider_popup_wrap" style=" width:'+i+"px; height:"+a+"px; margin-top:-"+a/2+"px; margin-left: -"+i/2+'px; ">'+e+"</div>").hide().appendTo("body");gallery_box_ready(),spider_showpopup(_,s,t,r,o)},beforeSend:function(){},complete:function(){}})))}function spider_showpopup(e,t,i,a,r){var _=gallery_box_data.data,s=parseInt(jQuery("#bwg_current_image_key").val());void 0!==_[s]&&(isPopUpOpened=!0,-1<_[s].filetype.indexOf("EMBED_")?bwg_first_image_load(i):jQuery("#spider_popup_wrap .bwg_popup_image_spun img").prop("complete")?bwg_first_image_load(i):jQuery("#spider_popup_wrap .bwg_popup_image_spun img").on("load error",function(){bwg_first_image_load(i)}),spider_receivedpopup(e,t,r))}function bwg_first_image_load(e){e.show(),jQuery(".bwg_spider_popup_loading").hide(),1==gallery_box_data.preload_images&&bwg_preload_images(parseInt(jQuery("#bwg_current_image_key").val())),bwg_load_filmstrip(),bwg_info_height_set()}function spider_hasalreadyreceivedpopup(e){return-1<document.cookie.indexOf(e)&&delete document.cookie[document.cookie.indexOf(e)],!1}function spider_receivedpopup(e,t,i){var a=new Date;a.setDate(a.getDate()+t),document.cookie=e+"=true;expires="+a.toUTCString()+";path=/";var r=gallery_box_data.bwg_ctrl_btn_container_height;"bottom"==i?jQuery(".bwg_toggle_container").css("bottom",r+"px"):"top"==i&&jQuery(".bwg_toggle_container").css("top",r+"px")}function spider_isunsupporteduseragent(){return!window.XMLHttpRequest}function spider_destroypopup(e){null!=document.getElementById("spider_popup_wrap")&&(void 0!==jQuery().fullscreen&&jQuery.isFunction(jQuery().fullscreen)&&jQuery.fullscreen.isFullScreen()&&jQuery.fullscreen.exit(),"undefined"!=typeof enable_addthis&&enable_addthis&&jQuery(".at4-share-outer").hide(),setTimeout(function(){jQuery(".spider_popup_wrap").remove(),jQuery(".bwg_spider_popup_loading").css({display:"none"}),jQuery(".spider_popup_overlay").css({display:"none"}),jQuery(document).off("keydown"),!1!==bwg_overflow_initial_value&&jQuery("html").css("overflow",bwg_overflow_initial_value),!1!==bwg_overflow_x_initial_value&&jQuery("html").css("overflow-x",bwg_overflow_x_initial_value),!1!==bwg_overflow_y_initial_value&&jQuery("html").css("overflow-y",bwg_overflow_y_initial_value)},20)),isPopUpOpened=!1;var t=/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()),i=document.querySelector('meta[name="viewport"]');t&&i&&(i.content="width=device-width, initial-scale=1");var a=jQuery(document).scrollTop();bwg_objectsL10n.is_pro&&location.replace("#"),jQuery(document).scrollTop(a),void 0!==gallery_box_data.bwg_playInterval&&clearInterval(gallery_box_data.bwg_playInterval)}function get_ajax_pricelist(){var e={};return jQuery(".add_to_cart_msg").html(""),e.ajax_task="display",e.image_id=jQuery("#bwg_popup_image").attr("image_id"),jQuery("#ecommerce_ajax_loading").css("height",jQuery(".bwg_ecommerce_panel").css("height")),jQuery("#ecommerce_opacity_div").css("width",jQuery(".bwg_ecommerce_panel").css("width")),jQuery("#ecommerce_opacity_div").css("height",jQuery(".bwg_ecommerce_panel").css("height")),jQuery("#ecommerce_loading_div").css("width",jQuery(".bwg_ecommerce_panel").css("width")),jQuery("#ecommerce_loading_div").css("height",jQuery(".bwg_ecommerce_panel").css("height")),jQuery("#ecommerce_opacity_div").css("display","block"),jQuery("#ecommerce_loading_div").css("display","table-cell"),jQuery.ajax({type:"POST",url:jQuery("#bwg_ecommerce_form").attr("action"),data:e,success:function(e){jQuery(".pge_tabs li a").on("click",function(){return jQuery(".pge_tabs_container > div").hide(),jQuery(".pge_tabs li").removeClass("pge_active"),jQuery(jQuery(this).attr("href")).show(),jQuery(this).closest("li").addClass("pge_active"),jQuery("[name=type]").val(jQuery(this).attr("href").substr(1)),!1});var t=jQuery(e).find(".manual").html();jQuery(".manual").html(t);var i=jQuery(e).find(".downloads").html();jQuery(".downloads").html(i);var a=jQuery(e).find(".pge_options").html();jQuery(".pge_options").html(a);var r=jQuery(e).find(".pge_add_to_cart").html();jQuery(".pge_add_to_cart").html(r)},beforeSend:function(){},complete:function(){jQuery("#ecommerce_opacity_div").css("display","none"),jQuery("#ecommerce_loading_div").css("display","none")}}),!1}function spider_ajax_save(e){var t={};return t.bwg_name=jQuery("#bwg_name").val(),t.bwg_comment=jQuery("#bwg_comment").val(),t.bwg_email=jQuery("#bwg_email").val(),t.bwg_captcha_input=jQuery("#bwg_captcha_input").val(),t.ajax_task=jQuery("#ajax_task").val(),t.image_id=jQuery("#image_id").val(),t.comment_id=jQuery("#comment_id").val(),jQuery("#ajax_loading").css("height",jQuery(".bwg_comments").css("height")),jQuery("#opacity_div").css("width",jQuery(".bwg_comments").css("width")),jQuery("#opacity_div").css("height",jQuery(".bwg_comments").css("height")),jQuery("#loading_div").css("width",jQuery(".bwg_comments").css("width")),jQuery("#loading_div").css("height",jQuery(".bwg_comments").css("height")),document.getElementById("opacity_div").style.display="",document.getElementById("loading_div").style.display="table-cell",jQuery.ajax({type:"POST",url:jQuery("#"+e).attr("action"),data:t,success:function(e){var t=jQuery(e).find(".bwg_comments").html();jQuery(".bwg_comments").html(t)},beforeSend:function(){},complete:function(){document.getElementById("opacity_div").style.display="none",document.getElementById("loading_div").style.display="none",jQuery(".bwg_comments").mCustomScrollbar({scrollInertia:150,advanced:{updateOnContentResize:!0}}),jQuery(".bwg_comments_close_btn").click(bwg_comment),bwg_captcha_refresh("bwg_captcha")}}),!1}function spider_rate_ajax_save(i){var e={};return e.image_id=jQuery("#"+i+" input[name='image_id']").val(),e.rate=jQuery("#"+i+" input[name='score']").val(),e.ajax_task=jQuery("#rate_ajax_task").val(),jQuery.ajax({type:"POST",url:jQuery("#"+i).attr("action"),data:e,success:function(e){var t=jQuery(e).find("#"+i).html();jQuery("#"+i).html(t)},beforeSend:function(){},complete:function(){}})}function spider_set_input_value(e,t){document.getElementById(e)&&(document.getElementById(e).value=t)}function spider_form_submit(e,t){document.getElementById(t)&&document.getElementById(t).submit(),e.preventDefault?e.preventDefault():e.returnValue=!1}function spider_check_required(e,t){return""==jQuery("#"+e).val()&&(alert(t+" "+bwg_objectsL10n.bwg_field_required),jQuery("#"+e).attr("style","border-color: #FF0000;"),jQuery("#"+e).focus(),!0)}function comment_check_privacy_policy(){var e=jQuery("#bwg_submit");e.removeClass("bwg-submit-disabled"),e.removeAttr("disabled"),jQuery("#bwg_comment_privacy_policy").is(":checked")||(e.addClass("bwg-submit-disabled"),e.attr("disabled","disabled"))}function spider_check_email(e){if(""!=jQuery("#"+e).val())return-1==jQuery("#"+e).val().replace(/^\s+|\s+$/g,"").search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/)&&(alert(bwg_objectsL10n.bwg_mail_validation),!0)}function bwg_captcha_refresh(e){document.getElementById(e+"_img")&&document.getElementById(e+"_input")&&(srcArr=document.getElementById(e+"_img").src.split("&r="),document.getElementById(e+"_img").src=srcArr[0]+"&r="+Math.floor(100*Math.random()),document.getElementById(e+"_img").style.display="inline-block",document.getElementById(e+"_input").value="")}function bwg_play_instagram_video(e,t){jQuery(e).parent().find("video").each(function(){jQuery(this).get(0).paused?(jQuery(this).get(0).play(),jQuery(e).children().hide()):(jQuery(this).get(0).pause(),jQuery(e).children().show())})}function bwg_add_comment(){var t=jQuery("#bwg_comment_form"),e=t.attr("action"),i={ajax_task:"add_comment"};return i.comment_name=t.find("#bwg_name").val(),i.comment_email=t.find("#bwg_email").val(),i.comment_text=t.find("#bwg_comment").val(),i.comment_captcha=t.find("#bwg_captcha_input").val(),i.privacy_policy=t.find("#bwg_comment_privacy_policy").is(":checked")?1:0,i.comment_image_id=jQuery("#bwg_popup_image").attr("image_id"),i.comment_moderation=t.find("#bwg_comment_moderation").val(),jQuery(".bwg_spider_ajax_loading").hide(),jQuery.ajax({url:e,type:"POST",dataType:"json",data:i,success:function(e){jQuery(".bwg_comment_error").text(""),1==e.error?jQuery.each(e.error_messages,function(e,t){t&&jQuery(".bwg_comment_"+e+"_error").text(t)}):(t.find("#bwg_comment").val(""),jQuery(".bwg_comment_waiting_message").hide(),0==e.published&&jQuery(".bwg_comment_waiting_message").show(),""!=e.html_comments_block&&jQuery("#bwg_added_comments").html(e.html_comments_block).show())},beforeSend:function(){jQuery(".bwg_spider_ajax_loading").show()},complete:function(){0<t.find("#bwg_comment_privacy_policy").length&&(t.find("#bwg_comment_privacy_policy").prop("checked",!1),comment_check_privacy_policy()),bwg_captcha_refresh("bwg_captcha"),jQuery(".bwg_spider_ajax_loading").hide()},error:function(){}}),!1}function bwg_remove_comment(t){var e=jQuery("#bwg_comment_form").attr("action"),i={ajax_task:"delete_comment"};return i.id_image=jQuery("#bwg_popup_image").attr("image_id"),i.id_comment=t,jQuery.ajax({url:e,type:"POST",dataType:"json",data:i,success:function(e){0==e.error&&jQuery("#bwg_comment_block_"+t).fadeOut("slow").remove()},beforeSend:function(){},complete:function(){},error:function(){}}),!1}function bwg_gallery_box(e,t,i,a){jQuery(".bwg-validate").each(function(){jQuery(this).on("keypress change",function(){jQuery(this).parent().next().find(".bwg_comment_error").html("")})}),void 0===i&&(i=!1);var r,_=t.data("bwg");r=t.find(".bwg-container").data("lightbox-url")?t.find(".bwg-container").data("lightbox-url"):t.data("lightbox-url");var s=jQuery("#bwg_tag_id_"+_).val();s=s||0;var o=1==i?"&open_ecommerce=1":"",l=jQuery("#bwg_search_input_"+_).val(),n=jQuery("#bwg_order_"+_).val()?"&filtersortby="+jQuery("#bwg_order_"+_).val():"";l=l||"",void 0!==a&&(r+="&gallery_id="+a);var g="",w=jQuery("#bwg_blog_style_share_buttons_"+e).attr("data-open-comment");void 0!==w&&!1!==w&&(g="&open_comment=1"),spider_createpopup(r+"&bwg_random_seed="+jQuery("#bwg_random_seed_"+_).val()+"&image_id="+e+"&filter_tag="+s+o+g+"&filter_search_name="+l+n,_,t.data("popup-width"),t.data("popup-height"),1,"testpopup",5,t.data("buttons-position"))}function bwg_change_image_lightbox(e,a,r,t){if(bwg_current_key=gallery_box_data.bwg_current_key,jQuery(".bwg_image_info").css("height","auto"),setTimeout(function(){bwg_info_height_set(),jQuery(".bwg_image_description").height()>jQuery(".bwg_image_info").height()&&jQuery(".mCSB_container").hasClass("mCS_no_scrollbar")&&jQuery(".bwg_image_info").mCustomScrollbar("destroy"),jQuery(".bwg_image_info").hasClass("mCustomScrollbar")||void 0!==jQuery().mCustomScrollbar&&jQuery.isFunction(jQuery().mCustomScrollbar)&&jQuery(".bwg_image_info").mCustomScrollbar({scrollInertia:150,advanced:{updateOnContentResize:!0}})},200),jQuery("#spider_popup_left").show(),jQuery("#spider_popup_right").show(),jQuery(".bwg_image_info").hide(),0==gallery_box_data.enable_loop&&(a==parseInt(r.length)-1&&jQuery("#spider_popup_right").hide(),0==a&&jQuery("#spider_popup_left").hide()),1==gallery_box_data.ecommerceACtive&&1==gallery_box_data.enable_image_ecommerce)if(0==gallery_box_data.data[a].pricelist)jQuery(".bwg_ecommerce").hide();else{jQuery(".bwg_ecommerce").show(),jQuery(".pge_tabs li").hide(),jQuery("#downloads").hide(),jQuery("#manual").hide();var i=gallery_box_data.data[a].pricelist_sections.split(",");if(i)if(jQuery("#"+i[0]).show(),jQuery("[name=type]").val(i[0]),1<i.length)for(jQuery(".pge_tabs").show(),k=0;k<i.length;k++)jQuery("#"+i[k]+"_li").show();else jQuery(".pge_tabs").hide();else jQuery("[name=type]").val("")}if(jQuery("#bwg_image_container").find("iframe").each(function(){jQuery(this)[0].contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}',"*"),jQuery(this)[0].contentWindow.postMessage('{ "method": "pause" }',"*"),jQuery(this)[0].contentWindow.postMessage("pause","*")}),jQuery("#bwg_image_container").find("video").each(function(){jQuery(this).trigger("pause")}),void 0===r&&(r=gallery_box_data.data),void 0!==r[a]&&void 0!==r[e]){if(jQuery(".bwg_play_pause").length&&!jQuery(".bwg_play_pause").hasClass("bwg-icon-play")&&bwg_play(r),t||jQuery("#bwg_current_image_key").val(a),gallery_box_data.bwg_trans_in_progress)return void gallery_box_data.event_stack.push(e+"-"+a);var _="right";if(bwg_current_key>a)_="left";else if(bwg_current_key==a)return;jQuery(".bwg_image_count").html(r[a].number),jQuery(".bwg_watermark").css({display:"none"}),"width"==gallery_box_data.width_or_height?bwg_current_filmstrip_pos=a*(jQuery(".bwg_filmstrip_thumbnail").width()+2+2*gallery_box_data.lightbox_filmstrip_thumb_border_width):"height"==gallery_box_data.width_or_height&&(bwg_current_filmstrip_pos=a*(jQuery(".bwg_filmstrip_thumbnail").height()+2+2*gallery_box_data.lightbox_filmstrip_thumb_border_width)),gallery_box_data.bwg_current_key=a,bwg_objectsL10n.is_pro&&(location.replace("#bwg"+gallery_box_data.gallery_id+"/"+r[a].id),history.replaceState(void 0,void 0,"#bwg"+gallery_box_data.gallery_id+"/"+r[a].id)),gallery_box_data.popup_enable_rate&&(jQuery("#bwg_rate_form input[name='image_id']").val(r[a].id),jQuery("#bwg_star").attr("data-score",r[a].avg_rating),jQuery("#bwg_star").removeAttr("title"),r[a].cur_key=a,bwg_rating(r[a].rate,r[a].rate_count,r[a].avg_rating,a)),spider_set_input_value("rate_ajax_task","save_hit_count"),spider_rate_ajax_save("bwg_rate_form"),jQuery(".bwg_image_hits span").html(++r[a].hit_count),jQuery("#bwg_popup_image").attr("image_id",r[a].id),jQuery(".bwg_image_title").html(jQuery("<span />").html(r[a].alt).text()),jQuery(".bwg_image_description").html(jQuery("<span />").html(r[a].description).text()),jQuery(".bwg_filmstrip_thumbnail").removeClass("bwg_thumb_active").addClass("bwg_thumb_deactive"),jQuery("#bwg_filmstrip_thumbnail_"+a).removeClass("bwg_thumb_deactive").addClass("bwg_thumb_active"),jQuery(".bwg_image_info").css("opacity",1),""==r[a].alt.trim()&&""==r[a].description.trim()&&jQuery(".bwg_image_info").css("opacity",0),"none"!=jQuery(".bwg_image_info_container1").css("display")?jQuery(".bwg_image_info_container1").css("display","table-cell"):jQuery(".bwg_image_info_container1").css("display","none"),"none"!=jQuery(".bwg_image_rate_container1").css("display")?jQuery(".bwg_image_rate_container1").css("display","table-cell"):jQuery(".bwg_image_rate_container1").css("display","none");var s=2==jQuery(".bwg_popup_image_spun").css("zIndex")?".bwg_popup_image_spun":".bwg_popup_image_second_spun",o=".bwg_popup_image_second_spun"==s?".bwg_popup_image_spun":".bwg_popup_image_second_spun",l=-1<r[a].filetype.indexOf("EMBED_"),n=-1<r[a].filetype.indexOf("INSTAGRAM_POST"),g=-1<r[a].filetype.indexOf("INSTAGRAM_VIDEO"),w=-1!==jQuery.inArray(r[a].filetype,["EMBED_OEMBED_YOUTUBE_VIDEO","EMBED_OEMBED_VIMEO_VIDEO","EMBED_OEMBED_FACEBOOK_VIDEO","EMBED_OEMBED_DAILYMOTION_VIDEO"]),b=jQuery(s).height(),u=jQuery(s).width(),d='<span class="bwg_popup_image_spun1" style="display: '+(l?"block":"table")+'; width: inherit; height: inherit;"><span class="bwg_popup_image_spun2" style="display:'+(l?"block":"table-cell")+'; vertical-align: middle;text-align: center;height: 100%;">';if(l){if(jQuery("#bwg_download").addClass("hidden"),d+='<span class="bwg_popup_embed bwg_popup_watermark" style="display: '+(w?"block":"table")+'; table-layout: fixed; height: 100%;">'+(g?'<div class="bwg_inst_play_btn_cont" onclick="bwg_play_instagram_video(this)" ><div class="bwg_inst_play"></div></div>':" "),n){var h=0,m=0;b<u+88?h=(m=b)-88:m=(h=u)+88,d+=spider_display_embed(r[a].filetype,r[a].image_url,r[a].filename,{class:"bwg_embed_frame","data-width":r[a].image_width,"data-height":r[a].image_height,frameborder:"0",allowfullscreen:"allowfullscreen",style:"width:"+h+"px; height:"+m+"px; vertical-align:middle; display:inline-block; position:relative;"})}else d+=spider_display_embed(r[a].filetype,r[a].image_url,r[a].filename,{class:"bwg_embed_frame",frameborder:"0",allowfullscreen:"allowfullscreen",style:"display:"+(w?"block":"table-cell")+"; width:inherit; height:inherit; vertical-align:middle;"});d+="</span>"}else jQuery(".bwg-loading").removeClass("hidden"),jQuery("#bwg_download").removeClass("hidden"),d+='<img style="max-height: '+b+"px; max-width: "+u+'px;" class="bwg_popup_image bwg_popup_watermark" src="'+gallery_box_data.site_url+jQuery("<span />").html(r[a].image_url).text()+'" alt="'+r[a].alt+'" />';function p(){gallery_box_data.preload_images&&bwg_preload_images(a),window["bwg_"+gallery_box_data.bwg_image_effect](s,o,_),jQuery(s).find(".bwg_fb_video").each(function(){jQuery(this).attr("src","")}),l?jQuery("#bwg_fullsize_image").attr("href",r[a].image_url):(jQuery("#bwg_fullsize_image").attr("href",gallery_box_data.site_url+r[a].image_url),jQuery("#bwg_download").attr("href",gallery_box_data.site_url+r[a].thumb_url.replace("/thumb/","/.original/")));var e=r[a].image_url.split("/");jQuery("#bwg_download").attr("download",e[e.length-1].replace(/\?bwg=(\d+)$/,""));var t=encodeURIComponent(gallery_box_data.bwg_share_url)+"="+r[a].id+encodeURIComponent("#bwg"+gallery_box_data.gallery_id+"/")+r[a].id;if(l)var i=encodeURIComponent(r[a].thumb_url);else i=gallery_box_data.bwg_share_image_url+encodeURIComponent(encodeURIComponent(r[a].image_url));i=i.replace(/%252F/g,"%2F"),void 0!==addthis_share&&(addthis_share.url=t),jQuery("#bwg_facebook_a").attr("href","https://www.facebook.com/sharer/sharer.php?u="+t),jQuery("#bwg_twitter_a").attr("href","https://twitter.com/share?url="+t),jQuery("#bwg_pinterest_a").attr("href","http://pinterest.com/pin/create/button/?s=100&url="+t+"&media="+i+"&description="+r[a].alt+"%0A"+r[a].description),jQuery("#bwg_tumblr_a").attr("href","https://www.tumblr.com/share/photo?source="+i+"&caption="+r[a].alt+"&clickthru="+t),jQuery(".bwg_comment_container").hasClass("bwg_open")&&(jQuery(".bwg_comments .mCSB_container").css("top","0"),0==r[a].comment_count?jQuery("#bwg_added_comments").hide():(jQuery("#bwg_added_comments").show(),spider_set_input_value("ajax_task","display"),spider_set_input_value("image_id",jQuery("#bwg_popup_image").attr("image_id")),spider_ajax_save("bwg_comment_form"))),jQuery(".bwg_ecommerce_container").hasClass("bwg_open")&&(0==r[a].pricelist?(bwg_popup_sidebar_close(jQuery(".bwg_ecommerce_container")),bwg_animate_image_box_for_hide_sidebar(),jQuery(".bwg_ecommerce_container").attr("class","bwg_ecommerce_container bwg_close"),jQuery(".bwg_ecommerce").attr("title",bwg_objectsL10n.bwg_show_ecommerce),jQuery(".spider_popup_close_fullscreen").show()):get_ajax_pricelist()),void 0!==jQuery().mCustomScrollbar&&jQuery.isFunction(jQuery().mCustomScrollbar)&&jQuery(".bwg_comments").mCustomScrollbar({advanced:{updateOnContentResize:!0}}),jQuery(".bwg_comments .mCSB_scrollTools").hide(),gallery_box_data.enable_image_filmstrip&&bwg_move_filmstrip(),bwg_resize_instagram_post()}if(d+="</span></span>",jQuery(o).html(d),jQuery(o).find("img").on("load error",function(){jQuery(".bwg-loading").addClass("hidden")}),jQuery(".bwg_popup_embed > .bwg_embed_frame > img, .bwg_popup_embed > .bwg_embed_frame > video").css({maxWidth:u,maxHeight:b,height:"auto"}),l)p();else jQuery(o).find("img").one("load",function(){p()}).each(function(){this.complete&&jQuery(this).load()})}}function bwg_preload_images_lightbox(e){for(var t=gallery_box_data.data,i=t.length,a=0==gallery_box_data.preload_images_count||gallery_box_data.preload_images_count>=i?i:gallery_box_data.preload_images_count,r=0,_=1;r<a;_++){var s=1;do{var o=(e+_*s+i)%i;if(void 0!==t[o])-1<t[o].filetype.indexOf("EMBED_")||jQuery("<img/>").attr("src",gallery_box_data.site_url+jQuery("<span />").html(t[o].image_url).text());s*=-1,r++}while(1!=s)}}function bwg_popup_sidebar_open(e){var t=gallery_box_data.lightbox_comment_width,i=gallery_box_data.lightbox_comment_pos;if(t>jQuery(window).width()){if(t=jQuery(window).width(),e.css({width:t}),jQuery(".spider_popup_close_fullscreen").hide(),jQuery(".spider_popup_close").hide(),jQuery(".bwg_ctrl_btn").hasClass("bwg-icon-pause")){var a=/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase());jQuery(".bwg_play_pause").trigger(a?"touchend":"click")}}else jQuery(".spider_popup_close_fullscreen").show();"left"==i?e.animate({left:0},100):e.animate({right:0},100)}function bwg_comment(){if(jQuery(".bwg_watermark").css({display:"none"}),jQuery(".bwg_ecommerce_wrap").css("z-index","-1"),jQuery(".bwg_comment_wrap").css("z-index","25"),jQuery(".bwg_ecommerce_container").hasClass("bwg_open")&&(bwg_popup_sidebar_close(jQuery(".bwg_ecommerce_container")),jQuery(".bwg_ecommerce_container").attr("class","bwg_ecommerce_container bwg_close"),jQuery(".bwg_ecommerce").attr("title",bwg_objectsL10n.bwg_show_ecommerce)),jQuery(".bwg_comment_container").hasClass("bwg_open"))"1"==jQuery(".bwg_comment_container").attr("data-play-status")&&jQuery(".bwg_ctrl_btn.bwg_play_pause").removeClass("bwg-icon-play").addClass("bwg-icon-pause").attr("title",bwg_objectsL10n.bwg_pause),bwg_popup_sidebar_close(jQuery(".bwg_comment_container")),bwg_animate_image_box_for_hide_sidebar(),jQuery(".bwg_comment_wrap").css("z-index","-1"),jQuery(".bwg_comment_container").attr("class","bwg_comment_container bwg_close"),jQuery(".bwg_comment").attr("title",bwg_objectsL10n.bwg_show_comments),jQuery(".spider_popup_close_fullscreen").show();else{jQuery(".bwg_play_pause").hasClass("bwg-icon-pause")?jQuery(".bwg_comment_container").attr("data-play-status","1"):jQuery(".bwg_comment_container").attr("data-play-status","0"),jQuery(".bwg_ctrl_btn.bwg_play_pause").removeClass("bwg-icon-pause").addClass("bwg-icon-play").attr("title",bwg_objectsL10n.bwg_play),bwg_popup_sidebar_open(jQuery(".bwg_comment_container")),bwg_animate_image_box_for_show_sidebar(),jQuery(".bwg_comment_container").attr("class","bwg_comment_container bwg_open"),jQuery(".bwg_comment").attr("title",bwg_objectsL10n.bwg_hide_comments);var e=parseInt(jQuery("#bwg_current_image_key").val());void 0!==gallery_box_data[e]&&0!=gallery_box_data[e].comment_count&&(jQuery("#bwg_added_comments").show(),spider_set_input_value("ajax_task","display"),spider_set_input_value("image_id",jQuery("#bwg_popup_image").attr("image_id")),spider_ajax_save("bwg_comment_form"))}jQuery(".bwg_comments").mCustomScrollbar("update",{scrollInertia:150,advanced:{updateOnContentResize:!0}})}function bwg_ecommerce(){jQuery(".bwg_watermark").css({display:"none"}),jQuery(".bwg_ecommerce_wrap").css("z-index","25"),jQuery(".bwg_comment_wrap").css("z-index","-1"),jQuery(".bwg_comment_container").hasClass("bwg_open")&&(bwg_popup_sidebar_close(jQuery(".bwg_comment_container")),jQuery(".bwg_comment_container").attr("class","bwg_comment_container bwg_close"),jQuery(".bwg_comment").attr("title",bwg_objectsL10n.bwg_show_comments)),jQuery(".bwg_ecommerce_container").hasClass("bwg_open")?(bwg_popup_sidebar_close(jQuery(".bwg_ecommerce_container")),bwg_animate_image_box_for_hide_sidebar(),jQuery(".bwg_ecommerce_container").attr("class","bwg_ecommerce_container bwg_close"),jQuery(".bwg_ecommerce").attr("title",bwg_objectsL10n.bwg_show_ecommerce)):(bwg_popup_sidebar_open(jQuery(".bwg_ecommerce_container")),bwg_animate_image_box_for_show_sidebar(),jQuery(".bwg_ecommerce_container").attr("class","bwg_ecommerce_container bwg_open"),jQuery(".bwg_ecommerce").attr("title",bwg_objectsL10n.bwg_hide_ecommerce),get_ajax_pricelist())}function bwg_popup_sidebar_close(e){var t=parseInt(e.css("borderRightWidth"));t||(t=0),"left"==lightbox_comment_pos?e.animate({left:-e.width()-t},100):"right"==lightbox_comment_pos&&e.animate({right:-e.width()-t},100)}function bwg_animate_image_box_for_hide_sidebar(){"left"==lightbox_comment_pos?jQuery(".bwg_image_wrap").animate({left:0,width:jQuery("#spider_popup_wrap").width()},100):"right"==lightbox_comment_pos&&jQuery(".bwg_image_wrap").animate({right:0,width:jQuery("#spider_popup_wrap").width()},100),jQuery(".bwg_image_container").animate({width:jQuery("#spider_popup_wrap").width()-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0)},100),jQuery(".bwg_popup_image").animate({maxWidth:jQuery("#spider_popup_wrap").width()-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0)},{duration:100,complete:function(){bwg_change_watermark_container()}}),jQuery(".bwg_popup_embed").animate({width:jQuery("#spider_popup_wrap").width()-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0)},{duration:100,complete:function(){bwg_resize_instagram_post(),bwg_change_watermark_container()}}),"width"==gallery_box_data.width_or_height?(jQuery(".bwg_filmstrip_container").animate({width:jQuery(".spider_popup_wrap").width()},100),jQuery(".bwg_filmstrip").animate({width:jQuery(".spider_popup_wrap").width()-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height())},100)):"height"==gallery_box_data.width_or_height&&(jQuery(".bwg_filmstrip_container").animate({height:jQuery(".spider_popup_wrap").width()},100),jQuery(".bwg_filmstrip").animate({height:jQuery(".spider_popup_wrap").width()-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height())},100)),bwg_set_filmstrip_pos(jQuery(".spider_popup_wrap").width()-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height()),"",gallery_box_data),jQuery(".spider_popup_close_fullscreen").show(100)}function bwg_animate_image_box_for_show_sidebar(){var e=jQuery(".bwg_comment_container").width()||jQuery(".bwg_ecommerce_container").width();"left"==lightbox_comment_pos?jQuery(".bwg_image_wrap").animate({left:e,width:jQuery("#spider_popup_wrap").width()-e},100):"right"==lightbox_comment_pos&&jQuery(".bwg_image_wrap").animate({right:e,width:jQuery("#spider_popup_wrap").width()-e},100),jQuery(".bwg_image_container").animate({width:jQuery("#spider_popup_wrap").width()-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0)-e},100),jQuery(".bwg_popup_image").animate({maxWidth:jQuery("#spider_popup_wrap").width()-e-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0)},{duration:100,complete:function(){bwg_change_watermark_container()}}),jQuery(".bwg_popup_embed > .bwg_embed_frame > img, .bwg_popup_embed > .bwg_embed_frame > video").animate({maxWidth:jQuery("#spider_popup_wrap").width()-e-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0)},{duration:100,complete:function(){bwg_resize_instagram_post(),bwg_change_watermark_container()}}),"width"==gallery_box_data.width_or_height&&(jQuery(".bwg_filmstrip_container").css({width:jQuery("#spider_popup_wrap").width()-("vertical"==gallery_box_data.filmstrip_direction?0:e)}),jQuery(".bwg_filmstrip").animate({width:jQuery(".bwg_filmstrip_container").width()-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height())},100),bwg_set_filmstrip_pos(jQuery(".bwg_filmstrip_container").width()-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height()),"",gallery_box_data))}function bwg_reset_zoom(){var e=/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()),t=document.querySelector('meta[name="viewport"]');e&&t&&(t.content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=0")}function bwg_open_with_fullscreen(){jQuery(".bwg_watermark").css({display:"none"});var e=0;(jQuery(".bwg_comment_container").hasClass("bwg_open")||jQuery(".bwg_ecommerce_container").hasClass("bwg_open"))&&(e=jQuery(".bwg_comment_container").width()||jQuery(".bwg_ecommerce_container").width()),bwg_popup_current_width=jQuery(window).width(),bwg_popup_current_height=window.innerHeight,jQuery("#spider_popup_wrap").css({width:jQuery(window).width(),height:window.innerHeight,left:0,top:0,margin:0,zIndex:100002}),jQuery(".bwg_image_wrap").css({width:jQuery(window).width()-e}),jQuery(".bwg_image_container").css({height:bwg_popup_current_height-("horizontal"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_height:0),width:bwg_popup_current_width-e-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0)}),jQuery(".bwg_popup_image").css({maxWidth:jQuery(window).width()-e-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0),maxHeight:window.innerHeight-("horizontal"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_height:0)},{complete:function(){bwg_change_watermark_container()}}),jQuery(".bwg_popup_video").css({width:jQuery(window).width()-e-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0),height:window.innerHeight-("horizontal"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_height:0)},{complete:function(){bwg_change_watermark_container()}}),jQuery(".bwg_popup_embed > .bwg_embed_frame > img, .bwg_popup_embed > .bwg_embed_frame > video").css({maxWidth:jQuery(window).width()-e-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0),maxHeight:window.innerHeight-("horizontal"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_height:0)},{complete:function(){bwg_resize_instagram_post(),bwg_change_watermark_container()}}),"width"==gallery_box_data.width_or_height?(jQuery(".bwg_filmstrip_container").css({width:jQuery(window).width()-("horizontal"==gallery_box_data.filmstrip_direction?"comment_container_width":0)}),jQuery(".bwg_filmstrip").css({width:jQuery(window).width()-("horizontal"==gallery_box_data.filmstrip_direction?"comment_container_width":0)-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height())}),bwg_set_filmstrip_pos(jQuery(window).width()-("horizontal"==gallery_box_data.filmstrip_direction?"comment_container_width":0)-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height()),"",gallery_box_data)):(jQuery(".bwg_filmstrip_container").css({height:window.innerHeight-("horizontal"==gallery_box_data.filmstrip_direction?"comment_container_width":0)}),jQuery(".bwg_filmstrip").css({height:window.innerHeight-("horizontal"==gallery_box_data.filmstrip_direction?"comment_container_width":0)-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height())}),bwg_set_filmstrip_pos(window.innerHeight-("horizontal"==gallery_box_data.filmstrip_direction?"comment_container_width":0)-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height()),"",gallery_box_data)),jQuery(".bwg_resize-full").attr("class","bwg-icon-compress bwg_ctrl_btn bwg_resize-full"),jQuery(".bwg_resize-full").attr("title",bwg_objectsL10n.bwg_restore),jQuery(".spider_popup_close").attr("class","bwg_ctrl_btn spider_popup_close_fullscreen")}function bwg_resize_full(){jQuery(".bwg_watermark").css({display:"none"});var e=0;(jQuery(".bwg_comment_container").hasClass("bwg_open")||jQuery(".bwg_ecommerce_container").hasClass("bwg_open"))&&(e=jQuery(".bwg_comment_container").width()||jQuery(".bwg_ecommerce_container").width()),jQuery(".bwg_resize-full").hasClass("bwg-icon-compress")?(jQuery(window).width()>gallery_box_data.image_width&&(bwg_popup_current_width=gallery_box_data.image_width),window.innerHeight>gallery_box_data.image_height&&(bwg_popup_current_height=gallery_box_data.image_height),jQuery("#spider_popup_wrap").animate({width:bwg_popup_current_width,height:bwg_popup_current_height,left:"50%",top:"50%",marginLeft:-bwg_popup_current_width/2,marginTop:-bwg_popup_current_height/2,zIndex:100002},500),jQuery(".bwg_image_wrap").animate({width:bwg_popup_current_width-e},500),jQuery(".bwg_image_container").animate({height:bwg_popup_current_height-("horizontal"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_height:0),width:bwg_popup_current_width-e-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0)},500),jQuery(".bwg_popup_image").animate({maxWidth:bwg_popup_current_width-e-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0),maxHeight:bwg_popup_current_height-("horizontal"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_height:0)},{duration:500,complete:function(){bwg_change_watermark_container(),jQuery("#spider_popup_wrap").width()<jQuery(window).width()&&jQuery("#spider_popup_wrap").height()<window.innerHeight&&jQuery(".spider_popup_close_fullscreen").attr("class","spider_popup_close")}}),jQuery(".bwg_popup_embed > .bwg_embed_frame > img, .bwg_popup_embed > .bwg_embed_frame > video").animate({maxWidth:bwg_popup_current_width-e-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0),maxHeight:bwg_popup_current_height-("horizontal"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_height:0)},{duration:500,complete:function(){bwg_resize_instagram_post(),bwg_change_watermark_container(),jQuery("#spider_popup_wrap").width()<jQuery(window).width()&&jQuery("#spider_popup_wrap").height()<window.innerHeight&&jQuery(".spider_popup_close_fullscreen").attr("class","spider_popup_close")}}),"width"==gallery_box_data.width_or_height?(jQuery(".bwg_filmstrip_container").animate({width:bwg_popup_current_width-("horizontal"==gallery_box_data.filmstrip_direction?e:0)},500),jQuery(".bwg_filmstrip").animate({width:bwg_popup_current_width-("horizontal"==gallery_box_data.filmstrip_direction?e:0)-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height())},500),bwg_set_filmstrip_pos(bwg_popup_current_width-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height()),"",gallery_box_data)):(jQuery(".bwg_filmstrip_container").animate({height:bwg_popup_current_height-("horizontal"==gallery_box_data.filmstrip_direction?e:0)},500),jQuery(".bwg_filmstrip").animate({height:bwg_popup_current_height-("horizontal"==gallery_box_data.filmstrip_direction?e:0)-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height())},500),bwg_set_filmstrip_pos(bwg_popup_current_height-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height()),"",gallery_box_data),"horizontal"!=gallery_box_data.filmstrip_direction&&jQuery(".bwg_filmstrip_right").css({top:bwg_popup_current_height-jQuery(".bwg_filmstrip_right").height()})),jQuery(".bwg_resize-full").attr("class","bwg-icon-expand bwg_ctrl_btn bwg_resize-full"),jQuery(".bwg_resize-full").attr("title",bwg_objectsL10n.bwg_maximize),setTimeout(function(){bwg_info_height_set()},500)):(bwg_popup_current_width=jQuery(window).width(),bwg_popup_current_height=window.innerHeight,jQuery("#spider_popup_wrap").animate({width:jQuery(window).width(),height:window.innerHeight,left:0,top:0,margin:0,zIndex:100002},500),jQuery(".bwg_image_wrap").animate({width:jQuery(window).width()-e},500),jQuery(".bwg_image_container").animate({height:bwg_popup_current_height-("horizontal"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_height:0),width:bwg_popup_current_width-e-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0)},500),jQuery(".bwg_popup_image").animate({maxWidth:jQuery(window).width()-e-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0),maxHeight:window.innerHeight-("horizontal"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_height:0)},{duration:500,complete:function(){bwg_change_watermark_container()}}),jQuery(".bwg_popup_embed > .bwg_embed_frame > img, .bwg_popup_embed > .bwg_embed_frame > video").animate({maxWidth:jQuery(window).width()-e-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0),maxHeight:window.innerHeight-("horizontal"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_height:0)},{duration:500,complete:function(){bwg_resize_instagram_post(),bwg_change_watermark_container()}}),"width"==gallery_box_data.width_or_height?(jQuery(".bwg_filmstrip_container").animate({width:jQuery(window).width()-("horizontal"==gallery_box_data.filmstrip_direction?e:0)},500),jQuery(".bwg_filmstrip").animate({width:jQuery(window).width()-("horizontal"==gallery_box_data.filmstrip_direction?e:0)-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height())},500),bwg_set_filmstrip_pos(jQuery(window).width()-("horizontal"==gallery_box_data.filmstrip_direction?e:0)-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height()),"",gallery_box_data)):(jQuery(".bwg_filmstrip_container").animate({height:window.innerHeight-("horizontal"==gallery_box_data.filmstrip_direction?e:0)},500),jQuery(".bwg_filmstrip").animate({height:window.innerHeight-("horizontal"==gallery_box_data.filmstrip_direction?e:0)-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height())},500),bwg_set_filmstrip_pos(window.innerHeight-("horizontal"==gallery_box_data.filmstrip_direction?e:0)-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height()),"",gallery_box_data),"horizontal"!=gallery_box_data.filmstrip_direction&&jQuery(".bwg_filmstrip_right").css({top:window.innerHeight-jQuery(".bwg_filmstrip_right").height()})),jQuery(".bwg_resize-full").attr("class","bwg-icon-compress bwg_ctrl_btn bwg_resize-full"),jQuery(".bwg_resize-full").attr("title",bwg_objectsL10n.bwg_restore),jQuery(".spider_popup_close").attr("class","bwg_ctrl_btn spider_popup_close_fullscreen")),setTimeout(function(){bwg_info_height_set()},500)}function bwg_popup_resize_lightbox(){void 0!==jQuery().fullscreen&&jQuery.isFunction(jQuery().fullscreen)&&(jQuery.fullscreen.isFullScreen()||(jQuery(".bwg_resize-full").show(),jQuery(".bwg_resize-full").hasClass("bwg-icon-compress")||jQuery(".bwg_resize-full").attr("class","bwg-icon-expand bwg_ctrl_btn bwg_resize-full"),jQuery(".bwg_resize-full").attr("title",bwg_objectsL10n.bwg_maximize),jQuery(".bwg_fullscreen").attr("class","bwg-icon-arrows-out bwg_ctrl_btn bwg_fullscreen"),jQuery(".bwg_fullscreen").attr("title",bwg_objectsL10n.fullscreen)));var e=0;(jQuery(".bwg_comment_container").hasClass("bwg_open")||jQuery(".bwg_ecommerce_container").hasClass("bwg_open"))&&(e=gallery_box_data.lightbox_comment_width),e>jQuery(window).width()?(e=jQuery(window).width(),jQuery(".bwg_comment_container").css({width:e}),jQuery(".bwg_ecommerce_container").css({width:e}),jQuery(".spider_popup_close_fullscreen").hide()):jQuery(".spider_popup_close_fullscreen").show(),window.innerHeight>gallery_box_data.image_height&&1!=gallery_box_data.open_with_fullscreen&&!jQuery(".bwg_resize-full").hasClass("bwg-icon-compress")?(jQuery("#spider_popup_wrap").css({height:gallery_box_data.image_height,top:"50%",marginTop:-gallery_box_data.image_height/2,zIndex:100002}),jQuery(".bwg_image_container").css({height:gallery_box_data.image_height-("horizontal"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_height:0)}),jQuery(".bwg_image_info").css("height","auto"),bwg_info_height_set(),jQuery(".bwg_popup_image").css({maxHeight:gallery_box_data.image_height-("horizontal"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_height:0)}),jQuery(".bwg_popup_embed > .bwg_embed_frame > img, .bwg_popup_embed > .bwg_embed_frame > video").css({maxHeight:gallery_box_data.image_height-("horizontal"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_height:0)}),"vertical"==gallery_box_data.filmstrip_direction&&(jQuery(".bwg_filmstrip_container").css({height:gallery_box_data.image_height}),jQuery(".bwg_filmstrip").css({height:gallery_box_data.image_height-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height())})),bwg_popup_current_height=gallery_box_data.image_height):(jQuery("#spider_popup_wrap").css({height:window.innerHeight,top:0,marginTop:0,zIndex:100002}),jQuery(".bwg_image_container").css({height:window.innerHeight-("horizontal"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_height:0)}),jQuery(".bwg_image_info").css("height","auto"),bwg_info_height_set(),jQuery(".bwg_popup_image").css({maxHeight:window.innerHeight-("horizontal"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_height:0)}),jQuery(".bwg_popup_embed > .bwg_embed_frame > img, .bwg_popup_embed > .bwg_embed_frame > video").css({maxHeight:window.innerHeight-("horizontal"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_height:0)}),"vertical"==gallery_box_data.filmstrip_direction&&(jQuery(".bwg_filmstrip_container").css({height:window.innerHeight}),jQuery(".bwg_filmstrip").css({height:window.innerHeight-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height())})),bwg_popup_current_height=window.innerHeight),jQuery(window).width()>=gallery_box_data.image_width&&1!=gallery_box_data.open_with_fullscreen?(jQuery("#spider_popup_wrap").css({width:gallery_box_data.image_width,left:"50%",marginLeft:-gallery_box_data.image_width/2,zIndex:100002}),jQuery(".bwg_image_wrap").css({width:gallery_box_data.image_width-e}),jQuery(".bwg_image_container").css({width:gallery_box_data.image_width-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0)-e}),jQuery(".bwg_image_info").css("height","auto"),bwg_info_height_set(),jQuery(".bwg_popup_image").css({maxWidth:gallery_box_data.image_width-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0)-e}),jQuery(".bwg_popup_embed > .bwg_embed_frame > img, .bwg_popup_embed > .bwg_embed_frame > video").css({maxWidth:gallery_box_data.image_width-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0)-e}),"horizontal"==gallery_box_data.filmstrip_direction&&(jQuery(".bwg_filmstrip_container").css({width:gallery_box_data.image_width-e}),jQuery(".bwg_filmstrip").css({width:gallery_box_data.image_width-e-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height())})),bwg_popup_current_width=gallery_box_data.image_width):(jQuery("#spider_popup_wrap").css({width:jQuery(window).width(),left:0,marginLeft:0,zIndex:100002}),jQuery(".bwg_image_wrap").css({width:jQuery(window).width()-e}),jQuery(".bwg_image_container").css({width:jQuery(window).width()-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0)-e}),jQuery(".bwg_popup_image").css({maxWidth:jQuery(window).width()-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0)-e}),jQuery(".bwg_popup_embed > .bwg_embed_frame > img, .bwg_popup_embed > .bwg_embed_frame > video").css({maxWidth:jQuery(window).width()-("vertical"==gallery_box_data.filmstrip_direction?gallery_box_data.image_filmstrip_width:0)-e}),"horizontal"==gallery_box_data.filmstrip_direction&&(jQuery(".bwg_filmstrip_container").css({width:jQuery(window).width()-e}),jQuery(".bwg_filmstrip").css({width:jQuery(window).width()-e-2*("horizontal"==gallery_box_data.filmstrip_direction?jQuery(".bwg_filmstrip_right").width():jQuery(".bwg_filmstrip_right").height())})),bwg_popup_current_width=jQuery(window).width()),bwg_resize_instagram_post(),bwg_change_watermark_container(),window.innerHeight>gallery_box_data.image_height-2*gallery_box_data.lightbox_close_btn_top&&jQuery(window).width()>=gallery_box_data.image_width-2*gallery_box_data.lightbox_close_btn_right&&1!=gallery_box_data.open_with_fullscreen?jQuery(".spider_popup_close_fullscreen").attr("class","spider_popup_close"):jQuery("#spider_popup_wrap").width()<jQuery(window).width()&&jQuery("#spider_popup_wrap").height()<jQuery(window).height()&&jQuery(".spider_popup_close").attr("class","bwg_ctrl_btn spider_popup_close_fullscreen");var t=gallery_box_data.bwg_ctrl_btn_container_height;"bottom"==gallery_box_data.lightbox_ctrl_btn_pos&&jQuery(".bwg_toggle_container i").hasClass("bwg-icon-caret-down")&&jQuery(".bwg_toggle_container").css("bottom",t+"px"),"top"==gallery_box_data.lightbox_ctrl_btn_pos&&jQuery(".bwg_toggle_container i").hasClass("bwg-icon-caret-up")&&jQuery(".bwg_toggle_container").css("top",t+"px")}function bwg_rating(e,t,i,a){lightbox_rate_stars_count=gallery_box_data.lightbox_rate_stars_count,lightbox_rate_size=gallery_box_data.lightbox_rate_size,lightbox_rate_icon=gallery_box_data.lightbox_rate_icon;var r="Not rated yet.";0!=i&&""!=i&&(r=parseFloat(i).toFixed(1)+"\n Votes: "+t),void 0!==jQuery().raty&&jQuery.isFunction(jQuery().raty)&&jQuery("#bwg_star").raty({score:function(){return jQuery(this).attr("data-score")},starType:"i",number:lightbox_rate_stars_count,size:lightbox_rate_size,readOnly:function(){return!!e},noRatedMsg:"Not rated yet.",click:function(t,e){jQuery("#bwg_star").hide(),jQuery("#bwg_rated").show(),spider_set_input_value("rate_ajax_task","save_rate"),jQuery.when(spider_rate_ajax_save("bwg_rate_form")).then(function(){gallery_box_data.data[a].rate=t,++gallery_box_data.data[a].rate_count;var e=parseFloat(jQuery("#bwg_star").attr("data-score"));gallery_box_data.data[a].avg_rating=e?((e+t)/2).toFixed(1):t.toFixed(1),bwg_rating(gallery_box_data.data[a].rate,gallery_box_data.data[a].rate_count,gallery_box_data.data[a].avg_rating,gallery_box_data.current_image_key)})},starHalf:"bwg-icon-"+lightbox_rate_icon+("star"==lightbox_rate_icon?"-half":"")+"-o",starOff:"bwg-icon-"+lightbox_rate_icon+"-o",starOn:"bwg-icon-"+lightbox_rate_icon,cancelOff:"bwg-icon-minus-square-o",cancelOn:"bwg-icon-minus-square-o",cancel:!1,cancelHint:"Cancel your rating.",hints:[r,r,r,r,r],alreadyRatedMsg:parseFloat(i).toFixed(1)+"\nYou have already rated.\nVotes: "+t})}function changeDownloadsTotal(e){var t=0;0==jQuery("[name=option_show_digital_items_count]").val()?jQuery("[name=selected_download_item]:checked").each(function(){t+=Number(jQuery(this).closest("tr").attr("data-price"))}):jQuery(".digital_image_count").each(function(){0!=Number(jQuery(this).val())&&(t+=Number(jQuery(this).closest("tr").attr("data-price"))*Number(jQuery(this).val()))}),t=t.toFixed(2).toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1,"),jQuery(".product_downloads_price").html(t)}function changeMenualTotal(e){Number(jQuery(e).val())<=0&&jQuery(e).val("1");var t=Number(jQuery(e).val()),i=Number(jQuery(".product_manual_price").attr("data-actual-price"));i=(i*=t).toFixed(2).toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1,"),jQuery(".product_manual_price").html(i)}function onSelectableParametersChange(e){var t=0,i=gallery_box_data.data[jQuery("#bwg_current_image_key").val()].pricelist_manual_price?gallery_box_data.data[jQuery("#bwg_current_image_key").val()].pricelist_manual_price:"0";i=parseFloat(i.replace(",",""));var a=jQuery(e).closest(".image_selected_parameter").attr("data-parameter-type"),r=jQuery(e).val();r=r.split("*");var _=parseFloat(r[1]),s=r[0],o=Number(jQuery(e).closest(".image_selected_parameter").find(".already_selected_values").val());if("4"==a||"5"==a){var l=parseFloat(s+_);jQuery(e).closest(".image_selected_parameter").find(".already_selected_values").val(l)}else if("6"==a){if(0==jQuery(e).is(":checked"))var n=o-parseFloat(s+_);else n=o+parseFloat(s+_);jQuery(e).closest(".image_selected_parameter").find(".already_selected_values").val(n)}jQuery(".already_selected_values").each(function(){t+=Number(jQuery(this).val())}),i+=t,jQuery(".product_manual_price").attr("data-actual-price",i),i=(i*=Number(jQuery(".image_count").val())<=0?1:Number(jQuery(".image_count").val())).toFixed(2).toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1,"),jQuery(".product_manual_price").html(i)}function onBtnClickAddToCart(){var e=jQuery("[name=type]").val();if(""!=e){var t={};if("manual"==e){var i=jQuery(".image_count").val(),a={};jQuery(".manual").find(".image_selected_parameter").each(function(){var e=jQuery(this).attr("data-parameter-id"),t="";switch(jQuery(this).attr("data-parameter-type")){case"2":t=jQuery(this).find("input").val();break;case"3":t=jQuery(this).find("textarea").val();break;case"4":t=jQuery(this).find("select :selected").val();break;case"5":t=jQuery(this).find("[type=radio]:checked").val();break;case"6":var i=[];jQuery(this).find("[type=checkbox]:checked").each(function(){i.push(jQuery(this).val())}),t=i}a[e]=t}),t.count=i,t.parameters=a,t.price=jQuery(".product_manual_price").attr("data-price").replace(",","")}else{var r=[];if(0==jQuery("[name=option_show_digital_items_count]").val()){if(0==jQuery("[name=selected_download_item]:checked").length)return void jQuery(".add_to_cart_msg").html("You must select at least one item.");jQuery("[name=selected_download_item]:checked").each(function(){var e={};e.id=jQuery(this).val(),e.count=1,e.price=jQuery(this).closest("tr").attr("data-price"),r.push(e)})}else jQuery(".digital_image_count").each(function(){var e={};0<jQuery(this).val()&&(e.id=jQuery(this).closest("tr").attr("data-id"),e.price=jQuery(this).closest("tr").attr("data-price"),e.count=jQuery(this).val(),r.push(e))});if(0==(t.downloadItems=r).length)return void jQuery(".add_to_cart_msg").html("Please select at least one item")}var _=jQuery("#ajax_url").val(),s={action:"add_cart",task:"add_cart",controller:"checkout",image_id:jQuery("#bwg_popup_image").attr("image_id"),type:e,data:JSON.stringify(t)};jQuery.ajax({type:"POST",url:_,data:s,success:function(e){responseData=JSON.parse(e),jQuery(".add_to_cart_msg").html(responseData.msg),jQuery(".products_in_cart").html(responseData.products_in_cart),1==responseData.redirect&&(window.location.href="<?php echo get_permalink($options->checkout_page);?>")},beforeSend:function(){},complete:function(){}})}else jQuery(".add_to_cart_msg").html("Please select Prints and products or Downloads")}function onBtnViewCart(){var e=jQuery("[name=option_checkout_page]").val();jQuery("#bwg_ecommerce_form").attr("action",e),jQuery("#bwg_ecommerce_form").submit()}function bwg_load_visible_images(e,t,i){0<=e-t&&(startPoint=e-t),i<e+t&&(endPoint=i);for(var a=startPoint;a<=endPoint;a++){var r=jQuery("#bwg_filmstrip_thumbnail_"+a+" img");r.removeClass("hidden"),r.attr("src",r.data("url"))}}function bwg_load_filmstrip(){for(var e=1;e<=total_thumbnail_count;e++){var t;if(leftIndex=startPoint-e,rightIndex=endPoint+e,rightIndex<total_thumbnail_count)(t=jQuery("#bwg_filmstrip_thumbnail_"+rightIndex+" img")).removeClass("hidden"),t.attr("src",t.data("url"));if(0<=leftIndex)(t=jQuery("#bwg_filmstrip_thumbnail_"+leftIndex+" img")).removeClass("hidden"),t.attr("src",t.data("url"))}jQuery(".bwg_filmstrip_thumbnail").each(function(){var e=jQuery(this).find("img");void 0===e.attr("style")&&(0==e.width()?e.on("load",function(){jQuery(this).find(".bwg_filmstrip_thumbnail_img_wrap"),bwg_filmstrip_thumb_view(e)}):(jQuery(this).find(".bwg_filmstrip_thumbnail_img_wrap"),bwg_filmstrip_thumb_view(e)))})}function bwg_filmstrip_thumb_view(e){var t=gallery_box_data.image_filmstrip_height,i=gallery_box_data.image_filmstrip_width,a=i-gallery_box_data.filmstrip_thumb_right_left_space,r=t,_=Math.max(i/e.width(),t/e.height()),s=e.width()*_,o=e.height()*_;e.css({width:s,height:o,marginLeft:(a-s)/2,marginTop:(r-o)/2})}function bwg_info_height_set(){bwg_info_position(!1),jQuery(".mCustomScrollBox").length&&jQuery(".bwg_image_info_container1").height()<jQuery(".mCustomScrollBox").height()+jQuery(".bwg_toggle_container").height()+bwg_image_info_pos+2*parseInt(gallery_box_data.lightbox_info_margin)&&jQuery(".bwg_image_info").css({height:jQuery(".bwg_image_info_container1").height()-jQuery(".bwg_toggle_container").height()-bwg_image_info_pos-2*parseInt(gallery_box_data.lightbox_info_margin)})}function bwg_info_position(e){var t=0,i="none";"top"==gallery_box_data.lightbox_ctrl_btn_pos?"top"==gallery_box_data.lightbox_info_pos&&(i="top"):"bottom"==gallery_box_data.lightbox_info_pos&&(i="bottom"),jQuery(".bwg_ctrl_btn_container").hasClass("closed")||("top"==gallery_box_data.lightbox_ctrl_btn_pos?"top"==gallery_box_data.lightbox_info_pos&&(t=jQuery(".bwg_ctrl_btn_container").height()):"bottom"==gallery_box_data.lightbox_info_pos&&(t=jQuery(".bwg_ctrl_btn_container").height())),"top"==i?0==e?jQuery(".bwg_image_info").css("top",t):jQuery(".bwg_image_info").animate({top:t+"px"},500):"bottom"==i&&(0==e?jQuery(".bwg_image_info").css("bottom",t):jQuery(".bwg_image_info").animate({bottom:t+"px"},500))}function spider_display_embed(e,t,i,a){var r="";switch(e){case"EMBED_OEMBED_YOUTUBE_VIDEO":var _="<iframe ";for(attr in""!=i&&(_+=' src="//www.youtube.com/embed/'+i+'?enablejsapi=1&wmode=transparent"'),a)/src/i.test(attr)||""!=attr&&""!=a[attr]&&(_+=" "+attr+'="'+a[attr]+'"');r+=_+=" ></iframe>";break;case"EMBED_OEMBED_VIMEO_VIDEO":var s="<iframe ";for(attr in""!=i&&(s+=' src="//player.vimeo.com/video/'+i+'?enablejsapi=1"'),a)/src/i.test(attr)||""!=attr&&""!=a[attr]&&(s+=" "+attr+'="'+a[attr]+'"');r+=s+=" ></iframe>";break;case"EMBED_OEMBED_FLICKR_IMAGE":var o="<div ";for(attr in a)/src/i.test(attr)||""!=attr&&""!=a[attr]&&(o+=" "+attr+'="'+a[attr]+'"');o+=" >",""!=i&&(o+='<img src="'+i+'" style="max-width:100% !important; max-height:100% !important; width:auto !important; height:auto !important;">'),r+=o+="</div>";break;case"EMBED_OEMBED_FLICKR_VIDEO":break;case"EMBED_OEMBED_INSTAGRAM_VIDEO":var l="<div ";for(attr in a)/src/i.test(attr)||""!=attr&&""!=a[attr]&&(l+=" "+attr+'="'+a[attr]+'"');l+=" >",""!=i&&(l+='<video style="width:auto !important; height:auto !important; max-width:100% !important; max-height:100% !important; margin:0 !important;" controls><source src="'+i+'" type="video/mp4"> Your browser does not support the video tag. </video>'),r+=l+="</div>";break;case"EMBED_OEMBED_INSTAGRAM_IMAGE":l="<div ";for(attr in a)/src/i.test(attr)||""!=attr&&""!=a[attr]&&(l+=" "+attr+'="'+a[attr]+'"');l+=" >",""!=i&&(l+='<img src="//instagram.com/p/'+i+'/media/?size=l" style=" max-width:100% !important; max-height:100% !important; width:auto; height:auto;">'),r+=l+="</div>";break;case"EMBED_OEMBED_INSTAGRAM_POST":l="<div ";for(attr in a)/src/i.test(attr)||""!=attr&&""!=a[attr]&&(l+=" "+attr+'="'+a[attr]+'"',"CLASS"!=attr&&"class"!=attr&&"Class"!=attr||(obj_class=a[attr]));l+=" >",""!=i&&(l+='<iframe class="inner_instagram_iframe_'+obj_class+'" src="//instagr.am/p/'+i+'/embed/?enablejsapi=1" style="max-width:100% !important; max-height:100% !important; width:100%; height:100%; margin:0; display:table-cell; vertical-align:middle;"frameborder="0" scrolling="no" allowtransparency="false" allowfullscreen></iframe>'),r+=l+="</div>";break;case"EMBED_OEMBED_FACEBOOK_IMAGE":var n="<span ";for(attr in a)/src/i.test(attr)||""!=attr&&""!=a[attr]&&(n+=" "+attr+'="'+a[attr]+'"');n+=" >",""!=i&&(n+='<img src="'+t+'" style=" max-width:100% !important; max-height:100% !important; width:auto; height:100%;">'),r+=n+="</span>";break;case"EMBED_OEMBED_FACEBOOK_VIDEO":var g="<div ";for(attr in a)/src/i.test(attr)||""!=attr&&""!=a[attr]&&(g+=" "+attr+'="'+a[attr]+'"');g+=" >",""!=i&&(g+='<iframe src="//www.facebook.com/video/embed?video_id='+t+'&enablejsapi=1&wmode=transparent" style="max-width:100% !important; max-height:100% !important; width:100%; height:100%; margin:0; display:table-cell; vertical-align:middle;"frameborder="0" class="bwg_fb_video" scrolling="no" allowtransparency="false" allowfullscreen></iframe>'),r+=g+="</div>";break;case"EMBED_OEMBED_DAILYMOTION_VIDEO":var w="<iframe ";for(attr in""!=i&&(w+=' src="//www.dailymotion.com/embed/video/'+i+'?api=postMessage"'),a)/src/i.test(attr)||""!=attr&&""!=a[attr]&&(w+=" "+attr+'="'+a[attr]+'"');r+=w+=" ></iframe>";break;case"EMBED_OEMBED_IMGUR":var b="<div ";for(attr in a)/src/i.test(attr)||""!=attr&&""!=a[attr]&&(l+=" "+attr+'="'+a[attr]+'"');b+=" >",""!=i&&(b+='<img src="'+i+'" style="max-width:100% !important; max-height:100% !important; width:auto; height:auto !important;">'),r+=b+="</div>";break;case"EMBED_OEMBED_GOOGLE_PHOTO_IMAGE":var u="<div ";for(attr in a)/src/i.test(attr)||""!=attr&&""!=a[attr]&&(u+=" "+attr+'="'+a[attr]+'"');u+=" >",""!=i&&(u+='<img src="'+t+'" style=" max-width:100% !important; max-height:100% !important; width:auto; height:auto;">'),r+=u+="</div>";break;default:var d={content:""};jQuery(document).trigger("bwg_display_embed",[d,e,t,i,a]),r=d.content}return r}function bwg_add_instagram_gallery(e,s){if(!0===(s=void 0!==s&&s)){if(bwg_check_instagram_gallery_input(e,s))return!1;var t="0";1==jQuery("input[name=popup_instagram_post_gallery]:checked").val()&&(t="1");var i=encodeURI(jQuery("#popup_instagram_gallery_source").val()),a=encodeURI(jQuery("#popup_instagram_image_number").val())}else{if(bwg_check_instagram_gallery_input(e,s))return!1;if(!bwg_check_gallery_empty(!1,!0))return!1;t="0";1==jQuery("input[name=instagram_post_gallery]:checked").val()&&(t="1");i=encodeURI(jQuery("#gallery_source").val());var r=jQuery("input[name=update_flag]:checked").val();a=encodeURI(jQuery("#autogallery_image_number").val())}jQuery("#bulk_embed").hide(),jQuery("#loading_div").show();var o=[],_={action:"addInstagramGallery",instagram_user:i,instagram_access_token:e,whole_post:t,autogallery_image_number:a,update_flag:r,async:!0};jQuery.post(ajax_url,_,function(e){if(0==e)return alert("Error: cannot get response from the server."),jQuery("#loading_div").hide(),s&&jQuery("#bulk_embed").show(),!1;var t=e.indexOf("WD_delimiter_start"),i=e.indexOf("WD_delimiter_end");if(-1==t||-1==i)return jQuery("#loading_div").hide(),s&&jQuery("#bulk_embed").show(),!1;if(e=e.substring(t+18,i),response_JSON=jQuery.parseJSON(e),response_JSON){if("error"==response_JSON[0])return alert("Error: "+jQuery.parseJSON(e)[1]),jQuery("#loading_div").hide(),s&&jQuery("#bulk_embed").show(),!1;for(var a=response_JSON.length,r=1;r<=a;r++)if(0!=response_JSON[a-r]){var _=response_JSON[a-r];o.push(_)}return bwg_add_image(o),s||(bwg_gallery_update_flag(),jQuery("#tr_instagram_gallery_add_button").hide()),jQuery("#loading_div").hide(),s&&jQuery(".opacity_bulk_embed").hide(),"ok"}return alert("There is some error. Cannot add Instagram gallery."),jQuery("#loading_div").hide(),s&&jQuery("#bulk_embed").show(),!1})}var bwg=0,isMobile=/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()),bwg_click=isMobile?"touchend":"click",bwg_params=[],bwg_params_ib=[],bwg_params_carousel=[];function bwg_main_ready(){1==bwg_objectsL10n.lazy_load&&jQuery(function(){jQuery("img.bwg_lazyload").lazy({onFinishedAll:function(){jQuery(".lazy_loader").removeClass("lazy_loader")}})}),jQuery(".bwg_container").each(function(){0<jQuery(this).find(".wd_error").length&&bwg_container_loaded(jQuery(this).data("bwg"))}),bwg_document_ready(),jQuery(".bwg-thumbnails, .bwg-masonry-thumbnails, .bwg-album-thumbnails").each(function(){bwg_all_thumnails_loaded(this)}),jQuery(".bwg-mosaic-thumbnails").each(function(){bwg_thumbnail_mosaic(this)}),bwg_slideshow_ready(),bwg_carousel_ready(),bwg_carousel_onload(),bwg_image_browser_ready()}function bwg_resize_search_line(){jQuery(".search_line").each(function(){var e=jQuery(this);e.width()<410?e.addClass("bwg-search-line-responsive"):e.removeClass("bwg-search-line-responsive")})}function bwg_slideshow_resize(){jQuery(".bwg_slideshow").each(function(){bwg=jQuery(this).attr("data-bwg"),jQuery("#bwg_slideshow_image_container_"+bwg).length&&(bwg_params[bwg]=JSON.parse(jQuery("#bwg_slideshow_image_container_"+bwg).attr("data-params")),bwg_params[bwg].event_stack=[],bwg_popup_resize(bwg))})}function bwg_blog_style_resize(){jQuery(".bwg_blog_style").each(function(){bwg=jQuery(this).attr("data-bwg"),jQuery(".bwg_embed_frame_16x9_"+bwg).each(function(e){jQuery(this).width(jQuery(this).parent().width()),jQuery(this).height(.5625*jQuery(this).width())}),jQuery(".bwg_embed_frame_instapost_"+bwg).each(function(e){jQuery(this).width(jQuery(this).parent().width()),jQuery(this).height((jQuery(this).width()-16)*jQuery(this).attr("data-height")/jQuery(this).attr("data-width")+96)})})}function bwg_blog_style_onload(){jQuery(".bwg_blog_style").each(function(){bwg=jQuery(this).attr("data-bwg");jQuery("#bwg_blog_style_"+bwg);jQuery(".bwg_embed_frame_16x9_"+bwg).each(function(e){if(jQuery(".bwg_blog_style_image_"+bwg).find(".fluid-width-video-wrapper").length){jQuery(".fluid-width-video-wrapper").removeAttr("style");var t=jQuery(this).parents(".bwg_blog_style_image_"+bwg).find(".fluid-width-video-wrapper").contents();jQuery(this).parents(".fluid-width-video-wrapper").replaceWith(t)}jQuery(this).width(jQuery(this).parents(".bwg_blog_style_image_"+bwg).width()),jQuery(this).height(.5625*jQuery(this).width())}),jQuery(".bwg_embed_frame_instapost_"+bwg).each(function(e){jQuery(this).width(jQuery(this).parents(".bwg_blog_style_image_"+bwg).width()),jQuery(this).height((jQuery(this).width()-16)*jQuery(this).attr("data-height")/jQuery(this).attr("data-width")+96)}),bwg_container_loaded(bwg)})}function bwg_blog_style_ready(){jQuery(".bwg_blog_style").each(function(){var e=jQuery(this).attr("data-bwg");bwg_container_loaded(e);var t=!1;jQuery(this).find(".bwg_lightbox_"+e).on("click",function(){var e=jQuery(this).attr("data-image-id");if(jQuery("#bwg_blog_style_share_buttons_"+e).removeAttr("data-open-comment"),!t)return t=!0,setTimeout(function(){t=!1},100),bwg_gallery_box(e,jQuery(this).closest(".bwg_container")),!1}),jQuery(".bwg_lightbox_"+e+" .bwg_ecommerce").on("click",function(e){if(e.stopPropagation(),!t)return t=!0,setTimeout(function(){t=!1},100),bwg_gallery_box(jQuery(this).attr("data-image-id"),jQuery(this).closest(".bwg_container"),!0),!1});var i=window.location.hash.substring(1);i&&"-1"!=i.indexOf("bwg")&&(bwg_hash_array=i.replace("bwg","").split("/"),"<?php echo $params_array['gallery_id']; ?>"==bwg_hash_array[0]&&bwg_gallery_box(bwg_hash_array[1]))})}function bwg_slideshow_focus(){jQuery(".bwg_slideshow").each(function(){bwg=jQuery(this).attr("data-bwg"),jQuery("#bwg_slideshow_image_container_"+bwg).length&&(bwg_params[bwg]=JSON.parse(jQuery("#bwg_slideshow_image_container_"+bwg).attr("data-params")),bwg_params[bwg].event_stack=[],window.clearInterval(window["bwg_playInterval"+bwg]),jQuery(".bwg_ctrl_btn_"+bwg).hasClass("bwg-icon-play")||bwg_play(bwg_params[bwg].data,bwg))})}function bwg_slideshow_blur(){jQuery(".bwg_slideshow").each(function(){bwg=jQuery(this).attr("data-bwg"),jQuery("#bwg_slideshow_image_container_"+bwg).length&&(bwg_params[bwg]=JSON.parse(jQuery("#bwg_slideshow_image_container_"+bwg).attr("data-params")),bwg_params[bwg].event_stack=[],window.clearInterval(window["bwg_playInterval"+bwg]))})}function bwg_carousel_ready(){jQuery(".bwg-carousel").each(function(){var t=jQuery(this).data("bwg");bwg_params_carousel[t]=[],bwg_params_carousel[t].bwg_currentCenterNum=1,bwg_params_carousel[t].bwg_currentlyMoving=!1,bwg_params_carousel[t].data=[],jQuery("#spider_carousel_left-ico_"+t).on("click",function(){bwg_params_carousel[t].carousel.prev()}),jQuery("#spider_carousel_right-ico_"+t).on("click",function(){bwg_params_carousel[t].carousel.next()}),parseInt(bwg_params_carousel[t].carousel_enable_autoplay)&&(jQuery(".bwg_carousel_play_pause_"+t).attr("title",bwg_objectsL10n.pause),jQuery(".bwg_carousel_play_pause_"+t).attr("class","bwg-icon-pause bwg_ctrl_btn_"+t+" bwg_carousel_play_pause_"+t)),jQuery(".bwg_carousel_play_pause_"+t).on(bwg_click,function(e){jQuery(".bwg_ctrl_btn_"+t).hasClass("bwg-icon-play")?(jQuery(".bwg_carousel_play_pause_"+t).attr("title",bwg_objectsL10n.pause),jQuery(".bwg_carousel_play_pause_"+t).attr("class","bwg-icon-pause bwg_ctrl_btn_"+t+" bwg_carousel_play_pause_"+t),bwg_params_carousel[t].bwg_currentlyMoving=!1,bwg_params_carousel[t].carousel.start()):(jQuery(".bwg_carousel_play_pause_"+t).attr("title",bwg_objectsL10n.play),jQuery(".bwg_carousel_play_pause_"+t).attr("class","bwg-icon-play bwg_ctrl_btn_"+t+" bwg_carousel_play_pause_"+t),bwg_params_carousel[t].bwg_currentlyMoving=!0,bwg_params_carousel[t].carousel.pause()),e.stopPropagation(),e.stopImmediatePropagation()}),void 0!==jQuery().swiperight&&jQuery.isFunction(jQuery().swiperight)&&jQuery("#bwg_container1_"+t).swiperight(function(){bwg_params_carousel[t].carousel.prev()}),void 0!==jQuery().swipeleft&&jQuery.isFunction(jQuery().swipeleft)&&jQuery("#bwg_container1_"+t).swipeleft(function(){bwg_params_carousel[t].carousel.next()})})}function bwg_carousel_resize(){jQuery(".bwg-carousel").each(function(){var e=jQuery(this).data("bwg");bwg_carousel_params(e),bwg_params_carousel[e].carousel.pause(),bwg_carousel_watermark(e),jQuery(".bwg_ctrl_btn_"+e).hasClass("bwg-icon-play")||bwg_params_carousel[e].carousel.start()})}function bwg_carousel_onload(){jQuery(".bwg-carousel").each(function(){var e=jQuery(this).data("bwg");bwg_params_carousel[e]=jQuery(this).data("params"),bwg_carousel_watermark(e),bwg_carousel_params(e),bwg_container_loaded(e)})}function bwg_carousel_params(t){var e=jQuery("#bwg_container1_"+t).parent().width(),i=1;e<bwg_params_carousel[t].carousel_r_width?i=e/bwg_params_carousel[t].carousel_r_width:e=bwg_params_carousel[t].carousel_r_width,bwg_params_carousel[t].carousel_image_column_number>bwg_params_carousel[t].count&&(bwg_params_carousel[t].carousel_image_column_number=bwg_params_carousel[t].count),jQuery(".bwg_carousel_play_pause_"+t).css({display:parseInt(bwg_params_carousel[t].carousel_play_pause_butt)?"":"none"}),parseInt(bwg_params_carousel[t].carousel_prev_next_butt)?(jQuery("#bwg_carousel-right"+t).css({display:""}),jQuery("#bwg_carousel-left"+t).css({display:""})):(jQuery("#bwg_carousel-left"+t).css({display:"none"}),jQuery("#bwg_carousel-right"+t).css({display:"none"})),jQuery(".inner_instagram_iframe_bwg_embed_frame_"+t).each(function(){var e=jQuery(this).parent();bwg_params_carousel[t].image_height/(parseInt(e.attr("data-height"))+96)<bwg_params_carousel[t].image_width/parseInt(e.attr("data-width"))?(e.height(bwg_params_carousel[t].image_height*i),e.width((e.height()-96)*e.attr("data-width")/e.attr("data-height")+16)):(e.width(bwg_params_carousel[t].image_width*i),e.height((e.width()-16)*e.attr("data-height")/e.attr("data-width")+96))}),jQuery(".bwg_carousel_image_container_"+t).css({width:bwg_params_carousel[t].image_width*i,height:bwg_params_carousel[t].image_height*i}),jQuery(".bwg_carousel_watermark_text_"+t+", .bwg_carousel_watermark_text_"+t+":hover").css({fontSize:e*(bwg_params_carousel[t].watermark_font_size/bwg_params_carousel[t].image_width)*i}),jQuery(".bwg_carousel-image "+t).css({width:bwg_params_carousel[t].image_width*i,height:bwg_params_carousel[t].image_height*i}),jQuery(".bwg_carousel_watermark_container_"+t).css({width:bwg_params_carousel[t].image_width*i,height:bwg_params_carousel[t].image_height*i}),jQuery(".bwg_carousel_embed_video_"+t).css({width:bwg_params_carousel[t].image_width*i,height:bwg_params_carousel[t].image_height*i}),jQuery(".bwg_carousel_watermark_spun_"+t).css({width:bwg_params_carousel[t].image_width*i,height:bwg_params_carousel[t].image_height*i}),jQuery(".bwg_carousel-container"+t).css({width:e,height:bwg_params_carousel[t].image_height*i}),jQuery(".bwg_video_hide"+t).css({width:bwg_params_carousel[t].image_width*i,height:bwg_params_carousel[t].image_height*i}),bwg_params_carousel[t].carousel=jQuery("#bwg_carousel"+t).featureCarousel({containerWidth:e*i,containerHeight:bwg_params_carousel[t].image_height*i,fit_containerWidth:bwg_params_carousel[t].carousel_fit_containerWidth,largeFeatureWidth:bwg_params_carousel[t].image_width*i,largeFeatureHeight:bwg_params_carousel[t].image_height*i,smallFeaturePar:bwg_params_carousel[t].carousel_image_par,currentlyMoving:!1,startingFeature:bwg_params_carousel[t].bwg_currentCenterNum,featuresArray:[],timeoutVar:null,rotationsRemaining:0,autoPlay:1e3*bwg_params_carousel[t].car_inter,interval:1e3*bwg_params_carousel[t].carousel_interval,imagecount:bwg_params_carousel[t].carousel_image_column_number,bwg_number:t,enable_image_title:bwg_params_carousel[t].enable_image_title,borderWidth:0})}function bwg_carousel_watermark(e){var t=1,i=jQuery("#bwg_container1_"+e).parent().width();if(i<bwg_params_carousel[e].carousel_r_width&&(t=i/bwg_params_carousel[e].carousel_r_width),i>=bwg_params_carousel[e].image_width)bwg_carousel_change_watermark_container(e),jQuery("#bwg_carousel_play_pause-ico_"+e).css({fontSize:bwg_params_carousel[e].carousel_play_pause_btn_size}),jQuery(".bwg_carousel_watermark_image_"+e).css({maxWidth:bwg_params_carousel[e].watermark_width*t,maxHeight:bwg_params_carousel[e].watermark_height*t}),jQuery(".bwg_carousel_watermark_text_"+e+", .bwg_carousel_watermark_text_"+e+":hover").css({fontSize:t*bwg_params_carousel[e].watermark_font_size});else{var a=bwg_params_carousel[e].image_width/t;bwg_carousel_change_watermark_container(e),jQuery("#bwg_carousel_play_pause-ico_"+e).css({fontSize:i*bwg_params_carousel[e].carousel_play_pause_btn_size/a}),jQuery(".bwg_carousel_watermark_image_"+e).css({maxWidth:i*bwg_params_carousel[e].watermark_width/a,maxHeight:i*bwg_params_carousel[e].watermark_height/a}),jQuery(".bwg_carousel_watermark_text_"+e+", .bwg_carousel_watermark_text_"+e+":hover").css({fontSize:i*bwg_params_carousel[e].watermark_font_size/a})}}function bwg_carousel_change_watermark_container(a){jQuery(".bwg_carousel"+a).children().each(function(){if(2==jQuery(this).css("zIndex")){var e=jQuery(this).find("img");e.length||(e=jQuery(this).find("iframe"));var t=e.width(),i=e.height();jQuery(".bwg_carousel_watermark_spun_"+a).width(t),jQuery(".bwg_carousel_watermark_spun_"+a).height(i),jQuery(".bwg_carousel_title_spun_"+a).width(t),jQuery(".bwg_carouel_title_spun_"+a).height(i),jQuery(".bwg_carousel_watermark_"+a).css({display:"none"})}})}function bwg_carousel_preload(e,t){var i=jQuery(".bwg_carousel_preload").get();t||i.reverse();var a=0;jQuery(i).each(function(){if(1<++a)return!1;jQuery(this).parent().hasClass("bwg_carousel_embed_video_"+e)||jQuery(this).parent().hasClass("bwg_embed_frame_"+e)||jQuery(this).parent().hasClass("bwg_carousel_video")?(jQuery(this).attr("src",jQuery(this).attr("data-src")),jQuery(this).on("load",function(){jQuery(this).removeClass("bwg_carousel_preload")}),jQuery(this).parent().hasClass("bwg_carousel_video")&&(jQuery(".bwg_carousel_video")[0].load(),jQuery(this).parent().parent().removeClass("bwg_carousel_preload")),jQuery(this).removeAttr("data-src")):(jQuery(this).css({"background-image":"url('"+jQuery(this).attr("data-background")+"')",height:"100%"}),jQuery(this).removeClass("bwg_carousel_preload"),jQuery(this).removeAttr("data-background"))})}function bwg_slideshow_ready(){jQuery(".bwg_slideshow").each(function(){var i=jQuery(this).data("bwg");if(jQuery("#bwg_slideshow_image_container_"+i).length){bwg_params[i]=JSON.parse(jQuery("#bwg_slideshow_image_container_"+i).attr("data-params")),bwg_params[i].event_stack=[],bwg_container_loaded(i);var e=bwg_params[i].data;void 0!==jQuery().swiperight&&jQuery.isFunction(jQuery().swiperight)&&jQuery("#bwg_container1_"+i).swiperight(function(){return bwg_change_image(parseInt(jQuery("#bwg_current_image_key_"+i).val()),0<=parseInt(jQuery("#bwg_current_image_key_"+i).val())-bwg_iterator(i)?(parseInt(jQuery("#bwg_current_image_key_"+i).val())-bwg_iterator(i))%e.length:e.length-1,e,"",i),!1}),void 0!==jQuery().swipeleft&&jQuery.isFunction(jQuery().swipeleft)&&jQuery("#bwg_container1_"+i).swipeleft(function(){return bwg_change_image(parseInt(jQuery("#bwg_current_image_key_"+i).val()),parseInt(jQuery("#bwg_current_image_key_"+i).val())+bwg_iterator(i)%e.length,e,"",i),!1});var t=/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase())?"touchend":"click";bwg_popup_resize(i),jQuery(".bwg_slideshow_watermark_"+i).css({display:"none"}),jQuery(".bwg_slideshow_title_text_"+i).css({display:"none"}),jQuery(".bwg_slideshow_description_text_"+i).css({display:"none"}),setTimeout(function(){bwg_change_watermark_container(i)},500),"horizontal"==bwg_params[i].filmstrip_direction?jQuery(".bwg_slideshow_image_container_"+i).height(jQuery(".bwg_slideshow_image_wrap_"+i).height()-bwg_params[i].slideshow_filmstrip_height):jQuery(".bwg_slideshow_image_container_"+i).width(jQuery(".bwg_slideshow_image_wrap_"+i).width()-bwg_params[i].slideshow_filmstrip_width);var a=/Firefox/i.test(navigator.userAgent)?"DOMMouseScroll":"mousewheel";jQuery(".bwg_slideshow_filmstrip_"+i).bind(a,function(e){var t=window.event||e;return 0<((t=t.originalEvent?t.originalEvent:t).detail?-40*t.detail:t.wheelDelta)?jQuery(".bwg_slideshow_filmstrip_left_"+i).trigger("click"):jQuery(".bwg_slideshow_filmstrip_right_"+i).trigger("click"),!1}),jQuery(".bwg_slideshow_filmstrip_right_"+i).on(t,function(){jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).stop(!0,!1),"left"==bwg_params[i].left_or_top?"width"==bwg_params[i].width_or_height?(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).position().left>=-(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).width()-jQuery(".bwg_slideshow_filmstrip_"+i).width())&&(jQuery(".bwg_slideshow_filmstrip_left_"+i).css({opacity:1}),jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).position().left<-(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).width()-jQuery(".bwg_slideshow_filmstrip_"+i).width()-(parseInt(bwg_params[i].filmstrip_thumb_margin_hor)+parseInt(bwg_params[i].slideshow_filmstrip_width)))?jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).animate({left:-(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).width()-jQuery(".bwg_slideshow_filmstrip_"+i).width())},500,"linear"):jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).animate({left:jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).position().left-(parseInt(bwg_params[i].filmstrip_thumb_margin_hor)+parseInt(bwg_params[i].slideshow_filmstrip_width))},500,"linear")),window.setTimeout(function(){jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).position().left==-(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).width()-jQuery(".bwg_slideshow_filmstrip_"+i).width())&&jQuery(".bwg_slideshow_filmstrip_right_"+i).css({opacity:.3})},500)):(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).position().left>=-(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).height()-jQuery(".bwg_slideshow_filmstrip_"+i).height())&&(jQuery(".bwg_slideshow_filmstrip_left_"+i).css({opacity:1}),jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).position().left<-(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).height()-jQuery(".bwg_slideshow_filmstrip_"+i).height()-(parseInt(bwg_params[i].filmstrip_thumb_margin_hor)+parseInt(bwg_params[i].slideshow_filmstrip_width)))?jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).animate({left:-(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).height()-jQuery(".bwg_slideshow_filmstrip_"+i).height())},500,"linear"):jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).animate({left:jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).position().left-(parseInt(bwg_params[i].filmstrip_thumb_margin_hor)+parseInt(bwg_params[i].slideshow_filmstrip_width))},500,"linear")),window.setTimeout(function(){jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).position().left==-(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).height()-jQuery(".bwg_slideshow_filmstrip_"+i).height())&&jQuery(".bwg_slideshow_filmstrip_right_"+i).css({opacity:.3})},500)):"width"==bwg_params[i].width_or_height?(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).position().top>=-(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).width()-jQuery(".bwg_slideshow_filmstrip_"+i).width())&&(jQuery(".bwg_slideshow_filmstrip_left_"+i).css({opacity:1}),jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).position().top<-(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).width()-jQuery(".bwg_slideshow_filmstrip_"+i).width()-parseInt(bwg_params[i].filmstrip_thumb_margin_hor)+parseInt(bwg_params[i].slideshow_filmstrip_width))?jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).animate({top:-(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).width()-jQuery(".bwg_slideshow_filmstrip_"+i).width())},500,"linear"):jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).animate({top:jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).position().top-parseInt(bwg_params[i].filmstrip_thumb_margin_hor)+parseInt(bwg_params[i].slideshow_filmstrip_width)},500,"linear")),window.setTimeout(function(){jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).position().top==-(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).width()-jQuery(".bwg_slideshow_filmstrip_"+i).width())&&jQuery(".bwg_slideshow_filmstrip_right_"+i).css({opacity:.3})},500)):(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).position().top>=-(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).height()-jQuery(".bwg_slideshow_filmstrip_"+i).height())&&(jQuery(".bwg_slideshow_filmstrip_left_"+i).css({opacity:1}),jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).position().top<-(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).height()-jQuery(".bwg_slideshow_filmstrip_"+i).height()-(parseInt(bwg_params[i].filmstrip_thumb_margin_hor)+parseInt(bwg_params[i].slideshow_filmstrip_width)))?jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).animate({top:-(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).height()-jQuery(".bwg_slideshow_filmstrip_"+i).height())},500,"linear"):jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).animate({top:jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).position().top-(parseInt(bwg_params[i].filmstrip_thumb_margin_hor)+parseInt(bwg_params[i].slideshow_filmstrip_width))},500,"linear")),window.setTimeout(function(){jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).position().top==-(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).height()-jQuery(".bwg_slideshow_filmstrip_"+i).height())&&jQuery(".bwg_slideshow_filmstrip_right_"+i).css({opacity:.3})},500))}),jQuery(".bwg_slideshow_filmstrip_left_"+i).on(t,function(){jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).stop(!0,!1),"left"==bwg_params[i].left_or_top?(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).position().left<0&&(jQuery(".bwg_slideshow_filmstrip_right_"+i).css({opacity:1}),jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).position().left>-(bwg_params[i].filmstrip_thumb_margin_hor+bwg_params[i].slideshow_filmstrip_width)?jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).animate({left:0},500,"linear"):jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).animate({left:jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).position().left+parseInt(bwg_params[i].filmstrip_thumb_margin_hor)+parseInt(bwg_params[i].slideshow_filmstrip_width)},500,"linear")),window.setTimeout(function(){0==jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).position().left&&jQuery(".bwg_slideshow_filmstrip_left_"+i).css({opacity:.3})},500)):(jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).position().top<0&&(jQuery(".bwg_slideshow_filmstrip_right_"+i).css({opacity:1}),jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).position().top>-(bwg_params[i].filmstrip_thumb_margin_hor+bwg_params[i].slideshow_filmstrip_width)?jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).animate({top:0},500,"linear"):jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).animate({top:jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).position().top+parseInt(bwg_params[i].filmstrip_thumb_margin_hor)+parseInt(bwg_params[i].slideshow_filmstrip_width)},500,"linear")),window.setTimeout(function(){0==jQuery(".bwg_slideshow_filmstrip_thumbnails_"+i).position().top&&jQuery(".bwg_slideshow_filmstrip_left_"+i).css({opacity:.3})},500))}),"width"==bwg_params[i].width_or_height?bwg_set_filmstrip_pos(jQuery(".bwg_slideshow_filmstrip_"+i).width(),i):bwg_set_filmstrip_pos(jQuery(".bwg_slideshow_filmstrip_"+i).height(),i),jQuery("#bwg_slideshow_play_pause_"+i).off(t).on(t,function(){jQuery(".bwg_ctrl_btn_"+i).hasClass("bwg-icon-play")?(bwg_play(bwg_params[i].data,i),jQuery(".bwg_slideshow_play_pause_"+i).attr("title",bwg_objectsL10n.pause),jQuery(".bwg_slideshow_play_pause_"+i).attr("class","bwg-icon-pause bwg_ctrl_btn_"+i+" bwg_slideshow_play_pause_"+i),1==bwg_params[i].enable_slideshow_music&&document.getElementById("bwg_audio_"+i).play()):(window.clearInterval(window["bwg_playInterval"+i]),jQuery(".bwg_slideshow_play_pause_"+i).attr("title","Play"),jQuery(".bwg_slideshow_play_pause_"+i).attr("class","bwg-icon-play bwg_ctrl_btn_"+i+" bwg_slideshow_play_pause_"+i),1==bwg_params[i].enable_slideshow_music&&document.getElementById("bwg_audio_"+i).pause())}),0!=bwg_params[i].enable_slideshow_autoplay&&(bwg_play(bwg_params[i].data,i),jQuery(".bwg_slideshow_play_pause_"+i).attr("title",bwg_objectsL10n.pause),jQuery(".bwg_slideshow_play_pause_"+i).attr("class","bwg-icon-pause bwg_ctrl_btn_"+i+" bwg_slideshow_play_pause_"+i),1==bwg_params[i].enable_slideshow_music&&jQuery("#bwg_audio_"+i).length&&document.getElementById("bwg_audio_"+i).play()),bwg_params[i].preload_images&&bwg_preload_images(parseInt(jQuery("#bwg_current_image_key_".$bwg).val()),i),jQuery(".bwg_slideshow_image_"+i).removeAttr("width"),jQuery(".bwg_slideshow_image_"+i).removeAttr("height")}})}function bwg_image_browser_resize(){jQuery(".bwg_image_browser").each(function(){var e=jQuery(this).attr("data-bwg");jQuery(".image_browser_images_conteiner_"+e).length&&(bwg_params_ib[e]=JSON.parse(jQuery("#bwg_container1_"+e+" .image_browser_images_conteiner_"+e).attr("data-params")),bwg_image_browser(e))})}function bwg_image_browser_ready(){jQuery(".bwg_image_browser").each(function(){var e=jQuery(this).attr("data-bwg");bwg_container_loaded(e),jQuery(".image_browser_images_conteiner_"+e).length&&(bwg_params_ib[e]=JSON.parse(jQuery(".image_browser_images_conteiner_"+e).attr("data-params")),setTimeout(function(){bwg_image_browser(e)},3))})}function bwg_search_focus(e){jQuery(e).parent().find(".bwg_search_input").focus(),jQuery(e).hide()}function bwg_key_press(e){jQuery(e).parent().find(".bwg_search_reset_container").removeClass("hidden"),jQuery(e).parent().find(".bwg_search_loupe_container1").removeClass("hidden")}function bwg_all_thumnails_loaded(t){var i=0,a=jQuery(t).find("img").length;return 0==a?bwg_all_thumbnails_loaded_callback(t):jQuery(t).find("img").each(function(){var e=jQuery(this).attr("src");jQuery("<img/>").attr("src",e).on("load error",function(){++i>=a&&bwg_all_thumbnails_loaded_callback(t)})}),0==a}function bwg_all_thumbnails_loaded_callback(e){jQuery(e).hasClass("bwg-thumbnails")&&!jQuery(e).hasClass("bwg-masonry-thumbnails")&&bwg_thumbnail(e),jQuery(e).hasClass("bwg-masonry-thumbnails")&&bwg_thumbnail_masonry(e),jQuery(e).hasClass("bwg-album-extended")&&bwg_album_extended(e)}function bwg_container_loaded(e){jQuery("#gal_front_form_"+e).removeClass("bwg-hidden"),jQuery("#ajax_loading_"+e).addClass("bwg-hidden")}function bwg_album_thumbnail(e){bwg_container_loaded(jQuery(e).data("bwg"))}function bwg_album_extended(e){var t=jQuery(e).width(),i=jQuery(e).data("thumbnail-width"),a=jQuery(e).data("spacing"),r=jQuery(e).data("max-count"),_=parseInt(t/(2*i));_<1&&(_=1),r<_&&(_=r);var s=100/_,o=jQuery(e).find(".bwg-extended-item"),l=parseInt(o.css("margin-left")),n=parseInt(o.css("margin-right"));o.css({width:"calc("+s+"% - "+(l+n)+"px)"}),o.width()<i?o.find(".bwg-extended-item0, .bwg-extended-item1").css({width:"calc(100% - "+a+"px)"}):o.width()>2*i?(o.find(".bwg-extended-item0").css({width:"calc(50% - "+a+"px)"}),o.find(".bwg-extended-item1").css({width:"calc(100% - "+(i+2*a)+"px)"})):o.find(".bwg-extended-item0, .bwg-extended-item1").css({width:"calc(50% - "+a+"px)"}),jQuery(e).children(".bwg-extended-item").each(function(){var e=jQuery(this).find("img"),t=jQuery(this).find(".bwg-item0"),i=jQuery(this).find(".bwg-item2"),a=e.data("width"),r=e.data("height");""!=a&&""!=r||(a=e.width(),r=e.height());var _=a/r;i.width()/i.height()>a/r?(i.width()>a?e.css({width:"100%",height:i.width()/_}):e.css({maxWidth:"100%",height:i.width()/_}),a=i.width(),r=i.width()/_):(i.height()>r?e.css({height:"100%",width:i.height()*_,maxWidth:"initial"}):e.css({maxHeight:"100%",width:i.height()*_,maxWidth:"initial"}),r=i.height(),a=i.height()*_),jQuery(this).find(".bwg-item2").css({marginLeft:(t.width()-a)/2,marginTop:(t.height()-r)/2})}),bwg_container_loaded(jQuery(e).data("bwg"))}function bwg_thumbnail(e){var t=jQuery(e).width(),i=jQuery(e).data("thumbnail-width"),a=jQuery(e).data("max-count"),r=parseInt(t/i)+1;a<r&&(r=a);var _=100/r;jQuery(e).find(".bwg-item").css({width:_+"%"}),jQuery(e).children(".bwg-item").each(function(){var e=jQuery(this).find("img"),t=jQuery(this).find(".bwg-item2"),i=jQuery(this).find(".bwg-item1"),a=0<t.width()?t.width():i.width(),r=0<t.height()?t.height():i.height(),_=e.data("width"),s=e.data("height");""!=_&&""!=s&&void 0!==_&&void 0!==s||(_=e.width(),s=e.height());var o=_/s;e.removeAttr("style"),o<a/r?(_<a?e.css({width:"100%",height:a/o}):e.css({maxWidth:"100%",height:Math.ceil(a/o)}),s=(_=a)/o):(r>e.height()?e.css({height:"100%",width:r*o,maxWidth:"initial"}):e.css({maxHeight:"100%",width:r*o,maxWidth:"initial"}),_=(s=r)*o),jQuery(this).find(".bwg-item2").css({marginLeft:(a-_)/2,marginTop:(r-s)/2})}),bwg_container_loaded(jQuery(e).data("bwg"))}function bwg_thumbnail_masonry(e){var t=jQuery(e);if(t.find(".bwg-empty-item").remove(),"horizontal"==t.data("masonry-type")){var a=t.data("thumbnail-height"),r=t.data("max-count"),_=[];for(i=0;i<r;i++)_.push(0);t.find(".bwg-item").each(function(){var e=_.indexOf(Math.min.apply(Math,_));jQuery(this).css({height:a,order:e+1}),_[e]+=jQuery(this)[0].getBoundingClientRect().width});var s=Math.max.apply(Math,_);for(t.width(s),i=0;i<r;i++)_[i]<s&&t.append(jQuery('<div class="bwg-item bwg-empty-item"></div>').css({height:a,order:i+1,width:s-_[i]}))}else{t.removeAttr("style");s=t.width();var o=t.data("thumbnail-width"),l=(r=t.data("max-count"),parseInt(s/o)+("0"==t.data("resizable-thumbnails")?0:1));r<l&&(l=r);var n=t.find(".bwg-item").length;n<l&&(l=n);var g,w,b=100/l,u=[];for(i=0;i<l;i++)u.push(0);t.find(".bwg-item").each(function(){var e=u.indexOf(Math.min.apply(Math,u));if(jQuery(this).css({width:b+"%",order:e+1}),0<jQuery(this).find("img").attr("data-width").length&&0<jQuery(this).find("img").attr("data-height").length){w=jQuery(this).find("img").data("width")/jQuery(this).find("img").data("height"),g=jQuery(this).width()/w;var t=+(jQuery(this).find(".bwg-title1").height()+jQuery(this).find(".bwg-masonry-thumb-description").height());jQuery(this).height(g+t)}u[e]+=jQuery(this)[0].getBoundingClientRect().height});var d=Math.max.apply(Math,u);for(i=0;i<l;i++)u[i]<d&&t.append(jQuery('<div class="bwg-item bwg-empty-item"></div>').css({width:b+"%",order:i+1,height:d-u[i]}));t.outerWidth(l*o),t.height(d)}bwg_container_loaded(t.data("bwg"))}function bwg_thumbnail_mosaic_logic(e){var t=e.attr("data-bwg"),i=e.attr("data-block-id"),a=parseInt(e.attr("data-thumb-padding"))/2,r=parseInt(e.attr("data-thumb-border"))+a;if("horizontal"==e.attr("data-mosaic-direction")){var _=parseInt(e.attr("data-height"));if("1"==e.attr("data-resizable"))if(1920<=jQuery(window).width())var s=(1+jQuery(window).width()/1920)*_;else if(jQuery(window).width()<=640)s=jQuery(window).width()/640*_;else s=_;else s=_;(c=jQuery(".bwg_mosaic_thumb_"+t)).each(function(e){var t=jQuery(this).data("width"),i=jQuery(this).data("height");""!=t&&""!=i&&void 0!==t&&void 0!==i||(t=c.get(e).naturalWidth,i=c.get(e).naturalHeight),t=t*s/i,c.eq(e).height(s),c.eq(e).width(t)});var o=jQuery("#bwg_mosaic_thumbnails_div_"+t).width()/100*parseInt(e.attr("data-total-width"));jQuery("#"+i).width(o);var l=s+2*r,n=0,g=[];g[0]=0;var w=[],b=w[0]=0;c.each(function(e){row_cum_width2=b+c.eq(e).width()+2*r,row_cum_width2-o<0?(b=row_cum_width2,g[e]=n,w[n]++):e!==c.length-1?Math.abs(b-o)>Math.abs(row_cum_width2-o)||Math.abs(b-o)<=Math.abs(row_cum_width2-o)&&0==w[n]?e!==c.length-2?(b=row_cum_width2,g[e]=n,w[n]++,w[++n]=0,b=0):(b=row_cum_width2,g[e]=n,w[n]++):(w[++n]=1,g[e]=n,b=row_cum_width2-b):(b=row_cum_width2,g[e]=n,w[n]++)});for(var u=[],d=[],h=0;h<=n;h++)u[h]=1,d[h]=l;for(h=0;h<=n;h++)b=0,c.each(function(e){g[e]==h&&(b+=c.eq(e).width())}),u[h]=z=(o-2*w[h]*r)/b,d[h]=(l-2*r)*u[h]+2*r;(S=[])[0]=0;var m=[],p=[];m[0]=0,p[0]=0;for(h=1;h<=n;h++)m[h]=m[0],p[h]=p[h-1]+d[h-1];c.each(function(e){var t=c.eq(e).width(),i=c.eq(e).height();c.eq(e).width(t*u[g[e]]),c.eq(e).height(i*u[g[e]]),c.eq(e).parent().css({top:p[g[e]],left:m[g[e]]}),m[g[e]]+=t*u[g[e]]+2*r,S[g[e]]=e}),jQuery("#"+i).height(p[n]+d[n]-p[0])}else{var c,y=parseInt(e.attr("data-width"));if("1"==e.attr("data-resizable")){if(1920<=jQuery(window).width())var f=(1+jQuery(window).width()/1920)*y;else if(jQuery(window).width()<=640)f=jQuery(window).width()/640*y;else f=y;if(0<jQuery(".header-content-with_tab").length)f=jQuery(".header-content-with_tab").width()/4-10}else f=y;(c=jQuery(".bwg_mosaic_thumb_"+t)).each(function(e){var t=jQuery(this).data("width"),i=jQuery(this).data("height");""!=t&&""!=i&&void 0!==t&&void 0!==i||(t=c.get(e).naturalWidth,i=c.get(e).naturalHeight),c.eq(e).height(i*f/t),c.eq(e).width(f)});o=jQuery("#bwg_mosaic_thumbnails_div_"+t).width()/100*parseInt(e.attr("data-total-width"));jQuery("#"+i).width(o);var j=f+2*r<o?f:o-2*r,Q=Math.floor(o/(j+2*r)),v=[];v[0]=0;for(var x=[],k=[],z=0;z<Q;z++)k[z]=0,x[z]=0;c.each(function(e){for(var t=0,i=k[0],a=0;a<Q;a++)i>k[a]&&(i=k[a],t=a);v[e]=t,x[t]++,B=i,T=0+t*(j+2*r),c.eq(e).parent().css({top:B,left:T}),k[t]+=c.eq(e).height()+2*r}),(u=[])[0]=1;var C=0,I=[],E=0,O=0;for(z=0;z<Q;z++)C+=j,I[z]=0,c.each(function(e){v[e]==z&&(I[z]+=c.eq(e).height())}),0!=I[z]&&(E+=j/I[z],O+=j*x[z]*2*r/I[z]);var M=0;0!=E&&(M=(C+O)/E);for(z=0;z<Q;z++)0!=I[z]&&(u[z]=(M-2*x[z]*r)/I[z]);var S,T=[];T[0]=0;for(z=1;z<=Q;z++)T[z]=T[z-1]+j*u[z-1]+2*r;var B=[];for(z=0;z<Q;z++)B[z]=0;(S=[])[0]=0,c.each(function(e){var t=c.eq(e).width(),i=c.eq(e).height();c.eq(e).width(t*u[v[e]]),c.eq(e).height(i*u[v[e]]),c.eq(e).parent().css({top:B[v[e]],left:T[v[e]]}),B[v[e]]+=i*u[v[e]]+2*r,S[v[e]]=e}),jQuery("#"+i).width(T[Q]).height(B[0])}}function bwg_thumbnail_mosaic(e){var t=jQuery(e),i=jQuery.Deferred();if(i.done([bwg_thumbnail_mosaic_logic]).done(function(e){"1"!=e.data("mosaic-thumb-transition")&&jQuery(".bwg_mosaic_thumb_spun_"+t).css({transition:"all 0.3s ease 0s","-webkit-transition":"all 0.3s ease 0s"});var t=e.data("bwg");jQuery(".bwg_mosaic_thumbnails_"+t).css({visibility:"visible"}),jQuery(".tablenav-pages_"+t).css({visibility:"visible"}),bwg_container_loaded(t),jQuery(".bwg_mosaic_thumb_"+t).removeClass("bwg-hidden"),jQuery("#bwg_mosaic_thumbnails_div_"+t).removeClass("bwg-hidden")}),i.resolve(t),"hover"==t.attr("data-image-title")){var a=parseInt(t.attr("data-thumb-padding"))/2,r=parseInt(t.attr("data-thumb-border"))+a;bwg_mosaic_title_on_hover(bwg,t,r)}"hover"==t.attr("data-ecommerce-icon")&&(jQuery(".bwg_mosaic_thumb_spun_"+bwg).on("mouseenter",function(){var e=jQuery(this).parents(".bwg-mosaic-thumb-span").children(".bwg_mosaic_thumb_"+bwg).width(),t=jQuery(this).parents(".bwg-mosaic-thumb-span").children(".bwg_mosaic_thumb_"+bwg).height();jQuery(this).children(".bwg_ecommerce_spun1_"+bwg).width(e);var i=jQuery(this).children(".bwg_ecommerce_spun1_"+bwg).width(),a=jQuery(this).children(".bwg_ecommerce_spun1_"+bwg).height();jQuery(this).children(".bwg_ecommerce_spun1_"+bwg).css({top:r+.5*t-.5*a,left:r+.5*e-.5*i,opacity:1})}),jQuery(".bwg_mosaic_thumb_spun_"+bwg).on("mouseleave",function(){jQuery(this).children(".bwg_ecommerce_spun1_"+bwg).css({top:0,left:-1e4,opacity:0,padding:t.attr("data-title-margin")})}))}function bwg_mosaic_title_on_hover(r,e,_){jQuery(".bwg-mosaic-thumb-span").on("mouseenter",function(){var e=jQuery(this).children(".bwg_mosaic_thumb_"+r).width(),t=jQuery(this).children(".bwg_mosaic_thumb_"+r).height();jQuery(this).find(".bwg_mosaic_title_spun1_"+r).width(e);var i=jQuery(this).find(".bwg_mosaic_title_spun1_"+r).width(),a=jQuery(this).find(".bwg_mosaic_title_spun1_"+r).height();jQuery(this).find(".bwg_mosaic_title_spun1_"+r).css({top:_+.5*t-.5*a<0?_:_+.5*t-.5*a,left:_+.5*e-.5*i,opacity:1,"max-height":"calc(100% - "+2*_+"px)",overflow:"hidden"})}),jQuery(".bwg-mosaic-thumb-span").on("mouseleave",function(){jQuery(this).find(".bwg_mosaic_title_spun1_"+r).css({top:0,left:-1e4,opacity:0,padding:e.attr("data-title-margin"),"max-height":"calc(100% - "+2*_+"px)",overflow:"hidden"})})}function bwg_mosaic_ajax(e,t){var i=0;jQuery(".bwg_mosaic_thumb_spun_"+e+" img").on("load",function(){++i>=t&&bwg_thumbnail_mosaic(jQuery(".bwg-mosaic-thumbnails[data-bwg="+e+"]"))}),jQuery(".bwg_mosaic_thumb_spun_"+e+" img").on("error",function(){jQuery(this).height(100),jQuery(this).width(100),++i>=t&&bwg_thumbnail_mosaic(jQuery(".bwg-mosaic-thumbnails[data-bwg="+e+"]"))})}function bwg_add_album(){var t=!1;"1"!=bwg_objectsL10n.front_ajax&&jQuery(".bwg-album").off("click").on("click",function(){if(!t){var e=jQuery(this).attr("data-bwg");return t=!0,setTimeout(function(){t=!1},100),bwg_ajax("gal_front_form_"+e,e,jQuery(this).attr("data-container_id"),jQuery(this).attr("data-alb_gal_id"),jQuery(this).attr("data-album_gallery_id"),jQuery(this).attr("data-def_type"),"",jQuery(this).attr("data-title")),!1}}),jQuery(".bwg_description_more").on("click",function(){jQuery(this).hasClass("bwg_more")?(jQuery(this).parent().find(".bwg_description_full").show(),jQuery(this).addClass("bwg_hide").removeClass("bwg_more"),jQuery(this).html(jQuery(this).data("hide-msg"))):(jQuery(this).parent().find(".bwg_description_full").hide(),jQuery(this).addClass("bwg_more").removeClass("bwg_hide"),jQuery(this).html(jQuery(this).data("more-msg")))})}function bwg_add_lightbox(){var i=!1;jQuery(".bwg_lightbox .bwg-item0, .bwg_lightbox .bwg_slide, .bwg_lightbox .bwg-carousel-image, .bwg_lightbox .bwg-title1").on("click",function(e){e.stopPropagation(),e.preventDefault();var t=jQuery(this).closest("a");if(!i)return i=!0,setTimeout(function(){i=!1},100),bwg_gallery_box(jQuery(t).attr("data-image-id"),jQuery(t).closest(".bwg_container")),!1}),jQuery(".bwg_lightbox .bwg_ecommerce").on("click",function(e){if(e.stopPropagation(),!i)return i=!0,setTimeout(function(){i=!1},100),bwg_gallery_box(jQuery(this).closest(".bwg_lightbox").attr("data-image-id"),jQuery(this).closest(".bwg_container"),!0),!1})}function bwg_filter_by_tag(e){var t="",i=jQuery(e).parent().parent(),a=i.find(".current_view").val(),r=i.find(".form_id").val(),_=i.find(".cur_gal_id").val(),s=i.find(".album_gallery_id").val(),o=i.find(".type").val();jQuery(e).parent().find(".opt.selected").each(function(){t=t+jQuery(e).text()+","}),""==(t=t.slice(0,-1))&&(t=bwg_objectsL10n.bwg_select_tag),jQuery(e).parent().find(".CaptionCont").attr("title",t),jQuery(e).parent().find(".CaptionCont .placeholder").html(t),jQuery("#bwg_tag_id_"+a).val(jQuery("#bwg_tag_id_"+_).val()),bwg_select_tag(a,r,_,s,o,!1)}function bwg_document_ready(){bwg_add_lightbox(),jQuery('div[id^="bwg_container1_"]').each(function(){var e=jQuery(this);e.data("right-click-protection")&&bwg_disable_right_click(e),jQuery(".SumoSelect > .CaptionCont > label > i").addClass("bwg-icon-angle-down closed");var t=e.find(".search_tags");if("1"==bwg_objectsL10n.front_ajax&&t.length)for(var i=0;i<t[0].length;i++)void 0===t[0][i].attributes.selected&&(t[0][i].selected=!1);t.length&&(t.SumoSelect({triggerChangeCombined:!0,placeholder:bwg_objectsL10n.bwg_select_tag,search:!0,searchText:bwg_objectsL10n.bwg_search,forceCustomRendering:!0,noMatch:bwg_objectsL10n.bwg_tag_no_match,captionFormatAllSelected:bwg_objectsL10n.bwg_all_tags_selected,captionFormat:"{0} "+bwg_objectsL10n.bwg_tags_selected,okCancelInMulti:!0,locale:[bwg_objectsL10n.ok,bwg_objectsL10n.cancel,bwg_objectsL10n.select_all]}),t.off("change").on("change",function(){bwg_filter_by_tag(this)}));var a=e.find(".bwg_order");a.length&&a.SumoSelect({triggerChangeCombined:!0,forceCustomRendering:!0}),jQuery(this).find("search_placeholder_title").hide(),""==jQuery(this).find(".bwg_search_input").val()&&jQuery(this).find("search_placeholder_title").show(),jQuery(".bwg_thumbnail .bwg_search_container_2").focusout(function(e){""==jQuery(this).find(".bwg_search_input").val()&&(jQuery(this).find(".search_placeholder_title").show(),jQuery(this).find(".bwg_search_loupe_container1").addClass("hidden"),jQuery(this).find(".bwg_search_reset_container").addClass("hidden"))})}),jQuery(".search_tags").on("sumo:opened",function(){0==jQuery(this).parent().find("ul li").length&&(jQuery(".no-match").html(bwg_objectsL10n.bwg_tag_no_match),jQuery(".no-match").show())}),jQuery(".bwg_thumbnail .SumoSelect").on("sumo:closed",function(){jQuery(this).find("label i").removeClass("bwg-icon-angle-up opened"),jQuery(this).find("label i").addClass("bwg-icon-angle-down closed")}),jQuery(".bwg_thumbnail .SumoSelect").on("sumo:opened",function(){jQuery(this).find("label i").removeClass("bwg-icon-angle-down closed"),jQuery(this).find("label i").addClass("bwg-icon-angle-up opened")}),bwg_add_album();var e=window.location.hash.substring(1);if(e&&"-1"!=e.indexOf("bwg")){bwg_hash_array=e.replace("bwg","").split("/");var t=jQuery(".bwg_container");t&&bwg_gallery_box(bwg_hash_array[1],t,!1,bwg_hash_array[0])}bwg_blog_style_ready(),bwg_image_browser_ready(),bwg_resize_search_line()}function bwg_clear_search_input(e){if("1"!=bwg_objectsL10n.front_ajax)jQuery("#bwg_search_input_"+e).val(""),jQuery("#bwg_search_container_1_"+e+" .bwg_search_loupe_container1").addClass("hidden"),jQuery("#bwg_search_container_1_"+e+" .bwg_search_reset_container").addClass("hidden");else{var t=window.location.href,i=bwg_remove_url_parameter("bwg_search_"+e,t,t);window.location.replace(i)}}function bwg_check_search_input_enter(e,t){return 13!=(t.which||t.keyCode)||(jQuery(e).closest(".bwg_search_container_1").find(".bwg_search").trigger("click"),!1)}function bwg_ajax(t,i,a,r,e,_,s,o,l,n,g){if("1"!=bwg_objectsL10n.front_ajax||!0===n){jQuery("#ajax_loading_"+i).removeClass("bwg-hidden"),jQuery(".bwg_load_more_ajax_loading").css({top:jQuery("#bwg_container1_"+bwg).height()-jQuery(".bwg_load_more_ajax_loading").height()}),"function"==typeof bwg_scroll_load_action&&jQuery(window).off("scroll",bwg_scroll_load_action),jQuery(".bwg_thumbnail .search_tags").off("sumo:closed");var w=jQuery("#"+t).data("ajax-url"),b=0;if(void 0===n)n=!1;var u=jQuery("#page_number_"+i).val(),d=jQuery("#bwg_search_input_"+i).val(),h={},m=jQuery("#bwg_album_breadcrumb_"+i).val();if(m&&!0!==n){var p=JSON.parse(m);if("back"==r){p.splice(-1,1);var c=p.slice(-1)[0];r=c.id,u=c.page,h["action_"+i]="back"}else"numeric"===n||s?(p.splice(-1,1),p.push({id:r,page:u,search:d})):(p.push({id:r,page:1}),u=1);h["bwg_album_breadcrumb_"+i]=JSON.stringify(p)}if(h.gallery_type=jQuery("#"+t).data("gallery-type"),h.gallery_id=jQuery("#"+t).data("gallery-id"),h.tag=jQuery("#"+t).data("tag"),h.album_id=jQuery("#"+t).data("album-id"),h.theme_id=jQuery("#"+t).data("theme-id"),h.shortcode_id=jQuery("#"+t).data("shortcode-id"),h.bwg=i,h.current_url=encodeURI(jQuery("#bwg_container1_"+i).data("current-url")),s&&(u=1),void 0===o||""==o)o="";if(void 0===g||""==g)g="";if(void 0===l||""==l)l=jQuery(".bwg_order_"+i).val();if(h["page_number_"+i]=u,h["bwg_load_more_"+i]=jQuery("#bwg_load_more_"+i).val(),h["album_gallery_id_"+i]=r,h["type_"+i]=_,h["title_"+i]=o,h["description_"+i]=g,h["sortImagesByValue_"+i]=l,0<jQuery("#bwg_search_input_"+i).length&&(h["bwg_search_"+i]=jQuery("#bwg_search_input_"+i).val()),void 0!==h["bwg_album_breadcrumb_"+i]){var y=jQuery.parseJSON(h["bwg_album_breadcrumb_"+i]);jQuery.each(y,function(e,t){h["bwg_search_"+i]="",r==t.id&&(h["bwg_search_"+i]=t.search)})}return h["bwg_tag_id_"+a]=jQuery("#bwg_tag_id_"+a).val(),jQuery("#ajax_loading_"+i).removeClass("bwg-hidden"),jQuery(".bwg_load_more_ajax_loading").css({top:jQuery("#bwg_container1_"+bwg).height()-jQuery(".bwg_load_more_ajax_loading").height()}),jQuery.ajax({type:"POST",url:w,data:h,success:function(e){jQuery(e).find(".bwg_masonry_thumb_spun_"+i+" img").length,b=jQuery(e).find(".bwg_mosaic_thumb_spun_"+i+" img").length,!0===n?(a=="bwg_thumbnails_mosaic_"+i?jQuery("#"+a).append(jQuery(e).closest(".bwg-container-"+i).find("#"+a).html()):a=="bwg_album_compact_"+i?jQuery("#"+a).append(jQuery(e).closest(".bwg-album-thumbnails").html()):jQuery("#"+a).append(jQuery(e).closest(".bwg-container-"+i).html()),jQuery(".bwg_nav_cont_"+i).html(jQuery(e).closest(".bwg_nav_cont_"+i).html())):jQuery("#bwg_container3_"+i).html(e)},complete:function(){jQuery("div[id^='bwg_container1_'] img").each(function(){null!=jQuery(this).attr("data-lazy-src")&&""!=jQuery(this).attr("data-lazy-src")?jQuery(this).attr("src",jQuery(this).attr("data-lazy-src")):null!=jQuery(this).attr("data-src")&&""!=jQuery(this).attr("data-src")&&jQuery(this).attr("src",jQuery(this).attr("data-src"))}),jQuery(".blog_style_image_buttons_conteiner_"+i).find(jQuery(".bwg_blog_style_img_"+i)).on("load",function(){jQuery(".bwg_blog_style_img_"+i).closest(jQuery(".blog_style_image_buttons_conteiner_"+i)).show()}),jQuery("#bwg_tags_id_"+a).val(jQuery("#bwg_tag_id_"+a).val()),jQuery(".pagination-links_"+i).length&&jQuery("html, body").animate({scrollTop:jQuery("#"+t).offset().top-150},500),bwg_document_ready(),bwg_mosaic_ajax(i,b),bwg_all_thumnails_loaded(".bwg-container-"+i)&&bwg_container_loaded(i),jQuery(".blog_style_images_conteiner_"+i+" .bwg_embed_frame_16x9_"+i).each(function(e){jQuery(this).width(jQuery(this).parent().width()),jQuery(this).height(.5625*jQuery(this).width())}),jQuery(".blog_style_images_conteiner_"+i+" .bwg_embed_frame_instapost_"+i).each(function(e){jQuery(this).width(jQuery(this).parent().width()),jQuery(this).height((jQuery(this).width()-16)*jQuery(this).attr("data-height")/jQuery(this).attr("data-width")+96)}),jQuery("#bwg_embed_frame_16x9_"+i).width(jQuery("#bwg_embed_frame_16x9_"+i).parent().width()),jQuery("#bwg_embed_frame_16x9_"+i).height(.5625*jQuery("#bwg_embed_frame_16x9_"+i).width()),jQuery("#bwg_embed_frame_instapost_"+i).width(jQuery("#bwg_embed_frame_16x9_"+i).parent().width()),jQuery(".bwg_embed_frame_instapost_"+i).height((jQuery(".bwg_embed_frame_instapost_"+i).width()-16)*jQuery(".bwg_embed_frame_instapost_"+i).attr("data-height")/jQuery(".bwg_embed_frame_instapost_"+i).attr("data-width")+96),jQuery("#bwg_search_input_"+i).val(h["bwg_search_"+i]),""!=jQuery("#bwg_search_input_"+i).val()?(jQuery("#bwg_search_input_"+i).parent().find(".search_placeholder_title").hide(),jQuery("#bwg_search_input_"+i).parent().parent().find(".bwg_search_reset_container").show(),jQuery("#bwg_search_input_"+i).parent().parent().find(".bwg_search_loupe_container1").show()):jQuery("#bwg_search_input_"+i).parent().find(".search_placeholder_title").show();var e=jQuery("#bwg_container2_"+i+" .cur_gal_id").val();jQuery("#bwg_tag_id_"+i).val(jQuery("#bwg_tag_id_"+e).val())}}),!1}if("back"!==r){var f=jQuery("#bwg_search_input_"+i).val(),j=window.location.href,Q="",v=jQuery("#bwg_tag_id_"+a).val();if(""!==window.location.hash&&(j=j.replace("#","")),""!==f?!1!==(Q=bwg_add_url_parameter(Q=bwg_remove_url_parameter("page_number_"+i,j),"bwg_search_"+i,f))&&(j=Q):!1!==(Q=bwg_remove_url_parameter("bwg_search_"+i,j))&&(j=Q),void 0!==l&&""!==l&&!1!==(Q=bwg_add_url_parameter(j,"sort_by_"+i,l))&&(j=Q),null!=v&&0<v.length){var x="";jQuery.each(v,function(e){var t=",";e===v.length-1&&(t=""),x+=v[e]+t}),""!==x&&!1!==(Q=bwg_add_url_parameter(j,"filter_tag_"+i,x))&&(j=Q)}else!1!==(Q=bwg_remove_url_parameter("filter_tag_"+i,Q))&&(j=Q);window.location.href=j}else window.history.back()}function bwg_add_url_parameter(e,t,i){var a=new RegExp("([?&])"+t+"=.*?(&|$)","i"),r=-1!==e.indexOf("?")?"&":"?";return e.match(a)?e.replace(a,"$1"+t+"="+i+"$2"):e+r+t+"="+i}function bwg_remove_url_parameter(e,t){var i=t.split("?"),a=i[0]+"?",r="";if(void 0!==i[1]&&(r=i[1]),""===r)return t;var _,s,o=decodeURIComponent(r).split("&");for(s=0;s<o.length;s++)(_=o[s].split("="))[0]!=e&&(a=a+_[0]+"="+_[1]+"&");return a.substring(0,a.length-1)}function bwg_select_tag(e,t,i,a,r,_){_&&jQuery("#bwg_tag_id_"+i).val(""),bwg_ajax(t,e,i,a,"",r,1,"")}function bwg_cube(e,t,i,a,r,_,s,o,l,n,g){var w,b=!1,u="";if(void 0!==g&&""!==g){b=!0,bwg_params[g].bwg_trans_in_progress=!0,u="_"+g,w=bwg_params[g].bwg_transition_duration;bwg_params[g].event_stack}else w=bwg_transition_duration;if(!bwg_testBrowser_cssTransitions(g))return bwg_fallback(o,l,n,g);if(!bwg_testBrowser_cssTransforms3d(g))return bwg_fallback3d(o,l,n,g);function d(){if(jQuery(o).removeAttr("style"),jQuery(l).removeAttr("style"),jQuery(".bwg_slider"+u).removeAttr("style"),jQuery(o).css({opacity:0,"z-index":1}),jQuery(l).css({opacity:1,"z-index":2}),jQuery(".bwg_image_info").show(),jQuery(o).html(""),b){bwg_change_watermark_container(g),bwg_params[g].bwg_trans_in_progress=!1;var e=bwg_params[g].data,t=bwg_params[g].event_stack}else{e="";gallery_box_data.bwg_trans_in_progress=!1;t=gallery_box_data.event_stack}if(void 0!==t&&0<t.length){var i=t[0].split("-");t.shift(),bwg_change_image(i[0],i[1],e,!0,g)}bwg_change_watermark_container()}b?(jQuery(".bwg_slideshow_filmstrip_thumbnail_"+g).removeClass("bwg_slideshow_thumb_active_"+g).addClass("bwg_slideshow_thumb_deactive_"+g),jQuery("#bwg_filmstrip_thumbnail_"+bwg_params[g].bwg_current_key+"_"+g).removeClass("bwg_slideshow_thumb_deactive_"+g).addClass("bwg_slideshow_thumb_active_"+g),jQuery(".bwg_slideshow_dots_"+g).removeClass("bwg_slideshow_dots_active_"+g).addClass("bwg_slideshow_dots_deactive_"+g),jQuery("#bwg_dots_"+bwg_params[g].bwg_current_key+"_"+g).removeClass("bwg_slideshow_dots_deactive_"+g).addClass("bwg_slideshow_dots_active_"+g),jQuery(".bwg_slide_bg_"+g).css("perspective",1e3)):(gallery_box_data.bwg_trans_in_progress=!0,jQuery(".bwg_filmstrip_thumbnail").removeClass("bwg_thumb_active").addClass("bwg_thumb_deactive"),jQuery("#bwg_filmstrip_thumbnail_"+gallery_box_data.bwg_current_key).removeClass("bwg_thumb_deactive").addClass("bwg_thumb_active"),jQuery(".bwg_slide_bg").css("perspective",1e3)),jQuery(o).css({transform:"translateZ("+e+"px)",backfaceVisibility:"hidden"}),jQuery(l).css({opacity:1,backfaceVisibility:"hidden",transform:"translateY("+i+"px) translateX("+t+"px) rotateY("+r+"deg) rotateX("+a+"deg)"}),jQuery(".bwg_slider"+u).css({transform:"translateZ(-"+e+"px)",transformStyle:"preserve-3d"}),setTimeout(function(){jQuery(".bwg_slider"+u).css({transition:"all "+w+"ms ease-in-out",transform:"translateZ(-"+e+"px) rotateX("+_+"deg) rotateY("+s+"deg)"})},20),jQuery(".bwg_slider"+u).one("webkitTransitionEnd transitionend otransitionend oTransitionEnd mstransitionend",jQuery.proxy(d)),0==w&&d()}function bwg_fade(e,t,i,a){var r,_=!1;function s(){jQuery(".bwg_image_info").show(),bwg_change_watermark_container(a),_?bwg_params[a].bwg_trans_in_progress=!1:gallery_box_data.bwg_trans_in_progress=!1}r=void 0!==a&&""!==a?(_=!0,bwg_params[a].bwg_trans_in_progress=!0,bwg_params[a].bwg_transition_duration):(gallery_box_data.bwg_trans_in_progress=!0,gallery_box_data.bwg_transition_duration),_?(jQuery(".bwg_slideshow_filmstrip_thumbnail_"+a).removeClass("bwg_slideshow_thumb_active_"+a).addClass("bwg_slideshow_thumb_deactive_"+a),jQuery("#bwg_filmstrip_thumbnail_"+bwg_params[a].bwg_current_key+"_"+a).removeClass("bwg_slideshow_thumb_deactive_"+a).addClass("bwg_slideshow_thumb_active_"+a),jQuery(".bwg_slideshow_dots_"+a).removeClass("bwg_slideshow_dots_active_"+a).addClass("bwg_slideshow_dots_deactive_"+a),jQuery("#bwg_dots_"+bwg_params[a].bwg_current_key+"_"+a).removeClass("bwg_slideshow_dots_deactive_"+a).addClass("bwg_slideshow_dots_active_"+a)):(jQuery(".bwg_filmstrip_thumbnail").removeClass("bwg_thumb_active").addClass("bwg_thumb_deactive"),jQuery("#bwg_filmstrip_thumbnail_"+gallery_box_data.bwg_current_key).removeClass("bwg_thumb_deactive").addClass("bwg_thumb_active")),bwg_testBrowser_cssTransitions()?(jQuery(t).css("transition","opacity "+r+"ms linear"),jQuery(e).css({opacity:0,"z-index":1}),jQuery(t).css({opacity:1,"z-index":2}),jQuery(t).one("webkitTransitionEnd transitionend otransitionend oTransitionEnd mstransitionend",jQuery.proxy(s))):(jQuery(e).animate({opacity:0,"z-index":1},r),jQuery(t).animate({opacity:1,"z-index":2},{duration:r,complete:function(){_?bwg_params[a].bwg_trans_in_progress=!1:gallery_box_data.bwg_trans_in_progress=!1,jQuery(e).html(""),s()}}),jQuery(e).fadeTo(r,0),jQuery(t).fadeTo(r,1)),0==r&&s()}function bwg_change_watermark_container(t){jQuery(".bwg_slider"+(void 0!==t&&""!==t?"_"+t:"")).children().each(function(){if(2==jQuery(this).css("zIndex")){var e=jQuery(this).find("img");if(e.length)if(e.prop("complete"))bwg_change_each_watermark_container(e.width(),e.height(),t);else e.on("load",function(){bwg_change_each_watermark_container(e.width(),e.height(),t)});else(e=jQuery(this).find("iframe")).length||(e=jQuery(this).find("video")),bwg_change_each_watermark_container(e.width(),e.height(),t)}})}function bwg_change_each_watermark_container(e,t,i){var a=void 0!==i&&""!==i?"_"+i:"",r=void 0!==i&&""!==i?"_slideshow":"";if(jQuery(".bwg"+r+"_watermark_spun"+a).width(e),jQuery(".bwg"+r+"_watermark_spun"+a).height(t),jQuery(".bwg"+r+"_watermark"+a).css({display:""}),void 0===i||""===i){var _=0;(jQuery(".bwg_comment_container").hasClass("bwg_open")||jQuery(".bwg_ecommerce_container").hasClass("bwg_open"))&&(_=gallery_box_data.lightbox_comment_width),e<=jQuery(window).width()-_&&(jQuery(".bwg_watermark_image").css({width:(jQuery(".spider_popup_wrap").width()-_)*gallery_box_data.watermark_font_size/gallery_box_data.image_width}),jQuery(".bwg_watermark_text, .bwg_watermark_text:hover").css({fontSize:(jQuery(".spider_popup_wrap").width()-_)*gallery_box_data.watermark_font_size/gallery_box_data.image_width}))}else jQuery(".bwg"+r+"_title_spun"+a).width(e),jQuery(".bwg"+r+"_title_spun"+a).height(t),jQuery(".bwg"+r+"_description_spun"+a).width(e),jQuery(".bwg"+r+"_description_spun"+a).height(t);jQuery.trim(jQuery(".bwg"+r+"_title_text"+a).text())&&jQuery(".bwg_slideshow_title_text"+a).css({display:""}),jQuery.trim(jQuery(".bwg"+r+"_description_text"+a).text())&&jQuery(".bwg"+r+"_description_text"+a).css({display:""})}function bwg_set_filmstrip_pos(e,t,i){var a,r=void 0!==t&&""!==t?"_"+t:"",_=void 0!==t&&""!==t?"_slideshow":"";a=void 0!==t&&""!==t?bwg_params[t].left_or_top:gallery_box_data.left_or_top;var s=parseInt(jQuery(".bwg_filmstrip_thumbnails").attr("data-all-images-top-bottom-space")),o=parseInt(jQuery(".bwg_filmstrip_thumbnails").attr("data-all-images-right-left-space"));if(void 0===t||""===t){if("outerWidth"==gallery_box_data.outerWidth_or_outerHeight)var l=-bwg_current_filmstrip_pos-jQuery(".bwg_filmstrip_thumbnail").outerWidth(!0)/2;else if("outerHeight"==gallery_box_data.outerWidth_or_outerHeight)l=-bwg_current_filmstrip_pos-jQuery(".bwg_filmstrip_thumbnail").outerHeight(!0)/2;if("width"==gallery_box_data.width_or_height)var n=Math.min(0,Math.max(e-jQuery(".bwg_filmstrip_thumbnails").width(),l+e/2));else if("height"==gallery_box_data.width_or_height)n=Math.min(0,Math.max(e-jQuery(".bwg_filmstrip_thumbnails").height(),l+e/2))}else if("width"==bwg_params[t].width_or_height)l=-bwg_params[t].bwg_current_filmstrip_pos-(jQuery(".bwg_slideshow_filmstrip_thumbnail"+r).width()+bwg_params[t].filmstrip_thumb_margin_hor)/2,n=Math.min(0,Math.max(e-jQuery(".bwg_slideshow_filmstrip_thumbnails"+r).width(),l+e/2));else l=-bwg_params[t].bwg_current_filmstrip_pos-(jQuery(".bwg_slideshow_filmstrip_thumbnail"+r).height()+bwg_params[t].filmstrip_thumb_margin_hor)/2,n=Math.min(0,Math.max(e-jQuery(".bwg_slideshow_filmstrip_thumbnails"+r).height(),l+e/2));0<n+o&&(o=0),0<n+s&&(s=0),"left"==a?jQuery(".bwg"+_+"_filmstrip_thumbnails"+r).animate({left:n+o},{duration:500,complete:function(){bwg_filmstrip_arrows(t)}}):jQuery(".bwg"+_+"_filmstrip_thumbnails"+r).animate({top:n+s},{duration:500,complete:function(){bwg_filmstrip_arrows(t)}})}function bwg_filmstrip_arrows(e){var t=void 0!==e&&""!==e?"_"+e:"",i=void 0!==e&&""!==e?"_slideshow":"";if("width"==(void 0!==e&&""!==e?bwg_params[e].width_or_heigh:gallery_box_data.width_or_height))var a=jQuery(".bwg"+i+"_filmstrip_thumbnails"+t).width(),r=jQuery(".bwg"+i+"_filmstrip"+t).width();else a=jQuery(".bwg"+i+"_filmstrip_thumbnails"+t).height(),r=jQuery(".bwg"+i+"_filmstrip"+t).height();a<r?(jQuery(".bwg"+i+"_filmstrip_left"+t).hide(),jQuery(".bwg"+i+"_filmstrip_right"+t).hide()):(jQuery(".bwg"+i+"_filmstrip_left"+t).show(),jQuery(".bwg"+i+"_filmstrip_right"+t).show())}function bwg_move_filmstrip(e){var t,i,a,r,_,s,o=void 0!==e&&""!==e?"_"+e:"",l=void 0!==e&&""!==e?"_slideshow":"",n=void 0!==e&&""!==e?bwg_params[e].outerWidth_or_outerHeight:gallery_box_data.outerWidth_or_outerHeight,g=void 0!==e&&""!==e?bwg_params[e].left_or_top:gallery_box_data.left_or_top;i="outerWidth"==n?(t=jQuery(".bwg"+l+"_filmstrip"+o).outerWidth(!0),jQuery(".bwg"+l+"_filmstrip_thumbnails"+o).outerWidth(!0)):(t=jQuery(".bwg"+l+"_filmstrip"+o).outerHeight(!0),jQuery(".bwg"+l+"_filmstrip_thumbnails"+o).outerHeight(!0)),s="left"==g?(a=jQuery(".bwg"+l+"_thumb_active"+o).position().left,r="outerWidth"==n?jQuery(".bwg"+l+"_thumb_active"+o).position().left+jQuery(".bwg"+l+"_thumb_active"+o).outerWidth(!0):jQuery(".bwg"+l+"_thumb_active"+o).position().left+jQuery(".bwg"+l+"_thumb_active"+o).outerHeight(!0),_=jQuery(".bwg"+l+"_filmstrip_thumbnails"+o).position().left,Math.abs(jQuery(".bwg"+l+"_filmstrip_thumbnails"+o).position().left)+t):(a=jQuery(".bwg"+l+"_thumb_active"+o).position().top,r="outerWidth"==n?jQuery(".bwg"+l+"_thumb_active"+o).position().top+jQuery(".bwg"+l+"_thumb_active"+o).outerWidth(!0):jQuery(".bwg"+l+"_thumb_active"+o).position().top+jQuery(".bwg"+l+"_thumb_active"+o).outerHeight(!0),_=jQuery(".bwg"+l+"_filmstrip_thumbnails"+o).position().top,Math.abs(jQuery(".bwg"+l+"_filmstrip_thumbnails"+o).position().top)+t),i<t||(a<Math.abs(_)?"left"==g?jQuery(".bwg"+l+"_filmstrip_thumbnails"+o).animate({left:-a},{duration:500,complete:function(){bwg_filmstrip_arrows(e)}}):jQuery(".bwg"+l+"_filmstrip_thumbnails"+o).animate({top:-a},{duration:500,complete:function(){bwg_filmstrip_arrows(e)}}):s<r&&("left"==g?jQuery(".bwg"+l+"_filmstrip_thumbnails"+o).animate({left:-(r-t)},{duration:500,complete:function(){bwg_filmstrip_arrows(e)}}):jQuery(".bwg"+l+"_filmstrip_thumbnails"+o).animate({top:-(r-t)},{duration:500,complete:function(){bwg_filmstrip_arrows(e)}})))}function bwg_move_dots(e){var t=jQuery(".bwg_slideshow_dots_active_"+e).position().left,i=jQuery(".bwg_slideshow_dots_active_"+e).position().left+jQuery(".bwg_slideshow_dots_active_"+e).outerWidth(!0),a=jQuery(".bwg_slideshow_dots_container_"+e).outerWidth(!0),r=jQuery(".bwg_slideshow_dots_thumbnails_"+e).outerWidth(!1),_=jQuery(".bwg_slideshow_dots_thumbnails_"+e).position().left,s=Math.abs(jQuery(".bwg_slideshow_dots_thumbnails_"+e).position().left)+a;r<a||(t<Math.abs(_)?jQuery(".bwg_slideshow_dots_thumbnails_"+e).animate({left:-t},{duration:500,complete:function(){}}):s<i&&jQuery(".bwg_slideshow_dots_thumbnails_"+e).animate({left:-(i-a)},{duration:500,complete:function(){}}))}function bwg_testBrowser_cssTransitions(e){return bwg_testDom("Transition",e)}function bwg_testBrowser_cssTransforms3d(e){return bwg_testDom("Perspective",e)}function bwg_testDom(e,t){for(var i=["","Webkit","Moz","ms","O","Khtml"],a=i.length;a--;)if(void 0!==document.body.style[i[a]+e])return!0;return!1}function bwg_fallback(e,t,i,a){bwg_fade(e,t,i,a)}function bwg_fallback3d(e,t,i,a){bwg_sliceV(e,t,i,a)}function bwg_none(e,t,i,a){var r=void 0!==a&&""!==a?"_"+a:"";if(jQuery(e).css({opacity:0,"z-index":1}),jQuery(t).css({opacity:1,"z-index":2}),void 0!==a&&""!==a){var _=bwg_params[a].bwg_current_key;bwg_change_watermark_container(a),jQuery(".bwg_slideshow_filmstrip_thumbnail"+r).removeClass("bwg_slideshow_thumb_active"+r).addClass("bwg_slideshow_thumb_deactive"+r),jQuery("#bwg_filmstrip_thumbnail_"+_+r).removeClass("bwg_slideshow_thumb_deactive"+r).addClass("bwg_slideshow_thumb_active"+r),jQuery(".bwg_slideshow_dots"+r).removeClass("bwg_slideshow_dots_active"+r).addClass("bwg_slideshow_dots_deactive"+r),jQuery("#bwg_dots_"+_+r).removeClass("bwg_slideshow_dots_deactive"+r).addClass("bwg_slideshow_dots_active"+r)}else jQuery(".bwg_image_info").show(),gallery_box_data.bwg_trans_in_progress=!1,jQuery(e).html(""),bwg_change_watermark_container()}function bwg_iterator(e){var t=1;return void 0!==e&&""!==e&&void 0!==bwg_params[e]&&1==bwg_params[e].enable_slideshow_shuffle&&(t=Math.floor((bwg_params[e].data.length-1)*Math.random()+1)),t}function bwg_change_image_slideshow(e,t,i,a,r){i=bwg_params[r].data;if(jQuery("#bwg_slideshow_image_container_"+r).find("iframe").each(function(){jQuery(this)[0].contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}',"*"),jQuery(this)[0].contentWindow.postMessage('{ "method": "pause" }',"*"),jQuery(this)[0].contentWindow.postMessage("pause","*")}),jQuery("#image_id_"+r+"_"+i[e].id).find(".bwg_fb_video").each(function(){jQuery(this).attr("src",jQuery(this).attr("src"))}),i[t]){if(jQuery(".bwg_ctrl_btn_"+r).hasClass("bwg-icon-pause")&&bwg_play(bwg_params[r].data,r),a||(jQuery("#bwg_current_image_key_"+r).val(t),"-1"==e?e=jQuery(".bwg_slideshow_thumb_active_"+r).children("img").attr("image_key"):"-2"==e&&(e=jQuery(".bwg_slideshow_dots_active_"+r).attr("image_key"))),bwg_params[r].bwg_trans_in_progress)return void bwg_params[r].event_stack.push(e+"-"+t);var _="right";if(t<e)_="left";else if(e==t)return;jQuery(".bwg_slideshow_watermark_"+r).css({display:"none"}),jQuery(".bwg_slideshow_title_text_"+r).css({display:"none"}),jQuery(".bwg_slideshow_description_text_"+r).css({display:"none"}),"width"==bwg_params[r].width_or_height?bwg_params[r].bwg_current_filmstrip_pos=t*(jQuery(".bwg_slideshow_filmstrip_thumbnail_"+r).width()+2+2*bwg_params[r].lightbox_filmstrip_thumb_border_width):bwg_params[r].bwg_current_filmstrip_pos=t*(jQuery(".bwg_slideshow_filmstrip_thumbnail_"+r).height()+2+2*bwg_params[r].lightbox_filmstrip_thumb_border_width),e=t,bwg_params[r].bwg_current_key=e,jQuery("#bwg_slideshow_image_"+r).attr("image_id",i[t].id),jQuery(".bwg_slideshow_title_text_"+r).html(jQuery('<span style="display: block;" />').html(i[t].alt).text()),jQuery(".bwg_slideshow_description_text_"+r).html(jQuery('<span style="display: block;" />').html(i[t].description).text());var s=2==jQuery(".bwg_slideshow_image_spun_"+r).css("zIndex")?".bwg_slideshow_image_spun_"+r:".bwg_slideshow_image_second_spun_"+r,o=s==".bwg_slideshow_image_second_spun_"+r?".bwg_slideshow_image_spun_"+r:".bwg_slideshow_image_second_spun_"+r,l=-1<i[t].filetype.indexOf("EMBED_"),n=-1<i[t].filetype.indexOf("INSTAGRAM_POST"),g=-1<i[t].filetype.indexOf("INSTAGRAM_VIDEO"),w=jQuery(s).height(),b=jQuery(s).width(),u='<span class="bwg_slideshow_image_spun1_'+r+'" style="display: '+(l?"block":"table")+' ;width: inherit; height: inherit;"><span class="bwg_slideshow_image_spun2_'+r+'" style="display: '+(l?"block":"table-cell")+'; vertical-align: middle; text-align: center; ">';if(l){if(u+='<span style="height: '+w+"px; width: "+b+'px;" class="bwg_popup_embed bwg_popup_watermark">',g&&(u+='<span class="bwg_inst_play_btn_cont" onclick="bwg_play_instagram_video(this)"><span class="bwg_inst_play"></span></span>'),n){var d=0,h=0;w<b+88?d=(h=w)-88:h=(d=b)+88,u+=spider_display_embed(i[t].filetype,i[t].image_url,i[t].filename,{class:"bwg_embed_frame","data-width":i[t].image_width,"data-height":i[t].image_height,frameborder:"0",allowfullscreen:"allowfullscreen",style:"width:"+d+"px; height:"+h+"px; vertical-align:middle; display:inline-block; position:relative;"})}else u+=spider_display_embed(i[t].filetype,i[t].image_url,i[t].filename,{class:"bwg_embed_frame",frameborder:"0",allowfullscreen:"allowfullscreen",style:"width:inherit; height:inherit; vertical-align:middle; display:table-cell;"});u+="</span>"}else{if("do_nothing"!=bwg_params[r].thumb_click_action){var m="";"open_lightbox"==bwg_params[r].thumb_click_action?m+=' class="bwg_lightbox" data-image-id="'+i[t].id+'"':"redirect_to_url"==bwg_params[r].thumb_click_action&&i[t].redirect_url&&(m+='href="'+i[t].redirect_url+'"'+(bwg_params[r].thumb_link_target&&1==bwg_params[r].thumb_link_target?' target="_blank"':"")),u+="<a "+m+">"}u+='<img style="max-height: '+w+"px !important; max-width: "+b+'px !important; display:inline-block;" ',u+=' class="bwg_slide bwg_slideshow_image_'+r+'" ',u+=' id="bwg_slideshow_image_'+r+'" ',u+=' src="'+bwg_params[r].upload_url+jQuery("<span style='display: block;' />").html(i[t].image_url).text()+'" alt="'+i[t].alt+'" image_id="'+i[t].id+'" /></a>'}u+="</span></span>",jQuery(o).html(u),bwg_params[r].preload_images&&bwg_preload_images(t,r),window["bwg_"+bwg_params[r].slideshow_effect](s,o,_,r),0<bwg_params[r].enable_slideshow_filmstrip?bwg_move_filmstrip(r):bwg_move_dots(r),i[t].is_embed_video?jQuery("#bwg_slideshow_play_pause_"+r).css({display:"none"}):jQuery("#bwg_slideshow_play_pause_"+r).css({display:""})}bwg_add_lightbox()}function bwg_preload_images_slideshow(e,t){var i=bwg_params[t].data;count=bwg_params[t].preload_images_count/2;var a=i.length;if(a<bwg_params[t].preload_images_count&&(count=0),0!=count)for(var r=e-count;r<e+count;r++){var _=parseInt((r+a)%a),s=-1<i[_].filetype.indexOf("EMBED_");void 0!==i[_]&&(s||jQuery("<img/>").attr("src",bwg_params[t].upload_url+jQuery('<span style="display: block;" />').html(i[_].image_url).text()))}else for(r=0;r<i.length;r++){s=-1<i[r].filetype.indexOf("EMBED_");void 0!==i[r]&&(s||jQuery("<img/>").attr("src",bwg_params[t].upload_url+jQuery('<span style="display: block;" />').html(i[r].image_url).text()))}}function bwg_preload_images(e,t){void 0!==t&&""!==t?bwg_preload_images_slideshow(e,t):bwg_preload_images_lightbox(e)}function bwg_popup_resize_slidshow(e){var t=jQuery(".bwg_slideshow_image_wrap_"+e).parent().width(),i=bwg_params[e].data;if(t>=bwg_params[e].image_width){jQuery(".bwg_slideshow_image_wrap_"+e).css({width:bwg_params[e].image_width}),jQuery(".bwg_slideshow_image_wrap_"+e).css({height:bwg_params[e].image_height}),jQuery(".bwg_slideshow_image_container_"+e).css({width:"horizontal"==bwg_params[e].filmstrip_direction?bwg_params[e].image_width:bwg_params[e].image_width-bwg_params[e].slideshow_filmstrip_width}),jQuery(".bwg_slideshow_image_container_"+e).css({height:"horizontal"==bwg_params[e].filmstrip_direction?bwg_params[e].image_height-bwg_params[e].slideshow_filmstrip_height:bwg_params[e].image_height}),jQuery(".bwg_slideshow_image_"+e).css({cssText:(bwg_params[e].filmstrip_direction,bwg_params[e].image_width)}),jQuery(".bwg_slideshow_embed_"+e).css({cssText:(bwg_params[e].filmstrip_direction,bwg_params[e].image_width)}),bwg_resize_instagram_post(e),bwg_change_watermark_container(e);var a="horizontal"==bwg_params[e].filmstrip_direction?"width: "+bwg_params[e].image_width:"height: "+bwg_params[e].image_height,r="horizontal"==bwg_params[e].filmstrip_direction?"width: "+(bwg_params[e].image_width-40):"height: "+(bwg_params[e].image_height-40);jQuery(".bwg_slideshow_filmstrip_container_"+e).css({cssText:a}),jQuery(".bwg_slideshow_filmstrip_"+e).css({cssText:r}),jQuery(".bwg_slideshow_dots_container_"+e).css({width:bwg_params[e].image_width}),jQuery("#bwg_slideshow_play_pause-ico_"+e).css({fontSize:bwg_params[e].slideshow_play_pause_btn_size}),"image"==bwg_params[e].watermark_type&&jQuery(".bwg_slideshow_watermark_image_"+e).css({maxWidth:bwg_params[e].watermark_width,maxHeight:bwg_params[e].watermark_height}),"text"==bwg_params[e].watermark_type&&jQuery(".bwg_slideshow_watermark_text_"+e+", .bwg_slideshow_watermark_text_"+e+" : hover").css({fontSize:bwg_params[e].watermark_font_size}),jQuery(".bwg_slideshow_title_text_"+e).css({fontSize:2*bwg_params[e].slideshow_title_font_size}),jQuery(".bwg_slideshow_description_text_"+e).css({fontSize:2*bwg_params[e].slideshow_description_font_size})}else jQuery(".bwg_slideshow_image_wrap_"+e).css({width:t}),jQuery(".bwg_slideshow_image_wrap_"+e).css({height:t*bwg_params[e].image_height/bwg_params[e].image_width}),jQuery(".bwg_slideshow_image_container_"+e).css({width:t-("horizontal"==bwg_params[e].filmstrip_direction?0:bwg_params[e].slideshow_filmstrip_width)}),jQuery(".bwg_slideshow_image_container_"+e).css({height:t*bwg_params[e].image_height/bwg_params[e].image_width-("horizontal"==bwg_params[e].filmstrip_direction?bwg_params[e].slideshow_filmstrip_height:0)}),jQuery(".bwg_slideshow_image_"+e).css({cssText:"max-width: "+(t-("horizontal"==bwg_params[e].filmstrip_direction?0:bwg_params[e].slideshow_filmstrip_width))+"px !important; max-height: "+(t*(bwg_params[e].image_height/bwg_params[e].image_width)-("horizontal"==bwg_params[e].filmstrip_direction?bwg_params[e].slideshow_filmstrip_height:0)-1)+"px !important;"}),jQuery(".bwg_slideshow_embed_"+e).css({cssText:"width: "+(t-("horizontal"==bwg_params[e].filmstrip_direction?0:bwg_params[e].slideshow_filmstrip_width))+"px !important; height: "+(t*(bwg_params[e].image_height/bwg_params[e].image_width)-("horizontal"==bwg_params[e].filmstrip_direction?bwg_params[e].slideshow_filmstrip_height:0)-1)+"px !important;"}),bwg_resize_instagram_post(e),bwg_change_watermark_container(e),"horizontal"==bwg_params[e].filmstrip_direction?(jQuery(".bwg_slideshow_filmstrip_container_"+e).css({width:t}),jQuery(".bwg_slideshow_filmstrip_"+e).css({width:t-40})):(jQuery(".bwg_slideshow_filmstrip_container_"+e).css({height:t*bwg_params[e].image_height/bwg_params[e].image_width}),jQuery(".bwg_slideshow_filmstrip_"+e).css({height:t*bwg_params[e].image_height/bwg_params[e].image_width-40})),jQuery(".bwg_slideshow_dots_container_"+e).css({width:t}),jQuery("#bwg_slideshow_play_pause-ico_"+e).css({fontSize:t*bwg_params[e].slideshow_play_pause_btn_size/bwg_params[e].image_width}),jQuery(".bwg_slideshow_watermark_image_"+e).css({maxWidth:t*bwg_params[e].watermark_width/bwg_params[e].image_width,maxHeight:t*bwg_params[e].watermark_height/bwg_params[e].image_width}),jQuery(".bwg_slideshow_watermark_text_"+e+", .bwg_slideshow_watermark_text_"+e+":hover").css({fontSize:t*bwg_params[e].watermark_font_size/bwg_params[e].image_width}),jQuery(".bwg_slideshow_title_text_"+e).css({fontSize:2*t*bwg_params[e].slideshow_title_font_size/bwg_params[e].image_width}),jQuery(".bwg_slideshow_description_text_"+e).css({fontSize:2*t*bwg_params[e].slideshow_description_font_size/bwg_params[e].image_width}),jQuery(".bwg_slideshow_image_"+e).css({display:"inline-block"});i[parseInt(jQuery("#bwg_current_image_key_"+e).val())].is_embed_video?jQuery("#bwg_slideshow_play_pause_"+e).css({display:"none"}):jQuery("#bwg_slideshow_play_pause_"+e).css({display:""})}function bwg_popup_resize(e){void 0!==e&&""!==e?bwg_popup_resize_slidshow(e):bwg_popup_resize_lightbox()}function bwg_change_image(e,t,i,a,r){void 0!==r&&""!==r?bwg_change_image_slideshow(e,t,i,a,r):bwg_change_image_lightbox(e,t,i=gallery_box_data.data,a)}function bwg_resize_instagram_post(e){if(void 0!==e&&""!==e){if(jQuery(".inner_instagram_iframe_bwg_embed_frame_"+e).length){var t=jQuery(".bwg_slideshow_embed_"+e).width(),i=jQuery(".bwg_slideshow_embed_").height();jQuery(".inner_instagram_iframe_bwg_embed_frame_"+e).each(function(){var e=jQuery(this).parent();i/(parseInt(e.attr("data-height"))+96)<t/parseInt(e.attr("data-width"))?(e.height(i),e.width((e.height()-96)*e.attr("data-width")/e.attr("data-height")+16)):(e.width(t),e.height((e.width()-16)*e.attr("data-height")/e.attr("data-width")+96))}),bwg_change_watermark_container(e)}}else if(jQuery(".inner_instagram_iframe_bwg_embed_frame").length){t=jQuery(".bwg_image_container").width(),i=jQuery(".bwg_image_container").height();jQuery(".inner_instagram_iframe_bwg_embed_frame").each(function(){var e=jQuery(this).parent();i/(parseInt(e.attr("data-height"))+176)<t/parseInt(e.attr("data-width"))?(e.height(i),e.width((e.height()-176)*e.attr("data-width")/e.attr("data-height")+16)):(e.width(t),e.height((e.width()-16)*e.attr("data-height")/e.attr("data-width")+96)),e.css({top:.5*(i-e.height())})}),bwg_change_watermark_container()}}function bwg_play(t,i){if(void 0!==i&&""!==i)t=bwg_params[i].data;void 0!==i&&""!==i?(window.clearInterval(window["bwg_playInterval"+i]),window["bwg_playInterval"+i]=setInterval(function(){var e=1;1==bwg_params[i].enable_slideshow_shuffle&&(e=Math.floor((t.length-1)*Math.random()+1)),bwg_change_image(parseInt(jQuery("#bwg_current_image_key_"+i).val()),(parseInt(jQuery("#bwg_current_image_key_"+i).val())+e)%t.length,t,"",i)},1e3*bwg_params[i].slideshow_interval)):(window.clearInterval(gallery_box_data.bwg_playInterval),gallery_box_data.bwg_playInterval=setInterval(function(){jQuery(".bwg_comment_container").hasClass("bwg_open")||jQuery(".bwg_play_pause").length&&jQuery(".bwg_play_pause").hasClass("bwg-icon-play")||(void 0===t||void 0!==t[parseInt(jQuery("#bwg_current_image_key").val())+1]?bwg_change_image(parseInt(jQuery("#bwg_current_image_key").val()),parseInt(jQuery("#bwg_current_image_key").val())+1):1==gallery_box_data.enable_loop&&bwg_change_image(parseInt(jQuery("#bwg_current_image_key").val()),0))},1e3*gallery_box_data.slideshow_interval))}function bwg_image_browser(e){if(jQuery("#bwg_embed_frame_16x9_"+e).width(jQuery("#bwg_embed_frame_16x9_"+e).parents(".image_browser_image_buttons_"+e).width()),jQuery("#bwg_embed_frame_16x9_"+e).height(.5625*jQuery("#bwg_embed_frame_16x9_"+e).width()),jQuery("#bwg_embed_frame_instapost_"+e).width(jQuery("#bwg_embed_frame_16x9_"+e).parents(".image_browser_image_buttons_"+e).width()),jQuery(".image_browser_images_conteiner_"+e).find(".fluid-width-video-wrapper").length){var t=jQuery(".image_browser_images_conteiner_"+e).find(".fluid-width-video-wrapper").contents();jQuery(".image_browser_images_conteiner_"+e).find(".fluid-width-video-wrapper").replaceWith(t)}jQuery(".bwg_embed_frame_instapost_"+e).height((jQuery(".bwg_embed_frame_instapost_"+e).width()-16)*jQuery(".bwg_embed_frame_instapost_"+e).attr("data-height")/jQuery(".bwg_embed_frame_instapost_"+e).attr("data-width")+96);var i=jQuery(".image_browser_images_"+e).width();i<=108?jQuery(".paging-input_"+e).css("display","none"):(i<=200?(jQuery(".paging-input_"+e).css("margin","0% 0% 0% 0%"),jQuery(".paging-input_"+e).css("display","inline")):i<=580?(jQuery(".paging-input_"+e).css("display","inline"),jQuery(".tablenav-pages_"+e+" a").css("font-size","13px"),jQuery(".paging-input_"+e).css("margin","0% 7% 0% 7%")):(jQuery(".tablenav-pages_"+e+" a").css("font-size","15px"),jQuery(".paging-input_"+e).css("margin","0% 14% 0% 14%"),jQuery(".paging-input_"+e).css("display","inline")),jQuery(".tablenav-pages_"+e+" .next-page").css("margin","0% 0% 0% 0%"),jQuery(".tablenav-pages_"+e+" .prev-page").css("margin","0% 0% 0% 0%"))}function bwg_disable_right_click(e){e.bind("contextmenu",function(){return!1}),e.css("webkitTouchCallout","none")}jQuery(document).ready(function(){document.addEventListener("visibilitychange",function(){var e=!1;jQuery(".bwg_container").each(function(){0<jQuery(this).find(".wd_error").length&&(e=!0)}),e||("visible"==document.visibilityState&&bwg_slideshow_focus(),"hidden"==document.visibilityState&&bwg_slideshow_blur())}),bwg_main_ready(),jQuery.fn.extend({hideShow:function(e){return this.checkForVisiblilityChange(e),this},checkForVisiblilityChange:function(e){if(this.length>>>0){for(var t,i,a,r=0;t=this[r++];){var _=jQuery(t).is(":visible");void 0===t.lastVisibility&&(t.lastVisibility=_),_!==t.lastVisibility&&(t.lastVisibility=_,"function"==typeof e&&e.apply(this,[new jQuery.Event("visibilityChanged"),_?"shown":"hidden"]),function(e,t){setTimeout(function(){jQuery(e).trigger("visibilityChanged",[t?"shown":"hidden"])},10)}(t,_))}i=this,a=arguments,setTimeout(function(){i.checkForVisiblilityChange.apply(i,a)},10)}}}),jQuery(this).hideShow(function(e,t){"shown"==t&&bwg_main_ready()})}),jQuery(window).on("resize",function(){var e=!1;jQuery(".bwg_container").each(function(){0<jQuery(this).find(".wd_error").length&&(e=!0)}),e||(jQuery(".bwg-thumbnails, .bwg-masonry-thumbnails, .bwg-album-thumbnails").each(function(){bwg_all_thumnails_loaded(this)}),bwg_slideshow_resize(),bwg_image_browser_resize(),bwg_carousel_resize(),bwg_blog_style_resize(),jQuery(".bwg-mosaic-thumbnails").each(function(){bwg_thumbnail_mosaic(this)})),bwg_resize_search_line()}),jQuery(window).on("load",function(){var e=!1;jQuery(".bwg_container").each(function(){0<jQuery(this).find(".wd_error").length&&(e=!0)}),e||(bwg_blog_style_onload(),jQuery(".bwg-mosaic-thumbnails").each(function(){bwg_thumbnail_mosaic(this)}))}),jQuery(".bwg-masonry-thumb-span img, .bwg-mosaic-thumb-span img").on("error",function(){jQuery(this).height(100),jQuery(this).width(100)});
|
photo-gallery.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: Photo Gallery
|
4 |
* Plugin URI: https://10web.io/plugins/wordpress-photo-gallery/?utm_source=photo_gallery&utm_medium=free_plugin
|
5 |
* Description: This plugin is a fully responsive gallery plugin with advanced functionality. It allows having different image galleries for your posts and pages. You can create unlimited number of galleries, combine them into albums, and provide descriptions and tags.
|
6 |
-
* Version: 1.5.
|
7 |
* Author: Photo Gallery Team
|
8 |
* Author URI: https://10web.io/plugins/?utm_source=photo_gallery&utm_medium=free_plugin
|
9 |
* License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
|
@@ -84,8 +84,8 @@ final class BWG {
|
|
84 |
$this->plugin_dir = WP_PLUGIN_DIR . "/" . plugin_basename(dirname(__FILE__));
|
85 |
$this->plugin_url = plugins_url(plugin_basename(dirname(__FILE__)));
|
86 |
$this->main_file = plugin_basename(__FILE__);
|
87 |
-
$this->plugin_version = '1.5.
|
88 |
-
$this->db_version = '1.5.
|
89 |
$this->prefix = 'bwg';
|
90 |
$this->nicename = __('Photo Gallery', $this->prefix);
|
91 |
|
@@ -223,21 +223,36 @@ final class BWG {
|
|
223 |
add_action( 'admin_init', array($this, 'add_privacy_policy_content') );
|
224 |
// Prevent adding shortcode conflict with some builders.
|
225 |
|
226 |
-
|
227 |
|
228 |
-
|
229 |
add_action('elementor/widgets/widgets_registered', array($this, 'register_elementor_widgets'));
|
230 |
|
231 |
//fires after elementor editor styles and scripts are enqueued.
|
232 |
add_action('elementor/editor/after_enqueue_styles', array($this, 'enqueue_editor_styles'), 11);
|
233 |
|
|
|
|
|
|
|
234 |
// Register 10Web category for Elementor widget if 10Web builder isn't installed.
|
235 |
add_action('elementor/elements/categories_registered', array($this, 'register_widget_category'), 1, 1);
|
236 |
|
237 |
// Add noindex/nofollow to custom posts to not allow search engines to index custom posts.
|
238 |
add_action('wp_head', array($this, 'robots'), 9, 1);
|
239 |
|
240 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
241 |
}
|
242 |
|
243 |
/**
|
@@ -655,6 +670,7 @@ final class BWG {
|
|
655 |
$params['tag'] = WDWLibrary::get('tag', 0);
|
656 |
$params['album_id'] = WDWLibrary::get('album_id', 0);
|
657 |
$params['theme_id'] = WDWLibrary::get('theme_id', 0);
|
|
|
658 |
$params['ajax'] = TRUE;
|
659 |
|
660 |
echo $this->shortcode($params);
|
@@ -970,7 +986,7 @@ final class BWG {
|
|
970 |
ob_start();
|
971 |
$url = add_query_arg(array('action' => 'shortcode_bwg', 'TB_iframe' => '1'), admin_url('admin-ajax.php'));
|
972 |
?>
|
973 |
-
<a onclick="if ( typeof tb_click == 'function' && (jQuery(this).parent().attr('id').indexOf('elementor') !== -1 || typeof bwg_check_ready == 'function') ) {
|
974 |
tb_click.call(this);
|
975 |
bwg_create_loading_block();
|
976 |
bwg_set_shortcode_popup_dimensions(); } return false;" href="<?php echo $url; ?>" class="bwg-shortcode-btn button" title="<?php _e('Insert Photo Gallery', $this->prefix); ?>">
|
@@ -1929,6 +1945,10 @@ final class BWG {
|
|
1929 |
}
|
1930 |
}
|
1931 |
|
|
|
|
|
|
|
|
|
1932 |
public function webinar_banner() {
|
1933 |
// Webinar banner
|
1934 |
if ( !class_exists( 'TWPGWebinar' ) ) {
|
@@ -1937,7 +1957,7 @@ final class BWG {
|
|
1937 |
new TWPGWebinar(array(
|
1938 |
'menu_postfix' => '_' . $this->prefix,
|
1939 |
'title' => 'Join the Webinar',
|
1940 |
-
'description' => 'How to Create Fully Functional WP Website with Beautiful Photo Gallery in Just an Hour + SPECIAL GIFT FOR WEBINAR ATTENDEES',
|
1941 |
'preview_type' => 'youtube',
|
1942 |
'preview_url' => 'A111ykjWdW8',
|
1943 |
'button_text' => 'SIGN UP',
|
3 |
* Plugin Name: Photo Gallery
|
4 |
* Plugin URI: https://10web.io/plugins/wordpress-photo-gallery/?utm_source=photo_gallery&utm_medium=free_plugin
|
5 |
* Description: This plugin is a fully responsive gallery plugin with advanced functionality. It allows having different image galleries for your posts and pages. You can create unlimited number of galleries, combine them into albums, and provide descriptions and tags.
|
6 |
+
* Version: 1.5.35
|
7 |
* Author: Photo Gallery Team
|
8 |
* Author URI: https://10web.io/plugins/?utm_source=photo_gallery&utm_medium=free_plugin
|
9 |
* License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
|
84 |
$this->plugin_dir = WP_PLUGIN_DIR . "/" . plugin_basename(dirname(__FILE__));
|
85 |
$this->plugin_url = plugins_url(plugin_basename(dirname(__FILE__)));
|
86 |
$this->main_file = plugin_basename(__FILE__);
|
87 |
+
$this->plugin_version = '1.5.35';
|
88 |
+
$this->db_version = '1.5.35';
|
89 |
$this->prefix = 'bwg';
|
90 |
$this->nicename = __('Photo Gallery', $this->prefix);
|
91 |
|
223 |
add_action( 'admin_init', array($this, 'add_privacy_policy_content') );
|
224 |
// Prevent adding shortcode conflict with some builders.
|
225 |
|
226 |
+
$this->before_shortcode_add_builder_editor();
|
227 |
|
228 |
+
// Register widget for Elementor builder.
|
229 |
add_action('elementor/widgets/widgets_registered', array($this, 'register_elementor_widgets'));
|
230 |
|
231 |
//fires after elementor editor styles and scripts are enqueued.
|
232 |
add_action('elementor/editor/after_enqueue_styles', array($this, 'enqueue_editor_styles'), 11);
|
233 |
|
234 |
+
add_action('elementor/editor/after_enqueue_scripts', array($this, 'enqueue_elementor_widget_scripts'));
|
235 |
+
|
236 |
+
|
237 |
// Register 10Web category for Elementor widget if 10Web builder isn't installed.
|
238 |
add_action('elementor/elements/categories_registered', array($this, 'register_widget_category'), 1, 1);
|
239 |
|
240 |
// Add noindex/nofollow to custom posts to not allow search engines to index custom posts.
|
241 |
add_action('wp_head', array($this, 'robots'), 9, 1);
|
242 |
|
243 |
+
// Divi frontend builder assets.
|
244 |
+
add_action('et_fb_enqueue_assets', array($this, 'enqueue_divi_bulder_assets'));
|
245 |
+
add_action('et_fb_enqueue_assets', array($this, 'global_script'));
|
246 |
+
|
247 |
+
// Add Photo Gallery images to sitemap xml.
|
248 |
+
require_once ($this->plugin_dir . '/framework/WDWSitemap.php');
|
249 |
+
add_filter('wd_seo_sitemap_images', array( WDWSitemap::instance(), 'add_wpseo_xml_sitemap_images'), 10, 2);
|
250 |
+
add_filter('wpseo_sitemap_urlimages', array( WDWSitemap::instance(), 'add_wpseo_xml_sitemap_images'), 10, 2);
|
251 |
+
}
|
252 |
+
|
253 |
+
public function enqueue_divi_bulder_assets() {
|
254 |
+
wp_enqueue_style('thickbox');
|
255 |
+
wp_enqueue_script('thickbox');
|
256 |
}
|
257 |
|
258 |
/**
|
670 |
$params['tag'] = WDWLibrary::get('tag', 0);
|
671 |
$params['album_id'] = WDWLibrary::get('album_id', 0);
|
672 |
$params['theme_id'] = WDWLibrary::get('theme_id', 0);
|
673 |
+
$params['current_url'] = WDWLibrary::get('current_url', NULL);
|
674 |
$params['ajax'] = TRUE;
|
675 |
|
676 |
echo $this->shortcode($params);
|
986 |
ob_start();
|
987 |
$url = add_query_arg(array('action' => 'shortcode_bwg', 'TB_iframe' => '1'), admin_url('admin-ajax.php'));
|
988 |
?>
|
989 |
+
<a onclick="if ( typeof tb_click == 'function' && ( jQuery(this).parent().attr('id') && jQuery(this).parent().attr('id').indexOf('elementor') !== -1 || typeof bwg_check_ready == 'function') ) {
|
990 |
tb_click.call(this);
|
991 |
bwg_create_loading_block();
|
992 |
bwg_set_shortcode_popup_dimensions(); } return false;" href="<?php echo $url; ?>" class="bwg-shortcode-btn button" title="<?php _e('Insert Photo Gallery', $this->prefix); ?>">
|
1945 |
}
|
1946 |
}
|
1947 |
|
1948 |
+
public function enqueue_elementor_widget_scripts() {
|
1949 |
+
wp_enqueue_script(BWG()->prefix . 'elementor_widget_js', plugins_url('js/bwg_elementor_widget.js', __FILE__), array( 'jquery' ));
|
1950 |
+
}
|
1951 |
+
|
1952 |
public function webinar_banner() {
|
1953 |
// Webinar banner
|
1954 |
if ( !class_exists( 'TWPGWebinar' ) ) {
|
1957 |
new TWPGWebinar(array(
|
1958 |
'menu_postfix' => '_' . $this->prefix,
|
1959 |
'title' => 'Join the Webinar',
|
1960 |
+
'description' => 'How to Create a Fully Functional WP Website with Beautiful Photo Gallery in Just an Hour + SPECIAL GIFT FOR WEBINAR ATTENDEES',
|
1961 |
'preview_type' => 'youtube',
|
1962 |
'preview_url' => 'A111ykjWdW8',
|
1963 |
'button_text' => 'SIGN UP',
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: webdorado,wdsupport,photogallerysupport,10web
|
|
3 |
Tags: gallery, photo gallery, image gallery, responsive gallery, wordpress gallery plugin, photo albums, gallery slider, gallery lightbox, wordpress photo gallery plugin, fullscreen gallery, watermarking, video gallery
|
4 |
Requires at least: 3.4
|
5 |
Tested up to: 5.2
|
6 |
-
Stable tag: 1.5.
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
@@ -54,7 +54,7 @@ You can display your media content in a responsive lightbox that comes with 15 s
|
|
54 |
|
55 |
= AUDIO AND VIDEO SUPPORT =
|
56 |
|
57 |
-
The Photo Gallery plugin allows you to include both videos and images within a single gallery. The WordPress Plugin supports YouTube, Vimeo, Instagram, Flickr or Dailymotion videos within Galleries. All you need to do is
|
58 |
|
59 |
= MULTIPLE WIDGETS =
|
60 |
|
@@ -165,7 +165,7 @@ Instagram: http://instagram.com/p/ykvv0puS4u, if you want to add the image toget
|
|
165 |
Flickr: https://www.flickr.com/photos/sui-fong/15250186998/in/gallery-flickr-72157648726328108/
|
166 |
**Videos**
|
167 |
YouTube: https://www.youtube.com/watch?v=fa4RLje-yM8
|
168 |
-
|
169 |
Dailymotion: http://www.dailymotion.com/video/xexaq0_frank-sinatra-strangers-in-the-nigh_music
|
170 |
|
171 |
**Bulk Embed.** This option will allow adding more than one images from specific social media (currently only Instagram account, but more options will be added with the upcoming updates) into the standard gallery. You should keep in mind that the images will be added without the possibility of auto-update.
|
@@ -282,8 +282,25 @@ Choose whether to display random or the first/last specific number of images.
|
|
282 |
|
283 |
== Changelog ==
|
284 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
285 |
= 1.5.34 =
|
286 |
-
*
|
|
|
287 |
|
288 |
= 1.5.33 =
|
289 |
* Fixed: Error from Instagram after connecting a Personal account.
|
@@ -431,9 +448,9 @@ Choose whether to display random or the first/last specific number of images.
|
|
431 |
* Added: Free plugin flow: When installing Manager, store plugin name or slug in a WP option.
|
432 |
|
433 |
= 1.5.11 =
|
434 |
-
* Fixed: Upload image when there is a
|
435 |
* Fixed: Bug on slideshow autoplay.
|
436 |
-
* Fixed: Bug when you put
|
437 |
* Fixed: Conflict with "BigSlam" theme.
|
438 |
* Fixed: Conflict with some ajax themes.
|
439 |
* Fixed: PNG and GIF crop.
|
@@ -516,8 +533,8 @@ Choose whether to display random or the first/last specific number of images.
|
|
516 |
* Improved: Use the largest image file instead of the original image when the original file doesn't exist to prevent errors.
|
517 |
* Improved: Gallery edit page load time.
|
518 |
* Improved: Disabled the cron functionality in the free version.
|
519 |
-
* Improved: Masonry view HTML / CSS / JS
|
520 |
-
* Improved: Mosaic view HTML / CSS / JS
|
521 |
* Improved: Albums "Back" button styles.
|
522 |
* Improved: Filemanager load time.
|
523 |
* Improved: Do not add hashtag ids to browser history.
|
@@ -593,6 +610,7 @@ Choose whether to display random or the first/last specific number of images.
|
|
593 |
* Fixed: Bug on opening lightbox with embed media.
|
594 |
|
595 |
= 1.4.10 =
|
|
|
596 |
* Changed: Separate buttons for deactivation.
|
597 |
|
598 |
= 1.4.9 =
|
@@ -890,7 +908,7 @@ Choose whether to display random or the first/last specific number of images.
|
|
890 |
|
891 |
= 1.3.16 =
|
892 |
* Fixed: Ampersand in watermark and advertisement text.
|
893 |
-
* Fixed: Lightbox
|
894 |
* Added: Google fonts.
|
895 |
* Changed: UploadHandler class name to prevent conflict with some themes.
|
896 |
|
@@ -983,14 +1001,14 @@ IMPORTANT: Instagram changed the API. You need to get a new access token by usin
|
|
983 |
* Added: Effect duration option.
|
984 |
|
985 |
= 1.2.103 =
|
986 |
-
* Fixed: Text watermark
|
987 |
* Added: Set/Reset watermark to all images at once.
|
988 |
* Fixed: Description for masonry album views.
|
989 |
|
990 |
= 1.2.102 =
|
991 |
* Fixed: Search also in description.
|
992 |
* Added: Options for slideshow widget.
|
993 |
-
* Fixed: Import from media
|
994 |
* Fixed: File manager loading.
|
995 |
|
996 |
= 1.2.101 =
|
@@ -1065,11 +1083,11 @@ IMPORTANT: Instagram changed the API. You need to get a new access token by usin
|
|
1065 |
|
1066 |
= 1.2.84 =
|
1067 |
* Added: Placeholder for search by name (optional).
|
1068 |
-
* Fixed: Styles
|
1069 |
|
1070 |
= 1.2.83 =
|
1071 |
* Fixed: Add selected images to gallery.
|
1072 |
-
* Fixed:
|
1073 |
|
1074 |
= 1.2.82 =
|
1075 |
* Added: "Load More..." translation.
|
@@ -1088,7 +1106,7 @@ IMPORTANT: Instagram changed the API. You need to get a new access token by usin
|
|
1088 |
* Fixed: Russian translation (Thanks to Ruslan Tertyshny).
|
1089 |
|
1090 |
= 1.2.78 =
|
1091 |
-
* Fixed:
|
1092 |
* Fixed: Undefined property on album widget.
|
1093 |
* Fixed: German backend translation.
|
1094 |
* Fixed: Dutch backend translation.
|
@@ -1199,10 +1217,10 @@ IMPORTANT: Instagram changed the API. You need to get a new access token by usin
|
|
1199 |
= 1.2.52 =
|
1200 |
* Added: Images count parameter for load more.
|
1201 |
* Fixed: Pinterest share.
|
1202 |
-
* Fixed:
|
1203 |
|
1204 |
= 1.2.51 =
|
1205 |
-
* Changed:
|
1206 |
|
1207 |
= 1.2.50 =
|
1208 |
* Fixed: JavaScript conflict with some themes.
|
@@ -1350,7 +1368,7 @@ This vulnerability was discovered by Fortinet's FortiGuard Labs.
|
|
1350 |
|
1351 |
= 1.2.11 =
|
1352 |
* security issue fixed.
|
1353 |
-
* bug in fullscreen button and
|
1354 |
|
1355 |
= 1.2.9 =
|
1356 |
* updated font-awesome to 4.2.0 version.
|
@@ -1472,16 +1490,18 @@ This vulnerability was discovered by Fortinet's FortiGuard Labs.
|
|
1472 |
* improved filemanager functionality, fix bug on widget.
|
1473 |
|
1474 |
= 1.0.5 =
|
1475 |
-
*
|
1476 |
|
1477 |
= 1.0.4 =
|
1478 |
-
*
|
|
|
|
|
1479 |
|
1480 |
= 1.0.3 =
|
1481 |
-
*
|
1482 |
|
1483 |
= 1.0.2 =
|
1484 |
-
* php 5.2
|
1485 |
|
1486 |
= 1.0.1 =
|
1487 |
* Initial version.
|
@@ -1491,7 +1511,7 @@ This vulnerability was discovered by Fortinet's FortiGuard Labs.
|
|
1491 |
1. Photo Gallery - Popup View
|
1492 |
2. Photo Gallery - Thumbnails View
|
1493 |
3. Photo Gallery - Image Browser View
|
1494 |
-
4. Photo Gallery -
|
1495 |
5. Photo Gallery - Mosaic View (Premium version)
|
1496 |
-
6. Photo Gallery -
|
1497 |
7. Photo Gallery - Galleries list
|
3 |
Tags: gallery, photo gallery, image gallery, responsive gallery, wordpress gallery plugin, photo albums, gallery slider, gallery lightbox, wordpress photo gallery plugin, fullscreen gallery, watermarking, video gallery
|
4 |
Requires at least: 3.4
|
5 |
Tested up to: 5.2
|
6 |
+
Stable tag: 1.5.35
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
54 |
|
55 |
= AUDIO AND VIDEO SUPPORT =
|
56 |
|
57 |
+
The Photo Gallery plugin allows you to include both videos and images within a single gallery. The WordPress Plugin supports YouTube, Vimeo, Instagram, Flickr or Dailymotion videos within Galleries. All you need to do is copy the URL of the video you want to include in the gallery plugin. It’s also possible to add audio tracks for the image slideshow.
|
58 |
|
59 |
= MULTIPLE WIDGETS =
|
60 |
|
165 |
Flickr: https://www.flickr.com/photos/sui-fong/15250186998/in/gallery-flickr-72157648726328108/
|
166 |
**Videos**
|
167 |
YouTube: https://www.youtube.com/watch?v=fa4RLje-yM8
|
168 |
+
Vimeo: http://vimeo.com/8110647
|
169 |
Dailymotion: http://www.dailymotion.com/video/xexaq0_frank-sinatra-strangers-in-the-nigh_music
|
170 |
|
171 |
**Bulk Embed.** This option will allow adding more than one images from specific social media (currently only Instagram account, but more options will be added with the upcoming updates) into the standard gallery. You should keep in mind that the images will be added without the possibility of auto-update.
|
282 |
|
283 |
== Changelog ==
|
284 |
|
285 |
+
= 1.5.35 =
|
286 |
+
* Added: Gallery, Gallery group, Tag edit links in widget for Elementor.
|
287 |
+
* Improved: Add gallery images to the XML generated with Yoast or Seo by 10Web.
|
288 |
+
* Updated: jQuery File Upload framework.
|
289 |
+
* Fixed: Shortcode buttons behaviour in Text widget of Divi Builder.
|
290 |
+
* Fixed: Vulnerabilities.
|
291 |
+
* Fixed: Opening shared URLs.
|
292 |
+
* Fixed: Click action on image title click.
|
293 |
+
* Fixed: Filmstrip arrows alignment.
|
294 |
+
* Fixed: Masonry layout after closing lightbox.
|
295 |
+
* Fixed: Do not reset shortcode options on 'Use default options' enable/disable.
|
296 |
+
* Fixed: Titles on masonry view.
|
297 |
+
* Fixed: Images ordering in lightbox.
|
298 |
+
* Fixed: Don't delete tags on deleting all images.
|
299 |
+
* Removed: Webinar banner.
|
300 |
+
|
301 |
= 1.5.34 =
|
302 |
+
* Added: Webinar banner.
|
303 |
+
* Fixed: More than one mosaic gallery on a page.
|
304 |
|
305 |
= 1.5.33 =
|
306 |
* Fixed: Error from Instagram after connecting a Personal account.
|
448 |
* Added: Free plugin flow: When installing Manager, store plugin name or slug in a WP option.
|
449 |
|
450 |
= 1.5.11 =
|
451 |
+
* Fixed: Upload image when there is a quote in the image metadata.
|
452 |
* Fixed: Bug on slideshow autoplay.
|
453 |
+
* Fixed: Bug when you put a Gallery Group after a Gallery with scroll load.
|
454 |
* Fixed: Conflict with "BigSlam" theme.
|
455 |
* Fixed: Conflict with some ajax themes.
|
456 |
* Fixed: PNG and GIF crop.
|
533 |
* Improved: Use the largest image file instead of the original image when the original file doesn't exist to prevent errors.
|
534 |
* Improved: Gallery edit page load time.
|
535 |
* Improved: Disabled the cron functionality in the free version.
|
536 |
+
* Improved: Masonry view HTML / CSS / JS structure.
|
537 |
+
* Improved: Mosaic view HTML / CSS / JS structure.
|
538 |
* Improved: Albums "Back" button styles.
|
539 |
* Improved: Filemanager load time.
|
540 |
* Improved: Do not add hashtag ids to browser history.
|
610 |
* Fixed: Bug on opening lightbox with embed media.
|
611 |
|
612 |
= 1.4.10 =
|
613 |
+
* Fixed: Removed Bom from Galleries.php.
|
614 |
* Changed: Separate buttons for deactivation.
|
615 |
|
616 |
= 1.4.9 =
|
908 |
|
909 |
= 1.3.16 =
|
910 |
* Fixed: Ampersand in watermark and advertisement text.
|
911 |
+
* Fixed: Lightbox controls toggle button on mobile.
|
912 |
* Added: Google fonts.
|
913 |
* Changed: UploadHandler class name to prevent conflict with some themes.
|
914 |
|
1001 |
* Added: Effect duration option.
|
1002 |
|
1003 |
= 1.2.103 =
|
1004 |
+
* Fixed: Text watermark responsiveness.
|
1005 |
* Added: Set/Reset watermark to all images at once.
|
1006 |
* Fixed: Description for masonry album views.
|
1007 |
|
1008 |
= 1.2.102 =
|
1009 |
* Fixed: Search also in description.
|
1010 |
* Added: Options for slideshow widget.
|
1011 |
+
* Fixed: Import from media library.
|
1012 |
* Fixed: File manager loading.
|
1013 |
|
1014 |
= 1.2.101 =
|
1083 |
|
1084 |
= 1.2.84 =
|
1085 |
* Added: Placeholder for search by name (optional).
|
1086 |
+
* Fixed: Styles conflict with Twenty Sixteen theme.
|
1087 |
|
1088 |
= 1.2.83 =
|
1089 |
* Fixed: Add selected images to gallery.
|
1090 |
+
* Fixed: Control buttons and filmstrip conflict in lightbox.
|
1091 |
|
1092 |
= 1.2.82 =
|
1093 |
* Added: "Load More..." translation.
|
1106 |
* Fixed: Russian translation (Thanks to Ruslan Tertyshny).
|
1107 |
|
1108 |
= 1.2.78 =
|
1109 |
+
* Fixed: Compatibility with Wordpress 4.4.
|
1110 |
* Fixed: Undefined property on album widget.
|
1111 |
* Fixed: German backend translation.
|
1112 |
* Fixed: Dutch backend translation.
|
1217 |
= 1.2.52 =
|
1218 |
* Added: Images count parameter for load more.
|
1219 |
* Fixed: Pinterest share.
|
1220 |
+
* Fixed: Deprecated function in carousel.
|
1221 |
|
1222 |
= 1.2.51 =
|
1223 |
+
* Changed: Compatibility with Wordpress 4.3.
|
1224 |
|
1225 |
= 1.2.50 =
|
1226 |
* Fixed: JavaScript conflict with some themes.
|
1368 |
|
1369 |
= 1.2.11 =
|
1370 |
* security issue fixed.
|
1371 |
+
* bug in fullscreen button and loading image animation fixed.
|
1372 |
|
1373 |
= 1.2.9 =
|
1374 |
* updated font-awesome to 4.2.0 version.
|
1490 |
* improved filemanager functionality, fix bug on widget.
|
1491 |
|
1492 |
= 1.0.5 =
|
1493 |
+
* Fixed: File manager.
|
1494 |
|
1495 |
= 1.0.4 =
|
1496 |
+
* New: Added shortcode generator
|
1497 |
+
* New: Thumbnail title, thumb size in filemanager.
|
1498 |
+
* Fixed: Slideshow.
|
1499 |
|
1500 |
= 1.0.3 =
|
1501 |
+
* Fixed: Album view.
|
1502 |
|
1503 |
= 1.0.2 =
|
1504 |
+
* Fixed: php 5.2 compatibility.
|
1505 |
|
1506 |
= 1.0.1 =
|
1507 |
* Initial version.
|
1511 |
1. Photo Gallery - Popup View
|
1512 |
2. Photo Gallery - Thumbnails View
|
1513 |
3. Photo Gallery - Image Browser View
|
1514 |
+
4. Photo Gallery - Masonry View (Premium version)
|
1515 |
5. Photo Gallery - Mosaic View (Premium version)
|
1516 |
+
6. Photo Gallery - Shortcode popup
|
1517 |
7. Photo Gallery - Galleries list
|