Version Description
Download this release
Release Info
Code changes from version 1.3.41 to 1.3.42
- admin/import/class-parsers.php +2 -2
- admin/includes/wpr-conditions-manager.php +3 -1
- admin/includes/wpr-render-templates.php +6 -4
- admin/includes/wpr-templates-actions.php +38 -22
- admin/includes/wpr-templates-library.php +133 -129
- admin/includes/wpr-templates-loop.php +17 -12
- admin/includes/wpr-templates-modal-popups.php +8 -8
- admin/includes/wpr-templates-shortcode.php +4 -2
- admin/plugin-options.php +26 -24
- admin/popups.php +6 -4
- admin/premade-blocks.php +4 -2
- admin/templates-kit.php +567 -551
- admin/templates/views/royal/theme-header-royal.php +1 -1
- admin/templates/views/storefront/class-storefront-compat.php +2 -1
- admin/templates/views/theme-header.php +1 -1
- admin/templates/wpr-templates-data.php +69 -3
- admin/templates/wpr-templates-library-blocks.php +7 -5
- admin/templates/wpr-templates-library-popups.php +108 -106
- admin/templates/wpr-templates-pages.php +3 -1
- admin/theme-builder.php +133 -131
- assets/css/admin/premade-blocks.css +436 -436
- assets/css/editor.min.css +1 -0
- assets/css/lib/animations/button-animations.css +1629 -1629
- assets/css/lib/animations/wpr-link-animations.css +191 -191
- assets/css/lib/lightgallery/lightgallery.css +982 -982
- assets/js/admin/plugin-options.js +0 -1
- assets/js/admin/templates-kit.js +1 -1
- assets/js/frontend.js +15 -13
- assets/js/frontend.min.js +1 -1
- assets/js/lib/lightgallery/lightgallery.js +2912 -2912
- assets/js/lib/perfect-scrollbar/perfect-scrollbar.js +1324 -1324
- assets/js/library-editor.js +319 -319
- base/module-base.php +3 -3
- classes/plugin-sale-notice.php +6 -6
- classes/plugin-update-notice.php +4 -4
- classes/utilities.php +31 -25
- classes/wpr-post-likes.php +15 -13
- extensions/wpr-custom-css.php +3 -1
- extensions/wpr-parallax.php +6 -4
- extensions/wpr-particles.php +3 -1
- extensions/wpr-reading-progress-bar.php +200 -217
- extensions/wpr-sticky-section.php +3 -1
- freemius/assets/css/admin/affiliation.css +11 -11
- freemius/includes/class-freemius.php +0 -5720
admin/import/class-parsers.php
CHANGED
@@ -97,7 +97,7 @@ class WXR_Parser_Regex {
|
|
97 |
|
98 |
foreach ( $multiline_tags as $tag => $handler ) {
|
99 |
// Handle multi-line tags on a singular line.
|
100 |
-
if ( preg_match( '|<'
|
101 |
$this->{$handler[0]}[] = call_user_func( $handler[1], $matches[1] );
|
102 |
|
103 |
continue;
|
@@ -969,7 +969,7 @@ class WXR_Parser_XML {
|
|
969 |
if ( $this->in_sub_tag ) {
|
970 |
$this->sub_data[ $this->in_sub_tag ] = $this->cdata;
|
971 |
$this->in_sub_tag = false;
|
972 |
-
}
|
973 |
$this->data[ $this->in_tag ] = $this->cdata;
|
974 |
$this->in_tag = false;
|
975 |
}
|
97 |
|
98 |
foreach ( $multiline_tags as $tag => $handler ) {
|
99 |
// Handle multi-line tags on a singular line.
|
100 |
+
if ( preg_match( '|<'. $tag .'>(.*?)</'. $tag .'>|is', $importline, $matches ) ) {
|
101 |
$this->{$handler[0]}[] = call_user_func( $handler[1], $matches[1] );
|
102 |
|
103 |
continue;
|
969 |
if ( $this->in_sub_tag ) {
|
970 |
$this->sub_data[ $this->in_sub_tag ] = $this->cdata;
|
971 |
$this->in_sub_tag = false;
|
972 |
+
} elseif ( $this->in_tag ) {
|
973 |
$this->data[ $this->in_tag ] = $this->cdata;
|
974 |
$this->in_tag = false;
|
975 |
}
|
admin/includes/wpr-conditions-manager.php
CHANGED
@@ -3,7 +3,9 @@ namespace WprAddons\Admin\Includes;
|
|
3 |
|
4 |
use WprAddons\Classes\Utilities;
|
5 |
|
6 |
-
if ( ! defined( 'ABSPATH' ) )
|
|
|
|
|
7 |
|
8 |
/**
|
9 |
* WPR_Conditions_Manager setup
|
3 |
|
4 |
use WprAddons\Classes\Utilities;
|
5 |
|
6 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
7 |
+
exit; // Exit if accessed directly.
|
8 |
+
}
|
9 |
|
10 |
/**
|
11 |
* WPR_Conditions_Manager setup
|
admin/includes/wpr-render-templates.php
CHANGED
@@ -3,7 +3,9 @@ namespace WprAddons\Admin\Includes;
|
|
3 |
|
4 |
use WprAddons\Classes\Utilities;
|
5 |
|
6 |
-
if ( ! defined( 'ABSPATH' ) )
|
|
|
|
|
7 |
|
8 |
/**
|
9 |
* WPR_Render_Templates setup
|
@@ -48,13 +50,13 @@ class WPR_Render_Templates {
|
|
48 |
if ( 'astra' === $this->current_theme ) {
|
49 |
require_once(__DIR__ . '/../templates/views/astra/class-astra-compat.php');
|
50 |
|
51 |
-
}
|
52 |
require_once(__DIR__ . '/../templates/views/generatepress/class-generatepress-compat.php');
|
53 |
|
54 |
-
}
|
55 |
require_once(__DIR__ . '/../templates/views/oceanwp/class-oceanwp-compat.php');
|
56 |
|
57 |
-
}
|
58 |
require_once(__DIR__ . '/../templates/views/storefront/class-storefront-compat.php');
|
59 |
|
60 |
// Other Themes
|
3 |
|
4 |
use WprAddons\Classes\Utilities;
|
5 |
|
6 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
7 |
+
exit; // Exit if accessed directly.
|
8 |
+
}
|
9 |
|
10 |
/**
|
11 |
* WPR_Render_Templates setup
|
50 |
if ( 'astra' === $this->current_theme ) {
|
51 |
require_once(__DIR__ . '/../templates/views/astra/class-astra-compat.php');
|
52 |
|
53 |
+
} elseif ( 'generatepress' === $this->current_theme ) {
|
54 |
require_once(__DIR__ . '/../templates/views/generatepress/class-generatepress-compat.php');
|
55 |
|
56 |
+
} elseif ( 'oceanwp' === $this->current_theme ) {
|
57 |
require_once(__DIR__ . '/../templates/views/oceanwp/class-oceanwp-compat.php');
|
58 |
|
59 |
+
} elseif ( 'storefront' === $this->current_theme ) {
|
60 |
require_once(__DIR__ . '/../templates/views/storefront/class-storefront-compat.php');
|
61 |
|
62 |
// Other Themes
|
admin/includes/wpr-templates-actions.php
CHANGED
@@ -6,7 +6,9 @@ use Elementor\TemplateLibrary\Source_Base;
|
|
6 |
use Elementor\Core\Common\Modules\Ajax\Module as Ajax;
|
7 |
use WprAddons\Classes\Utilities;
|
8 |
|
9 |
-
if ( ! defined( 'ABSPATH' ) )
|
|
|
|
|
10 |
|
11 |
|
12 |
/**
|
@@ -45,71 +47,81 @@ class WPR_Templates_Actions {
|
|
45 |
** Save Template Conditions
|
46 |
*/
|
47 |
public function wpr_save_template_conditions() {
|
|
|
|
|
48 |
// Header
|
49 |
if ( isset($_POST['wpr_header_conditions']) ) {
|
50 |
-
update_option( 'wpr_header_conditions', $this->sanitize_conditions($_POST['wpr_header_conditions']) );
|
51 |
|
52 |
-
|
53 |
-
|
|
|
54 |
}
|
55 |
}
|
56 |
|
57 |
// Footer
|
58 |
if ( isset($_POST['wpr_footer_conditions']) ) {
|
59 |
-
update_option( 'wpr_footer_conditions', $this->sanitize_conditions($_POST['wpr_footer_conditions']) );
|
60 |
|
61 |
-
|
62 |
-
|
|
|
63 |
}
|
64 |
}
|
65 |
|
66 |
// Archive
|
67 |
if ( isset($_POST['wpr_archive_conditions']) ) {
|
68 |
-
update_option( 'wpr_archive_conditions', $this->sanitize_conditions($_POST['wpr_archive_conditions']) );
|
69 |
}
|
70 |
|
71 |
// Single
|
72 |
if ( isset($_POST['wpr_single_conditions']) ) {
|
73 |
-
update_option( 'wpr_single_conditions', $this->sanitize_conditions($_POST['wpr_single_conditions']) );
|
74 |
}
|
75 |
|
76 |
// Product Archive
|
77 |
if ( isset($_POST['wpr_product_archive_conditions']) ) {
|
78 |
-
update_option( 'wpr_product_archive_conditions', $this->sanitize_conditions($_POST['wpr_product_archive_conditions']) );
|
79 |
}
|
80 |
|
81 |
// Product Single
|
82 |
if ( isset($_POST['wpr_product_single_conditions']) ) {
|
83 |
-
update_option( 'wpr_product_single_conditions', $this->sanitize_conditions($_POST['wpr_product_single_conditions']) );
|
84 |
}
|
85 |
|
86 |
// Popup
|
87 |
if ( isset($_POST['wpr_popup_conditions']) ) {
|
88 |
-
update_option( 'wpr_popup_conditions', $this->sanitize_conditions($_POST['wpr_popup_conditions']) );
|
89 |
}
|
90 |
}
|
91 |
|
92 |
public function sanitize_conditions( $data ) {
|
93 |
-
return
|
94 |
}
|
95 |
|
96 |
/**
|
97 |
** Create Template
|
98 |
*/
|
99 |
public function wpr_create_template() {
|
100 |
-
|
|
|
|
|
|
|
|
|
|
|
101 |
// Create
|
102 |
$template_id = wp_insert_post(array (
|
103 |
-
'post_type' =>
|
104 |
-
'post_title' =>
|
105 |
-
'post_name' =>
|
106 |
'post_content' => '',
|
107 |
'post_status' => 'publish'
|
108 |
));
|
109 |
|
110 |
// Set Types
|
111 |
if ( 'wpr_templates' === $_POST['user_template_library'] ) {
|
112 |
-
|
|
|
113 |
|
114 |
if ( 'popup' === $_POST['user_template_type'] ) {
|
115 |
update_post_meta( $template_id, '_elementor_template_type', 'wpr-popups' );
|
@@ -122,7 +134,7 @@ class WPR_Templates_Actions {
|
|
122 |
update_post_meta( $template_id, '_elementor_template_type', 'wpr-theme-builder' );
|
123 |
}
|
124 |
|
125 |
-
update_post_meta( $template_id, '_wpr_template_type',
|
126 |
}
|
127 |
} else {
|
128 |
update_post_meta( $template_id, '_elementor_template_type', 'page' );
|
@@ -132,7 +144,7 @@ class WPR_Templates_Actions {
|
|
132 |
update_post_meta( $template_id, '_wp_page_template', 'elementor_canvas' ); //tmp - maybe set for wpr_templates only
|
133 |
|
134 |
// Send ID to JS
|
135 |
-
echo $template_id;
|
136 |
}
|
137 |
}
|
138 |
|
@@ -141,9 +153,10 @@ class WPR_Templates_Actions {
|
|
141 |
*/
|
142 |
public function wpr_import_library_template() {
|
143 |
$source = new WPR_Library_Source();
|
|
|
144 |
|
145 |
$data = $source->get_data([
|
146 |
-
'template_id' => $
|
147 |
]);
|
148 |
|
149 |
echo json_encode($data);
|
@@ -153,7 +166,10 @@ class WPR_Templates_Actions {
|
|
153 |
** Reset Template
|
154 |
*/
|
155 |
public function wpr_delete_template() {
|
156 |
-
$
|
|
|
|
|
|
|
157 |
wp_delete_post( $post->ID, true );
|
158 |
}
|
159 |
|
6 |
use Elementor\Core\Common\Modules\Ajax\Module as Ajax;
|
7 |
use WprAddons\Classes\Utilities;
|
8 |
|
9 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
10 |
+
exit; // Exit if accessed directly.
|
11 |
+
}
|
12 |
|
13 |
|
14 |
/**
|
47 |
** Save Template Conditions
|
48 |
*/
|
49 |
public function wpr_save_template_conditions() {
|
50 |
+
$template = isset($_POST['template']) ? sanitize_text_field(wp_unslash($_POST['template'])): false;
|
51 |
+
|
52 |
// Header
|
53 |
if ( isset($_POST['wpr_header_conditions']) ) {
|
54 |
+
update_option( 'wpr_header_conditions', $this->sanitize_conditions($_POST['wpr_header_conditions']) ); // phpcs:ignore
|
55 |
|
56 |
+
$wpr_header_show_on_canvas = isset($_POST['wpr_header_show_on_canvas']) ? sanitize_text_field(wp_unslash($_POST['wpr_header_show_on_canvas'])): false;
|
57 |
+
if ( $wpr_header_show_on_canvas && $template ) {
|
58 |
+
update_post_meta( Utilities::get_template_id($template), 'wpr_header_show_on_canvas', $wpr_header_show_on_canvas );
|
59 |
}
|
60 |
}
|
61 |
|
62 |
// Footer
|
63 |
if ( isset($_POST['wpr_footer_conditions']) ) {
|
64 |
+
update_option( 'wpr_footer_conditions', $this->sanitize_conditions($_POST['wpr_footer_conditions']) ); // phpcs:ignore
|
65 |
|
66 |
+
$wpr_footer_show_on_canvas = isset($_POST['wpr_footer_show_on_canvas']) ? sanitize_text_field(wp_unslash($_POST['wpr_footer_show_on_canvas'])): false;
|
67 |
+
if ( $wpr_footer_show_on_canvas && $template ) {
|
68 |
+
update_post_meta( Utilities::get_template_id($template), 'wpr_footer_show_on_canvas', $wpr_footer_show_on_canvas );
|
69 |
}
|
70 |
}
|
71 |
|
72 |
// Archive
|
73 |
if ( isset($_POST['wpr_archive_conditions']) ) {
|
74 |
+
update_option( 'wpr_archive_conditions', $this->sanitize_conditions($_POST['wpr_archive_conditions']) ); // phpcs:ignore
|
75 |
}
|
76 |
|
77 |
// Single
|
78 |
if ( isset($_POST['wpr_single_conditions']) ) {
|
79 |
+
update_option( 'wpr_single_conditions', $this->sanitize_conditions($_POST['wpr_single_conditions']) ); // phpcs:ignore
|
80 |
}
|
81 |
|
82 |
// Product Archive
|
83 |
if ( isset($_POST['wpr_product_archive_conditions']) ) {
|
84 |
+
update_option( 'wpr_product_archive_conditions', $this->sanitize_conditions($_POST['wpr_product_archive_conditions']) ); // phpcs:ignore
|
85 |
}
|
86 |
|
87 |
// Product Single
|
88 |
if ( isset($_POST['wpr_product_single_conditions']) ) {
|
89 |
+
update_option( 'wpr_product_single_conditions', $this->sanitize_conditions($_POST['wpr_product_single_conditions']) ); // phpcs:ignore
|
90 |
}
|
91 |
|
92 |
// Popup
|
93 |
if ( isset($_POST['wpr_popup_conditions']) ) {
|
94 |
+
update_option( 'wpr_popup_conditions', $this->sanitize_conditions($_POST['wpr_popup_conditions']) ); // phpcs:ignore
|
95 |
}
|
96 |
}
|
97 |
|
98 |
public function sanitize_conditions( $data ) {
|
99 |
+
return wp_unslash( json_encode( array_filter( json_decode(stripcslashes($data), true) ) ) );
|
100 |
}
|
101 |
|
102 |
/**
|
103 |
** Create Template
|
104 |
*/
|
105 |
public function wpr_create_template() {
|
106 |
+
$user_template_type = isset($_POST['user_template_type']) ? sanitize_text_field(wp_unslash($_POST['user_template_type'])): false;
|
107 |
+
$user_template_library = isset($_POST['user_template_library']) ? sanitize_text_field(wp_unslash($_POST['user_template_library'])): false;
|
108 |
+
$user_template_title = isset($_POST['user_template_title']) ? sanitize_text_field(wp_unslash($_POST['user_template_title'])): false;
|
109 |
+
$user_template_slug = isset($_POST['user_template_slug']) ? sanitize_text_field(wp_unslash($_POST['user_template_slug'])): false;
|
110 |
+
|
111 |
+
if ( $user_template_title ) {
|
112 |
// Create
|
113 |
$template_id = wp_insert_post(array (
|
114 |
+
'post_type' => $user_template_library,
|
115 |
+
'post_title' => $user_template_title,
|
116 |
+
'post_name' => $user_template_slug,
|
117 |
'post_content' => '',
|
118 |
'post_status' => 'publish'
|
119 |
));
|
120 |
|
121 |
// Set Types
|
122 |
if ( 'wpr_templates' === $_POST['user_template_library'] ) {
|
123 |
+
|
124 |
+
wp_set_object_terms( $template_id, [$user_template_type, 'user'], 'wpr_template_type' );
|
125 |
|
126 |
if ( 'popup' === $_POST['user_template_type'] ) {
|
127 |
update_post_meta( $template_id, '_elementor_template_type', 'wpr-popups' );
|
134 |
update_post_meta( $template_id, '_elementor_template_type', 'wpr-theme-builder' );
|
135 |
}
|
136 |
|
137 |
+
update_post_meta( $template_id, '_wpr_template_type', $user_template_type );
|
138 |
}
|
139 |
} else {
|
140 |
update_post_meta( $template_id, '_elementor_template_type', 'page' );
|
144 |
update_post_meta( $template_id, '_wp_page_template', 'elementor_canvas' ); //tmp - maybe set for wpr_templates only
|
145 |
|
146 |
// Send ID to JS
|
147 |
+
echo esc_html($template_id);
|
148 |
}
|
149 |
}
|
150 |
|
153 |
*/
|
154 |
public function wpr_import_library_template() {
|
155 |
$source = new WPR_Library_Source();
|
156 |
+
$slug = isset($_POST['slug']) ? sanitize_text_field(wp_unslash($_POST['slug'])): '';
|
157 |
|
158 |
$data = $source->get_data([
|
159 |
+
'template_id' => $slug
|
160 |
]);
|
161 |
|
162 |
echo json_encode($data);
|
166 |
** Reset Template
|
167 |
*/
|
168 |
public function wpr_delete_template() {
|
169 |
+
$template_slug = isset($_POST['template_slug']) ? sanitize_text_field(wp_unslash($_POST['template_slug'])): '';
|
170 |
+
$template_library = isset($_POST['template_library']) ? sanitize_text_field(wp_unslash($_POST['template_library'])): '';
|
171 |
+
|
172 |
+
$post = get_page_by_path( $template_slug, OBJECT, $template_library );
|
173 |
wp_delete_post( $post->ID, true );
|
174 |
}
|
175 |
|
admin/includes/wpr-templates-library.php
CHANGED
@@ -1,130 +1,134 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
if ( ! defined( 'ABSPATH' ) )
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
use WprAddons\Admin\Includes\
|
8 |
-
use WprAddons\Admin\Includes\
|
9 |
-
use WprAddons\Admin\
|
10 |
-
use WprAddons\Admin\
|
11 |
-
use WprAddons\Admin\Templates\
|
12 |
-
use WprAddons\
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
*
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
add_action( '
|
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 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
|
|
|
|
|
|
|
|
130 |
new WPR_Templates_Library();
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
4 |
+
exit; // Exit if accessed directly.
|
5 |
+
}
|
6 |
+
|
7 |
+
use WprAddons\Admin\Includes\WPR_Render_Templates;
|
8 |
+
use WprAddons\Admin\Includes\WPR_Templates_Shortcode;
|
9 |
+
use WprAddons\Admin\Includes\WPR_Templates_Modal_Popups;
|
10 |
+
use WprAddons\Admin\Includes\WPR_Templates_Actions;
|
11 |
+
use WprAddons\Admin\Templates\WPR_Templates_Library_Blocks;
|
12 |
+
use WprAddons\Admin\Templates\WPR_Templates_Library_Popups;
|
13 |
+
use WprAddons\Admin\Templates\WPR_Templates_Library_Pages;
|
14 |
+
use WprAddons\Classes\Utilities;
|
15 |
+
|
16 |
+
/**
|
17 |
+
* WPR_Templates_Library setup
|
18 |
+
*
|
19 |
+
* @since 1.0
|
20 |
+
*/
|
21 |
+
class WPR_Templates_Library {
|
22 |
+
|
23 |
+
/**
|
24 |
+
** Constructor
|
25 |
+
*/
|
26 |
+
public function __construct() {
|
27 |
+
|
28 |
+
// Register CPTs
|
29 |
+
add_action( 'init', [ $this, 'register_templates_library_cpt' ] );
|
30 |
+
add_action( 'template_redirect', [ $this, 'block_template_frontend' ] );
|
31 |
+
add_action( 'current_screen', [ $this, 'redirect_to_options_page' ] );
|
32 |
+
|
33 |
+
// Templates Shortcode
|
34 |
+
new WPR_Templates_Shortcode();
|
35 |
+
|
36 |
+
// Init Popups
|
37 |
+
new WPR_Templates_Modal_Popups();
|
38 |
+
|
39 |
+
// Init Theme Builder
|
40 |
+
new WPR_Render_Templates();
|
41 |
+
|
42 |
+
// Template Actions
|
43 |
+
new WPR_Templates_Actions();
|
44 |
+
|
45 |
+
// Add Blocks to Library
|
46 |
+
new WPR_Templates_Library_Blocks();
|
47 |
+
|
48 |
+
// Add Popups to Library
|
49 |
+
new WPR_Templates_Library_Popups();
|
50 |
+
|
51 |
+
// Add Pages to Library
|
52 |
+
// new WPR_Templates_Library_Pages();
|
53 |
+
|
54 |
+
// Enable Elementor for 'wpr_templates'
|
55 |
+
$this->add_elementor_cpt_support();
|
56 |
+
|
57 |
+
}
|
58 |
+
|
59 |
+
/**
|
60 |
+
** Register Templates Library
|
61 |
+
*/
|
62 |
+
public function redirect_to_options_page() {
|
63 |
+
if ( get_current_screen()->post_type == 'wpr_templates' && isset($_GET['action']) && $_GET['action'] == 'edit' ) {
|
64 |
+
$elementor_template_type = isset($_GET['post']) ? sanitize_text_field(wp_unslash($_GET['post'])) : '';
|
65 |
+
|
66 |
+
if ( 'wpr-popups' === Utilities::get_elementor_template_type( $elementor_template_type ) ) {
|
67 |
+
wp_redirect('admin.php?page=wpr-popups');
|
68 |
+
} else {
|
69 |
+
wp_redirect('admin.php?page=wpr-theme-builder');
|
70 |
+
}
|
71 |
+
}
|
72 |
+
}
|
73 |
+
|
74 |
+
public function register_templates_library_cpt() {
|
75 |
+
|
76 |
+
$args = array(
|
77 |
+
'label' => esc_html__( 'Royal Templates', 'wpr-addons' ),
|
78 |
+
'public' => true,
|
79 |
+
'rewrite' => false,
|
80 |
+
'show_ui' => true,
|
81 |
+
'show_in_menu' => false,
|
82 |
+
'show_in_nav_menus' => false,
|
83 |
+
'exclude_from_search' => true,
|
84 |
+
'capability_type' => 'post',
|
85 |
+
'hierarchical' => false,
|
86 |
+
);
|
87 |
+
|
88 |
+
register_post_type( 'wpr_templates', $args );
|
89 |
+
|
90 |
+
$tax_args = [
|
91 |
+
'hierarchical' => true,
|
92 |
+
'show_ui' => true,
|
93 |
+
'show_in_nav_menus' => false,
|
94 |
+
'show_admin_column' => true,
|
95 |
+
'query_var' => is_admin(),
|
96 |
+
'rewrite' => false,
|
97 |
+
'public' => false,
|
98 |
+
];
|
99 |
+
|
100 |
+
register_taxonomy( 'wpr_template_type', 'wpr_templates', $tax_args );
|
101 |
+
|
102 |
+
}
|
103 |
+
|
104 |
+
/**
|
105 |
+
** Don't display on the frontend for non edit_posts capable users
|
106 |
+
*/
|
107 |
+
public function block_template_frontend() {
|
108 |
+
if ( is_singular( 'wpr_templates' ) && ! current_user_can( 'edit_posts' ) ) {
|
109 |
+
wp_redirect( site_url(), 301 );
|
110 |
+
die;
|
111 |
+
}
|
112 |
+
}
|
113 |
+
|
114 |
+
/**
|
115 |
+
*** Add elementor support for wpr_templates.
|
116 |
+
**/
|
117 |
+
function add_elementor_cpt_support() {
|
118 |
+
if ( ! is_admin() ) {
|
119 |
+
return;
|
120 |
+
}
|
121 |
+
|
122 |
+
$cpt_support = get_option( 'elementor_cpt_support' );
|
123 |
+
|
124 |
+
if ( ! $cpt_support ) {
|
125 |
+
update_option( 'elementor_cpt_support', ['post', 'page', 'wpr_templates'] );
|
126 |
+
} elseif ( ! in_array( 'wpr_templates', $cpt_support ) ) {
|
127 |
+
$cpt_support[] = 'wpr_templates';
|
128 |
+
update_option( 'elementor_cpt_support', $cpt_support );
|
129 |
+
}
|
130 |
+
}
|
131 |
+
|
132 |
+
}
|
133 |
+
|
134 |
new WPR_Templates_Library();
|
admin/includes/wpr-templates-loop.php
CHANGED
@@ -2,7 +2,9 @@
|
|
2 |
|
3 |
namespace WprAddons\Admin\Includes;
|
4 |
|
5 |
-
if ( ! defined( 'ABSPATH' ) )
|
|
|
|
|
6 |
|
7 |
use WprAddons\Classes\Utilities;
|
8 |
|
@@ -94,7 +96,7 @@ class WPR_Templates_Loop {
|
|
94 |
|
95 |
// List
|
96 |
echo '<li>';
|
97 |
-
echo '<h3 class="wpr-title">'. $user_template->post_title .'</h3>';
|
98 |
|
99 |
echo '<span class="wpr-action-buttons">';
|
100 |
echo '<a href="'. esc_url($edit_url) .'" class="wpr-edit-template button button-primary">'. esc_html__( 'Edit', 'wpr-addons' ) .'</a>';
|
@@ -114,6 +116,9 @@ class WPR_Templates_Loop {
|
|
114 |
** Render Conditions Popup
|
115 |
*/
|
116 |
public static function render_conditions_popup( $canvas = false ) {
|
|
|
|
|
|
|
117 |
|
118 |
?>
|
119 |
|
@@ -140,7 +145,7 @@ class WPR_Templates_Loop {
|
|
140 |
</select>
|
141 |
<!-- Archive -->
|
142 |
<select name="archives_condition_select" class="archives-condition-select">
|
143 |
-
<?php if ( 'wpr_tab_product_archive' !== $
|
144 |
<option value="all_archives"><?php esc_html_e( 'All Archives', 'wpr-addons' ); ?></option>
|
145 |
<option value="posts"><?php esc_html_e( 'Posts Archive', 'wpr-addons' ); ?></option>
|
146 |
<option value="author"><?php esc_html_e( 'Author Archive', 'wpr-addons' ); ?></option>
|
@@ -151,7 +156,7 @@ class WPR_Templates_Loop {
|
|
151 |
<?php // Custom Taxonomies
|
152 |
$custom_taxonomies = Utilities::get_custom_types_of( 'tax', true );
|
153 |
foreach ($custom_taxonomies as $key => $value) {
|
154 |
-
if ( 'wpr_tab_header' !== $
|
155 |
continue;
|
156 |
} elseif ( 'product_cat' === $key ) {
|
157 |
echo '<option value="products">'. esc_html__( 'Products Archive', 'wpr-addons' ) .'</option>';
|
@@ -169,7 +174,7 @@ class WPR_Templates_Loop {
|
|
169 |
</select>
|
170 |
<!-- Single -->
|
171 |
<select name="singles_condition_select" class="singles-condition-select">
|
172 |
-
<?php if ( 'wpr_tab_product_single' !== $
|
173 |
<option value="front_page"><?php esc_html_e( 'Front Page', 'wpr-addons' ); ?></option>
|
174 |
<option value="page_404"><?php esc_html_e( '404 Page', 'wpr-addons' ); ?></option>
|
175 |
<option value="pages" class="custom-ids"><?php esc_html_e( 'Pages', 'wpr-addons' ); ?></option>
|
@@ -177,7 +182,7 @@ class WPR_Templates_Loop {
|
|
177 |
<?php // Custom Post Types
|
178 |
$custom_taxonomies = Utilities::get_custom_types_of( 'post', true );
|
179 |
foreach ($custom_taxonomies as $key => $value) {
|
180 |
-
if ( 'wpr_tab_header' !== $
|
181 |
continue;
|
182 |
}
|
183 |
|
@@ -204,8 +209,8 @@ class WPR_Templates_Loop {
|
|
204 |
<!-- Archive -->
|
205 |
<select name="archives_condition_select" class="archives-condition-select">
|
206 |
|
207 |
-
<?php if ( 'wpr_tab_product_archive' !== $
|
208 |
-
<?php if ( 'wpr_tab_archive' === $
|
209 |
<option value="all_archives"><?php esc_html_e( 'All Archives', 'wpr-addons' ); ?></option>
|
210 |
<option value="posts"><?php esc_html_e( 'Posts Archive', 'wpr-addons' ); ?></option>
|
211 |
<option value="author"><?php esc_html_e( 'Author Archive', 'wpr-addons' ); ?></option>
|
@@ -224,7 +229,7 @@ class WPR_Templates_Loop {
|
|
224 |
<?php // Custom Taxonomies
|
225 |
$custom_taxonomies = Utilities::get_custom_types_of( 'tax', true );
|
226 |
foreach ($custom_taxonomies as $key => $value) {
|
227 |
-
if ( 'wpr_tab_header' !== $
|
228 |
continue;
|
229 |
} elseif ( 'product_cat' === $key ) {
|
230 |
echo '<option value="products">'. esc_html__( 'Products Archive (Pro)', 'wpr-addons' ) .'</option>';
|
@@ -243,8 +248,8 @@ class WPR_Templates_Loop {
|
|
243 |
</select>
|
244 |
<!-- Single -->
|
245 |
<select name="singles_condition_select" class="singles-condition-select">
|
246 |
-
<?php if ( 'wpr_tab_product_single' !== $
|
247 |
-
<?php if ( 'wpr_tab_single' === $
|
248 |
<option value="front_page"><?php esc_html_e( 'Front Page', 'wpr-addons' ); ?></option>
|
249 |
<option value="page_404"><?php esc_html_e( '404 Page', 'wpr-addons' ); ?></option>
|
250 |
<option value="pages" class="custom-ids"><?php esc_html_e( 'Pages', 'wpr-addons' ); ?></option>
|
@@ -257,7 +262,7 @@ class WPR_Templates_Loop {
|
|
257 |
<?php // Custom Post Types
|
258 |
$custom_taxonomies = Utilities::get_custom_types_of( 'post', true );
|
259 |
foreach ($custom_taxonomies as $key => $value) {
|
260 |
-
if ( 'wpr_tab_header' !== $
|
261 |
continue;
|
262 |
}
|
263 |
|
2 |
|
3 |
namespace WprAddons\Admin\Includes;
|
4 |
|
5 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
6 |
+
exit; // Exit if accessed directly.
|
7 |
+
}
|
8 |
|
9 |
use WprAddons\Classes\Utilities;
|
10 |
|
96 |
|
97 |
// List
|
98 |
echo '<li>';
|
99 |
+
echo '<h3 class="wpr-title">'. esc_html($user_template->post_title) .'</h3>';
|
100 |
|
101 |
echo '<span class="wpr-action-buttons">';
|
102 |
echo '<a href="'. esc_url($edit_url) .'" class="wpr-edit-template button button-primary">'. esc_html__( 'Edit', 'wpr-addons' ) .'</a>';
|
116 |
** Render Conditions Popup
|
117 |
*/
|
118 |
public static function render_conditions_popup( $canvas = false ) {
|
119 |
+
|
120 |
+
// Active Tab
|
121 |
+
$active_tab = isset( $_GET['tab'] ) ? sanitize_text_field( wp_unslash( $_GET['tab'] ) ) : '';
|
122 |
|
123 |
?>
|
124 |
|
145 |
</select>
|
146 |
<!-- Archive -->
|
147 |
<select name="archives_condition_select" class="archives-condition-select">
|
148 |
+
<?php if ( 'wpr_tab_product_archive' !== $active_tab ) : ?>
|
149 |
<option value="all_archives"><?php esc_html_e( 'All Archives', 'wpr-addons' ); ?></option>
|
150 |
<option value="posts"><?php esc_html_e( 'Posts Archive', 'wpr-addons' ); ?></option>
|
151 |
<option value="author"><?php esc_html_e( 'Author Archive', 'wpr-addons' ); ?></option>
|
156 |
<?php // Custom Taxonomies
|
157 |
$custom_taxonomies = Utilities::get_custom_types_of( 'tax', true );
|
158 |
foreach ($custom_taxonomies as $key => $value) {
|
159 |
+
if ( 'wpr_tab_header' !== $active_tab && 'wpr_tab_footer' !== $active_tab && ('product_cat' === $key || 'product_tag' === $key) ) {
|
160 |
continue;
|
161 |
} elseif ( 'product_cat' === $key ) {
|
162 |
echo '<option value="products">'. esc_html__( 'Products Archive', 'wpr-addons' ) .'</option>';
|
174 |
</select>
|
175 |
<!-- Single -->
|
176 |
<select name="singles_condition_select" class="singles-condition-select">
|
177 |
+
<?php if ( 'wpr_tab_product_single' !== $active_tab ) : ?>
|
178 |
<option value="front_page"><?php esc_html_e( 'Front Page', 'wpr-addons' ); ?></option>
|
179 |
<option value="page_404"><?php esc_html_e( '404 Page', 'wpr-addons' ); ?></option>
|
180 |
<option value="pages" class="custom-ids"><?php esc_html_e( 'Pages', 'wpr-addons' ); ?></option>
|
182 |
<?php // Custom Post Types
|
183 |
$custom_taxonomies = Utilities::get_custom_types_of( 'post', true );
|
184 |
foreach ($custom_taxonomies as $key => $value) {
|
185 |
+
if ( 'wpr_tab_header' !== $active_tab && 'wpr_tab_footer' !== $active_tab && 'product' === $key ) {
|
186 |
continue;
|
187 |
}
|
188 |
|
209 |
<!-- Archive -->
|
210 |
<select name="archives_condition_select" class="archives-condition-select">
|
211 |
|
212 |
+
<?php if ( 'wpr_tab_product_archive' !== $active_tab ) : ?>
|
213 |
+
<?php if ( 'wpr_tab_archive' === $active_tab ) : ?>
|
214 |
<option value="all_archives"><?php esc_html_e( 'All Archives', 'wpr-addons' ); ?></option>
|
215 |
<option value="posts"><?php esc_html_e( 'Posts Archive', 'wpr-addons' ); ?></option>
|
216 |
<option value="author"><?php esc_html_e( 'Author Archive', 'wpr-addons' ); ?></option>
|
229 |
<?php // Custom Taxonomies
|
230 |
$custom_taxonomies = Utilities::get_custom_types_of( 'tax', true );
|
231 |
foreach ($custom_taxonomies as $key => $value) {
|
232 |
+
if ( 'wpr_tab_header' !== $active_tab && 'wpr_tab_footer' !== $active_tab && ('product_cat' === $key || 'product_tag' === $key) ) {
|
233 |
continue;
|
234 |
} elseif ( 'product_cat' === $key ) {
|
235 |
echo '<option value="products">'. esc_html__( 'Products Archive (Pro)', 'wpr-addons' ) .'</option>';
|
248 |
</select>
|
249 |
<!-- Single -->
|
250 |
<select name="singles_condition_select" class="singles-condition-select">
|
251 |
+
<?php if ( 'wpr_tab_product_single' !== $active_tab ) : ?>
|
252 |
+
<?php if ( 'wpr_tab_single' === $active_tab ) : ?>
|
253 |
<option value="front_page"><?php esc_html_e( 'Front Page', 'wpr-addons' ); ?></option>
|
254 |
<option value="page_404"><?php esc_html_e( '404 Page', 'wpr-addons' ); ?></option>
|
255 |
<option value="pages" class="custom-ids"><?php esc_html_e( 'Pages', 'wpr-addons' ); ?></option>
|
262 |
<?php // Custom Post Types
|
263 |
$custom_taxonomies = Utilities::get_custom_types_of( 'post', true );
|
264 |
foreach ($custom_taxonomies as $key => $value) {
|
265 |
+
if ( 'wpr_tab_header' !== $active_tab && 'wpr_tab_footer' !== $active_tab && 'product' === $key ) {
|
266 |
continue;
|
267 |
}
|
268 |
|
admin/includes/wpr-templates-modal-popups.php
CHANGED
@@ -4,7 +4,9 @@ namespace WprAddons\Admin\Includes;
|
|
4 |
use WprAddons\Plugin;
|
5 |
use WprAddons\Classes\Utilities;
|
6 |
|
7 |
-
if ( ! defined( 'ABSPATH' ) )
|
|
|
|
|
8 |
|
9 |
/**
|
10 |
* WPR_Templates_Modal_Popups setup
|
@@ -122,10 +124,8 @@ class WPR_Templates_Modal_Popups {
|
|
122 |
// Encode Settings
|
123 |
$get_encoded_settings = ! empty( $get_settings ) ? wp_json_encode( $get_settings ) : '[]';
|
124 |
|
125 |
-
// Template
|
126 |
-
$
|
127 |
-
$template_class_attr = 'class="wpr-template-popup"';
|
128 |
-
$template_settings_attr = "data-settings='". $get_encoded_settings ."'";
|
129 |
|
130 |
// Return if NOT available for current user
|
131 |
if ( ! WPR_Templates_Modal_Popups::check_available_user_roles( $get_settings['popup_show_for_roles'] ) ) {
|
@@ -133,7 +133,7 @@ class WPR_Templates_Modal_Popups {
|
|
133 |
}
|
134 |
|
135 |
if ( ! self::$elementor_instance->preview->is_preview_mode() ) {
|
136 |
-
echo '<div '. $
|
137 |
echo '<div class="wpr-template-popup-inner">';
|
138 |
|
139 |
// Popup Overlay & Close Button
|
@@ -145,9 +145,9 @@ class WPR_Templates_Modal_Popups {
|
|
145 |
// Close Button
|
146 |
echo '<div class="wpr-popup-close-btn"><i class="eicon-close"></i></div>';
|
147 |
|
148 |
-
// Template Content
|
149 |
echo '<div class="wpr-popup-container-inner">';
|
150 |
-
echo $get_elementor_content;
|
151 |
echo '</div>';
|
152 |
|
153 |
echo '</div>';
|
4 |
use WprAddons\Plugin;
|
5 |
use WprAddons\Classes\Utilities;
|
6 |
|
7 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
8 |
+
exit; // Exit if accessed directly.
|
9 |
+
}
|
10 |
|
11 |
/**
|
12 |
* WPR_Templates_Modal_Popups setup
|
124 |
// Encode Settings
|
125 |
$get_encoded_settings = ! empty( $get_settings ) ? wp_json_encode( $get_settings ) : '[]';
|
126 |
|
127 |
+
// Template Settings Attribute
|
128 |
+
$template_settings_attr = "data-settings='". esc_attr($get_encoded_settings) ."'";
|
|
|
|
|
129 |
|
130 |
// Return if NOT available for current user
|
131 |
if ( ! WPR_Templates_Modal_Popups::check_available_user_roles( $get_settings['popup_show_for_roles'] ) ) {
|
133 |
}
|
134 |
|
135 |
if ( ! self::$elementor_instance->preview->is_preview_mode() ) {
|
136 |
+
echo '<div id="wpr-popup-id-'. esc_attr($template_id) .'" class="wpr-template-popup" '. $template_settings_attr .'>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
137 |
echo '<div class="wpr-template-popup-inner">';
|
138 |
|
139 |
// Popup Overlay & Close Button
|
145 |
// Close Button
|
146 |
echo '<div class="wpr-popup-close-btn"><i class="eicon-close"></i></div>';
|
147 |
|
148 |
+
// Elementor Template Content
|
149 |
echo '<div class="wpr-popup-container-inner">';
|
150 |
+
echo ''. $get_elementor_content; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
151 |
echo '</div>';
|
152 |
|
153 |
echo '</div>';
|
admin/includes/wpr-templates-shortcode.php
CHANGED
@@ -4,7 +4,9 @@ namespace WprAddons\Admin\Includes;
|
|
4 |
|
5 |
use Elementor;
|
6 |
|
7 |
-
if ( ! defined( 'ABSPATH' ) )
|
|
|
|
|
8 |
|
9 |
/**
|
10 |
* WPR_Templates_Shortcode setup
|
@@ -24,7 +26,7 @@ class WPR_Templates_Shortcode {
|
|
24 |
return '';
|
25 |
}
|
26 |
|
27 |
-
$edit_link = '<span class="wpr-template-edit-btn" data-permalink="'. get_permalink($attributes['id']) .'">Edit Template</span>';
|
28 |
|
29 |
return Elementor\Plugin::instance()->frontend->get_builder_content_for_display( $attributes['id'], true ) . $edit_link;
|
30 |
}
|
4 |
|
5 |
use Elementor;
|
6 |
|
7 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
8 |
+
exit; // Exit if accessed directly.
|
9 |
+
}
|
10 |
|
11 |
/**
|
12 |
* WPR_Templates_Shortcode setup
|
26 |
return '';
|
27 |
}
|
28 |
|
29 |
+
$edit_link = '<span class="wpr-template-edit-btn" data-permalink="'. esc_url(get_permalink($attributes['id'])) .'">Edit Template</span>';
|
30 |
|
31 |
return Elementor\Plugin::instance()->frontend->get_builder_content_for_display( $attributes['id'], true ) . $edit_link;
|
32 |
}
|
admin/plugin-options.php
CHANGED
@@ -1,6 +1,8 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
if ( ! defined( 'ABSPATH' ) )
|
|
|
|
|
4 |
|
5 |
use WprAddons\Admin\Includes\WPR_Templates_Loop;
|
6 |
use WprAddonsPro\Admin\Wpr_White_Label;
|
@@ -22,7 +24,7 @@ function wpr_settings_link( $links ) {
|
|
22 |
array_push( $links, $settings_link );
|
23 |
|
24 |
if ( !is_plugin_installed('wpr-addons-pro/wpr-addons-pro.php') ) {
|
25 |
-
$links[] = '<a href="https://royal-elementor-addons.com/?ref=rea-plugin-backend-wpplugindashboard-upgrade-pro#purchasepro" style="color:#93003c;font-weight:700" target="_blank">' . esc_html__('Pro', 'wpr-addons') . '</a>';
|
26 |
}
|
27 |
|
28 |
return $links;
|
@@ -89,24 +91,24 @@ function wpr_register_addons_settings() {
|
|
89 |
}
|
90 |
|
91 |
function wpr_addons_settings_page() {
|
92 |
-
|
93 |
?>
|
94 |
|
95 |
<div class="wrap wpr-settings-page-wrap">
|
96 |
|
97 |
<div class="wpr-settings-page-header">
|
98 |
-
<h1><?php echo Utilities::get_plugin_name(true); ?></h1>
|
99 |
<p><?php esc_html_e( 'The most powerful Elementor Addons in the universe.', 'wpr-addons' ); ?></p>
|
100 |
|
101 |
<?php if ( empty(get_option('wpr_wl_plugin_links')) ) : ?>
|
102 |
<div class="wpr-preview-buttons">
|
103 |
<a href="https://royal-elementor-addons.com/?ref=rea-plugin-backend-plugin-prev-btn#widgets" target="_blank" class="button wpr-options-button">
|
104 |
-
<span><?php echo
|
105 |
<span class="dashicons dashicons-external"></span>
|
106 |
</a>
|
107 |
|
108 |
<a href="https://www.youtube.com/watch?v=rkYQfn3tUc0" class="wpr-options-button button" target="_blank">
|
109 |
-
<?php echo
|
110 |
<span class="dashicons dashicons-video-alt3"></span>
|
111 |
</a>
|
112 |
</div>
|
@@ -119,13 +121,13 @@ function wpr_addons_settings_page() {
|
|
119 |
|
120 |
// Active Tab
|
121 |
if ( empty(get_option('wpr_wl_hide_elements_tab')) ) {
|
122 |
-
$active_tab = isset( $_GET['tab'] ) ?
|
123 |
} elseif ( empty(get_option('wpr_wl_hide_extensions_tab')) ) {
|
124 |
-
$active_tab = isset( $_GET['tab'] ) ?
|
125 |
} elseif ( empty(get_option('wpr_wl_hide_settings_tab')) ) {
|
126 |
-
$active_tab = isset( $_GET['tab'] ) ?
|
127 |
} elseif ( empty(get_option('wpr_wl_hide_white_label_tab')) ) {
|
128 |
-
$active_tab = isset( $_GET['tab'] ) ?
|
129 |
}
|
130 |
|
131 |
|
@@ -137,19 +139,19 @@ function wpr_addons_settings_page() {
|
|
137 |
<!-- Tabs -->
|
138 |
<div class="nav-tab-wrapper wpr-nav-tab-wrapper">
|
139 |
<?php if ( empty(get_option('wpr_wl_hide_elements_tab')) ) : ?>
|
140 |
-
<a href="?page=wpr-addons&tab=wpr_tab_elements" data-title="Elements" class="nav-tab <?php echo $active_tab == 'wpr_tab_elements' ? 'nav-tab-active' : ''; ?>">
|
141 |
<?php esc_html_e( 'Widgets', 'wpr-addons' ); ?>
|
142 |
</a>
|
143 |
<?php endif; ?>
|
144 |
|
145 |
<?php if ( empty(get_option('wpr_wl_hide_extensions_tab')) ) : ?>
|
146 |
-
<a href="?page=wpr-addons&tab=wpr_tab_extensions" data-title="Extensions" class="nav-tab <?php echo $active_tab == 'wpr_tab_extensions' ? 'nav-tab-active' : ''; ?>">
|
147 |
<?php esc_html_e( 'Extensions', 'wpr-addons' ); ?>
|
148 |
</a>
|
149 |
<?php endif; ?>
|
150 |
|
151 |
<?php if ( empty(get_option('wpr_wl_hide_settings_tab')) ) : ?>
|
152 |
-
<a href="?page=wpr-addons&tab=wpr_tab_settings" data-title="Settings" class="nav-tab <?php echo $active_tab == 'wpr_tab_settings' ? 'nav-tab-active' : ''; ?>">
|
153 |
<?php esc_html_e( 'Settings', 'wpr-addons' ); ?>
|
154 |
</a>
|
155 |
<?php endif; ?>
|
@@ -190,12 +192,12 @@ function wpr_addons_settings_page() {
|
|
190 |
$reff = '?ref=rea-plugin-backend-elements-widget-prev'. $data[2];
|
191 |
$class = 'new' === $data[3] ? ' wpr-new-element' : '';
|
192 |
|
193 |
-
echo '<div class="wpr-element'. $class .'">';
|
194 |
echo '<div class="wpr-element-info">';
|
195 |
-
echo '<h3>'. $title .'</h3>';
|
196 |
-
echo '<input type="checkbox" name="wpr-element-'. $slug .'" id="wpr-element-'. $slug .'" '. checked( get_option('wpr-element-'. $slug, 'on'), 'on', false ) .'>';
|
197 |
-
echo '<label for="wpr-element-'. $slug .'"></label>';
|
198 |
-
echo ( '' !== $url && empty(get_option('wpr_wl_plugin_links')) ) ? '<a href="'. $url . $reff .'" target="_blank">'.
|
199 |
echo '</div>';
|
200 |
echo '</div>';
|
201 |
}
|
@@ -325,20 +327,20 @@ function wpr_addons_settings_page() {
|
|
325 |
|
326 |
echo '<div class="wpr-element">';
|
327 |
echo '<div class="wpr-element-info">';
|
328 |
-
echo '<h3>'
|
329 |
-
echo '<input type="checkbox" name="'. $option_name .'" id="'. $option_name .'" '. checked( get_option(''. $option_name .'', 'on'), 'on', false ) .'>';
|
330 |
-
echo '<label for="'. $option_name .'"></label>';
|
331 |
|
332 |
if ( 'wpr-parallax-background' === $option_name ) {
|
333 |
echo '<br><span>Tip: Edit any Section > Navigate to Style tab</span>';
|
334 |
echo '<a href="https://www.youtube.com/watch?v=DcDeQ__lJbw" target="_blank">Watch Video Tutorial</a>';
|
335 |
-
}
|
336 |
echo '<br><span>Tip: Edit any Section > Navigate to Style tab</span>';
|
337 |
echo '<a href="https://youtu.be/DcDeQ__lJbw?t=121" target="_blank">Watch Video Tutorial</a>';
|
338 |
-
}
|
339 |
echo '<br><span>Tip: Edit any Section > Navigate to Style tab</span>';
|
340 |
echo '<a href="https://www.youtube.com/watch?v=8OdnaoFSj94" target="_blank">Watch Video Tutorial</a>';
|
341 |
-
}
|
342 |
echo '<br><span>Tip: Edit any Section > Navigate to Advanced tab</span>';
|
343 |
echo '<a href="https://www.youtube.com/watch?v=at0CPKtklF0&t=375s" target="_blank">Watch Video Tutorial</a>';
|
344 |
}
|
1 |
<?php
|
2 |
|
3 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
4 |
+
exit; // Exit if accessed directly.
|
5 |
+
}
|
6 |
|
7 |
use WprAddons\Admin\Includes\WPR_Templates_Loop;
|
8 |
use WprAddonsPro\Admin\Wpr_White_Label;
|
24 |
array_push( $links, $settings_link );
|
25 |
|
26 |
if ( !is_plugin_installed('wpr-addons-pro/wpr-addons-pro.php') ) {
|
27 |
+
$links[] = '<a href="https://royal-elementor-addons.com/?ref=rea-plugin-backend-wpplugindashboard-upgrade-pro#purchasepro" style="color:#93003c;font-weight:700" target="_blank">' . esc_html__('Go Pro', 'wpr-addons') . '</a>';
|
28 |
}
|
29 |
|
30 |
return $links;
|
91 |
}
|
92 |
|
93 |
function wpr_addons_settings_page() {
|
94 |
+
|
95 |
?>
|
96 |
|
97 |
<div class="wrap wpr-settings-page-wrap">
|
98 |
|
99 |
<div class="wpr-settings-page-header">
|
100 |
+
<h1><?php echo esc_html(Utilities::get_plugin_name(true)); ?></h1>
|
101 |
<p><?php esc_html_e( 'The most powerful Elementor Addons in the universe.', 'wpr-addons' ); ?></p>
|
102 |
|
103 |
<?php if ( empty(get_option('wpr_wl_plugin_links')) ) : ?>
|
104 |
<div class="wpr-preview-buttons">
|
105 |
<a href="https://royal-elementor-addons.com/?ref=rea-plugin-backend-plugin-prev-btn#widgets" target="_blank" class="button wpr-options-button">
|
106 |
+
<span><?php echo esc_html__( 'View Plugin Demo', 'wpr-addons' ); ?></span>
|
107 |
<span class="dashicons dashicons-external"></span>
|
108 |
</a>
|
109 |
|
110 |
<a href="https://www.youtube.com/watch?v=rkYQfn3tUc0" class="wpr-options-button button" target="_blank">
|
111 |
+
<?php echo esc_html__( 'How to use Widgets', 'wpr-addons' ); ?>
|
112 |
<span class="dashicons dashicons-video-alt3"></span>
|
113 |
</a>
|
114 |
</div>
|
121 |
|
122 |
// Active Tab
|
123 |
if ( empty(get_option('wpr_wl_hide_elements_tab')) ) {
|
124 |
+
$active_tab = isset( $_GET['tab'] ) ? sanitize_text_field( wp_unslash( $_GET['tab'] ) ) : 'wpr_tab_elements';
|
125 |
} elseif ( empty(get_option('wpr_wl_hide_extensions_tab')) ) {
|
126 |
+
$active_tab = isset( $_GET['tab'] ) ? sanitize_text_field( wp_unslash( $_GET['tab'] ) ) : 'wpr_tab_extensions';
|
127 |
} elseif ( empty(get_option('wpr_wl_hide_settings_tab')) ) {
|
128 |
+
$active_tab = isset( $_GET['tab'] ) ? sanitize_text_field( wp_unslash( $_GET['tab'] ) ) : 'wpr_tab_settings';
|
129 |
} elseif ( empty(get_option('wpr_wl_hide_white_label_tab')) ) {
|
130 |
+
$active_tab = isset( $_GET['tab'] ) ? sanitize_text_field( wp_unslash( $_GET['tab'] ) ) : 'wpr_tab_white_label';
|
131 |
}
|
132 |
|
133 |
|
139 |
<!-- Tabs -->
|
140 |
<div class="nav-tab-wrapper wpr-nav-tab-wrapper">
|
141 |
<?php if ( empty(get_option('wpr_wl_hide_elements_tab')) ) : ?>
|
142 |
+
<a href="?page=wpr-addons&tab=wpr_tab_elements" data-title="Elements" class="nav-tab <?php echo ($active_tab == 'wpr_tab_elements') ? 'nav-tab-active' : ''; ?>">
|
143 |
<?php esc_html_e( 'Widgets', 'wpr-addons' ); ?>
|
144 |
</a>
|
145 |
<?php endif; ?>
|
146 |
|
147 |
<?php if ( empty(get_option('wpr_wl_hide_extensions_tab')) ) : ?>
|
148 |
+
<a href="?page=wpr-addons&tab=wpr_tab_extensions" data-title="Extensions" class="nav-tab <?php echo ($active_tab == 'wpr_tab_extensions') ? 'nav-tab-active' : ''; ?>">
|
149 |
<?php esc_html_e( 'Extensions', 'wpr-addons' ); ?>
|
150 |
</a>
|
151 |
<?php endif; ?>
|
152 |
|
153 |
<?php if ( empty(get_option('wpr_wl_hide_settings_tab')) ) : ?>
|
154 |
+
<a href="?page=wpr-addons&tab=wpr_tab_settings" data-title="Settings" class="nav-tab <?php echo ($active_tab == 'wpr_tab_settings') ? 'nav-tab-active' : ''; ?>">
|
155 |
<?php esc_html_e( 'Settings', 'wpr-addons' ); ?>
|
156 |
</a>
|
157 |
<?php endif; ?>
|
192 |
$reff = '?ref=rea-plugin-backend-elements-widget-prev'. $data[2];
|
193 |
$class = 'new' === $data[3] ? ' wpr-new-element' : '';
|
194 |
|
195 |
+
echo '<div class="wpr-element'. esc_attr($class) .'">';
|
196 |
echo '<div class="wpr-element-info">';
|
197 |
+
echo '<h3>'. esc_html($title) .'</h3>';
|
198 |
+
echo '<input type="checkbox" name="wpr-element-'. esc_attr($slug) .'" id="wpr-element-'. esc_attr($slug) .'" '. checked( get_option('wpr-element-'. $slug, 'on'), 'on', false ) .'>';
|
199 |
+
echo '<label for="wpr-element-'. esc_attr($slug) .'"></label>';
|
200 |
+
echo ( '' !== $url && empty(get_option('wpr_wl_plugin_links')) ) ? '<a href="'. esc_url($url . $reff) .'" target="_blank">'. esc_html__('View Widget Demo', 'wpr-addons') .'</a>' : '';
|
201 |
echo '</div>';
|
202 |
echo '</div>';
|
203 |
}
|
327 |
|
328 |
echo '<div class="wpr-element">';
|
329 |
echo '<div class="wpr-element-info">';
|
330 |
+
echo '<h3>'. esc_html($option_title) .'</h3>';
|
331 |
+
echo '<input type="checkbox" name="'. esc_attr($option_name) .'" id="'. esc_attr($option_name) .'" '. checked( get_option(''. $option_name .'', 'on'), 'on', false ) .'>';
|
332 |
+
echo '<label for="'. esc_attr($option_name) .'"></label>';
|
333 |
|
334 |
if ( 'wpr-parallax-background' === $option_name ) {
|
335 |
echo '<br><span>Tip: Edit any Section > Navigate to Style tab</span>';
|
336 |
echo '<a href="https://www.youtube.com/watch?v=DcDeQ__lJbw" target="_blank">Watch Video Tutorial</a>';
|
337 |
+
} elseif ( 'wpr-parallax-multi-layer' === $option_name ) {
|
338 |
echo '<br><span>Tip: Edit any Section > Navigate to Style tab</span>';
|
339 |
echo '<a href="https://youtu.be/DcDeQ__lJbw?t=121" target="_blank">Watch Video Tutorial</a>';
|
340 |
+
} elseif ( 'wpr-particles' === $option_name ) {
|
341 |
echo '<br><span>Tip: Edit any Section > Navigate to Style tab</span>';
|
342 |
echo '<a href="https://www.youtube.com/watch?v=8OdnaoFSj94" target="_blank">Watch Video Tutorial</a>';
|
343 |
+
} elseif ( 'wpr-sticky-section' === $option_name ) {
|
344 |
echo '<br><span>Tip: Edit any Section > Navigate to Advanced tab</span>';
|
345 |
echo '<a href="https://www.youtube.com/watch?v=at0CPKtklF0&t=375s" target="_blank">Watch Video Tutorial</a>';
|
346 |
}
|
admin/popups.php
CHANGED
@@ -1,6 +1,8 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
if ( ! defined( 'ABSPATH' ) )
|
|
|
|
|
4 |
|
5 |
use WprAddons\Admin\Includes\WPR_Templates_Loop;
|
6 |
use WprAddons\Classes\Utilities;
|
@@ -18,7 +20,7 @@ function wpr_addons_popups_page() {
|
|
18 |
<div class="wrap wpr-settings-page-wrap">
|
19 |
|
20 |
<div class="wpr-settings-page-header">
|
21 |
-
<h1><?php echo Utilities::get_plugin_name(true); ?></h1>
|
22 |
<p><?php esc_html_e( 'The most powerful Elementor Addons in the universe.', 'wpr-addons' ); ?></p>
|
23 |
|
24 |
<!-- Custom Template -->
|
@@ -33,7 +35,7 @@ function wpr_addons_popups_page() {
|
|
33 |
<?php
|
34 |
|
35 |
// Active Tab
|
36 |
-
$active_tab = isset( $_GET['tab'] ) ?
|
37 |
|
38 |
?>
|
39 |
|
@@ -48,7 +50,7 @@ function wpr_addons_popups_page() {
|
|
48 |
|
49 |
<!-- Tabs -->
|
50 |
<div class="nav-tab-wrapper wpr-nav-tab-wrapper">
|
51 |
-
<a href="?page=wpr-theme-builder&tab=wpr_tab_popups" data-title="popup" class="nav-tab <?php echo $active_tab == 'wpr_tab_popups' ? 'nav-tab-active' : ''; ?>">
|
52 |
<?php esc_html_e( 'Popups', 'wpr-addons' ); ?>
|
53 |
</a>
|
54 |
</div>
|
1 |
<?php
|
2 |
|
3 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
4 |
+
exit; // Exit if accessed directly.
|
5 |
+
}
|
6 |
|
7 |
use WprAddons\Admin\Includes\WPR_Templates_Loop;
|
8 |
use WprAddons\Classes\Utilities;
|
20 |
<div class="wrap wpr-settings-page-wrap">
|
21 |
|
22 |
<div class="wpr-settings-page-header">
|
23 |
+
<h1><?php echo esc_html(Utilities::get_plugin_name(true)); ?></h1>
|
24 |
<p><?php esc_html_e( 'The most powerful Elementor Addons in the universe.', 'wpr-addons' ); ?></p>
|
25 |
|
26 |
<!-- Custom Template -->
|
35 |
<?php
|
36 |
|
37 |
// Active Tab
|
38 |
+
$active_tab = isset( $_GET['tab'] ) ? sanitize_text_field( wp_unslash( $_GET['tab'] ) ) : 'wpr_tab_popups';
|
39 |
|
40 |
?>
|
41 |
|
50 |
|
51 |
<!-- Tabs -->
|
52 |
<div class="nav-tab-wrapper wpr-nav-tab-wrapper">
|
53 |
+
<a href="?page=wpr-theme-builder&tab=wpr_tab_popups" data-title="popup" class="nav-tab <?php echo ($active_tab == 'wpr_tab_popups') ? 'nav-tab-active' : ''; ?>">
|
54 |
<?php esc_html_e( 'Popups', 'wpr-addons' ); ?>
|
55 |
</a>
|
56 |
</div>
|
admin/premade-blocks.php
CHANGED
@@ -1,6 +1,8 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
if ( ! defined( 'ABSPATH' ) )
|
|
|
|
|
4 |
|
5 |
use WprAddons\Admin\Templates\WPR_Templates_Data;
|
6 |
use WprAddons\Admin\Templates\WPR_Templates_Library_Blocks;
|
@@ -23,7 +25,7 @@ function wpr_addons_premade_blocks_page() {
|
|
23 |
<div class="wpr-premade-blocks-page">
|
24 |
|
25 |
<div class="wpr-settings-page-header">
|
26 |
-
<h1><?php echo Utilities::get_plugin_name(true); ?></h1>
|
27 |
<p><?php esc_html_e( 'The most powerful Elementor Addons in the universe.', 'wpr-addons' ); ?></p>
|
28 |
</div>
|
29 |
|
1 |
<?php
|
2 |
|
3 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
4 |
+
exit; // Exit if accessed directly.
|
5 |
+
}
|
6 |
|
7 |
use WprAddons\Admin\Templates\WPR_Templates_Data;
|
8 |
use WprAddons\Admin\Templates\WPR_Templates_Library_Blocks;
|
25 |
<div class="wpr-premade-blocks-page">
|
26 |
|
27 |
<div class="wpr-settings-page-header">
|
28 |
+
<h1><?php echo esc_html(Utilities::get_plugin_name(true)); ?></h1>
|
29 |
<p><?php esc_html_e( 'The most powerful Elementor Addons in the universe.', 'wpr-addons' ); ?></p>
|
30 |
</div>
|
31 |
|
admin/templates-kit.php
CHANGED
@@ -1,552 +1,568 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
if ( ! defined( 'ABSPATH' ) )
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
use
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
add_action( '
|
19 |
-
add_action( '
|
20 |
-
add_action( '
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
<
|
47 |
-
|
48 |
-
|
49 |
-
<li><?php
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
<li data-filter="
|
59 |
-
<li data-filter="
|
60 |
-
<li data-filter="
|
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 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
<
|
109 |
-
|
110 |
-
|
111 |
-
<
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
<
|
130 |
-
|
131 |
-
|
132 |
-
<
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
<
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
}
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
//
|
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 |
-
if ( !
|
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 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
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 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
$
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
$
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
wp_remote_post( 'http://reastats.kinsta.cloud/wp-json/templates-kit-
|
548 |
-
'body' => [
|
549 |
-
'
|
550 |
-
]
|
551 |
-
] );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
552 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
4 |
+
exit; // Exit if accessed directly.
|
5 |
+
}
|
6 |
+
|
7 |
+
use WprAddons\Admin\Templates\WPR_Templates_Data;
|
8 |
+
use WprAddons\Classes\Utilities;
|
9 |
+
use Elementor\Plugin;
|
10 |
+
|
11 |
+
// Register Menus
|
12 |
+
function wpr_addons_add_templates_kit_menu() {
|
13 |
+
add_submenu_page( 'wpr-addons', 'Templates Kit', 'Templates Kit', 'manage_options', 'wpr-templates-kit', 'wpr_addons_templates_kit_page' );
|
14 |
+
}
|
15 |
+
add_action( 'admin_menu', 'wpr_addons_add_templates_kit_menu' );
|
16 |
+
|
17 |
+
// Import Template Kit
|
18 |
+
add_action( 'wp_ajax_wpr_install_reuired_plugins', 'wpr_install_reuired_plugins' );
|
19 |
+
add_action( 'wp_ajax_wpr_activate_reuired_theme', 'wpr_activate_reuired_theme' );
|
20 |
+
add_action( 'wp_ajax_wpr_import_templates_kit', 'wpr_import_templates_kit' );
|
21 |
+
add_action( 'wp_ajax_wpr_final_settings_setup', 'wpr_final_settings_setup' );
|
22 |
+
add_action( 'wp_ajax_wpr_search_query_results', 'wpr_search_query_results' );
|
23 |
+
|
24 |
+
|
25 |
+
/**
|
26 |
+
** Render Templates Kit Page
|
27 |
+
*/
|
28 |
+
function wpr_addons_templates_kit_page() {
|
29 |
+
|
30 |
+
?>
|
31 |
+
|
32 |
+
<div class="wpr-templates-kit-page">
|
33 |
+
|
34 |
+
<header>
|
35 |
+
<div class="wpr-templates-kit-logo">
|
36 |
+
<div><img src="<?php echo !empty(get_option('wpr_wl_plugin_logo')) ? esc_url(wp_get_attachment_image_src(get_option('wpr_wl_plugin_logo'), 'full')[0]) : esc_url(WPR_ADDONS_ASSETS_URL .'img/logo-40x40.png'); ?>"></div>
|
37 |
+
<div class="back-btn"><?php printf( esc_html__('%s Back to Library', 'wpr-addons'), '<span class="dashicons dashicons-arrow-left-alt2"></span>'); ?></div>
|
38 |
+
</div>
|
39 |
+
|
40 |
+
<div class="wpr-templates-kit-search">
|
41 |
+
<input type="text" autocomplete="off" placeholder="<?php esc_html_e('Search Templates Kit...', 'wpr-addons'); ?>">
|
42 |
+
<span class="dashicons dashicons-search"></span>
|
43 |
+
</div>
|
44 |
+
|
45 |
+
<div class="wpr-templates-kit-price-filter">
|
46 |
+
<span data-price="mixed"><?php esc_html_e('Price: Mixed', 'wpr-addons'); ?></span>
|
47 |
+
<span class="dashicons dashicons-arrow-down-alt2"></span>
|
48 |
+
<ul>
|
49 |
+
<li><?php esc_html_e('Mixed', 'wpr-addons'); ?></li>
|
50 |
+
<li><?php esc_html_e('Free', 'wpr-addons'); ?></li>
|
51 |
+
<li><?php esc_html_e('Premium', 'wpr-addons'); ?></li>
|
52 |
+
</ul>
|
53 |
+
</div>
|
54 |
+
|
55 |
+
<div class="wpr-templates-kit-filters">
|
56 |
+
<div>Filter: All</div>
|
57 |
+
<ul>
|
58 |
+
<li data-filter="all">Blog</li>
|
59 |
+
<li data-filter="blog">Blog</li>
|
60 |
+
<li data-filter="business">Business</li>
|
61 |
+
<li data-filter="ecommerce">eCommerce</li>
|
62 |
+
<li data-filter="beauty">Beauty</li>
|
63 |
+
</ul>
|
64 |
+
</div>
|
65 |
+
</header>
|
66 |
+
|
67 |
+
<div class="wpr-templates-kit-page-title">
|
68 |
+
<h1><?php esc_html_e('Royal Elementor Templates Kit', 'wpr-addons'); ?></h1>
|
69 |
+
<p><?php esc_html_e('Import any Templates Kit with just a Single click', 'wpr-addons'); ?></p>
|
70 |
+
</div>
|
71 |
+
|
72 |
+
<div class="wpr-templates-kit-grid main-grid" data-theme-status="<?php echo esc_attr(get_theme_status()); ?>">
|
73 |
+
<?php
|
74 |
+
$kits = WPR_Templates_Data::get_available_kits();
|
75 |
+
$sorted_kits = [];
|
76 |
+
|
77 |
+
foreach ($kits as $slug => $kit) {
|
78 |
+
foreach ($kit as $version => $data ) {
|
79 |
+
$sorted_kits[$slug .'-'. $version] = $data;
|
80 |
+
}
|
81 |
+
}
|
82 |
+
|
83 |
+
// Sort by Priority
|
84 |
+
uasort($sorted_kits, function ($item1, $item2) {
|
85 |
+
if ($item1['priority'] == $item2['priority']) return 0;
|
86 |
+
return $item1['priority'] < $item2['priority'] ? -1 : 1;
|
87 |
+
});
|
88 |
+
|
89 |
+
// Loop
|
90 |
+
foreach ($sorted_kits as $kit_id => $data) {
|
91 |
+
echo '<div class="grid-item" data-kit-id="'. esc_attr($kit_id) .'" data-tags="'. esc_attr($data['tags']) .'" data-plugins="'. esc_attr($data['plugins']) .'" data-pages="'. esc_attr($data['pages']) .'" data-price="'. esc_attr($data['price']) .'">';
|
92 |
+
echo '<div class="image-wrap">';
|
93 |
+
echo '<img src="'. esc_url('https://royal-elementor-addons.com/library/templates-kit/'. $kit_id .'/home.jpg') .'">';
|
94 |
+
echo '<div class="image-overlay"><span class="dashicons dashicons-search"></span></div>';
|
95 |
+
echo '</div>';
|
96 |
+
echo '<footer>';
|
97 |
+
echo '<h3>'. esc_html($data['name']) .'</h3>';
|
98 |
+
echo esc_html($data['theme-builder']) ? '<span>'. esc_html__( 'Theme Builder', 'wpr-addons' ) .'</span>' : '';
|
99 |
+
echo '</footer>';
|
100 |
+
echo '</div>';
|
101 |
+
}
|
102 |
+
|
103 |
+
?>
|
104 |
+
|
105 |
+
</div>
|
106 |
+
|
107 |
+
<div class="wpr-templates-kit-single">
|
108 |
+
<div class="wpr-templates-kit-grid single-grid"></div>
|
109 |
+
|
110 |
+
<footer class="action-buttons-wrap">
|
111 |
+
<a href="https://royal-elementor-addons.com/" class="preview-demo button" target="_blank"><?php esc_html_e('Preview Demo', 'wpr-addons'); ?> <span class="dashicons dashicons-external"></span></a>
|
112 |
+
|
113 |
+
<div class="import-template-buttons">
|
114 |
+
<?php
|
115 |
+
echo '<button class="import-kit button">'. esc_html__('Import Templates Kit', 'wpr-addons') .' <span class="dashicons dashicons-download"></span></button>';
|
116 |
+
echo '<a href="https://royal-elementor-addons.com/?ref=rea-plugin-backend-templates-upgrade-pro#purchasepro" class="get-access button" target="_blank">'. esc_html__('Get Access', 'wpr-addons') .' <span class="dashicons dashicons-external"></span></a>';
|
117 |
+
?>
|
118 |
+
<button class="import-template button"><?php printf( esc_html__( 'Import %s Template', 'wpr-addons' ), '<strong></strong>' ); ?></button>
|
119 |
+
|
120 |
+
</div>
|
121 |
+
</footer>
|
122 |
+
</div>
|
123 |
+
|
124 |
+
<div class="wpr-import-kit-popup-wrap">
|
125 |
+
<div class="overlay"></div>
|
126 |
+
<div class="wpr-import-kit-popup">
|
127 |
+
<header>
|
128 |
+
<h3><?php esc_html_e('Template Kit is being imported', 'wpr-addons'); ?><span>.</span></h3>
|
129 |
+
<span class="dashicons dashicons-no-alt close-btn"></span>
|
130 |
+
</header>
|
131 |
+
<div class="content">
|
132 |
+
<p><?php esc_html_e('The import process can take a few seconds depending on the size of the kit you are importing and speed of the connection.', 'wpr-addons'); ?></p>
|
133 |
+
<p><?php esc_html_e('Please do NOT close this browser window until import is completed.', 'wpr-addons'); ?></p>
|
134 |
+
|
135 |
+
<div class="progress-wrap">
|
136 |
+
<div class="progress-bar"></div>
|
137 |
+
<strong></strong>
|
138 |
+
</div>
|
139 |
+
</div>
|
140 |
+
</div>
|
141 |
+
</div>
|
142 |
+
|
143 |
+
<div class="wpr-templates-kit-not-found">
|
144 |
+
<img src="<?php echo esc_url(WPR_ADDONS_ASSETS_URL .'img/not-found.png'); ?>">
|
145 |
+
<h1><?php esc_html_e('No Search Results Found.', 'wpr-addons'); ?></h1>
|
146 |
+
<p><?php esc_html_e('Cant find a Templates Kit you are looking for?', 'wpr-addons'); ?></p>
|
147 |
+
<a href="https://royal-elementor-addons.com/library/request-new-kit-red.html" target="_blank"><?php esc_html_e('Request Templates Kit.', 'wpr-addons'); ?></a>
|
148 |
+
</div>
|
149 |
+
|
150 |
+
</div>
|
151 |
+
|
152 |
+
|
153 |
+
<?php
|
154 |
+
|
155 |
+
} // End wpr_addons_templates_kit_page()
|
156 |
+
|
157 |
+
/**
|
158 |
+
** Get Theme Status
|
159 |
+
*/
|
160 |
+
function get_theme_status() {
|
161 |
+
$theme = wp_get_theme();
|
162 |
+
|
163 |
+
// Theme installed and activate.
|
164 |
+
if ( 'Royal Elementor Kit' === $theme->name || 'Royal Elementor Kit' === $theme->parent_theme ) {
|
165 |
+
return 'req-theme-active';
|
166 |
+
}
|
167 |
+
|
168 |
+
// Theme installed but not activate.
|
169 |
+
foreach ( (array) wp_get_themes() as $theme_dir => $theme ) {
|
170 |
+
if ( 'Royal Elementor Kit' === $theme->name || 'Royal Elementor Kit' === $theme->parent_theme ) {
|
171 |
+
return 'req-theme-inactive';
|
172 |
+
}
|
173 |
+
}
|
174 |
+
|
175 |
+
return 'req-theme-not-installed';
|
176 |
+
}
|
177 |
+
|
178 |
+
/**
|
179 |
+
** Install/Activate Required Theme
|
180 |
+
*/
|
181 |
+
function wpr_activate_reuired_theme() {
|
182 |
+
// Get Current Theme
|
183 |
+
$theme = get_option('stylesheet');
|
184 |
+
|
185 |
+
// Activate Royal Elementor Kit Theme
|
186 |
+
if ( 'ashe-pro-premium' !== $theme && 'bard-pro-premium' !== $theme
|
187 |
+
&& 'vayne-pro-premium' !== $theme && 'kayn-pro-premium' !== $theme ) {
|
188 |
+
switch_theme( 'royal-elementor-kit' );
|
189 |
+
set_transient( 'royal-elementor-kit_activation_notice', true );
|
190 |
+
}
|
191 |
+
|
192 |
+
// TODO: maybe return back - 'ashe' !== $theme && 'bard' !== $theme &&
|
193 |
+
}
|
194 |
+
|
195 |
+
/**
|
196 |
+
** Install/Activate Required Plugins
|
197 |
+
*/
|
198 |
+
function wpr_install_reuired_plugins() {
|
199 |
+
// Get currently active plugins
|
200 |
+
$active_plugins = (array) get_option( 'active_plugins', array() );
|
201 |
+
|
202 |
+
// Add Required Plugins
|
203 |
+
if ( isset($_POST['plugin']) ) {
|
204 |
+
if ( 'contact-form-7' == $_POST['plugin'] ) {
|
205 |
+
array_push( $active_plugins, 'contact-form-7/wp-contact-form-7.php' );
|
206 |
+
} elseif ( 'media-library-assistant' == $_POST['plugin'] ) {
|
207 |
+
array_push( $active_plugins, 'media-library-assistant/index.php' );
|
208 |
+
}
|
209 |
+
}
|
210 |
+
|
211 |
+
// Set Active Plugins
|
212 |
+
update_option( 'active_plugins', $active_plugins );
|
213 |
+
|
214 |
+
// Get Current Theme
|
215 |
+
$theme = get_option('stylesheet');
|
216 |
+
|
217 |
+
// Activate Royal Elementor Kit Theme
|
218 |
+
if ( 'ashe-pro-premium' !== $theme && 'bard-pro-premium' !== $theme
|
219 |
+
&& 'vayne-pro-premium' !== $theme && 'kayn-pro-premium' !== $theme ) {
|
220 |
+
switch_theme( 'royal-elementor-kit' );
|
221 |
+
set_transient( 'royal-elementor-kit_activation_notice', true );
|
222 |
+
}
|
223 |
+
|
224 |
+
// TODO: maybe return back - 'ashe' !== $theme && 'bard' !== $theme &&
|
225 |
+
|
226 |
+
}
|
227 |
+
|
228 |
+
/**
|
229 |
+
** Import Template Kit
|
230 |
+
*/
|
231 |
+
function wpr_import_templates_kit() {
|
232 |
+
|
233 |
+
// Temp Define Importers
|
234 |
+
if ( ! defined('WP_LOAD_IMPORTERS') ) {
|
235 |
+
define('WP_LOAD_IMPORTERS', true);
|
236 |
+
}
|
237 |
+
|
238 |
+
// Include if Class Does NOT Exist
|
239 |
+
if ( ! class_exists( 'WP_Import' ) ) {
|
240 |
+
$class_wp_importer = WPR_ADDONS_PATH .'admin/import/class-wordpress-importer.php';
|
241 |
+
if ( file_exists( $class_wp_importer ) ) {
|
242 |
+
require $class_wp_importer;
|
243 |
+
}
|
244 |
+
}
|
245 |
+
|
246 |
+
if ( class_exists( 'WP_Import' ) ) {
|
247 |
+
$kit = isset($_POST['wpr_templates_kit']) ? sanitize_file_name(wp_unslash($_POST['wpr_templates_kit'])) : '';
|
248 |
+
$file = isset($_POST['wpr_templates_kit_single']) ? sanitize_file_name(wp_unslash($_POST['wpr_templates_kit_single'])) : '';
|
249 |
+
|
250 |
+
// Tmp
|
251 |
+
update_option( 'wpr-import-kit-id', $kit );
|
252 |
+
|
253 |
+
// Download Import File
|
254 |
+
$local_file_path = download_template( $kit, $file );
|
255 |
+
|
256 |
+
// Prepare for Import
|
257 |
+
$wp_import = new WP_Import( $local_file_path, ['fetch_attachments' => true] );
|
258 |
+
|
259 |
+
// Import
|
260 |
+
ob_start();
|
261 |
+
$wp_import->run();
|
262 |
+
ob_end_clean();
|
263 |
+
|
264 |
+
// Delete Import File
|
265 |
+
unlink( $local_file_path );
|
266 |
+
|
267 |
+
// Send to JS
|
268 |
+
echo esc_html(serialize( $wp_import ));
|
269 |
+
}
|
270 |
+
|
271 |
+
}
|
272 |
+
|
273 |
+
/**
|
274 |
+
** Download Template
|
275 |
+
*/
|
276 |
+
function download_template( $kit, $file ) {
|
277 |
+
$file = ! $file ? 'main' : $file;
|
278 |
+
|
279 |
+
// Avoid Cache
|
280 |
+
$randomNum = substr(str_shuffle("0123456789abcdefghijklmnopqrstvwxyzABCDEFGHIJKLMNOPQRSTVWXYZ"), 0, 7);
|
281 |
+
|
282 |
+
// Remote and Local Files
|
283 |
+
$remote_file_url = 'https://royal-elementor-addons.com/library/templates-kit/'. $kit .'/main.xml?='. $randomNum;
|
284 |
+
$local_file_path = WPR_ADDONS_PATH .'admin/import/tmp.xml';
|
285 |
+
|
286 |
+
// No Limit for Execution
|
287 |
+
set_time_limit(0);
|
288 |
+
|
289 |
+
// Copy File From Server
|
290 |
+
copy( $remote_file_url, $local_file_path );
|
291 |
+
|
292 |
+
return $local_file_path;
|
293 |
+
}
|
294 |
+
|
295 |
+
/**
|
296 |
+
** Import Elementor Site Settings
|
297 |
+
*/
|
298 |
+
function import_elementor_site_settings( $kit ) {
|
299 |
+
// Avoid Cache
|
300 |
+
// $randomNum = substr(str_shuffle("0123456789abcdefghijklmnopqrstvwxyzABCDEFGHIJKLMNOPQRSTVWXYZ"), 0, 7);
|
301 |
+
|
302 |
+
// Get Remote File
|
303 |
+
$site_settings = @file_get_contents('https://royal-elementor-addons.com/library/templates-kit/'. $kit .'/site-settings.json');
|
304 |
+
|
305 |
+
if ( false !== $site_settings ) {
|
306 |
+
$site_settings = json_decode($site_settings, true);
|
307 |
+
|
308 |
+
if ( ! empty($site_settings['settings']) ) {
|
309 |
+
$default_kit = \Elementor\Plugin::$instance->documents->get_doc_for_frontend( get_option( 'elementor_active_kit' ) );
|
310 |
+
|
311 |
+
$kit_settings = $default_kit->get_settings();
|
312 |
+
$new_settings = $site_settings['settings'];
|
313 |
+
$settings = array_merge($kit_settings, $new_settings);
|
314 |
+
|
315 |
+
$default_kit->save( [ 'settings' => $settings ] );
|
316 |
+
}
|
317 |
+
}
|
318 |
+
}
|
319 |
+
|
320 |
+
/**
|
321 |
+
** Setup WPR Templates
|
322 |
+
*/
|
323 |
+
function setup_wpr_templates( $kit ) {
|
324 |
+
$kit = isset($kit) ? sanitize_text_field(wp_unslash($kit)) : '';
|
325 |
+
|
326 |
+
// Check if kit has Theme Builder templates
|
327 |
+
$kit_name = substr($kit, 0, strripos($kit, '-v'));
|
328 |
+
$kit_version = substr($kit, (strripos($kit, '-v') + 1), strlen($kit));
|
329 |
+
$get_available_kits = WPR_Templates_Data::get_available_kits();
|
330 |
+
$has_theme_builder = $get_available_kits[$kit_name][$kit_version]['theme-builder'];
|
331 |
+
|
332 |
+
// Set Home & Blog Pages
|
333 |
+
$home_page = get_page_by_path('home-'. $kit);
|
334 |
+
$blog_page = get_page_by_path('blog-'. $kit);
|
335 |
+
|
336 |
+
if ( $home_page ) {
|
337 |
+
update_option( 'show_on_front', 'page' );
|
338 |
+
update_option( 'page_on_front', $home_page->ID );
|
339 |
+
|
340 |
+
if ( $blog_page ) {
|
341 |
+
update_option( 'page_for_posts', $blog_page->ID );
|
342 |
+
}
|
343 |
+
}
|
344 |
+
|
345 |
+
// Set Headers and Footers
|
346 |
+
update_option('wpr_header_conditions', '{"user-header-'. $kit .'-header":["global"]}');
|
347 |
+
update_post_meta( Utilities::get_template_id('user-header-'. $kit), 'wpr_header_show_on_canvas', 'true' );
|
348 |
+
update_option('wpr_footer_conditions', '{"user-footer-'. $kit .'-footer":["global"]}');
|
349 |
+
update_post_meta( Utilities::get_template_id('user-footer-'. $kit), 'wpr_footer_show_on_canvas', 'true' );
|
350 |
+
|
351 |
+
// Theme Builder
|
352 |
+
if ( $has_theme_builder ) {
|
353 |
+
update_option('wpr_archive_conditions', '{"user-archive-'. $kit .'-blog":["archive/posts"],"user-archive-'. $kit .'-author":["archive/author"],"user-archive-'. $kit .'-date":["archive/date"],"user-archive-'. $kit .'-category-tag":["archive/categories/all","archive/tags/all"],"user-archive-'. $kit .'-search":["archive/search"]}');
|
354 |
+
update_option('wpr_single_conditions', '{"user-single-'. $kit .'-404":["single/page_404"],"user-single-'. $kit .'-post":["single/posts/all"],"user-single-'. $kit .'-page":["single/pages/all"]}');
|
355 |
+
}
|
356 |
+
|
357 |
+
// Set Popup
|
358 |
+
update_option('wpr_popup_conditions', '{"user-popup-'. $kit .'-popup":["global"]}');
|
359 |
+
}
|
360 |
+
|
361 |
+
/**
|
362 |
+
** Fix Elementor Images
|
363 |
+
*/
|
364 |
+
function wpr_fix_elementor_images() {
|
365 |
+
$args = array(
|
366 |
+
'post_type' => ['wpr_templates', 'page'],
|
367 |
+
'posts_per_page' => '-1',
|
368 |
+
'meta_key' => '_elementor_version'
|
369 |
+
);
|
370 |
+
$elementor_pages = new WP_Query ( $args );
|
371 |
+
|
372 |
+
// Check that we have query results.
|
373 |
+
if ( $elementor_pages->have_posts() ) {
|
374 |
+
|
375 |
+
// Start looping over the query results.
|
376 |
+
while ( $elementor_pages->have_posts() ) {
|
377 |
+
|
378 |
+
$elementor_pages->the_post();
|
379 |
+
|
380 |
+
// Replace Demo with Current
|
381 |
+
$site_url = get_site_url();
|
382 |
+
$site_url = str_replace( '/', '\/', $site_url );
|
383 |
+
$demo_site_url = 'https://demosites.royal-elementor-addons.com/'. get_option('wpr-import-kit-id');
|
384 |
+
$demo_site_url = str_replace( '/', '\/', $demo_site_url );
|
385 |
+
|
386 |
+
// Elementor Data
|
387 |
+
$data = get_post_meta( get_the_ID(), '_elementor_data', true );
|
388 |
+
|
389 |
+
if ( ! empty( $data ) ) {
|
390 |
+
$data = preg_replace('/\\\{1}\/sites\\\{1}\/\d+/', '', $data);
|
391 |
+
$data = str_replace( $demo_site_url, $site_url, $data );
|
392 |
+
$data = json_decode( $data, true );
|
393 |
+
}
|
394 |
+
|
395 |
+
update_metadata( 'post', get_the_ID(), '_elementor_data', $data );
|
396 |
+
|
397 |
+
// Elementor Page Settings
|
398 |
+
$page_settings = get_post_meta( get_the_ID(), '_elementor_page_settings', true );
|
399 |
+
$page_settings = json_encode($page_settings);
|
400 |
+
|
401 |
+
if ( ! empty( $page_settings ) ) {
|
402 |
+
$page_settings = preg_replace('/\\\{1}\/sites\\\{1}\/\d+/', '', $page_settings);
|
403 |
+
$page_settings = str_replace( $demo_site_url, $site_url, $page_settings );
|
404 |
+
$page_settings = json_decode( $page_settings, true );
|
405 |
+
}
|
406 |
+
|
407 |
+
update_metadata( 'post', get_the_ID(), '_elementor_page_settings', $page_settings );
|
408 |
+
|
409 |
+
}
|
410 |
+
|
411 |
+
}
|
412 |
+
|
413 |
+
// Clear Elementor Cache
|
414 |
+
Plugin::$instance->files_manager->clear_cache();
|
415 |
+
}
|
416 |
+
|
417 |
+
/**
|
418 |
+
** Fix Contact Form 7
|
419 |
+
*/
|
420 |
+
function fix_contact_form_7() {
|
421 |
+
if ( class_exists('WPCF7_ContactForm') ) {
|
422 |
+
$new_contact_form = WPCF7_ContactForm::get_template(
|
423 |
+
array(
|
424 |
+
'title' =>
|
425 |
+
/* translators: title of your first contact form. %d: number fixed to '1' */
|
426 |
+
sprintf( __( 'Contact form %d', 'contact-form-7' ), 1 ),
|
427 |
+
)
|
428 |
+
);
|
429 |
+
|
430 |
+
// Get CF7s
|
431 |
+
$contact_forms = get_posts(['post_type'=>'wpcf7_contact_form']);
|
432 |
+
|
433 |
+
// Add new CF7
|
434 |
+
if ( empty($contact_forms) ) {
|
435 |
+
$new_contact_form->save();
|
436 |
+
}
|
437 |
+
}
|
438 |
+
}
|
439 |
+
|
440 |
+
/**
|
441 |
+
** Final Settings Setup
|
442 |
+
*/
|
443 |
+
function wpr_final_settings_setup() {
|
444 |
+
$kit = !empty(get_option('wpr-import-kit-id')) ? esc_html(get_option('wpr-import-kit-id')) : '';
|
445 |
+
|
446 |
+
// Elementor Site Settings
|
447 |
+
import_elementor_site_settings($kit);
|
448 |
+
|
449 |
+
// Setup WPR Templates
|
450 |
+
setup_wpr_templates($kit);
|
451 |
+
|
452 |
+
// Fix Elementor Images
|
453 |
+
wpr_fix_elementor_images();
|
454 |
+
|
455 |
+
// Fix Contact Form 7
|
456 |
+
fix_contact_form_7();
|
457 |
+
|
458 |
+
// Track Kit
|
459 |
+
wpr_track_imported_kit( $kit );
|
460 |
+
|
461 |
+
// Clear DB
|
462 |
+
delete_option('wpr-import-kit-id');
|
463 |
+
|
464 |
+
// Delete Hello World Post
|
465 |
+
$post = get_page_by_path('hello-world', OBJECT, 'post');
|
466 |
+
if ( $post ) {
|
467 |
+
wp_delete_post($post->ID,true);
|
468 |
+
}
|
469 |
+
}
|
470 |
+
|
471 |
+
/**
|
472 |
+
* Allow SVG Import - Add Mime Types
|
473 |
+
*/
|
474 |
+
function wpr_svgs_upload_mimes( $mimes = array() ) {
|
475 |
+
|
476 |
+
// allow SVG file upload
|
477 |
+
$mimes['svg'] = 'image/svg+xml';
|
478 |
+
$mimes['svgz'] = 'image/svg+xml';
|
479 |
+
|
480 |
+
// allow JSON file upload
|
481 |
+
$mimes['json'] = 'text/plain';
|
482 |
+
|
483 |
+
return $mimes;
|
484 |
+
|
485 |
+
}
|
486 |
+
add_filter( 'upload_mimes', 'wpr_svgs_upload_mimes', 99 );
|
487 |
+
|
488 |
+
/**
|
489 |
+
* Check Mime Types
|
490 |
+
*/
|
491 |
+
function wpr_svgs_upload_check( $checked, $file, $filename, $mimes ) {
|
492 |
+
|
493 |
+
if ( ! $checked['type'] ) {
|
494 |
+
|
495 |
+
$check_filetype = wp_check_filetype( $filename, $mimes );
|
496 |
+
$ext = $check_filetype['ext'];
|
497 |
+
$type = $check_filetype['type'];
|
498 |
+
$proper_filename = $filename;
|
499 |
+
|
500 |
+
if ( $type && 0 === strpos( $type, 'image/' ) && $ext !== 'svg' ) {
|
501 |
+
$ext = $type = false;
|
502 |
+
}
|
503 |
+
|
504 |
+
$checked = compact( 'ext','type','proper_filename' );
|
505 |
+
}
|
506 |
+
|
507 |
+
return $checked;
|
508 |
+
|
509 |
+
}
|
510 |
+
add_filter( 'wp_check_filetype_and_ext', 'wpr_svgs_upload_check', 10, 4 );
|
511 |
+
|
512 |
+
/**
|
513 |
+
* Mime Check fix for WP 4.7.1 / 4.7.2
|
514 |
+
*
|
515 |
+
* Fixes uploads for these 2 version of WordPress.
|
516 |
+
* Issue was fixed in 4.7.3 core.
|
517 |
+
*/
|
518 |
+
function wpr_svgs_allow_svg_upload( $data, $file, $filename, $mimes ) {
|
519 |
+
|
520 |
+
global $wp_version;
|
521 |
+
if ( $wp_version !== '4.7.1' || $wp_version !== '4.7.2' ) {
|
522 |
+
return $data;
|
523 |
+
}
|
524 |
+
|
525 |
+
$filetype = wp_check_filetype( $filename, $mimes );
|
526 |
+
|
527 |
+
return [
|
528 |
+
'ext' => $filetype['ext'],
|
529 |
+
'type' => $filetype['type'],
|
530 |
+
'proper_filename' => $data['proper_filename']
|
531 |
+
];
|
532 |
+
|
533 |
+
}
|
534 |
+
add_filter( 'wp_check_filetype_and_ext', 'wpr_svgs_allow_svg_upload', 10, 4 );
|
535 |
+
|
536 |
+
/**
|
537 |
+
** Search Query Results
|
538 |
+
*/
|
539 |
+
function wpr_search_query_results() {
|
540 |
+
// Freemius OptIn
|
541 |
+
if ( ! ( wpr_fs()->is_registered() && wpr_fs()->is_tracking_allowed() || wpr_fs()->is_pending_activation() ) ) {
|
542 |
+
return;
|
543 |
+
}
|
544 |
+
|
545 |
+
$search_query = isset($_POST['search_query']) ? sanitize_text_field(wp_unslash($_POST['search_query'])) : '';
|
546 |
+
|
547 |
+
wp_remote_post( 'http://reastats.kinsta.cloud/wp-json/templates-kit-search/data', [
|
548 |
+
'body' => [
|
549 |
+
'search_query' => $search_query
|
550 |
+
]
|
551 |
+
] );
|
552 |
+
}
|
553 |
+
|
554 |
+
/**
|
555 |
+
** Search Query Results
|
556 |
+
*/
|
557 |
+
function wpr_track_imported_kit( $kit ) {
|
558 |
+
// Freemius OptIn
|
559 |
+
if ( ! ( wpr_fs()->is_registered() && wpr_fs()->is_tracking_allowed() || wpr_fs()->is_pending_activation() ) ) {
|
560 |
+
return;
|
561 |
+
}
|
562 |
+
|
563 |
+
wp_remote_post( 'http://reastats.kinsta.cloud/wp-json/templates-kit-import/data', [
|
564 |
+
'body' => [
|
565 |
+
'imported_kit' => $kit
|
566 |
+
]
|
567 |
+
] );
|
568 |
}
|
admin/templates/views/royal/theme-header-royal.php
CHANGED
@@ -18,7 +18,7 @@ $template_slug = WPR_Conditions_Manager::header_footer_display_conditions($condi
|
|
18 |
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
|
19 |
<?php if ( ! current_theme_supports( 'title-tag' ) ) : ?>
|
20 |
<title>
|
21 |
-
<?php echo wp_get_document_title(); ?>
|
22 |
</title>
|
23 |
<?php endif; ?>
|
24 |
<?php wp_head(); ?>
|
18 |
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
|
19 |
<?php if ( ! current_theme_supports( 'title-tag' ) ) : ?>
|
20 |
<title>
|
21 |
+
<?php echo esc_html(wp_get_document_title()); ?>
|
22 |
</title>
|
23 |
<?php endif; ?>
|
24 |
<?php wp_head(); ?>
|
admin/templates/views/storefront/class-storefront-compat.php
CHANGED
@@ -78,7 +78,8 @@ class Wpr_Storefront_Compat {
|
|
78 |
|
79 |
$css .= '</style>';
|
80 |
|
81 |
-
|
|
|
82 |
}
|
83 |
|
84 |
/**
|
78 |
|
79 |
$css .= '</style>';
|
80 |
|
81 |
+
// Echo plain CSS (no user input or variables)
|
82 |
+
echo ''. $css; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
83 |
}
|
84 |
|
85 |
/**
|
admin/templates/views/theme-header.php
CHANGED
@@ -18,7 +18,7 @@ $template_slug = WPR_Conditions_Manager::header_footer_display_conditions($condi
|
|
18 |
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
|
19 |
<?php if ( ! current_theme_supports( 'title-tag' ) ) : ?>
|
20 |
<title>
|
21 |
-
<?php echo wp_get_document_title(); ?>
|
22 |
</title>
|
23 |
<?php endif; ?>
|
24 |
<?php wp_head(); ?>
|
18 |
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
|
19 |
<?php if ( ! current_theme_supports( 'title-tag' ) ) : ?>
|
20 |
<title>
|
21 |
+
<?php echo esc_html(wp_get_document_title()); ?>
|
22 |
</title>
|
23 |
<?php endif; ?>
|
24 |
<?php wp_head(); ?>
|
admin/templates/wpr-templates-data.php
CHANGED
@@ -20,7 +20,7 @@ class WPR_Templates_Data {
|
|
20 |
'tags' => 'blog blogger posts personal blog lifestyle blogger theme builder grid slider news',
|
21 |
'theme-builder' => true,
|
22 |
'price' => $is_pro_active ? 'free' : 'free',
|
23 |
-
'priority' =>
|
24 |
],
|
25 |
'v2' => [
|
26 |
'name' => 'Personal Blog',
|
@@ -78,11 +78,33 @@ class WPR_Templates_Data {
|
|
78 |
'pages' => 'home,about,services,projects,contact,',
|
79 |
'plugins' => '{"contact-form-7":'. $is_cf7_active .'}',
|
80 |
'tags' => 'nature influencer travel blogger blog content slider tourism influencers creator travel forest slider generic multipurpose national-park nature-park sanctuary wilderness hitchhiking mountain river lakes outdoors',
|
81 |
-
'theme-builder' =>
|
82 |
'price' => $is_pro_active ? 'free' : 'free',
|
83 |
'priority' => 60,
|
84 |
],
|
85 |
],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
86 |
'travel-blog' => [
|
87 |
'v1' => [
|
88 |
'name' => 'Travel Blog',
|
@@ -91,7 +113,7 @@ class WPR_Templates_Data {
|
|
91 |
'tags' => 'nature influencer travel blogger blog posts content tourism influencers creator travel forest slider generic multipurpose national-park nature-park sanctuary wilderness slider hitchhiking mountain river lakes outdoors theme builder traveler hiking grid',
|
92 |
'theme-builder' => true,
|
93 |
'price' => $is_pro_active ? 'free' : 'pro',
|
94 |
-
'priority' =>
|
95 |
],
|
96 |
],
|
97 |
'portfolio' => [
|
@@ -105,6 +127,17 @@ class WPR_Templates_Data {
|
|
105 |
'priority' => 80,
|
106 |
],
|
107 |
],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
108 |
'pizza' => [
|
109 |
'v1' => [
|
110 |
'name' => 'Pizza Restaurant',
|
@@ -116,6 +149,17 @@ class WPR_Templates_Data {
|
|
116 |
'priority' => 90,
|
117 |
],
|
118 |
],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
119 |
'travel' => [
|
120 |
'v1' => [
|
121 |
'name' => 'Travel Blogger & Influencer',
|
@@ -138,6 +182,17 @@ class WPR_Templates_Data {
|
|
138 |
'priority' => 110,
|
139 |
],
|
140 |
],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
141 |
'photographer' => [
|
142 |
'v1' => [
|
143 |
'name' => 'Photographer Portfolio Dark',
|
@@ -286,6 +341,17 @@ class WPR_Templates_Data {
|
|
286 |
'priority' => 260,
|
287 |
],
|
288 |
],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
289 |
'realestate' => [
|
290 |
'v1' => [
|
291 |
'name' => 'Real Estate',
|
20 |
'tags' => 'blog blogger posts personal blog lifestyle blogger theme builder grid slider news',
|
21 |
'theme-builder' => true,
|
22 |
'price' => $is_pro_active ? 'free' : 'free',
|
23 |
+
'priority' => 2,
|
24 |
],
|
25 |
'v2' => [
|
26 |
'name' => 'Personal Blog',
|
78 |
'pages' => 'home,about,services,projects,contact,',
|
79 |
'plugins' => '{"contact-form-7":'. $is_cf7_active .'}',
|
80 |
'tags' => 'nature influencer travel blogger blog content slider tourism influencers creator travel forest slider generic multipurpose national-park nature-park sanctuary wilderness hitchhiking mountain river lakes outdoors',
|
81 |
+
'theme-builder' => true,
|
82 |
'price' => $is_pro_active ? 'free' : 'free',
|
83 |
'priority' => 60,
|
84 |
],
|
85 |
],
|
86 |
+
'digital-marketing-agency' => [
|
87 |
+
'v1' => [
|
88 |
+
'name' => 'Digital Marketing Agency',
|
89 |
+
'pages' => 'home,seo,branding,marketing,social,blog,about,contact,',
|
90 |
+
'plugins' => '{"contact-form-7":'. $is_cf7_active .'}',
|
91 |
+
'tags' => 'digital agency company corporate digital services office agency web digital marketing seo social media branding',
|
92 |
+
'theme-builder' => true,
|
93 |
+
'price' => $is_pro_active ? 'free' : 'free',
|
94 |
+
'priority' => 1,
|
95 |
+
],
|
96 |
+
],
|
97 |
+
'one-page' => [
|
98 |
+
'v1' => [
|
99 |
+
'name' => 'One Page - Digital Marketing Agency',
|
100 |
+
'pages' => 'home,blog,',
|
101 |
+
'plugins' => '{"contact-form-7":'. $is_cf7_active .', "media-library-assistant":'. $is_mla_active .'}',
|
102 |
+
'tags' => 'digital agency company corporate digital services office agency web digital marketing seo social media branding one page onepage one pages parallax single page',
|
103 |
+
'theme-builder' => true,
|
104 |
+
'price' => $is_pro_active ? 'free' : 'free',
|
105 |
+
'priority' => 49,
|
106 |
+
],
|
107 |
+
],
|
108 |
'travel-blog' => [
|
109 |
'v1' => [
|
110 |
'name' => 'Travel Blog',
|
113 |
'tags' => 'nature influencer travel blogger blog posts content tourism influencers creator travel forest slider generic multipurpose national-park nature-park sanctuary wilderness slider hitchhiking mountain river lakes outdoors theme builder traveler hiking grid',
|
114 |
'theme-builder' => true,
|
115 |
'price' => $is_pro_active ? 'free' : 'pro',
|
116 |
+
'priority' => 71,
|
117 |
],
|
118 |
],
|
119 |
'portfolio' => [
|
127 |
'priority' => 80,
|
128 |
],
|
129 |
],
|
130 |
+
'nft-portfolio' => [
|
131 |
+
'v1' => [
|
132 |
+
'name' => 'NFT',
|
133 |
+
'pages' => 'home,about,blog,roadmap,team,nft,faq,comingsoon,',
|
134 |
+
'plugins' => '{"contact-form-7":'. $is_cf7_active .'}',
|
135 |
+
'tags' => 'portfolio blockchain nft crypto collection minting listing metavers digital currency art',
|
136 |
+
'theme-builder' => false,
|
137 |
+
'price' => $is_pro_active ? 'free' : 'free',
|
138 |
+
'priority' => 81,
|
139 |
+
],
|
140 |
+
],
|
141 |
'pizza' => [
|
142 |
'v1' => [
|
143 |
'name' => 'Pizza Restaurant',
|
149 |
'priority' => 90,
|
150 |
],
|
151 |
],
|
152 |
+
'pet-care' => [
|
153 |
+
'v1' => [
|
154 |
+
'name' => 'Pet Care',
|
155 |
+
'pages' => 'home,about,services,reviews,contact,',
|
156 |
+
'plugins' => '{"contact-form-7":'. $is_cf7_active .'}',
|
157 |
+
'tags' => 'pet care dog care grooming pet minding pet sitting pet training pet walking cat animal dogs dog training',
|
158 |
+
'theme-builder' => false,
|
159 |
+
'price' => $is_pro_active ? 'free' : 'free',
|
160 |
+
'priority' => 91,
|
161 |
+
],
|
162 |
+
],
|
163 |
'travel' => [
|
164 |
'v1' => [
|
165 |
'name' => 'Travel Blogger & Influencer',
|
182 |
'priority' => 110,
|
183 |
],
|
184 |
],
|
185 |
+
'charity' => [
|
186 |
+
'v1' => [
|
187 |
+
'name' => 'Charity',
|
188 |
+
'pages' => 'home,home-v1,contact,whatwedo,whoweare,partners,',
|
189 |
+
'plugins' => '{"contact-form-7":'. $is_cf7_active .'}',
|
190 |
+
'tags' => 'charity donate church foundation giving non-profit organization kids charity help children save life donation fundrising ngo fundraising corona fundraising nonprofit non profit',
|
191 |
+
'theme-builder' => false,
|
192 |
+
'price' => $is_pro_active ? 'free' : 'free',
|
193 |
+
'priority' => 111,
|
194 |
+
],
|
195 |
+
],
|
196 |
'photographer' => [
|
197 |
'v1' => [
|
198 |
'name' => 'Photographer Portfolio Dark',
|
341 |
'priority' => 260,
|
342 |
],
|
343 |
],
|
344 |
+
'carwash' => [
|
345 |
+
'v1' => [
|
346 |
+
'name' => 'Carwash',
|
347 |
+
'pages' => 'home,about,services,contact,',
|
348 |
+
'plugins' => '{"contact-form-7":'. $is_cf7_active .'}',
|
349 |
+
'tags' => 'vehicle car wash cleaning painting service maintenance care bike motorcycle detailing',
|
350 |
+
'theme-builder' => false,
|
351 |
+
'price' => $is_pro_active ? 'free' : 'free',
|
352 |
+
'priority' => 252,
|
353 |
+
],
|
354 |
+
],
|
355 |
'realestate' => [
|
356 |
'v1' => [
|
357 |
'name' => 'Real Estate',
|
admin/templates/wpr-templates-library-blocks.php
CHANGED
@@ -3,7 +3,9 @@ namespace WprAddons\Admin\Templates;
|
|
3 |
use WprAddons\Classes\Utilities;
|
4 |
use WprAddons\Admin\Templates\WPR_Templates_Data;
|
5 |
|
6 |
-
if ( ! defined( 'ABSPATH' ) )
|
|
|
|
|
7 |
|
8 |
/**
|
9 |
* WPR_Templates_Library_Blocks setup
|
@@ -67,7 +69,7 @@ class WPR_Templates_Library_Blocks {
|
|
67 |
|
68 |
foreach ($modules as $title => $slug) {
|
69 |
if ( ! in_array($slug[0], $exclude_widgets) ) {
|
70 |
-
echo '<li data-filter="'. $slug[0] .'">'. $title .'</li>';
|
71 |
}
|
72 |
}
|
73 |
|
@@ -120,16 +122,16 @@ class WPR_Templates_Library_Blocks {
|
|
120 |
<div class="wpr-tplib-template-wrap<?php echo esc_attr($template_class); ?>">
|
121 |
<div class="wpr-tplib-template" data-slug="<?php echo esc_attr($template_slug); ?>" data-filter="<?php echo esc_attr($module_slug); ?>" data-sub-filter="<?php echo esc_attr($template_sub); ?>" data-preview-type="<?php echo esc_attr($preview_type); ?>" data-preview-url="<?php echo esc_attr($preview_url); ?>">
|
122 |
<div class="wpr-tplib-template-media">
|
123 |
-
<img src="<?php echo 'https://royal-elementor-addons.com/library/premade-styles/'. $module_slug .'/'.
|
124 |
<div class="wpr-tplib-template-media-overlay">
|
125 |
<i class="eicon-eye"></i>
|
126 |
</div>
|
127 |
</div>
|
128 |
<div class="wpr-tplib-template-footer elementor-clearfix">
|
129 |
<?php if ( !defined('WPR_ADDONS_PRO_VERSION') && ! wpr_fs()->can_use_premium_code() ) : ?>
|
130 |
-
<h3><?php echo strpos($template_slug, 'pro') ? str_replace('-pro', ' Pro', $template_title) : str_replace('-zzz', ' Pro', $template_title); ?></h3>
|
131 |
<?php else : ?>
|
132 |
-
<h3><?php echo strpos($template_slug, 'pro') ? str_replace('-pro', '', $template_title) : str_replace('-zzz', '', $template_title); ?></h3>
|
133 |
<?php endif; ?>
|
134 |
|
135 |
<?php if ( ( strpos($template_slug, 'pro') && !wpr_fs()->can_use_premium_code() ) || ( strpos($template_slug, 'zzz') ) && !wpr_fs()->can_use_premium_code() ) : ?>
|
3 |
use WprAddons\Classes\Utilities;
|
4 |
use WprAddons\Admin\Templates\WPR_Templates_Data;
|
5 |
|
6 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
7 |
+
exit; // Exit if accessed directly.
|
8 |
+
}
|
9 |
|
10 |
/**
|
11 |
* WPR_Templates_Library_Blocks setup
|
69 |
|
70 |
foreach ($modules as $title => $slug) {
|
71 |
if ( ! in_array($slug[0], $exclude_widgets) ) {
|
72 |
+
echo '<li data-filter="'. esc_attr($slug[0]) .'">'. esc_html($title) .'</li>';
|
73 |
}
|
74 |
}
|
75 |
|
122 |
<div class="wpr-tplib-template-wrap<?php echo esc_attr($template_class); ?>">
|
123 |
<div class="wpr-tplib-template" data-slug="<?php echo esc_attr($template_slug); ?>" data-filter="<?php echo esc_attr($module_slug); ?>" data-sub-filter="<?php echo esc_attr($template_sub); ?>" data-preview-type="<?php echo esc_attr($preview_type); ?>" data-preview-url="<?php echo esc_attr($preview_url); ?>">
|
124 |
<div class="wpr-tplib-template-media">
|
125 |
+
<img src="<?php echo esc_url('https://royal-elementor-addons.com/library/premade-styles/'. $module_slug .'/'. $template_slug_for_image .'.jpg'); ?>">
|
126 |
<div class="wpr-tplib-template-media-overlay">
|
127 |
<i class="eicon-eye"></i>
|
128 |
</div>
|
129 |
</div>
|
130 |
<div class="wpr-tplib-template-footer elementor-clearfix">
|
131 |
<?php if ( !defined('WPR_ADDONS_PRO_VERSION') && ! wpr_fs()->can_use_premium_code() ) : ?>
|
132 |
+
<h3><?php echo strpos($template_slug, 'pro') ? esc_html(str_replace('-pro', ' Pro', $template_title)) : esc_html(str_replace('-zzz', ' Pro', $template_title)); ?></h3>
|
133 |
<?php else : ?>
|
134 |
+
<h3><?php echo strpos($template_slug, 'pro') ? esc_html(str_replace('-pro', '', $template_title)) : esc_html(str_replace('-zzz', '', $template_title)); ?></h3>
|
135 |
<?php endif; ?>
|
136 |
|
137 |
<?php if ( ( strpos($template_slug, 'pro') && !wpr_fs()->can_use_premium_code() ) || ( strpos($template_slug, 'zzz') ) && !wpr_fs()->can_use_premium_code() ) : ?>
|
admin/templates/wpr-templates-library-popups.php
CHANGED
@@ -1,107 +1,109 @@
|
|
1 |
-
<?php
|
2 |
-
namespace WprAddons\Admin\Templates;
|
3 |
-
use WprAddons\Classes\Utilities;
|
4 |
-
use WprAddons\Admin\Templates\WPR_Templates_Data;
|
5 |
-
|
6 |
-
if ( ! defined( 'ABSPATH' ) )
|
7 |
-
|
8 |
-
|
9 |
-
|
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 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
<li data-filter="
|
50 |
-
<li data-filter="
|
51 |
-
<li data-filter="
|
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 |
-
<?php
|
92 |
-
<span class="wpr-tplib-insert-template"><i class="eicon-
|
93 |
-
<?php
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
|
|
|
|
107 |
}
|
1 |
+
<?php
|
2 |
+
namespace WprAddons\Admin\Templates;
|
3 |
+
use WprAddons\Classes\Utilities;
|
4 |
+
use WprAddons\Admin\Templates\WPR_Templates_Data;
|
5 |
+
|
6 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
7 |
+
exit; // Exit if accessed directly.
|
8 |
+
}
|
9 |
+
|
10 |
+
/**
|
11 |
+
* WPR_Templates_Library_Popups setup
|
12 |
+
*
|
13 |
+
* @since 1.0
|
14 |
+
*/
|
15 |
+
class WPR_Templates_Library_Popups {
|
16 |
+
|
17 |
+
/**
|
18 |
+
** Constructor
|
19 |
+
*/
|
20 |
+
public function __construct() {
|
21 |
+
|
22 |
+
// Template Library Popup
|
23 |
+
add_action( 'wp_ajax_render_library_templates_popups', [ $this, 'render_library_templates_popups' ] );
|
24 |
+
|
25 |
+
}
|
26 |
+
|
27 |
+
/**
|
28 |
+
** Template Library Popup
|
29 |
+
*/
|
30 |
+
public function render_library_templates_popups() {
|
31 |
+
|
32 |
+
?>
|
33 |
+
|
34 |
+
<div class="wpr-tplib-sidebar">
|
35 |
+
<div class="wpr-tplib-search">
|
36 |
+
<input type="text" placeholder="Search Template">
|
37 |
+
<i class="eicon-search"></i>
|
38 |
+
</div>
|
39 |
+
|
40 |
+
<div class="wpr-tplib-filters-wrap">
|
41 |
+
<div class="wpr-tplib-filters">
|
42 |
+
<h3>
|
43 |
+
<span><?php esc_html_e( 'Category', 'wpr-addons' ); ?></span>
|
44 |
+
<i class="fas fa-angle-down"></i>
|
45 |
+
</h3>
|
46 |
+
|
47 |
+
<div class="wpr-tplib-filters-list">
|
48 |
+
<ul>
|
49 |
+
<li data-filter="all"><?php esc_html_e( 'All', 'wpr-addons' ) ?></li>
|
50 |
+
<li data-filter="cookie"><?php esc_html_e( 'Cookie', 'wpr-addons' ) ?></li>
|
51 |
+
<li data-filter="discount"><?php esc_html_e( 'Discount', 'wpr-addons' ) ?></li>
|
52 |
+
<li data-filter="subscribe"><?php esc_html_e( 'Subscribe', 'wpr-addons' ) ?></li>
|
53 |
+
<li data-filter="yesno"><?php esc_html_e( 'Yes/No', 'wpr-addons' ) ?></li>
|
54 |
+
</ul>
|
55 |
+
</div>
|
56 |
+
</div>
|
57 |
+
</div>
|
58 |
+
|
59 |
+
</div>
|
60 |
+
|
61 |
+
<div class="wpr-tplib-template-gird elementor-clearfix">
|
62 |
+
<div class="wpr-tplib-template-gird-inner">
|
63 |
+
|
64 |
+
<?php
|
65 |
+
|
66 |
+
$popups = WPR_Templates_Data::get_available_popups();
|
67 |
+
|
68 |
+
foreach ($popups as $type => $data) :
|
69 |
+
|
70 |
+
for ( $i=0; $i < count($popups[$type]); $i++ ) :
|
71 |
+
|
72 |
+
$template_slug = array_keys($popups[$type])[$i];
|
73 |
+
$template_title = ucfirst($type) .' '. $template_slug;
|
74 |
+
$preview_type = $popups[$type][$template_slug]['type'];
|
75 |
+
$preview_url = $popups[$type][$template_slug]['url'];
|
76 |
+
$template_class = ( strpos($template_slug, 'pro') && ! wpr_fs()->can_use_premium_code() ) ? ' wpr-tplib-pro-wrap' : '';
|
77 |
+
|
78 |
+
?>
|
79 |
+
|
80 |
+
<div class="wpr-tplib-template-wrap<?php echo esc_attr($template_class); ?>">
|
81 |
+
<div class="wpr-tplib-template" data-slug="<?php echo esc_attr($template_slug); ?>" data-filter="<?php echo esc_attr($type); ?>" data-preview-type="<?php echo esc_attr($preview_type); ?>" data-preview-url="<?php echo esc_attr($preview_url); ?>">
|
82 |
+
<div class="wpr-tplib-template-media">
|
83 |
+
<img src="<?php echo esc_url('https://royal-elementor-addons.com/library/premade-styles/popups/'. $type .'/'. $template_slug .'.jpg'); ?>">
|
84 |
+
<div class="wpr-tplib-template-media-overlay">
|
85 |
+
<i class="eicon-eye"></i>
|
86 |
+
</div>
|
87 |
+
</div>
|
88 |
+
<div class="wpr-tplib-template-footer elementor-clearfix">
|
89 |
+
<h3><?php echo esc_html(str_replace('-pro', ' Pro', $template_title)); ?></h3>
|
90 |
+
|
91 |
+
<?php if ( strpos($template_slug, 'pro') && ! wpr_fs()->can_use_premium_code() ) : ?>
|
92 |
+
<span class="wpr-tplib-insert-template wpr-tplib-insert-pro"><i class="eicon-star"></i> <span><?php esc_html_e( 'Go Pro', 'wpr-addons' ); ?></span></span>
|
93 |
+
<?php else : ?>
|
94 |
+
<span class="wpr-tplib-insert-template"><i class="eicon-file-download"></i> <span><?php esc_html_e( 'Insert', 'wpr-addons' ); ?></span></span>
|
95 |
+
<?php endif; ?>
|
96 |
+
</div>
|
97 |
+
</div>
|
98 |
+
</div>
|
99 |
+
|
100 |
+
<?php endfor; ?>
|
101 |
+
<?php endforeach; ?>
|
102 |
+
|
103 |
+
</div>
|
104 |
+
</div>
|
105 |
+
|
106 |
+
<?php exit();
|
107 |
+
}
|
108 |
+
|
109 |
}
|
admin/templates/wpr-templates-pages.php
CHANGED
@@ -1,7 +1,9 @@
|
|
1 |
<?php
|
2 |
namespace WprAddons\Admin\Templates;
|
3 |
|
4 |
-
if ( ! defined( 'ABSPATH' ) )
|
|
|
|
|
5 |
|
6 |
/**
|
7 |
* WPR_Templates_Library_Pages setup
|
1 |
<?php
|
2 |
namespace WprAddons\Admin\Templates;
|
3 |
|
4 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
5 |
+
exit; // Exit if accessed directly.
|
6 |
+
}
|
7 |
|
8 |
/**
|
9 |
* WPR_Templates_Library_Pages setup
|
admin/theme-builder.php
CHANGED
@@ -1,132 +1,134 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
if ( ! defined( 'ABSPATH' ) )
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
<div class="wpr-settings-page-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
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 |
-
<?php
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
<?php
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
<?php
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
<?php
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
</div>
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
|
|
|
|
132 |
} // End wpr_addons_theme_builder_page()
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
4 |
+
exit; // Exit if accessed directly.
|
5 |
+
}
|
6 |
+
|
7 |
+
use WprAddons\Admin\Includes\WPR_Templates_Loop;
|
8 |
+
use WprAddons\Classes\Utilities;
|
9 |
+
|
10 |
+
// Register Menus
|
11 |
+
function wpr_addons_add_theme_builder_menu() {
|
12 |
+
add_submenu_page( 'wpr-addons', 'Theme Builder', 'Theme Builder', 'manage_options', 'wpr-theme-builder', 'wpr_addons_theme_builder_page' );
|
13 |
+
}
|
14 |
+
add_action( 'admin_menu', 'wpr_addons_add_theme_builder_menu' );
|
15 |
+
|
16 |
+
function wpr_addons_theme_builder_page() {
|
17 |
+
|
18 |
+
?>
|
19 |
+
|
20 |
+
<div class="wrap wpr-settings-page-wrap">
|
21 |
+
|
22 |
+
<div class="wpr-settings-page-header">
|
23 |
+
<h1><?php echo esc_html(Utilities::get_plugin_name(true)); ?></h1>
|
24 |
+
<p><?php esc_html_e( 'The most powerful Elementor Addons in the universe.', 'wpr-addons' ); ?></p>
|
25 |
+
|
26 |
+
<!-- Custom Template -->
|
27 |
+
<div class="wpr-preview-buttons">
|
28 |
+
<div class="wpr-user-template">
|
29 |
+
<span><?php esc_html_e( 'Create Template', 'wpr-addons' ); ?></span>
|
30 |
+
<span class="plus-icon">+</span>
|
31 |
+
</div>
|
32 |
+
|
33 |
+
<a href="https://www.youtube.com/watch?v=cwkhwO_rPuo" class="wpr-options-button button" target="_blank" style="padding: 8px 22px;">
|
34 |
+
<?php echo esc_html__( 'How to use Theme Builder', 'wpr-addons' ); ?>
|
35 |
+
<span class="dashicons dashicons-video-alt3"></span>
|
36 |
+
</a>
|
37 |
+
</div>
|
38 |
+
</div>
|
39 |
+
|
40 |
+
<div class="wpr-settings-page">
|
41 |
+
<form method="post" action="options.php">
|
42 |
+
<?php
|
43 |
+
|
44 |
+
// Active Tab
|
45 |
+
$active_tab = isset( $_GET['tab'] ) ? sanitize_text_field( wp_unslash( $_GET['tab'] ) ) : 'wpr_tab_header';
|
46 |
+
|
47 |
+
?>
|
48 |
+
|
49 |
+
<!-- Template ID Holder -->
|
50 |
+
<input type="hidden" name="wpr_template" id="wpr_template" value="">
|
51 |
+
|
52 |
+
<!-- Conditions Popup -->
|
53 |
+
<?php WPR_Templates_Loop::render_conditions_popup(true); ?>
|
54 |
+
|
55 |
+
<!-- Create Templte Popup -->
|
56 |
+
<?php WPR_Templates_Loop::render_create_template_popup(); ?>
|
57 |
+
|
58 |
+
<!-- Tabs -->
|
59 |
+
<div class="nav-tab-wrapper wpr-nav-tab-wrapper">
|
60 |
+
<a href="?page=wpr-theme-builder&tab=wpr_tab_header" data-title="Header" class="nav-tab <?php echo ($active_tab == 'wpr_tab_header') ? 'nav-tab-active' : ''; ?>">
|
61 |
+
<?php esc_html_e( 'Header', 'wpr-addons' ); ?>
|
62 |
+
</a>
|
63 |
+
<a href="?page=wpr-theme-builder&tab=wpr_tab_footer" data-title="Footer" class="nav-tab <?php echo ($active_tab == 'wpr_tab_footer') ? 'nav-tab-active' : ''; ?>">
|
64 |
+
<?php esc_html_e( 'Footer', 'wpr-addons' ); ?>
|
65 |
+
</a>
|
66 |
+
<a href="?page=wpr-theme-builder&tab=wpr_tab_archive" data-title="Archive" class="nav-tab <?php echo ($active_tab == 'wpr_tab_archive') ? 'nav-tab-active' : ''; ?>">
|
67 |
+
<?php esc_html_e( 'Archive', 'wpr-addons' ); ?>
|
68 |
+
</a>
|
69 |
+
<a href="?page=wpr-theme-builder&tab=wpr_tab_single" data-title="Single" class="nav-tab <?php echo ($active_tab == 'wpr_tab_single') ? 'nav-tab-active' : ''; ?>">
|
70 |
+
<?php esc_html_e( 'Single', 'wpr-addons' ); ?>
|
71 |
+
</a>
|
72 |
+
<a href="?page=wpr-theme-builder&tab=wpr_tab_my_templates" data-title="My Templates" class="nav-tab <?php echo ($active_tab == 'wpr_tab_my_templates') ? 'nav-tab-active' : ''; ?>">
|
73 |
+
<?php esc_html_e( 'Saved Templates', 'wpr-addons' ); ?>
|
74 |
+
</a>
|
75 |
+
|
76 |
+
<a href="?page=wpr-theme-builder&tab=wpr_tab_product_archive" data-title="Product Archive" class="nav-tab <?php echo ($active_tab == 'wpr_tab_product_archive') ? 'nav-tab-active' : ''; ?>">
|
77 |
+
<?php esc_html_e( 'Product Archive', 'wpr-addons' ); ?>
|
78 |
+
</a>
|
79 |
+
<a href="?page=wpr-theme-builder&tab=wpr_tab_product_single" data-title="Product Single" class="nav-tab <?php echo ($active_tab == 'wpr_tab_product_single') ? 'nav-tab-active' : ''; ?>">
|
80 |
+
<?php esc_html_e( 'Product Single', 'wpr-addons' ); ?>
|
81 |
+
</a>
|
82 |
+
</div>
|
83 |
+
|
84 |
+
<?php if ( $active_tab == 'wpr_tab_header' ) : ?>
|
85 |
+
|
86 |
+
<!-- Save Conditions -->
|
87 |
+
<input type="hidden" name="wpr_header_conditions" id="wpr_header_conditions" value="<?php echo esc_attr(get_option('wpr_header_conditions', '[]')); ?>">
|
88 |
+
|
89 |
+
<?php WPR_Templates_Loop::render_theme_builder_templates( 'header' ); ?>
|
90 |
+
|
91 |
+
<?php elseif ( $active_tab == 'wpr_tab_footer' ) : ?>
|
92 |
+
|
93 |
+
<!-- Save Conditions -->
|
94 |
+
<input type="hidden" name="wpr_footer_conditions" id="wpr_footer_conditions" value="<?php echo esc_attr(get_option('wpr_footer_conditions', '[]')); ?>">
|
95 |
+
|
96 |
+
<?php WPR_Templates_Loop::render_theme_builder_templates( 'footer' ); ?>
|
97 |
+
|
98 |
+
<?php elseif ( $active_tab == 'wpr_tab_archive' ) : ?>
|
99 |
+
|
100 |
+
<!-- Save Conditions -->
|
101 |
+
<input type="hidden" name="wpr_archive_conditions" id="wpr_archive_conditions" value="<?php echo esc_attr(get_option('wpr_archive_conditions', '[]')); ?>">
|
102 |
+
|
103 |
+
<?php WPR_Templates_Loop::render_theme_builder_templates( 'archive' ); ?>
|
104 |
+
|
105 |
+
<?php elseif ( $active_tab == 'wpr_tab_single' ) : ?>
|
106 |
+
|
107 |
+
<!-- Save Conditions -->
|
108 |
+
<input type="hidden" name="wpr_single_conditions" id="wpr_single_conditions" value="<?php echo esc_attr(get_option('wpr_single_conditions', '[]')); ?>">
|
109 |
+
|
110 |
+
<?php WPR_Templates_Loop::render_theme_builder_templates( 'single' ); ?>
|
111 |
+
|
112 |
+
<?php elseif ( $active_tab == 'wpr_tab_my_templates' ) : ?>
|
113 |
+
|
114 |
+
<?php Wpr_Templates_Loop::render_elementor_saved_templates(); ?>
|
115 |
+
|
116 |
+
<?php elseif ( $active_tab == 'wpr_tab_product_archive' || $active_tab == 'wpr_tab_product_single' ) : ?>
|
117 |
+
<div class="wpr-coming-soon">
|
118 |
+
<div>
|
119 |
+
<h3>WooCommerce is Comming Soon!</h3>
|
120 |
+
<p><strong>WooCommerce Builder</strong> and <strong>Templates Kit</strong> (Premade Sites) will be available very soon. You will be able to style and modify any part of WooCommerce Pages with the most advanced options available on the market. </p>
|
121 |
+
</div>
|
122 |
+
<img src="<?php echo esc_url(WPR_ADDONS_ASSETS_URL .'img/woo-coming-soon.jpg'); ?>" alt="">
|
123 |
+
</div>
|
124 |
+
<?php endif; ?>
|
125 |
+
|
126 |
+
</form>
|
127 |
+
</div>
|
128 |
+
|
129 |
+
</div>
|
130 |
+
|
131 |
+
|
132 |
+
<?php
|
133 |
+
|
134 |
} // End wpr_addons_theme_builder_page()
|
assets/css/admin/premade-blocks.css
CHANGED
@@ -1,437 +1,437 @@
|
|
1 |
-
#wpcontent {
|
2 |
-
padding: 0;
|
3 |
-
}
|
4 |
-
|
5 |
-
.wpr-settings-page-header {
|
6 |
-
padding: 10px 30px 30px;
|
7 |
-
}
|
8 |
-
|
9 |
-
.wpr-settings-page-header h1 {
|
10 |
-
font-size: 42px;
|
11 |
-
}
|
12 |
-
|
13 |
-
.wpr-settings-page-header p {
|
14 |
-
margin-top: 5px;
|
15 |
-
color: #5a5a5a;
|
16 |
-
font-size: 16px;
|
17 |
-
margin-bottom: 30px;
|
18 |
-
}
|
19 |
-
|
20 |
-
.wpr-premade-blocks-tutorial {
|
21 |
-
display: inline-block;
|
22 |
-
margin-left: 45px;
|
23 |
-
padding: 9px 25px;
|
24 |
-
border: 0;
|
25 |
-
color: #fff;
|
26 |
-
background: #6A4BFF;
|
27 |
-
-webkit-box-shadow: 2px 2px 5px rgb(0 0 0 / 30%);
|
28 |
-
box-shadow: 2px 2px 5px rgb(0 0 0 / 30%);
|
29 |
-
font-size: 14px;
|
30 |
-
text-decoration: none;
|
31 |
-
border-radius: 3px;
|
32 |
-
}
|
33 |
-
|
34 |
-
.wpr-premade-blocks-tutorial:hover,
|
35 |
-
.wpr-premade-blocks-tutorial:focus {
|
36 |
-
color: #fff;
|
37 |
-
background: #5a39fb;
|
38 |
-
}
|
39 |
-
|
40 |
-
.wpr-tplib-content-wrap {
|
41 |
-
}
|
42 |
-
|
43 |
-
.wpr-tplib-sidebar {
|
44 |
-
padding: 30px;
|
45 |
-
display: -webkit-box;
|
46 |
-
display: -ms-flexbox;
|
47 |
-
display: flex;
|
48 |
-
}
|
49 |
-
|
50 |
-
.wpr-tplib-sidebar .wpr-tplib-search {
|
51 |
-
display: none;
|
52 |
-
position: relative;
|
53 |
-
margin: 30px 0;
|
54 |
-
}
|
55 |
-
|
56 |
-
.wpr-tplib-sidebar .wpr-tplib-search i {
|
57 |
-
position: absolute;
|
58 |
-
top: 50%;
|
59 |
-
right: 10px;
|
60 |
-
font-size: 12px;
|
61 |
-
-webkit-transform: translateY(-50%);
|
62 |
-
-ms-transform: translateY(-50%);
|
63 |
-
transform: translateY(-50%);
|
64 |
-
}
|
65 |
-
|
66 |
-
.wpr-tplib-sidebar .wpr-tplib-search input {
|
67 |
-
width: 100%;
|
68 |
-
padding: 8px 10px;
|
69 |
-
border: 0;
|
70 |
-
border-bottom: 1px solid #efefef;
|
71 |
-
}
|
72 |
-
|
73 |
-
.wpr-tplib-sidebar .wpr-tplib-search input::-webkit-input-placeholder {
|
74 |
-
color: #9a9a9a;
|
75 |
-
}
|
76 |
-
|
77 |
-
.wpr-tplib-sidebar .wpr-tplib-search input::-moz-placeholder {
|
78 |
-
color: #9a9a9a;
|
79 |
-
}
|
80 |
-
|
81 |
-
.wpr-tplib-sidebar .wpr-tplib-search input:-ms-input-placeholder {
|
82 |
-
color: #9a9a9a;
|
83 |
-
}
|
84 |
-
|
85 |
-
.wpr-tplib-sidebar .wpr-tplib-search input::-ms-input-placeholder {
|
86 |
-
color: #9a9a9a;
|
87 |
-
}
|
88 |
-
|
89 |
-
.wpr-tplib-sidebar .wpr-tplib-search input::placeholder {
|
90 |
-
color: #9a9a9a;
|
91 |
-
}
|
92 |
-
|
93 |
-
.wpr-tplib-filters-wrap {
|
94 |
-
display: -webkit-box;
|
95 |
-
display: -ms-flexbox;
|
96 |
-
display: flex;
|
97 |
-
}
|
98 |
-
|
99 |
-
.wpr-tplib-sub-filters {
|
100 |
-
display: none;
|
101 |
-
margin-left: 20px;
|
102 |
-
}
|
103 |
-
|
104 |
-
.wpr-tplib-sub-filters ul {
|
105 |
-
display: -webkit-box;
|
106 |
-
display: -ms-flexbox;
|
107 |
-
display: flex;
|
108 |
-
}
|
109 |
-
|
110 |
-
.wpr-tplib-sub-filters ul li {
|
111 |
-
padding: 10px 25px;
|
112 |
-
margin-right: 7px;
|
113 |
-
line-height: 15px;
|
114 |
-
font-size: 13px;
|
115 |
-
font-weight: normal;
|
116 |
-
background: #fff;
|
117 |
-
-webkit-box-shadow: 0 2px 5px 0 rgba(0,0,0,0.05);
|
118 |
-
box-shadow: 0 2px 5px 0 rgba(0,0,0,0.05);
|
119 |
-
cursor: pointer;
|
120 |
-
border-radius: 3px;
|
121 |
-
}
|
122 |
-
|
123 |
-
.wpr-tplib-sub-filters ul li:hover,
|
124 |
-
.wpr-tplib-sub-filters ul .wpr-tplib-activ-filter {
|
125 |
-
background: #6A4BFF;
|
126 |
-
color: #fff;
|
127 |
-
}
|
128 |
-
|
129 |
-
.wpr-tplib-filters {
|
130 |
-
-webkit-box-sizing: border-box;
|
131 |
-
box-sizing: border-box;
|
132 |
-
display: -webkit-box;
|
133 |
-
display: -ms-flexbox;
|
134 |
-
display: flex;
|
135 |
-
-webkit-box-orient: vertical;
|
136 |
-
-webkit-box-direction: normal;
|
137 |
-
-ms-flex-direction: column;
|
138 |
-
flex-direction: column;
|
139 |
-
-webkit-box-align: start;
|
140 |
-
-ms-flex-align: start;
|
141 |
-
align-items: flex-start;
|
142 |
-
position: relative;
|
143 |
-
width: 200px;
|
144 |
-
font-size: 14px;
|
145 |
-
font-weight: normal;
|
146 |
-
font-family: "Roboto",Arial,Helvetica,Verdana,sans-serif;
|
147 |
-
color: #6d7882;
|
148 |
-
}
|
149 |
-
|
150 |
-
.wpr-tplib-filters h3 {
|
151 |
-
display: -webkit-box;
|
152 |
-
display: -ms-flexbox;
|
153 |
-
display: flex;
|
154 |
-
width: 100%;
|
155 |
-
padding: 10px 15px;
|
156 |
-
margin: 0;
|
157 |
-
font-size: 13px;
|
158 |
-
font-weight: normal;
|
159 |
-
font-family: "Roboto",Arial,Helvetica,Verdana,sans-serif;
|
160 |
-
background: #fff;
|
161 |
-
-webkit-box-shadow: 0 2px 5px 0 rgba(0,0,0,0.05);
|
162 |
-
box-shadow: 0 2px 5px 0 rgba(0,0,0,0.05);
|
163 |
-
cursor: pointer;
|
164 |
-
border-radius: 3px;
|
165 |
-
}
|
166 |
-
|
167 |
-
.wpr-tplib-filters h3 span {
|
168 |
-
width: 100%;
|
169 |
-
}
|
170 |
-
|
171 |
-
.wpr-tplib-filters h3 i.fa-angle-down:before {
|
172 |
-
content: "\f347";
|
173 |
-
font-family: dashicons;
|
174 |
-
line-height: 18px;
|
175 |
-
font-weight: 400;
|
176 |
-
font-style: normal;
|
177 |
-
speak: never;
|
178 |
-
text-decoration: inherit;
|
179 |
-
text-transform: none;
|
180 |
-
text-rendering: auto;
|
181 |
-
-webkit-font-smoothing: antialiased;
|
182 |
-
-moz-osx-font-smoothing: grayscale;
|
183 |
-
font-size: 15px;
|
184 |
-
vertical-align: top;
|
185 |
-
text-align: center;
|
186 |
-
}
|
187 |
-
|
188 |
-
.wpr-tplib-filters-list {
|
189 |
-
visibility: hidden;
|
190 |
-
opacity: 0;
|
191 |
-
position: absolute;
|
192 |
-
top: 38px;
|
193 |
-
z-index: 999;
|
194 |
-
width: 700px;
|
195 |
-
padding: 20px 30px;
|
196 |
-
background: #fff;
|
197 |
-
-webkit-box-shadow: 0 2px 5px 0 rgba(0,0,0,0.05);
|
198 |
-
box-shadow: 0 2px 5px 0 rgba(0,0,0,0.05);
|
199 |
-
-webkit-transition: all 0.2s ease-in;
|
200 |
-
-o-transition: all 0.2s ease-in;
|
201 |
-
transition: all 0.2s ease-in;
|
202 |
-
border-radius: 3px;
|
203 |
-
}
|
204 |
-
|
205 |
-
.wpr-tplib-filters-list ul {
|
206 |
-
display: -webkit-box;
|
207 |
-
display: -ms-flexbox;
|
208 |
-
display: flex;
|
209 |
-
-ms-flex-wrap: wrap;
|
210 |
-
flex-wrap: wrap;
|
211 |
-
margin-top: 0;
|
212 |
-
}
|
213 |
-
|
214 |
-
.wpr-tplib-filters-list ul li {
|
215 |
-
-webkit-box-sizing: border-box;
|
216 |
-
box-sizing: border-box;
|
217 |
-
width: 25%;
|
218 |
-
padding: 12px;
|
219 |
-
color: #6d7882;
|
220 |
-
background: #fff;
|
221 |
-
font-size: 13px;
|
222 |
-
line-height: 1;
|
223 |
-
cursor: pointer;
|
224 |
-
}
|
225 |
-
|
226 |
-
.wpr-tplib-filters-list ul li:hover {
|
227 |
-
background: #f9f9f9;
|
228 |
-
color: #222;
|
229 |
-
}
|
230 |
-
|
231 |
-
.wpr-tplib-template-gird {
|
232 |
-
overflow: auto;
|
233 |
-
margin-left: -10px;
|
234 |
-
padding: 0 30px;
|
235 |
-
}
|
236 |
-
|
237 |
-
.elementor-clearfix:after {
|
238 |
-
content: '';
|
239 |
-
display: block;
|
240 |
-
clear: both;
|
241 |
-
width: 0;
|
242 |
-
height: 0;
|
243 |
-
}
|
244 |
-
|
245 |
-
.wpr-tplib-template-wrap {
|
246 |
-
position: relative;
|
247 |
-
float: left;
|
248 |
-
overflow: hidden;
|
249 |
-
width: 18.5%;
|
250 |
-
margin: 10px;
|
251 |
-
border-radius: 3px;
|
252 |
-
-webkit-box-shadow: 0 1px 20px 0 rgba(0,0,0,0.07);
|
253 |
-
box-shadow: 0 1px 20px 0 rgba(0,0,0,0.07);
|
254 |
-
}
|
255 |
-
|
256 |
-
.wpr-tplib-template-wrap:not(.wpr-tplib-pro-active):before {
|
257 |
-
content: 'Free';
|
258 |
-
display: block;
|
259 |
-
position: absolute;
|
260 |
-
top: 10px;
|
261 |
-
right: 10px;
|
262 |
-
z-index: 1;
|
263 |
-
width: 45px;
|
264 |
-
padding: 4px;
|
265 |
-
font-size: 11px;
|
266 |
-
font-weight: bold;
|
267 |
-
letter-spacing: 0.3px;
|
268 |
-
text-transform: uppercase;
|
269 |
-
text-align: center;
|
270 |
-
background: #555;
|
271 |
-
color: #fff;
|
272 |
-
-webkit-box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.3);
|
273 |
-
box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.3);
|
274 |
-
border-radius: 3px;
|
275 |
-
}
|
276 |
-
|
277 |
-
.wpr-tplib-pro-wrap:not(.wpr-tplib-pro-active):before {
|
278 |
-
content: 'Pro';
|
279 |
-
background: #6A4BFF;
|
280 |
-
}
|
281 |
-
|
282 |
-
@media screen and ( max-width: 1364px ) {
|
283 |
-
.wpr-tplib-template-wrap {
|
284 |
-
width: 23%;
|
285 |
-
}
|
286 |
-
}
|
287 |
-
|
288 |
-
.wpr-tplib-template {
|
289 |
-
}
|
290 |
-
|
291 |
-
.wpr-tplib-insert-template:not(.wpr-tplib-insert-pro) {
|
292 |
-
display: none;
|
293 |
-
}
|
294 |
-
|
295 |
-
.wpr-tplib-template-wrap:hover .wpr-tplib-insert-pro {
|
296 |
-
opacity: 1;
|
297 |
-
visibility: visible;
|
298 |
-
}
|
299 |
-
|
300 |
-
.wpr-tplib-template-media {
|
301 |
-
position: relative;
|
302 |
-
background-color: #e8e8e8;
|
303 |
-
}
|
304 |
-
|
305 |
-
.wpr-tplib-template-media img {
|
306 |
-
display: block;
|
307 |
-
width: 100%;
|
308 |
-
max-width: 100%;
|
309 |
-
height: auto;
|
310 |
-
}
|
311 |
-
|
312 |
-
.wpr-tplib-template-media:hover .wpr-tplib-template-media-overlay {
|
313 |
-
opacity: 1;
|
314 |
-
}
|
315 |
-
|
316 |
-
.wpr-tplib-template-media-overlay {
|
317 |
-
opacity: 0;
|
318 |
-
position: absolute;
|
319 |
-
top: 0;
|
320 |
-
left: 0;
|
321 |
-
width: 100%;
|
322 |
-
height: 100%;
|
323 |
-
background-color: rgba(0, 0, 0, 0.5);
|
324 |
-
color: #fff;
|
325 |
-
cursor: pointer;
|
326 |
-
-webkit-transition: opacity 0.1s ease-in;
|
327 |
-
-o-transition: opacity 0.1s ease-in;
|
328 |
-
transition: opacity 0.1s ease-in;
|
329 |
-
}
|
330 |
-
|
331 |
-
.wpr-tplib-template-media-overlay i {
|
332 |
-
position: absolute;
|
333 |
-
top: 50%;
|
334 |
-
left: 50%;
|
335 |
-
-webkit-transform: translate(-50%, -50%);
|
336 |
-
-ms-transform: translate(-50%, -50%);
|
337 |
-
transform: translate(-50%, -50%);
|
338 |
-
font-size: 25px;
|
339 |
-
}
|
340 |
-
|
341 |
-
.wpr-tplib-preview-wrap {
|
342 |
-
display: none;
|
343 |
-
}
|
344 |
-
|
345 |
-
.wpr-tplib-image {
|
346 |
-
display: -webkit-box;
|
347 |
-
display: -ms-flexbox;
|
348 |
-
display: flex;
|
349 |
-
-webkit-box-pack: center;
|
350 |
-
-ms-flex-pack: center;
|
351 |
-
justify-content: center;
|
352 |
-
padding: 20px;
|
353 |
-
}
|
354 |
-
|
355 |
-
.wpr-tplib-iframe {
|
356 |
-
position: relative;
|
357 |
-
padding-top: 56.25%;
|
358 |
-
}
|
359 |
-
|
360 |
-
.wpr-tplib-iframe iframe {
|
361 |
-
position: absolute;
|
362 |
-
top: 0;
|
363 |
-
left: 0;
|
364 |
-
width: 100%;
|
365 |
-
height: 100%;
|
366 |
-
border: none;
|
367 |
-
}
|
368 |
-
|
369 |
-
.wpr-tplib-template-footer {
|
370 |
-
display: -webkit-box;
|
371 |
-
display: -ms-flexbox;
|
372 |
-
display: flex;
|
373 |
-
-webkit-box-orient: vertical;
|
374 |
-
-webkit-box-direction: normal;
|
375 |
-
-ms-flex-flow: column wrap;
|
376 |
-
flex-flow: column wrap;
|
377 |
-
-ms-flex-line-pack: justify;
|
378 |
-
align-content: space-between;
|
379 |
-
-webkit-box-pack: center;
|
380 |
-
-ms-flex-pack: center;
|
381 |
-
justify-content: center;
|
382 |
-
height: 45px;
|
383 |
-
padding: 5px 15px;
|
384 |
-
background-color: #fff;
|
385 |
-
border-top: 1px solid #efefef;
|
386 |
-
}
|
387 |
-
|
388 |
-
.wpr-tplib-template-footer h3 {
|
389 |
-
overflow: hidden;
|
390 |
-
color: #6d7882;
|
391 |
-
font-family: "Roboto",Arial,Helvetica,Verdana,sans-serif;
|
392 |
-
font-size: 13px;
|
393 |
-
font-weight: normal;
|
394 |
-
white-space: nowrap;
|
395 |
-
-o-text-overflow: ellipsis;
|
396 |
-
text-overflow: ellipsis;
|
397 |
-
}
|
398 |
-
|
399 |
-
.wpr-tplib-template-footer .wpr-tplib-insert-template {
|
400 |
-
opacity: 0;
|
401 |
-
visibility: hidden;
|
402 |
-
padding: 6px 10px;
|
403 |
-
color: #fff;
|
404 |
-
background-color: #6A4BFF;
|
405 |
-
font-family: "Roboto",Arial,Helvetica,Verdana,sans-serif;
|
406 |
-
font-size: 13px;
|
407 |
-
line-height: 1;
|
408 |
-
letter-spacing: 0.3px;
|
409 |
-
border-radius: 3px;
|
410 |
-
cursor: pointer;
|
411 |
-
-webkit-transition: all 0.1s ease-in;
|
412 |
-
-o-transition: all 0.1s ease-in;
|
413 |
-
transition: all 0.1s ease-in;
|
414 |
-
}
|
415 |
-
|
416 |
-
|
417 |
-
#masonry-effect {
|
418 |
-
display: -webkit-box;
|
419 |
-
display: -ms-flexbox;
|
420 |
-
display: flex;
|
421 |
-
-webkit-box-orient: horizontal;
|
422 |
-
-webkit-box-direction: normal;
|
423 |
-
-ms-flex-direction: row;
|
424 |
-
flex-direction: row;
|
425 |
-
-ms-flex-wrap: wrap;
|
426 |
-
flex-wrap: wrap;
|
427 |
-
}
|
428 |
-
.item {
|
429 |
-
-webkit-box-sizing: border-box;
|
430 |
-
box-sizing: border-box;
|
431 |
-
-webkit-box-orient: vertical;
|
432 |
-
-webkit-box-direction: normal;
|
433 |
-
-ms-flex-direction: column;
|
434 |
-
flex-direction: column;
|
435 |
-
position: relative;
|
436 |
-
width: calc(33.3%);
|
437 |
}
|
1 |
+
#wpcontent {
|
2 |
+
padding: 0;
|
3 |
+
}
|
4 |
+
|
5 |
+
.wpr-settings-page-header {
|
6 |
+
padding: 10px 30px 30px;
|
7 |
+
}
|
8 |
+
|
9 |
+
.wpr-settings-page-header h1 {
|
10 |
+
font-size: 42px;
|
11 |
+
}
|
12 |
+
|
13 |
+
.wpr-settings-page-header p {
|
14 |
+
margin-top: 5px;
|
15 |
+
color: #5a5a5a;
|
16 |
+
font-size: 16px;
|
17 |
+
margin-bottom: 30px;
|
18 |
+
}
|
19 |
+
|
20 |
+
.wpr-premade-blocks-tutorial {
|
21 |
+
display: inline-block;
|
22 |
+
margin-left: 45px;
|
23 |
+
padding: 9px 25px;
|
24 |
+
border: 0;
|
25 |
+
color: #fff;
|
26 |
+
background: #6A4BFF;
|
27 |
+
-webkit-box-shadow: 2px 2px 5px rgb(0 0 0 / 30%);
|
28 |
+
box-shadow: 2px 2px 5px rgb(0 0 0 / 30%);
|
29 |
+
font-size: 14px;
|
30 |
+
text-decoration: none;
|
31 |
+
border-radius: 3px;
|
32 |
+
}
|
33 |
+
|
34 |
+
.wpr-premade-blocks-tutorial:hover,
|
35 |
+
.wpr-premade-blocks-tutorial:focus {
|
36 |
+
color: #fff;
|
37 |
+
background: #5a39fb;
|
38 |
+
}
|
39 |
+
|
40 |
+
.wpr-tplib-content-wrap {
|
41 |
+
}
|
42 |
+
|
43 |
+
.wpr-tplib-sidebar {
|
44 |
+
padding: 30px;
|
45 |
+
display: -webkit-box;
|
46 |
+
display: -ms-flexbox;
|
47 |
+
display: flex;
|
48 |
+
}
|
49 |
+
|
50 |
+
.wpr-tplib-sidebar .wpr-tplib-search {
|
51 |
+
display: none;
|
52 |
+
position: relative;
|
53 |
+
margin: 30px 0;
|
54 |
+
}
|
55 |
+
|
56 |
+
.wpr-tplib-sidebar .wpr-tplib-search i {
|
57 |
+
position: absolute;
|
58 |
+
top: 50%;
|
59 |
+
right: 10px;
|
60 |
+
font-size: 12px;
|
61 |
+
-webkit-transform: translateY(-50%);
|
62 |
+
-ms-transform: translateY(-50%);
|
63 |
+
transform: translateY(-50%);
|
64 |
+
}
|
65 |
+
|
66 |
+
.wpr-tplib-sidebar .wpr-tplib-search input {
|
67 |
+
width: 100%;
|
68 |
+
padding: 8px 10px;
|
69 |
+
border: 0;
|
70 |
+
border-bottom: 1px solid #efefef;
|
71 |
+
}
|
72 |
+
|
73 |
+
.wpr-tplib-sidebar .wpr-tplib-search input::-webkit-input-placeholder {
|
74 |
+
color: #9a9a9a;
|
75 |
+
}
|
76 |
+
|
77 |
+
.wpr-tplib-sidebar .wpr-tplib-search input::-moz-placeholder {
|
78 |
+
color: #9a9a9a;
|
79 |
+
}
|
80 |
+
|
81 |
+
.wpr-tplib-sidebar .wpr-tplib-search input:-ms-input-placeholder {
|
82 |
+
color: #9a9a9a;
|
83 |
+
}
|
84 |
+
|
85 |
+
.wpr-tplib-sidebar .wpr-tplib-search input::-ms-input-placeholder {
|
86 |
+
color: #9a9a9a;
|
87 |
+
}
|
88 |
+
|
89 |
+
.wpr-tplib-sidebar .wpr-tplib-search input::placeholder {
|
90 |
+
color: #9a9a9a;
|
91 |
+
}
|
92 |
+
|
93 |
+
.wpr-tplib-filters-wrap {
|
94 |
+
display: -webkit-box;
|
95 |
+
display: -ms-flexbox;
|
96 |
+
display: flex;
|
97 |
+
}
|
98 |
+
|
99 |
+
.wpr-tplib-sub-filters {
|
100 |
+
display: none;
|
101 |
+
margin-left: 20px;
|
102 |
+
}
|
103 |
+
|
104 |
+
.wpr-tplib-sub-filters ul {
|
105 |
+
display: -webkit-box;
|
106 |
+
display: -ms-flexbox;
|
107 |
+
display: flex;
|
108 |
+
}
|
109 |
+
|
110 |
+
.wpr-tplib-sub-filters ul li {
|
111 |
+
padding: 10px 25px;
|
112 |
+
margin-right: 7px;
|
113 |
+
line-height: 15px;
|
114 |
+
font-size: 13px;
|
115 |
+
font-weight: normal;
|
116 |
+
background: #fff;
|
117 |
+
-webkit-box-shadow: 0 2px 5px 0 rgba(0,0,0,0.05);
|
118 |
+
box-shadow: 0 2px 5px 0 rgba(0,0,0,0.05);
|
119 |
+
cursor: pointer;
|
120 |
+
border-radius: 3px;
|
121 |
+
}
|
122 |
+
|
123 |
+
.wpr-tplib-sub-filters ul li:hover,
|
124 |
+
.wpr-tplib-sub-filters ul .wpr-tplib-activ-filter {
|
125 |
+
background: #6A4BFF;
|
126 |
+
color: #fff;
|
127 |
+
}
|
128 |
+
|
129 |
+
.wpr-tplib-filters {
|
130 |
+
-webkit-box-sizing: border-box;
|
131 |
+
box-sizing: border-box;
|
132 |
+
display: -webkit-box;
|
133 |
+
display: -ms-flexbox;
|
134 |
+
display: flex;
|
135 |
+
-webkit-box-orient: vertical;
|
136 |
+
-webkit-box-direction: normal;
|
137 |
+
-ms-flex-direction: column;
|
138 |
+
flex-direction: column;
|
139 |
+
-webkit-box-align: start;
|
140 |
+
-ms-flex-align: start;
|
141 |
+
align-items: flex-start;
|
142 |
+
position: relative;
|
143 |
+
width: 200px;
|
144 |
+
font-size: 14px;
|
145 |
+
font-weight: normal;
|
146 |
+
font-family: "Roboto",Arial,Helvetica,Verdana,sans-serif;
|
147 |
+
color: #6d7882;
|
148 |
+
}
|
149 |
+
|
150 |
+
.wpr-tplib-filters h3 {
|
151 |
+
display: -webkit-box;
|
152 |
+
display: -ms-flexbox;
|
153 |
+
display: flex;
|
154 |
+
width: 100%;
|
155 |
+
padding: 10px 15px;
|
156 |
+
margin: 0;
|
157 |
+
font-size: 13px;
|
158 |
+
font-weight: normal;
|
159 |
+
font-family: "Roboto",Arial,Helvetica,Verdana,sans-serif;
|
160 |
+
background: #fff;
|
161 |
+
-webkit-box-shadow: 0 2px 5px 0 rgba(0,0,0,0.05);
|
162 |
+
box-shadow: 0 2px 5px 0 rgba(0,0,0,0.05);
|
163 |
+
cursor: pointer;
|
164 |
+
border-radius: 3px;
|
165 |
+
}
|
166 |
+
|
167 |
+
.wpr-tplib-filters h3 span {
|
168 |
+
width: 100%;
|
169 |
+
}
|
170 |
+
|
171 |
+
.wpr-tplib-filters h3 i.fa-angle-down:before {
|
172 |
+
content: "\f347";
|
173 |
+
font-family: dashicons;
|
174 |
+
line-height: 18px;
|
175 |
+
font-weight: 400;
|
176 |
+
font-style: normal;
|
177 |
+
speak: never;
|
178 |
+
text-decoration: inherit;
|
179 |
+
text-transform: none;
|
180 |
+
text-rendering: auto;
|
181 |
+
-webkit-font-smoothing: antialiased;
|
182 |
+
-moz-osx-font-smoothing: grayscale;
|
183 |
+
font-size: 15px;
|
184 |
+
vertical-align: top;
|
185 |
+
text-align: center;
|
186 |
+
}
|
187 |
+
|
188 |
+
.wpr-tplib-filters-list {
|
189 |
+
visibility: hidden;
|
190 |
+
opacity: 0;
|
191 |
+
position: absolute;
|
192 |
+
top: 38px;
|
193 |
+
z-index: 999;
|
194 |
+
width: 700px;
|
195 |
+
padding: 20px 30px;
|
196 |
+
background: #fff;
|
197 |
+
-webkit-box-shadow: 0 2px 5px 0 rgba(0,0,0,0.05);
|
198 |
+
box-shadow: 0 2px 5px 0 rgba(0,0,0,0.05);
|
199 |
+
-webkit-transition: all 0.2s ease-in;
|
200 |
+
-o-transition: all 0.2s ease-in;
|
201 |
+
transition: all 0.2s ease-in;
|
202 |
+
border-radius: 3px;
|
203 |
+
}
|
204 |
+
|
205 |
+
.wpr-tplib-filters-list ul {
|
206 |
+
display: -webkit-box;
|
207 |
+
display: -ms-flexbox;
|
208 |
+
display: flex;
|
209 |
+
-ms-flex-wrap: wrap;
|
210 |
+
flex-wrap: wrap;
|
211 |
+
margin-top: 0;
|
212 |
+
}
|
213 |
+
|
214 |
+
.wpr-tplib-filters-list ul li {
|
215 |
+
-webkit-box-sizing: border-box;
|
216 |
+
box-sizing: border-box;
|
217 |
+
width: 25%;
|
218 |
+
padding: 12px;
|
219 |
+
color: #6d7882;
|
220 |
+
background: #fff;
|
221 |
+
font-size: 13px;
|
222 |
+
line-height: 1;
|
223 |
+
cursor: pointer;
|
224 |
+
}
|
225 |
+
|
226 |
+
.wpr-tplib-filters-list ul li:hover {
|
227 |
+
background: #f9f9f9;
|
228 |
+
color: #222;
|
229 |
+
}
|
230 |
+
|
231 |
+
.wpr-tplib-template-gird {
|
232 |
+
overflow: auto;
|
233 |
+
margin-left: -10px;
|
234 |
+
padding: 0 30px;
|
235 |
+
}
|
236 |
+
|
237 |
+
.elementor-clearfix:after {
|
238 |
+
content: '';
|
239 |
+
display: block;
|
240 |
+
clear: both;
|
241 |
+
width: 0;
|
242 |
+
height: 0;
|
243 |
+
}
|
244 |
+
|
245 |
+
.wpr-tplib-template-wrap {
|
246 |
+
position: relative;
|
247 |
+
float: left;
|
248 |
+
overflow: hidden;
|
249 |
+
width: 18.5%;
|
250 |
+
margin: 10px;
|
251 |
+
border-radius: 3px;
|
252 |
+
-webkit-box-shadow: 0 1px 20px 0 rgba(0,0,0,0.07);
|
253 |
+
box-shadow: 0 1px 20px 0 rgba(0,0,0,0.07);
|
254 |
+
}
|
255 |
+
|
256 |
+
.wpr-tplib-template-wrap:not(.wpr-tplib-pro-active):before {
|
257 |
+
content: 'Free';
|
258 |
+
display: block;
|
259 |
+
position: absolute;
|
260 |
+
top: 10px;
|
261 |
+
right: 10px;
|
262 |
+
z-index: 1;
|
263 |
+
width: 45px;
|
264 |
+
padding: 4px;
|
265 |
+
font-size: 11px;
|
266 |
+
font-weight: bold;
|
267 |
+
letter-spacing: 0.3px;
|
268 |
+
text-transform: uppercase;
|
269 |
+
text-align: center;
|
270 |
+
background: #555;
|
271 |
+
color: #fff;
|
272 |
+
-webkit-box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.3);
|
273 |
+
box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.3);
|
274 |
+
border-radius: 3px;
|
275 |
+
}
|
276 |
+
|
277 |
+
.wpr-tplib-pro-wrap:not(.wpr-tplib-pro-active):before {
|
278 |
+
content: 'Pro';
|
279 |
+
background: #6A4BFF;
|
280 |
+
}
|
281 |
+
|
282 |
+
@media screen and ( max-width: 1364px ) {
|
283 |
+
.wpr-tplib-template-wrap {
|
284 |
+
width: 23%;
|
285 |
+
}
|
286 |
+
}
|
287 |
+
|
288 |
+
.wpr-tplib-template {
|
289 |
+
}
|
290 |
+
|
291 |
+
.wpr-tplib-insert-template:not(.wpr-tplib-insert-pro) {
|
292 |
+
display: none;
|
293 |
+
}
|
294 |
+
|
295 |
+
.wpr-tplib-template-wrap:hover .wpr-tplib-insert-pro {
|
296 |
+
opacity: 1;
|
297 |
+
visibility: visible;
|
298 |
+
}
|
299 |
+
|
300 |
+
.wpr-tplib-template-media {
|
301 |
+
position: relative;
|
302 |
+
background-color: #e8e8e8;
|
303 |
+
}
|
304 |
+
|
305 |
+
.wpr-tplib-template-media img {
|
306 |
+
display: block;
|
307 |
+
width: 100%;
|
308 |
+
max-width: 100%;
|
309 |
+
height: auto;
|
310 |
+
}
|
311 |
+
|
312 |
+
.wpr-tplib-template-media:hover .wpr-tplib-template-media-overlay {
|
313 |
+
opacity: 1;
|
314 |
+
}
|
315 |
+
|
316 |
+
.wpr-tplib-template-media-overlay {
|
317 |
+
opacity: 0;
|
318 |
+
position: absolute;
|
319 |
+
top: 0;
|
320 |
+
left: 0;
|
321 |
+
width: 100%;
|
322 |
+
height: 100%;
|
323 |
+
background-color: rgba(0, 0, 0, 0.5);
|
324 |
+
color: #fff;
|
325 |
+
cursor: pointer;
|
326 |
+
-webkit-transition: opacity 0.1s ease-in;
|
327 |
+
-o-transition: opacity 0.1s ease-in;
|
328 |
+
transition: opacity 0.1s ease-in;
|
329 |
+
}
|
330 |
+
|
331 |
+
.wpr-tplib-template-media-overlay i {
|
332 |
+
position: absolute;
|
333 |
+
top: 50%;
|
334 |
+
left: 50%;
|
335 |
+
-webkit-transform: translate(-50%, -50%);
|
336 |
+
-ms-transform: translate(-50%, -50%);
|
337 |
+
transform: translate(-50%, -50%);
|
338 |
+
font-size: 25px;
|
339 |
+
}
|
340 |
+
|
341 |
+
.wpr-tplib-preview-wrap {
|
342 |
+
display: none;
|
343 |
+
}
|
344 |
+
|
345 |
+
.wpr-tplib-image {
|
346 |
+
display: -webkit-box;
|
347 |
+
display: -ms-flexbox;
|
348 |
+
display: flex;
|
349 |
+
-webkit-box-pack: center;
|
350 |
+
-ms-flex-pack: center;
|
351 |
+
justify-content: center;
|
352 |
+
padding: 20px;
|
353 |
+
}
|
354 |
+
|
355 |
+
.wpr-tplib-iframe {
|
356 |
+
position: relative;
|
357 |
+
padding-top: 56.25%;
|
358 |
+
}
|
359 |
+
|
360 |
+
.wpr-tplib-iframe iframe {
|
361 |
+
position: absolute;
|
362 |
+
top: 0;
|
363 |
+
left: 0;
|
364 |
+
width: 100%;
|
365 |
+
height: 100%;
|
366 |
+
border: none;
|
367 |
+
}
|
368 |
+
|
369 |
+
.wpr-tplib-template-footer {
|
370 |
+
display: -webkit-box;
|
371 |
+
display: -ms-flexbox;
|
372 |
+
display: flex;
|
373 |
+
-webkit-box-orient: vertical;
|
374 |
+
-webkit-box-direction: normal;
|
375 |
+
-ms-flex-flow: column wrap;
|
376 |
+
flex-flow: column wrap;
|
377 |
+
-ms-flex-line-pack: justify;
|
378 |
+
align-content: space-between;
|
379 |
+
-webkit-box-pack: center;
|
380 |
+
-ms-flex-pack: center;
|
381 |
+
justify-content: center;
|
382 |
+
height: 45px;
|
383 |
+
padding: 5px 15px;
|
384 |
+
background-color: #fff;
|
385 |
+
border-top: 1px solid #efefef;
|
386 |
+
}
|
387 |
+
|
388 |
+
.wpr-tplib-template-footer h3 {
|
389 |
+
overflow: hidden;
|
390 |
+
color: #6d7882;
|
391 |
+
font-family: "Roboto",Arial,Helvetica,Verdana,sans-serif;
|
392 |
+
font-size: 13px;
|
393 |
+
font-weight: normal;
|
394 |
+
white-space: nowrap;
|
395 |
+
-o-text-overflow: ellipsis;
|
396 |
+
text-overflow: ellipsis;
|
397 |
+
}
|
398 |
+
|
399 |
+
.wpr-tplib-template-footer .wpr-tplib-insert-template {
|
400 |
+
opacity: 0;
|
401 |
+
visibility: hidden;
|
402 |
+
padding: 6px 10px;
|
403 |
+
color: #fff;
|
404 |
+
background-color: #6A4BFF;
|
405 |
+
font-family: "Roboto",Arial,Helvetica,Verdana,sans-serif;
|
406 |
+
font-size: 13px;
|
407 |
+
line-height: 1;
|
408 |
+
letter-spacing: 0.3px;
|
409 |
+
border-radius: 3px;
|
410 |
+
cursor: pointer;
|
411 |
+
-webkit-transition: all 0.1s ease-in;
|
412 |
+
-o-transition: all 0.1s ease-in;
|
413 |
+
transition: all 0.1s ease-in;
|
414 |
+
}
|
415 |
+
|
416 |
+
|
417 |
+
#masonry-effect {
|
418 |
+
display: -webkit-box;
|
419 |
+
display: -ms-flexbox;
|
420 |
+
display: flex;
|
421 |
+
-webkit-box-orient: horizontal;
|
422 |
+
-webkit-box-direction: normal;
|
423 |
+
-ms-flex-direction: row;
|
424 |
+
flex-direction: row;
|
425 |
+
-ms-flex-wrap: wrap;
|
426 |
+
flex-wrap: wrap;
|
427 |
+
}
|
428 |
+
.item {
|
429 |
+
-webkit-box-sizing: border-box;
|
430 |
+
box-sizing: border-box;
|
431 |
+
-webkit-box-orient: vertical;
|
432 |
+
-webkit-box-direction: normal;
|
433 |
+
-ms-flex-direction: column;
|
434 |
+
flex-direction: column;
|
435 |
+
position: relative;
|
436 |
+
width: calc(33.3%);
|
437 |
}
|
assets/css/editor.min.css
CHANGED
@@ -107,6 +107,7 @@
|
|
107 |
.elementor-control-archive_link_transition_duration,
|
108 |
.elementor-control-post_info_tax_select,
|
109 |
.elementor-control-post_info_link_wrap,
|
|
|
110 |
.elementor-control-tabs_sharing_custom_colors,
|
111 |
.elementor-control-post_info_show_avatar,
|
112 |
.elementor-control-post_info_cf,
|
107 |
.elementor-control-archive_link_transition_duration,
|
108 |
.elementor-control-post_info_tax_select,
|
109 |
.elementor-control-post_info_link_wrap,
|
110 |
+
.elementor-control-post_info_modified_time,
|
111 |
.elementor-control-tabs_sharing_custom_colors,
|
112 |
.elementor-control-post_info_show_avatar,
|
113 |
.elementor-control-post_info_cf,
|
assets/css/lib/animations/button-animations.css
CHANGED
@@ -1,1629 +1,1629 @@
|
|
1 |
-
/*!
|
2 |
-
* Hover.css (http://ianlunn.github.io/Hover/)
|
3 |
-
* Version: 2.3.2
|
4 |
-
* Author: Ian Lunn @IanLunn
|
5 |
-
* Author URL: http://ianlunn.co.uk/
|
6 |
-
* Github: https://github.com/IanLunn/Hover
|
7 |
-
|
8 |
-
* Hover.css Copyright Ian Lunn 2017. Generated with Sass.
|
9 |
-
*/
|
10 |
-
|
11 |
-
|
12 |
-
/* 2D TRANSITIONS */
|
13 |
-
/* Forward */
|
14 |
-
.elementor-animation-forward {
|
15 |
-
display: inline-block;
|
16 |
-
vertical-align: middle;
|
17 |
-
-webkit-transform: perspective(1px) translateZ(0);
|
18 |
-
transform: perspective(1px) translateZ(0);
|
19 |
-
-webkit-transition-duration: 0.3s;
|
20 |
-
-o-transition-duration: 0.3s;
|
21 |
-
transition-duration: 0.3s;
|
22 |
-
-webkit-transition-property: transform;
|
23 |
-
-webkit-transition-property: -webkit-transform;
|
24 |
-
transition-property: -webkit-transform;
|
25 |
-
-o-transition-property: transform;
|
26 |
-
transition-property: transform;
|
27 |
-
transition-property: transform, -webkit-transform;
|
28 |
-
}
|
29 |
-
.elementor-animation-forward:hover, .elementor-animation-forward:focus, .elementor-animation-forward:active {
|
30 |
-
-webkit-transform: translateX(8px);
|
31 |
-
-ms-transform: translateX(8px);
|
32 |
-
transform: translateX(8px);
|
33 |
-
}
|
34 |
-
|
35 |
-
/* Backward */
|
36 |
-
.elementor-animation-backward {
|
37 |
-
display: inline-block;
|
38 |
-
vertical-align: middle;
|
39 |
-
-webkit-transform: perspective(1px) translateZ(0);
|
40 |
-
transform: perspective(1px) translateZ(0);
|
41 |
-
-webkit-transition-duration: 0.3s;
|
42 |
-
-o-transition-duration: 0.3s;
|
43 |
-
transition-duration: 0.3s;
|
44 |
-
-webkit-transition-property: transform;
|
45 |
-
-webkit-transition-property: -webkit-transform;
|
46 |
-
transition-property: -webkit-transform;
|
47 |
-
-o-transition-property: transform;
|
48 |
-
transition-property: transform;
|
49 |
-
transition-property: transform, -webkit-transform;
|
50 |
-
}
|
51 |
-
.elementor-animation-backward:hover, .elementor-animation-backward:focus, .elementor-animation-backward:active {
|
52 |
-
-webkit-transform: translateX(-8px);
|
53 |
-
-ms-transform: translateX(-8px);
|
54 |
-
transform: translateX(-8px);
|
55 |
-
}
|
56 |
-
|
57 |
-
/* BACKGROUND TRANSITIONS */
|
58 |
-
/* Back Pulse */
|
59 |
-
@-webkit-keyframes wpr-button-back-pulse {
|
60 |
-
50% {
|
61 |
-
opacity: 0.5;
|
62 |
-
}
|
63 |
-
}
|
64 |
-
@keyframes wpr-button-back-pulse {
|
65 |
-
50% {
|
66 |
-
opacity: 0.5;
|
67 |
-
}
|
68 |
-
}
|
69 |
-
|
70 |
-
.wpr-button-back-pulse:before {
|
71 |
-
content: "";
|
72 |
-
width: 100%;
|
73 |
-
height: 100%;
|
74 |
-
position: absolute;
|
75 |
-
top: 0;
|
76 |
-
left: 0;
|
77 |
-
opacity: 0;
|
78 |
-
z-index: -1;
|
79 |
-
}
|
80 |
-
|
81 |
-
.wpr-button-back-pulse:hover:before {
|
82 |
-
opacity: 1;
|
83 |
-
-webkit-animation-name: wpr-button-back-pulse;
|
84 |
-
animation-name: wpr-button-back-pulse;
|
85 |
-
-webkit-animation-duration: 1s;
|
86 |
-
animation-duration: 1s;
|
87 |
-
-webkit-animation-delay: 0.5s;
|
88 |
-
animation-delay: 0.5s;
|
89 |
-
-webkit-animation-timing-function: linear;
|
90 |
-
animation-timing-function: linear;
|
91 |
-
-webkit-animation-iteration-count: infinite;
|
92 |
-
animation-iteration-count: infinite;
|
93 |
-
}
|
94 |
-
|
95 |
-
/* Sweep To Right */
|
96 |
-
.wpr-button-sweep-to-right {
|
97 |
-
display: inline-block;
|
98 |
-
vertical-align: middle;
|
99 |
-
-webkit-transform: perspective(1px) translateZ(0);
|
100 |
-
transform: perspective(1px) translateZ(0);
|
101 |
-
position: relative;
|
102 |
-
-webkit-transition-property: color;
|
103 |
-
-o-transition-property: color;
|
104 |
-
transition-property: color;
|
105 |
-
-webkit-transition-duration: 0.3s;
|
106 |
-
-o-transition-duration: 0.3s;
|
107 |
-
transition-duration: 0.3s;
|
108 |
-
}
|
109 |
-
.wpr-button-sweep-to-right:before {
|
110 |
-
content: "";
|
111 |
-
position: absolute;
|
112 |
-
z-index: -1;
|
113 |
-
top: 0;
|
114 |
-
left: 0;
|
115 |
-
right: 0;
|
116 |
-
bottom: 0;
|
117 |
-
-webkit-transform: scaleX(0);
|
118 |
-
-ms-transform: scaleX(0);
|
119 |
-
transform: scaleX(0);
|
120 |
-
-webkit-transform-origin: 0 50%;
|
121 |
-
-ms-transform-origin: 0 50%;
|
122 |
-
transform-origin: 0 50%;
|
123 |
-
-webkit-transition-property: transform;
|
124 |
-
-webkit-transition-property: -webkit-transform;
|
125 |
-
transition-property: -webkit-transform;
|
126 |
-
-o-transition-property: transform;
|
127 |
-
transition-property: transform;
|
128 |
-
transition-property: transform, -webkit-transform;
|
129 |
-
-webkit-transition-duration: 0.3s;
|
130 |
-
-o-transition-duration: 0.3s;
|
131 |
-
transition-duration: 0.3s;
|
132 |
-
-webkit-transition-timing-function: ease-out;
|
133 |
-
-o-transition-timing-function: ease-out;
|
134 |
-
transition-timing-function: ease-out;
|
135 |
-
}
|
136 |
-
.wpr-button-sweep-to-right:hover:before, .wpr-button-sweep-to-right:focus:before, .wpr-button-sweep-to-right:active:before {
|
137 |
-
-webkit-transform: scaleX(1);
|
138 |
-
-ms-transform: scaleX(1);
|
139 |
-
transform: scaleX(1);
|
140 |
-
}
|
141 |
-
|
142 |
-
/* Sweep To Left */
|
143 |
-
.wpr-button-sweep-to-left {
|
144 |
-
display: inline-block;
|
145 |
-
vertical-align: middle;
|
146 |
-
-webkit-transform: perspective(1px) translateZ(0);
|
147 |
-
transform: perspective(1px) translateZ(0);
|
148 |
-
position: relative;
|
149 |
-
-webkit-transition-property: color;
|
150 |
-
-o-transition-property: color;
|
151 |
-
transition-property: color;
|
152 |
-
-webkit-transition-duration: 0.3s;
|
153 |
-
-o-transition-duration: 0.3s;
|
154 |
-
transition-duration: 0.3s;
|
155 |
-
}
|
156 |
-
.wpr-button-sweep-to-left:before {
|
157 |
-
content: "";
|
158 |
-
position: absolute;
|
159 |
-
z-index: -1;
|
160 |
-
top: 0;
|
161 |
-
left: 0;
|
162 |
-
right: 0;
|
163 |
-
bottom: 0;
|
164 |
-
-webkit-transform: scaleX(0);
|
165 |
-
-ms-transform: scaleX(0);
|
166 |
-
transform: scaleX(0);
|
167 |
-
-webkit-transform-origin: 100% 50%;
|
168 |
-
-ms-transform-origin: 100% 50%;
|
169 |
-
transform-origin: 100% 50%;
|
170 |
-
-webkit-transition-property: transform;
|
171 |
-
-webkit-transition-property: -webkit-transform;
|
172 |
-
transition-property: -webkit-transform;
|
173 |
-
-o-transition-property: transform;
|
174 |
-
transition-property: transform;
|
175 |
-
transition-property: transform, -webkit-transform;
|
176 |
-
-webkit-transition-duration: 0.3s;
|
177 |
-
-o-transition-duration: 0.3s;
|
178 |
-
transition-duration: 0.3s;
|
179 |
-
-webkit-transition-timing-function: ease-out;
|
180 |
-
-o-transition-timing-function: ease-out;
|
181 |
-
transition-timing-function: ease-out;
|
182 |
-
}
|
183 |
-
.wpr-button-sweep-to-left:hover:before, .wpr-button-sweep-to-left:focus:before, .wpr-button-sweep-to-left:active:before {
|
184 |
-
-webkit-transform: scaleX(1);
|
185 |
-
-ms-transform: scaleX(1);
|
186 |
-
transform: scaleX(1);
|
187 |
-
}
|
188 |
-
|
189 |
-
/* Sweep To Bottom */
|
190 |
-
.wpr-button-sweep-to-bottom {
|
191 |
-
display: inline-block;
|
192 |
-
vertical-align: middle;
|
193 |
-
-webkit-transform: perspective(1px) translateZ(0);
|
194 |
-
transform: perspective(1px) translateZ(0);
|
195 |
-
position: relative;
|
196 |
-
-webkit-transition-property: color;
|
197 |
-
-o-transition-property: color;
|
198 |
-
transition-property: color;
|
199 |
-
-webkit-transition-duration: 0.3s;
|
200 |
-
-o-transition-duration: 0.3s;
|
201 |
-
transition-duration: 0.3s;
|
202 |
-
}
|
203 |
-
.wpr-button-sweep-to-bottom:before {
|
204 |
-
content: "";
|
205 |
-
position: absolute;
|
206 |
-
z-index: -1;
|
207 |
-
top: 0;
|
208 |
-
left: 0;
|
209 |
-
right: 0;
|
210 |
-
bottom: 0;
|
211 |
-
-webkit-transform: scaleY(0);
|
212 |
-
-ms-transform: scaleY(0);
|
213 |
-
transform: scaleY(0);
|
214 |
-
-webkit-transform-origin: 50% 0;
|
215 |
-
-ms-transform-origin: 50% 0;
|
216 |
-
transform-origin: 50% 0;
|
217 |
-
-webkit-transition-property: transform;
|
218 |
-
-webkit-transition-property: -webkit-transform;
|
219 |
-
transition-property: -webkit-transform;
|
220 |
-
-o-transition-property: transform;
|
221 |
-
transition-property: transform;
|
222 |
-
transition-property: transform, -webkit-transform;
|
223 |
-
-webkit-transition-duration: 0.3s;
|
224 |
-
-o-transition-duration: 0.3s;
|
225 |
-
transition-duration: 0.3s;
|
226 |
-
-webkit-transition-timing-function: ease-out;
|
227 |
-
-o-transition-timing-function: ease-out;
|
228 |
-
transition-timing-function: ease-out;
|
229 |
-
}
|
230 |
-
.wpr-button-sweep-to-bottom:hover:before, .wpr-button-sweep-to-bottom:focus:before, .wpr-button-sweep-to-bottom:active:before {
|
231 |
-
-webkit-transform: scaleY(1);
|
232 |
-
-ms-transform: scaleY(1);
|
233 |
-
transform: scaleY(1);
|
234 |
-
}
|
235 |
-
|
236 |
-
/* Sweep To Top */
|
237 |
-
.wpr-button-sweep-to-top {
|
238 |
-
display: inline-block;
|
239 |
-
vertical-align: middle;
|
240 |
-
-webkit-transform: perspective(1px) translateZ(0);
|
241 |
-
transform: perspective(1px) translateZ(0);
|
242 |
-
position: relative;
|
243 |
-
-webkit-transition-property: color;
|
244 |
-
-o-transition-property: color;
|
245 |
-
transition-property: color;
|
246 |
-
-webkit-transition-duration: 0.3s;
|
247 |
-
-o-transition-duration: 0.3s;
|
248 |
-
transition-duration: 0.3s;
|
249 |
-
}
|
250 |
-
.wpr-button-sweep-to-top:before {
|
251 |
-
content: "";
|
252 |
-
position: absolute;
|
253 |
-
z-index: -1;
|
254 |
-
top: 0;
|
255 |
-
left: 0;
|
256 |
-
right: 0;
|
257 |
-
bottom: 0;
|
258 |
-
-webkit-transform: scaleY(0);
|
259 |
-
-ms-transform: scaleY(0);
|
260 |
-
transform: scaleY(0);
|
261 |
-
-webkit-transform-origin: 50% 100%;
|
262 |
-
-ms-transform-origin: 50% 100%;
|
263 |
-
transform-origin: 50% 100%;
|
264 |
-
-webkit-transition-property: transform;
|
265 |
-
-webkit-transition-property: -webkit-transform;
|
266 |
-
transition-property: -webkit-transform;
|
267 |
-
-o-transition-property: transform;
|
268 |
-
transition-property: transform;
|
269 |
-
transition-property: transform, -webkit-transform;
|
270 |
-
-webkit-transition-duration: 0.3s;
|
271 |
-
-o-transition-duration: 0.3s;
|
272 |
-
transition-duration: 0.3s;
|
273 |
-
-webkit-transition-timing-function: ease-out;
|
274 |
-
-o-transition-timing-function: ease-out;
|
275 |
-
transition-timing-function: ease-out;
|
276 |
-
}
|
277 |
-
.wpr-button-sweep-to-top:hover:before, .wpr-button-sweep-to-top:focus:before, .wpr-button-sweep-to-top:active:before {
|
278 |
-
-webkit-transform: scaleY(1);
|
279 |
-
-ms-transform: scaleY(1);
|
280 |
-
transform: scaleY(1);
|
281 |
-
}
|
282 |
-
|
283 |
-
/* Bounce To Right */
|
284 |
-
.wpr-button-bounce-to-right {
|
285 |
-
display: inline-block;
|
286 |
-
vertical-align: middle;
|
287 |
-
-webkit-transform: perspective(1px) translateZ(0);
|
288 |
-
transform: perspective(1px) translateZ(0);
|
289 |
-
position: relative;
|
290 |
-
-webkit-transition-property: color;
|
291 |
-
-o-transition-property: color;
|
292 |
-
transition-property: color;
|
293 |
-
-webkit-transition-duration: 0.5s;
|
294 |
-
-o-transition-duration: 0.5s;
|
295 |
-
transition-duration: 0.5s;
|
296 |
-
}
|
297 |
-
.wpr-button-bounce-to-right:before {
|
298 |
-
content: "";
|
299 |
-
position: absolute;
|
300 |
-
z-index: -1;
|
301 |
-
top: 0;
|
302 |
-
left: 0;
|
303 |
-
right: 0;
|
304 |
-
bottom: 0;
|
305 |
-
-webkit-transform: scaleX(0);
|
306 |
-
-ms-transform: scaleX(0);
|
307 |
-
transform: scaleX(0);
|
308 |
-
-webkit-transform-origin: 0 50%;
|
309 |
-
-ms-transform-origin: 0 50%;
|
310 |
-
transform-origin: 0 50%;
|
311 |
-
-webkit-transition-property: transform;
|
312 |
-
-webkit-transition-property: -webkit-transform;
|
313 |
-
transition-property: -webkit-transform;
|
314 |
-
-o-transition-property: transform;
|
315 |
-
transition-property: transform;
|
316 |
-
transition-property: transform, -webkit-transform;
|
317 |
-
-webkit-transition-duration: 0.5s;
|
318 |
-
-o-transition-duration: 0.5s;
|
319 |
-
transition-duration: 0.5s;
|
320 |
-
-webkit-transition-timing-function: ease-out;
|
321 |
-
-o-transition-timing-function: ease-out;
|
322 |
-
transition-timing-function: ease-out;
|
323 |
-
}
|
324 |
-
|
325 |
-
.wpr-button-bounce-to-right:hover:before, .wpr-button-bounce-to-right:focus:before, .wpr-button-bounce-to-right:active:before {
|
326 |
-
-webkit-transform: scaleX(1);
|
327 |
-
-ms-transform: scaleX(1);
|
328 |
-
transform: scaleX(1);
|
329 |
-
-webkit-transition-timing-function: cubic-bezier(0.52, 1.64, 0.37, 0.66);
|
330 |
-
-o-transition-timing-function: cubic-bezier(0.52, 1.64, 0.37, 0.66);
|
331 |
-
transition-timing-function: cubic-bezier(0.52, 1.64, 0.37, 0.66);
|
332 |
-
}
|
333 |
-
|
334 |
-
/* Bounce To Left */
|
335 |
-
.wpr-button-bounce-to-left {
|
336 |
-
display: inline-block;
|
337 |
-
vertical-align: middle;
|
338 |
-
-webkit-transform: perspective(1px) translateZ(0);
|
339 |
-
transform: perspective(1px) translateZ(0);
|
340 |
-
position: relative;
|
341 |
-
-webkit-transition-property: color;
|
342 |
-
-o-transition-property: color;
|
343 |
-
transition-property: color;
|
344 |
-
-webkit-transition-duration: 0.5s;
|
345 |
-
-o-transition-duration: 0.5s;
|
346 |
-
transition-duration: 0.5s;
|
347 |
-
}
|
348 |
-
.wpr-button-bounce-to-left:before {
|
349 |
-
content: "";
|
350 |
-
position: absolute;
|
351 |
-
z-index: -1;
|
352 |
-
top: 0;
|
353 |
-
left: 0;
|
354 |
-
right: 0;
|
355 |
-
bottom: 0;
|
356 |
-
-webkit-transform: scaleX(0);
|
357 |
-
-ms-transform: scaleX(0);
|
358 |
-
transform: scaleX(0);
|
359 |
-
-webkit-transform-origin: 100% 50%;
|
360 |
-
-ms-transform-origin: 100% 50%;
|
361 |
-
transform-origin: 100% 50%;
|
362 |
-
-webkit-transition-property: transform;
|
363 |
-
-webkit-transition-property: -webkit-transform;
|
364 |
-
transition-property: -webkit-transform;
|
365 |
-
-o-transition-property: transform;
|
366 |
-
transition-property: transform;
|
367 |
-
transition-property: transform, -webkit-transform;
|
368 |
-
-webkit-transition-duration: 0.5s;
|
369 |
-
-o-transition-duration: 0.5s;
|
370 |
-
transition-duration: 0.5s;
|
371 |
-
-webkit-transition-timing-function: ease-out;
|
372 |
-
-o-transition-timing-function: ease-out;
|
373 |
-
transition-timing-function: ease-out;
|
374 |
-
}
|
375 |
-
.wpr-button-bounce-to-left:hover:before, .wpr-button-bounce-to-left:focus:before, .wpr-button-bounce-to-left:active:before {
|
376 |
-
-webkit-transform: scaleX(1);
|
377 |
-
-ms-transform: scaleX(1);
|
378 |
-
transform: scaleX(1);
|
379 |
-
-webkit-transition-timing-function: cubic-bezier(0.52, 1.64, 0.37, 0.66);
|
380 |
-
-o-transition-timing-function: cubic-bezier(0.52, 1.64, 0.37, 0.66);
|
381 |
-
transition-timing-function: cubic-bezier(0.52, 1.64, 0.37, 0.66);
|
382 |
-
}
|
383 |
-
|
384 |
-
/* Bounce To Bottom */
|
385 |
-
.wpr-button-bounce-to-bottom {
|
386 |
-
display: inline-block;
|
387 |
-
vertical-align: middle;
|
388 |
-
-webkit-transform: perspective(1px) translateZ(0);
|
389 |
-
transform: perspective(1px) translateZ(0);
|
390 |
-
position: relative;
|
391 |
-
-webkit-transition-property: color;
|
392 |
-
-o-transition-property: color;
|
393 |
-
transition-property: color;
|
394 |
-
-webkit-transition-duration: 0.5s;
|
395 |
-
-o-transition-duration: 0.5s;
|
396 |
-
transition-duration: 0.5s;
|
397 |
-
}
|
398 |
-
.wpr-button-bounce-to-bottom:before {
|
399 |
-
content: "";
|
400 |
-
position: absolute;
|
401 |
-
z-index: -1;
|
402 |
-
top: 0;
|
403 |
-
left: 0;
|
404 |
-
right: 0;
|
405 |
-
bottom: 0;
|
406 |
-
-webkit-transform: scaleY(0);
|
407 |
-
-ms-transform: scaleY(0);
|
408 |
-
transform: scaleY(0);
|
409 |
-
-webkit-transform-origin: 50% 0;
|
410 |
-
-ms-transform-origin: 50% 0;
|
411 |
-
transform-origin: 50% 0;
|
412 |
-
-webkit-transition-property: transform;
|
413 |
-
-webkit-transition-property: -webkit-transform;
|
414 |
-
transition-property: -webkit-transform;
|
415 |
-
-o-transition-property: transform;
|
416 |
-
transition-property: transform;
|
417 |
-
transition-property: transform, -webkit-transform;
|
418 |
-
-webkit-transition-duration: 0.5s;
|
419 |
-
-o-transition-duration: 0.5s;
|
420 |
-
transition-duration: 0.5s;
|
421 |
-
-webkit-transition-timing-function: ease-out;
|
422 |
-
-o-transition-timing-function: ease-out;
|
423 |
-
transition-timing-function: ease-out;
|
424 |
-
}
|
425 |
-
.wpr-button-bounce-to-bottom:hover:before, .wpr-button-bounce-to-bottom:focus:before, .wpr-button-bounce-to-bottom:active:before {
|
426 |
-
-webkit-transform: scaleY(1);
|
427 |
-
-ms-transform: scaleY(1);
|
428 |
-
transform: scaleY(1);
|
429 |
-
-webkit-transition-timing-function: cubic-bezier(0.52, 1.64, 0.37, 0.66);
|
430 |
-
-o-transition-timing-function: cubic-bezier(0.52, 1.64, 0.37, 0.66);
|
431 |
-
transition-timing-function: cubic-bezier(0.52, 1.64, 0.37, 0.66);
|
432 |
-
}
|
433 |
-
|
434 |
-
/* Bounce To Top */
|
435 |
-
.wpr-button-bounce-to-top {
|
436 |
-
display: inline-block;
|
437 |
-
vertical-align: middle;
|
438 |
-
-webkit-transform: perspective(1px) translateZ(0);
|
439 |
-
transform: perspective(1px) translateZ(0);
|
440 |
-
position: relative;
|
441 |
-
-webkit-transition-property: color;
|
442 |
-
-o-transition-property: color;
|
443 |
-
transition-property: color;
|
444 |
-
-webkit-transition-duration: 0.5s;
|
445 |
-
-o-transition-duration: 0.5s;
|
446 |
-
transition-duration: 0.5s;
|
447 |
-
}
|
448 |
-
.wpr-button-bounce-to-top:before {
|
449 |
-
content: "";
|
450 |
-
position: absolute;
|
451 |
-
z-index: -1;
|
452 |
-
top: 0;
|
453 |
-
left: 0;
|
454 |
-
right: 0;
|
455 |
-
bottom: 0;
|
456 |
-
-webkit-transform: scaleY(0);
|
457 |
-
-ms-transform: scaleY(0);
|
458 |
-
transform: scaleY(0);
|
459 |
-
-webkit-transform-origin: 50% 100%;
|
460 |
-
-ms-transform-origin: 50% 100%;
|
461 |
-
transform-origin: 50% 100%;
|
462 |
-
-webkit-transition-property: transform;
|
463 |
-
-webkit-transition-property: -webkit-transform;
|
464 |
-
transition-property: -webkit-transform;
|
465 |
-
-o-transition-property: transform;
|
466 |
-
transition-property: transform;
|
467 |
-
transition-property: transform, -webkit-transform;
|
468 |
-
-webkit-transition-duration: 0.5s;
|
469 |
-
-o-transition-duration: 0.5s;
|
470 |
-
transition-duration: 0.5s;
|
471 |
-
-webkit-transition-timing-function: ease-out;
|
472 |
-
-o-transition-timing-function: ease-out;
|
473 |
-
transition-timing-function: ease-out;
|
474 |
-
}
|
475 |
-
.wpr-button-bounce-to-top:hover, .wpr-button-bounce-to-top:focus, .wpr-button-bounce-to-top:active {
|
476 |
-
color: white;
|
477 |
-
}
|
478 |
-
.wpr-button-bounce-to-top:hover:before, .wpr-button-bounce-to-top:focus:before, .wpr-button-bounce-to-top:active:before {
|
479 |
-
-webkit-transform: scaleY(1);
|
480 |
-
-ms-transform: scaleY(1);
|
481 |
-
transform: scaleY(1);
|
482 |
-
-webkit-transition-timing-function: cubic-bezier(0.52, 1.64, 0.37, 0.66);
|
483 |
-
-o-transition-timing-function: cubic-bezier(0.52, 1.64, 0.37, 0.66);
|
484 |
-
transition-timing-function: cubic-bezier(0.52, 1.64, 0.37, 0.66);
|
485 |
-
}
|
486 |
-
|
487 |
-
/* Radial Out */
|
488 |
-
.wpr-button-radial-out {
|
489 |
-
display: inline-block;
|
490 |
-
vertical-align: middle;
|
491 |
-
-webkit-transform: perspective(1px) translateZ(0);
|
492 |
-
transform: perspective(1px) translateZ(0);
|
493 |
-
position: relative;
|
494 |
-
overflow: hidden;
|
495 |
-
-webkit-transition-property: color;
|
496 |
-
-o-transition-property: color;
|
497 |
-
transition-property: color;
|
498 |
-
-webkit-transition-duration: 0.3s;
|
499 |
-
-o-transition-duration: 0.3s;
|
500 |
-
transition-duration: 0.3s;
|
501 |
-
}
|
502 |
-
.wpr-button-radial-out:before {
|
503 |
-
content: "";
|
504 |
-
position: absolute;
|
505 |
-
z-index: -1;
|
506 |
-
top: 0;
|
507 |
-
left: 0;
|
508 |
-
right: 0;
|
509 |
-
bottom: 0;
|
510 |
-
border-radius: 100%;
|
511 |
-
-webkit-transform: scale(0);
|
512 |
-
-ms-transform: scale(0);
|
513 |
-
transform: scale(0);
|
514 |
-
-webkit-transition-property: transform;
|
515 |
-
-webkit-transition-property: -webkit-transform;
|
516 |
-
transition-property: -webkit-transform;
|
517 |
-
-o-transition-property: transform;
|
518 |
-
transition-property: transform;
|
519 |
-
transition-property: transform, -webkit-transform;
|
520 |
-
-webkit-transition-duration: 0.3s;
|
521 |
-
-o-transition-duration: 0.3s;
|
522 |
-
transition-duration: 0.3s;
|
523 |
-
-webkit-transition-timing-function: ease-out;
|
524 |
-
-o-transition-timing-function: ease-out;
|
525 |
-
transition-timing-function: ease-out;
|
526 |
-
}
|
527 |
-
.wpr-button-radial-out:hover, .wpr-button-radial-out:focus, .wpr-button-radial-out:active {
|
528 |
-
color: white;
|
529 |
-
}
|
530 |
-
.wpr-button-radial-out:hover:before, .wpr-button-radial-out:focus:before, .wpr-button-radial-out:active:before {
|
531 |
-
-webkit-transform: scale(2);
|
532 |
-
-ms-transform: scale(2);
|
533 |
-
transform: scale(2);
|
534 |
-
}
|
535 |
-
|
536 |
-
/* Radial In */
|
537 |
-
.wpr-button-radial-in {
|
538 |
-
display: inline-block;
|
539 |
-
vertical-align: middle;
|
540 |
-
-webkit-transform: perspective(1px) translateZ(0);
|
541 |
-
transform: perspective(1px) translateZ(0);
|
542 |
-
position: relative;
|
543 |
-
overflow: hidden;
|
544 |
-
-webkit-transition-property: color;
|
545 |
-
-o-transition-property: color;
|
546 |
-
transition-property: color;
|
547 |
-
-webkit-transition-duration: 0.3s;
|
548 |
-
-o-transition-duration: 0.3s;
|
549 |
-
transition-duration: 0.3s;
|
550 |
-
}
|
551 |
-
.wpr-button-radial-in:before {
|
552 |
-
content: "";
|
553 |
-
position: absolute;
|
554 |
-
z-index: -1;
|
555 |
-
top: 0;
|
556 |
-
left: 0;
|
557 |
-
right: 0;
|
558 |
-
bottom: 0;
|
559 |
-
border-radius: 100%;
|
560 |
-
-webkit-transform: scale(2);
|
561 |
-
-ms-transform: scale(2);
|
562 |
-
transform: scale(2);
|
563 |
-
-webkit-transition-property: transform;
|
564 |
-
-webkit-transition-property: -webkit-transform;
|
565 |
-
transition-property: -webkit-transform;
|
566 |
-
-o-transition-property: transform;
|
567 |
-
transition-property: transform;
|
568 |
-
transition-property: transform, -webkit-transform;
|
569 |
-
-webkit-transition-duration: 0.3s;
|
570 |
-
-o-transition-duration: 0.3s;
|
571 |
-
transition-duration: 0.3s;
|
572 |
-
-webkit-transition-timing-function: ease-out;
|
573 |
-
-o-transition-timing-function: ease-out;
|
574 |
-
transition-timing-function: ease-out;
|
575 |
-
}
|
576 |
-
.wpr-button-radial-in:hover, .wpr-button-radial-in:focus, .wpr-button-radial-in:active {
|
577 |
-
color: white;
|
578 |
-
}
|
579 |
-
.wpr-button-radial-in:hover:before, .wpr-button-radial-in:focus:before, .wpr-button-radial-in:active:before {
|
580 |
-
-webkit-transform: scale(0);
|
581 |
-
-ms-transform: scale(0);
|
582 |
-
transform: scale(0);
|
583 |
-
}
|
584 |
-
|
585 |
-
/* Rectangle In */
|
586 |
-
.wpr-button-rectangle-in {
|
587 |
-
display: inline-block;
|
588 |
-
vertical-align: middle;
|
589 |
-
-webkit-transform: perspective(1px) translateZ(0);
|
590 |
-
transform: perspective(1px) translateZ(0);
|
591 |
-
position: relative;
|
592 |
-
-webkit-transition-property: color;
|
593 |
-
-o-transition-property: color;
|
594 |
-
transition-property: color;
|
595 |
-
-webkit-transition-duration: 0.3s;
|
596 |
-
-o-transition-duration: 0.3s;
|
597 |
-
transition-duration: 0.3s;
|
598 |
-
}
|
599 |
-
.wpr-button-rectangle-in:before {
|
600 |
-
content: "";
|
601 |
-
position: absolute;
|
602 |
-
z-index: -1;
|
603 |
-
top: 0;
|
604 |
-
left: 0;
|
605 |
-
right: 0;
|
606 |
-
bottom: 0;
|
607 |
-
-webkit-transform: scale(1);
|
608 |
-
-ms-transform: scale(1);
|
609 |
-
transform: scale(1);
|
610 |
-
-webkit-transition-property: transform;
|
611 |
-
-webkit-transition-property: -webkit-transform;
|
612 |
-
transition-property: -webkit-transform;
|
613 |
-
-o-transition-property: transform;
|
614 |
-
transition-property: transform;
|
615 |
-
transition-property: transform, -webkit-transform;
|
616 |
-
-webkit-transition-duration: 0.3s;
|
617 |
-
-o-transition-duration: 0.3s;
|
618 |
-
transition-duration: 0.3s;
|
619 |
-
-webkit-transition-timing-function: ease-out;
|
620 |
-
-o-transition-timing-function: ease-out;
|
621 |
-
transition-timing-function: ease-out;
|
622 |
-
}
|
623 |
-
.wpr-button-rectangle-in:hover:before, .wpr-button-rectangle-in:focus:before, .wpr-button-rectangle-in:active:before {
|
624 |
-
-webkit-transform: scale(0);
|
625 |
-
-ms-transform: scale(0);
|
626 |
-
transform: scale(0);
|
627 |
-
}
|
628 |
-
|
629 |
-
/* Rectangle Out */
|
630 |
-
.wpr-button-rectangle-out {
|
631 |
-
display: inline-block;
|
632 |
-
vertical-align: middle;
|
633 |
-
-webkit-transform: perspective(1px) translateZ(0);
|
634 |
-
transform: perspective(1px) translateZ(0);
|
635 |
-
position: relative;
|
636 |
-
-webkit-transition-property: color;
|
637 |
-
-o-transition-property: color;
|
638 |
-
transition-property: color;
|
639 |
-
-webkit-transition-duration: 0.3s;
|
640 |
-
-o-transition-duration: 0.3s;
|
641 |
-
transition-duration: 0.3s;
|
642 |
-
}
|
643 |
-
.wpr-button-rectangle-out:before {
|
644 |
-
content: "";
|
645 |
-
position: absolute;
|
646 |
-
z-index: -1;
|
647 |
-
top: 0;
|
648 |
-
left: 0;
|
649 |
-
right: 0;
|
650 |
-
bottom: 0;
|
651 |
-
-webkit-transform: scale(0);
|
652 |
-
-ms-transform: scale(0);
|
653 |
-
transform: scale(0);
|
654 |
-
-webkit-transition-property: transform;
|
655 |
-
-webkit-transition-property: -webkit-transform;
|
656 |
-
transition-property: -webkit-transform;
|
657 |
-
-o-transition-property: transform;
|
658 |
-
transition-property: transform;
|
659 |
-
transition-property: transform, -webkit-transform;
|
660 |
-
-webkit-transition-duration: 0.3s;
|
661 |
-
-o-transition-duration: 0.3s;
|
662 |
-
transition-duration: 0.3s;
|
663 |
-
-webkit-transition-timing-function: ease-out;
|
664 |
-
-o-transition-timing-function: ease-out;
|
665 |
-
transition-timing-function: ease-out;
|
666 |
-
}
|
667 |
-
.wpr-button-rectangle-out:hover:before, .wpr-button-rectangle-out:focus:before, .wpr-button-rectangle-out:active:before {
|
668 |
-
-webkit-transform: scale(1);
|
669 |
-
-ms-transform: scale(1);
|
670 |
-
transform: scale(1);
|
671 |
-
}
|
672 |
-
|
673 |
-
/* Shutter In Horizontal */
|
674 |
-
.wpr-button-shutter-in-horizontal {
|
675 |
-
display: inline-block;
|
676 |
-
vertical-align: middle;
|
677 |
-
-webkit-transform: perspective(1px) translateZ(0);
|
678 |
-
transform: perspective(1px) translateZ(0);
|
679 |
-
position: relative;
|
680 |
-
-webkit-transition-property: color;
|
681 |
-
-o-transition-property: color;
|
682 |
-
transition-property: color;
|
683 |
-
-webkit-transition-duration: 0.3s;
|
684 |
-
-o-transition-duration: 0.3s;
|
685 |
-
transition-duration: 0.3s;
|
686 |
-
}
|
687 |
-
.wpr-button-shutter-in-horizontal:before {
|
688 |
-
content: "";
|
689 |
-
position: absolute;
|
690 |
-
z-index: -1;
|
691 |
-
top: 0;
|
692 |
-
bottom: 0;
|
693 |
-
left: 0;
|
694 |
-
right: 0;
|
695 |
-
-webkit-transform: scaleX(1);
|
696 |
-
-ms-transform: scaleX(1);
|
697 |
-
transform: scaleX(1);
|
698 |
-
-webkit-transform-origin: 50%;
|
699 |
-
-ms-transform-origin: 50%;
|
700 |
-
transform-origin: 50%;
|
701 |
-
-webkit-transition-property: transform;
|
702 |
-
-webkit-transition-property: -webkit-transform;
|
703 |
-
transition-property: -webkit-transform;
|
704 |
-
-o-transition-property: transform;
|
705 |
-
transition-property: transform;
|
706 |
-
transition-property: transform, -webkit-transform;
|
707 |
-
-webkit-transition-duration: 0.3s;
|
708 |
-
-o-transition-duration: 0.3s;
|
709 |
-
transition-duration: 0.3s;
|
710 |
-
-webkit-transition-timing-function: ease-out;
|
711 |
-
-o-transition-timing-function: ease-out;
|
712 |
-
transition-timing-function: ease-out;
|
713 |
-
}
|
714 |
-
.wpr-button-shutter-in-horizontal:hover:before, .wpr-button-shutter-in-horizontal:focus:before, .wpr-button-shutter-in-horizontal:active:before {
|
715 |
-
-webkit-transform: scaleX(0);
|
716 |
-
-ms-transform: scaleX(0);
|
717 |
-
transform: scaleX(0);
|
718 |
-
}
|
719 |
-
|
720 |
-
/* Shutter Out Horizontal */
|
721 |
-
.wpr-button-shutter-out-horizontal {
|
722 |
-
display: inline-block;
|
723 |
-
vertical-align: middle;
|
724 |
-
-webkit-transform: perspective(1px) translateZ(0);
|
725 |
-
transform: perspective(1px) translateZ(0);
|
726 |
-
position: relative;
|
727 |
-
-webkit-transition-property: color;
|
728 |
-
-o-transition-property: color;
|
729 |
-
transition-property: color;
|
730 |
-
-webkit-transition-duration: 0.3s;
|
731 |
-
-o-transition-duration: 0.3s;
|
732 |
-
transition-duration: 0.3s;
|
733 |
-
}
|
734 |
-
.wpr-button-shutter-out-horizontal:before {
|
735 |
-
content: "";
|
736 |
-
position: absolute;
|
737 |
-
z-index: -1;
|
738 |
-
top: 0;
|
739 |
-
bottom: 0;
|
740 |
-
left: 0;
|
741 |
-
right: 0;
|
742 |
-
-webkit-transform: scaleX(0);
|
743 |
-
-ms-transform: scaleX(0);
|
744 |
-
transform: scaleX(0);
|
745 |
-
-webkit-transform-origin: 50%;
|
746 |
-
-ms-transform-origin: 50%;
|
747 |
-
transform-origin: 50%;
|
748 |
-
-webkit-transition-property: transform;
|
749 |
-
-webkit-transition-property: -webkit-transform;
|
750 |
-
transition-property: -webkit-transform;
|
751 |
-
-o-transition-property: transform;
|
752 |
-
transition-property: transform;
|
753 |
-
transition-property: transform, -webkit-transform;
|
754 |
-
-webkit-transition-duration: 0.3s;
|
755 |
-
-o-transition-duration: 0.3s;
|
756 |
-
transition-duration: 0.3s;
|
757 |
-
-webkit-transition-timing-function: ease-out;
|
758 |
-
-o-transition-timing-function: ease-out;
|
759 |
-
transition-timing-function: ease-out;
|
760 |
-
}
|
761 |
-
.wpr-button-shutter-out-horizontal:hover:before, .wpr-button-shutter-out-horizontal:focus:before, .wpr-button-shutter-out-horizontal:active:before {
|
762 |
-
-webkit-transform: scaleX(1);
|
763 |
-
-ms-transform: scaleX(1);
|
764 |
-
transform: scaleX(1);
|
765 |
-
}
|
766 |
-
|
767 |
-
/* Shutter In Vertical */
|
768 |
-
.wpr-button-shutter-in-vertical {
|
769 |
-
display: inline-block;
|
770 |
-
vertical-align: middle;
|
771 |
-
-webkit-transform: perspective(1px) translateZ(0);
|
772 |
-
transform: perspective(1px) translateZ(0);
|
773 |
-
position: relative;
|
774 |
-
-webkit-transition-property: color;
|
775 |
-
-o-transition-property: color;
|
776 |
-
transition-property: color;
|
777 |
-
-webkit-transition-duration: 0.3s;
|
778 |
-
-o-transition-duration: 0.3s;
|
779 |
-
transition-duration: 0.3s;
|
780 |
-
}
|
781 |
-
.wpr-button-shutter-in-vertical:before {
|
782 |
-
content: "";
|
783 |
-
position: absolute;
|
784 |
-
z-index: -1;
|
785 |
-
top: 0;
|
786 |
-
bottom: 0;
|
787 |
-
left: 0;
|
788 |
-
right: 0;
|
789 |
-
-webkit-transform: scaleY(1);
|
790 |
-
-ms-transform: scaleY(1);
|
791 |
-
transform: scaleY(1);
|
792 |
-
-webkit-transform-origin: 50%;
|
793 |
-
-ms-transform-origin: 50%;
|
794 |
-
transform-origin: 50%;
|
795 |
-
-webkit-transition-property: transform;
|
796 |
-
-webkit-transition-property: -webkit-transform;
|
797 |
-
transition-property: -webkit-transform;
|
798 |
-
-o-transition-property: transform;
|
799 |
-
transition-property: transform;
|
800 |
-
transition-property: transform, -webkit-transform;
|
801 |
-
-webkit-transition-duration: 0.3s;
|
802 |
-
-o-transition-duration: 0.3s;
|
803 |
-
transition-duration: 0.3s;
|
804 |
-
-webkit-transition-timing-function: ease-out;
|
805 |
-
-o-transition-timing-function: ease-out;
|
806 |
-
transition-timing-function: ease-out;
|
807 |
-
}
|
808 |
-
.wpr-button-shutter-in-vertical:hover:before, .wpr-button-shutter-in-vertical:focus:before, .wpr-button-shutter-in-vertical:active:before {
|
809 |
-
-webkit-transform: scaleY(0);
|
810 |
-
-ms-transform: scaleY(0);
|
811 |
-
transform: scaleY(0);
|
812 |
-
}
|
813 |
-
|
814 |
-
/* Shutter Out Vertical */
|
815 |
-
.wpr-button-shutter-out-vertical {
|
816 |
-
display: inline-block;
|
817 |
-
vertical-align: middle;
|
818 |
-
-webkit-transform: perspective(1px) translateZ(0);
|
819 |
-
transform: perspective(1px) translateZ(0);
|
820 |
-
position: relative;
|
821 |
-
-webkit-transition-property: color;
|
822 |
-
-o-transition-property: color;
|
823 |
-
transition-property: color;
|
824 |
-
-webkit-transition-duration: 0.3s;
|
825 |
-
-o-transition-duration: 0.3s;
|
826 |
-
transition-duration: 0.3s;
|
827 |
-
}
|
828 |
-
.wpr-button-shutter-out-vertical:before {
|
829 |
-
content: "";
|
830 |
-
position: absolute;
|
831 |
-
z-index: -1;
|
832 |
-
top: 0;
|
833 |
-
bottom: 0;
|
834 |
-
left: 0;
|
835 |
-
right: 0;
|
836 |
-
-webkit-transform: scaleY(0);
|
837 |
-
-ms-transform: scaleY(0);
|
838 |
-
transform: scaleY(0);
|
839 |
-
-webkit-transform-origin: 50%;
|
840 |
-
-ms-transform-origin: 50%;
|
841 |
-
transform-origin: 50%;
|
842 |
-
-webkit-transition-property: transform;
|
843 |
-
-webkit-transition-property: -webkit-transform;
|
844 |
-
transition-property: -webkit-transform;
|
845 |
-
-o-transition-property: transform;
|
846 |
-
transition-property: transform;
|
847 |
-
transition-property: transform, -webkit-transform;
|
848 |
-
-webkit-transition-duration: 0.3s;
|
849 |
-
-o-transition-duration: 0.3s;
|
850 |
-
transition-duration: 0.3s;
|
851 |
-
-webkit-transition-timing-function: ease-out;
|
852 |
-
-o-transition-timing-function: ease-out;
|
853 |
-
transition-timing-function: ease-out;
|
854 |
-
}
|
855 |
-
|
856 |
-
.wpr-button-shutter-out-vertical:hover:before, .wpr-button-shutter-out-vertical:focus:before, .wpr-button-shutter-out-vertical:active:before {
|
857 |
-
-webkit-transform: scaleY(1);
|
858 |
-
-ms-transform: scaleY(1);
|
859 |
-
transform: scaleY(1);
|
860 |
-
}
|
861 |
-
|
862 |
-
/* BORDER TRANSITIONS */
|
863 |
-
|
864 |
-
/* Underline From Left */
|
865 |
-
.wpr-button-underline-from-left {
|
866 |
-
display: inline-block;
|
867 |
-
vertical-align: middle;
|
868 |
-
-webkit-transform: perspective(1px) translateZ(0);
|
869 |
-
transform: perspective(1px) translateZ(0);
|
870 |
-
position: relative;
|
871 |
-
border: none !important;
|
872 |
-
overflow: hidden;
|
873 |
-
}
|
874 |
-
.wpr-button-underline-from-left:before {
|
875 |
-
content: "";
|
876 |
-
position: absolute;
|
877 |
-
z-index: -1;
|
878 |
-
left: 0;
|
879 |
-
right: 100%;
|
880 |
-
bottom: 0;
|
881 |
-
height: 4px;
|
882 |
-
-webkit-transition-property: right;
|
883 |
-
-o-transition-property: right;
|
884 |
-
transition-property: right;
|
885 |
-
-webkit-transition-duration: 0.3s;
|
886 |
-
-o-transition-duration: 0.3s;
|
887 |
-
transition-duration: 0.3s;
|
888 |
-
-webkit-transition-timing-function: ease-out;
|
889 |
-
-o-transition-timing-function: ease-out;
|
890 |
-
transition-timing-function: ease-out;
|
891 |
-
}
|
892 |
-
.wpr-button-underline-from-left:hover:before, .wpr-button-underline-from-left:focus:before, .wpr-button-underline-from-left:active:before {
|
893 |
-
right: 0;
|
894 |
-
}
|
895 |
-
|
896 |
-
/* Underline From Center */
|
897 |
-
.wpr-button-underline-from-center {
|
898 |
-
display: inline-block;
|
899 |
-
vertical-align: middle;
|
900 |
-
-webkit-transform: perspective(1px) translateZ(0);
|
901 |
-
transform: perspective(1px) translateZ(0);
|
902 |
-
position: relative;
|
903 |
-
border: none !important;
|
904 |
-
overflow: hidden;
|
905 |
-
}
|
906 |
-
.wpr-button-underline-from-center:before {
|
907 |
-
content: "";
|
908 |
-
position: absolute;
|
909 |
-
z-index: -1;
|
910 |
-
left: 51%;
|
911 |
-
right: 51%;
|
912 |
-
bottom: 0;
|
913 |
-
-webkit-transition-property: left, right;
|
914 |
-
-o-transition-property: left, right;
|
915 |
-
transition-property: left, right;
|
916 |
-
-webkit-transition-duration: 0.3s;
|
917 |
-
-o-transition-duration: 0.3s;
|
918 |
-
transition-duration: 0.3s;
|
919 |
-
-webkit-transition-timing-function: ease-out;
|
920 |
-
-o-transition-timing-function: ease-out;
|
921 |
-
transition-timing-function: ease-out;
|
922 |
-
}
|
923 |
-
.wpr-button-underline-from-center:hover:before, .wpr-button-underline-from-center:focus:before, .wpr-button-underline-from-center:active:before {
|
924 |
-
left: 0;
|
925 |
-
right: 0;
|
926 |
-
}
|
927 |
-
|
928 |
-
/* Underline From Right */
|
929 |
-
.wpr-button-underline-from-right {
|
930 |
-
display: inline-block;
|
931 |
-
vertical-align: middle;
|
932 |
-
-webkit-transform: perspective(1px) translateZ(0);
|
933 |
-
transform: perspective(1px) translateZ(0);
|
934 |
-
position: relative;
|
935 |
-
border: none !important;
|
936 |
-
overflow: hidden;
|
937 |
-
}
|
938 |
-
.wpr-button-underline-from-right:before {
|
939 |
-
content: "";
|
940 |
-
position: absolute;
|
941 |
-
z-index: -1;
|
942 |
-
left: 100%;
|
943 |
-
right: 0;
|
944 |
-
bottom: 0;
|
945 |
-
-webkit-transition-property: left;
|
946 |
-
-o-transition-property: left;
|
947 |
-
transition-property: left;
|
948 |
-
-webkit-transition-duration: 0.3s;
|
949 |
-
-o-transition-duration: 0.3s;
|
950 |
-
transition-duration: 0.3s;
|
951 |
-
-webkit-transition-timing-function: ease-out;
|
952 |
-
-o-transition-timing-function: ease-out;
|
953 |
-
transition-timing-function: ease-out;
|
954 |
-
}
|
955 |
-
.wpr-button-underline-from-right:hover:before, .wpr-button-underline-from-right:focus:before, .wpr-button-underline-from-right:active:before {
|
956 |
-
left: 0;
|
957 |
-
}
|
958 |
-
|
959 |
-
/* Overline From Left */
|
960 |
-
.wpr-button-overline-from-left {
|
961 |
-
display: inline-block;
|
962 |
-
vertical-align: middle;
|
963 |
-
-webkit-transform: perspective(1px) translateZ(0);
|
964 |
-
transform: perspective(1px) translateZ(0);
|
965 |
-
position: relative;
|
966 |
-
border: none !important;
|
967 |
-
overflow: hidden;
|
968 |
-
}
|
969 |
-
.wpr-button-overline-from-left:before {
|
970 |
-
content: "";
|
971 |
-
position: absolute;
|
972 |
-
z-index: -1;
|
973 |
-
left: 0;
|
974 |
-
right: 100%;
|
975 |
-
top: 0;
|
976 |
-
-webkit-transition-property: right;
|
977 |
-
-o-transition-property: right;
|
978 |
-
transition-property: right;
|
979 |
-
-webkit-transition-duration: 0.3s;
|
980 |
-
-o-transition-duration: 0.3s;
|
981 |
-
transition-duration: 0.3s;
|
982 |
-
-webkit-transition-timing-function: ease-out;
|
983 |
-
-o-transition-timing-function: ease-out;
|
984 |
-
transition-timing-function: ease-out;
|
985 |
-
}
|
986 |
-
.wpr-button-overline-from-left:hover:before, .wpr-button-overline-from-left:focus:before, .wpr-button-overline-from-left:active:before {
|
987 |
-
right: 0;
|
988 |
-
}
|
989 |
-
|
990 |
-
/* Overline From Center */
|
991 |
-
.wpr-button-overline-from-center {
|
992 |
-
display: inline-block;
|
993 |
-
vertical-align: middle;
|
994 |
-
-webkit-transform: perspective(1px) translateZ(0);
|
995 |
-
transform: perspective(1px) translateZ(0);
|
996 |
-
position: relative;
|
997 |
-
border: none !important;
|
998 |
-
overflow: hidden;
|
999 |
-
}
|
1000 |
-
.wpr-button-overline-from-center:before {
|
1001 |
-
content: "";
|
1002 |
-
position: absolute;
|
1003 |
-
z-index: -1;
|
1004 |
-
left: 51%;
|
1005 |
-
right: 51%;
|
1006 |
-
top: 0;
|
1007 |
-
-webkit-transition-property: left, right;
|
1008 |
-
-o-transition-property: left, right;
|
1009 |
-
transition-property: left, right;
|
1010 |
-
-webkit-transition-duration: 0.3s;
|
1011 |
-
-o-transition-duration: 0.3s;
|
1012 |
-
transition-duration: 0.3s;
|
1013 |
-
-webkit-transition-timing-function: ease-out;
|
1014 |
-
-o-transition-timing-function: ease-out;
|
1015 |
-
transition-timing-function: ease-out;
|
1016 |
-
}
|
1017 |
-
.wpr-button-overline-from-center:hover:before, .wpr-button-overline-from-center:focus:before, .wpr-button-overline-from-center:active:before {
|
1018 |
-
left: 0;
|
1019 |
-
right: 0;
|
1020 |
-
}
|
1021 |
-
|
1022 |
-
/* Overline From Right */
|
1023 |
-
.wpr-button-overline-from-right {
|
1024 |
-
display: inline-block;
|
1025 |
-
vertical-align: middle;
|
1026 |
-
-webkit-transform: perspective(1px) translateZ(0);
|
1027 |
-
transform: perspective(1px) translateZ(0);
|
1028 |
-
position: relative;
|
1029 |
-
border: none !important;
|
1030 |
-
overflow: hidden;
|
1031 |
-
}
|
1032 |
-
.wpr-button-overline-from-right:before {
|
1033 |
-
content: "";
|
1034 |
-
position: absolute;
|
1035 |
-
z-index: -1;
|
1036 |
-
left: 100%;
|
1037 |
-
right: 0;
|
1038 |
-
top: 0;
|
1039 |
-
-webkit-transition-property: left;
|
1040 |
-
-o-transition-property: left;
|
1041 |
-
transition-property: left;
|
1042 |
-
-webkit-transition-duration: 0.3s;
|
1043 |
-
-o-transition-duration: 0.3s;
|
1044 |
-
transition-duration: 0.3s;
|
1045 |
-
-webkit-transition-timing-function: ease-out;
|
1046 |
-
-o-transition-timing-function: ease-out;
|
1047 |
-
transition-timing-function: ease-out;
|
1048 |
-
}
|
1049 |
-
.wpr-button-overline-from-right:hover:before, .wpr-button-overline-from-right:focus:before, .wpr-button-overline-from-right:active:before {
|
1050 |
-
left: 0;
|
1051 |
-
}
|
1052 |
-
|
1053 |
-
/* Underline Reveal */
|
1054 |
-
.wpr-button-underline-reveal {
|
1055 |
-
display: inline-block;
|
1056 |
-
vertical-align: middle;
|
1057 |
-
-webkit-transform: perspective(1px) translateZ(0);
|
1058 |
-
transform: perspective(1px) translateZ(0);
|
1059 |
-
position: relative;
|
1060 |
-
border: none !important;
|
1061 |
-
overflow: hidden;
|
1062 |
-
}
|
1063 |
-
.wpr-button-underline-reveal:before {
|
1064 |
-
content: "";
|
1065 |
-
position: absolute;
|
1066 |
-
z-index: -1;
|
1067 |
-
left: 0;
|
1068 |
-
right: 0;
|
1069 |
-
bottom: 0;
|
1070 |
-
-webkit-transform: translateY(100%);
|
1071 |
-
-ms-transform: translateY(100%);
|
1072 |
-
transform: translateY(100%);
|
1073 |
-
-webkit-transition-property: transform;
|
1074 |
-
-webkit-transition-property: -webkit-transform;
|
1075 |
-
transition-property: -webkit-transform;
|
1076 |
-
-o-transition-property: transform;
|
1077 |
-
transition-property: transform;
|
1078 |
-
transition-property: transform, -webkit-transform;
|
1079 |
-
-webkit-transition-duration: 0.3s;
|
1080 |
-
-o-transition-duration: 0.3s;
|
1081 |
-
transition-duration: 0.3s;
|
1082 |
-
-webkit-transition-timing-function: ease-out;
|
1083 |
-
-o-transition-timing-function: ease-out;
|
1084 |
-
transition-timing-function: ease-out;
|
1085 |
-
}
|
1086 |
-
.wpr-button-underline-reveal:hover:before, .wpr-button-underline-reveal:focus:before, .wpr-button-underline-reveal:active:before {
|
1087 |
-
-webkit-transform: translateY(0);
|
1088 |
-
-ms-transform: translateY(0);
|
1089 |
-
transform: translateY(0);
|
1090 |
-
}
|
1091 |
-
|
1092 |
-
/* Overline Reveal */
|
1093 |
-
.wpr-button-overline-reveal {
|
1094 |
-
display: inline-block;
|
1095 |
-
vertical-align: middle;
|
1096 |
-
-webkit-transform: perspective(1px) translateZ(0);
|
1097 |
-
transform: perspective(1px) translateZ(0);
|
1098 |
-
position: relative;
|
1099 |
-
border: none !important;
|
1100 |
-
overflow: hidden;
|
1101 |
-
}
|
1102 |
-
.wpr-button-overline-reveal:before {
|
1103 |
-
content: "";
|
1104 |
-
position: absolute;
|
1105 |
-
z-index: -1;
|
1106 |
-
left: 0;
|
1107 |
-
right: 0;
|
1108 |
-
top: 0;
|
1109 |
-
-webkit-transform: translateY(-100%);
|
1110 |
-
-ms-transform: translateY(-100%);
|
1111 |
-
transform: translateY(-100%);
|
1112 |
-
-webkit-transition-property: transform;
|
1113 |
-
-webkit-transition-property: -webkit-transform;
|
1114 |
-
transition-property: -webkit-transform;
|
1115 |
-
-o-transition-property: transform;
|
1116 |
-
transition-property: transform;
|
1117 |
-
transition-property: transform, -webkit-transform;
|
1118 |
-
-webkit-transition-duration: 0.3s;
|
1119 |
-
-o-transition-duration: 0.3s;
|
1120 |
-
transition-duration: 0.3s;
|
1121 |
-
-webkit-transition-timing-function: ease-out;
|
1122 |
-
-o-transition-timing-function: ease-out;
|
1123 |
-
transition-timing-function: ease-out;
|
1124 |
-
}
|
1125 |
-
.wpr-button-overline-reveal:hover:before, .wpr-button-overline-reveal:focus:before, .wpr-button-overline-reveal:active:before {
|
1126 |
-
-webkit-transform: translateY(0);
|
1127 |
-
-ms-transform: translateY(0);
|
1128 |
-
transform: translateY(0);
|
1129 |
-
}
|
1130 |
-
|
1131 |
-
/* Winona */
|
1132 |
-
.wpr-button-winona {
|
1133 |
-
overflow: hidden;
|
1134 |
-
-webkit-transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
|
1135 |
-
-o-transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
|
1136 |
-
transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
|
1137 |
-
}
|
1138 |
-
.wpr-button-winona::after {
|
1139 |
-
content: attr(data-text);
|
1140 |
-
position: absolute;
|
1141 |
-
width: 100%;
|
1142 |
-
height: 100%;
|
1143 |
-
top: 0;
|
1144 |
-
left: 0;
|
1145 |
-
opacity: 0;
|
1146 |
-
-webkit-transform: translate3d(0, 25%, 0);
|
1147 |
-
transform: translate3d(0, 25%, 0);
|
1148 |
-
}
|
1149 |
-
|
1150 |
-
.wpr-button-winona::after,
|
1151 |
-
.wpr-button-winona > span {
|
1152 |
-
-webkit-transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
|
1153 |
-
-o-transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
|
1154 |
-
transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
|
1155 |
-
}
|
1156 |
-
.wpr-button-winona:hover::after {
|
1157 |
-
opacity: 1;
|
1158 |
-
-webkit-transform: translate3d(0, 0, 0);
|
1159 |
-
transform: translate3d(0, 0, 0);
|
1160 |
-
}
|
1161 |
-
.wpr-button-winona:hover > span {
|
1162 |
-
opacity: 0;
|
1163 |
-
-webkit-transform: translate3d(0, -25%, 0);
|
1164 |
-
transform: translate3d(0, -25%, 0);
|
1165 |
-
}
|
1166 |
-
|
1167 |
-
/* Wayra Left */
|
1168 |
-
.wpr-button-wayra-left {
|
1169 |
-
overflow: hidden;
|
1170 |
-
-webkit-transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
|
1171 |
-
-o-transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
|
1172 |
-
transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
|
1173 |
-
}
|
1174 |
-
.wpr-button-wayra-left::after {
|
1175 |
-
content: '';
|
1176 |
-
position: absolute;
|
1177 |
-
top: 0;
|
1178 |
-
left: 0;
|
1179 |
-
width: 150%;
|
1180 |
-
height: 100%;
|
1181 |
-
z-index: -1;
|
1182 |
-
-webkit-transform: rotate3d(0, 0, 1, -90deg) translate3d(0, -3em, 0);
|
1183 |
-
transform: rotate3d(0, 0, 1, -90deg) translate3d(0, -3em, 0);
|
1184 |
-
-webkit-transform-origin: 0% 100%;
|
1185 |
-
-ms-transform-origin: 0% 100%;
|
1186 |
-
transform-origin: 0% 100%;
|
1187 |
-
-webkit-transition: -webkit-transform 0.3s, opacity 0.3s, background-color 0.3s;
|
1188 |
-
-webkit-transition: opacity 0.3s, background-color 0.3s, -webkit-transform 0.3s;
|
1189 |
-
transition: opacity 0.3s, background-color 0.3s, -webkit-transform 0.3s;
|
1190 |
-
-o-transition: transform 0.3s, opacity 0.3s, background-color 0.3s;
|
1191 |
-
transition: transform 0.3s, opacity 0.3s, background-color 0.3s;
|
1192 |
-
transition: transform 0.3s, opacity 0.3s, background-color 0.3s, -webkit-transform 0.3s;
|
1193 |
-
}
|
1194 |
-
|
1195 |
-
.wpr-button-wayra-left:hover::after {
|
1196 |
-
opacity: 1;
|
1197 |
-
-webkit-transform: rotate3d(0, 0, 1, 0deg);
|
1198 |
-
transform: rotate3d(0, 0, 1, 0deg);
|
1199 |
-
-webkit-transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
|
1200 |
-
-o-transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
|
1201 |
-
transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
|
1202 |
-
}
|
1203 |
-
|
1204 |
-
/* Wayra Right */
|
1205 |
-
.wpr-button-wayra-right {
|
1206 |
-
overflow: hidden;
|
1207 |
-
-webkit-transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
|
1208 |
-
-o-transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
|
1209 |
-
transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
|
1210 |
-
}
|
1211 |
-
.wpr-button-wayra-right::after {
|
1212 |
-
content: '';
|
1213 |
-
position: absolute;
|
1214 |
-
top: 0;
|
1215 |
-
right: 0;
|
1216 |
-
width: 150%;
|
1217 |
-
height: 100%;
|
1218 |
-
z-index: -1;
|
1219 |
-
-webkit-transform: rotate3d(0, 0, 1, 90deg) translate3d(0, -3em, 0);
|
1220 |
-
transform: rotate3d(0, 0, 1, 90deg) translate3d(0, -3em, 0);
|
1221 |
-
-webkit-transform-origin: 100% 100%;
|
1222 |
-
-ms-transform-origin: 100% 100%;
|
1223 |
-
transform-origin: 100% 100%;
|
1224 |
-
-webkit-transition: -webkit-transform 0.3s, opacity 0.3s, background-color 0.3s;
|
1225 |
-
-webkit-transition: opacity 0.3s, background-color 0.3s, -webkit-transform 0.3s;
|
1226 |
-
transition: opacity 0.3s, background-color 0.3s, -webkit-transform 0.3s;
|
1227 |
-
-o-transition: transform 0.3s, opacity 0.3s, background-color 0.3s;
|
1228 |
-
transition: transform 0.3s, opacity 0.3s, background-color 0.3s;
|
1229 |
-
transition: transform 0.3s, opacity 0.3s, background-color 0.3s, -webkit-transform 0.3s;
|
1230 |
-
}
|
1231 |
-
|
1232 |
-
.wpr-button-wayra-right:hover::after {
|
1233 |
-
opacity: 1;
|
1234 |
-
-webkit-transform: rotate3d(0, 0, 1, 0deg);
|
1235 |
-
transform: rotate3d(0, 0, 1, 0deg);
|
1236 |
-
-webkit-transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
|
1237 |
-
-o-transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
|
1238 |
-
transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
|
1239 |
-
}
|
1240 |
-
|
1241 |
-
|
1242 |
-
/* Rayen Left */
|
1243 |
-
.wpr-button-rayen-left {
|
1244 |
-
overflow: hidden;
|
1245 |
-
}
|
1246 |
-
.wpr-button-rayen-left::after {
|
1247 |
-
content: attr(data-text);
|
1248 |
-
position: absolute;
|
1249 |
-
top: 0;
|
1250 |
-
left: 0;
|
1251 |
-
width: 100%;
|
1252 |
-
height: 100%;
|
1253 |
-
-webkit-transform: translate3d(-100%, 0, 0);
|
1254 |
-
transform: translate3d(-100%, 0, 0);
|
1255 |
-
z-index: 10;
|
1256 |
-
}
|
1257 |
-
.wpr-button-rayen-left::after,
|
1258 |
-
.wpr-button-rayen-left > span {
|
1259 |
-
-webkit-transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
|
1260 |
-
-o-transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
|
1261 |
-
transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
|
1262 |
-
}
|
1263 |
-
.wpr-button-rayen-left:hover::after {
|
1264 |
-
-webkit-transform: translate3d(0, 0, 0);
|
1265 |
-
transform: translate3d(0, 0, 0);
|
1266 |
-
}
|
1267 |
-
.wpr-button-rayen-left:hover > span {
|
1268 |
-
-webkit-transform: translate3d(0, 100%, 0);
|
1269 |
-
transform: translate3d(0, 100%, 0);
|
1270 |
-
}
|
1271 |
-
|
1272 |
-
/* Rayen Right */
|
1273 |
-
.wpr-button-rayen-right {
|
1274 |
-
overflow: hidden;
|
1275 |
-
}
|
1276 |
-
.wpr-button-rayen-right::after {
|
1277 |
-
content: attr(data-text);
|
1278 |
-
position: absolute;
|
1279 |
-
top: 0;
|
1280 |
-
right: 0;
|
1281 |
-
width: 100%;
|
1282 |
-
height: 100%;
|
1283 |
-
-webkit-transform: translate3d(100%, 0, 0);
|
1284 |
-
transform: translate3d(100%, 0, 0);
|
1285 |
-
z-index: 10;
|
1286 |
-
}
|
1287 |
-
.wpr-button-rayen-right::after,
|
1288 |
-
.wpr-button-rayen-right > span {
|
1289 |
-
-webkit-transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
|
1290 |
-
-o-transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
|
1291 |
-
transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
|
1292 |
-
}
|
1293 |
-
.wpr-button-rayen-right:hover::after {
|
1294 |
-
-webkit-transform: translate3d(0, 0, 0);
|
1295 |
-
transform: translate3d(0, 0, 0);
|
1296 |
-
}
|
1297 |
-
.wpr-button-rayen-right:hover > span {
|
1298 |
-
-webkit-transform: translate3d(0, 100%, 0);
|
1299 |
-
transform: translate3d(0, 100%, 0);
|
1300 |
-
}
|
1301 |
-
|
1302 |
-
/* Isi Right */
|
1303 |
-
.wpr-button-isi-left {
|
1304 |
-
overflow: hidden;
|
1305 |
-
}
|
1306 |
-
.wpr-button-isi-left::after {
|
1307 |
-
content: '';
|
1308 |
-
z-index: -1;
|
1309 |
-
position: absolute;
|
1310 |
-
top: 50%;
|
1311 |
-
right: 100%;
|
1312 |
-
margin: -15px 0 0 1px;
|
1313 |
-
width: 15%;
|
1314 |
-
height: 30px;
|
1315 |
-
border-radius: 50%;
|
1316 |
-
-webkit-transform-origin: 0% 50%;
|
1317 |
-
-ms-transform-origin: 0% 50%;
|
1318 |
-
transform-origin: 0% 50%;
|
1319 |
-
-webkit-transform: scale3d(1, 2, 1);
|
1320 |
-
transform: scale3d(1, 2, 1);
|
1321 |
-
-webkit-transition-timing-function: cubic-bezier(0.7,0,0.9,1);
|
1322 |
-
-o-transition-timing-function: cubic-bezier(0.7,0,0.9,1);
|
1323 |
-
transition-timing-function: cubic-bezier(0.7,0,0.9,1);
|
1324 |
-
}
|
1325 |
-
.wpr-button-isi-left:hover::after {
|
1326 |
-
-webkit-transform: scale3d(9, 9, 1);
|
1327 |
-
}
|
1328 |
-
|
1329 |
-
/* Isi Left */
|
1330 |
-
.wpr-button-isi-right {
|
1331 |
-
overflow: hidden;
|
1332 |
-
}
|
1333 |
-
.wpr-button-isi-right::after {
|
1334 |
-
content: '';
|
1335 |
-
z-index: -1;
|
1336 |
-
position: absolute;
|
1337 |
-
top: 50%;
|
1338 |
-
left: 100%;
|
1339 |
-
margin: -15px 0 0 1px;
|
1340 |
-
width: 15%;
|
1341 |
-
height: 30px;
|
1342 |
-
border-radius: 50%;
|
1343 |
-
-webkit-transform-origin: 100% 50%;
|
1344 |
-
-ms-transform-origin: 100% 50%;
|
1345 |
-
transform-origin: 100% 50%;
|
1346 |
-
-webkit-transform: scale3d(1, 2, 1);
|
1347 |
-
transform: scale3d(1, 2, 1);
|
1348 |
-
-webkit-transition-timing-function: cubic-bezier(0.7,0,0.9,1);
|
1349 |
-
-o-transition-timing-function: cubic-bezier(0.7,0,0.9,1);
|
1350 |
-
transition-timing-function: cubic-bezier(0.7,0,0.9,1);
|
1351 |
-
}
|
1352 |
-
.wpr-button-isi-right:hover::after {
|
1353 |
-
-webkit-transform: scale3d(9, 9, 1);
|
1354 |
-
transform: scale3d(9, 9, 1);
|
1355 |
-
}
|
1356 |
-
|
1357 |
-
/* Aylen */
|
1358 |
-
.wpr-button-aylen {
|
1359 |
-
overflow: hidden;
|
1360 |
-
}
|
1361 |
-
|
1362 |
-
.wpr-button-aylen::after,
|
1363 |
-
.wpr-button-aylen::before {
|
1364 |
-
content: '';
|
1365 |
-
position: absolute;
|
1366 |
-
height: 100%;
|
1367 |
-
width: 100%;
|
1368 |
-
bottom: 100%;
|
1369 |
-
left: 0;
|
1370 |
-
z-index: -1;
|
1371 |
-
-webkit-transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
|
1372 |
-
-o-transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
|
1373 |
-
transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
|
1374 |
-
}
|
1375 |
-
|
1376 |
-
.wpr-button-aylen::after {
|
1377 |
-
opacity: 0.75;
|
1378 |
-
}
|
1379 |
-
|
1380 |
-
.wpr-button-aylen:hover::after,
|
1381 |
-
.wpr-button-aylen:hover::before {
|
1382 |
-
-webkit-transform: translate3d(0, 100%, 0);
|
1383 |
-
transform: translate3d(0, 100%, 0);
|
1384 |
-
}
|
1385 |
-
.wpr-button-aylen:hover::before {
|
1386 |
-
-webkit-transition-delay: 0.175s;
|
1387 |
-
-o-transition-delay: 0.175s;
|
1388 |
-
transition-delay: 0.175s;
|
1389 |
-
}
|
1390 |
-
|
1391 |
-
/* Antiman */
|
1392 |
-
.wpr-button-antiman {
|
1393 |
-
overflow: visible !important;
|
1394 |
-
border: none !important;
|
1395 |
-
}
|
1396 |
-
|
1397 |
-
.wpr-button-antiman::after {
|
1398 |
-
content: '';
|
1399 |
-
z-index: -1;
|
1400 |
-
border-radius: inherit;
|
1401 |
-
pointer-events: none;
|
1402 |
-
position: absolute;
|
1403 |
-
top: 0;
|
1404 |
-
left: 0;
|
1405 |
-
width: 100%;
|
1406 |
-
height: 100%;
|
1407 |
-
-webkit-backface-visibility: hidden;
|
1408 |
-
-webkit-transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
|
1409 |
-
-o-transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
|
1410 |
-
transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
|
1411 |
-
}
|
1412 |
-
.wpr-button-antiman::after {
|
1413 |
-
opacity: 0;
|
1414 |
-
-webkit-transform: scale3d(1.2, 1.2, 1);
|
1415 |
-
transform: scale3d(1.2, 1.2, 1);
|
1416 |
-
}
|
1417 |
-
.wpr-button-antiman:hover::after {
|
1418 |
-
opacity: 1;
|
1419 |
-
-webkit-transform: scale3d(1, 1, 1);
|
1420 |
-
transform: scale3d(1, 1, 1);
|
1421 |
-
}
|
1422 |
-
|
1423 |
-
/* Naira */
|
1424 |
-
.wpr-button-naira {
|
1425 |
-
overflow: hidden;
|
1426 |
-
}
|
1427 |
-
.wpr-button-naira::after {
|
1428 |
-
content: '';
|
1429 |
-
position: absolute;
|
1430 |
-
left: -50%;
|
1431 |
-
width: 200%;
|
1432 |
-
height: 200%;
|
1433 |
-
top: -50%;
|
1434 |
-
z-index: -1;
|
1435 |
-
-webkit-transform: translate3d(0, -100%, 0) rotate3d(0, 0, 1, -10deg);
|
1436 |
-
transform: translate3d(0, -100%, 0) rotate3d(0, 0, 1, -10deg);
|
1437 |
-
}
|
1438 |
-
.wpr-button-naira .wpr-button-button-icon {
|
1439 |
-
position: absolute;
|
1440 |
-
top: 0;
|
1441 |
-
width: 100%;
|
1442 |
-
height: 100%;
|
1443 |
-
left: 0;
|
1444 |
-
margin: 0 !important;
|
1445 |
-
-webkit-transform: translate3d(0, -100%, 0);
|
1446 |
-
transform: translate3d(0, -100%, 0);
|
1447 |
-
opacity: 0;
|
1448 |
-
}
|
1449 |
-
.wpr-button-naira .wpr-button-button-icon i {
|
1450 |
-
position: absolute;
|
1451 |
-
top: 50%;
|
1452 |
-
left: 50%;
|
1453 |
-
-webkit-transform: translate(-50%,-50%);
|
1454 |
-
-ms-transform: translate(-50%,-50%);
|
1455 |
-
transform: translate(-50%,-50%);
|
1456 |
-
}
|
1457 |
-
|
1458 |
-
.wpr-button-naira .wpr-button-button-text {
|
1459 |
-
display: block;
|
1460 |
-
}
|
1461 |
-
|
1462 |
-
.wpr-button-naira .wpr-button-button-text,
|
1463 |
-
.wpr-button-naira .wpr-button-button-icon {
|
1464 |
-
-webkit-transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
|
1465 |
-
-o-transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
|
1466 |
-
transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
|
1467 |
-
}
|
1468 |
-
|
1469 |
-
.wpr-button-naira:hover .wpr-button-button-icon {
|
1470 |
-
-webkit-transform: translate3d(0, 0, 0);
|
1471 |
-
transform: translate3d(0, 0, 0);
|
1472 |
-
opacity: 1;
|
1473 |
-
}
|
1474 |
-
.wpr-button-naira:hover .wpr-button-button-text {
|
1475 |
-
opacity: 0;
|
1476 |
-
-webkit-transform: translate3d(0, 100%, 0);
|
1477 |
-
transform: translate3d(0, 100%, 0);
|
1478 |
-
}
|
1479 |
-
@-webkit-keyframes anim-naira-1 {
|
1480 |
-
50% {
|
1481 |
-
-webkit-transform: translate3d(0, -50%, 0) rotate3d(0, 0, 1, -10deg);
|
1482 |
-
transform: translate3d(0, -50%, 0) rotate3d(0, 0, 1, -10deg);
|
1483 |
-
-webkit-animation-timing-function: ease-out;
|
1484 |
-
animation-timing-function: ease-out;
|
1485 |
-
}
|
1486 |
-
100% {
|
1487 |
-
-webkit-transform: translate3d(0, 0%, 0) rotate3d(0, 0, 1, 0deg);
|
1488 |
-
transform: translate3d(0, 0%, 0) rotate3d(0, 0, 1, 0deg);
|
1489 |
-
}
|
1490 |
-
}
|
1491 |
-
@keyframes anim-naira-1 {
|
1492 |
-
50% {
|
1493 |
-
-webkit-transform: translate3d(0, -50%, 0) rotate3d(0, 0, 1, -10deg);
|
1494 |
-
transform: translate3d(0, -50%, 0) rotate3d(0, 0, 1, -10deg);
|
1495 |
-
-webkit-animation-timing-function: ease-out;
|
1496 |
-
animation-timing-function: ease-out;
|
1497 |
-
}
|
1498 |
-
100% {
|
1499 |
-
-webkit-transform: translate3d(0, 0%, 0) rotate3d(0, 0, 1, 0deg);
|
1500 |
-
transform: translate3d(0, 0%, 0) rotate3d(0, 0, 1, 0deg);
|
1501 |
-
}
|
1502 |
-
}
|
1503 |
-
.wpr-button-naira:hover::after {
|
1504 |
-
-webkit-animation-name: anim-naira-1;
|
1505 |
-
animation-name: anim-naira-1;
|
1506 |
-
-webkit-animation-fill-mode: forwards;
|
1507 |
-
animation-fill-mode: forwards;
|
1508 |
-
-webkit-animation-timing-function: ease-in;
|
1509 |
-
animation-timing-function: ease-in;
|
1510 |
-
}
|
1511 |
-
|
1512 |
-
/* Naira Up*/
|
1513 |
-
.wpr-button-naira-up {
|
1514 |
-
overflow: hidden;
|
1515 |
-
}
|
1516 |
-
.wpr-button-naira-up::after {
|
1517 |
-
content: '';
|
1518 |
-
position: absolute;
|
1519 |
-
left: -50%;
|
1520 |
-
width: 200%;
|
1521 |
-
height: 200%;
|
1522 |
-
top: -50%;
|
1523 |
-
z-index: -1;
|
1524 |
-
-webkit-transform: translate3d(0, 100%, 0) rotate3d(0, 0, 1, 10deg);
|
1525 |
-
transform: translate3d(0, 100%, 0) rotate3d(0, 0, 1, 10deg);
|
1526 |
-
}
|
1527 |
-
.wpr-button-naira-up .wpr-button-button-icon {
|
1528 |
-
position: absolute;
|
1529 |
-
top: 0;
|
1530 |
-
width: 100%;
|
1531 |
-
height: 100%;
|
1532 |
-
left: 0;
|
1533 |
-
margin: 0 !important;
|
1534 |
-
-webkit-transform: translate3d(0, 100%, 0);
|
1535 |
-
transform: translate3d(0, 100%, 0);
|
1536 |
-
opacity: 0;
|
1537 |
-
}
|
1538 |
-
|
1539 |
-
.wpr-button-naira-up .wpr-button-button-icon i {
|
1540 |
-
position: absolute;
|
1541 |
-
top: 50%;
|
1542 |
-
left: 50%;
|
1543 |
-
-webkit-transform: translate(-50%,-50%);
|
1544 |
-
-ms-transform: translate(-50%,-50%);
|
1545 |
-
transform: translate(-50%,-50%);
|
1546 |
-
}
|
1547 |
-
|
1548 |
-
.wpr-button-naira-up .wpr-button-button-text {
|
1549 |
-
display: block;
|
1550 |
-
}
|
1551 |
-
|
1552 |
-
.wpr-button-naira-up .wpr-button-button-text,
|
1553 |
-
.wpr-button-naira-up .wpr-button-button-icon {
|
1554 |
-
-webkit-transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
|
1555 |
-
-o-transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
|
1556 |
-
transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
|
1557 |
-
}
|
1558 |
-
|
1559 |
-
.wpr-button-naira-up:hover .wpr-button-button-icon {
|
1560 |
-
-webkit-transform: translate3d(0, 0, 0);
|
1561 |
-
transform: translate3d(0, 0, 0);
|
1562 |
-
opacity: 1;
|
1563 |
-
}
|
1564 |
-
.wpr-button-naira-up:hover .wpr-button-button-text {
|
1565 |
-
opacity: 0;
|
1566 |
-
-webkit-transform: translate3d(0, -100%, 0);
|
1567 |
-
transform: translate3d(0, -100%, 0);
|
1568 |
-
}
|
1569 |
-
@-webkit-keyframes anim-naira-2 {
|
1570 |
-
50% {
|
1571 |
-
-webkit-transform: translate3d(0, 50%, 0) rotate3d(0, 0, 1, 10deg);
|
1572 |
-
transform: translate3d(0, 50%, 0) rotate3d(0, 0, 1, 10deg);
|
1573 |
-
-webkit-animation-timing-function: ease-out;
|
1574 |
-
animation-timing-function: ease-out;
|
1575 |
-
}
|
1576 |
-
100% {
|
1577 |
-
-webkit-transform: translate3d(0, 0%, 0) rotate3d(0, 0, 1, 0deg);
|
1578 |
-
transform: translate3d(0, 0%, 0) rotate3d(0, 0, 1, 0deg);
|
1579 |
-
}
|
1580 |
-
}
|
1581 |
-
@keyframes anim-naira-2 {
|
1582 |
-
50% {
|
1583 |
-
-webkit-transform: translate3d(0, 50%, 0) rotate3d(0, 0, 1, 10deg);
|
1584 |
-
transform: translate3d(0, 50%, 0) rotate3d(0, 0, 1, 10deg);
|
1585 |
-
-webkit-animation-timing-function: ease-out;
|
1586 |
-
animation-timing-function: ease-out;
|
1587 |
-
}
|
1588 |
-
100% {
|
1589 |
-
-webkit-transform: translate3d(0, 0%, 0) rotate3d(0, 0, 1, 0deg);
|
1590 |
-
transform: translate3d(0, 0%, 0) rotate3d(0, 0, 1, 0deg);
|
1591 |
-
}
|
1592 |
-
}
|
1593 |
-
.wpr-button-naira-up:hover::after {
|
1594 |
-
-webkit-animation-name: anim-naira-2;
|
1595 |
-
animation-name: anim-naira-2;
|
1596 |
-
-webkit-animation-fill-mode: forwards;
|
1597 |
-
animation-fill-mode: forwards;
|
1598 |
-
-webkit-animation-timing-function: ease-in;
|
1599 |
-
animation-timing-function: ease-in;
|
1600 |
-
}
|
1601 |
-
|
1602 |
-
/* Fade */
|
1603 |
-
.wpr-button-none:before {
|
1604 |
-
content: "";
|
1605 |
-
position: absolute;
|
1606 |
-
z-index: -1;
|
1607 |
-
top: 0;
|
1608 |
-
left: 0;
|
1609 |
-
width: 100%;
|
1610 |
-
height: 100%;
|
1611 |
-
opacity: 0;
|
1612 |
-
}
|
1613 |
-
.wpr-button-none:hover:before {
|
1614 |
-
opacity: 1;
|
1615 |
-
}
|
1616 |
-
|
1617 |
-
|
1618 |
-
.wpr-button-effect,
|
1619 |
-
.wpr-button-effect::before,
|
1620 |
-
.wpr-button-effect::after,
|
1621 |
-
.wpr-button-effect span {
|
1622 |
-
-webkit-transition-property: all;
|
1623 |
-
-o-transition-property: all;
|
1624 |
-
transition-property: all;
|
1625 |
-
}
|
1626 |
-
|
1627 |
-
.wpr-button-effect::after {
|
1628 |
-
text-align: center;
|
1629 |
-
}
|
1 |
+
/*!
|
2 |
+
* Hover.css (http://ianlunn.github.io/Hover/)
|
3 |
+
* Version: 2.3.2
|
4 |
+
* Author: Ian Lunn @IanLunn
|
5 |
+
* Author URL: http://ianlunn.co.uk/
|
6 |
+
* Github: https://github.com/IanLunn/Hover
|
7 |
+
|
8 |
+
* Hover.css Copyright Ian Lunn 2017. Generated with Sass.
|
9 |
+
*/
|
10 |
+
|
11 |
+
|
12 |
+
/* 2D TRANSITIONS */
|
13 |
+
/* Forward */
|
14 |
+
.elementor-animation-forward {
|
15 |
+
display: inline-block;
|
16 |
+
vertical-align: middle;
|
17 |
+
-webkit-transform: perspective(1px) translateZ(0);
|
18 |
+
transform: perspective(1px) translateZ(0);
|
19 |
+
-webkit-transition-duration: 0.3s;
|
20 |
+
-o-transition-duration: 0.3s;
|
21 |
+
transition-duration: 0.3s;
|
22 |
+
-webkit-transition-property: transform;
|
23 |
+
-webkit-transition-property: -webkit-transform;
|
24 |
+
transition-property: -webkit-transform;
|
25 |
+
-o-transition-property: transform;
|
26 |
+
transition-property: transform;
|
27 |
+
transition-property: transform, -webkit-transform;
|
28 |
+
}
|
29 |
+
.elementor-animation-forward:hover, .elementor-animation-forward:focus, .elementor-animation-forward:active {
|
30 |
+
-webkit-transform: translateX(8px);
|
31 |
+
-ms-transform: translateX(8px);
|
32 |
+
transform: translateX(8px);
|
33 |
+
}
|
34 |
+
|
35 |
+
/* Backward */
|
36 |
+
.elementor-animation-backward {
|
37 |
+
display: inline-block;
|
38 |
+
vertical-align: middle;
|
39 |
+
-webkit-transform: perspective(1px) translateZ(0);
|
40 |
+
transform: perspective(1px) translateZ(0);
|
41 |
+
-webkit-transition-duration: 0.3s;
|
42 |
+
-o-transition-duration: 0.3s;
|
43 |
+
transition-duration: 0.3s;
|
44 |
+
-webkit-transition-property: transform;
|
45 |
+
-webkit-transition-property: -webkit-transform;
|
46 |
+
transition-property: -webkit-transform;
|
47 |
+
-o-transition-property: transform;
|
48 |
+
transition-property: transform;
|
49 |
+
transition-property: transform, -webkit-transform;
|
50 |
+
}
|
51 |
+
.elementor-animation-backward:hover, .elementor-animation-backward:focus, .elementor-animation-backward:active {
|
52 |
+
-webkit-transform: translateX(-8px);
|
53 |
+
-ms-transform: translateX(-8px);
|
54 |
+
transform: translateX(-8px);
|
55 |
+
}
|
56 |
+
|
57 |
+
/* BACKGROUND TRANSITIONS */
|
58 |
+
/* Back Pulse */
|
59 |
+
@-webkit-keyframes wpr-button-back-pulse {
|
60 |
+
50% {
|
61 |
+
opacity: 0.5;
|
62 |
+
}
|
63 |
+
}
|
64 |
+
@keyframes wpr-button-back-pulse {
|
65 |
+
50% {
|
66 |
+
opacity: 0.5;
|
67 |
+
}
|
68 |
+
}
|
69 |
+
|
70 |
+
.wpr-button-back-pulse:before {
|
71 |
+
content: "";
|
72 |
+
width: 100%;
|
73 |
+
height: 100%;
|
74 |
+
position: absolute;
|
75 |
+
top: 0;
|
76 |
+
left: 0;
|
77 |
+
opacity: 0;
|
78 |
+
z-index: -1;
|
79 |
+
}
|
80 |
+
|
81 |
+
.wpr-button-back-pulse:hover:before {
|
82 |
+
opacity: 1;
|
83 |
+
-webkit-animation-name: wpr-button-back-pulse;
|
84 |
+
animation-name: wpr-button-back-pulse;
|
85 |
+
-webkit-animation-duration: 1s;
|
86 |
+
animation-duration: 1s;
|
87 |
+
-webkit-animation-delay: 0.5s;
|
88 |
+
animation-delay: 0.5s;
|
89 |
+
-webkit-animation-timing-function: linear;
|
90 |
+
animation-timing-function: linear;
|
91 |
+
-webkit-animation-iteration-count: infinite;
|
92 |
+
animation-iteration-count: infinite;
|
93 |
+
}
|
94 |
+
|
95 |
+
/* Sweep To Right */
|
96 |
+
.wpr-button-sweep-to-right {
|
97 |
+
display: inline-block;
|
98 |
+
vertical-align: middle;
|
99 |
+
-webkit-transform: perspective(1px) translateZ(0);
|
100 |
+
transform: perspective(1px) translateZ(0);
|
101 |
+
position: relative;
|
102 |
+
-webkit-transition-property: color;
|
103 |
+
-o-transition-property: color;
|
104 |
+
transition-property: color;
|
105 |
+
-webkit-transition-duration: 0.3s;
|
106 |
+
-o-transition-duration: 0.3s;
|
107 |
+
transition-duration: 0.3s;
|
108 |
+
}
|
109 |
+
.wpr-button-sweep-to-right:before {
|
110 |
+
content: "";
|
111 |
+
position: absolute;
|
112 |
+
z-index: -1;
|
113 |
+
top: 0;
|
114 |
+
left: 0;
|
115 |
+
right: 0;
|
116 |
+
bottom: 0;
|
117 |
+
-webkit-transform: scaleX(0);
|
118 |
+
-ms-transform: scaleX(0);
|
119 |
+
transform: scaleX(0);
|
120 |
+
-webkit-transform-origin: 0 50%;
|
121 |
+
-ms-transform-origin: 0 50%;
|
122 |
+
transform-origin: 0 50%;
|
123 |
+
-webkit-transition-property: transform;
|
124 |
+
-webkit-transition-property: -webkit-transform;
|
125 |
+
transition-property: -webkit-transform;
|
126 |
+
-o-transition-property: transform;
|
127 |
+
transition-property: transform;
|
128 |
+
transition-property: transform, -webkit-transform;
|
129 |
+
-webkit-transition-duration: 0.3s;
|
130 |
+
-o-transition-duration: 0.3s;
|
131 |
+
transition-duration: 0.3s;
|
132 |
+
-webkit-transition-timing-function: ease-out;
|
133 |
+
-o-transition-timing-function: ease-out;
|
134 |
+
transition-timing-function: ease-out;
|
135 |
+
}
|
136 |
+
.wpr-button-sweep-to-right:hover:before, .wpr-button-sweep-to-right:focus:before, .wpr-button-sweep-to-right:active:before {
|
137 |
+
-webkit-transform: scaleX(1);
|
138 |
+
-ms-transform: scaleX(1);
|
139 |
+
transform: scaleX(1);
|
140 |
+
}
|
141 |
+
|
142 |
+
/* Sweep To Left */
|
143 |
+
.wpr-button-sweep-to-left {
|
144 |
+
display: inline-block;
|
145 |
+
vertical-align: middle;
|
146 |
+
-webkit-transform: perspective(1px) translateZ(0);
|
147 |
+
transform: perspective(1px) translateZ(0);
|
148 |
+
position: relative;
|
149 |
+
-webkit-transition-property: color;
|
150 |
+
-o-transition-property: color;
|
151 |
+
transition-property: color;
|
152 |
+
-webkit-transition-duration: 0.3s;
|
153 |
+
-o-transition-duration: 0.3s;
|
154 |
+
transition-duration: 0.3s;
|
155 |
+
}
|
156 |
+
.wpr-button-sweep-to-left:before {
|
157 |
+
content: "";
|
158 |
+
position: absolute;
|
159 |
+
z-index: -1;
|
160 |
+
top: 0;
|
161 |
+
left: 0;
|
162 |
+
right: 0;
|
163 |
+
bottom: 0;
|
164 |
+
-webkit-transform: scaleX(0);
|
165 |
+
-ms-transform: scaleX(0);
|
166 |
+
transform: scaleX(0);
|
167 |
+
-webkit-transform-origin: 100% 50%;
|
168 |
+
-ms-transform-origin: 100% 50%;
|
169 |
+
transform-origin: 100% 50%;
|
170 |
+
-webkit-transition-property: transform;
|
171 |
+
-webkit-transition-property: -webkit-transform;
|
172 |
+
transition-property: -webkit-transform;
|
173 |
+
-o-transition-property: transform;
|
174 |
+
transition-property: transform;
|
175 |
+
transition-property: transform, -webkit-transform;
|
176 |
+
-webkit-transition-duration: 0.3s;
|
177 |
+
-o-transition-duration: 0.3s;
|
178 |
+
transition-duration: 0.3s;
|
179 |
+
-webkit-transition-timing-function: ease-out;
|
180 |
+
-o-transition-timing-function: ease-out;
|
181 |
+
transition-timing-function: ease-out;
|
182 |
+
}
|
183 |
+
.wpr-button-sweep-to-left:hover:before, .wpr-button-sweep-to-left:focus:before, .wpr-button-sweep-to-left:active:before {
|
184 |
+
-webkit-transform: scaleX(1);
|
185 |
+
-ms-transform: scaleX(1);
|
186 |
+
transform: scaleX(1);
|
187 |
+
}
|
188 |
+
|
189 |
+
/* Sweep To Bottom */
|
190 |
+
.wpr-button-sweep-to-bottom {
|
191 |
+
display: inline-block;
|
192 |
+
vertical-align: middle;
|
193 |
+
-webkit-transform: perspective(1px) translateZ(0);
|
194 |
+
transform: perspective(1px) translateZ(0);
|
195 |
+
position: relative;
|
196 |
+
-webkit-transition-property: color;
|
197 |
+
-o-transition-property: color;
|
198 |
+
transition-property: color;
|
199 |
+
-webkit-transition-duration: 0.3s;
|
200 |
+
-o-transition-duration: 0.3s;
|
201 |
+
transition-duration: 0.3s;
|
202 |
+
}
|
203 |
+
.wpr-button-sweep-to-bottom:before {
|
204 |
+
content: "";
|
205 |
+
position: absolute;
|
206 |
+
z-index: -1;
|
207 |
+
top: 0;
|
208 |
+
left: 0;
|
209 |
+
right: 0;
|
210 |
+
bottom: 0;
|
211 |
+
-webkit-transform: scaleY(0);
|
212 |
+
-ms-transform: scaleY(0);
|
213 |
+
transform: scaleY(0);
|
214 |
+
-webkit-transform-origin: 50% 0;
|
215 |
+
-ms-transform-origin: 50% 0;
|
216 |
+
transform-origin: 50% 0;
|
217 |
+
-webkit-transition-property: transform;
|
218 |
+
-webkit-transition-property: -webkit-transform;
|
219 |
+
transition-property: -webkit-transform;
|
220 |
+
-o-transition-property: transform;
|
221 |
+
transition-property: transform;
|
222 |
+
transition-property: transform, -webkit-transform;
|
223 |
+
-webkit-transition-duration: 0.3s;
|
224 |
+
-o-transition-duration: 0.3s;
|
225 |
+
transition-duration: 0.3s;
|
226 |
+
-webkit-transition-timing-function: ease-out;
|
227 |
+
-o-transition-timing-function: ease-out;
|
228 |
+
transition-timing-function: ease-out;
|
229 |
+
}
|
230 |
+
.wpr-button-sweep-to-bottom:hover:before, .wpr-button-sweep-to-bottom:focus:before, .wpr-button-sweep-to-bottom:active:before {
|
231 |
+
-webkit-transform: scaleY(1);
|
232 |
+
-ms-transform: scaleY(1);
|
233 |
+
transform: scaleY(1);
|
234 |
+
}
|
235 |
+
|
236 |
+
/* Sweep To Top */
|
237 |
+
.wpr-button-sweep-to-top {
|
238 |
+
display: inline-block;
|
239 |
+
vertical-align: middle;
|
240 |
+
-webkit-transform: perspective(1px) translateZ(0);
|
241 |
+
transform: perspective(1px) translateZ(0);
|
242 |
+
position: relative;
|
243 |
+
-webkit-transition-property: color;
|
244 |
+
-o-transition-property: color;
|
245 |
+
transition-property: color;
|
246 |
+
-webkit-transition-duration: 0.3s;
|
247 |
+
-o-transition-duration: 0.3s;
|
248 |
+
transition-duration: 0.3s;
|
249 |
+
}
|
250 |
+
.wpr-button-sweep-to-top:before {
|
251 |
+
content: "";
|
252 |
+
position: absolute;
|
253 |
+
z-index: -1;
|
254 |
+
top: 0;
|
255 |
+
left: 0;
|
256 |
+
right: 0;
|
257 |
+
bottom: 0;
|
258 |
+
-webkit-transform: scaleY(0);
|
259 |
+
-ms-transform: scaleY(0);
|
260 |
+
transform: scaleY(0);
|
261 |
+
-webkit-transform-origin: 50% 100%;
|
262 |
+
-ms-transform-origin: 50% 100%;
|
263 |
+
transform-origin: 50% 100%;
|
264 |
+
-webkit-transition-property: transform;
|
265 |
+
-webkit-transition-property: -webkit-transform;
|
266 |
+
transition-property: -webkit-transform;
|
267 |
+
-o-transition-property: transform;
|
268 |
+
transition-property: transform;
|
269 |
+
transition-property: transform, -webkit-transform;
|
270 |
+
-webkit-transition-duration: 0.3s;
|
271 |
+
-o-transition-duration: 0.3s;
|
272 |
+
transition-duration: 0.3s;
|
273 |
+
-webkit-transition-timing-function: ease-out;
|
274 |
+
-o-transition-timing-function: ease-out;
|
275 |
+
transition-timing-function: ease-out;
|
276 |
+
}
|
277 |
+
.wpr-button-sweep-to-top:hover:before, .wpr-button-sweep-to-top:focus:before, .wpr-button-sweep-to-top:active:before {
|
278 |
+
-webkit-transform: scaleY(1);
|
279 |
+
-ms-transform: scaleY(1);
|
280 |
+
transform: scaleY(1);
|
281 |
+
}
|
282 |
+
|
283 |
+
/* Bounce To Right */
|
284 |
+
.wpr-button-bounce-to-right {
|
285 |
+
display: inline-block;
|
286 |
+
vertical-align: middle;
|
287 |
+
-webkit-transform: perspective(1px) translateZ(0);
|
288 |
+
transform: perspective(1px) translateZ(0);
|
289 |
+
position: relative;
|
290 |
+
-webkit-transition-property: color;
|
291 |
+
-o-transition-property: color;
|
292 |
+
transition-property: color;
|
293 |
+
-webkit-transition-duration: 0.5s;
|
294 |
+
-o-transition-duration: 0.5s;
|
295 |
+
transition-duration: 0.5s;
|
296 |
+
}
|
297 |
+
.wpr-button-bounce-to-right:before {
|
298 |
+
content: "";
|
299 |
+
position: absolute;
|
300 |
+
z-index: -1;
|
301 |
+
top: 0;
|
302 |
+
left: 0;
|
303 |
+
right: 0;
|
304 |
+
bottom: 0;
|
305 |
+
-webkit-transform: scaleX(0);
|
306 |
+
-ms-transform: scaleX(0);
|
307 |
+
transform: scaleX(0);
|
308 |
+
-webkit-transform-origin: 0 50%;
|
309 |
+
-ms-transform-origin: 0 50%;
|
310 |
+
transform-origin: 0 50%;
|
311 |
+
-webkit-transition-property: transform;
|
312 |
+
-webkit-transition-property: -webkit-transform;
|
313 |
+
transition-property: -webkit-transform;
|
314 |
+
-o-transition-property: transform;
|
315 |
+
transition-property: transform;
|
316 |
+
transition-property: transform, -webkit-transform;
|
317 |
+
-webkit-transition-duration: 0.5s;
|
318 |
+
-o-transition-duration: 0.5s;
|
319 |
+
transition-duration: 0.5s;
|
320 |
+
-webkit-transition-timing-function: ease-out;
|
321 |
+
-o-transition-timing-function: ease-out;
|
322 |
+
transition-timing-function: ease-out;
|
323 |
+
}
|
324 |
+
|
325 |
+
.wpr-button-bounce-to-right:hover:before, .wpr-button-bounce-to-right:focus:before, .wpr-button-bounce-to-right:active:before {
|
326 |
+
-webkit-transform: scaleX(1);
|
327 |
+
-ms-transform: scaleX(1);
|
328 |
+
transform: scaleX(1);
|
329 |
+
-webkit-transition-timing-function: cubic-bezier(0.52, 1.64, 0.37, 0.66);
|
330 |
+
-o-transition-timing-function: cubic-bezier(0.52, 1.64, 0.37, 0.66);
|
331 |
+
transition-timing-function: cubic-bezier(0.52, 1.64, 0.37, 0.66);
|
332 |
+
}
|
333 |
+
|
334 |
+
/* Bounce To Left */
|
335 |
+
.wpr-button-bounce-to-left {
|
336 |
+
display: inline-block;
|
337 |
+
vertical-align: middle;
|
338 |
+
-webkit-transform: perspective(1px) translateZ(0);
|
339 |
+
transform: perspective(1px) translateZ(0);
|
340 |
+
position: relative;
|
341 |
+
-webkit-transition-property: color;
|
342 |
+
-o-transition-property: color;
|
343 |
+
transition-property: color;
|
344 |
+
-webkit-transition-duration: 0.5s;
|
345 |
+
-o-transition-duration: 0.5s;
|
346 |
+
transition-duration: 0.5s;
|
347 |
+
}
|
348 |
+
.wpr-button-bounce-to-left:before {
|
349 |
+
content: "";
|
350 |
+
position: absolute;
|
351 |
+
z-index: -1;
|
352 |
+
top: 0;
|
353 |
+
left: 0;
|
354 |
+
right: 0;
|
355 |
+
bottom: 0;
|
356 |
+
-webkit-transform: scaleX(0);
|
357 |
+
-ms-transform: scaleX(0);
|
358 |
+
transform: scaleX(0);
|
359 |
+
-webkit-transform-origin: 100% 50%;
|
360 |
+
-ms-transform-origin: 100% 50%;
|
361 |
+
transform-origin: 100% 50%;
|
362 |
+
-webkit-transition-property: transform;
|
363 |
+
-webkit-transition-property: -webkit-transform;
|
364 |
+
transition-property: -webkit-transform;
|
365 |
+
-o-transition-property: transform;
|
366 |
+
transition-property: transform;
|
367 |
+
transition-property: transform, -webkit-transform;
|
368 |
+
-webkit-transition-duration: 0.5s;
|
369 |
+
-o-transition-duration: 0.5s;
|
370 |
+
transition-duration: 0.5s;
|
371 |
+
-webkit-transition-timing-function: ease-out;
|
372 |
+
-o-transition-timing-function: ease-out;
|
373 |
+
transition-timing-function: ease-out;
|
374 |
+
}
|
375 |
+
.wpr-button-bounce-to-left:hover:before, .wpr-button-bounce-to-left:focus:before, .wpr-button-bounce-to-left:active:before {
|
376 |
+
-webkit-transform: scaleX(1);
|
377 |
+
-ms-transform: scaleX(1);
|
378 |
+
transform: scaleX(1);
|
379 |
+
-webkit-transition-timing-function: cubic-bezier(0.52, 1.64, 0.37, 0.66);
|
380 |
+
-o-transition-timing-function: cubic-bezier(0.52, 1.64, 0.37, 0.66);
|
381 |
+
transition-timing-function: cubic-bezier(0.52, 1.64, 0.37, 0.66);
|
382 |
+
}
|
383 |
+
|
384 |
+
/* Bounce To Bottom */
|
385 |
+
.wpr-button-bounce-to-bottom {
|
386 |
+
display: inline-block;
|
387 |
+
vertical-align: middle;
|
388 |
+
-webkit-transform: perspective(1px) translateZ(0);
|
389 |
+
transform: perspective(1px) translateZ(0);
|
390 |
+
position: relative;
|
391 |
+
-webkit-transition-property: color;
|
392 |
+
-o-transition-property: color;
|
393 |
+
transition-property: color;
|
394 |
+
-webkit-transition-duration: 0.5s;
|
395 |
+
-o-transition-duration: 0.5s;
|
396 |
+
transition-duration: 0.5s;
|
397 |
+
}
|
398 |
+
.wpr-button-bounce-to-bottom:before {
|
399 |
+
content: "";
|
400 |
+
position: absolute;
|
401 |
+
z-index: -1;
|
402 |
+
top: 0;
|
403 |
+
left: 0;
|
404 |
+
right: 0;
|
405 |
+
bottom: 0;
|
406 |
+
-webkit-transform: scaleY(0);
|
407 |
+
-ms-transform: scaleY(0);
|
408 |
+
transform: scaleY(0);
|
409 |
+
-webkit-transform-origin: 50% 0;
|
410 |
+
-ms-transform-origin: 50% 0;
|
411 |
+
transform-origin: 50% 0;
|
412 |
+
-webkit-transition-property: transform;
|
413 |
+
-webkit-transition-property: -webkit-transform;
|
414 |
+
transition-property: -webkit-transform;
|
415 |
+
-o-transition-property: transform;
|
416 |
+
transition-property: transform;
|
417 |
+
transition-property: transform, -webkit-transform;
|
418 |
+
-webkit-transition-duration: 0.5s;
|
419 |
+
-o-transition-duration: 0.5s;
|
420 |
+
transition-duration: 0.5s;
|
421 |
+
-webkit-transition-timing-function: ease-out;
|
422 |
+
-o-transition-timing-function: ease-out;
|
423 |
+
transition-timing-function: ease-out;
|
424 |
+
}
|
425 |
+
.wpr-button-bounce-to-bottom:hover:before, .wpr-button-bounce-to-bottom:focus:before, .wpr-button-bounce-to-bottom:active:before {
|
426 |
+
-webkit-transform: scaleY(1);
|
427 |
+
-ms-transform: scaleY(1);
|
428 |
+
transform: scaleY(1);
|
429 |
+
-webkit-transition-timing-function: cubic-bezier(0.52, 1.64, 0.37, 0.66);
|
430 |
+
-o-transition-timing-function: cubic-bezier(0.52, 1.64, 0.37, 0.66);
|
431 |
+
transition-timing-function: cubic-bezier(0.52, 1.64, 0.37, 0.66);
|
432 |
+
}
|
433 |
+
|
434 |
+
/* Bounce To Top */
|
435 |
+
.wpr-button-bounce-to-top {
|
436 |
+
display: inline-block;
|
437 |
+
vertical-align: middle;
|
438 |
+
-webkit-transform: perspective(1px) translateZ(0);
|
439 |
+
transform: perspective(1px) translateZ(0);
|
440 |
+
position: relative;
|
441 |
+
-webkit-transition-property: color;
|
442 |
+
-o-transition-property: color;
|
443 |
+
transition-property: color;
|
444 |
+
-webkit-transition-duration: 0.5s;
|
445 |
+
-o-transition-duration: 0.5s;
|
446 |
+
transition-duration: 0.5s;
|
447 |
+
}
|
448 |
+
.wpr-button-bounce-to-top:before {
|
449 |
+
content: "";
|
450 |
+
position: absolute;
|
451 |
+
z-index: -1;
|
452 |
+
top: 0;
|
453 |
+
left: 0;
|
454 |
+
right: 0;
|
455 |
+
bottom: 0;
|
456 |
+
-webkit-transform: scaleY(0);
|
457 |
+
-ms-transform: scaleY(0);
|
458 |
+
transform: scaleY(0);
|
459 |
+
-webkit-transform-origin: 50% 100%;
|
460 |
+
-ms-transform-origin: 50% 100%;
|
461 |
+
transform-origin: 50% 100%;
|
462 |
+
-webkit-transition-property: transform;
|
463 |
+
-webkit-transition-property: -webkit-transform;
|
464 |
+
transition-property: -webkit-transform;
|
465 |
+
-o-transition-property: transform;
|
466 |
+
transition-property: transform;
|
467 |
+
transition-property: transform, -webkit-transform;
|
468 |
+
-webkit-transition-duration: 0.5s;
|
469 |
+
-o-transition-duration: 0.5s;
|
470 |
+
transition-duration: 0.5s;
|
471 |
+
-webkit-transition-timing-function: ease-out;
|
472 |
+
-o-transition-timing-function: ease-out;
|
473 |
+
transition-timing-function: ease-out;
|
474 |
+
}
|
475 |
+
.wpr-button-bounce-to-top:hover, .wpr-button-bounce-to-top:focus, .wpr-button-bounce-to-top:active {
|
476 |
+
color: white;
|
477 |
+
}
|
478 |
+
.wpr-button-bounce-to-top:hover:before, .wpr-button-bounce-to-top:focus:before, .wpr-button-bounce-to-top:active:before {
|
479 |
+
-webkit-transform: scaleY(1);
|
480 |
+
-ms-transform: scaleY(1);
|
481 |
+
transform: scaleY(1);
|
482 |
+
-webkit-transition-timing-function: cubic-bezier(0.52, 1.64, 0.37, 0.66);
|
483 |
+
-o-transition-timing-function: cubic-bezier(0.52, 1.64, 0.37, 0.66);
|
484 |
+
transition-timing-function: cubic-bezier(0.52, 1.64, 0.37, 0.66);
|
485 |
+
}
|
486 |
+
|
487 |
+
/* Radial Out */
|
488 |
+
.wpr-button-radial-out {
|
489 |
+
display: inline-block;
|
490 |
+
vertical-align: middle;
|
491 |
+
-webkit-transform: perspective(1px) translateZ(0);
|
492 |
+
transform: perspective(1px) translateZ(0);
|
493 |
+
position: relative;
|
494 |
+
overflow: hidden;
|
495 |
+
-webkit-transition-property: color;
|
496 |
+
-o-transition-property: color;
|
497 |
+
transition-property: color;
|
498 |
+
-webkit-transition-duration: 0.3s;
|
499 |
+
-o-transition-duration: 0.3s;
|
500 |
+
transition-duration: 0.3s;
|
501 |
+
}
|
502 |
+
.wpr-button-radial-out:before {
|
503 |
+
content: "";
|
504 |
+
position: absolute;
|
505 |
+
z-index: -1;
|
506 |
+
top: 0;
|
507 |
+
left: 0;
|
508 |
+
right: 0;
|
509 |
+
bottom: 0;
|
510 |
+
border-radius: 100%;
|
511 |
+
-webkit-transform: scale(0);
|
512 |
+
-ms-transform: scale(0);
|
513 |
+
transform: scale(0);
|
514 |
+
-webkit-transition-property: transform;
|
515 |
+
-webkit-transition-property: -webkit-transform;
|
516 |
+
transition-property: -webkit-transform;
|
517 |
+
-o-transition-property: transform;
|
518 |
+
transition-property: transform;
|
519 |
+
transition-property: transform, -webkit-transform;
|
520 |
+
-webkit-transition-duration: 0.3s;
|
521 |
+
-o-transition-duration: 0.3s;
|
522 |
+
transition-duration: 0.3s;
|
523 |
+
-webkit-transition-timing-function: ease-out;
|
524 |
+
-o-transition-timing-function: ease-out;
|
525 |
+
transition-timing-function: ease-out;
|
526 |
+
}
|
527 |
+
.wpr-button-radial-out:hover, .wpr-button-radial-out:focus, .wpr-button-radial-out:active {
|
528 |
+
color: white;
|
529 |
+
}
|
530 |
+
.wpr-button-radial-out:hover:before, .wpr-button-radial-out:focus:before, .wpr-button-radial-out:active:before {
|
531 |
+
-webkit-transform: scale(2);
|
532 |
+
-ms-transform: scale(2);
|
533 |
+
transform: scale(2);
|
534 |
+
}
|
535 |
+
|
536 |
+
/* Radial In */
|
537 |
+
.wpr-button-radial-in {
|
538 |
+
display: inline-block;
|
539 |
+
vertical-align: middle;
|
540 |
+
-webkit-transform: perspective(1px) translateZ(0);
|
541 |
+
transform: perspective(1px) translateZ(0);
|
542 |
+
position: relative;
|
543 |
+
overflow: hidden;
|
544 |
+
-webkit-transition-property: color;
|
545 |
+
-o-transition-property: color;
|
546 |
+
transition-property: color;
|
547 |
+
-webkit-transition-duration: 0.3s;
|
548 |
+
-o-transition-duration: 0.3s;
|
549 |
+
transition-duration: 0.3s;
|
550 |
+
}
|
551 |
+
.wpr-button-radial-in:before {
|
552 |
+
content: "";
|
553 |
+
position: absolute;
|
554 |
+
z-index: -1;
|
555 |
+
top: 0;
|
556 |
+
left: 0;
|
557 |
+
right: 0;
|
558 |
+
bottom: 0;
|
559 |
+
border-radius: 100%;
|
560 |
+
-webkit-transform: scale(2);
|
561 |
+
-ms-transform: scale(2);
|
562 |
+
transform: scale(2);
|
563 |
+
-webkit-transition-property: transform;
|
564 |
+
-webkit-transition-property: -webkit-transform;
|
565 |
+
transition-property: -webkit-transform;
|
566 |
+
-o-transition-property: transform;
|
567 |
+
transition-property: transform;
|
568 |
+
transition-property: transform, -webkit-transform;
|
569 |
+
-webkit-transition-duration: 0.3s;
|
570 |
+
-o-transition-duration: 0.3s;
|
571 |
+
transition-duration: 0.3s;
|
572 |
+
-webkit-transition-timing-function: ease-out;
|
573 |
+
-o-transition-timing-function: ease-out;
|
574 |
+
transition-timing-function: ease-out;
|
575 |
+
}
|
576 |
+
.wpr-button-radial-in:hover, .wpr-button-radial-in:focus, .wpr-button-radial-in:active {
|
577 |
+
color: white;
|
578 |
+
}
|
579 |
+
.wpr-button-radial-in:hover:before, .wpr-button-radial-in:focus:before, .wpr-button-radial-in:active:before {
|
580 |
+
-webkit-transform: scale(0);
|
581 |
+
-ms-transform: scale(0);
|
582 |
+
transform: scale(0);
|
583 |
+
}
|
584 |
+
|
585 |
+
/* Rectangle In */
|
586 |
+
.wpr-button-rectangle-in {
|
587 |
+
display: inline-block;
|
588 |
+
vertical-align: middle;
|
589 |
+
-webkit-transform: perspective(1px) translateZ(0);
|
590 |
+
transform: perspective(1px) translateZ(0);
|
591 |
+
position: relative;
|
592 |
+
-webkit-transition-property: color;
|
593 |
+
-o-transition-property: color;
|
594 |
+
transition-property: color;
|
595 |
+
-webkit-transition-duration: 0.3s;
|
596 |
+
-o-transition-duration: 0.3s;
|
597 |
+
transition-duration: 0.3s;
|
598 |
+
}
|
599 |
+
.wpr-button-rectangle-in:before {
|
600 |
+
content: "";
|
601 |
+
position: absolute;
|
602 |
+
z-index: -1;
|
603 |
+
top: 0;
|
604 |
+
left: 0;
|
605 |
+
right: 0;
|
606 |
+
bottom: 0;
|
607 |
+
-webkit-transform: scale(1);
|
608 |
+
-ms-transform: scale(1);
|
609 |
+
transform: scale(1);
|
610 |
+
-webkit-transition-property: transform;
|
611 |
+
-webkit-transition-property: -webkit-transform;
|
612 |
+
transition-property: -webkit-transform;
|
613 |
+
-o-transition-property: transform;
|
614 |
+
transition-property: transform;
|
615 |
+
transition-property: transform, -webkit-transform;
|
616 |
+
-webkit-transition-duration: 0.3s;
|
617 |
+
-o-transition-duration: 0.3s;
|
618 |
+
transition-duration: 0.3s;
|
619 |
+
-webkit-transition-timing-function: ease-out;
|
620 |
+
-o-transition-timing-function: ease-out;
|
621 |
+
transition-timing-function: ease-out;
|
622 |
+
}
|
623 |
+
.wpr-button-rectangle-in:hover:before, .wpr-button-rectangle-in:focus:before, .wpr-button-rectangle-in:active:before {
|
624 |
+
-webkit-transform: scale(0);
|
625 |
+
-ms-transform: scale(0);
|
626 |
+
transform: scale(0);
|
627 |
+
}
|
628 |
+
|
629 |
+
/* Rectangle Out */
|
630 |
+
.wpr-button-rectangle-out {
|
631 |
+
display: inline-block;
|
632 |
+
vertical-align: middle;
|
633 |
+
-webkit-transform: perspective(1px) translateZ(0);
|
634 |
+
transform: perspective(1px) translateZ(0);
|
635 |
+
position: relative;
|
636 |
+
-webkit-transition-property: color;
|
637 |
+
-o-transition-property: color;
|
638 |
+
transition-property: color;
|
639 |
+
-webkit-transition-duration: 0.3s;
|
640 |
+
-o-transition-duration: 0.3s;
|
641 |
+
transition-duration: 0.3s;
|
642 |
+
}
|
643 |
+
.wpr-button-rectangle-out:before {
|
644 |
+
content: "";
|
645 |
+
position: absolute;
|
646 |
+
z-index: -1;
|
647 |
+
top: 0;
|
648 |
+
left: 0;
|
649 |
+
right: 0;
|
650 |
+
bottom: 0;
|
651 |
+
-webkit-transform: scale(0);
|
652 |
+
-ms-transform: scale(0);
|
653 |
+
transform: scale(0);
|
654 |
+
-webkit-transition-property: transform;
|
655 |
+
-webkit-transition-property: -webkit-transform;
|
656 |
+
transition-property: -webkit-transform;
|
657 |
+
-o-transition-property: transform;
|
658 |
+
transition-property: transform;
|
659 |
+
transition-property: transform, -webkit-transform;
|
660 |
+
-webkit-transition-duration: 0.3s;
|
661 |
+
-o-transition-duration: 0.3s;
|
662 |
+
transition-duration: 0.3s;
|
663 |
+
-webkit-transition-timing-function: ease-out;
|
664 |
+
-o-transition-timing-function: ease-out;
|
665 |
+
transition-timing-function: ease-out;
|
666 |
+
}
|
667 |
+
.wpr-button-rectangle-out:hover:before, .wpr-button-rectangle-out:focus:before, .wpr-button-rectangle-out:active:before {
|
668 |
+
-webkit-transform: scale(1);
|
669 |
+
-ms-transform: scale(1);
|
670 |
+
transform: scale(1);
|
671 |
+
}
|
672 |
+
|
673 |
+
/* Shutter In Horizontal */
|
674 |
+
.wpr-button-shutter-in-horizontal {
|
675 |
+
display: inline-block;
|
676 |
+
vertical-align: middle;
|
677 |
+
-webkit-transform: perspective(1px) translateZ(0);
|
678 |
+
transform: perspective(1px) translateZ(0);
|
679 |
+
position: relative;
|
680 |
+
-webkit-transition-property: color;
|
681 |
+
-o-transition-property: color;
|
682 |
+
transition-property: color;
|
683 |
+
-webkit-transition-duration: 0.3s;
|
684 |
+
-o-transition-duration: 0.3s;
|
685 |
+
transition-duration: 0.3s;
|
686 |
+
}
|
687 |
+
.wpr-button-shutter-in-horizontal:before {
|
688 |
+
content: "";
|
689 |
+
position: absolute;
|
690 |
+
z-index: -1;
|
691 |
+
top: 0;
|
692 |
+
bottom: 0;
|
693 |
+
left: 0;
|
694 |
+
right: 0;
|
695 |
+
-webkit-transform: scaleX(1);
|
696 |
+
-ms-transform: scaleX(1);
|
697 |
+
transform: scaleX(1);
|
698 |
+
-webkit-transform-origin: 50%;
|
699 |
+
-ms-transform-origin: 50%;
|
700 |
+
transform-origin: 50%;
|
701 |
+
-webkit-transition-property: transform;
|
702 |
+
-webkit-transition-property: -webkit-transform;
|
703 |
+
transition-property: -webkit-transform;
|
704 |
+
-o-transition-property: transform;
|
705 |
+
transition-property: transform;
|
706 |
+
transition-property: transform, -webkit-transform;
|
707 |
+
-webkit-transition-duration: 0.3s;
|
708 |
+
-o-transition-duration: 0.3s;
|
709 |
+
transition-duration: 0.3s;
|
710 |
+
-webkit-transition-timing-function: ease-out;
|
711 |
+
-o-transition-timing-function: ease-out;
|
712 |
+
transition-timing-function: ease-out;
|
713 |
+
}
|
714 |
+
.wpr-button-shutter-in-horizontal:hover:before, .wpr-button-shutter-in-horizontal:focus:before, .wpr-button-shutter-in-horizontal:active:before {
|
715 |
+
-webkit-transform: scaleX(0);
|
716 |
+
-ms-transform: scaleX(0);
|
717 |
+
transform: scaleX(0);
|
718 |
+
}
|
719 |
+
|
720 |
+
/* Shutter Out Horizontal */
|
721 |
+
.wpr-button-shutter-out-horizontal {
|
722 |
+
display: inline-block;
|
723 |
+
vertical-align: middle;
|
724 |
+
-webkit-transform: perspective(1px) translateZ(0);
|
725 |
+
transform: perspective(1px) translateZ(0);
|
726 |
+
position: relative;
|
727 |
+
-webkit-transition-property: color;
|
728 |
+
-o-transition-property: color;
|
729 |
+
transition-property: color;
|
730 |
+
-webkit-transition-duration: 0.3s;
|
731 |
+
-o-transition-duration: 0.3s;
|
732 |
+
transition-duration: 0.3s;
|
733 |
+
}
|
734 |
+
.wpr-button-shutter-out-horizontal:before {
|
735 |
+
content: "";
|
736 |
+
position: absolute;
|
737 |
+
z-index: -1;
|
738 |
+
top: 0;
|
739 |
+
bottom: 0;
|
740 |
+
left: 0;
|
741 |
+
right: 0;
|
742 |
+
-webkit-transform: scaleX(0);
|
743 |
+
-ms-transform: scaleX(0);
|
744 |
+
transform: scaleX(0);
|
745 |
+
-webkit-transform-origin: 50%;
|
746 |
+
-ms-transform-origin: 50%;
|
747 |
+
transform-origin: 50%;
|
748 |
+
-webkit-transition-property: transform;
|
749 |
+
-webkit-transition-property: -webkit-transform;
|
750 |
+
transition-property: -webkit-transform;
|
751 |
+
-o-transition-property: transform;
|
752 |
+
transition-property: transform;
|
753 |
+
transition-property: transform, -webkit-transform;
|
754 |
+
-webkit-transition-duration: 0.3s;
|
755 |
+
-o-transition-duration: 0.3s;
|
756 |
+
transition-duration: 0.3s;
|
757 |
+
-webkit-transition-timing-function: ease-out;
|
758 |
+
-o-transition-timing-function: ease-out;
|
759 |
+
transition-timing-function: ease-out;
|
760 |
+
}
|
761 |
+
.wpr-button-shutter-out-horizontal:hover:before, .wpr-button-shutter-out-horizontal:focus:before, .wpr-button-shutter-out-horizontal:active:before {
|
762 |
+
-webkit-transform: scaleX(1);
|
763 |
+
-ms-transform: scaleX(1);
|
764 |
+
transform: scaleX(1);
|
765 |
+
}
|
766 |
+
|
767 |
+
/* Shutter In Vertical */
|
768 |
+
.wpr-button-shutter-in-vertical {
|
769 |
+
display: inline-block;
|
770 |
+
vertical-align: middle;
|
771 |
+
-webkit-transform: perspective(1px) translateZ(0);
|
772 |
+
transform: perspective(1px) translateZ(0);
|
773 |
+
position: relative;
|
774 |
+
-webkit-transition-property: color;
|
775 |
+
-o-transition-property: color;
|
776 |
+
transition-property: color;
|
777 |
+
-webkit-transition-duration: 0.3s;
|
778 |
+
-o-transition-duration: 0.3s;
|
779 |
+
transition-duration: 0.3s;
|
780 |
+
}
|
781 |
+
.wpr-button-shutter-in-vertical:before {
|
782 |
+
content: "";
|
783 |
+
position: absolute;
|
784 |
+
z-index: -1;
|
785 |
+
top: 0;
|
786 |
+
bottom: 0;
|
787 |
+
left: 0;
|
788 |
+
right: 0;
|
789 |
+
-webkit-transform: scaleY(1);
|
790 |
+
-ms-transform: scaleY(1);
|
791 |
+
transform: scaleY(1);
|
792 |
+
-webkit-transform-origin: 50%;
|
793 |
+
-ms-transform-origin: 50%;
|
794 |
+
transform-origin: 50%;
|
795 |
+
-webkit-transition-property: transform;
|
796 |
+
-webkit-transition-property: -webkit-transform;
|
797 |
+
transition-property: -webkit-transform;
|
798 |
+
-o-transition-property: transform;
|
799 |
+
transition-property: transform;
|
800 |
+
transition-property: transform, -webkit-transform;
|
801 |
+
-webkit-transition-duration: 0.3s;
|
802 |
+
-o-transition-duration: 0.3s;
|
803 |
+
transition-duration: 0.3s;
|
804 |
+
-webkit-transition-timing-function: ease-out;
|
805 |
+
-o-transition-timing-function: ease-out;
|
806 |
+
transition-timing-function: ease-out;
|
807 |
+
}
|
808 |
+
.wpr-button-shutter-in-vertical:hover:before, .wpr-button-shutter-in-vertical:focus:before, .wpr-button-shutter-in-vertical:active:before {
|
809 |
+
-webkit-transform: scaleY(0);
|
810 |
+
-ms-transform: scaleY(0);
|
811 |
+
transform: scaleY(0);
|
812 |
+
}
|
813 |
+
|
814 |
+
/* Shutter Out Vertical */
|
815 |
+
.wpr-button-shutter-out-vertical {
|
816 |
+
display: inline-block;
|
817 |
+
vertical-align: middle;
|
818 |
+
-webkit-transform: perspective(1px) translateZ(0);
|
819 |
+
transform: perspective(1px) translateZ(0);
|
820 |
+
position: relative;
|
821 |
+
-webkit-transition-property: color;
|
822 |
+
-o-transition-property: color;
|
823 |
+
transition-property: color;
|
824 |
+
-webkit-transition-duration: 0.3s;
|
825 |
+
-o-transition-duration: 0.3s;
|
826 |
+
transition-duration: 0.3s;
|
827 |
+
}
|
828 |
+
.wpr-button-shutter-out-vertical:before {
|
829 |
+
content: "";
|
830 |
+
position: absolute;
|
831 |
+
z-index: -1;
|
832 |
+
top: 0;
|
833 |
+
bottom: 0;
|
834 |
+
left: 0;
|
835 |
+
right: 0;
|
836 |
+
-webkit-transform: scaleY(0);
|
837 |
+
-ms-transform: scaleY(0);
|
838 |
+
transform: scaleY(0);
|
839 |
+
-webkit-transform-origin: 50%;
|
840 |
+
-ms-transform-origin: 50%;
|
841 |
+
transform-origin: 50%;
|
842 |
+
-webkit-transition-property: transform;
|
843 |
+
-webkit-transition-property: -webkit-transform;
|
844 |
+
transition-property: -webkit-transform;
|
845 |
+
-o-transition-property: transform;
|
846 |
+
transition-property: transform;
|
847 |
+
transition-property: transform, -webkit-transform;
|
848 |
+
-webkit-transition-duration: 0.3s;
|
849 |
+
-o-transition-duration: 0.3s;
|
850 |
+
transition-duration: 0.3s;
|
851 |
+
-webkit-transition-timing-function: ease-out;
|
852 |
+
-o-transition-timing-function: ease-out;
|
853 |
+
transition-timing-function: ease-out;
|
854 |
+
}
|
855 |
+
|
856 |
+
.wpr-button-shutter-out-vertical:hover:before, .wpr-button-shutter-out-vertical:focus:before, .wpr-button-shutter-out-vertical:active:before {
|
857 |
+
-webkit-transform: scaleY(1);
|
858 |
+
-ms-transform: scaleY(1);
|
859 |
+
transform: scaleY(1);
|
860 |
+
}
|
861 |
+
|
862 |
+
/* BORDER TRANSITIONS */
|
863 |
+
|
864 |
+
/* Underline From Left */
|
865 |
+
.wpr-button-underline-from-left {
|
866 |
+
display: inline-block;
|
867 |
+
vertical-align: middle;
|
868 |
+
-webkit-transform: perspective(1px) translateZ(0);
|
869 |
+
transform: perspective(1px) translateZ(0);
|
870 |
+
position: relative;
|
871 |
+
border: none !important;
|
872 |
+
overflow: hidden;
|
873 |
+
}
|
874 |
+
.wpr-button-underline-from-left:before {
|
875 |
+
content: "";
|
876 |
+
position: absolute;
|
877 |
+
z-index: -1;
|
878 |
+
left: 0;
|
879 |
+
right: 100%;
|
880 |
+
bottom: 0;
|
881 |
+
height: 4px;
|
882 |
+
-webkit-transition-property: right;
|
883 |
+
-o-transition-property: right;
|
884 |
+
transition-property: right;
|
885 |
+
-webkit-transition-duration: 0.3s;
|
886 |
+
-o-transition-duration: 0.3s;
|
887 |
+
transition-duration: 0.3s;
|
888 |
+
-webkit-transition-timing-function: ease-out;
|
889 |
+
-o-transition-timing-function: ease-out;
|
890 |
+
transition-timing-function: ease-out;
|
891 |
+
}
|
892 |
+
.wpr-button-underline-from-left:hover:before, .wpr-button-underline-from-left:focus:before, .wpr-button-underline-from-left:active:before {
|
893 |
+
right: 0;
|
894 |
+
}
|
895 |
+
|
896 |
+
/* Underline From Center */
|
897 |
+
.wpr-button-underline-from-center {
|
898 |
+
display: inline-block;
|
899 |
+
vertical-align: middle;
|
900 |
+
-webkit-transform: perspective(1px) translateZ(0);
|
901 |
+
transform: perspective(1px) translateZ(0);
|
902 |
+
position: relative;
|
903 |
+
border: none !important;
|
904 |
+
overflow: hidden;
|
905 |
+
}
|
906 |
+
.wpr-button-underline-from-center:before {
|
907 |
+
content: "";
|
908 |
+
position: absolute;
|
909 |
+
z-index: -1;
|
910 |
+
left: 51%;
|
911 |
+
right: 51%;
|
912 |
+
bottom: 0;
|
913 |
+
-webkit-transition-property: left, right;
|
914 |
+
-o-transition-property: left, right;
|
915 |
+
transition-property: left, right;
|
916 |
+
-webkit-transition-duration: 0.3s;
|
917 |
+
-o-transition-duration: 0.3s;
|
918 |
+
transition-duration: 0.3s;
|
919 |
+
-webkit-transition-timing-function: ease-out;
|
920 |
+
-o-transition-timing-function: ease-out;
|
921 |
+
transition-timing-function: ease-out;
|
922 |
+
}
|
923 |
+
.wpr-button-underline-from-center:hover:before, .wpr-button-underline-from-center:focus:before, .wpr-button-underline-from-center:active:before {
|
924 |
+
left: 0;
|
925 |
+
right: 0;
|
926 |
+
}
|
927 |
+
|
928 |
+
/* Underline From Right */
|
929 |
+
.wpr-button-underline-from-right {
|
930 |
+
display: inline-block;
|
931 |
+
vertical-align: middle;
|
932 |
+
-webkit-transform: perspective(1px) translateZ(0);
|
933 |
+
transform: perspective(1px) translateZ(0);
|
934 |
+
position: relative;
|
935 |
+
border: none !important;
|
936 |
+
overflow: hidden;
|
937 |
+
}
|
938 |
+
.wpr-button-underline-from-right:before {
|
939 |
+
content: "";
|
940 |
+
position: absolute;
|
941 |
+
z-index: -1;
|
942 |
+
left: 100%;
|
943 |
+
right: 0;
|
944 |
+
bottom: 0;
|
945 |
+
-webkit-transition-property: left;
|
946 |
+
-o-transition-property: left;
|
947 |
+
transition-property: left;
|
948 |
+
-webkit-transition-duration: 0.3s;
|
949 |
+
-o-transition-duration: 0.3s;
|
950 |
+
transition-duration: 0.3s;
|
951 |
+
-webkit-transition-timing-function: ease-out;
|
952 |
+
-o-transition-timing-function: ease-out;
|
953 |
+
transition-timing-function: ease-out;
|
954 |
+
}
|
955 |
+
.wpr-button-underline-from-right:hover:before, .wpr-button-underline-from-right:focus:before, .wpr-button-underline-from-right:active:before {
|
956 |
+
left: 0;
|
957 |
+
}
|
958 |
+
|
959 |
+
/* Overline From Left */
|
960 |
+
.wpr-button-overline-from-left {
|
961 |
+
display: inline-block;
|
962 |
+
vertical-align: middle;
|
963 |
+
-webkit-transform: perspective(1px) translateZ(0);
|
964 |
+
transform: perspective(1px) translateZ(0);
|
965 |
+
position: relative;
|
966 |
+
border: none !important;
|
967 |
+
overflow: hidden;
|
968 |
+
}
|
969 |
+
.wpr-button-overline-from-left:before {
|
970 |
+
content: "";
|
971 |
+
position: absolute;
|
972 |
+
z-index: -1;
|
973 |
+
left: 0;
|
974 |
+
right: 100%;
|
975 |
+
top: 0;
|
976 |
+
-webkit-transition-property: right;
|
977 |
+
-o-transition-property: right;
|
978 |
+
transition-property: right;
|
979 |
+
-webkit-transition-duration: 0.3s;
|
980 |
+
-o-transition-duration: 0.3s;
|
981 |
+
transition-duration: 0.3s;
|
982 |
+
-webkit-transition-timing-function: ease-out;
|
983 |
+
-o-transition-timing-function: ease-out;
|
984 |
+
transition-timing-function: ease-out;
|
985 |
+
}
|
986 |
+
.wpr-button-overline-from-left:hover:before, .wpr-button-overline-from-left:focus:before, .wpr-button-overline-from-left:active:before {
|
987 |
+
right: 0;
|
988 |
+
}
|
989 |
+
|
990 |
+
/* Overline From Center */
|
991 |
+
.wpr-button-overline-from-center {
|
992 |
+
display: inline-block;
|
993 |
+
vertical-align: middle;
|
994 |
+
-webkit-transform: perspective(1px) translateZ(0);
|
995 |
+
transform: perspective(1px) translateZ(0);
|
996 |
+
position: relative;
|
997 |
+
border: none !important;
|
998 |
+
overflow: hidden;
|
999 |
+
}
|
1000 |
+
.wpr-button-overline-from-center:before {
|
1001 |
+
content: "";
|
1002 |
+
position: absolute;
|
1003 |
+
z-index: -1;
|
1004 |
+
left: 51%;
|
1005 |
+
right: 51%;
|
1006 |
+
top: 0;
|
1007 |
+
-webkit-transition-property: left, right;
|
1008 |
+
-o-transition-property: left, right;
|
1009 |
+
transition-property: left, right;
|
1010 |
+
-webkit-transition-duration: 0.3s;
|
1011 |
+
-o-transition-duration: 0.3s;
|
1012 |
+
transition-duration: 0.3s;
|
1013 |
+
-webkit-transition-timing-function: ease-out;
|
1014 |
+
-o-transition-timing-function: ease-out;
|
1015 |
+
transition-timing-function: ease-out;
|
1016 |
+
}
|
1017 |
+
.wpr-button-overline-from-center:hover:before, .wpr-button-overline-from-center:focus:before, .wpr-button-overline-from-center:active:before {
|
1018 |
+
left: 0;
|
1019 |
+
right: 0;
|
1020 |
+
}
|
1021 |
+
|
1022 |
+
/* Overline From Right */
|
1023 |
+
.wpr-button-overline-from-right {
|
1024 |
+
display: inline-block;
|
1025 |
+
vertical-align: middle;
|
1026 |
+
-webkit-transform: perspective(1px) translateZ(0);
|
1027 |
+
transform: perspective(1px) translateZ(0);
|
1028 |
+
position: relative;
|
1029 |
+
border: none !important;
|
1030 |
+
overflow: hidden;
|
1031 |
+
}
|
1032 |
+
.wpr-button-overline-from-right:before {
|
1033 |
+
content: "";
|
1034 |
+
position: absolute;
|
1035 |
+
z-index: -1;
|
1036 |
+
left: 100%;
|
1037 |
+
right: 0;
|
1038 |
+
top: 0;
|
1039 |
+
-webkit-transition-property: left;
|
1040 |
+
-o-transition-property: left;
|
1041 |
+
transition-property: left;
|
1042 |
+
-webkit-transition-duration: 0.3s;
|
1043 |
+
-o-transition-duration: 0.3s;
|
1044 |
+
transition-duration: 0.3s;
|
1045 |
+
-webkit-transition-timing-function: ease-out;
|
1046 |
+
-o-transition-timing-function: ease-out;
|
1047 |
+
transition-timing-function: ease-out;
|
1048 |
+
}
|
1049 |
+
.wpr-button-overline-from-right:hover:before, .wpr-button-overline-from-right:focus:before, .wpr-button-overline-from-right:active:before {
|
1050 |
+
left: 0;
|
1051 |
+
}
|
1052 |
+
|
1053 |
+
/* Underline Reveal */
|
1054 |
+
.wpr-button-underline-reveal {
|
1055 |
+
display: inline-block;
|
1056 |
+
vertical-align: middle;
|
1057 |
+
-webkit-transform: perspective(1px) translateZ(0);
|
1058 |
+
transform: perspective(1px) translateZ(0);
|
1059 |
+
position: relative;
|
1060 |
+
border: none !important;
|
1061 |
+
overflow: hidden;
|
1062 |
+
}
|
1063 |
+
.wpr-button-underline-reveal:before {
|
1064 |
+
content: "";
|
1065 |
+
position: absolute;
|
1066 |
+
z-index: -1;
|
1067 |
+
left: 0;
|
1068 |
+
right: 0;
|
1069 |
+
bottom: 0;
|
1070 |
+
-webkit-transform: translateY(100%);
|
1071 |
+
-ms-transform: translateY(100%);
|
1072 |
+
transform: translateY(100%);
|
1073 |
+
-webkit-transition-property: transform;
|
1074 |
+
-webkit-transition-property: -webkit-transform;
|
1075 |
+
transition-property: -webkit-transform;
|
1076 |
+
-o-transition-property: transform;
|
1077 |
+
transition-property: transform;
|
1078 |
+
transition-property: transform, -webkit-transform;
|
1079 |
+
-webkit-transition-duration: 0.3s;
|
1080 |
+
-o-transition-duration: 0.3s;
|
1081 |
+
transition-duration: 0.3s;
|
1082 |
+
-webkit-transition-timing-function: ease-out;
|
1083 |
+
-o-transition-timing-function: ease-out;
|
1084 |
+
transition-timing-function: ease-out;
|
1085 |
+
}
|
1086 |
+
.wpr-button-underline-reveal:hover:before, .wpr-button-underline-reveal:focus:before, .wpr-button-underline-reveal:active:before {
|
1087 |
+
-webkit-transform: translateY(0);
|
1088 |
+
-ms-transform: translateY(0);
|
1089 |
+
transform: translateY(0);
|
1090 |
+
}
|
1091 |
+
|
1092 |
+
/* Overline Reveal */
|
1093 |
+
.wpr-button-overline-reveal {
|
1094 |
+
display: inline-block;
|
1095 |
+
vertical-align: middle;
|
1096 |
+
-webkit-transform: perspective(1px) translateZ(0);
|
1097 |
+
transform: perspective(1px) translateZ(0);
|
1098 |
+
position: relative;
|
1099 |
+
border: none !important;
|
1100 |
+
overflow: hidden;
|
1101 |
+
}
|
1102 |
+
.wpr-button-overline-reveal:before {
|
1103 |
+
content: "";
|
1104 |
+
position: absolute;
|
1105 |
+
z-index: -1;
|
1106 |
+
left: 0;
|
1107 |
+
right: 0;
|
1108 |
+
top: 0;
|
1109 |
+
-webkit-transform: translateY(-100%);
|
1110 |
+
-ms-transform: translateY(-100%);
|
1111 |
+
transform: translateY(-100%);
|
1112 |
+
-webkit-transition-property: transform;
|
1113 |
+
-webkit-transition-property: -webkit-transform;
|
1114 |
+
transition-property: -webkit-transform;
|
1115 |
+
-o-transition-property: transform;
|
1116 |
+
transition-property: transform;
|
1117 |
+
transition-property: transform, -webkit-transform;
|
1118 |
+
-webkit-transition-duration: 0.3s;
|
1119 |
+
-o-transition-duration: 0.3s;
|
1120 |
+
transition-duration: 0.3s;
|
1121 |
+
-webkit-transition-timing-function: ease-out;
|
1122 |
+
-o-transition-timing-function: ease-out;
|
1123 |
+
transition-timing-function: ease-out;
|
1124 |
+
}
|
1125 |
+
.wpr-button-overline-reveal:hover:before, .wpr-button-overline-reveal:focus:before, .wpr-button-overline-reveal:active:before {
|
1126 |
+
-webkit-transform: translateY(0);
|
1127 |
+
-ms-transform: translateY(0);
|
1128 |
+
transform: translateY(0);
|
1129 |
+
}
|
1130 |
+
|
1131 |
+
/* Winona */
|
1132 |
+
.wpr-button-winona {
|
1133 |
+
overflow: hidden;
|
1134 |
+
-webkit-transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
|
1135 |
+
-o-transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
|
1136 |
+
transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
|
1137 |
+
}
|
1138 |
+
.wpr-button-winona::after {
|
1139 |
+
content: attr(data-text);
|
1140 |
+
position: absolute;
|
1141 |
+
width: 100%;
|
1142 |
+
height: 100%;
|
1143 |
+
top: 0;
|
1144 |
+
left: 0;
|
1145 |
+
opacity: 0;
|
1146 |
+
-webkit-transform: translate3d(0, 25%, 0);
|
1147 |
+
transform: translate3d(0, 25%, 0);
|
1148 |
+
}
|
1149 |
+
|
1150 |
+
.wpr-button-winona::after,
|
1151 |
+
.wpr-button-winona > span {
|
1152 |
+
-webkit-transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
|
1153 |
+
-o-transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
|
1154 |
+
transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
|
1155 |
+
}
|
1156 |
+
.wpr-button-winona:hover::after {
|
1157 |
+
opacity: 1;
|
1158 |
+
-webkit-transform: translate3d(0, 0, 0);
|
1159 |
+
transform: translate3d(0, 0, 0);
|
1160 |
+
}
|
1161 |
+
.wpr-button-winona:hover > span {
|
1162 |
+
opacity: 0;
|
1163 |
+
-webkit-transform: translate3d(0, -25%, 0);
|
1164 |
+
transform: translate3d(0, -25%, 0);
|
1165 |
+
}
|
1166 |
+
|
1167 |
+
/* Wayra Left */
|
1168 |
+
.wpr-button-wayra-left {
|
1169 |
+
overflow: hidden;
|
1170 |
+
-webkit-transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
|
1171 |
+
-o-transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
|
1172 |
+
transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
|
1173 |
+
}
|
1174 |
+
.wpr-button-wayra-left::after {
|
1175 |
+
content: '';
|
1176 |
+
position: absolute;
|
1177 |
+
top: 0;
|
1178 |
+
left: 0;
|
1179 |
+
width: 150%;
|
1180 |
+
height: 100%;
|
1181 |
+
z-index: -1;
|
1182 |
+
-webkit-transform: rotate3d(0, 0, 1, -90deg) translate3d(0, -3em, 0);
|
1183 |
+
transform: rotate3d(0, 0, 1, -90deg) translate3d(0, -3em, 0);
|
1184 |
+
-webkit-transform-origin: 0% 100%;
|
1185 |
+
-ms-transform-origin: 0% 100%;
|
1186 |
+
transform-origin: 0% 100%;
|
1187 |
+
-webkit-transition: -webkit-transform 0.3s, opacity 0.3s, background-color 0.3s;
|
1188 |
+
-webkit-transition: opacity 0.3s, background-color 0.3s, -webkit-transform 0.3s;
|
1189 |
+
transition: opacity 0.3s, background-color 0.3s, -webkit-transform 0.3s;
|
1190 |
+
-o-transition: transform 0.3s, opacity 0.3s, background-color 0.3s;
|
1191 |
+
transition: transform 0.3s, opacity 0.3s, background-color 0.3s;
|
1192 |
+
transition: transform 0.3s, opacity 0.3s, background-color 0.3s, -webkit-transform 0.3s;
|
1193 |
+
}
|
1194 |
+
|
1195 |
+
.wpr-button-wayra-left:hover::after {
|
1196 |
+
opacity: 1;
|
1197 |
+
-webkit-transform: rotate3d(0, 0, 1, 0deg);
|
1198 |
+
transform: rotate3d(0, 0, 1, 0deg);
|
1199 |
+
-webkit-transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
|
1200 |
+
-o-transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
|
1201 |
+
transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
|
1202 |
+
}
|
1203 |
+
|
1204 |
+
/* Wayra Right */
|
1205 |
+
.wpr-button-wayra-right {
|
1206 |
+
overflow: hidden;
|
1207 |
+
-webkit-transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
|
1208 |
+
-o-transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
|
1209 |
+
transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
|
1210 |
+
}
|
1211 |
+
.wpr-button-wayra-right::after {
|
1212 |
+
content: '';
|
1213 |
+
position: absolute;
|
1214 |
+
top: 0;
|
1215 |
+
right: 0;
|
1216 |
+
width: 150%;
|
1217 |
+
height: 100%;
|
1218 |
+
z-index: -1;
|
1219 |
+
-webkit-transform: rotate3d(0, 0, 1, 90deg) translate3d(0, -3em, 0);
|
1220 |
+
transform: rotate3d(0, 0, 1, 90deg) translate3d(0, -3em, 0);
|
1221 |
+
-webkit-transform-origin: 100% 100%;
|
1222 |
+
-ms-transform-origin: 100% 100%;
|
1223 |
+
transform-origin: 100% 100%;
|
1224 |
+
-webkit-transition: -webkit-transform 0.3s, opacity 0.3s, background-color 0.3s;
|
1225 |
+
-webkit-transition: opacity 0.3s, background-color 0.3s, -webkit-transform 0.3s;
|
1226 |
+
transition: opacity 0.3s, background-color 0.3s, -webkit-transform 0.3s;
|
1227 |
+
-o-transition: transform 0.3s, opacity 0.3s, background-color 0.3s;
|
1228 |
+
transition: transform 0.3s, opacity 0.3s, background-color 0.3s;
|
1229 |
+
transition: transform 0.3s, opacity 0.3s, background-color 0.3s, -webkit-transform 0.3s;
|
1230 |
+
}
|
1231 |
+
|
1232 |
+
.wpr-button-wayra-right:hover::after {
|
1233 |
+
opacity: 1;
|
1234 |
+
-webkit-transform: rotate3d(0, 0, 1, 0deg);
|
1235 |
+
transform: rotate3d(0, 0, 1, 0deg);
|
1236 |
+
-webkit-transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
|
1237 |
+
-o-transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
|
1238 |
+
transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
|
1239 |
+
}
|
1240 |
+
|
1241 |
+
|
1242 |
+
/* Rayen Left */
|
1243 |
+
.wpr-button-rayen-left {
|
1244 |
+
overflow: hidden;
|
1245 |
+
}
|
1246 |
+
.wpr-button-rayen-left::after {
|
1247 |
+
content: attr(data-text);
|
1248 |
+
position: absolute;
|
1249 |
+
top: 0;
|
1250 |
+
left: 0;
|
1251 |
+
width: 100%;
|
1252 |
+
height: 100%;
|
1253 |
+
-webkit-transform: translate3d(-100%, 0, 0);
|
1254 |
+
transform: translate3d(-100%, 0, 0);
|
1255 |
+
z-index: 10;
|
1256 |
+
}
|
1257 |
+
.wpr-button-rayen-left::after,
|
1258 |
+
.wpr-button-rayen-left > span {
|
1259 |
+
-webkit-transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
|
1260 |
+
-o-transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
|
1261 |
+
transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
|
1262 |
+
}
|
1263 |
+
.wpr-button-rayen-left:hover::after {
|
1264 |
+
-webkit-transform: translate3d(0, 0, 0);
|
1265 |
+
transform: translate3d(0, 0, 0);
|
1266 |
+
}
|
1267 |
+
.wpr-button-rayen-left:hover > span {
|
1268 |
+
-webkit-transform: translate3d(0, 100%, 0);
|
1269 |
+
transform: translate3d(0, 100%, 0);
|
1270 |
+
}
|
1271 |
+
|
1272 |
+
/* Rayen Right */
|
1273 |
+
.wpr-button-rayen-right {
|
1274 |
+
overflow: hidden;
|
1275 |
+
}
|
1276 |
+
.wpr-button-rayen-right::after {
|
1277 |
+
content: attr(data-text);
|
1278 |
+
position: absolute;
|
1279 |
+
top: 0;
|
1280 |
+
right: 0;
|
1281 |
+
width: 100%;
|
1282 |
+
height: 100%;
|
1283 |
+
-webkit-transform: translate3d(100%, 0, 0);
|
1284 |
+
transform: translate3d(100%, 0, 0);
|
1285 |
+
z-index: 10;
|
1286 |
+
}
|
1287 |
+
.wpr-button-rayen-right::after,
|
1288 |
+
.wpr-button-rayen-right > span {
|
1289 |
+
-webkit-transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
|
1290 |
+
-o-transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
|
1291 |
+
transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
|
1292 |
+
}
|
1293 |
+
.wpr-button-rayen-right:hover::after {
|
1294 |
+
-webkit-transform: translate3d(0, 0, 0);
|
1295 |
+
transform: translate3d(0, 0, 0);
|
1296 |
+
}
|
1297 |
+
.wpr-button-rayen-right:hover > span {
|
1298 |
+
-webkit-transform: translate3d(0, 100%, 0);
|
1299 |
+
transform: translate3d(0, 100%, 0);
|
1300 |
+
}
|
1301 |
+
|
1302 |
+
/* Isi Right */
|
1303 |
+
.wpr-button-isi-left {
|
1304 |
+
overflow: hidden;
|
1305 |
+
}
|
1306 |
+
.wpr-button-isi-left::after {
|
1307 |
+
content: '';
|
1308 |
+
z-index: -1;
|
1309 |
+
position: absolute;
|
1310 |
+
top: 50%;
|
1311 |
+
right: 100%;
|
1312 |
+
margin: -15px 0 0 1px;
|
1313 |
+
width: 15%;
|
1314 |
+
height: 30px;
|
1315 |
+
border-radius: 50%;
|
1316 |
+
-webkit-transform-origin: 0% 50%;
|
1317 |
+
-ms-transform-origin: 0% 50%;
|
1318 |
+
transform-origin: 0% 50%;
|
1319 |
+
-webkit-transform: scale3d(1, 2, 1);
|
1320 |
+
transform: scale3d(1, 2, 1);
|
1321 |
+
-webkit-transition-timing-function: cubic-bezier(0.7,0,0.9,1);
|
1322 |
+
-o-transition-timing-function: cubic-bezier(0.7,0,0.9,1);
|
1323 |
+
transition-timing-function: cubic-bezier(0.7,0,0.9,1);
|
1324 |
+
}
|
1325 |
+
.wpr-button-isi-left:hover::after {
|
1326 |
+
-webkit-transform: scale3d(9, 9, 1);
|
1327 |
+
}
|
1328 |
+
|
1329 |
+
/* Isi Left */
|
1330 |
+
.wpr-button-isi-right {
|
1331 |
+
overflow: hidden;
|
1332 |
+
}
|
1333 |
+
.wpr-button-isi-right::after {
|
1334 |
+
content: '';
|
1335 |
+
z-index: -1;
|
1336 |
+
position: absolute;
|
1337 |
+
top: 50%;
|
1338 |
+
left: 100%;
|
1339 |
+
margin: -15px 0 0 1px;
|
1340 |
+
width: 15%;
|
1341 |
+
height: 30px;
|
1342 |
+
border-radius: 50%;
|
1343 |
+
-webkit-transform-origin: 100% 50%;
|
1344 |
+
-ms-transform-origin: 100% 50%;
|
1345 |
+
transform-origin: 100% 50%;
|
1346 |
+
-webkit-transform: scale3d(1, 2, 1);
|
1347 |
+
transform: scale3d(1, 2, 1);
|
1348 |
+
-webkit-transition-timing-function: cubic-bezier(0.7,0,0.9,1);
|
1349 |
+
-o-transition-timing-function: cubic-bezier(0.7,0,0.9,1);
|
1350 |
+
transition-timing-function: cubic-bezier(0.7,0,0.9,1);
|
1351 |
+
}
|
1352 |
+
.wpr-button-isi-right:hover::after {
|
1353 |
+
-webkit-transform: scale3d(9, 9, 1);
|
1354 |
+
transform: scale3d(9, 9, 1);
|
1355 |
+
}
|
1356 |
+
|
1357 |
+
/* Aylen */
|
1358 |
+
.wpr-button-aylen {
|
1359 |
+
overflow: hidden;
|
1360 |
+
}
|
1361 |
+
|
1362 |
+
.wpr-button-aylen::after,
|
1363 |
+
.wpr-button-aylen::before {
|
1364 |
+
content: '';
|
1365 |
+
position: absolute;
|
1366 |
+
height: 100%;
|
1367 |
+
width: 100%;
|
1368 |
+
bottom: 100%;
|
1369 |
+
left: 0;
|
1370 |
+
z-index: -1;
|
1371 |
+
-webkit-transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
|
1372 |
+
-o-transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
|
1373 |
+
transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
|
1374 |
+
}
|
1375 |
+
|
1376 |
+
.wpr-button-aylen::after {
|
1377 |
+
opacity: 0.75;
|
1378 |
+
}
|
1379 |
+
|
1380 |
+
.wpr-button-aylen:hover::after,
|
1381 |
+
.wpr-button-aylen:hover::before {
|
1382 |
+
-webkit-transform: translate3d(0, 100%, 0);
|
1383 |
+
transform: translate3d(0, 100%, 0);
|
1384 |
+
}
|
1385 |
+
.wpr-button-aylen:hover::before {
|
1386 |
+
-webkit-transition-delay: 0.175s;
|
1387 |
+
-o-transition-delay: 0.175s;
|
1388 |
+
transition-delay: 0.175s;
|
1389 |
+
}
|
1390 |
+
|
1391 |
+
/* Antiman */
|
1392 |
+
.wpr-button-antiman {
|
1393 |
+
overflow: visible !important;
|
1394 |
+
border: none !important;
|
1395 |
+
}
|
1396 |
+
|
1397 |
+
.wpr-button-antiman::after {
|
1398 |
+
content: '';
|
1399 |
+
z-index: -1;
|
1400 |
+
border-radius: inherit;
|
1401 |
+
pointer-events: none;
|
1402 |
+
position: absolute;
|
1403 |
+
top: 0;
|
1404 |
+
left: 0;
|
1405 |
+
width: 100%;
|
1406 |
+
height: 100%;
|
1407 |
+
-webkit-backface-visibility: hidden;
|
1408 |
+
-webkit-transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
|
1409 |
+
-o-transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
|
1410 |
+
transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
|
1411 |
+
}
|
1412 |
+
.wpr-button-antiman::after {
|
1413 |
+
opacity: 0;
|
1414 |
+
-webkit-transform: scale3d(1.2, 1.2, 1);
|
1415 |
+
transform: scale3d(1.2, 1.2, 1);
|
1416 |
+
}
|
1417 |
+
.wpr-button-antiman:hover::after {
|
1418 |
+
opacity: 1;
|
1419 |
+
-webkit-transform: scale3d(1, 1, 1);
|
1420 |
+
transform: scale3d(1, 1, 1);
|
1421 |
+
}
|
1422 |
+
|
1423 |
+
/* Naira */
|
1424 |
+
.wpr-button-naira {
|
1425 |
+
overflow: hidden;
|
1426 |
+
}
|
1427 |
+
.wpr-button-naira::after {
|
1428 |
+
content: '';
|
1429 |
+
position: absolute;
|
1430 |
+
left: -50%;
|
1431 |
+
width: 200%;
|
1432 |
+
height: 200%;
|
1433 |
+
top: -50%;
|
1434 |
+
z-index: -1;
|
1435 |
+
-webkit-transform: translate3d(0, -100%, 0) rotate3d(0, 0, 1, -10deg);
|
1436 |
+
transform: translate3d(0, -100%, 0) rotate3d(0, 0, 1, -10deg);
|
1437 |
+
}
|
1438 |
+
.wpr-button-naira .wpr-button-button-icon {
|
1439 |
+
position: absolute;
|
1440 |
+
top: 0;
|
1441 |
+
width: 100%;
|
1442 |
+
height: 100%;
|
1443 |
+
left: 0;
|
1444 |
+
margin: 0 !important;
|
1445 |
+
-webkit-transform: translate3d(0, -100%, 0);
|
1446 |
+
transform: translate3d(0, -100%, 0);
|
1447 |
+
opacity: 0;
|
1448 |
+
}
|
1449 |
+
.wpr-button-naira .wpr-button-button-icon i {
|
1450 |
+
position: absolute;
|
1451 |
+
top: 50%;
|
1452 |
+
left: 50%;
|
1453 |
+
-webkit-transform: translate(-50%,-50%);
|
1454 |
+
-ms-transform: translate(-50%,-50%);
|
1455 |
+
transform: translate(-50%,-50%);
|
1456 |
+
}
|
1457 |
+
|
1458 |
+
.wpr-button-naira .wpr-button-button-text {
|
1459 |
+
display: block;
|
1460 |
+
}
|
1461 |
+
|
1462 |
+
.wpr-button-naira .wpr-button-button-text,
|
1463 |
+
.wpr-button-naira .wpr-button-button-icon {
|
1464 |
+
-webkit-transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
|
1465 |
+
-o-transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
|
1466 |
+
transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
|
1467 |
+
}
|
1468 |
+
|
1469 |
+
.wpr-button-naira:hover .wpr-button-button-icon {
|
1470 |
+
-webkit-transform: translate3d(0, 0, 0);
|
1471 |
+
transform: translate3d(0, 0, 0);
|
1472 |
+
opacity: 1;
|
1473 |
+
}
|
1474 |
+
.wpr-button-naira:hover .wpr-button-button-text {
|
1475 |
+
opacity: 0;
|
1476 |
+
-webkit-transform: translate3d(0, 100%, 0);
|
1477 |
+
transform: translate3d(0, 100%, 0);
|
1478 |
+
}
|
1479 |
+
@-webkit-keyframes anim-naira-1 {
|
1480 |
+
50% {
|
1481 |
+
-webkit-transform: translate3d(0, -50%, 0) rotate3d(0, 0, 1, -10deg);
|
1482 |
+
transform: translate3d(0, -50%, 0) rotate3d(0, 0, 1, -10deg);
|
1483 |
+
-webkit-animation-timing-function: ease-out;
|
1484 |
+
animation-timing-function: ease-out;
|
1485 |
+
}
|
1486 |
+
100% {
|
1487 |
+
-webkit-transform: translate3d(0, 0%, 0) rotate3d(0, 0, 1, 0deg);
|
1488 |
+
transform: translate3d(0, 0%, 0) rotate3d(0, 0, 1, 0deg);
|
1489 |
+
}
|
1490 |
+
}
|
1491 |
+
@keyframes anim-naira-1 {
|
1492 |
+
50% {
|
1493 |
+
-webkit-transform: translate3d(0, -50%, 0) rotate3d(0, 0, 1, -10deg);
|
1494 |
+
transform: translate3d(0, -50%, 0) rotate3d(0, 0, 1, -10deg);
|
1495 |
+
-webkit-animation-timing-function: ease-out;
|
1496 |
+
animation-timing-function: ease-out;
|
1497 |
+
}
|
1498 |
+
100% {
|
1499 |
+
-webkit-transform: translate3d(0, 0%, 0) rotate3d(0, 0, 1, 0deg);
|
1500 |
+
transform: translate3d(0, 0%, 0) rotate3d(0, 0, 1, 0deg);
|
1501 |
+
}
|
1502 |
+
}
|
1503 |
+
.wpr-button-naira:hover::after {
|
1504 |
+
-webkit-animation-name: anim-naira-1;
|
1505 |
+
animation-name: anim-naira-1;
|
1506 |
+
-webkit-animation-fill-mode: forwards;
|
1507 |
+
animation-fill-mode: forwards;
|
1508 |
+
-webkit-animation-timing-function: ease-in;
|
1509 |
+
animation-timing-function: ease-in;
|
1510 |
+
}
|
1511 |
+
|
1512 |
+
/* Naira Up*/
|
1513 |
+
.wpr-button-naira-up {
|
1514 |
+
overflow: hidden;
|
1515 |
+
}
|
1516 |
+
.wpr-button-naira-up::after {
|
1517 |
+
content: '';
|
1518 |
+
position: absolute;
|
1519 |
+
left: -50%;
|
1520 |
+
width: 200%;
|
1521 |
+
height: 200%;
|
1522 |
+
top: -50%;
|
1523 |
+
z-index: -1;
|
1524 |
+
-webkit-transform: translate3d(0, 100%, 0) rotate3d(0, 0, 1, 10deg);
|
1525 |
+
transform: translate3d(0, 100%, 0) rotate3d(0, 0, 1, 10deg);
|
1526 |
+
}
|
1527 |
+
.wpr-button-naira-up .wpr-button-button-icon {
|
1528 |
+
position: absolute;
|
1529 |
+
top: 0;
|
1530 |
+
width: 100%;
|
1531 |
+
height: 100%;
|
1532 |
+
left: 0;
|
1533 |
+
margin: 0 !important;
|
1534 |
+
-webkit-transform: translate3d(0, 100%, 0);
|
1535 |
+
transform: translate3d(0, 100%, 0);
|
1536 |
+
opacity: 0;
|
1537 |
+
}
|
1538 |
+
|
1539 |
+
.wpr-button-naira-up .wpr-button-button-icon i {
|
1540 |
+
position: absolute;
|
1541 |
+
top: 50%;
|
1542 |
+
left: 50%;
|
1543 |
+
-webkit-transform: translate(-50%,-50%);
|
1544 |
+
-ms-transform: translate(-50%,-50%);
|
1545 |
+
transform: translate(-50%,-50%);
|
1546 |
+
}
|
1547 |
+
|
1548 |
+
.wpr-button-naira-up .wpr-button-button-text {
|
1549 |
+
display: block;
|
1550 |
+
}
|
1551 |
+
|
1552 |
+
.wpr-button-naira-up .wpr-button-button-text,
|
1553 |
+
.wpr-button-naira-up .wpr-button-button-icon {
|
1554 |
+
-webkit-transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
|
1555 |
+
-o-transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
|
1556 |
+
transition-timing-function: cubic-bezier(0.75, 0, 0.125, 1);
|
1557 |
+
}
|
1558 |
+
|
1559 |
+
.wpr-button-naira-up:hover .wpr-button-button-icon {
|
1560 |
+
-webkit-transform: translate3d(0, 0, 0);
|
1561 |
+
transform: translate3d(0, 0, 0);
|
1562 |
+
opacity: 1;
|
1563 |
+
}
|
1564 |
+
.wpr-button-naira-up:hover .wpr-button-button-text {
|
1565 |
+
opacity: 0;
|
1566 |
+
-webkit-transform: translate3d(0, -100%, 0);
|
1567 |
+
transform: translate3d(0, -100%, 0);
|
1568 |
+
}
|
1569 |
+
@-webkit-keyframes anim-naira-2 {
|
1570 |
+
50% {
|
1571 |
+
-webkit-transform: translate3d(0, 50%, 0) rotate3d(0, 0, 1, 10deg);
|
1572 |
+
transform: translate3d(0, 50%, 0) rotate3d(0, 0, 1, 10deg);
|
1573 |
+
-webkit-animation-timing-function: ease-out;
|
1574 |
+
animation-timing-function: ease-out;
|
1575 |
+
}
|
1576 |
+
100% {
|
1577 |
+
-webkit-transform: translate3d(0, 0%, 0) rotate3d(0, 0, 1, 0deg);
|
1578 |
+
transform: translate3d(0, 0%, 0) rotate3d(0, 0, 1, 0deg);
|
1579 |
+
}
|
1580 |
+
}
|
1581 |
+
@keyframes anim-naira-2 {
|
1582 |
+
50% {
|
1583 |
+
-webkit-transform: translate3d(0, 50%, 0) rotate3d(0, 0, 1, 10deg);
|
1584 |
+
transform: translate3d(0, 50%, 0) rotate3d(0, 0, 1, 10deg);
|
1585 |
+
-webkit-animation-timing-function: ease-out;
|
1586 |
+
animation-timing-function: ease-out;
|
1587 |
+
}
|
1588 |
+
100% {
|
1589 |
+
-webkit-transform: translate3d(0, 0%, 0) rotate3d(0, 0, 1, 0deg);
|
1590 |
+
transform: translate3d(0, 0%, 0) rotate3d(0, 0, 1, 0deg);
|
1591 |
+
}
|
1592 |
+
}
|
1593 |
+
.wpr-button-naira-up:hover::after {
|
1594 |
+
-webkit-animation-name: anim-naira-2;
|
1595 |
+
animation-name: anim-naira-2;
|
1596 |
+
-webkit-animation-fill-mode: forwards;
|
1597 |
+
animation-fill-mode: forwards;
|
1598 |
+
-webkit-animation-timing-function: ease-in;
|
1599 |
+
animation-timing-function: ease-in;
|
1600 |
+
}
|
1601 |
+
|
1602 |
+
/* Fade */
|
1603 |
+
.wpr-button-none:before {
|
1604 |
+
content: "";
|
1605 |
+
position: absolute;
|
1606 |
+
z-index: -1;
|
1607 |
+
top: 0;
|
1608 |
+
left: 0;
|
1609 |
+
width: 100%;
|
1610 |
+
height: 100%;
|
1611 |
+
opacity: 0;
|
1612 |
+
}
|
1613 |
+
.wpr-button-none:hover:before {
|
1614 |
+
opacity: 1;
|
1615 |
+
}
|
1616 |
+
|
1617 |
+
|
1618 |
+
.wpr-button-effect,
|
1619 |
+
.wpr-button-effect::before,
|
1620 |
+
.wpr-button-effect::after,
|
1621 |
+
.wpr-button-effect span {
|
1622 |
+
-webkit-transition-property: all;
|
1623 |
+
-o-transition-property: all;
|
1624 |
+
transition-property: all;
|
1625 |
+
}
|
1626 |
+
|
1627 |
+
.wpr-button-effect::after {
|
1628 |
+
text-align: center;
|
1629 |
+
}
|
assets/css/lib/animations/wpr-link-animations.css
CHANGED
@@ -1,192 +1,192 @@
|
|
1 |
-
/*!
|
2 |
-
* WPR Link Animations
|
3 |
-
* Version: 1.0
|
4 |
-
* Author: WP Royal
|
5 |
-
* Author URL: https://royal-elementor-addons.com/
|
6 |
-
|
7 |
-
* WPR Animations Copyright WP Royal 2020.
|
8 |
-
*/
|
9 |
-
|
10 |
-
.wpr-pointer-item {
|
11 |
-
position: relative;
|
12 |
-
}
|
13 |
-
|
14 |
-
.wpr-pointer-double-line .wpr-pointer-item:before,
|
15 |
-
.wpr-pointer-double-line .wpr-pointer-item:after,
|
16 |
-
.wpr-pointer-underline .wpr-pointer-item:after,
|
17 |
-
.wpr-pointer-overline .wpr-pointer-item:before {
|
18 |
-
content: '';
|
19 |
-
display: block;
|
20 |
-
height: 4px;
|
21 |
-
width: 100%;
|
22 |
-
left: 0;
|
23 |
-
background-color: #55595c;
|
24 |
-
z-index: 2;
|
25 |
-
}
|
26 |
-
|
27 |
-
|
28 |
-
.wpr-pointer-fx-none .wpr-pointer-item:before,
|
29 |
-
.wpr-pointer-fx-none .wpr-pointer-item:after {
|
30 |
-
opacity: 0;
|
31 |
-
-webkit-transition: none !important;
|
32 |
-
-o-transition: none !important;
|
33 |
-
transition: none !important;
|
34 |
-
}
|
35 |
-
|
36 |
-
.wpr-pointer-fx-none .wpr-pointer-item:hover:before,
|
37 |
-
.wpr-pointer-fx-none .wpr-pointer-item:hover:after {
|
38 |
-
opacity: 1;
|
39 |
-
}
|
40 |
-
|
41 |
-
.wpr-pointer-fx-fade .wpr-pointer-item:before,
|
42 |
-
.wpr-pointer-line-fx.wpr-pointer-fx-fade .wpr-pointer-item:after,
|
43 |
-
.wpr-pointer-line-fx.wpr-pointer-fx-grow .wpr-pointer-item:before,
|
44 |
-
.wpr-pointer-line-fx.wpr-pointer-fx-grow .wpr-pointer-item:after,
|
45 |
-
.wpr-pointer-line-fx.wpr-pointer-fx-drop .wpr-pointer-item:before,
|
46 |
-
.wpr-pointer-line-fx.wpr-pointer-fx-drop .wpr-pointer-item:after {
|
47 |
-
opacity: 0;
|
48 |
-
-webkit-transition: all 0.3s;
|
49 |
-
-o-transition: all 0.3s;
|
50 |
-
transition: all 0.3s;
|
51 |
-
}
|
52 |
-
|
53 |
-
.wpr-pointer-line-fx.wpr-pointer-fx-fade .wpr-pointer-item:hover:before,
|
54 |
-
.wpr-pointer-line-fx.wpr-pointer-fx-fade .wpr-pointer-item:hover:after {
|
55 |
-
opacity: 1;
|
56 |
-
}
|
57 |
-
|
58 |
-
.wpr-pointer-line-fx.wpr-pointer-fx-slide .wpr-pointer-item:before,
|
59 |
-
.wpr-pointer-line-fx.wpr-pointer-fx-slide .wpr-pointer-item:after {
|
60 |
-
width: 0;
|
61 |
-
-webkit-transition: all .3s cubic-bezier(.175,.885,.32,1.075);
|
62 |
-
-o-transition: all .3s cubic-bezier(.175,.885,.32,1.075);
|
63 |
-
transition: all .3s cubic-bezier(.175,.885,.32,1.075);
|
64 |
-
}
|
65 |
-
|
66 |
-
.wpr-pointer-line-fx.wpr-pointer-fx-slide .wpr-pointer-item:hover:before,
|
67 |
-
.wpr-pointer-line-fx.wpr-pointer-fx-slide .wpr-pointer-item:hover:after {
|
68 |
-
width: 100%;
|
69 |
-
}
|
70 |
-
|
71 |
-
.wpr-pointer-line-fx.wpr-pointer-fx-grow .wpr-pointer-item:before,
|
72 |
-
.wpr-pointer-line-fx.wpr-pointer-fx-grow .wpr-pointer-item:after {
|
73 |
-
position: absolute;
|
74 |
-
width: 0;
|
75 |
-
margin: 0 auto;
|
76 |
-
left: 0;
|
77 |
-
right: 0;
|
78 |
-
-webkit-transition: all .3s cubic-bezier(0, 0, 0.16, 0.95);
|
79 |
-
-o-transition: all .3s cubic-bezier(0, 0, 0.16, 0.95);
|
80 |
-
-webkit-transition: all .3s ease(0, 0, 0.16, 0.95);
|
81 |
-
-o-transition: all .3s ease(0, 0, 0.16, 0.95);
|
82 |
-
transition: all .3s ease(0, 0, 0.16, 0.95);
|
83 |
-
}
|
84 |
-
|
85 |
-
.wpr-pointer-line-fx.wpr-pointer-fx-grow .wpr-pointer-item:hover:before,
|
86 |
-
.wpr-pointer-line-fx.wpr-pointer-fx-grow .wpr-pointer-item:hover:after {
|
87 |
-
opacity: 1;
|
88 |
-
width: 100%;
|
89 |
-
}
|
90 |
-
|
91 |
-
.wpr-pointer-line-fx.wpr-pointer-fx-drop .wpr-pointer-item:before {
|
92 |
-
position: absolute;
|
93 |
-
top: -10px;
|
94 |
-
}
|
95 |
-
|
96 |
-
.wpr-pointer-line-fx.wpr-pointer-fx-drop .wpr-pointer-item:hover:before {
|
97 |
-
top: 0;
|
98 |
-
opacity: 1;
|
99 |
-
}
|
100 |
-
|
101 |
-
.wpr-pointer-line-fx.wpr-pointer-fx-drop .wpr-pointer-item:after {
|
102 |
-
position: absolute;
|
103 |
-
bottom: -10px;
|
104 |
-
}
|
105 |
-
|
106 |
-
.wpr-pointer-line-fx.wpr-pointer-fx-drop .wpr-pointer-item:hover:after {
|
107 |
-
bottom: 0;
|
108 |
-
opacity: 1;
|
109 |
-
}
|
110 |
-
|
111 |
-
.wpr-pointer-border-fx .wpr-pointer-item:before {
|
112 |
-
content: '';
|
113 |
-
display: block;
|
114 |
-
position: absolute;
|
115 |
-
top: 0;
|
116 |
-
right: 0;
|
117 |
-
bottom: 0;
|
118 |
-
left: 0;
|
119 |
-
z-index: 2;
|
120 |
-
opacity: 0;
|
121 |
-
border: 2px solid #000;
|
122 |
-
-webkit-transition: all 0.3s;
|
123 |
-
-o-transition: all 0.3s;
|
124 |
-
transition: all 0.3s;
|
125 |
-
}
|
126 |
-
|
127 |
-
.wpr-pointer-border-fx .wpr-pointer-item:hover:before {
|
128 |
-
opacity: 1;
|
129 |
-
}
|
130 |
-
|
131 |
-
.wpr-pointer-border-fx.wpr-pointer-fx-grow .wpr-pointer-item:before,
|
132 |
-
.wpr-pointer-background-fx.wpr-pointer-fx-grow .wpr-pointer-item:before {
|
133 |
-
-webkit-transform: scale(0.9);
|
134 |
-
-ms-transform: scale(0.9);
|
135 |
-
transform: scale(0.9);
|
136 |
-
}
|
137 |
-
|
138 |
-
.wpr-pointer-border-fx.wpr-pointer-fx-shrink .wpr-pointer-item:before,
|
139 |
-
.wpr-pointer-background-fx.wpr-pointer-fx-shrink .wpr-pointer-item:before {
|
140 |
-
-webkit-transform: scale(1.1);
|
141 |
-
-ms-transform: scale(1.1);
|
142 |
-
transform: scale(1.1);
|
143 |
-
}
|
144 |
-
|
145 |
-
.wpr-pointer-border-fx.wpr-pointer-fx-grow .wpr-pointer-item:hover:before,
|
146 |
-
.wpr-pointer-border-fx.wpr-pointer-fx-shrink .wpr-pointer-item:hover:before,
|
147 |
-
.wpr-pointer-background-fx.wpr-pointer-fx-grow .wpr-pointer-item:hover:before,
|
148 |
-
.wpr-pointer-background-fx.wpr-pointer-fx-shrink .wpr-pointer-item:hover:before,
|
149 |
-
.wpr-pointer-background-fx.wpr-pointer-fx-sweep .wpr-pointer-item:hover:before {
|
150 |
-
-webkit-transform: scale(1);
|
151 |
-
-ms-transform: scale(1);
|
152 |
-
transform: scale(1);
|
153 |
-
}
|
154 |
-
|
155 |
-
.wpr-pointer-background-fx .wpr-pointer-item:before {
|
156 |
-
content: '';
|
157 |
-
display: block;
|
158 |
-
position: absolute;
|
159 |
-
top: 0;
|
160 |
-
right: 0;
|
161 |
-
bottom: 0;
|
162 |
-
left: 0;
|
163 |
-
z-index: -1;
|
164 |
-
opacity: 0;
|
165 |
-
background: #000;
|
166 |
-
-webkit-transition: all 0.3s;
|
167 |
-
-o-transition: all 0.3s;
|
168 |
-
transition: all 0.3s;
|
169 |
-
}
|
170 |
-
|
171 |
-
.wpr-pointer-background-fx .wpr-pointer-item:hover:before {
|
172 |
-
opacity: 1;
|
173 |
-
}
|
174 |
-
|
175 |
-
.wpr-pointer-background-fx.wpr-pointer-fx-sweep .wpr-pointer-item:before {
|
176 |
-
-webkit-transform: translateY(-12%);
|
177 |
-
-ms-transform: translateY(-12%);
|
178 |
-
transform: translateY(-12%);
|
179 |
-
}
|
180 |
-
|
181 |
-
.wpr-pointer-background-fx.wpr-pointer-fx-skew .wpr-pointer-item:before {
|
182 |
-
-webkit-transform: perspective(600px) rotateX(90deg);
|
183 |
-
transform: perspective(600px) rotateX(90deg);
|
184 |
-
-webkit-transform-origin: center bottom 0;
|
185 |
-
-ms-transform-origin: center bottom 0;
|
186 |
-
transform-origin: center bottom 0;
|
187 |
-
}
|
188 |
-
|
189 |
-
.wpr-pointer-background-fx.wpr-pointer-fx-skew .wpr-pointer-item:hover:before {
|
190 |
-
-webkit-transform: perspective(600px) rotateX(0deg);
|
191 |
-
transform: perspective(600px) rotateX(0deg);
|
192 |
}
|
1 |
+
/*!
|
2 |
+
* WPR Link Animations
|
3 |
+
* Version: 1.0
|
4 |
+
* Author: WP Royal
|
5 |
+
* Author URL: https://royal-elementor-addons.com/
|
6 |
+
|
7 |
+
* WPR Animations Copyright WP Royal 2020.
|
8 |
+
*/
|
9 |
+
|
10 |
+
.wpr-pointer-item {
|
11 |
+
position: relative;
|
12 |
+
}
|
13 |
+
|
14 |
+
.wpr-pointer-double-line .wpr-pointer-item:before,
|
15 |
+
.wpr-pointer-double-line .wpr-pointer-item:after,
|
16 |
+
.wpr-pointer-underline .wpr-pointer-item:after,
|
17 |
+
.wpr-pointer-overline .wpr-pointer-item:before {
|
18 |
+
content: '';
|
19 |
+
display: block;
|
20 |
+
height: 4px;
|
21 |
+
width: 100%;
|
22 |
+
left: 0;
|
23 |
+
background-color: #55595c;
|
24 |
+
z-index: 2;
|
25 |
+
}
|
26 |
+
|
27 |
+
|
28 |
+
.wpr-pointer-fx-none .wpr-pointer-item:before,
|
29 |
+
.wpr-pointer-fx-none .wpr-pointer-item:after {
|
30 |
+
opacity: 0;
|
31 |
+
-webkit-transition: none !important;
|
32 |
+
-o-transition: none !important;
|
33 |
+
transition: none !important;
|
34 |
+
}
|
35 |
+
|
36 |
+
.wpr-pointer-fx-none .wpr-pointer-item:hover:before,
|
37 |
+
.wpr-pointer-fx-none .wpr-pointer-item:hover:after {
|
38 |
+
opacity: 1;
|
39 |
+
}
|
40 |
+
|
41 |
+
.wpr-pointer-fx-fade .wpr-pointer-item:before,
|
42 |
+
.wpr-pointer-line-fx.wpr-pointer-fx-fade .wpr-pointer-item:after,
|
43 |
+
.wpr-pointer-line-fx.wpr-pointer-fx-grow .wpr-pointer-item:before,
|
44 |
+
.wpr-pointer-line-fx.wpr-pointer-fx-grow .wpr-pointer-item:after,
|
45 |
+
.wpr-pointer-line-fx.wpr-pointer-fx-drop .wpr-pointer-item:before,
|
46 |
+
.wpr-pointer-line-fx.wpr-pointer-fx-drop .wpr-pointer-item:after {
|
47 |
+
opacity: 0;
|
48 |
+
-webkit-transition: all 0.3s;
|
49 |
+
-o-transition: all 0.3s;
|
50 |
+
transition: all 0.3s;
|
51 |
+
}
|
52 |
+
|
53 |
+
.wpr-pointer-line-fx.wpr-pointer-fx-fade .wpr-pointer-item:hover:before,
|
54 |
+
.wpr-pointer-line-fx.wpr-pointer-fx-fade .wpr-pointer-item:hover:after {
|
55 |
+
opacity: 1;
|
56 |
+
}
|
57 |
+
|
58 |
+
.wpr-pointer-line-fx.wpr-pointer-fx-slide .wpr-pointer-item:before,
|
59 |
+
.wpr-pointer-line-fx.wpr-pointer-fx-slide .wpr-pointer-item:after {
|
60 |
+
width: 0;
|
61 |
+
-webkit-transition: all .3s cubic-bezier(.175,.885,.32,1.075);
|
62 |
+
-o-transition: all .3s cubic-bezier(.175,.885,.32,1.075);
|
63 |
+
transition: all .3s cubic-bezier(.175,.885,.32,1.075);
|
64 |
+
}
|
65 |
+
|
66 |
+
.wpr-pointer-line-fx.wpr-pointer-fx-slide .wpr-pointer-item:hover:before,
|
67 |
+
.wpr-pointer-line-fx.wpr-pointer-fx-slide .wpr-pointer-item:hover:after {
|
68 |
+
width: 100%;
|
69 |
+
}
|
70 |
+
|
71 |
+
.wpr-pointer-line-fx.wpr-pointer-fx-grow .wpr-pointer-item:before,
|
72 |
+
.wpr-pointer-line-fx.wpr-pointer-fx-grow .wpr-pointer-item:after {
|
73 |
+
position: absolute;
|
74 |
+
width: 0;
|
75 |
+
margin: 0 auto;
|
76 |
+
left: 0;
|
77 |
+
right: 0;
|
78 |
+
-webkit-transition: all .3s cubic-bezier(0, 0, 0.16, 0.95);
|
79 |
+
-o-transition: all .3s cubic-bezier(0, 0, 0.16, 0.95);
|
80 |
+
-webkit-transition: all .3s ease(0, 0, 0.16, 0.95);
|
81 |
+
-o-transition: all .3s ease(0, 0, 0.16, 0.95);
|
82 |
+
transition: all .3s ease(0, 0, 0.16, 0.95);
|
83 |
+
}
|
84 |
+
|
85 |
+
.wpr-pointer-line-fx.wpr-pointer-fx-grow .wpr-pointer-item:hover:before,
|
86 |
+
.wpr-pointer-line-fx.wpr-pointer-fx-grow .wpr-pointer-item:hover:after {
|
87 |
+
opacity: 1;
|
88 |
+
width: 100%;
|
89 |
+
}
|
90 |
+
|
91 |
+
.wpr-pointer-line-fx.wpr-pointer-fx-drop .wpr-pointer-item:before {
|
92 |
+
position: absolute;
|
93 |
+
top: -10px;
|
94 |
+
}
|
95 |
+
|
96 |
+
.wpr-pointer-line-fx.wpr-pointer-fx-drop .wpr-pointer-item:hover:before {
|
97 |
+
top: 0;
|
98 |
+
opacity: 1;
|
99 |
+
}
|
100 |
+
|
101 |
+
.wpr-pointer-line-fx.wpr-pointer-fx-drop .wpr-pointer-item:after {
|
102 |
+
position: absolute;
|
103 |
+
bottom: -10px;
|
104 |
+
}
|
105 |
+
|
106 |
+
.wpr-pointer-line-fx.wpr-pointer-fx-drop .wpr-pointer-item:hover:after {
|
107 |
+
bottom: 0;
|
108 |
+
opacity: 1;
|
109 |
+
}
|
110 |
+
|
111 |
+
.wpr-pointer-border-fx .wpr-pointer-item:before {
|
112 |
+
content: '';
|
113 |
+
display: block;
|
114 |
+
position: absolute;
|
115 |
+
top: 0;
|
116 |
+
right: 0;
|
117 |
+
bottom: 0;
|
118 |
+
left: 0;
|
119 |
+
z-index: 2;
|
120 |
+
opacity: 0;
|
121 |
+
border: 2px solid #000;
|
122 |
+
-webkit-transition: all 0.3s;
|
123 |
+
-o-transition: all 0.3s;
|
124 |
+
transition: all 0.3s;
|
125 |
+
}
|
126 |
+
|
127 |
+
.wpr-pointer-border-fx .wpr-pointer-item:hover:before {
|
128 |
+
opacity: 1;
|
129 |
+
}
|
130 |
+
|
131 |
+
.wpr-pointer-border-fx.wpr-pointer-fx-grow .wpr-pointer-item:before,
|
132 |
+
.wpr-pointer-background-fx.wpr-pointer-fx-grow .wpr-pointer-item:before {
|
133 |
+
-webkit-transform: scale(0.9);
|
134 |
+
-ms-transform: scale(0.9);
|
135 |
+
transform: scale(0.9);
|
136 |
+
}
|
137 |
+
|
138 |
+
.wpr-pointer-border-fx.wpr-pointer-fx-shrink .wpr-pointer-item:before,
|
139 |
+
.wpr-pointer-background-fx.wpr-pointer-fx-shrink .wpr-pointer-item:before {
|
140 |
+
-webkit-transform: scale(1.1);
|
141 |
+
-ms-transform: scale(1.1);
|
142 |
+
transform: scale(1.1);
|
143 |
+
}
|
144 |
+
|
145 |
+
.wpr-pointer-border-fx.wpr-pointer-fx-grow .wpr-pointer-item:hover:before,
|
146 |
+
.wpr-pointer-border-fx.wpr-pointer-fx-shrink .wpr-pointer-item:hover:before,
|
147 |
+
.wpr-pointer-background-fx.wpr-pointer-fx-grow .wpr-pointer-item:hover:before,
|
148 |
+
.wpr-pointer-background-fx.wpr-pointer-fx-shrink .wpr-pointer-item:hover:before,
|
149 |
+
.wpr-pointer-background-fx.wpr-pointer-fx-sweep .wpr-pointer-item:hover:before {
|
150 |
+
-webkit-transform: scale(1);
|
151 |
+
-ms-transform: scale(1);
|
152 |
+
transform: scale(1);
|
153 |
+
}
|
154 |
+
|
155 |
+
.wpr-pointer-background-fx .wpr-pointer-item:before {
|
156 |
+
content: '';
|
157 |
+
display: block;
|
158 |
+
position: absolute;
|
159 |
+
top: 0;
|
160 |
+
right: 0;
|
161 |
+
bottom: 0;
|
162 |
+
left: 0;
|
163 |
+
z-index: -1;
|
164 |
+
opacity: 0;
|
165 |
+
background: #000;
|
166 |
+
-webkit-transition: all 0.3s;
|
167 |
+
-o-transition: all 0.3s;
|
168 |
+
transition: all 0.3s;
|
169 |
+
}
|
170 |
+
|
171 |
+
.wpr-pointer-background-fx .wpr-pointer-item:hover:before {
|
172 |
+
opacity: 1;
|
173 |
+
}
|
174 |
+
|
175 |
+
.wpr-pointer-background-fx.wpr-pointer-fx-sweep .wpr-pointer-item:before {
|
176 |
+
-webkit-transform: translateY(-12%);
|
177 |
+
-ms-transform: translateY(-12%);
|
178 |
+
transform: translateY(-12%);
|
179 |
+
}
|
180 |
+
|
181 |
+
.wpr-pointer-background-fx.wpr-pointer-fx-skew .wpr-pointer-item:before {
|
182 |
+
-webkit-transform: perspective(600px) rotateX(90deg);
|
183 |
+
transform: perspective(600px) rotateX(90deg);
|
184 |
+
-webkit-transform-origin: center bottom 0;
|
185 |
+
-ms-transform-origin: center bottom 0;
|
186 |
+
transform-origin: center bottom 0;
|
187 |
+
}
|
188 |
+
|
189 |
+
.wpr-pointer-background-fx.wpr-pointer-fx-skew .wpr-pointer-item:hover:before {
|
190 |
+
-webkit-transform: perspective(600px) rotateX(0deg);
|
191 |
+
transform: perspective(600px) rotateX(0deg);
|
192 |
}
|
assets/css/lib/lightgallery/lightgallery.css
CHANGED
@@ -1,982 +1,982 @@
|
|
1 |
-
/*! lightgallery - v1.6.12 - 2019-02-19
|
2 |
-
* http://sachinchoolur.github.io/lightGallery/
|
3 |
-
* Copyright (c) 2019 Sachin N; Licensed GPLv3 */
|
4 |
-
@font-face {
|
5 |
-
font-family: 'lg';
|
6 |
-
src: url("fonts/lg.eot?n1z373");
|
7 |
-
src: url("fonts/lg.eot?#iefixn1z373") format("embedded-opentype"), url("fonts/lg.woff?n1z373") format("woff"), url("fonts/lg.ttf?n1z373") format("truetype"), url("fonts/lg.svg?n1z373#lg") format("svg");
|
8 |
-
font-weight: normal;
|
9 |
-
font-style: normal;
|
10 |
-
}
|
11 |
-
.lg-icon {
|
12 |
-
font-family: 'lg';
|
13 |
-
speak: none;
|
14 |
-
font-style: normal;
|
15 |
-
font-weight: normal;
|
16 |
-
font-variant: normal;
|
17 |
-
text-transform: none;
|
18 |
-
line-height: 1;
|
19 |
-
/* Better Font Rendering =========== */
|
20 |
-
-webkit-font-smoothing: antialiased;
|
21 |
-
-moz-osx-font-smoothing: grayscale;
|
22 |
-
}
|
23 |
-
|
24 |
-
.lg-actions .lg-next, .lg-actions .lg-prev {
|
25 |
-
background-color: rgba(0, 0, 0, 0.45);
|
26 |
-
border-radius: 2px;
|
27 |
-
color: #999;
|
28 |
-
cursor: pointer;
|
29 |
-
display: block;
|
30 |
-
font-size: 22px;
|
31 |
-
margin-top: -10px;
|
32 |
-
padding: 8px 10px 9px;
|
33 |
-
position: absolute;
|
34 |
-
top: 50%;
|
35 |
-
z-index: 1080;
|
36 |
-
border: none;
|
37 |
-
outline: none;
|
38 |
-
}
|
39 |
-
.lg-actions .lg-next.disabled, .lg-actions .lg-prev.disabled {
|
40 |
-
pointer-events: none;
|
41 |
-
opacity: 0.5;
|
42 |
-
}
|
43 |
-
.lg-actions .lg-next:hover, .lg-actions .lg-prev:hover {
|
44 |
-
color: #FFF;
|
45 |
-
}
|
46 |
-
.lg-actions .lg-next {
|
47 |
-
right: 20px;
|
48 |
-
}
|
49 |
-
.lg-actions .lg-next:before {
|
50 |
-
content: "\e095";
|
51 |
-
}
|
52 |
-
.lg-actions .lg-prev {
|
53 |
-
left: 20px;
|
54 |
-
}
|
55 |
-
.lg-actions .lg-prev:after {
|
56 |
-
content: "\e094";
|
57 |
-
}
|
58 |
-
|
59 |
-
@-webkit-keyframes lg-right-end {
|
60 |
-
0% {
|
61 |
-
left: 0;
|
62 |
-
}
|
63 |
-
50% {
|
64 |
-
left: -30px;
|
65 |
-
}
|
66 |
-
100% {
|
67 |
-
left: 0;
|
68 |
-
}
|
69 |
-
}
|
70 |
-
@-moz-keyframes lg-right-end {
|
71 |
-
0% {
|
72 |
-
left: 0;
|
73 |
-
}
|
74 |
-
50% {
|
75 |
-
left: -30px;
|
76 |
-
}
|
77 |
-
100% {
|
78 |
-
left: 0;
|
79 |
-
}
|
80 |
-
}
|
81 |
-
@-ms-keyframes lg-right-end {
|
82 |
-
0% {
|
83 |
-
left: 0;
|
84 |
-
}
|
85 |
-
50% {
|
86 |
-
left: -30px;
|
87 |
-
}
|
88 |
-
100% {
|
89 |
-
left: 0;
|
90 |
-
}
|
91 |
-
}
|
92 |
-
@keyframes lg-right-end {
|
93 |
-
0% {
|
94 |
-
left: 0;
|
95 |
-
}
|
96 |
-
50% {
|
97 |
-
left: -30px;
|
98 |
-
}
|
99 |
-
100% {
|
100 |
-
left: 0;
|
101 |
-
}
|
102 |
-
}
|
103 |
-
@-webkit-keyframes lg-left-end {
|
104 |
-
0% {
|
105 |
-
left: 0;
|
106 |
-
}
|
107 |
-
50% {
|
108 |
-
left: 30px;
|
109 |
-
}
|
110 |
-
100% {
|
111 |
-
left: 0;
|
112 |
-
}
|
113 |
-
}
|
114 |
-
@-moz-keyframes lg-left-end {
|
115 |
-
0% {
|
116 |
-
left: 0;
|
117 |
-
}
|
118 |
-
50% {
|
119 |
-
left: 30px;
|
120 |
-
}
|
121 |
-
100% {
|
122 |
-
left: 0;
|
123 |
-
}
|
124 |
-
}
|
125 |
-
@-ms-keyframes lg-left-end {
|
126 |
-
0% {
|
127 |
-
left: 0;
|
128 |
-
}
|
129 |
-
50% {
|
130 |
-
left: 30px;
|
131 |
-
}
|
132 |
-
100% {
|
133 |
-
left: 0;
|
134 |
-
}
|
135 |
-
}
|
136 |
-
@keyframes lg-left-end {
|
137 |
-
0% {
|
138 |
-
left: 0;
|
139 |
-
}
|
140 |
-
50% {
|
141 |
-
left: 30px;
|
142 |
-
}
|
143 |
-
100% {
|
144 |
-
left: 0;
|
145 |
-
}
|
146 |
-
}
|
147 |
-
.lg-outer.lg-right-end .lg-object {
|
148 |
-
-webkit-animation: lg-right-end 0.3s;
|
149 |
-
-o-animation: lg-right-end 0.3s;
|
150 |
-
animation: lg-right-end 0.3s;
|
151 |
-
position: relative;
|
152 |
-
}
|
153 |
-
.lg-outer.lg-left-end .lg-object {
|
154 |
-
-webkit-animation: lg-left-end 0.3s;
|
155 |
-
-o-animation: lg-left-end 0.3s;
|
156 |
-
animation: lg-left-end 0.3s;
|
157 |
-
position: relative;
|
158 |
-
}
|
159 |
-
|
160 |
-
.lg-toolbar {
|
161 |
-
z-index: 1082;
|
162 |
-
left: 0;
|
163 |
-
position: absolute;
|
164 |
-
top: 0;
|
165 |
-
width: 100%;
|
166 |
-
background-color: rgba(0, 0, 0, 0.45);
|
167 |
-
}
|
168 |
-
.lg-toolbar .lg-icon {
|
169 |
-
color: #999;
|
170 |
-
cursor: pointer;
|
171 |
-
float: right;
|
172 |
-
font-size: 24px;
|
173 |
-
height: 47px;
|
174 |
-
line-height: 27px;
|
175 |
-
padding: 10px 0;
|
176 |
-
text-align: center;
|
177 |
-
width: 50px;
|
178 |
-
text-decoration: none !important;
|
179 |
-
outline: medium none;
|
180 |
-
-webkit-transition: color 0.2s linear;
|
181 |
-
-o-transition: color 0.2s linear;
|
182 |
-
transition: color 0.2s linear;
|
183 |
-
}
|
184 |
-
.lg-toolbar .lg-icon:hover {
|
185 |
-
color: #FFF;
|
186 |
-
}
|
187 |
-
.lg-toolbar .lg-close:after {
|
188 |
-
content: "\e070";
|
189 |
-
}
|
190 |
-
.lg-toolbar .lg-download:after {
|
191 |
-
content: "\e0f2";
|
192 |
-
}
|
193 |
-
|
194 |
-
.lg-sub-html {
|
195 |
-
background-color: rgba(0, 0, 0, 0.45);
|
196 |
-
bottom: 0;
|
197 |
-
color: #EEE;
|
198 |
-
font-size: 16px;
|
199 |
-
left: 0;
|
200 |
-
padding: 10px 40px;
|
201 |
-
position: fixed;
|
202 |
-
right: 0;
|
203 |
-
text-align: center;
|
204 |
-
z-index: 1080;
|
205 |
-
}
|
206 |
-
.lg-sub-html h4 {
|
207 |
-
margin: 0;
|
208 |
-
font-size: 13px;
|
209 |
-
font-weight: bold;
|
210 |
-
}
|
211 |
-
.lg-sub-html p {
|
212 |
-
font-size: 12px;
|
213 |
-
margin: 5px 0 0;
|
214 |
-
}
|
215 |
-
|
216 |
-
#lg-counter {
|
217 |
-
color: #999;
|
218 |
-
display: inline-block;
|
219 |
-
font-size: 16px;
|
220 |
-
padding-left: 20px;
|
221 |
-
padding-top: 12px;
|
222 |
-
vertical-align: middle;
|
223 |
-
}
|
224 |
-
|
225 |
-
.lg-toolbar, .lg-prev, .lg-next {
|
226 |
-
opacity: 1;
|
227 |
-
-webkit-transition: -webkit-transform 0.35s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.35s cubic-bezier(0, 0, 0.25, 1) 0s, color 0.2s linear;
|
228 |
-
-moz-transition: -moz-transform 0.35s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.35s cubic-bezier(0, 0, 0.25, 1) 0s, color 0.2s linear;
|
229 |
-
-o-transition: -o-transform 0.35s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.35s cubic-bezier(0, 0, 0.25, 1) 0s, color 0.2s linear;
|
230 |
-
transition: transform 0.35s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.35s cubic-bezier(0, 0, 0.25, 1) 0s, color 0.2s linear;
|
231 |
-
}
|
232 |
-
|
233 |
-
.lg-hide-items .lg-prev {
|
234 |
-
opacity: 0;
|
235 |
-
-webkit-transform: translate3d(-10px, 0, 0);
|
236 |
-
transform: translate3d(-10px, 0, 0);
|
237 |
-
}
|
238 |
-
.lg-hide-items .lg-next {
|
239 |
-
opacity: 0;
|
240 |
-
-webkit-transform: translate3d(10px, 0, 0);
|
241 |
-
transform: translate3d(10px, 0, 0);
|
242 |
-
}
|
243 |
-
.lg-hide-items .lg-toolbar {
|
244 |
-
opacity: 0;
|
245 |
-
-webkit-transform: translate3d(0, -10px, 0);
|
246 |
-
transform: translate3d(0, -10px, 0);
|
247 |
-
}
|
248 |
-
|
249 |
-
body:not(.lg-from-hash) .lg-outer.lg-start-zoom .lg-object {
|
250 |
-
-webkit-transform: scale3d(0.5, 0.5, 0.5);
|
251 |
-
transform: scale3d(0.5, 0.5, 0.5);
|
252 |
-
opacity: 0;
|
253 |
-
-webkit-transition: -webkit-transform 250ms cubic-bezier(0, 0, 0.25, 1) 0s, opacity 250ms cubic-bezier(0, 0, 0.25, 1) !important;
|
254 |
-
-moz-transition: -moz-transform 250ms cubic-bezier(0, 0, 0.25, 1) 0s, opacity 250ms cubic-bezier(0, 0, 0.25, 1) !important;
|
255 |
-
-o-transition: -o-transform 250ms cubic-bezier(0, 0, 0.25, 1) 0s, opacity 250ms cubic-bezier(0, 0, 0.25, 1) !important;
|
256 |
-
transition: transform 250ms cubic-bezier(0, 0, 0.25, 1) 0s, opacity 250ms cubic-bezier(0, 0, 0.25, 1) !important;
|
257 |
-
-webkit-transform-origin: 50% 50%;
|
258 |
-
-moz-transform-origin: 50% 50%;
|
259 |
-
-ms-transform-origin: 50% 50%;
|
260 |
-
transform-origin: 50% 50%;
|
261 |
-
}
|
262 |
-
body:not(.lg-from-hash) .lg-outer.lg-start-zoom .lg-item.lg-complete .lg-object {
|
263 |
-
-webkit-transform: scale3d(1, 1, 1);
|
264 |
-
transform: scale3d(1, 1, 1);
|
265 |
-
opacity: 1;
|
266 |
-
}
|
267 |
-
|
268 |
-
.lg-outer .lg-thumb-outer {
|
269 |
-
background-color: #0D0A0A;
|
270 |
-
bottom: 0;
|
271 |
-
position: absolute;
|
272 |
-
width: 100%;
|
273 |
-
z-index: 1080;
|
274 |
-
max-height: 350px;
|
275 |
-
-webkit-transform: translate3d(0, 100%, 0);
|
276 |
-
transform: translate3d(0, 100%, 0);
|
277 |
-
-webkit-transition: -webkit-transform 0.25s cubic-bezier(0, 0, 0.25, 1) 0s;
|
278 |
-
-moz-transition: -moz-transform 0.25s cubic-bezier(0, 0, 0.25, 1) 0s;
|
279 |
-
-o-transition: -o-transform 0.25s cubic-bezier(0, 0, 0.25, 1) 0s;
|
280 |
-
transition: transform 0.25s cubic-bezier(0, 0, 0.25, 1) 0s;
|
281 |
-
}
|
282 |
-
.lg-outer .lg-thumb-outer.lg-grab .lg-thumb-item {
|
283 |
-
cursor: -webkit-grab;
|
284 |
-
cursor: -moz-grab;
|
285 |
-
cursor: -o-grab;
|
286 |
-
cursor: -ms-grab;
|
287 |
-
cursor: grab;
|
288 |
-
}
|
289 |
-
.lg-outer .lg-thumb-outer.lg-grabbing .lg-thumb-item {
|
290 |
-
cursor: move;
|
291 |
-
cursor: -webkit-grabbing;
|
292 |
-
cursor: -moz-grabbing;
|
293 |
-
cursor: -o-grabbing;
|
294 |
-
cursor: -ms-grabbing;
|
295 |
-
cursor: grabbing;
|
296 |
-
}
|
297 |
-
.lg-outer .lg-thumb-outer.lg-dragging .lg-thumb {
|
298 |
-
-webkit-transition-duration: 0s !important;
|
299 |
-
transition-duration: 0s !important;
|
300 |
-
}
|
301 |
-
.lg-outer.lg-thumb-open .lg-thumb-outer {
|
302 |
-
-webkit-transform: translate3d(0, 0%, 0);
|
303 |
-
transform: translate3d(0, 0%, 0);
|
304 |
-
}
|
305 |
-
.lg-outer .lg-thumb {
|
306 |
-
padding: 10px 0;
|
307 |
-
height: 100%;
|
308 |
-
margin-bottom: -5px;
|
309 |
-
}
|
310 |
-
.lg-outer .lg-thumb-item {
|
311 |
-
border-radius: 5px;
|
312 |
-
cursor: pointer;
|
313 |
-
float: left;
|
314 |
-
overflow: hidden;
|
315 |
-
height: 100%;
|
316 |
-
border: 2px solid #FFF;
|
317 |
-
border-radius: 4px;
|
318 |
-
margin-bottom: 5px;
|
319 |
-
}
|
320 |
-
@media (min-width: 1025px) {
|
321 |
-
.lg-outer .lg-thumb-item {
|
322 |
-
-webkit-transition: border-color 0.25s ease;
|
323 |
-
-o-transition: border-color 0.25s ease;
|
324 |
-
transition: border-color 0.25s ease;
|
325 |
-
}
|
326 |
-
}
|
327 |
-
.lg-outer .lg-thumb-item.active, .lg-outer .lg-thumb-item:hover {
|
328 |
-
border-color: #a90707;
|
329 |
-
}
|
330 |
-
.lg-outer .lg-thumb-item img {
|
331 |
-
width: 100%;
|
332 |
-
height: 100%;
|
333 |
-
object-fit: cover;
|
334 |
-
}
|
335 |
-
.lg-outer.lg-has-thumb .lg-item {
|
336 |
-
padding-bottom: 120px;
|
337 |
-
}
|
338 |
-
.lg-outer.lg-can-toggle .lg-item {
|
339 |
-
padding-bottom: 0;
|
340 |
-
}
|
341 |
-
.lg-outer.lg-pull-caption-up .lg-sub-html {
|
342 |
-
-webkit-transition: bottom 0.25s ease;
|
343 |
-
-o-transition: bottom 0.25s ease;
|
344 |
-
transition: bottom 0.25s ease;
|
345 |
-
}
|
346 |
-
.lg-outer.lg-pull-caption-up.lg-thumb-open .lg-sub-html {
|
347 |
-
bottom: 100px;
|
348 |
-
}
|
349 |
-
.lg-outer .lg-toogle-thumb {
|
350 |
-
background-color: #0D0A0A;
|
351 |
-
border-radius: 2px 2px 0 0;
|
352 |
-
color: #999;
|
353 |
-
cursor: pointer;
|
354 |
-
font-size: 24px;
|
355 |
-
height: 39px;
|
356 |
-
line-height: 27px;
|
357 |
-
padding: 5px 0;
|
358 |
-
position: absolute;
|
359 |
-
right: 20px;
|
360 |
-
text-align: center;
|
361 |
-
top: -39px;
|
362 |
-
width: 50px;
|
363 |
-
}
|
364 |
-
.lg-outer .lg-toogle-thumb:after {
|
365 |
-
content: "\e1ff";
|
366 |
-
}
|
367 |
-
.lg-outer .lg-toogle-thumb:hover {
|
368 |
-
color: #FFF;
|
369 |
-
}
|
370 |
-
|
371 |
-
.lg-outer .lg-video-cont {
|
372 |
-
display: inline-block;
|
373 |
-
vertical-align: middle;
|
374 |
-
max-width: 1140px;
|
375 |
-
max-height: 100%;
|
376 |
-
width: 100%;
|
377 |
-
padding: 0 5px;
|
378 |
-
}
|
379 |
-
.lg-outer .lg-video {
|
380 |
-
width: 100%;
|
381 |
-
height: 0;
|
382 |
-
padding-bottom: 56.25%;
|
383 |
-
overflow: hidden;
|
384 |
-
position: relative;
|
385 |
-
}
|
386 |
-
.lg-outer .lg-video .lg-object {
|
387 |
-
display: inline-block;
|
388 |
-
position: absolute;
|
389 |
-
top: 0;
|
390 |
-
left: 0;
|
391 |
-
width: 100% !important;
|
392 |
-
height: 100% !important;
|
393 |
-
}
|
394 |
-
.lg-outer .lg-video .lg-video-play {
|
395 |
-
width: 84px;
|
396 |
-
height: 59px;
|
397 |
-
position: absolute;
|
398 |
-
left: 50%;
|
399 |
-
top: 50%;
|
400 |
-
margin-left: -42px;
|
401 |
-
margin-top: -30px;
|
402 |
-
z-index: 1080;
|
403 |
-
cursor: pointer;
|
404 |
-
}
|
405 |
-
.lg-outer .lg-has-iframe .lg-video {
|
406 |
-
-webkit-overflow-scrolling: touch;
|
407 |
-
overflow: auto;
|
408 |
-
}
|
409 |
-
.lg-outer .lg-has-vimeo .lg-video-play {
|
410 |
-
background: url("img/vimeo-play.png") no-repeat scroll 0 0 transparent;
|
411 |
-
}
|
412 |
-
.lg-outer .lg-has-vimeo:hover .lg-video-play {
|
413 |
-
background: url("img/vimeo-play.png") no-repeat scroll 0 -58px transparent;
|
414 |
-
}
|
415 |
-
.lg-outer .lg-has-html5 .lg-video-play {
|
416 |
-
background: transparent url("img/video-play.png") no-repeat scroll 0 0;
|
417 |
-
height: 64px;
|
418 |
-
margin-left: -32px;
|
419 |
-
margin-top: -32px;
|
420 |
-
width: 64px;
|
421 |
-
opacity: 0.8;
|
422 |
-
}
|
423 |
-
.lg-outer .lg-has-html5:hover .lg-video-play {
|
424 |
-
opacity: 1;
|
425 |
-
}
|
426 |
-
.lg-outer .lg-has-youtube .lg-video-play {
|
427 |
-
background: url("img/youtube-play.png") no-repeat scroll 0 0 transparent;
|
428 |
-
}
|
429 |
-
.lg-outer .lg-has-youtube:hover .lg-video-play {
|
430 |
-
background: url("img/youtube-play.png") no-repeat scroll 0 -60px transparent;
|
431 |
-
}
|
432 |
-
.lg-outer .lg-video-object {
|
433 |
-
width: 100% !important;
|
434 |
-
height: 100% !important;
|
435 |
-
position: absolute;
|
436 |
-
top: 0;
|
437 |
-
left: 0;
|
438 |
-
}
|
439 |
-
.lg-outer .lg-has-video .lg-video-object {
|
440 |
-
visibility: hidden;
|
441 |
-
}
|
442 |
-
.lg-outer .lg-has-video.lg-video-playing .lg-object, .lg-outer .lg-has-video.lg-video-playing .lg-video-play {
|
443 |
-
display: none;
|
444 |
-
}
|
445 |
-
.lg-outer .lg-has-video.lg-video-playing .lg-video-object {
|
446 |
-
visibility: visible;
|
447 |
-
}
|
448 |
-
|
449 |
-
.lg-progress-bar {
|
450 |
-
background-color: #333;
|
451 |
-
height: 5px;
|
452 |
-
left: 0;
|
453 |
-
position: absolute;
|
454 |
-
top: 0;
|
455 |
-
width: 100%;
|
456 |
-
z-index: 1083;
|
457 |
-
opacity: 0;
|
458 |
-
-webkit-transition: opacity 0.08s ease 0s;
|
459 |
-
-moz-transition: opacity 0.08s ease 0s;
|
460 |
-
-o-transition: opacity 0.08s ease 0s;
|
461 |
-
transition: opacity 0.08s ease 0s;
|
462 |
-
}
|
463 |
-
.lg-progress-bar .lg-progress {
|
464 |
-
background-color: #a90707;
|
465 |
-
height: 5px;
|
466 |
-
width: 0;
|
467 |
-
}
|
468 |
-
.lg-progress-bar.lg-start .lg-progress {
|
469 |
-
width: 100%;
|
470 |
-
}
|
471 |
-
.lg-show-autoplay .lg-progress-bar {
|
472 |
-
opacity: 1;
|
473 |
-
}
|
474 |
-
|
475 |
-
.lg-autoplay-button:after {
|
476 |
-
content: "\e01d";
|
477 |
-
}
|
478 |
-
.lg-show-autoplay .lg-autoplay-button:after {
|
479 |
-
content: "\e01a";
|
480 |
-
}
|
481 |
-
|
482 |
-
.lg-outer.lg-css3.lg-zoom-dragging .lg-item.lg-complete.lg-zoomable .lg-img-wrap, .lg-outer.lg-css3.lg-zoom-dragging .lg-item.lg-complete.lg-zoomable .lg-image {
|
483 |
-
-webkit-transition-duration: 0s;
|
484 |
-
transition-duration: 0s;
|
485 |
-
}
|
486 |
-
.lg-outer.lg-use-transition-for-zoom .lg-item.lg-complete.lg-zoomable .lg-img-wrap {
|
487 |
-
-webkit-transition: -webkit-transform 0.3s cubic-bezier(0, 0, 0.25, 1) 0s;
|
488 |
-
-moz-transition: -moz-transform 0.3s cubic-bezier(0, 0, 0.25, 1) 0s;
|
489 |
-
-o-transition: -o-transform 0.3s cubic-bezier(0, 0, 0.25, 1) 0s;
|
490 |
-
transition: transform 0.3s cubic-bezier(0, 0, 0.25, 1) 0s;
|
491 |
-
}
|
492 |
-
.lg-outer.lg-use-left-for-zoom .lg-item.lg-complete.lg-zoomable .lg-img-wrap {
|
493 |
-
-webkit-transition: left 0.3s cubic-bezier(0, 0, 0.25, 1) 0s, top 0.3s cubic-bezier(0, 0, 0.25, 1) 0s;
|
494 |
-
-moz-transition: left 0.3s cubic-bezier(0, 0, 0.25, 1) 0s, top 0.3s cubic-bezier(0, 0, 0.25, 1) 0s;
|
495 |
-
-o-transition: left 0.3s cubic-bezier(0, 0, 0.25, 1) 0s, top 0.3s cubic-bezier(0, 0, 0.25, 1) 0s;
|
496 |
-
transition: left 0.3s cubic-bezier(0, 0, 0.25, 1) 0s, top 0.3s cubic-bezier(0, 0, 0.25, 1) 0s;
|
497 |
-
}
|
498 |
-
.lg-outer .lg-item.lg-complete.lg-zoomable .lg-img-wrap {
|
499 |
-
-webkit-transform: translate3d(0, 0, 0);
|
500 |
-
transform: translate3d(0, 0, 0);
|
501 |
-
-webkit-backface-visibility: hidden;
|
502 |
-
-moz-backface-visibility: hidden;
|
503 |
-
backface-visibility: hidden;
|
504 |
-
}
|
505 |
-
.lg-outer .lg-item.lg-complete.lg-zoomable .lg-image {
|
506 |
-
-webkit-transform: scale3d(1, 1, 1);
|
507 |
-
transform: scale3d(1, 1, 1);
|
508 |
-
-webkit-transition: -webkit-transform 0.3s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.15s !important;
|
509 |
-
-moz-transition: -moz-transform 0.3s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.15s !important;
|
510 |
-
-o-transition: -o-transform 0.3s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.15s !important;
|
511 |
-
transition: transform 0.3s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.15s !important;
|
512 |
-
-webkit-transform-origin: 0 0;
|
513 |
-
-moz-transform-origin: 0 0;
|
514 |
-
-ms-transform-origin: 0 0;
|
515 |
-
transform-origin: 0 0;
|
516 |
-
-webkit-backface-visibility: hidden;
|
517 |
-
-moz-backface-visibility: hidden;
|
518 |
-
backface-visibility: hidden;
|
519 |
-
}
|
520 |
-
|
521 |
-
#lg-zoom-in:after {
|
522 |
-
content: "\e311";
|
523 |
-
}
|
524 |
-
|
525 |
-
#lg-actual-size {
|
526 |
-
font-size: 20px;
|
527 |
-
}
|
528 |
-
#lg-actual-size:after {
|
529 |
-
content: "\e033";
|
530 |
-
}
|
531 |
-
|
532 |
-
#lg-zoom-out {
|
533 |
-
opacity: 0.5;
|
534 |
-
pointer-events: none;
|
535 |
-
}
|
536 |
-
#lg-zoom-out:after {
|
537 |
-
content: "\e312";
|
538 |
-
}
|
539 |
-
.lg-zoomed #lg-zoom-out {
|
540 |
-
opacity: 1;
|
541 |
-
pointer-events: auto;
|
542 |
-
}
|
543 |
-
|
544 |
-
.lg-outer .lg-pager-outer {
|
545 |
-
bottom: 60px;
|
546 |
-
left: 0;
|
547 |
-
position: absolute;
|
548 |
-
right: 0;
|
549 |
-
text-align: center;
|
550 |
-
z-index: 1080;
|
551 |
-
height: 10px;
|
552 |
-
}
|
553 |
-
.lg-outer .lg-pager-outer.lg-pager-hover .lg-pager-cont {
|
554 |
-
overflow: visible;
|
555 |
-
}
|
556 |
-
.lg-outer .lg-pager-cont {
|
557 |
-
cursor: pointer;
|
558 |
-
display: inline-block;
|
559 |
-
overflow: hidden;
|
560 |
-
position: relative;
|
561 |
-
vertical-align: top;
|
562 |
-
margin: 0 5px;
|
563 |
-
}
|
564 |
-
.lg-outer .lg-pager-cont:hover .lg-pager-thumb-cont {
|
565 |
-
opacity: 1;
|
566 |
-
-webkit-transform: translate3d(0, 0, 0);
|
567 |
-
transform: translate3d(0, 0, 0);
|
568 |
-
}
|
569 |
-
.lg-outer .lg-pager-cont.lg-pager-active .lg-pager {
|
570 |
-
box-shadow: 0 0 0 2px white inset;
|
571 |
-
}
|
572 |
-
.lg-outer .lg-pager-thumb-cont {
|
573 |
-
background-color: #fff;
|
574 |
-
color: #FFF;
|
575 |
-
bottom: 100%;
|
576 |
-
height: 83px;
|
577 |
-
left: 0;
|
578 |
-
margin-bottom: 20px;
|
579 |
-
margin-left: -60px;
|
580 |
-
opacity: 0;
|
581 |
-
padding: 5px;
|
582 |
-
position: absolute;
|
583 |
-
width: 120px;
|
584 |
-
border-radius: 3px;
|
585 |
-
-webkit-transition: opacity 0.15s ease 0s, -webkit-transform 0.15s ease 0s;
|
586 |
-
-moz-transition: opacity 0.15s ease 0s, -moz-transform 0.15s ease 0s;
|
587 |
-
-o-transition: opacity 0.15s ease 0s, -o-transform 0.15s ease 0s;
|
588 |
-
transition: opacity 0.15s ease 0s, transform 0.15s ease 0s;
|
589 |
-
-webkit-transform: translate3d(0, 5px, 0);
|
590 |
-
transform: translate3d(0, 5px, 0);
|
591 |
-
}
|
592 |
-
.lg-outer .lg-pager-thumb-cont img {
|
593 |
-
width: 100%;
|
594 |
-
height: 100%;
|
595 |
-
}
|
596 |
-
.lg-outer .lg-pager {
|
597 |
-
background-color: rgba(255, 255, 255, 0.5);
|
598 |
-
border-radius: 50%;
|
599 |
-
box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.7) inset;
|
600 |
-
display: block;
|
601 |
-
height: 12px;
|
602 |
-
-webkit-transition: box-shadow 0.3s ease 0s;
|
603 |
-
-o-transition: box-shadow 0.3s ease 0s;
|
604 |
-
transition: box-shadow 0.3s ease 0s;
|
605 |
-
width: 12px;
|
606 |
-
}
|
607 |
-
.lg-outer .lg-pager:hover, .lg-outer .lg-pager:focus {
|
608 |
-
box-shadow: 0 0 0 8px white inset;
|
609 |
-
}
|
610 |
-
.lg-outer .lg-caret {
|
611 |
-
border-left: 10px solid transparent;
|
612 |
-
border-right: 10px solid transparent;
|
613 |
-
border-top: 10px dashed;
|
614 |
-
bottom: -10px;
|
615 |
-
display: inline-block;
|
616 |
-
height: 0;
|
617 |
-
left: 50%;
|
618 |
-
margin-left: -5px;
|
619 |
-
position: absolute;
|
620 |
-
vertical-align: middle;
|
621 |
-
width: 0;
|
622 |
-
}
|
623 |
-
|
624 |
-
.lg-fullscreen:after {
|
625 |
-
content: "\e20c";
|
626 |
-
}
|
627 |
-
.lg-fullscreen-on .lg-fullscreen:after {
|
628 |
-
content: "\e20d";
|
629 |
-
}
|
630 |
-
|
631 |
-
.lg-outer #lg-dropdown-overlay {
|
632 |
-
background-color: rgba(0, 0, 0, 0.25);
|
633 |
-
bottom: 0;
|
634 |
-
cursor: default;
|
635 |
-
left: 0;
|
636 |
-
position: fixed;
|
637 |
-
right: 0;
|
638 |
-
top: 0;
|
639 |
-
z-index: 1081;
|
640 |
-
opacity: 0;
|
641 |
-
visibility: hidden;
|
642 |
-
-webkit-transition: visibility 0s linear 0.18s, opacity 0.18s linear 0s;
|
643 |
-
-o-transition: visibility 0s linear 0.18s, opacity 0.18s linear 0s;
|
644 |
-
transition: visibility 0s linear 0.18s, opacity 0.18s linear 0s;
|
645 |
-
}
|
646 |
-
.lg-outer.lg-dropdown-active .lg-dropdown, .lg-outer.lg-dropdown-active #lg-dropdown-overlay {
|
647 |
-
-webkit-transition-delay: 0s;
|
648 |
-
transition-delay: 0s;
|
649 |
-
-moz-transform: translate3d(0, 0px, 0);
|
650 |
-
-o-transform: translate3d(0, 0px, 0);
|
651 |
-
-ms-transform: translate3d(0, 0px, 0);
|
652 |
-
-webkit-transform: translate3d(0, 0px, 0);
|
653 |
-
transform: translate3d(0, 0px, 0);
|
654 |
-
opacity: 1;
|
655 |
-
visibility: visible;
|
656 |
-
}
|
657 |
-
.lg-outer.lg-dropdown-active #lg-share {
|
658 |
-
color: #FFF;
|
659 |
-
}
|
660 |
-
.lg-outer .lg-dropdown {
|
661 |
-
background-color: #fff;
|
662 |
-
border-radius: 2px;
|
663 |
-
font-size: 14px;
|
664 |
-
list-style-type: none;
|
665 |
-
margin: 0;
|
666 |
-
padding: 10px 0;
|
667 |
-
position: absolute;
|
668 |
-
right: 0;
|
669 |
-
text-align: left;
|
670 |
-
top: 50px;
|
671 |
-
opacity: 0;
|
672 |
-
visibility: hidden;
|
673 |
-
-moz-transform: translate3d(0, 5px, 0);
|
674 |
-
-o-transform: translate3d(0, 5px, 0);
|
675 |
-
-ms-transform: translate3d(0, 5px, 0);
|
676 |
-
-webkit-transform: translate3d(0, 5px, 0);
|
677 |
-
transform: translate3d(0, 5px, 0);
|
678 |
-
-webkit-transition: -webkit-transform 0.18s linear 0s, visibility 0s linear 0.5s, opacity 0.18s linear 0s;
|
679 |
-
-moz-transition: -moz-transform 0.18s linear 0s, visibility 0s linear 0.5s, opacity 0.18s linear 0s;
|
680 |
-
-o-transition: -o-transform 0.18s linear 0s, visibility 0s linear 0.5s, opacity 0.18s linear 0s;
|
681 |
-
transition: transform 0.18s linear 0s, visibility 0s linear 0.5s, opacity 0.18s linear 0s;
|
682 |
-
}
|
683 |
-
.lg-outer .lg-dropdown:after {
|
684 |
-
content: "";
|
685 |
-
display: block;
|
686 |
-
height: 0;
|
687 |
-
width: 0;
|
688 |
-
position: absolute;
|
689 |
-
border: 8px solid transparent;
|
690 |
-
border-bottom-color: #FFF;
|
691 |
-
right: 16px;
|
692 |
-
top: -16px;
|
693 |
-
}
|
694 |
-
.lg-outer .lg-dropdown > li:last-child {
|
695 |
-
margin-bottom: 0px;
|
696 |
-
}
|
697 |
-
.lg-outer .lg-dropdown > li:hover a, .lg-outer .lg-dropdown > li:hover .lg-icon {
|
698 |
-
color: #333;
|
699 |
-
}
|
700 |
-
.lg-outer .lg-dropdown a {
|
701 |
-
color: #333;
|
702 |
-
display: block;
|
703 |
-
white-space: pre;
|
704 |
-
padding: 4px 12px;
|
705 |
-
font-family: "Open Sans","Helvetica Neue",Helvetica,Arial,sans-serif;
|
706 |
-
font-size: 12px;
|
707 |
-
}
|
708 |
-
.lg-outer .lg-dropdown a:hover {
|
709 |
-
background-color: rgba(0, 0, 0, 0.07);
|
710 |
-
}
|
711 |
-
.lg-outer .lg-dropdown .lg-dropdown-text {
|
712 |
-
display: inline-block;
|
713 |
-
line-height: 1;
|
714 |
-
margin-top: -3px;
|
715 |
-
vertical-align: middle;
|
716 |
-
}
|
717 |
-
.lg-outer .lg-dropdown .lg-icon {
|
718 |
-
color: #333;
|
719 |
-
display: inline-block;
|
720 |
-
float: none;
|
721 |
-
font-size: 20px;
|
722 |
-
height: auto;
|
723 |
-
line-height: 1;
|
724 |
-
margin-right: 8px;
|
725 |
-
padding: 0;
|
726 |
-
vertical-align: middle;
|
727 |
-
width: auto;
|
728 |
-
}
|
729 |
-
.lg-outer #lg-share {
|
730 |
-
position: relative;
|
731 |
-
}
|
732 |
-
.lg-outer #lg-share:after {
|
733 |
-
content: "\e80d";
|
734 |
-
}
|
735 |
-
.lg-outer #lg-share-facebook .lg-icon {
|
736 |
-
color: #3b5998;
|
737 |
-
}
|
738 |
-
.lg-outer #lg-share-facebook .lg-icon:after {
|
739 |
-
content: "\e901";
|
740 |
-
}
|
741 |
-
.lg-outer #lg-share-twitter .lg-icon {
|
742 |
-
color: #00aced;
|
743 |
-
}
|
744 |
-
.lg-outer #lg-share-twitter .lg-icon:after {
|
745 |
-
content: "\e904";
|
746 |
-
}
|
747 |
-
.lg-outer #lg-share-googleplus .lg-icon {
|
748 |
-
color: #dd4b39;
|
749 |
-
}
|
750 |
-
.lg-outer #lg-share-googleplus .lg-icon:after {
|
751 |
-
content: "\e902";
|
752 |
-
}
|
753 |
-
.lg-outer #lg-share-pinterest .lg-icon {
|
754 |
-
color: #cb2027;
|
755 |
-
}
|
756 |
-
.lg-outer #lg-share-pinterest .lg-icon:after {
|
757 |
-
content: "\e903";
|
758 |
-
}
|
759 |
-
|
760 |
-
.lg-group:after {
|
761 |
-
content: "";
|
762 |
-
display: table;
|
763 |
-
clear: both;
|
764 |
-
}
|
765 |
-
|
766 |
-
.lg-outer {
|
767 |
-
width: 100%;
|
768 |
-
height: 100%;
|
769 |
-
position: fixed;
|
770 |
-
top: 0;
|
771 |
-
left: 0;
|
772 |
-
z-index: 1050;
|
773 |
-
text-align: left;
|
774 |
-
opacity: 0;
|
775 |
-
-webkit-transition: opacity 0.15s ease 0s;
|
776 |
-
-o-transition: opacity 0.15s ease 0s;
|
777 |
-
transition: opacity 0.15s ease 0s;
|
778 |
-
}
|
779 |
-
.lg-outer * {
|
780 |
-
-webkit-box-sizing: border-box;
|
781 |
-
-moz-box-sizing: border-box;
|
782 |
-
box-sizing: border-box;
|
783 |
-
}
|
784 |
-
.lg-outer.lg-visible {
|
785 |
-
opacity: 1;
|
786 |
-
}
|
787 |
-
.lg-outer.lg-css3 .lg-item.lg-prev-slide, .lg-outer.lg-css3 .lg-item.lg-next-slide, .lg-outer.lg-css3 .lg-item.lg-current {
|
788 |
-
-webkit-transition-duration: inherit !important;
|
789 |
-
transition-duration: inherit !important;
|
790 |
-
-webkit-transition-timing-function: inherit !important;
|
791 |
-
transition-timing-function: inherit !important;
|
792 |
-
}
|
793 |
-
.lg-outer.lg-css3.lg-dragging .lg-item.lg-prev-slide, .lg-outer.lg-css3.lg-dragging .lg-item.lg-next-slide, .lg-outer.lg-css3.lg-dragging .lg-item.lg-current {
|
794 |
-
-webkit-transition-duration: 0s !important;
|
795 |
-
transition-duration: 0s !important;
|
796 |
-
opacity: 1;
|
797 |
-
}
|
798 |
-
.lg-outer.lg-grab img.lg-object {
|
799 |
-
cursor: -webkit-grab;
|
800 |
-
cursor: -moz-grab;
|
801 |
-
cursor: -o-grab;
|
802 |
-
cursor: -ms-grab;
|
803 |
-
cursor: grab;
|
804 |
-
}
|
805 |
-
.lg-outer.lg-grabbing img.lg-object {
|
806 |
-
cursor: move;
|
807 |
-
cursor: -webkit-grabbing;
|
808 |
-
cursor: -moz-grabbing;
|
809 |
-
cursor: -o-grabbing;
|
810 |
-
cursor: -ms-grabbing;
|
811 |
-
cursor: grabbing;
|
812 |
-
}
|
813 |
-
.lg-outer .lg {
|
814 |
-
height: 100%;
|
815 |
-
width: 100%;
|
816 |
-
position: relative;
|
817 |
-
overflow: hidden;
|
818 |
-
margin-left: auto;
|
819 |
-
margin-right: auto;
|
820 |
-
max-width: 100%;
|
821 |
-
max-height: 100%;
|
822 |
-
}
|
823 |
-
.lg-outer .lg-inner {
|
824 |
-
width: 100%;
|
825 |
-
height: 100%;
|
826 |
-
position: absolute;
|
827 |
-
left: 0;
|
828 |
-
top: 0;
|
829 |
-
white-space: nowrap;
|
830 |
-
}
|
831 |
-
.lg-outer .lg-item {
|
832 |
-
background: url("img/loading.gif") no-repeat scroll center center transparent;
|
833 |
-
display: none !important;
|
834 |
-
}
|
835 |
-
.lg-outer.lg-css3 .lg-prev-slide, .lg-outer.lg-css3 .lg-current, .lg-outer.lg-css3 .lg-next-slide {
|
836 |
-
display: inline-block !important;
|
837 |
-
}
|
838 |
-
.lg-outer.lg-css .lg-current {
|
839 |
-
display: inline-block !important;
|
840 |
-
}
|
841 |
-
.lg-outer .lg-item, .lg-outer .lg-img-wrap {
|
842 |
-
display: inline-block;
|
843 |
-
text-align: center;
|
844 |
-
position: absolute;
|
845 |
-
width: 100%;
|
846 |
-
height: 100%;
|
847 |
-
}
|
848 |
-
.lg-outer .lg-item:before, .lg-outer .lg-img-wrap:before {
|
849 |
-
content: "";
|
850 |
-
display: inline-block;
|
851 |
-
height: 50%;
|
852 |
-
width: 1px;
|
853 |
-
margin-right: -1px;
|
854 |
-
}
|
855 |
-
.lg-outer .lg-img-wrap {
|
856 |
-
position: absolute;
|
857 |
-
padding: 0 5px;
|
858 |
-
left: 0;
|
859 |
-
right: 0;
|
860 |
-
top: 0;
|
861 |
-
bottom: 0;
|
862 |
-
}
|
863 |
-
.lg-outer .lg-item.lg-complete {
|
864 |
-
background-image: none;
|
865 |
-
}
|
866 |
-
.lg-outer .lg-item.lg-current {
|
867 |
-
z-index: 1060;
|
868 |
-
}
|
869 |
-
.lg-outer .lg-image {
|
870 |
-
display: inline-block;
|
871 |
-
vertical-align: middle;
|
872 |
-
max-width: 100%;
|
873 |
-
max-height: 100%;
|
874 |
-
width: auto !important;
|
875 |
-
height: auto !important;
|
876 |
-
}
|
877 |
-
.lg-outer.lg-show-after-load .lg-item .lg-object, .lg-outer.lg-show-after-load .lg-item .lg-video-play {
|
878 |
-
opacity: 0;
|
879 |
-
-webkit-transition: opacity 0.15s ease 0s;
|
880 |
-
-o-transition: opacity 0.15s ease 0s;
|
881 |
-
transition: opacity 0.15s ease 0s;
|
882 |
-
}
|
883 |
-
.lg-outer.lg-show-after-load .lg-item.lg-complete .lg-object, .lg-outer.lg-show-after-load .lg-item.lg-complete .lg-video-play {
|
884 |
-
opacity: 1;
|
885 |
-
}
|
886 |
-
.lg-outer .lg-empty-html {
|
887 |
-
display: none;
|
888 |
-
}
|
889 |
-
.lg-outer.lg-hide-download #lg-download {
|
890 |
-
display: none;
|
891 |
-
}
|
892 |
-
|
893 |
-
.lg-backdrop {
|
894 |
-
position: fixed;
|
895 |
-
top: 0;
|
896 |
-
left: 0;
|
897 |
-
right: 0;
|
898 |
-
bottom: 0;
|
899 |
-
z-index: 1040;
|
900 |
-
background-color: #000;
|
901 |
-
opacity: 0;
|
902 |
-
-webkit-transition: opacity 0.15s ease 0s;
|
903 |
-
-o-transition: opacity 0.15s ease 0s;
|
904 |
-
transition: opacity 0.15s ease 0s;
|
905 |
-
}
|
906 |
-
.lg-backdrop.in {
|
907 |
-
opacity: 1;
|
908 |
-
}
|
909 |
-
|
910 |
-
.lg-css3.lg-no-trans .lg-prev-slide, .lg-css3.lg-no-trans .lg-next-slide, .lg-css3.lg-no-trans .lg-current {
|
911 |
-
-webkit-transition: none 0s ease 0s !important;
|
912 |
-
-moz-transition: none 0s ease 0s !important;
|
913 |
-
-o-transition: none 0s ease 0s !important;
|
914 |
-
transition: none 0s ease 0s !important;
|
915 |
-
}
|
916 |
-
.lg-css3.lg-use-css3 .lg-item {
|
917 |
-
-webkit-backface-visibility: hidden;
|
918 |
-
-moz-backface-visibility: hidden;
|
919 |
-
backface-visibility: hidden;
|
920 |
-
}
|
921 |
-
.lg-css3.lg-use-left .lg-item {
|
922 |
-
-webkit-backface-visibility: hidden;
|
923 |
-
-moz-backface-visibility: hidden;
|
924 |
-
backface-visibility: hidden;
|
925 |
-
}
|
926 |
-
.lg-css3.lg-fade .lg-item {
|
927 |
-
opacity: 0;
|
928 |
-
}
|
929 |
-
.lg-css3.lg-fade .lg-item.lg-current {
|
930 |
-
opacity: 1;
|
931 |
-
}
|
932 |
-
.lg-css3.lg-fade .lg-item.lg-prev-slide, .lg-css3.lg-fade .lg-item.lg-next-slide, .lg-css3.lg-fade .lg-item.lg-current {
|
933 |
-
-webkit-transition: opacity 0.1s ease 0s;
|
934 |
-
-moz-transition: opacity 0.1s ease 0s;
|
935 |
-
-o-transition: opacity 0.1s ease 0s;
|
936 |
-
transition: opacity 0.1s ease 0s;
|
937 |
-
}
|
938 |
-
.lg-css3.lg-slide.lg-use-css3 .lg-item {
|
939 |
-
opacity: 0;
|
940 |
-
}
|
941 |
-
.lg-css3.lg-slide.lg-use-css3 .lg-item.lg-prev-slide {
|
942 |
-
-webkit-transform: translate3d(-100%, 0, 0);
|
943 |
-
transform: translate3d(-100%, 0, 0);
|
944 |
-
}
|
945 |
-
.lg-css3.lg-slide.lg-use-css3 .lg-item.lg-next-slide {
|
946 |
-
-webkit-transform: translate3d(100%, 0, 0);
|
947 |
-
transform: translate3d(100%, 0, 0);
|
948 |
-
}
|
949 |
-
.lg-css3.lg-slide.lg-use-css3 .lg-item.lg-current {
|
950 |
-
-webkit-transform: translate3d(0, 0, 0);
|
951 |
-
transform: translate3d(0, 0, 0);
|
952 |
-
opacity: 1;
|
953 |
-
}
|
954 |
-
.lg-css3.lg-slide.lg-use-css3 .lg-item.lg-prev-slide, .lg-css3.lg-slide.lg-use-css3 .lg-item.lg-next-slide, .lg-css3.lg-slide.lg-use-css3 .lg-item.lg-current {
|
955 |
-
-webkit-transition: -webkit-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
956 |
-
-moz-transition: -moz-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
957 |
-
-o-transition: -o-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
958 |
-
transition: transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
959 |
-
}
|
960 |
-
.lg-css3.lg-slide.lg-use-left .lg-item {
|
961 |
-
opacity: 0;
|
962 |
-
position: absolute;
|
963 |
-
left: 0;
|
964 |
-
}
|
965 |
-
.lg-css3.lg-slide.lg-use-left .lg-item.lg-prev-slide {
|
966 |
-
left: -100%;
|
967 |
-
}
|
968 |
-
.lg-css3.lg-slide.lg-use-left .lg-item.lg-next-slide {
|
969 |
-
left: 100%;
|
970 |
-
}
|
971 |
-
.lg-css3.lg-slide.lg-use-left .lg-item.lg-current {
|
972 |
-
left: 0;
|
973 |
-
opacity: 1;
|
974 |
-
}
|
975 |
-
.lg-css3.lg-slide.lg-use-left .lg-item.lg-prev-slide, .lg-css3.lg-slide.lg-use-left .lg-item.lg-next-slide, .lg-css3.lg-slide.lg-use-left .lg-item.lg-current {
|
976 |
-
-webkit-transition: left 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
977 |
-
-moz-transition: left 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
978 |
-
-o-transition: left 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
979 |
-
transition: left 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
980 |
-
}
|
981 |
-
|
982 |
-
/*# sourceMappingURL=lightgallery.css.map */
|
1 |
+
/*! lightgallery - v1.6.12 - 2019-02-19
|
2 |
+
* http://sachinchoolur.github.io/lightGallery/
|
3 |
+
* Copyright (c) 2019 Sachin N; Licensed GPLv3 */
|
4 |
+
@font-face {
|
5 |
+
font-family: 'lg';
|
6 |
+
src: url("fonts/lg.eot?n1z373");
|
7 |
+
src: url("fonts/lg.eot?#iefixn1z373") format("embedded-opentype"), url("fonts/lg.woff?n1z373") format("woff"), url("fonts/lg.ttf?n1z373") format("truetype"), url("fonts/lg.svg?n1z373#lg") format("svg");
|
8 |
+
font-weight: normal;
|
9 |
+
font-style: normal;
|
10 |
+
}
|
11 |
+
.lg-icon {
|
12 |
+
font-family: 'lg';
|
13 |
+
speak: none;
|
14 |
+
font-style: normal;
|
15 |
+
font-weight: normal;
|
16 |
+
font-variant: normal;
|
17 |
+
text-transform: none;
|
18 |
+
line-height: 1;
|
19 |
+
/* Better Font Rendering =========== */
|
20 |
+
-webkit-font-smoothing: antialiased;
|
21 |
+
-moz-osx-font-smoothing: grayscale;
|
22 |
+
}
|
23 |
+
|
24 |
+
.lg-actions .lg-next, .lg-actions .lg-prev {
|
25 |
+
background-color: rgba(0, 0, 0, 0.45);
|
26 |
+
border-radius: 2px;
|
27 |
+
color: #999;
|
28 |
+
cursor: pointer;
|
29 |
+
display: block;
|
30 |
+
font-size: 22px;
|
31 |
+
margin-top: -10px;
|
32 |
+
padding: 8px 10px 9px;
|
33 |
+
position: absolute;
|
34 |
+
top: 50%;
|
35 |
+
z-index: 1080;
|
36 |
+
border: none;
|
37 |
+
outline: none;
|
38 |
+
}
|
39 |
+
.lg-actions .lg-next.disabled, .lg-actions .lg-prev.disabled {
|
40 |
+
pointer-events: none;
|
41 |
+
opacity: 0.5;
|
42 |
+
}
|
43 |
+
.lg-actions .lg-next:hover, .lg-actions .lg-prev:hover {
|
44 |
+
color: #FFF;
|
45 |
+
}
|
46 |
+
.lg-actions .lg-next {
|
47 |
+
right: 20px;
|
48 |
+
}
|
49 |
+
.lg-actions .lg-next:before {
|
50 |
+
content: "\e095";
|
51 |
+
}
|
52 |
+
.lg-actions .lg-prev {
|
53 |
+
left: 20px;
|
54 |
+
}
|
55 |
+
.lg-actions .lg-prev:after {
|
56 |
+
content: "\e094";
|
57 |
+
}
|
58 |
+
|
59 |
+
@-webkit-keyframes lg-right-end {
|
60 |
+
0% {
|
61 |
+
left: 0;
|
62 |
+
}
|
63 |
+
50% {
|
64 |
+
left: -30px;
|
65 |
+
}
|
66 |
+
100% {
|
67 |
+
left: 0;
|
68 |
+
}
|
69 |
+
}
|
70 |
+
@-moz-keyframes lg-right-end {
|
71 |
+
0% {
|
72 |
+
left: 0;
|
73 |
+
}
|
74 |
+
50% {
|
75 |
+
left: -30px;
|
76 |
+
}
|
77 |
+
100% {
|
78 |
+
left: 0;
|
79 |
+
}
|
80 |
+
}
|
81 |
+
@-ms-keyframes lg-right-end {
|
82 |
+
0% {
|
83 |
+
left: 0;
|
84 |
+
}
|
85 |
+
50% {
|
86 |
+
left: -30px;
|
87 |
+
}
|
88 |
+
100% {
|
89 |
+
left: 0;
|
90 |
+
}
|
91 |
+
}
|
92 |
+
@keyframes lg-right-end {
|
93 |
+
0% {
|
94 |
+
left: 0;
|
95 |
+
}
|
96 |
+
50% {
|
97 |
+
left: -30px;
|
98 |
+
}
|
99 |
+
100% {
|
100 |
+
left: 0;
|
101 |
+
}
|
102 |
+
}
|
103 |
+
@-webkit-keyframes lg-left-end {
|
104 |
+
0% {
|
105 |
+
left: 0;
|
106 |
+
}
|
107 |
+
50% {
|
108 |
+
left: 30px;
|
109 |
+
}
|
110 |
+
100% {
|
111 |
+
left: 0;
|
112 |
+
}
|
113 |
+
}
|
114 |
+
@-moz-keyframes lg-left-end {
|
115 |
+
0% {
|
116 |
+
left: 0;
|
117 |
+
}
|
118 |
+
50% {
|
119 |
+
left: 30px;
|
120 |
+
}
|
121 |
+
100% {
|
122 |
+
left: 0;
|
123 |
+
}
|
124 |
+
}
|
125 |
+
@-ms-keyframes lg-left-end {
|
126 |
+
0% {
|
127 |
+
left: 0;
|
128 |
+
}
|
129 |
+
50% {
|
130 |
+
left: 30px;
|
131 |
+
}
|
132 |
+
100% {
|
133 |
+
left: 0;
|
134 |
+
}
|
135 |
+
}
|
136 |
+
@keyframes lg-left-end {
|
137 |
+
0% {
|
138 |
+
left: 0;
|
139 |
+
}
|
140 |
+
50% {
|
141 |
+
left: 30px;
|
142 |
+
}
|
143 |
+
100% {
|
144 |
+
left: 0;
|
145 |
+
}
|
146 |
+
}
|
147 |
+
.lg-outer.lg-right-end .lg-object {
|
148 |
+
-webkit-animation: lg-right-end 0.3s;
|
149 |
+
-o-animation: lg-right-end 0.3s;
|
150 |
+
animation: lg-right-end 0.3s;
|
151 |
+
position: relative;
|
152 |
+
}
|
153 |
+
.lg-outer.lg-left-end .lg-object {
|
154 |
+
-webkit-animation: lg-left-end 0.3s;
|
155 |
+
-o-animation: lg-left-end 0.3s;
|
156 |
+
animation: lg-left-end 0.3s;
|
157 |
+
position: relative;
|
158 |
+
}
|
159 |
+
|
160 |
+
.lg-toolbar {
|
161 |
+
z-index: 1082;
|
162 |
+
left: 0;
|
163 |
+
position: absolute;
|
164 |
+
top: 0;
|
165 |
+
width: 100%;
|
166 |
+
background-color: rgba(0, 0, 0, 0.45);
|
167 |
+
}
|
168 |
+
.lg-toolbar .lg-icon {
|
169 |
+
color: #999;
|
170 |
+
cursor: pointer;
|
171 |
+
float: right;
|
172 |
+
font-size: 24px;
|
173 |
+
height: 47px;
|
174 |
+
line-height: 27px;
|
175 |
+
padding: 10px 0;
|
176 |
+
text-align: center;
|
177 |
+
width: 50px;
|
178 |
+
text-decoration: none !important;
|
179 |
+
outline: medium none;
|
180 |
+
-webkit-transition: color 0.2s linear;
|
181 |
+
-o-transition: color 0.2s linear;
|
182 |
+
transition: color 0.2s linear;
|
183 |
+
}
|
184 |
+
.lg-toolbar .lg-icon:hover {
|
185 |
+
color: #FFF;
|
186 |
+
}
|
187 |
+
.lg-toolbar .lg-close:after {
|
188 |
+
content: "\e070";
|
189 |
+
}
|
190 |
+
.lg-toolbar .lg-download:after {
|
191 |
+
content: "\e0f2";
|
192 |
+
}
|
193 |
+
|
194 |
+
.lg-sub-html {
|
195 |
+
background-color: rgba(0, 0, 0, 0.45);
|
196 |
+
bottom: 0;
|
197 |
+
color: #EEE;
|
198 |
+
font-size: 16px;
|
199 |
+
left: 0;
|
200 |
+
padding: 10px 40px;
|
201 |
+
position: fixed;
|
202 |
+
right: 0;
|
203 |
+
text-align: center;
|
204 |
+
z-index: 1080;
|
205 |
+
}
|
206 |
+
.lg-sub-html h4 {
|
207 |
+
margin: 0;
|
208 |
+
font-size: 13px;
|
209 |
+
font-weight: bold;
|
210 |
+
}
|
211 |
+
.lg-sub-html p {
|
212 |
+
font-size: 12px;
|
213 |
+
margin: 5px 0 0;
|
214 |
+
}
|
215 |
+
|
216 |
+
#lg-counter {
|
217 |
+
color: #999;
|
218 |
+
display: inline-block;
|
219 |
+
font-size: 16px;
|
220 |
+
padding-left: 20px;
|
221 |
+
padding-top: 12px;
|
222 |
+
vertical-align: middle;
|
223 |
+
}
|
224 |
+
|
225 |
+
.lg-toolbar, .lg-prev, .lg-next {
|
226 |
+
opacity: 1;
|
227 |
+
-webkit-transition: -webkit-transform 0.35s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.35s cubic-bezier(0, 0, 0.25, 1) 0s, color 0.2s linear;
|
228 |
+
-moz-transition: -moz-transform 0.35s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.35s cubic-bezier(0, 0, 0.25, 1) 0s, color 0.2s linear;
|
229 |
+
-o-transition: -o-transform 0.35s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.35s cubic-bezier(0, 0, 0.25, 1) 0s, color 0.2s linear;
|
230 |
+
transition: transform 0.35s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.35s cubic-bezier(0, 0, 0.25, 1) 0s, color 0.2s linear;
|
231 |
+
}
|
232 |
+
|
233 |
+
.lg-hide-items .lg-prev {
|
234 |
+
opacity: 0;
|
235 |
+
-webkit-transform: translate3d(-10px, 0, 0);
|
236 |
+
transform: translate3d(-10px, 0, 0);
|
237 |
+
}
|
238 |
+
.lg-hide-items .lg-next {
|
239 |
+
opacity: 0;
|
240 |
+
-webkit-transform: translate3d(10px, 0, 0);
|
241 |
+
transform: translate3d(10px, 0, 0);
|
242 |
+
}
|
243 |
+
.lg-hide-items .lg-toolbar {
|
244 |
+
opacity: 0;
|
245 |
+
-webkit-transform: translate3d(0, -10px, 0);
|
246 |
+
transform: translate3d(0, -10px, 0);
|
247 |
+
}
|
248 |
+
|
249 |
+
body:not(.lg-from-hash) .lg-outer.lg-start-zoom .lg-object {
|
250 |
+
-webkit-transform: scale3d(0.5, 0.5, 0.5);
|
251 |
+
transform: scale3d(0.5, 0.5, 0.5);
|
252 |
+
opacity: 0;
|
253 |
+
-webkit-transition: -webkit-transform 250ms cubic-bezier(0, 0, 0.25, 1) 0s, opacity 250ms cubic-bezier(0, 0, 0.25, 1) !important;
|
254 |
+
-moz-transition: -moz-transform 250ms cubic-bezier(0, 0, 0.25, 1) 0s, opacity 250ms cubic-bezier(0, 0, 0.25, 1) !important;
|
255 |
+
-o-transition: -o-transform 250ms cubic-bezier(0, 0, 0.25, 1) 0s, opacity 250ms cubic-bezier(0, 0, 0.25, 1) !important;
|
256 |
+
transition: transform 250ms cubic-bezier(0, 0, 0.25, 1) 0s, opacity 250ms cubic-bezier(0, 0, 0.25, 1) !important;
|
257 |
+
-webkit-transform-origin: 50% 50%;
|
258 |
+
-moz-transform-origin: 50% 50%;
|
259 |
+
-ms-transform-origin: 50% 50%;
|
260 |
+
transform-origin: 50% 50%;
|
261 |
+
}
|
262 |
+
body:not(.lg-from-hash) .lg-outer.lg-start-zoom .lg-item.lg-complete .lg-object {
|
263 |
+
-webkit-transform: scale3d(1, 1, 1);
|
264 |
+
transform: scale3d(1, 1, 1);
|
265 |
+
opacity: 1;
|
266 |
+
}
|
267 |
+
|
268 |
+
.lg-outer .lg-thumb-outer {
|
269 |
+
background-color: #0D0A0A;
|
270 |
+
bottom: 0;
|
271 |
+
position: absolute;
|
272 |
+
width: 100%;
|
273 |
+
z-index: 1080;
|
274 |
+
max-height: 350px;
|
275 |
+
-webkit-transform: translate3d(0, 100%, 0);
|
276 |
+
transform: translate3d(0, 100%, 0);
|
277 |
+
-webkit-transition: -webkit-transform 0.25s cubic-bezier(0, 0, 0.25, 1) 0s;
|
278 |
+
-moz-transition: -moz-transform 0.25s cubic-bezier(0, 0, 0.25, 1) 0s;
|
279 |
+
-o-transition: -o-transform 0.25s cubic-bezier(0, 0, 0.25, 1) 0s;
|
280 |
+
transition: transform 0.25s cubic-bezier(0, 0, 0.25, 1) 0s;
|
281 |
+
}
|
282 |
+
.lg-outer .lg-thumb-outer.lg-grab .lg-thumb-item {
|
283 |
+
cursor: -webkit-grab;
|
284 |
+
cursor: -moz-grab;
|
285 |
+
cursor: -o-grab;
|
286 |
+
cursor: -ms-grab;
|
287 |
+
cursor: grab;
|
288 |
+
}
|
289 |
+
.lg-outer .lg-thumb-outer.lg-grabbing .lg-thumb-item {
|
290 |
+
cursor: move;
|
291 |
+
cursor: -webkit-grabbing;
|
292 |
+
cursor: -moz-grabbing;
|
293 |
+
cursor: -o-grabbing;
|
294 |
+
cursor: -ms-grabbing;
|
295 |
+
cursor: grabbing;
|
296 |
+
}
|
297 |
+
.lg-outer .lg-thumb-outer.lg-dragging .lg-thumb {
|
298 |
+
-webkit-transition-duration: 0s !important;
|
299 |
+
transition-duration: 0s !important;
|
300 |
+
}
|
301 |
+
.lg-outer.lg-thumb-open .lg-thumb-outer {
|
302 |
+
-webkit-transform: translate3d(0, 0%, 0);
|
303 |
+
transform: translate3d(0, 0%, 0);
|
304 |
+
}
|
305 |
+
.lg-outer .lg-thumb {
|
306 |
+
padding: 10px 0;
|
307 |
+
height: 100%;
|
308 |
+
margin-bottom: -5px;
|
309 |
+
}
|
310 |
+
.lg-outer .lg-thumb-item {
|
311 |
+
border-radius: 5px;
|
312 |
+
cursor: pointer;
|
313 |
+
float: left;
|
314 |
+
overflow: hidden;
|
315 |
+
height: 100%;
|
316 |
+
border: 2px solid #FFF;
|
317 |
+
border-radius: 4px;
|
318 |
+
margin-bottom: 5px;
|
319 |
+
}
|
320 |
+
@media (min-width: 1025px) {
|
321 |
+
.lg-outer .lg-thumb-item {
|
322 |
+
-webkit-transition: border-color 0.25s ease;
|
323 |
+
-o-transition: border-color 0.25s ease;
|
324 |
+
transition: border-color 0.25s ease;
|
325 |
+
}
|
326 |
+
}
|
327 |
+
.lg-outer .lg-thumb-item.active, .lg-outer .lg-thumb-item:hover {
|
328 |
+
border-color: #a90707;
|
329 |
+
}
|
330 |
+
.lg-outer .lg-thumb-item img {
|
331 |
+
width: 100%;
|
332 |
+
height: 100%;
|
333 |
+
object-fit: cover;
|
334 |
+
}
|
335 |
+
.lg-outer.lg-has-thumb .lg-item {
|
336 |
+
padding-bottom: 120px;
|
337 |
+
}
|
338 |
+
.lg-outer.lg-can-toggle .lg-item {
|
339 |
+
padding-bottom: 0;
|
340 |
+
}
|
341 |
+
.lg-outer.lg-pull-caption-up .lg-sub-html {
|
342 |
+
-webkit-transition: bottom 0.25s ease;
|
343 |
+
-o-transition: bottom 0.25s ease;
|
344 |
+
transition: bottom 0.25s ease;
|
345 |
+
}
|
346 |
+
.lg-outer.lg-pull-caption-up.lg-thumb-open .lg-sub-html {
|
347 |
+
bottom: 100px;
|
348 |
+
}
|
349 |
+
.lg-outer .lg-toogle-thumb {
|
350 |
+
background-color: #0D0A0A;
|
351 |
+
border-radius: 2px 2px 0 0;
|
352 |
+
color: #999;
|
353 |
+
cursor: pointer;
|
354 |
+
font-size: 24px;
|
355 |
+
height: 39px;
|
356 |
+
line-height: 27px;
|
357 |
+
padding: 5px 0;
|
358 |
+
position: absolute;
|
359 |
+
right: 20px;
|
360 |
+
text-align: center;
|
361 |
+
top: -39px;
|
362 |
+
width: 50px;
|
363 |
+
}
|
364 |
+
.lg-outer .lg-toogle-thumb:after {
|
365 |
+
content: "\e1ff";
|
366 |
+
}
|
367 |
+
.lg-outer .lg-toogle-thumb:hover {
|
368 |
+
color: #FFF;
|
369 |
+
}
|
370 |
+
|
371 |
+
.lg-outer .lg-video-cont {
|
372 |
+
display: inline-block;
|
373 |
+
vertical-align: middle;
|
374 |
+
max-width: 1140px;
|
375 |
+
max-height: 100%;
|
376 |
+
width: 100%;
|
377 |
+
padding: 0 5px;
|
378 |
+
}
|
379 |
+
.lg-outer .lg-video {
|
380 |
+
width: 100%;
|
381 |
+
height: 0;
|
382 |
+
padding-bottom: 56.25%;
|
383 |
+
overflow: hidden;
|
384 |
+
position: relative;
|
385 |
+
}
|
386 |
+
.lg-outer .lg-video .lg-object {
|
387 |
+
display: inline-block;
|
388 |
+
position: absolute;
|
389 |
+
top: 0;
|
390 |
+
left: 0;
|
391 |
+
width: 100% !important;
|
392 |
+
height: 100% !important;
|
393 |
+
}
|
394 |
+
.lg-outer .lg-video .lg-video-play {
|
395 |
+
width: 84px;
|
396 |
+
height: 59px;
|
397 |
+
position: absolute;
|
398 |
+
left: 50%;
|
399 |
+
top: 50%;
|
400 |
+
margin-left: -42px;
|
401 |
+
margin-top: -30px;
|
402 |
+
z-index: 1080;
|
403 |
+
cursor: pointer;
|
404 |
+
}
|
405 |
+
.lg-outer .lg-has-iframe .lg-video {
|
406 |
+
-webkit-overflow-scrolling: touch;
|
407 |
+
overflow: auto;
|
408 |
+
}
|
409 |
+
.lg-outer .lg-has-vimeo .lg-video-play {
|
410 |
+
background: url("img/vimeo-play.png") no-repeat scroll 0 0 transparent;
|
411 |
+
}
|
412 |
+
.lg-outer .lg-has-vimeo:hover .lg-video-play {
|
413 |
+
background: url("img/vimeo-play.png") no-repeat scroll 0 -58px transparent;
|
414 |
+
}
|
415 |
+
.lg-outer .lg-has-html5 .lg-video-play {
|
416 |
+
background: transparent url("img/video-play.png") no-repeat scroll 0 0;
|
417 |
+
height: 64px;
|
418 |
+
margin-left: -32px;
|
419 |
+
margin-top: -32px;
|
420 |
+
width: 64px;
|
421 |
+
opacity: 0.8;
|
422 |
+
}
|
423 |
+
.lg-outer .lg-has-html5:hover .lg-video-play {
|
424 |
+
opacity: 1;
|
425 |
+
}
|
426 |
+
.lg-outer .lg-has-youtube .lg-video-play {
|
427 |
+
background: url("img/youtube-play.png") no-repeat scroll 0 0 transparent;
|
428 |
+
}
|
429 |
+
.lg-outer .lg-has-youtube:hover .lg-video-play {
|
430 |
+
background: url("img/youtube-play.png") no-repeat scroll 0 -60px transparent;
|
431 |
+
}
|
432 |
+
.lg-outer .lg-video-object {
|
433 |
+
width: 100% !important;
|
434 |
+
height: 100% !important;
|
435 |
+
position: absolute;
|
436 |
+
top: 0;
|
437 |
+
left: 0;
|
438 |
+
}
|
439 |
+
.lg-outer .lg-has-video .lg-video-object {
|
440 |
+
visibility: hidden;
|
441 |
+
}
|
442 |
+
.lg-outer .lg-has-video.lg-video-playing .lg-object, .lg-outer .lg-has-video.lg-video-playing .lg-video-play {
|
443 |
+
display: none;
|
444 |
+
}
|
445 |
+
.lg-outer .lg-has-video.lg-video-playing .lg-video-object {
|
446 |
+
visibility: visible;
|
447 |
+
}
|
448 |
+
|
449 |
+
.lg-progress-bar {
|
450 |
+
background-color: #333;
|
451 |
+
height: 5px;
|
452 |
+
left: 0;
|
453 |
+
position: absolute;
|
454 |
+
top: 0;
|
455 |
+
width: 100%;
|
456 |
+
z-index: 1083;
|
457 |
+
opacity: 0;
|
458 |
+
-webkit-transition: opacity 0.08s ease 0s;
|
459 |
+
-moz-transition: opacity 0.08s ease 0s;
|
460 |
+
-o-transition: opacity 0.08s ease 0s;
|
461 |
+
transition: opacity 0.08s ease 0s;
|
462 |
+
}
|
463 |
+
.lg-progress-bar .lg-progress {
|
464 |
+
background-color: #a90707;
|
465 |
+
height: 5px;
|
466 |
+
width: 0;
|
467 |
+
}
|
468 |
+
.lg-progress-bar.lg-start .lg-progress {
|
469 |
+
width: 100%;
|
470 |
+
}
|
471 |
+
.lg-show-autoplay .lg-progress-bar {
|
472 |
+
opacity: 1;
|
473 |
+
}
|
474 |
+
|
475 |
+
.lg-autoplay-button:after {
|
476 |
+
content: "\e01d";
|
477 |
+
}
|
478 |
+
.lg-show-autoplay .lg-autoplay-button:after {
|
479 |
+
content: "\e01a";
|
480 |
+
}
|
481 |
+
|
482 |
+
.lg-outer.lg-css3.lg-zoom-dragging .lg-item.lg-complete.lg-zoomable .lg-img-wrap, .lg-outer.lg-css3.lg-zoom-dragging .lg-item.lg-complete.lg-zoomable .lg-image {
|
483 |
+
-webkit-transition-duration: 0s;
|
484 |
+
transition-duration: 0s;
|
485 |
+
}
|
486 |
+
.lg-outer.lg-use-transition-for-zoom .lg-item.lg-complete.lg-zoomable .lg-img-wrap {
|
487 |
+
-webkit-transition: -webkit-transform 0.3s cubic-bezier(0, 0, 0.25, 1) 0s;
|
488 |
+
-moz-transition: -moz-transform 0.3s cubic-bezier(0, 0, 0.25, 1) 0s;
|
489 |
+
-o-transition: -o-transform 0.3s cubic-bezier(0, 0, 0.25, 1) 0s;
|
490 |
+
transition: transform 0.3s cubic-bezier(0, 0, 0.25, 1) 0s;
|
491 |
+
}
|
492 |
+
.lg-outer.lg-use-left-for-zoom .lg-item.lg-complete.lg-zoomable .lg-img-wrap {
|
493 |
+
-webkit-transition: left 0.3s cubic-bezier(0, 0, 0.25, 1) 0s, top 0.3s cubic-bezier(0, 0, 0.25, 1) 0s;
|
494 |
+
-moz-transition: left 0.3s cubic-bezier(0, 0, 0.25, 1) 0s, top 0.3s cubic-bezier(0, 0, 0.25, 1) 0s;
|
495 |
+
-o-transition: left 0.3s cubic-bezier(0, 0, 0.25, 1) 0s, top 0.3s cubic-bezier(0, 0, 0.25, 1) 0s;
|
496 |
+
transition: left 0.3s cubic-bezier(0, 0, 0.25, 1) 0s, top 0.3s cubic-bezier(0, 0, 0.25, 1) 0s;
|
497 |
+
}
|
498 |
+
.lg-outer .lg-item.lg-complete.lg-zoomable .lg-img-wrap {
|
499 |
+
-webkit-transform: translate3d(0, 0, 0);
|
500 |
+
transform: translate3d(0, 0, 0);
|
501 |
+
-webkit-backface-visibility: hidden;
|
502 |
+
-moz-backface-visibility: hidden;
|
503 |
+
backface-visibility: hidden;
|
504 |
+
}
|
505 |
+
.lg-outer .lg-item.lg-complete.lg-zoomable .lg-image {
|
506 |
+
-webkit-transform: scale3d(1, 1, 1);
|
507 |
+
transform: scale3d(1, 1, 1);
|
508 |
+
-webkit-transition: -webkit-transform 0.3s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.15s !important;
|
509 |
+
-moz-transition: -moz-transform 0.3s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.15s !important;
|
510 |
+
-o-transition: -o-transform 0.3s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.15s !important;
|
511 |
+
transition: transform 0.3s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.15s !important;
|
512 |
+
-webkit-transform-origin: 0 0;
|
513 |
+
-moz-transform-origin: 0 0;
|
514 |
+
-ms-transform-origin: 0 0;
|
515 |
+
transform-origin: 0 0;
|
516 |
+
-webkit-backface-visibility: hidden;
|
517 |
+
-moz-backface-visibility: hidden;
|
518 |
+
backface-visibility: hidden;
|
519 |
+
}
|
520 |
+
|
521 |
+
#lg-zoom-in:after {
|
522 |
+
content: "\e311";
|
523 |
+
}
|
524 |
+
|
525 |
+
#lg-actual-size {
|
526 |
+
font-size: 20px;
|
527 |
+
}
|
528 |
+
#lg-actual-size:after {
|
529 |
+
content: "\e033";
|
530 |
+
}
|
531 |
+
|
532 |
+
#lg-zoom-out {
|
533 |
+
opacity: 0.5;
|
534 |
+
pointer-events: none;
|
535 |
+
}
|
536 |
+
#lg-zoom-out:after {
|
537 |
+
content: "\e312";
|
538 |
+
}
|
539 |
+
.lg-zoomed #lg-zoom-out {
|
540 |
+
opacity: 1;
|
541 |
+
pointer-events: auto;
|
542 |
+
}
|
543 |
+
|
544 |
+
.lg-outer .lg-pager-outer {
|
545 |
+
bottom: 60px;
|
546 |
+
left: 0;
|
547 |
+
position: absolute;
|
548 |
+
right: 0;
|
549 |
+
text-align: center;
|
550 |
+
z-index: 1080;
|
551 |
+
height: 10px;
|
552 |
+
}
|
553 |
+
.lg-outer .lg-pager-outer.lg-pager-hover .lg-pager-cont {
|
554 |
+
overflow: visible;
|
555 |
+
}
|
556 |
+
.lg-outer .lg-pager-cont {
|
557 |
+
cursor: pointer;
|
558 |
+
display: inline-block;
|
559 |
+
overflow: hidden;
|
560 |
+
position: relative;
|
561 |
+
vertical-align: top;
|
562 |
+
margin: 0 5px;
|
563 |
+
}
|
564 |
+
.lg-outer .lg-pager-cont:hover .lg-pager-thumb-cont {
|
565 |
+
opacity: 1;
|
566 |
+
-webkit-transform: translate3d(0, 0, 0);
|
567 |
+
transform: translate3d(0, 0, 0);
|
568 |
+
}
|
569 |
+
.lg-outer .lg-pager-cont.lg-pager-active .lg-pager {
|
570 |
+
box-shadow: 0 0 0 2px white inset;
|
571 |
+
}
|
572 |
+
.lg-outer .lg-pager-thumb-cont {
|
573 |
+
background-color: #fff;
|
574 |
+
color: #FFF;
|
575 |
+
bottom: 100%;
|
576 |
+
height: 83px;
|
577 |
+
left: 0;
|
578 |
+
margin-bottom: 20px;
|
579 |
+
margin-left: -60px;
|
580 |
+
opacity: 0;
|
581 |
+
padding: 5px;
|
582 |
+
position: absolute;
|
583 |
+
width: 120px;
|
584 |
+
border-radius: 3px;
|
585 |
+
-webkit-transition: opacity 0.15s ease 0s, -webkit-transform 0.15s ease 0s;
|
586 |
+
-moz-transition: opacity 0.15s ease 0s, -moz-transform 0.15s ease 0s;
|
587 |
+
-o-transition: opacity 0.15s ease 0s, -o-transform 0.15s ease 0s;
|
588 |
+
transition: opacity 0.15s ease 0s, transform 0.15s ease 0s;
|
589 |
+
-webkit-transform: translate3d(0, 5px, 0);
|
590 |
+
transform: translate3d(0, 5px, 0);
|
591 |
+
}
|
592 |
+
.lg-outer .lg-pager-thumb-cont img {
|
593 |
+
width: 100%;
|
594 |
+
height: 100%;
|
595 |
+
}
|
596 |
+
.lg-outer .lg-pager {
|
597 |
+
background-color: rgba(255, 255, 255, 0.5);
|
598 |
+
border-radius: 50%;
|
599 |
+
box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.7) inset;
|
600 |
+
display: block;
|
601 |
+
height: 12px;
|
602 |
+
-webkit-transition: box-shadow 0.3s ease 0s;
|
603 |
+
-o-transition: box-shadow 0.3s ease 0s;
|
604 |
+
transition: box-shadow 0.3s ease 0s;
|
605 |
+
width: 12px;
|
606 |
+
}
|
607 |
+
.lg-outer .lg-pager:hover, .lg-outer .lg-pager:focus {
|
608 |
+
box-shadow: 0 0 0 8px white inset;
|
609 |
+
}
|
610 |
+
.lg-outer .lg-caret {
|
611 |
+
border-left: 10px solid transparent;
|
612 |
+
border-right: 10px solid transparent;
|
613 |
+
border-top: 10px dashed;
|
614 |
+
bottom: -10px;
|
615 |
+
display: inline-block;
|
616 |
+
height: 0;
|
617 |
+
left: 50%;
|
618 |
+
margin-left: -5px;
|
619 |
+
position: absolute;
|
620 |
+
vertical-align: middle;
|
621 |
+
width: 0;
|
622 |
+
}
|
623 |
+
|
624 |
+
.lg-fullscreen:after {
|
625 |
+
content: "\e20c";
|
626 |
+
}
|
627 |
+
.lg-fullscreen-on .lg-fullscreen:after {
|
628 |
+
content: "\e20d";
|
629 |
+
}
|
630 |
+
|
631 |
+
.lg-outer #lg-dropdown-overlay {
|
632 |
+
background-color: rgba(0, 0, 0, 0.25);
|
633 |
+
bottom: 0;
|
634 |
+
cursor: default;
|
635 |
+
left: 0;
|
636 |
+
position: fixed;
|
637 |
+
right: 0;
|
638 |
+
top: 0;
|
639 |
+
z-index: 1081;
|
640 |
+
opacity: 0;
|
641 |
+
visibility: hidden;
|
642 |
+
-webkit-transition: visibility 0s linear 0.18s, opacity 0.18s linear 0s;
|
643 |
+
-o-transition: visibility 0s linear 0.18s, opacity 0.18s linear 0s;
|
644 |
+
transition: visibility 0s linear 0.18s, opacity 0.18s linear 0s;
|
645 |
+
}
|
646 |
+
.lg-outer.lg-dropdown-active .lg-dropdown, .lg-outer.lg-dropdown-active #lg-dropdown-overlay {
|
647 |
+
-webkit-transition-delay: 0s;
|
648 |
+
transition-delay: 0s;
|
649 |
+
-moz-transform: translate3d(0, 0px, 0);
|
650 |
+
-o-transform: translate3d(0, 0px, 0);
|
651 |
+
-ms-transform: translate3d(0, 0px, 0);
|
652 |
+
-webkit-transform: translate3d(0, 0px, 0);
|
653 |
+
transform: translate3d(0, 0px, 0);
|
654 |
+
opacity: 1;
|
655 |
+
visibility: visible;
|
656 |
+
}
|
657 |
+
.lg-outer.lg-dropdown-active #lg-share {
|
658 |
+
color: #FFF;
|
659 |
+
}
|
660 |
+
.lg-outer .lg-dropdown {
|
661 |
+
background-color: #fff;
|
662 |
+
border-radius: 2px;
|
663 |
+
font-size: 14px;
|
664 |
+
list-style-type: none;
|
665 |
+
margin: 0;
|
666 |
+
padding: 10px 0;
|
667 |
+
position: absolute;
|
668 |
+
right: 0;
|
669 |
+
text-align: left;
|
670 |
+
top: 50px;
|
671 |
+
opacity: 0;
|
672 |
+
visibility: hidden;
|
673 |
+
-moz-transform: translate3d(0, 5px, 0);
|
674 |
+
-o-transform: translate3d(0, 5px, 0);
|
675 |
+
-ms-transform: translate3d(0, 5px, 0);
|
676 |
+
-webkit-transform: translate3d(0, 5px, 0);
|
677 |
+
transform: translate3d(0, 5px, 0);
|
678 |
+
-webkit-transition: -webkit-transform 0.18s linear 0s, visibility 0s linear 0.5s, opacity 0.18s linear 0s;
|
679 |
+
-moz-transition: -moz-transform 0.18s linear 0s, visibility 0s linear 0.5s, opacity 0.18s linear 0s;
|
680 |
+
-o-transition: -o-transform 0.18s linear 0s, visibility 0s linear 0.5s, opacity 0.18s linear 0s;
|
681 |
+
transition: transform 0.18s linear 0s, visibility 0s linear 0.5s, opacity 0.18s linear 0s;
|
682 |
+
}
|
683 |
+
.lg-outer .lg-dropdown:after {
|
684 |
+
content: "";
|
685 |
+
display: block;
|
686 |
+
height: 0;
|
687 |
+
width: 0;
|
688 |
+
position: absolute;
|
689 |
+
border: 8px solid transparent;
|
690 |
+
border-bottom-color: #FFF;
|
691 |
+
right: 16px;
|
692 |
+
top: -16px;
|
693 |
+
}
|
694 |
+
.lg-outer .lg-dropdown > li:last-child {
|
695 |
+
margin-bottom: 0px;
|
696 |
+
}
|
697 |
+
.lg-outer .lg-dropdown > li:hover a, .lg-outer .lg-dropdown > li:hover .lg-icon {
|
698 |
+
color: #333;
|
699 |
+
}
|
700 |
+
.lg-outer .lg-dropdown a {
|
701 |
+
color: #333;
|
702 |
+
display: block;
|
703 |
+
white-space: pre;
|
704 |
+
padding: 4px 12px;
|
705 |
+
font-family: "Open Sans","Helvetica Neue",Helvetica,Arial,sans-serif;
|
706 |
+
font-size: 12px;
|
707 |
+
}
|
708 |
+
.lg-outer .lg-dropdown a:hover {
|
709 |
+
background-color: rgba(0, 0, 0, 0.07);
|
710 |
+
}
|
711 |
+
.lg-outer .lg-dropdown .lg-dropdown-text {
|
712 |
+
display: inline-block;
|
713 |
+
line-height: 1;
|
714 |
+
margin-top: -3px;
|
715 |
+
vertical-align: middle;
|
716 |
+
}
|
717 |
+
.lg-outer .lg-dropdown .lg-icon {
|
718 |
+
color: #333;
|
719 |
+
display: inline-block;
|
720 |
+
float: none;
|
721 |
+
font-size: 20px;
|
722 |
+
height: auto;
|
723 |
+
line-height: 1;
|
724 |
+
margin-right: 8px;
|
725 |
+
padding: 0;
|
726 |
+
vertical-align: middle;
|
727 |
+
width: auto;
|
728 |
+
}
|
729 |
+
.lg-outer #lg-share {
|
730 |
+
position: relative;
|
731 |
+
}
|
732 |
+
.lg-outer #lg-share:after {
|
733 |
+
content: "\e80d";
|
734 |
+
}
|
735 |
+
.lg-outer #lg-share-facebook .lg-icon {
|
736 |
+
color: #3b5998;
|
737 |
+
}
|
738 |
+
.lg-outer #lg-share-facebook .lg-icon:after {
|
739 |
+
content: "\e901";
|
740 |
+
}
|
741 |
+
.lg-outer #lg-share-twitter .lg-icon {
|
742 |
+
color: #00aced;
|
743 |
+
}
|
744 |
+
.lg-outer #lg-share-twitter .lg-icon:after {
|
745 |
+
content: "\e904";
|
746 |
+
}
|
747 |
+
.lg-outer #lg-share-googleplus .lg-icon {
|
748 |
+
color: #dd4b39;
|
749 |
+
}
|
750 |
+
.lg-outer #lg-share-googleplus .lg-icon:after {
|
751 |
+
content: "\e902";
|
752 |
+
}
|
753 |
+
.lg-outer #lg-share-pinterest .lg-icon {
|
754 |
+
color: #cb2027;
|
755 |
+
}
|
756 |
+
.lg-outer #lg-share-pinterest .lg-icon:after {
|
757 |
+
content: "\e903";
|
758 |
+
}
|
759 |
+
|
760 |
+
.lg-group:after {
|
761 |
+
content: "";
|
762 |
+
display: table;
|
763 |
+
clear: both;
|
764 |
+
}
|
765 |
+
|
766 |
+
.lg-outer {
|
767 |
+
width: 100%;
|
768 |
+
height: 100%;
|
769 |
+
position: fixed;
|
770 |
+
top: 0;
|
771 |
+
left: 0;
|
772 |
+
z-index: 1050;
|
773 |
+
text-align: left;
|
774 |
+
opacity: 0;
|
775 |
+
-webkit-transition: opacity 0.15s ease 0s;
|
776 |
+
-o-transition: opacity 0.15s ease 0s;
|
777 |
+
transition: opacity 0.15s ease 0s;
|
778 |
+
}
|
779 |
+
.lg-outer * {
|
780 |
+
-webkit-box-sizing: border-box;
|
781 |
+
-moz-box-sizing: border-box;
|
782 |
+
box-sizing: border-box;
|
783 |
+
}
|
784 |
+
.lg-outer.lg-visible {
|
785 |
+
opacity: 1;
|
786 |
+
}
|
787 |
+
.lg-outer.lg-css3 .lg-item.lg-prev-slide, .lg-outer.lg-css3 .lg-item.lg-next-slide, .lg-outer.lg-css3 .lg-item.lg-current {
|
788 |
+
-webkit-transition-duration: inherit !important;
|
789 |
+
transition-duration: inherit !important;
|
790 |
+
-webkit-transition-timing-function: inherit !important;
|
791 |
+
transition-timing-function: inherit !important;
|
792 |
+
}
|
793 |
+
.lg-outer.lg-css3.lg-dragging .lg-item.lg-prev-slide, .lg-outer.lg-css3.lg-dragging .lg-item.lg-next-slide, .lg-outer.lg-css3.lg-dragging .lg-item.lg-current {
|
794 |
+
-webkit-transition-duration: 0s !important;
|
795 |
+
transition-duration: 0s !important;
|
796 |
+
opacity: 1;
|
797 |
+
}
|
798 |
+
.lg-outer.lg-grab img.lg-object {
|
799 |
+
cursor: -webkit-grab;
|
800 |
+
cursor: -moz-grab;
|
801 |
+
cursor: -o-grab;
|
802 |
+
cursor: -ms-grab;
|
803 |
+
cursor: grab;
|
804 |
+
}
|
805 |
+
.lg-outer.lg-grabbing img.lg-object {
|
806 |
+
cursor: move;
|
807 |
+
cursor: -webkit-grabbing;
|
808 |
+
cursor: -moz-grabbing;
|
809 |
+
cursor: -o-grabbing;
|
810 |
+
cursor: -ms-grabbing;
|
811 |
+
cursor: grabbing;
|
812 |
+
}
|
813 |
+
.lg-outer .lg {
|
814 |
+
height: 100%;
|
815 |
+
width: 100%;
|
816 |
+
position: relative;
|
817 |
+
overflow: hidden;
|
818 |
+
margin-left: auto;
|
819 |
+
margin-right: auto;
|
820 |
+
max-width: 100%;
|
821 |
+
max-height: 100%;
|
822 |
+
}
|
823 |
+
.lg-outer .lg-inner {
|
824 |
+
width: 100%;
|
825 |
+
height: 100%;
|
826 |
+
position: absolute;
|
827 |
+
left: 0;
|
828 |
+
top: 0;
|
829 |
+
white-space: nowrap;
|
830 |
+
}
|
831 |
+
.lg-outer .lg-item {
|
832 |
+
background: url("img/loading.gif") no-repeat scroll center center transparent;
|
833 |
+
display: none !important;
|
834 |
+
}
|
835 |
+
.lg-outer.lg-css3 .lg-prev-slide, .lg-outer.lg-css3 .lg-current, .lg-outer.lg-css3 .lg-next-slide {
|
836 |
+
display: inline-block !important;
|
837 |
+
}
|
838 |
+
.lg-outer.lg-css .lg-current {
|
839 |
+
display: inline-block !important;
|
840 |
+
}
|
841 |
+
.lg-outer .lg-item, .lg-outer .lg-img-wrap {
|
842 |
+
display: inline-block;
|
843 |
+
text-align: center;
|
844 |
+
position: absolute;
|
845 |
+
width: 100%;
|
846 |
+
height: 100%;
|
847 |
+
}
|
848 |
+
.lg-outer .lg-item:before, .lg-outer .lg-img-wrap:before {
|
849 |
+
content: "";
|
850 |
+
display: inline-block;
|
851 |
+
height: 50%;
|
852 |
+
width: 1px;
|
853 |
+
margin-right: -1px;
|
854 |
+
}
|
855 |
+
.lg-outer .lg-img-wrap {
|
856 |
+
position: absolute;
|
857 |
+
padding: 0 5px;
|
858 |
+
left: 0;
|
859 |
+
right: 0;
|
860 |
+
top: 0;
|
861 |
+
bottom: 0;
|
862 |
+
}
|
863 |
+
.lg-outer .lg-item.lg-complete {
|
864 |
+
background-image: none;
|
865 |
+
}
|
866 |
+
.lg-outer .lg-item.lg-current {
|
867 |
+
z-index: 1060;
|
868 |
+
}
|
869 |
+
.lg-outer .lg-image {
|
870 |
+
display: inline-block;
|
871 |
+
vertical-align: middle;
|
872 |
+
max-width: 100%;
|
873 |
+
max-height: 100%;
|
874 |
+
width: auto !important;
|
875 |
+
height: auto !important;
|
876 |
+
}
|
877 |
+
.lg-outer.lg-show-after-load .lg-item .lg-object, .lg-outer.lg-show-after-load .lg-item .lg-video-play {
|
878 |
+
opacity: 0;
|
879 |
+
-webkit-transition: opacity 0.15s ease 0s;
|
880 |
+
-o-transition: opacity 0.15s ease 0s;
|
881 |
+
transition: opacity 0.15s ease 0s;
|
882 |
+
}
|
883 |
+
.lg-outer.lg-show-after-load .lg-item.lg-complete .lg-object, .lg-outer.lg-show-after-load .lg-item.lg-complete .lg-video-play {
|
884 |
+
opacity: 1;
|
885 |
+
}
|
886 |
+
.lg-outer .lg-empty-html {
|
887 |
+
display: none;
|
888 |
+
}
|
889 |
+
.lg-outer.lg-hide-download #lg-download {
|
890 |
+
display: none;
|
891 |
+
}
|
892 |
+
|
893 |
+
.lg-backdrop {
|
894 |
+
position: fixed;
|
895 |
+
top: 0;
|
896 |
+
left: 0;
|
897 |
+
right: 0;
|
898 |
+
bottom: 0;
|
899 |
+
z-index: 1040;
|
900 |
+
background-color: #000;
|
901 |
+
opacity: 0;
|
902 |
+
-webkit-transition: opacity 0.15s ease 0s;
|
903 |
+
-o-transition: opacity 0.15s ease 0s;
|
904 |
+
transition: opacity 0.15s ease 0s;
|
905 |
+
}
|
906 |
+
.lg-backdrop.in {
|
907 |
+
opacity: 1;
|
908 |
+
}
|
909 |
+
|
910 |
+
.lg-css3.lg-no-trans .lg-prev-slide, .lg-css3.lg-no-trans .lg-next-slide, .lg-css3.lg-no-trans .lg-current {
|
911 |
+
-webkit-transition: none 0s ease 0s !important;
|
912 |
+
-moz-transition: none 0s ease 0s !important;
|
913 |
+
-o-transition: none 0s ease 0s !important;
|
914 |
+
transition: none 0s ease 0s !important;
|
915 |
+
}
|
916 |
+
.lg-css3.lg-use-css3 .lg-item {
|
917 |
+
-webkit-backface-visibility: hidden;
|
918 |
+
-moz-backface-visibility: hidden;
|
919 |
+
backface-visibility: hidden;
|
920 |
+
}
|
921 |
+
.lg-css3.lg-use-left .lg-item {
|
922 |
+
-webkit-backface-visibility: hidden;
|
923 |
+
-moz-backface-visibility: hidden;
|
924 |
+
backface-visibility: hidden;
|
925 |
+
}
|
926 |
+
.lg-css3.lg-fade .lg-item {
|
927 |
+
opacity: 0;
|
928 |
+
}
|
929 |
+
.lg-css3.lg-fade .lg-item.lg-current {
|
930 |
+
opacity: 1;
|
931 |
+
}
|
932 |
+
.lg-css3.lg-fade .lg-item.lg-prev-slide, .lg-css3.lg-fade .lg-item.lg-next-slide, .lg-css3.lg-fade .lg-item.lg-current {
|
933 |
+
-webkit-transition: opacity 0.1s ease 0s;
|
934 |
+
-moz-transition: opacity 0.1s ease 0s;
|
935 |
+
-o-transition: opacity 0.1s ease 0s;
|
936 |
+
transition: opacity 0.1s ease 0s;
|
937 |
+
}
|
938 |
+
.lg-css3.lg-slide.lg-use-css3 .lg-item {
|
939 |
+
opacity: 0;
|
940 |
+
}
|
941 |
+
.lg-css3.lg-slide.lg-use-css3 .lg-item.lg-prev-slide {
|
942 |
+
-webkit-transform: translate3d(-100%, 0, 0);
|
943 |
+
transform: translate3d(-100%, 0, 0);
|
944 |
+
}
|
945 |
+
.lg-css3.lg-slide.lg-use-css3 .lg-item.lg-next-slide {
|
946 |
+
-webkit-transform: translate3d(100%, 0, 0);
|
947 |
+
transform: translate3d(100%, 0, 0);
|
948 |
+
}
|
949 |
+
.lg-css3.lg-slide.lg-use-css3 .lg-item.lg-current {
|
950 |
+
-webkit-transform: translate3d(0, 0, 0);
|
951 |
+
transform: translate3d(0, 0, 0);
|
952 |
+
opacity: 1;
|
953 |
+
}
|
954 |
+
.lg-css3.lg-slide.lg-use-css3 .lg-item.lg-prev-slide, .lg-css3.lg-slide.lg-use-css3 .lg-item.lg-next-slide, .lg-css3.lg-slide.lg-use-css3 .lg-item.lg-current {
|
955 |
+
-webkit-transition: -webkit-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
956 |
+
-moz-transition: -moz-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
957 |
+
-o-transition: -o-transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
958 |
+
transition: transform 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
959 |
+
}
|
960 |
+
.lg-css3.lg-slide.lg-use-left .lg-item {
|
961 |
+
opacity: 0;
|
962 |
+
position: absolute;
|
963 |
+
left: 0;
|
964 |
+
}
|
965 |
+
.lg-css3.lg-slide.lg-use-left .lg-item.lg-prev-slide {
|
966 |
+
left: -100%;
|
967 |
+
}
|
968 |
+
.lg-css3.lg-slide.lg-use-left .lg-item.lg-next-slide {
|
969 |
+
left: 100%;
|
970 |
+
}
|
971 |
+
.lg-css3.lg-slide.lg-use-left .lg-item.lg-current {
|
972 |
+
left: 0;
|
973 |
+
opacity: 1;
|
974 |
+
}
|
975 |
+
.lg-css3.lg-slide.lg-use-left .lg-item.lg-prev-slide, .lg-css3.lg-slide.lg-use-left .lg-item.lg-next-slide, .lg-css3.lg-slide.lg-use-left .lg-item.lg-current {
|
976 |
+
-webkit-transition: left 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
977 |
+
-moz-transition: left 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
978 |
+
-o-transition: left 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
979 |
+
transition: left 1s cubic-bezier(0, 0, 0.25, 1) 0s, opacity 0.1s ease 0s;
|
980 |
+
}
|
981 |
+
|
982 |
+
/*# sourceMappingURL=lightgallery.css.map */
|
assets/js/admin/plugin-options.js
CHANGED
@@ -64,7 +64,6 @@ jQuery(document).ready(function( $ ) {
|
|
64 |
** Create User Template -------------------------
|
65 |
*/
|
66 |
function craeteUserTemplate() {
|
67 |
-
console.log(getActiveFilter)
|
68 |
// Get Template Library
|
69 |
var library = 'my-templates' === getActiveFilter() ? 'elementor_library' : 'wpr_templates';
|
70 |
// Get Template Title
|
64 |
** Create User Template -------------------------
|
65 |
*/
|
66 |
function craeteUserTemplate() {
|
|
|
67 |
// Get Template Library
|
68 |
var library = 'my-templates' === getActiveFilter() ? 'elementor_library' : 'wpr_templates';
|
69 |
// Get Template Title
|
assets/js/admin/templates-kit.js
CHANGED
@@ -45,7 +45,7 @@ jQuery(document).ready(function( $ ) {
|
|
45 |
return false;
|
46 |
}
|
47 |
|
48 |
-
var val = $(this).val();
|
49 |
|
50 |
if (searchTimeout != null) {
|
51 |
clearTimeout(searchTimeout);
|
45 |
return false;
|
46 |
}
|
47 |
|
48 |
+
var val = $(this).val().toLowerCase();
|
49 |
|
50 |
if (searchTimeout != null) {
|
51 |
clearTimeout(searchTimeout);
|
assets/js/frontend.js
CHANGED
@@ -47,22 +47,22 @@
|
|
47 |
},
|
48 |
|
49 |
widgetPostMedia: function( $scope ) {
|
50 |
-
var gallery = $scope.find( '.wpr-gallery-slider' ),
|
51 |
-
|
52 |
|
53 |
-
gallery.animate({ 'opacity' : '1' }, 1000 );//tmp
|
54 |
|
55 |
-
if ( '[]' !== gallerySettings ) {
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
}
|
66 |
|
67 |
// Lightbox
|
68 |
var lightboxSettings = $( '.wpr-featured-media-image' ).attr( 'data-lightbox' );
|
@@ -383,9 +383,11 @@
|
|
383 |
|
384 |
if ( ! currentItem.hasClass( 'wpr-sub-open' ) ) {
|
385 |
e.preventDefault();
|
|
|
386 |
subMenuAnimation( childrenSub, true );
|
387 |
|
388 |
} else {
|
|
|
389 |
subMenuAnimation( childrenSub, false );
|
390 |
}
|
391 |
});
|
47 |
},
|
48 |
|
49 |
widgetPostMedia: function( $scope ) {
|
50 |
+
// var gallery = $scope.find( '.wpr-gallery-slider' ),
|
51 |
+
// gallerySettings = gallery.attr( 'data-slick' );
|
52 |
|
53 |
+
// gallery.animate({ 'opacity' : '1' }, 1000 );//tmp
|
54 |
|
55 |
+
// if ( '[]' !== gallerySettings ) {
|
56 |
+
// gallery.slick({
|
57 |
+
// appendDots : $scope.find( '.wpr-gallery-slider-dots' ),
|
58 |
+
// customPaging : function ( slider, i ) {
|
59 |
+
// var slideNumber = (i + 1),
|
60 |
+
// totalSlides = slider.slideCount;
|
61 |
|
62 |
+
// return '<span class="wpr-gallery-slider-dot"></span>';
|
63 |
+
// }
|
64 |
+
// });
|
65 |
+
// }
|
66 |
|
67 |
// Lightbox
|
68 |
var lightboxSettings = $( '.wpr-featured-media-image' ).attr( 'data-lightbox' );
|
383 |
|
384 |
if ( ! currentItem.hasClass( 'wpr-sub-open' ) ) {
|
385 |
e.preventDefault();
|
386 |
+
currentItem.addClass('wpr-sub-open');
|
387 |
subMenuAnimation( childrenSub, true );
|
388 |
|
389 |
} else {
|
390 |
+
currentItem.removeClass('wpr-sub-open');
|
391 |
subMenuAnimation( childrenSub, false );
|
392 |
}
|
393 |
});
|
assets/js/frontend.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
(function(t){"use strict";var e={init:function(){var i={"wpr-nav-menu.default":e.widgetNavMenu,"wpr-onepage-nav.default":e.OnepageNav,"wpr-grid.default":e.widgetGrid,"wpr-magazine-grid.default":e.widgetMagazineGrid,"wpr-media-grid.default":e.widgetGrid,"wpr-woo-grid.default":e.widgetGrid,"wpr-featured-media.default":e.widgetFeaturedMedia,"wpr-product-media.default":e.widgetProductMedia,"wpr-countdown.default":e.widgetCountDown,"wpr-google-maps.default":e.widgetGoogleMaps,"wpr-before-after.default":e.widgetBeforeAfter,"wpr-mailchimp.default":e.widgetMailchimp,"wpr-advanced-slider.default":e.widgetAdvancedSlider,"wpr-testimonial.default":e.widgetTestimonialCarousel,"wpr-search.default":e.widgetSearch,"wpr-advanced-text.default":e.widgetAdvancedText,"wpr-progress-bar.default":e.widgetProgressBar,"wpr-image-hotspots.default":e.widgetImageHotspots,"wpr-flip-box.default":e.widgetFlipBox,"wpr-content-ticker.default":e.widgetContentTicker,"wpr-tabs.default":e.widgetTabs,"wpr-content-toggle.default":e.widgetContentToogle,"wpr-back-to-top.default":e.widgetBackToTop,"wpr-lottie-animations.default":e.widgetLottieAnimations,"wpr-posts-timeline.default":e.widgetPostsTimeline,"wpr-sharing-buttons.default":e.widgetSharingButtons,"wpr-flip-carousel.default":e.widgetFlipCarousel,"wpr-feature-list.default":e.widgetFeatureList,global:e.widgetSection,"wpr-post-media.default":e.widgetPostMedia};t.each(i,function(e,t){window.elementorFrontend.hooks.addAction("frontend/element_ready/"+e,t)})},widgetPostMedia:function(i){var r=i.find(".wpr-gallery-slider"),a=r.attr("data-slick");r.animate({opacity:"1"},1e3),"[]"!==a&&r.slick({appendDots:i.find(".wpr-gallery-slider-dots"),customPaging:function(e,t){e.slideCount;return"<span class=\"wpr-gallery-slider-dot\"></span>"}});var s=t(".wpr-featured-media-image").attr("data-lightbox");if(typeof s!=typeof void 0&&!1!==s&&!e.editorCheck()){var l=i.find(".wpr-featured-media-wrap");s=JSON.parse(s),l.lightGallery(s),l.on("onAferAppendSlide.lg, onAfterSlide.lg",function(){var e=t("#lg-actual-size, #lg-zoom-in, #lg-zoom-out, #lg-download"),i=t("#lg-download").attr("href");t("#lg-download").length&&(-1===i.indexOf("wp-content")?e.addClass("wpr-hidden-element"):e.removeClass("wpr-hidden-element")),""===s.autoplay&&t(".lg-autoplay-button").css({width:"0",height:"0",overflow:"hidden"})})}},widgetSection:function(i){function r(t){var r=JSON.parse(t),a=e.editorCheck()?i.find(".wpr-particle-wrapper").attr("wpr-quantity"):i.attr("wpr-quantity"),s=e.editorCheck()?i.find(".wpr-particle-wrapper").attr("wpr-color")?i.find(".wpr-particle-wrapper").attr("wpr-color"):"#000000":i.attr("wpr-color")||"#000000",l=e.editorCheck()?i.find(".wpr-particle-wrapper").attr("wpr-speed"):i.attr("wpr-speed"),n=e.editorCheck()?i.find(".wpr-particle-wrapper").attr("wpr-shape"):i.attr("wpr-shape"),o=e.editorCheck()?i.find(".wpr-particle-wrapper").attr("wpr-size"):i.attr("wpr-size");return r.particles.size.value=o,r.particles.number.value=a,r.particles.color.value=s,r.particles.shape.type=n,r.particles.line_linked.color=s,r.particles.move.speed=l,r}if(function(){function e(){if(document.querySelector(".wpr-mybar")){var e=document.body.scrollTop||document.documentElement.scrollTop,t=document.documentElement.scrollHeight-document.documentElement.clientHeight;document.querySelector("#wpr-mybar").style.width=100*(e/t)+"%"}}e(),window.onscroll=function(){e()},t("#wpadminbar").length&&t(".wpr-reading-progress-bar-container").length&&0===t(".wpr-reading-progress-bar-container").position().top&&t(".wpr-reading-progress-bar-container").css("top"," 32px")}(),(i.attr("data-wpr-particles")||i.find(".wpr-particle-wrapper").attr("data-wpr-particles-editor"))&&function(){var a=i.data("element_type"),s=i.data("id"),l=e.editorCheck()?i.find(".wpr-particle-wrapper").attr("data-wpr-particles-editor"):i.attr("data-wpr-particles");"section"===a&&void 0!==l&&(e.editorCheck()?i.hasClass("wpr-particle-yes")?(particlesJS("wpr-particle-"+s,"wpr_particle_json_custom"==i.find(".wpr-particle-wrapper").attr("particle-source")?JSON.parse(l):r(l)),i.find(".elementor-column").css("z-index",9),t(window).trigger("resize")):i.find(".wpr-particle-wrapper").remove():(i.prepend("<div class=\"wpr-particle-wrapper\" id=\"wpr-particle-"+s+"\"></div>"),particlesJS("wpr-particle-"+s,"wpr_particle_json_custom"==i.attr("particle-source")?JSON.parse(l):r(l))))}(),(i.hasClass("wpr-jarallax")||i.hasClass("wpr-jarallax-yes"))&&function(){i.hasClass("wpr-jarallax-yes")&&(!e.editorCheck()&&i.hasClass("wpr-jarallax")?(i.css("background-image","url(\""+i.attr("bg-image")+"\")"),i.jarallax({type:i.attr("scroll-effect"),speed:i.attr("speed-data")})):e.editorCheck()&&(i.css("background-image","url(\""+i.find(".wpr-jarallax").attr("bg-image-editor")+"\")"),i.jarallax({type:i.find(".wpr-jarallax").attr("scroll-effect-editor"),speed:i.find(".wpr-jarallax").attr("speed-data-editor")})))}(),i.hasClass("wpr-parallax-yes")&&function(){if(i.hasClass("wpr-parallax-yes")){var r=document.getElementsByClassName("wpr-parallax-multi-layer"),a=Array.from(r).map(e=>new Parallax(e,{invertY:"yes"==e.getAttribute("direction"),invertX:"yes"==e.getAttribute("direction"),scalarX:e.getAttribute("scalar-speed"),scalarY:e.getAttribute("scalar-speed"),hoverOnly:!0,pointerEvents:!0}));a.forEach(e=>{e.friction(.2,.2)})}if(!e.editorCheck()){var s=[];document.querySelectorAll(".wpr-parallax-multi-layer").forEach(e=>{e.parentElement.style.position="relative",e.style.position="absolute",s.push(e),e.remove()}),document.querySelectorAll(".wpr-parallax-ml-children").forEach(e=>{e.style.position="absolute",e.style.top=e.getAttribute("style-top"),e.style.left=e.getAttribute("style-left")}),t(".wpr-parallax-yes").each(function(e){t(this).append(s[e])})}}(),i.hasClass("wpr-sticky-section-yes")){function r(){if(!i.hasClass("wpr-sticky-section-yes")||!i.find(".wpr-sticky-section-yes-editor"))return void(a="static");var e=[],t=[["mobile_sticky",768],["mobile_extra_sticky",881],["tablet_sticky",1025],["tablet_extra_sticky",1201],["laptop_sticky",1216],["desktop_sticky",2400],["widescreen_sticky",4e3]].filter(e=>-1!=c.indexOf(e[0])).reverse();t.forEach((t,i)=>{t[1]>d&&-1===p.indexOf(t[0])?(a=-1===c?.indexOf(t[0])?e[i-1]?e[i-1]:l:"static",e[i]=a):t[1]>d&&-1!==p.indexOf(t[0])&&(a=l)}),h()}function h(){var e=+window.innerHeight-(+i.css("top").slice(0,-2)+i.height()),t=+window.innerHeight-(+i.css("bottom").slice(0,-2)+i.height());"top"===n?(i.css({position:a}),""!==g&&g.css({position:a,top:o+"px",bottom:"auto","z-index":y,width:"100%"})):(i.css({position:a}),""!==g&&(g=g.find(".wpr-sticky-section-yes"),g.css({position:a,bottom:o+"px",top:"auto","z-index":y,width:"100%"})))}function u(){t("#wpadminbar").length&&(s=t("#wpadminbar").css("height").slice(0,t("#wpadminbar").css("height").length-2),"top"===n&&("fixed"==i.css("position")||"sticky"==i.css("position"))&&(i.css("top",+s+m+"px"),i.css("bottom","auto")))}var a,s,l=e.editorCheck()?i.find(".wpr-sticky-section-yes-editor").attr("data-wpr-position-type"):i.attr("data-wpr-position-type"),n=e.editorCheck()?i.find(".wpr-sticky-section-yes-editor").attr("data-wpr-position-location"):i.attr("data-wpr-position-location"),o=e.editorCheck()?i.find(".wpr-sticky-section-yes-editor").attr("data-wpr-position-offset"):i.attr("data-wpr-position-offset"),d=t("body").prop("clientWidth")+17,p=e.editorCheck()?i.find(".wpr-sticky-section-yes-editor").attr("data-wpr-sticky-devices"):i.attr("data-wpr-sticky-devices"),c=e.editorCheck()?i.find(".wpr-sticky-section-yes-editor").attr("data-wpr-active-breakpoints"):i.attr("data-wpr-active-breakpoints"),f=!!(i.hasClass("wpr-sticky-section-yes")||i.find(".wpr-sticky-section-yes-editor")),m=+i.css("top").slice(0,-2),g=i.closest("div[data-elementor-type=\"wp-post\"]").length?i.closest("div[data-elementor-type=\"wp-post\"]"):"",y=e.editorCheck()?i.find(".wpr-sticky-section-yes-editor").attr("data-wpr-z-index"):i.attr("data-wpr-z-index");if(i.find(".wpr-sticky-section-yes-editor").length||(l=i.attr("data-wpr-position-type"),n=i.attr("data-wpr-position-location"),o=i.attr("data-wpr-position-offset"),p=i.attr("data-wpr-sticky-devices"),c=i.attr("data-wpr-active-breakpoints"),y=i.attr("data-wpr-z-index")),0==p.length&&(l="static"),e.editorCheck()&&p){var w=i.find(".wpr-sticky-section-yes-editor").attr("data-wpr-sticky-devices");i.attr("data-wpr-sticky-devices",w),p=i.attr("data-wpr-sticky-devices")}r(),u(),t(window).resize(function(){d=t("body").prop("clientWidth")+17,r()}),f||(a="static")}},widgetNavMenu:function(i){function r(){if(i.hasClass("wpr-mobile-menu-full-width")&&i.closest(".elementor-column").length){var e=i.closest(".elementor-column"),t=i.closest(".elementor-top-section").outerWidth()-2*d.offset().left,r=e.offset().left+parseInt(e.css("padding-left"),10);d.css({width:t+"px",left:-r+"px"})}}function a(e,t){!0===t?i.hasClass("wpr-sub-menu-fx-slide")?e.stop().slideDown():e.stop().fadeIn():i.hasClass("wpr-sub-menu-fx-slide")?e.stop().slideUp():e.stop().fadeOut()}var s=i.find(".wpr-nav-menu-container"),l=i.find(".wpr-mobile-nav-menu-container"),n=s.find(".wpr-nav-menu > li.menu-item-has-children"),o=s.find(".wpr-sub-menu li.menu-item-has-children");"click"===s.attr("data-trigger")?(n.children("a").on("click",function(r){var e=t(this).parent(),l=e.children(".wpr-sub-menu");n.not(e).removeClass("wpr-sub-open"),(s.hasClass("wpr-nav-menu-horizontal")||s.hasClass("wpr-nav-menu-vertical")&&i.hasClass("wpr-sub-menu-position-absolute"))&&a(n.children(".wpr-sub-menu"),!1),e.hasClass("wpr-sub-open")?(e.removeClass("wpr-sub-open"),a(l,!1)):(r.preventDefault(),e.addClass("wpr-sub-open"),a(l,!0))}),o.on("click",function(i){var e=t(this),r=e.children(".wpr-sub-menu");s.hasClass("wpr-nav-menu-horizontal")&&a(o.find(".wpr-sub-menu"),!1),e.hasClass("wpr-sub-open")?a(r,!1):(i.preventDefault(),a(r,!0))}),t(document).mouseup(function(t){n.is(t.target)||0!==n.has(t.target).length||(n.not().removeClass("wpr-sub-open"),a(n.children(".wpr-sub-menu"),!1)),o.is(t.target)||0!==o.has(t.target).length||(o.removeClass("wpr-sub-open"),a(o.children(".wpr-sub-menu"),!1))})):(n.on("mouseenter",function(){s.hasClass("wpr-nav-menu-vertical")&&i.hasClass("wpr-sub-menu-position-absolute")&&s.find("li").not(this).children(".wpr-sub-menu").hide(),a(t(this).children(".wpr-sub-menu"),!0)}),o.on("mouseenter",function(){a(t(this).children(".wpr-sub-menu"),!0)}),s.hasClass("wpr-nav-menu-horizontal")?(n.on("mouseleave",function(){a(t(this).children(".wpr-sub-menu"),!1)}),o.on("mouseleave",function(){a(t(this).children(".wpr-sub-menu"),!1)})):s.on("mouseleave",function(){a(t(this).find(".wpr-sub-menu"),!1)}));var d=l.find(".wpr-mobile-nav-menu");l.find(".wpr-mobile-toggle").on("click",function(){t(this).toggleClass("wpr-mobile-toggle-fx"),t(this).hasClass(".wpr-mobile-toggle-open")?(t(this).removeClass(".wpr-mobile-toggle-open"),t(this).trigger("focusout"),t(this).find(".wpr-mobile-toggle-text").length&&(t(this).children().eq(1).hide(),t(this).children().eq(0).show())):(t(this).addClass(".wpr-mobile-toggle-open"),t(this).find(".wpr-mobile-toggle-text").length&&(t(this).children().eq(0).hide(),t(this).children().eq(1).show())),t(this).parent().next().stop().slideToggle(),r()}),d.find(".sub-menu").removeClass("wpr-sub-menu").addClass("wpr-mobile-sub-menu"),d.find(".menu-item-has-children").children("a").on("click",function(i){var e=t(this).closest("li");e.hasClass("wpr-mobile-sub-open")?(e.removeClass("wpr-mobile-sub-open"),e.children(".wpr-mobile-sub-menu").first().stop().slideUp()):(i.preventDefault(),e.addClass("wpr-mobile-sub-open"),e.children(".wpr-mobile-sub-menu").first().stop().slideDown())}),r(),t(window).smartresize(function(){r()})},OnepageNav:function(e){function i(i){"yes"!==e.find(".wpr-onepage-nav").attr("data-highlight")||(e.find(".wpr-onepage-nav-item").children("a").removeClass("wpr-onepage-active-item"),t(".elementor-section").each(function(){var r=t(this).offset().top,a=r+t(this).outerHeight();i>=r&&i<a&&e.find(".wpr-onepage-nav-item").children("a[href=\"#"+t(this).attr("id")+"\"]").addClass("wpr-onepage-active-item")}))}e.find(".wpr-onepage-nav-item").on("click",function(e){e.preventDefault();var r=t(t(this).find("a").attr("href")),a=parseInt(t(this).parent().attr("data-speed"),10);t("html,body").animate({scrollTop:r.offset().top},a),i(t(window).scrollTop())}),"yes"===e.find(".wpr-onepage-nav").attr("data-highlight")&&setTimeout(function(){t(window).scroll()},10),t(window).scroll(function(){i(t(this).scrollTop())})},widgetGrid:function(r){function a(){if(r.find(".wpr-sharing-trigger").length){var e=r.find(".wpr-sharing-trigger"),i=r.find(".wpr-post-sharing-inner"),a=5;i.first().find("a").each(function(){a+=t(this).outerWidth()+parseInt(t(this).css("margin-right"),10)});var s=parseInt(i.find("a").css("margin-right"),10);"left"===e.attr("data-direction")?(i.css("width",a+"px"),i.css("left",-(s+a)+"px")):"right"===e.attr("data-direction")?(i.css("width",a+"px"),i.css("right",-(s+a)+"px")):"top"===e.attr("data-direction")?(i.find("a").css({"margin-right":"0","margin-top":s+"px"}),i.css({top:-s+"px",left:"50%","-webkit-transform":"translate(-50%, -100%)",transform:"translate(-50%, -100%)"})):"right"===e.attr("data-direction")?(i.css("width",a+"px"),i.css({left:s+"px"})):"bottom"===e.attr("data-direction")&&(i.find("a").css({"margin-right":"0","margin-bottom":s+"px"}),i.css({bottom:-s+"px",left:"50%","-webkit-transform":"translate(-50%, 100%)",transform:"translate(-50%, 100%)"})),"click"===e.attr("data-action")?e.on("click",function(){var e=t(this).next();"hidden"===e.css("visibility")?(e.css("visibility","visible"),e.find("a").css({opacity:"1",top:"0"}),setTimeout(function(){e.find("a").addClass("wpr-no-transition-delay")},100*e.find("a").length)):(e.find("a").removeClass("wpr-no-transition-delay"),e.find("a").css({opacity:"0",top:"-5px"}),setTimeout(function(){e.css("visibility","hidden")},100*e.find("a").length))}):(e.on("mouseenter",function(){var e=t(this).next();e.css("visibility","visible"),e.find("a").css({opacity:"1",top:"0"}),setTimeout(function(){e.find("a").addClass("wpr-no-transition-delay")},100*e.find("a").length)}),r.find(".wpr-grid-item-sharing").on("mouseleave",function(){var e=t(this).find(".wpr-post-sharing-inner");e.find("a").removeClass("wpr-no-transition-delay"),e.find("a").css({opacity:"0",top:"-5px"}),setTimeout(function(){e.css("visibility","hidden")},100*e.find("a").length)}))}}function s(){"yes"!==p.find(".wpr-grid-media-wrap").attr("data-overlay-link")||e.editorCheck()||(p.find(".wpr-grid-media-wrap").css("cursor","pointer"),p.find(".wpr-grid-media-wrap").on("click",function(e){var i=e.target.className;if(-1!==i.indexOf("inner-block")||-1!==i.indexOf("wpr-cv-inner")||-1!==i.indexOf("wpr-grid-media-hover")){e.preventDefault();var r=t(this).find(".wpr-grid-media-hover-bg").attr("data-url"),r=r.replace("#new_tab","");"_blank"===p.find(".wpr-grid-item-title a").attr("target")?window.open(r,"_blank").focus():window.location.href=r}}))}function l(i){if(-1!==r.find(".wpr-grid-item-lightbox").length){var a=r.find(".wpr-grid-item-lightbox"),s=a.find(".wpr-grid-lightbox-overlay").first();a.each(function(){var e=t(this).find(".inner-block > span").attr("data-src"),i=t(this).closest("article").not(".slick-cloned");p.hasClass("wpr-media-grid")||i.find(".wpr-grid-image-wrap").attr("data-src",e);var r=i.find(".wpr-grid-image-wrap").attr("data-src");typeof r!="undefined"&&!1!==r&&-1===r.indexOf("wp-content")&&i.find(".wpr-grid-image-wrap").attr("data-iframe","true")}),p.lightGallery(i.lightbox),p.on("onAfterOpen.lg",function(){t(".lg-outer").find(".lg-thumb-item").length&&t(".lg-outer").find(".lg-thumb-item").each(function(){var e=t(this).find("img").attr("src"),i=e,r=e.lastIndexOf("."),a=e.slice(r),s=e.lastIndexOf("-"),l=!!/\d{3,}x\d{3,}/.test(e.substring(r,s))&&e.substring(r,s);42<=e.substring(r,s).length&&(l=""),""!==l&&(!1===l?i=[e.slice(0,r),"-150x150",e.slice(r)].join(""):i=e.replace(l,"-150x150")),t(this).find("img").attr("src",i)})}),r.find(".wpr-grid").on("onAferAppendSlide.lg, onAfterSlide.lg",function(){var e=t("#lg-actual-size, #lg-zoom-in, #lg-zoom-out, #lg-download"),r=t("#lg-download").attr("href");t("#lg-download").length&&(-1===r.indexOf("wp-content")?e.addClass("wpr-hidden-element"):e.removeClass("wpr-hidden-element")),""===i.lightbox.autoplay&&t(".lg-autoplay-button").css({width:"0",height:"0",overflow:"hidden"})}),s.length?(r.find(".wpr-grid-media-hover-bg").after(s.remove()),r.find(".wpr-grid-lightbox-overlay").on("click",function(){e.editorCheck()?alert("Lightbox is Disabled in the Editor!"):t(this).closest("article").find(".wpr-grid-image-wrap").trigger("click")})):a.find(".inner-block > span").on("click",function(){if(!e.editorCheck()){var i=t(this).closest("article").find(".wpr-grid-image-wrap");i.trigger("click")}else alert("Lightbox is Disabled in the Editor!")})}}function n(){r.find(".wpr-post-like-button").length&&r.find(".wpr-post-like-button").on("click",function(){var e=t(this);return""!==e.attr("data-post-id")&&t.ajax({type:"POST",url:e.attr("data-ajax"),data:{action:"wpr_likes_init",post_id:e.attr("data-post-id"),nonce:e.attr("data-nonce")},beforeSend:function(){e.fadeTo(500,.5)},success:function(t){var i=e.attr("data-icon"),r=t.count;""===r.replace(/<\/?[^>]+(>|$)/g,"")?(r="<span class=\"wpr-post-like-count\">"+e.attr("data-text")+"</span>",!e.hasClass("wpr-likes-zero")&&e.addClass("wpr-likes-zero")):e.removeClass("wpr-likes-zero"),e.hasClass("wpr-already-liked")?(e.prop("title","Like"),e.removeClass("wpr-already-liked"),e.html("<i class=\""+i+"\"></i>"+r)):(e.prop("title","Unlike"),e.addClass("wpr-already-liked"),e.html("<i class=\""+i.replace("far","fas")+"\"></i>"+r)),e.fadeTo(500,1)}}),!1})}function o(e){for(var a,s,l,n,o=r.find(".wpr-grid"),d=o.find(".wpr-grid-item"),p=d.filter(":visible"),c=e.layout,f=e.media_align,m=e.media_width,g=e.media_distance,y=3,w=1,h=2,u=parseInt(e.columns_desktop,10),b=e.gutter_hr,T=e.gutter_vr,v=o.width()+b-.3,k=t("body").prop("clientWidth"),x=400,C=r.attr("class"),C=C.split(" "),_=0;_<C.length-1;_++)-1!==C[_].search(/mobile\d/)&&(w=C[_].slice(-1)),-1!==C[_].search(/mobile_extra\d/)&&(a=C[_].slice(-1)),-1!==C[_].search(/tablet\d/)&&(h=C[_].slice(-1)),-1!==C[_].search(/tablet_extra\d/)&&(s=C[_].slice(-1)),-1!==C[_].search(/widescreen\d/)&&(n=C[_].slice(-1)),-1!==C[_].search(/laptop\d/)&&(l=C[_].slice(-1));y=440>=k?w:768>=k?a?a:h:881>=k?h:1025>=k?s?s:h:1201>=k?l?l:u:1920>=k?u:2300>=k?u:2650>=k?n?n:u+1:3e3>=k?n?n:u+2:n?n:u+3,8<y&&(y=8),"string"==typeof y&&-1!==y.indexOf("pro")&&(y=3),d.outerWidth(Math.floor(v/y-b)),d.css("margin-bottom",T+"px"),1===y&&d.last().css("margin-bottom","0");var S=-1;if(p.each(function(){var e=t(this).outerHeight(),i=parseInt(t(this).css("top"),10);i>S&&(S=i)}),"fitRows"===c&&p.each(function(){parseInt(t(this).css("top"))===S&&t(this).addClass("rf-last-row")}),"list"===c){var z=d.find(".wpr-grid-image-wrap").outerHeight();if(d.find(".wpr-grid-item-below-content").css("min-height",z+"px"),480>t("body").prop("clientWidth"))d.find(".wpr-grid-media-wrap").css({float:"none",width:"100%"}),d.find(".wpr-grid-item-below-content").css({float:"none",width:"100%"}),d.find(".wpr-grid-image-wrap").css("padding","0"),d.find(".wpr-grid-item-below-content").css("min-height","0"),"zigzag"===f&&d.find("[class*=\"elementor-repeater-item\"]").css("text-align","center");else if("zigzag"!==f){d.find(".wpr-grid-media-wrap").css({float:f,width:m+"%"});var j="left"===f?"margin-right":"margin-left";d.find(".wpr-grid-media-wrap").css(j,g+"px"),d.find(".wpr-grid-item-below-content").css({float:f,width:"calc((100% - "+m+"%) - "+g+"px)"})}else d.filter(":even").find(".wpr-grid-media-wrap").css({float:"left",width:m+"%"}),d.filter(":even").find(".wpr-grid-item-below-content").css({float:"left",width:"calc((100% - "+m+"%) - "+g+"px)"}),d.filter(":even").find(".wpr-grid-media-wrap").css("margin-right",g+"px"),d.filter(":odd").find(".wpr-grid-media-wrap").css({float:"right",width:m+"%"}),d.filter(":odd").find(".wpr-grid-item-below-content").css({float:"right",width:"calc((100% - "+m+"%) - "+g+"px)"}),d.filter(":odd").find(".wpr-grid-media-wrap").css("margin-left",g+"px"),o.hasClass("wpr-grid-list-ready")||d.each(function(e){var i=t(this).find("[class*=\"elementor-repeater-item\"]");0==e%2?i.each(function(){if(!t(this).hasClass("wpr-grid-item-align-center")){"none"===t(this).css("float")?t(this).css("text-align","left"):t(this).css("float","left");t(this).find(".inner-block")}}):i.each(function(e){if(!t(this).hasClass("wpr-grid-item-align-center")){"none"===t(this).css("float")?t(this).css("text-align","right"):t(this).css("float","right");var i=t(this).find(".inner-block");"0px"!==i.css("margin-left")&&(i.css("margin-right",i.css("margin-left")),i.css("margin-left","0")),0===e&&"0px"!==i.css("margin-right")&&(i.css("margin-left",i.css("margin-right")),i.css("margin-right","0"))}})}),setTimeout(function(){o.hasClass("wpr-grid-list-ready")||o.addClass("wpr-grid-list-ready")},500)}"list"===c&&(c="fitRows"),"default"!==e.filters_animation&&(x=0);o.isotope({layoutMode:c,masonry:{comlumnWidth:v/y,gutter:b},fitRows:{comlumnWidth:v/y,gutter:b},transitionDuration:x,percentPosition:!0})}function d(e){if("yes"===e.filters_count&&r.find(".wpr-grid-filters a, .wpr-grid-filters span").each(function(){"*"===t(this).attr("data-filter")?t(this).find("sup").text(r.find(".wpr-grid-filters").next().find("article").length):t(this).find("sup").text(r.find(t(this).attr("data-filter")).length)}),"yes"!==e.filters_linkable){if("yes"===e.deeplinking){var i=window.location.hash.replace("#filter:",".");window.location.hash.match("#filter:all")&&(i="*");var a=r.find(".wpr-grid-filters span[data-filter=\""+i+"\"]:not(.wpr-back-filter)"),s=a.parent();"parent"===a.parent().attr("data-role")?s.parent("ul").find("ul[data-parent=\""+i+"\"]").length&&(s.parent("ul").children("li").css("display","none"),s.siblings("ul[data-parent=\""+i+"\"]").css("display","block")):"sub"===a.parent().attr("data-role")&&(s.closest(".wpr-grid-filters").children("li").css("display","none"),s.parent("ul").css("display","inline-block")),r.find(".wpr-grid-filters span").removeClass("wpr-active-filter"),a.addClass("wpr-active-filter"),r.find(".wpr-grid").isotope({filter:i}),e.lightbox.selector="*"===i?" .wpr-grid-image-wrap":i+" .wpr-grid-image-wrap",l(e)}"yes"===e.filters_hide_empty&&r.find(".wpr-grid-filters span").each(function(){var e=t(this).attr("data-filter");"*"!==e&&(0===p.find(e).length?t(this).parent("li").addClass("wpr-hidden-element"):t(this).parent("li").removeClass("wpr-hidden-element"))}),""!==e.filters_default_filter&&setTimeout(function(){r.find(".wpr-grid-filters").find("span[data-filter*=\"-"+e.filters_default_filter+"\"]")[0].click()},100),r.find(".wpr-grid-filters span").on("click",function(){var i=t(this).data("filter"),a=t(this).parent("li"),s=a.attr("data-role");if(r.find(".wpr-grid-filters span").removeClass("wpr-active-filter"),t(this).addClass("wpr-active-filter"),"parent"===s?a.parent("ul").find("ul[data-parent=\""+i+"\"]").length&&(a.parent("ul").children("li").css("display","none"),a.siblings("ul[data-parent=\""+i+"\"]").css("display","block")):"back"===s&&(a.closest(".wpr-grid-filters").children("li").css("display","inline-block"),a.parent().css("display","none")),"yes"===e.deeplinking){var l="#filter:"+i.replace(".","");"*"===i&&(l="#filter:all"),window.location.href=window.location.pathname+window.location.search+l}"infinite-scroll"===e.pagination_type&&0===p.find(t(this).attr("data-filter")).length&&r.find(".wpr-grid").infiniteScroll("loadNextPage"),"default"!==e.filters_animation&&r.find(".wpr-grid-item-inner").css({opacity:"0",transition:"none"}),"fade-slide"===e.filters_animation?r.find(".wpr-grid-item-inner").css("top","20px"):"zoom"===e.filters_animation?r.find(".wpr-grid-item-inner").css("transform","scale(0.01)"):r.find(".wpr-grid-item-inner").css({top:"0",transform:"scale(1)"}),r.find(".wpr-grid").isotope({filter:i}),e.lightbox.selector="*"===i?" .wpr-grid-image-wrap":i+" .wpr-grid-image-wrap",p.data("lightGallery").destroy(!0),p.lightGallery(e.lightbox)})}}var p=r.find(".wpr-grid");if(p.length){var c=p.attr("data-settings");if("undefined"==typeof c||!1===c){p.animate({opacity:"1"},1e3);var f=r.attr("class"),m=f.match(/wpr-grid-slider-columns-\d/)?f.match(/wpr-grid-slider-columns-\d/).join().slice(-1):2,g=f.match(/columns--widescreen\d/)?f.match(/columns--widescreen\d/).join().slice(-1):m,y=f.match(/columns--laptop\d/)?f.match(/columns--laptop\d/).join().slice(-1):m,w=f.match(/columns--tablet_extra\d/)?f.match(/columns--tablet_extra\d/).join().slice(-1):h,h=f.match(/columns--tablet\d/)?f.match(/columns--tablet\d/).join().slice(-1):2,u=f.match(/columns--mobile_extra\d/)?f.match(/columns--mobile_extra\d/).join().slice(-1):h,b=f.match(/columns--mobile\d/)?f.match(/columns--mobile\d/).join().slice(-1):1,T=f.match(/wpr-grid-slides-to-scroll-\d/)?+f.match(/wpr-grid-slides-to-scroll-\d/).join().slice(-1):1;if(p.slick({appendDots:r.find(".wpr-grid-slider-dots"),customPaging:function(e,t){e.slideCount;return"<span class=\"wpr-grid-slider-dot\"></span>"},slidesToShow:m,responsive:[{breakpoint:1e4,settings:{slidesToShow:g,slidesToScroll:T>g?1:T}},{breakpoint:2399,settings:{slidesToShow:m,slidesToScroll:T>m?1:T}},{breakpoint:1221,settings:{slidesToShow:y,slidesToScroll:T>y?1:T}},{breakpoint:1200,settings:{slidesToShow:w,slidesToScroll:T>w?1:T}},{breakpoint:1024,settings:{slidesToShow:h,slidesToScroll:T>h?1:T}},{breakpoint:880,settings:{slidesToShow:u,slidesToScroll:T>u?1:T}},{breakpoint:768,settings:{slidesToShow:b,slidesToScroll:T>b?1:T}}]}),r.find(".slick-dots").length&&r.hasClass("wpr-grid-slider-dots-horizontal")){var v=r.find(".slick-dots li").outerWidth()*r.find(".slick-dots li").length-parseInt(r.find(".slick-dots li span").css("margin-right"),10);r.find(".slick-dots").length&&r.find(".slick-dots").css("width",v),t(window).on("resize",function(){setTimeout(function(){var e=r.find(".slick-dots li").outerWidth()*r.find(".slick-dots li").length-parseInt(r.find(".slick-dots li span").css("margin-right"),10);r.find(".slick-dots").css("width",e)},300)})}c=JSON.parse(p.attr("data-slick"))}else if(c=JSON.parse(p.attr("data-settings")),o(c),setTimeout(function(){o(c)},100),e.editorCheck()&&(setTimeout(function(){o(c)},500),setTimeout(function(){o(c)},1e3)),t(window).on("load",function(){setTimeout(function(){o(c)},100)}),t(window).smartresize(function(){setTimeout(function(){o(c)},200)}),d(c),p.on("arrangeComplete",function(e,i){var a=0,s=0,l=c.animation_delay,n=c.animation_duration,o=c.filters_animation_duration;if(p.hasClass("grid-images-loaded"))l=0;else if(p.css("opacity","1"),"default"===c.animation&&"default"===c.filters_animation)return;for(var d in i){l+=c.animation_delay,r.find(i[d].element).find(".wpr-grid-item-inner").css({opacity:"1",top:"0",transform:"scale(1)",transition:"all "+n+"s ease-in "+l+"s"}),s+=c.filters_animation_delay,p.hasClass("grid-images-loaded")&&r.find(i[d].element).find(".wpr-grid-item-inner").css({transition:"all "+o+"s ease-in "+s+"s"});var f=window.location.hash;0<=f.indexOf("#filter:")&&0>f.indexOf("#filter:*")&&(f=f.replace("#filter:",""),r.find(i[d].element).filter(function(){if(t(this).hasClass(f))return a+=c.filters_animation_delay,t(this)}).find(".wpr-grid-item-inner").css({"transition-delay":a+"s"}))}}),p.imagesLoaded().progress(function(){"1"!==p.css("opacity")&&p.css("opacity","1"),setTimeout(function(){p.addClass("grid-images-loaded")},500)}),("load-more"===c.pagination_type||"infinite-scroll"===c.pagination_type)&&r.find(".wpr-grid-pagination").length&&!e.editorCheck()){var k=r.find(".wpr-grid-pagination"),x=".elementor-element-"+r.attr("data-id"),C=!1,_=!1;"infinite-scroll"===c.pagination_type&&(_=300,C=x+" .wpr-load-more-btn"),p.infiniteScroll({path:x+" .wpr-grid-pagination a",hideNav:C,append:!1,history:!1,scrollThreshold:_,status:x+" .page-load-status",onInit:function(){this.on("load",function(){p.removeClass("grid-images-loaded")})}}),p.on("request.infiniteScroll",function(){k.find(".wpr-load-more-btn").hide(),k.find(".wpr-pagination-loading").css("display","inline-block")});var S=0;p.on("load.infiniteScroll",function(e,i){S++;var r=t(i).find(x).find(".wpr-grid-item");p.infiniteScroll("appendItems",r),p.isotope("appended",r),r.imagesLoaded().progress(function(){o(c),setTimeout(function(){o(c),d(c)},10),setTimeout(function(){p.addClass("grid-images-loaded")},500)}),k.find(".wpr-pagination-loading").hide(),c.pagination_max_pages-1===S?(k.find(".wpr-pagination-finish").fadeIn(1e3),k.delay(2e3).fadeOut(1e3),setTimeout(function(){k.find(".wpr-pagination-loading").hide()},500)):"load-more"===c.pagination_type&&k.find(".wpr-load-more-btn").fadeIn(),setTimeout(function(){n(c)},300),l(c),p.data("lightGallery").destroy(!0),p.lightGallery(c.lightbox),s(),a()}),k.find(".wpr-load-more-btn").on("click",function(){return p.infiniteScroll("loadNextPage"),!1})}if(p.find(".wpr-grid-item-add-to-cart").length){var z=p.find(".wpr-grid-item-add-to-cart").find("i"),j=z.attr("class");z.length&&(j=j.substring(j.indexOf("fa-"),j.length)),t("body").on("adding_to_cart",function(e,t){t.fadeTo("slow",.5)}),t("body").on("added_to_cart",function(e,t,i,r){r.fadeTo("slow",1),z.length&&(r.find("i").removeClass(j).addClass("fa-check"),setTimeout(function(){r.find("i").removeClass("fa-check").addClass(j)},3500))})}a(),s(),l(c),n(c)}},widgetMagazineGrid:function(i){var r=i.find(".wpr-magazine-grid-wrap"),a=r.attr("data-slick"),s=r.attr("data-slide-effect");if(typeof a!="undefined"&&!1!==a&&r.slick({fade:"fade"===s}),"yes"!==r.find(".wpr-grid-media-wrap").attr("data-overlay-link")||e.editorCheck()||(r.find(".wpr-grid-media-wrap").css("cursor","pointer"),r.find(".wpr-grid-media-wrap").on("click",function(e){var i=e.target.className;(-1!==i.indexOf("inner-block")||-1!==i.indexOf("wpr-cv-inner")||-1!==i.indexOf("wpr-grid-media-hover"))&&(e.preventDefault(),window.location.href=t(this).find(".wpr-grid-media-hover-bg").attr("data-url"))})),i.find(".wpr-sharing-trigger").length){var l=i.find(".wpr-sharing-trigger"),n=i.find(".wpr-post-sharing-inner"),o=5;n.first().find("a").each(function(){o+=t(this).outerWidth()+parseInt(t(this).css("margin-right"),10)});var d=parseInt(n.find("a").css("margin-right"),10);"left"===l.attr("data-direction")?(n.css("width",o+"px"),n.css("left",-(d+o)+"px")):"right"===l.attr("data-direction")?(n.css("width",o+"px"),n.css("right",-(d+o)+"px")):"top"===l.attr("data-direction")?(n.find("a").css({"margin-right":"0","margin-top":d+"px"}),n.css({top:-d+"px",left:"50%","-webkit-transform":"translate(-50%, -100%)",transform:"translate(-50%, -100%)"})):"right"===l.attr("data-direction")?(n.css("width",o+"px"),n.css({left:d+"px"})):"bottom"===l.attr("data-direction")&&(n.find("a").css({"margin-right":"0","margin-bottom":d+"px"}),n.css({bottom:-d+"px",left:"50%","-webkit-transform":"translate(-50%, 100%)",transform:"translate(-50%, 100%)"})),"click"===l.attr("data-action")?l.on("click",function(){var e=t(this).next();"hidden"===e.css("visibility")?(e.css("visibility","visible"),e.find("a").css({opacity:"1",top:"0"}),setTimeout(function(){e.find("a").addClass("wpr-no-transition-delay")},100*e.find("a").length)):(e.find("a").removeClass("wpr-no-transition-delay"),e.find("a").css({opacity:"0",top:"-5px"}),setTimeout(function(){e.css("visibility","hidden")},100*e.find("a").length))}):(l.on("mouseenter",function(){var e=t(this).next();e.css("visibility","visible"),e.find("a").css({opacity:"1",top:"0"}),setTimeout(function(){e.find("a").addClass("wpr-no-transition-delay")},100*e.find("a").length)}),i.find(".wpr-grid-item-sharing").on("mouseleave",function(){var e=t(this).find(".wpr-post-sharing-inner");e.find("a").removeClass("wpr-no-transition-delay"),e.find("a").css({opacity:"0",top:"-5px"}),setTimeout(function(){e.css("visibility","hidden")},100*e.find("a").length)}))}i.find(".wpr-post-like-button").length&&i.find(".wpr-post-like-button").on("click",function(){var e=t(this);return""!==e.attr("data-post-id")&&t.ajax({type:"POST",url:e.attr("data-ajax"),data:{action:"wpr_likes_init",post_id:e.attr("data-post-id"),nonce:e.attr("data-nonce")},beforeSend:function(){e.fadeTo(500,.5)},success:function(t){var i=e.attr("data-icon"),r=t.count;""===r.replace(/<\/?[^>]+(>|$)/g,"")?(r="<span class=\"wpr-post-like-count\">"+e.attr("data-text")+"</span>",!e.hasClass("wpr-likes-zero")&&e.addClass("wpr-likes-zero")):e.removeClass("wpr-likes-zero"),e.hasClass("wpr-already-liked")?(e.prop("title","Like"),e.removeClass("wpr-already-liked"),e.html("<i class=\""+i+"\"></i>"+r)):(e.prop("title","Unlike"),e.addClass("wpr-already-liked"),e.html("<i class=\""+i.replace("far","fas")+"\"></i>"+r)),e.fadeTo(500,1)}}),!1})},widgetFeaturedMedia:function(i){var r=i.find(".wpr-gallery-slider"),a=r.attr("data-slick");r.animate({opacity:"1"},1e3),"[]"!==a&&r.slick({appendDots:i.find(".wpr-gallery-slider-dots"),customPaging:function(e,t){e.slideCount;return"<span class=\"wpr-gallery-slider-dot\"></span>"}});var s=t(".wpr-featured-media-image").attr("data-lightbox");if(typeof s!=typeof void 0&&!1!==s&&!e.editorCheck()){var l=i.find(".wpr-featured-media-wrap");s=JSON.parse(s),l.lightGallery(s),l.on("onAferAppendSlide.lg, onAfterSlide.lg",function(){var e=t("#lg-actual-size, #lg-zoom-in, #lg-zoom-out, #lg-download"),i=t("#lg-download").attr("href");t("#lg-download").length&&(-1===i.indexOf("wp-content")?e.addClass("wpr-hidden-element"):e.removeClass("wpr-hidden-element")),""===s.autoplay&&t(".lg-autoplay-button").css({width:"0",height:"0",overflow:"hidden"})})}},widgetProductMedia:function(i){var r=i.find(".wpr-product-media-image"),a=i.find(".wpr-gallery-slider"),s=a.attr("data-slick");if(a.animate({opacity:"1"},1e3),"[]"!==s&&a.length){var s=JSON.parse(s);if(a.slick(),"yes"===s.thumbnail_nav){var l=i.find(".wpr-product-thumb-nav");l.slick(),l.find("li").on("click",function(){var e=t(this).attr("data-slick-index");t(this).siblings().removeClass("slick-current"),t(this).addClass("slick-current"),a.slick("slickGoTo",parseInt(e,10))})}}var n=t(".wpr-product-media-image").attr("data-lightbox");if(typeof n!="undefined"&&!1!==n&&!e.editorCheck()){var o=i.find(".wpr-product-media-wrap");n=JSON.parse(n),o.lightGallery(n),o.on("onAferAppendSlide.lg, onAfterSlide.lg",function(){var e=t("#lg-actual-size, #lg-zoom-in, #lg-zoom-out, #lg-download"),i=t("#lg-download").attr("href");t("#lg-download").length&&(-1===i.indexOf("wp-content")?e.addClass("wpr-hidden-element"):e.removeClass("wpr-hidden-element")),""===n.autoplay&&t(".lg-autoplay-button").css({width:"0",height:"0",overflow:"hidden"})})}i.hasClass("wpr-gallery-zoom-yes")&&r.on("mousemove",function(e){var i=100*((e.pageX-t(this).offset().left)/t(this).width()),r=100*((e.pageY-t(this).offset().top)/t(this).height());t(this).children("img").css({"transform-origin":i+"% "+r+"%"})})},widgetCountDown:function(i){function r(){var e=d-new Date,r={days:Math.floor(e/86400000),hours:Math.floor(e/3600000%24),minutes:Math.floor(e/1e3/60%60),seconds:Math.floor(e/1e3%60)};(0>r.days||0>r.hours||0>r.minutes)&&(r={days:0,hours:0,minutes:0,seconds:0}),i.find(".wpr-countdown-number").each(function(){var e=r[t(this).attr("data-item")];1===e.toString().length&&(e="0"+e),t(this).text(e);var i=t(this).next();if(i.length&&!t(this).hasClass("wpr-countdown-seconds")){var a=i.data("text");"01"==e?i.text(a.singular):i.text(a.plural)}}),0>e&&(clearInterval(l),a())}function a(){var r=s.data("actions");e.editorCheck()||(r.hasOwnProperty("hide-timer")&&s.hide(),r.hasOwnProperty("hide-element")&&t(r["hide-element"]).hide(),r.hasOwnProperty("message")&&!i.children(".elementor-widget-container").children(".wpr-countdown-message").length&&s.after("<div class=\"wpr-countdown-message\">"+r.message+"</div>"),r.hasOwnProperty("redirect")&&(window.location.href=r.redirect),r.hasOwnProperty("load-template")&&s.parent().find(".elementor-inner").parent().show())}var s=i.children(".elementor-widget-container").children(".wpr-countdown-wrap"),l=null,n=s.data("interval"),o=s.data("show-again"),d=new Date(1e3*n);if("evergreen"===s.data("type")){var p=new Date,c=i.attr("data-id"),f=JSON.parse(localStorage.getItem("WprCountDownSettings"))||{};d=f.hasOwnProperty(c)?0===Object.keys(f).length||n!==f[c].interval?p.setSeconds(p.getSeconds()+n):f[c].endTime:p.setSeconds(p.getSeconds()+n),d+o<p.setSeconds(p.getSeconds())&&(d=p.setSeconds(p.getSeconds()+n)),f[c]={interval:n,endTime:d},localStorage.setItem("WprCountDownSettings",JSON.stringify(f))}r(),e.editorCheck()||(l=setInterval(r,1e3))},widgetGoogleMaps:function(e){function t(e,t){var i="<div class=\"wpr-gm-iwindow\"><h3>"+t.gm_location_title+"</h3><p>"+t.gm_location_description+"</p></div>",r=new google.maps.InfoWindow({content:i,maxWidth:t.gm_info_window_width.size});"load"===t.gm_show_info_window?r.open(p,e):e.addListener("click",function(){r.open(p,e)})}function r(e){var t;switch(e.style){case"simple":t=JSON.parse("[{\"featureType\":\"road\",\"elementType\":\"geometry\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"poi\",\"elementType\":\"geometry\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"landscape\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#fffffa\"}]},{\"featureType\":\"water\",\"stylers\":[{\"lightness\":50}]},{\"featureType\":\"road\",\"elementType\":\"labels\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"transit\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"administrative\",\"elementType\":\"geometry\",\"stylers\":[{\"lightness\":40}]}]");break;case"white-black":t=JSON.parse("[{\"featureType\":\"road\",\"elementType\":\"labels\",\"stylers\":[{\"visibility\":\"on\"}]},{\"featureType\":\"poi\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"administrative\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"road\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#000000\"},{\"weight\":1}]},{\"featureType\":\"road\",\"elementType\":\"geometry.stroke\",\"stylers\":[{\"color\":\"#000000\"},{\"weight\":0.8}]},{\"featureType\":\"landscape\",\"stylers\":[{\"color\":\"#ffffff\"}]},{\"featureType\":\"water\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"transit\",\"stylers\":[{\"visibility\":\"off\"}]},{\"elementType\":\"labels\",\"stylers\":[{\"visibility\":\"off\"}]},{\"elementType\":\"labels.text\",\"stylers\":[{\"visibility\":\"on\"}]},{\"elementType\":\"labels.text.stroke\",\"stylers\":[{\"color\":\"#ffffff\"}]},{\"elementType\":\"labels.text.fill\",\"stylers\":[{\"color\":\"#000000\"}]},{\"elementType\":\"labels.icon\",\"stylers\":[{\"visibility\":\"on\"}]}]");break;case"light-silver":t=JSON.parse("[{\"featureType\":\"water\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#e9e9e9\"},{\"lightness\":17}]},{\"featureType\":\"landscape\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#f5f5f5\"},{\"lightness\":20}]},{\"featureType\":\"road.highway\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#ffffff\"},{\"lightness\":17}]},{\"featureType\":\"road.highway\",\"elementType\":\"geometry.stroke\",\"stylers\":[{\"color\":\"#ffffff\"},{\"lightness\":29},{\"weight\":0.2}]},{\"featureType\":\"road.arterial\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#ffffff\"},{\"lightness\":18}]},{\"featureType\":\"road.local\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#ffffff\"},{\"lightness\":16}]},{\"featureType\":\"poi\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#f5f5f5\"},{\"lightness\":21}]},{\"featureType\":\"poi.park\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#dedede\"},{\"lightness\":21}]},{\"elementType\":\"labels.text.stroke\",\"stylers\":[{\"visibility\":\"on\"},{\"color\":\"#ffffff\"},{\"lightness\":16}]},{\"elementType\":\"labels.text.fill\",\"stylers\":[{\"saturation\":36},{\"color\":\"#333333\"},{\"lightness\":40}]},{\"elementType\":\"labels.icon\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"transit\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#f2f2f2\"},{\"lightness\":19}]},{\"featureType\":\"administrative\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#fefefe\"},{\"lightness\":20}]},{\"featureType\":\"administrative\",\"elementType\":\"geometry.stroke\",\"stylers\":[{\"color\":\"#fefefe\"},{\"lightness\":17},{\"weight\":1.2}]}]");break;case"light-grayscale":t=JSON.parse("[{\"featureType\":\"all\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"weight\":\"2.00\"}]},{\"featureType\":\"all\",\"elementType\":\"geometry.stroke\",\"stylers\":[{\"color\":\"#9c9c9c\"}]},{\"featureType\":\"all\",\"elementType\":\"labels.text\",\"stylers\":[{\"visibility\":\"on\"}]},{\"featureType\":\"landscape\",\"elementType\":\"all\",\"stylers\":[{\"color\":\"#f2f2f2\"}]},{\"featureType\":\"landscape\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#ffffff\"}]},{\"featureType\":\"landscape.man_made\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#ffffff\"}]},{\"featureType\":\"poi\",\"elementType\":\"all\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"road\",\"elementType\":\"all\",\"stylers\":[{\"saturation\":-100},{\"lightness\":45}]},{\"featureType\":\"road\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#eeeeee\"}]},{\"featureType\":\"road\",\"elementType\":\"labels.text.fill\",\"stylers\":[{\"color\":\"#7b7b7b\"}]},{\"featureType\":\"road\",\"elementType\":\"labels.text.stroke\",\"stylers\":[{\"color\":\"#ffffff\"}]},{\"featureType\":\"road.highway\",\"elementType\":\"all\",\"stylers\":[{\"visibility\":\"simplified\"}]},{\"featureType\":\"road.arterial\",\"elementType\":\"labels.icon\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"transit\",\"elementType\":\"all\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"water\",\"elementType\":\"all\",\"stylers\":[{\"color\":\"#46bcec\"},{\"visibility\":\"on\"}]},{\"featureType\":\"water\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#c8d7d4\"}]},{\"featureType\":\"water\",\"elementType\":\"labels.text.fill\",\"stylers\":[{\"color\":\"#070707\"}]},{\"featureType\":\"water\",\"elementType\":\"labels.text.stroke\",\"stylers\":[{\"color\":\"#ffffff\"}]}]");break;case"subtle-grayscale":t=JSON.parse("[{\"featureType\":\"administrative\",\"elementType\":\"all\",\"stylers\":[{\"saturation\":\"-100\"}]},{\"featureType\":\"administrative.province\",\"elementType\":\"all\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"landscape\",\"elementType\":\"all\",\"stylers\":[{\"saturation\":-100},{\"lightness\":65},{\"visibility\":\"on\"}]},{\"featureType\":\"poi\",\"elementType\":\"all\",\"stylers\":[{\"saturation\":-100},{\"lightness\":\"50\"},{\"visibility\":\"simplified\"}]},{\"featureType\":\"road\",\"elementType\":\"all\",\"stylers\":[{\"saturation\":\"-100\"}]},{\"featureType\":\"road.highway\",\"elementType\":\"all\",\"stylers\":[{\"visibility\":\"simplified\"}]},{\"featureType\":\"road.arterial\",\"elementType\":\"all\",\"stylers\":[{\"lightness\":\"30\"}]},{\"featureType\":\"road.local\",\"elementType\":\"all\",\"stylers\":[{\"lightness\":\"40\"}]},{\"featureType\":\"transit\",\"elementType\":\"all\",\"stylers\":[{\"saturation\":-100},{\"visibility\":\"simplified\"}]},{\"featureType\":\"water\",\"elementType\":\"geometry\",\"stylers\":[{\"hue\":\"#ffff00\"},{\"lightness\":-25},{\"saturation\":-97}]},{\"featureType\":\"water\",\"elementType\":\"labels\",\"stylers\":[{\"lightness\":-25},{\"saturation\":-100}]}]");break;case"mostly-white":t=JSON.parse("[{\"featureType\":\"administrative\",\"elementType\":\"labels.text.fill\",\"stylers\":[{\"color\":\"#6195a0\"}]},{\"featureType\":\"landscape\",\"elementType\":\"all\",\"stylers\":[{\"color\":\"#f2f2f2\"}]},{\"featureType\":\"landscape\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#ffffff\"}]},{\"featureType\":\"poi\",\"elementType\":\"all\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"poi.park\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#e6f3d6\"},{\"visibility\":\"on\"}]},{\"featureType\":\"road\",\"elementType\":\"all\",\"stylers\":[{\"saturation\":-100},{\"lightness\":45},{\"visibility\":\"simplified\"}]},{\"featureType\":\"road.highway\",\"elementType\":\"all\",\"stylers\":[{\"visibility\":\"simplified\"}]},{\"featureType\":\"road.highway\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#f4d2c5\"},{\"visibility\":\"simplified\"}]},{\"featureType\":\"road.highway\",\"elementType\":\"labels.text\",\"stylers\":[{\"color\":\"#4e4e4e\"}]},{\"featureType\":\"road.arterial\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#f4f4f4\"}]},{\"featureType\":\"road.arterial\",\"elementType\":\"labels.text.fill\",\"stylers\":[{\"color\":\"#787878\"}]},{\"featureType\":\"road.arterial\",\"elementType\":\"labels.icon\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"transit\",\"elementType\":\"all\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"water\",\"elementType\":\"all\",\"stylers\":[{\"color\":\"#eaf6f8\"},{\"visibility\":\"on\"}]},{\"featureType\":\"water\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#eaf6f8\"}]}]");break;case"mostly-green":t=JSON.parse("[{\"featureType\":\"landscape.man_made\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#f7f1df\"}]},{\"featureType\":\"landscape.natural\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#d0e3b4\"}]},{\"featureType\":\"landscape.natural.terrain\",\"elementType\":\"geometry\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"poi\",\"elementType\":\"labels\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"poi.business\",\"elementType\":\"all\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"poi.medical\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#fbd3da\"}]},{\"featureType\":\"poi.park\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#bde6ab\"}]},{\"featureType\":\"road\",\"elementType\":\"geometry.stroke\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"road\",\"elementType\":\"labels\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"road.highway\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#ffe15f\"}]},{\"featureType\":\"road.highway\",\"elementType\":\"geometry.stroke\",\"stylers\":[{\"color\":\"#efd151\"}]},{\"featureType\":\"road.arterial\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#ffffff\"}]},{\"featureType\":\"road.local\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"black\"}]},{\"featureType\":\"transit.station.airport\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#cfb2db\"}]},{\"featureType\":\"water\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#a2daf2\"}]}]");break;case"neutral-blue":t=JSON.parse("[{\"featureType\":\"water\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#193341\"}]},{\"featureType\":\"landscape\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#2c5a71\"}]},{\"featureType\":\"road\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#29768a\"},{\"lightness\":-37}]},{\"featureType\":\"poi\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#406d80\"}]},{\"featureType\":\"transit\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#406d80\"}]},{\"elementType\":\"labels.text.stroke\",\"stylers\":[{\"visibility\":\"on\"},{\"color\":\"#3e606f\"},{\"weight\":2},{\"gamma\":0.84}]},{\"elementType\":\"labels.text.fill\",\"stylers\":[{\"color\":\"#ffffff\"}]},{\"featureType\":\"administrative\",\"elementType\":\"geometry\",\"stylers\":[{\"weight\":0.6},{\"color\":\"#1a3541\"}]},{\"elementType\":\"labels.icon\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"poi.park\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#2c5a71\"}]}]");break;case"blue-water":t=JSON.parse("[{\"featureType\":\"administrative\",\"elementType\":\"labels.text.fill\",\"stylers\":[{\"color\":\"#444444\"}]},{\"featureType\":\"landscape\",\"elementType\":\"all\",\"stylers\":[{\"color\":\"#f2f2f2\"}]},{\"featureType\":\"poi\",\"elementType\":\"all\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"road\",\"elementType\":\"all\",\"stylers\":[{\"saturation\":-100},{\"lightness\":45}]},{\"featureType\":\"road.highway\",\"elementType\":\"all\",\"stylers\":[{\"visibility\":\"simplified\"}]},{\"featureType\":\"road.arterial\",\"elementType\":\"labels.icon\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"transit\",\"elementType\":\"all\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"water\",\"elementType\":\"all\",\"stylers\":[{\"color\":\"#46bcec\"},{\"visibility\":\"on\"}]}]");break;case"blue-essense":t=JSON.parse("[{\"featureType\":\"landscape.natural\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"visibility\":\"on\"},{\"color\":\"#e0efef\"}]},{\"featureType\":\"poi\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"visibility\":\"on\"},{\"hue\":\"#1900ff\"},{\"color\":\"#c0e8e8\"}]},{\"featureType\":\"road\",\"elementType\":\"geometry\",\"stylers\":[{\"lightness\":100},{\"visibility\":\"simplified\"}]},{\"featureType\":\"road\",\"elementType\":\"labels\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"transit.line\",\"elementType\":\"geometry\",\"stylers\":[{\"visibility\":\"on\"},{\"lightness\":700}]},{\"featureType\":\"water\",\"elementType\":\"all\",\"stylers\":[{\"color\":\"#7dcdcd\"}]}]");break;case"golden-brown":t=JSON.parse("[{\"featureType\":\"all\",\"elementType\":\"all\",\"stylers\":[{\"color\":\"#ff7000\"},{\"lightness\":\"69\"},{\"saturation\":\"100\"},{\"weight\":\"1.17\"},{\"gamma\":\"2.04\"}]},{\"featureType\":\"all\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#cb8536\"}]},{\"featureType\":\"all\",\"elementType\":\"labels\",\"stylers\":[{\"color\":\"#ffb471\"},{\"lightness\":\"66\"},{\"saturation\":\"100\"}]},{\"featureType\":\"all\",\"elementType\":\"labels.text.fill\",\"stylers\":[{\"gamma\":0.01},{\"lightness\":20}]},{\"featureType\":\"all\",\"elementType\":\"labels.text.stroke\",\"stylers\":[{\"saturation\":-31},{\"lightness\":-33},{\"weight\":2},{\"gamma\":0.8}]},{\"featureType\":\"all\",\"elementType\":\"labels.icon\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"landscape\",\"elementType\":\"all\",\"stylers\":[{\"lightness\":\"-8\"},{\"gamma\":\"0.98\"},{\"weight\":\"2.45\"},{\"saturation\":\"26\"}]},{\"featureType\":\"landscape\",\"elementType\":\"geometry\",\"stylers\":[{\"lightness\":30},{\"saturation\":30}]},{\"featureType\":\"poi\",\"elementType\":\"geometry\",\"stylers\":[{\"saturation\":20}]},{\"featureType\":\"poi.park\",\"elementType\":\"geometry\",\"stylers\":[{\"lightness\":20},{\"saturation\":-20}]},{\"featureType\":\"road\",\"elementType\":\"geometry\",\"stylers\":[{\"lightness\":10},{\"saturation\":-30}]},{\"featureType\":\"road\",\"elementType\":\"geometry.stroke\",\"stylers\":[{\"saturation\":25},{\"lightness\":25}]},{\"featureType\":\"water\",\"elementType\":\"all\",\"stylers\":[{\"lightness\":-20},{\"color\":\"#ecc080\"}]}]");break;case"midnight-commander":t=JSON.parse("[{\"featureType\":\"all\",\"elementType\":\"labels.text.fill\",\"stylers\":[{\"color\":\"#ffffff\"}]},{\"featureType\":\"all\",\"elementType\":\"labels.text.stroke\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":13}]},{\"featureType\":\"administrative\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#000000\"}]},{\"featureType\":\"administrative\",\"elementType\":\"geometry.stroke\",\"stylers\":[{\"color\":\"#144b53\"},{\"lightness\":14},{\"weight\":1.4}]},{\"featureType\":\"landscape\",\"elementType\":\"all\",\"stylers\":[{\"color\":\"#08304b\"}]},{\"featureType\":\"poi\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#0c4152\"},{\"lightness\":5}]},{\"featureType\":\"road.highway\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#000000\"}]},{\"featureType\":\"road.highway\",\"elementType\":\"geometry.stroke\",\"stylers\":[{\"color\":\"#0b434f\"},{\"lightness\":25}]},{\"featureType\":\"road.arterial\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#000000\"}]},{\"featureType\":\"road.arterial\",\"elementType\":\"geometry.stroke\",\"stylers\":[{\"color\":\"#0b3d51\"},{\"lightness\":16}]},{\"featureType\":\"road.local\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#000000\"}]},{\"featureType\":\"transit\",\"elementType\":\"all\",\"stylers\":[{\"color\":\"#146474\"}]},{\"featureType\":\"water\",\"elementType\":\"all\",\"stylers\":[{\"color\":\"#021019\"}]}]");break;case"shades-of-grey":t=JSON.parse("[{\"featureType\":\"all\",\"elementType\":\"labels.text.fill\",\"stylers\":[{\"saturation\":36},{\"color\":\"#000000\"},{\"lightness\":40}]},{\"featureType\":\"all\",\"elementType\":\"labels.text.stroke\",\"stylers\":[{\"visibility\":\"on\"},{\"color\":\"#000000\"},{\"lightness\":16}]},{\"featureType\":\"all\",\"elementType\":\"labels.icon\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"administrative\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":20}]},{\"featureType\":\"administrative\",\"elementType\":\"geometry.stroke\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":17},{\"weight\":1.2}]},{\"featureType\":\"landscape\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":20}]},{\"featureType\":\"poi\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":21}]},{\"featureType\":\"road.highway\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":17}]},{\"featureType\":\"road.highway\",\"elementType\":\"geometry.stroke\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":29},{\"weight\":0.2}]},{\"featureType\":\"road.arterial\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":18}]},{\"featureType\":\"road.local\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":16}]},{\"featureType\":\"transit\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":19}]},{\"featureType\":\"water\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":17}]}]");break;case"yellow-black":t=JSON.parse("[{\"featureType\":\"all\",\"elementType\":\"labels\",\"stylers\":[{\"visibility\":\"on\"}]},{\"featureType\":\"all\",\"elementType\":\"labels.text.fill\",\"stylers\":[{\"saturation\":36},{\"color\":\"#000000\"},{\"lightness\":40}]},{\"featureType\":\"all\",\"elementType\":\"labels.text.stroke\",\"stylers\":[{\"visibility\":\"on\"},{\"color\":\"#000000\"},{\"lightness\":16}]},{\"featureType\":\"all\",\"elementType\":\"labels.icon\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"administrative\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":20}]},{\"featureType\":\"administrative\",\"elementType\":\"geometry.stroke\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":17},{\"weight\":1.2}]},{\"featureType\":\"administrative.country\",\"elementType\":\"labels.text.fill\",\"stylers\":[{\"color\":\"#e5c163\"}]},{\"featureType\":\"administrative.locality\",\"elementType\":\"labels.text.fill\",\"stylers\":[{\"color\":\"#c4c4c4\"}]},{\"featureType\":\"administrative.neighborhood\",\"elementType\":\"labels.text.fill\",\"stylers\":[{\"color\":\"#e5c163\"}]},{\"featureType\":\"landscape\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":20}]},{\"featureType\":\"poi\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":21},{\"visibility\":\"on\"}]},{\"featureType\":\"poi.business\",\"elementType\":\"geometry\",\"stylers\":[{\"visibility\":\"on\"}]},{\"featureType\":\"road.highway\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#e5c163\"},{\"lightness\":\"0\"}]},{\"featureType\":\"road.highway\",\"elementType\":\"geometry.stroke\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"road.highway\",\"elementType\":\"labels.text.fill\",\"stylers\":[{\"color\":\"#ffffff\"}]},{\"featureType\":\"road.highway\",\"elementType\":\"labels.text.stroke\",\"stylers\":[{\"color\":\"#e5c163\"}]},{\"featureType\":\"road.arterial\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":18}]},{\"featureType\":\"road.arterial\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#575757\"}]},{\"featureType\":\"road.arterial\",\"elementType\":\"labels.text.fill\",\"stylers\":[{\"color\":\"#ffffff\"}]},{\"featureType\":\"road.arterial\",\"elementType\":\"labels.text.stroke\",\"stylers\":[{\"color\":\"#2c2c2c\"}]},{\"featureType\":\"road.local\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":16}]},{\"featureType\":\"road.local\",\"elementType\":\"labels.text.fill\",\"stylers\":[{\"color\":\"#999999\"}]},{\"featureType\":\"transit\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":19}]},{\"featureType\":\"water\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":17}]}]");break;case"custom":t=JSON.parse(e.custom_style);break;default:t="";}return t}for(var a=e.find(".wpr-google-map"),s=a.data("settings"),l=a.data("controls"),n=a.data("locations"),o=[],d=new google.maps.LatLngBounds,p=new google.maps.Map(a[0],{mapTypeId:s.type,styles:r(s),zoom:s.zoom_depth,gestureHandling:s.zoom_on_scroll,mapTypeControl:l.type,fullscreenControl:l.fullscreen,zoomControl:l.zoom,streetViewControl:l.streetview}),c=0;c<n.length;c++){var f=n[c],m="",g=f.gm_marker_icon_size_width.size,y=f.gm_marker_icon_size_height.size;if(""!=f.gm_latitude&&""!=f.gm_longtitude){"yes"===f.gm_custom_marker&&(m={url:f.gm_marker_icon.url,scaledSize:new google.maps.Size(g,y)});var w=new google.maps.Marker({map:p,position:new google.maps.LatLng(parseFloat(f.gm_latitude),parseFloat(f.gm_longtitude)),animation:google.maps.Animation[f.gm_marker_animation],icon:m});"none"!==f.gm_show_info_window&&t(w,f),o.push(w),d.extend(w.position)}}if(1<n.length?p.fitBounds(d):p.setCenter(d.getCenter()),"yes"===s.cluster_markers)new MarkerClusterer(p,o,{imagePath:s.clusters_url})},widgetBeforeAfter:function(e){function i(){var e=r.find(".wpr-ba-label-1 div"),t=r.find(".wpr-ba-label-2 div");if(e.length||t.length)if(r.hasClass("wpr-ba-horizontal")){var i=e.position().left+e.outerWidth(),a=t.position().left+t.outerWidth();i+15>=parseInt(l.css("left"),10)?e.stop().css("opacity",0):e.stop().css("opacity",1),r.outerWidth()-(a+15)<=parseInt(l.css("left"),10)?t.stop().css("opacity",0):t.stop().css("opacity",1)}else{var i=e.position().top+e.outerHeight(),a=t.position().top+t.outerHeight();i+15>=parseInt(l.css("top"),10)?e.stop().css("opacity",0):e.stop().css("opacity",1),r.outerHeight()-(a+15)<=parseInt(l.css("top"),10)?t.stop().css("opacity",0):t.stop().css("opacity",1)}}var r=e.find(".wpr-ba-image-container"),a=r.find(".wpr-ba-image-1"),s=r.find(".wpr-ba-image-2"),l=r.find(".wpr-ba-divider"),n=r.attr("data-position");r.hasClass("wpr-ba-horizontal")?(l.css("left",n+"%"),s.css("left",n+"%"),s.find("img").css("right",n+"%"),l.on("move",function(t){var e=t.pageX-r.offset().left;l.css({left:"auto",right:"auto"}),s.css({left:"auto",right:"auto"}),0<e&&e<r.outerWidth()?(l.css("left",e),s.css("left",e),s.find("img").css("right",e)):0>=e?(l.css("left",0),s.css("left",0),s.find("img").css("right",0)):e>=r.outerWidth()&&(l.css("right",-l.outerWidth()/2),s.css("right",0),s.find("img").css("right","100%")),i()})):(l.css("top",n+"%"),s.css("top",n+"%"),s.find("img").css("bottom",n+"%"),l.on("move",function(t){var e=t.pageY-r.offset().top;l.css({top:"auto",bottom:"auto"}),s.css({top:"auto",bottom:"auto"}),0<e&&e<r.outerHeight()?(l.css("top",e),s.css("top",e),s.find("img").css("bottom",e)):0>=e?(l.css("top",0),s.css("top",0),s.find("img").css("bottom",0)):e>=r.outerHeight()&&(l.css("bottom",-l.outerHeight()/2),s.css("bottom",0),s.find("img").css("bottom","100%")),i()})),"mouse"===r.attr("data-trigger")&&r.on("mousemove",function(e){if(r.hasClass("wpr-ba-horizontal")){var a=e.pageX-t(this).offset().left;l.css("left",a),s.css("left",a),s.find("img").css("right",a)}else{var a=e.pageY-t(this).offset().top;l.css("top",a),s.css("top",a),s.find("img").css("bottom",a)}i()}),i()},widgetMailchimp:function(e){var i=e.find("form");i.on("submit",function(r){r.preventDefault();var a=t(this).find("button").text();t(this).find("button").text(t(this).find("button").data("loading")),t.ajax({url:WprConfig.ajaxurl,type:"POST",data:{action:"mailchimp_subscribe",fields:t(this).serialize(),apiKey:i.data("api-key"),listId:i.data("list-id")},success:function(t){i.find("button").text(a),"subscribed"===t.status?e.find(".wpr-mailchimp-success-message").show():e.find(".wpr-mailchimp-error-message").show(),e.find(".wpr-mailchimp-message").fadeIn()}})})},widgetAdvancedSlider:function(e){function i(){var e,t,i=l.find(".wpr-slider-item").outerWidth(),r=l.find(".wpr-slider-item").outerHeight(),a=16/9,s=0,n=0;i/r>a?(t=i,e=t/a,s="-"+(e-r)/2+"px"):(e=r,t=e*a,n="-"+(t-i)/2+"px"),l.find("iframe").css({width:t+"px",height:e+"px","max-width":"none",position:"absolute",left:n+"",top:s+"",display:"block","text-align":"inherit","line-height":"0px","border-width":"0px",margin:"0px",padding:"0px"})}function r(){l.find(".slick-active").each(function(){var e=t(this).attr("data-video-src"),r=t(this).attr("data-video-autoplay");1!==t(this).find(".wpr-slider-video").length&&"yes"===r&&(1==d?t(this).find(".wpr-cv-inner").prepend("<div class=\"wpr-slider-video\"><iframe src=\""+e+"\" width=\"100%\" height=\"100%\" frameborder=\"0\" allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen></iframe></div>"):t(this).find(".wpr-cv-container").prepend("<div class=\"wpr-slider-video\"><iframe src=\""+e+"\" width=\"100%\" height=\"100%\" frameborder=\"0\" allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen></iframe></div>"),i())})}function a(){1==d&&l.find(".wpr-slider-item").not(".slick-active").find(".wpr-slider-animation").removeClass("wpr-animation-enter")}function s(){l.find(".slick-active").find(".wpr-slider-content").fadeIn(0),1==d&&l.find(".slick-active").find(".wpr-slider-animation").addClass("wpr-animation-enter")}var l=e.find(".wpr-advanced-slider"),n=l.data("slick"),o=e.attr("class"),d=o.match(/wpr-adv-slider-columns-\d/)?o.match(/wpr-adv-slider-columns-\d/).join().slice(-1):2,p=o.match(/columns--widescreen\d/)?o.match(/columns--widescreen\d/).join().slice(-1):d,c=o.match(/columns--laptop\d/)?o.match(/columns--laptop\d/).join().slice(-1):d,f=o.match(/columns--tablet_extra\d/)?o.match(/columns--tablet_extra\d/).join().slice(-1):m,m=o.match(/columns--tablet\d/)?o.match(/columns--tablet\d/).join().slice(-1):2,g=o.match(/columns--mobile_extra\d/)?o.match(/columns--mobile_extra\d/).join().slice(-1):m,y=o.match(/columns--mobile\d/)?o.match(/columns--mobile\d/).join().slice(-1):1,w=+o.match(/wpr-adv-slides-to-scroll-\d/).join().slice(-1),h=l.attr("data-slide-effect");if(l.slick({appendArrows:e.find(".wpr-slider-controls"),appendDots:e.find(".wpr-slider-dots"),customPaging:function(e,t){e.slideCount;return"<span class=\"wpr-slider-dot\"></span>"},slidesToShow:d,responsive:[{breakpoint:1e4,settings:{slidesToShow:p,slidesToScroll:w>p?1:w,fade:1==p&&"fade"===h}},{breakpoint:2399,settings:{slidesToShow:d,slidesToScroll:w>d?1:w,fade:1==d&&"fade"===h}},{breakpoint:1221,settings:{slidesToShow:c,slidesToScroll:w>c?1:w,fade:1==c&&"fade"===h}},{breakpoint:1200,settings:{slidesToShow:f,slidesToScroll:w>f?1:w,fade:1==f&&"fade"===h}},{breakpoint:1024,settings:{slidesToShow:m,slidesToScroll:w>m?1:w,fade:1==m&&"fade"===h}},{breakpoint:880,settings:{slidesToShow:g,slidesToScroll:w>g?1:w,fade:1==g&&"fade"===h}},{breakpoint:768,settings:{slidesToShow:y,slidesToScroll:w>y?1:w,fade:1==y&&"fade"===h}}]}),t(window).on("load resize",function(){i()}),r(),s(),l.find(".wpr-slider-video-btn").on("click",function(){var e=t(this).closest(".slick-active"),r=e.attr("data-video-src");1!==e.find(".wpr-slider-video").length&&(e.find(".wpr-cv-container").prepend("<div class=\"wpr-slider-video\"><iframe src=\""+r+"\" width=\"100%\" height=\"100%\" frameborder=\"0\" allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen></iframe></div>"),i(),e.find(".wpr-slider-content").fadeOut(300))}),l.on({beforeChange:function(){l.find(".wpr-slider-item").not(".slick-active").find(".wpr-slider-video").remove(),l.find(".wpr-animation-enter").find(".wpr-slider-content").fadeOut(300),a()},afterChange:function(){s(),r()}}),e.find(".slick-dots").length&&e.hasClass("wpr-slider-dots-horizontal")){var u=e.find(".slick-dots li").outerWidth()*e.find(".slick-dots li").length-parseInt(e.find(".slick-dots li span").css("margin-right"),10);e.find(".slick-dots").length&&e.find(".slick-dots").css("width",u),t(window).on("resize",function(){setTimeout(function(){var t=e.find(".slick-dots li").outerWidth()*e.find(".slick-dots li").length-parseInt(e.find(".slick-dots li span").css("margin-right"),10);e.find(".slick-dots").css("width",t)},300)})}},widgetTestimonialCarousel:function(e){var i=e.find(".wpr-testimonial-carousel"),r=e.attr("class"),a=r.match(/wpr-testimonial-slider-columns-\d/)?r.match(/wpr-testimonial-slider-columns-\d/).join().slice(-1):2,s=r.match(/columns--widescreen\d/)?r.match(/columns--widescreen\d/).join().slice(-1):a,l=r.match(/columns--laptop\d/)?r.match(/columns--laptop\d/).join().slice(-1):a,n=r.match(/columns--tablet_extra\d/)?r.match(/columns--tablet_extra\d/).join().slice(-1):o,o=r.match(/columns--tablet\d/)?r.match(/columns--tablet\d/).join().slice(-1):2,d=r.match(/columns--mobile_extra\d/)?r.match(/columns--mobile_extra\d/).join().slice(-1):o,p=r.match(/columns--mobile\d/)?r.match(/columns--mobile\d/).join().slice(-1):1,c=+r.match(/wpr-adv-slides-to-scroll-\d/).join().slice(-1),f=i.attr("data-slide-effect");if(i.slick({appendArrows:e.find(".wpr-testimonial-controls"),appendDots:e.find(".wpr-testimonial-dots"),customPaging:function(e,t){e.slideCount;return"<span class=\"wpr-testimonial-dot\"></span>"},slidesToShow:a,responsive:[{breakpoint:1e4,settings:{slidesToShow:s,slidesToScroll:c>s?1:c,fade:1==s&&"fade"===f}},{breakpoint:2399,settings:{slidesToShow:a,slidesToScroll:c>a?1:c,fade:1==a&&"fade"===f}},{breakpoint:1221,settings:{slidesToShow:l,slidesToScroll:c>l?1:c,fade:1==l&&"fade"===f}},{breakpoint:1200,settings:{slidesToShow:n,slidesToScroll:c>n?1:c,fade:1==n&&"fade"===f}},{breakpoint:1024,settings:{slidesToShow:o,slidesToScroll:c>o?1:c,fade:1==o&&"fade"===f}},{breakpoint:880,settings:{slidesToShow:d,slidesToScroll:c>d?1:c,fade:1==d&&"fade"===f}},{breakpoint:768,settings:{slidesToShow:p,slidesToScroll:c>p?1:c,fade:1==p&&"fade"===f}}]}),e.hasClass("wpr-testimonial-nav-fade")&&(e.on("mouseover",function(){e.closest("section").find(".wpr-testimonial-arrow").css({opacity:1})}),e.closest("section").on("mouseout",function(){e.find(".wpr-testimonial-arrow").css({opacity:0})})),e.find(".slick-dots").length){var m=e.find(".slick-dots li").outerWidth()*e.find(".slick-dots li").length-parseInt(e.find(".slick-dots li span").css("margin-right"),10);e.find(".slick-dots").css("width",m)}t(window).on("resize",function(){setTimeout(function(){if(e.find(".slick-dots").length){var t=e.find(".slick-dots li").outerWidth()*e.find(".slick-dots li").length-parseInt(e.find(".slick-dots li span").css("margin-right"),10);e.find(".slick-dots").css("width",t)}},300)})},widgetSearch:function(e){e.find(".wpr-search-form-input").on({focus:function(){e.addClass("wpr-search-form-input-focus")},blur:function(){e.removeClass("wpr-search-form-input-focus")}})},widgetAdvancedText:function(e){function i(){var t=e.find(".wpr-clipped-text"),i=t.data("clipped-options"),r=elementorFrontend.getCurrentDeviceMode();if(i){var a=i.longShadowSize,s=i.longShadowSizeTablet,l=i.longShadowSizeMobile;"desktop"===r&&(a=i.longShadowSize),"tablet"===r&&s&&(a=s),"mobile"===r&&l&&(a=l),t.find(".wpr-clipped-text-long-shadow").attr("style","text-shadow:"+f(i.longShadowColor,a,i.longShadowDirection))}}function r(){a(g.find("b")),s(m)}function a(e){e.each(function(){var e=t(this),r=e.text().split(""),a=e.hasClass("wpr-anim-text-visible");for(var s in r){var i=r[s].replace(/ /g," ");r[s]=a?"<i class=\"wpr-anim-text-in\">"+i+"</i>":"<i>"+i+"</i>"}var l=r.join("");e.html(l).css("opacity",1)})}function s(e){e.each(function(){var e=t(this),i=e.find(".wpr-anim-text-inner");if(e.hasClass("wpr-anim-text-type-clip")){var r=i.outerWidth();i.css("width",r)}setTimeout(function(){l(e.find(".wpr-anim-text-visible").eq(0))},T),e.hasClass("wpr-anim-text-type-rotate-1")&&i.find("b").each(function(){t(this).outerWidth()>i.outerWidth()&&i.css("width",t(this).outerWidth())})})}function l(e){var t=p(e);if(!("yes"!==h&&(b++,b===u)))if(e.parents(".wpr-anim-text").hasClass("wpr-anim-text-type-typing")){var i=e.parent(".wpr-anim-text-inner");i.addClass("wpr-anim-text-selected").removeClass("waiting"),setTimeout(function(){i.removeClass("wpr-anim-text-selected"),e.removeClass("wpr-anim-text-visible").addClass("wpr-anim-text-hidden").children("i").removeClass("wpr-anim-text-in").addClass("wpr-anim-text-out")},v),setTimeout(function(){n(t,y)},k)}else if(e.parents(".wpr-anim-text").hasClass("wpr-anim-text-letters")){var r=!!(e.children("i").length>=t.children("i").length);o(e.find("i").eq(0),e,r,y),d(t.find("i").eq(0),t,r,y)}else e.parents(".wpr-anim-text").hasClass("wpr-anim-text-type-clip")?e.parents(".wpr-anim-text-inner").animate({width:"2px"},y,function(){c(e,t),n(t)}):(c(e,t),setTimeout(function(){l(t)},T))}function n(e,t){e.parents(".wpr-anim-text").hasClass("wpr-anim-text-type-typing")?(d(e.find("i").eq(0),e,!1,t),e.addClass("wpr-anim-text-visible").removeClass("wpr-anim-text-hidden")):e.parents(".wpr-anim-text").hasClass("wpr-anim-text-type-clip")&&e.parents(".wpr-anim-text-inner").animate({width:e.outerWidth()},y,function(){setTimeout(function(){l(e)},T)})}function o(e,t,i,r){if(e.removeClass("wpr-anim-text-in").addClass("wpr-anim-text-out"),e.is(":last-child")?i&&setTimeout(function(){l(p(t))},T):setTimeout(function(){o(e.next(),t,i,r)},r),e.is(":last-child")){var a=p(t);c(t,a)}}function d(e,t,i,r){e.addClass("wpr-anim-text-in").removeClass("wpr-anim-text-out"),e.is(":last-child")?(t.parents(".wpr-anim-text").hasClass("wpr-anim-text-type-typing")&&setTimeout(function(){t.parents(".wpr-anim-text-inner").addClass("waiting")},200),!i&&setTimeout(function(){l(t)},T)):setTimeout(function(){d(e.next(),t,i,r)},r)}function p(e){return e.is(":last-child")?e.parent().children().eq(0):e.next()}function c(e,t){e.removeClass("wpr-anim-text-visible").addClass("wpr-anim-text-hidden"),t.removeClass("wpr-anim-text-hidden").addClass("wpr-anim-text-visible")}function f(e,t,r){for(var a="",s=0;s<t;s++)a+="top"===r?"0 -"+s+"px 0 "+e+",":"right"===r?s+"px 0 0 "+e+",":"bottom"===r?"0 "+s+"px 0 "+e+",":"left"===r?"-"+s+"px 0 0 "+e+",":"top-left"===r?"-"+s+"px -"+s+"px 0 "+e+",":"top-right"===r?s+"px -"+s+"px 0 "+e+",":"bottom-left"===r?"-"+s+"px "+s+"px 0 "+e+",":"bottom-right"===r?s+"px "+s+"px 0 "+e+",":s+"px "+s+"px 0 "+e+",";return a=a.slice(0,-1),a}if(e.hasClass("wpr-advanced-text-style-animated")){var m=e.find(".wpr-anim-text"),g=e.find(".wpr-anim-text-letters"),y=m.attr("data-anim-duration"),w=y.split(","),h=m.attr("data-anim-loop"),u=m.find("b").length,b=0;m.find("b").first().addClass("wpr-anim-text-visible");var y=parseInt(w[0],10),T=parseInt(w[1],10),v=500,k=1300;r()}i(),t(window).on("resize",function(){i()})},widgetProgressBar:function(e){function i(e){if(e.length){var i=e.offset().top,r=i+e.outerHeight(),a=t(window).scrollTop(),s=a+t(window).height();return i>t(window).height()&&(i+=50),r>a&&i<s}}function r(){if(i(p)&&p.css({height:y+"%"}),i(d)&&d.css({width:y+"%"}),i(s)){var e=f.circleOffset;o.css({"stroke-dashoffset":e})}(i(p)||i(d)||i(s))&&setTimeout(function(){m.numerator(b)},h)}var a=e.find(".wpr-progress-bar"),s=e.find(".wpr-prbar-circle"),l=s.find(".wpr-prbar-circle-svg"),n=l.find(".wpr-prbar-circle-line"),o=e.find(".wpr-prbar-circle-prline"),d=a.find(".wpr-prbar-hr-line-inner"),p=a.find(".wpr-prbar-vr-line-inner"),c=a.data("options"),f=s.data("circle-options"),m=a.find(".wpr-prbar-counter-value"),g=c.counterValue,y=c.counterValuePersent,w=c.animDuration,h=c.animDelay,u=elementorFrontend.getCurrentDeviceMode(),b={toValue:g,duration:w};"yes"===c.counterSeparator&&(b.delimiter=",");r(),t(window).on("scroll",function(){r()})},widgetImageHotspots:function(e){var i=e.find(".wpr-image-hotspots"),r=i.data("options"),a=i.find(".wpr-hotspot-item"),s=r.tooltipTrigger;"click"===s?(a.on("click",function(){t(this).hasClass("wpr-tooltip-active")?t(this).removeClass("wpr-tooltip-active"):(a.removeClass("wpr-tooltip-active"),t(this).addClass("wpr-tooltip-active")),event.stopPropagation()}),t(window).on("click",function(){a.removeClass("wpr-tooltip-active")})):"hover"===s?a.hover(function(){t(this).toggleClass("wpr-tooltip-active")}):a.addClass("wpr-tooltip-active")},widgetFlipBox:function(e){var i=e.find(".wpr-flip-box"),r=i.data("trigger");"box"===r?(i.find(".wpr-flip-box-front").on("click",function(){t(this).closest(".wpr-flip-box").addClass("wpr-flip-box-active")}),t(window).on("click",function(){0===t(event.target).closest(".wpr-flip-box").length&&i.removeClass("wpr-flip-box-active")})):"btn"==r?(i.find(".wpr-flip-box-btn").on("click",function(){t(this).closest(".wpr-flip-box").addClass("wpr-flip-box-active")}),t(window).on("click",function(){0===t(event.target).closest(".wpr-flip-box").length&&i.removeClass("wpr-flip-box-active")})):"hover"==r&&i.hover(function(){t(this).toggleClass("wpr-flip-box-active")})},widgetContentTicker:function(e){var t=e.find(".wpr-ticker-slider"),i=e.find(".wpr-ticker-marquee"),r=i.data("options"),a=e.attr("class"),s=a.match(/wpr-ticker-slider-columns-\d/)?a.match(/wpr-ticker-slider-columns-\d/).join().slice(-1):2,l=a.match(/columns--widescreen\d/)?a.match(/columns--widescreen\d/).join().slice(-1):s,n=a.match(/columns--laptop\d/)?a.match(/columns--laptop\d/).join().slice(-1):s,o=a.match(/columns--tablet_extra\d/)?a.match(/columns--tablet_extra\d/).join().slice(-1):d,d=a.match(/columns--tablet\d/)?a.match(/columns--tablet\d/).join().slice(-1):2,p=a.match(/columns--mobile_extra\d/)?a.match(/columns--mobile_extra\d/).join().slice(-1):d,c=a.match(/columns--mobile\d/)?a.match(/columns--mobile\d/).join().slice(-1):1,f=t.attr("data-slide-effect"),m="hr-slide"===f&&a.match(/wpr-ticker-slides-to-scroll-\d/)?+a.match(/wpr-ticker-slides-to-scroll-\d/).join().slice(-1):1;t.slick({appendArrows:e.find(".wpr-ticker-slider-controls"),slidesToShow:s,responsive:[{breakpoint:1e4,settings:{slidesToShow:"typing"===f||"fade"===f?1:l,slidesToScroll:m>l?1:m,fade:!("typing"!==f&&"fade"!==f)}},{breakpoint:2399,settings:{slidesToShow:"typing"===f||"fade"===f?1:s,slidesToScroll:m>s?1:m,fade:!("typing"!==f&&"fade"!==f)}},{breakpoint:1221,settings:{slidesToShow:"typing"===f||"fade"===f?1:n,slidesToScroll:m>n?1:m,fade:!("typing"!==f&&"fade"!==f)}},{breakpoint:1200,settings:{slidesToShow:"typing"===f||"fade"===f?1:o,slidesToScroll:m>o?1:m,fade:!("typing"!==f&&"fade"!==f)}},{breakpoint:1024,settings:{slidesToShow:"typing"===f||"fade"===f?1:d,slidesToScroll:m>d?1:m,fade:!("typing"!==f&&"fade"!==f)}},{breakpoint:880,settings:{slidesToShow:"typing"===f||"fade"===f?1:p,slidesToScroll:m>p?1:m,fade:!("typing"!==f&&"fade"!==f)}},{breakpoint:768,settings:{slidesToShow:"typing"===f||"fade"===f?1:c,slidesToScroll:m>c?1:m,fade:!("typing"!==f&&"fade"!==f)}}]}),i.marquee(r)},widgetTabs:function(e){function i(e){var t=l.eq(e),i=o.eq(e),r="auto";n.css({height:n.outerHeight(!0)}),l.removeClass("wpr-tab-active"),t.addClass("wpr-tab-active"),o.removeClass("wpr-tab-content-active wpr-animation-enter"),r=i.outerHeight(!0),r+=parseInt(n.css("border-top-width"))+parseInt(n.css("border-bottom-width")),i.addClass("wpr-tab-content-active wpr-animation-enter"),n.css({height:r}),setTimeout(function(){n.css({height:"auto"})},500)}function r(){l.on("click",function(){var e=t(this).data("tab")-1;clearInterval(f),i(e)})}function a(){l.hover(function(){var e=t(this).data("tab")-1;clearInterval(f),i(e)})}var s=t(".wpr-tabs",e).first(),l=t(".wpr-tabs-wrap",s).first(),n=t(".wpr-tabs-content-wrap",s).first(),l=t("> .wpr-tab",l),o=t("> .wpr-tab-content",n),d=s.data("options"),p=d.activeTab-1;if(l.eq(p).addClass("wpr-tab-active"),o.eq(p).addClass("wpr-tab-content-active wpr-animation-enter"),d.autoplay)var c=d.activeTab-1,f=setInterval(function(){c<l.length-1?c++:c=0,i(c)},d.autoplaySpeed);"hover"===d.trigger?a():r()},widgetContentToogle:function(e){function i(t){if(!e.hasClass("wpr-switcher-label-style-outer")){var i=100/d.length;o.css({width:i+"%",left:t*i+"%"})}}function r(t){var r=d.eq(t),a=p.eq(t),l="auto";i(t),e.hasClass("wpr-switcher-label-style-outer")||(d.removeClass("wpr-switcher-active"),r.addClass("wpr-switcher-active"),e.hasClass("wpr-switcher-style-dual")&&s.attr("data-active-switcher",t+1)),n.css({height:n.outerHeight(!0)}),p.removeClass("wpr-switcher-content-active wpr-animation-enter"),l=a.outerHeight(!0),l+=parseInt(n.css("border-top-width"))+parseInt(n.css("border-bottom-width")),a.addClass("wpr-switcher-content-active wpr-animation-enter"),n.css({height:l}),setTimeout(function(){n.css({height:"auto"})},500)}var a=t(".wpr-content-toggle",e).first(),s=t(".wpr-switcher-container",a).first(),l=t(".wpr-switcher-wrap",a).first(),n=t(".wpr-switcher-content-wrap",a).first(),o=t("> .wpr-switcher-bg",l),d=t("> .wpr-switcher",l),p=t("> .wpr-switcher-content",n),c=parseInt(s.data("active-switcher"))-1;d.eq(c).addClass("wpr-switcher-active"),p.eq(c).addClass("wpr-switcher-content-active wpr-animation-enter"),i(c),function(){e.hasClass("wpr-switcher-label-style-outer")?l.on("click",function(){var e=l.find(".wpr-switcher-active");1===parseInt(e.data("switcher"),10)?(l.children(".wpr-switcher").eq(0).removeClass("wpr-switcher-active"),l.children(".wpr-switcher").eq(1).addClass("wpr-switcher-active"),l.closest(".wpr-switcher-container").attr("data-active-switcher",2),r(1)):2===parseInt(e.data("switcher"),10)&&(l.children(".wpr-switcher").eq(1).removeClass("wpr-switcher-active"),l.children(".wpr-switcher").eq(0).addClass("wpr-switcher-active"),l.closest(".wpr-switcher-container").attr("data-active-switcher",1),r(0))}):d.on("click",function(){var e=t(this).data("switcher")-1;r(e)})}()},widgetBackToTop:function(e){function i(e,t,i){e>i.animationOffset?"fade"===i.animation?r.stop().css("visibility","visible").animate({opacity:"1"},i.animationDuration):"slide"===i.animation?r.stop().css("visibility","visible").animate({opacity:"1","margin-bottom":0},i.animationDuration):r.css("visibility","visible"):"fade"===i.animation?r.stop().animate({opacity:"0"},i.animationDuration):"slide"===i.animation?r.stop().animate({"margin-bottom":"-100px",opacity:"0"},i.animationDuration):r.css("visibility","hidden")}var r=e.find(".wpr-stt-btn"),a=r.attr("data-settings");a=JSON.parse(a),"fixed"===a.fixed&&("none"!==a.animation&&(r.css({opacity:"0"}),"slide"===a.animation&&r.css({"margin-bottom":"-100px"})),i(t(window).scrollTop(),r,a),t(window).scroll(function(){i(t(this).scrollTop(),r,a)})),r.on("click",function(){return t("html, body").animate({scrollTop:0},a.scrolAnim),!1})},widgetLottieAnimations:function(e){var i=e.find(".wpr-lottie-animations"),r=e.find(".wpr-lottie-animations-wrapper"),a=JSON.parse(i.attr("data-settings")),s=lottie.loadAnimation({container:i[0],path:i.attr("data-json-url"),renderer:a.lottie_renderer,loop:!("yes"!==a.loop),autoplay:!("yes"!==a.autoplay)});s.setSpeed(a.speed),a.reverse&&s.setDirection(-1),s.addEventListener("DOMLoaded",function(){function e(){if(s.pause(),"function"==typeof i[0].getBoundingClientRect){var e=document.documentElement.clientHeight,r=100*(i[0].getBoundingClientRect().top/e),l=100*(i[0].getBoundingClientRect().bottom/e),n=r<a.scroll_end,o=l>a.scroll_start;if("viewport"===a.trigger&&(o&&n?s.play():s.pause()),"scroll"===a.trigger&&o&&n){s.pause();var d=100*t(window).scrollTop()/(t(document).height()-t(window).height()),p=Math.round(d);s.goToAndStop(4e3*(p/100))}}}"hover"!==a.trigger&&"none"!==a.trigger&&(e("load"),t(window).on("scroll",e)),"hover"===a.trigger&&(s.pause(),i.hover(function(){s.play()},function(){s.pause()}))})},widgetPostsTimeline:function(i){function r(){i.find(".wpr-centered").length&&(767>=window.innerWidth?(i.find(".wpr-wrapper .wpr-timeline-centered").removeClass("wpr-both-sided-timeline").addClass("wpr-one-sided-timeline").addClass("wpr-remove-one-sided-later"),i.find(".wpr-wrapper .wpr-left-aligned").removeClass("wpr-left-aligned").addClass("wpr-right-aligned").addClass("wpr-remove-right-aligned-later")):(i.find(".wpr-wrapper .wpr-timeline-centered.wpr-remove-one-sided-later").removeClass("wpr-one-sided-timeline").addClass("wpr-both-sided-timeline").removeClass("wpr-remove-one-sided-later"),i.find(".wpr-wrapper .wpr-remove-right-aligned-later").removeClass("wpr-right-aligned").addClass("wpr-left-aligned").removeClass("wpr-remove-right-aligned-later")))}function a(e,r){if(i.find(".wpr-timeline-fill").length&&(0<i.find(".wpr-timeline-entry:eq(0)").prev(".wpr-year-wrap").length&&(r=i.find(".wpr-year-label").eq(0)),p.length)){var a=p.css("height").slice(0,-2),s=document.documentElement.scrollTop,l=document.documentElement.clientHeight/2;s+l-r.offset().top>e.offset().top-r.offset().top+parseInt(e.css("height").slice(0,-2))||p.css("height",s+l-r.offset().top+"px"),i.find(".wpr-main-line-icon.wpr-icon").each(function(){t(this).offset().top<parseInt(r.offset().top+parseInt(a))?t(this).addClass("wpr-change-border-color"):t(this).removeClass("wpr-change-border-color")})}}function s(e,t,r,a,s){if(s=i.find(".wpr-timeline-centered"),i.find(".wpr-both-sided-timeline").length||i.find(".wpr-one-sided-timeline").length||i.find(".wpr-one-sided-timeline-left").length){0<i.find(".wpr-timeline-entry:eq(0)").prev(".wpr-year-wrap").length&&(a=i.find(".wpr-year-label").eq(0));var l=a.offset().top,n=r.offset().top,o=l-s.offset().top+"px",d=n-l+parseInt(r.css("height").slice(0,-2));e.css("top",o),e.css("height",d),""===t?"":t.css("top",o)}}var l=0<i.find(".wpr-timeline-centered").length?i.find(".wpr-timeline-centered"):"",n=0<i.find(".wpr-timeline-centered").length?i.find(".wpr-timeline-centered"):"",o=0<i.find(".wpr-grid-pagination").length?i.find(".wpr-grid-pagination"):"",d=0<i.find(".wpr-middle-line").length?i.find(".wpr-middle-line"):"",p=0<i.find(".wpr-timeline-fill").length?i.find(".wpr-timeline-fill"):"",c=0<i.find(".wpr-main-line-icon.wpr-icon:last").length?i.find(".wpr-main-line-icon.wpr-icon:last"):"",f=0<i.find(".wpr-main-line-icon.wpr-icon").length?i.find(".wpr-main-line-icon.wpr-icon").first():"",m=".elementor-element-"+i.attr("data-id"),g=i.find(".wpr-story-info-vertical").attr("data-animation-offset")?+i.find(".wpr-story-info-vertical").attr("data-animation-offset"):"",y=i.find(".wpr-story-info-vertical").attr("data-animation-duration")?+i.find(".wpr-story-info-vertical").attr("data-animation-duration"):"";if(0<i.find(".wpr-timeline-centered").length&&(t(window).resize(function(){r()}),t(window).smartresize(function(){r()}),setTimeout(function(){r(),t(window).trigger("resize")},500),s(d,p,c,f,n),setTimeout(function(){s(d,p,c,f,n),t(window).trigger("resize")},500),t(window).smartresize(function(){s(d,p,c,f,n)}),t(window).resize(function(){s(d,p,c,f,n)}),"load-more"!==l.attr("data-pagination")&&i.find(".wpr-grid-pagination").css("visibility","hidden"),AOS.init({offset:parseInt(g),duration:y,once:!0}),a(c,f),t(window).on("scroll",function(){a(c,f)}),!i.find(".elementor-repeater-items").length&&!e.editorCheck()&&("load-more"===i.find(".wpr-timeline-centered").data("pagination")||"infinite-scroll"===i.find(".wpr-timeline-centered").data("pagination")))){var w=(void 0===l||"load-more"!==l.attr("data-pagination"))&&10;l.infiniteScroll({path:m+" .wpr-grid-pagination a",hideNav:!1,append:m+".wpr-timeline-entry",history:!1,scrollThreshold:w,status:m+" .page-load-status"}),l.on("request.infiniteScroll",function(){i.find(".wpr-load-more-btn").hide(),i.find(".wpr-pagination-loading").css("display","inline-block")});var h=0;l.on("load.infiniteScroll",function(e,r){h++;var w=t(r).find(m).find(".wpr-timeline-entry");l.infiniteScroll("appendItems",w),i.find(".wpr-one-sided-timeline").length||i.find(".wpr-one-sided-timeline-left").length||(i.find(".wpr-timeline-entry").each(function(e){t(this).removeClass("wpr-right-aligned wpr-left-aligned"),0==e%2?(t(this).addClass("wpr-left-aligned"),t(this).find(".wpr-story-info-vertical").attr("data-aos",t(this).find(".wpr-story-info-vertical").attr("data-aos-left"))):(t(this).addClass("wpr-right-aligned"),t(this).find(".wpr-story-info-vertical").attr("data-aos",t(this).find(".wpr-story-info-vertical").attr("data-aos-right")))}),AOS.init({offset:parseInt(g),duration:y,once:!0})),t(window).scroll(),i.find(".wpr-pagination-loading").hide(),l.data("max-pages")-1===h?(i.find(".wpr-pagination-finish").fadeIn(1e3),o.delay(2e3).fadeOut(1e3)):"load-more"===l.attr("data-pagination")&&i.find(".wpr-load-more-btn").fadeIn(),d=i.find(".wpr-middle-line"),p=i.find(".wpr-timeline-fill"),c=i.find(".wpr-main-line-icon.wpr-icon:last"),f=i.find(".wpr-main-line-icon.wpr-icon").first(),n=i.find(".wpr-timeline-centered"),s(d,p,c,f,n),t(window).trigger("resize"),a(c,f)}),e.editorCheck()||(i.find(".wpr-load-more-btn").on("click",function(){return l.infiniteScroll("loadNextPage"),!1}),"infinite-scroll"==l.attr("data-pagination")&&l.infiniteScroll("loadNextPage"))}if(i.find(".swiper-wrapper").length){var u=function(e,t){if("undefined"==typeof Swiper){var i=elementorFrontend.utils.swiper;return new i(e,t).then(function(e){return e})}return b(e,t)},b=function(e,t){return new Promise(function(i){var r=new Swiper(e,t);i(r)})},T=i.find(".wpr-horizontal-bottom").length?".wpr-horizontal-bottom":".wpr-horizontal",v=i.find(T+".swiper-container"),k=v.data("slidestoshow");u(v,{spaceBetween:+v.data("swiper-space-between"),autoplay:"yes"===v.data("autoplay"),delay:+v.attr("data-swiper-delay"),speed:+v.attr("data-swiper-speed"),slidesPerView:v.data("slidestoshow"),direction:"horizontal",pagination:{el:".wpr-swiper-pagination",type:"progressbar"},navigation:{nextEl:".wpr-button-next",prevEl:".wpr-button-prev"},breakpoints:{320:{slidesPerView:1},480:{slidesPerView:2},769:{slidesPerView:k}}})}},widgetSharingButtons:function(e){e.find(".wpr-sharing-print").on("click",function(t){t.preventDefault(),window.print()})},widgetFlipCarousel:function(e){var i=JSON.parse(e.find(".wpr-flip-carousel").attr("data-settings"));e.find(".wpr-flip-carousel").css("opacity",1),e.find(".wpr-flip-carousel").flipster({itemContainer:"ul",itemSelector:"li",fadeIn:400,start:"yes"===i.starts_from_center?"center":0,style:i.carousel_type,loop:!("yes"!==i.loop),autoplay:"no"!==i.autoplay&&i.autoplay_milliseconds,pauseOnHover:!("yes"!==i.pause_on_hover),click:!("yes"!==i.play_on_click),scrollwheel:!("yes"!==i.play_on_scroll),touch:!0,nav:!("true"!==i.pagination_position)||!!i.pagination_position&&i.pagination_position,spacing:i.spacing,buttons:"custom",buttonPrev:i.button_prev,buttonNext:i.button_next});var r=e.find(".wpr-flip-carousel").find(".flipster__nav__item").find(".flipster__nav__link");r.each(function(){t(this).text(parseInt(t(this).text())+1)})},widgetFeatureList:function(e){e.find(".wpr-feature-list-item:not(:last-of-type)").find(".wpr-feature-list-icon-wrap").each(function(i){var r=e.find(".wpr-feature-list-item").eq(i+1).find(".wpr-feature-list-icon-wrap").offset().top;t(this).find(".wpr-feature-list-line").height(r-t(this).offset().top+"px")}),t(window).resize(function(){e.find(".wpr-feature-list-item:not(:last-of-type)").find(".wpr-feature-list-icon-wrap").each(function(i){var r=e.find(".wpr-feature-list-item").eq(i+1).find(".wpr-feature-list-icon-wrap").offset().top;t(this).find(".wpr-feature-list-line").height(r-t(this).offset().top+"px")})})},editorCheck:function(){return!!t("body").hasClass("elementor-editor-active")}};t(window).on("elementor/frontend/init",e.init)})(jQuery,window.elementorFrontend),function(e,t){var i=function(e,t,i){var r;return function(){var a=this,s=arguments;r?clearTimeout(r):i&&e.apply(a,s),r=setTimeout(function(){i||e.apply(a,s),r=null},t||100)}};jQuery.fn[t]=function(e){return e?this.bind("resize",i(e)):this.trigger(t)}}(jQuery,"smartresize");
|
1 |
+
(function(t){"use strict";var e={init:function(){var i={"wpr-nav-menu.default":e.widgetNavMenu,"wpr-onepage-nav.default":e.OnepageNav,"wpr-grid.default":e.widgetGrid,"wpr-magazine-grid.default":e.widgetMagazineGrid,"wpr-media-grid.default":e.widgetGrid,"wpr-woo-grid.default":e.widgetGrid,"wpr-featured-media.default":e.widgetFeaturedMedia,"wpr-product-media.default":e.widgetProductMedia,"wpr-countdown.default":e.widgetCountDown,"wpr-google-maps.default":e.widgetGoogleMaps,"wpr-before-after.default":e.widgetBeforeAfter,"wpr-mailchimp.default":e.widgetMailchimp,"wpr-advanced-slider.default":e.widgetAdvancedSlider,"wpr-testimonial.default":e.widgetTestimonialCarousel,"wpr-search.default":e.widgetSearch,"wpr-advanced-text.default":e.widgetAdvancedText,"wpr-progress-bar.default":e.widgetProgressBar,"wpr-image-hotspots.default":e.widgetImageHotspots,"wpr-flip-box.default":e.widgetFlipBox,"wpr-content-ticker.default":e.widgetContentTicker,"wpr-tabs.default":e.widgetTabs,"wpr-content-toggle.default":e.widgetContentToogle,"wpr-back-to-top.default":e.widgetBackToTop,"wpr-lottie-animations.default":e.widgetLottieAnimations,"wpr-posts-timeline.default":e.widgetPostsTimeline,"wpr-sharing-buttons.default":e.widgetSharingButtons,"wpr-flip-carousel.default":e.widgetFlipCarousel,"wpr-feature-list.default":e.widgetFeatureList,global:e.widgetSection,"wpr-post-media.default":e.widgetPostMedia};t.each(i,function(e,t){window.elementorFrontend.hooks.addAction("frontend/element_ready/"+e,t)})},widgetPostMedia:function(i){var r=t(".wpr-featured-media-image").attr("data-lightbox");if(typeof r!=typeof void 0&&!1!==r&&!e.editorCheck()){var a=i.find(".wpr-featured-media-wrap");r=JSON.parse(r),a.lightGallery(r),a.on("onAferAppendSlide.lg, onAfterSlide.lg",function(){var e=t("#lg-actual-size, #lg-zoom-in, #lg-zoom-out, #lg-download"),i=t("#lg-download").attr("href");t("#lg-download").length&&(-1===i.indexOf("wp-content")?e.addClass("wpr-hidden-element"):e.removeClass("wpr-hidden-element")),""===r.autoplay&&t(".lg-autoplay-button").css({width:"0",height:"0",overflow:"hidden"})})}},widgetSection:function(i){function r(t){var r=JSON.parse(t),a=e.editorCheck()?i.find(".wpr-particle-wrapper").attr("wpr-quantity"):i.attr("wpr-quantity"),s=e.editorCheck()?i.find(".wpr-particle-wrapper").attr("wpr-color")?i.find(".wpr-particle-wrapper").attr("wpr-color"):"#000000":i.attr("wpr-color")||"#000000",l=e.editorCheck()?i.find(".wpr-particle-wrapper").attr("wpr-speed"):i.attr("wpr-speed"),n=e.editorCheck()?i.find(".wpr-particle-wrapper").attr("wpr-shape"):i.attr("wpr-shape"),o=e.editorCheck()?i.find(".wpr-particle-wrapper").attr("wpr-size"):i.attr("wpr-size");return r.particles.size.value=o,r.particles.number.value=a,r.particles.color.value=s,r.particles.shape.type=n,r.particles.line_linked.color=s,r.particles.move.speed=l,r}if(function(){function e(){if(document.querySelector(".wpr-mybar")){var e=document.body.scrollTop||document.documentElement.scrollTop,t=document.documentElement.scrollHeight-document.documentElement.clientHeight;document.querySelector("#wpr-mybar").style.width=100*(e/t)+"%"}}e(),window.onscroll=function(){e()},t("#wpadminbar").length&&t(".wpr-reading-progress-bar-container").length&&0===t(".wpr-reading-progress-bar-container").position().top&&t(".wpr-reading-progress-bar-container").css("top"," 32px")}(),(i.attr("data-wpr-particles")||i.find(".wpr-particle-wrapper").attr("data-wpr-particles-editor"))&&function(){var a=i.data("element_type"),s=i.data("id"),l=e.editorCheck()?i.find(".wpr-particle-wrapper").attr("data-wpr-particles-editor"):i.attr("data-wpr-particles");"section"===a&&void 0!==l&&(e.editorCheck()?i.hasClass("wpr-particle-yes")?(particlesJS("wpr-particle-"+s,"wpr_particle_json_custom"==i.find(".wpr-particle-wrapper").attr("particle-source")?JSON.parse(l):r(l)),i.find(".elementor-column").css("z-index",9),t(window).trigger("resize")):i.find(".wpr-particle-wrapper").remove():(i.prepend("<div class=\"wpr-particle-wrapper\" id=\"wpr-particle-"+s+"\"></div>"),particlesJS("wpr-particle-"+s,"wpr_particle_json_custom"==i.attr("particle-source")?JSON.parse(l):r(l))))}(),(i.hasClass("wpr-jarallax")||i.hasClass("wpr-jarallax-yes"))&&function(){i.hasClass("wpr-jarallax-yes")&&(!e.editorCheck()&&i.hasClass("wpr-jarallax")?(i.css("background-image","url(\""+i.attr("bg-image")+"\")"),i.jarallax({type:i.attr("scroll-effect"),speed:i.attr("speed-data")})):e.editorCheck()&&(i.css("background-image","url(\""+i.find(".wpr-jarallax").attr("bg-image-editor")+"\")"),i.jarallax({type:i.find(".wpr-jarallax").attr("scroll-effect-editor"),speed:i.find(".wpr-jarallax").attr("speed-data-editor")})))}(),i.hasClass("wpr-parallax-yes")&&function(){if(i.hasClass("wpr-parallax-yes")){var r=document.getElementsByClassName("wpr-parallax-multi-layer"),a=Array.from(r).map(e=>new Parallax(e,{invertY:"yes"==e.getAttribute("direction"),invertX:"yes"==e.getAttribute("direction"),scalarX:e.getAttribute("scalar-speed"),scalarY:e.getAttribute("scalar-speed"),hoverOnly:!0,pointerEvents:!0}));a.forEach(e=>{e.friction(.2,.2)})}if(!e.editorCheck()){var s=[];document.querySelectorAll(".wpr-parallax-multi-layer").forEach(e=>{e.parentElement.style.position="relative",e.style.position="absolute",s.push(e),e.remove()}),document.querySelectorAll(".wpr-parallax-ml-children").forEach(e=>{e.style.position="absolute",e.style.top=e.getAttribute("style-top"),e.style.left=e.getAttribute("style-left")}),t(".wpr-parallax-yes").each(function(e){t(this).append(s[e])})}}(),i.hasClass("wpr-sticky-section-yes")){function r(){if(!i.hasClass("wpr-sticky-section-yes")||!i.find(".wpr-sticky-section-yes-editor"))return void(a="static");var e=[],t=[["mobile_sticky",768],["mobile_extra_sticky",881],["tablet_sticky",1025],["tablet_extra_sticky",1201],["laptop_sticky",1216],["desktop_sticky",2400],["widescreen_sticky",4e3]].filter(e=>-1!=c.indexOf(e[0])).reverse();t.forEach((t,i)=>{t[1]>d&&-1===p.indexOf(t[0])?(a=-1===c?.indexOf(t[0])?e[i-1]?e[i-1]:l:"static",e[i]=a):t[1]>d&&-1!==p.indexOf(t[0])&&(a=l)}),h()}function h(){var e=+window.innerHeight-(+i.css("top").slice(0,-2)+i.height()),t=+window.innerHeight-(+i.css("bottom").slice(0,-2)+i.height());"top"===n?(i.css({position:a}),""!==g&&g.css({position:a,top:o+"px",bottom:"auto","z-index":y,width:"100%"})):(i.css({position:a}),""!==g&&(g=g.find(".wpr-sticky-section-yes"),g.css({position:a,bottom:o+"px",top:"auto","z-index":y,width:"100%"})))}function u(){t("#wpadminbar").length&&(s=t("#wpadminbar").css("height").slice(0,t("#wpadminbar").css("height").length-2),"top"===n&&("fixed"==i.css("position")||"sticky"==i.css("position"))&&(i.css("top",+s+m+"px"),i.css("bottom","auto")))}var a,s,l=e.editorCheck()?i.find(".wpr-sticky-section-yes-editor").attr("data-wpr-position-type"):i.attr("data-wpr-position-type"),n=e.editorCheck()?i.find(".wpr-sticky-section-yes-editor").attr("data-wpr-position-location"):i.attr("data-wpr-position-location"),o=e.editorCheck()?i.find(".wpr-sticky-section-yes-editor").attr("data-wpr-position-offset"):i.attr("data-wpr-position-offset"),d=t("body").prop("clientWidth")+17,p=e.editorCheck()?i.find(".wpr-sticky-section-yes-editor").attr("data-wpr-sticky-devices"):i.attr("data-wpr-sticky-devices"),c=e.editorCheck()?i.find(".wpr-sticky-section-yes-editor").attr("data-wpr-active-breakpoints"):i.attr("data-wpr-active-breakpoints"),f=!!(i.hasClass("wpr-sticky-section-yes")||i.find(".wpr-sticky-section-yes-editor")),m=+i.css("top").slice(0,-2),g=i.closest("div[data-elementor-type=\"wp-post\"]").length?i.closest("div[data-elementor-type=\"wp-post\"]"):"",y=e.editorCheck()?i.find(".wpr-sticky-section-yes-editor").attr("data-wpr-z-index"):i.attr("data-wpr-z-index");if(i.find(".wpr-sticky-section-yes-editor").length||(l=i.attr("data-wpr-position-type"),n=i.attr("data-wpr-position-location"),o=i.attr("data-wpr-position-offset"),p=i.attr("data-wpr-sticky-devices"),c=i.attr("data-wpr-active-breakpoints"),y=i.attr("data-wpr-z-index")),0==p.length&&(l="static"),e.editorCheck()&&p){var w=i.find(".wpr-sticky-section-yes-editor").attr("data-wpr-sticky-devices");i.attr("data-wpr-sticky-devices",w),p=i.attr("data-wpr-sticky-devices")}r(),u(),t(window).resize(function(){d=t("body").prop("clientWidth")+17,r()}),f||(a="static")}},widgetNavMenu:function(i){function r(){if(i.hasClass("wpr-mobile-menu-full-width")&&i.closest(".elementor-column").length){var e=i.closest(".elementor-column"),t=i.closest(".elementor-top-section").outerWidth()-2*d.offset().left,r=e.offset().left+parseInt(e.css("padding-left"),10);d.css({width:t+"px",left:-r+"px"})}}function a(e,t){!0===t?i.hasClass("wpr-sub-menu-fx-slide")?e.stop().slideDown():e.stop().fadeIn():i.hasClass("wpr-sub-menu-fx-slide")?e.stop().slideUp():e.stop().fadeOut()}var s=i.find(".wpr-nav-menu-container"),l=i.find(".wpr-mobile-nav-menu-container"),n=s.find(".wpr-nav-menu > li.menu-item-has-children"),o=s.find(".wpr-sub-menu li.menu-item-has-children");"click"===s.attr("data-trigger")?(n.children("a").on("click",function(r){var e=t(this).parent(),l=e.children(".wpr-sub-menu");n.not(e).removeClass("wpr-sub-open"),(s.hasClass("wpr-nav-menu-horizontal")||s.hasClass("wpr-nav-menu-vertical")&&i.hasClass("wpr-sub-menu-position-absolute"))&&a(n.children(".wpr-sub-menu"),!1),e.hasClass("wpr-sub-open")?(e.removeClass("wpr-sub-open"),a(l,!1)):(r.preventDefault(),e.addClass("wpr-sub-open"),a(l,!0))}),o.on("click",function(i){var e=t(this),r=e.children(".wpr-sub-menu");s.hasClass("wpr-nav-menu-horizontal")&&a(o.find(".wpr-sub-menu"),!1),e.hasClass("wpr-sub-open")?(e.removeClass("wpr-sub-open"),a(r,!1)):(i.preventDefault(),e.addClass("wpr-sub-open"),a(r,!0))}),t(document).mouseup(function(t){n.is(t.target)||0!==n.has(t.target).length||(n.not().removeClass("wpr-sub-open"),a(n.children(".wpr-sub-menu"),!1)),o.is(t.target)||0!==o.has(t.target).length||(o.removeClass("wpr-sub-open"),a(o.children(".wpr-sub-menu"),!1))})):(n.on("mouseenter",function(){s.hasClass("wpr-nav-menu-vertical")&&i.hasClass("wpr-sub-menu-position-absolute")&&s.find("li").not(this).children(".wpr-sub-menu").hide(),a(t(this).children(".wpr-sub-menu"),!0)}),o.on("mouseenter",function(){a(t(this).children(".wpr-sub-menu"),!0)}),s.hasClass("wpr-nav-menu-horizontal")?(n.on("mouseleave",function(){a(t(this).children(".wpr-sub-menu"),!1)}),o.on("mouseleave",function(){a(t(this).children(".wpr-sub-menu"),!1)})):s.on("mouseleave",function(){a(t(this).find(".wpr-sub-menu"),!1)}));var d=l.find(".wpr-mobile-nav-menu");l.find(".wpr-mobile-toggle").on("click",function(){t(this).toggleClass("wpr-mobile-toggle-fx"),t(this).hasClass(".wpr-mobile-toggle-open")?(t(this).removeClass(".wpr-mobile-toggle-open"),t(this).trigger("focusout"),t(this).find(".wpr-mobile-toggle-text").length&&(t(this).children().eq(1).hide(),t(this).children().eq(0).show())):(t(this).addClass(".wpr-mobile-toggle-open"),t(this).find(".wpr-mobile-toggle-text").length&&(t(this).children().eq(0).hide(),t(this).children().eq(1).show())),t(this).parent().next().stop().slideToggle(),r()}),d.find(".sub-menu").removeClass("wpr-sub-menu").addClass("wpr-mobile-sub-menu"),d.find(".menu-item-has-children").children("a").on("click",function(i){var e=t(this).closest("li");e.hasClass("wpr-mobile-sub-open")?(e.removeClass("wpr-mobile-sub-open"),e.children(".wpr-mobile-sub-menu").first().stop().slideUp()):(i.preventDefault(),e.addClass("wpr-mobile-sub-open"),e.children(".wpr-mobile-sub-menu").first().stop().slideDown())}),r(),t(window).smartresize(function(){r()})},OnepageNav:function(e){function i(i){"yes"!==e.find(".wpr-onepage-nav").attr("data-highlight")||(e.find(".wpr-onepage-nav-item").children("a").removeClass("wpr-onepage-active-item"),t(".elementor-section").each(function(){var r=t(this).offset().top,a=r+t(this).outerHeight();i>=r&&i<a&&e.find(".wpr-onepage-nav-item").children("a[href=\"#"+t(this).attr("id")+"\"]").addClass("wpr-onepage-active-item")}))}e.find(".wpr-onepage-nav-item").on("click",function(e){e.preventDefault();var r=t(t(this).find("a").attr("href")),a=parseInt(t(this).parent().attr("data-speed"),10);t("body").animate({scrollTop:r.offset().top},a),i(t(window).scrollTop())}),"yes"===e.find(".wpr-onepage-nav").attr("data-highlight")&&setTimeout(function(){t(window).scroll()},10),t(window).scroll(function(){i(t(this).scrollTop())})},widgetGrid:function(r){function a(){if(r.find(".wpr-sharing-trigger").length){var e=r.find(".wpr-sharing-trigger"),i=r.find(".wpr-post-sharing-inner"),a=5;i.first().find("a").each(function(){a+=t(this).outerWidth()+parseInt(t(this).css("margin-right"),10)});var s=parseInt(i.find("a").css("margin-right"),10);"left"===e.attr("data-direction")?(i.css("width",a+"px"),i.css("left",-(s+a)+"px")):"right"===e.attr("data-direction")?(i.css("width",a+"px"),i.css("right",-(s+a)+"px")):"top"===e.attr("data-direction")?(i.find("a").css({"margin-right":"0","margin-top":s+"px"}),i.css({top:-s+"px",left:"50%","-webkit-transform":"translate(-50%, -100%)",transform:"translate(-50%, -100%)"})):"right"===e.attr("data-direction")?(i.css("width",a+"px"),i.css({left:s+"px"})):"bottom"===e.attr("data-direction")&&(i.find("a").css({"margin-right":"0","margin-bottom":s+"px"}),i.css({bottom:-s+"px",left:"50%","-webkit-transform":"translate(-50%, 100%)",transform:"translate(-50%, 100%)"})),"click"===e.attr("data-action")?e.on("click",function(){var e=t(this).next();"hidden"===e.css("visibility")?(e.css("visibility","visible"),e.find("a").css({opacity:"1",top:"0"}),setTimeout(function(){e.find("a").addClass("wpr-no-transition-delay")},100*e.find("a").length)):(e.find("a").removeClass("wpr-no-transition-delay"),e.find("a").css({opacity:"0",top:"-5px"}),setTimeout(function(){e.css("visibility","hidden")},100*e.find("a").length))}):(e.on("mouseenter",function(){var e=t(this).next();e.css("visibility","visible"),e.find("a").css({opacity:"1",top:"0"}),setTimeout(function(){e.find("a").addClass("wpr-no-transition-delay")},100*e.find("a").length)}),r.find(".wpr-grid-item-sharing").on("mouseleave",function(){var e=t(this).find(".wpr-post-sharing-inner");e.find("a").removeClass("wpr-no-transition-delay"),e.find("a").css({opacity:"0",top:"-5px"}),setTimeout(function(){e.css("visibility","hidden")},100*e.find("a").length)}))}}function s(){"yes"!==p.find(".wpr-grid-media-wrap").attr("data-overlay-link")||e.editorCheck()||(p.find(".wpr-grid-media-wrap").css("cursor","pointer"),p.find(".wpr-grid-media-wrap").on("click",function(e){var i=e.target.className;if(-1!==i.indexOf("inner-block")||-1!==i.indexOf("wpr-cv-inner")||-1!==i.indexOf("wpr-grid-media-hover")){e.preventDefault();var r=t(this).find(".wpr-grid-media-hover-bg").attr("data-url"),r=r.replace("#new_tab","");"_blank"===p.find(".wpr-grid-item-title a").attr("target")?window.open(r,"_blank").focus():window.location.href=r}}))}function l(i){if(-1!==r.find(".wpr-grid-item-lightbox").length){var a=r.find(".wpr-grid-item-lightbox"),s=a.find(".wpr-grid-lightbox-overlay").first();a.each(function(){var e=t(this).find(".inner-block > span").attr("data-src"),i=t(this).closest("article").not(".slick-cloned");p.hasClass("wpr-media-grid")||i.find(".wpr-grid-image-wrap").attr("data-src",e);var r=i.find(".wpr-grid-image-wrap").attr("data-src");typeof r!="undefined"&&!1!==r&&-1===r.indexOf("wp-content")&&i.find(".wpr-grid-image-wrap").attr("data-iframe","true")}),p.lightGallery(i.lightbox),p.on("onAfterOpen.lg",function(){t(".lg-outer").find(".lg-thumb-item").length&&t(".lg-outer").find(".lg-thumb-item").each(function(){var e=t(this).find("img").attr("src"),i=e,r=e.lastIndexOf("."),a=e.slice(r),s=e.lastIndexOf("-"),l=!!/\d{3,}x\d{3,}/.test(e.substring(r,s))&&e.substring(r,s);42<=e.substring(r,s).length&&(l=""),""!==l&&(!1===l?i=[e.slice(0,r),"-150x150",e.slice(r)].join(""):i=e.replace(l,"-150x150")),t(this).find("img").attr("src",i)})}),r.find(".wpr-grid").on("onAferAppendSlide.lg, onAfterSlide.lg",function(){var e=t("#lg-actual-size, #lg-zoom-in, #lg-zoom-out, #lg-download"),r=t("#lg-download").attr("href");t("#lg-download").length&&(-1===r.indexOf("wp-content")?e.addClass("wpr-hidden-element"):e.removeClass("wpr-hidden-element")),""===i.lightbox.autoplay&&t(".lg-autoplay-button").css({width:"0",height:"0",overflow:"hidden"})}),s.length?(r.find(".wpr-grid-media-hover-bg").after(s.remove()),r.find(".wpr-grid-lightbox-overlay").on("click",function(){e.editorCheck()?alert("Lightbox is Disabled in the Editor!"):t(this).closest("article").find(".wpr-grid-image-wrap").trigger("click")})):a.find(".inner-block > span").on("click",function(){if(!e.editorCheck()){var i=t(this).closest("article").find(".wpr-grid-image-wrap");i.trigger("click")}else alert("Lightbox is Disabled in the Editor!")})}}function n(){r.find(".wpr-post-like-button").length&&r.find(".wpr-post-like-button").on("click",function(){var e=t(this);return""!==e.attr("data-post-id")&&t.ajax({type:"POST",url:e.attr("data-ajax"),data:{action:"wpr_likes_init",post_id:e.attr("data-post-id"),nonce:e.attr("data-nonce")},beforeSend:function(){e.fadeTo(500,.5)},success:function(t){var i=e.attr("data-icon"),r=t.count;""===r.replace(/<\/?[^>]+(>|$)/g,"")?(r="<span class=\"wpr-post-like-count\">"+e.attr("data-text")+"</span>",!e.hasClass("wpr-likes-zero")&&e.addClass("wpr-likes-zero")):e.removeClass("wpr-likes-zero"),e.hasClass("wpr-already-liked")?(e.prop("title","Like"),e.removeClass("wpr-already-liked"),e.html("<i class=\""+i+"\"></i>"+r)):(e.prop("title","Unlike"),e.addClass("wpr-already-liked"),e.html("<i class=\""+i.replace("far","fas")+"\"></i>"+r)),e.fadeTo(500,1)}}),!1})}function o(e){for(var a,s,l,n,o=r.find(".wpr-grid"),d=o.find(".wpr-grid-item"),p=d.filter(":visible"),c=e.layout,f=e.media_align,m=e.media_width,g=e.media_distance,y=3,w=1,h=2,u=parseInt(e.columns_desktop,10),b=e.gutter_hr,T=e.gutter_vr,v=o.width()+b-.3,k=t("body").prop("clientWidth"),x=400,C=r.attr("class"),C=C.split(" "),_=0;_<C.length-1;_++)-1!==C[_].search(/mobile\d/)&&(w=C[_].slice(-1)),-1!==C[_].search(/mobile_extra\d/)&&(a=C[_].slice(-1)),-1!==C[_].search(/tablet\d/)&&(h=C[_].slice(-1)),-1!==C[_].search(/tablet_extra\d/)&&(s=C[_].slice(-1)),-1!==C[_].search(/widescreen\d/)&&(n=C[_].slice(-1)),-1!==C[_].search(/laptop\d/)&&(l=C[_].slice(-1));y=440>=k?w:768>=k?a?a:h:881>=k?h:1025>=k?s?s:h:1201>=k?l?l:u:1920>=k?u:2300>=k?u:2650>=k?n?n:u+1:3e3>=k?n?n:u+2:n?n:u+3,8<y&&(y=8),"string"==typeof y&&-1!==y.indexOf("pro")&&(y=3),d.outerWidth(Math.floor(v/y-b)),d.css("margin-bottom",T+"px"),1===y&&d.last().css("margin-bottom","0");var S=-1;if(p.each(function(){var e=t(this).outerHeight(),i=parseInt(t(this).css("top"),10);i>S&&(S=i)}),"fitRows"===c&&p.each(function(){parseInt(t(this).css("top"))===S&&t(this).addClass("rf-last-row")}),"list"===c){var z=d.find(".wpr-grid-image-wrap").outerHeight();if(d.find(".wpr-grid-item-below-content").css("min-height",z+"px"),480>t("body").prop("clientWidth"))d.find(".wpr-grid-media-wrap").css({float:"none",width:"100%"}),d.find(".wpr-grid-item-below-content").css({float:"none",width:"100%"}),d.find(".wpr-grid-image-wrap").css("padding","0"),d.find(".wpr-grid-item-below-content").css("min-height","0"),"zigzag"===f&&d.find("[class*=\"elementor-repeater-item\"]").css("text-align","center");else if("zigzag"!==f){d.find(".wpr-grid-media-wrap").css({float:f,width:m+"%"});var j="left"===f?"margin-right":"margin-left";d.find(".wpr-grid-media-wrap").css(j,g+"px"),d.find(".wpr-grid-item-below-content").css({float:f,width:"calc((100% - "+m+"%) - "+g+"px)"})}else d.filter(":even").find(".wpr-grid-media-wrap").css({float:"left",width:m+"%"}),d.filter(":even").find(".wpr-grid-item-below-content").css({float:"left",width:"calc((100% - "+m+"%) - "+g+"px)"}),d.filter(":even").find(".wpr-grid-media-wrap").css("margin-right",g+"px"),d.filter(":odd").find(".wpr-grid-media-wrap").css({float:"right",width:m+"%"}),d.filter(":odd").find(".wpr-grid-item-below-content").css({float:"right",width:"calc((100% - "+m+"%) - "+g+"px)"}),d.filter(":odd").find(".wpr-grid-media-wrap").css("margin-left",g+"px"),o.hasClass("wpr-grid-list-ready")||d.each(function(e){var i=t(this).find("[class*=\"elementor-repeater-item\"]");0==e%2?i.each(function(){if(!t(this).hasClass("wpr-grid-item-align-center")){"none"===t(this).css("float")?t(this).css("text-align","left"):t(this).css("float","left");t(this).find(".inner-block")}}):i.each(function(e){if(!t(this).hasClass("wpr-grid-item-align-center")){"none"===t(this).css("float")?t(this).css("text-align","right"):t(this).css("float","right");var i=t(this).find(".inner-block");"0px"!==i.css("margin-left")&&(i.css("margin-right",i.css("margin-left")),i.css("margin-left","0")),0===e&&"0px"!==i.css("margin-right")&&(i.css("margin-left",i.css("margin-right")),i.css("margin-right","0"))}})}),setTimeout(function(){o.hasClass("wpr-grid-list-ready")||o.addClass("wpr-grid-list-ready")},500)}"list"===c&&(c="fitRows"),"default"!==e.filters_animation&&(x=0);o.isotope({layoutMode:c,masonry:{comlumnWidth:v/y,gutter:b},fitRows:{comlumnWidth:v/y,gutter:b},transitionDuration:x,percentPosition:!0})}function d(e){if("yes"===e.filters_count&&r.find(".wpr-grid-filters a, .wpr-grid-filters span").each(function(){"*"===t(this).attr("data-filter")?t(this).find("sup").text(r.find(".wpr-grid-filters").next().find("article").length):t(this).find("sup").text(r.find(t(this).attr("data-filter")).length)}),"yes"!==e.filters_linkable){if("yes"===e.deeplinking){var i=window.location.hash.replace("#filter:",".");window.location.hash.match("#filter:all")&&(i="*");var a=r.find(".wpr-grid-filters span[data-filter=\""+i+"\"]:not(.wpr-back-filter)"),s=a.parent();"parent"===a.parent().attr("data-role")?s.parent("ul").find("ul[data-parent=\""+i+"\"]").length&&(s.parent("ul").children("li").css("display","none"),s.siblings("ul[data-parent=\""+i+"\"]").css("display","block")):"sub"===a.parent().attr("data-role")&&(s.closest(".wpr-grid-filters").children("li").css("display","none"),s.parent("ul").css("display","inline-block")),r.find(".wpr-grid-filters span").removeClass("wpr-active-filter"),a.addClass("wpr-active-filter"),r.find(".wpr-grid").isotope({filter:i}),e.lightbox.selector="*"===i?" .wpr-grid-image-wrap":i+" .wpr-grid-image-wrap",l(e)}"yes"===e.filters_hide_empty&&r.find(".wpr-grid-filters span").each(function(){var e=t(this).attr("data-filter");"*"!==e&&(0===p.find(e).length?t(this).parent("li").addClass("wpr-hidden-element"):t(this).parent("li").removeClass("wpr-hidden-element"))}),""!==e.filters_default_filter&&setTimeout(function(){r.find(".wpr-grid-filters").find("span[data-filter*=\"-"+e.filters_default_filter+"\"]")[0].click()},100),r.find(".wpr-grid-filters span").on("click",function(){var i=t(this).data("filter"),a=t(this).parent("li"),s=a.attr("data-role");if(r.find(".wpr-grid-filters span").removeClass("wpr-active-filter"),t(this).addClass("wpr-active-filter"),"parent"===s?a.parent("ul").find("ul[data-parent=\""+i+"\"]").length&&(a.parent("ul").children("li").css("display","none"),a.siblings("ul[data-parent=\""+i+"\"]").css("display","block")):"back"===s&&(a.closest(".wpr-grid-filters").children("li").css("display","inline-block"),a.parent().css("display","none")),"yes"===e.deeplinking){var l="#filter:"+i.replace(".","");"*"===i&&(l="#filter:all"),window.location.href=window.location.pathname+window.location.search+l}"infinite-scroll"===e.pagination_type&&0===p.find(t(this).attr("data-filter")).length&&r.find(".wpr-grid").infiniteScroll("loadNextPage"),"default"!==e.filters_animation&&r.find(".wpr-grid-item-inner").css({opacity:"0",transition:"none"}),"fade-slide"===e.filters_animation?r.find(".wpr-grid-item-inner").css("top","20px"):"zoom"===e.filters_animation?r.find(".wpr-grid-item-inner").css("transform","scale(0.01)"):r.find(".wpr-grid-item-inner").css({top:"0",transform:"scale(1)"}),r.find(".wpr-grid").isotope({filter:i}),e.lightbox.selector="*"===i?" .wpr-grid-image-wrap":i+" .wpr-grid-image-wrap",p.data("lightGallery").destroy(!0),p.lightGallery(e.lightbox)})}}var p=r.find(".wpr-grid");if(p.length){var c=p.attr("data-settings");if("undefined"==typeof c||!1===c){p.animate({opacity:"1"},1e3);var f=r.attr("class"),m=f.match(/wpr-grid-slider-columns-\d/)?f.match(/wpr-grid-slider-columns-\d/).join().slice(-1):2,g=f.match(/columns--widescreen\d/)?f.match(/columns--widescreen\d/).join().slice(-1):m,y=f.match(/columns--laptop\d/)?f.match(/columns--laptop\d/).join().slice(-1):m,w=f.match(/columns--tablet_extra\d/)?f.match(/columns--tablet_extra\d/).join().slice(-1):h,h=f.match(/columns--tablet\d/)?f.match(/columns--tablet\d/).join().slice(-1):2,u=f.match(/columns--mobile_extra\d/)?f.match(/columns--mobile_extra\d/).join().slice(-1):h,b=f.match(/columns--mobile\d/)?f.match(/columns--mobile\d/).join().slice(-1):1,T=f.match(/wpr-grid-slides-to-scroll-\d/)?+f.match(/wpr-grid-slides-to-scroll-\d/).join().slice(-1):1;if(p.slick({appendDots:r.find(".wpr-grid-slider-dots"),customPaging:function(e,t){e.slideCount;return"<span class=\"wpr-grid-slider-dot\"></span>"},slidesToShow:m,responsive:[{breakpoint:1e4,settings:{slidesToShow:g,slidesToScroll:T>g?1:T}},{breakpoint:2399,settings:{slidesToShow:m,slidesToScroll:T>m?1:T}},{breakpoint:1221,settings:{slidesToShow:y,slidesToScroll:T>y?1:T}},{breakpoint:1200,settings:{slidesToShow:w,slidesToScroll:T>w?1:T}},{breakpoint:1024,settings:{slidesToShow:h,slidesToScroll:T>h?1:T}},{breakpoint:880,settings:{slidesToShow:u,slidesToScroll:T>u?1:T}},{breakpoint:768,settings:{slidesToShow:b,slidesToScroll:T>b?1:T}}]}),r.find(".slick-dots").length&&r.hasClass("wpr-grid-slider-dots-horizontal")){var v=r.find(".slick-dots li").outerWidth()*r.find(".slick-dots li").length-parseInt(r.find(".slick-dots li span").css("margin-right"),10);r.find(".slick-dots").length&&r.find(".slick-dots").css("width",v),t(window).on("resize",function(){setTimeout(function(){var e=r.find(".slick-dots li").outerWidth()*r.find(".slick-dots li").length-parseInt(r.find(".slick-dots li span").css("margin-right"),10);r.find(".slick-dots").css("width",e)},300)})}c=JSON.parse(p.attr("data-slick"))}else if(c=JSON.parse(p.attr("data-settings")),o(c),setTimeout(function(){o(c)},100),e.editorCheck()&&(setTimeout(function(){o(c)},500),setTimeout(function(){o(c)},1e3)),t(window).on("load",function(){setTimeout(function(){o(c)},100)}),t(window).smartresize(function(){setTimeout(function(){o(c)},200)}),d(c),p.on("arrangeComplete",function(e,i){var a=0,s=0,l=c.animation_delay,n=c.animation_duration,o=c.filters_animation_duration;if(p.hasClass("grid-images-loaded"))l=0;else if(p.css("opacity","1"),"default"===c.animation&&"default"===c.filters_animation)return;for(var d in i){l+=c.animation_delay,r.find(i[d].element).find(".wpr-grid-item-inner").css({opacity:"1",top:"0",transform:"scale(1)",transition:"all "+n+"s ease-in "+l+"s"}),s+=c.filters_animation_delay,p.hasClass("grid-images-loaded")&&r.find(i[d].element).find(".wpr-grid-item-inner").css({transition:"all "+o+"s ease-in "+s+"s"});var f=window.location.hash;0<=f.indexOf("#filter:")&&0>f.indexOf("#filter:*")&&(f=f.replace("#filter:",""),r.find(i[d].element).filter(function(){if(t(this).hasClass(f))return a+=c.filters_animation_delay,t(this)}).find(".wpr-grid-item-inner").css({"transition-delay":a+"s"}))}}),p.imagesLoaded().progress(function(){"1"!==p.css("opacity")&&p.css("opacity","1"),setTimeout(function(){p.addClass("grid-images-loaded")},500)}),("load-more"===c.pagination_type||"infinite-scroll"===c.pagination_type)&&r.find(".wpr-grid-pagination").length&&!e.editorCheck()){var k=r.find(".wpr-grid-pagination"),x=".elementor-element-"+r.attr("data-id"),C=!1,_=!1;"infinite-scroll"===c.pagination_type&&(_=300,C=x+" .wpr-load-more-btn"),p.infiniteScroll({path:x+" .wpr-grid-pagination a",hideNav:C,append:!1,history:!1,scrollThreshold:_,status:x+" .page-load-status",onInit:function(){this.on("load",function(){p.removeClass("grid-images-loaded")})}}),p.on("request.infiniteScroll",function(){k.find(".wpr-load-more-btn").hide(),k.find(".wpr-pagination-loading").css("display","inline-block")});var S=0;p.on("load.infiniteScroll",function(e,i){S++;var r=t(i).find(x).find(".wpr-grid-item");p.infiniteScroll("appendItems",r),p.isotope("appended",r),r.imagesLoaded().progress(function(){o(c),setTimeout(function(){o(c),d(c)},10),setTimeout(function(){p.addClass("grid-images-loaded")},500)}),k.find(".wpr-pagination-loading").hide(),c.pagination_max_pages-1===S?(k.find(".wpr-pagination-finish").fadeIn(1e3),k.delay(2e3).fadeOut(1e3),setTimeout(function(){k.find(".wpr-pagination-loading").hide()},500)):"load-more"===c.pagination_type&&k.find(".wpr-load-more-btn").fadeIn(),setTimeout(function(){n(c)},300),l(c),p.data("lightGallery").destroy(!0),p.lightGallery(c.lightbox),s(),a()}),k.find(".wpr-load-more-btn").on("click",function(){return p.infiniteScroll("loadNextPage"),!1})}if(p.find(".wpr-grid-item-add-to-cart").length){var z=p.find(".wpr-grid-item-add-to-cart").find("i"),j=z.attr("class");z.length&&(j=j.substring(j.indexOf("fa-"),j.length)),t("body").on("adding_to_cart",function(e,t){t.fadeTo("slow",.5)}),t("body").on("added_to_cart",function(e,t,i,r){r.fadeTo("slow",1),z.length&&(r.find("i").removeClass(j).addClass("fa-check"),setTimeout(function(){r.find("i").removeClass("fa-check").addClass(j)},3500))})}a(),s(),l(c),n(c)}},widgetMagazineGrid:function(i){var r=i.find(".wpr-magazine-grid-wrap"),a=r.attr("data-slick"),s=r.attr("data-slide-effect");if(typeof a!="undefined"&&!1!==a&&r.slick({fade:"fade"===s}),"yes"!==r.find(".wpr-grid-media-wrap").attr("data-overlay-link")||e.editorCheck()||(r.find(".wpr-grid-media-wrap").css("cursor","pointer"),r.find(".wpr-grid-media-wrap").on("click",function(e){var i=e.target.className;(-1!==i.indexOf("inner-block")||-1!==i.indexOf("wpr-cv-inner")||-1!==i.indexOf("wpr-grid-media-hover"))&&(e.preventDefault(),window.location.href=t(this).find(".wpr-grid-media-hover-bg").attr("data-url"))})),i.find(".wpr-sharing-trigger").length){var l=i.find(".wpr-sharing-trigger"),n=i.find(".wpr-post-sharing-inner"),o=5;n.first().find("a").each(function(){o+=t(this).outerWidth()+parseInt(t(this).css("margin-right"),10)});var d=parseInt(n.find("a").css("margin-right"),10);"left"===l.attr("data-direction")?(n.css("width",o+"px"),n.css("left",-(d+o)+"px")):"right"===l.attr("data-direction")?(n.css("width",o+"px"),n.css("right",-(d+o)+"px")):"top"===l.attr("data-direction")?(n.find("a").css({"margin-right":"0","margin-top":d+"px"}),n.css({top:-d+"px",left:"50%","-webkit-transform":"translate(-50%, -100%)",transform:"translate(-50%, -100%)"})):"right"===l.attr("data-direction")?(n.css("width",o+"px"),n.css({left:d+"px"})):"bottom"===l.attr("data-direction")&&(n.find("a").css({"margin-right":"0","margin-bottom":d+"px"}),n.css({bottom:-d+"px",left:"50%","-webkit-transform":"translate(-50%, 100%)",transform:"translate(-50%, 100%)"})),"click"===l.attr("data-action")?l.on("click",function(){var e=t(this).next();"hidden"===e.css("visibility")?(e.css("visibility","visible"),e.find("a").css({opacity:"1",top:"0"}),setTimeout(function(){e.find("a").addClass("wpr-no-transition-delay")},100*e.find("a").length)):(e.find("a").removeClass("wpr-no-transition-delay"),e.find("a").css({opacity:"0",top:"-5px"}),setTimeout(function(){e.css("visibility","hidden")},100*e.find("a").length))}):(l.on("mouseenter",function(){var e=t(this).next();e.css("visibility","visible"),e.find("a").css({opacity:"1",top:"0"}),setTimeout(function(){e.find("a").addClass("wpr-no-transition-delay")},100*e.find("a").length)}),i.find(".wpr-grid-item-sharing").on("mouseleave",function(){var e=t(this).find(".wpr-post-sharing-inner");e.find("a").removeClass("wpr-no-transition-delay"),e.find("a").css({opacity:"0",top:"-5px"}),setTimeout(function(){e.css("visibility","hidden")},100*e.find("a").length)}))}i.find(".wpr-post-like-button").length&&i.find(".wpr-post-like-button").on("click",function(){var e=t(this);return""!==e.attr("data-post-id")&&t.ajax({type:"POST",url:e.attr("data-ajax"),data:{action:"wpr_likes_init",post_id:e.attr("data-post-id"),nonce:e.attr("data-nonce")},beforeSend:function(){e.fadeTo(500,.5)},success:function(t){var i=e.attr("data-icon"),r=t.count;""===r.replace(/<\/?[^>]+(>|$)/g,"")?(r="<span class=\"wpr-post-like-count\">"+e.attr("data-text")+"</span>",!e.hasClass("wpr-likes-zero")&&e.addClass("wpr-likes-zero")):e.removeClass("wpr-likes-zero"),e.hasClass("wpr-already-liked")?(e.prop("title","Like"),e.removeClass("wpr-already-liked"),e.html("<i class=\""+i+"\"></i>"+r)):(e.prop("title","Unlike"),e.addClass("wpr-already-liked"),e.html("<i class=\""+i.replace("far","fas")+"\"></i>"+r)),e.fadeTo(500,1)}}),!1})},widgetFeaturedMedia:function(i){var r=i.find(".wpr-gallery-slider"),a=r.attr("data-slick");r.animate({opacity:"1"},1e3),"[]"!==a&&r.slick({appendDots:i.find(".wpr-gallery-slider-dots"),customPaging:function(e,t){e.slideCount;return"<span class=\"wpr-gallery-slider-dot\"></span>"}});var s=t(".wpr-featured-media-image").attr("data-lightbox");if(typeof s!=typeof void 0&&!1!==s&&!e.editorCheck()){var l=i.find(".wpr-featured-media-wrap");s=JSON.parse(s),l.lightGallery(s),l.on("onAferAppendSlide.lg, onAfterSlide.lg",function(){var e=t("#lg-actual-size, #lg-zoom-in, #lg-zoom-out, #lg-download"),i=t("#lg-download").attr("href");t("#lg-download").length&&(-1===i.indexOf("wp-content")?e.addClass("wpr-hidden-element"):e.removeClass("wpr-hidden-element")),""===s.autoplay&&t(".lg-autoplay-button").css({width:"0",height:"0",overflow:"hidden"})})}},widgetProductMedia:function(i){var r=i.find(".wpr-product-media-image"),a=i.find(".wpr-gallery-slider"),s=a.attr("data-slick");if(a.animate({opacity:"1"},1e3),"[]"!==s&&a.length){var s=JSON.parse(s);if(a.slick(),"yes"===s.thumbnail_nav){var l=i.find(".wpr-product-thumb-nav");l.slick(),l.find("li").on("click",function(){var e=t(this).attr("data-slick-index");t(this).siblings().removeClass("slick-current"),t(this).addClass("slick-current"),a.slick("slickGoTo",parseInt(e,10))})}}var n=t(".wpr-product-media-image").attr("data-lightbox");if(typeof n!="undefined"&&!1!==n&&!e.editorCheck()){var o=i.find(".wpr-product-media-wrap");n=JSON.parse(n),o.lightGallery(n),o.on("onAferAppendSlide.lg, onAfterSlide.lg",function(){var e=t("#lg-actual-size, #lg-zoom-in, #lg-zoom-out, #lg-download"),i=t("#lg-download").attr("href");t("#lg-download").length&&(-1===i.indexOf("wp-content")?e.addClass("wpr-hidden-element"):e.removeClass("wpr-hidden-element")),""===n.autoplay&&t(".lg-autoplay-button").css({width:"0",height:"0",overflow:"hidden"})})}i.hasClass("wpr-gallery-zoom-yes")&&r.on("mousemove",function(e){var i=100*((e.pageX-t(this).offset().left)/t(this).width()),r=100*((e.pageY-t(this).offset().top)/t(this).height());t(this).children("img").css({"transform-origin":i+"% "+r+"%"})})},widgetCountDown:function(i){function r(){var e=d-new Date,r={days:Math.floor(e/86400000),hours:Math.floor(e/3600000%24),minutes:Math.floor(e/1e3/60%60),seconds:Math.floor(e/1e3%60)};(0>r.days||0>r.hours||0>r.minutes)&&(r={days:0,hours:0,minutes:0,seconds:0}),i.find(".wpr-countdown-number").each(function(){var e=r[t(this).attr("data-item")];1===e.toString().length&&(e="0"+e),t(this).text(e);var i=t(this).next();if(i.length&&!t(this).hasClass("wpr-countdown-seconds")){var a=i.data("text");"01"==e?i.text(a.singular):i.text(a.plural)}}),0>e&&(clearInterval(l),a())}function a(){var r=s.data("actions");e.editorCheck()||(r.hasOwnProperty("hide-timer")&&s.hide(),r.hasOwnProperty("hide-element")&&t(r["hide-element"]).hide(),r.hasOwnProperty("message")&&!i.children(".elementor-widget-container").children(".wpr-countdown-message").length&&s.after("<div class=\"wpr-countdown-message\">"+r.message+"</div>"),r.hasOwnProperty("redirect")&&(window.location.href=r.redirect),r.hasOwnProperty("load-template")&&s.parent().find(".elementor-inner").parent().show())}var s=i.children(".elementor-widget-container").children(".wpr-countdown-wrap"),l=null,n=s.data("interval"),o=s.data("show-again"),d=new Date(1e3*n);if("evergreen"===s.data("type")){var p=new Date,c=i.attr("data-id"),f=JSON.parse(localStorage.getItem("WprCountDownSettings"))||{};d=f.hasOwnProperty(c)?0===Object.keys(f).length||n!==f[c].interval?p.setSeconds(p.getSeconds()+n):f[c].endTime:p.setSeconds(p.getSeconds()+n),d+o<p.setSeconds(p.getSeconds())&&(d=p.setSeconds(p.getSeconds()+n)),f[c]={interval:n,endTime:d},localStorage.setItem("WprCountDownSettings",JSON.stringify(f))}r(),e.editorCheck()||(l=setInterval(r,1e3))},widgetGoogleMaps:function(e){function t(e,t){var i="<div class=\"wpr-gm-iwindow\"><h3>"+t.gm_location_title+"</h3><p>"+t.gm_location_description+"</p></div>",r=new google.maps.InfoWindow({content:i,maxWidth:t.gm_info_window_width.size});"load"===t.gm_show_info_window?r.open(p,e):e.addListener("click",function(){r.open(p,e)})}function r(e){var t;switch(e.style){case"simple":t=JSON.parse("[{\"featureType\":\"road\",\"elementType\":\"geometry\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"poi\",\"elementType\":\"geometry\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"landscape\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#fffffa\"}]},{\"featureType\":\"water\",\"stylers\":[{\"lightness\":50}]},{\"featureType\":\"road\",\"elementType\":\"labels\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"transit\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"administrative\",\"elementType\":\"geometry\",\"stylers\":[{\"lightness\":40}]}]");break;case"white-black":t=JSON.parse("[{\"featureType\":\"road\",\"elementType\":\"labels\",\"stylers\":[{\"visibility\":\"on\"}]},{\"featureType\":\"poi\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"administrative\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"road\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#000000\"},{\"weight\":1}]},{\"featureType\":\"road\",\"elementType\":\"geometry.stroke\",\"stylers\":[{\"color\":\"#000000\"},{\"weight\":0.8}]},{\"featureType\":\"landscape\",\"stylers\":[{\"color\":\"#ffffff\"}]},{\"featureType\":\"water\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"transit\",\"stylers\":[{\"visibility\":\"off\"}]},{\"elementType\":\"labels\",\"stylers\":[{\"visibility\":\"off\"}]},{\"elementType\":\"labels.text\",\"stylers\":[{\"visibility\":\"on\"}]},{\"elementType\":\"labels.text.stroke\",\"stylers\":[{\"color\":\"#ffffff\"}]},{\"elementType\":\"labels.text.fill\",\"stylers\":[{\"color\":\"#000000\"}]},{\"elementType\":\"labels.icon\",\"stylers\":[{\"visibility\":\"on\"}]}]");break;case"light-silver":t=JSON.parse("[{\"featureType\":\"water\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#e9e9e9\"},{\"lightness\":17}]},{\"featureType\":\"landscape\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#f5f5f5\"},{\"lightness\":20}]},{\"featureType\":\"road.highway\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#ffffff\"},{\"lightness\":17}]},{\"featureType\":\"road.highway\",\"elementType\":\"geometry.stroke\",\"stylers\":[{\"color\":\"#ffffff\"},{\"lightness\":29},{\"weight\":0.2}]},{\"featureType\":\"road.arterial\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#ffffff\"},{\"lightness\":18}]},{\"featureType\":\"road.local\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#ffffff\"},{\"lightness\":16}]},{\"featureType\":\"poi\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#f5f5f5\"},{\"lightness\":21}]},{\"featureType\":\"poi.park\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#dedede\"},{\"lightness\":21}]},{\"elementType\":\"labels.text.stroke\",\"stylers\":[{\"visibility\":\"on\"},{\"color\":\"#ffffff\"},{\"lightness\":16}]},{\"elementType\":\"labels.text.fill\",\"stylers\":[{\"saturation\":36},{\"color\":\"#333333\"},{\"lightness\":40}]},{\"elementType\":\"labels.icon\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"transit\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#f2f2f2\"},{\"lightness\":19}]},{\"featureType\":\"administrative\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#fefefe\"},{\"lightness\":20}]},{\"featureType\":\"administrative\",\"elementType\":\"geometry.stroke\",\"stylers\":[{\"color\":\"#fefefe\"},{\"lightness\":17},{\"weight\":1.2}]}]");break;case"light-grayscale":t=JSON.parse("[{\"featureType\":\"all\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"weight\":\"2.00\"}]},{\"featureType\":\"all\",\"elementType\":\"geometry.stroke\",\"stylers\":[{\"color\":\"#9c9c9c\"}]},{\"featureType\":\"all\",\"elementType\":\"labels.text\",\"stylers\":[{\"visibility\":\"on\"}]},{\"featureType\":\"landscape\",\"elementType\":\"all\",\"stylers\":[{\"color\":\"#f2f2f2\"}]},{\"featureType\":\"landscape\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#ffffff\"}]},{\"featureType\":\"landscape.man_made\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#ffffff\"}]},{\"featureType\":\"poi\",\"elementType\":\"all\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"road\",\"elementType\":\"all\",\"stylers\":[{\"saturation\":-100},{\"lightness\":45}]},{\"featureType\":\"road\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#eeeeee\"}]},{\"featureType\":\"road\",\"elementType\":\"labels.text.fill\",\"stylers\":[{\"color\":\"#7b7b7b\"}]},{\"featureType\":\"road\",\"elementType\":\"labels.text.stroke\",\"stylers\":[{\"color\":\"#ffffff\"}]},{\"featureType\":\"road.highway\",\"elementType\":\"all\",\"stylers\":[{\"visibility\":\"simplified\"}]},{\"featureType\":\"road.arterial\",\"elementType\":\"labels.icon\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"transit\",\"elementType\":\"all\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"water\",\"elementType\":\"all\",\"stylers\":[{\"color\":\"#46bcec\"},{\"visibility\":\"on\"}]},{\"featureType\":\"water\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#c8d7d4\"}]},{\"featureType\":\"water\",\"elementType\":\"labels.text.fill\",\"stylers\":[{\"color\":\"#070707\"}]},{\"featureType\":\"water\",\"elementType\":\"labels.text.stroke\",\"stylers\":[{\"color\":\"#ffffff\"}]}]");break;case"subtle-grayscale":t=JSON.parse("[{\"featureType\":\"administrative\",\"elementType\":\"all\",\"stylers\":[{\"saturation\":\"-100\"}]},{\"featureType\":\"administrative.province\",\"elementType\":\"all\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"landscape\",\"elementType\":\"all\",\"stylers\":[{\"saturation\":-100},{\"lightness\":65},{\"visibility\":\"on\"}]},{\"featureType\":\"poi\",\"elementType\":\"all\",\"stylers\":[{\"saturation\":-100},{\"lightness\":\"50\"},{\"visibility\":\"simplified\"}]},{\"featureType\":\"road\",\"elementType\":\"all\",\"stylers\":[{\"saturation\":\"-100\"}]},{\"featureType\":\"road.highway\",\"elementType\":\"all\",\"stylers\":[{\"visibility\":\"simplified\"}]},{\"featureType\":\"road.arterial\",\"elementType\":\"all\",\"stylers\":[{\"lightness\":\"30\"}]},{\"featureType\":\"road.local\",\"elementType\":\"all\",\"stylers\":[{\"lightness\":\"40\"}]},{\"featureType\":\"transit\",\"elementType\":\"all\",\"stylers\":[{\"saturation\":-100},{\"visibility\":\"simplified\"}]},{\"featureType\":\"water\",\"elementType\":\"geometry\",\"stylers\":[{\"hue\":\"#ffff00\"},{\"lightness\":-25},{\"saturation\":-97}]},{\"featureType\":\"water\",\"elementType\":\"labels\",\"stylers\":[{\"lightness\":-25},{\"saturation\":-100}]}]");break;case"mostly-white":t=JSON.parse("[{\"featureType\":\"administrative\",\"elementType\":\"labels.text.fill\",\"stylers\":[{\"color\":\"#6195a0\"}]},{\"featureType\":\"landscape\",\"elementType\":\"all\",\"stylers\":[{\"color\":\"#f2f2f2\"}]},{\"featureType\":\"landscape\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#ffffff\"}]},{\"featureType\":\"poi\",\"elementType\":\"all\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"poi.park\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#e6f3d6\"},{\"visibility\":\"on\"}]},{\"featureType\":\"road\",\"elementType\":\"all\",\"stylers\":[{\"saturation\":-100},{\"lightness\":45},{\"visibility\":\"simplified\"}]},{\"featureType\":\"road.highway\",\"elementType\":\"all\",\"stylers\":[{\"visibility\":\"simplified\"}]},{\"featureType\":\"road.highway\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#f4d2c5\"},{\"visibility\":\"simplified\"}]},{\"featureType\":\"road.highway\",\"elementType\":\"labels.text\",\"stylers\":[{\"color\":\"#4e4e4e\"}]},{\"featureType\":\"road.arterial\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#f4f4f4\"}]},{\"featureType\":\"road.arterial\",\"elementType\":\"labels.text.fill\",\"stylers\":[{\"color\":\"#787878\"}]},{\"featureType\":\"road.arterial\",\"elementType\":\"labels.icon\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"transit\",\"elementType\":\"all\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"water\",\"elementType\":\"all\",\"stylers\":[{\"color\":\"#eaf6f8\"},{\"visibility\":\"on\"}]},{\"featureType\":\"water\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#eaf6f8\"}]}]");break;case"mostly-green":t=JSON.parse("[{\"featureType\":\"landscape.man_made\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#f7f1df\"}]},{\"featureType\":\"landscape.natural\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#d0e3b4\"}]},{\"featureType\":\"landscape.natural.terrain\",\"elementType\":\"geometry\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"poi\",\"elementType\":\"labels\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"poi.business\",\"elementType\":\"all\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"poi.medical\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#fbd3da\"}]},{\"featureType\":\"poi.park\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#bde6ab\"}]},{\"featureType\":\"road\",\"elementType\":\"geometry.stroke\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"road\",\"elementType\":\"labels\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"road.highway\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#ffe15f\"}]},{\"featureType\":\"road.highway\",\"elementType\":\"geometry.stroke\",\"stylers\":[{\"color\":\"#efd151\"}]},{\"featureType\":\"road.arterial\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#ffffff\"}]},{\"featureType\":\"road.local\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"black\"}]},{\"featureType\":\"transit.station.airport\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#cfb2db\"}]},{\"featureType\":\"water\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#a2daf2\"}]}]");break;case"neutral-blue":t=JSON.parse("[{\"featureType\":\"water\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#193341\"}]},{\"featureType\":\"landscape\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#2c5a71\"}]},{\"featureType\":\"road\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#29768a\"},{\"lightness\":-37}]},{\"featureType\":\"poi\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#406d80\"}]},{\"featureType\":\"transit\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#406d80\"}]},{\"elementType\":\"labels.text.stroke\",\"stylers\":[{\"visibility\":\"on\"},{\"color\":\"#3e606f\"},{\"weight\":2},{\"gamma\":0.84}]},{\"elementType\":\"labels.text.fill\",\"stylers\":[{\"color\":\"#ffffff\"}]},{\"featureType\":\"administrative\",\"elementType\":\"geometry\",\"stylers\":[{\"weight\":0.6},{\"color\":\"#1a3541\"}]},{\"elementType\":\"labels.icon\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"poi.park\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#2c5a71\"}]}]");break;case"blue-water":t=JSON.parse("[{\"featureType\":\"administrative\",\"elementType\":\"labels.text.fill\",\"stylers\":[{\"color\":\"#444444\"}]},{\"featureType\":\"landscape\",\"elementType\":\"all\",\"stylers\":[{\"color\":\"#f2f2f2\"}]},{\"featureType\":\"poi\",\"elementType\":\"all\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"road\",\"elementType\":\"all\",\"stylers\":[{\"saturation\":-100},{\"lightness\":45}]},{\"featureType\":\"road.highway\",\"elementType\":\"all\",\"stylers\":[{\"visibility\":\"simplified\"}]},{\"featureType\":\"road.arterial\",\"elementType\":\"labels.icon\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"transit\",\"elementType\":\"all\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"water\",\"elementType\":\"all\",\"stylers\":[{\"color\":\"#46bcec\"},{\"visibility\":\"on\"}]}]");break;case"blue-essense":t=JSON.parse("[{\"featureType\":\"landscape.natural\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"visibility\":\"on\"},{\"color\":\"#e0efef\"}]},{\"featureType\":\"poi\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"visibility\":\"on\"},{\"hue\":\"#1900ff\"},{\"color\":\"#c0e8e8\"}]},{\"featureType\":\"road\",\"elementType\":\"geometry\",\"stylers\":[{\"lightness\":100},{\"visibility\":\"simplified\"}]},{\"featureType\":\"road\",\"elementType\":\"labels\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"transit.line\",\"elementType\":\"geometry\",\"stylers\":[{\"visibility\":\"on\"},{\"lightness\":700}]},{\"featureType\":\"water\",\"elementType\":\"all\",\"stylers\":[{\"color\":\"#7dcdcd\"}]}]");break;case"golden-brown":t=JSON.parse("[{\"featureType\":\"all\",\"elementType\":\"all\",\"stylers\":[{\"color\":\"#ff7000\"},{\"lightness\":\"69\"},{\"saturation\":\"100\"},{\"weight\":\"1.17\"},{\"gamma\":\"2.04\"}]},{\"featureType\":\"all\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#cb8536\"}]},{\"featureType\":\"all\",\"elementType\":\"labels\",\"stylers\":[{\"color\":\"#ffb471\"},{\"lightness\":\"66\"},{\"saturation\":\"100\"}]},{\"featureType\":\"all\",\"elementType\":\"labels.text.fill\",\"stylers\":[{\"gamma\":0.01},{\"lightness\":20}]},{\"featureType\":\"all\",\"elementType\":\"labels.text.stroke\",\"stylers\":[{\"saturation\":-31},{\"lightness\":-33},{\"weight\":2},{\"gamma\":0.8}]},{\"featureType\":\"all\",\"elementType\":\"labels.icon\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"landscape\",\"elementType\":\"all\",\"stylers\":[{\"lightness\":\"-8\"},{\"gamma\":\"0.98\"},{\"weight\":\"2.45\"},{\"saturation\":\"26\"}]},{\"featureType\":\"landscape\",\"elementType\":\"geometry\",\"stylers\":[{\"lightness\":30},{\"saturation\":30}]},{\"featureType\":\"poi\",\"elementType\":\"geometry\",\"stylers\":[{\"saturation\":20}]},{\"featureType\":\"poi.park\",\"elementType\":\"geometry\",\"stylers\":[{\"lightness\":20},{\"saturation\":-20}]},{\"featureType\":\"road\",\"elementType\":\"geometry\",\"stylers\":[{\"lightness\":10},{\"saturation\":-30}]},{\"featureType\":\"road\",\"elementType\":\"geometry.stroke\",\"stylers\":[{\"saturation\":25},{\"lightness\":25}]},{\"featureType\":\"water\",\"elementType\":\"all\",\"stylers\":[{\"lightness\":-20},{\"color\":\"#ecc080\"}]}]");break;case"midnight-commander":t=JSON.parse("[{\"featureType\":\"all\",\"elementType\":\"labels.text.fill\",\"stylers\":[{\"color\":\"#ffffff\"}]},{\"featureType\":\"all\",\"elementType\":\"labels.text.stroke\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":13}]},{\"featureType\":\"administrative\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#000000\"}]},{\"featureType\":\"administrative\",\"elementType\":\"geometry.stroke\",\"stylers\":[{\"color\":\"#144b53\"},{\"lightness\":14},{\"weight\":1.4}]},{\"featureType\":\"landscape\",\"elementType\":\"all\",\"stylers\":[{\"color\":\"#08304b\"}]},{\"featureType\":\"poi\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#0c4152\"},{\"lightness\":5}]},{\"featureType\":\"road.highway\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#000000\"}]},{\"featureType\":\"road.highway\",\"elementType\":\"geometry.stroke\",\"stylers\":[{\"color\":\"#0b434f\"},{\"lightness\":25}]},{\"featureType\":\"road.arterial\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#000000\"}]},{\"featureType\":\"road.arterial\",\"elementType\":\"geometry.stroke\",\"stylers\":[{\"color\":\"#0b3d51\"},{\"lightness\":16}]},{\"featureType\":\"road.local\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#000000\"}]},{\"featureType\":\"transit\",\"elementType\":\"all\",\"stylers\":[{\"color\":\"#146474\"}]},{\"featureType\":\"water\",\"elementType\":\"all\",\"stylers\":[{\"color\":\"#021019\"}]}]");break;case"shades-of-grey":t=JSON.parse("[{\"featureType\":\"all\",\"elementType\":\"labels.text.fill\",\"stylers\":[{\"saturation\":36},{\"color\":\"#000000\"},{\"lightness\":40}]},{\"featureType\":\"all\",\"elementType\":\"labels.text.stroke\",\"stylers\":[{\"visibility\":\"on\"},{\"color\":\"#000000\"},{\"lightness\":16}]},{\"featureType\":\"all\",\"elementType\":\"labels.icon\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"administrative\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":20}]},{\"featureType\":\"administrative\",\"elementType\":\"geometry.stroke\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":17},{\"weight\":1.2}]},{\"featureType\":\"landscape\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":20}]},{\"featureType\":\"poi\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":21}]},{\"featureType\":\"road.highway\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":17}]},{\"featureType\":\"road.highway\",\"elementType\":\"geometry.stroke\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":29},{\"weight\":0.2}]},{\"featureType\":\"road.arterial\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":18}]},{\"featureType\":\"road.local\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":16}]},{\"featureType\":\"transit\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":19}]},{\"featureType\":\"water\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":17}]}]");break;case"yellow-black":t=JSON.parse("[{\"featureType\":\"all\",\"elementType\":\"labels\",\"stylers\":[{\"visibility\":\"on\"}]},{\"featureType\":\"all\",\"elementType\":\"labels.text.fill\",\"stylers\":[{\"saturation\":36},{\"color\":\"#000000\"},{\"lightness\":40}]},{\"featureType\":\"all\",\"elementType\":\"labels.text.stroke\",\"stylers\":[{\"visibility\":\"on\"},{\"color\":\"#000000\"},{\"lightness\":16}]},{\"featureType\":\"all\",\"elementType\":\"labels.icon\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"administrative\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":20}]},{\"featureType\":\"administrative\",\"elementType\":\"geometry.stroke\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":17},{\"weight\":1.2}]},{\"featureType\":\"administrative.country\",\"elementType\":\"labels.text.fill\",\"stylers\":[{\"color\":\"#e5c163\"}]},{\"featureType\":\"administrative.locality\",\"elementType\":\"labels.text.fill\",\"stylers\":[{\"color\":\"#c4c4c4\"}]},{\"featureType\":\"administrative.neighborhood\",\"elementType\":\"labels.text.fill\",\"stylers\":[{\"color\":\"#e5c163\"}]},{\"featureType\":\"landscape\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":20}]},{\"featureType\":\"poi\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":21},{\"visibility\":\"on\"}]},{\"featureType\":\"poi.business\",\"elementType\":\"geometry\",\"stylers\":[{\"visibility\":\"on\"}]},{\"featureType\":\"road.highway\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#e5c163\"},{\"lightness\":\"0\"}]},{\"featureType\":\"road.highway\",\"elementType\":\"geometry.stroke\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"road.highway\",\"elementType\":\"labels.text.fill\",\"stylers\":[{\"color\":\"#ffffff\"}]},{\"featureType\":\"road.highway\",\"elementType\":\"labels.text.stroke\",\"stylers\":[{\"color\":\"#e5c163\"}]},{\"featureType\":\"road.arterial\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":18}]},{\"featureType\":\"road.arterial\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#575757\"}]},{\"featureType\":\"road.arterial\",\"elementType\":\"labels.text.fill\",\"stylers\":[{\"color\":\"#ffffff\"}]},{\"featureType\":\"road.arterial\",\"elementType\":\"labels.text.stroke\",\"stylers\":[{\"color\":\"#2c2c2c\"}]},{\"featureType\":\"road.local\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":16}]},{\"featureType\":\"road.local\",\"elementType\":\"labels.text.fill\",\"stylers\":[{\"color\":\"#999999\"}]},{\"featureType\":\"transit\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":19}]},{\"featureType\":\"water\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":17}]}]");break;case"custom":t=JSON.parse(e.custom_style);break;default:t="";}return t}for(var a=e.find(".wpr-google-map"),s=a.data("settings"),l=a.data("controls"),n=a.data("locations"),o=[],d=new google.maps.LatLngBounds,p=new google.maps.Map(a[0],{mapTypeId:s.type,styles:r(s),zoom:s.zoom_depth,gestureHandling:s.zoom_on_scroll,mapTypeControl:l.type,fullscreenControl:l.fullscreen,zoomControl:l.zoom,streetViewControl:l.streetview}),c=0;c<n.length;c++){var f=n[c],m="",g=f.gm_marker_icon_size_width.size,y=f.gm_marker_icon_size_height.size;if(""!=f.gm_latitude&&""!=f.gm_longtitude){"yes"===f.gm_custom_marker&&(m={url:f.gm_marker_icon.url,scaledSize:new google.maps.Size(g,y)});var w=new google.maps.Marker({map:p,position:new google.maps.LatLng(parseFloat(f.gm_latitude),parseFloat(f.gm_longtitude)),animation:google.maps.Animation[f.gm_marker_animation],icon:m});"none"!==f.gm_show_info_window&&t(w,f),o.push(w),d.extend(w.position)}}if(1<n.length?p.fitBounds(d):p.setCenter(d.getCenter()),"yes"===s.cluster_markers)new MarkerClusterer(p,o,{imagePath:s.clusters_url})},widgetBeforeAfter:function(e){function i(){var e=r.find(".wpr-ba-label-1 div"),t=r.find(".wpr-ba-label-2 div");if(e.length||t.length)if(r.hasClass("wpr-ba-horizontal")){var i=e.position().left+e.outerWidth(),a=t.position().left+t.outerWidth();i+15>=parseInt(l.css("left"),10)?e.stop().css("opacity",0):e.stop().css("opacity",1),r.outerWidth()-(a+15)<=parseInt(l.css("left"),10)?t.stop().css("opacity",0):t.stop().css("opacity",1)}else{var i=e.position().top+e.outerHeight(),a=t.position().top+t.outerHeight();i+15>=parseInt(l.css("top"),10)?e.stop().css("opacity",0):e.stop().css("opacity",1),r.outerHeight()-(a+15)<=parseInt(l.css("top"),10)?t.stop().css("opacity",0):t.stop().css("opacity",1)}}var r=e.find(".wpr-ba-image-container"),a=r.find(".wpr-ba-image-1"),s=r.find(".wpr-ba-image-2"),l=r.find(".wpr-ba-divider"),n=r.attr("data-position");r.hasClass("wpr-ba-horizontal")?(l.css("left",n+"%"),s.css("left",n+"%"),s.find("img").css("right",n+"%"),l.on("move",function(t){var e=t.pageX-r.offset().left;l.css({left:"auto",right:"auto"}),s.css({left:"auto",right:"auto"}),0<e&&e<r.outerWidth()?(l.css("left",e),s.css("left",e),s.find("img").css("right",e)):0>=e?(l.css("left",0),s.css("left",0),s.find("img").css("right",0)):e>=r.outerWidth()&&(l.css("right",-l.outerWidth()/2),s.css("right",0),s.find("img").css("right","100%")),i()})):(l.css("top",n+"%"),s.css("top",n+"%"),s.find("img").css("bottom",n+"%"),l.on("move",function(t){var e=t.pageY-r.offset().top;l.css({top:"auto",bottom:"auto"}),s.css({top:"auto",bottom:"auto"}),0<e&&e<r.outerHeight()?(l.css("top",e),s.css("top",e),s.find("img").css("bottom",e)):0>=e?(l.css("top",0),s.css("top",0),s.find("img").css("bottom",0)):e>=r.outerHeight()&&(l.css("bottom",-l.outerHeight()/2),s.css("bottom",0),s.find("img").css("bottom","100%")),i()})),"mouse"===r.attr("data-trigger")&&r.on("mousemove",function(e){if(r.hasClass("wpr-ba-horizontal")){var a=e.pageX-t(this).offset().left;l.css("left",a),s.css("left",a),s.find("img").css("right",a)}else{var a=e.pageY-t(this).offset().top;l.css("top",a),s.css("top",a),s.find("img").css("bottom",a)}i()}),i()},widgetMailchimp:function(e){var i=e.find("form");i.on("submit",function(r){r.preventDefault();var a=t(this).find("button").text();t(this).find("button").text(t(this).find("button").data("loading")),t.ajax({url:WprConfig.ajaxurl,type:"POST",data:{action:"mailchimp_subscribe",fields:t(this).serialize(),apiKey:i.data("api-key"),listId:i.data("list-id")},success:function(t){i.find("button").text(a),"subscribed"===t.status?e.find(".wpr-mailchimp-success-message").show():e.find(".wpr-mailchimp-error-message").show(),e.find(".wpr-mailchimp-message").fadeIn()}})})},widgetAdvancedSlider:function(e){function i(){var e,t,i=l.find(".wpr-slider-item").outerWidth(),r=l.find(".wpr-slider-item").outerHeight(),a=16/9,s=0,n=0;i/r>a?(t=i,e=t/a,s="-"+(e-r)/2+"px"):(e=r,t=e*a,n="-"+(t-i)/2+"px"),l.find("iframe").css({width:t+"px",height:e+"px","max-width":"none",position:"absolute",left:n+"",top:s+"",display:"block","text-align":"inherit","line-height":"0px","border-width":"0px",margin:"0px",padding:"0px"})}function r(){l.find(".slick-active").each(function(){var e=t(this).attr("data-video-src"),r=t(this).attr("data-video-autoplay");1!==t(this).find(".wpr-slider-video").length&&"yes"===r&&(1==d?t(this).find(".wpr-cv-inner").prepend("<div class=\"wpr-slider-video\"><iframe src=\""+e+"\" width=\"100%\" height=\"100%\" frameborder=\"0\" allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen></iframe></div>"):t(this).find(".wpr-cv-container").prepend("<div class=\"wpr-slider-video\"><iframe src=\""+e+"\" width=\"100%\" height=\"100%\" frameborder=\"0\" allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen></iframe></div>"),i())})}function a(){1==d&&l.find(".wpr-slider-item").not(".slick-active").find(".wpr-slider-animation").removeClass("wpr-animation-enter")}function s(){l.find(".slick-active").find(".wpr-slider-content").fadeIn(0),1==d&&l.find(".slick-active").find(".wpr-slider-animation").addClass("wpr-animation-enter")}var l=e.find(".wpr-advanced-slider"),n=l.data("slick"),o=e.attr("class"),d=o.match(/wpr-adv-slider-columns-\d/)?o.match(/wpr-adv-slider-columns-\d/).join().slice(-1):2,p=o.match(/columns--widescreen\d/)?o.match(/columns--widescreen\d/).join().slice(-1):d,c=o.match(/columns--laptop\d/)?o.match(/columns--laptop\d/).join().slice(-1):d,f=o.match(/columns--tablet_extra\d/)?o.match(/columns--tablet_extra\d/).join().slice(-1):m,m=o.match(/columns--tablet\d/)?o.match(/columns--tablet\d/).join().slice(-1):2,g=o.match(/columns--mobile_extra\d/)?o.match(/columns--mobile_extra\d/).join().slice(-1):m,y=o.match(/columns--mobile\d/)?o.match(/columns--mobile\d/).join().slice(-1):1,w=+o.match(/wpr-adv-slides-to-scroll-\d/).join().slice(-1),h=l.attr("data-slide-effect");if(l.slick({appendArrows:e.find(".wpr-slider-controls"),appendDots:e.find(".wpr-slider-dots"),customPaging:function(e,t){e.slideCount;return"<span class=\"wpr-slider-dot\"></span>"},slidesToShow:d,responsive:[{breakpoint:1e4,settings:{slidesToShow:p,slidesToScroll:w>p?1:w,fade:1==p&&"fade"===h}},{breakpoint:2399,settings:{slidesToShow:d,slidesToScroll:w>d?1:w,fade:1==d&&"fade"===h}},{breakpoint:1221,settings:{slidesToShow:c,slidesToScroll:w>c?1:w,fade:1==c&&"fade"===h}},{breakpoint:1200,settings:{slidesToShow:f,slidesToScroll:w>f?1:w,fade:1==f&&"fade"===h}},{breakpoint:1024,settings:{slidesToShow:m,slidesToScroll:w>m?1:w,fade:1==m&&"fade"===h}},{breakpoint:880,settings:{slidesToShow:g,slidesToScroll:w>g?1:w,fade:1==g&&"fade"===h}},{breakpoint:768,settings:{slidesToShow:y,slidesToScroll:w>y?1:w,fade:1==y&&"fade"===h}}]}),t(window).on("load resize",function(){i()}),r(),s(),l.find(".wpr-slider-video-btn").on("click",function(){var e=t(this).closest(".slick-active"),r=e.attr("data-video-src");1!==e.find(".wpr-slider-video").length&&(e.find(".wpr-cv-container").prepend("<div class=\"wpr-slider-video\"><iframe src=\""+r+"\" width=\"100%\" height=\"100%\" frameborder=\"0\" allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen></iframe></div>"),i(),e.find(".wpr-slider-content").fadeOut(300))}),l.on({beforeChange:function(){l.find(".wpr-slider-item").not(".slick-active").find(".wpr-slider-video").remove(),l.find(".wpr-animation-enter").find(".wpr-slider-content").fadeOut(300),a()},afterChange:function(){s(),r()}}),e.find(".slick-dots").length&&e.hasClass("wpr-slider-dots-horizontal")){var u=e.find(".slick-dots li").outerWidth()*e.find(".slick-dots li").length-parseInt(e.find(".slick-dots li span").css("margin-right"),10);e.find(".slick-dots").length&&e.find(".slick-dots").css("width",u),t(window).on("resize",function(){setTimeout(function(){var t=e.find(".slick-dots li").outerWidth()*e.find(".slick-dots li").length-parseInt(e.find(".slick-dots li span").css("margin-right"),10);e.find(".slick-dots").css("width",t)},300)})}},widgetTestimonialCarousel:function(e){var i=e.find(".wpr-testimonial-carousel"),r=e.attr("class"),a=r.match(/wpr-testimonial-slider-columns-\d/)?r.match(/wpr-testimonial-slider-columns-\d/).join().slice(-1):2,s=r.match(/columns--widescreen\d/)?r.match(/columns--widescreen\d/).join().slice(-1):a,l=r.match(/columns--laptop\d/)?r.match(/columns--laptop\d/).join().slice(-1):a,n=r.match(/columns--tablet_extra\d/)?r.match(/columns--tablet_extra\d/).join().slice(-1):o,o=r.match(/columns--tablet\d/)?r.match(/columns--tablet\d/).join().slice(-1):2,d=r.match(/columns--mobile_extra\d/)?r.match(/columns--mobile_extra\d/).join().slice(-1):o,p=r.match(/columns--mobile\d/)?r.match(/columns--mobile\d/).join().slice(-1):1,c=+r.match(/wpr-adv-slides-to-scroll-\d/).join().slice(-1),f=i.attr("data-slide-effect");if(i.slick({appendArrows:e.find(".wpr-testimonial-controls"),appendDots:e.find(".wpr-testimonial-dots"),customPaging:function(e,t){e.slideCount;return"<span class=\"wpr-testimonial-dot\"></span>"},slidesToShow:a,responsive:[{breakpoint:1e4,settings:{slidesToShow:s,slidesToScroll:c>s?1:c,fade:1==s&&"fade"===f}},{breakpoint:2399,settings:{slidesToShow:a,slidesToScroll:c>a?1:c,fade:1==a&&"fade"===f}},{breakpoint:1221,settings:{slidesToShow:l,slidesToScroll:c>l?1:c,fade:1==l&&"fade"===f}},{breakpoint:1200,settings:{slidesToShow:n,slidesToScroll:c>n?1:c,fade:1==n&&"fade"===f}},{breakpoint:1024,settings:{slidesToShow:o,slidesToScroll:c>o?1:c,fade:1==o&&"fade"===f}},{breakpoint:880,settings:{slidesToShow:d,slidesToScroll:c>d?1:c,fade:1==d&&"fade"===f}},{breakpoint:768,settings:{slidesToShow:p,slidesToScroll:c>p?1:c,fade:1==p&&"fade"===f}}]}),e.hasClass("wpr-testimonial-nav-fade")&&(e.on("mouseover",function(){e.closest("section").find(".wpr-testimonial-arrow").css({opacity:1})}),e.closest("section").on("mouseout",function(){e.find(".wpr-testimonial-arrow").css({opacity:0})})),e.find(".slick-dots").length){var m=e.find(".slick-dots li").outerWidth()*e.find(".slick-dots li").length-parseInt(e.find(".slick-dots li span").css("margin-right"),10);e.find(".slick-dots").css("width",m)}t(window).on("resize",function(){setTimeout(function(){if(e.find(".slick-dots").length){var t=e.find(".slick-dots li").outerWidth()*e.find(".slick-dots li").length-parseInt(e.find(".slick-dots li span").css("margin-right"),10);e.find(".slick-dots").css("width",t)}},300)})},widgetSearch:function(e){e.find(".wpr-search-form-input").on({focus:function(){e.addClass("wpr-search-form-input-focus")},blur:function(){e.removeClass("wpr-search-form-input-focus")}})},widgetAdvancedText:function(e){function i(){var t=e.find(".wpr-clipped-text"),i=t.data("clipped-options"),r=elementorFrontend.getCurrentDeviceMode();if(i){var a=i.longShadowSize,s=i.longShadowSizeTablet,l=i.longShadowSizeMobile;"desktop"===r&&(a=i.longShadowSize),"tablet"===r&&s&&(a=s),"mobile"===r&&l&&(a=l),t.find(".wpr-clipped-text-long-shadow").attr("style","text-shadow:"+f(i.longShadowColor,a,i.longShadowDirection))}}function r(){a(g.find("b")),s(m)}function a(e){e.each(function(){var e=t(this),r=e.text().split(""),a=e.hasClass("wpr-anim-text-visible");for(var s in r){var i=r[s].replace(/ /g," ");r[s]=a?"<i class=\"wpr-anim-text-in\">"+i+"</i>":"<i>"+i+"</i>"}var l=r.join("");e.html(l).css("opacity",1)})}function s(e){e.each(function(){var e=t(this),i=e.find(".wpr-anim-text-inner");if(e.hasClass("wpr-anim-text-type-clip")){var r=i.outerWidth();i.css("width",r)}setTimeout(function(){l(e.find(".wpr-anim-text-visible").eq(0))},T),e.hasClass("wpr-anim-text-type-rotate-1")&&i.find("b").each(function(){t(this).outerWidth()>i.outerWidth()&&i.css("width",t(this).outerWidth())})})}function l(e){var t=p(e);if(!("yes"!==h&&(b++,b===u)))if(e.parents(".wpr-anim-text").hasClass("wpr-anim-text-type-typing")){var i=e.parent(".wpr-anim-text-inner");i.addClass("wpr-anim-text-selected").removeClass("waiting"),setTimeout(function(){i.removeClass("wpr-anim-text-selected"),e.removeClass("wpr-anim-text-visible").addClass("wpr-anim-text-hidden").children("i").removeClass("wpr-anim-text-in").addClass("wpr-anim-text-out")},v),setTimeout(function(){n(t,y)},k)}else if(e.parents(".wpr-anim-text").hasClass("wpr-anim-text-letters")){var r=!!(e.children("i").length>=t.children("i").length);o(e.find("i").eq(0),e,r,y),d(t.find("i").eq(0),t,r,y)}else e.parents(".wpr-anim-text").hasClass("wpr-anim-text-type-clip")?e.parents(".wpr-anim-text-inner").animate({width:"2px"},y,function(){c(e,t),n(t)}):(c(e,t),setTimeout(function(){l(t)},T))}function n(e,t){e.parents(".wpr-anim-text").hasClass("wpr-anim-text-type-typing")?(d(e.find("i").eq(0),e,!1,t),e.addClass("wpr-anim-text-visible").removeClass("wpr-anim-text-hidden")):e.parents(".wpr-anim-text").hasClass("wpr-anim-text-type-clip")&&e.parents(".wpr-anim-text-inner").animate({width:e.outerWidth()},y,function(){setTimeout(function(){l(e)},T)})}function o(e,t,i,r){if(e.removeClass("wpr-anim-text-in").addClass("wpr-anim-text-out"),e.is(":last-child")?i&&setTimeout(function(){l(p(t))},T):setTimeout(function(){o(e.next(),t,i,r)},r),e.is(":last-child")){var a=p(t);c(t,a)}}function d(e,t,i,r){e.addClass("wpr-anim-text-in").removeClass("wpr-anim-text-out"),e.is(":last-child")?(t.parents(".wpr-anim-text").hasClass("wpr-anim-text-type-typing")&&setTimeout(function(){t.parents(".wpr-anim-text-inner").addClass("waiting")},200),!i&&setTimeout(function(){l(t)},T)):setTimeout(function(){d(e.next(),t,i,r)},r)}function p(e){return e.is(":last-child")?e.parent().children().eq(0):e.next()}function c(e,t){e.removeClass("wpr-anim-text-visible").addClass("wpr-anim-text-hidden"),t.removeClass("wpr-anim-text-hidden").addClass("wpr-anim-text-visible")}function f(e,t,r){for(var a="",s=0;s<t;s++)a+="top"===r?"0 -"+s+"px 0 "+e+",":"right"===r?s+"px 0 0 "+e+",":"bottom"===r?"0 "+s+"px 0 "+e+",":"left"===r?"-"+s+"px 0 0 "+e+",":"top-left"===r?"-"+s+"px -"+s+"px 0 "+e+",":"top-right"===r?s+"px -"+s+"px 0 "+e+",":"bottom-left"===r?"-"+s+"px "+s+"px 0 "+e+",":"bottom-right"===r?s+"px "+s+"px 0 "+e+",":s+"px "+s+"px 0 "+e+",";return a=a.slice(0,-1),a}if(e.hasClass("wpr-advanced-text-style-animated")){var m=e.find(".wpr-anim-text"),g=e.find(".wpr-anim-text-letters"),y=m.attr("data-anim-duration"),w=y.split(","),h=m.attr("data-anim-loop"),u=m.find("b").length,b=0;m.find("b").first().addClass("wpr-anim-text-visible");var y=parseInt(w[0],10),T=parseInt(w[1],10),v=500,k=1300;r()}i(),t(window).on("resize",function(){i()})},widgetProgressBar:function(e){function i(e){if(e.length){var i=e.offset().top,r=i+e.outerHeight(),a=t(window).scrollTop(),s=a+t(window).height();return i>t(window).height()&&(i+=50),r>a&&i<s}}function r(){if(i(p)&&p.css({height:y+"%"}),i(d)&&d.css({width:y+"%"}),i(s)){var e=f.circleOffset;o.css({"stroke-dashoffset":e})}(i(p)||i(d)||i(s))&&setTimeout(function(){m.numerator(b)},h)}var a=e.find(".wpr-progress-bar"),s=e.find(".wpr-prbar-circle"),l=s.find(".wpr-prbar-circle-svg"),n=l.find(".wpr-prbar-circle-line"),o=e.find(".wpr-prbar-circle-prline"),d=a.find(".wpr-prbar-hr-line-inner"),p=a.find(".wpr-prbar-vr-line-inner"),c=a.data("options"),f=s.data("circle-options"),m=a.find(".wpr-prbar-counter-value"),g=c.counterValue,y=c.counterValuePersent,w=c.animDuration,h=c.animDelay,u=elementorFrontend.getCurrentDeviceMode(),b={toValue:g,duration:w};"yes"===c.counterSeparator&&(b.delimiter=",");r(),t(window).on("scroll",function(){r()})},widgetImageHotspots:function(e){var i=e.find(".wpr-image-hotspots"),r=i.data("options"),a=i.find(".wpr-hotspot-item"),s=r.tooltipTrigger;"click"===s?(a.on("click",function(){t(this).hasClass("wpr-tooltip-active")?t(this).removeClass("wpr-tooltip-active"):(a.removeClass("wpr-tooltip-active"),t(this).addClass("wpr-tooltip-active")),event.stopPropagation()}),t(window).on("click",function(){a.removeClass("wpr-tooltip-active")})):"hover"===s?a.hover(function(){t(this).toggleClass("wpr-tooltip-active")}):a.addClass("wpr-tooltip-active")},widgetFlipBox:function(e){var i=e.find(".wpr-flip-box"),r=i.data("trigger");"box"===r?(i.find(".wpr-flip-box-front").on("click",function(){t(this).closest(".wpr-flip-box").addClass("wpr-flip-box-active")}),t(window).on("click",function(){0===t(event.target).closest(".wpr-flip-box").length&&i.removeClass("wpr-flip-box-active")})):"btn"==r?(i.find(".wpr-flip-box-btn").on("click",function(){t(this).closest(".wpr-flip-box").addClass("wpr-flip-box-active")}),t(window).on("click",function(){0===t(event.target).closest(".wpr-flip-box").length&&i.removeClass("wpr-flip-box-active")})):"hover"==r&&i.hover(function(){t(this).toggleClass("wpr-flip-box-active")})},widgetContentTicker:function(e){var t=e.find(".wpr-ticker-slider"),i=e.find(".wpr-ticker-marquee"),r=i.data("options"),a=e.attr("class"),s=a.match(/wpr-ticker-slider-columns-\d/)?a.match(/wpr-ticker-slider-columns-\d/).join().slice(-1):2,l=a.match(/columns--widescreen\d/)?a.match(/columns--widescreen\d/).join().slice(-1):s,n=a.match(/columns--laptop\d/)?a.match(/columns--laptop\d/).join().slice(-1):s,o=a.match(/columns--tablet_extra\d/)?a.match(/columns--tablet_extra\d/).join().slice(-1):d,d=a.match(/columns--tablet\d/)?a.match(/columns--tablet\d/).join().slice(-1):2,p=a.match(/columns--mobile_extra\d/)?a.match(/columns--mobile_extra\d/).join().slice(-1):d,c=a.match(/columns--mobile\d/)?a.match(/columns--mobile\d/).join().slice(-1):1,f=t.attr("data-slide-effect"),m="hr-slide"===f&&a.match(/wpr-ticker-slides-to-scroll-\d/)?+a.match(/wpr-ticker-slides-to-scroll-\d/).join().slice(-1):1;t.slick({appendArrows:e.find(".wpr-ticker-slider-controls"),slidesToShow:s,responsive:[{breakpoint:1e4,settings:{slidesToShow:"typing"===f||"fade"===f?1:l,slidesToScroll:m>l?1:m,fade:!("typing"!==f&&"fade"!==f)}},{breakpoint:2399,settings:{slidesToShow:"typing"===f||"fade"===f?1:s,slidesToScroll:m>s?1:m,fade:!("typing"!==f&&"fade"!==f)}},{breakpoint:1221,settings:{slidesToShow:"typing"===f||"fade"===f?1:n,slidesToScroll:m>n?1:m,fade:!("typing"!==f&&"fade"!==f)}},{breakpoint:1200,settings:{slidesToShow:"typing"===f||"fade"===f?1:o,slidesToScroll:m>o?1:m,fade:!("typing"!==f&&"fade"!==f)}},{breakpoint:1024,settings:{slidesToShow:"typing"===f||"fade"===f?1:d,slidesToScroll:m>d?1:m,fade:!("typing"!==f&&"fade"!==f)}},{breakpoint:880,settings:{slidesToShow:"typing"===f||"fade"===f?1:p,slidesToScroll:m>p?1:m,fade:!("typing"!==f&&"fade"!==f)}},{breakpoint:768,settings:{slidesToShow:"typing"===f||"fade"===f?1:c,slidesToScroll:m>c?1:m,fade:!("typing"!==f&&"fade"!==f)}}]}),i.marquee(r)},widgetTabs:function(e){function i(e){var t=l.eq(e),i=o.eq(e),r="auto";n.css({height:n.outerHeight(!0)}),l.removeClass("wpr-tab-active"),t.addClass("wpr-tab-active"),o.removeClass("wpr-tab-content-active wpr-animation-enter"),r=i.outerHeight(!0),r+=parseInt(n.css("border-top-width"))+parseInt(n.css("border-bottom-width")),i.addClass("wpr-tab-content-active wpr-animation-enter"),n.css({height:r}),setTimeout(function(){n.css({height:"auto"})},500)}function r(){l.on("click",function(){var e=t(this).data("tab")-1;clearInterval(f),i(e)})}function a(){l.hover(function(){var e=t(this).data("tab")-1;clearInterval(f),i(e)})}var s=t(".wpr-tabs",e).first(),l=t(".wpr-tabs-wrap",s).first(),n=t(".wpr-tabs-content-wrap",s).first(),l=t("> .wpr-tab",l),o=t("> .wpr-tab-content",n),d=s.data("options"),p=d.activeTab-1;if(l.eq(p).addClass("wpr-tab-active"),o.eq(p).addClass("wpr-tab-content-active wpr-animation-enter"),d.autoplay)var c=d.activeTab-1,f=setInterval(function(){c<l.length-1?c++:c=0,i(c)},d.autoplaySpeed);"hover"===d.trigger?a():r()},widgetContentToogle:function(e){function i(t){if(!e.hasClass("wpr-switcher-label-style-outer")){var i=100/d.length;o.css({width:i+"%",left:t*i+"%"})}}function r(t){var r=d.eq(t),a=p.eq(t),l="auto";i(t),e.hasClass("wpr-switcher-label-style-outer")||(d.removeClass("wpr-switcher-active"),r.addClass("wpr-switcher-active"),e.hasClass("wpr-switcher-style-dual")&&s.attr("data-active-switcher",t+1)),n.css({height:n.outerHeight(!0)}),p.removeClass("wpr-switcher-content-active wpr-animation-enter"),l=a.outerHeight(!0),l+=parseInt(n.css("border-top-width"))+parseInt(n.css("border-bottom-width")),a.addClass("wpr-switcher-content-active wpr-animation-enter"),n.css({height:l}),setTimeout(function(){n.css({height:"auto"})},500)}var a=t(".wpr-content-toggle",e).first(),s=t(".wpr-switcher-container",a).first(),l=t(".wpr-switcher-wrap",a).first(),n=t(".wpr-switcher-content-wrap",a).first(),o=t("> .wpr-switcher-bg",l),d=t("> .wpr-switcher",l),p=t("> .wpr-switcher-content",n),c=parseInt(s.data("active-switcher"))-1;d.eq(c).addClass("wpr-switcher-active"),p.eq(c).addClass("wpr-switcher-content-active wpr-animation-enter"),i(c),function(){e.hasClass("wpr-switcher-label-style-outer")?l.on("click",function(){var e=l.find(".wpr-switcher-active");1===parseInt(e.data("switcher"),10)?(l.children(".wpr-switcher").eq(0).removeClass("wpr-switcher-active"),l.children(".wpr-switcher").eq(1).addClass("wpr-switcher-active"),l.closest(".wpr-switcher-container").attr("data-active-switcher",2),r(1)):2===parseInt(e.data("switcher"),10)&&(l.children(".wpr-switcher").eq(1).removeClass("wpr-switcher-active"),l.children(".wpr-switcher").eq(0).addClass("wpr-switcher-active"),l.closest(".wpr-switcher-container").attr("data-active-switcher",1),r(0))}):d.on("click",function(){var e=t(this).data("switcher")-1;r(e)})}()},widgetBackToTop:function(e){function i(e,t,i){e>i.animationOffset?"fade"===i.animation?r.stop().css("visibility","visible").animate({opacity:"1"},i.animationDuration):"slide"===i.animation?r.stop().css("visibility","visible").animate({opacity:"1","margin-bottom":0},i.animationDuration):r.css("visibility","visible"):"fade"===i.animation?r.stop().animate({opacity:"0"},i.animationDuration):"slide"===i.animation?r.stop().animate({"margin-bottom":"-100px",opacity:"0"},i.animationDuration):r.css("visibility","hidden")}var r=e.find(".wpr-stt-btn"),a=r.attr("data-settings");a=JSON.parse(a),"fixed"===a.fixed&&("none"!==a.animation&&(r.css({opacity:"0"}),"slide"===a.animation&&r.css({"margin-bottom":"-100px"})),i(t(window).scrollTop(),r,a),t(window).scroll(function(){i(t(this).scrollTop(),r,a)})),r.on("click",function(){return t("html, body").animate({scrollTop:0},a.scrolAnim),!1})},widgetLottieAnimations:function(e){var i=e.find(".wpr-lottie-animations"),r=e.find(".wpr-lottie-animations-wrapper"),a=JSON.parse(i.attr("data-settings")),s=lottie.loadAnimation({container:i[0],path:i.attr("data-json-url"),renderer:a.lottie_renderer,loop:!("yes"!==a.loop),autoplay:!("yes"!==a.autoplay)});s.setSpeed(a.speed),a.reverse&&s.setDirection(-1),s.addEventListener("DOMLoaded",function(){function e(){if(s.pause(),"function"==typeof i[0].getBoundingClientRect){var e=document.documentElement.clientHeight,r=100*(i[0].getBoundingClientRect().top/e),l=100*(i[0].getBoundingClientRect().bottom/e),n=r<a.scroll_end,o=l>a.scroll_start;if("viewport"===a.trigger&&(o&&n?s.play():s.pause()),"scroll"===a.trigger&&o&&n){s.pause();var d=100*t(window).scrollTop()/(t(document).height()-t(window).height()),p=Math.round(d);s.goToAndStop(4e3*(p/100))}}}"hover"!==a.trigger&&"none"!==a.trigger&&(e("load"),t(window).on("scroll",e)),"hover"===a.trigger&&(s.pause(),i.hover(function(){s.play()},function(){s.pause()}))})},widgetPostsTimeline:function(i){function r(){i.find(".wpr-centered").length&&(767>=window.innerWidth?(i.find(".wpr-wrapper .wpr-timeline-centered").removeClass("wpr-both-sided-timeline").addClass("wpr-one-sided-timeline").addClass("wpr-remove-one-sided-later"),i.find(".wpr-wrapper .wpr-left-aligned").removeClass("wpr-left-aligned").addClass("wpr-right-aligned").addClass("wpr-remove-right-aligned-later")):(i.find(".wpr-wrapper .wpr-timeline-centered.wpr-remove-one-sided-later").removeClass("wpr-one-sided-timeline").addClass("wpr-both-sided-timeline").removeClass("wpr-remove-one-sided-later"),i.find(".wpr-wrapper .wpr-remove-right-aligned-later").removeClass("wpr-right-aligned").addClass("wpr-left-aligned").removeClass("wpr-remove-right-aligned-later")))}function a(e,r){if(i.find(".wpr-timeline-fill").length&&(0<i.find(".wpr-timeline-entry:eq(0)").prev(".wpr-year-wrap").length&&(r=i.find(".wpr-year-label").eq(0)),p.length)){var a=p.css("height").slice(0,-2),s=document.documentElement.scrollTop,l=document.documentElement.clientHeight/2;s+l-r.offset().top>e.offset().top-r.offset().top+parseInt(e.css("height").slice(0,-2))||p.css("height",s+l-r.offset().top+"px"),i.find(".wpr-main-line-icon.wpr-icon").each(function(){t(this).offset().top<parseInt(r.offset().top+parseInt(a))?t(this).addClass("wpr-change-border-color"):t(this).removeClass("wpr-change-border-color")})}}function s(e,t,r,a,s){if(s=i.find(".wpr-timeline-centered"),i.find(".wpr-both-sided-timeline").length||i.find(".wpr-one-sided-timeline").length||i.find(".wpr-one-sided-timeline-left").length){0<i.find(".wpr-timeline-entry:eq(0)").prev(".wpr-year-wrap").length&&(a=i.find(".wpr-year-label").eq(0));var l=a.offset().top,n=r.offset().top,o=l-s.offset().top+"px",d=n-l+parseInt(r.css("height").slice(0,-2));e.css("top",o),e.css("height",d),""===t?"":t.css("top",o)}}var l=0<i.find(".wpr-timeline-centered").length?i.find(".wpr-timeline-centered"):"",n=0<i.find(".wpr-timeline-centered").length?i.find(".wpr-timeline-centered"):"",o=0<i.find(".wpr-grid-pagination").length?i.find(".wpr-grid-pagination"):"",d=0<i.find(".wpr-middle-line").length?i.find(".wpr-middle-line"):"",p=0<i.find(".wpr-timeline-fill").length?i.find(".wpr-timeline-fill"):"",c=0<i.find(".wpr-main-line-icon.wpr-icon:last").length?i.find(".wpr-main-line-icon.wpr-icon:last"):"",f=0<i.find(".wpr-main-line-icon.wpr-icon").length?i.find(".wpr-main-line-icon.wpr-icon").first():"",m=".elementor-element-"+i.attr("data-id"),g=i.find(".wpr-story-info-vertical").attr("data-animation-offset")?+i.find(".wpr-story-info-vertical").attr("data-animation-offset"):"",y=i.find(".wpr-story-info-vertical").attr("data-animation-duration")?+i.find(".wpr-story-info-vertical").attr("data-animation-duration"):"";if(0<i.find(".wpr-timeline-centered").length&&(t(window).resize(function(){r()}),t(window).smartresize(function(){r()}),setTimeout(function(){r(),t(window).trigger("resize")},500),s(d,p,c,f,n),setTimeout(function(){s(d,p,c,f,n),t(window).trigger("resize")},500),t(window).smartresize(function(){s(d,p,c,f,n)}),t(window).resize(function(){s(d,p,c,f,n)}),"load-more"!==l.attr("data-pagination")&&i.find(".wpr-grid-pagination").css("visibility","hidden"),AOS.init({offset:parseInt(g),duration:y,once:!0}),a(c,f),t(window).on("scroll",function(){a(c,f)}),!i.find(".elementor-repeater-items").length&&!e.editorCheck()&&("load-more"===i.find(".wpr-timeline-centered").data("pagination")||"infinite-scroll"===i.find(".wpr-timeline-centered").data("pagination")))){var w=(void 0===l||"load-more"!==l.attr("data-pagination"))&&10;l.infiniteScroll({path:m+" .wpr-grid-pagination a",hideNav:!1,append:m+".wpr-timeline-entry",history:!1,scrollThreshold:w,status:m+" .page-load-status"}),l.on("request.infiniteScroll",function(){i.find(".wpr-load-more-btn").hide(),i.find(".wpr-pagination-loading").css("display","inline-block")});var h=0;l.on("load.infiniteScroll",function(e,r){h++;var w=t(r).find(m).find(".wpr-timeline-entry");l.infiniteScroll("appendItems",w),i.find(".wpr-one-sided-timeline").length||i.find(".wpr-one-sided-timeline-left").length||(i.find(".wpr-timeline-entry").each(function(e){t(this).removeClass("wpr-right-aligned wpr-left-aligned"),0==e%2?(t(this).addClass("wpr-left-aligned"),t(this).find(".wpr-story-info-vertical").attr("data-aos",t(this).find(".wpr-story-info-vertical").attr("data-aos-left"))):(t(this).addClass("wpr-right-aligned"),t(this).find(".wpr-story-info-vertical").attr("data-aos",t(this).find(".wpr-story-info-vertical").attr("data-aos-right")))}),AOS.init({offset:parseInt(g),duration:y,once:!0})),t(window).scroll(),i.find(".wpr-pagination-loading").hide(),l.data("max-pages")-1===h?(i.find(".wpr-pagination-finish").fadeIn(1e3),o.delay(2e3).fadeOut(1e3)):"load-more"===l.attr("data-pagination")&&i.find(".wpr-load-more-btn").fadeIn(),d=i.find(".wpr-middle-line"),p=i.find(".wpr-timeline-fill"),c=i.find(".wpr-main-line-icon.wpr-icon:last"),f=i.find(".wpr-main-line-icon.wpr-icon").first(),n=i.find(".wpr-timeline-centered"),s(d,p,c,f,n),t(window).trigger("resize"),a(c,f)}),e.editorCheck()||(i.find(".wpr-load-more-btn").on("click",function(){return l.infiniteScroll("loadNextPage"),!1}),"infinite-scroll"==l.attr("data-pagination")&&l.infiniteScroll("loadNextPage"))}if(i.find(".swiper-wrapper").length){var u=function(e,t){if("undefined"==typeof Swiper){var i=elementorFrontend.utils.swiper;return new i(e,t).then(function(e){return e})}return b(e,t)},b=function(e,t){return new Promise(function(i){var r=new Swiper(e,t);i(r)})},T=i.find(".wpr-horizontal-bottom").length?".wpr-horizontal-bottom":".wpr-horizontal",v=i.find(T+".swiper-container"),k=v.data("slidestoshow");u(v,{spaceBetween:+v.data("swiper-space-between"),autoplay:"yes"===v.data("autoplay"),delay:+v.attr("data-swiper-delay"),speed:+v.attr("data-swiper-speed"),slidesPerView:v.data("slidestoshow"),direction:"horizontal",pagination:{el:".wpr-swiper-pagination",type:"progressbar"},navigation:{nextEl:".wpr-button-next",prevEl:".wpr-button-prev"},breakpoints:{320:{slidesPerView:1},480:{slidesPerView:2},769:{slidesPerView:k}}})}},widgetSharingButtons:function(e){e.find(".wpr-sharing-print").on("click",function(t){t.preventDefault(),window.print()})},widgetFlipCarousel:function(e){var i=JSON.parse(e.find(".wpr-flip-carousel").attr("data-settings"));e.find(".wpr-flip-carousel").css("opacity",1),e.find(".wpr-flip-carousel").flipster({itemContainer:"ul",itemSelector:"li",fadeIn:400,start:"yes"===i.starts_from_center?"center":0,style:i.carousel_type,loop:!("yes"!==i.loop),autoplay:"no"!==i.autoplay&&i.autoplay_milliseconds,pauseOnHover:!("yes"!==i.pause_on_hover),click:!("yes"!==i.play_on_click),scrollwheel:!("yes"!==i.play_on_scroll),touch:!0,nav:!("true"!==i.pagination_position)||!!i.pagination_position&&i.pagination_position,spacing:i.spacing,buttons:"custom",buttonPrev:i.button_prev,buttonNext:i.button_next});var r=e.find(".wpr-flip-carousel").find(".flipster__nav__item").find(".flipster__nav__link");r.each(function(){t(this).text(parseInt(t(this).text())+1)})},widgetFeatureList:function(e){e.find(".wpr-feature-list-item:not(:last-of-type)").find(".wpr-feature-list-icon-wrap").each(function(i){var r=e.find(".wpr-feature-list-item").eq(i+1).find(".wpr-feature-list-icon-wrap").offset().top;t(this).find(".wpr-feature-list-line").height(r-t(this).offset().top+"px")}),t(window).resize(function(){e.find(".wpr-feature-list-item:not(:last-of-type)").find(".wpr-feature-list-icon-wrap").each(function(i){var r=e.find(".wpr-feature-list-item").eq(i+1).find(".wpr-feature-list-icon-wrap").offset().top;t(this).find(".wpr-feature-list-line").height(r-t(this).offset().top+"px")})})},editorCheck:function(){return!!t("body").hasClass("elementor-editor-active")}};t(window).on("elementor/frontend/init",e.init)})(jQuery,window.elementorFrontend),function(e,t){var i=function(e,t,i){var r;return function(){var a=this,s=arguments;r?clearTimeout(r):i&&e.apply(a,s),r=setTimeout(function(){i||e.apply(a,s),r=null},t||100)}};jQuery.fn[t]=function(e){return e?this.bind("resize",i(e)):this.trigger(t)}}(jQuery,"smartresize");
|
assets/js/lib/lightgallery/lightgallery.js
CHANGED
@@ -1,2912 +1,2912 @@
|
|
1 |
-
/*! lightgallery - v1.6.12 - 2019-02-19
|
2 |
-
* http://sachinchoolur.github.io/lightGallery/
|
3 |
-
* Copyright (c) 2019 Sachin N; Licensed GPLv3 */
|
4 |
-
(function (root, factory) {
|
5 |
-
if (typeof define === 'function' && define.amd) {
|
6 |
-
// AMD. Register as an anonymous module unless amdModuleId is set
|
7 |
-
define(['jquery'], function (a0) {
|
8 |
-
return (factory(a0));
|
9 |
-
});
|
10 |
-
} else if (typeof module === 'object' && module.exports) {
|
11 |
-
// Node. Does not work with strict CommonJS, but
|
12 |
-
// only CommonJS-like environments that support module.exports,
|
13 |
-
// like Node.
|
14 |
-
module.exports = factory(require('jquery'));
|
15 |
-
} else {
|
16 |
-
factory(root["jQuery"]);
|
17 |
-
}
|
18 |
-
}(this, function ($) {
|
19 |
-
|
20 |
-
(function() {
|
21 |
-
'use strict';
|
22 |
-
|
23 |
-
var defaults = {
|
24 |
-
|
25 |
-
mode: 'lg-slide',
|
26 |
-
|
27 |
-
// Ex : 'ease'
|
28 |
-
cssEasing: 'ease',
|
29 |
-
|
30 |
-
//'for jquery animation'
|
31 |
-
easing: 'linear',
|
32 |
-
speed: 600,
|
33 |
-
height: '100%',
|
34 |
-
width: '100%',
|
35 |
-
addClass: '',
|
36 |
-
startClass: 'lg-start-zoom',
|
37 |
-
backdropDuration: 150,
|
38 |
-
hideBarsDelay: 6000,
|
39 |
-
|
40 |
-
useLeft: false,
|
41 |
-
|
42 |
-
closable: true,
|
43 |
-
loop: true,
|
44 |
-
escKey: true,
|
45 |
-
keyPress: true,
|
46 |
-
controls: true,
|
47 |
-
slideEndAnimatoin: true,
|
48 |
-
hideControlOnEnd: false,
|
49 |
-
mousewheel: true,
|
50 |
-
|
51 |
-
getCaptionFromTitleOrAlt: true,
|
52 |
-
|
53 |
-
// .lg-item || '.lg-sub-html'
|
54 |
-
appendSubHtmlTo: '.lg-sub-html',
|
55 |
-
|
56 |
-
subHtmlSelectorRelative: false,
|
57 |
-
|
58 |
-
/**
|
59 |
-
* @desc number of preload slides
|
60 |
-
* will exicute only after the current slide is fully loaded.
|
61 |
-
*
|
62 |
-
* @ex you clicked on 4th image and if preload = 1 then 3rd slide and 5th
|
63 |
-
* slide will be loaded in the background after the 4th slide is fully loaded..
|
64 |
-
* if preload is 2 then 2nd 3rd 5th 6th slides will be preloaded.. ... ...
|
65 |
-
*
|
66 |
-
*/
|
67 |
-
preload: 1,
|
68 |
-
showAfterLoad: true,
|
69 |
-
selector: '',
|
70 |
-
selectWithin: '',
|
71 |
-
nextHtml: '',
|
72 |
-
prevHtml: '',
|
73 |
-
|
74 |
-
// 0, 1
|
75 |
-
index: false,
|
76 |
-
|
77 |
-
iframeMaxWidth: '100%',
|
78 |
-
|
79 |
-
download: true,
|
80 |
-
counter: true,
|
81 |
-
appendCounterTo: '.lg-toolbar',
|
82 |
-
|
83 |
-
swipeThreshold: 50,
|
84 |
-
enableSwipe: true,
|
85 |
-
enableDrag: true,
|
86 |
-
|
87 |
-
dynamic: false,
|
88 |
-
dynamicEl: [],
|
89 |
-
galleryId: 1
|
90 |
-
};
|
91 |
-
|
92 |
-
function Plugin(element, options) {
|
93 |
-
|
94 |
-
// Current lightGallery element
|
95 |
-
this.el = element;
|
96 |
-
|
97 |
-
// Current jquery element
|
98 |
-
this.$el = $(element);
|
99 |
-
|
100 |
-
// lightGallery settings
|
101 |
-
this.s = $.extend({}, defaults, options);
|
102 |
-
|
103 |
-
// When using dynamic mode, ensure dynamicEl is an array
|
104 |
-
if (this.s.dynamic && this.s.dynamicEl !== 'undefined' && this.s.dynamicEl.constructor === Array && !this.s.dynamicEl.length) {
|
105 |
-
throw ('When using dynamic mode, you must also define dynamicEl as an Array.');
|
106 |
-
}
|
107 |
-
|
108 |
-
// lightGallery modules
|
109 |
-
this.modules = {};
|
110 |
-
|
111 |
-
// false when lightgallery complete first slide;
|
112 |
-
this.lGalleryOn = false;
|
113 |
-
|
114 |
-
this.lgBusy = false;
|
115 |
-
|
116 |
-
// Timeout function for hiding controls;
|
117 |
-
this.hideBartimeout = false;
|
118 |
-
|
119 |
-
// To determine browser supports for touch events;
|
120 |
-
this.isTouch = ('ontouchstart' in document.documentElement);
|
121 |
-
|
122 |
-
// Disable hideControlOnEnd if sildeEndAnimation is true
|
123 |
-
if (this.s.slideEndAnimatoin) {
|
124 |
-
this.s.hideControlOnEnd = false;
|
125 |
-
}
|
126 |
-
|
127 |
-
// Gallery items
|
128 |
-
if (this.s.dynamic) {
|
129 |
-
this.$items = this.s.dynamicEl;
|
130 |
-
} else {
|
131 |
-
if (this.s.selector === 'this') {
|
132 |
-
this.$items = this.$el;
|
133 |
-
} else if (this.s.selector !== '') {
|
134 |
-
if (this.s.selectWithin) {
|
135 |
-
this.$items = $(this.s.selectWithin).find(this.s.selector);
|
136 |
-
} else {
|
137 |
-
this.$items = this.$el.find($(this.s.selector));
|
138 |
-
}
|
139 |
-
} else {
|
140 |
-
this.$items = this.$el.children();
|
141 |
-
}
|
142 |
-
}
|
143 |
-
|
144 |
-
// .lg-item
|
145 |
-
this.$slide = '';
|
146 |
-
|
147 |
-
// .lg-outer
|
148 |
-
this.$outer = '';
|
149 |
-
|
150 |
-
this.init();
|
151 |
-
|
152 |
-
return this;
|
153 |
-
}
|
154 |
-
|
155 |
-
Plugin.prototype.init = function() {
|
156 |
-
|
157 |
-
var _this = this;
|
158 |
-
|
159 |
-
// s.preload should not be more than $item.length
|
160 |
-
if (_this.s.preload > _this.$items.length) {
|
161 |
-
_this.s.preload = _this.$items.length;
|
162 |
-
}
|
163 |
-
|
164 |
-
// if dynamic option is enabled execute immediately
|
165 |
-
var _hash = window.location.hash;
|
166 |
-
if (_hash.indexOf('lg=' + this.s.galleryId) > 0) {
|
167 |
-
|
168 |
-
_this.index = parseInt(_hash.split('&slide=')[1], 10);
|
169 |
-
|
170 |
-
$('body').addClass('lg-from-hash');
|
171 |
-
if (!$('body').hasClass('lg-on')) {
|
172 |
-
setTimeout(function() {
|
173 |
-
_this.build(_this.index);
|
174 |
-
});
|
175 |
-
|
176 |
-
$('body').addClass('lg-on');
|
177 |
-
}
|
178 |
-
}
|
179 |
-
|
180 |
-
if (_this.s.dynamic) {
|
181 |
-
|
182 |
-
_this.$el.trigger('onBeforeOpen.lg');
|
183 |
-
|
184 |
-
_this.index = _this.s.index || 0;
|
185 |
-
|
186 |
-
// prevent accidental double execution
|
187 |
-
if (!$('body').hasClass('lg-on')) {
|
188 |
-
setTimeout(function() {
|
189 |
-
_this.build(_this.index);
|
190 |
-
$('body').addClass('lg-on');
|
191 |
-
});
|
192 |
-
}
|
193 |
-
} else {
|
194 |
-
|
195 |
-
// Using different namespace for click because click event should not unbind if selector is same object('this')
|
196 |
-
_this.$items.on('click.lgcustom', function(event) {
|
197 |
-
|
198 |
-
// For IE8
|
199 |
-
try {
|
200 |
-
event.preventDefault();
|
201 |
-
event.preventDefault();
|
202 |
-
} catch (er) {
|
203 |
-
event.returnValue = false;
|
204 |
-
}
|
205 |
-
|
206 |
-
_this.$el.trigger('onBeforeOpen.lg');
|
207 |
-
|
208 |
-
_this.index = _this.s.index || _this.$items.index(this);
|
209 |
-
|
210 |
-
// prevent accidental double execution
|
211 |
-
if (!$('body').hasClass('lg-on')) {
|
212 |
-
_this.build(_this.index);
|
213 |
-
$('body').addClass('lg-on');
|
214 |
-
}
|
215 |
-
});
|
216 |
-
}
|
217 |
-
|
218 |
-
};
|
219 |
-
|
220 |
-
Plugin.prototype.build = function(index) {
|
221 |
-
|
222 |
-
var _this = this;
|
223 |
-
|
224 |
-
_this.structure();
|
225 |
-
|
226 |
-
// module constructor
|
227 |
-
$.each($.fn.lightGallery.modules, function(key) {
|
228 |
-
_this.modules[key] = new $.fn.lightGallery.modules[key](_this.el);
|
229 |
-
});
|
230 |
-
|
231 |
-
// initiate slide function
|
232 |
-
_this.slide(index, false, false, false);
|
233 |
-
|
234 |
-
if (_this.s.keyPress) {
|
235 |
-
_this.keyPress();
|
236 |
-
}
|
237 |
-
|
238 |
-
if (_this.$items.length > 1) {
|
239 |
-
|
240 |
-
_this.arrow();
|
241 |
-
|
242 |
-
setTimeout(function() {
|
243 |
-
_this.enableDrag();
|
244 |
-
_this.enableSwipe();
|
245 |
-
}, 50);
|
246 |
-
|
247 |
-
if (_this.s.mousewheel) {
|
248 |
-
_this.mousewheel();
|
249 |
-
}
|
250 |
-
} else {
|
251 |
-
_this.$slide.on('click.lg', function() {
|
252 |
-
_this.$el.trigger('onSlideClick.lg');
|
253 |
-
});
|
254 |
-
}
|
255 |
-
|
256 |
-
_this.counter();
|
257 |
-
|
258 |
-
_this.closeGallery();
|
259 |
-
|
260 |
-
_this.$el.trigger('onAfterOpen.lg');
|
261 |
-
|
262 |
-
// Hide controllers if mouse doesn't move for some period
|
263 |
-
_this.$outer.on('mousemove.lg click.lg touchstart.lg', function() {
|
264 |
-
|
265 |
-
_this.$outer.removeClass('lg-hide-items');
|
266 |
-
|
267 |
-
clearTimeout(_this.hideBartimeout);
|
268 |
-
|
269 |
-
// Timeout will be cleared on each slide movement also
|
270 |
-
_this.hideBartimeout = setTimeout(function() {
|
271 |
-
_this.$outer.addClass('lg-hide-items');
|
272 |
-
}, _this.s.hideBarsDelay);
|
273 |
-
|
274 |
-
});
|
275 |
-
|
276 |
-
_this.$outer.trigger('mousemove.lg');
|
277 |
-
|
278 |
-
};
|
279 |
-
|
280 |
-
Plugin.prototype.structure = function() {
|
281 |
-
var list = '';
|
282 |
-
var controls = '';
|
283 |
-
var i = 0;
|
284 |
-
var subHtmlCont = '';
|
285 |
-
var template;
|
286 |
-
var _this = this;
|
287 |
-
|
288 |
-
$('body').append('<div class="lg-backdrop"></div>');
|
289 |
-
$('.lg-backdrop').css('transition-duration', this.s.backdropDuration + 'ms');
|
290 |
-
|
291 |
-
// Create gallery items
|
292 |
-
for (i = 0; i < this.$items.length; i++) {
|
293 |
-
list += '<div class="lg-item"></div>';
|
294 |
-
}
|
295 |
-
|
296 |
-
// Create controlls
|
297 |
-
if (this.s.controls && this.$items.length > 1) {
|
298 |
-
controls = '<div class="lg-actions">' +
|
299 |
-
'<button class="lg-prev lg-icon">' + this.s.prevHtml + '</button>' +
|
300 |
-
'<button class="lg-next lg-icon">' + this.s.nextHtml + '</button>' +
|
301 |
-
'</div>';
|
302 |
-
}
|
303 |
-
|
304 |
-
if (this.s.appendSubHtmlTo === '.lg-sub-html') {
|
305 |
-
subHtmlCont = '<div class="lg-sub-html"></div>';
|
306 |
-
}
|
307 |
-
|
308 |
-
template = '<div class="lg-outer ' + this.s.addClass + ' ' + this.s.startClass + '">' +
|
309 |
-
'<div class="lg" style="width:' + this.s.width + '; height:' + this.s.height + '">' +
|
310 |
-
'<div class="lg-inner">' + list + '</div>' +
|
311 |
-
'<div class="lg-toolbar lg-group">' +
|
312 |
-
'<span class="lg-close lg-icon"></span>' +
|
313 |
-
'</div>' +
|
314 |
-
controls +
|
315 |
-
subHtmlCont +
|
316 |
-
'</div>' +
|
317 |
-
'</div>';
|
318 |
-
|
319 |
-
$('body').append(template);
|
320 |
-
this.$outer = $('.lg-outer');
|
321 |
-
this.$slide = this.$outer.find('.lg-item');
|
322 |
-
|
323 |
-
if (this.s.useLeft) {
|
324 |
-
this.$outer.addClass('lg-use-left');
|
325 |
-
|
326 |
-
// Set mode lg-slide if use left is true;
|
327 |
-
this.s.mode = 'lg-slide';
|
328 |
-
} else {
|
329 |
-
this.$outer.addClass('lg-use-css3');
|
330 |
-
}
|
331 |
-
|
332 |
-
// For fixed height gallery
|
333 |
-
_this.setTop();
|
334 |
-
$(window).on('resize.lg orientationchange.lg', function() {
|
335 |
-
setTimeout(function() {
|
336 |
-
_this.setTop();
|
337 |
-
}, 100);
|
338 |
-
});
|
339 |
-
|
340 |
-
// add class lg-current to remove initial transition
|
341 |
-
this.$slide.eq(this.index).addClass('lg-current');
|
342 |
-
|
343 |
-
// add Class for css support and transition mode
|
344 |
-
if (this.doCss()) {
|
345 |
-
this.$outer.addClass('lg-css3');
|
346 |
-
} else {
|
347 |
-
this.$outer.addClass('lg-css');
|
348 |
-
|
349 |
-
// Set speed 0 because no animation will happen if browser doesn't support css3
|
350 |
-
this.s.speed = 0;
|
351 |
-
}
|
352 |
-
|
353 |
-
this.$outer.addClass(this.s.mode);
|
354 |
-
|
355 |
-
if (this.s.enableDrag && this.$items.length > 1) {
|
356 |
-
this.$outer.addClass('lg-grab');
|
357 |
-
}
|
358 |
-
|
359 |
-
if (this.s.showAfterLoad) {
|
360 |
-
this.$outer.addClass('lg-show-after-load');
|
361 |
-
}
|
362 |
-
|
363 |
-
if (this.doCss()) {
|
364 |
-
var $inner = this.$outer.find('.lg-inner');
|
365 |
-
$inner.css('transition-timing-function', this.s.cssEasing);
|
366 |
-
$inner.css('transition-duration', this.s.speed + 'ms');
|
367 |
-
}
|
368 |
-
|
369 |
-
setTimeout(function() {
|
370 |
-
$('.lg-backdrop').addClass('in');
|
371 |
-
});
|
372 |
-
|
373 |
-
setTimeout(function() {
|
374 |
-
_this.$outer.addClass('lg-visible');
|
375 |
-
}, this.s.backdropDuration);
|
376 |
-
|
377 |
-
if (this.s.download) {
|
378 |
-
this.$outer.find('.lg-toolbar').append('<a id="lg-download" target="_blank" download class="lg-download lg-icon"></a>');
|
379 |
-
}
|
380 |
-
|
381 |
-
// Store the current scroll top value to scroll back after closing the gallery..
|
382 |
-
this.prevScrollTop = $(window).scrollTop();
|
383 |
-
|
384 |
-
};
|
385 |
-
|
386 |
-
// For fixed height gallery
|
387 |
-
Plugin.prototype.setTop = function() {
|
388 |
-
if (this.s.height !== '100%') {
|
389 |
-
var wH = $(window).height();
|
390 |
-
var top = (wH - parseInt(this.s.height, 10)) / 2;
|
391 |
-
var $lGallery = this.$outer.find('.lg');
|
392 |
-
if (wH >= parseInt(this.s.height, 10)) {
|
393 |
-
$lGallery.css('top', top + 'px');
|
394 |
-
} else {
|
395 |
-
$lGallery.css('top', '0px');
|
396 |
-
}
|
397 |
-
}
|
398 |
-
};
|
399 |
-
|
400 |
-
// Find css3 support
|
401 |
-
Plugin.prototype.doCss = function() {
|
402 |
-
// check for css animation support
|
403 |
-
var support = function() {
|
404 |
-
var transition = ['transition', 'MozTransition', 'WebkitTransition', 'OTransition', 'msTransition', 'KhtmlTransition'];
|
405 |
-
var root = document.documentElement;
|
406 |
-
var i = 0;
|
407 |
-
for (i = 0; i < transition.length; i++) {
|
408 |
-
if (transition[i] in root.style) {
|
409 |
-
return true;
|
410 |
-
}
|
411 |
-
}
|
412 |
-
};
|
413 |
-
|
414 |
-
if (support()) {
|
415 |
-
return true;
|
416 |
-
}
|
417 |
-
|
418 |
-
return false;
|
419 |
-
};
|
420 |
-
|
421 |
-
/**
|
422 |
-
* @desc Check the given src is video
|
423 |
-
* @param {String} src
|
424 |
-
* @return {Object} video type
|
425 |
-
* Ex:{ youtube : ["//www.youtube.com/watch?v=c0asJgSyxcY", "c0asJgSyxcY"] }
|
426 |
-
*/
|
427 |
-
Plugin.prototype.isVideo = function(src, index) {
|
428 |
-
|
429 |
-
var html;
|
430 |
-
if (this.s.dynamic) {
|
431 |
-
html = this.s.dynamicEl[index].html;
|
432 |
-
} else {
|
433 |
-
html = this.$items.eq(index).attr('data-html');
|
434 |
-
}
|
435 |
-
|
436 |
-
if (!src) {
|
437 |
-
if(html) {
|
438 |
-
return {
|
439 |
-
html5: true
|
440 |
-
};
|
441 |
-
} else {
|
442 |
-
console.error('lightGallery :- data-src is not pvovided on slide item ' + (index + 1) + '. Please make sure the selector property is properly configured. More info - http://sachinchoolur.github.io/lightGallery/demos/html-markup.html');
|
443 |
-
return false;
|
444 |
-
}
|
445 |
-
}
|
446 |
-
|
447 |
-
var youtube = src.match(/\/\/(?:www\.)?youtu(?:\.be|be\.com|be-nocookie\.com)\/(?:watch\?v=|embed\/)?([a-z0-9\-\_\%]+)/i);
|
448 |
-
var vimeo = src.match(/\/\/(?:www\.)?vimeo.com\/([0-9a-z\-_]+)/i);
|
449 |
-
var dailymotion = src.match(/\/\/(?:www\.)?dai.ly\/([0-9a-z\-_]+)/i);
|
450 |
-
var vk = src.match(/\/\/(?:www\.)?(?:vk\.com|vkontakte\.ru)\/(?:video_ext\.php\?)(.*)/i);
|
451 |
-
|
452 |
-
if (youtube) {
|
453 |
-
return {
|
454 |
-
youtube: youtube
|
455 |
-
};
|
456 |
-
} else if (vimeo) {
|
457 |
-
return {
|
458 |
-
vimeo: vimeo
|
459 |
-
};
|
460 |
-
} else if (dailymotion) {
|
461 |
-
return {
|
462 |
-
dailymotion: dailymotion
|
463 |
-
};
|
464 |
-
} else if (vk) {
|
465 |
-
return {
|
466 |
-
vk: vk
|
467 |
-
};
|
468 |
-
}
|
469 |
-
};
|
470 |
-
|
471 |
-
/**
|
472 |
-
* @desc Create image counter
|
473 |
-
* Ex: 1/10
|
474 |
-
*/
|
475 |
-
Plugin.prototype.counter = function() {
|
476 |
-
if (this.s.counter) {
|
477 |
-
$(this.s.appendCounterTo).append('<div id="lg-counter"><span id="lg-counter-current">' + (parseInt(this.index, 10) + 1) + '</span> / <span id="lg-counter-all">' + this.$items.length + '</span></div>');
|
478 |
-
}
|
479 |
-
};
|
480 |
-
|
481 |
-
/**
|
482 |
-
* @desc add sub-html into the slide
|
483 |
-
* @param {Number} index - index of the slide
|
484 |
-
*/
|
485 |
-
Plugin.prototype.addHtml = function(index) {
|
486 |
-
var subHtml = null;
|
487 |
-
var subHtmlUrl;
|
488 |
-
var $currentEle;
|
489 |
-
if (this.s.dynamic) {
|
490 |
-
if (this.s.dynamicEl[index].subHtmlUrl) {
|
491 |
-
subHtmlUrl = this.s.dynamicEl[index].subHtmlUrl;
|
492 |
-
} else {
|
493 |
-
subHtml = this.s.dynamicEl[index].subHtml;
|
494 |
-
}
|
495 |
-
} else {
|
496 |
-
$currentEle = this.$items.eq(index);
|
497 |
-
if ($currentEle.attr('data-sub-html-url')) {
|
498 |
-
subHtmlUrl = $currentEle.attr('data-sub-html-url');
|
499 |
-
} else {
|
500 |
-
subHtml = $currentEle.attr('data-sub-html');
|
501 |
-
if (this.s.getCaptionFromTitleOrAlt && !subHtml) {
|
502 |
-
subHtml = $currentEle.attr('title') || $currentEle.find('img').first().attr('alt');
|
503 |
-
}
|
504 |
-
}
|
505 |
-
}
|
506 |
-
|
507 |
-
if (!subHtmlUrl) {
|
508 |
-
if (typeof subHtml !== 'undefined' && subHtml !== null) {
|
509 |
-
|
510 |
-
// get first letter of subhtml
|
511 |
-
// if first letter starts with . or # get the html form the jQuery object
|
512 |
-
var fL = subHtml.substring(0, 1);
|
513 |
-
if (fL === '.' || fL === '#') {
|
514 |
-
if (this.s.subHtmlSelectorRelative && !this.s.dynamic) {
|
515 |
-
subHtml = $currentEle.find(subHtml).html();
|
516 |
-
} else {
|
517 |
-
subHtml = $(subHtml).html();
|
518 |
-
}
|
519 |
-
}
|
520 |
-
} else {
|
521 |
-
subHtml = '';
|
522 |
-
}
|
523 |
-
}
|
524 |
-
|
525 |
-
if (this.s.appendSubHtmlTo === '.lg-sub-html') {
|
526 |
-
|
527 |
-
if (subHtmlUrl) {
|
528 |
-
this.$outer.find(this.s.appendSubHtmlTo).load(subHtmlUrl);
|
529 |
-
} else {
|
530 |
-
this.$outer.find(this.s.appendSubHtmlTo).html(subHtml);
|
531 |
-
}
|
532 |
-
|
533 |
-
} else {
|
534 |
-
|
535 |
-
if (subHtmlUrl) {
|
536 |
-
this.$slide.eq(index).load(subHtmlUrl);
|
537 |
-
} else {
|
538 |
-
this.$slide.eq(index).append(subHtml);
|
539 |
-
}
|
540 |
-
}
|
541 |
-
|
542 |
-
// Add lg-empty-html class if title doesn't exist
|
543 |
-
if (typeof subHtml !== 'undefined' && subHtml !== null) {
|
544 |
-
if (subHtml === '') {
|
545 |
-
this.$outer.find(this.s.appendSubHtmlTo).addClass('lg-empty-html');
|
546 |
-
} else {
|
547 |
-
this.$outer.find(this.s.appendSubHtmlTo).removeClass('lg-empty-html');
|
548 |
-
}
|
549 |
-
}
|
550 |
-
|
551 |
-
this.$el.trigger('onAfterAppendSubHtml.lg', [index]);
|
552 |
-
};
|
553 |
-
|
554 |
-
/**
|
555 |
-
* @desc Preload slides
|
556 |
-
* @param {Number} index - index of the slide
|
557 |
-
*/
|
558 |
-
Plugin.prototype.preload = function(index) {
|
559 |
-
var i = 1;
|
560 |
-
var j = 1;
|
561 |
-
for (i = 1; i <= this.s.preload; i++) {
|
562 |
-
if (i >= this.$items.length - index) {
|
563 |
-
break;
|
564 |
-
}
|
565 |
-
|
566 |
-
this.loadContent(index + i, false, 0);
|
567 |
-
}
|
568 |
-
|
569 |
-
for (j = 1; j <= this.s.preload; j++) {
|
570 |
-
if (index - j < 0) {
|
571 |
-
break;
|
572 |
-
}
|
573 |
-
|
574 |
-
this.loadContent(index - j, false, 0);
|
575 |
-
}
|
576 |
-
};
|
577 |
-
|
578 |
-
/**
|
579 |
-
* @desc Load slide content into slide.
|
580 |
-
* @param {Number} index - index of the slide.
|
581 |
-
* @param {Boolean} rec - if true call loadcontent() function again.
|
582 |
-
* @param {Boolean} delay - delay for adding complete class. it is 0 except first time.
|
583 |
-
*/
|
584 |
-
Plugin.prototype.loadContent = function(index, rec, delay) {
|
585 |
-
|
586 |
-
var _this = this;
|
587 |
-
var _hasPoster = false;
|
588 |
-
var _$img;
|
589 |
-
var _src;
|
590 |
-
var _poster;
|
591 |
-
var _srcset;
|
592 |
-
var _sizes;
|
593 |
-
var _html;
|
594 |
-
var getResponsiveSrc = function(srcItms) {
|
595 |
-
var rsWidth = [];
|
596 |
-
var rsSrc = [];
|
597 |
-
for (var i = 0; i < srcItms.length; i++) {
|
598 |
-
var __src = srcItms[i].split(' ');
|
599 |
-
|
600 |
-
// Manage empty space
|
601 |
-
if (__src[0] === '') {
|
602 |
-
__src.splice(0, 1);
|
603 |
-
}
|
604 |
-
|
605 |
-
rsSrc.push(__src[0]);
|
606 |
-
rsWidth.push(__src[1]);
|
607 |
-
}
|
608 |
-
|
609 |
-
var wWidth = $(window).width();
|
610 |
-
for (var j = 0; j < rsWidth.length; j++) {
|
611 |
-
if (parseInt(rsWidth[j], 10) > wWidth) {
|
612 |
-
_src = rsSrc[j];
|
613 |
-
break;
|
614 |
-
}
|
615 |
-
}
|
616 |
-
};
|
617 |
-
|
618 |
-
if (_this.s.dynamic) {
|
619 |
-
|
620 |
-
if (_this.s.dynamicEl[index].poster) {
|
621 |
-
_hasPoster = true;
|
622 |
-
_poster = _this.s.dynamicEl[index].poster;
|
623 |
-
}
|
624 |
-
|
625 |
-
_html = _this.s.dynamicEl[index].html;
|
626 |
-
_src = _this.s.dynamicEl[index].src;
|
627 |
-
|
628 |
-
if (_this.s.dynamicEl[index].responsive) {
|
629 |
-
var srcDyItms = _this.s.dynamicEl[index].responsive.split(',');
|
630 |
-
getResponsiveSrc(srcDyItms);
|
631 |
-
}
|
632 |
-
|
633 |
-
_srcset = _this.s.dynamicEl[index].srcset;
|
634 |
-
_sizes = _this.s.dynamicEl[index].sizes;
|
635 |
-
|
636 |
-
} else {
|
637 |
-
|
638 |
-
if (_this.$items.eq(index).attr('data-poster')) {
|
639 |
-
_hasPoster = true;
|
640 |
-
_poster = _this.$items.eq(index).attr('data-poster');
|
641 |
-
}
|
642 |
-
|
643 |
-
_html = _this.$items.eq(index).attr('data-html');
|
644 |
-
_src = _this.$items.eq(index).attr('href') || _this.$items.eq(index).attr('data-src');
|
645 |
-
|
646 |
-
if (_this.$items.eq(index).attr('data-responsive')) {
|
647 |
-
var srcItms = _this.$items.eq(index).attr('data-responsive').split(',');
|
648 |
-
getResponsiveSrc(srcItms);
|
649 |
-
}
|
650 |
-
|
651 |
-
_srcset = _this.$items.eq(index).attr('data-srcset');
|
652 |
-
_sizes = _this.$items.eq(index).attr('data-sizes');
|
653 |
-
|
654 |
-
}
|
655 |
-
|
656 |
-
//if (_src || _srcset || _sizes || _poster) {
|
657 |
-
|
658 |
-
var iframe = false;
|
659 |
-
if (_this.s.dynamic) {
|
660 |
-
if (_this.s.dynamicEl[index].iframe) {
|
661 |
-
iframe = true;
|
662 |
-
}
|
663 |
-
} else {
|
664 |
-
if (_this.$items.eq(index).attr('data-iframe') === 'true') {
|
665 |
-
iframe = true;
|
666 |
-
}
|
667 |
-
}
|
668 |
-
|
669 |
-
var _isVideo = _this.isVideo(_src, index);
|
670 |
-
if (!_this.$slide.eq(index).hasClass('lg-loaded')) {
|
671 |
-
if (iframe) {
|
672 |
-
_this.$slide.eq(index).prepend('<div class="lg-video-cont lg-has-iframe" style="max-width:' + _this.s.iframeMaxWidth + '"><div class="lg-video"><iframe class="lg-object" frameborder="0" src="' + _src + '" allowfullscreen="true"></iframe></div></div>');
|
673 |
-
} else if (_hasPoster) {
|
674 |
-
var videoClass = '';
|
675 |
-
if (_isVideo && _isVideo.youtube) {
|
676 |
-
videoClass = 'lg-has-youtube';
|
677 |
-
} else if (_isVideo && _isVideo.vimeo) {
|
678 |
-
videoClass = 'lg-has-vimeo';
|
679 |
-
} else {
|
680 |
-
videoClass = 'lg-has-html5';
|
681 |
-
}
|
682 |
-
|
683 |
-
_this.$slide.eq(index).prepend('<div class="lg-video-cont ' + videoClass + ' "><div class="lg-video"><span class="lg-video-play"></span><img class="lg-object lg-has-poster" src="' + _poster + '" /></div></div>');
|
684 |
-
|
685 |
-
} else if (_isVideo) {
|
686 |
-
_this.$slide.eq(index).prepend('<div class="lg-video-cont "><div class="lg-video"></div></div>');
|
687 |
-
_this.$el.trigger('hasVideo.lg', [index, _src, _html]);
|
688 |
-
} else {
|
689 |
-
_this.$slide.eq(index).prepend('<div class="lg-img-wrap"><img class="lg-object lg-image" src="' + _src + '" /></div>');
|
690 |
-
}
|
691 |
-
|
692 |
-
_this.$el.trigger('onAferAppendSlide.lg', [index]);
|
693 |
-
|
694 |
-
_$img = _this.$slide.eq(index).find('.lg-object');
|
695 |
-
if (_sizes) {
|
696 |
-
_$img.attr('sizes', _sizes);
|
697 |
-
}
|
698 |
-
|
699 |
-
if (_srcset) {
|
700 |
-
_$img.attr('srcset', _srcset);
|
701 |
-
try {
|
702 |
-
picturefill({
|
703 |
-
elements: [_$img[0]]
|
704 |
-
});
|
705 |
-
} catch (e) {
|
706 |
-
console.warn('lightGallery :- If you want srcset to be supported for older browser please include picturefil version 2 javascript library in your document.');
|
707 |
-
}
|
708 |
-
}
|
709 |
-
|
710 |
-
if (this.s.appendSubHtmlTo !== '.lg-sub-html') {
|
711 |
-
_this.addHtml(index);
|
712 |
-
}
|
713 |
-
|
714 |
-
_this.$slide.eq(index).addClass('lg-loaded');
|
715 |
-
}
|
716 |
-
|
717 |
-
_this.$slide.eq(index).find('.lg-object').on('load.lg error.lg', function() {
|
718 |
-
|
719 |
-
// For first time add some delay for displaying the start animation.
|
720 |
-
var _speed = 0;
|
721 |
-
|
722 |
-
// Do not change the delay value because it is required for zoom plugin.
|
723 |
-
// If gallery opened from direct url (hash) speed value should be 0
|
724 |
-
if (delay && !$('body').hasClass('lg-from-hash')) {
|
725 |
-
_speed = delay;
|
726 |
-
}
|
727 |
-
|
728 |
-
setTimeout(function() {
|
729 |
-
_this.$slide.eq(index).addClass('lg-complete');
|
730 |
-
_this.$el.trigger('onSlideItemLoad.lg', [index, delay || 0]);
|
731 |
-
}, _speed);
|
732 |
-
|
733 |
-
});
|
734 |
-
|
735 |
-
// @todo check load state for html5 videos
|
736 |
-
if (_isVideo && _isVideo.html5 && !_hasPoster) {
|
737 |
-
_this.$slide.eq(index).addClass('lg-complete');
|
738 |
-
}
|
739 |
-
|
740 |
-
if (rec === true) {
|
741 |
-
if (!_this.$slide.eq(index).hasClass('lg-complete')) {
|
742 |
-
_this.$slide.eq(index).find('.lg-object').on('load.lg error.lg', function() {
|
743 |
-
_this.preload(index);
|
744 |
-
});
|
745 |
-
} else {
|
746 |
-
_this.preload(index);
|
747 |
-
}
|
748 |
-
}
|
749 |
-
|
750 |
-
//}
|
751 |
-
};
|
752 |
-
|
753 |
-
/**
|
754 |
-
* @desc slide function for lightgallery
|
755 |
-
** Slide() gets call on start
|
756 |
-
** ** Set lg.on true once slide() function gets called.
|
757 |
-
** Call loadContent() on slide() function inside setTimeout
|
758 |
-
** ** On first slide we do not want any animation like slide of fade
|
759 |
-
** ** So on first slide( if lg.on if false that is first slide) loadContent() should start loading immediately
|
760 |
-
** ** Else loadContent() should wait for the transition to complete.
|
761 |
-
** ** So set timeout s.speed + 50
|
762 |
-
<=> ** loadContent() will load slide content in to the particular slide
|
763 |
-
** ** It has recursion (rec) parameter. if rec === true loadContent() will call preload() function.
|
764 |
-
** ** preload will execute only when the previous slide is fully loaded (images iframe)
|
765 |
-
** ** avoid simultaneous image load
|
766 |
-
<=> ** Preload() will check for s.preload value and call loadContent() again accoring to preload value
|
767 |
-
** loadContent() <====> Preload();
|
768 |
-
|
769 |
-
* @param {Number} index - index of the slide
|
770 |
-
* @param {Boolean} fromTouch - true if slide function called via touch event or mouse drag
|
771 |
-
* @param {Boolean} fromThumb - true if slide function called via thumbnail click
|
772 |
-
* @param {String} direction - Direction of the slide(next/prev)
|
773 |
-
*/
|
774 |
-
Plugin.prototype.slide = function(index, fromTouch, fromThumb, direction) {
|
775 |
-
|
776 |
-
var _prevIndex = this.$outer.find('.lg-current').index();
|
777 |
-
var _this = this;
|
778 |
-
|
779 |
-
// Prevent if multiple call
|
780 |
-
// Required for hsh plugin
|
781 |
-
if (_this.lGalleryOn && (_prevIndex === index)) {
|
782 |
-
return;
|
783 |
-
}
|
784 |
-
|
785 |
-
var _length = this.$slide.length;
|
786 |
-
var _time = _this.lGalleryOn ? this.s.speed : 0;
|
787 |
-
|
788 |
-
if (!_this.lgBusy) {
|
789 |
-
|
790 |
-
if (this.s.download) {
|
791 |
-
var _src;
|
792 |
-
if (_this.s.dynamic) {
|
793 |
-
_src = _this.s.dynamicEl[index].downloadUrl !== false && (_this.s.dynamicEl[index].downloadUrl || _this.s.dynamicEl[index].src);
|
794 |
-
} else {
|
795 |
-
_src = _this.$items.eq(index).attr('data-download-url') !== 'false' && (_this.$items.eq(index).attr('data-download-url') || _this.$items.eq(index).attr('href') || _this.$items.eq(index).attr('data-src'));
|
796 |
-
|
797 |
-
}
|
798 |
-
|
799 |
-
if (_src) {
|
800 |
-
$('#lg-download').attr('href', _src);
|
801 |
-
_this.$outer.removeClass('lg-hide-download');
|
802 |
-
} else {
|
803 |
-
_this.$outer.addClass('lg-hide-download');
|
804 |
-
}
|
805 |
-
}
|
806 |
-
|
807 |
-
this.$el.trigger('onBeforeSlide.lg', [_prevIndex, index, fromTouch, fromThumb]);
|
808 |
-
|
809 |
-
_this.lgBusy = true;
|
810 |
-
|
811 |
-
clearTimeout(_this.hideBartimeout);
|
812 |
-
|
813 |
-
// Add title if this.s.appendSubHtmlTo === lg-sub-html
|
814 |
-
if (this.s.appendSubHtmlTo === '.lg-sub-html') {
|
815 |
-
|
816 |
-
// wait for slide animation to complete
|
817 |
-
setTimeout(function() {
|
818 |
-
_this.addHtml(index);
|
819 |
-
}, _time);
|
820 |
-
}
|
821 |
-
|
822 |
-
this.arrowDisable(index);
|
823 |
-
|
824 |
-
if (!direction) {
|
825 |
-
if (index < _prevIndex) {
|
826 |
-
direction = 'prev';
|
827 |
-
} else if (index > _prevIndex) {
|
828 |
-
direction = 'next';
|
829 |
-
}
|
830 |
-
}
|
831 |
-
|
832 |
-
if (!fromTouch) {
|
833 |
-
|
834 |
-
// remove all transitions
|
835 |
-
_this.$outer.addClass('lg-no-trans');
|
836 |
-
|
837 |
-
this.$slide.removeClass('lg-prev-slide lg-next-slide');
|
838 |
-
|
839 |
-
if (direction === 'prev') {
|
840 |
-
|
841 |
-
//prevslide
|
842 |
-
this.$slide.eq(index).addClass('lg-prev-slide');
|
843 |
-
this.$slide.eq(_prevIndex).addClass('lg-next-slide');
|
844 |
-
} else {
|
845 |
-
|
846 |
-
// next slide
|
847 |
-
this.$slide.eq(index).addClass('lg-next-slide');
|
848 |
-
this.$slide.eq(_prevIndex).addClass('lg-prev-slide');
|
849 |
-
}
|
850 |
-
|
851 |
-
// give 50 ms for browser to add/remove class
|
852 |
-
setTimeout(function() {
|
853 |
-
_this.$slide.removeClass('lg-current');
|
854 |
-
|
855 |
-
//_this.$slide.eq(_prevIndex).removeClass('lg-current');
|
856 |
-
_this.$slide.eq(index).addClass('lg-current');
|
857 |
-
|
858 |
-
// reset all transitions
|
859 |
-
_this.$outer.removeClass('lg-no-trans');
|
860 |
-
}, 50);
|
861 |
-
} else {
|
862 |
-
|
863 |
-
this.$slide.removeClass('lg-prev-slide lg-current lg-next-slide');
|
864 |
-
var touchPrev;
|
865 |
-
var touchNext;
|
866 |
-
if (_length > 2) {
|
867 |
-
touchPrev = index - 1;
|
868 |
-
touchNext = index + 1;
|
869 |
-
|
870 |
-
if ((index === 0) && (_prevIndex === _length - 1)) {
|
871 |
-
|
872 |
-
// next slide
|
873 |
-
touchNext = 0;
|
874 |
-
touchPrev = _length - 1;
|
875 |
-
} else if ((index === _length - 1) && (_prevIndex === 0)) {
|
876 |
-
|
877 |
-
// prev slide
|
878 |
-
touchNext = 0;
|
879 |
-
touchPrev = _length - 1;
|
880 |
-
}
|
881 |
-
|
882 |
-
} else {
|
883 |
-
touchPrev = 0;
|
884 |
-
touchNext = 1;
|
885 |
-
}
|
886 |
-
|
887 |
-
if (direction === 'prev') {
|
888 |
-
_this.$slide.eq(touchNext).addClass('lg-next-slide');
|
889 |
-
} else {
|
890 |
-
_this.$slide.eq(touchPrev).addClass('lg-prev-slide');
|
891 |
-
}
|
892 |
-
|
893 |
-
_this.$slide.eq(index).addClass('lg-current');
|
894 |
-
}
|
895 |
-
|
896 |
-
if (_this.lGalleryOn) {
|
897 |
-
setTimeout(function() {
|
898 |
-
_this.loadContent(index, true, 0);
|
899 |
-
}, this.s.speed + 50);
|
900 |
-
|
901 |
-
setTimeout(function() {
|
902 |
-
_this.lgBusy = false;
|
903 |
-
_this.$el.trigger('onAfterSlide.lg', [_prevIndex, index, fromTouch, fromThumb]);
|
904 |
-
}, this.s.speed);
|
905 |
-
|
906 |
-
} else {
|
907 |
-
_this.loadContent(index, true, _this.s.backdropDuration);
|
908 |
-
|
909 |
-
_this.lgBusy = false;
|
910 |
-
_this.$el.trigger('onAfterSlide.lg', [_prevIndex, index, fromTouch, fromThumb]);
|
911 |
-
}
|
912 |
-
|
913 |
-
_this.lGalleryOn = true;
|
914 |
-
|
915 |
-
if (this.s.counter) {
|
916 |
-
$('#lg-counter-current').text(index + 1);
|
917 |
-
}
|
918 |
-
|
919 |
-
}
|
920 |
-
_this.index = index;
|
921 |
-
|
922 |
-
};
|
923 |
-
|
924 |
-
/**
|
925 |
-
* @desc Go to next slide
|
926 |
-
* @param {Boolean} fromTouch - true if slide function called via touch event
|
927 |
-
*/
|
928 |
-
Plugin.prototype.goToNextSlide = function(fromTouch) {
|
929 |
-
var _this = this;
|
930 |
-
var _loop = _this.s.loop;
|
931 |
-
if (fromTouch && _this.$slide.length < 3) {
|
932 |
-
_loop = false;
|
933 |
-
}
|
934 |
-
|
935 |
-
if (!_this.lgBusy) {
|
936 |
-
if ((_this.index + 1) < _this.$slide.length) {
|
937 |
-
_this.index++;
|
938 |
-
_this.$el.trigger('onBeforeNextSlide.lg', [_this.index]);
|
939 |
-
_this.slide(_this.index, fromTouch, false, 'next');
|
940 |
-
} else {
|
941 |
-
if (_loop) {
|
942 |
-
_this.index = 0;
|
943 |
-
_this.$el.trigger('onBeforeNextSlide.lg', [_this.index]);
|
944 |
-
_this.slide(_this.index, fromTouch, false, 'next');
|
945 |
-
} else if (_this.s.slideEndAnimatoin && !fromTouch) {
|
946 |
-
_this.$outer.addClass('lg-right-end');
|
947 |
-
setTimeout(function() {
|
948 |
-
_this.$outer.removeClass('lg-right-end');
|
949 |
-
}, 400);
|
950 |
-
}
|
951 |
-
}
|
952 |
-
}
|
953 |
-
};
|
954 |
-
|
955 |
-
/**
|
956 |
-
* @desc Go to previous slide
|
957 |
-
* @param {Boolean} fromTouch - true if slide function called via touch event
|
958 |
-
*/
|
959 |
-
Plugin.prototype.goToPrevSlide = function(fromTouch) {
|
960 |
-
var _this = this;
|
961 |
-
var _loop = _this.s.loop;
|
962 |
-
if (fromTouch && _this.$slide.length < 3) {
|
963 |
-
_loop = false;
|
964 |
-
}
|
965 |
-
|
966 |
-
if (!_this.lgBusy) {
|
967 |
-
if (_this.index > 0) {
|
968 |
-
_this.index--;
|
969 |
-
_this.$el.trigger('onBeforePrevSlide.lg', [_this.index, fromTouch]);
|
970 |
-
_this.slide(_this.index, fromTouch, false, 'prev');
|
971 |
-
} else {
|
972 |
-
if (_loop) {
|
973 |
-
_this.index = _this.$items.length - 1;
|
974 |
-
_this.$el.trigger('onBeforePrevSlide.lg', [_this.index, fromTouch]);
|
975 |
-
_this.slide(_this.index, fromTouch, false, 'prev');
|
976 |
-
} else if (_this.s.slideEndAnimatoin && !fromTouch) {
|
977 |
-
_this.$outer.addClass('lg-left-end');
|
978 |
-
setTimeout(function() {
|
979 |
-
_this.$outer.removeClass('lg-left-end');
|
980 |
-
}, 400);
|
981 |
-
}
|
982 |
-
}
|
983 |
-
}
|
984 |
-
};
|
985 |
-
|
986 |
-
Plugin.prototype.keyPress = function() {
|
987 |
-
var _this = this;
|
988 |
-
if (this.$items.length > 1) {
|
989 |
-
$(window).on('keyup.lg', function(e) {
|
990 |
-
if (_this.$items.length > 1) {
|
991 |
-
if (e.keyCode === 37) {
|
992 |
-
e.preventDefault();
|
993 |
-
_this.goToPrevSlide();
|
994 |
-
}
|
995 |
-
|
996 |
-
if (e.keyCode === 39) {
|
997 |
-
e.preventDefault();
|
998 |
-
_this.goToNextSlide();
|
999 |
-
}
|
1000 |
-
}
|
1001 |
-
});
|
1002 |
-
}
|
1003 |
-
|
1004 |
-
$(window).on('keydown.lg', function(e) {
|
1005 |
-
if (_this.s.escKey === true && e.keyCode === 27) {
|
1006 |
-
e.preventDefault();
|
1007 |
-
if (!_this.$outer.hasClass('lg-thumb-open')) {
|
1008 |
-
_this.destroy();
|
1009 |
-
} else {
|
1010 |
-
_this.$outer.removeClass('lg-thumb-open');
|
1011 |
-
}
|
1012 |
-
}
|
1013 |
-
});
|
1014 |
-
};
|
1015 |
-
|
1016 |
-
Plugin.prototype.arrow = function() {
|
1017 |
-
var _this = this;
|
1018 |
-
this.$outer.find('.lg-prev').on('click.lg', function() {
|
1019 |
-
_this.goToPrevSlide();
|
1020 |
-
});
|
1021 |
-
|
1022 |
-
this.$outer.find('.lg-next').on('click.lg', function() {
|
1023 |
-
_this.goToNextSlide();
|
1024 |
-
});
|
1025 |
-
};
|
1026 |
-
|
1027 |
-
Plugin.prototype.arrowDisable = function(index) {
|
1028 |
-
|
1029 |
-
// Disable arrows if s.hideControlOnEnd is true
|
1030 |
-
if (!this.s.loop && this.s.hideControlOnEnd) {
|
1031 |
-
if ((index + 1) < this.$slide.length) {
|
1032 |
-
this.$outer.find('.lg-next').removeAttr('disabled').removeClass('disabled');
|
1033 |
-
} else {
|
1034 |
-
this.$outer.find('.lg-next').attr('disabled', 'disabled').addClass('disabled');
|
1035 |
-
}
|
1036 |
-
|
1037 |
-
if (index > 0) {
|
1038 |
-
this.$outer.find('.lg-prev').removeAttr('disabled').removeClass('disabled');
|
1039 |
-
} else {
|
1040 |
-
this.$outer.find('.lg-prev').attr('disabled', 'disabled').addClass('disabled');
|
1041 |
-
}
|
1042 |
-
}
|
1043 |
-
};
|
1044 |
-
|
1045 |
-
Plugin.prototype.setTranslate = function($el, xValue, yValue) {
|
1046 |
-
// jQuery supports Automatic CSS prefixing since jQuery 1.8.0
|
1047 |
-
if (this.s.useLeft) {
|
1048 |
-
$el.css('left', xValue);
|
1049 |
-
} else {
|
1050 |
-
$el.css({
|
1051 |
-
transform: 'translate3d(' + (xValue) + 'px, ' + yValue + 'px, 0px)'
|
1052 |
-
});
|
1053 |
-
}
|
1054 |
-
};
|
1055 |
-
|
1056 |
-
Plugin.prototype.touchMove = function(startCoords, endCoords) {
|
1057 |
-
|
1058 |
-
var distance = endCoords - startCoords;
|
1059 |
-
|
1060 |
-
if (Math.abs(distance) > 15) {
|
1061 |
-
// reset opacity and transition duration
|
1062 |
-
this.$outer.addClass('lg-dragging');
|
1063 |
-
|
1064 |
-
// move current slide
|
1065 |
-
this.setTranslate(this.$slide.eq(this.index), distance, 0);
|
1066 |
-
|
1067 |
-
// move next and prev slide with current slide
|
1068 |
-
this.setTranslate($('.lg-prev-slide'), -this.$slide.eq(this.index).width() + distance, 0);
|
1069 |
-
this.setTranslate($('.lg-next-slide'), this.$slide.eq(this.index).width() + distance, 0);
|
1070 |
-
}
|
1071 |
-
};
|
1072 |
-
|
1073 |
-
Plugin.prototype.touchEnd = function(distance) {
|
1074 |
-
var _this = this;
|
1075 |
-
|
1076 |
-
// keep slide animation for any mode while dragg/swipe
|
1077 |
-
if (_this.s.mode !== 'lg-slide') {
|
1078 |
-
_this.$outer.addClass('lg-slide');
|
1079 |
-
}
|
1080 |
-
|
1081 |
-
this.$slide.not('.lg-current, .lg-prev-slide, .lg-next-slide').css('opacity', '0');
|
1082 |
-
|
1083 |
-
// set transition duration
|
1084 |
-
setTimeout(function() {
|
1085 |
-
_this.$outer.removeClass('lg-dragging');
|
1086 |
-
if ((distance < 0) && (Math.abs(distance) > _this.s.swipeThreshold)) {
|
1087 |
-
_this.goToNextSlide(true);
|
1088 |
-
} else if ((distance > 0) && (Math.abs(distance) > _this.s.swipeThreshold)) {
|
1089 |
-
_this.goToPrevSlide(true);
|
1090 |
-
} else if (Math.abs(distance) < 5) {
|
1091 |
-
|
1092 |
-
// Trigger click if distance is less than 5 pix
|
1093 |
-
_this.$el.trigger('onSlideClick.lg');
|
1094 |
-
}
|
1095 |
-
|
1096 |
-
_this.$slide.removeAttr('style');
|
1097 |
-
});
|
1098 |
-
|
1099 |
-
// remove slide class once drag/swipe is completed if mode is not slide
|
1100 |
-
setTimeout(function() {
|
1101 |
-
if (!_this.$outer.hasClass('lg-dragging') && _this.s.mode !== 'lg-slide') {
|
1102 |
-
_this.$outer.removeClass('lg-slide');
|
1103 |
-
}
|
1104 |
-
}, _this.s.speed + 100);
|
1105 |
-
|
1106 |
-
};
|
1107 |
-
|
1108 |
-
Plugin.prototype.enableSwipe = function() {
|
1109 |
-
var _this = this;
|
1110 |
-
var startCoords = 0;
|
1111 |
-
var endCoords = 0;
|
1112 |
-
var isMoved = false;
|
1113 |
-
|
1114 |
-
if (_this.s.enableSwipe && _this.doCss()) {
|
1115 |
-
|
1116 |
-
_this.$slide.on('touchstart.lg', function(e) {
|
1117 |
-
if (!_this.$outer.hasClass('lg-zoomed') && !_this.lgBusy) {
|
1118 |
-
e.preventDefault();
|
1119 |
-
_this.manageSwipeClass();
|
1120 |
-
startCoords = e.originalEvent.targetTouches[0].pageX;
|
1121 |
-
}
|
1122 |
-
});
|
1123 |
-
|
1124 |
-
_this.$slide.on('touchmove.lg', function(e) {
|
1125 |
-
if (!_this.$outer.hasClass('lg-zoomed')) {
|
1126 |
-
e.preventDefault();
|
1127 |
-
endCoords = e.originalEvent.targetTouches[0].pageX;
|
1128 |
-
_this.touchMove(startCoords, endCoords);
|
1129 |
-
isMoved = true;
|
1130 |
-
}
|
1131 |
-
});
|
1132 |
-
|
1133 |
-
_this.$slide.on('touchend.lg', function() {
|
1134 |
-
if (!_this.$outer.hasClass('lg-zoomed')) {
|
1135 |
-
if (isMoved) {
|
1136 |
-
isMoved = false;
|
1137 |
-
_this.touchEnd(endCoords - startCoords);
|
1138 |
-
} else {
|
1139 |
-
_this.$el.trigger('onSlideClick.lg');
|
1140 |
-
}
|
1141 |
-
}
|
1142 |
-
});
|
1143 |
-
}
|
1144 |
-
|
1145 |
-
};
|
1146 |
-
|
1147 |
-
Plugin.prototype.enableDrag = function() {
|
1148 |
-
var _this = this;
|
1149 |
-
var startCoords = 0;
|
1150 |
-
var endCoords = 0;
|
1151 |
-
var isDraging = false;
|
1152 |
-
var isMoved = false;
|
1153 |
-
if (_this.s.enableDrag && _this.doCss()) {
|
1154 |
-
_this.$slide.on('mousedown.lg', function(e) {
|
1155 |
-
if (!_this.$outer.hasClass('lg-zoomed') && !_this.lgBusy && !$(e.target).text().trim()) {
|
1156 |
-
e.preventDefault();
|
1157 |
-
_this.manageSwipeClass();
|
1158 |
-
startCoords = e.pageX;
|
1159 |
-
isDraging = true;
|
1160 |
-
|
1161 |
-
// ** Fix for webkit cursor issue https://code.google.com/p/chromium/issues/detail?id=26723
|
1162 |
-
_this.$outer.scrollLeft += 1;
|
1163 |
-
_this.$outer.scrollLeft -= 1;
|
1164 |
-
|
1165 |
-
// *
|
1166 |
-
|
1167 |
-
_this.$outer.removeClass('lg-grab').addClass('lg-grabbing');
|
1168 |
-
|
1169 |
-
_this.$el.trigger('onDragstart.lg');
|
1170 |
-
}
|
1171 |
-
});
|
1172 |
-
|
1173 |
-
$(window).on('mousemove.lg', function(e) {
|
1174 |
-
if (isDraging) {
|
1175 |
-
isMoved = true;
|
1176 |
-
endCoords = e.pageX;
|
1177 |
-
_this.touchMove(startCoords, endCoords);
|
1178 |
-
_this.$el.trigger('onDragmove.lg');
|
1179 |
-
}
|
1180 |
-
});
|
1181 |
-
|
1182 |
-
$(window).on('mouseup.lg', function(e) {
|
1183 |
-
if (isMoved) {
|
1184 |
-
isMoved = false;
|
1185 |
-
_this.touchEnd(endCoords - startCoords);
|
1186 |
-
_this.$el.trigger('onDragend.lg');
|
1187 |
-
} else if ($(e.target).hasClass('lg-object') || $(e.target).hasClass('lg-video-play')) {
|
1188 |
-
_this.$el.trigger('onSlideClick.lg');
|
1189 |
-
}
|
1190 |
-
|
1191 |
-
// Prevent execution on click
|
1192 |
-
if (isDraging) {
|
1193 |
-
isDraging = false;
|
1194 |
-
_this.$outer.removeClass('lg-grabbing').addClass('lg-grab');
|
1195 |
-
}
|
1196 |
-
});
|
1197 |
-
|
1198 |
-
}
|
1199 |
-
};
|
1200 |
-
|
1201 |
-
Plugin.prototype.manageSwipeClass = function() {
|
1202 |
-
var _touchNext = this.index + 1;
|
1203 |
-
var _touchPrev = this.index - 1;
|
1204 |
-
if (this.s.loop && this.$slide.length > 2) {
|
1205 |
-
if (this.index === 0) {
|
1206 |
-
_touchPrev = this.$slide.length - 1;
|
1207 |
-
} else if (this.index === this.$slide.length - 1) {
|
1208 |
-
_touchNext = 0;
|
1209 |
-
}
|
1210 |
-
}
|
1211 |
-
|
1212 |
-
this.$slide.removeClass('lg-next-slide lg-prev-slide');
|
1213 |
-
if (_touchPrev > -1) {
|
1214 |
-
this.$slide.eq(_touchPrev).addClass('lg-prev-slide');
|
1215 |
-
}
|
1216 |
-
|
1217 |
-
this.$slide.eq(_touchNext).addClass('lg-next-slide');
|
1218 |
-
};
|
1219 |
-
|
1220 |
-
Plugin.prototype.mousewheel = function() {
|
1221 |
-
var _this = this;
|
1222 |
-
_this.$outer.on('mousewheel.lg', function(e) {
|
1223 |
-
|
1224 |
-
if (!e.deltaY) {
|
1225 |
-
return;
|
1226 |
-
}
|
1227 |
-
|
1228 |
-
if (e.deltaY > 0) {
|
1229 |
-
_this.goToPrevSlide();
|
1230 |
-
} else {
|
1231 |
-
_this.goToNextSlide();
|
1232 |
-
}
|
1233 |
-
|
1234 |
-
e.preventDefault();
|
1235 |
-
});
|
1236 |
-
|
1237 |
-
};
|
1238 |
-
|
1239 |
-
Plugin.prototype.closeGallery = function() {
|
1240 |
-
|
1241 |
-
var _this = this;
|
1242 |
-
var mousedown = false;
|
1243 |
-
this.$outer.find('.lg-close').on('click.lg', function() {
|
1244 |
-
_this.destroy();
|
1245 |
-
});
|
1246 |
-
|
1247 |
-
if (_this.s.closable) {
|
1248 |
-
|
1249 |
-
// If you drag the slide and release outside gallery gets close on chrome
|
1250 |
-
// for preventing this check mousedown and mouseup happened on .lg-item or lg-outer
|
1251 |
-
_this.$outer.on('mousedown.lg', function(e) {
|
1252 |
-
|
1253 |
-
if ($(e.target).is('.lg-outer') || $(e.target).is('.lg-item ') || $(e.target).is('.lg-img-wrap')) {
|
1254 |
-
mousedown = true;
|
1255 |
-
} else {
|
1256 |
-
mousedown = false;
|
1257 |
-
}
|
1258 |
-
|
1259 |
-
});
|
1260 |
-
|
1261 |
-
_this.$outer.on('mousemove.lg', function() {
|
1262 |
-
mousedown = false;
|
1263 |
-
});
|
1264 |
-
|
1265 |
-
_this.$outer.on('mouseup.lg', function(e) {
|
1266 |
-
|
1267 |
-
if ($(e.target).is('.lg-outer') || $(e.target).is('.lg-item ') || $(e.target).is('.lg-img-wrap') && mousedown) {
|
1268 |
-
if (!_this.$outer.hasClass('lg-dragging')) {
|
1269 |
-
_this.destroy();
|
1270 |
-
}
|
1271 |
-
}
|
1272 |
-
|
1273 |
-
});
|
1274 |
-
|
1275 |
-
}
|
1276 |
-
|
1277 |
-
};
|
1278 |
-
|
1279 |
-
Plugin.prototype.destroy = function(d) {
|
1280 |
-
|
1281 |
-
var _this = this;
|
1282 |
-
|
1283 |
-
if (!d) {
|
1284 |
-
_this.$el.trigger('onBeforeClose.lg');
|
1285 |
-
$(window).scrollTop(_this.prevScrollTop);
|
1286 |
-
}
|
1287 |
-
|
1288 |
-
|
1289 |
-
/**
|
1290 |
-
* if d is false or undefined destroy will only close the gallery
|
1291 |
-
* plugins instance remains with the element
|
1292 |
-
*
|
1293 |
-
* if d is true destroy will completely remove the plugin
|
1294 |
-
*/
|
1295 |
-
|
1296 |
-
if (d) {
|
1297 |
-
if (!_this.s.dynamic) {
|
1298 |
-
// only when not using dynamic mode is $items a jquery collection
|
1299 |
-
this.$items.off('click.lg click.lgcustom');
|
1300 |
-
}
|
1301 |
-
|
1302 |
-
$.removeData(_this.el, 'lightGallery');
|
1303 |
-
}
|
1304 |
-
|
1305 |
-
// Unbind all events added by lightGallery
|
1306 |
-
this.$el.off('.lg.tm');
|
1307 |
-
|
1308 |
-
// Distroy all lightGallery modules
|
1309 |
-
$.each($.fn.lightGallery.modules, function(key) {
|
1310 |
-
if (_this.modules[key]) {
|
1311 |
-
_this.modules[key].destroy();
|
1312 |
-
}
|
1313 |
-
});
|
1314 |
-
|
1315 |
-
this.lGalleryOn = false;
|
1316 |
-
|
1317 |
-
clearTimeout(_this.hideBartimeout);
|
1318 |
-
this.hideBartimeout = false;
|
1319 |
-
$(window).off('.lg');
|
1320 |
-
$('body').removeClass('lg-on lg-from-hash');
|
1321 |
-
|
1322 |
-
if (_this.$outer) {
|
1323 |
-
_this.$outer.removeClass('lg-visible');
|
1324 |
-
}
|
1325 |
-
|
1326 |
-
$('.lg-backdrop').removeClass('in');
|
1327 |
-
|
1328 |
-
setTimeout(function() {
|
1329 |
-
if (_this.$outer) {
|
1330 |
-
_this.$outer.remove();
|
1331 |
-
}
|
1332 |
-
|
1333 |
-
$('.lg-backdrop').remove();
|
1334 |
-
|
1335 |
-
if (!d) {
|
1336 |
-
_this.$el.trigger('onCloseAfter.lg');
|
1337 |
-
}
|
1338 |
-
|
1339 |
-
}, _this.s.backdropDuration + 50);
|
1340 |
-
};
|
1341 |
-
|
1342 |
-
$.fn.lightGallery = function(options) {
|
1343 |
-
return this.each(function() {
|
1344 |
-
if (!$.data(this, 'lightGallery')) {
|
1345 |
-
$.data(this, 'lightGallery', new Plugin(this, options));
|
1346 |
-
} else {
|
1347 |
-
try {
|
1348 |
-
$(this).data('lightGallery').init();
|
1349 |
-
} catch (err) {
|
1350 |
-
console.error('lightGallery has not initiated properly');
|
1351 |
-
}
|
1352 |
-
}
|
1353 |
-
});
|
1354 |
-
};
|
1355 |
-
|
1356 |
-
$.fn.lightGallery.modules = {};
|
1357 |
-
|
1358 |
-
})();
|
1359 |
-
|
1360 |
-
|
1361 |
-
}));
|
1362 |
-
|
1363 |
-
/*! lg-autoplay - v1.0.4 - 2017-03-28
|
1364 |
-
* http://sachinchoolur.github.io/lightGallery
|
1365 |
-
* Copyright (c) 2017 Sachin N; Licensed GPLv3 */
|
1366 |
-
|
1367 |
-
(function (root, factory) {
|
1368 |
-
if (typeof define === 'function' && define.amd) {
|
1369 |
-
// AMD. Register as an anonymous module unless amdModuleId is set
|
1370 |
-
define(['jquery'], function (a0) {
|
1371 |
-
return (factory(a0));
|
1372 |
-
});
|
1373 |
-
} else if (typeof exports === 'object') {
|
1374 |
-
// Node. Does not work with strict CommonJS, but
|
1375 |
-
// only CommonJS-like environments that support module.exports,
|
1376 |
-
// like Node.
|
1377 |
-
module.exports = factory(require('jquery'));
|
1378 |
-
} else {
|
1379 |
-
factory(jQuery);
|
1380 |
-
}
|
1381 |
-
}(this, function ($) {
|
1382 |
-
|
1383 |
-
|
1384 |
-
(function() {
|
1385 |
-
|
1386 |
-
'use strict';
|
1387 |
-
|
1388 |
-
var defaults = {
|
1389 |
-
autoplay: false,
|
1390 |
-
pause: 5000,
|
1391 |
-
progressBar: true,
|
1392 |
-
fourceAutoplay: false,
|
1393 |
-
autoplayControls: true,
|
1394 |
-
appendAutoplayControlsTo: '.lg-toolbar'
|
1395 |
-
};
|
1396 |
-
|
1397 |
-
/**
|
1398 |
-
* Creates the autoplay plugin.
|
1399 |
-
* @param {object} element - lightGallery element
|
1400 |
-
*/
|
1401 |
-
var Autoplay = function(element) {
|
1402 |
-
|
1403 |
-
this.core = $(element).data('lightGallery');
|
1404 |
-
|
1405 |
-
this.$el = $(element);
|
1406 |
-
|
1407 |
-
// Execute only if items are above 1
|
1408 |
-
if (this.core.$items.length < 2) {
|
1409 |
-
return false;
|
1410 |
-
}
|
1411 |
-
|
1412 |
-
this.core.s = $.extend({}, defaults, this.core.s);
|
1413 |
-
this.interval = false;
|
1414 |
-
|
1415 |
-
// Identify if slide happened from autoplay
|
1416 |
-
this.fromAuto = true;
|
1417 |
-
|
1418 |
-
// Identify if autoplay canceled from touch/drag
|
1419 |
-
this.canceledOnTouch = false;
|
1420 |
-
|
1421 |
-
// save fourceautoplay value
|
1422 |
-
this.fourceAutoplayTemp = this.core.s.fourceAutoplay;
|
1423 |
-
|
1424 |
-
// do not allow progress bar if browser does not support css3 transitions
|
1425 |
-
if (!this.core.doCss()) {
|
1426 |
-
this.core.s.progressBar = false;
|
1427 |
-
}
|
1428 |
-
|
1429 |
-
this.init();
|
1430 |
-
|
1431 |
-
return this;
|
1432 |
-
};
|
1433 |
-
|
1434 |
-
Autoplay.prototype.init = function() {
|
1435 |
-
var _this = this;
|
1436 |
-
|
1437 |
-
// append autoplay controls
|
1438 |
-
if (_this.core.s.autoplayControls) {
|
1439 |
-
_this.controls();
|
1440 |
-
}
|
1441 |
-
|
1442 |
-
// Create progress bar
|
1443 |
-
if (_this.core.s.progressBar) {
|
1444 |
-
_this.core.$outer.find('.lg').append('<div class="lg-progress-bar"><div class="lg-progress"></div></div>');
|
1445 |
-
}
|
1446 |
-
|
1447 |
-
// set progress
|
1448 |
-
_this.progress();
|
1449 |
-
|
1450 |
-
// Start autoplay
|
1451 |
-
if (_this.core.s.autoplay) {
|
1452 |
-
_this.$el.one('onSlideItemLoad.lg.tm', function() {
|
1453 |
-
_this.startlAuto();
|
1454 |
-
});
|
1455 |
-
}
|
1456 |
-
|
1457 |
-
// cancel interval on touchstart and dragstart
|
1458 |
-
_this.$el.on('onDragstart.lg.tm touchstart.lg.tm', function() {
|
1459 |
-
if (_this.interval) {
|
1460 |
-
_this.cancelAuto();
|
1461 |
-
_this.canceledOnTouch = true;
|
1462 |
-
}
|
1463 |
-
});
|
1464 |
-
|
1465 |
-
// restore autoplay if autoplay canceled from touchstart / dragstart
|
1466 |
-
_this.$el.on('onDragend.lg.tm touchend.lg.tm onSlideClick.lg.tm', function() {
|
1467 |
-
if (!_this.interval && _this.canceledOnTouch) {
|
1468 |
-
_this.startlAuto();
|
1469 |
-
_this.canceledOnTouch = false;
|
1470 |
-
}
|
1471 |
-
});
|
1472 |
-
|
1473 |
-
};
|
1474 |
-
|
1475 |
-
Autoplay.prototype.progress = function() {
|
1476 |
-
|
1477 |
-
var _this = this;
|
1478 |
-
var _$progressBar;
|
1479 |
-
var _$progress;
|
1480 |
-
|
1481 |
-
_this.$el.on('onBeforeSlide.lg.tm', function() {
|
1482 |
-
|
1483 |
-
// start progress bar animation
|
1484 |
-
if (_this.core.s.progressBar && _this.fromAuto) {
|
1485 |
-
_$progressBar = _this.core.$outer.find('.lg-progress-bar');
|
1486 |
-
_$progress = _this.core.$outer.find('.lg-progress');
|
1487 |
-
if (_this.interval) {
|
1488 |
-
_$progress.removeAttr('style');
|
1489 |
-
_$progressBar.removeClass('lg-start');
|
1490 |
-
setTimeout(function() {
|
1491 |
-
_$progress.css('transition', 'width ' + (_this.core.s.speed + _this.core.s.pause) + 'ms ease 0s');
|
1492 |
-
_$progressBar.addClass('lg-start');
|
1493 |
-
}, 20);
|
1494 |
-
}
|
1495 |
-
}
|
1496 |
-
|
1497 |
-
// Remove setinterval if slide is triggered manually and fourceautoplay is false
|
1498 |
-
if (!_this.fromAuto && !_this.core.s.fourceAutoplay) {
|
1499 |
-
_this.cancelAuto();
|
1500 |
-
}
|
1501 |
-
|
1502 |
-
_this.fromAuto = false;
|
1503 |
-
|
1504 |
-
});
|
1505 |
-
};
|
1506 |
-
|
1507 |
-
// Manage autoplay via play/stop buttons
|
1508 |
-
Autoplay.prototype.controls = function() {
|
1509 |
-
var _this = this;
|
1510 |
-
var _html = '<span class="lg-autoplay-button lg-icon"></span>';
|
1511 |
-
|
1512 |
-
// Append autoplay controls
|
1513 |
-
$(this.core.s.appendAutoplayControlsTo).append(_html);
|
1514 |
-
|
1515 |
-
_this.core.$outer.find('.lg-autoplay-button').on('click.lg', function() {
|
1516 |
-
if ($(_this.core.$outer).hasClass('lg-show-autoplay')) {
|
1517 |
-
_this.cancelAuto();
|
1518 |
-
_this.core.s.fourceAutoplay = false;
|
1519 |
-
} else {
|
1520 |
-
if (!_this.interval) {
|
1521 |
-
_this.startlAuto();
|
1522 |
-
_this.core.s.fourceAutoplay = _this.fourceAutoplayTemp;
|
1523 |
-
}
|
1524 |
-
}
|
1525 |
-
});
|
1526 |
-
};
|
1527 |
-
|
1528 |
-
// Autostart gallery
|
1529 |
-
Autoplay.prototype.startlAuto = function() {
|
1530 |
-
var _this = this;
|
1531 |
-
|
1532 |
-
_this.core.$outer.find('.lg-progress').css('transition', 'width ' + (_this.core.s.speed + _this.core.s.pause) + 'ms ease 0s');
|
1533 |
-
_this.core.$outer.addClass('lg-show-autoplay');
|
1534 |
-
_this.core.$outer.find('.lg-progress-bar').addClass('lg-start');
|
1535 |
-
|
1536 |
-
_this.interval = setInterval(function() {
|
1537 |
-
if (_this.core.index + 1 < _this.core.$items.length) {
|
1538 |
-
_this.core.index++;
|
1539 |
-
} else {
|
1540 |
-
_this.core.index = 0;
|
1541 |
-
}
|
1542 |
-
|
1543 |
-
_this.fromAuto = true;
|
1544 |
-
_this.core.slide(_this.core.index, false, false, 'next');
|
1545 |
-
}, _this.core.s.speed + _this.core.s.pause);
|
1546 |
-
};
|
1547 |
-
|
1548 |
-
// cancel Autostart
|
1549 |
-
Autoplay.prototype.cancelAuto = function() {
|
1550 |
-
clearInterval(this.interval);
|
1551 |
-
this.interval = false;
|
1552 |
-
this.core.$outer.find('.lg-progress').removeAttr('style');
|
1553 |
-
this.core.$outer.removeClass('lg-show-autoplay');
|
1554 |
-
this.core.$outer.find('.lg-progress-bar').removeClass('lg-start');
|
1555 |
-
};
|
1556 |
-
|
1557 |
-
Autoplay.prototype.destroy = function() {
|
1558 |
-
|
1559 |
-
this.cancelAuto();
|
1560 |
-
this.core.$outer.find('.lg-progress-bar').remove();
|
1561 |
-
};
|
1562 |
-
|
1563 |
-
$.fn.lightGallery.modules.autoplay = Autoplay;
|
1564 |
-
|
1565 |
-
})();
|
1566 |
-
|
1567 |
-
|
1568 |
-
}));
|
1569 |
-
|
1570 |
-
/*! lg-fullscreen - v1.1.0 - 2019-02-19
|
1571 |
-
* http://sachinchoolur.github.io/lightGallery
|
1572 |
-
* Copyright (c) 2019 Sachin N; Licensed GPLv3 */
|
1573 |
-
|
1574 |
-
(function (root, factory) {
|
1575 |
-
if (typeof define === 'function' && define.amd) {
|
1576 |
-
// AMD. Register as an anonymous module unless amdModuleId is set
|
1577 |
-
define(['jquery'], function (a0) {
|
1578 |
-
return (factory(a0));
|
1579 |
-
});
|
1580 |
-
} else if (typeof module === 'object' && module.exports) {
|
1581 |
-
// Node. Does not work with strict CommonJS, but
|
1582 |
-
// only CommonJS-like environments that support module.exports,
|
1583 |
-
// like Node.
|
1584 |
-
module.exports = factory(require('jquery'));
|
1585 |
-
} else {
|
1586 |
-
factory(root["jQuery"]);
|
1587 |
-
}
|
1588 |
-
}(this, function ($) {
|
1589 |
-
|
1590 |
-
(function() {
|
1591 |
-
|
1592 |
-
'use strict';
|
1593 |
-
|
1594 |
-
var defaults = {
|
1595 |
-
fullScreen: true
|
1596 |
-
};
|
1597 |
-
|
1598 |
-
function isFullScreen() {
|
1599 |
-
return (
|
1600 |
-
document.fullscreenElement ||
|
1601 |
-
document.mozFullScreenElement ||
|
1602 |
-
document.webkitFullscreenElement ||
|
1603 |
-
document.msFullscreenElement
|
1604 |
-
);
|
1605 |
-
}
|
1606 |
-
|
1607 |
-
var Fullscreen = function(element) {
|
1608 |
-
|
1609 |
-
// get lightGallery core plugin data
|
1610 |
-
this.core = $(element).data('lightGallery');
|
1611 |
-
|
1612 |
-
this.$el = $(element);
|
1613 |
-
|
1614 |
-
// extend module defalut settings with lightGallery core settings
|
1615 |
-
this.core.s = $.extend({}, defaults, this.core.s);
|
1616 |
-
|
1617 |
-
this.init();
|
1618 |
-
|
1619 |
-
return this;
|
1620 |
-
};
|
1621 |
-
|
1622 |
-
Fullscreen.prototype.init = function() {
|
1623 |
-
var fullScreen = '';
|
1624 |
-
if (this.core.s.fullScreen) {
|
1625 |
-
|
1626 |
-
// check for fullscreen browser support
|
1627 |
-
if (!document.fullscreenEnabled && !document.webkitFullscreenEnabled &&
|
1628 |
-
!document.mozFullScreenEnabled && !document.msFullscreenEnabled) {
|
1629 |
-
return;
|
1630 |
-
} else {
|
1631 |
-
fullScreen = '<span class="lg-fullscreen lg-icon"></span>';
|
1632 |
-
this.core.$outer.find('.lg-toolbar').append(fullScreen);
|
1633 |
-
this.fullScreen();
|
1634 |
-
}
|
1635 |
-
}
|
1636 |
-
};
|
1637 |
-
|
1638 |
-
Fullscreen.prototype.requestFullscreen = function() {
|
1639 |
-
var el = document.documentElement;
|
1640 |
-
if (el.requestFullscreen) {
|
1641 |
-
el.requestFullscreen();
|
1642 |
-
} else if (el.msRequestFullscreen) {
|
1643 |
-
el.msRequestFullscreen();
|
1644 |
-
} else if (el.mozRequestFullScreen) {
|
1645 |
-
el.mozRequestFullScreen();
|
1646 |
-
} else if (el.webkitRequestFullscreen) {
|
1647 |
-
el.webkitRequestFullscreen();
|
1648 |
-
}
|
1649 |
-
};
|
1650 |
-
|
1651 |
-
Fullscreen.prototype.exitFullscreen = function() {
|
1652 |
-
if (document.exitFullscreen) {
|
1653 |
-
document.exitFullscreen();
|
1654 |
-
} else if (document.msExitFullscreen) {
|
1655 |
-
document.msExitFullscreen();
|
1656 |
-
} else if (document.mozCancelFullScreen) {
|
1657 |
-
document.mozCancelFullScreen();
|
1658 |
-
} else if (document.webkitExitFullscreen) {
|
1659 |
-
document.webkitExitFullscreen();
|
1660 |
-
}
|
1661 |
-
};
|
1662 |
-
|
1663 |
-
// https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Using_full_screen_mode
|
1664 |
-
Fullscreen.prototype.fullScreen = function() {
|
1665 |
-
var _this = this;
|
1666 |
-
|
1667 |
-
$(document).on('fullscreenchange.lg webkitfullscreenchange.lg mozfullscreenchange.lg MSFullscreenChange.lg', function() {
|
1668 |
-
_this.core.$outer.toggleClass('lg-fullscreen-on');
|
1669 |
-
});
|
1670 |
-
|
1671 |
-
this.core.$outer.find('.lg-fullscreen').on('click.lg', function() {
|
1672 |
-
if (isFullScreen()) {
|
1673 |
-
_this.exitFullscreen();
|
1674 |
-
} else {
|
1675 |
-
_this.requestFullscreen();
|
1676 |
-
}
|
1677 |
-
});
|
1678 |
-
|
1679 |
-
};
|
1680 |
-
|
1681 |
-
Fullscreen.prototype.destroy = function() {
|
1682 |
-
|
1683 |
-
// exit from fullscreen if activated
|
1684 |
-
if(isFullScreen()) {
|
1685 |
-
this.exitFullscreen();
|
1686 |
-
}
|
1687 |
-
|
1688 |
-
$(document).off('fullscreenchange.lg webkitfullscreenchange.lg mozfullscreenchange.lg MSFullscreenChange.lg');
|
1689 |
-
};
|
1690 |
-
|
1691 |
-
$.fn.lightGallery.modules.fullscreen = Fullscreen;
|
1692 |
-
|
1693 |
-
})();
|
1694 |
-
|
1695 |
-
}));
|
1696 |
-
|
1697 |
-
/*! lg-zoom - v1.1.0 - 2017-08-08
|
1698 |
-
* http://sachinchoolur.github.io/lightGallery
|
1699 |
-
* Copyright (c) 2017 Sachin N; Licensed GPLv3 */
|
1700 |
-
|
1701 |
-
(function (root, factory) {
|
1702 |
-
if (typeof define === 'function' && define.amd) {
|
1703 |
-
// AMD. Register as an anonymous module unless amdModuleId is set
|
1704 |
-
define(['jquery'], function (a0) {
|
1705 |
-
return (factory(a0));
|
1706 |
-
});
|
1707 |
-
} else if (typeof exports === 'object') {
|
1708 |
-
// Node. Does not work with strict CommonJS, but
|
1709 |
-
// only CommonJS-like environments that support module.exports,
|
1710 |
-
// like Node.
|
1711 |
-
module.exports = factory(require('jquery'));
|
1712 |
-
} else {
|
1713 |
-
factory(jQuery);
|
1714 |
-
}
|
1715 |
-
}(this, function ($) {
|
1716 |
-
|
1717 |
-
(function() {
|
1718 |
-
|
1719 |
-
'use strict';
|
1720 |
-
|
1721 |
-
var getUseLeft = function() {
|
1722 |
-
var useLeft = false;
|
1723 |
-
var isChrome = navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);
|
1724 |
-
if (isChrome && parseInt(isChrome[2], 10) < 54) {
|
1725 |
-
useLeft = true;
|
1726 |
-
}
|
1727 |
-
|
1728 |
-
return useLeft;
|
1729 |
-
};
|
1730 |
-
|
1731 |
-
var defaults = {
|
1732 |
-
scale: 1,
|
1733 |
-
zoom: true,
|
1734 |
-
actualSize: true,
|
1735 |
-
enableZoomAfter: 300,
|
1736 |
-
useLeftForZoom: getUseLeft()
|
1737 |
-
};
|
1738 |
-
|
1739 |
-
var Zoom = function(element) {
|
1740 |
-
|
1741 |
-
this.core = $(element).data('lightGallery');
|
1742 |
-
|
1743 |
-
this.core.s = $.extend({}, defaults, this.core.s);
|
1744 |
-
|
1745 |
-
if (this.core.s.zoom && this.core.doCss()) {
|
1746 |
-
this.init();
|
1747 |
-
|
1748 |
-
// Store the zoomable timeout value just to clear it while closing
|
1749 |
-
this.zoomabletimeout = false;
|
1750 |
-
|
1751 |
-
// Set the initial value center
|
1752 |
-
this.pageX = $(window).width() / 2;
|
1753 |
-
this.pageY = ($(window).height() / 2) + $(window).scrollTop();
|
1754 |
-
}
|
1755 |
-
|
1756 |
-
return this;
|
1757 |
-
};
|
1758 |
-
|
1759 |
-
Zoom.prototype.init = function() {
|
1760 |
-
|
1761 |
-
var _this = this;
|
1762 |
-
var zoomIcons = '<span id="lg-zoom-in" class="lg-icon"></span><span id="lg-zoom-out" class="lg-icon"></span>';
|
1763 |
-
|
1764 |
-
if (_this.core.s.actualSize) {
|
1765 |
-
zoomIcons += '<span id="lg-actual-size" class="lg-icon"></span>';
|
1766 |
-
}
|
1767 |
-
|
1768 |
-
if (_this.core.s.useLeftForZoom) {
|
1769 |
-
_this.core.$outer.addClass('lg-use-left-for-zoom');
|
1770 |
-
} else {
|
1771 |
-
_this.core.$outer.addClass('lg-use-transition-for-zoom');
|
1772 |
-
}
|
1773 |
-
|
1774 |
-
this.core.$outer.find('.lg-toolbar').append(zoomIcons);
|
1775 |
-
|
1776 |
-
// Add zoomable class
|
1777 |
-
_this.core.$el.on('onSlideItemLoad.lg.tm.zoom', function(event, index, delay) {
|
1778 |
-
|
1779 |
-
// delay will be 0 except first time
|
1780 |
-
var _speed = _this.core.s.enableZoomAfter + delay;
|
1781 |
-
|
1782 |
-
// set _speed value 0 if gallery opened from direct url and if it is first slide
|
1783 |
-
if ($('body').hasClass('lg-from-hash') && delay) {
|
1784 |
-
|
1785 |
-
// will execute only once
|
1786 |
-
_speed = 0;
|
1787 |
-
} else {
|
1788 |
-
|
1789 |
-
// Remove lg-from-hash to enable starting animation.
|
1790 |
-
$('body').removeClass('lg-from-hash');
|
1791 |
-
}
|
1792 |
-
|
1793 |
-
_this.zoomabletimeout = setTimeout(function() {
|
1794 |
-
_this.core.$slide.eq(index).addClass('lg-zoomable');
|
1795 |
-
}, _speed + 30);
|
1796 |
-
});
|
1797 |
-
|
1798 |
-
var scale = 1;
|
1799 |
-
/**
|
1800 |
-
* @desc Image zoom
|
1801 |
-
* Translate the wrap and scale the image to get better user experience
|
1802 |
-
*
|
1803 |
-
* @param {String} scaleVal - Zoom decrement/increment value
|
1804 |
-
*/
|
1805 |
-
var zoom = function(scaleVal) {
|
1806 |
-
|
1807 |
-
var $image = _this.core.$outer.find('.lg-current .lg-image');
|
1808 |
-
var _x;
|
1809 |
-
var _y;
|
1810 |
-
|
1811 |
-
// Find offset manually to avoid issue after zoom
|
1812 |
-
var offsetX = ($(window).width() - $image.prop('offsetWidth')) / 2;
|
1813 |
-
var offsetY = (($(window).height() - $image.prop('offsetHeight')) / 2) + $(window).scrollTop();
|
1814 |
-
|
1815 |
-
_x = _this.pageX - offsetX;
|
1816 |
-
_y = _this.pageY - offsetY;
|
1817 |
-
|
1818 |
-
var x = (scaleVal - 1) * (_x);
|
1819 |
-
var y = (scaleVal - 1) * (_y);
|
1820 |
-
|
1821 |
-
$image.css('transform', 'scale3d(' + scaleVal + ', ' + scaleVal + ', 1)').attr('data-scale', scaleVal);
|
1822 |
-
|
1823 |
-
if (_this.core.s.useLeftForZoom) {
|
1824 |
-
$image.parent().css({
|
1825 |
-
left: -x + 'px',
|
1826 |
-
top: -y + 'px'
|
1827 |
-
}).attr('data-x', x).attr('data-y', y);
|
1828 |
-
} else {
|
1829 |
-
$image.parent().css('transform', 'translate3d(-' + x + 'px, -' + y + 'px, 0)').attr('data-x', x).attr('data-y', y);
|
1830 |
-
}
|
1831 |
-
};
|
1832 |
-
|
1833 |
-
var callScale = function() {
|
1834 |
-
if (scale > 1) {
|
1835 |
-
_this.core.$outer.addClass('lg-zoomed');
|
1836 |
-
} else {
|
1837 |
-
_this.resetZoom();
|
1838 |
-
}
|
1839 |
-
|
1840 |
-
if (scale < 1) {
|
1841 |
-
scale = 1;
|
1842 |
-
}
|
1843 |
-
|
1844 |
-
zoom(scale);
|
1845 |
-
};
|
1846 |
-
|
1847 |
-
var actualSize = function(event, $image, index, fromIcon) {
|
1848 |
-
var w = $image.prop('offsetWidth');
|
1849 |
-
var nw;
|
1850 |
-
if (_this.core.s.dynamic) {
|
1851 |
-
nw = _this.core.s.dynamicEl[index].width || $image[0].naturalWidth || w;
|
1852 |
-
} else {
|
1853 |
-
nw = _this.core.$items.eq(index).attr('data-width') || $image[0].naturalWidth || w;
|
1854 |
-
}
|
1855 |
-
|
1856 |
-
var _scale;
|
1857 |
-
|
1858 |
-
if (_this.core.$outer.hasClass('lg-zoomed')) {
|
1859 |
-
scale = 1;
|
1860 |
-
} else {
|
1861 |
-
if (nw > w) {
|
1862 |
-
_scale = nw / w;
|
1863 |
-
scale = _scale || 2;
|
1864 |
-
}
|
1865 |
-
}
|
1866 |
-
|
1867 |
-
if (fromIcon) {
|
1868 |
-
_this.pageX = $(window).width() / 2;
|
1869 |
-
_this.pageY = ($(window).height() / 2) + $(window).scrollTop();
|
1870 |
-
} else {
|
1871 |
-
_this.pageX = event.pageX || event.originalEvent.targetTouches[0].pageX;
|
1872 |
-
_this.pageY = event.pageY || event.originalEvent.targetTouches[0].pageY;
|
1873 |
-
}
|
1874 |
-
|
1875 |
-
callScale();
|
1876 |
-
setTimeout(function() {
|
1877 |
-
_this.core.$outer.removeClass('lg-grabbing').addClass('lg-grab');
|
1878 |
-
}, 10);
|
1879 |
-
};
|
1880 |
-
|
1881 |
-
var tapped = false;
|
1882 |
-
|
1883 |
-
// event triggered after appending slide content
|
1884 |
-
_this.core.$el.on('onAferAppendSlide.lg.tm.zoom', function(event, index) {
|
1885 |
-
|
1886 |
-
// Get the current element
|
1887 |
-
var $image = _this.core.$slide.eq(index).find('.lg-image');
|
1888 |
-
|
1889 |
-
$image.on('dblclick', function(event) {
|
1890 |
-
actualSize(event, $image, index);
|
1891 |
-
});
|
1892 |
-
|
1893 |
-
$image.on('touchstart', function(event) {
|
1894 |
-
if (!tapped) {
|
1895 |
-
tapped = setTimeout(function() {
|
1896 |
-
tapped = null;
|
1897 |
-
}, 300);
|
1898 |
-
} else {
|
1899 |
-
clearTimeout(tapped);
|
1900 |
-
tapped = null;
|
1901 |
-
actualSize(event, $image, index);
|
1902 |
-
}
|
1903 |
-
|
1904 |
-
event.preventDefault();
|
1905 |
-
});
|
1906 |
-
|
1907 |
-
});
|
1908 |
-
|
1909 |
-
// Update zoom on resize and orientationchange
|
1910 |
-
$(window).on('resize.lg.zoom scroll.lg.zoom orientationchange.lg.zoom', function() {
|
1911 |
-
_this.pageX = $(window).width() / 2;
|
1912 |
-
_this.pageY = ($(window).height() / 2) + $(window).scrollTop();
|
1913 |
-
zoom(scale);
|
1914 |
-
});
|
1915 |
-
|
1916 |
-
$('#lg-zoom-out').on('click.lg', function() {
|
1917 |
-
if (_this.core.$outer.find('.lg-current .lg-image').length) {
|
1918 |
-
scale -= _this.core.s.scale;
|
1919 |
-
callScale();
|
1920 |
-
}
|
1921 |
-
});
|
1922 |
-
|
1923 |
-
$('#lg-zoom-in').on('click.lg', function() {
|
1924 |
-
if (_this.core.$outer.find('.lg-current .lg-image').length) {
|
1925 |
-
scale += _this.core.s.scale;
|
1926 |
-
callScale();
|
1927 |
-
}
|
1928 |
-
});
|
1929 |
-
|
1930 |
-
$('#lg-actual-size').on('click.lg', function(event) {
|
1931 |
-
actualSize(event, _this.core.$slide.eq(_this.core.index).find('.lg-image'), _this.core.index, true);
|
1932 |
-
});
|
1933 |
-
|
1934 |
-
// Reset zoom on slide change
|
1935 |
-
_this.core.$el.on('onBeforeSlide.lg.tm', function() {
|
1936 |
-
scale = 1;
|
1937 |
-
_this.resetZoom();
|
1938 |
-
});
|
1939 |
-
|
1940 |
-
// Drag option after zoom
|
1941 |
-
_this.zoomDrag();
|
1942 |
-
|
1943 |
-
_this.zoomSwipe();
|
1944 |
-
|
1945 |
-
};
|
1946 |
-
|
1947 |
-
// Reset zoom effect
|
1948 |
-
Zoom.prototype.resetZoom = function() {
|
1949 |
-
this.core.$outer.removeClass('lg-zoomed');
|
1950 |
-
this.core.$slide.find('.lg-img-wrap').removeAttr('style data-x data-y');
|
1951 |
-
this.core.$slide.find('.lg-image').removeAttr('style data-scale');
|
1952 |
-
|
1953 |
-
// Reset pagx pagy values to center
|
1954 |
-
this.pageX = $(window).width() / 2;
|
1955 |
-
this.pageY = ($(window).height() / 2) + $(window).scrollTop();
|
1956 |
-
};
|
1957 |
-
|
1958 |
-
Zoom.prototype.zoomSwipe = function() {
|
1959 |
-
var _this = this;
|
1960 |
-
var startCoords = {};
|
1961 |
-
var endCoords = {};
|
1962 |
-
var isMoved = false;
|
1963 |
-
|
1964 |
-
// Allow x direction drag
|
1965 |
-
var allowX = false;
|
1966 |
-
|
1967 |
-
// Allow Y direction drag
|
1968 |
-
var allowY = false;
|
1969 |
-
|
1970 |
-
_this.core.$slide.on('touchstart.lg', function(e) {
|
1971 |
-
|
1972 |
-
if (_this.core.$outer.hasClass('lg-zoomed')) {
|
1973 |
-
var $image = _this.core.$slide.eq(_this.core.index).find('.lg-object');
|
1974 |
-
|
1975 |
-
allowY = $image.prop('offsetHeight') * $image.attr('data-scale') > _this.core.$outer.find('.lg').height();
|
1976 |
-
allowX = $image.prop('offsetWidth') * $image.attr('data-scale') > _this.core.$outer.find('.lg').width();
|
1977 |
-
if ((allowX || allowY)) {
|
1978 |
-
e.preventDefault();
|
1979 |
-
startCoords = {
|
1980 |
-
x: e.originalEvent.targetTouches[0].pageX,
|
1981 |
-
y: e.originalEvent.targetTouches[0].pageY
|
1982 |
-
};
|
1983 |
-
}
|
1984 |
-
}
|
1985 |
-
|
1986 |
-
});
|
1987 |
-
|
1988 |
-
_this.core.$slide.on('touchmove.lg', function(e) {
|
1989 |
-
|
1990 |
-
if (_this.core.$outer.hasClass('lg-zoomed')) {
|
1991 |
-
|
1992 |
-
var _$el = _this.core.$slide.eq(_this.core.index).find('.lg-img-wrap');
|
1993 |
-
var distanceX;
|
1994 |
-
var distanceY;
|
1995 |
-
|
1996 |
-
e.preventDefault();
|
1997 |
-
isMoved = true;
|
1998 |
-
|
1999 |
-
endCoords = {
|
2000 |
-
x: e.originalEvent.targetTouches[0].pageX,
|
2001 |
-
y: e.originalEvent.targetTouches[0].pageY
|
2002 |
-
};
|
2003 |
-
|
2004 |
-
// reset opacity and transition duration
|
2005 |
-
_this.core.$outer.addClass('lg-zoom-dragging');
|
2006 |
-
|
2007 |
-
if (allowY) {
|
2008 |
-
distanceY = (-Math.abs(_$el.attr('data-y'))) + (endCoords.y - startCoords.y);
|
2009 |
-
} else {
|
2010 |
-
distanceY = -Math.abs(_$el.attr('data-y'));
|
2011 |
-
}
|
2012 |
-
|
2013 |
-
if (allowX) {
|
2014 |
-
distanceX = (-Math.abs(_$el.attr('data-x'))) + (endCoords.x - startCoords.x);
|
2015 |
-
} else {
|
2016 |
-
distanceX = -Math.abs(_$el.attr('data-x'));
|
2017 |
-
}
|
2018 |
-
|
2019 |
-
if ((Math.abs(endCoords.x - startCoords.x) > 15) || (Math.abs(endCoords.y - startCoords.y) > 15)) {
|
2020 |
-
|
2021 |
-
if (_this.core.s.useLeftForZoom) {
|
2022 |
-
_$el.css({
|
2023 |
-
left: distanceX + 'px',
|
2024 |
-
top: distanceY + 'px'
|
2025 |
-
});
|
2026 |
-
} else {
|
2027 |
-
_$el.css('transform', 'translate3d(' + distanceX + 'px, ' + distanceY + 'px, 0)');
|
2028 |
-
}
|
2029 |
-
}
|
2030 |
-
|
2031 |
-
}
|
2032 |
-
|
2033 |
-
});
|
2034 |
-
|
2035 |
-
_this.core.$slide.on('touchend.lg', function() {
|
2036 |
-
if (_this.core.$outer.hasClass('lg-zoomed')) {
|
2037 |
-
if (isMoved) {
|
2038 |
-
isMoved = false;
|
2039 |
-
_this.core.$outer.removeClass('lg-zoom-dragging');
|
2040 |
-
_this.touchendZoom(startCoords, endCoords, allowX, allowY);
|
2041 |
-
|
2042 |
-
}
|
2043 |
-
}
|
2044 |
-
});
|
2045 |
-
|
2046 |
-
};
|
2047 |
-
|
2048 |
-
Zoom.prototype.zoomDrag = function() {
|
2049 |
-
|
2050 |
-
var _this = this;
|
2051 |
-
var startCoords = {};
|
2052 |
-
var endCoords = {};
|
2053 |
-
var isDraging = false;
|
2054 |
-
var isMoved = false;
|
2055 |
-
|
2056 |
-
// Allow x direction drag
|
2057 |
-
var allowX = false;
|
2058 |
-
|
2059 |
-
// Allow Y direction drag
|
2060 |
-
var allowY = false;
|
2061 |
-
|
2062 |
-
_this.core.$slide.on('mousedown.lg.zoom', function(e) {
|
2063 |
-
|
2064 |
-
// execute only on .lg-object
|
2065 |
-
var $image = _this.core.$slide.eq(_this.core.index).find('.lg-object');
|
2066 |
-
|
2067 |
-
allowY = $image.prop('offsetHeight') * $image.attr('data-scale') > _this.core.$outer.find('.lg').height();
|
2068 |
-
allowX = $image.prop('offsetWidth') * $image.attr('data-scale') > _this.core.$outer.find('.lg').width();
|
2069 |
-
|
2070 |
-
if (_this.core.$outer.hasClass('lg-zoomed')) {
|
2071 |
-
if ($(e.target).hasClass('lg-object') && (allowX || allowY)) {
|
2072 |
-
e.preventDefault();
|
2073 |
-
startCoords = {
|
2074 |
-
x: e.pageX,
|
2075 |
-
y: e.pageY
|
2076 |
-
};
|
2077 |
-
|
2078 |
-
isDraging = true;
|
2079 |
-
|
2080 |
-
// ** Fix for webkit cursor issue https://code.google.com/p/chromium/issues/detail?id=26723
|
2081 |
-
_this.core.$outer.scrollLeft += 1;
|
2082 |
-
_this.core.$outer.scrollLeft -= 1;
|
2083 |
-
|
2084 |
-
_this.core.$outer.removeClass('lg-grab').addClass('lg-grabbing');
|
2085 |
-
}
|
2086 |
-
}
|
2087 |
-
});
|
2088 |
-
|
2089 |
-
$(window).on('mousemove.lg.zoom', function(e) {
|
2090 |
-
if (isDraging) {
|
2091 |
-
var _$el = _this.core.$slide.eq(_this.core.index).find('.lg-img-wrap');
|
2092 |
-
var distanceX;
|
2093 |
-
var distanceY;
|
2094 |
-
|
2095 |
-
isMoved = true;
|
2096 |
-
endCoords = {
|
2097 |
-
x: e.pageX,
|
2098 |
-
y: e.pageY
|
2099 |
-
};
|
2100 |
-
|
2101 |
-
// reset opacity and transition duration
|
2102 |
-
_this.core.$outer.addClass('lg-zoom-dragging');
|
2103 |
-
|
2104 |
-
if (allowY) {
|
2105 |
-
distanceY = (-Math.abs(_$el.attr('data-y'))) + (endCoords.y - startCoords.y);
|
2106 |
-
} else {
|
2107 |
-
distanceY = -Math.abs(_$el.attr('data-y'));
|
2108 |
-
}
|
2109 |
-
|
2110 |
-
if (allowX) {
|
2111 |
-
distanceX = (-Math.abs(_$el.attr('data-x'))) + (endCoords.x - startCoords.x);
|
2112 |
-
} else {
|
2113 |
-
distanceX = -Math.abs(_$el.attr('data-x'));
|
2114 |
-
}
|
2115 |
-
|
2116 |
-
if (_this.core.s.useLeftForZoom) {
|
2117 |
-
_$el.css({
|
2118 |
-
left: distanceX + 'px',
|
2119 |
-
top: distanceY + 'px'
|
2120 |
-
});
|
2121 |
-
} else {
|
2122 |
-
_$el.css('transform', 'translate3d(' + distanceX + 'px, ' + distanceY + 'px, 0)');
|
2123 |
-
}
|
2124 |
-
}
|
2125 |
-
});
|
2126 |
-
|
2127 |
-
$(window).on('mouseup.lg.zoom', function(e) {
|
2128 |
-
|
2129 |
-
if (isDraging) {
|
2130 |
-
isDraging = false;
|
2131 |
-
_this.core.$outer.removeClass('lg-zoom-dragging');
|
2132 |
-
|
2133 |
-
// Fix for chrome mouse move on click
|
2134 |
-
if (isMoved && ((startCoords.x !== endCoords.x) || (startCoords.y !== endCoords.y))) {
|
2135 |
-
endCoords = {
|
2136 |
-
x: e.pageX,
|
2137 |
-
y: e.pageY
|
2138 |
-
};
|
2139 |
-
_this.touchendZoom(startCoords, endCoords, allowX, allowY);
|
2140 |
-
|
2141 |
-
}
|
2142 |
-
|
2143 |
-
isMoved = false;
|
2144 |
-
}
|
2145 |
-
|
2146 |
-
_this.core.$outer.removeClass('lg-grabbing').addClass('lg-grab');
|
2147 |
-
|
2148 |
-
});
|
2149 |
-
};
|
2150 |
-
|
2151 |
-
Zoom.prototype.touchendZoom = function(startCoords, endCoords, allowX, allowY) {
|
2152 |
-
|
2153 |
-
var _this = this;
|
2154 |
-
var _$el = _this.core.$slide.eq(_this.core.index).find('.lg-img-wrap');
|
2155 |
-
var $image = _this.core.$slide.eq(_this.core.index).find('.lg-object');
|
2156 |
-
var distanceX = (-Math.abs(_$el.attr('data-x'))) + (endCoords.x - startCoords.x);
|
2157 |
-
var distanceY = (-Math.abs(_$el.attr('data-y'))) + (endCoords.y - startCoords.y);
|
2158 |
-
var minY = (_this.core.$outer.find('.lg').height() - $image.prop('offsetHeight')) / 2;
|
2159 |
-
var maxY = Math.abs(($image.prop('offsetHeight') * Math.abs($image.attr('data-scale'))) - _this.core.$outer.find('.lg').height() + minY);
|
2160 |
-
var minX = (_this.core.$outer.find('.lg').width() - $image.prop('offsetWidth')) / 2;
|
2161 |
-
var maxX = Math.abs(($image.prop('offsetWidth') * Math.abs($image.attr('data-scale'))) - _this.core.$outer.find('.lg').width() + minX);
|
2162 |
-
|
2163 |
-
if ((Math.abs(endCoords.x - startCoords.x) > 15) || (Math.abs(endCoords.y - startCoords.y) > 15)) {
|
2164 |
-
if (allowY) {
|
2165 |
-
if (distanceY <= -maxY) {
|
2166 |
-
distanceY = -maxY;
|
2167 |
-
} else if (distanceY >= -minY) {
|
2168 |
-
distanceY = -minY;
|
2169 |
-
}
|
2170 |
-
}
|
2171 |
-
|
2172 |
-
if (allowX) {
|
2173 |
-
if (distanceX <= -maxX) {
|
2174 |
-
distanceX = -maxX;
|
2175 |
-
} else if (distanceX >= -minX) {
|
2176 |
-
distanceX = -minX;
|
2177 |
-
}
|
2178 |
-
}
|
2179 |
-
|
2180 |
-
if (allowY) {
|
2181 |
-
_$el.attr('data-y', Math.abs(distanceY));
|
2182 |
-
} else {
|
2183 |
-
distanceY = -Math.abs(_$el.attr('data-y'));
|
2184 |
-
}
|
2185 |
-
|
2186 |
-
if (allowX) {
|
2187 |
-
_$el.attr('data-x', Math.abs(distanceX));
|
2188 |
-
} else {
|
2189 |
-
distanceX = -Math.abs(_$el.attr('data-x'));
|
2190 |
-
}
|
2191 |
-
|
2192 |
-
if (_this.core.s.useLeftForZoom) {
|
2193 |
-
_$el.css({
|
2194 |
-
left: distanceX + 'px',
|
2195 |
-
top: distanceY + 'px'
|
2196 |
-
});
|
2197 |
-
} else {
|
2198 |
-
_$el.css('transform', 'translate3d(' + distanceX + 'px, ' + distanceY + 'px, 0)');
|
2199 |
-
}
|
2200 |
-
|
2201 |
-
}
|
2202 |
-
};
|
2203 |
-
|
2204 |
-
Zoom.prototype.destroy = function() {
|
2205 |
-
|
2206 |
-
var _this = this;
|
2207 |
-
|
2208 |
-
// Unbind all events added by lightGallery zoom plugin
|
2209 |
-
_this.core.$el.off('.lg.zoom');
|
2210 |
-
$(window).off('.lg.zoom');
|
2211 |
-
_this.core.$slide.off('.lg.zoom');
|
2212 |
-
_this.core.$el.off('.lg.tm.zoom');
|
2213 |
-
_this.resetZoom();
|
2214 |
-
clearTimeout(_this.zoomabletimeout);
|
2215 |
-
_this.zoomabletimeout = false;
|
2216 |
-
};
|
2217 |
-
|
2218 |
-
$.fn.lightGallery.modules.zoom = Zoom;
|
2219 |
-
|
2220 |
-
})();
|
2221 |
-
|
2222 |
-
|
2223 |
-
}));
|
2224 |
-
|
2225 |
-
/*! lg-share - v1.1.0 - 2017-10-03
|
2226 |
-
* http://sachinchoolur.github.io/lightGallery
|
2227 |
-
* Copyright (c) 2017 Sachin N; Licensed GPLv3 */
|
2228 |
-
|
2229 |
-
(function (root, factory) {
|
2230 |
-
if (typeof define === 'function' && define.amd) {
|
2231 |
-
// AMD. Register as an anonymous module unless amdModuleId is set
|
2232 |
-
define(['jquery'], function (a0) {
|
2233 |
-
return (factory(a0));
|
2234 |
-
});
|
2235 |
-
} else if (typeof exports === 'object') {
|
2236 |
-
// Node. Does not work with strict CommonJS, but
|
2237 |
-
// only CommonJS-like environments that support module.exports,
|
2238 |
-
// like Node.
|
2239 |
-
module.exports = factory(require('jquery'));
|
2240 |
-
} else {
|
2241 |
-
factory(jQuery);
|
2242 |
-
}
|
2243 |
-
}(this, function ($) {
|
2244 |
-
|
2245 |
-
(function() {
|
2246 |
-
|
2247 |
-
'use strict';
|
2248 |
-
|
2249 |
-
var defaults = {
|
2250 |
-
share: true,
|
2251 |
-
facebook: true,
|
2252 |
-
facebookDropdownText: 'Facebook',
|
2253 |
-
twitter: true,
|
2254 |
-
twitterDropdownText: 'Twitter',
|
2255 |
-
googlePlus: true,
|
2256 |
-
googlePlusDropdownText: 'GooglePlus',
|
2257 |
-
pinterest: true,
|
2258 |
-
pinterestDropdownText: 'Pinterest'
|
2259 |
-
};
|
2260 |
-
|
2261 |
-
var Share = function(element) {
|
2262 |
-
|
2263 |
-
this.core = $(element).data('lightGallery');
|
2264 |
-
|
2265 |
-
this.core.s = $.extend({}, defaults, this.core.s);
|
2266 |
-
if (this.core.s.share) {
|
2267 |
-
this.init();
|
2268 |
-
}
|
2269 |
-
|
2270 |
-
return this;
|
2271 |
-
};
|
2272 |
-
|
2273 |
-
Share.prototype.init = function() {
|
2274 |
-
var _this = this;
|
2275 |
-
var shareHtml = '<span id="lg-share" class="lg-icon">' +
|
2276 |
-
'<ul class="lg-dropdown" style="position: absolute;">';
|
2277 |
-
shareHtml += _this.core.s.facebook ? '<li><a id="lg-share-facebook" target="_blank"><span class="lg-icon"></span><span class="lg-dropdown-text">' + this.core.s.facebookDropdownText + '</span></a></li>' : '';
|
2278 |
-
shareHtml += _this.core.s.twitter ? '<li><a id="lg-share-twitter" target="_blank"><span class="lg-icon"></span><span class="lg-dropdown-text">' + this.core.s.twitterDropdownText + '</span></a></li>' : '';
|
2279 |
-
shareHtml += _this.core.s.googlePlus ? '<li><a id="lg-share-googleplus" target="_blank"><span class="lg-icon"></span><span class="lg-dropdown-text">' + this.core.s.googlePlusDropdownText + '</span></a></li>' : '';
|
2280 |
-
shareHtml += _this.core.s.pinterest ? '<li><a id="lg-share-pinterest" target="_blank"><span class="lg-icon"></span><span class="lg-dropdown-text">' + this.core.s.pinterestDropdownText + '</span></a></li>' : '';
|
2281 |
-
shareHtml += '</ul></span>';
|
2282 |
-
|
2283 |
-
this.core.$outer.find('.lg-toolbar').append(shareHtml);
|
2284 |
-
this.core.$outer.find('.lg').append('<div id="lg-dropdown-overlay"></div>');
|
2285 |
-
$('#lg-share').on('click.lg', function(){
|
2286 |
-
_this.core.$outer.toggleClass('lg-dropdown-active');
|
2287 |
-
});
|
2288 |
-
|
2289 |
-
$('#lg-dropdown-overlay').on('click.lg', function(){
|
2290 |
-
_this.core.$outer.removeClass('lg-dropdown-active');
|
2291 |
-
});
|
2292 |
-
|
2293 |
-
_this.core.$el.on('onAfterSlide.lg.tm', function(event, prevIndex, index) {
|
2294 |
-
|
2295 |
-
setTimeout(function() {
|
2296 |
-
|
2297 |
-
$('#lg-share-facebook').attr('href', 'https://www.facebook.com/sharer/sharer.php?u=' + (encodeURIComponent(_this.getSahreProps(index, 'facebookShareUrl') || window.location.href)));
|
2298 |
-
|
2299 |
-
$('#lg-share-twitter').attr('href', 'https://twitter.com/intent/tweet?text=' + _this.getSahreProps(index, 'tweetText') + '&url=' + (encodeURIComponent(_this.getSahreProps(index, 'twitterShareUrl') || window.location.href)));
|
2300 |
-
|
2301 |
-
$('#lg-share-googleplus').attr('href', 'https://plus.google.com/share?url=' + (encodeURIComponent(_this.getSahreProps(index, 'googleplusShareUrl') || window.location.href)));
|
2302 |
-
|
2303 |
-
$('#lg-share-pinterest').attr('href', 'http://www.pinterest.com/pin/create/button/?url=' + (encodeURIComponent(_this.getSahreProps(index, 'pinterestShareUrl') || window.location.href)) + '&media=' + encodeURIComponent(_this.getSahreProps(index, 'src')) + '&description=' + _this.getSahreProps(index, 'pinterestText'));
|
2304 |
-
|
2305 |
-
}, 100);
|
2306 |
-
});
|
2307 |
-
};
|
2308 |
-
|
2309 |
-
Share.prototype.getSahreProps = function(index, prop){
|
2310 |
-
var shareProp = '';
|
2311 |
-
if(this.core.s.dynamic) {
|
2312 |
-
shareProp = this.core.s.dynamicEl[index][prop];
|
2313 |
-
} else {
|
2314 |
-
var _href = this.core.$items.eq(index).attr('href');
|
2315 |
-
var _prop = this.core.$items.eq(index).data(prop);
|
2316 |
-
shareProp = prop === 'src' ? _href || _prop : _prop;
|
2317 |
-
}
|
2318 |
-
return shareProp;
|
2319 |
-
};
|
2320 |
-
|
2321 |
-
Share.prototype.destroy = function() {
|
2322 |
-
|
2323 |
-
};
|
2324 |
-
|
2325 |
-
$.fn.lightGallery.modules.share = Share;
|
2326 |
-
|
2327 |
-
})();
|
2328 |
-
|
2329 |
-
|
2330 |
-
|
2331 |
-
}));
|
2332 |
-
|
2333 |
-
/*! lg-hash - v1.0.4 - 2017-12-20
|
2334 |
-
* http://sachinchoolur.github.io/lightGallery
|
2335 |
-
* Copyright (c) 2017 Sachin N; Licensed GPLv3 */
|
2336 |
-
|
2337 |
-
(function (root, factory) {
|
2338 |
-
if (typeof define === 'function' && define.amd) {
|
2339 |
-
// AMD. Register as an anonymous module unless amdModuleId is set
|
2340 |
-
define(['jquery'], function (a0) {
|
2341 |
-
return (factory(a0));
|
2342 |
-
});
|
2343 |
-
} else if (typeof exports === 'object') {
|
2344 |
-
// Node. Does not work with strict CommonJS, but
|
2345 |
-
// only CommonJS-like environments that support module.exports,
|
2346 |
-
// like Node.
|
2347 |
-
module.exports = factory(require('jquery'));
|
2348 |
-
} else {
|
2349 |
-
factory(jQuery);
|
2350 |
-
}
|
2351 |
-
}(this, function ($) {
|
2352 |
-
|
2353 |
-
(function() {
|
2354 |
-
|
2355 |
-
'use strict';
|
2356 |
-
|
2357 |
-
var defaults = {
|
2358 |
-
hash: true
|
2359 |
-
};
|
2360 |
-
|
2361 |
-
var Hash = function(element) {
|
2362 |
-
|
2363 |
-
this.core = $(element).data('lightGallery');
|
2364 |
-
|
2365 |
-
this.core.s = $.extend({}, defaults, this.core.s);
|
2366 |
-
|
2367 |
-
if (this.core.s.hash) {
|
2368 |
-
this.oldHash = window.location.hash;
|
2369 |
-
this.init();
|
2370 |
-
}
|
2371 |
-
|
2372 |
-
return this;
|
2373 |
-
};
|
2374 |
-
|
2375 |
-
Hash.prototype.init = function() {
|
2376 |
-
var _this = this;
|
2377 |
-
var _hash;
|
2378 |
-
|
2379 |
-
// Change hash value on after each slide transition
|
2380 |
-
_this.core.$el.on('onAfterSlide.lg.tm', function(event, prevIndex, index) {
|
2381 |
-
if (history.replaceState) {
|
2382 |
-
history.replaceState(null, null, window.location.pathname + window.location.search + '#lg=' + _this.core.s.galleryId + '&slide=' + index);
|
2383 |
-
} else {
|
2384 |
-
window.location.hash = 'lg=' + _this.core.s.galleryId + '&slide=' + index;
|
2385 |
-
}
|
2386 |
-
});
|
2387 |
-
|
2388 |
-
// Listen hash change and change the slide according to slide value
|
2389 |
-
$(window).on('hashchange.lg.hash', function() {
|
2390 |
-
_hash = window.location.hash;
|
2391 |
-
var _idx = parseInt(_hash.split('&slide=')[1], 10);
|
2392 |
-
|
2393 |
-
// it galleryId doesn't exist in the url close the gallery
|
2394 |
-
if ((_hash.indexOf('lg=' + _this.core.s.galleryId) > -1)) {
|
2395 |
-
_this.core.slide(_idx, false, false);
|
2396 |
-
} else if (_this.core.lGalleryOn) {
|
2397 |
-
_this.core.destroy();
|
2398 |
-
}
|
2399 |
-
|
2400 |
-
});
|
2401 |
-
};
|
2402 |
-
|
2403 |
-
Hash.prototype.destroy = function() {
|
2404 |
-
|
2405 |
-
if (!this.core.s.hash) {
|
2406 |
-
return;
|
2407 |
-
}
|
2408 |
-
|
2409 |
-
// Reset to old hash value
|
2410 |
-
if (this.oldHash && this.oldHash.indexOf('lg=' + this.core.s.galleryId) < 0) {
|
2411 |
-
if (history.replaceState) {
|
2412 |
-
history.replaceState(null, null, this.oldHash);
|
2413 |
-
} else {
|
2414 |
-
window.location.hash = this.oldHash;
|
2415 |
-
}
|
2416 |
-
} else {
|
2417 |
-
if (history.replaceState) {
|
2418 |
-
history.replaceState(null, document.title, window.location.pathname + window.location.search);
|
2419 |
-
} else {
|
2420 |
-
window.location.hash = '';
|
2421 |
-
}
|
2422 |
-
}
|
2423 |
-
|
2424 |
-
this.core.$el.off('.lg.hash');
|
2425 |
-
|
2426 |
-
};
|
2427 |
-
|
2428 |
-
$.fn.lightGallery.modules.hash = Hash;
|
2429 |
-
|
2430 |
-
})();
|
2431 |
-
|
2432 |
-
|
2433 |
-
}));
|
2434 |
-
|
2435 |
-
/*! lg-thumbnail - v1.1.0 - 2017-08-08
|
2436 |
-
* http://sachinchoolur.github.io/lightGallery
|
2437 |
-
* Copyright (c) 2017 Sachin N; Licensed GPLv3 */
|
2438 |
-
|
2439 |
-
(function (root, factory) {
|
2440 |
-
if (typeof define === 'function' && define.amd) {
|
2441 |
-
// AMD. Register as an anonymous module unless amdModuleId is set
|
2442 |
-
define(['jquery'], function (a0) {
|
2443 |
-
return (factory(a0));
|
2444 |
-
});
|
2445 |
-
} else if (typeof exports === 'object') {
|
2446 |
-
// Node. Does not work with strict CommonJS, but
|
2447 |
-
// only CommonJS-like environments that support module.exports,
|
2448 |
-
// like Node.
|
2449 |
-
module.exports = factory(require('jquery'));
|
2450 |
-
} else {
|
2451 |
-
factory(jQuery);
|
2452 |
-
}
|
2453 |
-
}(this, function ($) {
|
2454 |
-
|
2455 |
-
(function() {
|
2456 |
-
|
2457 |
-
'use strict';
|
2458 |
-
|
2459 |
-
var defaults = {
|
2460 |
-
thumbnail: true,
|
2461 |
-
|
2462 |
-
animateThumb: true,
|
2463 |
-
currentPagerPosition: 'middle',
|
2464 |
-
|
2465 |
-
thumbWidth: 100,
|
2466 |
-
thumbHeight: '80px',
|
2467 |
-
thumbContHeight: 100,
|
2468 |
-
thumbMargin: 5,
|
2469 |
-
|
2470 |
-
exThumbImage: false,
|
2471 |
-
showThumbByDefault: true,
|
2472 |
-
toogleThumb: true,
|
2473 |
-
pullCaptionUp: true,
|
2474 |
-
|
2475 |
-
enableThumbDrag: true,
|
2476 |
-
enableThumbSwipe: true,
|
2477 |
-
swipeThreshold: 50,
|
2478 |
-
|
2479 |
-
loadYoutubeThumbnail: true,
|
2480 |
-
youtubeThumbSize: 1,
|
2481 |
-
|
2482 |
-
loadVimeoThumbnail: true,
|
2483 |
-
vimeoThumbSize: 'thumbnail_small',
|
2484 |
-
|
2485 |
-
loadDailymotionThumbnail: true
|
2486 |
-
};
|
2487 |
-
|
2488 |
-
var Thumbnail = function(element) {
|
2489 |
-
|
2490 |
-
// get lightGallery core plugin data
|
2491 |
-
this.core = $(element).data('lightGallery');
|
2492 |
-
|
2493 |
-
// extend module default settings with lightGallery core settings
|
2494 |
-
this.core.s = $.extend({}, defaults, this.core.s);
|
2495 |
-
|
2496 |
-
this.$el = $(element);
|
2497 |
-
this.$thumbOuter = null;
|
2498 |
-
this.thumbOuterWidth = 0;
|
2499 |
-
this.thumbTotalWidth = (this.core.$items.length * (this.core.s.thumbWidth + this.core.s.thumbMargin));
|
2500 |
-
this.thumbIndex = this.core.index;
|
2501 |
-
|
2502 |
-
if (this.core.s.animateThumb) {
|
2503 |
-
this.core.s.thumbHeight = '100%';
|
2504 |
-
}
|
2505 |
-
|
2506 |
-
// Thumbnail animation value
|
2507 |
-
this.left = 0;
|
2508 |
-
|
2509 |
-
this.init();
|
2510 |
-
|
2511 |
-
return this;
|
2512 |
-
};
|
2513 |
-
|
2514 |
-
Thumbnail.prototype.init = function() {
|
2515 |
-
var _this = this;
|
2516 |
-
if (this.core.s.thumbnail && this.core.$items.length > 1) {
|
2517 |
-
if (this.core.s.showThumbByDefault) {
|
2518 |
-
setTimeout(function(){
|
2519 |
-
_this.core.$outer.addClass('lg-thumb-open');
|
2520 |
-
}, 700);
|
2521 |
-
}
|
2522 |
-
|
2523 |
-
if (this.core.s.pullCaptionUp) {
|
2524 |
-
this.core.$outer.addClass('lg-pull-caption-up');
|
2525 |
-
}
|
2526 |
-
|
2527 |
-
this.build();
|
2528 |
-
if (this.core.s.animateThumb && this.core.doCss()) {
|
2529 |
-
if (this.core.s.enableThumbDrag) {
|
2530 |
-
this.enableThumbDrag();
|
2531 |
-
}
|
2532 |
-
|
2533 |
-
if (this.core.s.enableThumbSwipe) {
|
2534 |
-
this.enableThumbSwipe();
|
2535 |
-
}
|
2536 |
-
|
2537 |
-
this.thumbClickable = false;
|
2538 |
-
} else {
|
2539 |
-
this.thumbClickable = true;
|
2540 |
-
}
|
2541 |
-
|
2542 |
-
this.toogle();
|
2543 |
-
this.thumbkeyPress();
|
2544 |
-
}
|
2545 |
-
};
|
2546 |
-
|
2547 |
-
Thumbnail.prototype.build = function() {
|
2548 |
-
var _this = this;
|
2549 |
-
var thumbList = '';
|
2550 |
-
var vimeoErrorThumbSize = '';
|
2551 |
-
var $thumb;
|
2552 |
-
var html = '<div class="lg-thumb-outer">' +
|
2553 |
-
'<div class="lg-thumb lg-group">' +
|
2554 |
-
'</div>' +
|
2555 |
-
'</div>';
|
2556 |
-
|
2557 |
-
switch (this.core.s.vimeoThumbSize) {
|
2558 |
-
case 'thumbnail_large':
|
2559 |
-
vimeoErrorThumbSize = '640';
|
2560 |
-
break;
|
2561 |
-
case 'thumbnail_medium':
|
2562 |
-
vimeoErrorThumbSize = '200x150';
|
2563 |
-
break;
|
2564 |
-
case 'thumbnail_small':
|
2565 |
-
vimeoErrorThumbSize = '100x75';
|
2566 |
-
}
|
2567 |
-
|
2568 |
-
_this.core.$outer.addClass('lg-has-thumb');
|
2569 |
-
|
2570 |
-
_this.core.$outer.find('.lg').append(html);
|
2571 |
-
|
2572 |
-
_this.$thumbOuter = _this.core.$outer.find('.lg-thumb-outer');
|
2573 |
-
_this.thumbOuterWidth = _this.$thumbOuter.width();
|
2574 |
-
|
2575 |
-
if (_this.core.s.animateThumb) {
|
2576 |
-
_this.core.$outer.find('.lg-thumb').css({
|
2577 |
-
width: _this.thumbTotalWidth + 'px',
|
2578 |
-
position: 'relative'
|
2579 |
-
});
|
2580 |
-
}
|
2581 |
-
|
2582 |
-
if (this.core.s.animateThumb) {
|
2583 |
-
_this.$thumbOuter.css('height', _this.core.s.thumbContHeight + 'px');
|
2584 |
-
}
|
2585 |
-
|
2586 |
-
function getThumb(src, thumb, index) {
|
2587 |
-
var isVideo = _this.core.isVideo(src, index) || {};
|
2588 |
-
var thumbImg;
|
2589 |
-
var vimeoId = '';
|
2590 |
-
|
2591 |
-
if (isVideo.youtube || isVideo.vimeo || isVideo.dailymotion) {
|
2592 |
-
if (isVideo.youtube) {
|
2593 |
-
if (_this.core.s.loadYoutubeThumbnail) {
|
2594 |
-
thumbImg = '//img.youtube.com/vi/' + isVideo.youtube[1] + '/' + _this.core.s.youtubeThumbSize + '.jpg';
|
2595 |
-
} else {
|
2596 |
-
thumbImg = thumb;
|
2597 |
-
}
|
2598 |
-
} else if (isVideo.vimeo) {
|
2599 |
-
if (_this.core.s.loadVimeoThumbnail) {
|
2600 |
-
thumbImg = '//i.vimeocdn.com/video/error_' + vimeoErrorThumbSize + '.jpg';
|
2601 |
-
vimeoId = isVideo.vimeo[1];
|
2602 |
-
} else {
|
2603 |
-
thumbImg = thumb;
|
2604 |
-
}
|
2605 |
-
} else if (isVideo.dailymotion) {
|
2606 |
-
if (_this.core.s.loadDailymotionThumbnail) {
|
2607 |
-
thumbImg = '//www.dailymotion.com/thumbnail/video/' + isVideo.dailymotion[1];
|
2608 |
-
} else {
|
2609 |
-
thumbImg = thumb;
|
2610 |
-
}
|
2611 |
-
}
|
2612 |
-
} else {
|
2613 |
-
thumbImg = thumb;
|
2614 |
-
}
|
2615 |
-
|
2616 |
-
thumbList += '<div data-vimeo-id="' + vimeoId + '" class="lg-thumb-item" style="width:' + _this.core.s.thumbWidth + 'px; height: ' + _this.core.s.thumbHeight + '; margin-right: ' + _this.core.s.thumbMargin + 'px"><img src="' + thumbImg + '" /></div>';
|
2617 |
-
vimeoId = '';
|
2618 |
-
}
|
2619 |
-
|
2620 |
-
if (_this.core.s.dynamic) {
|
2621 |
-
for (var i = 0; i < _this.core.s.dynamicEl.length; i++) {
|
2622 |
-
getThumb(_this.core.s.dynamicEl[i].src, _this.core.s.dynamicEl[i].thumb, i);
|
2623 |
-
}
|
2624 |
-
} else {
|
2625 |
-
_this.core.$items.each(function(i) {
|
2626 |
-
|
2627 |
-
if (!_this.core.s.exThumbImage) {
|
2628 |
-
getThumb($(this).attr('href') || $(this).attr('data-src'), $(this).find('img').attr('src'), i);
|
2629 |
-
} else {
|
2630 |
-
getThumb($(this).attr('href') || $(this).attr('data-src'), $(this).attr(_this.core.s.exThumbImage), i);
|
2631 |
-
}
|
2632 |
-
|
2633 |
-
});
|
2634 |
-
}
|
2635 |
-
|
2636 |
-
_this.core.$outer.find('.lg-thumb').html(thumbList);
|
2637 |
-
|
2638 |
-
$thumb = _this.core.$outer.find('.lg-thumb-item');
|
2639 |
-
|
2640 |
-
// Load vimeo thumbnails
|
2641 |
-
$thumb.each(function() {
|
2642 |
-
var $this = $(this);
|
2643 |
-
var vimeoVideoId = $this.attr('data-vimeo-id');
|
2644 |
-
|
2645 |
-
if (vimeoVideoId) {
|
2646 |
-
$.getJSON('//www.vimeo.com/api/v2/video/' + vimeoVideoId + '.json?callback=?', {
|
2647 |
-
format: 'json'
|
2648 |
-
}, function(data) {
|
2649 |
-
$this.find('img').attr('src', data[0][_this.core.s.vimeoThumbSize]);
|
2650 |
-
});
|
2651 |
-
}
|
2652 |
-
});
|
2653 |
-
|
2654 |
-
// manage active class for thumbnail
|
2655 |
-
$thumb.eq(_this.core.index).addClass('active');
|
2656 |
-
_this.core.$el.on('onBeforeSlide.lg.tm', function() {
|
2657 |
-
$thumb.removeClass('active');
|
2658 |
-
$thumb.eq(_this.core.index).addClass('active');
|
2659 |
-
});
|
2660 |
-
|
2661 |
-
$thumb.on('click.lg touchend.lg', function() {
|
2662 |
-
var _$this = $(this);
|
2663 |
-
setTimeout(function() {
|
2664 |
-
|
2665 |
-
// In IE9 and bellow touch does not support
|
2666 |
-
// Go to slide if browser does not support css transitions
|
2667 |
-
if ((_this.thumbClickable && !_this.core.lgBusy) || !_this.core.doCss()) {
|
2668 |
-
_this.core.index = _$this.index();
|
2669 |
-
_this.core.slide(_this.core.index, false, true, false);
|
2670 |
-
}
|
2671 |
-
}, 50);
|
2672 |
-
});
|
2673 |
-
|
2674 |
-
_this.core.$el.on('onBeforeSlide.lg.tm', function() {
|
2675 |
-
_this.animateThumb(_this.core.index);
|
2676 |
-
});
|
2677 |
-
|
2678 |
-
$(window).on('resize.lg.thumb orientationchange.lg.thumb', function() {
|
2679 |
-
setTimeout(function() {
|
2680 |
-
_this.animateThumb(_this.core.index);
|
2681 |
-
_this.thumbOuterWidth = _this.$thumbOuter.width();
|
2682 |
-
}, 200);
|
2683 |
-
});
|
2684 |
-
|
2685 |
-
};
|
2686 |
-
|
2687 |
-
Thumbnail.prototype.setTranslate = function(value) {
|
2688 |
-
// jQuery supports Automatic CSS prefixing since jQuery 1.8.0
|
2689 |
-
this.core.$outer.find('.lg-thumb').css({
|
2690 |
-
transform: 'translate3d(-' + (value) + 'px, 0px, 0px)'
|
2691 |
-
});
|
2692 |
-
};
|
2693 |
-
|
2694 |
-
Thumbnail.prototype.animateThumb = function(index) {
|
2695 |
-
var $thumb = this.core.$outer.find('.lg-thumb');
|
2696 |
-
if (this.core.s.animateThumb) {
|
2697 |
-
var position;
|
2698 |
-
switch (this.core.s.currentPagerPosition) {
|
2699 |
-
case 'left':
|
2700 |
-
position = 0;
|
2701 |
-
break;
|
2702 |
-
case 'middle':
|
2703 |
-
position = (this.thumbOuterWidth / 2) - (this.core.s.thumbWidth / 2);
|
2704 |
-
break;
|
2705 |
-
case 'right':
|
2706 |
-
position = this.thumbOuterWidth - this.core.s.thumbWidth;
|
2707 |
-
}
|
2708 |
-
this.left = ((this.core.s.thumbWidth + this.core.s.thumbMargin) * index - 1) - position;
|
2709 |
-
if (this.left > (this.thumbTotalWidth - this.thumbOuterWidth)) {
|
2710 |
-
this.left = this.thumbTotalWidth - this.thumbOuterWidth;
|
2711 |
-
}
|
2712 |
-
|
2713 |
-
if (this.left < 0) {
|
2714 |
-
this.left = 0;
|
2715 |
-
}
|
2716 |
-
|
2717 |
-
if (this.core.lGalleryOn) {
|
2718 |
-
if (!$thumb.hasClass('on')) {
|
2719 |
-
this.core.$outer.find('.lg-thumb').css('transition-duration', this.core.s.speed + 'ms');
|
2720 |
-
}
|
2721 |
-
|
2722 |
-
if (!this.core.doCss()) {
|
2723 |
-
$thumb.animate({
|
2724 |
-
left: -this.left + 'px'
|
2725 |
-
}, this.core.s.speed);
|
2726 |
-
}
|
2727 |
-
} else {
|
2728 |
-
if (!this.core.doCss()) {
|
2729 |
-
$thumb.css('left', -this.left + 'px');
|
2730 |
-
}
|
2731 |
-
}
|
2732 |
-
|
2733 |
-
this.setTranslate(this.left);
|
2734 |
-
|
2735 |
-
}
|
2736 |
-
};
|
2737 |
-
|
2738 |
-
// Enable thumbnail dragging and swiping
|
2739 |
-
Thumbnail.prototype.enableThumbDrag = function() {
|
2740 |
-
|
2741 |
-
var _this = this;
|
2742 |
-
var startCoords = 0;
|
2743 |
-
var endCoords = 0;
|
2744 |
-
var isDraging = false;
|
2745 |
-
var isMoved = false;
|
2746 |
-
var tempLeft = 0;
|
2747 |
-
|
2748 |
-
_this.$thumbOuter.addClass('lg-grab');
|
2749 |
-
|
2750 |
-
_this.core.$outer.find('.lg-thumb').on('mousedown.lg.thumb', function(e) {
|
2751 |
-
if (_this.thumbTotalWidth > _this.thumbOuterWidth) {
|
2752 |
-
// execute only on .lg-object
|
2753 |
-
e.preventDefault();
|
2754 |
-
startCoords = e.pageX;
|
2755 |
-
isDraging = true;
|
2756 |
-
|
2757 |
-
// ** Fix for webkit cursor issue https://code.google.com/p/chromium/issues/detail?id=26723
|
2758 |
-
_this.core.$outer.scrollLeft += 1;
|
2759 |
-
_this.core.$outer.scrollLeft -= 1;
|
2760 |
-
|
2761 |
-
// *
|
2762 |
-
_this.thumbClickable = false;
|
2763 |
-
_this.$thumbOuter.removeClass('lg-grab').addClass('lg-grabbing');
|
2764 |
-
}
|
2765 |
-
});
|
2766 |
-
|
2767 |
-
$(window).on('mousemove.lg.thumb', function(e) {
|
2768 |
-
if (isDraging) {
|
2769 |
-
tempLeft = _this.left;
|
2770 |
-
isMoved = true;
|
2771 |
-
endCoords = e.pageX;
|
2772 |
-
|
2773 |
-
_this.$thumbOuter.addClass('lg-dragging');
|
2774 |
-
|
2775 |
-
tempLeft = tempLeft - (endCoords - startCoords);
|
2776 |
-
|
2777 |
-
if (tempLeft > (_this.thumbTotalWidth - _this.thumbOuterWidth)) {
|
2778 |
-
tempLeft = _this.thumbTotalWidth - _this.thumbOuterWidth;
|
2779 |
-
}
|
2780 |
-
|
2781 |
-
if (tempLeft < 0) {
|
2782 |
-
tempLeft = 0;
|
2783 |
-
}
|
2784 |
-
|
2785 |
-
// move current slide
|
2786 |
-
_this.setTranslate(tempLeft);
|
2787 |
-
|
2788 |
-
}
|
2789 |
-
});
|
2790 |
-
|
2791 |
-
$(window).on('mouseup.lg.thumb', function() {
|
2792 |
-
if (isMoved) {
|
2793 |
-
isMoved = false;
|
2794 |
-
_this.$thumbOuter.removeClass('lg-dragging');
|
2795 |
-
|
2796 |
-
_this.left = tempLeft;
|
2797 |
-
|
2798 |
-
if (Math.abs(endCoords - startCoords) < _this.core.s.swipeThreshold) {
|
2799 |
-
_this.thumbClickable = true;
|
2800 |
-
}
|
2801 |
-
|
2802 |
-
} else {
|
2803 |
-
_this.thumbClickable = true;
|
2804 |
-
}
|
2805 |
-
|
2806 |
-
if (isDraging) {
|
2807 |
-
isDraging = false;
|
2808 |
-
_this.$thumbOuter.removeClass('lg-grabbing').addClass('lg-grab');
|
2809 |
-
}
|
2810 |
-
});
|
2811 |
-
|
2812 |
-
};
|
2813 |
-
|
2814 |
-
Thumbnail.prototype.enableThumbSwipe = function() {
|
2815 |
-
var _this = this;
|
2816 |
-
var startCoords = 0;
|
2817 |
-
var endCoords = 0;
|
2818 |
-
var isMoved = false;
|
2819 |
-
var tempLeft = 0;
|
2820 |
-
|
2821 |
-
_this.core.$outer.find('.lg-thumb').on('touchstart.lg', function(e) {
|
2822 |
-
if (_this.thumbTotalWidth > _this.thumbOuterWidth) {
|
2823 |
-
e.preventDefault();
|
2824 |
-
startCoords = e.originalEvent.targetTouches[0].pageX;
|
2825 |
-
_this.thumbClickable = false;
|
2826 |
-
}
|
2827 |
-
});
|
2828 |
-
|
2829 |
-
_this.core.$outer.find('.lg-thumb').on('touchmove.lg', function(e) {
|
2830 |
-
if (_this.thumbTotalWidth > _this.thumbOuterWidth) {
|
2831 |
-
e.preventDefault();
|
2832 |
-
endCoords = e.originalEvent.targetTouches[0].pageX;
|
2833 |
-
isMoved = true;
|
2834 |
-
|
2835 |
-
_this.$thumbOuter.addClass('lg-dragging');
|
2836 |
-
|
2837 |
-
tempLeft = _this.left;
|
2838 |
-
|
2839 |
-
tempLeft = tempLeft - (endCoords - startCoords);
|
2840 |
-
|
2841 |
-
if (tempLeft > (_this.thumbTotalWidth - _this.thumbOuterWidth)) {
|
2842 |
-
tempLeft = _this.thumbTotalWidth - _this.thumbOuterWidth;
|
2843 |
-
}
|
2844 |
-
|
2845 |
-
if (tempLeft < 0) {
|
2846 |
-
tempLeft = 0;
|
2847 |
-
}
|
2848 |
-
|
2849 |
-
// move current slide
|
2850 |
-
_this.setTranslate(tempLeft);
|
2851 |
-
|
2852 |
-
}
|
2853 |
-
});
|
2854 |
-
|
2855 |
-
_this.core.$outer.find('.lg-thumb').on('touchend.lg', function() {
|
2856 |
-
if (_this.thumbTotalWidth > _this.thumbOuterWidth) {
|
2857 |
-
|
2858 |
-
if (isMoved) {
|
2859 |
-
isMoved = false;
|
2860 |
-
_this.$thumbOuter.removeClass('lg-dragging');
|
2861 |
-
if (Math.abs(endCoords - startCoords) < _this.core.s.swipeThreshold) {
|
2862 |
-
_this.thumbClickable = true;
|
2863 |
-
}
|
2864 |
-
|
2865 |
-
_this.left = tempLeft;
|
2866 |
-
} else {
|
2867 |
-
_this.thumbClickable = true;
|
2868 |
-
}
|
2869 |
-
} else {
|
2870 |
-
_this.thumbClickable = true;
|
2871 |
-
}
|
2872 |
-
});
|
2873 |
-
|
2874 |
-
};
|
2875 |
-
|
2876 |
-
Thumbnail.prototype.toogle = function() {
|
2877 |
-
var _this = this;
|
2878 |
-
if (_this.core.s.toogleThumb) {
|
2879 |
-
_this.core.$outer.addClass('lg-can-toggle');
|
2880 |
-
_this.$thumbOuter.append('<span class="lg-toogle-thumb lg-icon"></span>');
|
2881 |
-
_this.core.$outer.find('.lg-toogle-thumb').on('click.lg', function() {
|
2882 |
-
_this.core.$outer.toggleClass('lg-thumb-open');
|
2883 |
-
});
|
2884 |
-
}
|
2885 |
-
};
|
2886 |
-
|
2887 |
-
Thumbnail.prototype.thumbkeyPress = function() {
|
2888 |
-
var _this = this;
|
2889 |
-
$(window).on('keydown.lg.thumb', function(e) {
|
2890 |
-
if (e.keyCode === 38) {
|
2891 |
-
e.preventDefault();
|
2892 |
-
_this.core.$outer.addClass('lg-thumb-open');
|
2893 |
-
} else if (e.keyCode === 40) {
|
2894 |
-
e.preventDefault();
|
2895 |
-
_this.core.$outer.removeClass('lg-thumb-open');
|
2896 |
-
}
|
2897 |
-
});
|
2898 |
-
};
|
2899 |
-
|
2900 |
-
Thumbnail.prototype.destroy = function() {
|
2901 |
-
if (this.core.s.thumbnail && this.core.$items.length > 1) {
|
2902 |
-
$(window).off('resize.lg.thumb orientationchange.lg.thumb keydown.lg.thumb');
|
2903 |
-
this.$thumbOuter.remove();
|
2904 |
-
this.core.$outer.removeClass('lg-has-thumb');
|
2905 |
-
}
|
2906 |
-
};
|
2907 |
-
|
2908 |
-
$.fn.lightGallery.modules.Thumbnail = Thumbnail;
|
2909 |
-
|
2910 |
-
})();
|
2911 |
-
|
2912 |
-
}));
|
1 |
+
/*! lightgallery - v1.6.12 - 2019-02-19
|
2 |
+
* http://sachinchoolur.github.io/lightGallery/
|
3 |
+
* Copyright (c) 2019 Sachin N; Licensed GPLv3 */
|
4 |
+
(function (root, factory) {
|
5 |
+
if (typeof define === 'function' && define.amd) {
|
6 |
+
// AMD. Register as an anonymous module unless amdModuleId is set
|
7 |
+
define(['jquery'], function (a0) {
|
8 |
+
return (factory(a0));
|
9 |
+
});
|
10 |
+
} else if (typeof module === 'object' && module.exports) {
|
11 |
+
// Node. Does not work with strict CommonJS, but
|
12 |
+
// only CommonJS-like environments that support module.exports,
|
13 |
+
// like Node.
|
14 |
+
module.exports = factory(require('jquery'));
|
15 |
+
} else {
|
16 |
+
factory(root["jQuery"]);
|
17 |
+
}
|
18 |
+
}(this, function ($) {
|
19 |
+
|
20 |
+
(function() {
|
21 |
+
'use strict';
|
22 |
+
|
23 |
+
var defaults = {
|
24 |
+
|
25 |
+
mode: 'lg-slide',
|
26 |
+
|
27 |
+
// Ex : 'ease'
|
28 |
+
cssEasing: 'ease',
|
29 |
+
|
30 |
+
//'for jquery animation'
|
31 |
+
easing: 'linear',
|
32 |
+
speed: 600,
|
33 |
+
height: '100%',
|
34 |
+
width: '100%',
|
35 |
+
addClass: '',
|
36 |
+
startClass: 'lg-start-zoom',
|
37 |
+
backdropDuration: 150,
|
38 |
+
hideBarsDelay: 6000,
|
39 |
+
|
40 |
+
useLeft: false,
|
41 |
+
|
42 |
+
closable: true,
|
43 |
+
loop: true,
|
44 |
+
escKey: true,
|
45 |
+
keyPress: true,
|
46 |
+
controls: true,
|
47 |
+
slideEndAnimatoin: true,
|
48 |
+
hideControlOnEnd: false,
|
49 |
+
mousewheel: true,
|
50 |
+
|
51 |
+
getCaptionFromTitleOrAlt: true,
|
52 |
+
|
53 |
+
// .lg-item || '.lg-sub-html'
|
54 |
+
appendSubHtmlTo: '.lg-sub-html',
|
55 |
+
|
56 |
+
subHtmlSelectorRelative: false,
|
57 |
+
|
58 |
+
/**
|
59 |
+
* @desc number of preload slides
|
60 |
+
* will exicute only after the current slide is fully loaded.
|
61 |
+
*
|
62 |
+
* @ex you clicked on 4th image and if preload = 1 then 3rd slide and 5th
|
63 |
+
* slide will be loaded in the background after the 4th slide is fully loaded..
|
64 |
+
* if preload is 2 then 2nd 3rd 5th 6th slides will be preloaded.. ... ...
|
65 |
+
*
|
66 |
+
*/
|
67 |
+
preload: 1,
|
68 |
+
showAfterLoad: true,
|
69 |
+
selector: '',
|
70 |
+
selectWithin: '',
|
71 |
+
nextHtml: '',
|
72 |
+
prevHtml: '',
|
73 |
+
|
74 |
+
// 0, 1
|
75 |
+
index: false,
|
76 |
+
|
77 |
+
iframeMaxWidth: '100%',
|
78 |
+
|
79 |
+
download: true,
|
80 |
+
counter: true,
|
81 |
+
appendCounterTo: '.lg-toolbar',
|
82 |
+
|
83 |
+
swipeThreshold: 50,
|
84 |
+
enableSwipe: true,
|
85 |
+
enableDrag: true,
|
86 |
+
|
87 |
+
dynamic: false,
|
88 |
+
dynamicEl: [],
|
89 |
+
galleryId: 1
|
90 |
+
};
|
91 |
+
|
92 |
+
function Plugin(element, options) {
|
93 |
+
|
94 |
+
// Current lightGallery element
|
95 |
+
this.el = element;
|
96 |
+
|
97 |
+
// Current jquery element
|
98 |
+
this.$el = $(element);
|
99 |
+
|
100 |
+
// lightGallery settings
|
101 |
+
this.s = $.extend({}, defaults, options);
|
102 |
+
|
103 |
+
// When using dynamic mode, ensure dynamicEl is an array
|
104 |
+
if (this.s.dynamic && this.s.dynamicEl !== 'undefined' && this.s.dynamicEl.constructor === Array && !this.s.dynamicEl.length) {
|
105 |
+
throw ('When using dynamic mode, you must also define dynamicEl as an Array.');
|
106 |
+
}
|
107 |
+
|
108 |
+
// lightGallery modules
|
109 |
+
this.modules = {};
|
110 |
+
|
111 |
+
// false when lightgallery complete first slide;
|
112 |
+
this.lGalleryOn = false;
|
113 |
+
|
114 |
+
this.lgBusy = false;
|
115 |
+
|
116 |
+
// Timeout function for hiding controls;
|
117 |
+
this.hideBartimeout = false;
|
118 |
+
|
119 |
+
// To determine browser supports for touch events;
|
120 |
+
this.isTouch = ('ontouchstart' in document.documentElement);
|
121 |
+
|
122 |
+
// Disable hideControlOnEnd if sildeEndAnimation is true
|
123 |
+
if (this.s.slideEndAnimatoin) {
|
124 |
+
this.s.hideControlOnEnd = false;
|
125 |
+
}
|
126 |
+
|
127 |
+
// Gallery items
|
128 |
+
if (this.s.dynamic) {
|
129 |
+
this.$items = this.s.dynamicEl;
|
130 |
+
} else {
|
131 |
+
if (this.s.selector === 'this') {
|
132 |
+
this.$items = this.$el;
|
133 |
+
} else if (this.s.selector !== '') {
|
134 |
+
if (this.s.selectWithin) {
|
135 |
+
this.$items = $(this.s.selectWithin).find(this.s.selector);
|
136 |
+
} else {
|
137 |
+
this.$items = this.$el.find($(this.s.selector));
|
138 |
+
}
|
139 |
+
} else {
|
140 |
+
this.$items = this.$el.children();
|
141 |
+
}
|
142 |
+
}
|
143 |
+
|
144 |
+
// .lg-item
|
145 |
+
this.$slide = '';
|
146 |
+
|
147 |
+
// .lg-outer
|
148 |
+
this.$outer = '';
|
149 |
+
|
150 |
+
this.init();
|
151 |
+
|
152 |
+
return this;
|
153 |
+
}
|
154 |
+
|
155 |
+
Plugin.prototype.init = function() {
|
156 |
+
|
157 |
+
var _this = this;
|
158 |
+
|
159 |
+
// s.preload should not be more than $item.length
|
160 |
+
if (_this.s.preload > _this.$items.length) {
|
161 |
+
_this.s.preload = _this.$items.length;
|
162 |
+
}
|
163 |
+
|
164 |
+
// if dynamic option is enabled execute immediately
|
165 |
+
var _hash = window.location.hash;
|
166 |
+
if (_hash.indexOf('lg=' + this.s.galleryId) > 0) {
|
167 |
+
|
168 |
+
_this.index = parseInt(_hash.split('&slide=')[1], 10);
|
169 |
+
|
170 |
+
$('body').addClass('lg-from-hash');
|
171 |
+
if (!$('body').hasClass('lg-on')) {
|
172 |
+
setTimeout(function() {
|
173 |
+
_this.build(_this.index);
|
174 |
+
});
|
175 |
+
|
176 |
+
$('body').addClass('lg-on');
|
177 |
+
}
|
178 |
+
}
|
179 |
+
|
180 |
+
if (_this.s.dynamic) {
|
181 |
+
|
182 |
+
_this.$el.trigger('onBeforeOpen.lg');
|
183 |
+
|
184 |
+
_this.index = _this.s.index || 0;
|
185 |
+
|
186 |
+
// prevent accidental double execution
|
187 |
+
if (!$('body').hasClass('lg-on')) {
|
188 |
+
setTimeout(function() {
|
189 |
+
_this.build(_this.index);
|
190 |
+
$('body').addClass('lg-on');
|
191 |
+
});
|
192 |
+
}
|
193 |
+
} else {
|
194 |
+
|
195 |
+
// Using different namespace for click because click event should not unbind if selector is same object('this')
|
196 |
+
_this.$items.on('click.lgcustom', function(event) {
|
197 |
+
|
198 |
+
// For IE8
|
199 |
+
try {
|
200 |
+
event.preventDefault();
|
201 |
+
event.preventDefault();
|
202 |
+
} catch (er) {
|
203 |
+
event.returnValue = false;
|
204 |
+
}
|
205 |
+
|
206 |
+
_this.$el.trigger('onBeforeOpen.lg');
|
207 |
+
|
208 |
+
_this.index = _this.s.index || _this.$items.index(this);
|
209 |
+
|
210 |
+
// prevent accidental double execution
|
211 |
+
if (!$('body').hasClass('lg-on')) {
|
212 |
+
_this.build(_this.index);
|
213 |
+
$('body').addClass('lg-on');
|
214 |
+
}
|
215 |
+
});
|
216 |
+
}
|
217 |
+
|
218 |
+
};
|
219 |
+
|
220 |
+
Plugin.prototype.build = function(index) {
|
221 |
+
|
222 |
+
var _this = this;
|
223 |
+
|
224 |
+
_this.structure();
|
225 |
+
|
226 |
+
// module constructor
|
227 |
+
$.each($.fn.lightGallery.modules, function(key) {
|
228 |
+
_this.modules[key] = new $.fn.lightGallery.modules[key](_this.el);
|
229 |
+
});
|
230 |
+
|
231 |
+
// initiate slide function
|
232 |
+
_this.slide(index, false, false, false);
|
233 |
+
|
234 |
+
if (_this.s.keyPress) {
|
235 |
+
_this.keyPress();
|
236 |
+
}
|
237 |
+
|
238 |
+
if (_this.$items.length > 1) {
|
239 |
+
|
240 |
+
_this.arrow();
|
241 |
+
|
242 |
+
setTimeout(function() {
|
243 |
+
_this.enableDrag();
|
244 |
+
_this.enableSwipe();
|
245 |
+
}, 50);
|
246 |
+
|
247 |
+
if (_this.s.mousewheel) {
|
248 |
+
_this.mousewheel();
|
249 |
+
}
|
250 |
+
} else {
|
251 |
+
_this.$slide.on('click.lg', function() {
|
252 |
+
_this.$el.trigger('onSlideClick.lg');
|
253 |
+
});
|
254 |
+
}
|
255 |
+
|
256 |
+
_this.counter();
|
257 |
+
|
258 |
+
_this.closeGallery();
|
259 |
+
|
260 |
+
_this.$el.trigger('onAfterOpen.lg');
|
261 |
+
|
262 |
+
// Hide controllers if mouse doesn't move for some period
|
263 |
+
_this.$outer.on('mousemove.lg click.lg touchstart.lg', function() {
|
264 |
+
|
265 |
+
_this.$outer.removeClass('lg-hide-items');
|
266 |
+
|
267 |
+
clearTimeout(_this.hideBartimeout);
|
268 |
+
|
269 |
+
// Timeout will be cleared on each slide movement also
|
270 |
+
_this.hideBartimeout = setTimeout(function() {
|
271 |
+
_this.$outer.addClass('lg-hide-items');
|
272 |
+
}, _this.s.hideBarsDelay);
|
273 |
+
|
274 |
+
});
|
275 |
+
|
276 |
+
_this.$outer.trigger('mousemove.lg');
|
277 |
+
|
278 |
+
};
|
279 |
+
|
280 |
+
Plugin.prototype.structure = function() {
|
281 |
+
var list = '';
|
282 |
+
var controls = '';
|
283 |
+
var i = 0;
|
284 |
+
var subHtmlCont = '';
|
285 |
+
var template;
|
286 |
+
var _this = this;
|
287 |
+
|
288 |
+
$('body').append('<div class="lg-backdrop"></div>');
|
289 |
+
$('.lg-backdrop').css('transition-duration', this.s.backdropDuration + 'ms');
|
290 |
+
|
291 |
+
// Create gallery items
|
292 |
+
for (i = 0; i < this.$items.length; i++) {
|
293 |
+
list += '<div class="lg-item"></div>';
|
294 |
+
}
|
295 |
+
|
296 |
+
// Create controlls
|
297 |
+
if (this.s.controls && this.$items.length > 1) {
|
298 |
+
controls = '<div class="lg-actions">' +
|
299 |
+
'<button class="lg-prev lg-icon">' + this.s.prevHtml + '</button>' +
|
300 |
+
'<button class="lg-next lg-icon">' + this.s.nextHtml + '</button>' +
|
301 |
+
'</div>';
|
302 |
+
}
|
303 |
+
|
304 |
+
if (this.s.appendSubHtmlTo === '.lg-sub-html') {
|
305 |
+
subHtmlCont = '<div class="lg-sub-html"></div>';
|
306 |
+
}
|
307 |
+
|
308 |
+
template = '<div class="lg-outer ' + this.s.addClass + ' ' + this.s.startClass + '">' +
|
309 |
+
'<div class="lg" style="width:' + this.s.width + '; height:' + this.s.height + '">' +
|
310 |
+
'<div class="lg-inner">' + list + '</div>' +
|
311 |
+
'<div class="lg-toolbar lg-group">' +
|
312 |
+
'<span class="lg-close lg-icon"></span>' +
|
313 |
+
'</div>' +
|
314 |
+
controls +
|
315 |
+
subHtmlCont +
|
316 |
+
'</div>' +
|
317 |
+
'</div>';
|
318 |
+
|
319 |
+
$('body').append(template);
|
320 |
+
this.$outer = $('.lg-outer');
|
321 |
+
this.$slide = this.$outer.find('.lg-item');
|
322 |
+
|
323 |
+
if (this.s.useLeft) {
|
324 |
+
this.$outer.addClass('lg-use-left');
|
325 |
+
|
326 |
+
// Set mode lg-slide if use left is true;
|
327 |
+
this.s.mode = 'lg-slide';
|
328 |
+
} else {
|
329 |
+
this.$outer.addClass('lg-use-css3');
|
330 |
+
}
|
331 |
+
|
332 |
+
// For fixed height gallery
|
333 |
+
_this.setTop();
|
334 |
+
$(window).on('resize.lg orientationchange.lg', function() {
|
335 |
+
setTimeout(function() {
|
336 |
+
_this.setTop();
|
337 |
+
}, 100);
|
338 |
+
});
|
339 |
+
|
340 |
+
// add class lg-current to remove initial transition
|
341 |
+
this.$slide.eq(this.index).addClass('lg-current');
|
342 |
+
|
343 |
+
// add Class for css support and transition mode
|
344 |
+
if (this.doCss()) {
|
345 |
+
this.$outer.addClass('lg-css3');
|
346 |
+
} else {
|
347 |
+
this.$outer.addClass('lg-css');
|
348 |
+
|
349 |
+
// Set speed 0 because no animation will happen if browser doesn't support css3
|
350 |
+
this.s.speed = 0;
|
351 |
+
}
|
352 |
+
|
353 |
+
this.$outer.addClass(this.s.mode);
|
354 |
+
|
355 |
+
if (this.s.enableDrag && this.$items.length > 1) {
|
356 |
+
this.$outer.addClass('lg-grab');
|
357 |
+
}
|
358 |
+
|
359 |
+
if (this.s.showAfterLoad) {
|
360 |
+
this.$outer.addClass('lg-show-after-load');
|
361 |
+
}
|
362 |
+
|
363 |
+
if (this.doCss()) {
|
364 |
+
var $inner = this.$outer.find('.lg-inner');
|
365 |
+
$inner.css('transition-timing-function', this.s.cssEasing);
|
366 |
+
$inner.css('transition-duration', this.s.speed + 'ms');
|
367 |
+
}
|
368 |
+
|
369 |
+
setTimeout(function() {
|
370 |
+
$('.lg-backdrop').addClass('in');
|
371 |
+
});
|
372 |
+
|
373 |
+
setTimeout(function() {
|
374 |
+
_this.$outer.addClass('lg-visible');
|
375 |
+
}, this.s.backdropDuration);
|
376 |
+
|
377 |
+
if (this.s.download) {
|
378 |
+
this.$outer.find('.lg-toolbar').append('<a id="lg-download" target="_blank" download class="lg-download lg-icon"></a>');
|
379 |
+
}
|
380 |
+
|
381 |
+
// Store the current scroll top value to scroll back after closing the gallery..
|
382 |
+
this.prevScrollTop = $(window).scrollTop();
|
383 |
+
|
384 |
+
};
|
385 |
+
|
386 |
+
// For fixed height gallery
|
387 |
+
Plugin.prototype.setTop = function() {
|
388 |
+
if (this.s.height !== '100%') {
|
389 |
+
var wH = $(window).height();
|
390 |
+
var top = (wH - parseInt(this.s.height, 10)) / 2;
|
391 |
+
var $lGallery = this.$outer.find('.lg');
|
392 |
+
if (wH >= parseInt(this.s.height, 10)) {
|
393 |
+
$lGallery.css('top', top + 'px');
|
394 |
+
} else {
|
395 |
+
$lGallery.css('top', '0px');
|
396 |
+
}
|
397 |
+
}
|
398 |
+
};
|
399 |
+
|
400 |
+
// Find css3 support
|
401 |
+
Plugin.prototype.doCss = function() {
|
402 |
+
// check for css animation support
|
403 |
+
var support = function() {
|
404 |
+
var transition = ['transition', 'MozTransition', 'WebkitTransition', 'OTransition', 'msTransition', 'KhtmlTransition'];
|
405 |
+
var root = document.documentElement;
|
406 |
+
var i = 0;
|
407 |
+
for (i = 0; i < transition.length; i++) {
|
408 |
+
if (transition[i] in root.style) {
|
409 |
+
return true;
|
410 |
+
}
|
411 |
+
}
|
412 |
+
};
|
413 |
+
|
414 |
+
if (support()) {
|
415 |
+
return true;
|
416 |
+
}
|
417 |
+
|
418 |
+
return false;
|
419 |
+
};
|
420 |
+
|
421 |
+
/**
|
422 |
+
* @desc Check the given src is video
|
423 |
+
* @param {String} src
|
424 |
+
* @return {Object} video type
|
425 |
+
* Ex:{ youtube : ["//www.youtube.com/watch?v=c0asJgSyxcY", "c0asJgSyxcY"] }
|
426 |
+
*/
|
427 |
+
Plugin.prototype.isVideo = function(src, index) {
|
428 |
+
|
429 |
+
var html;
|
430 |
+
if (this.s.dynamic) {
|
431 |
+
html = this.s.dynamicEl[index].html;
|
432 |
+
} else {
|
433 |
+
html = this.$items.eq(index).attr('data-html');
|
434 |
+
}
|
435 |
+
|
436 |
+
if (!src) {
|
437 |
+
if(html) {
|
438 |
+
return {
|
439 |
+
html5: true
|
440 |
+
};
|
441 |
+
} else {
|
442 |
+
console.error('lightGallery :- data-src is not pvovided on slide item ' + (index + 1) + '. Please make sure the selector property is properly configured. More info - http://sachinchoolur.github.io/lightGallery/demos/html-markup.html');
|
443 |
+
return false;
|
444 |
+
}
|
445 |
+
}
|
446 |
+
|
447 |
+
var youtube = src.match(/\/\/(?:www\.)?youtu(?:\.be|be\.com|be-nocookie\.com)\/(?:watch\?v=|embed\/)?([a-z0-9\-\_\%]+)/i);
|
448 |
+
var vimeo = src.match(/\/\/(?:www\.)?vimeo.com\/([0-9a-z\-_]+)/i);
|
449 |
+
var dailymotion = src.match(/\/\/(?:www\.)?dai.ly\/([0-9a-z\-_]+)/i);
|
450 |
+
var vk = src.match(/\/\/(?:www\.)?(?:vk\.com|vkontakte\.ru)\/(?:video_ext\.php\?)(.*)/i);
|
451 |
+
|
452 |
+
if (youtube) {
|
453 |
+
return {
|
454 |
+
youtube: youtube
|
455 |
+
};
|
456 |
+
} else if (vimeo) {
|
457 |
+
return {
|
458 |
+
vimeo: vimeo
|
459 |
+
};
|
460 |
+
} else if (dailymotion) {
|
461 |
+
return {
|
462 |
+
dailymotion: dailymotion
|
463 |
+
};
|
464 |
+
} else if (vk) {
|
465 |
+
return {
|
466 |
+
vk: vk
|
467 |
+
};
|
468 |
+
}
|
469 |
+
};
|
470 |
+
|
471 |
+
/**
|
472 |
+
* @desc Create image counter
|
473 |
+
* Ex: 1/10
|
474 |
+
*/
|
475 |
+
Plugin.prototype.counter = function() {
|
476 |
+
if (this.s.counter) {
|
477 |
+
$(this.s.appendCounterTo).append('<div id="lg-counter"><span id="lg-counter-current">' + (parseInt(this.index, 10) + 1) + '</span> / <span id="lg-counter-all">' + this.$items.length + '</span></div>');
|
478 |
+
}
|
479 |
+
};
|
480 |
+
|
481 |
+
/**
|
482 |
+
* @desc add sub-html into the slide
|
483 |
+
* @param {Number} index - index of the slide
|
484 |
+
*/
|
485 |
+
Plugin.prototype.addHtml = function(index) {
|
486 |
+
var subHtml = null;
|
487 |
+
var subHtmlUrl;
|
488 |
+
var $currentEle;
|
489 |
+
if (this.s.dynamic) {
|
490 |
+
if (this.s.dynamicEl[index].subHtmlUrl) {
|
491 |
+
subHtmlUrl = this.s.dynamicEl[index].subHtmlUrl;
|
492 |
+
} else {
|
493 |
+
subHtml = this.s.dynamicEl[index].subHtml;
|
494 |
+
}
|
495 |
+
} else {
|
496 |
+
$currentEle = this.$items.eq(index);
|
497 |
+
if ($currentEle.attr('data-sub-html-url')) {
|
498 |
+
subHtmlUrl = $currentEle.attr('data-sub-html-url');
|
499 |
+
} else {
|
500 |
+
subHtml = $currentEle.attr('data-sub-html');
|
501 |
+
if (this.s.getCaptionFromTitleOrAlt && !subHtml) {
|
502 |
+
subHtml = $currentEle.attr('title') || $currentEle.find('img').first().attr('alt');
|
503 |
+
}
|
504 |
+
}
|
505 |
+
}
|
506 |
+
|
507 |
+
if (!subHtmlUrl) {
|
508 |
+
if (typeof subHtml !== 'undefined' && subHtml !== null) {
|
509 |
+
|
510 |
+
// get first letter of subhtml
|
511 |
+
// if first letter starts with . or # get the html form the jQuery object
|
512 |
+
var fL = subHtml.substring(0, 1);
|
513 |
+
if (fL === '.' || fL === '#') {
|
514 |
+
if (this.s.subHtmlSelectorRelative && !this.s.dynamic) {
|
515 |
+
subHtml = $currentEle.find(subHtml).html();
|
516 |
+
} else {
|
517 |
+
subHtml = $(subHtml).html();
|
518 |
+
}
|
519 |
+
}
|
520 |
+
} else {
|
521 |
+
subHtml = '';
|
522 |
+
}
|
523 |
+
}
|
524 |
+
|
525 |
+
if (this.s.appendSubHtmlTo === '.lg-sub-html') {
|
526 |
+
|
527 |
+
if (subHtmlUrl) {
|
528 |
+
this.$outer.find(this.s.appendSubHtmlTo).load(subHtmlUrl);
|
529 |
+
} else {
|
530 |
+
this.$outer.find(this.s.appendSubHtmlTo).html(subHtml);
|
531 |
+
}
|
532 |
+
|
533 |
+
} else {
|
534 |
+
|
535 |
+
if (subHtmlUrl) {
|
536 |
+
this.$slide.eq(index).load(subHtmlUrl);
|
537 |
+
} else {
|
538 |
+
this.$slide.eq(index).append(subHtml);
|
539 |
+
}
|
540 |
+
}
|
541 |
+
|
542 |
+
// Add lg-empty-html class if title doesn't exist
|
543 |
+
if (typeof subHtml !== 'undefined' && subHtml !== null) {
|
544 |
+
if (subHtml === '') {
|
545 |
+
this.$outer.find(this.s.appendSubHtmlTo).addClass('lg-empty-html');
|
546 |
+
} else {
|
547 |
+
this.$outer.find(this.s.appendSubHtmlTo).removeClass('lg-empty-html');
|
548 |
+
}
|
549 |
+
}
|
550 |
+
|
551 |
+
this.$el.trigger('onAfterAppendSubHtml.lg', [index]);
|
552 |
+
};
|
553 |
+
|
554 |
+
/**
|
555 |
+
* @desc Preload slides
|
556 |
+
* @param {Number} index - index of the slide
|
557 |
+
*/
|
558 |
+
Plugin.prototype.preload = function(index) {
|
559 |
+
var i = 1;
|
560 |
+
var j = 1;
|
561 |
+
for (i = 1; i <= this.s.preload; i++) {
|
562 |
+
if (i >= this.$items.length - index) {
|
563 |
+
break;
|
564 |
+
}
|
565 |
+
|
566 |
+
this.loadContent(index + i, false, 0);
|
567 |
+
}
|
568 |
+
|
569 |
+
for (j = 1; j <= this.s.preload; j++) {
|
570 |
+
if (index - j < 0) {
|
571 |
+
break;
|
572 |
+
}
|
573 |
+
|
574 |
+
this.loadContent(index - j, false, 0);
|
575 |
+
}
|
576 |
+
};
|
577 |
+
|
578 |
+
/**
|
579 |
+
* @desc Load slide content into slide.
|
580 |
+
* @param {Number} index - index of the slide.
|
581 |
+
* @param {Boolean} rec - if true call loadcontent() function again.
|
582 |
+
* @param {Boolean} delay - delay for adding complete class. it is 0 except first time.
|
583 |
+
*/
|
584 |
+
Plugin.prototype.loadContent = function(index, rec, delay) {
|
585 |
+
|
586 |
+
var _this = this;
|
587 |
+
var _hasPoster = false;
|
588 |
+
var _$img;
|
589 |
+
var _src;
|
590 |
+
var _poster;
|
591 |
+
var _srcset;
|
592 |
+
var _sizes;
|
593 |
+
var _html;
|
594 |
+
var getResponsiveSrc = function(srcItms) {
|
595 |
+
var rsWidth = [];
|
596 |
+
var rsSrc = [];
|
597 |
+
for (var i = 0; i < srcItms.length; i++) {
|
598 |
+
var __src = srcItms[i].split(' ');
|
599 |
+
|
600 |
+
// Manage empty space
|
601 |
+
if (__src[0] === '') {
|
602 |
+
__src.splice(0, 1);
|
603 |
+
}
|
604 |
+
|
605 |
+
rsSrc.push(__src[0]);
|
606 |
+
rsWidth.push(__src[1]);
|
607 |
+
}
|
608 |
+
|
609 |
+
var wWidth = $(window).width();
|
610 |
+
for (var j = 0; j < rsWidth.length; j++) {
|
611 |
+
if (parseInt(rsWidth[j], 10) > wWidth) {
|
612 |
+
_src = rsSrc[j];
|
613 |
+
break;
|
614 |
+
}
|
615 |
+
}
|
616 |
+
};
|
617 |
+
|
618 |
+
if (_this.s.dynamic) {
|
619 |
+
|
620 |
+
if (_this.s.dynamicEl[index].poster) {
|
621 |
+
_hasPoster = true;
|
622 |
+
_poster = _this.s.dynamicEl[index].poster;
|
623 |
+
}
|
624 |
+
|
625 |
+
_html = _this.s.dynamicEl[index].html;
|
626 |
+
_src = _this.s.dynamicEl[index].src;
|
627 |
+
|
628 |
+
if (_this.s.dynamicEl[index].responsive) {
|
629 |
+
var srcDyItms = _this.s.dynamicEl[index].responsive.split(',');
|
630 |
+
getResponsiveSrc(srcDyItms);
|
631 |
+
}
|
632 |
+
|
633 |
+
_srcset = _this.s.dynamicEl[index].srcset;
|
634 |
+
_sizes = _this.s.dynamicEl[index].sizes;
|
635 |
+
|
636 |
+
} else {
|
637 |
+
|
638 |
+
if (_this.$items.eq(index).attr('data-poster')) {
|
639 |
+
_hasPoster = true;
|
640 |
+
_poster = _this.$items.eq(index).attr('data-poster');
|
641 |
+
}
|
642 |
+
|
643 |
+
_html = _this.$items.eq(index).attr('data-html');
|
644 |
+
_src = _this.$items.eq(index).attr('href') || _this.$items.eq(index).attr('data-src');
|
645 |
+
|
646 |
+
if (_this.$items.eq(index).attr('data-responsive')) {
|
647 |
+
var srcItms = _this.$items.eq(index).attr('data-responsive').split(',');
|
648 |
+
getResponsiveSrc(srcItms);
|
649 |
+
}
|
650 |
+
|
651 |
+
_srcset = _this.$items.eq(index).attr('data-srcset');
|
652 |
+
_sizes = _this.$items.eq(index).attr('data-sizes');
|
653 |
+
|
654 |
+
}
|
655 |
+
|
656 |
+
//if (_src || _srcset || _sizes || _poster) {
|
657 |
+
|
658 |
+
var iframe = false;
|
659 |
+
if (_this.s.dynamic) {
|
660 |
+
if (_this.s.dynamicEl[index].iframe) {
|
661 |
+
iframe = true;
|
662 |
+
}
|
663 |
+
} else {
|
664 |
+
if (_this.$items.eq(index).attr('data-iframe') === 'true') {
|
665 |
+
iframe = true;
|
666 |
+
}
|
667 |
+
}
|
668 |
+
|
669 |
+
var _isVideo = _this.isVideo(_src, index);
|
670 |
+
if (!_this.$slide.eq(index).hasClass('lg-loaded')) {
|
671 |
+
if (iframe) {
|
672 |
+
_this.$slide.eq(index).prepend('<div class="lg-video-cont lg-has-iframe" style="max-width:' + _this.s.iframeMaxWidth + '"><div class="lg-video"><iframe class="lg-object" frameborder="0" src="' + _src + '" allowfullscreen="true"></iframe></div></div>');
|
673 |
+
} else if (_hasPoster) {
|
674 |
+
var videoClass = '';
|
675 |
+
if (_isVideo && _isVideo.youtube) {
|
676 |
+
videoClass = 'lg-has-youtube';
|
677 |
+
} else if (_isVideo && _isVideo.vimeo) {
|
678 |
+
videoClass = 'lg-has-vimeo';
|
679 |
+
} else {
|
680 |
+
videoClass = 'lg-has-html5';
|
681 |
+
}
|
682 |
+
|
683 |
+
_this.$slide.eq(index).prepend('<div class="lg-video-cont ' + videoClass + ' "><div class="lg-video"><span class="lg-video-play"></span><img class="lg-object lg-has-poster" src="' + _poster + '" /></div></div>');
|
684 |
+
|
685 |
+
} else if (_isVideo) {
|
686 |
+
_this.$slide.eq(index).prepend('<div class="lg-video-cont "><div class="lg-video"></div></div>');
|
687 |
+
_this.$el.trigger('hasVideo.lg', [index, _src, _html]);
|
688 |
+
} else {
|
689 |
+
_this.$slide.eq(index).prepend('<div class="lg-img-wrap"><img class="lg-object lg-image" src="' + _src + '" /></div>');
|
690 |
+
}
|
691 |
+
|
692 |
+
_this.$el.trigger('onAferAppendSlide.lg', [index]);
|
693 |
+
|
694 |
+
_$img = _this.$slide.eq(index).find('.lg-object');
|
695 |
+
if (_sizes) {
|
696 |
+
_$img.attr('sizes', _sizes);
|
697 |
+
}
|
698 |
+
|
699 |
+
if (_srcset) {
|
700 |
+
_$img.attr('srcset', _srcset);
|
701 |
+
try {
|
702 |
+
picturefill({
|
703 |
+
elements: [_$img[0]]
|
704 |
+
});
|
705 |
+
} catch (e) {
|
706 |
+
console.warn('lightGallery :- If you want srcset to be supported for older browser please include picturefil version 2 javascript library in your document.');
|
707 |
+
}
|
708 |
+
}
|
709 |
+
|
710 |
+
if (this.s.appendSubHtmlTo !== '.lg-sub-html') {
|
711 |
+
_this.addHtml(index);
|
712 |
+
}
|
713 |
+
|
714 |
+
_this.$slide.eq(index).addClass('lg-loaded');
|
715 |
+
}
|
716 |
+
|
717 |
+
_this.$slide.eq(index).find('.lg-object').on('load.lg error.lg', function() {
|
718 |
+
|
719 |
+
// For first time add some delay for displaying the start animation.
|
720 |
+
var _speed = 0;
|
721 |
+
|
722 |
+
// Do not change the delay value because it is required for zoom plugin.
|
723 |
+
// If gallery opened from direct url (hash) speed value should be 0
|
724 |
+
if (delay && !$('body').hasClass('lg-from-hash')) {
|
725 |
+
_speed = delay;
|
726 |
+
}
|
727 |
+
|
728 |
+
setTimeout(function() {
|
729 |
+
_this.$slide.eq(index).addClass('lg-complete');
|
730 |
+
_this.$el.trigger('onSlideItemLoad.lg', [index, delay || 0]);
|
731 |
+
}, _speed);
|
732 |
+
|
733 |
+
});
|
734 |
+
|
735 |
+
// @todo check load state for html5 videos
|
736 |
+
if (_isVideo && _isVideo.html5 && !_hasPoster) {
|
737 |
+
_this.$slide.eq(index).addClass('lg-complete');
|
738 |
+
}
|
739 |
+
|
740 |
+
if (rec === true) {
|
741 |
+
if (!_this.$slide.eq(index).hasClass('lg-complete')) {
|
742 |
+
_this.$slide.eq(index).find('.lg-object').on('load.lg error.lg', function() {
|
743 |
+
_this.preload(index);
|
744 |
+
});
|
745 |
+
} else {
|
746 |
+
_this.preload(index);
|
747 |
+
}
|
748 |
+
}
|
749 |
+
|
750 |
+
//}
|
751 |
+
};
|
752 |
+
|
753 |
+
/**
|
754 |
+
* @desc slide function for lightgallery
|
755 |
+
** Slide() gets call on start
|
756 |
+
** ** Set lg.on true once slide() function gets called.
|
757 |
+
** Call loadContent() on slide() function inside setTimeout
|
758 |
+
** ** On first slide we do not want any animation like slide of fade
|
759 |
+
** ** So on first slide( if lg.on if false that is first slide) loadContent() should start loading immediately
|
760 |
+
** ** Else loadContent() should wait for the transition to complete.
|
761 |
+
** ** So set timeout s.speed + 50
|
762 |
+
<=> ** loadContent() will load slide content in to the particular slide
|
763 |
+
** ** It has recursion (rec) parameter. if rec === true loadContent() will call preload() function.
|
764 |
+
** ** preload will execute only when the previous slide is fully loaded (images iframe)
|
765 |
+
** ** avoid simultaneous image load
|
766 |
+
<=> ** Preload() will check for s.preload value and call loadContent() again accoring to preload value
|
767 |
+
** loadContent() <====> Preload();
|
768 |
+
|
769 |
+
* @param {Number} index - index of the slide
|
770 |
+
* @param {Boolean} fromTouch - true if slide function called via touch event or mouse drag
|
771 |
+
* @param {Boolean} fromThumb - true if slide function called via thumbnail click
|
772 |
+
* @param {String} direction - Direction of the slide(next/prev)
|
773 |
+
*/
|
774 |
+
Plugin.prototype.slide = function(index, fromTouch, fromThumb, direction) {
|
775 |
+
|
776 |
+
var _prevIndex = this.$outer.find('.lg-current').index();
|
777 |
+
var _this = this;
|
778 |
+
|
779 |
+
// Prevent if multiple call
|
780 |
+
// Required for hsh plugin
|
781 |
+
if (_this.lGalleryOn && (_prevIndex === index)) {
|
782 |
+
return;
|
783 |
+
}
|
784 |
+
|
785 |
+
var _length = this.$slide.length;
|
786 |
+
var _time = _this.lGalleryOn ? this.s.speed : 0;
|
787 |
+
|
788 |
+
if (!_this.lgBusy) {
|
789 |
+
|
790 |
+
if (this.s.download) {
|
791 |
+
var _src;
|
792 |
+
if (_this.s.dynamic) {
|
793 |
+
_src = _this.s.dynamicEl[index].downloadUrl !== false && (_this.s.dynamicEl[index].downloadUrl || _this.s.dynamicEl[index].src);
|
794 |
+
} else {
|
795 |
+
_src = _this.$items.eq(index).attr('data-download-url') !== 'false' && (_this.$items.eq(index).attr('data-download-url') || _this.$items.eq(index).attr('href') || _this.$items.eq(index).attr('data-src'));
|
796 |
+
|
797 |
+
}
|
798 |
+
|
799 |
+
if (_src) {
|
800 |
+
$('#lg-download').attr('href', _src);
|
801 |
+
_this.$outer.removeClass('lg-hide-download');
|
802 |
+
} else {
|
803 |
+
_this.$outer.addClass('lg-hide-download');
|
804 |
+
}
|
805 |
+
}
|
806 |
+
|
807 |
+
this.$el.trigger('onBeforeSlide.lg', [_prevIndex, index, fromTouch, fromThumb]);
|
808 |
+
|
809 |
+
_this.lgBusy = true;
|
810 |
+
|
811 |
+
clearTimeout(_this.hideBartimeout);
|
812 |
+
|
813 |
+
// Add title if this.s.appendSubHtmlTo === lg-sub-html
|
814 |
+
if (this.s.appendSubHtmlTo === '.lg-sub-html') {
|
815 |
+
|
816 |
+
// wait for slide animation to complete
|
817 |
+
setTimeout(function() {
|
818 |
+
_this.addHtml(index);
|
819 |
+
}, _time);
|
820 |
+
}
|
821 |
+
|
822 |
+
this.arrowDisable(index);
|
823 |
+
|
824 |
+
if (!direction) {
|
825 |
+
if (index < _prevIndex) {
|
826 |
+
direction = 'prev';
|
827 |
+
} else if (index > _prevIndex) {
|
828 |
+
direction = 'next';
|
829 |
+
}
|
830 |
+
}
|
831 |
+
|
832 |
+
if (!fromTouch) {
|
833 |
+
|
834 |
+
// remove all transitions
|
835 |
+
_this.$outer.addClass('lg-no-trans');
|
836 |
+
|
837 |
+
this.$slide.removeClass('lg-prev-slide lg-next-slide');
|
838 |
+
|
839 |
+
if (direction === 'prev') {
|
840 |
+
|
841 |
+
//prevslide
|
842 |
+
this.$slide.eq(index).addClass('lg-prev-slide');
|
843 |
+
this.$slide.eq(_prevIndex).addClass('lg-next-slide');
|
844 |
+
} else {
|
845 |
+
|
846 |
+
// next slide
|
847 |
+
this.$slide.eq(index).addClass('lg-next-slide');
|
848 |
+
this.$slide.eq(_prevIndex).addClass('lg-prev-slide');
|
849 |
+
}
|
850 |
+
|
851 |
+
// give 50 ms for browser to add/remove class
|
852 |
+
setTimeout(function() {
|
853 |
+
_this.$slide.removeClass('lg-current');
|
854 |
+
|
855 |
+
//_this.$slide.eq(_prevIndex).removeClass('lg-current');
|
856 |
+
_this.$slide.eq(index).addClass('lg-current');
|
857 |
+
|
858 |
+
// reset all transitions
|
859 |
+
_this.$outer.removeClass('lg-no-trans');
|
860 |
+
}, 50);
|
861 |
+
} else {
|
862 |
+
|
863 |
+
this.$slide.removeClass('lg-prev-slide lg-current lg-next-slide');
|
864 |
+
var touchPrev;
|
865 |
+
var touchNext;
|
866 |
+
if (_length > 2) {
|
867 |
+
touchPrev = index - 1;
|
868 |
+
touchNext = index + 1;
|
869 |
+
|
870 |
+
if ((index === 0) && (_prevIndex === _length - 1)) {
|
871 |
+
|
872 |
+
// next slide
|
873 |
+
touchNext = 0;
|
874 |
+
touchPrev = _length - 1;
|
875 |
+
} else if ((index === _length - 1) && (_prevIndex === 0)) {
|
876 |
+
|
877 |
+
// prev slide
|
878 |
+
touchNext = 0;
|
879 |
+
touchPrev = _length - 1;
|
880 |
+
}
|
881 |
+
|
882 |
+
} else {
|
883 |
+
touchPrev = 0;
|
884 |
+
touchNext = 1;
|
885 |
+
}
|
886 |
+
|
887 |
+
if (direction === 'prev') {
|
888 |
+
_this.$slide.eq(touchNext).addClass('lg-next-slide');
|
889 |
+
} else {
|
890 |
+
_this.$slide.eq(touchPrev).addClass('lg-prev-slide');
|
891 |
+
}
|
892 |
+
|
893 |
+
_this.$slide.eq(index).addClass('lg-current');
|
894 |
+
}
|
895 |
+
|
896 |
+
if (_this.lGalleryOn) {
|
897 |
+
setTimeout(function() {
|
898 |
+
_this.loadContent(index, true, 0);
|
899 |
+
}, this.s.speed + 50);
|
900 |
+
|
901 |
+
setTimeout(function() {
|
902 |
+
_this.lgBusy = false;
|
903 |
+
_this.$el.trigger('onAfterSlide.lg', [_prevIndex, index, fromTouch, fromThumb]);
|
904 |
+
}, this.s.speed);
|
905 |
+
|
906 |
+
} else {
|
907 |
+
_this.loadContent(index, true, _this.s.backdropDuration);
|
908 |
+
|
909 |
+
_this.lgBusy = false;
|
910 |
+
_this.$el.trigger('onAfterSlide.lg', [_prevIndex, index, fromTouch, fromThumb]);
|
911 |
+
}
|
912 |
+
|
913 |
+
_this.lGalleryOn = true;
|
914 |
+
|
915 |
+
if (this.s.counter) {
|
916 |
+
$('#lg-counter-current').text(index + 1);
|
917 |
+
}
|
918 |
+
|
919 |
+
}
|
920 |
+
_this.index = index;
|
921 |
+
|
922 |
+
};
|
923 |
+
|
924 |
+
/**
|
925 |
+
* @desc Go to next slide
|
926 |
+
* @param {Boolean} fromTouch - true if slide function called via touch event
|
927 |
+
*/
|
928 |
+
Plugin.prototype.goToNextSlide = function(fromTouch) {
|
929 |
+
var _this = this;
|
930 |
+
var _loop = _this.s.loop;
|
931 |
+
if (fromTouch && _this.$slide.length < 3) {
|
932 |
+
_loop = false;
|
933 |
+
}
|
934 |
+
|
935 |
+
if (!_this.lgBusy) {
|
936 |
+
if ((_this.index + 1) < _this.$slide.length) {
|
937 |
+
_this.index++;
|
938 |
+
_this.$el.trigger('onBeforeNextSlide.lg', [_this.index]);
|
939 |
+
_this.slide(_this.index, fromTouch, false, 'next');
|
940 |
+
} else {
|
941 |
+
if (_loop) {
|
942 |
+
_this.index = 0;
|
943 |
+
_this.$el.trigger('onBeforeNextSlide.lg', [_this.index]);
|
944 |
+
_this.slide(_this.index, fromTouch, false, 'next');
|
945 |
+
} else if (_this.s.slideEndAnimatoin && !fromTouch) {
|
946 |
+
_this.$outer.addClass('lg-right-end');
|
947 |
+
setTimeout(function() {
|
948 |
+
_this.$outer.removeClass('lg-right-end');
|
949 |
+
}, 400);
|
950 |
+
}
|
951 |
+
}
|
952 |
+
}
|
953 |
+
};
|
954 |
+
|
955 |
+
/**
|
956 |
+
* @desc Go to previous slide
|
957 |
+
* @param {Boolean} fromTouch - true if slide function called via touch event
|
958 |
+
*/
|
959 |
+
Plugin.prototype.goToPrevSlide = function(fromTouch) {
|
960 |
+
var _this = this;
|
961 |
+
var _loop = _this.s.loop;
|
962 |
+
if (fromTouch && _this.$slide.length < 3) {
|
963 |
+
_loop = false;
|
964 |
+
}
|
965 |
+
|
966 |
+
if (!_this.lgBusy) {
|
967 |
+
if (_this.index > 0) {
|
968 |
+
_this.index--;
|
969 |
+
_this.$el.trigger('onBeforePrevSlide.lg', [_this.index, fromTouch]);
|
970 |
+
_this.slide(_this.index, fromTouch, false, 'prev');
|
971 |
+
} else {
|
972 |
+
if (_loop) {
|
973 |
+
_this.index = _this.$items.length - 1;
|
974 |
+
_this.$el.trigger('onBeforePrevSlide.lg', [_this.index, fromTouch]);
|
975 |
+
_this.slide(_this.index, fromTouch, false, 'prev');
|
976 |
+
} else if (_this.s.slideEndAnimatoin && !fromTouch) {
|
977 |
+
_this.$outer.addClass('lg-left-end');
|
978 |
+
setTimeout(function() {
|
979 |
+
_this.$outer.removeClass('lg-left-end');
|
980 |
+
}, 400);
|
981 |
+
}
|
982 |
+
}
|
983 |
+
}
|
984 |
+
};
|
985 |
+
|
986 |
+
Plugin.prototype.keyPress = function() {
|
987 |
+
var _this = this;
|
988 |
+
if (this.$items.length > 1) {
|
989 |
+
$(window).on('keyup.lg', function(e) {
|
990 |
+
if (_this.$items.length > 1) {
|
991 |
+
if (e.keyCode === 37) {
|
992 |
+
e.preventDefault();
|
993 |
+
_this.goToPrevSlide();
|
994 |
+
}
|
995 |
+
|
996 |
+
if (e.keyCode === 39) {
|
997 |
+
e.preventDefault();
|
998 |
+
_this.goToNextSlide();
|
999 |
+
}
|
1000 |
+
}
|
1001 |
+
});
|
1002 |
+
}
|
1003 |
+
|
1004 |
+
$(window).on('keydown.lg', function(e) {
|
1005 |
+
if (_this.s.escKey === true && e.keyCode === 27) {
|
1006 |
+
e.preventDefault();
|
1007 |
+
if (!_this.$outer.hasClass('lg-thumb-open')) {
|
1008 |
+
_this.destroy();
|
1009 |
+
} else {
|
1010 |
+
_this.$outer.removeClass('lg-thumb-open');
|
1011 |
+
}
|
1012 |
+
}
|
1013 |
+
});
|
1014 |
+
};
|
1015 |
+
|
1016 |
+
Plugin.prototype.arrow = function() {
|
1017 |
+
var _this = this;
|
1018 |
+
this.$outer.find('.lg-prev').on('click.lg', function() {
|
1019 |
+
_this.goToPrevSlide();
|
1020 |
+
});
|
1021 |
+
|
1022 |
+
this.$outer.find('.lg-next').on('click.lg', function() {
|
1023 |
+
_this.goToNextSlide();
|
1024 |
+
});
|
1025 |
+
};
|
1026 |
+
|
1027 |
+
Plugin.prototype.arrowDisable = function(index) {
|
1028 |
+
|
1029 |
+
// Disable arrows if s.hideControlOnEnd is true
|
1030 |
+
if (!this.s.loop && this.s.hideControlOnEnd) {
|
1031 |
+
if ((index + 1) < this.$slide.length) {
|
1032 |
+
this.$outer.find('.lg-next').removeAttr('disabled').removeClass('disabled');
|
1033 |
+
} else {
|
1034 |
+
this.$outer.find('.lg-next').attr('disabled', 'disabled').addClass('disabled');
|
1035 |
+
}
|
1036 |
+
|
1037 |
+
if (index > 0) {
|
1038 |
+
this.$outer.find('.lg-prev').removeAttr('disabled').removeClass('disabled');
|
1039 |
+
} else {
|
1040 |
+
this.$outer.find('.lg-prev').attr('disabled', 'disabled').addClass('disabled');
|
1041 |
+
}
|
1042 |
+
}
|
1043 |
+
};
|
1044 |
+
|
1045 |
+
Plugin.prototype.setTranslate = function($el, xValue, yValue) {
|
1046 |
+
// jQuery supports Automatic CSS prefixing since jQuery 1.8.0
|
1047 |
+
if (this.s.useLeft) {
|
1048 |
+
$el.css('left', xValue);
|
1049 |
+
} else {
|
1050 |
+
$el.css({
|
1051 |
+
transform: 'translate3d(' + (xValue) + 'px, ' + yValue + 'px, 0px)'
|
1052 |
+
});
|
1053 |
+
}
|
1054 |
+
};
|
1055 |
+
|
1056 |
+
Plugin.prototype.touchMove = function(startCoords, endCoords) {
|
1057 |
+
|
1058 |
+
var distance = endCoords - startCoords;
|
1059 |
+
|
1060 |
+
if (Math.abs(distance) > 15) {
|
1061 |
+
// reset opacity and transition duration
|
1062 |
+
this.$outer.addClass('lg-dragging');
|
1063 |
+
|
1064 |
+
// move current slide
|
1065 |
+
this.setTranslate(this.$slide.eq(this.index), distance, 0);
|
1066 |
+
|
1067 |
+
// move next and prev slide with current slide
|
1068 |
+
this.setTranslate($('.lg-prev-slide'), -this.$slide.eq(this.index).width() + distance, 0);
|
1069 |
+
this.setTranslate($('.lg-next-slide'), this.$slide.eq(this.index).width() + distance, 0);
|
1070 |
+
}
|
1071 |
+
};
|
1072 |
+
|
1073 |
+
Plugin.prototype.touchEnd = function(distance) {
|
1074 |
+
var _this = this;
|
1075 |
+
|
1076 |
+
// keep slide animation for any mode while dragg/swipe
|
1077 |
+
if (_this.s.mode !== 'lg-slide') {
|
1078 |
+
_this.$outer.addClass('lg-slide');
|
1079 |
+
}
|
1080 |
+
|
1081 |
+
this.$slide.not('.lg-current, .lg-prev-slide, .lg-next-slide').css('opacity', '0');
|
1082 |
+
|
1083 |
+
// set transition duration
|
1084 |
+
setTimeout(function() {
|
1085 |
+
_this.$outer.removeClass('lg-dragging');
|
1086 |
+
if ((distance < 0) && (Math.abs(distance) > _this.s.swipeThreshold)) {
|
1087 |
+
_this.goToNextSlide(true);
|
1088 |
+
} else if ((distance > 0) && (Math.abs(distance) > _this.s.swipeThreshold)) {
|
1089 |
+
_this.goToPrevSlide(true);
|
1090 |
+
} else if (Math.abs(distance) < 5) {
|
1091 |
+
|
1092 |
+
// Trigger click if distance is less than 5 pix
|
1093 |
+
_this.$el.trigger('onSlideClick.lg');
|
1094 |
+
}
|
1095 |
+
|
1096 |
+
_this.$slide.removeAttr('style');
|
1097 |
+
});
|
1098 |
+
|
1099 |
+
// remove slide class once drag/swipe is completed if mode is not slide
|
1100 |
+
setTimeout(function() {
|
1101 |
+
if (!_this.$outer.hasClass('lg-dragging') && _this.s.mode !== 'lg-slide') {
|
1102 |
+
_this.$outer.removeClass('lg-slide');
|
1103 |
+
}
|
1104 |
+
}, _this.s.speed + 100);
|
1105 |
+
|
1106 |
+
};
|
1107 |
+
|
1108 |
+
Plugin.prototype.enableSwipe = function() {
|
1109 |
+
var _this = this;
|
1110 |
+
var startCoords = 0;
|
1111 |
+
var endCoords = 0;
|
1112 |
+
var isMoved = false;
|
1113 |
+
|
1114 |
+
if (_this.s.enableSwipe && _this.doCss()) {
|
1115 |
+
|
1116 |
+
_this.$slide.on('touchstart.lg', function(e) {
|
1117 |
+
if (!_this.$outer.hasClass('lg-zoomed') && !_this.lgBusy) {
|
1118 |
+
e.preventDefault();
|
1119 |
+
_this.manageSwipeClass();
|
1120 |
+
startCoords = e.originalEvent.targetTouches[0].pageX;
|
1121 |
+
}
|
1122 |
+
});
|
1123 |
+
|
1124 |
+
_this.$slide.on('touchmove.lg', function(e) {
|
1125 |
+
if (!_this.$outer.hasClass('lg-zoomed')) {
|
1126 |
+
e.preventDefault();
|
1127 |
+
endCoords = e.originalEvent.targetTouches[0].pageX;
|
1128 |
+
_this.touchMove(startCoords, endCoords);
|
1129 |
+
isMoved = true;
|
1130 |
+
}
|
1131 |
+
});
|
1132 |
+
|
1133 |
+
_this.$slide.on('touchend.lg', function() {
|
1134 |
+
if (!_this.$outer.hasClass('lg-zoomed')) {
|
1135 |
+
if (isMoved) {
|
1136 |
+
isMoved = false;
|
1137 |
+
_this.touchEnd(endCoords - startCoords);
|
1138 |
+
} else {
|
1139 |
+
_this.$el.trigger('onSlideClick.lg');
|
1140 |
+
}
|
1141 |
+
}
|
1142 |
+
});
|
1143 |
+
}
|
1144 |
+
|
1145 |
+
};
|
1146 |
+
|
1147 |
+
Plugin.prototype.enableDrag = function() {
|
1148 |
+
var _this = this;
|
1149 |
+
var startCoords = 0;
|
1150 |
+
var endCoords = 0;
|
1151 |
+
var isDraging = false;
|
1152 |
+
var isMoved = false;
|
1153 |
+
if (_this.s.enableDrag && _this.doCss()) {
|
1154 |
+
_this.$slide.on('mousedown.lg', function(e) {
|
1155 |
+
if (!_this.$outer.hasClass('lg-zoomed') && !_this.lgBusy && !$(e.target).text().trim()) {
|
1156 |
+
e.preventDefault();
|
1157 |
+
_this.manageSwipeClass();
|
1158 |
+
startCoords = e.pageX;
|
1159 |
+
isDraging = true;
|
1160 |
+
|
1161 |
+
// ** Fix for webkit cursor issue https://code.google.com/p/chromium/issues/detail?id=26723
|
1162 |
+
_this.$outer.scrollLeft += 1;
|
1163 |
+
_this.$outer.scrollLeft -= 1;
|
1164 |
+
|
1165 |
+
// *
|
1166 |
+
|
1167 |
+
_this.$outer.removeClass('lg-grab').addClass('lg-grabbing');
|
1168 |
+
|
1169 |
+
_this.$el.trigger('onDragstart.lg');
|
1170 |
+
}
|
1171 |
+
});
|
1172 |
+
|
1173 |
+
$(window).on('mousemove.lg', function(e) {
|
1174 |
+
if (isDraging) {
|
1175 |
+
isMoved = true;
|
1176 |
+
endCoords = e.pageX;
|
1177 |
+
_this.touchMove(startCoords, endCoords);
|
1178 |
+
_this.$el.trigger('onDragmove.lg');
|
1179 |
+
}
|
1180 |
+
});
|
1181 |
+
|
1182 |
+
$(window).on('mouseup.lg', function(e) {
|
1183 |
+
if (isMoved) {
|
1184 |
+
isMoved = false;
|
1185 |
+
_this.touchEnd(endCoords - startCoords);
|
1186 |
+
_this.$el.trigger('onDragend.lg');
|
1187 |
+
} else if ($(e.target).hasClass('lg-object') || $(e.target).hasClass('lg-video-play')) {
|
1188 |
+
_this.$el.trigger('onSlideClick.lg');
|
1189 |
+
}
|
1190 |
+
|
1191 |
+
// Prevent execution on click
|
1192 |
+
if (isDraging) {
|
1193 |
+
isDraging = false;
|
1194 |
+
_this.$outer.removeClass('lg-grabbing').addClass('lg-grab');
|
1195 |
+
}
|
1196 |
+
});
|
1197 |
+
|
1198 |
+
}
|
1199 |
+
};
|
1200 |
+
|
1201 |
+
Plugin.prototype.manageSwipeClass = function() {
|
1202 |
+
var _touchNext = this.index + 1;
|
1203 |
+
var _touchPrev = this.index - 1;
|
1204 |
+
if (this.s.loop && this.$slide.length > 2) {
|
1205 |
+
if (this.index === 0) {
|
1206 |
+
_touchPrev = this.$slide.length - 1;
|
1207 |
+
} else if (this.index === this.$slide.length - 1) {
|
1208 |
+
_touchNext = 0;
|
1209 |
+
}
|
1210 |
+
}
|
1211 |
+
|
1212 |
+
this.$slide.removeClass('lg-next-slide lg-prev-slide');
|
1213 |
+
if (_touchPrev > -1) {
|
1214 |
+
this.$slide.eq(_touchPrev).addClass('lg-prev-slide');
|
1215 |
+
}
|
1216 |
+
|
1217 |
+
this.$slide.eq(_touchNext).addClass('lg-next-slide');
|
1218 |
+
};
|
1219 |
+
|
1220 |
+
Plugin.prototype.mousewheel = function() {
|
1221 |
+
var _this = this;
|
1222 |
+
_this.$outer.on('mousewheel.lg', function(e) {
|
1223 |
+
|
1224 |
+
if (!e.deltaY) {
|
1225 |
+
return;
|
1226 |
+
}
|
1227 |
+
|
1228 |
+
if (e.deltaY > 0) {
|
1229 |
+
_this.goToPrevSlide();
|
1230 |
+
} else {
|
1231 |
+
_this.goToNextSlide();
|
1232 |
+
}
|
1233 |
+
|
1234 |
+
e.preventDefault();
|
1235 |
+
});
|
1236 |
+
|
1237 |
+
};
|
1238 |
+
|
1239 |
+
Plugin.prototype.closeGallery = function() {
|
1240 |
+
|
1241 |
+
var _this = this;
|
1242 |
+
var mousedown = false;
|
1243 |
+
this.$outer.find('.lg-close').on('click.lg', function() {
|
1244 |
+
_this.destroy();
|
1245 |
+
});
|
1246 |
+
|
1247 |
+
if (_this.s.closable) {
|
1248 |
+
|
1249 |
+
// If you drag the slide and release outside gallery gets close on chrome
|
1250 |
+
// for preventing this check mousedown and mouseup happened on .lg-item or lg-outer
|
1251 |
+
_this.$outer.on('mousedown.lg', function(e) {
|
1252 |
+
|
1253 |
+
if ($(e.target).is('.lg-outer') || $(e.target).is('.lg-item ') || $(e.target).is('.lg-img-wrap')) {
|
1254 |
+
mousedown = true;
|
1255 |
+
} else {
|
1256 |
+
mousedown = false;
|
1257 |
+
}
|
1258 |
+
|
1259 |
+
});
|
1260 |
+
|
1261 |
+
_this.$outer.on('mousemove.lg', function() {
|
1262 |
+
mousedown = false;
|
1263 |
+
});
|
1264 |
+
|
1265 |
+
_this.$outer.on('mouseup.lg', function(e) {
|
1266 |
+
|
1267 |
+
if ($(e.target).is('.lg-outer') || $(e.target).is('.lg-item ') || $(e.target).is('.lg-img-wrap') && mousedown) {
|
1268 |
+
if (!_this.$outer.hasClass('lg-dragging')) {
|
1269 |
+
_this.destroy();
|
1270 |
+
}
|
1271 |
+
}
|
1272 |
+
|
1273 |
+
});
|
1274 |
+
|
1275 |
+
}
|
1276 |
+
|
1277 |
+
};
|
1278 |
+
|
1279 |
+
Plugin.prototype.destroy = function(d) {
|
1280 |
+
|
1281 |
+
var _this = this;
|
1282 |
+
|
1283 |
+
if (!d) {
|
1284 |
+
_this.$el.trigger('onBeforeClose.lg');
|
1285 |
+
$(window).scrollTop(_this.prevScrollTop);
|
1286 |
+
}
|
1287 |
+
|
1288 |
+
|
1289 |
+
/**
|
1290 |
+
* if d is false or undefined destroy will only close the gallery
|
1291 |
+
* plugins instance remains with the element
|
1292 |
+
*
|
1293 |
+
* if d is true destroy will completely remove the plugin
|
1294 |
+
*/
|
1295 |
+
|
1296 |
+
if (d) {
|
1297 |
+
if (!_this.s.dynamic) {
|
1298 |
+
// only when not using dynamic mode is $items a jquery collection
|
1299 |
+
this.$items.off('click.lg click.lgcustom');
|
1300 |
+
}
|
1301 |
+
|
1302 |
+
$.removeData(_this.el, 'lightGallery');
|
1303 |
+
}
|
1304 |
+
|
1305 |
+
// Unbind all events added by lightGallery
|
1306 |
+
this.$el.off('.lg.tm');
|
1307 |
+
|
1308 |
+
// Distroy all lightGallery modules
|
1309 |
+
$.each($.fn.lightGallery.modules, function(key) {
|
1310 |
+
if (_this.modules[key]) {
|
1311 |
+
_this.modules[key].destroy();
|
1312 |
+
}
|
1313 |
+
});
|
1314 |
+
|
1315 |
+
this.lGalleryOn = false;
|
1316 |
+
|
1317 |
+
clearTimeout(_this.hideBartimeout);
|
1318 |
+
this.hideBartimeout = false;
|
1319 |
+
$(window).off('.lg');
|
1320 |
+
$('body').removeClass('lg-on lg-from-hash');
|
1321 |
+
|
1322 |
+
if (_this.$outer) {
|
1323 |
+
_this.$outer.removeClass('lg-visible');
|
1324 |
+
}
|
1325 |
+
|
1326 |
+
$('.lg-backdrop').removeClass('in');
|
1327 |
+
|
1328 |
+
setTimeout(function() {
|
1329 |
+
if (_this.$outer) {
|
1330 |
+
_this.$outer.remove();
|
1331 |
+
}
|
1332 |
+
|
1333 |
+
$('.lg-backdrop').remove();
|
1334 |
+
|
1335 |
+
if (!d) {
|
1336 |
+
_this.$el.trigger('onCloseAfter.lg');
|
1337 |
+
}
|
1338 |
+
|
1339 |
+
}, _this.s.backdropDuration + 50);
|
1340 |
+
};
|
1341 |
+
|
1342 |
+
$.fn.lightGallery = function(options) {
|
1343 |
+
return this.each(function() {
|
1344 |
+
if (!$.data(this, 'lightGallery')) {
|
1345 |
+
$.data(this, 'lightGallery', new Plugin(this, options));
|
1346 |
+
} else {
|
1347 |
+
try {
|
1348 |
+
$(this).data('lightGallery').init();
|
1349 |
+
} catch (err) {
|
1350 |
+
console.error('lightGallery has not initiated properly');
|
1351 |
+
}
|
1352 |
+
}
|
1353 |
+
});
|
1354 |
+
};
|
1355 |
+
|
1356 |
+
$.fn.lightGallery.modules = {};
|
1357 |
+
|
1358 |
+
})();
|
1359 |
+
|
1360 |
+
|
1361 |
+
}));
|
1362 |
+
|
1363 |
+
/*! lg-autoplay - v1.0.4 - 2017-03-28
|
1364 |
+
* http://sachinchoolur.github.io/lightGallery
|
1365 |
+
* Copyright (c) 2017 Sachin N; Licensed GPLv3 */
|
1366 |
+
|
1367 |
+
(function (root, factory) {
|
1368 |
+
if (typeof define === 'function' && define.amd) {
|
1369 |
+
// AMD. Register as an anonymous module unless amdModuleId is set
|
1370 |
+
define(['jquery'], function (a0) {
|
1371 |
+
return (factory(a0));
|
1372 |
+
});
|
1373 |
+
} else if (typeof exports === 'object') {
|
1374 |
+
// Node. Does not work with strict CommonJS, but
|
1375 |
+
// only CommonJS-like environments that support module.exports,
|
1376 |
+
// like Node.
|
1377 |
+
module.exports = factory(require('jquery'));
|
1378 |
+
} else {
|
1379 |
+
factory(jQuery);
|
1380 |
+
}
|
1381 |
+
}(this, function ($) {
|
1382 |
+
|
1383 |
+
|
1384 |
+
(function() {
|
1385 |
+
|
1386 |
+
'use strict';
|
1387 |
+
|
1388 |
+
var defaults = {
|
1389 |
+
autoplay: false,
|
1390 |
+
pause: 5000,
|
1391 |
+
progressBar: true,
|
1392 |
+
fourceAutoplay: false,
|
1393 |
+
autoplayControls: true,
|
1394 |
+
appendAutoplayControlsTo: '.lg-toolbar'
|
1395 |
+
};
|
1396 |
+
|
1397 |
+
/**
|
1398 |
+
* Creates the autoplay plugin.
|
1399 |
+
* @param {object} element - lightGallery element
|
1400 |
+
*/
|
1401 |
+
var Autoplay = function(element) {
|
1402 |
+
|
1403 |
+
this.core = $(element).data('lightGallery');
|
1404 |
+
|
1405 |
+
this.$el = $(element);
|
1406 |
+
|
1407 |
+
// Execute only if items are above 1
|
1408 |
+
if (this.core.$items.length < 2) {
|
1409 |
+
return false;
|
1410 |
+
}
|
1411 |
+
|
1412 |
+
this.core.s = $.extend({}, defaults, this.core.s);
|
1413 |
+
this.interval = false;
|
1414 |
+
|
1415 |
+
// Identify if slide happened from autoplay
|
1416 |
+
this.fromAuto = true;
|
1417 |
+
|
1418 |
+
// Identify if autoplay canceled from touch/drag
|
1419 |
+
this.canceledOnTouch = false;
|
1420 |
+
|
1421 |
+
// save fourceautoplay value
|
1422 |
+
this.fourceAutoplayTemp = this.core.s.fourceAutoplay;
|
1423 |
+
|
1424 |
+
// do not allow progress bar if browser does not support css3 transitions
|
1425 |
+
if (!this.core.doCss()) {
|
1426 |
+
this.core.s.progressBar = false;
|
1427 |
+
}
|
1428 |
+
|
1429 |
+
this.init();
|
1430 |
+
|
1431 |
+
return this;
|
1432 |
+
};
|
1433 |
+
|
1434 |
+
Autoplay.prototype.init = function() {
|
1435 |
+
var _this = this;
|
1436 |
+
|
1437 |
+
// append autoplay controls
|
1438 |
+
if (_this.core.s.autoplayControls) {
|
1439 |
+
_this.controls();
|
1440 |
+
}
|
1441 |
+
|
1442 |
+
// Create progress bar
|
1443 |
+
if (_this.core.s.progressBar) {
|
1444 |
+
_this.core.$outer.find('.lg').append('<div class="lg-progress-bar"><div class="lg-progress"></div></div>');
|
1445 |
+
}
|
1446 |
+
|
1447 |
+
// set progress
|
1448 |
+
_this.progress();
|
1449 |
+
|
1450 |
+
// Start autoplay
|
1451 |
+
if (_this.core.s.autoplay) {
|
1452 |
+
_this.$el.one('onSlideItemLoad.lg.tm', function() {
|
1453 |
+
_this.startlAuto();
|
1454 |
+
});
|
1455 |
+
}
|
1456 |
+
|
1457 |
+
// cancel interval on touchstart and dragstart
|
1458 |
+
_this.$el.on('onDragstart.lg.tm touchstart.lg.tm', function() {
|
1459 |
+
if (_this.interval) {
|
1460 |
+
_this.cancelAuto();
|
1461 |
+
_this.canceledOnTouch = true;
|
1462 |
+
}
|
1463 |
+
});
|
1464 |
+
|
1465 |
+
// restore autoplay if autoplay canceled from touchstart / dragstart
|
1466 |
+
_this.$el.on('onDragend.lg.tm touchend.lg.tm onSlideClick.lg.tm', function() {
|
1467 |
+
if (!_this.interval && _this.canceledOnTouch) {
|
1468 |
+
_this.startlAuto();
|
1469 |
+
_this.canceledOnTouch = false;
|
1470 |
+
}
|
1471 |
+
});
|
1472 |
+
|
1473 |
+
};
|
1474 |
+
|
1475 |
+
Autoplay.prototype.progress = function() {
|
1476 |
+
|
1477 |
+
var _this = this;
|
1478 |
+
var _$progressBar;
|
1479 |
+
var _$progress;
|
1480 |
+
|
1481 |
+
_this.$el.on('onBeforeSlide.lg.tm', function() {
|
1482 |
+
|
1483 |
+
// start progress bar animation
|
1484 |
+
if (_this.core.s.progressBar && _this.fromAuto) {
|
1485 |
+
_$progressBar = _this.core.$outer.find('.lg-progress-bar');
|
1486 |
+
_$progress = _this.core.$outer.find('.lg-progress');
|
1487 |
+
if (_this.interval) {
|
1488 |
+
_$progress.removeAttr('style');
|
1489 |
+
_$progressBar.removeClass('lg-start');
|
1490 |
+
setTimeout(function() {
|
1491 |
+
_$progress.css('transition', 'width ' + (_this.core.s.speed + _this.core.s.pause) + 'ms ease 0s');
|
1492 |
+
_$progressBar.addClass('lg-start');
|
1493 |
+
}, 20);
|
1494 |
+
}
|
1495 |
+
}
|
1496 |
+
|
1497 |
+
// Remove setinterval if slide is triggered manually and fourceautoplay is false
|
1498 |
+
if (!_this.fromAuto && !_this.core.s.fourceAutoplay) {
|
1499 |
+
_this.cancelAuto();
|
1500 |
+
}
|
1501 |
+
|
1502 |
+
_this.fromAuto = false;
|
1503 |
+
|
1504 |
+
});
|
1505 |
+
};
|
1506 |
+
|
1507 |
+
// Manage autoplay via play/stop buttons
|
1508 |
+
Autoplay.prototype.controls = function() {
|
1509 |
+
var _this = this;
|
1510 |
+
var _html = '<span class="lg-autoplay-button lg-icon"></span>';
|
1511 |
+
|
1512 |
+
// Append autoplay controls
|
1513 |
+
$(this.core.s.appendAutoplayControlsTo).append(_html);
|
1514 |
+
|
1515 |
+
_this.core.$outer.find('.lg-autoplay-button').on('click.lg', function() {
|
1516 |
+
if ($(_this.core.$outer).hasClass('lg-show-autoplay')) {
|
1517 |
+
_this.cancelAuto();
|
1518 |
+
_this.core.s.fourceAutoplay = false;
|
1519 |
+
} else {
|
1520 |
+
if (!_this.interval) {
|
1521 |
+
_this.startlAuto();
|
1522 |
+
_this.core.s.fourceAutoplay = _this.fourceAutoplayTemp;
|
1523 |
+
}
|
1524 |
+
}
|
1525 |
+
});
|
1526 |
+
};
|
1527 |
+
|
1528 |
+
// Autostart gallery
|
1529 |
+
Autoplay.prototype.startlAuto = function() {
|
1530 |
+
var _this = this;
|
1531 |
+
|
1532 |
+
_this.core.$outer.find('.lg-progress').css('transition', 'width ' + (_this.core.s.speed + _this.core.s.pause) + 'ms ease 0s');
|
1533 |
+
_this.core.$outer.addClass('lg-show-autoplay');
|
1534 |
+
_this.core.$outer.find('.lg-progress-bar').addClass('lg-start');
|
1535 |
+
|
1536 |
+
_this.interval = setInterval(function() {
|
1537 |
+
if (_this.core.index + 1 < _this.core.$items.length) {
|
1538 |
+
_this.core.index++;
|
1539 |
+
} else {
|
1540 |
+
_this.core.index = 0;
|
1541 |
+
}
|
1542 |
+
|
1543 |
+
_this.fromAuto = true;
|
1544 |
+
_this.core.slide(_this.core.index, false, false, 'next');
|
1545 |
+
}, _this.core.s.speed + _this.core.s.pause);
|
1546 |
+
};
|
1547 |
+
|
1548 |
+
// cancel Autostart
|
1549 |
+
Autoplay.prototype.cancelAuto = function() {
|
1550 |
+
clearInterval(this.interval);
|
1551 |
+
this.interval = false;
|
1552 |
+
this.core.$outer.find('.lg-progress').removeAttr('style');
|
1553 |
+
this.core.$outer.removeClass('lg-show-autoplay');
|
1554 |
+
this.core.$outer.find('.lg-progress-bar').removeClass('lg-start');
|
1555 |
+
};
|
1556 |
+
|
1557 |
+
Autoplay.prototype.destroy = function() {
|
1558 |
+
|
1559 |
+
this.cancelAuto();
|
1560 |
+
this.core.$outer.find('.lg-progress-bar').remove();
|
1561 |
+
};
|
1562 |
+
|
1563 |
+
$.fn.lightGallery.modules.autoplay = Autoplay;
|
1564 |
+
|
1565 |
+
})();
|
1566 |
+
|
1567 |
+
|
1568 |
+
}));
|
1569 |
+
|
1570 |
+
/*! lg-fullscreen - v1.1.0 - 2019-02-19
|
1571 |
+
* http://sachinchoolur.github.io/lightGallery
|
1572 |
+
* Copyright (c) 2019 Sachin N; Licensed GPLv3 */
|
1573 |
+
|
1574 |
+
(function (root, factory) {
|
1575 |
+
if (typeof define === 'function' && define.amd) {
|
1576 |
+
// AMD. Register as an anonymous module unless amdModuleId is set
|
1577 |
+
define(['jquery'], function (a0) {
|
1578 |
+
return (factory(a0));
|
1579 |
+
});
|
1580 |
+
} else if (typeof module === 'object' && module.exports) {
|
1581 |
+
// Node. Does not work with strict CommonJS, but
|
1582 |
+
// only CommonJS-like environments that support module.exports,
|
1583 |
+
// like Node.
|
1584 |
+
module.exports = factory(require('jquery'));
|
1585 |
+
} else {
|
1586 |
+
factory(root["jQuery"]);
|
1587 |
+
}
|
1588 |
+
}(this, function ($) {
|
1589 |
+
|
1590 |
+
(function() {
|
1591 |
+
|
1592 |
+
'use strict';
|
1593 |
+
|
1594 |
+
var defaults = {
|
1595 |
+
fullScreen: true
|
1596 |
+
};
|
1597 |
+
|
1598 |
+
function isFullScreen() {
|
1599 |
+
return (
|
1600 |
+
document.fullscreenElement ||
|
1601 |
+
document.mozFullScreenElement ||
|
1602 |
+
document.webkitFullscreenElement ||
|
1603 |
+
document.msFullscreenElement
|
1604 |
+
);
|
1605 |
+
}
|
1606 |
+
|
1607 |
+
var Fullscreen = function(element) {
|
1608 |
+
|
1609 |
+
// get lightGallery core plugin data
|
1610 |
+
this.core = $(element).data('lightGallery');
|
1611 |
+
|
1612 |
+
this.$el = $(element);
|
1613 |
+
|
1614 |
+
// extend module defalut settings with lightGallery core settings
|
1615 |
+
this.core.s = $.extend({}, defaults, this.core.s);
|
1616 |
+
|
1617 |
+
this.init();
|
1618 |
+
|
1619 |
+
return this;
|
1620 |
+
};
|
1621 |
+
|
1622 |
+
Fullscreen.prototype.init = function() {
|
1623 |
+
var fullScreen = '';
|
1624 |
+
if (this.core.s.fullScreen) {
|
1625 |
+
|
1626 |
+
// check for fullscreen browser support
|
1627 |
+
if (!document.fullscreenEnabled && !document.webkitFullscreenEnabled &&
|
1628 |
+
!document.mozFullScreenEnabled && !document.msFullscreenEnabled) {
|
1629 |
+
return;
|
1630 |
+
} else {
|
1631 |
+
fullScreen = '<span class="lg-fullscreen lg-icon"></span>';
|
1632 |
+
this.core.$outer.find('.lg-toolbar').append(fullScreen);
|
1633 |
+
this.fullScreen();
|
1634 |
+
}
|
1635 |
+
}
|
1636 |
+
};
|
1637 |
+
|
1638 |
+
Fullscreen.prototype.requestFullscreen = function() {
|
1639 |
+
var el = document.documentElement;
|
1640 |
+
if (el.requestFullscreen) {
|
1641 |
+
el.requestFullscreen();
|
1642 |
+
} else if (el.msRequestFullscreen) {
|
1643 |
+
el.msRequestFullscreen();
|
1644 |
+
} else if (el.mozRequestFullScreen) {
|
1645 |
+
el.mozRequestFullScreen();
|
1646 |
+
} else if (el.webkitRequestFullscreen) {
|
1647 |
+
el.webkitRequestFullscreen();
|
1648 |
+
}
|
1649 |
+
};
|
1650 |
+
|
1651 |
+
Fullscreen.prototype.exitFullscreen = function() {
|
1652 |
+
if (document.exitFullscreen) {
|
1653 |
+
document.exitFullscreen();
|
1654 |
+
} else if (document.msExitFullscreen) {
|
1655 |
+
document.msExitFullscreen();
|
1656 |
+
} else if (document.mozCancelFullScreen) {
|
1657 |
+
document.mozCancelFullScreen();
|
1658 |
+
} else if (document.webkitExitFullscreen) {
|
1659 |
+
document.webkitExitFullscreen();
|
1660 |
+
}
|
1661 |
+
};
|
1662 |
+
|
1663 |
+
// https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Using_full_screen_mode
|
1664 |
+
Fullscreen.prototype.fullScreen = function() {
|
1665 |
+
var _this = this;
|
1666 |
+
|
1667 |
+
$(document).on('fullscreenchange.lg webkitfullscreenchange.lg mozfullscreenchange.lg MSFullscreenChange.lg', function() {
|
1668 |
+
_this.core.$outer.toggleClass('lg-fullscreen-on');
|
1669 |
+
});
|
1670 |
+
|
1671 |
+
this.core.$outer.find('.lg-fullscreen').on('click.lg', function() {
|
1672 |
+
if (isFullScreen()) {
|
1673 |
+
_this.exitFullscreen();
|
1674 |
+
} else {
|
1675 |
+
_this.requestFullscreen();
|
1676 |
+
}
|
1677 |
+
});
|
1678 |
+
|
1679 |
+
};
|
1680 |
+
|
1681 |
+
Fullscreen.prototype.destroy = function() {
|
1682 |
+
|
1683 |
+
// exit from fullscreen if activated
|
1684 |
+
if(isFullScreen()) {
|
1685 |
+
this.exitFullscreen();
|
1686 |
+
}
|
1687 |
+
|
1688 |
+
$(document).off('fullscreenchange.lg webkitfullscreenchange.lg mozfullscreenchange.lg MSFullscreenChange.lg');
|
1689 |
+
};
|
1690 |
+
|
1691 |
+
$.fn.lightGallery.modules.fullscreen = Fullscreen;
|
1692 |
+
|
1693 |
+
})();
|
1694 |
+
|
1695 |
+
}));
|
1696 |
+
|
1697 |
+
/*! lg-zoom - v1.1.0 - 2017-08-08
|
1698 |
+
* http://sachinchoolur.github.io/lightGallery
|
1699 |
+
* Copyright (c) 2017 Sachin N; Licensed GPLv3 */
|
1700 |
+
|
1701 |
+
(function (root, factory) {
|
1702 |
+
if (typeof define === 'function' && define.amd) {
|
1703 |
+
// AMD. Register as an anonymous module unless amdModuleId is set
|
1704 |
+
define(['jquery'], function (a0) {
|
1705 |
+
return (factory(a0));
|
1706 |
+
});
|
1707 |
+
} else if (typeof exports === 'object') {
|
1708 |
+
// Node. Does not work with strict CommonJS, but
|
1709 |
+
// only CommonJS-like environments that support module.exports,
|
1710 |
+
// like Node.
|
1711 |
+
module.exports = factory(require('jquery'));
|
1712 |
+
} else {
|
1713 |
+
factory(jQuery);
|
1714 |
+
}
|
1715 |
+
}(this, function ($) {
|
1716 |
+
|
1717 |
+
(function() {
|
1718 |
+
|
1719 |
+
'use strict';
|
1720 |
+
|
1721 |
+
var getUseLeft = function() {
|
1722 |
+
var useLeft = false;
|
1723 |
+
var isChrome = navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);
|
1724 |
+
if (isChrome && parseInt(isChrome[2], 10) < 54) {
|
1725 |
+
useLeft = true;
|
1726 |
+
}
|
1727 |
+
|
1728 |
+
return useLeft;
|
1729 |
+
};
|
1730 |
+
|
1731 |
+
var defaults = {
|
1732 |
+
scale: 1,
|
1733 |
+
zoom: true,
|
1734 |
+
actualSize: true,
|
1735 |
+
enableZoomAfter: 300,
|
1736 |
+
useLeftForZoom: getUseLeft()
|
1737 |
+
};
|
1738 |
+
|
1739 |
+
var Zoom = function(element) {
|
1740 |
+
|
1741 |
+
this.core = $(element).data('lightGallery');
|
1742 |
+
|
1743 |
+
this.core.s = $.extend({}, defaults, this.core.s);
|
1744 |
+
|
1745 |
+
if (this.core.s.zoom && this.core.doCss()) {
|
1746 |
+
this.init();
|
1747 |
+
|
1748 |
+
// Store the zoomable timeout value just to clear it while closing
|
1749 |
+
this.zoomabletimeout = false;
|
1750 |
+
|
1751 |
+
// Set the initial value center
|
1752 |
+
this.pageX = $(window).width() / 2;
|
1753 |
+
this.pageY = ($(window).height() / 2) + $(window).scrollTop();
|
1754 |
+
}
|
1755 |
+
|
1756 |
+
return this;
|
1757 |
+
};
|
1758 |
+
|
1759 |
+
Zoom.prototype.init = function() {
|
1760 |
+
|
1761 |
+
var _this = this;
|
1762 |
+
var zoomIcons = '<span id="lg-zoom-in" class="lg-icon"></span><span id="lg-zoom-out" class="lg-icon"></span>';
|
1763 |
+
|
1764 |
+
if (_this.core.s.actualSize) {
|
1765 |
+
zoomIcons += '<span id="lg-actual-size" class="lg-icon"></span>';
|
1766 |
+
}
|
1767 |
+
|
1768 |
+
if (_this.core.s.useLeftForZoom) {
|
1769 |
+
_this.core.$outer.addClass('lg-use-left-for-zoom');
|
1770 |
+
} else {
|
1771 |
+
_this.core.$outer.addClass('lg-use-transition-for-zoom');
|
1772 |
+
}
|
1773 |
+
|
1774 |
+
this.core.$outer.find('.lg-toolbar').append(zoomIcons);
|
1775 |
+
|
1776 |
+
// Add zoomable class
|
1777 |
+
_this.core.$el.on('onSlideItemLoad.lg.tm.zoom', function(event, index, delay) {
|
1778 |
+
|
1779 |
+
// delay will be 0 except first time
|
1780 |
+
var _speed = _this.core.s.enableZoomAfter + delay;
|
1781 |
+
|
1782 |
+
// set _speed value 0 if gallery opened from direct url and if it is first slide
|
1783 |
+
if ($('body').hasClass('lg-from-hash') && delay) {
|
1784 |
+
|
1785 |
+
// will execute only once
|
1786 |
+
_speed = 0;
|
1787 |
+
} else {
|
1788 |
+
|
1789 |
+
// Remove lg-from-hash to enable starting animation.
|
1790 |
+
$('body').removeClass('lg-from-hash');
|
1791 |
+
}
|
1792 |
+
|
1793 |
+
_this.zoomabletimeout = setTimeout(function() {
|
1794 |
+
_this.core.$slide.eq(index).addClass('lg-zoomable');
|
1795 |
+
}, _speed + 30);
|
1796 |
+
});
|
1797 |
+
|
1798 |
+
var scale = 1;
|
1799 |
+
/**
|
1800 |
+
* @desc Image zoom
|
1801 |
+
* Translate the wrap and scale the image to get better user experience
|
1802 |
+
*
|
1803 |
+
* @param {String} scaleVal - Zoom decrement/increment value
|
1804 |
+
*/
|
1805 |
+
var zoom = function(scaleVal) {
|
1806 |
+
|
1807 |
+
var $image = _this.core.$outer.find('.lg-current .lg-image');
|
1808 |
+
var _x;
|
1809 |
+
var _y;
|
1810 |
+
|
1811 |
+
// Find offset manually to avoid issue after zoom
|
1812 |
+
var offsetX = ($(window).width() - $image.prop('offsetWidth')) / 2;
|
1813 |
+
var offsetY = (($(window).height() - $image.prop('offsetHeight')) / 2) + $(window).scrollTop();
|
1814 |
+
|
1815 |
+
_x = _this.pageX - offsetX;
|
1816 |
+
_y = _this.pageY - offsetY;
|
1817 |
+
|
1818 |
+
var x = (scaleVal - 1) * (_x);
|
1819 |
+
var y = (scaleVal - 1) * (_y);
|
1820 |
+
|
1821 |
+
$image.css('transform', 'scale3d(' + scaleVal + ', ' + scaleVal + ', 1)').attr('data-scale', scaleVal);
|
1822 |
+
|
1823 |
+
if (_this.core.s.useLeftForZoom) {
|
1824 |
+
$image.parent().css({
|
1825 |
+
left: -x + 'px',
|
1826 |
+
top: -y + 'px'
|
1827 |
+
}).attr('data-x', x).attr('data-y', y);
|
1828 |
+
} else {
|
1829 |
+
$image.parent().css('transform', 'translate3d(-' + x + 'px, -' + y + 'px, 0)').attr('data-x', x).attr('data-y', y);
|
1830 |
+
}
|
1831 |
+
};
|
1832 |
+
|
1833 |
+
var callScale = function() {
|
1834 |
+
if (scale > 1) {
|
1835 |
+
_this.core.$outer.addClass('lg-zoomed');
|
1836 |
+
} else {
|
1837 |
+
_this.resetZoom();
|
1838 |
+
}
|
1839 |
+
|
1840 |
+
if (scale < 1) {
|
1841 |
+
scale = 1;
|
1842 |
+
}
|
1843 |
+
|
1844 |
+
zoom(scale);
|
1845 |
+
};
|
1846 |
+
|
1847 |
+
var actualSize = function(event, $image, index, fromIcon) {
|
1848 |
+
var w = $image.prop('offsetWidth');
|
1849 |
+
var nw;
|
1850 |
+
if (_this.core.s.dynamic) {
|
1851 |
+
nw = _this.core.s.dynamicEl[index].width || $image[0].naturalWidth || w;
|
1852 |
+
} else {
|
1853 |
+
nw = _this.core.$items.eq(index).attr('data-width') || $image[0].naturalWidth || w;
|
1854 |
+
}
|
1855 |
+
|
1856 |
+
var _scale;
|
1857 |
+
|
1858 |
+
if (_this.core.$outer.hasClass('lg-zoomed')) {
|
1859 |
+
scale = 1;
|
1860 |
+
} else {
|
1861 |
+
if (nw > w) {
|
1862 |
+
_scale = nw / w;
|
1863 |
+
scale = _scale || 2;
|
1864 |
+
}
|
1865 |
+
}
|
1866 |
+
|
1867 |
+
if (fromIcon) {
|
1868 |
+
_this.pageX = $(window).width() / 2;
|
1869 |
+
_this.pageY = ($(window).height() / 2) + $(window).scrollTop();
|
1870 |
+
} else {
|
1871 |
+
_this.pageX = event.pageX || event.originalEvent.targetTouches[0].pageX;
|
1872 |
+
_this.pageY = event.pageY || event.originalEvent.targetTouches[0].pageY;
|
1873 |
+
}
|
1874 |
+
|
1875 |
+
callScale();
|
1876 |
+
setTimeout(function() {
|
1877 |
+
_this.core.$outer.removeClass('lg-grabbing').addClass('lg-grab');
|
1878 |
+
}, 10);
|
1879 |
+
};
|
1880 |
+
|
1881 |
+
var tapped = false;
|
1882 |
+
|
1883 |
+
// event triggered after appending slide content
|
1884 |
+
_this.core.$el.on('onAferAppendSlide.lg.tm.zoom', function(event, index) {
|
1885 |
+
|
1886 |
+
// Get the current element
|
1887 |
+
var $image = _this.core.$slide.eq(index).find('.lg-image');
|
1888 |
+
|
1889 |
+
$image.on('dblclick', function(event) {
|
1890 |
+
actualSize(event, $image, index);
|
1891 |
+
});
|
1892 |
+
|
1893 |
+
$image.on('touchstart', function(event) {
|
1894 |
+
if (!tapped) {
|
1895 |
+
tapped = setTimeout(function() {
|
1896 |
+
tapped = null;
|
1897 |
+
}, 300);
|
1898 |
+
} else {
|
1899 |
+
clearTimeout(tapped);
|
1900 |
+
tapped = null;
|
1901 |
+
actualSize(event, $image, index);
|
1902 |
+
}
|
1903 |
+
|
1904 |
+
event.preventDefault();
|
1905 |
+
});
|
1906 |
+
|
1907 |
+
});
|
1908 |
+
|
1909 |
+
// Update zoom on resize and orientationchange
|
1910 |
+
$(window).on('resize.lg.zoom scroll.lg.zoom orientationchange.lg.zoom', function() {
|
1911 |
+
_this.pageX = $(window).width() / 2;
|
1912 |
+
_this.pageY = ($(window).height() / 2) + $(window).scrollTop();
|
1913 |
+
zoom(scale);
|
1914 |
+
});
|
1915 |
+
|
1916 |
+
$('#lg-zoom-out').on('click.lg', function() {
|
1917 |
+
if (_this.core.$outer.find('.lg-current .lg-image').length) {
|
1918 |
+
scale -= _this.core.s.scale;
|
1919 |
+
callScale();
|
1920 |
+
}
|
1921 |
+
});
|
1922 |
+
|
1923 |
+
$('#lg-zoom-in').on('click.lg', function() {
|
1924 |
+
if (_this.core.$outer.find('.lg-current .lg-image').length) {
|
1925 |
+
scale += _this.core.s.scale;
|
1926 |
+
callScale();
|
1927 |
+
}
|
1928 |
+
});
|
1929 |
+
|
1930 |
+
$('#lg-actual-size').on('click.lg', function(event) {
|
1931 |
+
actualSize(event, _this.core.$slide.eq(_this.core.index).find('.lg-image'), _this.core.index, true);
|
1932 |
+
});
|
1933 |
+
|
1934 |
+
// Reset zoom on slide change
|
1935 |
+
_this.core.$el.on('onBeforeSlide.lg.tm', function() {
|
1936 |
+
scale = 1;
|
1937 |
+
_this.resetZoom();
|
1938 |
+
});
|
1939 |
+
|
1940 |
+
// Drag option after zoom
|
1941 |
+
_this.zoomDrag();
|
1942 |
+
|
1943 |
+
_this.zoomSwipe();
|
1944 |
+
|
1945 |
+
};
|
1946 |
+
|
1947 |
+
// Reset zoom effect
|
1948 |
+
Zoom.prototype.resetZoom = function() {
|
1949 |
+
this.core.$outer.removeClass('lg-zoomed');
|
1950 |
+
this.core.$slide.find('.lg-img-wrap').removeAttr('style data-x data-y');
|
1951 |
+
this.core.$slide.find('.lg-image').removeAttr('style data-scale');
|
1952 |
+
|
1953 |
+
// Reset pagx pagy values to center
|
1954 |
+
this.pageX = $(window).width() / 2;
|
1955 |
+
this.pageY = ($(window).height() / 2) + $(window).scrollTop();
|
1956 |
+
};
|
1957 |
+
|
1958 |
+
Zoom.prototype.zoomSwipe = function() {
|
1959 |
+
var _this = this;
|
1960 |
+
var startCoords = {};
|
1961 |
+
var endCoords = {};
|
1962 |
+
var isMoved = false;
|
1963 |
+
|
1964 |
+
// Allow x direction drag
|
1965 |
+
var allowX = false;
|
1966 |
+
|
1967 |
+
// Allow Y direction drag
|
1968 |
+
var allowY = false;
|
1969 |
+
|
1970 |
+
_this.core.$slide.on('touchstart.lg', function(e) {
|
1971 |
+
|
1972 |
+
if (_this.core.$outer.hasClass('lg-zoomed')) {
|
1973 |
+
var $image = _this.core.$slide.eq(_this.core.index).find('.lg-object');
|
1974 |
+
|
1975 |
+
allowY = $image.prop('offsetHeight') * $image.attr('data-scale') > _this.core.$outer.find('.lg').height();
|
1976 |
+
allowX = $image.prop('offsetWidth') * $image.attr('data-scale') > _this.core.$outer.find('.lg').width();
|
1977 |
+
if ((allowX || allowY)) {
|
1978 |
+
e.preventDefault();
|
1979 |
+
startCoords = {
|
1980 |
+
x: e.originalEvent.targetTouches[0].pageX,
|
1981 |
+
y: e.originalEvent.targetTouches[0].pageY
|
1982 |
+
};
|
1983 |
+
}
|
1984 |
+
}
|
1985 |
+
|
1986 |
+
});
|
1987 |
+
|
1988 |
+
_this.core.$slide.on('touchmove.lg', function(e) {
|
1989 |
+
|
1990 |
+
if (_this.core.$outer.hasClass('lg-zoomed')) {
|
1991 |
+
|
1992 |
+
var _$el = _this.core.$slide.eq(_this.core.index).find('.lg-img-wrap');
|
1993 |
+
var distanceX;
|
1994 |
+
var distanceY;
|
1995 |
+
|
1996 |
+
e.preventDefault();
|
1997 |
+
isMoved = true;
|
1998 |
+
|
1999 |
+
endCoords = {
|
2000 |
+
x: e.originalEvent.targetTouches[0].pageX,
|
2001 |
+
y: e.originalEvent.targetTouches[0].pageY
|
2002 |
+
};
|
2003 |
+
|
2004 |
+
// reset opacity and transition duration
|
2005 |
+
_this.core.$outer.addClass('lg-zoom-dragging');
|
2006 |
+
|
2007 |
+
if (allowY) {
|
2008 |
+
distanceY = (-Math.abs(_$el.attr('data-y'))) + (endCoords.y - startCoords.y);
|
2009 |
+
} else {
|
2010 |
+
distanceY = -Math.abs(_$el.attr('data-y'));
|
2011 |
+
}
|
2012 |
+
|
2013 |
+
if (allowX) {
|
2014 |
+
distanceX = (-Math.abs(_$el.attr('data-x'))) + (endCoords.x - startCoords.x);
|
2015 |
+
} else {
|
2016 |
+
distanceX = -Math.abs(_$el.attr('data-x'));
|
2017 |
+
}
|
2018 |
+
|
2019 |
+
if ((Math.abs(endCoords.x - startCoords.x) > 15) || (Math.abs(endCoords.y - startCoords.y) > 15)) {
|
2020 |
+
|
2021 |
+
if (_this.core.s.useLeftForZoom) {
|
2022 |
+
_$el.css({
|
2023 |
+
left: distanceX + 'px',
|
2024 |
+
top: distanceY + 'px'
|
2025 |
+
});
|
2026 |
+
} else {
|
2027 |
+
_$el.css('transform', 'translate3d(' + distanceX + 'px, ' + distanceY + 'px, 0)');
|
2028 |
+
}
|
2029 |
+
}
|
2030 |
+
|
2031 |
+
}
|
2032 |
+
|
2033 |
+
});
|
2034 |
+
|
2035 |
+
_this.core.$slide.on('touchend.lg', function() {
|
2036 |
+
if (_this.core.$outer.hasClass('lg-zoomed')) {
|
2037 |
+
if (isMoved) {
|
2038 |
+
isMoved = false;
|
2039 |
+
_this.core.$outer.removeClass('lg-zoom-dragging');
|
2040 |
+
_this.touchendZoom(startCoords, endCoords, allowX, allowY);
|
2041 |
+
|
2042 |
+
}
|
2043 |
+
}
|
2044 |
+
});
|
2045 |
+
|
2046 |
+
};
|
2047 |
+
|
2048 |
+
Zoom.prototype.zoomDrag = function() {
|
2049 |
+
|
2050 |
+
var _this = this;
|
2051 |
+
var startCoords = {};
|
2052 |
+
var endCoords = {};
|
2053 |
+
var isDraging = false;
|
2054 |
+
var isMoved = false;
|
2055 |
+
|
2056 |
+
// Allow x direction drag
|
2057 |
+
var allowX = false;
|
2058 |
+
|
2059 |
+
// Allow Y direction drag
|
2060 |
+
var allowY = false;
|
2061 |
+
|
2062 |
+
_this.core.$slide.on('mousedown.lg.zoom', function(e) {
|
2063 |
+
|
2064 |
+
// execute only on .lg-object
|
2065 |
+
var $image = _this.core.$slide.eq(_this.core.index).find('.lg-object');
|
2066 |
+
|
2067 |
+
allowY = $image.prop('offsetHeight') * $image.attr('data-scale') > _this.core.$outer.find('.lg').height();
|
2068 |
+
allowX = $image.prop('offsetWidth') * $image.attr('data-scale') > _this.core.$outer.find('.lg').width();
|
2069 |
+
|
2070 |
+
if (_this.core.$outer.hasClass('lg-zoomed')) {
|
2071 |
+
if ($(e.target).hasClass('lg-object') && (allowX || allowY)) {
|
2072 |
+
e.preventDefault();
|
2073 |
+
startCoords = {
|
2074 |
+
x: e.pageX,
|
2075 |
+
y: e.pageY
|
2076 |
+
};
|
2077 |
+
|
2078 |
+
isDraging = true;
|
2079 |
+
|
2080 |
+
// ** Fix for webkit cursor issue https://code.google.com/p/chromium/issues/detail?id=26723
|
2081 |
+
_this.core.$outer.scrollLeft += 1;
|
2082 |
+
_this.core.$outer.scrollLeft -= 1;
|
2083 |
+
|
2084 |
+
_this.core.$outer.removeClass('lg-grab').addClass('lg-grabbing');
|
2085 |
+
}
|
2086 |
+
}
|
2087 |
+
});
|
2088 |
+
|
2089 |
+
$(window).on('mousemove.lg.zoom', function(e) {
|
2090 |
+
if (isDraging) {
|
2091 |
+
var _$el = _this.core.$slide.eq(_this.core.index).find('.lg-img-wrap');
|
2092 |
+
var distanceX;
|
2093 |
+
var distanceY;
|
2094 |
+
|
2095 |
+
isMoved = true;
|
2096 |
+
endCoords = {
|
2097 |
+
x: e.pageX,
|
2098 |
+
y: e.pageY
|
2099 |
+
};
|
2100 |
+
|
2101 |
+
// reset opacity and transition duration
|
2102 |
+
_this.core.$outer.addClass('lg-zoom-dragging');
|
2103 |
+
|
2104 |
+
if (allowY) {
|
2105 |
+
distanceY = (-Math.abs(_$el.attr('data-y'))) + (endCoords.y - startCoords.y);
|
2106 |
+
} else {
|
2107 |
+
distanceY = -Math.abs(_$el.attr('data-y'));
|
2108 |
+
}
|
2109 |
+
|
2110 |
+
if (allowX) {
|
2111 |
+
distanceX = (-Math.abs(_$el.attr('data-x'))) + (endCoords.x - startCoords.x);
|
2112 |
+
} else {
|
2113 |
+
distanceX = -Math.abs(_$el.attr('data-x'));
|
2114 |
+
}
|
2115 |
+
|
2116 |
+
if (_this.core.s.useLeftForZoom) {
|
2117 |
+
_$el.css({
|
2118 |
+
left: distanceX + 'px',
|
2119 |
+
top: distanceY + 'px'
|
2120 |
+
});
|
2121 |
+
} else {
|
2122 |
+
_$el.css('transform', 'translate3d(' + distanceX + 'px, ' + distanceY + 'px, 0)');
|
2123 |
+
}
|
2124 |
+
}
|
2125 |
+
});
|
2126 |
+
|
2127 |
+
$(window).on('mouseup.lg.zoom', function(e) {
|
2128 |
+
|
2129 |
+
if (isDraging) {
|
2130 |
+
isDraging = false;
|
2131 |
+
_this.core.$outer.removeClass('lg-zoom-dragging');
|
2132 |
+
|
2133 |
+
// Fix for chrome mouse move on click
|
2134 |
+
if (isMoved && ((startCoords.x !== endCoords.x) || (startCoords.y !== endCoords.y))) {
|
2135 |
+
endCoords = {
|
2136 |
+
x: e.pageX,
|
2137 |
+
y: e.pageY
|
2138 |
+
};
|
2139 |
+
_this.touchendZoom(startCoords, endCoords, allowX, allowY);
|
2140 |
+
|
2141 |
+
}
|
2142 |
+
|
2143 |
+
isMoved = false;
|
2144 |
+
}
|
2145 |
+
|
2146 |
+
_this.core.$outer.removeClass('lg-grabbing').addClass('lg-grab');
|
2147 |
+
|
2148 |
+
});
|
2149 |
+
};
|
2150 |
+
|
2151 |
+
Zoom.prototype.touchendZoom = function(startCoords, endCoords, allowX, allowY) {
|
2152 |
+
|
2153 |
+
var _this = this;
|
2154 |
+
var _$el = _this.core.$slide.eq(_this.core.index).find('.lg-img-wrap');
|
2155 |
+
var $image = _this.core.$slide.eq(_this.core.index).find('.lg-object');
|
2156 |
+
var distanceX = (-Math.abs(_$el.attr('data-x'))) + (endCoords.x - startCoords.x);
|
2157 |
+
var distanceY = (-Math.abs(_$el.attr('data-y'))) + (endCoords.y - startCoords.y);
|
2158 |
+
var minY = (_this.core.$outer.find('.lg').height() - $image.prop('offsetHeight')) / 2;
|
2159 |
+
var maxY = Math.abs(($image.prop('offsetHeight') * Math.abs($image.attr('data-scale'))) - _this.core.$outer.find('.lg').height() + minY);
|
2160 |
+
var minX = (_this.core.$outer.find('.lg').width() - $image.prop('offsetWidth')) / 2;
|
2161 |
+
var maxX = Math.abs(($image.prop('offsetWidth') * Math.abs($image.attr('data-scale'))) - _this.core.$outer.find('.lg').width() + minX);
|
2162 |
+
|
2163 |
+
if ((Math.abs(endCoords.x - startCoords.x) > 15) || (Math.abs(endCoords.y - startCoords.y) > 15)) {
|
2164 |
+
if (allowY) {
|
2165 |
+
if (distanceY <= -maxY) {
|
2166 |
+
distanceY = -maxY;
|
2167 |
+
} else if (distanceY >= -minY) {
|
2168 |
+
distanceY = -minY;
|
2169 |
+
}
|
2170 |
+
}
|
2171 |
+
|
2172 |
+
if (allowX) {
|
2173 |
+
if (distanceX <= -maxX) {
|
2174 |
+
distanceX = -maxX;
|
2175 |
+
} else if (distanceX >= -minX) {
|
2176 |
+
distanceX = -minX;
|
2177 |
+
}
|
2178 |
+
}
|
2179 |
+
|
2180 |
+
if (allowY) {
|
2181 |
+
_$el.attr('data-y', Math.abs(distanceY));
|
2182 |
+
} else {
|
2183 |
+
distanceY = -Math.abs(_$el.attr('data-y'));
|
2184 |
+
}
|
2185 |
+
|
2186 |
+
if (allowX) {
|
2187 |
+
_$el.attr('data-x', Math.abs(distanceX));
|
2188 |
+
} else {
|
2189 |
+
distanceX = -Math.abs(_$el.attr('data-x'));
|
2190 |
+
}
|
2191 |
+
|
2192 |
+
if (_this.core.s.useLeftForZoom) {
|
2193 |
+
_$el.css({
|
2194 |
+
left: distanceX + 'px',
|
2195 |
+
top: distanceY + 'px'
|
2196 |
+
});
|
2197 |
+
} else {
|
2198 |
+
_$el.css('transform', 'translate3d(' + distanceX + 'px, ' + distanceY + 'px, 0)');
|
2199 |
+
}
|
2200 |
+
|
2201 |
+
}
|
2202 |
+
};
|
2203 |
+
|
2204 |
+
Zoom.prototype.destroy = function() {
|
2205 |
+
|
2206 |
+
var _this = this;
|
2207 |
+
|
2208 |
+
// Unbind all events added by lightGallery zoom plugin
|
2209 |
+
_this.core.$el.off('.lg.zoom');
|
2210 |
+
$(window).off('.lg.zoom');
|
2211 |
+
_this.core.$slide.off('.lg.zoom');
|
2212 |
+
_this.core.$el.off('.lg.tm.zoom');
|
2213 |
+
_this.resetZoom();
|
2214 |
+
clearTimeout(_this.zoomabletimeout);
|
2215 |
+
_this.zoomabletimeout = false;
|
2216 |
+
};
|
2217 |
+
|
2218 |
+
$.fn.lightGallery.modules.zoom = Zoom;
|
2219 |
+
|
2220 |
+
})();
|
2221 |
+
|
2222 |
+
|
2223 |
+
}));
|
2224 |
+
|
2225 |
+
/*! lg-share - v1.1.0 - 2017-10-03
|
2226 |
+
* http://sachinchoolur.github.io/lightGallery
|
2227 |
+
* Copyright (c) 2017 Sachin N; Licensed GPLv3 */
|
2228 |
+
|
2229 |
+
(function (root, factory) {
|
2230 |
+
if (typeof define === 'function' && define.amd) {
|
2231 |
+
// AMD. Register as an anonymous module unless amdModuleId is set
|
2232 |
+
define(['jquery'], function (a0) {
|
2233 |
+
return (factory(a0));
|
2234 |
+
});
|
2235 |
+
} else if (typeof exports === 'object') {
|
2236 |
+
// Node. Does not work with strict CommonJS, but
|
2237 |
+
// only CommonJS-like environments that support module.exports,
|
2238 |
+
// like Node.
|
2239 |
+
module.exports = factory(require('jquery'));
|
2240 |
+
} else {
|
2241 |
+
factory(jQuery);
|
2242 |
+
}
|
2243 |
+
}(this, function ($) {
|
2244 |
+
|
2245 |
+
(function() {
|
2246 |
+
|
2247 |
+
'use strict';
|
2248 |
+
|
2249 |
+
var defaults = {
|
2250 |
+
share: true,
|
2251 |
+
facebook: true,
|
2252 |
+
facebookDropdownText: 'Facebook',
|
2253 |
+
twitter: true,
|
2254 |
+
twitterDropdownText: 'Twitter',
|
2255 |
+
googlePlus: true,
|
2256 |
+
googlePlusDropdownText: 'GooglePlus',
|
2257 |
+
pinterest: true,
|
2258 |
+
pinterestDropdownText: 'Pinterest'
|
2259 |
+
};
|
2260 |
+
|
2261 |
+
var Share = function(element) {
|
2262 |
+
|
2263 |
+
this.core = $(element).data('lightGallery');
|
2264 |
+
|
2265 |
+
this.core.s = $.extend({}, defaults, this.core.s);
|
2266 |
+
if (this.core.s.share) {
|
2267 |
+
this.init();
|
2268 |
+
}
|
2269 |
+
|
2270 |
+
return this;
|
2271 |
+
};
|
2272 |
+
|
2273 |
+
Share.prototype.init = function() {
|
2274 |
+
var _this = this;
|
2275 |
+
var shareHtml = '<span id="lg-share" class="lg-icon">' +
|
2276 |
+
'<ul class="lg-dropdown" style="position: absolute;">';
|
2277 |
+
shareHtml += _this.core.s.facebook ? '<li><a id="lg-share-facebook" target="_blank"><span class="lg-icon"></span><span class="lg-dropdown-text">' + this.core.s.facebookDropdownText + '</span></a></li>' : '';
|
2278 |
+
shareHtml += _this.core.s.twitter ? '<li><a id="lg-share-twitter" target="_blank"><span class="lg-icon"></span><span class="lg-dropdown-text">' + this.core.s.twitterDropdownText + '</span></a></li>' : '';
|
2279 |
+
shareHtml += _this.core.s.googlePlus ? '<li><a id="lg-share-googleplus" target="_blank"><span class="lg-icon"></span><span class="lg-dropdown-text">' + this.core.s.googlePlusDropdownText + '</span></a></li>' : '';
|
2280 |
+
shareHtml += _this.core.s.pinterest ? '<li><a id="lg-share-pinterest" target="_blank"><span class="lg-icon"></span><span class="lg-dropdown-text">' + this.core.s.pinterestDropdownText + '</span></a></li>' : '';
|
2281 |
+
shareHtml += '</ul></span>';
|
2282 |
+
|
2283 |
+
this.core.$outer.find('.lg-toolbar').append(shareHtml);
|
2284 |
+
this.core.$outer.find('.lg').append('<div id="lg-dropdown-overlay"></div>');
|
2285 |
+
$('#lg-share').on('click.lg', function(){
|
2286 |
+
_this.core.$outer.toggleClass('lg-dropdown-active');
|
2287 |
+
});
|
2288 |
+
|
2289 |
+
$('#lg-dropdown-overlay').on('click.lg', function(){
|
2290 |
+
_this.core.$outer.removeClass('lg-dropdown-active');
|
2291 |
+
});
|
2292 |
+
|
2293 |
+
_this.core.$el.on('onAfterSlide.lg.tm', function(event, prevIndex, index) {
|
2294 |
+
|
2295 |
+
setTimeout(function() {
|
2296 |
+
|
2297 |
+
$('#lg-share-facebook').attr('href', 'https://www.facebook.com/sharer/sharer.php?u=' + (encodeURIComponent(_this.getSahreProps(index, 'facebookShareUrl') || window.location.href)));
|
2298 |
+
|
2299 |
+
$('#lg-share-twitter').attr('href', 'https://twitter.com/intent/tweet?text=' + _this.getSahreProps(index, 'tweetText') + '&url=' + (encodeURIComponent(_this.getSahreProps(index, 'twitterShareUrl') || window.location.href)));
|
2300 |
+
|
2301 |
+
$('#lg-share-googleplus').attr('href', 'https://plus.google.com/share?url=' + (encodeURIComponent(_this.getSahreProps(index, 'googleplusShareUrl') || window.location.href)));
|
2302 |
+
|
2303 |
+
$('#lg-share-pinterest').attr('href', 'http://www.pinterest.com/pin/create/button/?url=' + (encodeURIComponent(_this.getSahreProps(index, 'pinterestShareUrl') || window.location.href)) + '&media=' + encodeURIComponent(_this.getSahreProps(index, 'src')) + '&description=' + _this.getSahreProps(index, 'pinterestText'));
|
2304 |
+
|
2305 |
+
}, 100);
|
2306 |
+
});
|
2307 |
+
};
|
2308 |
+
|
2309 |
+
Share.prototype.getSahreProps = function(index, prop){
|
2310 |
+
var shareProp = '';
|
2311 |
+
if(this.core.s.dynamic) {
|
2312 |
+
shareProp = this.core.s.dynamicEl[index][prop];
|
2313 |
+
} else {
|
2314 |
+
var _href = this.core.$items.eq(index).attr('href');
|
2315 |
+
var _prop = this.core.$items.eq(index).data(prop);
|
2316 |
+
shareProp = prop === 'src' ? _href || _prop : _prop;
|
2317 |
+
}
|
2318 |
+
return shareProp;
|
2319 |
+
};
|
2320 |
+
|
2321 |
+
Share.prototype.destroy = function() {
|
2322 |
+
|
2323 |
+
};
|
2324 |
+
|
2325 |
+
$.fn.lightGallery.modules.share = Share;
|
2326 |
+
|
2327 |
+
})();
|
2328 |
+
|
2329 |
+
|
2330 |
+
|
2331 |
+
}));
|
2332 |
+
|
2333 |
+
/*! lg-hash - v1.0.4 - 2017-12-20
|
2334 |
+
* http://sachinchoolur.github.io/lightGallery
|
2335 |
+
* Copyright (c) 2017 Sachin N; Licensed GPLv3 */
|
2336 |
+
|
2337 |
+
(function (root, factory) {
|
2338 |
+
if (typeof define === 'function' && define.amd) {
|
2339 |
+
// AMD. Register as an anonymous module unless amdModuleId is set
|
2340 |
+
define(['jquery'], function (a0) {
|
2341 |
+
return (factory(a0));
|
2342 |
+
});
|
2343 |
+
} else if (typeof exports === 'object') {
|
2344 |
+
// Node. Does not work with strict CommonJS, but
|
2345 |
+
// only CommonJS-like environments that support module.exports,
|
2346 |
+
// like Node.
|
2347 |
+
module.exports = factory(require('jquery'));
|
2348 |
+
} else {
|
2349 |
+
factory(jQuery);
|
2350 |
+
}
|
2351 |
+
}(this, function ($) {
|
2352 |
+
|
2353 |
+
(function() {
|
2354 |
+
|
2355 |
+
'use strict';
|
2356 |
+
|
2357 |
+
var defaults = {
|
2358 |
+
hash: true
|
2359 |
+
};
|
2360 |
+
|
2361 |
+
var Hash = function(element) {
|
2362 |
+
|
2363 |
+
this.core = $(element).data('lightGallery');
|
2364 |
+
|
2365 |
+
this.core.s = $.extend({}, defaults, this.core.s);
|
2366 |
+
|
2367 |
+
if (this.core.s.hash) {
|
2368 |
+
this.oldHash = window.location.hash;
|
2369 |
+
this.init();
|
2370 |
+
}
|
2371 |
+
|
2372 |
+
return this;
|
2373 |
+
};
|
2374 |
+
|
2375 |
+
Hash.prototype.init = function() {
|
2376 |
+
var _this = this;
|
2377 |
+
var _hash;
|
2378 |
+
|
2379 |
+
// Change hash value on after each slide transition
|
2380 |
+
_this.core.$el.on('onAfterSlide.lg.tm', function(event, prevIndex, index) {
|
2381 |
+
if (history.replaceState) {
|
2382 |
+
history.replaceState(null, null, window.location.pathname + window.location.search + '#lg=' + _this.core.s.galleryId + '&slide=' + index);
|
2383 |
+
} else {
|
2384 |
+
window.location.hash = 'lg=' + _this.core.s.galleryId + '&slide=' + index;
|
2385 |
+
}
|
2386 |
+
});
|
2387 |
+
|
2388 |
+
// Listen hash change and change the slide according to slide value
|
2389 |
+
$(window).on('hashchange.lg.hash', function() {
|
2390 |
+
_hash = window.location.hash;
|
2391 |
+
var _idx = parseInt(_hash.split('&slide=')[1], 10);
|
2392 |
+
|
2393 |
+
// it galleryId doesn't exist in the url close the gallery
|
2394 |
+
if ((_hash.indexOf('lg=' + _this.core.s.galleryId) > -1)) {
|
2395 |
+
_this.core.slide(_idx, false, false);
|
2396 |
+
} else if (_this.core.lGalleryOn) {
|
2397 |
+
_this.core.destroy();
|
2398 |
+
}
|
2399 |
+
|
2400 |
+
});
|
2401 |
+
};
|
2402 |
+
|
2403 |
+
Hash.prototype.destroy = function() {
|
2404 |
+
|
2405 |
+
if (!this.core.s.hash) {
|
2406 |
+
return;
|
2407 |
+
}
|
2408 |
+
|
2409 |
+
// Reset to old hash value
|
2410 |
+
if (this.oldHash && this.oldHash.indexOf('lg=' + this.core.s.galleryId) < 0) {
|
2411 |
+
if (history.replaceState) {
|
2412 |
+
history.replaceState(null, null, this.oldHash);
|
2413 |
+
} else {
|
2414 |
+
window.location.hash = this.oldHash;
|
2415 |
+
}
|
2416 |
+
} else {
|
2417 |
+
if (history.replaceState) {
|
2418 |
+
history.replaceState(null, document.title, window.location.pathname + window.location.search);
|
2419 |
+
} else {
|
2420 |
+
window.location.hash = '';
|
2421 |
+
}
|
2422 |
+
}
|
2423 |
+
|
2424 |
+
this.core.$el.off('.lg.hash');
|
2425 |
+
|
2426 |
+
};
|
2427 |
+
|
2428 |
+
$.fn.lightGallery.modules.hash = Hash;
|
2429 |
+
|
2430 |
+
})();
|
2431 |
+
|
2432 |
+
|
2433 |
+
}));
|
2434 |
+
|
2435 |
+
/*! lg-thumbnail - v1.1.0 - 2017-08-08
|
2436 |
+
* http://sachinchoolur.github.io/lightGallery
|
2437 |
+
* Copyright (c) 2017 Sachin N; Licensed GPLv3 */
|
2438 |
+
|
2439 |
+
(function (root, factory) {
|
2440 |
+
if (typeof define === 'function' && define.amd) {
|
2441 |
+
// AMD. Register as an anonymous module unless amdModuleId is set
|
2442 |
+
define(['jquery'], function (a0) {
|
2443 |
+
return (factory(a0));
|
2444 |
+
});
|
2445 |
+
} else if (typeof exports === 'object') {
|
2446 |
+
// Node. Does not work with strict CommonJS, but
|
2447 |
+
// only CommonJS-like environments that support module.exports,
|
2448 |
+
// like Node.
|
2449 |
+
module.exports = factory(require('jquery'));
|
2450 |
+
} else {
|
2451 |
+
factory(jQuery);
|
2452 |
+
}
|
2453 |
+
}(this, function ($) {
|
2454 |
+
|
2455 |
+
(function() {
|
2456 |
+
|
2457 |
+
'use strict';
|
2458 |
+
|
2459 |
+
var defaults = {
|
2460 |
+
thumbnail: true,
|
2461 |
+
|
2462 |
+
animateThumb: true,
|
2463 |
+
currentPagerPosition: 'middle',
|
2464 |
+
|
2465 |
+
thumbWidth: 100,
|
2466 |
+
thumbHeight: '80px',
|
2467 |
+
thumbContHeight: 100,
|
2468 |
+
thumbMargin: 5,
|
2469 |
+
|
2470 |
+
exThumbImage: false,
|
2471 |
+
showThumbByDefault: true,
|
2472 |
+
toogleThumb: true,
|
2473 |
+
pullCaptionUp: true,
|
2474 |
+
|
2475 |
+
enableThumbDrag: true,
|
2476 |
+
enableThumbSwipe: true,
|
2477 |
+
swipeThreshold: 50,
|
2478 |
+
|
2479 |
+
loadYoutubeThumbnail: true,
|
2480 |
+
youtubeThumbSize: 1,
|
2481 |
+
|
2482 |
+
loadVimeoThumbnail: true,
|
2483 |
+
vimeoThumbSize: 'thumbnail_small',
|
2484 |
+
|
2485 |
+
loadDailymotionThumbnail: true
|
2486 |
+
};
|
2487 |
+
|
2488 |
+
var Thumbnail = function(element) {
|
2489 |
+
|
2490 |
+
// get lightGallery core plugin data
|
2491 |
+
this.core = $(element).data('lightGallery');
|
2492 |
+
|
2493 |
+
// extend module default settings with lightGallery core settings
|
2494 |
+
this.core.s = $.extend({}, defaults, this.core.s);
|
2495 |
+
|
2496 |
+
this.$el = $(element);
|
2497 |
+
this.$thumbOuter = null;
|
2498 |
+
this.thumbOuterWidth = 0;
|
2499 |
+
this.thumbTotalWidth = (this.core.$items.length * (this.core.s.thumbWidth + this.core.s.thumbMargin));
|
2500 |
+
this.thumbIndex = this.core.index;
|
2501 |
+
|
2502 |
+
if (this.core.s.animateThumb) {
|
2503 |
+
this.core.s.thumbHeight = '100%';
|
2504 |
+
}
|
2505 |
+
|
2506 |
+
// Thumbnail animation value
|
2507 |
+
this.left = 0;
|
2508 |
+
|
2509 |
+
this.init();
|
2510 |
+
|
2511 |
+
return this;
|
2512 |
+
};
|
2513 |
+
|
2514 |
+
Thumbnail.prototype.init = function() {
|
2515 |
+
var _this = this;
|
2516 |
+
if (this.core.s.thumbnail && this.core.$items.length > 1) {
|
2517 |
+
if (this.core.s.showThumbByDefault) {
|
2518 |
+
setTimeout(function(){
|
2519 |
+
_this.core.$outer.addClass('lg-thumb-open');
|
2520 |
+
}, 700);
|
2521 |
+
}
|
2522 |
+
|
2523 |
+
if (this.core.s.pullCaptionUp) {
|
2524 |
+
this.core.$outer.addClass('lg-pull-caption-up');
|
2525 |
+
}
|
2526 |
+
|
2527 |
+
this.build();
|
2528 |
+
if (this.core.s.animateThumb && this.core.doCss()) {
|
2529 |
+
if (this.core.s.enableThumbDrag) {
|
2530 |
+
this.enableThumbDrag();
|
2531 |
+
}
|
2532 |
+
|
2533 |
+
if (this.core.s.enableThumbSwipe) {
|
2534 |
+
this.enableThumbSwipe();
|
2535 |
+
}
|
2536 |
+
|
2537 |
+
this.thumbClickable = false;
|
2538 |
+
} else {
|
2539 |
+
this.thumbClickable = true;
|
2540 |
+
}
|
2541 |
+
|
2542 |
+
this.toogle();
|
2543 |
+
this.thumbkeyPress();
|
2544 |
+
}
|
2545 |
+
};
|
2546 |
+
|
2547 |
+
Thumbnail.prototype.build = function() {
|
2548 |
+
var _this = this;
|
2549 |
+
var thumbList = '';
|
2550 |
+
var vimeoErrorThumbSize = '';
|
2551 |
+
var $thumb;
|
2552 |
+
var html = '<div class="lg-thumb-outer">' +
|
2553 |
+
'<div class="lg-thumb lg-group">' +
|
2554 |
+
'</div>' +
|
2555 |
+
'</div>';
|
2556 |
+
|
2557 |
+
switch (this.core.s.vimeoThumbSize) {
|
2558 |
+
case 'thumbnail_large':
|
2559 |
+
vimeoErrorThumbSize = '640';
|
2560 |
+
break;
|
2561 |
+
case 'thumbnail_medium':
|
2562 |
+
vimeoErrorThumbSize = '200x150';
|
2563 |
+
break;
|
2564 |
+
case 'thumbnail_small':
|
2565 |
+
vimeoErrorThumbSize = '100x75';
|
2566 |
+
}
|
2567 |
+
|
2568 |
+
_this.core.$outer.addClass('lg-has-thumb');
|
2569 |
+
|
2570 |
+
_this.core.$outer.find('.lg').append(html);
|
2571 |
+
|
2572 |
+
_this.$thumbOuter = _this.core.$outer.find('.lg-thumb-outer');
|
2573 |
+
_this.thumbOuterWidth = _this.$thumbOuter.width();
|
2574 |
+
|
2575 |
+
if (_this.core.s.animateThumb) {
|
2576 |
+
_this.core.$outer.find('.lg-thumb').css({
|
2577 |
+
width: _this.thumbTotalWidth + 'px',
|
2578 |
+
position: 'relative'
|
2579 |
+
});
|
2580 |
+
}
|
2581 |
+
|
2582 |
+
if (this.core.s.animateThumb) {
|
2583 |
+
_this.$thumbOuter.css('height', _this.core.s.thumbContHeight + 'px');
|
2584 |
+
}
|
2585 |
+
|
2586 |
+
function getThumb(src, thumb, index) {
|
2587 |
+
var isVideo = _this.core.isVideo(src, index) || {};
|
2588 |
+
var thumbImg;
|
2589 |
+
var vimeoId = '';
|
2590 |
+
|
2591 |
+
if (isVideo.youtube || isVideo.vimeo || isVideo.dailymotion) {
|
2592 |
+
if (isVideo.youtube) {
|
2593 |
+
if (_this.core.s.loadYoutubeThumbnail) {
|
2594 |
+
thumbImg = '//img.youtube.com/vi/' + isVideo.youtube[1] + '/' + _this.core.s.youtubeThumbSize + '.jpg';
|
2595 |
+
} else {
|
2596 |
+
thumbImg = thumb;
|
2597 |
+
}
|
2598 |
+
} else if (isVideo.vimeo) {
|
2599 |
+
if (_this.core.s.loadVimeoThumbnail) {
|
2600 |
+
thumbImg = '//i.vimeocdn.com/video/error_' + vimeoErrorThumbSize + '.jpg';
|
2601 |
+
vimeoId = isVideo.vimeo[1];
|
2602 |
+
} else {
|
2603 |
+
thumbImg = thumb;
|
2604 |
+
}
|
2605 |
+
} else if (isVideo.dailymotion) {
|
2606 |
+
if (_this.core.s.loadDailymotionThumbnail) {
|
2607 |
+
thumbImg = '//www.dailymotion.com/thumbnail/video/' + isVideo.dailymotion[1];
|
2608 |
+
} else {
|
2609 |
+
thumbImg = thumb;
|
2610 |
+
}
|
2611 |
+
}
|
2612 |
+
} else {
|
2613 |
+
thumbImg = thumb;
|
2614 |
+
}
|
2615 |
+
|
2616 |
+
thumbList += '<div data-vimeo-id="' + vimeoId + '" class="lg-thumb-item" style="width:' + _this.core.s.thumbWidth + 'px; height: ' + _this.core.s.thumbHeight + '; margin-right: ' + _this.core.s.thumbMargin + 'px"><img src="' + thumbImg + '" /></div>';
|
2617 |
+
vimeoId = '';
|
2618 |
+
}
|
2619 |
+
|
2620 |
+
if (_this.core.s.dynamic) {
|
2621 |
+
for (var i = 0; i < _this.core.s.dynamicEl.length; i++) {
|
2622 |
+
getThumb(_this.core.s.dynamicEl[i].src, _this.core.s.dynamicEl[i].thumb, i);
|
2623 |
+
}
|
2624 |
+
} else {
|
2625 |
+
_this.core.$items.each(function(i) {
|
2626 |
+
|
2627 |
+
if (!_this.core.s.exThumbImage) {
|
2628 |
+
getThumb($(this).attr('href') || $(this).attr('data-src'), $(this).find('img').attr('src'), i);
|
2629 |
+
} else {
|
2630 |
+
getThumb($(this).attr('href') || $(this).attr('data-src'), $(this).attr(_this.core.s.exThumbImage), i);
|
2631 |
+
}
|
2632 |
+
|
2633 |
+
});
|
2634 |
+
}
|
2635 |
+
|
2636 |
+
_this.core.$outer.find('.lg-thumb').html(thumbList);
|
2637 |
+
|
2638 |
+
$thumb = _this.core.$outer.find('.lg-thumb-item');
|
2639 |
+
|
2640 |
+
// Load vimeo thumbnails
|
2641 |
+
$thumb.each(function() {
|
2642 |
+
var $this = $(this);
|
2643 |
+
var vimeoVideoId = $this.attr('data-vimeo-id');
|
2644 |
+
|
2645 |
+
if (vimeoVideoId) {
|
2646 |
+
$.getJSON('//www.vimeo.com/api/v2/video/' + vimeoVideoId + '.json?callback=?', {
|
2647 |
+
format: 'json'
|
2648 |
+
}, function(data) {
|
2649 |
+
$this.find('img').attr('src', data[0][_this.core.s.vimeoThumbSize]);
|
2650 |
+
});
|
2651 |
+
}
|
2652 |
+
});
|
2653 |
+
|
2654 |
+
// manage active class for thumbnail
|
2655 |
+
$thumb.eq(_this.core.index).addClass('active');
|
2656 |
+
_this.core.$el.on('onBeforeSlide.lg.tm', function() {
|
2657 |
+
$thumb.removeClass('active');
|
2658 |
+
$thumb.eq(_this.core.index).addClass('active');
|
2659 |
+
});
|
2660 |
+
|
2661 |
+
$thumb.on('click.lg touchend.lg', function() {
|
2662 |
+
var _$this = $(this);
|
2663 |
+
setTimeout(function() {
|
2664 |
+
|
2665 |
+
// In IE9 and bellow touch does not support
|
2666 |
+
// Go to slide if browser does not support css transitions
|
2667 |
+
if ((_this.thumbClickable && !_this.core.lgBusy) || !_this.core.doCss()) {
|
2668 |
+
_this.core.index = _$this.index();
|
2669 |
+
_this.core.slide(_this.core.index, false, true, false);
|
2670 |
+
}
|
2671 |
+
}, 50);
|
2672 |
+
});
|
2673 |
+
|
2674 |
+
_this.core.$el.on('onBeforeSlide.lg.tm', function() {
|
2675 |
+
_this.animateThumb(_this.core.index);
|
2676 |
+
});
|
2677 |
+
|
2678 |
+
$(window).on('resize.lg.thumb orientationchange.lg.thumb', function() {
|
2679 |
+
setTimeout(function() {
|
2680 |
+
_this.animateThumb(_this.core.index);
|
2681 |
+
_this.thumbOuterWidth = _this.$thumbOuter.width();
|
2682 |
+
}, 200);
|
2683 |
+
});
|
2684 |
+
|
2685 |
+
};
|
2686 |
+
|
2687 |
+
Thumbnail.prototype.setTranslate = function(value) {
|
2688 |
+
// jQuery supports Automatic CSS prefixing since jQuery 1.8.0
|
2689 |
+
this.core.$outer.find('.lg-thumb').css({
|
2690 |
+
transform: 'translate3d(-' + (value) + 'px, 0px, 0px)'
|
2691 |
+
});
|
2692 |
+
};
|
2693 |
+
|
2694 |
+
Thumbnail.prototype.animateThumb = function(index) {
|
2695 |
+
var $thumb = this.core.$outer.find('.lg-thumb');
|
2696 |
+
if (this.core.s.animateThumb) {
|
2697 |
+
var position;
|
2698 |
+
switch (this.core.s.currentPagerPosition) {
|
2699 |
+
case 'left':
|
2700 |
+
position = 0;
|
2701 |
+
break;
|
2702 |
+
case 'middle':
|
2703 |
+
position = (this.thumbOuterWidth / 2) - (this.core.s.thumbWidth / 2);
|
2704 |
+
break;
|
2705 |
+
case 'right':
|
2706 |
+
position = this.thumbOuterWidth - this.core.s.thumbWidth;
|
2707 |
+
}
|
2708 |
+
this.left = ((this.core.s.thumbWidth + this.core.s.thumbMargin) * index - 1) - position;
|
2709 |
+
if (this.left > (this.thumbTotalWidth - this.thumbOuterWidth)) {
|
2710 |
+
this.left = this.thumbTotalWidth - this.thumbOuterWidth;
|
2711 |
+
}
|
2712 |
+
|
2713 |
+
if (this.left < 0) {
|
2714 |
+
this.left = 0;
|
2715 |
+
}
|
2716 |
+
|
2717 |
+
if (this.core.lGalleryOn) {
|
2718 |
+
if (!$thumb.hasClass('on')) {
|
2719 |
+
this.core.$outer.find('.lg-thumb').css('transition-duration', this.core.s.speed + 'ms');
|
2720 |
+
}
|
2721 |
+
|
2722 |
+
if (!this.core.doCss()) {
|
2723 |
+
$thumb.animate({
|
2724 |
+
left: -this.left + 'px'
|
2725 |
+
}, this.core.s.speed);
|
2726 |
+
}
|
2727 |
+
} else {
|
2728 |
+
if (!this.core.doCss()) {
|
2729 |
+
$thumb.css('left', -this.left + 'px');
|
2730 |
+
}
|
2731 |
+
}
|
2732 |
+
|
2733 |
+
this.setTranslate(this.left);
|
2734 |
+
|
2735 |
+
}
|
2736 |
+
};
|
2737 |
+
|
2738 |
+
// Enable thumbnail dragging and swiping
|
2739 |
+
Thumbnail.prototype.enableThumbDrag = function() {
|
2740 |
+
|
2741 |
+
var _this = this;
|
2742 |
+
var startCoords = 0;
|
2743 |
+
var endCoords = 0;
|
2744 |
+
var isDraging = false;
|
2745 |
+
var isMoved = false;
|
2746 |
+
var tempLeft = 0;
|
2747 |
+
|
2748 |
+
_this.$thumbOuter.addClass('lg-grab');
|
2749 |
+
|
2750 |
+
_this.core.$outer.find('.lg-thumb').on('mousedown.lg.thumb', function(e) {
|
2751 |
+
if (_this.thumbTotalWidth > _this.thumbOuterWidth) {
|
2752 |
+
// execute only on .lg-object
|
2753 |
+
e.preventDefault();
|
2754 |
+
startCoords = e.pageX;
|
2755 |
+
isDraging = true;
|
2756 |
+
|
2757 |
+
// ** Fix for webkit cursor issue https://code.google.com/p/chromium/issues/detail?id=26723
|
2758 |
+
_this.core.$outer.scrollLeft += 1;
|
2759 |
+
_this.core.$outer.scrollLeft -= 1;
|
2760 |
+
|
2761 |
+
// *
|
2762 |
+
_this.thumbClickable = false;
|
2763 |
+
_this.$thumbOuter.removeClass('lg-grab').addClass('lg-grabbing');
|
2764 |
+
}
|
2765 |
+
});
|
2766 |
+
|
2767 |
+
$(window).on('mousemove.lg.thumb', function(e) {
|
2768 |
+
if (isDraging) {
|
2769 |
+
tempLeft = _this.left;
|
2770 |
+
isMoved = true;
|
2771 |
+
endCoords = e.pageX;
|
2772 |
+
|
2773 |
+
_this.$thumbOuter.addClass('lg-dragging');
|
2774 |
+
|
2775 |
+
tempLeft = tempLeft - (endCoords - startCoords);
|
2776 |
+
|
2777 |
+
if (tempLeft > (_this.thumbTotalWidth - _this.thumbOuterWidth)) {
|
2778 |
+
tempLeft = _this.thumbTotalWidth - _this.thumbOuterWidth;
|
2779 |
+
}
|
2780 |
+
|
2781 |
+
if (tempLeft < 0) {
|
2782 |
+
tempLeft = 0;
|
2783 |
+
}
|
2784 |
+
|
2785 |
+
// move current slide
|
2786 |
+
_this.setTranslate(tempLeft);
|
2787 |
+
|
2788 |
+
}
|
2789 |
+
});
|
2790 |
+
|
2791 |
+
$(window).on('mouseup.lg.thumb', function() {
|
2792 |
+
if (isMoved) {
|
2793 |
+
isMoved = false;
|
2794 |
+
_this.$thumbOuter.removeClass('lg-dragging');
|
2795 |
+
|
2796 |
+
_this.left = tempLeft;
|
2797 |
+
|
2798 |
+
if (Math.abs(endCoords - startCoords) < _this.core.s.swipeThreshold) {
|
2799 |
+
_this.thumbClickable = true;
|
2800 |
+
}
|
2801 |
+
|
2802 |
+
} else {
|
2803 |
+
_this.thumbClickable = true;
|
2804 |
+
}
|
2805 |
+
|
2806 |
+
if (isDraging) {
|
2807 |
+
isDraging = false;
|
2808 |
+
_this.$thumbOuter.removeClass('lg-grabbing').addClass('lg-grab');
|
2809 |
+
}
|
2810 |
+
});
|
2811 |
+
|
2812 |
+
};
|
2813 |
+
|
2814 |
+
Thumbnail.prototype.enableThumbSwipe = function() {
|
2815 |
+
var _this = this;
|
2816 |
+
var startCoords = 0;
|
2817 |
+
var endCoords = 0;
|
2818 |
+
var isMoved = false;
|
2819 |
+
var tempLeft = 0;
|
2820 |
+
|
2821 |
+
_this.core.$outer.find('.lg-thumb').on('touchstart.lg', function(e) {
|
2822 |
+
if (_this.thumbTotalWidth > _this.thumbOuterWidth) {
|
2823 |
+
e.preventDefault();
|
2824 |
+
startCoords = e.originalEvent.targetTouches[0].pageX;
|
2825 |
+
_this.thumbClickable = false;
|
2826 |
+
}
|
2827 |
+
});
|
2828 |
+
|
2829 |
+
_this.core.$outer.find('.lg-thumb').on('touchmove.lg', function(e) {
|
2830 |
+
if (_this.thumbTotalWidth > _this.thumbOuterWidth) {
|
2831 |
+
e.preventDefault();
|
2832 |
+
endCoords = e.originalEvent.targetTouches[0].pageX;
|
2833 |
+
isMoved = true;
|
2834 |
+
|
2835 |
+
_this.$thumbOuter.addClass('lg-dragging');
|
2836 |
+
|
2837 |
+
tempLeft = _this.left;
|
2838 |
+
|
2839 |
+
tempLeft = tempLeft - (endCoords - startCoords);
|
2840 |
+
|
2841 |
+
if (tempLeft > (_this.thumbTotalWidth - _this.thumbOuterWidth)) {
|
2842 |
+
tempLeft = _this.thumbTotalWidth - _this.thumbOuterWidth;
|
2843 |
+
}
|
2844 |
+
|
2845 |
+
if (tempLeft < 0) {
|
2846 |
+
tempLeft = 0;
|
2847 |
+
}
|
2848 |
+
|
2849 |
+
// move current slide
|
2850 |
+
_this.setTranslate(tempLeft);
|
2851 |
+
|
2852 |
+
}
|
2853 |
+
});
|
2854 |
+
|
2855 |
+
_this.core.$outer.find('.lg-thumb').on('touchend.lg', function() {
|
2856 |
+
if (_this.thumbTotalWidth > _this.thumbOuterWidth) {
|
2857 |
+
|
2858 |
+
if (isMoved) {
|
2859 |
+
isMoved = false;
|
2860 |
+
_this.$thumbOuter.removeClass('lg-dragging');
|
2861 |
+
if (Math.abs(endCoords - startCoords) < _this.core.s.swipeThreshold) {
|
2862 |
+
_this.thumbClickable = true;
|
2863 |
+
}
|
2864 |
+
|
2865 |
+
_this.left = tempLeft;
|
2866 |
+
} else {
|
2867 |
+
_this.thumbClickable = true;
|
2868 |
+
}
|
2869 |
+
} else {
|
2870 |
+
_this.thumbClickable = true;
|
2871 |
+
}
|
2872 |
+
});
|
2873 |
+
|
2874 |
+
};
|
2875 |
+
|
2876 |
+
Thumbnail.prototype.toogle = function() {
|
2877 |
+
var _this = this;
|
2878 |
+
if (_this.core.s.toogleThumb) {
|
2879 |
+
_this.core.$outer.addClass('lg-can-toggle');
|
2880 |
+
_this.$thumbOuter.append('<span class="lg-toogle-thumb lg-icon"></span>');
|
2881 |
+
_this.core.$outer.find('.lg-toogle-thumb').on('click.lg', function() {
|
2882 |
+
_this.core.$outer.toggleClass('lg-thumb-open');
|
2883 |
+
});
|
2884 |
+
}
|
2885 |
+
};
|
2886 |
+
|
2887 |
+
Thumbnail.prototype.thumbkeyPress = function() {
|
2888 |
+
var _this = this;
|
2889 |
+
$(window).on('keydown.lg.thumb', function(e) {
|
2890 |
+
if (e.keyCode === 38) {
|
2891 |
+
e.preventDefault();
|
2892 |
+
_this.core.$outer.addClass('lg-thumb-open');
|
2893 |
+
} else if (e.keyCode === 40) {
|
2894 |
+
e.preventDefault();
|
2895 |
+
_this.core.$outer.removeClass('lg-thumb-open');
|
2896 |
+
}
|
2897 |
+
});
|
2898 |
+
};
|
2899 |
+
|
2900 |
+
Thumbnail.prototype.destroy = function() {
|
2901 |
+
if (this.core.s.thumbnail && this.core.$items.length > 1) {
|
2902 |
+
$(window).off('resize.lg.thumb orientationchange.lg.thumb keydown.lg.thumb');
|
2903 |
+
this.$thumbOuter.remove();
|
2904 |
+
this.core.$outer.removeClass('lg-has-thumb');
|
2905 |
+
}
|
2906 |
+
};
|
2907 |
+
|
2908 |
+
$.fn.lightGallery.modules.Thumbnail = Thumbnail;
|
2909 |
+
|
2910 |
+
})();
|
2911 |
+
|
2912 |
+
}));
|
assets/js/lib/perfect-scrollbar/perfect-scrollbar.js
CHANGED
@@ -1,1324 +1,1324 @@
|
|
1 |
-
/*!
|
2 |
-
* perfect-scrollbar v1.4.0
|
3 |
-
* (c) 2018 Hyunje Jun
|
4 |
-
* @license MIT
|
5 |
-
*/
|
6 |
-
(function (global, factory) {
|
7 |
-
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
8 |
-
typeof define === 'function' && define.amd ? define(factory) :
|
9 |
-
(global.PerfectScrollbar = factory());
|
10 |
-
}(this, (function () { 'use strict';
|
11 |
-
|
12 |
-
function get(element) {
|
13 |
-
return getComputedStyle(element);
|
14 |
-
}
|
15 |
-
|
16 |
-
function set(element, obj) {
|
17 |
-
for (var key in obj) {
|
18 |
-
var val = obj[key];
|
19 |
-
if (typeof val === 'number') {
|
20 |
-
val = val + "px";
|
21 |
-
}
|
22 |
-
element.style[key] = val;
|
23 |
-
}
|
24 |
-
return element;
|
25 |
-
}
|
26 |
-
|
27 |
-
function div(className) {
|
28 |
-
var div = document.createElement('div');
|
29 |
-
div.className = className;
|
30 |
-
return div;
|
31 |
-
}
|
32 |
-
|
33 |
-
var elMatches =
|
34 |
-
typeof Element !== 'undefined' &&
|
35 |
-
(Element.prototype.matches ||
|
36 |
-
Element.prototype.webkitMatchesSelector ||
|
37 |
-
Element.prototype.mozMatchesSelector ||
|
38 |
-
Element.prototype.msMatchesSelector);
|
39 |
-
|
40 |
-
function matches(element, query) {
|
41 |
-
if (!elMatches) {
|
42 |
-
throw new Error('No element matching method supported');
|
43 |
-
}
|
44 |
-
|
45 |
-
return elMatches.call(element, query);
|
46 |
-
}
|
47 |
-
|
48 |
-
function remove(element) {
|
49 |
-
if (element.remove) {
|
50 |
-
element.remove();
|
51 |
-
} else {
|
52 |
-
if (element.parentNode) {
|
53 |
-
element.parentNode.removeChild(element);
|
54 |
-
}
|
55 |
-
}
|
56 |
-
}
|
57 |
-
|
58 |
-
function queryChildren(element, selector) {
|
59 |
-
return Array.prototype.filter.call(element.children, function (child) { return matches(child, selector); }
|
60 |
-
);
|
61 |
-
}
|
62 |
-
|
63 |
-
var cls = {
|
64 |
-
main: 'ps',
|
65 |
-
element: {
|
66 |
-
thumb: function (x) { return ("ps__thumb-" + x); },
|
67 |
-
rail: function (x) { return ("ps__rail-" + x); },
|
68 |
-
consuming: 'ps__child--consume',
|
69 |
-
},
|
70 |
-
state: {
|
71 |
-
focus: 'ps--focus',
|
72 |
-
clicking: 'ps--clicking',
|
73 |
-
active: function (x) { return ("ps--active-" + x); },
|
74 |
-
scrolling: function (x) { return ("ps--scrolling-" + x); },
|
75 |
-
},
|
76 |
-
};
|
77 |
-
|
78 |
-
/*
|
79 |
-
* Helper methods
|
80 |
-
*/
|
81 |
-
var scrollingClassTimeout = { x: null, y: null };
|
82 |
-
|
83 |
-
function addScrollingClass(i, x) {
|
84 |
-
var classList = i.element.classList;
|
85 |
-
var className = cls.state.scrolling(x);
|
86 |
-
|
87 |
-
if (classList.contains(className)) {
|
88 |
-
clearTimeout(scrollingClassTimeout[x]);
|
89 |
-
} else {
|
90 |
-
classList.add(className);
|
91 |
-
}
|
92 |
-
}
|
93 |
-
|
94 |
-
function removeScrollingClass(i, x) {
|
95 |
-
scrollingClassTimeout[x] = setTimeout(
|
96 |
-
function () { return i.isAlive && i.element.classList.remove(cls.state.scrolling(x)); },
|
97 |
-
i.settings.scrollingThreshold
|
98 |
-
);
|
99 |
-
}
|
100 |
-
|
101 |
-
function setScrollingClassInstantly(i, x) {
|
102 |
-
addScrollingClass(i, x);
|
103 |
-
removeScrollingClass(i, x);
|
104 |
-
}
|
105 |
-
|
106 |
-
var EventElement = function EventElement(element) {
|
107 |
-
this.element = element;
|
108 |
-
this.handlers = {};
|
109 |
-
};
|
110 |
-
|
111 |
-
var prototypeAccessors = { isEmpty: { configurable: true } };
|
112 |
-
|
113 |
-
EventElement.prototype.bind = function bind (eventName, handler) {
|
114 |
-
if (typeof this.handlers[eventName] === 'undefined') {
|
115 |
-
this.handlers[eventName] = [];
|
116 |
-
}
|
117 |
-
this.handlers[eventName].push(handler);
|
118 |
-
this.element.addEventListener(eventName, handler, false);
|
119 |
-
};
|
120 |
-
|
121 |
-
EventElement.prototype.unbind = function unbind (eventName, target) {
|
122 |
-
var this$1 = this;
|
123 |
-
|
124 |
-
this.handlers[eventName] = this.handlers[eventName].filter(function (handler) {
|
125 |
-
if (target && handler !== target) {
|
126 |
-
return true;
|
127 |
-
}
|
128 |
-
this$1.element.removeEventListener(eventName, handler, false);
|
129 |
-
return false;
|
130 |
-
});
|
131 |
-
};
|
132 |
-
|
133 |
-
EventElement.prototype.unbindAll = function unbindAll () {
|
134 |
-
var this$1 = this;
|
135 |
-
|
136 |
-
for (var name in this$1.handlers) {
|
137 |
-
this$1.unbind(name);
|
138 |
-
}
|
139 |
-
};
|
140 |
-
|
141 |
-
prototypeAccessors.isEmpty.get = function () {
|
142 |
-
var this$1 = this;
|
143 |
-
|
144 |
-
return Object.keys(this.handlers).every(
|
145 |
-
function (key) { return this$1.handlers[key].length === 0; }
|
146 |
-
);
|
147 |
-
};
|
148 |
-
|
149 |
-
Object.defineProperties( EventElement.prototype, prototypeAccessors );
|
150 |
-
|
151 |
-
var EventManager = function EventManager() {
|
152 |
-
this.eventElements = [];
|
153 |
-
};
|
154 |
-
|
155 |
-
EventManager.prototype.eventElement = function eventElement (element) {
|
156 |
-
var ee = this.eventElements.filter(function (ee) { return ee.element === element; })[0];
|
157 |
-
if (!ee) {
|
158 |
-
ee = new EventElement(element);
|
159 |
-
this.eventElements.push(ee);
|
160 |
-
}
|
161 |
-
return ee;
|
162 |
-
};
|
163 |
-
|
164 |
-
EventManager.prototype.bind = function bind (element, eventName, handler) {
|
165 |
-
this.eventElement(element).bind(eventName, handler);
|
166 |
-
};
|
167 |
-
|
168 |
-
EventManager.prototype.unbind = function unbind (element, eventName, handler) {
|
169 |
-
var ee = this.eventElement(element);
|
170 |
-
ee.unbind(eventName, handler);
|
171 |
-
|
172 |
-
if (ee.isEmpty) {
|
173 |
-
// remove
|
174 |
-
this.eventElements.splice(this.eventElements.indexOf(ee), 1);
|
175 |
-
}
|
176 |
-
};
|
177 |
-
|
178 |
-
EventManager.prototype.unbindAll = function unbindAll () {
|
179 |
-
this.eventElements.forEach(function (e) { return e.unbindAll(); });
|
180 |
-
this.eventElements = [];
|
181 |
-
};
|
182 |
-
|
183 |
-
EventManager.prototype.once = function once (element, eventName, handler) {
|
184 |
-
var ee = this.eventElement(element);
|
185 |
-
var onceHandler = function (evt) {
|
186 |
-
ee.unbind(eventName, onceHandler);
|
187 |
-
handler(evt);
|
188 |
-
};
|
189 |
-
ee.bind(eventName, onceHandler);
|
190 |
-
};
|
191 |
-
|
192 |
-
function createEvent(name) {
|
193 |
-
if (typeof window.CustomEvent === 'function') {
|
194 |
-
return new CustomEvent(name);
|
195 |
-
} else {
|
196 |
-
var evt = document.createEvent('CustomEvent');
|
197 |
-
evt.initCustomEvent(name, false, false, undefined);
|
198 |
-
return evt;
|
199 |
-
}
|
200 |
-
}
|
201 |
-
|
202 |
-
var processScrollDiff = function(
|
203 |
-
i,
|
204 |
-
axis,
|
205 |
-
diff,
|
206 |
-
useScrollingClass,
|
207 |
-
forceFireReachEvent
|
208 |
-
) {
|
209 |
-
if ( useScrollingClass === void 0 ) useScrollingClass = true;
|
210 |
-
if ( forceFireReachEvent === void 0 ) forceFireReachEvent = false;
|
211 |
-
|
212 |
-
var fields;
|
213 |
-
if (axis === 'top') {
|
214 |
-
fields = [
|
215 |
-
'contentHeight',
|
216 |
-
'containerHeight',
|
217 |
-
'scrollTop',
|
218 |
-
'y',
|
219 |
-
'up',
|
220 |
-
'down' ];
|
221 |
-
} else if (axis === 'left') {
|
222 |
-
fields = [
|
223 |
-
'contentWidth',
|
224 |
-
'containerWidth',
|
225 |
-
'scrollLeft',
|
226 |
-
'x',
|
227 |
-
'left',
|
228 |
-
'right' ];
|
229 |
-
} else {
|
230 |
-
throw new Error('A proper axis should be provided');
|
231 |
-
}
|
232 |
-
|
233 |
-
processScrollDiff$1(i, diff, fields, useScrollingClass, forceFireReachEvent);
|
234 |
-
};
|
235 |
-
|
236 |
-
function processScrollDiff$1(
|
237 |
-
i,
|
238 |
-
diff,
|
239 |
-
ref,
|
240 |
-
useScrollingClass,
|
241 |
-
forceFireReachEvent
|
242 |
-
) {
|
243 |
-
var contentHeight = ref[0];
|
244 |
-
var containerHeight = ref[1];
|
245 |
-
var scrollTop = ref[2];
|
246 |
-
var y = ref[3];
|
247 |
-
var up = ref[4];
|
248 |
-
var down = ref[5];
|
249 |
-
if ( useScrollingClass === void 0 ) useScrollingClass = true;
|
250 |
-
if ( forceFireReachEvent === void 0 ) forceFireReachEvent = false;
|
251 |
-
|
252 |
-
var element = i.element;
|
253 |
-
|
254 |
-
// reset reach
|
255 |
-
i.reach[y] = null;
|
256 |
-
|
257 |
-
// 1 for subpixel rounding
|
258 |
-
if (element[scrollTop] < 1) {
|
259 |
-
i.reach[y] = 'start';
|
260 |
-
}
|
261 |
-
|
262 |
-
// 1 for subpixel rounding
|
263 |
-
if (element[scrollTop] > i[contentHeight] - i[containerHeight] - 1) {
|
264 |
-
i.reach[y] = 'end';
|
265 |
-
}
|
266 |
-
|
267 |
-
if (diff) {
|
268 |
-
element.dispatchEvent(createEvent(("ps-scroll-" + y)));
|
269 |
-
|
270 |
-
if (diff < 0) {
|
271 |
-
element.dispatchEvent(createEvent(("ps-scroll-" + up)));
|
272 |
-
} else if (diff > 0) {
|
273 |
-
element.dispatchEvent(createEvent(("ps-scroll-" + down)));
|
274 |
-
}
|
275 |
-
|
276 |
-
if (useScrollingClass) {
|
277 |
-
setScrollingClassInstantly(i, y);
|
278 |
-
}
|
279 |
-
}
|
280 |
-
|
281 |
-
if (i.reach[y] && (diff || forceFireReachEvent)) {
|
282 |
-
element.dispatchEvent(createEvent(("ps-" + y + "-reach-" + (i.reach[y]))));
|
283 |
-
}
|
284 |
-
}
|
285 |
-
|
286 |
-
function toInt(x) {
|
287 |
-
return parseInt(x, 10) || 0;
|
288 |
-
}
|
289 |
-
|
290 |
-
function isEditable(el) {
|
291 |
-
return (
|
292 |
-
matches(el, 'input,[contenteditable]') ||
|
293 |
-
matches(el, 'select,[contenteditable]') ||
|
294 |
-
matches(el, 'textarea,[contenteditable]') ||
|
295 |
-
matches(el, 'button,[contenteditable]')
|
296 |
-
);
|
297 |
-
}
|
298 |
-
|
299 |
-
function outerWidth(element) {
|
300 |
-
var styles = get(element);
|
301 |
-
return (
|
302 |
-
toInt(styles.width) +
|
303 |
-
toInt(styles.paddingLeft) +
|
304 |
-
toInt(styles.paddingRight) +
|
305 |
-
toInt(styles.borderLeftWidth) +
|
306 |
-
toInt(styles.borderRightWidth)
|
307 |
-
);
|
308 |
-
}
|
309 |
-
|
310 |
-
var env = {
|
311 |
-
isWebKit:
|
312 |
-
typeof document !== 'undefined' &&
|
313 |
-
'WebkitAppearance' in document.documentElement.style,
|
314 |
-
supportsTouch:
|
315 |
-
typeof window !== 'undefined' &&
|
316 |
-
('ontouchstart' in window ||
|
317 |
-
(window.DocumentTouch && document instanceof window.DocumentTouch)),
|
318 |
-
supportsIePointer:
|
319 |
-
typeof navigator !== 'undefined' && navigator.msMaxTouchPoints,
|
320 |
-
isChrome:
|
321 |
-
typeof navigator !== 'undefined' &&
|
322 |
-
/Chrome/i.test(navigator && navigator.userAgent),
|
323 |
-
};
|
324 |
-
|
325 |
-
var updateGeometry = function(i) {
|
326 |
-
var element = i.element;
|
327 |
-
var roundedScrollTop = Math.floor(element.scrollTop);
|
328 |
-
|
329 |
-
i.containerWidth = element.clientWidth;
|
330 |
-
i.containerHeight = element.clientHeight;
|
331 |
-
i.contentWidth = element.scrollWidth;
|
332 |
-
i.contentHeight = element.scrollHeight;
|
333 |
-
|
334 |
-
if (!element.contains(i.scrollbarXRail)) {
|
335 |
-
// clean up and append
|
336 |
-
queryChildren(element, cls.element.rail('x')).forEach(function (el) { return remove(el); }
|
337 |
-
);
|
338 |
-
element.appendChild(i.scrollbarXRail);
|
339 |
-
}
|
340 |
-
if (!element.contains(i.scrollbarYRail)) {
|
341 |
-
// clean up and append
|
342 |
-
queryChildren(element, cls.element.rail('y')).forEach(function (el) { return remove(el); }
|
343 |
-
);
|
344 |
-
element.appendChild(i.scrollbarYRail);
|
345 |
-
}
|
346 |
-
|
347 |
-
if (
|
348 |
-
!i.settings.suppressScrollX &&
|
349 |
-
i.containerWidth + i.settings.scrollXMarginOffset < i.contentWidth
|
350 |
-
) {
|
351 |
-
i.scrollbarXActive = true;
|
352 |
-
i.railXWidth = i.containerWidth - i.railXMarginWidth;
|
353 |
-
i.railXRatio = i.containerWidth / i.railXWidth;
|
354 |
-
i.scrollbarXWidth = getThumbSize(
|
355 |
-
i,
|
356 |
-
toInt(i.railXWidth * i.containerWidth / i.contentWidth)
|
357 |
-
);
|
358 |
-
i.scrollbarXLeft = toInt(
|
359 |
-
(i.negativeScrollAdjustment + element.scrollLeft) *
|
360 |
-
(i.railXWidth - i.scrollbarXWidth) /
|
361 |
-
(i.contentWidth - i.containerWidth)
|
362 |
-
);
|
363 |
-
} else {
|
364 |
-
i.scrollbarXActive = false;
|
365 |
-
}
|
366 |
-
|
367 |
-
if (
|
368 |
-
!i.settings.suppressScrollY &&
|
369 |
-
i.containerHeight + i.settings.scrollYMarginOffset < i.contentHeight
|
370 |
-
) {
|
371 |
-
i.scrollbarYActive = true;
|
372 |
-
i.railYHeight = i.containerHeight - i.railYMarginHeight;
|
373 |
-
i.railYRatio = i.containerHeight / i.railYHeight;
|
374 |
-
i.scrollbarYHeight = getThumbSize(
|
375 |
-
i,
|
376 |
-
toInt(i.railYHeight * i.containerHeight / i.contentHeight)
|
377 |
-
);
|
378 |
-
i.scrollbarYTop = toInt(
|
379 |
-
roundedScrollTop *
|
380 |
-
(i.railYHeight - i.scrollbarYHeight) /
|
381 |
-
(i.contentHeight - i.containerHeight)
|
382 |
-
);
|
383 |
-
} else {
|
384 |
-
i.scrollbarYActive = false;
|
385 |
-
}
|
386 |
-
|
387 |
-
if (i.scrollbarXLeft >= i.railXWidth - i.scrollbarXWidth) {
|
388 |
-
i.scrollbarXLeft = i.railXWidth - i.scrollbarXWidth;
|
389 |
-
}
|
390 |
-
if (i.scrollbarYTop >= i.railYHeight - i.scrollbarYHeight) {
|
391 |
-
i.scrollbarYTop = i.railYHeight - i.scrollbarYHeight;
|
392 |
-
}
|
393 |
-
|
394 |
-
updateCss(element, i);
|
395 |
-
|
396 |
-
if (i.scrollbarXActive) {
|
397 |
-
element.classList.add(cls.state.active('x'));
|
398 |
-
} else {
|
399 |
-
element.classList.remove(cls.state.active('x'));
|
400 |
-
i.scrollbarXWidth = 0;
|
401 |
-
i.scrollbarXLeft = 0;
|
402 |
-
element.scrollLeft = 0;
|
403 |
-
}
|
404 |
-
if (i.scrollbarYActive) {
|
405 |
-
element.classList.add(cls.state.active('y'));
|
406 |
-
} else {
|
407 |
-
element.classList.remove(cls.state.active('y'));
|
408 |
-
i.scrollbarYHeight = 0;
|
409 |
-
i.scrollbarYTop = 0;
|
410 |
-
element.scrollTop = 0;
|
411 |
-
}
|
412 |
-
};
|
413 |
-
|
414 |
-
function getThumbSize(i, thumbSize) {
|
415 |
-
if (i.settings.minScrollbarLength) {
|
416 |
-
thumbSize = Math.max(thumbSize, i.settings.minScrollbarLength);
|
417 |
-
}
|
418 |
-
if (i.settings.maxScrollbarLength) {
|
419 |
-
thumbSize = Math.min(thumbSize, i.settings.maxScrollbarLength);
|
420 |
-
}
|
421 |
-
return thumbSize;
|
422 |
-
}
|
423 |
-
|
424 |
-
function updateCss(element, i) {
|
425 |
-
var xRailOffset = { width: i.railXWidth };
|
426 |
-
var roundedScrollTop = Math.floor(element.scrollTop);
|
427 |
-
|
428 |
-
if (i.isRtl) {
|
429 |
-
xRailOffset.left =
|
430 |
-
i.negativeScrollAdjustment +
|
431 |
-
element.scrollLeft +
|
432 |
-
i.containerWidth -
|
433 |
-
i.contentWidth;
|
434 |
-
} else {
|
435 |
-
xRailOffset.left = element.scrollLeft;
|
436 |
-
}
|
437 |
-
if (i.isScrollbarXUsingBottom) {
|
438 |
-
xRailOffset.bottom = i.scrollbarXBottom - roundedScrollTop;
|
439 |
-
} else {
|
440 |
-
xRailOffset.top = i.scrollbarXTop + roundedScrollTop;
|
441 |
-
}
|
442 |
-
set(i.scrollbarXRail, xRailOffset);
|
443 |
-
|
444 |
-
var yRailOffset = { top: roundedScrollTop, height: i.railYHeight };
|
445 |
-
if (i.isScrollbarYUsingRight) {
|
446 |
-
if (i.isRtl) {
|
447 |
-
yRailOffset.right =
|
448 |
-
i.contentWidth -
|
449 |
-
(i.negativeScrollAdjustment + element.scrollLeft) -
|
450 |
-
i.scrollbarYRight -
|
451 |
-
i.scrollbarYOuterWidth;
|
452 |
-
} else {
|
453 |
-
yRailOffset.right = i.scrollbarYRight - element.scrollLeft;
|
454 |
-
}
|
455 |
-
} else {
|
456 |
-
if (i.isRtl) {
|
457 |
-
yRailOffset.left =
|
458 |
-
i.negativeScrollAdjustment +
|
459 |
-
element.scrollLeft +
|
460 |
-
i.containerWidth * 2 -
|
461 |
-
i.contentWidth -
|
462 |
-
i.scrollbarYLeft -
|
463 |
-
i.scrollbarYOuterWidth;
|
464 |
-
} else {
|
465 |
-
yRailOffset.left = i.scrollbarYLeft + element.scrollLeft;
|
466 |
-
}
|
467 |
-
}
|
468 |
-
set(i.scrollbarYRail, yRailOffset);
|
469 |
-
|
470 |
-
set(i.scrollbarX, {
|
471 |
-
left: i.scrollbarXLeft,
|
472 |
-
width: i.scrollbarXWidth - i.railBorderXWidth,
|
473 |
-
});
|
474 |
-
set(i.scrollbarY, {
|
475 |
-
top: i.scrollbarYTop,
|
476 |
-
height: i.scrollbarYHeight - i.railBorderYWidth,
|
477 |
-
});
|
478 |
-
}
|
479 |
-
|
480 |
-
var clickRail = function(i) {
|
481 |
-
i.event.bind(i.scrollbarY, 'mousedown', function (e) { return e.stopPropagation(); });
|
482 |
-
i.event.bind(i.scrollbarYRail, 'mousedown', function (e) {
|
483 |
-
var positionTop =
|
484 |
-
e.pageY -
|
485 |
-
window.pageYOffset -
|
486 |
-
i.scrollbarYRail.getBoundingClientRect().top;
|
487 |
-
var direction = positionTop > i.scrollbarYTop ? 1 : -1;
|
488 |
-
|
489 |
-
i.element.scrollTop += direction * i.containerHeight;
|
490 |
-
updateGeometry(i);
|
491 |
-
|
492 |
-
e.stopPropagation();
|
493 |
-
});
|
494 |
-
|
495 |
-
i.event.bind(i.scrollbarX, 'mousedown', function (e) { return e.stopPropagation(); });
|
496 |
-
i.event.bind(i.scrollbarXRail, 'mousedown', function (e) {
|
497 |
-
var positionLeft =
|
498 |
-
e.pageX -
|
499 |
-
window.pageXOffset -
|
500 |
-
i.scrollbarXRail.getBoundingClientRect().left;
|
501 |
-
var direction = positionLeft > i.scrollbarXLeft ? 1 : -1;
|
502 |
-
|
503 |
-
i.element.scrollLeft += direction * i.containerWidth;
|
504 |
-
updateGeometry(i);
|
505 |
-
|
506 |
-
e.stopPropagation();
|
507 |
-
});
|
508 |
-
};
|
509 |
-
|
510 |
-
var dragThumb = function(i) {
|
511 |
-
bindMouseScrollHandler(i, [
|
512 |
-
'containerWidth',
|
513 |
-
'contentWidth',
|
514 |
-
'pageX',
|
515 |
-
'railXWidth',
|
516 |
-
'scrollbarX',
|
517 |
-
'scrollbarXWidth',
|
518 |
-
'scrollLeft',
|
519 |
-
'x',
|
520 |
-
'scrollbarXRail' ]);
|
521 |
-
bindMouseScrollHandler(i, [
|
522 |
-
'containerHeight',
|
523 |
-
'contentHeight',
|
524 |
-
'pageY',
|
525 |
-
'railYHeight',
|
526 |
-
'scrollbarY',
|
527 |
-
'scrollbarYHeight',
|
528 |
-
'scrollTop',
|
529 |
-
'y',
|
530 |
-
'scrollbarYRail' ]);
|
531 |
-
};
|
532 |
-
|
533 |
-
function bindMouseScrollHandler(
|
534 |
-
i,
|
535 |
-
ref
|
536 |
-
) {
|
537 |
-
var containerHeight = ref[0];
|
538 |
-
var contentHeight = ref[1];
|
539 |
-
var pageY = ref[2];
|
540 |
-
var railYHeight = ref[3];
|
541 |
-
var scrollbarY = ref[4];
|
542 |
-
var scrollbarYHeight = ref[5];
|
543 |
-
var scrollTop = ref[6];
|
544 |
-
var y = ref[7];
|
545 |
-
var scrollbarYRail = ref[8];
|
546 |
-
|
547 |
-
var element = i.element;
|
548 |
-
|
549 |
-
var startingScrollTop = null;
|
550 |
-
var startingMousePageY = null;
|
551 |
-
var scrollBy = null;
|
552 |
-
|
553 |
-
function mouseMoveHandler(e) {
|
554 |
-
element[scrollTop] =
|
555 |
-
startingScrollTop + scrollBy * (e[pageY] - startingMousePageY);
|
556 |
-
addScrollingClass(i, y);
|
557 |
-
updateGeometry(i);
|
558 |
-
|
559 |
-
e.stopPropagation();
|
560 |
-
e.preventDefault();
|
561 |
-
}
|
562 |
-
|
563 |
-
function mouseUpHandler() {
|
564 |
-
removeScrollingClass(i, y);
|
565 |
-
i[scrollbarYRail].classList.remove(cls.state.clicking);
|
566 |
-
i.event.unbind(i.ownerDocument, 'mousemove', mouseMoveHandler);
|
567 |
-
}
|
568 |
-
|
569 |
-
i.event.bind(i[scrollbarY], 'mousedown', function (e) {
|
570 |
-
startingScrollTop = element[scrollTop];
|
571 |
-
startingMousePageY = e[pageY];
|
572 |
-
scrollBy =
|
573 |
-
(i[contentHeight] - i[containerHeight]) /
|
574 |
-
(i[railYHeight] - i[scrollbarYHeight]);
|
575 |
-
|
576 |
-
i.event.bind(i.ownerDocument, 'mousemove', mouseMoveHandler);
|
577 |
-
i.event.once(i.ownerDocument, 'mouseup', mouseUpHandler);
|
578 |
-
|
579 |
-
i[scrollbarYRail].classList.add(cls.state.clicking);
|
580 |
-
|
581 |
-
e.stopPropagation();
|
582 |
-
e.preventDefault();
|
583 |
-
});
|
584 |
-
}
|
585 |
-
|
586 |
-
var keyboard = function(i) {
|
587 |
-
var element = i.element;
|
588 |
-
|
589 |
-
var elementHovered = function () { return matches(element, ':hover'); };
|
590 |
-
var scrollbarFocused = function () { return matches(i.scrollbarX, ':focus') || matches(i.scrollbarY, ':focus'); };
|
591 |
-
|
592 |
-
function shouldPreventDefault(deltaX, deltaY) {
|
593 |
-
var scrollTop = Math.floor(element.scrollTop);
|
594 |
-
if (deltaX === 0) {
|
595 |
-
if (!i.scrollbarYActive) {
|
596 |
-
return false;
|
597 |
-
}
|
598 |
-
if (
|
599 |
-
(scrollTop === 0 && deltaY > 0) ||
|
600 |
-
(scrollTop >= i.contentHeight - i.containerHeight && deltaY < 0)
|
601 |
-
) {
|
602 |
-
return !i.settings.wheelPropagation;
|
603 |
-
}
|
604 |
-
}
|
605 |
-
|
606 |
-
var scrollLeft = element.scrollLeft;
|
607 |
-
if (deltaY === 0) {
|
608 |
-
if (!i.scrollbarXActive) {
|
609 |
-
return false;
|
610 |
-
}
|
611 |
-
if (
|
612 |
-
(scrollLeft === 0 && deltaX < 0) ||
|
613 |
-
(scrollLeft >= i.contentWidth - i.containerWidth && deltaX > 0)
|
614 |
-
) {
|
615 |
-
return !i.settings.wheelPropagation;
|
616 |
-
}
|
617 |
-
}
|
618 |
-
return true;
|
619 |
-
}
|
620 |
-
|
621 |
-
i.event.bind(i.ownerDocument, 'keydown', function (e) {
|
622 |
-
if (
|
623 |
-
(e.isDefaultPrevented && e.isDefaultPrevented()) ||
|
624 |
-
e.defaultPrevented
|
625 |
-
) {
|
626 |
-
return;
|
627 |
-
}
|
628 |
-
|
629 |
-
if (!elementHovered() && !scrollbarFocused()) {
|
630 |
-
return;
|
631 |
-
}
|
632 |
-
|
633 |
-
var activeElement = document.activeElement
|
634 |
-
? document.activeElement
|
635 |
-
: i.ownerDocument.activeElement;
|
636 |
-
if (activeElement) {
|
637 |
-
if (activeElement.tagName === 'IFRAME') {
|
638 |
-
activeElement = activeElement.contentDocument.activeElement;
|
639 |
-
} else {
|
640 |
-
// go deeper if element is a webcomponent
|
641 |
-
while (activeElement.shadowRoot) {
|
642 |
-
activeElement = activeElement.shadowRoot.activeElement;
|
643 |
-
}
|
644 |
-
}
|
645 |
-
if (isEditable(activeElement)) {
|
646 |
-
return;
|
647 |
-
}
|
648 |
-
}
|
649 |
-
|
650 |
-
var deltaX = 0;
|
651 |
-
var deltaY = 0;
|
652 |
-
|
653 |
-
switch (e.which) {
|
654 |
-
case 37: // left
|
655 |
-
if (e.metaKey) {
|
656 |
-
deltaX = -i.contentWidth;
|
657 |
-
} else if (e.altKey) {
|
658 |
-
deltaX = -i.containerWidth;
|
659 |
-
} else {
|
660 |
-
deltaX = -30;
|
661 |
-
}
|
662 |
-
break;
|
663 |
-
case 38: // up
|
664 |
-
if (e.metaKey) {
|
665 |
-
deltaY = i.contentHeight;
|
666 |
-
} else if (e.altKey) {
|
667 |
-
deltaY = i.containerHeight;
|
668 |
-
} else {
|
669 |
-
deltaY = 30;
|
670 |
-
}
|
671 |
-
break;
|
672 |
-
case 39: // right
|
673 |
-
if (e.metaKey) {
|
674 |
-
deltaX = i.contentWidth;
|
675 |
-
} else if (e.altKey) {
|
676 |
-
deltaX = i.containerWidth;
|
677 |
-
} else {
|
678 |
-
deltaX = 30;
|
679 |
-
}
|
680 |
-
break;
|
681 |
-
case 40: // down
|
682 |
-
if (e.metaKey) {
|
683 |
-
deltaY = -i.contentHeight;
|
684 |
-
} else if (e.altKey) {
|
685 |
-
deltaY = -i.containerHeight;
|
686 |
-
} else {
|
687 |
-
deltaY = -30;
|
688 |
-
}
|
689 |
-
break;
|
690 |
-
case 32: // space bar
|
691 |
-
if (e.shiftKey) {
|
692 |
-
deltaY = i.containerHeight;
|
693 |
-
} else {
|
694 |
-
deltaY = -i.containerHeight;
|
695 |
-
}
|
696 |
-
break;
|
697 |
-
case 33: // page up
|
698 |
-
deltaY = i.containerHeight;
|
699 |
-
break;
|
700 |
-
case 34: // page down
|
701 |
-
deltaY = -i.containerHeight;
|
702 |
-
break;
|
703 |
-
case 36: // home
|
704 |
-
deltaY = i.contentHeight;
|
705 |
-
break;
|
706 |
-
case 35: // end
|
707 |
-
deltaY = -i.contentHeight;
|
708 |
-
break;
|
709 |
-
default:
|
710 |
-
return;
|
711 |
-
}
|
712 |
-
|
713 |
-
if (i.settings.suppressScrollX && deltaX !== 0) {
|
714 |
-
return;
|
715 |
-
}
|
716 |
-
if (i.settings.suppressScrollY && deltaY !== 0) {
|
717 |
-
return;
|
718 |
-
}
|
719 |
-
|
720 |
-
element.scrollTop -= deltaY;
|
721 |
-
element.scrollLeft += deltaX;
|
722 |
-
updateGeometry(i);
|
723 |
-
|
724 |
-
if (shouldPreventDefault(deltaX, deltaY)) {
|
725 |
-
e.preventDefault();
|
726 |
-
}
|
727 |
-
});
|
728 |
-
};
|
729 |
-
|
730 |
-
var wheel = function(i) {
|
731 |
-
var element = i.element;
|
732 |
-
|
733 |
-
function shouldPreventDefault(deltaX, deltaY) {
|
734 |
-
var roundedScrollTop = Math.floor(element.scrollTop);
|
735 |
-
var isTop = element.scrollTop === 0;
|
736 |
-
var isBottom =
|
737 |
-
roundedScrollTop + element.offsetHeight === element.scrollHeight;
|
738 |
-
var isLeft = element.scrollLeft === 0;
|
739 |
-
var isRight =
|
740 |
-
element.scrollLeft + element.offsetWidth === element.scrollWidth;
|
741 |
-
|
742 |
-
var hitsBound;
|
743 |
-
|
744 |
-
// pick axis with primary direction
|
745 |
-
if (Math.abs(deltaY) > Math.abs(deltaX)) {
|
746 |
-
hitsBound = isTop || isBottom;
|
747 |
-
} else {
|
748 |
-
hitsBound = isLeft || isRight;
|
749 |
-
}
|
750 |
-
|
751 |
-
return hitsBound ? !i.settings.wheelPropagation : true;
|
752 |
-
}
|
753 |
-
|
754 |
-
function getDeltaFromEvent(e) {
|
755 |
-
var deltaX = e.deltaX;
|
756 |
-
var deltaY = -1 * e.deltaY;
|
757 |
-
|
758 |
-
if (typeof deltaX === 'undefined' || typeof deltaY === 'undefined') {
|
759 |
-
// OS X Safari
|
760 |
-
deltaX = -1 * e.wheelDeltaX / 6;
|
761 |
-
deltaY = e.wheelDeltaY / 6;
|
762 |
-
}
|
763 |
-
|
764 |
-
if (e.deltaMode && e.deltaMode === 1) {
|
765 |
-
// Firefox in deltaMode 1: Line scrolling
|
766 |
-
deltaX *= 10;
|
767 |
-
deltaY *= 10;
|
768 |
-
}
|
769 |
-
|
770 |
-
if (deltaX !== deltaX && deltaY !== deltaY /* NaN checks */) {
|
771 |
-
// IE in some mouse drivers
|
772 |
-
deltaX = 0;
|
773 |
-
deltaY = e.wheelDelta;
|
774 |
-
}
|
775 |
-
|
776 |
-
if (e.shiftKey) {
|
777 |
-
// reverse axis with shift key
|
778 |
-
return [-deltaY, -deltaX];
|
779 |
-
}
|
780 |
-
return [deltaX, deltaY];
|
781 |
-
}
|
782 |
-
|
783 |
-
function shouldBeConsumedByChild(target, deltaX, deltaY) {
|
784 |
-
// FIXME: this is a workaround for <select> issue in FF and IE #571
|
785 |
-
if (!env.isWebKit && element.querySelector('select:focus')) {
|
786 |
-
return true;
|
787 |
-
}
|
788 |
-
|
789 |
-
if (!element.contains(target)) {
|
790 |
-
return false;
|
791 |
-
}
|
792 |
-
|
793 |
-
var cursor = target;
|
794 |
-
|
795 |
-
while (cursor && cursor !== element) {
|
796 |
-
if (cursor.classList.contains(cls.element.consuming)) {
|
797 |
-
return true;
|
798 |
-
}
|
799 |
-
|
800 |
-
var style = get(cursor);
|
801 |
-
var overflow = [style.overflow, style.overflowX, style.overflowY].join(
|
802 |
-
''
|
803 |
-
);
|
804 |
-
|
805 |
-
// if scrollable
|
806 |
-
if (overflow.match(/(scroll|auto)/)) {
|
807 |
-
var maxScrollTop = cursor.scrollHeight - cursor.clientHeight;
|
808 |
-
if (maxScrollTop > 0) {
|
809 |
-
if (
|
810 |
-
!(cursor.scrollTop === 0 && deltaY > 0) &&
|
811 |
-
!(cursor.scrollTop === maxScrollTop && deltaY < 0)
|
812 |
-
) {
|
813 |
-
return true;
|
814 |
-
}
|
815 |
-
}
|
816 |
-
var maxScrollLeft = cursor.scrollWidth - cursor.clientWidth;
|
817 |
-
if (maxScrollLeft > 0) {
|
818 |
-
if (
|
819 |
-
!(cursor.scrollLeft === 0 && deltaX < 0) &&
|
820 |
-
!(cursor.scrollLeft === maxScrollLeft && deltaX > 0)
|
821 |
-
) {
|
822 |
-
return true;
|
823 |
-
}
|
824 |
-
}
|
825 |
-
}
|
826 |
-
|
827 |
-
cursor = cursor.parentNode;
|
828 |
-
}
|
829 |
-
|
830 |
-
return false;
|
831 |
-
}
|
832 |
-
|
833 |
-
function mousewheelHandler(e) {
|
834 |
-
var ref = getDeltaFromEvent(e);
|
835 |
-
var deltaX = ref[0];
|
836 |
-
var deltaY = ref[1];
|
837 |
-
|
838 |
-
if (shouldBeConsumedByChild(e.target, deltaX, deltaY)) {
|
839 |
-
return;
|
840 |
-
}
|
841 |
-
|
842 |
-
var shouldPrevent = false;
|
843 |
-
if (!i.settings.useBothWheelAxes) {
|
844 |
-
// deltaX will only be used for horizontal scrolling and deltaY will
|
845 |
-
// only be used for vertical scrolling - this is the default
|
846 |
-
element.scrollTop -= deltaY * i.settings.wheelSpeed;
|
847 |
-
element.scrollLeft += deltaX * i.settings.wheelSpeed;
|
848 |
-
} else if (i.scrollbarYActive && !i.scrollbarXActive) {
|
849 |
-
// only vertical scrollbar is active and useBothWheelAxes option is
|
850 |
-
// active, so let's scroll vertical bar using both mouse wheel axes
|
851 |
-
if (deltaY) {
|
852 |
-
element.scrollTop -= deltaY * i.settings.wheelSpeed;
|
853 |
-
} else {
|
854 |
-
element.scrollTop += deltaX * i.settings.wheelSpeed;
|
855 |
-
}
|
856 |
-
shouldPrevent = true;
|
857 |
-
} else if (i.scrollbarXActive && !i.scrollbarYActive) {
|
858 |
-
// useBothWheelAxes and only horizontal bar is active, so use both
|
859 |
-
// wheel axes for horizontal bar
|
860 |
-
if (deltaX) {
|
861 |
-
element.scrollLeft += deltaX * i.settings.wheelSpeed;
|
862 |
-
} else {
|
863 |
-
element.scrollLeft -= deltaY * i.settings.wheelSpeed;
|
864 |
-
}
|
865 |
-
shouldPrevent = true;
|
866 |
-
}
|
867 |
-
|
868 |
-
updateGeometry(i);
|
869 |
-
|
870 |
-
shouldPrevent = shouldPrevent || shouldPreventDefault(deltaX, deltaY);
|
871 |
-
if (shouldPrevent && !e.ctrlKey) {
|
872 |
-
e.stopPropagation();
|
873 |
-
e.preventDefault();
|
874 |
-
}
|
875 |
-
}
|
876 |
-
|
877 |
-
if (typeof window.onwheel !== 'undefined') {
|
878 |
-
i.event.bind(element, 'wheel', mousewheelHandler);
|
879 |
-
} else if (typeof window.onmousewheel !== 'undefined') {
|
880 |
-
i.event.bind(element, 'mousewheel', mousewheelHandler);
|
881 |
-
}
|
882 |
-
};
|
883 |
-
|
884 |
-
var touch = function(i) {
|
885 |
-
if (!env.supportsTouch && !env.supportsIePointer) {
|
886 |
-
return;
|
887 |
-
}
|
888 |
-
|
889 |
-
var element = i.element;
|
890 |
-
|
891 |
-
function shouldPrevent(deltaX, deltaY) {
|
892 |
-
var scrollTop = Math.floor(element.scrollTop);
|
893 |
-
var scrollLeft = element.scrollLeft;
|
894 |
-
var magnitudeX = Math.abs(deltaX);
|
895 |
-
var magnitudeY = Math.abs(deltaY);
|
896 |
-
|
897 |
-
if (magnitudeY > magnitudeX) {
|
898 |
-
// user is perhaps trying to swipe up/down the page
|
899 |
-
|
900 |
-
if (
|
901 |
-
(deltaY < 0 && scrollTop === i.contentHeight - i.containerHeight) ||
|
902 |
-
(deltaY > 0 && scrollTop === 0)
|
903 |
-
) {
|
904 |
-
// set prevent for mobile Chrome refresh
|
905 |
-
return window.scrollY === 0 && deltaY > 0 && env.isChrome;
|
906 |
-
}
|
907 |
-
} else if (magnitudeX > magnitudeY) {
|
908 |
-
// user is perhaps trying to swipe left/right across the page
|
909 |
-
|
910 |
-
if (
|
911 |
-
(deltaX < 0 && scrollLeft === i.contentWidth - i.containerWidth) ||
|
912 |
-
(deltaX > 0 && scrollLeft === 0)
|
913 |
-
) {
|
914 |
-
return true;
|
915 |
-
}
|
916 |
-
}
|
917 |
-
|
918 |
-
return true;
|
919 |
-
}
|
920 |
-
|
921 |
-
function applyTouchMove(differenceX, differenceY) {
|
922 |
-
element.scrollTop -= differenceY;
|
923 |
-
element.scrollLeft -= differenceX;
|
924 |
-
|
925 |
-
updateGeometry(i);
|
926 |
-
}
|
927 |
-
|
928 |
-
var startOffset = {};
|
929 |
-
var startTime = 0;
|
930 |
-
var speed = {};
|
931 |
-
var easingLoop = null;
|
932 |
-
|
933 |
-
function getTouch(e) {
|
934 |
-
if (e.targetTouches) {
|
935 |
-
return e.targetTouches[0];
|
936 |
-
} else {
|
937 |
-
// Maybe IE pointer
|
938 |
-
return e;
|
939 |
-
}
|
940 |
-
}
|
941 |
-
|
942 |
-
function shouldHandle(e) {
|
943 |
-
if (e.pointerType && e.pointerType === 'pen' && e.buttons === 0) {
|
944 |
-
return false;
|
945 |
-
}
|
946 |
-
if (e.targetTouches && e.targetTouches.length === 1) {
|
947 |
-
return true;
|
948 |
-
}
|
949 |
-
if (
|
950 |
-
e.pointerType &&
|
951 |
-
e.pointerType !== 'mouse' &&
|
952 |
-
e.pointerType !== e.MSPOINTER_TYPE_MOUSE
|
953 |
-
) {
|
954 |
-
return true;
|
955 |
-
}
|
956 |
-
return false;
|
957 |
-
}
|
958 |
-
|
959 |
-
function touchStart(e) {
|
960 |
-
if (!shouldHandle(e)) {
|
961 |
-
return;
|
962 |
-
}
|
963 |
-
|
964 |
-
var touch = getTouch(e);
|
965 |
-
|
966 |
-
startOffset.pageX = touch.pageX;
|
967 |
-
startOffset.pageY = touch.pageY;
|
968 |
-
|
969 |
-
startTime = new Date().getTime();
|
970 |
-
|
971 |
-
if (easingLoop !== null) {
|
972 |
-
clearInterval(easingLoop);
|
973 |
-
}
|
974 |
-
}
|
975 |
-
|
976 |
-
function shouldBeConsumedByChild(target, deltaX, deltaY) {
|
977 |
-
if (!element.contains(target)) {
|
978 |
-
return false;
|
979 |
-
}
|
980 |
-
|
981 |
-
var cursor = target;
|
982 |
-
|
983 |
-
while (cursor && cursor !== element) {
|
984 |
-
if (cursor.classList.contains(cls.element.consuming)) {
|
985 |
-
return true;
|
986 |
-
}
|
987 |
-
|
988 |
-
var style = get(cursor);
|
989 |
-
var overflow = [style.overflow, style.overflowX, style.overflowY].join(
|
990 |
-
''
|
991 |
-
);
|
992 |
-
|
993 |
-
// if scrollable
|
994 |
-
if (overflow.match(/(scroll|auto)/)) {
|
995 |
-
var maxScrollTop = cursor.scrollHeight - cursor.clientHeight;
|
996 |
-
if (maxScrollTop > 0) {
|
997 |
-
if (
|
998 |
-
!(cursor.scrollTop === 0 && deltaY > 0) &&
|
999 |
-
!(cursor.scrollTop === maxScrollTop && deltaY < 0)
|
1000 |
-
) {
|
1001 |
-
return true;
|
1002 |
-
}
|
1003 |
-
}
|
1004 |
-
var maxScrollLeft = cursor.scrollLeft - cursor.clientWidth;
|
1005 |
-
if (maxScrollLeft > 0) {
|
1006 |
-
if (
|
1007 |
-
!(cursor.scrollLeft === 0 && deltaX < 0) &&
|
1008 |
-
!(cursor.scrollLeft === maxScrollLeft && deltaX > 0)
|
1009 |
-
) {
|
1010 |
-
return true;
|
1011 |
-
}
|
1012 |
-
}
|
1013 |
-
}
|
1014 |
-
|
1015 |
-
cursor = cursor.parentNode;
|
1016 |
-
}
|
1017 |
-
|
1018 |
-
return false;
|
1019 |
-
}
|
1020 |
-
|
1021 |
-
function touchMove(e) {
|
1022 |
-
if (shouldHandle(e)) {
|
1023 |
-
var touch = getTouch(e);
|
1024 |
-
|
1025 |
-
var currentOffset = { pageX: touch.pageX, pageY: touch.pageY };
|
1026 |
-
|
1027 |
-
var differenceX = currentOffset.pageX - startOffset.pageX;
|
1028 |
-
var differenceY = currentOffset.pageY - startOffset.pageY;
|
1029 |
-
|
1030 |
-
if (shouldBeConsumedByChild(e.target, differenceX, differenceY)) {
|
1031 |
-
return;
|
1032 |
-
}
|
1033 |
-
|
1034 |
-
applyTouchMove(differenceX, differenceY);
|
1035 |
-
startOffset = currentOffset;
|
1036 |
-
|
1037 |
-
var currentTime = new Date().getTime();
|
1038 |
-
|
1039 |
-
var timeGap = currentTime - startTime;
|
1040 |
-
if (timeGap > 0) {
|
1041 |
-
speed.x = differenceX / timeGap;
|
1042 |
-
speed.y = differenceY / timeGap;
|
1043 |
-
startTime = currentTime;
|
1044 |
-
}
|
1045 |
-
|
1046 |
-
if (shouldPrevent(differenceX, differenceY)) {
|
1047 |
-
e.preventDefault();
|
1048 |
-
}
|
1049 |
-
}
|
1050 |
-
}
|
1051 |
-
function touchEnd() {
|
1052 |
-
if (i.settings.swipeEasing) {
|
1053 |
-
clearInterval(easingLoop);
|
1054 |
-
easingLoop = setInterval(function() {
|
1055 |
-
if (i.isInitialized) {
|
1056 |
-
clearInterval(easingLoop);
|
1057 |
-
return;
|
1058 |
-
}
|
1059 |
-
|
1060 |
-
if (!speed.x && !speed.y) {
|
1061 |
-
clearInterval(easingLoop);
|
1062 |
-
return;
|
1063 |
-
}
|
1064 |
-
|
1065 |
-
if (Math.abs(speed.x) < 0.01 && Math.abs(speed.y) < 0.01) {
|
1066 |
-
clearInterval(easingLoop);
|
1067 |
-
return;
|
1068 |
-
}
|
1069 |
-
|
1070 |
-
applyTouchMove(speed.x * 30, speed.y * 30);
|
1071 |
-
|
1072 |
-
speed.x *= 0.8;
|
1073 |
-
speed.y *= 0.8;
|
1074 |
-
}, 10);
|
1075 |
-
}
|
1076 |
-
}
|
1077 |
-
|
1078 |
-
if (env.supportsTouch) {
|
1079 |
-
i.event.bind(element, 'touchstart', touchStart);
|
1080 |
-
i.event.bind(element, 'touchmove', touchMove);
|
1081 |
-
i.event.bind(element, 'touchend', touchEnd);
|
1082 |
-
} else if (env.supportsIePointer) {
|
1083 |
-
if (window.PointerEvent) {
|
1084 |
-
i.event.bind(element, 'pointerdown', touchStart);
|
1085 |
-
i.event.bind(element, 'pointermove', touchMove);
|
1086 |
-
i.event.bind(element, 'pointerup', touchEnd);
|
1087 |
-
} else if (window.MSPointerEvent) {
|
1088 |
-
i.event.bind(element, 'MSPointerDown', touchStart);
|
1089 |
-
i.event.bind(element, 'MSPointerMove', touchMove);
|
1090 |
-
i.event.bind(element, 'MSPointerUp', touchEnd);
|
1091 |
-
}
|
1092 |
-
}
|
1093 |
-
};
|
1094 |
-
|
1095 |
-
var defaultSettings = function () { return ({
|
1096 |
-
handlers: ['click-rail', 'drag-thumb', 'keyboard', 'wheel', 'touch'],
|
1097 |
-
maxScrollbarLength: null,
|
1098 |
-
minScrollbarLength: null,
|
1099 |
-
scrollingThreshold: 1000,
|
1100 |
-
scrollXMarginOffset: 0,
|
1101 |
-
scrollYMarginOffset: 0,
|
1102 |
-
suppressScrollX: false,
|
1103 |
-
suppressScrollY: false,
|
1104 |
-
swipeEasing: true,
|
1105 |
-
useBothWheelAxes: false,
|
1106 |
-
wheelPropagation: true,
|
1107 |
-
wheelSpeed: 1,
|
1108 |
-
}); };
|
1109 |
-
|
1110 |
-
var handlers = {
|
1111 |
-
'click-rail': clickRail,
|
1112 |
-
'drag-thumb': dragThumb,
|
1113 |
-
keyboard: keyboard,
|
1114 |
-
wheel: wheel,
|
1115 |
-
touch: touch,
|
1116 |
-
};
|
1117 |
-
|
1118 |
-
var PerfectScrollbar = function PerfectScrollbar(element, userSettings) {
|
1119 |
-
var this$1 = this;
|
1120 |
-
if ( userSettings === void 0 ) userSettings = {};
|
1121 |
-
|
1122 |
-
if (typeof element === 'string') {
|
1123 |
-
element = document.querySelector(element);
|
1124 |
-
}
|
1125 |
-
|
1126 |
-
if (!element || !element.nodeName) {
|
1127 |
-
throw new Error('no element is specified to initialize PerfectScrollbar');
|
1128 |
-
}
|
1129 |
-
|
1130 |
-
this.element = element;
|
1131 |
-
|
1132 |
-
element.classList.add(cls.main);
|
1133 |
-
|
1134 |
-
this.settings = defaultSettings();
|
1135 |
-
for (var key in userSettings) {
|
1136 |
-
this$1.settings[key] = userSettings[key];
|
1137 |
-
}
|
1138 |
-
|
1139 |
-
this.containerWidth = null;
|
1140 |
-
this.containerHeight = null;
|
1141 |
-
this.contentWidth = null;
|
1142 |
-
this.contentHeight = null;
|
1143 |
-
|
1144 |
-
var focus = function () { return element.classList.add(cls.state.focus); };
|
1145 |
-
var blur = function () { return element.classList.remove(cls.state.focus); };
|
1146 |
-
|
1147 |
-
this.isRtl = get(element).direction === 'rtl';
|
1148 |
-
this.isNegativeScroll = (function () {
|
1149 |
-
var originalScrollLeft = element.scrollLeft;
|
1150 |
-
var result = null;
|
1151 |
-
element.scrollLeft = -1;
|
1152 |
-
result = element.scrollLeft < 0;
|
1153 |
-
element.scrollLeft = originalScrollLeft;
|
1154 |
-
return result;
|
1155 |
-
})();
|
1156 |
-
this.negativeScrollAdjustment = this.isNegativeScroll
|
1157 |
-
? element.scrollWidth - element.clientWidth
|
1158 |
-
: 0;
|
1159 |
-
this.event = new EventManager();
|
1160 |
-
this.ownerDocument = element.ownerDocument || document;
|
1161 |
-
|
1162 |
-
this.scrollbarXRail = div(cls.element.rail('x'));
|
1163 |
-
element.appendChild(this.scrollbarXRail);
|
1164 |
-
this.scrollbarX = div(cls.element.thumb('x'));
|
1165 |
-
this.scrollbarXRail.appendChild(this.scrollbarX);
|
1166 |
-
this.scrollbarX.setAttribute('tabindex', 0);
|
1167 |
-
this.event.bind(this.scrollbarX, 'focus', focus);
|
1168 |
-
this.event.bind(this.scrollbarX, 'blur', blur);
|
1169 |
-
this.scrollbarXActive = null;
|
1170 |
-
this.scrollbarXWidth = null;
|
1171 |
-
this.scrollbarXLeft = null;
|
1172 |
-
var railXStyle = get(this.scrollbarXRail);
|
1173 |
-
this.scrollbarXBottom = parseInt(railXStyle.bottom, 10);
|
1174 |
-
if (isNaN(this.scrollbarXBottom)) {
|
1175 |
-
this.isScrollbarXUsingBottom = false;
|
1176 |
-
this.scrollbarXTop = toInt(railXStyle.top);
|
1177 |
-
} else {
|
1178 |
-
this.isScrollbarXUsingBottom = true;
|
1179 |
-
}
|
1180 |
-
this.railBorderXWidth =
|
1181 |
-
toInt(railXStyle.borderLeftWidth) + toInt(railXStyle.borderRightWidth);
|
1182 |
-
// Set rail to display:block to calculate margins
|
1183 |
-
set(this.scrollbarXRail, { display: 'block' });
|
1184 |
-
this.railXMarginWidth =
|
1185 |
-
toInt(railXStyle.marginLeft) + toInt(railXStyle.marginRight);
|
1186 |
-
set(this.scrollbarXRail, { display: '' });
|
1187 |
-
this.railXWidth = null;
|
1188 |
-
this.railXRatio = null;
|
1189 |
-
|
1190 |
-
this.scrollbarYRail = div(cls.element.rail('y'));
|
1191 |
-
element.appendChild(this.scrollbarYRail);
|
1192 |
-
this.scrollbarY = div(cls.element.thumb('y'));
|
1193 |
-
this.scrollbarYRail.appendChild(this.scrollbarY);
|
1194 |
-
this.scrollbarY.setAttribute('tabindex', 0);
|
1195 |
-
this.event.bind(this.scrollbarY, 'focus', focus);
|
1196 |
-
this.event.bind(this.scrollbarY, 'blur', blur);
|
1197 |
-
this.scrollbarYActive = null;
|
1198 |
-
this.scrollbarYHeight = null;
|
1199 |
-
this.scrollbarYTop = null;
|
1200 |
-
var railYStyle = get(this.scrollbarYRail);
|
1201 |
-
this.scrollbarYRight = parseInt(railYStyle.right, 10);
|
1202 |
-
if (isNaN(this.scrollbarYRight)) {
|
1203 |
-
this.isScrollbarYUsingRight = false;
|
1204 |
-
this.scrollbarYLeft = toInt(railYStyle.left);
|
1205 |
-
} else {
|
1206 |
-
this.isScrollbarYUsingRight = true;
|
1207 |
-
}
|
1208 |
-
this.scrollbarYOuterWidth = this.isRtl ? outerWidth(this.scrollbarY) : null;
|
1209 |
-
this.railBorderYWidth =
|
1210 |
-
toInt(railYStyle.borderTopWidth) + toInt(railYStyle.borderBottomWidth);
|
1211 |
-
set(this.scrollbarYRail, { display: 'block' });
|
1212 |
-
this.railYMarginHeight =
|
1213 |
-
toInt(railYStyle.marginTop) + toInt(railYStyle.marginBottom);
|
1214 |
-
set(this.scrollbarYRail, { display: '' });
|
1215 |
-
this.railYHeight = null;
|
1216 |
-
this.railYRatio = null;
|
1217 |
-
|
1218 |
-
this.reach = {
|
1219 |
-
x:
|
1220 |
-
element.scrollLeft <= 0
|
1221 |
-
? 'start'
|
1222 |
-
: element.scrollLeft >= this.contentWidth - this.containerWidth
|
1223 |
-
? 'end'
|
1224 |
-
: null,
|
1225 |
-
y:
|
1226 |
-
element.scrollTop <= 0
|
1227 |
-
? 'start'
|
1228 |
-
: element.scrollTop >= this.contentHeight - this.containerHeight
|
1229 |
-
? 'end'
|
1230 |
-
: null,
|
1231 |
-
};
|
1232 |
-
|
1233 |
-
this.isAlive = true;
|
1234 |
-
|
1235 |
-
this.settings.handlers.forEach(function (handlerName) { return handlers[handlerName](this$1); });
|
1236 |
-
|
1237 |
-
this.lastScrollTop = Math.floor(element.scrollTop); // for onScroll only
|
1238 |
-
this.lastScrollLeft = element.scrollLeft; // for onScroll only
|
1239 |
-
this.event.bind(this.element, 'scroll', function (e) { return this$1.onScroll(e); });
|
1240 |
-
updateGeometry(this);
|
1241 |
-
};
|
1242 |
-
|
1243 |
-
PerfectScrollbar.prototype.update = function update () {
|
1244 |
-
if (!this.isAlive) {
|
1245 |
-
return;
|
1246 |
-
}
|
1247 |
-
|
1248 |
-
// Recalcuate negative scrollLeft adjustment
|
1249 |
-
this.negativeScrollAdjustment = this.isNegativeScroll
|
1250 |
-
? this.element.scrollWidth - this.element.clientWidth
|
1251 |
-
: 0;
|
1252 |
-
|
1253 |
-
// Recalculate rail margins
|
1254 |
-
set(this.scrollbarXRail, { display: 'block' });
|
1255 |
-
set(this.scrollbarYRail, { display: 'block' });
|
1256 |
-
this.railXMarginWidth =
|
1257 |
-
toInt(get(this.scrollbarXRail).marginLeft) +
|
1258 |
-
toInt(get(this.scrollbarXRail).marginRight);
|
1259 |
-
this.railYMarginHeight =
|
1260 |
-
toInt(get(this.scrollbarYRail).marginTop) +
|
1261 |
-
toInt(get(this.scrollbarYRail).marginBottom);
|
1262 |
-
|
1263 |
-
// Hide scrollbars not to affect scrollWidth and scrollHeight
|
1264 |
-
set(this.scrollbarXRail, { display: 'none' });
|
1265 |
-
set(this.scrollbarYRail, { display: 'none' });
|
1266 |
-
|
1267 |
-
updateGeometry(this);
|
1268 |
-
|
1269 |
-
processScrollDiff(this, 'top', 0, false, true);
|
1270 |
-
processScrollDiff(this, 'left', 0, false, true);
|
1271 |
-
|
1272 |
-
set(this.scrollbarXRail, { display: '' });
|
1273 |
-
set(this.scrollbarYRail, { display: '' });
|
1274 |
-
};
|
1275 |
-
|
1276 |
-
PerfectScrollbar.prototype.onScroll = function onScroll (e) {
|
1277 |
-
if (!this.isAlive) {
|
1278 |
-
return;
|
1279 |
-
}
|
1280 |
-
|
1281 |
-
updateGeometry(this);
|
1282 |
-
processScrollDiff(this, 'top', this.element.scrollTop - this.lastScrollTop);
|
1283 |
-
processScrollDiff(
|
1284 |
-
this,
|
1285 |
-
'left',
|
1286 |
-
this.element.scrollLeft - this.lastScrollLeft
|
1287 |
-
);
|
1288 |
-
|
1289 |
-
this.lastScrollTop = Math.floor(this.element.scrollTop);
|
1290 |
-
this.lastScrollLeft = this.element.scrollLeft;
|
1291 |
-
};
|
1292 |
-
|
1293 |
-
PerfectScrollbar.prototype.destroy = function destroy () {
|
1294 |
-
if (!this.isAlive) {
|
1295 |
-
return;
|
1296 |
-
}
|
1297 |
-
|
1298 |
-
this.event.unbindAll();
|
1299 |
-
remove(this.scrollbarX);
|
1300 |
-
remove(this.scrollbarY);
|
1301 |
-
remove(this.scrollbarXRail);
|
1302 |
-
remove(this.scrollbarYRail);
|
1303 |
-
this.removePsClasses();
|
1304 |
-
|
1305 |
-
// unset elements
|
1306 |
-
this.element = null;
|
1307 |
-
this.scrollbarX = null;
|
1308 |
-
this.scrollbarY = null;
|
1309 |
-
this.scrollbarXRail = null;
|
1310 |
-
this.scrollbarYRail = null;
|
1311 |
-
|
1312 |
-
this.isAlive = false;
|
1313 |
-
};
|
1314 |
-
|
1315 |
-
PerfectScrollbar.prototype.removePsClasses = function removePsClasses () {
|
1316 |
-
this.element.className = this.element.className
|
1317 |
-
.split(' ')
|
1318 |
-
.filter(function (name) { return !name.match(/^ps([-_].+|)$/); })
|
1319 |
-
.join(' ');
|
1320 |
-
};
|
1321 |
-
|
1322 |
-
return PerfectScrollbar;
|
1323 |
-
|
1324 |
-
})));
|
1 |
+
/*!
|
2 |
+
* perfect-scrollbar v1.4.0
|
3 |
+
* (c) 2018 Hyunje Jun
|
4 |
+
* @license MIT
|
5 |
+
*/
|
6 |
+
(function (global, factory) {
|
7 |
+
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
8 |
+
typeof define === 'function' && define.amd ? define(factory) :
|
9 |
+
(global.PerfectScrollbar = factory());
|
10 |
+
}(this, (function () { 'use strict';
|
11 |
+
|
12 |
+
function get(element) {
|
13 |
+
return getComputedStyle(element);
|
14 |
+
}
|
15 |
+
|
16 |
+
function set(element, obj) {
|
17 |
+
for (var key in obj) {
|
18 |
+
var val = obj[key];
|
19 |
+
if (typeof val === 'number') {
|
20 |
+
val = val + "px";
|
21 |
+
}
|
22 |
+
element.style[key] = val;
|
23 |
+
}
|
24 |
+
return element;
|
25 |
+
}
|
26 |
+
|
27 |
+
function div(className) {
|
28 |
+
var div = document.createElement('div');
|
29 |
+
div.className = className;
|
30 |
+
return div;
|
31 |
+
}
|
32 |
+
|
33 |
+
var elMatches =
|
34 |
+
typeof Element !== 'undefined' &&
|
35 |
+
(Element.prototype.matches ||
|
36 |
+
Element.prototype.webkitMatchesSelector ||
|
37 |
+
Element.prototype.mozMatchesSelector ||
|
38 |
+
Element.prototype.msMatchesSelector);
|
39 |
+
|
40 |
+
function matches(element, query) {
|
41 |
+
if (!elMatches) {
|
42 |
+
throw new Error('No element matching method supported');
|
43 |
+
}
|
44 |
+
|
45 |
+
return elMatches.call(element, query);
|
46 |
+
}
|
47 |
+
|
48 |
+
function remove(element) {
|
49 |
+
if (element.remove) {
|
50 |
+
element.remove();
|
51 |
+
} else {
|
52 |
+
if (element.parentNode) {
|
53 |
+
element.parentNode.removeChild(element);
|
54 |
+
}
|
55 |
+
}
|
56 |
+
}
|
57 |
+
|
58 |
+
function queryChildren(element, selector) {
|
59 |
+
return Array.prototype.filter.call(element.children, function (child) { return matches(child, selector); }
|
60 |
+
);
|
61 |
+
}
|
62 |
+
|
63 |
+
var cls = {
|
64 |
+
main: 'ps',
|
65 |
+
element: {
|
66 |
+
thumb: function (x) { return ("ps__thumb-" + x); },
|
67 |
+
rail: function (x) { return ("ps__rail-" + x); },
|
68 |
+
consuming: 'ps__child--consume',
|
69 |
+
},
|
70 |
+
state: {
|
71 |
+
focus: 'ps--focus',
|
72 |
+
clicking: 'ps--clicking',
|
73 |
+
active: function (x) { return ("ps--active-" + x); },
|
74 |
+
scrolling: function (x) { return ("ps--scrolling-" + x); },
|
75 |
+
},
|
76 |
+
};
|
77 |
+
|
78 |
+
/*
|
79 |
+
* Helper methods
|
80 |
+
*/
|
81 |
+
var scrollingClassTimeout = { x: null, y: null };
|
82 |
+
|
83 |
+
function addScrollingClass(i, x) {
|
84 |
+
var classList = i.element.classList;
|
85 |
+
var className = cls.state.scrolling(x);
|
86 |
+
|
87 |
+
if (classList.contains(className)) {
|
88 |
+
clearTimeout(scrollingClassTimeout[x]);
|
89 |
+
} else {
|
90 |
+
classList.add(className);
|
91 |
+
}
|
92 |
+
}
|
93 |
+
|
94 |
+
function removeScrollingClass(i, x) {
|
95 |
+
scrollingClassTimeout[x] = setTimeout(
|
96 |
+
function () { return i.isAlive && i.element.classList.remove(cls.state.scrolling(x)); },
|
97 |
+
i.settings.scrollingThreshold
|
98 |
+
);
|
99 |
+
}
|
100 |
+
|
101 |
+
function setScrollingClassInstantly(i, x) {
|
102 |
+
addScrollingClass(i, x);
|
103 |
+
removeScrollingClass(i, x);
|
104 |
+
}
|
105 |
+
|
106 |
+
var EventElement = function EventElement(element) {
|
107 |
+
this.element = element;
|
108 |
+
this.handlers = {};
|
109 |
+
};
|
110 |
+
|
111 |
+
var prototypeAccessors = { isEmpty: { configurable: true } };
|
112 |
+
|
113 |
+
EventElement.prototype.bind = function bind (eventName, handler) {
|
114 |
+
if (typeof this.handlers[eventName] === 'undefined') {
|
115 |
+
this.handlers[eventName] = [];
|
116 |
+
}
|
117 |
+
this.handlers[eventName].push(handler);
|
118 |
+
this.element.addEventListener(eventName, handler, false);
|
119 |
+
};
|
120 |
+
|
121 |
+
EventElement.prototype.unbind = function unbind (eventName, target) {
|
122 |
+
var this$1 = this;
|
123 |
+
|
124 |
+
this.handlers[eventName] = this.handlers[eventName].filter(function (handler) {
|
125 |
+
if (target && handler !== target) {
|
126 |
+
return true;
|
127 |
+
}
|
128 |
+
this$1.element.removeEventListener(eventName, handler, false);
|
129 |
+
return false;
|
130 |
+
});
|
131 |
+
};
|
132 |
+
|
133 |
+
EventElement.prototype.unbindAll = function unbindAll () {
|
134 |
+
var this$1 = this;
|
135 |
+
|
136 |
+
for (var name in this$1.handlers) {
|
137 |
+
this$1.unbind(name);
|
138 |
+
}
|
139 |
+
};
|
140 |
+
|
141 |
+
prototypeAccessors.isEmpty.get = function () {
|
142 |
+
var this$1 = this;
|
143 |
+
|
144 |
+
return Object.keys(this.handlers).every(
|
145 |
+
function (key) { return this$1.handlers[key].length === 0; }
|
146 |
+
);
|
147 |
+
};
|
148 |
+
|
149 |
+
Object.defineProperties( EventElement.prototype, prototypeAccessors );
|
150 |
+
|
151 |
+
var EventManager = function EventManager() {
|
152 |
+
this.eventElements = [];
|
153 |
+
};
|
154 |
+
|
155 |
+
EventManager.prototype.eventElement = function eventElement (element) {
|
156 |
+
var ee = this.eventElements.filter(function (ee) { return ee.element === element; })[0];
|
157 |
+
if (!ee) {
|
158 |
+
ee = new EventElement(element);
|
159 |
+
this.eventElements.push(ee);
|
160 |
+
}
|
161 |
+
return ee;
|
162 |
+
};
|
163 |
+
|
164 |
+
EventManager.prototype.bind = function bind (element, eventName, handler) {
|
165 |
+
this.eventElement(element).bind(eventName, handler);
|
166 |
+
};
|
167 |
+
|
168 |
+
EventManager.prototype.unbind = function unbind (element, eventName, handler) {
|
169 |
+
var ee = this.eventElement(element);
|
170 |
+
ee.unbind(eventName, handler);
|
171 |
+
|
172 |
+
if (ee.isEmpty) {
|
173 |
+
// remove
|
174 |
+
this.eventElements.splice(this.eventElements.indexOf(ee), 1);
|
175 |
+
}
|
176 |
+
};
|
177 |
+
|
178 |
+
EventManager.prototype.unbindAll = function unbindAll () {
|
179 |
+
this.eventElements.forEach(function (e) { return e.unbindAll(); });
|
180 |
+
this.eventElements = [];
|
181 |
+
};
|
182 |
+
|
183 |
+
EventManager.prototype.once = function once (element, eventName, handler) {
|
184 |
+
var ee = this.eventElement(element);
|
185 |
+
var onceHandler = function (evt) {
|
186 |
+
ee.unbind(eventName, onceHandler);
|
187 |
+
handler(evt);
|
188 |
+
};
|
189 |
+
ee.bind(eventName, onceHandler);
|
190 |
+
};
|
191 |
+
|
192 |
+
function createEvent(name) {
|
193 |
+
if (typeof window.CustomEvent === 'function') {
|
194 |
+
return new CustomEvent(name);
|
195 |
+
} else {
|
196 |
+
var evt = document.createEvent('CustomEvent');
|
197 |
+
evt.initCustomEvent(name, false, false, undefined);
|
198 |
+
return evt;
|
199 |
+
}
|
200 |
+
}
|
201 |
+
|
202 |
+
var processScrollDiff = function(
|
203 |
+
i,
|
204 |
+
axis,
|
205 |
+
diff,
|
206 |
+
useScrollingClass,
|
207 |
+
forceFireReachEvent
|
208 |
+
) {
|
209 |
+
if ( useScrollingClass === void 0 ) useScrollingClass = true;
|
210 |
+
if ( forceFireReachEvent === void 0 ) forceFireReachEvent = false;
|
211 |
+
|
212 |
+
var fields;
|
213 |
+
if (axis === 'top') {
|
214 |
+
fields = [
|
215 |
+
'contentHeight',
|
216 |
+
'containerHeight',
|
217 |
+
'scrollTop',
|
218 |
+
'y',
|
219 |
+
'up',
|
220 |
+
'down' ];
|
221 |
+
} else if (axis === 'left') {
|
222 |
+
fields = [
|
223 |
+
'contentWidth',
|
224 |
+
'containerWidth',
|
225 |
+
'scrollLeft',
|
226 |
+
'x',
|
227 |
+
'left',
|
228 |
+
'right' ];
|
229 |
+
} else {
|
230 |
+
throw new Error('A proper axis should be provided');
|
231 |
+
}
|
232 |
+
|
233 |
+
processScrollDiff$1(i, diff, fields, useScrollingClass, forceFireReachEvent);
|
234 |
+
};
|
235 |
+
|
236 |
+
function processScrollDiff$1(
|
237 |
+
i,
|
238 |
+
diff,
|
239 |
+
ref,
|
240 |
+
useScrollingClass,
|
241 |
+
forceFireReachEvent
|
242 |
+
) {
|
243 |
+
var contentHeight = ref[0];
|
244 |
+
var containerHeight = ref[1];
|
245 |
+
var scrollTop = ref[2];
|
246 |
+
var y = ref[3];
|
247 |
+
var up = ref[4];
|
248 |
+
var down = ref[5];
|
249 |
+
if ( useScrollingClass === void 0 ) useScrollingClass = true;
|
250 |
+
if ( forceFireReachEvent === void 0 ) forceFireReachEvent = false;
|
251 |
+
|
252 |
+
var element = i.element;
|
253 |
+
|
254 |
+
// reset reach
|
255 |
+
i.reach[y] = null;
|
256 |
+
|
257 |
+
// 1 for subpixel rounding
|
258 |
+
if (element[scrollTop] < 1) {
|
259 |
+
i.reach[y] = 'start';
|
260 |
+
}
|
261 |
+
|
262 |
+
// 1 for subpixel rounding
|
263 |
+
if (element[scrollTop] > i[contentHeight] - i[containerHeight] - 1) {
|
264 |
+
i.reach[y] = 'end';
|
265 |
+
}
|
266 |
+
|
267 |
+
if (diff) {
|
268 |
+
element.dispatchEvent(createEvent(("ps-scroll-" + y)));
|
269 |
+
|
270 |
+
if (diff < 0) {
|
271 |
+
element.dispatchEvent(createEvent(("ps-scroll-" + up)));
|
272 |
+
} else if (diff > 0) {
|
273 |
+
element.dispatchEvent(createEvent(("ps-scroll-" + down)));
|
274 |
+
}
|
275 |
+
|
276 |
+
if (useScrollingClass) {
|
277 |
+
setScrollingClassInstantly(i, y);
|
278 |
+
}
|
279 |
+
}
|
280 |
+
|
281 |
+
if (i.reach[y] && (diff || forceFireReachEvent)) {
|
282 |
+
element.dispatchEvent(createEvent(("ps-" + y + "-reach-" + (i.reach[y]))));
|
283 |
+
}
|
284 |
+
}
|
285 |
+
|
286 |
+
function toInt(x) {
|
287 |
+
return parseInt(x, 10) || 0;
|
288 |
+
}
|
289 |
+
|
290 |
+
function isEditable(el) {
|
291 |
+
return (
|
292 |
+
matches(el, 'input,[contenteditable]') ||
|
293 |
+
matches(el, 'select,[contenteditable]') ||
|
294 |
+
matches(el, 'textarea,[contenteditable]') ||
|
295 |
+
matches(el, 'button,[contenteditable]')
|
296 |
+
);
|
297 |
+
}
|
298 |
+
|
299 |
+
function outerWidth(element) {
|
300 |
+
var styles = get(element);
|
301 |
+
return (
|
302 |
+
toInt(styles.width) +
|
303 |
+
toInt(styles.paddingLeft) +
|
304 |
+
toInt(styles.paddingRight) +
|
305 |
+
toInt(styles.borderLeftWidth) +
|
306 |
+
toInt(styles.borderRightWidth)
|
307 |
+
);
|
308 |
+
}
|
309 |
+
|
310 |
+
var env = {
|
311 |
+
isWebKit:
|
312 |
+
typeof document !== 'undefined' &&
|
313 |
+
'WebkitAppearance' in document.documentElement.style,
|
314 |
+
supportsTouch:
|
315 |
+
typeof window !== 'undefined' &&
|
316 |
+
('ontouchstart' in window ||
|
317 |
+
(window.DocumentTouch && document instanceof window.DocumentTouch)),
|
318 |
+
supportsIePointer:
|
319 |
+
typeof navigator !== 'undefined' && navigator.msMaxTouchPoints,
|
320 |
+
isChrome:
|
321 |
+
typeof navigator !== 'undefined' &&
|
322 |
+
/Chrome/i.test(navigator && navigator.userAgent),
|
323 |
+
};
|
324 |
+
|
325 |
+
var updateGeometry = function(i) {
|
326 |
+
var element = i.element;
|
327 |
+
var roundedScrollTop = Math.floor(element.scrollTop);
|
328 |
+
|
329 |
+
i.containerWidth = element.clientWidth;
|
330 |
+
i.containerHeight = element.clientHeight;
|
331 |
+
i.contentWidth = element.scrollWidth;
|
332 |
+
i.contentHeight = element.scrollHeight;
|
333 |
+
|
334 |
+
if (!element.contains(i.scrollbarXRail)) {
|
335 |
+
// clean up and append
|
336 |
+
queryChildren(element, cls.element.rail('x')).forEach(function (el) { return remove(el); }
|
337 |
+
);
|
338 |
+
element.appendChild(i.scrollbarXRail);
|
339 |
+
}
|
340 |
+
if (!element.contains(i.scrollbarYRail)) {
|
341 |
+
// clean up and append
|
342 |
+
queryChildren(element, cls.element.rail('y')).forEach(function (el) { return remove(el); }
|
343 |
+
);
|
344 |
+
element.appendChild(i.scrollbarYRail);
|
345 |
+
}
|
346 |
+
|
347 |
+
if (
|
348 |
+
!i.settings.suppressScrollX &&
|
349 |
+
i.containerWidth + i.settings.scrollXMarginOffset < i.contentWidth
|
350 |
+
) {
|
351 |
+
i.scrollbarXActive = true;
|
352 |
+
i.railXWidth = i.containerWidth - i.railXMarginWidth;
|
353 |
+
i.railXRatio = i.containerWidth / i.railXWidth;
|
354 |
+
i.scrollbarXWidth = getThumbSize(
|
355 |
+
i,
|
356 |
+
toInt(i.railXWidth * i.containerWidth / i.contentWidth)
|
357 |
+
);
|
358 |
+
i.scrollbarXLeft = toInt(
|
359 |
+
(i.negativeScrollAdjustment + element.scrollLeft) *
|
360 |
+
(i.railXWidth - i.scrollbarXWidth) /
|
361 |
+
(i.contentWidth - i.containerWidth)
|
362 |
+
);
|
363 |
+
} else {
|
364 |
+
i.scrollbarXActive = false;
|
365 |
+
}
|
366 |
+
|
367 |
+
if (
|
368 |
+
!i.settings.suppressScrollY &&
|
369 |
+
i.containerHeight + i.settings.scrollYMarginOffset < i.contentHeight
|
370 |
+
) {
|
371 |
+
i.scrollbarYActive = true;
|
372 |
+
i.railYHeight = i.containerHeight - i.railYMarginHeight;
|
373 |
+
i.railYRatio = i.containerHeight / i.railYHeight;
|
374 |
+
i.scrollbarYHeight = getThumbSize(
|
375 |
+
i,
|
376 |
+
toInt(i.railYHeight * i.containerHeight / i.contentHeight)
|
377 |
+
);
|
378 |
+
i.scrollbarYTop = toInt(
|
379 |
+
roundedScrollTop *
|
380 |
+
(i.railYHeight - i.scrollbarYHeight) /
|
381 |
+
(i.contentHeight - i.containerHeight)
|
382 |
+
);
|
383 |
+
} else {
|
384 |
+
i.scrollbarYActive = false;
|
385 |
+
}
|
386 |
+
|
387 |
+
if (i.scrollbarXLeft >= i.railXWidth - i.scrollbarXWidth) {
|
388 |
+
i.scrollbarXLeft = i.railXWidth - i.scrollbarXWidth;
|
389 |
+
}
|
390 |
+
if (i.scrollbarYTop >= i.railYHeight - i.scrollbarYHeight) {
|
391 |
+
i.scrollbarYTop = i.railYHeight - i.scrollbarYHeight;
|
392 |
+
}
|
393 |
+
|
394 |
+
updateCss(element, i);
|
395 |
+
|
396 |
+
if (i.scrollbarXActive) {
|
397 |
+
element.classList.add(cls.state.active('x'));
|
398 |
+
} else {
|
399 |
+
element.classList.remove(cls.state.active('x'));
|
400 |
+
i.scrollbarXWidth = 0;
|
401 |
+
i.scrollbarXLeft = 0;
|
402 |
+
element.scrollLeft = 0;
|
403 |
+
}
|
404 |
+
if (i.scrollbarYActive) {
|
405 |
+
element.classList.add(cls.state.active('y'));
|
406 |
+
} else {
|
407 |
+
element.classList.remove(cls.state.active('y'));
|
408 |
+
i.scrollbarYHeight = 0;
|
409 |
+
i.scrollbarYTop = 0;
|
410 |
+
element.scrollTop = 0;
|
411 |
+
}
|
412 |
+
};
|
413 |
+
|
414 |
+
function getThumbSize(i, thumbSize) {
|
415 |
+
if (i.settings.minScrollbarLength) {
|
416 |
+
thumbSize = Math.max(thumbSize, i.settings.minScrollbarLength);
|
417 |
+
}
|
418 |
+
if (i.settings.maxScrollbarLength) {
|
419 |
+
thumbSize = Math.min(thumbSize, i.settings.maxScrollbarLength);
|
420 |
+
}
|
421 |
+
return thumbSize;
|
422 |
+
}
|
423 |
+
|
424 |
+
function updateCss(element, i) {
|
425 |
+
var xRailOffset = { width: i.railXWidth };
|
426 |
+
var roundedScrollTop = Math.floor(element.scrollTop);
|
427 |
+
|
428 |
+
if (i.isRtl) {
|
429 |
+
xRailOffset.left =
|
430 |
+
i.negativeScrollAdjustment +
|
431 |
+
element.scrollLeft +
|
432 |
+
i.containerWidth -
|
433 |
+
i.contentWidth;
|
434 |
+
} else {
|
435 |
+
xRailOffset.left = element.scrollLeft;
|
436 |
+
}
|
437 |
+
if (i.isScrollbarXUsingBottom) {
|
438 |
+
xRailOffset.bottom = i.scrollbarXBottom - roundedScrollTop;
|
439 |
+
} else {
|
440 |
+
xRailOffset.top = i.scrollbarXTop + roundedScrollTop;
|
441 |
+
}
|
442 |
+
set(i.scrollbarXRail, xRailOffset);
|
443 |
+
|
444 |
+
var yRailOffset = { top: roundedScrollTop, height: i.railYHeight };
|
445 |
+
if (i.isScrollbarYUsingRight) {
|
446 |
+
if (i.isRtl) {
|
447 |
+
yRailOffset.right =
|
448 |
+
i.contentWidth -
|
449 |
+
(i.negativeScrollAdjustment + element.scrollLeft) -
|
450 |
+
i.scrollbarYRight -
|
451 |
+
i.scrollbarYOuterWidth;
|
452 |
+
} else {
|
453 |
+
yRailOffset.right = i.scrollbarYRight - element.scrollLeft;
|
454 |
+
}
|
455 |
+
} else {
|
456 |
+
if (i.isRtl) {
|
457 |
+
yRailOffset.left =
|
458 |
+
i.negativeScrollAdjustment +
|
459 |
+
element.scrollLeft +
|
460 |
+
i.containerWidth * 2 -
|
461 |
+
i.contentWidth -
|
462 |
+
i.scrollbarYLeft -
|
463 |
+
i.scrollbarYOuterWidth;
|
464 |
+
} else {
|
465 |
+
yRailOffset.left = i.scrollbarYLeft + element.scrollLeft;
|
466 |
+
}
|
467 |
+
}
|
468 |
+
set(i.scrollbarYRail, yRailOffset);
|
469 |
+
|
470 |
+
set(i.scrollbarX, {
|
471 |
+
left: i.scrollbarXLeft,
|
472 |
+
width: i.scrollbarXWidth - i.railBorderXWidth,
|
473 |
+
});
|
474 |
+
set(i.scrollbarY, {
|
475 |
+
top: i.scrollbarYTop,
|
476 |
+
height: i.scrollbarYHeight - i.railBorderYWidth,
|
477 |
+
});
|
478 |
+
}
|
479 |
+
|
480 |
+
var clickRail = function(i) {
|
481 |
+
i.event.bind(i.scrollbarY, 'mousedown', function (e) { return e.stopPropagation(); });
|
482 |
+
i.event.bind(i.scrollbarYRail, 'mousedown', function (e) {
|
483 |
+
var positionTop =
|
484 |
+
e.pageY -
|
485 |
+
window.pageYOffset -
|
486 |
+
i.scrollbarYRail.getBoundingClientRect().top;
|
487 |
+
var direction = positionTop > i.scrollbarYTop ? 1 : -1;
|
488 |
+
|
489 |
+
i.element.scrollTop += direction * i.containerHeight;
|
490 |
+
updateGeometry(i);
|
491 |
+
|
492 |
+
e.stopPropagation();
|
493 |
+
});
|
494 |
+
|
495 |
+
i.event.bind(i.scrollbarX, 'mousedown', function (e) { return e.stopPropagation(); });
|
496 |
+
i.event.bind(i.scrollbarXRail, 'mousedown', function (e) {
|
497 |
+
var positionLeft =
|
498 |
+
e.pageX -
|
499 |
+
window.pageXOffset -
|
500 |
+
i.scrollbarXRail.getBoundingClientRect().left;
|
501 |
+
var direction = positionLeft > i.scrollbarXLeft ? 1 : -1;
|
502 |
+
|
503 |
+
i.element.scrollLeft += direction * i.containerWidth;
|
504 |
+
updateGeometry(i);
|
505 |
+
|
506 |
+
e.stopPropagation();
|
507 |
+
});
|
508 |
+
};
|
509 |
+
|
510 |
+
var dragThumb = function(i) {
|
511 |
+
bindMouseScrollHandler(i, [
|
512 |
+
'containerWidth',
|
513 |
+
'contentWidth',
|
514 |
+
'pageX',
|
515 |
+
'railXWidth',
|
516 |
+
'scrollbarX',
|
517 |
+
'scrollbarXWidth',
|
518 |
+
'scrollLeft',
|
519 |
+
'x',
|
520 |
+
'scrollbarXRail' ]);
|
521 |
+
bindMouseScrollHandler(i, [
|
522 |
+
'containerHeight',
|
523 |
+
'contentHeight',
|
524 |
+
'pageY',
|
525 |
+
'railYHeight',
|
526 |
+
'scrollbarY',
|
527 |
+
'scrollbarYHeight',
|
528 |
+
'scrollTop',
|
529 |
+
'y',
|
530 |
+
'scrollbarYRail' ]);
|
531 |
+
};
|
532 |
+
|
533 |
+
function bindMouseScrollHandler(
|
534 |
+
i,
|
535 |
+
ref
|
536 |
+
) {
|
537 |
+
var containerHeight = ref[0];
|
538 |
+
var contentHeight = ref[1];
|
539 |
+
var pageY = ref[2];
|
540 |
+
var railYHeight = ref[3];
|
541 |
+
var scrollbarY = ref[4];
|
542 |
+
var scrollbarYHeight = ref[5];
|
543 |
+
var scrollTop = ref[6];
|
544 |
+
var y = ref[7];
|
545 |
+
var scrollbarYRail = ref[8];
|
546 |
+
|
547 |
+
var element = i.element;
|
548 |
+
|
549 |
+
var startingScrollTop = null;
|
550 |
+
var startingMousePageY = null;
|
551 |
+
var scrollBy = null;
|
552 |
+
|
553 |
+
function mouseMoveHandler(e) {
|
554 |
+
element[scrollTop] =
|
555 |
+
startingScrollTop + scrollBy * (e[pageY] - startingMousePageY);
|
556 |
+
addScrollingClass(i, y);
|
557 |
+
updateGeometry(i);
|
558 |
+
|
559 |
+
e.stopPropagation();
|
560 |
+
e.preventDefault();
|
561 |
+
}
|
562 |
+
|
563 |
+
function mouseUpHandler() {
|
564 |
+
removeScrollingClass(i, y);
|
565 |
+
i[scrollbarYRail].classList.remove(cls.state.clicking);
|
566 |
+
i.event.unbind(i.ownerDocument, 'mousemove', mouseMoveHandler);
|
567 |
+
}
|
568 |
+
|
569 |
+
i.event.bind(i[scrollbarY], 'mousedown', function (e) {
|
570 |
+
startingScrollTop = element[scrollTop];
|
571 |
+
startingMousePageY = e[pageY];
|
572 |
+
scrollBy =
|
573 |
+
(i[contentHeight] - i[containerHeight]) /
|
574 |
+
(i[railYHeight] - i[scrollbarYHeight]);
|
575 |
+
|
576 |
+
i.event.bind(i.ownerDocument, 'mousemove', mouseMoveHandler);
|
577 |
+
i.event.once(i.ownerDocument, 'mouseup', mouseUpHandler);
|
578 |
+
|
579 |
+
i[scrollbarYRail].classList.add(cls.state.clicking);
|
580 |
+
|
581 |
+
e.stopPropagation();
|
582 |
+
e.preventDefault();
|
583 |
+
});
|
584 |
+
}
|
585 |
+
|
586 |
+
var keyboard = function(i) {
|
587 |
+
var element = i.element;
|
588 |
+
|
589 |
+
var elementHovered = function () { return matches(element, ':hover'); };
|
590 |
+
var scrollbarFocused = function () { return matches(i.scrollbarX, ':focus') || matches(i.scrollbarY, ':focus'); };
|
591 |
+
|
592 |
+
function shouldPreventDefault(deltaX, deltaY) {
|
593 |
+
var scrollTop = Math.floor(element.scrollTop);
|
594 |
+
if (deltaX === 0) {
|
595 |
+
if (!i.scrollbarYActive) {
|
596 |
+
return false;
|
597 |
+
}
|
598 |
+
if (
|
599 |
+
(scrollTop === 0 && deltaY > 0) ||
|
600 |
+
(scrollTop >= i.contentHeight - i.containerHeight && deltaY < 0)
|
601 |
+
) {
|
602 |
+
return !i.settings.wheelPropagation;
|
603 |
+
}
|
604 |
+
}
|
605 |
+
|
606 |
+
var scrollLeft = element.scrollLeft;
|
607 |
+
if (deltaY === 0) {
|
608 |
+
if (!i.scrollbarXActive) {
|
609 |
+
return false;
|
610 |
+
}
|
611 |
+
if (
|
612 |
+
(scrollLeft === 0 && deltaX < 0) ||
|
613 |
+
(scrollLeft >= i.contentWidth - i.containerWidth && deltaX > 0)
|
614 |
+
) {
|
615 |
+
return !i.settings.wheelPropagation;
|
616 |
+
}
|
617 |
+
}
|
618 |
+
return true;
|
619 |
+
}
|
620 |
+
|
621 |
+
i.event.bind(i.ownerDocument, 'keydown', function (e) {
|
622 |
+
if (
|
623 |
+
(e.isDefaultPrevented && e.isDefaultPrevented()) ||
|
624 |
+
e.defaultPrevented
|
625 |
+
) {
|
626 |
+
return;
|
627 |
+
}
|
628 |
+
|
629 |
+
if (!elementHovered() && !scrollbarFocused()) {
|
630 |
+
return;
|
631 |
+
}
|
632 |
+
|
633 |
+
var activeElement = document.activeElement
|
634 |
+
? document.activeElement
|
635 |
+
: i.ownerDocument.activeElement;
|
636 |
+
if (activeElement) {
|
637 |
+
if (activeElement.tagName === 'IFRAME') {
|
638 |
+
activeElement = activeElement.contentDocument.activeElement;
|
639 |
+
} else {
|
640 |
+
// go deeper if element is a webcomponent
|
641 |
+
while (activeElement.shadowRoot) {
|
642 |
+
activeElement = activeElement.shadowRoot.activeElement;
|
643 |
+
}
|
644 |
+
}
|
645 |
+
if (isEditable(activeElement)) {
|
646 |
+
return;
|
647 |
+
}
|
648 |
+
}
|
649 |
+
|
650 |
+
var deltaX = 0;
|
651 |
+
var deltaY = 0;
|
652 |
+
|
653 |
+
switch (e.which) {
|
654 |
+
case 37: // left
|
655 |
+
if (e.metaKey) {
|
656 |
+
deltaX = -i.contentWidth;
|
657 |
+
} else if (e.altKey) {
|
658 |
+
deltaX = -i.containerWidth;
|
659 |
+
} else {
|
660 |
+
deltaX = -30;
|
661 |
+
}
|
662 |
+
break;
|
663 |
+
case 38: // up
|
664 |
+
if (e.metaKey) {
|
665 |
+
deltaY = i.contentHeight;
|
666 |
+
} else if (e.altKey) {
|
667 |
+
deltaY = i.containerHeight;
|
668 |
+
} else {
|
669 |
+
deltaY = 30;
|
670 |
+
}
|
671 |
+
break;
|
672 |
+
case 39: // right
|
673 |
+
if (e.metaKey) {
|
674 |
+
deltaX = i.contentWidth;
|
675 |
+
} else if (e.altKey) {
|
676 |
+
deltaX = i.containerWidth;
|
677 |
+
} else {
|
678 |
+
deltaX = 30;
|
679 |
+
}
|
680 |
+
break;
|
681 |
+
case 40: // down
|
682 |
+
if (e.metaKey) {
|
683 |
+
deltaY = -i.contentHeight;
|
684 |
+
} else if (e.altKey) {
|
685 |
+
deltaY = -i.containerHeight;
|
686 |
+
} else {
|
687 |
+
deltaY = -30;
|
688 |
+
}
|
689 |
+
break;
|
690 |
+
case 32: // space bar
|
691 |
+
if (e.shiftKey) {
|
692 |
+
deltaY = i.containerHeight;
|
693 |
+
} else {
|
694 |
+
deltaY = -i.containerHeight;
|
695 |
+
}
|
696 |
+
break;
|
697 |
+
case 33: // page up
|
698 |
+
deltaY = i.containerHeight;
|
699 |
+
break;
|
700 |
+
case 34: // page down
|
701 |
+
deltaY = -i.containerHeight;
|
702 |
+
break;
|
703 |
+
case 36: // home
|
704 |
+
deltaY = i.contentHeight;
|
705 |
+
break;
|
706 |
+
case 35: // end
|
707 |
+
deltaY = -i.contentHeight;
|
708 |
+
break;
|
709 |
+
default:
|
710 |
+
return;
|
711 |
+
}
|
712 |
+
|
713 |
+
if (i.settings.suppressScrollX && deltaX !== 0) {
|
714 |
+
return;
|
715 |
+
}
|
716 |
+
if (i.settings.suppressScrollY && deltaY !== 0) {
|
717 |
+
return;
|
718 |
+
}
|
719 |
+
|
720 |
+
element.scrollTop -= deltaY;
|
721 |
+
element.scrollLeft += deltaX;
|
722 |
+
updateGeometry(i);
|
723 |
+
|
724 |
+
if (shouldPreventDefault(deltaX, deltaY)) {
|
725 |
+
e.preventDefault();
|
726 |
+
}
|
727 |
+
});
|
728 |
+
};
|
729 |
+
|
730 |
+
var wheel = function(i) {
|
731 |
+
var element = i.element;
|
732 |
+
|
733 |
+
function shouldPreventDefault(deltaX, deltaY) {
|
734 |
+
var roundedScrollTop = Math.floor(element.scrollTop);
|
735 |
+
var isTop = element.scrollTop === 0;
|
736 |
+
var isBottom =
|
737 |
+
roundedScrollTop + element.offsetHeight === element.scrollHeight;
|
738 |
+
var isLeft = element.scrollLeft === 0;
|
739 |
+
var isRight =
|
740 |
+
element.scrollLeft + element.offsetWidth === element.scrollWidth;
|
741 |
+
|
742 |
+
var hitsBound;
|
743 |
+
|
744 |
+
// pick axis with primary direction
|
745 |
+
if (Math.abs(deltaY) > Math.abs(deltaX)) {
|
746 |
+
hitsBound = isTop || isBottom;
|
747 |
+
} else {
|
748 |
+
hitsBound = isLeft || isRight;
|
749 |
+
}
|
750 |
+
|
751 |
+
return hitsBound ? !i.settings.wheelPropagation : true;
|
752 |
+
}
|
753 |
+
|
754 |
+
function getDeltaFromEvent(e) {
|
755 |
+
var deltaX = e.deltaX;
|
756 |
+
var deltaY = -1 * e.deltaY;
|
757 |
+
|
758 |
+
if (typeof deltaX === 'undefined' || typeof deltaY === 'undefined') {
|
759 |
+
// OS X Safari
|
760 |
+
deltaX = -1 * e.wheelDeltaX / 6;
|
761 |
+
deltaY = e.wheelDeltaY / 6;
|
762 |
+
}
|
763 |
+
|
764 |
+
if (e.deltaMode && e.deltaMode === 1) {
|
765 |
+
// Firefox in deltaMode 1: Line scrolling
|
766 |
+
deltaX *= 10;
|
767 |
+
deltaY *= 10;
|
768 |
+
}
|
769 |
+
|
770 |
+
if (deltaX !== deltaX && deltaY !== deltaY /* NaN checks */) {
|
771 |
+
// IE in some mouse drivers
|
772 |
+
deltaX = 0;
|
773 |
+
deltaY = e.wheelDelta;
|
774 |
+
}
|
775 |
+
|
776 |
+
if (e.shiftKey) {
|
777 |
+
// reverse axis with shift key
|
778 |
+
return [-deltaY, -deltaX];
|
779 |
+
}
|
780 |
+
return [deltaX, deltaY];
|
781 |
+
}
|
782 |
+
|
783 |
+
function shouldBeConsumedByChild(target, deltaX, deltaY) {
|
784 |
+
// FIXME: this is a workaround for <select> issue in FF and IE #571
|
785 |
+
if (!env.isWebKit && element.querySelector('select:focus')) {
|
786 |
+
return true;
|
787 |
+
}
|
788 |
+
|
789 |
+
if (!element.contains(target)) {
|
790 |
+
return false;
|
791 |
+
}
|
792 |
+
|
793 |
+
var cursor = target;
|
794 |
+
|
795 |
+
while (cursor && cursor !== element) {
|
796 |
+
if (cursor.classList.contains(cls.element.consuming)) {
|
797 |
+
return true;
|
798 |
+
}
|
799 |
+
|
800 |
+
var style = get(cursor);
|
801 |
+
var overflow = [style.overflow, style.overflowX, style.overflowY].join(
|
802 |
+
''
|
803 |
+
);
|
804 |
+
|
805 |
+
// if scrollable
|
806 |
+
if (overflow.match(/(scroll|auto)/)) {
|
807 |
+
var maxScrollTop = cursor.scrollHeight - cursor.clientHeight;
|
808 |
+
if (maxScrollTop > 0) {
|
809 |
+
if (
|
810 |
+
!(cursor.scrollTop === 0 && deltaY > 0) &&
|
811 |
+
!(cursor.scrollTop === maxScrollTop && deltaY < 0)
|
812 |
+
) {
|
813 |
+
return true;
|
814 |
+
}
|
815 |
+
}
|
816 |
+
var maxScrollLeft = cursor.scrollWidth - cursor.clientWidth;
|
817 |
+
if (maxScrollLeft > 0) {
|
818 |
+
if (
|
819 |
+
!(cursor.scrollLeft === 0 && deltaX < 0) &&
|
820 |
+
!(cursor.scrollLeft === maxScrollLeft && deltaX > 0)
|
821 |
+
) {
|
822 |
+
return true;
|
823 |
+
}
|
824 |
+
}
|
825 |
+
}
|
826 |
+
|
827 |
+
cursor = cursor.parentNode;
|
828 |
+
}
|
829 |
+
|
830 |
+
return false;
|
831 |
+
}
|
832 |
+
|
833 |
+
function mousewheelHandler(e) {
|
834 |
+
var ref = getDeltaFromEvent(e);
|
835 |
+
var deltaX = ref[0];
|
836 |
+
var deltaY = ref[1];
|
837 |
+
|
838 |
+
if (shouldBeConsumedByChild(e.target, deltaX, deltaY)) {
|
839 |
+
return;
|
840 |
+
}
|
841 |
+
|
842 |
+
var shouldPrevent = false;
|
843 |
+
if (!i.settings.useBothWheelAxes) {
|
844 |
+
// deltaX will only be used for horizontal scrolling and deltaY will
|
845 |
+
// only be used for vertical scrolling - this is the default
|
846 |
+
element.scrollTop -= deltaY * i.settings.wheelSpeed;
|
847 |
+
element.scrollLeft += deltaX * i.settings.wheelSpeed;
|
848 |
+
} else if (i.scrollbarYActive && !i.scrollbarXActive) {
|
849 |
+
// only vertical scrollbar is active and useBothWheelAxes option is
|
850 |
+
// active, so let's scroll vertical bar using both mouse wheel axes
|
851 |
+
if (deltaY) {
|
852 |
+
element.scrollTop -= deltaY * i.settings.wheelSpeed;
|
853 |
+
} else {
|
854 |
+
element.scrollTop += deltaX * i.settings.wheelSpeed;
|
855 |
+
}
|
856 |
+
shouldPrevent = true;
|
857 |
+
} else if (i.scrollbarXActive && !i.scrollbarYActive) {
|
858 |
+
// useBothWheelAxes and only horizontal bar is active, so use both
|
859 |
+
// wheel axes for horizontal bar
|
860 |
+
if (deltaX) {
|
861 |
+
element.scrollLeft += deltaX * i.settings.wheelSpeed;
|
862 |
+
} else {
|
863 |
+
element.scrollLeft -= deltaY * i.settings.wheelSpeed;
|
864 |
+
}
|
865 |
+
shouldPrevent = true;
|
866 |
+
}
|
867 |
+
|
868 |
+
updateGeometry(i);
|
869 |
+
|
870 |
+
shouldPrevent = shouldPrevent || shouldPreventDefault(deltaX, deltaY);
|
871 |
+
if (shouldPrevent && !e.ctrlKey) {
|
872 |
+
e.stopPropagation();
|
873 |
+
e.preventDefault();
|
874 |
+
}
|
875 |
+
}
|
876 |
+
|
877 |
+
if (typeof window.onwheel !== 'undefined') {
|
878 |
+
i.event.bind(element, 'wheel', mousewheelHandler);
|
879 |
+
} else if (typeof window.onmousewheel !== 'undefined') {
|
880 |
+
i.event.bind(element, 'mousewheel', mousewheelHandler);
|
881 |
+
}
|
882 |
+
};
|
883 |
+
|
884 |
+
var touch = function(i) {
|
885 |
+
if (!env.supportsTouch && !env.supportsIePointer) {
|
886 |
+
return;
|
887 |
+
}
|
888 |
+
|
889 |
+
var element = i.element;
|
890 |
+
|
891 |
+
function shouldPrevent(deltaX, deltaY) {
|
892 |
+
var scrollTop = Math.floor(element.scrollTop);
|
893 |
+
var scrollLeft = element.scrollLeft;
|
894 |
+
var magnitudeX = Math.abs(deltaX);
|
895 |
+
var magnitudeY = Math.abs(deltaY);
|
896 |
+
|
897 |
+
if (magnitudeY > magnitudeX) {
|
898 |
+
// user is perhaps trying to swipe up/down the page
|
899 |
+
|
900 |
+
if (
|
901 |
+
(deltaY < 0 && scrollTop === i.contentHeight - i.containerHeight) ||
|
902 |
+
(deltaY > 0 && scrollTop === 0)
|
903 |
+
) {
|
904 |
+
// set prevent for mobile Chrome refresh
|
905 |
+
return window.scrollY === 0 && deltaY > 0 && env.isChrome;
|
906 |
+
}
|
907 |
+
} else if (magnitudeX > magnitudeY) {
|
908 |
+
// user is perhaps trying to swipe left/right across the page
|
909 |
+
|
910 |
+
if (
|
911 |
+
(deltaX < 0 && scrollLeft === i.contentWidth - i.containerWidth) ||
|
912 |
+
(deltaX > 0 && scrollLeft === 0)
|
913 |
+
) {
|
914 |
+
return true;
|
915 |
+
}
|
916 |
+
}
|
917 |
+
|
918 |
+
return true;
|
919 |
+
}
|
920 |
+
|
921 |
+
function applyTouchMove(differenceX, differenceY) {
|
922 |
+
element.scrollTop -= differenceY;
|
923 |
+
element.scrollLeft -= differenceX;
|
924 |
+
|
925 |
+
updateGeometry(i);
|
926 |
+
}
|
927 |
+
|
928 |
+
var startOffset = {};
|
929 |
+
var startTime = 0;
|
930 |
+
var speed = {};
|
931 |
+
var easingLoop = null;
|
932 |
+
|
933 |
+
function getTouch(e) {
|
934 |
+
if (e.targetTouches) {
|
935 |
+
return e.targetTouches[0];
|
936 |
+
} else {
|
937 |
+
// Maybe IE pointer
|
938 |
+
return e;
|
939 |
+
}
|
940 |
+
}
|
941 |
+
|
942 |
+
function shouldHandle(e) {
|
943 |
+
if (e.pointerType && e.pointerType === 'pen' && e.buttons === 0) {
|
944 |
+
return false;
|
945 |
+
}
|
946 |
+
if (e.targetTouches && e.targetTouches.length === 1) {
|
947 |
+
return true;
|
948 |
+
}
|
949 |
+
if (
|
950 |
+
e.pointerType &&
|
951 |
+
e.pointerType !== 'mouse' &&
|
952 |
+
e.pointerType !== e.MSPOINTER_TYPE_MOUSE
|
953 |
+
) {
|
954 |
+
return true;
|
955 |
+
}
|
956 |
+
return false;
|
957 |
+
}
|
958 |
+
|
959 |
+
function touchStart(e) {
|
960 |
+
if (!shouldHandle(e)) {
|
961 |
+
return;
|
962 |
+
}
|
963 |
+
|
964 |
+
var touch = getTouch(e);
|
965 |
+
|
966 |
+
startOffset.pageX = touch.pageX;
|
967 |
+
startOffset.pageY = touch.pageY;
|
968 |
+
|
969 |
+
startTime = new Date().getTime();
|
970 |
+
|
971 |
+
if (easingLoop !== null) {
|
972 |
+
clearInterval(easingLoop);
|
973 |
+
}
|
974 |
+
}
|
975 |
+
|
976 |
+
function shouldBeConsumedByChild(target, deltaX, deltaY) {
|
977 |
+
if (!element.contains(target)) {
|
978 |
+
return false;
|
979 |
+
}
|
980 |
+
|
981 |
+
var cursor = target;
|
982 |
+
|
983 |
+
while (cursor && cursor !== element) {
|
984 |
+
if (cursor.classList.contains(cls.element.consuming)) {
|
985 |
+
return true;
|
986 |
+
}
|
987 |
+
|
988 |
+
var style = get(cursor);
|
989 |
+
var overflow = [style.overflow, style.overflowX, style.overflowY].join(
|
990 |
+
''
|
991 |
+
);
|
992 |
+
|
993 |
+
// if scrollable
|
994 |
+
if (overflow.match(/(scroll|auto)/)) {
|
995 |
+
var maxScrollTop = cursor.scrollHeight - cursor.clientHeight;
|
996 |
+
if (maxScrollTop > 0) {
|
997 |
+
if (
|
998 |
+
!(cursor.scrollTop === 0 && deltaY > 0) &&
|
999 |
+
!(cursor.scrollTop === maxScrollTop && deltaY < 0)
|
1000 |
+
) {
|
1001 |
+
return true;
|
1002 |
+
}
|
1003 |
+
}
|
1004 |
+
var maxScrollLeft = cursor.scrollLeft - cursor.clientWidth;
|
1005 |
+
if (maxScrollLeft > 0) {
|
1006 |
+
if (
|
1007 |
+
!(cursor.scrollLeft === 0 && deltaX < 0) &&
|
1008 |
+
!(cursor.scrollLeft === maxScrollLeft && deltaX > 0)
|
1009 |
+
) {
|
1010 |
+
return true;
|
1011 |
+
}
|
1012 |
+
}
|
1013 |
+
}
|
1014 |
+
|
1015 |
+
cursor = cursor.parentNode;
|
1016 |
+
}
|
1017 |
+
|
1018 |
+
return false;
|
1019 |
+
}
|
1020 |
+
|
1021 |
+
function touchMove(e) {
|
1022 |
+
if (shouldHandle(e)) {
|
1023 |
+
var touch = getTouch(e);
|
1024 |
+
|
1025 |
+
var currentOffset = { pageX: touch.pageX, pageY: touch.pageY };
|
1026 |
+
|
1027 |
+
var differenceX = currentOffset.pageX - startOffset.pageX;
|
1028 |
+
var differenceY = currentOffset.pageY - startOffset.pageY;
|
1029 |
+
|
1030 |
+
if (shouldBeConsumedByChild(e.target, differenceX, differenceY)) {
|
1031 |
+
return;
|
1032 |
+
}
|
1033 |
+
|
1034 |
+
applyTouchMove(differenceX, differenceY);
|
1035 |
+
startOffset = currentOffset;
|
1036 |
+
|
1037 |
+
var currentTime = new Date().getTime();
|
1038 |
+
|
1039 |
+
var timeGap = currentTime - startTime;
|
1040 |
+
if (timeGap > 0) {
|
1041 |
+
speed.x = differenceX / timeGap;
|
1042 |
+
speed.y = differenceY / timeGap;
|
1043 |
+
startTime = currentTime;
|
1044 |
+
}
|
1045 |
+
|
1046 |
+
if (shouldPrevent(differenceX, differenceY)) {
|
1047 |
+
e.preventDefault();
|
1048 |
+
}
|
1049 |
+
}
|
1050 |
+
}
|
1051 |
+
function touchEnd() {
|
1052 |
+
if (i.settings.swipeEasing) {
|
1053 |
+
clearInterval(easingLoop);
|
1054 |
+
easingLoop = setInterval(function() {
|
1055 |
+
if (i.isInitialized) {
|
1056 |
+
clearInterval(easingLoop);
|
1057 |
+
return;
|
1058 |
+
}
|
1059 |
+
|
1060 |
+
if (!speed.x && !speed.y) {
|
1061 |
+
clearInterval(easingLoop);
|
1062 |
+
return;
|
1063 |
+
}
|
1064 |
+
|
1065 |
+
if (Math.abs(speed.x) < 0.01 && Math.abs(speed.y) < 0.01) {
|
1066 |
+
clearInterval(easingLoop);
|
1067 |
+
return;
|
1068 |
+
}
|
1069 |
+
|
1070 |
+
applyTouchMove(speed.x * 30, speed.y * 30);
|
1071 |
+
|
1072 |
+
speed.x *= 0.8;
|
1073 |
+
speed.y *= 0.8;
|
1074 |
+
}, 10);
|
1075 |
+
}
|
1076 |
+
}
|
1077 |
+
|
1078 |
+
if (env.supportsTouch) {
|
1079 |
+
i.event.bind(element, 'touchstart', touchStart);
|
1080 |
+
i.event.bind(element, 'touchmove', touchMove);
|
1081 |
+
i.event.bind(element, 'touchend', touchEnd);
|
1082 |
+
} else if (env.supportsIePointer) {
|
1083 |
+
if (window.PointerEvent) {
|
1084 |
+
i.event.bind(element, 'pointerdown', touchStart);
|
1085 |
+
i.event.bind(element, 'pointermove', touchMove);
|
1086 |
+
i.event.bind(element, 'pointerup', touchEnd);
|
1087 |
+
} else if (window.MSPointerEvent) {
|
1088 |
+
i.event.bind(element, 'MSPointerDown', touchStart);
|
1089 |
+
i.event.bind(element, 'MSPointerMove', touchMove);
|
1090 |
+
i.event.bind(element, 'MSPointerUp', touchEnd);
|
1091 |
+
}
|
1092 |
+
}
|
1093 |
+
};
|
1094 |
+
|
1095 |
+
var defaultSettings = function () { return ({
|
1096 |
+
handlers: ['click-rail', 'drag-thumb', 'keyboard', 'wheel', 'touch'],
|
1097 |
+
maxScrollbarLength: null,
|
1098 |
+
minScrollbarLength: null,
|
1099 |
+
scrollingThreshold: 1000,
|
1100 |
+
scrollXMarginOffset: 0,
|
1101 |
+
scrollYMarginOffset: 0,
|
1102 |
+
suppressScrollX: false,
|
1103 |
+
suppressScrollY: false,
|
1104 |
+
swipeEasing: true,
|
1105 |
+
useBothWheelAxes: false,
|
1106 |
+
wheelPropagation: true,
|
1107 |
+
wheelSpeed: 1,
|
1108 |
+
}); };
|
1109 |
+
|
1110 |
+
var handlers = {
|
1111 |
+
'click-rail': clickRail,
|
1112 |
+
'drag-thumb': dragThumb,
|
1113 |
+
keyboard: keyboard,
|
1114 |
+
wheel: wheel,
|
1115 |
+
touch: touch,
|
1116 |
+
};
|
1117 |
+
|
1118 |
+
var PerfectScrollbar = function PerfectScrollbar(element, userSettings) {
|
1119 |
+
var this$1 = this;
|
1120 |
+
if ( userSettings === void 0 ) userSettings = {};
|
1121 |
+
|
1122 |
+
if (typeof element === 'string') {
|
1123 |
+
element = document.querySelector(element);
|
1124 |
+
}
|
1125 |
+
|
1126 |
+
if (!element || !element.nodeName) {
|
1127 |
+
throw new Error('no element is specified to initialize PerfectScrollbar');
|
1128 |
+
}
|
1129 |
+
|
1130 |
+
this.element = element;
|
1131 |
+
|
1132 |
+
element.classList.add(cls.main);
|
1133 |
+
|
1134 |
+
this.settings = defaultSettings();
|
1135 |
+
for (var key in userSettings) {
|
1136 |
+
this$1.settings[key] = userSettings[key];
|
1137 |
+
}
|
1138 |
+
|
1139 |
+
this.containerWidth = null;
|
1140 |
+
this.containerHeight = null;
|
1141 |
+
this.contentWidth = null;
|
1142 |
+
this.contentHeight = null;
|
1143 |
+
|
1144 |
+
var focus = function () { return element.classList.add(cls.state.focus); };
|
1145 |
+
var blur = function () { return element.classList.remove(cls.state.focus); };
|
1146 |
+
|
1147 |
+
this.isRtl = get(element).direction === 'rtl';
|
1148 |
+
this.isNegativeScroll = (function () {
|
1149 |
+
var originalScrollLeft = element.scrollLeft;
|
1150 |
+
var result = null;
|
1151 |
+
element.scrollLeft = -1;
|
1152 |
+
result = element.scrollLeft < 0;
|
1153 |
+
element.scrollLeft = originalScrollLeft;
|
1154 |
+
return result;
|
1155 |
+
})();
|
1156 |
+
this.negativeScrollAdjustment = this.isNegativeScroll
|
1157 |
+
? element.scrollWidth - element.clientWidth
|
1158 |
+
: 0;
|
1159 |
+
this.event = new EventManager();
|
1160 |
+
this.ownerDocument = element.ownerDocument || document;
|
1161 |
+
|
1162 |
+
this.scrollbarXRail = div(cls.element.rail('x'));
|
1163 |
+
element.appendChild(this.scrollbarXRail);
|
1164 |
+
this.scrollbarX = div(cls.element.thumb('x'));
|
1165 |
+
this.scrollbarXRail.appendChild(this.scrollbarX);
|
1166 |
+
this.scrollbarX.setAttribute('tabindex', 0);
|
1167 |
+
this.event.bind(this.scrollbarX, 'focus', focus);
|
1168 |
+
this.event.bind(this.scrollbarX, 'blur', blur);
|
1169 |
+
this.scrollbarXActive = null;
|
1170 |
+
this.scrollbarXWidth = null;
|
1171 |
+
this.scrollbarXLeft = null;
|
1172 |
+
var railXStyle = get(this.scrollbarXRail);
|
1173 |
+
this.scrollbarXBottom = parseInt(railXStyle.bottom, 10);
|
1174 |
+
if (isNaN(this.scrollbarXBottom)) {
|
1175 |
+
this.isScrollbarXUsingBottom = false;
|
1176 |
+
this.scrollbarXTop = toInt(railXStyle.top);
|
1177 |
+
} else {
|
1178 |
+
this.isScrollbarXUsingBottom = true;
|
1179 |
+
}
|
1180 |
+
this.railBorderXWidth =
|
1181 |
+
toInt(railXStyle.borderLeftWidth) + toInt(railXStyle.borderRightWidth);
|
1182 |
+
// Set rail to display:block to calculate margins
|
1183 |
+
set(this.scrollbarXRail, { display: 'block' });
|
1184 |
+
this.railXMarginWidth =
|
1185 |
+
toInt(railXStyle.marginLeft) + toInt(railXStyle.marginRight);
|
1186 |
+
set(this.scrollbarXRail, { display: '' });
|
1187 |
+
this.railXWidth = null;
|
1188 |
+
this.railXRatio = null;
|
1189 |
+
|
1190 |
+
this.scrollbarYRail = div(cls.element.rail('y'));
|
1191 |
+
element.appendChild(this.scrollbarYRail);
|
1192 |
+
this.scrollbarY = div(cls.element.thumb('y'));
|
1193 |
+
this.scrollbarYRail.appendChild(this.scrollbarY);
|
1194 |
+
this.scrollbarY.setAttribute('tabindex', 0);
|
1195 |
+
this.event.bind(this.scrollbarY, 'focus', focus);
|
1196 |
+
this.event.bind(this.scrollbarY, 'blur', blur);
|
1197 |
+
this.scrollbarYActive = null;
|
1198 |
+
this.scrollbarYHeight = null;
|
1199 |
+
this.scrollbarYTop = null;
|
1200 |
+
var railYStyle = get(this.scrollbarYRail);
|
1201 |
+
this.scrollbarYRight = parseInt(railYStyle.right, 10);
|
1202 |
+
if (isNaN(this.scrollbarYRight)) {
|
1203 |
+
this.isScrollbarYUsingRight = false;
|
1204 |
+
this.scrollbarYLeft = toInt(railYStyle.left);
|
1205 |
+
} else {
|
1206 |
+
this.isScrollbarYUsingRight = true;
|
1207 |
+
}
|
1208 |
+
this.scrollbarYOuterWidth = this.isRtl ? outerWidth(this.scrollbarY) : null;
|
1209 |
+
this.railBorderYWidth =
|
1210 |
+
toInt(railYStyle.borderTopWidth) + toInt(railYStyle.borderBottomWidth);
|
1211 |
+
set(this.scrollbarYRail, { display: 'block' });
|
1212 |
+
this.railYMarginHeight =
|
1213 |
+
toInt(railYStyle.marginTop) + toInt(railYStyle.marginBottom);
|
1214 |
+
set(this.scrollbarYRail, { display: '' });
|
1215 |
+
this.railYHeight = null;
|
1216 |
+
this.railYRatio = null;
|
1217 |
+
|
1218 |
+
this.reach = {
|
1219 |
+
x:
|
1220 |
+
element.scrollLeft <= 0
|
1221 |
+
? 'start'
|
1222 |
+
: element.scrollLeft >= this.contentWidth - this.containerWidth
|
1223 |
+
? 'end'
|
1224 |
+
: null,
|
1225 |
+
y:
|
1226 |
+
element.scrollTop <= 0
|
1227 |
+
? 'start'
|
1228 |
+
: element.scrollTop >= this.contentHeight - this.containerHeight
|
1229 |
+
? 'end'
|
1230 |
+
: null,
|
1231 |
+
};
|
1232 |
+
|
1233 |
+
this.isAlive = true;
|
1234 |
+
|
1235 |
+
this.settings.handlers.forEach(function (handlerName) { return handlers[handlerName](this$1); });
|
1236 |
+
|
1237 |
+
this.lastScrollTop = Math.floor(element.scrollTop); // for onScroll only
|
1238 |
+
this.lastScrollLeft = element.scrollLeft; // for onScroll only
|
1239 |
+
this.event.bind(this.element, 'scroll', function (e) { return this$1.onScroll(e); });
|
1240 |
+
updateGeometry(this);
|
1241 |
+
};
|
1242 |
+
|
1243 |
+
PerfectScrollbar.prototype.update = function update () {
|
1244 |
+
if (!this.isAlive) {
|
1245 |
+
return;
|
1246 |
+
}
|
1247 |
+
|
1248 |
+
// Recalcuate negative scrollLeft adjustment
|
1249 |
+
this.negativeScrollAdjustment = this.isNegativeScroll
|
1250 |
+
? this.element.scrollWidth - this.element.clientWidth
|
1251 |
+
: 0;
|
1252 |
+
|
1253 |
+
// Recalculate rail margins
|
1254 |
+
set(this.scrollbarXRail, { display: 'block' });
|
1255 |
+
set(this.scrollbarYRail, { display: 'block' });
|
1256 |
+
this.railXMarginWidth =
|
1257 |
+
toInt(get(this.scrollbarXRail).marginLeft) +
|
1258 |
+
toInt(get(this.scrollbarXRail).marginRight);
|
1259 |
+
this.railYMarginHeight =
|
1260 |
+
toInt(get(this.scrollbarYRail).marginTop) +
|
1261 |
+
toInt(get(this.scrollbarYRail).marginBottom);
|
1262 |
+
|
1263 |
+
// Hide scrollbars not to affect scrollWidth and scrollHeight
|
1264 |
+
set(this.scrollbarXRail, { display: 'none' });
|
1265 |
+
set(this.scrollbarYRail, { display: 'none' });
|
1266 |
+
|
1267 |
+
updateGeometry(this);
|
1268 |
+
|
1269 |
+
processScrollDiff(this, 'top', 0, false, true);
|
1270 |
+
processScrollDiff(this, 'left', 0, false, true);
|
1271 |
+
|
1272 |
+
set(this.scrollbarXRail, { display: '' });
|
1273 |
+
set(this.scrollbarYRail, { display: '' });
|
1274 |
+
};
|
1275 |
+
|
1276 |
+
PerfectScrollbar.prototype.onScroll = function onScroll (e) {
|
1277 |
+
if (!this.isAlive) {
|
1278 |
+
return;
|
1279 |
+
}
|
1280 |
+
|
1281 |
+
updateGeometry(this);
|
1282 |
+
processScrollDiff(this, 'top', this.element.scrollTop - this.lastScrollTop);
|
1283 |
+
processScrollDiff(
|
1284 |
+
this,
|
1285 |
+
'left',
|
1286 |
+
this.element.scrollLeft - this.lastScrollLeft
|
1287 |
+
);
|
1288 |
+
|
1289 |
+
this.lastScrollTop = Math.floor(this.element.scrollTop);
|
1290 |
+
this.lastScrollLeft = this.element.scrollLeft;
|
1291 |
+
};
|
1292 |
+
|
1293 |
+
PerfectScrollbar.prototype.destroy = function destroy () {
|
1294 |
+
if (!this.isAlive) {
|
1295 |
+
return;
|
1296 |
+
}
|
1297 |
+
|
1298 |
+
this.event.unbindAll();
|
1299 |
+
remove(this.scrollbarX);
|
1300 |
+
remove(this.scrollbarY);
|
1301 |
+
remove(this.scrollbarXRail);
|
1302 |
+
remove(this.scrollbarYRail);
|
1303 |
+
this.removePsClasses();
|
1304 |
+
|
1305 |
+
// unset elements
|
1306 |
+
this.element = null;
|
1307 |
+
this.scrollbarX = null;
|
1308 |
+
this.scrollbarY = null;
|
1309 |
+
this.scrollbarXRail = null;
|
1310 |
+
this.scrollbarYRail = null;
|
1311 |
+
|
1312 |
+
this.isAlive = false;
|
1313 |
+
};
|
1314 |
+
|
1315 |
+
PerfectScrollbar.prototype.removePsClasses = function removePsClasses () {
|
1316 |
+
this.element.className = this.element.className
|
1317 |
+
.split(' ')
|
1318 |
+
.filter(function (name) { return !name.match(/^ps([-_].+|)$/); })
|
1319 |
+
.join(' ');
|
1320 |
+
};
|
1321 |
+
|
1322 |
+
return PerfectScrollbar;
|
1323 |
+
|
1324 |
+
})));
|
assets/js/library-editor.js
CHANGED
@@ -1,319 +1,319 @@
|
|
1 |
-
( function( $ ) {
|
2 |
-
|
3 |
-
"use strict";
|
4 |
-
|
5 |
-
// Elementor Editor Popup
|
6 |
-
var WprElementorEditorPopup = {
|
7 |
-
|
8 |
-
loaded: false,
|
9 |
-
|
10 |
-
init: function() {
|
11 |
-
window.elementor.on( 'preview:loaded', WprElementorEditorPopup.loadPreview );
|
12 |
-
},
|
13 |
-
|
14 |
-
loadPreview: function() {
|
15 |
-
window.elementorFrontend.hooks.addAction( 'frontend/element_ready/shortcode.default', function( $scope ) {
|
16 |
-
$scope.find( '.wpr-template-edit-btn' ).on( 'click', WprElementorEditorPopup.renderPopup );
|
17 |
-
} );
|
18 |
-
|
19 |
-
window.elementorFrontend.hooks.addAction( 'frontend/element_ready/wpr-advanced-slider.default', function( $scope ) {
|
20 |
-
$scope.find( '.wpr-template-edit-btn' ).on( 'click', WprElementorEditorPopup.renderPopup );
|
21 |
-
} );
|
22 |
-
|
23 |
-
window.elementorFrontend.hooks.addAction( 'frontend/element_ready/wpr-tabs.default', function( $scope ) {
|
24 |
-
$scope.find( '.wpr-template-edit-btn' ).on( 'click', WprElementorEditorPopup.renderPopup );
|
25 |
-
} );
|
26 |
-
|
27 |
-
window.elementorFrontend.hooks.addAction( 'frontend/element_ready/wpr-content-toggle.default', function( $scope ) {
|
28 |
-
$scope.find( '.wpr-template-edit-btn' ).on( 'click', WprElementorEditorPopup.renderPopup );
|
29 |
-
} );
|
30 |
-
},
|
31 |
-
|
32 |
-
renderPopup: function( link ) {
|
33 |
-
// Open Editor
|
34 |
-
WprElementorEditorPopup.getPopup().show();
|
35 |
-
|
36 |
-
// Render Iframe
|
37 |
-
$( '#wpr-template-editor-popup .dialog-message').html( '<iframe src="' + $( this ).data( 'permalink' ) + '&elementor' + '" id="wpr-template-edit-frame" width="100%" height="100%"></iframe>' );
|
38 |
-
|
39 |
-
// Preloading
|
40 |
-
$( '#wpr-template-editor-popup .dialog-message').append( '<div id="wpr-template-editor-loading"><div class="elementor-loader-wrapper"><div class="elementor-loader"><div class="elementor-loader-boxes"><div class="elementor-loader-box"></div><div class="elementor-loader-box"></div><div class="elementor-loader-box"></div><div class="elementor-loader-box"></div></div></div><div class="elementor-loading-title">Loading</div></div></div>' );
|
41 |
-
|
42 |
-
// Loaded
|
43 |
-
$( '#wpr-template-edit-frame').on( 'load', function() {
|
44 |
-
$( '#wpr-template-editor-loading').fadeOut( 300 );
|
45 |
-
} );
|
46 |
-
|
47 |
-
// Close
|
48 |
-
$( '#wpr-template-editor-popup .dialog-close-button' ).css({
|
49 |
-
'right' : '30px',
|
50 |
-
'width' : '35px',
|
51 |
-
'height' : '35px',
|
52 |
-
'line-height' : '30px',
|
53 |
-
'border-radius' : '50%',
|
54 |
-
'text-align' : 'center',
|
55 |
-
'opacity' : '1',
|
56 |
-
'background-color' : '#333',
|
57 |
-
'box-shadow' : '1px 1px 3px 0 #000',
|
58 |
-
}).html( '<i class="eicon-close"></i>');
|
59 |
-
|
60 |
-
$( '#wpr-template-editor-popup .dialog-close-button i' ).css({
|
61 |
-
'font-size' : '15px',
|
62 |
-
'color' : '#fff',
|
63 |
-
})
|
64 |
-
|
65 |
-
$( '#wpr-template-editor-popup .dialog-close-button' ).on( 'click', function() {
|
66 |
-
elementor.reloadPreview();
|
67 |
-
});
|
68 |
-
},
|
69 |
-
|
70 |
-
getPopup: function() {
|
71 |
-
|
72 |
-
if ( ! WprElementorEditorPopup.loaded ) {
|
73 |
-
this.loaded = elementor.dialogsManager.createWidget( 'lightbox', {
|
74 |
-
id: 'wpr-template-editor-popup',
|
75 |
-
closeButton: true,
|
76 |
-
hide: { onBackgroundClick: false }
|
77 |
-
} );
|
78 |
-
}
|
79 |
-
|
80 |
-
return WprElementorEditorPopup.loaded;
|
81 |
-
}
|
82 |
-
|
83 |
-
};
|
84 |
-
|
85 |
-
$( window ).on( 'elementor:init', WprElementorEditorPopup.init );
|
86 |
-
|
87 |
-
|
88 |
-
// Modal Popups
|
89 |
-
var WprModalPopups = {
|
90 |
-
|
91 |
-
init: function() {
|
92 |
-
if ( ! $( 'body' ).hasClass( 'elementor-editor-wpr-popups' ) ) {
|
93 |
-
return;
|
94 |
-
}
|
95 |
-
|
96 |
-
// Load Preview
|
97 |
-
window.elementor.on( 'preview:loaded', WprModalPopups.onPreviewLoad );
|
98 |
-
|
99 |
-
// Change Preview
|
100 |
-
window.elementor.on( 'preview:loaded', WprModalPopups.onPreviewChange );
|
101 |
-
|
102 |
-
// Change Controls
|
103 |
-
elementor.settings.page.model.on( 'change', WprModalPopups.onControlChange );
|
104 |
-
},
|
105 |
-
|
106 |
-
onPreviewLoad: function() {
|
107 |
-
// Open Popup Settings
|
108 |
-
setTimeout(function() {
|
109 |
-
$( '#elementor-panel-footer-settings' ).trigger( 'click' );
|
110 |
-
}, 2000);
|
111 |
-
|
112 |
-
// Popup Settings Notification
|
113 |
-
WprModalPopups.settingsNotification();
|
114 |
-
|
115 |
-
// Fix Popup Layout
|
116 |
-
window.elementorFrontend.hooks.addAction( 'frontend/element_ready/global', function( $scope ) {
|
117 |
-
var popup = $scope.closest( '.wpr-template-popup' );
|
118 |
-
|
119 |
-
WprModalPopups.fixPopupLayout( popup );
|
120 |
-
} );
|
121 |
-
},
|
122 |
-
|
123 |
-
onPreviewChange: function() {
|
124 |
-
// preview change code goes here
|
125 |
-
},
|
126 |
-
|
127 |
-
onControlChange: function( model ) {
|
128 |
-
var iframe = document.getElementById( 'elementor-preview-iframe' ),
|
129 |
-
iframeContent = iframe.contentDocument || iframe.contentWindow.document;
|
130 |
-
|
131 |
-
// Popup
|
132 |
-
var popup = $( '.wpr-template-popup', iframeContent );
|
133 |
-
|
134 |
-
// Scrollbar
|
135 |
-
if ( model.changed.hasOwnProperty( 'popup_height' ) ) {
|
136 |
-
// elementor.reloadPreview();
|
137 |
-
}
|
138 |
-
|
139 |
-
// Display As
|
140 |
-
if ( model.changed.hasOwnProperty( 'popup_display_as' ) ) {
|
141 |
-
if ( 'notification' === model.changed['popup_display_as'] ) {
|
142 |
-
popup.addClass( 'wpr-popup-notification' );
|
143 |
-
} else {
|
144 |
-
popup.removeClass( 'wpr-popup-notification' );
|
145 |
-
}
|
146 |
-
}
|
147 |
-
|
148 |
-
if ( model.changed.hasOwnProperty( 'popup_display_as' ) ) {
|
149 |
-
|
150 |
-
}
|
151 |
-
|
152 |
-
// Entrance Animation
|
153 |
-
if ( model.changed.hasOwnProperty( 'popup_animation' ) ) {
|
154 |
-
var popupContainer = popup.find('.wpr-popup-container');
|
155 |
-
|
156 |
-
popupContainer.removeAttr( 'class');
|
157 |
-
popupContainer.addClass( 'wpr-popup-container animated '+ model.changed['popup_animation'] );
|
158 |
-
}
|
159 |
-
},
|
160 |
-
|
161 |
-
fixPopupLayout: function( popup ) {
|
162 |
-
var settings = WprModalPopups.getDocumentSettings();
|
163 |
-
|
164 |
-
// Add Scrollbar
|
165 |
-
if ( ! popup.find('.wpr-popup-container-inner').hasClass('ps') ) {
|
166 |
-
const ps = new PerfectScrollbar(popup.find('.wpr-popup-container-inner')[0], {
|
167 |
-
suppressScrollX: true
|
168 |
-
});
|
169 |
-
}
|
170 |
-
|
171 |
-
if ( 'notification' === settings.popup_display_as ) {
|
172 |
-
popup.addClass( 'wpr-popup-notification' );
|
173 |
-
}
|
174 |
-
},
|
175 |
-
|
176 |
-
getDocumentSettings: function() {
|
177 |
-
var documentSettings = {},
|
178 |
-
settings = elementor.settings.page.model;
|
179 |
-
|
180 |
-
jQuery.each(settings.getActiveControls(), function (controlKey) {
|
181 |
-
documentSettings[controlKey] = settings.attributes[controlKey];
|
182 |
-
});
|
183 |
-
|
184 |
-
return documentSettings;
|
185 |
-
},
|
186 |
-
|
187 |
-
settingsNotification: function() {
|
188 |
-
// Get Close Time
|
189 |
-
var closeTime = JSON.parse( localStorage.getItem( 'WprPopupEditorNotification') ) || {};
|
190 |
-
|
191 |
-
if ( closeTime + 604800000 >= Date.now() ) {
|
192 |
-
return;
|
193 |
-
}
|
194 |
-
|
195 |
-
// Notification HTML
|
196 |
-
var nHTML = '\
|
197 |
-
<div id="wpr-template-settings-notification">\
|
198 |
-
<h4><i class="eicon-info-circle"></i><span>Please Note</span></h4>\
|
199 |
-
<p>Click here to access <strong>Popup Settings</strong>.</p>\
|
200 |
-
<i class="eicon-close"></i>\
|
201 |
-
</div>\
|
202 |
-
';
|
203 |
-
|
204 |
-
// Render Notification
|
205 |
-
$( 'body' ).append( nHTML ).hide().fadeIn();
|
206 |
-
|
207 |
-
// Hide on Click
|
208 |
-
$( '#wpr-template-settings-notification .eicon-close' ).on( 'click', function() {
|
209 |
-
$( '#wpr-template-settings-notification' ).fadeOut();
|
210 |
-
|
211 |
-
// Save Close Time in Browser
|
212 |
-
localStorage.setItem( 'WprPopupEditorNotification', Date.now() );
|
213 |
-
});
|
214 |
-
},
|
215 |
-
};
|
216 |
-
|
217 |
-
$( window ).on( 'elementor:init', WprModalPopups.init );
|
218 |
-
|
219 |
-
|
220 |
-
// Theme Builder
|
221 |
-
var WprTemplateEditor = {
|
222 |
-
|
223 |
-
init: function() {
|
224 |
-
if ( ! $( 'body' ).hasClass( 'elementor-editor-wpr-theme-builder' ) ) {
|
225 |
-
return;
|
226 |
-
}
|
227 |
-
|
228 |
-
// Load Preview
|
229 |
-
window.elementor.on( 'preview:loaded', WprTemplateEditor.onPreviewLoad );
|
230 |
-
},
|
231 |
-
|
232 |
-
onPreviewLoad: function() {
|
233 |
-
|
234 |
-
// Open Popup Settings
|
235 |
-
setTimeout(function() {
|
236 |
-
$( '#elementor-panel-footer-settings' ).trigger( 'click' );
|
237 |
-
}, 500 );
|
238 |
-
|
239 |
-
// Popup Settings Notification
|
240 |
-
WprTemplateEditor.settingsNotification();
|
241 |
-
|
242 |
-
// Submit Preview Changes
|
243 |
-
$( '#elementor-panel-footer-settings' ).on( 'click', function() {
|
244 |
-
setTimeout(function() {
|
245 |
-
|
246 |
-
$( '.elementor-control-submit_preview_changes' ).on( 'click', function() {
|
247 |
-
$( '#elementor-panel-saver-button-publish' ).trigger( 'click' );
|
248 |
-
$( '#elementor-preview-loading' ).show();
|
249 |
-
|
250 |
-
|
251 |
-
var saveChanges = setInterval(function() {
|
252 |
-
if ( ! $( 'html' ).hasClass( 'nprogress-busy' ) ) {
|
253 |
-
location.reload();
|
254 |
-
clearInterval(saveChanges);
|
255 |
-
}
|
256 |
-
}, 500 );
|
257 |
-
});
|
258 |
-
});
|
259 |
-
});
|
260 |
-
|
261 |
-
},
|
262 |
-
|
263 |
-
settingsNotification: function() {
|
264 |
-
// Get Close Time
|
265 |
-
var closeTime = JSON.parse( localStorage.getItem( 'WprTemplateEditorNotification') ) || {};
|
266 |
-
|
267 |
-
if ( closeTime + 604800000 >= Date.now() ) {
|
268 |
-
return;
|
269 |
-
}
|
270 |
-
|
271 |
-
// Notification HTML
|
272 |
-
var nHTML = '\
|
273 |
-
<div id="wpr-template-settings-notification">\
|
274 |
-
<h4><i class="eicon-info-circle"></i><span>Please Note</span></h4>\
|
275 |
-
<p>You can change <strong>Preview Settings</strong> here.</p>\
|
276 |
-
<i class="eicon-close"></i>\
|
277 |
-
</div>\
|
278 |
-
';
|
279 |
-
|
280 |
-
setTimeout(function() {
|
281 |
-
// Render Notification
|
282 |
-
$( 'body' ).append( nHTML ).hide().fadeIn();
|
283 |
-
|
284 |
-
// Set Close Time
|
285 |
-
$( document ).on( 'click', function() {
|
286 |
-
$( '#wpr-template-settings-notification' ).fadeOut();
|
287 |
-
});
|
288 |
-
|
289 |
-
// Hide on Click
|
290 |
-
$( '#wpr-template-settings-notification .eicon-close' ).on( 'click', function() {
|
291 |
-
$( '#wpr-template-settings-notification' ).fadeOut();
|
292 |
-
|
293 |
-
// Save Close Time in Browser
|
294 |
-
localStorage.setItem( 'WprTemplateEditorNotification', Date.now() );
|
295 |
-
});
|
296 |
-
}, 1000 );
|
297 |
-
},
|
298 |
-
};
|
299 |
-
|
300 |
-
$( window ).on( 'elementor:init', WprTemplateEditor.init );
|
301 |
-
|
302 |
-
// Dynamic Progress Bar for Elementor Editor
|
303 |
-
$(window).on('elementor:init', function () {
|
304 |
-
|
305 |
-
elementor.settings.page.addChangeCallback( 'wpr_rpb_enable', function ( newValue ) {
|
306 |
-
console.log(newValue);
|
307 |
-
if('yes' == newValue ) {
|
308 |
-
let wrpbHtml = '<div class="wpr-progress-container"><div class="wpr-progress-bar wpr-mybar" id="wpr-mybar"></div></div>';
|
309 |
-
$( elementorFrontend.elements.$body ).append( wrpbHtml );
|
310 |
-
} else {
|
311 |
-
if ( $( elementorFrontend.elements.$body ).find( '.wpr-progress-container' ).length ) {
|
312 |
-
$( elementorFrontend.elements.$body ).find( '.wpr-progress-container' ).remove();
|
313 |
-
}
|
314 |
-
}
|
315 |
-
});
|
316 |
-
|
317 |
-
});
|
318 |
-
|
319 |
-
}( jQuery ) );
|
1 |
+
( function( $ ) {
|
2 |
+
|
3 |
+
"use strict";
|
4 |
+
|
5 |
+
// Elementor Editor Popup
|
6 |
+
var WprElementorEditorPopup = {
|
7 |
+
|
8 |
+
loaded: false,
|
9 |
+
|
10 |
+
init: function() {
|
11 |
+
window.elementor.on( 'preview:loaded', WprElementorEditorPopup.loadPreview );
|
12 |
+
},
|
13 |
+
|
14 |
+
loadPreview: function() {
|
15 |
+
window.elementorFrontend.hooks.addAction( 'frontend/element_ready/shortcode.default', function( $scope ) {
|
16 |
+
$scope.find( '.wpr-template-edit-btn' ).on( 'click', WprElementorEditorPopup.renderPopup );
|
17 |
+
} );
|
18 |
+
|
19 |
+
window.elementorFrontend.hooks.addAction( 'frontend/element_ready/wpr-advanced-slider.default', function( $scope ) {
|
20 |
+
$scope.find( '.wpr-template-edit-btn' ).on( 'click', WprElementorEditorPopup.renderPopup );
|
21 |
+
} );
|
22 |
+
|
23 |
+
window.elementorFrontend.hooks.addAction( 'frontend/element_ready/wpr-tabs.default', function( $scope ) {
|
24 |
+
$scope.find( '.wpr-template-edit-btn' ).on( 'click', WprElementorEditorPopup.renderPopup );
|
25 |
+
} );
|
26 |
+
|
27 |
+
window.elementorFrontend.hooks.addAction( 'frontend/element_ready/wpr-content-toggle.default', function( $scope ) {
|
28 |
+
$scope.find( '.wpr-template-edit-btn' ).on( 'click', WprElementorEditorPopup.renderPopup );
|
29 |
+
} );
|
30 |
+
},
|
31 |
+
|
32 |
+
renderPopup: function( link ) {
|
33 |
+
// Open Editor
|
34 |
+
WprElementorEditorPopup.getPopup().show();
|
35 |
+
|
36 |
+
// Render Iframe
|
37 |
+
$( '#wpr-template-editor-popup .dialog-message').html( '<iframe src="' + $( this ).data( 'permalink' ) + '&elementor' + '" id="wpr-template-edit-frame" width="100%" height="100%"></iframe>' );
|
38 |
+
|
39 |
+
// Preloading
|
40 |
+
$( '#wpr-template-editor-popup .dialog-message').append( '<div id="wpr-template-editor-loading"><div class="elementor-loader-wrapper"><div class="elementor-loader"><div class="elementor-loader-boxes"><div class="elementor-loader-box"></div><div class="elementor-loader-box"></div><div class="elementor-loader-box"></div><div class="elementor-loader-box"></div></div></div><div class="elementor-loading-title">Loading</div></div></div>' );
|
41 |
+
|
42 |
+
// Loaded
|
43 |
+
$( '#wpr-template-edit-frame').on( 'load', function() {
|
44 |
+
$( '#wpr-template-editor-loading').fadeOut( 300 );
|
45 |
+
} );
|
46 |
+
|
47 |
+
// Close
|
48 |
+
$( '#wpr-template-editor-popup .dialog-close-button' ).css({
|
49 |
+
'right' : '30px',
|
50 |
+
'width' : '35px',
|
51 |
+
'height' : '35px',
|
52 |
+
'line-height' : '30px',
|
53 |
+
'border-radius' : '50%',
|
54 |
+
'text-align' : 'center',
|
55 |
+
'opacity' : '1',
|
56 |
+
'background-color' : '#333',
|
57 |
+
'box-shadow' : '1px 1px 3px 0 #000',
|
58 |
+
}).html( '<i class="eicon-close"></i>');
|
59 |
+
|
60 |
+
$( '#wpr-template-editor-popup .dialog-close-button i' ).css({
|
61 |
+
'font-size' : '15px',
|
62 |
+
'color' : '#fff',
|
63 |
+
})
|
64 |
+
|
65 |
+
$( '#wpr-template-editor-popup .dialog-close-button' ).on( 'click', function() {
|
66 |
+
elementor.reloadPreview();
|
67 |
+
});
|
68 |
+
},
|
69 |
+
|
70 |
+
getPopup: function() {
|
71 |
+
|
72 |
+
if ( ! WprElementorEditorPopup.loaded ) {
|
73 |
+
this.loaded = elementor.dialogsManager.createWidget( 'lightbox', {
|
74 |
+
id: 'wpr-template-editor-popup',
|
75 |
+
closeButton: true,
|
76 |
+
hide: { onBackgroundClick: false }
|
77 |
+
} );
|
78 |
+
}
|
79 |
+
|
80 |
+
return WprElementorEditorPopup.loaded;
|
81 |
+
}
|
82 |
+
|
83 |
+
};
|
84 |
+
|
85 |
+
$( window ).on( 'elementor:init', WprElementorEditorPopup.init );
|
86 |
+
|
87 |
+
|
88 |
+
// Modal Popups
|
89 |
+
var WprModalPopups = {
|
90 |
+
|
91 |
+
init: function() {
|
92 |
+
if ( ! $( 'body' ).hasClass( 'elementor-editor-wpr-popups' ) ) {
|
93 |
+
return;
|
94 |
+
}
|
95 |
+
|
96 |
+
// Load Preview
|
97 |
+
window.elementor.on( 'preview:loaded', WprModalPopups.onPreviewLoad );
|
98 |
+
|
99 |
+
// Change Preview
|
100 |
+
window.elementor.on( 'preview:loaded', WprModalPopups.onPreviewChange );
|
101 |
+
|
102 |
+
// Change Controls
|
103 |
+
elementor.settings.page.model.on( 'change', WprModalPopups.onControlChange );
|
104 |
+
},
|
105 |
+
|
106 |
+
onPreviewLoad: function() {
|
107 |
+
// Open Popup Settings
|
108 |
+
setTimeout(function() {
|
109 |
+
$( '#elementor-panel-footer-settings' ).trigger( 'click' );
|
110 |
+
}, 2000);
|
111 |
+
|
112 |
+
// Popup Settings Notification
|
113 |
+
WprModalPopups.settingsNotification();
|
114 |
+
|
115 |
+
// Fix Popup Layout
|
116 |
+
window.elementorFrontend.hooks.addAction( 'frontend/element_ready/global', function( $scope ) {
|
117 |
+
var popup = $scope.closest( '.wpr-template-popup' );
|
118 |
+
|
119 |
+
WprModalPopups.fixPopupLayout( popup );
|
120 |
+
} );
|
121 |
+
},
|
122 |
+
|
123 |
+
onPreviewChange: function() {
|
124 |
+
// preview change code goes here
|
125 |
+
},
|
126 |
+
|
127 |
+
onControlChange: function( model ) {
|
128 |
+
var iframe = document.getElementById( 'elementor-preview-iframe' ),
|
129 |
+
iframeContent = iframe.contentDocument || iframe.contentWindow.document;
|
130 |
+
|
131 |
+
// Popup
|
132 |
+
var popup = $( '.wpr-template-popup', iframeContent );
|
133 |
+
|
134 |
+
// Scrollbar
|
135 |
+
if ( model.changed.hasOwnProperty( 'popup_height' ) ) {
|
136 |
+
// elementor.reloadPreview();
|
137 |
+
}
|
138 |
+
|
139 |
+
// Display As
|
140 |
+
if ( model.changed.hasOwnProperty( 'popup_display_as' ) ) {
|
141 |
+
if ( 'notification' === model.changed['popup_display_as'] ) {
|
142 |
+
popup.addClass( 'wpr-popup-notification' );
|
143 |
+
} else {
|
144 |
+
popup.removeClass( 'wpr-popup-notification' );
|
145 |
+
}
|
146 |
+
}
|
147 |
+
|
148 |
+
if ( model.changed.hasOwnProperty( 'popup_display_as' ) ) {
|
149 |
+
|
150 |
+
}
|
151 |
+
|
152 |
+
// Entrance Animation
|
153 |
+
if ( model.changed.hasOwnProperty( 'popup_animation' ) ) {
|
154 |
+
var popupContainer = popup.find('.wpr-popup-container');
|
155 |
+
|
156 |
+
popupContainer.removeAttr( 'class');
|
157 |
+
popupContainer.addClass( 'wpr-popup-container animated '+ model.changed['popup_animation'] );
|
158 |
+
}
|
159 |
+
},
|
160 |
+
|
161 |
+
fixPopupLayout: function( popup ) {
|
162 |
+
var settings = WprModalPopups.getDocumentSettings();
|
163 |
+
|
164 |
+
// Add Scrollbar
|
165 |
+
if ( ! popup.find('.wpr-popup-container-inner').hasClass('ps') ) {
|
166 |
+
const ps = new PerfectScrollbar(popup.find('.wpr-popup-container-inner')[0], {
|
167 |
+
suppressScrollX: true
|
168 |
+
});
|
169 |
+
}
|
170 |
+
|
171 |
+
if ( 'notification' === settings.popup_display_as ) {
|
172 |
+
popup.addClass( 'wpr-popup-notification' );
|
173 |
+
}
|
174 |
+
},
|
175 |
+
|
176 |
+
getDocumentSettings: function() {
|
177 |
+
var documentSettings = {},
|
178 |
+
settings = elementor.settings.page.model;
|
179 |
+
|
180 |
+
jQuery.each(settings.getActiveControls(), function (controlKey) {
|
181 |
+
documentSettings[controlKey] = settings.attributes[controlKey];
|
182 |
+
});
|
183 |
+
|
184 |
+
return documentSettings;
|
185 |
+
},
|
186 |
+
|
187 |
+
settingsNotification: function() {
|
188 |
+
// Get Close Time
|
189 |
+
var closeTime = JSON.parse( localStorage.getItem( 'WprPopupEditorNotification') ) || {};
|
190 |
+
|
191 |
+
if ( closeTime + 604800000 >= Date.now() ) {
|
192 |
+
return;
|
193 |
+
}
|
194 |
+
|
195 |
+
// Notification HTML
|
196 |
+
var nHTML = '\
|
197 |
+
<div id="wpr-template-settings-notification">\
|
198 |
+
<h4><i class="eicon-info-circle"></i><span>Please Note</span></h4>\
|
199 |
+
<p>Click here to access <strong>Popup Settings</strong>.</p>\
|
200 |
+
<i class="eicon-close"></i>\
|
201 |
+
</div>\
|
202 |
+
';
|
203 |
+
|
204 |
+
// Render Notification
|
205 |
+
$( 'body' ).append( nHTML ).hide().fadeIn();
|
206 |
+
|
207 |
+
// Hide on Click
|
208 |
+
$( '#wpr-template-settings-notification .eicon-close' ).on( 'click', function() {
|
209 |
+
$( '#wpr-template-settings-notification' ).fadeOut();
|
210 |
+
|
211 |
+
// Save Close Time in Browser
|
212 |
+
localStorage.setItem( 'WprPopupEditorNotification', Date.now() );
|
213 |
+
});
|
214 |
+
},
|
215 |
+
};
|
216 |
+
|
217 |
+
$( window ).on( 'elementor:init', WprModalPopups.init );
|
218 |
+
|
219 |
+
|
220 |
+
// Theme Builder
|
221 |
+
var WprTemplateEditor = {
|
222 |
+
|
223 |
+
init: function() {
|
224 |
+
if ( ! $( 'body' ).hasClass( 'elementor-editor-wpr-theme-builder' ) ) {
|
225 |
+
return;
|
226 |
+
}
|
227 |
+
|
228 |
+
// Load Preview
|
229 |
+
window.elementor.on( 'preview:loaded', WprTemplateEditor.onPreviewLoad );
|
230 |
+
},
|
231 |
+
|
232 |
+
onPreviewLoad: function() {
|
233 |
+
|
234 |
+
// Open Popup Settings
|
235 |
+
setTimeout(function() {
|
236 |
+
$( '#elementor-panel-footer-settings' ).trigger( 'click' );
|
237 |
+
}, 500 );
|
238 |
+
|
239 |
+
// Popup Settings Notification
|
240 |
+
WprTemplateEditor.settingsNotification();
|
241 |
+
|
242 |
+
// Submit Preview Changes
|
243 |
+
$( '#elementor-panel-footer-settings' ).on( 'click', function() {
|
244 |
+
setTimeout(function() {
|
245 |
+
|
246 |
+
$( '.elementor-control-submit_preview_changes' ).on( 'click', function() {
|
247 |
+
$( '#elementor-panel-saver-button-publish' ).trigger( 'click' );
|
248 |
+
$( '#elementor-preview-loading' ).show();
|
249 |
+
|
250 |
+
|
251 |
+
var saveChanges = setInterval(function() {
|
252 |
+
if ( ! $( 'html' ).hasClass( 'nprogress-busy' ) ) {
|
253 |
+
location.reload();
|
254 |
+
clearInterval(saveChanges);
|
255 |
+
}
|
256 |
+
}, 500 );
|
257 |
+
});
|
258 |
+
});
|
259 |
+
});
|
260 |
+
|
261 |
+
},
|
262 |
+
|
263 |
+
settingsNotification: function() {
|
264 |
+
// Get Close Time
|
265 |
+
var closeTime = JSON.parse( localStorage.getItem( 'WprTemplateEditorNotification') ) || {};
|
266 |
+
|
267 |
+
if ( closeTime + 604800000 >= Date.now() ) {
|
268 |
+
return;
|
269 |
+
}
|
270 |
+
|
271 |
+
// Notification HTML
|
272 |
+
var nHTML = '\
|
273 |
+
<div id="wpr-template-settings-notification">\
|
274 |
+
<h4><i class="eicon-info-circle"></i><span>Please Note</span></h4>\
|
275 |
+
<p>You can change <strong>Preview Settings</strong> here.</p>\
|
276 |
+
<i class="eicon-close"></i>\
|
277 |
+
</div>\
|
278 |
+
';
|
279 |
+
|
280 |
+
setTimeout(function() {
|
281 |
+
// Render Notification
|
282 |
+
$( 'body' ).append( nHTML ).hide().fadeIn();
|
283 |
+
|
284 |
+
// Set Close Time
|
285 |
+
$( document ).on( 'click', function() {
|
286 |
+
$( '#wpr-template-settings-notification' ).fadeOut();
|
287 |
+
});
|
288 |
+
|
289 |
+
// Hide on Click
|
290 |
+
$( '#wpr-template-settings-notification .eicon-close' ).on( 'click', function() {
|
291 |
+
$( '#wpr-template-settings-notification' ).fadeOut();
|
292 |
+
|
293 |
+
// Save Close Time in Browser
|
294 |
+
localStorage.setItem( 'WprTemplateEditorNotification', Date.now() );
|
295 |
+
});
|
296 |
+
}, 1000 );
|
297 |
+
},
|
298 |
+
};
|
299 |
+
|
300 |
+
$( window ).on( 'elementor:init', WprTemplateEditor.init );
|
301 |
+
|
302 |
+
// Dynamic Progress Bar for Elementor Editor
|
303 |
+
$(window).on('elementor:init', function () {
|
304 |
+
|
305 |
+
elementor.settings.page.addChangeCallback( 'wpr_rpb_enable', function ( newValue ) {
|
306 |
+
console.log(newValue);
|
307 |
+
if('yes' == newValue ) {
|
308 |
+
let wrpbHtml = '<div class="wpr-progress-container"><div class="wpr-progress-bar wpr-mybar" id="wpr-mybar"></div></div>';
|
309 |
+
$( elementorFrontend.elements.$body ).append( wrpbHtml );
|
310 |
+
} else {
|
311 |
+
if ( $( elementorFrontend.elements.$body ).find( '.wpr-progress-container' ).length ) {
|
312 |
+
$( elementorFrontend.elements.$body ).find( '.wpr-progress-container' ).remove();
|
313 |
+
}
|
314 |
+
}
|
315 |
+
});
|
316 |
+
|
317 |
+
});
|
318 |
+
|
319 |
+
}( jQuery ) );
|
base/module-base.php
CHANGED
@@ -26,7 +26,7 @@ abstract class Module_Base {
|
|
26 |
*/
|
27 |
public function __clone() {
|
28 |
// Cloning instances of the class is forbidden
|
29 |
-
_doing_it_wrong( __FUNCTION__,
|
30 |
}
|
31 |
|
32 |
/**
|
@@ -37,7 +37,7 @@ abstract class Module_Base {
|
|
37 |
*/
|
38 |
public function __wakeup() {
|
39 |
// Unserializing instances of the class is forbidden
|
40 |
-
_doing_it_wrong( __FUNCTION__,
|
41 |
}
|
42 |
|
43 |
public static function class_name() {
|
@@ -75,7 +75,7 @@ abstract class Module_Base {
|
|
75 |
$widget_manager = \Elementor\Plugin::instance()->widgets_manager;
|
76 |
|
77 |
foreach ( $this->get_widgets() as $widget ) {
|
78 |
-
$class_name = $this->reflection->getNamespaceName() .
|
79 |
$widget_manager->register_widget_type( new $class_name() );
|
80 |
}
|
81 |
}
|
26 |
*/
|
27 |
public function __clone() {
|
28 |
// Cloning instances of the class is forbidden
|
29 |
+
_doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin huh?', 'wpr-addons' ), '1.0' );
|
30 |
}
|
31 |
|
32 |
/**
|
37 |
*/
|
38 |
public function __wakeup() {
|
39 |
// Unserializing instances of the class is forbidden
|
40 |
+
_doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin huh?', 'wpr-addons' ), '1.0' );
|
41 |
}
|
42 |
|
43 |
public static function class_name() {
|
75 |
$widget_manager = \Elementor\Plugin::instance()->widgets_manager;
|
76 |
|
77 |
foreach ( $this->get_widgets() as $widget ) {
|
78 |
+
$class_name = $this->reflection->getNamespaceName() .'\Widgets\\'. $widget;
|
79 |
$widget_manager->register_widget_type( new $class_name() );
|
80 |
}
|
81 |
}
|
classes/plugin-sale-notice.php
CHANGED
@@ -40,25 +40,25 @@ class WprPluginSaleNotice {
|
|
40 |
if ( is_admin() ) {
|
41 |
echo '<div class="notice wpr-plugin-sale-notice is-dismissible">
|
42 |
<div class="wpr-plugin-sale-notice-logo">
|
43 |
-
<img src="'. WPR_ADDONS_ASSETS_URL .'/img/logo-128x128.png">
|
44 |
</div>
|
45 |
<div>
|
46 |
<h3><span>Flash Sale</span><br> Royal Elementor Addons Pro</h3>
|
47 |
<ul>
|
48 |
<li>
|
49 |
-
<img src="'
|
50 |
Advanced Theme Builder
|
51 |
</li>
|
52 |
<li>
|
53 |
-
<img src="'
|
54 |
20+ Designer Made Templates Kit
|
55 |
</li>
|
56 |
<li>
|
57 |
-
<img src="'
|
58 |
35+ Advanced Elementor Widgets
|
59 |
</li>
|
60 |
<li>
|
61 |
-
<img src="'
|
62 |
Advanced Popup Builder
|
63 |
</li>
|
64 |
</ul>
|
@@ -72,7 +72,7 @@ class WprPluginSaleNotice {
|
|
72 |
<a href="https://royal-elementor-addons.com/?ref=rea-plugin-backend-salebanner-upgrade-pro#purchasepro" target="_blank" class="wpr-upgrade-to-pro-button button button-secondary">Upgrade to Pro <span class="dashicons dashicons-arrow-right-alt"></span></a>
|
73 |
</div>
|
74 |
</div>
|
75 |
-
<div class="image-wrap"><img src="'. WPR_ADDONS_ASSETS_URL .'/img/sale-banner.png"></div>
|
76 |
<canvas id="wpr-notice-confetti"></canvas>
|
77 |
</div>';
|
78 |
}
|
40 |
if ( is_admin() ) {
|
41 |
echo '<div class="notice wpr-plugin-sale-notice is-dismissible">
|
42 |
<div class="wpr-plugin-sale-notice-logo">
|
43 |
+
<img src="'. esc_url(WPR_ADDONS_ASSETS_URL) .'/img/logo-128x128.png">
|
44 |
</div>
|
45 |
<div>
|
46 |
<h3><span>Flash Sale</span><br> Royal Elementor Addons Pro</h3>
|
47 |
<ul>
|
48 |
<li>
|
49 |
+
<img src="'. esc_url(WPR_ADDONS_ASSETS_URL) .'/img/check-mark.png">
|
50 |
Advanced Theme Builder
|
51 |
</li>
|
52 |
<li>
|
53 |
+
<img src="'. esc_url(WPR_ADDONS_ASSETS_URL) .'/img/check-mark.png">
|
54 |
20+ Designer Made Templates Kit
|
55 |
</li>
|
56 |
<li>
|
57 |
+
<img src="'. esc_url(WPR_ADDONS_ASSETS_URL) .'/img/check-mark.png">
|
58 |
35+ Advanced Elementor Widgets
|
59 |
</li>
|
60 |
<li>
|
61 |
+
<img src="'. esc_url(WPR_ADDONS_ASSETS_URL) .'/img/check-mark.png">
|
62 |
Advanced Popup Builder
|
63 |
</li>
|
64 |
</ul>
|
72 |
<a href="https://royal-elementor-addons.com/?ref=rea-plugin-backend-salebanner-upgrade-pro#purchasepro" target="_blank" class="wpr-upgrade-to-pro-button button button-secondary">Upgrade to Pro <span class="dashicons dashicons-arrow-right-alt"></span></a>
|
73 |
</div>
|
74 |
</div>
|
75 |
+
<div class="image-wrap"><img src="'. esc_url(WPR_ADDONS_ASSETS_URL) .'/img/sale-banner.png"></div>
|
76 |
<canvas id="wpr-notice-confetti"></canvas>
|
77 |
</div>';
|
78 |
}
|
classes/plugin-update-notice.php
CHANGED
@@ -40,7 +40,7 @@ class WprPluginUpdateNotice {
|
|
40 |
|
41 |
echo '<div class="notice wpr-plugin-update-notice is-dismissible">
|
42 |
<div class="wpr-plugin-update-notice-logo">
|
43 |
-
<img src="'. WPR_ADDONS_ASSETS_URL .'/img/logo-128x128.png">
|
44 |
</div>
|
45 |
<div>
|
46 |
<h3><span>New Feature</span><br> Royal Theme Builder</h3>
|
@@ -55,11 +55,11 @@ class WprPluginUpdateNotice {
|
|
55 |
</p>
|
56 |
<br>
|
57 |
<div>
|
58 |
-
<a href="'. get_admin_url() .'admin.php?page=wpr-templates-kit" class="wpr-get-started-button button button-primary">Go to Templates Library</a>
|
59 |
-
<a href="'. get_admin_url() .'admin.php?page=wpr-theme-builder" class="wpr-get-started-button button button-secondary">Go to Theme Builder</a>
|
60 |
</div>
|
61 |
</div>
|
62 |
-
<div class="image-wrap"><img src="'. WPR_ADDONS_ASSETS_URL .'/img/theme-builder.png"></div>
|
63 |
<canvas id="wpr-notice-confetti"></canvas>
|
64 |
</div>';
|
65 |
}
|
40 |
|
41 |
echo '<div class="notice wpr-plugin-update-notice is-dismissible">
|
42 |
<div class="wpr-plugin-update-notice-logo">
|
43 |
+
<img src="'. esc_url(WPR_ADDONS_ASSETS_URL) .'/img/logo-128x128.png">
|
44 |
</div>
|
45 |
<div>
|
46 |
<h3><span>New Feature</span><br> Royal Theme Builder</h3>
|
55 |
</p>
|
56 |
<br>
|
57 |
<div>
|
58 |
+
<a href="'. esc_url(get_admin_url()) .'admin.php?page=wpr-templates-kit" class="wpr-get-started-button button button-primary">Go to Templates Library</a>
|
59 |
+
<a href="'. esc_url(get_admin_url()) .'admin.php?page=wpr-theme-builder" class="wpr-get-started-button button button-secondary">Go to Theme Builder</a>
|
60 |
</div>
|
61 |
</div>
|
62 |
+
<div class="image-wrap"><img src="'. esc_url(WPR_ADDONS_ASSETS_URL) .'/img/theme-builder.png"></div>
|
63 |
<canvas id="wpr-notice-confetti"></canvas>
|
64 |
</div>';
|
65 |
}
|
classes/utilities.php
CHANGED
@@ -302,8 +302,8 @@ class Utilities {
|
|
302 |
return;
|
303 |
}
|
304 |
|
305 |
-
// Render Template Content
|
306 |
-
echo $get_elementor_content;
|
307 |
}
|
308 |
|
309 |
|
@@ -350,7 +350,7 @@ class Utilities {
|
|
350 |
$network_title = esc_html__( 'LinkedIn', 'wpr-addons' );
|
351 |
} elseif ( 'pinterest-p' === $args['network'] ) {
|
352 |
// $sharing_url = 'https://www.pinterest.com/pin/find/?url='. $args['url'];
|
353 |
-
$sharing_url = 'https://www.pinterest.com/pin/create/button/?url='
|
354 |
$network_title = esc_html__( 'Pinterest', 'wpr-addons' );
|
355 |
} elseif ( 'reddit' === $args['network'] ) {
|
356 |
$sharing_url = 'https://reddit.com/submit?url='. $args['url'] .'&title='. $args['title'];
|
@@ -404,7 +404,7 @@ class Utilities {
|
|
404 |
$output = '';
|
405 |
|
406 |
if ( '' !== $network_title ) {
|
407 |
-
$output .= '<a href="'. $sharing_url .'" class="wpr-sharing-icon wpr-sharing-'. esc_attr( $args['network'] ) .'" title="" target="_blank">';
|
408 |
// Tooltip
|
409 |
$output .= 'yes' === $args['tooltip'] ? '<span class="wpr-sharing-tooltip wpr-tooltip">'. esc_html( $network_title ) .'</span>' : '';
|
410 |
|
@@ -533,14 +533,14 @@ class Utilities {
|
|
533 |
|
534 |
$icons = [
|
535 |
// Arrows
|
536 |
-
'svg-angle-1-left' => '<svg '. $style_attr .'version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 283.4 512" style="enable-background:new 0 0 283.4 512;" xml:space="preserve"><g><polygon class="st0" points="54.5,256.3 283.4,485.1 256.1,512.5 0,256.3 0,256.3 27.2,229 256.1,0 283.4,27.4 "/></g></svg>',
|
537 |
-
'svg-angle-2-left' => '<svg '. $style_attr .'version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 303.3 512" style="enable-background:new 0 0 303.3 512;" xml:space="preserve"><g><polygon class="st0" points="94.7,256 303.3,464.6 256,512 47.3,303.4 0,256 47.3,208.6 256,0 303.3,47.4 "/></g></svg>',
|
538 |
-
'svg-angle-3-left' => '<svg '. $style_attr .'version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 291.4 512" style="enable-background:new 0 0 291.4 512;" xml:space="preserve"><g><path class="st0" d="M281.1,451.5c13.8,13.8,13.8,36.3,0,50.1c-13.8,13.8-36.3,13.8-50.1,0L10.4,281C3.5,274.1,0,265.1,0,256c0-9.1,3.5-18.1,10.4-25L231,10.4c13.8-13.8,36.3-13.8,50.1,0c6.9,6.9,10.4,16,10.4,25s-3.5,18.1-10.4,25L85.5,256L281.1,451.5z"/></g></svg>',
|
539 |
-
'svg-angle-4-left' => '<svg '. $style_attr .'version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 259.6 512" style="enable-background:new 0 0 259.6 512;" xml:space="preserve"><g><path class="st0" d="M256.6,18.1L126.2,256.1l130.6,237.6c3.6,5.6,3.9,10.8,0.2,14.9c-0.2,0.2-0.2,0.3-0.3,0.3s-0.3,0.3-0.3,0.3c-3.9,3.9-10.3,3.6-14.2-0.3L2.9,263.6c-2-2.1-3.1-4.7-2.9-7.5c0-2.8,1-5.6,3.1-7.7L242,3.1c4.1-4.1,10.6-4.1,14.6,0l0,0C260.7,7.3,260.5,10.9,256.6,18.1z"/></g></svg>',
|
540 |
-
'svg-arrow-1-left' => '<svg '. $style_attr .'version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 512 338.4" style="enable-background:new 0 0 512 338.4;" xml:space="preserve"><g><polygon class="st0" points="511.4,183.1 53.4,183.1 188.9,318.7 169.2,338.4 0,169.2 169.2,0 188.9,19.7 53.4,155.3 511.4,155.3 "/></g></svg>',
|
541 |
-
'svg-arrow-2-left' => '<svg '. $style_attr .'version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 512 320.6" style="enable-background:new 0 0 512 320.6;" xml:space="preserve"><g><polygon class="st0" points="512,184.4 92.7,184.4 194.7,286.4 160.5,320.6 34.3,194.4 34.3,194.4 0,160.2 160.4,0 194.5,34.2 92.7,136 512,136 "/></g></svg>',
|
542 |
-
'svg-arrow-3-left' => '<svg '. $style_attr .'version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 499.6 320.6" style="enable-background:new 0 0 499.6 320.6;" xml:space="preserve"><g><path class="st0" d="M499.6,159.3c0.3,7-2.4,13.2-7,17.9c-4.3,4.3-10.4,7-16.9,7H81.6l95.6,95.6c9.3,9.3,9.3,24.4,0,33.8c-4.6,4.6-10.8,7-16.9,7c-6.1,0-12.3-2.4-16.9-7L6.9,177.2c-9.3-9.3-9.3-24.4,0-33.8l16.9-16.9l0,0L143.3,6.9c9.3-9.3,24.4-9.3,33.8,0c4.6,4.6,7,10.8,7,16.9s-2.4,12.3-7,16.9l-95.6,95.6h393.7C488.3,136.3,499.1,146.4,499.6,159.3z"/></g></svg>',
|
543 |
-
'svg-arrow-4-left' => '<svg '. $style_attr .'version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 499.6 201.3" style="enable-background:new 0 0 499.6 201.3;" xml:space="preserve"><g><polygon class="st0" points="0,101.1 126,0 126,81.6 499.6,81.6 499.6,120.8 126,120.8 126,201.3 "/></g></svg>',
|
544 |
|
545 |
// Blockquote
|
546 |
'svg-blockquote-1' => '<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 512 406.1" style="enable-background:new 0 0 512 406.1;" xml:space="preserve"><g><g id="Layer_2_1_" class="st0"><path class="st1" d="M510.6,301.8c0,57.6-46.7,104.3-104.3,104.3c-12.6,0-24.7-2.3-36-6.4c-28.3-9.1-64.7-29.1-82.8-76.3C218.9,145.3,477.7,0.1,477.7,0.1l6.4,12.3c0,0-152.4,85.7-132.8,200.8C421.8,170.3,510.1,220.2,510.6,301.8z"/><path class="st1" d="M234.6,301.8c0,57.6-46.7,104.3-104.3,104.3c-12.6,0-24.7-2.3-36-6.4c-28.3-9.1-64.7-29.1-82.8-76.3C-57.1,145.3,201.8,0.1,201.8,0.1l6.4,12.3c0,0-152.4,85.7-132.8,200.8C145.9,170.3,234.1,220.2,234.6,301.8z"/></g></g></svg>',
|
@@ -565,9 +565,14 @@ class Utilities {
|
|
565 |
public static function get_wpr_icon( $icon, $dir ) {
|
566 |
if ( false !== strpos( $icon, 'svg-' ) ) {
|
567 |
return Utilities::get_svg_icon( $icon, $dir );
|
|
|
568 |
} elseif ( false !== strpos( $icon, 'fa-' ) ) {
|
569 |
$dir = '' !== $dir ? '-'. $dir : '';
|
570 |
-
return '<i class="'. esc_attr($icon . $dir) .'"></i>'
|
|
|
|
|
|
|
|
|
571 |
} else {
|
572 |
return '';
|
573 |
}
|
@@ -579,33 +584,34 @@ class Utilities {
|
|
579 |
*/
|
580 |
public static function ajax_mailchimp_subscribe() {
|
581 |
// API Key
|
582 |
-
$api_key =
|
583 |
$api_key_sufix = explode( '-', $api_key )[1];
|
584 |
|
585 |
// List ID
|
586 |
-
$list_id = sanitize_text_field($_POST['listId']);
|
587 |
|
588 |
-
// Get Available Fileds
|
589 |
-
|
|
|
590 |
|
591 |
// Merge Additional Fields
|
592 |
$merge_fields = array(
|
593 |
-
'FNAME' => !
|
594 |
-
'LNAME' => !
|
595 |
);
|
596 |
|
597 |
// API URL
|
598 |
-
$api_url = 'https://'. $api_key_sufix .'.api.mailchimp.com/3.0/lists/'. $list_id .'/members/'. md5(strtolower(
|
599 |
|
600 |
// API Args
|
601 |
$api_args = [
|
602 |
'method' => 'PUT',
|
603 |
'headers' => [
|
604 |
'Content-Type' => 'application/json',
|
605 |
-
'Authorization' => 'apikey '
|
606 |
],
|
607 |
'body' => json_encode([
|
608 |
-
'email_address' =>
|
609 |
'status' => 'subscribed',
|
610 |
'merge_fields' => $merge_fields,
|
611 |
]),
|
@@ -649,7 +655,7 @@ class Utilities {
|
|
649 |
|
650 |
if ( ! empty( $body->lists ) ) {
|
651 |
foreach ( $body->lists as $list ) {
|
652 |
-
$mailchimp_list[$list->id] = $list->name .' ('
|
653 |
}
|
654 |
}
|
655 |
|
@@ -710,7 +716,7 @@ class Utilities {
|
|
710 |
public static function wpr_library_buttons( $module, $controls_manager, $tutorial_url = '' ) {
|
711 |
if ( empty(get_option('wpr_wl_plugin_links')) ) {
|
712 |
if ( '' !== $tutorial_url ) {
|
713 |
-
$tutorial_link = '<a href="'. $tutorial_url .'" target="_blank">'. esc_html__( 'Watch Video Tutorial ', 'wpr-addons' ) .'<span class="dashicons dashicons-video-alt3"></span></a>';
|
714 |
} else {
|
715 |
$tutorial_link = '';
|
716 |
}
|
@@ -718,7 +724,7 @@ class Utilities {
|
|
718 |
$module->add_control(
|
719 |
'wpr_library_buttons',
|
720 |
[
|
721 |
-
'raw' => '<div><a href="#" target="_blank" data-theme="'. get_template() .'">'. esc_html__( 'Widget Preview', 'wpr-addons' ) .'</a> <a href="#">'. esc_html__( 'Predefined Styles', 'wpr-addons' ) .'</a></div>'. $tutorial_link,
|
722 |
'type' => $controls_manager,
|
723 |
]
|
724 |
);
|
302 |
return;
|
303 |
}
|
304 |
|
305 |
+
// Render Elementor Template Content
|
306 |
+
echo ''. $get_elementor_content; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
307 |
}
|
308 |
|
309 |
|
350 |
$network_title = esc_html__( 'LinkedIn', 'wpr-addons' );
|
351 |
} elseif ( 'pinterest-p' === $args['network'] ) {
|
352 |
// $sharing_url = 'https://www.pinterest.com/pin/find/?url='. $args['url'];
|
353 |
+
$sharing_url = 'https://www.pinterest.com/pin/create/button/?url='. $args['url'] .'&media='. $args['image'];
|
354 |
$network_title = esc_html__( 'Pinterest', 'wpr-addons' );
|
355 |
} elseif ( 'reddit' === $args['network'] ) {
|
356 |
$sharing_url = 'https://reddit.com/submit?url='. $args['url'] .'&title='. $args['title'];
|
404 |
$output = '';
|
405 |
|
406 |
if ( '' !== $network_title ) {
|
407 |
+
$output .= '<a href="'. esc_url($sharing_url) .'" class="wpr-sharing-icon wpr-sharing-'. esc_attr( $args['network'] ) .'" title="" target="_blank">';
|
408 |
// Tooltip
|
409 |
$output .= 'yes' === $args['tooltip'] ? '<span class="wpr-sharing-tooltip wpr-tooltip">'. esc_html( $network_title ) .'</span>' : '';
|
410 |
|
533 |
|
534 |
$icons = [
|
535 |
// Arrows
|
536 |
+
'svg-angle-1-left' => '<svg '. $style_attr .'version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 283.4 512" style="enable-background:new 0 0 283.4 512;" xml:space="preserve"><g><polygon class="st0" points="54.5,256.3 283.4,485.1 256.1,512.5 0,256.3 0,256.3 27.2,229 256.1,0 283.4,27.4 "/></g></svg>', // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
537 |
+
'svg-angle-2-left' => '<svg '. $style_attr .'version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 303.3 512" style="enable-background:new 0 0 303.3 512;" xml:space="preserve"><g><polygon class="st0" points="94.7,256 303.3,464.6 256,512 47.3,303.4 0,256 47.3,208.6 256,0 303.3,47.4 "/></g></svg>', // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
538 |
+
'svg-angle-3-left' => '<svg '. $style_attr .'version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 291.4 512" style="enable-background:new 0 0 291.4 512;" xml:space="preserve"><g><path class="st0" d="M281.1,451.5c13.8,13.8,13.8,36.3,0,50.1c-13.8,13.8-36.3,13.8-50.1,0L10.4,281C3.5,274.1,0,265.1,0,256c0-9.1,3.5-18.1,10.4-25L231,10.4c13.8-13.8,36.3-13.8,50.1,0c6.9,6.9,10.4,16,10.4,25s-3.5,18.1-10.4,25L85.5,256L281.1,451.5z"/></g></svg>', // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
539 |
+
'svg-angle-4-left' => '<svg '. $style_attr .'version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 259.6 512" style="enable-background:new 0 0 259.6 512;" xml:space="preserve"><g><path class="st0" d="M256.6,18.1L126.2,256.1l130.6,237.6c3.6,5.6,3.9,10.8,0.2,14.9c-0.2,0.2-0.2,0.3-0.3,0.3s-0.3,0.3-0.3,0.3c-3.9,3.9-10.3,3.6-14.2-0.3L2.9,263.6c-2-2.1-3.1-4.7-2.9-7.5c0-2.8,1-5.6,3.1-7.7L242,3.1c4.1-4.1,10.6-4.1,14.6,0l0,0C260.7,7.3,260.5,10.9,256.6,18.1z"/></g></svg>', // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
540 |
+
'svg-arrow-1-left' => '<svg '. $style_attr .'version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 512 338.4" style="enable-background:new 0 0 512 338.4;" xml:space="preserve"><g><polygon class="st0" points="511.4,183.1 53.4,183.1 188.9,318.7 169.2,338.4 0,169.2 169.2,0 188.9,19.7 53.4,155.3 511.4,155.3 "/></g></svg>', // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
541 |
+
'svg-arrow-2-left' => '<svg '. $style_attr .'version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 512 320.6" style="enable-background:new 0 0 512 320.6;" xml:space="preserve"><g><polygon class="st0" points="512,184.4 92.7,184.4 194.7,286.4 160.5,320.6 34.3,194.4 34.3,194.4 0,160.2 160.4,0 194.5,34.2 92.7,136 512,136 "/></g></svg>', // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
542 |
+
'svg-arrow-3-left' => '<svg '. $style_attr .'version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 499.6 320.6" style="enable-background:new 0 0 499.6 320.6;" xml:space="preserve"><g><path class="st0" d="M499.6,159.3c0.3,7-2.4,13.2-7,17.9c-4.3,4.3-10.4,7-16.9,7H81.6l95.6,95.6c9.3,9.3,9.3,24.4,0,33.8c-4.6,4.6-10.8,7-16.9,7c-6.1,0-12.3-2.4-16.9-7L6.9,177.2c-9.3-9.3-9.3-24.4,0-33.8l16.9-16.9l0,0L143.3,6.9c9.3-9.3,24.4-9.3,33.8,0c4.6,4.6,7,10.8,7,16.9s-2.4,12.3-7,16.9l-95.6,95.6h393.7C488.3,136.3,499.1,146.4,499.6,159.3z"/></g></svg>', // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
543 |
+
'svg-arrow-4-left' => '<svg '. $style_attr .'version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 499.6 201.3" style="enable-background:new 0 0 499.6 201.3;" xml:space="preserve"><g><polygon class="st0" points="0,101.1 126,0 126,81.6 499.6,81.6 499.6,120.8 126,120.8 126,201.3 "/></g></svg>', // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
544 |
|
545 |
// Blockquote
|
546 |
'svg-blockquote-1' => '<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 512 406.1" style="enable-background:new 0 0 512 406.1;" xml:space="preserve"><g><g id="Layer_2_1_" class="st0"><path class="st1" d="M510.6,301.8c0,57.6-46.7,104.3-104.3,104.3c-12.6,0-24.7-2.3-36-6.4c-28.3-9.1-64.7-29.1-82.8-76.3C218.9,145.3,477.7,0.1,477.7,0.1l6.4,12.3c0,0-152.4,85.7-132.8,200.8C421.8,170.3,510.1,220.2,510.6,301.8z"/><path class="st1" d="M234.6,301.8c0,57.6-46.7,104.3-104.3,104.3c-12.6,0-24.7-2.3-36-6.4c-28.3-9.1-64.7-29.1-82.8-76.3C-57.1,145.3,201.8,0.1,201.8,0.1l6.4,12.3c0,0-152.4,85.7-132.8,200.8C145.9,170.3,234.1,220.2,234.6,301.8z"/></g></g></svg>',
|
565 |
public static function get_wpr_icon( $icon, $dir ) {
|
566 |
if ( false !== strpos( $icon, 'svg-' ) ) {
|
567 |
return Utilities::get_svg_icon( $icon, $dir );
|
568 |
+
|
569 |
} elseif ( false !== strpos( $icon, 'fa-' ) ) {
|
570 |
$dir = '' !== $dir ? '-'. $dir : '';
|
571 |
+
return wp_kses('<i class="'. esc_attr($icon . $dir) .'"></i>', [
|
572 |
+
'i' => [
|
573 |
+
'class' => []
|
574 |
+
]
|
575 |
+
]);
|
576 |
} else {
|
577 |
return '';
|
578 |
}
|
584 |
*/
|
585 |
public static function ajax_mailchimp_subscribe() {
|
586 |
// API Key
|
587 |
+
$api_key = isset($_POST['apiKey']) ? sanitize_key($_POST['apiKey']) : '';
|
588 |
$api_key_sufix = explode( '-', $api_key )[1];
|
589 |
|
590 |
// List ID
|
591 |
+
$list_id = isset($_POST['listId']) ? sanitize_text_field(wp_unslash($_POST['listId'])) : '';
|
592 |
|
593 |
+
// Get Available Fileds (PHPCS - fields are sanitized later on input)
|
594 |
+
$available_fields = isset($_POST['fields']) ? $_POST['fields'] : []; // phpcs:ignore
|
595 |
+
wp_parse_str( $available_fields, $fields );
|
596 |
|
597 |
// Merge Additional Fields
|
598 |
$merge_fields = array(
|
599 |
+
'FNAME' => !empty( $fields['wpr_mailchimp_firstname'] ) ? sanitize_text_field($fields['wpr_mailchimp_firstname']) : '',
|
600 |
+
'LNAME' => !empty( $fields['wpr_mailchimp_lastname'] ) ? sanitize_text_field($fields['wpr_mailchimp_lastname']) : '',
|
601 |
);
|
602 |
|
603 |
// API URL
|
604 |
+
$api_url = 'https://'. $api_key_sufix .'.api.mailchimp.com/3.0/lists/'. $list_id .'/members/'. md5(strtolower(sanitize_text_field($fields['wpr_mailchimp_email'])));
|
605 |
|
606 |
// API Args
|
607 |
$api_args = [
|
608 |
'method' => 'PUT',
|
609 |
'headers' => [
|
610 |
'Content-Type' => 'application/json',
|
611 |
+
'Authorization' => 'apikey '. $api_key,
|
612 |
],
|
613 |
'body' => json_encode([
|
614 |
+
'email_address' => sanitize_text_field($fields[ 'wpr_mailchimp_email' ]),
|
615 |
'status' => 'subscribed',
|
616 |
'merge_fields' => $merge_fields,
|
617 |
]),
|
655 |
|
656 |
if ( ! empty( $body->lists ) ) {
|
657 |
foreach ( $body->lists as $list ) {
|
658 |
+
$mailchimp_list[$list->id] = $list->name .' ('. $list->stats->member_count .')';
|
659 |
}
|
660 |
}
|
661 |
|
716 |
public static function wpr_library_buttons( $module, $controls_manager, $tutorial_url = '' ) {
|
717 |
if ( empty(get_option('wpr_wl_plugin_links')) ) {
|
718 |
if ( '' !== $tutorial_url ) {
|
719 |
+
$tutorial_link = '<a href="'. esc_url($tutorial_url) .'" target="_blank">'. esc_html__( 'Watch Video Tutorial ', 'wpr-addons' ) .'<span class="dashicons dashicons-video-alt3"></span></a>';
|
720 |
} else {
|
721 |
$tutorial_link = '';
|
722 |
}
|
724 |
$module->add_control(
|
725 |
'wpr_library_buttons',
|
726 |
[
|
727 |
+
'raw' => '<div><a href="#" target="_blank" data-theme="'. esc_attr(get_template()) .'">'. esc_html__( 'Widget Preview', 'wpr-addons' ) .'</a> <a href="#">'. esc_html__( 'Predefined Styles', 'wpr-addons' ) .'</a></div>'. $tutorial_link,
|
728 |
'type' => $controls_manager,
|
729 |
]
|
730 |
);
|
classes/wpr-post-likes.php
CHANGED
@@ -1,7 +1,9 @@
|
|
1 |
<?php
|
2 |
namespace WprAddons\Classes;
|
3 |
|
4 |
-
if ( ! defined( 'ABSPATH' ) )
|
|
|
|
|
5 |
|
6 |
/**
|
7 |
* WPR_Post_Likes setup
|
@@ -23,7 +25,7 @@ class WPR_Post_Likes {
|
|
23 |
*/
|
24 |
public function wpr_likes_init() {
|
25 |
// Security
|
26 |
-
$nonce = isset( $_REQUEST['nonce'] ) ? sanitize_text_field( $_REQUEST['nonce'] ) : 0;
|
27 |
|
28 |
if ( ! wp_verify_nonce( $nonce, 'wpr-post-likes-nonce' ) ) {
|
29 |
exit( esc_html__( 'Not permitted', 'wpr-addons' ) );
|
@@ -33,7 +35,7 @@ class WPR_Post_Likes {
|
|
33 |
$js_disabled = ( isset( $_REQUEST['disabled'] ) && $_REQUEST['disabled'] == true ) ? true : false;
|
34 |
|
35 |
// Base variables
|
36 |
-
$post_id = ( isset( $_REQUEST['post_id'] ) && is_numeric( $_REQUEST['post_id'] ) ) ?
|
37 |
|
38 |
$post_users = NULL;
|
39 |
$like_count = 0;
|
@@ -166,12 +168,12 @@ class WPR_Post_Likes {
|
|
166 |
}
|
167 |
|
168 |
// Button Attributes
|
169 |
-
$attributes = 'href="'. admin_url( 'admin-ajax.php?action=wpr_likes_init&post_id='. $post_id .'&nonce='. $nonce ) .'"';
|
170 |
-
$attributes .= ' class="wpr-post-like-button'. $liked_class . $default_text_class .'"';
|
171 |
$attributes .= ' title="'. esc_attr($title) .'"';
|
172 |
$attributes .= ' data-nonce="'. esc_attr($nonce) .'"';
|
173 |
$attributes .= ' data-post-id="'. esc_attr($post_id) .'"';
|
174 |
-
$attributes .= ' data-ajax="'. admin_url( 'admin-ajax.php' ) .'"';
|
175 |
$attributes .= ' data-icon="'. esc_attr($icon_class) .'"';
|
176 |
$attributes .= ' data-text="'. esc_attr($button_text) .'"';
|
177 |
|
@@ -181,7 +183,7 @@ class WPR_Post_Likes {
|
|
181 |
$output .= $this->get_like_count( $like_count, $button_text );
|
182 |
$output .= '</a>';
|
183 |
|
184 |
-
return $output;
|
185 |
}
|
186 |
|
187 |
/**
|
@@ -268,11 +270,11 @@ class WPR_Post_Likes {
|
|
268 |
*/
|
269 |
public function get_IP() {
|
270 |
if ( isset( $_SERVER['HTTP_CLIENT_IP'] ) && ! empty( $_SERVER['HTTP_CLIENT_IP'] ) ) {
|
271 |
-
$ip = $_SERVER['HTTP_CLIENT_IP'];
|
272 |
} elseif ( isset( $_SERVER['HTTP_X_FORWARDED_FOR'] ) && ! empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) {
|
273 |
-
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
|
274 |
} else {
|
275 |
-
$ip = ( isset( $_SERVER['REMOTE_ADDR'] ) ) ? $_SERVER['REMOTE_ADDR'] : '0.0.0.0';
|
276 |
}
|
277 |
|
278 |
$ip = filter_var( $ip, FILTER_VALIDATE_IP );
|
@@ -289,9 +291,9 @@ class WPR_Post_Likes {
|
|
289 |
|
290 |
if ( $number >= 1000 && $number < 1000000 ) {
|
291 |
$formatted = number_format( $number/1000, $precision ).'K';
|
292 |
-
}
|
293 |
$formatted = number_format( $number/1000000, $precision ).'M';
|
294 |
-
}
|
295 |
$formatted = number_format( $number/1000000000, $precision ).'B';
|
296 |
} else {
|
297 |
$formatted = $number; // Number is less than 1000
|
@@ -312,7 +314,7 @@ class WPR_Post_Likes {
|
|
312 |
$number = $like_text;
|
313 |
}
|
314 |
|
315 |
-
return '<span class="wpr-post-like-count">'. $number .'</span>';
|
316 |
}
|
317 |
}
|
318 |
|
1 |
<?php
|
2 |
namespace WprAddons\Classes;
|
3 |
|
4 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
5 |
+
exit; // Exit if accessed directly.
|
6 |
+
}
|
7 |
|
8 |
/**
|
9 |
* WPR_Post_Likes setup
|
25 |
*/
|
26 |
public function wpr_likes_init() {
|
27 |
// Security
|
28 |
+
$nonce = isset( $_REQUEST['nonce'] ) ? sanitize_text_field( wp_unslash($_REQUEST['nonce']) ) : 0;
|
29 |
|
30 |
if ( ! wp_verify_nonce( $nonce, 'wpr-post-likes-nonce' ) ) {
|
31 |
exit( esc_html__( 'Not permitted', 'wpr-addons' ) );
|
35 |
$js_disabled = ( isset( $_REQUEST['disabled'] ) && $_REQUEST['disabled'] == true ) ? true : false;
|
36 |
|
37 |
// Base variables
|
38 |
+
$post_id = ( isset( $_REQUEST['post_id'] ) && is_numeric( $_REQUEST['post_id'] ) ) ? absint($_REQUEST['post_id']) : '';
|
39 |
|
40 |
$post_users = NULL;
|
41 |
$like_count = 0;
|
168 |
}
|
169 |
|
170 |
// Button Attributes
|
171 |
+
$attributes = 'href="'. esc_url(admin_url( 'admin-ajax.php?action=wpr_likes_init&post_id='. $post_id .'&nonce='. $nonce )) .'"';
|
172 |
+
$attributes .= ' class="wpr-post-like-button'. esc_attr($liked_class . $default_text_class) .'"';
|
173 |
$attributes .= ' title="'. esc_attr($title) .'"';
|
174 |
$attributes .= ' data-nonce="'. esc_attr($nonce) .'"';
|
175 |
$attributes .= ' data-post-id="'. esc_attr($post_id) .'"';
|
176 |
+
$attributes .= ' data-ajax="'. esc_url(admin_url( 'admin-ajax.php' )) .'"';
|
177 |
$attributes .= ' data-icon="'. esc_attr($icon_class) .'"';
|
178 |
$attributes .= ' data-text="'. esc_attr($button_text) .'"';
|
179 |
|
183 |
$output .= $this->get_like_count( $like_count, $button_text );
|
184 |
$output .= '</a>';
|
185 |
|
186 |
+
return $output; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
187 |
}
|
188 |
|
189 |
/**
|
270 |
*/
|
271 |
public function get_IP() {
|
272 |
if ( isset( $_SERVER['HTTP_CLIENT_IP'] ) && ! empty( $_SERVER['HTTP_CLIENT_IP'] ) ) {
|
273 |
+
$ip = sanitize_text_field(wp_unslash($_SERVER['HTTP_CLIENT_IP']));
|
274 |
} elseif ( isset( $_SERVER['HTTP_X_FORWARDED_FOR'] ) && ! empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) {
|
275 |
+
$ip = sanitize_text_field(wp_unslash($_SERVER['HTTP_X_FORWARDED_FOR']));
|
276 |
} else {
|
277 |
+
$ip = ( isset( $_SERVER['REMOTE_ADDR'] ) ) ? sanitize_text_field(wp_unslash($_SERVER['REMOTE_ADDR'])) : '0.0.0.0';
|
278 |
}
|
279 |
|
280 |
$ip = filter_var( $ip, FILTER_VALIDATE_IP );
|
291 |
|
292 |
if ( $number >= 1000 && $number < 1000000 ) {
|
293 |
$formatted = number_format( $number/1000, $precision ).'K';
|
294 |
+
} elseif ( $number >= 1000000 && $number < 1000000000 ) {
|
295 |
$formatted = number_format( $number/1000000, $precision ).'M';
|
296 |
+
} elseif ( $number >= 1000000000 ) {
|
297 |
$formatted = number_format( $number/1000000000, $precision ).'B';
|
298 |
} else {
|
299 |
$formatted = $number; // Number is less than 1000
|
314 |
$number = $like_text;
|
315 |
}
|
316 |
|
317 |
+
return '<span class="wpr-post-like-count">'. esc_html($number) .'</span>';
|
318 |
}
|
319 |
}
|
320 |
|
extensions/wpr-custom-css.php
CHANGED
@@ -2,7 +2,9 @@
|
|
2 |
use \Elementor\Controls_Manager;
|
3 |
use WprAddons\Classes\Utilities;
|
4 |
|
5 |
-
if ( ! defined( 'ABSPATH' ) )
|
|
|
|
|
6 |
|
7 |
class Wpr_Custom_CSS {
|
8 |
|
2 |
use \Elementor\Controls_Manager;
|
3 |
use WprAddons\Classes\Utilities;
|
4 |
|
5 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
6 |
+
exit; // Exit if accessed directly.
|
7 |
+
}
|
8 |
|
9 |
class Wpr_Custom_CSS {
|
10 |
|
extensions/wpr-parallax.php
CHANGED
@@ -9,7 +9,9 @@ use Elementor\Repeater;
|
|
9 |
use Elementor\Utils;
|
10 |
use WprAddons\Classes\Utilities;
|
11 |
|
12 |
-
if ( ! defined( 'ABSPATH' ) )
|
|
|
|
|
13 |
|
14 |
class Wpr_Parallax_Scroll {
|
15 |
|
@@ -362,12 +364,12 @@ class Wpr_Parallax_Scroll {
|
|
362 |
if ( $settings['wpr_enable_parallax_hover'] == 'yes' ) {
|
363 |
if ( $settings['hover_parallax'] ) {
|
364 |
|
365 |
-
echo '<div class="wpr-parallax-multi-layer" scalar-speed="'. $settings['scalar_speed']['size'] .'" direction="'. $settings['invert_direction'] .'" style="overflow: hidden;">';
|
366 |
|
367 |
foreach ( $settings['hover_parallax'] as $key => $item ) {
|
368 |
if ( $key < 2 || wpr_fs()->can_use_premium_code() ) {
|
369 |
-
echo '<div data-depth="'. $item['data_depth'] .'" style-top="'. $item['layer_position_vr']['size'] .'%" style-left="'. $item['layer_position_hr']['size'] .'%" class="wpr-parallax-ml-children elementor-repeater-item-'
|
370 |
-
echo '<img src="'
|
371 |
echo '</div>';
|
372 |
}
|
373 |
}
|
9 |
use Elementor\Utils;
|
10 |
use WprAddons\Classes\Utilities;
|
11 |
|
12 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
13 |
+
exit; // Exit if accessed directly.
|
14 |
+
}
|
15 |
|
16 |
class Wpr_Parallax_Scroll {
|
17 |
|
364 |
if ( $settings['wpr_enable_parallax_hover'] == 'yes' ) {
|
365 |
if ( $settings['hover_parallax'] ) {
|
366 |
|
367 |
+
echo '<div class="wpr-parallax-multi-layer" scalar-speed="'. esc_attr($settings['scalar_speed']['size']) .'" direction="'. esc_attr($settings['invert_direction']) .'" style="overflow: hidden;">';
|
368 |
|
369 |
foreach ( $settings['hover_parallax'] as $key => $item ) {
|
370 |
if ( $key < 2 || wpr_fs()->can_use_premium_code() ) {
|
371 |
+
echo '<div data-depth="'. esc_attr($item['data_depth']) .'" style-top="'. esc_attr($item['layer_position_vr']['size']) .'%" style-left="'. esc_attr($item['layer_position_hr']['size']) .'%" class="wpr-parallax-ml-children elementor-repeater-item-'. esc_attr($item['_id']) .'">';
|
372 |
+
echo '<img src="'. esc_url($item['repeater_bg_image']['url']) .'">';
|
373 |
echo '</div>';
|
374 |
}
|
375 |
}
|
extensions/wpr-particles.php
CHANGED
@@ -3,7 +3,9 @@ use Elementor\Controls_Manager;
|
|
3 |
use Elementor\Core\Schemes\Color;
|
4 |
use WprAddons\Classes\Utilities;
|
5 |
|
6 |
-
if ( ! defined( 'ABSPATH' ) )
|
|
|
|
|
7 |
|
8 |
class Wpr_Particles {
|
9 |
|
3 |
use Elementor\Core\Schemes\Color;
|
4 |
use WprAddons\Classes\Utilities;
|
5 |
|
6 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
7 |
+
exit; // Exit if accessed directly.
|
8 |
+
}
|
9 |
|
10 |
class Wpr_Particles {
|
11 |
|
extensions/wpr-reading-progress-bar.php
CHANGED
@@ -1,218 +1,201 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace WprAddons\Extensions\Wpr_ReadingProgressBar;
|
4 |
-
|
5 |
-
// Elementor classes
|
6 |
-
use Elementor\Controls_Manager;
|
7 |
-
|
8 |
-
if ( ! defined( 'ABSPATH' ) ) {
|
9 |
-
exit; // Exit if accessed directly.
|
10 |
-
}
|
11 |
-
|
12 |
-
class Wpr_ReadingProgressBar {
|
13 |
-
|
14 |
-
private static $_instance = null;
|
15 |
-
|
16 |
-
public final function __construct() {
|
17 |
-
// Register controls on Post/Page Settings
|
18 |
-
add_action( 'elementor/documents/register_controls', [ $this, 'register_controls' ], 10, 3 );
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
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 |
-
|
101 |
-
|
102 |
-
|
103 |
-
'
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
'.wpr-reading-progress-bar-container' => 'height: {{SIZE}}{{UNIT}} !important',
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
'
|
120 |
-
'
|
121 |
-
'
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
'
|
135 |
-
'
|
136 |
-
'
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
'
|
150 |
-
'
|
151 |
-
'
|
152 |
-
'
|
153 |
-
|
154 |
-
'
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
'
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
$
|
176 |
-
$
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
}
|
202 |
-
|
203 |
-
echo '<div style="'. $rpb_position . $rpb_background_color .'" class="wpr-reading-progress-bar-container"><div style="'.$rpb_fill_color . $rpb_height .'" class="wpr-reading-progress-bar wpr-mybar" id="wpr-mybar"></div></div>';
|
204 |
-
} else {
|
205 |
-
echo '<div class="wpr-reading-progress-bar-container"><div class="wpr-reading-progress-bar wpr-mybar" id="wpr-mybar"></div></div>';
|
206 |
-
}
|
207 |
-
}
|
208 |
-
}
|
209 |
-
|
210 |
-
public static function instance() {
|
211 |
-
if ( is_null( self::$_instance ) ) {
|
212 |
-
self::$_instance = new self();
|
213 |
-
}
|
214 |
-
return self::$_instance;
|
215 |
-
}
|
216 |
-
}
|
217 |
-
|
218 |
Wpr_ReadingProgressBar::instance();
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace WprAddons\Extensions\Wpr_ReadingProgressBar;
|
4 |
+
|
5 |
+
// Elementor classes
|
6 |
+
use Elementor\Controls_Manager;
|
7 |
+
|
8 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
9 |
+
exit; // Exit if accessed directly.
|
10 |
+
}
|
11 |
+
|
12 |
+
class Wpr_ReadingProgressBar {
|
13 |
+
|
14 |
+
private static $_instance = null;
|
15 |
+
|
16 |
+
public final function __construct() {
|
17 |
+
// Register controls on Post/Page Settings
|
18 |
+
add_action( 'elementor/documents/register_controls', [ $this, 'register_controls' ], 10, 3 );
|
19 |
+
add_action( 'wp_footer', [ $this, 'html_to_footer' ] );
|
20 |
+
}
|
21 |
+
|
22 |
+
public function register_controls( $element ) {
|
23 |
+
|
24 |
+
$element->start_controls_section(
|
25 |
+
'wpr_reading_progress_bar',
|
26 |
+
[
|
27 |
+
'tab' => Controls_Manager::TAB_SETTINGS,
|
28 |
+
'label' => __( 'Reading Progress Bar - Royal Addons', 'wpr-addons' ),
|
29 |
+
]
|
30 |
+
);
|
31 |
+
|
32 |
+
$element->add_control(
|
33 |
+
'wpr_rpb_apply_changes',
|
34 |
+
[
|
35 |
+
'type' => Controls_Manager::RAW_HTML,
|
36 |
+
'raw' => '<div style="text-align: center;"><button class="elementor-update-preview-button elementor-button elementor-button-success" onclick="elementor.reloadPreview();">Apply Changes</button></div>',
|
37 |
+
'condition' => [
|
38 |
+
'wpr_rpb_enable_globally' => 'yes'
|
39 |
+
]
|
40 |
+
]
|
41 |
+
);
|
42 |
+
|
43 |
+
$element->add_control(
|
44 |
+
'wpr_rpb_enable',
|
45 |
+
[
|
46 |
+
'label' => __( 'Enable Progress Bar', 'wpr-addons' ),
|
47 |
+
'type' => Controls_Manager::SWITCHER,
|
48 |
+
'render_type' => 'template',
|
49 |
+
'label_on' => __( 'On', 'wpr-addons' ),
|
50 |
+
'label_off' => __( 'Off', 'wpr-addons' ),
|
51 |
+
'return_value' => 'yes',
|
52 |
+
]
|
53 |
+
);
|
54 |
+
|
55 |
+
$element->add_control(
|
56 |
+
'wpr_rpb_enable_globally',
|
57 |
+
[
|
58 |
+
'label' => __( 'Enable Progress Bar Globally', 'wpr-addons' ),
|
59 |
+
'type' => Controls_Manager::SWITCHER,
|
60 |
+
'render_type' => 'template',
|
61 |
+
'label_on' => __( 'On', 'wpr-addons' ),
|
62 |
+
'label_off' => __( 'Off', 'wpr-addons' ),
|
63 |
+
'return_value' => 'yes',
|
64 |
+
'condition' => [
|
65 |
+
'wpr_rpb_enable' => 'yes',
|
66 |
+
],
|
67 |
+
]
|
68 |
+
);
|
69 |
+
|
70 |
+
$element->add_control(
|
71 |
+
'wpr_rpb_display_on',
|
72 |
+
[
|
73 |
+
'label' => __( 'Display Progress Bar', 'wpr-addons' ),
|
74 |
+
'type' => \Elementor\Controls_Manager::SELECT,
|
75 |
+
'default' => 'page',
|
76 |
+
'options' => [
|
77 |
+
'page' => __( 'On All Pages', 'wpr-addons' ),
|
78 |
+
'post' => __( 'On All Posts', 'wpr-addons' ),
|
79 |
+
'global' => __( 'Globally', 'wpr-addons' ),
|
80 |
+
],
|
81 |
+
'separator' => 'after',
|
82 |
+
'condition' => [
|
83 |
+
'wpr_rpb_enable' => 'yes',
|
84 |
+
'wpr_rpb_enable_globally' => 'yes',
|
85 |
+
],
|
86 |
+
]
|
87 |
+
);
|
88 |
+
|
89 |
+
$element->add_control(
|
90 |
+
'wpr_height',
|
91 |
+
[
|
92 |
+
'label' => __( 'Height', 'wpr-addons' ),
|
93 |
+
'type' => Controls_Manager::SLIDER,
|
94 |
+
'range' => [
|
95 |
+
'px' => [
|
96 |
+
'min' => 1,
|
97 |
+
'max' => 100,
|
98 |
+
'step' => 1,
|
99 |
+
],
|
100 |
+
],
|
101 |
+
'default' => [
|
102 |
+
'unit' => 'px',
|
103 |
+
'size' => 10,
|
104 |
+
],
|
105 |
+
'condition' => [
|
106 |
+
'wpr_rpb_enable' => 'yes',
|
107 |
+
],
|
108 |
+
'selectors' => [
|
109 |
+
'.wpr-reading-progress-bar-container' => 'height: {{SIZE}}{{UNIT}} !important',
|
110 |
+
'.wpr-reading-progress-bar-container .wpr-reading-progress-bar' => 'height: {{SIZE}}{{UNIT}} !important',
|
111 |
+
],
|
112 |
+
]
|
113 |
+
);
|
114 |
+
|
115 |
+
$element->add_control(
|
116 |
+
'wpr_background_color',
|
117 |
+
[
|
118 |
+
'label' => __( 'Background Color', 'wpr-addons' ),
|
119 |
+
'type' => \Elementor\Controls_Manager::COLOR,
|
120 |
+
'default' => '#C5C5C6',
|
121 |
+
'condition' => [
|
122 |
+
'wpr_rpb_enable' => 'yes',
|
123 |
+
],
|
124 |
+
'selectors' => [
|
125 |
+
'.wpr-reading-progress-bar-container' => 'background-color: {{VALUE}};'
|
126 |
+
]
|
127 |
+
]
|
128 |
+
);
|
129 |
+
|
130 |
+
$element->add_control(
|
131 |
+
'wpr_fill_color',
|
132 |
+
[
|
133 |
+
'label' => __( 'Fill Color', 'wpr-addons' ),
|
134 |
+
'type' => \Elementor\Controls_Manager::COLOR,
|
135 |
+
'default' => '#6A63DA',
|
136 |
+
'condition' => [
|
137 |
+
'wpr_rpb_enable' => 'yes',
|
138 |
+
],
|
139 |
+
'selectors' => [
|
140 |
+
'.wpr-reading-progress-bar-container .wpr-reading-progress-bar' => 'background-color: {{VALUE}};'
|
141 |
+
]
|
142 |
+
]
|
143 |
+
);
|
144 |
+
|
145 |
+
$element->add_control(//wpr_rpb_position
|
146 |
+
'progress_bar_position',
|
147 |
+
[
|
148 |
+
'label' => __( 'Position', 'wpr-addons' ),
|
149 |
+
'type' => \Elementor\Controls_Manager::SELECT,
|
150 |
+
'default' => 'top',
|
151 |
+
'render_type' => 'template',
|
152 |
+
'options' => [
|
153 |
+
'top' => __( 'Top', 'wpr-addons' ),
|
154 |
+
'bottom' => __( 'Bottom', 'wpr-addons' ),
|
155 |
+
],
|
156 |
+
'selectors_dictionary' => [
|
157 |
+
'top' => 'top: 0px !important; bottom: auto !important;',
|
158 |
+
'bottom' => 'bottom: 0px !important; top: auto !important;',
|
159 |
+
],
|
160 |
+
'selectors' => [
|
161 |
+
'{{WRAPPER}} .wpr-reading-progress-bar-container' => '{{VALUE}}',
|
162 |
+
],
|
163 |
+
'condition' => [
|
164 |
+
'wpr_rpb_enable' => 'yes',
|
165 |
+
],
|
166 |
+
]
|
167 |
+
);
|
168 |
+
|
169 |
+
$element->end_controls_section();
|
170 |
+
|
171 |
+
}
|
172 |
+
|
173 |
+
public function html_to_footer() {
|
174 |
+
$settings = get_option('wpr_progress_bar_global_options');
|
175 |
+
$rpb_position = 'top' === $settings['wpr_progress_bar_position'] ? 'top: 0px; bottom: auto;' : 'bottom: 0px; top: auto;';
|
176 |
+
$rpb_background_color = 'background-color: '. $settings['wpr_background_color'] .' !important;';
|
177 |
+
$rpb_fill_color = 'background-color: '. $settings['wpr_fill_color'] .'!important;';
|
178 |
+
$rpb_height = 'height: '. $settings['wpr_height']['size'] . $settings['wpr_height']['unit'] .';';
|
179 |
+
|
180 |
+
if ( !empty($settings) && 'yes' === $settings['wpr_rpb_enable'] ) {
|
181 |
+
if ( 'yes' === $settings['wpr_rpb_enable_globally_option'] ) {
|
182 |
+
if ( ('post' === $settings['wpr_rpb_display_option'] && ! is_single()) || ('page' === $settings['wpr_rpb_display_option'] && ! is_page()) ) {
|
183 |
+
return;
|
184 |
+
}
|
185 |
+
|
186 |
+
echo '<div style="'. esc_attr($rpb_position . $rpb_background_color) .'" class="wpr-reading-progress-bar-container"><div style="'. esc_attr($rpb_fill_color . $rpb_height) .'" class="wpr-reading-progress-bar wpr-mybar" id="wpr-mybar"></div></div>';
|
187 |
+
} else {
|
188 |
+
echo '<div class="wpr-reading-progress-bar-container"><div class="wpr-reading-progress-bar wpr-mybar" id="wpr-mybar"></div></div>';
|
189 |
+
}
|
190 |
+
}
|
191 |
+
}
|
192 |
+
|
193 |
+
public static function instance() {
|
194 |
+
if ( is_null( self::$_instance ) ) {
|
195 |
+
self::$_instance = new self();
|
196 |
+
}
|
197 |
+
return self::$_instance;
|
198 |
+
}
|
199 |
+
}
|
200 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
201 |
Wpr_ReadingProgressBar::instance();
|
extensions/wpr-sticky-section.php
CHANGED
@@ -15,7 +15,9 @@ use Elementor\Core\Breakpoints;
|
|
15 |
use WprAddons\Classes\Utilities;
|
16 |
|
17 |
|
18 |
-
if ( ! defined( 'ABSPATH' ) )
|
|
|
|
|
19 |
|
20 |
class Wpr_Sticky_Section {
|
21 |
|
15 |
use WprAddons\Classes\Utilities;
|
16 |
|
17 |
|
18 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
19 |
+
exit; // Exit if accessed directly.
|
20 |
+
}
|
21 |
|
22 |
class Wpr_Sticky_Section {
|
23 |
|
freemius/assets/css/admin/affiliation.css
CHANGED
@@ -1,12 +1,12 @@
|
|
1 |
-
@charset "UTF-8";#fs_affiliation_content_wrapper #messages{margin-top:25px}#fs_affiliation_content_wrapper h3{font-size:24px;padding:0;margin-left:0}#fs_affiliation_content_wrapper ul li{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;list-style-type:none}#fs_affiliation_content_wrapper ul li:before{content:'✓';margin-right:10px;font-weight:bold}#fs_affiliation_content_wrapper p:not(.description),#fs_affiliation_content_wrapper li,#fs_affiliation_content_wrapper label{font-size:16px !important;line-height:26px !important}#fs_affiliation_content_wrapper .button{margin-top:20px;margin-bottom:7px;line-height:35px;height:40px;font-size:16px}#fs_affiliation_content_wrapper .button#cancel_button{margin-right:5px}#fs_affiliation_content_wrapper form .input-container{margin-bottom:15px}#fs_affiliation_content_wrapper form .input-container .input-label{font-weight:bold;display:block;width:100%}#fs_affiliation_content_wrapper form .input-container.input-container-text label,#fs_affiliation_content_wrapper form .input-container.input-container-text input,#fs_affiliation_content_wrapper form .input-container.input-container-text textarea{display:block}#fs_affiliation_content_wrapper form .input-container #add_domain,#fs_affiliation_content_wrapper form .input-container .remove-domain{text-decoration:none;display:inline-block;margin-top:3px}#fs_affiliation_content_wrapper form .input-container #add_domain:focus,#fs_affiliation_content_wrapper form .input-container .remove-domain:focus{box-shadow:none}#fs_affiliation_content_wrapper form .input-container #add_domain.disabled,#fs_affiliation_content_wrapper form .input-container .remove-domain.disabled{color:#aaa;cursor:default}#fs_affiliation_content_wrapper form #extra_domains_container .description{margin-top:0;position:relative;top:-4px}#fs_affiliation_content_wrapper form #extra_domains_container .extra-domain-input-container{margin-bottom:15px}#fs_affiliation_content_wrapper form #extra_domains_container .extra-domain-input-container .domain{display:inline-block;margin-right:5px}#fs_affiliation_content_wrapper form #extra_domains_container .extra-domain-input-container .domain:last-of-type{margin-bottom:0}
|
2 |
-
|
3 |
-
#fs_affiliation_content_wrapper .postbox {
|
4 |
-
padding: 0 20px 10px 20px;
|
5 |
-
}
|
6 |
-
|
7 |
-
#fs_affiliation_content_wrapper #apply_button {
|
8 |
-
padding: 0 25px;
|
9 |
-
text-transform: uppercase;
|
10 |
-
font-size: 14px;
|
11 |
-
letter-spacing: 0.5px;
|
12 |
}
|
1 |
+
@charset "UTF-8";#fs_affiliation_content_wrapper #messages{margin-top:25px}#fs_affiliation_content_wrapper h3{font-size:24px;padding:0;margin-left:0}#fs_affiliation_content_wrapper ul li{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;list-style-type:none}#fs_affiliation_content_wrapper ul li:before{content:'✓';margin-right:10px;font-weight:bold}#fs_affiliation_content_wrapper p:not(.description),#fs_affiliation_content_wrapper li,#fs_affiliation_content_wrapper label{font-size:16px !important;line-height:26px !important}#fs_affiliation_content_wrapper .button{margin-top:20px;margin-bottom:7px;line-height:35px;height:40px;font-size:16px}#fs_affiliation_content_wrapper .button#cancel_button{margin-right:5px}#fs_affiliation_content_wrapper form .input-container{margin-bottom:15px}#fs_affiliation_content_wrapper form .input-container .input-label{font-weight:bold;display:block;width:100%}#fs_affiliation_content_wrapper form .input-container.input-container-text label,#fs_affiliation_content_wrapper form .input-container.input-container-text input,#fs_affiliation_content_wrapper form .input-container.input-container-text textarea{display:block}#fs_affiliation_content_wrapper form .input-container #add_domain,#fs_affiliation_content_wrapper form .input-container .remove-domain{text-decoration:none;display:inline-block;margin-top:3px}#fs_affiliation_content_wrapper form .input-container #add_domain:focus,#fs_affiliation_content_wrapper form .input-container .remove-domain:focus{box-shadow:none}#fs_affiliation_content_wrapper form .input-container #add_domain.disabled,#fs_affiliation_content_wrapper form .input-container .remove-domain.disabled{color:#aaa;cursor:default}#fs_affiliation_content_wrapper form #extra_domains_container .description{margin-top:0;position:relative;top:-4px}#fs_affiliation_content_wrapper form #extra_domains_container .extra-domain-input-container{margin-bottom:15px}#fs_affiliation_content_wrapper form #extra_domains_container .extra-domain-input-container .domain{display:inline-block;margin-right:5px}#fs_affiliation_content_wrapper form #extra_domains_container .extra-domain-input-container .domain:last-of-type{margin-bottom:0}
|
2 |
+
|
3 |
+
#fs_affiliation_content_wrapper .postbox {
|
4 |
+
padding: 0 20px 10px 20px;
|
5 |
+
}
|
6 |
+
|
7 |
+
#fs_affiliation_content_wrapper #apply_button {
|
8 |
+
padding: 0 25px;
|
9 |
+
text-transform: uppercase;
|
10 |
+
font-size: 14px;
|
11 |
+
letter-spacing: 0.5px;
|
12 |
}
|
freemius/includes/class-freemius.php
CHANGED
@@ -1,25387 +1,25387 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Freemius
|
4 |
-
* @copyright Copyright (c) 2015, Freemius, Inc.
|
5 |
-
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
6 |
-
* @since 1.0.3
|
7 |
-
*/
|
8 |
-
if ( ! defined( 'ABSPATH' ) ) {
|
9 |
-
exit;
|
10 |
-
}
|
11 |
-
|
12 |
-
// "final class"
|
13 |
-
class Freemius extends Freemius_Abstract {
|
14 |
-
/**
|
15 |
-
* SDK Version
|
16 |
-
*
|
17 |
-
* @var string
|
18 |
-
*/
|
19 |
-
public $version = WP_FS__SDK_VERSION;
|
20 |
-
|
21 |
-
#region Plugin Info
|
22 |
-
|
23 |
-
/**
|
24 |
-
* @since 1.0.1
|
25 |
-
*
|
26 |
-
* @var string
|
27 |
-
*/
|
28 |
-
private $_slug;
|
29 |
-
|
30 |
-
/**
|
31 |
-
* @since 1.0.0
|
32 |
-
*
|
33 |
-
* @var string
|
34 |
-
*/
|
35 |
-
private $_plugin_basename;
|
36 |
-
/**
|
37 |
-
* @since 2.2.1
|
38 |
-
*
|
39 |
-
* @var string
|
40 |
-
*/
|
41 |
-
private $_premium_plugin_basename;
|
42 |
-
/**
|
43 |
-
* @since 1.0.0
|
44 |
-
*
|
45 |
-
* @var string
|
46 |
-
*/
|
47 |
-
private $_free_plugin_basename;
|
48 |
-
/**
|
49 |
-
* @since 1.0.0
|
50 |
-
*
|
51 |
-
* @var string
|
52 |
-
*/
|
53 |
-
private $_plugin_dir_path;
|
54 |
-
/**
|
55 |
-
* @since 1.0.0
|
56 |
-
*
|
57 |
-
* @var string
|
58 |
-
*/
|
59 |
-
private $_plugin_dir_name;
|
60 |
-
/**
|
61 |
-
* @since 1.0.0
|
62 |
-
*
|
63 |
-
* @var string
|
64 |
-
*/
|
65 |
-
private $_plugin_main_file_path;
|
66 |
-
/**
|
67 |
-
* @var string[]
|
68 |
-
*/
|
69 |
-
private $_plugin_data;
|
70 |
-
/**
|
71 |
-
* @since 1.0.9
|
72 |
-
*
|
73 |
-
* @var string
|
74 |
-
*/
|
75 |
-
private $_plugin_name;
|
76 |
-
/**
|
77 |
-
* @since 1.2.2
|
78 |
-
*
|
79 |
-
* @var string
|
80 |
-
*/
|
81 |
-
private $_module_type;
|
82 |
-
|
83 |
-
#endregion Plugin Info
|
84 |
-
|
85 |
-
/**
|
86 |
-
* @since 1.0.9
|
87 |
-
*
|
88 |
-
* @var bool If false, don't turn Freemius on.
|
89 |
-
*/
|
90 |
-
private $_is_on;
|
91 |
-
|
92 |
-
/**
|
93 |
-
* @since 1.1.3
|
94 |
-
*
|
95 |
-
* @var bool If false, don't turn Freemius on.
|
96 |
-
*/
|
97 |
-
private $_is_anonymous;
|
98 |
-
|
99 |
-
/**
|
100 |
-
* @since 1.0.9
|
101 |
-
* @var bool If false, issues with connectivity to Freemius API.
|
102 |
-
*/
|
103 |
-
private $_has_api_connection;
|
104 |
-
|
105 |
-
/**
|
106 |
-
* @since 1.0.9
|
107 |
-
* @since 2.0.0 Default to true since we need the property during the instance construction, prior to the dynamic_init() execution.
|
108 |
-
* @var bool Hints the SDK if plugin can support anonymous mode (if skip connect is visible).
|
109 |
-
*/
|
110 |
-
private $_enable_anonymous = true;
|
111 |
-
|
112 |
-
/**
|
113 |
-
* @since 1.1.7.5
|
114 |
-
* @var bool Hints the SDK if plugin should run in anonymous mode (only adds feedback form).
|
115 |
-
*/
|
116 |
-
private $_anonymous_mode;
|
117 |
-
|
118 |
-
/**
|
119 |
-
* @since 1.1.9
|
120 |
-
* @var bool Hints the SDK if plugin have any free plans.
|
121 |
-
*/
|
122 |
-
private $_is_premium_only;
|
123 |
-
|
124 |
-
/**
|
125 |
-
* @since 1.2.1.6
|
126 |
-
* @var bool Hints the SDK if plugin have premium code version at all.
|
127 |
-
*/
|
128 |
-
private $_has_premium_version;
|
129 |
-
|
130 |
-
/**
|
131 |
-
* @since 1.2.1.6
|
132 |
-
* @var bool Hints the SDK if plugin should ignore pending mode by simulating a skip.
|
133 |
-
*/
|
134 |
-
private $_ignore_pending_mode;
|
135 |
-
|
136 |
-
/**
|
137 |
-
* @since 1.0.8
|
138 |
-
* @var bool Hints the SDK if the plugin has any paid plans.
|
139 |
-
*/
|
140 |
-
private $_has_paid_plans;
|
141 |
-
|
142 |
-
/**
|
143 |
-
* @since 1.2.1.5
|
144 |
-
* @var int Hints the SDK if the plugin offers a trial period. If negative, no trial, if zero - has a trial but
|
145 |
-
* without a specified period, if positive - the number of trial days.
|
146 |
-
*/
|
147 |
-
private $_trial_days = - 1;
|
148 |
-
|
149 |
-
/**
|
150 |
-
* @since 1.2.1.5
|
151 |
-
* @var bool Hints the SDK if the trial requires a payment method or not.
|
152 |
-
*/
|
153 |
-
private $_is_trial_require_payment = false;
|
154 |
-
|
155 |
-
/**
|
156 |
-
* @since 1.0.7
|
157 |
-
* @var bool Hints the SDK if the plugin is WordPress.org compliant.
|
158 |
-
*/
|
159 |
-
private $_is_org_compliant;
|
160 |
-
|
161 |
-
/**
|
162 |
-
* @since 1.0.7
|
163 |
-
* @var bool Hints the SDK if the plugin is has add-ons.
|
164 |
-
*/
|
165 |
-
private $_has_addons;
|
166 |
-
|
167 |
-
/**
|
168 |
-
* @since 2.4.5
|
169 |
-
* @var string Navigation type: 'menu' or 'tabs'.
|
170 |
-
*/
|
171 |
-
private $_navigation;
|
172 |
-
|
173 |
-
const NAVIGATION_MENU = 'menu';
|
174 |
-
const NAVIGATION_TABS = 'tabs';
|
175 |
-
|
176 |
-
/**
|
177 |
-
* @since 1.1.6
|
178 |
-
* @var string[]bool.
|
179 |
-
*/
|
180 |
-
private $_permissions;
|
181 |
-
|
182 |
-
/**
|
183 |
-
* @var FS_Storage
|
184 |
-
*/
|
185 |
-
private $_storage;
|
186 |
-
|
187 |
-
/**
|
188 |
-
* @since 1.2.2.7
|
189 |
-
* @var FS_Cache_Manager
|
190 |
-
*/
|
191 |
-
private $_cache;
|
192 |
-
|
193 |
-
/**
|
194 |
-
* @since 1.0.0
|
195 |
-
*
|
196 |
-
* @var FS_Logger
|
197 |
-
*/
|
198 |
-
private $_logger;
|
199 |
-
/**
|
200 |
-
* @since 1.0.4
|
201 |
-
*
|
202 |
-
* @var FS_Plugin
|
203 |
-
*/
|
204 |
-
private $_plugin = false;
|
205 |
-
/**
|
206 |
-
* @since 1.0.4
|
207 |
-
*
|
208 |
-
* @var FS_Plugin|false
|
209 |
-
*/
|
210 |
-
private $_parent_plugin = false;
|
211 |
-
/**
|
212 |
-
* @since 1.1.1
|
213 |
-
*
|
214 |
-
* @var Freemius
|
215 |
-
*/
|
216 |
-
private $_parent = false;
|
217 |
-
/**
|
218 |
-
* @since 1.0.1
|
219 |
-
*
|
220 |
-
* @var FS_User
|
221 |
-
*/
|
222 |
-
private $_user = false;
|
223 |
-
/**
|
224 |
-
* @since 1.0.1
|
225 |
-
*
|
226 |
-
* @var FS_Site
|
227 |
-
*/
|
228 |
-
private $_site = false;
|
229 |
-
/**
|
230 |
-
* @since 1.0.1
|
231 |
-
*
|
232 |
-
* @var FS_Plugin_License
|
233 |
-
*/
|
234 |
-
private $_license;
|
235 |
-
/**
|
236 |
-
* @since 1.0.2
|
237 |
-
*
|
238 |
-
* @var FS_Plugin_Plan[]
|
239 |
-
*/
|
240 |
-
private $_plans = false;
|
241 |
-
/**
|
242 |
-
* @var FS_Plugin_License[]
|
243 |
-
* @since 1.0.5
|
244 |
-
*/
|
245 |
-
private $_licenses = false;
|
246 |
-
|
247 |
-
/**
|
248 |
-
* @since 1.0.1
|
249 |
-
*
|
250 |
-
* @var FS_Admin_Menu_Manager
|
251 |
-
*/
|
252 |
-
private $_menu;
|
253 |
-
|
254 |
-
/**
|
255 |
-
* @var FS_Admin_Notices
|
256 |
-
*/
|
257 |
-
private $_admin_notices;
|
258 |
-
|
259 |
-
/**
|
260 |
-
* @since 1.1.6
|
261 |
-
*
|
262 |
-
* @var FS_Admin_Notices
|
263 |
-
*/
|
264 |
-
private static $_global_admin_notices;
|
265 |
-
|
266 |
-
/**
|
267 |
-
* @var FS_Logger
|
268 |
-
* @since 1.0.0
|
269 |
-
*/
|
270 |
-
private static $_static_logger;
|
271 |
-
|
272 |
-
/**
|
273 |
-
* @var FS_Options
|
274 |
-
* @since 1.0.2
|
275 |
-
*/
|
276 |
-
private static $_accounts;
|
277 |
-
|
278 |
-
/**
|
279 |
-
* @since 1.2.2
|
280 |
-
*
|
281 |
-
* @var number
|
282 |
-
*/
|
283 |
-
private $_module_id;
|
284 |
-
|
285 |
-
/**
|
286 |
-
* @var Freemius[]
|
287 |
-
*/
|
288 |
-
private static $_instances = array();
|
289 |
-
|
290 |
-
/**
|
291 |
-
* @since 1.2.3
|
292 |
-
*
|
293 |
-
* @var FS_Affiliate
|
294 |
-
*/
|
295 |
-
private $affiliate = null;
|
296 |
-
|
297 |
-
/**
|
298 |
-
* @since 1.2.3
|
299 |
-
*
|
300 |
-
* @var FS_AffiliateTerms
|
301 |
-
*/
|
302 |
-
private $plugin_affiliate_terms = null;
|
303 |
-
|
304 |
-
/**
|
305 |
-
* @since 1.2.3
|
306 |
-
*
|
307 |
-
* @var FS_AffiliateTerms
|
308 |
-
*/
|
309 |
-
private $custom_affiliate_terms = null;
|
310 |
-
|
311 |
-
/**
|
312 |
-
* @since 2.0.0
|
313 |
-
*
|
314 |
-
* @var bool
|
315 |
-
*/
|
316 |
-
private $_is_multisite_integrated;
|
317 |
-
|
318 |
-
/**
|
319 |
-
* @since 2.0.0
|
320 |
-
*
|
321 |
-
* @var bool True if the current request is for a network admin screen and the plugin is network active.
|
322 |
-
*/
|
323 |
-
private $_is_network_active;
|
324 |
-
|
325 |
-
/**
|
326 |
-
* @since 2.0.0
|
327 |
-
*
|
328 |
-
* @var int|null The original blog ID the plugin was loaded with.
|
329 |
-
*/
|
330 |
-
private $_blog_id = null;
|
331 |
-
|
332 |
-
/**
|
333 |
-
* @since 2.0.0
|
334 |
-
*
|
335 |
-
* @var int|null The current execution context. When true, run on network context. When int, run on the specified blog context.
|
336 |
-
*/
|
337 |
-
private $_context_is_network_or_blog_id = null;
|
338 |
-
|
339 |
-
/**
|
340 |
-
* @since 2.0.0
|
341 |
-
*
|
342 |
-
* @var string
|
343 |
-
*/
|
344 |
-
private $_dynamically_added_top_level_page_hook_name = '';
|
345 |
-
|
346 |
-
/**
|
347 |
-
* @author Leo Fajardo (@leorw)
|
348 |
-
* @since 2.3.1
|
349 |
-
*
|
350 |
-
* @var bool
|
351 |
-
*/
|
352 |
-
private $is_whitelabeled;
|
353 |
-
|
354 |
-
/**
|
355 |
-
* @author Leo Fajardo (@leorw)
|
356 |
-
* @since 2.4.0
|
357 |
-
*
|
358 |
-
* @var bool
|
359 |
-
*/
|
360 |
-
private $_is_bundle_license_auto_activation_enabled = false;
|
361 |
-
|
362 |
-
#region Uninstall Reasons IDs
|
363 |
-
|
364 |
-
const REASON_NO_LONGER_NEEDED = 1;
|
365 |
-
const REASON_FOUND_A_BETTER_PLUGIN = 2;
|
366 |
-
const REASON_NEEDED_FOR_A_SHORT_PERIOD = 3;
|
367 |
-
const REASON_BROKE_MY_SITE = 4;
|
368 |
-
const REASON_SUDDENLY_STOPPED_WORKING = 5;
|
369 |
-
const REASON_CANT_PAY_ANYMORE = 6;
|
370 |
-
const REASON_OTHER = 7;
|
371 |
-
const REASON_DIDNT_WORK = 8;
|
372 |
-
const REASON_DONT_LIKE_TO_SHARE_MY_INFORMATION = 9;
|
373 |
-
const REASON_COULDNT_MAKE_IT_WORK = 10;
|
374 |
-
const REASON_GREAT_BUT_NEED_SPECIFIC_FEATURE = 11;
|
375 |
-
const REASON_NOT_WORKING = 12;
|
376 |
-
const REASON_NOT_WHAT_I_WAS_LOOKING_FOR = 13;
|
377 |
-
const REASON_DIDNT_WORK_AS_EXPECTED = 14;
|
378 |
-
const REASON_TEMPORARY_DEACTIVATION = 15;
|
379 |
-
|
380 |
-
/**
|
381 |
-
* @author Leo Fajardo (@leorw)
|
382 |
-
* @since 2.3.1
|
383 |
-
*
|
384 |
-
* @var boolean|null
|
385 |
-
*/
|
386 |
-
private $_use_external_pricing = null;
|
387 |
-
/**
|
388 |
-
* @author Leo Fajardo (@leorw)
|
389 |
-
* @since 2.4.2
|
390 |
-
*
|
391 |
-
* @var string|null
|
392 |
-
*/
|
393 |
-
private $_pricing_js_path = null;
|
394 |
-
|
395 |
-
#endregion
|
396 |
-
|
397 |
-
/* Ctor
|
398 |
-
------------------------------------------------------------------------------------------------------------------*/
|
399 |
-
|
400 |
-
/**
|
401 |
-
* Main singleton instance.
|
402 |
-
*
|
403 |
-
* @author Vova Feldman (@svovaf)
|
404 |
-
* @since 1.0.0
|
405 |
-
*
|
406 |
-
* @param number $module_id
|
407 |
-
* @param string|bool $slug
|
408 |
-
* @param bool $is_init Since 1.2.1 Is initiation sequence.
|
409 |
-
*/
|
410 |
-
private function __construct( $module_id, $slug = false, $is_init = false ) {
|
411 |
-
if ( $is_init && is_numeric( $module_id ) && is_string( $slug ) ) {
|
412 |
-
$this->store_id_slug_type_path_map( $module_id, $slug );
|
413 |
-
}
|
414 |
-
|
415 |
-
$this->_module_id = $module_id;
|
416 |
-
$this->_slug = $this->get_slug();
|
417 |
-
$this->_module_type = $this->get_module_type();
|
418 |
-
|
419 |
-
$this->_blog_id = is_multisite() ? get_current_blog_id() : null;
|
420 |
-
|
421 |
-
$this->_storage = FS_Storage::instance( $this->_module_type, $this->_slug );
|
422 |
-
|
423 |
-
$this->_cache = FS_Cache_Manager::get_manager( WP_FS___OPTION_PREFIX . "cache_{$module_id}" );
|
424 |
-
|
425 |
-
$this->_logger = FS_Logger::get_logger( WP_FS__SLUG . '_' . $this->get_unique_affix(), WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK );
|
426 |
-
|
427 |
-
$this->_plugin_main_file_path = $this->_find_caller_plugin_file( $is_init );
|
428 |
-
$this->_plugin_dir_path = plugin_dir_path( $this->_plugin_main_file_path );
|
429 |
-
$this->_plugin_basename = $this->get_plugin_basename();
|
430 |
-
$this->_free_plugin_basename = str_replace( '-premium/', '/', $this->_plugin_basename );
|
431 |
-
|
432 |
-
$this->_is_multisite_integrated = (
|
433 |
-
defined( "WP_FS__PRODUCT_{$module_id}_MULTISITE" ) &&
|
434 |
-
( true === constant( "WP_FS__PRODUCT_{$module_id}_MULTISITE" ) )
|
435 |
-
);
|
436 |
-
|
437 |
-
$this->_is_network_active = (
|
438 |
-
is_multisite() &&
|
439 |
-
$this->_is_multisite_integrated &&
|
440 |
-
// Themes are always network activated, but the ACTUAL activation is per site.
|
441 |
-
$this->is_plugin() &&
|
442 |
-
(
|
443 |
-
is_plugin_active_for_network( $this->_plugin_basename ) ||
|
444 |
-
// Plugin network level activation or uninstall.
|
445 |
-
( fs_is_network_admin() && is_plugin_inactive( $this->_plugin_basename ) )
|
446 |
-
)
|
447 |
-
);
|
448 |
-
|
449 |
-
$this->_storage->set_network_active(
|
450 |
-
$this->_is_network_active,
|
451 |
-
$this->is_delegated_connection()
|
452 |
-
);
|
453 |
-
|
454 |
-
if ( ! isset( $this->_storage->is_network_activated ) ) {
|
455 |
-
$this->_storage->is_network_activated = $this->_is_network_active;
|
456 |
-
}
|
457 |
-
|
458 |
-
if ( $this->_storage->is_network_activated != $this->_is_network_active ) {
|
459 |
-
// Update last activation level.
|
460 |
-
$this->_storage->is_network_activated = $this->_is_network_active;
|
461 |
-
|
462 |
-
$this->maybe_adjust_storage();
|
463 |
-
}
|
464 |
-
|
465 |
-
#region Migration
|
466 |
-
|
467 |
-
if ( is_multisite() ) {
|
468 |
-
/**
|
469 |
-
* If the install_timestamp exists on the site level but doesn't exist on the
|
470 |
-
* network level storage, it means that we need to process the storage with migration.
|
471 |
-
*
|
472 |
-
* The code in this `if` scope will only be executed once and only for the first site that will execute it because once we migrate the storage data, install_timestamp will be already set in the network level storage.
|
473 |
-
*
|
474 |
-
* @author Vova Feldman (@svovaf)
|
475 |
-
* @since 2.0.0
|
476 |
-
*/
|
477 |
-
if ( false === $this->_storage->get( 'install_timestamp', false, true ) &&
|
478 |
-
false !== $this->_storage->get( 'install_timestamp', false, false )
|
479 |
-
) {
|
480 |
-
// Initiate storage migration.
|
481 |
-
$this->_storage->migrate_to_network();
|
482 |
-
|
483 |
-
// Migrate module cache to network level storage.
|
484 |
-
$this->_cache->migrate_to_network();
|
485 |
-
}
|
486 |
-
}
|
487 |
-
|
488 |
-
#endregion
|
489 |
-
|
490 |
-
$base_name_split = explode( '/', $this->_plugin_basename );
|
491 |
-
$this->_plugin_dir_name = $base_name_split[0];
|
492 |
-
|
493 |
-
if ( $this->_logger->is_on() ) {
|
494 |
-
$this->_logger->info( 'plugin_main_file_path = ' . $this->_plugin_main_file_path );
|
495 |
-
$this->_logger->info( 'plugin_dir_path = ' . $this->_plugin_dir_path );
|
496 |
-
$this->_logger->info( 'plugin_basename = ' . $this->_plugin_basename );
|
497 |
-
$this->_logger->info( 'free_plugin_basename = ' . $this->_free_plugin_basename );
|
498 |
-
$this->_logger->info( 'plugin_dir_name = ' . $this->_plugin_dir_name );
|
499 |
-
}
|
500 |
-
|
501 |
-
// Remember link between file to slug.
|
502 |
-
$this->store_file_slug_map();
|
503 |
-
|
504 |
-
// Store plugin's initial install timestamp.
|
505 |
-
if ( ! isset( $this->_storage->install_timestamp ) ) {
|
506 |
-
$this->_storage->install_timestamp = WP_FS__SCRIPT_START_TIME;
|
507 |
-
}
|
508 |
-
|
509 |
-
if ( ! is_object( $this->_plugin ) ) {
|
510 |
-
$this->_plugin = FS_Plugin_Manager::instance( $this->_module_id )->get();
|
511 |
-
}
|
512 |
-
|
513 |
-
$this->_admin_notices = FS_Admin_Notices::instance(
|
514 |
-
$this->_slug . ( $this->is_theme() ? ':theme' : '' ),
|
515 |
-
/**
|
516 |
-
* Ensure that the admin notice will always have a title by using the stored plugin title if available and
|
517 |
-
* retrieving the title via the "get_plugin_name" method if there is no stored plugin title available.
|
518 |
-
*
|
519 |
-
* @author Leo Fajardo (@leorw)
|
520 |
-
* @since 1.2.2
|
521 |
-
*/
|
522 |
-
( is_object( $this->_plugin ) ? $this->_plugin->title : $this->get_plugin_name() ),
|
523 |
-
$this->get_unique_affix()
|
524 |
-
);
|
525 |
-
|
526 |
-
if ( 'true' === fs_request_get( 'fs_clear_api_cache' ) ||
|
527 |
-
fs_request_is_action( 'restart_freemius' )
|
528 |
-
) {
|
529 |
-
FS_Api::clear_cache();
|
530 |
-
$this->_cache->clear();
|
531 |
-
}
|
532 |
-
|
533 |
-
$this->register_constructor_hooks();
|
534 |
-
|
535 |
-
/**
|
536 |
-
* Starting from version 2.0.0, `FS_Site` entities no longer have the `plan` property and have `plan_id`
|
537 |
-
* instead. This should be called before calling `_load_account()`, otherwise, `$this->_site` will not be
|
538 |
-
* loaded in `_load_account` for versions of SDK starting from 2.0.0.
|
539 |
-
*
|
540 |
-
* @author Leo Fajardo (@leorw)
|
541 |
-
*/
|
542 |
-
self::migrate_install_plan_to_plan_id( $this->_storage );
|
543 |
-
|
544 |
-
$this->_load_account();
|
545 |
-
|
546 |
-
$this->_version_updates_handler();
|
547 |
-
}
|
548 |
-
|
549 |
-
/**
|
550 |
-
* @author Leo Fajardo (@leorw)
|
551 |
-
* @since 2.3.0
|
552 |
-
*/
|
553 |
-
private function maybe_adjust_storage() {
|
554 |
-
$install_timestamp = null;
|
555 |
-
$prev_is_premium = null;
|
556 |
-
|
557 |
-
$options_to_update = array();
|
558 |
-
|
559 |
-
$is_network_admin = fs_is_network_admin();
|
560 |
-
|
561 |
-
$network_install_timestamp = $this->_storage->get( 'install_timestamp', null, true );
|
562 |
-
|
563 |
-
if ( ! $is_network_admin ) {
|
564 |
-
if ( is_null( $network_install_timestamp ) ) {
|
565 |
-
// Plugin was not network-activated before.
|
566 |
-
return;
|
567 |
-
}
|
568 |
-
|
569 |
-
if ( is_null( $this->_storage->get( 'install_timestamp', null, false ) ) ) {
|
570 |
-
// Set the `install_timestamp` only if it's not yet set.
|
571 |
-
$install_timestamp = $network_install_timestamp;
|
572 |
-
}
|
573 |
-
|
574 |
-
$prev_is_premium = $this->_storage->get( 'prev_is_premium', null, true );
|
575 |
-
} else {
|
576 |
-
$current_wp_user = self::_get_current_wp_user();
|
577 |
-
$current_fs_user = self::_get_user_by_email( $current_wp_user->user_email );
|
578 |
-
$network_user_info = array();
|
579 |
-
|
580 |
-
$skips_count = 0;
|
581 |
-
|
582 |
-
$sites = self::get_sites();
|
583 |
-
$sites_count = count( $sites );
|
584 |
-
|
585 |
-
$blog_id_2_install_map = array();
|
586 |
-
|
587 |
-
$is_first_non_ignored_blog = true;
|
588 |
-
|
589 |
-
foreach ( $sites as $site ) {
|
590 |
-
$blog_id = self::get_site_blog_id( $site );
|
591 |
-
|
592 |
-
$blog_install_timestamp = $this->_storage->get( 'install_timestamp', null, $blog_id );
|
593 |
-
|
594 |
-
if ( is_null( $blog_install_timestamp ) ) {
|
595 |
-
// Plugin has not been installed on this blog.
|
596 |
-
continue;
|
597 |
-
}
|
598 |
-
|
599 |
-
$is_earlier_install = (
|
600 |
-
! is_null( $install_timestamp ) &&
|
601 |
-
$blog_install_timestamp < $install_timestamp
|
602 |
-
);
|
603 |
-
|
604 |
-
$install = $this->get_install_by_blog_id( $blog_id );
|
605 |
-
|
606 |
-
$update_network_user_info = false;
|
607 |
-
|
608 |
-
if ( ! is_object( $install ) ) {
|
609 |
-
if ( ! $this->_storage->get( 'is_anonymous', false, $blog_id ) ) {
|
610 |
-
// The opt-in decision (whether to skip or opt in) is yet to be made.
|
611 |
-
continue;
|
612 |
-
}
|
613 |
-
|
614 |
-
$skips_count ++;
|
615 |
-
} else {
|
616 |
-
$blog_id_2_install_map[ $blog_id ] = $install;
|
617 |
-
|
618 |
-
if ( empty( $network_user_info ) ) {
|
619 |
-
// Set the network user info for the 1st time. Choose any user information whether or not it is for the current WP user.
|
620 |
-
$update_network_user_info = true;
|
621 |
-
}
|
622 |
-
|
623 |
-
if ( ! $update_network_user_info &&
|
624 |
-
is_object( $current_fs_user ) &&
|
625 |
-
$network_user_info['user_id'] != $current_fs_user->id &&
|
626 |
-
$install->user_id == $current_fs_user->id
|
627 |
-
) {
|
628 |
-
// If an install that is owned by the current WP user is found, use its user information instead.
|
629 |
-
$update_network_user_info = true;
|
630 |
-
}
|
631 |
-
|
632 |
-
if ( ! $update_network_user_info &&
|
633 |
-
$is_earlier_install &&
|
634 |
-
( ! is_object( $current_fs_user ) || $current_fs_user->id == $install->user_id )
|
635 |
-
) {
|
636 |
-
// Update to the earliest install info if there's no install found so far that is owned by the current WP user; OR only if the found install is owned by the current WP user.
|
637 |
-
$update_network_user_info = true;
|
638 |
-
}
|
639 |
-
}
|
640 |
-
|
641 |
-
if ( $update_network_user_info ) {
|
642 |
-
$network_user_info = array(
|
643 |
-
'user_id' => $install->user_id,
|
644 |
-
'blog_id' => $blog_id
|
645 |
-
);
|
646 |
-
}
|
647 |
-
|
648 |
-
$site_prev_is_premium = $this->_storage->get( 'prev_is_premium', null, $blog_id );
|
649 |
-
|
650 |
-
if ( $is_first_non_ignored_blog ) {
|
651 |
-
$prev_is_premium = $site_prev_is_premium;
|
652 |
-
|
653 |
-
if ( is_null( $network_install_timestamp ) ) {
|
654 |
-
$install_timestamp = $blog_install_timestamp;
|
655 |
-
}
|
656 |
-
|
657 |
-
$is_first_non_ignored_blog = false;
|
658 |
-
|
659 |
-
continue;
|
660 |
-
}
|
661 |
-
|
662 |
-
if ( ! is_null( $prev_is_premium ) && $prev_is_premium !== $site_prev_is_premium ) {
|
663 |
-
// If a different `$site_prev_is_premium` value is found, do not include the option in the collection of options to update.
|
664 |
-
$prev_is_premium = null;
|
665 |
-
}
|
666 |
-
|
667 |
-
if ( $is_earlier_install ) {
|
668 |
-
// If an earlier install timestamp is found.
|
669 |
-
$install_timestamp = $blog_install_timestamp;
|
670 |
-
}
|
671 |
-
}
|
672 |
-
|
673 |
-
$installs_count = count( $blog_id_2_install_map );
|
674 |
-
|
675 |
-
if ( $sites_count === ( $installs_count + $skips_count ) ) {
|
676 |
-
if ( ! empty( $network_user_info ) ) {
|
677 |
-
$options_to_update['network_user_id'] = $network_user_info['user_id'];
|
678 |
-
$options_to_update['network_install_blog_id'] = $network_user_info['blog_id'];
|
679 |
-
|
680 |
-
foreach ( $blog_id_2_install_map as $blog_id => $install ) {
|
681 |
-
if ( $install->user_id == $network_user_info['user_id'] ) {
|
682 |
-
continue;
|
683 |
-
}
|
684 |
-
|
685 |
-
$this->_storage->store( 'is_delegated_connection', true, $blog_id );
|
686 |
-
}
|
687 |
-
}
|
688 |
-
|
689 |
-
if ( $sites_count === $skips_count ) {
|
690 |
-
/**
|
691 |
-
* Assume network-level skipping as the intended action if all actions identified were only
|
692 |
-
* skipping of the connection (i.e., no opt-ins and delegated connections so far).
|
693 |
-
*/
|
694 |
-
$options_to_update['is_anonymous_ms'] = true;
|
695 |
-
} else if ( $sites_count === $installs_count ) {
|
696 |
-
/**
|
697 |
-
* Assume network-level opt-in as the intended action if all actions identified were only opt-ins
|
698 |
-
* (i.e., no delegation and skipping of the connections so far).
|
699 |
-
*/
|
700 |
-
$options_to_update['is_network_connected'] = true;
|
701 |
-
}
|
702 |
-
}
|
703 |
-
}
|
704 |
-
|
705 |
-
if ( ! is_null( $install_timestamp ) ) {
|
706 |
-
$options_to_update['install_timestamp'] = $install_timestamp;
|
707 |
-
}
|
708 |
-
|
709 |
-
if ( ! is_null( $prev_is_premium ) ) {
|
710 |
-
$options_to_update['prev_is_premium'] = $prev_is_premium;
|
711 |
-
}
|
712 |
-
|
713 |
-
if ( ! empty( $options_to_update ) ) {
|
714 |
-
$this->adjust_storage( $options_to_update, $is_network_admin );
|
715 |
-
}
|
716 |
-
}
|
717 |
-
|
718 |
-
/**
|
719 |
-
* @author Leo Fajardo (@leorw)
|
720 |
-
* @since 2.3.0
|
721 |
-
*
|
722 |
-
* @param array $options
|
723 |
-
* @param bool $is_network_admin
|
724 |
-
*/
|
725 |
-
private function adjust_storage( $options, $is_network_admin ) {
|
726 |
-
foreach ( $options as $name => $value ) {
|
727 |
-
$this->_storage->store( $name, $value, $is_network_admin ? true : null );
|
728 |
-
}
|
729 |
-
}
|
730 |
-
|
731 |
-
/**
|
732 |
-
* Checks whether this module has a settings menu.
|
733 |
-
*
|
734 |
-
* @author Leo Fajardo (@leorw)
|
735 |
-
* @since 1.2.2
|
736 |
-
*
|
737 |
-
* @return bool
|
738 |
-
*/
|
739 |
-
function has_settings_menu() {
|
740 |
-
return ( $this->_is_network_active && fs_is_network_admin() ) ?
|
741 |
-
$this->_menu->has_network_menu() :
|
742 |
-
$this->_menu->has_menu();
|
743 |
-
}
|
744 |
-
|
745 |
-
/**
|
746 |
-
* If `true` the opt-in should be shown as a modal dialog box on the themes.php page. WordPress.org themes guidelines prohibit from redirecting the user from the themes.php page after activating a theme.
|
747 |
-
*
|
748 |
-
* @author Vova Feldman (@svovaf)
|
749 |
-
* @since 2.4.5
|
750 |
-
*
|
751 |
-
* @return bool
|
752 |
-
*/
|
753 |
-
function show_opt_in_on_themes_page() {
|
754 |
-
if ( ! $this->is_free_wp_org_theme() ) {
|
755 |
-
return false;
|
756 |
-
}
|
757 |
-
|
758 |
-
if ( ! $this->has_settings_menu() ) {
|
759 |
-
return true;
|
760 |
-
}
|
761 |
-
|
762 |
-
return $this->show_settings_with_tabs();
|
763 |
-
}
|
764 |
-
|
765 |
-
/**
|
766 |
-
* If `true` the opt-in should be shown on the product's main setting page.
|
767 |
-
*
|
768 |
-
* @author Vova Feldman (@svovaf)
|
769 |
-
* @since 2.4.5
|
770 |
-
*
|
771 |
-
* @return bool
|
772 |
-
*
|
773 |
-
* @uses show_opt_in_on_themes_page();
|
774 |
-
*/
|
775 |
-
function show_opt_in_on_setting_page() {
|
776 |
-
return ! $this->show_opt_in_on_themes_page();
|
777 |
-
}
|
778 |
-
|
779 |
-
/**
|
780 |
-
* If `true` the settings should be shown using tabs.
|
781 |
-
*
|
782 |
-
* @author Vova Feldman (@svovaf)
|
783 |
-
* @since 2.4.5
|
784 |
-
*
|
785 |
-
* @return bool
|
786 |
-
*/
|
787 |
-
function show_settings_with_tabs() {
|
788 |
-
return ( self::NAVIGATION_TABS === $this->_navigation );
|
789 |
-
}
|
790 |
-
|
791 |
-
/**
|
792 |
-
* Check if the context module is free wp.org theme.
|
793 |
-
*
|
794 |
-
* This method is helpful because:
|
795 |
-
* 1. wp.org themes are limited to a single submenu item,
|
796 |
-
* and sub-submenu items are most likely not allowed (never verified).
|
797 |
-
* 2. wp.org themes are not allowed to redirect the user
|
798 |
-
* after the theme activation, therefore, the agreed UX
|
799 |
-
* is showing the opt-in as a modal dialog box after
|
800 |
-
* activation (approved by @otto42, @emiluzelac, @greenshady, @grapplerulrich).
|
801 |
-
*
|
802 |
-
* @author Vova Feldman (@svovaf)
|
803 |
-
* @since 1.2.2.7
|
804 |
-
*
|
805 |
-
* @return bool
|
806 |
-
*/
|
807 |
-
function is_free_wp_org_theme() {
|
808 |
-
return (
|
809 |
-
$this->is_theme() &&
|
810 |
-
$this->is_org_repo_compliant() &&
|
811 |
-
! $this->is_premium()
|
812 |
-
);
|
813 |
-
}
|
814 |
-
|
815 |
-
/**
|
816 |
-
* Checks whether this a submenu item is visible.
|
817 |
-
*
|
818 |
-
* @author Vova Feldman (@svovaf)
|
819 |
-
* @since 1.2.2.6
|
820 |
-
* @since 1.2.2.7 Even if the menu item was specified to be hidden, when it is the context page, then show the submenu item so the user will have the right context page.
|
821 |
-
*
|
822 |
-
* @param string $slug
|
823 |
-
* @param bool $is_tabs_visibility_check This is used to decide if the associated tab should be shown or hidden.
|
824 |
-
*
|
825 |
-
* @return bool
|
826 |
-
*/
|
827 |
-
function is_submenu_item_visible( $slug, $is_tabs_visibility_check = false ) {
|
828 |
-
if ( $this->is_admin_page( $slug ) ) {
|
829 |
-
/**
|
830 |
-
* It is the current context page, so show the submenu item
|
831 |
-
* so the user will have the right context page, even if it
|
832 |
-
* was set to hidden.
|
833 |
-
*/
|
834 |
-
return true;
|
835 |
-
}
|
836 |
-
|
837 |
-
if ( ! $this->has_settings_menu() ) {
|
838 |
-
// No menu settings at all.
|
839 |
-
return false;
|
840 |
-
}
|
841 |
-
|
842 |
-
if (
|
843 |
-
! $is_tabs_visibility_check &&
|
844 |
-
$this->is_org_repo_compliant() &&
|
845 |
-
$this->show_settings_with_tabs()
|
846 |
-
) {
|
847 |
-
/**
|
848 |
-
* wp.org themes are limited to a single submenu item, and
|
849 |
-
* sub-submenu items are most likely not allowed (never verified).
|
850 |
-
*/
|
851 |
-
return false;
|
852 |
-
}
|
853 |
-
|
854 |
-
return $this->_menu->is_submenu_item_visible( $slug );
|
855 |
-
}
|
856 |
-
|
857 |
-
/**
|
858 |
-
* Check if a Freemius page should be accessible via the UI.
|
859 |
-
*
|
860 |
-
* @author Vova Feldman (@svovaf)
|
861 |
-
* @since 1.2.2.7
|
862 |
-
*
|
863 |
-
* @param string $slug
|
864 |
-
*
|
865 |
-
* @return bool
|
866 |
-
*/
|
867 |
-
function is_page_visible( $slug ) {
|
868 |
-
if ( $this->is_admin_page( $slug ) ) {
|
869 |
-
return true;
|
870 |
-
}
|
871 |
-
|
872 |
-
return $this->_menu->is_submenu_item_visible( $slug, true, true );
|
873 |
-
}
|
874 |
-
|
875 |
-
/**
|
876 |
-
* @author Vova Feldman (@svovaf)
|
877 |
-
* @since 1.0.9
|
878 |
-
*/
|
879 |
-
private function _version_updates_handler() {
|
880 |
-
if ( ! isset( $this->_storage->sdk_version ) || $this->_storage->sdk_version != $this->version ) {
|
881 |
-
// Freemius version upgrade mode.
|
882 |
-
$this->_storage->sdk_last_version = $this->_storage->sdk_version;
|
883 |
-
$this->_storage->sdk_version = $this->version;
|
884 |
-
|
885 |
-
if ( empty( $this->_storage->sdk_last_version ) ||
|
886 |
-
version_compare( $this->_storage->sdk_last_version, $this->version, '<' )
|
887 |
-
) {
|
888 |
-
$this->_storage->sdk_upgrade_mode = true;
|
889 |
-
$this->_storage->sdk_downgrade_mode = false;
|
890 |
-
} else {
|
891 |
-
$this->_storage->sdk_downgrade_mode = true;
|
892 |
-
$this->_storage->sdk_upgrade_mode = false;
|
893 |
-
|
894 |
-
}
|
895 |
-
|
896 |
-
$this->do_action( 'sdk_version_update', $this->_storage->sdk_last_version, $this->version );
|
897 |
-
}
|
898 |
-
|
899 |
-
$plugin_version = $this->get_plugin_version();
|
900 |
-
if ( ! isset( $this->_storage->plugin_version ) || $this->_storage->plugin_version != $plugin_version ) {
|
901 |
-
// Plugin version upgrade mode.
|
902 |
-
$this->_storage->plugin_last_version = $this->_storage->plugin_version;
|
903 |
-
$this->_storage->plugin_version = $plugin_version;
|
904 |
-
|
905 |
-
if ( empty( $this->_storage->plugin_last_version ) ||
|
906 |
-
version_compare( $this->_storage->plugin_last_version, $plugin_version, '<' )
|
907 |
-
) {
|
908 |
-
$this->_storage->plugin_upgrade_mode = true;
|
909 |
-
$this->_storage->plugin_downgrade_mode = false;
|
910 |
-
} else {
|
911 |
-
$this->_storage->plugin_downgrade_mode = true;
|
912 |
-
$this->_storage->plugin_upgrade_mode = false;
|
913 |
-
}
|
914 |
-
|
915 |
-
if ( ! empty( $this->_storage->plugin_last_version ) ) {
|
916 |
-
// Different version of the plugin was installed before, therefore it's an update.
|
917 |
-
$this->_storage->is_plugin_new_install = false;
|
918 |
-
}
|
919 |
-
|
920 |
-
$this->do_action( 'plugin_version_update', $this->_storage->plugin_last_version, $plugin_version );
|
921 |
-
}
|
922 |
-
}
|
923 |
-
|
924 |
-
#--------------------------------------------------------------------------------
|
925 |
-
#region Data Migration on SDK Update
|
926 |
-
#--------------------------------------------------------------------------------
|
927 |
-
|
928 |
-
/**
|
929 |
-
* @author Vova Feldman (@svovaf)
|
930 |
-
* @since 1.1.5
|
931 |
-
*
|
932 |
-
* @param string $sdk_prev_version
|
933 |
-
* @param string $sdk_version
|
934 |
-
*/
|
935 |
-
function _sdk_version_update( $sdk_prev_version, $sdk_version ) {
|
936 |
-
/**
|
937 |
-
* @since 1.1.7.3 Fixed unwanted connectivity test cleanup.
|
938 |
-
*/
|
939 |
-
if ( empty( $sdk_prev_version ) ) {
|
940 |
-
return;
|
941 |
-
}
|
942 |
-
|
943 |
-
if ( version_compare( $sdk_prev_version, '2.1.0', '<' ) &&
|
944 |
-
version_compare( $sdk_version, '2.1.0', '>=' )
|
945 |
-
) {
|
946 |
-
$this->_storage->handle_gdpr_admin_notice = true;
|
947 |
-
}
|
948 |
-
|
949 |
-
if ( version_compare( $sdk_prev_version, '2.0.0', '<' ) &&
|
950 |
-
version_compare( $sdk_version, '2.0.0', '>=' )
|
951 |
-
) {
|
952 |
-
$this->migrate_to_subscriptions_collection();
|
953 |
-
|
954 |
-
$this->consolidate_licenses();
|
955 |
-
|
956 |
-
// Clear trial_plan since it's now loaded from the plans collection when needed.
|
957 |
-
$this->_storage->remove( 'trial_plan', true, false );
|
958 |
-
}
|
959 |
-
|
960 |
-
if ( version_compare( $sdk_prev_version, '1.2.3', '<' ) &&
|
961 |
-
version_compare( $sdk_version, '1.2.3', '>=' )
|
962 |
-
) {
|
963 |
-
/**
|
964 |
-
* Starting from version 1.2.3, paths are stored as relative instead of absolute and some of them can be
|
965 |
-
* invalid.
|
966 |
-
*
|
967 |
-
* @author Leo Fajardo (@leorw)
|
968 |
-
*/
|
969 |
-
$this->remove_invalid_paths();
|
970 |
-
}
|
971 |
-
|
972 |
-
if ( version_compare( $sdk_prev_version, '1.1.5', '<' ) &&
|
973 |
-
version_compare( $sdk_version, '1.1.5', '>=' )
|
974 |
-
) {
|
975 |
-
// On version 1.1.5 merged connectivity and is_on data.
|
976 |
-
if ( isset( $this->_storage->connectivity_test ) ) {
|
977 |
-
if ( ! isset( $this->_storage->is_on ) ) {
|
978 |
-
unset( $this->_storage->connectivity_test );
|
979 |
-
} else {
|
980 |
-
$connectivity_data = $this->_storage->connectivity_test;
|
981 |
-
$connectivity_data['is_active'] = $this->_storage->is_on['is_active'];
|
982 |
-
$connectivity_data['timestamp'] = $this->_storage->is_on['timestamp'];
|
983 |
-
|
984 |
-
// Override.
|
985 |
-
$this->_storage->connectivity_test = $connectivity_data;
|
986 |
-
|
987 |
-
// Remove previous structure.
|
988 |
-
unset( $this->_storage->is_on );
|
989 |
-
}
|
990 |
-
|
991 |
-
}
|
992 |
-
}
|
993 |
-
|
994 |
-
if (
|
995 |
-
version_compare( $sdk_prev_version, '2.2.1', '<' ) &&
|
996 |
-
version_compare( $sdk_version, '2.2.1', '>=' )
|
997 |
-
) {
|
998 |
-
/**
|
999 |
-
* Clear the file cache without storing the previous path since it could be a wrong path. For example,
|
1000 |
-
* in the versions of the SDK lower than 2.2.1, it's possible for the path of an add-on to be the same
|
1001 |
-
* as the parent plugin's when the add-on was auto-installed since the relevant method names were not
|
1002 |
-
* skipped in the logic that determines the right path in the `get_caller_main_file_and_type` method
|
1003 |
-
* (e.g. `try_activate_plugin`). Since it was an auto-installation, the caller was the parent plugin
|
1004 |
-
* and so its path was used. In case the stored path is wrong, clearing the cache will resolve issues
|
1005 |
-
* related to data mix-up between plugins (e.g. titles and versions of an add-on and its parent plugin).
|
1006 |
-
*
|
1007 |
-
* @author Leo Fajardo (@leorw)
|
1008 |
-
* @since 2.2.1
|
1009 |
-
*/
|
1010 |
-
$this->clear_module_main_file_cache( false );
|
1011 |
-
}
|
1012 |
-
}
|
1013 |
-
|
1014 |
-
/**
|
1015 |
-
* @author Leo Fajardo (@leorw)
|
1016 |
-
* @since 2.0.0
|
1017 |
-
*
|
1018 |
-
* @param \FS_Storage $storage
|
1019 |
-
* @param bool|int|null $blog_id
|
1020 |
-
*/
|
1021 |
-
private static function migrate_install_plan_to_plan_id( FS_Storage $storage, $blog_id = null ) {
|
1022 |
-
if ( empty( $storage->sdk_version ) ) {
|
1023 |
-
// New installation of the plugin, no need to upgrade.
|
1024 |
-
return;
|
1025 |
-
}
|
1026 |
-
|
1027 |
-
if ( ! version_compare( $storage->sdk_version, '2.0.0', '<' ) ) {
|
1028 |
-
// Previous version is >= 2.0.0, so no need to migrate.
|
1029 |
-
return;
|
1030 |
-
}
|
1031 |
-
|
1032 |
-
// Alias.
|
1033 |
-
$module_type = $storage->get_module_type();
|
1034 |
-
$module_slug = $storage->get_module_slug();
|
1035 |
-
|
1036 |
-
$installs = self::get_all_sites( $module_type, $blog_id );
|
1037 |
-
$install = isset( $installs[ $module_slug ] ) ? $installs[ $module_slug ] : null;
|
1038 |
-
|
1039 |
-
if ( ! is_object( $install ) ) {
|
1040 |
-
return;
|
1041 |
-
}
|
1042 |
-
|
1043 |
-
if ( isset( $install->plan ) && is_object( $install->plan ) ) {
|
1044 |
-
if ( isset( $install->plan->id ) && ! empty( $install->plan->id ) ) {
|
1045 |
-
$install->plan_id = self::_decrypt( $install->plan->id );
|
1046 |
-
}
|
1047 |
-
|
1048 |
-
unset( $install->plan );
|
1049 |
-
|
1050 |
-
$installs[ $module_slug ] = clone $install;
|
1051 |
-
|
1052 |
-
self::set_account_option_by_module(
|
1053 |
-
$module_type,
|
1054 |
-
'sites',
|
1055 |
-
$installs,
|
1056 |
-
true,
|
1057 |
-
$blog_id
|
1058 |
-
);
|
1059 |
-
}
|
1060 |
-
}
|
1061 |
-
|
1062 |
-
/**
|
1063 |
-
* @author Leo Fajardo (@leorw)
|
1064 |
-
* @since 2.0.0
|
1065 |
-
*/
|
1066 |
-
private function migrate_to_subscriptions_collection() {
|
1067 |
-
if ( ! is_object( $this->_site ) ) {
|
1068 |
-
return;
|
1069 |
-
}
|
1070 |
-
|
1071 |
-
if ( isset( $this->_storage->subscription ) && is_object( $this->_storage->subscription ) ) {
|
1072 |
-
$this->_storage->subscriptions = array( fs_get_entity( $this->_storage->subscription, FS_Subscription::get_class_name() ) );
|
1073 |
-
}
|
1074 |
-
}
|
1075 |
-
|
1076 |
-
/**
|
1077 |
-
* @author Leo Fajardo (@leorw)
|
1078 |
-
* @since 2.0.0
|
1079 |
-
*/
|
1080 |
-
private function consolidate_licenses() {
|
1081 |
-
$plugin_licenses = self::get_account_option( 'licenses', WP_FS__MODULE_TYPE_PLUGIN );
|
1082 |
-
if ( isset( $plugin_licenses[ $this->_slug ] ) ) {
|
1083 |
-
$plugin_licenses = $plugin_licenses[ $this->_slug ];
|
1084 |
-
} else {
|
1085 |
-
$plugin_licenses = array();
|
1086 |
-
}
|
1087 |
-
|
1088 |
-
$theme_licenses = self::get_account_option( 'licenses', WP_FS__MODULE_TYPE_THEME );
|
1089 |
-
if ( isset( $theme_licenses[ $this->_slug ] ) ) {
|
1090 |
-
$theme_licenses = $theme_licenses[ $this->_slug ];
|
1091 |
-
} else {
|
1092 |
-
$theme_licenses = array();
|
1093 |
-
}
|
1094 |
-
|
1095 |
-
if ( empty( $plugin_licenses ) && empty( $theme_licenses ) ) {
|
1096 |
-
return;
|
1097 |
-
}
|
1098 |
-
|
1099 |
-
$all_licenses = array();
|
1100 |
-
$user_id_license_ids_map = array();
|
1101 |
-
|
1102 |
-
foreach ( $plugin_licenses as $user_id => $user_licenses ) {
|
1103 |
-
if ( is_array( $user_licenses ) ) {
|
1104 |
-
if ( ! isset( $user_license_ids[ $user_id ] ) ) {
|
1105 |
-
$user_id_license_ids_map[ $user_id ] = array();
|
1106 |
-
}
|
1107 |
-
|
1108 |
-
foreach ( $user_licenses as $user_license ) {
|
1109 |
-
$all_licenses[] = $user_license;
|
1110 |
-
$user_id_license_ids_map[ $user_id ][] = $user_license->id;
|
1111 |
-
}
|
1112 |
-
}
|
1113 |
-
}
|
1114 |
-
|
1115 |
-
foreach ( $theme_licenses as $user_id => $user_licenses ) {
|
1116 |
-
if ( is_array( $user_licenses ) ) {
|
1117 |
-
if ( ! isset( $user_license_ids[ $user_id ] ) ) {
|
1118 |
-
$user_id_license_ids_map[ $user_id ] = array();
|
1119 |
-
}
|
1120 |
-
|
1121 |
-
foreach ( $user_licenses as $user_license ) {
|
1122 |
-
$all_licenses[] = $user_license;
|
1123 |
-
$user_id_license_ids_map[ $user_id ][] = $user_license->id;
|
1124 |
-
}
|
1125 |
-
}
|
1126 |
-
}
|
1127 |
-
|
1128 |
-
self::store_user_id_license_ids_map(
|
1129 |
-
$user_id_license_ids_map,
|
1130 |
-
$this->_module_id
|
1131 |
-
);
|
1132 |
-
|
1133 |
-
$this->_store_licenses( true, $this->_module_id, $all_licenses );
|
1134 |
-
}
|
1135 |
-
|
1136 |
-
/**
|
1137 |
-
* Remove invalid paths.
|
1138 |
-
*
|
1139 |
-
* @author Leo Fajardo (@leorw)
|
1140 |
-
* @since 1.2.3
|
1141 |
-
*/
|
1142 |
-
private function remove_invalid_paths() {
|
1143 |
-
// Remove invalid path that is still associated with the current slug if there's any.
|
1144 |
-
$file_slug_map = self::$_accounts->get_option( 'file_slug_map', array() );
|
1145 |
-
foreach ( $file_slug_map as $plugin_basename => $slug ) {
|
1146 |
-
if ( $slug === $this->_slug &&
|
1147 |
-
$plugin_basename !== $this->_plugin_basename &&
|
1148 |
-
! file_exists( $this->get_absolute_path( $plugin_basename ) )
|
1149 |
-
) {
|
1150 |
-
unset( $file_slug_map[ $plugin_basename ] );
|
1151 |
-
self::$_accounts->set_option( 'file_slug_map', $file_slug_map, true );
|
1152 |
-
|
1153 |
-
break;
|
1154 |
-
}
|
1155 |
-
}
|
1156 |
-
}
|
1157 |
-
|
1158 |
-
/**
|
1159 |
-
* @author Vova Feldman (@svovaf)
|
1160 |
-
* @since 1.2.2.7
|
1161 |
-
*
|
1162 |
-
* @param string $plugin_prev_version
|
1163 |
-
* @param string $plugin_version
|
1164 |
-
*/
|
1165 |
-
function _after_version_update( $plugin_prev_version, $plugin_version ) {
|
1166 |
-
if ( $this->is_theme() ) {
|
1167 |
-
// Expire the cache of the previous tabs since the theme may
|
1168 |
-
// have setting updates.
|
1169 |
-
$this->_cache->expire( 'tabs' );
|
1170 |
-
$this->_cache->expire( 'tabs_stylesheets' );
|
1171 |
-
}
|
1172 |
-
}
|
1173 |
-
|
1174 |
-
/**
|
1175 |
-
* A special migration logic for the $_accounts, executed for all the plugins in the system:
|
1176 |
-
* - Moves some data to the network level storage.
|
1177 |
-
* - If the plugin's connection was skipped for all sites, set the plugin as if it was network skipped.
|
1178 |
-
* - If the plugin's connection was ignored for all sites, don't do anything in terms of the network connection.
|
1179 |
-
* - If the plugin was connected to all sites by the same super-admin, set the plugin as if was network opted-in for all sites.
|
1180 |
-
* - If there's at least one site that was connected by a super-admin, find the "main super-admin" (the one that installed the majority of the plugin installs) and set the plugin as if was network activated with the main super-admin, set all the sites that were skipped or opted-in with a different user to delegated mode. Then, prompt the currently logged super-admin to choose what to do with the ignored sites.
|
1181 |
-
* - If there are any sites in the network which the connection decision was not yet taken for, set this plugin into network activation mode so a super-admin can choose what to do with the rest of the sites.
|
1182 |
-
*
|
1183 |
-
* @author Vova Feldman (@svovaf)
|
1184 |
-
* @since 2.0.0
|
1185 |
-
*/
|
1186 |
-
private static function migrate_accounts_to_network() {
|
1187 |
-
$sites = self::get_sites();
|
1188 |
-
$sites_count = count( $sites );
|
1189 |
-
$connection_status = array();
|
1190 |
-
$plugin_slugs = array();
|
1191 |
-
foreach ( $sites as $site ) {
|
1192 |
-
$blog_id = self::get_site_blog_id( $site );
|
1193 |
-
|
1194 |
-
self::$_accounts->migrate_to_network( $blog_id );
|
1195 |
-
|
1196 |
-
/**
|
1197 |
-
* Build a list of all Freemius powered plugins slugs.
|
1198 |
-
*/
|
1199 |
-
$id_slug_type_path_map = self::$_accounts->get_option( 'id_slug_type_path_map', array(), $blog_id );
|
1200 |
-
foreach ( $id_slug_type_path_map as $module_id => $data ) {
|
1201 |
-
if ( WP_FS__MODULE_TYPE_PLUGIN === $data['type'] ) {
|
1202 |
-
$plugin_slugs[ $data['slug'] ] = true;
|
1203 |
-
}
|
1204 |
-
}
|
1205 |
-
|
1206 |
-
$installs = self::get_account_option( 'sites', WP_FS__MODULE_TYPE_PLUGIN, $blog_id );
|
1207 |
-
|
1208 |
-
if ( is_array( $installs ) ) {
|
1209 |
-
foreach ( $installs as $slug => $install ) {
|
1210 |
-
if ( ! isset( $connection_status[ $slug ] ) ) {
|
1211 |
-
$connection_status[ $slug ] = array();
|
1212 |
-
}
|
1213 |
-
|
1214 |
-
if ( is_object( $install ) &&
|
1215 |
-
FS_Site::is_valid_id( $install->id ) &&
|
1216 |
-
FS_User::is_valid_id( $install->user_id )
|
1217 |
-
) {
|
1218 |
-
$connection_status[ $slug ][ $blog_id ] = $install->user_id;
|
1219 |
-
}
|
1220 |
-
}
|
1221 |
-
}
|
1222 |
-
}
|
1223 |
-
|
1224 |
-
foreach ( $plugin_slugs as $slug => $true ) {
|
1225 |
-
if ( ! isset( $connection_status[ $slug ] ) ) {
|
1226 |
-
$connection_status[ $slug ] = array();
|
1227 |
-
}
|
1228 |
-
|
1229 |
-
foreach ( $sites as $site ) {
|
1230 |
-
$blog_id = self::get_site_blog_id( $site );
|
1231 |
-
|
1232 |
-
if ( isset( $connection_status[ $slug ][ $blog_id ] ) ) {
|
1233 |
-
continue;
|
1234 |
-
}
|
1235 |
-
|
1236 |
-
$storage = FS_Storage::instance( WP_FS__MODULE_TYPE_PLUGIN, $slug );
|
1237 |
-
|
1238 |
-
$is_anonymous = $storage->get( 'is_anonymous', null, $blog_id );
|
1239 |
-
|
1240 |
-
if ( ! is_null( $is_anonymous ) ) {
|
1241 |
-
// Since 1.1.3 is_anonymous is an array.
|
1242 |
-
if ( is_array( $is_anonymous ) && isset( $is_anonymous['is'] ) ) {
|
1243 |
-
$is_anonymous = $is_anonymous['is'];
|
1244 |
-
}
|
1245 |
-
|
1246 |
-
if ( is_bool( $is_anonymous ) && true === $is_anonymous ) {
|
1247 |
-
$connection_status[ $slug ][ $blog_id ] = 'skipped';
|
1248 |
-
}
|
1249 |
-
}
|
1250 |
-
|
1251 |
-
if ( ! isset( $connection_status[ $slug ][ $blog_id ] ) ) {
|
1252 |
-
$connection_status[ $slug ][ $blog_id ] = 'ignored';
|
1253 |
-
}
|
1254 |
-
}
|
1255 |
-
}
|
1256 |
-
|
1257 |
-
$super_admins = array();
|
1258 |
-
|
1259 |
-
foreach ( $connection_status as $slug => $blogs_status ) {
|
1260 |
-
$skips = 0;
|
1261 |
-
$ignores = 0;
|
1262 |
-
$connections = 0;
|
1263 |
-
$opted_in_users = array();
|
1264 |
-
$opted_in_super_admins = array();
|
1265 |
-
|
1266 |
-
$storage = FS_Storage::instance( WP_FS__MODULE_TYPE_PLUGIN, $slug );
|
1267 |
-
|
1268 |
-
foreach ( $blogs_status as $blog_id => $status_or_user_id ) {
|
1269 |
-
if ( 'skipped' === $status_or_user_id ) {
|
1270 |
-
$skips ++;
|
1271 |
-
} else if ( 'ignored' === $status_or_user_id ) {
|
1272 |
-
$ignores ++;
|
1273 |
-
} else if ( FS_User::is_valid_id( $status_or_user_id ) ) {
|
1274 |
-
$connections ++;
|
1275 |
-
|
1276 |
-
if ( ! isset( $opted_in_users[ $status_or_user_id ] ) ) {
|
1277 |
-
$opted_in_users[ $status_or_user_id ] = array();
|
1278 |
-
}
|
1279 |
-
|
1280 |
-
$opted_in_users[ $status_or_user_id ][] = $blog_id;
|
1281 |
-
|
1282 |
-
if ( isset( $super_admins[ $status_or_user_id ] ) ||
|
1283 |
-
self::is_super_admin( $status_or_user_id )
|
1284 |
-
) {
|
1285 |
-
// Cache super-admin data.
|
1286 |
-
$super_admins[ $status_or_user_id ] = true;
|
1287 |
-
|
1288 |
-
// Remember opted-in super-admins for the plugin.
|
1289 |
-
$opted_in_super_admins[ $status_or_user_id ] = true;
|
1290 |
-
}
|
1291 |
-
}
|
1292 |
-
}
|
1293 |
-
|
1294 |
-
$main_super_admin_user_id = null;
|
1295 |
-
$all_migrated = false;
|
1296 |
-
if ( $sites_count == $skips ) {
|
1297 |
-
// All sites were skipped -> network skip by copying the anonymous mode from any of the sites.
|
1298 |
-
$storage->is_anonymous_ms = $storage->is_anonymous;
|
1299 |
-
|
1300 |
-
$all_migrated = true;
|
1301 |
-
} else if ( $sites_count == $ignores ) {
|
1302 |
-
// Don't do anything, still in activation mode.
|
1303 |
-
|
1304 |
-
$all_migrated = true;
|
1305 |
-
} else if ( 0 < count( $opted_in_super_admins ) ) {
|
1306 |
-
// Find the super-admin with the majority of installs.
|
1307 |
-
$max_installs_by_super_admin = 0;
|
1308 |
-
foreach ( $opted_in_super_admins as $user_id => $true ) {
|
1309 |
-
$installs_count = count( $opted_in_users[ $user_id ] );
|
1310 |
-
|
1311 |
-
if ( $installs_count > $max_installs_by_super_admin ) {
|
1312 |
-
$max_installs_by_super_admin = $installs_count;
|
1313 |
-
$main_super_admin_user_id = $user_id;
|
1314 |
-
}
|
1315 |
-
}
|
1316 |
-
|
1317 |
-
if ( $sites_count == $connections && 1 == count( $opted_in_super_admins ) ) {
|
1318 |
-
// Super-admin opted-in for all sites in the network.
|
1319 |
-
$storage->is_network_connected = true;
|
1320 |
-
|
1321 |
-
$all_migrated = true;
|
1322 |
-
}
|
1323 |
-
|
1324 |
-
// Store network user.
|
1325 |
-
$storage->network_user_id = $main_super_admin_user_id;
|
1326 |
-
|
1327 |
-
$storage->network_install_blog_id = ( $sites_count == $connections ) ?
|
1328 |
-
// Since all sites are opted-in, associating with the main site.
|
1329 |
-
get_current_blog_id() :
|
1330 |
-
// Associating with the 1st found opted-in site.
|
1331 |
-
$opted_in_users[ $main_super_admin_user_id ][0];
|
1332 |
-
|
1333 |
-
/**
|
1334 |
-
* Make sure we migrate the plan ID of the network install, otherwise, if after the migration
|
1335 |
-
* the 1st page that will be loaded is the network level WP Admin and $storage->network_install_blog_id
|
1336 |
-
* is different than the main site of the network, the $this->_site will not be set since the plan_id
|
1337 |
-
* will be empty.
|
1338 |
-
*/
|
1339 |
-
$storage->migrate_to_network();
|
1340 |
-
self::migrate_install_plan_to_plan_id( $storage, $storage->network_install_blog_id );
|
1341 |
-
} else {
|
1342 |
-
// At least one opt-in. All the opt-in were created by a non-super-admin.
|
1343 |
-
if ( 0 == $ignores ) {
|
1344 |
-
// All sites were opted-in or skipped, all by non-super-admin. So delegate all.
|
1345 |
-
$storage->store( 'is_delegated_connection', true, true );
|
1346 |
-
|
1347 |
-
$all_migrated = true;
|
1348 |
-
}
|
1349 |
-
}
|
1350 |
-
|
1351 |
-
if ( ! $all_migrated ) {
|
1352 |
-
/**
|
1353 |
-
* Delegate all sites that were:
|
1354 |
-
* 1) Opted-in by a user that is NOT the main-super-admin.
|
1355 |
-
* 2) Skipped and non of the sites was opted-in by a super-admin. If any site was opted-in by a super-admin, there will be a main-super-admin, and we consider the skip as if it was done by that user.
|
1356 |
-
*/
|
1357 |
-
foreach ( $blogs_status as $blog_id => $status_or_user_id ) {
|
1358 |
-
if ( $status_or_user_id == $main_super_admin_user_id ) {
|
1359 |
-
continue;
|
1360 |
-
}
|
1361 |
-
|
1362 |
-
if ( FS_User::is_valid_id( $status_or_user_id ) ||
|
1363 |
-
( 'skipped' === $status_or_user_id && is_null( $main_super_admin_user_id ) )
|
1364 |
-
) {
|
1365 |
-
$storage->store( 'is_delegated_connection', true, $blog_id );
|
1366 |
-
}
|
1367 |
-
}
|
1368 |
-
}
|
1369 |
-
|
1370 |
-
|
1371 |
-
if ( ( $connections + $skips > 0 ) ) {
|
1372 |
-
if ( $ignores > 0 ) {
|
1373 |
-
/**
|
1374 |
-
* If admin already opted-in or skipped in any of the network sites, and also
|
1375 |
-
* have sites which the connection decision was not yet taken, set this plugin
|
1376 |
-
* into network activation mode so the super-admin can choose what to do with
|
1377 |
-
* the rest of the sites.
|
1378 |
-
*/
|
1379 |
-
self::set_network_upgrade_mode( $storage );
|
1380 |
-
}
|
1381 |
-
}
|
1382 |
-
}
|
1383 |
-
}
|
1384 |
-
|
1385 |
-
/**
|
1386 |
-
* Set a module into network upgrade mode.
|
1387 |
-
*
|
1388 |
-
* @author Vova Feldman (@svovaf)
|
1389 |
-
* @since 2.0.0
|
1390 |
-
*
|
1391 |
-
* @param \FS_Storage $storage
|
1392 |
-
*
|
1393 |
-
* @return bool
|
1394 |
-
*/
|
1395 |
-
private static function set_network_upgrade_mode( FS_Storage $storage ) {
|
1396 |
-
return $storage->is_network_activation = true;
|
1397 |
-
}
|
1398 |
-
|
1399 |
-
/**
|
1400 |
-
* Will return true after upgrading to the SDK with the network level integration,
|
1401 |
-
* when the super-admin involvement is required regarding the rest of the sites.
|
1402 |
-
*
|
1403 |
-
* @author Vova Feldman (@svovaf)
|
1404 |
-
* @since 2.0.0
|
1405 |
-
*
|
1406 |
-
* @return bool
|
1407 |
-
*/
|
1408 |
-
function is_network_upgrade_mode() {
|
1409 |
-
return $this->_storage->get( 'is_network_activation' );
|
1410 |
-
}
|
1411 |
-
|
1412 |
-
/**
|
1413 |
-
* Clear flag after the upgrade mode completion.
|
1414 |
-
*
|
1415 |
-
* @author Vova Feldman (@svovaf)
|
1416 |
-
* @since 2.0.0
|
1417 |
-
*
|
1418 |
-
* @return bool True if network activation was on and now completed.
|
1419 |
-
*/
|
1420 |
-
private function network_upgrade_mode_completed() {
|
1421 |
-
if ( fs_is_network_admin() && $this->is_network_upgrade_mode() ) {
|
1422 |
-
$this->_storage->remove( 'is_network_activation' );
|
1423 |
-
|
1424 |
-
return true;
|
1425 |
-
}
|
1426 |
-
|
1427 |
-
return false;
|
1428 |
-
}
|
1429 |
-
|
1430 |
-
#endregion
|
1431 |
-
|
1432 |
-
/**
|
1433 |
-
* This action is connected to the 'plugins_loaded' hook and helps to determine
|
1434 |
-
* if this is a new plugin installation or a plugin update.
|
1435 |
-
*
|
1436 |
-
* There are 3 different use-cases:
|
1437 |
-
* 1) New plugin installation right with Freemius:
|
1438 |
-
* 1.1 _activate_plugin_event_hook() will be executed first
|
1439 |
-
* 1.2 Since $this->_storage->is_plugin_new_install is not set,
|
1440 |
-
* and $this->_storage->plugin_last_version is not set,
|
1441 |
-
* $this->_storage->is_plugin_new_install will be set to TRUE.
|
1442 |
-
* 1.3 When _plugins_loaded() will be executed, $this->_storage->is_plugin_new_install will
|
1443 |
-
* be already set to TRUE.
|
1444 |
-
*
|
1445 |
-
* 2) Plugin update, didn't have Freemius before, and now have the SDK:
|
1446 |
-
* 2.1 _activate_plugin_event_hook() will not be executed, because
|
1447 |
-
* the activation hook do NOT fires on updates since WP 3.1.
|
1448 |
-
* 2.2 When _plugins_loaded() will be executed, $this->_storage->is_plugin_new_install will
|
1449 |
-
* be empty, therefore, it will be set to FALSE.
|
1450 |
-
*
|
1451 |
-
* 3) Plugin update, had Freemius in prev version as well:
|
1452 |
-
* 3.1 _version_updates_handler() will be executed 1st, since FS was installed
|
1453 |
-
* before, $this->_storage->plugin_last_version will NOT be empty,
|
1454 |
-
* therefore, $this->_storage->is_plugin_new_install will be set to FALSE.
|
1455 |
-
* 3.2 When _plugins_loaded() will be executed, $this->_storage->is_plugin_new_install is
|
1456 |
-
* already set, therefore, it will not be modified.
|
1457 |
-
*
|
1458 |
-
* Use-case #3 is backward compatible, #3.1 will be executed since 1.0.9.
|
1459 |
-
*
|
1460 |
-
* NOTE:
|
1461 |
-
* The only fallback of this mechanism is if an admin updates a plugin based on use-case #2,
|
1462 |
-
* and then, the next immediate PageView is the plugin's main settings page, it will not
|
1463 |
-
* show the opt-in right away. The reason it will happen is because Freemius execution
|
1464 |
-
* will be turned off till the plugin is fully loaded at least once
|
1465 |
-
* (till $this->_storage->was_plugin_loaded is TRUE).
|
1466 |
-
*
|
1467 |
-
* @author Vova Feldman (@svovaf)
|
1468 |
-
* @since 1.1.9
|
1469 |
-
*
|
1470 |
-
*/
|
1471 |
-
function _plugins_loaded() {
|
1472 |
-
// Update flag that plugin was loaded with Freemius at least once.
|
1473 |
-
$this->_storage->was_plugin_loaded = true;
|
1474 |
-
|
1475 |
-
/**
|
1476 |
-
* Bug fix - only set to false when it's a plugin, due to the
|
1477 |
-
* execution sequence of the theme hooks and our methods, if
|
1478 |
-
* this will be set for themes, Freemius will always assume
|
1479 |
-
* it's a theme update.
|
1480 |
-
*
|
1481 |
-
* @author Vova Feldman (@svovaf)
|
1482 |
-
* @since 1.2.2.2
|
1483 |
-
*/
|
1484 |
-
if ( $this->is_plugin() &&
|
1485 |
-
! isset( $this->_storage->is_plugin_new_install )
|
1486 |
-
) {
|
1487 |
-
$this->_storage->is_plugin_new_install = (
|
1488 |
-
! is_plugin_active( $this->_plugin_basename ) &&
|
1489 |
-
empty( $this->_storage->plugin_last_version )
|
1490 |
-
);
|
1491 |
-
}
|
1492 |
-
}
|
1493 |
-
|
1494 |
-
/**
|
1495 |
-
* Add special parameter to WP admin AJAX calls so when we
|
1496 |
-
* process AJAX calls we can identify its source properly.
|
1497 |
-
*
|
1498 |
-
* @author Leo Fajardo (@leorw)
|
1499 |
-
* @since 2.0.0
|
1500 |
-
*/
|
1501 |
-
static function _enrich_ajax_url() {
|
1502 |
-
$admin_param = is_network_admin() ?
|
1503 |
-
'_fs_network_admin' :
|
1504 |
-
'_fs_blog_admin';
|
1505 |
-
?>
|
1506 |
-
<script type="text/javascript">
|
1507 |
-
(function ($) {
|
1508 |
-
$(document).ajaxSend(function (event, jqxhr, settings) {
|
1509 |
-
if (settings.url &&
|
1510 |
-
-1 < settings.url.indexOf('admin-ajax.php') &&
|
1511 |
-
! ( settings.url.indexOf( '<?php echo $admin_param ?>' ) > 0 )
|
1512 |
-
) {
|
1513 |
-
if (
|
1514 |
-
'string' === typeof settings.data &&
|
1515 |
-
settings.data.indexOf( 'action=heartbeat' ) > 0
|
1516 |
-
) {
|
1517 |
-
return;
|
1518 |
-
}
|
1519 |
-
|
1520 |
-
if (settings.url.indexOf('?') > 0) {
|
1521 |
-
settings.url += '&';
|
1522 |
-
} else {
|
1523 |
-
settings.url += '?';
|
1524 |
-
}
|
1525 |
-
|
1526 |
-
settings.url += '<?php echo $admin_param ?>=true';
|
1527 |
-
}
|
1528 |
-
});
|
1529 |
-
})(jQuery);
|
1530 |
-
</script>
|
1531 |
-
<?php
|
1532 |
-
}
|
1533 |
-
|
1534 |
-
/**
|
1535 |
-
* Opens the support forum subemenu item in a new browser page.
|
1536 |
-
*
|
1537 |
-
* @author Vova Feldman (@svovaf)
|
1538 |
-
* @since 2.1.4
|
1539 |
-
*/
|
1540 |
-
static function _open_support_forum_in_new_page() {
|
1541 |
-
?>
|
1542 |
-
<script type="text/javascript">
|
1543 |
-
(function ($) {
|
1544 |
-
$('.fs-submenu-item.wp-support-forum').parent().attr( { target: '_blank', rel: 'noopener noreferrer' } );
|
1545 |
-
})(jQuery);
|
1546 |
-
</script>
|
1547 |
-
<?php
|
1548 |
-
}
|
1549 |
-
|
1550 |
-
/**
|
1551 |
-
* @author Vova Feldman (@svovaf)
|
1552 |
-
* @since 1.0.9
|
1553 |
-
*/
|
1554 |
-
private function register_constructor_hooks() {
|
1555 |
-
$this->_logger->entrance();
|
1556 |
-
|
1557 |
-
if ( is_admin() ) {
|
1558 |
-
add_action( 'admin_init', array( &$this, '_hook_action_links_and_register_account_hooks' ) );
|
1559 |
-
|
1560 |
-
if ( $this->is_plugin() ) {
|
1561 |
-
if ( self::is_plugin_install_page() && true !== fs_request_get_bool( 'fs_allow_updater_and_dialog' ) ) {
|
1562 |
-
/**
|
1563 |
-
* Unless the `fs_allow_updater_and_dialog` URL param exists and its value is `true`, make
|
1564 |
-
* Freemius-related updates unavailable on the "Add Plugins" admin page (/plugin-install.php)
|
1565 |
-
* so that they won't interfere with the .org plugins' functionalities on that page (e.g.
|
1566 |
-
* updating of a .org plugin).
|
1567 |
-
*/
|
1568 |
-
add_filter( 'site_transient_update_plugins', array( 'Freemius', '_remove_fs_updates_from_plugin_install_page' ), 10, 2 );
|
1569 |
-
} else if ( self::is_plugins_page() || self::is_updates_page() ) {
|
1570 |
-
/**
|
1571 |
-
* On the "Plugins" and "Updates" admin pages, if there are premium or non–org-compliant plugins, modify their details dialog URLs (add a Freemius-specific param) so that the SDK can determine if the plugin information dialog should show information from Freemius.
|
1572 |
-
*
|
1573 |
-
* @author Leo Fajardo (@leorw)
|
1574 |
-
* @since 2.2.3
|
1575 |
-
*/
|
1576 |
-
add_action( 'admin_footer', array( 'Freemius', '_prepend_fs_allow_updater_and_dialog_flag_url_param' ) );
|
1577 |
-
}
|
1578 |
-
|
1579 |
-
$plugin_dir = dirname( $this->_plugin_dir_path ) . '/';
|
1580 |
-
|
1581 |
-
/**
|
1582 |
-
* @since 1.2.2
|
1583 |
-
*
|
1584 |
-
* Hook to both free and premium version activations to support
|
1585 |
-
* auto deactivation on the other version activation.
|
1586 |
-
*/
|
1587 |
-
register_activation_hook(
|
1588 |
-
$plugin_dir . $this->_free_plugin_basename,
|
1589 |
-
array( &$this, '_activate_plugin_event_hook' )
|
1590 |
-
);
|
1591 |
-
|
1592 |
-
register_activation_hook(
|
1593 |
-
$plugin_dir . $this->premium_plugin_basename(),
|
1594 |
-
array( &$this, '_activate_plugin_event_hook' )
|
1595 |
-
);
|
1596 |
-
} else {
|
1597 |
-
add_action( 'after_switch_theme', array( &$this, '_activate_theme_event_hook' ), 10, 2 );
|
1598 |
-
|
1599 |
-
add_action( 'admin_footer', array( &$this, '_style_premium_theme' ) );
|
1600 |
-
}
|
1601 |
-
|
1602 |
-
/**
|
1603 |
-
* Part of the mechanism to identify new plugin install vs. plugin update.
|
1604 |
-
*
|
1605 |
-
* @author Vova Feldman (@svovaf)
|
1606 |
-
* @since 1.1.9
|
1607 |
-
*/
|
1608 |
-
if ( empty( $this->_storage->was_plugin_loaded ) ) {
|
1609 |
-
/**
|
1610 |
-
* During the plugin activation (not theme), 'plugins_loaded' will be already executed
|
1611 |
-
* when the logic gets here since the activation logic first add the activate plugins,
|
1612 |
-
* then triggers 'plugins_loaded', and only then include the code of the plugin that
|
1613 |
-
* is activated. Which means that _plugins_loaded() will NOT be executed during the
|
1614 |
-
* plugin activation, and that IS intentional.
|
1615 |
-
*
|
1616 |
-
* @author Vova Feldman (@svovaf)
|
1617 |
-
*/
|
1618 |
-
if ( $this->is_plugin() &&
|
1619 |
-
$this->is_activation_mode( false ) &&
|
1620 |
-
0 == did_action( 'plugins_loaded' )
|
1621 |
-
) {
|
1622 |
-
add_action( 'plugins_loaded', array( &$this, '_plugins_loaded' ) );
|
1623 |
-
} else {
|
1624 |
-
// If was activated before, then it was already loaded before.
|
1625 |
-
$this->_plugins_loaded();
|
1626 |
-
}
|
1627 |
-
}
|
1628 |
-
|
1629 |
-
if ( ! self::is_ajax() ) {
|
1630 |
-
if ( ! $this->is_addon() ) {
|
1631 |
-
add_action( 'init', array( &$this, '_add_default_submenu_items' ), WP_FS__LOWEST_PRIORITY );
|
1632 |
-
}
|
1633 |
-
}
|
1634 |
-
|
1635 |
-
if ( $this->_storage->handle_gdpr_admin_notice ) {
|
1636 |
-
add_action( 'init', array( &$this, '_maybe_show_gdpr_admin_notice' ) );
|
1637 |
-
}
|
1638 |
-
|
1639 |
-
add_action( 'init', array( &$this, '_maybe_add_gdpr_optin_ajax_handler') );
|
1640 |
-
add_action( 'init', array( &$this, '_maybe_add_pricing_ajax_handler' ) );
|
1641 |
-
}
|
1642 |
-
|
1643 |
-
if ( $this->is_plugin() ) {
|
1644 |
-
if ( $this->_is_network_active ) {
|
1645 |
-
add_action( 'wpmu_new_blog', array( $this, '_after_new_blog_callback' ), 10, 6 );
|
1646 |
-
}
|
1647 |
-
|
1648 |
-
register_deactivation_hook( $this->_plugin_main_file_path, array( &$this, '_deactivate_plugin_hook' ) );
|
1649 |
-
}
|
1650 |
-
|
1651 |
-
if ( is_multisite() ) {
|
1652 |
-
add_action( 'deactivate_blog', array( &$this, '_after_site_deactivated_callback' ) );
|
1653 |
-
add_action( 'archive_blog', array( &$this, '_after_site_deactivated_callback' ) );
|
1654 |
-
add_action( 'make_spam_blog', array( &$this, '_after_site_deactivated_callback' ) );
|
1655 |
-
add_action( 'deleted_blog', array( &$this, '_after_site_deleted_callback' ), 10, 2 );
|
1656 |
-
|
1657 |
-
add_action( 'activate_blog', array( &$this, '_after_site_reactivated_callback' ) );
|
1658 |
-
add_action( 'unarchive_blog', array( &$this, '_after_site_reactivated_callback' ) );
|
1659 |
-
add_action( 'make_ham_blog', array( &$this, '_after_site_reactivated_callback' ) );
|
1660 |
-
}
|
1661 |
-
|
1662 |
-
if ( $this->is_theme() &&
|
1663 |
-
self::is_customizer() &&
|
1664 |
-
$this->apply_filters( 'show_customizer_upsell', true )
|
1665 |
-
) {
|
1666 |
-
// Register customizer upsell.
|
1667 |
-
add_action( 'customize_register', array( &$this, '_customizer_register' ) );
|
1668 |
-
}
|
1669 |
-
|
1670 |
-
add_action( 'admin_init', array( &$this, '_redirect_on_clicked_menu_link' ), WP_FS__LOWEST_PRIORITY );
|
1671 |
-
|
1672 |
-
if ( $this->is_theme() && ! $this->is_migration() ) {
|
1673 |
-
add_action( 'admin_init', array( &$this, '_add_tracking_links' ) );
|
1674 |
-
}
|
1675 |
-
|
1676 |
-
add_action( 'admin_init', array( &$this, '_add_license_activation' ) );
|
1677 |
-
add_action( 'admin_init', array( &$this, '_add_premium_version_upgrade_selection' ) );
|
1678 |
-
add_action( 'admin_init', array( &$this, '_add_beta_mode_update_handler' ) );
|
1679 |
-
add_action( 'admin_init', array( &$this, '_add_user_change_option' ) );
|
1680 |
-
|
1681 |
-
$this->add_ajax_action( 'update_billing', array( &$this, '_update_billing_ajax_action' ) );
|
1682 |
-
$this->add_ajax_action( 'start_trial', array( &$this, '_start_trial_ajax_action' ) );
|
1683 |
-
$this->add_ajax_action( 'set_data_debug_mode', array( &$this, '_set_data_debug_mode' ) );
|
1684 |
-
$this->add_ajax_action( 'toggle_whitelabel_mode', array( &$this, '_toggle_whitelabel_mode_ajax_handler' ) );
|
1685 |
-
|
1686 |
-
if ( $this->_is_network_active && fs_is_network_admin() ) {
|
1687 |
-
$this->add_ajax_action( 'network_activate', array( &$this, '_network_activate_ajax_action' ) );
|
1688 |
-
}
|
1689 |
-
|
1690 |
-
$this->add_ajax_action( 'install_premium_version', array(
|
1691 |
-
&$this,
|
1692 |
-
'_install_premium_version_ajax_action'
|
1693 |
-
) );
|
1694 |
-
|
1695 |
-
$this->add_ajax_action( 'submit_affiliate_application', array( &$this, '_submit_affiliate_application' ) );
|
1696 |
-
|
1697 |
-
$this->add_action( 'after_plans_sync', array( &$this, '_check_for_trial_plans' ) );
|
1698 |
-
|
1699 |
-
$this->add_action( 'sdk_version_update', array( &$this, '_sdk_version_update' ), WP_FS__DEFAULT_PRIORITY, 2 );
|
1700 |
-
|
1701 |
-
$this->add_action(
|
1702 |
-
'plugin_version_update',
|
1703 |
-
array( &$this, '_after_version_update' ),
|
1704 |
-
WP_FS__DEFAULT_PRIORITY,
|
1705 |
-
2
|
1706 |
-
);
|
1707 |
-
$this->add_filter( 'after_code_type_change', array( &$this, '_after_code_type_change' ) );
|
1708 |
-
|
1709 |
-
add_action( 'admin_init', array( &$this, '_add_trial_notice' ) );
|
1710 |
-
add_action( 'admin_init', array( &$this, '_add_affiliate_program_notice' ) );
|
1711 |
-
add_action( 'admin_enqueue_scripts', array( &$this, '_enqueue_common_css' ) );
|
1712 |
-
|
1713 |
-
/**
|
1714 |
-
* Handle request to reset anonymous mode for `get_reconnect_url()`.
|
1715 |
-
*
|
1716 |
-
* @author Vova Feldman (@svovaf)
|
1717 |
-
* @since 1.2.1.5
|
1718 |
-
*/
|
1719 |
-
if ( fs_request_is_action( 'reset_anonymous_mode' ) &&
|
1720 |
-
$this->get_unique_affix() === fs_request_get( 'fs_unique_affix' )
|
1721 |
-
) {
|
1722 |
-
add_action( 'admin_init', array( &$this, 'connect_again' ) );
|
1723 |
-
}
|
1724 |
-
}
|
1725 |
-
|
1726 |
-
/**
|
1727 |
-
* Register the required hooks right after the settings parse is completed.
|
1728 |
-
*
|
1729 |
-
* @author Vova Feldman (@svovaf)
|
1730 |
-
* @since 2.3.1
|
1731 |
-
*/
|
1732 |
-
private function register_after_settings_parse_hooks() {
|
1733 |
-
if ( is_admin() &&
|
1734 |
-
$this->is_theme() &&
|
1735 |
-
$this->is_premium() &&
|
1736 |
-
! $this->has_active_valid_license()
|
1737 |
-
) {
|
1738 |
-
$this->add_ajax_action(
|
1739 |
-
'delete_theme_update_data',
|
1740 |
-
array( &$this, '_delete_theme_update_data_action' )
|
1741 |
-
);
|
1742 |
-
}
|
1743 |
-
|
1744 |
-
if ( $this->show_settings_with_tabs() ) {
|
1745 |
-
/**
|
1746 |
-
* Include the required hooks to capture the theme settings' page tabs
|
1747 |
-
* and cache them.
|
1748 |
-
*
|
1749 |
-
* @author Vova Feldman (@svovaf)
|
1750 |
-
* @since 1.2.2.7
|
1751 |
-
*/
|
1752 |
-
if ( ! $this->_cache->has_valid( 'tabs' ) ) {
|
1753 |
-
add_action( 'admin_footer', array( &$this, '_tabs_capture' ) );
|
1754 |
-
// Add license activation AJAX callback.
|
1755 |
-
$this->add_ajax_action( 'store_tabs', array( &$this, '_store_tabs_ajax_action' ) );
|
1756 |
-
|
1757 |
-
add_action( 'admin_enqueue_scripts', array( &$this, '_store_tabs_styles' ), 9999999 );
|
1758 |
-
}
|
1759 |
-
|
1760 |
-
add_action(
|
1761 |
-
'admin_footer',
|
1762 |
-
array( &$this, '_add_freemius_tabs' ),
|
1763 |
-
/**
|
1764 |
-
* The tabs JS code must be executed after the tabs capture logic (_tabs_capture()).
|
1765 |
-
* That's why the priority is 11 while the tabs capture logic is added
|
1766 |
-
* with priority 10.
|
1767 |
-
*
|
1768 |
-
* @author Vova Feldman (@svovaf)
|
1769 |
-
*/
|
1770 |
-
11
|
1771 |
-
);
|
1772 |
-
}
|
1773 |
-
|
1774 |
-
if ( ! self::is_ajax() ) {
|
1775 |
-
if ( ! $this->is_addon() || $this->is_only_premium() ) {
|
1776 |
-
add_action(
|
1777 |
-
( $this->_is_network_active && fs_is_network_admin() ? 'network_' : '' ) . 'admin_menu',
|
1778 |
-
array( &$this, '_prepare_admin_menu' ),
|
1779 |
-
WP_FS__LOWEST_PRIORITY
|
1780 |
-
);
|
1781 |
-
}
|
1782 |
-
}
|
1783 |
-
}
|
1784 |
-
|
1785 |
-
/**
|
1786 |
-
* Makes Freemius-related updates unavailable on the "Add Plugins" admin page (/plugin-install.php) so that
|
1787 |
-
* they won't interfere with the .org plugins' functionalities on that page (e.g. updating of a .org plugin).
|
1788 |
-
*
|
1789 |
-
* @author Leo Fajardo (@leorw)
|
1790 |
-
* @since 2.2.3
|
1791 |
-
*
|
1792 |
-
* @param object $updates
|
1793 |
-
* @param string|null $transient
|
1794 |
-
*
|
1795 |
-
* @return object
|
1796 |
-
*/
|
1797 |
-
static function _remove_fs_updates_from_plugin_install_page( $updates, $transient = null ) {
|
1798 |
-
if ( is_object( $updates ) && isset( $updates->response ) ) {
|
1799 |
-
foreach ( $updates->response as $file => $plugin ) {
|
1800 |
-
if ( isset( $plugin->package ) && false !== strpos( $plugin->package, 'api.freemius' ) ) {
|
1801 |
-
unset( $updates->response[ $file ] );
|
1802 |
-
}
|
1803 |
-
}
|
1804 |
-
}
|
1805 |
-
|
1806 |
-
return $updates;
|
1807 |
-
}
|
1808 |
-
|
1809 |
-
/**
|
1810 |
-
* Prepends the `fs_allow_updater_and_dialog` param to the plugin information URLs to tell the SDK to handle
|
1811 |
-
* the information that is shown on the plugin details dialog that is shown when the relevant link is clicked.
|
1812 |
-
*
|
1813 |
-
* @author Leo Fajardo (@leorw)
|
1814 |
-
* @since 2.2.3
|
1815 |
-
*
|
1816 |
-
* @return string
|
1817 |
-
*/
|
1818 |
-
static function _prepend_fs_allow_updater_and_dialog_flag_url_param() {
|
1819 |
-
$slug_basename_map = array();
|
1820 |
-
foreach ( self::$_instances as $instance ) {
|
1821 |
-
if ( ! $instance->is_plugin() ) {
|
1822 |
-
continue;
|
1823 |
-
}
|
1824 |
-
|
1825 |
-
$slug_basename_map[ $instance->get_slug() ] = $instance->premium_plugin_basename();
|
1826 |
-
}
|
1827 |
-
?>
|
1828 |
-
<script type="text/javascript">
|
1829 |
-
(function( $ ) {
|
1830 |
-
var slugBasenameMap = <?php echo json_encode( $slug_basename_map ) ?>;
|
1831 |
-
for ( var slug in slugBasenameMap ) {
|
1832 |
-
var basename = slugBasenameMap[ slug ];
|
1833 |
-
|
1834 |
-
// Try to get the plugin rows if on the "Plugins" page.
|
1835 |
-
var $pluginRows = $( '.wp-list-table.plugins tr[data-plugin="' + basename + '"]');
|
1836 |
-
|
1837 |
-
if ( 0 === $pluginRows.length ) {
|
1838 |
-
// Try to get the plugin rows if on the "Updates" page.
|
1839 |
-
var $pluginCheckbox = $( '#update-plugins-table input[type="checkbox"][value="' + basename + '"]' );
|
1840 |
-
if ( 0 !== $pluginCheckbox.length ) {
|
1841 |
-
$pluginRows = $pluginCheckbox.parents( 'tr:first' );
|
1842 |
-
}
|
1843 |
-
}
|
1844 |
-
|
1845 |
-
if ( 0 === $pluginRows.length ) {
|
1846 |
-
// No plugin rows found.
|
1847 |
-
continue;
|
1848 |
-
}
|
1849 |
-
|
1850 |
-
// Find the "View details" links and add the `fs_allow_updater_and_dialog` param to the URL.
|
1851 |
-
$pluginRows.find( 'a[href*="plugin-install.php?tab=plugin-information"]' ).each(function() {
|
1852 |
-
var $this = $( this ),
|
1853 |
-
href = $this.attr( 'href' ).replace( '?tab=', '?fs_allow_updater_and_dialog=true&tab=');
|
1854 |
-
|
1855 |
-
$this.attr( 'href', href );
|
1856 |
-
});
|
1857 |
-
}
|
1858 |
-
})( jQuery );
|
1859 |
-
</script>
|
1860 |
-
<?php
|
1861 |
-
}
|
1862 |
-
|
1863 |
-
/**
|
1864 |
-
* @author Leo Fajardo (@leorw)
|
1865 |
-
* @since 2.3.0
|
1866 |
-
*/
|
1867 |
-
static function _maybe_add_beta_label_styles() {
|
1868 |
-
$has_any_beta_version = false;
|
1869 |
-
|
1870 |
-
foreach ( self::$_instances as $instance ) {
|
1871 |
-
if ( $instance->is_beta() ) {
|
1872 |
-
$has_any_beta_version = true;
|
1873 |
-
break;
|
1874 |
-
}
|
1875 |
-
}
|
1876 |
-
|
1877 |
-
if ( $has_any_beta_version ) {
|
1878 |
-
fs_enqueue_local_style( 'fs_plugins', '/admin/plugins.css' );
|
1879 |
-
}
|
1880 |
-
}
|
1881 |
-
|
1882 |
-
/**
|
1883 |
-
* @author Leo Fajardo (@leorw)
|
1884 |
-
* @since 2.3.0
|
1885 |
-
*/
|
1886 |
-
static function _maybe_add_beta_label_to_plugins_and_handle_confirmation() {
|
1887 |
-
$beta_data = array();
|
1888 |
-
|
1889 |
-
foreach ( self::$_instances as $instance ) {
|
1890 |
-
if ( ! $instance->is_premium() ) {
|
1891 |
-
continue;
|
1892 |
-
}
|
1893 |
-
|
1894 |
-
/**
|
1895 |
-
* If there's an available beta version update, a confirmation message will be shown when the
|
1896 |
-
* "Update now" link on the "Plugins" or "Themes" page is clicked.
|
1897 |
-
*/
|
1898 |
-
$has_beta_update = $instance->has_beta_update();
|
1899 |
-
|
1900 |
-
$is_beta = (
|
1901 |
-
// The "Beta" label is added separately for themes.
|
1902 |
-
$instance->is_plugin() &&
|
1903 |
-
$instance->is_beta()
|
1904 |
-
);
|
1905 |
-
|
1906 |
-
if ( ! $is_beta && ! $has_beta_update ) {
|
1907 |
-
continue;
|
1908 |
-
}
|
1909 |
-
|
1910 |
-
$beta_data[ $instance->get_plugin_basename() ] = array( 'is_installed_version_beta' => $is_beta );
|
1911 |
-
|
1912 |
-
if ( ! $has_beta_update ) {
|
1913 |
-
continue;
|
1914 |
-
}
|
1915 |
-
|
1916 |
-
$beta_data[ $instance->get_plugin_basename() ]['beta_version_update_confirmation_message'] = sprintf(
|
1917 |
-
'%s %s',
|
1918 |
-
sprintf(
|
1919 |
-
fs_esc_attr_inline(
|
1920 |
-
'An update to a Beta version will replace your installed version of %s with the latest Beta release - use with caution, and not on production sites. You have been warned.',
|
1921 |
-
'beta-version-update-caution',
|
1922 |
-
$instance->get_slug()
|
1923 |
-
),
|
1924 |
-
$instance->get_plugin_title()
|
1925 |
-
),
|
1926 |
-
fs_esc_attr_inline( 'Would you like to proceed with the update?', 'update-confirmation', $instance->get_slug() )
|
1927 |
-
);
|
1928 |
-
}
|
1929 |
-
|
1930 |
-
if ( empty( $beta_data ) ) {
|
1931 |
-
return;
|
1932 |
-
}
|
1933 |
-
?>
|
1934 |
-
<script type="text/javascript">
|
1935 |
-
( function( $ ) {
|
1936 |
-
var betaData = <?php echo json_encode( $beta_data ) ?>;
|
1937 |
-
|
1938 |
-
for ( var pluginBasename in betaData ) {
|
1939 |
-
if ( ! betaData.hasOwnProperty( pluginBasename ) ) {
|
1940 |
-
continue;
|
1941 |
-
}
|
1942 |
-
|
1943 |
-
if ( ! betaData[ pluginBasename ].is_installed_version_beta ) {
|
1944 |
-
continue;
|
1945 |
-
}
|
1946 |
-
|
1947 |
-
var $parentContainer = $( '.wp-list-table.plugins tr[data-plugin="' + pluginBasename + '"]' );
|
1948 |
-
if ( 0 === $parentContainer.length ) {
|
1949 |
-
continue;
|
1950 |
-
}
|
1951 |
-
|
1952 |
-
$parentContainer.find( '.plugin-title > strong:first-child').append(
|
1953 |
-
'<span class="fs-tag fs-info"><?php fs_esc_js_echo_inline( 'Beta', 'beta' ) ?></span>'
|
1954 |
-
);
|
1955 |
-
}
|
1956 |
-
|
1957 |
-
setTimeout( function() {
|
1958 |
-
// Wait a little bit before adding the event handler, otherwise, it will be overridden by the core WP logic.
|
1959 |
-
$( '.plugins .update-message .update-link, .themes .theme .update-message' ).on( 'click', function() {
|
1960 |
-
var $parentContainer = $( this ).parents( 'tr:first' );
|
1961 |
-
pluginBasename = ( 0 !== $parentContainer.length ) ?
|
1962 |
-
$parentContainer.data( 'plugin' ) :
|
1963 |
-
$( this ).parents( '.theme:first' ).data( 'slug' );
|
1964 |
-
|
1965 |
-
if (
|
1966 |
-
betaData[ pluginBasename ] &&
|
1967 |
-
betaData[ pluginBasename ].beta_version_update_confirmation_message &&
|
1968 |
-
! confirm( betaData[ pluginBasename ].beta_version_update_confirmation_message )
|
1969 |
-
) {
|
1970 |
-
return false;
|
1971 |
-
}
|
1972 |
-
} );
|
1973 |
-
}, 20 );
|
1974 |
-
} )( jQuery );
|
1975 |
-
</script>
|
1976 |
-
<?php
|
1977 |
-
}
|
1978 |
-
|
1979 |
-
/**
|
1980 |
-
* Keeping the uninstall hook registered for free or premium plugin version may result to a fatal error that
|
1981 |
-
* could happen when a user tries to uninstall either version while one of them is still active. Uninstalling a
|
1982 |
-
* plugin will trigger inclusion of the free or premium version and if one of them is active during the
|
1983 |
-
* uninstallation, a fatal error may occur in case the plugin's class or functions are already defined.
|
1984 |
-
*
|
1985 |
-
* @author Leo Fajardo (@leorw)
|
1986 |
-
*
|
1987 |
-
* @since 1.2.0
|
1988 |
-
*/
|
1989 |
-
private function unregister_uninstall_hook() {
|
1990 |
-
$uninstallable_plugins = (array) get_option( 'uninstall_plugins' );
|
1991 |
-
unset( $uninstallable_plugins[ $this->_free_plugin_basename ] );
|
1992 |
-
unset( $uninstallable_plugins[ $this->premium_plugin_basename() ] );
|
1993 |
-
|
1994 |
-
update_option( 'uninstall_plugins', $uninstallable_plugins );
|
1995 |
-
}
|
1996 |
-
|
1997 |
-
/**
|
1998 |
-
* @since 1.2.0 Invalidate module's main file cache, otherwise, FS_Plugin_Updater will not fetch updates.
|
1999 |
-
*
|
2000 |
-
* @param bool $store_prev_path
|
2001 |
-
*/
|
2002 |
-
private function clear_module_main_file_cache( $store_prev_path = true ) {
|
2003 |
-
if ( ! isset( $this->_storage->plugin_main_file ) ||
|
2004 |
-
empty( $this->_storage->plugin_main_file->path )
|
2005 |
-
) {
|
2006 |
-
return;
|
2007 |
-
}
|
2008 |
-
|
2009 |
-
if ( ! $store_prev_path ) {
|
2010 |
-
/**
|
2011 |
-
* Storing the previous path is not needed when clearing the cache after an SDK version update since
|
2012 |
-
* the main purpose of the cache clearing in that event is to correct a wrong plugin main file path
|
2013 |
-
* which causes data mix-up between plugins (e.g. titles and versions of an add-on and its parent plugin).
|
2014 |
-
*
|
2015 |
-
* @author Leo Fajardo (@leorw)
|
2016 |
-
* @since 2.2.1
|
2017 |
-
*/
|
2018 |
-
unset( $this->_storage->plugin_main_file->path );
|
2019 |
-
} else {
|
2020 |
-
$plugin_main_file = clone $this->_storage->plugin_main_file;
|
2021 |
-
|
2022 |
-
// Store cached path (2nd layer cache).
|
2023 |
-
$plugin_main_file->prev_path = $plugin_main_file->path;
|
2024 |
-
|
2025 |
-
// Clear cached path.
|
2026 |
-
unset( $plugin_main_file->path );
|
2027 |
-
|
2028 |
-
$this->_storage->plugin_main_file = $plugin_main_file;
|
2029 |
-
}
|
2030 |
-
|
2031 |
-
/**
|
2032 |
-
* Clear global cached path.
|
2033 |
-
*
|
2034 |
-
* @author Leo Fajardo (@leorw)
|
2035 |
-
* @since 1.2.2
|
2036 |
-
*/
|
2037 |
-
$id_slug_type_path_map = self::$_accounts->get_option( 'id_slug_type_path_map' );
|
2038 |
-
unset( $id_slug_type_path_map[ $this->_module_id ]['path'] );
|
2039 |
-
self::$_accounts->set_option( 'id_slug_type_path_map', $id_slug_type_path_map, true );
|
2040 |
-
}
|
2041 |
-
|
2042 |
-
/**
|
2043 |
-
* @author Leo Fajardo (@leorw)
|
2044 |
-
* @since 2.0.0
|
2045 |
-
*/
|
2046 |
-
function _hook_action_links_and_register_account_hooks() {
|
2047 |
-
if ( $this->is_migration() ) {
|
2048 |
-
return;
|
2049 |
-
}
|
2050 |
-
|
2051 |
-
$this->_add_tracking_links();
|
2052 |
-
|
2053 |
-
if ( self::is_plugins_page() && $this->is_plugin() ) {
|
2054 |
-
$this->hook_plugin_action_links();
|
2055 |
-
}
|
2056 |
-
|
2057 |
-
$this->_register_account_hooks();
|
2058 |
-
}
|
2059 |
-
|
2060 |
-
/**
|
2061 |
-
* @author Vova Feldman (@svovaf)
|
2062 |
-
* @since 1.0.9
|
2063 |
-
*/
|
2064 |
-
private function _register_account_hooks() {
|
2065 |
-
if ( ! is_admin() ) {
|
2066 |
-
return;
|
2067 |
-
}
|
2068 |
-
|
2069 |
-
/**
|
2070 |
-
* Always show the deactivation feedback form since we added
|
2071 |
-
* automatic free version deactivation upon premium code activation.
|
2072 |
-
*
|
2073 |
-
* @since 1.2.1.6
|
2074 |
-
*/
|
2075 |
-
$this->add_ajax_action(
|
2076 |
-
'submit_uninstall_reason',
|
2077 |
-
array( &$this, '_submit_uninstall_reason_action' )
|
2078 |
-
);
|
2079 |
-
|
2080 |
-
$this->add_ajax_action(
|
2081 |
-
'cancel_subscription_or_trial',
|
2082 |
-
array( &$this, 'cancel_subscription_or_trial_ajax_action' )
|
2083 |
-
);
|
2084 |
-
|
2085 |
-
if ( ! $this->is_addon() || $this->is_parent_plugin_installed() ) {
|
2086 |
-
if ( ( $this->is_plugin() && self::is_plugins_page() ) ||
|
2087 |
-
( $this->is_theme() && self::is_themes_page() )
|
2088 |
-
) {
|
2089 |
-
add_action( 'admin_footer', array( &$this, '_add_deactivation_feedback_dialog_box' ) );
|
2090 |
-
}
|
2091 |
-
}
|
2092 |
-
}
|
2093 |
-
|
2094 |
-
/**
|
2095 |
-
* Leverage backtrace to find caller plugin file path.
|
2096 |
-
*
|
2097 |
-
* @author Vova Feldman (@svovaf)
|
2098 |
-
* @since 1.0.6
|
2099 |
-
*
|
2100 |
-
* @param bool $is_init Is initiation sequence.
|
2101 |
-
*
|
2102 |
-
* @return string
|
2103 |
-
*/
|
2104 |
-
private function _find_caller_plugin_file( $is_init = false ) {
|
2105 |
-
// Try to load the cached value of the file path.
|
2106 |
-
if ( isset( $this->_storage->plugin_main_file ) ) {
|
2107 |
-
$plugin_main_file = $this->_storage->plugin_main_file;
|
2108 |
-
if ( ! empty( $plugin_main_file->path ) ) {
|
2109 |
-
$absolute_path = $this->get_absolute_path( $plugin_main_file->path );
|
2110 |
-
if ( file_exists( $absolute_path ) ) {
|
2111 |
-
return $absolute_path;
|
2112 |
-
}
|
2113 |
-
}
|
2114 |
-
}
|
2115 |
-
|
2116 |
-
/**
|
2117 |
-
* @since 1.2.1
|
2118 |
-
*
|
2119 |
-
* `clear_module_main_file_cache()` is clearing the plugin's cached path on
|
2120 |
-
* deactivation. Therefore, if any plugin/theme was initiating `Freemius`
|
2121 |
-
* with that plugin's slug, it was overriding the empty plugin path with a wrong path.
|
2122 |
-
*
|
2123 |
-
* So, we've added a special mechanism with a 2nd layer of cache that uses `prev_path`
|
2124 |
-
* when the class instantiator isn't the module.
|
2125 |
-
*/
|
2126 |
-
if ( ! $is_init ) {
|
2127 |
-
// Fetch prev path cache.
|
2128 |
-
if ( isset( $this->_storage->plugin_main_file ) &&
|
2129 |
-
! empty( $this->_storage->plugin_main_file->prev_path )
|
2130 |
-
) {
|
2131 |
-
$absolute_path = $this->get_absolute_path( $this->_storage->plugin_main_file->prev_path );
|
2132 |
-
if ( file_exists( $absolute_path ) ) {
|
2133 |
-
return $absolute_path;
|
2134 |
-
}
|
2135 |
-
}
|
2136 |
-
|
2137 |
-
wp_die(
|
2138 |
-
$this->get_text_inline( 'Freemius SDK couldn\'t find the plugin\'s main file. Please contact sdk@freemius.com with the current error.', 'failed-finding-main-path' ) .
|
2139 |
-
" Module: {$this->_slug}; SDK: " . WP_FS__SDK_VERSION . ";",
|
2140 |
-
$this->get_text_inline( 'Error', 'error' ),
|
2141 |
-
array( 'back_link' => true )
|
2142 |
-
);
|
2143 |
-
}
|
2144 |
-
|
2145 |
-
/**
|
2146 |
-
* @since 1.2.1
|
2147 |
-
*
|
2148 |
-
* Only the original instantiator that calls dynamic_init can modify the module's path.
|
2149 |
-
*/
|
2150 |
-
// Find caller module.
|
2151 |
-
$id_slug_type_path_map = self::$_accounts->get_option( 'id_slug_type_path_map', array() );
|
2152 |
-
$this->_storage->plugin_main_file = (object) array(
|
2153 |
-
'path' => $id_slug_type_path_map[ $this->_module_id ]['path'],
|
2154 |
-
);
|
2155 |
-
|
2156 |
-
return $this->get_absolute_path( $id_slug_type_path_map[ $this->_module_id ]['path'] );
|
2157 |
-
}
|
2158 |
-
|
2159 |
-
/**
|
2160 |
-
* @author Leo Fajardo (@leorw)
|
2161 |
-
* @since 1.2.3
|
2162 |
-
*
|
2163 |
-
* @param string $path
|
2164 |
-
*
|
2165 |
-
* @return string
|
2166 |
-
*/
|
2167 |
-
private function get_relative_path( $path ) {
|
2168 |
-
$module_root_dir = $this->get_module_root_dir_path();
|
2169 |
-
if ( 0 === strpos( $path, $module_root_dir ) ) {
|
2170 |
-
$path = substr( $path, strlen( $module_root_dir ) );
|
2171 |
-
}
|
2172 |
-
|
2173 |
-
return $path;
|
2174 |
-
}
|
2175 |
-
|
2176 |
-
/**
|
2177 |
-
* @author Leo Fajardo (@leorw)
|
2178 |
-
* @since 1.2.3
|
2179 |
-
*
|
2180 |
-
* @param string $path
|
2181 |
-
* @param string|bool $module_type
|
2182 |
-
*
|
2183 |
-
* @return string
|
2184 |
-
*/
|
2185 |
-
private function get_absolute_path( $path, $module_type = false ) {
|
2186 |
-
$module_root_dir = $this->get_module_root_dir_path( $module_type );
|
2187 |
-
if ( 0 !== strpos( $path, $module_root_dir ) ) {
|
2188 |
-
$path = fs_normalize_path( $module_root_dir . $path );
|
2189 |
-
}
|
2190 |
-
|
2191 |
-
return $path;
|
2192 |
-
}
|
2193 |
-
|
2194 |
-
/**
|
2195 |
-
* @author Leo Fajardo (@leorw)
|
2196 |
-
* @since 1.2.3
|
2197 |
-
*
|
2198 |
-
* @param string|bool $module_type
|
2199 |
-
*
|
2200 |
-
* @return string
|
2201 |
-
*/
|
2202 |
-
private function get_module_root_dir_path( $module_type = false ) {
|
2203 |
-
$is_plugin = empty( $module_type ) ?
|
2204 |
-
$this->is_plugin() :
|
2205 |
-
( WP_FS__MODULE_TYPE_PLUGIN === $module_type );
|
2206 |
-
|
2207 |
-
return fs_normalize_path( trailingslashit( $is_plugin ?
|
2208 |
-
WP_PLUGIN_DIR :
|
2209 |
-
get_theme_root( get_stylesheet() ) ) );
|
2210 |
-
}
|
2211 |
-
|
2212 |
-
/**
|
2213 |
-
* @author Leo Fajardo (@leorw)
|
2214 |
-
*
|
2215 |
-
* @param number $module_id
|
2216 |
-
* @param string $slug
|
2217 |
-
*
|
2218 |
-
* @since 1.2.2
|
2219 |
-
*/
|
2220 |
-
private function store_id_slug_type_path_map( $module_id, $slug ) {
|
2221 |
-
$id_slug_type_path_map = self::$_accounts->get_option( 'id_slug_type_path_map', array() );
|
2222 |
-
|
2223 |
-
$store_option = false;
|
2224 |
-
|
2225 |
-
if ( ! isset( $id_slug_type_path_map[ $module_id ] ) ) {
|
2226 |
-
$id_slug_type_path_map[ $module_id ] = array(
|
2227 |
-
'slug' => $slug
|
2228 |
-
);
|
2229 |
-
|
2230 |
-
$store_option = true;
|
2231 |
-
} else if (
|
2232 |
-
isset( $id_slug_type_path_map[ $module_id ]['slug'] ) &&
|
2233 |
-
$slug !== $id_slug_type_path_map[ $module_id ]['slug']
|
2234 |
-
) {
|
2235 |
-
$id_slug_type_path_map[ $module_id ]['slug'] = $slug;
|
2236 |
-
$store_option = true;
|
2237 |
-
}
|
2238 |
-
|
2239 |
-
if ( empty( $id_slug_type_path_map[ $module_id ]['path'] ) ||
|
2240 |
-
/**
|
2241 |
-
* This verification is for cases when suddenly the same module
|
2242 |
-
* is installed but with a different folder name.
|
2243 |
-
*
|
2244 |
-
* @author Vova Feldman (@svovaf)
|
2245 |
-
* @since 1.2.3
|
2246 |
-
*/
|
2247 |
-
! file_exists( $this->get_absolute_path(
|
2248 |
-
$id_slug_type_path_map[ $module_id ]['path'],
|
2249 |
-
$id_slug_type_path_map[ $module_id ]['type']
|
2250 |
-
) )
|
2251 |
-
) {
|
2252 |
-
$caller_main_file_and_type = $this->get_caller_main_file_and_type();
|
2253 |
-
|
2254 |
-
$id_slug_type_path_map[ $module_id ]['type'] = $caller_main_file_and_type->module_type;
|
2255 |
-
$id_slug_type_path_map[ $module_id ]['path'] = $caller_main_file_and_type->path;
|
2256 |
-
|
2257 |
-
$store_option = true;
|
2258 |
-
}
|
2259 |
-
|
2260 |
-
if ( $store_option ) {
|
2261 |
-
self::$_accounts->set_option( 'id_slug_type_path_map', $id_slug_type_path_map, true );
|
2262 |
-
}
|
2263 |
-
}
|
2264 |
-
|
2265 |
-
/**
|
2266 |
-
* Identifies the caller type: plugin or theme.
|
2267 |
-
*
|
2268 |
-
* @author Leo Fajardo (@leorw)
|
2269 |
-
* @since 1.2.2
|
2270 |
-
*
|
2271 |
-
* @author Vova Feldman (@svovaf)
|
2272 |
-
* @since 1.2.2.3 Find the earliest module in the call stack that calls to the SDK. This fix is for cases when
|
2273 |
-
* add-ons are relying on loading the SDK from the parent module, and also allows themes including the
|
2274 |
-
* SDK an internal file instead of directly from functions.php.
|
2275 |
-
* @since 1.2.1.7 Knows how to handle cases when an add-on includes the parent module logic.
|
2276 |
-
*/
|
2277 |
-
private function get_caller_main_file_and_type() {
|
2278 |
-
self::require_plugin_essentials();
|
2279 |
-
|
2280 |
-
$all_plugins = fs_get_plugins( true );
|
2281 |
-
$all_plugins_paths = array();
|
2282 |
-
|
2283 |
-
// Get active plugin's main files real full names (might be symlinks).
|
2284 |
-
foreach ( $all_plugins as $relative_path => $data ) {
|
2285 |
-
if ( false === strpos( fs_normalize_path( $relative_path ), '/' ) ) {
|
2286 |
-
/**
|
2287 |
-
* Ignore plugins that don't have a folder (e.g. Hello Dolly) since they
|
2288 |
-
* can't really include the SDK.
|
2289 |
-
*
|
2290 |
-
* @author Vova Feldman
|
2291 |
-
* @since 1.2.1.7
|
2292 |
-
*/
|
2293 |
-
continue;
|
2294 |
-
}
|
2295 |
-
|
2296 |
-
$all_plugins_paths[] = fs_normalize_path( realpath( WP_PLUGIN_DIR . '/' . $relative_path ) );
|
2297 |
-
}
|
2298 |
-
|
2299 |
-
$caller_file_candidate = false;
|
2300 |
-
$caller_map = array();
|
2301 |
-
$module_type = WP_FS__MODULE_TYPE_PLUGIN;
|
2302 |
-
$themes_dir = fs_normalize_path( get_theme_root( get_stylesheet() ) );
|
2303 |
-
$plugin_dir_to_skip = false;
|
2304 |
-
|
2305 |
-
for ( $i = 1, $bt = debug_backtrace(), $len = count( $bt ); $i < $len; $i ++ ) {
|
2306 |
-
if ( empty( $bt[ $i ]['file'] ) ) {
|
2307 |
-
continue;
|
2308 |
-
}
|
2309 |
-
|
2310 |
-
if ( $i > 1 && ! empty( $bt[ $i - 1 ]['file'] ) && $bt[ $i ]['file'] === $bt[ $i - 1 ]['file'] ) {
|
2311 |
-
// If file same as the prev file in the stack, skip it.
|
2312 |
-
continue;
|
2313 |
-
}
|
2314 |
-
|
2315 |
-
if ( ! empty( $bt[ $i ]['function'] ) && in_array( $bt[ $i ]['function'], array(
|
2316 |
-
'do_action',
|
2317 |
-
'apply_filter',
|
2318 |
-
// The string split is stupid, but otherwise, theme check
|
2319 |
-
// throws info notices.
|
2320 |
-
'requir' . 'e_once',
|
2321 |
-
'requir' . 'e',
|
2322 |
-
'includ' . 'e_once',
|
2323 |
-
'includ' . 'e',
|
2324 |
-
'install_and_activate_plugin',
|
2325 |
-
'try_activate_plugin',
|
2326 |
-
'activate_plugin'
|
2327 |
-
) )
|
2328 |
-
) {
|
2329 |
-
if ( 'activate_plugin' === $bt[ $i ]['function'] ) {
|
2330 |
-
/**
|
2331 |
-
* Store the directory of the activator plugin so that any other file that starts with it
|
2332 |
-
* cannot be mistakenly chosen as a candidate caller file.
|
2333 |
-
*
|
2334 |
-
* @author Leo Fajardo
|
2335 |
-
*
|
2336 |
-
* @since 2.3.0
|
2337 |
-
*/
|
2338 |
-
$caller_file_path = fs_normalize_path( $bt[ $i ]['file'] );
|
2339 |
-
|
2340 |
-
foreach ( $all_plugins_paths as $plugin_path ) {
|
2341 |
-
$plugin_dir = fs_normalize_path( dirname( $plugin_path ) . '/' );
|
2342 |
-
if ( false !== strpos( $caller_file_path, $plugin_dir ) ) {
|
2343 |
-
$plugin_dir_to_skip = $plugin_dir;
|
2344 |
-
|
2345 |
-
break;
|
2346 |
-
}
|
2347 |
-
}
|
2348 |
-
}
|
2349 |
-
|
2350 |
-
// Ignore call stack hooks and files inclusion.
|
2351 |
-
continue;
|
2352 |
-
}
|
2353 |
-
|
2354 |
-
$caller_file_path = fs_normalize_path( $bt[ $i ]['file'] );
|
2355 |
-
|
2356 |
-
if ( ! empty( $plugin_dir_to_skip ) ) {
|
2357 |
-
/**
|
2358 |
-
* Skip if it's an activator plugin file to avoid mistakenly choosing it as a candidate caller file.
|
2359 |
-
*
|
2360 |
-
* @author Leo Fajardo
|
2361 |
-
*
|
2362 |
-
* @since 2.3.0
|
2363 |
-
*/
|
2364 |
-
if ( 0 === strpos( $caller_file_path, $plugin_dir_to_skip ) ) {
|
2365 |
-
continue;
|
2366 |
-
}
|
2367 |
-
}
|
2368 |
-
|
2369 |
-
if ( 'functions.php' === basename( $caller_file_path ) ) {
|
2370 |
-
/**
|
2371 |
-
* 1. Assumes that theme's starting execution file is functions.php.
|
2372 |
-
* 2. This complex logic fixes symlink issues (e.g. with Vargant).
|
2373 |
-
*
|
2374 |
-
* @author Vova Feldman (@svovaf)
|
2375 |
-
* @since 1.2.2.5
|
2376 |
-
*/
|
2377 |
-
|
2378 |
-
if ( $caller_file_path == fs_normalize_path( realpath( trailingslashit( $themes_dir ) . basename( dirname( $caller_file_path ) ) . '/' . basename( $caller_file_path ) ) ) ) {
|
2379 |
-
$module_type = WP_FS__MODULE_TYPE_THEME;
|
2380 |
-
|
2381 |
-
/**
|
2382 |
-
* Relative path of the theme, e.g.:
|
2383 |
-
* `my-theme/functions.php`
|
2384 |
-
*
|
2385 |
-
* @author Leo Fajardo (@leorw)
|
2386 |
-
*/
|
2387 |
-
$caller_file_candidate = basename( dirname( $caller_file_path ) ) .
|
2388 |
-
'/' .
|
2389 |
-
basename( $caller_file_path );
|
2390 |
-
|
2391 |
-
continue;
|
2392 |
-
}
|
2393 |
-
}
|
2394 |
-
|
2395 |
-
$caller_file_hash = md5( $caller_file_path );
|
2396 |
-
|
2397 |
-
if ( ! isset( $caller_map[ $caller_file_hash ] ) ) {
|
2398 |
-
foreach ( $all_plugins_paths as $plugin_path ) {
|
2399 |
-
if ( empty( $plugin_path ) ) {
|
2400 |
-
continue;
|
2401 |
-
}
|
2402 |
-
|
2403 |
-
if ( false !== strpos( $caller_file_path, fs_normalize_path( dirname( $plugin_path ) . '/' ) ) ) {
|
2404 |
-
$caller_map[ $caller_file_hash ] = fs_normalize_path( $plugin_path );
|
2405 |
-
break;
|
2406 |
-
}
|
2407 |
-
}
|
2408 |
-
}
|
2409 |
-
|
2410 |
-
if ( isset( $caller_map[ $caller_file_hash ] ) ) {
|
2411 |
-
$module_type = WP_FS__MODULE_TYPE_PLUGIN;
|
2412 |
-
$caller_file_candidate = plugin_basename( $caller_map[ $caller_file_hash ] );
|
2413 |
-
}
|
2414 |
-
}
|
2415 |
-
|
2416 |
-
return (object) array(
|
2417 |
-
'module_type' => $module_type,
|
2418 |
-
'path' => $caller_file_candidate
|
2419 |
-
);
|
2420 |
-
}
|
2421 |
-
|
2422 |
-
#----------------------------------------------------------------------------------
|
2423 |
-
#region Deactivation Feedback Form
|
2424 |
-
#----------------------------------------------------------------------------------
|
2425 |
-
|
2426 |
-
/**
|
2427 |
-
* Displays a confirmation and feedback dialog box when the user clicks on the "Deactivate" link on the plugins
|
2428 |
-
* page.
|
2429 |
-
*
|
2430 |
-
* @author Vova Feldman (@svovaf)
|
2431 |
-
* @author Leo Fajardo (@leorw)
|
2432 |
-
*
|
2433 |
-
* @since 1.1.2
|
2434 |
-
*/
|
2435 |
-
function _add_deactivation_feedback_dialog_box() {
|
2436 |
-
$subscription_cancellation_dialog_box_template_params = $this->apply_filters( 'show_deactivation_subscription_cancellation', true ) ?
|
2437 |
-
$this->_get_subscription_cancellation_dialog_box_template_params() :
|
2438 |
-
array();
|
2439 |
-
|
2440 |
-
/**
|
2441 |
-
* @since 2.3.0 Developers can optionally hide the deactivation feedback form using the 'show_deactivation_feedback_form' filter.
|
2442 |
-
*/
|
2443 |
-
$show_deactivation_feedback_form = true;
|
2444 |
-
if ( $this->has_filter( 'show_deactivation_feedback_form' ) ) {
|
2445 |
-
$show_deactivation_feedback_form = $this->apply_filters( 'show_deactivation_feedback_form', true );
|
2446 |
-
} else if ( $this->is_addon() ) {
|
2447 |
-
/**
|
2448 |
-
* If the add-on's 'show_deactivation_feedback_form' is not set, try to inherit the value from the parent.
|
2449 |
-
*/
|
2450 |
-
$show_deactivation_feedback_form = $this->get_parent_instance()->apply_filters( 'show_deactivation_feedback_form', true );
|
2451 |
-
}
|
2452 |
-
|
2453 |
-
$uninstall_confirmation_message = $this->apply_filters( 'uninstall_confirmation_message', '' );
|
2454 |
-
|
2455 |
-
if (
|
2456 |
-
empty( $subscription_cancellation_dialog_box_template_params ) &&
|
2457 |
-
! $show_deactivation_feedback_form &&
|
2458 |
-
empty( $uninstall_confirmation_message )
|
2459 |
-
) {
|
2460 |
-
return;
|
2461 |
-
}
|
2462 |
-
|
2463 |
-
$vars = array( 'id' => $this->_module_id );
|
2464 |
-
|
2465 |
-
if ( $show_deactivation_feedback_form ) {
|
2466 |
-
/* Check the type of user:
|
2467 |
-
* 1. Long-term (long-term)
|
2468 |
-
* 2. Non-registered and non-anonymous short-term (non-registered-and-non-anonymous-short-term).
|
2469 |
-
* 3. Short-term (short-term)
|
2470 |
-
*/
|
2471 |
-
$is_long_term_user = true;
|
2472 |
-
|
2473 |
-
// Check if the site is at least 2 days old.
|
2474 |
-
$time_installed = $this->_storage->install_timestamp;
|
2475 |
-
|
2476 |
-
// Difference in seconds.
|
2477 |
-
$date_diff = time() - $time_installed;
|
2478 |
-
|
2479 |
-
// Convert seconds to days.
|
2480 |
-
$date_diff_days = floor( $date_diff / ( 60 * 60 * 24 ) );
|
2481 |
-
|
2482 |
-
if ( $date_diff_days < 2 ) {
|
2483 |
-
$is_long_term_user = false;
|
2484 |
-
}
|
2485 |
-
|
2486 |
-
$is_long_term_user = $this->apply_filters( 'is_long_term_user', $is_long_term_user );
|
2487 |
-
|
2488 |
-
if ( $is_long_term_user ) {
|
2489 |
-
$user_type = 'long-term';
|
2490 |
-
} else {
|
2491 |
-
if ( ! $this->is_registered() && ! $this->is_anonymous() ) {
|
2492 |
-
$user_type = 'non-registered-and-non-anonymous-short-term';
|
2493 |
-
} else {
|
2494 |
-
$user_type = 'short-term';
|
2495 |
-
}
|
2496 |
-
}
|
2497 |
-
|
2498 |
-
$uninstall_reasons = $this->_get_uninstall_reasons( $user_type );
|
2499 |
-
|
2500 |
-
$vars['reasons'] = $uninstall_reasons;
|
2501 |
-
}
|
2502 |
-
|
2503 |
-
$vars['subscription_cancellation_dialog_box_template_params'] = &$subscription_cancellation_dialog_box_template_params;
|
2504 |
-
$vars['show_deactivation_feedback_form'] = $show_deactivation_feedback_form;
|
2505 |
-
$vars['uninstall_confirmation_message'] = $uninstall_confirmation_message;
|
2506 |
-
|
2507 |
-
/**
|
2508 |
-
* Load the HTML template for the deactivation feedback dialog box.
|
2509 |
-
*
|
2510 |
-
* @todo Deactivation form core functions should be loaded only once! Otherwise, when there are multiple Freemius powered plugins the same code is loaded multiple times. The only thing that should be loaded differently is the various deactivation reasons object based on the state of the plugin.
|
2511 |
-
*/
|
2512 |
-
fs_require_template( 'forms/deactivation/form.php', $vars );
|
2513 |
-
}
|
2514 |
-
|
2515 |
-
/**
|
2516 |
-
* @author Leo Fajardo (@leorw)
|
2517 |
-
* @since 1.1.2
|
2518 |
-
*
|
2519 |
-
* @param string $user_type
|
2520 |
-
*
|
2521 |
-
* @return array The uninstall reasons for the specified user type.
|
2522 |
-
*/
|
2523 |
-
function _get_uninstall_reasons( $user_type = 'long-term' ) {
|
2524 |
-
$module_type = $this->_module_type;
|
2525 |
-
|
2526 |
-
$internal_message_template_var = array(
|
2527 |
-
'id' => $this->_module_id
|
2528 |
-
);
|
2529 |
-
|
2530 |
-
$plan = $this->get_plan();
|
2531 |
-
|
2532 |
-
if ( $this->is_registered() && is_object( $plan ) && $plan->has_technical_support() ) {
|
2533 |
-
$contact_support_template = fs_get_template( 'forms/deactivation/contact.php', $internal_message_template_var );
|
2534 |
-
} else {
|
2535 |
-
$contact_support_template = '';
|
2536 |
-
}
|
2537 |
-
|
2538 |
-
$reason_found_better_plugin = array(
|
2539 |
-
'id' => self::REASON_FOUND_A_BETTER_PLUGIN,
|
2540 |
-
'text' => sprintf( $this->get_text_inline( 'I found a better %s', 'reason-found-a-better-plugin' ), $module_type ),
|
2541 |
-
'input_type' => 'textfield',
|
2542 |
-
'input_placeholder' => sprintf( $this->get_text_inline( "What's the %s's name?", 'placeholder-plugin-name' ), $module_type ),
|
2543 |
-
);
|
2544 |
-
|
2545 |
-
$reason_temporary_deactivation = array(
|
2546 |
-
'id' => self::REASON_TEMPORARY_DEACTIVATION,
|
2547 |
-
'text' => sprintf(
|
2548 |
-
$this->get_text_inline( "It's a temporary %s. I'm just debugging an issue.", 'reason-temporary-x' ),
|
2549 |
-
strtolower( $this->is_plugin() ?
|
2550 |
-
$this->get_text_inline( 'Deactivation', 'deactivation' ) :
|
2551 |
-
$this->get_text_inline( 'Theme Switch', 'theme-switch' )
|
2552 |
-
)
|
2553 |
-
),
|
2554 |
-
'input_type' => '',
|
2555 |
-
'input_placeholder' => ''
|
2556 |
-
);
|
2557 |
-
|
2558 |
-
$reason_other = array(
|
2559 |
-
'id' => self::REASON_OTHER,
|
2560 |
-
'text' => $this->get_text_inline( 'Other', 'reason-other' ),
|
2561 |
-
'input_type' => 'textfield',
|
2562 |
-
'input_placeholder' => ''
|
2563 |
-
);
|
2564 |
-
|
2565 |
-
$long_term_user_reasons = array(
|
2566 |
-
array(
|
2567 |
-
'id' => self::REASON_NO_LONGER_NEEDED,
|
2568 |
-
'text' => sprintf( $this->get_text_inline( 'I no longer need the %s', 'reason-no-longer-needed' ), $module_type ),
|
2569 |
-
'input_type' => '',
|
2570 |
-
'input_placeholder' => ''
|
2571 |
-
),
|
2572 |
-
$reason_found_better_plugin,
|
2573 |
-
array(
|
2574 |
-
'id' => self::REASON_NEEDED_FOR_A_SHORT_PERIOD,
|
2575 |
-
'text' => sprintf( $this->get_text_inline( 'I only needed the %s for a short period', 'reason-needed-for-a-short-period' ), $module_type ),
|
2576 |
-
'input_type' => '',
|
2577 |
-
'input_placeholder' => ''
|
2578 |
-
),
|
2579 |
-
array(
|
2580 |
-
'id' => self::REASON_BROKE_MY_SITE,
|
2581 |
-
'text' => sprintf( $this->get_text_inline( 'The %s broke my site', 'reason-broke-my-site' ), $module_type ),
|
2582 |
-
'input_type' => '',
|
2583 |
-
'input_placeholder' => '',
|
2584 |
-
'internal_message' => $contact_support_template
|
2585 |
-
),
|
2586 |
-
array(
|
2587 |
-
'id' => self::REASON_SUDDENLY_STOPPED_WORKING,
|
2588 |
-
'text' => sprintf( $this->get_text_inline( 'The %s suddenly stopped working', 'reason-suddenly-stopped-working' ), $module_type ),
|
2589 |
-
'input_type' => '',
|
2590 |
-
'input_placeholder' => '',
|
2591 |
-
'internal_message' => $contact_support_template
|
2592 |
-
)
|
2593 |
-
);
|
2594 |
-
|
2595 |
-
if ( $this->is_paying() ) {
|
2596 |
-
$long_term_user_reasons[] = array(
|
2597 |
-
'id' => self::REASON_CANT_PAY_ANYMORE,
|
2598 |
-
'text' => $this->get_text_inline( "I can't pay for it anymore", 'reason-cant-pay-anymore' ),
|
2599 |
-
'input_type' => 'textfield',
|
2600 |
-
'input_placeholder' => $this->get_text_inline( 'What price would you feel comfortable paying?', 'placeholder-comfortable-price' )
|
2601 |
-
);
|
2602 |
-
}
|
2603 |
-
|
2604 |
-
$reason_dont_share_info = array(
|
2605 |
-
'id' => self::REASON_DONT_LIKE_TO_SHARE_MY_INFORMATION,
|
2606 |
-
'text' => $this->get_text_inline( "I don't like to share my information with you", 'reason-dont-like-to-share-my-information' ),
|
2607 |
-
'input_type' => '',
|
2608 |
-
'input_placeholder' => ''
|
2609 |
-
);
|
2610 |
-
|
2611 |
-
/**
|
2612 |
-
* If the current user has selected the "don't share data" reason in the deactivation feedback modal, inform the
|
2613 |
-
* user by showing additional message that he doesn't have to share data and can just choose to skip the opt-in
|
2614 |
-
* (the Skip button is included in the message to show). This message will only be shown if anonymous mode is
|
2615 |
-
* enabled and the user's account is currently not in pending activation state (similar to the way the Skip
|
2616 |
-
* button in the opt-in form is shown/hidden).
|
2617 |
-
*/
|
2618 |
-
if ( $this->is_enable_anonymous() && ! $this->is_pending_activation() ) {
|
2619 |
-
$reason_dont_share_info['internal_message'] = fs_get_template( 'forms/deactivation/retry-skip.php', $internal_message_template_var );
|
2620 |
-
}
|
2621 |
-
|
2622 |
-
$uninstall_reasons = array(
|
2623 |
-
'long-term' => $long_term_user_reasons,
|
2624 |
-
'non-registered-and-non-anonymous-short-term' => array(
|
2625 |
-
array(
|
2626 |
-
'id' => self::REASON_DIDNT_WORK,
|
2627 |
-
'text' => sprintf( $this->get_text_inline( "The %s didn't work", 'reason-didnt-work' ), $module_type ),
|
2628 |
-
'input_type' => '',
|
2629 |
-
'input_placeholder' => ''
|
2630 |
-
),
|
2631 |
-
$reason_dont_share_info,
|
2632 |
-
$reason_found_better_plugin
|
2633 |
-
),
|
2634 |
-
'short-term' => array(
|
2635 |
-
array(
|
2636 |
-
'id' => self::REASON_COULDNT_MAKE_IT_WORK,
|
2637 |
-
'text' => $this->get_text_inline( "I couldn't understand how to make it work", 'reason-couldnt-make-it-work' ),
|
2638 |
-
'input_type' => '',
|
2639 |
-
'input_placeholder' => '',
|
2640 |
-
'internal_message' => $contact_support_template
|
2641 |
-
),
|
2642 |
-
$reason_found_better_plugin,
|
2643 |
-
array(
|
2644 |
-
'id' => self::REASON_GREAT_BUT_NEED_SPECIFIC_FEATURE,
|
2645 |
-
'text' => sprintf( $this->get_text_inline( "The %s is great, but I need specific feature that you don't support", 'reason-great-but-need-specific-feature' ), $module_type ),
|
2646 |
-
'input_type' => 'textarea',
|
2647 |
-
'input_placeholder' => $this->get_text_inline( 'What feature?', 'placeholder-feature' )
|
2648 |
-
),
|
2649 |
-
array(
|
2650 |
-
'id' => self::REASON_NOT_WORKING,
|
2651 |
-
'text' => sprintf( $this->get_text_inline( 'The %s is not working', 'reason-not-working' ), $module_type ),
|
2652 |
-
'input_type' => 'textarea',
|
2653 |
-
'input_placeholder' => $this->get_text_inline( "Kindly share what didn't work so we can fix it for future users...", 'placeholder-share-what-didnt-work' )
|
2654 |
-
),
|
2655 |
-
array(
|
2656 |
-
'id' => self::REASON_NOT_WHAT_I_WAS_LOOKING_FOR,
|
2657 |
-
'text' => $this->get_text_inline( "It's not what I was looking for", 'reason-not-what-i-was-looking-for' ),
|
2658 |
-
'input_type' => 'textarea',
|
2659 |
-
'input_placeholder' => $this->get_text_inline( "What you've been looking for?", 'placeholder-what-youve-been-looking-for' )
|
2660 |
-
),
|
2661 |
-
array(
|
2662 |
-
'id' => self::REASON_DIDNT_WORK_AS_EXPECTED,
|
2663 |
-
'text' => sprintf( $this->get_text_inline( "The %s didn't work as expected", 'reason-didnt-work-as-expected' ), $module_type ),
|
2664 |
-
'input_type' => 'textarea',
|
2665 |
-
'input_placeholder' => $this->get_text_inline( 'What did you expect?', 'placeholder-what-did-you-expect' )
|
2666 |
-
)
|
2667 |
-
)
|
2668 |
-
);
|
2669 |
-
|
2670 |
-
// Randomize the reasons for the current user type.
|
2671 |
-
shuffle( $uninstall_reasons[ $user_type ] );
|
2672 |
-
|
2673 |
-
// Keep the following reasons as the last items in the list.
|
2674 |
-
$uninstall_reasons[ $user_type ][] = $reason_temporary_deactivation;
|
2675 |
-
$uninstall_reasons[ $user_type ][] = $reason_other;
|
2676 |
-
|
2677 |
-
$uninstall_reasons = $this->apply_filters( 'uninstall_reasons', $uninstall_reasons );
|
2678 |
-
|
2679 |
-
return $uninstall_reasons[ $user_type ];
|
2680 |
-
}
|
2681 |
-
|
2682 |
-
/**
|
2683 |
-
* Called after the user has submitted his reason for deactivating the plugin.
|
2684 |
-
*
|
2685 |
-
* @author Leo Fajardo (@leorw)
|
2686 |
-
* @since 1.1.2
|
2687 |
-
*/
|
2688 |
-
function _submit_uninstall_reason_action() {
|
2689 |
-
$this->_logger->entrance();
|
2690 |
-
|
2691 |
-
$this->check_ajax_referer( 'submit_uninstall_reason' );
|
2692 |
-
|
2693 |
-
$reason_id = fs_request_get( 'reason_id' );
|
2694 |
-
|
2695 |
-
// Check if the given reason ID is an unsigned integer.
|
2696 |
-
if ( ! ctype_digit( $reason_id ) ) {
|
2697 |
-
exit;
|
2698 |
-
}
|
2699 |
-
|
2700 |
-
$reason_info = trim( fs_request_get( 'reason_info', '' ) );
|
2701 |
-
if ( ! empty( $reason_info ) ) {
|
2702 |
-
$reason_info = substr( $reason_info, 0, 128 );
|
2703 |
-
}
|
2704 |
-
|
2705 |
-
$reason = (object) array(
|
2706 |
-
'id' => $reason_id,
|
2707 |
-
'info' => $reason_info,
|
2708 |
-
'is_anonymous' => fs_request_get_bool( 'is_anonymous' )
|
2709 |
-
);
|
2710 |
-
|
2711 |
-
$this->_storage->store( 'uninstall_reason', $reason );
|
2712 |
-
|
2713 |
-
/**
|
2714 |
-
* If the module type is "theme", trigger the uninstall event here (on theme deactivation) since themes do
|
2715 |
-
* not support uninstall hook.
|
2716 |
-
*
|
2717 |
-
* @author Leo Fajardo (@leorw)
|
2718 |
-
* @since 1.2.2
|
2719 |
-
*/
|
2720 |
-
if ( $this->is_theme() ) {
|
2721 |
-
if ( $this->is_premium() && ! $this->has_active_valid_license() ) {
|
2722 |
-
FS_Plugin_Updater::instance( $this )->delete_update_data();
|
2723 |
-
}
|
2724 |
-
|
2725 |
-
$this->_uninstall_plugin_event( false );
|
2726 |
-
$this->remove_sdk_reference();
|
2727 |
-
}
|
2728 |
-
|
2729 |
-
// Print '1' for successful operation.
|
2730 |
-
echo 1;
|
2731 |
-
exit;
|
2732 |
-
}
|
2733 |
-
|
2734 |
-
/**
|
2735 |
-
* @author Leo Fajardo (@leorw)
|
2736 |
-
* @since 2.1.4
|
2737 |
-
*/
|
2738 |
-
function cancel_subscription_or_trial_ajax_action() {
|
2739 |
-
$this->_logger->entrance();
|
2740 |
-
|
2741 |
-
$this->check_ajax_referer( 'cancel_subscription_or_trial' );
|
2742 |
-
|
2743 |
-
$result = $this->cancel_subscription_or_trial( fs_request_get( 'plugin_id', $this->get_id() ), false );
|
2744 |
-
|
2745 |
-
if ( $this->is_api_error( $result ) ) {
|
2746 |
-
$this->shoot_ajax_failure( $result->error->message );
|
2747 |
-
}
|
2748 |
-
|
2749 |
-
$this->shoot_ajax_success();
|
2750 |
-
}
|
2751 |
-
|
2752 |
-
/**
|
2753 |
-
* @author Leo Fajardo (@leorw)
|
2754 |
-
* @since 2.1.4
|
2755 |
-
*
|
2756 |
-
* @param number $plugin_id
|
2757 |
-
*
|
2758 |
-
* @return object
|
2759 |
-
*/
|
2760 |
-
private function cancel_subscription_or_trial( $plugin_id ) {
|
2761 |
-
$fs = null;
|
2762 |
-
if ( $plugin_id == $this->get_id() ) {
|
2763 |
-
$fs = $this;
|
2764 |
-
} else if ( $this->is_addon_activated( $plugin_id ) ) {
|
2765 |
-
$fs = self::get_instance_by_id( $plugin_id );
|
2766 |
-
}
|
2767 |
-
|
2768 |
-
$result = null;
|
2769 |
-
|
2770 |
-
if ( ! is_null( $fs ) ) {
|
2771 |
-
$result = $fs->is_paid_trial() ?
|
2772 |
-
$fs->_cancel_trial() :
|
2773 |
-
$fs->_downgrade_site();
|
2774 |
-
}
|
2775 |
-
|
2776 |
-
return $result;
|
2777 |
-
}
|
2778 |
-
|
2779 |
-
/**
|
2780 |
-
* @author Leo Fajardo (@leorw)
|
2781 |
-
* @since 2.0.2
|
2782 |
-
*/
|
2783 |
-
function _delete_theme_update_data_action() {
|
2784 |
-
FS_Plugin_Updater::instance( $this )->delete_update_data();
|
2785 |
-
}
|
2786 |
-
|
2787 |
-
#endregion
|
2788 |
-
|
2789 |
-
#----------------------------------------------------------------------------------
|
2790 |
-
#region Instance
|
2791 |
-
#----------------------------------------------------------------------------------
|
2792 |
-
|
2793 |
-
/**
|
2794 |
-
* Main singleton instance.
|
2795 |
-
*
|
2796 |
-
* @author Vova Feldman (@svovaf)
|
2797 |
-
* @since 1.0.0
|
2798 |
-
*
|
2799 |
-
* @param number $module_id
|
2800 |
-
* @param string|bool $slug
|
2801 |
-
* @param bool $is_init Is initiation sequence.
|
2802 |
-
*
|
2803 |
-
* @return Freemius|false
|
2804 |
-
*/
|
2805 |
-
static function instance( $module_id, $slug = false, $is_init = false ) {
|
2806 |
-
if ( empty( $module_id ) ) {
|
2807 |
-
return false;
|
2808 |
-
}
|
2809 |
-
|
2810 |
-
/**
|
2811 |
-
* Load the essential static data prior to initiating FS_Plugin_Manager since there's an essential MS network migration logic that needs to be executed prior to the initiation.
|
2812 |
-
*/
|
2813 |
-
self::_load_required_static();
|
2814 |
-
|
2815 |
-
if ( ! is_numeric( $module_id ) ) {
|
2816 |
-
if ( ! $is_init && true === $slug ) {
|
2817 |
-
$is_init = true;
|
2818 |
-
}
|
2819 |
-
|
2820 |
-
$slug = $module_id;
|
2821 |
-
|
2822 |
-
$module = FS_Plugin_Manager::instance( $slug )->get();
|
2823 |
-
|
2824 |
-
if ( is_object( $module ) ) {
|
2825 |
-
$module_id = $module->id;
|
2826 |
-
}
|
2827 |
-
}
|
2828 |
-
|
2829 |
-
$key = 'm_' . $module_id;
|
2830 |
-
|
2831 |
-
if ( ! isset( self::$_instances[ $key ] ) ) {
|
2832 |
-
self::$_instances[ $key ] = new Freemius( $module_id, $slug, $is_init );
|
2833 |
-
}
|
2834 |
-
|
2835 |
-
return self::$_instances[ $key ];
|
2836 |
-
}
|
2837 |
-
|
2838 |
-
/**
|
2839 |
-
* @author Vova Feldman (@svovaf)
|
2840 |
-
* @since 1.0.6
|
2841 |
-
*
|
2842 |
-
* @param number $addon_id
|
2843 |
-
*
|
2844 |
-
* @return bool
|
2845 |
-
*/
|
2846 |
-
private static function has_instance( $addon_id ) {
|
2847 |
-
return isset( self::$_instances[ 'm_' . $addon_id ] );
|
2848 |
-
}
|
2849 |
-
|
2850 |
-
/**
|
2851 |
-
* @author Leo Fajardo (@leorw)
|
2852 |
-
* @since 1.2.2
|
2853 |
-
*
|
2854 |
-
* @param string|number $id_or_slug
|
2855 |
-
* @param string $module_type
|
2856 |
-
*
|
2857 |
-
* @return number|false
|
2858 |
-
*/
|
2859 |
-
private static function get_module_id( $id_or_slug, $module_type = WP_FS__MODULE_TYPE_PLUGIN ) {
|
2860 |
-
if ( is_numeric( $id_or_slug ) ) {
|
2861 |
-
return $id_or_slug;
|
2862 |
-
}
|
2863 |
-
|
2864 |
-
foreach ( self::$_instances as $instance ) {
|
2865 |
-
// Also check the module type since there can be a plugin and a theme with the same slug.
|
2866 |
-
if ( ( $module_type === $instance->get_module_type() ) && ( $id_or_slug === $instance->get_slug() ) ) {
|
2867 |
-
return $instance->get_id();
|
2868 |
-
}
|
2869 |
-
}
|
2870 |
-
|
2871 |
-
return false;
|
2872 |
-
}
|
2873 |
-
|
2874 |
-
/**
|
2875 |
-
* @author Vova Feldman (@svovaf)
|
2876 |
-
* @since 1.0.6
|
2877 |
-
*
|
2878 |
-
* @param number $id
|
2879 |
-
*
|
2880 |
-
* @return false|Freemius
|
2881 |
-
*/
|
2882 |
-
static function get_instance_by_id( $id ) {
|
2883 |
-
return isset ( self::$_instances[ 'm_' . $id ] ) ?
|
2884 |
-
self::$_instances[ 'm_' . $id ] :
|
2885 |
-
false;
|
2886 |
-
}
|
2887 |
-
|
2888 |
-
/**
|
2889 |
-
*
|
2890 |
-
* @author Vova Feldman (@svovaf)
|
2891 |
-
* @since 1.0.1
|
2892 |
-
*
|
2893 |
-
* @param string $plugin_file
|
2894 |
-
* @param string $module_type
|
2895 |
-
*
|
2896 |
-
* @return false|Freemius
|
2897 |
-
*/
|
2898 |
-
static function get_instance_by_file( $plugin_file, $module_type = WP_FS__MODULE_TYPE_PLUGIN ) {
|
2899 |
-
$slug = self::find_slug_by_basename( $plugin_file );
|
2900 |
-
|
2901 |
-
return ( false !== $slug ) ?
|
2902 |
-
self::instance( self::get_module_id( $slug, $module_type ) ) :
|
2903 |
-
false;
|
2904 |
-
}
|
2905 |
-
|
2906 |
-
/**
|
2907 |
-
* @author Vova Feldman (@svovaf)
|
2908 |
-
* @since 1.0.6
|
2909 |
-
*
|
2910 |
-
* @return false|Freemius
|
2911 |
-
*/
|
2912 |
-
function get_parent_instance() {
|
2913 |
-
return self::get_instance_by_id( $this->_plugin->parent_plugin_id );
|
2914 |
-
}
|
2915 |
-
|
2916 |
-
/**
|
2917 |
-
* @author Vova Feldman (@svovaf)
|
2918 |
-
* @since 1.0.6
|
2919 |
-
*
|
2920 |
-
* @param string|number $id_or_slug
|
2921 |
-
*
|
2922 |
-
* @return false|Freemius
|
2923 |
-
*/
|
2924 |
-
function get_addon_instance( $id_or_slug ) {
|
2925 |
-
$addon_id = self::get_module_id( $id_or_slug );
|
2926 |
-
|
2927 |
-
return self::instance( $addon_id );
|
2928 |
-
}
|
2929 |
-
|
2930 |
-
#endregion ------------------------------------------------------------------
|
2931 |
-
|
2932 |
-
/**
|
2933 |
-
* @author Vova Feldman (@svovaf)
|
2934 |
-
* @since 1.0.6
|
2935 |
-
*
|
2936 |
-
* @return bool
|
2937 |
-
*/
|
2938 |
-
function is_parent_plugin_installed() {
|
2939 |
-
$is_active = self::has_instance( $this->_plugin->parent_plugin_id );
|
2940 |
-
|
2941 |
-
if ( $is_active ) {
|
2942 |
-
return true;
|
2943 |
-
}
|
2944 |
-
|
2945 |
-
/**
|
2946 |
-
* Parent module might be a theme. If that's the case, the add-on's FS
|
2947 |
-
* instance will be loaded prior to the theme's FS instance, therefore,
|
2948 |
-
* we need to check if it's active with a "look ahead".
|
2949 |
-
*
|
2950 |
-
* @author Vova Feldman
|
2951 |
-
* @since 1.2.2.3
|
2952 |
-
*/
|
2953 |
-
global $fs_active_plugins;
|
2954 |
-
if ( is_object( $fs_active_plugins ) && is_array( $fs_active_plugins->plugins ) ) {
|
2955 |
-
$active_theme = wp_get_theme();
|
2956 |
-
|
2957 |
-
foreach ( $fs_active_plugins->plugins as $sdk => $module ) {
|
2958 |
-
if ( WP_FS__MODULE_TYPE_THEME === $module->type ) {
|
2959 |
-
if ( $module->plugin_path == $active_theme->get_stylesheet() ) {
|
2960 |
-
// Parent module is a theme and it's currently active.
|
2961 |
-
return true;
|
2962 |
-
}
|
2963 |
-
}
|
2964 |
-
}
|
2965 |
-
}
|
2966 |
-
|
2967 |
-
return false;
|
2968 |
-
}
|
2969 |
-
|
2970 |
-
/**
|
2971 |
-
* Check if add-on parent plugin in activation mode.
|
2972 |
-
*
|
2973 |
-
* @author Vova Feldman (@svovaf)
|
2974 |
-
* @since 1.0.7
|
2975 |
-
*
|
2976 |
-
* @return bool
|
2977 |
-
*/
|
2978 |
-
function is_parent_in_activation() {
|
2979 |
-
$parent_fs = $this->get_parent_instance();
|
2980 |
-
if ( ! is_object( $parent_fs ) ) {
|
2981 |
-
return false;
|
2982 |
-
}
|
2983 |
-
|
2984 |
-
return ( $parent_fs->is_activation_mode() );
|
2985 |
-
}
|
2986 |
-
|
2987 |
-
/**
|
2988 |
-
* Is plugin in activation mode.
|
2989 |
-
*
|
2990 |
-
* @author Vova Feldman (@svovaf)
|
2991 |
-
* @since 1.0.7
|
2992 |
-
*
|
2993 |
-
* @param bool $and_on
|
2994 |
-
*
|
2995 |
-
* @return bool
|
2996 |
-
*/
|
2997 |
-
function is_activation_mode( $and_on = true ) {
|
2998 |
-
return fs_is_network_admin() ?
|
2999 |
-
$this->is_network_activation_mode( $and_on ) :
|
3000 |
-
$this->is_site_activation_mode( $and_on );
|
3001 |
-
}
|
3002 |
-
|
3003 |
-
/**
|
3004 |
-
* Is plugin in activation mode.
|
3005 |
-
*
|
3006 |
-
* @author Vova Feldman (@svovaf)
|
3007 |
-
* @since 1.0.7
|
3008 |
-
*
|
3009 |
-
* @param bool $and_on
|
3010 |
-
*
|
3011 |
-
* @return bool
|
3012 |
-
*/
|
3013 |
-
function is_site_activation_mode( $and_on = true ) {
|
3014 |
-
return (
|
3015 |
-
( $this->is_on() || ! $and_on ) &&
|
3016 |
-
(
|
3017 |
-
( $this->is_premium() && true === $this->_storage->require_license_activation ) ||
|
3018 |
-
(
|
3019 |
-
( ! $this->is_registered() ||
|
3020 |
-
( $this->is_only_premium() && ! $this->has_features_enabled_license() ) ) &&
|
3021 |
-
( ! $this->is_enable_anonymous() ||
|
3022 |
-
( ! $this->is_anonymous() && ! $this->is_pending_activation() ) )
|
3023 |
-
)
|
3024 |
-
)
|
3025 |
-
);
|
3026 |
-
}
|
3027 |
-
|
3028 |
-
/**
|
3029 |
-
* Checks if the SDK in network activation mode.
|
3030 |
-
*
|
3031 |
-
* @author Leo Fajardo (@leorw)
|
3032 |
-
* @since 2.0.0
|
3033 |
-
*
|
3034 |
-
* @param bool $and_on
|
3035 |
-
*
|
3036 |
-
* @return bool
|
3037 |
-
*/
|
3038 |
-
private function is_network_activation_mode( $and_on = true ) {
|
3039 |
-
if ( ! $this->_is_network_active ) {
|
3040 |
-
// Not network activated.
|
3041 |
-
return false;
|
3042 |
-
}
|
3043 |
-
|
3044 |
-
if ( $this->is_network_upgrade_mode() ) {
|
3045 |
-
// Special flag to enforce network activation mode to decide what to do with the sites that are not yet opted-in nor skipped.
|
3046 |
-
return true;
|
3047 |
-
}
|
3048 |
-
|
3049 |
-
if ( ! $this->is_site_activation_mode( $and_on ) ) {
|
3050 |
-
// Whether the context is single site or the network, if the plugin is no longer in activation mode then it is not in network activation mode as well.
|
3051 |
-
return false;
|
3052 |
-
}
|
3053 |
-
|
3054 |
-
if ( $this->is_network_delegated_connection() ) {
|
3055 |
-
// Super-admin delegated the connection to the site admins -> not activation mode.
|
3056 |
-
return false;
|
3057 |
-
}
|
3058 |
-
|
3059 |
-
if ( $this->is_network_anonymous() && true !== $this->_storage->require_license_activation ) {
|
3060 |
-
// Super-admin skipped the connection network wide -> not activation mode.
|
3061 |
-
return false;
|
3062 |
-
}
|
3063 |
-
|
3064 |
-
if ( $this->is_network_registered() ) {
|
3065 |
-
// Super-admin connected at least one site -> not activation mode.
|
3066 |
-
return false;
|
3067 |
-
}
|
3068 |
-
|
3069 |
-
return true;
|
3070 |
-
}
|
3071 |
-
|
3072 |
-
/**
|
3073 |
-
* Check if current page is the opt-in/pending-activation page.
|
3074 |
-
*
|
3075 |
-
* @author Vova Feldman (@svovaf)
|
3076 |
-
* @since 1.2.1.7
|
3077 |
-
*
|
3078 |
-
* @return bool
|
3079 |
-
*/
|
3080 |
-
function is_activation_page() {
|
3081 |
-
if ( $this->_menu->is_activation_page( $this->show_opt_in_on_themes_page() ) ) {
|
3082 |
-
return true;
|
3083 |
-
}
|
3084 |
-
|
3085 |
-
if ( ! $this->is_activation_mode() ) {
|
3086 |
-
return false;
|
3087 |
-
}
|
3088 |
-
|
3089 |
-
// Check if current page is matching the activation page.
|
3090 |
-
return $this->is_matching_url( $this->get_activation_url() );
|
3091 |
-
}
|
3092 |
-
|
3093 |
-
/**
|
3094 |
-
* Check if URL path's are matching and that all querystring
|
3095 |
-
* arguments of the $sub_url exist in the $url with the same values.
|
3096 |
-
*
|
3097 |
-
* WARNING:
|
3098 |
-
* 1. This method doesn't check if the sub/domain are matching.
|
3099 |
-
* 2. Ignore case sensitivity.
|
3100 |
-
*
|
3101 |
-
* @author Vova Feldman (@svovaf)
|
3102 |
-
* @since 1.2.1.7
|
3103 |
-
*
|
3104 |
-
* @param string $sub_url
|
3105 |
-
* @param string $url If argument is not set, check if the sub_url matching the current's page URL.
|
3106 |
-
*
|
3107 |
-
* @return bool
|
3108 |
-
*/
|
3109 |
-
private function is_matching_url( $sub_url, $url = '' ) {
|
3110 |
-
if ( empty( $url ) ) {
|
3111 |
-
$url = $_SERVER['REQUEST_URI'];
|
3112 |
-
}
|
3113 |
-
|
3114 |
-
$url = strtolower( $url );
|
3115 |
-
$sub_url = strtolower( $sub_url );
|
3116 |
-
|
3117 |
-
if ( parse_url( $sub_url, PHP_URL_PATH ) !== parse_url( $url, PHP_URL_PATH ) ) {
|
3118 |
-
// Different path - DO NOT OVERRIDE PAGE.
|
3119 |
-
return false;
|
3120 |
-
}
|
3121 |
-
|
3122 |
-
$url_params = array();
|
3123 |
-
parse_str( parse_url( $url, PHP_URL_QUERY ), $url_params );
|
3124 |
-
|
3125 |
-
$sub_url_params = array();
|
3126 |
-
parse_str( parse_url( $sub_url, PHP_URL_QUERY ), $sub_url_params );
|
3127 |
-
|
3128 |
-
foreach ( $sub_url_params as $key => $val ) {
|
3129 |
-
if ( ! isset( $url_params[ $key ] ) || $val != $url_params[ $key ] ) {
|
3130 |
-
// Not matching query string - DO NOT OVERRIDE PAGE.
|
3131 |
-
return false;
|
3132 |
-
}
|
3133 |
-
}
|
3134 |
-
|
3135 |
-
return true;
|
3136 |
-
}
|
3137 |
-
|
3138 |
-
/**
|
3139 |
-
* Get the basenames of all active plugins for specific blog. Including network activated plugins.
|
3140 |
-
*
|
3141 |
-
* @author Vova Feldman (@svovaf)
|
3142 |
-
* @since 2.0.0
|
3143 |
-
*
|
3144 |
-
* @param int $blog_id
|
3145 |
-
*
|
3146 |
-
* @return string[]
|
3147 |
-
*/
|
3148 |
-
private static function get_active_plugins_basenames( $blog_id = 0 ) {
|
3149 |
-
if ( is_multisite() && $blog_id > 0 ) {
|
3150 |
-
$active_basenames = get_blog_option( $blog_id, 'active_plugins' );
|
3151 |
-
} else {
|
3152 |
-
$active_basenames = get_option( 'active_plugins' );
|
3153 |
-
}
|
3154 |
-
|
3155 |
-
if ( ! is_array( $active_basenames ) ) {
|
3156 |
-
$active_basenames = array();
|
3157 |
-
}
|
3158 |
-
|
3159 |
-
if ( is_multisite() ) {
|
3160 |
-
$network_active_basenames = get_site_option( 'active_sitewide_plugins' );
|
3161 |
-
|
3162 |
-
if ( is_array( $network_active_basenames ) && ! empty( $network_active_basenames ) ) {
|
3163 |
-
$active_basenames = array_merge( $active_basenames, array_keys( $network_active_basenames ) );
|
3164 |
-
}
|
3165 |
-
}
|
3166 |
-
|
3167 |
-
return $active_basenames;
|
3168 |
-
}
|
3169 |
-
|
3170 |
-
/**
|
3171 |
-
* @author Leo Fajardo (@leorw)
|
3172 |
-
* @since 2.3.0
|
3173 |
-
*
|
3174 |
-
* @param int $blog_id
|
3175 |
-
*
|
3176 |
-
* @return array
|
3177 |
-
*/
|
3178 |
-
static function get_active_plugins_directories_map( $blog_id = 0 ) {
|
3179 |
-
$active_basenames = self::get_active_plugins_basenames( $blog_id );
|
3180 |
-
|
3181 |
-
$map = array();
|
3182 |
-
|
3183 |
-
foreach ( $active_basenames as $active_basename ) {
|
3184 |
-
$active_basename = fs_normalize_path( $active_basename );
|
3185 |
-
|
3186 |
-
if ( false === strpos( $active_basename, '/' ) ) {
|
3187 |
-
continue;
|
3188 |
-
}
|
3189 |
-
|
3190 |
-
$map[ dirname( $active_basename ) ] = true;
|
3191 |
-
}
|
3192 |
-
|
3193 |
-
return $map;
|
3194 |
-
}
|
3195 |
-
|
3196 |
-
/**
|
3197 |
-
* Get collection of all active plugins. Including network activated plugins.
|
3198 |
-
*
|
3199 |
-
* @author Vova Feldman (@svovaf)
|
3200 |
-
* @since 1.0.9
|
3201 |
-
*
|
3202 |
-
* @param int $blog_id Since 2.0.0
|
3203 |
-
*
|
3204 |
-
* @return array[string]array
|
3205 |
-
*/
|
3206 |
-
private static function get_active_plugins( $blog_id = 0 ) {
|
3207 |
-
self::require_plugin_essentials();
|
3208 |
-
|
3209 |
-
$active_plugin = array();
|
3210 |
-
$all_plugins = fs_get_plugins();
|
3211 |
-
$active_plugins_basenames = self::get_active_plugins_basenames( $blog_id );
|
3212 |
-
|
3213 |
-
foreach ( $active_plugins_basenames as $plugin_basename ) {
|
3214 |
-
$active_plugin[ $plugin_basename ] = $all_plugins[ $plugin_basename ];
|
3215 |
-
}
|
3216 |
-
|
3217 |
-
return $active_plugin;
|
3218 |
-
}
|
3219 |
-
|
3220 |
-
/**
|
3221 |
-
* Get collection of all site active plugins for a specified blog.
|
3222 |
-
*
|
3223 |
-
* @author Vova Feldman (@svovaf)
|
3224 |
-
* @since 2.0.0
|
3225 |
-
*
|
3226 |
-
* @param int $blog_id
|
3227 |
-
*
|
3228 |
-
* @return array[string]array
|
3229 |
-
*/
|
3230 |
-
private static function get_site_active_plugins( $blog_id = 0 ) {
|
3231 |
-
$active_basenames = ( is_multisite() && $blog_id > 0 ) ?
|
3232 |
-
get_blog_option( $blog_id, 'active_plugins' ) :
|
3233 |
-
get_option( 'active_plugins' );
|
3234 |
-
|
3235 |
-
$active = array();
|
3236 |
-
|
3237 |
-
if ( ! is_array( $active_basenames ) ) {
|
3238 |
-
return $active;
|
3239 |
-
}
|
3240 |
-
|
3241 |
-
foreach ( $active_basenames as $basename ) {
|
3242 |
-
$active[ $basename ] = array(
|
3243 |
-
'is_active' => true,
|
3244 |
-
'Version' => '1.0', // Dummy version.
|
3245 |
-
'slug' => self::get_plugin_slug( $basename ),
|
3246 |
-
);
|
3247 |
-
}
|
3248 |
-
|
3249 |
-
return $active;
|
3250 |
-
}
|
3251 |
-
|
3252 |
-
/**
|
3253 |
-
* Get collection of all plugins with their activation status for a specified blog.
|
3254 |
-
*
|
3255 |
-
* @author Vova Feldman (@svovaf)
|
3256 |
-
* @since 1.1.8
|
3257 |
-
*
|
3258 |
-
* @param int $blog_id Since 2.0.0
|
3259 |
-
*
|
3260 |
-
* @return array Key is the plugin file path and the value is an array of the plugin data.
|
3261 |
-
*/
|
3262 |
-
private static function get_all_plugins( $blog_id = 0 ) {
|
3263 |
-
self::require_plugin_essentials();
|
3264 |
-
|
3265 |
-
$all_plugins = fs_get_plugins();
|
3266 |
-
|
3267 |
-
$active_plugins_basenames = self::get_active_plugins_basenames( $blog_id );
|
3268 |
-
|
3269 |
-
foreach ( $all_plugins as $basename => &$data ) {
|
3270 |
-
// By default set to inactive (next foreach update the active plugins).
|
3271 |
-
$data['is_active'] = false;
|
3272 |
-
// Enrich with plugin slug.
|
3273 |
-
$data['slug'] = self::get_plugin_slug( $basename );
|
3274 |
-
}
|
3275 |
-
|
3276 |
-
// Flag active plugins.
|
3277 |
-
foreach ( $active_plugins_basenames as $basename ) {
|
3278 |
-
if ( isset( $all_plugins[ $basename ] ) ) {
|
3279 |
-
$all_plugins[ $basename ]['is_active'] = true;
|
3280 |
-
}
|
3281 |
-
}
|
3282 |
-
|
3283 |
-
return $all_plugins;
|
3284 |
-
}
|
3285 |
-
|
3286 |
-
/**
|
3287 |
-
* Get collection of all plugins and if they are network level activated.
|
3288 |
-
*
|
3289 |
-
* @author Vova Feldman (@svovaf)
|
3290 |
-
* @since 2.0.0
|
3291 |
-
*
|
3292 |
-
* @return array Key is the plugin basename and the value is an array of the plugin data.
|
3293 |
-
*/
|
3294 |
-
private static function get_network_plugins() {
|
3295 |
-
self::require_plugin_essentials();
|
3296 |
-
|
3297 |
-
$all_plugins = fs_get_plugins();
|
3298 |
-
|
3299 |
-
$network_active_basenames = is_multisite() ?
|
3300 |
-
get_site_option( 'active_sitewide_plugins' ) :
|
3301 |
-
array();
|
3302 |
-
|
3303 |
-
foreach ( $all_plugins as $basename => &$data ) {
|
3304 |
-
// By default set to inactive (next foreach update the active plugins).
|
3305 |
-
$data['is_active'] = false;
|
3306 |
-
// Enrich with plugin slug.
|
3307 |
-
$data['slug'] = self::get_plugin_slug( $basename );
|
3308 |
-
}
|
3309 |
-
|
3310 |
-
// Flag active plugins.
|
3311 |
-
foreach ( $network_active_basenames as $basename ) {
|
3312 |
-
if ( isset( $all_plugins[ $basename ] ) ) {
|
3313 |
-
$all_plugins[ $basename ]['is_active'] = true;
|
3314 |
-
}
|
3315 |
-
}
|
3316 |
-
|
3317 |
-
return $all_plugins;
|
3318 |
-
}
|
3319 |
-
|
3320 |
-
/**
|
3321 |
-
* Cached result of get_site_transient( 'update_plugins' )
|
3322 |
-
*
|
3323 |
-
* @author Vova Feldman (@svovaf)
|
3324 |
-
* @since 1.1.8
|
3325 |
-
*
|
3326 |
-
* @var object
|
3327 |
-
*/
|
3328 |
-
private static $_plugins_info;
|
3329 |
-
|
3330 |
-
/**
|
3331 |
-
* Helper function to get specified plugin's slug.
|
3332 |
-
*
|
3333 |
-
* @author Vova Feldman (@svovaf)
|
3334 |
-
* @since 1.1.8
|
3335 |
-
*
|
3336 |
-
* @param $basename
|
3337 |
-
*
|
3338 |
-
* @return string
|
3339 |
-
*/
|
3340 |
-
private static function get_plugin_slug( $basename ) {
|
3341 |
-
if ( ! isset( self::$_plugins_info ) ) {
|
3342 |
-
self::$_plugins_info = get_site_transient( 'update_plugins' );
|
3343 |
-
}
|
3344 |
-
|
3345 |
-
$slug = '';
|
3346 |
-
|
3347 |
-
if ( is_object( self::$_plugins_info ) ) {
|
3348 |
-
if ( isset( self::$_plugins_info->no_update ) &&
|
3349 |
-
isset( self::$_plugins_info->no_update[ $basename ] ) &&
|
3350 |
-
! empty( self::$_plugins_info->no_update[ $basename ]->slug )
|
3351 |
-
) {
|
3352 |
-
$slug = self::$_plugins_info->no_update[ $basename ]->slug;
|
3353 |
-
} else if ( isset( self::$_plugins_info->response ) &&
|
3354 |
-
isset( self::$_plugins_info->response[ $basename ] ) &&
|
3355 |
-
! empty( self::$_plugins_info->response[ $basename ]->slug )
|
3356 |
-
) {
|
3357 |
-
$slug = self::$_plugins_info->response[ $basename ]->slug;
|
3358 |
-
}
|
3359 |
-
}
|
3360 |
-
|
3361 |
-
if ( empty( $slug ) ) {
|
3362 |
-
// Try to find slug from FS data.
|
3363 |
-
$slug = self::find_slug_by_basename( $basename );
|
3364 |
-
}
|
3365 |
-
|
3366 |
-
if ( empty( $slug ) ) {
|
3367 |
-
// Fallback to plugin's folder name.
|
3368 |
-
$slug = dirname( $basename );
|
3369 |
-
}
|
3370 |
-
|
3371 |
-
return $slug;
|
3372 |
-
}
|
3373 |
-
|
3374 |
-
private static $_statics_loaded = false;
|
3375 |
-
|
3376 |
-
/**
|
3377 |
-
* Load static resources.
|
3378 |
-
*
|
3379 |
-
* @author Vova Feldman (@svovaf)
|
3380 |
-
* @since 1.0.1
|
3381 |
-
*/
|
3382 |
-
private static function _load_required_static() {
|
3383 |
-
if ( self::$_statics_loaded ) {
|
3384 |
-
return;
|
3385 |
-
}
|
3386 |
-
|
3387 |
-
self::$_static_logger = FS_Logger::get_logger( WP_FS__SLUG, WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK );
|
3388 |
-
|
3389 |
-
self::$_static_logger->entrance();
|
3390 |
-
|
3391 |
-
self::$_accounts = FS_Options::instance( WP_FS__ACCOUNTS_OPTION_NAME, true );
|
3392 |
-
|
3393 |
-
if ( is_multisite() ) {
|
3394 |
-
$has_skipped_migration = (
|
3395 |
-
// 'id_slug_type_path_map' - was never stored on older versions, therefore, not exists on the site level.
|
3396 |
-
null === self::$_accounts->get_option( 'id_slug_type_path_map', null, false ) &&
|
3397 |
-
// 'file_slug_map' stored on the site level, so it was running an SDK version before it was integrated with MS-network.
|
3398 |
-
null !== self::$_accounts->get_option( 'file_slug_map', null, false )
|
3399 |
-
);
|
3400 |
-
|
3401 |
-
/**
|
3402 |
-
* If the file_slug_map exists on the site level but doesn't exist on the
|
3403 |
-
* network level storage, it means that we need to process the storage with migration.
|
3404 |
-
*
|
3405 |
-
* The code in this `if` scope will only be executed once and only for the first site that will execute it because once we migrate the storage data, file_slug_map will be already set in the network level storage.
|
3406 |
-
*
|
3407 |
-
* @author Vova Feldman (@svovaf)
|
3408 |
-
* @since 2.0.0
|
3409 |
-
*/
|
3410 |
-
if (
|
3411 |
-
( $has_skipped_migration && true !== self::$_accounts->get_option( 'ms_migration_complete', false, true ) ) ||
|
3412 |
-
( null === self::$_accounts->get_option( 'file_slug_map', null, true ) &&
|
3413 |
-
null !== self::$_accounts->get_option( 'file_slug_map', null, false ) )
|
3414 |
-
) {
|
3415 |
-
self::migrate_options_to_network();
|
3416 |
-
}
|
3417 |
-
}
|
3418 |
-
|
3419 |
-
self::$_global_admin_notices = FS_Admin_Notices::instance( 'global' );
|
3420 |
-
|
3421 |
-
if ( ! WP_FS__DEMO_MODE ) {
|
3422 |
-
add_action( ( fs_is_network_admin() ? 'network_' : '' ) . 'admin_menu', array(
|
3423 |
-
'Freemius',
|
3424 |
-
'_add_debug_section'
|
3425 |
-
) );
|
3426 |
-
}
|
3427 |
-
|
3428 |
-
add_action( "wp_ajax_fs_toggle_debug_mode", array( 'Freemius', '_toggle_debug_mode' ) );
|
3429 |
-
|
3430 |
-
self::add_ajax_action_static( 'get_debug_log', array( 'Freemius', '_get_debug_log' ) );
|
3431 |
-
|
3432 |
-
self::add_ajax_action_static( 'get_db_option', array( 'Freemius', '_get_db_option' ) );
|
3433 |
-
|
3434 |
-
self::add_ajax_action_static( 'set_db_option', array( 'Freemius', '_set_db_option' ) );
|
3435 |
-
|
3436 |
-
if ( 0 == did_action( 'plugins_loaded' ) ) {
|
3437 |
-
add_action( 'plugins_loaded', array( 'Freemius', '_load_textdomain' ), 1 );
|
3438 |
-
}
|
3439 |
-
|
3440 |
-
add_action( 'admin_footer', array( 'Freemius', '_enrich_ajax_url' ) );
|
3441 |
-
add_action( 'admin_footer', array( 'Freemius', '_open_support_forum_in_new_page' ) );
|
3442 |
-
|
3443 |
-
if ( self::is_plugins_page() || self::is_themes_page() ) {
|
3444 |
-
add_action( 'admin_print_footer_scripts', array( 'Freemius', '_maybe_add_beta_label_styles' ), 9 );
|
3445 |
-
|
3446 |
-
/**
|
3447 |
-
* Specifically use this hook so that the JS event handlers will work properly on the "Themes"
|
3448 |
-
* page.
|
3449 |
-
*
|
3450 |
-
* @author Leo Fajardo (@leorw)
|
3451 |
-
* @since 2.3.0
|
3452 |
-
*/
|
3453 |
-
add_action( 'admin_footer-' . self::get_current_page(), array( 'Freemius', '_maybe_add_beta_label_to_plugins_and_handle_confirmation') );
|
3454 |
-
}
|
3455 |
-
|
3456 |
-
self::$_statics_loaded = true;
|
3457 |
-
}
|
3458 |
-
|
3459 |
-
/**
|
3460 |
-
* @author Leo Fajardo (@leorw)
|
3461 |
-
*
|
3462 |
-
* @since 2.1.3
|
3463 |
-
*/
|
3464 |
-
private static function migrate_options_to_network() {
|
3465 |
-
self::migrate_accounts_to_network();
|
3466 |
-
|
3467 |
-
// Migrate API options from site level to network level.
|
3468 |
-
$api_network_options = FS_Option_Manager::get_manager( WP_FS__OPTIONS_OPTION_NAME, true, true );
|
3469 |
-
$api_network_options->migrate_to_network();
|
3470 |
-
|
3471 |
-
// Migrate API cache to network level storage.
|
3472 |
-
FS_Cache_Manager::get_manager( WP_FS__API_CACHE_OPTION_NAME )->migrate_to_network();
|
3473 |
-
|
3474 |
-
self::$_accounts->set_option( 'ms_migration_complete', true, true );
|
3475 |
-
}
|
3476 |
-
|
3477 |
-
#----------------------------------------------------------------------------------
|
3478 |
-
#region Localization
|
3479 |
-
#----------------------------------------------------------------------------------
|
3480 |
-
|
3481 |
-
/**
|
3482 |
-
* Load framework's text domain.
|
3483 |
-
*
|
3484 |
-
* @author Vova Feldman (@svovaf)
|
3485 |
-
* @since 1.2.1
|
3486 |
-
*/
|
3487 |
-
static function _load_textdomain() {
|
3488 |
-
if ( ! is_admin() ) {
|
3489 |
-
return;
|
3490 |
-
}
|
3491 |
-
|
3492 |
-
global $fs_active_plugins;
|
3493 |
-
|
3494 |
-
// Works both for plugins and themes.
|
3495 |
-
load_plugin_textdomain(
|
3496 |
-
'freemius',
|
3497 |
-
false,
|
3498 |
-
$fs_active_plugins->newest->sdk_path . '/languages/'
|
3499 |
-
);
|
3500 |
-
}
|
3501 |
-
|
3502 |
-
#endregion
|
3503 |
-
|
3504 |
-
#----------------------------------------------------------------------------------
|
3505 |
-
#region Debugging
|
3506 |
-
#----------------------------------------------------------------------------------
|
3507 |
-
|
3508 |
-
/**
|
3509 |
-
* @author Vova Feldman (@svovaf)
|
3510 |
-
* @since 1.0.8
|
3511 |
-
*/
|
3512 |
-
static function _add_debug_section() {
|
3513 |
-
if ( ! is_super_admin() ) {
|
3514 |
-
// Add debug page only for super-admins.
|
3515 |
-
return;
|
3516 |
-
}
|
3517 |
-
|
3518 |
-
self::$_static_logger->entrance();
|
3519 |
-
|
3520 |
-
$title = sprintf( '%s [v.%s]', fs_text_inline( 'Freemius Debug' ), WP_FS__SDK_VERSION );
|
3521 |
-
|
3522 |
-
if ( WP_FS__DEV_MODE ) {
|
3523 |
-
// Add top-level debug menu item.
|
3524 |
-
$hook = FS_Admin_Menu_Manager::add_page(
|
3525 |
-
$title,
|
3526 |
-
$title,
|
3527 |
-
'manage_options',
|
3528 |
-
'freemius',
|
3529 |
-
array( 'Freemius', '_debug_page_render' )
|
3530 |
-
);
|
3531 |
-
} else {
|
3532 |
-
// Add hidden debug page.
|
3533 |
-
$hook = FS_Admin_Menu_Manager::add_subpage(
|
3534 |
-
null,
|
3535 |
-
$title,
|
3536 |
-
$title,
|
3537 |
-
'manage_options',
|
3538 |
-
'freemius',
|
3539 |
-
array( 'Freemius', '_debug_page_render' )
|
3540 |
-
);
|
3541 |
-
}
|
3542 |
-
|
3543 |
-
if ( ! empty( $hook ) ) {
|
3544 |
-
add_action( "load-$hook", array( 'Freemius', '_debug_page_actions' ) );
|
3545 |
-
}
|
3546 |
-
}
|
3547 |
-
|
3548 |
-
/**
|
3549 |
-
* @author Vova Feldman (@svovaf)
|
3550 |
-
* @since 1.1.7.3
|
3551 |
-
*/
|
3552 |
-
static function _toggle_debug_mode() {
|
3553 |
-
check_admin_referer( 'fs_toggle_debug_mode' );
|
3554 |
-
|
3555 |
-
if ( ! is_super_admin() ) {
|
3556 |
-
return;
|
3557 |
-
}
|
3558 |
-
|
3559 |
-
$is_on = fs_request_get( 'is_on', false, 'post' );
|
3560 |
-
|
3561 |
-
if ( fs_request_is_post() && in_array( $is_on, array( 0, 1 ) ) ) {
|
3562 |
-
update_option( 'fs_debug_mode', $is_on );
|
3563 |
-
|
3564 |
-
// Turn on/off storage logging.
|
3565 |
-
FS_Logger::_set_storage_logging( ( 1 == $is_on ) );
|
3566 |
-
}
|
3567 |
-
|
3568 |
-
exit;
|
3569 |
-
}
|
3570 |
-
|
3571 |
-
/**
|
3572 |
-
* @author Vova Feldman (@svovaf)
|
3573 |
-
* @since 1.2.1.6
|
3574 |
-
*/
|
3575 |
-
static function _get_debug_log() {
|
3576 |
-
check_admin_referer( 'fs_get_debug_log' );
|
3577 |
-
|
3578 |
-
if ( ! is_super_admin() ) {
|
3579 |
-
return;
|
3580 |
-
}
|
3581 |
-
|
3582 |
-
$limit = min( ! empty( $_POST['limit'] ) ? absint( $_POST['limit'] ) : 200, 200 );
|
3583 |
-
$offset = min( ! empty( $_POST['offset'] ) ? absint( $_POST['offset'] ) : 200, 200 );
|
3584 |
-
|
3585 |
-
$logs = FS_Logger::load_db_logs(
|
3586 |
-
fs_request_get( 'filters', false, 'post' ),
|
3587 |
-
$limit,
|
3588 |
-
$offset
|
3589 |
-
);
|
3590 |
-
|
3591 |
-
self::shoot_ajax_success( $logs );
|
3592 |
-
}
|
3593 |
-
|
3594 |
-
/**
|
3595 |
-
* @author Vova Feldman (@svovaf)
|
3596 |
-
* @since 1.2.1.7
|
3597 |
-
*/
|
3598 |
-
static function _get_db_option() {
|
3599 |
-
check_admin_referer( 'fs_get_db_option' );
|
3600 |
-
|
3601 |
-
$option_name = fs_request_get( 'option_name' );
|
3602 |
-
|
3603 |
-
if ( ! is_super_admin() ||
|
3604 |
-
! fs_starts_with( $option_name, 'fs_' )
|
3605 |
-
) {
|
3606 |
-
self::shoot_ajax_failure();
|
3607 |
-
}
|
3608 |
-
|
3609 |
-
$value = get_option( $option_name );
|
3610 |
-
|
3611 |
-
$result = array(
|
3612 |
-
'name' => $option_name,
|
3613 |
-
);
|
3614 |
-
|
3615 |
-
if ( false !== $value ) {
|
3616 |
-
if ( ! is_string( $value ) ) {
|
3617 |
-
$value = json_encode( $value );
|
3618 |
-
}
|
3619 |
-
|
3620 |
-
$result['value'] = $value;
|
3621 |
-
}
|
3622 |
-
|
3623 |
-
self::shoot_ajax_success( $result );
|
3624 |
-
}
|
3625 |
-
|
3626 |
-
/**
|
3627 |
-
* @author Vova Feldman (@svovaf)
|
3628 |
-
* @since 1.2.1.7
|
3629 |
-
*/
|
3630 |
-
static function _set_db_option() {
|
3631 |
-
check_admin_referer( 'fs_set_db_option' );
|
3632 |
-
|
3633 |
-
$option_name = fs_request_get( 'option_name' );
|
3634 |
-
|
3635 |
-
if ( ! is_super_admin() ||
|
3636 |
-
! fs_starts_with( $option_name, 'fs_' )
|
3637 |
-
) {
|
3638 |
-
self::shoot_ajax_failure();
|
3639 |
-
}
|
3640 |
-
|
3641 |
-
$option_value = fs_request_get( 'option_value' );
|
3642 |
-
|
3643 |
-
if ( ! empty( $option_value ) ) {
|
3644 |
-
update_option( $option_name, $option_value );
|
3645 |
-
}
|
3646 |
-
|
3647 |
-
self::shoot_ajax_success();
|
3648 |
-
}
|
3649 |
-
|
3650 |
-
/**
|
3651 |
-
* @author Vova Feldman (@svovaf)
|
3652 |
-
* @since 1.0.8
|
3653 |
-
*/
|
3654 |
-
static function _debug_page_actions() {
|
3655 |
-
self::_clean_admin_content_section();
|
3656 |
-
|
3657 |
-
if ( fs_request_is_action( 'restart_freemius' ) ) {
|
3658 |
-
check_admin_referer( 'restart_freemius' );
|
3659 |
-
|
3660 |
-
if ( ! is_multisite() ) {
|
3661 |
-
// Clear accounts data.
|
3662 |
-
self::$_accounts->clear( null, true );
|
3663 |
-
} else {
|
3664 |
-
$sites = self::get_sites();
|
3665 |
-
foreach ( $sites as $site ) {
|
3666 |
-
$blog_id = self::get_site_blog_id( $site );
|
3667 |
-
self::$_accounts->clear( $blog_id, true );
|
3668 |
-
}
|
3669 |
-
|
3670 |
-
// Clear network level storage.
|
3671 |
-
self::$_accounts->clear( true, true );
|
3672 |
-
}
|
3673 |
-
|
3674 |
-
// Clear SDK reference cache.
|
3675 |
-
delete_option( 'fs_active_plugins' );
|
3676 |
-
} else if ( fs_request_is_action( 'clear_updates_data' ) ) {
|
3677 |
-
check_admin_referer( 'clear_updates_data' );
|
3678 |
-
|
3679 |
-
if ( ! is_multisite() ) {
|
3680 |
-
set_site_transient( 'update_plugins', null );
|
3681 |
-
set_site_transient( 'update_themes', null );
|
3682 |
-
} else {
|
3683 |
-
$current_blog_id = get_current_blog_id();
|
3684 |
-
|
3685 |
-
$sites = self::get_sites();
|
3686 |
-
foreach ( $sites as $site ) {
|
3687 |
-
switch_to_blog( self::get_site_blog_id( $site ) );
|
3688 |
-
|
3689 |
-
set_site_transient( 'update_plugins', null );
|
3690 |
-
set_site_transient( 'update_themes', null );
|
3691 |
-
}
|
3692 |
-
|
3693 |
-
switch_to_blog( $current_blog_id );
|
3694 |
-
}
|
3695 |
-
} else if ( fs_request_is_action( 'simulate_trial' ) ) {
|
3696 |
-
check_admin_referer( 'simulate_trial' );
|
3697 |
-
|
3698 |
-
$fs = freemius( fs_request_get( 'module_id' ) );
|
3699 |
-
|
3700 |
-
// Update SDK install to at least 24 hours before.
|
3701 |
-
$fs->_storage->install_timestamp = ( time() - WP_FS__TIME_24_HOURS_IN_SEC );
|
3702 |
-
// Unset the trial shown timestamp.
|
3703 |
-
unset( $fs->_storage->trial_promotion_shown );
|
3704 |
-
} else if ( fs_request_is_action( 'simulate_network_upgrade' ) ) {
|
3705 |
-
check_admin_referer( 'simulate_network_upgrade' );
|
3706 |
-
|
3707 |
-
$fs = freemius( fs_request_get( 'module_id' ) );
|
3708 |
-
|
3709 |
-
self::set_network_upgrade_mode( $fs->_storage );
|
3710 |
-
} else if ( fs_request_is_action( 'delete_install' ) ) {
|
3711 |
-
check_admin_referer( 'delete_install' );
|
3712 |
-
|
3713 |
-
self::_delete_site_by_slug(
|
3714 |
-
fs_request_get( 'slug' ),
|
3715 |
-
fs_request_get( 'module_type' ),
|
3716 |
-
true,
|
3717 |
-
fs_request_get( 'blog_id', null )
|
3718 |
-
);
|
3719 |
-
} else if ( fs_request_is_action( 'delete_user' ) ) {
|
3720 |
-
check_admin_referer( 'delete_user' );
|
3721 |
-
|
3722 |
-
self::delete_user( fs_request_get( 'user_id' ) );
|
3723 |
-
} else if ( fs_request_is_action( 'download_logs' ) ) {
|
3724 |
-
check_admin_referer( 'download_logs' );
|
3725 |
-
|
3726 |
-
$download_url = FS_Logger::download_db_logs(
|
3727 |
-
fs_request_get( 'filters', false, 'post' )
|
3728 |
-
);
|
3729 |
-
|
3730 |
-
if ( false === $download_url ) {
|
3731 |
-
wp_die( 'Oops... there was an error while generating the logs download file. Please try again and if it doesn\'t work contact support@freemius.com.' );
|
3732 |
-
}
|
3733 |
-
|
3734 |
-
fs_redirect( $download_url );
|
3735 |
-
} else if ( fs_request_is_action( 'migrate_options_to_network' ) ) {
|
3736 |
-
check_admin_referer( 'migrate_options_to_network' );
|
3737 |
-
|
3738 |
-
self::migrate_options_to_network();
|
3739 |
-
}
|
3740 |
-
}
|
3741 |
-
|
3742 |
-
/**
|
3743 |
-
* @author Vova Feldman (@svovaf)
|
3744 |
-
* @since 1.0.8
|
3745 |
-
*/
|
3746 |
-
static function _debug_page_render() {
|
3747 |
-
self::$_static_logger->entrance();
|
3748 |
-
|
3749 |
-
if ( ! is_multisite() ) {
|
3750 |
-
$all_plugins_installs = self::get_all_sites( WP_FS__MODULE_TYPE_PLUGIN );
|
3751 |
-
$all_themes_installs = self::get_all_sites( WP_FS__MODULE_TYPE_THEME );
|
3752 |
-
} else {
|
3753 |
-
$sites = self::get_sites();
|
3754 |
-
|
3755 |
-
$all_plugins_installs = array();
|
3756 |
-
$all_themes_installs = array();
|
3757 |
-
|
3758 |
-
foreach ( $sites as $site ) {
|
3759 |
-
$blog_id = self::get_site_blog_id( $site );
|
3760 |
-
|
3761 |
-
$plugins_installs = self::get_all_sites( WP_FS__MODULE_TYPE_PLUGIN, $blog_id );
|
3762 |
-
|
3763 |
-
foreach ( $plugins_installs as $slug => $install ) {
|
3764 |
-
if ( ! isset( $all_plugins_installs[ $slug ] ) ) {
|
3765 |
-
$all_plugins_installs[ $slug ] = array();
|
3766 |
-
}
|
3767 |
-
|
3768 |
-
$install->blog_id = $blog_id;
|
3769 |
-
|
3770 |
-
$all_plugins_installs[ $slug ][] = $install;
|
3771 |
-
}
|
3772 |
-
|
3773 |
-
$themes_installs = self::get_all_sites( WP_FS__MODULE_TYPE_THEME, $blog_id );
|
3774 |
-
|
3775 |
-
foreach ( $themes_installs as $slug => $install ) {
|
3776 |
-
if ( ! isset( $all_themes_installs[ $slug ] ) ) {
|
3777 |
-
$all_themes_installs[ $slug ] = array();
|
3778 |
-
}
|
3779 |
-
|
3780 |
-
$install->blog_id = $blog_id;
|
3781 |
-
|
3782 |
-
$all_themes_installs[ $slug ][] = $install;
|
3783 |
-
}
|
3784 |
-
}
|
3785 |
-
}
|
3786 |
-
|
3787 |
-
$licenses_by_module_type = self::get_all_licenses_by_module_type();
|
3788 |
-
|
3789 |
-
$vars = array(
|
3790 |
-
'plugin_sites' => $all_plugins_installs,
|
3791 |
-
'theme_sites' => $all_themes_installs,
|
3792 |
-
'users' => self::get_all_users(),
|
3793 |
-
'addons' => self::get_all_addons(),
|
3794 |
-
'account_addons' => self::get_all_account_addons(),
|
3795 |
-
'plugin_licenses' => $licenses_by_module_type[ WP_FS__MODULE_TYPE_PLUGIN ],
|
3796 |
-
'theme_licenses' => $licenses_by_module_type[ WP_FS__MODULE_TYPE_THEME ]
|
3797 |
-
);
|
3798 |
-
|
3799 |
-
fs_enqueue_local_style( 'fs_debug', '/admin/debug.css' );
|
3800 |
-
fs_require_once_template( 'debug.php', $vars );
|
3801 |
-
}
|
3802 |
-
|
3803 |
-
#endregion
|
3804 |
-
|
3805 |
-
#----------------------------------------------------------------------------------
|
3806 |
-
#region Connectivity Issues
|
3807 |
-
#----------------------------------------------------------------------------------
|
3808 |
-
|
3809 |
-
/**
|
3810 |
-
* Check if Freemius should be turned on for the current plugin install.
|
3811 |
-
*
|
3812 |
-
* Note:
|
3813 |
-
* $this->_is_on is updated in has_api_connectivity()
|
3814 |
-
*
|
3815 |
-
* @author Vova Feldman (@svovaf)
|
3816 |
-
* @since 1.0.9
|
3817 |
-
*
|
3818 |
-
* @return bool
|
3819 |
-
*/
|
3820 |
-
function is_on() {
|
3821 |
-
self::$_static_logger->entrance();
|
3822 |
-
|
3823 |
-
if ( isset( $this->_is_on ) ) {
|
3824 |
-
return $this->_is_on;
|
3825 |
-
}
|
3826 |
-
|
3827 |
-
// If already installed or pending then sure it's on :)
|
3828 |
-
if ( $this->is_registered() || $this->is_pending_activation() ) {
|
3829 |
-
$this->_is_on = true;
|
3830 |
-
|
3831 |
-
return true;
|
3832 |
-
}
|
3833 |
-
|
3834 |
-
return false;
|
3835 |
-
}
|
3836 |
-
|
3837 |
-
/**
|
3838 |
-
* @author Vova Feldman (@svovaf)
|
3839 |
-
* @since 1.1.7.3
|
3840 |
-
*
|
3841 |
-
* @param bool $flush_if_no_connectivity
|
3842 |
-
*
|
3843 |
-
* @return bool
|
3844 |
-
*/
|
3845 |
-
private function should_run_connectivity_test( $flush_if_no_connectivity = false ) {
|
3846 |
-
if ( ! isset( $this->_storage->connectivity_test ) ) {
|
3847 |
-
// Connectivity test was never executed, or cache was cleared.
|
3848 |
-
return true;
|
3849 |
-
}
|
3850 |
-
|
3851 |
-
if ( WP_FS__PING_API_ON_IP_OR_HOST_CHANGES ) {
|
3852 |
-
if ( WP_FS__IS_HTTP_REQUEST ) {
|
3853 |
-
if ( $_SERVER['HTTP_HOST'] != $this->_storage->connectivity_test['host'] ) {
|
3854 |
-
// Domain changed.
|
3855 |
-
return true;
|
3856 |
-
}
|
3857 |
-
|
3858 |
-
if ( WP_FS__REMOTE_ADDR != $this->_storage->connectivity_test['server_ip'] ) {
|
3859 |
-
// Server IP changed.
|
3860 |
-
return true;
|
3861 |
-
}
|
3862 |
-
}
|
3863 |
-
}
|
3864 |
-
|
3865 |
-
if ( $this->_storage->connectivity_test['is_connected'] &&
|
3866 |
-
$this->_storage->connectivity_test['is_active']
|
3867 |
-
) {
|
3868 |
-
// API connected and Freemius is active - no need to run connectivity check.
|
3869 |
-
return false;
|
3870 |
-
}
|
3871 |
-
|
3872 |
-
if ( $flush_if_no_connectivity ) {
|
3873 |
-
/**
|
3874 |
-
* If explicitly asked to flush when no connectivity - do it only
|
3875 |
-
* if at least 10 sec passed from the last API connectivity test.
|
3876 |
-
*/
|
3877 |
-
return ( isset( $this->_storage->connectivity_test['timestamp'] ) &&
|
3878 |
-
( WP_FS__SCRIPT_START_TIME - $this->_storage->connectivity_test['timestamp'] ) > 10 );
|
3879 |
-
}
|
3880 |
-
|
3881 |
-
/**
|
3882 |
-
* @since 1.1.7 Don't check for connectivity on plugin downgrade.
|
3883 |
-
*/
|
3884 |
-
$version = $this->get_plugin_version();
|
3885 |
-
if ( version_compare( $version, $this->_storage->connectivity_test['version'], '>' ) ) {
|
3886 |
-
// If it's a plugin version upgrade and Freemius is off or no connectivity, run connectivity test.
|
3887 |
-
return true;
|
3888 |
-
}
|
3889 |
-
|
3890 |
-
return false;
|
3891 |
-
}
|
3892 |
-
|
3893 |
-
/**
|
3894 |
-
* @author Vova Feldman (@svovaf)
|
3895 |
-
* @since 1.1.7.4
|
3896 |
-
*
|
3897 |
-
* @param int|null $blog_id Since 2.0.0.
|
3898 |
-
* @param bool $is_gdpr_test Since 2.0.2. Perform only the GDPR test.
|
3899 |
-
*
|
3900 |
-
* @return object|false
|
3901 |
-
*/
|
3902 |
-
private function ping( $blog_id = null, $is_gdpr_test = false ) {
|
3903 |
-
if ( WP_FS__SIMULATE_NO_API_CONNECTIVITY ) {
|
3904 |
-
return false;
|
3905 |
-
}
|
3906 |
-
|
3907 |
-
$version = $this->get_plugin_version();
|
3908 |
-
|
3909 |
-
$is_update = $this->apply_filters( 'is_plugin_update', $this->is_plugin_update() );
|
3910 |
-
|
3911 |
-
return $this->get_api_plugin_scope()->ping(
|
3912 |
-
$this->get_anonymous_id( $blog_id ),
|
3913 |
-
array(
|
3914 |
-
'is_update' => json_encode( $is_update ),
|
3915 |
-
'version' => $version,
|
3916 |
-
'sdk' => $this->version,
|
3917 |
-
'is_admin' => json_encode( is_admin() ),
|
3918 |
-
'is_ajax' => json_encode( self::is_ajax() ),
|
3919 |
-
'is_cron' => json_encode( self::is_cron() ),
|
3920 |
-
'is_gdpr_test' => $is_gdpr_test,
|
3921 |
-
'is_http' => json_encode( WP_FS__IS_HTTP_REQUEST ),
|
3922 |
-
)
|
3923 |
-
);
|
3924 |
-
}
|
3925 |
-
|
3926 |
-
/**
|
3927 |
-
* Check if there's any connectivity issue to Freemius API.
|
3928 |
-
*
|
3929 |
-
* @author Vova Feldman (@svovaf)
|
3930 |
-
* @since 1.0.9
|
3931 |
-
*
|
3932 |
-
* @param bool $flush_if_no_connectivity
|
3933 |
-
*
|
3934 |
-
* @return bool
|
3935 |
-
*/
|
3936 |
-
function has_api_connectivity( $flush_if_no_connectivity = false ) {
|
3937 |
-
$this->_logger->entrance();
|
3938 |
-
|
3939 |
-
if ( isset( $this->_has_api_connection ) && ( $this->_has_api_connection || ! $flush_if_no_connectivity ) ) {
|
3940 |
-
return $this->_has_api_connection;
|
3941 |
-
}
|
3942 |
-
|
3943 |
-
if ( WP_FS__SIMULATE_NO_API_CONNECTIVITY &&
|
3944 |
-
isset( $this->_storage->connectivity_test ) &&
|
3945 |
-
true === $this->_storage->connectivity_test['is_connected']
|
3946 |
-
) {
|
3947 |
-
unset( $this->_storage->connectivity_test );
|
3948 |
-
}
|
3949 |
-
|
3950 |
-
if ( ! $this->should_run_connectivity_test( $flush_if_no_connectivity ) ) {
|
3951 |
-
$this->_has_api_connection = $this->_storage->connectivity_test['is_connected'];
|
3952 |
-
/**
|
3953 |
-
* @since 1.1.6 During dev mode, if there's connectivity - turn Freemius on regardless the configuration.
|
3954 |
-
*
|
3955 |
-
* @since 1.2.1.5 If the user running the premium version then ignore the 'is_active' flag and turn Freemius on to enable license key activation.
|
3956 |
-
*/
|
3957 |
-
$this->_is_on = $this->_storage->connectivity_test['is_active'] ||
|
3958 |
-
$this->is_premium() ||
|
3959 |
-
( WP_FS__DEV_MODE && $this->_has_api_connection && ! WP_FS__SIMULATE_FREEMIUS_OFF );
|
3960 |
-
|
3961 |
-
return $this->_has_api_connection;
|
3962 |
-
}
|
3963 |
-
|
3964 |
-
$pong = $this->ping();
|
3965 |
-
$is_connected = $this->get_api_plugin_scope()->is_valid_ping( $pong );
|
3966 |
-
|
3967 |
-
if ( ! $is_connected ) {
|
3968 |
-
// API failure.
|
3969 |
-
$this->_add_connectivity_issue_message( $pong );
|
3970 |
-
}
|
3971 |
-
|
3972 |
-
if ( $is_connected ) {
|
3973 |
-
FS_GDPR_Manager::instance()->store_is_required( $pong->is_gdpr_required );
|
3974 |
-
}
|
3975 |
-
|
3976 |
-
$this->store_connectivity_info( $pong, $is_connected );
|
3977 |
-
|
3978 |
-
return $this->_has_api_connection;
|
3979 |
-
}
|
3980 |
-
|
3981 |
-
/**
|
3982 |
-
* @author Vova Feldman (@svovaf)
|
3983 |
-
* @since 1.1.7.4
|
3984 |
-
*
|
3985 |
-
* @param object $pong
|
3986 |
-
* @param bool $is_connected
|
3987 |
-
*/
|
3988 |
-
private function store_connectivity_info( $pong, $is_connected ) {
|
3989 |
-
$this->_logger->entrance();
|
3990 |
-
|
3991 |
-
$version = $this->get_plugin_version();
|
3992 |
-
|
3993 |
-
if ( ! $is_connected || WP_FS__SIMULATE_FREEMIUS_OFF ) {
|
3994 |
-
$is_active = false;
|
3995 |
-
} else {
|
3996 |
-
$is_active = ( isset( $pong->is_active ) && true == $pong->is_active );
|
3997 |
-
}
|
3998 |
-
|
3999 |
-
$is_active = $this->apply_filters(
|
4000 |
-
'is_on',
|
4001 |
-
$is_active,
|
4002 |
-
$this->is_plugin_update(),
|
4003 |
-
$version
|
4004 |
-
);
|
4005 |
-
|
4006 |
-
$this->_storage->connectivity_test = array(
|
4007 |
-
'is_connected' => $is_connected,
|
4008 |
-
'host' => $_SERVER['HTTP_HOST'],
|
4009 |
-
'server_ip' => WP_FS__REMOTE_ADDR,
|
4010 |
-
'is_active' => $is_active,
|
4011 |
-
'timestamp' => WP_FS__SCRIPT_START_TIME,
|
4012 |
-
// Last version with connectivity attempt.
|
4013 |
-
'version' => $version,
|
4014 |
-
);
|
4015 |
-
|
4016 |
-
$this->_has_api_connection = $is_connected;
|
4017 |
-
$this->_is_on = $is_active || ( WP_FS__DEV_MODE && $is_connected && ! WP_FS__SIMULATE_FREEMIUS_OFF );
|
4018 |
-
}
|
4019 |
-
|
4020 |
-
/**
|
4021 |
-
* Force turning Freemius on.
|
4022 |
-
*
|
4023 |
-
* @author Vova Feldman (@svovaf)
|
4024 |
-
* @since 1.1.8.1
|
4025 |
-
*
|
4026 |
-
* @return bool TRUE if successfully turned on.
|
4027 |
-
*/
|
4028 |
-
private function turn_on() {
|
4029 |
-
$this->_logger->entrance();
|
4030 |
-
|
4031 |
-
if ( $this->is_on() || ! isset( $this->_storage->connectivity_test['is_active'] ) ) {
|
4032 |
-
return false;
|
4033 |
-
}
|
4034 |
-
|
4035 |
-
$updated_connectivity = $this->_storage->connectivity_test;
|
4036 |
-
$updated_connectivity['is_active'] = true;
|
4037 |
-
$updated_connectivity['timestamp'] = WP_FS__SCRIPT_START_TIME;
|
4038 |
-
$this->_storage->connectivity_test = $updated_connectivity;
|
4039 |
-
|
4040 |
-
$this->_is_on = true;
|
4041 |
-
|
4042 |
-
return true;
|
4043 |
-
}
|
4044 |
-
|
4045 |
-
/**
|
4046 |
-
* Anonymous and unique site identifier (Hash).
|
4047 |
-
*
|
4048 |
-
* @author Vova Feldman (@svovaf)
|
4049 |
-
* @since 1.1.0
|
4050 |
-
*
|
4051 |
-
* @param null|int $blog_id Since 2.0.0
|
4052 |
-
*
|
4053 |
-
* @return string
|
4054 |
-
*/
|
4055 |
-
function get_anonymous_id( $blog_id = null ) {
|
4056 |
-
$unique_id = self::$_accounts->get_option( 'unique_id', null, $blog_id );
|
4057 |
-
|
4058 |
-
if ( empty( $unique_id ) || ! is_string( $unique_id ) ) {
|
4059 |
-
$key = fs_strip_url_protocol( get_site_url( $blog_id ) );
|
4060 |
-
|
4061 |
-
$secure_auth = SECURE_AUTH_KEY;
|
4062 |
-
if ( empty( $secure_auth ) ||
|
4063 |
-
false !== strpos( $secure_auth, ' ' ) ||
|
4064 |
-
'put your unique phrase here' === $secure_auth
|
4065 |
-
) {
|
4066 |
-
// Protect against default auth key.
|
4067 |
-
$secure_auth = md5( microtime() );
|
4068 |
-
}
|
4069 |
-
|
4070 |
-
/**
|
4071 |
-
* Base the unique identifier on the WP secure authentication key. Which
|
4072 |
-
* turns the key into a secret anonymous identifier. This will help us
|
4073 |
-
* to avoid duplicate installs generation on the backend upon opt-in.
|
4074 |
-
*
|
4075 |
-
* @author Vova Feldman (@svovaf)
|
4076 |
-
* @since 1.2.3
|
4077 |
-
*/
|
4078 |
-
$unique_id = md5( $key . $secure_auth );
|
4079 |
-
|
4080 |
-
self::$_accounts->set_option( 'unique_id', $unique_id, true, $blog_id );
|
4081 |
-
}
|
4082 |
-
|
4083 |
-
$this->_logger->departure( $unique_id );
|
4084 |
-
|
4085 |
-
return $unique_id;
|
4086 |
-
}
|
4087 |
-
|
4088 |
-
/**
|
4089 |
-
* @author Vova Feldman (@svovaf)
|
4090 |
-
* @since 1.1.7.4
|
4091 |
-
*
|
4092 |
-
* @return \WP_User
|
4093 |
-
*/
|
4094 |
-
static function _get_current_wp_user() {
|
4095 |
-
self::require_pluggable_essentials();
|
4096 |
-
self::wp_cookie_constants();
|
4097 |
-
|
4098 |
-
return wp_get_current_user();
|
4099 |
-
}
|
4100 |
-
|
4101 |
-
/**
|
4102 |
-
* Define cookie constants which are required by Freemius::_get_current_wp_user() since
|
4103 |
-
* it uses wp_get_current_user() which needs the cookie constants set. When a plugin
|
4104 |
-
* is network activated the cookie constants are only configured after the network
|
4105 |
-
* plugins activation, therefore, if we don't define those constants WP will throw
|
4106 |
-
* PHP warnings/notices.
|
4107 |
-
*
|
4108 |
-
* @author Vova Feldman (@svovaf)
|
4109 |
-
* @since 2.1.1
|
4110 |
-
*/
|
4111 |
-
private static function wp_cookie_constants() {
|
4112 |
-
if ( defined( 'LOGGED_IN_COOKIE' ) &&
|
4113 |
-
( defined( 'AUTH_COOKIE' ) || defined( 'SECURE_AUTH_COOKIE' ) )
|
4114 |
-
) {
|
4115 |
-
return;
|
4116 |
-
}
|
4117 |
-
|
4118 |
-
/**
|
4119 |
-
* Used to guarantee unique hash cookies
|
4120 |
-
*
|
4121 |
-
* @since 1.5.0
|
4122 |
-
*/
|
4123 |
-
if ( ! defined( 'COOKIEHASH' ) ) {
|
4124 |
-
$siteurl = get_site_option( 'siteurl' );
|
4125 |
-
if ( $siteurl ) {
|
4126 |
-
define( 'COOKIEHASH', md5( $siteurl ) );
|
4127 |
-
} else {
|
4128 |
-
define( 'COOKIEHASH', '' );
|
4129 |
-
}
|
4130 |
-
}
|
4131 |
-
|
4132 |
-
if ( ! defined( 'LOGGED_IN_COOKIE' ) ) {
|
4133 |
-
define( 'LOGGED_IN_COOKIE', 'wordpress_logged_in_' . COOKIEHASH );
|
4134 |
-
}
|
4135 |
-
|
4136 |
-
/**
|
4137 |
-
* @since 2.5.0
|
4138 |
-
*/
|
4139 |
-
if ( ! defined( 'AUTH_COOKIE' ) ) {
|
4140 |
-
define( 'AUTH_COOKIE', 'wordpress_' . COOKIEHASH );
|
4141 |
-
}
|
4142 |
-
|
4143 |
-
/**
|
4144 |
-
* @since 2.6.0
|
4145 |
-
*/
|
4146 |
-
if ( ! defined( 'SECURE_AUTH_COOKIE' ) ) {
|
4147 |
-
define( 'SECURE_AUTH_COOKIE', 'wordpress_sec_' . COOKIEHASH );
|
4148 |
-
}
|
4149 |
-
}
|
4150 |
-
|
4151 |
-
/**
|
4152 |
-
* @author Vova Feldman (@svovaf)
|
4153 |
-
* @since 2.1.0
|
4154 |
-
*
|
4155 |
-
* @return int
|
4156 |
-
*/
|
4157 |
-
static function get_current_wp_user_id() {
|
4158 |
-
$wp_user = self::_get_current_wp_user();
|
4159 |
-
|
4160 |
-
return $wp_user->ID;
|
4161 |
-
}
|
4162 |
-
|
4163 |
-
/**
|
4164 |
-
* @author Vova Feldman (@svovaf)
|
4165 |
-
* @since 1.2.1.7
|
4166 |
-
*
|
4167 |
-
* @param string $email
|
4168 |
-
*
|
4169 |
-
* @return bool
|
4170 |
-
*/
|
4171 |
-
static function is_valid_email( $email ) {
|
4172 |
-
if ( false === filter_var( $email, FILTER_VALIDATE_EMAIL ) ) {
|
4173 |
-
return false;
|
4174 |
-
}
|
4175 |
-
|
4176 |
-
$parts = explode( '@', $email );
|
4177 |
-
|
4178 |
-
if ( 2 !== count( $parts ) || empty( $parts[1] ) ) {
|
4179 |
-
return false;
|
4180 |
-
}
|
4181 |
-
|
4182 |
-
$blacklist = array(
|
4183 |
-
'admin.',
|
4184 |
-
'webmaster.',
|
4185 |
-
'localhost.',
|
4186 |
-
'dev.',
|
4187 |
-
'development.',
|
4188 |
-
'test.',
|
4189 |
-
'stage.',
|
4190 |
-
'staging.',
|
4191 |
-
);
|
4192 |
-
|
4193 |
-
// Make sure domain is not one of the blacklisted.
|
4194 |
-
foreach ( $blacklist as $invalid ) {
|
4195 |
-
if ( 0 === strpos( $parts[1], $invalid ) ) {
|
4196 |
-
return false;
|
4197 |
-
}
|
4198 |
-
}
|
4199 |
-
|
4200 |
-
// Get the UTF encoded domain name.
|
4201 |
-
$domain = idn_to_ascii( $parts[1] ) . '.';
|
4202 |
-
|
4203 |
-
return ( checkdnsrr( $domain, 'MX' ) || checkdnsrr( $domain, 'A' ) );
|
4204 |
-
}
|
4205 |
-
|
4206 |
-
/**
|
4207 |
-
* Generate API connectivity issue message.
|
4208 |
-
*
|
4209 |
-
* @author Vova Feldman (@svovaf)
|
4210 |
-
* @since 1.0.9
|
4211 |
-
*
|
4212 |
-
* @param mixed $api_result
|
4213 |
-
* @param bool $is_first_failure
|
4214 |
-
*/
|
4215 |
-
function _add_connectivity_issue_message( $api_result, $is_first_failure = true ) {
|
4216 |
-
if ( ! $this->is_premium() && $this->_enable_anonymous ) {
|
4217 |
-
// Don't add message if it's the free version and can run anonymously.
|
4218 |
-
return;
|
4219 |
-
}
|
4220 |
-
|
4221 |
-
if ( ! function_exists( 'wp_nonce_url' ) ) {
|
4222 |
-
require_once ABSPATH . 'wp-includes/functions.php';
|
4223 |
-
}
|
4224 |
-
|
4225 |
-
$current_user = self::_get_current_wp_user();
|
4226 |
-
// $admin_email = get_option( 'admin_email' );
|
4227 |
-
$admin_email = $current_user->user_email;
|
4228 |
-
|
4229 |
-
// Aliases.
|
4230 |
-
$deactivate_plugin_title = $this->esc_html_inline( 'That\'s exhausting, please deactivate', 'deactivate-plugin-title' );
|
4231 |
-
$deactivate_plugin_desc = $this->esc_html_inline( 'We feel your frustration and sincerely apologize for the inconvenience. Hope to see you again in the future.', 'deactivate-plugin-desc' );
|
4232 |
-
$install_previous_title = $this->esc_html_inline( 'Let\'s try your previous version', 'install-previous-title' );
|
4233 |
-
$install_previous_desc = $this->esc_html_inline( 'Uninstall this version and install the previous one.', 'install-previous-desc' );
|
4234 |
-
$fix_issue_title = $this->esc_html_inline( 'Yes - I\'m giving you a chance to fix it', 'fix-issue-title' );
|
4235 |
-
$fix_issue_desc = $this->esc_html_inline( 'We will do our best to whitelist your server and resolve this issue ASAP. You will get a follow-up email to %s once we have an update.', 'fix-issue-desc' );
|
4236 |
-
/* translators: %s: product title (e.g. "Awesome Plugin" requires an access to...) */
|
4237 |
-
$x_requires_access_to_api = $this->esc_html_inline( '%s requires an access to our API.', 'x-requires-access-to-api' );
|
4238 |
-
$sysadmin_title = $this->esc_html_inline( 'I\'m a system administrator', 'sysadmin-title' );
|
4239 |
-
$happy_to_resolve_issue_asap = $this->esc_html_inline( 'We are sure it\'s an issue on our side and more than happy to resolve it for you ASAP if you give us a chance.', 'happy-to-resolve-issue-asap' );
|
4240 |
-
|
4241 |
-
$message = false;
|
4242 |
-
if ( is_object( $api_result ) &&
|
4243 |
-
isset( $api_result->error ) &&
|
4244 |
-
isset( $api_result->error->code )
|
4245 |
-
) {
|
4246 |
-
switch ( $api_result->error->code ) {
|
4247 |
-
case 'curl_missing':
|
4248 |
-
$missing_methods = '';
|
4249 |
-
if ( is_array( $api_result->missing_methods ) &&
|
4250 |
-
! empty( $api_result->missing_methods )
|
4251 |
-
) {
|
4252 |
-
foreach ( $api_result->missing_methods as $m ) {
|
4253 |
-
if ( 'curl_version' === $m ) {
|
4254 |
-
continue;
|
4255 |
-
}
|
4256 |
-
|
4257 |
-
if ( ! empty( $missing_methods ) ) {
|
4258 |
-
$missing_methods .= ', ';
|
4259 |
-
}
|
4260 |
-
|
4261 |
-
$missing_methods .= sprintf( '<code>%s</code>', $m );
|
4262 |
-
}
|
4263 |
-
|
4264 |
-
if ( ! empty( $missing_methods ) ) {
|
4265 |
-
$missing_methods = sprintf(
|
4266 |
-
'<br><br><b>%s</b> %s',
|
4267 |
-
$this->esc_html_inline( 'Disabled method(s):', 'curl-disabled-methods' ),
|
4268 |
-
$missing_methods
|
4269 |
-
);
|
4270 |
-
}
|
4271 |
-
}
|
4272 |
-
|
4273 |
-
$message = sprintf(
|
4274 |
-
$x_requires_access_to_api . ' ' .
|
4275 |
-
$this->esc_html_inline( 'We use PHP cURL library for the API calls, which is a very common library and usually installed and activated out of the box. Unfortunately, cURL is not activated (or disabled) on your server.', 'curl-missing-message' ) . ' ' .
|
4276 |
-
$missing_methods .
|
4277 |
-
' %s',
|
4278 |
-
'<b>' . $this->get_plugin_name() . '</b>',
|
4279 |
-
sprintf(
|
4280 |
-
'<ol id="fs_firewall_issue_options"><li>%s</li><li>%s</li><li>%s</li></ol>',
|
4281 |
-
sprintf(
|
4282 |
-
'<a class="fs-resolve" data-type="curl" href="#"><b>%s</b></a>%s',
|
4283 |
-
$this->get_text_inline( 'I don\'t know what is cURL or how to install it, help me!', 'curl-missing-no-clue-title' ),
|
4284 |
-
' - ' . sprintf(
|
4285 |
-
$this->get_text_inline( 'We\'ll make sure to contact your hosting company and resolve the issue. You will get a follow-up email to %s once we have an update.', 'curl-missing-no-clue-desc' ),
|
4286 |
-
'<a href="mailto:' . $admin_email . '">' . $admin_email . '</a>'
|
4287 |
-
)
|
4288 |
-
),
|
4289 |
-
sprintf(
|
4290 |
-
'<b>%s</b> - %s',
|
4291 |
-
$sysadmin_title,
|
4292 |
-
esc_html( sprintf( $this->get_text_inline( 'Great, please install cURL and enable it in your php.ini file. In addition, search for the \'disable_functions\' directive in your php.ini file and remove any disabled methods starting with \'curl_\'. To make sure it was successfully activated, use \'phpinfo()\'. Once activated, deactivate the %s and reactivate it back again.', 'curl-missing-sysadmin-desc' ), $this->get_module_label( true ) ) )
|
4293 |
-
),
|
4294 |
-
sprintf(
|
4295 |
-
'<a href="%s"><b>%s</b></a> - %s',
|
4296 |
-
wp_nonce_url( 'plugins.php?action=deactivate&plugin=' . $this->_plugin_basename . '&plugin_status=all&paged=1&s=', 'deactivate-plugin_' . $this->_plugin_basename ),
|
4297 |
-
$deactivate_plugin_title,
|
4298 |
-
$deactivate_plugin_desc
|
4299 |
-
)
|
4300 |
-
)
|
4301 |
-
);
|
4302 |
-
break;
|
4303 |
-
case 'cloudflare_ddos_protection':
|
4304 |
-
$message = sprintf(
|
4305 |
-
$x_requires_access_to_api . ' ' .
|
4306 |
-
$this->esc_html_inline( 'From unknown reason, CloudFlare, the firewall we use, blocks the connection.', 'cloudflare-blocks-connection-message' ) . ' ' .
|
4307 |
-
$happy_to_resolve_issue_asap .
|
4308 |
-
' %s',
|
4309 |
-
'<b>' . $this->get_plugin_name() . '</b>',
|
4310 |
-
sprintf(
|
4311 |
-
'<ol id="fs_firewall_issue_options"><li>%s</li><li>%s</li><li>%s</li></ol>',
|
4312 |
-
sprintf(
|
4313 |
-
'<a class="fs-resolve" data-type="cloudflare" href="#"><b>%s</b></a>%s',
|
4314 |
-
$fix_issue_title,
|
4315 |
-
' - ' . sprintf(
|
4316 |
-
$fix_issue_desc,
|
4317 |
-
'<a href="mailto:' . $admin_email . '">' . $admin_email . '</a>'
|
4318 |
-
)
|
4319 |
-
),
|
4320 |
-
sprintf(
|
4321 |
-
'<a href="%s" target="_blank" rel="noopener noreferrer"><b>%s</b></a> - %s',
|
4322 |
-
sprintf( 'https://wordpress.org/plugins/%s/download/', $this->_slug ),
|
4323 |
-
$install_previous_title,
|
4324 |
-
$install_previous_desc
|
4325 |
-
),
|
4326 |
-
sprintf(
|
4327 |
-
'<a href="%s"><b>%s</b></a> - %s',
|
4328 |
-
wp_nonce_url( 'plugins.php?action=deactivate&plugin=' . $this->_plugin_basename . '&plugin_status=all&paged=1&s=' . '', 'deactivate-plugin_' . $this->_plugin_basename ),
|
4329 |
-
$deactivate_plugin_title,
|
4330 |
-
$deactivate_plugin_desc
|
4331 |
-
)
|
4332 |
-
)
|
4333 |
-
);
|
4334 |
-
break;
|
4335 |
-
case 'squid_cache_block':
|
4336 |
-
$message = sprintf(
|
4337 |
-
$x_requires_access_to_api . ' ' .
|
4338 |
-
$this->esc_html_inline( 'It looks like your server is using Squid ACL (access control lists), which blocks the connection.', 'squid-blocks-connection-message' ) .
|
4339 |
-
' %s',
|
4340 |
-
'<b>' . $this->get_plugin_name() . '</b>',
|
4341 |
-
sprintf(
|
4342 |
-
'<ol id="fs_firewall_issue_options"><li>%s</li><li>%s</li><li>%s</li></ol>',
|
4343 |
-
sprintf(
|
4344 |
-
'<a class="fs-resolve" data-type="squid" href="#"><b>%s</b></a> - %s',
|
4345 |
-
$this->esc_html_inline( 'I don\'t know what is Squid or ACL, help me!', 'squid-no-clue-title' ),
|
4346 |
-
sprintf(
|
4347 |
-
$this->esc_html_inline( 'We\'ll make sure to contact your hosting company and resolve the issue. You will get a follow-up email to %s once we have an update.', 'squid-no-clue-desc' ),
|
4348 |
-
'<a href="mailto:' . $admin_email . '">' . $admin_email . '</a>'
|
4349 |
-
)
|
4350 |
-
),
|
4351 |
-
sprintf(
|
4352 |
-
'<b>%s</b> - %s',
|
4353 |
-
$sysadmin_title,
|
4354 |
-
sprintf(
|
4355 |
-
$this->esc_html_inline( 'Great, please whitelist the following domains: %s. Once you are done, deactivate the %s and activate it again.', 'squid-sysadmin-desc' ),
|
4356 |
-
// We use a filter since the plugin might require additional API connectivity.
|
4357 |
-
'<b>' . implode( ', ', $this->apply_filters( 'api_domains', array(
|
4358 |
-
'api.freemius.com',
|
4359 |
-
'wp.freemius.com'
|
4360 |
-
) ) ) . '</b>',
|
4361 |
-
$this->_module_type
|
4362 |
-
)
|
4363 |
-
),
|
4364 |
-
sprintf(
|
4365 |
-
'<a href="%s"><b>%s</b></a> - %s',
|
4366 |
-
wp_nonce_url( 'plugins.php?action=deactivate&plugin=' . $this->_plugin_basename . '&plugin_status=all&paged=1&s=', 'deactivate-plugin_' . $this->_plugin_basename ),
|
4367 |
-
$deactivate_plugin_title,
|
4368 |
-
$deactivate_plugin_desc
|
4369 |
-
)
|
4370 |
-
)
|
4371 |
-
);
|
4372 |
-
break;
|
4373 |
-
// default:
|
4374 |
-
// $message = $this->get_text_inline( 'connectivity-test-fails-message' );
|
4375 |
-
// break;
|
4376 |
-
}
|
4377 |
-
}
|
4378 |
-
|
4379 |
-
$message_id = 'failed_connect_api';
|
4380 |
-
$type = 'error';
|
4381 |
-
|
4382 |
-
$connectivity_test_fails_message = $this->esc_html_inline( 'From unknown reason, the API connectivity test failed.', 'connectivity-test-fails-message' );
|
4383 |
-
|
4384 |
-
if ( false === $message ) {
|
4385 |
-
if ( $is_first_failure ) {
|
4386 |
-
// First attempt failed.
|
4387 |
-
$message = sprintf(
|
4388 |
-
$x_requires_access_to_api . ' ' .
|
4389 |
-
$connectivity_test_fails_message . ' ' .
|
4390 |
-
$this->esc_html_inline( 'It\'s probably a temporary issue on our end. Just to be sure, with your permission, would it be o.k to run another connectivity test?', 'connectivity-test-maybe-temporary' ) . '<br><br>' .
|
4391 |
-
'%s',
|
4392 |
-
'<b>' . $this->get_plugin_name() . '</b>',
|
4393 |
-
sprintf(
|
4394 |
-
'<div id="fs_firewall_issue_options">%s %s</div>',
|
4395 |
-
sprintf(
|
4396 |
-
'<a class="button button-primary fs-resolve" data-type="retry_ping" href="#">%s</a>',
|
4397 |
-
$this->get_text_inline( 'Yes - do your thing', 'yes-do-your-thing' )
|
4398 |
-
),
|
4399 |
-
sprintf(
|
4400 |
-
'<a href="%s" class="button">%s</a>',
|
4401 |
-
wp_nonce_url( 'plugins.php?action=deactivate&plugin=' . $this->_plugin_basename . '&plugin_status=all&paged=1&s=', 'deactivate-plugin_' . $this->_plugin_basename ),
|
4402 |
-
$this->get_text_inline( 'No - just deactivate', 'no-deactivate' )
|
4403 |
-
)
|
4404 |
-
)
|
4405 |
-
);
|
4406 |
-
|
4407 |
-
$message_id = 'failed_connect_api_first';
|
4408 |
-
$type = 'promotion';
|
4409 |
-
} else {
|
4410 |
-
// Second connectivity attempt failed.
|
4411 |
-
$message = sprintf(
|
4412 |
-
$x_requires_access_to_api . ' ' .
|
4413 |
-
$connectivity_test_fails_message . ' ' .
|
4414 |
-
$happy_to_resolve_issue_asap .
|
4415 |
-
' %s',
|
4416 |
-
'<b>' . $this->get_plugin_name() . '</b>',
|
4417 |
-
sprintf(
|
4418 |
-
'<ol id="fs_firewall_issue_options"><li>%s</li><li>%s</li><li>%s</li></ol>',
|
4419 |
-
sprintf(
|
4420 |
-
'<a class="fs-resolve" data-type="general" href="#"><b>%s</b></a>%s',
|
4421 |
-
$fix_issue_title,
|
4422 |
-
' - ' . sprintf(
|
4423 |
-
$fix_issue_desc,
|
4424 |
-
'<a href="mailto:' . $admin_email . '">' . $admin_email . '</a>'
|
4425 |
-
)
|
4426 |
-
),
|
4427 |
-
sprintf(
|
4428 |
-
'<a href="%s" target="_blank" rel="noopener noreferrer"><b>%s</b></a> - %s',
|
4429 |
-
sprintf( 'https://wordpress.org/plugins/%s/download/', $this->_slug ),
|
4430 |
-
$install_previous_title,
|
4431 |
-
$install_previous_desc
|
4432 |
-
),
|
4433 |
-
sprintf(
|
4434 |
-
'<a href="%s"><b>%s</b></a> - %s',
|
4435 |
-
wp_nonce_url( 'plugins.php?action=deactivate&plugin=' . $this->_plugin_basename . '&plugin_status=all&paged=1&s=', 'deactivate-plugin_' . $this->_plugin_basename ),
|
4436 |
-
$deactivate_plugin_title,
|
4437 |
-
$deactivate_plugin_desc
|
4438 |
-
)
|
4439 |
-
)
|
4440 |
-
);
|
4441 |
-
}
|
4442 |
-
}
|
4443 |
-
|
4444 |
-
$this->_admin_notices->add_sticky(
|
4445 |
-
$message,
|
4446 |
-
$message_id,
|
4447 |
-
$this->get_text_x_inline( 'Oops', 'exclamation', 'oops' ) . '...',
|
4448 |
-
$type
|
4449 |
-
);
|
4450 |
-
}
|
4451 |
-
|
4452 |
-
/**
|
4453 |
-
* Handle user request to resolve connectivity issue.
|
4454 |
-
* This method will send an email to Freemius API technical staff for resolution.
|
4455 |
-
* The email will contain server's info and installed plugins (might be caching issue).
|
4456 |
-
*
|
4457 |
-
* @author Vova Feldman (@svovaf)
|
4458 |
-
* @since 1.0.9
|
4459 |
-
*/
|
4460 |
-
function _email_about_firewall_issue() {
|
4461 |
-
check_admin_referer( 'fs_resolve_firewall_issues' );
|
4462 |
-
|
4463 |
-
if ( ! current_user_can( is_multisite() ? 'manage_options' : 'activate_plugins' ) ) {
|
4464 |
-
return;
|
4465 |
-
}
|
4466 |
-
|
4467 |
-
$this->_admin_notices->remove_sticky( 'failed_connect_api' );
|
4468 |
-
|
4469 |
-
$pong = $this->ping();
|
4470 |
-
|
4471 |
-
$is_connected = $this->get_api_plugin_scope()->is_valid_ping( $pong );
|
4472 |
-
|
4473 |
-
if ( $is_connected ) {
|
4474 |
-
FS_GDPR_Manager::instance()->store_is_required( $pong->is_gdpr_required );
|
4475 |
-
|
4476 |
-
$this->store_connectivity_info( $pong, $is_connected );
|
4477 |
-
|
4478 |
-
echo $this->get_after_plugin_activation_redirect_url();
|
4479 |
-
exit;
|
4480 |
-
}
|
4481 |
-
|
4482 |
-
$current_user = self::_get_current_wp_user();
|
4483 |
-
$admin_email = $current_user->user_email;
|
4484 |
-
|
4485 |
-
$error_type = fs_request_get( 'error_type', 'general' );
|
4486 |
-
|
4487 |
-
switch ( $error_type ) {
|
4488 |
-
case 'squid':
|
4489 |
-
$title = 'Squid ACL Blocking Issue';
|
4490 |
-
break;
|
4491 |
-
case 'cloudflare':
|
4492 |
-
$title = 'CloudFlare Blocking Issue';
|
4493 |
-
break;
|
4494 |
-
default:
|
4495 |
-
$title = 'API Connectivity Issue';
|
4496 |
-
break;
|
4497 |
-
}
|
4498 |
-
|
4499 |
-
$custom_email_sections = array();
|
4500 |
-
|
4501 |
-
// Add 'API Error' custom email section.
|
4502 |
-
$custom_email_sections['api_error'] = array(
|
4503 |
-
'title' => 'API Error',
|
4504 |
-
'rows' => array(
|
4505 |
-
'ping' => array(
|
4506 |
-
'API Error',
|
4507 |
-
is_string( $pong ) ? htmlentities( $pong ) : json_encode( $pong )
|
4508 |
-
),
|
4509 |
-
)
|
4510 |
-
);
|
4511 |
-
|
4512 |
-
// Send email with technical details to resolve API connectivity issues.
|
4513 |
-
$this->send_email(
|
4514 |
-
'api@freemius.com', // recipient
|
4515 |
-
$title . ' [' . $this->get_plugin_name() . ']', // subject
|
4516 |
-
$custom_email_sections,
|
4517 |
-
array( "Reply-To: $admin_email <$admin_email>" ) // headers
|
4518 |
-
);
|
4519 |
-
|
4520 |
-
$this->_admin_notices->add_sticky(
|
4521 |
-
sprintf(
|
4522 |
-
$this->get_text_inline( 'Thank for giving us the chance to fix it! A message was just sent to our technical staff. We will get back to you as soon as we have an update to %s. Appreciate your patience.', 'fix-request-sent-message' ),
|
4523 |
-
'<a href="mailto:' . $admin_email . '">' . $admin_email . '</a>'
|
4524 |
-
),
|
4525 |
-
'server_details_sent'
|
4526 |
-
);
|
4527 |
-
|
4528 |
-
// Action was taken, tell that API connectivity troubleshooting should be off now.
|
4529 |
-
|
4530 |
-
echo "1";
|
4531 |
-
exit;
|
4532 |
-
}
|
4533 |
-
|
4534 |
-
/**
|
4535 |
-
* Handle connectivity test retry approved by the user.
|
4536 |
-
*
|
4537 |
-
* @author Vova Feldman (@svovaf)
|
4538 |
-
* @since 1.1.7.4
|
4539 |
-
*/
|
4540 |
-
function _retry_connectivity_test() {
|
4541 |
-
check_admin_referer( 'fs_retry_connectivity_test' );
|
4542 |
-
|
4543 |
-
if ( ! current_user_can( is_multisite() ? 'manage_options' : 'activate_plugins' ) ) {
|
4544 |
-
return;
|
4545 |
-
}
|
4546 |
-
|
4547 |
-
$this->_admin_notices->remove_sticky( 'failed_connect_api_first' );
|
4548 |
-
|
4549 |
-
$pong = $this->ping();
|
4550 |
-
|
4551 |
-
$is_connected = $this->get_api_plugin_scope()->is_valid_ping( $pong );
|
4552 |
-
|
4553 |
-
if ( $is_connected ) {
|
4554 |
-
FS_GDPR_Manager::instance()->store_is_required( $pong->is_gdpr_required );
|
4555 |
-
|
4556 |
-
$this->store_connectivity_info( $pong, $is_connected );
|
4557 |
-
|
4558 |
-
echo $this->get_after_plugin_activation_redirect_url();
|
4559 |
-
} else {
|
4560 |
-
// Add connectivity issue message after 2nd failed attempt.
|
4561 |
-
$this->_add_connectivity_issue_message( $pong, false );
|
4562 |
-
|
4563 |
-
echo "1";
|
4564 |
-
}
|
4565 |
-
|
4566 |
-
exit;
|
4567 |
-
}
|
4568 |
-
|
4569 |
-
static function _add_firewall_issues_javascript() {
|
4570 |
-
$params = array();
|
4571 |
-
fs_require_once_template( 'firewall-issues-js.php', $params );
|
4572 |
-
}
|
4573 |
-
|
4574 |
-
#endregion
|
4575 |
-
|
4576 |
-
#----------------------------------------------------------------------------------
|
4577 |
-
#region Email
|
4578 |
-
#----------------------------------------------------------------------------------
|
4579 |
-
|
4580 |
-
/**
|
4581 |
-
* Generates and sends an HTML email with customizable sections.
|
4582 |
-
*
|
4583 |
-
* @author Leo Fajardo (@leorw)
|
4584 |
-
* @since 1.1.2
|
4585 |
-
*
|
4586 |
-
* @param string $to_address
|
4587 |
-
* @param string $subject
|
4588 |
-
* @param array $sections
|
4589 |
-
* @param array $headers
|
4590 |
-
*
|
4591 |
-
* @return bool Whether the email contents were sent successfully.
|
4592 |
-
*/
|
4593 |
-
private function send_email(
|
4594 |
-
$to_address,
|
4595 |
-
$subject,
|
4596 |
-
$sections = array(),
|
4597 |
-
$headers = array()
|
4598 |
-
) {
|
4599 |
-
$default_sections = $this->get_email_sections();
|
4600 |
-
|
4601 |
-
// Insert new sections or replace the default email sections.
|
4602 |
-
if ( is_array( $sections ) && ! empty( $sections ) ) {
|
4603 |
-
foreach ( $sections as $section_id => $custom_section ) {
|
4604 |
-
if ( ! isset( $default_sections[ $section_id ] ) ) {
|
4605 |
-
// If the section does not exist, add it.
|
4606 |
-
$default_sections[ $section_id ] = $custom_section;
|
4607 |
-
} else {
|
4608 |
-
// If the section already exists, override it.
|
4609 |
-
$current_section = $default_sections[ $section_id ];
|
4610 |
-
|
4611 |
-
// Replace the current section's title if a custom section title exists.
|
4612 |
-
if ( isset( $custom_section['title'] ) ) {
|
4613 |
-
$current_section['title'] = $custom_section['title'];
|
4614 |
-
}
|
4615 |
-
|
4616 |
-
// Insert new rows under the current section or replace the default rows.
|
4617 |
-
if ( isset( $custom_section['rows'] ) && is_array( $custom_section['rows'] ) && ! empty( $custom_section['rows'] ) ) {
|
4618 |
-
foreach ( $custom_section['rows'] as $row_id => $row ) {
|
4619 |
-
$current_section['rows'][ $row_id ] = $row;
|
4620 |
-
}
|
4621 |
-
}
|
4622 |
-
|
4623 |
-
$default_sections[ $section_id ] = $current_section;
|
4624 |
-
}
|
4625 |
-
}
|
4626 |
-
}
|
4627 |
-
|
4628 |
-
$vars = array( 'sections' => $default_sections );
|
4629 |
-
$message = fs_get_template( 'email.php', $vars );
|
4630 |
-
|
4631 |
-
// Set the type of email to HTML.
|
4632 |
-
$headers[] = 'Content-type: text/html; charset=UTF-8';
|
4633 |
-
|
4634 |
-
$header_string = implode( "\r\n", $headers );
|
4635 |
-
|
4636 |
-
return wp_mail(
|
4637 |
-
$to_address,
|
4638 |
-
$subject,
|
4639 |
-
$message,
|
4640 |
-
$header_string
|
4641 |
-
);
|
4642 |
-
}
|
4643 |
-
|
4644 |
-
/**
|
4645 |
-
* Generates the data for the sections of the email content.
|
4646 |
-
*
|
4647 |
-
* @author Leo Fajardo (@leorw)
|
4648 |
-
* @since 1.1.2
|
4649 |
-
*
|
4650 |
-
* @return array
|
4651 |
-
*/
|
4652 |
-
private function get_email_sections() {
|
4653 |
-
// Retrieve the current user's information so that we can get the user's email, first name, and last name below.
|
4654 |
-
$current_user = self::_get_current_wp_user();
|
4655 |
-
|
4656 |
-
// Retrieve the cURL version information so that we can get the version number below.
|
4657 |
-
$curl_version_information = curl_version();
|
4658 |
-
|
4659 |
-
$active_plugin = self::get_active_plugins();
|
4660 |
-
|
4661 |
-
// Generate the list of active plugins separated by new line.
|
4662 |
-
$active_plugin_string = '';
|
4663 |
-
foreach ( $active_plugin as $plugin ) {
|
4664 |
-
$active_plugin_string .= sprintf(
|
4665 |
-
'<a href="%s">%s</a> [v%s]<br>',
|
4666 |
-
$plugin['PluginURI'],
|
4667 |
-
$plugin['Name'],
|
4668 |
-
$plugin['Version']
|
4669 |
-
);
|
4670 |
-
}
|
4671 |
-
|
4672 |
-
$server_ip = WP_FS__REMOTE_ADDR;
|
4673 |
-
|
4674 |
-
// Add PHP info for deeper investigation.
|
4675 |
-
ob_start();
|
4676 |
-
phpinfo();
|
4677 |
-
$php_info = ob_get_clean();
|
4678 |
-
|
4679 |
-
$api_domain = substr( FS_API__ADDRESS, strpos( FS_API__ADDRESS, ':' ) + 3 );
|
4680 |
-
|
4681 |
-
// Generate the default email sections.
|
4682 |
-
$sections = array(
|
4683 |
-
'sdk' => array(
|
4684 |
-
'title' => 'SDK',
|
4685 |
-
'rows' => array(
|
4686 |
-
'fs_version' => array( 'FS Version', $this->version ),
|
4687 |
-
'curl_version' => array( 'cURL Version', $curl_version_information['version'] )
|
4688 |
-
)
|
4689 |
-
),
|
4690 |
-
'plugin' => array(
|
4691 |
-
'title' => ucfirst( $this->get_module_type() ),
|
4692 |
-
'rows' => array(
|
4693 |
-
'name' => array( 'Name', $this->get_plugin_name() ),
|
4694 |
-
'version' => array( 'Version', $this->get_plugin_version() )
|
4695 |
-
)
|
4696 |
-
),
|
4697 |
-
'api' => array(
|
4698 |
-
'title' => 'API Subdomain',
|
4699 |
-
'rows' => array(
|
4700 |
-
'dns' => array(
|
4701 |
-
'DNS_CNAME',
|
4702 |
-
function_exists( 'dns_get_record' ) ?
|
4703 |
-
var_export( dns_get_record( $api_domain, DNS_CNAME ), true ) :
|
4704 |
-
'dns_get_record() disabled/blocked'
|
4705 |
-
),
|
4706 |
-
'ip' => array(
|
4707 |
-
'IP',
|
4708 |
-
function_exists( 'gethostbyname' ) ?
|
4709 |
-
gethostbyname( $api_domain ) :
|
4710 |
-
'gethostbyname() disabled/blocked'
|
4711 |
-
),
|
4712 |
-
),
|
4713 |
-
),
|
4714 |
-
'site' => array(
|
4715 |
-
'title' => 'Site',
|
4716 |
-
'rows' => array(
|
4717 |
-
'unique_id' => array( 'Unique ID', $this->get_anonymous_id() ),
|
4718 |
-
'address' => array( 'Address', site_url() ),
|
4719 |
-
'host' => array(
|
4720 |
-
'HTTP_HOST',
|
4721 |
-
( ! empty( $_SERVER['HTTP_HOST'] ) ? $_SERVER['HTTP_HOST'] : '' )
|
4722 |
-
),
|
4723 |
-
'hosting' => array(
|
4724 |
-
'Hosting Company' => fs_request_has( 'hosting_company' ) ?
|
4725 |
-
fs_request_get( 'hosting_company' ) :
|
4726 |
-
'Unknown',
|
4727 |
-
),
|
4728 |
-
'server_addr' => array(
|
4729 |
-
'SERVER_ADDR',
|
4730 |
-
'<a href="http://www.projecthoneypot.org/ip_' . $server_ip . '">' . $server_ip . '</a>'
|
4731 |
-
)
|
4732 |
-
)
|
4733 |
-
),
|
4734 |
-
'user' => array(
|
4735 |
-
'title' => 'User',
|
4736 |
-
'rows' => array(
|
4737 |
-
'email' => array( 'Email', $current_user->user_email ),
|
4738 |
-
'first' => array( 'First', $current_user->user_firstname ),
|
4739 |
-
'last' => array( 'Last', $current_user->user_lastname )
|
4740 |
-
)
|
4741 |
-
),
|
4742 |
-
'plugins' => array(
|
4743 |
-
'title' => 'Plugins',
|
4744 |
-
'rows' => array(
|
4745 |
-
'active_plugins' => array( 'Active Plugins', $active_plugin_string )
|
4746 |
-
)
|
4747 |
-
),
|
4748 |
-
'php_info' => array(
|
4749 |
-
'title' => 'PHP Info',
|
4750 |
-
'rows' => array(
|
4751 |
-
'info' => array( $php_info )
|
4752 |
-
),
|
4753 |
-
)
|
4754 |
-
);
|
4755 |
-
|
4756 |
-
// Allow the sections to be modified by other code.
|
4757 |
-
$sections = $this->apply_filters( 'email_template_sections', $sections );
|
4758 |
-
|
4759 |
-
return $sections;
|
4760 |
-
}
|
4761 |
-
|
4762 |
-
#endregion
|
4763 |
-
|
4764 |
-
#----------------------------------------------------------------------------------
|
4765 |
-
#region Initialization
|
4766 |
-
#----------------------------------------------------------------------------------
|
4767 |
-
|
4768 |
-
/**
|
4769 |
-
* Init plugin's Freemius instance.
|
4770 |
-
*
|
4771 |
-
* @author Vova Feldman (@svovaf)
|
4772 |
-
* @since 1.0.1
|
4773 |
-
*
|
4774 |
-
* @param number $id
|
4775 |
-
* @param string $public_key
|
4776 |
-
* @param bool $is_live
|
4777 |
-
* @param bool $is_premium
|
4778 |
-
*/
|
4779 |
-
function init( $id, $public_key, $is_live = true, $is_premium = true ) {
|
4780 |
-
$this->_logger->entrance();
|
4781 |
-
|
4782 |
-
$this->dynamic_init( array(
|
4783 |
-
'id' => $id,
|
4784 |
-
'public_key' => $public_key,
|
4785 |
-
'is_live' => $is_live,
|
4786 |
-
'is_premium' => $is_premium,
|
4787 |
-
) );
|
4788 |
-
}
|
4789 |
-
|
4790 |
-
/**
|
4791 |
-
* Dynamic initiator, originally created to support initiation
|
4792 |
-
* with parent_id for add-ons.
|
4793 |
-
*
|
4794 |
-
* @author Vova Feldman (@svovaf)
|
4795 |
-
* @since 1.0.6
|
4796 |
-
*
|
4797 |
-
* @param array $plugin_info
|
4798 |
-
*
|
4799 |
-
* @throws Freemius_Exception
|
4800 |
-
*/
|
4801 |
-
function dynamic_init( array $plugin_info ) {
|
4802 |
-
$this->_logger->entrance();
|
4803 |
-
|
4804 |
-
$this->parse_settings( $plugin_info );
|
4805 |
-
|
4806 |
-
$this->register_after_settings_parse_hooks();
|
4807 |
-
|
4808 |
-
if ( $this->should_stop_execution() ) {
|
4809 |
-
return;
|
4810 |
-
}
|
4811 |
-
|
4812 |
-
if ( ! $this->is_registered() ) {
|
4813 |
-
if ( $this->is_anonymous() ) {
|
4814 |
-
// If user skipped, no need to test connectivity.
|
4815 |
-
$this->_has_api_connection = true;
|
4816 |
-
$this->_is_on = true;
|
4817 |
-
} else {
|
4818 |
-
if ( ! $this->has_api_connectivity() ) {
|
4819 |
-
if ( $this->_admin_notices->has_sticky( 'failed_connect_api_first' ) ||
|
4820 |
-
$this->_admin_notices->has_sticky( 'failed_connect_api' )
|
4821 |
-
) {
|
4822 |
-
if ( ! $this->_enable_anonymous || $this->is_premium() ) {
|
4823 |
-
// If anonymous mode is disabled, add firewall admin-notice message.
|
4824 |
-
add_action( 'admin_footer', array( 'Freemius', '_add_firewall_issues_javascript' ) );
|
4825 |
-
|
4826 |
-
$ajax_action_suffix = $this->_slug . ( $this->is_theme() ? ':theme' : '' );
|
4827 |
-
add_action( "wp_ajax_fs_resolve_firewall_issues_{$ajax_action_suffix}", array(
|
4828 |
-
&$this,
|
4829 |
-
'_email_about_firewall_issue'
|
4830 |
-
) );
|
4831 |
-
|
4832 |
-
add_action( "wp_ajax_fs_retry_connectivity_test_{$ajax_action_suffix}", array(
|
4833 |
-
&$this,
|
4834 |
-
'_retry_connectivity_test'
|
4835 |
-
) );
|
4836 |
-
|
4837 |
-
/**
|
4838 |
-
* Currently the admin notice manager relies on the module's type and slug. The new AJAX actions manager uses module IDs, hence, consider to replace the if block above with the commented code below after adjusting the admin notices manager to work with module IDs.
|
4839 |
-
*
|
4840 |
-
* @author Vova Feldman (@svovaf)
|
4841 |
-
* @since 2.0.0
|
4842 |
-
*/
|
4843 |
-
/*$this->add_ajax_action( 'resolve_firewall_issues', array(
|
4844 |
-
&$this,
|
4845 |
-
'_email_about_firewall_issue'
|
4846 |
-
) );
|
4847 |
-
|
4848 |
-
$this->add_ajax_action( 'retry_connectivity_test', array(
|
4849 |
-
&$this,
|
4850 |
-
'_retry_connectivity_test'
|
4851 |
-
) );*/
|
4852 |
-
}
|
4853 |
-
}
|
4854 |
-
|
4855 |
-
return;
|
4856 |
-
} else {
|
4857 |
-
$this->_admin_notices->remove_sticky( array(
|
4858 |
-
'failed_connect_api_first',
|
4859 |
-
'failed_connect_api',
|
4860 |
-
) );
|
4861 |
-
|
4862 |
-
if ( $this->_anonymous_mode ) {
|
4863 |
-
// Simulate anonymous mode.
|
4864 |
-
$this->_is_anonymous = true;
|
4865 |
-
}
|
4866 |
-
}
|
4867 |
-
}
|
4868 |
-
}
|
4869 |
-
|
4870 |
-
/**
|
4871 |
-
* This should be executed even if Freemius is off for the core module,
|
4872 |
-
* otherwise, the add-ons dialogbox won't work properly. This is esepcially
|
4873 |
-
* relevant when the developer decided to turn FS off for existing users.
|
4874 |
-
*
|
4875 |
-
* @author Vova Feldman (@svovaf)
|
4876 |
-
*/
|
4877 |
-
if ( $this->is_user_in_admin() &&
|
4878 |
-
'plugin-information' === fs_request_get( 'tab', false ) &&
|
4879 |
-
$this->should_use_freemius_updater_and_dialog() &&
|
4880 |
-
(
|
4881 |
-
( $this->is_addon() && $this->get_slug() == fs_request_get( 'plugin', false ) ) ||
|
4882 |
-
( $this->has_addons() && $this->get_id() == fs_request_get( 'parent_plugin_id', false ) )
|
4883 |
-
)
|
4884 |
-
) {
|
4885 |
-
require_once WP_FS__DIR_INCLUDES . '/fs-plugin-info-dialog.php';
|
4886 |
-
|
4887 |
-
new FS_Plugin_Info_Dialog( $this->is_addon() ? $this->get_parent_instance() : $this );
|
4888 |
-
}
|
4889 |
-
|
4890 |
-
// Check if Freemius is on for the current plugin.
|
4891 |
-
// This MUST be executed after all the plugin variables has been loaded.
|
4892 |
-
if ( ! $this->is_registered() && ! $this->is_on() ) {
|
4893 |
-
return;
|
4894 |
-
}
|
4895 |
-
|
4896 |
-
if ( $this->has_api_connectivity() ) {
|
4897 |
-
if ( self::is_cron() ) {
|
4898 |
-
$this->hook_callback_to_sync_cron();
|
4899 |
-
} else if ( $this->is_user_in_admin() ) {
|
4900 |
-
/**
|
4901 |
-
* Schedule daily data sync cron if:
|
4902 |
-
*
|
4903 |
-
* 1. User opted-in (for tracking).
|
4904 |
-
* 2. If skipped, but later upgraded (opted-in via upgrade).
|
4905 |
-
*
|
4906 |
-
* @author Vova Feldman (@svovaf)
|
4907 |
-
* @since 1.1.7.3
|
4908 |
-
*
|
4909 |
-
*/
|
4910 |
-
if ( $this->is_registered() ) {
|
4911 |
-
if ( ! $this->is_sync_cron_on() && $this->is_tracking_allowed() ) {
|
4912 |
-
$this->schedule_sync_cron();
|
4913 |
-
}
|
4914 |
-
}
|
4915 |
-
|
4916 |
-
/**
|
4917 |
-
* Check if requested for manual blocking background sync.
|
4918 |
-
*/
|
4919 |
-
if ( fs_request_has( 'background_sync' ) ) {
|
4920 |
-
$this->run_manual_sync();
|
4921 |
-
}
|
4922 |
-
}
|
4923 |
-
}
|
4924 |
-
|
4925 |
-
if ( $this->is_registered() ) {
|
4926 |
-
$this->hook_callback_to_install_sync();
|
4927 |
-
}
|
4928 |
-
|
4929 |
-
if ( $this->is_addon() ) {
|
4930 |
-
if ( $this->is_parent_plugin_installed() ) {
|
4931 |
-
// Link to parent FS.
|
4932 |
-
$this->_parent = self::get_instance_by_id( $this->_plugin->parent_plugin_id );
|
4933 |
-
|
4934 |
-
// Get parent plugin reference.
|
4935 |
-
$this->_parent_plugin = $this->_parent->get_plugin();
|
4936 |
-
}
|
4937 |
-
}
|
4938 |
-
|
4939 |
-
if ( $this->is_user_in_admin() ) {
|
4940 |
-
if ( $this->is_addon() ) {
|
4941 |
-
if ( ! $this->is_parent_plugin_installed() ) {
|
4942 |
-
$parent_name = $this->get_option( $plugin_info, 'parent_name', null );
|
4943 |
-
|
4944 |
-
if ( isset( $plugin_info['parent'] ) ) {
|
4945 |
-
$parent_name = $this->get_option( $plugin_info['parent'], 'name', null );
|
4946 |
-
}
|
4947 |
-
|
4948 |
-
$this->_admin_notices->add(
|
4949 |
-
( ! empty( $parent_name ) ?
|
4950 |
-
sprintf( $this->get_text_x_inline( '%s cannot run without %s.', 'addonX cannot run without pluginY', 'addon-x-cannot-run-without-y' ), $this->get_plugin_name(), $parent_name ) :
|
4951 |
-
sprintf( $this->get_text_x_inline( '%s cannot run without the plugin.', 'addonX cannot run...', 'addon-x-cannot-run-without-parent' ), $this->get_plugin_name() )
|
4952 |
-
),
|
4953 |
-
$this->get_text_x_inline( 'Oops', 'exclamation', 'oops' ) . '...',
|
4954 |
-
'error'
|
4955 |
-
);
|
4956 |
-
|
4957 |
-
return;
|
4958 |
-
} else {
|
4959 |
-
$is_network_admin = fs_is_network_admin();
|
4960 |
-
|
4961 |
-
if ( ! $this->_parent->is_registered() && $this->is_registered() ) {
|
4962 |
-
// If add-on activated and parent not, automatically install parent for the user.
|
4963 |
-
$this->activate_parent_account( $this->_parent );
|
4964 |
-
} else if (
|
4965 |
-
$this->_parent->is_registered() &&
|
4966 |
-
! $this->is_registered() &&
|
4967 |
-
/**
|
4968 |
-
* If not registered for add-on and the following conditions for the add-on are met, activate add-on account.
|
4969 |
-
* * Network active and in network admin - network activate add-on account.
|
4970 |
-
* * Network active and not in network admin - activate add-on account for the current blog.
|
4971 |
-
* * Not network active and not in network admin - activate add-on account for the current blog.
|
4972 |
-
*
|
4973 |
-
* If not registered for add-on, not network active, and in network admin, do not handle the add-on activation.
|
4974 |
-
*
|
4975 |
-
* @author Leo Fajardo (@leorw)
|
4976 |
-
* @since 2.3.0
|
4977 |
-
*/
|
4978 |
-
( $this->is_network_active() || ! $is_network_admin )
|
4979 |
-
) {
|
4980 |
-
$premium_license = null;
|
4981 |
-
|
4982 |
-
if (
|
4983 |
-
! $this->has_free_plan() &&
|
4984 |
-
$this->is_bundle_license_auto_activation_enabled() &&
|
4985 |
-
$this->_parent->is_activated_with_bundle_license()
|
4986 |
-
) {
|
4987 |
-
/**
|
4988 |
-
* If the add-on has no free plan, try to activate the account only when there's a bundle license.
|
4989 |
-
*
|
4990 |
-
* @author Leo Fajardo (@leorw)
|
4991 |
-
* @since 2.4.0
|
4992 |
-
*/
|
4993 |
-
$bundle_license = $this->get_active_parent_license( $this->_parent->_get_license()->secret_key, false );
|
4994 |
-
|
4995 |
-
if (
|
4996 |
-
is_object( $bundle_license ) &&
|
4997 |
-
! empty( $bundle_license->products ) &&
|
4998 |
-
in_array( $this->get_id(), $bundle_license->products )
|
4999 |
-
) {
|
5000 |
-
$premium_license = $bundle_license;
|
5001 |
-
}
|
5002 |
-
}
|
5003 |
-
|
5004 |
-
if ( $this->has_free_plan() || is_object( $premium_license) ) {
|
5005 |
-
// If parent plugin activated, automatically install add-on for the user.
|
5006 |
-
$this->_activate_addon_account(
|
5007 |
-
$this->_parent,
|
5008 |
-
( $this->is_network_active() && $is_network_admin ) ?
|
5009 |
-
true :
|
5010 |
-
get_current_blog_id(),
|
5011 |
-
$premium_license
|
5012 |
-
);
|
5013 |
-
}
|
5014 |
-
}
|
5015 |
-
|
5016 |
-
// @todo This should be only executed on activation. It should be migrated to register_activation_hook() together with other activation related logic.
|
5017 |
-
if ( $this->is_premium() ) {
|
5018 |
-
// Remove add-on download admin-notice.
|
5019 |
-
$this->_parent->_admin_notices->remove_sticky( array(
|
5020 |
-
'addon_plan_upgraded_' . $this->_slug,
|
5021 |
-
'no_addon_license_' . $this->_slug,
|
5022 |
-
) );
|
5023 |
-
}
|
5024 |
-
|
5025 |
-
// $this->deactivate_premium_only_addon_without_license();
|
5026 |
-
}
|
5027 |
-
}
|
5028 |
-
|
5029 |
-
add_action( 'admin_init', array( &$this, '_admin_init_action' ) );
|
5030 |
-
|
5031 |
-
// if ( $this->is_registered() ||
|
5032 |
-
// $this->is_anonymous() ||
|
5033 |
-
// $this->is_pending_activation()
|
5034 |
-
// ) {
|
5035 |
-
// $this->_init_admin();
|
5036 |
-
// }
|
5037 |
-
}
|
5038 |
-
|
5039 |
-
/**
|
5040 |
-
* Should be called outside `$this->is_user_in_admin()` scope
|
5041 |
-
* because the updater has some logic that needs to be executed
|
5042 |
-
* during AJAX calls.
|
5043 |
-
*
|
5044 |
-
* Currently we need to hook to the `http_request_host_is_external` filter.
|
5045 |
-
* In the future, there might be additional logic added.
|
5046 |
-
*
|
5047 |
-
* @author Vova Feldman
|
5048 |
-
* @since 1.2.1.6
|
5049 |
-
*/
|
5050 |
-
if (
|
5051 |
-
$this->should_use_freemius_updater_and_dialog() &&
|
5052 |
-
(
|
5053 |
-
$this->is_premium() ||
|
5054 |
-
/**
|
5055 |
-
* If not premium but the premium version is installed, also instantiate the updater so that the
|
5056 |
-
* plugin information dialog of the premium version will have the information from the server.
|
5057 |
-
*
|
5058 |
-
* @author Leo Fajardo (@leorw)
|
5059 |
-
* @since 2.2.3
|
5060 |
-
*/
|
5061 |
-
( file_exists( fs_normalize_path( WP_PLUGIN_DIR . '/' . $this->premium_plugin_basename() ) ) )
|
5062 |
-
) &&
|
5063 |
-
$this->has_release_on_freemius()
|
5064 |
-
) {
|
5065 |
-
FS_Plugin_Updater::instance( $this );
|
5066 |
-
}
|
5067 |
-
|
5068 |
-
$this->do_action( 'initiated' );
|
5069 |
-
|
5070 |
-
if ( $this->_storage->prev_is_premium !== $this->_plugin->is_premium ) {
|
5071 |
-
if ( isset( $this->_storage->prev_is_premium ) ) {
|
5072 |
-
$this->apply_filters(
|
5073 |
-
'after_code_type_change',
|
5074 |
-
// New code type.
|
5075 |
-
$this->_plugin->is_premium
|
5076 |
-
);
|
5077 |
-
} else {
|
5078 |
-
// Set for code type for the first time.
|
5079 |
-
$this->_storage->prev_is_premium = $this->_plugin->is_premium;
|
5080 |
-
}
|
5081 |
-
}
|
5082 |
-
|
5083 |
-
if ( ! $this->is_addon() ) {
|
5084 |
-
if ( $this->is_registered() ) {
|
5085 |
-
// Fix for upgrade from versions < 1.0.9.
|
5086 |
-
if ( ! isset( $this->_storage->activation_timestamp ) ) {
|
5087 |
-
$this->_storage->activation_timestamp = WP_FS__SCRIPT_START_TIME;
|
5088 |
-
}
|
5089 |
-
|
5090 |
-
$this->do_action( 'after_init_plugin_registered' );
|
5091 |
-
} else if ( $this->is_anonymous() ) {
|
5092 |
-
$this->do_action( 'after_init_plugin_anonymous' );
|
5093 |
-
} else if ( $this->is_pending_activation() ) {
|
5094 |
-
$this->do_action( 'after_init_plugin_pending_activations' );
|
5095 |
-
}
|
5096 |
-
} else {
|
5097 |
-
if ( $this->is_registered() ) {
|
5098 |
-
$this->do_action( 'after_init_addon_registered' );
|
5099 |
-
} else if ( $this->is_anonymous() ) {
|
5100 |
-
$this->do_action( 'after_init_addon_anonymous' );
|
5101 |
-
} else if ( $this->is_pending_activation() ) {
|
5102 |
-
$this->do_action( 'after_init_addon_pending_activations' );
|
5103 |
-
}
|
5104 |
-
}
|
5105 |
-
}
|
5106 |
-
|
5107 |
-
/**
|
5108 |
-
* @author Leo Fajardo (@leorw)
|
5109 |
-
* @since 2.2.3
|
5110 |
-
*
|
5111 |
-
* @return bool
|
5112 |
-
*/
|
5113 |
-
private function should_use_freemius_updater_and_dialog() {
|
5114 |
-
return (
|
5115 |
-
/**
|
5116 |
-
* Allow updater and dialog when the `fs_allow_updater_and_dialog` URL query param exists and has `true`
|
5117 |
-
* value, or when the current page is not the "Add Plugins" page (/plugin-install.php) and the `action`
|
5118 |
-
* URL query param doesn't exist or its value is not `install-plugin` so that there will be no conflicts
|
5119 |
-
* with the .org plugins' functionalities (e.g. installation from the "Add Plugins" page and viewing
|
5120 |
-
* plugin details from .org).
|
5121 |
-
*/
|
5122 |
-
( true === fs_request_get_bool( 'fs_allow_updater_and_dialog' ) ) ||
|
5123 |
-
(
|
5124 |
-
! self::is_plugin_install_page() &&
|
5125 |
-
// Disallow updater and dialog when installing a plugin, otherwise .org "add-on" plugins will be affected.
|
5126 |
-
( 'install-plugin' !== fs_request_get( 'action' ) )
|
5127 |
-
)
|
5128 |
-
);
|
5129 |
-
}
|
5130 |
-
|
5131 |
-
/**
|
5132 |
-
* @author Leo Fajardo (@leorw)
|
5133 |
-
*
|
5134 |
-
* @since 1.2.1.5
|
5135 |
-
*/
|
5136 |
-
function _stop_tracking_callback() {
|
5137 |
-
$this->_logger->entrance();
|
5138 |
-
|
5139 |
-
$this->check_ajax_referer( 'stop_tracking' );
|
5140 |
-
|
5141 |
-
$result = $this->stop_tracking( fs_is_network_admin() );
|
5142 |
-
|
5143 |
-
if ( true === $result ) {
|
5144 |
-
self::shoot_ajax_success();
|
5145 |
-
}
|
5146 |
-
|
5147 |
-
$this->_logger->api_error( $result );
|
5148 |
-
|
5149 |
-
self::shoot_ajax_failure(
|
5150 |
-
sprintf( $this->get_text_inline( 'Unexpected API error. Please contact the %s\'s author with the following error.', 'unexpected-api-error' ), $this->_module_type ) .
|
5151 |
-
( $this->is_api_error( $result ) && isset( $result->error ) ?
|
5152 |
-
$result->error->message :
|
5153 |
-
var_export( $result, true ) )
|
5154 |
-
);
|
5155 |
-
}
|
5156 |
-
|
5157 |
-
/**
|
5158 |
-
* @author Leo Fajardo (@leorw)
|
5159 |
-
* @since 1.2.1.5
|
5160 |
-
*/
|
5161 |
-
function _allow_tracking_callback() {
|
5162 |
-
$this->_logger->entrance();
|
5163 |
-
|
5164 |
-
$this->check_ajax_referer( 'allow_tracking' );
|
5165 |
-
|
5166 |
-
$result = $this->allow_tracking( fs_is_network_admin() );
|
5167 |
-
|
5168 |
-
if ( true === $result ) {
|
5169 |
-
self::shoot_ajax_success();
|
5170 |
-
}
|
5171 |
-
|
5172 |
-
$this->_logger->api_error( $result );
|
5173 |
-
|
5174 |
-
self::shoot_ajax_failure(
|
5175 |
-
sprintf( $this->get_text_inline( 'Unexpected API error. Please contact the %s\'s author with the following error.', 'unexpected-api-error' ), $this->_module_type ) .
|
5176 |
-
( $this->is_api_error( $result ) && isset( $result->error ) ?
|
5177 |
-
$result->error->message :
|
5178 |
-
var_export( $result, true ) )
|
5179 |
-
);
|
5180 |
-
}
|
5181 |
-
|
5182 |
-
/**
|
5183 |
-
* Opt-out from usage tracking.
|
5184 |
-
*
|
5185 |
-
* Note: This will not delete the account information but will stop all tracking.
|
5186 |
-
*
|
5187 |
-
* Returns:
|
5188 |
-
* 1. FALSE - If the user never opted-in.
|
5189 |
-
* 2. TRUE - If successfully opted-out.
|
5190 |
-
* 3. object - API result on failure.
|
5191 |
-
*
|
5192 |
-
* @author Leo Fajardo (@leorw)
|
5193 |
-
* @since 1.2.1.5
|
5194 |
-
*
|
5195 |
-
* @return bool|object
|
5196 |
-
*/
|
5197 |
-
function stop_site_tracking() {
|
5198 |
-
$this->_logger->entrance();
|
5199 |
-
|
5200 |
-
if ( ! $this->is_registered() ) {
|
5201 |
-
// User never opted-in.
|
5202 |
-
return false;
|
5203 |
-
}
|
5204 |
-
|
5205 |
-
if ( $this->is_tracking_prohibited() ) {
|
5206 |
-
// Already disconnected.
|
5207 |
-
return true;
|
5208 |
-
}
|
5209 |
-
|
5210 |
-
// Send update to FS.
|
5211 |
-
$result = $this->get_api_site_scope()->call( '/?fields=is_disconnected', 'put', array(
|
5212 |
-
'is_disconnected' => true
|
5213 |
-
) );
|
5214 |
-
|
5215 |
-
if ( ! $this->is_api_result_entity( $result ) ||
|
5216 |
-
! isset( $result->is_disconnected ) ||
|
5217 |
-
! $result->is_disconnected
|
5218 |
-
) {
|
5219 |
-
$this->_logger->api_error( $result );
|
5220 |
-
|
5221 |
-
return $result;
|
5222 |
-
}
|
5223 |
-
|
5224 |
-
$this->_site->is_disconnected = $result->is_disconnected;
|
5225 |
-
$this->_store_site();
|
5226 |
-
|
5227 |
-
$this->clear_sync_cron();
|
5228 |
-
|
5229 |
-
// Successfully disconnected.
|
5230 |
-
return true;
|
5231 |
-
}
|
5232 |
-
|
5233 |
-
/**
|
5234 |
-
* Opt-out network from usage tracking.
|
5235 |
-
*
|
5236 |
-
* Note: This will not delete the account information but will stop all tracking.
|
5237 |
-
*
|
5238 |
-
* Returns:
|
5239 |
-
* 1. FALSE - If the user never opted-in.
|
5240 |
-
* 2. TRUE - If successfully opted-out.
|
5241 |
-
* 3. object - API result on failure.
|
5242 |
-
*
|
5243 |
-
* @author Leo Fajardo (@leorw)
|
5244 |
-
* @since 1.2.1.5
|
5245 |
-
*
|
5246 |
-
* @return bool|object
|
5247 |
-
*/
|
5248 |
-
function stop_network_tracking() {
|
5249 |
-
$this->_logger->entrance();
|
5250 |
-
|
5251 |
-
if ( ! $this->is_registered() ) {
|
5252 |
-
// User never opted-in.
|
5253 |
-
return false;
|
5254 |
-
}
|
5255 |
-
|
5256 |
-
$install_id_2_blog_id = array();
|
5257 |
-
$installs_map = $this->get_blog_install_map();
|
5258 |
-
|
5259 |
-
$opt_out_all = true;
|
5260 |
-
|
5261 |
-
$params = array();
|
5262 |
-
foreach ( $installs_map as $blog_id => $install ) {
|
5263 |
-
if ( $install->is_tracking_prohibited() ) {
|
5264 |
-
// Already opted-out.
|
5265 |
-
continue;
|
5266 |
-
}
|
5267 |
-
|
5268 |
-
if ( $this->is_site_delegated_connection( $blog_id ) ) {
|
5269 |
-
// Opt-out only from non-delegated installs.
|
5270 |
-
$opt_out_all = false;
|
5271 |
-
continue;
|
5272 |
-
}
|
5273 |
-
|
5274 |
-
$params[] = array( 'id' => $install->id );
|
5275 |
-
|
5276 |
-
$install_id_2_blog_id[ $install->id ] = $blog_id;
|
5277 |
-
}
|
5278 |
-
|
5279 |
-
if ( empty( $install_id_2_blog_id ) ) {
|
5280 |
-
return true;
|
5281 |
-
}
|
5282 |
-
|
5283 |
-
$params[] = array( 'is_disconnected' => true );
|
5284 |
-
|
5285 |
-
// Send update to FS.
|
5286 |
-
$result = $this->get_current_or_network_user_api_scope()->call( "/plugins/{$this->_module_id}/installs.json", 'put', $params );
|
5287 |
-
|
5288 |
-
if ( ! $this->is_api_result_object( $result, 'installs' ) ) {
|
5289 |
-
$this->_logger->api_error( $result );
|
5290 |
-
|
5291 |
-
return $result;
|
5292 |
-
}
|
5293 |
-
|
5294 |
-
foreach ( $result->installs as $r_install ) {
|
5295 |
-
$blog_id = $install_id_2_blog_id[ $r_install->id ];
|
5296 |
-
$install = $installs_map[ $blog_id ];
|
5297 |
-
$install->is_disconnected = $r_install->is_disconnected;
|
5298 |
-
$this->_store_site( true, $blog_id, $install );
|
5299 |
-
}
|
5300 |
-
|
5301 |
-
$this->clear_sync_cron( $opt_out_all );
|
5302 |
-
|
5303 |
-
// Successfully disconnected.
|
5304 |
-
return true;
|
5305 |
-
}
|
5306 |
-
|
5307 |
-
/**
|
5308 |
-
* Opt-out from usage tracking.
|
5309 |
-
*
|
5310 |
-
* Note: This will not delete the account information but will stop all tracking.
|
5311 |
-
*
|
5312 |
-
* Returns:
|
5313 |
-
* 1. FALSE - If the user never opted-in.
|
5314 |
-
* 2. TRUE - If successfully opted-out.
|
5315 |
-
* 3. object - API result on failure.
|
5316 |
-
*
|
5317 |
-
* @author Leo Fajardo (@leorw)
|
5318 |
-
* @since 1.2.1.5
|
5319 |
-
*
|
5320 |
-
* @param bool $is_network_action
|
5321 |
-
*
|
5322 |
-
* @return bool|object
|
5323 |
-
*/
|
5324 |
-
function stop_tracking( $is_network_action = false ) {
|
5325 |
-
$this->_logger->entrance();
|
5326 |
-
|
5327 |
-
return $is_network_action ?
|
5328 |
-
$this->stop_network_tracking() :
|
5329 |
-
$this->stop_site_tracking();
|
5330 |
-
}
|
5331 |
-
|
5332 |
-
/**
|
5333 |
-
* Opt-in back into usage tracking.
|
5334 |
-
*
|
5335 |
-
* Note: This will only work if the user opted-in previously.
|
5336 |
-
*
|
5337 |
-
* Returns:
|
5338 |
-
* 1. FALSE - If the user never opted-in.
|
5339 |
-
* 2. TRUE - If successfully opted-in back to usage tracking.
|
5340 |
-
* 3. object - API result on failure.
|
5341 |
-
*
|
5342 |
-
* @author Leo Fajardo (@leorw)
|
5343 |
-
* @since 1.2.1.5
|
5344 |
-
*
|
5345 |
-
* @return bool|object
|
5346 |
-
*/
|
5347 |
-
function allow_site_tracking() {
|
5348 |
-
$this->_logger->entrance();
|
5349 |
-
|
5350 |
-
if ( ! $this->is_registered() ) {
|
5351 |
-
// User never opted-in.
|
5352 |
-
return false;
|
5353 |
-
}
|
5354 |
-
|
5355 |
-
if ( $this->is_tracking_allowed() ) {
|
5356 |
-
// Tracking already allowed.
|
5357 |
-
return true;
|
5358 |
-
}
|
5359 |
-
|
5360 |
-
$result = $this->get_api_site_scope()->call( '/?is_disconnected', 'put', array(
|
5361 |
-
'is_disconnected' => false
|
5362 |
-
) );
|
5363 |
-
|
5364 |
-
if ( ! $this->is_api_result_entity( $result ) ||
|
5365 |
-
! isset( $result->is_disconnected ) ||
|
5366 |
-
$result->is_disconnected
|
5367 |
-
) {
|
5368 |
-
$this->_logger->api_error( $result );
|
5369 |
-
|
5370 |
-
return $result;
|
5371 |
-
}
|
5372 |
-
|
5373 |
-
$this->_site->is_disconnected = $result->is_disconnected;
|
5374 |
-
$this->_store_site();
|
5375 |
-
|
5376 |
-
$this->schedule_sync_cron();
|
5377 |
-
|
5378 |
-
// Successfully reconnected.
|
5379 |
-
return true;
|
5380 |
-
}
|
5381 |
-
|
5382 |
-
/**
|
5383 |
-
* Opt-in network back into usage tracking.
|
5384 |
-
*
|
5385 |
-
* Note: This will only work if the user opted-in previously.
|
5386 |
-
*
|
5387 |
-
* Returns:
|
5388 |
-
* 1. FALSE - If the user never opted-in.
|
5389 |
-
* 2. TRUE - If successfully opted-in back to usage tracking.
|
5390 |
-
* 3. object - API result on failure.
|
5391 |
-
*
|
5392 |
-
* @author Leo Fajardo (@leorw)
|
5393 |
-
* @since 1.2.1.5
|
5394 |
-
*
|
5395 |
-
* @return bool|object
|
5396 |
-
*/
|
5397 |
-
function allow_network_tracking() {
|
5398 |
-
$this->_logger->entrance();
|
5399 |
-
|
5400 |
-
if ( ! $this->is_registered() ) {
|
5401 |
-
// User never opted-in.
|
5402 |
-
return false;
|
5403 |
-
}
|
5404 |
-
|
5405 |
-
$install_id_2_blog_id = array();
|
5406 |
-
$installs_map = $this->get_blog_install_map();
|
5407 |
-
|
5408 |
-
$params = array();
|
5409 |
-
foreach ( $installs_map as $blog_id => $install ) {
|
5410 |
-
if ( $install->is_tracking_allowed() ) {
|
5411 |
-
continue;
|
5412 |
-
}
|
5413 |
-
|
5414 |
-
$params[] = array( 'id' => $install->id );
|
5415 |
-
|
5416 |
-
$install_id_2_blog_id[ $install->id ] = $blog_id;
|
5417 |
-
}
|
5418 |
-
|
5419 |
-
if ( empty( $install_id_2_blog_id ) ) {
|
5420 |
-
return true;
|
5421 |
-
}
|
5422 |
-
|
5423 |
-
$params[] = array( 'is_disconnected' => false );
|
5424 |
-
|
5425 |
-
// Send update to FS.
|
5426 |
-
$result = $this->get_current_or_network_user_api_scope()->call( "/plugins/{$this->_module_id}/installs.json", 'put', $params );
|
5427 |
-
|
5428 |
-
|
5429 |
-
if ( ! $this->is_api_result_object( $result, 'installs' ) ) {
|
5430 |
-
$this->_logger->api_error( $result );
|
5431 |
-
|
5432 |
-
return $result;
|
5433 |
-
}
|
5434 |
-
|
5435 |
-
foreach ( $result->installs as $r_install ) {
|
5436 |
-
$blog_id = $install_id_2_blog_id[ $r_install->id ];
|
5437 |
-
$install = $installs_map[ $blog_id ];
|
5438 |
-
$install->is_disconnected = $r_install->is_disconnected;
|
5439 |
-
$this->_store_site( true, $blog_id, $install );
|
5440 |
-
}
|
5441 |
-
|
5442 |
-
$this->schedule_sync_cron();
|
5443 |
-
|
5444 |
-
// Successfully reconnected.
|
5445 |
-
return true;
|
5446 |
-
}
|
5447 |
-
|
5448 |
-
/**
|
5449 |
-
* Opt-in back into usage tracking.
|
5450 |
-
*
|
5451 |
-
* Note: This will only work if the user opted-in previously.
|
5452 |
-
*
|
5453 |
-
* Returns:
|
5454 |
-
* 1. FALSE - If the user never opted-in.
|
5455 |
-
* 2. TRUE - If successfully opted-in back to usage tracking.
|
5456 |
-
* 3. object - API result on failure.
|
5457 |
-
*
|
5458 |
-
* @author Leo Fajardo (@leorw)
|
5459 |
-
* @since 1.2.1.5
|
5460 |
-
*
|
5461 |
-
* @param bool $is_network_action
|
5462 |
-
*
|
5463 |
-
* @return bool|object
|
5464 |
-
*/
|
5465 |
-
function allow_tracking( $is_network_action = false ) {
|
5466 |
-
$this->_logger->entrance();
|
5467 |
-
|
5468 |
-
return $is_network_action ?
|
5469 |
-
$this->allow_network_tracking() :
|
5470 |
-
$this->allow_site_tracking();
|
5471 |
-
}
|
5472 |
-
|
5473 |
-
/**
|
5474 |
-
* If user opted-in and later disabled usage-tracking,
|
5475 |
-
* re-allow tracking for licensing and updates.
|
5476 |
-
*
|
5477 |
-
* @author Leo Fajardo (@leorw)
|
5478 |
-
* @since 1.2.1.5
|
5479 |
-
*
|
5480 |
-
* @param bool $is_context_single_site
|
5481 |
-
*/
|
5482 |
-
private function reconnect_locally( $is_context_single_site = false ) {
|
5483 |
-
$this->_logger->entrance();
|
5484 |
-
|
5485 |
-
if ( ! $this->is_registered() ) {
|
5486 |
-
return;
|
5487 |
-
}
|
5488 |
-
|
5489 |
-
if ( ! fs_is_network_admin() || $is_context_single_site ) {
|
5490 |
-
if ( $this->is_tracking_prohibited() ) {
|
5491 |
-
$this->_site->is_disconnected = false;
|
5492 |
-
$this->_store_site();
|
5493 |
-
}
|
5494 |
-
} else {
|
5495 |
-
$installs_map = $this->get_blog_install_map();
|
5496 |
-
foreach ( $installs_map as $blog_id => $install ) {
|
5497 |
-
/**
|
5498 |
-
* @var FS_Site $install
|
5499 |
-
*/
|
5500 |
-
if ( $install->is_tracking_prohibited() ) {
|
5501 |
-
$install->is_disconnected = false;
|
5502 |
-
$this->_store_site( true, $blog_id, $install );
|
5503 |
-
}
|
5504 |
-
}
|
5505 |
-
}
|
5506 |
-
}
|
5507 |
-
|
5508 |
-
/**
|
5509 |
-
* @author Vova Feldman (@svovaf)
|
5510 |
-
* @since 2.3.2
|
5511 |
-
*
|
5512 |
-
* @return bool
|
5513 |
-
*/
|
5514 |
-
function is_extensions_tracking_allowed() {
|
5515 |
-
return ( true === $this->apply_filters(
|
5516 |
-
'is_extensions_tracking_allowed',
|
5517 |
-
$this->_storage->get( 'is_extensions_tracking_allowed', null )
|
5518 |
-
) );
|
5519 |
-
}
|
5520 |
-
|
5521 |
-
/**
|
5522 |
-
* @author Vova Feldman (@svovaf)
|
5523 |
-
* @since 2.3.2
|
5524 |
-
*/
|
5525 |
-
function _update_tracking_permission_callback() {
|
5526 |
-
$this->_logger->entrance();
|
5527 |
-
|
5528 |
-
$this->check_ajax_referer( 'update_tracking_permission' );
|
5529 |
-
|
5530 |
-
$is_enabled = fs_request_get_bool( 'is_enabled', null );
|
5531 |
-
|
5532 |
-
if ( ! is_bool( $is_enabled ) ) {
|
5533 |
-
self::shoot_ajax_failure();
|
5534 |
-
}
|
5535 |
-
|
5536 |
-
$permission = fs_request_get( 'permission' );
|
5537 |
-
|
5538 |
-
switch ( $permission ) {
|
5539 |
-
case 'extensions':
|
5540 |
-
$this->update_extensions_tracking_flag( $is_enabled );
|
5541 |
-
break;
|
5542 |
-
default:
|
5543 |
-
$permission = 'no_match';
|
5544 |
-
}
|
5545 |
-
|
5546 |
-
if ( 'no_match' === $permission ) {
|
5547 |
-
self::shoot_ajax_failure();
|
5548 |
-
}
|
5549 |
-
|
5550 |
-
self::shoot_ajax_success( array(
|
5551 |
-
'permissions' => array(
|
5552 |
-
$permission => $is_enabled,
|
5553 |
-
)
|
5554 |
-
) );
|
5555 |
-
}
|
5556 |
-
|
5557 |
-
/**
|
5558 |
-
* @author Leo Fajardo (@leorw)
|
5559 |
-
* @since 2.3.2
|
5560 |
-
*
|
5561 |
-
* @param bool|null $is_enabled
|
5562 |
-
*/
|
5563 |
-
function update_extensions_tracking_flag( $is_enabled ) {
|
5564 |
-
if ( is_bool( $is_enabled ) ) {
|
5565 |
-
$this->_storage->store( 'is_extensions_tracking_allowed', $is_enabled );
|
5566 |
-
}
|
5567 |
-
}
|
5568 |
-
|
5569 |
-
/**
|
5570 |
-
* Parse plugin's settings (as defined by the plugin dev).
|
5571 |
-
*
|
5572 |
-
* @author Vova Feldman (@svovaf)
|
5573 |
-
* @since 1.1.7.3
|
5574 |
-
*
|
5575 |
-
* @param array $plugin_info
|
5576 |
-
*
|
5577 |
-
* @throws \Freemius_Exception
|
5578 |
-
*/
|
5579 |
-
private function parse_settings( &$plugin_info ) {
|
5580 |
-
$this->_logger->entrance();
|
5581 |
-
|
5582 |
-
$id = $this->get_numeric_option( $plugin_info, 'id', false );
|
5583 |
-
$public_key = $this->get_option( $plugin_info, 'public_key', false );
|
5584 |
-
$secret_key = $this->get_option( $plugin_info, 'secret_key', null );
|
5585 |
-
$parent_id = $this->get_numeric_option( $plugin_info, 'parent_id', null );
|
5586 |
-
$parent_name = $this->get_option( $plugin_info, 'parent_name', null );
|
5587 |
-
|
5588 |
-
/**
|
5589 |
-
* @author Vova Feldman (@svovaf)
|
5590 |
-
* @since 1.1.9 Try to pull secret key from external config.
|
5591 |
-
*/
|
5592 |
-
if ( is_null( $secret_key ) && defined( "WP_FS__{$this->_slug}_SECRET_KEY" ) ) {
|
5593 |
-
$secret_key = constant( "WP_FS__{$this->_slug}_SECRET_KEY" );
|
5594 |
-
}
|
5595 |
-
|
5596 |
-
if ( isset( $plugin_info['parent'] ) ) {
|
5597 |
-
$parent_id = $this->get_numeric_option( $plugin_info['parent'], 'id', null );
|
5598 |
-
// $parent_slug = $this->get_option( $plugin_info['parent'], 'slug', null );
|
5599 |
-
// $parent_public_key = $this->get_option( $plugin_info['parent'], 'public_key', null );
|
5600 |
-
// $parent_name = $this->get_option( $plugin_info['parent'], 'name', null );
|
5601 |
-
}
|
5602 |
-
|
5603 |
-
if ( false === $id ) {
|
5604 |
-
throw new Freemius_Exception( array(
|
5605 |
-
'error' => array(
|
5606 |
-
'type' => 'ParameterNotSet',
|
5607 |
-
'message' => 'Plugin id parameter is not set.',
|
5608 |
-
'code' => 'plugin_id_not_set',
|
5609 |
-
'http' => 500,
|
5610 |
-
)
|
5611 |
-
) );
|
5612 |
-
}
|
5613 |
-
if ( false === $public_key ) {
|
5614 |
-
throw new Freemius_Exception( array(
|
5615 |
-
'error' => array(
|
5616 |
-
'type' => 'ParameterNotSet',
|
5617 |
-
'message' => 'Plugin public_key parameter is not set.',
|
5618 |
-
'code' => 'plugin_public_key_not_set',
|
5619 |
-
'http' => 500,
|
5620 |
-
)
|
5621 |
-
) );
|
5622 |
-
}
|
5623 |
-
|
5624 |
-
$plugin = ( $this->_plugin instanceof FS_Plugin ) ?
|
5625 |
-
$this->_plugin :
|
5626 |
-
new FS_Plugin();
|
5627 |
-
|
5628 |
-
$premium_suffix = $this->get_option( $plugin_info, 'premium_suffix', '(Premium)' );
|
5629 |
-
|
5630 |
-
$plugin->update( array(
|
5631 |
-
'id' => $id,
|
5632 |
-
'type' => $this->get_option( $plugin_info, 'type', $this->_module_type ),
|
5633 |
-
'public_key' => $public_key,
|
5634 |
-
'slug' => $this->_slug,
|
5635 |
-
'premium_slug' => $this->get_option( $plugin_info, 'premium_slug', "{$this->_slug}-premium" ),
|
5636 |
-
'parent_plugin_id' => $parent_id,
|
5637 |
-
'version' => $this->get_plugin_version(),
|
5638 |
-
'title' => $this->get_plugin_name( $premium_suffix ),
|
5639 |
-
'file' => $this->_plugin_basename,
|
5640 |
-
'is_premium' => $this->get_bool_option( $plugin_info, 'is_premium', true ),
|
5641 |
-
'premium_suffix' => $premium_suffix,
|
5642 |
-
'is_live' => $this->get_bool_option( $plugin_info, 'is_live', true ),
|
5643 |
-
'affiliate_moderation' => $this->get_option( $plugin_info, 'has_affiliation' ),
|
5644 |
-
'bundle_id' => $this->get_option( $plugin_info, 'bundle_id', null ),
|
5645 |
-
'bundle_public_key' => $this->get_option( $plugin_info, 'bundle_public_key', null ),
|
5646 |
-
) );
|
5647 |
-
|
5648 |
-
if ( $plugin->is_updated() ) {
|
5649 |
-
// Update plugin details.
|
5650 |
-
$this->_plugin = FS_Plugin_Manager::instance( $this->_module_id )->store( $plugin );
|
5651 |
-
}
|
5652 |
-
// Set the secret key after storing the plugin, we don't want to store the key in the storage.
|
5653 |
-
$this->_plugin->secret_key = $secret_key;
|
5654 |
-
|
5655 |
-
/**
|
5656 |
-
* If the product is network integrated and activated and the current view is in the network level Admin dashboard, if the product's network-level menu located differently from the sub-site level, then use the network menu details (when set).
|
5657 |
-
*
|
5658 |
-
* @author Vova Feldman
|
5659 |
-
* @since 2.4.5
|
5660 |
-
*/
|
5661 |
-
if ( $this->is_network_active() && fs_is_network_admin() ) {
|
5662 |
-
if ( isset( $plugin_info['menu_network'] ) &&
|
5663 |
-
is_array( $plugin_info['menu_network'] ) &&
|
5664 |
-
! empty( $plugin_info['menu_network'] )
|
5665 |
-
) {
|
5666 |
-
$plugin_info['menu'] = $plugin_info['menu_network'];
|
5667 |
-
}
|
5668 |
-
}
|
5669 |
-
|
5670 |
-
if ( ! isset( $plugin_info['menu'] ) ) {
|
5671 |
-
$plugin_info['menu'] = array();
|
5672 |
-
|
5673 |
-
if ( ! empty( $this->_storage->sdk_last_version ) &&
|
5674 |
-
version_compare( $this->_storage->sdk_last_version, '1.1.2', '<=' )
|
5675 |
-
) {
|
5676 |
-
// Backward compatibility to 1.1.2
|
5677 |
-
$plugin_info['menu']['slug'] = isset( $plugin_info['menu_slug'] ) ?
|
5678 |
-
$plugin_info['menu_slug'] :
|
5679 |
-
$this->_slug;
|
5680 |
-
}
|
5681 |
-
}
|
5682 |
-
|
5683 |
-
$this->_menu = FS_Admin_Menu_Manager::instance(
|
5684 |
-
$this->_module_id,
|
5685 |
-
$this->_module_type,
|
5686 |
-
$this->get_unique_affix()
|
5687 |
-
);
|
5688 |
-
|
5689 |
-
$this->_menu->init( $plugin_info['menu'], $this->is_addon() );
|
5690 |
-
|
5691 |
-
$this->_has_addons = $this->get_bool_option( $plugin_info, 'has_addons', false );
|
5692 |
-
$this->_has_paid_plans = $this->get_bool_option( $plugin_info, 'has_paid_plans', true );
|
5693 |
-
$this->_has_premium_version = $this->get_bool_option( $plugin_info, 'has_premium_version', $this->_has_paid_plans );
|
5694 |
-
$this->_ignore_pending_mode = $this->get_bool_option( $plugin_info, 'ignore_pending_mode', false );
|
5695 |
-
$this->_is_org_compliant = $this->get_bool_option( $plugin_info, 'is_org_compliant', true );
|
5696 |
-
$this->_is_premium_only = $this->get_bool_option( $plugin_info, 'is_premium_only', false );
|
5697 |
-
if ( $this->_is_premium_only ) {
|
5698 |
-
// If premium only plugin, disable anonymous mode.
|
5699 |
-
$this->_enable_anonymous = false;
|
5700 |
-
$this->_anonymous_mode = false;
|
5701 |
-
} else {
|
5702 |
-
$this->_enable_anonymous = $this->get_bool_option( $plugin_info, 'enable_anonymous', true );
|
5703 |
-
$this->_anonymous_mode = $this->get_bool_option( $plugin_info, 'anonymous_mode', false );
|
5704 |
-
}
|
5705 |
-
$this->_permissions = $this->get_option( $plugin_info, 'permissions', array() );
|
5706 |
-
$this->_is_bundle_license_auto_activation_enabled = $this->get_option( $plugin_info, 'bundle_license_auto_activation', false );
|
5707 |
-
|
5708 |
-
if ( ! empty( $plugin_info['trial'] ) ) {
|
5709 |
-
$this->_trial_days = $this->get_numeric_option(
|
5710 |
-
$plugin_info['trial'],
|
5711 |
-
'days',
|
5712 |
-
// Default to 0 - trial without days specification.
|
5713 |
-
0
|
5714 |
-
);
|
5715 |
-
|
5716 |
-
$this->_is_trial_require_payment = $this->get_bool_option( $plugin_info['trial'], 'is_require_payment', false );
|
5717 |
-
}
|
5718 |
-
|
5719 |
-
$this->_navigation = $this->get_option(
|
5720 |
-
$plugin_
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|