Version Description
What's new
- Added compatibility with the Gutenberg editor. Learn more.
Fixes
- Fixed
<img>
icon appearance of the[su_service]
shortcode
Download this release
Release Info
Developer | gn_themes |
Plugin | Shortcodes Ultimate |
Version | 5.1.0 |
Comparing to | |
See all releases |
Code changes from version 5.0.8 to 5.1.0
- admin/class-shortcodes-ultimate-admin-settings.php +12 -0
- admin/class-shortcodes-ultimate-admin.php +11 -0
- admin/partials/settings/fields/checkbox-group.php +22 -0
- assets/css/magnific-popup.css +47 -64
- assets/js/magnific-popup.js +3 -3
- inc/core/assets.php +5 -5
- inc/core/generator.php +144 -35
- includes/class-shortcodes-ultimate-activator.php +5 -0
- includes/config/supported-blocks.php +10 -0
- includes/functions-helpers.php +20 -3
- includes/js/block-editor/index.js +3 -0
- includes/js/block-editor/index.js.map +1 -0
- includes/js/generator/index.js +3 -0
- includes/js/generator/index.js.map +1 -0
- includes/shortcodes/service.php +59 -47
- includes/shortcodes/slider.php +1 -1
- readme.txt +6 -1
- shortcodes-ultimate.php +2 -2
admin/class-shortcodes-ultimate-admin-settings.php
CHANGED
@@ -203,6 +203,18 @@ final class Shortcodes_Ultimate_Admin_Settings extends Shortcodes_Ultimate_Admin
|
|
203 |
'description' => __( 'In this field you can write your custom CSS code for shortcodes. These styles will have higher priority compared to original styles of shortcodes. You can use variables in your CSS code. These variables will be replaced by respective values.', 'shortcodes-ultimate' ),
|
204 |
);
|
205 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
206 |
}
|
207 |
|
208 |
return apply_filters( 'su/admin/settings', $this->plugin_settings );
|
203 |
'description' => __( 'In this field you can write your custom CSS code for shortcodes. These styles will have higher priority compared to original styles of shortcodes. You can use variables in your CSS code. These variables will be replaced by respective values.', 'shortcodes-ultimate' ),
|
204 |
);
|
205 |
|
206 |
+
/**
|
207 |
+
* @since 5.1.0
|
208 |
+
*/
|
209 |
+
$this->plugin_settings[] = array(
|
210 |
+
'id' => 'su_option_supported_blocks',
|
211 |
+
'type' => 'checkbox-group',
|
212 |
+
'sanitize' => array( $this, 'sanitize_checkbox_group' ),
|
213 |
+
'title' => __( 'Supported blocks', 'shortcodes-ultimate' ),
|
214 |
+
'description' => __( 'Enable the "Insert Shortcode" button in selected blocks', 'shortcodes-ultimate' ),
|
215 |
+
'options' => su_get_config( 'supported-blocks' ),
|
216 |
+
);
|
217 |
+
|
218 |
}
|
219 |
|
220 |
return apply_filters( 'su/admin/settings', $this->plugin_settings );
|
admin/class-shortcodes-ultimate-admin.php
CHANGED
@@ -392,6 +392,17 @@ abstract class Shortcodes_Ultimate_Admin {
|
|
392 |
return ! empty( $value ) && 'on' === $value ? 'on' : '';
|
393 |
}
|
394 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
395 |
/**
|
396 |
* Callback function to sanitize prefix value.
|
397 |
*
|
392 |
return ! empty( $value ) && 'on' === $value ? 'on' : '';
|
393 |
}
|
394 |
|
395 |
+
/**
|
396 |
+
* Callback function to sanitize checkbox-group value.
|
397 |
+
*
|
398 |
+
* @since 5.1.0
|
399 |
+
* @param mixed $value Array with selected checkboxes or null.
|
400 |
+
* @return string Array with selected checkbox IDs, each sanitized.
|
401 |
+
*/
|
402 |
+
public function sanitize_checkbox_group( $value ) {
|
403 |
+
return array_map( 'sanitize_text_field', array_keys( (array) $value ) );
|
404 |
+
}
|
405 |
+
|
406 |
/**
|
407 |
* Callback function to sanitize prefix value.
|
408 |
*
|
admin/partials/settings/fields/checkbox-group.php
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php defined( 'ABSPATH' ) || exit; ?>
|
2 |
+
|
3 |
+
<fieldset>
|
4 |
+
|
5 |
+
<?php foreach ( $data['options'] as $cb_id => $cb_label ) : ?>
|
6 |
+
|
7 |
+
<input
|
8 |
+
type="checkbox"
|
9 |
+
name="<?php echo esc_attr( sprintf( '%s[%s]', $data['id'], $cb_id ) ); ?>"
|
10 |
+
id="<?php echo esc_attr( sprintf( '%s_%s', $data['id'], $cb_id ) ); ?>"
|
11 |
+
<?php checked( in_array( $cb_id, get_option( $data['id'], array() ), true ) ); ?>
|
12 |
+
>
|
13 |
+
<label for="<?php echo esc_attr( sprintf( '%s_%s', $data['id'], $cb_id ) ); ?>" >
|
14 |
+
<?php echo esc_html( $cb_label ); ?>
|
15 |
+
</label>
|
16 |
+
<br>
|
17 |
+
|
18 |
+
<?php endforeach; ?>
|
19 |
+
|
20 |
+
</fieldset>
|
21 |
+
|
22 |
+
<p class="description"><?php echo $data['description']; ?></p>
|
assets/css/magnific-popup.css
CHANGED
@@ -8,8 +8,7 @@
|
|
8 |
overflow: hidden;
|
9 |
position: fixed;
|
10 |
background: #0b0b0b;
|
11 |
-
opacity: 0.8;
|
12 |
-
filter: alpha(opacity=80); }
|
13 |
|
14 |
.mfp-wrap {
|
15 |
top: 0;
|
@@ -29,8 +28,6 @@
|
|
29 |
left: 0;
|
30 |
top: 0;
|
31 |
padding: 0 8px;
|
32 |
-
-webkit-box-sizing: border-box;
|
33 |
-
-moz-box-sizing: border-box;
|
34 |
box-sizing: border-box; }
|
35 |
|
36 |
.mfp-container:before {
|
@@ -50,7 +47,8 @@
|
|
50 |
text-align: left;
|
51 |
z-index: 1045; }
|
52 |
|
53 |
-
.mfp-inline-holder .mfp-content,
|
|
|
54 |
width: 100%;
|
55 |
cursor: auto; }
|
56 |
|
@@ -71,7 +69,10 @@
|
|
71 |
.mfp-auto-cursor .mfp-content {
|
72 |
cursor: auto; }
|
73 |
|
74 |
-
.mfp-close,
|
|
|
|
|
|
|
75 |
-webkit-user-select: none;
|
76 |
-moz-user-select: none;
|
77 |
user-select: none; }
|
@@ -83,7 +84,7 @@
|
|
83 |
display: none !important; }
|
84 |
|
85 |
.mfp-preloader {
|
86 |
-
color: #
|
87 |
position: absolute;
|
88 |
top: 50%;
|
89 |
width: auto;
|
@@ -93,9 +94,9 @@
|
|
93 |
right: 8px;
|
94 |
z-index: 1044; }
|
95 |
.mfp-preloader a {
|
96 |
-
color: #
|
97 |
.mfp-preloader a:hover {
|
98 |
-
color:
|
99 |
|
100 |
.mfp-s-ready .mfp-preloader {
|
101 |
display: none; }
|
@@ -103,7 +104,8 @@
|
|
103 |
.mfp-s-error .mfp-content {
|
104 |
display: none; }
|
105 |
|
106 |
-
button.mfp-close,
|
|
|
107 |
overflow: visible;
|
108 |
cursor: pointer;
|
109 |
background: transparent;
|
@@ -113,8 +115,9 @@ button.mfp-close, button.mfp-arrow {
|
|
113 |
outline: none;
|
114 |
padding: 0;
|
115 |
z-index: 1046;
|
116 |
-
|
117 |
-
|
|
|
118 |
button::-moz-focus-inner {
|
119 |
padding: 0;
|
120 |
border: 0; }
|
@@ -129,23 +132,23 @@ button::-moz-focus-inner {
|
|
129 |
text-decoration: none;
|
130 |
text-align: center;
|
131 |
opacity: 0.65;
|
132 |
-
filter: alpha(opacity=65);
|
133 |
padding: 0 0 18px 10px;
|
134 |
-
color:
|
135 |
font-style: normal;
|
136 |
font-size: 28px;
|
137 |
font-family: Arial, Baskerville, monospace; }
|
138 |
-
.mfp-close:hover,
|
139 |
-
|
140 |
-
|
141 |
.mfp-close:active {
|
142 |
top: 1px; }
|
143 |
|
144 |
.mfp-close-btn-in .mfp-close {
|
145 |
-
color: #
|
146 |
|
147 |
-
.mfp-image-holder .mfp-close,
|
148 |
-
|
|
|
149 |
right: -6px;
|
150 |
text-align: right;
|
151 |
padding-right: 6px;
|
@@ -155,27 +158,28 @@ button::-moz-focus-inner {
|
|
155 |
position: absolute;
|
156 |
top: 0;
|
157 |
right: 0;
|
158 |
-
color: #
|
159 |
font-size: 12px;
|
160 |
-
line-height: 18px;
|
|
|
161 |
|
162 |
.mfp-arrow {
|
163 |
position: absolute;
|
164 |
opacity: 0.65;
|
165 |
-
filter: alpha(opacity=65);
|
166 |
margin: 0;
|
167 |
top: 50%;
|
168 |
margin-top: -55px;
|
169 |
padding: 0;
|
170 |
width: 90px;
|
171 |
height: 110px;
|
172 |
-
-webkit-tap-highlight-color:
|
173 |
.mfp-arrow:active {
|
174 |
margin-top: -54px; }
|
175 |
-
.mfp-arrow:hover,
|
176 |
-
|
177 |
-
|
178 |
-
.mfp-arrow:before,
|
|
|
179 |
content: '';
|
180 |
display: block;
|
181 |
width: 0;
|
@@ -186,31 +190,31 @@ button::-moz-focus-inner {
|
|
186 |
margin-top: 35px;
|
187 |
margin-left: 35px;
|
188 |
border: medium inset transparent; }
|
189 |
-
.mfp-arrow:after
|
190 |
border-top-width: 13px;
|
191 |
border-bottom-width: 13px;
|
192 |
top: 8px; }
|
193 |
-
.mfp-arrow:before
|
194 |
border-top-width: 21px;
|
195 |
border-bottom-width: 21px;
|
196 |
opacity: 0.7; }
|
197 |
|
198 |
.mfp-arrow-left {
|
199 |
left: 0; }
|
200 |
-
.mfp-arrow-left:after
|
201 |
-
border-right: 17px solid
|
202 |
margin-left: 31px; }
|
203 |
-
.mfp-arrow-left:before
|
204 |
margin-left: 25px;
|
205 |
-
border-right: 27px solid #
|
206 |
|
207 |
.mfp-arrow-right {
|
208 |
right: 0; }
|
209 |
-
.mfp-arrow-right:after
|
210 |
-
border-left: 17px solid
|
211 |
margin-left: 39px; }
|
212 |
-
.mfp-arrow-right:before
|
213 |
-
border-left: 27px solid #
|
214 |
|
215 |
.mfp-iframe-holder {
|
216 |
padding-top: 40px;
|
@@ -235,7 +239,7 @@ button::-moz-focus-inner {
|
|
235 |
width: 100%;
|
236 |
height: 100%;
|
237 |
box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
|
238 |
-
background:
|
239 |
|
240 |
/* Main image in popup */
|
241 |
img.mfp-img {
|
@@ -244,8 +248,6 @@ img.mfp-img {
|
|
244 |
height: auto;
|
245 |
display: block;
|
246 |
line-height: 0;
|
247 |
-
-webkit-box-sizing: border-box;
|
248 |
-
-moz-box-sizing: border-box;
|
249 |
box-sizing: border-box;
|
250 |
padding: 40px 0 40px;
|
251 |
margin: 0 auto; }
|
@@ -265,9 +267,9 @@ img.mfp-img {
|
|
265 |
height: auto;
|
266 |
z-index: -1;
|
267 |
box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
|
268 |
-
background: #
|
269 |
.mfp-figure small {
|
270 |
-
color: #
|
271 |
display: block;
|
272 |
font-size: 12px;
|
273 |
line-height: 14px; }
|
@@ -285,7 +287,7 @@ img.mfp-img {
|
|
285 |
.mfp-title {
|
286 |
text-align: left;
|
287 |
line-height: 18px;
|
288 |
-
color: #
|
289 |
word-wrap: break-word;
|
290 |
padding-right: 36px; }
|
291 |
|
@@ -317,8 +319,6 @@ img.mfp-img {
|
|
317 |
top: auto;
|
318 |
padding: 3px 5px;
|
319 |
position: fixed;
|
320 |
-
-webkit-box-sizing: border-box;
|
321 |
-
-moz-box-sizing: border-box;
|
322 |
box-sizing: border-box; }
|
323 |
.mfp-img-mobile .mfp-bottom-bar:empty {
|
324 |
padding: 0; }
|
@@ -348,21 +348,4 @@ img.mfp-img {
|
|
348 |
transform-origin: 100%; }
|
349 |
.mfp-container {
|
350 |
padding-left: 6px;
|
351 |
-
padding-right: 6px; } }
|
352 |
-
|
353 |
-
.mfp-ie7 .mfp-img {
|
354 |
-
padding: 0; }
|
355 |
-
.mfp-ie7 .mfp-bottom-bar {
|
356 |
-
width: 600px;
|
357 |
-
left: 50%;
|
358 |
-
margin-left: -300px;
|
359 |
-
margin-top: 5px;
|
360 |
-
padding-bottom: 5px; }
|
361 |
-
.mfp-ie7 .mfp-container {
|
362 |
-
padding: 0; }
|
363 |
-
.mfp-ie7 .mfp-content {
|
364 |
-
padding-top: 44px; }
|
365 |
-
.mfp-ie7 .mfp-close {
|
366 |
-
top: 0;
|
367 |
-
right: 0;
|
368 |
-
padding-top: 0; }
|
8 |
overflow: hidden;
|
9 |
position: fixed;
|
10 |
background: #0b0b0b;
|
11 |
+
opacity: 0.8; }
|
|
|
12 |
|
13 |
.mfp-wrap {
|
14 |
top: 0;
|
28 |
left: 0;
|
29 |
top: 0;
|
30 |
padding: 0 8px;
|
|
|
|
|
31 |
box-sizing: border-box; }
|
32 |
|
33 |
.mfp-container:before {
|
47 |
text-align: left;
|
48 |
z-index: 1045; }
|
49 |
|
50 |
+
.mfp-inline-holder .mfp-content,
|
51 |
+
.mfp-ajax-holder .mfp-content {
|
52 |
width: 100%;
|
53 |
cursor: auto; }
|
54 |
|
69 |
.mfp-auto-cursor .mfp-content {
|
70 |
cursor: auto; }
|
71 |
|
72 |
+
.mfp-close,
|
73 |
+
.mfp-arrow,
|
74 |
+
.mfp-preloader,
|
75 |
+
.mfp-counter {
|
76 |
-webkit-user-select: none;
|
77 |
-moz-user-select: none;
|
78 |
user-select: none; }
|
84 |
display: none !important; }
|
85 |
|
86 |
.mfp-preloader {
|
87 |
+
color: #CCC;
|
88 |
position: absolute;
|
89 |
top: 50%;
|
90 |
width: auto;
|
94 |
right: 8px;
|
95 |
z-index: 1044; }
|
96 |
.mfp-preloader a {
|
97 |
+
color: #CCC; }
|
98 |
.mfp-preloader a:hover {
|
99 |
+
color: #FFF; }
|
100 |
|
101 |
.mfp-s-ready .mfp-preloader {
|
102 |
display: none; }
|
104 |
.mfp-s-error .mfp-content {
|
105 |
display: none; }
|
106 |
|
107 |
+
button.mfp-close,
|
108 |
+
button.mfp-arrow {
|
109 |
overflow: visible;
|
110 |
cursor: pointer;
|
111 |
background: transparent;
|
115 |
outline: none;
|
116 |
padding: 0;
|
117 |
z-index: 1046;
|
118 |
+
box-shadow: none;
|
119 |
+
touch-action: manipulation; }
|
120 |
+
|
121 |
button::-moz-focus-inner {
|
122 |
padding: 0;
|
123 |
border: 0; }
|
132 |
text-decoration: none;
|
133 |
text-align: center;
|
134 |
opacity: 0.65;
|
|
|
135 |
padding: 0 0 18px 10px;
|
136 |
+
color: #FFF;
|
137 |
font-style: normal;
|
138 |
font-size: 28px;
|
139 |
font-family: Arial, Baskerville, monospace; }
|
140 |
+
.mfp-close:hover,
|
141 |
+
.mfp-close:focus {
|
142 |
+
opacity: 1; }
|
143 |
.mfp-close:active {
|
144 |
top: 1px; }
|
145 |
|
146 |
.mfp-close-btn-in .mfp-close {
|
147 |
+
color: #333; }
|
148 |
|
149 |
+
.mfp-image-holder .mfp-close,
|
150 |
+
.mfp-iframe-holder .mfp-close {
|
151 |
+
color: #FFF;
|
152 |
right: -6px;
|
153 |
text-align: right;
|
154 |
padding-right: 6px;
|
158 |
position: absolute;
|
159 |
top: 0;
|
160 |
right: 0;
|
161 |
+
color: #CCC;
|
162 |
font-size: 12px;
|
163 |
+
line-height: 18px;
|
164 |
+
white-space: nowrap; }
|
165 |
|
166 |
.mfp-arrow {
|
167 |
position: absolute;
|
168 |
opacity: 0.65;
|
|
|
169 |
margin: 0;
|
170 |
top: 50%;
|
171 |
margin-top: -55px;
|
172 |
padding: 0;
|
173 |
width: 90px;
|
174 |
height: 110px;
|
175 |
+
-webkit-tap-highlight-color: transparent; }
|
176 |
.mfp-arrow:active {
|
177 |
margin-top: -54px; }
|
178 |
+
.mfp-arrow:hover,
|
179 |
+
.mfp-arrow:focus {
|
180 |
+
opacity: 1; }
|
181 |
+
.mfp-arrow:before,
|
182 |
+
.mfp-arrow:after {
|
183 |
content: '';
|
184 |
display: block;
|
185 |
width: 0;
|
190 |
margin-top: 35px;
|
191 |
margin-left: 35px;
|
192 |
border: medium inset transparent; }
|
193 |
+
.mfp-arrow:after {
|
194 |
border-top-width: 13px;
|
195 |
border-bottom-width: 13px;
|
196 |
top: 8px; }
|
197 |
+
.mfp-arrow:before {
|
198 |
border-top-width: 21px;
|
199 |
border-bottom-width: 21px;
|
200 |
opacity: 0.7; }
|
201 |
|
202 |
.mfp-arrow-left {
|
203 |
left: 0; }
|
204 |
+
.mfp-arrow-left:after {
|
205 |
+
border-right: 17px solid #FFF;
|
206 |
margin-left: 31px; }
|
207 |
+
.mfp-arrow-left:before {
|
208 |
margin-left: 25px;
|
209 |
+
border-right: 27px solid #3F3F3F; }
|
210 |
|
211 |
.mfp-arrow-right {
|
212 |
right: 0; }
|
213 |
+
.mfp-arrow-right:after {
|
214 |
+
border-left: 17px solid #FFF;
|
215 |
margin-left: 39px; }
|
216 |
+
.mfp-arrow-right:before {
|
217 |
+
border-left: 27px solid #3F3F3F; }
|
218 |
|
219 |
.mfp-iframe-holder {
|
220 |
padding-top: 40px;
|
239 |
width: 100%;
|
240 |
height: 100%;
|
241 |
box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
|
242 |
+
background: #000; }
|
243 |
|
244 |
/* Main image in popup */
|
245 |
img.mfp-img {
|
248 |
height: auto;
|
249 |
display: block;
|
250 |
line-height: 0;
|
|
|
|
|
251 |
box-sizing: border-box;
|
252 |
padding: 40px 0 40px;
|
253 |
margin: 0 auto; }
|
267 |
height: auto;
|
268 |
z-index: -1;
|
269 |
box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
|
270 |
+
background: #444; }
|
271 |
.mfp-figure small {
|
272 |
+
color: #BDBDBD;
|
273 |
display: block;
|
274 |
font-size: 12px;
|
275 |
line-height: 14px; }
|
287 |
.mfp-title {
|
288 |
text-align: left;
|
289 |
line-height: 18px;
|
290 |
+
color: #F3F3F3;
|
291 |
word-wrap: break-word;
|
292 |
padding-right: 36px; }
|
293 |
|
319 |
top: auto;
|
320 |
padding: 3px 5px;
|
321 |
position: fixed;
|
|
|
|
|
322 |
box-sizing: border-box; }
|
323 |
.mfp-img-mobile .mfp-bottom-bar:empty {
|
324 |
padding: 0; }
|
348 |
transform-origin: 100%; }
|
349 |
.mfp-container {
|
350 |
padding-left: 6px;
|
351 |
+
padding-right: 6px; } }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/magnific-popup.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
// Magnific Popup
|
2 |
-
// http://bit.ly/magnific-popup#build=inline+image+ajax+iframe+gallery+retina+imagezoom
|
3 |
-
(function(a){var b="Close",c="BeforeClose",d="AfterClose",e="BeforeAppend",f="MarkupParse",g="Open",h="Change",i="mfp",j="."+i,k="mfp-ready",l="mfp-removing",m="mfp-prevent-close",n,o=function(){},p=!!window.jQuery,q,r=a(window),s,t,u,v,w,x=function(a,b){n.ev.on(i+a+j,b)},y=function(b,c,d,e){var f=document.createElement("div");return f.className="mfp-"+b,d&&(f.innerHTML=d),e?c&&c.appendChild(f):(f=a(f),c&&f.appendTo(c)),f},z=function(b,c){n.ev.triggerHandler(i+b,c),n.st.callbacks&&(b=b.charAt(0).toLowerCase()+b.slice(1),n.st.callbacks[b]&&n.st.callbacks[b].apply(n,a.isArray(c)?c:[c]))},A=function(b){if(b!==w||!n.currTemplate.closeBtn)n.currTemplate.closeBtn=a(n.st.closeMarkup.replace("%title%",n.st.tClose)),w=b;return n.currTemplate.closeBtn},B=function(){a.magnificPopup.instance||(n=new o,n.init(),a.magnificPopup.instance=n)},C=function(){var a=document.createElement("p").style,b=["ms","O","Moz","Webkit"];if(a.transition!==undefined)return!0;while(b.length)if(b.pop()+"Transition"in a)return!0;return!1};o.prototype={constructor:o,init:function(){var b=navigator.appVersion;n.isIE7=b.indexOf("MSIE 7.")!==-1,n.isIE8=b.indexOf("MSIE 8.")!==-1,n.isLowIE=n.isIE7||n.isIE8,n.isAndroid=/android/gi.test(b),n.isIOS=/iphone|ipad|ipod/gi.test(b),n.supportsTransition=C(),n.probablyMobile=n.isAndroid||n.isIOS||/(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent),t=a(document),n.popupsCache={}},open:function(b){s||(s=a(document.body));var c;if(b.isObj===!1){n.items=b.items.toArray(),n.index=0;var d=b.items,e;for(c=0;c<d.length;c++){e=d[c],e.parsed&&(e=e.el[0]);if(e===b.el[0]){n.index=c;break}}}else n.items=a.isArray(b.items)?b.items:[b.items],n.index=b.index||0;if(n.isOpen){n.updateItemHTML();return}n.types=[],v="",b.mainEl&&b.mainEl.length?n.ev=b.mainEl.eq(0):n.ev=t,b.key?(n.popupsCache[b.key]||(n.popupsCache[b.key]={}),n.currTemplate=n.popupsCache[b.key]):n.currTemplate={},n.st=a.extend(!0,{},a.magnificPopup.defaults,b),n.fixedContentPos=n.st.fixedContentPos==="auto"?!n.probablyMobile:n.st.fixedContentPos,n.st.modal&&(n.st.closeOnContentClick=!1,n.st.closeOnBgClick=!1,n.st.showCloseBtn=!1,n.st.enableEscapeKey=!1),n.bgOverlay||(n.bgOverlay=y("bg").on("click"+j,function(){n.close()}),n.wrap=y("wrap").attr("tabindex",-1).on("click"+j,function(a){n._checkIfClose(a.target)&&n.close()}),n.container=y("container",n.wrap)),n.contentContainer=y("content"),n.st.preloader&&(n.preloader=y("preloader",n.container,n.st.tLoading));var h=a.magnificPopup.modules;for(c=0;c<h.length;c++){var i=h[c];i=i.charAt(0).toUpperCase()+i.slice(1),n["init"+i].call(n)}z("BeforeOpen"),n.st.showCloseBtn&&(n.st.closeBtnInside?(x(f,function(a,b,c,d){c.close_replaceWith=A(d.type)}),v+=" mfp-close-btn-in"):n.wrap.append(A())),n.st.alignTop&&(v+=" mfp-align-top"),n.fixedContentPos?n.wrap.css({overflow:n.st.overflowY,overflowX:"hidden",overflowY:n.st.overflowY}):n.wrap.css({top:r.scrollTop(),position:"absolute"}),(n.st.fixedBgPos===!1||n.st.fixedBgPos==="auto"&&!n.fixedContentPos)&&n.bgOverlay.css({height:t.height(),position:"absolute"}),n.st.enableEscapeKey&&t.on("keyup"+j,function(a){a.keyCode===27&&n.close()}),r.on("resize"+j,function(){n.updateSize()}),n.st.closeOnContentClick||(v+=" mfp-auto-cursor"),v&&n.wrap.addClass(v);var l=n.wH=r.height(),m={};if(n.fixedContentPos&&n._hasScrollBar(l)){var o=n._getScrollbarSize();o&&(m.marginRight=o)}n.fixedContentPos&&(n.isIE7?a("body, html").css("overflow","hidden"):m.overflow="hidden");var p=n.st.mainClass;return n.isIE7&&(p+=" mfp-ie7"),p&&n._addClassToMFP(p),n.updateItemHTML(),z("BuildControls"),a("html").css(m),n.bgOverlay.add(n.wrap).prependTo(n.st.prependTo||s),n._lastFocusedEl=document.activeElement,setTimeout(function(){n.content?(n._addClassToMFP(k),n._setFocus()):n.bgOverlay.addClass(k),t.on("focusin"+j,n._onFocusIn)},16),n.isOpen=!0,n.updateSize(l),z(g),b},close:function(){if(!n.isOpen)return;z(c),n.isOpen=!1,n.st.removalDelay&&!n.isLowIE&&n.supportsTransition?(n._addClassToMFP(l),setTimeout(function(){n._close()},n.st.removalDelay)):n._close()},_close:function(){z(b);var c=l+" "+k+" ";n.bgOverlay.detach(),n.wrap.detach(),n.container.empty(),n.st.mainClass&&(c+=n.st.mainClass+" "),n._removeClassFromMFP(c);if(n.fixedContentPos){var e={marginRight:""};n.isIE7?a("body, html").css("overflow",""):e.overflow="",a("html").css(e)}t.off("keyup"+j+" focusin"+j),n.ev.off(j),n.wrap.attr("class","mfp-wrap").removeAttr("style"),n.bgOverlay.attr("class","mfp-bg"),n.container.attr("class","mfp-container"),n.st.showCloseBtn&&(!n.st.closeBtnInside||n.currTemplate[n.currItem.type]===!0)&&n.currTemplate.closeBtn&&n.currTemplate.closeBtn.detach(),n._lastFocusedEl&&a(n._lastFocusedEl).focus(),n.currItem=null,n.content=null,n.currTemplate=null,n.prevHeight=0,z(d)},updateSize:function(a){if(n.isIOS){var b=document.documentElement.clientWidth/window.innerWidth,c=window.innerHeight*b;n.wrap.css("height",c),n.wH=c}else n.wH=a||r.height();n.fixedContentPos||n.wrap.css("height",n.wH),z("Resize")},updateItemHTML:function(){var b=n.items[n.index];n.contentContainer.detach(),n.content&&n.content.detach(),b.parsed||(b=n.parseEl(n.index));var c=b.type;z("BeforeChange",[n.currItem?n.currItem.type:"",c]),n.currItem=b;if(!n.currTemplate[c]){var d=n.st[c]?n.st[c].markup:!1;z("FirstMarkupParse",d),d?n.currTemplate[c]=a(d):n.currTemplate[c]=!0}u&&u!==b.type&&n.container.removeClass("mfp-"+u+"-holder");var e=n["get"+c.charAt(0).toUpperCase()+c.slice(1)](b,n.currTemplate[c]);n.appendContent(e,c),b.preloaded=!0,z(h,b),u=b.type,n.container.prepend(n.contentContainer),z("AfterChange")},appendContent:function(a,b){n.content=a,a?n.st.showCloseBtn&&n.st.closeBtnInside&&n.currTemplate[b]===!0?n.content.find(".mfp-close").length||n.content.append(A()):n.content=a:n.content="",z(e),n.container.addClass("mfp-"+b+"-holder"),n.contentContainer.append(n.content)},parseEl:function(b){var c=n.items[b],d;c.tagName?c={el:a(c)}:(d=c.type,c={data:c,src:c.src});if(c.el){var e=n.types;for(var f=0;f<e.length;f++)if(c.el.hasClass("mfp-"+e[f])){d=e[f];break}c.src=c.el.attr("data-mfp-src"),c.src||(c.src=c.el.attr("href"))}return c.type=d||n.st.type||"inline",c.index=b,c.parsed=!0,n.items[b]=c,z("ElementParse",c),n.items[b]},addGroup:function(a,b){var c=function(c){c.mfpEl=this,n._openClick(c,a,b)};b||(b={});var d="click.magnificPopup";b.mainEl=a,b.items?(b.isObj=!0,a.off(d).on(d,c)):(b.isObj=!1,b.delegate?a.off(d).on(d,b.delegate,c):(b.items=a,a.off(d).on(d,c)))},_openClick:function(b,c,d){var e=d.midClick!==undefined?d.midClick:a.magnificPopup.defaults.midClick;if(!e&&(b.which===2||b.ctrlKey||b.metaKey))return;var f=d.disableOn!==undefined?d.disableOn:a.magnificPopup.defaults.disableOn;if(f)if(a.isFunction(f)){if(!f.call(n))return!0}else if(r.width()<f)return!0;b.type&&(b.preventDefault(),n.isOpen&&b.stopPropagation()),d.el=a(b.mfpEl),d.delegate&&(d.items=c.find(d.delegate)),n.open(d)},updateStatus:function(a,b){if(n.preloader){q!==a&&n.container.removeClass("mfp-s-"+q),!b&&a==="loading"&&(b=n.st.tLoading);var c={status:a,text:b};z("UpdateStatus",c),a=c.status,b=c.text,n.preloader.html(b),n.preloader.find("a").on("click",function(a){a.stopImmediatePropagation()}),n.container.addClass("mfp-s-"+a),q=a}},_checkIfClose:function(b){if(a(b).hasClass(m))return;var c=n.st.closeOnContentClick,d=n.st.closeOnBgClick;if(c&&d)return!0;if(!n.content||a(b).hasClass("mfp-close")||n.preloader&&b===n.preloader[0])return!0;if(b!==n.content[0]&&!a.contains(n.content[0],b)){if(d&&a.contains(document,b))return!0}else if(c)return!0;return!1},_addClassToMFP:function(a){n.bgOverlay.addClass(a),n.wrap.addClass(a)},_removeClassFromMFP:function(a){this.bgOverlay.removeClass(a),n.wrap.removeClass(a)},_hasScrollBar:function(a){return(n.isIE7?t.height():document.body.scrollHeight)>(a||r.height())},_setFocus:function(){(n.st.focus?n.content.find(n.st.focus).eq(0):n.wrap).focus()},_onFocusIn:function(b){if(b.target!==n.wrap[0]&&!a.contains(n.wrap[0],b.target))return n._setFocus(),!1},_parseMarkup:function(b,c,d){var e;d.data&&(c=a.extend(d.data,c)),z(f,[b,c,d]),a.each(c,function(a,c){if(c===undefined||c===!1)return!0;e=a.split("_");if(e.length>1){var d=b.find(j+"-"+e[0]);if(d.length>0){var f=e[1];f==="replaceWith"?d[0]!==c[0]&&d.replaceWith(c):f==="img"?d.is("img")?d.attr("src",c):d.replaceWith('<img src="'+c+'" class="'+d.attr("class")+'" />'):d.attr(e[1],c)}}else b.find(j+"-"+a).html(c)})},_getScrollbarSize:function(){if(n.scrollbarSize===undefined){var a=document.createElement("div");a.id="mfp-sbm",a.style.cssText="width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(a),n.scrollbarSize=a.offsetWidth-a.clientWidth,document.body.removeChild(a)}return n.scrollbarSize}},a.magnificPopup={instance:null,proto:o.prototype,modules:[],open:function(b,c){return B(),b?b=a.extend(!0,{},b):b={},b.isObj=!0,b.index=c||0,this.instance.open(b)},close:function(){return a.magnificPopup.instance&&a.magnificPopup.instance.close()},registerModule:function(b,c){c.options&&(a.magnificPopup.defaults[b]=c.options),a.extend(this.proto,c.proto),this.modules.push(b)},defaults:{disableOn:0,key:null,midClick:!1,mainClass:"",preloader:!0,focus:"",closeOnContentClick:!1,closeOnBgClick:!0,closeBtnInside:!0,showCloseBtn:!0,enableEscapeKey:!0,modal:!1,alignTop:!1,removalDelay:0,prependTo:null,fixedContentPos:"auto",fixedBgPos:"auto",overflowY:"auto",closeMarkup:'<button title="%title%" type="button" class="mfp-close">×</button>',tClose:"Close (Esc)",tLoading:"Loading..."}},a.fn.magnificPopup=function(b){B();var c=a(this);if(typeof b=="string")if(b==="open"){var d,e=p?c.data("magnificPopup"):c[0].magnificPopup,f=parseInt(arguments[1],10)||0;e.items?d=e.items[f]:(d=c,e.delegate&&(d=d.find(e.delegate)),d=d.eq(f)),n._openClick({mfpEl:d},c,e)}else n.isOpen&&n[b].apply(n,Array.prototype.slice.call(arguments,1));else b=a.extend(!0,{},b),p?c.data("magnificPopup",b):c[0].magnificPopup=b,n.addGroup(c,b);return c};var D="inline",E,F,G,H=function(){G&&(F.after(G.addClass(E)).detach(),G=null)};a.magnificPopup.registerModule(D,{options:{hiddenClass:"hide",markup:"",tNotFound:"Content not found"},proto:{initInline:function(){n.types.push(D),x(b+"."+D,function(){H()})},getInline:function(b,c){H();if(b.src){var d=n.st.inline,e=a(b.src);if(e.length){var f=e[0].parentNode;f&&f.tagName&&(F||(E=d.hiddenClass,F=y(E),E="mfp-"+E),G=e.after(F).detach().removeClass(E)),n.updateStatus("ready")}else n.updateStatus("error",d.tNotFound),e=a("<div>");return b.inlineElement=e,e}return n.updateStatus("ready"),n._parseMarkup(c,{},b),c}}});var I="ajax",J,K=function(){J&&s.removeClass(J)},L=function(){K(),n.req&&n.req.abort()};a.magnificPopup.registerModule(I,{options:{settings:null,cursor:"mfp-ajax-cur",tError:'<a href="%url%">The content</a> could not be loaded.'},proto:{initAjax:function(){n.types.push(I),J=n.st.ajax.cursor,x(b+"."+I,L),x("BeforeChange."+I,L)},getAjax:function(b){J&&s.addClass(J),n.updateStatus("loading");var c=a.extend({url:b.src,success:function(c,d,e){var f={data:c,xhr:e};z("ParseAjax",f),n.appendContent(a(f.data),I),b.finished=!0,K(),n._setFocus(),setTimeout(function(){n.wrap.addClass(k)},16),n.updateStatus("ready"),z("AjaxContentAdded")},error:function(){K(),b.finished=b.loadError=!0,n.updateStatus("error",n.st.ajax.tError.replace("%url%",b.src))}},n.st.ajax.settings);return n.req=a.ajax(c),""}}});var M,N=function(b){if(b.data&&b.data.title!==undefined)return b.data.title;var c=n.st.image.titleSrc;if(c){if(a.isFunction(c))return c.call(n,b);if(b.el)return b.el.attr(c)||""}return""};a.magnificPopup.registerModule("image",{options:{markup:'<div class="mfp-figure"><div class="mfp-close"></div><figure><div class="mfp-img"></div><figcaption><div class="mfp-bottom-bar"><div class="mfp-title"></div><div class="mfp-counter"></div></div></figcaption></figure></div>',cursor:"mfp-zoom-out-cur",titleSrc:"title",verticalFit:!0,tError:'<a href="%url%">The image</a> could not be loaded.'},proto:{initImage:function(){var a=n.st.image,c=".image";n.types.push("image"),x(g+c,function(){n.currItem.type==="image"&&a.cursor&&s.addClass(a.cursor)}),x(b+c,function(){a.cursor&&s.removeClass(a.cursor),r.off("resize"+j)}),x("Resize"+c,n.resizeImage),n.isLowIE&&x("AfterChange",n.resizeImage)},resizeImage:function(){var a=n.currItem;if(!a||!a.img)return;if(n.st.image.verticalFit){var b=0;n.isLowIE&&(b=parseInt(a.img.css("padding-top"),10)+parseInt(a.img.css("padding-bottom"),10)),a.img.css("max-height",n.wH-b)}},_onImageHasSize:function(a){a.img&&(a.hasSize=!0,M&&clearInterval(M),a.isCheckingImgSize=!1,z("ImageHasSize",a),a.imgHidden&&(n.content&&n.content.removeClass("mfp-loading"),a.imgHidden=!1))},findImageSize:function(a){var b=0,c=a.img[0],d=function(e){M&&clearInterval(M),M=setInterval(function(){if(c.naturalWidth>0){n._onImageHasSize(a);return}b>200&&clearInterval(M),b++,b===3?d(10):b===40?d(50):b===100&&d(500)},e)};d(1)},getImage:function(b,c){var d=0,e=function(){b&&(b.img[0].complete?(b.img.off(".mfploader"),b===n.currItem&&(n._onImageHasSize(b),n.updateStatus("ready")),b.hasSize=!0,b.loaded=!0,z("ImageLoadComplete")):(d++,d<200?setTimeout(e,100):f()))},f=function(){b&&(b.img.off(".mfploader"),b===n.currItem&&(n._onImageHasSize(b),n.updateStatus("error",g.tError.replace("%url%",b.src))),b.hasSize=!0,b.loaded=!0,b.loadError=!0)},g=n.st.image,h=c.find(".mfp-img");if(h.length){var i=document.createElement("img");i.className="mfp-img",b.img=a(i).on("load.mfploader",e).on("error.mfploader",f),i.src=b.src,h.is("img")&&(b.img=b.img.clone()),i=b.img[0],i.naturalWidth>0?b.hasSize=!0:i.width||(b.hasSize=!1)}return n._parseMarkup(c,{title:N(b),img_replaceWith:b.img},b),n.resizeImage(),b.hasSize?(M&&clearInterval(M),b.loadError?(c.addClass("mfp-loading"),n.updateStatus("error",g.tError.replace("%url%",b.src))):(c.removeClass("mfp-loading"),n.updateStatus("ready")),c):(n.updateStatus("loading"),b.loading=!0,b.hasSize||(b.imgHidden=!0,c.addClass("mfp-loading"),n.findImageSize(b)),c)}}});var O,P=function(){return O===undefined&&(O=document.createElement("p").style.MozTransform!==undefined),O};a.magnificPopup.registerModule("zoom",{options:{enabled:!1,easing:"ease-in-out",duration:300,opener:function(a){return a.is("img")?a:a.find("img")}},proto:{initZoom:function(){var a=n.st.zoom,d=".zoom",e;if(!a.enabled||!n.supportsTransition)return;var f=a.duration,g=function(b){var c=b.clone().removeAttr("style").removeAttr("class").addClass("mfp-animated-image"),d="all "+a.duration/1e3+"s "+a.easing,e={position:"fixed",zIndex:9999,left:0,top:0,"-webkit-backface-visibility":"hidden"},f="transition";return e["-webkit-"+f]=e["-moz-"+f]=e["-o-"+f]=e[f]=d,c.css(e),c},h=function(){n.content.css("visibility","visible")},i,j;x("BuildControls"+d,function(){if(n._allowZoom()){clearTimeout(i),n.content.css("visibility","hidden"),e=n._getItemToZoom();if(!e){h();return}j=g(e),j.css(n._getOffset()),n.wrap.append(j),i=setTimeout(function(){j.css(n._getOffset(!0)),i=setTimeout(function(){h(),setTimeout(function(){j.remove(),e=j=null,z("ZoomAnimationEnded")},16)},f)},16)}}),x(c+d,function(){if(n._allowZoom()){clearTimeout(i),n.st.removalDelay=f;if(!e){e=n._getItemToZoom();if(!e)return;j=g(e)}j.css(n._getOffset(!0)),n.wrap.append(j),n.content.css("visibility","hidden"),setTimeout(function(){j.css(n._getOffset())},16)}}),x(b+d,function(){n._allowZoom()&&(h(),j&&j.remove(),e=null)})},_allowZoom:function(){return n.currItem.type==="image"},_getItemToZoom:function(){return n.currItem.hasSize?n.currItem.img:!1},_getOffset:function(b){var c;b?c=n.currItem.img:c=n.st.zoom.opener(n.currItem.el||n.currItem);var d=c.offset(),e=parseInt(c.css("padding-top"),10),f=parseInt(c.css("padding-bottom"),10);d.top-=a(window).scrollTop()-e;var g={width:c.width(),height:(p?c.innerHeight():c[0].offsetHeight)-f-e};return P()?g["-moz-transform"]=g.transform="translate("+d.left+"px,"+d.top+"px)":(g.left=d.left,g.top=d.top),g}}});var Q="iframe",R="//about:blank",S=function(a){if(n.currTemplate[Q]){var b=n.currTemplate[Q].find("iframe");b.length&&(a||(b[0].src=R),n.isIE8&&b.css("display",a?"block":"none"))}};a.magnificPopup.registerModule(Q,{options:{markup:'<div class="mfp-iframe-scaler"><div class="mfp-close"></div><iframe class="mfp-iframe" src="//about:blank" frameborder="0" allowfullscreen></iframe></div>',srcAction:"iframe_src",patterns:{youtube:{index:"youtube.com",id:"v=",src:"//www.youtube.com/embed/%id%?autoplay=1"},vimeo:{index:"vimeo.com/",id:"/",src:"//player.vimeo.com/video/%id%?autoplay=1"},gmaps:{index:"//maps.google.",src:"%id%&output=embed"}}},proto:{initIframe:function(){n.types.push(Q),x("BeforeChange",function(a,b,c){b!==c&&(b===Q?S():c===Q&&S(!0))}),x(b+"."+Q,function(){S()})},getIframe:function(b,c){var d=b.src,e=n.st.iframe;a.each(e.patterns,function(){if(d.indexOf(this.index)>-1)return this.id&&(typeof this.id=="string"?d=d.substr(d.lastIndexOf(this.id)+this.id.length,d.length):d=this.id.call(this,d)),d=this.src.replace("%id%",d),!1});var f={};return e.srcAction&&(f[e.srcAction]=d),n._parseMarkup(c,f,b),n.updateStatus("ready"),c}}});var T=function(a){var b=n.items.length;return a>b-1?a-b:a<0?b+a:a},U=function(a,b,c){return a.replace(/%curr%/gi,b+1).replace(/%total%/gi,c)};a.magnificPopup.registerModule("gallery",{options:{enabled:!1,arrowMarkup:'<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>',preload:[0,2],navigateByImgClick:!0,arrows:!0,tPrev:"Previous (Left arrow key)",tNext:"Next (Right arrow key)",tCounter:"%curr% of %total%"},proto:{initGallery:function(){var c=n.st.gallery,d=".mfp-gallery",e=Boolean(a.fn.mfpFastClick);n.direction=!0;if(!c||!c.enabled)return!1;v+=" mfp-gallery",x(g+d,function(){c.navigateByImgClick&&n.wrap.on("click"+d,".mfp-img",function(){if(n.items.length>1)return n.next(),!1}),t.on("keydown"+d,function(a){a.keyCode===37?n.prev():a.keyCode===39&&n.next()})}),x("UpdateStatus"+d,function(a,b){b.text&&(b.text=U(b.text,n.currItem.index,n.items.length))}),x(f+d,function(a,b,d,e){var f=n.items.length;d.counter=f>1?U(c.tCounter,e.index,f):""}),x("BuildControls"+d,function(){if(n.items.length>1&&c.arrows&&!n.arrowLeft){var b=c.arrowMarkup,d=n.arrowLeft=a(b.replace(/%title%/gi,c.tPrev).replace(/%dir%/gi,"left")).addClass(m),f=n.arrowRight=a(b.replace(/%title%/gi,c.tNext).replace(/%dir%/gi,"right")).addClass(m),g=e?"mfpFastClick":"click";d[g](function(){n.prev()}),f[g](function(){n.next()}),n.isIE7&&(y("b",d[0],!1,!0),y("a",d[0],!1,!0),y("b",f[0],!1,!0),y("a",f[0],!1,!0)),n.container.append(d.add(f))}}),x(h+d,function(){n._preloadTimeout&&clearTimeout(n._preloadTimeout),n._preloadTimeout=setTimeout(function(){n.preloadNearbyImages(),n._preloadTimeout=null},16)}),x(b+d,function(){t.off(d),n.wrap.off("click"+d),n.arrowLeft&&e&&n.arrowLeft.add(n.arrowRight).destroyMfpFastClick(),n.arrowRight=n.arrowLeft=null})},next:function(){n.direction=!0,n.index=T(n.index+1),n.updateItemHTML()},prev:function(){n.direction=!1,n.index=T(n.index-1),n.updateItemHTML()},goTo:function(a){n.direction=a>=n.index,n.index=a,n.updateItemHTML()},preloadNearbyImages:function(){var a=n.st.gallery.preload,b=Math.min(a[0],n.items.length),c=Math.min(a[1],n.items.length),d;for(d=1;d<=(n.direction?c:b);d++)n._preloadItem(n.index+d);for(d=1;d<=(n.direction?b:c);d++)n._preloadItem(n.index-d)},_preloadItem:function(b){b=T(b);if(n.items[b].preloaded)return;var c=n.items[b];c.parsed||(c=n.parseEl(b)),z("LazyLoad",c),c.type==="image"&&(c.img=a('<img class="mfp-img" />').on("load.mfploader",function(){c.hasSize=!0}).on("error.mfploader",function(){c.hasSize=!0,c.loadError=!0,z("LazyLoadError",c)}).attr("src",c.src)),c.preloaded=!0}}});var V="retina";a.magnificPopup.registerModule(V,{options:{replaceSrc:function(a){return a.src.replace(/\.\w+$/,function(a){return"@2x"+a})},ratio:1},proto:{initRetina:function(){if(window.devicePixelRatio>1){var a=n.st.retina,b=a.ratio;b=isNaN(b)?b():b,b>1&&(x("ImageHasSize."+V,function(a,c){c.img.css({"max-width":c.img[0].naturalWidth/b,width:"100%"})}),x("ElementParse."+V,function(c,d){d.src=a.replaceSrc(d,b)}))}}}}),function(){var b=1e3,c="ontouchstart"in window,d=function(){r.off("touchmove"+f+" touchend"+f)},e="mfpFastClick",f="."+e;a.fn.mfpFastClick=function(e){return a(this).each(function(){var g=a(this),h;if(c){var i,j,k,l,m,n;g.on("touchstart"+f,function(a){l=!1,n=1,m=a.originalEvent?a.originalEvent.touches[0]:a.touches[0],j=m.clientX,k=m.clientY,r.on("touchmove"+f,function(a){m=a.originalEvent?a.originalEvent.touches:a.touches,n=m.length,m=m[0];if(Math.abs(m.clientX-j)>10||Math.abs(m.clientY-k)>10)l=!0,d()}).on("touchend"+f,function(a){d();if(l||n>1)return;h=!0,a.preventDefault(),clearTimeout(i),i=setTimeout(function(){h=!1},b),e()})})}g.on("click"+f,function(){h||e()})})},a.fn.destroyMfpFastClick=function(){a(this).off("touchstart"+f+" click"+f),c&&r.off("touchmove"+f+" touchend"+f)}}(),B()})(window.jQuery||window.Zepto)
|
1 |
+
// Magnific Popup v1.1.0 by Dmitry Semenov
|
2 |
+
// http://bit.ly/magnific-popup#build=inline+image+ajax+iframe+gallery+retina+imagezoom
|
3 |
+
(function(a){typeof define=="function"&&define.amd?define(["jquery"],a):typeof exports=="object"?a(require("jquery")):a(window.jQuery||window.Zepto)})(function(a){var b="Close",c="BeforeClose",d="AfterClose",e="BeforeAppend",f="MarkupParse",g="Open",h="Change",i="mfp",j="."+i,k="mfp-ready",l="mfp-removing",m="mfp-prevent-close",n,o=function(){},p=!!window.jQuery,q,r=a(window),s,t,u,v,w=function(a,b){n.ev.on(i+a+j,b)},x=function(b,c,d,e){var f=document.createElement("div");return f.className="mfp-"+b,d&&(f.innerHTML=d),e?c&&c.appendChild(f):(f=a(f),c&&f.appendTo(c)),f},y=function(b,c){n.ev.triggerHandler(i+b,c),n.st.callbacks&&(b=b.charAt(0).toLowerCase()+b.slice(1),n.st.callbacks[b]&&n.st.callbacks[b].apply(n,a.isArray(c)?c:[c]))},z=function(b){if(b!==v||!n.currTemplate.closeBtn)n.currTemplate.closeBtn=a(n.st.closeMarkup.replace("%title%",n.st.tClose)),v=b;return n.currTemplate.closeBtn},A=function(){a.magnificPopup.instance||(n=new o,n.init(),a.magnificPopup.instance=n)},B=function(){var a=document.createElement("p").style,b=["ms","O","Moz","Webkit"];if(a.transition!==undefined)return!0;while(b.length)if(b.pop()+"Transition"in a)return!0;return!1};o.prototype={constructor:o,init:function(){var b=navigator.appVersion;n.isLowIE=n.isIE8=document.all&&!document.addEventListener,n.isAndroid=/android/gi.test(b),n.isIOS=/iphone|ipad|ipod/gi.test(b),n.supportsTransition=B(),n.probablyMobile=n.isAndroid||n.isIOS||/(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent),s=a(document),n.popupsCache={}},open:function(b){var c;if(b.isObj===!1){n.items=b.items.toArray(),n.index=0;var d=b.items,e;for(c=0;c<d.length;c++){e=d[c],e.parsed&&(e=e.el[0]);if(e===b.el[0]){n.index=c;break}}}else n.items=a.isArray(b.items)?b.items:[b.items],n.index=b.index||0;if(n.isOpen){n.updateItemHTML();return}n.types=[],u="",b.mainEl&&b.mainEl.length?n.ev=b.mainEl.eq(0):n.ev=s,b.key?(n.popupsCache[b.key]||(n.popupsCache[b.key]={}),n.currTemplate=n.popupsCache[b.key]):n.currTemplate={},n.st=a.extend(!0,{},a.magnificPopup.defaults,b),n.fixedContentPos=n.st.fixedContentPos==="auto"?!n.probablyMobile:n.st.fixedContentPos,n.st.modal&&(n.st.closeOnContentClick=!1,n.st.closeOnBgClick=!1,n.st.showCloseBtn=!1,n.st.enableEscapeKey=!1),n.bgOverlay||(n.bgOverlay=x("bg").on("click"+j,function(){n.close()}),n.wrap=x("wrap").attr("tabindex",-1).on("click"+j,function(a){n._checkIfClose(a.target)&&n.close()}),n.container=x("container",n.wrap)),n.contentContainer=x("content"),n.st.preloader&&(n.preloader=x("preloader",n.container,n.st.tLoading));var h=a.magnificPopup.modules;for(c=0;c<h.length;c++){var i=h[c];i=i.charAt(0).toUpperCase()+i.slice(1),n["init"+i].call(n)}y("BeforeOpen"),n.st.showCloseBtn&&(n.st.closeBtnInside?(w(f,function(a,b,c,d){c.close_replaceWith=z(d.type)}),u+=" mfp-close-btn-in"):n.wrap.append(z())),n.st.alignTop&&(u+=" mfp-align-top"),n.fixedContentPos?n.wrap.css({overflow:n.st.overflowY,overflowX:"hidden",overflowY:n.st.overflowY}):n.wrap.css({top:r.scrollTop(),position:"absolute"}),(n.st.fixedBgPos===!1||n.st.fixedBgPos==="auto"&&!n.fixedContentPos)&&n.bgOverlay.css({height:s.height(),position:"absolute"}),n.st.enableEscapeKey&&s.on("keyup"+j,function(a){a.keyCode===27&&n.close()}),r.on("resize"+j,function(){n.updateSize()}),n.st.closeOnContentClick||(u+=" mfp-auto-cursor"),u&&n.wrap.addClass(u);var l=n.wH=r.height(),m={};if(n.fixedContentPos&&n._hasScrollBar(l)){var o=n._getScrollbarSize();o&&(m.marginRight=o)}n.fixedContentPos&&(n.isIE7?a("body, html").css("overflow","hidden"):m.overflow="hidden");var p=n.st.mainClass;return n.isIE7&&(p+=" mfp-ie7"),p&&n._addClassToMFP(p),n.updateItemHTML(),y("BuildControls"),a("html").css(m),n.bgOverlay.add(n.wrap).prependTo(n.st.prependTo||a(document.body)),n._lastFocusedEl=document.activeElement,setTimeout(function(){n.content?(n._addClassToMFP(k),n._setFocus()):n.bgOverlay.addClass(k),s.on("focusin"+j,n._onFocusIn)},16),n.isOpen=!0,n.updateSize(l),y(g),b},close:function(){if(!n.isOpen)return;y(c),n.isOpen=!1,n.st.removalDelay&&!n.isLowIE&&n.supportsTransition?(n._addClassToMFP(l),setTimeout(function(){n._close()},n.st.removalDelay)):n._close()},_close:function(){y(b);var c=l+" "+k+" ";n.bgOverlay.detach(),n.wrap.detach(),n.container.empty(),n.st.mainClass&&(c+=n.st.mainClass+" "),n._removeClassFromMFP(c);if(n.fixedContentPos){var e={marginRight:""};n.isIE7?a("body, html").css("overflow",""):e.overflow="",a("html").css(e)}s.off("keyup"+j+" focusin"+j),n.ev.off(j),n.wrap.attr("class","mfp-wrap").removeAttr("style"),n.bgOverlay.attr("class","mfp-bg"),n.container.attr("class","mfp-container"),n.st.showCloseBtn&&(!n.st.closeBtnInside||n.currTemplate[n.currItem.type]===!0)&&n.currTemplate.closeBtn&&n.currTemplate.closeBtn.detach(),n.st.autoFocusLast&&n._lastFocusedEl&&a(n._lastFocusedEl).focus(),n.currItem=null,n.content=null,n.currTemplate=null,n.prevHeight=0,y(d)},updateSize:function(a){if(n.isIOS){var b=document.documentElement.clientWidth/window.innerWidth,c=window.innerHeight*b;n.wrap.css("height",c),n.wH=c}else n.wH=a||r.height();n.fixedContentPos||n.wrap.css("height",n.wH),y("Resize")},updateItemHTML:function(){var b=n.items[n.index];n.contentContainer.detach(),n.content&&n.content.detach(),b.parsed||(b=n.parseEl(n.index));var c=b.type;y("BeforeChange",[n.currItem?n.currItem.type:"",c]),n.currItem=b;if(!n.currTemplate[c]){var d=n.st[c]?n.st[c].markup:!1;y("FirstMarkupParse",d),d?n.currTemplate[c]=a(d):n.currTemplate[c]=!0}t&&t!==b.type&&n.container.removeClass("mfp-"+t+"-holder");var e=n["get"+c.charAt(0).toUpperCase()+c.slice(1)](b,n.currTemplate[c]);n.appendContent(e,c),b.preloaded=!0,y(h,b),t=b.type,n.container.prepend(n.contentContainer),y("AfterChange")},appendContent:function(a,b){n.content=a,a?n.st.showCloseBtn&&n.st.closeBtnInside&&n.currTemplate[b]===!0?n.content.find(".mfp-close").length||n.content.append(z()):n.content=a:n.content="",y(e),n.container.addClass("mfp-"+b+"-holder"),n.contentContainer.append(n.content)},parseEl:function(b){var c=n.items[b],d;c.tagName?c={el:a(c)}:(d=c.type,c={data:c,src:c.src});if(c.el){var e=n.types;for(var f=0;f<e.length;f++)if(c.el.hasClass("mfp-"+e[f])){d=e[f];break}c.src=c.el.attr("data-mfp-src"),c.src||(c.src=c.el.attr("href"))}return c.type=d||n.st.type||"inline",c.index=b,c.parsed=!0,n.items[b]=c,y("ElementParse",c),n.items[b]},addGroup:function(a,b){var c=function(c){c.mfpEl=this,n._openClick(c,a,b)};b||(b={});var d="click.magnificPopup";b.mainEl=a,b.items?(b.isObj=!0,a.off(d).on(d,c)):(b.isObj=!1,b.delegate?a.off(d).on(d,b.delegate,c):(b.items=a,a.off(d).on(d,c)))},_openClick:function(b,c,d){var e=d.midClick!==undefined?d.midClick:a.magnificPopup.defaults.midClick;if(!e&&(b.which===2||b.ctrlKey||b.metaKey||b.altKey||b.shiftKey))return;var f=d.disableOn!==undefined?d.disableOn:a.magnificPopup.defaults.disableOn;if(f)if(a.isFunction(f)){if(!f.call(n))return!0}else if(r.width()<f)return!0;b.type&&(b.preventDefault(),n.isOpen&&b.stopPropagation()),d.el=a(b.mfpEl),d.delegate&&(d.items=c.find(d.delegate)),n.open(d)},updateStatus:function(a,b){if(n.preloader){q!==a&&n.container.removeClass("mfp-s-"+q),!b&&a==="loading"&&(b=n.st.tLoading);var c={status:a,text:b};y("UpdateStatus",c),a=c.status,b=c.text,n.preloader.html(b),n.preloader.find("a").on("click",function(a){a.stopImmediatePropagation()}),n.container.addClass("mfp-s-"+a),q=a}},_checkIfClose:function(b){if(a(b).hasClass(m))return;var c=n.st.closeOnContentClick,d=n.st.closeOnBgClick;if(c&&d)return!0;if(!n.content||a(b).hasClass("mfp-close")||n.preloader&&b===n.preloader[0])return!0;if(b!==n.content[0]&&!a.contains(n.content[0],b)){if(d&&a.contains(document,b))return!0}else if(c)return!0;return!1},_addClassToMFP:function(a){n.bgOverlay.addClass(a),n.wrap.addClass(a)},_removeClassFromMFP:function(a){this.bgOverlay.removeClass(a),n.wrap.removeClass(a)},_hasScrollBar:function(a){return(n.isIE7?s.height():document.body.scrollHeight)>(a||r.height())},_setFocus:function(){(n.st.focus?n.content.find(n.st.focus).eq(0):n.wrap).focus()},_onFocusIn:function(b){if(b.target!==n.wrap[0]&&!a.contains(n.wrap[0],b.target))return n._setFocus(),!1},_parseMarkup:function(b,c,d){var e;d.data&&(c=a.extend(d.data,c)),y(f,[b,c,d]),a.each(c,function(c,d){if(d===undefined||d===!1)return!0;e=c.split("_");if(e.length>1){var f=b.find(j+"-"+e[0]);if(f.length>0){var g=e[1];g==="replaceWith"?f[0]!==d[0]&&f.replaceWith(d):g==="img"?f.is("img")?f.attr("src",d):f.replaceWith(a("<img>").attr("src",d).attr("class",f.attr("class"))):f.attr(e[1],d)}}else b.find(j+"-"+c).html(d)})},_getScrollbarSize:function(){if(n.scrollbarSize===undefined){var a=document.createElement("div");a.style.cssText="width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(a),n.scrollbarSize=a.offsetWidth-a.clientWidth,document.body.removeChild(a)}return n.scrollbarSize}},a.magnificPopup={instance:null,proto:o.prototype,modules:[],open:function(b,c){return A(),b?b=a.extend(!0,{},b):b={},b.isObj=!0,b.index=c||0,this.instance.open(b)},close:function(){return a.magnificPopup.instance&&a.magnificPopup.instance.close()},registerModule:function(b,c){c.options&&(a.magnificPopup.defaults[b]=c.options),a.extend(this.proto,c.proto),this.modules.push(b)},defaults:{disableOn:0,key:null,midClick:!1,mainClass:"",preloader:!0,focus:"",closeOnContentClick:!1,closeOnBgClick:!0,closeBtnInside:!0,showCloseBtn:!0,enableEscapeKey:!0,modal:!1,alignTop:!1,removalDelay:0,prependTo:null,fixedContentPos:"auto",fixedBgPos:"auto",overflowY:"auto",closeMarkup:'<button title="%title%" type="button" class="mfp-close">×</button>',tClose:"Close (Esc)",tLoading:"Loading...",autoFocusLast:!0}},a.fn.magnificPopup=function(b){A();var c=a(this);if(typeof b=="string")if(b==="open"){var d,e=p?c.data("magnificPopup"):c[0].magnificPopup,f=parseInt(arguments[1],10)||0;e.items?d=e.items[f]:(d=c,e.delegate&&(d=d.find(e.delegate)),d=d.eq(f)),n._openClick({mfpEl:d},c,e)}else n.isOpen&&n[b].apply(n,Array.prototype.slice.call(arguments,1));else b=a.extend(!0,{},b),p?c.data("magnificPopup",b):c[0].magnificPopup=b,n.addGroup(c,b);return c};var C="inline",D,E,F,G=function(){F&&(E.after(F.addClass(D)).detach(),F=null)};a.magnificPopup.registerModule(C,{options:{hiddenClass:"hide",markup:"",tNotFound:"Content not found"},proto:{initInline:function(){n.types.push(C),w(b+"."+C,function(){G()})},getInline:function(b,c){G();if(b.src){var d=n.st.inline,e=a(b.src);if(e.length){var f=e[0].parentNode;f&&f.tagName&&(E||(D=d.hiddenClass,E=x(D),D="mfp-"+D),F=e.after(E).detach().removeClass(D)),n.updateStatus("ready")}else n.updateStatus("error",d.tNotFound),e=a("<div>");return b.inlineElement=e,e}return n.updateStatus("ready"),n._parseMarkup(c,{},b),c}}});var H="ajax",I,J=function(){I&&a(document.body).removeClass(I)},K=function(){J(),n.req&&n.req.abort()};a.magnificPopup.registerModule(H,{options:{settings:null,cursor:"mfp-ajax-cur",tError:'<a href="%url%">The content</a> could not be loaded.'},proto:{initAjax:function(){n.types.push(H),I=n.st.ajax.cursor,w(b+"."+H,K),w("BeforeChange."+H,K)},getAjax:function(b){I&&a(document.body).addClass(I),n.updateStatus("loading");var c=a.extend({url:b.src,success:function(c,d,e){var f={data:c,xhr:e};y("ParseAjax",f),n.appendContent(a(f.data),H),b.finished=!0,J(),n._setFocus(),setTimeout(function(){n.wrap.addClass(k)},16),n.updateStatus("ready"),y("AjaxContentAdded")},error:function(){J(),b.finished=b.loadError=!0,n.updateStatus("error",n.st.ajax.tError.replace("%url%",b.src))}},n.st.ajax.settings);return n.req=a.ajax(c),""}}});var L,M=function(b){if(b.data&&b.data.title!==undefined)return b.data.title;var c=n.st.image.titleSrc;if(c){if(a.isFunction(c))return c.call(n,b);if(b.el)return b.el.attr(c)||""}return""};a.magnificPopup.registerModule("image",{options:{markup:'<div class="mfp-figure"><div class="mfp-close"></div><figure><div class="mfp-img"></div><figcaption><div class="mfp-bottom-bar"><div class="mfp-title"></div><div class="mfp-counter"></div></div></figcaption></figure></div>',cursor:"mfp-zoom-out-cur",titleSrc:"title",verticalFit:!0,tError:'<a href="%url%">The image</a> could not be loaded.'},proto:{initImage:function(){var c=n.st.image,d=".image";n.types.push("image"),w(g+d,function(){n.currItem.type==="image"&&c.cursor&&a(document.body).addClass(c.cursor)}),w(b+d,function(){c.cursor&&a(document.body).removeClass(c.cursor),r.off("resize"+j)}),w("Resize"+d,n.resizeImage),n.isLowIE&&w("AfterChange",n.resizeImage)},resizeImage:function(){var a=n.currItem;if(!a||!a.img)return;if(n.st.image.verticalFit){var b=0;n.isLowIE&&(b=parseInt(a.img.css("padding-top"),10)+parseInt(a.img.css("padding-bottom"),10)),a.img.css("max-height",n.wH-b)}},_onImageHasSize:function(a){a.img&&(a.hasSize=!0,L&&clearInterval(L),a.isCheckingImgSize=!1,y("ImageHasSize",a),a.imgHidden&&(n.content&&n.content.removeClass("mfp-loading"),a.imgHidden=!1))},findImageSize:function(a){var b=0,c=a.img[0],d=function(e){L&&clearInterval(L),L=setInterval(function(){if(c.naturalWidth>0){n._onImageHasSize(a);return}b>200&&clearInterval(L),b++,b===3?d(10):b===40?d(50):b===100&&d(500)},e)};d(1)},getImage:function(b,c){var d=0,e=function(){b&&(b.img[0].complete?(b.img.off(".mfploader"),b===n.currItem&&(n._onImageHasSize(b),n.updateStatus("ready")),b.hasSize=!0,b.loaded=!0,y("ImageLoadComplete")):(d++,d<200?setTimeout(e,100):f()))},f=function(){b&&(b.img.off(".mfploader"),b===n.currItem&&(n._onImageHasSize(b),n.updateStatus("error",g.tError.replace("%url%",b.src))),b.hasSize=!0,b.loaded=!0,b.loadError=!0)},g=n.st.image,h=c.find(".mfp-img");if(h.length){var i=document.createElement("img");i.className="mfp-img",b.el&&b.el.find("img").length&&(i.alt=b.el.find("img").attr("alt")),b.img=a(i).on("load.mfploader",e).on("error.mfploader",f),i.src=b.src,h.is("img")&&(b.img=b.img.clone()),i=b.img[0],i.naturalWidth>0?b.hasSize=!0:i.width||(b.hasSize=!1)}return n._parseMarkup(c,{title:M(b),img_replaceWith:b.img},b),n.resizeImage(),b.hasSize?(L&&clearInterval(L),b.loadError?(c.addClass("mfp-loading"),n.updateStatus("error",g.tError.replace("%url%",b.src))):(c.removeClass("mfp-loading"),n.updateStatus("ready")),c):(n.updateStatus("loading"),b.loading=!0,b.hasSize||(b.imgHidden=!0,c.addClass("mfp-loading"),n.findImageSize(b)),c)}}});var N,O=function(){return N===undefined&&(N=document.createElement("p").style.MozTransform!==undefined),N};a.magnificPopup.registerModule("zoom",{options:{enabled:!1,easing:"ease-in-out",duration:300,opener:function(a){return a.is("img")?a:a.find("img")}},proto:{initZoom:function(){var a=n.st.zoom,d=".zoom",e;if(!a.enabled||!n.supportsTransition)return;var f=a.duration,g=function(b){var c=b.clone().removeAttr("style").removeAttr("class").addClass("mfp-animated-image"),d="all "+a.duration/1e3+"s "+a.easing,e={position:"fixed",zIndex:9999,left:0,top:0,"-webkit-backface-visibility":"hidden"},f="transition";return e["-webkit-"+f]=e["-moz-"+f]=e["-o-"+f]=e[f]=d,c.css(e),c},h=function(){n.content.css("visibility","visible")},i,j;w("BuildControls"+d,function(){if(n._allowZoom()){clearTimeout(i),n.content.css("visibility","hidden"),e=n._getItemToZoom();if(!e){h();return}j=g(e),j.css(n._getOffset()),n.wrap.append(j),i=setTimeout(function(){j.css(n._getOffset(!0)),i=setTimeout(function(){h(),setTimeout(function(){j.remove(),e=j=null,y("ZoomAnimationEnded")},16)},f)},16)}}),w(c+d,function(){if(n._allowZoom()){clearTimeout(i),n.st.removalDelay=f;if(!e){e=n._getItemToZoom();if(!e)return;j=g(e)}j.css(n._getOffset(!0)),n.wrap.append(j),n.content.css("visibility","hidden"),setTimeout(function(){j.css(n._getOffset())},16)}}),w(b+d,function(){n._allowZoom()&&(h(),j&&j.remove(),e=null)})},_allowZoom:function(){return n.currItem.type==="image"},_getItemToZoom:function(){return n.currItem.hasSize?n.currItem.img:!1},_getOffset:function(b){var c;b?c=n.currItem.img:c=n.st.zoom.opener(n.currItem.el||n.currItem);var d=c.offset(),e=parseInt(c.css("padding-top"),10),f=parseInt(c.css("padding-bottom"),10);d.top-=a(window).scrollTop()-e;var g={width:c.width(),height:(p?c.innerHeight():c[0].offsetHeight)-f-e};return O()?g["-moz-transform"]=g.transform="translate("+d.left+"px,"+d.top+"px)":(g.left=d.left,g.top=d.top),g}}});var P="iframe",Q="//about:blank",R=function(a){if(n.currTemplate[P]){var b=n.currTemplate[P].find("iframe");b.length&&(a||(b[0].src=Q),n.isIE8&&b.css("display",a?"block":"none"))}};a.magnificPopup.registerModule(P,{options:{markup:'<div class="mfp-iframe-scaler"><div class="mfp-close"></div><iframe class="mfp-iframe" src="//about:blank" frameborder="0" allowfullscreen></iframe></div>',srcAction:"iframe_src",patterns:{youtube:{index:"youtube.com",id:"v=",src:"//www.youtube.com/embed/%id%?autoplay=1"},vimeo:{index:"vimeo.com/",id:"/",src:"//player.vimeo.com/video/%id%?autoplay=1"},gmaps:{index:"//maps.google.",src:"%id%&output=embed"}}},proto:{initIframe:function(){n.types.push(P),w("BeforeChange",function(a,b,c){b!==c&&(b===P?R():c===P&&R(!0))}),w(b+"."+P,function(){R()})},getIframe:function(b,c){var d=b.src,e=n.st.iframe;a.each(e.patterns,function(){if(d.indexOf(this.index)>-1)return this.id&&(typeof this.id=="string"?d=d.substr(d.lastIndexOf(this.id)+this.id.length,d.length):d=this.id.call(this,d)),d=this.src.replace("%id%",d),!1});var f={};return e.srcAction&&(f[e.srcAction]=d),n._parseMarkup(c,f,b),n.updateStatus("ready"),c}}});var S=function(a){var b=n.items.length;return a>b-1?a-b:a<0?b+a:a},T=function(a,b,c){return a.replace(/%curr%/gi,b+1).replace(/%total%/gi,c)};a.magnificPopup.registerModule("gallery",{options:{enabled:!1,arrowMarkup:'<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>',preload:[0,2],navigateByImgClick:!0,arrows:!0,tPrev:"Previous (Left arrow key)",tNext:"Next (Right arrow key)",tCounter:"%curr% of %total%"},proto:{initGallery:function(){var c=n.st.gallery,d=".mfp-gallery";n.direction=!0;if(!c||!c.enabled)return!1;u+=" mfp-gallery",w(g+d,function(){c.navigateByImgClick&&n.wrap.on("click"+d,".mfp-img",function(){if(n.items.length>1)return n.next(),!1}),s.on("keydown"+d,function(a){a.keyCode===37?n.prev():a.keyCode===39&&n.next()})}),w("UpdateStatus"+d,function(a,b){b.text&&(b.text=T(b.text,n.currItem.index,n.items.length))}),w(f+d,function(a,b,d,e){var f=n.items.length;d.counter=f>1?T(c.tCounter,e.index,f):""}),w("BuildControls"+d,function(){if(n.items.length>1&&c.arrows&&!n.arrowLeft){var b=c.arrowMarkup,d=n.arrowLeft=a(b.replace(/%title%/gi,c.tPrev).replace(/%dir%/gi,"left")).addClass(m),e=n.arrowRight=a(b.replace(/%title%/gi,c.tNext).replace(/%dir%/gi,"right")).addClass(m);d.click(function(){n.prev()}),e.click(function(){n.next()}),n.container.append(d.add(e))}}),w(h+d,function(){n._preloadTimeout&&clearTimeout(n._preloadTimeout),n._preloadTimeout=setTimeout(function(){n.preloadNearbyImages(),n._preloadTimeout=null},16)}),w(b+d,function(){s.off(d),n.wrap.off("click"+d),n.arrowRight=n.arrowLeft=null})},next:function(){n.direction=!0,n.index=S(n.index+1),n.updateItemHTML()},prev:function(){n.direction=!1,n.index=S(n.index-1),n.updateItemHTML()},goTo:function(a){n.direction=a>=n.index,n.index=a,n.updateItemHTML()},preloadNearbyImages:function(){var a=n.st.gallery.preload,b=Math.min(a[0],n.items.length),c=Math.min(a[1],n.items.length),d;for(d=1;d<=(n.direction?c:b);d++)n._preloadItem(n.index+d);for(d=1;d<=(n.direction?b:c);d++)n._preloadItem(n.index-d)},_preloadItem:function(b){b=S(b);if(n.items[b].preloaded)return;var c=n.items[b];c.parsed||(c=n.parseEl(b)),y("LazyLoad",c),c.type==="image"&&(c.img=a('<img class="mfp-img" />').on("load.mfploader",function(){c.hasSize=!0}).on("error.mfploader",function(){c.hasSize=!0,c.loadError=!0,y("LazyLoadError",c)}).attr("src",c.src)),c.preloaded=!0}}});var U="retina";a.magnificPopup.registerModule(U,{options:{replaceSrc:function(a){return a.src.replace(/\.\w+$/,function(a){return"@2x"+a})},ratio:1},proto:{initRetina:function(){if(window.devicePixelRatio>1){var a=n.st.retina,b=a.ratio;b=isNaN(b)?b():b,b>1&&(w("ImageHasSize."+U,function(a,c){c.img.css({"max-width":c.img[0].naturalWidth/b,width:"100%"})}),w("ElementParse."+U,function(c,d){d.src=a.replaceSrc(d,b)}))}}}}),A()})
|
inc/core/assets.php
CHANGED
@@ -62,8 +62,8 @@ class Su_Assets {
|
|
62 |
// jsRender
|
63 |
wp_register_script( 'jsrender', plugins_url( 'assets/js/jsrender.js', SU_PLUGIN_FILE ), array( 'jquery' ), '1.0.0-beta', true );
|
64 |
// Magnific Popup
|
65 |
-
wp_register_style( 'magnific-popup', plugins_url( 'assets/css/magnific-popup.css', SU_PLUGIN_FILE ), false, '
|
66 |
-
wp_register_script( 'magnific-popup', plugins_url( 'assets/js/magnific-popup.js', SU_PLUGIN_FILE ), array( 'jquery' ), '
|
67 |
wp_localize_script( 'magnific-popup', 'su_magnific_popup', array(
|
68 |
'close' => __( 'Close (Esc)', 'shortcodes-ultimate' ),
|
69 |
'loading' => __( 'Loading...', 'shortcodes-ultimate' ),
|
@@ -79,9 +79,9 @@ class Su_Assets {
|
|
79 |
// jPlayer
|
80 |
wp_register_script( 'jplayer', plugins_url( 'assets/js/jplayer.js', SU_PLUGIN_FILE ), array( 'jquery' ), '2.4.0', true );
|
81 |
// Generator
|
82 |
-
wp_register_style( 'su-generator', plugins_url( 'assets/css/generator.css', SU_PLUGIN_FILE ), array( 'farbtastic', 'magnific-popup' ), SU_PLUGIN_VERSION, 'all' );
|
83 |
-
wp_register_script( 'su-generator', plugins_url( '
|
84 |
-
wp_localize_script( 'su-generator', '
|
85 |
'upload_title' => __( 'Choose file', 'shortcodes-ultimate' ),
|
86 |
'upload_insert' => __( 'Insert', 'shortcodes-ultimate' ),
|
87 |
'isp_media_title' => __( 'Select images', 'shortcodes-ultimate' ),
|
62 |
// jsRender
|
63 |
wp_register_script( 'jsrender', plugins_url( 'assets/js/jsrender.js', SU_PLUGIN_FILE ), array( 'jquery' ), '1.0.0-beta', true );
|
64 |
// Magnific Popup
|
65 |
+
wp_register_style( 'magnific-popup', plugins_url( 'assets/css/magnific-popup.css', SU_PLUGIN_FILE ), false, '1.1.0', 'all' );
|
66 |
+
wp_register_script( 'magnific-popup', plugins_url( 'assets/js/magnific-popup.js', SU_PLUGIN_FILE ), array( 'jquery' ), '1.1.0', true );
|
67 |
wp_localize_script( 'magnific-popup', 'su_magnific_popup', array(
|
68 |
'close' => __( 'Close (Esc)', 'shortcodes-ultimate' ),
|
69 |
'loading' => __( 'Loading...', 'shortcodes-ultimate' ),
|
79 |
// jPlayer
|
80 |
wp_register_script( 'jplayer', plugins_url( 'assets/js/jplayer.js', SU_PLUGIN_FILE ), array( 'jquery' ), '2.4.0', true );
|
81 |
// Generator
|
82 |
+
wp_register_style( 'su-generator', plugins_url( 'assets/css/generator.css', SU_PLUGIN_FILE ), array( 'farbtastic', 'magnific-popup', 'simpleslider' ), SU_PLUGIN_VERSION, 'all' );
|
83 |
+
wp_register_script( 'su-generator', plugins_url( 'includes/js/generator/index.js', SU_PLUGIN_FILE ), array( 'farbtastic', 'magnific-popup', 'simpleslider' ), SU_PLUGIN_VERSION, true );
|
84 |
+
wp_localize_script( 'su-generator', 'SUGL10n', array(
|
85 |
'upload_title' => __( 'Choose file', 'shortcodes-ultimate' ),
|
86 |
'upload_insert' => __( 'Insert', 'shortcodes-ultimate' ),
|
87 |
'isp_media_title' => __( 'Select images', 'shortcodes-ultimate' ),
|
inc/core/generator.php
CHANGED
@@ -4,63 +4,172 @@
|
|
4 |
*/
|
5 |
class Su_Generator {
|
6 |
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
|
13 |
-
add_action( 'wp_ajax_su_generator_settings',
|
14 |
-
add_action( 'wp_ajax_su_generator_preview',
|
15 |
-
add_action( 'su/generator/actions',
|
16 |
|
17 |
-
add_action( 'wp_ajax_su_generator_get_icons',
|
18 |
-
add_action( 'wp_ajax_su_generator_get_terms',
|
19 |
add_action( 'wp_ajax_su_generator_get_taxonomies', array( __CLASS__, 'ajax_get_taxonomies' ) );
|
20 |
-
add_action( 'wp_ajax_su_generator_add_preset',
|
21 |
-
add_action( 'wp_ajax_su_generator_remove_preset',
|
22 |
-
add_action( 'wp_ajax_su_generator_get_preset',
|
23 |
}
|
24 |
|
25 |
/**
|
26 |
-
*
|
27 |
*/
|
28 |
public static function button( $args = array() ) {
|
29 |
-
|
30 |
-
|
31 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
$target = is_string( $args ) ? $args : 'content';
|
33 |
-
|
34 |
-
$args = wp_parse_args(
|
|
|
|
|
35 |
'target' => $target,
|
36 |
'text' => __( 'Insert shortcode', 'shortcodes-ultimate' ),
|
37 |
'class' => 'button',
|
38 |
'icon' => plugins_url( 'assets/images/icon.png', SU_PLUGIN_FILE ),
|
39 |
'echo' => true,
|
40 |
-
'shortcode' =>
|
41 |
-
)
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
do_action( 'su/button', $args );
|
55 |
-
|
56 |
-
if ( $args['echo'] )
|
|
|
|
|
|
|
57 |
return $button;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
}
|
59 |
|
60 |
/**
|
61 |
* Generator popup form
|
62 |
*/
|
63 |
public static function popup() {
|
|
|
|
|
|
|
|
|
|
|
64 |
ob_start();
|
65 |
$tools = apply_filters( 'su/generator/tools', array(
|
66 |
'<a href="' . admin_url( 'admin.php?page=shortcodes-ultimate' ) . '#tab-1" target="_blank" title="' . __( 'Settings', 'shortcodes-ultimate' ) . '">' . __( 'Plugin settings', 'shortcodes-ultimate' ) . '</a>',
|
4 |
*/
|
5 |
class Su_Generator {
|
6 |
|
7 |
+
public function __construct() {
|
8 |
+
add_action(
|
9 |
+
'media_buttons',
|
10 |
+
array( __CLASS__, 'classic_editor_button' ),
|
11 |
+
1000
|
12 |
+
);
|
13 |
+
add_action(
|
14 |
+
'enqueue_block_editor_assets',
|
15 |
+
array( __CLASS__, 'block_editor_button' )
|
16 |
+
);
|
17 |
+
|
18 |
+
add_action( 'wp_footer', array( __CLASS__, 'popup' ) );
|
19 |
+
add_action( 'admin_footer', array( __CLASS__, 'popup' ) );
|
20 |
|
21 |
+
add_action( 'wp_ajax_su_generator_settings', array( __CLASS__, 'settings' ) );
|
22 |
+
add_action( 'wp_ajax_su_generator_preview', array( __CLASS__, 'preview' ) );
|
23 |
+
add_action( 'su/generator/actions', array( __CLASS__, 'presets' ) );
|
24 |
|
25 |
+
add_action( 'wp_ajax_su_generator_get_icons', array( __CLASS__, 'ajax_get_icons' ) );
|
26 |
+
add_action( 'wp_ajax_su_generator_get_terms', array( __CLASS__, 'ajax_get_terms' ) );
|
27 |
add_action( 'wp_ajax_su_generator_get_taxonomies', array( __CLASS__, 'ajax_get_taxonomies' ) );
|
28 |
+
add_action( 'wp_ajax_su_generator_add_preset', array( __CLASS__, 'ajax_add_preset' ) );
|
29 |
+
add_action( 'wp_ajax_su_generator_remove_preset', array( __CLASS__, 'ajax_remove_preset' ) );
|
30 |
+
add_action( 'wp_ajax_su_generator_get_preset', array( __CLASS__, 'ajax_get_preset' ) );
|
31 |
}
|
32 |
|
33 |
/**
|
34 |
+
* @deprecated 5.1.0 Replaced with Su_Generator::classic_editor_button()
|
35 |
*/
|
36 |
public static function button( $args = array() ) {
|
37 |
+
self::classic_editor_button( $args );
|
38 |
+
}
|
39 |
+
|
40 |
+
public static function classic_editor_button( $args = array() ) {
|
41 |
+
|
42 |
+
if ( ! self::access_check() ) {
|
43 |
+
return;
|
44 |
+
}
|
45 |
+
|
46 |
+
self::enqueue_generator();
|
47 |
+
|
48 |
$target = is_string( $args ) ? $args : 'content';
|
49 |
+
|
50 |
+
$args = wp_parse_args(
|
51 |
+
$args,
|
52 |
+
array(
|
53 |
'target' => $target,
|
54 |
'text' => __( 'Insert shortcode', 'shortcodes-ultimate' ),
|
55 |
'class' => 'button',
|
56 |
'icon' => plugins_url( 'assets/images/icon.png', SU_PLUGIN_FILE ),
|
57 |
'echo' => true,
|
58 |
+
'shortcode' => '',
|
59 |
+
)
|
60 |
+
);
|
61 |
+
|
62 |
+
$icon = ( $args['icon'] )
|
63 |
+
? sprintf( '<img src="%s">', $args['icon'] )
|
64 |
+
: '';
|
65 |
+
|
66 |
+
$js_args = sprintf(
|
67 |
+
"'classic', { editorID: '%s', shortcode: '%s' }",
|
68 |
+
esc_attr( $args['target'] ),
|
69 |
+
esc_attr( $args['shortcode'] )
|
70 |
+
);
|
71 |
+
|
72 |
+
$button = sprintf(
|
73 |
+
'<button
|
74 |
+
type="button"
|
75 |
+
class="su-generator-button %1$s"
|
76 |
+
title="%2$s"
|
77 |
+
onclick="SUG.App.insert(%3$s);"
|
78 |
+
>
|
79 |
+
%4$s %5$s
|
80 |
+
</button>',
|
81 |
+
esc_attr( $args['class'] ),
|
82 |
+
esc_attr( $args['text'] ),
|
83 |
+
$js_args,
|
84 |
+
$icon,
|
85 |
+
esc_html( $args['text'] )
|
86 |
+
);
|
87 |
+
|
88 |
do_action( 'su/button', $args );
|
89 |
+
|
90 |
+
if ( $args['echo'] ) {
|
91 |
+
echo $button;
|
92 |
+
}
|
93 |
+
|
94 |
return $button;
|
95 |
+
|
96 |
+
}
|
97 |
+
|
98 |
+
public static function block_editor_button() {
|
99 |
+
|
100 |
+
if ( ! self::access_check() ) {
|
101 |
+
return;
|
102 |
+
}
|
103 |
+
|
104 |
+
self::enqueue_generator();
|
105 |
+
|
106 |
+
wp_enqueue_script(
|
107 |
+
'shortcodes-ultimate-block-editor',
|
108 |
+
plugins_url( 'includes/js/block-editor/index.js', SU_PLUGIN_FILE ),
|
109 |
+
array( 'wp-element', 'wp-editor', 'wp-components', 'su-generator' ),
|
110 |
+
SU_PLUGIN_VERSION,
|
111 |
+
true
|
112 |
+
);
|
113 |
+
|
114 |
+
wp_localize_script(
|
115 |
+
'shortcodes-ultimate-block-editor',
|
116 |
+
'SUBlockEditorL10n',
|
117 |
+
array( 'insertShortcode' => __( 'Insert shortcode', 'shortcodes-ultimate' ) )
|
118 |
+
);
|
119 |
+
|
120 |
+
wp_localize_script(
|
121 |
+
'shortcodes-ultimate-block-editor',
|
122 |
+
'SUBlockEditorSettings',
|
123 |
+
array( 'supportedBlocks' => get_option( 'su_option_supported_blocks', array() ) )
|
124 |
+
);
|
125 |
+
|
126 |
+
}
|
127 |
+
|
128 |
+
public static function enqueue_generator() {
|
129 |
+
do_action( 'su/generator/enqueue' );
|
130 |
+
self::enqueue_assets();
|
131 |
+
}
|
132 |
+
|
133 |
+
public static function enqueue_assets() {
|
134 |
+
|
135 |
+
wp_enqueue_media();
|
136 |
+
|
137 |
+
su_query_asset(
|
138 |
+
'css',
|
139 |
+
array(
|
140 |
+
'simpleslider',
|
141 |
+
'farbtastic',
|
142 |
+
'magnific-popup',
|
143 |
+
'font-awesome',
|
144 |
+
'su-generator',
|
145 |
+
)
|
146 |
+
);
|
147 |
+
|
148 |
+
su_query_asset(
|
149 |
+
'js',
|
150 |
+
array(
|
151 |
+
'jquery',
|
152 |
+
'jquery-ui-core',
|
153 |
+
'jquery-ui-widget',
|
154 |
+
'jquery-ui-mouse',
|
155 |
+
'simpleslider',
|
156 |
+
'farbtastic',
|
157 |
+
'magnific-popup',
|
158 |
+
'su-generator',
|
159 |
+
)
|
160 |
+
);
|
161 |
+
|
162 |
}
|
163 |
|
164 |
/**
|
165 |
* Generator popup form
|
166 |
*/
|
167 |
public static function popup() {
|
168 |
+
|
169 |
+
if ( ! did_action( 'su/generator/enqueue' ) ) {
|
170 |
+
return;
|
171 |
+
}
|
172 |
+
|
173 |
ob_start();
|
174 |
$tools = apply_filters( 'su/generator/tools', array(
|
175 |
'<a href="' . admin_url( 'admin.php?page=shortcodes-ultimate' ) . '#tab-1" target="_blank" title="' . __( 'Settings', 'shortcodes-ultimate' ) . '">' . __( 'Plugin settings', 'shortcodes-ultimate' ) . '</a>',
|
includes/class-shortcodes-ultimate-activator.php
CHANGED
@@ -79,6 +79,11 @@ class Shortcodes_Ultimate_Activator {
|
|
79 |
'su_option_skip' => 'on',
|
80 |
'su_option_prefix' => 'su_',
|
81 |
'su_option_custom-css' => '',
|
|
|
|
|
|
|
|
|
|
|
82 |
);
|
83 |
|
84 |
foreach ( $defaults as $option => $value ) {
|
79 |
'su_option_skip' => 'on',
|
80 |
'su_option_prefix' => 'su_',
|
81 |
'su_option_custom-css' => '',
|
82 |
+
'su_option_supported_blocks' => array(
|
83 |
+
'core/paragraph',
|
84 |
+
'core/shortcode',
|
85 |
+
'core/freeform',
|
86 |
+
),
|
87 |
);
|
88 |
|
89 |
foreach ( $defaults as $option => $value ) {
|
includes/config/supported-blocks.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
return apply_filters(
|
4 |
+
'su/config/supported_blocks',
|
5 |
+
array(
|
6 |
+
'core/paragraph' => __( 'Paragraph', 'shortcodes-ultimate' ),
|
7 |
+
'core/shortcode' => __( 'Shortcode', 'shortcodes-ultimate' ),
|
8 |
+
'core/freeform' => __( 'Classic', 'shortcodes-ultimate' ),
|
9 |
+
)
|
10 |
+
);
|
includes/functions-helpers.php
CHANGED
@@ -56,7 +56,7 @@ function su_get_config( $key = null ) {
|
|
56 |
return false;
|
57 |
}
|
58 |
|
59 |
-
return $config[ $key ] =
|
60 |
|
61 |
}
|
62 |
|
@@ -143,8 +143,12 @@ function su_parse_range( $string = '' ) {
|
|
143 |
* @param array $atts Shortcode atts.
|
144 |
* @return string Extra CSS class(es) prepended by a space.
|
145 |
*/
|
146 |
-
|
147 |
-
|
|
|
|
|
|
|
|
|
148 |
}
|
149 |
|
150 |
/**
|
@@ -226,3 +230,16 @@ function su_do_nested_shortcodes( $content, $shortcode ) {
|
|
226 |
return do_shortcode( $content );
|
227 |
|
228 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
return false;
|
57 |
}
|
58 |
|
59 |
+
return $config[ $key ] = include $config_file;
|
60 |
|
61 |
}
|
62 |
|
143 |
* @param array $atts Shortcode atts.
|
144 |
* @return string Extra CSS class(es) prepended by a space.
|
145 |
*/
|
146 |
+
if ( ! function_exists( 'su_get_css_class' ) ) {
|
147 |
+
|
148 |
+
function su_get_css_class( $atts ) {
|
149 |
+
return $atts['class'] ? ' ' . trim( $atts['class'] ) : '';
|
150 |
+
}
|
151 |
+
|
152 |
}
|
153 |
|
154 |
/**
|
230 |
return do_shortcode( $content );
|
231 |
|
232 |
}
|
233 |
+
|
234 |
+
/**
|
235 |
+
* Helper function to force enqueuing of the shortcode generator
|
236 |
+
* assets and templates.
|
237 |
+
*
|
238 |
+
* Usage example:
|
239 |
+
* `add_action( 'admin_init', 'su_enqueue_generator' );`
|
240 |
+
*
|
241 |
+
* @since 5.1.0
|
242 |
+
*/
|
243 |
+
function su_enqueue_generator() {
|
244 |
+
Su_Generator::enqueue_generator();
|
245 |
+
}
|
includes/js/block-editor/index.js
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
"use strict";!function(){var n=wp.element.Fragment,c=wp.editor.BlockControls,t=wp.components,r=t.SVG,i=t.Path,e=function t(o){return function(e){return-1===SUBlockEditorSettings.supportedBlocks.indexOf(e.name)?React.createElement(o,e):React.createElement(n,null,React.createElement(o,e),React.createElement(c,{controls:[{icon:React.createElement(r,{viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},React.createElement(i,{d:"m3 3h5.833v2.333h-3.5v9.334h3.5v2.333h-5.833zm8.167 0h5.833v14h-5.833v-2.333h3.5v-9.334h-3.5z"})),title:SUBlockEditorL10n.insertShortcode,onClick:function t(){SUG.App.insert("block",{props:e})}}]}))}};wp.hooks.addFilter("editor.BlockEdit","shortcodes-ultimate/with-insert-shortcode-button",e)}();
|
2 |
+
//# sourceMappingURL=index.js.map
|
3 |
+
//# sourceMappingURL=index.js.map
|
includes/js/block-editor/index.js.map
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
{"version":3,"sources":["src/index.js"],"names":["Fragment","wp","element","BlockControls","editor","_wp$components","components","SVG","Path","withInsertShortcodeButton","BlockEdit","props","SUBlockEditorSettings","supportedBlocks","indexOf","name","React","createElement","controls","icon","viewBox","xmlns","d","title","SUBlockEditorL10n","insertShortcode","onClick","SUG","App","insert","hooks","addFilter"],"mappings":"cAAA,WAAY,IAEHA,EAAkBC,GAAGC,QAArBF,SACAG,EAAkBF,GAAGG,OAArBD,cAHGE,EAIeJ,GAAGK,WAArBC,EAJGF,EAIHE,IAAKC,EAJFH,EAIEG,KAEPC,EAA4B,SAA5BA,EAA4BC,GAEjC,OAAO,SAAEC,GAER,OAAsE,IAAjEC,sBAAsBC,gBAAgBC,QAASH,EAAMI,MAClDC,MAAAC,cAACP,EAAeC,GAIvBK,MAAAC,cAACjB,EAAD,KACCgB,MAAAC,cAACP,EAAeC,GAChBK,MAAAC,cAACd,EAAD,CAAee,SAAW,CACzB,CACCC,KAAMH,MAAAC,cAACV,EAAD,CAAKa,QAAQ,YAAYC,MAAM,8BAA6BL,MAAAC,cAACT,EAAD,CAAMc,EAAE,mGAC1EC,MAAOC,kBAAkBC,gBACzBC,QAAS,SAAAA,IACRC,IAAIC,IAAIC,OAAQ,QAAS,CAAElB,MAAOA,YAWzCV,GAAG6B,MAAMC,UACR,mBACA,mDACAtB,GApCF"}
|
includes/js/generator/index.js
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
"use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function e(t){return typeof t}:function e(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}var SUG={};SUG.App=function(f){var s=f("#su-generator"),o=f("#su-generator-search"),i=f("#su-generator-filter"),e=i.children("a"),u=f("#su-generator-choices"),c=u.find("span"),l=f("#su-generator-settings"),g=f("#su-compatibility-mode-prefix"),n=f("#su-generator-result"),p=f("#su-generator-selected"),d={state:{mceSelection:"",target:"",wpActiveEditor:null,context:"",insertArgs:"",preview:{timer:null,request:null}}};return d.el={body:f("body")},d.init=function(){var n;e.click(function(e){var t=f(this).data("filter");if("all"===t)c.css({opacity:1}).removeClass("su-generator-choice-first");else{var r=new RegExp(t,"gi");c.css({opacity:.2}),c.each(function(){var e;null!==f(this).data("group").match(r)&&f(this).css({opacity:1}).removeClass("su-generator-choice-first")})}e.preventDefault()}),f("#su-generator").on("click",".su-generator-home",function(e){o.val(""),l.html("").hide(),s.removeClass("su-generator-narrow"),i.show(),u.show(),c.show(),d.state.mceSelection="",o.focus(),e.preventDefault()}),f("#su-generator").on("click",".su-generator-close",function(e){f.magnificPopup.close(),e.preventDefault()}),o.on({focus:function e(){f(this).val(""),l.html("").hide(),s.removeClass("su-generator-narrow"),u.show(),c.css({opacity:1}).removeClass("su-generator-choice-first"),i.show()},blur:function e(){},keyup:function e(t){var r=f(".su-generator-choice-first:first"),o=f(this).val(),i=new RegExp(o,"gi"),u=0;13===t.keyCode&&0<r.length&&(t.preventDefault(),f(this).val("").blur(),r.trigger("click")),c.css({opacity:.2}).removeClass("su-generator-choice-first"),c.each(function(){var e=f(this).data(),t=e.shortcode,r,a,n,s=[t,e.name,e.desc,e.group].join(" ").match(i);null!==s&&(f(this).css({opacity:1}),o===t?(c.removeClass("su-generator-choice-first"),f(this).addClass("su-generator-choice-first"),u=999):s.length>u&&(c.removeClass("su-generator-choice-first"),f(this).addClass("su-generator-choice-first"),u=s.length))}),""===o&&c.removeClass("su-generator-choice-first")}}),c.on("click",function(e){var a=f(this).data("shortcode");f.ajax({type:"POST",url:ajaxurl,data:{action:"su_generator_settings",shortcode:a},beforeSend:function e(){f("#su-generator-preview").hide(),u.hide(),l.addClass("su-generator-loading").show(),s.addClass("su-generator-narrow"),i.hide()},success:function e(t){l.removeClass("su-generator-loading"),l.html(t);var r=f("#su-generator-content");void 0!==d.state.mceSelection&&""!==d.state.mceSelection&&"hidden"!==r.attr("type")&&r.val(d.state.mceSelection),f(".su-generator-range-picker").each(function(e){var t,r=f(this).find("input"),a=r.attr("min"),n=r.attr("max"),s=r.attr("step");r.simpleSlider({snap:!0,step:s,range:[a,n]}),r.show(),r.on("keyup blur",function(e){r.simpleSlider("setValue",r.val())})}),f(".su-generator-select-color").each(function(e){f(this).find(".su-generator-select-color-wheel").filter(":first").farbtastic(".su-generator-select-color-value:eq("+e+")"),f(this).find(".su-generator-select-color-value").focus(function(){f(".su-generator-select-color-wheel:eq("+e+")").show()}),f(this).find(".su-generator-select-color-value").blur(function(){f(".su-generator-select-color-wheel:eq("+e+")").hide()})}),f(".su-generator-isp").each(function(){var r=f(this),u=r.find(".su-generator-isp-sources"),a=r.find(".su-generator-isp-source"),e=r.find(".su-generator-isp-add-media"),c=r.find(".su-generator-isp-images"),l=r.find(".su-generator-isp-categories"),g=r.find(".su-generator-isp-taxonomies"),p=f(".su-generator-isp-terms"),d=r.find(".su-generator-attr"),t,n=function e(){var t="none",r="",a=u.val();if("media"===a){var n=[];c.find("span").each(function(e){n[e]=f(this).data("id")}),0<n.length&&(r=n.join(","))}else if("category"===a){var s=l.val()||[];0<s.length&&(r=s.join(","))}else if("taxonomy"===a){var o=g.val()||"",i=p.val()||[];"0"!==o&&0<i.length&&(t="taxonomy: "+o+"/"+i.join(","))}else t="0"===a?"none":a;""!==r&&(t=a+": "+r),d.val(t).trigger("change")};u.on("change",function(e){var t=f(this).val();e.preventDefault(),a.removeClass("su-generator-isp-source-open"),-1===t.indexOf(":")&&r.find(".su-generator-isp-source-"+t).addClass("su-generator-isp-source-open"),n()}),c.on("click","span i",function(){f(this).parent("span").css("border-color","#f03").fadeOut(300,function(){f(this).remove(),n()})}),e.click(function(e){e.preventDefault(),void 0!==t&&t.close(),(t=wp.media.frames.su_media_frame_1=wp.media({title:SUGL10n.isp_media_title,library:{type:"image"},button:{text:SUGL10n.isp_media_insert},multiple:!0})).on("select",function(){var e=t.state().get("selection").toJSON();c.find("em").remove(),f.each(e,function(e){c.append('<span data-id="'+this.id+'" title="'+this.title+'"><img src="'+this.url+'" alt="" /><i class="fa fa-times"></i></span>')}),n()}).open()}),c.sortable({revert:200,containment:r,tolerance:"pointer",stop:function e(){n()}}),l.on("change",n),p.on("change",n),g.on("change",function(){var r=f(this).parents(".su-generator-isp-source"),e=f(this).val();if(p.hide().find("option").remove(),n(),"0"!==e)var t=f.ajax({url:ajaxurl,type:"post",dataType:"html",data:{action:"su_generator_get_terms",tax:e,class:"su-generator-isp-terms",multiple:!0,size:10},beforeSend:function e(){"object"===_typeof(t)&&t.abort(),p.html("").attr("disabled",!0).hide(),r.addClass("su-generator-loading")},success:function e(t){p.html(t).attr("disabled",!1).show(),r.removeClass("su-generator-loading")}})})}),f(".su-generator-upload-button").each(function(){var e=f(this),t=f(this).parents(".su-generator-attr-container").find("input:text"),r;e.on("click",function(e){e.preventDefault(),e.stopPropagation(),void 0!==r&&r.close(),(r=wp.media.frames.su_media_frame_2=wp.media({title:SUGL10n.upload_title,button:{text:SUGL10n.upload_insert},multiple:!1})).on("select",function(){var e=r.state().get("selection").first().toJSON();t.val(e.url).trigger("change")}),r.open()})}),f(".su-generator-icon-picker-button").each(function(){var e=f(this),t=f(this).parents(".su-generator-attr-container"),r=t.find(".su-generator-attr"),n=t.find(".su-generator-icon-picker"),s=n.find("input:text");e.click(function(e){n.toggleClass("su-generator-icon-picker-visible"),s.val("").trigger("keyup"),n.hasClass("su-generator-icon-picker-loaded")||(f.ajax({type:"post",url:ajaxurl,data:{action:"su_generator_get_icons"},dataType:"html",beforeSend:function e(){n.addClass("su-generator-loading"),n.addClass("su-generator-icon-picker-loaded")},success:function e(t){n.append(t);var a=n.children("i");a.click(function(e){r.val("icon: "+f(this).attr("title")),n.removeClass("su-generator-icon-picker-visible"),r.trigger("change"),e.preventDefault()}),s.on({keyup:function e(){var t=f(this).val(),r=new RegExp(t,"gi");a.hide(),a.each(function(){var e;null!==f(this).attr("title").match(r)&&f(this).show()})},focus:function e(){f(this).val(""),a.show()}}),n.removeClass("su-generator-loading")}}),e.preventDefault())})}),f(".su-generator-switch").click(function(e){var t,r=f(this).parent().children("input"),a;"yes"===r.val()?r.val("no").trigger("change"):r.val("yes").trigger("change"),e.preventDefault()}),f(".su-generator-switch-value").on("change",function(){var e=f(this),t=e.parent().children(".su-generator-switch"),r=e.val();"yes"===r?t.removeClass("su-generator-switch-no").addClass("su-generator-switch-yes"):"no"===r&&t.removeClass("su-generator-switch-yes").addClass("su-generator-switch-no")}),f("select#su-generator-attr-taxonomy").on("change",function(){var e,t=f(this).val(),r=f("select#su-generator-attr-tax_term");window.su_generator_get_terms=f.ajax({type:"POST",url:ajaxurl,data:{action:"su_generator_get_terms",tax:t,noselect:!0},dataType:"html",beforeSend:function e(){"object"===_typeof(window.su_generator_get_terms)&&window.su_generator_get_terms.abort(),r.parent().addClass("su-generator-loading")},success:function e(t){r.find("option").remove(),r.append(t),r.parent().removeClass("su-generator-loading")}})}),f(".su-generator-shadow-picker").each(function(e){var t=f(this),r=t.find(".su-generator-shadow-picker-field input"),a=t.find(".su-generator-sp-hoff"),n=t.find(".su-generator-sp-voff"),s=t.find(".su-generator-sp-blur"),o={cnt:t.find(".su-generator-shadow-picker-color"),value:t.find(".su-generator-shadow-picker-color-value"),wheel:t.find(".su-generator-shadow-picker-color-wheel")},i=t.find(".su-generator-attr");o.wheel.farbtastic(o.value),o.value.focus(function(){o.wheel.show()}),o.value.blur(function(){o.wheel.hide()}),r.on("change blur keyup",function(){i.val(a.val()+"px "+n.val()+"px "+s.val()+"px "+o.value.val()).trigger("change")}),i.on("keyup",function(){var e=f(this).val().split(" ");4===e.length&&(a.val(e[0].replace("px","")),n.val(e[1].replace("px","")),s.val(e[2].replace("px","")),o.value.val(e[3]),r.trigger("keyup"))})}),f(".su-generator-border-picker").each(function(e){var t=f(this),r=t.find(".su-generator-border-picker-field input, .su-generator-border-picker-field select"),a=t.find(".su-generator-bp-width"),n=t.find(".su-generator-bp-style"),s={cnt:t.find(".su-generator-border-picker-color"),value:t.find(".su-generator-border-picker-color-value"),wheel:t.find(".su-generator-border-picker-color-wheel")},o=t.find(".su-generator-attr");s.wheel.farbtastic(s.value),s.value.focus(function(){s.wheel.show()}),s.value.blur(function(){s.wheel.hide()}),r.on("change blur keyup",function(){o.val(a.val()+"px "+n.val()+" "+s.value.val()).trigger("change")}),o.on("keyup",function(){var e=f(this).val().split(" ");3===e.length&&(a.val(e[0].replace("px","")),n.val(e[1]),s.value.val(e[2]),r.trigger("keyup"))})}),l.find(".su-generator-attr").on("change keyup blur",function(){var e=f(this).parents(".su-generator-attr-container"),t=e.data("default"),r;f(this).val()!=t?e.removeClass("su-generator-skip"):e.addClass("su-generator-skip")}),f(".su-generator-set-value").click(function(e){f(this).parents(".su-generator-attr-container").find("input").val(f(this).text()).trigger("change")}),p.val(a),f.ajax({type:"GET",url:ajaxurl,data:{action:"su_generator_get_preset",id:"last_used",shortcode:a},beforeSend:function e(){},success:function e(t){d.setSettings(t);var r=f("#su-generator-content");void 0!==d.state.mceSelection&&""!==d.state.mceSelection&&"hidden"!==r.attr("type")&&r.val(d.state.mceSelection)},dataType:"json"})},dataType:"html"})}),f("#su-generator").on("click",".su-generator-insert",d.insertShortcode),f("#su-generator").on("click",".su-generator-toggle-preview",function(e){var t=f("#su-generator-preview"),r;f(this).hide(),t.addClass("su-generator-loading").show(),l.find("input, textarea, select").on("change keyup blur",function(){d.updatePreview()}),d.updatePreview(!0),e.preventDefault()}),f("#su-generator").on("mouseenter click",".su-generator-presets",function(){clearTimeout(n),f(".su-gp-popup").show()}),f("#su-generator").on("mouseleave",".su-generator-presets",function(){n=window.setTimeout(function(){f(".su-gp-popup").fadeOut(200)},600)}),f("#su-generator").on("click",".su-gp-new",function(e){var t=f(this).parents(".su-generator-presets"),r=f(".su-gp-list"),a=(new Date).getTime(),n=prompt(SUGL10n.presets_prompt_msg,SUGL10n.presets_prompt_value);""!==n&&null!==n&&(r.find("b").hide(),r.append('<span data-id="'+a+'"><em>'+n+'</em><i class="fa fa-times"></i></span>'),d.addPreset(a,n))}),f("#su-generator").on("click",".su-gp-list span",function(e){var t=f(".su-generator-presets").data("shortcode"),r=f(this).data("id"),a=f(".su-generator-insert");f(".su-gp-popup").hide(),clearTimeout(n),f.ajax({type:"GET",url:ajaxurl,data:{action:"su_generator_get_preset",id:r,shortcode:t},beforeSend:function e(){a.addClass("button-primary-disabled").attr("disabled",!0)},success:function e(t){a.removeClass("button-primary-disabled").attr("disabled",!1),d.setSettings(t)},dataType:"json"}),e.preventDefault(),e.stopPropagation()}),f("#su-generator").on("click",".su-gp-list i",function(e){var t=f(this).parents(".su-gp-list"),r=f(this).parent("span"),a=r.data("id");r.remove(),t.find("span").length<1&&t.find("b").show(),d.removePreset(a),e.stopPropagation(),e.preventDefault()})},d.addPreset=function(e,t){var r=f(".su-generator-presets").data("shortcode"),a=d.getSettings();f.ajax({type:"POST",url:ajaxurl,data:{action:"su_generator_add_preset",id:e,name:t,shortcode:r,settings:a}})},d.removePreset=function(e){var t=f(".su-generator-presets").data("shortcode");f.ajax({type:"POST",url:ajaxurl,data:{action:"su_generator_remove_preset",id:e,shortcode:t}})},d.parseSettings=function(){var e=p.val(),t=g.val(),r=f("#su-generator-settings .su-generator-attr-container:not(.su-generator-skip) .su-generator-attr"),a=f("#su-generator-content").val(),n=new String("");return n+="["+t+e,r.each(function(){var e=f(this),t="";null==(t=e.is("select")?e.find("option:selected").val():e.val())?t="":"array"==typeof t&&(t=t.join(",")),""!==t&&(n+=" "+f(this).attr("name")+'="'+f(this).val().toString().replace(/"/gi,"'")+'"')}),n+="]","false"!=a&&(n+=a+"[/"+t+e+"]"),n},d.getSettings=function(){var e=p.val(),t=f("#su-generator-settings .su-generator-attr"),r=f("#su-generator-content").val(),n={};return t.each(function(e){var t=f(this),r="",a=t.attr("name");null==(r=t.is("select")?t.find("option:selected").val():t.val())&&(r=""),n[a]=r}),n.content=r.toString(),n},d.setSettings=function(r){var e=f("#su-generator-settings .su-generator-attr"),t=f("#su-generator-content");e.each(function(){var e=f(this),t=e.attr("name");r.hasOwnProperty(t)&&(e.val(r[t]),e.trigger("keyup").trigger("change").trigger("blur"))}),r.hasOwnProperty("content")&&t.val(r.content).trigger("keyup").trigger("change").trigger("blur"),d.updatePreview()},d.updatePreview=function(e){var r=f("#su-generator-preview"),t=d.parseSettings(),a=n.text();e=e||!1,r.is(":visible")&&(t!==a||e)&&(window.clearTimeout(d.state.preview.timer),d.state.preview.timer=window.setTimeout(function(){d.state.preview.request=f.ajax({type:"POST",url:ajaxurl,cache:!1,data:{action:"su_generator_preview",shortcode:t},beforeSend:function e(){d.state.preview.request&&d.state.preview.request.abort(),r.addClass("su-generator-loading").html("")},success:function e(t){r.html(t).removeClass("su-generator-loading")},dataType:"html"})},300),n.text(t))},d.insert=function(e,t){if("string"==typeof e&&"object"===_typeof(t)){d.state.context=e;var r=(d.state.insertArgs=t).shortcode||"",a={type:"inline",alignTop:!0,items:{src:"#su-generator"},callbacks:{}};a.callbacks.open=function(){r?c.filter('[data-shortcode="'.concat(r,'"]')).trigger("click"):window.setTimeout(function(){return o.focus()},200),d.el.body.addClass("su-mfp-shown"),"undefined"!=typeof tinyMCE&&null!=tinyMCE.activeEditor&&tinyMCE.activeEditor.hasOwnProperty("selection")&&(d.state.mceSelection=tinyMCE.activeEditor.selection.getContent({format:"text"}))},a.callbacks.close=function(){o.val(""),l.html("").hide(),s.removeClass("su-generator-narrow"),i.show(),u.show(),c.show(),d.state.mceSelection="",d.el.body.removeClass("su-mfp-shown")},f.magnificPopup.open(a)}},d.insertShortcode=function(){var e=d.parseSettings();if(d.addPreset("last_used",SUGL10n.last_used),f.magnificPopup.close(),n.text(e),"classic"===d.state.context)d.state.wpActiveEditor=window.wpActiveEditor,window.wpActiveEditor=d.state.insertArgs.editorID,window.wp.media.editor.insert(e),window.wpActiveEditor=d.state.wpActiveEditor;else if("block"===d.state.context){var t=d.state.insertArgs.props;if(t.attributes.hasOwnProperty("content"))t.setAttributes({content:t.attributes.content+e});else if("core/shortcode"===t.name){var r=t.attributes.hasOwnProperty("text")?t.attributes.text:"";t.setAttributes({text:r+e})}}},d.insertAtCaret=function(e,t){var r=e.selectionStart,a=e.selectionEnd;e.value=e.value.substring(0,r)+t+e.value.substring(r),e.focus(),e.selectionStart=r+t.length},{init:d.init,insert:d.insert}}(jQuery),jQuery(document).ready(SUG.App.init);
|
2 |
+
//# sourceMappingURL=index.js.map
|
3 |
+
//# sourceMappingURL=index.js.map
|
includes/js/generator/index.js.map
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
{"version":3,"sources":["src/index.js"],"names":["SUG","App","$","$generator","$search","$filter","$filters","children","$choices","$choice","find","$settings","$prefix","$result","$selected","self","state","mceSelection","target","wpActiveEditor","context","insertArgs","preview","timer","request","el","body","init","gp_hover_timer","click","e","filter","this","data","css","opacity","removeClass","regex","RegExp","each","group","match","preventDefault","on","val","html","hide","show","focus","magnificPopup","close","blur","keyup","$first","best","keyCode","length","trigger","id","shortcode","name","desc","matches","join","addClass","ajax","type","url","ajaxurl","action","beforeSend","success","$content","attr","index","$picker","$val","min","max","step","simpleSlider","snap","range","farbtastic","$sources","$source","$add_media","$images","$cats","$taxes","$terms","frame","update","ids","source","images","i","categories","tax","terms","indexOf","parent","fadeOut","remove","wp","media","frames","su_media_frame_1","title","SUGL10n","isp_media_title","library","button","text","isp_media_insert","multiple","files","get","toJSON","append","open","sortable","revert","containment","tolerance","stop","$cont","parents","ajax_term_select","dataType","class","size","_typeof","abort","$button","file","stopPropagation","su_media_frame_2","upload_title","upload_insert","attachment","first","$field","toggleClass","hasClass","$icons","$switch","$value","is_on","value","$taxonomy","window","su_generator_get_terms","noselect","$fields","$hoff","$voff","$blur","$color","cnt","wheel","split","replace","$width","$style","$cnt","_default","setSettings","insertShortcode","$preview","updatePreview","clearTimeout","setTimeout","$container","$list","Date","getTime","prompt","presets_prompt_msg","presets_prompt_value","addPreset","$insert","$preset","removePreset","settings","getSettings","parseSettings","query","prefix","content","result","String","$this","is","toString","hasOwnProperty","forced","previous","cache","insert","args","preSelectedShortcode","mfpOptions","alignTop","items","src","callbacks","concat","tinyMCE","activeEditor","selection","getContent","format","last_used","editorID","editor","props","attributes","setAttributes","originalText","insertAtCaret","field","start","selectionStart","end","selectionEnd","substring","jQuery","document","ready"],"mappings":"kQAAA,IAAIA,IAAM,GAEVA,IAAIC,IAAQ,SAAEC,GAEb,IAAIC,EAAaD,EAAG,iBAChBE,EAAaF,EAAG,wBAChBG,EAAaH,EAAG,wBAChBI,EAAaD,EAAQE,SAAU,KAC/BC,EAAaN,EAAG,yBAChBO,EAAaD,EAASE,KAAM,QAC5BC,EAAaT,EAAG,0BAChBU,EAAaV,EAAG,iCAChBW,EAAaX,EAAG,wBAChBY,EAAaZ,EAAG,0BAEhBa,EAAO,CAEXC,MAAa,CACZC,aAAiB,GACjBC,OAAiB,GACjBC,eAAiB,KACjBC,QAAiB,GACjBC,WAAiB,GACjBC,QAAiB,CAChBC,MAAS,KACTC,QAAS,QAgsCX,OA5rCAT,EAAKU,GAAK,CACTC,KAAMxB,EAAG,SAGVa,EAAKY,KAAO,WAgxBX,IAAIC,EA9wBJtB,EAASuB,MACR,SAASC,GAER,IAAIC,EAAS7B,EAAG8B,MAAOC,KAAM,UAE7B,GAAe,QAAXF,EACHtB,EAAQyB,IACP,CACCC,QAAS,IAETC,YAAa,iCAGX,CACJ,IAAIC,EAAQ,IAAIC,OAAQP,EAAQ,MAEhCtB,EAAQyB,IAAK,CAAEC,QAAS,KAExB1B,EAAQ8B,KACP,WAEC,IAAIC,EAEyB,OAF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aAElBJ,EAAMxE,MAAQwE,EAAMxE,MAAM6E,UAAW,EAAGJ,GAAU7G,EAAO4G,EAAMxE,MAAM6E,UAAWJ,GAEhFD,EAAM7K,QAEN6K,EAAME,eAAiBD,EAAQ7G,EAAKzD,QAI9B,CACN7B,KAASZ,EAAKY,KACd4K,OAASxL,EAAKwL,QAztCJ,CA4tCP4B,QAELA,OAAQC,UAAWC,MAAOrO,IAAIC,IAAI0B"}
|
includes/shortcodes/service.php
CHANGED
@@ -1,79 +1,91 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
su_add_shortcode(
|
4 |
-
|
|
|
5 |
'callback' => 'su_shortcode_service',
|
6 |
-
'image'
|
7 |
-
'name'
|
8 |
-
'type'
|
9 |
-
'group'
|
10 |
-
'atts'
|
11 |
-
'title'
|
12 |
-
'values'
|
13 |
'default' => __( 'Service title', 'shortcodes-ultimate' ),
|
14 |
-
'name'
|
15 |
-
'desc'
|
16 |
),
|
17 |
-
'icon'
|
18 |
-
'type'
|
19 |
'default' => 'icon: star',
|
20 |
-
'name'
|
21 |
-
'desc'
|
22 |
),
|
23 |
'icon_color' => array(
|
24 |
-
'type'
|
25 |
'default' => '#333333',
|
26 |
-
'name'
|
27 |
-
'desc'
|
28 |
),
|
29 |
-
'size'
|
30 |
-
'type'
|
31 |
-
'min'
|
32 |
-
'max'
|
33 |
-
'step'
|
34 |
'default' => 32,
|
35 |
-
'name'
|
36 |
-
'desc'
|
37 |
),
|
38 |
-
'class'
|
39 |
-
'type'
|
40 |
-
'name'
|
41 |
-
'desc'
|
42 |
'default' => '',
|
43 |
),
|
44 |
),
|
45 |
-
'content'
|
46 |
-
'desc'
|
47 |
-
'icon'
|
48 |
-
)
|
|
|
49 |
|
50 |
function su_shortcode_service( $atts = null, $content = null ) {
|
51 |
|
52 |
-
$atts = shortcode_atts(
|
53 |
-
|
54 |
-
'
|
55 |
-
'
|
56 |
-
'
|
57 |
-
'
|
58 |
-
|
|
|
|
|
|
|
|
|
59 |
|
60 |
// RTL
|
61 |
$rtl = is_rtl()
|
62 |
? 'right'
|
63 |
: 'left';
|
64 |
|
65 |
-
// Built-in icon
|
66 |
if ( strpos( $atts['icon'], 'icon:' ) !== false ) {
|
67 |
|
68 |
-
$atts['icon'] =
|
|
|
|
|
|
|
|
|
|
|
69 |
|
70 |
su_query_asset( 'css', 'font-awesome' );
|
71 |
|
72 |
-
}
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
|
|
|
|
77 |
}
|
78 |
|
79 |
su_query_asset( 'css', 'su-shortcodes' );
|
1 |
<?php
|
2 |
|
3 |
+
su_add_shortcode(
|
4 |
+
array(
|
5 |
+
'id' => 'service',
|
6 |
'callback' => 'su_shortcode_service',
|
7 |
+
'image' => su_get_plugin_url() . 'admin/images/shortcodes/service.svg',
|
8 |
+
'name' => __( 'Service', 'shortcodes-ultimate' ),
|
9 |
+
'type' => 'wrap',
|
10 |
+
'group' => 'box',
|
11 |
+
'atts' => array(
|
12 |
+
'title' => array(
|
13 |
+
'values' => array(),
|
14 |
'default' => __( 'Service title', 'shortcodes-ultimate' ),
|
15 |
+
'name' => __( 'Title', 'shortcodes-ultimate' ),
|
16 |
+
'desc' => __( 'Service name', 'shortcodes-ultimate' ),
|
17 |
),
|
18 |
+
'icon' => array(
|
19 |
+
'type' => 'icon',
|
20 |
'default' => 'icon: star',
|
21 |
+
'name' => __( 'Icon', 'shortcodes-ultimate' ),
|
22 |
+
'desc' => __( 'You can upload custom icon for this box', 'shortcodes-ultimate' ),
|
23 |
),
|
24 |
'icon_color' => array(
|
25 |
+
'type' => 'color',
|
26 |
'default' => '#333333',
|
27 |
+
'name' => __( 'Icon color', 'shortcodes-ultimate' ),
|
28 |
+
'desc' => __( 'This color will be applied to the selected icon. Does not works with uploaded icons', 'shortcodes-ultimate' ),
|
29 |
),
|
30 |
+
'size' => array(
|
31 |
+
'type' => 'slider',
|
32 |
+
'min' => 10,
|
33 |
+
'max' => 128,
|
34 |
+
'step' => 2,
|
35 |
'default' => 32,
|
36 |
+
'name' => __( 'Icon size', 'shortcodes-ultimate' ),
|
37 |
+
'desc' => __( 'Size of the uploaded icon in pixels', 'shortcodes-ultimate' ),
|
38 |
),
|
39 |
+
'class' => array(
|
40 |
+
'type' => 'extra_css_class',
|
41 |
+
'name' => __( 'Extra CSS class', 'shortcodes-ultimate' ),
|
42 |
+
'desc' => __( 'Additional CSS class name(s) separated by space(s)', 'shortcodes-ultimate' ),
|
43 |
'default' => '',
|
44 |
),
|
45 |
),
|
46 |
+
'content' => __( 'Service description', 'shortcodes-ultimate' ),
|
47 |
+
'desc' => __( 'Service box with title', 'shortcodes-ultimate' ),
|
48 |
+
'icon' => 'check-square-o',
|
49 |
+
)
|
50 |
+
);
|
51 |
|
52 |
function su_shortcode_service( $atts = null, $content = null ) {
|
53 |
|
54 |
+
$atts = shortcode_atts(
|
55 |
+
array(
|
56 |
+
'title' => __( 'Service title', 'shortcodes-ultimate' ),
|
57 |
+
'icon' => 'icon: star',
|
58 |
+
'icon_color' => '#333',
|
59 |
+
'size' => 32,
|
60 |
+
'class' => '',
|
61 |
+
),
|
62 |
+
$atts,
|
63 |
+
'service'
|
64 |
+
);
|
65 |
|
66 |
// RTL
|
67 |
$rtl = is_rtl()
|
68 |
? 'right'
|
69 |
: 'left';
|
70 |
|
|
|
71 |
if ( strpos( $atts['icon'], 'icon:' ) !== false ) {
|
72 |
|
73 |
+
$atts['icon'] = sprintf(
|
74 |
+
'<i class="fa fa-%s" style="font-size:%spx;color:%s"></i>',
|
75 |
+
esc_attr( trim( str_replace( 'icon:', '', $atts['icon'] ) ) ),
|
76 |
+
intval( $atts['size'] ),
|
77 |
+
esc_attr( $atts['icon_color'] )
|
78 |
+
);
|
79 |
|
80 |
su_query_asset( 'css', 'font-awesome' );
|
81 |
|
82 |
+
} else {
|
83 |
+
$atts['icon'] = sprintf(
|
84 |
+
'<img src="%1$s" width="%2$s" height="%2$s" alt="%3$s" style="width:%2$spx;height:%2$spx" />',
|
85 |
+
esc_attr( $atts['icon'] ),
|
86 |
+
intval( $atts['size'] ),
|
87 |
+
esc_attr( $atts['title'] )
|
88 |
+
);
|
89 |
}
|
90 |
|
91 |
su_query_asset( 'css', 'su-shortcodes' );
|
includes/shortcodes/slider.php
CHANGED
@@ -145,7 +145,7 @@ function su_shortcode_slider( $atts = null, $content = null ) {
|
|
145 |
), $atts, 'slider' );
|
146 |
|
147 |
$slides = su_get_slides( $atts );
|
148 |
-
$slides = apply_filters( 'su/shortcode/
|
149 |
|
150 |
// Loop slides
|
151 |
if ( count( $slides ) ) {
|
145 |
), $atts, 'slider' );
|
146 |
|
147 |
$slides = su_get_slides( $atts );
|
148 |
+
$slides = apply_filters( 'su/shortcode/slider/slides', $slides, $atts );
|
149 |
|
150 |
// Loop slides
|
151 |
if ( count( $slides ) ) {
|
readme.txt
CHANGED
@@ -20,6 +20,7 @@ A comprehensive collection of visual components for your site
|
|
20 |
|
21 |
* 50+ beautiful shortcodes
|
22 |
* 1-click shortcode insertion with live preview
|
|
|
23 |
* Works with any theme
|
24 |
* Modern responsive design
|
25 |
* Documentation
|
@@ -149,7 +150,11 @@ For help with premium add-ons, please [open new support ticket](https://getshort
|
|
149 |
|
150 |
== Changelog ==
|
151 |
|
152 |
-
=
|
|
|
|
|
|
|
|
|
153 |
|
154 |
**Fixes**
|
155 |
|
20 |
|
21 |
* 50+ beautiful shortcodes
|
22 |
* 1-click shortcode insertion with live preview
|
23 |
+
* Gutenberg-ready
|
24 |
* Works with any theme
|
25 |
* Modern responsive design
|
26 |
* Documentation
|
150 |
|
151 |
== Changelog ==
|
152 |
|
153 |
+
= 5.1.0 =
|
154 |
+
|
155 |
+
**What's new**
|
156 |
+
|
157 |
+
- Added compatibility with the Gutenberg editor. [Learn more](https://vanokhin.com/su-now-supports-gutenberg/).
|
158 |
|
159 |
**Fixes**
|
160 |
|
shortcodes-ultimate.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/**
|
3 |
* Plugin Name: Shortcodes Ultimate
|
4 |
* Plugin URI: https://getshortcodes.com/
|
5 |
-
* Version: 5.0
|
6 |
* Author: Vladimir Anokhin
|
7 |
* Author URI: https://vanokhin.com/
|
8 |
* Description: A comprehensive collection of visual components for WordPress
|
@@ -15,7 +15,7 @@
|
|
15 |
* Define plugin constants.
|
16 |
*/
|
17 |
define( 'SU_PLUGIN_FILE', __FILE__ );
|
18 |
-
define( 'SU_PLUGIN_VERSION', '5.0
|
19 |
|
20 |
/**
|
21 |
* Load dependencies.
|
2 |
/**
|
3 |
* Plugin Name: Shortcodes Ultimate
|
4 |
* Plugin URI: https://getshortcodes.com/
|
5 |
+
* Version: 5.1.0
|
6 |
* Author: Vladimir Anokhin
|
7 |
* Author URI: https://vanokhin.com/
|
8 |
* Description: A comprehensive collection of visual components for WordPress
|
15 |
* Define plugin constants.
|
16 |
*/
|
17 |
define( 'SU_PLUGIN_FILE', __FILE__ );
|
18 |
+
define( 'SU_PLUGIN_VERSION', '5.1.0' );
|
19 |
|
20 |
/**
|
21 |
* Load dependencies.
|