Version Description
Release Date - 3 June 2019
- New - Added "Preview Size" and "Return Format" settings to the Gallery field.
- Tweak - Improved metabox styling for Gutenberg.
- Tweak - Changed default "Preview Size" to medium for the Image field.
- Fix - Fixed bug in media modal causing the primary button text to disappear after editing an image.
- Fix - Fixed bug preventing the TinyMCE Advanced plugin from adding
< p >
tags. - Fix - Fixed bug where HTML choices were not visible in conditional logic dropdown.
- Fix - Fixed bug causing incorrect order of imported/synced flexible content sub fields.
- i18n - Updated German translation thanks to Ralf Koller.
- i18n - Updated Persian translation thanks to Majix.
Download this release
Release Info
Developer | elliotcondon |
Plugin | Advanced Custom Fields |
Version | 5.8.1 |
Comparing to | |
See all releases |
Code changes from version 5.8.0 to 5.8.1
- acf.php +2 -4
- assets/build/css/_dark.scss +0 -437
- assets/build/css/_field-group.scss +0 -600
- assets/build/css/_fields.scss +0 -2767
- assets/build/css/_forms.scss +0 -292
- assets/build/css/_global.scss +0 -1807
- assets/build/css/_gutenberg.scss +0 -220
- assets/build/css/_input.scss +0 -61
- assets/build/css/_media.scss +0 -513
- assets/build/css/_mixins.scss +0 -39
- assets/build/css/_variables.scss +0 -24
- assets/build/css/acf-dark.scss +0 -1
- assets/build/css/acf-field-group.scss +0 -3
- assets/build/css/acf-global.scss +0 -3
- assets/build/css/acf-input.scss +0 -6
- assets/build/images/acf-logo.psd +0 -0
- assets/build/js/_acf-compatibility.js +0 -761
- assets/build/js/_acf-condition-types.js +0 -447
- assets/build/js/_acf-condition.js +0 -249
- assets/build/js/_acf-conditions.js +0 -306
- assets/build/js/_acf-field-accordion.js +0 -232
- assets/build/js/_acf-field-button-group.js +0 -45
- assets/build/js/_acf-field-checkbox.js +0 -97
- assets/build/js/_acf-field-color-picker.js +0 -64
- assets/build/js/_acf-field-date-picker.js +0 -157
- assets/build/js/_acf-field-date-time-picker.js +0 -99
- assets/build/js/_acf-field-file.js +0 -120
- assets/build/js/_acf-field-google-map.js +0 -553
- assets/build/js/_acf-field-image.js +0 -198
- assets/build/js/_acf-field-link.js +0 -191
- assets/build/js/_acf-field-oembed.js +0 -163
- assets/build/js/_acf-field-page-link.js +0 -9
- assets/build/js/_acf-field-post-object.js +0 -9
- assets/build/js/_acf-field-radio.js +0 -68
- assets/build/js/_acf-field-range.js +0 -42
- assets/build/js/_acf-field-relationship.js +0 -380
- assets/build/js/_acf-field-select.js +0 -57
- assets/build/js/_acf-field-tab.js +0 -505
- assets/build/js/_acf-field-taxonomy.js +0 -321
- assets/build/js/_acf-field-time-picker.js +0 -77
- assets/build/js/_acf-field-true-false.js +0 -95
- assets/build/js/_acf-field-url.js +0 -64
- assets/build/js/_acf-field-user.js +0 -9
- assets/build/js/_acf-field-wysiwyg.js +0 -102
- assets/build/js/_acf-field.js +0 -524
- assets/build/js/_acf-fields.js +0 -372
- assets/build/js/_acf-helpers.js +0 -361
- assets/build/js/_acf-hooks.js +0 -252
- assets/build/js/_acf-media.js +0 -812
- assets/build/js/_acf-model.js +0 -908
- assets/build/js/_acf-notice.js +0 -146
- assets/build/js/_acf-panel.js +0 -34
- assets/build/js/_acf-popup.js +0 -121
- assets/build/js/_acf-postbox.js +0 -191
- assets/build/js/_acf-screen.js +0 -593
- assets/build/js/_acf-select2.js +0 -793
- assets/build/js/_acf-tinymce.js +0 -395
- assets/build/js/_acf-tooltip.js +0 -324
- assets/build/js/_acf-unload.js +0 -62
- assets/build/js/_acf-validation.js +0 -1006
- assets/build/js/_acf.js +0 -2202
- assets/build/js/_field-group-compatibility.js +0 -281
- assets/build/js/_field-group-conditions.js +0 -403
- assets/build/js/_field-group-field.js +0 -808
- assets/build/js/_field-group-fields.js +0 -468
- assets/build/js/_field-group-locations.js +0 -104
- assets/build/js/_field-group-settings.js +0 -248
- assets/build/js/_field-group.js +0 -182
- assets/build/js/acf-field-group.js +0 -7
- assets/build/js/acf-field-group.min.js +0 -7
- assets/build/js/acf-input.js +0 -45
- assets/build/js/acf-input.min.js +0 -45
- assets/css/acf-input.css +1 -1
- assets/js/acf-input.js +61 -31
- assets/js/acf-input.min.js +4 -4
- includes/acf-field-group-functions.php +1 -1
- includes/acf-user-functions.php +55 -0
- includes/ajax/class-acf-ajax-check-screen.php +15 -16
- includes/ajax/class-acf-ajax-query-terms.php +0 -141
- includes/ajax/class-acf-ajax-query.php +0 -133
- includes/ajax/class-acf-ajax-upgrade.php +19 -24
- includes/ajax/class-acf-ajax-user-setting.php +13 -16
- includes/ajax/class-acf-ajax.php +106 -117
- includes/api/api-helpers.php +52 -70
- includes/assets.php +2 -1
- includes/fields/class-acf-field-image.php +4 -4
- includes/forms/form-post.php +27 -26
- lang/acf-de_DE.mo +0 -0
- lang/acf-de_DE.po +38 -27
- lang/acf-de_DE_formal.mo +0 -0
- lang/acf-de_DE_formal.po +36 -26
- lang/acf-fa_IR.mo +0 -0
- lang/acf-fa_IR.po +104 -78
- lang/acf-sv_SE.mo +0 -0
- lang/acf-sv_SE.po +2 -2
- readme.txt +14 -364
acf.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Advanced Custom Fields
|
4 |
Plugin URI: https://www.advancedcustomfields.com/
|
5 |
Description: Customize WordPress with powerful, professional and intuitive fields.
|
6 |
-
Version: 5.8.
|
7 |
Author: Elliot Condon
|
8 |
Author URI: http://www.elliotcondon.com/
|
9 |
Copyright: Elliot Condon
|
@@ -18,7 +18,7 @@ if( ! class_exists('ACF') ) :
|
|
18 |
class ACF {
|
19 |
|
20 |
/** @var string The plugin version number */
|
21 |
-
var $version = '5.8.
|
22 |
|
23 |
/** @var array The plugin settings array */
|
24 |
var $settings = array();
|
@@ -174,8 +174,6 @@ class ACF {
|
|
174 |
acf_include('includes/ajax/class-acf-ajax-check-screen.php');
|
175 |
acf_include('includes/ajax/class-acf-ajax-user-setting.php');
|
176 |
acf_include('includes/ajax/class-acf-ajax-upgrade.php');
|
177 |
-
acf_include('includes/ajax/class-acf-ajax-query.php');
|
178 |
-
acf_include('includes/ajax/class-acf-ajax-query-terms.php');
|
179 |
|
180 |
// forms
|
181 |
acf_include('includes/forms/form-attachment.php');
|
3 |
Plugin Name: Advanced Custom Fields
|
4 |
Plugin URI: https://www.advancedcustomfields.com/
|
5 |
Description: Customize WordPress with powerful, professional and intuitive fields.
|
6 |
+
Version: 5.8.1
|
7 |
Author: Elliot Condon
|
8 |
Author URI: http://www.elliotcondon.com/
|
9 |
Copyright: Elliot Condon
|
18 |
class ACF {
|
19 |
|
20 |
/** @var string The plugin version number */
|
21 |
+
var $version = '5.8.1';
|
22 |
|
23 |
/** @var array The plugin settings array */
|
24 |
var $settings = array();
|
174 |
acf_include('includes/ajax/class-acf-ajax-check-screen.php');
|
175 |
acf_include('includes/ajax/class-acf-ajax-user-setting.php');
|
176 |
acf_include('includes/ajax/class-acf-ajax-upgrade.php');
|
|
|
|
|
177 |
|
178 |
// forms
|
179 |
acf_include('includes/forms/form-attachment.php');
|
assets/build/css/_dark.scss
DELETED
@@ -1,437 +0,0 @@
|
|
1 |
-
/*--------------------------------------------------------------------------------------------
|
2 |
-
*
|
3 |
-
* Dark mode
|
4 |
-
*
|
5 |
-
* WordPress plugin: https://en-au.wordpress.org/plugins/dark-mode/
|
6 |
-
* Github Documentation: https://github.com/danieltj27/Dark-Mode/wiki/Help:-Plugin-Compatibility-Guide
|
7 |
-
*
|
8 |
-
*--------------------------------------------------------------------------------------------*/
|
9 |
-
|
10 |
-
// Dark Mode Colours.
|
11 |
-
$white: #ffffff;
|
12 |
-
$black: #000000;
|
13 |
-
$blue: #0073aa;
|
14 |
-
$medium-blue: #00a0d2;
|
15 |
-
$clear: transparent;
|
16 |
-
|
17 |
-
$accent-red: #dc3232;
|
18 |
-
$accent-orange: #f56e28;
|
19 |
-
$accent-yellow: #ffb900;
|
20 |
-
$accent-green: #46b450;
|
21 |
-
$accent-blue: $blue;
|
22 |
-
$accent-purple: #826eb4;
|
23 |
-
|
24 |
-
$base-grey: #23282d;
|
25 |
-
$light-grey: #bbc8d4;
|
26 |
-
$heavy-grey: #37444c;
|
27 |
-
$dark-grey: #32373c;
|
28 |
-
$ultra-grey: #191f25;
|
29 |
-
$dark-silver: #50626f;
|
30 |
-
$base-blue: #2e74aa;
|
31 |
-
$light-blue: #4092d2;
|
32 |
-
$dark-blue: #2c5f88;
|
33 |
-
$ultra-blue: #1f3f58;
|
34 |
-
$bright-blue: #30ceff;
|
35 |
-
|
36 |
-
$editor-lavender: #c678dd;
|
37 |
-
$editor-sunglo: #e06c75;
|
38 |
-
$editor-olivine: #98c379;
|
39 |
-
|
40 |
-
// Custom variables.
|
41 |
-
$body_text: #bbc8d4;
|
42 |
-
$body_background: #23282d;
|
43 |
-
$body_background2: #191f25;
|
44 |
-
$postbox_background: #32373c;
|
45 |
-
$postbox_border: #191f25;
|
46 |
-
$postbox_divider: #23282d;
|
47 |
-
$input_background: #50626f;
|
48 |
-
$input_text: #fff;
|
49 |
-
$input_border: #191f25;
|
50 |
-
|
51 |
-
// Mixins.
|
52 |
-
@mixin dark-text() {
|
53 |
-
color: $body_text;
|
54 |
-
}
|
55 |
-
@mixin dark-heading() {
|
56 |
-
color: $body_text;
|
57 |
-
}
|
58 |
-
@mixin dark-border() {
|
59 |
-
border-color: $postbox_border;
|
60 |
-
}
|
61 |
-
@mixin dark-background() {
|
62 |
-
background: $body_background;
|
63 |
-
}
|
64 |
-
@mixin darker-background() {
|
65 |
-
background: darken($body_background, 5%);
|
66 |
-
}
|
67 |
-
@mixin dark-postbox() {
|
68 |
-
background-color: $postbox_background;
|
69 |
-
border-color: $postbox_border;
|
70 |
-
color: $body_text;
|
71 |
-
}
|
72 |
-
@mixin dark-postbox-block() {
|
73 |
-
background-color: #2d3136;
|
74 |
-
border-color: $postbox_divider;
|
75 |
-
}
|
76 |
-
@mixin dark-divider() {
|
77 |
-
border-color: $postbox_divider;
|
78 |
-
}
|
79 |
-
@mixin dark-input() {
|
80 |
-
background-color: $input_background;
|
81 |
-
border-color: $input_border;
|
82 |
-
color: $input_text;
|
83 |
-
}
|
84 |
-
|
85 |
-
|
86 |
-
/*---------------------------------------------------------------------------------------------
|
87 |
-
*
|
88 |
-
* Global
|
89 |
-
*
|
90 |
-
*---------------------------------------------------------------------------------------------*/
|
91 |
-
|
92 |
-
// acf-box
|
93 |
-
.acf-box {
|
94 |
-
@include dark-postbox();
|
95 |
-
|
96 |
-
.title,
|
97 |
-
.footer {
|
98 |
-
@include dark-divider();
|
99 |
-
}
|
100 |
-
|
101 |
-
h2 {
|
102 |
-
@include dark-heading();
|
103 |
-
}
|
104 |
-
|
105 |
-
table, tbody, tr {
|
106 |
-
background: transparent !important;
|
107 |
-
}
|
108 |
-
}
|
109 |
-
|
110 |
-
// thead
|
111 |
-
.acf-thead {
|
112 |
-
@include dark-heading();
|
113 |
-
@include dark-border();
|
114 |
-
}
|
115 |
-
.acf-tfoot {
|
116 |
-
@include dark-postbox-block();
|
117 |
-
}
|
118 |
-
|
119 |
-
// table clear
|
120 |
-
.acf-table.-clear,
|
121 |
-
.acf-table.-clear tr {
|
122 |
-
background: transparent !important;
|
123 |
-
}
|
124 |
-
|
125 |
-
// loading overlay
|
126 |
-
.acf-loading-overlay {
|
127 |
-
background: rgba(0,0,0,0.5);
|
128 |
-
}
|
129 |
-
|
130 |
-
|
131 |
-
/*---------------------------------------------------------------------------------------------
|
132 |
-
*
|
133 |
-
* Fields
|
134 |
-
*
|
135 |
-
*---------------------------------------------------------------------------------------------*/
|
136 |
-
|
137 |
-
// fields
|
138 |
-
.acf-fields {
|
139 |
-
|
140 |
-
// field
|
141 |
-
> .acf-field {
|
142 |
-
@include dark-divider();
|
143 |
-
}
|
144 |
-
}
|
145 |
-
|
146 |
-
// fields (left)
|
147 |
-
.acf-fields.-left {
|
148 |
-
|
149 |
-
> .acf-field {
|
150 |
-
&:before {
|
151 |
-
background: rgba(0,0,0,0.1);
|
152 |
-
@include dark-divider();
|
153 |
-
}
|
154 |
-
}
|
155 |
-
}
|
156 |
-
|
157 |
-
// fields (border)
|
158 |
-
.acf-fields.-border {
|
159 |
-
@include dark-postbox();
|
160 |
-
}
|
161 |
-
|
162 |
-
// width
|
163 |
-
.acf-field[data-width] + .acf-field[data-width] {
|
164 |
-
@include dark-divider();
|
165 |
-
}
|
166 |
-
|
167 |
-
// text
|
168 |
-
.acf-input-prepend,
|
169 |
-
.acf-input-append {
|
170 |
-
@include dark-postbox();
|
171 |
-
}
|
172 |
-
|
173 |
-
// tab
|
174 |
-
.acf-tab-wrap {
|
175 |
-
|
176 |
-
}
|
177 |
-
|
178 |
-
.acf-fields > .acf-tab-wrap {
|
179 |
-
@include dark-postbox();
|
180 |
-
|
181 |
-
.acf-tab-group {
|
182 |
-
@include dark-postbox-block();
|
183 |
-
|
184 |
-
li {
|
185 |
-
a {
|
186 |
-
@include dark-postbox-block();
|
187 |
-
|
188 |
-
&:hover {
|
189 |
-
@include dark-postbox-block();
|
190 |
-
@include dark-text();
|
191 |
-
}
|
192 |
-
}
|
193 |
-
|
194 |
-
&.active a {
|
195 |
-
@include dark-postbox();
|
196 |
-
}
|
197 |
-
}
|
198 |
-
}
|
199 |
-
}
|
200 |
-
|
201 |
-
.acf-fields.-sidebar {
|
202 |
-
&:before {
|
203 |
-
@include dark-postbox-block();
|
204 |
-
}
|
205 |
-
}
|
206 |
-
|
207 |
-
.acf-fields.-sidebar.-left {
|
208 |
-
&:before {
|
209 |
-
@include dark-postbox-block();
|
210 |
-
background: $body_background;
|
211 |
-
}
|
212 |
-
> .acf-tab-wrap.-left {
|
213 |
-
.acf-tab-group li a {
|
214 |
-
@include dark-postbox-block();
|
215 |
-
}
|
216 |
-
|
217 |
-
.acf-tab-group li.active a {
|
218 |
-
@include dark-postbox-block();
|
219 |
-
}
|
220 |
-
}
|
221 |
-
}
|
222 |
-
|
223 |
-
// file
|
224 |
-
.acf-file-uploader {
|
225 |
-
|
226 |
-
.show-if-value {
|
227 |
-
@include dark-postbox();
|
228 |
-
|
229 |
-
.file-icon {
|
230 |
-
@include dark-postbox-block();
|
231 |
-
}
|
232 |
-
}
|
233 |
-
}
|
234 |
-
|
235 |
-
// acf-oembed
|
236 |
-
.acf-oembed {
|
237 |
-
@include dark-postbox-block();
|
238 |
-
|
239 |
-
.title {
|
240 |
-
@include dark-input();
|
241 |
-
}
|
242 |
-
}
|
243 |
-
|
244 |
-
// gallery
|
245 |
-
.acf-gallery {
|
246 |
-
@include dark-postbox-block();
|
247 |
-
|
248 |
-
.acf-gallery-main {
|
249 |
-
@include dark-background();
|
250 |
-
}
|
251 |
-
|
252 |
-
.acf-gallery-attachment {
|
253 |
-
.margin {
|
254 |
-
@include dark-postbox-block();
|
255 |
-
}
|
256 |
-
}
|
257 |
-
|
258 |
-
.acf-gallery-side {
|
259 |
-
@include dark-postbox-block();
|
260 |
-
|
261 |
-
.acf-gallery-side-info {
|
262 |
-
@include dark-postbox-block();
|
263 |
-
}
|
264 |
-
}
|
265 |
-
|
266 |
-
.acf-gallery-toolbar {
|
267 |
-
@include dark-postbox-block();
|
268 |
-
}
|
269 |
-
}
|
270 |
-
|
271 |
-
// button group
|
272 |
-
.acf-button-group {
|
273 |
-
|
274 |
-
label:not(.selected) {
|
275 |
-
@include dark-postbox-block();
|
276 |
-
}
|
277 |
-
}
|
278 |
-
|
279 |
-
// switch
|
280 |
-
.acf-switch:not(.-on) {
|
281 |
-
@include dark-postbox-block();
|
282 |
-
.acf-switch-slider {
|
283 |
-
@include dark-input();
|
284 |
-
}
|
285 |
-
}
|
286 |
-
|
287 |
-
// link
|
288 |
-
.acf-link .link-wrap {
|
289 |
-
@include dark-postbox-block();
|
290 |
-
}
|
291 |
-
|
292 |
-
// relationship
|
293 |
-
.acf-relationship {
|
294 |
-
.filters {
|
295 |
-
@include dark-postbox();
|
296 |
-
}
|
297 |
-
.selection {
|
298 |
-
@include dark-postbox-block();
|
299 |
-
.choices,
|
300 |
-
.choices-list,
|
301 |
-
.values {
|
302 |
-
@include dark-postbox-block();
|
303 |
-
}
|
304 |
-
}
|
305 |
-
}
|
306 |
-
|
307 |
-
// checkbox
|
308 |
-
.acf-taxonomy-field .categorychecklist-holder {
|
309 |
-
@include dark-postbox-block();
|
310 |
-
}
|
311 |
-
|
312 |
-
// google map
|
313 |
-
.acf-google-map {
|
314 |
-
@include dark-postbox-block();
|
315 |
-
|
316 |
-
.title {
|
317 |
-
@include dark-input();
|
318 |
-
}
|
319 |
-
}
|
320 |
-
|
321 |
-
// accordion
|
322 |
-
.acf-accordion {
|
323 |
-
@include dark-postbox();
|
324 |
-
}
|
325 |
-
.acf-field.acf-accordion .acf-accordion-content > .acf-fields {
|
326 |
-
@include dark-border();
|
327 |
-
}
|
328 |
-
|
329 |
-
// flexible content
|
330 |
-
.acf-flexible-content {
|
331 |
-
.layout {
|
332 |
-
@include dark-postbox();
|
333 |
-
|
334 |
-
.acf-fc-layout-handle {
|
335 |
-
@include dark-postbox-block();
|
336 |
-
|
337 |
-
.acf-fc-layout-order {
|
338 |
-
@include dark-postbox();
|
339 |
-
}
|
340 |
-
}
|
341 |
-
}
|
342 |
-
}
|
343 |
-
|
344 |
-
// repeater
|
345 |
-
#wpbody .acf-table {
|
346 |
-
@include dark-postbox-block();
|
347 |
-
|
348 |
-
> tbody,
|
349 |
-
> thead {
|
350 |
-
> tr {
|
351 |
-
background: transparent;
|
352 |
-
|
353 |
-
> td,
|
354 |
-
> th {
|
355 |
-
@include dark-border();
|
356 |
-
}
|
357 |
-
}
|
358 |
-
}
|
359 |
-
}
|
360 |
-
|
361 |
-
// Select
|
362 |
-
.acf-field select {
|
363 |
-
optgroup, optgroup:nth-child(2n) {
|
364 |
-
background: $input_background;
|
365 |
-
}
|
366 |
-
}
|
367 |
-
|
368 |
-
/*---------------------------------------------------------------------------------------------
|
369 |
-
*
|
370 |
-
* Field Group
|
371 |
-
*
|
372 |
-
*---------------------------------------------------------------------------------------------*/
|
373 |
-
|
374 |
-
// fields
|
375 |
-
#acf-field-group-fields {
|
376 |
-
|
377 |
-
// field list
|
378 |
-
.acf-field-list-wrap {
|
379 |
-
@include dark-postbox();
|
380 |
-
}
|
381 |
-
|
382 |
-
.acf-field-list {
|
383 |
-
.no-fields-message {
|
384 |
-
@include dark-postbox();
|
385 |
-
}
|
386 |
-
}
|
387 |
-
|
388 |
-
// field
|
389 |
-
.acf-field-object {
|
390 |
-
@include dark-postbox();
|
391 |
-
@include dark-divider();
|
392 |
-
|
393 |
-
|
394 |
-
table, tbody, tr, td, th {
|
395 |
-
background: transparent;
|
396 |
-
@include dark-divider();
|
397 |
-
}
|
398 |
-
|
399 |
-
.acf-field {
|
400 |
-
.acf-label {
|
401 |
-
@include dark-postbox-block();
|
402 |
-
}
|
403 |
-
}
|
404 |
-
|
405 |
-
// sortable
|
406 |
-
&.ui-sortable-helper {
|
407 |
-
@include dark-border();
|
408 |
-
box-shadow: none;
|
409 |
-
}
|
410 |
-
|
411 |
-
&.ui-sortable-placeholder {
|
412 |
-
@include dark-postbox-block();
|
413 |
-
box-shadow: none;
|
414 |
-
}
|
415 |
-
}
|
416 |
-
|
417 |
-
.acf-field-object + .acf-field-object-tab::before,
|
418 |
-
.acf-field-object + .acf-field-object-accordion::before {
|
419 |
-
@include dark-postbox-block();
|
420 |
-
}
|
421 |
-
}
|
422 |
-
|
423 |
-
|
424 |
-
/*---------------------------------------------------------------------------------------------
|
425 |
-
*
|
426 |
-
* Admin: Tools
|
427 |
-
*
|
428 |
-
*---------------------------------------------------------------------------------------------*/
|
429 |
-
|
430 |
-
// tools
|
431 |
-
.acf-meta-box-wrap {
|
432 |
-
|
433 |
-
.acf-fields {
|
434 |
-
@include dark-input();
|
435 |
-
background: transparent;
|
436 |
-
}
|
437 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/build/css/_field-group.scss
DELETED
@@ -1,600 +0,0 @@
|
|
1 |
-
/*---------------------------------------------------------------------------------------------
|
2 |
-
*
|
3 |
-
* Global
|
4 |
-
*
|
5 |
-
*---------------------------------------------------------------------------------------------*/
|
6 |
-
|
7 |
-
#adv-settings .show-field-keys label {
|
8 |
-
padding: 0 5px;
|
9 |
-
}
|
10 |
-
|
11 |
-
|
12 |
-
#acf-field-group-fields > .inside,
|
13 |
-
#acf-field-group-locations > .inside,
|
14 |
-
#acf-field-group-options > .inside {
|
15 |
-
padding: 0;
|
16 |
-
margin: 0;
|
17 |
-
}
|
18 |
-
|
19 |
-
.acf-field {
|
20 |
-
|
21 |
-
p.description {
|
22 |
-
font-style: normal;
|
23 |
-
font-size: 12px;
|
24 |
-
color: #777777;
|
25 |
-
}
|
26 |
-
|
27 |
-
}
|
28 |
-
|
29 |
-
|
30 |
-
/*---------------------------------------------------------------------------------------------
|
31 |
-
*
|
32 |
-
* Postbox: Publish
|
33 |
-
*
|
34 |
-
*---------------------------------------------------------------------------------------------*/
|
35 |
-
|
36 |
-
#minor-publishing-actions,
|
37 |
-
#misc-publishing-actions #visibility {
|
38 |
-
display: none;
|
39 |
-
}
|
40 |
-
|
41 |
-
#minor-publishing {
|
42 |
-
border-bottom: 0 none;
|
43 |
-
}
|
44 |
-
|
45 |
-
#misc-pub-section {
|
46 |
-
border-bottom: 0 none;
|
47 |
-
}
|
48 |
-
|
49 |
-
#misc-publishing-actions .misc-pub-section {
|
50 |
-
border-bottom-color: #F5F5F5;
|
51 |
-
}
|
52 |
-
|
53 |
-
|
54 |
-
/*---------------------------------------------------------------------------------------------
|
55 |
-
*
|
56 |
-
* Postbox: Fields
|
57 |
-
*
|
58 |
-
*---------------------------------------------------------------------------------------------*/
|
59 |
-
|
60 |
-
#acf-field-group-fields {
|
61 |
-
border: 0 none;
|
62 |
-
box-shadow: none;
|
63 |
-
|
64 |
-
|
65 |
-
/* metabox */
|
66 |
-
> .handlediv,
|
67 |
-
> .hndle {
|
68 |
-
display: none;
|
69 |
-
}
|
70 |
-
|
71 |
-
|
72 |
-
/* links */
|
73 |
-
a {
|
74 |
-
text-decoration: none;
|
75 |
-
|
76 |
-
&:active,
|
77 |
-
&:focus {
|
78 |
-
outline: none;
|
79 |
-
box-shadow: none;
|
80 |
-
}
|
81 |
-
}
|
82 |
-
|
83 |
-
|
84 |
-
/* table header */
|
85 |
-
.li-field-order { width: 20%; }
|
86 |
-
.li-field-label { width: 30%; }
|
87 |
-
.li-field-name { width: 25%; }
|
88 |
-
.li-field-type { width: 25%; }
|
89 |
-
.li-field-key { display: none; }
|
90 |
-
|
91 |
-
|
92 |
-
/* show keys */
|
93 |
-
&.show-field-keys {
|
94 |
-
|
95 |
-
.li-field-label,
|
96 |
-
.li-field-name,
|
97 |
-
.li-field-type,
|
98 |
-
.li-field-key { width: 20%; }
|
99 |
-
.li-field-key { display: block; }
|
100 |
-
}
|
101 |
-
|
102 |
-
|
103 |
-
/* fields */
|
104 |
-
.acf-field-list-wrap {
|
105 |
-
border: #DFDFDF solid 1px;
|
106 |
-
}
|
107 |
-
|
108 |
-
.acf-field-list {
|
109 |
-
background: #F9F9F9;
|
110 |
-
margin-top: -1px;
|
111 |
-
|
112 |
-
/* no fields */
|
113 |
-
.no-fields-message {
|
114 |
-
padding: 15px 15px;
|
115 |
-
background: #fff;
|
116 |
-
display: none;
|
117 |
-
}
|
118 |
-
|
119 |
-
/* empty */
|
120 |
-
&.-empty {
|
121 |
-
.no-fields-message {
|
122 |
-
display: block;
|
123 |
-
}
|
124 |
-
}
|
125 |
-
}
|
126 |
-
|
127 |
-
}
|
128 |
-
|
129 |
-
|
130 |
-
/* field object */
|
131 |
-
.acf-field-object {
|
132 |
-
border-top: #F0F0F0 solid 1px;
|
133 |
-
background: #fff;
|
134 |
-
|
135 |
-
/* sortable */
|
136 |
-
&.ui-sortable-helper {
|
137 |
-
border-top-color: #fff;
|
138 |
-
box-shadow: 0 0 0 1px #DFDFDF, 0 1px 4px rgba(0,0,0,0.1);
|
139 |
-
}
|
140 |
-
|
141 |
-
&.ui-sortable-placeholder {
|
142 |
-
box-shadow: 0 -1px 0 0 #DFDFDF;
|
143 |
-
visibility: visible !important;
|
144 |
-
background: #F9F9F9;
|
145 |
-
border-top-color: transparent;
|
146 |
-
min-height: 54px;
|
147 |
-
|
148 |
-
// hide tab field separator
|
149 |
-
&:after, &:before {
|
150 |
-
visibility: hidden;
|
151 |
-
}
|
152 |
-
}
|
153 |
-
|
154 |
-
|
155 |
-
/* meta */
|
156 |
-
> .meta {
|
157 |
-
display: none;
|
158 |
-
}
|
159 |
-
|
160 |
-
|
161 |
-
/* handle */
|
162 |
-
> .handle {
|
163 |
-
|
164 |
-
a {
|
165 |
-
-webkit-transition: none;
|
166 |
-
-moz-transition: none;
|
167 |
-
-o-transition: none;
|
168 |
-
transition: none;
|
169 |
-
}
|
170 |
-
|
171 |
-
li {
|
172 |
-
padding-top: 10px;
|
173 |
-
padding-bottom: 10px;
|
174 |
-
word-wrap: break-word;
|
175 |
-
}
|
176 |
-
|
177 |
-
.acf-icon {
|
178 |
-
margin: 1px 0 0;
|
179 |
-
cursor: move;
|
180 |
-
background: transparent;
|
181 |
-
float: left;
|
182 |
-
|
183 |
-
height: 28px;
|
184 |
-
line-height: 28px;
|
185 |
-
width: 28px;
|
186 |
-
font-size: 13px;
|
187 |
-
color: #444;
|
188 |
-
position: relative;
|
189 |
-
z-index: 1;
|
190 |
-
}
|
191 |
-
|
192 |
-
strong {
|
193 |
-
display: block;
|
194 |
-
padding-bottom: 6px;
|
195 |
-
font-size: 14px;
|
196 |
-
line-height: 14px;
|
197 |
-
min-height: 14px;
|
198 |
-
}
|
199 |
-
|
200 |
-
.row-options {
|
201 |
-
visibility: hidden;
|
202 |
-
|
203 |
-
a {
|
204 |
-
margin-right: 4px;
|
205 |
-
}
|
206 |
-
|
207 |
-
a.delete-field {
|
208 |
-
color: #a00;
|
209 |
-
|
210 |
-
&:hover { color: #f00; }
|
211 |
-
}
|
212 |
-
}
|
213 |
-
|
214 |
-
}
|
215 |
-
|
216 |
-
/* open */
|
217 |
-
&.open {
|
218 |
-
|
219 |
-
+ .acf-field-object {
|
220 |
-
border-top-color: #E1E1E1;
|
221 |
-
}
|
222 |
-
|
223 |
-
> .handle {
|
224 |
-
background: $acf_blue;
|
225 |
-
border: darken($acf_blue, 2%) solid 1px;
|
226 |
-
text-shadow: #268FBB 0 1px 0;
|
227 |
-
color: #fff;
|
228 |
-
position: relative;
|
229 |
-
margin: -1px -1px 0 -1px;
|
230 |
-
|
231 |
-
a {
|
232 |
-
color: #fff !important;
|
233 |
-
|
234 |
-
&:hover {
|
235 |
-
text-decoration: underline !important;
|
236 |
-
}
|
237 |
-
}
|
238 |
-
|
239 |
-
.acf-icon {
|
240 |
-
border-color: #fff;
|
241 |
-
color: #fff;
|
242 |
-
}
|
243 |
-
|
244 |
-
.acf-required {
|
245 |
-
color: #fff;
|
246 |
-
}
|
247 |
-
}
|
248 |
-
}
|
249 |
-
|
250 |
-
|
251 |
-
/*
|
252 |
-
// debug
|
253 |
-
&[data-save="meta"] {
|
254 |
-
> .handle {
|
255 |
-
border-left: #ffb700 solid 5px !important;
|
256 |
-
}
|
257 |
-
}
|
258 |
-
|
259 |
-
&[data-save="settings"] {
|
260 |
-
> .handle {
|
261 |
-
border-left: #0ec563 solid 5px !important;
|
262 |
-
}
|
263 |
-
}
|
264 |
-
*/
|
265 |
-
|
266 |
-
|
267 |
-
/* hover */
|
268 |
-
&:hover, &.-hover {
|
269 |
-
|
270 |
-
> .handle {
|
271 |
-
|
272 |
-
.row-options {
|
273 |
-
visibility: visible;
|
274 |
-
}
|
275 |
-
|
276 |
-
}
|
277 |
-
}
|
278 |
-
|
279 |
-
|
280 |
-
/* settings */
|
281 |
-
> .settings {
|
282 |
-
display: none;
|
283 |
-
width: 100%;
|
284 |
-
|
285 |
-
> .acf-table {
|
286 |
-
border: none;
|
287 |
-
}
|
288 |
-
}
|
289 |
-
|
290 |
-
|
291 |
-
/* conditional logic */
|
292 |
-
.rule-groups {
|
293 |
-
margin-top: 20px;
|
294 |
-
}
|
295 |
-
|
296 |
-
}
|
297 |
-
|
298 |
-
|
299 |
-
/*---------------------------------------------------------------------------------------------
|
300 |
-
*
|
301 |
-
* Postbox: Locations
|
302 |
-
*
|
303 |
-
*---------------------------------------------------------------------------------------------*/
|
304 |
-
|
305 |
-
.rule-groups {
|
306 |
-
|
307 |
-
h4 {
|
308 |
-
margin: 15px 0 5px;
|
309 |
-
}
|
310 |
-
|
311 |
-
.rule-group {
|
312 |
-
margin: 0 0 5px;
|
313 |
-
|
314 |
-
h4 {
|
315 |
-
margin: 0 0 3px;
|
316 |
-
}
|
317 |
-
|
318 |
-
td.param {
|
319 |
-
width: 35%;
|
320 |
-
}
|
321 |
-
|
322 |
-
td.operator {
|
323 |
-
width: 20%;
|
324 |
-
}
|
325 |
-
|
326 |
-
td.add {
|
327 |
-
width: 40px;
|
328 |
-
}
|
329 |
-
|
330 |
-
td.remove {
|
331 |
-
width: 28px;
|
332 |
-
vertical-align: middle;
|
333 |
-
|
334 |
-
a {
|
335 |
-
visibility: hidden;
|
336 |
-
}
|
337 |
-
}
|
338 |
-
|
339 |
-
tr:hover td.remove a {
|
340 |
-
visibility: visible;
|
341 |
-
}
|
342 |
-
|
343 |
-
/* Don't allow user to delete the first field group */
|
344 |
-
&:first-child tr:first-child td.remove a {
|
345 |
-
visibility: hidden !important;
|
346 |
-
}
|
347 |
-
|
348 |
-
// empty select
|
349 |
-
select:empty {
|
350 |
-
background: #f8f8f8;
|
351 |
-
}
|
352 |
-
}
|
353 |
-
}
|
354 |
-
|
355 |
-
|
356 |
-
/*---------------------------------------------------------------------------------------------
|
357 |
-
*
|
358 |
-
* Options
|
359 |
-
*
|
360 |
-
*---------------------------------------------------------------------------------------------*/
|
361 |
-
|
362 |
-
#acf-field-group-options tr[data-name="hide_on_screen"] li {
|
363 |
-
float: left;
|
364 |
-
width: 33%;
|
365 |
-
}
|
366 |
-
|
367 |
-
@media (max-width: 1100px) {
|
368 |
-
|
369 |
-
#acf-field-group-options tr[data-name="hide_on_screen"] li {
|
370 |
-
width: 50%;
|
371 |
-
}
|
372 |
-
|
373 |
-
}
|
374 |
-
|
375 |
-
|
376 |
-
/*---------------------------------------------------------------------------------------------
|
377 |
-
*
|
378 |
-
* Conditional Logic
|
379 |
-
*
|
380 |
-
*---------------------------------------------------------------------------------------------*/
|
381 |
-
|
382 |
-
table.conditional-logic-rules {
|
383 |
-
background: transparent;
|
384 |
-
border: 0 none;
|
385 |
-
border-radius: 0;
|
386 |
-
}
|
387 |
-
|
388 |
-
table.conditional-logic-rules tbody td {
|
389 |
-
background: transparent;
|
390 |
-
border: 0 none !important;
|
391 |
-
padding: 5px 2px !important;
|
392 |
-
}
|
393 |
-
|
394 |
-
|
395 |
-
/*---------------------------------------------------------------------------------------------
|
396 |
-
*
|
397 |
-
* Field: Tab
|
398 |
-
*
|
399 |
-
*---------------------------------------------------------------------------------------------*/
|
400 |
-
|
401 |
-
.acf-field-object-tab {
|
402 |
-
|
403 |
-
// hide setting
|
404 |
-
.acf-field-setting-name,
|
405 |
-
.acf-field-setting-instructions,
|
406 |
-
.acf-field-setting-required,
|
407 |
-
.acf-field-setting-warning,
|
408 |
-
.acf-field-setting-wrapper {
|
409 |
-
display: none;
|
410 |
-
}
|
411 |
-
|
412 |
-
// hide name
|
413 |
-
.li-field-name {
|
414 |
-
visibility: hidden;
|
415 |
-
}
|
416 |
-
|
417 |
-
// add spacer
|
418 |
-
.acf-field-object + & {
|
419 |
-
|
420 |
-
&:before {
|
421 |
-
display: block;
|
422 |
-
content: "";
|
423 |
-
height: 5px;
|
424 |
-
width: 100%;
|
425 |
-
background: #f9f9f9;
|
426 |
-
border-bottom: #f0f0f0 solid 1px;
|
427 |
-
}
|
428 |
-
}
|
429 |
-
|
430 |
-
p:first-child {
|
431 |
-
margin: 0.5em 0;
|
432 |
-
}
|
433 |
-
}
|
434 |
-
|
435 |
-
|
436 |
-
/*---------------------------------------------------------------------------------------------
|
437 |
-
*
|
438 |
-
* Field: Accordion
|
439 |
-
*
|
440 |
-
*---------------------------------------------------------------------------------------------*/
|
441 |
-
|
442 |
-
.acf-field-object-accordion {
|
443 |
-
@extend .acf-field-object-tab;
|
444 |
-
|
445 |
-
// show settings
|
446 |
-
.acf-field-setting-instructions {
|
447 |
-
display: table-row;
|
448 |
-
}
|
449 |
-
|
450 |
-
}
|
451 |
-
|
452 |
-
|
453 |
-
/*---------------------------------------------------------------------------------------------
|
454 |
-
*
|
455 |
-
* Field: Message
|
456 |
-
*
|
457 |
-
*---------------------------------------------------------------------------------------------*/
|
458 |
-
|
459 |
-
.acf-field-object-message tr[data-name="name"],
|
460 |
-
.acf-field-object-message tr[data-name="instructions"],
|
461 |
-
.acf-field-object-message tr[data-name="required"] {
|
462 |
-
display: none !important;
|
463 |
-
}
|
464 |
-
|
465 |
-
.acf-field-object-message .li-field-name {
|
466 |
-
visibility: hidden;
|
467 |
-
}
|
468 |
-
|
469 |
-
.acf-field-object-message textarea {
|
470 |
-
height: 175px !important;
|
471 |
-
}
|
472 |
-
|
473 |
-
|
474 |
-
/*---------------------------------------------------------------------------------------------
|
475 |
-
*
|
476 |
-
* Field: Separator
|
477 |
-
*
|
478 |
-
*---------------------------------------------------------------------------------------------*/
|
479 |
-
|
480 |
-
.acf-field-object-separator tr[data-name="name"],
|
481 |
-
.acf-field-object-separator tr[data-name="instructions"],
|
482 |
-
.acf-field-object-separator tr[data-name="required"] {
|
483 |
-
display: none !important;
|
484 |
-
}
|
485 |
-
|
486 |
-
|
487 |
-
/*---------------------------------------------------------------------------------------------
|
488 |
-
*
|
489 |
-
* Field: Date Picker
|
490 |
-
*
|
491 |
-
*---------------------------------------------------------------------------------------------*/
|
492 |
-
|
493 |
-
.acf-field-object-date-picker,
|
494 |
-
.acf-field-object-time-picker,
|
495 |
-
.acf-field-object-date-time-picker {
|
496 |
-
|
497 |
-
.acf-radio-list {
|
498 |
-
|
499 |
-
li {
|
500 |
-
line-height: 25px;
|
501 |
-
}
|
502 |
-
|
503 |
-
span {
|
504 |
-
display: inline-block;
|
505 |
-
min-width: 10em;
|
506 |
-
}
|
507 |
-
|
508 |
-
input[type="text"] {
|
509 |
-
width: 100px;
|
510 |
-
}
|
511 |
-
}
|
512 |
-
|
513 |
-
}
|
514 |
-
|
515 |
-
.acf-field-object-date-time-picker {
|
516 |
-
|
517 |
-
.acf-radio-list {
|
518 |
-
|
519 |
-
span {
|
520 |
-
min-width: 15em;
|
521 |
-
}
|
522 |
-
|
523 |
-
input[type="text"] {
|
524 |
-
width: 200px;
|
525 |
-
}
|
526 |
-
}
|
527 |
-
|
528 |
-
}
|
529 |
-
|
530 |
-
|
531 |
-
/*--------------------------------------------------------------------------------------------
|
532 |
-
*
|
533 |
-
* Slug
|
534 |
-
*
|
535 |
-
*--------------------------------------------------------------------------------------------*/
|
536 |
-
|
537 |
-
#slugdiv {
|
538 |
-
|
539 |
-
.inside {
|
540 |
-
padding: 12px;
|
541 |
-
margin: 0;
|
542 |
-
}
|
543 |
-
|
544 |
-
input[type="text"] {
|
545 |
-
width: 100%;
|
546 |
-
height: 28px;
|
547 |
-
font-size: 14px;
|
548 |
-
}
|
549 |
-
}
|
550 |
-
|
551 |
-
|
552 |
-
/*--------------------------------------------------------------------------------------------
|
553 |
-
*
|
554 |
-
* RTL
|
555 |
-
*
|
556 |
-
*--------------------------------------------------------------------------------------------*/
|
557 |
-
|
558 |
-
html[dir="rtl"] .acf-field-object.open > .handle {
|
559 |
-
margin: -1px -1px 0;
|
560 |
-
}
|
561 |
-
|
562 |
-
html[dir="rtl"] .acf-field-object.open > .handle .acf-icon {
|
563 |
-
float: right;
|
564 |
-
}
|
565 |
-
|
566 |
-
html[dir="rtl"] .acf-field-object.open > .handle .li-field-order {
|
567 |
-
padding-left: 0 !important;
|
568 |
-
padding-right: 15px !important;
|
569 |
-
}
|
570 |
-
|
571 |
-
|
572 |
-
/*---------------------------------------------------------------------------------------------
|
573 |
-
*
|
574 |
-
* Device
|
575 |
-
*
|
576 |
-
*---------------------------------------------------------------------------------------------*/
|
577 |
-
|
578 |
-
@media only screen and (max-width: 850px) {
|
579 |
-
|
580 |
-
tr.acf-field,
|
581 |
-
td.acf-label,
|
582 |
-
td.acf-input {
|
583 |
-
display: block !important;
|
584 |
-
width: auto !important;
|
585 |
-
border: 0 none !important;
|
586 |
-
}
|
587 |
-
|
588 |
-
tr.acf-field {
|
589 |
-
border-top: #ededed solid 1px !important;
|
590 |
-
margin-bottom: 0 !important;
|
591 |
-
}
|
592 |
-
|
593 |
-
td.acf-label {
|
594 |
-
background: transparent !important;
|
595 |
-
padding-bottom: 0 !important;
|
596 |
-
|
597 |
-
}
|
598 |
-
|
599 |
-
}
|
600 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/build/css/_fields.scss
DELETED
@@ -1,2767 +0,0 @@
|
|
1 |
-
/*--------------------------------------------------------------------------------------------
|
2 |
-
*
|
3 |
-
* acf-field
|
4 |
-
*
|
5 |
-
*--------------------------------------------------------------------------------------------*/
|
6 |
-
|
7 |
-
.acf-field,
|
8 |
-
.acf-field .acf-label,
|
9 |
-
.acf-field .acf-input {
|
10 |
-
-webkit-box-sizing: border-box;
|
11 |
-
-moz-box-sizing: border-box;
|
12 |
-
box-sizing: border-box;
|
13 |
-
position: relative;
|
14 |
-
}
|
15 |
-
|
16 |
-
.acf-field {
|
17 |
-
margin: 15px 0;
|
18 |
-
|
19 |
-
// clear is important as it will avoid any layout issues with floating fields
|
20 |
-
// do not delete (you have tried this)
|
21 |
-
clear: both;
|
22 |
-
|
23 |
-
// description
|
24 |
-
p.description {
|
25 |
-
display: block;
|
26 |
-
margin: 0;
|
27 |
-
padding: 0;
|
28 |
-
}
|
29 |
-
|
30 |
-
// label
|
31 |
-
.acf-label {
|
32 |
-
vertical-align: top;
|
33 |
-
margin: 0 0 10px;
|
34 |
-
|
35 |
-
label {
|
36 |
-
display: block;
|
37 |
-
font-weight: bold;
|
38 |
-
margin: 0 0 3px;
|
39 |
-
padding: 0;
|
40 |
-
}
|
41 |
-
|
42 |
-
&:empty {
|
43 |
-
margin-bottom: 0;
|
44 |
-
}
|
45 |
-
}
|
46 |
-
|
47 |
-
// input
|
48 |
-
.acf-input {
|
49 |
-
vertical-align: top;
|
50 |
-
|
51 |
-
> p.description {
|
52 |
-
margin-top: 5px;
|
53 |
-
}
|
54 |
-
}
|
55 |
-
|
56 |
-
// notice
|
57 |
-
.acf-notice {
|
58 |
-
margin: 0 0 15px;
|
59 |
-
background: #edf2ff;
|
60 |
-
color: #2183b9;
|
61 |
-
border: none;
|
62 |
-
|
63 |
-
.acf-notice-dismiss {
|
64 |
-
background: transparent;
|
65 |
-
color: inherit;
|
66 |
-
|
67 |
-
&:hover {
|
68 |
-
background: #fff;
|
69 |
-
}
|
70 |
-
}
|
71 |
-
|
72 |
-
// dismiss
|
73 |
-
&.-dismiss {
|
74 |
-
padding-right: 40px;
|
75 |
-
}
|
76 |
-
|
77 |
-
// error
|
78 |
-
&.-error {
|
79 |
-
background: #ffe6e6;
|
80 |
-
color: #d12626;
|
81 |
-
}
|
82 |
-
|
83 |
-
// success
|
84 |
-
&.-success {
|
85 |
-
background: #eefbe8;
|
86 |
-
color: #32a23b;
|
87 |
-
}
|
88 |
-
|
89 |
-
// warning
|
90 |
-
&.-warning {
|
91 |
-
background: #fff3e6;
|
92 |
-
color: #d16226;
|
93 |
-
}
|
94 |
-
}
|
95 |
-
|
96 |
-
// table
|
97 |
-
@at-root td#{&}, tr#{&} {
|
98 |
-
margin: 0;
|
99 |
-
}
|
100 |
-
}
|
101 |
-
|
102 |
-
// width
|
103 |
-
.acf-field[data-width] {
|
104 |
-
float: left;
|
105 |
-
clear: none;
|
106 |
-
|
107 |
-
// next
|
108 |
-
+ .acf-field[data-width] {
|
109 |
-
border-left: 1px solid #eeeeee;
|
110 |
-
}
|
111 |
-
|
112 |
-
// rtl
|
113 |
-
html[dir="rtl"] & {
|
114 |
-
float: right;
|
115 |
-
|
116 |
-
+ .acf-field[data-width] {
|
117 |
-
border-left: none;
|
118 |
-
border-right: 1px solid #eeeeee;
|
119 |
-
}
|
120 |
-
}
|
121 |
-
|
122 |
-
// table
|
123 |
-
@at-root td#{&}, tr#{&} {
|
124 |
-
float: none;
|
125 |
-
}
|
126 |
-
|
127 |
-
// mobile
|
128 |
-
/*
|
129 |
-
@media screen and (max-width: $sm) {
|
130 |
-
float: none;
|
131 |
-
width: auto;
|
132 |
-
border-left-width: 0;
|
133 |
-
border-right-width: 0;
|
134 |
-
}
|
135 |
-
*/
|
136 |
-
}
|
137 |
-
|
138 |
-
|
139 |
-
// float helpers
|
140 |
-
.acf-field.-c0 {
|
141 |
-
clear: both;
|
142 |
-
border-left-width: 0 !important;
|
143 |
-
|
144 |
-
// rtl
|
145 |
-
html[dir="rtl"] & {
|
146 |
-
border-left-width: 1px !important;
|
147 |
-
border-right-width: 0 !important;
|
148 |
-
}
|
149 |
-
}
|
150 |
-
|
151 |
-
.acf-field.-r0 {
|
152 |
-
border-top-width: 0 !important;
|
153 |
-
}
|
154 |
-
|
155 |
-
|
156 |
-
/*--------------------------------------------------------------------------------------------
|
157 |
-
*
|
158 |
-
* acf-fields
|
159 |
-
*
|
160 |
-
*--------------------------------------------------------------------------------------------*/
|
161 |
-
|
162 |
-
.acf-fields {
|
163 |
-
position: relative;
|
164 |
-
|
165 |
-
// clearifx
|
166 |
-
@include clearfix();
|
167 |
-
|
168 |
-
// border
|
169 |
-
&.-border {
|
170 |
-
border: #dfdfdf solid 1px;
|
171 |
-
background: #fff;
|
172 |
-
}
|
173 |
-
|
174 |
-
// field
|
175 |
-
> .acf-field {
|
176 |
-
position: relative;
|
177 |
-
margin: 0;
|
178 |
-
padding: $field_padding;
|
179 |
-
border-top: #EEEEEE solid 1px;
|
180 |
-
|
181 |
-
// first
|
182 |
-
&:first-child {
|
183 |
-
border-top-width: 0;
|
184 |
-
}
|
185 |
-
}
|
186 |
-
|
187 |
-
// table
|
188 |
-
@at-root td#{&} {
|
189 |
-
padding: 0 !important;
|
190 |
-
}
|
191 |
-
}
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
/*--------------------------------------------------------------------------------------------
|
196 |
-
*
|
197 |
-
* acf-fields (clear)
|
198 |
-
*
|
199 |
-
*--------------------------------------------------------------------------------------------*/
|
200 |
-
|
201 |
-
.acf-fields.-clear > .acf-field {
|
202 |
-
border: none;
|
203 |
-
padding: 0;
|
204 |
-
margin: 15px 0;
|
205 |
-
|
206 |
-
// width
|
207 |
-
&[data-width] {
|
208 |
-
border: none !important;
|
209 |
-
}
|
210 |
-
|
211 |
-
// label
|
212 |
-
> .acf-label {
|
213 |
-
padding: 0;
|
214 |
-
}
|
215 |
-
|
216 |
-
// input
|
217 |
-
> .acf-input {
|
218 |
-
padding: 0;
|
219 |
-
}
|
220 |
-
}
|
221 |
-
|
222 |
-
|
223 |
-
/*--------------------------------------------------------------------------------------------
|
224 |
-
*
|
225 |
-
* acf-fields (left)
|
226 |
-
*
|
227 |
-
*--------------------------------------------------------------------------------------------*/
|
228 |
-
|
229 |
-
.acf-fields.-left > .acf-field {
|
230 |
-
padding: $fy 0;
|
231 |
-
|
232 |
-
// clearifx
|
233 |
-
@include clearfix();
|
234 |
-
|
235 |
-
// sidebar
|
236 |
-
&:before {
|
237 |
-
content: "";
|
238 |
-
display: block;
|
239 |
-
position: absolute;
|
240 |
-
z-index: 0;
|
241 |
-
background: #F9F9F9;
|
242 |
-
border-color: #E1E1E1;
|
243 |
-
border-style: solid;
|
244 |
-
border-width: 0 1px 0 0;
|
245 |
-
top: 0;
|
246 |
-
bottom: 0;
|
247 |
-
left: 0;
|
248 |
-
width: 20%;
|
249 |
-
}
|
250 |
-
|
251 |
-
// width
|
252 |
-
&[data-width] {
|
253 |
-
float: none;
|
254 |
-
width: auto !important;
|
255 |
-
border-left-width: 0 !important;
|
256 |
-
border-right-width: 0 !important;
|
257 |
-
}
|
258 |
-
|
259 |
-
// label
|
260 |
-
> .acf-label {
|
261 |
-
float: left;
|
262 |
-
width: 20%;
|
263 |
-
margin: 0;
|
264 |
-
padding: 0 $fx;
|
265 |
-
}
|
266 |
-
|
267 |
-
// input
|
268 |
-
> .acf-input {
|
269 |
-
float: left;
|
270 |
-
width: 80%;
|
271 |
-
margin: 0;
|
272 |
-
padding: 0 $fx;
|
273 |
-
}
|
274 |
-
|
275 |
-
// rtl
|
276 |
-
html[dir="rtl"] & {
|
277 |
-
|
278 |
-
// sidebar
|
279 |
-
&:before {
|
280 |
-
border-width: 0 0 0 1px;
|
281 |
-
left: auto;
|
282 |
-
right: 0;
|
283 |
-
}
|
284 |
-
|
285 |
-
// label
|
286 |
-
> .acf-label {
|
287 |
-
float: right;
|
288 |
-
}
|
289 |
-
|
290 |
-
// input
|
291 |
-
> .acf-input {
|
292 |
-
float: right;
|
293 |
-
}
|
294 |
-
}
|
295 |
-
|
296 |
-
// mobile
|
297 |
-
@media screen and (max-width: $sm) {
|
298 |
-
|
299 |
-
// sidebar
|
300 |
-
&:before {
|
301 |
-
display: none;
|
302 |
-
}
|
303 |
-
|
304 |
-
// label
|
305 |
-
> .acf-label {
|
306 |
-
width: 100%;
|
307 |
-
margin-bottom: 10px;
|
308 |
-
}
|
309 |
-
|
310 |
-
// input
|
311 |
-
> .acf-input {
|
312 |
-
width: 100%;
|
313 |
-
}
|
314 |
-
}
|
315 |
-
}
|
316 |
-
|
317 |
-
/* clear + left */
|
318 |
-
.acf-fields.-clear.-left > .acf-field {
|
319 |
-
padding: 0;
|
320 |
-
border: none;
|
321 |
-
|
322 |
-
// sidebar
|
323 |
-
&:before {
|
324 |
-
display: none;
|
325 |
-
}
|
326 |
-
|
327 |
-
// label
|
328 |
-
> .acf-label {
|
329 |
-
padding: 0;
|
330 |
-
}
|
331 |
-
|
332 |
-
// input
|
333 |
-
> .acf-input {
|
334 |
-
padding: 0;
|
335 |
-
}
|
336 |
-
}
|
337 |
-
|
338 |
-
|
339 |
-
/*--------------------------------------------------------------------------------------------
|
340 |
-
*
|
341 |
-
* acf-table
|
342 |
-
*
|
343 |
-
*--------------------------------------------------------------------------------------------*/
|
344 |
-
|
345 |
-
.acf-table tr.acf-field {
|
346 |
-
|
347 |
-
// label
|
348 |
-
> td.acf-label {
|
349 |
-
padding: $fp;
|
350 |
-
margin: 0;
|
351 |
-
background: #F9F9F9;
|
352 |
-
width: 20%;
|
353 |
-
}
|
354 |
-
|
355 |
-
// input
|
356 |
-
> td.acf-input {
|
357 |
-
padding: $fp;
|
358 |
-
margin: 0;
|
359 |
-
border-left-color: #E1E1E1;
|
360 |
-
}
|
361 |
-
}
|
362 |
-
|
363 |
-
.acf-sortable-tr-helper {
|
364 |
-
position: relative !important;
|
365 |
-
display: table-row !important;
|
366 |
-
}
|
367 |
-
|
368 |
-
|
369 |
-
/*--------------------------------------------------------------------------------------------
|
370 |
-
*
|
371 |
-
* acf-postbox
|
372 |
-
*
|
373 |
-
*--------------------------------------------------------------------------------------------*/
|
374 |
-
|
375 |
-
.acf-postbox {
|
376 |
-
position: relative;
|
377 |
-
|
378 |
-
// inside
|
379 |
-
> .inside {
|
380 |
-
margin: 0 !important; /* override WP style - do not delete - you have tried this before */
|
381 |
-
padding: 0 !important; /* override WP style - do not delete - you have tried this before */
|
382 |
-
}
|
383 |
-
|
384 |
-
// hndle
|
385 |
-
> .hndle {
|
386 |
-
|
387 |
-
/* edit field group */
|
388 |
-
.acf-hndle-cog {
|
389 |
-
color: #AAAAAA;
|
390 |
-
font-size: 16px;
|
391 |
-
line-height: 20px;
|
392 |
-
padding: 0 2px;
|
393 |
-
float: right;
|
394 |
-
position: relative;
|
395 |
-
display: none;
|
396 |
-
|
397 |
-
&:hover {
|
398 |
-
color: #777777;
|
399 |
-
}
|
400 |
-
}
|
401 |
-
}
|
402 |
-
|
403 |
-
// hover
|
404 |
-
&:hover > .hndle .acf-hndle-cog {
|
405 |
-
display: block;
|
406 |
-
}
|
407 |
-
|
408 |
-
// replace
|
409 |
-
.acf-replace-with-fields {
|
410 |
-
padding: 15px;
|
411 |
-
text-align: center;
|
412 |
-
}
|
413 |
-
}
|
414 |
-
|
415 |
-
// Correct margin around #acf_after_title
|
416 |
-
#post-body-content #acf_after_title-sortables {
|
417 |
-
margin: 20px 0 -20px;
|
418 |
-
}
|
419 |
-
|
420 |
-
/* seamless */
|
421 |
-
.acf-postbox.seamless {
|
422 |
-
border: 0 none;
|
423 |
-
background: transparent;
|
424 |
-
box-shadow: none;
|
425 |
-
|
426 |
-
|
427 |
-
/* hide hndle */
|
428 |
-
> .hndle,
|
429 |
-
> .handlediv {
|
430 |
-
display: none !important;
|
431 |
-
}
|
432 |
-
|
433 |
-
|
434 |
-
/* inside */
|
435 |
-
> .inside {
|
436 |
-
display: block !important; /* stop metabox from hiding when closed */
|
437 |
-
margin-left: -$field_padding_x !important;
|
438 |
-
margin-right: -$field_padding_x !important;
|
439 |
-
|
440 |
-
> .acf-field {
|
441 |
-
border-color: transparent;
|
442 |
-
}
|
443 |
-
}
|
444 |
-
}
|
445 |
-
|
446 |
-
|
447 |
-
/* seamless (left) */
|
448 |
-
.acf-postbox.seamless > .acf-fields.-left {
|
449 |
-
|
450 |
-
/* hide sidebar bg */
|
451 |
-
> .acf-field:before {
|
452 |
-
display: none;
|
453 |
-
}
|
454 |
-
|
455 |
-
|
456 |
-
/* mobile */
|
457 |
-
@media screen and (max-width: 782px) {
|
458 |
-
|
459 |
-
/* remove padding */
|
460 |
-
& > .acf-field > .acf-label,
|
461 |
-
& > .acf-field > .acf-input {
|
462 |
-
padding: 0;
|
463 |
-
}
|
464 |
-
}
|
465 |
-
}
|
466 |
-
|
467 |
-
/*---------------------------------------------------------------------------------------------
|
468 |
-
*
|
469 |
-
* Inputs
|
470 |
-
*
|
471 |
-
*---------------------------------------------------------------------------------------------*/
|
472 |
-
|
473 |
-
.acf-field {
|
474 |
-
|
475 |
-
// inputs
|
476 |
-
input[type="text"],
|
477 |
-
input[type="password"],
|
478 |
-
input[type="number"],
|
479 |
-
input[type="search"],
|
480 |
-
input[type="email"],
|
481 |
-
input[type="url"],
|
482 |
-
textarea,
|
483 |
-
select {
|
484 |
-
width: 100%;
|
485 |
-
padding: 3px 5px;
|
486 |
-
resize: none;
|
487 |
-
margin: 0;
|
488 |
-
-webkit-box-sizing: border-box;
|
489 |
-
-moz-box-sizing: border-box;
|
490 |
-
box-sizing: border-box;
|
491 |
-
|
492 |
-
font-size: 14px;
|
493 |
-
line-height: 1.4;
|
494 |
-
|
495 |
-
// disabled
|
496 |
-
&:disabled {
|
497 |
-
background: #f8f8f8;
|
498 |
-
}
|
499 |
-
|
500 |
-
// readonly
|
501 |
-
&[readonly] {
|
502 |
-
background: #f8f8f8;
|
503 |
-
}
|
504 |
-
}
|
505 |
-
|
506 |
-
// textarea
|
507 |
-
textarea {
|
508 |
-
resize: vertical;
|
509 |
-
}
|
510 |
-
|
511 |
-
}
|
512 |
-
|
513 |
-
|
514 |
-
/*---------------------------------------------------------------------------------------------
|
515 |
-
*
|
516 |
-
* Text
|
517 |
-
*
|
518 |
-
*---------------------------------------------------------------------------------------------*/
|
519 |
-
.acf-input-prepend,
|
520 |
-
.acf-input-append,
|
521 |
-
.acf-input-wrap {
|
522 |
-
box-sizing: border-box;
|
523 |
-
height: 28px;
|
524 |
-
}
|
525 |
-
|
526 |
-
.acf-input-prepend,
|
527 |
-
.acf-input-append {
|
528 |
-
font-size: 13px;
|
529 |
-
line-height: 20px;
|
530 |
-
padding: 3px 7px;
|
531 |
-
background: #F4F4F4;
|
532 |
-
border: #DFDFDF solid 1px;
|
533 |
-
}
|
534 |
-
|
535 |
-
.acf-input-prepend {
|
536 |
-
float: left;
|
537 |
-
border-right-width: 0;
|
538 |
-
border-radius: 3px 0 0 3px;
|
539 |
-
}
|
540 |
-
|
541 |
-
.acf-input-append {
|
542 |
-
float: right;
|
543 |
-
border-left-width: 0;
|
544 |
-
border-radius: 0 3px 3px 0;
|
545 |
-
}
|
546 |
-
|
547 |
-
.acf-input-wrap {
|
548 |
-
position: relative;
|
549 |
-
overflow: hidden;
|
550 |
-
|
551 |
-
input {
|
552 |
-
height: 28px;
|
553 |
-
margin: 0;
|
554 |
-
}
|
555 |
-
}
|
556 |
-
|
557 |
-
input.acf-is-prepended {
|
558 |
-
border-radius: 0 3px 3px 0 !important;
|
559 |
-
}
|
560 |
-
|
561 |
-
input.acf-is-appended {
|
562 |
-
border-radius: 3px 0 0 3px !important;
|
563 |
-
}
|
564 |
-
|
565 |
-
input.acf-is-prepended.acf-is-appended {
|
566 |
-
border-radius: 0 !important;
|
567 |
-
}
|
568 |
-
|
569 |
-
|
570 |
-
/* rtl */
|
571 |
-
html[dir="rtl"] .acf-input-prepend {
|
572 |
-
border-left-width: 0;
|
573 |
-
border-right-width: 1px;
|
574 |
-
border-radius: 0 3px 3px 0;
|
575 |
-
|
576 |
-
float: right;
|
577 |
-
}
|
578 |
-
|
579 |
-
html[dir="rtl"] .acf-input-append {
|
580 |
-
border-left-width: 1px;
|
581 |
-
border-right-width: 0;
|
582 |
-
border-radius: 3px 0 0 3px;
|
583 |
-
float: left;
|
584 |
-
}
|
585 |
-
|
586 |
-
html[dir="rtl"] input.acf-is-prepended {
|
587 |
-
border-radius: 3px 0 0 3px !important;
|
588 |
-
}
|
589 |
-
|
590 |
-
html[dir="rtl"] input.acf-is-appended {
|
591 |
-
border-radius: 0 3px 3px 0 !important;
|
592 |
-
}
|
593 |
-
|
594 |
-
html[dir="rtl"] input.acf-is-prepended.acf-is-appended {
|
595 |
-
border-radius: 0 !important;
|
596 |
-
}
|
597 |
-
|
598 |
-
|
599 |
-
/*---------------------------------------------------------------------------------------------
|
600 |
-
*
|
601 |
-
* Color Picker
|
602 |
-
*
|
603 |
-
*---------------------------------------------------------------------------------------------*/
|
604 |
-
|
605 |
-
.acf-color-picker {
|
606 |
-
|
607 |
-
.wp-picker-active {
|
608 |
-
position: relative;
|
609 |
-
z-index: 1;
|
610 |
-
}
|
611 |
-
|
612 |
-
}
|
613 |
-
|
614 |
-
|
615 |
-
/*---------------------------------------------------------------------------------------------
|
616 |
-
*
|
617 |
-
* Url
|
618 |
-
*
|
619 |
-
*---------------------------------------------------------------------------------------------*/
|
620 |
-
|
621 |
-
.acf-url {
|
622 |
-
|
623 |
-
i {
|
624 |
-
position: absolute;
|
625 |
-
top: 4px;
|
626 |
-
left: 4px;
|
627 |
-
opacity: 0.5;
|
628 |
-
color: #A9A9A9;
|
629 |
-
}
|
630 |
-
|
631 |
-
input[type="url"] {
|
632 |
-
padding-left: 25px;
|
633 |
-
}
|
634 |
-
|
635 |
-
&.-valid i {
|
636 |
-
opacity: 1;
|
637 |
-
}
|
638 |
-
|
639 |
-
}
|
640 |
-
|
641 |
-
|
642 |
-
/*---------------------------------------------------------------------------------------------
|
643 |
-
*
|
644 |
-
* Select
|
645 |
-
*
|
646 |
-
*---------------------------------------------------------------------------------------------*/
|
647 |
-
|
648 |
-
.acf-field select {
|
649 |
-
padding: 2px;
|
650 |
-
}
|
651 |
-
|
652 |
-
.acf-field select optgroup {
|
653 |
-
padding: 5px;
|
654 |
-
background: #fff;
|
655 |
-
}
|
656 |
-
|
657 |
-
.acf-field select option {
|
658 |
-
padding: 3px;
|
659 |
-
}
|
660 |
-
|
661 |
-
.acf-field select optgroup option {
|
662 |
-
padding-left: 5px;
|
663 |
-
}
|
664 |
-
|
665 |
-
.acf-field select optgroup:nth-child(2n) {
|
666 |
-
background: #F9F9F9;
|
667 |
-
}
|
668 |
-
|
669 |
-
.acf-field .select2-input {
|
670 |
-
max-width: 200px;
|
671 |
-
}
|
672 |
-
|
673 |
-
|
674 |
-
/*---------------------------------------------------------------------------------------------
|
675 |
-
*
|
676 |
-
* Select2 (v3)
|
677 |
-
*
|
678 |
-
*---------------------------------------------------------------------------------------------*/
|
679 |
-
|
680 |
-
.select2-container.-acf {
|
681 |
-
|
682 |
-
.select2-choices {
|
683 |
-
background: #fff;
|
684 |
-
border-color: #ddd;
|
685 |
-
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.07) inset;
|
686 |
-
min-height: 31px;
|
687 |
-
|
688 |
-
.select2-search-choice {
|
689 |
-
margin: 5px 0 5px 5px;
|
690 |
-
padding: 3px 5px 3px 18px;
|
691 |
-
border-color: #bbb;
|
692 |
-
background: #f9f9f9;
|
693 |
-
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset;
|
694 |
-
|
695 |
-
/* sortable item*/
|
696 |
-
&.ui-sortable-helper {
|
697 |
-
background: #5897fb;
|
698 |
-
border-color: darken(#5897fb, 5%);
|
699 |
-
color: #fff;
|
700 |
-
box-shadow: 0 0 3px rgba(0,0,0,0.1);
|
701 |
-
|
702 |
-
a {
|
703 |
-
visibility: hidden;
|
704 |
-
}
|
705 |
-
}
|
706 |
-
|
707 |
-
|
708 |
-
/* sortable shadow */
|
709 |
-
&.ui-sortable-placeholder {
|
710 |
-
background-color: #f7f7f7;
|
711 |
-
border-color: #f7f7f7;
|
712 |
-
visibility: visible !important;
|
713 |
-
}
|
714 |
-
}
|
715 |
-
|
716 |
-
.select2-search-choice-focus {
|
717 |
-
border-color: #999;
|
718 |
-
}
|
719 |
-
|
720 |
-
.select2-search-field input {
|
721 |
-
height: 31px;
|
722 |
-
line-height: 22px;
|
723 |
-
margin: 0;
|
724 |
-
padding: 5px 5px 5px 7px;
|
725 |
-
}
|
726 |
-
}
|
727 |
-
|
728 |
-
.select2-choice {
|
729 |
-
border-color: #BBBBBB;
|
730 |
-
|
731 |
-
.select2-arrow {
|
732 |
-
background: transparent;
|
733 |
-
border-left-color: #DFDFDF;
|
734 |
-
padding-left: 1px;
|
735 |
-
}
|
736 |
-
|
737 |
-
.select2-result-description {
|
738 |
-
display: none;
|
739 |
-
}
|
740 |
-
}
|
741 |
-
|
742 |
-
|
743 |
-
|
744 |
-
/* open */
|
745 |
-
&.select2-container-active .select2-choices,
|
746 |
-
&.select2-dropdown-open .select2-choices {
|
747 |
-
border-color: #5B9DD9;
|
748 |
-
border-radius: 3px 3px 0 0;
|
749 |
-
}
|
750 |
-
|
751 |
-
|
752 |
-
/* single open */
|
753 |
-
&.select2-dropdown-open .select2-choice {
|
754 |
-
background: #fff;
|
755 |
-
border-color: #5B9DD9;
|
756 |
-
}
|
757 |
-
|
758 |
-
}
|
759 |
-
|
760 |
-
/* rtl */
|
761 |
-
html[dir="rtl"] .select2-container.-acf {
|
762 |
-
|
763 |
-
.select2-search-choice-close {
|
764 |
-
left: 24px;
|
765 |
-
}
|
766 |
-
|
767 |
-
.select2-choice > .select2-chosen {
|
768 |
-
margin-left: 42px;
|
769 |
-
}
|
770 |
-
|
771 |
-
.select2-choice .select2-arrow {
|
772 |
-
padding-left: 0;
|
773 |
-
padding-right: 1px;
|
774 |
-
}
|
775 |
-
}
|
776 |
-
|
777 |
-
|
778 |
-
/* description */
|
779 |
-
.select2-drop {
|
780 |
-
|
781 |
-
/* search*/
|
782 |
-
.select2-search {
|
783 |
-
padding: 4px 4px 0;
|
784 |
-
}
|
785 |
-
|
786 |
-
|
787 |
-
/* result */
|
788 |
-
.select2-result {
|
789 |
-
|
790 |
-
.select2-result-description {
|
791 |
-
color: #999;
|
792 |
-
font-size: 12px;
|
793 |
-
margin-left: 5px;
|
794 |
-
}
|
795 |
-
|
796 |
-
|
797 |
-
/* hover*/
|
798 |
-
&.select2-highlighted {
|
799 |
-
|
800 |
-
.select2-result-description {
|
801 |
-
color: #fff;
|
802 |
-
opacity: 0.75;
|
803 |
-
}
|
804 |
-
|
805 |
-
}
|
806 |
-
|
807 |
-
}
|
808 |
-
|
809 |
-
}
|
810 |
-
|
811 |
-
|
812 |
-
|
813 |
-
/*---------------------------------------------------------------------------------------------
|
814 |
-
*
|
815 |
-
* Select2 (v4)
|
816 |
-
*
|
817 |
-
*---------------------------------------------------------------------------------------------*/
|
818 |
-
|
819 |
-
// Fix unneeded bottom margin.
|
820 |
-
.select2-container.-acf {
|
821 |
-
li{
|
822 |
-
margin-bottom: 0;
|
823 |
-
}
|
824 |
-
}
|
825 |
-
|
826 |
-
// Default wrap.
|
827 |
-
.select2-container--default.-acf {
|
828 |
-
|
829 |
-
// Multiple wrap.
|
830 |
-
.select2-selection--multiple {
|
831 |
-
|
832 |
-
// If no value, increase hidden search input full width.
|
833 |
-
// Overrides calculated px width issues.
|
834 |
-
.select2-search--inline:first-child {
|
835 |
-
float: none;
|
836 |
-
input {
|
837 |
-
width: 100% !important;
|
838 |
-
}
|
839 |
-
}
|
840 |
-
|
841 |
-
// ul: Remove padding because li already has margin-right.
|
842 |
-
.select2-selection__rendered {
|
843 |
-
padding-right: 0;
|
844 |
-
}
|
845 |
-
|
846 |
-
// li
|
847 |
-
.select2-selection__choice {
|
848 |
-
background-color: #f7f7f7;
|
849 |
-
border-color: #cccccc;
|
850 |
-
|
851 |
-
// Allow choice to wrap multiple lines.
|
852 |
-
max-width: 100%;
|
853 |
-
overflow: hidden;
|
854 |
-
word-wrap: normal !important;
|
855 |
-
white-space: normal;
|
856 |
-
|
857 |
-
// Sortable.
|
858 |
-
&.ui-sortable-helper {
|
859 |
-
background: #5897fb;
|
860 |
-
border-color: darken(#5897fb, 5%);
|
861 |
-
color: #fff;
|
862 |
-
box-shadow: 0 0 3px rgba(0,0,0,0.1);
|
863 |
-
|
864 |
-
span {
|
865 |
-
visibility: hidden;
|
866 |
-
}
|
867 |
-
}
|
868 |
-
|
869 |
-
// Sortable shadow
|
870 |
-
&.ui-sortable-placeholder {
|
871 |
-
background-color: #f7f7f7;
|
872 |
-
border-color: #f7f7f7;
|
873 |
-
visibility: visible !important;
|
874 |
-
}
|
875 |
-
}
|
876 |
-
|
877 |
-
// search
|
878 |
-
.select2-search__field {
|
879 |
-
box-shadow: none !important;
|
880 |
-
}
|
881 |
-
}
|
882 |
-
}
|
883 |
-
|
884 |
-
// z-index helper.
|
885 |
-
.select2-container {
|
886 |
-
.select2-dropdown {
|
887 |
-
z-index: 900000;
|
888 |
-
}
|
889 |
-
}
|
890 |
-
|
891 |
-
/*---------------------------------------------------------------------------------------------
|
892 |
-
*
|
893 |
-
* Link
|
894 |
-
*
|
895 |
-
*---------------------------------------------------------------------------------------------*/
|
896 |
-
|
897 |
-
.link-wrap {
|
898 |
-
border: #dddddd solid 1px;
|
899 |
-
border-radius: 3px;
|
900 |
-
padding: 5px;
|
901 |
-
line-height: 26px;
|
902 |
-
background: #fff;
|
903 |
-
|
904 |
-
word-wrap: break-word;
|
905 |
-
word-break: break-all;
|
906 |
-
|
907 |
-
.link-title {
|
908 |
-
padding: 0 5px;
|
909 |
-
}
|
910 |
-
|
911 |
-
}
|
912 |
-
|
913 |
-
.acf-link {
|
914 |
-
|
915 |
-
.link-wrap,
|
916 |
-
.acf-icon.-link-ext { display: none; }
|
917 |
-
|
918 |
-
/* value */
|
919 |
-
&.-value {
|
920 |
-
|
921 |
-
.button { display: none; }
|
922 |
-
.link-wrap { display: inline-block; }
|
923 |
-
|
924 |
-
}
|
925 |
-
|
926 |
-
|
927 |
-
/* external */
|
928 |
-
&.-external {
|
929 |
-
|
930 |
-
.acf-icon.-link-ext { display: inline-block; }
|
931 |
-
|
932 |
-
}
|
933 |
-
|
934 |
-
}
|
935 |
-
|
936 |
-
#wp-link-backdrop { z-index: 900000 !important; }
|
937 |
-
#wp-link-wrap { z-index: 900001 !important; }
|
938 |
-
|
939 |
-
|
940 |
-
|
941 |
-
/*---------------------------------------------------------------------------------------------
|
942 |
-
*
|
943 |
-
* Radio
|
944 |
-
*
|
945 |
-
*---------------------------------------------------------------------------------------------*/
|
946 |
-
|
947 |
-
ul.acf-radio-list,
|
948 |
-
ul.acf-checkbox-list {
|
949 |
-
background: transparent;
|
950 |
-
position: relative;
|
951 |
-
padding: 1px;
|
952 |
-
margin: 0;
|
953 |
-
|
954 |
-
li {
|
955 |
-
font-size: 13px;
|
956 |
-
line-height: 22px;
|
957 |
-
margin: 0;
|
958 |
-
position: relative;
|
959 |
-
word-wrap: break-word;
|
960 |
-
|
961 |
-
label {
|
962 |
-
display: inline;
|
963 |
-
}
|
964 |
-
|
965 |
-
input[type="checkbox"],
|
966 |
-
input[type="radio"] {
|
967 |
-
margin: -1px 4px 0 0;
|
968 |
-
vertical-align: middle;
|
969 |
-
}
|
970 |
-
|
971 |
-
input[type="text"] {
|
972 |
-
width: auto;
|
973 |
-
vertical-align: middle;
|
974 |
-
margin: 2px 0;
|
975 |
-
}
|
976 |
-
|
977 |
-
|
978 |
-
/* attachment sidebar fix*/
|
979 |
-
span {
|
980 |
-
float: none;
|
981 |
-
}
|
982 |
-
|
983 |
-
i {
|
984 |
-
vertical-align: middle;
|
985 |
-
}
|
986 |
-
}
|
987 |
-
|
988 |
-
|
989 |
-
/* hl */
|
990 |
-
&.acf-hl {
|
991 |
-
|
992 |
-
li {
|
993 |
-
margin-right: 20px;
|
994 |
-
clear: none;
|
995 |
-
}
|
996 |
-
}
|
997 |
-
|
998 |
-
|
999 |
-
/* rtl */
|
1000 |
-
html[dir="rtl"] & {
|
1001 |
-
|
1002 |
-
input[type="checkbox"],
|
1003 |
-
input[type="radio"] {
|
1004 |
-
margin-left: 4px;
|
1005 |
-
margin-right: 0;
|
1006 |
-
}
|
1007 |
-
}
|
1008 |
-
|
1009 |
-
|
1010 |
-
|
1011 |
-
|
1012 |
-
}
|
1013 |
-
|
1014 |
-
|
1015 |
-
/*---------------------------------------------------------------------------------------------
|
1016 |
-
*
|
1017 |
-
* Button Group
|
1018 |
-
*
|
1019 |
-
*---------------------------------------------------------------------------------------------*/
|
1020 |
-
|
1021 |
-
.acf-button-group {
|
1022 |
-
display: inline-block;
|
1023 |
-
|
1024 |
-
label {
|
1025 |
-
display: inline-block;
|
1026 |
-
border: #ccc solid 1px;
|
1027 |
-
position: relative;
|
1028 |
-
z-index: 1;
|
1029 |
-
padding: 5px 10px;
|
1030 |
-
background: #fff;
|
1031 |
-
|
1032 |
-
&:hover {
|
1033 |
-
border-color: darken(#ccc, 20%);
|
1034 |
-
z-index: 2;
|
1035 |
-
}
|
1036 |
-
|
1037 |
-
&.selected {
|
1038 |
-
border-color: darken(#309cf3, 1%);
|
1039 |
-
background: #309cf3;
|
1040 |
-
color: #fff;
|
1041 |
-
z-index: 2;
|
1042 |
-
|
1043 |
-
&:hover {
|
1044 |
-
background: lighten(#309cf3, 5%);
|
1045 |
-
}
|
1046 |
-
}
|
1047 |
-
}
|
1048 |
-
|
1049 |
-
input {
|
1050 |
-
display: none !important;
|
1051 |
-
}
|
1052 |
-
|
1053 |
-
|
1054 |
-
/* default (horizontal) */
|
1055 |
-
& {
|
1056 |
-
padding-left: 1px;
|
1057 |
-
display: inline-flex;
|
1058 |
-
flex-direction: row;
|
1059 |
-
flex-wrap: nowrap;
|
1060 |
-
|
1061 |
-
label {
|
1062 |
-
margin: 0 0 0 -1px;
|
1063 |
-
flex: 1;
|
1064 |
-
text-align: center;
|
1065 |
-
white-space: nowrap;
|
1066 |
-
|
1067 |
-
// corners
|
1068 |
-
&:first-child {
|
1069 |
-
border-radius: 3px 0 0 3px;
|
1070 |
-
html[dir="rtl"] & { border-radius: 0 3px 3px 0; }
|
1071 |
-
}
|
1072 |
-
&:last-child {
|
1073 |
-
border-radius: 0 3px 3px 0;
|
1074 |
-
html[dir="rtl"] & { border-radius: 3px 0 0 3px; }
|
1075 |
-
}
|
1076 |
-
&:only-child { border-radius: 3px; }
|
1077 |
-
}
|
1078 |
-
}
|
1079 |
-
|
1080 |
-
|
1081 |
-
/* vertical */
|
1082 |
-
&.-vertical {
|
1083 |
-
padding-left: 0;
|
1084 |
-
padding-top: 1px;
|
1085 |
-
flex-direction: column;
|
1086 |
-
|
1087 |
-
label {
|
1088 |
-
margin: -1px 0 0 0;
|
1089 |
-
|
1090 |
-
// corners
|
1091 |
-
&:first-child { border-radius: 3px 3px 0 0; }
|
1092 |
-
&:last-child { border-radius: 0 0 3px 3px; }
|
1093 |
-
&:only-child { border-radius: 3px; }
|
1094 |
-
|
1095 |
-
}
|
1096 |
-
}
|
1097 |
-
|
1098 |
-
|
1099 |
-
}
|
1100 |
-
|
1101 |
-
|
1102 |
-
|
1103 |
-
/*---------------------------------------------------------------------------------------------
|
1104 |
-
*
|
1105 |
-
* Checkbox
|
1106 |
-
*
|
1107 |
-
*---------------------------------------------------------------------------------------------*/
|
1108 |
-
|
1109 |
-
.acf-checkbox-list {
|
1110 |
-
|
1111 |
-
.button {
|
1112 |
-
margin: 10px 0 0;
|
1113 |
-
}
|
1114 |
-
|
1115 |
-
}
|
1116 |
-
|
1117 |
-
|
1118 |
-
|
1119 |
-
/*---------------------------------------------------------------------------------------------
|
1120 |
-
*
|
1121 |
-
* True / False
|
1122 |
-
*
|
1123 |
-
*---------------------------------------------------------------------------------------------*/
|
1124 |
-
|
1125 |
-
.acf-switch {
|
1126 |
-
display: inline-block;
|
1127 |
-
border-radius: 5px;
|
1128 |
-
cursor: pointer;
|
1129 |
-
position: relative;
|
1130 |
-
background: #f8f8f8;
|
1131 |
-
height: 30px;
|
1132 |
-
vertical-align: middle;
|
1133 |
-
//box-shadow: inset 0 0 1px rgba(0,0,0,0.2);
|
1134 |
-
border: #ccc solid 1px;
|
1135 |
-
|
1136 |
-
-webkit-transition: background 0.25s ease;
|
1137 |
-
-moz-transition: background 0.25s ease;
|
1138 |
-
-o-transition: background 0.25s ease;
|
1139 |
-
transition: background 0.25s ease;
|
1140 |
-
|
1141 |
-
span {
|
1142 |
-
display: inline-block;
|
1143 |
-
float: left;
|
1144 |
-
text-align: center;
|
1145 |
-
|
1146 |
-
font-size: 13px;
|
1147 |
-
line-height: 22px;
|
1148 |
-
|
1149 |
-
padding: 4px 10px;
|
1150 |
-
min-width: 15px;
|
1151 |
-
|
1152 |
-
i {
|
1153 |
-
vertical-align: middle;
|
1154 |
-
}
|
1155 |
-
}
|
1156 |
-
|
1157 |
-
.acf-switch-on {
|
1158 |
-
color: #fff;
|
1159 |
-
text-shadow: darken($acf_blue, 10%) 0 1px 0;
|
1160 |
-
}
|
1161 |
-
|
1162 |
-
.acf-switch-off {
|
1163 |
-
|
1164 |
-
}
|
1165 |
-
|
1166 |
-
.acf-switch-slider {
|
1167 |
-
position: absolute;
|
1168 |
-
top: 2px;
|
1169 |
-
left: 2px;
|
1170 |
-
bottom: 2px;
|
1171 |
-
right: 50%;
|
1172 |
-
z-index: 1;
|
1173 |
-
background: #fff;
|
1174 |
-
border-radius: 3px;
|
1175 |
-
border: #ccc solid 1px;
|
1176 |
-
|
1177 |
-
-webkit-transition: all 0.25s ease;
|
1178 |
-
-moz-transition: all 0.25s ease;
|
1179 |
-
-o-transition: all 0.25s ease;
|
1180 |
-
transition: all 0.25s ease;
|
1181 |
-
|
1182 |
-
transition-property: left, right;
|
1183 |
-
}
|
1184 |
-
|
1185 |
-
|
1186 |
-
/* hover */
|
1187 |
-
&:hover {
|
1188 |
-
.acf-switch-slider{
|
1189 |
-
border-color: darken(#ccc, 10%);
|
1190 |
-
}
|
1191 |
-
}
|
1192 |
-
|
1193 |
-
|
1194 |
-
/* active */
|
1195 |
-
&.-on {
|
1196 |
-
background: #309cf3;
|
1197 |
-
border-color: darken(#309cf3, 1%);
|
1198 |
-
|
1199 |
-
.acf-switch-slider {
|
1200 |
-
left: 50%;
|
1201 |
-
right: 2px;
|
1202 |
-
border-color: darken(#309cf3, 10%);
|
1203 |
-
}
|
1204 |
-
|
1205 |
-
/* hover */
|
1206 |
-
&:hover {
|
1207 |
-
background: lighten(#309cf3, 5%);
|
1208 |
-
}
|
1209 |
-
}
|
1210 |
-
|
1211 |
-
|
1212 |
-
/* focus */
|
1213 |
-
&.-focus {
|
1214 |
-
|
1215 |
-
.acf-switch-slider {
|
1216 |
-
border-color: #5b9dd9;
|
1217 |
-
box-shadow: 0 0 2px rgba(30, 140, 190, 0.5);
|
1218 |
-
}
|
1219 |
-
|
1220 |
-
|
1221 |
-
&.-on {
|
1222 |
-
|
1223 |
-
.acf-switch-slider {
|
1224 |
-
border-color: darken($acf_blue, 20%);
|
1225 |
-
box-shadow: 0 0 2px darken($acf_blue, 10%);
|
1226 |
-
}
|
1227 |
-
}
|
1228 |
-
|
1229 |
-
}
|
1230 |
-
|
1231 |
-
|
1232 |
-
/* message */
|
1233 |
-
+ span {
|
1234 |
-
margin-left: 6px;
|
1235 |
-
}
|
1236 |
-
|
1237 |
-
}
|
1238 |
-
|
1239 |
-
|
1240 |
-
/* checkbox */
|
1241 |
-
.acf-switch-input {
|
1242 |
-
opacity: 0;
|
1243 |
-
position: absolute;
|
1244 |
-
margin: 0;
|
1245 |
-
}
|
1246 |
-
|
1247 |
-
|
1248 |
-
/* in media modal */
|
1249 |
-
.compat-item .acf-true-false {
|
1250 |
-
|
1251 |
-
.message {
|
1252 |
-
float: none;
|
1253 |
-
padding: 0;
|
1254 |
-
vertical-align: middle;
|
1255 |
-
}
|
1256 |
-
|
1257 |
-
}
|
1258 |
-
|
1259 |
-
|
1260 |
-
/*--------------------------------------------------------------------------
|
1261 |
-
*
|
1262 |
-
* Google Map
|
1263 |
-
*
|
1264 |
-
*-------------------------------------------------------------------------*/
|
1265 |
-
|
1266 |
-
.acf-google-map {
|
1267 |
-
position: relative;
|
1268 |
-
border: #DFDFDF solid 1px;
|
1269 |
-
background: #fff;
|
1270 |
-
|
1271 |
-
.title {
|
1272 |
-
position: relative;
|
1273 |
-
border-bottom: #DFDFDF solid 1px;
|
1274 |
-
|
1275 |
-
.search {
|
1276 |
-
margin: 0;
|
1277 |
-
font-size: 14px;
|
1278 |
-
line-height: 30px;
|
1279 |
-
height: 40px;
|
1280 |
-
padding: 5px 10px;
|
1281 |
-
border: 0 none;
|
1282 |
-
box-shadow: none;
|
1283 |
-
border-radius: 0;
|
1284 |
-
font-family: inherit;
|
1285 |
-
cursor: text;
|
1286 |
-
}
|
1287 |
-
|
1288 |
-
.acf-actions {
|
1289 |
-
|
1290 |
-
}
|
1291 |
-
|
1292 |
-
.acf-loading {
|
1293 |
-
position: absolute;
|
1294 |
-
top: 10px;
|
1295 |
-
right: 11px;
|
1296 |
-
display: none;
|
1297 |
-
}
|
1298 |
-
|
1299 |
-
&:hover {
|
1300 |
-
.acf-actions { display: block; }
|
1301 |
-
}
|
1302 |
-
}
|
1303 |
-
|
1304 |
-
.canvas {
|
1305 |
-
height: 400px;
|
1306 |
-
}
|
1307 |
-
|
1308 |
-
|
1309 |
-
/* default is focused */
|
1310 |
-
.title {
|
1311 |
-
.acf-icon.-location {
|
1312 |
-
display: inline-block;
|
1313 |
-
}
|
1314 |
-
.acf-icon.-cancel {
|
1315 |
-
display: none;
|
1316 |
-
}
|
1317 |
-
.acf-icon.-search {
|
1318 |
-
display: none;
|
1319 |
-
}
|
1320 |
-
}
|
1321 |
-
|
1322 |
-
|
1323 |
-
/* -search */
|
1324 |
-
&.-search .title {
|
1325 |
-
.acf-icon.-location {
|
1326 |
-
display: none;
|
1327 |
-
}
|
1328 |
-
.acf-icon.-cancel {
|
1329 |
-
display: inline-block;
|
1330 |
-
}
|
1331 |
-
.acf-icon.-search {
|
1332 |
-
display: inline-block;
|
1333 |
-
}
|
1334 |
-
}
|
1335 |
-
|
1336 |
-
|
1337 |
-
|
1338 |
-
/* -value */
|
1339 |
-
&.-value .title {
|
1340 |
-
.search {
|
1341 |
-
font-weight: bold;
|
1342 |
-
}
|
1343 |
-
.acf-icon.-location {
|
1344 |
-
display: none;
|
1345 |
-
}
|
1346 |
-
.acf-icon.-cancel {
|
1347 |
-
display: inline-block;
|
1348 |
-
}
|
1349 |
-
.acf-icon.-search {
|
1350 |
-
display: none;
|
1351 |
-
}
|
1352 |
-
}
|
1353 |
-
|
1354 |
-
|
1355 |
-
/* -loading */
|
1356 |
-
&.-loading .title {
|
1357 |
-
a {
|
1358 |
-
display: none !important;
|
1359 |
-
}
|
1360 |
-
i {
|
1361 |
-
display: inline-block;
|
1362 |
-
}
|
1363 |
-
}
|
1364 |
-
|
1365 |
-
}
|
1366 |
-
|
1367 |
-
|
1368 |
-
|
1369 |
-
/* autocomplete */
|
1370 |
-
.pac-container {
|
1371 |
-
border-width: 1px 0;
|
1372 |
-
box-shadow: none;
|
1373 |
-
}
|
1374 |
-
|
1375 |
-
.pac-container:after {
|
1376 |
-
display: none;
|
1377 |
-
}
|
1378 |
-
|
1379 |
-
.pac-container .pac-item:first-child {
|
1380 |
-
border-top: 0 none;
|
1381 |
-
}
|
1382 |
-
.pac-container .pac-item {
|
1383 |
-
padding: 5px 10px;
|
1384 |
-
cursor: pointer;
|
1385 |
-
}
|
1386 |
-
|
1387 |
-
|
1388 |
-
html[dir="rtl"] .pac-container .pac-item {
|
1389 |
-
text-align: right;
|
1390 |
-
}
|
1391 |
-
|
1392 |
-
|
1393 |
-
/*--------------------------------------------------------------------------
|
1394 |
-
*
|
1395 |
-
* Relationship
|
1396 |
-
*
|
1397 |
-
*-------------------------------------------------------------------------*/
|
1398 |
-
|
1399 |
-
.acf-relationship {
|
1400 |
-
background: #fff;
|
1401 |
-
|
1402 |
-
/* filters (top) */
|
1403 |
-
.filters {
|
1404 |
-
@include clearfix();
|
1405 |
-
border: #DFDFDF solid 1px;
|
1406 |
-
background: #fff;
|
1407 |
-
|
1408 |
-
|
1409 |
-
.filter {
|
1410 |
-
margin: 0;
|
1411 |
-
padding: 0;
|
1412 |
-
float: left;
|
1413 |
-
width: 100%;
|
1414 |
-
|
1415 |
-
|
1416 |
-
/* inner padding */
|
1417 |
-
span {
|
1418 |
-
display: block;
|
1419 |
-
padding: 7px 7px 7px 0;
|
1420 |
-
}
|
1421 |
-
|
1422 |
-
&:first-child span {
|
1423 |
-
padding-left: 7px;
|
1424 |
-
}
|
1425 |
-
|
1426 |
-
|
1427 |
-
// inputs
|
1428 |
-
input, select {
|
1429 |
-
height: 28px;
|
1430 |
-
line-height: 28px;
|
1431 |
-
padding: 2px;
|
1432 |
-
width: 100%;
|
1433 |
-
margin: 0;
|
1434 |
-
float: none; /* potential fix for media popup? */
|
1435 |
-
|
1436 |
-
&:focus,
|
1437 |
-
&:active {
|
1438 |
-
outline: none;
|
1439 |
-
box-shadow: none;
|
1440 |
-
}
|
1441 |
-
}
|
1442 |
-
|
1443 |
-
input {
|
1444 |
-
border-color: transparent;
|
1445 |
-
box-shadow: none;
|
1446 |
-
}
|
1447 |
-
|
1448 |
-
}
|
1449 |
-
|
1450 |
-
|
1451 |
-
/* widths */
|
1452 |
-
&.-f2 {
|
1453 |
-
.filter { width: 50%; }
|
1454 |
-
}
|
1455 |
-
&.-f3 {
|
1456 |
-
.filter { width: 25%; }
|
1457 |
-
.filter.-search { width: 50%; }
|
1458 |
-
}
|
1459 |
-
|
1460 |
-
}
|
1461 |
-
|
1462 |
-
|
1463 |
-
/* list */
|
1464 |
-
.list {
|
1465 |
-
margin: 0;
|
1466 |
-
padding: 5px;
|
1467 |
-
height: 160px;
|
1468 |
-
overflow: auto;
|
1469 |
-
|
1470 |
-
.acf-rel-label,
|
1471 |
-
.acf-rel-item,
|
1472 |
-
p {
|
1473 |
-
padding: 5px 7px;
|
1474 |
-
margin: 0;
|
1475 |
-
display: block;
|
1476 |
-
position: relative;
|
1477 |
-
min-height: 18px;
|
1478 |
-
}
|
1479 |
-
|
1480 |
-
.acf-rel-label {
|
1481 |
-
font-weight: bold;
|
1482 |
-
}
|
1483 |
-
|
1484 |
-
.acf-rel-item {
|
1485 |
-
cursor: pointer;
|
1486 |
-
|
1487 |
-
b {
|
1488 |
-
text-decoration: underline;
|
1489 |
-
font-weight: normal;
|
1490 |
-
}
|
1491 |
-
|
1492 |
-
.thumbnail {
|
1493 |
-
background: darken(#f9f9f9, 10%);
|
1494 |
-
width: 22px;
|
1495 |
-
height: 22px;
|
1496 |
-
float: left;
|
1497 |
-
margin: -2px 5px 0 0;
|
1498 |
-
|
1499 |
-
img {
|
1500 |
-
max-width: 22px;
|
1501 |
-
max-height: 22px;
|
1502 |
-
margin: 0 auto;
|
1503 |
-
display: block;
|
1504 |
-
}
|
1505 |
-
|
1506 |
-
&.-icon {
|
1507 |
-
background: #fff;
|
1508 |
-
|
1509 |
-
img {
|
1510 |
-
max-height: 20px;
|
1511 |
-
margin-top: 1px;
|
1512 |
-
}
|
1513 |
-
}
|
1514 |
-
}
|
1515 |
-
|
1516 |
-
/* hover */
|
1517 |
-
&:hover {
|
1518 |
-
background: #3875D7;
|
1519 |
-
color: #fff;
|
1520 |
-
|
1521 |
-
.thumbnail {
|
1522 |
-
background: lighten(#3875D7, 25%);
|
1523 |
-
|
1524 |
-
&.-icon {
|
1525 |
-
background: #fff;
|
1526 |
-
}
|
1527 |
-
}
|
1528 |
-
}
|
1529 |
-
|
1530 |
-
|
1531 |
-
/* disabled */
|
1532 |
-
&.disabled {
|
1533 |
-
opacity: 0.5;
|
1534 |
-
|
1535 |
-
&:hover {
|
1536 |
-
background: transparent;
|
1537 |
-
color: #333;
|
1538 |
-
cursor: default;
|
1539 |
-
|
1540 |
-
.thumbnail {
|
1541 |
-
background: darken(#f9f9f9, 10%);
|
1542 |
-
|
1543 |
-
&.-icon {
|
1544 |
-
background: #fff;
|
1545 |
-
}
|
1546 |
-
}
|
1547 |
-
}
|
1548 |
-
}
|
1549 |
-
}
|
1550 |
-
|
1551 |
-
ul {
|
1552 |
-
padding-bottom: 5px;
|
1553 |
-
|
1554 |
-
.acf-rel-label,
|
1555 |
-
.acf-rel-item,
|
1556 |
-
p {
|
1557 |
-
padding-left: 20px;
|
1558 |
-
}
|
1559 |
-
|
1560 |
-
}
|
1561 |
-
|
1562 |
-
}
|
1563 |
-
|
1564 |
-
|
1565 |
-
/* selection (bottom) */
|
1566 |
-
.selection {
|
1567 |
-
@include clearfix();
|
1568 |
-
border: #DFDFDF solid 1px;
|
1569 |
-
position: relative;
|
1570 |
-
margin-top: -1px;
|
1571 |
-
|
1572 |
-
.values,
|
1573 |
-
.choices {
|
1574 |
-
width: 50%;
|
1575 |
-
background: #fff;
|
1576 |
-
float: left
|
1577 |
-
}
|
1578 |
-
|
1579 |
-
/* choices */
|
1580 |
-
.choices {
|
1581 |
-
background: #F9F9F9;
|
1582 |
-
|
1583 |
-
.list {
|
1584 |
-
border-right: #DFDFDF solid 1px;
|
1585 |
-
}
|
1586 |
-
|
1587 |
-
}
|
1588 |
-
|
1589 |
-
|
1590 |
-
/* values */
|
1591 |
-
.values {
|
1592 |
-
|
1593 |
-
.acf-icon {
|
1594 |
-
position: absolute;
|
1595 |
-
top: 4px;
|
1596 |
-
right: 7px;
|
1597 |
-
display: none;
|
1598 |
-
|
1599 |
-
/* rtl */
|
1600 |
-
html[dir="rtl"] & {
|
1601 |
-
right: auto;
|
1602 |
-
left: 7px;
|
1603 |
-
}
|
1604 |
-
|
1605 |
-
}
|
1606 |
-
|
1607 |
-
.acf-rel-item:hover .acf-icon {
|
1608 |
-
display: block;
|
1609 |
-
}
|
1610 |
-
|
1611 |
-
.acf-rel-item {
|
1612 |
-
cursor: move;
|
1613 |
-
|
1614 |
-
b {
|
1615 |
-
text-decoration: none;
|
1616 |
-
}
|
1617 |
-
|
1618 |
-
}
|
1619 |
-
|
1620 |
-
}
|
1621 |
-
|
1622 |
-
}
|
1623 |
-
|
1624 |
-
|
1625 |
-
}
|
1626 |
-
|
1627 |
-
/* menu item fix */
|
1628 |
-
.menu-item {
|
1629 |
-
|
1630 |
-
.acf-relationship {
|
1631 |
-
|
1632 |
-
ul {
|
1633 |
-
width: auto;
|
1634 |
-
}
|
1635 |
-
|
1636 |
-
li {
|
1637 |
-
display: block;
|
1638 |
-
}
|
1639 |
-
}
|
1640 |
-
}
|
1641 |
-
|
1642 |
-
|
1643 |
-
/*--------------------------------------------------------------------------
|
1644 |
-
*
|
1645 |
-
* WYSIWYG
|
1646 |
-
*
|
1647 |
-
*-------------------------------------------------------------------------*/
|
1648 |
-
|
1649 |
-
.acf-editor-wrap {
|
1650 |
-
|
1651 |
-
// Delay.
|
1652 |
-
&.delay {
|
1653 |
-
|
1654 |
-
.acf-editor-toolbar {
|
1655 |
-
content: "";
|
1656 |
-
display: block;
|
1657 |
-
background: #f5f5f5;
|
1658 |
-
border-bottom: #dddddd solid 1px;
|
1659 |
-
color: #555d66;
|
1660 |
-
padding: 10px;
|
1661 |
-
}
|
1662 |
-
|
1663 |
-
textarea {
|
1664 |
-
padding: 10px;
|
1665 |
-
border: none;
|
1666 |
-
}
|
1667 |
-
}
|
1668 |
-
|
1669 |
-
iframe{
|
1670 |
-
min-height: 200px;
|
1671 |
-
}
|
1672 |
-
|
1673 |
-
.wp-editor-container{
|
1674 |
-
border: 1px solid #E5E5E5;
|
1675 |
-
box-shadow: none !important;
|
1676 |
-
}
|
1677 |
-
|
1678 |
-
.wp-editor-tabs {
|
1679 |
-
box-sizing: content-box;
|
1680 |
-
}
|
1681 |
-
}
|
1682 |
-
|
1683 |
-
// Full Screen Mode.
|
1684 |
-
#mce_fullscreen_container {
|
1685 |
-
z-index: 900000 !important;
|
1686 |
-
}
|
1687 |
-
|
1688 |
-
/*---------------------------------------------------------------------------------------------
|
1689 |
-
*
|
1690 |
-
* Tab
|
1691 |
-
*
|
1692 |
-
*---------------------------------------------------------------------------------------------*/
|
1693 |
-
|
1694 |
-
.acf-field-tab {
|
1695 |
-
display: none !important;
|
1696 |
-
}
|
1697 |
-
|
1698 |
-
// class to hide fields
|
1699 |
-
.hidden-by-tab {
|
1700 |
-
display: none !important;
|
1701 |
-
}
|
1702 |
-
|
1703 |
-
// ensure floating fields do not disturb tab wrap
|
1704 |
-
.acf-tab-wrap {
|
1705 |
-
clear: both;
|
1706 |
-
z-index: 1;
|
1707 |
-
}
|
1708 |
-
|
1709 |
-
// tab group
|
1710 |
-
.acf-tab-group {
|
1711 |
-
border-bottom: #ccc solid 1px;
|
1712 |
-
padding: 10px 10px 0;
|
1713 |
-
|
1714 |
-
li {
|
1715 |
-
margin: 0 0.5em 0 0;
|
1716 |
-
|
1717 |
-
a {
|
1718 |
-
padding: 5px 10px;
|
1719 |
-
display: block;
|
1720 |
-
|
1721 |
-
color: #555;
|
1722 |
-
font-size: 14px;
|
1723 |
-
font-weight: 600;
|
1724 |
-
line-height: 24px;
|
1725 |
-
|
1726 |
-
border: #ccc solid 1px;
|
1727 |
-
border-bottom: 0 none;
|
1728 |
-
text-decoration: none;
|
1729 |
-
background: #e5e5e5;
|
1730 |
-
transition: none;
|
1731 |
-
|
1732 |
-
&:hover {
|
1733 |
-
background: #FFF;
|
1734 |
-
}
|
1735 |
-
|
1736 |
-
&:focus {
|
1737 |
-
outline: none;
|
1738 |
-
box-shadow: none;
|
1739 |
-
}
|
1740 |
-
|
1741 |
-
&:empty {
|
1742 |
-
display: none;
|
1743 |
-
}
|
1744 |
-
|
1745 |
-
}
|
1746 |
-
|
1747 |
-
|
1748 |
-
// rtl
|
1749 |
-
html[dir="rtl"] & {
|
1750 |
-
margin: 0 0 0 0.5em;
|
1751 |
-
}
|
1752 |
-
|
1753 |
-
|
1754 |
-
// active
|
1755 |
-
&.active a {
|
1756 |
-
background: #F1F1F1;
|
1757 |
-
color: #000;
|
1758 |
-
padding-bottom: 6px;
|
1759 |
-
margin-bottom: -1px;
|
1760 |
-
position: relative;
|
1761 |
-
z-index: 1;
|
1762 |
-
}
|
1763 |
-
}
|
1764 |
-
}
|
1765 |
-
|
1766 |
-
|
1767 |
-
// inside acf-fields
|
1768 |
-
.acf-fields > .acf-tab-wrap {
|
1769 |
-
background: #F9F9F9;
|
1770 |
-
|
1771 |
-
// group
|
1772 |
-
.acf-tab-group {
|
1773 |
-
position: relative;
|
1774 |
-
z-index: 1;
|
1775 |
-
margin-bottom: -1px;
|
1776 |
-
border-top: #DFDFDF solid 1px;
|
1777 |
-
border-bottom: #DFDFDF solid 1px;
|
1778 |
-
|
1779 |
-
li a {
|
1780 |
-
background: #f1f1f1;
|
1781 |
-
|
1782 |
-
&:hover {
|
1783 |
-
background: #FFF;
|
1784 |
-
}
|
1785 |
-
}
|
1786 |
-
|
1787 |
-
li.active a {
|
1788 |
-
background: #FFFFFF;
|
1789 |
-
}
|
1790 |
-
}
|
1791 |
-
|
1792 |
-
// first child
|
1793 |
-
// fixes issue causing double border-top due to WP postbox .handlediv
|
1794 |
-
&:first-child .acf-tab-group {
|
1795 |
-
border-top: none;
|
1796 |
-
}
|
1797 |
-
|
1798 |
-
}
|
1799 |
-
|
1800 |
-
|
1801 |
-
// inside acf-fields.-left
|
1802 |
-
.acf-fields.-left > .acf-tab-wrap {
|
1803 |
-
|
1804 |
-
// group
|
1805 |
-
.acf-tab-group {
|
1806 |
-
padding-left: 20%;
|
1807 |
-
|
1808 |
-
/* mobile */
|
1809 |
-
@media screen and (max-width: $sm) {
|
1810 |
-
padding-left: 10px;
|
1811 |
-
}
|
1812 |
-
|
1813 |
-
|
1814 |
-
/* rtl */
|
1815 |
-
html[dir="rtl"] & {
|
1816 |
-
padding-left: 0;
|
1817 |
-
padding-right: 20%;
|
1818 |
-
|
1819 |
-
/* mobile */
|
1820 |
-
@media screen and (max-width: 850px) {
|
1821 |
-
padding-right: 10px;
|
1822 |
-
}
|
1823 |
-
}
|
1824 |
-
}
|
1825 |
-
}
|
1826 |
-
|
1827 |
-
|
1828 |
-
// left
|
1829 |
-
.acf-tab-wrap.-left {
|
1830 |
-
|
1831 |
-
// group
|
1832 |
-
.acf-tab-group {
|
1833 |
-
position: absolute;
|
1834 |
-
left: 0;
|
1835 |
-
width: 20%;
|
1836 |
-
border: 0 none;
|
1837 |
-
padding: 0 !important; /* important overrides 'left aligned labels' */
|
1838 |
-
margin: 1px 0 0;
|
1839 |
-
|
1840 |
-
// li
|
1841 |
-
li {
|
1842 |
-
float: none;
|
1843 |
-
margin: -1px 0 0;
|
1844 |
-
|
1845 |
-
a {
|
1846 |
-
border: 1px solid #ededed;
|
1847 |
-
font-size: 13px;
|
1848 |
-
line-height: 18px;
|
1849 |
-
color: #0073aa;
|
1850 |
-
padding: 10px;
|
1851 |
-
margin: 0;
|
1852 |
-
font-weight: normal;
|
1853 |
-
border-width: 1px 0;
|
1854 |
-
border-radius: 0;
|
1855 |
-
background: transparent;
|
1856 |
-
|
1857 |
-
&:hover {
|
1858 |
-
color: #00a0d2;
|
1859 |
-
}
|
1860 |
-
}
|
1861 |
-
|
1862 |
-
&.active a {
|
1863 |
-
border-color:#DFDFDF;
|
1864 |
-
color: #000;
|
1865 |
-
margin-right: -1px;
|
1866 |
-
background: #fff;
|
1867 |
-
}
|
1868 |
-
}
|
1869 |
-
|
1870 |
-
// rtl
|
1871 |
-
html[dir="rtl"] & {
|
1872 |
-
left: auto;
|
1873 |
-
right: 0;
|
1874 |
-
|
1875 |
-
li.active a {
|
1876 |
-
margin-right: 0;
|
1877 |
-
margin-left: -1px;
|
1878 |
-
}
|
1879 |
-
}
|
1880 |
-
}
|
1881 |
-
|
1882 |
-
// space before field
|
1883 |
-
.acf-field + &:before {
|
1884 |
-
content: "";
|
1885 |
-
display: block;
|
1886 |
-
position: relative;
|
1887 |
-
z-index: 1;
|
1888 |
-
height: 10px;
|
1889 |
-
border-top: #DFDFDF solid 1px;
|
1890 |
-
border-bottom: #DFDFDF solid 1px;
|
1891 |
-
margin-bottom: -1px;
|
1892 |
-
}
|
1893 |
-
|
1894 |
-
|
1895 |
-
// first child has negative margin issues
|
1896 |
-
&:first-child {
|
1897 |
-
|
1898 |
-
.acf-tab-group {
|
1899 |
-
|
1900 |
-
li:first-child a {
|
1901 |
-
border-top: none;
|
1902 |
-
}
|
1903 |
-
}
|
1904 |
-
}
|
1905 |
-
}
|
1906 |
-
|
1907 |
-
|
1908 |
-
/* sidebar */
|
1909 |
-
.acf-fields.-sidebar {
|
1910 |
-
padding: 0 0 0 20% !important;
|
1911 |
-
position: relative;
|
1912 |
-
|
1913 |
-
/* before */
|
1914 |
-
&:before {
|
1915 |
-
content: "";
|
1916 |
-
display: block;
|
1917 |
-
position: absolute;
|
1918 |
-
top: 0;
|
1919 |
-
left: 0;
|
1920 |
-
width: 20%;
|
1921 |
-
bottom: 0;
|
1922 |
-
border-right: #DFDFDF solid 1px;
|
1923 |
-
background: #F9F9F9;
|
1924 |
-
z-index: 1;
|
1925 |
-
}
|
1926 |
-
|
1927 |
-
|
1928 |
-
/* rtl */
|
1929 |
-
html[dir="rtl"] & {
|
1930 |
-
padding: 0 20% 0 0 !important;
|
1931 |
-
|
1932 |
-
&:before {
|
1933 |
-
border-left: #DFDFDF solid 1px;
|
1934 |
-
border-right-width: 0;
|
1935 |
-
left: auto;
|
1936 |
-
right: 0;
|
1937 |
-
}
|
1938 |
-
}
|
1939 |
-
|
1940 |
-
|
1941 |
-
// left
|
1942 |
-
&.-left {
|
1943 |
-
padding: 0 0 0 180px !important;
|
1944 |
-
|
1945 |
-
/* rtl */
|
1946 |
-
html[dir="rtl"] & {
|
1947 |
-
padding: 0 180px 0 0 !important;
|
1948 |
-
}
|
1949 |
-
|
1950 |
-
&:before {
|
1951 |
-
background: #F1F1F1;
|
1952 |
-
border-color: #dfdfdf;
|
1953 |
-
width: 180px;
|
1954 |
-
}
|
1955 |
-
|
1956 |
-
> .acf-tab-wrap.-left .acf-tab-group {
|
1957 |
-
width: 180px;
|
1958 |
-
|
1959 |
-
li a {
|
1960 |
-
border-color: #e4e4e4;
|
1961 |
-
}
|
1962 |
-
|
1963 |
-
li.active a {
|
1964 |
-
background: #F9F9F9;
|
1965 |
-
}
|
1966 |
-
|
1967 |
-
}
|
1968 |
-
}
|
1969 |
-
|
1970 |
-
// fix double border
|
1971 |
-
> .acf-field-tab + .acf-field {
|
1972 |
-
border-top: none;
|
1973 |
-
}
|
1974 |
-
}
|
1975 |
-
|
1976 |
-
|
1977 |
-
// clear
|
1978 |
-
.acf-fields.-clear > .acf-tab-wrap {
|
1979 |
-
background: transparent;
|
1980 |
-
|
1981 |
-
// group
|
1982 |
-
.acf-tab-group {
|
1983 |
-
margin-top: 0;
|
1984 |
-
border-top: none;
|
1985 |
-
padding-left: 0;
|
1986 |
-
padding-right: 0;
|
1987 |
-
|
1988 |
-
li a {
|
1989 |
-
background: #e5e5e5;
|
1990 |
-
|
1991 |
-
&:hover {
|
1992 |
-
background: #fff;
|
1993 |
-
}
|
1994 |
-
}
|
1995 |
-
|
1996 |
-
li.active a {
|
1997 |
-
background: #f1f1f1;
|
1998 |
-
}
|
1999 |
-
}
|
2000 |
-
}
|
2001 |
-
|
2002 |
-
|
2003 |
-
/* seamless */
|
2004 |
-
.acf-postbox.seamless {
|
2005 |
-
|
2006 |
-
// sidebar
|
2007 |
-
> .acf-fields.-sidebar {
|
2008 |
-
margin-left: 0 !important;
|
2009 |
-
|
2010 |
-
&:before {
|
2011 |
-
background: transparent;
|
2012 |
-
}
|
2013 |
-
}
|
2014 |
-
|
2015 |
-
// default
|
2016 |
-
> .acf-fields > .acf-tab-wrap {
|
2017 |
-
background: transparent;
|
2018 |
-
margin-bottom: 10px;
|
2019 |
-
padding-left: $fx;
|
2020 |
-
padding-right: $fx;
|
2021 |
-
|
2022 |
-
.acf-tab-group {
|
2023 |
-
border-top: 0 none;
|
2024 |
-
|
2025 |
-
li a {
|
2026 |
-
background: #e5e5e5;
|
2027 |
-
|
2028 |
-
&:hover {
|
2029 |
-
background: #fff;
|
2030 |
-
}
|
2031 |
-
}
|
2032 |
-
|
2033 |
-
li.active a {
|
2034 |
-
background: #f1f1f1;
|
2035 |
-
}
|
2036 |
-
}
|
2037 |
-
}
|
2038 |
-
|
2039 |
-
// left tabs
|
2040 |
-
> .acf-fields > .acf-tab-wrap.-left {
|
2041 |
-
|
2042 |
-
&:before {
|
2043 |
-
border-top: none;
|
2044 |
-
height: auto;
|
2045 |
-
}
|
2046 |
-
|
2047 |
-
.acf-tab-group {
|
2048 |
-
margin-bottom: 0;
|
2049 |
-
|
2050 |
-
li a {
|
2051 |
-
border-width: 1px 0 1px 1px !important;
|
2052 |
-
border-color: #cccccc;
|
2053 |
-
background: #e5e5e5;
|
2054 |
-
}
|
2055 |
-
|
2056 |
-
li.active a {
|
2057 |
-
background: #f1f1f1;
|
2058 |
-
}
|
2059 |
-
}
|
2060 |
-
|
2061 |
-
}
|
2062 |
-
}
|
2063 |
-
|
2064 |
-
|
2065 |
-
// menu
|
2066 |
-
.menu-edit,
|
2067 |
-
.widget {
|
2068 |
-
.acf-fields.-clear > .acf-tab-wrap .acf-tab-group li {
|
2069 |
-
a { background: #f1f1f1; }
|
2070 |
-
a:hover, &.active a { background: #fff; }
|
2071 |
-
}
|
2072 |
-
}
|
2073 |
-
|
2074 |
-
.compat-item .acf-tab-wrap td {
|
2075 |
-
display: block;
|
2076 |
-
}
|
2077 |
-
|
2078 |
-
|
2079 |
-
|
2080 |
-
/* within gallery sidebar */
|
2081 |
-
.acf-gallery-side .acf-tab-wrap {
|
2082 |
-
border-top: 0 none !important;
|
2083 |
-
}
|
2084 |
-
|
2085 |
-
.acf-gallery-side .acf-tab-wrap .acf-tab-group {
|
2086 |
-
margin: 10px 0 !important;
|
2087 |
-
padding: 0 !important;
|
2088 |
-
}
|
2089 |
-
|
2090 |
-
.acf-gallery-side .acf-tab-group li.active a {
|
2091 |
-
background: #F9F9F9 !important;
|
2092 |
-
}
|
2093 |
-
|
2094 |
-
|
2095 |
-
|
2096 |
-
/* withing widget */
|
2097 |
-
.widget .acf-tab-group {
|
2098 |
-
border-bottom-color: #e8e8e8;
|
2099 |
-
}
|
2100 |
-
|
2101 |
-
.widget .acf-tab-group li a {
|
2102 |
-
background: #F1F1F1;
|
2103 |
-
}
|
2104 |
-
|
2105 |
-
.widget .acf-tab-group li.active a {
|
2106 |
-
background: #fff;
|
2107 |
-
}
|
2108 |
-
|
2109 |
-
|
2110 |
-
/* media popup (edit image) */
|
2111 |
-
.media-modal.acf-expanded .compat-attachment-fields > tbody > tr.acf-tab-wrap .acf-tab-group {
|
2112 |
-
padding-left: 23%;
|
2113 |
-
border-bottom-color: #DDDDDD;
|
2114 |
-
}
|
2115 |
-
|
2116 |
-
|
2117 |
-
/* table */
|
2118 |
-
|
2119 |
-
|
2120 |
-
.form-table > tbody > tr.acf-tab-wrap .acf-tab-group {
|
2121 |
-
padding: 0 5px 0 210px;
|
2122 |
-
}
|
2123 |
-
|
2124 |
-
/* rtl */
|
2125 |
-
html[dir="rtl"] .form-table > tbody > tr.acf-tab-wrap .acf-tab-group {
|
2126 |
-
padding: 0 210px 0 5px;
|
2127 |
-
}
|
2128 |
-
|
2129 |
-
|
2130 |
-
/*--------------------------------------------------------------------------------------------
|
2131 |
-
*
|
2132 |
-
* oembed
|
2133 |
-
*
|
2134 |
-
*--------------------------------------------------------------------------------------------*/
|
2135 |
-
|
2136 |
-
.acf-oembed {
|
2137 |
-
position: relative;
|
2138 |
-
border: #DFDFDF solid 1px;
|
2139 |
-
background: #fff;
|
2140 |
-
|
2141 |
-
.title {
|
2142 |
-
position: relative;
|
2143 |
-
border-bottom: #DFDFDF solid 1px;
|
2144 |
-
padding: 5px 10px;
|
2145 |
-
|
2146 |
-
.input-search {
|
2147 |
-
margin: 0;
|
2148 |
-
font-size: 14px;
|
2149 |
-
line-height: 30px;
|
2150 |
-
height: 30px;
|
2151 |
-
padding: 0;
|
2152 |
-
border: 0 none;
|
2153 |
-
box-shadow: none;
|
2154 |
-
border-radius: 0;
|
2155 |
-
font-family: inherit;
|
2156 |
-
cursor: text;
|
2157 |
-
}
|
2158 |
-
|
2159 |
-
.acf-actions {
|
2160 |
-
padding: 6px;
|
2161 |
-
}
|
2162 |
-
}
|
2163 |
-
|
2164 |
-
.canvas {
|
2165 |
-
position: relative;
|
2166 |
-
min-height: 250px;
|
2167 |
-
background: #F9F9F9;
|
2168 |
-
|
2169 |
-
.canvas-media {
|
2170 |
-
position: relative;
|
2171 |
-
z-index: 1;
|
2172 |
-
}
|
2173 |
-
|
2174 |
-
iframe {
|
2175 |
-
display: block;
|
2176 |
-
margin: 0;
|
2177 |
-
padding: 0;
|
2178 |
-
width: 100%;
|
2179 |
-
}
|
2180 |
-
|
2181 |
-
.acf-icon.-picture {
|
2182 |
-
@include centered();
|
2183 |
-
z-index: 0;
|
2184 |
-
|
2185 |
-
height: 42px;
|
2186 |
-
width: 42px;
|
2187 |
-
font-size: 42px;
|
2188 |
-
color: #999;
|
2189 |
-
}
|
2190 |
-
|
2191 |
-
.acf-loading-overlay {
|
2192 |
-
background: rgba(255,255,255,0.9);
|
2193 |
-
}
|
2194 |
-
|
2195 |
-
.canvas-error {
|
2196 |
-
position: absolute;
|
2197 |
-
top: 50%;
|
2198 |
-
left: 0%;
|
2199 |
-
right: 0%;
|
2200 |
-
margin: -9px 0 0 0;
|
2201 |
-
text-align: center;
|
2202 |
-
display: none;
|
2203 |
-
|
2204 |
-
p {
|
2205 |
-
padding: 8px;
|
2206 |
-
margin: 0;
|
2207 |
-
display: inline;
|
2208 |
-
}
|
2209 |
-
}
|
2210 |
-
}
|
2211 |
-
|
2212 |
-
// has value
|
2213 |
-
&.has-value {
|
2214 |
-
.canvas {
|
2215 |
-
min-height: 50px;
|
2216 |
-
}
|
2217 |
-
|
2218 |
-
.input-search {
|
2219 |
-
font-weight: bold;
|
2220 |
-
}
|
2221 |
-
|
2222 |
-
.title:hover .acf-actions {
|
2223 |
-
display: block;
|
2224 |
-
}
|
2225 |
-
}
|
2226 |
-
|
2227 |
-
}
|
2228 |
-
|
2229 |
-
/*--------------------------------------------------------------------------------------------
|
2230 |
-
*
|
2231 |
-
* Image
|
2232 |
-
*
|
2233 |
-
*--------------------------------------------------------------------------------------------*/
|
2234 |
-
|
2235 |
-
.acf-image-uploader {
|
2236 |
-
@include clearfix();
|
2237 |
-
position: relative;
|
2238 |
-
|
2239 |
-
|
2240 |
-
p {
|
2241 |
-
margin: 0;
|
2242 |
-
}
|
2243 |
-
|
2244 |
-
|
2245 |
-
/* image wrap*/
|
2246 |
-
.image-wrap {
|
2247 |
-
position: relative;
|
2248 |
-
float: left;
|
2249 |
-
|
2250 |
-
img {
|
2251 |
-
max-width: 100%;
|
2252 |
-
width: auto;
|
2253 |
-
height: auto;
|
2254 |
-
display: block;
|
2255 |
-
min-width: 30px;
|
2256 |
-
min-height: 30px;
|
2257 |
-
background: #f1f1f1;
|
2258 |
-
margin: 0;
|
2259 |
-
padding: 0;
|
2260 |
-
|
2261 |
-
|
2262 |
-
/* svg */
|
2263 |
-
&[src$=".svg"] {
|
2264 |
-
min-height: 100px;
|
2265 |
-
min-width: 100px;
|
2266 |
-
}
|
2267 |
-
}
|
2268 |
-
|
2269 |
-
|
2270 |
-
/* hover */
|
2271 |
-
&:hover .acf-actions {
|
2272 |
-
display: block;
|
2273 |
-
}
|
2274 |
-
}
|
2275 |
-
|
2276 |
-
|
2277 |
-
/* input */
|
2278 |
-
input.button {
|
2279 |
-
width: auto;
|
2280 |
-
}
|
2281 |
-
|
2282 |
-
|
2283 |
-
/* rtl */
|
2284 |
-
html[dir="rtl"] & {
|
2285 |
-
|
2286 |
-
.image-wrap {
|
2287 |
-
float: right;
|
2288 |
-
}
|
2289 |
-
|
2290 |
-
}
|
2291 |
-
|
2292 |
-
}
|
2293 |
-
|
2294 |
-
|
2295 |
-
/*--------------------------------------------------------------------------------------------
|
2296 |
-
*
|
2297 |
-
* File
|
2298 |
-
*
|
2299 |
-
*--------------------------------------------------------------------------------------------*/
|
2300 |
-
|
2301 |
-
.acf-file-uploader {
|
2302 |
-
position: relative;
|
2303 |
-
|
2304 |
-
p {
|
2305 |
-
margin: 0;
|
2306 |
-
}
|
2307 |
-
|
2308 |
-
.file-wrap {
|
2309 |
-
border: #DFDFDF solid 1px;
|
2310 |
-
min-height: 84px;
|
2311 |
-
position: relative;
|
2312 |
-
background: #fff;
|
2313 |
-
}
|
2314 |
-
|
2315 |
-
.file-icon {
|
2316 |
-
position: absolute;
|
2317 |
-
top: 0;
|
2318 |
-
left: 0;
|
2319 |
-
bottom: 0;
|
2320 |
-
padding: 10px;
|
2321 |
-
background: #F1F1F1;
|
2322 |
-
border-right: #E5E5E5 solid 1px;
|
2323 |
-
|
2324 |
-
img {
|
2325 |
-
display: block;
|
2326 |
-
padding: 0;
|
2327 |
-
margin: 0;
|
2328 |
-
max-width: 48px;
|
2329 |
-
}
|
2330 |
-
}
|
2331 |
-
|
2332 |
-
.file-info {
|
2333 |
-
padding: 10px;
|
2334 |
-
margin-left: 69px;
|
2335 |
-
|
2336 |
-
p {
|
2337 |
-
margin: 0 0 2px;
|
2338 |
-
font-size: 13px;
|
2339 |
-
line-height: 1.4em;
|
2340 |
-
word-break: break-all;
|
2341 |
-
}
|
2342 |
-
|
2343 |
-
a {
|
2344 |
-
text-decoration: none;
|
2345 |
-
}
|
2346 |
-
}
|
2347 |
-
|
2348 |
-
/* hover */
|
2349 |
-
&:hover .acf-actions {
|
2350 |
-
display: block;
|
2351 |
-
}
|
2352 |
-
|
2353 |
-
|
2354 |
-
/* rtl */
|
2355 |
-
html[dir="rtl"] & {
|
2356 |
-
|
2357 |
-
.file-icon {
|
2358 |
-
left: auto;
|
2359 |
-
right: 0;
|
2360 |
-
border-left: #E5E5E5 solid 1px;
|
2361 |
-
border-right: none;
|
2362 |
-
}
|
2363 |
-
|
2364 |
-
.file-info {
|
2365 |
-
margin-right: 69px;
|
2366 |
-
margin-left: 0;
|
2367 |
-
}
|
2368 |
-
}
|
2369 |
-
|
2370 |
-
}
|
2371 |
-
|
2372 |
-
|
2373 |
-
/*---------------------------------------------------------------------------------------------
|
2374 |
-
*
|
2375 |
-
* Date Picker
|
2376 |
-
*
|
2377 |
-
*---------------------------------------------------------------------------------------------*/
|
2378 |
-
|
2379 |
-
.acf-ui-datepicker .ui-datepicker {
|
2380 |
-
z-index: 900000 !important;
|
2381 |
-
|
2382 |
-
.ui-widget-header a {
|
2383 |
-
cursor: pointer;
|
2384 |
-
transition: none;
|
2385 |
-
}
|
2386 |
-
}
|
2387 |
-
|
2388 |
-
|
2389 |
-
/* fix highlight state overriding hover / active */
|
2390 |
-
.acf-ui-datepicker .ui-state-highlight.ui-state-hover {
|
2391 |
-
border: 1px solid #98b7e8 !important;
|
2392 |
-
background: #98b7e8 !important;
|
2393 |
-
font-weight: normal !important;
|
2394 |
-
color: #ffffff !important;
|
2395 |
-
}
|
2396 |
-
|
2397 |
-
.acf-ui-datepicker .ui-state-highlight.ui-state-active {
|
2398 |
-
border: 1px solid #3875d7 !important;
|
2399 |
-
background: #3875d7 !important;
|
2400 |
-
font-weight: normal !important;
|
2401 |
-
color: #ffffff !important;
|
2402 |
-
}
|
2403 |
-
|
2404 |
-
|
2405 |
-
/*---------------------------------------------------------------------------------------------
|
2406 |
-
*
|
2407 |
-
* Separator field
|
2408 |
-
*
|
2409 |
-
*---------------------------------------------------------------------------------------------*/
|
2410 |
-
|
2411 |
-
.acf-field-separator {
|
2412 |
-
|
2413 |
-
.acf-label {
|
2414 |
-
margin-bottom: 0;
|
2415 |
-
|
2416 |
-
label {
|
2417 |
-
font-weight: normal;
|
2418 |
-
}
|
2419 |
-
}
|
2420 |
-
|
2421 |
-
.acf-input {
|
2422 |
-
display: none;
|
2423 |
-
}
|
2424 |
-
|
2425 |
-
|
2426 |
-
/* fields */
|
2427 |
-
.acf-fields > & {
|
2428 |
-
background: #f9f9f9;
|
2429 |
-
border-bottom: 1px solid #dfdfdf;
|
2430 |
-
border-top: 1px solid #dfdfdf;
|
2431 |
-
margin-bottom: -1px;
|
2432 |
-
z-index: 2;
|
2433 |
-
}
|
2434 |
-
|
2435 |
-
}
|
2436 |
-
|
2437 |
-
|
2438 |
-
/*---------------------------------------------------------------------------------------------
|
2439 |
-
*
|
2440 |
-
* Taxonomy
|
2441 |
-
*
|
2442 |
-
*---------------------------------------------------------------------------------------------*/
|
2443 |
-
|
2444 |
-
.acf-taxonomy-field {
|
2445 |
-
position: relative;
|
2446 |
-
|
2447 |
-
.categorychecklist-holder {
|
2448 |
-
border: #DFDFDF solid 1px;
|
2449 |
-
border-radius: 3px;
|
2450 |
-
max-height: 200px;
|
2451 |
-
overflow: auto;
|
2452 |
-
}
|
2453 |
-
|
2454 |
-
.acf-checkbox-list {
|
2455 |
-
margin: 0;
|
2456 |
-
padding: 10px;
|
2457 |
-
|
2458 |
-
ul.children {
|
2459 |
-
padding-left: 18px;
|
2460 |
-
}
|
2461 |
-
}
|
2462 |
-
|
2463 |
-
|
2464 |
-
/* hover */
|
2465 |
-
&:hover {
|
2466 |
-
.acf-actions {
|
2467 |
-
display: block;
|
2468 |
-
}
|
2469 |
-
}
|
2470 |
-
|
2471 |
-
|
2472 |
-
/* select */
|
2473 |
-
&[data-ftype="select"] {
|
2474 |
-
.acf-actions {
|
2475 |
-
padding: 0;
|
2476 |
-
margin: -9px;
|
2477 |
-
}
|
2478 |
-
}
|
2479 |
-
|
2480 |
-
}
|
2481 |
-
|
2482 |
-
|
2483 |
-
/*---------------------------------------------------------------------------------------------
|
2484 |
-
*
|
2485 |
-
* Range
|
2486 |
-
*
|
2487 |
-
*---------------------------------------------------------------------------------------------*/
|
2488 |
-
|
2489 |
-
.acf-range-wrap {
|
2490 |
-
|
2491 |
-
.acf-append,
|
2492 |
-
.acf-prepend {
|
2493 |
-
display: inline-block;
|
2494 |
-
vertical-align: middle;
|
2495 |
-
line-height: 28px;
|
2496 |
-
margin: 0 7px 0 0;
|
2497 |
-
}
|
2498 |
-
|
2499 |
-
.acf-append {
|
2500 |
-
margin: 0 0 0 7px;
|
2501 |
-
}
|
2502 |
-
|
2503 |
-
input[type="range"] {
|
2504 |
-
display: inline-block;
|
2505 |
-
padding: 0;
|
2506 |
-
margin: 0;
|
2507 |
-
vertical-align: middle;
|
2508 |
-
height: 28px;
|
2509 |
-
|
2510 |
-
&:focus {
|
2511 |
-
outline: none;
|
2512 |
-
}
|
2513 |
-
|
2514 |
-
}
|
2515 |
-
|
2516 |
-
input[type="number"] {
|
2517 |
-
display: inline-block;
|
2518 |
-
min-width: 3em;
|
2519 |
-
margin-left: 10px;
|
2520 |
-
vertical-align: middle;
|
2521 |
-
}
|
2522 |
-
|
2523 |
-
|
2524 |
-
/* rtl */
|
2525 |
-
html[dir="rtl"] & {
|
2526 |
-
|
2527 |
-
input[type="number"] {
|
2528 |
-
margin-right: 10px;
|
2529 |
-
margin-left: 0;
|
2530 |
-
}
|
2531 |
-
|
2532 |
-
.acf-append { margin: 0 7px 0 0; }
|
2533 |
-
.acf-prepend { margin: 0 0 0 7px; }
|
2534 |
-
|
2535 |
-
}
|
2536 |
-
|
2537 |
-
}
|
2538 |
-
|
2539 |
-
|
2540 |
-
/*---------------------------------------------------------------------------------------------
|
2541 |
-
*
|
2542 |
-
* acf-accordion
|
2543 |
-
*
|
2544 |
-
*---------------------------------------------------------------------------------------------*/
|
2545 |
-
|
2546 |
-
.acf-accordion {
|
2547 |
-
margin: 0;
|
2548 |
-
padding: 0;
|
2549 |
-
background: #fff;
|
2550 |
-
|
2551 |
-
/* title */
|
2552 |
-
.acf-accordion-title {
|
2553 |
-
margin: 0;
|
2554 |
-
padding: 12px;
|
2555 |
-
font-weight: bold;
|
2556 |
-
cursor: pointer;
|
2557 |
-
font-size: inherit;
|
2558 |
-
font-size: 13px;
|
2559 |
-
line-height: 1.4em;
|
2560 |
-
|
2561 |
-
label {
|
2562 |
-
margin: 0;
|
2563 |
-
padding: 0;
|
2564 |
-
font-size: 13px;
|
2565 |
-
line-height: 1.4em;
|
2566 |
-
}
|
2567 |
-
|
2568 |
-
p {
|
2569 |
-
font-weight: normal;
|
2570 |
-
}
|
2571 |
-
|
2572 |
-
.acf-accordion-icon {
|
2573 |
-
float: right;
|
2574 |
-
}
|
2575 |
-
}
|
2576 |
-
|
2577 |
-
.acf-accordion-content {
|
2578 |
-
margin: 0;
|
2579 |
-
padding: 0 12px 12px;
|
2580 |
-
display: none;
|
2581 |
-
}
|
2582 |
-
|
2583 |
-
|
2584 |
-
/* open */
|
2585 |
-
&.-open {
|
2586 |
-
|
2587 |
-
> .acf-accordion-content {
|
2588 |
-
display: block;
|
2589 |
-
}
|
2590 |
-
|
2591 |
-
}
|
2592 |
-
}
|
2593 |
-
|
2594 |
-
|
2595 |
-
/* field specific */
|
2596 |
-
.acf-field.acf-accordion {
|
2597 |
-
padding: 0 !important;
|
2598 |
-
border-color: #dfdfdf;
|
2599 |
-
|
2600 |
-
.acf-accordion-title {
|
2601 |
-
padding: 12px;
|
2602 |
-
width: auto !important;
|
2603 |
-
float: none !important;
|
2604 |
-
width: auto !important;
|
2605 |
-
}
|
2606 |
-
|
2607 |
-
.acf-accordion-content {
|
2608 |
-
padding: 0;
|
2609 |
-
float: none !important;
|
2610 |
-
width: auto !important;
|
2611 |
-
|
2612 |
-
> .acf-fields {
|
2613 |
-
border-top: #EEEEEE solid 1px;
|
2614 |
-
|
2615 |
-
&.-clear {
|
2616 |
-
padding: 0 $fx $fy;
|
2617 |
-
}
|
2618 |
-
}
|
2619 |
-
}
|
2620 |
-
}
|
2621 |
-
|
2622 |
-
|
2623 |
-
/* field specific (left) */
|
2624 |
-
.acf-fields.-left > .acf-field.acf-accordion {
|
2625 |
-
padding: 0 !important;
|
2626 |
-
|
2627 |
-
&:before {
|
2628 |
-
display: none;
|
2629 |
-
}
|
2630 |
-
|
2631 |
-
.acf-accordion-title {
|
2632 |
-
width: auto;
|
2633 |
-
margin: 0 !important;
|
2634 |
-
padding: 12px;
|
2635 |
-
float: none !important;
|
2636 |
-
}
|
2637 |
-
|
2638 |
-
.acf-accordion-content {
|
2639 |
-
padding: 0 !important;
|
2640 |
-
}
|
2641 |
-
}
|
2642 |
-
|
2643 |
-
|
2644 |
-
/* field specific (clear) */
|
2645 |
-
.acf-fields.-clear > .acf-field.acf-accordion {
|
2646 |
-
border: #cccccc solid 1px;
|
2647 |
-
background: transparent;
|
2648 |
-
|
2649 |
-
+ .acf-field.acf-accordion {
|
2650 |
-
margin-top: -16px;
|
2651 |
-
}
|
2652 |
-
}
|
2653 |
-
|
2654 |
-
|
2655 |
-
/* table */
|
2656 |
-
tr.acf-field.acf-accordion {
|
2657 |
-
background: transparent;
|
2658 |
-
|
2659 |
-
> .acf-input {
|
2660 |
-
padding: 0 !important;
|
2661 |
-
border: #cccccc solid 1px;
|
2662 |
-
}
|
2663 |
-
|
2664 |
-
.acf-accordion-content {
|
2665 |
-
padding: 0 12px 12px;
|
2666 |
-
}
|
2667 |
-
}
|
2668 |
-
|
2669 |
-
|
2670 |
-
/* #addtag */
|
2671 |
-
#addtag div.acf-field.error {
|
2672 |
-
border: 0 none;
|
2673 |
-
padding: 8px 0;
|
2674 |
-
}
|
2675 |
-
|
2676 |
-
|
2677 |
-
#addtag > .acf-field.acf-accordion {
|
2678 |
-
padding-right: 0;
|
2679 |
-
margin-right: 5%;
|
2680 |
-
|
2681 |
-
+ p.submit {
|
2682 |
-
margin-top: 0;
|
2683 |
-
}
|
2684 |
-
}
|
2685 |
-
|
2686 |
-
|
2687 |
-
|
2688 |
-
/* border */
|
2689 |
-
tr.acf-accordion {
|
2690 |
-
margin: 15px 0 !important;
|
2691 |
-
|
2692 |
-
+ tr.acf-accordion {
|
2693 |
-
margin-top: -16px !important;
|
2694 |
-
}
|
2695 |
-
}
|
2696 |
-
|
2697 |
-
|
2698 |
-
/* seamless */
|
2699 |
-
.acf-postbox.seamless > .acf-fields > .acf-accordion {
|
2700 |
-
margin-left: $field_padding_x !important;
|
2701 |
-
margin-right: $field_padding_x !important;
|
2702 |
-
}
|
2703 |
-
|
2704 |
-
|
2705 |
-
/* rtl */
|
2706 |
-
html[dir="rtl"] .acf-accordion {
|
2707 |
-
|
2708 |
-
}
|
2709 |
-
|
2710 |
-
|
2711 |
-
/* menu item */
|
2712 |
-
/*
|
2713 |
-
.menu-item-settings > .field-acf > .acf-field.acf-accordion {
|
2714 |
-
border: #dfdfdf solid 1px;
|
2715 |
-
margin: 10px -13px 10px -11px;
|
2716 |
-
|
2717 |
-
+ .acf-field.acf-accordion {
|
2718 |
-
margin-top: -11px;
|
2719 |
-
}
|
2720 |
-
}
|
2721 |
-
*/
|
2722 |
-
|
2723 |
-
|
2724 |
-
/* widget */
|
2725 |
-
.widget .widget-content > .acf-field.acf-accordion {
|
2726 |
-
border: #dfdfdf solid 1px;
|
2727 |
-
margin-bottom: 10px;
|
2728 |
-
|
2729 |
-
.acf-accordion-title {
|
2730 |
-
margin-bottom: 0;
|
2731 |
-
}
|
2732 |
-
|
2733 |
-
+ .acf-field.acf-accordion {
|
2734 |
-
margin-top: -11px;
|
2735 |
-
}
|
2736 |
-
}
|
2737 |
-
|
2738 |
-
|
2739 |
-
// seamless
|
2740 |
-
.acf-postbox.seamless > .acf-fields > .acf-field.acf-accordion {
|
2741 |
-
border: #e5e5e5 solid 1px;
|
2742 |
-
|
2743 |
-
// siblings
|
2744 |
-
+ .acf-field.acf-accordion {
|
2745 |
-
margin-top: -1px;
|
2746 |
-
}
|
2747 |
-
}
|
2748 |
-
|
2749 |
-
|
2750 |
-
// media modal
|
2751 |
-
.media-modal .compat-attachment-fields .acf-field.acf-accordion {
|
2752 |
-
|
2753 |
-
// siblings
|
2754 |
-
+ .acf-field.acf-accordion {
|
2755 |
-
margin-top: -1px;
|
2756 |
-
}
|
2757 |
-
|
2758 |
-
// input
|
2759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------
|
2 |
-
*
|
3 |
-
* User
|
4 |
-
*
|
5 |
-
*--------------------------------------------------------------------------------------------*/
|
6 |
-
|
7 |
-
.form-table > tbody {
|
8 |
-
|
9 |
-
/* field */
|
10 |
-
> .acf-field {
|
11 |
-
|
12 |
-
/* label */
|
13 |
-
> .acf-label {
|
14 |
-
padding: 20px 10px 20px 0;
|
15 |
-
width: 210px;
|
16 |
-
|
17 |
-
/* rtl */
|
18 |
-
html[dir="rtl"] & {
|
19 |
-
padding: 20px 0 20px 10px;
|
20 |
-
}
|
21 |
-
|
22 |
-
label {
|
23 |
-
font-size: 14px;
|
24 |
-
color: #23282d;
|
25 |
-
}
|
26 |
-
|
27 |
-
}
|
28 |
-
|
29 |
-
|
30 |
-
/* input */
|
31 |
-
> .acf-input {
|
32 |
-
padding: 15px 10px;
|
33 |
-
|
34 |
-
/* rtl */
|
35 |
-
html[dir="rtl"] & {
|
36 |
-
padding: 15px 10px 15px 5%;
|
37 |
-
}
|
38 |
-
}
|
39 |
-
|
40 |
-
}
|
41 |
-
|
42 |
-
|
43 |
-
/* tab wrap */
|
44 |
-
> .acf-tab-wrap td {
|
45 |
-
padding: 15px 5% 15px 0;
|
46 |
-
|
47 |
-
/* rtl */
|
48 |
-
html[dir="rtl"] & {
|
49 |
-
padding: 15px 0 15px 5%;
|
50 |
-
}
|
51 |
-
|
52 |
-
}
|
53 |
-
|
54 |
-
|
55 |
-
/* misc */
|
56 |
-
.form-table th.acf-th {
|
57 |
-
width: auto;
|
58 |
-
}
|
59 |
-
|
60 |
-
}
|
61 |
-
|
62 |
-
#your-profile,
|
63 |
-
#createuser {
|
64 |
-
|
65 |
-
/* override for user css */
|
66 |
-
.acf-field input[type="text"],
|
67 |
-
.acf-field input[type="password"],
|
68 |
-
.acf-field input[type="number"],
|
69 |
-
.acf-field input[type="search"],
|
70 |
-
.acf-field input[type="email"],
|
71 |
-
.acf-field input[type="url"],
|
72 |
-
.acf-field select {
|
73 |
-
max-width: 25em;
|
74 |
-
}
|
75 |
-
|
76 |
-
.acf-field textarea {
|
77 |
-
max-width: 500px;
|
78 |
-
}
|
79 |
-
|
80 |
-
|
81 |
-
/* allow sub fields to display correctly */
|
82 |
-
.acf-field .acf-field input[type="text"],
|
83 |
-
.acf-field .acf-field input[type="password"],
|
84 |
-
.acf-field .acf-field input[type="number"],
|
85 |
-
.acf-field .acf-field input[type="search"],
|
86 |
-
.acf-field .acf-field input[type="email"],
|
87 |
-
.acf-field .acf-field input[type="url"],
|
88 |
-
.acf-field .acf-field textarea,
|
89 |
-
.acf-field .acf-field select {
|
90 |
-
max-width: none;
|
91 |
-
}
|
92 |
-
}
|
93 |
-
|
94 |
-
#registerform {
|
95 |
-
|
96 |
-
h2 {
|
97 |
-
margin: 1em 0;
|
98 |
-
}
|
99 |
-
|
100 |
-
.acf-field .acf-label {
|
101 |
-
margin-bottom: 0;
|
102 |
-
|
103 |
-
label {
|
104 |
-
font-weight: normal;
|
105 |
-
font-size: 14px;
|
106 |
-
}
|
107 |
-
}
|
108 |
-
|
109 |
-
p.submit {
|
110 |
-
text-align: right;
|
111 |
-
}
|
112 |
-
|
113 |
-
}
|
114 |
-
|
115 |
-
/*--------------------------------------------------------------------------------------------
|
116 |
-
*
|
117 |
-
* Term
|
118 |
-
*
|
119 |
-
*--------------------------------------------------------------------------------------------*/
|
120 |
-
|
121 |
-
// add term
|
122 |
-
#acf-term-fields {
|
123 |
-
padding-right: 5%;
|
124 |
-
|
125 |
-
> .acf-field {
|
126 |
-
|
127 |
-
> .acf-label {
|
128 |
-
margin: 0;
|
129 |
-
|
130 |
-
label {
|
131 |
-
font-size: 12px;
|
132 |
-
font-weight: normal;
|
133 |
-
}
|
134 |
-
}
|
135 |
-
}
|
136 |
-
|
137 |
-
}
|
138 |
-
|
139 |
-
p.submit .spinner,
|
140 |
-
p.submit .acf-spinner {
|
141 |
-
vertical-align: top;
|
142 |
-
float: none;
|
143 |
-
margin: 4px 4px 0;
|
144 |
-
}
|
145 |
-
|
146 |
-
|
147 |
-
// edit term
|
148 |
-
#edittag .acf-fields.-left {
|
149 |
-
|
150 |
-
> .acf-field {
|
151 |
-
padding-left: 220px;
|
152 |
-
|
153 |
-
&:before {
|
154 |
-
width: 209px;
|
155 |
-
}
|
156 |
-
|
157 |
-
> .acf-label {
|
158 |
-
width: 220px;
|
159 |
-
margin-left: -220px;
|
160 |
-
padding: 0 10px;
|
161 |
-
}
|
162 |
-
|
163 |
-
> .acf-input {
|
164 |
-
padding: 0;
|
165 |
-
}
|
166 |
-
}
|
167 |
-
}
|
168 |
-
|
169 |
-
#edittag > .acf-fields.-left {
|
170 |
-
width: 96%;
|
171 |
-
|
172 |
-
> .acf-field {
|
173 |
-
|
174 |
-
> .acf-label {
|
175 |
-
padding-left: 0;
|
176 |
-
}
|
177 |
-
}
|
178 |
-
}
|
179 |
-
|
180 |
-
|
181 |
-
/*--------------------------------------------------------------------------------------------
|
182 |
-
*
|
183 |
-
* Comment
|
184 |
-
*
|
185 |
-
*--------------------------------------------------------------------------------------------*/
|
186 |
-
|
187 |
-
.editcomment td:first-child {
|
188 |
-
white-space: nowrap;
|
189 |
-
width: 131px;
|
190 |
-
}
|
191 |
-
|
192 |
-
|
193 |
-
/*--------------------------------------------------------------------------------------------
|
194 |
-
*
|
195 |
-
* Widget
|
196 |
-
*
|
197 |
-
*--------------------------------------------------------------------------------------------*/
|
198 |
-
|
199 |
-
#widgets-right .widget .acf-field .description {
|
200 |
-
padding-left: 0;
|
201 |
-
padding-right: 0;
|
202 |
-
}
|
203 |
-
|
204 |
-
.acf-widget-fields {
|
205 |
-
|
206 |
-
> .acf-field {
|
207 |
-
|
208 |
-
.acf-label {
|
209 |
-
margin-bottom: 5px;
|
210 |
-
|
211 |
-
label {
|
212 |
-
font-weight: normal;
|
213 |
-
margin: 0;
|
214 |
-
}
|
215 |
-
}
|
216 |
-
}
|
217 |
-
}
|
218 |
-
|
219 |
-
/*--------------------------------------------------------------------------------------------
|
220 |
-
*
|
221 |
-
* Nav Menu
|
222 |
-
*
|
223 |
-
*--------------------------------------------------------------------------------------------*/
|
224 |
-
|
225 |
-
.acf-menu-settings {
|
226 |
-
border-top: 1px solid #eee;
|
227 |
-
margin-top: 2em;
|
228 |
-
|
229 |
-
// seamless
|
230 |
-
&.-seamless {
|
231 |
-
border-top: none;
|
232 |
-
margin-top: 15px;
|
233 |
-
|
234 |
-
> h2 { display: none; }
|
235 |
-
}
|
236 |
-
|
237 |
-
// Fix relationship conflict.
|
238 |
-
.list li {
|
239 |
-
display: block;
|
240 |
-
margin-bottom: 0;
|
241 |
-
}
|
242 |
-
}
|
243 |
-
|
244 |
-
.acf-menu-item-fields {
|
245 |
-
margin-right: 10px;
|
246 |
-
float: left;
|
247 |
-
}
|
248 |
-
|
249 |
-
/*---------------------------------------------------------------------------------------------
|
250 |
-
*
|
251 |
-
* Attachment Form (single)
|
252 |
-
*
|
253 |
-
*---------------------------------------------------------------------------------------------*/
|
254 |
-
|
255 |
-
#post .compat-attachment-fields {
|
256 |
-
|
257 |
-
.compat-field-acf-form-data {
|
258 |
-
display: none;
|
259 |
-
}
|
260 |
-
|
261 |
-
&,
|
262 |
-
> tbody,
|
263 |
-
> tbody > tr,
|
264 |
-
> tbody > tr > th,
|
265 |
-
> tbody > tr > td {
|
266 |
-
display: block;
|
267 |
-
}
|
268 |
-
|
269 |
-
> tbody > .acf-field {
|
270 |
-
margin: 15px 0;
|
271 |
-
|
272 |
-
> .acf-label {
|
273 |
-
margin: 0;
|
274 |
-
|
275 |
-
label {
|
276 |
-
margin: 0;
|
277 |
-
padding: 0;
|
278 |
-
|
279 |
-
p {
|
280 |
-
margin: 0 0 3px !important;
|
281 |
-
}
|
282 |
-
}
|
283 |
-
}
|
284 |
-
|
285 |
-
> .acf-input {
|
286 |
-
margin: 0;
|
287 |
-
}
|
288 |
-
}
|
289 |
-
}
|
290 |
-
|
291 |
-
|
292 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/build/css/_global.scss
DELETED
@@ -1,1807 +0,0 @@
|
|
1 |
-
/*--------------------------------------------------------------------------------------------
|
2 |
-
*
|
3 |
-
* Global
|
4 |
-
*
|
5 |
-
*--------------------------------------------------------------------------------------------*/
|
6 |
-
|
7 |
-
/* Horizontal List */
|
8 |
-
.acf-hl { padding: 0; margin: 0; list-style: none; display: block; position: relative; }
|
9 |
-
.acf-hl > li { float: left; display: block; margin: 0; padding: 0; }
|
10 |
-
.acf-hl > li.acf-fr { float: right; }
|
11 |
-
|
12 |
-
|
13 |
-
/* Horizontal List: Clearfix */
|
14 |
-
.acf-hl:before, .acf-hl:after,
|
15 |
-
.acf-bl:before, .acf-bl:after,
|
16 |
-
.acf-cf:before, .acf-cf:after {
|
17 |
-
content: "";
|
18 |
-
display: block;
|
19 |
-
line-height: 0;
|
20 |
-
}
|
21 |
-
.acf-hl:after,
|
22 |
-
.acf-bl:after,
|
23 |
-
.acf-cf:after {
|
24 |
-
clear: both;
|
25 |
-
}
|
26 |
-
|
27 |
-
|
28 |
-
/* Block List */
|
29 |
-
.acf-bl { padding: 0; margin: 0; list-style: none; display: block; position: relative; }
|
30 |
-
.acf-bl > li { display: block; margin: 0; padding: 0; float: none; }
|
31 |
-
|
32 |
-
|
33 |
-
/* Visibility */
|
34 |
-
.acf-hidden {
|
35 |
-
display: none !important;
|
36 |
-
}
|
37 |
-
.acf-empty {
|
38 |
-
display: table-cell !important;
|
39 |
-
* { display: none !important; }
|
40 |
-
}
|
41 |
-
|
42 |
-
/* Float */
|
43 |
-
.acf-fl { float: left; }
|
44 |
-
.acf-fr { float: right; }
|
45 |
-
.acf-fn { float: none; }
|
46 |
-
|
47 |
-
|
48 |
-
/* Align */
|
49 |
-
.acf-al { text-align: left; }
|
50 |
-
.acf-ar { text-align: right; }
|
51 |
-
.acf-ac { text-align: center; }
|
52 |
-
|
53 |
-
|
54 |
-
/* loading */
|
55 |
-
.acf-loading,
|
56 |
-
.acf-spinner {
|
57 |
-
display: inline-block;
|
58 |
-
height: 20px;
|
59 |
-
width: 20px;
|
60 |
-
vertical-align: text-top;
|
61 |
-
background: transparent url(../images/spinner.gif) no-repeat 50% 50%;
|
62 |
-
}
|
63 |
-
|
64 |
-
|
65 |
-
/* spinner */
|
66 |
-
.acf-spinner {
|
67 |
-
display: none;
|
68 |
-
}
|
69 |
-
|
70 |
-
.acf-spinner.is-active {
|
71 |
-
display: inline-block;
|
72 |
-
}
|
73 |
-
|
74 |
-
|
75 |
-
/* WP < 4.2 */
|
76 |
-
.spinner.is-active {
|
77 |
-
display: inline-block;
|
78 |
-
}
|
79 |
-
|
80 |
-
|
81 |
-
/* required */
|
82 |
-
.acf-required {
|
83 |
-
color: #f00;
|
84 |
-
}
|
85 |
-
|
86 |
-
|
87 |
-
/* show on hover */
|
88 |
-
.acf-soh .acf-soh-target {
|
89 |
-
-webkit-transition: opacity 0.25s 0s ease-in-out, visibility 0s linear 0.25s;
|
90 |
-
-moz-transition: opacity 0.25s 0s ease-in-out, visibility 0s linear 0.25s;
|
91 |
-
-o-transition: opacity 0.25s 0s ease-in-out, visibility 0s linear 0.25s;
|
92 |
-
transition: opacity 0.25s 0s ease-in-out, visibility 0s linear 0.25s;
|
93 |
-
|
94 |
-
visibility: hidden;
|
95 |
-
opacity: 0;
|
96 |
-
}
|
97 |
-
|
98 |
-
.acf-soh:hover .acf-soh-target {
|
99 |
-
-webkit-transition-delay:0s;
|
100 |
-
-moz-transition-delay:0s;
|
101 |
-
-o-transition-delay:0s;
|
102 |
-
transition-delay:0s;
|
103 |
-
|
104 |
-
visibility: visible;
|
105 |
-
opacity: 1;
|
106 |
-
}
|
107 |
-
|
108 |
-
|
109 |
-
/* show if value */
|
110 |
-
.show-if-value { display: none; }
|
111 |
-
.hide-if-value { display: block; }
|
112 |
-
|
113 |
-
.has-value .show-if-value { display: block; }
|
114 |
-
.has-value .hide-if-value { display: none; }
|
115 |
-
|
116 |
-
|
117 |
-
/* select2 WP animation fix */
|
118 |
-
.select2-search-choice-close {
|
119 |
-
-webkit-transition: none;
|
120 |
-
-moz-transition: none;
|
121 |
-
-o-transition: none;
|
122 |
-
transition: none;
|
123 |
-
}
|
124 |
-
|
125 |
-
|
126 |
-
/*---------------------------------------------------------------------------------------------
|
127 |
-
*
|
128 |
-
* tooltip
|
129 |
-
*
|
130 |
-
*---------------------------------------------------------------------------------------------*/
|
131 |
-
|
132 |
-
/* tooltip */
|
133 |
-
.acf-tooltip {
|
134 |
-
background: #2F353E;
|
135 |
-
border-radius: 5px;
|
136 |
-
color: #fff;
|
137 |
-
padding: 5px 10px;
|
138 |
-
position: absolute;
|
139 |
-
font-size: 12px;
|
140 |
-
line-height: 1.4em;
|
141 |
-
z-index: 900000;
|
142 |
-
|
143 |
-
|
144 |
-
/* tip */
|
145 |
-
&:before {
|
146 |
-
border: solid;
|
147 |
-
border-color: transparent;
|
148 |
-
border-width: 6px;
|
149 |
-
content: "";
|
150 |
-
position: absolute;
|
151 |
-
}
|
152 |
-
|
153 |
-
|
154 |
-
/* positions */
|
155 |
-
&.top {
|
156 |
-
margin-top: -8px;
|
157 |
-
|
158 |
-
&:before {
|
159 |
-
top: 100%;
|
160 |
-
left: 50%;
|
161 |
-
margin-left: -6px;
|
162 |
-
border-top-color: #2F353E;
|
163 |
-
border-bottom-width: 0;
|
164 |
-
}
|
165 |
-
}
|
166 |
-
|
167 |
-
&.right {
|
168 |
-
margin-left: 8px;
|
169 |
-
|
170 |
-
&:before {
|
171 |
-
top: 50%;
|
172 |
-
margin-top: -6px;
|
173 |
-
right: 100%;
|
174 |
-
border-right-color: #2F353E;
|
175 |
-
border-left-width: 0;
|
176 |
-
}
|
177 |
-
}
|
178 |
-
|
179 |
-
&.bottom {
|
180 |
-
margin-top: 8px;
|
181 |
-
|
182 |
-
&:before {
|
183 |
-
bottom: 100%;
|
184 |
-
left: 50%;
|
185 |
-
margin-left: -6px;
|
186 |
-
border-bottom-color: #2F353E;
|
187 |
-
border-top-width: 0;
|
188 |
-
}
|
189 |
-
}
|
190 |
-
|
191 |
-
&.left {
|
192 |
-
margin-left: -8px;
|
193 |
-
|
194 |
-
&:before {
|
195 |
-
top: 50%;
|
196 |
-
margin-top: -6px;
|
197 |
-
left: 100%;
|
198 |
-
border-left-color: #2F353E;
|
199 |
-
border-right-width: 0;
|
200 |
-
}
|
201 |
-
}
|
202 |
-
|
203 |
-
.acf-overlay {
|
204 |
-
z-index: -1;
|
205 |
-
}
|
206 |
-
|
207 |
-
}
|
208 |
-
|
209 |
-
|
210 |
-
/* confirm */
|
211 |
-
.acf-tooltip.-confirm {
|
212 |
-
z-index: 900001; // +1 higher than .acf-tooltip
|
213 |
-
|
214 |
-
a {
|
215 |
-
text-decoration: none;
|
216 |
-
color: #9ea3a8;
|
217 |
-
|
218 |
-
&:hover {
|
219 |
-
text-decoration: underline;
|
220 |
-
}
|
221 |
-
|
222 |
-
&[data-event="confirm"] {
|
223 |
-
color: #F55E4F;
|
224 |
-
}
|
225 |
-
}
|
226 |
-
}
|
227 |
-
|
228 |
-
.acf-overlay {
|
229 |
-
position: fixed;
|
230 |
-
top: 0;
|
231 |
-
bottom: 0;
|
232 |
-
left: 0;
|
233 |
-
right: 0;
|
234 |
-
cursor: default;
|
235 |
-
}
|
236 |
-
|
237 |
-
.acf-tooltip-target {
|
238 |
-
position: relative;
|
239 |
-
z-index: 900002; // +1 higher than .acf-tooltip
|
240 |
-
}
|
241 |
-
|
242 |
-
|
243 |
-
/*---------------------------------------------------------------------------------------------
|
244 |
-
*
|
245 |
-
* loading
|
246 |
-
*
|
247 |
-
*---------------------------------------------------------------------------------------------*/
|
248 |
-
.acf-loading-overlay {
|
249 |
-
position: absolute;
|
250 |
-
top: 0;
|
251 |
-
bottom: 0;
|
252 |
-
left: 0;
|
253 |
-
right: 0;
|
254 |
-
cursor: default;
|
255 |
-
z-index: 99;
|
256 |
-
background: rgba(249, 249, 249, 0.5);
|
257 |
-
|
258 |
-
i {
|
259 |
-
@include centered();
|
260 |
-
}
|
261 |
-
}
|
262 |
-
|
263 |
-
|
264 |
-
/*---------------------------------------------------------------------------------------------
|
265 |
-
*
|
266 |
-
* callout
|
267 |
-
*
|
268 |
-
*---------------------------------------------------------------------------------------------*/
|
269 |
-
|
270 |
-
.acf-callout {
|
271 |
-
margin: 20px 0;
|
272 |
-
padding: 20px;
|
273 |
-
|
274 |
-
background-color: #FCF8F2;
|
275 |
-
border-left: 3px solid #F0AD4E;
|
276 |
-
}
|
277 |
-
|
278 |
-
.acf-callout h4 {
|
279 |
-
color: #F0AD4E;
|
280 |
-
margin: 0 !important;
|
281 |
-
}
|
282 |
-
|
283 |
-
.acf-callout p {
|
284 |
-
margin-bottom: 0;
|
285 |
-
}
|
286 |
-
|
287 |
-
.acf-callout.danger {
|
288 |
-
border-color: #D9534F;
|
289 |
-
background-color: #FDF7F7;
|
290 |
-
}
|
291 |
-
|
292 |
-
.acf-callout.danger h4 {
|
293 |
-
color: #D9534F;
|
294 |
-
}
|
295 |
-
|
296 |
-
.acf-callout.success {
|
297 |
-
background-color: #f4faf6;
|
298 |
-
border-color: #bcf1c5;
|
299 |
-
}
|
300 |
-
|
301 |
-
.acf-callout.success h4 {
|
302 |
-
color: #3aad60;
|
303 |
-
}
|
304 |
-
|
305 |
-
|
306 |
-
/*--------------------------------------------------------------------------------------------
|
307 |
-
*
|
308 |
-
* acf-icon
|
309 |
-
*
|
310 |
-
*--------------------------------------------------------------------------------------------*/
|
311 |
-
|
312 |
-
@font-face {
|
313 |
-
font-family: 'acf';
|
314 |
-
src: url('../font/acf.eot?57601716');
|
315 |
-
src: url('../font/acf.eot?57601716#iefix') format('embedded-opentype'),
|
316 |
-
url('../font/acf.woff2?57601716') format('woff2'),
|
317 |
-
url('../font/acf.woff?57601716') format('woff'),
|
318 |
-
url('../font/acf.ttf?57601716') format('truetype'),
|
319 |
-
url('../font/acf.svg?57601716#acf') format('svg');
|
320 |
-
font-weight: normal;
|
321 |
-
font-style: normal;
|
322 |
-
}
|
323 |
-
|
324 |
-
.acf-icon:before {
|
325 |
-
font-family: "acf";
|
326 |
-
font-style: normal;
|
327 |
-
font-weight: normal;
|
328 |
-
speak: none;
|
329 |
-
|
330 |
-
display: inline-block;
|
331 |
-
text-decoration: inherit;
|
332 |
-
width: 1em;
|
333 |
-
// margin-right: .2em;
|
334 |
-
text-align: center;
|
335 |
-
/* opacity: .8; */
|
336 |
-
|
337 |
-
/* For safety - reset parent styles, that can break glyph codes*/
|
338 |
-
font-variant: normal;
|
339 |
-
text-transform: none;
|
340 |
-
|
341 |
-
/* fix buttons height, for twitter bootstrap */
|
342 |
-
line-height: 1em;
|
343 |
-
|
344 |
-
/* Font smoothing. That was taken from TWBS */
|
345 |
-
-webkit-font-smoothing: antialiased;
|
346 |
-
-moz-osx-font-smoothing: grayscale;
|
347 |
-
|
348 |
-
/* more consistent vertical align */
|
349 |
-
position: relative;
|
350 |
-
}
|
351 |
-
|
352 |
-
.acf-icon.-plus:before { content: '\e800'; } /* '' */
|
353 |
-
.acf-icon.-minus:before { content: '\e801'; } /* '' */
|
354 |
-
.acf-icon.-cancel:before { content: '\e802'; } /* '' */
|
355 |
-
.acf-icon.-pencil:before { content: '\e803'; top: -1px; } /* '' */
|
356 |
-
.acf-icon.-location:before { content: '\e804'; } /* '' */
|
357 |
-
.acf-icon.-down:before { content: '\e805'; top: 1px; } /* '' */
|
358 |
-
.acf-icon.-left:before { content: '\e806'; left: -1px; } /* '' */
|
359 |
-
.acf-icon.-right:before { content: '\e807'; left: 1px; } /* '' */
|
360 |
-
.acf-icon.-up:before { content: '\e808'; top: -1px; } /* '' */
|
361 |
-
.acf-icon.-sync:before { content: '\e809'; } /* '' */
|
362 |
-
.acf-icon.-globe:before { content: '\e80a'; } /* '' */
|
363 |
-
.acf-icon.-picture:before { content: '\e80b'; } /* '' */
|
364 |
-
.acf-icon.-check:before { content: '\e80c'; } /* '' */
|
365 |
-
.acf-icon.-dot-3:before { content: '\e80d'; } /* '' */
|
366 |
-
.acf-icon.-arrow-combo:before { content: '\e80e'; } /* '' */
|
367 |
-
.acf-icon.-arrow-up:before { content: '\e810'; top: -1px; } /* '' */
|
368 |
-
.acf-icon.-arrow-down:before { content: '\e80f'; top: 1px; } /* '' */
|
369 |
-
.acf-icon.-search:before { content: '\e811'; } /* '' */
|
370 |
-
.acf-icon.-link-ext:before { content: '\f08e'; } /* '' */
|
371 |
-
|
372 |
-
|
373 |
-
/* collapse */
|
374 |
-
.acf-icon.-collapse:before { content: '\e810'; top: -1px; } /* arrow-up */
|
375 |
-
.-collapsed .acf-icon.-collapse:before { content: '\e80f'; top: 1px; } /* arrow-down */
|
376 |
-
|
377 |
-
|
378 |
-
/* default */
|
379 |
-
.acf-icon {
|
380 |
-
display: inline-block;
|
381 |
-
height: 26px;
|
382 |
-
width: 26px;
|
383 |
-
border: transparent solid 1px;
|
384 |
-
border-radius: 100%;
|
385 |
-
|
386 |
-
font-size: 16px;
|
387 |
-
line-height: 26px;
|
388 |
-
text-align: center;
|
389 |
-
text-decoration: none;
|
390 |
-
vertical-align: top;
|
391 |
-
box-sizing: content-box;
|
392 |
-
}
|
393 |
-
|
394 |
-
|
395 |
-
/* elements */
|
396 |
-
span.acf-icon {
|
397 |
-
color: #999;
|
398 |
-
border-color: #BBB;
|
399 |
-
background-color: #fff;
|
400 |
-
}
|
401 |
-
|
402 |
-
|
403 |
-
/* icon */
|
404 |
-
a.acf-icon {
|
405 |
-
color: #999;
|
406 |
-
border-color: #BBB;
|
407 |
-
background-color: #fff;
|
408 |
-
|
409 |
-
position: relative;
|
410 |
-
overflow: hidden;
|
411 |
-
transition: none;
|
412 |
-
|
413 |
-
|
414 |
-
/* clear */
|
415 |
-
&.-clear {
|
416 |
-
color: #444;
|
417 |
-
background: transparent;
|
418 |
-
border: none;
|
419 |
-
}
|
420 |
-
|
421 |
-
|
422 |
-
/* light*/
|
423 |
-
&.light {
|
424 |
-
border: none;
|
425 |
-
padding: 1px;
|
426 |
-
background: #F5F5F5;
|
427 |
-
color: #72777c;
|
428 |
-
}
|
429 |
-
|
430 |
-
|
431 |
-
/* states */
|
432 |
-
&:hover {
|
433 |
-
border-color: transparent;
|
434 |
-
background: $acf_blue;
|
435 |
-
color: #fff;
|
436 |
-
}
|
437 |
-
|
438 |
-
&:active {
|
439 |
-
color: #fff;
|
440 |
-
background-color: darken($acf_blue, 5%);
|
441 |
-
}
|
442 |
-
|
443 |
-
|
444 |
-
/* remove WP outline box-shadow */
|
445 |
-
&:active,
|
446 |
-
&:focus {
|
447 |
-
outline: none;
|
448 |
-
box-shadow: none;
|
449 |
-
}
|
450 |
-
|
451 |
-
|
452 |
-
/* red */
|
453 |
-
&.-minus,
|
454 |
-
&.-cancel {
|
455 |
-
|
456 |
-
&:hover {
|
457 |
-
background-color: #F55E4F;
|
458 |
-
}
|
459 |
-
|
460 |
-
&:active {
|
461 |
-
background-color: darken(#F55E4F, 5%);
|
462 |
-
}
|
463 |
-
|
464 |
-
}
|
465 |
-
|
466 |
-
}
|
467 |
-
|
468 |
-
|
469 |
-
/* minor tweaks */
|
470 |
-
.acf-icon.-pencil {
|
471 |
-
font-size: 15px;
|
472 |
-
}
|
473 |
-
|
474 |
-
.acf-icon.-location {
|
475 |
-
font-size: 18px;
|
476 |
-
}
|
477 |
-
|
478 |
-
|
479 |
-
/* sizes */
|
480 |
-
.acf-icon.small,
|
481 |
-
.acf-icon.-small {
|
482 |
-
width: 18px;
|
483 |
-
height: 18px;
|
484 |
-
line-height: 18px;
|
485 |
-
font-size: 14px;
|
486 |
-
}
|
487 |
-
|
488 |
-
|
489 |
-
/* dark */
|
490 |
-
.acf-icon.dark {
|
491 |
-
border-color: transparent;
|
492 |
-
background: #23282D;
|
493 |
-
color: #eee;
|
494 |
-
}
|
495 |
-
|
496 |
-
a.acf-icon.dark:hover {
|
497 |
-
border-color: transparent;
|
498 |
-
background: #191E23;
|
499 |
-
color: #00b9eb;
|
500 |
-
}
|
501 |
-
|
502 |
-
a.acf-icon.-minus.dark:hover,
|
503 |
-
a.acf-icon.-cancel.dark:hover {
|
504 |
-
color: #D54E21;
|
505 |
-
}
|
506 |
-
|
507 |
-
|
508 |
-
/* grey */
|
509 |
-
.acf-icon.grey {
|
510 |
-
border-color: transparent;
|
511 |
-
background: #b4b9be;
|
512 |
-
color: #fff;
|
513 |
-
}
|
514 |
-
|
515 |
-
a.acf-icon.grey:hover {
|
516 |
-
border-color: transparent;
|
517 |
-
background: #00A0D2;
|
518 |
-
color: #fff;
|
519 |
-
}
|
520 |
-
|
521 |
-
a.acf-icon.-minus.grey:hover,
|
522 |
-
a.acf-icon.-cancel.grey:hover {
|
523 |
-
background: #32373C;
|
524 |
-
}
|
525 |
-
|
526 |
-
|
527 |
-
/* red */
|
528 |
-
.acf-icon.red {
|
529 |
-
border-color: transparent;
|
530 |
-
background-color: #F55E4F;
|
531 |
-
color: #fff;
|
532 |
-
}
|
533 |
-
|
534 |
-
|
535 |
-
/* yellow */
|
536 |
-
.acf-icon.yellow {
|
537 |
-
border-color: transparent;
|
538 |
-
background-color: #FDBC40;
|
539 |
-
color: #fff;
|
540 |
-
}
|
541 |
-
|
542 |
-
|
543 |
-
/* logo */
|
544 |
-
.acf-icon.logo {
|
545 |
-
width: 150px;
|
546 |
-
height: 150px;
|
547 |
-
background: #5EE8BF;
|
548 |
-
|
549 |
-
border: 0 none;
|
550 |
-
position: absolute;
|
551 |
-
right: 0;
|
552 |
-
top: 0;
|
553 |
-
}
|
554 |
-
|
555 |
-
|
556 |
-
/*--------------------------------------------------------------------------------------------
|
557 |
-
*
|
558 |
-
* acf-box
|
559 |
-
*
|
560 |
-
*--------------------------------------------------------------------------------------------*/
|
561 |
-
|
562 |
-
.acf-box {
|
563 |
-
background: #FFFFFF;
|
564 |
-
border: 1px solid #E5E5E5;
|
565 |
-
position: relative;
|
566 |
-
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
|
567 |
-
|
568 |
-
/* title */
|
569 |
-
.title {
|
570 |
-
border-bottom: 1px solid #EEEEEE;
|
571 |
-
margin: 0;
|
572 |
-
padding: 15px;
|
573 |
-
|
574 |
-
h3 {
|
575 |
-
font-size: 14px;
|
576 |
-
line-height: 1em;
|
577 |
-
margin: 0;
|
578 |
-
padding: 0;
|
579 |
-
}
|
580 |
-
}
|
581 |
-
|
582 |
-
|
583 |
-
.inner {
|
584 |
-
padding: 15px;
|
585 |
-
}
|
586 |
-
|
587 |
-
h2 {
|
588 |
-
color: #333333;
|
589 |
-
font-size: 26px;
|
590 |
-
line-height: 1.25em;
|
591 |
-
margin: 0.25em 0 0.75em;
|
592 |
-
padding: 0;
|
593 |
-
}
|
594 |
-
|
595 |
-
h3 {
|
596 |
-
margin: 1.5em 0 0;
|
597 |
-
}
|
598 |
-
|
599 |
-
p {
|
600 |
-
margin-top: 0.5em;
|
601 |
-
}
|
602 |
-
|
603 |
-
a {
|
604 |
-
text-decoration: none;
|
605 |
-
}
|
606 |
-
|
607 |
-
i {
|
608 |
-
&.dashicons-external {
|
609 |
-
margin-top: -1px;
|
610 |
-
}
|
611 |
-
}
|
612 |
-
|
613 |
-
/* footer */
|
614 |
-
.footer {
|
615 |
-
border-top: 1px solid #eee;
|
616 |
-
padding: 12px;
|
617 |
-
font-size: 13px;
|
618 |
-
line-height: 1.5;
|
619 |
-
|
620 |
-
p {
|
621 |
-
margin: 0;
|
622 |
-
}
|
623 |
-
}
|
624 |
-
}
|
625 |
-
|
626 |
-
/*--------------------------------------------------------------------------------------------
|
627 |
-
*
|
628 |
-
* acf-notice
|
629 |
-
*
|
630 |
-
*--------------------------------------------------------------------------------------------*/
|
631 |
-
|
632 |
-
.acf-notice {
|
633 |
-
position: relative;
|
634 |
-
display: block;
|
635 |
-
color: #fff;
|
636 |
-
margin: 5px 0 15px;
|
637 |
-
padding: 3px 12px;
|
638 |
-
background: $acf_notice;
|
639 |
-
border-left: darken($acf_notice, 8%) solid 4px;
|
640 |
-
|
641 |
-
p {
|
642 |
-
font-size: 13px;
|
643 |
-
line-height: 1.5;
|
644 |
-
margin: 0.5em 0;
|
645 |
-
text-shadow: none;
|
646 |
-
color: inherit;
|
647 |
-
}
|
648 |
-
|
649 |
-
a.acf-notice-dismiss {
|
650 |
-
position: absolute;
|
651 |
-
border-color: transparent;
|
652 |
-
top: 9px;
|
653 |
-
right: 12px;
|
654 |
-
color: #fff;
|
655 |
-
background: rgba(0,0,0,0.1);
|
656 |
-
|
657 |
-
&:hover {
|
658 |
-
background: rgba(0,0,0,0.2);
|
659 |
-
}
|
660 |
-
}
|
661 |
-
|
662 |
-
// dismiss
|
663 |
-
&.-dismiss {
|
664 |
-
padding-right: 40px;
|
665 |
-
}
|
666 |
-
|
667 |
-
// error
|
668 |
-
&.-error {
|
669 |
-
background: $acf_error;
|
670 |
-
border-color: darken($acf_error, 8%);
|
671 |
-
}
|
672 |
-
|
673 |
-
// success
|
674 |
-
&.-success {
|
675 |
-
background: $acf_success;
|
676 |
-
border-color: darken($acf_success, 8%);
|
677 |
-
}
|
678 |
-
|
679 |
-
// warning
|
680 |
-
&.-warning {
|
681 |
-
background: $acf_warning;
|
682 |
-
border-color: darken($acf_warning, 8%);
|
683 |
-
}
|
684 |
-
}
|
685 |
-
|
686 |
-
|
687 |
-
/*--------------------------------------------------------------------------------------------
|
688 |
-
*
|
689 |
-
* acf-table
|
690 |
-
*
|
691 |
-
*--------------------------------------------------------------------------------------------*/
|
692 |
-
|
693 |
-
.acf-table {
|
694 |
-
border: #DFDFDF solid 1px;
|
695 |
-
background: #fff;
|
696 |
-
border-spacing: 0;
|
697 |
-
border-radius: 0;
|
698 |
-
table-layout: auto;
|
699 |
-
padding: 0;
|
700 |
-
margin: 0;
|
701 |
-
width: 100%;
|
702 |
-
clear: both;
|
703 |
-
box-sizing: content-box;
|
704 |
-
|
705 |
-
/* defaults */
|
706 |
-
> tbody > tr,
|
707 |
-
> thead > tr {
|
708 |
-
|
709 |
-
> th, > td {
|
710 |
-
padding: 8px;
|
711 |
-
vertical-align: top;
|
712 |
-
background: #fff;
|
713 |
-
text-align: left;
|
714 |
-
border-style: solid;
|
715 |
-
font-weight: normal;
|
716 |
-
}
|
717 |
-
|
718 |
-
> th {
|
719 |
-
position: relative;
|
720 |
-
color: #333333;
|
721 |
-
}
|
722 |
-
|
723 |
-
}
|
724 |
-
|
725 |
-
|
726 |
-
/* thead */
|
727 |
-
> thead {
|
728 |
-
|
729 |
-
> tr {
|
730 |
-
|
731 |
-
> th {
|
732 |
-
border-color: #E1E1E1;
|
733 |
-
border-width: 0 0 1px 1px;
|
734 |
-
|
735 |
-
&:first-child {
|
736 |
-
border-left-width: 0;
|
737 |
-
}
|
738 |
-
}
|
739 |
-
|
740 |
-
}
|
741 |
-
|
742 |
-
}
|
743 |
-
|
744 |
-
|
745 |
-
/* tbody */
|
746 |
-
> tbody {
|
747 |
-
|
748 |
-
> tr {
|
749 |
-
z-index: 1;
|
750 |
-
|
751 |
-
> td {
|
752 |
-
border-color: #EDEDED;
|
753 |
-
border-width: 1px 0 0 1px;
|
754 |
-
|
755 |
-
&:first-child {
|
756 |
-
border-left-width: 0;
|
757 |
-
}
|
758 |
-
}
|
759 |
-
|
760 |
-
&:first-child > td {
|
761 |
-
border-top-width: 0;
|
762 |
-
}
|
763 |
-
}
|
764 |
-
|
765 |
-
}
|
766 |
-
|
767 |
-
|
768 |
-
/* -clear */
|
769 |
-
&.-clear {
|
770 |
-
border: 0 none;
|
771 |
-
|
772 |
-
> tbody > tr,
|
773 |
-
> thead > tr {
|
774 |
-
|
775 |
-
> td, >th {
|
776 |
-
border: 0 none;
|
777 |
-
padding: 4px;
|
778 |
-
}
|
779 |
-
}
|
780 |
-
}
|
781 |
-
}
|
782 |
-
|
783 |
-
|
784 |
-
/* remove tr */
|
785 |
-
.acf-remove-element {
|
786 |
-
-webkit-transition: all 0.25s ease-out;
|
787 |
-
-moz-transition: all 0.25s ease-out;
|
788 |
-
-o-transition: all 0.25s ease-out;
|
789 |
-
transition: all 0.25s ease-out;
|
790 |
-
|
791 |
-
transform: translate(50px, 0);
|
792 |
-
opacity: 0;
|
793 |
-
}
|
794 |
-
|
795 |
-
|
796 |
-
/* fade-up */
|
797 |
-
.acf-fade-up {
|
798 |
-
-webkit-transition: all 0.25s ease-out;
|
799 |
-
-moz-transition: all 0.25s ease-out;
|
800 |
-
-o-transition: all 0.25s ease-out;
|
801 |
-
transition: all 0.25s ease-out;
|
802 |
-
|
803 |
-
transform: translate(0, -10px);
|
804 |
-
opacity: 0;
|
805 |
-
}
|
806 |
-
|
807 |
-
|
808 |
-
/*---------------------------------------------------------------------------------------------
|
809 |
-
*
|
810 |
-
* wp-admin
|
811 |
-
*
|
812 |
-
*---------------------------------------------------------------------------------------------*/
|
813 |
-
|
814 |
-
/* Menu */
|
815 |
-
#adminmenu a[href="edit.php?post_type=acf-field-group&page=acf-settings-info"] {
|
816 |
-
display: none;
|
817 |
-
}
|
818 |
-
|
819 |
-
|
820 |
-
/*---------------------------------------------------------------------------------------------
|
821 |
-
*
|
822 |
-
* Field Group List
|
823 |
-
*
|
824 |
-
*---------------------------------------------------------------------------------------------*/
|
825 |
-
|
826 |
-
#icon-edit.icon32-posts-acf-field-group {
|
827 |
-
background-position: -11px -5px;
|
828 |
-
}
|
829 |
-
|
830 |
-
#acf-field-group-wrap {
|
831 |
-
|
832 |
-
.tablenav,
|
833 |
-
p.search-box {
|
834 |
-
display: none;
|
835 |
-
}
|
836 |
-
|
837 |
-
.wp-list-table {
|
838 |
-
|
839 |
-
.column-acf-fg-description,
|
840 |
-
.column-acf-fg-description:before {
|
841 |
-
display: none !important; /* important needed to override mobile */
|
842 |
-
}
|
843 |
-
|
844 |
-
.column-acf-fg-count {
|
845 |
-
width: 10%;
|
846 |
-
}
|
847 |
-
|
848 |
-
.column-acf-fg-status {
|
849 |
-
width: 10%;
|
850 |
-
}
|
851 |
-
|
852 |
-
}
|
853 |
-
|
854 |
-
.tablenav.bottom {
|
855 |
-
display: block;
|
856 |
-
}
|
857 |
-
|
858 |
-
.acf-description {
|
859 |
-
font-weight: normal;
|
860 |
-
font-size: 13px;
|
861 |
-
color: #999;
|
862 |
-
margin-left: 7px;
|
863 |
-
font-style: italic;
|
864 |
-
}
|
865 |
-
|
866 |
-
}
|
867 |
-
|
868 |
-
|
869 |
-
|
870 |
-
|
871 |
-
/* subsubsub */
|
872 |
-
#acf-field-group-wrap .subsubsub {
|
873 |
-
|
874 |
-
/* WPML */
|
875 |
-
margin-bottom: 3px;
|
876 |
-
|
877 |
-
ul {
|
878 |
-
margin: 0;
|
879 |
-
}
|
880 |
-
|
881 |
-
+ .subsubsub {
|
882 |
-
margin-top: 0;
|
883 |
-
}
|
884 |
-
|
885 |
-
/* search */
|
886 |
-
a:focus {
|
887 |
-
box-shadow: none;
|
888 |
-
}
|
889 |
-
|
890 |
-
}
|
891 |
-
|
892 |
-
|
893 |
-
|
894 |
-
/* columns (replicate post edit layout) */
|
895 |
-
.acf-columns-2 {
|
896 |
-
margin-right: 300px;
|
897 |
-
clear: both;
|
898 |
-
@include clearfix();
|
899 |
-
|
900 |
-
/* rtl */
|
901 |
-
html[dir="rtl"] & {
|
902 |
-
margin-right: 0;
|
903 |
-
margin-left: 300px;
|
904 |
-
}
|
905 |
-
|
906 |
-
.acf-column-1 {
|
907 |
-
float: left;
|
908 |
-
width: 100%;
|
909 |
-
|
910 |
-
/* rtl */
|
911 |
-
html[dir="rtl"] & {
|
912 |
-
float: right;
|
913 |
-
}
|
914 |
-
}
|
915 |
-
|
916 |
-
.acf-column-2 {
|
917 |
-
float: right;
|
918 |
-
margin-right: -300px;
|
919 |
-
width: 280px;
|
920 |
-
|
921 |
-
/* rtl */
|
922 |
-
html[dir="rtl"] & {
|
923 |
-
float: left;
|
924 |
-
margin-right: 0;
|
925 |
-
margin-left: -300px;
|
926 |
-
}
|
927 |
-
}
|
928 |
-
|
929 |
-
}
|
930 |
-
|
931 |
-
|
932 |
-
/* search */
|
933 |
-
#acf-field-group-wrap .search-box {
|
934 |
-
|
935 |
-
&:after {
|
936 |
-
display: block;
|
937 |
-
content: "";
|
938 |
-
height: 5px;
|
939 |
-
}
|
940 |
-
|
941 |
-
}
|
942 |
-
|
943 |
-
.acf-clear {
|
944 |
-
clear: both;
|
945 |
-
}
|
946 |
-
|
947 |
-
|
948 |
-
/* mobile compatibilty */
|
949 |
-
@media screen and (max-width: 782px) {
|
950 |
-
|
951 |
-
#acf-field-group-wrap #the-list .acf-icon:after {
|
952 |
-
content: attr(title);
|
953 |
-
position: absolute;
|
954 |
-
margin-left: 5px;
|
955 |
-
font-size: 13px;
|
956 |
-
line-height: 18px;
|
957 |
-
font-style: normal;
|
958 |
-
color: #444;
|
959 |
-
}
|
960 |
-
|
961 |
-
}
|
962 |
-
|
963 |
-
|
964 |
-
/*---------------------------------------------------------------------------------------------
|
965 |
-
*
|
966 |
-
* Fake table
|
967 |
-
*
|
968 |
-
*---------------------------------------------------------------------------------------------*/
|
969 |
-
|
970 |
-
.acf-thead,
|
971 |
-
.acf-tbody,
|
972 |
-
.acf-tfoot {
|
973 |
-
width: 100%;
|
974 |
-
padding: 0;
|
975 |
-
margin: 0;
|
976 |
-
}
|
977 |
-
|
978 |
-
.acf-thead > li,
|
979 |
-
.acf-tbody > li,
|
980 |
-
.acf-tfoot > li {
|
981 |
-
-webkit-box-sizing: border-box;
|
982 |
-
-moz-box-sizing: border-box;
|
983 |
-
box-sizing: border-box;
|
984 |
-
|
985 |
-
padding: 8px 15px;
|
986 |
-
font-size: 12px;
|
987 |
-
line-height: 14px;
|
988 |
-
}
|
989 |
-
|
990 |
-
|
991 |
-
.acf-thead {
|
992 |
-
border-bottom: #E1E1E1 solid 1px;
|
993 |
-
color: #23282d;
|
994 |
-
}
|
995 |
-
|
996 |
-
.acf-thead > li {
|
997 |
-
font-size: 14px;
|
998 |
-
line-height: 1.4em;
|
999 |
-
font-family: "Open Sans",sans-serif;
|
1000 |
-
font-weight: bold;
|
1001 |
-
}
|
1002 |
-
|
1003 |
-
.acf-tfoot {
|
1004 |
-
background: #f5f5f5;
|
1005 |
-
border-top: #dddddd solid 1px;
|
1006 |
-
}
|
1007 |
-
|
1008 |
-
.acf-tfoot > li {
|
1009 |
-
color: #7A9BBE;
|
1010 |
-
font-size: 12px;
|
1011 |
-
line-height: 27px;
|
1012 |
-
}
|
1013 |
-
|
1014 |
-
/*--------------------------------------------------------------------------------------------
|
1015 |
-
*
|
1016 |
-
* Settings
|
1017 |
-
*
|
1018 |
-
*--------------------------------------------------------------------------------------------*/
|
1019 |
-
|
1020 |
-
.acf-settings-wrap {
|
1021 |
-
#poststuff {
|
1022 |
-
padding-top: 15px;
|
1023 |
-
}
|
1024 |
-
}
|
1025 |
-
|
1026 |
-
.acf-settings-wrap table {
|
1027 |
-
margin: 0;
|
1028 |
-
}
|
1029 |
-
|
1030 |
-
.acf-settings-wrap table .button {
|
1031 |
-
vertical-align: middle;
|
1032 |
-
}
|
1033 |
-
|
1034 |
-
|
1035 |
-
/*--------------------------------------------------------------------------------------------
|
1036 |
-
*
|
1037 |
-
* Settings: Add-ons
|
1038 |
-
*
|
1039 |
-
*--------------------------------------------------------------------------------------------*/
|
1040 |
-
|
1041 |
-
.add-ons-list {
|
1042 |
-
margin: 20px 0 0 -18px;
|
1043 |
-
max-width: 960px;
|
1044 |
-
}
|
1045 |
-
|
1046 |
-
.add-ons-list .add-on {
|
1047 |
-
width: 220px;
|
1048 |
-
margin: 0 0 20px 18px;
|
1049 |
-
float: left;
|
1050 |
-
}
|
1051 |
-
|
1052 |
-
.add-ons-list .add-on .inner {
|
1053 |
-
min-height: 90px;
|
1054 |
-
}
|
1055 |
-
|
1056 |
-
.add-ons-list .add-on-acf-pro {
|
1057 |
-
width: 940px;
|
1058 |
-
}
|
1059 |
-
|
1060 |
-
.add-ons-list .add-on .thumbnail {
|
1061 |
-
|
1062 |
-
}
|
1063 |
-
|
1064 |
-
.add-ons-list .add-on .thumbnail img {
|
1065 |
-
display: block;
|
1066 |
-
}
|
1067 |
-
|
1068 |
-
.add-ons-list .add-on h3 a {
|
1069 |
-
color: inherit;
|
1070 |
-
text-decoration: none;
|
1071 |
-
}
|
1072 |
-
|
1073 |
-
.add-ons-list .add-on h3 {
|
1074 |
-
margin: 0.5em 0;
|
1075 |
-
}
|
1076 |
-
|
1077 |
-
|
1078 |
-
/*--------------------------------------------------------------------------------------------
|
1079 |
-
*
|
1080 |
-
* acf-popup
|
1081 |
-
*
|
1082 |
-
*--------------------------------------------------------------------------------------------*/
|
1083 |
-
|
1084 |
-
#acf-popup {
|
1085 |
-
position: fixed;
|
1086 |
-
z-index: 900000;
|
1087 |
-
top: 0;
|
1088 |
-
left: 0;
|
1089 |
-
right: 0;
|
1090 |
-
bottom: 0;
|
1091 |
-
text-align: center;
|
1092 |
-
|
1093 |
-
// bg
|
1094 |
-
.bg {
|
1095 |
-
position: absolute;
|
1096 |
-
top: 0;
|
1097 |
-
left: 0;
|
1098 |
-
right: 0;
|
1099 |
-
bottom: 0;
|
1100 |
-
z-index: 0;
|
1101 |
-
background: rgba(0,0,0,0.25);
|
1102 |
-
}
|
1103 |
-
|
1104 |
-
&:before {
|
1105 |
-
content: '';
|
1106 |
-
display: inline-block;
|
1107 |
-
height: 100%;
|
1108 |
-
vertical-align: middle;
|
1109 |
-
}
|
1110 |
-
|
1111 |
-
// box
|
1112 |
-
.acf-popup-box {
|
1113 |
-
display: inline-block;
|
1114 |
-
vertical-align: middle;
|
1115 |
-
z-index: 1;
|
1116 |
-
min-width: 300px;
|
1117 |
-
min-height: 160px;
|
1118 |
-
border-color: #aaaaaa;
|
1119 |
-
box-shadow: 0 5px 30px -5px rgba(0, 0, 0, 0.25);
|
1120 |
-
text-align: left;
|
1121 |
-
@include rtl();
|
1122 |
-
|
1123 |
-
// title
|
1124 |
-
.title {
|
1125 |
-
min-height: 15px;
|
1126 |
-
line-height: 15px;
|
1127 |
-
|
1128 |
-
// icon
|
1129 |
-
.acf-icon {
|
1130 |
-
position: absolute;
|
1131 |
-
top: 10px;
|
1132 |
-
right: 10px;
|
1133 |
-
|
1134 |
-
// rtl
|
1135 |
-
html[dir="rtl"] & {
|
1136 |
-
right: auto;
|
1137 |
-
left: 10px;
|
1138 |
-
}
|
1139 |
-
}
|
1140 |
-
}
|
1141 |
-
|
1142 |
-
.inner {
|
1143 |
-
min-height: 50px;
|
1144 |
-
|
1145 |
-
// use margin instead of padding to allow inner elements marin to overlap and avoid large hitespace at top/bottom
|
1146 |
-
padding: 0;
|
1147 |
-
margin: 15px;
|
1148 |
-
}
|
1149 |
-
|
1150 |
-
// loading
|
1151 |
-
.loading {
|
1152 |
-
position: absolute;
|
1153 |
-
top: 45px;
|
1154 |
-
left: 0;
|
1155 |
-
right: 0;
|
1156 |
-
bottom: 0;
|
1157 |
-
z-index: 2;
|
1158 |
-
background: rgba(0,0,0,0.1);
|
1159 |
-
display: none;
|
1160 |
-
|
1161 |
-
i {
|
1162 |
-
@include centered();
|
1163 |
-
}
|
1164 |
-
}
|
1165 |
-
|
1166 |
-
}
|
1167 |
-
}
|
1168 |
-
|
1169 |
-
|
1170 |
-
// acf-submit
|
1171 |
-
.acf-submit {
|
1172 |
-
margin-bottom: 0;
|
1173 |
-
line-height: 28px; // .button height
|
1174 |
-
|
1175 |
-
// message
|
1176 |
-
span {
|
1177 |
-
float: right;
|
1178 |
-
color: #999;
|
1179 |
-
|
1180 |
-
&.-error {
|
1181 |
-
color: #dd4232;
|
1182 |
-
}
|
1183 |
-
}
|
1184 |
-
|
1185 |
-
// button (allow margin between loading)
|
1186 |
-
.button {
|
1187 |
-
margin-right: 5px;
|
1188 |
-
}
|
1189 |
-
}
|
1190 |
-
|
1191 |
-
/*--------------------------------------------------------------------------------------------
|
1192 |
-
*
|
1193 |
-
* upgrade notice
|
1194 |
-
*
|
1195 |
-
*--------------------------------------------------------------------------------------------*/
|
1196 |
-
|
1197 |
-
#acf-upgrade-notice {
|
1198 |
-
position: relative;
|
1199 |
-
background: #fff;
|
1200 |
-
border-left: 4px solid #00a0d2;
|
1201 |
-
padding: 20px;
|
1202 |
-
@include clearfix();
|
1203 |
-
|
1204 |
-
.col-content {
|
1205 |
-
float: left;
|
1206 |
-
width: 55%;
|
1207 |
-
padding-left: 90px;
|
1208 |
-
}
|
1209 |
-
|
1210 |
-
.col-actions {
|
1211 |
-
float: right;
|
1212 |
-
text-align: center;
|
1213 |
-
padding: 10px;
|
1214 |
-
}
|
1215 |
-
|
1216 |
-
img {
|
1217 |
-
float: left;
|
1218 |
-
width: 70px;
|
1219 |
-
height: 70px;
|
1220 |
-
margin: 0 0 0 -90px;
|
1221 |
-
}
|
1222 |
-
|
1223 |
-
h2 {
|
1224 |
-
font-size: 16px;
|
1225 |
-
margin: 2px 0 6.5px;
|
1226 |
-
}
|
1227 |
-
|
1228 |
-
p {
|
1229 |
-
padding: 0;
|
1230 |
-
margin: 0;
|
1231 |
-
}
|
1232 |
-
|
1233 |
-
.button:before {
|
1234 |
-
margin-top: 11px;
|
1235 |
-
}
|
1236 |
-
|
1237 |
-
// mobile
|
1238 |
-
@media screen and (max-width: $sm) {
|
1239 |
-
|
1240 |
-
.col-content,
|
1241 |
-
.col-actions {
|
1242 |
-
float: none;
|
1243 |
-
padding-left: 90px;
|
1244 |
-
width: auto;
|
1245 |
-
text-align: left;
|
1246 |
-
}
|
1247 |
-
}
|
1248 |
-
}
|
1249 |
-
|
1250 |
-
|
1251 |
-
/*--------------------------------------------------------------------------------------------
|
1252 |
-
*
|
1253 |
-
* Welcome
|
1254 |
-
*
|
1255 |
-
*--------------------------------------------------------------------------------------------*/
|
1256 |
-
|
1257 |
-
.acf-wrap {
|
1258 |
-
|
1259 |
-
h1 {
|
1260 |
-
margin-top: 0;
|
1261 |
-
padding-top: 20px;
|
1262 |
-
}
|
1263 |
-
|
1264 |
-
.about-text {
|
1265 |
-
margin-top: 0.5em;
|
1266 |
-
min-height: 50px;
|
1267 |
-
}
|
1268 |
-
|
1269 |
-
.about-headline-callout {
|
1270 |
-
font-size: 2.4em;
|
1271 |
-
font-weight: 300;
|
1272 |
-
line-height: 1.3;
|
1273 |
-
margin: 1.1em 0 0.2em;
|
1274 |
-
text-align: center;
|
1275 |
-
}
|
1276 |
-
|
1277 |
-
.feature-section {
|
1278 |
-
padding: 40px 0;
|
1279 |
-
|
1280 |
-
h2 {
|
1281 |
-
margin-top: 20px;
|
1282 |
-
}
|
1283 |
-
}
|
1284 |
-
|
1285 |
-
.changelog {
|
1286 |
-
list-style: disc;
|
1287 |
-
padding-left: 15px;
|
1288 |
-
|
1289 |
-
li {
|
1290 |
-
margin: 0 0 0.75em;
|
1291 |
-
}
|
1292 |
-
}
|
1293 |
-
|
1294 |
-
.acf-three-col {
|
1295 |
-
display: flex;
|
1296 |
-
flex-wrap: wrap;
|
1297 |
-
justify-content: space-between;
|
1298 |
-
|
1299 |
-
> div {
|
1300 |
-
flex: 1;
|
1301 |
-
align-self: flex-start;
|
1302 |
-
min-width: 31%;
|
1303 |
-
max-width: 31%;
|
1304 |
-
|
1305 |
-
@media screen and (max-width: $md) {
|
1306 |
-
min-width: 48%;
|
1307 |
-
}
|
1308 |
-
|
1309 |
-
@media screen and (max-width: $sm) {
|
1310 |
-
min-width: 100%;
|
1311 |
-
}
|
1312 |
-
}
|
1313 |
-
|
1314 |
-
h3 .badge {
|
1315 |
-
display: inline-block;
|
1316 |
-
vertical-align: top;
|
1317 |
-
border-radius: 5px;
|
1318 |
-
background: #fc9700;
|
1319 |
-
color: #fff;
|
1320 |
-
font-weight: normal;
|
1321 |
-
font-size: 12px;
|
1322 |
-
padding: 2px 5px;
|
1323 |
-
}
|
1324 |
-
|
1325 |
-
img + h3 {
|
1326 |
-
margin-top: 0.5em;
|
1327 |
-
}
|
1328 |
-
}
|
1329 |
-
}
|
1330 |
-
|
1331 |
-
/*--------------------------------------------------------------------------------------------
|
1332 |
-
*
|
1333 |
-
* acf-hl cols
|
1334 |
-
*
|
1335 |
-
*--------------------------------------------------------------------------------------------*/
|
1336 |
-
|
1337 |
-
.acf-hl[data-cols] {
|
1338 |
-
margin-left: -10px;
|
1339 |
-
margin-right: -10px;
|
1340 |
-
|
1341 |
-
> li {
|
1342 |
-
padding: 0 10px;
|
1343 |
-
|
1344 |
-
-webkit-box-sizing: border-box;
|
1345 |
-
-moz-box-sizing: border-box;
|
1346 |
-
box-sizing: border-box;
|
1347 |
-
}
|
1348 |
-
|
1349 |
-
}
|
1350 |
-
|
1351 |
-
|
1352 |
-
/* sizes */
|
1353 |
-
.acf-hl[data-cols="2"] > li { width: 50%; }
|
1354 |
-
.acf-hl[data-cols="3"] > li { width: 33.333%; }
|
1355 |
-
.acf-hl[data-cols="4"] > li { width: 25%; }
|
1356 |
-
|
1357 |
-
|
1358 |
-
/* mobile */
|
1359 |
-
@media screen and (max-width: $sm) {
|
1360 |
-
|
1361 |
-
.acf-hl[data-cols] {
|
1362 |
-
margin-left: 0;
|
1363 |
-
margin-right: 0;
|
1364 |
-
margin-top: -10px;
|
1365 |
-
|
1366 |
-
> li {
|
1367 |
-
width: 100% !important;
|
1368 |
-
padding: 10px 0 0;
|
1369 |
-
}
|
1370 |
-
|
1371 |
-
}
|
1372 |
-
|
1373 |
-
}
|
1374 |
-
|
1375 |
-
|
1376 |
-
|
1377 |
-
/*--------------------------------------------------------------------------------------------
|
1378 |
-
*
|
1379 |
-
* misc
|
1380 |
-
*
|
1381 |
-
*--------------------------------------------------------------------------------------------*/
|
1382 |
-
|
1383 |
-
.acf-actions {
|
1384 |
-
text-align: right;
|
1385 |
-
z-index: 1;
|
1386 |
-
|
1387 |
-
a {
|
1388 |
-
margin-left: 4px;
|
1389 |
-
}
|
1390 |
-
|
1391 |
-
|
1392 |
-
/* hover */
|
1393 |
-
&.-hover {
|
1394 |
-
position: absolute;
|
1395 |
-
display: none;
|
1396 |
-
top: 0;
|
1397 |
-
right: 0;
|
1398 |
-
padding: 5px;
|
1399 |
-
}
|
1400 |
-
|
1401 |
-
|
1402 |
-
/* rtl */
|
1403 |
-
html[dir="rtl"] & {
|
1404 |
-
|
1405 |
-
a {
|
1406 |
-
margin-left: 0;
|
1407 |
-
margin-right: 4px;
|
1408 |
-
}
|
1409 |
-
|
1410 |
-
&.-hover {
|
1411 |
-
right: auto;
|
1412 |
-
left: 0;
|
1413 |
-
}
|
1414 |
-
|
1415 |
-
}
|
1416 |
-
}
|
1417 |
-
|
1418 |
-
|
1419 |
-
/* ul compatibility */
|
1420 |
-
ul.acf-actions {
|
1421 |
-
li { float: right; margin-left: 4px; }
|
1422 |
-
}
|
1423 |
-
|
1424 |
-
|
1425 |
-
/*--------------------------------------------------------------------------------------------
|
1426 |
-
*
|
1427 |
-
* Plugins
|
1428 |
-
*
|
1429 |
-
*--------------------------------------------------------------------------------------------*/
|
1430 |
-
|
1431 |
-
.acf-plugin-upgrade-notice {
|
1432 |
-
font-weight: normal;
|
1433 |
-
color: #fff;
|
1434 |
-
background: #d54d21;
|
1435 |
-
padding: 1em;
|
1436 |
-
margin: 9px 0;
|
1437 |
-
|
1438 |
-
&:before {
|
1439 |
-
content: "\f348";
|
1440 |
-
display: inline-block;
|
1441 |
-
font: 400 18px/1 dashicons;
|
1442 |
-
speak: none;
|
1443 |
-
margin: 0 8px 0 -2px;
|
1444 |
-
-webkit-font-smoothing: antialiased;
|
1445 |
-
-moz-osx-font-smoothing: grayscale;
|
1446 |
-
vertical-align: top;
|
1447 |
-
}
|
1448 |
-
|
1449 |
-
h4 {
|
1450 |
-
display: none;
|
1451 |
-
}
|
1452 |
-
|
1453 |
-
ul,
|
1454 |
-
li {
|
1455 |
-
display: inline;
|
1456 |
-
color: inherit;
|
1457 |
-
list-style: none;
|
1458 |
-
}
|
1459 |
-
|
1460 |
-
li:after {
|
1461 |
-
content: '. ';
|
1462 |
-
display: inline;
|
1463 |
-
}
|
1464 |
-
|
1465 |
-
}
|
1466 |
-
|
1467 |
-
|
1468 |
-
/*--------------------------------------------------------------------------------------------
|
1469 |
-
*
|
1470 |
-
* RTL
|
1471 |
-
*
|
1472 |
-
*--------------------------------------------------------------------------------------------*/
|
1473 |
-
|
1474 |
-
html[dir="rtl"] .acf-fl { float: right; }
|
1475 |
-
html[dir="rtl"] .acf-fr { float: left; }
|
1476 |
-
|
1477 |
-
html[dir="rtl"] .acf-hl > li {
|
1478 |
-
float: right;
|
1479 |
-
}
|
1480 |
-
|
1481 |
-
html[dir="rtl"] .acf-hl > li.acf-fr {
|
1482 |
-
float: left;
|
1483 |
-
}
|
1484 |
-
|
1485 |
-
html[dir="rtl"] .acf-icon.logo {
|
1486 |
-
left: 0;
|
1487 |
-
right: auto;
|
1488 |
-
}
|
1489 |
-
|
1490 |
-
|
1491 |
-
html[dir="rtl"] .acf-table thead th {
|
1492 |
-
text-align: right;
|
1493 |
-
border-right-width: 1px;
|
1494 |
-
border-left-width: 0px;
|
1495 |
-
}
|
1496 |
-
|
1497 |
-
html[dir="rtl"] .acf-table > tbody > tr > td {
|
1498 |
-
text-align: right;
|
1499 |
-
border-right-width: 1px;
|
1500 |
-
border-left-width: 0px;
|
1501 |
-
}
|
1502 |
-
|
1503 |
-
html[dir="rtl"] .acf-table > thead > tr > th:first-child,
|
1504 |
-
html[dir="rtl"] .acf-table > tbody > tr > td:first-child {
|
1505 |
-
border-right-width: 0;
|
1506 |
-
}
|
1507 |
-
|
1508 |
-
html[dir="rtl"] .acf-table > tbody > tr > td.order + td {
|
1509 |
-
border-right-color: #e1e1e1;
|
1510 |
-
}
|
1511 |
-
|
1512 |
-
|
1513 |
-
/*---------------------------------------------------------------------------------------------
|
1514 |
-
*
|
1515 |
-
* acf-postbox-columns
|
1516 |
-
*
|
1517 |
-
*---------------------------------------------------------------------------------------------*/
|
1518 |
-
|
1519 |
-
.acf-postbox-columns {
|
1520 |
-
@include clearfix();
|
1521 |
-
position: relative;
|
1522 |
-
margin-top: -11px;
|
1523 |
-
margin-bottom: -11px;
|
1524 |
-
margin-left: -12px;
|
1525 |
-
margin-right: (280px - 12px);
|
1526 |
-
|
1527 |
-
.acf-postbox-main,
|
1528 |
-
.acf-postbox-side {
|
1529 |
-
@include border-box();
|
1530 |
-
padding: 0 12px 12px;
|
1531 |
-
}
|
1532 |
-
|
1533 |
-
.acf-postbox-main {
|
1534 |
-
float: left;
|
1535 |
-
width: 100%;
|
1536 |
-
}
|
1537 |
-
|
1538 |
-
.acf-postbox-side {
|
1539 |
-
float: right;
|
1540 |
-
width: 280px;
|
1541 |
-
margin-right: -280px;
|
1542 |
-
|
1543 |
-
&:before {
|
1544 |
-
content: "";
|
1545 |
-
display: block;
|
1546 |
-
position: absolute;
|
1547 |
-
width: 1px;
|
1548 |
-
height: 100%;
|
1549 |
-
top: 0;
|
1550 |
-
right: 0;
|
1551 |
-
background: #ebebeb;
|
1552 |
-
}
|
1553 |
-
}
|
1554 |
-
}
|
1555 |
-
|
1556 |
-
|
1557 |
-
/* mobile */
|
1558 |
-
@media only screen and (max-width: 850px) {
|
1559 |
-
|
1560 |
-
.acf-postbox-columns {
|
1561 |
-
margin: 0;
|
1562 |
-
|
1563 |
-
.acf-postbox-main,
|
1564 |
-
.acf-postbox-side {
|
1565 |
-
float: none;
|
1566 |
-
width: auto;
|
1567 |
-
margin: 0;
|
1568 |
-
padding: 0;
|
1569 |
-
}
|
1570 |
-
|
1571 |
-
.acf-postbox-side {
|
1572 |
-
margin-top: 1em;
|
1573 |
-
|
1574 |
-
&:before {
|
1575 |
-
display: none;
|
1576 |
-
}
|
1577 |
-
}
|
1578 |
-
}
|
1579 |
-
}
|
1580 |
-
|
1581 |
-
|
1582 |
-
/*---------------------------------------------------------------------------------------------
|
1583 |
-
*
|
1584 |
-
* acf-panel
|
1585 |
-
*
|
1586 |
-
*---------------------------------------------------------------------------------------------*/
|
1587 |
-
|
1588 |
-
.acf-panel {
|
1589 |
-
margin-top: -1px;
|
1590 |
-
border-top: 1px solid #e2e4e7;
|
1591 |
-
border-bottom: 1px solid #e2e4e7;
|
1592 |
-
|
1593 |
-
.acf-panel-title {
|
1594 |
-
margin: 0;
|
1595 |
-
padding: 12px;
|
1596 |
-
font-weight: bold;
|
1597 |
-
cursor: pointer;
|
1598 |
-
font-size: inherit;
|
1599 |
-
|
1600 |
-
i {
|
1601 |
-
float: right;
|
1602 |
-
}
|
1603 |
-
}
|
1604 |
-
|
1605 |
-
.acf-panel-inside {
|
1606 |
-
margin: 0;
|
1607 |
-
padding: 0 12px 12px;
|
1608 |
-
display: none;
|
1609 |
-
}
|
1610 |
-
|
1611 |
-
/* open */
|
1612 |
-
&.-open {
|
1613 |
-
|
1614 |
-
.acf-panel-inside {
|
1615 |
-
display: block;
|
1616 |
-
}
|
1617 |
-
|
1618 |
-
}
|
1619 |
-
|
1620 |
-
|
1621 |
-
/* inside postbox */
|
1622 |
-
.postbox & {
|
1623 |
-
margin-left: -12px;
|
1624 |
-
margin-right: -12px;
|
1625 |
-
}
|
1626 |
-
|
1627 |
-
|
1628 |
-
/* fields */
|
1629 |
-
.acf-field {
|
1630 |
-
margin: 20px 0 0;
|
1631 |
-
|
1632 |
-
.acf-label label {
|
1633 |
-
color: #555d66;
|
1634 |
-
font-weight: normal;
|
1635 |
-
}
|
1636 |
-
|
1637 |
-
&:first-child {
|
1638 |
-
margin-top: 0;
|
1639 |
-
}
|
1640 |
-
}
|
1641 |
-
|
1642 |
-
}
|
1643 |
-
|
1644 |
-
|
1645 |
-
/*---------------------------------------------------------------------------------------------
|
1646 |
-
*
|
1647 |
-
* Admin Tools
|
1648 |
-
*
|
1649 |
-
*---------------------------------------------------------------------------------------------*/
|
1650 |
-
|
1651 |
-
#acf-admin-tools {
|
1652 |
-
|
1653 |
-
.notice {
|
1654 |
-
margin-top: 10px;
|
1655 |
-
}
|
1656 |
-
}
|
1657 |
-
|
1658 |
-
.acf-meta-box-wrap {
|
1659 |
-
margin-top: 10px;
|
1660 |
-
|
1661 |
-
.postbox {
|
1662 |
-
@include border-box();
|
1663 |
-
|
1664 |
-
.inside {
|
1665 |
-
margin-bottom: 0;
|
1666 |
-
}
|
1667 |
-
|
1668 |
-
.hndle {
|
1669 |
-
font-size: 14px;
|
1670 |
-
padding: 8px 12px;
|
1671 |
-
margin: 0;
|
1672 |
-
line-height: 1.4;
|
1673 |
-
}
|
1674 |
-
|
1675 |
-
.handlediv {
|
1676 |
-
display: none;
|
1677 |
-
}
|
1678 |
-
}
|
1679 |
-
|
1680 |
-
|
1681 |
-
/* acf-fields */
|
1682 |
-
.acf-fields {
|
1683 |
-
border: #ebebeb solid 1px;
|
1684 |
-
background: #fafafa;
|
1685 |
-
border-radius: 3px;
|
1686 |
-
}
|
1687 |
-
}
|
1688 |
-
|
1689 |
-
|
1690 |
-
/* grid */
|
1691 |
-
.acf-meta-box-wrap.-grid {
|
1692 |
-
margin-left: 8px;
|
1693 |
-
margin-right: 8px;
|
1694 |
-
|
1695 |
-
.postbox {
|
1696 |
-
float: left;
|
1697 |
-
clear: left;
|
1698 |
-
width: 50%;
|
1699 |
-
margin: 0 0 16px;
|
1700 |
-
|
1701 |
-
&:nth-child(odd) {
|
1702 |
-
margin-left: -8px;
|
1703 |
-
}
|
1704 |
-
|
1705 |
-
&:nth-child(even) {
|
1706 |
-
float: right;
|
1707 |
-
clear: right;
|
1708 |
-
margin-right: -8px;
|
1709 |
-
}
|
1710 |
-
}
|
1711 |
-
}
|
1712 |
-
|
1713 |
-
|
1714 |
-
/* mobile */
|
1715 |
-
@media only screen and (max-width: 850px) {
|
1716 |
-
|
1717 |
-
.acf-meta-box-wrap.-grid {
|
1718 |
-
margin-left: 0;
|
1719 |
-
margin-right: 0;
|
1720 |
-
|
1721 |
-
.postbox {
|
1722 |
-
margin-left: 0 !important;
|
1723 |
-
margin-right: 0 !important;
|
1724 |
-
width: 100%;
|
1725 |
-
}
|
1726 |
-
}
|
1727 |
-
}
|
1728 |
-
|
1729 |
-
|
1730 |
-
/* export tool */
|
1731 |
-
#acf-admin-tool-export {
|
1732 |
-
|
1733 |
-
p {
|
1734 |
-
max-width: 800px;
|
1735 |
-
}
|
1736 |
-
|
1737 |
-
ul {
|
1738 |
-
column-width: 200px;
|
1739 |
-
}
|
1740 |
-
|
1741 |
-
.acf-postbox-side .button {
|
1742 |
-
margin: 0;
|
1743 |
-
width: 100%;
|
1744 |
-
}
|
1745 |
-
|
1746 |
-
textarea {
|
1747 |
-
display: block;
|
1748 |
-
width: 100%;
|
1749 |
-
min-height: 500px;
|
1750 |
-
|
1751 |
-
background: #fafafa;
|
1752 |
-
box-shadow: none;
|
1753 |
-
padding: 7px;
|
1754 |
-
border-radius: 3px;
|
1755 |
-
}
|
1756 |
-
|
1757 |
-
/* panel: selection */
|
1758 |
-
.acf-panel-selection {
|
1759 |
-
.acf-label {
|
1760 |
-
display: none;
|
1761 |
-
}
|
1762 |
-
}
|
1763 |
-
}
|
1764 |
-
|
1765 |
-
/*---------------------------------------------------------------------------------------------
|
1766 |
-
*
|
1767 |
-
* Retina
|
1768 |
-
*
|
1769 |
-
*---------------------------------------------------------------------------------------------*/
|
1770 |
-
|
1771 |
-
@media
|
1772 |
-
only screen and (-webkit-min-device-pixel-ratio: 2),
|
1773 |
-
only screen and ( min--moz-device-pixel-ratio: 2),
|
1774 |
-
only screen and ( -o-min-device-pixel-ratio: 2/1),
|
1775 |
-
only screen and ( min-device-pixel-ratio: 2),
|
1776 |
-
only screen and ( min-resolution: 192dpi),
|
1777 |
-
only screen and ( min-resolution: 2dppx) {
|
1778 |
-
|
1779 |
-
.acf-loading,
|
1780 |
-
.acf-spinner {
|
1781 |
-
background-image: url(../images/spinner@2x.gif);
|
1782 |
-
background-size: 20px 20px;
|
1783 |
-
}
|
1784 |
-
|
1785 |
-
}
|
1786 |
-
|
1787 |
-
|
1788 |
-
/*---------------------------------------------------------------------------------------------
|
1789 |
-
*
|
1790 |
-
* Device
|
1791 |
-
*
|
1792 |
-
*---------------------------------------------------------------------------------------------*/
|
1793 |
-
|
1794 |
-
@media only screen and (max-width: 850px) {
|
1795 |
-
|
1796 |
-
.acf-columns-2 {
|
1797 |
-
margin-right: 0;
|
1798 |
-
}
|
1799 |
-
|
1800 |
-
.acf-columns-2 .acf-column-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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/build/css/_gutenberg.scss
DELETED
@@ -1,220 +0,0 @@
|
|
1 |
-
/*--------------------------------------------------------------------------------------------
|
2 |
-
*
|
3 |
-
* Gutenberg
|
4 |
-
*
|
5 |
-
*--------------------------------------------------------------------------------------------*/
|
6 |
-
#editor {
|
7 |
-
|
8 |
-
// main column is split into "editor" and "metaboxes".
|
9 |
-
// remove WP flex that pushed metaboxes to bottom
|
10 |
-
.edit-post-visual-editor,
|
11 |
-
.edit-post-layout__metaboxes {
|
12 |
-
flex-basis: 0%;
|
13 |
-
flex-grow: 0;
|
14 |
-
}
|
15 |
-
|
16 |
-
// metabox wrap
|
17 |
-
.edit-post-layout__metaboxes {
|
18 |
-
background: transparent;
|
19 |
-
border-top: 0 none;
|
20 |
-
margin-top: 0;
|
21 |
-
padding: 46px 14px;
|
22 |
-
|
23 |
-
@media screen and (min-width: 600px) {
|
24 |
-
padding: 46px;
|
25 |
-
}
|
26 |
-
@media screen and (min-width: 1200px) {
|
27 |
-
padding: 56px 66px;
|
28 |
-
}
|
29 |
-
|
30 |
-
&:empty {
|
31 |
-
display: none;
|
32 |
-
};
|
33 |
-
|
34 |
-
.edit-post-meta-boxes-area {
|
35 |
-
margin: 0;
|
36 |
-
}
|
37 |
-
|
38 |
-
// make postbox look like a classic box
|
39 |
-
.postbox {
|
40 |
-
border: #e2e4e7 solid 1px;
|
41 |
-
border-bottom: none;
|
42 |
-
margin: 0 0 20px;
|
43 |
-
|
44 |
-
input {
|
45 |
-
max-width: none;
|
46 |
-
}
|
47 |
-
}
|
48 |
-
}
|
49 |
-
|
50 |
-
// improve handle style
|
51 |
-
.postbox {
|
52 |
-
.handlediv {
|
53 |
-
height: 46px;
|
54 |
-
width: auto;
|
55 |
-
padding: 0 14px 0 5px;
|
56 |
-
}
|
57 |
-
.hndle {
|
58 |
-
color: #191e23 !important;
|
59 |
-
font-size: 13px;
|
60 |
-
line-height: 16px;
|
61 |
-
|
62 |
-
.acf-hndle-cog {
|
63 |
-
line-height: 16px;
|
64 |
-
}
|
65 |
-
}
|
66 |
-
|
67 |
-
// change icons to match gutenberg sidebar accordions
|
68 |
-
.handlediv .toggle-indicator {
|
69 |
-
color: #191e23;
|
70 |
-
}
|
71 |
-
.handlediv .toggle-indicator:before {
|
72 |
-
content: "\f343";
|
73 |
-
font-size: 18px;
|
74 |
-
width: auto;
|
75 |
-
}
|
76 |
-
&.closed .handlediv .toggle-indicator:before {
|
77 |
-
content: "\f347";
|
78 |
-
}
|
79 |
-
}
|
80 |
-
|
81 |
-
// acf-input-wrap
|
82 |
-
.acf-input-prepend,
|
83 |
-
.acf-input-append {
|
84 |
-
box-sizing: border-box;
|
85 |
-
height: 28px;
|
86 |
-
}
|
87 |
-
|
88 |
-
// accordion
|
89 |
-
.acf-accordion {
|
90 |
-
padding: 0 !important;
|
91 |
-
|
92 |
-
.acf-accordion-title {
|
93 |
-
color: #191e23;
|
94 |
-
font-weight: 600;
|
95 |
-
|
96 |
-
&:hover {
|
97 |
-
background: #f8f9f9;
|
98 |
-
}
|
99 |
-
|
100 |
-
label {
|
101 |
-
font-weight: inherit;
|
102 |
-
}
|
103 |
-
}
|
104 |
-
}
|
105 |
-
|
106 |
-
// table
|
107 |
-
.acf-table {
|
108 |
-
box-sizing: border-box;
|
109 |
-
|
110 |
-
.acf-row-handle {
|
111 |
-
width: 32px;
|
112 |
-
}
|
113 |
-
}
|
114 |
-
|
115 |
-
// main error message
|
116 |
-
.components-notice-list .acf-notice.-error {
|
117 |
-
margin: 0 0 5px;
|
118 |
-
min-height: 50px;
|
119 |
-
padding: 6px 12px;
|
120 |
-
border-left: 4px solid #00a0d2;
|
121 |
-
color: #191e23;
|
122 |
-
background-color: #f9e2e2;
|
123 |
-
border-left-color: #d94f4f;
|
124 |
-
|
125 |
-
p {
|
126 |
-
margin: 1em 0;
|
127 |
-
}
|
128 |
-
|
129 |
-
.acf-notice-dismiss {
|
130 |
-
top: 15px;
|
131 |
-
right: 15px;
|
132 |
-
}
|
133 |
-
}
|
134 |
-
}
|
135 |
-
|
136 |
-
// acf-block
|
137 |
-
.acf-block {
|
138 |
-
|
139 |
-
}
|
140 |
-
|
141 |
-
// block body
|
142 |
-
.acf-block-body {
|
143 |
-
|
144 |
-
.acf-block-fields {
|
145 |
-
border: #e2e4e7 solid 1px;
|
146 |
-
|
147 |
-
div.acf-field {
|
148 |
-
padding: 16px 20px;
|
149 |
-
}
|
150 |
-
}
|
151 |
-
}
|
152 |
-
|
153 |
-
// block panel
|
154 |
-
.acf-block-panel {
|
155 |
-
|
156 |
-
// panel actions
|
157 |
-
.acf-block-panel-actions {
|
158 |
-
margin: 16px -16px;
|
159 |
-
padding: 0 16px;
|
160 |
-
|
161 |
-
button {
|
162 |
-
padding: 0 12px 2px;
|
163 |
-
font-size: 13px;
|
164 |
-
margin: 2px;
|
165 |
-
height: 33px;
|
166 |
-
line-height: 32px;
|
167 |
-
width: 100%;
|
168 |
-
}
|
169 |
-
}
|
170 |
-
|
171 |
-
// fields
|
172 |
-
.acf-block-fields {
|
173 |
-
border: none;
|
174 |
-
border-top: #e2e4e7 solid 1px;
|
175 |
-
margin: 0 -16px -16px;
|
176 |
-
padding: 0;
|
177 |
-
|
178 |
-
// field
|
179 |
-
div.acf-field {
|
180 |
-
padding: 16px;
|
181 |
-
|
182 |
-
width: auto !important;
|
183 |
-
min-height: 0 !important;
|
184 |
-
border-left: none !important;
|
185 |
-
float: none !important;
|
186 |
-
}
|
187 |
-
}
|
188 |
-
|
189 |
-
// accordion
|
190 |
-
.acf-accordion .acf-accordion-title .acf-accordion-icon {
|
191 |
-
font-size: 18px;
|
192 |
-
line-height: inherit;
|
193 |
-
|
194 |
-
// open
|
195 |
-
&.dashicons-arrow-down:before {
|
196 |
-
content: "\f343";
|
197 |
-
}
|
198 |
-
|
199 |
-
// closed
|
200 |
-
&.dashicons-arrow-right:before {
|
201 |
-
content: "\f347";
|
202 |
-
}
|
203 |
-
}
|
204 |
-
}
|
205 |
-
|
206 |
-
// block loading
|
207 |
-
.acf-block-loading {
|
208 |
-
background: #f3f3f4;
|
209 |
-
min-height: 200px;
|
210 |
-
position: relative;
|
211 |
-
|
212 |
-
i {
|
213 |
-
@include centered();
|
214 |
-
}
|
215 |
-
}
|
216 |
-
|
217 |
-
// hide is-loading
|
218 |
-
.acf-block-fields.is-loading {
|
219 |
-
display: none;
|
220 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/build/css/_input.scss
DELETED
@@ -1,61 +0,0 @@
|
|
1 |
-
/*--------------------------------------------------------------------------------------------
|
2 |
-
*
|
3 |
-
* Confirm remove
|
4 |
-
*
|
5 |
-
*--------------------------------------------------------------------------------------------*/
|
6 |
-
|
7 |
-
.acf-temp-remove {
|
8 |
-
position: relative;
|
9 |
-
opacity: 1;
|
10 |
-
-webkit-transition: all 0.25s ease;
|
11 |
-
-moz-transition: all 0.25s ease;
|
12 |
-
-o-transition: all 0.25s ease;
|
13 |
-
transition: all 0.25s ease;
|
14 |
-
overflow: hidden;
|
15 |
-
|
16 |
-
/* overlay prevents hover */
|
17 |
-
&:after {
|
18 |
-
display: block;
|
19 |
-
content: "";
|
20 |
-
position: absolute;
|
21 |
-
top: 0;
|
22 |
-
left: 0;
|
23 |
-
right: 0;
|
24 |
-
bottom: 0;
|
25 |
-
z-index: 99;
|
26 |
-
}
|
27 |
-
}
|
28 |
-
|
29 |
-
|
30 |
-
/*--------------------------------------------------------------------------
|
31 |
-
*
|
32 |
-
* Conditional Logic
|
33 |
-
*
|
34 |
-
*-------------------------------------------------------------------------*/
|
35 |
-
|
36 |
-
/* Hide */
|
37 |
-
.hidden-by-conditional-logic {
|
38 |
-
display: none !important;
|
39 |
-
}
|
40 |
-
|
41 |
-
|
42 |
-
/* Hide (appear empty) */
|
43 |
-
.hidden-by-conditional-logic.appear-empty {
|
44 |
-
display: table-cell !important;
|
45 |
-
}
|
46 |
-
|
47 |
-
.hidden-by-conditional-logic.appear-empty .acf-input {
|
48 |
-
display: none !important;
|
49 |
-
}
|
50 |
-
|
51 |
-
|
52 |
-
/*--------------------------------------------------------------------------
|
53 |
-
*
|
54 |
-
* 3rd Party
|
55 |
-
*
|
56 |
-
*-------------------------------------------------------------------------*/
|
57 |
-
|
58 |
-
/* Tabify shows hidden postboxes */
|
59 |
-
.acf-postbox.acf-hidden {
|
60 |
-
display: none !important;
|
61 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/build/css/_media.scss
DELETED
@@ -1,513 +0,0 @@
|
|
1 |
-
/*---------------------------------------------------------------------------------------------
|
2 |
-
*
|
3 |
-
* Media Model
|
4 |
-
*
|
5 |
-
*---------------------------------------------------------------------------------------------*/
|
6 |
-
|
7 |
-
/* WP sets tables to act as divs. ACF uses tables, so these muct be reset */
|
8 |
-
.media-modal .compat-attachment-fields td.acf-input {
|
9 |
-
|
10 |
-
table {
|
11 |
-
display: table;
|
12 |
-
table-layout: auto;
|
13 |
-
|
14 |
-
tbody {
|
15 |
-
display: table-row-group;
|
16 |
-
}
|
17 |
-
|
18 |
-
tr {
|
19 |
-
display: table-row;
|
20 |
-
}
|
21 |
-
|
22 |
-
td, th {
|
23 |
-
display: table-cell;
|
24 |
-
}
|
25 |
-
|
26 |
-
}
|
27 |
-
|
28 |
-
}
|
29 |
-
|
30 |
-
|
31 |
-
/* field widths floats */
|
32 |
-
.media-modal .compat-attachment-fields > tbody > .acf-field {
|
33 |
-
margin: 5px 0;
|
34 |
-
|
35 |
-
> .acf-label {
|
36 |
-
min-width: 30%;
|
37 |
-
margin: 0;
|
38 |
-
padding: 0;
|
39 |
-
float: left;
|
40 |
-
text-align: right;
|
41 |
-
display: block;
|
42 |
-
float: left;
|
43 |
-
|
44 |
-
> label {
|
45 |
-
padding-top: 6px;
|
46 |
-
margin: 0;
|
47 |
-
color: #666666;
|
48 |
-
font-weight: 400;
|
49 |
-
line-height: 16px;
|
50 |
-
}
|
51 |
-
}
|
52 |
-
|
53 |
-
> .acf-input {
|
54 |
-
width: 65%;
|
55 |
-
margin: 0;
|
56 |
-
padding: 0;
|
57 |
-
float: right;
|
58 |
-
display: block;
|
59 |
-
}
|
60 |
-
|
61 |
-
p.description {
|
62 |
-
margin: 0;
|
63 |
-
}
|
64 |
-
}
|
65 |
-
|
66 |
-
|
67 |
-
/* restricted selection (copy of WP .upload-errors)*/
|
68 |
-
.acf-selection-error {
|
69 |
-
background: #ffebe8;
|
70 |
-
border: 1px solid #c00;
|
71 |
-
border-radius: 3px;
|
72 |
-
padding: 8px;
|
73 |
-
margin: 20px 0 0;
|
74 |
-
|
75 |
-
.selection-error-label {
|
76 |
-
background: #CC0000;
|
77 |
-
border-radius: 3px;
|
78 |
-
color: #fff;
|
79 |
-
font-weight: bold;
|
80 |
-
margin-right: 8px;
|
81 |
-
padding: 2px 4px;
|
82 |
-
}
|
83 |
-
|
84 |
-
.selection-error-message {
|
85 |
-
color: #b44;
|
86 |
-
display: block;
|
87 |
-
padding-top: 8px;
|
88 |
-
word-wrap: break-word;
|
89 |
-
white-space: pre-wrap;
|
90 |
-
}
|
91 |
-
}
|
92 |
-
|
93 |
-
|
94 |
-
/* disabled attachment */
|
95 |
-
.media-modal .attachment.acf-disabled {
|
96 |
-
|
97 |
-
.thumbnail {
|
98 |
-
opacity: 0.25 !important;
|
99 |
-
}
|
100 |
-
|
101 |
-
.attachment-preview:before {
|
102 |
-
background: rgba(0,0,0,0.15);
|
103 |
-
z-index: 1;
|
104 |
-
position: relative;
|
105 |
-
}
|
106 |
-
|
107 |
-
}
|
108 |
-
|
109 |
-
|
110 |
-
/* misc */
|
111 |
-
.media-modal {
|
112 |
-
|
113 |
-
/* compat-item */
|
114 |
-
.compat-field-acf-form-data,
|
115 |
-
.compat-field-acf-blank {
|
116 |
-
display: none !important;
|
117 |
-
}
|
118 |
-
|
119 |
-
|
120 |
-
/* allow line breaks in upload error */
|
121 |
-
.upload-error-message {
|
122 |
-
white-space: pre-wrap;
|
123 |
-
}
|
124 |
-
|
125 |
-
|
126 |
-
/* fix required span */
|
127 |
-
.acf-required {
|
128 |
-
padding: 0 !important;
|
129 |
-
margin: 0 !important;
|
130 |
-
float: none !important;
|
131 |
-
color: #f00 !important;
|
132 |
-
}
|
133 |
-
|
134 |
-
|
135 |
-
/* sidebar */
|
136 |
-
.media-sidebar {
|
137 |
-
|
138 |
-
.compat-item{
|
139 |
-
padding-bottom: 20px;
|
140 |
-
}
|
141 |
-
|
142 |
-
}
|
143 |
-
|
144 |
-
|
145 |
-
/* mobile md */
|
146 |
-
@media (max-width: 900px) {
|
147 |
-
|
148 |
-
/* label */
|
149 |
-
.setting span,
|
150 |
-
.compat-attachment-fields > tbody > .acf-field > .acf-label {
|
151 |
-
width: 98%;
|
152 |
-
float: none;
|
153 |
-
text-align: left;
|
154 |
-
min-height: 0;
|
155 |
-
padding: 0;
|
156 |
-
}
|
157 |
-
|
158 |
-
|
159 |
-
/* field */
|
160 |
-
.setting input,
|
161 |
-
.setting textarea,
|
162 |
-
.compat-attachment-fields > tbody > .acf-field > .acf-input {
|
163 |
-
float: none;
|
164 |
-
height: auto;
|
165 |
-
max-width: none;
|
166 |
-
width: 98%;
|
167 |
-
}
|
168 |
-
|
169 |
-
}
|
170 |
-
|
171 |
-
|
172 |
-
}
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
/*---------------------------------------------------------------------------------------------
|
177 |
-
*
|
178 |
-
* Media Model (expand details)
|
179 |
-
*
|
180 |
-
*---------------------------------------------------------------------------------------------*/
|
181 |
-
|
182 |
-
.media-modal .acf-expand-details {
|
183 |
-
float: right;
|
184 |
-
padding: 1px 10px;
|
185 |
-
margin-right: 6px;
|
186 |
-
height: 18px;
|
187 |
-
line-height: 18px;
|
188 |
-
color: #AAAAAA;
|
189 |
-
font-size: 12px;
|
190 |
-
|
191 |
-
&:focus, &:active {
|
192 |
-
outline: 0 none;
|
193 |
-
box-shadow: none;
|
194 |
-
color: #AAAAAA;
|
195 |
-
}
|
196 |
-
|
197 |
-
&:hover {
|
198 |
-
color: #666666 !important;
|
199 |
-
}
|
200 |
-
|
201 |
-
span {
|
202 |
-
display: block;
|
203 |
-
float: left;
|
204 |
-
}
|
205 |
-
|
206 |
-
.acf-icon {
|
207 |
-
margin: 0 4px 0 0;
|
208 |
-
}
|
209 |
-
|
210 |
-
&:hover .acf-icon {
|
211 |
-
border-color: #AAAAAA;
|
212 |
-
}
|
213 |
-
|
214 |
-
.is-open { display: none; }
|
215 |
-
.is-closed { display: block; }
|
216 |
-
|
217 |
-
|
218 |
-
/* mobile sm */
|
219 |
-
@media (max-width: $sm) {
|
220 |
-
display: none;
|
221 |
-
}
|
222 |
-
}
|
223 |
-
|
224 |
-
|
225 |
-
/* expanded */
|
226 |
-
.media-modal.acf-expanded {
|
227 |
-
|
228 |
-
/* toggle */
|
229 |
-
.acf-expand-details {
|
230 |
-
|
231 |
-
.is-open { display: block; }
|
232 |
-
.is-closed { display: none; }
|
233 |
-
|
234 |
-
}
|
235 |
-
|
236 |
-
|
237 |
-
/* resize */
|
238 |
-
.attachments-browser .media-toolbar,
|
239 |
-
.attachments-browser .attachments { right: 740px; }
|
240 |
-
.media-sidebar { width: 708px; }
|
241 |
-
|
242 |
-
|
243 |
-
/* label & fields */
|
244 |
-
.media-sidebar {
|
245 |
-
|
246 |
-
/* label */
|
247 |
-
.attachment-info .thumbnail,
|
248 |
-
.setting span,
|
249 |
-
.compat-attachment-fields > tbody > .acf-field > .acf-label {
|
250 |
-
min-width: 20%;
|
251 |
-
}
|
252 |
-
|
253 |
-
|
254 |
-
/* field */
|
255 |
-
.attachment-info .details,
|
256 |
-
.setting input,
|
257 |
-
.setting textarea,
|
258 |
-
.compat-attachment-fields > tbody > .acf-field > .acf-input {
|
259 |
-
min-width: 77%;
|
260 |
-
}
|
261 |
-
|
262 |
-
.setting span {
|
263 |
-
margin-right: 2%;
|
264 |
-
}
|
265 |
-
|
266 |
-
|
267 |
-
/* larger thumbnail */
|
268 |
-
.attachment-info {
|
269 |
-
|
270 |
-
.thumbnail {
|
271 |
-
max-height: none;
|
272 |
-
|
273 |
-
img {
|
274 |
-
max-width: 100%;
|
275 |
-
max-height: 200px;
|
276 |
-
}
|
277 |
-
|
278 |
-
}
|
279 |
-
|
280 |
-
.details {
|
281 |
-
float: right;
|
282 |
-
|
283 |
-
}
|
284 |
-
|
285 |
-
}
|
286 |
-
|
287 |
-
}
|
288 |
-
|
289 |
-
|
290 |
-
/* mobile md */
|
291 |
-
@media (max-width: 900px) {
|
292 |
-
|
293 |
-
/* resize */
|
294 |
-
.attachments-browser .media-toolbar { display: none; }
|
295 |
-
.attachments { display: none; }
|
296 |
-
.media-sidebar { width: auto; max-width: none !important; }
|
297 |
-
|
298 |
-
|
299 |
-
.media-sidebar {
|
300 |
-
|
301 |
-
.attachment-info {
|
302 |
-
|
303 |
-
.thumbnail {
|
304 |
-
min-width: 30%;
|
305 |
-
margin: 0;
|
306 |
-
}
|
307 |
-
|
308 |
-
.details {
|
309 |
-
min-width: 67%;
|
310 |
-
}
|
311 |
-
|
312 |
-
}
|
313 |
-
|
314 |
-
}
|
315 |
-
|
316 |
-
}
|
317 |
-
|
318 |
-
}
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
/*---------------------------------------------------------------------------------------------
|
323 |
-
*
|
324 |
-
* ACF Media Model
|
325 |
-
*
|
326 |
-
*---------------------------------------------------------------------------------------------*/
|
327 |
-
|
328 |
-
.acf-media-modal {
|
329 |
-
|
330 |
-
/* hide embed settings */
|
331 |
-
.media-embed {
|
332 |
-
|
333 |
-
.setting.align,
|
334 |
-
.setting.link-to {
|
335 |
-
display: none;
|
336 |
-
}
|
337 |
-
|
338 |
-
}
|
339 |
-
|
340 |
-
// only allow for devices larger than mobile
|
341 |
-
@media screen and (min-width: 1024px) {
|
342 |
-
|
343 |
-
// - requires long selector to override WP core
|
344 |
-
.media-modal-content .media-frame .media-toolbar-secondary {
|
345 |
-
max-width: none;
|
346 |
-
|
347 |
-
select.attachment-filters {
|
348 |
-
width: auto;
|
349 |
-
min-width: 150px;
|
350 |
-
max-width: none;
|
351 |
-
margin: 11px 6px 0 0;
|
352 |
-
vertical-align: middle;
|
353 |
-
}
|
354 |
-
}
|
355 |
-
}
|
356 |
-
}
|
357 |
-
|
358 |
-
|
359 |
-
/*---------------------------------------------------------------------------------------------
|
360 |
-
*
|
361 |
-
* ACF Media Model (Select Mode)
|
362 |
-
*
|
363 |
-
*---------------------------------------------------------------------------------------------*/
|
364 |
-
|
365 |
-
.acf-media-modal.-select {
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
}
|
370 |
-
|
371 |
-
|
372 |
-
/*---------------------------------------------------------------------------------------------
|
373 |
-
*
|
374 |
-
* ACF Media Model (Edit Mode)
|
375 |
-
*
|
376 |
-
*---------------------------------------------------------------------------------------------*/
|
377 |
-
|
378 |
-
.acf-media-modal.-edit {
|
379 |
-
|
380 |
-
/* resize modal */
|
381 |
-
left: 15%;
|
382 |
-
right: 15%;
|
383 |
-
top: 100px;
|
384 |
-
bottom: 100px;
|
385 |
-
|
386 |
-
|
387 |
-
/* hide elements */
|
388 |
-
.media-frame-menu,
|
389 |
-
.media-frame-router,
|
390 |
-
.media-frame-content .attachments,
|
391 |
-
.media-frame-content .media-toolbar {
|
392 |
-
display: none;
|
393 |
-
}
|
394 |
-
|
395 |
-
|
396 |
-
/* full width */
|
397 |
-
.media-frame-title,
|
398 |
-
.media-frame-content,
|
399 |
-
.media-frame-toolbar,
|
400 |
-
.media-sidebar {
|
401 |
-
width: auto;
|
402 |
-
left: 0;
|
403 |
-
right: 0;
|
404 |
-
}
|
405 |
-
|
406 |
-
|
407 |
-
/* tidy up incorrect distance */
|
408 |
-
.media-frame-content {
|
409 |
-
top: 50px;
|
410 |
-
}
|
411 |
-
|
412 |
-
|
413 |
-
/* title box shadow (to match media grid) */
|
414 |
-
.media-frame-title {
|
415 |
-
border-bottom: 1px solid #DFDFDF;
|
416 |
-
box-shadow: 0 4px 4px -4px rgba(0, 0, 0, 0.1);
|
417 |
-
}
|
418 |
-
|
419 |
-
|
420 |
-
/* sidebar */
|
421 |
-
.media-sidebar {
|
422 |
-
|
423 |
-
padding: 0 16px;
|
424 |
-
|
425 |
-
/* WP details */
|
426 |
-
.attachment-details {
|
427 |
-
|
428 |
-
overflow: visible;
|
429 |
-
|
430 |
-
/* hide 'Attachment Details' heading */
|
431 |
-
> h3, > h2 {
|
432 |
-
display: none;
|
433 |
-
}
|
434 |
-
|
435 |
-
|
436 |
-
/* remove overflow */
|
437 |
-
.attachment-info {
|
438 |
-
background: #fff;
|
439 |
-
border-bottom: #dddddd solid 1px;
|
440 |
-
padding: 16px;
|
441 |
-
margin: 0 -16px 16px;
|
442 |
-
}
|
443 |
-
|
444 |
-
/* move thumbnail */
|
445 |
-
.thumbnail {
|
446 |
-
margin: 0 16px 0 0;
|
447 |
-
}
|
448 |
-
|
449 |
-
.setting {
|
450 |
-
display: block;
|
451 |
-
overflow: hidden;
|
452 |
-
float: none;
|
453 |
-
width: auto;
|
454 |
-
margin: 0 0 5px;
|
455 |
-
|
456 |
-
span {
|
457 |
-
margin: 0;
|
458 |
-
}
|
459 |
-
}
|
460 |
-
|
461 |
-
}
|
462 |
-
|
463 |
-
|
464 |
-
/* ACF fields */
|
465 |
-
.compat-attachment-fields {
|
466 |
-
|
467 |
-
> tbody > .acf-field {
|
468 |
-
margin: 0 0 5px;
|
469 |
-
|
470 |
-
p.description {
|
471 |
-
margin-top: 3px;
|
472 |
-
}
|
473 |
-
}
|
474 |
-
|
475 |
-
}
|
476 |
-
|
477 |
-
|
478 |
-
/* WP required message */
|
479 |
-
.media-types-required-info { display: none; }
|
480 |
-
|
481 |
-
}
|
482 |
-
|
483 |
-
|
484 |
-
/* mobile md */
|
485 |
-
@media (max-width: 900px) {
|
486 |
-
|
487 |
-
& {
|
488 |
-
top: 30px;
|
489 |
-
right: 30px;
|
490 |
-
bottom: 30px;
|
491 |
-
left: 30px;
|
492 |
-
}
|
493 |
-
|
494 |
-
}
|
495 |
-
|
496 |
-
|
497 |
-
/* mobile sm */
|
498 |
-
@media (max-width: 640px) {
|
499 |
-
|
500 |
-
& {
|
501 |
-
top: 0;
|
502 |
-
right: 0;
|
503 |
-
bottom: 0;
|
504 |
-
left: 0;
|
505 |
-
}
|
506 |
-
|
507 |
-
.media-sidebar {
|
508 |
-
bottom: 0 !important;
|
509 |
-
}
|
510 |
-
|
511 |
-
}
|
512 |
-
|
513 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/build/css/_mixins.scss
DELETED
@@ -1,39 +0,0 @@
|
|
1 |
-
/*--------------------------------------------------------------------------------------------
|
2 |
-
*
|
3 |
-
* Mixins
|
4 |
-
*
|
5 |
-
*--------------------------------------------------------------------------------------------*/
|
6 |
-
@mixin clearfix() {
|
7 |
-
&:after {
|
8 |
-
display: block;
|
9 |
-
clear: both;
|
10 |
-
content: "";
|
11 |
-
}
|
12 |
-
}
|
13 |
-
|
14 |
-
@mixin border-box() {
|
15 |
-
-webkit-box-sizing: border-box;
|
16 |
-
-moz-box-sizing: border-box;
|
17 |
-
box-sizing: border-box;
|
18 |
-
}
|
19 |
-
|
20 |
-
@mixin centered() {
|
21 |
-
position: absolute;
|
22 |
-
top: 50%;
|
23 |
-
left: 50%;
|
24 |
-
transform: translate(-50%, -50%);
|
25 |
-
}
|
26 |
-
|
27 |
-
@mixin animate( $properties: 'all' ) {
|
28 |
-
-webkit-transition: $properties 0.3s ease; // Safari 3.2+, Chrome
|
29 |
-
-moz-transition: $properties 0.3s ease; // Firefox 4-15
|
30 |
-
-o-transition: $properties 0.3s ease; // Opera 10.5–12.00
|
31 |
-
transition: $properties 0.3s ease; // Firefox 16+, Opera 12.50+
|
32 |
-
}
|
33 |
-
|
34 |
-
@mixin rtl() {
|
35 |
-
html[dir="rtl"] & {
|
36 |
-
text-align: right;
|
37 |
-
@content;
|
38 |
-
}
|
39 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/build/css/_variables.scss
DELETED
@@ -1,24 +0,0 @@
|
|
1 |
-
/*--------------------------------------------------------------------------------------------
|
2 |
-
*
|
3 |
-
* Vars
|
4 |
-
*
|
5 |
-
*--------------------------------------------------------------------------------------------*/
|
6 |
-
|
7 |
-
/* colors */
|
8 |
-
$acf_blue: #2a9bd9;
|
9 |
-
$acf_notice: #2a9bd9;
|
10 |
-
$acf_error: #F55E4F;
|
11 |
-
$acf_success: #46b450;
|
12 |
-
$acf_warning: #fd8d3b;
|
13 |
-
|
14 |
-
/* acf-field */
|
15 |
-
$field_padding: 15px 12px;
|
16 |
-
$field_padding_x: 12px;
|
17 |
-
$field_padding_y: 15px;
|
18 |
-
$fp: 15px 12px;
|
19 |
-
$fy: 15px;
|
20 |
-
$fx: 12px;
|
21 |
-
|
22 |
-
/* responsive */
|
23 |
-
$md: 880px;
|
24 |
-
$sm: 640px;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/build/css/acf-dark.scss
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
@import "dark";
|
|
assets/build/css/acf-field-group.scss
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
@import "variables";
|
2 |
-
@import "mixins";
|
3 |
-
@import "field-group";
|
|
|
|
|
|
assets/build/css/acf-global.scss
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
@import "variables";
|
2 |
-
@import "mixins";
|
3 |
-
@import "global";
|
|
|
|
|
|
assets/build/css/acf-input.scss
DELETED
@@ -1,6 +0,0 @@
|
|
1 |
-
@import "variables";
|
2 |
-
@import "mixins";
|
3 |
-
@import "fields";
|
4 |
-
@import "forms";
|
5 |
-
@import "media";
|
6 |
-
@import "input";
|
|
|
|
|
|
|
|
|
|
|
|
assets/build/images/acf-logo.psd
DELETED
Binary file
|
assets/build/js/_acf-compatibility.js
DELETED
@@ -1,761 +0,0 @@
|
|
1 |
-
(function($, undefined){
|
2 |
-
|
3 |
-
/**
|
4 |
-
* acf.newCompatibility
|
5 |
-
*
|
6 |
-
* Inserts a new __proto__ object compatibility layer
|
7 |
-
*
|
8 |
-
* @date 15/2/18
|
9 |
-
* @since 5.6.9
|
10 |
-
*
|
11 |
-
* @param object instance The object to modify.
|
12 |
-
* @param object compatibilty Optional. The compatibilty layer.
|
13 |
-
* @return object compatibilty
|
14 |
-
*/
|
15 |
-
|
16 |
-
acf.newCompatibility = function( instance, compatibilty ){
|
17 |
-
|
18 |
-
// defaults
|
19 |
-
compatibilty = compatibilty || {};
|
20 |
-
|
21 |
-
// inherit __proto_-
|
22 |
-
compatibilty.__proto__ = instance.__proto__;
|
23 |
-
|
24 |
-
// inject
|
25 |
-
instance.__proto__ = compatibilty;
|
26 |
-
|
27 |
-
// reference
|
28 |
-
instance.compatibility = compatibilty;
|
29 |
-
|
30 |
-
// return
|
31 |
-
return compatibilty;
|
32 |
-
};
|
33 |
-
|
34 |
-
/**
|
35 |
-
* acf.getCompatibility
|
36 |
-
*
|
37 |
-
* Returns the compatibility layer for a given instance
|
38 |
-
*
|
39 |
-
* @date 13/3/18
|
40 |
-
* @since 5.6.9
|
41 |
-
*
|
42 |
-
* @param object instance The object to look in.
|
43 |
-
* @return object|null compatibility The compatibility object or null on failure.
|
44 |
-
*/
|
45 |
-
|
46 |
-
acf.getCompatibility = function( instance ) {
|
47 |
-
return instance.compatibility || null;
|
48 |
-
};
|
49 |
-
|
50 |
-
/**
|
51 |
-
* acf (compatibility)
|
52 |
-
*
|
53 |
-
* Compatibility layer for the acf object
|
54 |
-
*
|
55 |
-
* @date 15/2/18
|
56 |
-
* @since 5.6.9
|
57 |
-
*
|
58 |
-
* @param void
|
59 |
-
* @return void
|
60 |
-
*/
|
61 |
-
|
62 |
-
var _acf = acf.newCompatibility(acf, {
|
63 |
-
|
64 |
-
// storage
|
65 |
-
l10n: {},
|
66 |
-
o: {},
|
67 |
-
fields: {},
|
68 |
-
|
69 |
-
// changed function names
|
70 |
-
update: acf.set,
|
71 |
-
add_action: acf.addAction,
|
72 |
-
remove_action: acf.removeAction,
|
73 |
-
do_action: acf.doAction,
|
74 |
-
add_filter: acf.addFilter,
|
75 |
-
remove_filter: acf.removeFilter,
|
76 |
-
apply_filters: acf.applyFilters,
|
77 |
-
parse_args: acf.parseArgs,
|
78 |
-
disable_el: acf.disable,
|
79 |
-
disable_form: acf.disable,
|
80 |
-
enable_el: acf.enable,
|
81 |
-
enable_form: acf.enable,
|
82 |
-
update_user_setting: acf.updateUserSetting,
|
83 |
-
prepare_for_ajax: acf.prepareForAjax,
|
84 |
-
is_ajax_success: acf.isAjaxSuccess,
|
85 |
-
remove_el: acf.remove,
|
86 |
-
remove_tr: acf.remove,
|
87 |
-
str_replace: acf.strReplace,
|
88 |
-
render_select: acf.renderSelect,
|
89 |
-
get_uniqid: acf.uniqid,
|
90 |
-
serialize_form: acf.serialize,
|
91 |
-
esc_html: acf.strEscape,
|
92 |
-
str_sanitize: acf.strSanitize,
|
93 |
-
|
94 |
-
});
|
95 |
-
|
96 |
-
_acf._e = function( k1, k2 ){
|
97 |
-
|
98 |
-
// defaults
|
99 |
-
k1 = k1 || '';
|
100 |
-
k2 = k2 || '';
|
101 |
-
|
102 |
-
// compability
|
103 |
-
var compatKey = k2 ? k1 + '.' + k2 : k1;
|
104 |
-
var compats = {
|
105 |
-
'image.select': 'Select Image',
|
106 |
-
'image.edit': 'Edit Image',
|
107 |
-
'image.update': 'Update Image'
|
108 |
-
};
|
109 |
-
if( compats[compatKey] ) {
|
110 |
-
return acf.__(compats[compatKey]);
|
111 |
-
}
|
112 |
-
|
113 |
-
// try k1
|
114 |
-
var string = this.l10n[ k1 ] || '';
|
115 |
-
|
116 |
-
// try k2
|
117 |
-
if( k2 ) {
|
118 |
-
string = string[ k2 ] || '';
|
119 |
-
}
|
120 |
-
|
121 |
-
// return
|
122 |
-
return string;
|
123 |
-
};
|
124 |
-
|
125 |
-
_acf.get_selector = function( s ) {
|
126 |
-
|
127 |
-
// vars
|
128 |
-
var selector = '.acf-field';
|
129 |
-
|
130 |
-
// bail early if no search
|
131 |
-
if( !s ) {
|
132 |
-
return selector;
|
133 |
-
}
|
134 |
-
|
135 |
-
// compatibility with object
|
136 |
-
if( $.isPlainObject(s) ) {
|
137 |
-
if( $.isEmptyObject(s) ) {
|
138 |
-
return selector;
|
139 |
-
} else {
|
140 |
-
for( var k in s ) { s = s[k]; break; }
|
141 |
-
}
|
142 |
-
}
|
143 |
-
|
144 |
-
// append
|
145 |
-
selector += '-' + s;
|
146 |
-
|
147 |
-
// replace underscores (split/join replaces all and is faster than regex!)
|
148 |
-
selector = acf.strReplace('_', '-', selector);
|
149 |
-
|
150 |
-
// remove potential double up
|
151 |
-
selector = acf.strReplace('field-field-', 'field-', selector);
|
152 |
-
|
153 |
-
// return
|
154 |
-
return selector;
|
155 |
-
};
|
156 |
-
|
157 |
-
_acf.get_fields = function( s, $el, all ){
|
158 |
-
|
159 |
-
// args
|
160 |
-
var args = {
|
161 |
-
is: s || '',
|
162 |
-
parent: $el || false,
|
163 |
-
suppressFilters: all || false,
|
164 |
-
};
|
165 |
-
|
166 |
-
// change 'field_123' to '.acf-field-123'
|
167 |
-
if( args.is ) {
|
168 |
-
args.is = this.get_selector( args.is );
|
169 |
-
}
|
170 |
-
|
171 |
-
// return
|
172 |
-
return acf.findFields(args);
|
173 |
-
};
|
174 |
-
|
175 |
-
_acf.get_field = function( s, $el ){
|
176 |
-
|
177 |
-
// get fields
|
178 |
-
var $fields = this.get_fields.apply(this, arguments);
|
179 |
-
|
180 |
-
// return
|
181 |
-
if( $fields.length ) {
|
182 |
-
return $fields.first();
|
183 |
-
} else {
|
184 |
-
return false;
|
185 |
-
}
|
186 |
-
};
|
187 |
-
|
188 |
-
_acf.get_closest_field = function( $el, s ){
|
189 |
-
return $el.closest( this.get_selector(s) );
|
190 |
-
};
|
191 |
-
|
192 |
-
_acf.get_field_wrap = function( $el ){
|
193 |
-
return $el.closest( this.get_selector() );
|
194 |
-
};
|
195 |
-
|
196 |
-
_acf.get_field_key = function( $field ){
|
197 |
-
return $field.data('key');
|
198 |
-
};
|
199 |
-
|
200 |
-
_acf.get_field_type = function( $field ){
|
201 |
-
return $field.data('type');
|
202 |
-
};
|
203 |
-
|
204 |
-
_acf.get_data = function( $el, defaults ){
|
205 |
-
return acf.parseArgs( $el.data(), defaults );
|
206 |
-
};
|
207 |
-
|
208 |
-
_acf.maybe_get = function( obj, key, value ){
|
209 |
-
|
210 |
-
// default
|
211 |
-
if( value === undefined ) {
|
212 |
-
value = null;
|
213 |
-
}
|
214 |
-
|
215 |
-
// get keys
|
216 |
-
keys = String(key).split('.');
|
217 |
-
|
218 |
-
// acf.isget
|
219 |
-
for( var i = 0; i < keys.length; i++ ) {
|
220 |
-
if( !obj.hasOwnProperty(keys[i]) ) {
|
221 |
-
return value;
|
222 |
-
}
|
223 |
-
obj = obj[ keys[i] ];
|
224 |
-
}
|
225 |
-
return obj;
|
226 |
-
};
|
227 |
-
|
228 |
-
|
229 |
-
/**
|
230 |
-
* hooks
|
231 |
-
*
|
232 |
-
* Modify add_action and add_filter functions to add compatibility with changed $field parameter
|
233 |
-
* Using the acf.add_action() or acf.add_filter() functions will interpret new field parameters as jQuery $field
|
234 |
-
*
|
235 |
-
* @date 12/5/18
|
236 |
-
* @since 5.6.9
|
237 |
-
*
|
238 |
-
* @param void
|
239 |
-
* @return void
|
240 |
-
*/
|
241 |
-
|
242 |
-
var compatibleArgument = function( arg ){
|
243 |
-
return ( arg instanceof acf.Field ) ? arg.$el : arg;
|
244 |
-
};
|
245 |
-
|
246 |
-
var compatibleArguments = function( args ){
|
247 |
-
return acf.arrayArgs( args ).map( compatibleArgument );
|
248 |
-
}
|
249 |
-
|
250 |
-
var compatibleCallback = function( origCallback ){
|
251 |
-
return function(){
|
252 |
-
|
253 |
-
// convert to compatible arguments
|
254 |
-
if( arguments.length ) {
|
255 |
-
var args = compatibleArguments(arguments);
|
256 |
-
|
257 |
-
// add default argument for 'ready', 'append' and 'load' events
|
258 |
-
} else {
|
259 |
-
var args = [ $(document) ];
|
260 |
-
}
|
261 |
-
|
262 |
-
// return
|
263 |
-
return origCallback.apply(this, args);
|
264 |
-
}
|
265 |
-
}
|
266 |
-
|
267 |
-
_acf.add_action = function( action, callback, priority, context ){
|
268 |
-
|
269 |
-
// handle multiple actions
|
270 |
-
var actions = action.split(' ');
|
271 |
-
var length = actions.length;
|
272 |
-
if( length > 1 ) {
|
273 |
-
for( var i = 0; i < length; i++) {
|
274 |
-
action = actions[i];
|
275 |
-
_acf.add_action.apply(this, arguments);
|
276 |
-
}
|
277 |
-
return this;
|
278 |
-
}
|
279 |
-
|
280 |
-
// single
|
281 |
-
var callback = compatibleCallback(callback);
|
282 |
-
return acf.addAction.apply(this, arguments);
|
283 |
-
};
|
284 |
-
|
285 |
-
_acf.add_filter = function( action, callback, priority, context ){
|
286 |
-
var callback = compatibleCallback(callback);
|
287 |
-
return acf.addFilter.apply(this, arguments);
|
288 |
-
};
|
289 |
-
|
290 |
-
/*
|
291 |
-
* acf.model
|
292 |
-
*
|
293 |
-
* This model acts as a scafold for action.event driven modules
|
294 |
-
*
|
295 |
-
* @type object
|
296 |
-
* @date 8/09/2014
|
297 |
-
* @since 5.0.0
|
298 |
-
*
|
299 |
-
* @param (object)
|
300 |
-
* @return (object)
|
301 |
-
*/
|
302 |
-
|
303 |
-
_acf.model = {
|
304 |
-
actions: {},
|
305 |
-
filters: {},
|
306 |
-
events: {},
|
307 |
-
extend: function( args ){
|
308 |
-
|
309 |
-
// extend
|
310 |
-
var model = $.extend( {}, this, args );
|
311 |
-
|
312 |
-
// setup actions
|
313 |
-
$.each(model.actions, function( name, callback ){
|
314 |
-
model._add_action( name, callback );
|
315 |
-
});
|
316 |
-
|
317 |
-
// setup filters
|
318 |
-
$.each(model.filters, function( name, callback ){
|
319 |
-
model._add_filter( name, callback );
|
320 |
-
});
|
321 |
-
|
322 |
-
// setup events
|
323 |
-
$.each(model.events, function( name, callback ){
|
324 |
-
model._add_event( name, callback );
|
325 |
-
});
|
326 |
-
|
327 |
-
// return
|
328 |
-
return model;
|
329 |
-
},
|
330 |
-
|
331 |
-
_add_action: function( name, callback ) {
|
332 |
-
|
333 |
-
// split
|
334 |
-
var model = this,
|
335 |
-
data = name.split(' ');
|
336 |
-
|
337 |
-
// add missing priority
|
338 |
-
var name = data[0] || '',
|
339 |
-
priority = data[1] || 10;
|
340 |
-
|
341 |
-
// add action
|
342 |
-
acf.add_action(name, model[ callback ], priority, model);
|
343 |
-
|
344 |
-
},
|
345 |
-
|
346 |
-
_add_filter: function( name, callback ) {
|
347 |
-
|
348 |
-
// split
|
349 |
-
var model = this,
|
350 |
-
data = name.split(' ');
|
351 |
-
|
352 |
-
// add missing priority
|
353 |
-
var name = data[0] || '',
|
354 |
-
priority = data[1] || 10;
|
355 |
-
|
356 |
-
// add action
|
357 |
-
acf.add_filter(name, model[ callback ], priority, model);
|
358 |
-
},
|
359 |
-
|
360 |
-
_add_event: function( name, callback ) {
|
361 |
-
|
362 |
-
// vars
|
363 |
-
var model = this,
|
364 |
-
i = name.indexOf(' '),
|
365 |
-
event = (i > 0) ? name.substr(0,i) : name,
|
366 |
-
selector = (i > 0) ? name.substr(i+1) : '';
|
367 |
-
|
368 |
-
// event
|
369 |
-
var fn = function( e ){
|
370 |
-
|
371 |
-
// append $el to event object
|
372 |
-
e.$el = $(this);
|
373 |
-
|
374 |
-
// append $field to event object (used in field group)
|
375 |
-
if( acf.field_group ) {
|
376 |
-
e.$field = e.$el.closest('.acf-field-object');
|
377 |
-
}
|
378 |
-
|
379 |
-
// event
|
380 |
-
if( typeof model.event === 'function' ) {
|
381 |
-
e = model.event( e );
|
382 |
-
}
|
383 |
-
|
384 |
-
// callback
|
385 |
-
model[ callback ].apply(model, arguments);
|
386 |
-
|
387 |
-
};
|
388 |
-
|
389 |
-
// add event
|
390 |
-
if( selector ) {
|
391 |
-
$(document).on(event, selector, fn);
|
392 |
-
} else {
|
393 |
-
$(document).on(event, fn);
|
394 |
-
}
|
395 |
-
},
|
396 |
-
|
397 |
-
get: function( name, value ){
|
398 |
-
|
399 |
-
// defaults
|
400 |
-
value = value || null;
|
401 |
-
|
402 |
-
// get
|
403 |
-
if( typeof this[ name ] !== 'undefined' ) {
|
404 |
-
value = this[ name ];
|
405 |
-
}
|
406 |
-
|
407 |
-
// return
|
408 |
-
return value;
|
409 |
-
},
|
410 |
-
|
411 |
-
set: function( name, value ){
|
412 |
-
|
413 |
-
// set
|
414 |
-
this[ name ] = value;
|
415 |
-
|
416 |
-
// function for 3rd party
|
417 |
-
if( typeof this[ '_set_' + name ] === 'function' ) {
|
418 |
-
this[ '_set_' + name ].apply(this);
|
419 |
-
}
|
420 |
-
|
421 |
-
// return for chaining
|
422 |
-
return this;
|
423 |
-
}
|
424 |
-
};
|
425 |
-
|
426 |
-
/*
|
427 |
-
* field
|
428 |
-
*
|
429 |
-
* This model sets up many of the field's interactions
|
430 |
-
*
|
431 |
-
* @type function
|
432 |
-
* @date 21/02/2014
|
433 |
-
* @since 3.5.1
|
434 |
-
*
|
435 |
-
* @param n/a
|
436 |
-
* @return n/a
|
437 |
-
*/
|
438 |
-
|
439 |
-
_acf.field = acf.model.extend({
|
440 |
-
type: '',
|
441 |
-
o: {},
|
442 |
-
$field: null,
|
443 |
-
_add_action: function( name, callback ) {
|
444 |
-
|
445 |
-
// vars
|
446 |
-
var model = this;
|
447 |
-
|
448 |
-
// update name
|
449 |
-
name = name + '_field/type=' + model.type;
|
450 |
-
|
451 |
-
// add action
|
452 |
-
acf.add_action(name, function( $field ){
|
453 |
-
|
454 |
-
// focus
|
455 |
-
model.set('$field', $field);
|
456 |
-
|
457 |
-
// callback
|
458 |
-
model[ callback ].apply(model, arguments);
|
459 |
-
});
|
460 |
-
},
|
461 |
-
|
462 |
-
_add_filter: function( name, callback ) {
|
463 |
-
|
464 |
-
// vars
|
465 |
-
var model = this;
|
466 |
-
|
467 |
-
// update name
|
468 |
-
name = name + '_field/type=' + model.type;
|
469 |
-
|
470 |
-
// add action
|
471 |
-
acf.add_filter(name, function( $field ){
|
472 |
-
|
473 |
-
// focus
|
474 |
-
model.set('$field', $field);
|
475 |
-
|
476 |
-
// callback
|
477 |
-
model[ callback ].apply(model, arguments);
|
478 |
-
});
|
479 |
-
},
|
480 |
-
|
481 |
-
_add_event: function( name, callback ) {
|
482 |
-
|
483 |
-
// vars
|
484 |
-
var model = this,
|
485 |
-
event = name.substr(0,name.indexOf(' ')),
|
486 |
-
selector = name.substr(name.indexOf(' ')+1),
|
487 |
-
context = acf.get_selector(model.type);
|
488 |
-
|
489 |
-
// add event
|
490 |
-
$(document).on(event, context + ' ' + selector, function( e ){
|
491 |
-
|
492 |
-
// vars
|
493 |
-
var $el = $(this);
|
494 |
-
var $field = acf.get_closest_field( $el, model.type );
|
495 |
-
|
496 |
-
// bail early if no field
|
497 |
-
if( !$field.length ) return;
|
498 |
-
|
499 |
-
// focus
|
500 |
-
if( !$field.is(model.$field) ) {
|
501 |
-
model.set('$field', $field);
|
502 |
-
}
|
503 |
-
|
504 |
-
// append to event
|
505 |
-
e.$el = $el;
|
506 |
-
e.$field = $field;
|
507 |
-
|
508 |
-
// callback
|
509 |
-
model[ callback ].apply(model, [e]);
|
510 |
-
});
|
511 |
-
},
|
512 |
-
|
513 |
-
_set_$field: function(){
|
514 |
-
|
515 |
-
// callback
|
516 |
-
if( typeof this.focus === 'function' ) {
|
517 |
-
this.focus();
|
518 |
-
}
|
519 |
-
},
|
520 |
-
|
521 |
-
// depreciated
|
522 |
-
doFocus: function( $field ){
|
523 |
-
return this.set('$field', $field);
|
524 |
-
}
|
525 |
-
});
|
526 |
-
|
527 |
-
|
528 |
-
/**
|
529 |
-
* validation
|
530 |
-
*
|
531 |
-
* description
|
532 |
-
*
|
533 |
-
* @date 15/2/18
|
534 |
-
* @since 5.6.9
|
535 |
-
*
|
536 |
-
* @param type $var Description. Default.
|
537 |
-
* @return type Description.
|
538 |
-
*/
|
539 |
-
|
540 |
-
var _validation = acf.newCompatibility(acf.validation, {
|
541 |
-
remove_error: function( $field ){
|
542 |
-
acf.getField( $field ).removeError();
|
543 |
-
},
|
544 |
-
add_warning: function( $field, message ){
|
545 |
-
acf.getField( $field ).showNotice({
|
546 |
-
text: message,
|
547 |
-
type: 'warning',
|
548 |
-
timeout: 1000
|
549 |
-
});
|
550 |
-
},
|
551 |
-
fetch: acf.validateForm,
|
552 |
-
enableSubmit: acf.enableSubmit,
|
553 |
-
disableSubmit: acf.disableSubmit,
|
554 |
-
showSpinner: acf.showSpinner,
|
555 |
-
hideSpinner: acf.hideSpinner,
|
556 |
-
unlockForm: acf.unlockForm,
|
557 |
-
lockForm: acf.lockForm
|
558 |
-
});
|
559 |
-
|
560 |
-
|
561 |
-
/**
|
562 |
-
* tooltip
|
563 |
-
*
|
564 |
-
* description
|
565 |
-
*
|
566 |
-
* @date 15/2/18
|
567 |
-
* @since 5.6.9
|
568 |
-
*
|
569 |
-
* @param type $var Description. Default.
|
570 |
-
* @return type Description.
|
571 |
-
*/
|
572 |
-
|
573 |
-
_acf.tooltip = {
|
574 |
-
|
575 |
-
tooltip: function( text, $el ){
|
576 |
-
|
577 |
-
var tooltip = acf.newTooltip({
|
578 |
-
text: text,
|
579 |
-
target: $el
|
580 |
-
});
|
581 |
-
|
582 |
-
// return
|
583 |
-
return tooltip.$el;
|
584 |
-
},
|
585 |
-
|
586 |
-
temp: function( text, $el ){
|
587 |
-
|
588 |
-
var tooltip = acf.newTooltip({
|
589 |
-
text: text,
|
590 |
-
target: $el,
|
591 |
-
timeout: 250
|
592 |
-
});
|
593 |
-
},
|
594 |
-
|
595 |
-
confirm: function( $el, callback, text, button_y, button_n ){
|
596 |
-
|
597 |
-
var tooltip = acf.newTooltip({
|
598 |
-
confirm: true,
|
599 |
-
text: text,
|
600 |
-
target: $el,
|
601 |
-
confirm: function(){
|
602 |
-
callback(true);
|
603 |
-
},
|
604 |
-
cancel: function(){
|
605 |
-
callback(false);
|
606 |
-
}
|
607 |
-
});
|
608 |
-
},
|
609 |
-
|
610 |
-
confirm_remove: function( $el, callback ){
|
611 |
-
|
612 |
-
var tooltip = acf.newTooltip({
|
613 |
-
confirmRemove: true,
|
614 |
-
target: $el,
|
615 |
-
confirm: function(){
|
616 |
-
callback(true);
|
617 |
-
},
|
618 |
-
cancel: function(){
|
619 |
-
callback(false);
|
620 |
-
}
|
621 |
-
});
|
622 |
-
},
|
623 |
-
};
|
624 |
-
|
625 |
-
/**
|
626 |
-
* tooltip
|
627 |
-
*
|
628 |
-
* description
|
629 |
-
*
|
630 |
-
* @date 15/2/18
|
631 |
-
* @since 5.6.9
|
632 |
-
*
|
633 |
-
* @param type $var Description. Default.
|
634 |
-
* @return type Description.
|
635 |
-
*/
|
636 |
-
|
637 |
-
_acf.media = new acf.Model({
|
638 |
-
activeFrame: false,
|
639 |
-
actions: {
|
640 |
-
'new_media_popup': 'onNewMediaPopup'
|
641 |
-
},
|
642 |
-
|
643 |
-
frame: function(){
|
644 |
-
return this.activeFrame;
|
645 |
-
},
|
646 |
-
|
647 |
-
onNewMediaPopup: function( popup ){
|
648 |
-
this.activeFrame = popup.frame;
|
649 |
-
},
|
650 |
-
|
651 |
-
popup: function( props ){
|
652 |
-
|
653 |
-
// update props
|
654 |
-
if( props.mime_types ) {
|
655 |
-
props.allowedTypes = props.mime_types;
|
656 |
-
}
|
657 |
-
if( props.id ) {
|
658 |
-
props.attachment = props.id;
|
659 |
-
}
|
660 |
-
|
661 |
-
// new
|
662 |
-
var popup = acf.newMediaPopup( props );
|
663 |
-
|
664 |
-
// append
|
665 |
-
/*
|
666 |
-
if( props.selected ) {
|
667 |
-
popup.selected = props.selected;
|
668 |
-
}
|
669 |
-
*/
|
670 |
-
|
671 |
-
// return
|
672 |
-
return popup.frame;
|
673 |
-
}
|
674 |
-
});
|
675 |
-
|
676 |
-
|
677 |
-
/**
|
678 |
-
* Select2
|
679 |
-
*
|
680 |
-
* description
|
681 |
-
*
|
682 |
-
* @date 11/6/18
|
683 |
-
* @since 5.6.9
|
684 |
-
*
|
685 |
-
* @param type $var Description. Default.
|
686 |
-
* @return type Description.
|
687 |
-
*/
|
688 |
-
|
689 |
-
_acf.select2 = {
|
690 |
-
init: function( $select, args, $field ){
|
691 |
-
|
692 |
-
// compatible args
|
693 |
-
if( args.allow_null ) {
|
694 |
-
args.allowNull = args.allow_null;
|
695 |
-
}
|
696 |
-
if( args.ajax_action ) {
|
697 |
-
args.ajaxAction = args.ajax_action;
|
698 |
-
}
|
699 |
-
if( $field ) {
|
700 |
-
args.field = acf.getField($field);
|
701 |
-
}
|
702 |
-
|
703 |
-
// return
|
704 |
-
return acf.newSelect2( $select, args );
|
705 |
-
},
|
706 |
-
|
707 |
-
destroy: function( $select ){
|
708 |
-
return acf.getInstance( $select ).destroy();
|
709 |
-
|
710 |
-
},
|
711 |
-
};
|
712 |
-
|
713 |
-
/**
|
714 |
-
* postbox
|
715 |
-
*
|
716 |
-
* description
|
717 |
-
*
|
718 |
-
* @date 11/6/18
|
719 |
-
* @since 5.6.9
|
720 |
-
*
|
721 |
-
* @param type $var Description. Default.
|
722 |
-
* @return type Description.
|
723 |
-
*/
|
724 |
-
|
725 |
-
_acf.postbox = {
|
726 |
-
render: function( args ){
|
727 |
-
|
728 |
-
// compatible args
|
729 |
-
if( args.edit_url ) {
|
730 |
-
args.editLink = args.edit_url;
|
731 |
-
}
|
732 |
-
if( args.edit_title ) {
|
733 |
-
args.editTitle = args.edit_title;
|
734 |
-
}
|
735 |
-
|
736 |
-
// return
|
737 |
-
return acf.newPostbox( args );
|
738 |
-
}
|
739 |
-
};
|
740 |
-
|
741 |
-
/**
|
742 |
-
* acf.screen
|
743 |
-
*
|
744 |
-
* description
|
745 |
-
*
|
746 |
-
* @date 11/6/18
|
747 |
-
* @since 5.6.9
|
748 |
-
*
|
749 |
-
* @param type $var Description. Default.
|
750 |
-
* @return type Description.
|
751 |
-
*/
|
752 |
-
|
753 |
-
acf.newCompatibility(acf.screen, {
|
754 |
-
update: function(){
|
755 |
-
return this.set.apply(this, arguments);
|
756 |
-
},
|
757 |
-
fetch: acf.screen.check
|
758 |
-
});
|
759 |
-
_acf.ajax = acf.screen;
|
760 |
-
|
761 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/build/js/_acf-condition-types.js
DELETED
@@ -1,447 +0,0 @@
|
|
1 |
-
(function($, undefined){
|
2 |
-
|
3 |
-
var __ = acf.__;
|
4 |
-
|
5 |
-
var parseString = function( val ){
|
6 |
-
return val ? '' + val : '';
|
7 |
-
};
|
8 |
-
|
9 |
-
var isEqualTo = function( v1, v2 ){
|
10 |
-
return ( parseString(v1).toLowerCase() === parseString(v2).toLowerCase() );
|
11 |
-
};
|
12 |
-
|
13 |
-
var isEqualToNumber = function( v1, v2 ){
|
14 |
-
return ( parseFloat(v1) === parseFloat(v2) );
|
15 |
-
};
|
16 |
-
|
17 |
-
var isGreaterThan = function( v1, v2 ){
|
18 |
-
return ( parseFloat(v1) > parseFloat(v2) );
|
19 |
-
};
|
20 |
-
|
21 |
-
var isLessThan = function( v1, v2 ){
|
22 |
-
return ( parseFloat(v1) < parseFloat(v2) );
|
23 |
-
};
|
24 |
-
|
25 |
-
var inArray = function( v1, array ){
|
26 |
-
|
27 |
-
// cast all values as string
|
28 |
-
array = array.map(function(v2){
|
29 |
-
return parseString(v2);
|
30 |
-
});
|
31 |
-
|
32 |
-
return (array.indexOf( v1 ) > -1);
|
33 |
-
}
|
34 |
-
|
35 |
-
var containsString = function( haystack, needle ){
|
36 |
-
return ( parseString(haystack).indexOf( parseString(needle) ) > -1 );
|
37 |
-
};
|
38 |
-
|
39 |
-
var matchesPattern = function( v1, pattern ){
|
40 |
-
var regexp = new RegExp(parseString(pattern), 'gi');
|
41 |
-
return parseString(v1).match( regexp );
|
42 |
-
};
|
43 |
-
|
44 |
-
/**
|
45 |
-
* hasValue
|
46 |
-
*
|
47 |
-
* description
|
48 |
-
*
|
49 |
-
* @date 1/2/18
|
50 |
-
* @since 5.6.5
|
51 |
-
*
|
52 |
-
* @param void
|
53 |
-
* @return void
|
54 |
-
*/
|
55 |
-
|
56 |
-
var HasValue = acf.Condition.extend({
|
57 |
-
type: 'hasValue',
|
58 |
-
operator: '!=empty',
|
59 |
-
label: __('Has any value'),
|
60 |
-
fieldTypes: [ 'text', 'textarea', 'number', 'range', 'email', 'url', 'password', 'image', 'file', 'wysiwyg', 'oembed', 'select', 'checkbox', 'radio', 'button_group', 'link', 'post_object', 'page_link', 'relationship', 'taxonomy', 'user', 'google_map', 'date_picker', 'date_time_picker', 'time_picker', 'color_picker' ],
|
61 |
-
match: function( rule, field ){
|
62 |
-
return (field.val() ? true : false);
|
63 |
-
},
|
64 |
-
choices: function( fieldObject ){
|
65 |
-
return '<input type="text" disabled="" />';
|
66 |
-
}
|
67 |
-
});
|
68 |
-
|
69 |
-
acf.registerConditionType( HasValue );
|
70 |
-
|
71 |
-
/**
|
72 |
-
* hasValue
|
73 |
-
*
|
74 |
-
* description
|
75 |
-
*
|
76 |
-
* @date 1/2/18
|
77 |
-
* @since 5.6.5
|
78 |
-
*
|
79 |
-
* @param void
|
80 |
-
* @return void
|
81 |
-
*/
|
82 |
-
|
83 |
-
var HasNoValue = HasValue.extend({
|
84 |
-
type: 'hasNoValue',
|
85 |
-
operator: '==empty',
|
86 |
-
label: __('Has no value'),
|
87 |
-
match: function( rule, field ){
|
88 |
-
return !HasValue.prototype.match.apply(this, arguments);
|
89 |
-
}
|
90 |
-
});
|
91 |
-
|
92 |
-
acf.registerConditionType( HasNoValue );
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
/**
|
97 |
-
* EqualTo
|
98 |
-
*
|
99 |
-
* description
|
100 |
-
*
|
101 |
-
* @date 1/2/18
|
102 |
-
* @since 5.6.5
|
103 |
-
*
|
104 |
-
* @param void
|
105 |
-
* @return void
|
106 |
-
*/
|
107 |
-
|
108 |
-
var EqualTo = acf.Condition.extend({
|
109 |
-
type: 'equalTo',
|
110 |
-
operator: '==',
|
111 |
-
label: __('Value is equal to'),
|
112 |
-
fieldTypes: [ 'text', 'textarea', 'number', 'range', 'email', 'url', 'password' ],
|
113 |
-
match: function( rule, field ){
|
114 |
-
if( $.isNumeric(rule.value) ) {
|
115 |
-
return isEqualToNumber( rule.value, field.val() );
|
116 |
-
} else {
|
117 |
-
return isEqualTo( rule.value, field.val() );
|
118 |
-
}
|
119 |
-
},
|
120 |
-
choices: function( fieldObject ){
|
121 |
-
return '<input type="text" />';
|
122 |
-
}
|
123 |
-
});
|
124 |
-
|
125 |
-
acf.registerConditionType( EqualTo );
|
126 |
-
|
127 |
-
/**
|
128 |
-
* NotEqualTo
|
129 |
-
*
|
130 |
-
* description
|
131 |
-
*
|
132 |
-
* @date 1/2/18
|
133 |
-
* @since 5.6.5
|
134 |
-
*
|
135 |
-
* @param void
|
136 |
-
* @return void
|
137 |
-
*/
|
138 |
-
|
139 |
-
var NotEqualTo = EqualTo.extend({
|
140 |
-
type: 'notEqualTo',
|
141 |
-
operator: '!=',
|
142 |
-
label: __('Value is not equal to'),
|
143 |
-
match: function( rule, field ){
|
144 |
-
return !EqualTo.prototype.match.apply(this, arguments);
|
145 |
-
}
|
146 |
-
});
|
147 |
-
|
148 |
-
acf.registerConditionType( NotEqualTo );
|
149 |
-
|
150 |
-
/**
|
151 |
-
* PatternMatch
|
152 |
-
*
|
153 |
-
* description
|
154 |
-
*
|
155 |
-
* @date 1/2/18
|
156 |
-
* @since 5.6.5
|
157 |
-
*
|
158 |
-
* @param void
|
159 |
-
* @return void
|
160 |
-
*/
|
161 |
-
|
162 |
-
var PatternMatch = acf.Condition.extend({
|
163 |
-
type: 'patternMatch',
|
164 |
-
operator: '==pattern',
|
165 |
-
label: __('Value matches pattern'),
|
166 |
-
fieldTypes: [ 'text', 'textarea', 'email', 'url', 'password', 'wysiwyg' ],
|
167 |
-
match: function( rule, field ){
|
168 |
-
return matchesPattern( field.val(), rule.value );
|
169 |
-
},
|
170 |
-
choices: function( fieldObject ){
|
171 |
-
return '<input type="text" placeholder="[a-z0-9]" />';
|
172 |
-
}
|
173 |
-
});
|
174 |
-
|
175 |
-
acf.registerConditionType( PatternMatch );
|
176 |
-
|
177 |
-
/**
|
178 |
-
* Contains
|
179 |
-
*
|
180 |
-
* description
|
181 |
-
*
|
182 |
-
* @date 1/2/18
|
183 |
-
* @since 5.6.5
|
184 |
-
*
|
185 |
-
* @param void
|
186 |
-
* @return void
|
187 |
-
*/
|
188 |
-
|
189 |
-
var Contains = acf.Condition.extend({
|
190 |
-
type: 'contains',
|
191 |
-
operator: '==contains',
|
192 |
-
label: __('Value contains'),
|
193 |
-
fieldTypes: [ 'text', 'textarea', 'number', 'email', 'url', 'password', 'wysiwyg', 'oembed', 'select' ],
|
194 |
-
match: function( rule, field ){
|
195 |
-
return containsString( field.val(), rule.value );
|
196 |
-
},
|
197 |
-
choices: function( fieldObject ){
|
198 |
-
return '<input type="text" />';
|
199 |
-
}
|
200 |
-
});
|
201 |
-
|
202 |
-
acf.registerConditionType( Contains );
|
203 |
-
|
204 |
-
/**
|
205 |
-
* TrueFalseEqualTo
|
206 |
-
*
|
207 |
-
* description
|
208 |
-
*
|
209 |
-
* @date 1/2/18
|
210 |
-
* @since 5.6.5
|
211 |
-
*
|
212 |
-
* @param void
|
213 |
-
* @return void
|
214 |
-
*/
|
215 |
-
|
216 |
-
var TrueFalseEqualTo = EqualTo.extend({
|
217 |
-
type: 'trueFalseEqualTo',
|
218 |
-
choiceType: 'select',
|
219 |
-
fieldTypes: [ 'true_false' ],
|
220 |
-
choices: function( field ){
|
221 |
-
return [
|
222 |
-
{
|
223 |
-
id: 1,
|
224 |
-
text: __('Checked')
|
225 |
-
}
|
226 |
-
];
|
227 |
-
},
|
228 |
-
});
|
229 |
-
|
230 |
-
acf.registerConditionType( TrueFalseEqualTo );
|
231 |
-
|
232 |
-
/**
|
233 |
-
* TrueFalseNotEqualTo
|
234 |
-
*
|
235 |
-
* description
|
236 |
-
*
|
237 |
-
* @date 1/2/18
|
238 |
-
* @since 5.6.5
|
239 |
-
*
|
240 |
-
* @param void
|
241 |
-
* @return void
|
242 |
-
*/
|
243 |
-
|
244 |
-
var TrueFalseNotEqualTo = NotEqualTo.extend({
|
245 |
-
type: 'trueFalseNotEqualTo',
|
246 |
-
choiceType: 'select',
|
247 |
-
fieldTypes: [ 'true_false' ],
|
248 |
-
choices: function( field ){
|
249 |
-
return [
|
250 |
-
{
|
251 |
-
id: 1,
|
252 |
-
text: __('Checked')
|
253 |
-
}
|
254 |
-
];
|
255 |
-
},
|
256 |
-
});
|
257 |
-
|
258 |
-
acf.registerConditionType( TrueFalseNotEqualTo );
|
259 |
-
|
260 |
-
/**
|
261 |
-
* SelectEqualTo
|
262 |
-
*
|
263 |
-
* description
|
264 |
-
*
|
265 |
-
* @date 1/2/18
|
266 |
-
* @since 5.6.5
|
267 |
-
*
|
268 |
-
* @param void
|
269 |
-
* @return void
|
270 |
-
*/
|
271 |
-
|
272 |
-
var SelectEqualTo = acf.Condition.extend({
|
273 |
-
type: 'selectEqualTo',
|
274 |
-
operator: '==',
|
275 |
-
label: __('Value is equal to'),
|
276 |
-
fieldTypes: [ 'select', 'checkbox', 'radio', 'button_group' ],
|
277 |
-
match: function( rule, field ){
|
278 |
-
var val = field.val();
|
279 |
-
if( val instanceof Array ) {
|
280 |
-
return inArray( rule.value, val );
|
281 |
-
} else {
|
282 |
-
return isEqualTo( rule.value, val );
|
283 |
-
}
|
284 |
-
},
|
285 |
-
choices: function( fieldObject ){
|
286 |
-
|
287 |
-
// vars
|
288 |
-
var choices = [];
|
289 |
-
var lines = fieldObject.$setting('choices textarea').val().split("\n");
|
290 |
-
|
291 |
-
// allow null
|
292 |
-
if( fieldObject.$input('allow_null').prop('checked') ) {
|
293 |
-
choices.push({
|
294 |
-
id: '',
|
295 |
-
text: __('Null')
|
296 |
-
});
|
297 |
-
}
|
298 |
-
|
299 |
-
// loop
|
300 |
-
lines.map(function( line ){
|
301 |
-
|
302 |
-
// split
|
303 |
-
line = line.split(':');
|
304 |
-
|
305 |
-
// default label to value
|
306 |
-
line[1] = line[1] || line[0];
|
307 |
-
|
308 |
-
// append
|
309 |
-
choices.push({
|
310 |
-
id: $.trim( line[0] ),
|
311 |
-
text: $.trim( line[1] )
|
312 |
-
});
|
313 |
-
});
|
314 |
-
|
315 |
-
// return
|
316 |
-
return choices;
|
317 |
-
},
|
318 |
-
});
|
319 |
-
|
320 |
-
acf.registerConditionType( SelectEqualTo );
|
321 |
-
|
322 |
-
/**
|
323 |
-
* SelectNotEqualTo
|
324 |
-
*
|
325 |
-
* description
|
326 |
-
*
|
327 |
-
* @date 1/2/18
|
328 |
-
* @since 5.6.5
|
329 |
-
*
|
330 |
-
* @param void
|
331 |
-
* @return void
|
332 |
-
*/
|
333 |
-
|
334 |
-
var SelectNotEqualTo = SelectEqualTo.extend({
|
335 |
-
type: 'selectNotEqualTo',
|
336 |
-
operator: '!=',
|
337 |
-
label: __('Value is not equal to'),
|
338 |
-
match: function( rule, field ){
|
339 |
-
return !SelectEqualTo.prototype.match.apply(this, arguments);
|
340 |
-
}
|
341 |
-
});
|
342 |
-
|
343 |
-
acf.registerConditionType( SelectNotEqualTo );
|
344 |
-
|
345 |
-
/**
|
346 |
-
* GreaterThan
|
347 |
-
*
|
348 |
-
* description
|
349 |
-
*
|
350 |
-
* @date 1/2/18
|
351 |
-
* @since 5.6.5
|
352 |
-
*
|
353 |
-
* @param void
|
354 |
-
* @return void
|
355 |
-
*/
|
356 |
-
|
357 |
-
var GreaterThan = acf.Condition.extend({
|
358 |
-
type: 'greaterThan',
|
359 |
-
operator: '>',
|
360 |
-
label: __('Value is greater than'),
|
361 |
-
fieldTypes: [ 'number', 'range' ],
|
362 |
-
match: function( rule, field ){
|
363 |
-
var val = field.val();
|
364 |
-
if( val instanceof Array ) {
|
365 |
-
val = val.length;
|
366 |
-
}
|
367 |
-
return isGreaterThan( val, rule.value );
|
368 |
-
},
|
369 |
-
choices: function( fieldObject ){
|
370 |
-
return '<input type="number" />';
|
371 |
-
}
|
372 |
-
});
|
373 |
-
|
374 |
-
acf.registerConditionType( GreaterThan );
|
375 |
-
|
376 |
-
|
377 |
-
/**
|
378 |
-
* LessThan
|
379 |
-
*
|
380 |
-
* description
|
381 |
-
*
|
382 |
-
* @date 1/2/18
|
383 |
-
* @since 5.6.5
|
384 |
-
*
|
385 |
-
* @param void
|
386 |
-
* @return void
|
387 |
-
*/
|
388 |
-
|
389 |
-
var LessThan = GreaterThan.extend({
|
390 |
-
type: 'lessThan',
|
391 |
-
operator: '<',
|
392 |
-
label: __('Value is less than'),
|
393 |
-
match: function( rule, field ){
|
394 |
-
var val = field.val();
|
395 |
-
if( val instanceof Array ) {
|
396 |
-
val = val.length;
|
397 |
-
}
|
398 |
-
return isLessThan( val, rule.value );
|
399 |
-
},
|
400 |
-
choices: function( fieldObject ){
|
401 |
-
return '<input type="number" />';
|
402 |
-
}
|
403 |
-
});
|
404 |
-
|
405 |
-
acf.registerConditionType( LessThan );
|
406 |
-
|
407 |
-
/**
|
408 |
-
* SelectedGreaterThan
|
409 |
-
*
|
410 |
-
* description
|
411 |
-
*
|
412 |
-
* @date 1/2/18
|
413 |
-
* @since 5.6.5
|
414 |
-
*
|
415 |
-
* @param void
|
416 |
-
* @return void
|
417 |
-
*/
|
418 |
-
|
419 |
-
var SelectionGreaterThan = GreaterThan.extend({
|
420 |
-
type: 'selectionGreaterThan',
|
421 |
-
label: __('Selection is greater than'),
|
422 |
-
fieldTypes: [ 'checkbox', 'select', 'post_object', 'page_link', 'relationship', 'taxonomy', 'user' ],
|
423 |
-
});
|
424 |
-
|
425 |
-
acf.registerConditionType( SelectionGreaterThan );
|
426 |
-
|
427 |
-
/**
|
428 |
-
* SelectedGreaterThan
|
429 |
-
*
|
430 |
-
* description
|
431 |
-
*
|
432 |
-
* @date 1/2/18
|
433 |
-
* @since 5.6.5
|
434 |
-
*
|
435 |
-
* @param void
|
436 |
-
* @return void
|
437 |
-
*/
|
438 |
-
|
439 |
-
var SelectionLessThan = LessThan.extend({
|
440 |
-
type: 'selectionLessThan',
|
441 |
-
label: __('Selection is less than'),
|
442 |
-
fieldTypes: [ 'checkbox', 'select', 'post_object', 'page_link', 'relationship', 'taxonomy', 'user' ],
|
443 |
-
});
|
444 |
-
|
445 |
-
acf.registerConditionType( SelectionLessThan );
|
446 |
-
|
447 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/build/js/_acf-condition.js
DELETED
@@ -1,249 +0,0 @@
|
|
1 |
-
(function($, undefined){
|
2 |
-
|
3 |
-
// vars
|
4 |
-
var storage = [];
|
5 |
-
|
6 |
-
/**
|
7 |
-
* acf.Condition
|
8 |
-
*
|
9 |
-
* description
|
10 |
-
*
|
11 |
-
* @date 23/3/18
|
12 |
-
* @since 5.6.9
|
13 |
-
*
|
14 |
-
* @param type $var Description. Default.
|
15 |
-
* @return type Description.
|
16 |
-
*/
|
17 |
-
|
18 |
-
acf.Condition = acf.Model.extend({
|
19 |
-
|
20 |
-
type: '', // used for model name
|
21 |
-
operator: '==', // rule operator
|
22 |
-
label: '', // label shown when editing fields
|
23 |
-
choiceType: 'input', // input, select
|
24 |
-
fieldTypes: [], // auto connect this conditions with these field types
|
25 |
-
|
26 |
-
data: {
|
27 |
-
conditions: false, // the parent instance
|
28 |
-
field: false, // the field which we query against
|
29 |
-
rule: {} // the rule [field, operator, value]
|
30 |
-
},
|
31 |
-
|
32 |
-
events: {
|
33 |
-
'change': 'change',
|
34 |
-
'keyup': 'change',
|
35 |
-
'enableField': 'change',
|
36 |
-
'disableField': 'change'
|
37 |
-
},
|
38 |
-
|
39 |
-
setup: function( props ){
|
40 |
-
$.extend(this.data, props);
|
41 |
-
},
|
42 |
-
|
43 |
-
getEventTarget: function( $el, event ){
|
44 |
-
return $el || this.get('field').$el;
|
45 |
-
},
|
46 |
-
|
47 |
-
change: function( e, $el ){
|
48 |
-
this.get('conditions').change( e );
|
49 |
-
},
|
50 |
-
|
51 |
-
match: function( rule, field ){
|
52 |
-
return false;
|
53 |
-
},
|
54 |
-
|
55 |
-
calculate: function(){
|
56 |
-
return this.match( this.get('rule'), this.get('field') );
|
57 |
-
},
|
58 |
-
|
59 |
-
choices: function( field ){
|
60 |
-
return '<input type="text" />';
|
61 |
-
}
|
62 |
-
});
|
63 |
-
|
64 |
-
/**
|
65 |
-
* acf.newCondition
|
66 |
-
*
|
67 |
-
* description
|
68 |
-
*
|
69 |
-
* @date 1/2/18
|
70 |
-
* @since 5.6.5
|
71 |
-
*
|
72 |
-
* @param type $var Description. Default.
|
73 |
-
* @return type Description.
|
74 |
-
*/
|
75 |
-
|
76 |
-
acf.newCondition = function( rule, conditions ){
|
77 |
-
|
78 |
-
// currently setting up conditions for fieldX, this field is the 'target'
|
79 |
-
var target = conditions.get('field');
|
80 |
-
|
81 |
-
// use the 'target' to find the 'trigger' field.
|
82 |
-
// - this field is used to setup the conditional logic events
|
83 |
-
var field = target.getField( rule.field );
|
84 |
-
|
85 |
-
// bail ealry if no target or no field (possible if field doesn't exist due to HTML error)
|
86 |
-
if( !target || !field ) {
|
87 |
-
return false;
|
88 |
-
}
|
89 |
-
|
90 |
-
// vars
|
91 |
-
var args = {
|
92 |
-
rule: rule,
|
93 |
-
target: target,
|
94 |
-
conditions: conditions,
|
95 |
-
field: field
|
96 |
-
};
|
97 |
-
|
98 |
-
// vars
|
99 |
-
var fieldType = field.get('type');
|
100 |
-
var operator = rule.operator;
|
101 |
-
|
102 |
-
// get avaibale conditions
|
103 |
-
var conditionTypes = acf.getConditionTypes({
|
104 |
-
fieldType: fieldType,
|
105 |
-
operator: operator,
|
106 |
-
});
|
107 |
-
|
108 |
-
// instantiate
|
109 |
-
var model = conditionTypes[0] || acf.Condition;
|
110 |
-
|
111 |
-
// instantiate
|
112 |
-
var condition = new model( args );
|
113 |
-
|
114 |
-
// return
|
115 |
-
return condition;
|
116 |
-
};
|
117 |
-
|
118 |
-
/**
|
119 |
-
* mid
|
120 |
-
*
|
121 |
-
* Calculates the model ID for a field type
|
122 |
-
*
|
123 |
-
* @date 15/12/17
|
124 |
-
* @since 5.6.5
|
125 |
-
*
|
126 |
-
* @param string type
|
127 |
-
* @return string
|
128 |
-
*/
|
129 |
-
|
130 |
-
var modelId = function( type ) {
|
131 |
-
return acf.strPascalCase( type || '' ) + 'Condition';
|
132 |
-
};
|
133 |
-
|
134 |
-
/**
|
135 |
-
* acf.registerConditionType
|
136 |
-
*
|
137 |
-
* description
|
138 |
-
*
|
139 |
-
* @date 1/2/18
|
140 |
-
* @since 5.6.5
|
141 |
-
*
|
142 |
-
* @param type $var Description. Default.
|
143 |
-
* @return type Description.
|
144 |
-
*/
|
145 |
-
|
146 |
-
acf.registerConditionType = function( model ){
|
147 |
-
|
148 |
-
// vars
|
149 |
-
var proto = model.prototype;
|
150 |
-
var type = proto.type;
|
151 |
-
var mid = modelId( type );
|
152 |
-
|
153 |
-
// store model
|
154 |
-
acf.models[ mid ] = model;
|
155 |
-
|
156 |
-
// store reference
|
157 |
-
storage.push( type );
|
158 |
-
};
|
159 |
-
|
160 |
-
/**
|
161 |
-
* acf.getConditionType
|
162 |
-
*
|
163 |
-
* description
|
164 |
-
*
|
165 |
-
* @date 1/2/18
|
166 |
-
* @since 5.6.5
|
167 |
-
*
|
168 |
-
* @param type $var Description. Default.
|
169 |
-
* @return type Description.
|
170 |
-
*/
|
171 |
-
|
172 |
-
acf.getConditionType = function( type ){
|
173 |
-
var mid = modelId( type );
|
174 |
-
return acf.models[ mid ] || false;
|
175 |
-
}
|
176 |
-
|
177 |
-
/**
|
178 |
-
* acf.registerConditionForFieldType
|
179 |
-
*
|
180 |
-
* description
|
181 |
-
*
|
182 |
-
* @date 1/2/18
|
183 |
-
* @since 5.6.5
|
184 |
-
*
|
185 |
-
* @param type $var Description. Default.
|
186 |
-
* @return type Description.
|
187 |
-
*/
|
188 |
-
|
189 |
-
acf.registerConditionForFieldType = function( conditionType, fieldType ){
|
190 |
-
|
191 |
-
// get model
|
192 |
-
var model = acf.getConditionType( conditionType );
|
193 |
-
|
194 |
-
// append
|
195 |
-
if( model ) {
|
196 |
-
model.prototype.fieldTypes.push( fieldType );
|
197 |
-
}
|
198 |
-
};
|
199 |
-
|
200 |
-
/**
|
201 |
-
* acf.getConditionTypes
|
202 |
-
*
|
203 |
-
* description
|
204 |
-
*
|
205 |
-
* @date 1/2/18
|
206 |
-
* @since 5.6.5
|
207 |
-
*
|
208 |
-
* @param type $var Description. Default.
|
209 |
-
* @return type Description.
|
210 |
-
*/
|
211 |
-
|
212 |
-
acf.getConditionTypes = function( args ){
|
213 |
-
|
214 |
-
// defaults
|
215 |
-
args = acf.parseArgs(args, {
|
216 |
-
fieldType: '',
|
217 |
-
operator: ''
|
218 |
-
});
|
219 |
-
|
220 |
-
// clonse available types
|
221 |
-
var types = [];
|
222 |
-
|
223 |
-
// loop
|
224 |
-
storage.map(function( type ){
|
225 |
-
|
226 |
-
// vars
|
227 |
-
var model = acf.getConditionType(type);
|
228 |
-
var ProtoFieldTypes = model.prototype.fieldTypes;
|
229 |
-
var ProtoOperator = model.prototype.operator;
|
230 |
-
|
231 |
-
// check fieldType
|
232 |
-
if( args.fieldType && ProtoFieldTypes.indexOf( args.fieldType ) === -1 ) {
|
233 |
-
return;
|
234 |
-
}
|
235 |
-
|
236 |
-
// check operator
|
237 |
-
if( args.operator && ProtoOperator !== args.operator ) {
|
238 |
-
return;
|
239 |
-
}
|
240 |
-
|
241 |
-
// append
|
242 |
-
types.push( model );
|
243 |
-
});
|
244 |
-
|
245 |
-
// return
|
246 |
-
return types;
|
247 |
-
};
|
248 |
-
|
249 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/build/js/_acf-conditions.js
DELETED
@@ -1,306 +0,0 @@
|
|
1 |
-
(function($, undefined){
|
2 |
-
|
3 |
-
// vars
|
4 |
-
var CONTEXT = 'conditional_logic';
|
5 |
-
|
6 |
-
/**
|
7 |
-
* conditionsManager
|
8 |
-
*
|
9 |
-
* description
|
10 |
-
*
|
11 |
-
* @date 1/2/18
|
12 |
-
* @since 5.6.5
|
13 |
-
*
|
14 |
-
* @param type $var Description. Default.
|
15 |
-
* @return type Description.
|
16 |
-
*/
|
17 |
-
|
18 |
-
var conditionsManager = new acf.Model({
|
19 |
-
|
20 |
-
id: 'conditionsManager',
|
21 |
-
|
22 |
-
priority: 20, // run actions later
|
23 |
-
|
24 |
-
actions: {
|
25 |
-
'new_field': 'onNewField',
|
26 |
-
},
|
27 |
-
|
28 |
-
onNewField: function( field ){
|
29 |
-
if( field.has('conditions') ) {
|
30 |
-
field.getConditions().render();
|
31 |
-
}
|
32 |
-
},
|
33 |
-
});
|
34 |
-
|
35 |
-
/**
|
36 |
-
* acf.Field.prototype.getField
|
37 |
-
*
|
38 |
-
* Finds a field that is related to another field
|
39 |
-
*
|
40 |
-
* @date 1/2/18
|
41 |
-
* @since 5.6.5
|
42 |
-
*
|
43 |
-
* @param type $var Description. Default.
|
44 |
-
* @return type Description.
|
45 |
-
*/
|
46 |
-
|
47 |
-
var getSiblingField = function( field, key ){
|
48 |
-
|
49 |
-
// find sibling (very fast)
|
50 |
-
var fields = acf.getFields({
|
51 |
-
key: key,
|
52 |
-
sibling: field.$el,
|
53 |
-
suppressFilters: true,
|
54 |
-
});
|
55 |
-
|
56 |
-
// find sibling-children (fast)
|
57 |
-
// needed for group fields, accordions, etc
|
58 |
-
if( !fields.length ) {
|
59 |
-
fields = acf.getFields({
|
60 |
-
key: key,
|
61 |
-
parent: field.$el.parent(),
|
62 |
-
suppressFilters: true,
|
63 |
-
});
|
64 |
-
}
|
65 |
-
|
66 |
-
// return
|
67 |
-
if( fields.length ) {
|
68 |
-
return fields[0];
|
69 |
-
}
|
70 |
-
return false;
|
71 |
-
};
|
72 |
-
|
73 |
-
acf.Field.prototype.getField = function( key ){
|
74 |
-
|
75 |
-
// get sibling field
|
76 |
-
var field = getSiblingField( this, key );
|
77 |
-
|
78 |
-
// return early
|
79 |
-
if( field ) {
|
80 |
-
return field;
|
81 |
-
}
|
82 |
-
|
83 |
-
// move up through each parent and try again
|
84 |
-
var parents = this.parents();
|
85 |
-
for( var i = 0; i < parents.length; i++ ) {
|
86 |
-
|
87 |
-
// get sibling field
|
88 |
-
field = getSiblingField( parents[i], key );
|
89 |
-
|
90 |
-
// return early
|
91 |
-
if( field ) {
|
92 |
-
return field;
|
93 |
-
}
|
94 |
-
}
|
95 |
-
|
96 |
-
// return
|
97 |
-
return false;
|
98 |
-
};
|
99 |
-
|
100 |
-
|
101 |
-
/**
|
102 |
-
* acf.Field.prototype.getConditions
|
103 |
-
*
|
104 |
-
* Returns the field's conditions instance
|
105 |
-
*
|
106 |
-
* @date 1/2/18
|
107 |
-
* @since 5.6.5
|
108 |
-
*
|
109 |
-
* @param type $var Description. Default.
|
110 |
-
* @return type Description.
|
111 |
-
*/
|
112 |
-
|
113 |
-
acf.Field.prototype.getConditions = function(){
|
114 |
-
|
115 |
-
// instantiate
|
116 |
-
if( !this.conditions ) {
|
117 |
-
this.conditions = new Conditions( this );
|
118 |
-
}
|
119 |
-
|
120 |
-
// return
|
121 |
-
return this.conditions;
|
122 |
-
};
|
123 |
-
|
124 |
-
|
125 |
-
/**
|
126 |
-
* Conditions
|
127 |
-
*
|
128 |
-
* description
|
129 |
-
*
|
130 |
-
* @date 1/2/18
|
131 |
-
* @since 5.6.5
|
132 |
-
*
|
133 |
-
* @param type $var Description. Default.
|
134 |
-
* @return type Description.
|
135 |
-
*/
|
136 |
-
var timeout = false;
|
137 |
-
var Conditions = acf.Model.extend({
|
138 |
-
|
139 |
-
id: 'Conditions',
|
140 |
-
|
141 |
-
data: {
|
142 |
-
field: false, // The field with "data-conditions" (target).
|
143 |
-
timeStamp: false, // Reference used during "change" event.
|
144 |
-
groups: [], // The groups of condition instances.
|
145 |
-
},
|
146 |
-
|
147 |
-
setup: function( field ){
|
148 |
-
|
149 |
-
// data
|
150 |
-
this.data.field = field;
|
151 |
-
|
152 |
-
// vars
|
153 |
-
var conditions = field.get('conditions');
|
154 |
-
|
155 |
-
// detect groups
|
156 |
-
if( conditions instanceof Array ) {
|
157 |
-
|
158 |
-
// detect groups
|
159 |
-
if( conditions[0] instanceof Array ) {
|
160 |
-
|
161 |
-
// loop
|
162 |
-
conditions.map(function(rules, i){
|
163 |
-
this.addRules( rules, i );
|
164 |
-
}, this);
|
165 |
-
|
166 |
-
// detect rules
|
167 |
-
} else {
|
168 |
-
this.addRules( conditions );
|
169 |
-
}
|
170 |
-
|
171 |
-
// detect rule
|
172 |
-
} else {
|
173 |
-
this.addRule( conditions );
|
174 |
-
}
|
175 |
-
},
|
176 |
-
|
177 |
-
change: function( e ){
|
178 |
-
|
179 |
-
// this function may be triggered multiple times per event due to multiple condition classes
|
180 |
-
// compare timestamp to allow only 1 trigger per event
|
181 |
-
if( this.get('timeStamp') === e.timeStamp ) {
|
182 |
-
return false;
|
183 |
-
} else {
|
184 |
-
this.set('timeStamp', e.timeStamp, true);
|
185 |
-
}
|
186 |
-
|
187 |
-
// render condition and store result
|
188 |
-
var changed = this.render();
|
189 |
-
},
|
190 |
-
|
191 |
-
render: function(){
|
192 |
-
return this.calculate() ? this.show() : this.hide();
|
193 |
-
},
|
194 |
-
|
195 |
-
show: function(){
|
196 |
-
return this.get('field').showEnable(this.cid, CONTEXT);
|
197 |
-
},
|
198 |
-
|
199 |
-
hide: function(){
|
200 |
-
return this.get('field').hideDisable(this.cid, CONTEXT);
|
201 |
-
},
|
202 |
-
|
203 |
-
calculate: function(){
|
204 |
-
|
205 |
-
// vars
|
206 |
-
var pass = false;
|
207 |
-
|
208 |
-
// loop
|
209 |
-
this.getGroups().map(function( group ){
|
210 |
-
|
211 |
-
// igrnore this group if another group passed
|
212 |
-
if( pass ) return;
|
213 |
-
|
214 |
-
// find passed
|
215 |
-
var passed = group.filter(function(condition){
|
216 |
-
return condition.calculate();
|
217 |
-
});
|
218 |
-
|
219 |
-
// if all conditions passed, update the global var
|
220 |
-
if( passed.length == group.length ) {
|
221 |
-
pass = true;
|
222 |
-
}
|
223 |
-
});
|
224 |
-
|
225 |
-
return pass;
|
226 |
-
},
|
227 |
-
|
228 |
-
hasGroups: function(){
|
229 |
-
return this.data.groups != null;
|
230 |
-
},
|
231 |
-
|
232 |
-
getGroups: function(){
|
233 |
-
return this.data.groups;
|
234 |
-
},
|
235 |
-
|
236 |
-
addGroup: function(){
|
237 |
-
var group = [];
|
238 |
-
this.data.groups.push( group );
|
239 |
-
return group;
|
240 |
-
},
|
241 |
-
|
242 |
-
hasGroup: function( i ){
|
243 |
-
return this.data.groups[i] != null;
|
244 |
-
},
|
245 |
-
|
246 |
-
getGroup: function( i ){
|
247 |
-
return this.data.groups[i];
|
248 |
-
},
|
249 |
-
|
250 |
-
removeGroup: function( i ){
|
251 |
-
this.data.groups[i].delete;
|
252 |
-
return this;
|
253 |
-
},
|
254 |
-
|
255 |
-
addRules: function( rules, group ){
|
256 |
-
rules.map(function( rule ){
|
257 |
-
this.addRule( rule, group );
|
258 |
-
}, this);
|
259 |
-
},
|
260 |
-
|
261 |
-
addRule: function( rule, group ){
|
262 |
-
|
263 |
-
// defaults
|
264 |
-
group = group || 0;
|
265 |
-
|
266 |
-
// vars
|
267 |
-
var groupArray;
|
268 |
-
|
269 |
-
// get group
|
270 |
-
if( this.hasGroup(group) ) {
|
271 |
-
groupArray = this.getGroup(group);
|
272 |
-
} else {
|
273 |
-
groupArray = this.addGroup();
|
274 |
-
}
|
275 |
-
|
276 |
-
// instantiate
|
277 |
-
var condition = acf.newCondition( rule, this );
|
278 |
-
|
279 |
-
// bail ealry if condition failed (field did not exist)
|
280 |
-
if( !condition ) {
|
281 |
-
return false;
|
282 |
-
}
|
283 |
-
|
284 |
-
// add rule
|
285 |
-
groupArray.push(condition);
|
286 |
-
},
|
287 |
-
|
288 |
-
hasRule: function(){
|
289 |
-
|
290 |
-
},
|
291 |
-
|
292 |
-
getRule: function( rule, group ){
|
293 |
-
|
294 |
-
// defaults
|
295 |
-
rule = rule || 0;
|
296 |
-
group = group || 0;
|
297 |
-
|
298 |
-
return this.data.groups[ group ][ rule ];
|
299 |
-
},
|
300 |
-
|
301 |
-
removeRule: function(){
|
302 |
-
|
303 |
-
}
|
304 |
-
});
|
305 |
-
|
306 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/build/js/_acf-field-accordion.js
DELETED
@@ -1,232 +0,0 @@
|
|
1 |
-
(function($, undefined){
|
2 |
-
|
3 |
-
var i = 0;
|
4 |
-
|
5 |
-
var Field = acf.Field.extend({
|
6 |
-
|
7 |
-
type: 'accordion',
|
8 |
-
|
9 |
-
wait: '',
|
10 |
-
|
11 |
-
$control: function(){
|
12 |
-
return this.$('.acf-fields:first');
|
13 |
-
},
|
14 |
-
|
15 |
-
initialize: function(){
|
16 |
-
|
17 |
-
// bail early if is cell
|
18 |
-
if( this.$el.is('td') ) return;
|
19 |
-
|
20 |
-
// enpoint
|
21 |
-
if( this.get('endpoint') ) {
|
22 |
-
return this.remove();
|
23 |
-
}
|
24 |
-
|
25 |
-
// vars
|
26 |
-
var $field = this.$el;
|
27 |
-
var $label = this.$labelWrap()
|
28 |
-
var $input = this.$inputWrap();
|
29 |
-
var $wrap = this.$control();
|
30 |
-
var $instructions = $input.children('.description');
|
31 |
-
|
32 |
-
// force description into label
|
33 |
-
if( $instructions.length ) {
|
34 |
-
$label.append( $instructions );
|
35 |
-
}
|
36 |
-
|
37 |
-
// table
|
38 |
-
if( this.$el.is('tr') ) {
|
39 |
-
|
40 |
-
// vars
|
41 |
-
var $table = this.$el.closest('table');
|
42 |
-
var $newLabel = $('<div class="acf-accordion-title"/>');
|
43 |
-
var $newInput = $('<div class="acf-accordion-content"/>');
|
44 |
-
var $newTable = $('<table class="' + $table.attr('class') + '"/>');
|
45 |
-
var $newWrap = $('<tbody/>');
|
46 |
-
|
47 |
-
// dom
|
48 |
-
$newLabel.append( $label.html() );
|
49 |
-
$newTable.append( $newWrap );
|
50 |
-
$newInput.append( $newTable );
|
51 |
-
$input.append( $newLabel );
|
52 |
-
$input.append( $newInput );
|
53 |
-
|
54 |
-
// modify
|
55 |
-
$label.remove();
|
56 |
-
$wrap.remove();
|
57 |
-
$input.attr('colspan', 2);
|
58 |
-
|
59 |
-
// update vars
|
60 |
-
$label = $newLabel;
|
61 |
-
$input = $newInput;
|
62 |
-
$wrap = $newWrap;
|
63 |
-
}
|
64 |
-
|
65 |
-
// add classes
|
66 |
-
$field.addClass('acf-accordion');
|
67 |
-
$label.addClass('acf-accordion-title');
|
68 |
-
$input.addClass('acf-accordion-content');
|
69 |
-
|
70 |
-
// index
|
71 |
-
i++;
|
72 |
-
|
73 |
-
// multi-expand
|
74 |
-
if( this.get('multi_expand') ) {
|
75 |
-
$field.attr('multi-expand', 1);
|
76 |
-
}
|
77 |
-
|
78 |
-
// open
|
79 |
-
var order = acf.getPreference('this.accordions') || [];
|
80 |
-
if( order[i-1] !== undefined ) {
|
81 |
-
this.set('open', order[i-1]);
|
82 |
-
}
|
83 |
-
|
84 |
-
if( this.get('open') ) {
|
85 |
-
$field.addClass('-open');
|
86 |
-
$input.css('display', 'block'); // needed for accordion to close smoothly
|
87 |
-
}
|
88 |
-
|
89 |
-
// add icon
|
90 |
-
$label.prepend( accordionManager.iconHtml({ open: this.get('open') }) );
|
91 |
-
|
92 |
-
// classes
|
93 |
-
// - remove 'inside' which is a #poststuff WP class
|
94 |
-
var $parent = $field.parent();
|
95 |
-
$wrap.addClass( $parent.hasClass('-left') ? '-left' : '' );
|
96 |
-
$wrap.addClass( $parent.hasClass('-clear') ? '-clear' : '' );
|
97 |
-
|
98 |
-
// append
|
99 |
-
$wrap.append( $field.nextUntil('.acf-field-accordion', '.acf-field') );
|
100 |
-
|
101 |
-
// clean up
|
102 |
-
$wrap.removeAttr('data-open data-multi_expand data-endpoint');
|
103 |
-
},
|
104 |
-
|
105 |
-
});
|
106 |
-
|
107 |
-
acf.registerFieldType( Field );
|
108 |
-
|
109 |
-
|
110 |
-
/**
|
111 |
-
* accordionManager
|
112 |
-
*
|
113 |
-
* Events manager for the acf accordion
|
114 |
-
*
|
115 |
-
* @date 14/2/18
|
116 |
-
* @since 5.6.9
|
117 |
-
*
|
118 |
-
* @param void
|
119 |
-
* @return void
|
120 |
-
*/
|
121 |
-
|
122 |
-
var accordionManager = new acf.Model({
|
123 |
-
|
124 |
-
actions: {
|
125 |
-
'unload': 'onUnload'
|
126 |
-
},
|
127 |
-
|
128 |
-
events: {
|
129 |
-
'click .acf-accordion-title': 'onClick',
|
130 |
-
'invalidField .acf-accordion': 'onInvalidField'
|
131 |
-
},
|
132 |
-
|
133 |
-
isOpen: function( $el ) {
|
134 |
-
return $el.hasClass('-open');
|
135 |
-
},
|
136 |
-
|
137 |
-
toggle: function( $el ){
|
138 |
-
if( this.isOpen($el) ) {
|
139 |
-
this.close( $el );
|
140 |
-
} else {
|
141 |
-
this.open( $el );
|
142 |
-
}
|
143 |
-
},
|
144 |
-
|
145 |
-
iconHtml: function( props ){
|
146 |
-
|
147 |
-
// Determine icon.
|
148 |
-
//if( acf.isGutenberg() ) {
|
149 |
-
// var icon = props.open ? 'arrow-up-alt2' : 'arrow-down-alt2';
|
150 |
-
//} else {
|
151 |
-
var icon = props.open ? 'arrow-down' : 'arrow-right';
|
152 |
-
//}
|
153 |
-
|
154 |
-
// Return HTML.
|
155 |
-
return '<i class="acf-accordion-icon dashicons dashicons-' + icon + '"></i>';
|
156 |
-
},
|
157 |
-
|
158 |
-
open: function( $el ){
|
159 |
-
|
160 |
-
// open
|
161 |
-
$el.find('.acf-accordion-content:first').slideDown().css('display', 'block');
|
162 |
-
$el.find('.acf-accordion-icon:first').replaceWith( this.iconHtml({ open: true }) );
|
163 |
-
$el.addClass('-open');
|
164 |
-
|
165 |
-
// action
|
166 |
-
acf.doAction('show', $el);
|
167 |
-
|
168 |
-
// close siblings
|
169 |
-
if( !$el.attr('multi-expand') ) {
|
170 |
-
$el.siblings('.acf-accordion.-open').each(function(){
|
171 |
-
accordionManager.close( $(this) );
|
172 |
-
});
|
173 |
-
}
|
174 |
-
},
|
175 |
-
|
176 |
-
close: function( $el ){
|
177 |
-
|
178 |
-
// close
|
179 |
-
$el.find('.acf-accordion-content:first').slideUp();
|
180 |
-
$el.find('.acf-accordion-icon:first').replaceWith( this.iconHtml({ open: false }) );
|
181 |
-
$el.removeClass('-open');
|
182 |
-
|
183 |
-
// action
|
184 |
-
acf.doAction('hide', $el);
|
185 |
-
},
|
186 |
-
|
187 |
-
onClick: function( e, $el ){
|
188 |
-
|
189 |
-
// prevent Defailt
|
190 |
-
e.preventDefault();
|
191 |
-
|
192 |
-
// open close
|
193 |
-
this.toggle( $el.parent() );
|
194 |
-
|
195 |
-
},
|
196 |
-
|
197 |
-
onInvalidField: function( e, $el ){
|
198 |
-
|
199 |
-
// bail early if already focused
|
200 |
-
if( this.busy ) {
|
201 |
-
return;
|
202 |
-
}
|
203 |
-
|
204 |
-
// disable functionality for 1sec (allow next validation to work)
|
205 |
-
this.busy = true;
|
206 |
-
this.setTimeout(function(){
|
207 |
-
this.busy = false;
|
208 |
-
}, 1000);
|
209 |
-
|
210 |
-
// open accordion
|
211 |
-
this.open( $el );
|
212 |
-
},
|
213 |
-
|
214 |
-
onUnload: function( e ){
|
215 |
-
|
216 |
-
// vars
|
217 |
-
var order = [];
|
218 |
-
|
219 |
-
// loop
|
220 |
-
$('.acf-accordion').each(function(){
|
221 |
-
var open = $(this).hasClass('-open') ? 1 : 0;
|
222 |
-
order.push(open);
|
223 |
-
});
|
224 |
-
|
225 |
-
// set
|
226 |
-
if( order.length ) {
|
227 |
-
acf.setPreference('this.accordions', order);
|
228 |
-
}
|
229 |
-
}
|
230 |
-
});
|
231 |
-
|
232 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/build/js/_acf-field-button-group.js
DELETED
@@ -1,45 +0,0 @@
|
|
1 |
-
(function($, undefined){
|
2 |
-
|
3 |
-
var Field = acf.Field.extend({
|
4 |
-
|
5 |
-
type: 'button_group',
|
6 |
-
|
7 |
-
events: {
|
8 |
-
'click input[type="radio"]': 'onClick'
|
9 |
-
},
|
10 |
-
|
11 |
-
$control: function(){
|
12 |
-
return this.$('.acf-button-group');
|
13 |
-
},
|
14 |
-
|
15 |
-
$input: function(){
|
16 |
-
return this.$('input:checked');
|
17 |
-
},
|
18 |
-
|
19 |
-
setValue: function( val ){
|
20 |
-
this.$('input[value="' + val + '"]').prop('checked', true).trigger('change');
|
21 |
-
},
|
22 |
-
|
23 |
-
onClick: function( e, $el ){
|
24 |
-
|
25 |
-
// vars
|
26 |
-
var $label = $el.parent('label');
|
27 |
-
var selected = $label.hasClass('selected');
|
28 |
-
|
29 |
-
// remove previous selected
|
30 |
-
this.$('.selected').removeClass('selected');
|
31 |
-
|
32 |
-
// add active class
|
33 |
-
$label.addClass('selected');
|
34 |
-
|
35 |
-
// allow null
|
36 |
-
if( this.get('allow_null') && selected ) {
|
37 |
-
$label.removeClass('selected');
|
38 |
-
$el.prop('checked', false).trigger('change');
|
39 |
-
}
|
40 |
-
}
|
41 |
-
});
|
42 |
-
|
43 |
-
acf.registerFieldType( Field );
|
44 |
-
|
45 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/build/js/_acf-field-checkbox.js
DELETED
@@ -1,97 +0,0 @@
|
|
1 |
-
(function($, undefined){
|
2 |
-
|
3 |
-
var Field = acf.Field.extend({
|
4 |
-
|
5 |
-
type: 'checkbox',
|
6 |
-
|
7 |
-
events: {
|
8 |
-
'change input': 'onChange',
|
9 |
-
'click .acf-add-checkbox': 'onClickAdd',
|
10 |
-
'click .acf-checkbox-toggle': 'onClickToggle',
|
11 |
-
'click .acf-checkbox-custom': 'onClickCustom'
|
12 |
-
},
|
13 |
-
|
14 |
-
$control: function(){
|
15 |
-
return this.$('.acf-checkbox-list');
|
16 |
-
},
|
17 |
-
|
18 |
-
$toggle: function(){
|
19 |
-
return this.$('.acf-checkbox-toggle');
|
20 |
-
},
|
21 |
-
|
22 |
-
$input: function(){
|
23 |
-
return this.$('input[type="hidden"]');
|
24 |
-
},
|
25 |
-
|
26 |
-
$inputs: function(){
|
27 |
-
return this.$('input[type="checkbox"]').not('.acf-checkbox-toggle');
|
28 |
-
},
|
29 |
-
|
30 |
-
getValue: function(){
|
31 |
-
var val = [];
|
32 |
-
this.$(':checked').each(function(){
|
33 |
-
val.push( $(this).val() );
|
34 |
-
});
|
35 |
-
return val.length ? val : false;
|
36 |
-
},
|
37 |
-
|
38 |
-
onChange: function( e, $el ){
|
39 |
-
|
40 |
-
// vars
|
41 |
-
var checked = $el.prop('checked');
|
42 |
-
var $toggle = this.$toggle();
|
43 |
-
|
44 |
-
// selected
|
45 |
-
if( checked ) {
|
46 |
-
$el.parent().addClass('selected');
|
47 |
-
} else {
|
48 |
-
$el.parent().removeClass('selected');
|
49 |
-
}
|
50 |
-
|
51 |
-
// determine if all inputs are checked
|
52 |
-
if( $toggle.length ) {
|
53 |
-
var $inputs = this.$inputs();
|
54 |
-
|
55 |
-
// all checked
|
56 |
-
if( $inputs.not(':checked').length == 0 ) {
|
57 |
-
$toggle.prop('checked', true);
|
58 |
-
} else {
|
59 |
-
$toggle.prop('checked', false);
|
60 |
-
}
|
61 |
-
}
|
62 |
-
},
|
63 |
-
|
64 |
-
onClickAdd: function( e, $el ){
|
65 |
-
var html = '<li><input class="acf-checkbox-custom" type="checkbox" checked="checked" /><input type="text" name="' + this.getInputName() + '[]" /></li>';
|
66 |
-
$el.parent('li').before( html );
|
67 |
-
},
|
68 |
-
|
69 |
-
onClickToggle: function( e, $el ){
|
70 |
-
var checked = $el.prop('checked');
|
71 |
-
var $inputs = this.$inputs();
|
72 |
-
$inputs.prop('checked', checked);
|
73 |
-
},
|
74 |
-
|
75 |
-
onClickCustom: function( e, $el ){
|
76 |
-
var checked = $el.prop('checked');
|
77 |
-
var $text = $el.next('input[type="text"]');
|
78 |
-
|
79 |
-
// checked
|
80 |
-
if( checked ) {
|
81 |
-
$text.prop('disabled', false);
|
82 |
-
|
83 |
-
// not checked
|
84 |
-
} else {
|
85 |
-
$text.prop('disabled', true);
|
86 |
-
|
87 |
-
// remove
|
88 |
-
if( $text.val() == '' ) {
|
89 |
-
$el.parent('li').remove();
|
90 |
-
}
|
91 |
-
}
|
92 |
-
}
|
93 |
-
});
|
94 |
-
|
95 |
-
acf.registerFieldType( Field );
|
96 |
-
|
97 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/build/js/_acf-field-color-picker.js
DELETED
@@ -1,64 +0,0 @@
|
|
1 |
-
(function($, undefined){
|
2 |
-
|
3 |
-
var Field = acf.Field.extend({
|
4 |
-
|
5 |
-
type: 'color_picker',
|
6 |
-
|
7 |
-
wait: 'load',
|
8 |
-
|
9 |
-
$control: function(){
|
10 |
-
return this.$('.acf-color-picker');
|
11 |
-
},
|
12 |
-
|
13 |
-
$input: function(){
|
14 |
-
return this.$('input[type="hidden"]');
|
15 |
-
},
|
16 |
-
|
17 |
-
$inputText: function(){
|
18 |
-
return this.$('input[type="text"]');
|
19 |
-
},
|
20 |
-
|
21 |
-
setValue: function( val ){
|
22 |
-
|
23 |
-
// update input (with change)
|
24 |
-
acf.val( this.$input(), val );
|
25 |
-
|
26 |
-
// update iris
|
27 |
-
this.$inputText().iris('color', val);
|
28 |
-
},
|
29 |
-
|
30 |
-
initialize: function(){
|
31 |
-
|
32 |
-
// vars
|
33 |
-
var $input = this.$input();
|
34 |
-
var $inputText = this.$inputText();
|
35 |
-
|
36 |
-
// event
|
37 |
-
var onChange = function( e ){
|
38 |
-
|
39 |
-
// timeout is required to ensure the $input val is correct
|
40 |
-
setTimeout(function(){
|
41 |
-
acf.val( $input, $inputText.val() );
|
42 |
-
}, 1);
|
43 |
-
}
|
44 |
-
|
45 |
-
// args
|
46 |
-
var args = {
|
47 |
-
defaultColor: false,
|
48 |
-
palettes: true,
|
49 |
-
hide: true,
|
50 |
-
change: onChange,
|
51 |
-
clear: onChange
|
52 |
-
};
|
53 |
-
|
54 |
-
// filter
|
55 |
-
var args = acf.applyFilters('color_picker_args', args, this);
|
56 |
-
|
57 |
-
// initialize
|
58 |
-
$inputText.wpColorPicker( args );
|
59 |
-
}
|
60 |
-
});
|
61 |
-
|
62 |
-
acf.registerFieldType( Field );
|
63 |
-
|
64 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/build/js/_acf-field-date-picker.js
DELETED
@@ -1,157 +0,0 @@
|
|
1 |
-
(function($, undefined){
|
2 |
-
|
3 |
-
var Field = acf.Field.extend({
|
4 |
-
|
5 |
-
type: 'date_picker',
|
6 |
-
|
7 |
-
events: {
|
8 |
-
'blur input[type="text"]': 'onBlur'
|
9 |
-
},
|
10 |
-
|
11 |
-
$control: function(){
|
12 |
-
return this.$('.acf-date-picker');
|
13 |
-
},
|
14 |
-
|
15 |
-
$input: function(){
|
16 |
-
return this.$('input[type="hidden"]');
|
17 |
-
},
|
18 |
-
|
19 |
-
$inputText: function(){
|
20 |
-
return this.$('input[type="text"]');
|
21 |
-
},
|
22 |
-
|
23 |
-
initialize: function(){
|
24 |
-
|
25 |
-
// save_format: compatibility with ACF < 5.0.0
|
26 |
-
if( this.has('save_format') ) {
|
27 |
-
return this.initializeCompatibility();
|
28 |
-
}
|
29 |
-
|
30 |
-
// vars
|
31 |
-
var $input = this.$input();
|
32 |
-
var $inputText = this.$inputText();
|
33 |
-
|
34 |
-
// args
|
35 |
-
var args = {
|
36 |
-
dateFormat: this.get('date_format'),
|
37 |
-
altField: $input,
|
38 |
-
altFormat: 'yymmdd',
|
39 |
-
changeYear: true,
|
40 |
-
yearRange: "-100:+100",
|
41 |
-
changeMonth: true,
|
42 |
-
showButtonPanel: true,
|
43 |
-
firstDay: this.get('first_day')
|
44 |
-
};
|
45 |
-
|
46 |
-
// filter
|
47 |
-
args = acf.applyFilters('date_picker_args', args, this);
|
48 |
-
|
49 |
-
// add date picker
|
50 |
-
acf.newDatePicker( $inputText, args );
|
51 |
-
|
52 |
-
// action
|
53 |
-
acf.doAction('date_picker_init', $inputText, args, this);
|
54 |
-
|
55 |
-
},
|
56 |
-
|
57 |
-
initializeCompatibility: function(){
|
58 |
-
|
59 |
-
// vars
|
60 |
-
var $input = this.$input();
|
61 |
-
var $inputText = this.$inputText();
|
62 |
-
|
63 |
-
// get and set value from alt field
|
64 |
-
$inputText.val( $input.val() );
|
65 |
-
|
66 |
-
// args
|
67 |
-
var args = {
|
68 |
-
dateFormat: this.get('date_format'),
|
69 |
-
altField: $input,
|
70 |
-
altFormat: this.get('save_format'),
|
71 |
-
changeYear: true,
|
72 |
-
yearRange: "-100:+100",
|
73 |
-
changeMonth: true,
|
74 |
-
showButtonPanel: true,
|
75 |
-
firstDay: this.get('first_day')
|
76 |
-
};
|
77 |
-
|
78 |
-
// filter for 3rd party customization
|
79 |
-
args = acf.applyFilters('date_picker_args', args, this);
|
80 |
-
|
81 |
-
// backup
|
82 |
-
var dateFormat = args.dateFormat;
|
83 |
-
|
84 |
-
// change args.dateFormat
|
85 |
-
args.dateFormat = this.get('save_format');
|
86 |
-
|
87 |
-
// add date picker
|
88 |
-
acf.newDatePicker( $inputText, args );
|
89 |
-
|
90 |
-
// now change the format back to how it should be.
|
91 |
-
$inputText.datepicker( 'option', 'dateFormat', dateFormat );
|
92 |
-
|
93 |
-
// action for 3rd party customization
|
94 |
-
acf.doAction('date_picker_init', $inputText, args, this);
|
95 |
-
},
|
96 |
-
|
97 |
-
onBlur: function(){
|
98 |
-
if( !this.$inputText().val() ) {
|
99 |
-
acf.val( this.$input(), '' );
|
100 |
-
}
|
101 |
-
}
|
102 |
-
});
|
103 |
-
|
104 |
-
acf.registerFieldType( Field );
|
105 |
-
|
106 |
-
|
107 |
-
// manager
|
108 |
-
var datePickerManager = new acf.Model({
|
109 |
-
priority: 5,
|
110 |
-
wait: 'ready',
|
111 |
-
initialize: function(){
|
112 |
-
|
113 |
-
// vars
|
114 |
-
var locale = acf.get('locale');
|
115 |
-
var rtl = acf.get('rtl');
|
116 |
-
var l10n = acf.get('datePickerL10n');
|
117 |
-
|
118 |
-
// bail ealry if no l10n
|
119 |
-
if( !l10n ) {
|
120 |
-
return false;
|
121 |
-
}
|
122 |
-
|
123 |
-
// bail ealry if no datepicker library
|
124 |
-
if( typeof $.datepicker === 'undefined' ) {
|
125 |
-
return false;
|
126 |
-
}
|
127 |
-
|
128 |
-
// rtl
|
129 |
-
l10n.isRTL = rtl;
|
130 |
-
|
131 |
-
// append
|
132 |
-
$.datepicker.regional[ locale ] = l10n;
|
133 |
-
$.datepicker.setDefaults(l10n);
|
134 |
-
}
|
135 |
-
});
|
136 |
-
|
137 |
-
// add
|
138 |
-
acf.newDatePicker = function( $input, args ){
|
139 |
-
|
140 |
-
// bail ealry if no datepicker library
|
141 |
-
if( typeof $.datepicker === 'undefined' ) {
|
142 |
-
return false;
|
143 |
-
}
|
144 |
-
|
145 |
-
// defaults
|
146 |
-
args = args || {};
|
147 |
-
|
148 |
-
// initialize
|
149 |
-
$input.datepicker( args );
|
150 |
-
|
151 |
-
// wrap the datepicker (only if it hasn't already been wrapped)
|
152 |
-
if( $('body > #ui-datepicker-div').exists() ) {
|
153 |
-
$('body > #ui-datepicker-div').wrap('<div class="acf-ui-datepicker" />');
|
154 |
-
}
|
155 |
-
};
|
156 |
-
|
157 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/build/js/_acf-field-date-time-picker.js
DELETED
@@ -1,99 +0,0 @@
|
|
1 |
-
(function($, undefined){
|
2 |
-
|
3 |
-
var Field = acf.models.DatePickerField.extend({
|
4 |
-
|
5 |
-
type: 'date_time_picker',
|
6 |
-
|
7 |
-
$control: function(){
|
8 |
-
return this.$('.acf-date-time-picker');
|
9 |
-
},
|
10 |
-
|
11 |
-
initialize: function(){
|
12 |
-
|
13 |
-
// vars
|
14 |
-
var $input = this.$input();
|
15 |
-
var $inputText = this.$inputText();
|
16 |
-
|
17 |
-
// args
|
18 |
-
var args = {
|
19 |
-
dateFormat: this.get('date_format'),
|
20 |
-
timeFormat: this.get('time_format'),
|
21 |
-
altField: $input,
|
22 |
-
altFieldTimeOnly: false,
|
23 |
-
altFormat: 'yy-mm-dd',
|
24 |
-
altTimeFormat: 'HH:mm:ss',
|
25 |
-
changeYear: true,
|
26 |
-
yearRange: "-100:+100",
|
27 |
-
changeMonth: true,
|
28 |
-
showButtonPanel: true,
|
29 |
-
firstDay: this.get('first_day'),
|
30 |
-
controlType: 'select',
|
31 |
-
oneLine: true
|
32 |
-
};
|
33 |
-
|
34 |
-
// filter
|
35 |
-
args = acf.applyFilters('date_time_picker_args', args, this);
|
36 |
-
|
37 |
-
// add date time picker
|
38 |
-
acf.newDateTimePicker( $inputText, args );
|
39 |
-
|
40 |
-
// action
|
41 |
-
acf.doAction('date_time_picker_init', $inputText, args, this);
|
42 |
-
}
|
43 |
-
});
|
44 |
-
|
45 |
-
acf.registerFieldType( Field );
|
46 |
-
|
47 |
-
|
48 |
-
// manager
|
49 |
-
var dateTimePickerManager = new acf.Model({
|
50 |
-
priority: 5,
|
51 |
-
wait: 'ready',
|
52 |
-
initialize: function(){
|
53 |
-
|
54 |
-
// vars
|
55 |
-
var locale = acf.get('locale');
|
56 |
-
var rtl = acf.get('rtl');
|
57 |
-
var l10n = acf.get('dateTimePickerL10n');
|
58 |
-
|
59 |
-
// bail ealry if no l10n
|
60 |
-
if( !l10n ) {
|
61 |
-
return false;
|
62 |
-
}
|
63 |
-
|
64 |
-
// bail ealry if no datepicker library
|
65 |
-
if( typeof $.timepicker === 'undefined' ) {
|
66 |
-
return false;
|
67 |
-
}
|
68 |
-
|
69 |
-
// rtl
|
70 |
-
l10n.isRTL = rtl;
|
71 |
-
|
72 |
-
// append
|
73 |
-
$.timepicker.regional[ locale ] = l10n;
|
74 |
-
$.timepicker.setDefaults(l10n);
|
75 |
-
}
|
76 |
-
});
|
77 |
-
|
78 |
-
|
79 |
-
// add
|
80 |
-
acf.newDateTimePicker = function( $input, args ){
|
81 |
-
|
82 |
-
// bail ealry if no datepicker library
|
83 |
-
if( typeof $.timepicker === 'undefined' ) {
|
84 |
-
return false;
|
85 |
-
}
|
86 |
-
|
87 |
-
// defaults
|
88 |
-
args = args || {};
|
89 |
-
|
90 |
-
// initialize
|
91 |
-
$input.datetimepicker( args );
|
92 |
-
|
93 |
-
// wrap the datepicker (only if it hasn't already been wrapped)
|
94 |
-
if( $('body > #ui-datepicker-div').exists() ) {
|
95 |
-
$('body > #ui-datepicker-div').wrap('<div class="acf-ui-datepicker" />');
|
96 |
-
}
|
97 |
-
};
|
98 |
-
|
99 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/build/js/_acf-field-file.js
DELETED
@@ -1,120 +0,0 @@
|
|
1 |
-
(function($, undefined){
|
2 |
-
|
3 |
-
var Field = acf.models.ImageField.extend({
|
4 |
-
|
5 |
-
type: 'file',
|
6 |
-
|
7 |
-
$control: function(){
|
8 |
-
return this.$('.acf-file-uploader');
|
9 |
-
},
|
10 |
-
|
11 |
-
$input: function(){
|
12 |
-
return this.$('input[type="hidden"]');
|
13 |
-
},
|
14 |
-
|
15 |
-
validateAttachment: function( attachment ){
|
16 |
-
|
17 |
-
// defaults
|
18 |
-
attachment = attachment || {};
|
19 |
-
|
20 |
-
// WP attachment
|
21 |
-
if( attachment.id !== undefined ) {
|
22 |
-
attachment = attachment.attributes;
|
23 |
-
}
|
24 |
-
|
25 |
-
// args
|
26 |
-
attachment = acf.parseArgs(attachment, {
|
27 |
-
url: '',
|
28 |
-
alt: '',
|
29 |
-
title: '',
|
30 |
-
filename: '',
|
31 |
-
filesizeHumanReadable: '',
|
32 |
-
icon: '/wp-includes/images/media/default.png'
|
33 |
-
});
|
34 |
-
|
35 |
-
// return
|
36 |
-
return attachment;
|
37 |
-
},
|
38 |
-
|
39 |
-
render: function( attachment ){
|
40 |
-
|
41 |
-
// vars
|
42 |
-
attachment = this.validateAttachment( attachment );
|
43 |
-
|
44 |
-
// update image
|
45 |
-
this.$('img').attr({
|
46 |
-
src: attachment.icon,
|
47 |
-
alt: attachment.alt,
|
48 |
-
title: attachment.title
|
49 |
-
});
|
50 |
-
|
51 |
-
// update elements
|
52 |
-
this.$('[data-name="title"]').text( attachment.title );
|
53 |
-
this.$('[data-name="filename"]').text( attachment.filename ).attr( 'href', attachment.url );
|
54 |
-
this.$('[data-name="filesize"]').text( attachment.filesizeHumanReadable );
|
55 |
-
|
56 |
-
// vars
|
57 |
-
var val = attachment.id || '';
|
58 |
-
|
59 |
-
// update val
|
60 |
-
acf.val( this.$input(), val );
|
61 |
-
|
62 |
-
// update class
|
63 |
-
if( val ) {
|
64 |
-
this.$control().addClass('has-value');
|
65 |
-
} else {
|
66 |
-
this.$control().removeClass('has-value');
|
67 |
-
}
|
68 |
-
},
|
69 |
-
|
70 |
-
selectAttachment: function(){
|
71 |
-
|
72 |
-
// vars
|
73 |
-
var parent = this.parent();
|
74 |
-
var multiple = (parent && parent.get('type') === 'repeater');
|
75 |
-
|
76 |
-
// new frame
|
77 |
-
var frame = acf.newMediaPopup({
|
78 |
-
mode: 'select',
|
79 |
-
title: acf.__('Select File'),
|
80 |
-
field: this.get('key'),
|
81 |
-
multiple: multiple,
|
82 |
-
library: this.get('library'),
|
83 |
-
allowedTypes: this.get('mime_types'),
|
84 |
-
select: $.proxy(function( attachment, i ) {
|
85 |
-
if( i > 0 ) {
|
86 |
-
this.append( attachment, parent );
|
87 |
-
} else {
|
88 |
-
this.render( attachment );
|
89 |
-
}
|
90 |
-
}, this)
|
91 |
-
});
|
92 |
-
},
|
93 |
-
|
94 |
-
editAttachment: function(){
|
95 |
-
|
96 |
-
// vars
|
97 |
-
var val = this.val();
|
98 |
-
|
99 |
-
// bail early if no val
|
100 |
-
if( !val ) {
|
101 |
-
return false;
|
102 |
-
}
|
103 |
-
|
104 |
-
// popup
|
105 |
-
var frame = acf.newMediaPopup({
|
106 |
-
mode: 'edit',
|
107 |
-
title: acf.__('Edit File'),
|
108 |
-
button: acf.__('Update File'),
|
109 |
-
attachment: val,
|
110 |
-
field: this.get('key'),
|
111 |
-
select: $.proxy(function( attachment, i ) {
|
112 |
-
this.render( attachment );
|
113 |
-
}, this)
|
114 |
-
});
|
115 |
-
}
|
116 |
-
});
|
117 |
-
|
118 |
-
acf.registerFieldType( Field );
|
119 |
-
|
120 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/build/js/_acf-field-google-map.js
DELETED
@@ -1,553 +0,0 @@
|
|
1 |
-
(function($, undefined){
|
2 |
-
|
3 |
-
var Field = acf.Field.extend({
|
4 |
-
|
5 |
-
type: 'google_map',
|
6 |
-
|
7 |
-
map: false,
|
8 |
-
|
9 |
-
wait: 'load',
|
10 |
-
|
11 |
-
events: {
|
12 |
-
'click a[data-name="clear"]': 'onClickClear',
|
13 |
-
'click a[data-name="locate"]': 'onClickLocate',
|
14 |
-
'click a[data-name="search"]': 'onClickSearch',
|
15 |
-
'keydown .search': 'onKeydownSearch',
|
16 |
-
'keyup .search': 'onKeyupSearch',
|
17 |
-
'focus .search': 'onFocusSearch',
|
18 |
-
'blur .search': 'onBlurSearch',
|
19 |
-
'showField': 'onShow'
|
20 |
-
},
|
21 |
-
|
22 |
-
$control: function(){
|
23 |
-
return this.$('.acf-google-map');
|
24 |
-
},
|
25 |
-
|
26 |
-
$input: function( name ){
|
27 |
-
return this.$('input[data-name="' + (name || 'address') + '"]');
|
28 |
-
},
|
29 |
-
|
30 |
-
$search: function(){
|
31 |
-
return this.$('.search');
|
32 |
-
},
|
33 |
-
|
34 |
-
$canvas: function(){
|
35 |
-
return this.$('.canvas');
|
36 |
-
},
|
37 |
-
|
38 |
-
addClass: function( name ){
|
39 |
-
this.$control().addClass( name );
|
40 |
-
},
|
41 |
-
|
42 |
-
removeClass: function( name ){
|
43 |
-
this.$control().removeClass( name );
|
44 |
-
},
|
45 |
-
|
46 |
-
getValue: function(){
|
47 |
-
|
48 |
-
// defaults
|
49 |
-
var val = {
|
50 |
-
lat: '',
|
51 |
-
lng: '',
|
52 |
-
address: ''
|
53 |
-
};
|
54 |
-
|
55 |
-
// loop
|
56 |
-
this.$('input[type="hidden"]').each(function(){
|
57 |
-
val[ $(this).data('name') ] = $(this).val();
|
58 |
-
});
|
59 |
-
|
60 |
-
// return false if no lat/lng
|
61 |
-
if( !val.lat || !val.lng ) {
|
62 |
-
val = false;
|
63 |
-
}
|
64 |
-
|
65 |
-
// return
|
66 |
-
return val;
|
67 |
-
},
|
68 |
-
|
69 |
-
setValue: function( val ){
|
70 |
-
|
71 |
-
// defaults
|
72 |
-
val = acf.parseArgs(val, {
|
73 |
-
lat: '',
|
74 |
-
lng: '',
|
75 |
-
address: ''
|
76 |
-
});
|
77 |
-
|
78 |
-
// loop
|
79 |
-
for( var name in val ) {
|
80 |
-
acf.val( this.$input(name), val[name] );
|
81 |
-
}
|
82 |
-
|
83 |
-
// return false if no lat/lng
|
84 |
-
if( !val.lat || !val.lng ) {
|
85 |
-
val = false;
|
86 |
-
}
|
87 |
-
|
88 |
-
// render
|
89 |
-
this.renderVal( val );
|
90 |
-
|
91 |
-
// action
|
92 |
-
var latLng = this.newLatLng( val.lat, val.lng );
|
93 |
-
acf.doAction('google_map_change', latLng, this.map, this);
|
94 |
-
},
|
95 |
-
|
96 |
-
renderVal: function( val ){
|
97 |
-
|
98 |
-
// has value
|
99 |
-
if( val ) {
|
100 |
-
this.addClass('-value');
|
101 |
-
this.setPosition( val.lat, val.lng );
|
102 |
-
this.map.marker.setVisible( true );
|
103 |
-
|
104 |
-
// no value
|
105 |
-
} else {
|
106 |
-
this.removeClass('-value');
|
107 |
-
this.map.marker.setVisible( false );
|
108 |
-
}
|
109 |
-
|
110 |
-
// search
|
111 |
-
this.$search().val( val.address );
|
112 |
-
},
|
113 |
-
|
114 |
-
setPosition: function( lat, lng ){
|
115 |
-
|
116 |
-
// vars
|
117 |
-
var latLng = this.newLatLng( lat, lng );
|
118 |
-
|
119 |
-
// update marker
|
120 |
-
this.map.marker.setPosition( latLng );
|
121 |
-
|
122 |
-
// show marker
|
123 |
-
this.map.marker.setVisible( true );
|
124 |
-
|
125 |
-
// center
|
126 |
-
this.center();
|
127 |
-
|
128 |
-
// return
|
129 |
-
return this;
|
130 |
-
},
|
131 |
-
|
132 |
-
center: function(){
|
133 |
-
|
134 |
-
// vars
|
135 |
-
var position = this.map.marker.getPosition();
|
136 |
-
var lat = this.get('lat');
|
137 |
-
var lng = this.get('lng');
|
138 |
-
|
139 |
-
// if marker exists, center on the marker
|
140 |
-
if( position ) {
|
141 |
-
lat = position.lat();
|
142 |
-
lng = position.lng();
|
143 |
-
}
|
144 |
-
|
145 |
-
// latlng
|
146 |
-
var latLng = this.newLatLng( lat, lng );
|
147 |
-
|
148 |
-
// set center of map
|
149 |
-
this.map.setCenter( latLng );
|
150 |
-
},
|
151 |
-
|
152 |
-
getSearchVal: function(){
|
153 |
-
return this.$search().val();
|
154 |
-
},
|
155 |
-
|
156 |
-
initialize: function(){
|
157 |
-
|
158 |
-
// Ensure Google API is loaded and then initialize map.
|
159 |
-
withAPI( this.initializeMap.bind(this) );
|
160 |
-
},
|
161 |
-
|
162 |
-
newLatLng: function( lat, lng ){
|
163 |
-
return new google.maps.LatLng( parseFloat(lat), parseFloat(lng) );
|
164 |
-
},
|
165 |
-
|
166 |
-
initializeMap: function(){
|
167 |
-
|
168 |
-
// vars
|
169 |
-
var zoom = this.get('zoom');
|
170 |
-
var lat = this.get('lat');
|
171 |
-
var lng = this.get('lng');
|
172 |
-
|
173 |
-
// Create Map.
|
174 |
-
var mapArgs = {
|
175 |
-
scrollwheel: false,
|
176 |
-
zoom: parseInt( zoom ),
|
177 |
-
center: this.newLatLng(lat, lng),
|
178 |
-
mapTypeId: google.maps.MapTypeId.ROADMAP,
|
179 |
-
marker: {
|
180 |
-
draggable: true,
|
181 |
-
raiseOnDrag: true
|
182 |
-
},
|
183 |
-
autocomplete: {}
|
184 |
-
};
|
185 |
-
mapArgs = acf.applyFilters('google_map_args', mapArgs, this);
|
186 |
-
var map = new google.maps.Map( this.$canvas()[0], mapArgs );
|
187 |
-
|
188 |
-
// Create Marker.
|
189 |
-
var markerArgs = acf.parseArgs(mapArgs.marker, {
|
190 |
-
draggable: true,
|
191 |
-
raiseOnDrag: true,
|
192 |
-
map: map
|
193 |
-
});
|
194 |
-
markerArgs = acf.applyFilters('google_map_marker_args', markerArgs, this);
|
195 |
-
var marker = new google.maps.Marker( markerArgs );
|
196 |
-
|
197 |
-
// Maybe Create Autocomplete.
|
198 |
-
var autocomplete = false;
|
199 |
-
if( acf.isset(google, 'maps', 'places', 'Autocomplete') ) {
|
200 |
-
var autocompleteArgs = mapArgs.autocomplete || {};
|
201 |
-
autocompleteArgs = acf.applyFilters('google_map_autocomplete_args', autocompleteArgs, this);
|
202 |
-
autocomplete = new google.maps.places.Autocomplete( this.$search()[0], autocompleteArgs );
|
203 |
-
autocomplete.bindTo('bounds', map);
|
204 |
-
}
|
205 |
-
|
206 |
-
// Add map events.
|
207 |
-
this.addMapEvents( this, map, marker, autocomplete );
|
208 |
-
|
209 |
-
// Append references.
|
210 |
-
map.acf = this;
|
211 |
-
map.marker = marker;
|
212 |
-
map.autocomplete = autocomplete;
|
213 |
-
this.map = map;
|
214 |
-
|
215 |
-
// action for 3rd party customization
|
216 |
-
acf.doAction('google_map_init', map, marker, this);
|
217 |
-
|
218 |
-
// set position
|
219 |
-
var val = this.getValue();
|
220 |
-
this.renderVal( val );
|
221 |
-
},
|
222 |
-
|
223 |
-
addMapEvents: function( field, map, marker, autocomplete ){
|
224 |
-
|
225 |
-
// Click map.
|
226 |
-
google.maps.event.addListener( map, 'click', function( e ) {
|
227 |
-
|
228 |
-
// vars
|
229 |
-
var lat = e.latLng.lat();
|
230 |
-
var lng = e.latLng.lng();
|
231 |
-
|
232 |
-
// search
|
233 |
-
field.searchPosition( lat, lng );
|
234 |
-
});
|
235 |
-
|
236 |
-
// Drag marker.
|
237 |
-
google.maps.event.addListener( marker, 'dragend', function(){
|
238 |
-
|
239 |
-
// vars
|
240 |
-
var position = this.getPosition();
|
241 |
-
var lat = position.lat();
|
242 |
-
var lng = position.lng();
|
243 |
-
|
244 |
-
// search
|
245 |
-
field.searchPosition( lat, lng );
|
246 |
-
});
|
247 |
-
|
248 |
-
// Autocomplete search.
|
249 |
-
if( autocomplete ) {
|
250 |
-
|
251 |
-
// autocomplete event place_changed is triggered each time the input changes
|
252 |
-
// customize the place object with the current "search value" to allow users controll over the address text
|
253 |
-
google.maps.event.addListener(autocomplete, 'place_changed', function() {
|
254 |
-
var place = this.getPlace();
|
255 |
-
place.address = field.getSearchVal();
|
256 |
-
field.setPlace( place );
|
257 |
-
});
|
258 |
-
}
|
259 |
-
},
|
260 |
-
|
261 |
-
searchPosition: function( lat, lng ){
|
262 |
-
|
263 |
-
// vars
|
264 |
-
var latLng = this.newLatLng( lat, lng );
|
265 |
-
var $wrap = this.$control();
|
266 |
-
|
267 |
-
// set position
|
268 |
-
this.setPosition( lat, lng );
|
269 |
-
|
270 |
-
// add class
|
271 |
-
$wrap.addClass('-loading');
|
272 |
-
|
273 |
-
// callback
|
274 |
-
var callback = $.proxy(function( results, status ){
|
275 |
-
|
276 |
-
// remove class
|
277 |
-
$wrap.removeClass('-loading');
|
278 |
-
|
279 |
-
// vars
|
280 |
-
var address = '';
|
281 |
-
|
282 |
-
// validate
|
283 |
-
if( status != google.maps.GeocoderStatus.OK ) {
|
284 |
-
console.log('Geocoder failed due to: ' + status);
|
285 |
-
} else if( !results[0] ) {
|
286 |
-
console.log('No results found');
|
287 |
-
} else {
|
288 |
-
address = results[0].formatted_address;
|
289 |
-
}
|
290 |
-
|
291 |
-
// update val
|
292 |
-
this.val({
|
293 |
-
lat: lat,
|
294 |
-
lng: lng,
|
295 |
-
address: address
|
296 |
-
});
|
297 |
-
|
298 |
-
}, this);
|
299 |
-
|
300 |
-
// query
|
301 |
-
geocoder.geocode({ 'latLng' : latLng }, callback);
|
302 |
-
},
|
303 |
-
|
304 |
-
setPlace: function( place ){
|
305 |
-
|
306 |
-
// bail if no place
|
307 |
-
if( !place ) return this;
|
308 |
-
|
309 |
-
// search name if no geometry
|
310 |
-
// - possible when hitting enter in search address
|
311 |
-
if( place.name && !place.geometry ) {
|
312 |
-
this.searchAddress(place.name);
|
313 |
-
return this;
|
314 |
-
}
|
315 |
-
|
316 |
-
// vars
|
317 |
-
var lat = place.geometry.location.lat();
|
318 |
-
var lng = place.geometry.location.lng();
|
319 |
-
var address = place.address || place.formatted_address;
|
320 |
-
|
321 |
-
// update
|
322 |
-
this.setValue({
|
323 |
-
lat: lat,
|
324 |
-
lng: lng,
|
325 |
-
address: address
|
326 |
-
});
|
327 |
-
|
328 |
-
// return
|
329 |
-
return this;
|
330 |
-
},
|
331 |
-
|
332 |
-
searchAddress: function( address ){
|
333 |
-
|
334 |
-
// is address latLng?
|
335 |
-
var latLng = address.split(',');
|
336 |
-
if( latLng.length == 2 ) {
|
337 |
-
|
338 |
-
// vars
|
339 |
-
var lat = latLng[0];
|
340 |
-
var lng = latLng[1];
|
341 |
-
|
342 |
-
// check
|
343 |
-
if( $.isNumeric(lat) && $.isNumeric(lng) ) {
|
344 |
-
return this.searchPosition( lat, lng );
|
345 |
-
}
|
346 |
-
}
|
347 |
-
|
348 |
-
// vars
|
349 |
-
var $wrap = this.$control();
|
350 |
-
|
351 |
-
// add class
|
352 |
-
$wrap.addClass('-loading');
|
353 |
-
|
354 |
-
// callback
|
355 |
-
var callback = this.proxy(function( results, status ){
|
356 |
-
|
357 |
-
// remove class
|
358 |
-
$wrap.removeClass('-loading');
|
359 |
-
|
360 |
-
// vars
|
361 |
-
var lat = '';
|
362 |
-
var lng = '';
|
363 |
-
|
364 |
-
// validate
|
365 |
-
if( status != google.maps.GeocoderStatus.OK ) {
|
366 |
-
console.log('Geocoder failed due to: ' + status);
|
367 |
-
} else if( !results[0] ) {
|
368 |
-
console.log('No results found');
|
369 |
-
} else {
|
370 |
-
lat = results[0].geometry.location.lat();
|
371 |
-
lng = results[0].geometry.location.lng();
|
372 |
-
//address = results[0].formatted_address;
|
373 |
-
}
|
374 |
-
|
375 |
-
// update val
|
376 |
-
this.val({
|
377 |
-
lat: lat,
|
378 |
-
lng: lng,
|
379 |
-
address: address
|
380 |
-
});
|
381 |
-
|
382 |
-
//acf.doAction('google_map_geocode_results', results, status, this.$el, this);
|
383 |
-
|
384 |
-
});
|
385 |
-
|
386 |
-
// query
|
387 |
-
geocoder.geocode({ 'address' : address }, callback);
|
388 |
-
},
|
389 |
-
|
390 |
-
searchLocation: function(){
|
391 |
-
|
392 |
-
// Try HTML5 geolocation
|
393 |
-
if( !navigator.geolocation ) {
|
394 |
-
return alert( acf.__('Sorry, this browser does not support geolocation') );
|
395 |
-
}
|
396 |
-
|
397 |
-
// vars
|
398 |
-
var $wrap = this.$control();
|
399 |
-
|
400 |
-
// add class
|
401 |
-
$wrap.addClass('-loading');
|
402 |
-
|
403 |
-
// callback
|
404 |
-
var onSuccess = $.proxy(function( results, status ){
|
405 |
-
|
406 |
-
// remove class
|
407 |
-
$wrap.removeClass('-loading');
|
408 |
-
|
409 |
-
// vars
|
410 |
-
var lat = results.coords.latitude;
|
411 |
-
var lng = results.coords.longitude;
|
412 |
-
|
413 |
-
// search;
|
414 |
-
this.searchPosition( lat, lng );
|
415 |
-
|
416 |
-
}, this);
|
417 |
-
|
418 |
-
var onFailure = function( error ){
|
419 |
-
$wrap.removeClass('-loading');
|
420 |
-
}
|
421 |
-
|
422 |
-
// try query
|
423 |
-
navigator.geolocation.getCurrentPosition( onSuccess, onFailure );
|
424 |
-
},
|
425 |
-
|
426 |
-
onClickClear: function( e, $el ){
|
427 |
-
this.val( false );
|
428 |
-
},
|
429 |
-
|
430 |
-
onClickLocate: function( e, $el ){
|
431 |
-
this.searchLocation();
|
432 |
-
},
|
433 |
-
|
434 |
-
onClickSearch: function( e, $el ){
|
435 |
-
this.searchAddress( this.$search().val() );
|
436 |
-
},
|
437 |
-
|
438 |
-
onFocusSearch: function( e, $el ){
|
439 |
-
this.removeClass('-value');
|
440 |
-
this.onKeyupSearch.apply(this, arguments);
|
441 |
-
},
|
442 |
-
|
443 |
-
onBlurSearch: function( e, $el ){
|
444 |
-
|
445 |
-
// timeout to allow onClickLocate event
|
446 |
-
this.setTimeout(function(){
|
447 |
-
this.removeClass('-search');
|
448 |
-
if( $el.val() ) {
|
449 |
-
this.addClass('-value');
|
450 |
-
}
|
451 |
-
}, 100);
|
452 |
-
},
|
453 |
-
|
454 |
-
onKeyupSearch: function( e, $el ){
|
455 |
-
if( $el.val() ) {
|
456 |
-
this.addClass('-search');
|
457 |
-
} else {
|
458 |
-
this.removeClass('-search');
|
459 |
-
}
|
460 |
-
},
|
461 |
-
|
462 |
-
onKeydownSearch: function( e, $el ){
|
463 |
-
|
464 |
-
// prevent form from submitting
|
465 |
-
if( e.which == 13 ) {
|
466 |
-
e.preventDefault();
|
467 |
-
}
|
468 |
-
},
|
469 |
-
|
470 |
-
onMousedown: function(){
|
471 |
-
|
472 |
-
/*
|
473 |
-
// clear timeout in 1ms (onMousedown will run before onBlurSearch)
|
474 |
-
this.setTimeout(function(){
|
475 |
-
clearTimeout( this.get('timeout') );
|
476 |
-
}, 1);
|
477 |
-
*/
|
478 |
-
},
|
479 |
-
|
480 |
-
onShow: function(){
|
481 |
-
|
482 |
-
// bail early if no map
|
483 |
-
// - possible if JS API was not loaded
|
484 |
-
if( !this.map ) {
|
485 |
-
return false;
|
486 |
-
}
|
487 |
-
|
488 |
-
// center map when it is shown (by a tab / collapsed row)
|
489 |
-
// - use delay to avoid rendering issues with browsers (ensures div is visible)
|
490 |
-
this.setTimeout( this.center, 10 );
|
491 |
-
}
|
492 |
-
});
|
493 |
-
|
494 |
-
acf.registerFieldType( Field );
|
495 |
-
|
496 |
-
// Vars.
|
497 |
-
var loading = false;
|
498 |
-
var geocoder = false;
|
499 |
-
|
500 |
-
/**
|
501 |
-
* withAPI
|
502 |
-
*
|
503 |
-
* Loads the Google Maps API library and troggers callback.
|
504 |
-
*
|
505 |
-
* @date 28/3/19
|
506 |
-
* @since 5.7.14
|
507 |
-
*
|
508 |
-
* @param function callback The callback to excecute.
|
509 |
-
* @return void
|
510 |
-
*/
|
511 |
-
|
512 |
-
function withAPI( callback ) {
|
513 |
-
|
514 |
-
// Check if geocoder exists.
|
515 |
-
if( geocoder ) {
|
516 |
-
return callback();
|
517 |
-
}
|
518 |
-
|
519 |
-
// Check if geocoder API exists.
|
520 |
-
if( acf.isset(window, 'google', 'maps', 'Geocoder') ) {
|
521 |
-
geocoder = new google.maps.Geocoder();
|
522 |
-
return callback();
|
523 |
-
}
|
524 |
-
|
525 |
-
// Geocoder will need to be loaded. Hook callback to action.
|
526 |
-
acf.addAction( 'google_map_api_loaded', callback );
|
527 |
-
|
528 |
-
// Bail early if already loading API.
|
529 |
-
if( loading ) {
|
530 |
-
return;
|
531 |
-
}
|
532 |
-
|
533 |
-
// load api
|
534 |
-
var url = acf.get('google_map_api');
|
535 |
-
if( url ) {
|
536 |
-
|
537 |
-
// Set loading status.
|
538 |
-
loading = true;
|
539 |
-
|
540 |
-
// Load API
|
541 |
-
$.ajax({
|
542 |
-
url: url,
|
543 |
-
dataType: 'script',
|
544 |
-
cache: true,
|
545 |
-
success: function(){
|
546 |
-
geocoder = new google.maps.Geocoder();
|
547 |
-
acf.doAction('google_map_api_loaded');
|
548 |
-
}
|
549 |
-
});
|
550 |
-
}
|
551 |
-
}
|
552 |
-
|
553 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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uploader');
|
9 |
-
},
|
10 |
-
|
11 |
-
$input: function(){
|
12 |
-
return this.$('input[type="hidden"]');
|
13 |
-
},
|
14 |
-
|
15 |
-
events: {
|
16 |
-
'click a[data-name="add"]': 'onClickAdd',
|
17 |
-
'click a[data-name="edit"]': 'onClickEdit',
|
18 |
-
'click a[data-name="remove"]': 'onClickRemove',
|
19 |
-
'change input[type="file"]': 'onChange'
|
20 |
-
},
|
21 |
-
|
22 |
-
initialize: function(){
|
23 |
-
|
24 |
-
// add attribute to form
|
25 |
-
if( this.get('uploader') === 'basic' ) {
|
26 |
-
this.$el.closest('form').attr('enctype', 'multipart/form-data');
|
27 |
-
}
|
28 |
-
},
|
29 |
-
|
30 |
-
validateAttachment: function( attachment ){
|
31 |
-
|
32 |
-
// defaults
|
33 |
-
attachment = attachment || {};
|
34 |
-
|
35 |
-
// WP attachment
|
36 |
-
if( attachment.id !== undefined ) {
|
37 |
-
attachment = attachment.attributes;
|
38 |
-
}
|
39 |
-
|
40 |
-
// args
|
41 |
-
attachment = acf.parseArgs(attachment, {
|
42 |
-
url: '',
|
43 |
-
alt: '',
|
44 |
-
title: '',
|
45 |
-
caption: '',
|
46 |
-
description: '',
|
47 |
-
width: 0,
|
48 |
-
height: 0
|
49 |
-
});
|
50 |
-
|
51 |
-
// preview size
|
52 |
-
var url = acf.isget(attachment, 'sizes', this.get('preview_size'), 'url');
|
53 |
-
if( url !== null ) {
|
54 |
-
attachment.url = url;
|
55 |
-
}
|
56 |
-
|
57 |
-
// return
|
58 |
-
return attachment;
|
59 |
-
},
|
60 |
-
|
61 |
-
render: function( attachment ){
|
62 |
-
|
63 |
-
// vars
|
64 |
-
attachment = this.validateAttachment( attachment );
|
65 |
-
|
66 |
-
// update image
|
67 |
-
this.$('img').attr({
|
68 |
-
src: attachment.url,
|
69 |
-
alt: attachment.alt,
|
70 |
-
title: attachment.title
|
71 |
-
});
|
72 |
-
|
73 |
-
// vars
|
74 |
-
var val = attachment.id || '';
|
75 |
-
|
76 |
-
// update val
|
77 |
-
this.val( val );
|
78 |
-
|
79 |
-
// update class
|
80 |
-
if( val ) {
|
81 |
-
this.$control().addClass('has-value');
|
82 |
-
} else {
|
83 |
-
this.$control().removeClass('has-value');
|
84 |
-
}
|
85 |
-
},
|
86 |
-
|
87 |
-
// create a new repeater row and render value
|
88 |
-
append: function( attachment, parent ){
|
89 |
-
|
90 |
-
// create function to find next available field within parent
|
91 |
-
var getNext = function( field, parent ){
|
92 |
-
|
93 |
-
// find existing file fields within parent
|
94 |
-
var fields = acf.getFields({
|
95 |
-
key: field.get('key'),
|
96 |
-
parent: parent.$el
|
97 |
-
});
|
98 |
-
|
99 |
-
// find the first field with no value
|
100 |
-
for( var i = 0; i < fields.length; i++ ) {
|
101 |
-
if( !fields[i].val() ) {
|
102 |
-
return fields[i];
|
103 |
-
}
|
104 |
-
}
|
105 |
-
|
106 |
-
// return
|
107 |
-
return false;
|
108 |
-
}
|
109 |
-
|
110 |
-
// find existing file fields within parent
|
111 |
-
var field = getNext( this, parent );
|
112 |
-
|
113 |
-
// add new row if no available field
|
114 |
-
if( !field ) {
|
115 |
-
parent.$('.acf-button:last').trigger('click');
|
116 |
-
field = getNext( this, parent );
|
117 |
-
}
|
118 |
-
|
119 |
-
// render
|
120 |
-
if( field ) {
|
121 |
-
field.render( attachment );
|
122 |
-
}
|
123 |
-
},
|
124 |
-
|
125 |
-
selectAttachment: function(){
|
126 |
-
|
127 |
-
// vars
|
128 |
-
var parent = this.parent();
|
129 |
-
var multiple = (parent && parent.get('type') === 'repeater');
|
130 |
-
|
131 |
-
// new frame
|
132 |
-
var frame = acf.newMediaPopup({
|
133 |
-
mode: 'select',
|
134 |
-
type: 'image',
|
135 |
-
title: acf.__('Select Image'),
|
136 |
-
field: this.get('key'),
|
137 |
-
multiple: multiple,
|
138 |
-
library: this.get('library'),
|
139 |
-
allowedTypes: this.get('mime_types'),
|
140 |
-
select: $.proxy(function( attachment, i ) {
|
141 |
-
if( i > 0 ) {
|
142 |
-
this.append( attachment, parent );
|
143 |
-
} else {
|
144 |
-
this.render( attachment );
|
145 |
-
}
|
146 |
-
}, this)
|
147 |
-
});
|
148 |
-
},
|
149 |
-
|
150 |
-
editAttachment: function(){
|
151 |
-
|
152 |
-
// vars
|
153 |
-
var val = this.val();
|
154 |
-
|
155 |
-
// bail early if no val
|
156 |
-
if( !val ) return;
|
157 |
-
|
158 |
-
// popup
|
159 |
-
var frame = acf.newMediaPopup({
|
160 |
-
mode: 'edit',
|
161 |
-
title: acf.__('Edit Image'),
|
162 |
-
button: acf.__('Update Image'),
|
163 |
-
attachment: val,
|
164 |
-
field: this.get('key'),
|
165 |
-
select: $.proxy(function( attachment, i ) {
|
166 |
-
this.render( attachment );
|
167 |
-
}, this)
|
168 |
-
});
|
169 |
-
},
|
170 |
-
|
171 |
-
removeAttachment: function(){
|
172 |
-
this.render( false );
|
173 |
-
},
|
174 |
-
|
175 |
-
onClickAdd: function( e, $el ){
|
176 |
-
this.selectAttachment();
|
177 |
-
},
|
178 |
-
|
179 |
-
onClickEdit: function( e, $el ){
|
180 |
-
this.editAttachment();
|
181 |
-
},
|
182 |
-
|
183 |
-
onClickRemove: function( e, $el ){
|
184 |
-
this.removeAttachment();
|
185 |
-
},
|
186 |
-
|
187 |
-
onChange: function( e, $el ){
|
188 |
-
var $hiddenInput = this.$input();
|
189 |
-
|
190 |
-
acf.getFileInputData($el, function( data ){
|
191 |
-
$hiddenInput.val( $.param(data) );
|
192 |
-
});
|
193 |
-
}
|
194 |
-
});
|
195 |
-
|
196 |
-
acf.registerFieldType( Field );
|
197 |
-
|
198 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/build/js/_acf-field-link.js
DELETED
@@ -1,191 +0,0 @@
|
|
1 |
-
(function($, undefined){
|
2 |
-
|
3 |
-
var Field = acf.Field.extend({
|
4 |
-
|
5 |
-
type: 'link',
|
6 |
-
|
7 |
-
events: {
|
8 |
-
'click a[data-name="add"]': 'onClickEdit',
|
9 |
-
'click a[data-name="edit"]': 'onClickEdit',
|
10 |
-
'click a[data-name="remove"]': 'onClickRemove',
|
11 |
-
'change .link-node': 'onChange',
|
12 |
-
},
|
13 |
-
|
14 |
-
$control: function(){
|
15 |
-
return this.$('.acf-link');
|
16 |
-
},
|
17 |
-
|
18 |
-
$node: function(){
|
19 |
-
return this.$('.link-node');
|
20 |
-
},
|
21 |
-
|
22 |
-
getValue: function(){
|
23 |
-
|
24 |
-
// vars
|
25 |
-
var $node = this.$node();
|
26 |
-
|
27 |
-
// return false if empty
|
28 |
-
if( !$node.attr('href') ) {
|
29 |
-
return false;
|
30 |
-
}
|
31 |
-
|
32 |
-
// return
|
33 |
-
return {
|
34 |
-
title: $node.html(),
|
35 |
-
url: $node.attr('href'),
|
36 |
-
target: $node.attr('target')
|
37 |
-
};
|
38 |
-
},
|
39 |
-
|
40 |
-
setValue: function( val ){
|
41 |
-
|
42 |
-
// default
|
43 |
-
val = acf.parseArgs(val, {
|
44 |
-
title: '',
|
45 |
-
url: '',
|
46 |
-
target: ''
|
47 |
-
});
|
48 |
-
|
49 |
-
// vars
|
50 |
-
var $div = this.$control();
|
51 |
-
var $node = this.$node();
|
52 |
-
|
53 |
-
// remove class
|
54 |
-
$div.removeClass('-value -external');
|
55 |
-
|
56 |
-
// add class
|
57 |
-
if( val.url ) $div.addClass('-value');
|
58 |
-
if( val.target === '_blank' ) $div.addClass('-external');
|
59 |
-
|
60 |
-
// update text
|
61 |
-
this.$('.link-title').html( val.title );
|
62 |
-
this.$('.link-url').attr('href', val.url).html( val.url );
|
63 |
-
|
64 |
-
// update node
|
65 |
-
$node.html(val.title);
|
66 |
-
$node.attr('href', val.url);
|
67 |
-
$node.attr('target', val.target);
|
68 |
-
|
69 |
-
// update inputs
|
70 |
-
this.$('.input-title').val( val.title );
|
71 |
-
this.$('.input-target').val( val.target );
|
72 |
-
this.$('.input-url').val( val.url ).trigger('change');
|
73 |
-
},
|
74 |
-
|
75 |
-
onClickEdit: function( e, $el ){
|
76 |
-
acf.wpLink.open( this.$node() );
|
77 |
-
},
|
78 |
-
|
79 |
-
onClickRemove: function( e, $el ){
|
80 |
-
this.setValue( false );
|
81 |
-
},
|
82 |
-
|
83 |
-
onChange: function( e, $el ){
|
84 |
-
|
85 |
-
// get the changed value
|
86 |
-
var val = this.getValue();
|
87 |
-
|
88 |
-
// update inputs
|
89 |
-
this.setValue(val);
|
90 |
-
}
|
91 |
-
|
92 |
-
});
|
93 |
-
|
94 |
-
acf.registerFieldType( Field );
|
95 |
-
|
96 |
-
|
97 |
-
// manager
|
98 |
-
acf.wpLink = new acf.Model({
|
99 |
-
|
100 |
-
getNodeValue: function(){
|
101 |
-
var $node = this.get('node');
|
102 |
-
return {
|
103 |
-
title: $node.html(),
|
104 |
-
url: $node.attr('href'),
|
105 |
-
target: $node.attr('target')
|
106 |
-
};
|
107 |
-
},
|
108 |
-
|
109 |
-
setNodeValue: function( val ){
|
110 |
-
var $node = this.get('node');
|
111 |
-
$node.html( val.title );
|
112 |
-
$node.attr('href', val.url);
|
113 |
-
$node.attr('target', val.target);
|
114 |
-
$node.trigger('change');
|
115 |
-
},
|
116 |
-
|
117 |
-
getInputValue: function(){
|
118 |
-
return {
|
119 |
-
title: $('#wp-link-text').val(),
|
120 |
-
url: $('#wp-link-url').val(),
|
121 |
-
target: $('#wp-link-target').prop('checked') ? '_blank' : ''
|
122 |
-
};
|
123 |
-
},
|
124 |
-
|
125 |
-
setInputValue: function( val ){
|
126 |
-
$('#wp-link-text').val( val.title );
|
127 |
-
$('#wp-link-url').val( val.url );
|
128 |
-
$('#wp-link-target').prop('checked', val.target === '_blank' );
|
129 |
-
},
|
130 |
-
|
131 |
-
open: function( $node ){
|
132 |
-
|
133 |
-
// add events
|
134 |
-
this.on('wplink-open', 'onOpen');
|
135 |
-
this.on('wplink-close', 'onClose');
|
136 |
-
|
137 |
-
// set node
|
138 |
-
this.set('node', $node);
|
139 |
-
|
140 |
-
// create textarea
|
141 |
-
var $textarea = $('<textarea id="acf-link-textarea" style="display:none;"></textarea>');
|
142 |
-
$('body').append( $textarea );
|
143 |
-
|
144 |
-
// vars
|
145 |
-
var val = this.getNodeValue();
|
146 |
-
|
147 |
-
// open popup
|
148 |
-
wpLink.open( 'acf-link-textarea', val.url, val.title, null );
|
149 |
-
|
150 |
-
},
|
151 |
-
|
152 |
-
onOpen: function(){
|
153 |
-
|
154 |
-
// always show title (WP will hide title if empty)
|
155 |
-
$('#wp-link-wrap').addClass('has-text-field');
|
156 |
-
|
157 |
-
// set inputs
|
158 |
-
var val = this.getNodeValue();
|
159 |
-
this.setInputValue( val );
|
160 |
-
},
|
161 |
-
|
162 |
-
close: function(){
|
163 |
-
wpLink.close();
|
164 |
-
},
|
165 |
-
|
166 |
-
onClose: function(){
|
167 |
-
|
168 |
-
// bail early if no node
|
169 |
-
// needed due to WP triggering this event twice
|
170 |
-
if( !this.has('node') ) {
|
171 |
-
return false;
|
172 |
-
}
|
173 |
-
|
174 |
-
// remove events
|
175 |
-
this.off('wplink-open');
|
176 |
-
this.off('wplink-close');
|
177 |
-
|
178 |
-
// set value
|
179 |
-
var val = this.getInputValue();
|
180 |
-
this.setNodeValue( val );
|
181 |
-
|
182 |
-
// remove textarea
|
183 |
-
$('#acf-link-textarea').remove();
|
184 |
-
|
185 |
-
// reset
|
186 |
-
this.set('node', null);
|
187 |
-
|
188 |
-
}
|
189 |
-
});
|
190 |
-
|
191 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/build/js/_acf-field-oembed.js
DELETED
@@ -1,163 +0,0 @@
|
|
1 |
-
(function($, undefined){
|
2 |
-
|
3 |
-
var Field = acf.Field.extend({
|
4 |
-
|
5 |
-
type: 'oembed',
|
6 |
-
|
7 |
-
events: {
|
8 |
-
'click [data-name="clear-button"]': 'onClickClear',
|
9 |
-
'keypress .input-search': 'onKeypressSearch',
|
10 |
-
'keyup .input-search': 'onKeyupSearch',
|
11 |
-
'change .input-search': 'onChangeSearch'
|
12 |
-
},
|
13 |
-
|
14 |
-
$control: function(){
|
15 |
-
return this.$('.acf-oembed');
|
16 |
-
},
|
17 |
-
|
18 |
-
$input: function(){
|
19 |
-
return this.$('.input-value');
|
20 |
-
},
|
21 |
-
|
22 |
-
$search: function(){
|
23 |
-
return this.$('.input-search');
|
24 |
-
},
|
25 |
-
|
26 |
-
getValue: function(){
|
27 |
-
return this.$input().val();
|
28 |
-
},
|
29 |
-
|
30 |
-
getSearchVal: function(){
|
31 |
-
return this.$search().val();
|
32 |
-
},
|
33 |
-
|
34 |
-
setValue: function( val ){
|
35 |
-
|
36 |
-
// class
|
37 |
-
if( val ) {
|
38 |
-
this.$control().addClass('has-value');
|
39 |
-
} else {
|
40 |
-
this.$control().removeClass('has-value');
|
41 |
-
}
|
42 |
-
|
43 |
-
acf.val( this.$input(), val );
|
44 |
-
},
|
45 |
-
|
46 |
-
showLoading: function( show ){
|
47 |
-
acf.showLoading( this.$('.canvas') );
|
48 |
-
},
|
49 |
-
|
50 |
-
hideLoading: function(){
|
51 |
-
acf.hideLoading( this.$('.canvas') );
|
52 |
-
},
|
53 |
-
|
54 |
-
maybeSearch: function(){
|
55 |
-
|
56 |
-
// vars
|
57 |
-
var prevUrl = this.val();
|
58 |
-
var url = this.getSearchVal();
|
59 |
-
|
60 |
-
// no value
|
61 |
-
if( !url ) {
|
62 |
-
return this.clear();
|
63 |
-
}
|
64 |
-
|
65 |
-
// fix missing 'http://' - causes the oembed code to error and fail
|
66 |
-
if( url.substr(0, 4) != 'http' ) {
|
67 |
-
url = 'http://' + url;
|
68 |
-
}
|
69 |
-
|
70 |
-
// bail early if no change
|
71 |
-
if( url === prevUrl ) return;
|
72 |
-
|
73 |
-
// clear existing timeout
|
74 |
-
var timeout = this.get('timeout');
|
75 |
-
if( timeout ) {
|
76 |
-
clearTimeout( timeout );
|
77 |
-
}
|
78 |
-
|
79 |
-
// set new timeout
|
80 |
-
var callback = $.proxy(this.search, this, url);
|
81 |
-
this.set('timeout', setTimeout(callback, 300));
|
82 |
-
|
83 |
-
},
|
84 |
-
|
85 |
-
search: function( url ){
|
86 |
-
|
87 |
-
// ajax
|
88 |
-
var ajaxData = {
|
89 |
-
action: 'acf/fields/oembed/search',
|
90 |
-
s: url,
|
91 |
-
field_key: this.get('key')
|
92 |
-
};
|
93 |
-
|
94 |
-
// clear existing timeout
|
95 |
-
var xhr = this.get('xhr');
|
96 |
-
if( xhr ) {
|
97 |
-
xhr.abort();
|
98 |
-
}
|
99 |
-
|
100 |
-
// loading
|
101 |
-
this.showLoading();
|
102 |
-
|
103 |
-
// query
|
104 |
-
var xhr = $.ajax({
|
105 |
-
url: acf.get('ajaxurl'),
|
106 |
-
data: acf.prepareForAjax(ajaxData),
|
107 |
-
type: 'post',
|
108 |
-
dataType: 'json',
|
109 |
-
context: this,
|
110 |
-
success: function( json ){
|
111 |
-
|
112 |
-
// error
|
113 |
-
if( !json || !json.html ) {
|
114 |
-
json = {
|
115 |
-
url: false,
|
116 |
-
html: ''
|
117 |
-
}
|
118 |
-
}
|
119 |
-
|
120 |
-
// update vars
|
121 |
-
this.val( json.url );
|
122 |
-
this.$('.canvas-media').html( json.html );
|
123 |
-
},
|
124 |
-
complete: function(){
|
125 |
-
this.hideLoading();
|
126 |
-
}
|
127 |
-
});
|
128 |
-
|
129 |
-
this.set('xhr', xhr);
|
130 |
-
},
|
131 |
-
|
132 |
-
clear: function(){
|
133 |
-
this.val('');
|
134 |
-
this.$search().val('');
|
135 |
-
this.$('.canvas-media').html('');
|
136 |
-
},
|
137 |
-
|
138 |
-
onClickClear: function( e, $el ){
|
139 |
-
this.clear();
|
140 |
-
},
|
141 |
-
|
142 |
-
onKeypressSearch: function( e, $el ){
|
143 |
-
if( e.which == 13 ) {
|
144 |
-
e.preventDefault();
|
145 |
-
this.maybeSearch();
|
146 |
-
}
|
147 |
-
},
|
148 |
-
|
149 |
-
onKeyupSearch: function( e, $el ){
|
150 |
-
if( $el.val() ) {
|
151 |
-
this.maybeSearch();
|
152 |
-
}
|
153 |
-
},
|
154 |
-
|
155 |
-
onChangeSearch: function( e, $el ){
|
156 |
-
this.maybeSearch();
|
157 |
-
}
|
158 |
-
|
159 |
-
});
|
160 |
-
|
161 |
-
acf.registerFieldType( Field );
|
162 |
-
|
163 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/build/js/_acf-field-page-link.js
DELETED
@@ -1,9 +0,0 @@
|
|
1 |
-
(function($, undefined){
|
2 |
-
|
3 |
-
var Field = acf.models.SelectField.extend({
|
4 |
-
type: 'page_link',
|
5 |
-
});
|
6 |
-
|
7 |
-
acf.registerFieldType( Field );
|
8 |
-
|
9 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/build/js/_acf-field-post-object.js
DELETED
@@ -1,9 +0,0 @@
|
|
1 |
-
(function($, undefined){
|
2 |
-
|
3 |
-
var Field = acf.models.SelectField.extend({
|
4 |
-
type: 'post_object',
|
5 |
-
});
|
6 |
-
|
7 |
-
acf.registerFieldType( Field );
|
8 |
-
|
9 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/build/js/_acf-field-radio.js
DELETED
@@ -1,68 +0,0 @@
|
|
1 |
-
(function($, undefined){
|
2 |
-
|
3 |
-
var Field = acf.Field.extend({
|
4 |
-
|
5 |
-
type: 'radio',
|
6 |
-
|
7 |
-
events: {
|
8 |
-
'click input[type="radio"]': 'onClick',
|
9 |
-
},
|
10 |
-
|
11 |
-
$control: function(){
|
12 |
-
return this.$('.acf-radio-list');
|
13 |
-
},
|
14 |
-
|
15 |
-
$input: function(){
|
16 |
-
return this.$('input:checked');
|
17 |
-
},
|
18 |
-
|
19 |
-
$inputText: function(){
|
20 |
-
return this.$('input[type="text"]');
|
21 |
-
},
|
22 |
-
|
23 |
-
getValue: function(){
|
24 |
-
var val = this.$input().val();
|
25 |
-
if( val === 'other' && this.get('other_choice') ) {
|
26 |
-
val = this.$inputText().val();
|
27 |
-
}
|
28 |
-
return val;
|
29 |
-
},
|
30 |
-
|
31 |
-
onClick: function( e, $el ){
|
32 |
-
|
33 |
-
// vars
|
34 |
-
var $label = $el.parent('label');
|
35 |
-
var selected = $label.hasClass('selected');
|
36 |
-
var val = $el.val();
|
37 |
-
|
38 |
-
// remove previous selected
|
39 |
-
this.$('.selected').removeClass('selected');
|
40 |
-
|
41 |
-
// add active class
|
42 |
-
$label.addClass('selected');
|
43 |
-
|
44 |
-
// allow null
|
45 |
-
if( this.get('allow_null') && selected ) {
|
46 |
-
$label.removeClass('selected');
|
47 |
-
$el.prop('checked', false).trigger('change');
|
48 |
-
val = false;
|
49 |
-
}
|
50 |
-
|
51 |
-
// other
|
52 |
-
if( this.get('other_choice') ) {
|
53 |
-
|
54 |
-
// enable
|
55 |
-
if( val === 'other' ) {
|
56 |
-
this.$inputText().prop('disabled', false);
|
57 |
-
|
58 |
-
// disable
|
59 |
-
} else {
|
60 |
-
this.$inputText().prop('disabled', true);
|
61 |
-
}
|
62 |
-
}
|
63 |
-
}
|
64 |
-
});
|
65 |
-
|
66 |
-
acf.registerFieldType( Field );
|
67 |
-
|
68 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/build/js/_acf-field-range.js
DELETED
@@ -1,42 +0,0 @@
|
|
1 |
-
(function($, undefined){
|
2 |
-
|
3 |
-
var Field = acf.Field.extend({
|
4 |
-
|
5 |
-
type: 'range',
|
6 |
-
|
7 |
-
events: {
|
8 |
-
'input input[type="range"]': 'onChange',
|
9 |
-
'change input': 'onChange'
|
10 |
-
},
|
11 |
-
|
12 |
-
$input: function(){
|
13 |
-
return this.$('input[type="range"]');
|
14 |
-
},
|
15 |
-
|
16 |
-
$inputAlt: function(){
|
17 |
-
return this.$('input[type="number"]');
|
18 |
-
},
|
19 |
-
|
20 |
-
setValue: function( val ){
|
21 |
-
|
22 |
-
this.busy = true;
|
23 |
-
|
24 |
-
// update range input (with change)
|
25 |
-
acf.val( this.$input(), val );
|
26 |
-
|
27 |
-
// update alt input (without change)
|
28 |
-
acf.val( this.$inputAlt(), val, true );
|
29 |
-
|
30 |
-
this.busy = false;
|
31 |
-
},
|
32 |
-
|
33 |
-
onChange: function( e, $el ){
|
34 |
-
if( !this.busy ) {
|
35 |
-
this.setValue( $el.val() );
|
36 |
-
}
|
37 |
-
}
|
38 |
-
});
|
39 |
-
|
40 |
-
acf.registerFieldType( Field );
|
41 |
-
|
42 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/build/js/_acf-field-relationship.js
DELETED
@@ -1,380 +0,0 @@
|
|
1 |
-
(function($, undefined){
|
2 |
-
|
3 |
-
var Field = acf.Field.extend({
|
4 |
-
|
5 |
-
type: 'relationship',
|
6 |
-
|
7 |
-
events: {
|
8 |
-
'keypress [data-filter]': 'onKeypressFilter',
|
9 |
-
'change [data-filter]': 'onChangeFilter',
|
10 |
-
'keyup [data-filter]': 'onChangeFilter',
|
11 |
-
'click .choices-list .acf-rel-item': 'onClickAdd',
|
12 |
-
'click [data-name="remove_item"]': 'onClickRemove',
|
13 |
-
'mouseover': 'onHover'
|
14 |
-
},
|
15 |
-
|
16 |
-
$control: function(){
|
17 |
-
return this.$('.acf-relationship');
|
18 |
-
},
|
19 |
-
|
20 |
-
$list: function( list ) {
|
21 |
-
return this.$('.' + list + '-list');
|
22 |
-
},
|
23 |
-
|
24 |
-
$listItems: function( list ) {
|
25 |
-
return this.$list( list ).find('.acf-rel-item');
|
26 |
-
},
|
27 |
-
|
28 |
-
$listItem: function( list, id ) {
|
29 |
-
return this.$list( list ).find('.acf-rel-item[data-id="' + id + '"]');
|
30 |
-
},
|
31 |
-
|
32 |
-
getValue: function(){
|
33 |
-
var val = [];
|
34 |
-
this.$listItems('values').each(function(){
|
35 |
-
val.push( $(this).data('id') );
|
36 |
-
});
|
37 |
-
return val.length ? val : false;
|
38 |
-
},
|
39 |
-
|
40 |
-
newChoice: function( props ){
|
41 |
-
return [
|
42 |
-
'<li>',
|
43 |
-
'<span data-id="' + props.id + '" class="acf-rel-item">' + props.text + '</span>',
|
44 |
-
'</li>'
|
45 |
-
].join('');
|
46 |
-
},
|
47 |
-
|
48 |
-
newValue: function( props ){
|
49 |
-
return [
|
50 |
-
'<li>',
|
51 |
-
'<input type="hidden" name="' + this.getInputName() + '[]" value="' + props.id + '" />',
|
52 |
-
'<span data-id="' + props.id + '" class="acf-rel-item">' + props.text,
|
53 |
-
'<a href="#" class="acf-icon -minus small dark" data-name="remove_item"></a>',
|
54 |
-
'</span>',
|
55 |
-
'</li>'
|
56 |
-
].join('');
|
57 |
-
},
|
58 |
-
|
59 |
-
addSortable: function( self ){
|
60 |
-
|
61 |
-
// sortable
|
62 |
-
this.$list('values').sortable({
|
63 |
-
items: 'li',
|
64 |
-
forceHelperSize: true,
|
65 |
-
forcePlaceholderSize: true,
|
66 |
-
scroll: true,
|
67 |
-
update: function(){
|
68 |
-
self.$input().trigger('change');
|
69 |
-
}
|
70 |
-
});
|
71 |
-
},
|
72 |
-
|
73 |
-
initialize: function(){
|
74 |
-
|
75 |
-
// scroll
|
76 |
-
var onScroll = this.proxy(function(e){
|
77 |
-
|
78 |
-
// bail early if no more results
|
79 |
-
if( this.get('loading') || !this.get('more') ) {
|
80 |
-
return;
|
81 |
-
}
|
82 |
-
|
83 |
-
// Scrolled to bottom
|
84 |
-
var $list = this.$list('choices');
|
85 |
-
var scrollTop = Math.ceil( $list.scrollTop() );
|
86 |
-
var scrollHeight = Math.ceil( $list[0].scrollHeight );
|
87 |
-
var innerHeight = Math.ceil( $list.innerHeight() );
|
88 |
-
var paged = this.get('paged') || 1;
|
89 |
-
if( (scrollTop + innerHeight) >= scrollHeight ) {
|
90 |
-
|
91 |
-
// update paged
|
92 |
-
this.set('paged', (paged+1));
|
93 |
-
|
94 |
-
// fetch
|
95 |
-
this.fetch();
|
96 |
-
}
|
97 |
-
|
98 |
-
});
|
99 |
-
|
100 |
-
this.$list('choices').scrollTop(0).on('scroll', onScroll);
|
101 |
-
|
102 |
-
// fetch
|
103 |
-
this.fetch();
|
104 |
-
},
|
105 |
-
|
106 |
-
onHover: function( e ){
|
107 |
-
|
108 |
-
// only once
|
109 |
-
$().off(e);
|
110 |
-
|
111 |
-
// add sortable
|
112 |
-
this.addSortable( this );
|
113 |
-
},
|
114 |
-
|
115 |
-
onKeypressFilter: function( e, $el ){
|
116 |
-
|
117 |
-
// don't submit form
|
118 |
-
if( e.which == 13 ) {
|
119 |
-
e.preventDefault();
|
120 |
-
}
|
121 |
-
},
|
122 |
-
|
123 |
-
onChangeFilter: function( e, $el ){
|
124 |
-
|
125 |
-
// vars
|
126 |
-
var val = $el.val();
|
127 |
-
var filter = $el.data('filter');
|
128 |
-
|
129 |
-
// Bail early if filter has not changed
|
130 |
-
if( this.get(filter) === val ) {
|
131 |
-
return;
|
132 |
-
}
|
133 |
-
|
134 |
-
// update attr
|
135 |
-
this.set(filter, val);
|
136 |
-
|
137 |
-
// reset paged
|
138 |
-
this.set('paged', 1);
|
139 |
-
|
140 |
-
// fetch
|
141 |
-
if( $el.is('select') ) {
|
142 |
-
this.fetch();
|
143 |
-
|
144 |
-
// search must go through timeout
|
145 |
-
} else {
|
146 |
-
this.maybeFetch();
|
147 |
-
}
|
148 |
-
},
|
149 |
-
|
150 |
-
onClickAdd: function( e, $el ){
|
151 |
-
|
152 |
-
// vars
|
153 |
-
var val = this.val();
|
154 |
-
var max = parseInt( this.get('max') );
|
155 |
-
|
156 |
-
// can be added?
|
157 |
-
if( $el.hasClass('disabled') ) {
|
158 |
-
return false;
|
159 |
-
}
|
160 |
-
|
161 |
-
// validate
|
162 |
-
if( max > 0 && val && val.length >= max ) {
|
163 |
-
|
164 |
-
// add notice
|
165 |
-
this.showNotice({
|
166 |
-
text: acf.__('Maximum values reached ( {max} values )').replace('{max}', max),
|
167 |
-
type: 'warning'
|
168 |
-
});
|
169 |
-
return false;
|
170 |
-
}
|
171 |
-
|
172 |
-
// disable
|
173 |
-
$el.addClass('disabled');
|
174 |
-
|
175 |
-
// add
|
176 |
-
var html = this.newValue({
|
177 |
-
id: $el.data('id'),
|
178 |
-
text: $el.html()
|
179 |
-
});
|
180 |
-
this.$list('values').append( html )
|
181 |
-
|
182 |
-
// trigger change
|
183 |
-
this.$input().trigger('change');
|
184 |
-
},
|
185 |
-
|
186 |
-
onClickRemove: function( e, $el ){
|
187 |
-
|
188 |
-
// Prevent default here because generic handler wont be triggered.
|
189 |
-
e.preventDefault();
|
190 |
-
|
191 |
-
// vars
|
192 |
-
var $span = $el.parent();
|
193 |
-
var $li = $span.parent();
|
194 |
-
var id = $span.data('id');
|
195 |
-
|
196 |
-
// remove value
|
197 |
-
$li.remove();
|
198 |
-
|
199 |
-
// show choice
|
200 |
-
this.$listItem('choices', id).removeClass('disabled');
|
201 |
-
|
202 |
-
// trigger change
|
203 |
-
this.$input().trigger('change');
|
204 |
-
},
|
205 |
-
|
206 |
-
maybeFetch: function(){
|
207 |
-
|
208 |
-
// vars
|
209 |
-
var timeout = this.get('timeout');
|
210 |
-
|
211 |
-
// abort timeout
|
212 |
-
if( timeout ) {
|
213 |
-
clearTimeout( timeout );
|
214 |
-
}
|
215 |
-
|
216 |
-
// fetch
|
217 |
-
timeout = this.setTimeout(this.fetch, 300);
|
218 |
-
this.set('timeout', timeout);
|
219 |
-
},
|
220 |
-
|
221 |
-
getAjaxData: function(){
|
222 |
-
|
223 |
-
// load data based on element attributes
|
224 |
-
var ajaxData = this.$control().data();
|
225 |
-
for( var name in ajaxData ) {
|
226 |
-
ajaxData[ name ] = this.get( name );
|
227 |
-
}
|
228 |
-
|
229 |
-
// extra
|
230 |
-
ajaxData.action = 'acf/fields/relationship/query';
|
231 |
-
ajaxData.field_key = this.get('key');
|
232 |
-
|
233 |
-
// Filter.
|
234 |
-
ajaxData = acf.applyFilters( 'relationship_ajax_data', ajaxData, this );
|
235 |
-
|
236 |
-
// return
|
237 |
-
return ajaxData;
|
238 |
-
},
|
239 |
-
|
240 |
-
fetch: function(){
|
241 |
-
|
242 |
-
// abort XHR if this field is already loading AJAX data
|
243 |
-
var xhr = this.get('xhr');
|
244 |
-
if( xhr ) {
|
245 |
-
xhr.abort();
|
246 |
-
}
|
247 |
-
|
248 |
-
// add to this.o
|
249 |
-
var ajaxData = this.getAjaxData();
|
250 |
-
|
251 |
-
// clear html if is new query
|
252 |
-
var $choiceslist = this.$list( 'choices' );
|
253 |
-
if( ajaxData.paged == 1 ) {
|
254 |
-
$choiceslist.html('');
|
255 |
-
}
|
256 |
-
|
257 |
-
// loading
|
258 |
-
var $loading = $('<li><i class="acf-loading"></i> ' + acf.__('Loading') + '</li>');
|
259 |
-
$choiceslist.append($loading);
|
260 |
-
this.set('loading', true);
|
261 |
-
|
262 |
-
// callback
|
263 |
-
var onComplete = function(){
|
264 |
-
this.set('loading', false);
|
265 |
-
$loading.remove();
|
266 |
-
};
|
267 |
-
|
268 |
-
var onSuccess = function( json ){
|
269 |
-
|
270 |
-
// no results
|
271 |
-
if( !json || !json.results || !json.results.length ) {
|
272 |
-
|
273 |
-
// prevent pagination
|
274 |
-
this.set('more', false);
|
275 |
-
|
276 |
-
// add message
|
277 |
-
if( this.get('paged') == 1 ) {
|
278 |
-
this.$list('choices').append('<li>' + acf.__('No matches found') + '</li>');
|
279 |
-
}
|
280 |
-
|
281 |
-
// return
|
282 |
-
return;
|
283 |
-
}
|
284 |
-
|
285 |
-
// set more (allows pagination scroll)
|
286 |
-
this.set('more', json.more );
|
287 |
-
|
288 |
-
// get new results
|
289 |
-
var html = this.walkChoices(json.results);
|
290 |
-
var $html = $( html );
|
291 |
-
|
292 |
-
// apply .disabled to left li's
|
293 |
-
var val = this.val();
|
294 |
-
if( val && val.length ) {
|
295 |
-
val.map(function( id ){
|
296 |
-
$html.find('.acf-rel-item[data-id="' + id + '"]').addClass('disabled');
|
297 |
-
});
|
298 |
-
}
|
299 |
-
|
300 |
-
// append
|
301 |
-
$choiceslist.append( $html );
|
302 |
-
|
303 |
-
// merge together groups
|
304 |
-
var $prevLabel = false;
|
305 |
-
var $prevList = false;
|
306 |
-
|
307 |
-
$choiceslist.find('.acf-rel-label').each(function(){
|
308 |
-
|
309 |
-
var $label = $(this);
|
310 |
-
var $list = $label.siblings('ul');
|
311 |
-
|
312 |
-
if( $prevLabel && $prevLabel.text() == $label.text() ) {
|
313 |
-
$prevList.append( $list.children() );
|
314 |
-
$(this).parent().remove();
|
315 |
-
return;
|
316 |
-
}
|
317 |
-
|
318 |
-
// update vars
|
319 |
-
$prevLabel = $label;
|
320 |
-
$prevList = $list;
|
321 |
-
});
|
322 |
-
};
|
323 |
-
|
324 |
-
// get results
|
325 |
-
var xhr = $.ajax({
|
326 |
-
url: acf.get('ajaxurl'),
|
327 |
-
dataType: 'json',
|
328 |
-
type: 'post',
|
329 |
-
data: acf.prepareForAjax(ajaxData),
|
330 |
-
context: this,
|
331 |
-
success: onSuccess,
|
332 |
-
complete: onComplete
|
333 |
-
});
|
334 |
-
|
335 |
-
// set
|
336 |
-
this.set('xhr', xhr);
|
337 |
-
},
|
338 |
-
|
339 |
-
walkChoices: function( data ){
|
340 |
-
|
341 |
-
// walker
|
342 |
-
var walk = function( data ){
|
343 |
-
|
344 |
-
// vars
|
345 |
-
var html = '';
|
346 |
-
|
347 |
-
// is array
|
348 |
-
if( $.isArray(data) ) {
|
349 |
-
data.map(function(item){
|
350 |
-
html += walk( item );
|
351 |
-
});
|
352 |
-
|
353 |
-
// is item
|
354 |
-
} else if( $.isPlainObject(data) ) {
|
355 |
-
|
356 |
-
// group
|
357 |
-
if( data.children !== undefined ) {
|
358 |
-
|
359 |
-
html += '<li><span class="acf-rel-label">' + data.text + '</span><ul class="acf-bl">';
|
360 |
-
html += walk( data.children );
|
361 |
-
html += '</ul></li>';
|
362 |
-
|
363 |
-
// single
|
364 |
-
} else {
|
365 |
-
html += '<li><span class="acf-rel-item" data-id="' + data.id + '">' + data.text + '</span></li>';
|
366 |
-
}
|
367 |
-
}
|
368 |
-
|
369 |
-
// return
|
370 |
-
return html;
|
371 |
-
};
|
372 |
-
|
373 |
-
return walk( data );
|
374 |
-
}
|
375 |
-
|
376 |
-
});
|
377 |
-
|
378 |
-
acf.registerFieldType( Field );
|
379 |
-
|
380 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/build/js/_acf-field-select.js
DELETED
@@ -1,57 +0,0 @@
|
|
1 |
-
(function($, undefined){
|
2 |
-
|
3 |
-
var Field = acf.Field.extend({
|
4 |
-
|
5 |
-
type: 'select',
|
6 |
-
|
7 |
-
select2: false,
|
8 |
-
|
9 |
-
wait: 'load',
|
10 |
-
|
11 |
-
events: {
|
12 |
-
'removeField': 'onRemove'
|
13 |
-
},
|
14 |
-
|
15 |
-
$input: function(){
|
16 |
-
return this.$('select');
|
17 |
-
},
|
18 |
-
|
19 |
-
initialize: function(){
|
20 |
-
|
21 |
-
// vars
|
22 |
-
var $select = this.$input();
|
23 |
-
|
24 |
-
// inherit data
|
25 |
-
this.inherit( $select );
|
26 |
-
|
27 |
-
// select2
|
28 |
-
if( this.get('ui') ) {
|
29 |
-
|
30 |
-
// populate ajax_data (allowing custom attribute to already exist)
|
31 |
-
var ajaxAction = this.get('ajax_action');
|
32 |
-
if( !ajaxAction ) {
|
33 |
-
ajaxAction = 'acf/fields/' + this.get('type') + '/query';
|
34 |
-
}
|
35 |
-
|
36 |
-
// select2
|
37 |
-
this.select2 = acf.newSelect2($select, {
|
38 |
-
field: this,
|
39 |
-
ajax: this.get('ajax'),
|
40 |
-
multiple: this.get('multiple'),
|
41 |
-
placeholder: this.get('placeholder'),
|
42 |
-
allowNull: this.get('allow_null'),
|
43 |
-
ajaxAction: ajaxAction,
|
44 |
-
});
|
45 |
-
}
|
46 |
-
},
|
47 |
-
|
48 |
-
onRemove: function(){
|
49 |
-
if( this.select2 ) {
|
50 |
-
this.select2.destroy();
|
51 |
-
}
|
52 |
-
}
|
53 |
-
});
|
54 |
-
|
55 |
-
acf.registerFieldType( Field );
|
56 |
-
|
57 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/build/js/_acf-field-tab.js
DELETED
@@ -1,505 +0,0 @@
|
|
1 |
-
(function($, undefined){
|
2 |
-
|
3 |
-
// vars
|
4 |
-
var CONTEXT = 'tab';
|
5 |
-
|
6 |
-
var Field = acf.Field.extend({
|
7 |
-
|
8 |
-
type: 'tab',
|
9 |
-
|
10 |
-
wait: '',
|
11 |
-
|
12 |
-
tabs: false,
|
13 |
-
|
14 |
-
tab: false,
|
15 |
-
|
16 |
-
findFields: function(){
|
17 |
-
return this.$el.nextUntil('.acf-field-tab', '.acf-field');
|
18 |
-
},
|
19 |
-
|
20 |
-
getFields: function(){
|
21 |
-
return acf.getFields( this.findFields() );
|
22 |
-
},
|
23 |
-
|
24 |
-
findTabs: function(){
|
25 |
-
return this.$el.prevAll('.acf-tab-wrap:first');
|
26 |
-
},
|
27 |
-
|
28 |
-
findTab: function(){
|
29 |
-
return this.$('.acf-tab-button');
|
30 |
-
},
|
31 |
-
|
32 |
-
initialize: function(){
|
33 |
-
|
34 |
-
// bail early if is td
|
35 |
-
if( this.$el.is('td') ) {
|
36 |
-
this.events = {};
|
37 |
-
return false;
|
38 |
-
}
|
39 |
-
|
40 |
-
// vars
|
41 |
-
var $tabs = this.findTabs();
|
42 |
-
var $tab = this.findTab();
|
43 |
-
var settings = acf.parseArgs($tab.data(), {
|
44 |
-
endpoint: false,
|
45 |
-
placement: '',
|
46 |
-
before: this.$el
|
47 |
-
});
|
48 |
-
|
49 |
-
// create wrap
|
50 |
-
if( !$tabs.length || settings.endpoint ) {
|
51 |
-
this.tabs = new Tabs( settings );
|
52 |
-
} else {
|
53 |
-
this.tabs = $tabs.data('acf');
|
54 |
-
}
|
55 |
-
|
56 |
-
// add tab
|
57 |
-
this.tab = this.tabs.addTab($tab, this);
|
58 |
-
},
|
59 |
-
|
60 |
-
isActive: function(){
|
61 |
-
return this.tab.isActive();
|
62 |
-
},
|
63 |
-
|
64 |
-
showFields: function(){
|
65 |
-
|
66 |
-
// show fields
|
67 |
-
this.getFields().map(function( field ){
|
68 |
-
field.show( this.cid, CONTEXT );
|
69 |
-
field.hiddenByTab = false;
|
70 |
-
}, this);
|
71 |
-
|
72 |
-
},
|
73 |
-
|
74 |
-
hideFields: function(){
|
75 |
-
|
76 |
-
// hide fields
|
77 |
-
this.getFields().map(function( field ){
|
78 |
-
field.hide( this.cid, CONTEXT );
|
79 |
-
field.hiddenByTab = this.tab;
|
80 |
-
}, this);
|
81 |
-
|
82 |
-
},
|
83 |
-
|
84 |
-
show: function( lockKey ){
|
85 |
-
|
86 |
-
// show field and store result
|
87 |
-
var visible = acf.Field.prototype.show.apply(this, arguments);
|
88 |
-
|
89 |
-
// check if now visible
|
90 |
-
if( visible ) {
|
91 |
-
|
92 |
-
// show tab
|
93 |
-
this.tab.show();
|
94 |
-
|
95 |
-
// check active tabs
|
96 |
-
this.tabs.refresh();
|
97 |
-
}
|
98 |
-
|
99 |
-
// return
|
100 |
-
return visible;
|
101 |
-
},
|
102 |
-
|
103 |
-
hide: function( lockKey ){
|
104 |
-
|
105 |
-
// hide field and store result
|
106 |
-
var hidden = acf.Field.prototype.hide.apply(this, arguments);
|
107 |
-
|
108 |
-
// check if now hidden
|
109 |
-
if( hidden ) {
|
110 |
-
|
111 |
-
// hide tab
|
112 |
-
this.tab.hide();
|
113 |
-
|
114 |
-
// reset tabs if this was active
|
115 |
-
if( this.isActive() ) {
|
116 |
-
this.tabs.reset();
|
117 |
-
}
|
118 |
-
}
|
119 |
-
|
120 |
-
// return
|
121 |
-
return hidden;
|
122 |
-
},
|
123 |
-
|
124 |
-
enable: function( lockKey ){
|
125 |
-
|
126 |
-
// enable fields
|
127 |
-
this.getFields().map(function( field ){
|
128 |
-
field.enable( CONTEXT );
|
129 |
-
});
|
130 |
-
},
|
131 |
-
|
132 |
-
disable: function( lockKey ){
|
133 |
-
|
134 |
-
// disable fields
|
135 |
-
this.getFields().map(function( field ){
|
136 |
-
field.disable( CONTEXT );
|
137 |
-
});
|
138 |
-
}
|
139 |
-
});
|
140 |
-
|
141 |
-
acf.registerFieldType( Field );
|
142 |
-
|
143 |
-
|
144 |
-
/**
|
145 |
-
* tabs
|
146 |
-
*
|
147 |
-
* description
|
148 |
-
*
|
149 |
-
* @date 8/2/18
|
150 |
-
* @since 5.6.5
|
151 |
-
*
|
152 |
-
* @param type $var Description. Default.
|
153 |
-
* @return type Description.
|
154 |
-
*/
|
155 |
-
|
156 |
-
var i = 0;
|
157 |
-
var Tabs = acf.Model.extend({
|
158 |
-
|
159 |
-
tabs: [],
|
160 |
-
|
161 |
-
active: false,
|
162 |
-
|
163 |
-
actions: {
|
164 |
-
'refresh': 'onRefresh'
|
165 |
-
},
|
166 |
-
|
167 |
-
data: {
|
168 |
-
before: false,
|
169 |
-
placement: 'top',
|
170 |
-
index: 0,
|
171 |
-
initialized: false,
|
172 |
-
},
|
173 |
-
|
174 |
-
setup: function( settings ){
|
175 |
-
|
176 |
-
// data
|
177 |
-
$.extend(this.data, settings);
|
178 |
-
|
179 |
-
// define this prop to avoid scope issues
|
180 |
-
this.tabs = [];
|
181 |
-
this.active = false;
|
182 |
-
|
183 |
-
// vars
|
184 |
-
var placement = this.get('placement');
|
185 |
-
var $before = this.get('before');
|
186 |
-
var $parent = $before.parent();
|
187 |
-
|
188 |
-
// add sidebar for left placement
|
189 |
-
if( placement == 'left' && $parent.hasClass('acf-fields') ) {
|
190 |
-
$parent.addClass('-sidebar');
|
191 |
-
}
|
192 |
-
|
193 |
-
// create wrap
|
194 |
-
if( $before.is('tr') ) {
|
195 |
-
this.$el = $('<tr class="acf-tab-wrap"><td colspan="2"><ul class="acf-hl acf-tab-group"></ul></td></tr>');
|
196 |
-
} else {
|
197 |
-
this.$el = $('<div class="acf-tab-wrap -' + placement + '"><ul class="acf-hl acf-tab-group"></ul></div>');
|
198 |
-
}
|
199 |
-
|
200 |
-
// append
|
201 |
-
$before.before( this.$el );
|
202 |
-
|
203 |
-
// set index
|
204 |
-
this.set('index', i, true);
|
205 |
-
i++;
|
206 |
-
},
|
207 |
-
|
208 |
-
initializeTabs: function(){
|
209 |
-
|
210 |
-
// find first visible tab
|
211 |
-
var tab = this.getVisible().shift();
|
212 |
-
|
213 |
-
// remember previous tab state
|
214 |
-
var order = acf.getPreference('this.tabs') || [];
|
215 |
-
var groupIndex = this.get('index');
|
216 |
-
var tabIndex = order[ groupIndex ];
|
217 |
-
|
218 |
-
if( this.tabs[ tabIndex ] && this.tabs[ tabIndex ].isVisible() ) {
|
219 |
-
tab = this.tabs[ tabIndex ];
|
220 |
-
}
|
221 |
-
|
222 |
-
// select
|
223 |
-
if( tab ) {
|
224 |
-
this.selectTab( tab );
|
225 |
-
} else {
|
226 |
-
this.closeTabs();
|
227 |
-
}
|
228 |
-
|
229 |
-
// set local variable used by tabsManager
|
230 |
-
this.set('initialized', true);
|
231 |
-
},
|
232 |
-
|
233 |
-
getVisible: function(){
|
234 |
-
return this.tabs.filter(function( tab ){
|
235 |
-
return tab.isVisible();
|
236 |
-
});
|
237 |
-
},
|
238 |
-
|
239 |
-
getActive: function(){
|
240 |
-
return this.active;
|
241 |
-
},
|
242 |
-
|
243 |
-
setActive: function( tab ){
|
244 |
-
return this.active = tab;
|
245 |
-
},
|
246 |
-
|
247 |
-
hasActive: function(){
|
248 |
-
return (this.active !== false);
|
249 |
-
},
|
250 |
-
|
251 |
-
isActive: function( tab ){
|
252 |
-
var active = this.getActive();
|
253 |
-
return (active && active.cid === tab.cid);
|
254 |
-
},
|
255 |
-
|
256 |
-
closeActive: function(){
|
257 |
-
if( this.hasActive() ) {
|
258 |
-
this.closeTab( this.getActive() );
|
259 |
-
}
|
260 |
-
},
|
261 |
-
|
262 |
-
openTab: function( tab ){
|
263 |
-
|
264 |
-
// close existing tab
|
265 |
-
this.closeActive();
|
266 |
-
|
267 |
-
// open
|
268 |
-
tab.open();
|
269 |
-
|
270 |
-
// set active
|
271 |
-
this.setActive( tab );
|
272 |
-
},
|
273 |
-
|
274 |
-
closeTab: function( tab ){
|
275 |
-
|
276 |
-
// close
|
277 |
-
tab.close();
|
278 |
-
|
279 |
-
// set active
|
280 |
-
this.setActive( false );
|
281 |
-
},
|
282 |
-
|
283 |
-
closeTabs: function(){
|
284 |
-
this.tabs.map( this.closeTab, this );
|
285 |
-
},
|
286 |
-
|
287 |
-
selectTab: function( tab ){
|
288 |
-
|
289 |
-
// close other tabs
|
290 |
-
this.tabs.map(function( t ){
|
291 |
-
if( tab.cid !== t.cid ) {
|
292 |
-
this.closeTab( t );
|
293 |
-
}
|
294 |
-
}, this);
|
295 |
-
|
296 |
-
// open
|
297 |
-
this.openTab( tab );
|
298 |
-
|
299 |
-
},
|
300 |
-
|
301 |
-
addTab: function( $a, field ){
|
302 |
-
|
303 |
-
// create <li>
|
304 |
-
var $li = $('<li></li>');
|
305 |
-
|
306 |
-
// append <a>
|
307 |
-
$li.append( $a );
|
308 |
-
|
309 |
-
// append
|
310 |
-
this.$('ul').append( $li );
|
311 |
-
|
312 |
-
// initialize
|
313 |
-
var tab = new Tab({
|
314 |
-
$el: $li,
|
315 |
-
field: field,
|
316 |
-
group: this,
|
317 |
-
});
|
318 |
-
|
319 |
-
// store
|
320 |
-
this.tabs.push( tab );
|
321 |
-
|
322 |
-
// return
|
323 |
-
return tab;
|
324 |
-
},
|
325 |
-
|
326 |
-
reset: function(){
|
327 |
-
|
328 |
-
// close existing tab
|
329 |
-
this.closeActive();
|
330 |
-
|
331 |
-
// find and active a tab
|
332 |
-
return this.refresh();
|
333 |
-
},
|
334 |
-
|
335 |
-
refresh: function(){
|
336 |
-
|
337 |
-
// bail early if active already exists
|
338 |
-
if( this.hasActive() ) {
|
339 |
-
return false;
|
340 |
-
}
|
341 |
-
|
342 |
-
// find next active tab
|
343 |
-
var tab = this.getVisible().shift();
|
344 |
-
|
345 |
-
// open tab
|
346 |
-
if( tab ) {
|
347 |
-
this.openTab( tab );
|
348 |
-
}
|
349 |
-
|
350 |
-
// return
|
351 |
-
return tab;
|
352 |
-
},
|
353 |
-
|
354 |
-
onRefresh: function(){
|
355 |
-
|
356 |
-
// only for left placements
|
357 |
-
if( this.get('placement') !== 'left' ) {
|
358 |
-
return;
|
359 |
-
}
|
360 |
-
|
361 |
-
// vars
|
362 |
-
var $parent = this.$el.parent();
|
363 |
-
var $list = this.$el.children('ul');
|
364 |
-
var attribute = $parent.is('td') ? 'height' : 'min-height';
|
365 |
-
|
366 |
-
// find height (minus 1 for border-bottom)
|
367 |
-
var height = $list.position().top + $list.outerHeight(true) - 1;
|
368 |
-
|
369 |
-
// add css
|
370 |
-
$parent.css(attribute, height);
|
371 |
-
}
|
372 |
-
});
|
373 |
-
|
374 |
-
var Tab = acf.Model.extend({
|
375 |
-
|
376 |
-
group: false,
|
377 |
-
|
378 |
-
field: false,
|
379 |
-
|
380 |
-
events: {
|
381 |
-
'click a': 'onClick'
|
382 |
-
},
|
383 |
-
|
384 |
-
index: function(){
|
385 |
-
return this.$el.index();
|
386 |
-
},
|
387 |
-
|
388 |
-
isVisible: function(){
|
389 |
-
return acf.isVisible( this.$el );
|
390 |
-
},
|
391 |
-
|
392 |
-
isActive: function(){
|
393 |
-
return this.$el.hasClass('active');
|
394 |
-
},
|
395 |
-
|
396 |
-
open: function(){
|
397 |
-
|
398 |
-
// add class
|
399 |
-
this.$el.addClass('active');
|
400 |
-
|
401 |
-
// show field
|
402 |
-
this.field.showFields();
|
403 |
-
},
|
404 |
-
|
405 |
-
close: function(){
|
406 |
-
|
407 |
-
// remove class
|
408 |
-
this.$el.removeClass('active');
|
409 |
-
|
410 |
-
// hide field
|
411 |
-
this.field.hideFields();
|
412 |
-
},
|
413 |
-
|
414 |
-
onClick: function( e, $el ){
|
415 |
-
|
416 |
-
// prevent default
|
417 |
-
e.preventDefault();
|
418 |
-
|
419 |
-
// toggle
|
420 |
-
this.toggle();
|
421 |
-
},
|
422 |
-
|
423 |
-
toggle: function(){
|
424 |
-
|
425 |
-
// bail early if already active
|
426 |
-
if( this.isActive() ) {
|
427 |
-
return;
|
428 |
-
}
|
429 |
-
|
430 |
-
// toggle this tab
|
431 |
-
this.group.openTab( this );
|
432 |
-
}
|
433 |
-
});
|
434 |
-
|
435 |
-
var tabsManager = new acf.Model({
|
436 |
-
|
437 |
-
priority: 50,
|
438 |
-
|
439 |
-
actions: {
|
440 |
-
'prepare': 'render',
|
441 |
-
'append': 'render',
|
442 |
-
'unload': 'onUnload',
|
443 |
-
'invalid_field': 'onInvalidField'
|
444 |
-
},
|
445 |
-
|
446 |
-
findTabs: function(){
|
447 |
-
return $('.acf-tab-wrap');
|
448 |
-
},
|
449 |
-
|
450 |
-
getTabs: function(){
|
451 |
-
return acf.getInstances( this.findTabs() );
|
452 |
-
},
|
453 |
-
|
454 |
-
render: function( $el ){
|
455 |
-
this.getTabs().map(function( tabs ){
|
456 |
-
if( !tabs.get('initialized') ) {
|
457 |
-
tabs.initializeTabs();
|
458 |
-
}
|
459 |
-
});
|
460 |
-
},
|
461 |
-
|
462 |
-
onInvalidField: function( field ){
|
463 |
-
|
464 |
-
// bail early if busy
|
465 |
-
if( this.busy ) {
|
466 |
-
return;
|
467 |
-
}
|
468 |
-
|
469 |
-
// ignore if not hidden by tab
|
470 |
-
if( !field.hiddenByTab ) {
|
471 |
-
return;
|
472 |
-
}
|
473 |
-
|
474 |
-
// toggle tab
|
475 |
-
field.hiddenByTab.toggle();
|
476 |
-
|
477 |
-
// ignore other invalid fields
|
478 |
-
this.busy = true;
|
479 |
-
this.setTimeout(function(){
|
480 |
-
this.busy = false;
|
481 |
-
}, 100);
|
482 |
-
},
|
483 |
-
|
484 |
-
onUnload: function(){
|
485 |
-
|
486 |
-
// vars
|
487 |
-
var order = [];
|
488 |
-
|
489 |
-
// loop
|
490 |
-
this.getTabs().map(function( group ){
|
491 |
-
var active = group.hasActive() ? group.getActive().index() : 0;
|
492 |
-
order.push(active);
|
493 |
-
});
|
494 |
-
|
495 |
-
// bail if no tabs
|
496 |
-
if( !order.length ) {
|
497 |
-
return;
|
498 |
-
}
|
499 |
-
|
500 |
-
// update
|
501 |
-
acf.setPreference('this.tabs', order);
|
502 |
-
}
|
503 |
-
});
|
504 |
-
|
505 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/build/js/_acf-field-taxonomy.js
DELETED
@@ -1,321 +0,0 @@
|
|
1 |
-
(function($, undefined){
|
2 |
-
|
3 |
-
var Field = acf.Field.extend({
|
4 |
-
|
5 |
-
type: 'taxonomy',
|
6 |
-
|
7 |
-
data: {
|
8 |
-
'ftype': 'select'
|
9 |
-
},
|
10 |
-
|
11 |
-
select2: false,
|
12 |
-
|
13 |
-
wait: 'load',
|
14 |
-
|
15 |
-
events: {
|
16 |
-
'click a[data-name="add"]': 'onClickAdd',
|
17 |
-
'click input[type="radio"]': 'onClickRadio',
|
18 |
-
},
|
19 |
-
|
20 |
-
$control: function(){
|
21 |
-
return this.$('.acf-taxonomy-field');
|
22 |
-
},
|
23 |
-
|
24 |
-
$input: function(){
|
25 |
-
return this.getRelatedPrototype().$input.apply(this, arguments);
|
26 |
-
},
|
27 |
-
|
28 |
-
getRelatedType: function(){
|
29 |
-
|
30 |
-
// vars
|
31 |
-
var fieldType = this.get('ftype');
|
32 |
-
|
33 |
-
// normalize
|
34 |
-
if( fieldType == 'multi_select' ) {
|
35 |
-
fieldType = 'select';
|
36 |
-
}
|
37 |
-
|
38 |
-
// return
|
39 |
-
return fieldType;
|
40 |
-
|
41 |
-
},
|
42 |
-
|
43 |
-
getRelatedPrototype: function(){
|
44 |
-
return acf.getFieldType( this.getRelatedType() ).prototype;
|
45 |
-
},
|
46 |
-
|
47 |
-
getValue: function(){
|
48 |
-
return this.getRelatedPrototype().getValue.apply(this, arguments);
|
49 |
-
},
|
50 |
-
|
51 |
-
setValue: function(){
|
52 |
-
return this.getRelatedPrototype().setValue.apply(this, arguments);
|
53 |
-
},
|
54 |
-
|
55 |
-
initialize: function(){
|
56 |
-
this.getRelatedPrototype().initialize.apply(this, arguments);
|
57 |
-
},
|
58 |
-
|
59 |
-
onRemove: function(){
|
60 |
-
if( this.select2 ) {
|
61 |
-
this.select2.destroy();
|
62 |
-
}
|
63 |
-
},
|
64 |
-
|
65 |
-
onClickAdd: function( e, $el ){
|
66 |
-
|
67 |
-
// vars
|
68 |
-
var field = this;
|
69 |
-
var popup = false;
|
70 |
-
var $form = false;
|
71 |
-
var $name = false;
|
72 |
-
var $parent = false;
|
73 |
-
var $button = false;
|
74 |
-
var $message = false;
|
75 |
-
var notice = false;
|
76 |
-
|
77 |
-
// step 1.
|
78 |
-
var step1 = function(){
|
79 |
-
|
80 |
-
// popup
|
81 |
-
popup = acf.newPopup({
|
82 |
-
title: $el.attr('title'),
|
83 |
-
loading: true,
|
84 |
-
width: '300px'
|
85 |
-
});
|
86 |
-
|
87 |
-
// ajax
|
88 |
-
var ajaxData = {
|
89 |
-
action: 'acf/fields/taxonomy/add_term',
|
90 |
-
field_key: field.get('key')
|
91 |
-
};
|
92 |
-
|
93 |
-
// get HTML
|
94 |
-
$.ajax({
|
95 |
-
url: acf.get('ajaxurl'),
|
96 |
-
data: acf.prepareForAjax(ajaxData),
|
97 |
-
type: 'post',
|
98 |
-
dataType: 'html',
|
99 |
-
success: step2
|
100 |
-
});
|
101 |
-
};
|
102 |
-
|
103 |
-
// step 2.
|
104 |
-
var step2 = function( html ){
|
105 |
-
|
106 |
-
// update popup
|
107 |
-
popup.loading(false);
|
108 |
-
popup.content(html);
|
109 |
-
|
110 |
-
// vars
|
111 |
-
$form = popup.$('form');
|
112 |
-
$name = popup.$('input[name="term_name"]');
|
113 |
-
$parent = popup.$('select[name="term_parent"]');
|
114 |
-
$button = popup.$('.acf-submit-button');
|
115 |
-
|
116 |
-
// focus
|
117 |
-
$name.focus();
|
118 |
-
|
119 |
-
// submit form
|
120 |
-
popup.on('submit', 'form', step3);
|
121 |
-
};
|
122 |
-
|
123 |
-
// step 3.
|
124 |
-
var step3 = function( e, $el ){
|
125 |
-
|
126 |
-
// prevent
|
127 |
-
e.preventDefault();
|
128 |
-
e.stopImmediatePropagation();
|
129 |
-
|
130 |
-
// basic validation
|
131 |
-
if( $name.val() === '' ) {
|
132 |
-
$name.focus();
|
133 |
-
return false;
|
134 |
-
}
|
135 |
-
|
136 |
-
// disable
|
137 |
-
acf.startButtonLoading( $button );
|
138 |
-
|
139 |
-
// ajax
|
140 |
-
var ajaxData = {
|
141 |
-
action: 'acf/fields/taxonomy/add_term',
|
142 |
-
field_key: field.get('key'),
|
143 |
-
term_name: $name.val(),
|
144 |
-
term_parent: $parent.length ? $parent.val() : 0
|
145 |
-
};
|
146 |
-
|
147 |
-
$.ajax({
|
148 |
-
url: acf.get('ajaxurl'),
|
149 |
-
data: acf.prepareForAjax(ajaxData),
|
150 |
-
type: 'post',
|
151 |
-
dataType: 'json',
|
152 |
-
success: step4
|
153 |
-
});
|
154 |
-
};
|
155 |
-
|
156 |
-
// step 4.
|
157 |
-
var step4 = function( json ){
|
158 |
-
|
159 |
-
// enable
|
160 |
-
acf.stopButtonLoading( $button );
|
161 |
-
|
162 |
-
// remove prev notice
|
163 |
-
if( notice ) {
|
164 |
-
notice.remove();
|
165 |
-
}
|
166 |
-
|
167 |
-
// success
|
168 |
-
if( acf.isAjaxSuccess(json) ) {
|
169 |
-
|
170 |
-
// clear name
|
171 |
-
$name.val('');
|
172 |
-
|
173 |
-
// update term lists
|
174 |
-
step5( json.data );
|
175 |
-
|
176 |
-
// notice
|
177 |
-
notice = acf.newNotice({
|
178 |
-
type: 'success',
|
179 |
-
text: acf.getAjaxMessage(json),
|
180 |
-
target: $form,
|
181 |
-
timeout: 2000,
|
182 |
-
dismiss: false
|
183 |
-
});
|
184 |
-
|
185 |
-
} else {
|
186 |
-
|
187 |
-
// notice
|
188 |
-
notice = acf.newNotice({
|
189 |
-
type: 'error',
|
190 |
-
text: acf.getAjaxError(json),
|
191 |
-
target: $form,
|
192 |
-
timeout: 2000,
|
193 |
-
dismiss: false
|
194 |
-
});
|
195 |
-
}
|
196 |
-
|
197 |
-
// focus
|
198 |
-
$name.focus();
|
199 |
-
};
|
200 |
-
|
201 |
-
// step 5.
|
202 |
-
var step5 = function( term ){
|
203 |
-
|
204 |
-
// update parent dropdown
|
205 |
-
var $option = $('<option value="' + term.term_id + '">' + term.term_label + '</option>');
|
206 |
-
if( term.term_parent ) {
|
207 |
-
$parent.children('option[value="' + term.term_parent + '"]').after( $option );
|
208 |
-
} else {
|
209 |
-
$parent.append( $option );
|
210 |
-
}
|
211 |
-
|
212 |
-
// add this new term to all taxonomy field
|
213 |
-
var fields = acf.getFields({
|
214 |
-
type: 'taxonomy'
|
215 |
-
});
|
216 |
-
|
217 |
-
fields.map(function( otherField ){
|
218 |
-
if( otherField.get('taxonomy') == field.get('taxonomy') ) {
|
219 |
-
otherField.appendTerm( term );
|
220 |
-
}
|
221 |
-
});
|
222 |
-
|
223 |
-
// select
|
224 |
-
field.selectTerm( term.term_id );
|
225 |
-
};
|
226 |
-
|
227 |
-
// run
|
228 |
-
step1();
|
229 |
-
},
|
230 |
-
|
231 |
-
appendTerm: function( term ){
|
232 |
-
|
233 |
-
if( this.getRelatedType() == 'select' ) {
|
234 |
-
this.appendTermSelect( term );
|
235 |
-
} else {
|
236 |
-
this.appendTermCheckbox( term );
|
237 |
-
}
|
238 |
-
},
|
239 |
-
|
240 |
-
appendTermSelect: function( term ){
|
241 |
-
|
242 |
-
this.select2.addOption({
|
243 |
-
id: term.term_id,
|
244 |
-
text: term.term_label
|
245 |
-
});
|
246 |
-
|
247 |
-
},
|
248 |
-
|
249 |
-
appendTermCheckbox: function( term ){
|
250 |
-
|
251 |
-
// vars
|
252 |
-
var name = this.$('[name]:first').attr('name');
|
253 |
-
var $ul = this.$('ul:first');
|
254 |
-
|
255 |
-
// allow multiple selection
|
256 |
-
if( this.getRelatedType() == 'checkbox' ) {
|
257 |
-
name += '[]';
|
258 |
-
}
|
259 |
-
|
260 |
-
// create new li
|
261 |
-
var $li = $([
|
262 |
-
'<li data-id="' + term.term_id + '">',
|
263 |
-
'<label>',
|
264 |
-
'<input type="' + this.get('ftype') + '" value="' + term.term_id + '" name="' + name + '" /> ',
|
265 |
-
'<span>' + term.term_name + '</span>',
|
266 |
-
'</label>',
|
267 |
-
'</li>'
|
268 |
-
].join(''));
|
269 |
-
|
270 |
-
// find parent
|
271 |
-
if( term.term_parent ) {
|
272 |
-
|
273 |
-
// vars
|
274 |
-
var $parent = $ul.find('li[data-id="' + term.term_parent + '"]');
|
275 |
-
|
276 |
-
// update vars
|
277 |
-
$ul = $parent.children('ul');
|
278 |
-
|
279 |
-
// create ul
|
280 |
-
if( !$ul.exists() ) {
|
281 |
-
$ul = $('<ul class="children acf-bl"></ul>');
|
282 |
-
$parent.append( $ul );
|
283 |
-
}
|
284 |
-
}
|
285 |
-
|
286 |
-
// append
|
287 |
-
$ul.append( $li );
|
288 |
-
},
|
289 |
-
|
290 |
-
selectTerm: function( id ){
|
291 |
-
if( this.getRelatedType() == 'select' ) {
|
292 |
-
this.select2.selectOption( id );
|
293 |
-
} else {
|
294 |
-
var $input = this.$('input[value="' + id + '"]');
|
295 |
-
$input.prop('checked', true).trigger('change');
|
296 |
-
}
|
297 |
-
},
|
298 |
-
|
299 |
-
onClickRadio: function( e, $el ){
|
300 |
-
|
301 |
-
// vars
|
302 |
-
var $label = $el.parent('label');
|
303 |
-
var selected = $label.hasClass('selected');
|
304 |
-
|
305 |
-
// remove previous selected
|
306 |
-
this.$('.selected').removeClass('selected');
|
307 |
-
|
308 |
-
// add active class
|
309 |
-
$label.addClass('selected');
|
310 |
-
|
311 |
-
// allow null
|
312 |
-
if( this.get('allow_null') && selected ) {
|
313 |
-
$label.removeClass('selected');
|
314 |
-
$el.prop('checked', false).trigger('change');
|
315 |
-
}
|
316 |
-
}
|
317 |
-
});
|
318 |
-
|
319 |
-
acf.registerFieldType( Field );
|
320 |
-
|
321 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/build/js/_acf-field-time-picker.js
DELETED
@@ -1,77 +0,0 @@
|
|
1 |
-
(function($, undefined){
|
2 |
-
|
3 |
-
var Field = acf.models.DatePickerField.extend({
|
4 |
-
|
5 |
-
type: 'time_picker',
|
6 |
-
|
7 |
-
$control: function(){
|
8 |
-
return this.$('.acf-time-picker');
|
9 |
-
},
|
10 |
-
|
11 |
-
initialize: function(){
|
12 |
-
|
13 |
-
// vars
|
14 |
-
var $input = this.$input();
|
15 |
-
var $inputText = this.$inputText();
|
16 |
-
|
17 |
-
// args
|
18 |
-
var args = {
|
19 |
-
timeFormat: this.get('time_format'),
|
20 |
-
altField: $input,
|
21 |
-
altFieldTimeOnly: false,
|
22 |
-
altTimeFormat: 'HH:mm:ss',
|
23 |
-
showButtonPanel: true,
|
24 |
-
controlType: 'select',
|
25 |
-
oneLine: true,
|
26 |
-
closeText: acf.get('dateTimePickerL10n').selectText,
|
27 |
-
timeOnly: true,
|
28 |
-
};
|
29 |
-
|
30 |
-
// add custom 'Close = Select' functionality
|
31 |
-
args.onClose = function( value, dp_instance, t_instance ){
|
32 |
-
|
33 |
-
// vars
|
34 |
-
var $close = dp_instance.dpDiv.find('.ui-datepicker-close');
|
35 |
-
|
36 |
-
// if clicking close button
|
37 |
-
if( !value && $close.is(':hover') ) {
|
38 |
-
t_instance._updateDateTime();
|
39 |
-
}
|
40 |
-
};
|
41 |
-
|
42 |
-
|
43 |
-
// filter
|
44 |
-
args = acf.applyFilters('time_picker_args', args, this);
|
45 |
-
|
46 |
-
// add date time picker
|
47 |
-
acf.newTimePicker( $inputText, args );
|
48 |
-
|
49 |
-
// action
|
50 |
-
acf.doAction('time_picker_init', $inputText, args, this);
|
51 |
-
}
|
52 |
-
});
|
53 |
-
|
54 |
-
acf.registerFieldType( Field );
|
55 |
-
|
56 |
-
|
57 |
-
// add
|
58 |
-
acf.newTimePicker = function( $input, args ){
|
59 |
-
|
60 |
-
// bail ealry if no datepicker library
|
61 |
-
if( typeof $.timepicker === 'undefined' ) {
|
62 |
-
return false;
|
63 |
-
}
|
64 |
-
|
65 |
-
// defaults
|
66 |
-
args = args || {};
|
67 |
-
|
68 |
-
// initialize
|
69 |
-
$input.timepicker( args );
|
70 |
-
|
71 |
-
// wrap the datepicker (only if it hasn't already been wrapped)
|
72 |
-
if( $('body > #ui-datepicker-div').exists() ) {
|
73 |
-
$('body > #ui-datepicker-div').wrap('<div class="acf-ui-datepicker" />');
|
74 |
-
}
|
75 |
-
};
|
76 |
-
|
77 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/build/js/_acf-field-true-false.js
DELETED
@@ -1,95 +0,0 @@
|
|
1 |
-
(function($, undefined){
|
2 |
-
|
3 |
-
var Field = acf.Field.extend({
|
4 |
-
|
5 |
-
type: 'true_false',
|
6 |
-
|
7 |
-
events: {
|
8 |
-
'change .acf-switch-input': 'onChange',
|
9 |
-
'focus .acf-switch-input': 'onFocus',
|
10 |
-
'blur .acf-switch-input': 'onBlur',
|
11 |
-
'keypress .acf-switch-input': 'onKeypress'
|
12 |
-
},
|
13 |
-
|
14 |
-
$input: function(){
|
15 |
-
return this.$('input[type="checkbox"]');
|
16 |
-
},
|
17 |
-
|
18 |
-
$switch: function(){
|
19 |
-
return this.$('.acf-switch');
|
20 |
-
},
|
21 |
-
|
22 |
-
getValue: function(){
|
23 |
-
return this.$input().prop('checked') ? 1 : 0;
|
24 |
-
},
|
25 |
-
|
26 |
-
initialize: function(){
|
27 |
-
this.render();
|
28 |
-
},
|
29 |
-
|
30 |
-
render: function(){
|
31 |
-
|
32 |
-
// vars
|
33 |
-
var $switch = this.$switch();
|
34 |
-
|
35 |
-
// bail ealry if no $switch
|
36 |
-
if( !$switch.length ) return;
|
37 |
-
|
38 |
-
// vars
|
39 |
-
var $on = $switch.children('.acf-switch-on');
|
40 |
-
var $off = $switch.children('.acf-switch-off');
|
41 |
-
var width = Math.max( $on.width(), $off.width() );
|
42 |
-
|
43 |
-
// bail ealry if no width
|
44 |
-
if( !width ) return;
|
45 |
-
|
46 |
-
// set widths
|
47 |
-
$on.css( 'min-width', width );
|
48 |
-
$off.css( 'min-width', width );
|
49 |
-
|
50 |
-
},
|
51 |
-
|
52 |
-
switchOn: function() {
|
53 |
-
this.$input().prop('checked', true);
|
54 |
-
this.$switch().addClass('-on');
|
55 |
-
},
|
56 |
-
|
57 |
-
switchOff: function() {
|
58 |
-
this.$input().prop('checked', false);
|
59 |
-
this.$switch().removeClass('-on');
|
60 |
-
},
|
61 |
-
|
62 |
-
onChange: function( e, $el ){
|
63 |
-
if( $el.prop('checked') ) {
|
64 |
-
this.switchOn();
|
65 |
-
} else {
|
66 |
-
this.switchOff();
|
67 |
-
}
|
68 |
-
},
|
69 |
-
|
70 |
-
onFocus: function( e, $el ){
|
71 |
-
this.$switch().addClass('-focus');
|
72 |
-
},
|
73 |
-
|
74 |
-
onBlur: function( e, $el ){
|
75 |
-
this.$switch().removeClass('-focus');
|
76 |
-
},
|
77 |
-
|
78 |
-
onKeypress: function( e, $el ){
|
79 |
-
|
80 |
-
// left
|
81 |
-
if( e.keyCode === 37 ) {
|
82 |
-
return this.switchOff();
|
83 |
-
}
|
84 |
-
|
85 |
-
// right
|
86 |
-
if( e.keyCode === 39 ) {
|
87 |
-
return this.switchOn();
|
88 |
-
}
|
89 |
-
|
90 |
-
}
|
91 |
-
});
|
92 |
-
|
93 |
-
acf.registerFieldType( Field );
|
94 |
-
|
95 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/build/js/_acf-field-url.js
DELETED
@@ -1,64 +0,0 @@
|
|
1 |
-
(function($, undefined){
|
2 |
-
|
3 |
-
var Field = acf.Field.extend({
|
4 |
-
|
5 |
-
type: 'url',
|
6 |
-
|
7 |
-
events: {
|
8 |
-
'keyup input[type="url"]': 'onkeyup'
|
9 |
-
},
|
10 |
-
|
11 |
-
$control: function(){
|
12 |
-
return this.$('.acf-input-wrap');
|
13 |
-
},
|
14 |
-
|
15 |
-
$input: function(){
|
16 |
-
return this.$('input[type="url"]');
|
17 |
-
},
|
18 |
-
|
19 |
-
initialize: function(){
|
20 |
-
this.render();
|
21 |
-
},
|
22 |
-
|
23 |
-
isValid: function(){
|
24 |
-
|
25 |
-
// vars
|
26 |
-
var val = this.val();
|
27 |
-
|
28 |
-
// bail early if no val
|
29 |
-
if( !val ) {
|
30 |
-
return false;
|
31 |
-
}
|
32 |
-
|
33 |
-
// url
|
34 |
-
if( val.indexOf('://') !== -1 ) {
|
35 |
-
return true;
|
36 |
-
}
|
37 |
-
|
38 |
-
// protocol relative url
|
39 |
-
if( val.indexOf('//') === 0 ) {
|
40 |
-
return true;
|
41 |
-
}
|
42 |
-
|
43 |
-
// return
|
44 |
-
return false;
|
45 |
-
},
|
46 |
-
|
47 |
-
render: function(){
|
48 |
-
|
49 |
-
// add class
|
50 |
-
if( this.isValid() ) {
|
51 |
-
this.$control().addClass('-valid');
|
52 |
-
} else {
|
53 |
-
this.$control().removeClass('-valid');
|
54 |
-
}
|
55 |
-
},
|
56 |
-
|
57 |
-
onkeyup: function( e, $el ){
|
58 |
-
this.render();
|
59 |
-
}
|
60 |
-
});
|
61 |
-
|
62 |
-
acf.registerFieldType( Field );
|
63 |
-
|
64 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/build/js/_acf-field-user.js
DELETED
@@ -1,9 +0,0 @@
|
|
1 |
-
(function($, undefined){
|
2 |
-
|
3 |
-
var Field = acf.models.SelectField.extend({
|
4 |
-
type: 'user',
|
5 |
-
});
|
6 |
-
|
7 |
-
acf.registerFieldType( Field );
|
8 |
-
|
9 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/build/js/_acf-field-wysiwyg.js
DELETED
@@ -1,102 +0,0 @@
|
|
1 |
-
(function($, undefined){
|
2 |
-
|
3 |
-
var Field = acf.Field.extend({
|
4 |
-
|
5 |
-
type: 'wysiwyg',
|
6 |
-
|
7 |
-
wait: 'load',
|
8 |
-
|
9 |
-
events: {
|
10 |
-
'mousedown .acf-editor-wrap.delay': 'onMousedown',
|
11 |
-
'unmountField': 'disableEditor',
|
12 |
-
'remountField': 'enableEditor',
|
13 |
-
'removeField': 'disableEditor'
|
14 |
-
},
|
15 |
-
|
16 |
-
$control: function(){
|
17 |
-
return this.$('.acf-editor-wrap');
|
18 |
-
},
|
19 |
-
|
20 |
-
$input: function(){
|
21 |
-
return this.$('textarea');
|
22 |
-
},
|
23 |
-
|
24 |
-
getMode: function(){
|
25 |
-
return this.$control().hasClass('tmce-active') ? 'visual' : 'text';
|
26 |
-
},
|
27 |
-
|
28 |
-
initialize: function(){
|
29 |
-
|
30 |
-
// initializeEditor if no delay
|
31 |
-
if( !this.$control().hasClass('delay') ) {
|
32 |
-
this.initializeEditor();
|
33 |
-
}
|
34 |
-
},
|
35 |
-
|
36 |
-
initializeEditor: function(){
|
37 |
-
|
38 |
-
// vars
|
39 |
-
var $wrap = this.$control();
|
40 |
-
var $textarea = this.$input();
|
41 |
-
var args = {
|
42 |
-
tinymce: true,
|
43 |
-
quicktags: true,
|
44 |
-
toolbar: this.get('toolbar'),
|
45 |
-
mode: this.getMode(),
|
46 |
-
field: this
|
47 |
-
};
|
48 |
-
|
49 |
-
// generate new id
|
50 |
-
var oldId = $textarea.attr('id');
|
51 |
-
var newId = acf.uniqueId('acf-editor-');
|
52 |
-
|
53 |
-
// store copy of textarea data
|
54 |
-
var data = $textarea.data();
|
55 |
-
|
56 |
-
// rename
|
57 |
-
acf.rename({
|
58 |
-
target: $wrap,
|
59 |
-
search: oldId,
|
60 |
-
replace: newId,
|
61 |
-
destructive: true
|
62 |
-
});
|
63 |
-
|
64 |
-
// update id
|
65 |
-
this.set('id', newId, true);
|
66 |
-
|
67 |
-
// initialize
|
68 |
-
acf.tinymce.initialize( newId, args );
|
69 |
-
|
70 |
-
// apply data to new textarea (acf.rename creates a new textarea element due to destructive mode)
|
71 |
-
// fixes bug where conditional logic "disabled" is lost during "screen_check"
|
72 |
-
this.$input().data(data);
|
73 |
-
},
|
74 |
-
|
75 |
-
onMousedown: function( e ){
|
76 |
-
|
77 |
-
// prevent default
|
78 |
-
e.preventDefault();
|
79 |
-
|
80 |
-
// remove delay class
|
81 |
-
var $wrap = this.$control();
|
82 |
-
$wrap.removeClass('delay');
|
83 |
-
$wrap.find('.acf-editor-toolbar').remove();
|
84 |
-
|
85 |
-
// initialize
|
86 |
-
this.initializeEditor();
|
87 |
-
},
|
88 |
-
|
89 |
-
enableEditor: function(){
|
90 |
-
if( this.getMode() == 'visual' ) {
|
91 |
-
acf.tinymce.enable( this.get('id') );
|
92 |
-
}
|
93 |
-
},
|
94 |
-
|
95 |
-
disableEditor: function(){
|
96 |
-
acf.tinymce.destroy( this.get('id') );
|
97 |
-
}
|
98 |
-
});
|
99 |
-
|
100 |
-
acf.registerFieldType( Field );
|
101 |
-
|
102 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/build/js/_acf-field.js
DELETED
@@ -1,524 +0,0 @@
|
|
1 |
-
(function($, undefined){
|
2 |
-
|
3 |
-
// vars
|
4 |
-
var storage = [];
|
5 |
-
|
6 |
-
/**
|
7 |
-
* acf.Field
|
8 |
-
*
|
9 |
-
* description
|
10 |
-
*
|
11 |
-
* @date 23/3/18
|
12 |
-
* @since 5.6.9
|
13 |
-
*
|
14 |
-
* @param type $var Description. Default.
|
15 |
-
* @return type Description.
|
16 |
-
*/
|
17 |
-
|
18 |
-
acf.Field = acf.Model.extend({
|
19 |
-
|
20 |
-
// field type
|
21 |
-
type: '',
|
22 |
-
|
23 |
-
// class used to avoid nested event triggers
|
24 |
-
eventScope: '.acf-field',
|
25 |
-
|
26 |
-
// initialize events on 'ready'
|
27 |
-
wait: 'ready',
|
28 |
-
|
29 |
-
/**
|
30 |
-
* setup
|
31 |
-
*
|
32 |
-
* Called during the constructor function to setup this field ready for initialization
|
33 |
-
*
|
34 |
-
* @date 8/5/18
|
35 |
-
* @since 5.6.9
|
36 |
-
*
|
37 |
-
* @param jQuery $field The field element.
|
38 |
-
* @return void
|
39 |
-
*/
|
40 |
-
|
41 |
-
setup: function( $field ){
|
42 |
-
|
43 |
-
// set $el
|
44 |
-
this.$el = $field;
|
45 |
-
|
46 |
-
// inherit $field data
|
47 |
-
this.inherit( $field );
|
48 |
-
|
49 |
-
// inherit controll data
|
50 |
-
this.inherit( this.$control() );
|
51 |
-
},
|
52 |
-
|
53 |
-
/**
|
54 |
-
* val
|
55 |
-
*
|
56 |
-
* Sets or returns the field's value
|
57 |
-
*
|
58 |
-
* @date 8/5/18
|
59 |
-
* @since 5.6.9
|
60 |
-
*
|
61 |
-
* @param mixed val Optional. The value to set
|
62 |
-
* @return mixed
|
63 |
-
*/
|
64 |
-
|
65 |
-
val: function( val ){
|
66 |
-
if( val !== undefined ) {
|
67 |
-
return this.setValue( val );
|
68 |
-
} else {
|
69 |
-
return this.prop('disabled') ? null : this.getValue();
|
70 |
-
}
|
71 |
-
},
|
72 |
-
|
73 |
-
/**
|
74 |
-
* getValue
|
75 |
-
*
|
76 |
-
* returns the field's value
|
77 |
-
*
|
78 |
-
* @date 8/5/18
|
79 |
-
* @since 5.6.9
|
80 |
-
*
|
81 |
-
* @param void
|
82 |
-
* @return mixed
|
83 |
-
*/
|
84 |
-
|
85 |
-
getValue: function(){
|
86 |
-
return this.$input().val();
|
87 |
-
},
|
88 |
-
|
89 |
-
/**
|
90 |
-
* setValue
|
91 |
-
*
|
92 |
-
* sets the field's value and returns true if changed
|
93 |
-
*
|
94 |
-
* @date 8/5/18
|
95 |
-
* @since 5.6.9
|
96 |
-
*
|
97 |
-
* @param mixed val
|
98 |
-
* @return boolean. True if changed.
|
99 |
-
*/
|
100 |
-
|
101 |
-
setValue: function( val ){
|
102 |
-
return acf.val( this.$input(), val );
|
103 |
-
},
|
104 |
-
|
105 |
-
/**
|
106 |
-
* __
|
107 |
-
*
|
108 |
-
* i18n helper to be removed
|
109 |
-
*
|
110 |
-
* @date 8/5/18
|
111 |
-
* @since 5.6.9
|
112 |
-
*
|
113 |
-
* @param type $var Description. Default.
|
114 |
-
* @return type Description.
|
115 |
-
*/
|
116 |
-
|
117 |
-
__: function( string ){
|
118 |
-
return acf._e( this.type, string );
|
119 |
-
},
|
120 |
-
|
121 |
-
/**
|
122 |
-
* $control
|
123 |
-
*
|
124 |
-
* returns the control jQuery element used for inheriting data. Uses this.control setting.
|
125 |
-
*
|
126 |
-
* @date 8/5/18
|
127 |
-
* @since 5.6.9
|
128 |
-
*
|
129 |
-
* @param void
|
130 |
-
* @return jQuery
|
131 |
-
*/
|
132 |
-
|
133 |
-
$control: function(){
|
134 |
-
return false;
|
135 |
-
},
|
136 |
-
|
137 |
-
/**
|
138 |
-
* $input
|
139 |
-
*
|
140 |
-
* returns the input jQuery element used for saving values. Uses this.input setting.
|
141 |
-
*
|
142 |
-
* @date 8/5/18
|
143 |
-
* @since 5.6.9
|
144 |
-
*
|
145 |
-
* @param void
|
146 |
-
* @return jQuery
|
147 |
-
*/
|
148 |
-
|
149 |
-
$input: function(){
|
150 |
-
return this.$('[name]:first');
|
151 |
-
},
|
152 |
-
|
153 |
-
/**
|
154 |
-
* $inputWrap
|
155 |
-
*
|
156 |
-
* description
|
157 |
-
*
|
158 |
-
* @date 12/5/18
|
159 |
-
* @since 5.6.9
|
160 |
-
*
|
161 |
-
* @param type $var Description. Default.
|
162 |
-
* @return type Description.
|
163 |
-
*/
|
164 |
-
|
165 |
-
$inputWrap: function(){
|
166 |
-
return this.$('.acf-input:first');
|
167 |
-
},
|
168 |
-
|
169 |
-
/**
|
170 |
-
* $inputWrap
|
171 |
-
*
|
172 |
-
* description
|
173 |
-
*
|
174 |
-
* @date 12/5/18
|
175 |
-
* @since 5.6.9
|
176 |
-
*
|
177 |
-
* @param type $var Description. Default.
|
178 |
-
* @return type Description.
|
179 |
-
*/
|
180 |
-
|
181 |
-
$labelWrap: function(){
|
182 |
-
return this.$('.acf-label:first');
|
183 |
-
},
|
184 |
-
|
185 |
-
/**
|
186 |
-
* getInputName
|
187 |
-
*
|
188 |
-
* Returns the field's input name
|
189 |
-
*
|
190 |
-
* @date 8/5/18
|
191 |
-
* @since 5.6.9
|
192 |
-
*
|
193 |
-
* @param void
|
194 |
-
* @return string
|
195 |
-
*/
|
196 |
-
|
197 |
-
getInputName: function(){
|
198 |
-
return this.$input().attr('name') || '';
|
199 |
-
},
|
200 |
-
|
201 |
-
/**
|
202 |
-
* parent
|
203 |
-
*
|
204 |
-
* returns the field's parent field or false on failure.
|
205 |
-
*
|
206 |
-
* @date 8/5/18
|
207 |
-
* @since 5.6.9
|
208 |
-
*
|
209 |
-
* @param void
|
210 |
-
* @return object|false
|
211 |
-
*/
|
212 |
-
|
213 |
-
parent: function() {
|
214 |
-
|
215 |
-
// vars
|
216 |
-
var parents = this.parents();
|
217 |
-
|
218 |
-
// return
|
219 |
-
return parents.length ? parents[0] : false;
|
220 |
-
},
|
221 |
-
|
222 |
-
/**
|
223 |
-
* parents
|
224 |
-
*
|
225 |
-
* description
|
226 |
-
*
|
227 |
-
* @date 9/7/18
|
228 |
-
* @since 5.6.9
|
229 |
-
*
|
230 |
-
* @param type $var Description. Default.
|
231 |
-
* @return type Description.
|
232 |
-
*/
|
233 |
-
|
234 |
-
parents: function(){
|
235 |
-
|
236 |
-
// vars
|
237 |
-
var $parents = this.$el.parents('.acf-field');
|
238 |
-
|
239 |
-
// convert
|
240 |
-
var parents = acf.getFields( $parents );
|
241 |
-
|
242 |
-
// return
|
243 |
-
return parents;
|
244 |
-
},
|
245 |
-
|
246 |
-
show: function( lockKey, context ){
|
247 |
-
|
248 |
-
// show field and store result
|
249 |
-
var changed = acf.show( this.$el, lockKey );
|
250 |
-
|
251 |
-
// do action if visibility has changed
|
252 |
-
if( changed ) {
|
253 |
-
this.prop('hidden', false);
|
254 |
-
acf.doAction('show_field', this, context);
|
255 |
-
}
|
256 |
-
|
257 |
-
// return
|
258 |
-
return changed;
|
259 |
-
},
|
260 |
-
|
261 |
-
hide: function( lockKey, context ){
|
262 |
-
|
263 |
-
// hide field and store result
|
264 |
-
var changed = acf.hide( this.$el, lockKey );
|
265 |
-
|
266 |
-
// do action if visibility has changed
|
267 |
-
if( changed ) {
|
268 |
-
this.prop('hidden', true);
|
269 |
-
acf.doAction('hide_field', this, context);
|
270 |
-
}
|
271 |
-
|
272 |
-
// return
|
273 |
-
return changed;
|
274 |
-
},
|
275 |
-
|
276 |
-
enable: function( lockKey, context ){
|
277 |
-
|
278 |
-
// enable field and store result
|
279 |
-
var changed = acf.enable( this.$el, lockKey );
|
280 |
-
|
281 |
-
// do action if disabled has changed
|
282 |
-
if( changed ) {
|
283 |
-
this.prop('disabled', false);
|
284 |
-
acf.doAction('enable_field', this, context);
|
285 |
-
}
|
286 |
-
|
287 |
-
// return
|
288 |
-
return changed;
|
289 |
-
},
|
290 |
-
|
291 |
-
disable: function( lockKey, context ){
|
292 |
-
|
293 |
-
// disabled field and store result
|
294 |
-
var changed = acf.disable( this.$el, lockKey );
|
295 |
-
|
296 |
-
// do action if disabled has changed
|
297 |
-
if( changed ) {
|
298 |
-
this.prop('disabled', true);
|
299 |
-
acf.doAction('disable_field', this, context);
|
300 |
-
}
|
301 |
-
|
302 |
-
// return
|
303 |
-
return changed;
|
304 |
-
},
|
305 |
-
|
306 |
-
showEnable: function( lockKey, context ){
|
307 |
-
|
308 |
-
// enable
|
309 |
-
this.enable.apply(this, arguments);
|
310 |
-
|
311 |
-
// show and return true if changed
|
312 |
-
return this.show.apply(this, arguments);
|
313 |
-
},
|
314 |
-
|
315 |
-
hideDisable: function( lockKey, context ){
|
316 |
-
|
317 |
-
// disable
|
318 |
-
this.disable.apply(this, arguments);
|
319 |
-
|
320 |
-
// hide and return true if changed
|
321 |
-
return this.hide.apply(this, arguments);
|
322 |
-
},
|
323 |
-
|
324 |
-
showNotice: function( props ){
|
325 |
-
|
326 |
-
// ensure object
|
327 |
-
if( typeof props !== 'object' ) {
|
328 |
-
props = { text: props };
|
329 |
-
}
|
330 |
-
|
331 |
-
// remove old notice
|
332 |
-
if( this.notice ) {
|
333 |
-
this.notice.remove();
|
334 |
-
}
|
335 |
-
|
336 |
-
// create new notice
|
337 |
-
props.target = this.$inputWrap();
|
338 |
-
this.notice = acf.newNotice( props );
|
339 |
-
},
|
340 |
-
|
341 |
-
removeNotice: function( timeout ){
|
342 |
-
if( this.notice ) {
|
343 |
-
this.notice.away( timeout || 0 );
|
344 |
-
this.notice = false;
|
345 |
-
}
|
346 |
-
},
|
347 |
-
|
348 |
-
showError: function( message ){
|
349 |
-
|
350 |
-
// add class
|
351 |
-
this.$el.addClass('acf-error');
|
352 |
-
|
353 |
-
// add message
|
354 |
-
if( message !== undefined ) {
|
355 |
-
this.showNotice({
|
356 |
-
text: message,
|
357 |
-
type: 'error',
|
358 |
-
dismiss: false
|
359 |
-
});
|
360 |
-
}
|
361 |
-
|
362 |
-
// action
|
363 |
-
acf.doAction('invalid_field', this);
|
364 |
-
|
365 |
-
// add event
|
366 |
-
this.$el.one('focus change', 'input, select, textarea', $.proxy( this.removeError, this ));
|
367 |
-
},
|
368 |
-
|
369 |
-
removeError: function(){
|
370 |
-
|
371 |
-
// remove class
|
372 |
-
this.$el.removeClass('acf-error');
|
373 |
-
|
374 |
-
// remove notice
|
375 |
-
this.removeNotice( 250 );
|
376 |
-
|
377 |
-
// action
|
378 |
-
acf.doAction('valid_field', this);
|
379 |
-
},
|
380 |
-
|
381 |
-
trigger: function( name, args, bubbles ){
|
382 |
-
|
383 |
-
// allow some events to bubble
|
384 |
-
if( name == 'invalidField' ) {
|
385 |
-
bubbles = true;
|
386 |
-
}
|
387 |
-
|
388 |
-
// return
|
389 |
-
return acf.Model.prototype.trigger.apply(this, [name, args, bubbles]);
|
390 |
-
},
|
391 |
-
});
|
392 |
-
|
393 |
-
/**
|
394 |
-
* newField
|
395 |
-
*
|
396 |
-
* description
|
397 |
-
*
|
398 |
-
* @date 14/12/17
|
399 |
-
* @since 5.6.5
|
400 |
-
*
|
401 |
-
* @param type $var Description. Default.
|
402 |
-
* @return type Description.
|
403 |
-
*/
|
404 |
-
|
405 |
-
acf.newField = function( $field ){
|
406 |
-
|
407 |
-
// vars
|
408 |
-
var type = $field.data('type');
|
409 |
-
var mid = modelId( type );
|
410 |
-
var model = acf.models[ mid ] || acf.Field;
|
411 |
-
|
412 |
-
// instantiate
|
413 |
-
var field = new model( $field );
|
414 |
-
|
415 |
-
// actions
|
416 |
-
acf.doAction('new_field', field);
|
417 |
-
|
418 |
-
// return
|
419 |
-
return field;
|
420 |
-
};
|
421 |
-
|
422 |
-
/**
|
423 |
-
* mid
|
424 |
-
*
|
425 |
-
* Calculates the model ID for a field type
|
426 |
-
*
|
427 |
-
* @date 15/12/17
|
428 |
-
* @since 5.6.5
|
429 |
-
*
|
430 |
-
* @param string type
|
431 |
-
* @return string
|
432 |
-
*/
|
433 |
-
|
434 |
-
var modelId = function( type ) {
|
435 |
-
return acf.strPascalCase( type || '' ) + 'Field';
|
436 |
-
};
|
437 |
-
|
438 |
-
/**
|
439 |
-
* registerFieldType
|
440 |
-
*
|
441 |
-
* description
|
442 |
-
*
|
443 |
-
* @date 14/12/17
|
444 |
-
* @since 5.6.5
|
445 |
-
*
|
446 |
-
* @param type $var Description. Default.
|
447 |
-
* @return type Description.
|
448 |
-
*/
|
449 |
-
|
450 |
-
acf.registerFieldType = function( model ){
|
451 |
-
|
452 |
-
// vars
|
453 |
-
var proto = model.prototype;
|
454 |
-
var type = proto.type;
|
455 |
-
var mid = modelId( type );
|
456 |
-
|
457 |
-
// store model
|
458 |
-
acf.models[ mid ] = model;
|
459 |
-
|
460 |
-
// store reference
|
461 |
-
storage.push( type );
|
462 |
-
};
|
463 |
-
|
464 |
-
/**
|
465 |
-
* acf.getFieldType
|
466 |
-
*
|
467 |
-
* description
|
468 |
-
*
|
469 |
-
* @date 1/2/18
|
470 |
-
* @since 5.6.5
|
471 |
-
*
|
472 |
-
* @param type $var Description. Default.
|
473 |
-
* @return type Description.
|
474 |
-
*/
|
475 |
-
|
476 |
-
acf.getFieldType = function( type ){
|
477 |
-
var mid = modelId( type );
|
478 |
-
return acf.models[ mid ] || false;
|
479 |
-
}
|
480 |
-
|
481 |
-
/**
|
482 |
-
* acf.getFieldTypes
|
483 |
-
*
|
484 |
-
* description
|
485 |
-
*
|
486 |
-
* @date 1/2/18
|
487 |
-
* @since 5.6.5
|
488 |
-
*
|
489 |
-
* @param type $var Description. Default.
|
490 |
-
* @return type Description.
|
491 |
-
*/
|
492 |
-
|
493 |
-
acf.getFieldTypes = function( args ){
|
494 |
-
|
495 |
-
// defaults
|
496 |
-
args = acf.parseArgs(args, {
|
497 |
-
category: '',
|
498 |
-
// hasValue: true
|
499 |
-
});
|
500 |
-
|
501 |
-
// clonse available types
|
502 |
-
var types = [];
|
503 |
-
|
504 |
-
// loop
|
505 |
-
storage.map(function( type ){
|
506 |
-
|
507 |
-
// vars
|
508 |
-
var model = acf.getFieldType(type);
|
509 |
-
var proto = model.prototype;
|
510 |
-
|
511 |
-
// check operator
|
512 |
-
if( args.category && proto.category !== args.category ) {
|
513 |
-
return;
|
514 |
-
}
|
515 |
-
|
516 |
-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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/build/js/_acf-fields.js
DELETED
@@ -1,372 +0,0 @@
|
|
1 |
-
(function($, undefined){
|
2 |
-
|
3 |
-
/**
|
4 |
-
* findFields
|
5 |
-
*
|
6 |
-
* Returns a jQuery selection object of acf fields.
|
7 |
-
*
|
8 |
-
* @date 14/12/17
|
9 |
-
* @since 5.6.5
|
10 |
-
*
|
11 |
-
* @param object $args {
|
12 |
-
* Optional. Arguments to find fields.
|
13 |
-
*
|
14 |
-
* @type string key The field's key (data-attribute).
|
15 |
-
* @type string name The field's name (data-attribute).
|
16 |
-
* @type string type The field's type (data-attribute).
|
17 |
-
* @type string is jQuery selector to compare against.
|
18 |
-
* @type jQuery parent jQuery element to search within.
|
19 |
-
* @type jQuery sibling jQuery element to search alongside.
|
20 |
-
* @type limit int The number of fields to find.
|
21 |
-
* @type suppressFilters bool Whether to allow filters to add/remove results. Default behaviour will ignore clone fields.
|
22 |
-
* }
|
23 |
-
* @return jQuery
|
24 |
-
*/
|
25 |
-
|
26 |
-
acf.findFields = function( args ){
|
27 |
-
|
28 |
-
// vars
|
29 |
-
var selector = '.acf-field';
|
30 |
-
var $fields = false;
|
31 |
-
|
32 |
-
// args
|
33 |
-
args = acf.parseArgs(args, {
|
34 |
-
key: '',
|
35 |
-
name: '',
|
36 |
-
type: '',
|
37 |
-
is: '',
|
38 |
-
parent: false,
|
39 |
-
sibling: false,
|
40 |
-
limit: false,
|
41 |
-
visible: false,
|
42 |
-
suppressFilters: false,
|
43 |
-
});
|
44 |
-
|
45 |
-
// filter args
|
46 |
-
if( !args.suppressFilters ) {
|
47 |
-
args = acf.applyFilters('find_fields_args', args);
|
48 |
-
}
|
49 |
-
|
50 |
-
// key
|
51 |
-
if( args.key ) {
|
52 |
-
selector += '[data-key="' + args.key + '"]';
|
53 |
-
}
|
54 |
-
|
55 |
-
// type
|
56 |
-
if( args.type ) {
|
57 |
-
selector += '[data-type="' + args.type + '"]';
|
58 |
-
}
|
59 |
-
|
60 |
-
// name
|
61 |
-
if( args.name ) {
|
62 |
-
selector += '[data-name="' + args.name + '"]';
|
63 |
-
}
|
64 |
-
|
65 |
-
// is
|
66 |
-
if( args.is ) {
|
67 |
-
selector += args.is;
|
68 |
-
}
|
69 |
-
|
70 |
-
// visibility
|
71 |
-
if( args.visible ) {
|
72 |
-
selector += ':visible';
|
73 |
-
}
|
74 |
-
|
75 |
-
// query
|
76 |
-
if( args.parent ) {
|
77 |
-
$fields = args.parent.find( selector );
|
78 |
-
} else if( args.sibling ) {
|
79 |
-
$fields = args.sibling.siblings( selector );
|
80 |
-
} else {
|
81 |
-
$fields = $( selector );
|
82 |
-
}
|
83 |
-
|
84 |
-
// filter
|
85 |
-
if( !args.suppressFilters ) {
|
86 |
-
$fields = $fields.not('.acf-clone .acf-field');
|
87 |
-
$fields = acf.applyFilters('find_fields', $fields);
|
88 |
-
}
|
89 |
-
|
90 |
-
// limit
|
91 |
-
if( args.limit ) {
|
92 |
-
$fields = $fields.slice( 0, args.limit );
|
93 |
-
}
|
94 |
-
|
95 |
-
// return
|
96 |
-
return $fields;
|
97 |
-
|
98 |
-
};
|
99 |
-
|
100 |
-
/**
|
101 |
-
* findField
|
102 |
-
*
|
103 |
-
* Finds a specific field with jQuery
|
104 |
-
*
|
105 |
-
* @date 14/12/17
|
106 |
-
* @since 5.6.5
|
107 |
-
*
|
108 |
-
* @param string key The field's key.
|
109 |
-
* @param jQuery $parent jQuery element to search within.
|
110 |
-
* @return jQuery
|
111 |
-
*/
|
112 |
-
|
113 |
-
acf.findField = function( key, $parent ){
|
114 |
-
return acf.findFields({
|
115 |
-
key: key,
|
116 |
-
limit: 1,
|
117 |
-
parent: $parent,
|
118 |
-
suppressFilters: true
|
119 |
-
});
|
120 |
-
};
|
121 |
-
|
122 |
-
/**
|
123 |
-
* getField
|
124 |
-
*
|
125 |
-
* Returns a field instance
|
126 |
-
*
|
127 |
-
* @date 14/12/17
|
128 |
-
* @since 5.6.5
|
129 |
-
*
|
130 |
-
* @param jQuery|string $field jQuery element or field key.
|
131 |
-
* @return object
|
132 |
-
*/
|
133 |
-
|
134 |
-
acf.getField = function( $field ){
|
135 |
-
|
136 |
-
// allow jQuery
|
137 |
-
if( $field instanceof jQuery ) {
|
138 |
-
|
139 |
-
// find fields
|
140 |
-
} else {
|
141 |
-
$field = acf.findField( $field );
|
142 |
-
}
|
143 |
-
|
144 |
-
// instantiate
|
145 |
-
var field = $field.data('acf');
|
146 |
-
if( !field ) {
|
147 |
-
field = acf.newField( $field );
|
148 |
-
}
|
149 |
-
|
150 |
-
// return
|
151 |
-
return field;
|
152 |
-
};
|
153 |
-
|
154 |
-
/**
|
155 |
-
* getFields
|
156 |
-
*
|
157 |
-
* Returns multiple field instances
|
158 |
-
*
|
159 |
-
* @date 14/12/17
|
160 |
-
* @since 5.6.5
|
161 |
-
*
|
162 |
-
* @param jQuery|object $fields jQuery elements or query args.
|
163 |
-
* @return array
|
164 |
-
*/
|
165 |
-
|
166 |
-
acf.getFields = function( $fields ){
|
167 |
-
|
168 |
-
// allow jQuery
|
169 |
-
if( $fields instanceof jQuery ) {
|
170 |
-
|
171 |
-
// find fields
|
172 |
-
} else {
|
173 |
-
$fields = acf.findFields( $fields );
|
174 |
-
}
|
175 |
-
|
176 |
-
// loop
|
177 |
-
var fields = [];
|
178 |
-
$fields.each(function(){
|
179 |
-
var field = acf.getField( $(this) );
|
180 |
-
fields.push( field );
|
181 |
-
});
|
182 |
-
|
183 |
-
// return
|
184 |
-
return fields;
|
185 |
-
};
|
186 |
-
|
187 |
-
/**
|
188 |
-
* findClosestField
|
189 |
-
*
|
190 |
-
* Returns the closest jQuery field element
|
191 |
-
*
|
192 |
-
* @date 9/4/18
|
193 |
-
* @since 5.6.9
|
194 |
-
*
|
195 |
-
* @param jQuery $el
|
196 |
-
* @return jQuery
|
197 |
-
*/
|
198 |
-
|
199 |
-
acf.findClosestField = function( $el ){
|
200 |
-
return $el.closest('.acf-field');
|
201 |
-
};
|
202 |
-
|
203 |
-
/**
|
204 |
-
* getClosestField
|
205 |
-
*
|
206 |
-
* Returns the closest field instance
|
207 |
-
*
|
208 |
-
* @date 22/1/18
|
209 |
-
* @since 5.6.5
|
210 |
-
*
|
211 |
-
* @param jQuery $el
|
212 |
-
* @return object
|
213 |
-
*/
|
214 |
-
|
215 |
-
acf.getClosestField = function( $el ){
|
216 |
-
var $field = acf.findClosestField( $el );
|
217 |
-
return this.getField( $field );
|
218 |
-
};
|
219 |
-
|
220 |
-
/**
|
221 |
-
* addGlobalFieldAction
|
222 |
-
*
|
223 |
-
* Sets up callback logic for global field actions
|
224 |
-
*
|
225 |
-
* @date 15/6/18
|
226 |
-
* @since 5.6.9
|
227 |
-
*
|
228 |
-
* @param string action
|
229 |
-
* @return void
|
230 |
-
*/
|
231 |
-
|
232 |
-
var addGlobalFieldAction = function( action ){
|
233 |
-
|
234 |
-
// vars
|
235 |
-
var globalAction = action;
|
236 |
-
var pluralAction = action + '_fields'; // ready_fields
|
237 |
-
var singleAction = action + '_field'; // ready_field
|
238 |
-
|
239 |
-
// global action
|
240 |
-
var globalCallback = function( $el /*, arg1, arg2, etc*/ ){
|
241 |
-
//console.log( action, arguments );
|
242 |
-
|
243 |
-
// get args [$el, ...]
|
244 |
-
var args = acf.arrayArgs( arguments );
|
245 |
-
var extraArgs = args.slice(1);
|
246 |
-
|
247 |
-
// find fields
|
248 |
-
var fields = acf.getFields({ parent: $el });
|
249 |
-
|
250 |
-
// check
|
251 |
-
if( fields.length ) {
|
252 |
-
|
253 |
-
// pluralAction
|
254 |
-
var pluralArgs = [ pluralAction, fields ].concat( extraArgs );
|
255 |
-
acf.doAction.apply(null, pluralArgs);
|
256 |
-
}
|
257 |
-
};
|
258 |
-
|
259 |
-
// plural action
|
260 |
-
var pluralCallback = function( fields /*, arg1, arg2, etc*/ ){
|
261 |
-
//console.log( pluralAction, arguments );
|
262 |
-
|
263 |
-
// get args [fields, ...]
|
264 |
-
var args = acf.arrayArgs( arguments );
|
265 |
-
var extraArgs = args.slice(1);
|
266 |
-
|
267 |
-
// loop
|
268 |
-
fields.map(function( field, i ){
|
269 |
-
//setTimeout(function(){
|
270 |
-
// singleAction
|
271 |
-
var singleArgs = [ singleAction, field ].concat( extraArgs );
|
272 |
-
acf.doAction.apply(null, singleArgs);
|
273 |
-
//}, i * 100);
|
274 |
-
});
|
275 |
-
};
|
276 |
-
|
277 |
-
// add actions
|
278 |
-
acf.addAction(globalAction, globalCallback);
|
279 |
-
acf.addAction(pluralAction, pluralCallback);
|
280 |
-
|
281 |
-
// also add single action
|
282 |
-
addSingleFieldAction( action );
|
283 |
-
}
|
284 |
-
|
285 |
-
/**
|
286 |
-
* addSingleFieldAction
|
287 |
-
*
|
288 |
-
* Sets up callback logic for single field actions
|
289 |
-
*
|
290 |
-
* @date 15/6/18
|
291 |
-
* @since 5.6.9
|
292 |
-
*
|
293 |
-
* @param string action
|
294 |
-
* @return void
|
295 |
-
*/
|
296 |
-
|
297 |
-
var addSingleFieldAction = function( action ){
|
298 |
-
|
299 |
-
// vars
|
300 |
-
var singleAction = action + '_field'; // ready_field
|
301 |
-
var singleEvent = action + 'Field'; // readyField
|
302 |
-
|
303 |
-
// single action
|
304 |
-
var singleCallback = function( field /*, arg1, arg2, etc*/ ){
|
305 |
-
//console.log( singleAction, arguments );
|
306 |
-
|
307 |
-
// get args [field, ...]
|
308 |
-
var args = acf.arrayArgs( arguments );
|
309 |
-
var extraArgs = args.slice(1);
|
310 |
-
|
311 |
-
// action variations (ready_field/type=image)
|
312 |
-
var variations = ['type', 'name', 'key'];
|
313 |
-
variations.map(function( variation ){
|
314 |
-
|
315 |
-
// vars
|
316 |
-
var prefix = '/' + variation + '=' + field.get(variation);
|
317 |
-
|
318 |
-
// singleAction
|
319 |
-
args = [ singleAction + prefix , field ].concat( extraArgs );
|
320 |
-
acf.doAction.apply(null, args);
|
321 |
-
});
|
322 |
-
|
323 |
-
// event
|
324 |
-
if( singleFieldEvents.indexOf(action) > -1 ) {
|
325 |
-
field.trigger(singleEvent, extraArgs);
|
326 |
-
}
|
327 |
-
};
|
328 |
-
|
329 |
-
// add actions
|
330 |
-
acf.addAction(singleAction, singleCallback);
|
331 |
-
}
|
332 |
-
|
333 |
-
// vars
|
334 |
-
var globalFieldActions = [ 'prepare', 'ready', 'load', 'append', 'remove', 'unmount', 'remount', 'sortstart', 'sortstop', 'show', 'hide', 'unload' ];
|
335 |
-
var singleFieldActions = [ 'valid', 'invalid', 'enable', 'disable', 'new' ];
|
336 |
-
var singleFieldEvents = [ 'remove', 'unmount', 'remount', 'sortstart', 'sortstop', 'show', 'hide', 'unload', 'valid', 'invalid', 'enable', 'disable' ];
|
337 |
-
|
338 |
-
// add
|
339 |
-
globalFieldActions.map( addGlobalFieldAction );
|
340 |
-
singleFieldActions.map( addSingleFieldAction );
|
341 |
-
|
342 |
-
/**
|
343 |
-
* fieldsEventManager
|
344 |
-
*
|
345 |
-
* Manages field actions and events
|
346 |
-
*
|
347 |
-
* @date 15/12/17
|
348 |
-
* @since 5.6.5
|
349 |
-
*
|
350 |
-
* @param void
|
351 |
-
* @param void
|
352 |
-
*/
|
353 |
-
|
354 |
-
var fieldsEventManager = new acf.Model({
|
355 |
-
id: 'fieldsEventManager',
|
356 |
-
events: {
|
357 |
-
'click .acf-field a[href="#"]': 'onClick',
|
358 |
-
'change .acf-field': 'onChange'
|
359 |
-
},
|
360 |
-
onClick: function( e ){
|
361 |
-
|
362 |
-
// prevent default of any link with an href of #
|
363 |
-
e.preventDefault();
|
364 |
-
},
|
365 |
-
onChange: function(){
|
366 |
-
|
367 |
-
// preview hack allows post to save with no title or content
|
368 |
-
$('#_acf_changed').val(1);
|
369 |
-
}
|
370 |
-
});
|
371 |
-
|
372 |
-
})(jQuery);
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/build/js/_acf-helpers.js
DELETED
@@ -1,361 +0,0 @@
|
|
1 |
-
(function($, undefined){
|
2 |
-
|
3 |
-
/**
|
4 |
-
* refreshHelper
|
5 |
-
*
|
6 |
-
* description
|
7 |
-
*
|
8 |
-
* @date 1/7/18
|
9 |
-
* @since 5.6.9
|
10 |
-
*
|
11 |
-
* @param type $var Description. Default.
|
12 |
-
* @return type Description.
|
13 |
-
*/
|
14 |
-
|
15 |
-
var refreshHelper = new acf.Model({
|
16 |
-
priority: 90,
|
17 |
-
timeout: 0,
|
18 |
-
actions: {
|
19 |
-
'new_field': 'refresh',
|
20 |
-
'show_field': 'refresh',
|
21 |
-
'hide_field': 'refresh',
|
22 |
-
'remove_field': 'refresh'
|
23 |
-
},
|
24 |
-
refresh: function(){
|
25 |
-
clearTimeout( this.timeout );
|
26 |
-
this.timeout = setTimeout(function(){
|
27 |
-
acf.doAction('refresh');
|
28 |
-
}, 0);
|
29 |
-
}
|
30 |
-
});
|
31 |
-
|
32 |
-
/**
|
33 |
-
* mountHelper
|
34 |
-
*
|
35 |
-
* Adds compatiblity for the 'unmount' and 'remount' actions added in 5.8.0
|
36 |
-
*
|
37 |
-
* @date 7/3/19
|
38 |
-
* @since 5.7.14
|
39 |
-
*
|
40 |
-
* @param void
|
41 |
-
* @return void
|
42 |
-
*/
|
43 |
-
var mountHelper = new acf.Model({
|
44 |
-
priority: 1,
|
45 |
-
actions: {
|
46 |
-
'sortstart': 'onSortstart',
|
47 |
-
'sortstop': 'onSortstop'
|
48 |
-
},
|
49 |
-
onSortstart: function( $item ){
|
50 |
-
acf.doAction('unmount', $item);
|
51 |
-
},
|
52 |
-
onSortstop: function( $item ){
|
53 |
-
acf.doAction('remount', $item);
|
54 |
-
}
|
55 |
-
});
|
56 |
-
|
57 |
-
/**
|
58 |
-
* sortableHelper
|
59 |
-
*
|
60 |
-
* Adds compatibility for sorting a <tr> element
|
61 |
-
*
|
62 |
-
* @date 6/3/18
|
63 |
-
* @since 5.6.9
|
64 |
-
*
|
65 |
-
* @param void
|
66 |
-
* @return void
|
67 |
-
*/
|
68 |
-
|
69 |
-
var sortableHelper = new acf.Model({
|
70 |
-
actions: {
|
71 |
-
'sortstart': 'onSortstart'
|
72 |
-
},
|
73 |
-
onSortstart: function( $item, $placeholder ){
|
74 |
-
|
75 |
-
// if $item is a tr, apply some css to the elements
|
76 |
-
if( $item.is('tr') ) {
|
77 |
-
|
78 |
-
// replace $placeholder children with a single td
|
79 |
-
// fixes "width calculation issues" due to conditional logic hiding some children
|
80 |
-
$placeholder.html('<td style="padding:0;" colspan="' + $placeholder.children().length + '"></td>');
|
81 |
-
|
82 |
-
// add helper class to remove absolute positioning
|
83 |
-
$item.addClass('acf-sortable-tr-helper');
|
84 |
-
|
85 |
-
// set fixed widths for children
|
86 |
-
$item.children().each(function(){
|
87 |
-
$(this).width( $(this).width() );
|
88 |
-
});
|
89 |
-
|
90 |
-
// mimic height
|
91 |
-
$placeholder.height( $item.height() + 'px' );
|
92 |
-
|
93 |
-
// remove class
|
94 |
-
$item.removeClass('acf-sortable-tr-helper');
|
95 |
-
}
|
96 |
-
}
|
97 |
-
});
|
98 |
-
|
99 |
-
/**
|
100 |
-
* duplicateHelper
|
101 |
-
*
|
102 |
-
* Fixes browser bugs when duplicating an element
|
103 |
-
*
|
104 |
-
* @date 6/3/18
|
105 |
-
* @since 5.6.9
|
106 |
-
*
|
107 |
-
* @param void
|
108 |
-
* @return void
|
109 |
-
*/
|
110 |
-
|
111 |
-
var duplicateHelper = new acf.Model({
|
112 |
-
actions: {
|
113 |
-
'after_duplicate': 'onAfterDuplicate'
|
114 |
-
},
|
115 |
-
onAfterDuplicate: function( $el, $el2 ){
|
116 |
-
|
117 |
-
// get original values
|
118 |
-
var vals = [];
|
119 |
-
$el.find('select').each(function(i){
|
120 |
-
vals.push( $(this).val() );
|
121 |
-
});
|
122 |
-
|
123 |
-
// set duplicate values
|
124 |
-
$el2.find('select').each(function(i){
|
125 |
-
$(this).val( vals[i] );
|
126 |
-
});
|
127 |
-
}
|
128 |
-
});
|
129 |
-
|
130 |
-
/**
|
131 |
-
* tableHelper
|
132 |
-
*
|
133 |
-
* description
|
134 |
-
*
|
135 |
-
* @date 6/3/18
|
136 |
-
* @since 5.6.9
|
137 |
-
*
|
138 |
-
* @param type $var Description. Default.
|
139 |
-
* @return type Description.
|
140 |
-
*/
|
141 |
-
|
142 |
-
var tableHelper = new acf.Model({
|
143 |
-
|
144 |
-
id: 'tableHelper',
|
145 |
-
|
146 |
-
priority: 20,
|
147 |
-
|
148 |
-
actions: {
|
149 |
-
'refresh': 'renderTables'
|
150 |
-
},
|
151 |
-
|
152 |
-
renderTables: function( $el ){
|
153 |
-
|
154 |
-
// loop
|
155 |
-
var self = this;
|
156 |
-
$('.acf-table:visible').each(function(){
|
157 |
-
self.renderTable( $(this) );
|
158 |
-
});
|
159 |
-
},
|
160 |
-
|
161 |
-
renderTable: function( $table ){
|
162 |
-
|
163 |
-
// vars
|
164 |
-
var $ths = $table.find('> thead > tr:visible > th[data-key]');
|
165 |
-
var $tds = $table.find('> tbody > tr:visible > td[data-key]');
|
166 |
-
|
167 |
-
// bail early if no thead
|
168 |
-
if( !$ths.length || !$tds.length ) {
|
169 |
-
return false;
|
170 |
-
}
|
171 |
-
|
172 |
-
|
173 |
-
// visiblity
|
174 |
-
$ths.each(function( i ){
|
175 |
-
|
176 |
-
// vars
|
177 |
-
var $th = $(this);
|
178 |
-
var key = $th.data('key');
|
179 |
-
var $cells = $tds.filter('[data-key="' + key + '"]');
|
180 |
-
var $hidden = $cells.filter('.acf-hidden');
|
181 |
-
|
182 |
-
// always remove empty and allow cells to be hidden
|
183 |
-
$cells.removeClass('acf-empty');
|
184 |
-
|
185 |
-
// hide $th if all cells are hidden
|
186 |
-
if( $cells.length === $hidden.length ) {
|
187 |
-
acf.hide( $th );
|
188 |
-
|
189 |
-
// force all hidden cells to appear empty
|
190 |
-
} else {
|
191 |
-
acf.show( $th );
|
192 |
-
$hidden.addClass('acf-empty');
|
193 |
-
}
|
194 |
-
});
|
195 |
-
|
196 |
-
|
197 |
-
// clear width
|
198 |
-
$ths.css('width', 'auto');
|
199 |
-
|
200 |
-
// get visible
|
201 |
-
$ths = $ths.not('.acf-hidden');
|
202 |
-
|
203 |
-
// vars
|
204 |
-
var availableWidth = 100;
|
205 |
-
var colspan = $ths.length;
|
206 |
-
|
207 |
-
// set custom widths first
|
208 |
-
var $fixedWidths = $ths.filter('[data-width]');
|
209 |
-
$fixedWidths.each(function(){
|
210 |
-
var width = $(this).data('width');
|
211 |
-
$(this).css('width', width + '%');
|
212 |
-
availableWidth -= width;
|
213 |
-
});
|
214 |
-
|
215 |
-
// set auto widths
|
216 |
-
var $auoWidths = $ths.not('[data-width]');
|
217 |
-
if( $auoWidths.length ) {
|
218 |
-
var width = availableWidth / $auoWidths.length;
|
219 |
-
$auoWidths.css('width', width + '%');
|
220 |
-
availableWidth = 0;
|
221 |
-
}
|
222 |
-
|
223 |
-
// avoid stretching issue
|
224 |
-
if( availableWidth > 0 ) {
|
225 |
-
$ths.last().css('width', 'auto');
|
226 |
-
}
|
227 |
-
|
228 |
-
|
229 |
-
// update colspan on collapsed
|
230 |
-
$tds.filter('.-collapsed-target').each(function(){
|
231 |
-
|
232 |
-
// vars
|
233 |
-
var $td = $(this);
|
234 |
-
|
235 |
-
// check if collapsed
|
236 |
-
if( $td.parent().hasClass('-collapsed') ) {
|
237 |
-
$td.attr('colspan', $ths.length);
|
238 |
-
} else {
|
239 |
-
$td.removeAttr('colspan');
|
240 |
-
}
|
241 |
-
});
|
242 |
-
}
|
243 |
-
});
|
244 |
-
|
245 |
-
|
246 |
-
/**
|
247 |
-
* fieldsHelper
|
248 |
-
*
|
249 |
-
* description
|
250 |
-
*
|
251 |
-
* @date 6/3/18
|
252 |
-
* @since 5.6.9
|
253 |
-
*
|
254 |
-
* @param type $var Description. Default.
|
255 |
-
* @return type Description.
|
256 |
-
*/
|
257 |
-
|
258 |
-
var fieldsHelper = new acf.Model({
|
259 |
-
|
260 |
-
id: 'fieldsHelper',
|
261 |
-
|
262 |
-
priority: 30,
|
263 |
-
|
264 |
-
actions: {
|
265 |
-
'refresh': 'renderGroups'
|
266 |
-
},
|
267 |
-
|
268 |
-
renderGroups: function(){
|
269 |
-
|
270 |
-
// loop
|
271 |
-
var self = this;
|
272 |
-
$('.acf-fields:visible').each(function(){
|
273 |
-
self.renderGroup( $(this) );
|
274 |
-
});
|
275 |
-
},
|
276 |
-
|
277 |
-
renderGroup: function( $el ){
|
278 |
-
|
279 |
-
// vars
|
280 |
-
var top = 0;
|
281 |
-
var height = 0;
|
282 |
-
var $row = $();
|
283 |
-
|
284 |
-
// get fields
|
285 |
-
var $fields = $el.children('.acf-field[data-width]:visible');
|
286 |
-
|
287 |
-
// bail early if no fields
|
288 |
-
if( !$fields.length ) {
|
289 |
-
return false;
|
290 |
-
}
|
291 |
-
|
292 |
-
// bail ealry if is .-left
|
293 |
-
if( $el.hasClass('-left') ) {
|
294 |
-
$fields.removeAttr('data-width');
|
295 |
-
$fields.css('width', 'auto');
|
296 |
-
return false;
|
297 |
-
}
|
298 |
-
|
299 |
-
// reset fields
|
300 |
-
$fields.removeClass('-r0 -c0').css({'min-height': 0});
|
301 |
-
|
302 |
-
// loop
|
303 |
-
$fields.each(function( i ){
|
304 |
-
|
305 |
-
// vars
|
306 |
-
var $field = $(this);
|
307 |
-
var position = $field.position();
|
308 |
-
var thisTop = Math.ceil( position.top );
|
309 |
-
var thisLeft = Math.ceil( position.left );
|
310 |
-
|
311 |
-
// detect change in row
|
312 |
-
if( $row.length && thisTop > top ) {
|
313 |
-
|
314 |
-
// set previous heights
|
315 |
-
$row.css({'min-height': height+'px'});
|
316 |
-
|
317 |
-
// update position due to change in row above
|
318 |
-
position = $field.position();
|
319 |
-
thisTop = Math.ceil( position.top );
|
320 |
-
thisLeft = Math.ceil( position.left );
|
321 |
-
|
322 |
-
// reset vars
|
323 |
-
top = 0;
|
324 |
-
height = 0;
|
325 |
-
$row = $();
|
326 |
-
}
|
327 |
-
|
328 |
-
// rtl
|
329 |
-
if( acf.get('rtl') ) {
|
330 |
-
thisLeft = Math.ceil( $field.parent().width() - (position.left + $field.outerWidth()) );
|
331 |
-
}
|
332 |
-
|
333 |
-
// add classes
|
334 |
-
if( thisTop == 0 ) {
|
335 |
-
$field.addClass('-r0');
|
336 |
-
} else if( thisLeft == 0 ) {
|
337 |
-
$field.addClass('-c0');
|
338 |
-
}
|
339 |
-
|
340 |
-
// get height after class change
|
341 |
-
// - add 1 for subpixel rendering
|
342 |
-
var thisHeight = Math.ceil( $field.outerHeight() ) + 1;
|
343 |
-
|
344 |
-
// set height
|
345 |
-
height = Math.max( height, thisHeight );
|
346 |
-
|
347 |
-
// set y
|
348 |
-
top = Math.max( top, thisTop );
|
349 |
-
|
350 |
-
// append
|
351 |
-
$row = $row.add( $field );
|
352 |
-
});
|
353 |
-
|
354 |
-
// clean up
|
355 |
-
if( $row.length ) {
|
356 |
-
$row.css({'min-height': height+'px'});
|
357 |
-
}
|
358 |
-
}
|
359 |
-
});
|
360 |
-
|
361 |
-
})(jQuery);
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/build/js/_acf-hooks.js
DELETED
@@ -1,252 +0,0 @@
|
|
1 |
-
( function( window, undefined ) {
|
2 |
-
"use strict";
|
3 |
-
|
4 |
-
/**
|
5 |
-
* Handles managing all events for whatever you plug it into. Priorities for hooks are based on lowest to highest in
|
6 |
-
* that, lowest priority hooks are fired first.
|
7 |
-
*/
|
8 |
-
var EventManager = function() {
|
9 |
-
/**
|
10 |
-
* Maintain a reference to the object scope so our public methods never get confusing.
|
11 |
-
*/
|
12 |
-
var MethodsAvailable = {
|
13 |
-
removeFilter : removeFilter,
|
14 |
-
applyFilters : applyFilters,
|
15 |
-
addFilter : addFilter,
|
16 |
-
removeAction : removeAction,
|
17 |
-
doAction : doAction,
|
18 |
-
addAction : addAction,
|
19 |
-
storage : getStorage
|
20 |
-
};
|
21 |
-
|
22 |
-
/**
|
23 |
-
* Contains the hooks that get registered with this EventManager. The array for storage utilizes a "flat"
|
24 |
-
* object literal such that looking up the hook utilizes the native object literal hash.
|
25 |
-
*/
|
26 |
-
var STORAGE = {
|
27 |
-
actions : {},
|
28 |
-
filters : {}
|
29 |
-
};
|
30 |
-
|
31 |
-
function getStorage() {
|
32 |
-
|
33 |
-
return STORAGE;
|
34 |
-
|
35 |
-
};
|
36 |
-
|
37 |
-
/**
|
38 |
-
* Adds an action to the event manager.
|
39 |
-
*
|
40 |
-
* @param action Must contain namespace.identifier
|
41 |
-
* @param callback Must be a valid callback function before this action is added
|
42 |
-
* @param [priority=10] Used to control when the function is executed in relation to other callbacks bound to the same hook
|
43 |
-
* @param [context] Supply a value to be used for this
|
44 |
-
*/
|
45 |
-
function addAction( action, callback, priority, context ) {
|
46 |
-
if( typeof action === 'string' && typeof callback === 'function' ) {
|
47 |
-
priority = parseInt( ( priority || 10 ), 10 );
|
48 |
-
_addHook( 'actions', action, callback, priority, context );
|
49 |
-
}
|
50 |
-
|
51 |
-
return MethodsAvailable;
|
52 |
-
}
|
53 |
-
|
54 |
-
/**
|
55 |
-
* Performs an action if it exists. You can pass as many arguments as you want to this function; the only rule is
|
56 |
-
* that the first argument must always be the action.
|
57 |
-
*/
|
58 |
-
function doAction( /* action, arg1, arg2, ... */ ) {
|
59 |
-
var args = Array.prototype.slice.call( arguments );
|
60 |
-
var action = args.shift();
|
61 |
-
|
62 |
-
if( typeof action === 'string' ) {
|
63 |
-
_runHook( 'actions', action, args );
|
64 |
-
}
|
65 |
-
|
66 |
-
return MethodsAvailable;
|
67 |
-
}
|
68 |
-
|
69 |
-
/**
|
70 |
-
* Removes the specified action if it contains a namespace.identifier & exists.
|
71 |
-
*
|
72 |
-
* @param action The action to remove
|
73 |
-
* @param [callback] Callback function to remove
|
74 |
-
*/
|
75 |
-
function removeAction( action, callback ) {
|
76 |
-
if( typeof action === 'string' ) {
|
77 |
-
_removeHook( 'actions', action, callback );
|
78 |
-
}
|
79 |
-
|
80 |
-
return MethodsAvailable;
|
81 |
-
}
|
82 |
-
|
83 |
-
/**
|
84 |
-
* Adds a filter to the event manager.
|
85 |
-
*
|
86 |
-
* @param filter Must contain namespace.identifier
|
87 |
-
* @param callback Must be a valid callback function before this action is added
|
88 |
-
* @param [priority=10] Used to control when the function is executed in relation to other callbacks bound to the same hook
|
89 |
-
* @param [context] Supply a value to be used for this
|
90 |
-
*/
|
91 |
-
function addFilter( filter, callback, priority, context ) {
|
92 |
-
if( typeof filter === 'string' && typeof callback === 'function' ) {
|
93 |
-
priority = parseInt( ( priority || 10 ), 10 );
|
94 |
-
_addHook( 'filters', filter, callback, priority, context );
|
95 |
-
}
|
96 |
-
|
97 |
-
return MethodsAvailable;
|
98 |
-
}
|
99 |
-
|
100 |
-
/**
|
101 |
-
* Performs a filter if it exists. You should only ever pass 1 argument to be filtered. The only rule is that
|
102 |
-
* the first argument must always be the filter.
|
103 |
-
*/
|
104 |
-
function applyFilters( /* filter, filtered arg, arg2, ... */ ) {
|
105 |
-
var args = Array.prototype.slice.call( arguments );
|
106 |
-
var filter = args.shift();
|
107 |
-
|
108 |
-
if( typeof filter === 'string' ) {
|
109 |
-
return _runHook( 'filters', filter, args );
|
110 |
-
}
|
111 |
-
|
112 |
-
return MethodsAvailable;
|
113 |
-
}
|
114 |
-
|
115 |
-
/**
|
116 |
-
* Removes the specified filter if it contains a namespace.identifier & exists.
|
117 |
-
*
|
118 |
-
* @param filter The action to remove
|
119 |
-
* @param [callback] Callback function to remove
|
120 |
-
*/
|
121 |
-
function removeFilter( filter, callback ) {
|
122 |
-
if( typeof filter === 'string') {
|
123 |
-
_removeHook( 'filters', filter, callback );
|
124 |
-
}
|
125 |
-
|
126 |
-
return MethodsAvailable;
|
127 |
-
}
|
128 |
-
|
129 |
-
/**
|
130 |
-
* Removes the specified hook by resetting the value of it.
|
131 |
-
*
|
132 |
-
* @param type Type of hook, either 'actions' or 'filters'
|
133 |
-
* @param hook The hook (namespace.identifier) to remove
|
134 |
-
* @private
|
135 |
-
*/
|
136 |
-
function _removeHook( type, hook, callback, context ) {
|
137 |
-
if ( !STORAGE[ type ][ hook ] ) {
|
138 |
-
return;
|
139 |
-
}
|
140 |
-
if ( !callback ) {
|
141 |
-
STORAGE[ type ][ hook ] = [];
|
142 |
-
} else {
|
143 |
-
var handlers = STORAGE[ type ][ hook ];
|
144 |
-
var i;
|
145 |
-
if ( !context ) {
|
146 |
-
for ( i = handlers.length; i--; ) {
|
147 |
-
if ( handlers[i].callback === callback ) {
|
148 |
-
handlers.splice( i, 1 );
|
149 |
-
}
|
150 |
-
}
|
151 |
-
}
|
152 |
-
else {
|
153 |
-
for ( i = handlers.length; i--; ) {
|
154 |
-
var handler = handlers[i];
|
155 |
-
if ( handler.callback === callback && handler.context === context) {
|
156 |
-
handlers.splice( i, 1 );
|
157 |
-
}
|
158 |
-
}
|
159 |
-
}
|
160 |
-
}
|
161 |
-
}
|
162 |
-
|
163 |
-
/**
|
164 |
-
* Adds the hook to the appropriate storage container
|
165 |
-
*
|
166 |
-
* @param type 'actions' or 'filters'
|
167 |
-
* @param hook The hook (namespace.identifier) to add to our event manager
|
168 |
-
* @param callback The function that will be called when the hook is executed.
|
169 |
-
* @param priority The priority of this hook. Must be an integer.
|
170 |
-
* @param [context] A value to be used for this
|
171 |
-
* @private
|
172 |
-
*/
|
173 |
-
function _addHook( type, hook, callback, priority, context ) {
|
174 |
-
var hookObject = {
|
175 |
-
callback : callback,
|
176 |
-
priority : priority,
|
177 |
-
context : context
|
178 |
-
};
|
179 |
-
|
180 |
-
// Utilize 'prop itself' : http://jsperf.com/hasownproperty-vs-in-vs-undefined/19
|
181 |
-
var hooks = STORAGE[ type ][ hook ];
|
182 |
-
if( hooks ) {
|
183 |
-
hooks.push( hookObject );
|
184 |
-
hooks = _hookInsertSort( hooks );
|
185 |
-
}
|
186 |
-
else {
|
187 |
-
hooks = [ hookObject ];
|
188 |
-
}
|
189 |
-
|
190 |
-
STORAGE[ type ][ hook ] = hooks;
|
191 |
-
}
|
192 |
-
|
193 |
-
/**
|
194 |
-
* Use an insert sort for keeping our hooks organized based on priority. This function is ridiculously faster
|
195 |
-
* than bubble sort, etc: http://jsperf.com/javascript-sort
|
196 |
-
*
|
197 |
-
* @param hooks The custom array containing all of the appropriate hooks to perform an insert sort on.
|
198 |
-
* @private
|
199 |
-
*/
|
200 |
-
function _hookInsertSort( hooks ) {
|
201 |
-
var tmpHook, j, prevHook;
|
202 |
-
for( var i = 1, len = hooks.length; i < len; i++ ) {
|
203 |
-
tmpHook = hooks[ i ];
|
204 |
-
j = i;
|
205 |
-
while( ( prevHook = hooks[ j - 1 ] ) && prevHook.priority > tmpHook.priority ) {
|
206 |
-
hooks[ j ] = hooks[ j - 1 ];
|
207 |
-
--j;
|
208 |
-
}
|
209 |
-
hooks[ j ] = tmpHook;
|
210 |
-
}
|
211 |
-
|
212 |
-
return hooks;
|
213 |
-
}
|
214 |
-
|
215 |
-
/**
|
216 |
-
* Runs the specified hook. If it is an action, the value is not modified but if it is a filter, it is.
|
217 |
-
*
|
218 |
-
* @param type 'actions' or 'filters'
|
219 |
-
* @param hook The hook ( namespace.identifier ) to be ran.
|
220 |
-
* @param args Arguments to pass to the action/filter. If it's a filter, args is actually a single parameter.
|
221 |
-
* @private
|
222 |
-
*/
|
223 |
-
function _runHook( type, hook, args ) {
|
224 |
-
var handlers = STORAGE[ type ][ hook ];
|
225 |
-
|
226 |
-
if ( !handlers ) {
|
227 |
-
return (type === 'filters') ? args[0] : false;
|
228 |
-
}
|
229 |
-
|
230 |
-
var i = 0, len = handlers.length;
|
231 |
-
if ( type === 'filters' ) {
|
232 |
-
for ( ; i < len; i++ ) {
|
233 |
-
args[ 0 ] = handlers[ i ].callback.apply( handlers[ i ].context, args );
|
234 |
-
}
|
235 |
-
} else {
|
236 |
-
for ( ; i < len; i++ ) {
|
237 |
-
handlers[ i ].callback.apply( handlers[ i ].context, args );
|
238 |
-
}
|
239 |
-
}
|
240 |
-
|
241 |
-
return ( type === 'filters' ) ? args[ 0 ] : true;
|
242 |
-
}
|
243 |
-
|
244 |
-
// return all of the publicly available methods
|
245 |
-
return MethodsAvailable;
|
246 |
-
|
247 |
-
};
|
248 |
-
|
249 |
-
// instantiate
|
250 |
-
acf.hooks = new EventManager();
|
251 |
-
|
252 |
-
} )( window );
|
|
|
|
|
|
|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0,0 @@
|
|
1 |
-
(function($, undefined){
|
2 |
-
|
3 |
-
/**
|
4 |
-
* acf.newMediaPopup
|
5 |
-
*
|
6 |
-
* description
|
7 |
-
*
|
8 |
-
* @date 10/1/18
|
9 |
-
* @since 5.6.5
|
10 |
-
*
|
11 |
-
* @param type $var Description. Default.
|
12 |
-
* @return type Description.
|
13 |
-
*/
|
14 |
-
|
15 |
-
acf.newMediaPopup = function( args ){
|
16 |
-
|
17 |
-
// args
|
18 |
-
var popup = null;
|
19 |
-
var args = acf.parseArgs(args, {
|
20 |
-
mode: 'select', // 'select', 'edit'
|
21 |
-
title: '', // 'Upload Image'
|
22 |
-
button: '', // 'Select Image'
|
23 |
-
type: '', // 'image', ''
|
24 |
-
field: false, // field instance
|
25 |
-
allowedTypes: '', // '.jpg, .png, etc'
|
26 |
-
library: 'all', // 'all', 'uploadedTo'
|
27 |
-
multiple: false, // false, true, 'add'
|
28 |
-
attachment: 0, // the attachment to edit
|
29 |
-
autoOpen: true, // open the popup automatically
|
30 |
-
open: function(){}, // callback after close
|
31 |
-
select: function(){}, // callback after select
|
32 |
-
close: function(){} // callback after close
|
33 |
-
});
|
34 |
-
|
35 |
-
// initialize
|
36 |
-
if( args.mode == 'edit' ) {
|
37 |
-
popup = new acf.models.EditMediaPopup( args );
|
38 |
-
} else {
|
39 |
-
popup = new acf.models.SelectMediaPopup( args );
|
40 |
-
}
|
41 |
-
|
42 |
-
// open popup (allow frame customization before opening)
|
43 |
-
if( args.autoOpen ) {
|
44 |
-
setTimeout(function(){
|
45 |
-
popup.open();
|
46 |
-
}, 1);
|
47 |
-
}
|
48 |
-
|
49 |
-
// action
|
50 |
-
acf.doAction('new_media_popup', popup);
|
51 |
-
|
52 |
-
// return
|
53 |
-
return popup;
|
54 |
-
};
|
55 |
-
|
56 |
-
|
57 |
-
/**
|
58 |
-
* getPostID
|
59 |
-
*
|
60 |
-
* description
|
61 |
-
*
|
62 |
-
* @date 10/1/18
|
63 |
-
* @since 5.6.5
|
64 |
-
*
|
65 |
-
* @param type $var Description. Default.
|
66 |
-
* @return type Description.
|
67 |
-
*/
|
68 |
-
|
69 |
-
var getPostID = function() {
|
70 |
-
var postID = acf.get('post_id');
|
71 |
-
return $.isNumeric(postID) ? postID : 0;
|
72 |
-
}
|
73 |
-
|
74 |
-
|
75 |
-
/**
|
76 |
-
* acf.getMimeTypes
|
77 |
-
*
|
78 |
-
* description
|
79 |
-
*
|
80 |
-
* @date 11/1/18
|
81 |
-
* @since 5.6.5
|
82 |
-
*
|
83 |
-
* @param type $var Description. Default.
|
84 |
-
* @return type Description.
|
85 |
-
*/
|
86 |
-
|
87 |
-
acf.getMimeTypes = function(){
|
88 |
-
return this.get('mimeTypes');
|
89 |
-
};
|
90 |
-
|
91 |
-
acf.getMimeType = function( name ){
|
92 |
-
|
93 |
-
// vars
|
94 |
-
var allTypes = acf.getMimeTypes();
|
95 |
-
|
96 |
-
// search
|
97 |
-
if( allTypes[name] !== undefined ) {
|
98 |
-
return allTypes[name];
|
99 |
-
}
|
100 |
-
|
101 |
-
// some types contain a mixed key such as "jpg|jpeg|jpe"
|
102 |
-
for( var key in allTypes ) {
|
103 |
-
if( key.indexOf(name) !== -1 ) {
|
104 |
-
return allTypes[key];
|
105 |
-
}
|
106 |
-
}
|
107 |
-
|
108 |
-
// return
|
109 |
-
return false;
|
110 |
-
};
|
111 |
-
|
112 |
-
|
113 |
-
/**
|
114 |
-
* MediaPopup
|
115 |
-
*
|
116 |
-
* description
|
117 |
-
*
|
118 |
-
* @date 10/1/18
|
119 |
-
* @since 5.6.5
|
120 |
-
*
|
121 |
-
* @param type $var Description. Default.
|
122 |
-
* @return type Description.
|
123 |
-
*/
|
124 |
-
|
125 |
-
var MediaPopup = acf.Model.extend({
|
126 |
-
|
127 |
-
id: 'MediaPopup',
|
128 |
-
data: {},
|
129 |
-
defaults: {},
|
130 |
-
frame: false,
|
131 |
-
|
132 |
-
setup: function( props ){
|
133 |
-
$.extend(this.data, props);
|
134 |
-
},
|
135 |
-
|
136 |
-
initialize: function(){
|
137 |
-
|
138 |
-
// vars
|
139 |
-
var options = this.getFrameOptions();
|
140 |
-
|
141 |
-
// add states
|
142 |
-
this.addFrameStates( options );
|
143 |
-
|
144 |
-
// create frame
|
145 |
-
var frame = wp.media( options );
|
146 |
-
|
147 |
-
// add args reference
|
148 |
-
frame.acf = this;
|
149 |
-
|
150 |
-
// add events
|
151 |
-
this.addFrameEvents( frame, options );
|
152 |
-
|
153 |
-
// strore frame
|
154 |
-
this.frame = frame;
|
155 |
-
},
|
156 |
-
|
157 |
-
open: function(){
|
158 |
-
this.frame.open();
|
159 |
-
},
|
160 |
-
|
161 |
-
close: function(){
|
162 |
-
this.frame.close();
|
163 |
-
},
|
164 |
-
|
165 |
-
remove: function(){
|
166 |
-
this.frame.detach();
|
167 |
-
this.frame.remove();
|
168 |
-
},
|
169 |
-
|
170 |
-
getFrameOptions: function(){
|
171 |
-
|
172 |
-
// vars
|
173 |
-
var options = {
|
174 |
-
title: this.get('title'),
|
175 |
-
multiple: this.get('multiple'),
|
176 |
-
library: {},
|
177 |
-
states: []
|
178 |
-
};
|
179 |
-
|
180 |
-
// type
|
181 |
-
if( this.get('type') ) {
|
182 |
-
options.library.type = this.get('type');
|
183 |
-
}
|
184 |
-
|
185 |
-
// type
|
186 |
-
if( this.get('library') === 'uploadedTo' ) {
|
187 |
-
options.library.uploadedTo = getPostID();
|
188 |
-
}
|
189 |
-
|
190 |
-
// attachment
|
191 |
-
if( this.get('attachment') ) {
|
192 |
-
options.library.post__in = [ this.get('attachment') ];
|
193 |
-
}
|
194 |
-
|
195 |
-
// button
|
196 |
-
if( this.get('button') ) {
|
197 |
-
options.button = {
|
198 |
-
text: this.get('button')
|
199 |
-
};
|
200 |
-
}
|
201 |
-
|
202 |
-
// return
|
203 |
-
return options;
|
204 |
-
},
|
205 |
-
|
206 |
-
addFrameStates: function( options ){
|
207 |
-
|
208 |
-
// create query
|
209 |
-
var Query = wp.media.query( options.library );
|
210 |
-
|
211 |
-
// add _acfuploader
|
212 |
-
// this is super wack!
|
213 |
-
// if you add _acfuploader to the options.library args, new uploads will not be added to the library view.
|
214 |
-
// this has been traced back to the wp.media.model.Query initialize function (which can't be overriden)
|
215 |
-
// Adding any custom args will cause the Attahcments to not observe the uploader queue
|
216 |
-
// To bypass this security issue, we add in the args AFTER the Query has been initialized
|
217 |
-
// options.library._acfuploader = settings.field;
|
218 |
-
if( this.get('field') && acf.isset(Query, 'mirroring', 'args') ) {
|
219 |
-
Query.mirroring.args._acfuploader = this.get('field');
|
220 |
-
}
|
221 |
-
|
222 |
-
// add states
|
223 |
-
options.states.push(
|
224 |
-
|
225 |
-
// main state
|
226 |
-
new wp.media.controller.Library({
|
227 |
-
library: Query,
|
228 |
-
multiple: this.get('multiple'),
|
229 |
-
title: this.get('title'),
|
230 |
-
priority: 20,
|
231 |
-
filterable: 'all',
|
232 |
-
editable: true,
|
233 |
-
allowLocalEdits: true
|
234 |
-
})
|
235 |
-
|
236 |
-
);
|
237 |
-
|
238 |
-
// edit image functionality (added in WP 3.9)
|
239 |
-
if( acf.isset(wp, 'media', 'controller', 'EditImage') ) {
|
240 |
-
options.states.push( new wp.media.controller.EditImage() );
|
241 |
-
}
|
242 |
-
},
|
243 |
-
|
244 |
-
addFrameEvents: function( frame, options ){
|
245 |
-
|
246 |
-
// log all events
|
247 |
-
//frame.on('all', function( e ) {
|
248 |
-
// console.log( 'frame all: %o', e );
|
249 |
-
//});
|
250 |
-
|
251 |
-
// add class
|
252 |
-
frame.on('open',function() {
|
253 |
-
this.$el.closest('.media-modal').addClass('acf-media-modal -' + this.acf.get('mode') );
|
254 |
-
}, frame);
|
255 |
-
|
256 |
-
// edit image view
|
257 |
-
// source: media-views.js:2410 editImageContent()
|
258 |
-
frame.on('content:render:edit-image', function(){
|
259 |
-
|
260 |
-
var image = this.state().get('image');
|
261 |
-
var view = new wp.media.view.EditImage({ model: image, controller: this }).render();
|
262 |
-
this.content.set( view );
|
263 |
-
|
264 |
-
// after creating the wrapper view, load the actual editor via an ajax call
|
265 |
-
view.loadEditor();
|
266 |
-
|
267 |
-
}, frame);
|
268 |
-
|
269 |
-
// update toolbar button
|
270 |
-
/*
|
271 |
-
frame.on( 'toolbar:create:select', function( toolbar ) {
|
272 |
-
|
273 |
-
toolbar.view = new wp.media.view.Toolbar.Select({
|
274 |
-
text: frame.options._button,
|
275 |
-
controller: this
|
276 |
-
});
|
277 |
-
|
278 |
-
}, frame );
|
279 |
-
*/
|
280 |
-
// on select
|
281 |
-
frame.on('select', function() {
|
282 |
-
|
283 |
-
// vars
|
284 |
-
var selection = frame.state().get('selection');
|
285 |
-
|
286 |
-
// if selecting images
|
287 |
-
if( selection ) {
|
288 |
-
|
289 |
-
// loop
|
290 |
-
selection.each(function( attachment, i ){
|
291 |
-
frame.acf.get('select').apply( frame.acf, [attachment, i] );
|
292 |
-
});
|
293 |
-
}
|
294 |
-
});
|
295 |
-
|
296 |
-
// on close
|
297 |
-
frame.on('close',function(){
|
298 |
-
|
299 |
-
// callback and remove
|
300 |
-
setTimeout(function(){
|
301 |
-
frame.acf.get('close').apply( frame.acf );
|
302 |
-
frame.acf.remove();
|
303 |
-
}, 1);
|
304 |
-
});
|
305 |
-
}
|
306 |
-
});
|
307 |
-
|
308 |
-
|
309 |
-
/**
|
310 |
-
* acf.models.SelectMediaPopup
|
311 |
-
*
|
312 |
-
* description
|
313 |
-
*
|
314 |
-
* @date 10/1/18
|
315 |
-
* @since 5.6.5
|
316 |
-
*
|
317 |
-
* @param type $var Description. Default.
|
318 |
-
* @return type Description.
|
319 |
-
*/
|
320 |
-
|
321 |
-
acf.models.SelectMediaPopup = MediaPopup.extend({
|
322 |
-
id: 'SelectMediaPopup',
|
323 |
-
setup: function( props ){
|
324 |
-
|
325 |
-
// default button
|
326 |
-
if( !props.button ) {
|
327 |
-
props.button = acf._x('Select', 'verb');
|
328 |
-
}
|
329 |
-
|
330 |
-
// parent
|
331 |
-
MediaPopup.prototype.setup.apply(this, arguments);
|
332 |
-
},
|
333 |
-
|
334 |
-
addFrameEvents: function( frame, options ){
|
335 |
-
|
336 |
-
// plupload
|
337 |
-
// adds _acfuploader param to validate uploads
|
338 |
-
if( acf.isset(_wpPluploadSettings, 'defaults', 'multipart_params') ) {
|
339 |
-
|
340 |
-
// add _acfuploader so that Uploader will inherit
|
341 |
-
_wpPluploadSettings.defaults.multipart_params._acfuploader = this.get('field');
|
342 |
-
|
343 |
-
// remove acf_field so future Uploaders won't inherit
|
344 |
-
frame.on('open', function(){
|
345 |
-
delete _wpPluploadSettings.defaults.multipart_params._acfuploader;
|
346 |
-
});
|
347 |
-
}
|
348 |
-
|
349 |
-
// browse
|
350 |
-
frame.on('content:activate:browse', function(){
|
351 |
-
|
352 |
-
// vars
|
353 |
-
var toolbar = false;
|
354 |
-
|
355 |
-
// populate above vars making sure to allow for failure
|
356 |
-
// perhaps toolbar does not exist because the frame open is Upload Files
|
357 |
-
try {
|
358 |
-
toolbar = frame.content.get().toolbar;
|
359 |
-
} catch(e) {
|
360 |
-
console.log(e);
|
361 |
-
return;
|
362 |
-
}
|
363 |
-
|
364 |
-
// callback
|
365 |
-
frame.acf.customizeFilters.apply(frame.acf, [toolbar]);
|
366 |
-
});
|
367 |
-
|
368 |
-
// parent
|
369 |
-
MediaPopup.prototype.addFrameEvents.apply(this, arguments);
|
370 |
-
|
371 |
-
},
|
372 |
-
|
373 |
-
customizeFilters: function( toolbar ){
|
374 |
-
|
375 |
-
// vars
|
376 |
-
var filters = toolbar.get('filters');
|
377 |
-
|
378 |
-
// image
|
379 |
-
if( this.get('type') == 'image' ) {
|
380 |
-
|
381 |
-
// update all
|
382 |
-
filters.filters.all.text = acf.__('All images');
|
383 |
-
|
384 |
-
// remove some filters
|
385 |
-
delete filters.filters.audio;
|
386 |
-
delete filters.filters.video;
|
387 |
-
delete filters.filters.image;
|
388 |
-
|
389 |
-
// update all filters to show images
|
390 |
-
$.each(filters.filters, function( i, filter ){
|
391 |
-
filter.props.type = filter.props.type || 'image';
|
392 |
-
});
|
393 |
-
}
|
394 |
-
|
395 |
-
// specific types
|
396 |
-
if( this.get('allowedTypes') ) {
|
397 |
-
|
398 |
-
// convert ".jpg, .png" into ["jpg", "png"]
|
399 |
-
var allowedTypes = this.get('allowedTypes').split(' ').join('').split('.').join('').split(',');
|
400 |
-
|
401 |
-
// loop
|
402 |
-
allowedTypes.map(function( name ){
|
403 |
-
|
404 |
-
// get type
|
405 |
-
var mimeType = acf.getMimeType( name );
|
406 |
-
|
407 |
-
// bail early if no type
|
408 |
-
if( !mimeType ) return;
|
409 |
-
|
410 |
-
// create new filter
|
411 |
-
var newFilter = {
|
412 |
-
text: mimeType,
|
413 |
-
props: {
|
414 |
-
status: null,
|
415 |
-
type: mimeType,
|
416 |
-
uploadedTo: null,
|
417 |
-
orderby: 'date',
|
418 |
-
order: 'DESC'
|
419 |
-
},
|
420 |
-
priority: 20
|
421 |
-
};
|
422 |
-
|
423 |
-
// append
|
424 |
-
filters.filters[ mimeType ] = newFilter;
|
425 |
-
|
426 |
-
});
|
427 |
-
}
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
// uploaded to post
|
432 |
-
if( this.get('library') === 'uploadedTo' ) {
|
433 |
-
|
434 |
-
// vars
|
435 |
-
var uploadedTo = this.frame.options.library.uploadedTo;
|
436 |
-
|
437 |
-
// remove some filters
|
438 |
-
delete filters.filters.unattached;
|
439 |
-
delete filters.filters.uploaded;
|
440 |
-
|
441 |
-
// add uploadedTo to filters
|
442 |
-
$.each(filters.filters, function( i, filter ){
|
443 |
-
filter.text += ' (' + acf.__('Uploaded to this post') + ')';
|
444 |
-
filter.props.uploadedTo = uploadedTo;
|
445 |
-
});
|
446 |
-
}
|
447 |
-
|
448 |
-
// add _acfuploader to filters
|
449 |
-
var field = this.get('field');
|
450 |
-
$.each(filters.filters, function( k, filter ){
|
451 |
-
filter.props._acfuploader = field;
|
452 |
-
});
|
453 |
-
|
454 |
-
// add _acfuplaoder to search
|
455 |
-
var search = toolbar.get('search');
|
456 |
-
search.model.attributes._acfuploader = field;
|
457 |
-
|
458 |
-
// render (custom function added to prototype)
|
459 |
-
if( filters.renderFilters ) {
|
460 |
-
filters.renderFilters();
|
461 |
-
}
|
462 |
-
}
|
463 |
-
});
|
464 |
-
|
465 |
-
|
466 |
-
/**
|
467 |
-
* acf.models.EditMediaPopup
|
468 |
-
*
|
469 |
-
* description
|
470 |
-
*
|
471 |
-
* @date 10/1/18
|
472 |
-
* @since 5.6.5
|
473 |
-
*
|
474 |
-
* @param type $var Description. Default.
|
475 |
-
* @return type Description.
|
476 |
-
*/
|
477 |
-
|
478 |
-
acf.models.EditMediaPopup = MediaPopup.extend({
|
479 |
-
id: 'SelectMediaPopup',
|
480 |
-
setup: function( props ){
|
481 |
-
|
482 |
-
// default button
|
483 |
-
if( !props.button ) {
|
484 |
-
props.button = acf._x('Update', 'verb');
|
485 |
-
}
|
486 |
-
|
487 |
-
// parent
|
488 |
-
MediaPopup.prototype.setup.apply(this, arguments);
|
489 |
-
},
|
490 |
-
|
491 |
-
addFrameEvents: function( frame, options ){
|
492 |
-
|
493 |
-
// add class
|
494 |
-
frame.on('open',function() {
|
495 |
-
|
496 |
-
// add class
|
497 |
-
this.$el.closest('.media-modal').addClass('acf-expanded');
|
498 |
-
|
499 |
-
// set to browse
|
500 |
-
if( this.content.mode() != 'browse' ) {
|
501 |
-
this.content.mode('browse');
|
502 |
-
}
|
503 |
-
|
504 |
-
// set selection
|
505 |
-
var state = this.state();
|
506 |
-
var selection = state.get('selection');
|
507 |
-
var attachment = wp.media.attachment( frame.acf.get('attachment') );
|
508 |
-
selection.add( attachment );
|
509 |
-
|
510 |
-
}, frame);
|
511 |
-
|
512 |
-
// parent
|
513 |
-
MediaPopup.prototype.addFrameEvents.apply(this, arguments);
|
514 |
-
|
515 |
-
}
|
516 |
-
});
|
517 |
-
|
518 |
-
|
519 |
-
/**
|
520 |
-
* customizePrototypes
|
521 |
-
*
|
522 |
-
* description
|
523 |
-
*
|
524 |
-
* @date 11/1/18
|
525 |
-
* @since 5.6.5
|
526 |
-
*
|
527 |
-
* @param type $var Description. Default.
|
528 |
-
* @return type Description.
|
529 |
-
*/
|
530 |
-
|
531 |
-
var customizePrototypes = new acf.Model({
|
532 |
-
id: 'customizePrototypes',
|
533 |
-
wait: 'ready',
|
534 |
-
|
535 |
-
initialize: function(){
|
536 |
-
|
537 |
-
// bail early if no media views
|
538 |
-
if( !acf.isset(window, 'wp', 'media', 'view') ) {
|
539 |
-
return;
|
540 |
-
}
|
541 |
-
|
542 |
-
// fix bug where CPT without "editor" does not set post.id setting which then prevents uploadedTo from working
|
543 |
-
var postID = getPostID();
|
544 |
-
if( postID && acf.isset(wp, 'media', 'view', 'settings', 'post') ) {
|
545 |
-
wp.media.view.settings.post.id = postID;
|
546 |
-
}
|
547 |
-
|
548 |
-
// customize
|
549 |
-
this.customizeAttachmentsRouter();
|
550 |
-
this.customizeAttachmentFilters();
|
551 |
-
this.customizeAttachmentCompat();
|
552 |
-
this.customizeAttachmentLibrary();
|
553 |
-
},
|
554 |
-
|
555 |
-
customizeAttachmentsRouter: function(){
|
556 |
-
|
557 |
-
// validate
|
558 |
-
if( !acf.isset(wp, 'media', 'view', 'Router') ) {
|
559 |
-
return;
|
560 |
-
}
|
561 |
-
|
562 |
-
// vars
|
563 |
-
var Parent = wp.media.view.Router;
|
564 |
-
|
565 |
-
// extend
|
566 |
-
wp.media.view.Router = Parent.extend({
|
567 |
-
|
568 |
-
addExpand: function(){
|
569 |
-
|
570 |
-
// vars
|
571 |
-
var $a = $([
|
572 |
-
'<a href="#" class="acf-expand-details">',
|
573 |
-
'<span class="is-closed"><span class="acf-icon -left small grey"></span>' + acf.__('Expand Details') + '</span>',
|
574 |
-
'<span class="is-open"><span class="acf-icon -right small grey"></span>' + acf.__('Collapse Details') + '</span>',
|
575 |
-
'</a>'
|
576 |
-
].join(''));
|
577 |
-
|
578 |
-
// add events
|
579 |
-
$a.on('click', function( e ){
|
580 |
-
e.preventDefault();
|
581 |
-
var $div = $(this).closest('.media-modal');
|
582 |
-
if( $div.hasClass('acf-expanded') ) {
|
583 |
-
$div.removeClass('acf-expanded');
|
584 |
-
} else {
|
585 |
-
$div.addClass('acf-expanded');
|
586 |
-
}
|
587 |
-
});
|
588 |
-
|
589 |
-
// append
|
590 |
-
this.$el.append( $a );
|
591 |
-
},
|
592 |
-
|
593 |
-
initialize: function(){
|
594 |
-
|
595 |
-
// initialize
|
596 |
-
Parent.prototype.initialize.apply( this, arguments );
|
597 |
-
|
598 |
-
// add buttons
|
599 |
-
this.addExpand();
|
600 |
-
|
601 |
-
// return
|
602 |
-
return this;
|
603 |
-
}
|
604 |
-
});
|
605 |
-
},
|
606 |
-
|
607 |
-
customizeAttachmentFilters: function(){
|
608 |
-
|
609 |
-
// validate
|
610 |
-
if( !acf.isset(wp, 'media', 'view', 'AttachmentFilters', 'All') ) {
|
611 |
-
return;
|
612 |
-
}
|
613 |
-
|
614 |
-
// vars
|
615 |
-
var Parent = wp.media.view.AttachmentFilters.All;
|
616 |
-
|
617 |
-
// renderFilters
|
618 |
-
// copied from media-views.js:6939
|
619 |
-
Parent.prototype.renderFilters = function(){
|
620 |
-
|
621 |
-
// Build `<option>` elements.
|
622 |
-
this.$el.html( _.chain( this.filters ).map( function( filter, value ) {
|
623 |
-
return {
|
624 |
-
el: $( '<option></option>' ).val( value ).html( filter.text )[0],
|
625 |
-
priority: filter.priority || 50
|
626 |
-
};
|
627 |
-
}, this ).sortBy('priority').pluck('el').value() );
|
628 |
-
|
629 |
-
};
|
630 |
-
},
|
631 |
-
|
632 |
-
customizeAttachmentCompat: function(){
|
633 |
-
|
634 |
-
// validate
|
635 |
-
if( !acf.isset(wp, 'media', 'view', 'AttachmentCompat') ) {
|
636 |
-
return;
|
637 |
-
}
|
638 |
-
|
639 |
-
// vars
|
640 |
-
var AttachmentCompat = wp.media.view.AttachmentCompat;
|
641 |
-
var timeout = false;
|
642 |
-
|
643 |
-
// extend
|
644 |
-
wp.media.view.AttachmentCompat = AttachmentCompat.extend({
|
645 |
-
|
646 |
-
render: function() {
|
647 |
-
|
648 |
-
// WP bug
|
649 |
-
// When multiple media frames exist on the same page (WP content, WYSIWYG, image, file ),
|
650 |
-
// WP creates multiple instances of this AttachmentCompat view.
|
651 |
-
// Each instance will attempt to render when a new modal is created.
|
652 |
-
// Use a property to avoid this and only render once per instance.
|
653 |
-
if( this.rendered ) {
|
654 |
-
return this;
|
655 |
-
}
|
656 |
-
|
657 |
-
// render HTML
|
658 |
-
AttachmentCompat.prototype.render.apply( this, arguments );
|
659 |
-
|
660 |
-
// when uploading, render is called twice.
|
661 |
-
// ignore first render by checking for #acf-form-data element
|
662 |
-
if( !this.$('#acf-form-data').length ) {
|
663 |
-
return this;
|
664 |
-
}
|
665 |
-
|
666 |
-
// clear timeout
|
667 |
-
clearTimeout( timeout );
|
668 |
-
|
669 |
-
// setTimeout
|
670 |
-
timeout = setTimeout($.proxy(function(){
|
671 |
-
this.rendered = true;
|
672 |
-
acf.doAction('append', this.$el);
|
673 |
-
}, this), 50);
|
674 |
-
|
675 |
-
// return
|
676 |
-
return this;
|
677 |
-
},
|
678 |
-
|
679 |
-
save: function( event ) {
|
680 |
-
var data = {};
|
681 |
-
|
682 |
-
if ( event ) {
|
683 |
-
event.preventDefault();
|
684 |
-
}
|
685 |
-
|
686 |
-
//_.each( this.$el.serializeArray(), function( pair ) {
|
687 |
-
// data[ pair.name ] = pair.value;
|
688 |
-
//});
|
689 |
-
|
690 |
-
// Serialize data more thoroughly to allow chckbox inputs to save.
|
691 |
-
data = acf.serializeForAjax(this.$el);
|
692 |
-
|
693 |
-
this.controller.trigger( 'attachment:compat:waiting', ['waiting'] );
|
694 |
-
this.model.saveCompat( data ).always( _.bind( this.postSave, this ) );
|
695 |
-
}
|
696 |
-
});
|
697 |
-
|
698 |
-
},
|
699 |
-
|
700 |
-
customizeAttachmentLibrary: function(){
|
701 |
-
|
702 |
-
// validate
|
703 |
-
if( !acf.isset(wp, 'media', 'view', 'Attachment', 'Library') ) {
|
704 |
-
return;
|
705 |
-
}
|
706 |
-
|
707 |
-
// vars
|
708 |
-
var AttachmentLibrary = wp.media.view.Attachment.Library;
|
709 |
-
|
710 |
-
// extend
|
711 |
-
wp.media.view.Attachment.Library = AttachmentLibrary.extend({
|
712 |
-
|
713 |
-
render: function() {
|
714 |
-
|
715 |
-
// vars
|
716 |
-
var popup = acf.isget(this, 'controller', 'acf');
|
717 |
-
var attributes = acf.isget(this, 'model', 'attributes');
|
718 |
-
|
719 |
-
// check vars exist to avoid errors
|
720 |
-
if( popup && attributes ) {
|
721 |
-
|
722 |
-
// show errors
|
723 |
-
if( attributes.acf_errors ) {
|
724 |
-
this.$el.addClass('acf-disabled');
|
725 |
-
}
|
726 |
-
|
727 |
-
// disable selected
|
728 |
-
var selected = popup.get('selected');
|
729 |
-
if( selected && selected.indexOf(attributes.id) > -1 ) {
|
730 |
-
this.$el.addClass('acf-selected');
|
731 |
-
}
|
732 |
-
}
|
733 |
-
|
734 |
-
// render
|
735 |
-
return AttachmentLibrary.prototype.render.apply( this, arguments );
|
736 |
-
|
737 |
-
},
|
738 |
-
|
739 |
-
|
740 |
-
/*
|
741 |
-
* toggleSelection
|
742 |
-
*
|
743 |
-
* This function is called before an attachment is selected
|
744 |
-
* A good place to check for errors and prevent the 'select' function from being fired
|
745 |
-
*
|
746 |
-
* @type function
|
747 |
-
* @date 29/09/2016
|
748 |
-
* @since 5.4.0
|
749 |
-
*
|
750 |
-
* @param options (object)
|
751 |
-
* @return n/a
|
752 |
-
*/
|
753 |
-
|
754 |
-
toggleSelection: function( options ) {
|
755 |
-
|
756 |
-
// vars
|
757 |
-
// source: wp-includes/js/media-views.js:2880
|
758 |
-
var collection = this.collection,
|
759 |
-
selection = this.options.selection,
|
760 |
-
model = this.model,
|
761 |
-
single = selection.single();
|
762 |
-
|
763 |
-
|
764 |
-
// vars
|
765 |
-
var frame = this.controller;
|
766 |
-
var errors = acf.isget(this, 'model', 'attributes', 'acf_errors');
|
767 |
-
var $sidebar = frame.$el.find('.media-frame-content .media-sidebar');
|
768 |
-
|
769 |
-
// remove previous error
|
770 |
-
$sidebar.children('.acf-selection-error').remove();
|
771 |
-
|
772 |
-
// show attachment details
|
773 |
-
$sidebar.children().removeClass('acf-hidden');
|
774 |
-
|
775 |
-
// add message
|
776 |
-
if( frame && errors ) {
|
777 |
-
|
778 |
-
// vars
|
779 |
-
var filename = acf.isget(this, 'model', 'attributes', 'filename');
|
780 |
-
|
781 |
-
// hide attachment details
|
782 |
-
// Gallery field continues to show previously selected attachment...
|
783 |
-
$sidebar.children().addClass('acf-hidden');
|
784 |
-
|
785 |
-
// append message
|
786 |
-
$sidebar.prepend([
|
787 |
-
'<div class="acf-selection-error">',
|
788 |
-
'<span class="selection-error-label">' + acf.__('Restricted') +'</span>',
|
789 |
-
'<span class="selection-error-filename">' + filename + '</span>',
|
790 |
-
'<span class="selection-error-message">' + errors + '</span>',
|
791 |
-
'</div>'
|
792 |
-
].join(''));
|
793 |
-
|
794 |
-
// reset selection (unselects all attachments)
|
795 |
-
selection.reset();
|
796 |
-
|
797 |
-
// set single (attachment displayed in sidebar)
|
798 |
-
selection.single( model );
|
799 |
-
|
800 |
-
// return and prevent 'select' form being fired
|
801 |
-
return;
|
802 |
-
|
803 |
-
}
|
804 |
-
|
805 |
-
// return
|
806 |
-
return AttachmentLibrary.prototype.toggleSelection.apply( this, arguments );
|
807 |
-
}
|
808 |
-
});
|
809 |
-
}
|
810 |
-
});
|
811 |
-
|
812 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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|
2 |
-
|
3 |
-
// Cached regex to split keys for `addEvent`.
|
4 |
-
var delegateEventSplitter = /^(\S+)\s*(.*)$/;
|
5 |
-
|
6 |
-
/**
|
7 |
-
* extend
|
8 |
-
*
|
9 |
-
* Helper function to correctly set up the prototype chain for subclasses
|
10 |
-
* Heavily inspired by backbone.js
|
11 |
-
*
|
12 |
-
* @date 14/12/17
|
13 |
-
* @since 5.6.5
|
14 |
-
*
|
15 |
-
* @param object protoProps New properties for this object.
|
16 |
-
* @return function.
|
17 |
-
*/
|
18 |
-
|
19 |
-
var extend = function( protoProps ) {
|
20 |
-
|
21 |
-
// vars
|
22 |
-
var Parent = this;
|
23 |
-
var Child;
|
24 |
-
|
25 |
-
// The constructor function for the new subclass is either defined by you
|
26 |
-
// (the "constructor" property in your `extend` definition), or defaulted
|
27 |
-
// by us to simply call the parent constructor.
|
28 |
-
if( protoProps && protoProps.hasOwnProperty('constructor') ) {
|
29 |
-
Child = protoProps.constructor;
|
30 |
-
} else {
|
31 |
-
Child = function(){ return Parent.apply(this, arguments); };
|
32 |
-
}
|
33 |
-
|
34 |
-
// Add static properties to the constructor function, if supplied.
|
35 |
-
$.extend(Child, Parent);
|
36 |
-
|
37 |
-
// Set the prototype chain to inherit from `parent`, without calling
|
38 |
-
// `parent`'s constructor function and add the prototype properties.
|
39 |
-
Child.prototype = Object.create(Parent.prototype);
|
40 |
-
$.extend(Child.prototype, protoProps);
|
41 |
-
Child.prototype.constructor = Child;
|
42 |
-
|
43 |
-
// Set a convenience property in case the parent's prototype is needed later.
|
44 |
-
//Child.prototype.__parent__ = Parent.prototype;
|
45 |
-
|
46 |
-
// return
|
47 |
-
return Child;
|
48 |
-
|
49 |
-
};
|
50 |
-
|
51 |
-
|
52 |
-
/**
|
53 |
-
* Model
|
54 |
-
*
|
55 |
-
* Base class for all inheritence
|
56 |
-
*
|
57 |
-
* @date 14/12/17
|
58 |
-
* @since 5.6.5
|
59 |
-
*
|
60 |
-
* @param object props
|
61 |
-
* @return function.
|
62 |
-
*/
|
63 |
-
|
64 |
-
var Model = acf.Model = function(){
|
65 |
-
|
66 |
-
// generate uique client id
|
67 |
-
this.cid = acf.uniqueId('acf');
|
68 |
-
|
69 |
-
// set vars to avoid modifying prototype
|
70 |
-
this.data = $.extend(true, {}, this.data);
|
71 |
-
|
72 |
-
// pass props to setup function
|
73 |
-
this.setup.apply(this, arguments);
|
74 |
-
|
75 |
-
// store on element (allow this.setup to create this.$el)
|
76 |
-
if( this.$el && !this.$el.data('acf') ) {
|
77 |
-
this.$el.data('acf', this);
|
78 |
-
}
|
79 |
-
|
80 |
-
// initialize
|
81 |
-
var initialize = function(){
|
82 |
-
this.initialize();
|
83 |
-
this.addEvents();
|
84 |
-
this.addActions();
|
85 |
-
this.addFilters();
|
86 |
-
};
|
87 |
-
|
88 |
-
// initialize on action
|
89 |
-
if( this.wait && !acf.didAction(this.wait) ) {
|
90 |
-
this.addAction(this.wait, initialize);
|
91 |
-
|
92 |
-
// initialize now
|
93 |
-
} else {
|
94 |
-
initialize.apply(this);
|
95 |
-
}
|
96 |
-
};
|
97 |
-
|
98 |
-
// Attach all inheritable methods to the Model prototype.
|
99 |
-
$.extend(Model.prototype, {
|
100 |
-
|
101 |
-
// Unique model id
|
102 |
-
id: '',
|
103 |
-
|
104 |
-
// Unique client id
|
105 |
-
cid: '',
|
106 |
-
|
107 |
-
// jQuery element
|
108 |
-
$el: null,
|
109 |
-
|
110 |
-
// Data specific to this instance
|
111 |
-
data: {},
|
112 |
-
|
113 |
-
// toggle used when changing data
|
114 |
-
busy: false,
|
115 |
-
changed: false,
|
116 |
-
|
117 |
-
// Setup events hooks
|
118 |
-
events: {},
|
119 |
-
actions: {},
|
120 |
-
filters: {},
|
121 |
-
|
122 |
-
// class used to avoid nested event triggers
|
123 |
-
eventScope: '',
|
124 |
-
|
125 |
-
// action to wait until initialize
|
126 |
-
wait: false,
|
127 |
-
|
128 |
-
// action priority default
|
129 |
-
priority: 10,
|
130 |
-
|
131 |
-
/**
|
132 |
-
* get
|
133 |
-
*
|
134 |
-
* Gets a specific data value
|
135 |
-
*
|
136 |
-
* @date 14/12/17
|
137 |
-
* @since 5.6.5
|
138 |
-
*
|
139 |
-
* @param string name
|
140 |
-
* @return mixed
|
141 |
-
*/
|
142 |
-
|
143 |
-
get: function( name ) {
|
144 |
-
return this.data[name];
|
145 |
-
},
|
146 |
-
|
147 |
-
/**
|
148 |
-
* has
|
149 |
-
*
|
150 |
-
* Returns `true` if the data exists and is not null
|
151 |
-
*
|
152 |
-
* @date 14/12/17
|
153 |
-
* @since 5.6.5
|
154 |
-
*
|
155 |
-
* @param string name
|
156 |
-
* @return boolean
|
157 |
-
*/
|
158 |
-
|
159 |
-
has: function( name ) {
|
160 |
-
return this.get(name) != null;
|
161 |
-
},
|
162 |
-
|
163 |
-
/**
|
164 |
-
* set
|
165 |
-
*
|
166 |
-
* Sets a specific data value
|
167 |
-
*
|
168 |
-
* @date 14/12/17
|
169 |
-
* @since 5.6.5
|
170 |
-
*
|
171 |
-
* @param string name
|
172 |
-
* @param mixed value
|
173 |
-
* @return this
|
174 |
-
*/
|
175 |
-
|
176 |
-
set: function( name, value, silent ) {
|
177 |
-
|
178 |
-
// bail if unchanged
|
179 |
-
var prevValue = this.get(name);
|
180 |
-
if( prevValue == value ) {
|
181 |
-
return this;
|
182 |
-
}
|
183 |
-
|
184 |
-
// set data
|
185 |
-
this.data[ name ] = value;
|
186 |
-
|
187 |
-
// trigger events
|
188 |
-
if( !silent ) {
|
189 |
-
this.changed = true;
|
190 |
-
this.trigger('changed:' + name, [value, prevValue]);
|
191 |
-
this.trigger('changed', [name, value, prevValue]);
|
192 |
-
}
|
193 |
-
|
194 |
-
// return
|
195 |
-
return this;
|
196 |
-
},
|
197 |
-
|
198 |
-
/**
|
199 |
-
* inherit
|
200 |
-
*
|
201 |
-
* Inherits the data from a jQuery element
|
202 |
-
*
|
203 |
-
* @date 14/12/17
|
204 |
-
* @since 5.6.5
|
205 |
-
*
|
206 |
-
* @param jQuery $el
|
207 |
-
* @return this
|
208 |
-
*/
|
209 |
-
|
210 |
-
inherit: function( data ){
|
211 |
-
|
212 |
-
// allow jQuery
|
213 |
-
if( data instanceof jQuery ) {
|
214 |
-
data = data.data();
|
215 |
-
}
|
216 |
-
|
217 |
-
// extend
|
218 |
-
$.extend(this.data, data);
|
219 |
-
|
220 |
-
// return
|
221 |
-
return this;
|
222 |
-
},
|
223 |
-
|
224 |
-
/**
|
225 |
-
* prop
|
226 |
-
*
|
227 |
-
* mimics the jQuery prop function
|
228 |
-
*
|
229 |
-
* @date 4/6/18
|
230 |
-
* @since 5.6.9
|
231 |
-
*
|
232 |
-
* @param type $var Description. Default.
|
233 |
-
* @return type Description.
|
234 |
-
*/
|
235 |
-
|
236 |
-
prop: function(){
|
237 |
-
return this.$el.prop.apply(this.$el, arguments);
|
238 |
-
},
|
239 |
-
|
240 |
-
/**
|
241 |
-
* setup
|
242 |
-
*
|
243 |
-
* Run during constructor function
|
244 |
-
*
|
245 |
-
* @date 14/12/17
|
246 |
-
* @since 5.6.5
|
247 |
-
*
|
248 |
-
* @param n/a
|
249 |
-
* @return n/a
|
250 |
-
*/
|
251 |
-
|
252 |
-
setup: function( props ){
|
253 |
-
$.extend(this, props);
|
254 |
-
},
|
255 |
-
|
256 |
-
/**
|
257 |
-
* initialize
|
258 |
-
*
|
259 |
-
* Also run during constructor function
|
260 |
-
*
|
261 |
-
* @date 14/12/17
|
262 |
-
* @since 5.6.5
|
263 |
-
*
|
264 |
-
* @param n/a
|
265 |
-
* @return n/a
|
266 |
-
*/
|
267 |
-
|
268 |
-
initialize: function(){},
|
269 |
-
|
270 |
-
/**
|
271 |
-
* addElements
|
272 |
-
*
|
273 |
-
* Adds multiple jQuery elements to this object
|
274 |
-
*
|
275 |
-
* @date 9/5/18
|
276 |
-
* @since 5.6.9
|
277 |
-
*
|
278 |
-
* @param type $var Description. Default.
|
279 |
-
* @return type Description.
|
280 |
-
*/
|
281 |
-
|
282 |
-
addElements: function( elements ){
|
283 |
-
elements = elements || this.elements || null;
|
284 |
-
if( !elements || !Object.keys(elements).length ) return false;
|
285 |
-
for( var i in elements ) {
|
286 |
-
this.addElement( i, elements[i] );
|
287 |
-
}
|
288 |
-
},
|
289 |
-
|
290 |
-
/**
|
291 |
-
* addElement
|
292 |
-
*
|
293 |
-
* description
|
294 |
-
*
|
295 |
-
* @date 9/5/18
|
296 |
-
* @since 5.6.9
|
297 |
-
*
|
298 |
-
* @param type $var Description. Default.
|
299 |
-
* @return type Description.
|
300 |
-
*/
|
301 |
-
|
302 |
-
addElement: function( name, selector){
|
303 |
-
this[ '$' + name ] = this.$( selector );
|
304 |
-
},
|
305 |
-
|
306 |
-
/**
|
307 |
-
* addEvents
|
308 |
-
*
|
309 |
-
* Adds multiple event handlers
|
310 |
-
*
|
311 |
-
* @date 14/12/17
|
312 |
-
* @since 5.6.5
|
313 |
-
*
|
314 |
-
* @param object events {event1 : callback, event2 : callback, etc }
|
315 |
-
* @return n/a
|
316 |
-
*/
|
317 |
-
|
318 |
-
addEvents: function( events ){
|
319 |
-
events = events || this.events || null;
|
320 |
-
if( !events ) return false;
|
321 |
-
for( var key in events ) {
|
322 |
-
var match = key.match(delegateEventSplitter);
|
323 |
-
this.on(match[1], match[2], events[key]);
|
324 |
-
}
|
325 |
-
},
|
326 |
-
|
327 |
-
/**
|
328 |
-
* removeEvents
|
329 |
-
*
|
330 |
-
* Removes multiple event handlers
|
331 |
-
*
|
332 |
-
* @date 14/12/17
|
333 |
-
* @since 5.6.5
|
334 |
-
*
|
335 |
-
* @param object events {event1 : callback, event2 : callback, etc }
|
336 |
-
* @return n/a
|
337 |
-
*/
|
338 |
-
|
339 |
-
removeEvents: function( events ){
|
340 |
-
events = events || this.events || null;
|
341 |
-
if( !events ) return false;
|
342 |
-
for( var key in events ) {
|
343 |
-
var match = key.match(delegateEventSplitter);
|
344 |
-
this.off(match[1], match[2], events[key]);
|
345 |
-
}
|
346 |
-
},
|
347 |
-
|
348 |
-
/**
|
349 |
-
* getEventTarget
|
350 |
-
*
|
351 |
-
* Returns a jQUery element to tigger an event on
|
352 |
-
*
|
353 |
-
* @date 5/6/18
|
354 |
-
* @since 5.6.9
|
355 |
-
*
|
356 |
-
* @param jQuery $el The default jQuery element. Optional.
|
357 |
-
* @param string event The event name. Optional.
|
358 |
-
* @return jQuery
|
359 |
-
*/
|
360 |
-
|
361 |
-
getEventTarget: function( $el, event ){
|
362 |
-
return $el || this.$el || $(document);
|
363 |
-
},
|
364 |
-
|
365 |
-
/**
|
366 |
-
* validateEvent
|
367 |
-
*
|
368 |
-
* Returns true if the event target's closest $el is the same as this.$el
|
369 |
-
* Requires both this.el and this.$el to be defined
|
370 |
-
*
|
371 |
-
* @date 5/6/18
|
372 |
-
* @since 5.6.9
|
373 |
-
*
|
374 |
-
* @param type $var Description. Default.
|
375 |
-
* @return type Description.
|
376 |
-
*/
|
377 |
-
|
378 |
-
validateEvent: function( e ){
|
379 |
-
if( this.eventScope ) {
|
380 |
-
return $( e.target ).closest( this.eventScope ).is( this.$el );
|
381 |
-
} else {
|
382 |
-
return true;
|
383 |
-
}
|
384 |
-
},
|
385 |
-
|
386 |
-
/**
|
387 |
-
* proxyEvent
|
388 |
-
*
|
389 |
-
* Returns a new event callback function scoped to this model
|
390 |
-
*
|
391 |
-
* @date 29/3/18
|
392 |
-
* @since 5.6.9
|
393 |
-
*
|
394 |
-
* @param function callback
|
395 |
-
* @return function
|
396 |
-
*/
|
397 |
-
|
398 |
-
proxyEvent: function( callback ){
|
399 |
-
return this.proxy(function(e){
|
400 |
-
|
401 |
-
// validate
|
402 |
-
if( !this.validateEvent(e) ) {
|
403 |
-
return;
|
404 |
-
}
|
405 |
-
|
406 |
-
// construct args
|
407 |
-
var args = acf.arrayArgs( arguments );
|
408 |
-
var extraArgs = args.slice(1);
|
409 |
-
var eventArgs = [ e, $(e.currentTarget) ].concat( extraArgs );
|
410 |
-
|
411 |
-
// callback
|
412 |
-
callback.apply(this, eventArgs);
|
413 |
-
});
|
414 |
-
},
|
415 |
-
|
416 |
-
/**
|
417 |
-
* on
|
418 |
-
*
|
419 |
-
* Adds an event handler similar to jQuery
|
420 |
-
* Uses the instance 'cid' to namespace event
|
421 |
-
*
|
422 |
-
* @date 14/12/17
|
423 |
-
* @since 5.6.5
|
424 |
-
*
|
425 |
-
* @param string name
|
426 |
-
* @param string callback
|
427 |
-
* @return n/a
|
428 |
-
*/
|
429 |
-
|
430 |
-
on: function( a1, a2, a3, a4 ){
|
431 |
-
|
432 |
-
// vars
|
433 |
-
var $el, event, selector, callback, args;
|
434 |
-
|
435 |
-
// find args
|
436 |
-
if( a1 instanceof jQuery ) {
|
437 |
-
|
438 |
-
// 1. args( $el, event, selector, callback )
|
439 |
-
if( a4 ) {
|
440 |
-
$el = a1; event = a2; selector = a3; callback = a4;
|
441 |
-
|
442 |
-
// 2. args( $el, event, callback )
|
443 |
-
} else {
|
444 |
-
$el = a1; event = a2; callback = a3;
|
445 |
-
}
|
446 |
-
} else {
|
447 |
-
|
448 |
-
// 3. args( event, selector, callback )
|
449 |
-
if( a3 ) {
|
450 |
-
event = a1; selector = a2; callback = a3;
|
451 |
-
|
452 |
-
// 4. args( event, callback )
|
453 |
-
} else {
|
454 |
-
event = a1; callback = a2;
|
455 |
-
}
|
456 |
-
}
|
457 |
-
|
458 |
-
// element
|
459 |
-
$el = this.getEventTarget( $el );
|
460 |
-
|
461 |
-
// modify callback
|
462 |
-
if( typeof callback === 'string' ) {
|
463 |
-
callback = this.proxyEvent( this[callback] );
|
464 |
-
}
|
465 |
-
|
466 |
-
// modify event
|
467 |
-
event = event + '.' + this.cid;
|
468 |
-
|
469 |
-
// args
|
470 |
-
if( selector ) {
|
471 |
-
args = [ event, selector, callback ];
|
472 |
-
} else {
|
473 |
-
args = [ event, callback ];
|
474 |
-
}
|
475 |
-
|
476 |
-
// on()
|
477 |
-
$el.on.apply($el, args);
|
478 |
-
},
|
479 |
-
|
480 |
-
/**
|
481 |
-
* off
|
482 |
-
*
|
483 |
-
* Removes an event handler similar to jQuery
|
484 |
-
*
|
485 |
-
* @date 14/12/17
|
486 |
-
* @since 5.6.5
|
487 |
-
*
|
488 |
-
* @param string name
|
489 |
-
* @param string callback
|
490 |
-
* @return n/a
|
491 |
-
*/
|
492 |
-
|
493 |
-
off: function( a1, a2 ,a3 ){
|
494 |
-
|
495 |
-
// vars
|
496 |
-
var $el, event, selector, args;
|
497 |
-
|
498 |
-
// find args
|
499 |
-
if( a1 instanceof jQuery ) {
|
500 |
-
|
501 |
-
// 1. args( $el, event, selector )
|
502 |
-
if( a3 ) {
|
503 |
-
$el = a1; event = a2; selector = a3;
|
504 |
-
|
505 |
-
// 2. args( $el, event )
|
506 |
-
} else {
|
507 |
-
$el = a1; event = a2;
|
508 |
-
}
|
509 |
-
} else {
|
510 |
-
|
511 |
-
// 3. args( event, selector )
|
512 |
-
if( a2 ) {
|
513 |
-
event = a1; selector = a2;
|
514 |
-
|
515 |
-
// 4. args( event )
|
516 |
-
} else {
|
517 |
-
event = a1;
|
518 |
-
}
|
519 |
-
}
|
520 |
-
|
521 |
-
// element
|
522 |
-
$el = this.getEventTarget( $el );
|
523 |
-
|
524 |
-
// modify event
|
525 |
-
event = event + '.' + this.cid;
|
526 |
-
|
527 |
-
// args
|
528 |
-
if( selector ) {
|
529 |
-
args = [ event, selector ];
|
530 |
-
} else {
|
531 |
-
args = [ event ];
|
532 |
-
}
|
533 |
-
|
534 |
-
// off()
|
535 |
-
$el.off.apply($el, args);
|
536 |
-
},
|
537 |
-
|
538 |
-
/**
|
539 |
-
* trigger
|
540 |
-
*
|
541 |
-
* Triggers an event similar to jQuery
|
542 |
-
*
|
543 |
-
* @date 14/12/17
|
544 |
-
* @since 5.6.5
|
545 |
-
*
|
546 |
-
* @param string name
|
547 |
-
* @param string callback
|
548 |
-
* @return n/a
|
549 |
-
*/
|
550 |
-
|
551 |
-
trigger: function( name, args, bubbles ){
|
552 |
-
var $el = this.getEventTarget();
|
553 |
-
if( bubbles ) {
|
554 |
-
$el.trigger.apply( $el, arguments );
|
555 |
-
} else {
|
556 |
-
$el.triggerHandler.apply( $el, arguments );
|
557 |
-
}
|
558 |
-
return this;
|
559 |
-
},
|
560 |
-
|
561 |
-
/**
|
562 |
-
* addActions
|
563 |
-
*
|
564 |
-
* Adds multiple action handlers
|
565 |
-
*
|
566 |
-
* @date 14/12/17
|
567 |
-
* @since 5.6.5
|
568 |
-
*
|
569 |
-
* @param object actions {action1 : callback, action2 : callback, etc }
|
570 |
-
* @return n/a
|
571 |
-
*/
|
572 |
-
|
573 |
-
addActions: function( actions ){
|
574 |
-
actions = actions || this.actions || null;
|
575 |
-
if( !actions ) return false;
|
576 |
-
for( var i in actions ) {
|
577 |
-
this.addAction( i, actions[i] );
|
578 |
-
}
|
579 |
-
},
|
580 |
-
|
581 |
-
/**
|
582 |
-
* removeActions
|
583 |
-
*
|
584 |
-
* Removes multiple action handlers
|
585 |
-
*
|
586 |
-
* @date 14/12/17
|
587 |
-
* @since 5.6.5
|
588 |
-
*
|
589 |
-
* @param object actions {action1 : callback, action2 : callback, etc }
|
590 |
-
* @return n/a
|
591 |
-
*/
|
592 |
-
|
593 |
-
removeActions: function( actions ){
|
594 |
-
actions = actions || this.actions || null;
|
595 |
-
if( !actions ) return false;
|
596 |
-
for( var i in actions ) {
|
597 |
-
this.removeAction( i, actions[i] );
|
598 |
-
}
|
599 |
-
},
|
600 |
-
|
601 |
-
/**
|
602 |
-
* addAction
|
603 |
-
*
|
604 |
-
* Adds an action using the wp.hooks library
|
605 |
-
*
|
606 |
-
* @date 14/12/17
|
607 |
-
* @since 5.6.5
|
608 |
-
*
|
609 |
-
* @param string name
|
610 |
-
* @param string callback
|
611 |
-
* @return n/a
|
612 |
-
*/
|
613 |
-
|
614 |
-
addAction: function( name, callback, priority ){
|
615 |
-
//console.log('addAction', name, priority);
|
616 |
-
// defaults
|
617 |
-
priority = priority || this.priority;
|
618 |
-
|
619 |
-
// modify callback
|
620 |
-
if( typeof callback === 'string' ) {
|
621 |
-
callback = this[ callback ];
|
622 |
-
}
|
623 |
-
|
624 |
-
// add
|
625 |
-
acf.addAction(name, callback, priority, this);
|
626 |
-
|
627 |
-
},
|
628 |
-
|
629 |
-
/**
|
630 |
-
* removeAction
|
631 |
-
*
|
632 |
-
* Remove an action using the wp.hooks library
|
633 |
-
*
|
634 |
-
* @date 14/12/17
|
635 |
-
* @since 5.6.5
|
636 |
-
*
|
637 |
-
* @param string name
|
638 |
-
* @param string callback
|
639 |
-
* @return n/a
|
640 |
-
*/
|
641 |
-
|
642 |
-
removeAction: function( name, callback ){
|
643 |
-
acf.removeAction(name, this[ callback ]);
|
644 |
-
},
|
645 |
-
|
646 |
-
/**
|
647 |
-
* addFilters
|
648 |
-
*
|
649 |
-
* Adds multiple filter handlers
|
650 |
-
*
|
651 |
-
* @date 14/12/17
|
652 |
-
* @since 5.6.5
|
653 |
-
*
|
654 |
-
* @param object filters {filter1 : callback, filter2 : callback, etc }
|
655 |
-
* @return n/a
|
656 |
-
*/
|
657 |
-
|
658 |
-
addFilters: function( filters ){
|
659 |
-
filters = filters || this.filters || null;
|
660 |
-
if( !filters ) return false;
|
661 |
-
for( var i in filters ) {
|
662 |
-
this.addFilter( i, filters[i] );
|
663 |
-
}
|
664 |
-
},
|
665 |
-
|
666 |
-
/**
|
667 |
-
* addFilter
|
668 |
-
*
|
669 |
-
* Adds a filter using the wp.hooks library
|
670 |
-
*
|
671 |
-
* @date 14/12/17
|
672 |
-
* @since 5.6.5
|
673 |
-
*
|
674 |
-
* @param string name
|
675 |
-
* @param string callback
|
676 |
-
* @return n/a
|
677 |
-
*/
|
678 |
-
|
679 |
-
addFilter: function( name, callback, priority ){
|
680 |
-
|
681 |
-
// defaults
|
682 |
-
priority = priority || this.priority;
|
683 |
-
|
684 |
-
// modify callback
|
685 |
-
if( typeof callback === 'string' ) {
|
686 |
-
callback = this[ callback ];
|
687 |
-
}
|
688 |
-
|
689 |
-
// add
|
690 |
-
acf.addFilter(name, callback, priority, this);
|
691 |
-
|
692 |
-
},
|
693 |
-
|
694 |
-
/**
|
695 |
-
* removeFilters
|
696 |
-
*
|
697 |
-
* Removes multiple filter handlers
|
698 |
-
*
|
699 |
-
* @date 14/12/17
|
700 |
-
* @since 5.6.5
|
701 |
-
*
|
702 |
-
* @param object filters {filter1 : callback, filter2 : callback, etc }
|
703 |
-
* @return n/a
|
704 |
-
*/
|
705 |
-
|
706 |
-
removeFilters: function( filters ){
|
707 |
-
filters = filters || this.filters || null;
|
708 |
-
if( !filters ) return false;
|
709 |
-
for( var i in filters ) {
|
710 |
-
this.removeFilter( i, filters[i] );
|
711 |
-
}
|
712 |
-
},
|
713 |
-
|
714 |
-
/**
|
715 |
-
* removeFilter
|
716 |
-
*
|
717 |
-
* Remove a filter using the wp.hooks library
|
718 |
-
*
|
719 |
-
* @date 14/12/17
|
720 |
-
* @since 5.6.5
|
721 |
-
*
|
722 |
-
* @param string name
|
723 |
-
* @param string callback
|
724 |
-
* @return n/a
|
725 |
-
*/
|
726 |
-
|
727 |
-
removeFilter: function( name, callback ){
|
728 |
-
acf.removeFilter(name, this[ callback ]);
|
729 |
-
},
|
730 |
-
|
731 |
-
/**
|
732 |
-
* $
|
733 |
-
*
|
734 |
-
* description
|
735 |
-
*
|
736 |
-
* @date 16/12/17
|
737 |
-
* @since 5.6.5
|
738 |
-
*
|
739 |
-
* @param type $var Description. Default.
|
740 |
-
* @return type Description.
|
741 |
-
*/
|
742 |
-
|
743 |
-
$: function( selector ){
|
744 |
-
return this.$el.find( selector );
|
745 |
-
},
|
746 |
-
|
747 |
-
/**
|
748 |
-
* remove
|
749 |
-
*
|
750 |
-
* Removes the element and listenters
|
751 |
-
*
|
752 |
-
* @date 19/12/17
|
753 |
-
* @since 5.6.5
|
754 |
-
*
|
755 |
-
* @param type $var Description. Default.
|
756 |
-
* @return type Description.
|
757 |
-
*/
|
758 |
-
|
759 |
-
remove: function(){
|
760 |
-
this.removeEvents();
|
761 |
-
this.removeActions();
|
762 |
-
this.removeFilters();
|
763 |
-
this.$el.remove();
|
764 |
-
},
|
765 |
-
|
766 |
-
/**
|
767 |
-
* setTimeout
|
768 |
-
*
|
769 |
-
* description
|
770 |
-
*
|
771 |
-
* @date 16/1/18
|
772 |
-
* @since 5.6.5
|
773 |
-
*
|
774 |
-
* @param type $var Description. Default.
|
775 |
-
* @return type Description.
|
776 |
-
*/
|
777 |
-
|
778 |
-
setTimeout: function( callback, milliseconds ){
|
779 |
-
return setTimeout( this.proxy(callback), milliseconds );
|
780 |
-
},
|
781 |
-
|
782 |
-
/**
|
783 |
-
* time
|
784 |
-
*
|
785 |
-
* used for debugging
|
786 |
-
*
|
787 |
-
* @date 7/3/18
|
788 |
-
* @since 5.6.9
|
789 |
-
*
|
790 |
-
* @param type $var Description. Default.
|
791 |
-
* @return type Description.
|
792 |
-
*/
|
793 |
-
|
794 |
-
time: function(){
|
795 |
-
console.time( this.id || this.cid );
|
796 |
-
},
|
797 |
-
|
798 |
-
/**
|
799 |
-
* timeEnd
|
800 |
-
*
|
801 |
-
* used for debugging
|
802 |
-
*
|
803 |
-
* @date 7/3/18
|
804 |
-
* @since 5.6.9
|
805 |
-
*
|
806 |
-
* @param type $var Description. Default.
|
807 |
-
* @return type Description.
|
808 |
-
*/
|
809 |
-
|
810 |
-
timeEnd: function(){
|
811 |
-
console.timeEnd( this.id || this.cid );
|
812 |
-
},
|
813 |
-
|
814 |
-
/**
|
815 |
-
* show
|
816 |
-
*
|
817 |
-
* description
|
818 |
-
*
|
819 |
-
* @date 15/3/18
|
820 |
-
* @since 5.6.9
|
821 |
-
*
|
822 |
-
* @param type $var Description. Default.
|
823 |
-
* @return type Description.
|
824 |
-
*/
|
825 |
-
|
826 |
-
show: function(){
|
827 |
-
acf.show( this.$el );
|
828 |
-
},
|
829 |
-
|
830 |
-
|
831 |
-
/**
|
832 |
-
* hide
|
833 |
-
*
|
834 |
-
* description
|
835 |
-
*
|
836 |
-
* @date 15/3/18
|
837 |
-
* @since 5.6.9
|
838 |
-
*
|
839 |
-
* @param type $var Description. Default.
|
840 |
-
* @return type Description.
|
841 |
-
*/
|
842 |
-
|
843 |
-
hide: function(){
|
844 |
-
acf.hide( this.$el );
|
845 |
-
},
|
846 |
-
|
847 |
-
/**
|
848 |
-
* proxy
|
849 |
-
*
|
850 |
-
* Returns a new function scoped to this model
|
851 |
-
*
|
852 |
-
* @date 29/3/18
|
853 |
-
* @since 5.6.9
|
854 |
-
*
|
855 |
-
* @param function callback
|
856 |
-
* @return function
|
857 |
-
*/
|
858 |
-
|
859 |
-
proxy: function( callback ){
|
860 |
-
return $.proxy( callback, this );
|
861 |
-
}
|
862 |
-
|
863 |
-
|
864 |
-
});
|
865 |
-
|
866 |
-
// Set up inheritance for the model
|
867 |
-
Model.extend = extend;
|
868 |
-
|
869 |
-
// Global model storage
|
870 |
-
acf.models = {};
|
871 |
-
|
872 |
-
/**
|
873 |
-
* acf.getInstance
|
874 |
-
*
|
875 |
-
* This function will get an instance from an element
|
876 |
-
*
|
877 |
-
* @date 5/3/18
|
878 |
-
* @since 5.6.9
|
879 |
-
*
|
880 |
-
* @param type $var Description. Default.
|
881 |
-
* @return type Description.
|
882 |
-
*/
|
883 |
-
|
884 |
-
acf.getInstance = function( $el ){
|
885 |
-
return $el.data('acf');
|
886 |
-
};
|
887 |
-
|
888 |
-
/**
|
889 |
-
* acf.getInstances
|
890 |
-
*
|
891 |
-
* This function will get an array of instances from multiple elements
|
892 |
-
*
|
893 |
-
* @date 5/3/18
|
894 |
-
* @since 5.6.9
|
895 |
-
*
|
896 |
-
* @param type $var Description. Default.
|
897 |
-
* @return type Description.
|
898 |
-
*/
|
899 |
-
|
900 |
-
acf.getInstances = function( $el ){
|
901 |
-
var instances = [];
|
902 |
-
$el.each(function(){
|
903 |
-
instances.push( acf.getInstance( $(this) ) );
|
904 |
-
});
|
905 |
-
return instances;
|
906 |
-
};
|
907 |
-
|
908 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/build/js/_acf-notice.js
DELETED
@@ -1,146 +0,0 @@
|
|
1 |
-
(function($, undefined){
|
2 |
-
|
3 |
-
var Notice = acf.Model.extend({
|
4 |
-
|
5 |
-
data: {
|
6 |
-
text: '',
|
7 |
-
type: '',
|
8 |
-
timeout: 0,
|
9 |
-
dismiss: true,
|
10 |
-
target: false,
|
11 |
-
close: function(){}
|
12 |
-
},
|
13 |
-
|
14 |
-
events: {
|
15 |
-
'click .acf-notice-dismiss': 'onClickClose',
|
16 |
-
},
|
17 |
-
|
18 |
-
tmpl: function(){
|
19 |
-
return '<div class="acf-notice"></div>';
|
20 |
-
},
|
21 |
-
|
22 |
-
setup: function( props ){
|
23 |
-
$.extend(this.data, props);
|
24 |
-
this.$el = $(this.tmpl());
|
25 |
-
},
|
26 |
-
|
27 |
-
initialize: function(){
|
28 |
-
|
29 |
-
// render
|
30 |
-
this.render();
|
31 |
-
|
32 |
-
// show
|
33 |
-
this.show();
|
34 |
-
},
|
35 |
-
|
36 |
-
render: function(){
|
37 |
-
|
38 |
-
// class
|
39 |
-
this.type( this.get('type') );
|
40 |
-
|
41 |
-
// text
|
42 |
-
this.html( '<p>' + this.get('text') + '</p>' );
|
43 |
-
|
44 |
-
// close
|
45 |
-
if( this.get('dismiss') ) {
|
46 |
-
this.$el.append('<a href="#" class="acf-notice-dismiss acf-icon -cancel small"></a>');
|
47 |
-
this.$el.addClass('-dismiss');
|
48 |
-
}
|
49 |
-
|
50 |
-
// timeout
|
51 |
-
var timeout = this.get('timeout');
|
52 |
-
if( timeout ) {
|
53 |
-
this.away( timeout );
|
54 |
-
}
|
55 |
-
},
|
56 |
-
|
57 |
-
update: function( props ){
|
58 |
-
|
59 |
-
// update
|
60 |
-
$.extend(this.data, props);
|
61 |
-
|
62 |
-
// re-initialize
|
63 |
-
this.initialize();
|
64 |
-
|
65 |
-
// refresh events
|
66 |
-
this.removeEvents();
|
67 |
-
this.addEvents();
|
68 |
-
},
|
69 |
-
|
70 |
-
show: function(){
|
71 |
-
var $target = this.get('target');
|
72 |
-
if( $target ) {
|
73 |
-
$target.prepend( this.$el );
|
74 |
-
}
|
75 |
-
},
|
76 |
-
|
77 |
-
hide: function(){
|
78 |
-
this.$el.remove();
|
79 |
-
},
|
80 |
-
|
81 |
-
away: function( timeout ){
|
82 |
-
this.setTimeout(function(){
|
83 |
-
acf.remove( this.$el );
|
84 |
-
}, timeout );
|
85 |
-
},
|
86 |
-
|
87 |
-
type: function( type ){
|
88 |
-
|
89 |
-
// remove prev type
|
90 |
-
var prevType = this.get('type');
|
91 |
-
if( prevType ) {
|
92 |
-
this.$el.removeClass('-' + prevType);
|
93 |
-
}
|
94 |
-
|
95 |
-
// add new type
|
96 |
-
this.$el.addClass('-' + type);
|
97 |
-
|
98 |
-
// backwards compatibility
|
99 |
-
if( type == 'error' ) {
|
100 |
-
this.$el.addClass('acf-error-message');
|
101 |
-
}
|
102 |
-
},
|
103 |
-
|
104 |
-
html: function( html ){
|
105 |
-
this.$el.html( html );
|
106 |
-
},
|
107 |
-
|
108 |
-
text: function( text ){
|
109 |
-
this.$('p').html( text );
|
110 |
-
},
|
111 |
-
|
112 |
-
onClickClose: function( e, $el ){
|
113 |
-
e.preventDefault();
|
114 |
-
this.get('close').apply(this, arguments);
|
115 |
-
this.remove();
|
116 |
-
}
|
117 |
-
});
|
118 |
-
|
119 |
-
acf.newNotice = function( props ){
|
120 |
-
|
121 |
-
// ensure object
|
122 |
-
if( typeof props !== 'object' ) {
|
123 |
-
props = { text: props };
|
124 |
-
}
|
125 |
-
|
126 |
-
// instantiate
|
127 |
-
return new Notice( props );
|
128 |
-
};
|
129 |
-
|
130 |
-
var noticeManager = new acf.Model({
|
131 |
-
wait: 'prepare',
|
132 |
-
priority: 1,
|
133 |
-
initialize: function(){
|
134 |
-
|
135 |
-
// vars
|
136 |
-
var $notice = $('.acf-admin-notice');
|
137 |
-
|
138 |
-
// move to avoid WP flicker
|
139 |
-
if( $notice.length ) {
|
140 |
-
$('h1:first').after( $notice );
|
141 |
-
}
|
142 |
-
}
|
143 |
-
});
|
144 |
-
|
145 |
-
|
146 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/build/js/_acf-panel.js
DELETED
@@ -1,34 +0,0 @@
|
|
1 |
-
(function($, undefined){
|
2 |
-
|
3 |
-
var panel = new acf.Model({
|
4 |
-
|
5 |
-
events: {
|
6 |
-
'click .acf-panel-title': 'onClick',
|
7 |
-
},
|
8 |
-
|
9 |
-
onClick: function( e, $el ){
|
10 |
-
e.preventDefault();
|
11 |
-
this.toggle( $el.parent() );
|
12 |
-
},
|
13 |
-
|
14 |
-
isOpen: function( $el ) {
|
15 |
-
return $el.hasClass('-open');
|
16 |
-
},
|
17 |
-
|
18 |
-
toggle: function( $el ){
|
19 |
-
this.isOpen($el) ? this.close( $el ) : this.open( $el );
|
20 |
-
},
|
21 |
-
|
22 |
-
open: function( $el ){
|
23 |
-
$el.addClass('-open');
|
24 |
-
$el.find('.acf-panel-title i').attr('class', 'dashicons dashicons-arrow-down');
|
25 |
-
},
|
26 |
-
|
27 |
-
close: function( $el ){
|
28 |
-
$el.removeClass('-open');
|
29 |
-
$el.find('.acf-panel-title i').attr('class', 'dashicons dashicons-arrow-right');
|
30 |
-
}
|
31 |
-
|
32 |
-
});
|
33 |
-
|
34 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/build/js/_acf-popup.js
DELETED
@@ -1,121 +0,0 @@
|
|
1 |
-
(function($, undefined){
|
2 |
-
|
3 |
-
acf.models.Popup = acf.Model.extend({
|
4 |
-
|
5 |
-
data: {
|
6 |
-
title: '',
|
7 |
-
content: '',
|
8 |
-
width: 0,
|
9 |
-
height: 0,
|
10 |
-
loading: false,
|
11 |
-
},
|
12 |
-
|
13 |
-
events: {
|
14 |
-
'click [data-event="close"]': 'onClickClose',
|
15 |
-
'click .acf-close-popup': 'onClickClose',
|
16 |
-
},
|
17 |
-
|
18 |
-
setup: function( props ){
|
19 |
-
$.extend(this.data, props);
|
20 |
-
this.$el = $(this.tmpl());
|
21 |
-
},
|
22 |
-
|
23 |
-
initialize: function(){
|
24 |
-
this.render();
|
25 |
-
this.open();
|
26 |
-
},
|
27 |
-
|
28 |
-
tmpl: function(){
|
29 |
-
return [
|
30 |
-
'<div id="acf-popup">',
|
31 |
-
'<div class="acf-popup-box acf-box">',
|
32 |
-
'<div class="title"><h3></h3><a href="#" class="acf-icon -cancel grey" data-event="close"></a></div>',
|
33 |
-
'<div class="inner"></div>',
|
34 |
-
'<div class="loading"><i class="acf-loading"></i></div>',
|
35 |
-
'</div>',
|
36 |
-
'<div class="bg" data-event="close"></div>',
|
37 |
-
'</div>'
|
38 |
-
].join('');
|
39 |
-
},
|
40 |
-
|
41 |
-
render: function(){
|
42 |
-
|
43 |
-
// vars
|
44 |
-
var title = this.get('title');
|
45 |
-
var content = this.get('content');
|
46 |
-
var loading = this.get('loading');
|
47 |
-
var width = this.get('width');
|
48 |
-
var height = this.get('height');
|
49 |
-
|
50 |
-
// html
|
51 |
-
this.title( title );
|
52 |
-
this.content( content );
|
53 |
-
|
54 |
-
// width
|
55 |
-
if( width ) {
|
56 |
-
this.$('.acf-popup-box').css('width', width);
|
57 |
-
}
|
58 |
-
|
59 |
-
// height
|
60 |
-
if( height ) {
|
61 |
-
this.$('.acf-popup-box').css('min-height', height);
|
62 |
-
}
|
63 |
-
|
64 |
-
// loading
|
65 |
-
this.loading( loading );
|
66 |
-
|
67 |
-
// action
|
68 |
-
acf.doAction('append', this.$el);
|
69 |
-
|
70 |
-
},
|
71 |
-
|
72 |
-
update: function( props ){
|
73 |
-
this.data = acf.parseArgs(props, this.data);
|
74 |
-
this.render();
|
75 |
-
},
|
76 |
-
|
77 |
-
title: function( title ){
|
78 |
-
this.$('.title:first h3').html( title );
|
79 |
-
},
|
80 |
-
|
81 |
-
content: function( content ){
|
82 |
-
this.$('.inner:first').html( content );
|
83 |
-
},
|
84 |
-
|
85 |
-
loading: function( show ){
|
86 |
-
var $loading = this.$('.loading:first');
|
87 |
-
show ? $loading.show() : $loading.hide();
|
88 |
-
},
|
89 |
-
|
90 |
-
open: function(){
|
91 |
-
$('body').append( this.$el );
|
92 |
-
},
|
93 |
-
|
94 |
-
close: function(){
|
95 |
-
this.remove();
|
96 |
-
},
|
97 |
-
|
98 |
-
onClickClose: function( e, $el ){
|
99 |
-
e.preventDefault();
|
100 |
-
this.close();
|
101 |
-
}
|
102 |
-
|
103 |
-
});
|
104 |
-
|
105 |
-
/**
|
106 |
-
* newPopup
|
107 |
-
*
|
108 |
-
* Creates a new Popup with the supplied props
|
109 |
-
*
|
110 |
-
* @date 17/12/17
|
111 |
-
* @since 5.6.5
|
112 |
-
*
|
113 |
-
* @param object props
|
114 |
-
* @return object
|
115 |
-
*/
|
116 |
-
|
117 |
-
acf.newPopup = function( props ){
|
118 |
-
return new acf.models.Popup( props );
|
119 |
-
};
|
120 |
-
|
121 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/build/js/_acf-postbox.js
DELETED
@@ -1,191 +0,0 @@
|
|
1 |
-
(function($, undefined){
|
2 |
-
|
3 |
-
/**
|
4 |
-
* acf.getPostbox
|
5 |
-
*
|
6 |
-
* Returns a postbox instance.
|
7 |
-
*
|
8 |
-
* @date 23/9/18
|
9 |
-
* @since 5.7.7
|
10 |
-
*
|
11 |
-
* @param mixed $el Either a jQuery element or the postbox id.
|
12 |
-
* @return object
|
13 |
-
*/
|
14 |
-
acf.getPostbox = function( $el ){
|
15 |
-
|
16 |
-
// allow string parameter
|
17 |
-
if( typeof arguments[0] == 'string' ) {
|
18 |
-
$el = $('#' + arguments[0]);
|
19 |
-
}
|
20 |
-
|
21 |
-
// return instance
|
22 |
-
return acf.getInstance( $el );
|
23 |
-
};
|
24 |
-
|
25 |
-
/**
|
26 |
-
* acf.getPostboxes
|
27 |
-
*
|
28 |
-
* Returns an array of postbox instances.
|
29 |
-
*
|
30 |
-
* @date 23/9/18
|
31 |
-
* @since 5.7.7
|
32 |
-
*
|
33 |
-
* @param void
|
34 |
-
* @return array
|
35 |
-
*/
|
36 |
-
acf.getPostboxes = function(){
|
37 |
-
return acf.getInstances( $('.acf-postbox') );
|
38 |
-
};
|
39 |
-
|
40 |
-
/**
|
41 |
-
* acf.newPostbox
|
42 |
-
*
|
43 |
-
* Returns a new postbox instance for the given props.
|
44 |
-
*
|
45 |
-
* @date 20/9/18
|
46 |
-
* @since 5.7.6
|
47 |
-
*
|
48 |
-
* @param object props The postbox properties.
|
49 |
-
* @return object
|
50 |
-
*/
|
51 |
-
acf.newPostbox = function( props ){
|
52 |
-
return new acf.models.Postbox( props );
|
53 |
-
};
|
54 |
-
|
55 |
-
/**
|
56 |
-
* acf.models.Postbox
|
57 |
-
*
|
58 |
-
* The postbox model.
|
59 |
-
*
|
60 |
-
* @date 20/9/18
|
61 |
-
* @since 5.7.6
|
62 |
-
*
|
63 |
-
* @param void
|
64 |
-
* @return void
|
65 |
-
*/
|
66 |
-
acf.models.Postbox = acf.Model.extend({
|
67 |
-
|
68 |
-
data: {
|
69 |
-
id: '',
|
70 |
-
key: '',
|
71 |
-
style: 'default',
|
72 |
-
label: 'top',
|
73 |
-
edit: ''
|
74 |
-
},
|
75 |
-
|
76 |
-
setup: function( props ){
|
77 |
-
|
78 |
-
// compatibilty
|
79 |
-
if( props.editLink ) {
|
80 |
-
props.edit = props.editLink;
|
81 |
-
}
|
82 |
-
|
83 |
-
// extend data
|
84 |
-
$.extend(this.data, props);
|
85 |
-
|
86 |
-
// set $el
|
87 |
-
this.$el = this.$postbox();
|
88 |
-
},
|
89 |
-
|
90 |
-
$postbox: function(){
|
91 |
-
return $('#' + this.get('id'));
|
92 |
-
},
|
93 |
-
|
94 |
-
$hide: function(){
|
95 |
-
return $('#' + this.get('id') + '-hide');
|
96 |
-
},
|
97 |
-
|
98 |
-
$hideLabel: function(){
|
99 |
-
return this.$hide().parent();
|
100 |
-
},
|
101 |
-
|
102 |
-
$hndle: function(){
|
103 |
-
return this.$('> .hndle');
|
104 |
-
},
|
105 |
-
|
106 |
-
$inside: function(){
|
107 |
-
return this.$('> .inside');
|
108 |
-
},
|
109 |
-
|
110 |
-
isVisible: function(){
|
111 |
-
return this.$el.hasClass('acf-hidden');
|
112 |
-
},
|
113 |
-
|
114 |
-
initialize: function(){
|
115 |
-
|
116 |
-
// Add default class.
|
117 |
-
this.$el.addClass('acf-postbox');
|
118 |
-
|
119 |
-
// Remove 'hide-if-js class.
|
120 |
-
// This class is added by WP to postboxes that are hidden via the "Screen Options" tab.
|
121 |
-
this.$el.removeClass('hide-if-js');
|
122 |
-
|
123 |
-
// Add field group style class.
|
124 |
-
var style = this.get('style');
|
125 |
-
if( style !== 'default' ) {
|
126 |
-
this.$el.addClass( style );
|
127 |
-
}
|
128 |
-
|
129 |
-
// Add .inside class.
|
130 |
-
this.$inside().addClass('acf-fields').addClass('-' + this.get('label'));
|
131 |
-
|
132 |
-
// Append edit link.
|
133 |
-
var edit = this.get('edit');
|
134 |
-
if( edit ) {
|
135 |
-
this.$hndle().append('<a href="' + edit + '" class="dashicons dashicons-admin-generic acf-hndle-cog acf-js-tooltip" title="' + acf.__('Edit field group') + '"></a>');
|
136 |
-
}
|
137 |
-
|
138 |
-
// Show postbox.
|
139 |
-
this.show();
|
140 |
-
},
|
141 |
-
|
142 |
-
show: function(){
|
143 |
-
|
144 |
-
// Show label.
|
145 |
-
this.$hideLabel().show();
|
146 |
-
|
147 |
-
// toggle on checkbox
|
148 |
-
this.$hide().prop('checked', true);
|
149 |
-
|
150 |
-
// Show postbox
|
151 |
-
this.$el.show().removeClass('acf-hidden');
|
152 |
-
},
|
153 |
-
|
154 |
-
enable: function(){
|
155 |
-
acf.enable( this.$el, 'postbox' );
|
156 |
-
},
|
157 |
-
|
158 |
-
showEnable: function(){
|
159 |
-
this.show();
|
160 |
-
this.enable();
|
161 |
-
},
|
162 |
-
|
163 |
-
hide: function(){
|
164 |
-
|
165 |
-
// Hide label.
|
166 |
-
this.$hideLabel().hide();
|
167 |
-
|
168 |
-
// Hide postbox
|
169 |
-
this.$el.hide().addClass('acf-hidden');
|
170 |
-
},
|
171 |
-
|
172 |
-
disable: function(){
|
173 |
-
acf.disable( this.$el, 'postbox' );
|
174 |
-
},
|
175 |
-
|
176 |
-
hideDisable: function(){
|
177 |
-
this.hide();
|
178 |
-
this.disable();
|
179 |
-
},
|
180 |
-
|
181 |
-
html: function( html ){
|
182 |
-
|
183 |
-
// Update HTML.
|
184 |
-
this.$inside().html( html );
|
185 |
-
|
186 |
-
// Do action.
|
187 |
-
acf.doAction('append', this.$el);
|
188 |
-
}
|
189 |
-
});
|
190 |
-
|
191 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/build/js/_acf-screen.js
DELETED
@@ -1,593 +0,0 @@
|
|
1 |
-
(function($, undefined){
|
2 |
-
|
3 |
-
acf.screen = new acf.Model({
|
4 |
-
|
5 |
-
active: true,
|
6 |
-
|
7 |
-
xhr: false,
|
8 |
-
|
9 |
-
timeout: false,
|
10 |
-
|
11 |
-
wait: 'load',
|
12 |
-
|
13 |
-
events: {
|
14 |
-
'change #page_template': 'onChange',
|
15 |
-
'change #parent_id': 'onChange',
|
16 |
-
'change #post-formats-select': 'onChange',
|
17 |
-
'change .categorychecklist': 'onChange',
|
18 |
-
'change .tagsdiv': 'onChange',
|
19 |
-
'change .acf-taxonomy-field[data-save="1"]': 'onChange',
|
20 |
-
'change #product-type': 'onChange'
|
21 |
-
},
|
22 |
-
|
23 |
-
isPost: function(){
|
24 |
-
return acf.get('screen') === 'post';
|
25 |
-
},
|
26 |
-
|
27 |
-
isUser: function(){
|
28 |
-
return acf.get('screen') === 'user';
|
29 |
-
},
|
30 |
-
|
31 |
-
isTaxonomy: function(){
|
32 |
-
return acf.get('screen') === 'taxonomy';
|
33 |
-
},
|
34 |
-
|
35 |
-
isAttachment: function(){
|
36 |
-
return acf.get('screen') === 'attachment';
|
37 |
-
},
|
38 |
-
|
39 |
-
isNavMenu: function(){
|
40 |
-
return acf.get('screen') === 'nav_menu';
|
41 |
-
},
|
42 |
-
|
43 |
-
isWidget: function(){
|
44 |
-
return acf.get('screen') === 'widget';
|
45 |
-
},
|
46 |
-
|
47 |
-
isComment: function(){
|
48 |
-
return acf.get('screen') === 'comment';
|
49 |
-
},
|
50 |
-
|
51 |
-
getPageTemplate: function(){
|
52 |
-
var $el = $('#page_template');
|
53 |
-
return $el.length ? $el.val() : null;
|
54 |
-
},
|
55 |
-
|
56 |
-
getPageParent: function( e, $el ){
|
57 |
-
var $el = $('#parent_id');
|
58 |
-
return $el.length ? $el.val() : null;
|
59 |
-
},
|
60 |
-
|
61 |
-
getPageType: function( e, $el ){
|
62 |
-
return this.getPageParent() ? 'child' : 'parent';
|
63 |
-
},
|
64 |
-
|
65 |
-
getPostType: function(){
|
66 |
-
return $('#post_type').val();
|
67 |
-
},
|
68 |
-
|
69 |
-
getPostFormat: function( e, $el ){
|
70 |
-
var $el = $('#post-formats-select input:checked');
|
71 |
-
if( $el.length ) {
|
72 |
-
var val = $el.val();
|
73 |
-
return (val == '0') ? 'standard' : val;
|
74 |
-
}
|
75 |
-
return null;
|
76 |
-
},
|
77 |
-
|
78 |
-
getPostCoreTerms: function(){
|
79 |
-
|
80 |
-
// vars
|
81 |
-
var terms = {};
|
82 |
-
|
83 |
-
// serialize WP taxonomy postboxes
|
84 |
-
var data = acf.serialize( $('.categorydiv, .tagsdiv') );
|
85 |
-
|
86 |
-
// use tax_input (tag, custom-taxonomy) when possible.
|
87 |
-
// this data is already formatted in taxonomy => [terms].
|
88 |
-
if( data.tax_input ) {
|
89 |
-
terms = data.tax_input;
|
90 |
-
}
|
91 |
-
|
92 |
-
// append "category" which uses a different name
|
93 |
-
if( data.post_category ) {
|
94 |
-
terms.category = data.post_category;
|
95 |
-
}
|
96 |
-
|
97 |
-
// convert any string values (tags) into array format
|
98 |
-
for( var tax in terms ) {
|
99 |
-
if( !acf.isArray(terms[tax]) ) {
|
100 |
-
terms[tax] = terms[tax].split(', ');
|
101 |
-
}
|
102 |
-
}
|
103 |
-
|
104 |
-
// return
|
105 |
-
return terms;
|
106 |
-
},
|
107 |
-
|
108 |
-
getPostTerms: function(){
|
109 |
-
|
110 |
-
// Get core terms.
|
111 |
-
var terms = this.getPostCoreTerms();
|
112 |
-
|
113 |
-
// loop over taxonomy fields and add their values
|
114 |
-
acf.getFields({type: 'taxonomy'}).map(function( field ){
|
115 |
-
|
116 |
-
// ignore fields that don't save
|
117 |
-
if( !field.get('save') ) {
|
118 |
-
return;
|
119 |
-
}
|
120 |
-
|
121 |
-
// vars
|
122 |
-
var val = field.val();
|
123 |
-
var tax = field.get('taxonomy');
|
124 |
-
|
125 |
-
// check val
|
126 |
-
if( val ) {
|
127 |
-
|
128 |
-
// ensure terms exists
|
129 |
-
terms[ tax ] = terms[ tax ] || [];
|
130 |
-
|
131 |
-
// ensure val is an array
|
132 |
-
val = acf.isArray(val) ? val : [val];
|
133 |
-
|
134 |
-
// append
|
135 |
-
terms[ tax ] = terms[ tax ].concat( val );
|
136 |
-
}
|
137 |
-
});
|
138 |
-
|
139 |
-
// add WC product type
|
140 |
-
if( (productType = this.getProductType()) !== null ) {
|
141 |
-
terms.product_type = [productType];
|
142 |
-
}
|
143 |
-
|
144 |
-
// remove duplicate values
|
145 |
-
for( var tax in terms ) {
|
146 |
-
terms[tax] = acf.uniqueArray(terms[tax]);
|
147 |
-
}
|
148 |
-
|
149 |
-
// return
|
150 |
-
return terms;
|
151 |
-
},
|
152 |
-
|
153 |
-
getProductType: function(){
|
154 |
-
var $el = $('#product-type');
|
155 |
-
return $el.length ? $el.val() : null;
|
156 |
-
},
|
157 |
-
|
158 |
-
check: function(){
|
159 |
-
|
160 |
-
// bail early if not for post
|
161 |
-
if( acf.get('screen') !== 'post' ) {
|
162 |
-
return;
|
163 |
-
}
|
164 |
-
|
165 |
-
// abort XHR if is already loading AJAX data
|
166 |
-
if( this.xhr ) {
|
167 |
-
this.xhr.abort();
|
168 |
-
}
|
169 |
-
|
170 |
-
// vars
|
171 |
-
var ajaxData = acf.parseArgs(this.data, {
|
172 |
-
action: 'acf/ajax/check_screen',
|
173 |
-
screen: acf.get('screen'),
|
174 |
-
exists: []
|
175 |
-
});
|
176 |
-
|
177 |
-
// post id
|
178 |
-
if( this.isPost() ) {
|
179 |
-
ajaxData.post_id = acf.get('post_id');
|
180 |
-
}
|
181 |
-
|
182 |
-
// post type
|
183 |
-
if( (postType = this.getPostType()) !== null ) {
|
184 |
-
ajaxData.post_type = postType;
|
185 |
-
}
|
186 |
-
|
187 |
-
// page template
|
188 |
-
if( (pageTemplate = this.getPageTemplate()) !== null ) {
|
189 |
-
ajaxData.page_template = pageTemplate;
|
190 |
-
}
|
191 |
-
|
192 |
-
// page parent
|
193 |
-
if( (pageParent = this.getPageParent()) !== null ) {
|
194 |
-
ajaxData.page_parent = pageParent;
|
195 |
-
}
|
196 |
-
|
197 |
-
// page type
|
198 |
-
if( (pageType = this.getPageType()) !== null ) {
|
199 |
-
ajaxData.page_type = pageType;
|
200 |
-
}
|
201 |
-
|
202 |
-
// post format
|
203 |
-
if( (postFormat = this.getPostFormat()) !== null ) {
|
204 |
-
ajaxData.post_format = postFormat;
|
205 |
-
}
|
206 |
-
|
207 |
-
// post terms
|
208 |
-
if( (postTerms = this.getPostTerms()) !== null ) {
|
209 |
-
ajaxData.post_terms = postTerms;
|
210 |
-
}
|
211 |
-
|
212 |
-
// add array of existing postboxes to increase performance and reduce JSON HTML
|
213 |
-
acf.getPostboxes().map(function( postbox ){
|
214 |
-
ajaxData.exists.push( postbox.get('key') );
|
215 |
-
});
|
216 |
-
|
217 |
-
// filter
|
218 |
-
ajaxData = acf.applyFilters('check_screen_args', ajaxData);
|
219 |
-
|
220 |
-
// success
|
221 |
-
var onSuccess = function( json ){
|
222 |
-
|
223 |
-
// Check success.
|
224 |
-
if( acf.isAjaxSuccess(json) ) {
|
225 |
-
|
226 |
-
// Render post screen.
|
227 |
-
if( acf.get('screen') == 'post' ) {
|
228 |
-
this.renderPostScreen( json.data );
|
229 |
-
|
230 |
-
// Render user screen.
|
231 |
-
} else if( acf.get('screen') == 'user' ) {
|
232 |
-
this.renderUserScreen( json.data );
|
233 |
-
}
|
234 |
-
}
|
235 |
-
|
236 |
-
// action
|
237 |
-
acf.doAction('check_screen_complete', json.data, ajaxData);
|
238 |
-
};
|
239 |
-
|
240 |
-
// ajax
|
241 |
-
this.xhr = $.ajax({
|
242 |
-
url: acf.get('ajaxurl'),
|
243 |
-
data: acf.prepareForAjax( ajaxData ),
|
244 |
-
type: 'post',
|
245 |
-
dataType: 'json',
|
246 |
-
context: this,
|
247 |
-
success: onSuccess
|
248 |
-
});
|
249 |
-
},
|
250 |
-
|
251 |
-
onChange: function( e, $el ){
|
252 |
-
this.setTimeout(this.check, 1);
|
253 |
-
},
|
254 |
-
|
255 |
-
renderPostScreen: function( data ){
|
256 |
-
|
257 |
-
// vars
|
258 |
-
var visible = [];
|
259 |
-
|
260 |
-
// Helper function to copy events
|
261 |
-
var copyEvents = function( $from, $to ){
|
262 |
-
var events = $._data($from[0]).events;
|
263 |
-
for( var type in events ) {
|
264 |
-
for( var i = 0; i < events[type].length; i++ ) {
|
265 |
-
$to.on( type, events[type][i].handler );
|
266 |
-
}
|
267 |
-
}
|
268 |
-
}
|
269 |
-
|
270 |
-
// Helper function to sort metabox.
|
271 |
-
var sortMetabox = function( id, ids ){
|
272 |
-
|
273 |
-
// Find position of id within ids.
|
274 |
-
var index = ids.indexOf( id );
|
275 |
-
|
276 |
-
// Bail early if index not found.
|
277 |
-
if( index == -1 ) {
|
278 |
-
return false;
|
279 |
-
}
|
280 |
-
|
281 |
-
// Loop over metaboxes behind (in reverse order).
|
282 |
-
for( var i = index-1; i >= 0; i-- ) {
|
283 |
-
if( $('#'+ids[i]).length ) {
|
284 |
-
return $('#'+ids[i]).after( $('#'+id) );
|
285 |
-
}
|
286 |
-
}
|
287 |
-
|
288 |
-
// Loop over metaboxes infront.
|
289 |
-
for( var i = index+1; i < ids.length; i++ ) {
|
290 |
-
if( $('#'+ids[i]).length ) {
|
291 |
-
return $('#'+ids[i]).before( $('#'+id) );
|
292 |
-
}
|
293 |
-
}
|
294 |
-
|
295 |
-
// Return false if not sorted.
|
296 |
-
return false;
|
297 |
-
};
|
298 |
-
|
299 |
-
// Show these postboxes.
|
300 |
-
data.results.map(function( result, i ){
|
301 |
-
|
302 |
-
// vars
|
303 |
-
var postbox = acf.getPostbox( result.id );
|
304 |
-
|
305 |
-
// Create postbox if doesn't exist.
|
306 |
-
if( !postbox ) {
|
307 |
-
|
308 |
-
// Create it.
|
309 |
-
var $postbox = $([
|
310 |
-
'<div id="' + result.id + '" class="postbox">',
|
311 |
-
'<button type="button" class="handlediv" aria-expanded="false">',
|
312 |
-
'<span class="screen-reader-text">Toggle panel: ' + result.title + '</span>',
|
313 |
-
'<span class="toggle-indicator" aria-hidden="true"></span>',
|
314 |
-
'</button>',
|
315 |
-
'<h2 class="hndle ui-sortable-handle">',
|
316 |
-
'<span>' + result.title + '</span>',
|
317 |
-
'</h2>',
|
318 |
-
'<div class="inside">',
|
319 |
-
result.html,
|
320 |
-
'</div>',
|
321 |
-
'</div>'
|
322 |
-
].join(''));
|
323 |
-
|
324 |
-
// Create new hide toggle.
|
325 |
-
if( $('#adv-settings').length ) {
|
326 |
-
var $prefs = $('#adv-settings .metabox-prefs');
|
327 |
-
var $label = $([
|
328 |
-
'<label for="' + result.id + '-hide">',
|
329 |
-
'<input class="hide-postbox-tog" name="' + result.id + '-hide" type="checkbox" id="' + result.id + '-hide" value="' + result.id + '" checked="checked">',
|
330 |
-
' ' + result.title,
|
331 |
-
'</label>'
|
332 |
-
].join(''));
|
333 |
-
|
334 |
-
// Copy default WP events onto checkbox.
|
335 |
-
copyEvents( $prefs.find('input').first(), $label.find('input') );
|
336 |
-
|
337 |
-
// Append hide label
|
338 |
-
$prefs.append( $label );
|
339 |
-
}
|
340 |
-
|
341 |
-
// Append metabox to the bottom of "side-sortables".
|
342 |
-
if( result.position === 'side' ) {
|
343 |
-
$('#' + result.position + '-sortables').append( $postbox );
|
344 |
-
|
345 |
-
// Prepend metabox to the top of "normal-sortbables".
|
346 |
-
} else {
|
347 |
-
$('#' + result.position + '-sortables').prepend( $postbox );
|
348 |
-
}
|
349 |
-
|
350 |
-
// Position metabox amongst existing ACF metaboxes within the same location.
|
351 |
-
var order = [];
|
352 |
-
data.results.map(function( _result ){
|
353 |
-
if( result.position === _result.position && $('#' + result.position + '-sortables #' + _result.id).length ) {
|
354 |
-
order.push( _result.id );
|
355 |
-
}
|
356 |
-
});
|
357 |
-
sortMetabox(result.id, order)
|
358 |
-
|
359 |
-
// Check 'sorted' for user preference.
|
360 |
-
if( data.sorted ) {
|
361 |
-
|
362 |
-
// Loop over each position (acf_after_title, side, normal).
|
363 |
-
for( var position in data.sorted ) {
|
364 |
-
|
365 |
-
// Explode string into array of ids.
|
366 |
-
var order = data.sorted[position].split(',');
|
367 |
-
|
368 |
-
// Position metabox relative to order.
|
369 |
-
if( sortMetabox(result.id, order) ) {
|
370 |
-
break;
|
371 |
-
}
|
372 |
-
}
|
373 |
-
}
|
374 |
-
|
375 |
-
// Copy default WP events onto metabox.
|
376 |
-
var $submitdiv = $('#submitdiv');
|
377 |
-
if( $('#submitdiv').length ) {
|
378 |
-
copyEvents( $submitdiv.children('.handlediv'), $postbox.children('.handlediv') );
|
379 |
-
copyEvents( $submitdiv.children('.hndle'), $postbox.children('.hndle') );
|
380 |
-
}
|
381 |
-
|
382 |
-
// Initalize it (modifies HTML).
|
383 |
-
postbox = acf.newPostbox( result );
|
384 |
-
|
385 |
-
// Trigger action.
|
386 |
-
acf.doAction('append', $postbox);
|
387 |
-
acf.doAction('append_postbox', postbox);
|
388 |
-
}
|
389 |
-
|
390 |
-
// show postbox
|
391 |
-
postbox.showEnable();
|
392 |
-
|
393 |
-
// Do action.
|
394 |
-
acf.doAction('show_postbox', postbox);
|
395 |
-
|
396 |
-
// append
|
397 |
-
visible.push( result.id );
|
398 |
-
});
|
399 |
-
|
400 |
-
// Hide these postboxes.
|
401 |
-
acf.getPostboxes().map(function( postbox ){
|
402 |
-
if( visible.indexOf( postbox.get('id') ) === -1 ) {
|
403 |
-
postbox.hideDisable();
|
404 |
-
|
405 |
-
// Do action.
|
406 |
-
acf.doAction('hide_postbox', postbox);
|
407 |
-
}
|
408 |
-
});
|
409 |
-
|
410 |
-
// Update style.
|
411 |
-
$('#acf-style').html( data.style );
|
412 |
-
},
|
413 |
-
|
414 |
-
renderUserScreen: function( json ){
|
415 |
-
|
416 |
-
}
|
417 |
-
});
|
418 |
-
|
419 |
-
/**
|
420 |
-
* gutenScreen
|
421 |
-
*
|
422 |
-
* Adds compatibility with the Gutenberg edit screen.
|
423 |
-
*
|
424 |
-
* @date 11/12/18
|
425 |
-
* @since 5.8.0
|
426 |
-
*
|
427 |
-
* @param void
|
428 |
-
* @return void
|
429 |
-
*/
|
430 |
-
var gutenScreen = new acf.Model({
|
431 |
-
|
432 |
-
// Wait until load to avoid 'core' issues when loading taxonomies.
|
433 |
-
wait: 'load',
|
434 |
-
|
435 |
-
initialize: function(){
|
436 |
-
|
437 |
-
// Bail early if not Gutenberg.
|
438 |
-
if( !acf.isGutenberg() ) {
|
439 |
-
return;
|
440 |
-
}
|
441 |
-
|
442 |
-
// Listen for changes.
|
443 |
-
wp.data.subscribe(this.proxy(this.onChange));
|
444 |
-
|
445 |
-
// Customize "acf.screen.get" functions.
|
446 |
-
acf.screen.getPageTemplate = this.getPageTemplate;
|
447 |
-
acf.screen.getPageParent = this.getPageParent;
|
448 |
-
acf.screen.getPostType = this.getPostType;
|
449 |
-
acf.screen.getPostFormat = this.getPostFormat;
|
450 |
-
acf.screen.getPostCoreTerms = this.getPostCoreTerms;
|
451 |
-
|
452 |
-
// Disable unload
|
453 |
-
acf.unload.disable();
|
454 |
-
|
455 |
-
// Add actions.
|
456 |
-
//this.addAction( 'append_postbox', acf.screen.refreshAvailableMetaBoxesPerLocation );
|
457 |
-
},
|
458 |
-
|
459 |
-
onChange: function(){
|
460 |
-
|
461 |
-
// Get edits.
|
462 |
-
var edits = wp.data.select( 'core/editor' ).getPostEdits();
|
463 |
-
|
464 |
-
// Check specific attributes.
|
465 |
-
var attributes = [
|
466 |
-
'template',
|
467 |
-
'parent',
|
468 |
-
'format'
|
469 |
-
];
|
470 |
-
|
471 |
-
// Append taxonomy attributes.
|
472 |
-
var taxonomies = wp.data.select( 'core' ).getTaxonomies() || [];
|
473 |
-
taxonomies.map(function( taxonomy ){
|
474 |
-
attributes.push( taxonomy.rest_base );
|
475 |
-
});
|
476 |
-
|
477 |
-
// Filter out attributes that have not changed.
|
478 |
-
attributes = attributes.filter(this.proxy(function( attr ){
|
479 |
-
return ( edits[attr] !== undefined && edits[attr] !== this.get(attr) );
|
480 |
-
}));
|
481 |
-
|
482 |
-
// Trigger change if has attributes.
|
483 |
-
if( attributes.length ) {
|
484 |
-
this.triggerChange( edits )
|
485 |
-
}
|
486 |
-
},
|
487 |
-
|
488 |
-
triggerChange: function( edits ){
|
489 |
-
|
490 |
-
// Update this.data if edits are provided.
|
491 |
-
if( edits !== undefined ) {
|
492 |
-
this.data = edits;
|
493 |
-
}
|
494 |
-
|
495 |
-
// Check screen.
|
496 |
-
acf.screen.check();
|
497 |
-
},
|
498 |
-
|
499 |
-
getPageTemplate: function(){
|
500 |
-
return wp.data.select( 'core/editor' ).getEditedPostAttribute( 'template' );
|
501 |
-
},
|
502 |
-
|
503 |
-
getPageParent: function( e, $el ){
|
504 |
-
return wp.data.select( 'core/editor' ).getEditedPostAttribute( 'parent' );
|
505 |
-
},
|
506 |
-
|
507 |
-
getPostType: function(){
|
508 |
-
return wp.data.select( 'core/editor' ).getEditedPostAttribute( 'type' );
|
509 |
-
},
|
510 |
-
|
511 |
-
getPostFormat: function( e, $el ){
|
512 |
-
return wp.data.select( 'core/editor' ).getEditedPostAttribute( 'format' );
|
513 |
-
},
|
514 |
-
|
515 |
-
getPostCoreTerms: function(){
|
516 |
-
|
517 |
-
// vars
|
518 |
-
var terms = {};
|
519 |
-
|
520 |
-
// Loop over taxonomies.
|
521 |
-
var taxonomies = wp.data.select( 'core' ).getTaxonomies() || [];
|
522 |
-
taxonomies.map(function( taxonomy ){
|
523 |
-
|
524 |
-
// Append selected taxonomies to terms object.
|
525 |
-
var postTerms = wp.data.select( 'core/editor' ).getEditedPostAttribute( taxonomy.rest_base );
|
526 |
-
if( postTerms ) {
|
527 |
-
terms[ taxonomy.slug ] = postTerms;
|
528 |
-
}
|
529 |
-
});
|
530 |
-
|
531 |
-
// return
|
532 |
-
return terms;
|
533 |
-
}
|
534 |
-
});
|
535 |
-
|
536 |
-
/**
|
537 |
-
* acf.screen.refreshAvailableMetaBoxesPerLocation
|
538 |
-
*
|
539 |
-
* Refreshes the WP data state based on metaboxes found in the DOM.
|
540 |
-
*
|
541 |
-
* Caution. Not safe to use.
|
542 |
-
* Causes duplicate dispatch listeners when saving post resulting in duplicate postmeta.
|
543 |
-
*
|
544 |
-
* @date 6/3/19
|
545 |
-
* @since 5.7.13
|
546 |
-
*
|
547 |
-
* @param void
|
548 |
-
* @return void
|
549 |
-
*/
|
550 |
-
acf.screen.refreshAvailableMetaBoxesPerLocation = function() {
|
551 |
-
|
552 |
-
// Extract vars.
|
553 |
-
var select = wp.data.select( 'core/edit-post' );
|
554 |
-
var dispatch = wp.data.dispatch( 'core/edit-post' );
|
555 |
-
|
556 |
-
// Load current metabox locations and data.
|
557 |
-
var data = {};
|
558 |
-
select.getActiveMetaBoxLocations().map(function( location ){
|
559 |
-
data[ location ] = select.getMetaBoxesPerLocation( location );
|
560 |
-
});
|
561 |
-
|
562 |
-
// Generate flat array of existing ids.
|
563 |
-
var ids = [];
|
564 |
-
for( var k in data ) {
|
565 |
-
ids = ids.concat( data[k].map(function(m){ return m.id; }) );
|
566 |
-
}
|
567 |
-
|
568 |
-
// Append ACF metaboxes.
|
569 |
-
acf.getPostboxes().map(function( postbox ){
|
570 |
-
|
571 |
-
// Ignore if already exists in data.
|
572 |
-
if( ids.indexOf( postbox.get('id') ) !== -1 ) {
|
573 |
-
return;
|
574 |
-
}
|
575 |
-
|
576 |
-
// Get metabox location looking at parent form.
|
577 |
-
var location = postbox.$el.closest('form').attr('class').replace('metabox-location-', '');
|
578 |
-
|
579 |
-
// Ensure location exists.
|
580 |
-
data[ location ] = data[ location ] || [];
|
581 |
-
|
582 |
-
// Append.
|
583 |
-
data[ location ].push({
|
584 |
-
id: postbox.get('id'),
|
585 |
-
title: postbox.get('title')
|
586 |
-
});
|
587 |
-
});
|
588 |
-
|
589 |
-
// Update state.
|
590 |
-
dispatch.setAvailableMetaBoxesPerLocation(data);
|
591 |
-
};
|
592 |
-
|
593 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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build/js/_acf-select2.js
DELETED
@@ -1,793 +0,0 @@
|
|
1 |
-
(function($, undefined){
|
2 |
-
|
3 |
-
/**
|
4 |
-
* acf.newSelect2
|
5 |
-
*
|
6 |
-
* description
|
7 |
-
*
|
8 |
-
* @date 13/1/18
|
9 |
-
* @since 5.6.5
|
10 |
-
*
|
11 |
-
* @param type $var Description. Default.
|
12 |
-
* @return type Description.
|
13 |
-
*/
|
14 |
-
|
15 |
-
acf.newSelect2 = function( $select, props ){
|
16 |
-
|
17 |
-
// defaults
|
18 |
-
props = acf.parseArgs(props, {
|
19 |
-
allowNull: false,
|
20 |
-
placeholder: '',
|
21 |
-
multiple: false,
|
22 |
-
field: false,
|
23 |
-
ajax: false,
|
24 |
-
ajaxAction: '',
|
25 |
-
ajaxData: function( data ){ return data; },
|
26 |
-
ajaxResults: function( json ){ return json; },
|
27 |
-
});
|
28 |
-
|
29 |
-
// initialize
|
30 |
-
if( getVersion() == 4 ) {
|
31 |
-
var select2 = new Select2_4( $select, props );
|
32 |
-
} else {
|
33 |
-
var select2 = new Select2_3( $select, props );
|
34 |
-
}
|
35 |
-
|
36 |
-
// actions
|
37 |
-
acf.doAction('new_select2', select2);
|
38 |
-
|
39 |
-
// return
|
40 |
-
return select2;
|
41 |
-
};
|
42 |
-
|
43 |
-
/**
|
44 |
-
* getVersion
|
45 |
-
*
|
46 |
-
* description
|
47 |
-
*
|
48 |
-
* @date 13/1/18
|
49 |
-
* @since 5.6.5
|
50 |
-
*
|
51 |
-
* @param type $var Description. Default.
|
52 |
-
* @return type Description.
|
53 |
-
*/
|
54 |
-
|
55 |
-
function getVersion() {
|
56 |
-
|
57 |
-
// v4
|
58 |
-
if( acf.isset(window, 'jQuery', 'fn', 'select2', 'amd') ) {
|
59 |
-
return 4;
|
60 |
-
}
|
61 |
-
|
62 |
-
// v3
|
63 |
-
if( acf.isset(window, 'Select2') ) {
|
64 |
-
return 3;
|
65 |
-
}
|
66 |
-
|
67 |
-
// return
|
68 |
-
return false;
|
69 |
-
}
|
70 |
-
|
71 |
-
/**
|
72 |
-
* Select2
|
73 |
-
*
|
74 |
-
* description
|
75 |
-
*
|
76 |
-
* @date 13/1/18
|
77 |
-
* @since 5.6.5
|
78 |
-
*
|
79 |
-
* @param type $var Description. Default.
|
80 |
-
* @return type Description.
|
81 |
-
*/
|
82 |
-
|
83 |
-
var Select2 = acf.Model.extend({
|
84 |
-
|
85 |
-
setup: function( $select, props ){
|
86 |
-
$.extend(this.data, props);
|
87 |
-
this.$el = $select;
|
88 |
-
},
|
89 |
-
|
90 |
-
initialize: function(){
|
91 |
-
|
92 |
-
},
|
93 |
-
|
94 |
-
selectOption: function( value ){
|
95 |
-
var $option = this.getOption( value );
|
96 |
-
if( !$option.prop('selected') ) {
|
97 |
-
$option.prop('selected', true).trigger('change');
|
98 |
-
}
|
99 |
-
},
|
100 |
-
|
101 |
-
unselectOption: function( value ){
|
102 |
-
var $option = this.getOption( value );
|
103 |
-
if( $option.prop('selected') ) {
|
104 |
-
$option.prop('selected', false).trigger('change');
|
105 |
-
}
|
106 |
-
},
|
107 |
-
|
108 |
-
getOption: function( value ){
|
109 |
-
return this.$('option[value="' + value + '"]');
|
110 |
-
},
|
111 |
-
|
112 |
-
addOption: function( option ){
|
113 |
-
|
114 |
-
// defaults
|
115 |
-
option = acf.parseArgs(option, {
|
116 |
-
id: '',
|
117 |
-
text: '',
|
118 |
-
selected: false
|
119 |
-
});
|
120 |
-
|
121 |
-
// vars
|
122 |
-
var $option = this.getOption( option.id );
|
123 |
-
|
124 |
-
// append
|
125 |
-
if( !$option.length ) {
|
126 |
-
$option = $('<option></option>');
|
127 |
-
$option.html( option.text );
|
128 |
-
$option.attr('value', option.id);
|
129 |
-
$option.prop('selected', option.selected);
|
130 |
-
this.$el.append($option);
|
131 |
-
}
|
132 |
-
|
133 |
-
// chain
|
134 |
-
return $option;
|
135 |
-
},
|
136 |
-
|
137 |
-
getValue: function(){
|
138 |
-
|
139 |
-
// vars
|
140 |
-
var val = [];
|
141 |
-
var $options = this.$el.find('option:selected');
|
142 |
-
|
143 |
-
// bail early if no selected
|
144 |
-
if( !$options.exists() ) {
|
145 |
-
return val;
|
146 |
-
}
|
147 |
-
|
148 |
-
// sort by attribute
|
149 |
-
$options = $options.sort(function(a, b) {
|
150 |
-
return +a.getAttribute('data-i') - +b.getAttribute('data-i');
|
151 |
-
});
|
152 |
-
|
153 |
-
// loop
|
154 |
-
$options.each(function(){
|
155 |
-
var $el = $(this);
|
156 |
-
val.push({
|
157 |
-
$el: $el,
|
158 |
-
id: $el.attr('value'),
|
159 |
-
text: $el.text(),
|
160 |
-
});
|
161 |
-
});
|
162 |
-
|
163 |
-
// return
|
164 |
-
return val;
|
165 |
-
|
166 |
-
},
|
167 |
-
|
168 |
-
mergeOptions: function(){
|
169 |
-
|
170 |
-
},
|
171 |
-
|
172 |
-
getChoices: function(){
|
173 |
-
|
174 |
-
// callback
|
175 |
-
var crawl = function( $parent ){
|
176 |
-
|
177 |
-
// vars
|
178 |
-
var choices = [];
|
179 |
-
|
180 |
-
// loop
|
181 |
-
$parent.children().each(function(){
|
182 |
-
|
183 |
-
// vars
|
184 |
-
var $child = $(this);
|
185 |
-
|
186 |
-
// optgroup
|
187 |
-
if( $child.is('optgroup') ) {
|
188 |
-
|
189 |
-
choices.push({
|
190 |
-
text: $child.attr('label'),
|
191 |
-
children: crawl( $child )
|
192 |
-
});
|
193 |
-
|
194 |
-
// option
|
195 |
-
} else {
|
196 |
-
|
197 |
-
choices.push({
|
198 |
-
id: $child.attr('value'),
|
199 |
-
text: $child.text()
|
200 |
-
});
|
201 |
-
}
|
202 |
-
});
|
203 |
-
|
204 |
-
// return
|
205 |
-
return choices;
|
206 |
-
};
|
207 |
-
|
208 |
-
// crawl
|
209 |
-
return crawl( this.$el );
|
210 |
-
},
|
211 |
-
|
212 |
-
decodeChoices: function( choices ){
|
213 |
-
|
214 |
-
// callback
|
215 |
-
var crawl = function( items ){
|
216 |
-
items.map(function( item ){
|
217 |
-
item.text = acf.decode( item.text );
|
218 |
-
if( item.children ) {
|
219 |
-
item.children = crawl( item.children );
|
220 |
-
}
|
221 |
-
return item;
|
222 |
-
});
|
223 |
-
return items;
|
224 |
-
};
|
225 |
-
|
226 |
-
// crawl
|
227 |
-
return crawl( choices );
|
228 |
-
},
|
229 |
-
|
230 |
-
getAjaxData: function( params ){
|
231 |
-
|
232 |
-
// vars
|
233 |
-
var ajaxData = {
|
234 |
-
action: this.get('ajaxAction'),
|
235 |
-
s: params.term || '',
|
236 |
-
paged: params.page || 1
|
237 |
-
};
|
238 |
-
|
239 |
-
// field helper
|
240 |
-
var field = this.get('field');
|
241 |
-
if( field ) {
|
242 |
-
ajaxData.field_key = field.get('key');
|
243 |
-
}
|
244 |
-
|
245 |
-
// callback
|
246 |
-
var callback = this.get('ajaxData');
|
247 |
-
if( callback ) {
|
248 |
-
ajaxData = callback.apply( this, [ajaxData, params] );
|
249 |
-
}
|
250 |
-
|
251 |
-
// filter
|
252 |
-
ajaxData = acf.applyFilters( 'select2_ajax_data', ajaxData, this.data, this.$el, (field || false), this );
|
253 |
-
|
254 |
-
// return
|
255 |
-
return acf.prepareForAjax(ajaxData);
|
256 |
-
},
|
257 |
-
|
258 |
-
getAjaxResults: function( json, params ){
|
259 |
-
|
260 |
-
// defaults
|
261 |
-
json = acf.parseArgs(json, {
|
262 |
-
results: false,
|
263 |
-
more: false,
|
264 |
-
});
|
265 |
-
|
266 |
-
// decode
|
267 |
-
if( json.results ) {
|
268 |
-
json.results = this.decodeChoices(json.results);
|
269 |
-
}
|
270 |
-
|
271 |
-
// callback
|
272 |
-
var callback = this.get('ajaxResults');
|
273 |
-
if( callback ) {
|
274 |
-
json = callback.apply( this, [json, params] );
|
275 |
-
}
|
276 |
-
|
277 |
-
// filter
|
278 |
-
json = acf.applyFilters( 'select2_ajax_results', json, params, this );
|
279 |
-
|
280 |
-
// return
|
281 |
-
return json;
|
282 |
-
},
|
283 |
-
|
284 |
-
processAjaxResults: function( json, params ){
|
285 |
-
|
286 |
-
// vars
|
287 |
-
var json = this.getAjaxResults( json, params );
|
288 |
-
|
289 |
-
// change more to pagination
|
290 |
-
if( json.more ) {
|
291 |
-
json.pagination = { more: true };
|
292 |
-
}
|
293 |
-
|
294 |
-
// merge together groups
|
295 |
-
setTimeout($.proxy(this.mergeOptions, this), 1);
|
296 |
-
|
297 |
-
// return
|
298 |
-
return json;
|
299 |
-
},
|
300 |
-
|
301 |
-
destroy: function(){
|
302 |
-
|
303 |
-
// destroy via api
|
304 |
-
if( this.$el.data('select2') ) {
|
305 |
-
this.$el.select2('destroy');
|
306 |
-
}
|
307 |
-
|
308 |
-
// destory via HTML (duplicating HTML does not contain data)
|
309 |
-
this.$el.siblings('.select2-container').remove();
|
310 |
-
}
|
311 |
-
|
312 |
-
});
|
313 |
-
|
314 |
-
|
315 |
-
/**
|
316 |
-
* Select2_4
|
317 |
-
*
|
318 |
-
* description
|
319 |
-
*
|
320 |
-
* @date 13/1/18
|
321 |
-
* @since 5.6.5
|
322 |
-
*
|
323 |
-
* @param type $var Description. Default.
|
324 |
-
* @return type Description.
|
325 |
-
*/
|
326 |
-
|
327 |
-
var Select2_4 = Select2.extend({
|
328 |
-
|
329 |
-
initialize: function(){
|
330 |
-
|
331 |
-
// vars
|
332 |
-
var $select = this.$el;
|
333 |
-
var options = {
|
334 |
-
width: '100%',
|
335 |
-
allowClear: this.get('allowNull'),
|
336 |
-
placeholder: this.get('placeholder'),
|
337 |
-
multiple: this.get('multiple'),
|
338 |
-
data: [],
|
339 |
-
escapeMarkup: function( m ){ return m; }
|
340 |
-
};
|
341 |
-
|
342 |
-
// multiple
|
343 |
-
if( options.multiple ) {
|
344 |
-
|
345 |
-
// reorder options
|
346 |
-
this.getValue().map(function( item ){
|
347 |
-
item.$el.detach().appendTo( $select );
|
348 |
-
});
|
349 |
-
}
|
350 |
-
|
351 |
-
// remove conflicting atts
|
352 |
-
$select.removeData('ajax');
|
353 |
-
$select.removeAttr('data-ajax');
|
354 |
-
|
355 |
-
// ajax
|
356 |
-
if( this.get('ajax') ) {
|
357 |
-
|
358 |
-
options.ajax = {
|
359 |
-
url: acf.get('ajaxurl'),
|
360 |
-
delay: 250,
|
361 |
-
dataType: 'json',
|
362 |
-
type: 'post',
|
363 |
-
cache: false,
|
364 |
-
data: $.proxy(this.getAjaxData, this),
|
365 |
-
processResults: $.proxy(this.processAjaxResults, this),
|
366 |
-
};
|
367 |
-
}
|
368 |
-
|
369 |
-
// filter for 3rd party customization
|
370 |
-
//options = acf.applyFilters( 'select2_args', options, $select, this );
|
371 |
-
var field = this.get('field');
|
372 |
-
options = acf.applyFilters( 'select2_args', options, $select, this.data, (field || false), this );
|
373 |
-
|
374 |
-
// add select2
|
375 |
-
$select.select2( options );
|
376 |
-
|
377 |
-
// get container (Select2 v4 does not return this from constructor)
|
378 |
-
var $container = $select.next('.select2-container');
|
379 |
-
|
380 |
-
// multiple
|
381 |
-
if( options.multiple ) {
|
382 |
-
|
383 |
-
// vars
|
384 |
-
var $ul = $container.find('ul');
|
385 |
-
|
386 |
-
// sortable
|
387 |
-
$ul.sortable({
|
388 |
-
stop: function( e ) {
|
389 |
-
|
390 |
-
// loop
|
391 |
-
$ul.find('.select2-selection__choice').each(function() {
|
392 |
-
|
393 |
-
// vars
|
394 |
-
var $option = $( $(this).data('data').element );
|
395 |
-
|
396 |
-
// detach and re-append to end
|
397 |
-
$option.detach().appendTo( $select );
|
398 |
-
});
|
399 |
-
|
400 |
-
// trigger change on input (JS error if trigger on select)
|
401 |
-
$select.trigger('change');
|
402 |
-
}
|
403 |
-
});
|
404 |
-
|
405 |
-
// on select, move to end
|
406 |
-
$select.on('select2:select', this.proxy(function( e ){
|
407 |
-
this.getOption( e.params.data.id ).detach().appendTo( this.$el );
|
408 |
-
}));
|
409 |
-
}
|
410 |
-
|
411 |
-
// add class
|
412 |
-
$container.addClass('-acf');
|
413 |
-
|
414 |
-
// action for 3rd party customization
|
415 |
-
acf.doAction('select2_init', $select, options, this.data, (field || false), this);
|
416 |
-
},
|
417 |
-
|
418 |
-
mergeOptions: function(){
|
419 |
-
|
420 |
-
// vars
|
421 |
-
var $prevOptions = false;
|
422 |
-
var $prevGroup = false;
|
423 |
-
|
424 |
-
// loop
|
425 |
-
$('.select2-results__option[role="group"]').each(function(){
|
426 |
-
|
427 |
-
// vars
|
428 |
-
var $options = $(this).children('ul');
|
429 |
-
var $group = $(this).children('strong');
|
430 |
-
|
431 |
-
// compare to previous
|
432 |
-
if( $prevGroup && $prevGroup.text() === $group.text() ) {
|
433 |
-
$prevOptions.append( $options.children() );
|
434 |
-
$(this).remove();
|
435 |
-
return;
|
436 |
-
}
|
437 |
-
|
438 |
-
// update vars
|
439 |
-
$prevOptions = $options;
|
440 |
-
$prevGroup = $group;
|
441 |
-
|
442 |
-
});
|
443 |
-
},
|
444 |
-
|
445 |
-
});
|
446 |
-
|
447 |
-
/**
|
448 |
-
* Select2_3
|
449 |
-
*
|
450 |
-
* description
|
451 |
-
*
|
452 |
-
* @date 13/1/18
|
453 |
-
* @since 5.6.5
|
454 |
-
*
|
455 |
-
* @param type $var Description. Default.
|
456 |
-
* @return type Description.
|
457 |
-
*/
|
458 |
-
|
459 |
-
var Select2_3 = Select2.extend({
|
460 |
-
|
461 |
-
initialize: function(){
|
462 |
-
|
463 |
-
// vars
|
464 |
-
var $select = this.$el;
|
465 |
-
var value = this.getValue();
|
466 |
-
var multiple = this.get('multiple');
|
467 |
-
var options = {
|
468 |
-
width: '100%',
|
469 |
-
allowClear: this.get('allowNull'),
|
470 |
-
placeholder: this.get('placeholder'),
|
471 |
-
separator: '||',
|
472 |
-
multiple: this.get('multiple'),
|
473 |
-
data: this.getChoices(),
|
474 |
-
escapeMarkup: function( m ){ return m; },
|
475 |
-
dropdownCss: {
|
476 |
-
'z-index': '999999999'
|
477 |
-
},
|
478 |
-
initSelection: function( element, callback ) {
|
479 |
-
if( multiple ) {
|
480 |
-
callback( value );
|
481 |
-
} else {
|
482 |
-
callback( value.shift() );
|
483 |
-
}
|
484 |
-
}
|
485 |
-
};
|
486 |
-
|
487 |
-
// get hidden input
|
488 |
-
var $input = $select.siblings('input');
|
489 |
-
if( !$input.length ) {
|
490 |
-
$input = $('<input type="hidden" />');
|
491 |
-
$select.before( $input );
|
492 |
-
}
|
493 |
-
|
494 |
-
// set input value
|
495 |
-
inputValue = value.map(function(item){ return item.id }).join('||');
|
496 |
-
$input.val( inputValue );
|
497 |
-
|
498 |
-
// multiple
|
499 |
-
if( options.multiple ) {
|
500 |
-
|
501 |
-
// reorder options
|
502 |
-
value.map(function( item ){
|
503 |
-
item.$el.detach().appendTo( $select );
|
504 |
-
});
|
505 |
-
}
|
506 |
-
|
507 |
-
// remove blank option as we have a clear all button
|
508 |
-
if( options.allowClear ) {
|
509 |
-
options.data = options.data.filter(function(item){
|
510 |
-
return item.id !== '';
|
511 |
-
});
|
512 |
-
}
|
513 |
-
|
514 |
-
// remove conflicting atts
|
515 |
-
$select.removeData('ajax');
|
516 |
-
$select.removeAttr('data-ajax');
|
517 |
-
|
518 |
-
// ajax
|
519 |
-
if( this.get('ajax') ) {
|
520 |
-
|
521 |
-
options.ajax = {
|
522 |
-
url: acf.get('ajaxurl'),
|
523 |
-
quietMillis: 250,
|
524 |
-
dataType: 'json',
|
525 |
-
type: 'post',
|
526 |
-
cache: false,
|
527 |
-
data: $.proxy(this.getAjaxData, this),
|
528 |
-
results: $.proxy(this.processAjaxResults, this),
|
529 |
-
};
|
530 |
-
}
|
531 |
-
|
532 |
-
// filter for 3rd party customization
|
533 |
-
var field = this.get('field');
|
534 |
-
options = acf.applyFilters( 'select2_args', options, $select, this.data, (field || false), this );
|
535 |
-
|
536 |
-
// add select2
|
537 |
-
$input.select2( options );
|
538 |
-
|
539 |
-
// get container
|
540 |
-
var $container = $input.select2('container');
|
541 |
-
|
542 |
-
// helper to find this select's option
|
543 |
-
var getOption = $.proxy(this.getOption, this);
|
544 |
-
|
545 |
-
// multiple
|
546 |
-
if( options.multiple ) {
|
547 |
-
|
548 |
-
// vars
|
549 |
-
var $ul = $container.find('ul');
|
550 |
-
|
551 |
-
// sortable
|
552 |
-
$ul.sortable({
|
553 |
-
stop: function() {
|
554 |
-
|
555 |
-
// loop
|
556 |
-
$ul.find('.select2-search-choice').each(function() {
|
557 |
-
|
558 |
-
// vars
|
559 |
-
var data = $(this).data('select2Data');
|
560 |
-
var $option = getOption( data.id );
|
561 |
-
|
562 |
-
// detach and re-append to end
|
563 |
-
$option.detach().appendTo( $select );
|
564 |
-
});
|
565 |
-
|
566 |
-
// trigger change on input (JS error if trigger on select)
|
567 |
-
$select.trigger('change');
|
568 |
-
}
|
569 |
-
});
|
570 |
-
}
|
571 |
-
|
572 |
-
// on select, create option and move to end
|
573 |
-
$input.on('select2-selecting', function( e ){
|
574 |
-
|
575 |
-
// vars
|
576 |
-
var item = e.choice;
|
577 |
-
var $option = getOption( item.id );
|
578 |
-
|
579 |
-
// create if doesn't exist
|
580 |
-
if( !$option.length ) {
|
581 |
-
$option = $('<option value="' + item.id + '">' + item.text + '</option>');
|
582 |
-
}
|
583 |
-
|
584 |
-
// detach and re-append to end
|
585 |
-
$option.detach().appendTo( $select );
|
586 |
-
});
|
587 |
-
|
588 |
-
// add class
|
589 |
-
$container.addClass('-acf');
|
590 |
-
|
591 |
-
// action for 3rd party customization
|
592 |
-
acf.doAction('select2_init', $select, options, this.data, (field || false), this);
|
593 |
-
|
594 |
-
// change
|
595 |
-
$input.on('change', function(){
|
596 |
-
var val = $input.val();
|
597 |
-
if( val.indexOf('||') ) {
|
598 |
-
val = val.split('||');
|
599 |
-
}
|
600 |
-
$select.val( val ).trigger('change');
|
601 |
-
});
|
602 |
-
|
603 |
-
// hide select
|
604 |
-
$select.hide();
|
605 |
-
},
|
606 |
-
|
607 |
-
mergeOptions: function(){
|
608 |
-
|
609 |
-
// vars
|
610 |
-
var $prevOptions = false;
|
611 |
-
var $prevGroup = false;
|
612 |
-
|
613 |
-
// loop
|
614 |
-
$('#select2-drop .select2-result-with-children').each(function(){
|
615 |
-
|
616 |
-
// vars
|
617 |
-
var $options = $(this).children('ul');
|
618 |
-
var $group = $(this).children('.select2-result-label');
|
619 |
-
|
620 |
-
// compare to previous
|
621 |
-
if( $prevGroup && $prevGroup.text() === $group.text() ) {
|
622 |
-
$prevGroup.append( $options.children() );
|
623 |
-
$(this).remove();
|
624 |
-
return;
|
625 |
-
}
|
626 |
-
|
627 |
-
// update vars
|
628 |
-
$prevOptions = $options;
|
629 |
-
$prevGroup = $group;
|
630 |
-
|
631 |
-
});
|
632 |
-
|
633 |
-
},
|
634 |
-
|
635 |
-
getAjaxData: function( term, page ){
|
636 |
-
|
637 |
-
// create Select2 v4 params
|
638 |
-
var params = {
|
639 |
-
term: term,
|
640 |
-
page: page
|
641 |
-
}
|
642 |
-
|
643 |
-
// return
|
644 |
-
return Select2.prototype.getAjaxData.apply(this, [params]);
|
645 |
-
},
|
646 |
-
|
647 |
-
});
|
648 |
-
|
649 |
-
|
650 |
-
// manager
|
651 |
-
var select2Manager = new acf.Model({
|
652 |
-
priority: 5,
|
653 |
-
wait: 'prepare',
|
654 |
-
initialize: function(){
|
655 |
-
|
656 |
-
// vars
|
657 |
-
var locale = acf.get('locale');
|
658 |
-
var rtl = acf.get('rtl');
|
659 |
-
var l10n = acf.get('select2L10n');
|
660 |
-
var version = getVersion();
|
661 |
-
|
662 |
-
// bail ealry if no l10n
|
663 |
-
if( !l10n ) {
|
664 |
-
return false;
|
665 |
-
}
|
666 |
-
|
667 |
-
// bail early if 'en'
|
668 |
-
if( locale.indexOf('en') === 0 ) {
|
669 |
-
return false;
|
670 |
-
}
|
671 |
-
|
672 |
-
// initialize
|
673 |
-
if( version == 4 ) {
|
674 |
-
this.addTranslations4();
|
675 |
-
} else if( version == 3 ) {
|
676 |
-
this.addTranslations3();
|
677 |
-
}
|
678 |
-
},
|
679 |
-
|
680 |
-
addTranslations4: function(){
|
681 |
-
|
682 |
-
// vars
|
683 |
-
var l10n = acf.get('select2L10n');
|
684 |
-
var locale = acf.get('locale');
|
685 |
-
|
686 |
-
// modify local to match html[lang] attribute (used by Select2)
|
687 |
-
locale = locale.replace('_', '-');
|
688 |
-
|
689 |
-
// select2L10n
|
690 |
-
var select2L10n = {
|
691 |
-
errorLoading: function () {
|
692 |
-
return l10n.load_fail;
|
693 |
-
},
|
694 |
-
inputTooLong: function (args) {
|
695 |
-
var overChars = args.input.length - args.maximum;
|
696 |
-
if( overChars > 1 ) {
|
697 |
-
return l10n.input_too_long_n.replace( '%d', overChars );
|
698 |
-
}
|
699 |
-
return l10n.input_too_long_1;
|
700 |
-
},
|
701 |
-
inputTooShort: function( args ){
|
702 |
-
var remainingChars = args.minimum - args.input.length;
|
703 |
-
if( remainingChars > 1 ) {
|
704 |
-
return l10n.input_too_short_n.replace( '%d', remainingChars );
|
705 |
-
}
|
706 |
-
return l10n.input_too_short_1;
|
707 |
-
},
|
708 |
-
loadingMore: function () {
|
709 |
-
return l10n.load_more;
|
710 |
-
},
|
711 |
-
maximumSelected: function( args ) {
|
712 |
-
var maximum = args.maximum;
|
713 |
-
if( maximum > 1 ) {
|
714 |
-
return l10n.selection_too_long_n.replace( '%d', maximum );
|
715 |
-
}
|
716 |
-
return l10n.selection_too_long_1;
|
717 |
-
},
|
718 |
-
noResults: function () {
|
719 |
-
return l10n.matches_0;
|
720 |
-
},
|
721 |
-
searching: function () {
|
722 |
-
return l10n.searching;
|
723 |
-
}
|
724 |
-
};
|
725 |
-
|
726 |
-
// append
|
727 |
-
jQuery.fn.select2.amd.define('select2/i18n/' + locale, [], function(){
|
728 |
-
return select2L10n;
|
729 |
-
});
|
730 |
-
},
|
731 |
-
|
732 |
-
addTranslations3: function(){
|
733 |
-
|
734 |
-
// vars
|
735 |
-
var l10n = acf.get('select2L10n');
|
736 |
-
var locale = acf.get('locale');
|
737 |
-
|
738 |
-
// modify local to match html[lang] attribute (used by Select2)
|
739 |
-
locale = locale.replace('_', '-');
|
740 |
-
|
741 |
-
// select2L10n
|
742 |
-
var select2L10n = {
|
743 |
-
formatMatches: function( matches ) {
|
744 |
-
if( matches > 1 ) {
|
745 |
-
return l10n.matches_n.replace( '%d', matches );
|
746 |
-
}
|
747 |
-
return l10n.matches_1;
|
748 |
-
},
|
749 |
-
formatNoMatches: function() {
|
750 |
-
return l10n.matches_0;
|
751 |
-
},
|
752 |
-
formatAjaxError: function() {
|
753 |
-
return l10n.load_fail;
|
754 |
-
},
|
755 |
-
formatInputTooShort: function( input, min ) {
|
756 |
-
var remainingChars = min - input.length;
|
757 |
-
if( remainingChars > 1 ) {
|
758 |
-
return l10n.input_too_short_n.replace( '%d', remainingChars );
|
759 |
-
}
|
760 |
-
return l10n.input_too_short_1;
|
761 |
-
},
|
762 |
-
formatInputTooLong: function( input, max ) {
|
763 |
-
var overChars = input.length - max;
|
764 |
-
if( overChars > 1 ) {
|
765 |
-
return l10n.input_too_long_n.replace( '%d', overChars );
|
766 |
-
}
|
767 |
-
return l10n.input_too_long_1;
|
768 |
-
},
|
769 |
-
formatSelectionTooBig: function( maximum ) {
|
770 |
-
if( maximum > 1 ) {
|
771 |
-
return l10n.selection_too_long_n.replace( '%d', maximum );
|
772 |
-
}
|
773 |
-
return l10n.selection_too_long_1;
|
774 |
-
},
|
775 |
-
formatLoadMore: function() {
|
776 |
-
return l10n.load_more;
|
777 |
-
},
|
778 |
-
formatSearching: function() {
|
779 |
-
return l10n.searching;
|
780 |
-
}
|
781 |
-
};
|
782 |
-
|
783 |
-
// ensure locales exists
|
784 |
-
$.fn.select2.locales = $.fn.select2.locales || {};
|
785 |
-
|
786 |
-
// append
|
787 |
-
$.fn.select2.locales[ locale ] = select2L10n;
|
788 |
-
$.extend($.fn.select2.defaults, select2L10n);
|
789 |
-
}
|
790 |
-
|
791 |
-
});
|
792 |
-
|
793 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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/_acf-tinymce.js
DELETED
@@ -1,395 +0,0 @@
|
|
1 |
-
(function($, undefined){
|
2 |
-
|
3 |
-
acf.tinymce = {
|
4 |
-
|
5 |
-
/*
|
6 |
-
* defaults
|
7 |
-
*
|
8 |
-
* This function will return default mce and qt settings
|
9 |
-
*
|
10 |
-
* @type function
|
11 |
-
* @date 18/8/17
|
12 |
-
* @since 5.6.0
|
13 |
-
*
|
14 |
-
* @param $post_id (int)
|
15 |
-
* @return $post_id (int)
|
16 |
-
*/
|
17 |
-
|
18 |
-
defaults: function(){
|
19 |
-
|
20 |
-
// bail early if no tinyMCEPreInit
|
21 |
-
if( typeof tinyMCEPreInit === 'undefined' ) return false;
|
22 |
-
|
23 |
-
// vars
|
24 |
-
var defaults = {
|
25 |
-
tinymce: tinyMCEPreInit.mceInit.acf_content,
|
26 |
-
quicktags: tinyMCEPreInit.qtInit.acf_content
|
27 |
-
};
|
28 |
-
|
29 |
-
// return
|
30 |
-
return defaults;
|
31 |
-
},
|
32 |
-
|
33 |
-
|
34 |
-
/*
|
35 |
-
* initialize
|
36 |
-
*
|
37 |
-
* This function will initialize the tinymce and quicktags instances
|
38 |
-
*
|
39 |
-
* @type function
|
40 |
-
* @date 18/8/17
|
41 |
-
* @since 5.6.0
|
42 |
-
*
|
43 |
-
* @param $post_id (int)
|
44 |
-
* @return $post_id (int)
|
45 |
-
*/
|
46 |
-
|
47 |
-
initialize: function( id, args ){
|
48 |
-
|
49 |
-
// defaults
|
50 |
-
args = acf.parseArgs(args, {
|
51 |
-
tinymce: true,
|
52 |
-
quicktags: true,
|
53 |
-
toolbar: 'full',
|
54 |
-
mode: 'visual', // visual,text
|
55 |
-
field: false
|
56 |
-
});
|
57 |
-
|
58 |
-
// tinymce
|
59 |
-
if( args.tinymce ) {
|
60 |
-
this.initializeTinymce( id, args );
|
61 |
-
}
|
62 |
-
|
63 |
-
// quicktags
|
64 |
-
if( args.quicktags ) {
|
65 |
-
this.initializeQuicktags( id, args );
|
66 |
-
}
|
67 |
-
},
|
68 |
-
|
69 |
-
|
70 |
-
/*
|
71 |
-
* initializeTinymce
|
72 |
-
*
|
73 |
-
* This function will initialize the tinymce instance
|
74 |
-
*
|
75 |
-
* @type function
|
76 |
-
* @date 18/8/17
|
77 |
-
* @since 5.6.0
|
78 |
-
*
|
79 |
-
* @param $post_id (int)
|
80 |
-
* @return $post_id (int)
|
81 |
-
*/
|
82 |
-
|
83 |
-
initializeTinymce: function( id, args ){
|
84 |
-
|
85 |
-
// vars
|
86 |
-
var $textarea = $('#'+id);
|
87 |
-
var defaults = this.defaults();
|
88 |
-
var toolbars = acf.get('toolbars');
|
89 |
-
var field = args.field || false;
|
90 |
-
var $field = field.$el || false;
|
91 |
-
|
92 |
-
// bail early
|
93 |
-
if( typeof tinymce === 'undefined' ) return false;
|
94 |
-
if( !defaults ) return false;
|
95 |
-
|
96 |
-
// check if exists
|
97 |
-
if( tinymce.get(id) ) {
|
98 |
-
return this.enable( id );
|
99 |
-
}
|
100 |
-
|
101 |
-
// settings
|
102 |
-
var init = $.extend( {}, defaults.tinymce, args.tinymce );
|
103 |
-
init.id = id;
|
104 |
-
init.selector = '#' + id;
|
105 |
-
|
106 |
-
// toolbar
|
107 |
-
var toolbar = args.toolbar;
|
108 |
-
if( toolbar && toolbars && toolbars[toolbar] ) {
|
109 |
-
|
110 |
-
for( var i = 1; i <= 4; i++ ) {
|
111 |
-
init[ 'toolbar' + i ] = toolbars[toolbar][i] || '';
|
112 |
-
}
|
113 |
-
}
|
114 |
-
|
115 |
-
// event
|
116 |
-
init.setup = function( ed ){
|
117 |
-
|
118 |
-
ed.on('change', function(e) {
|
119 |
-
ed.save(); // save to textarea
|
120 |
-
$textarea.trigger('change');
|
121 |
-
});
|
122 |
-
|
123 |
-
// Fix bug where Gutenberg does not hear "mouseup" event and tries to select multiple blocks.
|
124 |
-
ed.on('mouseup', function(e) {
|
125 |
-
var event = new MouseEvent('mouseup');
|
126 |
-
window.dispatchEvent(event);
|
127 |
-
});
|
128 |
-
|
129 |
-
// Temporarily comment out. May not be necessary due to wysiwyg field actions.
|
130 |
-
//ed.on('unload', function(e) {
|
131 |
-
// acf.tinymce.remove( id );
|
132 |
-
//});
|
133 |
-
};
|
134 |
-
|
135 |
-
// disable wp_autoresize_on (no solution yet for fixed toolbar)
|
136 |
-
init.wp_autoresize_on = false;
|
137 |
-
|
138 |
-
// Enable wpautop allowing value to save without <p> tags.
|
139 |
-
init.wpautop = true;
|
140 |
-
|
141 |
-
// hook for 3rd party customization
|
142 |
-
init = acf.applyFilters('wysiwyg_tinymce_settings', init, id, field);
|
143 |
-
|
144 |
-
// z-index fix (caused too many conflicts)
|
145 |
-
//if( acf.isset(tinymce,'ui','FloatPanel') ) {
|
146 |
-
// tinymce.ui.FloatPanel.zIndex = 900000;
|
147 |
-
//}
|
148 |
-
|
149 |
-
// store settings
|
150 |
-
tinyMCEPreInit.mceInit[ id ] = init;
|
151 |
-
|
152 |
-
// visual tab is active
|
153 |
-
if( args.mode == 'visual' ) {
|
154 |
-
|
155 |
-
// init
|
156 |
-
var result = tinymce.init( init );
|
157 |
-
|
158 |
-
// get editor
|
159 |
-
var ed = tinymce.get( id );
|
160 |
-
|
161 |
-
// validate
|
162 |
-
if( !ed ) {
|
163 |
-
return false;
|
164 |
-
}
|
165 |
-
|
166 |
-
// add reference
|
167 |
-
ed.acf = args.field;
|
168 |
-
|
169 |
-
// action
|
170 |
-
acf.doAction('wysiwyg_tinymce_init', ed, ed.id, init, field);
|
171 |
-
}
|
172 |
-
},
|
173 |
-
|
174 |
-
/*
|
175 |
-
* initializeQuicktags
|
176 |
-
*
|
177 |
-
* This function will initialize the quicktags instance
|
178 |
-
*
|
179 |
-
* @type function
|
180 |
-
* @date 18/8/17
|
181 |
-
* @since 5.6.0
|
182 |
-
*
|
183 |
-
* @param $post_id (int)
|
184 |
-
* @return $post_id (int)
|
185 |
-
*/
|
186 |
-
|
187 |
-
initializeQuicktags: function( id, args ){
|
188 |
-
|
189 |
-
// vars
|
190 |
-
var defaults = this.defaults();
|
191 |
-
|
192 |
-
// bail early
|
193 |
-
if( typeof quicktags === 'undefined' ) return false;
|
194 |
-
if( !defaults ) return false;
|
195 |
-
|
196 |
-
// settings
|
197 |
-
var init = $.extend( {}, defaults.quicktags, args.quicktags );
|
198 |
-
init.id = id;
|
199 |
-
|
200 |
-
// filter
|
201 |
-
var field = args.field || false;
|
202 |
-
var $field = field.$el || false;
|
203 |
-
init = acf.applyFilters('wysiwyg_quicktags_settings', init, init.id, field);
|
204 |
-
|
205 |
-
// store settings
|
206 |
-
tinyMCEPreInit.qtInit[ id ] = init;
|
207 |
-
|
208 |
-
// init
|
209 |
-
var ed = quicktags( init );
|
210 |
-
|
211 |
-
// validate
|
212 |
-
if( !ed ) {
|
213 |
-
return false;
|
214 |
-
}
|
215 |
-
|
216 |
-
// generate HTML
|
217 |
-
this.buildQuicktags( ed );
|
218 |
-
|
219 |
-
// action for 3rd party customization
|
220 |
-
acf.doAction('wysiwyg_quicktags_init', ed, ed.id, init, field);
|
221 |
-
},
|
222 |
-
|
223 |
-
|
224 |
-
/*
|
225 |
-
* buildQuicktags
|
226 |
-
*
|
227 |
-
* This function will build the quicktags HTML
|
228 |
-
*
|
229 |
-
* @type function
|
230 |
-
* @date 18/8/17
|
231 |
-
* @since 5.6.0
|
232 |
-
*
|
233 |
-
* @param $post_id (int)
|
234 |
-
* @return $post_id (int)
|
235 |
-
*/
|
236 |
-
|
237 |
-
buildQuicktags: function( ed ){
|
238 |
-
|
239 |
-
var canvas, name, settings, theButtons, html, ed, id, i, use, instanceId,
|
240 |
-
defaults = ',strong,em,link,block,del,ins,img,ul,ol,li,code,more,close,';
|
241 |
-
|
242 |
-
canvas = ed.canvas;
|
243 |
-
name = ed.name;
|
244 |
-
settings = ed.settings;
|
245 |
-
html = '';
|
246 |
-
theButtons = {};
|
247 |
-
use = '';
|
248 |
-
instanceId = ed.id;
|
249 |
-
|
250 |
-
// set buttons
|
251 |
-
if ( settings.buttons ) {
|
252 |
-
use = ','+settings.buttons+',';
|
253 |
-
}
|
254 |
-
|
255 |
-
for ( i in edButtons ) {
|
256 |
-
if ( ! edButtons[i] ) {
|
257 |
-
continue;
|
258 |
-
}
|
259 |
-
|
260 |
-
id = edButtons[i].id;
|
261 |
-
if ( use && defaults.indexOf( ',' + id + ',' ) !== -1 && use.indexOf( ',' + id + ',' ) === -1 ) {
|
262 |
-
continue;
|
263 |
-
}
|
264 |
-
|
265 |
-
if ( ! edButtons[i].instance || edButtons[i].instance === instanceId ) {
|
266 |
-
theButtons[id] = edButtons[i];
|
267 |
-
|
268 |
-
if ( edButtons[i].html ) {
|
269 |
-
html += edButtons[i].html( name + '_' );
|
270 |
-
}
|
271 |
-
}
|
272 |
-
}
|
273 |
-
|
274 |
-
if ( use && use.indexOf(',dfw,') !== -1 ) {
|
275 |
-
theButtons.dfw = new QTags.DFWButton();
|
276 |
-
html += theButtons.dfw.html( name + '_' );
|
277 |
-
}
|
278 |
-
|
279 |
-
if ( 'rtl' === document.getElementsByTagName( 'html' )[0].dir ) {
|
280 |
-
theButtons.textdirection = new QTags.TextDirectionButton();
|
281 |
-
html += theButtons.textdirection.html( name + '_' );
|
282 |
-
}
|
283 |
-
|
284 |
-
ed.toolbar.innerHTML = html;
|
285 |
-
ed.theButtons = theButtons;
|
286 |
-
|
287 |
-
if ( typeof jQuery !== 'undefined' ) {
|
288 |
-
jQuery( document ).triggerHandler( 'quicktags-init', [ ed ] );
|
289 |
-
}
|
290 |
-
|
291 |
-
},
|
292 |
-
|
293 |
-
disable: function( id ){
|
294 |
-
this.destroyTinymce( id );
|
295 |
-
},
|
296 |
-
|
297 |
-
remove: function( id ){
|
298 |
-
this.destroyTinymce( id );
|
299 |
-
},
|
300 |
-
|
301 |
-
destroy: function( id ){
|
302 |
-
this.destroyTinymce( id );
|
303 |
-
},
|
304 |
-
|
305 |
-
destroyTinymce: function( id ){
|
306 |
-
|
307 |
-
// bail early
|
308 |
-
if( typeof tinymce === 'undefined' ) return false;
|
309 |
-
|
310 |
-
// get editor
|
311 |
-
var ed = tinymce.get( id );
|
312 |
-
|
313 |
-
// bail early if no editor
|
314 |
-
if( !ed ) return false;
|
315 |
-
|
316 |
-
// save
|
317 |
-
ed.save();
|
318 |
-
|
319 |
-
// destroy editor
|
320 |
-
ed.destroy();
|
321 |
-
|
322 |
-
// return
|
323 |
-
return true;
|
324 |
-
},
|
325 |
-
|
326 |
-
enable: function( id ){
|
327 |
-
this.enableTinymce( id );
|
328 |
-
},
|
329 |
-
|
330 |
-
enableTinymce: function( id ){
|
331 |
-
|
332 |
-
// bail early
|
333 |
-
if( typeof switchEditors === 'undefined' ) return false;
|
334 |
-
|
335 |
-
// bail ealry if not initialized
|
336 |
-
if( typeof tinyMCEPreInit.mceInit[ id ] === 'undefined' ) return false;
|
337 |
-
|
338 |
-
// toggle
|
339 |
-
switchEditors.go( id, 'tmce');
|
340 |
-
|
341 |
-
// return
|
342 |
-
return true;
|
343 |
-
}
|
344 |
-
};
|
345 |
-
|
346 |
-
var editorManager = new acf.Model({
|
347 |
-
|
348 |
-
// hook in before fieldsEventManager, conditions, etc
|
349 |
-
priority: 5,
|
350 |
-
|
351 |
-
actions: {
|
352 |
-
'prepare': 'onPrepare',
|
353 |
-
'ready': 'onReady',
|
354 |
-
},
|
355 |
-
onPrepare: function(){
|
356 |
-
|
357 |
-
// find hidden editor which may exist within a field
|
358 |
-
var $div = $('#acf-hidden-wp-editor');
|
359 |
-
|
360 |
-
// move to footer
|
361 |
-
if( $div.exists() ) {
|
362 |
-
$div.appendTo('body');
|
363 |
-
}
|
364 |
-
},
|
365 |
-
onReady: function(){
|
366 |
-
|
367 |
-
// Restore wp.editor functions used by tinymce removed in WP5.
|
368 |
-
if( acf.isset(window,'wp','oldEditor') ) {
|
369 |
-
wp.editor.autop = wp.oldEditor.autop;
|
370 |
-
wp.editor.removep = wp.oldEditor.removep;
|
371 |
-
}
|
372 |
-
|
373 |
-
// bail early if no tinymce
|
374 |
-
if( !acf.isset(window,'tinymce','on') ) return;
|
375 |
-
|
376 |
-
// restore default activeEditor
|
377 |
-
tinymce.on('AddEditor', function( data ){
|
378 |
-
|
379 |
-
// vars
|
380 |
-
var editor = data.editor;
|
381 |
-
|
382 |
-
// bail early if not 'acf'
|
383 |
-
if( editor.id.substr(0, 3) !== 'acf' ) return;
|
384 |
-
|
385 |
-
// override if 'content' exists
|
386 |
-
editor = tinymce.editors.content || editor;
|
387 |
-
|
388 |
-
// update vars
|
389 |
-
tinymce.activeEditor = editor;
|
390 |
-
wpActiveEditor = editor.id;
|
391 |
-
});
|
392 |
-
}
|
393 |
-
});
|
394 |
-
|
395 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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object' ) {
|
7 |
-
props = { text: props };
|
8 |
-
}
|
9 |
-
|
10 |
-
// confirmRemove
|
11 |
-
if( props.confirmRemove !== undefined ) {
|
12 |
-
|
13 |
-
props.textConfirm = acf.__('Remove');
|
14 |
-
props.textCancel = acf.__('Cancel');
|
15 |
-
return new TooltipConfirm( props );
|
16 |
-
|
17 |
-
// confirm
|
18 |
-
} else if( props.confirm !== undefined ) {
|
19 |
-
|
20 |
-
return new TooltipConfirm( props );
|
21 |
-
|
22 |
-
// default
|
23 |
-
} else {
|
24 |
-
return new Tooltip( props );
|
25 |
-
}
|
26 |
-
|
27 |
-
};
|
28 |
-
|
29 |
-
var Tooltip = acf.Model.extend({
|
30 |
-
|
31 |
-
data: {
|
32 |
-
text: '',
|
33 |
-
timeout: 0,
|
34 |
-
target: null
|
35 |
-
},
|
36 |
-
|
37 |
-
tmpl: function(){
|
38 |
-
return '<div class="acf-tooltip"></div>';
|
39 |
-
},
|
40 |
-
|
41 |
-
setup: function( props ){
|
42 |
-
$.extend(this.data, props);
|
43 |
-
this.$el = $(this.tmpl());
|
44 |
-
},
|
45 |
-
|
46 |
-
initialize: function(){
|
47 |
-
|
48 |
-
// render
|
49 |
-
this.render();
|
50 |
-
|
51 |
-
// append
|
52 |
-
this.show();
|
53 |
-
|
54 |
-
// position
|
55 |
-
this.position();
|
56 |
-
|
57 |
-
// timeout
|
58 |
-
var timeout = this.get('timeout');
|
59 |
-
if( timeout ) {
|
60 |
-
setTimeout( $.proxy(this.fade, this), timeout );
|
61 |
-
}
|
62 |
-
},
|
63 |
-
|
64 |
-
update: function( props ){
|
65 |
-
$.extend(this.data, props);
|
66 |
-
this.initialize();
|
67 |
-
},
|
68 |
-
|
69 |
-
render: function(){
|
70 |
-
this.html( this.get('text') );
|
71 |
-
},
|
72 |
-
|
73 |
-
show: function(){
|
74 |
-
$('body').append( this.$el );
|
75 |
-
},
|
76 |
-
|
77 |
-
hide: function(){
|
78 |
-
this.$el.remove();
|
79 |
-
},
|
80 |
-
|
81 |
-
fade: function(){
|
82 |
-
|
83 |
-
// add class
|
84 |
-
this.$el.addClass('acf-fade-up');
|
85 |
-
|
86 |
-
// remove
|
87 |
-
this.setTimeout(function(){
|
88 |
-
this.remove();
|
89 |
-
}, 250);
|
90 |
-
},
|
91 |
-
|
92 |
-
html: function( html ){
|
93 |
-
this.$el.html( html );
|
94 |
-
},
|
95 |
-
|
96 |
-
position: function(){
|
97 |
-
|
98 |
-
// vars
|
99 |
-
var $tooltip = this.$el;
|
100 |
-
var $target = this.get('target');
|
101 |
-
if( !$target ) return;
|
102 |
-
|
103 |
-
// Reset position.
|
104 |
-
$tooltip.removeClass('right left bottom top').css({ top: 0, left: 0 });
|
105 |
-
|
106 |
-
// Declare tollerance to edge of screen.
|
107 |
-
var tolerance = 10;
|
108 |
-
|
109 |
-
// Find target position.
|
110 |
-
var targetWidth = $target.outerWidth();
|
111 |
-
var targetHeight = $target.outerHeight();
|
112 |
-
var targetTop = $target.offset().top;
|
113 |
-
var targetLeft = $target.offset().left;
|
114 |
-
|
115 |
-
// Find tooltip position.
|
116 |
-
var tooltipWidth = $tooltip.outerWidth();
|
117 |
-
var tooltipHeight = $tooltip.outerHeight();
|
118 |
-
var tooltipTop = $tooltip.offset().top; // Should be 0, but WP media grid causes this to be 32 (toolbar padding).
|
119 |
-
|
120 |
-
// Assume default top alignment.
|
121 |
-
var top = targetTop - tooltipHeight - tooltipTop;
|
122 |
-
var left = targetLeft + (targetWidth / 2) - (tooltipWidth / 2);
|
123 |
-
|
124 |
-
// Check if too far left.
|
125 |
-
if( left < tolerance ) {
|
126 |
-
$tooltip.addClass('right');
|
127 |
-
left = targetLeft + targetWidth;
|
128 |
-
top = targetTop + (targetHeight / 2) - (tooltipHeight / 2) - tooltipTop;
|
129 |
-
|
130 |
-
// Check if too far right.
|
131 |
-
} else if( (left + tooltipWidth + tolerance) > $(window).width() ) {
|
132 |
-
$tooltip.addClass('left');
|
133 |
-
left = targetLeft - tooltipWidth;
|
134 |
-
top = targetTop + (targetHeight / 2) - (tooltipHeight / 2) - tooltipTop;
|
135 |
-
|
136 |
-
// Check if too far up.
|
137 |
-
} else if( top - $(window).scrollTop() < tolerance ) {
|
138 |
-
$tooltip.addClass('bottom');
|
139 |
-
top = targetTop + targetHeight - tooltipTop;
|
140 |
-
|
141 |
-
// No colision with edges.
|
142 |
-
} else {
|
143 |
-
$tooltip.addClass('top');
|
144 |
-
}
|
145 |
-
|
146 |
-
// update css
|
147 |
-
$tooltip.css({ 'top': top, 'left': left });
|
148 |
-
}
|
149 |
-
});
|
150 |
-
|
151 |
-
var TooltipConfirm = Tooltip.extend({
|
152 |
-
|
153 |
-
data: {
|
154 |
-
text: '',
|
155 |
-
textConfirm: '',
|
156 |
-
textCancel: '',
|
157 |
-
target: null,
|
158 |
-
targetConfirm: true,
|
159 |
-
confirm: function(){},
|
160 |
-
cancel: function(){},
|
161 |
-
context: false
|
162 |
-
},
|
163 |
-
|
164 |
-
events: {
|
165 |
-
'click [data-event="cancel"]': 'onCancel',
|
166 |
-
'click [data-event="confirm"]': 'onConfirm',
|
167 |
-
},
|
168 |
-
|
169 |
-
addEvents: function(){
|
170 |
-
|
171 |
-
// add events
|
172 |
-
acf.Model.prototype.addEvents.apply(this);
|
173 |
-
|
174 |
-
// vars
|
175 |
-
var $document = $(document);
|
176 |
-
var $target = this.get('target');
|
177 |
-
|
178 |
-
// add global 'cancel' click event
|
179 |
-
// - use timeout to avoid the current 'click' event triggering the onCancel function
|
180 |
-
this.setTimeout(function(){
|
181 |
-
this.on( $document, 'click', 'onCancel' );
|
182 |
-
});
|
183 |
-
|
184 |
-
// add target 'confirm' click event
|
185 |
-
// - allow setting to control this feature
|
186 |
-
if( this.get('targetConfirm') ) {
|
187 |
-
this.on( $target, 'click', 'onConfirm' );
|
188 |
-
}
|
189 |
-
},
|
190 |
-
|
191 |
-
removeEvents: function(){
|
192 |
-
|
193 |
-
// remove events
|
194 |
-
acf.Model.prototype.removeEvents.apply(this);
|
195 |
-
|
196 |
-
// vars
|
197 |
-
var $document = $(document);
|
198 |
-
var $target = this.get('target');
|
199 |
-
|
200 |
-
// remove custom events
|
201 |
-
this.off( $document, 'click' );
|
202 |
-
this.off( $target, 'click' );
|
203 |
-
},
|
204 |
-
|
205 |
-
render: function(){
|
206 |
-
|
207 |
-
// defaults
|
208 |
-
var text = this.get('text') || acf.__('Are you sure?');
|
209 |
-
var textConfirm = this.get('textConfirm') || acf.__('Yes');
|
210 |
-
var textCancel = this.get('textCancel') || acf.__('No');
|
211 |
-
|
212 |
-
// html
|
213 |
-
var html = [
|
214 |
-
text,
|
215 |
-
'<a href="#" data-event="confirm">' + textConfirm + '</a>',
|
216 |
-
'<a href="#" data-event="cancel">' + textCancel + '</a>'
|
217 |
-
].join(' ');
|
218 |
-
|
219 |
-
// html
|
220 |
-
this.html( html );
|
221 |
-
|
222 |
-
// class
|
223 |
-
this.$el.addClass('-confirm');
|
224 |
-
},
|
225 |
-
|
226 |
-
onCancel: function( e, $el ){
|
227 |
-
|
228 |
-
// prevent default
|
229 |
-
e.preventDefault();
|
230 |
-
e.stopImmediatePropagation();
|
231 |
-
|
232 |
-
// callback
|
233 |
-
var callback = this.get('cancel');
|
234 |
-
var context = this.get('context') || this;
|
235 |
-
callback.apply( context, arguments );
|
236 |
-
|
237 |
-
//remove
|
238 |
-
this.remove();
|
239 |
-
},
|
240 |
-
|
241 |
-
onConfirm: function( e, $el ){
|
242 |
-
|
243 |
-
// prevent default
|
244 |
-
e.preventDefault();
|
245 |
-
e.stopImmediatePropagation();
|
246 |
-
|
247 |
-
// callback
|
248 |
-
var callback = this.get('confirm');
|
249 |
-
var context = this.get('context') || this;
|
250 |
-
callback.apply( context, arguments );
|
251 |
-
|
252 |
-
//remove
|
253 |
-
this.remove();
|
254 |
-
}
|
255 |
-
});
|
256 |
-
|
257 |
-
// storage
|
258 |
-
acf.models.Tooltip = Tooltip;
|
259 |
-
acf.models.TooltipConfirm = TooltipConfirm;
|
260 |
-
|
261 |
-
|
262 |
-
/**
|
263 |
-
* tooltipManager
|
264 |
-
*
|
265 |
-
* description
|
266 |
-
*
|
267 |
-
* @date 17/4/18
|
268 |
-
* @since 5.6.9
|
269 |
-
*
|
270 |
-
* @param type $var Description. Default.
|
271 |
-
* @return type Description.
|
272 |
-
*/
|
273 |
-
|
274 |
-
var tooltipHoverHelper = new acf.Model({
|
275 |
-
|
276 |
-
tooltip: false,
|
277 |
-
|
278 |
-
events: {
|
279 |
-
'mouseenter .acf-js-tooltip': 'showTitle',
|
280 |
-
'mouseup .acf-js-tooltip': 'hideTitle',
|
281 |
-
'mouseleave .acf-js-tooltip': 'hideTitle'
|
282 |
-
},
|
283 |
-
|
284 |
-
showTitle: function( e, $el ){
|
285 |
-
|
286 |
-
// vars
|
287 |
-
var title = $el.attr('title');
|
288 |
-
|
289 |
-
// bail ealry if no title
|
290 |
-
if( !title ) {
|
291 |
-
return;
|
292 |
-
}
|
293 |
-
|
294 |
-
// clear title to avoid default browser tooltip
|
295 |
-
$el.attr('title', '');
|
296 |
-
|
297 |
-
// create
|
298 |
-
if( !this.tooltip ) {
|
299 |
-
this.tooltip = acf.newTooltip({
|
300 |
-
text: title,
|
301 |
-
target: $el
|
302 |
-
});
|
303 |
-
|
304 |
-
// update
|
305 |
-
} else {
|
306 |
-
this.tooltip.update({
|
307 |
-
text: title,
|
308 |
-
target: $el
|
309 |
-
});
|
310 |
-
}
|
311 |
-
|
312 |
-
},
|
313 |
-
|
314 |
-
hideTitle: function( e, $el ){
|
315 |
-
|
316 |
-
// hide tooltip
|
317 |
-
this.tooltip.hide();
|
318 |
-
|
319 |
-
// restore title
|
320 |
-
$el.attr('title', this.tooltip.get('text'));
|
321 |
-
}
|
322 |
-
});
|
323 |
-
|
324 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/build/js/_acf-unload.js
DELETED
@@ -1,62 +0,0 @@
|
|
1 |
-
(function($, undefined){
|
2 |
-
|
3 |
-
acf.unload = new acf.Model({
|
4 |
-
|
5 |
-
wait: 'load',
|
6 |
-
active: true,
|
7 |
-
changed: false,
|
8 |
-
|
9 |
-
actions: {
|
10 |
-
'validation_failure': 'startListening',
|
11 |
-
'validation_success': 'stopListening'
|
12 |
-
},
|
13 |
-
|
14 |
-
events: {
|
15 |
-
'change form .acf-field': 'startListening',
|
16 |
-
'submit form': 'stopListening'
|
17 |
-
},
|
18 |
-
|
19 |
-
enable: function(){
|
20 |
-
this.active = true;
|
21 |
-
},
|
22 |
-
|
23 |
-
disable: function(){
|
24 |
-
this.active = false;
|
25 |
-
},
|
26 |
-
|
27 |
-
reset: function(){
|
28 |
-
this.stopListening();
|
29 |
-
},
|
30 |
-
|
31 |
-
startListening: function(){
|
32 |
-
|
33 |
-
// bail ealry if already changed, not active
|
34 |
-
if( this.changed || !this.active ) {
|
35 |
-
return;
|
36 |
-
}
|
37 |
-
|
38 |
-
// update
|
39 |
-
this.changed = true;
|
40 |
-
|
41 |
-
// add event
|
42 |
-
$(window).on('beforeunload', this.onUnload);
|
43 |
-
|
44 |
-
},
|
45 |
-
|
46 |
-
stopListening: function(){
|
47 |
-
|
48 |
-
// update
|
49 |
-
this.changed = false;
|
50 |
-
|
51 |
-
// remove event
|
52 |
-
$(window).off('beforeunload', this.onUnload);
|
53 |
-
|
54 |
-
},
|
55 |
-
|
56 |
-
onUnload: function(){
|
57 |
-
return acf.__('The changes you made will be lost if you navigate away from this page');
|
58 |
-
}
|
59 |
-
|
60 |
-
});
|
61 |
-
|
62 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/build/js/_acf-validation.js
DELETED
@@ -1,1006 +0,0 @@
|
|
1 |
-
(function($, undefined){
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Validator
|
5 |
-
*
|
6 |
-
* The model for validating forms
|
7 |
-
*
|
8 |
-
* @date 4/9/18
|
9 |
-
* @since 5.7.5
|
10 |
-
*
|
11 |
-
* @param void
|
12 |
-
* @return void
|
13 |
-
*/
|
14 |
-
var Validator = acf.Model.extend({
|
15 |
-
|
16 |
-
/** @var string The model identifier. */
|
17 |
-
id: 'Validator',
|
18 |
-
|
19 |
-
/** @var object The model data. */
|
20 |
-
data: {
|
21 |
-
|
22 |
-
/** @var array The form errors. */
|
23 |
-
errors: [],
|
24 |
-
|
25 |
-
/** @var object The form notice. */
|
26 |
-
notice: null,
|
27 |
-
|
28 |
-
/** @var string The form status. loading, invalid, valid */
|
29 |
-
status: ''
|
30 |
-
},
|
31 |
-
|
32 |
-
/** @var object The model events. */
|
33 |
-
events: {
|
34 |
-
'changed:status': 'onChangeStatus'
|
35 |
-
},
|
36 |
-
|
37 |
-
/**
|
38 |
-
* addErrors
|
39 |
-
*
|
40 |
-
* Adds errors to the form.
|
41 |
-
*
|
42 |
-
* @date 4/9/18
|
43 |
-
* @since 5.7.5
|
44 |
-
*
|
45 |
-
* @param array errors An array of errors.
|
46 |
-
* @return void
|
47 |
-
*/
|
48 |
-
addErrors: function( errors ){
|
49 |
-
errors.map( this.addError, this );
|
50 |
-
},
|
51 |
-
|
52 |
-
/**
|
53 |
-
* addError
|
54 |
-
*
|
55 |
-
* Adds and error to the form.
|
56 |
-
*
|
57 |
-
* @date 4/9/18
|
58 |
-
* @since 5.7.5
|
59 |
-
*
|
60 |
-
* @param object error An error object containing input and message.
|
61 |
-
* @return void
|
62 |
-
*/
|
63 |
-
addError: function( error ){
|
64 |
-
this.data.errors.push( error );
|
65 |
-
},
|
66 |
-
|
67 |
-
/**
|
68 |
-
* hasErrors
|
69 |
-
*
|
70 |
-
* Returns true if the form has errors.
|
71 |
-
*
|
72 |
-
* @date 4/9/18
|
73 |
-
* @since 5.7.5
|
74 |
-
*
|
75 |
-
* @param void
|
76 |
-
* @return bool
|
77 |
-
*/
|
78 |
-
hasErrors: function(){
|
79 |
-
return this.data.errors.length;
|
80 |
-
},
|
81 |
-
|
82 |
-
/**
|
83 |
-
* clearErrors
|
84 |
-
*
|
85 |
-
* Removes any errors.
|
86 |
-
*
|
87 |
-
* @date 4/9/18
|
88 |
-
* @since 5.7.5
|
89 |
-
*
|
90 |
-
* @param void
|
91 |
-
* @return void
|
92 |
-
*/
|
93 |
-
clearErrors: function(){
|
94 |
-
return this.data.errors = [];
|
95 |
-
},
|
96 |
-
|
97 |
-
/**
|
98 |
-
* getErrors
|
99 |
-
*
|
100 |
-
* Returns the forms errors.
|
101 |
-
*
|
102 |
-
* @date 4/9/18
|
103 |
-
* @since 5.7.5
|
104 |
-
*
|
105 |
-
* @param void
|
106 |
-
* @return array
|
107 |
-
*/
|
108 |
-
getErrors: function(){
|
109 |
-
return this.data.errors;
|
110 |
-
},
|
111 |
-
|
112 |
-
/**
|
113 |
-
* getFieldErrors
|
114 |
-
*
|
115 |
-
* Returns the forms field errors.
|
116 |
-
*
|
117 |
-
* @date 4/9/18
|
118 |
-
* @since 5.7.5
|
119 |
-
*
|
120 |
-
* @param void
|
121 |
-
* @return array
|
122 |
-
*/
|
123 |
-
getFieldErrors: function(){
|
124 |
-
|
125 |
-
// vars
|
126 |
-
var errors = [];
|
127 |
-
var inputs = [];
|
128 |
-
|
129 |
-
// loop
|
130 |
-
this.getErrors().map(function(error){
|
131 |
-
|
132 |
-
// bail early if global
|
133 |
-
if( !error.input ) return;
|
134 |
-
|
135 |
-
// update if exists
|
136 |
-
var i = inputs.indexOf(error.input);
|
137 |
-
if( i > -1 ) {
|
138 |
-
errors[ i ] = error;
|
139 |
-
|
140 |
-
// update
|
141 |
-
} else {
|
142 |
-
errors.push( error );
|
143 |
-
inputs.push( error.input );
|
144 |
-
}
|
145 |
-
});
|
146 |
-
|
147 |
-
// return
|
148 |
-
return errors;
|
149 |
-
},
|
150 |
-
|
151 |
-
/**
|
152 |
-
* getGlobalErrors
|
153 |
-
*
|
154 |
-
* Returns the forms global errors (errors without a specific input).
|
155 |
-
*
|
156 |
-
* @date 4/9/18
|
157 |
-
* @since 5.7.5
|
158 |
-
*
|
159 |
-
* @param void
|
160 |
-
* @return array
|
161 |
-
*/
|
162 |
-
getGlobalErrors: function(){
|
163 |
-
|
164 |
-
// return array of errors that contain no input
|
165 |
-
return this.getErrors().filter(function(error){
|
166 |
-
return !error.input;
|
167 |
-
});
|
168 |
-
},
|
169 |
-
|
170 |
-
/**
|
171 |
-
* showErrors
|
172 |
-
*
|
173 |
-
* Displays all errors for this form.
|
174 |
-
*
|
175 |
-
* @date 4/9/18
|
176 |
-
* @since 5.7.5
|
177 |
-
*
|
178 |
-
* @param void
|
179 |
-
* @return void
|
180 |
-
*/
|
181 |
-
showErrors: function(){
|
182 |
-
|
183 |
-
// bail early if no errors
|
184 |
-
if( !this.hasErrors() ) {
|
185 |
-
return;
|
186 |
-
}
|
187 |
-
|
188 |
-
// vars
|
189 |
-
var fieldErrors = this.getFieldErrors();
|
190 |
-
var globalErrors = this.getGlobalErrors();
|
191 |
-
|
192 |
-
// vars
|
193 |
-
var errorCount = 0;
|
194 |
-
var $scrollTo = false;
|
195 |
-
|
196 |
-
// loop
|
197 |
-
fieldErrors.map(function( error ){
|
198 |
-
|
199 |
-
// get input
|
200 |
-
var $input = this.$('[name="' + error.input + '"]').first();
|
201 |
-
|
202 |
-
// if $_POST value was an array, this $input may not exist
|
203 |
-
if( !$input.length ) {
|
204 |
-
$input = this.$('[name^="' + error.input + '"]').first();
|
205 |
-
}
|
206 |
-
|
207 |
-
// bail early if input doesn't exist
|
208 |
-
if( !$input.length ) {
|
209 |
-
return;
|
210 |
-
}
|
211 |
-
|
212 |
-
// increase
|
213 |
-
errorCount++;
|
214 |
-
|
215 |
-
// get field
|
216 |
-
var field = acf.getClosestField( $input );
|
217 |
-
|
218 |
-
// show error
|
219 |
-
field.showError( error.message );
|
220 |
-
|
221 |
-
// set $scrollTo
|
222 |
-
if( !$scrollTo ) {
|
223 |
-
$scrollTo = field.$el;
|
224 |
-
}
|
225 |
-
}, this);
|
226 |
-
|
227 |
-
// errorMessage
|
228 |
-
var errorMessage = acf.__('Validation failed');
|
229 |
-
globalErrors.map(function( error ){
|
230 |
-
errorMessage += '. ' + error.message;
|
231 |
-
});
|
232 |
-
if( errorCount == 1 ) {
|
233 |
-
errorMessage += '. ' + acf.__('1 field requires attention');
|
234 |
-
} else if( errorCount > 1 ) {
|
235 |
-
errorMessage += '. ' + acf.__('%d fields require attention').replace('%d', errorCount);
|
236 |
-
}
|
237 |
-
|
238 |
-
// notice
|
239 |
-
if( this.has('notice') ) {
|
240 |
-
this.get('notice').update({
|
241 |
-
type: 'error',
|
242 |
-
text: errorMessage
|
243 |
-
});
|
244 |
-
} else {
|
245 |
-
var notice = acf.newNotice({
|
246 |
-
type: 'error',
|
247 |
-
text: errorMessage,
|
248 |
-
target: this.$el
|
249 |
-
});
|
250 |
-
this.set('notice', notice);
|
251 |
-
}
|
252 |
-
|
253 |
-
// if no $scrollTo, set to message
|
254 |
-
if( !$scrollTo ) {
|
255 |
-
$scrollTo = this.get('notice').$el;
|
256 |
-
}
|
257 |
-
|
258 |
-
// timeout
|
259 |
-
setTimeout(function(){
|
260 |
-
$("html, body").animate({ scrollTop: $scrollTo.offset().top - ( $(window).height() / 2 ) }, 500);
|
261 |
-
}, 10);
|
262 |
-
},
|
263 |
-
|
264 |
-
/**
|
265 |
-
* onChangeStatus
|
266 |
-
*
|
267 |
-
* Update the form class when changing the 'status' data
|
268 |
-
*
|
269 |
-
* @date 4/9/18
|
270 |
-
* @since 5.7.5
|
271 |
-
*
|
272 |
-
* @param object e The event object.
|
273 |
-
* @param jQuery $el The form element.
|
274 |
-
* @param string value The new status.
|
275 |
-
* @param string prevValue The old status.
|
276 |
-
* @return void
|
277 |
-
*/
|
278 |
-
onChangeStatus: function( e, $el, value, prevValue ){
|
279 |
-
this.$el.removeClass('is-'+prevValue).addClass('is-'+value);
|
280 |
-
},
|
281 |
-
|
282 |
-
/**
|
283 |
-
* validate
|
284 |
-
*
|
285 |
-
* Vaildates the form via AJAX.
|
286 |
-
*
|
287 |
-
* @date 4/9/18
|
288 |
-
* @since 5.7.5
|
289 |
-
*
|
290 |
-
* @param object args A list of settings to customize the validation process.
|
291 |
-
* @return bool True if the form is valid.
|
292 |
-
*/
|
293 |
-
validate: function( args ){
|
294 |
-
|
295 |
-
// default args
|
296 |
-
args = acf.parseArgs(args, {
|
297 |
-
|
298 |
-
// trigger event
|
299 |
-
event: false,
|
300 |
-
|
301 |
-
// reset the form after submit
|
302 |
-
reset: false,
|
303 |
-
|
304 |
-
// loading callback
|
305 |
-
loading: function(){},
|
306 |
-
|
307 |
-
// complete callback
|
308 |
-
complete: function(){},
|
309 |
-
|
310 |
-
// failure callback
|
311 |
-
failure: function(){},
|
312 |
-
|
313 |
-
// success callback
|
314 |
-
success: function( $form ){
|
315 |
-
$form.submit();
|
316 |
-
}
|
317 |
-
});
|
318 |
-
|
319 |
-
// return true if is valid - allows form submit
|
320 |
-
if( this.get('status') == 'valid' ) {
|
321 |
-
return true;
|
322 |
-
}
|
323 |
-
|
324 |
-
// return false if is currently validating - prevents form submit
|
325 |
-
if( this.get('status') == 'validating' ) {
|
326 |
-
return false;
|
327 |
-
}
|
328 |
-
|
329 |
-
// return true if no ACF fields exist (no need to validate)
|
330 |
-
if( !this.$('.acf-field').length ) {
|
331 |
-
return true;
|
332 |
-
}
|
333 |
-
|
334 |
-
// if event is provided, create a new success callback.
|
335 |
-
if( args.event ) {
|
336 |
-
var event = $.Event(null, args.event);
|
337 |
-
args.success = function(){
|
338 |
-
acf.enableSubmit( $(event.target) ).trigger( event );
|
339 |
-
}
|
340 |
-
}
|
341 |
-
|
342 |
-
// action for 3rd party
|
343 |
-
acf.doAction('validation_begin', this.$el);
|
344 |
-
|
345 |
-
// lock form
|
346 |
-
acf.lockForm( this.$el );
|
347 |
-
|
348 |
-
// loading callback
|
349 |
-
args.loading( this.$el, this );
|
350 |
-
|
351 |
-
// update status
|
352 |
-
this.set('status', 'validating');
|
353 |
-
|
354 |
-
// success callback
|
355 |
-
var onSuccess = function( json ){
|
356 |
-
|
357 |
-
// validate
|
358 |
-
if( !acf.isAjaxSuccess(json) ) {
|
359 |
-
return;
|
360 |
-
}
|
361 |
-
|
362 |
-
// filter
|
363 |
-
var data = acf.applyFilters('validation_complete', json.data, this.$el, this);
|
364 |
-
|
365 |
-
// add errors
|
366 |
-
if( !data.valid ) {
|
367 |
-
this.addErrors( data.errors );
|
368 |
-
}
|
369 |
-
};
|
370 |
-
|
371 |
-
// complete
|
372 |
-
var onComplete = function(){
|
373 |
-
|
374 |
-
// unlock form
|
375 |
-
acf.unlockForm( this.$el );
|
376 |
-
|
377 |
-
// failure
|
378 |
-
if( this.hasErrors() ) {
|
379 |
-
|
380 |
-
// update status
|
381 |
-
this.set('status', 'invalid');
|
382 |
-
|
383 |
-
// action
|
384 |
-
acf.doAction('validation_failure', this.$el, this);
|
385 |
-
|
386 |
-
// display errors
|
387 |
-
this.showErrors();
|
388 |
-
|
389 |
-
// failure callback
|
390 |
-
args.failure( this.$el, this );
|
391 |
-
|
392 |
-
// success
|
393 |
-
} else {
|
394 |
-
|
395 |
-
// update status
|
396 |
-
this.set('status', 'valid');
|
397 |
-
|
398 |
-
// remove previous error message
|
399 |
-
if( this.has('notice') ) {
|
400 |
-
this.get('notice').update({
|
401 |
-
type: 'success',
|
402 |
-
text: acf.__('Validation successful'),
|
403 |
-
timeout: 1000
|
404 |
-
});
|
405 |
-
}
|
406 |
-
|
407 |
-
// action
|
408 |
-
acf.doAction('validation_success', this.$el, this);
|
409 |
-
acf.doAction('submit', this.$el);
|
410 |
-
|
411 |
-
// success callback (submit form)
|
412 |
-
args.success( this.$el, this );
|
413 |
-
|
414 |
-
// lock form
|
415 |
-
acf.lockForm( this.$el );
|
416 |
-
|
417 |
-
// reset
|
418 |
-
if( args.reset ) {
|
419 |
-
this.reset();
|
420 |
-
}
|
421 |
-
}
|
422 |
-
|
423 |
-
// complete callback
|
424 |
-
args.complete( this.$el, this );
|
425 |
-
|
426 |
-
// clear errors
|
427 |
-
this.clearErrors();
|
428 |
-
};
|
429 |
-
|
430 |
-
// serialize form data
|
431 |
-
var data = acf.serialize( this.$el );
|
432 |
-
data.action = 'acf/validate_save_post';
|
433 |
-
|
434 |
-
// ajax
|
435 |
-
$.ajax({
|
436 |
-
url: acf.get('ajaxurl'),
|
437 |
-
data: acf.prepareForAjax(data),
|
438 |
-
type: 'post',
|
439 |
-
dataType: 'json',
|
440 |
-
context: this,
|
441 |
-
success: onSuccess,
|
442 |
-
complete: onComplete
|
443 |
-
});
|
444 |
-
|
445 |
-
// return false to fail validation and allow AJAX
|
446 |
-
return false
|
447 |
-
},
|
448 |
-
|
449 |
-
/**
|
450 |
-
* setup
|
451 |
-
*
|
452 |
-
* Called during the constructor function to setup this instance
|
453 |
-
*
|
454 |
-
* @date 4/9/18
|
455 |
-
* @since 5.7.5
|
456 |
-
*
|
457 |
-
* @param jQuery $form The form element.
|
458 |
-
* @return void
|
459 |
-
*/
|
460 |
-
setup: function( $form ){
|
461 |
-
|
462 |
-
// set $el
|
463 |
-
this.$el = $form;
|
464 |
-
},
|
465 |
-
|
466 |
-
/**
|
467 |
-
* reset
|
468 |
-
*
|
469 |
-
* Rests the validation to be used again.
|
470 |
-
*
|
471 |
-
* @date 6/9/18
|
472 |
-
* @since 5.7.5
|
473 |
-
*
|
474 |
-
* @param void
|
475 |
-
* @return void
|
476 |
-
*/
|
477 |
-
reset: function(){
|
478 |
-
|
479 |
-
// reset data
|
480 |
-
this.set('errors', []);
|
481 |
-
this.set('notice', null);
|
482 |
-
this.set('status', '');
|
483 |
-
|
484 |
-
// unlock form
|
485 |
-
acf.unlockForm( this.$el );
|
486 |
-
}
|
487 |
-
});
|
488 |
-
|
489 |
-
/**
|
490 |
-
* getValidator
|
491 |
-
*
|
492 |
-
* Returns the instance for a given form element.
|
493 |
-
*
|
494 |
-
* @date 4/9/18
|
495 |
-
* @since 5.7.5
|
496 |
-
*
|
497 |
-
* @param jQuery $el The form element.
|
498 |
-
* @return object
|
499 |
-
*/
|
500 |
-
var getValidator = function( $el ){
|
501 |
-
|
502 |
-
// instantiate
|
503 |
-
var validator = $el.data('acf');
|
504 |
-
if( !validator ) {
|
505 |
-
validator = new Validator( $el );
|
506 |
-
}
|
507 |
-
|
508 |
-
// return
|
509 |
-
return validator;
|
510 |
-
};
|
511 |
-
|
512 |
-
/**
|
513 |
-
* acf.validateForm
|
514 |
-
*
|
515 |
-
* A helper function for the Validator.validate() function.
|
516 |
-
* Returns true if form is valid, or fetches a validation request and returns false.
|
517 |
-
*
|
518 |
-
* @date 4/4/18
|
519 |
-
* @since 5.6.9
|
520 |
-
*
|
521 |
-
* @param object args A list of settings to customize the validation process.
|
522 |
-
* @return bool
|
523 |
-
*/
|
524 |
-
|
525 |
-
acf.validateForm = function( args ){
|
526 |
-
return getValidator( args.form ).validate( args );
|
527 |
-
};
|
528 |
-
|
529 |
-
/**
|
530 |
-
* acf.enableSubmit
|
531 |
-
*
|
532 |
-
* Enables a submit button and returns the element.
|
533 |
-
*
|
534 |
-
* @date 30/8/18
|
535 |
-
* @since 5.7.4
|
536 |
-
*
|
537 |
-
* @param jQuery $submit The submit button.
|
538 |
-
* @return jQuery
|
539 |
-
*/
|
540 |
-
acf.enableSubmit = function( $submit ){
|
541 |
-
return $submit.removeClass('disabled');
|
542 |
-
};
|
543 |
-
|
544 |
-
/**
|
545 |
-
* acf.disableSubmit
|
546 |
-
*
|
547 |
-
* Disables a submit button and returns the element.
|
548 |
-
*
|
549 |
-
* @date 30/8/18
|
550 |
-
* @since 5.7.4
|
551 |
-
*
|
552 |
-
* @param jQuery $submit The submit button.
|
553 |
-
* @return jQuery
|
554 |
-
*/
|
555 |
-
acf.disableSubmit = function( $submit ){
|
556 |
-
return $submit.addClass('disabled');
|
557 |
-
};
|
558 |
-
|
559 |
-
/**
|
560 |
-
* acf.showSpinner
|
561 |
-
*
|
562 |
-
* Shows the spinner element.
|
563 |
-
*
|
564 |
-
* @date 4/9/18
|
565 |
-
* @since 5.7.5
|
566 |
-
*
|
567 |
-
* @param jQuery $spinner The spinner element.
|
568 |
-
* @return jQuery
|
569 |
-
*/
|
570 |
-
acf.showSpinner = function( $spinner ){
|
571 |
-
$spinner.addClass('is-active'); // add class (WP > 4.2)
|
572 |
-
$spinner.css('display', 'inline-block'); // css (WP < 4.2)
|
573 |
-
return $spinner;
|
574 |
-
};
|
575 |
-
|
576 |
-
/**
|
577 |
-
* acf.hideSpinner
|
578 |
-
*
|
579 |
-
* Hides the spinner element.
|
580 |
-
*
|
581 |
-
* @date 4/9/18
|
582 |
-
* @since 5.7.5
|
583 |
-
*
|
584 |
-
* @param jQuery $spinner The spinner element.
|
585 |
-
* @return jQuery
|
586 |
-
*/
|
587 |
-
acf.hideSpinner = function( $spinner ){
|
588 |
-
$spinner.removeClass('is-active'); // add class (WP > 4.2)
|
589 |
-
$spinner.css('display', 'none'); // css (WP < 4.2)
|
590 |
-
return $spinner;
|
591 |
-
};
|
592 |
-
|
593 |
-
/**
|
594 |
-
* acf.lockForm
|
595 |
-
*
|
596 |
-
* Locks a form by disabeling its primary inputs and showing a spinner.
|
597 |
-
*
|
598 |
-
* @date 4/9/18
|
599 |
-
* @since 5.7.5
|
600 |
-
*
|
601 |
-
* @param jQuery $form The form element.
|
602 |
-
* @return jQuery
|
603 |
-
*/
|
604 |
-
acf.lockForm = function( $form ){
|
605 |
-
|
606 |
-
// vars
|
607 |
-
var $wrap = findSubmitWrap( $form );
|
608 |
-
var $submit = $wrap.find('.button, [type="submit"]');
|
609 |
-
var $spinner = $wrap.find('.spinner, .acf-spinner');
|
610 |
-
|
611 |
-
// hide all spinners (hides the preview spinner)
|
612 |
-
acf.hideSpinner( $spinner );
|
613 |
-
|
614 |
-
// lock
|
615 |
-
acf.disableSubmit( $submit );
|
616 |
-
acf.showSpinner( $spinner.last() );
|
617 |
-
return $form;
|
618 |
-
};
|
619 |
-
|
620 |
-
/**
|
621 |
-
* acf.unlockForm
|
622 |
-
*
|
623 |
-
* Unlocks a form by enabeling its primary inputs and hiding all spinners.
|
624 |
-
*
|
625 |
-
* @date 4/9/18
|
626 |
-
* @since 5.7.5
|
627 |
-
*
|
628 |
-
* @param jQuery $form The form element.
|
629 |
-
* @return jQuery
|
630 |
-
*/
|
631 |
-
acf.unlockForm = function( $form ){
|
632 |
-
|
633 |
-
// vars
|
634 |
-
var $wrap = findSubmitWrap( $form );
|
635 |
-
var $submit = $wrap.find('.button, [type="submit"]');
|
636 |
-
var $spinner = $wrap.find('.spinner, .acf-spinner');
|
637 |
-
|
638 |
-
// unlock
|
639 |
-
acf.enableSubmit( $submit );
|
640 |
-
acf.hideSpinner( $spinner );
|
641 |
-
return $form;
|
642 |
-
};
|
643 |
-
|
644 |
-
/**
|
645 |
-
* findSubmitWrap
|
646 |
-
*
|
647 |
-
* An internal function to find the 'primary' form submit wrapping element.
|
648 |
-
*
|
649 |
-
* @date 4/9/18
|
650 |
-
* @since 5.7.5
|
651 |
-
*
|
652 |
-
* @param jQuery $form The form element.
|
653 |
-
* @return jQuery
|
654 |
-
*/
|
655 |
-
var findSubmitWrap = function( $form ){
|
656 |
-
|
657 |
-
// default post submit div
|
658 |
-
var $wrap = $form.find('#submitdiv');
|
659 |
-
if( $wrap.length ) {
|
660 |
-
return $wrap;
|
661 |
-
}
|
662 |
-
|
663 |
-
// 3rd party publish box
|
664 |
-
var $wrap = $form.find('#submitpost');
|
665 |
-
if( $wrap.length ) {
|
666 |
-
return $wrap;
|
667 |
-
}
|
668 |
-
|
669 |
-
// term, user
|
670 |
-
var $wrap = $form.find('p.submit').last();
|
671 |
-
if( $wrap.length ) {
|
672 |
-
return $wrap;
|
673 |
-
}
|
674 |
-
|
675 |
-
// front end form
|
676 |
-
var $wrap = $form.find('.acf-form-submit');
|
677 |
-
if( $wrap.length ) {
|
678 |
-
return $wrap;
|
679 |
-
}
|
680 |
-
|
681 |
-
// default
|
682 |
-
return $form;
|
683 |
-
};
|
684 |
-
|
685 |
-
/**
|
686 |
-
* acf.validation
|
687 |
-
*
|
688 |
-
* Global validation logic
|
689 |
-
*
|
690 |
-
* @date 4/4/18
|
691 |
-
* @since 5.6.9
|
692 |
-
*
|
693 |
-
* @param void
|
694 |
-
* @return void
|
695 |
-
*/
|
696 |
-
|
697 |
-
acf.validation = new acf.Model({
|
698 |
-
|
699 |
-
/** @var string The model identifier. */
|
700 |
-
id: 'validation',
|
701 |
-
|
702 |
-
/** @var bool The active state. Set to false before 'prepare' to prevent validation. */
|
703 |
-
active: true,
|
704 |
-
|
705 |
-
/** @var string The model initialize time. */
|
706 |
-
wait: 'prepare',
|
707 |
-
|
708 |
-
/** @var object The model actions. */
|
709 |
-
actions: {
|
710 |
-
'ready': 'addInputEvents',
|
711 |
-
'append': 'addInputEvents'
|
712 |
-
},
|
713 |
-
|
714 |
-
/** @var object The model events. */
|
715 |
-
events: {
|
716 |
-
'click input[type="submit"]': 'onClickSubmit',
|
717 |
-
'click button[type="submit"]': 'onClickSubmit',
|
718 |
-
//'click #editor .editor-post-publish-button': 'onClickSubmitGutenberg',
|
719 |
-
'click #save-post': 'onClickSave',
|
720 |
-
'submit form#post': 'onSubmitPost',
|
721 |
-
'submit form': 'onSubmit',
|
722 |
-
},
|
723 |
-
|
724 |
-
/**
|
725 |
-
* initialize
|
726 |
-
*
|
727 |
-
* Called when initializing the model.
|
728 |
-
*
|
729 |
-
* @date 4/9/18
|
730 |
-
* @since 5.7.5
|
731 |
-
*
|
732 |
-
* @param void
|
733 |
-
* @return void
|
734 |
-
*/
|
735 |
-
initialize: function(){
|
736 |
-
|
737 |
-
// check 'validation' setting
|
738 |
-
if( !acf.get('validation') ) {
|
739 |
-
this.active = false;
|
740 |
-
this.actions = {};
|
741 |
-
this.events = {};
|
742 |
-
}
|
743 |
-
},
|
744 |
-
|
745 |
-
/**
|
746 |
-
* enable
|
747 |
-
*
|
748 |
-
* Enables validation.
|
749 |
-
*
|
750 |
-
* @date 4/9/18
|
751 |
-
* @since 5.7.5
|
752 |
-
*
|
753 |
-
* @param void
|
754 |
-
* @return void
|
755 |
-
*/
|
756 |
-
enable: function(){
|
757 |
-
this.active = true;
|
758 |
-
},
|
759 |
-
|
760 |
-
/**
|
761 |
-
* disable
|
762 |
-
*
|
763 |
-
* Disables validation.
|
764 |
-
*
|
765 |
-
* @date 4/9/18
|
766 |
-
* @since 5.7.5
|
767 |
-
*
|
768 |
-
* @param void
|
769 |
-
* @return void
|
770 |
-
*/
|
771 |
-
disable: function(){
|
772 |
-
this.active = false;
|
773 |
-
},
|
774 |
-
|
775 |
-
/**
|
776 |
-
* reset
|
777 |
-
*
|
778 |
-
* Rests the form validation to be used again
|
779 |
-
*
|
780 |
-
* @date 6/9/18
|
781 |
-
* @since 5.7.5
|
782 |
-
*
|
783 |
-
* @param jQuery $form The form element.
|
784 |
-
* @return void
|
785 |
-
*/
|
786 |
-
reset: function( $form ){
|
787 |
-
getValidator( $form ).reset();
|
788 |
-
},
|
789 |
-
|
790 |
-
/**
|
791 |
-
* addInputEvents
|
792 |
-
*
|
793 |
-
* Adds 'invalid' event listeners to HTML inputs.
|
794 |
-
*
|
795 |
-
* @date 4/9/18
|
796 |
-
* @since 5.7.5
|
797 |
-
*
|
798 |
-
* @param jQuery $el The element being added / readied.
|
799 |
-
* @return void
|
800 |
-
*/
|
801 |
-
addInputEvents: function( $el ){
|
802 |
-
|
803 |
-
// vars
|
804 |
-
var $inputs = $('.acf-field [name]', $el);
|
805 |
-
|
806 |
-
// check
|
807 |
-
if( $inputs.length ) {
|
808 |
-
this.on( $inputs, 'invalid', 'onInvalid' );
|
809 |
-
}
|
810 |
-
},
|
811 |
-
|
812 |
-
/**
|
813 |
-
* onInvalid
|
814 |
-
*
|
815 |
-
* Callback for the 'invalid' event.
|
816 |
-
*
|
817 |
-
* @date 4/9/18
|
818 |
-
* @since 5.7.5
|
819 |
-
*
|
820 |
-
* @param object e The event object.
|
821 |
-
* @param jQuery $el The input element.
|
822 |
-
* @return void
|
823 |
-
*/
|
824 |
-
onInvalid: function( e, $el ){
|
825 |
-
|
826 |
-
// prevent default
|
827 |
-
// - prevents browser error message
|
828 |
-
// - also fixes chrome bug where 'hidden-by-tab' field throws focus error
|
829 |
-
e.preventDefault();
|
830 |
-
|
831 |
-
// vars
|
832 |
-
var $form = $el.closest('form');
|
833 |
-
|
834 |
-
// check form exists
|
835 |
-
if( $form.length ) {
|
836 |
-
|
837 |
-
// add error to validator
|
838 |
-
getValidator( $form ).addError({
|
839 |
-
input: $el.attr('name'),
|
840 |
-
message: e.target.validationMessage
|
841 |
-
});
|
842 |
-
|
843 |
-
// trigger submit on $form
|
844 |
-
// - allows for "save", "preview" and "publish" to work
|
845 |
-
$form.submit();
|
846 |
-
}
|
847 |
-
},
|
848 |
-
|
849 |
-
/**
|
850 |
-
* onClickSubmit
|
851 |
-
*
|
852 |
-
* Callback when clicking submit.
|
853 |
-
*
|
854 |
-
* @date 4/9/18
|
855 |
-
* @since 5.7.5
|
856 |
-
*
|
857 |
-
* @param object e The event object.
|
858 |
-
* @param jQuery $el The input element.
|
859 |
-
* @return void
|
860 |
-
*/
|
861 |
-
onClickSubmit: function( e, $el ){
|
862 |
-
|
863 |
-
// store the "click event" for later use in this.onSubmit()
|
864 |
-
this.set('originalEvent', e);
|
865 |
-
},
|
866 |
-
|
867 |
-
/**
|
868 |
-
* onClickSave
|
869 |
-
*
|
870 |
-
* Set ignore to true when saving a draft.
|
871 |
-
*
|
872 |
-
* @date 4/9/18
|
873 |
-
* @since 5.7.5
|
874 |
-
*
|
875 |
-
* @param object e The event object.
|
876 |
-
* @param jQuery $el The input element.
|
877 |
-
* @return void
|
878 |
-
*/
|
879 |
-
onClickSave: function( e, $el ) {
|
880 |
-
this.set('ignore', true);
|
881 |
-
},
|
882 |
-
|
883 |
-
/**
|
884 |
-
* onClickSubmitGutenberg
|
885 |
-
*
|
886 |
-
* Custom validation event for the gutenberg editor.
|
887 |
-
*
|
888 |
-
* @date 29/10/18
|
889 |
-
* @since 5.8.0
|
890 |
-
*
|
891 |
-
* @param object e The event object.
|
892 |
-
* @param jQuery $el The input element.
|
893 |
-
* @return void
|
894 |
-
*/
|
895 |
-
onClickSubmitGutenberg: function( e, $el ){
|
896 |
-
|
897 |
-
// validate
|
898 |
-
var valid = acf.validateForm({
|
899 |
-
form: $('#editor'),
|
900 |
-
event: e,
|
901 |
-
reset: true,
|
902 |
-
failure: function( $form, validator ){
|
903 |
-
var $notice = validator.get('notice').$el;
|
904 |
-
$notice.appendTo('.components-notice-list');
|
905 |
-
$notice.find('.acf-notice-dismiss').removeClass('small');
|
906 |
-
}
|
907 |
-
});
|
908 |
-
|
909 |
-
// if not valid, stop event and allow validation to continue
|
910 |
-
if( !valid ) {
|
911 |
-
e.preventDefault();
|
912 |
-
e.stopImmediatePropagation();
|
913 |
-
}
|
914 |
-
},
|
915 |
-
|
916 |
-
/**
|
917 |
-
* onSubmitPost
|
918 |
-
*
|
919 |
-
* Callback when the 'post' form is submit.
|
920 |
-
*
|
921 |
-
* @date 5/3/19
|
922 |
-
* @since 5.7.13
|
923 |
-
*
|
924 |
-
* @param object e The event object.
|
925 |
-
* @param jQuery $el The input element.
|
926 |
-
* @return void
|
927 |
-
*/
|
928 |
-
onSubmitPost: function( e, $el ) {
|
929 |
-
|
930 |
-
// Check if is preview.
|
931 |
-
if( $('input#wp-preview').val() === 'dopreview' ) {
|
932 |
-
|
933 |
-
// Ignore validation.
|
934 |
-
this.set('ignore', true);
|
935 |
-
|
936 |
-
// Unlock form to fix conflict with core "submit.edit-post" event causing all submit buttons to be disabled.
|
937 |
-
acf.unlockForm( $el )
|
938 |
-
}
|
939 |
-
},
|
940 |
-
|
941 |
-
/**
|
942 |
-
* onSubmit
|
943 |
-
*
|
944 |
-
* Callback when the form is submit.
|
945 |
-
*
|
946 |
-
* @date 4/9/18
|
947 |
-
* @since 5.7.5
|
948 |
-
*
|
949 |
-
* @param object e The event object.
|
950 |
-
* @param jQuery $el The input element.
|
951 |
-
* @return void
|
952 |
-
*/
|
953 |
-
onSubmit: function( e, $el ){
|
954 |
-
|
955 |
-
// Allow form to submit if...
|
956 |
-
if(
|
957 |
-
// Validation has been disabled.
|
958 |
-
!this.active
|
959 |
-
|
960 |
-
// Or this event is to be ignored.
|
961 |
-
|| this.get('ignore')
|
962 |
-
|
963 |
-
// Or this event has already been prevented.
|
964 |
-
|| e.isDefaultPrevented()
|
965 |
-
) {
|
966 |
-
// Return early and call reset function.
|
967 |
-
return this.allowSubmit();
|
968 |
-
}
|
969 |
-
|
970 |
-
// Validate form.
|
971 |
-
var valid = acf.validateForm({
|
972 |
-
form: $el,
|
973 |
-
event: this.get('originalEvent')
|
974 |
-
});
|
975 |
-
|
976 |
-
// If not valid, stop event to prevent form submit.
|
977 |
-
if( !valid ) {
|
978 |
-
e.preventDefault();
|
979 |
-
}
|
980 |
-
},
|
981 |
-
|
982 |
-
/**
|
983 |
-
* allowSubmit
|
984 |
-
*
|
985 |
-
* Resets data during onSubmit when the form is allowed to submit.
|
986 |
-
*
|
987 |
-
* @date 5/3/19
|
988 |
-
* @since 5.7.13
|
989 |
-
*
|
990 |
-
* @param void
|
991 |
-
* @return void
|
992 |
-
*/
|
993 |
-
allowSubmit: function(){
|
994 |
-
|
995 |
-
// Reset "ignore" state.
|
996 |
-
this.set('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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/build/js/_acf.js
DELETED
@@ -1,2202 +0,0 @@
|
|
1 |
-
(function($, undefined){
|
2 |
-
|
3 |
-
/**
|
4 |
-
* acf
|
5 |
-
*
|
6 |
-
* description
|
7 |
-
*
|
8 |
-
* @date 14/12/17
|
9 |
-
* @since 5.6.5
|
10 |
-
*
|
11 |
-
* @param type $var Description. Default.
|
12 |
-
* @return type Description.
|
13 |
-
*/
|
14 |
-
|
15 |
-
// The global acf object
|
16 |
-
var acf = {};
|
17 |
-
|
18 |
-
// Set as a browser global
|
19 |
-
window.acf = acf;
|
20 |
-
|
21 |
-
/** @var object Data sent from PHP */
|
22 |
-
acf.data = {};
|
23 |
-
|
24 |
-
|
25 |
-
/**
|
26 |
-
* get
|
27 |
-
*
|
28 |
-
* Gets a specific data value
|
29 |
-
*
|
30 |
-
* @date 14/12/17
|
31 |
-
* @since 5.6.5
|
32 |
-
*
|
33 |
-
* @param string name
|
34 |
-
* @return mixed
|
35 |
-
*/
|
36 |
-
|
37 |
-
acf.get = function( name ){
|
38 |
-
return this.data[name] || null;
|
39 |
-
};
|
40 |
-
|
41 |
-
|
42 |
-
/**
|
43 |
-
* has
|
44 |
-
*
|
45 |
-
* Returns `true` if the data exists and is not null
|
46 |
-
*
|
47 |
-
* @date 14/12/17
|
48 |
-
* @since 5.6.5
|
49 |
-
*
|
50 |
-
* @param string name
|
51 |
-
* @return boolean
|
52 |
-
*/
|
53 |
-
|
54 |
-
acf.has = function( name ){
|
55 |
-
return this.get(name) !== null;
|
56 |
-
};
|
57 |
-
|
58 |
-
|
59 |
-
/**
|
60 |
-
* set
|
61 |
-
*
|
62 |
-
* Sets a specific data value
|
63 |
-
*
|
64 |
-
* @date 14/12/17
|
65 |
-
* @since 5.6.5
|
66 |
-
*
|
67 |
-
* @param string name
|
68 |
-
* @param mixed value
|
69 |
-
* @return this
|
70 |
-
*/
|
71 |
-
|
72 |
-
acf.set = function( name, value ){
|
73 |
-
this.data[ name ] = value;
|
74 |
-
return this;
|
75 |
-
};
|
76 |
-
|
77 |
-
|
78 |
-
/**
|
79 |
-
* uniqueId
|
80 |
-
*
|
81 |
-
* Returns a unique ID
|
82 |
-
*
|
83 |
-
* @date 9/11/17
|
84 |
-
* @since 5.6.3
|
85 |
-
*
|
86 |
-
* @param string prefix Optional prefix.
|
87 |
-
* @return string
|
88 |
-
*/
|
89 |
-
|
90 |
-
var idCounter = 0;
|
91 |
-
acf.uniqueId = function(prefix){
|
92 |
-
var id = ++idCounter + '';
|
93 |
-
return prefix ? prefix + id : id;
|
94 |
-
};
|
95 |
-
|
96 |
-
/**
|
97 |
-
* acf.uniqueArray
|
98 |
-
*
|
99 |
-
* Returns a new array with only unique values
|
100 |
-
* Credit: https://stackoverflow.com/questions/1960473/get-all-unique-values-in-an-array-remove-duplicates
|
101 |
-
*
|
102 |
-
* @date 23/3/18
|
103 |
-
* @since 5.6.9
|
104 |
-
*
|
105 |
-
* @param type $var Description. Default.
|
106 |
-
* @return type Description.
|
107 |
-
*/
|
108 |
-
|
109 |
-
acf.uniqueArray = function( array ){
|
110 |
-
function onlyUnique(value, index, self) {
|
111 |
-
return self.indexOf(value) === index;
|
112 |
-
}
|
113 |
-
return array.filter( onlyUnique );
|
114 |
-
};
|
115 |
-
|
116 |
-
/**
|
117 |
-
* uniqid
|
118 |
-
*
|
119 |
-
* Returns a unique ID (PHP version)
|
120 |
-
*
|
121 |
-
* @date 9/11/17
|
122 |
-
* @since 5.6.3
|
123 |
-
* @source http://locutus.io/php/misc/uniqid/
|
124 |
-
*
|
125 |
-
* @param string prefix Optional prefix.
|
126 |
-
* @return string
|
127 |
-
*/
|
128 |
-
|
129 |
-
var uniqidSeed = '';
|
130 |
-
acf.uniqid = function(prefix, moreEntropy){
|
131 |
-
// discuss at: http://locutus.io/php/uniqid/
|
132 |
-
// original by: Kevin van Zonneveld (http://kvz.io)
|
133 |
-
// revised by: Kankrelune (http://www.webfaktory.info/)
|
134 |
-
// note 1: Uses an internal counter (in locutus global) to avoid collision
|
135 |
-
// example 1: var $id = uniqid()
|
136 |
-
// example 1: var $result = $id.length === 13
|
137 |
-
// returns 1: true
|
138 |
-
// example 2: var $id = uniqid('foo')
|
139 |
-
// example 2: var $result = $id.length === (13 + 'foo'.length)
|
140 |
-
// returns 2: true
|
141 |
-
// example 3: var $id = uniqid('bar', true)
|
142 |
-
// example 3: var $result = $id.length === (23 + 'bar'.length)
|
143 |
-
// returns 3: true
|
144 |
-
if (typeof prefix === 'undefined') {
|
145 |
-
prefix = '';
|
146 |
-
}
|
147 |
-
|
148 |
-
var retId;
|
149 |
-
var formatSeed = function(seed, reqWidth) {
|
150 |
-
seed = parseInt(seed, 10).toString(16); // to hex str
|
151 |
-
if (reqWidth < seed.length) { // so long we split
|
152 |
-
return seed.slice(seed.length - reqWidth);
|
153 |
-
}
|
154 |
-
if (reqWidth > seed.length) { // so short we pad
|
155 |
-
return Array(1 + (reqWidth - seed.length)).join('0') + seed;
|
156 |
-
}
|
157 |
-
return seed;
|
158 |
-
};
|
159 |
-
|
160 |
-
if (!uniqidSeed) { // init seed with big random int
|
161 |
-
uniqidSeed = Math.floor(Math.random() * 0x75bcd15);
|
162 |
-
}
|
163 |
-
uniqidSeed++;
|
164 |
-
|
165 |
-
retId = prefix; // start with prefix, add current milliseconds hex string
|
166 |
-
retId += formatSeed(parseInt(new Date().getTime() / 1000, 10), 8);
|
167 |
-
retId += formatSeed(uniqidSeed, 5); // add seed hex string
|
168 |
-
if (moreEntropy) {
|
169 |
-
// for more entropy we add a float lower to 10
|
170 |
-
retId += (Math.random() * 10).toFixed(8).toString();
|
171 |
-
}
|
172 |
-
|
173 |
-
return retId;
|
174 |
-
};
|
175 |
-
|
176 |
-
|
177 |
-
/**
|
178 |
-
* strReplace
|
179 |
-
*
|
180 |
-
* Performs a string replace
|
181 |
-
*
|
182 |
-
* @date 14/12/17
|
183 |
-
* @since 5.6.5
|
184 |
-
*
|
185 |
-
* @param string search
|
186 |
-
* @param string replace
|
187 |
-
* @param string subject
|
188 |
-
* @return string
|
189 |
-
*/
|
190 |
-
|
191 |
-
acf.strReplace = function( search, replace, subject ){
|
192 |
-
return subject.split(search).join(replace);
|
193 |
-
};
|
194 |
-
|
195 |
-
|
196 |
-
/**
|
197 |
-
* strCamelCase
|
198 |
-
*
|
199 |
-
* Converts a string into camelCase
|
200 |
-
* Thanks to https://stackoverflow.com/questions/2970525/converting-any-string-into-camel-case
|
201 |
-
*
|
202 |
-
* @date 14/12/17
|
203 |
-
* @since 5.6.5
|
204 |
-
*
|
205 |
-
* @param string str
|
206 |
-
* @return string
|
207 |
-
*/
|
208 |
-
|
209 |
-
acf.strCamelCase = function( str ){
|
210 |
-
|
211 |
-
// replace [_-] characters with space
|
212 |
-
str = str.replace(/[_-]/g, ' ');
|
213 |
-
|
214 |
-
// camelCase
|
215 |
-
str = str.replace(/(?:^\w|\b\w|\s+)/g, function(match, index) {
|
216 |
-
if (+match === 0) return ""; // or if (/\s+/.test(match)) for white spaces
|
217 |
-
return index == 0 ? match.toLowerCase() : match.toUpperCase();
|
218 |
-
});
|
219 |
-
|
220 |
-
// return
|
221 |
-
return str;
|
222 |
-
};
|
223 |
-
|
224 |
-
/**
|
225 |
-
* strPascalCase
|
226 |
-
*
|
227 |
-
* Converts a string into PascalCase
|
228 |
-
* Thanks to https://stackoverflow.com/questions/1026069/how-do-i-make-the-first-letter-of-a-string-uppercase-in-javascript
|
229 |
-
*
|
230 |
-
* @date 14/12/17
|
231 |
-
* @since 5.6.5
|
232 |
-
*
|
233 |
-
* @param string str
|
234 |
-
* @return string
|
235 |
-
*/
|
236 |
-
|
237 |
-
acf.strPascalCase = function( str ){
|
238 |
-
var camel = acf.strCamelCase( str );
|
239 |
-
return camel.charAt(0).toUpperCase() + camel.slice(1);
|
240 |
-
};
|
241 |
-
|
242 |
-
/**
|
243 |
-
* acf.strSlugify
|
244 |
-
*
|
245 |
-
* Converts a string into a HTML class friendly slug
|
246 |
-
*
|
247 |
-
* @date 21/3/18
|
248 |
-
* @since 5.6.9
|
249 |
-
*
|
250 |
-
* @param string str
|
251 |
-
* @return string
|
252 |
-
*/
|
253 |
-
|
254 |
-
acf.strSlugify = function( str ){
|
255 |
-
return acf.strReplace( '_', '-', str.toLowerCase() );
|
256 |
-
};
|
257 |
-
|
258 |
-
|
259 |
-
acf.strSanitize = function( str ){
|
260 |
-
|
261 |
-
// chars (https://jsperf.com/replace-foreign-characters)
|
262 |
-
var map = {
|
263 |
-
"À": "A",
|
264 |
-
"Á": "A",
|
265 |
-
"Â": "A",
|
266 |
-
"Ã": "A",
|
267 |
-
"Ä": "A",
|
268 |
-
"Å": "A",
|
269 |
-
"Æ": "AE",
|
270 |
-
"Ç": "C",
|
271 |
-
"È": "E",
|
272 |
-
"É": "E",
|
273 |
-
"Ê": "E",
|
274 |
-
"Ë": "E",
|
275 |
-
"Ì": "I",
|
276 |
-
"Í": "I",
|
277 |
-
"Î": "I",
|
278 |
-
"Ï": "I",
|
279 |
-
"Ð": "D",
|
280 |
-
"Ñ": "N",
|
281 |
-
"Ò": "O",
|
282 |
-
"Ó": "O",
|
283 |
-
"Ô": "O",
|
284 |
-
"Õ": "O",
|
285 |
-
"Ö": "O",
|
286 |
-
"Ø": "O",
|
287 |
-
"Ù": "U",
|
288 |
-
"Ú": "U",
|
289 |
-
"Û": "U",
|
290 |
-
"Ü": "U",
|
291 |
-
"Ý": "Y",
|
292 |
-
"ß": "s",
|
293 |
-
"à": "a",
|
294 |
-
"á": "a",
|
295 |
-
"â": "a",
|
296 |
-
"ã": "a",
|
297 |
-
"ä": "a",
|
298 |
-
"å": "a",
|
299 |
-
"æ": "ae",
|
300 |
-
"ç": "c",
|
301 |
-
"è": "e",
|
302 |
-
"é": "e",
|
303 |
-
"ê": "e",
|
304 |
-
"ë": "e",
|
305 |
-
"ì": "i",
|
306 |
-
"í": "i",
|
307 |
-
"î": "i",
|
308 |
-
"ï": "i",
|
309 |
-
"ñ": "n",
|
310 |
-
"ò": "o",
|
311 |
-
"ó": "o",
|
312 |
-
"ô": "o",
|
313 |
-
"õ": "o",
|
314 |
-
"ö": "o",
|
315 |
-
"ø": "o",
|
316 |
-
"ù": "u",
|
317 |
-
"ú": "u",
|
318 |
-
"û": "u",
|
319 |
-
"ü": "u",
|
320 |
-
"ý": "y",
|
321 |
-
"ÿ": "y",
|
322 |
-
"Ā": "A",
|
323 |
-
"ā": "a",
|
324 |
-
"Ă": "A",
|
325 |
-
"ă": "a",
|
326 |
-
"Ą": "A",
|
327 |
-
"ą": "a",
|
328 |
-
"Ć": "C",
|
329 |
-
"ć": "c",
|
330 |
-
"Ĉ": "C",
|
331 |
-
"ĉ": "c",
|
332 |
-
"Ċ": "C",
|
333 |
-
"ċ": "c",
|
334 |
-
"Č": "C",
|
335 |
-
"č": "c",
|
336 |
-
"Ď": "D",
|
337 |
-
"ď": "d",
|
338 |
-
"Đ": "D",
|
339 |
-
"đ": "d",
|
340 |
-
"Ē": "E",
|
341 |
-
"ē": "e",
|
342 |
-
"Ĕ": "E",
|
343 |
-
"ĕ": "e",
|
344 |
-
"Ė": "E",
|
345 |
-
"ė": "e",
|
346 |
-
"Ę": "E",
|
347 |
-
"ę": "e",
|
348 |
-
"Ě": "E",
|
349 |
-
"ě": "e",
|
350 |
-
"Ĝ": "G",
|
351 |
-
"ĝ": "g",
|
352 |
-
"Ğ": "G",
|
353 |
-
"ğ": "g",
|
354 |
-
"Ġ": "G",
|
355 |
-
"ġ": "g",
|
356 |
-
"Ģ": "G",
|
357 |
-
"ģ": "g",
|
358 |
-
"Ĥ": "H",
|
359 |
-
"ĥ": "h",
|
360 |
-
"Ħ": "H",
|
361 |
-
"ħ": "h",
|
362 |
-
"Ĩ": "I",
|
363 |
-
"ĩ": "i",
|
364 |
-
"Ī": "I",
|
365 |
-
"ī": "i",
|
366 |
-
"Ĭ": "I",
|
367 |
-
"ĭ": "i",
|
368 |
-
"Į": "I",
|
369 |
-
"į": "i",
|
370 |
-
"İ": "I",
|
371 |
-
"ı": "i",
|
372 |
-
"IJ": "IJ",
|
373 |
-
"ij": "ij",
|
374 |
-
"Ĵ": "J",
|
375 |
-
"ĵ": "j",
|
376 |
-
"Ķ": "K",
|
377 |
-
"ķ": "k",
|
378 |
-
"Ĺ": "L",
|
379 |
-
"ĺ": "l",
|
380 |
-
"Ļ": "L",
|
381 |
-
"ļ": "l",
|
382 |
-
"Ľ": "L",
|
383 |
-
"ľ": "l",
|
384 |
-
"Ŀ": "L",
|
385 |
-
"ŀ": "l",
|
386 |
-
"Ł": "l",
|
387 |
-
"ł": "l",
|
388 |
-
"Ń": "N",
|
389 |
-
"ń": "n",
|
390 |
-
"Ņ": "N",
|
391 |
-
"ņ": "n",
|
392 |
-
"Ň": "N",
|
393 |
-
"ň": "n",
|
394 |
-
"ʼn": "n",
|
395 |
-
"Ō": "O",
|
396 |
-
"ō": "o",
|
397 |
-
"Ŏ": "O",
|
398 |
-
"ŏ": "o",
|
399 |
-
"Ő": "O",
|
400 |
-
"ő": "o",
|
401 |
-
"Œ": "OE",
|
402 |
-
"œ": "oe",
|
403 |
-
"Ŕ": "R",
|
404 |
-
"ŕ": "r",
|
405 |
-
"Ŗ": "R",
|
406 |
-
"ŗ": "r",
|
407 |
-
"Ř": "R",
|
408 |
-
"ř": "r",
|
409 |
-
"Ś": "S",
|
410 |
-
"ś": "s",
|
411 |
-
"Ŝ": "S",
|
412 |
-
"ŝ": "s",
|
413 |
-
"Ş": "S",
|
414 |
-
"ş": "s",
|
415 |
-
"Š": "S",
|
416 |
-
"š": "s",
|
417 |
-
"Ţ": "T",
|
418 |
-
"ţ": "t",
|
419 |
-
"Ť": "T",
|
420 |
-
"ť": "t",
|
421 |
-
"Ŧ": "T",
|
422 |
-
"ŧ": "t",
|
423 |
-
"Ũ": "U",
|
424 |
-
"ũ": "u",
|
425 |
-
"Ū": "U",
|
426 |
-
"ū": "u",
|
427 |
-
"Ŭ": "U",
|
428 |
-
"ŭ": "u",
|
429 |
-
"Ů": "U",
|
430 |
-
"ů": "u",
|
431 |
-
"Ű": "U",
|
432 |
-
"ű": "u",
|
433 |
-
"Ų": "U",
|
434 |
-
"ų": "u",
|
435 |
-
"Ŵ": "W",
|
436 |
-
"ŵ": "w",
|
437 |
-
"Ŷ": "Y",
|
438 |
-
"ŷ": "y",
|
439 |
-
"Ÿ": "Y",
|
440 |
-
"Ź": "Z",
|
441 |
-
"ź": "z",
|
442 |
-
"Ż": "Z",
|
443 |
-
"ż": "z",
|
444 |
-
"Ž": "Z",
|
445 |
-
"ž": "z",
|
446 |
-
"ſ": "s",
|
447 |
-
"ƒ": "f",
|
448 |
-
"Ơ": "O",
|
449 |
-
"ơ": "o",
|
450 |
-
"Ư": "U",
|
451 |
-
"ư": "u",
|
452 |
-
"Ǎ": "A",
|
453 |
-
"ǎ": "a",
|
454 |
-
"Ǐ": "I",
|
455 |
-
"ǐ": "i",
|
456 |
-
"Ǒ": "O",
|
457 |
-
"ǒ": "o",
|
458 |
-
"Ǔ": "U",
|
459 |
-
"ǔ": "u",
|
460 |
-
"Ǖ": "U",
|
461 |
-
"ǖ": "u",
|
462 |
-
"Ǘ": "U",
|
463 |
-
"ǘ": "u",
|
464 |
-
"Ǚ": "U",
|
465 |
-
"ǚ": "u",
|
466 |
-
"Ǜ": "U",
|
467 |
-
"ǜ": "u",
|
468 |
-
"Ǻ": "A",
|
469 |
-
"ǻ": "a",
|
470 |
-
"Ǽ": "AE",
|
471 |
-
"ǽ": "ae",
|
472 |
-
"Ǿ": "O",
|
473 |
-
"ǿ": "o",
|
474 |
-
|
475 |
-
// extra
|
476 |
-
' ': '_',
|
477 |
-
"'": '',
|
478 |
-
'?': '',
|
479 |
-
'/': '',
|
480 |
-
'\\': '',
|
481 |
-
'.': '',
|
482 |
-
',': '',
|
483 |
-
'`': '',
|
484 |
-
'>': '',
|
485 |
-
'<': '',
|
486 |
-
'"': '',
|
487 |
-
'[': '',
|
488 |
-
']': '',
|
489 |
-
'|': '',
|
490 |
-
'{': '',
|
491 |
-
'}': '',
|
492 |
-
'(': '',
|
493 |
-
')': ''
|
494 |
-
};
|
495 |
-
|
496 |
-
// vars
|
497 |
-
var nonWord = /\W/g;
|
498 |
-
var mapping = function (c) {
|
499 |
-
return (map[c] !== undefined) ? map[c] : c;
|
500 |
-
};
|
501 |
-
|
502 |
-
// replace
|
503 |
-
str = str.replace(nonWord, mapping);
|
504 |
-
|
505 |
-
// lowercase
|
506 |
-
str = str.toLowerCase();
|
507 |
-
|
508 |
-
// return
|
509 |
-
return str;
|
510 |
-
};
|
511 |
-
|
512 |
-
/**
|
513 |
-
* acf.strMatch
|
514 |
-
*
|
515 |
-
* Returns the number of characters that match between two strings
|
516 |
-
*
|
517 |
-
* @date 1/2/18
|
518 |
-
* @since 5.6.5
|
519 |
-
*
|
520 |
-
* @param type $var Description. Default.
|
521 |
-
* @return type Description.
|
522 |
-
*/
|
523 |
-
|
524 |
-
acf.strMatch = function( s1, s2 ){
|
525 |
-
|
526 |
-
// vars
|
527 |
-
var val = 0;
|
528 |
-
var min = Math.min( s1.length, s2.length );
|
529 |
-
|
530 |
-
// loop
|
531 |
-
for( var i = 0; i < min; i++ ) {
|
532 |
-
if( s1[i] !== s2[i] ) {
|
533 |
-
break;
|
534 |
-
}
|
535 |
-
val++;
|
536 |
-
}
|
537 |
-
|
538 |
-
// return
|
539 |
-
return val;
|
540 |
-
};
|
541 |
-
|
542 |
-
/**
|
543 |
-
* acf.decode
|
544 |
-
*
|
545 |
-
* description
|
546 |
-
*
|
547 |
-
* @date 13/1/18
|
548 |
-
* @since 5.6.5
|
549 |
-
*
|
550 |
-
* @param type $var Description. Default.
|
551 |
-
* @return type Description.
|
552 |
-
*/
|
553 |
-
|
554 |
-
acf.decode = function( string ){
|
555 |
-
return $('<textarea/>').html( string ).text();
|
556 |
-
};
|
557 |
-
|
558 |
-
/**
|
559 |
-
* acf.strEscape
|
560 |
-
*
|
561 |
-
* description
|
562 |
-
*
|
563 |
-
* @date 3/2/18
|
564 |
-
* @since 5.6.5
|
565 |
-
*
|
566 |
-
* @param type $var Description. Default.
|
567 |
-
* @return type Description.
|
568 |
-
*/
|
569 |
-
|
570 |
-
acf.strEscape = function( string ){
|
571 |
-
|
572 |
-
var entityMap = {
|
573 |
-
'&': '&',
|
574 |
-
'<': '<',
|
575 |
-
'>': '>',
|
576 |
-
'"': '"',
|
577 |
-
"'": ''',
|
578 |
-
'/': '/',
|
579 |
-
'`': '`',
|
580 |
-
'=': '='
|
581 |
-
};
|
582 |
-
|
583 |
-
return String(string).replace(/[&<>"'`=\/]/g, function (s) {
|
584 |
-
return entityMap[s];
|
585 |
-
});
|
586 |
-
};
|
587 |
-
|
588 |
-
/**
|
589 |
-
* parseArgs
|
590 |
-
*
|
591 |
-
* Merges together defaults and args much like the WP wp_parse_args function
|
592 |
-
*
|
593 |
-
* @date 14/12/17
|
594 |
-
* @since 5.6.5
|
595 |
-
*
|
596 |
-
* @param object args
|
597 |
-
* @param object defaults
|
598 |
-
* @return object
|
599 |
-
*/
|
600 |
-
|
601 |
-
acf.parseArgs = function( args, defaults ){
|
602 |
-
if( typeof args !== 'object' ) args = {};
|
603 |
-
if( typeof defaults !== 'object' ) defaults = {};
|
604 |
-
return $.extend({}, defaults, args);
|
605 |
-
}
|
606 |
-
|
607 |
-
/**
|
608 |
-
* __
|
609 |
-
*
|
610 |
-
* Retrieve the translation of $text.
|
611 |
-
*
|
612 |
-
* @date 16/4/18
|
613 |
-
* @since 5.6.9
|
614 |
-
*
|
615 |
-
* @param string text Text to translate.
|
616 |
-
* @return string Translated text.
|
617 |
-
*/
|
618 |
-
|
619 |
-
if( window.acfL10n == undefined ) {
|
620 |
-
acfL10n = {};
|
621 |
-
}
|
622 |
-
|
623 |
-
acf.__ = function( text ){
|
624 |
-
return acfL10n[ text ] || text;
|
625 |
-
};
|
626 |
-
|
627 |
-
/**
|
628 |
-
* _x
|
629 |
-
*
|
630 |
-
* Retrieve translated string with gettext context.
|
631 |
-
*
|
632 |
-
* @date 16/4/18
|
633 |
-
* @since 5.6.9
|
634 |
-
*
|
635 |
-
* @param string text Text to translate.
|
636 |
-
* @param string context Context information for the translators.
|
637 |
-
* @return string Translated text.
|
638 |
-
*/
|
639 |
-
|
640 |
-
acf._x = function( text, context ){
|
641 |
-
return acfL10n[ text + '.' + context ] || acfL10n[ text ] || text;
|
642 |
-
};
|
643 |
-
|
644 |
-
/**
|
645 |
-
* _n
|
646 |
-
*
|
647 |
-
* Retrieve the plural or single form based on the amount.
|
648 |
-
*
|
649 |
-
* @date 16/4/18
|
650 |
-
* @since 5.6.9
|
651 |
-
*
|
652 |
-
* @param string single Single text to translate.
|
653 |
-
* @param string plural Plural text to translate.
|
654 |
-
* @param int number The number to compare against.
|
655 |
-
* @return string Translated text.
|
656 |
-
*/
|
657 |
-
|
658 |
-
acf._n = function( single, plural, number ){
|
659 |
-
if( number == 1 ) {
|
660 |
-
return acf.__(single);
|
661 |
-
} else {
|
662 |
-
return acf.__(plural);
|
663 |
-
}
|
664 |
-
};
|
665 |
-
|
666 |
-
acf.isArray = function( a ){
|
667 |
-
return Array.isArray(a);
|
668 |
-
};
|
669 |
-
|
670 |
-
acf.isObject = function( a ){
|
671 |
-
return ( typeof a === 'object' );
|
672 |
-
}
|
673 |
-
|
674 |
-
/**
|
675 |
-
* serialize
|
676 |
-
*
|
677 |
-
* description
|
678 |
-
*
|
679 |
-
* @date 24/12/17
|
680 |
-
* @since 5.6.5
|
681 |
-
*
|
682 |
-
* @param type $var Description. Default.
|
683 |
-
* @return type Description.
|
684 |
-
*/
|
685 |
-
|
686 |
-
var buildObject = function( obj, name, value ){
|
687 |
-
|
688 |
-
// replace [] with placeholder
|
689 |
-
name = name.replace('[]', '[%%index%%]');
|
690 |
-
|
691 |
-
// vars
|
692 |
-
var keys = name.match(/([^\[\]])+/g);
|
693 |
-
if( !keys ) return;
|
694 |
-
var length = keys.length;
|
695 |
-
var ref = obj;
|
696 |
-
|
697 |
-
// loop
|
698 |
-
for( var i = 0; i < length; i++ ) {
|
699 |
-
|
700 |
-
// vars
|
701 |
-
var key = String( keys[i] );
|
702 |
-
|
703 |
-
// value
|
704 |
-
if( i == length - 1 ) {
|
705 |
-
|
706 |
-
// %%index%%
|
707 |
-
if( key === '%%index%%' ) {
|
708 |
-
ref.push( value );
|
709 |
-
|
710 |
-
// default
|
711 |
-
} else {
|
712 |
-
ref[ key ] = value;
|
713 |
-
}
|
714 |
-
|
715 |
-
// path
|
716 |
-
} else {
|
717 |
-
|
718 |
-
// array
|
719 |
-
if( keys[i+1] === '%%index%%' ) {
|
720 |
-
if( !acf.isArray(ref[ key ]) ) {
|
721 |
-
ref[ key ] = [];
|
722 |
-
}
|
723 |
-
|
724 |
-
// object
|
725 |
-
} else {
|
726 |
-
if( !acf.isObject(ref[ key ]) ) {
|
727 |
-
ref[ key ] = {};
|
728 |
-
}
|
729 |
-
}
|
730 |
-
|
731 |
-
// crawl
|
732 |
-
ref = ref[ key ];
|
733 |
-
}
|
734 |
-
}
|
735 |
-
};
|
736 |
-
|
737 |
-
acf.serialize = function( $el, prefix ){
|
738 |
-
|
739 |
-
// vars
|
740 |
-
var obj = {};
|
741 |
-
var inputs = acf.serializeArray( $el );
|
742 |
-
|
743 |
-
// prefix
|
744 |
-
if( prefix !== undefined ) {
|
745 |
-
|
746 |
-
// filter and modify
|
747 |
-
inputs = inputs.filter(function( item ){
|
748 |
-
return item.name.indexOf(prefix) === 0;
|
749 |
-
}).map(function( item ){
|
750 |
-
item.name = item.name.slice(prefix.length);
|
751 |
-
return item;
|
752 |
-
});
|
753 |
-
}
|
754 |
-
|
755 |
-
// loop
|
756 |
-
for( var i = 0; i < inputs.length; i++ ) {
|
757 |
-
buildObject( obj, inputs[i].name, inputs[i].value );
|
758 |
-
}
|
759 |
-
|
760 |
-
// return
|
761 |
-
return obj;
|
762 |
-
};
|
763 |
-
|
764 |
-
/**
|
765 |
-
* acf.serializeArray
|
766 |
-
*
|
767 |
-
* Similar to $.serializeArray() but works with a parent wrapping element.
|
768 |
-
*
|
769 |
-
* @date 19/8/18
|
770 |
-
* @since 5.7.3
|
771 |
-
*
|
772 |
-
* @param jQuery $el The element or form to serialize.
|
773 |
-
* @return array
|
774 |
-
*/
|
775 |
-
|
776 |
-
acf.serializeArray = function( $el ){
|
777 |
-
return $el.find('select, textarea, input').serializeArray();
|
778 |
-
}
|
779 |
-
|
780 |
-
/**
|
781 |
-
* acf.serializeForAjax
|
782 |
-
*
|
783 |
-
* Returns an object containing name => value data ready to be encoded for Ajax.
|
784 |
-
*
|
785 |
-
* @date 17/12/18
|
786 |
-
* @since 5.8.0
|
787 |
-
*
|
788 |
-
* @param jQUery $el The element or form to serialize.
|
789 |
-
* @return object
|
790 |
-
*/
|
791 |
-
acf.serializeForAjax = function( $el ){
|
792 |
-
|
793 |
-
// vars
|
794 |
-
var data = {};
|
795 |
-
var index = {};
|
796 |
-
|
797 |
-
// Serialize inputs.
|
798 |
-
var inputs = acf.serializeArray( $el );
|
799 |
-
|
800 |
-
// Loop over inputs and build data.
|
801 |
-
inputs.map(function( item ){
|
802 |
-
|
803 |
-
// Append to array.
|
804 |
-
if( item.name.slice(-2) === '[]' ) {
|
805 |
-
data[ item.name ] = data[ item.name ] || [];
|
806 |
-
data[ item.name ].push( item.value );
|
807 |
-
// Append
|
808 |
-
} else {
|
809 |
-
data[ item.name ] = item.value;
|
810 |
-
}
|
811 |
-
});
|
812 |
-
|
813 |
-
// return
|
814 |
-
return data;
|
815 |
-
};
|
816 |
-
|
817 |
-
/**
|
818 |
-
* addAction
|
819 |
-
*
|
820 |
-
* Wrapper for acf.hooks.addAction
|
821 |
-
*
|
822 |
-
* @date 14/12/17
|
823 |
-
* @since 5.6.5
|
824 |
-
*
|
825 |
-
* @param n/a
|
826 |
-
* @return this
|
827 |
-
*/
|
828 |
-
|
829 |
-
/*
|
830 |
-
var prefixAction = function( action ){
|
831 |
-
return 'acf_' + action;
|
832 |
-
}
|
833 |
-
*/
|
834 |
-
|
835 |
-
acf.addAction = function( action, callback, priority, context ){
|
836 |
-
//action = prefixAction(action);
|
837 |
-
acf.hooks.addAction.apply(this, arguments);
|
838 |
-
return this;
|
839 |
-
};
|
840 |
-
|
841 |
-
|
842 |
-
/**
|
843 |
-
* removeAction
|
844 |
-
*
|
845 |
-
* Wrapper for acf.hooks.removeAction
|
846 |
-
*
|
847 |
-
* @date 14/12/17
|
848 |
-
* @since 5.6.5
|
849 |
-
*
|
850 |
-
* @param n/a
|
851 |
-
* @return this
|
852 |
-
*/
|
853 |
-
|
854 |
-
acf.removeAction = function( action, callback ){
|
855 |
-
//action = prefixAction(action);
|
856 |
-
acf.hooks.removeAction.apply(this, arguments);
|
857 |
-
return this;
|
858 |
-
};
|
859 |
-
|
860 |
-
|
861 |
-
/**
|
862 |
-
* doAction
|
863 |
-
*
|
864 |
-
* Wrapper for acf.hooks.doAction
|
865 |
-
*
|
866 |
-
* @date 14/12/17
|
867 |
-
* @since 5.6.5
|
868 |
-
*
|
869 |
-
* @param n/a
|
870 |
-
* @return this
|
871 |
-
*/
|
872 |
-
|
873 |
-
var actionHistory = {};
|
874 |
-
//var currentAction = false;
|
875 |
-
acf.doAction = function( action ){
|
876 |
-
//action = prefixAction(action);
|
877 |
-
//currentAction = action;
|
878 |
-
actionHistory[ action ] = 1;
|
879 |
-
acf.hooks.doAction.apply(this, arguments);
|
880 |
-
actionHistory[ action ] = 0;
|
881 |
-
return this;
|
882 |
-
};
|
883 |
-
|
884 |
-
|
885 |
-
/**
|
886 |
-
* doingAction
|
887 |
-
*
|
888 |
-
* Return true if doing action
|
889 |
-
*
|
890 |
-
* @date 14/12/17
|
891 |
-
* @since 5.6.5
|
892 |
-
*
|
893 |
-
* @param n/a
|
894 |
-
* @return this
|
895 |
-
*/
|
896 |
-
|
897 |
-
acf.doingAction = function( action ){
|
898 |
-
//action = prefixAction(action);
|
899 |
-
return (actionHistory[ action ] === 1);
|
900 |
-
};
|
901 |
-
|
902 |
-
|
903 |
-
/**
|
904 |
-
* didAction
|
905 |
-
*
|
906 |
-
* Wrapper for acf.hooks.doAction
|
907 |
-
*
|
908 |
-
* @date 14/12/17
|
909 |
-
* @since 5.6.5
|
910 |
-
*
|
911 |
-
* @param n/a
|
912 |
-
* @return this
|
913 |
-
*/
|
914 |
-
|
915 |
-
acf.didAction = function( action ){
|
916 |
-
//action = prefixAction(action);
|
917 |
-
return (actionHistory[ action ] !== undefined);
|
918 |
-
};
|
919 |
-
|
920 |
-
/**
|
921 |
-
* currentAction
|
922 |
-
*
|
923 |
-
* Wrapper for acf.hooks.doAction
|
924 |
-
*
|
925 |
-
* @date 14/12/17
|
926 |
-
* @since 5.6.5
|
927 |
-
*
|
928 |
-
* @param n/a
|
929 |
-
* @return this
|
930 |
-
*/
|
931 |
-
|
932 |
-
acf.currentAction = function(){
|
933 |
-
for( var k in actionHistory ) {
|
934 |
-
if( actionHistory[k] ) {
|
935 |
-
return k;
|
936 |
-
}
|
937 |
-
}
|
938 |
-
return false;
|
939 |
-
};
|
940 |
-
|
941 |
-
/**
|
942 |
-
* addFilter
|
943 |
-
*
|
944 |
-
* Wrapper for acf.hooks.addFilter
|
945 |
-
*
|
946 |
-
* @date 14/12/17
|
947 |
-
* @since 5.6.5
|
948 |
-
*
|
949 |
-
* @param n/a
|
950 |
-
* @return this
|
951 |
-
*/
|
952 |
-
|
953 |
-
acf.addFilter = function( action ){
|
954 |
-
//action = prefixAction(action);
|
955 |
-
acf.hooks.addFilter.apply(this, arguments);
|
956 |
-
return this;
|
957 |
-
};
|
958 |
-
|
959 |
-
|
960 |
-
/**
|
961 |
-
* removeFilter
|
962 |
-
*
|
963 |
-
* Wrapper for acf.hooks.removeFilter
|
964 |
-
*
|
965 |
-
* @date 14/12/17
|
966 |
-
* @since 5.6.5
|
967 |
-
*
|
968 |
-
* @param n/a
|
969 |
-
* @return this
|
970 |
-
*/
|
971 |
-
|
972 |
-
acf.removeFilter = function( action ){
|
973 |
-
//action = prefixAction(action);
|
974 |
-
acf.hooks.removeFilter.apply(this, arguments);
|
975 |
-
return this;
|
976 |
-
};
|
977 |
-
|
978 |
-
|
979 |
-
/**
|
980 |
-
* applyFilters
|
981 |
-
*
|
982 |
-
* Wrapper for acf.hooks.applyFilters
|
983 |
-
*
|
984 |
-
* @date 14/12/17
|
985 |
-
* @since 5.6.5
|
986 |
-
*
|
987 |
-
* @param n/a
|
988 |
-
* @return this
|
989 |
-
*/
|
990 |
-
|
991 |
-
acf.applyFilters = function( action ){
|
992 |
-
//action = prefixAction(action);
|
993 |
-
return acf.hooks.applyFilters.apply(this, arguments);
|
994 |
-
};
|
995 |
-
|
996 |
-
|
997 |
-
/**
|
998 |
-
* getArgs
|
999 |
-
*
|
1000 |
-
* description
|
1001 |
-
*
|
1002 |
-
* @date 15/12/17
|
1003 |
-
* @since 5.6.5
|
1004 |
-
*
|
1005 |
-
* @param type $var Description. Default.
|
1006 |
-
* @return type Description.
|
1007 |
-
*/
|
1008 |
-
|
1009 |
-
acf.arrayArgs = function( args ){
|
1010 |
-
return Array.prototype.slice.call( args );
|
1011 |
-
};
|
1012 |
-
|
1013 |
-
|
1014 |
-
/**
|
1015 |
-
* extendArgs
|
1016 |
-
*
|
1017 |
-
* description
|
1018 |
-
*
|
1019 |
-
* @date 15/12/17
|
1020 |
-
* @since 5.6.5
|
1021 |
-
*
|
1022 |
-
* @param type $var Description. Default.
|
1023 |
-
* @return type Description.
|
1024 |
-
*/
|
1025 |
-
|
1026 |
-
/*
|
1027 |
-
acf.extendArgs = function( ){
|
1028 |
-
var args = Array.prototype.slice.call( arguments );
|
1029 |
-
var realArgs = args.shift();
|
1030 |
-
|
1031 |
-
Array.prototype.push.call(arguments, 'bar')
|
1032 |
-
return Array.prototype.push.apply( args, arguments );
|
1033 |
-
};
|
1034 |
-
*/
|
1035 |
-
|
1036 |
-
// Preferences
|
1037 |
-
// - use try/catch to avoid JS error if cookies are disabled on front-end form
|
1038 |
-
try {
|
1039 |
-
var preferences = JSON.parse(localStorage.getItem('acf')) || {};
|
1040 |
-
} catch(e) {
|
1041 |
-
var preferences = {};
|
1042 |
-
}
|
1043 |
-
|
1044 |
-
|
1045 |
-
/**
|
1046 |
-
* getPreferenceName
|
1047 |
-
*
|
1048 |
-
* Gets the true preference name.
|
1049 |
-
* Converts "this.thing" to "thing-123" if editing post 123.
|
1050 |
-
*
|
1051 |
-
* @date 11/11/17
|
1052 |
-
* @since 5.6.5
|
1053 |
-
*
|
1054 |
-
* @param string name
|
1055 |
-
* @return string
|
1056 |
-
*/
|
1057 |
-
|
1058 |
-
var getPreferenceName = function( name ){
|
1059 |
-
if( name.substr(0, 5) === 'this.' ) {
|
1060 |
-
name = name.substr(5) + '-' + acf.get('post_id');
|
1061 |
-
}
|
1062 |
-
return name;
|
1063 |
-
};
|
1064 |
-
|
1065 |
-
|
1066 |
-
/**
|
1067 |
-
* acf.getPreference
|
1068 |
-
*
|
1069 |
-
* Gets a preference setting or null if not set.
|
1070 |
-
*
|
1071 |
-
* @date 11/11/17
|
1072 |
-
* @since 5.6.5
|
1073 |
-
*
|
1074 |
-
* @param string name
|
1075 |
-
* @return mixed
|
1076 |
-
*/
|
1077 |
-
|
1078 |
-
acf.getPreference = function( name ){
|
1079 |
-
name = getPreferenceName( name );
|
1080 |
-
return preferences[ name ] || null;
|
1081 |
-
}
|
1082 |
-
|
1083 |
-
|
1084 |
-
/**
|
1085 |
-
* acf.setPreference
|
1086 |
-
*
|
1087 |
-
* Sets a preference setting.
|
1088 |
-
*
|
1089 |
-
* @date 11/11/17
|
1090 |
-
* @since 5.6.5
|
1091 |
-
*
|
1092 |
-
* @param string name
|
1093 |
-
* @param mixed value
|
1094 |
-
* @return n/a
|
1095 |
-
*/
|
1096 |
-
|
1097 |
-
acf.setPreference = function( name, value ){
|
1098 |
-
name = getPreferenceName( name );
|
1099 |
-
if( value === null ) {
|
1100 |
-
delete preferences[ name ];
|
1101 |
-
} else {
|
1102 |
-
preferences[ name ] = value;
|
1103 |
-
}
|
1104 |
-
localStorage.setItem('acf', JSON.stringify(preferences));
|
1105 |
-
}
|
1106 |
-
|
1107 |
-
|
1108 |
-
/**
|
1109 |
-
* acf.removePreference
|
1110 |
-
*
|
1111 |
-
* Removes a preference setting.
|
1112 |
-
*
|
1113 |
-
* @date 11/11/17
|
1114 |
-
* @since 5.6.5
|
1115 |
-
*
|
1116 |
-
* @param string name
|
1117 |
-
* @return n/a
|
1118 |
-
*/
|
1119 |
-
|
1120 |
-
acf.removePreference = function( name ){
|
1121 |
-
acf.setPreference(name, null);
|
1122 |
-
};
|
1123 |
-
|
1124 |
-
|
1125 |
-
/**
|
1126 |
-
* remove
|
1127 |
-
*
|
1128 |
-
* Removes an element with fade effect
|
1129 |
-
*
|
1130 |
-
* @date 1/1/18
|
1131 |
-
* @since 5.6.5
|
1132 |
-
*
|
1133 |
-
* @param type $var Description. Default.
|
1134 |
-
* @return type Description.
|
1135 |
-
*/
|
1136 |
-
|
1137 |
-
acf.remove = function( props ){
|
1138 |
-
|
1139 |
-
// allow jQuery
|
1140 |
-
if( props instanceof jQuery ) {
|
1141 |
-
props = {
|
1142 |
-
target: props
|
1143 |
-
};
|
1144 |
-
}
|
1145 |
-
|
1146 |
-
// defaults
|
1147 |
-
props = acf.parseArgs(props, {
|
1148 |
-
target: false,
|
1149 |
-
endHeight: 0,
|
1150 |
-
complete: function(){}
|
1151 |
-
});
|
1152 |
-
|
1153 |
-
// action
|
1154 |
-
acf.doAction('remove', props.target);
|
1155 |
-
|
1156 |
-
// tr
|
1157 |
-
if( props.target.is('tr') ) {
|
1158 |
-
removeTr( props );
|
1159 |
-
|
1160 |
-
// div
|
1161 |
-
} else {
|
1162 |
-
removeDiv( props );
|
1163 |
-
}
|
1164 |
-
|
1165 |
-
};
|
1166 |
-
|
1167 |
-
/**
|
1168 |
-
* removeDiv
|
1169 |
-
*
|
1170 |
-
* description
|
1171 |
-
*
|
1172 |
-
* @date 16/2/18
|
1173 |
-
* @since 5.6.9
|
1174 |
-
*
|
1175 |
-
* @param type $var Description. Default.
|
1176 |
-
* @return type Description.
|
1177 |
-
*/
|
1178 |
-
|
1179 |
-
var removeDiv = function( props ){
|
1180 |
-
|
1181 |
-
// vars
|
1182 |
-
var $el = props.target;
|
1183 |
-
var height = $el.height();
|
1184 |
-
var width = $el.width();
|
1185 |
-
var margin = $el.css('margin');
|
1186 |
-
var outerHeight = $el.outerHeight(true);
|
1187 |
-
var style = $el.attr('style') + ''; // needed to copy
|
1188 |
-
|
1189 |
-
// wrap
|
1190 |
-
$el.wrap('<div class="acf-temp-remove" style="height:' + outerHeight + 'px"></div>');
|
1191 |
-
var $wrap = $el.parent();
|
1192 |
-
|
1193 |
-
// set pos
|
1194 |
-
$el.css({
|
1195 |
-
height: height,
|
1196 |
-
width: width,
|
1197 |
-
margin: margin,
|
1198 |
-
position: 'absolute'
|
1199 |
-
});
|
1200 |
-
|
1201 |
-
// fade wrap
|
1202 |
-
setTimeout(function(){
|
1203 |
-
|
1204 |
-
$wrap.css({
|
1205 |
-
opacity: 0,
|
1206 |
-
height: props.endHeight
|
1207 |
-
});
|
1208 |
-
|
1209 |
-
}, 50);
|
1210 |
-
|
1211 |
-
// remove
|
1212 |
-
setTimeout(function(){
|
1213 |
-
|
1214 |
-
$el.attr('style', style);
|
1215 |
-
$wrap.remove();
|
1216 |
-
props.complete();
|
1217 |
-
|
1218 |
-
}, 301);
|
1219 |
-
};
|
1220 |
-
|
1221 |
-
/**
|
1222 |
-
* removeTr
|
1223 |
-
*
|
1224 |
-
* description
|
1225 |
-
*
|
1226 |
-
* @date 16/2/18
|
1227 |
-
* @since 5.6.9
|
1228 |
-
*
|
1229 |
-
* @param type $var Description. Default.
|
1230 |
-
* @return type Description.
|
1231 |
-
*/
|
1232 |
-
|
1233 |
-
var removeTr = function( props ){
|
1234 |
-
|
1235 |
-
// vars
|
1236 |
-
var $tr = props.target;
|
1237 |
-
var height = $tr.height();
|
1238 |
-
var children = $tr.children().length;
|
1239 |
-
|
1240 |
-
// create dummy td
|
1241 |
-
var $td = $('<td class="acf-temp-remove" style="padding:0; height:' + height + 'px" colspan="' + children + '"></td>');
|
1242 |
-
|
1243 |
-
// fade away tr
|
1244 |
-
$tr.addClass('acf-remove-element');
|
1245 |
-
|
1246 |
-
// update HTML after fade animation
|
1247 |
-
setTimeout(function(){
|
1248 |
-
$tr.html( $td );
|
1249 |
-
}, 251);
|
1250 |
-
|
1251 |
-
// allow .acf-temp-remove to exist before changing CSS
|
1252 |
-
setTimeout(function(){
|
1253 |
-
|
1254 |
-
// remove class
|
1255 |
-
$tr.removeClass('acf-remove-element');
|
1256 |
-
|
1257 |
-
// collapse
|
1258 |
-
$td.css({
|
1259 |
-
height: props.endHeight
|
1260 |
-
});
|
1261 |
-
|
1262 |
-
}, 300);
|
1263 |
-
|
1264 |
-
// remove
|
1265 |
-
setTimeout(function(){
|
1266 |
-
|
1267 |
-
$tr.remove();
|
1268 |
-
props.complete();
|
1269 |
-
|
1270 |
-
}, 451);
|
1271 |
-
};
|
1272 |
-
|
1273 |
-
/**
|
1274 |
-
* duplicate
|
1275 |
-
*
|
1276 |
-
* description
|
1277 |
-
*
|
1278 |
-
* @date 3/1/18
|
1279 |
-
* @since 5.6.5
|
1280 |
-
*
|
1281 |
-
* @param type $var Description. Default.
|
1282 |
-
* @return type Description.
|
1283 |
-
*/
|
1284 |
-
|
1285 |
-
acf.duplicate = function( args ){
|
1286 |
-
|
1287 |
-
// allow jQuery
|
1288 |
-
if( args instanceof jQuery ) {
|
1289 |
-
args = {
|
1290 |
-
target: args
|
1291 |
-
};
|
1292 |
-
}
|
1293 |
-
|
1294 |
-
// vars
|
1295 |
-
var timeout = 0;
|
1296 |
-
|
1297 |
-
// defaults
|
1298 |
-
args = acf.parseArgs(args, {
|
1299 |
-
target: false,
|
1300 |
-
search: '',
|
1301 |
-
replace: '',
|
1302 |
-
before: function( $el ){},
|
1303 |
-
after: function( $el, $el2 ){},
|
1304 |
-
append: function( $el, $el2 ){
|
1305 |
-
$el.after( $el2 );
|
1306 |
-
timeout = 1;
|
1307 |
-
}
|
1308 |
-
});
|
1309 |
-
|
1310 |
-
// compatibility
|
1311 |
-
args.target = args.target || args.$el;
|
1312 |
-
|
1313 |
-
// vars
|
1314 |
-
var $el = args.target;
|
1315 |
-
|
1316 |
-
// search
|
1317 |
-
args.search = args.search || $el.attr('data-id');
|
1318 |
-
args.replace = args.replace || acf.uniqid();
|
1319 |
-
|
1320 |
-
// before
|
1321 |
-
// - allow acf to modify DOM
|
1322 |
-
// - fixes bug where select field option is not selected
|
1323 |
-
args.before( $el );
|
1324 |
-
acf.doAction('before_duplicate', $el);
|
1325 |
-
|
1326 |
-
// clone
|
1327 |
-
var $el2 = $el.clone();
|
1328 |
-
|
1329 |
-
// rename
|
1330 |
-
acf.rename({
|
1331 |
-
target: $el2,
|
1332 |
-
search: args.search,
|
1333 |
-
replace: args.replace,
|
1334 |
-
});
|
1335 |
-
|
1336 |
-
// remove classes
|
1337 |
-
$el2.removeClass('acf-clone');
|
1338 |
-
$el2.find('.ui-sortable').removeClass('ui-sortable');
|
1339 |
-
|
1340 |
-
// after
|
1341 |
-
// - allow acf to modify DOM
|
1342 |
-
args.after( $el, $el2 );
|
1343 |
-
acf.doAction('after_duplicate', $el, $el2 );
|
1344 |
-
|
1345 |
-
// append
|
1346 |
-
args.append( $el, $el2 );
|
1347 |
-
|
1348 |
-
// append
|
1349 |
-
// - allow element to be moved into a visible position before fire action
|
1350 |
-
//var callback = function(){
|
1351 |
-
acf.doAction('append', $el2);
|
1352 |
-
//};
|
1353 |
-
//if( timeout ) {
|
1354 |
-
// setTimeout(callback, timeout);
|
1355 |
-
//} else {
|
1356 |
-
// callback();
|
1357 |
-
//}
|
1358 |
-
|
1359 |
-
// return
|
1360 |
-
return $el2;
|
1361 |
-
};
|
1362 |
-
|
1363 |
-
/**
|
1364 |
-
* rename
|
1365 |
-
*
|
1366 |
-
* description
|
1367 |
-
*
|
1368 |
-
* @date 7/1/18
|
1369 |
-
* @since 5.6.5
|
1370 |
-
*
|
1371 |
-
* @param type $var Description. Default.
|
1372 |
-
* @return type Description.
|
1373 |
-
*/
|
1374 |
-
|
1375 |
-
acf.rename = function( args ){
|
1376 |
-
|
1377 |
-
// allow jQuery
|
1378 |
-
if( args instanceof jQuery ) {
|
1379 |
-
args = {
|
1380 |
-
target: args
|
1381 |
-
};
|
1382 |
-
}
|
1383 |
-
|
1384 |
-
// defaults
|
1385 |
-
args = acf.parseArgs(args, {
|
1386 |
-
target: false,
|
1387 |
-
destructive: false,
|
1388 |
-
search: '',
|
1389 |
-
replace: '',
|
1390 |
-
});
|
1391 |
-
|
1392 |
-
// vars
|
1393 |
-
var $el = args.target;
|
1394 |
-
var search = args.search || $el.attr('data-id');
|
1395 |
-
var replace = args.replace || acf.uniqid('acf');
|
1396 |
-
var replaceAttr = function(i, value){
|
1397 |
-
return value.replace( search, replace );
|
1398 |
-
}
|
1399 |
-
|
1400 |
-
// replace (destructive)
|
1401 |
-
if( args.destructive ) {
|
1402 |
-
var html = $el.outerHTML();
|
1403 |
-
html = acf.strReplace( search, replace, html );
|
1404 |
-
$el.replaceWith( html );
|
1405 |
-
|
1406 |
-
// replace
|
1407 |
-
} else {
|
1408 |
-
$el.attr('data-id', replace);
|
1409 |
-
$el.find('[id*="' + search + '"]').attr('id', replaceAttr);
|
1410 |
-
$el.find('[for*="' + search + '"]').attr('for', replaceAttr);
|
1411 |
-
$el.find('[name*="' + search + '"]').attr('name', replaceAttr);
|
1412 |
-
}
|
1413 |
-
|
1414 |
-
// return
|
1415 |
-
return $el;
|
1416 |
-
};
|
1417 |
-
|
1418 |
-
|
1419 |
-
/**
|
1420 |
-
* acf.prepareForAjax
|
1421 |
-
*
|
1422 |
-
* description
|
1423 |
-
*
|
1424 |
-
* @date 4/1/18
|
1425 |
-
* @since 5.6.5
|
1426 |
-
*
|
1427 |
-
* @param type $var Description. Default.
|
1428 |
-
* @return type Description.
|
1429 |
-
*/
|
1430 |
-
|
1431 |
-
acf.prepareForAjax = function( data ){
|
1432 |
-
|
1433 |
-
// required
|
1434 |
-
data.nonce = acf.get('nonce');
|
1435 |
-
data.post_id = acf.get('post_id');
|
1436 |
-
|
1437 |
-
// language
|
1438 |
-
if( acf.has('language') ) {
|
1439 |
-
data.lang = acf.get('language');
|
1440 |
-
}
|
1441 |
-
|
1442 |
-
// filter for 3rd party customization
|
1443 |
-
data = acf.applyFilters('prepare_for_ajax', data);
|
1444 |
-
|
1445 |
-
// return
|
1446 |
-
return data;
|
1447 |
-
};
|
1448 |
-
|
1449 |
-
|
1450 |
-
/**
|
1451 |
-
* acf.startButtonLoading
|
1452 |
-
*
|
1453 |
-
* description
|
1454 |
-
*
|
1455 |
-
* @date 5/1/18
|
1456 |
-
* @since 5.6.5
|
1457 |
-
*
|
1458 |
-
* @param type $var Description. Default.
|
1459 |
-
* @return type Description.
|
1460 |
-
*/
|
1461 |
-
|
1462 |
-
acf.startButtonLoading = function( $el ){
|
1463 |
-
$el.prop('disabled', true);
|
1464 |
-
$el.after(' <i class="acf-loading"></i>');
|
1465 |
-
}
|
1466 |
-
|
1467 |
-
acf.stopButtonLoading = function( $el ){
|
1468 |
-
$el.prop('disabled', false);
|
1469 |
-
$el.next('.acf-loading').remove();
|
1470 |
-
}
|
1471 |
-
|
1472 |
-
|
1473 |
-
/**
|
1474 |
-
* acf.showLoading
|
1475 |
-
*
|
1476 |
-
* description
|
1477 |
-
*
|
1478 |
-
* @date 12/1/18
|
1479 |
-
* @since 5.6.5
|
1480 |
-
*
|
1481 |
-
* @param type $var Description. Default.
|
1482 |
-
* @return type Description.
|
1483 |
-
*/
|
1484 |
-
|
1485 |
-
acf.showLoading = function( $el ){
|
1486 |
-
$el.append('<div class="acf-loading-overlay"><i class="acf-loading"></i></div>');
|
1487 |
-
};
|
1488 |
-
|
1489 |
-
acf.hideLoading = function( $el ){
|
1490 |
-
$el.children('.acf-loading-overlay').remove();
|
1491 |
-
};
|
1492 |
-
|
1493 |
-
|
1494 |
-
/**
|
1495 |
-
* acf.updateUserSetting
|
1496 |
-
*
|
1497 |
-
* description
|
1498 |
-
*
|
1499 |
-
* @date 5/1/18
|
1500 |
-
* @since 5.6.5
|
1501 |
-
*
|
1502 |
-
* @param type $var Description. Default.
|
1503 |
-
* @return type Description.
|
1504 |
-
*/
|
1505 |
-
|
1506 |
-
acf.updateUserSetting = function( name, value ){
|
1507 |
-
|
1508 |
-
var ajaxData = {
|
1509 |
-
action: 'acf/ajax/user_setting',
|
1510 |
-
name: name,
|
1511 |
-
value: value
|
1512 |
-
};
|
1513 |
-
|
1514 |
-
$.ajax({
|
1515 |
-
url: acf.get('ajaxurl'),
|
1516 |
-
data: acf.prepareForAjax(ajaxData),
|
1517 |
-
type: 'post',
|
1518 |
-
dataType: 'html'
|
1519 |
-
});
|
1520 |
-
|
1521 |
-
};
|
1522 |
-
|
1523 |
-
|
1524 |
-
/**
|
1525 |
-
* acf.val
|
1526 |
-
*
|
1527 |
-
* description
|
1528 |
-
*
|
1529 |
-
* @date 8/1/18
|
1530 |
-
* @since 5.6.5
|
1531 |
-
*
|
1532 |
-
* @param type $var Description. Default.
|
1533 |
-
* @return type Description.
|
1534 |
-
*/
|
1535 |
-
|
1536 |
-
acf.val = function( $input, value, silent ){
|
1537 |
-
|
1538 |
-
// vars
|
1539 |
-
var prevValue = $input.val();
|
1540 |
-
|
1541 |
-
// bail if no change
|
1542 |
-
if( value === prevValue ) {
|
1543 |
-
return false
|
1544 |
-
}
|
1545 |
-
|
1546 |
-
// update value
|
1547 |
-
$input.val( value );
|
1548 |
-
|
1549 |
-
// prevent select elements displaying blank value if option doesn't exist
|
1550 |
-
if( $input.is('select') && $input.val() === null ) {
|
1551 |
-
$input.val( prevValue );
|
1552 |
-
return false;
|
1553 |
-
}
|
1554 |
-
|
1555 |
-
// update with trigger
|
1556 |
-
if( silent !== true ) {
|
1557 |
-
$input.trigger('change');
|
1558 |
-
}
|
1559 |
-
|
1560 |
-
// return
|
1561 |
-
return true;
|
1562 |
-
};
|
1563 |
-
|
1564 |
-
/**
|
1565 |
-
* acf.show
|
1566 |
-
*
|
1567 |
-
* description
|
1568 |
-
*
|
1569 |
-
* @date 9/2/18
|
1570 |
-
* @since 5.6.5
|
1571 |
-
*
|
1572 |
-
* @param type $var Description. Default.
|
1573 |
-
* @return type Description.
|
1574 |
-
*/
|
1575 |
-
|
1576 |
-
acf.show = function( $el, lockKey ){
|
1577 |
-
|
1578 |
-
// unlock
|
1579 |
-
if( lockKey ) {
|
1580 |
-
acf.unlock($el, 'hidden', lockKey);
|
1581 |
-
}
|
1582 |
-
|
1583 |
-
// bail early if $el is still locked
|
1584 |
-
if( acf.isLocked($el, 'hidden') ) {
|
1585 |
-
//console.log( 'still locked', getLocks( $el, 'hidden' ));
|
1586 |
-
return false;
|
1587 |
-
}
|
1588 |
-
|
1589 |
-
// $el is hidden, remove class and return true due to change in visibility
|
1590 |
-
if( $el.hasClass('acf-hidden') ) {
|
1591 |
-
$el.removeClass('acf-hidden');
|
1592 |
-
return true;
|
1593 |
-
|
1594 |
-
// $el is visible, return false due to no change in visibility
|
1595 |
-
} else {
|
1596 |
-
return false;
|
1597 |
-
}
|
1598 |
-
};
|
1599 |
-
|
1600 |
-
|
1601 |
-
/**
|
1602 |
-
* acf.hide
|
1603 |
-
*
|
1604 |
-
* description
|
1605 |
-
*
|
1606 |
-
* @date 9/2/18
|
1607 |
-
* @since 5.6.5
|
1608 |
-
*
|
1609 |
-
* @param type $var Description. Default.
|
1610 |
-
* @return type Description.
|
1611 |
-
*/
|
1612 |
-
|
1613 |
-
acf.hide = function( $el, lockKey ){
|
1614 |
-
|
1615 |
-
// lock
|
1616 |
-
if( lockKey ) {
|
1617 |
-
acf.lock($el, 'hidden', lockKey);
|
1618 |
-
}
|
1619 |
-
|
1620 |
-
// $el is hidden, return false due to no change in visibility
|
1621 |
-
if( $el.hasClass('acf-hidden') ) {
|
1622 |
-
return false;
|
1623 |
-
|
1624 |
-
// $el is visible, add class and return true due to change in visibility
|
1625 |
-
} else {
|
1626 |
-
$el.addClass('acf-hidden');
|
1627 |
-
return true;
|
1628 |
-
}
|
1629 |
-
};
|
1630 |
-
|
1631 |
-
|
1632 |
-
/**
|
1633 |
-
* acf.isHidden
|
1634 |
-
*
|
1635 |
-
* description
|
1636 |
-
*
|
1637 |
-
* @date 9/2/18
|
1638 |
-
* @since 5.6.5
|
1639 |
-
*
|
1640 |
-
* @param type $var Description. Default.
|
1641 |
-
* @return type Description.
|
1642 |
-
*/
|
1643 |
-
|
1644 |
-
acf.isHidden = function( $el ){
|
1645 |
-
return $el.hasClass('acf-hidden');
|
1646 |
-
};
|
1647 |
-
|
1648 |
-
|
1649 |
-
/**
|
1650 |
-
* acf.isVisible
|
1651 |
-
*
|
1652 |
-
* description
|
1653 |
-
*
|
1654 |
-
* @date 9/2/18
|
1655 |
-
* @since 5.6.5
|
1656 |
-
*
|
1657 |
-
* @param type $var Description. Default.
|
1658 |
-
* @return type Description.
|
1659 |
-
*/
|
1660 |
-
|
1661 |
-
acf.isVisible = function( $el ){
|
1662 |
-
return !acf.isHidden( $el );
|
1663 |
-
};
|
1664 |
-
|
1665 |
-
|
1666 |
-
/**
|
1667 |
-
* enable
|
1668 |
-
*
|
1669 |
-
* description
|
1670 |
-
*
|
1671 |
-
* @date 12/3/18
|
1672 |
-
* @since 5.6.9
|
1673 |
-
*
|
1674 |
-
* @param type $var Description. Default.
|
1675 |
-
* @return type Description.
|
1676 |
-
*/
|
1677 |
-
|
1678 |
-
var enable = function( $el, lockKey ){
|
1679 |
-
|
1680 |
-
// check class. Allow .acf-disabled to overrule all JS
|
1681 |
-
if( $el.hasClass('acf-disabled') ) {
|
1682 |
-
return false;
|
1683 |
-
}
|
1684 |
-
|
1685 |
-
// unlock
|
1686 |
-
if( lockKey ) {
|
1687 |
-
acf.unlock($el, 'disabled', lockKey);
|
1688 |
-
}
|
1689 |
-
|
1690 |
-
// bail early if $el is still locked
|
1691 |
-
if( acf.isLocked($el, 'disabled') ) {
|
1692 |
-
return false;
|
1693 |
-
}
|
1694 |
-
|
1695 |
-
// $el is disabled, remove prop and return true due to change
|
1696 |
-
if( $el.prop('disabled') ) {
|
1697 |
-
$el.prop('disabled', false);
|
1698 |
-
return true;
|
1699 |
-
|
1700 |
-
// $el is enabled, return false due to no change
|
1701 |
-
} else {
|
1702 |
-
return false;
|
1703 |
-
}
|
1704 |
-
};
|
1705 |
-
|
1706 |
-
/**
|
1707 |
-
* acf.enable
|
1708 |
-
*
|
1709 |
-
* description
|
1710 |
-
*
|
1711 |
-
* @date 9/2/18
|
1712 |
-
* @since 5.6.5
|
1713 |
-
*
|
1714 |
-
* @param type $var Description. Default.
|
1715 |
-
* @return type Description.
|
1716 |
-
*/
|
1717 |
-
|
1718 |
-
acf.enable = function( $el, lockKey ){
|
1719 |
-
|
1720 |
-
// enable single input
|
1721 |
-
if( $el.attr('name') ) {
|
1722 |
-
return enable( $el, lockKey );
|
1723 |
-
}
|
1724 |
-
|
1725 |
-
// find and enable child inputs
|
1726 |
-
// return true if any inputs have changed
|
1727 |
-
var results = false;
|
1728 |
-
$el.find('[name]').each(function(){
|
1729 |
-
var result = enable( $(this), lockKey );
|
1730 |
-
if( result ) {
|
1731 |
-
results = true;
|
1732 |
-
}
|
1733 |
-
});
|
1734 |
-
return results;
|
1735 |
-
};
|
1736 |
-
|
1737 |
-
|
1738 |
-
/**
|
1739 |
-
* disable
|
1740 |
-
*
|
1741 |
-
* description
|
1742 |
-
*
|
1743 |
-
* @date 12/3/18
|
1744 |
-
* @since 5.6.9
|
1745 |
-
*
|
1746 |
-
* @param type $var Description. Default.
|
1747 |
-
* @return type Description.
|
1748 |
-
*/
|
1749 |
-
|
1750 |
-
var disable = function( $el, lockKey ){
|
1751 |
-
|
1752 |
-
// lock
|
1753 |
-
if( lockKey ) {
|
1754 |
-
acf.lock($el, 'disabled', lockKey);
|
1755 |
-
}
|
1756 |
-
|
1757 |
-
// $el is disabled, return false due to no change
|
1758 |
-
if( $el.prop('disabled') ) {
|
1759 |
-
return false;
|
1760 |
-
|
1761 |
-
// $el is enabled, add prop and return true due to change
|
1762 |
-
} else {
|
1763 |
-
$el.prop('disabled', true);
|
1764 |
-
return true;
|
1765 |
-
}
|
1766 |
-
};
|
1767 |
-
|
1768 |
-
|
1769 |
-
/**
|
1770 |
-
* acf.disable
|
1771 |
-
*
|
1772 |
-
* description
|
1773 |
-
*
|
1774 |
-
* @date 9/2/18
|
1775 |
-
* @since 5.6.5
|
1776 |
-
*
|
1777 |
-
* @param type $var Description. Default.
|
1778 |
-
* @return type Description.
|
1779 |
-
*/
|
1780 |
-
|
1781 |
-
acf.disable = function( $el, lockKey ){
|
1782 |
-
|
1783 |
-
// disable single input
|
1784 |
-
if( $el.attr('name') ) {
|
1785 |
-
return disable( $el, lockKey );
|
1786 |
-
}
|
1787 |
-
|
1788 |
-
// find and enable child inputs
|
1789 |
-
// return true if any inputs have changed
|
1790 |
-
var results = false;
|
1791 |
-
$el.find('[name]').each(function(){
|
1792 |
-
var result = disable( $(this), lockKey );
|
1793 |
-
if( result ) {
|
1794 |
-
results = true;
|
1795 |
-
}
|
1796 |
-
});
|
1797 |
-
return results;
|
1798 |
-
};
|
1799 |
-
|
1800 |
-
|
1801 |
-
/**
|
1802 |
-
* acf.isset
|
1803 |
-
*
|
1804 |
-
* description
|
1805 |
-
*
|
1806 |
-
* @date 10/1/18
|
1807 |
-
* @since 5.6.5
|
1808 |
-
*
|
1809 |
-
* @param type $var Description. Default.
|
1810 |
-
* @return type Description.
|
1811 |
-
*/
|
1812 |
-
|
1813 |
-
acf.isset = function( obj /*, level1, level2, ... */ ) {
|
1814 |
-
for( var i = 1; i < arguments.length; i++ ) {
|
1815 |
-
if( !obj || !obj.hasOwnProperty(arguments[i]) ) {
|
1816 |
-
return false;
|
1817 |
-
}
|
1818 |
-
obj = obj[ arguments[i] ];
|
1819 |
-
}
|
1820 |
-
return true;
|
1821 |
-
};
|
1822 |
-
|
1823 |
-
/**
|
1824 |
-
* acf.isget
|
1825 |
-
*
|
1826 |
-
* description
|
1827 |
-
*
|
1828 |
-
* @date 10/1/18
|
1829 |
-
* @since 5.6.5
|
1830 |
-
*
|
1831 |
-
* @param type $var Description. Default.
|
1832 |
-
* @return type Description.
|
1833 |
-
*/
|
1834 |
-
|
1835 |
-
acf.isget = function( obj /*, level1, level2, ... */ ) {
|
1836 |
-
for( var i = 1; i < arguments.length; i++ ) {
|
1837 |
-
if( !obj || !obj.hasOwnProperty(arguments[i]) ) {
|
1838 |
-
return null;
|
1839 |
-
}
|
1840 |
-
obj = obj[ arguments[i] ];
|
1841 |
-
}
|
1842 |
-
return obj;
|
1843 |
-
};
|
1844 |
-
|
1845 |
-
/**
|
1846 |
-
* acf.getFileInputData
|
1847 |
-
*
|
1848 |
-
* description
|
1849 |
-
*
|
1850 |
-
* @date 10/1/18
|
1851 |
-
* @since 5.6.5
|
1852 |
-
*
|
1853 |
-
* @param type $var Description. Default.
|
1854 |
-
* @return type Description.
|
1855 |
-
*/
|
1856 |
-
|
1857 |
-
acf.getFileInputData = function( $input, callback ){
|
1858 |
-
|
1859 |
-
// vars
|
1860 |
-
var value = $input.val();
|
1861 |
-
|
1862 |
-
// bail early if no value
|
1863 |
-
if( !value ) {
|
1864 |
-
return false;
|
1865 |
-
}
|
1866 |
-
|
1867 |
-
// data
|
1868 |
-
var data = {
|
1869 |
-
url: value
|
1870 |
-
};
|
1871 |
-
|
1872 |
-
// modern browsers
|
1873 |
-
var file = acf.isget( $input[0], 'files', 0);
|
1874 |
-
if( file ){
|
1875 |
-
|
1876 |
-
// update data
|
1877 |
-
data.size = file.size;
|
1878 |
-
data.type = file.type;
|
1879 |
-
|
1880 |
-
// image
|
1881 |
-
if( file.type.indexOf('image') > -1 ) {
|
1882 |
-
|
1883 |
-
// vars
|
1884 |
-
var windowURL = window.URL || window.webkitURL;
|
1885 |
-
var img = new Image();
|
1886 |
-
|
1887 |
-
img.onload = function() {
|
1888 |
-
|
1889 |
-
// update
|
1890 |
-
data.width = this.width;
|
1891 |
-
data.height = this.height;
|
1892 |
-
|
1893 |
-
callback( data );
|
1894 |
-
};
|
1895 |
-
img.src = windowURL.createObjectURL( file );
|
1896 |
-
} else {
|
1897 |
-
callback( data );
|
1898 |
-
}
|
1899 |
-
} else {
|
1900 |
-
callback( data );
|
1901 |
-
}
|
1902 |
-
};
|
1903 |
-
|
1904 |
-
/**
|
1905 |
-
* acf.isAjaxSuccess
|
1906 |
-
*
|
1907 |
-
* description
|
1908 |
-
*
|
1909 |
-
* @date 18/1/18
|
1910 |
-
* @since 5.6.5
|
1911 |
-
*
|
1912 |
-
* @param type $var Description. Default.
|
1913 |
-
* @return type Description.
|
1914 |
-
*/
|
1915 |
-
|
1916 |
-
acf.isAjaxSuccess = function( json ){
|
1917 |
-
return ( json && json.success );
|
1918 |
-
};
|
1919 |
-
|
1920 |
-
/**
|
1921 |
-
* acf.getAjaxMessage
|
1922 |
-
*
|
1923 |
-
* description
|
1924 |
-
*
|
1925 |
-
* @date 18/1/18
|
1926 |
-
* @since 5.6.5
|
1927 |
-
*
|
1928 |
-
* @param type $var Description. Default.
|
1929 |
-
* @return type Description.
|
1930 |
-
*/
|
1931 |
-
|
1932 |
-
acf.getAjaxMessage = function( json ){
|
1933 |
-
return acf.isget( json, 'data', 'message' );
|
1934 |
-
};
|
1935 |
-
|
1936 |
-
/**
|
1937 |
-
* acf.getAjaxError
|
1938 |
-
*
|
1939 |
-
* description
|
1940 |
-
*
|
1941 |
-
* @date 18/1/18
|
1942 |
-
* @since 5.6.5
|
1943 |
-
*
|
1944 |
-
* @param type $var Description. Default.
|
1945 |
-
* @return type Description.
|
1946 |
-
*/
|
1947 |
-
|
1948 |
-
acf.getAjaxError = function( json ){
|
1949 |
-
return acf.isget( json, 'data', 'error' );
|
1950 |
-
};
|
1951 |
-
|
1952 |
-
|
1953 |
-
/**
|
1954 |
-
* acf.renderSelect
|
1955 |
-
*
|
1956 |
-
* Renders the innter html for a select field.
|
1957 |
-
*
|
1958 |
-
* @date 19/2/18
|
1959 |
-
* @since 5.6.9
|
1960 |
-
*
|
1961 |
-
* @param jQuery $select The select element.
|
1962 |
-
* @param array choices An array of choices.
|
1963 |
-
* @return void
|
1964 |
-
*/
|
1965 |
-
|
1966 |
-
acf.renderSelect = function( $select, choices ){
|
1967 |
-
|
1968 |
-
// vars
|
1969 |
-
var value = $select.val();
|
1970 |
-
var values = [];
|
1971 |
-
|
1972 |
-
// callback
|
1973 |
-
var crawl = function( items ){
|
1974 |
-
|
1975 |
-
// vars
|
1976 |
-
var itemsHtml = '';
|
1977 |
-
|
1978 |
-
// loop
|
1979 |
-
items.map(function( item ){
|
1980 |
-
|
1981 |
-
// vars
|
1982 |
-
var text = item.text || item.label || '';
|
1983 |
-
var id = item.id || item.value || '';
|
1984 |
-
|
1985 |
-
// append
|
1986 |
-
values.push(id);
|
1987 |
-
|
1988 |
-
// optgroup
|
1989 |
-
if( item.children ) {
|
1990 |
-
itemsHtml += '<optgroup label="' + acf.strEscape(text) + '">' + crawl( item.children ) + '</optgroup>';
|
1991 |
-
|
1992 |
-
// option
|
1993 |
-
} else {
|
1994 |
-
itemsHtml += '<option value="' + id + '"' + (item.disabled ? ' disabled="disabled"' : '') + '>' + text + '</option>';
|
1995 |
-
}
|
1996 |
-
});
|
1997 |
-
|
1998 |
-
// return
|
1999 |
-
return itemsHtml;
|
2000 |
-
};
|
2001 |
-
|
2002 |
-
// update HTML
|
2003 |
-
$select.html( crawl(choices) );
|
2004 |
-
|
2005 |
-
// update value
|
2006 |
-
if( values.indexOf(value) > -1 ){
|
2007 |
-
$select.val( value );
|
2008 |
-
}
|
2009 |
-
|
2010 |
-
// return selected value
|
2011 |
-
return $select.val();
|
2012 |
-
};
|
2013 |
-
|
2014 |
-
/**
|
2015 |
-
* acf.lock
|
2016 |
-
*
|
2017 |
-
* Creates a "lock" on an element for a given type and key
|
2018 |
-
*
|
2019 |
-
* @date 22/2/18
|
2020 |
-
* @since 5.6.9
|
2021 |
-
*
|
2022 |
-
* @param jQuery $el The element to lock.
|
2023 |
-
* @param string type The type of lock such as "condition" or "visibility".
|
2024 |
-
* @param string key The key that will be used to unlock.
|
2025 |
-
* @return void
|
2026 |
-
*/
|
2027 |
-
|
2028 |
-
var getLocks = function( $el, type ){
|
2029 |
-
return $el.data('acf-lock-'+type) || [];
|
2030 |
-
};
|
2031 |
-
|
2032 |
-
var setLocks = function( $el, type, locks ){
|
2033 |
-
$el.data('acf-lock-'+type, locks);
|
2034 |
-
}
|
2035 |
-
|
2036 |
-
acf.lock = function( $el, type, key ){
|
2037 |
-
var locks = getLocks( $el, type );
|
2038 |
-
var i = locks.indexOf(key);
|
2039 |
-
if( i < 0 ) {
|
2040 |
-
locks.push( key );
|
2041 |
-
setLocks( $el, type, locks );
|
2042 |
-
}
|
2043 |
-
};
|
2044 |
-
|
2045 |
-
/**
|
2046 |
-
* acf.unlock
|
2047 |
-
*
|
2048 |
-
* Unlocks a "lock" on an element for a given type and key
|
2049 |
-
*
|
2050 |
-
* @date 22/2/18
|
2051 |
-
* @since 5.6.9
|
2052 |
-
*
|
2053 |
-
* @param jQuery $el The element to lock.
|
2054 |
-
* @param string type The type of lock such as "condition" or "visibility".
|
2055 |
-
* @param string key The key that will be used to unlock.
|
2056 |
-
* @return void
|
2057 |
-
*/
|
2058 |
-
|
2059 |
-
acf.unlock = function( $el, type, key ){
|
2060 |
-
var locks = getLocks( $el, type );
|
2061 |
-
var i = locks.indexOf(key);
|
2062 |
-
if( i > -1 ) {
|
2063 |
-
locks.splice(i, 1);
|
2064 |
-
setLocks( $el, type, locks );
|
2065 |
-
}
|
2066 |
-
|
2067 |
-
// return true if is unlocked (no locks)
|
2068 |
-
return (locks.length === 0);
|
2069 |
-
};
|
2070 |
-
|
2071 |
-
/**
|
2072 |
-
* acf.isLocked
|
2073 |
-
*
|
2074 |
-
* Returns true if a lock exists for a given type
|
2075 |
-
*
|
2076 |
-
* @date 22/2/18
|
2077 |
-
* @since 5.6.9
|
2078 |
-
*
|
2079 |
-
* @param jQuery $el The element to lock.
|
2080 |
-
* @param string type The type of lock such as "condition" or "visibility".
|
2081 |
-
* @return void
|
2082 |
-
*/
|
2083 |
-
|
2084 |
-
acf.isLocked = function( $el, type ){
|
2085 |
-
return ( getLocks( $el, type ).length > 0 );
|
2086 |
-
};
|
2087 |
-
|
2088 |
-
/**
|
2089 |
-
* acf.isGutenberg
|
2090 |
-
*
|
2091 |
-
* Returns true if the Gutenberg editor is being used.
|
2092 |
-
*
|
2093 |
-
* @date 14/11/18
|
2094 |
-
* @since 5.8.0
|
2095 |
-
*
|
2096 |
-
* @param vois
|
2097 |
-
* @return bool
|
2098 |
-
*/
|
2099 |
-
acf.isGutenberg = function(){
|
2100 |
-
return ( window.wp && wp.data && wp.data.select && wp.data.select( 'core/editor' ) );
|
2101 |
-
};
|
2102 |
-
|
2103 |
-
/**
|
2104 |
-
* acf.objectToArray
|
2105 |
-
*
|
2106 |
-
* Returns an array of items from the given object.
|
2107 |
-
*
|
2108 |
-
* @date 20/11/18
|
2109 |
-
* @since 5.8.0
|
2110 |
-
*
|
2111 |
-
* @param object obj The object of items.
|
2112 |
-
* @return array
|
2113 |
-
*/
|
2114 |
-
acf.objectToArray = function( obj ){
|
2115 |
-
return Object.keys( obj ).map(function( key ){
|
2116 |
-
return obj[key];
|
2117 |
-
});
|
2118 |
-
};
|
2119 |
-
|
2120 |
-
/*
|
2121 |
-
* exists
|
2122 |
-
*
|
2123 |
-
* This function will return true if a jQuery selection exists
|
2124 |
-
*
|
2125 |
-
* @type function
|
2126 |
-
* @date 8/09/2014
|
2127 |
-
* @since 5.0.0
|
2128 |
-
*
|
2129 |
-
* @param n/a
|
2130 |
-
* @return (boolean)
|
2131 |
-
*/
|
2132 |
-
|
2133 |
-
$.fn.exists = function() {
|
2134 |
-
return $(this).length>0;
|
2135 |
-
};
|
2136 |
-
|
2137 |
-
|
2138 |
-
/*
|
2139 |
-
* outerHTML
|
2140 |
-
*
|
2141 |
-
* This function will return a string containing the HTML of the selected element
|
2142 |
-
*
|
2143 |
-
* @type function
|
2144 |
-
* @date 19/11/2013
|
2145 |
-
* @since 5.0.0
|
2146 |
-
*
|
2147 |
-
* @param $.fn
|
2148 |
-
* @return (string)
|
2149 |
-
*/
|
2150 |
-
|
2151 |
-
$.fn.outerHTML = function() {
|
2152 |
-
return $(this).get(0).outerHTML;
|
2153 |
-
};
|
2154 |
-
|
2155 |
-
/*
|
2156 |
-
* indexOf
|
2157 |
-
*
|
2158 |
-
* This function will provide compatibility for ie8
|
2159 |
-
*
|
2160 |
-
* @type function
|
2161 |
-
* @date 5/3/17
|
2162 |
-
* @since 5.5.10
|
2163 |
-
*
|
2164 |
-
* @param n/a
|
2165 |
-
* @return n/a
|
2166 |
-
*/
|
2167 |
-
|
2168 |
-
if( !Array.prototype.indexOf ) {
|
2169 |
-
|
2170 |
-
Array.prototype.indexOf = function(val) {
|
2171 |
-
return $.inArray(val, this);
|
2172 |
-
};
|
2173 |
-
|
2174 |
-
}
|
2175 |
-
|
2176 |
-
|
2177 |
-
// Set up actions from events
|
2178 |
-
$(document).ready(function(){
|
2179 |
-
acf.doAction('ready');
|
2180 |
-
});
|
2181 |
-
|
2182 |
-
$(window).on('load', function(){
|
2183 |
-
acf.doAction('load');
|
2184 |
-
});
|
2185 |
-
|
2186 |
-
$(window).on('beforeunload', function(){
|
2187 |
-
acf.doAction('unload');
|
2188 |
-
});
|
2189 |
-
|
2190 |
-
$(window).on('resize', function(){
|
2191 |
-
acf.doAction('resize');
|
2192 |
-
});
|
2193 |
-
|
2194 |
-
$(document).on('sortstart', function( event, ui ) {
|
2195 |
-
acf.doAction('sortstart', ui.item, ui.placeholder);
|
2196 |
-
});
|
2197 |
-
|
2198 |
-
$(document).on('sortstop', function( event, ui ) {
|
2199 |
-
acf.doAction('sortstop', ui.item, ui.placeholder);
|
2200 |
-
});
|
2201 |
-
|
2202 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/build/js/_field-group-compatibility.js
DELETED
@@ -1,281 +0,0 @@
|
|
1 |
-
(function($, undefined){
|
2 |
-
|
3 |
-
var _acf = acf.getCompatibility( acf );
|
4 |
-
|
5 |
-
/**
|
6 |
-
* fieldGroupCompatibility
|
7 |
-
*
|
8 |
-
* Compatibility layer for extinct acf.field_group
|
9 |
-
*
|
10 |
-
* @date 15/12/17
|
11 |
-
* @since 5.7.0
|
12 |
-
*
|
13 |
-
* @param void
|
14 |
-
* @return void
|
15 |
-
*/
|
16 |
-
|
17 |
-
_acf.field_group = {
|
18 |
-
|
19 |
-
save_field: function( $field, type ){
|
20 |
-
type = (type !== undefined) ? type : 'settings';
|
21 |
-
acf.getFieldObject( $field ).save( type );
|
22 |
-
},
|
23 |
-
|
24 |
-
delete_field: function( $field, animate ){
|
25 |
-
animate = (animate !== undefined) ? animate : true;
|
26 |
-
acf.getFieldObject( $field ).delete({
|
27 |
-
animate: animate
|
28 |
-
});
|
29 |
-
},
|
30 |
-
|
31 |
-
update_field_meta: function( $field, name, value ){
|
32 |
-
acf.getFieldObject( $field ).prop( name, value );
|
33 |
-
},
|
34 |
-
|
35 |
-
delete_field_meta: function( $field, name ){
|
36 |
-
acf.getFieldObject( $field ).prop( name, null );
|
37 |
-
}
|
38 |
-
};
|
39 |
-
|
40 |
-
/**
|
41 |
-
* fieldGroupCompatibility.field_object
|
42 |
-
*
|
43 |
-
* Compatibility layer for extinct acf.field_group.field_object
|
44 |
-
*
|
45 |
-
* @date 15/12/17
|
46 |
-
* @since 5.7.0
|
47 |
-
*
|
48 |
-
* @param void
|
49 |
-
* @return void
|
50 |
-
*/
|
51 |
-
|
52 |
-
_acf.field_group.field_object = acf.model.extend({
|
53 |
-
|
54 |
-
// vars
|
55 |
-
type: '',
|
56 |
-
o: {},
|
57 |
-
$field: null,
|
58 |
-
$settings: null,
|
59 |
-
|
60 |
-
tag: function( tag ) {
|
61 |
-
|
62 |
-
// vars
|
63 |
-
var type = this.type;
|
64 |
-
|
65 |
-
|
66 |
-
// explode, add 'field' and implode
|
67 |
-
// - open => open_field
|
68 |
-
// - change_type => change_field_type
|
69 |
-
var tags = tag.split('_');
|
70 |
-
tags.splice(1, 0, 'field');
|
71 |
-
tag = tags.join('_');
|
72 |
-
|
73 |
-
|
74 |
-
// add type
|
75 |
-
if( type ) {
|
76 |
-
tag += '/type=' + type;
|
77 |
-
}
|
78 |
-
|
79 |
-
|
80 |
-
// return
|
81 |
-
return tag;
|
82 |
-
|
83 |
-
},
|
84 |
-
|
85 |
-
selector: function(){
|
86 |
-
|
87 |
-
// vars
|
88 |
-
var selector = '.acf-field-object';
|
89 |
-
var type = this.type;
|
90 |
-
|
91 |
-
|
92 |
-
// add type
|
93 |
-
if( type ) {
|
94 |
-
selector += '-' + type;
|
95 |
-
selector = acf.str_replace('_', '-', selector);
|
96 |
-
}
|
97 |
-
|
98 |
-
|
99 |
-
// return
|
100 |
-
return selector;
|
101 |
-
|
102 |
-
},
|
103 |
-
|
104 |
-
_add_action: function( name, callback ) {
|
105 |
-
|
106 |
-
// vars
|
107 |
-
var model = this;
|
108 |
-
|
109 |
-
|
110 |
-
// add action
|
111 |
-
acf.add_action( this.tag(name), function( $field ){
|
112 |
-
|
113 |
-
// focus
|
114 |
-
model.set('$field', $field);
|
115 |
-
|
116 |
-
|
117 |
-
// callback
|
118 |
-
model[ callback ].apply(model, arguments);
|
119 |
-
|
120 |
-
});
|
121 |
-
|
122 |
-
},
|
123 |
-
|
124 |
-
_add_filter: function( name, callback ) {
|
125 |
-
|
126 |
-
// vars
|
127 |
-
var model = this;
|
128 |
-
|
129 |
-
|
130 |
-
// add action
|
131 |
-
acf.add_filter( this.tag(name), function( $field ){
|
132 |
-
|
133 |
-
// focus
|
134 |
-
model.set('$field', $field);
|
135 |
-
|
136 |
-
|
137 |
-
// callback
|
138 |
-
model[ callback ].apply(model, arguments);
|
139 |
-
|
140 |
-
});
|
141 |
-
|
142 |
-
},
|
143 |
-
|
144 |
-
_add_event: function( name, callback ) {
|
145 |
-
|
146 |
-
// vars
|
147 |
-
var model = this;
|
148 |
-
var event = name.substr(0,name.indexOf(' '));
|
149 |
-
var selector = name.substr(name.indexOf(' ')+1);
|
150 |
-
var context = this.selector();
|
151 |
-
|
152 |
-
|
153 |
-
// add event
|
154 |
-
$(document).on(event, context + ' ' + selector, function( e ){
|
155 |
-
|
156 |
-
// append $el to event object
|
157 |
-
e.$el = $(this);
|
158 |
-
e.$field = e.$el.closest('.acf-field-object');
|
159 |
-
|
160 |
-
|
161 |
-
// focus
|
162 |
-
model.set('$field', e.$field);
|
163 |
-
|
164 |
-
|
165 |
-
// callback
|
166 |
-
model[ callback ].apply(model, [e]);
|
167 |
-
|
168 |
-
});
|
169 |
-
|
170 |
-
},
|
171 |
-
|
172 |
-
_set_$field: function(){
|
173 |
-
|
174 |
-
// vars
|
175 |
-
this.o = this.$field.data();
|
176 |
-
|
177 |
-
|
178 |
-
// els
|
179 |
-
this.$settings = this.$field.find('> .settings > table > tbody');
|
180 |
-
|
181 |
-
|
182 |
-
// focus
|
183 |
-
this.focus();
|
184 |
-
|
185 |
-
},
|
186 |
-
|
187 |
-
focus: function(){
|
188 |
-
|
189 |
-
// do nothing
|
190 |
-
|
191 |
-
},
|
192 |
-
|
193 |
-
setting: function( name ) {
|
194 |
-
|
195 |
-
return this.$settings.find('> .acf-field-setting-' + name);
|
196 |
-
|
197 |
-
}
|
198 |
-
|
199 |
-
});
|
200 |
-
|
201 |
-
|
202 |
-
/*
|
203 |
-
* field
|
204 |
-
*
|
205 |
-
* This model fires actions and filters for registered fields
|
206 |
-
*
|
207 |
-
* @type function
|
208 |
-
* @date 21/02/2014
|
209 |
-
* @since 3.5.1
|
210 |
-
*
|
211 |
-
* @param n/a
|
212 |
-
* @return n/a
|
213 |
-
*/
|
214 |
-
|
215 |
-
var actionManager = new acf.Model({
|
216 |
-
|
217 |
-
actions: {
|
218 |
-
'open_field_object': 'onOpenFieldObject',
|
219 |
-
'close_field_object': 'onCloseFieldObject',
|
220 |
-
'add_field_object': 'onAddFieldObject',
|
221 |
-
'duplicate_field_object': 'onDuplicateFieldObject',
|
222 |
-
'delete_field_object': 'onDeleteFieldObject',
|
223 |
-
'change_field_object_type': 'onChangeFieldObjectType',
|
224 |
-
'change_field_object_label': 'onChangeFieldObjectLabel',
|
225 |
-
'change_field_object_name': 'onChangeFieldObjectName',
|
226 |
-
'change_field_object_parent': 'onChangeFieldObjectParent',
|
227 |
-
'sortstop_field_object': 'onChangeFieldObjectParent'
|
228 |
-
},
|
229 |
-
|
230 |
-
onOpenFieldObject: function( field ){
|
231 |
-
acf.doAction('open_field', field.$el);
|
232 |
-
acf.doAction('open_field/type=' + field.get('type'), field.$el);
|
233 |
-
|
234 |
-
acf.doAction('render_field_settings', field.$el);
|
235 |
-
acf.doAction('render_field_settings/type=' + field.get('type'), field.$el);
|
236 |
-
},
|
237 |
-
|
238 |
-
onCloseFieldObject: function( field ){
|
239 |
-
acf.doAction('close_field', field.$el);
|
240 |
-
acf.doAction('close_field/type=' + field.get('type'), field.$el);
|
241 |
-
},
|
242 |
-
|
243 |
-
onAddFieldObject: function( field ){
|
244 |
-
acf.doAction('add_field', field.$el);
|
245 |
-
acf.doAction('add_field/type=' + field.get('type'), field.$el);
|
246 |
-
},
|
247 |
-
|
248 |
-
onDuplicateFieldObject: function( field ){
|
249 |
-
acf.doAction('duplicate_field', field.$el);
|
250 |
-
acf.doAction('duplicate_field/type=' + field.get('type'), field.$el);
|
251 |
-
},
|
252 |
-
|
253 |
-
onDeleteFieldObject: function( field ){
|
254 |
-
acf.doAction('delete_field', field.$el);
|
255 |
-
acf.doAction('delete_field/type=' + field.get('type'), field.$el);
|
256 |
-
},
|
257 |
-
|
258 |
-
onChangeFieldObjectType: function( field ){
|
259 |
-
acf.doAction('change_field_type', field.$el);
|
260 |
-
acf.doAction('change_field_type/type=' + field.get('type'), field.$el);
|
261 |
-
|
262 |
-
acf.doAction('render_field_settings', field.$el);
|
263 |
-
acf.doAction('render_field_settings/type=' + field.get('type'), field.$el);
|
264 |
-
},
|
265 |
-
|
266 |
-
onChangeFieldObjectLabel: function( field ){
|
267 |
-
acf.doAction('change_field_label', field.$el);
|
268 |
-
acf.doAction('change_field_label/type=' + field.get('type'), field.$el);
|
269 |
-
},
|
270 |
-
|
271 |
-
onChangeFieldObjectName: function( field ){
|
272 |
-
acf.doAction('change_field_name', field.$el);
|
273 |
-
acf.doAction('change_field_name/type=' + field.get('type'), field.$el);
|
274 |
-
},
|
275 |
-
|
276 |
-
onChangeFieldObjectParent: function( field ){
|
277 |
-
acf.doAction('update_field_parent', field.$el);
|
278 |
-
}
|
279 |
-
});
|
280 |
-
|
281 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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1,403 +0,0 @@
|
|
1 |
-
(function($, undefined){
|
2 |
-
|
3 |
-
/**
|
4 |
-
* ConditionalLogicFieldSetting
|
5 |
-
*
|
6 |
-
* description
|
7 |
-
*
|
8 |
-
* @date 3/2/18
|
9 |
-
* @since 5.6.5
|
10 |
-
*
|
11 |
-
* @param type $var Description. Default.
|
12 |
-
* @return type Description.
|
13 |
-
*/
|
14 |
-
|
15 |
-
var ConditionalLogicFieldSetting = acf.FieldSetting.extend({
|
16 |
-
type: '',
|
17 |
-
name: 'conditional_logic',
|
18 |
-
events: {
|
19 |
-
'change .conditions-toggle': 'onChangeToggle',
|
20 |
-
'click .add-conditional-group': 'onClickAddGroup',
|
21 |
-
'focus .condition-rule-field': 'onFocusField',
|
22 |
-
'change .condition-rule-field': 'onChangeField',
|
23 |
-
'change .condition-rule-operator': 'onChangeOperator',
|
24 |
-
'click .add-conditional-rule': 'onClickAdd',
|
25 |
-
'click .remove-conditional-rule': 'onClickRemove'
|
26 |
-
},
|
27 |
-
|
28 |
-
$rule: false,
|
29 |
-
|
30 |
-
scope: function( $rule ){
|
31 |
-
this.$rule = $rule;
|
32 |
-
return this;
|
33 |
-
},
|
34 |
-
|
35 |
-
ruleData: function( name, value ){
|
36 |
-
return this.$rule.data.apply( this.$rule, arguments );
|
37 |
-
},
|
38 |
-
|
39 |
-
$input: function( name ){
|
40 |
-
return this.$rule.find('.condition-rule-' + name);
|
41 |
-
},
|
42 |
-
|
43 |
-
$td: function( name ){
|
44 |
-
return this.$rule.find('td.' + name);
|
45 |
-
},
|
46 |
-
|
47 |
-
$toggle: function(){
|
48 |
-
return this.$('.conditions-toggle');
|
49 |
-
},
|
50 |
-
|
51 |
-
$control: function(){
|
52 |
-
return this.$('.rule-groups');
|
53 |
-
},
|
54 |
-
|
55 |
-
$groups: function(){
|
56 |
-
return this.$('.rule-group');
|
57 |
-
},
|
58 |
-
|
59 |
-
$rules: function(){
|
60 |
-
return this.$('.rule');
|
61 |
-
},
|
62 |
-
|
63 |
-
open: function(){
|
64 |
-
var $div = this.$control();
|
65 |
-
$div.show();
|
66 |
-
acf.enable( $div );
|
67 |
-
},
|
68 |
-
|
69 |
-
close: function(){
|
70 |
-
var $div = this.$control();
|
71 |
-
$div.hide();
|
72 |
-
acf.disable( $div );
|
73 |
-
},
|
74 |
-
|
75 |
-
render: function(){
|
76 |
-
|
77 |
-
// show
|
78 |
-
if( this.$toggle().prop('checked') ) {
|
79 |
-
this.renderRules();
|
80 |
-
this.open();
|
81 |
-
|
82 |
-
// hide
|
83 |
-
} else {
|
84 |
-
this.close();
|
85 |
-
}
|
86 |
-
},
|
87 |
-
|
88 |
-
renderRules: function(){
|
89 |
-
|
90 |
-
// vars
|
91 |
-
var self = this;
|
92 |
-
|
93 |
-
// loop
|
94 |
-
this.$rules().each(function(){
|
95 |
-
self.renderRule( $(this) );
|
96 |
-
});
|
97 |
-
},
|
98 |
-
|
99 |
-
renderRule: function( $rule ){
|
100 |
-
this.scope( $rule );
|
101 |
-
this.renderField();
|
102 |
-
this.renderOperator();
|
103 |
-
this.renderValue();
|
104 |
-
},
|
105 |
-
|
106 |
-
renderField: function(){
|
107 |
-
|
108 |
-
// vars
|
109 |
-
var choices = [];
|
110 |
-
var validFieldTypes = [];
|
111 |
-
var cid = this.fieldObject.cid;
|
112 |
-
var $select = this.$input('field');
|
113 |
-
|
114 |
-
// loop
|
115 |
-
acf.getFieldObjects().map(function( fieldObject ){
|
116 |
-
|
117 |
-
// vars
|
118 |
-
var choice = {
|
119 |
-
id: fieldObject.getKey(),
|
120 |
-
text: fieldObject.getLabel()
|
121 |
-
};
|
122 |
-
|
123 |
-
// bail early if is self
|
124 |
-
if( fieldObject.cid === cid ) {
|
125 |
-
choice.text += acf.__('(this field)');
|
126 |
-
choice.disabled = true;
|
127 |
-
}
|
128 |
-
|
129 |
-
// get selected field conditions
|
130 |
-
var conditionTypes = acf.getConditionTypes({
|
131 |
-
fieldType: fieldObject.getType()
|
132 |
-
});
|
133 |
-
|
134 |
-
// bail early if no types
|
135 |
-
if( !conditionTypes.length ) {
|
136 |
-
choice.disabled = true;
|
137 |
-
}
|
138 |
-
|
139 |
-
// calulate indents
|
140 |
-
var indents = fieldObject.getParents().length;
|
141 |
-
choice.text = '- '.repeat(indents) + choice.text;
|
142 |
-
|
143 |
-
// append
|
144 |
-
choices.push(choice);
|
145 |
-
});
|
146 |
-
|
147 |
-
// allow for scenario where only one field exists
|
148 |
-
if( !choices.length ) {
|
149 |
-
choices.push({
|
150 |
-
id: '',
|
151 |
-
text: acf.__('No toggle fields available'),
|
152 |
-
});
|
153 |
-
}
|
154 |
-
|
155 |
-
// render
|
156 |
-
acf.renderSelect( $select, choices );
|
157 |
-
|
158 |
-
// set
|
159 |
-
this.ruleData('field', $select.val());
|
160 |
-
},
|
161 |
-
|
162 |
-
renderOperator: function(){
|
163 |
-
|
164 |
-
// bail early if no field selected
|
165 |
-
if( !this.ruleData('field') ) {
|
166 |
-
return;
|
167 |
-
}
|
168 |
-
|
169 |
-
// vars
|
170 |
-
var $select = this.$input('operator');
|
171 |
-
var val = $select.val();
|
172 |
-
var choices = [];
|
173 |
-
|
174 |
-
// set saved value on first render
|
175 |
-
// - this allows the 2nd render to correctly select an option
|
176 |
-
if( $select.val() === null ) {
|
177 |
-
acf.renderSelect($select, [{
|
178 |
-
id: this.ruleData('operator'),
|
179 |
-
text: ''
|
180 |
-
}]);
|
181 |
-
}
|
182 |
-
|
183 |
-
// get selected field
|
184 |
-
var $field = acf.findFieldObject( this.ruleData('field') );
|
185 |
-
var field = acf.getFieldObject( $field );
|
186 |
-
|
187 |
-
// get selected field conditions
|
188 |
-
var conditionTypes = acf.getConditionTypes({
|
189 |
-
fieldType: field.getType()
|
190 |
-
});
|
191 |
-
|
192 |
-
// html
|
193 |
-
conditionTypes.map(function( model ){
|
194 |
-
choices.push({
|
195 |
-
id: model.prototype.operator,
|
196 |
-
text: acf.strEscape(model.prototype.label)
|
197 |
-
});
|
198 |
-
});
|
199 |
-
|
200 |
-
// render
|
201 |
-
acf.renderSelect( $select, choices );
|
202 |
-
|
203 |
-
// set
|
204 |
-
this.ruleData('operator', $select.val());
|
205 |
-
},
|
206 |
-
|
207 |
-
renderValue: function(){
|
208 |
-
|
209 |
-
// bail early if no field selected
|
210 |
-
if( !this.ruleData('field') || !this.ruleData('operator') ) {
|
211 |
-
return;
|
212 |
-
}
|
213 |
-
|
214 |
-
// vars
|
215 |
-
var $select = this.$input('value');
|
216 |
-
var $td = this.$td('value');
|
217 |
-
var val = $select.val();
|
218 |
-
|
219 |
-
// get selected field
|
220 |
-
var $field = acf.findFieldObject( this.ruleData('field') );
|
221 |
-
var field = acf.getFieldObject( $field );
|
222 |
-
|
223 |
-
// get selected field conditions
|
224 |
-
var conditionTypes = acf.getConditionTypes({
|
225 |
-
fieldType: field.getType(),
|
226 |
-
operator: this.ruleData('operator')
|
227 |
-
});
|
228 |
-
|
229 |
-
// html
|
230 |
-
var conditionType = conditionTypes[0].prototype;
|
231 |
-
var choices = conditionType.choices( field );
|
232 |
-
|
233 |
-
// create html: array
|
234 |
-
if( choices instanceof Array ) {
|
235 |
-
var $newSelect = $('<select></select>');
|
236 |
-
acf.renderSelect( $newSelect, choices );
|
237 |
-
|
238 |
-
// create html: string (<input />)
|
239 |
-
} else {
|
240 |
-
var $newSelect = $(choices);
|
241 |
-
}
|
242 |
-
|
243 |
-
// append
|
244 |
-
$select.detach();
|
245 |
-
$td.html( $newSelect );
|
246 |
-
|
247 |
-
// copy attrs
|
248 |
-
// timeout needed to avoid browser bug where "disabled" attribute is not applied
|
249 |
-
setTimeout(function(){
|
250 |
-
['class', 'name', 'id'].map(function( attr ){
|
251 |
-
$newSelect.attr( attr, $select.attr(attr));
|
252 |
-
});
|
253 |
-
}, 0);
|
254 |
-
|
255 |
-
// select existing value (if not a disabled input)
|
256 |
-
if( !$newSelect.prop('disabled') ) {
|
257 |
-
acf.val( $newSelect, val, true );
|
258 |
-
}
|
259 |
-
|
260 |
-
// set
|
261 |
-
this.ruleData('value', $newSelect.val());
|
262 |
-
},
|
263 |
-
|
264 |
-
onChangeToggle: function(){
|
265 |
-
this.render();
|
266 |
-
},
|
267 |
-
|
268 |
-
onClickAddGroup: function( e, $el ){
|
269 |
-
this.addGroup();
|
270 |
-
},
|
271 |
-
|
272 |
-
addGroup: function(){
|
273 |
-
|
274 |
-
// vars
|
275 |
-
var $group = this.$('.rule-group:last');
|
276 |
-
|
277 |
-
// duplicate
|
278 |
-
var $group2 = acf.duplicate( $group );
|
279 |
-
|
280 |
-
// update h4
|
281 |
-
$group2.find('h4').text( acf.__('or') );
|
282 |
-
|
283 |
-
// remove all tr's except the first one
|
284 |
-
$group2.find('tr').not(':first').remove();
|
285 |
-
|
286 |
-
// save field
|
287 |
-
this.fieldObject.save();
|
288 |
-
},
|
289 |
-
|
290 |
-
onFocusField: function( e, $el ){
|
291 |
-
this.renderField();
|
292 |
-
},
|
293 |
-
|
294 |
-
onChangeField: function( e, $el ){
|
295 |
-
|
296 |
-
// scope
|
297 |
-
this.scope( $el.closest('.rule') );
|
298 |
-
|
299 |
-
// set data
|
300 |
-
this.ruleData('field', $el.val());
|
301 |
-
|
302 |
-
// render
|
303 |
-
this.renderOperator();
|
304 |
-
this.renderValue();
|
305 |
-
},
|
306 |
-
|
307 |
-
onChangeOperator: function( e, $el ){
|
308 |
-
|
309 |
-
// scope
|
310 |
-
this.scope( $el.closest('.rule') );
|
311 |
-
|
312 |
-
// set data
|
313 |
-
this.ruleData('operator', $el.val());
|
314 |
-
|
315 |
-
// render
|
316 |
-
this.renderValue();
|
317 |
-
},
|
318 |
-
|
319 |
-
onClickAdd: function( e, $el ){
|
320 |
-
|
321 |
-
// duplciate
|
322 |
-
var $rule = acf.duplicate( $el.closest('.rule') );
|
323 |
-
|
324 |
-
// render
|
325 |
-
this.renderRule( $rule );
|
326 |
-
},
|
327 |
-
|
328 |
-
onClickRemove: function( e, $el ){
|
329 |
-
|
330 |
-
// vars
|
331 |
-
var $rule = $el.closest('.rule');
|
332 |
-
|
333 |
-
// save field
|
334 |
-
this.fieldObject.save();
|
335 |
-
|
336 |
-
// remove group
|
337 |
-
if( $rule.siblings('.rule').length == 0 ) {
|
338 |
-
$rule.closest('.rule-group').remove();
|
339 |
-
}
|
340 |
-
|
341 |
-
// remove
|
342 |
-
$rule.remove();
|
343 |
-
}
|
344 |
-
});
|
345 |
-
|
346 |
-
acf.registerFieldSetting( ConditionalLogicFieldSetting );
|
347 |
-
|
348 |
-
|
349 |
-
/**
|
350 |
-
* conditionalLogicHelper
|
351 |
-
*
|
352 |
-
* description
|
353 |
-
*
|
354 |
-
* @date 20/4/18
|
355 |
-
* @since 5.6.9
|
356 |
-
*
|
357 |
-
* @param type $var Description. Default.
|
358 |
-
* @return type Description.
|
359 |
-
*/
|
360 |
-
|
361 |
-
var conditionalLogicHelper = new acf.Model({
|
362 |
-
actions: {
|
363 |
-
'duplicate_field_objects': 'onDuplicateFieldObjects',
|
364 |
-
},
|
365 |
-
|
366 |
-
onDuplicateFieldObjects: function( children, newField, prevField ){
|
367 |
-
|
368 |
-
// vars
|
369 |
-
var data = {};
|
370 |
-
var $selects = $();
|
371 |
-
|
372 |
-
// reference change in key
|
373 |
-
children.map(function( child ){
|
374 |
-
|
375 |
-
// store reference of changed key
|
376 |
-
data[ child.get('prevKey') ] = child.get('key');
|
377 |
-
|
378 |
-
// append condition select
|
379 |
-
$selects = $selects.add( child.$('.condition-rule-field') );
|
380 |
-
});
|
381 |
-
|
382 |
-
// loop
|
383 |
-
$selects.each(function(){
|
384 |
-
|
385 |
-
// vars
|
386 |
-
var $select = $(this);
|
387 |
-
var val = $select.val();
|
388 |
-
|
389 |
-
// bail early if val is not a ref key
|
390 |
-
if( !val || !data[val] ) {
|
391 |
-
return;
|
392 |
-
}
|
393 |
-
|
394 |
-
// modify selected option
|
395 |
-
$select.find('option:selected').attr('value', data[val]);
|
396 |
-
|
397 |
-
// set new val
|
398 |
-
$select.val( data[val] );
|
399 |
-
|
400 |
-
});
|
401 |
-
},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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/build/js/_field-group-field.js
DELETED
@@ -1,808 +0,0 @@
|
|
1 |
-
(function($, undefined){
|
2 |
-
|
3 |
-
acf.FieldObject = acf.Model.extend({
|
4 |
-
|
5 |
-
// class used to avoid nested event triggers
|
6 |
-
eventScope: '.acf-field-object',
|
7 |
-
|
8 |
-
// events
|
9 |
-
events: {
|
10 |
-
'click .edit-field': 'onClickEdit',
|
11 |
-
'click .delete-field': 'onClickDelete',
|
12 |
-
'click .duplicate-field': 'duplicate',
|
13 |
-
'click .move-field': 'move',
|
14 |
-
|
15 |
-
'change .field-type': 'onChangeType',
|
16 |
-
'change .field-required': 'onChangeRequired',
|
17 |
-
'blur .field-label': 'onChangeLabel',
|
18 |
-
'blur .field-name': 'onChangeName',
|
19 |
-
|
20 |
-
'change': 'onChange',
|
21 |
-
'changed': 'onChanged',
|
22 |
-
},
|
23 |
-
|
24 |
-
// data
|
25 |
-
data: {
|
26 |
-
|
27 |
-
// Similar to ID, but used for HTML puposes.
|
28 |
-
// It is possbile for a new field to have an ID of 0, but an id of 'field_123' */
|
29 |
-
id: 0,
|
30 |
-
|
31 |
-
// The field key ('field_123')
|
32 |
-
key: '',
|
33 |
-
|
34 |
-
// The field type (text, image, etc)
|
35 |
-
type: '',
|
36 |
-
|
37 |
-
// The $post->ID of this field
|
38 |
-
//ID: 0,
|
39 |
-
|
40 |
-
// The field's parent
|
41 |
-
//parent: 0,
|
42 |
-
|
43 |
-
// The menu order
|
44 |
-
//menu_order: 0
|
45 |
-
},
|
46 |
-
|
47 |
-
setup: function( $field ){
|
48 |
-
|
49 |
-
// set $el
|
50 |
-
this.$el = $field;
|
51 |
-
|
52 |
-
// inherit $field data (id, key, type)
|
53 |
-
this.inherit( $field );
|
54 |
-
|
55 |
-
// load additional props
|
56 |
-
// - this won't trigger 'changed'
|
57 |
-
this.prop('ID');
|
58 |
-
this.prop('parent');
|
59 |
-
this.prop('menu_order');
|
60 |
-
},
|
61 |
-
|
62 |
-
$input: function( name ){
|
63 |
-
return $('#' + this.getInputId() + '-' + name);
|
64 |
-
},
|
65 |
-
|
66 |
-
$meta: function(){
|
67 |
-
return this.$('.meta:first');
|
68 |
-
},
|
69 |
-
|
70 |
-
$handle: function(){
|
71 |
-
return this.$('.handle:first');
|
72 |
-
},
|
73 |
-
|
74 |
-
$settings: function(){
|
75 |
-
return this.$('.settings:first');
|
76 |
-
},
|
77 |
-
|
78 |
-
$setting: function( name ){
|
79 |
-
return this.$('.acf-field-settings:first > .acf-field-setting-' + name);
|
80 |
-
},
|
81 |
-
|
82 |
-
getParent: function(){
|
83 |
-
return acf.getFieldObjects({ child: this.$el, limit: 1 }).pop();
|
84 |
-
},
|
85 |
-
|
86 |
-
getParents: function(){
|
87 |
-
return acf.getFieldObjects({ child: this.$el });
|
88 |
-
},
|
89 |
-
|
90 |
-
getFields: function(){
|
91 |
-
return acf.getFieldObjects({ parent: this.$el });
|
92 |
-
},
|
93 |
-
|
94 |
-
getInputName: function(){
|
95 |
-
return 'acf_fields[' + this.get('id') + ']';
|
96 |
-
},
|
97 |
-
|
98 |
-
getInputId: function(){
|
99 |
-
return 'acf_fields-' + this.get('id');
|
100 |
-
},
|
101 |
-
|
102 |
-
newInput: function( name, value ){
|
103 |
-
|
104 |
-
// vars
|
105 |
-
var inputId = this.getInputId();
|
106 |
-
var inputName = this.getInputName();
|
107 |
-
|
108 |
-
// append name
|
109 |
-
if( name ) {
|
110 |
-
inputId += '-'+name;
|
111 |
-
inputName += '['+name+']';
|
112 |
-
}
|
113 |
-
|
114 |
-
// create input (avoid HTML + JSON value issues)
|
115 |
-
var $input = $('<input />').attr({
|
116 |
-
id: inputId,
|
117 |
-
name: inputName,
|
118 |
-
value: value
|
119 |
-
});
|
120 |
-
this.$('> .meta').append( $input );
|
121 |
-
|
122 |
-
// return
|
123 |
-
return $input;
|
124 |
-
},
|
125 |
-
|
126 |
-
getProp: function( name ){
|
127 |
-
|
128 |
-
// check data
|
129 |
-
if( this.has(name) ) {
|
130 |
-
return this.get(name);
|
131 |
-
}
|
132 |
-
|
133 |
-
// get input value
|
134 |
-
var $input = this.$input( name );
|
135 |
-
var value = $input.length ? $input.val() : null;
|
136 |
-
|
137 |
-
// set data silently (cache)
|
138 |
-
this.set(name, value, true);
|
139 |
-
|
140 |
-
// return
|
141 |
-
return value;
|
142 |
-
},
|
143 |
-
|
144 |
-
setProp: function( name, value ) {
|
145 |
-
|
146 |
-
// get input
|
147 |
-
var $input = this.$input( name );
|
148 |
-
var prevVal = $input.val();
|
149 |
-
|
150 |
-
// create if new
|
151 |
-
if( !$input.length ) {
|
152 |
-
$input = this.newInput( name, value );
|
153 |
-
}
|
154 |
-
|
155 |
-
// remove
|
156 |
-
if( value === null ) {
|
157 |
-
$input.remove();
|
158 |
-
|
159 |
-
// update
|
160 |
-
} else {
|
161 |
-
$input.val( value );
|
162 |
-
}
|
163 |
-
|
164 |
-
//console.log('setProp', name, value, this);
|
165 |
-
|
166 |
-
// set data silently (cache)
|
167 |
-
if( !this.has(name) ) {
|
168 |
-
//console.log('setting silently');
|
169 |
-
this.set(name, value, true);
|
170 |
-
|
171 |
-
// set data allowing 'change' event to fire
|
172 |
-
} else {
|
173 |
-
//console.log('setting loudly!');
|
174 |
-
this.set(name, value);
|
175 |
-
}
|
176 |
-
|
177 |
-
// return
|
178 |
-
return this;
|
179 |
-
|
180 |
-
},
|
181 |
-
|
182 |
-
prop: function( name, value ){
|
183 |
-
if( value !== undefined ) {
|
184 |
-
return this.setProp( name, value );
|
185 |
-
} else {
|
186 |
-
return this.getProp( name );
|
187 |
-
}
|
188 |
-
},
|
189 |
-
|
190 |
-
props: function( props ){
|
191 |
-
Object.keys( props ).map(function( key ){
|
192 |
-
this.setProp( key, props[key] );
|
193 |
-
}, this);
|
194 |
-
},
|
195 |
-
|
196 |
-
getLabel: function(){
|
197 |
-
|
198 |
-
// get label with empty default
|
199 |
-
var label = this.prop('label');
|
200 |
-
if( label === '' ) {
|
201 |
-
label = acf.__('(no label)')
|
202 |
-
}
|
203 |
-
|
204 |
-
// return
|
205 |
-
return label;
|
206 |
-
},
|
207 |
-
|
208 |
-
getName: function(){
|
209 |
-
return this.prop('name');
|
210 |
-
},
|
211 |
-
|
212 |
-
getType: function(){
|
213 |
-
return this.prop('type');
|
214 |
-
},
|
215 |
-
|
216 |
-
getTypeLabel: function(){
|
217 |
-
var type = this.prop('type');
|
218 |
-
var types = acf.get('fieldTypes');
|
219 |
-
return ( types[type] ) ? types[type].label : type;
|
220 |
-
},
|
221 |
-
|
222 |
-
getKey: function(){
|
223 |
-
return this.prop('key');
|
224 |
-
},
|
225 |
-
|
226 |
-
initialize: function(){
|
227 |
-
// do nothing
|
228 |
-
},
|
229 |
-
|
230 |
-
render: function(){
|
231 |
-
|
232 |
-
// vars
|
233 |
-
var $handle = this.$('.handle:first');
|
234 |
-
var menu_order = this.prop('menu_order');
|
235 |
-
var label = this.getLabel();
|
236 |
-
var name = this.prop('name');
|
237 |
-
var type = this.getTypeLabel();
|
238 |
-
var key = this.prop('key');
|
239 |
-
var required = this.$input('required').prop('checked');
|
240 |
-
|
241 |
-
// update menu order
|
242 |
-
$handle.find('.acf-icon').html( parseInt(menu_order) + 1 );
|
243 |
-
|
244 |
-
// update required
|
245 |
-
if( required ) {
|
246 |
-
label += ' <span class="acf-required">*</span>';
|
247 |
-
}
|
248 |
-
|
249 |
-
// update label
|
250 |
-
$handle.find('.li-field-label strong a').html( label );
|
251 |
-
|
252 |
-
// update name
|
253 |
-
$handle.find('.li-field-name').text( name );
|
254 |
-
|
255 |
-
// update type
|
256 |
-
$handle.find('.li-field-type').text( type );
|
257 |
-
|
258 |
-
// update key
|
259 |
-
$handle.find('.li-field-key').text( key );
|
260 |
-
|
261 |
-
// action for 3rd party customization
|
262 |
-
acf.doAction('render_field_object', this);
|
263 |
-
},
|
264 |
-
|
265 |
-
refresh: function(){
|
266 |
-
acf.doAction('refresh_field_object', this);
|
267 |
-
},
|
268 |
-
|
269 |
-
isOpen: function() {
|
270 |
-
return this.$el.hasClass('open');
|
271 |
-
},
|
272 |
-
|
273 |
-
onClickEdit: function( e ){
|
274 |
-
this.isOpen() ? this.close() : this.open();
|
275 |
-
},
|
276 |
-
|
277 |
-
open: function(){
|
278 |
-
|
279 |
-
// vars
|
280 |
-
var $settings = this.$el.children('.settings');
|
281 |
-
|
282 |
-
// open
|
283 |
-
$settings.slideDown();
|
284 |
-
this.$el.addClass('open');
|
285 |
-
|
286 |
-
// action (open)
|
287 |
-
acf.doAction('open_field_object', this);
|
288 |
-
this.trigger('openFieldObject');
|
289 |
-
|
290 |
-
// action (show)
|
291 |
-
acf.doAction('show', $settings);
|
292 |
-
},
|
293 |
-
|
294 |
-
close: function(){
|
295 |
-
|
296 |
-
// vars
|
297 |
-
var $settings = this.$el.children('.settings');
|
298 |
-
|
299 |
-
// close
|
300 |
-
$settings.slideUp();
|
301 |
-
this.$el.removeClass('open');
|
302 |
-
|
303 |
-
// action (close)
|
304 |
-
acf.doAction('close_field_object', this);
|
305 |
-
this.trigger('closeFieldObject');
|
306 |
-
|
307 |
-
// action (hide)
|
308 |
-
acf.doAction('hide', $settings);
|
309 |
-
},
|
310 |
-
|
311 |
-
serialize: function(){
|
312 |
-
return acf.serialize( this.$el, this.getInputName() );
|
313 |
-
},
|
314 |
-
|
315 |
-
save: function( type ){
|
316 |
-
|
317 |
-
// defaults
|
318 |
-
type = type || 'settings'; // meta, settings
|
319 |
-
|
320 |
-
// vars
|
321 |
-
var save = this.getProp('save');
|
322 |
-
|
323 |
-
// bail if already saving settings
|
324 |
-
if( save === 'settings' ) {
|
325 |
-
return;
|
326 |
-
}
|
327 |
-
|
328 |
-
// prop
|
329 |
-
this.setProp('save', type);
|
330 |
-
|
331 |
-
// debug
|
332 |
-
this.$el.attr('data-save', type);
|
333 |
-
|
334 |
-
// action
|
335 |
-
acf.doAction('save_field_object', this, type);
|
336 |
-
},
|
337 |
-
|
338 |
-
submit: function(){
|
339 |
-
|
340 |
-
// vars
|
341 |
-
var inputName = this.getInputName();
|
342 |
-
var save = this.get('save');
|
343 |
-
|
344 |
-
// close
|
345 |
-
if( this.isOpen() ) {
|
346 |
-
this.close();
|
347 |
-
}
|
348 |
-
|
349 |
-
// allow all inputs to save
|
350 |
-
if( save == 'settings' ) {
|
351 |
-
// do nothing
|
352 |
-
|
353 |
-
// allow only meta inputs to save
|
354 |
-
} else if( save == 'meta' ) {
|
355 |
-
this.$('> .settings [name^="' + inputName + '"]').remove();
|
356 |
-
|
357 |
-
// prevent all inputs from saving
|
358 |
-
} else {
|
359 |
-
this.$('[name^="' + inputName + '"]').remove();
|
360 |
-
}
|
361 |
-
|
362 |
-
// action
|
363 |
-
acf.doAction('submit_field_object', this);
|
364 |
-
},
|
365 |
-
|
366 |
-
onChange: function( e, $el ){
|
367 |
-
|
368 |
-
// save settings
|
369 |
-
this.save();
|
370 |
-
|
371 |
-
// action for 3rd party customization
|
372 |
-
acf.doAction('change_field_object', this);
|
373 |
-
},
|
374 |
-
|
375 |
-
onChanged: function( e, $el, name, value ){
|
376 |
-
|
377 |
-
// ignore 'save'
|
378 |
-
if( name == 'save' ) {
|
379 |
-
return;
|
380 |
-
}
|
381 |
-
|
382 |
-
// save meta
|
383 |
-
if( ['menu_order', 'parent'].indexOf(name) > -1 ) {
|
384 |
-
this.save('meta');
|
385 |
-
|
386 |
-
// save field
|
387 |
-
} else {
|
388 |
-
this.save();
|
389 |
-
}
|
390 |
-
|
391 |
-
// render
|
392 |
-
if( ['menu_order', 'label', 'required', 'name', 'type', 'key'].indexOf(name) > -1 ) {
|
393 |
-
this.render();
|
394 |
-
}
|
395 |
-
|
396 |
-
// action for 3rd party customization
|
397 |
-
acf.doAction('change_field_object_' + name, this, value);
|
398 |
-
},
|
399 |
-
|
400 |
-
onChangeLabel: function( e, $el ){
|
401 |
-
|
402 |
-
// set
|
403 |
-
var label = $el.val();
|
404 |
-
this.set('label', label);
|
405 |
-
|
406 |
-
// render name
|
407 |
-
if( this.prop('name') == '' ) {
|
408 |
-
var name = acf.applyFilters('generate_field_object_name', acf.strSanitize(label), this);
|
409 |
-
this.prop('name', name);
|
410 |
-
}
|
411 |
-
},
|
412 |
-
|
413 |
-
onChangeName: function( e, $el){
|
414 |
-
|
415 |
-
// set
|
416 |
-
var name = $el.val();
|
417 |
-
this.set('name', name);
|
418 |
-
|
419 |
-
// error
|
420 |
-
if( name.substr(0, 6) === 'field_' ) {
|
421 |
-
alert( acf.__('The string "field_" may not be used at the start of a field name') );
|
422 |
-
}
|
423 |
-
},
|
424 |
-
|
425 |
-
onChangeRequired: function( e, $el ){
|
426 |
-
|
427 |
-
// set
|
428 |
-
var required = $el.prop('checked') ? 1 : 0;
|
429 |
-
this.set('required', required);
|
430 |
-
},
|
431 |
-
|
432 |
-
delete: function( args ){
|
433 |
-
|
434 |
-
// defaults
|
435 |
-
args = acf.parseArgs(args, {
|
436 |
-
animate: true
|
437 |
-
});
|
438 |
-
|
439 |
-
// add to remove list
|
440 |
-
var id = this.prop('ID');
|
441 |
-
|
442 |
-
if( id ) {
|
443 |
-
var $input = $('#_acf_delete_fields');
|
444 |
-
var newVal = $input.val() + '|' + id;
|
445 |
-
$input.val( newVal );
|
446 |
-
}
|
447 |
-
|
448 |
-
// action
|
449 |
-
acf.doAction('delete_field_object', this);
|
450 |
-
|
451 |
-
// animate
|
452 |
-
if( args.animate ) {
|
453 |
-
this.removeAnimate();
|
454 |
-
} else {
|
455 |
-
this.remove();
|
456 |
-
}
|
457 |
-
},
|
458 |
-
|
459 |
-
onClickDelete: function( e, $el ){
|
460 |
-
|
461 |
-
// add class
|
462 |
-
this.$el.addClass('-hover');
|
463 |
-
|
464 |
-
// add tooltip
|
465 |
-
var self = this;
|
466 |
-
var tooltip = acf.newTooltip({
|
467 |
-
confirmRemove: true,
|
468 |
-
target: $el,
|
469 |
-
confirm: function(){
|
470 |
-
self.delete( true );
|
471 |
-
},
|
472 |
-
cancel: function(){
|
473 |
-
self.$el.removeClass('-hover');
|
474 |
-
}
|
475 |
-
});
|
476 |
-
},
|
477 |
-
|
478 |
-
removeAnimate: function(){
|
479 |
-
|
480 |
-
// vars
|
481 |
-
var field = this;
|
482 |
-
var $list = this.$el.parent();
|
483 |
-
var $fields = acf.findFieldObjects({
|
484 |
-
sibling: this.$el
|
485 |
-
});
|
486 |
-
|
487 |
-
// remove
|
488 |
-
acf.remove({
|
489 |
-
target: this.$el,
|
490 |
-
endHeight: $fields.length ? 0 : 50,
|
491 |
-
complete: function(){
|
492 |
-
field.remove();
|
493 |
-
acf.doAction('removed_field_object', field, $list);
|
494 |
-
}
|
495 |
-
});
|
496 |
-
|
497 |
-
// action
|
498 |
-
acf.doAction('remove_field_object', field, $list);
|
499 |
-
},
|
500 |
-
|
501 |
-
duplicate: function(){
|
502 |
-
|
503 |
-
// vars
|
504 |
-
var newKey = acf.uniqid('field_');
|
505 |
-
|
506 |
-
// duplicate
|
507 |
-
var $newField = acf.duplicate({
|
508 |
-
target: this.$el,
|
509 |
-
search: this.get('id'),
|
510 |
-
replace: newKey,
|
511 |
-
});
|
512 |
-
|
513 |
-
// set new key
|
514 |
-
$newField.attr('data-key', newKey);
|
515 |
-
|
516 |
-
// get instance
|
517 |
-
var newField = acf.getFieldObject( $newField );
|
518 |
-
|
519 |
-
// open / close
|
520 |
-
if( this.isOpen() ) {
|
521 |
-
this.close();
|
522 |
-
} else {
|
523 |
-
newField.open();
|
524 |
-
}
|
525 |
-
|
526 |
-
// focus label
|
527 |
-
var $label = newField.$setting('label input');
|
528 |
-
setTimeout(function(){
|
529 |
-
$label.focus();
|
530 |
-
}, 251);
|
531 |
-
|
532 |
-
// update newField label / name
|
533 |
-
var label = newField.prop('label');
|
534 |
-
var name = newField.prop('name');
|
535 |
-
var end = name.split('_').pop();
|
536 |
-
var copy = acf.__('copy');
|
537 |
-
|
538 |
-
// increase suffix "1"
|
539 |
-
if( $.isNumeric(end) ) {
|
540 |
-
var i = (end*1) + 1;
|
541 |
-
label = label.replace( end, i );
|
542 |
-
name = name.replace( end, i );
|
543 |
-
|
544 |
-
// increase suffix "(copy1)"
|
545 |
-
} else if( end.indexOf(copy) === 0 ) {
|
546 |
-
var i = end.replace(copy, '') * 1;
|
547 |
-
i = i ? i+1 : 2;
|
548 |
-
|
549 |
-
// replace
|
550 |
-
label = label.replace( end, copy + i );
|
551 |
-
name = name.replace( end, copy + i );
|
552 |
-
|
553 |
-
// add default "(copy)"
|
554 |
-
} else {
|
555 |
-
label += ' (' + copy + ')';
|
556 |
-
name += '_' + copy;
|
557 |
-
}
|
558 |
-
|
559 |
-
newField.prop('ID', 0);
|
560 |
-
newField.prop('label', label);
|
561 |
-
newField.prop('name', name);
|
562 |
-
newField.prop('key', newKey);
|
563 |
-
|
564 |
-
// action
|
565 |
-
acf.doAction('duplicate_field_object', this, newField);
|
566 |
-
acf.doAction('append_field_object', newField);
|
567 |
-
},
|
568 |
-
|
569 |
-
wipe: function(){
|
570 |
-
|
571 |
-
// vars
|
572 |
-
var prevId = this.get('id');
|
573 |
-
var prevKey = this.get('key');
|
574 |
-
var newKey = acf.uniqid('field_');
|
575 |
-
|
576 |
-
// rename
|
577 |
-
acf.rename({
|
578 |
-
target: this.$el,
|
579 |
-
search: prevId,
|
580 |
-
replace: newKey,
|
581 |
-
});
|
582 |
-
|
583 |
-
// data
|
584 |
-
this.set('id', newKey);
|
585 |
-
this.set('prevId', prevId);
|
586 |
-
this.set('prevKey', prevKey);
|
587 |
-
|
588 |
-
// props
|
589 |
-
this.prop('key', newKey);
|
590 |
-
this.prop('ID', 0);
|
591 |
-
|
592 |
-
// attr
|
593 |
-
this.$el.attr('data-key', newKey);
|
594 |
-
this.$el.attr('data-id', newKey);
|
595 |
-
|
596 |
-
// action
|
597 |
-
acf.doAction('wipe_field_object', this);
|
598 |
-
},
|
599 |
-
|
600 |
-
move: function(){
|
601 |
-
|
602 |
-
// helper
|
603 |
-
var hasChanged = function( field ){
|
604 |
-
return (field.get('save') == 'settings');
|
605 |
-
};
|
606 |
-
|
607 |
-
// vars
|
608 |
-
var changed = hasChanged(this);
|
609 |
-
|
610 |
-
// has sub fields changed
|
611 |
-
if( !changed ) {
|
612 |
-
acf.getFieldObjects({
|
613 |
-
parent: this.$el
|
614 |
-
}).map(function( field ){
|
615 |
-
changed = hasChanged(field) || field.changed;
|
616 |
-
});
|
617 |
-
}
|
618 |
-
|
619 |
-
// bail early if changed
|
620 |
-
if( changed ) {
|
621 |
-
alert( acf.__('This field cannot be moved until its changes have been saved') );
|
622 |
-
return;
|
623 |
-
}
|
624 |
-
|
625 |
-
// step 1.
|
626 |
-
var id = this.prop('ID');
|
627 |
-
var field = this;
|
628 |
-
var popup = false;
|
629 |
-
var step1 = function(){
|
630 |
-
|
631 |
-
// popup
|
632 |
-
popup = acf.newPopup({
|
633 |
-
title: acf.__('Move Custom Field'),
|
634 |
-
loading: true,
|
635 |
-
width: '300px'
|
636 |
-
});
|
637 |
-
|
638 |
-
// ajax
|
639 |
-
var ajaxData = {
|
640 |
-
action: 'acf/field_group/move_field',
|
641 |
-
field_id: id
|
642 |
-
};
|
643 |
-
|
644 |
-
// get HTML
|
645 |
-
$.ajax({
|
646 |
-
url: acf.get('ajaxurl'),
|
647 |
-
data: acf.prepareForAjax(ajaxData),
|
648 |
-
type: 'post',
|
649 |
-
dataType: 'html',
|
650 |
-
success: step2
|
651 |
-
});
|
652 |
-
};
|
653 |
-
|
654 |
-
var step2 = function( html ){
|
655 |
-
|
656 |
-
// update popup
|
657 |
-
popup.loading(false);
|
658 |
-
popup.content(html);
|
659 |
-
|
660 |
-
// submit form
|
661 |
-
popup.on('submit', 'form', step3);
|
662 |
-
};
|
663 |
-
|
664 |
-
var step3 = function( e, $el ){
|
665 |
-
|
666 |
-
// prevent
|
667 |
-
e.preventDefault();
|
668 |
-
|
669 |
-
// disable
|
670 |
-
acf.startButtonLoading( popup.$('.button') );
|
671 |
-
|
672 |
-
// ajax
|
673 |
-
var ajaxData = {
|
674 |
-
action: 'acf/field_group/move_field',
|
675 |
-
field_id: id,
|
676 |
-
field_group_id: popup.$('select').val()
|
677 |
-
};
|
678 |
-
|
679 |
-
// get HTML
|
680 |
-
$.ajax({
|
681 |
-
url: acf.get('ajaxurl'),
|
682 |
-
data: acf.prepareForAjax(ajaxData),
|
683 |
-
type: 'post',
|
684 |
-
dataType: 'html',
|
685 |
-
success: step4
|
686 |
-
});
|
687 |
-
};
|
688 |
-
|
689 |
-
var step4 = function( html ){
|
690 |
-
|
691 |
-
// update popup
|
692 |
-
popup.content(html);
|
693 |
-
|
694 |
-
// remove element
|
695 |
-
field.removeAnimate();
|
696 |
-
};
|
697 |
-
|
698 |
-
// start
|
699 |
-
step1();
|
700 |
-
|
701 |
-
},
|
702 |
-
|
703 |
-
onChangeType: function( e, $el ){
|
704 |
-
|
705 |
-
// clea previous timout
|
706 |
-
if( this.changeTimeout ) {
|
707 |
-
clearTimeout(this.changeTimeout);
|
708 |
-
}
|
709 |
-
|
710 |
-
// set new timeout
|
711 |
-
// - prevents changing type multiple times whilst user types in newType
|
712 |
-
this.changeTimeout = this.setTimeout(function(){
|
713 |
-
this.changeType( $el.val() );
|
714 |
-
}, 300);
|
715 |
-
},
|
716 |
-
|
717 |
-
changeType: function( newType ){
|
718 |
-
|
719 |
-
// vars
|
720 |
-
var prevType = this.prop('type');
|
721 |
-
var prevClass = acf.strSlugify( 'acf-field-object-' + prevType );
|
722 |
-
var newClass = acf.strSlugify( 'acf-field-object-' + newType );
|
723 |
-
|
724 |
-
// update props
|
725 |
-
this.$el.removeClass(prevClass).addClass(newClass);
|
726 |
-
this.$el.attr('data-type', newType);
|
727 |
-
this.$el.data('type', newType);
|
728 |
-
|
729 |
-
// abort XHR if this field is already loading AJAX data
|
730 |
-
if( this.has('xhr') ) {
|
731 |
-
this.get('xhr').abort();
|
732 |
-
}
|
733 |
-
|
734 |
-
// store settings
|
735 |
-
var $tbody = this.$('> .settings > table > tbody');
|
736 |
-
var $settings = $tbody.children('[data-setting="' + prevType + '"]');
|
737 |
-
this.set( 'settings-' + prevType, $settings );
|
738 |
-
$settings.detach();
|
739 |
-
|
740 |
-
// show settings
|
741 |
-
if( this.has('settings-' + newType) ) {
|
742 |
-
var $newSettings = this.get('settings-' + newType);
|
743 |
-
this.$setting('conditional_logic').before( $newSettings );
|
744 |
-
this.set('type', newType);
|
745 |
-
//this.refresh();
|
746 |
-
return;
|
747 |
-
}
|
748 |
-
|
749 |
-
// load settings
|
750 |
-
var $loading = $('<tr class="acf-field"><td class="acf-label"></td><td class="acf-input"><div class="acf-loading"></div></td></tr>');
|
751 |
-
this.$setting('conditional_logic').before( $loading );
|
752 |
-
|
753 |
-
// ajax
|
754 |
-
var ajaxData = {
|
755 |
-
action: 'acf/field_group/render_field_settings',
|
756 |
-
field: this.serialize(),
|
757 |
-
prefix: this.getInputName()
|
758 |
-
};
|
759 |
-
|
760 |
-
// ajax
|
761 |
-
var xhr = $.ajax({
|
762 |
-
url: acf.get('ajaxurl'),
|
763 |
-
data: acf.prepareForAjax(ajaxData),
|
764 |
-
type: 'post',
|
765 |
-
dataType: 'html',
|
766 |
-
context: this,
|
767 |
-
success: function( html ){
|
768 |
-
|
769 |
-
// bail early if no settings
|
770 |
-
if( !html ) return;
|
771 |
-
|
772 |
-
// append settings
|
773 |
-
$loading.after( html );
|
774 |
-
|
775 |
-
// events
|
776 |
-
acf.doAction('append', $tbody);
|
777 |
-
},
|
778 |
-
complete: function(){
|
779 |
-
// also triggered by xhr.abort();
|
780 |
-
$loading.remove();
|
781 |
-
this.set('type', newType);
|
782 |
-
//this.refresh();
|
783 |
-
}
|
784 |
-
});
|
785 |
-
|
786 |
-
// set
|
787 |
-
this.set('xhr', xhr);
|
788 |
-
|
789 |
-
},
|
790 |
-
|
791 |
-
updateParent: function(){
|
792 |
-
|
793 |
-
// vars
|
794 |
-
var ID = acf.get('post_id');
|
795 |
-
|
796 |
-
// check parent
|
797 |
-
var parent = this.getParent();
|
798 |
-
if( parent ) {
|
799 |
-
ID = parseInt(parent.prop('ID')) || parent.prop('key');
|
800 |
-
}
|
801 |
-
|
802 |
-
// update
|
803 |
-
this.prop('parent', ID);
|
804 |
-
}
|
805 |
-
|
806 |
-
});
|
807 |
-
|
808 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/build/js/_field-group-fields.js
DELETED
@@ -1,468 +0,0 @@
|
|
1 |
-
(function($, undefined){
|
2 |
-
|
3 |
-
/**
|
4 |
-
* acf.findFieldObject
|
5 |
-
*
|
6 |
-
* Returns a single fieldObject $el for a given field key
|
7 |
-
*
|
8 |
-
* @date 1/2/18
|
9 |
-
* @since 5.7.0
|
10 |
-
*
|
11 |
-
* @param string key The field key
|
12 |
-
* @return jQuery
|
13 |
-
*/
|
14 |
-
|
15 |
-
acf.findFieldObject = function( key ){
|
16 |
-
return acf.findFieldObjects({
|
17 |
-
key: key,
|
18 |
-
limit: 1
|
19 |
-
});
|
20 |
-
};
|
21 |
-
|
22 |
-
/**
|
23 |
-
* acf.findFieldObjects
|
24 |
-
*
|
25 |
-
* Returns an array of fieldObject $el for the given args
|
26 |
-
*
|
27 |
-
* @date 1/2/18
|
28 |
-
* @since 5.7.0
|
29 |
-
*
|
30 |
-
* @param object args
|
31 |
-
* @return jQuery
|
32 |
-
*/
|
33 |
-
|
34 |
-
acf.findFieldObjects = function( args ){
|
35 |
-
|
36 |
-
// vars
|
37 |
-
args = args || {};
|
38 |
-
var selector = '.acf-field-object';
|
39 |
-
var $fields = false;
|
40 |
-
|
41 |
-
// args
|
42 |
-
args = acf.parseArgs(args, {
|
43 |
-
id: '',
|
44 |
-
key: '',
|
45 |
-
type: '',
|
46 |
-
limit: false,
|
47 |
-
list: null,
|
48 |
-
parent: false,
|
49 |
-
sibling: false,
|
50 |
-
child: false,
|
51 |
-
});
|
52 |
-
|
53 |
-
// id
|
54 |
-
if( args.id ) {
|
55 |
-
selector += '[data-id="' + args.id + '"]';
|
56 |
-
}
|
57 |
-
|
58 |
-
// key
|
59 |
-
if( args.key ) {
|
60 |
-
selector += '[data-key="' + args.key + '"]';
|
61 |
-
}
|
62 |
-
|
63 |
-
// type
|
64 |
-
if( args.type ) {
|
65 |
-
selector += '[data-type="' + args.type + '"]';
|
66 |
-
}
|
67 |
-
|
68 |
-
// query
|
69 |
-
if( args.list ) {
|
70 |
-
$fields = args.list.children( selector );
|
71 |
-
} else if( args.parent ) {
|
72 |
-
$fields = args.parent.find( selector );
|
73 |
-
} else if( args.sibling ) {
|
74 |
-
$fields = args.sibling.siblings( selector );
|
75 |
-
} else if( args.child ) {
|
76 |
-
$fields = args.child.parents( selector );
|
77 |
-
} else {
|
78 |
-
$fields = $( selector );
|
79 |
-
}
|
80 |
-
|
81 |
-
// limit
|
82 |
-
if( args.limit ) {
|
83 |
-
$fields = $fields.slice( 0, args.limit );
|
84 |
-
}
|
85 |
-
|
86 |
-
// return
|
87 |
-
return $fields;
|
88 |
-
};
|
89 |
-
|
90 |
-
/**
|
91 |
-
* acf.getFieldObject
|
92 |
-
*
|
93 |
-
* Returns a single fieldObject instance for a given $el|key
|
94 |
-
*
|
95 |
-
* @date 1/2/18
|
96 |
-
* @since 5.7.0
|
97 |
-
*
|
98 |
-
* @param string|jQuery $field The field $el or key
|
99 |
-
* @return jQuery
|
100 |
-
*/
|
101 |
-
|
102 |
-
acf.getFieldObject = function( $field ){
|
103 |
-
|
104 |
-
// allow key
|
105 |
-
if( typeof $field === 'string' ) {
|
106 |
-
$field = acf.findFieldObject( $field );
|
107 |
-
}
|
108 |
-
|
109 |
-
// instantiate
|
110 |
-
var field = $field.data('acf');
|
111 |
-
if( !field ) {
|
112 |
-
field = acf.newFieldObject( $field );
|
113 |
-
}
|
114 |
-
|
115 |
-
// return
|
116 |
-
return field;
|
117 |
-
};
|
118 |
-
|
119 |
-
/**
|
120 |
-
* acf.getFieldObjects
|
121 |
-
*
|
122 |
-
* Returns an array of fieldObject instances for the given args
|
123 |
-
*
|
124 |
-
* @date 1/2/18
|
125 |
-
* @since 5.7.0
|
126 |
-
*
|
127 |
-
* @param object args
|
128 |
-
* @return array
|
129 |
-
*/
|
130 |
-
|
131 |
-
acf.getFieldObjects = function( args ){
|
132 |
-
|
133 |
-
// query
|
134 |
-
var $fields = acf.findFieldObjects( args );
|
135 |
-
|
136 |
-
// loop
|
137 |
-
var fields = [];
|
138 |
-
$fields.each(function(){
|
139 |
-
var field = acf.getFieldObject( $(this) );
|
140 |
-
fields.push( field );
|
141 |
-
});
|
142 |
-
|
143 |
-
// return
|
144 |
-
return fields;
|
145 |
-
};
|
146 |
-
|
147 |
-
/**
|
148 |
-
* acf.newFieldObject
|
149 |
-
*
|
150 |
-
* Initializes and returns a new FieldObject instance
|
151 |
-
*
|
152 |
-
* @date 1/2/18
|
153 |
-
* @since 5.7.0
|
154 |
-
*
|
155 |
-
* @param jQuery $field The field $el
|
156 |
-
* @return object
|
157 |
-
*/
|
158 |
-
|
159 |
-
acf.newFieldObject = function( $field ){
|
160 |
-
|
161 |
-
// instantiate
|
162 |
-
var field = new acf.FieldObject( $field );
|
163 |
-
|
164 |
-
// action
|
165 |
-
acf.doAction('new_field_object', field);
|
166 |
-
|
167 |
-
// return
|
168 |
-
return field;
|
169 |
-
};
|
170 |
-
|
171 |
-
/**
|
172 |
-
* actionManager
|
173 |
-
*
|
174 |
-
* description
|
175 |
-
*
|
176 |
-
* @date 15/12/17
|
177 |
-
* @since 5.6.5
|
178 |
-
*
|
179 |
-
* @param type $var Description. Default.
|
180 |
-
* @return type Description.
|
181 |
-
*/
|
182 |
-
|
183 |
-
var eventManager = new acf.Model({
|
184 |
-
|
185 |
-
priority: 5,
|
186 |
-
|
187 |
-
initialize: function(){
|
188 |
-
|
189 |
-
// actions
|
190 |
-
var actions = [
|
191 |
-
'prepare',
|
192 |
-
'ready',
|
193 |
-
'append',
|
194 |
-
'remove'
|
195 |
-
];
|
196 |
-
|
197 |
-
// loop
|
198 |
-
actions.map(function( action ){
|
199 |
-
this.addFieldActions( action );
|
200 |
-
}, this);
|
201 |
-
},
|
202 |
-
|
203 |
-
addFieldActions: function( action ){
|
204 |
-
|
205 |
-
// vars
|
206 |
-
var pluralAction = action + '_field_objects'; // ready_field_objects
|
207 |
-
var singleAction = action + '_field_object'; // ready_field_object
|
208 |
-
var singleEvent = action + 'FieldObject'; // readyFieldObject
|
209 |
-
|
210 |
-
// global action
|
211 |
-
var callback = function( $el /*, arg1, arg2, etc*/ ){
|
212 |
-
|
213 |
-
// vars
|
214 |
-
var fieldObjects = acf.getFieldObjects({ parent: $el });
|
215 |
-
|
216 |
-
// call plural
|
217 |
-
if( fieldObjects.length ) {
|
218 |
-
|
219 |
-
/// get args [$el, arg1]
|
220 |
-
var args = acf.arrayArgs( arguments );
|
221 |
-
|
222 |
-
// modify args [pluralAction, fields, arg1]
|
223 |
-
args.splice(0, 1, pluralAction, fieldObjects);
|
224 |
-
acf.doAction.apply(null, args);
|
225 |
-
}
|
226 |
-
};
|
227 |
-
|
228 |
-
// plural action
|
229 |
-
var pluralCallback = function( fieldObjects /*, arg1, arg2, etc*/ ){
|
230 |
-
|
231 |
-
/// get args [fields, arg1]
|
232 |
-
var args = acf.arrayArgs( arguments );
|
233 |
-
|
234 |
-
// modify args [singleAction, fields, arg1]
|
235 |
-
args.unshift(singleAction);
|
236 |
-
|
237 |
-
// loop
|
238 |
-
fieldObjects.map(function( fieldObject ){
|
239 |
-
|
240 |
-
// modify args [singleAction, field, arg1]
|
241 |
-
args[1] = fieldObject;
|
242 |
-
acf.doAction.apply(null, args);
|
243 |
-
});
|
244 |
-
};
|
245 |
-
|
246 |
-
// single action
|
247 |
-
var singleCallback = function( fieldObject /*, arg1, arg2, etc*/ ){
|
248 |
-
|
249 |
-
/// get args [$field, arg1]
|
250 |
-
var args = acf.arrayArgs( arguments );
|
251 |
-
|
252 |
-
// modify args [singleAction, $field, arg1]
|
253 |
-
args.unshift(singleAction);
|
254 |
-
|
255 |
-
// action variations (ready_field/type=image)
|
256 |
-
var variations = ['type', 'name', 'key'];
|
257 |
-
variations.map(function( variation ){
|
258 |
-
args[0] = singleAction + '/' + variation + '=' + fieldObject.get(variation);
|
259 |
-
acf.doAction.apply(null, args);
|
260 |
-
});
|
261 |
-
|
262 |
-
// modify args [arg1]
|
263 |
-
args.splice(0, 2);
|
264 |
-
|
265 |
-
// event
|
266 |
-
fieldObject.trigger(singleEvent, args);
|
267 |
-
};
|
268 |
-
|
269 |
-
// add actions
|
270 |
-
acf.addAction(action, callback, 5);
|
271 |
-
acf.addAction(pluralAction, pluralCallback, 5);
|
272 |
-
acf.addAction(singleAction, singleCallback, 5);
|
273 |
-
|
274 |
-
}
|
275 |
-
});
|
276 |
-
|
277 |
-
/**
|
278 |
-
* fieldManager
|
279 |
-
*
|
280 |
-
* description
|
281 |
-
*
|
282 |
-
* @date 4/1/18
|
283 |
-
* @since 5.6.5
|
284 |
-
*
|
285 |
-
* @param type $var Description. Default.
|
286 |
-
* @return type Description.
|
287 |
-
*/
|
288 |
-
|
289 |
-
var fieldManager = new acf.Model({
|
290 |
-
|
291 |
-
id: 'fieldManager',
|
292 |
-
|
293 |
-
events: {
|
294 |
-
'submit #post': 'onSubmit',
|
295 |
-
'mouseenter .acf-field-list': 'onHoverSortable',
|
296 |
-
'click .add-field': 'onClickAdd',
|
297 |
-
},
|
298 |
-
|
299 |
-
actions: {
|
300 |
-
'removed_field_object': 'onRemovedField',
|
301 |
-
'sortstop_field_object': 'onReorderField',
|
302 |
-
'delete_field_object': 'onDeleteField',
|
303 |
-
'change_field_object_type': 'onChangeFieldType',
|
304 |
-
'duplicate_field_object': 'onDuplicateField'
|
305 |
-
},
|
306 |
-
|
307 |
-
onSubmit: function( e, $el ){
|
308 |
-
|
309 |
-
// vars
|
310 |
-
var fields = acf.getFieldObjects();
|
311 |
-
|
312 |
-
// loop
|
313 |
-
fields.map(function( field ){
|
314 |
-
field.submit();
|
315 |
-
});
|
316 |
-
},
|
317 |
-
|
318 |
-
setFieldMenuOrder: function( field ){
|
319 |
-
this.renderFields( field.$el.parent() );
|
320 |
-
},
|
321 |
-
|
322 |
-
onHoverSortable: function( e, $el ){
|
323 |
-
|
324 |
-
// bail early if already sortable
|
325 |
-
if( $el.hasClass('ui-sortable') ) return;
|
326 |
-
|
327 |
-
// sortable
|
328 |
-
$el.sortable({
|
329 |
-
handle: '.acf-sortable-handle',
|
330 |
-
connectWith: '.acf-field-list',
|
331 |
-
start: function( e, ui ){
|
332 |
-
var field = acf.getFieldObject( ui.item );
|
333 |
-
ui.placeholder.height( ui.item.height() );
|
334 |
-
acf.doAction('sortstart_field_object', field, $el);
|
335 |
-
},
|
336 |
-
update: function( e, ui ){
|
337 |
-
var field = acf.getFieldObject( ui.item );
|
338 |
-
acf.doAction('sortstop_field_object', field, $el);
|
339 |
-
}
|
340 |
-
});
|
341 |
-
},
|
342 |
-
|
343 |
-
onRemovedField: function( field, $list ){
|
344 |
-
this.renderFields( $list );
|
345 |
-
},
|
346 |
-
|
347 |
-
onReorderField: function( field, $list ){
|
348 |
-
field.updateParent();
|
349 |
-
this.renderFields( $list );
|
350 |
-
},
|
351 |
-
|
352 |
-
onDeleteField: function( field ){
|
353 |
-
|
354 |
-
// delete children
|
355 |
-
field.getFields().map(function( child ){
|
356 |
-
child.delete({ animate: false });
|
357 |
-
});
|
358 |
-
},
|
359 |
-
|
360 |
-
onChangeFieldType: function( field ){
|
361 |
-
// this caused sub fields to disapear if changing type back...
|
362 |
-
//this.onDeleteField( field );
|
363 |
-
},
|
364 |
-
|
365 |
-
onDuplicateField: function( field, newField ){
|
366 |
-
|
367 |
-
// check for children
|
368 |
-
var children = newField.getFields();
|
369 |
-
if( children.length ) {
|
370 |
-
|
371 |
-
// loop
|
372 |
-
children.map(function( child ){
|
373 |
-
|
374 |
-
// wipe field
|
375 |
-
child.wipe();
|
376 |
-
|
377 |
-
// update parent
|
378 |
-
child.updateParent();
|
379 |
-
});
|
380 |
-
|
381 |
-
// action
|
382 |
-
acf.doAction('duplicate_field_objects', children, newField, field);
|
383 |
-
}
|
384 |
-
|
385 |
-
// set menu order
|
386 |
-
this.setFieldMenuOrder( newField );
|
387 |
-
},
|
388 |
-
|
389 |
-
renderFields: function( $list ){
|
390 |
-
|
391 |
-
// vars
|
392 |
-
var fields = acf.getFieldObjects({
|
393 |
-
list: $list
|
394 |
-
});
|
395 |
-
|
396 |
-
// no fields
|
397 |
-
if( !fields.length ) {
|
398 |
-
$list.addClass('-empty');
|
399 |
-
return;
|
400 |
-
}
|
401 |
-
|
402 |
-
// has fields
|
403 |
-
$list.removeClass('-empty');
|
404 |
-
|
405 |
-
// prop
|
406 |
-
fields.map(function( field, i ){
|
407 |
-
field.prop('menu_order', i);
|
408 |
-
});
|
409 |
-
},
|
410 |
-
|
411 |
-
onClickAdd: function( e, $el ){
|
412 |
-
var $list = $el.closest('.acf-tfoot').siblings('.acf-field-list');
|
413 |
-
this.addField( $list );
|
414 |
-
},
|
415 |
-
|
416 |
-
addField: function( $list ){
|
417 |
-
|
418 |
-
// vars
|
419 |
-
var html = $('#tmpl-acf-field').html();
|
420 |
-
var $el = $(html);
|
421 |
-
var prevId = $el.data('id');
|
422 |
-
var newKey = acf.uniqid('field_');
|
423 |
-
|
424 |
-
// duplicate
|
425 |
-
var $newField = acf.duplicate({
|
426 |
-
target: $el,
|
427 |
-
search: prevId,
|
428 |
-
replace: newKey,
|
429 |
-
append: function( $el, $el2 ){
|
430 |
-
$list.append( $el2 );
|
431 |
-
}
|
432 |
-
});
|
433 |
-
|
434 |
-
// get instance
|
435 |
-
var newField = acf.getFieldObject( $newField );
|
436 |
-
|
437 |
-
// props
|
438 |
-
newField.prop('key', newKey);
|
439 |
-
newField.prop('ID', 0);
|
440 |
-
newField.prop('label', '');
|
441 |
-
newField.prop('name', '');
|
442 |
-
|
443 |
-
// attr
|
444 |
-
$newField.attr('data-key', newKey);
|
445 |
-
$newField.attr('data-id', newKey);
|
446 |
-
|
447 |
-
// update parent prop
|
448 |
-
newField.updateParent();
|
449 |
-
|
450 |
-
// focus label
|
451 |
-
var $label = newField.$input('label');
|
452 |
-
setTimeout(function(){
|
453 |
-
$label.focus();
|
454 |
-
}, 251);
|
455 |
-
|
456 |
-
// open
|
457 |
-
newField.open();
|
458 |
-
|
459 |
-
// set menu order
|
460 |
-
this.renderFields( $list );
|
461 |
-
|
462 |
-
// action
|
463 |
-
acf.doAction('add_field_object', newField);
|
464 |
-
acf.doAction('append_field_object', newField);
|
465 |
-
}
|
466 |
-
});
|
467 |
-
|
468 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/build/js/_field-group-locations.js
DELETED
@@ -1,104 +0,0 @@
|
|
1 |
-
(function($, undefined){
|
2 |
-
|
3 |
-
/**
|
4 |
-
* locationManager
|
5 |
-
*
|
6 |
-
* Field group location rules functionality
|
7 |
-
*
|
8 |
-
* @date 15/12/17
|
9 |
-
* @since 5.7.0
|
10 |
-
*
|
11 |
-
* @param void
|
12 |
-
* @return void
|
13 |
-
*/
|
14 |
-
|
15 |
-
var locationManager = new acf.Model({
|
16 |
-
|
17 |
-
id: 'locationManager',
|
18 |
-
wait: 'ready',
|
19 |
-
|
20 |
-
events: {
|
21 |
-
'click .add-location-rule': 'onClickAddRule',
|
22 |
-
'click .add-location-group': 'onClickAddGroup',
|
23 |
-
'click .remove-location-rule': 'onClickRemoveRule',
|
24 |
-
'change .refresh-location-rule': 'onChangeRemoveRule'
|
25 |
-
},
|
26 |
-
|
27 |
-
initialize: function(){
|
28 |
-
this.$el = $('#acf-field-group-locations');
|
29 |
-
},
|
30 |
-
|
31 |
-
onClickAddRule: function( e, $el ){
|
32 |
-
this.addRule( $el.closest('tr') );
|
33 |
-
},
|
34 |
-
|
35 |
-
onClickRemoveRule: function( e, $el ){
|
36 |
-
this.removeRule( $el.closest('tr') );
|
37 |
-
},
|
38 |
-
|
39 |
-
onChangeRemoveRule: function( e, $el ){
|
40 |
-
this.changeRule( $el.closest('tr') );
|
41 |
-
},
|
42 |
-
|
43 |
-
onClickAddGroup: function( e, $el ){
|
44 |
-
this.addGroup();
|
45 |
-
},
|
46 |
-
|
47 |
-
addRule: function( $tr ){
|
48 |
-
acf.duplicate( $tr );
|
49 |
-
},
|
50 |
-
|
51 |
-
removeRule: function( $tr ){
|
52 |
-
if( $tr.siblings('tr').length == 0 ) {
|
53 |
-
$tr.closest('.rule-group').remove();
|
54 |
-
} else {
|
55 |
-
$tr.remove();
|
56 |
-
}
|
57 |
-
},
|
58 |
-
|
59 |
-
changeRule: function( $rule ){
|
60 |
-
|
61 |
-
// vars
|
62 |
-
var $group = $rule.closest('.rule-group');
|
63 |
-
var prefix = $rule.find('td.param select').attr('name').replace('[param]', '');
|
64 |
-
|
65 |
-
// ajaxdata
|
66 |
-
var ajaxdata = {};
|
67 |
-
ajaxdata.action = 'acf/field_group/render_location_rule';
|
68 |
-
ajaxdata.rule = acf.serialize( $rule, prefix );
|
69 |
-
ajaxdata.rule.id = $rule.data('id');
|
70 |
-
ajaxdata.rule.group = $group.data('id');
|
71 |
-
|
72 |
-
// temp disable
|
73 |
-
acf.disable( $rule.find('td.value') );
|
74 |
-
|
75 |
-
// ajax
|
76 |
-
$.ajax({
|
77 |
-
url: acf.get('ajaxurl'),
|
78 |
-
data: acf.prepareForAjax(ajaxdata),
|
79 |
-
type: 'post',
|
80 |
-
dataType: 'html',
|
81 |
-
success: function( html ){
|
82 |
-
if( !html ) return;
|
83 |
-
$rule.replaceWith( html );
|
84 |
-
}
|
85 |
-
});
|
86 |
-
},
|
87 |
-
|
88 |
-
addGroup: function(){
|
89 |
-
|
90 |
-
// vars
|
91 |
-
var $group = this.$('.rule-group:last');
|
92 |
-
|
93 |
-
// duplicate
|
94 |
-
$group2 = acf.duplicate( $group );
|
95 |
-
|
96 |
-
// update h4
|
97 |
-
$group2.find('h4').text( acf.__('or') );
|
98 |
-
|
99 |
-
// remove all tr's except the first one
|
100 |
-
$group2.find('tr').not(':first').remove();
|
101 |
-
}
|
102 |
-
});
|
103 |
-
|
104 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/build/js/_field-group-settings.js
DELETED
@@ -1,248 +0,0 @@
|
|
1 |
-
(function($, undefined){
|
2 |
-
|
3 |
-
/**
|
4 |
-
* mid
|
5 |
-
*
|
6 |
-
* Calculates the model ID for a field type
|
7 |
-
*
|
8 |
-
* @date 15/12/17
|
9 |
-
* @since 5.6.5
|
10 |
-
*
|
11 |
-
* @param string type
|
12 |
-
* @return string
|
13 |
-
*/
|
14 |
-
|
15 |
-
var modelId = function( type ) {
|
16 |
-
return acf.strPascalCase( type || '' ) + 'FieldSetting';
|
17 |
-
};
|
18 |
-
|
19 |
-
/**
|
20 |
-
* registerFieldType
|
21 |
-
*
|
22 |
-
* description
|
23 |
-
*
|
24 |
-
* @date 14/12/17
|
25 |
-
* @since 5.6.5
|
26 |
-
*
|
27 |
-
* @param type $var Description. Default.
|
28 |
-
* @return type Description.
|
29 |
-
*/
|
30 |
-
|
31 |
-
acf.registerFieldSetting = function( model ){
|
32 |
-
var proto = model.prototype;
|
33 |
-
var mid = modelId(proto.type + ' ' + proto.name);
|
34 |
-
this.models[ mid ] = model;
|
35 |
-
};
|
36 |
-
|
37 |
-
/**
|
38 |
-
* newField
|
39 |
-
*
|
40 |
-
* description
|
41 |
-
*
|
42 |
-
* @date 14/12/17
|
43 |
-
* @since 5.6.5
|
44 |
-
*
|
45 |
-
* @param type $var Description. Default.
|
46 |
-
* @return type Description.
|
47 |
-
*/
|
48 |
-
|
49 |
-
acf.newFieldSetting = function( field ){
|
50 |
-
|
51 |
-
// vars
|
52 |
-
var type = field.get('setting') || '';
|
53 |
-
var name = field.get('name') || '';
|
54 |
-
var mid = modelId( type + ' ' + name );
|
55 |
-
var model = acf.models[ mid ] || null;
|
56 |
-
|
57 |
-
// bail ealry if no setting
|
58 |
-
if( model === null ) return false;
|
59 |
-
|
60 |
-
// instantiate
|
61 |
-
var setting = new model( field );
|
62 |
-
|
63 |
-
// return
|
64 |
-
return setting;
|
65 |
-
};
|
66 |
-
|
67 |
-
/**
|
68 |
-
* acf.getFieldSetting
|
69 |
-
*
|
70 |
-
* description
|
71 |
-
*
|
72 |
-
* @date 19/4/18
|
73 |
-
* @since 5.6.9
|
74 |
-
*
|
75 |
-
* @param type $var Description. Default.
|
76 |
-
* @return type Description.
|
77 |
-
*/
|
78 |
-
|
79 |
-
acf.getFieldSetting = function( field ) {
|
80 |
-
|
81 |
-
// allow jQuery
|
82 |
-
if( field instanceof jQuery ) {
|
83 |
-
field = acf.getField(field);
|
84 |
-
}
|
85 |
-
|
86 |
-
// return
|
87 |
-
return field.setting;
|
88 |
-
};
|
89 |
-
|
90 |
-
/**
|
91 |
-
* settingsManager
|
92 |
-
*
|
93 |
-
* description
|
94 |
-
*
|
95 |
-
* @date 6/1/18
|
96 |
-
* @since 5.6.5
|
97 |
-
*
|
98 |
-
* @param type $var Description. Default.
|
99 |
-
* @return type Description.
|
100 |
-
*/
|
101 |
-
|
102 |
-
var settingsManager = new acf.Model({
|
103 |
-
actions: {
|
104 |
-
'new_field': 'onNewField'
|
105 |
-
},
|
106 |
-
onNewField: function( field ){
|
107 |
-
field.setting = acf.newFieldSetting( field );
|
108 |
-
}
|
109 |
-
});
|
110 |
-
|
111 |
-
/**
|
112 |
-
* acf.FieldSetting
|
113 |
-
*
|
114 |
-
* description
|
115 |
-
*
|
116 |
-
* @date 6/1/18
|
117 |
-
* @since 5.6.5
|
118 |
-
*
|
119 |
-
* @param type $var Description. Default.
|
120 |
-
* @return type Description.
|
121 |
-
*/
|
122 |
-
|
123 |
-
acf.FieldSetting = acf.Model.extend({
|
124 |
-
|
125 |
-
field: false,
|
126 |
-
type: '',
|
127 |
-
name: '',
|
128 |
-
wait: 'ready',
|
129 |
-
eventScope: '.acf-field',
|
130 |
-
|
131 |
-
events: {
|
132 |
-
'change': 'render'
|
133 |
-
},
|
134 |
-
|
135 |
-
setup: function( field ){
|
136 |
-
|
137 |
-
// vars
|
138 |
-
var $field = field.$el;
|
139 |
-
|
140 |
-
// set props
|
141 |
-
this.$el = $field;
|
142 |
-
this.field = field;
|
143 |
-
this.$fieldObject = $field.closest('.acf-field-object');
|
144 |
-
this.fieldObject = acf.getFieldObject( this.$fieldObject );
|
145 |
-
|
146 |
-
// inherit data
|
147 |
-
$.extend(this.data, field.data);
|
148 |
-
},
|
149 |
-
|
150 |
-
initialize: function(){
|
151 |
-
this.render();
|
152 |
-
},
|
153 |
-
|
154 |
-
render: function(){
|
155 |
-
// do nothing
|
156 |
-
}
|
157 |
-
});
|
158 |
-
|
159 |
-
/*
|
160 |
-
* Date Picker
|
161 |
-
*
|
162 |
-
* This field type requires some extra logic for its settings
|
163 |
-
*
|
164 |
-
* @type function
|
165 |
-
* @date 24/10/13
|
166 |
-
* @since 5.0.0
|
167 |
-
*
|
168 |
-
* @param n/a
|
169 |
-
* @return n/a
|
170 |
-
*/
|
171 |
-
|
172 |
-
var DisplayFormatFieldSetting = acf.FieldSetting.extend({
|
173 |
-
type: '',
|
174 |
-
name: '',
|
175 |
-
render: function(){
|
176 |
-
var $input = this.$('input[type="radio"]:checked');
|
177 |
-
if( $input.val() != 'other' ) {
|
178 |
-
this.$('input[type="text"]').val( $input.val() );
|
179 |
-
}
|
180 |
-
}
|
181 |
-
});
|
182 |
-
|
183 |
-
var DatePickerDisplayFormatFieldSetting = DisplayFormatFieldSetting.extend({
|
184 |
-
type: 'date_picker',
|
185 |
-
name: 'display_format'
|
186 |
-
});
|
187 |
-
|
188 |
-
var DatePickerReturnFormatFieldSetting = DisplayFormatFieldSetting.extend({
|
189 |
-
type: 'date_picker',
|
190 |
-
name: 'return_format'
|
191 |
-
});
|
192 |
-
|
193 |
-
acf.registerFieldSetting( DatePickerDisplayFormatFieldSetting );
|
194 |
-
acf.registerFieldSetting( DatePickerReturnFormatFieldSetting );
|
195 |
-
|
196 |
-
/*
|
197 |
-
* Date Time Picker
|
198 |
-
*
|
199 |
-
* This field type requires some extra logic for its settings
|
200 |
-
*
|
201 |
-
* @type function
|
202 |
-
* @date 24/10/13
|
203 |
-
* @since 5.0.0
|
204 |
-
*
|
205 |
-
* @param n/a
|
206 |
-
* @return n/a
|
207 |
-
*/
|
208 |
-
|
209 |
-
var DateTimePickerDisplayFormatFieldSetting = DisplayFormatFieldSetting.extend({
|
210 |
-
type: 'date_time_picker',
|
211 |
-
name: 'display_format'
|
212 |
-
});
|
213 |
-
|
214 |
-
var DateTimePickerReturnFormatFieldSetting = DisplayFormatFieldSetting.extend({
|
215 |
-
type: 'date_time_picker',
|
216 |
-
name: 'return_format'
|
217 |
-
});
|
218 |
-
|
219 |
-
acf.registerFieldSetting( DateTimePickerDisplayFormatFieldSetting );
|
220 |
-
acf.registerFieldSetting( DateTimePickerReturnFormatFieldSetting );
|
221 |
-
|
222 |
-
/*
|
223 |
-
* Time Picker
|
224 |
-
*
|
225 |
-
* This field type requires some extra logic for its settings
|
226 |
-
*
|
227 |
-
* @type function
|
228 |
-
* @date 24/10/13
|
229 |
-
* @since 5.0.0
|
230 |
-
*
|
231 |
-
* @param n/a
|
232 |
-
* @return n/a
|
233 |
-
*/
|
234 |
-
|
235 |
-
var TimePickerDisplayFormatFieldSetting = DisplayFormatFieldSetting.extend({
|
236 |
-
type: 'time_picker',
|
237 |
-
name: 'display_format'
|
238 |
-
});
|
239 |
-
|
240 |
-
var TimePickerReturnFormatFieldSetting = DisplayFormatFieldSetting.extend({
|
241 |
-
name: 'time_picker',
|
242 |
-
name: 'return_format'
|
243 |
-
});
|
244 |
-
|
245 |
-
acf.registerFieldSetting( TimePickerDisplayFormatFieldSetting );
|
246 |
-
acf.registerFieldSetting( TimePickerReturnFormatFieldSetting );
|
247 |
-
|
248 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/build/js/_field-group.js
DELETED
@@ -1,182 +0,0 @@
|
|
1 |
-
(function($, undefined){
|
2 |
-
|
3 |
-
/**
|
4 |
-
* fieldGroupManager
|
5 |
-
*
|
6 |
-
* Generic field group functionality
|
7 |
-
*
|
8 |
-
* @date 15/12/17
|
9 |
-
* @since 5.7.0
|
10 |
-
*
|
11 |
-
* @param void
|
12 |
-
* @return void
|
13 |
-
*/
|
14 |
-
|
15 |
-
var fieldGroupManager = new acf.Model({
|
16 |
-
|
17 |
-
id: 'fieldGroupManager',
|
18 |
-
|
19 |
-
events: {
|
20 |
-
'submit #post': 'onSubmit',
|
21 |
-
'click a[href="#"]': 'onClick',
|
22 |
-
'click .submitdelete': 'onClickTrash',
|
23 |
-
},
|
24 |
-
|
25 |
-
filters: {
|
26 |
-
'find_fields_args': 'filterFindFieldArgs'
|
27 |
-
},
|
28 |
-
|
29 |
-
onSubmit: function( e, $el ){
|
30 |
-
|
31 |
-
// vars
|
32 |
-
var $title = $('#titlewrap #title');
|
33 |
-
|
34 |
-
// empty
|
35 |
-
if( !$title.val() ) {
|
36 |
-
|
37 |
-
// prevent default
|
38 |
-
e.preventDefault();
|
39 |
-
|
40 |
-
// unlock form
|
41 |
-
acf.unlockForm( $el );
|
42 |
-
|
43 |
-
// alert
|
44 |
-
alert( acf.__('Field group title is required') );
|
45 |
-
|
46 |
-
// focus
|
47 |
-
$title.focus();
|
48 |
-
}
|
49 |
-
},
|
50 |
-
|
51 |
-
onClick: function( e ){
|
52 |
-
e.preventDefault();
|
53 |
-
},
|
54 |
-
|
55 |
-
onClickTrash: function( e ){
|
56 |
-
var result = confirm( acf.__('Move to trash. Are you sure?') );
|
57 |
-
if( !result ) {
|
58 |
-
e.preventDefault();
|
59 |
-
}
|
60 |
-
},
|
61 |
-
|
62 |
-
filterFindFieldArgs: function( args ){
|
63 |
-
args.visible = true;
|
64 |
-
return args;
|
65 |
-
}
|
66 |
-
});
|
67 |
-
|
68 |
-
|
69 |
-
/**
|
70 |
-
* screenOptionsManager
|
71 |
-
*
|
72 |
-
* Screen options functionality
|
73 |
-
*
|
74 |
-
* @date 15/12/17
|
75 |
-
* @since 5.7.0
|
76 |
-
*
|
77 |
-
* @param void
|
78 |
-
* @return void
|
79 |
-
*/
|
80 |
-
|
81 |
-
var screenOptionsManager = new acf.Model({
|
82 |
-
|
83 |
-
id: 'screenOptionsManager',
|
84 |
-
wait: 'prepare',
|
85 |
-
|
86 |
-
events: {
|
87 |
-
'change': 'onChange'
|
88 |
-
},
|
89 |
-
|
90 |
-
initialize: function(){
|
91 |
-
|
92 |
-
// vars
|
93 |
-
var $div = $('#adv-settings');
|
94 |
-
var $append = $('#acf-append-show-on-screen');
|
95 |
-
|
96 |
-
// append
|
97 |
-
$div.find('.metabox-prefs').append( $append.html() );
|
98 |
-
$div.find('.metabox-prefs br').remove();
|
99 |
-
|
100 |
-
// clean up
|
101 |
-
$append.remove();
|
102 |
-
|
103 |
-
// initialize
|
104 |
-
this.$el = $('#acf-field-key-hide');
|
105 |
-
|
106 |
-
// render
|
107 |
-
this.render();
|
108 |
-
},
|
109 |
-
|
110 |
-
isChecked: function(){
|
111 |
-
return this.$el.prop('checked');
|
112 |
-
},
|
113 |
-
|
114 |
-
onChange: function( e, $el ) {
|
115 |
-
var val = this.isChecked() ? 1 : 0;
|
116 |
-
acf.updateUserSetting('show_field_keys', val);
|
117 |
-
this.render();
|
118 |
-
},
|
119 |
-
|
120 |
-
render: function(){
|
121 |
-
if( this.isChecked() ) {
|
122 |
-
$('#acf-field-group-fields').addClass('show-field-keys');
|
123 |
-
} else {
|
124 |
-
$('#acf-field-group-fields').removeClass('show-field-keys');
|
125 |
-
}
|
126 |
-
}
|
127 |
-
|
128 |
-
});
|
129 |
-
|
130 |
-
|
131 |
-
/**
|
132 |
-
* appendFieldManager
|
133 |
-
*
|
134 |
-
* Appends fields together
|
135 |
-
*
|
136 |
-
* @date 15/12/17
|
137 |
-
* @since 5.7.0
|
138 |
-
*
|
139 |
-
* @param void
|
140 |
-
* @return void
|
141 |
-
*/
|
142 |
-
|
143 |
-
var appendFieldManager = new acf.Model({
|
144 |
-
|
145 |
-
actions: {
|
146 |
-
'new_field' : 'onNewField'
|
147 |
-
},
|
148 |
-
|
149 |
-
onNewField: function( field ){
|
150 |
-
|
151 |
-
// bail ealry if not append
|
152 |
-
if( !field.has('append') ) return;
|
153 |
-
|
154 |
-
// vars
|
155 |
-
var append = field.get('append');
|
156 |
-
var $sibling = field.$el.siblings('[data-name="' + append + '"]').first();
|
157 |
-
|
158 |
-
// bail early if no sibling
|
159 |
-
if( !$sibling.length ) return;
|
160 |
-
|
161 |
-
// ul
|
162 |
-
var $div = $sibling.children('.acf-input');
|
163 |
-
var $ul = $div.children('ul');
|
164 |
-
|
165 |
-
// create ul
|
166 |
-
if( !$ul.length ) {
|
167 |
-
$div.wrapInner('<ul class="acf-hl"><li></li></ul>');
|
168 |
-
$ul = $div.children('ul');
|
169 |
-
}
|
170 |
-
|
171 |
-
// li
|
172 |
-
var html = field.$('.acf-input').html();
|
173 |
-
var $li = $('<li>' + html + '</li>');
|
174 |
-
$ul.append( $li );
|
175 |
-
$ul.attr('data-cols', $ul.children().length );
|
176 |
-
|
177 |
-
// clean up
|
178 |
-
field.remove();
|
179 |
-
}
|
180 |
-
});
|
181 |
-
|
182 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/build/js/acf-field-group.js
DELETED
@@ -1,7 +0,0 @@
|
|
1 |
-
// @codekit-prepend "_field-group.js";
|
2 |
-
// @codekit-prepend "_field-group-field.js";
|
3 |
-
// @codekit-prepend "_field-group-settings.js";
|
4 |
-
// @codekit-prepend "_field-group-conditions.js";
|
5 |
-
// @codekit-prepend "_field-group-fields.js";
|
6 |
-
// @codekit-prepend "_field-group-locations.js";
|
7 |
-
// @codekit-prepend "_field-group-compatibility.js";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/build/js/acf-field-group.min.js
DELETED
@@ -1,7 +0,0 @@
|
|
1 |
-
// @codekit-prepend "_field-group.js";
|
2 |
-
// @codekit-prepend "_field-group-field.js";
|
3 |
-
// @codekit-prepend "_field-group-settings.js";
|
4 |
-
// @codekit-prepend "_field-group-conditions.js";
|
5 |
-
// @codekit-prepend "_field-group-fields.js";
|
6 |
-
// @codekit-prepend "_field-group-locations.js";
|
7 |
-
// @codekit-prepend "_field-group-compatibility.js";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/build/js/acf-input.js
DELETED
@@ -1,45 +0,0 @@
|
|
1 |
-
// @codekit-prepend "_acf.js";
|
2 |
-
// @codekit-prepend "_acf-hooks.js";
|
3 |
-
// @codekit-prepend "_acf-model.js";
|
4 |
-
// @codekit-prepend "_acf-popup.js";
|
5 |
-
// @codekit-prepend "_acf-unload.js";
|
6 |
-
// @codekit-prepend "_acf-panel.js";
|
7 |
-
// @codekit-prepend "_acf-notice.js";
|
8 |
-
// @codekit-prepend "_acf-postbox.js";
|
9 |
-
// @codekit-prepend "_acf-tooltip.js";
|
10 |
-
// @codekit-prepend "_acf-field.js";
|
11 |
-
// @codekit-prepend "_acf-fields.js";
|
12 |
-
// @codekit-prepend "_acf-field-accordion.js";
|
13 |
-
// @codekit-prepend "_acf-field-button-group.js";
|
14 |
-
// @codekit-prepend "_acf-field-checkbox.js";
|
15 |
-
// @codekit-prepend "_acf-field-color-picker.js";
|
16 |
-
// @codekit-prepend "_acf-field-date-picker.js";
|
17 |
-
// @codekit-prepend "_acf-field-date-time-picker.js";
|
18 |
-
// @codekit-prepend "_acf-field-google-map.js";
|
19 |
-
// @codekit-prepend "_acf-field-image.js";
|
20 |
-
// @codekit-prepend "_acf-field-file.js";
|
21 |
-
// @codekit-prepend "_acf-field-link.js";
|
22 |
-
// @codekit-prepend "_acf-field-oembed.js";
|
23 |
-
// @codekit-prepend "_acf-field-radio.js";
|
24 |
-
// @codekit-prepend "_acf-field-range.js";
|
25 |
-
// @codekit-prepend "_acf-field-relationship.js";
|
26 |
-
// @codekit-prepend "_acf-field-select.js";
|
27 |
-
// @codekit-prepend "_acf-field-tab.js";
|
28 |
-
// @codekit-prepend "_acf-field-post-object.js";
|
29 |
-
// @codekit-prepend "_acf-field-page-link.js";
|
30 |
-
// @codekit-prepend "_acf-field-user.js";
|
31 |
-
// @codekit-prepend "_acf-field-taxonomy.js";
|
32 |
-
// @codekit-prepend "_acf-field-time-picker.js";
|
33 |
-
// @codekit-prepend "_acf-field-true-false.js";
|
34 |
-
// @codekit-prepend "_acf-field-url.js";
|
35 |
-
// @codekit-prepend "_acf-field-wysiwyg.js";
|
36 |
-
// @codekit-prepend "_acf-condition.js";
|
37 |
-
// @codekit-prepend "_acf-conditions.js";
|
38 |
-
// @codekit-prepend "_acf-condition-types.js";
|
39 |
-
// @codekit-prepend "_acf-media.js";
|
40 |
-
// @codekit-prepend "_acf-screen.js";
|
41 |
-
// @codekit-prepend "_acf-select2.js";
|
42 |
-
// @codekit-prepend "_acf-tinymce.js";
|
43 |
-
// @codekit-prepend "_acf-validation.js";
|
44 |
-
// @codekit-prepend "_acf-helpers.js";
|
45 |
-
// @codekit-prepend "_acf-compatibility";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/build/js/acf-input.min.js
DELETED
@@ -1,45 +0,0 @@
|
|
1 |
-
// @codekit-prepend "_acf.js";
|
2 |
-
// @codekit-prepend "_acf-hooks.js";
|
3 |
-
// @codekit-prepend "_acf-model.js";
|
4 |
-
// @codekit-prepend "_acf-popup.js";
|
5 |
-
// @codekit-prepend "_acf-unload.js";
|
6 |
-
// @codekit-prepend "_acf-panel.js";
|
7 |
-
// @codekit-prepend "_acf-notice.js";
|
8 |
-
// @codekit-prepend "_acf-postbox.js";
|
9 |
-
// @codekit-prepend "_acf-tooltip.js";
|
10 |
-
// @codekit-prepend "_acf-field.js";
|
11 |
-
// @codekit-prepend "_acf-fields.js";
|
12 |
-
// @codekit-prepend "_acf-field-accordion.js";
|
13 |
-
// @codekit-prepend "_acf-field-button-group.js";
|
14 |
-
// @codekit-prepend "_acf-field-checkbox.js";
|
15 |
-
// @codekit-prepend "_acf-field-color-picker.js";
|
16 |
-
// @codekit-prepend "_acf-field-date-picker.js";
|
17 |
-
// @codekit-prepend "_acf-field-date-time-picker.js";
|
18 |
-
// @codekit-prepend "_acf-field-google-map.js";
|
19 |
-
// @codekit-prepend "_acf-field-image.js";
|
20 |
-
// @codekit-prepend "_acf-field-file.js";
|
21 |
-
// @codekit-prepend "_acf-field-link.js";
|
22 |
-
// @codekit-prepend "_acf-field-oembed.js";
|
23 |
-
// @codekit-prepend "_acf-field-radio.js";
|
24 |
-
// @codekit-prepend "_acf-field-range.js";
|
25 |
-
// @codekit-prepend "_acf-field-relationship.js";
|
26 |
-
// @codekit-prepend "_acf-field-select.js";
|
27 |
-
// @codekit-prepend "_acf-field-tab.js";
|
28 |
-
// @codekit-prepend "_acf-field-post-object.js";
|
29 |
-
// @codekit-prepend "_acf-field-page-link.js";
|
30 |
-
// @codekit-prepend "_acf-field-user.js";
|
31 |
-
// @codekit-prepend "_acf-field-taxonomy.js";
|
32 |
-
// @codekit-prepend "_acf-field-time-picker.js";
|
33 |
-
// @codekit-prepend "_acf-field-true-false.js";
|
34 |
-
// @codekit-prepend "_acf-field-url.js";
|
35 |
-
// @codekit-prepend "_acf-field-wysiwyg.js";
|
36 |
-
// @codekit-prepend "_acf-condition.js";
|
37 |
-
// @codekit-prepend "_acf-conditions.js";
|
38 |
-
// @codekit-prepend "_acf-condition-types.js";
|
39 |
-
// @codekit-prepend "_acf-media.js";
|
40 |
-
// @codekit-prepend "_acf-screen.js";
|
41 |
-
// @codekit-prepend "_acf-select2.js";
|
42 |
-
// @codekit-prepend "_acf-tinymce.js";
|
43 |
-
// @codekit-prepend "_acf-validation.js";
|
44 |
-
// @codekit-prepend "_acf-helpers.js";
|
45 |
-
// @codekit-prepend "_acf-compatibility";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/css/acf-input.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.acf-field,.acf-field .acf-label,.acf-field .acf-input{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:relative}.acf-field{margin:15px 0;clear:both}.acf-field p.description{display:block;margin:0;padding:0}.acf-field .acf-label{vertical-align:top;margin:0 0 10px}.acf-field .acf-label label{display:block;font-weight:bold;margin:0 0 3px;padding:0}.acf-field .acf-label:empty{margin-bottom:0}.acf-field .acf-input{vertical-align:top}.acf-field .acf-input>p.description{margin-top:5px}.acf-field .acf-notice{margin:0 0 15px;background:#edf2ff;color:#2183b9;border:none}.acf-field .acf-notice .acf-notice-dismiss{background:transparent;color:inherit}.acf-field .acf-notice .acf-notice-dismiss:hover{background:#fff}.acf-field .acf-notice.-dismiss{padding-right:40px}.acf-field .acf-notice.-error{background:#ffe6e6;color:#d12626}.acf-field .acf-notice.-success{background:#eefbe8;color:#32a23b}.acf-field .acf-notice.-warning{background:#fff3e6;color:#d16226}td.acf-field,tr.acf-field{margin:0}.acf-field[data-width]{float:left;clear:none}.acf-field[data-width]+.acf-field[data-width]{border-left:1px solid #eeeeee}html[dir="rtl"] .acf-field[data-width]{float:right}html[dir="rtl"] .acf-field[data-width]+.acf-field[data-width]{border-left:none;border-right:1px solid #eeeeee}td.acf-field[data-width],tr.acf-field[data-width]{float:none}.acf-field.-c0{clear:both;border-left-width:0 !important}html[dir="rtl"] .acf-field.-c0{border-left-width:1px !important;border-right-width:0 !important}.acf-field.-r0{border-top-width:0 !important}.acf-fields{position:relative}.acf-fields:after{display:block;clear:both;content:""}.acf-fields.-border{border:#dfdfdf solid 1px;background:#fff}.acf-fields>.acf-field{position:relative;margin:0;padding:15px 12px;border-top:#EEEEEE solid 1px}.acf-fields>.acf-field:first-child{border-top-width:0}td.acf-fields{padding:0 !important}.acf-fields.-clear>.acf-field{border:none;padding:0;margin:15px 0}.acf-fields.-clear>.acf-field[data-width]{border:none !important}.acf-fields.-clear>.acf-field>.acf-label{padding:0}.acf-fields.-clear>.acf-field>.acf-input{padding:0}.acf-fields.-left>.acf-field{padding:15px 0}.acf-fields.-left>.acf-field:after{display:block;clear:both;content:""}.acf-fields.-left>.acf-field:before{content:"";display:block;position:absolute;z-index:0;background:#F9F9F9;border-color:#E1E1E1;border-style:solid;border-width:0 1px 0 0;top:0;bottom:0;left:0;width:20%}.acf-fields.-left>.acf-field[data-width]{float:none;width:auto !important;border-left-width:0 !important;border-right-width:0 !important}.acf-fields.-left>.acf-field>.acf-label{float:left;width:20%;margin:0;padding:0 12px}.acf-fields.-left>.acf-field>.acf-input{float:left;width:80%;margin:0;padding:0 12px}html[dir="rtl"] .acf-fields.-left>.acf-field:before{border-width:0 0 0 1px;left:auto;right:0}html[dir="rtl"] .acf-fields.-left>.acf-field>.acf-label{float:right}html[dir="rtl"] .acf-fields.-left>.acf-field>.acf-input{float:right}@media screen and (max-width: 640px){.acf-fields.-left>.acf-field:before{display:none}.acf-fields.-left>.acf-field>.acf-label{width:100%;margin-bottom:10px}.acf-fields.-left>.acf-field>.acf-input{width:100%}}.acf-fields.-clear.-left>.acf-field{padding:0;border:none}.acf-fields.-clear.-left>.acf-field:before{display:none}.acf-fields.-clear.-left>.acf-field>.acf-label{padding:0}.acf-fields.-clear.-left>.acf-field>.acf-input{padding:0}.acf-table tr.acf-field>td.acf-label{padding:15px 12px;margin:0;background:#F9F9F9;width:20%}.acf-table tr.acf-field>td.acf-input{padding:15px 12px;margin:0;border-left-color:#E1E1E1}.acf-sortable-tr-helper{position:relative !important;display:table-row !important}.acf-postbox{position:relative}.acf-postbox>.inside{margin:0 !important;padding:0 !important}.acf-postbox>.hndle .acf-hndle-cog{color:#AAAAAA;font-size:16px;line-height:20px;padding:0 2px;float:right;position:relative;display:none}.acf-postbox>.hndle .acf-hndle-cog:hover{color:#777777}.acf-postbox:hover>.hndle .acf-hndle-cog{display:block}.acf-postbox .acf-replace-with-fields{padding:15px;text-align:center}#post-body-content #acf_after_title-sortables{margin:20px 0 -20px}.acf-postbox.seamless{border:0 none;background:transparent;box-shadow:none}.acf-postbox.seamless>.hndle,.acf-postbox.seamless>.handlediv{display:none !important}.acf-postbox.seamless>.inside{display:block !important;margin-left:-12px !important;margin-right:-12px !important}.acf-postbox.seamless>.inside>.acf-field{border-color:transparent}.acf-postbox.seamless>.acf-fields.-left>.acf-field:before{display:none}@media screen and (max-width: 782px){.acf-postbox.seamless>.acf-fields.-left>.acf-field>.acf-label,.acf-postbox.seamless>.acf-fields.-left>.acf-field>.acf-input{padding:0}}.acf-field input[type="text"],.acf-field input[type="password"],.acf-field input[type="number"],.acf-field input[type="search"],.acf-field input[type="email"],.acf-field input[type="url"],.acf-field textarea,.acf-field select{width:100%;padding:3px 5px;resize:none;margin:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;font-size:14px;line-height:1.4}.acf-field input[type="text"]:disabled,.acf-field input[type="password"]:disabled,.acf-field input[type="number"]:disabled,.acf-field input[type="search"]:disabled,.acf-field input[type="email"]:disabled,.acf-field input[type="url"]:disabled,.acf-field textarea:disabled,.acf-field select:disabled{background:#f8f8f8}.acf-field input[type="text"][readonly],.acf-field input[type="password"][readonly],.acf-field input[type="number"][readonly],.acf-field input[type="search"][readonly],.acf-field input[type="email"][readonly],.acf-field input[type="url"][readonly],.acf-field textarea[readonly],.acf-field select[readonly]{background:#f8f8f8}.acf-field textarea{resize:vertical}.acf-input-prepend,.acf-input-append,.acf-input-wrap{box-sizing:border-box;height:28px}.acf-input-prepend,.acf-input-append{font-size:13px;line-height:20px;padding:3px 7px;background:#F4F4F4;border:#DFDFDF solid 1px}.acf-input-prepend{float:left;border-right-width:0;border-radius:3px 0 0 3px}.acf-input-append{float:right;border-left-width:0;border-radius:0 3px 3px 0}.acf-input-wrap{position:relative;overflow:hidden}.acf-input-wrap input{height:28px;margin:0}input.acf-is-prepended{border-radius:0 3px 3px 0 !important}input.acf-is-appended{border-radius:3px 0 0 3px !important}input.acf-is-prepended.acf-is-appended{border-radius:0 !important}html[dir="rtl"] .acf-input-prepend{border-left-width:0;border-right-width:1px;border-radius:0 3px 3px 0;float:right}html[dir="rtl"] .acf-input-append{border-left-width:1px;border-right-width:0;border-radius:3px 0 0 3px;float:left}html[dir="rtl"] input.acf-is-prepended{border-radius:3px 0 0 3px !important}html[dir="rtl"] input.acf-is-appended{border-radius:0 3px 3px 0 !important}html[dir="rtl"] input.acf-is-prepended.acf-is-appended{border-radius:0 !important}.acf-color-picker .wp-picker-active{position:relative;z-index:1}.acf-url i{position:absolute;top:4px;left:4px;opacity:0.5;color:#A9A9A9}.acf-url input[type="url"]{padding-left:25px}.acf-url.-valid i{opacity:1}.acf-field select{padding:2px}.acf-field select optgroup{padding:5px;background:#fff}.acf-field select option{padding:3px}.acf-field select optgroup option{padding-left:5px}.acf-field select optgroup:nth-child(2n){background:#F9F9F9}.acf-field .select2-input{max-width:200px}.select2-container.-acf .select2-choices{background:#fff;border-color:#ddd;box-shadow:0 1px 2px rgba(0,0,0,0.07) inset;min-height:31px}.select2-container.-acf .select2-choices .select2-search-choice{margin:5px 0 5px 5px;padding:3px 5px 3px 18px;border-color:#bbb;background:#f9f9f9;box-shadow:0 1px 0 rgba(255,255,255,0.25) inset}.select2-container.-acf .select2-choices .select2-search-choice.ui-sortable-helper{background:#5897fb;border-color:#3f87fa;color:#fff;box-shadow:0 0 3px rgba(0,0,0,0.1)}.select2-container.-acf .select2-choices .select2-search-choice.ui-sortable-helper a{visibility:hidden}.select2-container.-acf .select2-choices .select2-search-choice.ui-sortable-placeholder{background-color:#f7f7f7;border-color:#f7f7f7;visibility:visible !important}.select2-container.-acf .select2-choices .select2-search-choice-focus{border-color:#999}.select2-container.-acf .select2-choices .select2-search-field input{height:31px;line-height:22px;margin:0;padding:5px 5px 5px 7px}.select2-container.-acf .select2-choice{border-color:#BBBBBB}.select2-container.-acf .select2-choice .select2-arrow{background:transparent;border-left-color:#DFDFDF;padding-left:1px}.select2-container.-acf .select2-choice .select2-result-description{display:none}.select2-container.-acf.select2-container-active .select2-choices,.select2-container.-acf.select2-dropdown-open .select2-choices{border-color:#5B9DD9;border-radius:3px 3px 0 0}.select2-container.-acf.select2-dropdown-open .select2-choice{background:#fff;border-color:#5B9DD9}html[dir="rtl"] .select2-container.-acf .select2-search-choice-close{left:24px}html[dir="rtl"] .select2-container.-acf .select2-choice>.select2-chosen{margin-left:42px}html[dir="rtl"] .select2-container.-acf .select2-choice .select2-arrow{padding-left:0;padding-right:1px}.select2-drop .select2-search{padding:4px 4px 0}.select2-drop .select2-result .select2-result-description{color:#999;font-size:12px;margin-left:5px}.select2-drop .select2-result.select2-highlighted .select2-result-description{color:#fff;opacity:0.75}.select2-container.-acf li{margin-bottom:0}.select2-container--default.-acf .select2-selection--multiple .select2-search--inline:first-child{float:none}.select2-container--default.-acf .select2-selection--multiple .select2-search--inline:first-child input{width:100% !important}.select2-container--default.-acf .select2-selection--multiple .select2-selection__rendered{padding-right:0}.select2-container--default.-acf .select2-selection--multiple .select2-selection__choice{background-color:#f7f7f7;border-color:#cccccc;max-width:100%;overflow:hidden;word-wrap:normal !important;white-space:normal}.select2-container--default.-acf .select2-selection--multiple .select2-selection__choice.ui-sortable-helper{background:#5897fb;border-color:#3f87fa;color:#fff;box-shadow:0 0 3px rgba(0,0,0,0.1)}.select2-container--default.-acf .select2-selection--multiple .select2-selection__choice.ui-sortable-helper span{visibility:hidden}.select2-container--default.-acf .select2-selection--multiple .select2-selection__choice.ui-sortable-placeholder{background-color:#f7f7f7;border-color:#f7f7f7;visibility:visible !important}.select2-container--default.-acf .select2-selection--multiple .select2-search__field{box-shadow:none !important}.select2-container .select2-dropdown{z-index:900000}.link-wrap{border:#dddddd solid 1px;border-radius:3px;padding:5px;line-height:26px;background:#fff;word-wrap:break-word;word-break:break-all}.link-wrap .link-title{padding:0 5px}.acf-link .link-wrap,.acf-link .acf-icon.-link-ext{display:none}.acf-link.-value .button{display:none}.acf-link.-value .link-wrap{display:inline-block}.acf-link.-external .acf-icon.-link-ext{display:inline-block}#wp-link-backdrop{z-index:900000 !important}#wp-link-wrap{z-index:900001 !important}ul.acf-radio-list,ul.acf-checkbox-list{background:transparent;position:relative;padding:1px;margin:0}ul.acf-radio-list li,ul.acf-checkbox-list li{font-size:13px;line-height:22px;margin:0;position:relative;word-wrap:break-word}ul.acf-radio-list li label,ul.acf-checkbox-list li label{display:inline}ul.acf-radio-list li input[type="checkbox"],ul.acf-radio-list li input[type="radio"],ul.acf-checkbox-list li input[type="checkbox"],ul.acf-checkbox-list li input[type="radio"]{margin:-1px 4px 0 0;vertical-align:middle}ul.acf-radio-list li input[type="text"],ul.acf-checkbox-list li input[type="text"]{width:auto;vertical-align:middle;margin:2px 0}ul.acf-radio-list li span,ul.acf-checkbox-list li span{float:none}ul.acf-radio-list li i,ul.acf-checkbox-list li i{vertical-align:middle}ul.acf-radio-list.acf-hl li,ul.acf-checkbox-list.acf-hl li{margin-right:20px;clear:none}html[dir="rtl"] ul.acf-radio-list input[type="checkbox"],html[dir="rtl"] ul.acf-radio-list input[type="radio"],html[dir="rtl"] ul.acf-checkbox-list input[type="checkbox"],html[dir="rtl"] ul.acf-checkbox-list input[type="radio"]{margin-left:4px;margin-right:0}.acf-button-group{display:inline-block}.acf-button-group label{display:inline-block;border:#ccc solid 1px;position:relative;z-index:1;padding:5px 10px;background:#fff}.acf-button-group label:hover{border-color:#999;z-index:2}.acf-button-group label.selected{border-color:#2b9af3;background:#309cf3;color:#fff;z-index:2}.acf-button-group label.selected:hover{background:#48a8f4}.acf-button-group input{display:none !important}.acf-button-group{padding-left:1px;display:inline-flex;flex-direction:row;flex-wrap:nowrap}.acf-button-group label{margin:0 0 0 -1px;flex:1;text-align:center;white-space:nowrap}.acf-button-group label:first-child{border-radius:3px 0 0 3px}html[dir="rtl"] .acf-button-group label:first-child{border-radius:0 3px 3px 0}.acf-button-group label:last-child{border-radius:0 3px 3px 0}html[dir="rtl"] .acf-button-group label:last-child{border-radius:3px 0 0 3px}.acf-button-group label:only-child{border-radius:3px}.acf-button-group.-vertical{padding-left:0;padding-top:1px;flex-direction:column}.acf-button-group.-vertical label{margin:-1px 0 0 0}.acf-button-group.-vertical label:first-child{border-radius:3px 3px 0 0}.acf-button-group.-vertical label:last-child{border-radius:0 0 3px 3px}.acf-button-group.-vertical label:only-child{border-radius:3px}.acf-checkbox-list .button{margin:10px 0 0}.acf-switch{display:inline-block;border-radius:5px;cursor:pointer;position:relative;background:#f8f8f8;height:30px;vertical-align:middle;border:#ccc solid 1px;-webkit-transition:background 0.25s ease;-moz-transition:background 0.25s ease;-o-transition:background 0.25s ease;transition:background 0.25s ease}.acf-switch span{display:inline-block;float:left;text-align:center;font-size:13px;line-height:22px;padding:4px 10px;min-width:15px}.acf-switch span i{vertical-align:middle}.acf-switch .acf-switch-on{color:#fff;text-shadow:#1f7db1 0 1px 0}.acf-switch .acf-switch-slider{position:absolute;top:2px;left:2px;bottom:2px;right:50%;z-index:1;background:#fff;border-radius:3px;border:#ccc solid 1px;-webkit-transition:all 0.25s ease;-moz-transition:all 0.25s ease;-o-transition:all 0.25s ease;transition:all 0.25s ease;transition-property:left, right}.acf-switch:hover .acf-switch-slider{border-color:#b3b3b3}.acf-switch.-on{background:#309cf3;border-color:#2b9af3}.acf-switch.-on .acf-switch-slider{left:50%;right:2px;border-color:#0d84e3}.acf-switch.-on:hover{background:#48a8f4}.acf-switch.-focus .acf-switch-slider{border-color:#5b9dd9;box-shadow:0 0 2px rgba(30,140,190,0.5)}.acf-switch.-focus.-on .acf-switch-slider{border-color:#185e85;box-shadow:0 0 2px #1f7db1}.acf-switch+span{margin-left:6px}.acf-switch-input{opacity:0;position:absolute;margin:0}.compat-item .acf-true-false .message{float:none;padding:0;vertical-align:middle}.acf-google-map{position:relative;border:#DFDFDF solid 1px;background:#fff}.acf-google-map .title{position:relative;border-bottom:#DFDFDF solid 1px}.acf-google-map .title .search{margin:0;font-size:14px;line-height:30px;height:40px;padding:5px 10px;border:0 none;box-shadow:none;border-radius:0;font-family:inherit;cursor:text}.acf-google-map .title .acf-loading{position:absolute;top:10px;right:11px;display:none}.acf-google-map .title:hover .acf-actions{display:block}.acf-google-map .canvas{height:400px}.acf-google-map .title .acf-icon.-location{display:inline-block}.acf-google-map .title .acf-icon.-cancel{display:none}.acf-google-map .title .acf-icon.-search{display:none}.acf-google-map.-search .title .acf-icon.-location{display:none}.acf-google-map.-search .title .acf-icon.-cancel{display:inline-block}.acf-google-map.-search .title .acf-icon.-search{display:inline-block}.acf-google-map.-value .title .search{font-weight:bold}.acf-google-map.-value .title .acf-icon.-location{display:none}.acf-google-map.-value .title .acf-icon.-cancel{display:inline-block}.acf-google-map.-value .title .acf-icon.-search{display:none}.acf-google-map.-loading .title a{display:none !important}.acf-google-map.-loading .title i{display:inline-block}.pac-container{border-width:1px 0;box-shadow:none}.pac-container:after{display:none}.pac-container .pac-item:first-child{border-top:0 none}.pac-container .pac-item{padding:5px 10px;cursor:pointer}html[dir="rtl"] .pac-container .pac-item{text-align:right}.acf-relationship{background:#fff}.acf-relationship .filters{border:#DFDFDF solid 1px;background:#fff}.acf-relationship .filters:after{display:block;clear:both;content:""}.acf-relationship .filters .filter{margin:0;padding:0;float:left;width:100%}.acf-relationship .filters .filter span{display:block;padding:7px 7px 7px 0}.acf-relationship .filters .filter:first-child span{padding-left:7px}.acf-relationship .filters .filter input,.acf-relationship .filters .filter select{height:28px;line-height:28px;padding:2px;width:100%;margin:0;float:none}.acf-relationship .filters .filter input:focus,.acf-relationship .filters .filter input:active,.acf-relationship .filters .filter select:focus,.acf-relationship .filters .filter select:active{outline:none;box-shadow:none}.acf-relationship .filters .filter input{border-color:transparent;box-shadow:none}.acf-relationship .filters.-f2 .filter{width:50%}.acf-relationship .filters.-f3 .filter{width:25%}.acf-relationship .filters.-f3 .filter.-search{width:50%}.acf-relationship .list{margin:0;padding:5px;height:160px;overflow:auto}.acf-relationship .list .acf-rel-label,.acf-relationship .list .acf-rel-item,.acf-relationship .list p{padding:5px 7px;margin:0;display:block;position:relative;min-height:18px}.acf-relationship .list .acf-rel-label{font-weight:bold}.acf-relationship .list .acf-rel-item{cursor:pointer}.acf-relationship .list .acf-rel-item b{text-decoration:underline;font-weight:normal}.acf-relationship .list .acf-rel-item .thumbnail{background:#e0e0e0;width:22px;height:22px;float:left;margin:-2px 5px 0 0}.acf-relationship .list .acf-rel-item .thumbnail img{max-width:22px;max-height:22px;margin:0 auto;display:block}.acf-relationship .list .acf-rel-item .thumbnail.-icon{background:#fff}.acf-relationship .list .acf-rel-item .thumbnail.-icon img{max-height:20px;margin-top:1px}.acf-relationship .list .acf-rel-item:hover{background:#3875D7;color:#fff}.acf-relationship .list .acf-rel-item:hover .thumbnail{background:#a2bfec}.acf-relationship .list .acf-rel-item:hover .thumbnail.-icon{background:#fff}.acf-relationship .list .acf-rel-item.disabled{opacity:0.5}.acf-relationship .list .acf-rel-item.disabled:hover{background:transparent;color:#333;cursor:default}.acf-relationship .list .acf-rel-item.disabled:hover .thumbnail{background:#e0e0e0}.acf-relationship .list .acf-rel-item.disabled:hover .thumbnail.-icon{background:#fff}.acf-relationship .list ul{padding-bottom:5px}.acf-relationship .list ul .acf-rel-label,.acf-relationship .list ul .acf-rel-item,.acf-relationship .list ul p{padding-left:20px}.acf-relationship .selection{border:#DFDFDF solid 1px;position:relative;margin-top:-1px}.acf-relationship .selection:after{display:block;clear:both;content:""}.acf-relationship .selection .values,.acf-relationship .selection .choices{width:50%;background:#fff;float:left}.acf-relationship .selection .choices{background:#F9F9F9}.acf-relationship .selection .choices .list{border-right:#DFDFDF solid 1px}.acf-relationship .selection .values .acf-icon{position:absolute;top:4px;right:7px;display:none}html[dir="rtl"] .acf-relationship .selection .values .acf-icon{right:auto;left:7px}.acf-relationship .selection .values .acf-rel-item:hover .acf-icon{display:block}.acf-relationship .selection .values .acf-rel-item{cursor:move}.acf-relationship .selection .values .acf-rel-item b{text-decoration:none}.menu-item .acf-relationship ul{width:auto}.menu-item .acf-relationship li{display:block}.acf-editor-wrap.delay .acf-editor-toolbar{content:"";display:block;background:#f5f5f5;border-bottom:#dddddd solid 1px;color:#555d66;padding:10px}.acf-editor-wrap.delay textarea{padding:10px;border:none}.acf-editor-wrap iframe{min-height:200px}.acf-editor-wrap .wp-editor-container{border:1px solid #E5E5E5;box-shadow:none !important}.acf-editor-wrap .wp-editor-tabs{box-sizing:content-box}#mce_fullscreen_container{z-index:900000 !important}.acf-field-tab{display:none !important}.hidden-by-tab{display:none !important}.acf-tab-wrap{clear:both;z-index:1}.acf-tab-group{border-bottom:#ccc solid 1px;padding:10px 10px 0}.acf-tab-group li{margin:0 0.5em 0 0}.acf-tab-group li a{padding:5px 10px;display:block;color:#555;font-size:14px;font-weight:600;line-height:24px;border:#ccc solid 1px;border-bottom:0 none;text-decoration:none;background:#e5e5e5;transition:none}.acf-tab-group li a:hover{background:#FFF}.acf-tab-group li a:focus{outline:none;box-shadow:none}.acf-tab-group li a:empty{display:none}html[dir="rtl"] .acf-tab-group li{margin:0 0 0 0.5em}.acf-tab-group li.active a{background:#F1F1F1;color:#000;padding-bottom:6px;margin-bottom:-1px;position:relative;z-index:1}.acf-fields>.acf-tab-wrap{background:#F9F9F9}.acf-fields>.acf-tab-wrap .acf-tab-group{position:relative;z-index:1;margin-bottom:-1px;border-top:#DFDFDF solid 1px;border-bottom:#DFDFDF solid 1px}.acf-fields>.acf-tab-wrap .acf-tab-group li a{background:#f1f1f1}.acf-fields>.acf-tab-wrap .acf-tab-group li a:hover{background:#FFF}.acf-fields>.acf-tab-wrap .acf-tab-group li.active a{background:#FFFFFF}.acf-fields>.acf-tab-wrap:first-child .acf-tab-group{border-top:none}.acf-fields.-left>.acf-tab-wrap .acf-tab-group{padding-left:20%}@media screen and (max-width: 640px){.acf-fields.-left>.acf-tab-wrap .acf-tab-group{padding-left:10px}}html[dir="rtl"] .acf-fields.-left>.acf-tab-wrap .acf-tab-group{padding-left:0;padding-right:20%}@media screen and (max-width: 850px){html[dir="rtl"] .acf-fields.-left>.acf-tab-wrap .acf-tab-group{padding-right:10px}}.acf-tab-wrap.-left .acf-tab-group{position:absolute;left:0;width:20%;border:0 none;padding:0 !important;margin:1px 0 0}.acf-tab-wrap.-left .acf-tab-group li{float:none;margin:-1px 0 0}.acf-tab-wrap.-left .acf-tab-group li a{border:1px solid #ededed;font-size:13px;line-height:18px;color:#0073aa;padding:10px;margin:0;font-weight:normal;border-width:1px 0;border-radius:0;background:transparent}.acf-tab-wrap.-left .acf-tab-group li a:hover{color:#00a0d2}.acf-tab-wrap.-left .acf-tab-group li.active a{border-color:#DFDFDF;color:#000;margin-right:-1px;background:#fff}html[dir="rtl"] .acf-tab-wrap.-left .acf-tab-group{left:auto;right:0}html[dir="rtl"] .acf-tab-wrap.-left .acf-tab-group li.active a{margin-right:0;margin-left:-1px}.acf-field+.acf-tab-wrap.-left:before{content:"";display:block;position:relative;z-index:1;height:10px;border-top:#DFDFDF solid 1px;border-bottom:#DFDFDF solid 1px;margin-bottom:-1px}.acf-tab-wrap.-left:first-child .acf-tab-group li:first-child a{border-top:none}.acf-fields.-sidebar{padding:0 0 0 20% !important;position:relative}.acf-fields.-sidebar:before{content:"";display:block;position:absolute;top:0;left:0;width:20%;bottom:0;border-right:#DFDFDF solid 1px;background:#F9F9F9;z-index:1}html[dir="rtl"] .acf-fields.-sidebar{padding:0 20% 0 0 !important}html[dir="rtl"] .acf-fields.-sidebar:before{border-left:#DFDFDF solid 1px;border-right-width:0;left:auto;right:0}.acf-fields.-sidebar.-left{padding:0 0 0 180px !important}html[dir="rtl"] .acf-fields.-sidebar.-left{padding:0 180px 0 0 !important}.acf-fields.-sidebar.-left:before{background:#F1F1F1;border-color:#dfdfdf;width:180px}.acf-fields.-sidebar.-left>.acf-tab-wrap.-left .acf-tab-group{width:180px}.acf-fields.-sidebar.-left>.acf-tab-wrap.-left .acf-tab-group li a{border-color:#e4e4e4}.acf-fields.-sidebar.-left>.acf-tab-wrap.-left .acf-tab-group li.active a{background:#F9F9F9}.acf-fields.-sidebar>.acf-field-tab+.acf-field{border-top:none}.acf-fields.-clear>.acf-tab-wrap{background:transparent}.acf-fields.-clear>.acf-tab-wrap .acf-tab-group{margin-top:0;border-top:none;padding-left:0;padding-right:0}.acf-fields.-clear>.acf-tab-wrap .acf-tab-group li a{background:#e5e5e5}.acf-fields.-clear>.acf-tab-wrap .acf-tab-group li a:hover{background:#fff}.acf-fields.-clear>.acf-tab-wrap .acf-tab-group li.active a{background:#f1f1f1}.acf-postbox.seamless>.acf-fields.-sidebar{margin-left:0 !important}.acf-postbox.seamless>.acf-fields.-sidebar:before{background:transparent}.acf-postbox.seamless>.acf-fields>.acf-tab-wrap{background:transparent;margin-bottom:10px;padding-left:12px;padding-right:12px}.acf-postbox.seamless>.acf-fields>.acf-tab-wrap .acf-tab-group{border-top:0 none}.acf-postbox.seamless>.acf-fields>.acf-tab-wrap .acf-tab-group li a{background:#e5e5e5}.acf-postbox.seamless>.acf-fields>.acf-tab-wrap .acf-tab-group li a:hover{background:#fff}.acf-postbox.seamless>.acf-fields>.acf-tab-wrap .acf-tab-group li.active a{background:#f1f1f1}.acf-postbox.seamless>.acf-fields>.acf-tab-wrap.-left:before{border-top:none;height:auto}.acf-postbox.seamless>.acf-fields>.acf-tab-wrap.-left .acf-tab-group{margin-bottom:0}.acf-postbox.seamless>.acf-fields>.acf-tab-wrap.-left .acf-tab-group li a{border-width:1px 0 1px 1px !important;border-color:#cccccc;background:#e5e5e5}.acf-postbox.seamless>.acf-fields>.acf-tab-wrap.-left .acf-tab-group li.active a{background:#f1f1f1}.menu-edit .acf-fields.-clear>.acf-tab-wrap .acf-tab-group li a,.widget .acf-fields.-clear>.acf-tab-wrap .acf-tab-group li a{background:#f1f1f1}.menu-edit .acf-fields.-clear>.acf-tab-wrap .acf-tab-group li a:hover,.menu-edit .acf-fields.-clear>.acf-tab-wrap .acf-tab-group li.active a,.widget .acf-fields.-clear>.acf-tab-wrap .acf-tab-group li a:hover,.widget .acf-fields.-clear>.acf-tab-wrap .acf-tab-group li.active a{background:#fff}.compat-item .acf-tab-wrap td{display:block}.acf-gallery-side .acf-tab-wrap{border-top:0 none !important}.acf-gallery-side .acf-tab-wrap .acf-tab-group{margin:10px 0 !important;padding:0 !important}.acf-gallery-side .acf-tab-group li.active a{background:#F9F9F9 !important}.widget .acf-tab-group{border-bottom-color:#e8e8e8}.widget .acf-tab-group li a{background:#F1F1F1}.widget .acf-tab-group li.active a{background:#fff}.media-modal.acf-expanded .compat-attachment-fields>tbody>tr.acf-tab-wrap .acf-tab-group{padding-left:23%;border-bottom-color:#DDDDDD}.form-table>tbody>tr.acf-tab-wrap .acf-tab-group{padding:0 5px 0 210px}html[dir="rtl"] .form-table>tbody>tr.acf-tab-wrap .acf-tab-group{padding:0 210px 0 5px}.acf-oembed{position:relative;border:#DFDFDF solid 1px;background:#fff}.acf-oembed .title{position:relative;border-bottom:#DFDFDF solid 1px;padding:5px 10px}.acf-oembed .title .input-search{margin:0;font-size:14px;line-height:30px;height:30px;padding:0;border:0 none;box-shadow:none;border-radius:0;font-family:inherit;cursor:text}.acf-oembed .title .acf-actions{padding:6px}.acf-oembed .canvas{position:relative;min-height:250px;background:#F9F9F9}.acf-oembed .canvas .canvas-media{position:relative;z-index:1}.acf-oembed .canvas iframe{display:block;margin:0;padding:0;width:100%}.acf-oembed .canvas .acf-icon.-picture{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);z-index:0;height:42px;width:42px;font-size:42px;color:#999}.acf-oembed .canvas .acf-loading-overlay{background:rgba(255,255,255,0.9)}.acf-oembed .canvas .canvas-error{position:absolute;top:50%;left:0%;right:0%;margin:-9px 0 0 0;text-align:center;display:none}.acf-oembed .canvas .canvas-error p{padding:8px;margin:0;display:inline}.acf-oembed.has-value .canvas{min-height:50px}.acf-oembed.has-value .input-search{font-weight:bold}.acf-oembed.has-value .title:hover .acf-actions{display:block}.acf-image-uploader{position:relative}.acf-image-uploader:after{display:block;clear:both;content:""}.acf-image-uploader p{margin:0}.acf-image-uploader .image-wrap{position:relative;float:left}.acf-image-uploader .image-wrap img{max-width:100%;width:auto;height:auto;display:block;min-width:30px;min-height:30px;background:#f1f1f1;margin:0;padding:0}.acf-image-uploader .image-wrap img[src$=".svg"]{min-height:100px;min-width:100px}.acf-image-uploader .image-wrap:hover .acf-actions{display:block}.acf-image-uploader input.button{width:auto}html[dir="rtl"] .acf-image-uploader .image-wrap{float:right}.acf-file-uploader{position:relative}.acf-file-uploader p{margin:0}.acf-file-uploader .file-wrap{border:#DFDFDF solid 1px;min-height:84px;position:relative;background:#fff}.acf-file-uploader .file-icon{position:absolute;top:0;left:0;bottom:0;padding:10px;background:#F1F1F1;border-right:#E5E5E5 solid 1px}.acf-file-uploader .file-icon img{display:block;padding:0;margin:0;max-width:48px}.acf-file-uploader .file-info{padding:10px;margin-left:69px}.acf-file-uploader .file-info p{margin:0 0 2px;font-size:13px;line-height:1.4em;word-break:break-all}.acf-file-uploader .file-info a{text-decoration:none}.acf-file-uploader:hover .acf-actions{display:block}html[dir="rtl"] .acf-file-uploader .file-icon{left:auto;right:0;border-left:#E5E5E5 solid 1px;border-right:none}html[dir="rtl"] .acf-file-uploader .file-info{margin-right:69px;margin-left:0}.acf-ui-datepicker .ui-datepicker{z-index:900000 !important}.acf-ui-datepicker .ui-datepicker .ui-widget-header a{cursor:pointer;transition:none}.acf-ui-datepicker .ui-state-highlight.ui-state-hover{border:1px solid #98b7e8 !important;background:#98b7e8 !important;font-weight:normal !important;color:#ffffff !important}.acf-ui-datepicker .ui-state-highlight.ui-state-active{border:1px solid #3875d7 !important;background:#3875d7 !important;font-weight:normal !important;color:#ffffff !important}.acf-field-separator .acf-label{margin-bottom:0}.acf-field-separator .acf-label label{font-weight:normal}.acf-field-separator .acf-input{display:none}.acf-fields>.acf-field-separator{background:#f9f9f9;border-bottom:1px solid #dfdfdf;border-top:1px solid #dfdfdf;margin-bottom:-1px;z-index:2}.acf-taxonomy-field{position:relative}.acf-taxonomy-field .categorychecklist-holder{border:#DFDFDF solid 1px;border-radius:3px;max-height:200px;overflow:auto}.acf-taxonomy-field .acf-checkbox-list{margin:0;padding:10px}.acf-taxonomy-field .acf-checkbox-list ul.children{padding-left:18px}.acf-taxonomy-field:hover .acf-actions{display:block}.acf-taxonomy-field[data-ftype="select"] .acf-actions{padding:0;margin:-9px}.acf-range-wrap .acf-append,.acf-range-wrap .acf-prepend{display:inline-block;vertical-align:middle;line-height:28px;margin:0 7px 0 0}.acf-range-wrap .acf-append{margin:0 0 0 7px}.acf-range-wrap input[type="range"]{display:inline-block;padding:0;margin:0;vertical-align:middle;height:28px}.acf-range-wrap input[type="range"]:focus{outline:none}.acf-range-wrap input[type="number"]{display:inline-block;min-width:3em;margin-left:10px;vertical-align:middle}html[dir="rtl"] .acf-range-wrap input[type="number"]{margin-right:10px;margin-left:0}html[dir="rtl"] .acf-range-wrap .acf-append{margin:0 7px 0 0}html[dir="rtl"] .acf-range-wrap .acf-prepend{margin:0 0 0 7px}.acf-accordion{margin:0;padding:0;background:#fff}.acf-accordion .acf-accordion-title{margin:0;padding:12px;font-weight:bold;cursor:pointer;font-size:inherit;font-size:13px;line-height:1.4em}.acf-accordion .acf-accordion-title label{margin:0;padding:0;font-size:13px;line-height:1.4em}.acf-accordion .acf-accordion-title p{font-weight:normal}.acf-accordion .acf-accordion-title .acf-accordion-icon{float:right}.acf-accordion .acf-accordion-content{margin:0;padding:0 12px 12px;display:none}.acf-accordion.-open>.acf-accordion-content{display:block}.acf-field.acf-accordion{padding:0 !important;border-color:#dfdfdf}.acf-field.acf-accordion .acf-accordion-title{padding:12px;width:auto !important;float:none !important;width:auto !important}.acf-field.acf-accordion .acf-accordion-content{padding:0;float:none !important;width:auto !important}.acf-field.acf-accordion .acf-accordion-content>.acf-fields{border-top:#EEEEEE solid 1px}.acf-field.acf-accordion .acf-accordion-content>.acf-fields.-clear{padding:0 12px 15px}.acf-fields.-left>.acf-field.acf-accordion{padding:0 !important}.acf-fields.-left>.acf-field.acf-accordion:before{display:none}.acf-fields.-left>.acf-field.acf-accordion .acf-accordion-title{width:auto;margin:0 !important;padding:12px;float:none !important}.acf-fields.-left>.acf-field.acf-accordion .acf-accordion-content{padding:0 !important}.acf-fields.-clear>.acf-field.acf-accordion{border:#cccccc solid 1px;background:transparent}.acf-fields.-clear>.acf-field.acf-accordion+.acf-field.acf-accordion{margin-top:-16px}tr.acf-field.acf-accordion{background:transparent}tr.acf-field.acf-accordion>.acf-input{padding:0 !important;border:#cccccc solid 1px}tr.acf-field.acf-accordion .acf-accordion-content{padding:0 12px 12px}#addtag div.acf-field.error{border:0 none;padding:8px 0}#addtag>.acf-field.acf-accordion{padding-right:0;margin-right:5%}#addtag>.acf-field.acf-accordion+p.submit{margin-top:0}tr.acf-accordion{margin:15px 0 !important}tr.acf-accordion+tr.acf-accordion{margin-top:-16px !important}.acf-postbox.seamless>.acf-fields>.acf-accordion{margin-left:12px !important;margin-right:12px !important}.widget .widget-content>.acf-field.acf-accordion{border:#dfdfdf solid 1px;margin-bottom:10px}.widget .widget-content>.acf-field.acf-accordion .acf-accordion-title{margin-bottom:0}.widget .widget-content>.acf-field.acf-accordion+.acf-field.acf-accordion{margin-top:-11px}.acf-postbox.seamless>.acf-fields>.acf-field.acf-accordion{border:#e5e5e5 solid 1px}.acf-postbox.seamless>.acf-fields>.acf-field.acf-accordion+.acf-field.acf-accordion{margin-top:-1px}.media-modal .compat-attachment-fields .acf-field.acf-accordion+.acf-field.acf-accordion{margin-top:-1px}.media-modal .compat-attachment-fields .acf-field.acf-accordion>.acf-input{width:100%}.media-modal .compat-attachment-fields .acf-field.acf-accordion .compat-attachment-fields>tbody>tr>td{padding-bottom:5px}.form-table>tbody>.acf-field>.acf-label{padding:20px 10px 20px 0;width:210px}html[dir="rtl"] .form-table>tbody>.acf-field>.acf-label{padding:20px 0 20px 10px}.form-table>tbody>.acf-field>.acf-label label{font-size:14px;color:#23282d}.form-table>tbody>.acf-field>.acf-input{padding:15px 10px}html[dir="rtl"] .form-table>tbody>.acf-field>.acf-input{padding:15px 10px 15px 5%}.form-table>tbody>.acf-tab-wrap td{padding:15px 5% 15px 0}html[dir="rtl"] .form-table>tbody>.acf-tab-wrap td{padding:15px 0 15px 5%}.form-table>tbody .form-table th.acf-th{width:auto}#your-profile .acf-field input[type="text"],#your-profile .acf-field input[type="password"],#your-profile .acf-field input[type="number"],#your-profile .acf-field input[type="search"],#your-profile .acf-field input[type="email"],#your-profile .acf-field input[type="url"],#your-profile .acf-field select,#createuser .acf-field input[type="text"],#createuser .acf-field input[type="password"],#createuser .acf-field input[type="number"],#createuser .acf-field input[type="search"],#createuser .acf-field input[type="email"],#createuser .acf-field input[type="url"],#createuser .acf-field select{max-width:25em}#your-profile .acf-field textarea,#createuser .acf-field textarea{max-width:500px}#your-profile .acf-field .acf-field input[type="text"],#your-profile .acf-field .acf-field input[type="password"],#your-profile .acf-field .acf-field input[type="number"],#your-profile .acf-field .acf-field input[type="search"],#your-profile .acf-field .acf-field input[type="email"],#your-profile .acf-field .acf-field input[type="url"],#your-profile .acf-field .acf-field textarea,#your-profile .acf-field .acf-field select,#createuser .acf-field .acf-field input[type="text"],#createuser .acf-field .acf-field input[type="password"],#createuser .acf-field .acf-field input[type="number"],#createuser .acf-field .acf-field input[type="search"],#createuser .acf-field .acf-field input[type="email"],#createuser .acf-field .acf-field input[type="url"],#createuser .acf-field .acf-field textarea,#createuser .acf-field .acf-field select{max-width:none}#registerform h2{margin:1em 0}#registerform .acf-field .acf-label{margin-bottom:0}#registerform .acf-field .acf-label label{font-weight:normal;font-size:14px}#registerform p.submit{text-align:right}#acf-term-fields{padding-right:5%}#acf-term-fields>.acf-field>.acf-label{margin:0}#acf-term-fields>.acf-field>.acf-label label{font-size:12px;font-weight:normal}p.submit .spinner,p.submit .acf-spinner{vertical-align:top;float:none;margin:4px 4px 0}#edittag .acf-fields.-left>.acf-field{padding-left:220px}#edittag .acf-fields.-left>.acf-field:before{width:209px}#edittag .acf-fields.-left>.acf-field>.acf-label{width:220px;margin-left:-220px;padding:0 10px}#edittag .acf-fields.-left>.acf-field>.acf-input{padding:0}#edittag>.acf-fields.-left{width:96%}#edittag>.acf-fields.-left>.acf-field>.acf-label{padding-left:0}.editcomment td:first-child{white-space:nowrap;width:131px}#widgets-right .widget .acf-field .description{padding-left:0;padding-right:0}.acf-widget-fields>.acf-field .acf-label{margin-bottom:5px}.acf-widget-fields>.acf-field .acf-label label{font-weight:normal;margin:0}.acf-menu-settings{border-top:1px solid #eee;margin-top:2em}.acf-menu-settings.-seamless{border-top:none;margin-top:15px}.acf-menu-settings.-seamless>h2{display:none}.acf-menu-settings .list li{display:block;margin-bottom:0}.acf-menu-item-fields{margin-right:10px;float:left}#post .compat-attachment-fields .compat-field-acf-form-data{display:none}#post .compat-attachment-fields,#post .compat-attachment-fields>tbody,#post .compat-attachment-fields>tbody>tr,#post .compat-attachment-fields>tbody>tr>th,#post .compat-attachment-fields>tbody>tr>td{display:block}#post .compat-attachment-fields>tbody>.acf-field{margin:15px 0}#post .compat-attachment-fields>tbody>.acf-field>.acf-label{margin:0}#post .compat-attachment-fields>tbody>.acf-field>.acf-label label{margin:0;padding:0}#post .compat-attachment-fields>tbody>.acf-field>.acf-label label p{margin:0 0 3px !important}#post .compat-attachment-fields>tbody>.acf-field>.acf-input{margin:0}.media-modal .compat-attachment-fields td.acf-input table{display:table;table-layout:auto}.media-modal .compat-attachment-fields td.acf-input table tbody{display:table-row-group}.media-modal .compat-attachment-fields td.acf-input table tr{display:table-row}.media-modal .compat-attachment-fields td.acf-input table td,.media-modal .compat-attachment-fields td.acf-input table th{display:table-cell}.media-modal .compat-attachment-fields>tbody>.acf-field{margin:5px 0}.media-modal .compat-attachment-fields>tbody>.acf-field>.acf-label{min-width:30%;margin:0;padding:0;float:left;text-align:right;display:block;float:left}.media-modal .compat-attachment-fields>tbody>.acf-field>.acf-label>label{padding-top:6px;margin:0;color:#666666;font-weight:400;line-height:16px}.media-modal .compat-attachment-fields>tbody>.acf-field>.acf-input{width:65%;margin:0;padding:0;float:right;display:block}.media-modal .compat-attachment-fields>tbody>.acf-field p.description{margin:0}.acf-selection-error{background:#ffebe8;border:1px solid #c00;border-radius:3px;padding:8px;margin:20px 0 0}.acf-selection-error .selection-error-label{background:#CC0000;border-radius:3px;color:#fff;font-weight:bold;margin-right:8px;padding:2px 4px}.acf-selection-error .selection-error-message{color:#b44;display:block;padding-top:8px;word-wrap:break-word;white-space:pre-wrap}.media-modal .attachment.acf-disabled .thumbnail{opacity:0.25 !important}.media-modal .attachment.acf-disabled .attachment-preview:before{background:rgba(0,0,0,0.15);z-index:1;position:relative}.media-modal .compat-field-acf-form-data,.media-modal .compat-field-acf-blank{display:none !important}.media-modal .upload-error-message{white-space:pre-wrap}.media-modal .acf-required{padding:0 !important;margin:0 !important;float:none !important;color:#f00 !important}.media-modal .media-sidebar .compat-item{padding-bottom:20px}@media (max-width: 900px){.media-modal .setting span,.media-modal .compat-attachment-fields>tbody>.acf-field>.acf-label{width:98%;float:none;text-align:left;min-height:0;padding:0}.media-modal .setting input,.media-modal .setting textarea,.media-modal .compat-attachment-fields>tbody>.acf-field>.acf-input{float:none;height:auto;max-width:none;width:98%}}.media-modal .acf-expand-details{float:right;padding:1px 10px;margin-right:6px;height:18px;line-height:18px;color:#AAAAAA;font-size:12px}.media-modal .acf-expand-details:focus,.media-modal .acf-expand-details:active{outline:0 none;box-shadow:none;color:#AAAAAA}.media-modal .acf-expand-details:hover{color:#666666 !important}.media-modal .acf-expand-details span{display:block;float:left}.media-modal .acf-expand-details .acf-icon{margin:0 4px 0 0}.media-modal .acf-expand-details:hover .acf-icon{border-color:#AAAAAA}.media-modal .acf-expand-details .is-open{display:none}.media-modal .acf-expand-details .is-closed{display:block}@media (max-width: 640px){.media-modal .acf-expand-details{display:none}}.media-modal.acf-expanded .acf-expand-details .is-open{display:block}.media-modal.acf-expanded .acf-expand-details .is-closed{display:none}.media-modal.acf-expanded .attachments-browser .media-toolbar,.media-modal.acf-expanded .attachments-browser .attachments{right:740px}.media-modal.acf-expanded .media-sidebar{width:708px}.media-modal.acf-expanded .media-sidebar .attachment-info .thumbnail,.media-modal.acf-expanded .media-sidebar .setting span,.media-modal.acf-expanded .media-sidebar .compat-attachment-fields>tbody>.acf-field>.acf-label{min-width:20%}.media-modal.acf-expanded .media-sidebar .attachment-info .details,.media-modal.acf-expanded .media-sidebar .setting input,.media-modal.acf-expanded .media-sidebar .setting textarea,.media-modal.acf-expanded .media-sidebar .compat-attachment-fields>tbody>.acf-field>.acf-input{min-width:77%}.media-modal.acf-expanded .media-sidebar .setting span{margin-right:2%}.media-modal.acf-expanded .media-sidebar .attachment-info .thumbnail{max-height:none}.media-modal.acf-expanded .media-sidebar .attachment-info .thumbnail img{max-width:100%;max-height:200px}.media-modal.acf-expanded .media-sidebar .attachment-info .details{float:right}@media (max-width: 900px){.media-modal.acf-expanded .attachments-browser .media-toolbar{display:none}.media-modal.acf-expanded .attachments{display:none}.media-modal.acf-expanded .media-sidebar{width:auto;max-width:none !important}.media-modal.acf-expanded .media-sidebar .attachment-info .thumbnail{min-width:30%;margin:0}.media-modal.acf-expanded .media-sidebar .attachment-info .details{min-width:67%}}.acf-media-modal .media-embed .setting.align,.acf-media-modal .media-embed .setting.link-to{display:none}@media screen and (min-width: 1024px){.acf-media-modal .media-modal-content .media-frame .media-toolbar-secondary{max-width:none}.acf-media-modal .media-modal-content .media-frame .media-toolbar-secondary select.attachment-filters{width:auto;min-width:150px;max-width:none;margin:11px 6px 0 0;vertical-align:middle}}.acf-media-modal.-edit{left:15%;right:15%;top:100px;bottom:100px}.acf-media-modal.-edit .media-frame-menu,.acf-media-modal.-edit .media-frame-router,.acf-media-modal.-edit .media-frame-content .attachments,.acf-media-modal.-edit .media-frame-content .media-toolbar{display:none}.acf-media-modal.-edit .media-frame-title,.acf-media-modal.-edit .media-frame-content,.acf-media-modal.-edit .media-frame-toolbar,.acf-media-modal.-edit .media-sidebar{width:auto;left:0;right:0}.acf-media-modal.-edit .media-frame-content{top:50px}.acf-media-modal.-edit .media-frame-title{border-bottom:1px solid #DFDFDF;box-shadow:0 4px 4px -4px rgba(0,0,0,0.1)}.acf-media-modal.-edit .media-sidebar{padding:0 16px}.acf-media-modal.-edit .media-sidebar .attachment-details{overflow:visible}.acf-media-modal.-edit .media-sidebar .attachment-details>h3,.acf-media-modal.-edit .media-sidebar .attachment-details>h2{display:none}.acf-media-modal.-edit .media-sidebar .attachment-details .attachment-info{background:#fff;border-bottom:#dddddd solid 1px;padding:16px;margin:0 -16px 16px}.acf-media-modal.-edit .media-sidebar .attachment-details .thumbnail{margin:0 16px 0 0}.acf-media-modal.-edit .media-sidebar .attachment-details .setting{display:block;overflow:hidden;float:none;width:auto;margin:0 0 5px}.acf-media-modal.-edit .media-sidebar .attachment-details .setting span{margin:0}.acf-media-modal.-edit .media-sidebar .compat-attachment-fields>tbody>.acf-field{margin:0 0 5px}.acf-media-modal.-edit .media-sidebar .compat-attachment-fields>tbody>.acf-field p.description{margin-top:3px}.acf-media-modal.-edit .media-sidebar .media-types-required-info{display:none}@media (max-width: 900px){.acf-media-modal.-edit{top:30px;right:30px;bottom:30px;left:30px}}@media (max-width: 640px){.acf-media-modal.-edit{top:0;right:0;bottom:0;left:0}.acf-media-modal.-edit .media-sidebar{bottom:0 !important}}.acf-temp-remove{position:relative;opacity:1;-webkit-transition:all 0.25s ease;-moz-transition:all 0.25s ease;-o-transition:all 0.25s ease;transition:all 0.25s ease;overflow:hidden}.acf-temp-remove:after{display:block;content:"";position:absolute;top:0;left:0;right:0;bottom:0;z-index:99}.hidden-by-conditional-logic{display:none !important}.hidden-by-conditional-logic.appear-empty{display:table-cell !important}.hidden-by-conditional-logic.appear-empty .acf-input{display:none !important}.acf-postbox.acf-hidden{display:none !important}
|
1 |
+
.acf-field,.acf-field .acf-label,.acf-field .acf-input{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:relative}.acf-field{margin:15px 0;clear:both}.acf-field p.description{display:block;margin:0;padding:0}.acf-field .acf-label{vertical-align:top;margin:0 0 10px}.acf-field .acf-label label{display:block;font-weight:bold;margin:0 0 3px;padding:0}.acf-field .acf-label:empty{margin-bottom:0}.acf-field .acf-input{vertical-align:top}.acf-field .acf-input>p.description{margin-top:5px}.acf-field .acf-notice{margin:0 0 15px;background:#edf2ff;color:#2183b9;border:none}.acf-field .acf-notice .acf-notice-dismiss{background:transparent;color:inherit}.acf-field .acf-notice .acf-notice-dismiss:hover{background:#fff}.acf-field .acf-notice.-dismiss{padding-right:40px}.acf-field .acf-notice.-error{background:#ffe6e6;color:#d12626}.acf-field .acf-notice.-success{background:#eefbe8;color:#32a23b}.acf-field .acf-notice.-warning{background:#fff3e6;color:#d16226}td.acf-field,tr.acf-field{margin:0}.acf-field[data-width]{float:left;clear:none}.acf-field[data-width]+.acf-field[data-width]{border-left:1px solid #eeeeee}html[dir="rtl"] .acf-field[data-width]{float:right}html[dir="rtl"] .acf-field[data-width]+.acf-field[data-width]{border-left:none;border-right:1px solid #eeeeee}td.acf-field[data-width],tr.acf-field[data-width]{float:none}.acf-field.-c0{clear:both;border-left-width:0 !important}html[dir="rtl"] .acf-field.-c0{border-left-width:1px !important;border-right-width:0 !important}.acf-field.-r0{border-top-width:0 !important}.acf-fields{position:relative}.acf-fields:after{display:block;clear:both;content:""}.acf-fields.-border{border:#dfdfdf solid 1px;background:#fff}.acf-fields>.acf-field{position:relative;margin:0;padding:15px 12px;border-top:#EEEEEE solid 1px}.acf-fields>.acf-field:first-child{border-top-width:0}td.acf-fields{padding:0 !important}.acf-fields.-clear>.acf-field{border:none;padding:0;margin:15px 0}.acf-fields.-clear>.acf-field[data-width]{border:none !important}.acf-fields.-clear>.acf-field>.acf-label{padding:0}.acf-fields.-clear>.acf-field>.acf-input{padding:0}.acf-fields.-left>.acf-field{padding:15px 0}.acf-fields.-left>.acf-field:after{display:block;clear:both;content:""}.acf-fields.-left>.acf-field:before{content:"";display:block;position:absolute;z-index:0;background:#F9F9F9;border-color:#E1E1E1;border-style:solid;border-width:0 1px 0 0;top:0;bottom:0;left:0;width:20%}.acf-fields.-left>.acf-field[data-width]{float:none;width:auto !important;border-left-width:0 !important;border-right-width:0 !important}.acf-fields.-left>.acf-field>.acf-label{float:left;width:20%;margin:0;padding:0 12px}.acf-fields.-left>.acf-field>.acf-input{float:left;width:80%;margin:0;padding:0 12px}html[dir="rtl"] .acf-fields.-left>.acf-field:before{border-width:0 0 0 1px;left:auto;right:0}html[dir="rtl"] .acf-fields.-left>.acf-field>.acf-label{float:right}html[dir="rtl"] .acf-fields.-left>.acf-field>.acf-input{float:right}@media screen and (max-width: 640px){.acf-fields.-left>.acf-field:before{display:none}.acf-fields.-left>.acf-field>.acf-label{width:100%;margin-bottom:10px}.acf-fields.-left>.acf-field>.acf-input{width:100%}}.acf-fields.-clear.-left>.acf-field{padding:0;border:none}.acf-fields.-clear.-left>.acf-field:before{display:none}.acf-fields.-clear.-left>.acf-field>.acf-label{padding:0}.acf-fields.-clear.-left>.acf-field>.acf-input{padding:0}.acf-table tr.acf-field>td.acf-label{padding:15px 12px;margin:0;background:#F9F9F9;width:20%}.acf-table tr.acf-field>td.acf-input{padding:15px 12px;margin:0;border-left-color:#E1E1E1}.acf-sortable-tr-helper{position:relative !important;display:table-row !important}.acf-postbox{position:relative}.acf-postbox>.inside{margin:0 !important;padding:0 !important}.acf-postbox>.hndle .acf-hndle-cog{color:#AAAAAA;font-size:16px;line-height:20px;padding:0 2px;float:right;position:relative;display:none}.acf-postbox>.hndle .acf-hndle-cog:hover{color:#777777}.acf-postbox:hover>.hndle .acf-hndle-cog{display:block}.acf-postbox .acf-replace-with-fields{padding:15px;text-align:center}#post-body-content #acf_after_title-sortables{margin:20px 0 -20px}.acf-postbox.seamless{border:0 none;background:transparent;box-shadow:none}.acf-postbox.seamless>.hndle,.acf-postbox.seamless>.handlediv{display:none !important}.acf-postbox.seamless>.inside{display:block !important;margin-left:-12px !important;margin-right:-12px !important}.acf-postbox.seamless>.inside>.acf-field{border-color:transparent}.acf-postbox.seamless>.acf-fields.-left>.acf-field:before{display:none}@media screen and (max-width: 782px){.acf-postbox.seamless>.acf-fields.-left>.acf-field>.acf-label,.acf-postbox.seamless>.acf-fields.-left>.acf-field>.acf-input{padding:0}}.acf-field input[type="text"],.acf-field input[type="password"],.acf-field input[type="number"],.acf-field input[type="search"],.acf-field input[type="email"],.acf-field input[type="url"],.acf-field textarea,.acf-field select{width:100%;padding:3px 5px;resize:none;margin:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;font-size:14px;line-height:1.4}.acf-field input[type="text"]:disabled,.acf-field input[type="password"]:disabled,.acf-field input[type="number"]:disabled,.acf-field input[type="search"]:disabled,.acf-field input[type="email"]:disabled,.acf-field input[type="url"]:disabled,.acf-field textarea:disabled,.acf-field select:disabled{background:#f8f8f8}.acf-field input[type="text"][readonly],.acf-field input[type="password"][readonly],.acf-field input[type="number"][readonly],.acf-field input[type="search"][readonly],.acf-field input[type="email"][readonly],.acf-field input[type="url"][readonly],.acf-field textarea[readonly],.acf-field select[readonly]{background:#f8f8f8}.acf-field textarea{resize:vertical}.acf-input-prepend,.acf-input-append,.acf-input-wrap{box-sizing:border-box}.acf-input-prepend,.acf-input-append{font-size:13px;line-height:20px;padding:3px 7px;background:#F4F4F4;border:#DFDFDF solid 1px}.acf-input-prepend{float:left;border-right-width:0;border-radius:3px 0 0 3px}.acf-input-append{float:right;border-left-width:0;border-radius:0 3px 3px 0}.acf-input-wrap{position:relative;overflow:hidden}.acf-input-wrap input{height:28px;margin:0}input.acf-is-prepended{border-radius:0 3px 3px 0 !important}input.acf-is-appended{border-radius:3px 0 0 3px !important}input.acf-is-prepended.acf-is-appended{border-radius:0 !important}html[dir="rtl"] .acf-input-prepend{border-left-width:0;border-right-width:1px;border-radius:0 3px 3px 0;float:right}html[dir="rtl"] .acf-input-append{border-left-width:1px;border-right-width:0;border-radius:3px 0 0 3px;float:left}html[dir="rtl"] input.acf-is-prepended{border-radius:3px 0 0 3px !important}html[dir="rtl"] input.acf-is-appended{border-radius:0 3px 3px 0 !important}html[dir="rtl"] input.acf-is-prepended.acf-is-appended{border-radius:0 !important}.acf-color-picker .wp-picker-active{position:relative;z-index:1}.acf-url i{position:absolute;top:4px;left:4px;opacity:0.5;color:#A9A9A9}.acf-url input[type="url"]{padding-left:25px}.acf-url.-valid i{opacity:1}.acf-field select{padding:2px}.acf-field select optgroup{padding:5px;background:#fff}.acf-field select option{padding:3px}.acf-field select optgroup option{padding-left:5px}.acf-field select optgroup:nth-child(2n){background:#F9F9F9}.acf-field .select2-input{max-width:200px}.select2-container.-acf .select2-choices{background:#fff;border-color:#ddd;box-shadow:0 1px 2px rgba(0,0,0,0.07) inset;min-height:31px}.select2-container.-acf .select2-choices .select2-search-choice{margin:5px 0 5px 5px;padding:3px 5px 3px 18px;border-color:#bbb;background:#f9f9f9;box-shadow:0 1px 0 rgba(255,255,255,0.25) inset}.select2-container.-acf .select2-choices .select2-search-choice.ui-sortable-helper{background:#5897fb;border-color:#3f87fa;color:#fff;box-shadow:0 0 3px rgba(0,0,0,0.1)}.select2-container.-acf .select2-choices .select2-search-choice.ui-sortable-helper a{visibility:hidden}.select2-container.-acf .select2-choices .select2-search-choice.ui-sortable-placeholder{background-color:#f7f7f7;border-color:#f7f7f7;visibility:visible !important}.select2-container.-acf .select2-choices .select2-search-choice-focus{border-color:#999}.select2-container.-acf .select2-choices .select2-search-field input{height:31px;line-height:22px;margin:0;padding:5px 5px 5px 7px}.select2-container.-acf .select2-choice{border-color:#BBBBBB}.select2-container.-acf .select2-choice .select2-arrow{background:transparent;border-left-color:#DFDFDF;padding-left:1px}.select2-container.-acf .select2-choice .select2-result-description{display:none}.select2-container.-acf.select2-container-active .select2-choices,.select2-container.-acf.select2-dropdown-open .select2-choices{border-color:#5B9DD9;border-radius:3px 3px 0 0}.select2-container.-acf.select2-dropdown-open .select2-choice{background:#fff;border-color:#5B9DD9}html[dir="rtl"] .select2-container.-acf .select2-search-choice-close{left:24px}html[dir="rtl"] .select2-container.-acf .select2-choice>.select2-chosen{margin-left:42px}html[dir="rtl"] .select2-container.-acf .select2-choice .select2-arrow{padding-left:0;padding-right:1px}.select2-drop .select2-search{padding:4px 4px 0}.select2-drop .select2-result .select2-result-description{color:#999;font-size:12px;margin-left:5px}.select2-drop .select2-result.select2-highlighted .select2-result-description{color:#fff;opacity:0.75}.select2-container.-acf li{margin-bottom:0}.select2-container.-acf .select2-selection--multiple .select2-search--inline:first-child{float:none}.select2-container.-acf .select2-selection--multiple .select2-search--inline:first-child input{width:100% !important}.select2-container.-acf .select2-selection--multiple .select2-selection__rendered{padding-right:0}.select2-container.-acf .select2-selection--multiple .select2-selection__choice{background-color:#f7f7f7;border-color:#cccccc;max-width:100%;overflow:hidden;word-wrap:normal !important;white-space:normal}.select2-container.-acf .select2-selection--multiple .select2-selection__choice.ui-sortable-helper{background:#5897fb;border-color:#3f87fa;color:#fff;box-shadow:0 0 3px rgba(0,0,0,0.1)}.select2-container.-acf .select2-selection--multiple .select2-selection__choice.ui-sortable-helper span{visibility:hidden}.select2-container.-acf .select2-selection--multiple .select2-selection__choice.ui-sortable-placeholder{background-color:#f7f7f7;border-color:#f7f7f7;visibility:visible !important}.select2-container.-acf .select2-selection--multiple .select2-search__field{box-shadow:none !important}.acf-row .select2-container.-acf .select2-selection--single{overflow:hidden}.acf-row .select2-container.-acf .select2-selection--single .select2-selection__rendered{white-space:normal}.select2-container .select2-dropdown{z-index:900000}.link-wrap{border:#dddddd solid 1px;border-radius:3px;padding:5px;line-height:26px;background:#fff;word-wrap:break-word;word-break:break-all}.link-wrap .link-title{padding:0 5px}.acf-link .link-wrap,.acf-link .acf-icon.-link-ext{display:none}.acf-link.-value .button{display:none}.acf-link.-value .link-wrap{display:inline-block}.acf-link.-external .acf-icon.-link-ext{display:inline-block}#wp-link-backdrop{z-index:900000 !important}#wp-link-wrap{z-index:900001 !important}ul.acf-radio-list,ul.acf-checkbox-list{background:transparent;position:relative;padding:1px;margin:0}ul.acf-radio-list li,ul.acf-checkbox-list li{font-size:13px;line-height:22px;margin:0;position:relative;word-wrap:break-word}ul.acf-radio-list li label,ul.acf-checkbox-list li label{display:inline}ul.acf-radio-list li input[type="checkbox"],ul.acf-radio-list li input[type="radio"],ul.acf-checkbox-list li input[type="checkbox"],ul.acf-checkbox-list li input[type="radio"]{margin:-1px 4px 0 0;vertical-align:middle}ul.acf-radio-list li input[type="text"],ul.acf-checkbox-list li input[type="text"]{width:auto;vertical-align:middle;margin:2px 0}ul.acf-radio-list li span,ul.acf-checkbox-list li span{float:none}ul.acf-radio-list li i,ul.acf-checkbox-list li i{vertical-align:middle}ul.acf-radio-list.acf-hl li,ul.acf-checkbox-list.acf-hl li{margin-right:20px;clear:none}html[dir="rtl"] ul.acf-radio-list input[type="checkbox"],html[dir="rtl"] ul.acf-radio-list input[type="radio"],html[dir="rtl"] ul.acf-checkbox-list input[type="checkbox"],html[dir="rtl"] ul.acf-checkbox-list input[type="radio"]{margin-left:4px;margin-right:0}.acf-button-group{display:inline-block}.acf-button-group label{display:inline-block;border:#ccc solid 1px;position:relative;z-index:1;padding:5px 10px;background:#fff}.acf-button-group label:hover{border-color:#999;z-index:2}.acf-button-group label.selected{border-color:#2b9af3;background:#309cf3;color:#fff;z-index:2}.acf-button-group label.selected:hover{background:#48a8f4}.acf-button-group input{display:none !important}.acf-button-group{padding-left:1px;display:inline-flex;flex-direction:row;flex-wrap:nowrap}.acf-button-group label{margin:0 0 0 -1px;flex:1;text-align:center;white-space:nowrap}.acf-button-group label:first-child{border-radius:3px 0 0 3px}html[dir="rtl"] .acf-button-group label:first-child{border-radius:0 3px 3px 0}.acf-button-group label:last-child{border-radius:0 3px 3px 0}html[dir="rtl"] .acf-button-group label:last-child{border-radius:3px 0 0 3px}.acf-button-group label:only-child{border-radius:3px}.acf-button-group.-vertical{padding-left:0;padding-top:1px;flex-direction:column}.acf-button-group.-vertical label{margin:-1px 0 0 0}.acf-button-group.-vertical label:first-child{border-radius:3px 3px 0 0}.acf-button-group.-vertical label:last-child{border-radius:0 0 3px 3px}.acf-button-group.-vertical label:only-child{border-radius:3px}.acf-checkbox-list .button{margin:10px 0 0}.acf-switch{display:inline-block;border-radius:5px;cursor:pointer;position:relative;background:#f8f8f8;height:30px;vertical-align:middle;border:#ccc solid 1px;-webkit-transition:background 0.25s ease;-moz-transition:background 0.25s ease;-o-transition:background 0.25s ease;transition:background 0.25s ease}.acf-switch span{display:inline-block;float:left;text-align:center;font-size:13px;line-height:22px;padding:4px 10px;min-width:15px}.acf-switch span i{vertical-align:middle}.acf-switch .acf-switch-on{color:#fff;text-shadow:#1f7db1 0 1px 0}.acf-switch .acf-switch-slider{position:absolute;top:2px;left:2px;bottom:2px;right:50%;z-index:1;background:#fff;border-radius:3px;border:#ccc solid 1px;-webkit-transition:all 0.25s ease;-moz-transition:all 0.25s ease;-o-transition:all 0.25s ease;transition:all 0.25s ease;transition-property:left, right}.acf-switch:hover .acf-switch-slider{border-color:#b3b3b3}.acf-switch.-on{background:#309cf3;border-color:#2b9af3}.acf-switch.-on .acf-switch-slider{left:50%;right:2px;border-color:#0d84e3}.acf-switch.-on:hover{background:#48a8f4}.acf-switch.-focus .acf-switch-slider{border-color:#5b9dd9;box-shadow:0 0 2px rgba(30,140,190,0.5)}.acf-switch.-focus.-on .acf-switch-slider{border-color:#185e85;box-shadow:0 0 2px #1f7db1}.acf-switch+span{margin-left:6px}.acf-switch-input{opacity:0;position:absolute;margin:0}.compat-item .acf-true-false .message{float:none;padding:0;vertical-align:middle}.acf-google-map{position:relative;border:#DFDFDF solid 1px;background:#fff}.acf-google-map .title{position:relative;border-bottom:#DFDFDF solid 1px}.acf-google-map .title .search{margin:0;font-size:14px;line-height:30px;height:40px;padding:5px 10px;border:0 none;box-shadow:none;border-radius:0;font-family:inherit;cursor:text}.acf-google-map .title .acf-loading{position:absolute;top:10px;right:11px;display:none}.acf-google-map .title:hover .acf-actions{display:block}.acf-google-map .canvas{height:400px}.acf-google-map .title .acf-icon.-location{display:inline-block}.acf-google-map .title .acf-icon.-cancel{display:none}.acf-google-map .title .acf-icon.-search{display:none}.acf-google-map.-search .title .acf-icon.-location{display:none}.acf-google-map.-search .title .acf-icon.-cancel{display:inline-block}.acf-google-map.-search .title .acf-icon.-search{display:inline-block}.acf-google-map.-value .title .search{font-weight:bold}.acf-google-map.-value .title .acf-icon.-location{display:none}.acf-google-map.-value .title .acf-icon.-cancel{display:inline-block}.acf-google-map.-value .title .acf-icon.-search{display:none}.acf-google-map.-loading .title a{display:none !important}.acf-google-map.-loading .title i{display:inline-block}.pac-container{border-width:1px 0;box-shadow:none}.pac-container:after{display:none}.pac-container .pac-item:first-child{border-top:0 none}.pac-container .pac-item{padding:5px 10px;cursor:pointer}html[dir="rtl"] .pac-container .pac-item{text-align:right}.acf-relationship{background:#fff}.acf-relationship .filters{border:#DFDFDF solid 1px;background:#fff}.acf-relationship .filters:after{display:block;clear:both;content:""}.acf-relationship .filters .filter{margin:0;padding:0;float:left;width:100%}.acf-relationship .filters .filter span{display:block;padding:7px 7px 7px 0}.acf-relationship .filters .filter:first-child span{padding-left:7px}.acf-relationship .filters .filter input,.acf-relationship .filters .filter select{height:28px;line-height:28px;padding:2px;width:100%;margin:0;float:none}.acf-relationship .filters .filter input:focus,.acf-relationship .filters .filter input:active,.acf-relationship .filters .filter select:focus,.acf-relationship .filters .filter select:active{outline:none;box-shadow:none}.acf-relationship .filters .filter input{border-color:transparent;box-shadow:none}.acf-relationship .filters.-f2 .filter{width:50%}.acf-relationship .filters.-f3 .filter{width:25%}.acf-relationship .filters.-f3 .filter.-search{width:50%}.acf-relationship .list{margin:0;padding:5px;height:160px;overflow:auto}.acf-relationship .list .acf-rel-label,.acf-relationship .list .acf-rel-item,.acf-relationship .list p{padding:5px 7px;margin:0;display:block;position:relative;min-height:18px}.acf-relationship .list .acf-rel-label{font-weight:bold}.acf-relationship .list .acf-rel-item{cursor:pointer}.acf-relationship .list .acf-rel-item b{text-decoration:underline;font-weight:normal}.acf-relationship .list .acf-rel-item .thumbnail{background:#e0e0e0;width:22px;height:22px;float:left;margin:-2px 5px 0 0}.acf-relationship .list .acf-rel-item .thumbnail img{max-width:22px;max-height:22px;margin:0 auto;display:block}.acf-relationship .list .acf-rel-item .thumbnail.-icon{background:#fff}.acf-relationship .list .acf-rel-item .thumbnail.-icon img{max-height:20px;margin-top:1px}.acf-relationship .list .acf-rel-item:hover{background:#3875D7;color:#fff}.acf-relationship .list .acf-rel-item:hover .thumbnail{background:#a2bfec}.acf-relationship .list .acf-rel-item:hover .thumbnail.-icon{background:#fff}.acf-relationship .list .acf-rel-item.disabled{opacity:0.5}.acf-relationship .list .acf-rel-item.disabled:hover{background:transparent;color:#333;cursor:default}.acf-relationship .list .acf-rel-item.disabled:hover .thumbnail{background:#e0e0e0}.acf-relationship .list .acf-rel-item.disabled:hover .thumbnail.-icon{background:#fff}.acf-relationship .list ul{padding-bottom:5px}.acf-relationship .list ul .acf-rel-label,.acf-relationship .list ul .acf-rel-item,.acf-relationship .list ul p{padding-left:20px}.acf-relationship .selection{border:#DFDFDF solid 1px;position:relative;margin-top:-1px}.acf-relationship .selection:after{display:block;clear:both;content:""}.acf-relationship .selection .values,.acf-relationship .selection .choices{width:50%;background:#fff;float:left}.acf-relationship .selection .choices{background:#F9F9F9}.acf-relationship .selection .choices .list{border-right:#DFDFDF solid 1px}.acf-relationship .selection .values .acf-icon{position:absolute;top:4px;right:7px;display:none}html[dir="rtl"] .acf-relationship .selection .values .acf-icon{right:auto;left:7px}.acf-relationship .selection .values .acf-rel-item:hover .acf-icon{display:block}.acf-relationship .selection .values .acf-rel-item{cursor:move}.acf-relationship .selection .values .acf-rel-item b{text-decoration:none}.menu-item .acf-relationship ul{width:auto}.menu-item .acf-relationship li{display:block}.acf-editor-wrap.delay .acf-editor-toolbar{content:"";display:block;background:#f5f5f5;border-bottom:#dddddd solid 1px;color:#555d66;padding:10px}.acf-editor-wrap.delay .wp-editor-area{padding:10px;border:none;color:inherit}.acf-editor-wrap iframe{min-height:200px}.acf-editor-wrap .wp-editor-container{border:1px solid #E5E5E5;box-shadow:none !important}.acf-editor-wrap .wp-editor-tabs{box-sizing:content-box}#mce_fullscreen_container{z-index:900000 !important}.acf-field-tab{display:none !important}.hidden-by-tab{display:none !important}.acf-tab-wrap{clear:both;z-index:1}.acf-tab-group{border-bottom:#ccc solid 1px;padding:10px 10px 0}.acf-tab-group li{margin:0 0.5em 0 0}.acf-tab-group li a{padding:5px 10px;display:block;color:#555;font-size:14px;font-weight:600;line-height:24px;border:#ccc solid 1px;border-bottom:0 none;text-decoration:none;background:#e5e5e5;transition:none}.acf-tab-group li a:hover{background:#FFF}.acf-tab-group li a:focus{outline:none;box-shadow:none}.acf-tab-group li a:empty{display:none}html[dir="rtl"] .acf-tab-group li{margin:0 0 0 0.5em}.acf-tab-group li.active a{background:#F1F1F1;color:#000;padding-bottom:6px;margin-bottom:-1px;position:relative;z-index:1}.acf-fields>.acf-tab-wrap{background:#F9F9F9}.acf-fields>.acf-tab-wrap .acf-tab-group{position:relative;z-index:1;margin-bottom:-1px;border-top:#DFDFDF solid 1px;border-bottom:#DFDFDF solid 1px}.acf-fields>.acf-tab-wrap .acf-tab-group li a{background:#f1f1f1}.acf-fields>.acf-tab-wrap .acf-tab-group li a:hover{background:#FFF}.acf-fields>.acf-tab-wrap .acf-tab-group li.active a{background:#FFFFFF}.acf-fields>.acf-tab-wrap:first-child .acf-tab-group{border-top:none}.acf-fields.-left>.acf-tab-wrap .acf-tab-group{padding-left:20%}@media screen and (max-width: 640px){.acf-fields.-left>.acf-tab-wrap .acf-tab-group{padding-left:10px}}html[dir="rtl"] .acf-fields.-left>.acf-tab-wrap .acf-tab-group{padding-left:0;padding-right:20%}@media screen and (max-width: 850px){html[dir="rtl"] .acf-fields.-left>.acf-tab-wrap .acf-tab-group{padding-right:10px}}.acf-tab-wrap.-left .acf-tab-group{position:absolute;left:0;width:20%;border:0 none;padding:0 !important;margin:1px 0 0}.acf-tab-wrap.-left .acf-tab-group li{float:none;margin:-1px 0 0}.acf-tab-wrap.-left .acf-tab-group li a{border:1px solid #ededed;font-size:13px;line-height:18px;color:#0073aa;padding:10px;margin:0;font-weight:normal;border-width:1px 0;border-radius:0;background:transparent}.acf-tab-wrap.-left .acf-tab-group li a:hover{color:#00a0d2}.acf-tab-wrap.-left .acf-tab-group li.active a{border-color:#DFDFDF;color:#000;margin-right:-1px;background:#fff}html[dir="rtl"] .acf-tab-wrap.-left .acf-tab-group{left:auto;right:0}html[dir="rtl"] .acf-tab-wrap.-left .acf-tab-group li.active a{margin-right:0;margin-left:-1px}.acf-field+.acf-tab-wrap.-left:before{content:"";display:block;position:relative;z-index:1;height:10px;border-top:#DFDFDF solid 1px;border-bottom:#DFDFDF solid 1px;margin-bottom:-1px}.acf-tab-wrap.-left:first-child .acf-tab-group li:first-child a{border-top:none}.acf-fields.-sidebar{padding:0 0 0 20% !important;position:relative}.acf-fields.-sidebar:before{content:"";display:block;position:absolute;top:0;left:0;width:20%;bottom:0;border-right:#DFDFDF solid 1px;background:#F9F9F9;z-index:1}html[dir="rtl"] .acf-fields.-sidebar{padding:0 20% 0 0 !important}html[dir="rtl"] .acf-fields.-sidebar:before{border-left:#DFDFDF solid 1px;border-right-width:0;left:auto;right:0}.acf-fields.-sidebar.-left{padding:0 0 0 180px !important}html[dir="rtl"] .acf-fields.-sidebar.-left{padding:0 180px 0 0 !important}.acf-fields.-sidebar.-left:before{background:#F1F1F1;border-color:#dfdfdf;width:180px}.acf-fields.-sidebar.-left>.acf-tab-wrap.-left .acf-tab-group{width:180px}.acf-fields.-sidebar.-left>.acf-tab-wrap.-left .acf-tab-group li a{border-color:#e4e4e4}.acf-fields.-sidebar.-left>.acf-tab-wrap.-left .acf-tab-group li.active a{background:#F9F9F9}.acf-fields.-sidebar>.acf-field-tab+.acf-field{border-top:none}.acf-fields.-clear>.acf-tab-wrap{background:transparent}.acf-fields.-clear>.acf-tab-wrap .acf-tab-group{margin-top:0;border-top:none;padding-left:0;padding-right:0}.acf-fields.-clear>.acf-tab-wrap .acf-tab-group li a{background:#e5e5e5}.acf-fields.-clear>.acf-tab-wrap .acf-tab-group li a:hover{background:#fff}.acf-fields.-clear>.acf-tab-wrap .acf-tab-group li.active a{background:#f1f1f1}.acf-postbox.seamless>.acf-fields.-sidebar{margin-left:0 !important}.acf-postbox.seamless>.acf-fields.-sidebar:before{background:transparent}.acf-postbox.seamless>.acf-fields>.acf-tab-wrap{background:transparent;margin-bottom:10px;padding-left:12px;padding-right:12px}.acf-postbox.seamless>.acf-fields>.acf-tab-wrap .acf-tab-group{border-top:0 none}.acf-postbox.seamless>.acf-fields>.acf-tab-wrap .acf-tab-group li a{background:#e5e5e5}.acf-postbox.seamless>.acf-fields>.acf-tab-wrap .acf-tab-group li a:hover{background:#fff}.acf-postbox.seamless>.acf-fields>.acf-tab-wrap .acf-tab-group li.active a{background:#f1f1f1}.acf-postbox.seamless>.acf-fields>.acf-tab-wrap.-left:before{border-top:none;height:auto}.acf-postbox.seamless>.acf-fields>.acf-tab-wrap.-left .acf-tab-group{margin-bottom:0}.acf-postbox.seamless>.acf-fields>.acf-tab-wrap.-left .acf-tab-group li a{border-width:1px 0 1px 1px !important;border-color:#cccccc;background:#e5e5e5}.acf-postbox.seamless>.acf-fields>.acf-tab-wrap.-left .acf-tab-group li.active a{background:#f1f1f1}.menu-edit .acf-fields.-clear>.acf-tab-wrap .acf-tab-group li a,.widget .acf-fields.-clear>.acf-tab-wrap .acf-tab-group li a{background:#f1f1f1}.menu-edit .acf-fields.-clear>.acf-tab-wrap .acf-tab-group li a:hover,.menu-edit .acf-fields.-clear>.acf-tab-wrap .acf-tab-group li.active a,.widget .acf-fields.-clear>.acf-tab-wrap .acf-tab-group li a:hover,.widget .acf-fields.-clear>.acf-tab-wrap .acf-tab-group li.active a{background:#fff}.compat-item .acf-tab-wrap td{display:block}.acf-gallery-side .acf-tab-wrap{border-top:0 none !important}.acf-gallery-side .acf-tab-wrap .acf-tab-group{margin:10px 0 !important;padding:0 !important}.acf-gallery-side .acf-tab-group li.active a{background:#F9F9F9 !important}.widget .acf-tab-group{border-bottom-color:#e8e8e8}.widget .acf-tab-group li a{background:#F1F1F1}.widget .acf-tab-group li.active a{background:#fff}.media-modal.acf-expanded .compat-attachment-fields>tbody>tr.acf-tab-wrap .acf-tab-group{padding-left:23%;border-bottom-color:#DDDDDD}.form-table>tbody>tr.acf-tab-wrap .acf-tab-group{padding:0 5px 0 210px}html[dir="rtl"] .form-table>tbody>tr.acf-tab-wrap .acf-tab-group{padding:0 210px 0 5px}.acf-oembed{position:relative;border:#DFDFDF solid 1px;background:#fff}.acf-oembed .title{position:relative;border-bottom:#DFDFDF solid 1px;padding:5px 10px}.acf-oembed .title .input-search{margin:0;font-size:14px;line-height:30px;height:30px;padding:0;border:0 none;box-shadow:none;border-radius:0;font-family:inherit;cursor:text}.acf-oembed .title .acf-actions{padding:6px}.acf-oembed .canvas{position:relative;min-height:250px;background:#F9F9F9}.acf-oembed .canvas .canvas-media{position:relative;z-index:1}.acf-oembed .canvas iframe{display:block;margin:0;padding:0;width:100%}.acf-oembed .canvas .acf-icon.-picture{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);z-index:0;height:42px;width:42px;font-size:42px;color:#999}.acf-oembed .canvas .acf-loading-overlay{background:rgba(255,255,255,0.9)}.acf-oembed .canvas .canvas-error{position:absolute;top:50%;left:0%;right:0%;margin:-9px 0 0 0;text-align:center;display:none}.acf-oembed .canvas .canvas-error p{padding:8px;margin:0;display:inline}.acf-oembed.has-value .canvas{min-height:50px}.acf-oembed.has-value .input-search{font-weight:bold}.acf-oembed.has-value .title:hover .acf-actions{display:block}.acf-image-uploader{position:relative}.acf-image-uploader:after{display:block;clear:both;content:""}.acf-image-uploader p{margin:0}.acf-image-uploader .image-wrap{position:relative;float:left}.acf-image-uploader .image-wrap img{max-width:100%;width:auto;height:auto;display:block;min-width:30px;min-height:30px;background:#f1f1f1;margin:0;padding:0}.acf-image-uploader .image-wrap img[src$=".svg"]{min-height:100px;min-width:100px}.acf-image-uploader .image-wrap:hover .acf-actions{display:block}.acf-image-uploader input.button{width:auto}html[dir="rtl"] .acf-image-uploader .image-wrap{float:right}.acf-file-uploader{position:relative}.acf-file-uploader p{margin:0}.acf-file-uploader .file-wrap{border:#DFDFDF solid 1px;min-height:84px;position:relative;background:#fff}.acf-file-uploader .file-icon{position:absolute;top:0;left:0;bottom:0;padding:10px;background:#F1F1F1;border-right:#E5E5E5 solid 1px}.acf-file-uploader .file-icon img{display:block;padding:0;margin:0;max-width:48px}.acf-file-uploader .file-info{padding:10px;margin-left:69px}.acf-file-uploader .file-info p{margin:0 0 2px;font-size:13px;line-height:1.4em;word-break:break-all}.acf-file-uploader .file-info a{text-decoration:none}.acf-file-uploader:hover .acf-actions{display:block}html[dir="rtl"] .acf-file-uploader .file-icon{left:auto;right:0;border-left:#E5E5E5 solid 1px;border-right:none}html[dir="rtl"] .acf-file-uploader .file-info{margin-right:69px;margin-left:0}.acf-ui-datepicker .ui-datepicker{z-index:900000 !important}.acf-ui-datepicker .ui-datepicker .ui-widget-header a{cursor:pointer;transition:none}.acf-ui-datepicker .ui-state-highlight.ui-state-hover{border:1px solid #98b7e8 !important;background:#98b7e8 !important;font-weight:normal !important;color:#ffffff !important}.acf-ui-datepicker .ui-state-highlight.ui-state-active{border:1px solid #3875d7 !important;background:#3875d7 !important;font-weight:normal !important;color:#ffffff !important}.acf-field-separator .acf-label{margin-bottom:0}.acf-field-separator .acf-label label{font-weight:normal}.acf-field-separator .acf-input{display:none}.acf-fields>.acf-field-separator{background:#f9f9f9;border-bottom:1px solid #dfdfdf;border-top:1px solid #dfdfdf;margin-bottom:-1px;z-index:2}.acf-taxonomy-field{position:relative}.acf-taxonomy-field .categorychecklist-holder{border:#DFDFDF solid 1px;border-radius:3px;max-height:200px;overflow:auto}.acf-taxonomy-field .acf-checkbox-list{margin:0;padding:10px}.acf-taxonomy-field .acf-checkbox-list ul.children{padding-left:18px}.acf-taxonomy-field:hover .acf-actions{display:block}.acf-taxonomy-field[data-ftype="select"] .acf-actions{padding:0;margin:-9px}.acf-range-wrap .acf-append,.acf-range-wrap .acf-prepend{display:inline-block;vertical-align:middle;line-height:28px;margin:0 7px 0 0}.acf-range-wrap .acf-append{margin:0 0 0 7px}.acf-range-wrap input[type="range"]{display:inline-block;padding:0;margin:0;vertical-align:middle;height:28px}.acf-range-wrap input[type="range"]:focus{outline:none}.acf-range-wrap input[type="number"]{display:inline-block;min-width:3em;margin-left:10px;vertical-align:middle}html[dir="rtl"] .acf-range-wrap input[type="number"]{margin-right:10px;margin-left:0}html[dir="rtl"] .acf-range-wrap .acf-append{margin:0 7px 0 0}html[dir="rtl"] .acf-range-wrap .acf-prepend{margin:0 0 0 7px}.acf-accordion{margin:0;padding:0;background:#fff}.acf-accordion .acf-accordion-title{margin:0;padding:12px;font-weight:bold;cursor:pointer;font-size:inherit;font-size:13px;line-height:1.4em}.acf-accordion .acf-accordion-title label{margin:0;padding:0;font-size:13px;line-height:1.4em}.acf-accordion .acf-accordion-title p{font-weight:normal}.acf-accordion .acf-accordion-title .acf-accordion-icon{float:right}.acf-accordion .acf-accordion-content{margin:0;padding:0 12px 12px;display:none}.acf-accordion.-open>.acf-accordion-content{display:block}.acf-field.acf-accordion{padding:0 !important;border-color:#dfdfdf}.acf-field.acf-accordion .acf-accordion-title{padding:12px;width:auto !important;float:none !important;width:auto !important}.acf-field.acf-accordion .acf-accordion-content{padding:0;float:none !important;width:auto !important}.acf-field.acf-accordion .acf-accordion-content>.acf-fields{border-top:#EEEEEE solid 1px}.acf-field.acf-accordion .acf-accordion-content>.acf-fields.-clear{padding:0 12px 15px}.acf-fields.-left>.acf-field.acf-accordion{padding:0 !important}.acf-fields.-left>.acf-field.acf-accordion:before{display:none}.acf-fields.-left>.acf-field.acf-accordion .acf-accordion-title{width:auto;margin:0 !important;padding:12px;float:none !important}.acf-fields.-left>.acf-field.acf-accordion .acf-accordion-content{padding:0 !important}.acf-fields.-clear>.acf-field.acf-accordion{border:#cccccc solid 1px;background:transparent}.acf-fields.-clear>.acf-field.acf-accordion+.acf-field.acf-accordion{margin-top:-16px}tr.acf-field.acf-accordion{background:transparent}tr.acf-field.acf-accordion>.acf-input{padding:0 !important;border:#cccccc solid 1px}tr.acf-field.acf-accordion .acf-accordion-content{padding:0 12px 12px}#addtag div.acf-field.error{border:0 none;padding:8px 0}#addtag>.acf-field.acf-accordion{padding-right:0;margin-right:5%}#addtag>.acf-field.acf-accordion+p.submit{margin-top:0}tr.acf-accordion{margin:15px 0 !important}tr.acf-accordion+tr.acf-accordion{margin-top:-16px !important}.acf-postbox.seamless>.acf-fields>.acf-accordion{margin-left:12px !important;margin-right:12px !important}.widget .widget-content>.acf-field.acf-accordion{border:#dfdfdf solid 1px;margin-bottom:10px}.widget .widget-content>.acf-field.acf-accordion .acf-accordion-title{margin-bottom:0}.widget .widget-content>.acf-field.acf-accordion+.acf-field.acf-accordion{margin-top:-11px}.acf-postbox.seamless>.acf-fields>.acf-field.acf-accordion{border:#e5e5e5 solid 1px}.acf-postbox.seamless>.acf-fields>.acf-field.acf-accordion+.acf-field.acf-accordion{margin-top:-1px}.media-modal .compat-attachment-fields .acf-field.acf-accordion+.acf-field.acf-accordion{margin-top:-1px}.media-modal .compat-attachment-fields .acf-field.acf-accordion>.acf-input{width:100%}.media-modal .compat-attachment-fields .acf-field.acf-accordion .compat-attachment-fields>tbody>tr>td{padding-bottom:5px}.form-table>tbody>.acf-field>.acf-label{padding:20px 10px 20px 0;width:210px}html[dir="rtl"] .form-table>tbody>.acf-field>.acf-label{padding:20px 0 20px 10px}.form-table>tbody>.acf-field>.acf-label label{font-size:14px;color:#23282d}.form-table>tbody>.acf-field>.acf-input{padding:15px 10px}html[dir="rtl"] .form-table>tbody>.acf-field>.acf-input{padding:15px 10px 15px 5%}.form-table>tbody>.acf-tab-wrap td{padding:15px 5% 15px 0}html[dir="rtl"] .form-table>tbody>.acf-tab-wrap td{padding:15px 0 15px 5%}.form-table>tbody .form-table th.acf-th{width:auto}#your-profile .acf-field input[type="text"],#your-profile .acf-field input[type="password"],#your-profile .acf-field input[type="number"],#your-profile .acf-field input[type="search"],#your-profile .acf-field input[type="email"],#your-profile .acf-field input[type="url"],#your-profile .acf-field select,#createuser .acf-field input[type="text"],#createuser .acf-field input[type="password"],#createuser .acf-field input[type="number"],#createuser .acf-field input[type="search"],#createuser .acf-field input[type="email"],#createuser .acf-field input[type="url"],#createuser .acf-field select{max-width:25em}#your-profile .acf-field textarea,#createuser .acf-field textarea{max-width:500px}#your-profile .acf-field .acf-field input[type="text"],#your-profile .acf-field .acf-field input[type="password"],#your-profile .acf-field .acf-field input[type="number"],#your-profile .acf-field .acf-field input[type="search"],#your-profile .acf-field .acf-field input[type="email"],#your-profile .acf-field .acf-field input[type="url"],#your-profile .acf-field .acf-field textarea,#your-profile .acf-field .acf-field select,#createuser .acf-field .acf-field input[type="text"],#createuser .acf-field .acf-field input[type="password"],#createuser .acf-field .acf-field input[type="number"],#createuser .acf-field .acf-field input[type="search"],#createuser .acf-field .acf-field input[type="email"],#createuser .acf-field .acf-field input[type="url"],#createuser .acf-field .acf-field textarea,#createuser .acf-field .acf-field select{max-width:none}#registerform h2{margin:1em 0}#registerform .acf-field .acf-label{margin-bottom:0}#registerform .acf-field .acf-label label{font-weight:normal;font-size:14px}#registerform p.submit{text-align:right}#acf-term-fields{padding-right:5%}#acf-term-fields>.acf-field>.acf-label{margin:0}#acf-term-fields>.acf-field>.acf-label label{font-size:12px;font-weight:normal}p.submit .spinner,p.submit .acf-spinner{vertical-align:top;float:none;margin:4px 4px 0}#edittag .acf-fields.-left>.acf-field{padding-left:220px}#edittag .acf-fields.-left>.acf-field:before{width:209px}#edittag .acf-fields.-left>.acf-field>.acf-label{width:220px;margin-left:-220px;padding:0 10px}#edittag .acf-fields.-left>.acf-field>.acf-input{padding:0}#edittag>.acf-fields.-left{width:96%}#edittag>.acf-fields.-left>.acf-field>.acf-label{padding-left:0}.editcomment td:first-child{white-space:nowrap;width:131px}#widgets-right .widget .acf-field .description{padding-left:0;padding-right:0}.acf-widget-fields>.acf-field .acf-label{margin-bottom:5px}.acf-widget-fields>.acf-field .acf-label label{font-weight:normal;margin:0}.acf-menu-settings{border-top:1px solid #eee;margin-top:2em}.acf-menu-settings.-seamless{border-top:none;margin-top:15px}.acf-menu-settings.-seamless>h2{display:none}.acf-menu-settings .list li{display:block;margin-bottom:0}.acf-menu-item-fields{margin-right:10px;float:left}#post .compat-attachment-fields .compat-field-acf-form-data{display:none}#post .compat-attachment-fields,#post .compat-attachment-fields>tbody,#post .compat-attachment-fields>tbody>tr,#post .compat-attachment-fields>tbody>tr>th,#post .compat-attachment-fields>tbody>tr>td{display:block}#post .compat-attachment-fields>tbody>.acf-field{margin:15px 0}#post .compat-attachment-fields>tbody>.acf-field>.acf-label{margin:0}#post .compat-attachment-fields>tbody>.acf-field>.acf-label label{margin:0;padding:0}#post .compat-attachment-fields>tbody>.acf-field>.acf-label label p{margin:0 0 3px !important}#post .compat-attachment-fields>tbody>.acf-field>.acf-input{margin:0}.media-modal .compat-attachment-fields td.acf-input table{display:table;table-layout:auto}.media-modal .compat-attachment-fields td.acf-input table tbody{display:table-row-group}.media-modal .compat-attachment-fields td.acf-input table tr{display:table-row}.media-modal .compat-attachment-fields td.acf-input table td,.media-modal .compat-attachment-fields td.acf-input table th{display:table-cell}.media-modal .compat-attachment-fields>tbody>.acf-field{margin:5px 0}.media-modal .compat-attachment-fields>tbody>.acf-field>.acf-label{min-width:30%;margin:0;padding:0;float:left;text-align:right;display:block;float:left}.media-modal .compat-attachment-fields>tbody>.acf-field>.acf-label>label{padding-top:6px;margin:0;color:#666666;font-weight:400;line-height:16px}.media-modal .compat-attachment-fields>tbody>.acf-field>.acf-input{width:65%;margin:0;padding:0;float:right;display:block}.media-modal .compat-attachment-fields>tbody>.acf-field p.description{margin:0}.acf-selection-error{background:#ffebe8;border:1px solid #c00;border-radius:3px;padding:8px;margin:20px 0 0}.acf-selection-error .selection-error-label{background:#CC0000;border-radius:3px;color:#fff;font-weight:bold;margin-right:8px;padding:2px 4px}.acf-selection-error .selection-error-message{color:#b44;display:block;padding-top:8px;word-wrap:break-word;white-space:pre-wrap}.media-modal .attachment.acf-disabled .thumbnail{opacity:0.25 !important}.media-modal .attachment.acf-disabled .attachment-preview:before{background:rgba(0,0,0,0.15);z-index:1;position:relative}.media-modal .compat-field-acf-form-data,.media-modal .compat-field-acf-blank{display:none !important}.media-modal .upload-error-message{white-space:pre-wrap}.media-modal .acf-required{padding:0 !important;margin:0 !important;float:none !important;color:#f00 !important}.media-modal .media-sidebar .compat-item{padding-bottom:20px}@media (max-width: 900px){.media-modal .setting span,.media-modal .compat-attachment-fields>tbody>.acf-field>.acf-label{width:98%;float:none;text-align:left;min-height:0;padding:0}.media-modal .setting input,.media-modal .setting textarea,.media-modal .compat-attachment-fields>tbody>.acf-field>.acf-input{float:none;height:auto;max-width:none;width:98%}}.media-modal .acf-expand-details{float:right;padding:1px 10px;margin-right:6px;height:18px;line-height:18px;color:#AAAAAA;font-size:12px}.media-modal .acf-expand-details:focus,.media-modal .acf-expand-details:active{outline:0 none;box-shadow:none;color:#AAAAAA}.media-modal .acf-expand-details:hover{color:#666666 !important}.media-modal .acf-expand-details span{display:block;float:left}.media-modal .acf-expand-details .acf-icon{margin:0 4px 0 0}.media-modal .acf-expand-details:hover .acf-icon{border-color:#AAAAAA}.media-modal .acf-expand-details .is-open{display:none}.media-modal .acf-expand-details .is-closed{display:block}@media (max-width: 640px){.media-modal .acf-expand-details{display:none}}.media-modal.acf-expanded .acf-expand-details .is-open{display:block}.media-modal.acf-expanded .acf-expand-details .is-closed{display:none}.media-modal.acf-expanded .attachments-browser .media-toolbar,.media-modal.acf-expanded .attachments-browser .attachments{right:740px}.media-modal.acf-expanded .media-sidebar{width:708px}.media-modal.acf-expanded .media-sidebar .attachment-info .thumbnail{float:left;max-height:none}.media-modal.acf-expanded .media-sidebar .attachment-info .thumbnail img{max-width:100%;max-height:200px}.media-modal.acf-expanded .media-sidebar .attachment-info .details{float:right}.media-modal.acf-expanded .media-sidebar .attachment-info .thumbnail,.media-modal.acf-expanded .media-sidebar .attachment-details .setting span,.media-modal.acf-expanded .media-sidebar .compat-attachment-fields>tbody>.acf-field>.acf-label{min-width:20%;margin-right:0}.media-modal.acf-expanded .media-sidebar .attachment-info .details,.media-modal.acf-expanded .media-sidebar .attachment-details .setting input,.media-modal.acf-expanded .media-sidebar .attachment-details .setting textarea,.media-modal.acf-expanded .media-sidebar .attachment-details .setting+.description,.media-modal.acf-expanded .media-sidebar .compat-attachment-fields>tbody>.acf-field>.acf-input{min-width:77%}@media (max-width: 900px){.media-modal.acf-expanded .attachments-browser .media-toolbar{display:none}.media-modal.acf-expanded .attachments{display:none}.media-modal.acf-expanded .media-sidebar{width:auto;max-width:none !important;bottom:0 !important}.media-modal.acf-expanded .media-sidebar .attachment-info .thumbnail{min-width:0;max-width:none;width:30%}.media-modal.acf-expanded .media-sidebar .attachment-info .details{min-width:0;max-width:none;width:67%}}@media (max-width: 640px){.media-modal.acf-expanded .media-sidebar .attachment-info .thumbnail,.media-modal.acf-expanded .media-sidebar .attachment-info .details{width:100%}}.acf-media-modal .media-embed .setting.align,.acf-media-modal .media-embed .setting.link-to{display:none}@media screen and (min-width: 1024px){.acf-media-modal .media-modal-content .media-frame .media-toolbar-secondary{max-width:none}.acf-media-modal .media-modal-content .media-frame .media-toolbar-secondary select.attachment-filters{width:auto;min-width:150px;max-width:none;margin:11px 6px 0 0;vertical-align:middle}}.acf-media-modal.-edit{left:15%;right:15%;top:100px;bottom:100px}.acf-media-modal.-edit .media-frame-menu,.acf-media-modal.-edit .media-frame-router,.acf-media-modal.-edit .media-frame-content .attachments,.acf-media-modal.-edit .media-frame-content .media-toolbar{display:none}.acf-media-modal.-edit .media-frame-title,.acf-media-modal.-edit .media-frame-content,.acf-media-modal.-edit .media-frame-toolbar,.acf-media-modal.-edit .media-sidebar{width:auto;left:0;right:0}.acf-media-modal.-edit .media-frame-content{top:50px}.acf-media-modal.-edit .media-frame-title{border-bottom:1px solid #DFDFDF;box-shadow:0 4px 4px -4px rgba(0,0,0,0.1)}.acf-media-modal.-edit .media-sidebar{padding:0 16px}.acf-media-modal.-edit .media-sidebar .attachment-details{overflow:visible}.acf-media-modal.-edit .media-sidebar .attachment-details>h3,.acf-media-modal.-edit .media-sidebar .attachment-details>h2{display:none}.acf-media-modal.-edit .media-sidebar .attachment-details .attachment-info{background:#fff;border-bottom:#dddddd solid 1px;padding:16px;margin:0 -16px 16px}.acf-media-modal.-edit .media-sidebar .attachment-details .thumbnail{margin:0 16px 0 0}.acf-media-modal.-edit .media-sidebar .attachment-details .setting{margin:0 0 5px}.acf-media-modal.-edit .media-sidebar .attachment-details .setting span{margin:0}.acf-media-modal.-edit .media-sidebar .compat-attachment-fields>tbody>.acf-field{margin:0 0 5px}.acf-media-modal.-edit .media-sidebar .compat-attachment-fields>tbody>.acf-field p.description{margin-top:3px}.acf-media-modal.-edit .media-sidebar .media-types-required-info{display:none}@media (max-width: 900px){.acf-media-modal.-edit{top:30px;right:30px;bottom:30px;left:30px}}@media (max-width: 640px){.acf-media-modal.-edit{top:0;right:0;bottom:0;left:0}}@media (max-width: 480px){.acf-media-modal.-edit .media-frame-content{top:40px}}.acf-temp-remove{position:relative;opacity:1;-webkit-transition:all 0.25s ease;-moz-transition:all 0.25s ease;-o-transition:all 0.25s ease;transition:all 0.25s ease;overflow:hidden}.acf-temp-remove:after{display:block;content:"";position:absolute;top:0;left:0;right:0;bottom:0;z-index:99}.hidden-by-conditional-logic{display:none !important}.hidden-by-conditional-logic.appear-empty{display:table-cell !important}.hidden-by-conditional-logic.appear-empty .acf-input{display:none !important}.acf-postbox.acf-hidden{display:none !important}#editor .edit-post-layout__metaboxes{padding:0}#editor .postbox{color:#444}#editor .postbox .handlediv{color:#191e23 !important;height:46px;width:auto;padding:0 14px 0 5px;position:relative;z-index:2}#editor .postbox .hndle{color:#191e23 !important;font-size:13px;line-height:normal;padding:15px}#editor .postbox .hndle:hover{background:#f2f4f5}#editor .postbox .hndle .acf-hndle-cog{line-height:16px}#editor .postbox .handlediv .toggle-indicator{color:inherit}#editor .postbox .handlediv .toggle-indicator:before{content:"\f343";font-size:18px;width:auto}#editor .postbox.closed .handlediv .toggle-indicator:before{content:"\f347"}
|
assets/js/acf-input.js
CHANGED
@@ -568,21 +568,7 @@
|
|
568 |
*/
|
569 |
|
570 |
acf.strEscape = function( string ){
|
571 |
-
|
572 |
-
var entityMap = {
|
573 |
-
'&': '&',
|
574 |
-
'<': '<',
|
575 |
-
'>': '>',
|
576 |
-
'"': '"',
|
577 |
-
"'": ''',
|
578 |
-
'/': '/',
|
579 |
-
'`': '`',
|
580 |
-
'=': '='
|
581 |
-
};
|
582 |
-
|
583 |
-
return String(string).replace(/[&<>"'`=\/]/g, function (s) {
|
584 |
-
return entityMap[s];
|
585 |
-
});
|
586 |
};
|
587 |
|
588 |
/**
|
@@ -1991,7 +1977,7 @@
|
|
1991 |
|
1992 |
// option
|
1993 |
} else {
|
1994 |
-
itemsHtml += '<option value="' + id + '"' + (item.disabled ? ' disabled="disabled"' : '') + '>' + text + '</option>';
|
1995 |
}
|
1996 |
});
|
1997 |
|
@@ -3732,6 +3718,25 @@
|
|
3732 |
|
3733 |
(function($, undefined){
|
3734 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3735 |
/**
|
3736 |
* acf.getPostbox
|
3737 |
*
|
@@ -3852,10 +3857,12 @@
|
|
3852 |
// This class is added by WP to postboxes that are hidden via the "Screen Options" tab.
|
3853 |
this.$el.removeClass('hide-if-js');
|
3854 |
|
3855 |
-
// Add field group style class.
|
3856 |
-
|
3857 |
-
|
3858 |
-
|
|
|
|
|
3859 |
}
|
3860 |
|
3861 |
// Add .inside class.
|
@@ -10100,16 +10107,13 @@
|
|
10100 |
}, frame);
|
10101 |
|
10102 |
// update toolbar button
|
10103 |
-
|
10104 |
-
|
10105 |
-
|
10106 |
-
|
10107 |
-
|
10108 |
-
|
10109 |
-
|
10110 |
-
|
10111 |
-
}, frame );
|
10112 |
-
*/
|
10113 |
// on select
|
10114 |
frame.on('select', function() {
|
10115 |
|
@@ -10379,12 +10383,35 @@
|
|
10379 |
}
|
10380 |
|
10381 |
// customize
|
|
|
10382 |
this.customizeAttachmentsRouter();
|
10383 |
this.customizeAttachmentFilters();
|
10384 |
this.customizeAttachmentCompat();
|
10385 |
this.customizeAttachmentLibrary();
|
10386 |
},
|
10387 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10388 |
customizeAttachmentsRouter: function(){
|
10389 |
|
10390 |
// validate
|
@@ -12170,7 +12197,10 @@
|
|
12170 |
init.wp_autoresize_on = false;
|
12171 |
|
12172 |
// Enable wpautop allowing value to save without <p> tags.
|
12173 |
-
|
|
|
|
|
|
|
12174 |
|
12175 |
// hook for 3rd party customization
|
12176 |
init = acf.applyFilters('wysiwyg_tinymce_settings', init, id, field);
|
568 |
*/
|
569 |
|
570 |
acf.strEscape = function( string ){
|
571 |
+
return $('<div>').text(string).html();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
572 |
};
|
573 |
|
574 |
/**
|
1977 |
|
1978 |
// option
|
1979 |
} else {
|
1980 |
+
itemsHtml += '<option value="' + id + '"' + (item.disabled ? ' disabled="disabled"' : '') + '>' + acf.strEscape(text) + '</option>';
|
1981 |
}
|
1982 |
});
|
1983 |
|
3718 |
|
3719 |
(function($, undefined){
|
3720 |
|
3721 |
+
/**
|
3722 |
+
* postboxManager
|
3723 |
+
*
|
3724 |
+
* Manages postboxes on the screen.
|
3725 |
+
*
|
3726 |
+
* @date 25/5/19
|
3727 |
+
* @since 5.8.1
|
3728 |
+
*
|
3729 |
+
* @param void
|
3730 |
+
* @return void
|
3731 |
+
*/
|
3732 |
+
var postboxManager = new acf.Model({
|
3733 |
+
wait: 'prepare',
|
3734 |
+
priority: 1,
|
3735 |
+
initialize: function(){
|
3736 |
+
(acf.get('postboxes') || []).map( acf.newPostbox );
|
3737 |
+
},
|
3738 |
+
});
|
3739 |
+
|
3740 |
/**
|
3741 |
* acf.getPostbox
|
3742 |
*
|
3857 |
// This class is added by WP to postboxes that are hidden via the "Screen Options" tab.
|
3858 |
this.$el.removeClass('hide-if-js');
|
3859 |
|
3860 |
+
// Add field group style class (ignore in block editor).
|
3861 |
+
if( acf.get('editor') !== 'block' ) {
|
3862 |
+
var style = this.get('style');
|
3863 |
+
if( style !== 'default' ) {
|
3864 |
+
this.$el.addClass( style );
|
3865 |
+
}
|
3866 |
}
|
3867 |
|
3868 |
// Add .inside class.
|
10107 |
}, frame);
|
10108 |
|
10109 |
// update toolbar button
|
10110 |
+
//frame.on( 'toolbar:create:select', function( toolbar ) {
|
10111 |
+
// toolbar.view = new wp.media.view.Toolbar.Select({
|
10112 |
+
// text: frame.options._button,
|
10113 |
+
// controller: this
|
10114 |
+
// });
|
10115 |
+
//}, frame );
|
10116 |
+
|
|
|
|
|
|
|
10117 |
// on select
|
10118 |
frame.on('select', function() {
|
10119 |
|
10383 |
}
|
10384 |
|
10385 |
// customize
|
10386 |
+
this.customizeAttachmentsButton();
|
10387 |
this.customizeAttachmentsRouter();
|
10388 |
this.customizeAttachmentFilters();
|
10389 |
this.customizeAttachmentCompat();
|
10390 |
this.customizeAttachmentLibrary();
|
10391 |
},
|
10392 |
|
10393 |
+
customizeAttachmentsButton: function(){
|
10394 |
+
|
10395 |
+
// validate
|
10396 |
+
if( !acf.isset(wp, 'media', 'view', 'Button') ) {
|
10397 |
+
return;
|
10398 |
+
}
|
10399 |
+
|
10400 |
+
// Extend
|
10401 |
+
var Button = wp.media.view.Button;
|
10402 |
+
wp.media.view.Button = Button.extend({
|
10403 |
+
|
10404 |
+
// Fix bug where "Select" button appears blank after editing an image.
|
10405 |
+
// Do this by simplifying Button initialize function and avoid deleting this.options.
|
10406 |
+
initialize: function() {
|
10407 |
+
var options = _.defaults( this.options, this.defaults );
|
10408 |
+
this.model = new Backbone.Model( options );
|
10409 |
+
this.listenTo( this.model, 'change', this.render );
|
10410 |
+
}
|
10411 |
+
});
|
10412 |
+
|
10413 |
+
},
|
10414 |
+
|
10415 |
customizeAttachmentsRouter: function(){
|
10416 |
|
10417 |
// validate
|
12197 |
init.wp_autoresize_on = false;
|
12198 |
|
12199 |
// Enable wpautop allowing value to save without <p> tags.
|
12200 |
+
// Only if the "TinyMCE Advanced" plugin hasn't already set this functionality.
|
12201 |
+
if( !init.tadv_noautop ) {
|
12202 |
+
init.wpautop = true;
|
12203 |
+
}
|
12204 |
|
12205 |
// hook for 3rd party customization
|
12206 |
init = acf.applyFilters('wysiwyg_tinymce_settings', init, id, field);
|
assets/js/acf-input.min.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
!function(t,e){var i={};window.acf=i,i.data={},i.get=function(t){return this.data[t]||null},i.has=function(t){return null!==this.get(t)},i.set=function(t,e){return this.data[t]=e,this};var n=0;i.uniqueId=function(t){var e=++n+"";return t?t+e:e},i.uniqueArray=function(t){function e(t,e,i){return i.indexOf(t)===e}return t.filter(e)};var a="";i.uniqid=function(t,e){var i;void 0===t&&(t="");var n=function(t,e){return e<(t=parseInt(t,10).toString(16)).length?t.slice(t.length-e):e>t.length?Array(e-t.length+1).join("0")+t:t};return a||(a=Math.floor(123456789*Math.random())),a++,i=t,i+=n(parseInt((new Date).getTime()/1e3,10),8),i+=n(a,5),e&&(i+=(10*Math.random()).toFixed(8).toString()),i},i.strReplace=function(t,e,i){return i.split(t).join(e)},i.strCamelCase=function(t){return t=(t=t.replace(/[_-]/g," ")).replace(/(?:^\w|\b\w|\s+)/g,function(t,e){return 0==+t?"":0==e?t.toLowerCase():t.toUpperCase()})},i.strPascalCase=function(t){var e=i.strCamelCase(t);return e.charAt(0).toUpperCase()+e.slice(1)},i.strSlugify=function(t){return i.strReplace("_","-",t.toLowerCase())},i.strSanitize=function(t){var e={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","Æ":"AE","Ç":"C","È":"E","É":"E","Ê":"E","Ë":"E","Ì":"I","Í":"I","Î":"I","Ï":"I","Ð":"D","Ñ":"N","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","Ù":"U","Ú":"U","Û":"U","Ü":"U","Ý":"Y","ß":"s","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","æ":"ae","ç":"c","è":"e","é":"e","ê":"e","ë":"e","ì":"i","í":"i","î":"i","ï":"i","ñ":"n","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","ù":"u","ú":"u","û":"u","ü":"u","ý":"y","ÿ":"y","Ā":"A","ā":"a","Ă":"A","ă":"a","Ą":"A","ą":"a","Ć":"C","ć":"c","Ĉ":"C","ĉ":"c","Ċ":"C","ċ":"c","Č":"C","č":"c","Ď":"D","ď":"d","Đ":"D","đ":"d","Ē":"E","ē":"e","Ĕ":"E","ĕ":"e","Ė":"E","ė":"e","Ę":"E","ę":"e","Ě":"E","ě":"e","Ĝ":"G","ĝ":"g","Ğ":"G","ğ":"g","Ġ":"G","ġ":"g","Ģ":"G","ģ":"g","Ĥ":"H","ĥ":"h","Ħ":"H","ħ":"h","Ĩ":"I","ĩ":"i","Ī":"I","ī":"i","Ĭ":"I","ĭ":"i","Į":"I","į":"i","İ":"I","ı":"i","IJ":"IJ","ij":"ij","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","Ĺ":"L","ĺ":"l","Ļ":"L","ļ":"l","Ľ":"L","ľ":"l","Ŀ":"L","ŀ":"l","Ł":"l","ł":"l","Ń":"N","ń":"n","Ņ":"N","ņ":"n","Ň":"N","ň":"n","ʼn":"n","Ō":"O","ō":"o","Ŏ":"O","ŏ":"o","Ő":"O","ő":"o","Œ":"OE","œ":"oe","Ŕ":"R","ŕ":"r","Ŗ":"R","ŗ":"r","Ř":"R","ř":"r","Ś":"S","ś":"s","Ŝ":"S","ŝ":"s","Ş":"S","ş":"s","Š":"S","š":"s","Ţ":"T","ţ":"t","Ť":"T","ť":"t","Ŧ":"T","ŧ":"t","Ũ":"U","ũ":"u","Ū":"U","ū":"u","Ŭ":"U","ŭ":"u","Ů":"U","ů":"u","Ű":"U","ű":"u","Ų":"U","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","ź":"z","Ż":"Z","ż":"z","Ž":"Z","ž":"z","ſ":"s","ƒ":"f","Ơ":"O","ơ":"o","Ư":"U","ư":"u","Ǎ":"A","ǎ":"a","Ǐ":"I","ǐ":"i","Ǒ":"O","ǒ":"o","Ǔ":"U","ǔ":"u","Ǖ":"U","ǖ":"u","Ǘ":"U","ǘ":"u","Ǚ":"U","ǚ":"u","Ǜ":"U","ǜ":"u","Ǻ":"A","ǻ":"a","Ǽ":"AE","ǽ":"ae","Ǿ":"O","ǿ":"o"," ":"_","'":"","?":"","/":"","\\":"",".":"",",":"","`":"",">":"","<":"",'"':"","[":"","]":"","|":"","{":"","}":"","(":"",")":""},i=/\W/g,n=function(t){return void 0!==e[t]?e[t]:t};return t=(t=t.replace(i,n)).toLowerCase()},i.strMatch=function(t,e){for(var i=0,n=Math.min(t.length,e.length),a=0;a<n&&t[a]===e[a];a++)i++;return i},i.decode=function(e){return t("<textarea/>").html(e).text()},i.strEscape=function(t){var e={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};return String(t).replace(/[&<>"'`=\/]/g,function(t){return e[t]})},i.parseArgs=function(e,i){return"object"!=typeof e&&(e={}),"object"!=typeof i&&(i={}),t.extend({},i,e)},null==window.acfL10n&&(acfL10n={}),i.__=function(t){return acfL10n[t]||t},i._x=function(t,e){return acfL10n[t+"."+e]||acfL10n[t]||t},i._n=function(t,e,n){return 1==n?i.__(t):i.__(e)},i.isArray=function(t){return Array.isArray(t)},i.isObject=function(t){return"object"==typeof t};var r=function(t,e,n){var a=(e=e.replace("[]","[%%index%%]")).match(/([^\[\]])+/g);if(a)for(var r=a.length,o=t,s=0;s<r;s++){var c=String(a[s]);s==r-1?"%%index%%"===c?o.push(n):o[c]=n:("%%index%%"===a[s+1]?i.isArray(o[c])||(o[c]=[]):i.isObject(o[c])||(o[c]={}),o=o[c])}};i.serialize=function(t,e){var n={},a=i.serializeArray(t);void 0!==e&&(a=a.filter(function(t){return 0===t.name.indexOf(e)}).map(function(t){return t.name=t.name.slice(e.length),t}));for(var o=0;o<a.length;o++)r(n,a[o].name,a[o].value);return n},i.serializeArray=function(t){return t.find("select, textarea, input").serializeArray()},i.serializeForAjax=function(t){var e={},n;return i.serializeArray(t).map(function(t){"[]"===t.name.slice(-2)?(e[t.name]=e[t.name]||[],e[t.name].push(t.value)):e[t.name]=t.value}),e},i.addAction=function(t,e,n,a){return i.hooks.addAction.apply(this,arguments),this},i.removeAction=function(t,e){return i.hooks.removeAction.apply(this,arguments),this};var o={};i.doAction=function(t){return o[t]=1,i.hooks.doAction.apply(this,arguments),o[t]=0,this},i.doingAction=function(t){return 1===o[t]},i.didAction=function(t){return void 0!==o[t]},i.currentAction=function(){for(var t in o)if(o[t])return t;return!1},i.addFilter=function(t){return i.hooks.addFilter.apply(this,arguments),this},i.removeFilter=function(t){return i.hooks.removeFilter.apply(this,arguments),this},i.applyFilters=function(t){return i.hooks.applyFilters.apply(this,arguments)},i.arrayArgs=function(t){return Array.prototype.slice.call(t)};try{var s=JSON.parse(localStorage.getItem("acf"))||{}}catch(t){var s={}}var c=function(t){return"this."===t.substr(0,5)&&(t=t.substr(5)+"-"+i.get("post_id")),t};i.getPreference=function(t){return t=c(t),s[t]||null},i.setPreference=function(t,e){t=c(t),null===e?delete s[t]:s[t]=e,localStorage.setItem("acf",JSON.stringify(s))},i.removePreference=function(t){i.setPreference(t,null)},i.remove=function(t){t instanceof jQuery&&(t={target:t}),t=i.parseArgs(t,{target:!1,endHeight:0,complete:function(){}}),i.doAction("remove",t.target),t.target.is("tr")?u(t):l(t)};var l=function(t){var e=t.target,i=e.height(),n=e.width(),a=e.css("margin"),r=e.outerHeight(!0),o=e.attr("style")+"";e.wrap('<div class="acf-temp-remove" style="height:'+r+'px"></div>');var s=e.parent();e.css({height:i,width:n,margin:a,position:"absolute"}),setTimeout(function(){s.css({opacity:0,height:t.endHeight})},50),setTimeout(function(){e.attr("style",o),s.remove(),t.complete()},301)},u=function(e){var i=e.target,n=i.height(),a=i.children().length,r=t('<td class="acf-temp-remove" style="padding:0; height:'+n+'px" colspan="'+a+'"></td>');i.addClass("acf-remove-element"),setTimeout(function(){i.html(r)},251),setTimeout(function(){i.removeClass("acf-remove-element"),r.css({height:e.endHeight})},300),setTimeout(function(){i.remove(),e.complete()},451)};i.duplicate=function(t){t instanceof jQuery&&(t={target:t});var e=0;(t=i.parseArgs(t,{target:!1,search:"",replace:"",before:function(t){},after:function(t,e){},append:function(t,i){t.after(i),e=1}})).target=t.target||t.$el;var n=t.target;t.search=t.search||n.attr("data-id"),t.replace=t.replace||i.uniqid(),t.before(n),i.doAction("before_duplicate",n);var a=n.clone();return i.rename({target:a,search:t.search,replace:t.replace}),a.removeClass("acf-clone"),a.find(".ui-sortable").removeClass("ui-sortable"),t.after(n,a),i.doAction("after_duplicate",n,a),t.append(n,a),i.doAction("append",a),a},i.rename=function(t){t instanceof jQuery&&(t={target:t});var e=(t=i.parseArgs(t,{target:!1,destructive:!1,search:"",replace:""})).target,n=t.search||e.attr("data-id"),a=t.replace||i.uniqid("acf"),r=function(t,e){return e.replace(n,a)};if(t.destructive){var o=e.outerHTML();o=i.strReplace(n,a,o),e.replaceWith(o)}else e.attr("data-id",a),e.find('[id*="'+n+'"]').attr("id",r),e.find('[for*="'+n+'"]').attr("for",r),e.find('[name*="'+n+'"]').attr("name",r);return e},i.prepareForAjax=function(t){return t.nonce=i.get("nonce"),t.post_id=i.get("post_id"),i.has("language")&&(t.lang=i.get("language")),t=i.applyFilters("prepare_for_ajax",t)},i.startButtonLoading=function(t){t.prop("disabled",!0),t.after(' <i class="acf-loading"></i>')},i.stopButtonLoading=function(t){t.prop("disabled",!1),t.next(".acf-loading").remove()},i.showLoading=function(t){t.append('<div class="acf-loading-overlay"><i class="acf-loading"></i></div>')},i.hideLoading=function(t){t.children(".acf-loading-overlay").remove()},i.updateUserSetting=function(e,n){var a={action:"acf/ajax/user_setting",name:e,value:n};t.ajax({url:i.get("ajaxurl"),data:i.prepareForAjax(a),type:"post",dataType:"html"})},i.val=function(t,e,i){var n=t.val();return e!==n&&(t.val(e),t.is("select")&&null===t.val()?(t.val(n),!1):(!0!==i&&t.trigger("change"),!0))},i.show=function(t,e){return e&&i.unlock(t,"hidden",e),!i.isLocked(t,"hidden")&&(!!t.hasClass("acf-hidden")&&(t.removeClass("acf-hidden"),!0))},i.hide=function(t,e){return e&&i.lock(t,"hidden",e),!t.hasClass("acf-hidden")&&(t.addClass("acf-hidden"),!0)},i.isHidden=function(t){return t.hasClass("acf-hidden")},i.isVisible=function(t){return!i.isHidden(t)};var d=function(t,e){return!t.hasClass("acf-disabled")&&(e&&i.unlock(t,"disabled",e),!i.isLocked(t,"disabled")&&(!!t.prop("disabled")&&(t.prop("disabled",!1),!0)))};i.enable=function(e,i){if(e.attr("name"))return d(e,i);var n=!1;return e.find("[name]").each(function(){var e;d(t(this),i)&&(n=!0)}),n};var f=function(t,e){return e&&i.lock(t,"disabled",e),!t.prop("disabled")&&(t.prop("disabled",!0),!0)};i.disable=function(e,i){if(e.attr("name"))return f(e,i);var n=!1;return e.find("[name]").each(function(){var e;f(t(this),i)&&(n=!0)}),n},i.isset=function(t){for(var e=1;e<arguments.length;e++){if(!t||!t.hasOwnProperty(arguments[e]))return!1;t=t[arguments[e]]}return!0},i.isget=function(t){for(var e=1;e<arguments.length;e++){if(!t||!t.hasOwnProperty(arguments[e]))return null;t=t[arguments[e]]}return t},i.getFileInputData=function(t,e){var n=t.val();if(!n)return!1;var a={url:n},r=i.isget(t[0],"files",0);if(r)if(a.size=r.size,a.type=r.type,r.type.indexOf("image")>-1){var o=window.URL||window.webkitURL,s=new Image;s.onload=function(){a.width=this.width,a.height=this.height,e(a)},s.src=o.createObjectURL(r)}else e(a);else e(a)},i.isAjaxSuccess=function(t){return t&&t.success},i.getAjaxMessage=function(t){return i.isget(t,"data","message")},i.getAjaxError=function(t){return i.isget(t,"data","error")},i.renderSelect=function(t,e){var n=t.val(),a=[],r=function(t){var e="";return t.map(function(t){var n=t.text||t.label||"",o=t.id||t.value||"";a.push(o),t.children?e+='<optgroup label="'+i.strEscape(n)+'">'+r(t.children)+"</optgroup>":e+='<option value="'+o+'"'+(t.disabled?' disabled="disabled"':"")+">"+n+"</option>"}),e};return t.html(r(e)),a.indexOf(n)>-1&&t.val(n),t.val()};var h=function(t,e){return t.data("acf-lock-"+e)||[]},p=function(t,e,i){t.data("acf-lock-"+e,i)};i.lock=function(t,e,i){var n=h(t,e),a;n.indexOf(i)<0&&(n.push(i),p(t,e,n))},i.unlock=function(t,e,i){var n=h(t,e),a=n.indexOf(i);return a>-1&&(n.splice(a,1),p(t,e,n)),0===n.length},i.isLocked=function(t,e){return h(t,e).length>0},i.isGutenberg=function(){return window.wp&&wp.data&&wp.data.select&&wp.data.select("core/editor")},i.objectToArray=function(t){return Object.keys(t).map(function(e){return t[e]})},t.fn.exists=function(){return t(this).length>0},t.fn.outerHTML=function(){return t(this).get(0).outerHTML},Array.prototype.indexOf||(Array.prototype.indexOf=function(e){return t.inArray(e,this)}),t(document).ready(function(){i.doAction("ready")}),t(window).on("load",function(){i.doAction("load")}),t(window).on("beforeunload",function(){i.doAction("unload")}),t(window).on("resize",function(){i.doAction("resize")}),t(document).on("sortstart",function(t,e){i.doAction("sortstart",e.item,e.placeholder)}),t(document).on("sortstop",function(t,e){i.doAction("sortstop",e.item,e.placeholder)})}(jQuery),function(t,e){"use strict";var i=function(){function t(){return f}function e(t,e,i,n){return"string"==typeof t&&"function"==typeof e&&c("actions",t,e,i=parseInt(i||10,10),n),d}function i(){var t=Array.prototype.slice.call(arguments),e=t.shift();return"string"==typeof e&&u("actions",e,t),d}function n(t,e){return"string"==typeof t&&s("actions",t,e),d}function a(t,e,i,n){return"string"==typeof t&&"function"==typeof e&&c("filters",t,e,i=parseInt(i||10,10),n),d}function r(){var t=Array.prototype.slice.call(arguments),e=t.shift();return"string"==typeof e?u("filters",e,t):d}function o(t,e){return"string"==typeof t&&s("filters",t,e),d}function s(t,e,i,n){if(f[t][e])if(i){var a=f[t][e],r;if(n)for(r=a.length;r--;){var o=a[r];o.callback===i&&o.context===n&&a.splice(r,1)}else for(r=a.length;r--;)a[r].callback===i&&a.splice(r,1)}else f[t][e]=[]}function c(t,e,i,n,a){var r={callback:i,priority:n,context:a},o=f[t][e];o?(o.push(r),o=l(o)):o=[r],f[t][e]=o}function l(t){for(var e,i,n,a=1,r=t.length;a<r;a++){for(e=t[a],i=a;(n=t[i-1])&&n.priority>e.priority;)t[i]=t[i-1],--i;t[i]=e}return t}function u(t,e,i){var n=f[t][e];if(!n)return"filters"===t&&i[0];var a=0,r=n.length;if("filters"===t)for(;a<r;a++)i[0]=n[a].callback.apply(n[a].context,i);else for(;a<r;a++)n[a].callback.apply(n[a].context,i);return"filters"!==t||i[0]}var d={removeFilter:o,applyFilters:r,addFilter:a,removeAction:n,doAction:i,addAction:e,storage:t},f={actions:{},filters:{}};return d};acf.hooks=new i}(window),function(t,e){var i=/^(\S+)\s*(.*)$/,n=function(e){var i=this,n;return n=e&&e.hasOwnProperty("constructor")?e.constructor:function(){return i.apply(this,arguments)},t.extend(n,i),n.prototype=Object.create(i.prototype),t.extend(n.prototype,e),n.prototype.constructor=n,n},a=acf.Model=function(){this.cid=acf.uniqueId("acf"),this.data=t.extend(!0,{},this.data),this.setup.apply(this,arguments),this.$el&&!this.$el.data("acf")&&this.$el.data("acf",this);var e=function(){this.initialize(),this.addEvents(),this.addActions(),this.addFilters()};this.wait&&!acf.didAction(this.wait)?this.addAction(this.wait,e):e.apply(this)};t.extend(a.prototype,{id:"",cid:"",$el:null,data:{},busy:!1,changed:!1,events:{},actions:{},filters:{},eventScope:"",wait:!1,priority:10,get:function(t){return this.data[t]},has:function(t){return null!=this.get(t)},set:function(t,e,i){var n=this.get(t);return n==e?this:(this.data[t]=e,i||(this.changed=!0,this.trigger("changed:"+t,[e,n]),this.trigger("changed",[t,e,n])),this)},inherit:function(e){return e instanceof jQuery&&(e=e.data()),t.extend(this.data,e),this},prop:function(){return this.$el.prop.apply(this.$el,arguments)},setup:function(e){t.extend(this,e)},initialize:function(){},addElements:function(t){if(!(t=t||this.elements||null)||!Object.keys(t).length)return!1;for(var e in t)this.addElement(e,t[e])},addElement:function(t,e){this["$"+t]=this.$(e)},addEvents:function(t){if(!(t=t||this.events||null))return!1;for(var e in t){var n=e.match(i);this.on(n[1],n[2],t[e])}},removeEvents:function(t){if(!(t=t||this.events||null))return!1;for(var e in t){var n=e.match(i);this.off(n[1],n[2],t[e])}},getEventTarget:function(e,i){return e||this.$el||t(document)},validateEvent:function(e){return!this.eventScope||t(e.target).closest(this.eventScope).is(this.$el)},proxyEvent:function(e){return this.proxy(function(i){if(this.validateEvent(i)){var n,a=acf.arrayArgs(arguments).slice(1),r=[i,t(i.currentTarget)].concat(a);e.apply(this,r)}})},on:function(t,e,i,n){var a,r,o,s,c;t instanceof jQuery?n?(a=t,r=e,o=i,s=n):(a=t,r=e,s=i):i?(r=t,o=e,s=i):(r=t,s=e),a=this.getEventTarget(a),"string"==typeof s&&(s=this.proxyEvent(this[s])),r=r+"."+this.cid,c=o?[r,o,s]:[r,s],a.on.apply(a,c)},off:function(t,e,i){var n,a,r,o;t instanceof jQuery?i?(n=t,a=e,r=i):(n=t,a=e):e?(a=t,r=e):a=t,n=this.getEventTarget(n),a=a+"."+this.cid,o=r?[a,r]:[a],n.off.apply(n,o)},trigger:function(t,e,i){var n=this.getEventTarget();return i?n.trigger.apply(n,arguments):n.triggerHandler.apply(n,arguments),this},addActions:function(t){if(!(t=t||this.actions||null))return!1;for(var e in t)this.addAction(e,t[e])},removeActions:function(t){if(!(t=t||this.actions||null))return!1;for(var e in t)this.removeAction(e,t[e])},addAction:function(t,e,i){i=i||this.priority,"string"==typeof e&&(e=this[e]),acf.addAction(t,e,i,this)},removeAction:function(t,e){acf.removeAction(t,this[e])},addFilters:function(t){if(!(t=t||this.filters||null))return!1;for(var e in t)this.addFilter(e,t[e])},addFilter:function(t,e,i){i=i||this.priority,"string"==typeof e&&(e=this[e]),acf.addFilter(t,e,i,this)},removeFilters:function(t){if(!(t=t||this.filters||null))return!1;for(var e in t)this.removeFilter(e,t[e])},removeFilter:function(t,e){acf.removeFilter(t,this[e])},$:function(t){return this.$el.find(t)},remove:function(){this.removeEvents(),this.removeActions(),this.removeFilters(),this.$el.remove()},setTimeout:function(t,e){return setTimeout(this.proxy(t),e)},time:function(){console.time(this.id||this.cid)},timeEnd:function(){console.timeEnd(this.id||this.cid)},show:function(){acf.show(this.$el)},hide:function(){acf.hide(this.$el)},proxy:function(e){return t.proxy(e,this)}}),a.extend=n,acf.models={},acf.getInstance=function(t){return t.data("acf")},acf.getInstances=function(e){var i=[];return e.each(function(){i.push(acf.getInstance(t(this)))}),i}}(jQuery),function(t,e){acf.models.Popup=acf.Model.extend({data:{title:"",content:"",width:0,height:0,loading:!1},events:{'click [data-event="close"]':"onClickClose","click .acf-close-popup":"onClickClose"},setup:function(e){t.extend(this.data,e),this.$el=t(this.tmpl())},initialize:function(){this.render(),this.open()},tmpl:function(){return['<div id="acf-popup">','<div class="acf-popup-box acf-box">','<div class="title"><h3></h3><a href="#" class="acf-icon -cancel grey" data-event="close"></a></div>','<div class="inner"></div>','<div class="loading"><i class="acf-loading"></i></div>',"</div>",'<div class="bg" data-event="close"></div>',"</div>"].join("")},render:function(){var t=this.get("title"),e=this.get("content"),i=this.get("loading"),n=this.get("width"),a=this.get("height");this.title(t),this.content(e),n&&this.$(".acf-popup-box").css("width",n),a&&this.$(".acf-popup-box").css("min-height",a),this.loading(i),acf.doAction("append",this.$el)},update:function(t){this.data=acf.parseArgs(t,this.data),this.render()},title:function(t){this.$(".title:first h3").html(t)},content:function(t){this.$(".inner:first").html(t)},loading:function(t){var e=this.$(".loading:first");t?e.show():e.hide()},open:function(){t("body").append(this.$el)},close:function(){this.remove()},onClickClose:function(t,e){t.preventDefault(),this.close()}}),acf.newPopup=function(t){return new acf.models.Popup(t)}}(jQuery),function(t,e){acf.unload=new acf.Model({wait:"load",active:!0,changed:!1,actions:{validation_failure:"startListening",validation_success:"stopListening"},events:{"change form .acf-field":"startListening","submit form":"stopListening"},enable:function(){this.active=!0},disable:function(){this.active=!1},reset:function(){this.stopListening()},startListening:function(){!this.changed&&this.active&&(this.changed=!0,t(window).on("beforeunload",this.onUnload))},stopListening:function(){this.changed=!1,t(window).off("beforeunload",this.onUnload)},onUnload:function(){return acf.__("The changes you made will be lost if you navigate away from this page")}})}(jQuery),function(t,e){var i=new acf.Model({events:{"click .acf-panel-title":"onClick"},onClick:function(t,e){t.preventDefault(),this.toggle(e.parent())},isOpen:function(t){return t.hasClass("-open")},toggle:function(t){this.isOpen(t)?this.close(t):this.open(t)},open:function(t){t.addClass("-open"),t.find(".acf-panel-title i").attr("class","dashicons dashicons-arrow-down")},close:function(t){t.removeClass("-open"),t.find(".acf-panel-title i").attr("class","dashicons dashicons-arrow-right")}})}(jQuery),function(t,e){var i=acf.Model.extend({data:{text:"",type:"",timeout:0,dismiss:!0,target:!1,close:function(){}},events:{"click .acf-notice-dismiss":"onClickClose"},tmpl:function(){return'<div class="acf-notice"></div>'},setup:function(e){t.extend(this.data,e),this.$el=t(this.tmpl())},initialize:function(){this.render(),this.show()},render:function(){this.type(this.get("type")),this.html("<p>"+this.get("text")+"</p>"),this.get("dismiss")&&(this.$el.append('<a href="#" class="acf-notice-dismiss acf-icon -cancel small"></a>'),this.$el.addClass("-dismiss"));var t=this.get("timeout");t&&this.away(t)},update:function(e){t.extend(this.data,e),this.initialize(),this.removeEvents(),this.addEvents()},show:function(){var t=this.get("target");t&&t.prepend(this.$el)},hide:function(){this.$el.remove()},away:function(t){this.setTimeout(function(){acf.remove(this.$el)},t)},type:function(t){var e=this.get("type");e&&this.$el.removeClass("-"+e),this.$el.addClass("-"+t),"error"==t&&this.$el.addClass("acf-error-message")},html:function(t){this.$el.html(t)},text:function(t){this.$("p").html(t)},onClickClose:function(t,e){t.preventDefault(),this.get("close").apply(this,arguments),this.remove()}});acf.newNotice=function(t){return"object"!=typeof t&&(t={text:t}),new i(t)};var n=new acf.Model({wait:"prepare",priority:1,initialize:function(){var e=t(".acf-admin-notice");e.length&&t("h1:first").after(e)}})}(jQuery),function(t,e){acf.getPostbox=function(e){return"string"==typeof e&&(e=t("#"+e)),acf.getInstance(e)},acf.getPostboxes=function(){return acf.getInstances(t(".acf-postbox"))},acf.newPostbox=function(t){return new acf.models.Postbox(t)},acf.models.Postbox=acf.Model.extend({data:{id:"",key:"",style:"default",label:"top",edit:""},setup:function(e){e.editLink&&(e.edit=e.editLink),t.extend(this.data,e),this.$el=this.$postbox()},$postbox:function(){return t("#"+this.get("id"))},$hide:function(){return t("#"+this.get("id")+"-hide")},$hideLabel:function(){return this.$hide().parent()},$hndle:function(){return this.$("> .hndle")},$inside:function(){return this.$("> .inside")},isVisible:function(){return this.$el.hasClass("acf-hidden")},initialize:function(){this.$el.addClass("acf-postbox"),this.$el.removeClass("hide-if-js");var t=this.get("style");"default"!==t&&this.$el.addClass(t),this.$inside().addClass("acf-fields").addClass("-"+this.get("label"));var e=this.get("edit");e&&this.$hndle().append('<a href="'+e+'" class="dashicons dashicons-admin-generic acf-hndle-cog acf-js-tooltip" title="'+acf.__("Edit field group")+'"></a>'),this.show()},show:function(){this.$hideLabel().show(),this.$hide().prop("checked",!0),this.$el.show().removeClass("acf-hidden")},enable:function(){acf.enable(this.$el,"postbox")},showEnable:function(){this.show(),this.enable()},hide:function(){this.$hideLabel().hide(),this.$el.hide().addClass("acf-hidden")},disable:function(){acf.disable(this.$el,"postbox")},hideDisable:function(){this.hide(),this.disable()},html:function(t){this.$inside().html(t),acf.doAction("append",this.$el)}})}(jQuery),function(t,e){acf.newTooltip=function(t){return"object"!=typeof t&&(t={text:t}),void 0!==t.confirmRemove?(t.textConfirm=acf.__("Remove"),t.textCancel=acf.__("Cancel"),new n(t)):void 0!==t.confirm?new n(t):new i(t)};var i=acf.Model.extend({data:{text:"",timeout:0,target:null},tmpl:function(){return'<div class="acf-tooltip"></div>'},setup:function(e){t.extend(this.data,e),this.$el=t(this.tmpl())},initialize:function(){this.render(),this.show(),this.position();var e=this.get("timeout");e&&setTimeout(t.proxy(this.fade,this),e)},update:function(e){t.extend(this.data,e),this.initialize()},render:function(){this.html(this.get("text"))},show:function(){t("body").append(this.$el)},hide:function(){this.$el.remove()},fade:function(){this.$el.addClass("acf-fade-up"),this.setTimeout(function(){this.remove()},250)},html:function(t){this.$el.html(t)},position:function(){var e=this.$el,i=this.get("target");if(i){e.removeClass("right left bottom top").css({top:0,left:0});var n=10,a=i.outerWidth(),r=i.outerHeight(),o=i.offset().top,s=i.offset().left,c=e.outerWidth(),l=e.outerHeight(),u=e.offset().top,d=o-l-u,f=s+a/2-c/2;f<10?(e.addClass("right"),f=s+a,d=o+r/2-l/2-u):f+c+10>t(window).width()?(e.addClass("left"),f=s-c,d=o+r/2-l/2-u):d-t(window).scrollTop()<10?(e.addClass("bottom"),d=o+r-u):e.addClass("top"),e.css({top:d,left:f})}}}),n=i.extend({data:{text:"",textConfirm:"",textCancel:"",target:null,targetConfirm:!0,confirm:function(){},cancel:function(){},context:!1},events:{'click [data-event="cancel"]':"onCancel",'click [data-event="confirm"]':"onConfirm"},addEvents:function(){acf.Model.prototype.addEvents.apply(this);var e=t(document),i=this.get("target");this.setTimeout(function(){this.on(e,"click","onCancel")}),this.get("targetConfirm")&&this.on(i,"click","onConfirm")},removeEvents:function(){acf.Model.prototype.removeEvents.apply(this);var e=t(document),i=this.get("target");this.off(e,"click"),this.off(i,"click")},render:function(){var t,e,i,n=[this.get("text")||acf.__("Are you sure?"),'<a href="#" data-event="confirm">'+(this.get("textConfirm")||acf.__("Yes"))+"</a>",'<a href="#" data-event="cancel">'+(this.get("textCancel")||acf.__("No"))+"</a>"].join(" ");this.html(n),this.$el.addClass("-confirm")},onCancel:function(t,e){t.preventDefault(),t.stopImmediatePropagation();var i=this.get("cancel"),n=this.get("context")||this;i.apply(n,arguments),this.remove()},onConfirm:function(t,e){t.preventDefault(),t.stopImmediatePropagation();var i=this.get("confirm"),n=this.get("context")||this;i.apply(n,arguments),this.remove()}});acf.models.Tooltip=i,acf.models.TooltipConfirm=n;var a=new acf.Model({tooltip:!1,events:{"mouseenter .acf-js-tooltip":"showTitle","mouseup .acf-js-tooltip":"hideTitle","mouseleave .acf-js-tooltip":"hideTitle"},showTitle:function(t,e){var i=e.attr("title");i&&(e.attr("title",""),this.tooltip?this.tooltip.update({text:i,target:e}):this.tooltip=acf.newTooltip({text:i,target:e}))},hideTitle:function(t,e){this.tooltip.hide(),e.attr("title",this.tooltip.get("text"))}})}(jQuery),function(t,e){var i=[];acf.Field=acf.Model.extend({type:"",eventScope:".acf-field",wait:"ready",setup:function(t){this.$el=t,this.inherit(t),this.inherit(this.$control())},val:function(t){return void 0!==t?this.setValue(t):this.prop("disabled")?null:this.getValue()},getValue:function(){return this.$input().val()},setValue:function(t){return acf.val(this.$input(),t)},__:function(t){return acf._e(this.type,t)},$control:function(){return!1},$input:function(){return this.$("[name]:first")},$inputWrap:function(){return this.$(".acf-input:first")},$labelWrap:function(){return this.$(".acf-label:first")},getInputName:function(){return this.$input().attr("name")||""},parent:function(){var t=this.parents();return!!t.length&&t[0]},parents:function(){var t=this.$el.parents(".acf-field"),e;return acf.getFields(t)},show:function(t,e){var i=acf.show(this.$el,t);return i&&(this.prop("hidden",!1),acf.doAction("show_field",this,e)),i},hide:function(t,e){var i=acf.hide(this.$el,t);return i&&(this.prop("hidden",!0),acf.doAction("hide_field",this,e)),i},enable:function(t,e){var i=acf.enable(this.$el,t);return i&&(this.prop("disabled",!1),acf.doAction("enable_field",this,e)),i},disable:function(t,e){var i=acf.disable(this.$el,t);return i&&(this.prop("disabled",!0),acf.doAction("disable_field",this,e)),i},showEnable:function(t,e){return this.enable.apply(this,arguments),this.show.apply(this,arguments)},hideDisable:function(t,e){return this.disable.apply(this,arguments),this.hide.apply(this,arguments)},showNotice:function(t){"object"!=typeof t&&(t={text:t}),this.notice&&this.notice.remove(),t.target=this.$inputWrap(),this.notice=acf.newNotice(t)},removeNotice:function(t){this.notice&&(this.notice.away(t||0),this.notice=!1)},showError:function(e){this.$el.addClass("acf-error"),void 0!==e&&this.showNotice({text:e,type:"error",dismiss:!1}),acf.doAction("invalid_field",this),this.$el.one("focus change","input, select, textarea",t.proxy(this.removeError,this))},removeError:function(){this.$el.removeClass("acf-error"),this.removeNotice(250),acf.doAction("valid_field",this)},trigger:function(t,e,i){return"invalidField"==t&&(i=!0),acf.Model.prototype.trigger.apply(this,[t,e,i])}}),acf.newField=function(t){var e=t.data("type"),i=n(e),a,r=new(acf.models[i]||acf.Field)(t);return acf.doAction("new_field",r),r};var n=function(t){return acf.strPascalCase(t||"")+"Field"};acf.registerFieldType=function(t){var e,a=t.prototype.type,r=n(a);acf.models[r]=t,i.push(a)},acf.getFieldType=function(t){var e=n(t);return acf.models[e]||!1},acf.getFieldTypes=function(t){t=acf.parseArgs(t,{category:""});var e=[];return i.map(function(i){var n=acf.getFieldType(i),a=n.prototype;t.category&&a.category!==t.category||e.push(n)}),e}}(jQuery),function(t,e){acf.findFields=function(e){var i=".acf-field",n=!1;return(e=acf.parseArgs(e,{key:"",name:"",type:"",is:"",parent:!1,sibling:!1,limit:!1,visible:!1,suppressFilters:!1})).suppressFilters||(e=acf.applyFilters("find_fields_args",e)),e.key&&(i+='[data-key="'+e.key+'"]'),e.type&&(i+='[data-type="'+e.type+'"]'),e.name&&(i+='[data-name="'+e.name+'"]'),e.is&&(i+=e.is),e.visible&&(i+=":visible"),n=e.parent?e.parent.find(i):e.sibling?e.sibling.siblings(i):t(i),e.suppressFilters||(n=n.not(".acf-clone .acf-field"),n=acf.applyFilters("find_fields",n)),e.limit&&(n=n.slice(0,e.limit)),n},acf.findField=function(t,e){return acf.findFields({key:t,limit:1,parent:e,suppressFilters:!0})},acf.getField=function(t){t instanceof jQuery||(t=acf.findField(t));var e=t.data("acf");return e||(e=acf.newField(t)),e},acf.getFields=function(e){e instanceof jQuery||(e=acf.findFields(e));var i=[];return e.each(function(){var e=acf.getField(t(this));i.push(e)}),i},acf.findClosestField=function(t){return t.closest(".acf-field")},acf.getClosestField=function(t){var e=acf.findClosestField(t);return this.getField(e)};var i=function(t){var e=t,i=t+"_fields",a=t+"_field",r=function(t){var e,n=acf.arrayArgs(arguments).slice(1),a=acf.getFields({parent:t});if(a.length){var r=[i,a].concat(n);acf.doAction.apply(null,r)}},o=function(t){var e,i=acf.arrayArgs(arguments).slice(1);t.map(function(t,e){var n=[a,t].concat(i);acf.doAction.apply(null,n)})};acf.addAction(e,r),acf.addAction(i,o),n(t)},n=function(t){var e=t+"_field",i=t+"Field",n=function(n){var a=acf.arrayArgs(arguments),r=a.slice(1),s;["type","name","key"].map(function(t){var i="/"+t+"="+n.get(t);a=[e+i,n].concat(r),acf.doAction.apply(null,a)}),o.indexOf(t)>-1&&n.trigger(i,r)};acf.addAction(e,n)},a,r=["valid","invalid","enable","disable","new"],o=["remove","unmount","remount","sortstart","sortstop","show","hide","unload","valid","invalid","enable","disable"];["prepare","ready","load","append","remove","unmount","remount","sortstart","sortstop","show","hide","unload"].map(i),r.map(n);var s=new acf.Model({id:"fieldsEventManager",events:{'click .acf-field a[href="#"]':"onClick","change .acf-field":"onChange"},onClick:function(t){t.preventDefault()},onChange:function(){t("#_acf_changed").val(1)}})}(jQuery),function(t,e){var i=0,n=acf.Field.extend({type:"accordion",wait:"",$control:function(){return this.$(".acf-fields:first")},initialize:function(){if(!this.$el.is("td")){if(this.get("endpoint"))return this.remove();var e=this.$el,n=this.$labelWrap(),r=this.$inputWrap(),o=this.$control(),s=r.children(".description");if(s.length&&n.append(s),this.$el.is("tr")){var c=this.$el.closest("table"),l=t('<div class="acf-accordion-title"/>'),u=t('<div class="acf-accordion-content"/>'),d=t('<table class="'+c.attr("class")+'"/>'),f=t("<tbody/>");l.append(n.html()),d.append(f),u.append(d),r.append(l),r.append(u),n.remove(),o.remove(),r.attr("colspan",2),n=l,r=u,o=f}e.addClass("acf-accordion"),n.addClass("acf-accordion-title"),r.addClass("acf-accordion-content"),i++,this.get("multi_expand")&&e.attr("multi-expand",1);var h=acf.getPreference("this.accordions")||[];void 0!==h[i-1]&&this.set("open",h[i-1]),this.get("open")&&(e.addClass("-open"),r.css("display","block")),n.prepend(a.iconHtml({open:this.get("open")}));var p=e.parent();o.addClass(p.hasClass("-left")?"-left":""),o.addClass(p.hasClass("-clear")?"-clear":""),o.append(e.nextUntil(".acf-field-accordion",".acf-field")),o.removeAttr("data-open data-multi_expand data-endpoint")}}});acf.registerFieldType(n);var a=new acf.Model({actions:{unload:"onUnload"},events:{"click .acf-accordion-title":"onClick",
|
2 |
-
"invalidField .acf-accordion":"onInvalidField"},isOpen:function(t){return t.hasClass("-open")},toggle:function(t){this.isOpen(t)?this.close(t):this.open(t)},iconHtml:function(t){var e;return'<i class="acf-accordion-icon dashicons dashicons-'+(t.open?"arrow-down":"arrow-right")+'"></i>'},open:function(e){e.find(".acf-accordion-content:first").slideDown().css("display","block"),e.find(".acf-accordion-icon:first").replaceWith(this.iconHtml({open:!0})),e.addClass("-open"),acf.doAction("show",e),e.attr("multi-expand")||e.siblings(".acf-accordion.-open").each(function(){a.close(t(this))})},close:function(t){t.find(".acf-accordion-content:first").slideUp(),t.find(".acf-accordion-icon:first").replaceWith(this.iconHtml({open:!1})),t.removeClass("-open"),acf.doAction("hide",t)},onClick:function(t,e){t.preventDefault(),this.toggle(e.parent())},onInvalidField:function(t,e){this.busy||(this.busy=!0,this.setTimeout(function(){this.busy=!1},1e3),this.open(e))},onUnload:function(e){var i=[];t(".acf-accordion").each(function(){var e=t(this).hasClass("-open")?1:0;i.push(e)}),i.length&&acf.setPreference("this.accordions",i)}})}(jQuery),function(t,e){var i=acf.Field.extend({type:"button_group",events:{'click input[type="radio"]':"onClick"},$control:function(){return this.$(".acf-button-group")},$input:function(){return this.$("input:checked")},setValue:function(t){this.$('input[value="'+t+'"]').prop("checked",!0).trigger("change")},onClick:function(t,e){var i=e.parent("label"),n=i.hasClass("selected");this.$(".selected").removeClass("selected"),i.addClass("selected"),this.get("allow_null")&&n&&(i.removeClass("selected"),e.prop("checked",!1).trigger("change"))}});acf.registerFieldType(i)}(jQuery),function(t,e){var i=acf.Field.extend({type:"checkbox",events:{"change input":"onChange","click .acf-add-checkbox":"onClickAdd","click .acf-checkbox-toggle":"onClickToggle","click .acf-checkbox-custom":"onClickCustom"},$control:function(){return this.$(".acf-checkbox-list")},$toggle:function(){return this.$(".acf-checkbox-toggle")},$input:function(){return this.$('input[type="hidden"]')},$inputs:function(){return this.$('input[type="checkbox"]').not(".acf-checkbox-toggle")},getValue:function(){var e=[];return this.$(":checked").each(function(){e.push(t(this).val())}),!!e.length&&e},onChange:function(t,e){var i=e.prop("checked"),n=this.$toggle(),a;(i?e.parent().addClass("selected"):e.parent().removeClass("selected"),n.length)&&(0==this.$inputs().not(":checked").length?n.prop("checked",!0):n.prop("checked",!1))},onClickAdd:function(t,e){var i='<li><input class="acf-checkbox-custom" type="checkbox" checked="checked" /><input type="text" name="'+this.getInputName()+'[]" /></li>';e.parent("li").before(i)},onClickToggle:function(t,e){var i=e.prop("checked"),n;this.$inputs().prop("checked",i)},onClickCustom:function(t,e){var i=e.prop("checked"),n=e.next('input[type="text"]');i?n.prop("disabled",!1):(n.prop("disabled",!0),""==n.val()&&e.parent("li").remove())}});acf.registerFieldType(i)}(jQuery),function(t,e){var i=acf.Field.extend({type:"color_picker",wait:"load",$control:function(){return this.$(".acf-color-picker")},$input:function(){return this.$('input[type="hidden"]')},$inputText:function(){return this.$('input[type="text"]')},setValue:function(t){acf.val(this.$input(),t),this.$inputText().iris("color",t)},initialize:function(){var t=this.$input(),e=this.$inputText(),i=function(i){setTimeout(function(){acf.val(t,e.val())},1)},n={defaultColor:!1,palettes:!0,hide:!0,change:i,clear:i},n=acf.applyFilters("color_picker_args",n,this);e.wpColorPicker(n)}});acf.registerFieldType(i)}(jQuery),function(t,e){var i=acf.Field.extend({type:"date_picker",events:{'blur input[type="text"]':"onBlur"},$control:function(){return this.$(".acf-date-picker")},$input:function(){return this.$('input[type="hidden"]')},$inputText:function(){return this.$('input[type="text"]')},initialize:function(){if(this.has("save_format"))return this.initializeCompatibility();var t=this.$input(),e=this.$inputText(),i={dateFormat:this.get("date_format"),altField:t,altFormat:"yymmdd",changeYear:!0,yearRange:"-100:+100",changeMonth:!0,showButtonPanel:!0,firstDay:this.get("first_day")};i=acf.applyFilters("date_picker_args",i,this),acf.newDatePicker(e,i),acf.doAction("date_picker_init",e,i,this)},initializeCompatibility:function(){var t=this.$input(),e=this.$inputText();e.val(t.val());var i={dateFormat:this.get("date_format"),altField:t,altFormat:this.get("save_format"),changeYear:!0,yearRange:"-100:+100",changeMonth:!0,showButtonPanel:!0,firstDay:this.get("first_day")},n=(i=acf.applyFilters("date_picker_args",i,this)).dateFormat;i.dateFormat=this.get("save_format"),acf.newDatePicker(e,i),e.datepicker("option","dateFormat",n),acf.doAction("date_picker_init",e,i,this)},onBlur:function(){this.$inputText().val()||acf.val(this.$input(),"")}});acf.registerFieldType(i);var n=new acf.Model({priority:5,wait:"ready",initialize:function(){var e=acf.get("locale"),i=acf.get("rtl"),n=acf.get("datePickerL10n");return!!n&&(void 0!==t.datepicker&&(n.isRTL=i,t.datepicker.regional[e]=n,void t.datepicker.setDefaults(n)))}});acf.newDatePicker=function(e,i){if(void 0===t.datepicker)return!1;i=i||{},e.datepicker(i),t("body > #ui-datepicker-div").exists()&&t("body > #ui-datepicker-div").wrap('<div class="acf-ui-datepicker" />')}}(jQuery),function(t,e){var i=acf.models.DatePickerField.extend({type:"date_time_picker",$control:function(){return this.$(".acf-date-time-picker")},initialize:function(){var t=this.$input(),e=this.$inputText(),i={dateFormat:this.get("date_format"),timeFormat:this.get("time_format"),altField:t,altFieldTimeOnly:!1,altFormat:"yy-mm-dd",altTimeFormat:"HH:mm:ss",changeYear:!0,yearRange:"-100:+100",changeMonth:!0,showButtonPanel:!0,firstDay:this.get("first_day"),controlType:"select",oneLine:!0};i=acf.applyFilters("date_time_picker_args",i,this),acf.newDateTimePicker(e,i),acf.doAction("date_time_picker_init",e,i,this)}});acf.registerFieldType(i);var n=new acf.Model({priority:5,wait:"ready",initialize:function(){var e=acf.get("locale"),i=acf.get("rtl"),n=acf.get("dateTimePickerL10n");return!!n&&(void 0!==t.timepicker&&(n.isRTL=i,t.timepicker.regional[e]=n,void t.timepicker.setDefaults(n)))}});acf.newDateTimePicker=function(e,i){if(void 0===t.timepicker)return!1;i=i||{},e.datetimepicker(i),t("body > #ui-datepicker-div").exists()&&t("body > #ui-datepicker-div").wrap('<div class="acf-ui-datepicker" />')}}(jQuery),function(t,e){function i(e){if(r)return e();if(acf.isset(window,"google","maps","Geocoder"))return r=new google.maps.Geocoder,e();if(acf.addAction("google_map_api_loaded",e),!a){var i=acf.get("google_map_api");i&&(a=!0,t.ajax({url:i,dataType:"script",cache:!0,success:function(){r=new google.maps.Geocoder,acf.doAction("google_map_api_loaded")}}))}}var n=acf.Field.extend({type:"google_map",map:!1,wait:"load",events:{'click a[data-name="clear"]':"onClickClear",'click a[data-name="locate"]':"onClickLocate",'click a[data-name="search"]':"onClickSearch","keydown .search":"onKeydownSearch","keyup .search":"onKeyupSearch","focus .search":"onFocusSearch","blur .search":"onBlurSearch",showField:"onShow"},$control:function(){return this.$(".acf-google-map")},$input:function(t){return this.$('input[data-name="'+(t||"address")+'"]')},$search:function(){return this.$(".search")},$canvas:function(){return this.$(".canvas")},addClass:function(t){this.$control().addClass(t)},removeClass:function(t){this.$control().removeClass(t)},getValue:function(){var e={lat:"",lng:"",address:""};return this.$('input[type="hidden"]').each(function(){e[t(this).data("name")]=t(this).val()}),e.lat&&e.lng||(e=!1),e},setValue:function(t){for(var e in t=acf.parseArgs(t,{lat:"",lng:"",address:""}))acf.val(this.$input(e),t[e]);t.lat&&t.lng||(t=!1),this.renderVal(t);var i=this.newLatLng(t.lat,t.lng);acf.doAction("google_map_change",i,this.map,this)},renderVal:function(t){t?(this.addClass("-value"),this.setPosition(t.lat,t.lng),this.map.marker.setVisible(!0)):(this.removeClass("-value"),this.map.marker.setVisible(!1)),this.$search().val(t.address)},setPosition:function(t,e){var i=this.newLatLng(t,e);return this.map.marker.setPosition(i),this.map.marker.setVisible(!0),this.center(),this},center:function(){var t=this.map.marker.getPosition(),e=this.get("lat"),i=this.get("lng");t&&(e=t.lat(),i=t.lng());var n=this.newLatLng(e,i);this.map.setCenter(n)},getSearchVal:function(){return this.$search().val()},initialize:function(){i(this.initializeMap.bind(this))},newLatLng:function(t,e){return new google.maps.LatLng(parseFloat(t),parseFloat(e))},initializeMap:function(){var t=this.get("zoom"),e=this.get("lat"),i=this.get("lng"),n={scrollwheel:!1,zoom:parseInt(t),center:this.newLatLng(e,i),mapTypeId:google.maps.MapTypeId.ROADMAP,marker:{draggable:!0,raiseOnDrag:!0},autocomplete:{}};n=acf.applyFilters("google_map_args",n,this);var a=new google.maps.Map(this.$canvas()[0],n),r=acf.parseArgs(n.marker,{draggable:!0,raiseOnDrag:!0,map:a});r=acf.applyFilters("google_map_marker_args",r,this);var o=new google.maps.Marker(r),s=!1;if(acf.isset(google,"maps","places","Autocomplete")){var c=n.autocomplete||{};c=acf.applyFilters("google_map_autocomplete_args",c,this),(s=new google.maps.places.Autocomplete(this.$search()[0],c)).bindTo("bounds",a)}this.addMapEvents(this,a,o,s),a.acf=this,a.marker=o,a.autocomplete=s,this.map=a,acf.doAction("google_map_init",a,o,this);var l=this.getValue();this.renderVal(l)},addMapEvents:function(t,e,i,n){google.maps.event.addListener(e,"click",function(e){var i=e.latLng.lat(),n=e.latLng.lng();t.searchPosition(i,n)}),google.maps.event.addListener(i,"dragend",function(){var e=this.getPosition(),i=e.lat(),n=e.lng();t.searchPosition(i,n)}),n&&google.maps.event.addListener(n,"place_changed",function(){var e=this.getPlace();e.address=t.getSearchVal(),t.setPlace(e)})},searchPosition:function(e,i){var n=this.newLatLng(e,i),a=this.$control();this.setPosition(e,i),a.addClass("-loading");var o=t.proxy(function(t,n){a.removeClass("-loading");var r="";n!=google.maps.GeocoderStatus.OK?console.log("Geocoder failed due to: "+n):t[0]?r=t[0].formatted_address:console.log("No results found"),this.val({lat:e,lng:i,address:r})},this);r.geocode({latLng:n},o)},setPlace:function(t){if(!t)return this;if(t.name&&!t.geometry)return this.searchAddress(t.name),this;var e=t.geometry.location.lat(),i=t.geometry.location.lng(),n=t.address||t.formatted_address;return this.setValue({lat:e,lng:i,address:n}),this},searchAddress:function(e){var i=e.split(",");if(2==i.length){var n=i[0],a=i[1];if(t.isNumeric(n)&&t.isNumeric(a))return this.searchPosition(n,a)}var o=this.$control();o.addClass("-loading");var s=this.proxy(function(t,i){o.removeClass("-loading");var n="",a="";i!=google.maps.GeocoderStatus.OK?console.log("Geocoder failed due to: "+i):t[0]?(n=t[0].geometry.location.lat(),a=t[0].geometry.location.lng()):console.log("No results found"),this.val({lat:n,lng:a,address:e})});r.geocode({address:e},s)},searchLocation:function(){if(!navigator.geolocation)return alert(acf.__("Sorry, this browser does not support geolocation"));var e=this.$control();e.addClass("-loading");var i=t.proxy(function(t,i){e.removeClass("-loading");var n=t.coords.latitude,a=t.coords.longitude;this.searchPosition(n,a)},this),n=function(t){e.removeClass("-loading")};navigator.geolocation.getCurrentPosition(i,n)},onClickClear:function(t,e){this.val(!1)},onClickLocate:function(t,e){this.searchLocation()},onClickSearch:function(t,e){this.searchAddress(this.$search().val())},onFocusSearch:function(t,e){this.removeClass("-value"),this.onKeyupSearch.apply(this,arguments)},onBlurSearch:function(t,e){this.setTimeout(function(){this.removeClass("-search"),e.val()&&this.addClass("-value")},100)},onKeyupSearch:function(t,e){e.val()?this.addClass("-search"):this.removeClass("-search")},onKeydownSearch:function(t,e){13==t.which&&t.preventDefault()},onMousedown:function(){},onShow:function(){if(!this.map)return!1;this.setTimeout(this.center,10)}});acf.registerFieldType(n);var a=!1,r=!1}(jQuery),function(t,e){var i=acf.Field.extend({type:"image",$control:function(){return this.$(".acf-image-uploader")},$input:function(){return this.$('input[type="hidden"]')},events:{'click a[data-name="add"]':"onClickAdd",'click a[data-name="edit"]':"onClickEdit",'click a[data-name="remove"]':"onClickRemove",'change input[type="file"]':"onChange"},initialize:function(){"basic"===this.get("uploader")&&this.$el.closest("form").attr("enctype","multipart/form-data")},validateAttachment:function(t){void 0!==(t=t||{}).id&&(t=t.attributes),t=acf.parseArgs(t,{url:"",alt:"",title:"",caption:"",description:"",width:0,height:0});var e=acf.isget(t,"sizes",this.get("preview_size"),"url");return null!==e&&(t.url=e),t},render:function(t){t=this.validateAttachment(t),this.$("img").attr({src:t.url,alt:t.alt,title:t.title});var e=t.id||"";this.val(e),e?this.$control().addClass("has-value"):this.$control().removeClass("has-value")},append:function(t,e){var i=function(t,e){for(var i=acf.getFields({key:t.get("key"),parent:e.$el}),n=0;n<i.length;n++)if(!i[n].val())return i[n];return!1},n=i(this,e);n||(e.$(".acf-button:last").trigger("click"),n=i(this,e)),n&&n.render(t)},selectAttachment:function(){var e=this.parent(),i=e&&"repeater"===e.get("type"),n=acf.newMediaPopup({mode:"select",type:"image",title:acf.__("Select Image"),field:this.get("key"),multiple:i,library:this.get("library"),allowedTypes:this.get("mime_types"),select:t.proxy(function(t,i){i>0?this.append(t,e):this.render(t)},this)})},editAttachment:function(){var e=this.val();if(e)var i=acf.newMediaPopup({mode:"edit",title:acf.__("Edit Image"),button:acf.__("Update Image"),attachment:e,field:this.get("key"),select:t.proxy(function(t,e){this.render(t)},this)})},removeAttachment:function(){this.render(!1)},onClickAdd:function(t,e){this.selectAttachment()},onClickEdit:function(t,e){this.editAttachment()},onClickRemove:function(t,e){this.removeAttachment()},onChange:function(e,i){var n=this.$input();acf.getFileInputData(i,function(e){n.val(t.param(e))})}});acf.registerFieldType(i)}(jQuery),function(t,e){var i=acf.models.ImageField.extend({type:"file",$control:function(){return this.$(".acf-file-uploader")},$input:function(){return this.$('input[type="hidden"]')},validateAttachment:function(t){return void 0!==(t=t||{}).id&&(t=t.attributes),t=acf.parseArgs(t,{url:"",alt:"",title:"",filename:"",filesizeHumanReadable:"",icon:"/wp-includes/images/media/default.png"})},render:function(t){t=this.validateAttachment(t),this.$("img").attr({src:t.icon,alt:t.alt,title:t.title}),this.$('[data-name="title"]').text(t.title),this.$('[data-name="filename"]').text(t.filename).attr("href",t.url),this.$('[data-name="filesize"]').text(t.filesizeHumanReadable);var e=t.id||"";acf.val(this.$input(),e),e?this.$control().addClass("has-value"):this.$control().removeClass("has-value")},selectAttachment:function(){var e=this.parent(),i=e&&"repeater"===e.get("type"),n=acf.newMediaPopup({mode:"select",title:acf.__("Select File"),field:this.get("key"),multiple:i,library:this.get("library"),allowedTypes:this.get("mime_types"),select:t.proxy(function(t,i){i>0?this.append(t,e):this.render(t)},this)})},editAttachment:function(){var e=this.val();if(!e)return!1;var i=acf.newMediaPopup({mode:"edit",title:acf.__("Edit File"),button:acf.__("Update File"),attachment:e,field:this.get("key"),select:t.proxy(function(t,e){this.render(t)},this)})}});acf.registerFieldType(i)}(jQuery),function(t,e){var i=acf.Field.extend({type:"link",events:{'click a[data-name="add"]':"onClickEdit",'click a[data-name="edit"]':"onClickEdit",'click a[data-name="remove"]':"onClickRemove","change .link-node":"onChange"},$control:function(){return this.$(".acf-link")},$node:function(){return this.$(".link-node")},getValue:function(){var t=this.$node();return!!t.attr("href")&&{title:t.html(),url:t.attr("href"),target:t.attr("target")}},setValue:function(t){t=acf.parseArgs(t,{title:"",url:"",target:""});var e=this.$control(),i=this.$node();e.removeClass("-value -external"),t.url&&e.addClass("-value"),"_blank"===t.target&&e.addClass("-external"),this.$(".link-title").html(t.title),this.$(".link-url").attr("href",t.url).html(t.url),i.html(t.title),i.attr("href",t.url),i.attr("target",t.target),this.$(".input-title").val(t.title),this.$(".input-target").val(t.target),this.$(".input-url").val(t.url).trigger("change")},onClickEdit:function(t,e){acf.wpLink.open(this.$node())},onClickRemove:function(t,e){this.setValue(!1)},onChange:function(t,e){var i=this.getValue();this.setValue(i)}});acf.registerFieldType(i),acf.wpLink=new acf.Model({getNodeValue:function(){var t=this.get("node");return{title:t.html(),url:t.attr("href"),target:t.attr("target")}},setNodeValue:function(t){var e=this.get("node");e.html(t.title),e.attr("href",t.url),e.attr("target",t.target),e.trigger("change")},getInputValue:function(){return{title:t("#wp-link-text").val(),url:t("#wp-link-url").val(),target:t("#wp-link-target").prop("checked")?"_blank":""}},setInputValue:function(e){t("#wp-link-text").val(e.title),t("#wp-link-url").val(e.url),t("#wp-link-target").prop("checked","_blank"===e.target)},open:function(e){this.on("wplink-open","onOpen"),this.on("wplink-close","onClose"),this.set("node",e);var i=t('<textarea id="acf-link-textarea" style="display:none;"></textarea>');t("body").append(i);var n=this.getNodeValue();wpLink.open("acf-link-textarea",n.url,n.title,null)},onOpen:function(){t("#wp-link-wrap").addClass("has-text-field");var e=this.getNodeValue();this.setInputValue(e)},close:function(){wpLink.close()},onClose:function(){if(!this.has("node"))return!1;this.off("wplink-open"),this.off("wplink-close");var e=this.getInputValue();this.setNodeValue(e),t("#acf-link-textarea").remove(),this.set("node",null)}})}(jQuery),function(t,e){var i=acf.Field.extend({type:"oembed",events:{'click [data-name="clear-button"]':"onClickClear","keypress .input-search":"onKeypressSearch","keyup .input-search":"onKeyupSearch","change .input-search":"onChangeSearch"},$control:function(){return this.$(".acf-oembed")},$input:function(){return this.$(".input-value")},$search:function(){return this.$(".input-search")},getValue:function(){return this.$input().val()},getSearchVal:function(){return this.$search().val()},setValue:function(t){t?this.$control().addClass("has-value"):this.$control().removeClass("has-value"),acf.val(this.$input(),t)},showLoading:function(t){acf.showLoading(this.$(".canvas"))},hideLoading:function(){acf.hideLoading(this.$(".canvas"))},maybeSearch:function(){var e=this.val(),i=this.getSearchVal();if(!i)return this.clear();if("http"!=i.substr(0,4)&&(i="http://"+i),i!==e){var n=this.get("timeout");n&&clearTimeout(n);var a=t.proxy(this.search,this,i);this.set("timeout",setTimeout(a,300))}},search:function(e){var i={action:"acf/fields/oembed/search",s:e,field_key:this.get("key")},n;(n=this.get("xhr"))&&n.abort(),this.showLoading();var n=t.ajax({url:acf.get("ajaxurl"),data:acf.prepareForAjax(i),type:"post",dataType:"json",context:this,success:function(t){t&&t.html||(t={url:!1,html:""}),this.val(t.url),this.$(".canvas-media").html(t.html)},complete:function(){this.hideLoading()}});this.set("xhr",n)},clear:function(){this.val(""),this.$search().val(""),this.$(".canvas-media").html("")},onClickClear:function(t,e){this.clear()},onKeypressSearch:function(t,e){13==t.which&&(t.preventDefault(),this.maybeSearch())},onKeyupSearch:function(t,e){e.val()&&this.maybeSearch()},onChangeSearch:function(t,e){this.maybeSearch()}});acf.registerFieldType(i)}(jQuery),function(t,e){var i=acf.Field.extend({type:"radio",events:{'click input[type="radio"]':"onClick"},$control:function(){return this.$(".acf-radio-list")},$input:function(){return this.$("input:checked")},$inputText:function(){return this.$('input[type="text"]')},getValue:function(){var t=this.$input().val();return"other"===t&&this.get("other_choice")&&(t=this.$inputText().val()),t},onClick:function(t,e){var i=e.parent("label"),n=i.hasClass("selected"),a=e.val();this.$(".selected").removeClass("selected"),i.addClass("selected"),this.get("allow_null")&&n&&(i.removeClass("selected"),e.prop("checked",!1).trigger("change"),a=!1),this.get("other_choice")&&("other"===a?this.$inputText().prop("disabled",!1):this.$inputText().prop("disabled",!0))}});acf.registerFieldType(i)}(jQuery),function(t,e){var i=acf.Field.extend({type:"range",events:{'input input[type="range"]':"onChange","change input":"onChange"},$input:function(){return this.$('input[type="range"]')},$inputAlt:function(){return this.$('input[type="number"]')},setValue:function(t){this.busy=!0,acf.val(this.$input(),t),acf.val(this.$inputAlt(),t,!0),this.busy=!1},onChange:function(t,e){this.busy||this.setValue(e.val())}});acf.registerFieldType(i)}(jQuery),function(t,e){var i=acf.Field.extend({type:"relationship",events:{"keypress [data-filter]":"onKeypressFilter","change [data-filter]":"onChangeFilter","keyup [data-filter]":"onChangeFilter","click .choices-list .acf-rel-item":"onClickAdd",'click [data-name="remove_item"]':"onClickRemove",mouseover:"onHover"},$control:function(){return this.$(".acf-relationship")},$list:function(t){return this.$("."+t+"-list")},$listItems:function(t){return this.$list(t).find(".acf-rel-item")},$listItem:function(t,e){return this.$list(t).find('.acf-rel-item[data-id="'+e+'"]')},getValue:function(){var e=[];return this.$listItems("values").each(function(){e.push(t(this).data("id"))}),!!e.length&&e},newChoice:function(t){return["<li>",'<span data-id="'+t.id+'" class="acf-rel-item">'+t.text+"</span>","</li>"].join("")},newValue:function(t){return["<li>",'<input type="hidden" name="'+this.getInputName()+'[]" value="'+t.id+'" />','<span data-id="'+t.id+'" class="acf-rel-item">'+t.text,'<a href="#" class="acf-icon -minus small dark" data-name="remove_item"></a>',"</span>","</li>"].join("")},addSortable:function(t){this.$list("values").sortable({items:"li",forceHelperSize:!0,forcePlaceholderSize:!0,scroll:!0,update:function(){t.$input().trigger("change")}})},initialize:function(){var t=this.proxy(function(t){if(!this.get("loading")&&this.get("more")){var e=this.$list("choices"),i=Math.ceil(e.scrollTop()),n=Math.ceil(e[0].scrollHeight),a=Math.ceil(e.innerHeight()),r=this.get("paged")||1;i+a>=n&&(this.set("paged",r+1),this.fetch())}});this.$list("choices").scrollTop(0).on("scroll",t),this.fetch()},onHover:function(e){t().off(e),this.addSortable(this)},onKeypressFilter:function(t,e){13==t.which&&t.preventDefault()},onChangeFilter:function(t,e){var i=e.val(),n=e.data("filter");this.get(n)!==i&&(this.set(n,i),this.set("paged",1),e.is("select")?this.fetch():this.maybeFetch())},onClickAdd:function(t,e){var i=this.val(),n=parseInt(this.get("max"));if(e.hasClass("disabled"))return!1;if(n>0&&i&&i.length>=n)return this.showNotice({text:acf.__("Maximum values reached ( {max} values )").replace("{max}",n),type:"warning"}),!1;e.addClass("disabled");var a=this.newValue({id:e.data("id"),text:e.html()});this.$list("values").append(a),this.$input().trigger("change")},onClickRemove:function(t,e){t.preventDefault();var i=e.parent(),n=i.parent(),a=i.data("id");n.remove(),this.$listItem("choices",a).removeClass("disabled"),this.$input().trigger("change")},maybeFetch:function(){var t=this.get("timeout");t&&clearTimeout(t),t=this.setTimeout(this.fetch,300),this.set("timeout",t)},getAjaxData:function(){var t=this.$control().data();for(var e in t)t[e]=this.get(e);return t.action="acf/fields/relationship/query",t.field_key=this.get("key"),t=acf.applyFilters("relationship_ajax_data",t,this)},fetch:function(){var e;(e=this.get("xhr"))&&e.abort();var i=this.getAjaxData(),n=this.$list("choices");1==i.paged&&n.html("");var a=t('<li><i class="acf-loading"></i> '+acf.__("Loading")+"</li>");n.append(a),this.set("loading",!0);var r=function(){this.set("loading",!1),a.remove()},o=function(e){if(!e||!e.results||!e.results.length)return this.set("more",!1),void(1==this.get("paged")&&this.$list("choices").append("<li>"+acf.__("No matches found")+"</li>"));this.set("more",e.more);var i=this.walkChoices(e.results),a=t(i),r=this.val();r&&r.length&&r.map(function(t){a.find('.acf-rel-item[data-id="'+t+'"]').addClass("disabled")}),n.append(a);var o=!1,s=!1;n.find(".acf-rel-label").each(function(){var e=t(this),i=e.siblings("ul");if(o&&o.text()==e.text())return s.append(i.children()),void t(this).parent().remove();o=e,s=i})},e=t.ajax({url:acf.get("ajaxurl"),dataType:"json",type:"post",data:acf.prepareForAjax(i),context:this,success:o,complete:r});this.set("xhr",e)},walkChoices:function(e){var i=function(e){var n="";return t.isArray(e)?e.map(function(t){n+=i(t)}):t.isPlainObject(e)&&(void 0!==e.children?(n+='<li><span class="acf-rel-label">'+e.text+'</span><ul class="acf-bl">',n+=i(e.children),n+="</ul></li>"):n+='<li><span class="acf-rel-item" data-id="'+e.id+'">'+e.text+"</span></li>"),n};return i(e)}});acf.registerFieldType(i)}(jQuery),function(t,e){var i=acf.Field.extend({type:"select",select2:!1,wait:"load",events:{removeField:"onRemove"},$input:function(){return this.$("select")},initialize:function(){var t=this.$input();if(this.inherit(t),this.get("ui")){var e=this.get("ajax_action");e||(e="acf/fields/"+this.get("type")+"/query"),this.select2=acf.newSelect2(t,{field:this,ajax:this.get("ajax"),multiple:this.get("multiple"),placeholder:this.get("placeholder"),allowNull:this.get("allow_null"),ajaxAction:e})}},onRemove:function(){this.select2&&this.select2.destroy()}});acf.registerFieldType(i)}(jQuery),function(t,e){var i="tab",n=acf.Field.extend({type:"tab",wait:"",tabs:!1,tab:!1,findFields:function(){return this.$el.nextUntil(".acf-field-tab",".acf-field")},getFields:function(){return acf.getFields(this.findFields())},findTabs:function(){return this.$el.prevAll(".acf-tab-wrap:first")},findTab:function(){return this.$(".acf-tab-button")},initialize:function(){if(this.$el.is("td"))return this.events={},!1;var t=this.findTabs(),e=this.findTab(),i=acf.parseArgs(e.data(),{endpoint:!1,placement:"",before:this.$el});!t.length||i.endpoint?this.tabs=new r(i):this.tabs=t.data("acf"),this.tab=this.tabs.addTab(e,this)},isActive:function(){return this.tab.isActive()},showFields:function(){this.getFields().map(function(t){t.show(this.cid,"tab"),t.hiddenByTab=!1},this)},hideFields:function(){this.getFields().map(function(t){t.hide(this.cid,"tab"),t.hiddenByTab=this.tab},this)},show:function(t){var e=acf.Field.prototype.show.apply(this,arguments);return e&&(this.tab.show(),this.tabs.refresh()),e},hide:function(t){var e=acf.Field.prototype.hide.apply(this,arguments);return e&&(this.tab.hide(),this.isActive()&&this.tabs.reset()),e},enable:function(t){this.getFields().map(function(t){t.enable("tab")})},disable:function(t){this.getFields().map(function(t){t.disable("tab")})}});acf.registerFieldType(n);var a=0,r=acf.Model.extend({tabs:[],active:!1,actions:{refresh:"onRefresh"},data:{before:!1,placement:"top",index:0,initialized:!1},setup:function(e){t.extend(this.data,e),this.tabs=[],this.active=!1;var i=this.get("placement"),n=this.get("before"),r=n.parent();"left"==i&&r.hasClass("acf-fields")&&r.addClass("-sidebar"),n.is("tr")?this.$el=t('<tr class="acf-tab-wrap"><td colspan="2"><ul class="acf-hl acf-tab-group"></ul></td></tr>'):this.$el=t('<div class="acf-tab-wrap -'+i+'"><ul class="acf-hl acf-tab-group"></ul></div>'),n.before(this.$el),this.set("index",a,!0),a++},initializeTabs:function(){var t=this.getVisible().shift(),e,i,n=(acf.getPreference("this.tabs")||[])[this.get("index")];this.tabs[n]&&this.tabs[n].isVisible()&&(t=this.tabs[n]),t?this.selectTab(t):this.closeTabs(),this.set("initialized",!0)},getVisible:function(){return this.tabs.filter(function(t){return t.isVisible()})},getActive:function(){return this.active},setActive:function(t){return this.active=t},hasActive:function(){return!1!==this.active},isActive:function(t){var e=this.getActive();return e&&e.cid===t.cid},closeActive:function(){this.hasActive()&&this.closeTab(this.getActive())},openTab:function(t){this.closeActive(),t.open(),this.setActive(t)},closeTab:function(t){t.close(),this.setActive(!1)},closeTabs:function(){this.tabs.map(this.closeTab,this)},selectTab:function(t){this.tabs.map(function(e){t.cid!==e.cid&&this.closeTab(e)},this),this.openTab(t)},addTab:function(e,i){var n=t("<li></li>");n.append(e),this.$("ul").append(n);var a=new o({$el:n,field:i,group:this});return this.tabs.push(a),a},reset:function(){return this.closeActive(),this.refresh()},refresh:function(){if(this.hasActive())return!1;var t=this.getVisible().shift();return t&&this.openTab(t),t},onRefresh:function(){if("left"===this.get("placement")){var t=this.$el.parent(),e=this.$el.children("ul"),i=t.is("td")?"height":"min-height",n=e.position().top+e.outerHeight(!0)-1;t.css(i,n)}}}),o=acf.Model.extend({group:!1,field:!1,events:{"click a":"onClick"},index:function(){return this.$el.index()},isVisible:function(){return acf.isVisible(this.$el)},isActive:function(){return this.$el.hasClass("active")},open:function(){this.$el.addClass("active"),this.field.showFields()},close:function(){this.$el.removeClass("active"),this.field.hideFields()},onClick:function(t,e){t.preventDefault(),this.toggle()},toggle:function(){this.isActive()||this.group.openTab(this)}}),s=new acf.Model({priority:50,actions:{prepare:"render",append:"render",unload:"onUnload",invalid_field:"onInvalidField"},findTabs:function(){return t(".acf-tab-wrap")},getTabs:function(){return acf.getInstances(this.findTabs())},render:function(t){this.getTabs().map(function(t){t.get("initialized")||t.initializeTabs()})},onInvalidField:function(t){this.busy||t.hiddenByTab&&(t.hiddenByTab.toggle(),this.busy=!0,this.setTimeout(function(){this.busy=!1},100))},onUnload:function(){var t=[];this.getTabs().map(function(e){var i=e.hasActive()?e.getActive().index():0;t.push(i)}),t.length&&acf.setPreference("this.tabs",t)}})}(jQuery),function(t,e){var i=acf.models.SelectField.extend({type:"post_object"});acf.registerFieldType(i)}(jQuery),function(t,e){var i=acf.models.SelectField.extend({type:"page_link"});acf.registerFieldType(i)}(jQuery),function(t,e){var i=acf.models.SelectField.extend({type:"user"});acf.registerFieldType(i)}(jQuery),function(t,e){var i=acf.Field.extend({type:"taxonomy",data:{ftype:"select"},select2:!1,wait:"load",events:{'click a[data-name="add"]':"onClickAdd",'click input[type="radio"]':"onClickRadio"},$control:function(){return this.$(".acf-taxonomy-field")},$input:function(){return this.getRelatedPrototype().$input.apply(this,arguments)},getRelatedType:function(){var t=this.get("ftype");return"multi_select"==t&&(t="select"),t},getRelatedPrototype:function(){return acf.getFieldType(this.getRelatedType()).prototype},getValue:function(){return this.getRelatedPrototype().getValue.apply(this,arguments)},setValue:function(){return this.getRelatedPrototype().setValue.apply(this,arguments)},initialize:function(){this.getRelatedPrototype().initialize.apply(this,arguments)},onRemove:function(){this.select2&&this.select2.destroy()},onClickAdd:function(e,i){var n=this,a=!1,r=!1,o=!1,s=!1,c=!1,l=!1,u=!1,d=function(){a=acf.newPopup({title:i.attr("title"),loading:!0,width:"300px"});var e={action:"acf/fields/taxonomy/add_term",field_key:n.get("key")};t.ajax({url:acf.get("ajaxurl"),data:acf.prepareForAjax(e),type:"post",dataType:"html",success:f})},f=function(t){a.loading(!1),a.content(t),r=a.$("form"),o=a.$('input[name="term_name"]'),s=a.$('select[name="term_parent"]'),c=a.$(".acf-submit-button"),o.focus(),a.on("submit","form",h)},h=function(e,i){if(e.preventDefault(),e.stopImmediatePropagation(),""===o.val())return o.focus(),!1;acf.startButtonLoading(c);var a={action:"acf/fields/taxonomy/add_term",field_key:n.get("key"),term_name:o.val(),term_parent:s.length?s.val():0};t.ajax({url:acf.get("ajaxurl"),data:acf.prepareForAjax(a),type:"post",dataType:"json",success:p})},p=function(t){acf.stopButtonLoading(c),u&&u.remove(),acf.isAjaxSuccess(t)?(o.val(""),g(t.data),u=acf.newNotice({type:"success",text:acf.getAjaxMessage(t),
|
3 |
-
target:r,timeout:2e3,dismiss:!1})):u=acf.newNotice({type:"error",text:acf.getAjaxError(t),target:r,timeout:2e3,dismiss:!1}),o.focus()},g=function(e){var i=t('<option value="'+e.term_id+'">'+e.term_label+"</option>"),a;e.term_parent?s.children('option[value="'+e.term_parent+'"]').after(i):s.append(i),acf.getFields({type:"taxonomy"}).map(function(t){t.get("taxonomy")==n.get("taxonomy")&&t.appendTerm(e)}),n.selectTerm(e.term_id)};d()},appendTerm:function(t){"select"==this.getRelatedType()?this.appendTermSelect(t):this.appendTermCheckbox(t)},appendTermSelect:function(t){this.select2.addOption({id:t.term_id,text:t.term_label})},appendTermCheckbox:function(e){var i=this.$("[name]:first").attr("name"),n=this.$("ul:first");"checkbox"==this.getRelatedType()&&(i+="[]");var a=t(['<li data-id="'+e.term_id+'">',"<label>",'<input type="'+this.get("ftype")+'" value="'+e.term_id+'" name="'+i+'" /> ',"<span>"+e.term_name+"</span>","</label>","</li>"].join(""));if(e.term_parent){var r=n.find('li[data-id="'+e.term_parent+'"]');(n=r.children("ul")).exists()||(n=t('<ul class="children acf-bl"></ul>'),r.append(n))}n.append(a)},selectTerm:function(t){var e;"select"==this.getRelatedType()?this.select2.selectOption(t):this.$('input[value="'+t+'"]').prop("checked",!0).trigger("change")},onClickRadio:function(t,e){var i=e.parent("label"),n=i.hasClass("selected");this.$(".selected").removeClass("selected"),i.addClass("selected"),this.get("allow_null")&&n&&(i.removeClass("selected"),e.prop("checked",!1).trigger("change"))}});acf.registerFieldType(i)}(jQuery),function(t,e){var i=acf.models.DatePickerField.extend({type:"time_picker",$control:function(){return this.$(".acf-time-picker")},initialize:function(){var t=this.$input(),e=this.$inputText(),i={timeFormat:this.get("time_format"),altField:t,altFieldTimeOnly:!1,altTimeFormat:"HH:mm:ss",showButtonPanel:!0,controlType:"select",oneLine:!0,closeText:acf.get("dateTimePickerL10n").selectText,timeOnly:!0,onClose:function(t,e,i){var n=e.dpDiv.find(".ui-datepicker-close");!t&&n.is(":hover")&&i._updateDateTime()}};i=acf.applyFilters("time_picker_args",i,this),acf.newTimePicker(e,i),acf.doAction("time_picker_init",e,i,this)}});acf.registerFieldType(i),acf.newTimePicker=function(e,i){if(void 0===t.timepicker)return!1;i=i||{},e.timepicker(i),t("body > #ui-datepicker-div").exists()&&t("body > #ui-datepicker-div").wrap('<div class="acf-ui-datepicker" />')}}(jQuery),function(t,e){var i=acf.Field.extend({type:"true_false",events:{"change .acf-switch-input":"onChange","focus .acf-switch-input":"onFocus","blur .acf-switch-input":"onBlur","keypress .acf-switch-input":"onKeypress"},$input:function(){return this.$('input[type="checkbox"]')},$switch:function(){return this.$(".acf-switch")},getValue:function(){return this.$input().prop("checked")?1:0},initialize:function(){this.render()},render:function(){var t=this.$switch();if(t.length){var e=t.children(".acf-switch-on"),i=t.children(".acf-switch-off"),n=Math.max(e.width(),i.width());n&&(e.css("min-width",n),i.css("min-width",n))}},switchOn:function(){this.$input().prop("checked",!0),this.$switch().addClass("-on")},switchOff:function(){this.$input().prop("checked",!1),this.$switch().removeClass("-on")},onChange:function(t,e){e.prop("checked")?this.switchOn():this.switchOff()},onFocus:function(t,e){this.$switch().addClass("-focus")},onBlur:function(t,e){this.$switch().removeClass("-focus")},onKeypress:function(t,e){return 37===t.keyCode?this.switchOff():39===t.keyCode?this.switchOn():void 0}});acf.registerFieldType(i)}(jQuery),function(t,e){var i=acf.Field.extend({type:"url",events:{'keyup input[type="url"]':"onkeyup"},$control:function(){return this.$(".acf-input-wrap")},$input:function(){return this.$('input[type="url"]')},initialize:function(){this.render()},isValid:function(){var t=this.val();return!!t&&(-1!==t.indexOf("://")||0===t.indexOf("//"))},render:function(){this.isValid()?this.$control().addClass("-valid"):this.$control().removeClass("-valid")},onkeyup:function(t,e){this.render()}});acf.registerFieldType(i)}(jQuery),function(t,e){var i=acf.Field.extend({type:"wysiwyg",wait:"load",events:{"mousedown .acf-editor-wrap.delay":"onMousedown",unmountField:"disableEditor",remountField:"enableEditor",removeField:"disableEditor"},$control:function(){return this.$(".acf-editor-wrap")},$input:function(){return this.$("textarea")},getMode:function(){return this.$control().hasClass("tmce-active")?"visual":"text"},initialize:function(){this.$control().hasClass("delay")||this.initializeEditor()},initializeEditor:function(){var t=this.$control(),e=this.$input(),i={tinymce:!0,quicktags:!0,toolbar:this.get("toolbar"),mode:this.getMode(),field:this},n=e.attr("id"),a=acf.uniqueId("acf-editor-"),r=e.data();acf.rename({target:t,search:n,replace:a,destructive:!0}),this.set("id",a,!0),acf.tinymce.initialize(a,i),this.$input().data(r)},onMousedown:function(t){t.preventDefault();var e=this.$control();e.removeClass("delay"),e.find(".acf-editor-toolbar").remove(),this.initializeEditor()},enableEditor:function(){"visual"==this.getMode()&&acf.tinymce.enable(this.get("id"))},disableEditor:function(){acf.tinymce.destroy(this.get("id"))}});acf.registerFieldType(i)}(jQuery),function(t,e){var i=[];acf.Condition=acf.Model.extend({type:"",operator:"==",label:"",choiceType:"input",fieldTypes:[],data:{conditions:!1,field:!1,rule:{}},events:{change:"change",keyup:"change",enableField:"change",disableField:"change"},setup:function(e){t.extend(this.data,e)},getEventTarget:function(t,e){return t||this.get("field").$el},change:function(t,e){this.get("conditions").change(t)},match:function(t,e){return!1},calculate:function(){return this.match(this.get("rule"),this.get("field"))},choices:function(t){return'<input type="text" />'}}),acf.newCondition=function(t,e){var i=e.get("field"),n=i.getField(t.field);if(!i||!n)return!1;var a={rule:t,target:i,conditions:e,field:n},r=n.get("type"),o=t.operator,s,c,l;return new(acf.getConditionTypes({fieldType:r,operator:o})[0]||acf.Condition)(a)};var n=function(t){return acf.strPascalCase(t||"")+"Condition"};acf.registerConditionType=function(t){var e,a=t.prototype.type,r=n(a);acf.models[r]=t,i.push(a)},acf.getConditionType=function(t){var e=n(t);return acf.models[e]||!1},acf.registerConditionForFieldType=function(t,e){var i=acf.getConditionType(t);i&&i.prototype.fieldTypes.push(e)},acf.getConditionTypes=function(t){t=acf.parseArgs(t,{fieldType:"",operator:""});var e=[];return i.map(function(i){var n=acf.getConditionType(i),a=n.prototype.fieldTypes,r=n.prototype.operator;t.fieldType&&-1===a.indexOf(t.fieldType)||t.operator&&r!==t.operator||e.push(n)}),e}}(jQuery),function(t,e){var i="conditional_logic",n=new acf.Model({id:"conditionsManager",priority:20,actions:{new_field:"onNewField"},onNewField:function(t){t.has("conditions")&&t.getConditions().render()}}),a=function(t,e){var i=acf.getFields({key:e,sibling:t.$el,suppressFilters:!0});return i.length||(i=acf.getFields({key:e,parent:t.$el.parent(),suppressFilters:!0})),!!i.length&&i[0]};acf.Field.prototype.getField=function(t){var e=a(this,t);if(e)return e;for(var i=this.parents(),n=0;n<i.length;n++)if(e=a(i[n],t))return e;return!1},acf.Field.prototype.getConditions=function(){return this.conditions||(this.conditions=new o(this)),this.conditions};var r=!1,o=acf.Model.extend({id:"Conditions",data:{field:!1,timeStamp:!1,groups:[]},setup:function(t){this.data.field=t;var e=t.get("conditions");e instanceof Array?e[0]instanceof Array?e.map(function(t,e){this.addRules(t,e)},this):this.addRules(e):this.addRule(e)},change:function(t){if(this.get("timeStamp")===t.timeStamp)return!1;this.set("timeStamp",t.timeStamp,!0);var e=this.render()},render:function(){return this.calculate()?this.show():this.hide()},show:function(){return this.get("field").showEnable(this.cid,i)},hide:function(){return this.get("field").hideDisable(this.cid,i)},calculate:function(){var t=!1;return this.getGroups().map(function(e){var i;t||e.filter(function(t){return t.calculate()}).length==e.length&&(t=!0)}),t},hasGroups:function(){return null!=this.data.groups},getGroups:function(){return this.data.groups},addGroup:function(){var t=[];return this.data.groups.push(t),t},hasGroup:function(t){return null!=this.data.groups[t]},getGroup:function(t){return this.data.groups[t]},removeGroup:function(t){return this.data.groups[t].delete,this},addRules:function(t,e){t.map(function(t){this.addRule(t,e)},this)},addRule:function(t,e){var i;e=e||0,i=this.hasGroup(e)?this.getGroup(e):this.addGroup();var n=acf.newCondition(t,this);if(!n)return!1;i.push(n)},hasRule:function(){},getRule:function(t,e){return t=t||0,e=e||0,this.data.groups[e][t]},removeRule:function(){}})}(jQuery),function(t,e){var i=acf.__,n=function(t){return t?""+t:""},a=function(t,e){return n(t).toLowerCase()===n(e).toLowerCase()},r=function(t,e){return parseFloat(t)===parseFloat(e)},o=function(t,e){return parseFloat(t)>parseFloat(e)},s=function(t,e){return parseFloat(t)<parseFloat(e)},c=function(t,e){return(e=e.map(function(t){return n(t)})).indexOf(t)>-1},l=function(t,e){return n(t).indexOf(n(e))>-1},u=function(t,e){var i=new RegExp(n(e),"gi");return n(t).match(i)},d=acf.Condition.extend({type:"hasValue",operator:"!=empty",label:i("Has any value"),fieldTypes:["text","textarea","number","range","email","url","password","image","file","wysiwyg","oembed","select","checkbox","radio","button_group","link","post_object","page_link","relationship","taxonomy","user","google_map","date_picker","date_time_picker","time_picker","color_picker"],match:function(t,e){return!!e.val()},choices:function(t){return'<input type="text" disabled="" />'}});acf.registerConditionType(d);var f=d.extend({type:"hasNoValue",operator:"==empty",label:i("Has no value"),match:function(t,e){return!d.prototype.match.apply(this,arguments)}});acf.registerConditionType(f);var h=acf.Condition.extend({type:"equalTo",operator:"==",label:i("Value is equal to"),fieldTypes:["text","textarea","number","range","email","url","password"],match:function(e,i){return t.isNumeric(e.value)?r(e.value,i.val()):a(e.value,i.val())},choices:function(t){return'<input type="text" />'}});acf.registerConditionType(h);var p=h.extend({type:"notEqualTo",operator:"!=",label:i("Value is not equal to"),match:function(t,e){return!h.prototype.match.apply(this,arguments)}});acf.registerConditionType(p);var g=acf.Condition.extend({type:"patternMatch",operator:"==pattern",label:i("Value matches pattern"),fieldTypes:["text","textarea","email","url","password","wysiwyg"],match:function(t,e){return u(e.val(),t.value)},choices:function(t){return'<input type="text" placeholder="[a-z0-9]" />'}});acf.registerConditionType(g);var m=acf.Condition.extend({type:"contains",operator:"==contains",label:i("Value contains"),fieldTypes:["text","textarea","number","email","url","password","wysiwyg","oembed","select"],match:function(t,e){return l(e.val(),t.value)},choices:function(t){return'<input type="text" />'}});acf.registerConditionType(m);var v=h.extend({type:"trueFalseEqualTo",choiceType:"select",fieldTypes:["true_false"],choices:function(t){return[{id:1,text:i("Checked")}]}});acf.registerConditionType(v);var y=p.extend({type:"trueFalseNotEqualTo",choiceType:"select",fieldTypes:["true_false"],choices:function(t){return[{id:1,text:i("Checked")}]}});acf.registerConditionType(y);var b=acf.Condition.extend({type:"selectEqualTo",operator:"==",label:i("Value is equal to"),fieldTypes:["select","checkbox","radio","button_group"],match:function(t,e){var i=e.val();return i instanceof Array?c(t.value,i):a(t.value,i)},choices:function(e){var n=[],a=e.$setting("choices textarea").val().split("\n");return e.$input("allow_null").prop("checked")&&n.push({id:"",text:i("Null")}),a.map(function(e){(e=e.split(":"))[1]=e[1]||e[0],n.push({id:t.trim(e[0]),text:t.trim(e[1])})}),n}});acf.registerConditionType(b);var x=b.extend({type:"selectNotEqualTo",operator:"!=",label:i("Value is not equal to"),match:function(t,e){return!b.prototype.match.apply(this,arguments)}});acf.registerConditionType(x);var w=acf.Condition.extend({type:"greaterThan",operator:">",label:i("Value is greater than"),fieldTypes:["number","range"],match:function(t,e){var i=e.val();return i instanceof Array&&(i=i.length),o(i,t.value)},choices:function(t){return'<input type="number" />'}});acf.registerConditionType(w);var _=w.extend({type:"lessThan",operator:"<",label:i("Value is less than"),match:function(t,e){var i=e.val();return i instanceof Array&&(i=i.length),s(i,t.value)},choices:function(t){return'<input type="number" />'}});acf.registerConditionType(_);var $=w.extend({type:"selectionGreaterThan",label:i("Selection is greater than"),fieldTypes:["checkbox","select","post_object","page_link","relationship","taxonomy","user"]});acf.registerConditionType($);var k=_.extend({type:"selectionLessThan",label:i("Selection is less than"),fieldTypes:["checkbox","select","post_object","page_link","relationship","taxonomy","user"]});acf.registerConditionType(k)}(jQuery),function(t,e){acf.newMediaPopup=function(t){var e=null,t=acf.parseArgs(t,{mode:"select",title:"",button:"",type:"",field:!1,allowedTypes:"",library:"all",multiple:!1,attachment:0,autoOpen:!0,open:function(){},select:function(){},close:function(){}});return e="edit"==t.mode?new acf.models.EditMediaPopup(t):new acf.models.SelectMediaPopup(t),t.autoOpen&&setTimeout(function(){e.open()},1),acf.doAction("new_media_popup",e),e};var i=function(){var e=acf.get("post_id");return t.isNumeric(e)?e:0};acf.getMimeTypes=function(){return this.get("mimeTypes")},acf.getMimeType=function(t){var e=acf.getMimeTypes();if(void 0!==e[t])return e[t];for(var i in e)if(-1!==i.indexOf(t))return e[i];return!1};var n=acf.Model.extend({id:"MediaPopup",data:{},defaults:{},frame:!1,setup:function(e){t.extend(this.data,e)},initialize:function(){var t=this.getFrameOptions();this.addFrameStates(t);var e=wp.media(t);e.acf=this,this.addFrameEvents(e,t),this.frame=e},open:function(){this.frame.open()},close:function(){this.frame.close()},remove:function(){this.frame.detach(),this.frame.remove()},getFrameOptions:function(){var t={title:this.get("title"),multiple:this.get("multiple"),library:{},states:[]};return this.get("type")&&(t.library.type=this.get("type")),"uploadedTo"===this.get("library")&&(t.library.uploadedTo=i()),this.get("attachment")&&(t.library.post__in=[this.get("attachment")]),this.get("button")&&(t.button={text:this.get("button")}),t},addFrameStates:function(t){var e=wp.media.query(t.library);this.get("field")&&acf.isset(e,"mirroring","args")&&(e.mirroring.args._acfuploader=this.get("field")),t.states.push(new wp.media.controller.Library({library:e,multiple:this.get("multiple"),title:this.get("title"),priority:20,filterable:"all",editable:!0,allowLocalEdits:!0})),acf.isset(wp,"media","controller","EditImage")&&t.states.push(new wp.media.controller.EditImage)},addFrameEvents:function(t,e){t.on("open",function(){this.$el.closest(".media-modal").addClass("acf-media-modal -"+this.acf.get("mode"))},t),t.on("content:render:edit-image",function(){var t=this.state().get("image"),e=new wp.media.view.EditImage({model:t,controller:this}).render();this.content.set(e),e.loadEditor()},t),t.on("select",function(){var e=t.state().get("selection");e&&e.each(function(e,i){t.acf.get("select").apply(t.acf,[e,i])})}),t.on("close",function(){setTimeout(function(){t.acf.get("close").apply(t.acf),t.acf.remove()},1)})}});acf.models.SelectMediaPopup=n.extend({id:"SelectMediaPopup",setup:function(t){t.button||(t.button=acf._x("Select","verb")),n.prototype.setup.apply(this,arguments)},addFrameEvents:function(t,e){acf.isset(_wpPluploadSettings,"defaults","multipart_params")&&(_wpPluploadSettings.defaults.multipart_params._acfuploader=this.get("field"),t.on("open",function(){delete _wpPluploadSettings.defaults.multipart_params._acfuploader})),t.on("content:activate:browse",function(){var e=!1;try{e=t.content.get().toolbar}catch(t){return void console.log(t)}t.acf.customizeFilters.apply(t.acf,[e])}),n.prototype.addFrameEvents.apply(this,arguments)},customizeFilters:function(e){var i=e.get("filters"),n;("image"==this.get("type")&&(i.filters.all.text=acf.__("All images"),delete i.filters.audio,delete i.filters.video,delete i.filters.image,t.each(i.filters,function(t,e){e.props.type=e.props.type||"image"})),this.get("allowedTypes"))&&this.get("allowedTypes").split(" ").join("").split(".").join("").split(",").map(function(t){var e=acf.getMimeType(t);if(e){var n={text:e,props:{status:null,type:e,uploadedTo:null,orderby:"date",order:"DESC"},priority:20};i.filters[e]=n}});if("uploadedTo"===this.get("library")){var a=this.frame.options.library.uploadedTo;delete i.filters.unattached,delete i.filters.uploaded,t.each(i.filters,function(t,e){e.text+=" ("+acf.__("Uploaded to this post")+")",e.props.uploadedTo=a})}var r=this.get("field"),o;t.each(i.filters,function(t,e){e.props._acfuploader=r}),e.get("search").model.attributes._acfuploader=r,i.renderFilters&&i.renderFilters()}}),acf.models.EditMediaPopup=n.extend({id:"SelectMediaPopup",setup:function(t){t.button||(t.button=acf._x("Update","verb")),n.prototype.setup.apply(this,arguments)},addFrameEvents:function(t,e){t.on("open",function(){this.$el.closest(".media-modal").addClass("acf-expanded"),"browse"!=this.content.mode()&&this.content.mode("browse");var e,i=this.state().get("selection"),n=wp.media.attachment(t.acf.get("attachment"));i.add(n)},t),n.prototype.addFrameEvents.apply(this,arguments)}});var a=new acf.Model({id:"customizePrototypes",wait:"ready",initialize:function(){if(acf.isset(window,"wp","media","view")){var t=i();t&&acf.isset(wp,"media","view","settings","post")&&(wp.media.view.settings.post.id=t),this.customizeAttachmentsRouter(),this.customizeAttachmentFilters(),this.customizeAttachmentCompat(),this.customizeAttachmentLibrary()}},customizeAttachmentsRouter:function(){if(acf.isset(wp,"media","view","Router")){var e=wp.media.view.Router;wp.media.view.Router=e.extend({addExpand:function(){var e=t(['<a href="#" class="acf-expand-details">','<span class="is-closed"><span class="acf-icon -left small grey"></span>'+acf.__("Expand Details")+"</span>",'<span class="is-open"><span class="acf-icon -right small grey"></span>'+acf.__("Collapse Details")+"</span>","</a>"].join(""));e.on("click",function(e){e.preventDefault();var i=t(this).closest(".media-modal");i.hasClass("acf-expanded")?i.removeClass("acf-expanded"):i.addClass("acf-expanded")}),this.$el.append(e)},initialize:function(){return e.prototype.initialize.apply(this,arguments),this.addExpand(),this}})}},customizeAttachmentFilters:function(){var e;acf.isset(wp,"media","view","AttachmentFilters","All")&&(wp.media.view.AttachmentFilters.All.prototype.renderFilters=function(){this.$el.html(_.chain(this.filters).map(function(e,i){return{el:t("<option></option>").val(i).html(e.text)[0],priority:e.priority||50}},this).sortBy("priority").pluck("el").value())})},customizeAttachmentCompat:function(){if(acf.isset(wp,"media","view","AttachmentCompat")){var e=wp.media.view.AttachmentCompat,i=!1;wp.media.view.AttachmentCompat=e.extend({render:function(){return this.rendered?this:(e.prototype.render.apply(this,arguments),this.$("#acf-form-data").length?(clearTimeout(i),i=setTimeout(t.proxy(function(){this.rendered=!0,acf.doAction("append",this.$el)},this),50),this):this)},save:function(t){var e={};t&&t.preventDefault(),e=acf.serializeForAjax(this.$el),this.controller.trigger("attachment:compat:waiting",["waiting"]),this.model.saveCompat(e).always(_.bind(this.postSave,this))}})}},customizeAttachmentLibrary:function(){if(acf.isset(wp,"media","view","Attachment","Library")){var t=wp.media.view.Attachment.Library;wp.media.view.Attachment.Library=t.extend({render:function(){var e=acf.isget(this,"controller","acf"),i=acf.isget(this,"model","attributes");if(e&&i){i.acf_errors&&this.$el.addClass("acf-disabled");var n=e.get("selected");n&&n.indexOf(i.id)>-1&&this.$el.addClass("acf-selected")}return t.prototype.render.apply(this,arguments)},toggleSelection:function(e){var i=this.collection,n=this.options.selection,a=this.model,r=n.single(),o=this.controller,s=acf.isget(this,"model","attributes","acf_errors"),c=o.$el.find(".media-frame-content .media-sidebar");if(c.children(".acf-selection-error").remove(),c.children().removeClass("acf-hidden"),o&&s){var l=acf.isget(this,"model","attributes","filename");return c.children().addClass("acf-hidden"),c.prepend(['<div class="acf-selection-error">','<span class="selection-error-label">'+acf.__("Restricted")+"</span>",'<span class="selection-error-filename">'+l+"</span>",'<span class="selection-error-message">'+s+"</span>","</div>"].join("")),n.reset(),void n.single(a)}return t.prototype.toggleSelection.apply(this,arguments)}})}}})}(jQuery),function(t,e){acf.screen=new acf.Model({active:!0,xhr:!1,timeout:!1,wait:"load",events:{"change #page_template":"onChange","change #parent_id":"onChange","change #post-formats-select":"onChange","change .categorychecklist":"onChange","change .tagsdiv":"onChange",'change .acf-taxonomy-field[data-save="1"]':"onChange","change #product-type":"onChange"},isPost:function(){return"post"===acf.get("screen")},isUser:function(){return"user"===acf.get("screen")},isTaxonomy:function(){return"taxonomy"===acf.get("screen")},isAttachment:function(){return"attachment"===acf.get("screen")},isNavMenu:function(){return"nav_menu"===acf.get("screen")},isWidget:function(){return"widget"===acf.get("screen")},isComment:function(){return"comment"===acf.get("screen")},getPageTemplate:function(){var e=t("#page_template");return e.length?e.val():null},getPageParent:function(e,i){var i;return(i=t("#parent_id")).length?i.val():null},getPageType:function(t,e){return this.getPageParent()?"child":"parent"},getPostType:function(){return t("#post_type").val()},getPostFormat:function(e,i){var i;if((i=t("#post-formats-select input:checked")).length){var n=i.val();return"0"==n?"standard":n}return null},getPostCoreTerms:function(){var e={},i=acf.serialize(t(".categorydiv, .tagsdiv"));for(var n in i.tax_input&&(e=i.tax_input),i.post_category&&(e.category=i.post_category),e)acf.isArray(e[n])||(e[n]=e[n].split(", "));return e},getPostTerms:function(){var t=this.getPostCoreTerms();for(var e in acf.getFields({type:"taxonomy"}).map(function(e){if(e.get("save")){var i=e.val(),n=e.get("taxonomy");i&&(t[n]=t[n]||[],i=acf.isArray(i)?i:[i],t[n]=t[n].concat(i))}}),null!==(productType=this.getProductType())&&(t.product_type=[productType]),t)t[e]=acf.uniqueArray(t[e]);return t},getProductType:function(){var e=t("#product-type");return e.length?e.val():null},check:function(){if("post"===acf.get("screen")){this.xhr&&this.xhr.abort();var e=acf.parseArgs(this.data,{action:"acf/ajax/check_screen",screen:acf.get("screen"),exists:[]});this.isPost()&&(e.post_id=acf.get("post_id")),null!==(postType=this.getPostType())&&(e.post_type=postType),null!==(pageTemplate=this.getPageTemplate())&&(e.page_template=pageTemplate),null!==(pageParent=this.getPageParent())&&(e.page_parent=pageParent),null!==(pageType=this.getPageType())&&(e.page_type=pageType),null!==(postFormat=this.getPostFormat())&&(e.post_format=postFormat),null!==(postTerms=this.getPostTerms())&&(e.post_terms=postTerms),acf.getPostboxes().map(function(t){e.exists.push(t.get("key"))}),e=acf.applyFilters("check_screen_args",e);var i=function(t){acf.isAjaxSuccess(t)&&("post"==acf.get("screen")?this.renderPostScreen(t.data):"user"==acf.get("screen")&&this.renderUserScreen(t.data)),acf.doAction("check_screen_complete",t.data,e)};this.xhr=t.ajax({url:acf.get("ajaxurl"),data:acf.prepareForAjax(e),type:"post",dataType:"json",context:this,success:i})}},onChange:function(t,e){this.setTimeout(this.check,1)},renderPostScreen:function(e){var i=[],n=function(e,i){var n=t._data(e[0]).events;for(var a in n)for(var r=0;r<n[a].length;r++)i.on(a,n[a][r].handler)},a=function(e,i){var n=i.indexOf(e);if(-1==n)return!1;for(var a=n-1;a>=0;a--)if(t("#"+i[a]).length)return t("#"+i[a]).after(t("#"+e));for(var a=n+1;a<i.length;a++)if(t("#"+i[a]).length)return t("#"+i[a]).before(t("#"+e));return!1};e.results.map(function(r,o){var s=acf.getPostbox(r.id);if(!s){var c=t(['<div id="'+r.id+'" class="postbox">','<button type="button" class="handlediv" aria-expanded="false">','<span class="screen-reader-text">Toggle panel: '+r.title+"</span>",'<span class="toggle-indicator" aria-hidden="true"></span>',"</button>",'<h2 class="hndle ui-sortable-handle">',"<span>"+r.title+"</span>","</h2>",'<div class="inside">',r.html,"</div>","</div>"].join(""));if(t("#adv-settings").length){var l=t("#adv-settings .metabox-prefs"),u=t(['<label for="'+r.id+'-hide">','<input class="hide-postbox-tog" name="'+r.id+'-hide" type="checkbox" id="'+r.id+'-hide" value="'+r.id+'" checked="checked">'," "+r.title,"</label>"].join(""));n(l.find("input").first(),u.find("input")),l.append(u)}"side"===r.position?t("#"+r.position+"-sortables").append(c):t("#"+r.position+"-sortables").prepend(c);var d=[];if(e.results.map(function(e){r.position===e.position&&t("#"+r.position+"-sortables #"+e.id).length&&d.push(e.id)}),a(r.id,d),e.sorted)for(var f in e.sorted){var d=e.sorted[f].split(",");if(a(r.id,d))break}var h=t("#submitdiv");t("#submitdiv").length&&(n(h.children(".handlediv"),c.children(".handlediv")),n(h.children(".hndle"),c.children(".hndle"))),s=acf.newPostbox(r),acf.doAction("append",c),acf.doAction("append_postbox",s)}s.showEnable(),acf.doAction("show_postbox",s),i.push(r.id)}),acf.getPostboxes().map(function(t){-1===i.indexOf(t.get("id"))&&(t.hideDisable(),acf.doAction("hide_postbox",t))}),t("#acf-style").html(e.style)},renderUserScreen:function(t){}});var i=new acf.Model({wait:"load",initialize:function(){acf.isGutenberg()&&(wp.data.subscribe(this.proxy(this.onChange)),acf.screen.getPageTemplate=this.getPageTemplate,acf.screen.getPageParent=this.getPageParent,acf.screen.getPostType=this.getPostType,acf.screen.getPostFormat=this.getPostFormat,acf.screen.getPostCoreTerms=this.getPostCoreTerms,acf.unload.disable())},onChange:function(){var t=wp.data.select("core/editor").getPostEdits(),e=["template","parent","format"],i;(wp.data.select("core").getTaxonomies()||[]).map(function(t){e.push(t.rest_base)}),(e=e.filter(this.proxy(function(e){return void 0!==t[e]&&t[e]!==this.get(e)}))).length&&this.triggerChange(t)},triggerChange:function(t){void 0!==t&&(this.data=t),acf.screen.check()},getPageTemplate:function(){return wp.data.select("core/editor").getEditedPostAttribute("template")},getPageParent:function(t,e){return wp.data.select("core/editor").getEditedPostAttribute("parent")},getPostType:function(){return wp.data.select("core/editor").getEditedPostAttribute("type")},getPostFormat:function(t,e){return wp.data.select("core/editor").getEditedPostAttribute("format")},getPostCoreTerms:function(){var t={},e;return(wp.data.select("core").getTaxonomies()||[]).map(function(e){var i=wp.data.select("core/editor").getEditedPostAttribute(e.rest_base);i&&(t[e.slug]=i)}),t}});acf.screen.refreshAvailableMetaBoxesPerLocation=function(){var t=wp.data.select("core/edit-post"),e=wp.data.dispatch("core/edit-post"),i={};t.getActiveMetaBoxLocations().map(function(e){i[e]=t.getMetaBoxesPerLocation(e)});var n=[];for(var a in i)n=n.concat(i[a].map(function(t){return t.id}));acf.getPostboxes().map(function(t){if(-1===n.indexOf(t.get("id"))){var e=t.$el.closest("form").attr("class").replace("metabox-location-","");i[e]=i[e]||[],i[e].push({id:t.get("id"),title:t.get("title")})}}),e.setAvailableMetaBoxesPerLocation(i)}}(jQuery),function(t,e){function i(){return acf.isset(window,"jQuery","fn","select2","amd")?4:!!acf.isset(window,"Select2")&&3}acf.newSelect2=function(t,e){if(e=acf.parseArgs(e,{allowNull:!1,placeholder:"",multiple:!1,field:!1,ajax:!1,ajaxAction:"",ajaxData:function(t){return t},ajaxResults:function(t){return t}}),4==i())var n=new a(t,e);else var n=new r(t,e);return acf.doAction("new_select2",n),n};var n=acf.Model.extend({setup:function(e,i){t.extend(this.data,i),this.$el=e},initialize:function(){},selectOption:function(t){var e=this.getOption(t);e.prop("selected")||e.prop("selected",!0).trigger("change")},unselectOption:function(t){var e=this.getOption(t);e.prop("selected")&&e.prop("selected",!1).trigger("change")},getOption:function(t){return this.$('option[value="'+t+'"]')},addOption:function(e){e=acf.parseArgs(e,{id:"",text:"",selected:!1});var i=this.getOption(e.id);return i.length||((i=t("<option></option>")).html(e.text),i.attr("value",e.id),i.prop("selected",e.selected),this.$el.append(i)),i},getValue:function(){var e=[],i=this.$el.find("option:selected");return i.exists()?((i=i.sort(function(t,e){return+t.getAttribute("data-i")-+e.getAttribute("data-i")})).each(function(){var i=t(this);e.push({$el:i,id:i.attr("value"),text:i.text()})}),e):e},mergeOptions:function(){},getChoices:function(){var e=function(i){var n=[];return i.children().each(function(){var i=t(this);i.is("optgroup")?n.push({text:i.attr("label"),children:e(i)}):n.push({id:i.attr("value"),text:i.text()})}),n};return e(this.$el)},decodeChoices:function(t){var e=function(t){return t.map(function(t){return t.text=acf.decode(t.text),t.children&&(t.children=e(t.children)),t}),t};return e(t)},getAjaxData:function(t){var e={action:this.get("ajaxAction"),s:t.term||"",paged:t.page||1},i=this.get("field");i&&(e.field_key=i.get("key"));var n=this.get("ajaxData");return n&&(e=n.apply(this,[e,t])),e=acf.applyFilters("select2_ajax_data",e,this.data,this.$el,i||!1,this),acf.prepareForAjax(e)},getAjaxResults:function(t,e){(t=acf.parseArgs(t,{results:!1,more:!1})).results&&(t.results=this.decodeChoices(t.results));var i=this.get("ajaxResults");return i&&(t=i.apply(this,[t,e])),t=acf.applyFilters("select2_ajax_results",t,e,this)},processAjaxResults:function(e,i){var e;return(e=this.getAjaxResults(e,i)).more&&(e.pagination={more:!0}),setTimeout(t.proxy(this.mergeOptions,this),1),e},destroy:function(){this.$el.data("select2")&&this.$el.select2("destroy"),this.$el.siblings(".select2-container").remove()}}),a=n.extend({initialize:function(){var e=this.$el,i={width:"100%",allowClear:this.get("allowNull"),placeholder:this.get("placeholder"),multiple:this.get("multiple"),data:[],escapeMarkup:function(t){return t}};i.multiple&&this.getValue().map(function(t){t.$el.detach().appendTo(e)}),e.removeData("ajax"),e.removeAttr("data-ajax"),this.get("ajax")&&(i.ajax={url:acf.get("ajaxurl"),delay:250,dataType:"json",type:"post",cache:!1,data:t.proxy(this.getAjaxData,this),processResults:t.proxy(this.processAjaxResults,this)});var n=this.get("field");i=acf.applyFilters("select2_args",i,e,this.data,n||!1,this),e.select2(i);var a=e.next(".select2-container");if(i.multiple){var r=a.find("ul");r.sortable({stop:function(i){r.find(".select2-selection__choice").each(function(){var i;t(t(this).data("data").element).detach().appendTo(e)}),e.trigger("change")}}),e.on("select2:select",this.proxy(function(t){this.getOption(t.params.data.id).detach().appendTo(this.$el)}))}a.addClass("-acf"),acf.doAction("select2_init",e,i,this.data,n||!1,this)},mergeOptions:function(){var e=!1,i=!1;t('.select2-results__option[role="group"]').each(function(){var n=t(this).children("ul"),a=t(this).children("strong");if(i&&i.text()===a.text())return e.append(n.children()),void t(this).remove();e=n,i=a})}}),r=n.extend({initialize:function(){var e=this.$el,i=this.getValue(),n=this.get("multiple"),a={width:"100%",allowClear:this.get("allowNull"),placeholder:this.get("placeholder"),separator:"||",multiple:this.get("multiple"),data:this.getChoices(),escapeMarkup:function(t){return t},dropdownCss:{"z-index":"999999999"},initSelection:function(t,e){e(n?i:i.shift())}},r=e.siblings("input");r.length||(r=t('<input type="hidden" />'),e.before(r)),inputValue=i.map(function(t){return t.id}).join("||"),r.val(inputValue),a.multiple&&i.map(function(t){t.$el.detach().appendTo(e)}),a.allowClear&&(a.data=a.data.filter(function(t){return""!==t.id})),e.removeData("ajax"),e.removeAttr("data-ajax"),this.get("ajax")&&(a.ajax={
|
4 |
-
url:acf.get("ajaxurl"),quietMillis:250,dataType:"json",type:"post",cache:!1,data:t.proxy(this.getAjaxData,this),results:t.proxy(this.processAjaxResults,this)});var o=this.get("field");a=acf.applyFilters("select2_args",a,e,this.data,o||!1,this),r.select2(a);var s=r.select2("container"),c=t.proxy(this.getOption,this);if(a.multiple){var l=s.find("ul");l.sortable({stop:function(){l.find(".select2-search-choice").each(function(){var i=t(this).data("select2Data"),n;c(i.id).detach().appendTo(e)}),e.trigger("change")}})}r.on("select2-selecting",function(i){var n=i.choice,a=c(n.id);a.length||(a=t('<option value="'+n.id+'">'+n.text+"</option>")),a.detach().appendTo(e)}),s.addClass("-acf"),acf.doAction("select2_init",e,a,this.data,o||!1,this),r.on("change",function(){var t=r.val();t.indexOf("||")&&(t=t.split("||")),e.val(t).trigger("change")}),e.hide()},mergeOptions:function(){var e=!1,i=!1;t("#select2-drop .select2-result-with-children").each(function(){var n=t(this).children("ul"),a=t(this).children(".select2-result-label");if(i&&i.text()===a.text())return i.append(n.children()),void t(this).remove();e=n,i=a})},getAjaxData:function(t,e){var i={term:t,page:e};return n.prototype.getAjaxData.apply(this,[i])}}),o=new acf.Model({priority:5,wait:"prepare",initialize:function(){var t=acf.get("locale"),e=acf.get("rtl"),n=acf.get("select2L10n"),a=i();return!!n&&(0!==t.indexOf("en")&&void(4==a?this.addTranslations4():3==a&&this.addTranslations3()))},addTranslations4:function(){var t=acf.get("select2L10n"),e=acf.get("locale");e=e.replace("_","-");var i={errorLoading:function(){return t.load_fail},inputTooLong:function(e){var i=e.input.length-e.maximum;return i>1?t.input_too_long_n.replace("%d",i):t.input_too_long_1},inputTooShort:function(e){var i=e.minimum-e.input.length;return i>1?t.input_too_short_n.replace("%d",i):t.input_too_short_1},loadingMore:function(){return t.load_more},maximumSelected:function(e){var i=e.maximum;return i>1?t.selection_too_long_n.replace("%d",i):t.selection_too_long_1},noResults:function(){return t.matches_0},searching:function(){return t.searching}};jQuery.fn.select2.amd.define("select2/i18n/"+e,[],function(){return i})},addTranslations3:function(){var e=acf.get("select2L10n"),i=acf.get("locale");i=i.replace("_","-");var n={formatMatches:function(t){return t>1?e.matches_n.replace("%d",t):e.matches_1},formatNoMatches:function(){return e.matches_0},formatAjaxError:function(){return e.load_fail},formatInputTooShort:function(t,i){var n=i-t.length;return n>1?e.input_too_short_n.replace("%d",n):e.input_too_short_1},formatInputTooLong:function(t,i){var n=t.length-i;return n>1?e.input_too_long_n.replace("%d",n):e.input_too_long_1},formatSelectionTooBig:function(t){return t>1?e.selection_too_long_n.replace("%d",t):e.selection_too_long_1},formatLoadMore:function(){return e.load_more},formatSearching:function(){return e.searching}};t.fn.select2.locales=t.fn.select2.locales||{},t.fn.select2.locales[i]=n,t.extend(t.fn.select2.defaults,n)}})}(jQuery),function(t,e){acf.tinymce={defaults:function(){return"undefined"!=typeof tinyMCEPreInit&&{tinymce:tinyMCEPreInit.mceInit.acf_content,quicktags:tinyMCEPreInit.qtInit.acf_content};var t},initialize:function(t,e){(e=acf.parseArgs(e,{tinymce:!0,quicktags:!0,toolbar:"full",mode:"visual",field:!1})).tinymce&&this.initializeTinymce(t,e),e.quicktags&&this.initializeQuicktags(t,e)},initializeTinymce:function(e,i){var n=t("#"+e),a=this.defaults(),r=acf.get("toolbars"),o=i.field||!1,s=o.$el||!1;if("undefined"==typeof tinymce)return!1;if(!a)return!1;if(tinymce.get(e))return this.enable(e);var c=t.extend({},a.tinymce,i.tinymce);c.id=e,c.selector="#"+e;var l=i.toolbar;if(l&&r&&r[l])for(var u=1;u<=4;u++)c["toolbar"+u]=r[l][u]||"";if(c.setup=function(t){t.on("change",function(e){t.save(),n.trigger("change")}),t.on("mouseup",function(t){var e=new MouseEvent("mouseup");window.dispatchEvent(e)})},c.wp_autoresize_on=!1,c.wpautop=!0,c=acf.applyFilters("wysiwyg_tinymce_settings",c,e,o),tinyMCEPreInit.mceInit[e]=c,"visual"==i.mode){var d=tinymce.init(c),f=tinymce.get(e);if(!f)return!1;f.acf=i.field,acf.doAction("wysiwyg_tinymce_init",f,f.id,c,o)}},initializeQuicktags:function(e,i){var n=this.defaults();if("undefined"==typeof quicktags)return!1;if(!n)return!1;var a=t.extend({},n.quicktags,i.quicktags);a.id=e;var r=i.field||!1,o=r.$el||!1;a=acf.applyFilters("wysiwyg_quicktags_settings",a,a.id,r),tinyMCEPreInit.qtInit[e]=a;var s=quicktags(a);if(!s)return!1;this.buildQuicktags(s),acf.doAction("wysiwyg_quicktags_init",s,s.id,a,r)},buildQuicktags:function(t){var e,i,n,a,r,t,o,s,c,l,u=",strong,em,link,block,del,ins,img,ul,ol,li,code,more,close,";for(s in e=t.canvas,i=t.name,n=t.settings,r="",a={},c="",l=t.id,n.buttons&&(c=","+n.buttons+","),edButtons)edButtons[s]&&(o=edButtons[s].id,c&&-1!==u.indexOf(","+o+",")&&-1===c.indexOf(","+o+",")||edButtons[s].instance&&edButtons[s].instance!==l||(a[o]=edButtons[s],edButtons[s].html&&(r+=edButtons[s].html(i+"_"))));c&&-1!==c.indexOf(",dfw,")&&(a.dfw=new QTags.DFWButton,r+=a.dfw.html(i+"_")),"rtl"===document.getElementsByTagName("html")[0].dir&&(a.textdirection=new QTags.TextDirectionButton,r+=a.textdirection.html(i+"_")),t.toolbar.innerHTML=r,t.theButtons=a,"undefined"!=typeof jQuery&&jQuery(document).triggerHandler("quicktags-init",[t])},disable:function(t){this.destroyTinymce(t)},remove:function(t){this.destroyTinymce(t)},destroy:function(t){this.destroyTinymce(t)},destroyTinymce:function(t){if("undefined"==typeof tinymce)return!1;var e=tinymce.get(t);return!!e&&(e.save(),e.destroy(),!0)},enable:function(t){this.enableTinymce(t)},enableTinymce:function(t){return"undefined"!=typeof switchEditors&&(void 0!==tinyMCEPreInit.mceInit[t]&&(switchEditors.go(t,"tmce"),!0))}};var i=new acf.Model({priority:5,actions:{prepare:"onPrepare",ready:"onReady"},onPrepare:function(){var e=t("#acf-hidden-wp-editor");e.exists()&&e.appendTo("body")},onReady:function(){acf.isset(window,"wp","oldEditor")&&(wp.editor.autop=wp.oldEditor.autop,wp.editor.removep=wp.oldEditor.removep),acf.isset(window,"tinymce","on")&&tinymce.on("AddEditor",function(t){var e=t.editor;"acf"===e.id.substr(0,3)&&(e=tinymce.editors.content||e,tinymce.activeEditor=e,wpActiveEditor=e.id)})}})}(jQuery),function(t,e){var i=acf.Model.extend({id:"Validator",data:{errors:[],notice:null,status:""},events:{"changed:status":"onChangeStatus"},addErrors:function(t){t.map(this.addError,this)},addError:function(t){this.data.errors.push(t)},hasErrors:function(){return this.data.errors.length},clearErrors:function(){return this.data.errors=[]},getErrors:function(){return this.data.errors},getFieldErrors:function(){var t=[],e=[];return this.getErrors().map(function(i){if(i.input){var n=e.indexOf(i.input);n>-1?t[n]=i:(t.push(i),e.push(i.input))}}),t},getGlobalErrors:function(){return this.getErrors().filter(function(t){return!t.input})},showErrors:function(){if(this.hasErrors()){var e=this.getFieldErrors(),i=this.getGlobalErrors(),n=0,a=!1;e.map(function(t){var e=this.$('[name="'+t.input+'"]').first();if(e.length||(e=this.$('[name^="'+t.input+'"]').first()),e.length){n++;var i=acf.getClosestField(e);i.showError(t.message),a||(a=i.$el)}},this);var r=acf.__("Validation failed");if(i.map(function(t){r+=". "+t.message}),1==n?r+=". "+acf.__("1 field requires attention"):n>1&&(r+=". "+acf.__("%d fields require attention").replace("%d",n)),this.has("notice"))this.get("notice").update({type:"error",text:r});else{var o=acf.newNotice({type:"error",text:r,target:this.$el});this.set("notice",o)}a||(a=this.get("notice").$el),setTimeout(function(){t("html, body").animate({scrollTop:a.offset().top-t(window).height()/2},500)},10)}},onChangeStatus:function(t,e,i,n){this.$el.removeClass("is-"+n).addClass("is-"+i)},validate:function(e){if(e=acf.parseArgs(e,{event:!1,reset:!1,loading:function(){},complete:function(){},failure:function(){},success:function(t){t.submit()}}),"valid"==this.get("status"))return!0;if("validating"==this.get("status"))return!1;if(!this.$(".acf-field").length)return!0;if(e.event){var i=t.Event(null,e.event);e.success=function(){acf.enableSubmit(t(i.target)).trigger(i)}}acf.doAction("validation_begin",this.$el),acf.lockForm(this.$el),e.loading(this.$el,this),this.set("status","validating");var n=function(t){if(acf.isAjaxSuccess(t)){var e=acf.applyFilters("validation_complete",t.data,this.$el,this);e.valid||this.addErrors(e.errors)}},a=function(){acf.unlockForm(this.$el),this.hasErrors()?(this.set("status","invalid"),acf.doAction("validation_failure",this.$el,this),this.showErrors(),e.failure(this.$el,this)):(this.set("status","valid"),this.has("notice")&&this.get("notice").update({type:"success",text:acf.__("Validation successful"),timeout:1e3}),acf.doAction("validation_success",this.$el,this),acf.doAction("submit",this.$el),e.success(this.$el,this),acf.lockForm(this.$el),e.reset&&this.reset()),e.complete(this.$el,this),this.clearErrors()},r=acf.serialize(this.$el);return r.action="acf/validate_save_post",t.ajax({url:acf.get("ajaxurl"),data:acf.prepareForAjax(r),type:"post",dataType:"json",context:this,success:n,complete:a}),!1},setup:function(t){this.$el=t},reset:function(){this.set("errors",[]),this.set("notice",null),this.set("status",""),acf.unlockForm(this.$el)}}),n=function(t){var e=t.data("acf");return e||(e=new i(t)),e};acf.validateForm=function(t){return n(t.form).validate(t)},acf.enableSubmit=function(t){return t.removeClass("disabled")},acf.disableSubmit=function(t){return t.addClass("disabled")},acf.showSpinner=function(t){return t.addClass("is-active"),t.css("display","inline-block"),t},acf.hideSpinner=function(t){return t.removeClass("is-active"),t.css("display","none"),t},acf.lockForm=function(t){var e=a(t),i=e.find('.button, [type="submit"]'),n=e.find(".spinner, .acf-spinner");return acf.hideSpinner(n),acf.disableSubmit(i),acf.showSpinner(n.last()),t},acf.unlockForm=function(t){var e=a(t),i=e.find('.button, [type="submit"]'),n=e.find(".spinner, .acf-spinner");return acf.enableSubmit(i),acf.hideSpinner(n),t};var a=function(t){var e,e,e,e;return(e=t.find("#submitdiv")).length?e:(e=t.find("#submitpost")).length?e:(e=t.find("p.submit").last()).length?e:(e=t.find(".acf-form-submit")).length?e:t};acf.validation=new acf.Model({id:"validation",active:!0,wait:"prepare",actions:{ready:"addInputEvents",append:"addInputEvents"},events:{'click input[type="submit"]':"onClickSubmit",'click button[type="submit"]':"onClickSubmit","click #save-post":"onClickSave","submit form#post":"onSubmitPost","submit form":"onSubmit"},initialize:function(){acf.get("validation")||(this.active=!1,this.actions={},this.events={})},enable:function(){this.active=!0},disable:function(){this.active=!1},reset:function(t){n(t).reset()},addInputEvents:function(e){var i=t(".acf-field [name]",e);i.length&&this.on(i,"invalid","onInvalid")},onInvalid:function(t,e){t.preventDefault();var i=e.closest("form");i.length&&(n(i).addError({input:e.attr("name"),message:t.target.validationMessage}),i.submit())},onClickSubmit:function(t,e){this.set("originalEvent",t)},onClickSave:function(t,e){this.set("ignore",!0)},onClickSubmitGutenberg:function(e,i){var n;acf.validateForm({form:t("#editor"),event:e,reset:!0,failure:function(t,e){var i=e.get("notice").$el;i.appendTo(".components-notice-list"),i.find(".acf-notice-dismiss").removeClass("small")}})||(e.preventDefault(),e.stopImmediatePropagation())},onSubmitPost:function(e,i){"dopreview"===t("input#wp-preview").val()&&(this.set("ignore",!0),acf.unlockForm(i))},onSubmit:function(t,e){if(!this.active||this.get("ignore")||t.isDefaultPrevented())return this.allowSubmit();var i;acf.validateForm({form:e,event:this.get("originalEvent")})||t.preventDefault()},allowSubmit:function(){return this.set("ignore",!1),this.set("originalEvent",!1),!0}})}(jQuery),function(t,e){var i=new acf.Model({priority:90,timeout:0,actions:{new_field:"refresh",show_field:"refresh",hide_field:"refresh",remove_field:"refresh"},refresh:function(){clearTimeout(this.timeout),this.timeout=setTimeout(function(){acf.doAction("refresh")},0)}}),n=new acf.Model({priority:1,actions:{sortstart:"onSortstart",sortstop:"onSortstop"},onSortstart:function(t){acf.doAction("unmount",t)},onSortstop:function(t){acf.doAction("remount",t)}}),a=new acf.Model({actions:{sortstart:"onSortstart"},onSortstart:function(e,i){e.is("tr")&&(i.html('<td style="padding:0;" colspan="'+i.children().length+'"></td>'),e.addClass("acf-sortable-tr-helper"),e.children().each(function(){t(this).width(t(this).width())}),i.height(e.height()+"px"),e.removeClass("acf-sortable-tr-helper"))}}),r=new acf.Model({actions:{after_duplicate:"onAfterDuplicate"},onAfterDuplicate:function(e,i){var n=[];e.find("select").each(function(e){n.push(t(this).val())}),i.find("select").each(function(e){t(this).val(n[e])})}}),o=new acf.Model({id:"tableHelper",priority:20,actions:{refresh:"renderTables"},renderTables:function(e){var i=this;t(".acf-table:visible").each(function(){i.renderTable(t(this))})},renderTable:function(e){var i=e.find("> thead > tr:visible > th[data-key]"),n=e.find("> tbody > tr:visible > td[data-key]");if(!i.length||!n.length)return!1;i.each(function(e){var i=t(this),a=i.data("key"),r=n.filter('[data-key="'+a+'"]'),o=r.filter(".acf-hidden");r.removeClass("acf-empty"),r.length===o.length?acf.hide(i):(acf.show(i),o.addClass("acf-empty"))}),i.css("width","auto"),i=i.not(".acf-hidden");var a=100,r=i.length,o;i.filter("[data-width]").each(function(){var e=t(this).data("width");t(this).css("width",e+"%"),a-=e});var s=i.not("[data-width]");if(s.length){var c=a/s.length;s.css("width",c+"%"),a=0}a>0&&i.last().css("width","auto"),n.filter(".-collapsed-target").each(function(){var e=t(this);e.parent().hasClass("-collapsed")?e.attr("colspan",i.length):e.removeAttr("colspan")})}}),s=new acf.Model({id:"fieldsHelper",priority:30,actions:{refresh:"renderGroups"},renderGroups:function(){var e=this;t(".acf-fields:visible").each(function(){e.renderGroup(t(this))})},renderGroup:function(e){var i=0,n=0,a=t(),r=e.children(".acf-field[data-width]:visible");return!!r.length&&(e.hasClass("-left")?(r.removeAttr("data-width"),r.css("width","auto"),!1):(r.removeClass("-r0 -c0").css({"min-height":0}),r.each(function(e){var r=t(this),o=r.position(),s=Math.ceil(o.top),c=Math.ceil(o.left);a.length&&s>i&&(a.css({"min-height":n+"px"}),o=r.position(),s=Math.ceil(o.top),c=Math.ceil(o.left),i=0,n=0,a=t()),acf.get("rtl")&&(c=Math.ceil(r.parent().width()-(o.left+r.outerWidth()))),0==s?r.addClass("-r0"):0==c&&r.addClass("-c0");var l=Math.ceil(r.outerHeight())+1;n=Math.max(n,l),i=Math.max(i,s),a=a.add(r)}),void(a.length&&a.css({"min-height":n+"px"}))))}})}(jQuery),function(t,e){acf.newCompatibility=function(t,e){return(e=e||{}).__proto__=t.__proto__,t.__proto__=e,t.compatibility=e,e},acf.getCompatibility=function(t){return t.compatibility||null};var i=acf.newCompatibility(acf,{l10n:{},o:{},fields:{},update:acf.set,add_action:acf.addAction,remove_action:acf.removeAction,do_action:acf.doAction,add_filter:acf.addFilter,remove_filter:acf.removeFilter,apply_filters:acf.applyFilters,parse_args:acf.parseArgs,disable_el:acf.disable,disable_form:acf.disable,enable_el:acf.enable,enable_form:acf.enable,update_user_setting:acf.updateUserSetting,prepare_for_ajax:acf.prepareForAjax,is_ajax_success:acf.isAjaxSuccess,remove_el:acf.remove,remove_tr:acf.remove,str_replace:acf.strReplace,render_select:acf.renderSelect,get_uniqid:acf.uniqid,serialize_form:acf.serialize,esc_html:acf.strEscape,str_sanitize:acf.strSanitize});i._e=function(t,e){t=t||"";var i=(e=e||"")?t+"."+e:t,n={"image.select":"Select Image","image.edit":"Edit Image","image.update":"Update Image"};if(n[i])return acf.__(n[i]);var a=this.l10n[t]||"";return e&&(a=a[e]||""),a},i.get_selector=function(e){var i=".acf-field";if(!e)return i;if(t.isPlainObject(e)){if(t.isEmptyObject(e))return i;for(var n in e){e=e[n];break}}return i+="-"+e,i=acf.strReplace("_","-",i),i=acf.strReplace("field-field-","field-",i)},i.get_fields=function(t,e,i){var n={is:t||"",parent:e||!1,suppressFilters:i||!1};return n.is&&(n.is=this.get_selector(n.is)),acf.findFields(n)},i.get_field=function(t,e){var i=this.get_fields.apply(this,arguments);return!!i.length&&i.first()},i.get_closest_field=function(t,e){return t.closest(this.get_selector(e))},i.get_field_wrap=function(t){return t.closest(this.get_selector())},i.get_field_key=function(t){return t.data("key")},i.get_field_type=function(t){return t.data("type")},i.get_data=function(t,e){return acf.parseArgs(t.data(),e)},i.maybe_get=function(t,e,i){void 0===i&&(i=null),keys=String(e).split(".");for(var n=0;n<keys.length;n++){if(!t.hasOwnProperty(keys[n]))return i;t=t[keys[n]]}return t};var n=function(t){return t instanceof acf.Field?t.$el:t},a=function(t){return acf.arrayArgs(t).map(n)},r=function(e){return function(){if(arguments.length)var i=a(arguments);else var i=[t(document)];return e.apply(this,i)}};i.add_action=function(t,e,n,a){var o=t.split(" "),s=o.length;if(s>1){for(var c=0;c<s;c++)t=o[c],i.add_action.apply(this,arguments);return this}var e=r(e);return acf.addAction.apply(this,arguments)},i.add_filter=function(t,e,i,n){var e=r(e);return acf.addFilter.apply(this,arguments)},i.model={actions:{},filters:{},events:{},extend:function(e){var i=t.extend({},this,e);return t.each(i.actions,function(t,e){i._add_action(t,e)}),t.each(i.filters,function(t,e){i._add_filter(t,e)}),t.each(i.events,function(t,e){i._add_event(t,e)}),i},_add_action:function(t,e){var i=this,n=t.split(" "),t=n[0]||"",a=n[1]||10;acf.add_action(t,this[e],a,this)},_add_filter:function(t,e){var i=this,n=t.split(" "),t=n[0]||"",a=n[1]||10;acf.add_filter(t,this[e],a,this)},_add_event:function(e,i){var n=this,a=e.indexOf(" "),r=a>0?e.substr(0,a):e,o=a>0?e.substr(a+1):"",s=function(e){e.$el=t(this),acf.field_group&&(e.$field=e.$el.closest(".acf-field-object")),"function"==typeof n.event&&(e=n.event(e)),n[i].apply(n,arguments)};o?t(document).on(r,o,s):t(document).on(r,s)},get:function(t,e){return e=e||null,void 0!==this[t]&&(e=this[t]),e},set:function(t,e){return this[t]=e,"function"==typeof this["_set_"+t]&&this["_set_"+t].apply(this),this}},i.field=acf.model.extend({type:"",o:{},$field:null,_add_action:function(t,e){var i=this;t=t+"_field/type="+i.type,acf.add_action(t,function(t){i.set("$field",t),i[e].apply(i,arguments)})},_add_filter:function(t,e){var i=this;t=t+"_field/type="+i.type,acf.add_filter(t,function(t){i.set("$field",t),i[e].apply(i,arguments)})},_add_event:function(e,i){var n=this,a=e.substr(0,e.indexOf(" ")),r=e.substr(e.indexOf(" ")+1),o=acf.get_selector(n.type);t(document).on(a,o+" "+r,function(e){var a=t(this),r=acf.get_closest_field(a,n.type);r.length&&(r.is(n.$field)||n.set("$field",r),e.$el=a,e.$field=r,n[i].apply(n,[e]))})},_set_$field:function(){"function"==typeof this.focus&&this.focus()},doFocus:function(t){return this.set("$field",t)}});var o=acf.newCompatibility(acf.validation,{remove_error:function(t){acf.getField(t).removeError()},add_warning:function(t,e){acf.getField(t).showNotice({text:e,type:"warning",timeout:1e3})},fetch:acf.validateForm,enableSubmit:acf.enableSubmit,disableSubmit:acf.disableSubmit,showSpinner:acf.showSpinner,hideSpinner:acf.hideSpinner,unlockForm:acf.unlockForm,lockForm:acf.lockForm});i.tooltip={tooltip:function(t,e){var i;return acf.newTooltip({text:t,target:e}).$el},temp:function(t,e){var i=acf.newTooltip({text:t,target:e,timeout:250})},confirm:function(t,e,i,n,a){var r=acf.newTooltip({confirm:!0,text:i,target:t,confirm:function(){e(!0)},cancel:function(){e(!1)}})},confirm_remove:function(t,e){var i=acf.newTooltip({confirmRemove:!0,target:t,confirm:function(){e(!0)},cancel:function(){e(!1)}})}},i.media=new acf.Model({activeFrame:!1,actions:{new_media_popup:"onNewMediaPopup"},frame:function(){return this.activeFrame},onNewMediaPopup:function(t){this.activeFrame=t.frame},popup:function(t){var e;return t.mime_types&&(t.allowedTypes=t.mime_types),t.id&&(t.attachment=t.id),acf.newMediaPopup(t).frame}}),i.select2={init:function(t,e,i){return e.allow_null&&(e.allowNull=e.allow_null),e.ajax_action&&(e.ajaxAction=e.ajax_action),i&&(e.field=acf.getField(i)),acf.newSelect2(t,e)},destroy:function(t){return acf.getInstance(t).destroy()}},i.postbox={render:function(t){return t.edit_url&&(t.editLink=t.edit_url),t.edit_title&&(t.editTitle=t.edit_title),acf.newPostbox(t)}},acf.newCompatibility(acf.screen,{update:function(){return this.set.apply(this,arguments)},fetch:acf.screen.check}),i.ajax=acf.screen}(jQuery);
|
1 |
+
!function(t,e){var i={};window.acf=i,i.data={},i.get=function(t){return this.data[t]||null},i.has=function(t){return null!==this.get(t)},i.set=function(t,e){return this.data[t]=e,this};var n=0;i.uniqueId=function(t){var e=++n+"";return t?t+e:e},i.uniqueArray=function(t){function e(t,e,i){return i.indexOf(t)===e}return t.filter(e)};var a="";i.uniqid=function(t,e){var i;void 0===t&&(t="");var n=function(t,e){return e<(t=parseInt(t,10).toString(16)).length?t.slice(t.length-e):e>t.length?Array(e-t.length+1).join("0")+t:t};return a||(a=Math.floor(123456789*Math.random())),a++,i=t,i+=n(parseInt((new Date).getTime()/1e3,10),8),i+=n(a,5),e&&(i+=(10*Math.random()).toFixed(8).toString()),i},i.strReplace=function(t,e,i){return i.split(t).join(e)},i.strCamelCase=function(t){return t=(t=t.replace(/[_-]/g," ")).replace(/(?:^\w|\b\w|\s+)/g,function(t,e){return 0==+t?"":0==e?t.toLowerCase():t.toUpperCase()})},i.strPascalCase=function(t){var e=i.strCamelCase(t);return e.charAt(0).toUpperCase()+e.slice(1)},i.strSlugify=function(t){return i.strReplace("_","-",t.toLowerCase())},i.strSanitize=function(t){var e={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","Æ":"AE","Ç":"C","È":"E","É":"E","Ê":"E","Ë":"E","Ì":"I","Í":"I","Î":"I","Ï":"I","Ð":"D","Ñ":"N","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","Ù":"U","Ú":"U","Û":"U","Ü":"U","Ý":"Y","ß":"s","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","æ":"ae","ç":"c","è":"e","é":"e","ê":"e","ë":"e","ì":"i","í":"i","î":"i","ï":"i","ñ":"n","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","ù":"u","ú":"u","û":"u","ü":"u","ý":"y","ÿ":"y","Ā":"A","ā":"a","Ă":"A","ă":"a","Ą":"A","ą":"a","Ć":"C","ć":"c","Ĉ":"C","ĉ":"c","Ċ":"C","ċ":"c","Č":"C","č":"c","Ď":"D","ď":"d","Đ":"D","đ":"d","Ē":"E","ē":"e","Ĕ":"E","ĕ":"e","Ė":"E","ė":"e","Ę":"E","ę":"e","Ě":"E","ě":"e","Ĝ":"G","ĝ":"g","Ğ":"G","ğ":"g","Ġ":"G","ġ":"g","Ģ":"G","ģ":"g","Ĥ":"H","ĥ":"h","Ħ":"H","ħ":"h","Ĩ":"I","ĩ":"i","Ī":"I","ī":"i","Ĭ":"I","ĭ":"i","Į":"I","į":"i","İ":"I","ı":"i","IJ":"IJ","ij":"ij","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","Ĺ":"L","ĺ":"l","Ļ":"L","ļ":"l","Ľ":"L","ľ":"l","Ŀ":"L","ŀ":"l","Ł":"l","ł":"l","Ń":"N","ń":"n","Ņ":"N","ņ":"n","Ň":"N","ň":"n","ʼn":"n","Ō":"O","ō":"o","Ŏ":"O","ŏ":"o","Ő":"O","ő":"o","Œ":"OE","œ":"oe","Ŕ":"R","ŕ":"r","Ŗ":"R","ŗ":"r","Ř":"R","ř":"r","Ś":"S","ś":"s","Ŝ":"S","ŝ":"s","Ş":"S","ş":"s","Š":"S","š":"s","Ţ":"T","ţ":"t","Ť":"T","ť":"t","Ŧ":"T","ŧ":"t","Ũ":"U","ũ":"u","Ū":"U","ū":"u","Ŭ":"U","ŭ":"u","Ů":"U","ů":"u","Ű":"U","ű":"u","Ų":"U","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","ź":"z","Ż":"Z","ż":"z","Ž":"Z","ž":"z","ſ":"s","ƒ":"f","Ơ":"O","ơ":"o","Ư":"U","ư":"u","Ǎ":"A","ǎ":"a","Ǐ":"I","ǐ":"i","Ǒ":"O","ǒ":"o","Ǔ":"U","ǔ":"u","Ǖ":"U","ǖ":"u","Ǘ":"U","ǘ":"u","Ǚ":"U","ǚ":"u","Ǜ":"U","ǜ":"u","Ǻ":"A","ǻ":"a","Ǽ":"AE","ǽ":"ae","Ǿ":"O","ǿ":"o"," ":"_","'":"","?":"","/":"","\\":"",".":"",",":"","`":"",">":"","<":"",'"':"","[":"","]":"","|":"","{":"","}":"","(":"",")":""},i=/\W/g,n=function(t){return void 0!==e[t]?e[t]:t};return t=(t=t.replace(i,n)).toLowerCase()},i.strMatch=function(t,e){for(var i=0,n=Math.min(t.length,e.length),a=0;a<n&&t[a]===e[a];a++)i++;return i},i.decode=function(e){return t("<textarea/>").html(e).text()},i.strEscape=function(e){return t("<div>").text(e).html()},i.parseArgs=function(e,i){return"object"!=typeof e&&(e={}),"object"!=typeof i&&(i={}),t.extend({},i,e)},null==window.acfL10n&&(acfL10n={}),i.__=function(t){return acfL10n[t]||t},i._x=function(t,e){return acfL10n[t+"."+e]||acfL10n[t]||t},i._n=function(t,e,n){return 1==n?i.__(t):i.__(e)},i.isArray=function(t){return Array.isArray(t)},i.isObject=function(t){return"object"==typeof t};var r=function(t,e,n){var a=(e=e.replace("[]","[%%index%%]")).match(/([^\[\]])+/g);if(a)for(var r=a.length,o=t,s=0;s<r;s++){var c=String(a[s]);s==r-1?"%%index%%"===c?o.push(n):o[c]=n:("%%index%%"===a[s+1]?i.isArray(o[c])||(o[c]=[]):i.isObject(o[c])||(o[c]={}),o=o[c])}};i.serialize=function(t,e){var n={},a=i.serializeArray(t);void 0!==e&&(a=a.filter(function(t){return 0===t.name.indexOf(e)}).map(function(t){return t.name=t.name.slice(e.length),t}));for(var o=0;o<a.length;o++)r(n,a[o].name,a[o].value);return n},i.serializeArray=function(t){return t.find("select, textarea, input").serializeArray()},i.serializeForAjax=function(t){var e={},n;return i.serializeArray(t).map(function(t){"[]"===t.name.slice(-2)?(e[t.name]=e[t.name]||[],e[t.name].push(t.value)):e[t.name]=t.value}),e},i.addAction=function(t,e,n,a){return i.hooks.addAction.apply(this,arguments),this},i.removeAction=function(t,e){return i.hooks.removeAction.apply(this,arguments),this};var o={};i.doAction=function(t){return o[t]=1,i.hooks.doAction.apply(this,arguments),o[t]=0,this},i.doingAction=function(t){return 1===o[t]},i.didAction=function(t){return void 0!==o[t]},i.currentAction=function(){for(var t in o)if(o[t])return t;return!1},i.addFilter=function(t){return i.hooks.addFilter.apply(this,arguments),this},i.removeFilter=function(t){return i.hooks.removeFilter.apply(this,arguments),this},i.applyFilters=function(t){return i.hooks.applyFilters.apply(this,arguments)},i.arrayArgs=function(t){return Array.prototype.slice.call(t)};try{var s=JSON.parse(localStorage.getItem("acf"))||{}}catch(t){var s={}}var c=function(t){return"this."===t.substr(0,5)&&(t=t.substr(5)+"-"+i.get("post_id")),t};i.getPreference=function(t){return t=c(t),s[t]||null},i.setPreference=function(t,e){t=c(t),null===e?delete s[t]:s[t]=e,localStorage.setItem("acf",JSON.stringify(s))},i.removePreference=function(t){i.setPreference(t,null)},i.remove=function(t){t instanceof jQuery&&(t={target:t}),t=i.parseArgs(t,{target:!1,endHeight:0,complete:function(){}}),i.doAction("remove",t.target),t.target.is("tr")?u(t):l(t)};var l=function(t){var e=t.target,i=e.height(),n=e.width(),a=e.css("margin"),r=e.outerHeight(!0),o=e.attr("style")+"";e.wrap('<div class="acf-temp-remove" style="height:'+r+'px"></div>');var s=e.parent();e.css({height:i,width:n,margin:a,position:"absolute"}),setTimeout(function(){s.css({opacity:0,height:t.endHeight})},50),setTimeout(function(){e.attr("style",o),s.remove(),t.complete()},301)},u=function(e){var i=e.target,n=i.height(),a=i.children().length,r=t('<td class="acf-temp-remove" style="padding:0; height:'+n+'px" colspan="'+a+'"></td>');i.addClass("acf-remove-element"),setTimeout(function(){i.html(r)},251),setTimeout(function(){i.removeClass("acf-remove-element"),r.css({height:e.endHeight})},300),setTimeout(function(){i.remove(),e.complete()},451)};i.duplicate=function(t){t instanceof jQuery&&(t={target:t});var e=0;(t=i.parseArgs(t,{target:!1,search:"",replace:"",before:function(t){},after:function(t,e){},append:function(t,i){t.after(i),e=1}})).target=t.target||t.$el;var n=t.target;t.search=t.search||n.attr("data-id"),t.replace=t.replace||i.uniqid(),t.before(n),i.doAction("before_duplicate",n);var a=n.clone();return i.rename({target:a,search:t.search,replace:t.replace}),a.removeClass("acf-clone"),a.find(".ui-sortable").removeClass("ui-sortable"),t.after(n,a),i.doAction("after_duplicate",n,a),t.append(n,a),i.doAction("append",a),a},i.rename=function(t){t instanceof jQuery&&(t={target:t});var e=(t=i.parseArgs(t,{target:!1,destructive:!1,search:"",replace:""})).target,n=t.search||e.attr("data-id"),a=t.replace||i.uniqid("acf"),r=function(t,e){return e.replace(n,a)};if(t.destructive){var o=e.outerHTML();o=i.strReplace(n,a,o),e.replaceWith(o)}else e.attr("data-id",a),e.find('[id*="'+n+'"]').attr("id",r),e.find('[for*="'+n+'"]').attr("for",r),e.find('[name*="'+n+'"]').attr("name",r);return e},i.prepareForAjax=function(t){return t.nonce=i.get("nonce"),t.post_id=i.get("post_id"),i.has("language")&&(t.lang=i.get("language")),t=i.applyFilters("prepare_for_ajax",t)},i.startButtonLoading=function(t){t.prop("disabled",!0),t.after(' <i class="acf-loading"></i>')},i.stopButtonLoading=function(t){t.prop("disabled",!1),t.next(".acf-loading").remove()},i.showLoading=function(t){t.append('<div class="acf-loading-overlay"><i class="acf-loading"></i></div>')},i.hideLoading=function(t){t.children(".acf-loading-overlay").remove()},i.updateUserSetting=function(e,n){var a={action:"acf/ajax/user_setting",name:e,value:n};t.ajax({url:i.get("ajaxurl"),data:i.prepareForAjax(a),type:"post",dataType:"html"})},i.val=function(t,e,i){var n=t.val();return e!==n&&(t.val(e),t.is("select")&&null===t.val()?(t.val(n),!1):(!0!==i&&t.trigger("change"),!0))},i.show=function(t,e){return e&&i.unlock(t,"hidden",e),!i.isLocked(t,"hidden")&&(!!t.hasClass("acf-hidden")&&(t.removeClass("acf-hidden"),!0))},i.hide=function(t,e){return e&&i.lock(t,"hidden",e),!t.hasClass("acf-hidden")&&(t.addClass("acf-hidden"),!0)},i.isHidden=function(t){return t.hasClass("acf-hidden")},i.isVisible=function(t){return!i.isHidden(t)};var d=function(t,e){return!t.hasClass("acf-disabled")&&(e&&i.unlock(t,"disabled",e),!i.isLocked(t,"disabled")&&(!!t.prop("disabled")&&(t.prop("disabled",!1),!0)))};i.enable=function(e,i){if(e.attr("name"))return d(e,i);var n=!1;return e.find("[name]").each(function(){var e;d(t(this),i)&&(n=!0)}),n};var f=function(t,e){return e&&i.lock(t,"disabled",e),!t.prop("disabled")&&(t.prop("disabled",!0),!0)};i.disable=function(e,i){if(e.attr("name"))return f(e,i);var n=!1;return e.find("[name]").each(function(){var e;f(t(this),i)&&(n=!0)}),n},i.isset=function(t){for(var e=1;e<arguments.length;e++){if(!t||!t.hasOwnProperty(arguments[e]))return!1;t=t[arguments[e]]}return!0},i.isget=function(t){for(var e=1;e<arguments.length;e++){if(!t||!t.hasOwnProperty(arguments[e]))return null;t=t[arguments[e]]}return t},i.getFileInputData=function(t,e){var n=t.val();if(!n)return!1;var a={url:n},r=i.isget(t[0],"files",0);if(r)if(a.size=r.size,a.type=r.type,r.type.indexOf("image")>-1){var o=window.URL||window.webkitURL,s=new Image;s.onload=function(){a.width=this.width,a.height=this.height,e(a)},s.src=o.createObjectURL(r)}else e(a);else e(a)},i.isAjaxSuccess=function(t){return t&&t.success},i.getAjaxMessage=function(t){return i.isget(t,"data","message")},i.getAjaxError=function(t){return i.isget(t,"data","error")},i.renderSelect=function(t,e){var n=t.val(),a=[],r=function(t){var e="";return t.map(function(t){var n=t.text||t.label||"",o=t.id||t.value||"";a.push(o),t.children?e+='<optgroup label="'+i.strEscape(n)+'">'+r(t.children)+"</optgroup>":e+='<option value="'+o+'"'+(t.disabled?' disabled="disabled"':"")+">"+i.strEscape(n)+"</option>"}),e};return t.html(r(e)),a.indexOf(n)>-1&&t.val(n),t.val()};var h=function(t,e){return t.data("acf-lock-"+e)||[]},p=function(t,e,i){t.data("acf-lock-"+e,i)};i.lock=function(t,e,i){var n=h(t,e),a;n.indexOf(i)<0&&(n.push(i),p(t,e,n))},i.unlock=function(t,e,i){var n=h(t,e),a=n.indexOf(i);return a>-1&&(n.splice(a,1),p(t,e,n)),0===n.length},i.isLocked=function(t,e){return h(t,e).length>0},i.isGutenberg=function(){return window.wp&&wp.data&&wp.data.select&&wp.data.select("core/editor")},i.objectToArray=function(t){return Object.keys(t).map(function(e){return t[e]})},t.fn.exists=function(){return t(this).length>0},t.fn.outerHTML=function(){return t(this).get(0).outerHTML},Array.prototype.indexOf||(Array.prototype.indexOf=function(e){return t.inArray(e,this)}),t(document).ready(function(){i.doAction("ready")}),t(window).on("load",function(){i.doAction("load")}),t(window).on("beforeunload",function(){i.doAction("unload")}),t(window).on("resize",function(){i.doAction("resize")}),t(document).on("sortstart",function(t,e){i.doAction("sortstart",e.item,e.placeholder)}),t(document).on("sortstop",function(t,e){i.doAction("sortstop",e.item,e.placeholder)})}(jQuery),function(t,e){"use strict";var i=function(){function t(){return f}function e(t,e,i,n){return"string"==typeof t&&"function"==typeof e&&c("actions",t,e,i=parseInt(i||10,10),n),d}function i(){var t=Array.prototype.slice.call(arguments),e=t.shift();return"string"==typeof e&&u("actions",e,t),d}function n(t,e){return"string"==typeof t&&s("actions",t,e),d}function a(t,e,i,n){return"string"==typeof t&&"function"==typeof e&&c("filters",t,e,i=parseInt(i||10,10),n),d}function r(){var t=Array.prototype.slice.call(arguments),e=t.shift();return"string"==typeof e?u("filters",e,t):d}function o(t,e){return"string"==typeof t&&s("filters",t,e),d}function s(t,e,i,n){if(f[t][e])if(i){var a=f[t][e],r;if(n)for(r=a.length;r--;){var o=a[r];o.callback===i&&o.context===n&&a.splice(r,1)}else for(r=a.length;r--;)a[r].callback===i&&a.splice(r,1)}else f[t][e]=[]}function c(t,e,i,n,a){var r={callback:i,priority:n,context:a},o=f[t][e];o?(o.push(r),o=l(o)):o=[r],f[t][e]=o}function l(t){for(var e,i,n,a=1,r=t.length;a<r;a++){for(e=t[a],i=a;(n=t[i-1])&&n.priority>e.priority;)t[i]=t[i-1],--i;t[i]=e}return t}function u(t,e,i){var n=f[t][e];if(!n)return"filters"===t&&i[0];var a=0,r=n.length;if("filters"===t)for(;a<r;a++)i[0]=n[a].callback.apply(n[a].context,i);else for(;a<r;a++)n[a].callback.apply(n[a].context,i);return"filters"!==t||i[0]}var d={removeFilter:o,applyFilters:r,addFilter:a,removeAction:n,doAction:i,addAction:e,storage:t},f={actions:{},filters:{}};return d};acf.hooks=new i}(window),function(t,e){var i=/^(\S+)\s*(.*)$/,n=function(e){var i=this,n;return n=e&&e.hasOwnProperty("constructor")?e.constructor:function(){return i.apply(this,arguments)},t.extend(n,i),n.prototype=Object.create(i.prototype),t.extend(n.prototype,e),n.prototype.constructor=n,n},a=acf.Model=function(){this.cid=acf.uniqueId("acf"),this.data=t.extend(!0,{},this.data),this.setup.apply(this,arguments),this.$el&&!this.$el.data("acf")&&this.$el.data("acf",this);var e=function(){this.initialize(),this.addEvents(),this.addActions(),this.addFilters()};this.wait&&!acf.didAction(this.wait)?this.addAction(this.wait,e):e.apply(this)};t.extend(a.prototype,{id:"",cid:"",$el:null,data:{},busy:!1,changed:!1,events:{},actions:{},filters:{},eventScope:"",wait:!1,priority:10,get:function(t){return this.data[t]},has:function(t){return null!=this.get(t)},set:function(t,e,i){var n=this.get(t);return n==e?this:(this.data[t]=e,i||(this.changed=!0,this.trigger("changed:"+t,[e,n]),this.trigger("changed",[t,e,n])),this)},inherit:function(e){return e instanceof jQuery&&(e=e.data()),t.extend(this.data,e),this},prop:function(){return this.$el.prop.apply(this.$el,arguments)},setup:function(e){t.extend(this,e)},initialize:function(){},addElements:function(t){if(!(t=t||this.elements||null)||!Object.keys(t).length)return!1;for(var e in t)this.addElement(e,t[e])},addElement:function(t,e){this["$"+t]=this.$(e)},addEvents:function(t){if(!(t=t||this.events||null))return!1;for(var e in t){var n=e.match(i);this.on(n[1],n[2],t[e])}},removeEvents:function(t){if(!(t=t||this.events||null))return!1;for(var e in t){var n=e.match(i);this.off(n[1],n[2],t[e])}},getEventTarget:function(e,i){return e||this.$el||t(document)},validateEvent:function(e){return!this.eventScope||t(e.target).closest(this.eventScope).is(this.$el)},proxyEvent:function(e){return this.proxy(function(i){if(this.validateEvent(i)){var n,a=acf.arrayArgs(arguments).slice(1),r=[i,t(i.currentTarget)].concat(a);e.apply(this,r)}})},on:function(t,e,i,n){var a,r,o,s,c;t instanceof jQuery?n?(a=t,r=e,o=i,s=n):(a=t,r=e,s=i):i?(r=t,o=e,s=i):(r=t,s=e),a=this.getEventTarget(a),"string"==typeof s&&(s=this.proxyEvent(this[s])),r=r+"."+this.cid,c=o?[r,o,s]:[r,s],a.on.apply(a,c)},off:function(t,e,i){var n,a,r,o;t instanceof jQuery?i?(n=t,a=e,r=i):(n=t,a=e):e?(a=t,r=e):a=t,n=this.getEventTarget(n),a=a+"."+this.cid,o=r?[a,r]:[a],n.off.apply(n,o)},trigger:function(t,e,i){var n=this.getEventTarget();return i?n.trigger.apply(n,arguments):n.triggerHandler.apply(n,arguments),this},addActions:function(t){if(!(t=t||this.actions||null))return!1;for(var e in t)this.addAction(e,t[e])},removeActions:function(t){if(!(t=t||this.actions||null))return!1;for(var e in t)this.removeAction(e,t[e])},addAction:function(t,e,i){i=i||this.priority,"string"==typeof e&&(e=this[e]),acf.addAction(t,e,i,this)},removeAction:function(t,e){acf.removeAction(t,this[e])},addFilters:function(t){if(!(t=t||this.filters||null))return!1;for(var e in t)this.addFilter(e,t[e])},addFilter:function(t,e,i){i=i||this.priority,"string"==typeof e&&(e=this[e]),acf.addFilter(t,e,i,this)},removeFilters:function(t){if(!(t=t||this.filters||null))return!1;for(var e in t)this.removeFilter(e,t[e])},removeFilter:function(t,e){acf.removeFilter(t,this[e])},$:function(t){return this.$el.find(t)},remove:function(){this.removeEvents(),this.removeActions(),this.removeFilters(),this.$el.remove()},setTimeout:function(t,e){return setTimeout(this.proxy(t),e)},time:function(){console.time(this.id||this.cid)},timeEnd:function(){console.timeEnd(this.id||this.cid)},show:function(){acf.show(this.$el)},hide:function(){acf.hide(this.$el)},proxy:function(e){return t.proxy(e,this)}}),a.extend=n,acf.models={},acf.getInstance=function(t){return t.data("acf")},acf.getInstances=function(e){var i=[];return e.each(function(){i.push(acf.getInstance(t(this)))}),i}}(jQuery),function(t,e){acf.models.Popup=acf.Model.extend({data:{title:"",content:"",width:0,height:0,loading:!1},events:{'click [data-event="close"]':"onClickClose","click .acf-close-popup":"onClickClose"},setup:function(e){t.extend(this.data,e),this.$el=t(this.tmpl())},initialize:function(){this.render(),this.open()},tmpl:function(){return['<div id="acf-popup">','<div class="acf-popup-box acf-box">','<div class="title"><h3></h3><a href="#" class="acf-icon -cancel grey" data-event="close"></a></div>','<div class="inner"></div>','<div class="loading"><i class="acf-loading"></i></div>',"</div>",'<div class="bg" data-event="close"></div>',"</div>"].join("")},render:function(){var t=this.get("title"),e=this.get("content"),i=this.get("loading"),n=this.get("width"),a=this.get("height");this.title(t),this.content(e),n&&this.$(".acf-popup-box").css("width",n),a&&this.$(".acf-popup-box").css("min-height",a),this.loading(i),acf.doAction("append",this.$el)},update:function(t){this.data=acf.parseArgs(t,this.data),this.render()},title:function(t){this.$(".title:first h3").html(t)},content:function(t){this.$(".inner:first").html(t)},loading:function(t){var e=this.$(".loading:first");t?e.show():e.hide()},open:function(){t("body").append(this.$el)},close:function(){this.remove()},onClickClose:function(t,e){t.preventDefault(),this.close()}}),acf.newPopup=function(t){return new acf.models.Popup(t)}}(jQuery),function(t,e){acf.unload=new acf.Model({wait:"load",active:!0,changed:!1,actions:{validation_failure:"startListening",validation_success:"stopListening"},events:{"change form .acf-field":"startListening","submit form":"stopListening"},enable:function(){this.active=!0},disable:function(){this.active=!1},reset:function(){this.stopListening()},startListening:function(){!this.changed&&this.active&&(this.changed=!0,t(window).on("beforeunload",this.onUnload))},stopListening:function(){this.changed=!1,t(window).off("beforeunload",this.onUnload)},onUnload:function(){return acf.__("The changes you made will be lost if you navigate away from this page")}})}(jQuery),function(t,e){var i=new acf.Model({events:{"click .acf-panel-title":"onClick"},onClick:function(t,e){t.preventDefault(),this.toggle(e.parent())},isOpen:function(t){return t.hasClass("-open")},toggle:function(t){this.isOpen(t)?this.close(t):this.open(t)},open:function(t){t.addClass("-open"),t.find(".acf-panel-title i").attr("class","dashicons dashicons-arrow-down")},close:function(t){t.removeClass("-open"),t.find(".acf-panel-title i").attr("class","dashicons dashicons-arrow-right")}})}(jQuery),function(t,e){var i=acf.Model.extend({data:{text:"",type:"",timeout:0,dismiss:!0,target:!1,close:function(){}},events:{"click .acf-notice-dismiss":"onClickClose"},tmpl:function(){return'<div class="acf-notice"></div>'},setup:function(e){t.extend(this.data,e),this.$el=t(this.tmpl())},initialize:function(){this.render(),this.show()},render:function(){this.type(this.get("type")),this.html("<p>"+this.get("text")+"</p>"),this.get("dismiss")&&(this.$el.append('<a href="#" class="acf-notice-dismiss acf-icon -cancel small"></a>'),this.$el.addClass("-dismiss"));var t=this.get("timeout");t&&this.away(t)},update:function(e){t.extend(this.data,e),this.initialize(),this.removeEvents(),this.addEvents()},show:function(){var t=this.get("target");t&&t.prepend(this.$el)},hide:function(){this.$el.remove()},away:function(t){this.setTimeout(function(){acf.remove(this.$el)},t)},type:function(t){var e=this.get("type");e&&this.$el.removeClass("-"+e),this.$el.addClass("-"+t),"error"==t&&this.$el.addClass("acf-error-message")},html:function(t){this.$el.html(t)},text:function(t){this.$("p").html(t)},onClickClose:function(t,e){t.preventDefault(),this.get("close").apply(this,arguments),this.remove()}});acf.newNotice=function(t){return"object"!=typeof t&&(t={text:t}),new i(t)};var n=new acf.Model({wait:"prepare",priority:1,initialize:function(){var e=t(".acf-admin-notice");e.length&&t("h1:first").after(e)}})}(jQuery),function(t,e){var i=new acf.Model({wait:"prepare",priority:1,initialize:function(){(acf.get("postboxes")||[]).map(acf.newPostbox)}});acf.getPostbox=function(e){return"string"==typeof e&&(e=t("#"+e)),acf.getInstance(e)},acf.getPostboxes=function(){return acf.getInstances(t(".acf-postbox"))},acf.newPostbox=function(t){return new acf.models.Postbox(t)},acf.models.Postbox=acf.Model.extend({data:{id:"",key:"",style:"default",label:"top",edit:""},setup:function(e){e.editLink&&(e.edit=e.editLink),t.extend(this.data,e),this.$el=this.$postbox()},$postbox:function(){return t("#"+this.get("id"))},$hide:function(){return t("#"+this.get("id")+"-hide")},$hideLabel:function(){return this.$hide().parent()},$hndle:function(){return this.$("> .hndle")},$inside:function(){return this.$("> .inside")},isVisible:function(){return this.$el.hasClass("acf-hidden")},initialize:function(){if(this.$el.addClass("acf-postbox"),this.$el.removeClass("hide-if-js"),"block"!==acf.get("editor")){var t=this.get("style");"default"!==t&&this.$el.addClass(t)}this.$inside().addClass("acf-fields").addClass("-"+this.get("label"));var e=this.get("edit");e&&this.$hndle().append('<a href="'+e+'" class="dashicons dashicons-admin-generic acf-hndle-cog acf-js-tooltip" title="'+acf.__("Edit field group")+'"></a>'),this.show()},show:function(){this.$hideLabel().show(),this.$hide().prop("checked",!0),this.$el.show().removeClass("acf-hidden")},enable:function(){acf.enable(this.$el,"postbox")},showEnable:function(){this.show(),this.enable()},hide:function(){this.$hideLabel().hide(),this.$el.hide().addClass("acf-hidden")},disable:function(){acf.disable(this.$el,"postbox")},hideDisable:function(){this.hide(),this.disable()},html:function(t){this.$inside().html(t),acf.doAction("append",this.$el)}})}(jQuery),function(t,e){acf.newTooltip=function(t){return"object"!=typeof t&&(t={text:t}),void 0!==t.confirmRemove?(t.textConfirm=acf.__("Remove"),t.textCancel=acf.__("Cancel"),new n(t)):void 0!==t.confirm?new n(t):new i(t)};var i=acf.Model.extend({data:{text:"",timeout:0,target:null},tmpl:function(){return'<div class="acf-tooltip"></div>'},setup:function(e){t.extend(this.data,e),this.$el=t(this.tmpl())},initialize:function(){this.render(),this.show(),this.position();var e=this.get("timeout");e&&setTimeout(t.proxy(this.fade,this),e)},update:function(e){t.extend(this.data,e),this.initialize()},render:function(){this.html(this.get("text"))},show:function(){t("body").append(this.$el)},hide:function(){this.$el.remove()},fade:function(){this.$el.addClass("acf-fade-up"),this.setTimeout(function(){this.remove()},250)},html:function(t){this.$el.html(t)},position:function(){var e=this.$el,i=this.get("target");if(i){e.removeClass("right left bottom top").css({top:0,left:0});var n=10,a=i.outerWidth(),r=i.outerHeight(),o=i.offset().top,s=i.offset().left,c=e.outerWidth(),l=e.outerHeight(),u=e.offset().top,d=o-l-u,f=s+a/2-c/2;f<10?(e.addClass("right"),f=s+a,d=o+r/2-l/2-u):f+c+10>t(window).width()?(e.addClass("left"),f=s-c,d=o+r/2-l/2-u):d-t(window).scrollTop()<10?(e.addClass("bottom"),d=o+r-u):e.addClass("top"),e.css({top:d,left:f})}}}),n=i.extend({data:{text:"",textConfirm:"",textCancel:"",target:null,targetConfirm:!0,confirm:function(){},cancel:function(){},context:!1},events:{'click [data-event="cancel"]':"onCancel",'click [data-event="confirm"]':"onConfirm"},addEvents:function(){acf.Model.prototype.addEvents.apply(this);var e=t(document),i=this.get("target");this.setTimeout(function(){this.on(e,"click","onCancel")}),this.get("targetConfirm")&&this.on(i,"click","onConfirm")},removeEvents:function(){acf.Model.prototype.removeEvents.apply(this);var e=t(document),i=this.get("target");this.off(e,"click"),this.off(i,"click")},render:function(){var t,e,i,n=[this.get("text")||acf.__("Are you sure?"),'<a href="#" data-event="confirm">'+(this.get("textConfirm")||acf.__("Yes"))+"</a>",'<a href="#" data-event="cancel">'+(this.get("textCancel")||acf.__("No"))+"</a>"].join(" ");this.html(n),this.$el.addClass("-confirm")},onCancel:function(t,e){t.preventDefault(),t.stopImmediatePropagation();var i=this.get("cancel"),n=this.get("context")||this;i.apply(n,arguments),this.remove()},onConfirm:function(t,e){t.preventDefault(),t.stopImmediatePropagation();var i=this.get("confirm"),n=this.get("context")||this;i.apply(n,arguments),this.remove()}});acf.models.Tooltip=i,acf.models.TooltipConfirm=n;var a=new acf.Model({tooltip:!1,events:{"mouseenter .acf-js-tooltip":"showTitle","mouseup .acf-js-tooltip":"hideTitle","mouseleave .acf-js-tooltip":"hideTitle"},showTitle:function(t,e){var i=e.attr("title");i&&(e.attr("title",""),this.tooltip?this.tooltip.update({text:i,target:e}):this.tooltip=acf.newTooltip({text:i,target:e}))},hideTitle:function(t,e){this.tooltip.hide(),e.attr("title",this.tooltip.get("text"))}})}(jQuery),function(t,e){var i=[];acf.Field=acf.Model.extend({type:"",eventScope:".acf-field",wait:"ready",setup:function(t){this.$el=t,this.inherit(t),this.inherit(this.$control())},val:function(t){return void 0!==t?this.setValue(t):this.prop("disabled")?null:this.getValue()},getValue:function(){return this.$input().val()},setValue:function(t){return acf.val(this.$input(),t)},__:function(t){return acf._e(this.type,t)},$control:function(){return!1},$input:function(){return this.$("[name]:first")},$inputWrap:function(){return this.$(".acf-input:first")},$labelWrap:function(){return this.$(".acf-label:first")},getInputName:function(){return this.$input().attr("name")||""},parent:function(){var t=this.parents();return!!t.length&&t[0]},parents:function(){var t=this.$el.parents(".acf-field"),e;return acf.getFields(t)},show:function(t,e){var i=acf.show(this.$el,t);return i&&(this.prop("hidden",!1),acf.doAction("show_field",this,e)),i},hide:function(t,e){var i=acf.hide(this.$el,t);return i&&(this.prop("hidden",!0),acf.doAction("hide_field",this,e)),i},enable:function(t,e){var i=acf.enable(this.$el,t);return i&&(this.prop("disabled",!1),acf.doAction("enable_field",this,e)),i},disable:function(t,e){var i=acf.disable(this.$el,t);return i&&(this.prop("disabled",!0),acf.doAction("disable_field",this,e)),i},showEnable:function(t,e){return this.enable.apply(this,arguments),this.show.apply(this,arguments)},hideDisable:function(t,e){return this.disable.apply(this,arguments),this.hide.apply(this,arguments)},showNotice:function(t){"object"!=typeof t&&(t={text:t}),this.notice&&this.notice.remove(),t.target=this.$inputWrap(),this.notice=acf.newNotice(t)},removeNotice:function(t){this.notice&&(this.notice.away(t||0),this.notice=!1)},showError:function(e){this.$el.addClass("acf-error"),void 0!==e&&this.showNotice({text:e,type:"error",dismiss:!1}),acf.doAction("invalid_field",this),this.$el.one("focus change","input, select, textarea",t.proxy(this.removeError,this))},removeError:function(){this.$el.removeClass("acf-error"),this.removeNotice(250),acf.doAction("valid_field",this)},trigger:function(t,e,i){return"invalidField"==t&&(i=!0),acf.Model.prototype.trigger.apply(this,[t,e,i])}}),acf.newField=function(t){var e=t.data("type"),i=n(e),a,r=new(acf.models[i]||acf.Field)(t);return acf.doAction("new_field",r),r};var n=function(t){return acf.strPascalCase(t||"")+"Field"};acf.registerFieldType=function(t){var e,a=t.prototype.type,r=n(a);acf.models[r]=t,i.push(a)},acf.getFieldType=function(t){var e=n(t);return acf.models[e]||!1},acf.getFieldTypes=function(t){t=acf.parseArgs(t,{category:""});var e=[];return i.map(function(i){var n=acf.getFieldType(i),a=n.prototype;t.category&&a.category!==t.category||e.push(n)}),e}}(jQuery),function(t,e){acf.findFields=function(e){var i=".acf-field",n=!1;return(e=acf.parseArgs(e,{key:"",name:"",type:"",is:"",parent:!1,sibling:!1,limit:!1,visible:!1,suppressFilters:!1})).suppressFilters||(e=acf.applyFilters("find_fields_args",e)),e.key&&(i+='[data-key="'+e.key+'"]'),e.type&&(i+='[data-type="'+e.type+'"]'),e.name&&(i+='[data-name="'+e.name+'"]'),e.is&&(i+=e.is),e.visible&&(i+=":visible"),n=e.parent?e.parent.find(i):e.sibling?e.sibling.siblings(i):t(i),e.suppressFilters||(n=n.not(".acf-clone .acf-field"),n=acf.applyFilters("find_fields",n)),e.limit&&(n=n.slice(0,e.limit)),n},acf.findField=function(t,e){return acf.findFields({key:t,limit:1,parent:e,suppressFilters:!0})},acf.getField=function(t){t instanceof jQuery||(t=acf.findField(t));var e=t.data("acf");return e||(e=acf.newField(t)),e},acf.getFields=function(e){e instanceof jQuery||(e=acf.findFields(e));var i=[];return e.each(function(){var e=acf.getField(t(this));i.push(e)}),i},acf.findClosestField=function(t){return t.closest(".acf-field")},acf.getClosestField=function(t){var e=acf.findClosestField(t);return this.getField(e)};var i=function(t){var e=t,i=t+"_fields",a=t+"_field",r=function(t){var e,n=acf.arrayArgs(arguments).slice(1),a=acf.getFields({parent:t});if(a.length){var r=[i,a].concat(n);acf.doAction.apply(null,r)}},o=function(t){var e,i=acf.arrayArgs(arguments).slice(1);t.map(function(t,e){var n=[a,t].concat(i);acf.doAction.apply(null,n)})};acf.addAction(e,r),acf.addAction(i,o),n(t)},n=function(t){var e=t+"_field",i=t+"Field",n=function(n){var a=acf.arrayArgs(arguments),r=a.slice(1),s;["type","name","key"].map(function(t){var i="/"+t+"="+n.get(t);a=[e+i,n].concat(r),acf.doAction.apply(null,a)}),o.indexOf(t)>-1&&n.trigger(i,r)};acf.addAction(e,n)},a,r=["valid","invalid","enable","disable","new"],o=["remove","unmount","remount","sortstart","sortstop","show","hide","unload","valid","invalid","enable","disable"];["prepare","ready","load","append","remove","unmount","remount","sortstart","sortstop","show","hide","unload"].map(i),r.map(n);var s=new acf.Model({id:"fieldsEventManager",events:{'click .acf-field a[href="#"]':"onClick","change .acf-field":"onChange"},onClick:function(t){t.preventDefault()},onChange:function(){t("#_acf_changed").val(1)}})}(jQuery),function(t,e){var i=0,n=acf.Field.extend({type:"accordion",wait:"",$control:function(){return this.$(".acf-fields:first")},initialize:function(){if(!this.$el.is("td")){if(this.get("endpoint"))return this.remove();var e=this.$el,n=this.$labelWrap(),r=this.$inputWrap(),o=this.$control(),s=r.children(".description");if(s.length&&n.append(s),this.$el.is("tr")){var c=this.$el.closest("table"),l=t('<div class="acf-accordion-title"/>'),u=t('<div class="acf-accordion-content"/>'),d=t('<table class="'+c.attr("class")+'"/>'),f=t("<tbody/>");l.append(n.html()),d.append(f),u.append(d),r.append(l),r.append(u),n.remove(),o.remove(),r.attr("colspan",2),n=l,r=u,o=f}e.addClass("acf-accordion"),n.addClass("acf-accordion-title"),r.addClass("acf-accordion-content"),i++,this.get("multi_expand")&&e.attr("multi-expand",1);var h=acf.getPreference("this.accordions")||[];void 0!==h[i-1]&&this.set("open",h[i-1]),this.get("open")&&(e.addClass("-open"),r.css("display","block")),n.prepend(a.iconHtml({open:this.get("open")}));var p=e.parent();o.addClass(p.hasClass("-left")?"-left":""),o.addClass(p.hasClass("-clear")?"-clear":""),o.append(e.nextUntil(".acf-field-accordion",".acf-field")),o.removeAttr("data-open data-multi_expand data-endpoint")}}});acf.registerFieldType(n);var a=new acf.Model({actions:{unload:"onUnload"},events:{
|
2 |
+
"click .acf-accordion-title":"onClick","invalidField .acf-accordion":"onInvalidField"},isOpen:function(t){return t.hasClass("-open")},toggle:function(t){this.isOpen(t)?this.close(t):this.open(t)},iconHtml:function(t){var e;return'<i class="acf-accordion-icon dashicons dashicons-'+(t.open?"arrow-down":"arrow-right")+'"></i>'},open:function(e){e.find(".acf-accordion-content:first").slideDown().css("display","block"),e.find(".acf-accordion-icon:first").replaceWith(this.iconHtml({open:!0})),e.addClass("-open"),acf.doAction("show",e),e.attr("multi-expand")||e.siblings(".acf-accordion.-open").each(function(){a.close(t(this))})},close:function(t){t.find(".acf-accordion-content:first").slideUp(),t.find(".acf-accordion-icon:first").replaceWith(this.iconHtml({open:!1})),t.removeClass("-open"),acf.doAction("hide",t)},onClick:function(t,e){t.preventDefault(),this.toggle(e.parent())},onInvalidField:function(t,e){this.busy||(this.busy=!0,this.setTimeout(function(){this.busy=!1},1e3),this.open(e))},onUnload:function(e){var i=[];t(".acf-accordion").each(function(){var e=t(this).hasClass("-open")?1:0;i.push(e)}),i.length&&acf.setPreference("this.accordions",i)}})}(jQuery),function(t,e){var i=acf.Field.extend({type:"button_group",events:{'click input[type="radio"]':"onClick"},$control:function(){return this.$(".acf-button-group")},$input:function(){return this.$("input:checked")},setValue:function(t){this.$('input[value="'+t+'"]').prop("checked",!0).trigger("change")},onClick:function(t,e){var i=e.parent("label"),n=i.hasClass("selected");this.$(".selected").removeClass("selected"),i.addClass("selected"),this.get("allow_null")&&n&&(i.removeClass("selected"),e.prop("checked",!1).trigger("change"))}});acf.registerFieldType(i)}(jQuery),function(t,e){var i=acf.Field.extend({type:"checkbox",events:{"change input":"onChange","click .acf-add-checkbox":"onClickAdd","click .acf-checkbox-toggle":"onClickToggle","click .acf-checkbox-custom":"onClickCustom"},$control:function(){return this.$(".acf-checkbox-list")},$toggle:function(){return this.$(".acf-checkbox-toggle")},$input:function(){return this.$('input[type="hidden"]')},$inputs:function(){return this.$('input[type="checkbox"]').not(".acf-checkbox-toggle")},getValue:function(){var e=[];return this.$(":checked").each(function(){e.push(t(this).val())}),!!e.length&&e},onChange:function(t,e){var i=e.prop("checked"),n=this.$toggle(),a;(i?e.parent().addClass("selected"):e.parent().removeClass("selected"),n.length)&&(0==this.$inputs().not(":checked").length?n.prop("checked",!0):n.prop("checked",!1))},onClickAdd:function(t,e){var i='<li><input class="acf-checkbox-custom" type="checkbox" checked="checked" /><input type="text" name="'+this.getInputName()+'[]" /></li>';e.parent("li").before(i)},onClickToggle:function(t,e){var i=e.prop("checked"),n;this.$inputs().prop("checked",i)},onClickCustom:function(t,e){var i=e.prop("checked"),n=e.next('input[type="text"]');i?n.prop("disabled",!1):(n.prop("disabled",!0),""==n.val()&&e.parent("li").remove())}});acf.registerFieldType(i)}(jQuery),function(t,e){var i=acf.Field.extend({type:"color_picker",wait:"load",$control:function(){return this.$(".acf-color-picker")},$input:function(){return this.$('input[type="hidden"]')},$inputText:function(){return this.$('input[type="text"]')},setValue:function(t){acf.val(this.$input(),t),this.$inputText().iris("color",t)},initialize:function(){var t=this.$input(),e=this.$inputText(),i=function(i){setTimeout(function(){acf.val(t,e.val())},1)},n={defaultColor:!1,palettes:!0,hide:!0,change:i,clear:i},n=acf.applyFilters("color_picker_args",n,this);e.wpColorPicker(n)}});acf.registerFieldType(i)}(jQuery),function(t,e){var i=acf.Field.extend({type:"date_picker",events:{'blur input[type="text"]':"onBlur"},$control:function(){return this.$(".acf-date-picker")},$input:function(){return this.$('input[type="hidden"]')},$inputText:function(){return this.$('input[type="text"]')},initialize:function(){if(this.has("save_format"))return this.initializeCompatibility();var t=this.$input(),e=this.$inputText(),i={dateFormat:this.get("date_format"),altField:t,altFormat:"yymmdd",changeYear:!0,yearRange:"-100:+100",changeMonth:!0,showButtonPanel:!0,firstDay:this.get("first_day")};i=acf.applyFilters("date_picker_args",i,this),acf.newDatePicker(e,i),acf.doAction("date_picker_init",e,i,this)},initializeCompatibility:function(){var t=this.$input(),e=this.$inputText();e.val(t.val());var i={dateFormat:this.get("date_format"),altField:t,altFormat:this.get("save_format"),changeYear:!0,yearRange:"-100:+100",changeMonth:!0,showButtonPanel:!0,firstDay:this.get("first_day")},n=(i=acf.applyFilters("date_picker_args",i,this)).dateFormat;i.dateFormat=this.get("save_format"),acf.newDatePicker(e,i),e.datepicker("option","dateFormat",n),acf.doAction("date_picker_init",e,i,this)},onBlur:function(){this.$inputText().val()||acf.val(this.$input(),"")}});acf.registerFieldType(i);var n=new acf.Model({priority:5,wait:"ready",initialize:function(){var e=acf.get("locale"),i=acf.get("rtl"),n=acf.get("datePickerL10n");return!!n&&(void 0!==t.datepicker&&(n.isRTL=i,t.datepicker.regional[e]=n,void t.datepicker.setDefaults(n)))}});acf.newDatePicker=function(e,i){if(void 0===t.datepicker)return!1;i=i||{},e.datepicker(i),t("body > #ui-datepicker-div").exists()&&t("body > #ui-datepicker-div").wrap('<div class="acf-ui-datepicker" />')}}(jQuery),function(t,e){var i=acf.models.DatePickerField.extend({type:"date_time_picker",$control:function(){return this.$(".acf-date-time-picker")},initialize:function(){var t=this.$input(),e=this.$inputText(),i={dateFormat:this.get("date_format"),timeFormat:this.get("time_format"),altField:t,altFieldTimeOnly:!1,altFormat:"yy-mm-dd",altTimeFormat:"HH:mm:ss",changeYear:!0,yearRange:"-100:+100",changeMonth:!0,showButtonPanel:!0,firstDay:this.get("first_day"),controlType:"select",oneLine:!0};i=acf.applyFilters("date_time_picker_args",i,this),acf.newDateTimePicker(e,i),acf.doAction("date_time_picker_init",e,i,this)}});acf.registerFieldType(i);var n=new acf.Model({priority:5,wait:"ready",initialize:function(){var e=acf.get("locale"),i=acf.get("rtl"),n=acf.get("dateTimePickerL10n");return!!n&&(void 0!==t.timepicker&&(n.isRTL=i,t.timepicker.regional[e]=n,void t.timepicker.setDefaults(n)))}});acf.newDateTimePicker=function(e,i){if(void 0===t.timepicker)return!1;i=i||{},e.datetimepicker(i),t("body > #ui-datepicker-div").exists()&&t("body > #ui-datepicker-div").wrap('<div class="acf-ui-datepicker" />')}}(jQuery),function(t,e){function i(e){if(r)return e();if(acf.isset(window,"google","maps","Geocoder"))return r=new google.maps.Geocoder,e();if(acf.addAction("google_map_api_loaded",e),!a){var i=acf.get("google_map_api");i&&(a=!0,t.ajax({url:i,dataType:"script",cache:!0,success:function(){r=new google.maps.Geocoder,acf.doAction("google_map_api_loaded")}}))}}var n=acf.Field.extend({type:"google_map",map:!1,wait:"load",events:{'click a[data-name="clear"]':"onClickClear",'click a[data-name="locate"]':"onClickLocate",'click a[data-name="search"]':"onClickSearch","keydown .search":"onKeydownSearch","keyup .search":"onKeyupSearch","focus .search":"onFocusSearch","blur .search":"onBlurSearch",showField:"onShow"},$control:function(){return this.$(".acf-google-map")},$input:function(t){return this.$('input[data-name="'+(t||"address")+'"]')},$search:function(){return this.$(".search")},$canvas:function(){return this.$(".canvas")},addClass:function(t){this.$control().addClass(t)},removeClass:function(t){this.$control().removeClass(t)},getValue:function(){var e={lat:"",lng:"",address:""};return this.$('input[type="hidden"]').each(function(){e[t(this).data("name")]=t(this).val()}),e.lat&&e.lng||(e=!1),e},setValue:function(t){for(var e in t=acf.parseArgs(t,{lat:"",lng:"",address:""}))acf.val(this.$input(e),t[e]);t.lat&&t.lng||(t=!1),this.renderVal(t);var i=this.newLatLng(t.lat,t.lng);acf.doAction("google_map_change",i,this.map,this)},renderVal:function(t){t?(this.addClass("-value"),this.setPosition(t.lat,t.lng),this.map.marker.setVisible(!0)):(this.removeClass("-value"),this.map.marker.setVisible(!1)),this.$search().val(t.address)},setPosition:function(t,e){var i=this.newLatLng(t,e);return this.map.marker.setPosition(i),this.map.marker.setVisible(!0),this.center(),this},center:function(){var t=this.map.marker.getPosition(),e=this.get("lat"),i=this.get("lng");t&&(e=t.lat(),i=t.lng());var n=this.newLatLng(e,i);this.map.setCenter(n)},getSearchVal:function(){return this.$search().val()},initialize:function(){i(this.initializeMap.bind(this))},newLatLng:function(t,e){return new google.maps.LatLng(parseFloat(t),parseFloat(e))},initializeMap:function(){var t=this.get("zoom"),e=this.get("lat"),i=this.get("lng"),n={scrollwheel:!1,zoom:parseInt(t),center:this.newLatLng(e,i),mapTypeId:google.maps.MapTypeId.ROADMAP,marker:{draggable:!0,raiseOnDrag:!0},autocomplete:{}};n=acf.applyFilters("google_map_args",n,this);var a=new google.maps.Map(this.$canvas()[0],n),r=acf.parseArgs(n.marker,{draggable:!0,raiseOnDrag:!0,map:a});r=acf.applyFilters("google_map_marker_args",r,this);var o=new google.maps.Marker(r),s=!1;if(acf.isset(google,"maps","places","Autocomplete")){var c=n.autocomplete||{};c=acf.applyFilters("google_map_autocomplete_args",c,this),(s=new google.maps.places.Autocomplete(this.$search()[0],c)).bindTo("bounds",a)}this.addMapEvents(this,a,o,s),a.acf=this,a.marker=o,a.autocomplete=s,this.map=a,acf.doAction("google_map_init",a,o,this);var l=this.getValue();this.renderVal(l)},addMapEvents:function(t,e,i,n){google.maps.event.addListener(e,"click",function(e){var i=e.latLng.lat(),n=e.latLng.lng();t.searchPosition(i,n)}),google.maps.event.addListener(i,"dragend",function(){var e=this.getPosition(),i=e.lat(),n=e.lng();t.searchPosition(i,n)}),n&&google.maps.event.addListener(n,"place_changed",function(){var e=this.getPlace();e.address=t.getSearchVal(),t.setPlace(e)})},searchPosition:function(e,i){var n=this.newLatLng(e,i),a=this.$control();this.setPosition(e,i),a.addClass("-loading");var o=t.proxy(function(t,n){a.removeClass("-loading");var r="";n!=google.maps.GeocoderStatus.OK?console.log("Geocoder failed due to: "+n):t[0]?r=t[0].formatted_address:console.log("No results found"),this.val({lat:e,lng:i,address:r})},this);r.geocode({latLng:n},o)},setPlace:function(t){if(!t)return this;if(t.name&&!t.geometry)return this.searchAddress(t.name),this;var e=t.geometry.location.lat(),i=t.geometry.location.lng(),n=t.address||t.formatted_address;return this.setValue({lat:e,lng:i,address:n}),this},searchAddress:function(e){var i=e.split(",");if(2==i.length){var n=i[0],a=i[1];if(t.isNumeric(n)&&t.isNumeric(a))return this.searchPosition(n,a)}var o=this.$control();o.addClass("-loading");var s=this.proxy(function(t,i){o.removeClass("-loading");var n="",a="";i!=google.maps.GeocoderStatus.OK?console.log("Geocoder failed due to: "+i):t[0]?(n=t[0].geometry.location.lat(),a=t[0].geometry.location.lng()):console.log("No results found"),this.val({lat:n,lng:a,address:e})});r.geocode({address:e},s)},searchLocation:function(){if(!navigator.geolocation)return alert(acf.__("Sorry, this browser does not support geolocation"));var e=this.$control();e.addClass("-loading");var i=t.proxy(function(t,i){e.removeClass("-loading");var n=t.coords.latitude,a=t.coords.longitude;this.searchPosition(n,a)},this),n=function(t){e.removeClass("-loading")};navigator.geolocation.getCurrentPosition(i,n)},onClickClear:function(t,e){this.val(!1)},onClickLocate:function(t,e){this.searchLocation()},onClickSearch:function(t,e){this.searchAddress(this.$search().val())},onFocusSearch:function(t,e){this.removeClass("-value"),this.onKeyupSearch.apply(this,arguments)},onBlurSearch:function(t,e){this.setTimeout(function(){this.removeClass("-search"),e.val()&&this.addClass("-value")},100)},onKeyupSearch:function(t,e){e.val()?this.addClass("-search"):this.removeClass("-search")},onKeydownSearch:function(t,e){13==t.which&&t.preventDefault()},onMousedown:function(){},onShow:function(){if(!this.map)return!1;this.setTimeout(this.center,10)}});acf.registerFieldType(n);var a=!1,r=!1}(jQuery),function(t,e){var i=acf.Field.extend({type:"image",$control:function(){return this.$(".acf-image-uploader")},$input:function(){return this.$('input[type="hidden"]')},events:{'click a[data-name="add"]':"onClickAdd",'click a[data-name="edit"]':"onClickEdit",'click a[data-name="remove"]':"onClickRemove",'change input[type="file"]':"onChange"},initialize:function(){"basic"===this.get("uploader")&&this.$el.closest("form").attr("enctype","multipart/form-data")},validateAttachment:function(t){void 0!==(t=t||{}).id&&(t=t.attributes),t=acf.parseArgs(t,{url:"",alt:"",title:"",caption:"",description:"",width:0,height:0});var e=acf.isget(t,"sizes",this.get("preview_size"),"url");return null!==e&&(t.url=e),t},render:function(t){t=this.validateAttachment(t),this.$("img").attr({src:t.url,alt:t.alt,title:t.title});var e=t.id||"";this.val(e),e?this.$control().addClass("has-value"):this.$control().removeClass("has-value")},append:function(t,e){var i=function(t,e){for(var i=acf.getFields({key:t.get("key"),parent:e.$el}),n=0;n<i.length;n++)if(!i[n].val())return i[n];return!1},n=i(this,e);n||(e.$(".acf-button:last").trigger("click"),n=i(this,e)),n&&n.render(t)},selectAttachment:function(){var e=this.parent(),i=e&&"repeater"===e.get("type"),n=acf.newMediaPopup({mode:"select",type:"image",title:acf.__("Select Image"),field:this.get("key"),multiple:i,library:this.get("library"),allowedTypes:this.get("mime_types"),select:t.proxy(function(t,i){i>0?this.append(t,e):this.render(t)},this)})},editAttachment:function(){var e=this.val();if(e)var i=acf.newMediaPopup({mode:"edit",title:acf.__("Edit Image"),button:acf.__("Update Image"),attachment:e,field:this.get("key"),select:t.proxy(function(t,e){this.render(t)},this)})},removeAttachment:function(){this.render(!1)},onClickAdd:function(t,e){this.selectAttachment()},onClickEdit:function(t,e){this.editAttachment()},onClickRemove:function(t,e){this.removeAttachment()},onChange:function(e,i){var n=this.$input();acf.getFileInputData(i,function(e){n.val(t.param(e))})}});acf.registerFieldType(i)}(jQuery),function(t,e){var i=acf.models.ImageField.extend({type:"file",$control:function(){return this.$(".acf-file-uploader")},$input:function(){return this.$('input[type="hidden"]')},validateAttachment:function(t){return void 0!==(t=t||{}).id&&(t=t.attributes),t=acf.parseArgs(t,{url:"",alt:"",title:"",filename:"",filesizeHumanReadable:"",icon:"/wp-includes/images/media/default.png"})},render:function(t){t=this.validateAttachment(t),this.$("img").attr({src:t.icon,alt:t.alt,title:t.title}),this.$('[data-name="title"]').text(t.title),this.$('[data-name="filename"]').text(t.filename).attr("href",t.url),this.$('[data-name="filesize"]').text(t.filesizeHumanReadable);var e=t.id||"";acf.val(this.$input(),e),e?this.$control().addClass("has-value"):this.$control().removeClass("has-value")},selectAttachment:function(){var e=this.parent(),i=e&&"repeater"===e.get("type"),n=acf.newMediaPopup({mode:"select",title:acf.__("Select File"),field:this.get("key"),multiple:i,library:this.get("library"),allowedTypes:this.get("mime_types"),select:t.proxy(function(t,i){i>0?this.append(t,e):this.render(t)},this)})},editAttachment:function(){var e=this.val();if(!e)return!1;var i=acf.newMediaPopup({mode:"edit",title:acf.__("Edit File"),button:acf.__("Update File"),attachment:e,field:this.get("key"),select:t.proxy(function(t,e){this.render(t)},this)})}});acf.registerFieldType(i)}(jQuery),function(t,e){var i=acf.Field.extend({type:"link",events:{'click a[data-name="add"]':"onClickEdit",'click a[data-name="edit"]':"onClickEdit",'click a[data-name="remove"]':"onClickRemove","change .link-node":"onChange"},$control:function(){return this.$(".acf-link")},$node:function(){return this.$(".link-node")},getValue:function(){var t=this.$node();return!!t.attr("href")&&{title:t.html(),url:t.attr("href"),target:t.attr("target")}},setValue:function(t){t=acf.parseArgs(t,{title:"",url:"",target:""});var e=this.$control(),i=this.$node();e.removeClass("-value -external"),t.url&&e.addClass("-value"),"_blank"===t.target&&e.addClass("-external"),this.$(".link-title").html(t.title),this.$(".link-url").attr("href",t.url).html(t.url),i.html(t.title),i.attr("href",t.url),i.attr("target",t.target),this.$(".input-title").val(t.title),this.$(".input-target").val(t.target),this.$(".input-url").val(t.url).trigger("change")},onClickEdit:function(t,e){acf.wpLink.open(this.$node())},onClickRemove:function(t,e){this.setValue(!1)},onChange:function(t,e){var i=this.getValue();this.setValue(i)}});acf.registerFieldType(i),acf.wpLink=new acf.Model({getNodeValue:function(){var t=this.get("node");return{title:t.html(),url:t.attr("href"),target:t.attr("target")}},setNodeValue:function(t){var e=this.get("node");e.html(t.title),e.attr("href",t.url),e.attr("target",t.target),e.trigger("change")},getInputValue:function(){return{title:t("#wp-link-text").val(),url:t("#wp-link-url").val(),target:t("#wp-link-target").prop("checked")?"_blank":""}},setInputValue:function(e){t("#wp-link-text").val(e.title),t("#wp-link-url").val(e.url),t("#wp-link-target").prop("checked","_blank"===e.target)},open:function(e){this.on("wplink-open","onOpen"),this.on("wplink-close","onClose"),this.set("node",e);var i=t('<textarea id="acf-link-textarea" style="display:none;"></textarea>');t("body").append(i);var n=this.getNodeValue();wpLink.open("acf-link-textarea",n.url,n.title,null)},onOpen:function(){t("#wp-link-wrap").addClass("has-text-field");var e=this.getNodeValue();this.setInputValue(e)},close:function(){wpLink.close()},onClose:function(){if(!this.has("node"))return!1;this.off("wplink-open"),this.off("wplink-close");var e=this.getInputValue();this.setNodeValue(e),t("#acf-link-textarea").remove(),this.set("node",null)}})}(jQuery),function(t,e){var i=acf.Field.extend({type:"oembed",events:{'click [data-name="clear-button"]':"onClickClear","keypress .input-search":"onKeypressSearch","keyup .input-search":"onKeyupSearch","change .input-search":"onChangeSearch"},$control:function(){return this.$(".acf-oembed")},$input:function(){return this.$(".input-value")},$search:function(){return this.$(".input-search")},getValue:function(){return this.$input().val()},getSearchVal:function(){return this.$search().val()},setValue:function(t){t?this.$control().addClass("has-value"):this.$control().removeClass("has-value"),acf.val(this.$input(),t)},showLoading:function(t){acf.showLoading(this.$(".canvas"))},hideLoading:function(){acf.hideLoading(this.$(".canvas"))},maybeSearch:function(){var e=this.val(),i=this.getSearchVal();if(!i)return this.clear();if("http"!=i.substr(0,4)&&(i="http://"+i),i!==e){var n=this.get("timeout");n&&clearTimeout(n);var a=t.proxy(this.search,this,i);this.set("timeout",setTimeout(a,300))}},search:function(e){var i={action:"acf/fields/oembed/search",s:e,field_key:this.get("key")},n;(n=this.get("xhr"))&&n.abort(),this.showLoading();var n=t.ajax({url:acf.get("ajaxurl"),data:acf.prepareForAjax(i),type:"post",dataType:"json",context:this,success:function(t){t&&t.html||(t={url:!1,html:""}),this.val(t.url),this.$(".canvas-media").html(t.html)},complete:function(){this.hideLoading()}});this.set("xhr",n)},clear:function(){this.val(""),this.$search().val(""),this.$(".canvas-media").html("")},onClickClear:function(t,e){this.clear()},onKeypressSearch:function(t,e){13==t.which&&(t.preventDefault(),this.maybeSearch())},onKeyupSearch:function(t,e){e.val()&&this.maybeSearch()},onChangeSearch:function(t,e){this.maybeSearch()}});acf.registerFieldType(i)}(jQuery),function(t,e){var i=acf.Field.extend({type:"radio",events:{'click input[type="radio"]':"onClick"},$control:function(){return this.$(".acf-radio-list")},$input:function(){return this.$("input:checked")},$inputText:function(){return this.$('input[type="text"]')},getValue:function(){var t=this.$input().val();return"other"===t&&this.get("other_choice")&&(t=this.$inputText().val()),t},onClick:function(t,e){var i=e.parent("label"),n=i.hasClass("selected"),a=e.val();this.$(".selected").removeClass("selected"),i.addClass("selected"),this.get("allow_null")&&n&&(i.removeClass("selected"),e.prop("checked",!1).trigger("change"),a=!1),this.get("other_choice")&&("other"===a?this.$inputText().prop("disabled",!1):this.$inputText().prop("disabled",!0))}});acf.registerFieldType(i)}(jQuery),function(t,e){var i=acf.Field.extend({type:"range",events:{'input input[type="range"]':"onChange","change input":"onChange"},$input:function(){return this.$('input[type="range"]')},$inputAlt:function(){return this.$('input[type="number"]')},setValue:function(t){this.busy=!0,acf.val(this.$input(),t),acf.val(this.$inputAlt(),t,!0),this.busy=!1},onChange:function(t,e){this.busy||this.setValue(e.val())}});acf.registerFieldType(i)}(jQuery),function(t,e){var i=acf.Field.extend({type:"relationship",events:{"keypress [data-filter]":"onKeypressFilter","change [data-filter]":"onChangeFilter","keyup [data-filter]":"onChangeFilter","click .choices-list .acf-rel-item":"onClickAdd",'click [data-name="remove_item"]':"onClickRemove",mouseover:"onHover"},$control:function(){return this.$(".acf-relationship")},$list:function(t){return this.$("."+t+"-list")},$listItems:function(t){return this.$list(t).find(".acf-rel-item")},$listItem:function(t,e){return this.$list(t).find('.acf-rel-item[data-id="'+e+'"]')},getValue:function(){var e=[];return this.$listItems("values").each(function(){e.push(t(this).data("id"))}),!!e.length&&e},newChoice:function(t){return["<li>",'<span data-id="'+t.id+'" class="acf-rel-item">'+t.text+"</span>","</li>"].join("")},newValue:function(t){return["<li>",'<input type="hidden" name="'+this.getInputName()+'[]" value="'+t.id+'" />','<span data-id="'+t.id+'" class="acf-rel-item">'+t.text,'<a href="#" class="acf-icon -minus small dark" data-name="remove_item"></a>',"</span>","</li>"].join("")},addSortable:function(t){this.$list("values").sortable({items:"li",forceHelperSize:!0,forcePlaceholderSize:!0,scroll:!0,update:function(){t.$input().trigger("change")}})},initialize:function(){var t=this.proxy(function(t){if(!this.get("loading")&&this.get("more")){var e=this.$list("choices"),i=Math.ceil(e.scrollTop()),n=Math.ceil(e[0].scrollHeight),a=Math.ceil(e.innerHeight()),r=this.get("paged")||1;i+a>=n&&(this.set("paged",r+1),this.fetch())}});this.$list("choices").scrollTop(0).on("scroll",t),this.fetch()},onHover:function(e){t().off(e),this.addSortable(this)},onKeypressFilter:function(t,e){13==t.which&&t.preventDefault()},onChangeFilter:function(t,e){var i=e.val(),n=e.data("filter");this.get(n)!==i&&(this.set(n,i),this.set("paged",1),e.is("select")?this.fetch():this.maybeFetch())},onClickAdd:function(t,e){var i=this.val(),n=parseInt(this.get("max"));if(e.hasClass("disabled"))return!1;if(n>0&&i&&i.length>=n)return this.showNotice({text:acf.__("Maximum values reached ( {max} values )").replace("{max}",n),type:"warning"}),!1;e.addClass("disabled");var a=this.newValue({id:e.data("id"),text:e.html()});this.$list("values").append(a),this.$input().trigger("change")},onClickRemove:function(t,e){t.preventDefault();var i=e.parent(),n=i.parent(),a=i.data("id");n.remove(),this.$listItem("choices",a).removeClass("disabled"),this.$input().trigger("change")},maybeFetch:function(){var t=this.get("timeout");t&&clearTimeout(t),t=this.setTimeout(this.fetch,300),this.set("timeout",t)},getAjaxData:function(){var t=this.$control().data();for(var e in t)t[e]=this.get(e);return t.action="acf/fields/relationship/query",t.field_key=this.get("key"),t=acf.applyFilters("relationship_ajax_data",t,this)},fetch:function(){var e;(e=this.get("xhr"))&&e.abort();var i=this.getAjaxData(),n=this.$list("choices");1==i.paged&&n.html("");var a=t('<li><i class="acf-loading"></i> '+acf.__("Loading")+"</li>");n.append(a),this.set("loading",!0);var r=function(){this.set("loading",!1),a.remove()},o=function(e){if(!e||!e.results||!e.results.length)return this.set("more",!1),void(1==this.get("paged")&&this.$list("choices").append("<li>"+acf.__("No matches found")+"</li>"));this.set("more",e.more);var i=this.walkChoices(e.results),a=t(i),r=this.val();r&&r.length&&r.map(function(t){a.find('.acf-rel-item[data-id="'+t+'"]').addClass("disabled")}),n.append(a);var o=!1,s=!1;n.find(".acf-rel-label").each(function(){var e=t(this),i=e.siblings("ul");if(o&&o.text()==e.text())return s.append(i.children()),void t(this).parent().remove();o=e,s=i})},e=t.ajax({url:acf.get("ajaxurl"),dataType:"json",type:"post",data:acf.prepareForAjax(i),context:this,success:o,complete:r});this.set("xhr",e)},walkChoices:function(e){var i=function(e){var n="";return t.isArray(e)?e.map(function(t){n+=i(t)}):t.isPlainObject(e)&&(void 0!==e.children?(n+='<li><span class="acf-rel-label">'+e.text+'</span><ul class="acf-bl">',n+=i(e.children),n+="</ul></li>"):n+='<li><span class="acf-rel-item" data-id="'+e.id+'">'+e.text+"</span></li>"),n};return i(e)}});acf.registerFieldType(i)}(jQuery),function(t,e){var i=acf.Field.extend({type:"select",select2:!1,wait:"load",events:{removeField:"onRemove"},$input:function(){return this.$("select")},initialize:function(){var t=this.$input();if(this.inherit(t),this.get("ui")){var e=this.get("ajax_action");e||(e="acf/fields/"+this.get("type")+"/query"),this.select2=acf.newSelect2(t,{field:this,ajax:this.get("ajax"),multiple:this.get("multiple"),placeholder:this.get("placeholder"),allowNull:this.get("allow_null"),ajaxAction:e})}},onRemove:function(){this.select2&&this.select2.destroy()}});acf.registerFieldType(i)}(jQuery),function(t,e){var i="tab",n=acf.Field.extend({type:"tab",wait:"",tabs:!1,tab:!1,findFields:function(){return this.$el.nextUntil(".acf-field-tab",".acf-field")},getFields:function(){return acf.getFields(this.findFields())},findTabs:function(){return this.$el.prevAll(".acf-tab-wrap:first")},findTab:function(){return this.$(".acf-tab-button")},initialize:function(){if(this.$el.is("td"))return this.events={},!1;var t=this.findTabs(),e=this.findTab(),i=acf.parseArgs(e.data(),{endpoint:!1,placement:"",before:this.$el});!t.length||i.endpoint?this.tabs=new r(i):this.tabs=t.data("acf"),this.tab=this.tabs.addTab(e,this)},isActive:function(){return this.tab.isActive()},showFields:function(){this.getFields().map(function(t){t.show(this.cid,"tab"),t.hiddenByTab=!1},this)},hideFields:function(){this.getFields().map(function(t){t.hide(this.cid,"tab"),t.hiddenByTab=this.tab},this)},show:function(t){var e=acf.Field.prototype.show.apply(this,arguments);return e&&(this.tab.show(),this.tabs.refresh()),e},hide:function(t){var e=acf.Field.prototype.hide.apply(this,arguments);return e&&(this.tab.hide(),this.isActive()&&this.tabs.reset()),e},enable:function(t){this.getFields().map(function(t){t.enable("tab")})},disable:function(t){this.getFields().map(function(t){t.disable("tab")})}});acf.registerFieldType(n);var a=0,r=acf.Model.extend({tabs:[],active:!1,actions:{refresh:"onRefresh"},data:{before:!1,placement:"top",index:0,initialized:!1},setup:function(e){t.extend(this.data,e),this.tabs=[],this.active=!1;var i=this.get("placement"),n=this.get("before"),r=n.parent();"left"==i&&r.hasClass("acf-fields")&&r.addClass("-sidebar"),n.is("tr")?this.$el=t('<tr class="acf-tab-wrap"><td colspan="2"><ul class="acf-hl acf-tab-group"></ul></td></tr>'):this.$el=t('<div class="acf-tab-wrap -'+i+'"><ul class="acf-hl acf-tab-group"></ul></div>'),n.before(this.$el),this.set("index",a,!0),a++},initializeTabs:function(){var t=this.getVisible().shift(),e,i,n=(acf.getPreference("this.tabs")||[])[this.get("index")];this.tabs[n]&&this.tabs[n].isVisible()&&(t=this.tabs[n]),t?this.selectTab(t):this.closeTabs(),this.set("initialized",!0)},getVisible:function(){return this.tabs.filter(function(t){return t.isVisible()})},getActive:function(){return this.active},setActive:function(t){return this.active=t},hasActive:function(){return!1!==this.active},isActive:function(t){var e=this.getActive();return e&&e.cid===t.cid},closeActive:function(){this.hasActive()&&this.closeTab(this.getActive())},openTab:function(t){this.closeActive(),t.open(),this.setActive(t)},closeTab:function(t){t.close(),this.setActive(!1)},closeTabs:function(){this.tabs.map(this.closeTab,this)},selectTab:function(t){this.tabs.map(function(e){t.cid!==e.cid&&this.closeTab(e)},this),this.openTab(t)},addTab:function(e,i){var n=t("<li></li>");n.append(e),this.$("ul").append(n);var a=new o({$el:n,field:i,group:this});return this.tabs.push(a),a},reset:function(){return this.closeActive(),this.refresh()},refresh:function(){if(this.hasActive())return!1;var t=this.getVisible().shift();return t&&this.openTab(t),t},onRefresh:function(){if("left"===this.get("placement")){var t=this.$el.parent(),e=this.$el.children("ul"),i=t.is("td")?"height":"min-height",n=e.position().top+e.outerHeight(!0)-1;t.css(i,n)}}}),o=acf.Model.extend({group:!1,field:!1,events:{"click a":"onClick"},index:function(){return this.$el.index()},isVisible:function(){return acf.isVisible(this.$el)},isActive:function(){return this.$el.hasClass("active")},open:function(){this.$el.addClass("active"),this.field.showFields()},close:function(){this.$el.removeClass("active"),this.field.hideFields()},onClick:function(t,e){t.preventDefault(),this.toggle()},toggle:function(){this.isActive()||this.group.openTab(this)}}),s=new acf.Model({priority:50,actions:{prepare:"render",append:"render",unload:"onUnload",invalid_field:"onInvalidField"},findTabs:function(){return t(".acf-tab-wrap")},getTabs:function(){return acf.getInstances(this.findTabs())},render:function(t){this.getTabs().map(function(t){t.get("initialized")||t.initializeTabs()})},onInvalidField:function(t){this.busy||t.hiddenByTab&&(t.hiddenByTab.toggle(),this.busy=!0,this.setTimeout(function(){this.busy=!1},100))},onUnload:function(){var t=[];this.getTabs().map(function(e){var i=e.hasActive()?e.getActive().index():0;t.push(i)}),t.length&&acf.setPreference("this.tabs",t)}})}(jQuery),function(t,e){var i=acf.models.SelectField.extend({type:"post_object"});acf.registerFieldType(i)}(jQuery),function(t,e){var i=acf.models.SelectField.extend({type:"page_link"});acf.registerFieldType(i)}(jQuery),function(t,e){var i=acf.models.SelectField.extend({type:"user"});acf.registerFieldType(i)}(jQuery),function(t,e){var i=acf.Field.extend({type:"taxonomy",data:{ftype:"select"},select2:!1,wait:"load",events:{'click a[data-name="add"]':"onClickAdd",'click input[type="radio"]':"onClickRadio"},$control:function(){return this.$(".acf-taxonomy-field")},$input:function(){return this.getRelatedPrototype().$input.apply(this,arguments)},getRelatedType:function(){var t=this.get("ftype");return"multi_select"==t&&(t="select"),t},getRelatedPrototype:function(){return acf.getFieldType(this.getRelatedType()).prototype},getValue:function(){return this.getRelatedPrototype().getValue.apply(this,arguments)},setValue:function(){return this.getRelatedPrototype().setValue.apply(this,arguments)},initialize:function(){this.getRelatedPrototype().initialize.apply(this,arguments)},onRemove:function(){this.select2&&this.select2.destroy()},onClickAdd:function(e,i){var n=this,a=!1,r=!1,o=!1,s=!1,c=!1,l=!1,u=!1,d=function(){a=acf.newPopup({title:i.attr("title"),loading:!0,width:"300px"});var e={action:"acf/fields/taxonomy/add_term",field_key:n.get("key")};t.ajax({url:acf.get("ajaxurl"),data:acf.prepareForAjax(e),type:"post",dataType:"html",success:f})},f=function(t){a.loading(!1),a.content(t),r=a.$("form"),o=a.$('input[name="term_name"]'),s=a.$('select[name="term_parent"]'),c=a.$(".acf-submit-button"),o.focus(),a.on("submit","form",h)},h=function(e,i){if(e.preventDefault(),e.stopImmediatePropagation(),""===o.val())return o.focus(),!1;acf.startButtonLoading(c);var a={action:"acf/fields/taxonomy/add_term",field_key:n.get("key"),term_name:o.val(),term_parent:s.length?s.val():0};t.ajax({url:acf.get("ajaxurl"),data:acf.prepareForAjax(a),type:"post",dataType:"json",success:p})},p=function(t){acf.stopButtonLoading(c),u&&u.remove(),acf.isAjaxSuccess(t)?(o.val(""),g(t.data),u=acf.newNotice({
|
3 |
+
type:"success",text:acf.getAjaxMessage(t),target:r,timeout:2e3,dismiss:!1})):u=acf.newNotice({type:"error",text:acf.getAjaxError(t),target:r,timeout:2e3,dismiss:!1}),o.focus()},g=function(e){var i=t('<option value="'+e.term_id+'">'+e.term_label+"</option>"),a;e.term_parent?s.children('option[value="'+e.term_parent+'"]').after(i):s.append(i),acf.getFields({type:"taxonomy"}).map(function(t){t.get("taxonomy")==n.get("taxonomy")&&t.appendTerm(e)}),n.selectTerm(e.term_id)};d()},appendTerm:function(t){"select"==this.getRelatedType()?this.appendTermSelect(t):this.appendTermCheckbox(t)},appendTermSelect:function(t){this.select2.addOption({id:t.term_id,text:t.term_label})},appendTermCheckbox:function(e){var i=this.$("[name]:first").attr("name"),n=this.$("ul:first");"checkbox"==this.getRelatedType()&&(i+="[]");var a=t(['<li data-id="'+e.term_id+'">',"<label>",'<input type="'+this.get("ftype")+'" value="'+e.term_id+'" name="'+i+'" /> ',"<span>"+e.term_name+"</span>","</label>","</li>"].join(""));if(e.term_parent){var r=n.find('li[data-id="'+e.term_parent+'"]');(n=r.children("ul")).exists()||(n=t('<ul class="children acf-bl"></ul>'),r.append(n))}n.append(a)},selectTerm:function(t){var e;"select"==this.getRelatedType()?this.select2.selectOption(t):this.$('input[value="'+t+'"]').prop("checked",!0).trigger("change")},onClickRadio:function(t,e){var i=e.parent("label"),n=i.hasClass("selected");this.$(".selected").removeClass("selected"),i.addClass("selected"),this.get("allow_null")&&n&&(i.removeClass("selected"),e.prop("checked",!1).trigger("change"))}});acf.registerFieldType(i)}(jQuery),function(t,e){var i=acf.models.DatePickerField.extend({type:"time_picker",$control:function(){return this.$(".acf-time-picker")},initialize:function(){var t=this.$input(),e=this.$inputText(),i={timeFormat:this.get("time_format"),altField:t,altFieldTimeOnly:!1,altTimeFormat:"HH:mm:ss",showButtonPanel:!0,controlType:"select",oneLine:!0,closeText:acf.get("dateTimePickerL10n").selectText,timeOnly:!0,onClose:function(t,e,i){var n=e.dpDiv.find(".ui-datepicker-close");!t&&n.is(":hover")&&i._updateDateTime()}};i=acf.applyFilters("time_picker_args",i,this),acf.newTimePicker(e,i),acf.doAction("time_picker_init",e,i,this)}});acf.registerFieldType(i),acf.newTimePicker=function(e,i){if(void 0===t.timepicker)return!1;i=i||{},e.timepicker(i),t("body > #ui-datepicker-div").exists()&&t("body > #ui-datepicker-div").wrap('<div class="acf-ui-datepicker" />')}}(jQuery),function(t,e){var i=acf.Field.extend({type:"true_false",events:{"change .acf-switch-input":"onChange","focus .acf-switch-input":"onFocus","blur .acf-switch-input":"onBlur","keypress .acf-switch-input":"onKeypress"},$input:function(){return this.$('input[type="checkbox"]')},$switch:function(){return this.$(".acf-switch")},getValue:function(){return this.$input().prop("checked")?1:0},initialize:function(){this.render()},render:function(){var t=this.$switch();if(t.length){var e=t.children(".acf-switch-on"),i=t.children(".acf-switch-off"),n=Math.max(e.width(),i.width());n&&(e.css("min-width",n),i.css("min-width",n))}},switchOn:function(){this.$input().prop("checked",!0),this.$switch().addClass("-on")},switchOff:function(){this.$input().prop("checked",!1),this.$switch().removeClass("-on")},onChange:function(t,e){e.prop("checked")?this.switchOn():this.switchOff()},onFocus:function(t,e){this.$switch().addClass("-focus")},onBlur:function(t,e){this.$switch().removeClass("-focus")},onKeypress:function(t,e){return 37===t.keyCode?this.switchOff():39===t.keyCode?this.switchOn():void 0}});acf.registerFieldType(i)}(jQuery),function(t,e){var i=acf.Field.extend({type:"url",events:{'keyup input[type="url"]':"onkeyup"},$control:function(){return this.$(".acf-input-wrap")},$input:function(){return this.$('input[type="url"]')},initialize:function(){this.render()},isValid:function(){var t=this.val();return!!t&&(-1!==t.indexOf("://")||0===t.indexOf("//"))},render:function(){this.isValid()?this.$control().addClass("-valid"):this.$control().removeClass("-valid")},onkeyup:function(t,e){this.render()}});acf.registerFieldType(i)}(jQuery),function(t,e){var i=acf.Field.extend({type:"wysiwyg",wait:"load",events:{"mousedown .acf-editor-wrap.delay":"onMousedown",unmountField:"disableEditor",remountField:"enableEditor",removeField:"disableEditor"},$control:function(){return this.$(".acf-editor-wrap")},$input:function(){return this.$("textarea")},getMode:function(){return this.$control().hasClass("tmce-active")?"visual":"text"},initialize:function(){this.$control().hasClass("delay")||this.initializeEditor()},initializeEditor:function(){var t=this.$control(),e=this.$input(),i={tinymce:!0,quicktags:!0,toolbar:this.get("toolbar"),mode:this.getMode(),field:this},n=e.attr("id"),a=acf.uniqueId("acf-editor-"),r=e.data();acf.rename({target:t,search:n,replace:a,destructive:!0}),this.set("id",a,!0),acf.tinymce.initialize(a,i),this.$input().data(r)},onMousedown:function(t){t.preventDefault();var e=this.$control();e.removeClass("delay"),e.find(".acf-editor-toolbar").remove(),this.initializeEditor()},enableEditor:function(){"visual"==this.getMode()&&acf.tinymce.enable(this.get("id"))},disableEditor:function(){acf.tinymce.destroy(this.get("id"))}});acf.registerFieldType(i)}(jQuery),function(t,e){var i=[];acf.Condition=acf.Model.extend({type:"",operator:"==",label:"",choiceType:"input",fieldTypes:[],data:{conditions:!1,field:!1,rule:{}},events:{change:"change",keyup:"change",enableField:"change",disableField:"change"},setup:function(e){t.extend(this.data,e)},getEventTarget:function(t,e){return t||this.get("field").$el},change:function(t,e){this.get("conditions").change(t)},match:function(t,e){return!1},calculate:function(){return this.match(this.get("rule"),this.get("field"))},choices:function(t){return'<input type="text" />'}}),acf.newCondition=function(t,e){var i=e.get("field"),n=i.getField(t.field);if(!i||!n)return!1;var a={rule:t,target:i,conditions:e,field:n},r=n.get("type"),o=t.operator,s,c,l;return new(acf.getConditionTypes({fieldType:r,operator:o})[0]||acf.Condition)(a)};var n=function(t){return acf.strPascalCase(t||"")+"Condition"};acf.registerConditionType=function(t){var e,a=t.prototype.type,r=n(a);acf.models[r]=t,i.push(a)},acf.getConditionType=function(t){var e=n(t);return acf.models[e]||!1},acf.registerConditionForFieldType=function(t,e){var i=acf.getConditionType(t);i&&i.prototype.fieldTypes.push(e)},acf.getConditionTypes=function(t){t=acf.parseArgs(t,{fieldType:"",operator:""});var e=[];return i.map(function(i){var n=acf.getConditionType(i),a=n.prototype.fieldTypes,r=n.prototype.operator;t.fieldType&&-1===a.indexOf(t.fieldType)||t.operator&&r!==t.operator||e.push(n)}),e}}(jQuery),function(t,e){var i="conditional_logic",n=new acf.Model({id:"conditionsManager",priority:20,actions:{new_field:"onNewField"},onNewField:function(t){t.has("conditions")&&t.getConditions().render()}}),a=function(t,e){var i=acf.getFields({key:e,sibling:t.$el,suppressFilters:!0});return i.length||(i=acf.getFields({key:e,parent:t.$el.parent(),suppressFilters:!0})),!!i.length&&i[0]};acf.Field.prototype.getField=function(t){var e=a(this,t);if(e)return e;for(var i=this.parents(),n=0;n<i.length;n++)if(e=a(i[n],t))return e;return!1},acf.Field.prototype.getConditions=function(){return this.conditions||(this.conditions=new o(this)),this.conditions};var r=!1,o=acf.Model.extend({id:"Conditions",data:{field:!1,timeStamp:!1,groups:[]},setup:function(t){this.data.field=t;var e=t.get("conditions");e instanceof Array?e[0]instanceof Array?e.map(function(t,e){this.addRules(t,e)},this):this.addRules(e):this.addRule(e)},change:function(t){if(this.get("timeStamp")===t.timeStamp)return!1;this.set("timeStamp",t.timeStamp,!0);var e=this.render()},render:function(){return this.calculate()?this.show():this.hide()},show:function(){return this.get("field").showEnable(this.cid,i)},hide:function(){return this.get("field").hideDisable(this.cid,i)},calculate:function(){var t=!1;return this.getGroups().map(function(e){var i;t||e.filter(function(t){return t.calculate()}).length==e.length&&(t=!0)}),t},hasGroups:function(){return null!=this.data.groups},getGroups:function(){return this.data.groups},addGroup:function(){var t=[];return this.data.groups.push(t),t},hasGroup:function(t){return null!=this.data.groups[t]},getGroup:function(t){return this.data.groups[t]},removeGroup:function(t){return this.data.groups[t].delete,this},addRules:function(t,e){t.map(function(t){this.addRule(t,e)},this)},addRule:function(t,e){var i;e=e||0,i=this.hasGroup(e)?this.getGroup(e):this.addGroup();var n=acf.newCondition(t,this);if(!n)return!1;i.push(n)},hasRule:function(){},getRule:function(t,e){return t=t||0,e=e||0,this.data.groups[e][t]},removeRule:function(){}})}(jQuery),function(t,e){var i=acf.__,n=function(t){return t?""+t:""},a=function(t,e){return n(t).toLowerCase()===n(e).toLowerCase()},r=function(t,e){return parseFloat(t)===parseFloat(e)},o=function(t,e){return parseFloat(t)>parseFloat(e)},s=function(t,e){return parseFloat(t)<parseFloat(e)},c=function(t,e){return(e=e.map(function(t){return n(t)})).indexOf(t)>-1},l=function(t,e){return n(t).indexOf(n(e))>-1},u=function(t,e){var i=new RegExp(n(e),"gi");return n(t).match(i)},d=acf.Condition.extend({type:"hasValue",operator:"!=empty",label:i("Has any value"),fieldTypes:["text","textarea","number","range","email","url","password","image","file","wysiwyg","oembed","select","checkbox","radio","button_group","link","post_object","page_link","relationship","taxonomy","user","google_map","date_picker","date_time_picker","time_picker","color_picker"],match:function(t,e){return!!e.val()},choices:function(t){return'<input type="text" disabled="" />'}});acf.registerConditionType(d);var f=d.extend({type:"hasNoValue",operator:"==empty",label:i("Has no value"),match:function(t,e){return!d.prototype.match.apply(this,arguments)}});acf.registerConditionType(f);var h=acf.Condition.extend({type:"equalTo",operator:"==",label:i("Value is equal to"),fieldTypes:["text","textarea","number","range","email","url","password"],match:function(e,i){return t.isNumeric(e.value)?r(e.value,i.val()):a(e.value,i.val())},choices:function(t){return'<input type="text" />'}});acf.registerConditionType(h);var p=h.extend({type:"notEqualTo",operator:"!=",label:i("Value is not equal to"),match:function(t,e){return!h.prototype.match.apply(this,arguments)}});acf.registerConditionType(p);var g=acf.Condition.extend({type:"patternMatch",operator:"==pattern",label:i("Value matches pattern"),fieldTypes:["text","textarea","email","url","password","wysiwyg"],match:function(t,e){return u(e.val(),t.value)},choices:function(t){return'<input type="text" placeholder="[a-z0-9]" />'}});acf.registerConditionType(g);var m=acf.Condition.extend({type:"contains",operator:"==contains",label:i("Value contains"),fieldTypes:["text","textarea","number","email","url","password","wysiwyg","oembed","select"],match:function(t,e){return l(e.val(),t.value)},choices:function(t){return'<input type="text" />'}});acf.registerConditionType(m);var v=h.extend({type:"trueFalseEqualTo",choiceType:"select",fieldTypes:["true_false"],choices:function(t){return[{id:1,text:i("Checked")}]}});acf.registerConditionType(v);var y=p.extend({type:"trueFalseNotEqualTo",choiceType:"select",fieldTypes:["true_false"],choices:function(t){return[{id:1,text:i("Checked")}]}});acf.registerConditionType(y);var b=acf.Condition.extend({type:"selectEqualTo",operator:"==",label:i("Value is equal to"),fieldTypes:["select","checkbox","radio","button_group"],match:function(t,e){var i=e.val();return i instanceof Array?c(t.value,i):a(t.value,i)},choices:function(e){var n=[],a=e.$setting("choices textarea").val().split("\n");return e.$input("allow_null").prop("checked")&&n.push({id:"",text:i("Null")}),a.map(function(e){(e=e.split(":"))[1]=e[1]||e[0],n.push({id:t.trim(e[0]),text:t.trim(e[1])})}),n}});acf.registerConditionType(b);var w=b.extend({type:"selectNotEqualTo",operator:"!=",label:i("Value is not equal to"),match:function(t,e){return!b.prototype.match.apply(this,arguments)}});acf.registerConditionType(w);var x=acf.Condition.extend({type:"greaterThan",operator:">",label:i("Value is greater than"),fieldTypes:["number","range"],match:function(t,e){var i=e.val();return i instanceof Array&&(i=i.length),o(i,t.value)},choices:function(t){return'<input type="number" />'}});acf.registerConditionType(x);var _=x.extend({type:"lessThan",operator:"<",label:i("Value is less than"),match:function(t,e){var i=e.val();return i instanceof Array&&(i=i.length),s(i,t.value)},choices:function(t){return'<input type="number" />'}});acf.registerConditionType(_);var $=x.extend({type:"selectionGreaterThan",label:i("Selection is greater than"),fieldTypes:["checkbox","select","post_object","page_link","relationship","taxonomy","user"]});acf.registerConditionType($);var k=_.extend({type:"selectionLessThan",label:i("Selection is less than"),fieldTypes:["checkbox","select","post_object","page_link","relationship","taxonomy","user"]});acf.registerConditionType(k)}(jQuery),function(t,e){acf.newMediaPopup=function(t){var e=null,t=acf.parseArgs(t,{mode:"select",title:"",button:"",type:"",field:!1,allowedTypes:"",library:"all",multiple:!1,attachment:0,autoOpen:!0,open:function(){},select:function(){},close:function(){}});return e="edit"==t.mode?new acf.models.EditMediaPopup(t):new acf.models.SelectMediaPopup(t),t.autoOpen&&setTimeout(function(){e.open()},1),acf.doAction("new_media_popup",e),e};var i=function(){var e=acf.get("post_id");return t.isNumeric(e)?e:0};acf.getMimeTypes=function(){return this.get("mimeTypes")},acf.getMimeType=function(t){var e=acf.getMimeTypes();if(void 0!==e[t])return e[t];for(var i in e)if(-1!==i.indexOf(t))return e[i];return!1};var n=acf.Model.extend({id:"MediaPopup",data:{},defaults:{},frame:!1,setup:function(e){t.extend(this.data,e)},initialize:function(){var t=this.getFrameOptions();this.addFrameStates(t);var e=wp.media(t);e.acf=this,this.addFrameEvents(e,t),this.frame=e},open:function(){this.frame.open()},close:function(){this.frame.close()},remove:function(){this.frame.detach(),this.frame.remove()},getFrameOptions:function(){var t={title:this.get("title"),multiple:this.get("multiple"),library:{},states:[]};return this.get("type")&&(t.library.type=this.get("type")),"uploadedTo"===this.get("library")&&(t.library.uploadedTo=i()),this.get("attachment")&&(t.library.post__in=[this.get("attachment")]),this.get("button")&&(t.button={text:this.get("button")}),t},addFrameStates:function(t){var e=wp.media.query(t.library);this.get("field")&&acf.isset(e,"mirroring","args")&&(e.mirroring.args._acfuploader=this.get("field")),t.states.push(new wp.media.controller.Library({library:e,multiple:this.get("multiple"),title:this.get("title"),priority:20,filterable:"all",editable:!0,allowLocalEdits:!0})),acf.isset(wp,"media","controller","EditImage")&&t.states.push(new wp.media.controller.EditImage)},addFrameEvents:function(t,e){t.on("open",function(){this.$el.closest(".media-modal").addClass("acf-media-modal -"+this.acf.get("mode"))},t),t.on("content:render:edit-image",function(){var t=this.state().get("image"),e=new wp.media.view.EditImage({model:t,controller:this}).render();this.content.set(e),e.loadEditor()},t),t.on("select",function(){var e=t.state().get("selection");e&&e.each(function(e,i){t.acf.get("select").apply(t.acf,[e,i])})}),t.on("close",function(){setTimeout(function(){t.acf.get("close").apply(t.acf),t.acf.remove()},1)})}});acf.models.SelectMediaPopup=n.extend({id:"SelectMediaPopup",setup:function(t){t.button||(t.button=acf._x("Select","verb")),n.prototype.setup.apply(this,arguments)},addFrameEvents:function(t,e){acf.isset(_wpPluploadSettings,"defaults","multipart_params")&&(_wpPluploadSettings.defaults.multipart_params._acfuploader=this.get("field"),t.on("open",function(){delete _wpPluploadSettings.defaults.multipart_params._acfuploader})),t.on("content:activate:browse",function(){var e=!1;try{e=t.content.get().toolbar}catch(t){return void console.log(t)}t.acf.customizeFilters.apply(t.acf,[e])}),n.prototype.addFrameEvents.apply(this,arguments)},customizeFilters:function(e){var i=e.get("filters"),n;("image"==this.get("type")&&(i.filters.all.text=acf.__("All images"),delete i.filters.audio,delete i.filters.video,delete i.filters.image,t.each(i.filters,function(t,e){e.props.type=e.props.type||"image"})),this.get("allowedTypes"))&&this.get("allowedTypes").split(" ").join("").split(".").join("").split(",").map(function(t){var e=acf.getMimeType(t);if(e){var n={text:e,props:{status:null,type:e,uploadedTo:null,orderby:"date",order:"DESC"},priority:20};i.filters[e]=n}});if("uploadedTo"===this.get("library")){var a=this.frame.options.library.uploadedTo;delete i.filters.unattached,delete i.filters.uploaded,t.each(i.filters,function(t,e){e.text+=" ("+acf.__("Uploaded to this post")+")",e.props.uploadedTo=a})}var r=this.get("field"),o;t.each(i.filters,function(t,e){e.props._acfuploader=r}),e.get("search").model.attributes._acfuploader=r,i.renderFilters&&i.renderFilters()}}),acf.models.EditMediaPopup=n.extend({id:"SelectMediaPopup",setup:function(t){t.button||(t.button=acf._x("Update","verb")),n.prototype.setup.apply(this,arguments)},addFrameEvents:function(t,e){t.on("open",function(){this.$el.closest(".media-modal").addClass("acf-expanded"),"browse"!=this.content.mode()&&this.content.mode("browse");var e,i=this.state().get("selection"),n=wp.media.attachment(t.acf.get("attachment"));i.add(n)},t),n.prototype.addFrameEvents.apply(this,arguments)}});var a=new acf.Model({id:"customizePrototypes",wait:"ready",initialize:function(){if(acf.isset(window,"wp","media","view")){var t=i();t&&acf.isset(wp,"media","view","settings","post")&&(wp.media.view.settings.post.id=t),this.customizeAttachmentsButton(),this.customizeAttachmentsRouter(),this.customizeAttachmentFilters(),this.customizeAttachmentCompat(),this.customizeAttachmentLibrary()}},customizeAttachmentsButton:function(){if(acf.isset(wp,"media","view","Button")){var t=wp.media.view.Button;wp.media.view.Button=t.extend({initialize:function(){var t=_.defaults(this.options,this.defaults);this.model=new Backbone.Model(t),this.listenTo(this.model,"change",this.render)}})}},customizeAttachmentsRouter:function(){if(acf.isset(wp,"media","view","Router")){var e=wp.media.view.Router;wp.media.view.Router=e.extend({addExpand:function(){var e=t(['<a href="#" class="acf-expand-details">','<span class="is-closed"><span class="acf-icon -left small grey"></span>'+acf.__("Expand Details")+"</span>",'<span class="is-open"><span class="acf-icon -right small grey"></span>'+acf.__("Collapse Details")+"</span>","</a>"].join(""));e.on("click",function(e){e.preventDefault();var i=t(this).closest(".media-modal");i.hasClass("acf-expanded")?i.removeClass("acf-expanded"):i.addClass("acf-expanded")}),this.$el.append(e)},initialize:function(){return e.prototype.initialize.apply(this,arguments),this.addExpand(),this}})}},customizeAttachmentFilters:function(){var e;acf.isset(wp,"media","view","AttachmentFilters","All")&&(wp.media.view.AttachmentFilters.All.prototype.renderFilters=function(){this.$el.html(_.chain(this.filters).map(function(e,i){return{el:t("<option></option>").val(i).html(e.text)[0],priority:e.priority||50}},this).sortBy("priority").pluck("el").value())})},customizeAttachmentCompat:function(){if(acf.isset(wp,"media","view","AttachmentCompat")){var e=wp.media.view.AttachmentCompat,i=!1;wp.media.view.AttachmentCompat=e.extend({render:function(){return this.rendered?this:(e.prototype.render.apply(this,arguments),this.$("#acf-form-data").length?(clearTimeout(i),i=setTimeout(t.proxy(function(){this.rendered=!0,acf.doAction("append",this.$el)},this),50),this):this)},save:function(t){var e={};t&&t.preventDefault(),e=acf.serializeForAjax(this.$el),this.controller.trigger("attachment:compat:waiting",["waiting"]),this.model.saveCompat(e).always(_.bind(this.postSave,this))}})}},customizeAttachmentLibrary:function(){if(acf.isset(wp,"media","view","Attachment","Library")){var t=wp.media.view.Attachment.Library;wp.media.view.Attachment.Library=t.extend({render:function(){var e=acf.isget(this,"controller","acf"),i=acf.isget(this,"model","attributes");if(e&&i){i.acf_errors&&this.$el.addClass("acf-disabled");var n=e.get("selected");n&&n.indexOf(i.id)>-1&&this.$el.addClass("acf-selected")}return t.prototype.render.apply(this,arguments)},toggleSelection:function(e){var i=this.collection,n=this.options.selection,a=this.model,r=n.single(),o=this.controller,s=acf.isget(this,"model","attributes","acf_errors"),c=o.$el.find(".media-frame-content .media-sidebar");if(c.children(".acf-selection-error").remove(),c.children().removeClass("acf-hidden"),o&&s){var l=acf.isget(this,"model","attributes","filename");return c.children().addClass("acf-hidden"),c.prepend(['<div class="acf-selection-error">','<span class="selection-error-label">'+acf.__("Restricted")+"</span>",'<span class="selection-error-filename">'+l+"</span>",'<span class="selection-error-message">'+s+"</span>","</div>"].join("")),n.reset(),void n.single(a)}return t.prototype.toggleSelection.apply(this,arguments)}})}}})}(jQuery),function(t,e){acf.screen=new acf.Model({active:!0,xhr:!1,timeout:!1,wait:"load",events:{"change #page_template":"onChange","change #parent_id":"onChange","change #post-formats-select":"onChange","change .categorychecklist":"onChange","change .tagsdiv":"onChange",'change .acf-taxonomy-field[data-save="1"]':"onChange","change #product-type":"onChange"},isPost:function(){return"post"===acf.get("screen")},isUser:function(){return"user"===acf.get("screen")},isTaxonomy:function(){return"taxonomy"===acf.get("screen")},isAttachment:function(){return"attachment"===acf.get("screen")},isNavMenu:function(){return"nav_menu"===acf.get("screen")},isWidget:function(){return"widget"===acf.get("screen")},isComment:function(){return"comment"===acf.get("screen")},getPageTemplate:function(){var e=t("#page_template");return e.length?e.val():null},getPageParent:function(e,i){var i;return(i=t("#parent_id")).length?i.val():null},getPageType:function(t,e){return this.getPageParent()?"child":"parent"},getPostType:function(){return t("#post_type").val()},getPostFormat:function(e,i){var i;if((i=t("#post-formats-select input:checked")).length){var n=i.val();return"0"==n?"standard":n}return null},getPostCoreTerms:function(){var e={},i=acf.serialize(t(".categorydiv, .tagsdiv"));for(var n in i.tax_input&&(e=i.tax_input),i.post_category&&(e.category=i.post_category),e)acf.isArray(e[n])||(e[n]=e[n].split(", "));return e},getPostTerms:function(){var t=this.getPostCoreTerms();for(var e in acf.getFields({type:"taxonomy"}).map(function(e){if(e.get("save")){var i=e.val(),n=e.get("taxonomy");i&&(t[n]=t[n]||[],i=acf.isArray(i)?i:[i],t[n]=t[n].concat(i))}}),null!==(productType=this.getProductType())&&(t.product_type=[productType]),t)t[e]=acf.uniqueArray(t[e]);return t},getProductType:function(){var e=t("#product-type");return e.length?e.val():null},check:function(){if("post"===acf.get("screen")){this.xhr&&this.xhr.abort();var e=acf.parseArgs(this.data,{action:"acf/ajax/check_screen",screen:acf.get("screen"),exists:[]});this.isPost()&&(e.post_id=acf.get("post_id")),null!==(postType=this.getPostType())&&(e.post_type=postType),null!==(pageTemplate=this.getPageTemplate())&&(e.page_template=pageTemplate),null!==(pageParent=this.getPageParent())&&(e.page_parent=pageParent),null!==(pageType=this.getPageType())&&(e.page_type=pageType),null!==(postFormat=this.getPostFormat())&&(e.post_format=postFormat),null!==(postTerms=this.getPostTerms())&&(e.post_terms=postTerms),acf.getPostboxes().map(function(t){e.exists.push(t.get("key"))}),e=acf.applyFilters("check_screen_args",e);var i=function(t){acf.isAjaxSuccess(t)&&("post"==acf.get("screen")?this.renderPostScreen(t.data):"user"==acf.get("screen")&&this.renderUserScreen(t.data)),acf.doAction("check_screen_complete",t.data,e)};this.xhr=t.ajax({url:acf.get("ajaxurl"),data:acf.prepareForAjax(e),type:"post",dataType:"json",context:this,success:i})}},onChange:function(t,e){this.setTimeout(this.check,1)},renderPostScreen:function(e){var i=[],n=function(e,i){var n=t._data(e[0]).events;for(var a in n)for(var r=0;r<n[a].length;r++)i.on(a,n[a][r].handler)},a=function(e,i){var n=i.indexOf(e);if(-1==n)return!1;for(var a=n-1;a>=0;a--)if(t("#"+i[a]).length)return t("#"+i[a]).after(t("#"+e));for(var a=n+1;a<i.length;a++)if(t("#"+i[a]).length)return t("#"+i[a]).before(t("#"+e));return!1};e.results.map(function(r,o){var s=acf.getPostbox(r.id);if(!s){var c=t(['<div id="'+r.id+'" class="postbox">','<button type="button" class="handlediv" aria-expanded="false">','<span class="screen-reader-text">Toggle panel: '+r.title+"</span>",'<span class="toggle-indicator" aria-hidden="true"></span>',"</button>",'<h2 class="hndle ui-sortable-handle">',"<span>"+r.title+"</span>","</h2>",'<div class="inside">',r.html,"</div>","</div>"].join(""));if(t("#adv-settings").length){var l=t("#adv-settings .metabox-prefs"),u=t(['<label for="'+r.id+'-hide">','<input class="hide-postbox-tog" name="'+r.id+'-hide" type="checkbox" id="'+r.id+'-hide" value="'+r.id+'" checked="checked">'," "+r.title,"</label>"].join(""));n(l.find("input").first(),u.find("input")),l.append(u)}"side"===r.position?t("#"+r.position+"-sortables").append(c):t("#"+r.position+"-sortables").prepend(c);var d=[];if(e.results.map(function(e){r.position===e.position&&t("#"+r.position+"-sortables #"+e.id).length&&d.push(e.id)}),a(r.id,d),e.sorted)for(var f in e.sorted){var d=e.sorted[f].split(",");if(a(r.id,d))break}var h=t("#submitdiv");t("#submitdiv").length&&(n(h.children(".handlediv"),c.children(".handlediv")),n(h.children(".hndle"),c.children(".hndle"))),s=acf.newPostbox(r),acf.doAction("append",c),acf.doAction("append_postbox",s)}s.showEnable(),acf.doAction("show_postbox",s),i.push(r.id)}),acf.getPostboxes().map(function(t){-1===i.indexOf(t.get("id"))&&(t.hideDisable(),acf.doAction("hide_postbox",t))}),t("#acf-style").html(e.style)},renderUserScreen:function(t){}});var i=new acf.Model({wait:"load",initialize:function(){acf.isGutenberg()&&(wp.data.subscribe(this.proxy(this.onChange)),acf.screen.getPageTemplate=this.getPageTemplate,acf.screen.getPageParent=this.getPageParent,acf.screen.getPostType=this.getPostType,acf.screen.getPostFormat=this.getPostFormat,acf.screen.getPostCoreTerms=this.getPostCoreTerms,acf.unload.disable())},onChange:function(){var t=wp.data.select("core/editor").getPostEdits(),e=["template","parent","format"],i;(wp.data.select("core").getTaxonomies()||[]).map(function(t){e.push(t.rest_base)}),(e=e.filter(this.proxy(function(e){return void 0!==t[e]&&t[e]!==this.get(e)}))).length&&this.triggerChange(t)},triggerChange:function(t){void 0!==t&&(this.data=t),acf.screen.check()},getPageTemplate:function(){return wp.data.select("core/editor").getEditedPostAttribute("template")},getPageParent:function(t,e){return wp.data.select("core/editor").getEditedPostAttribute("parent")},getPostType:function(){return wp.data.select("core/editor").getEditedPostAttribute("type")},getPostFormat:function(t,e){return wp.data.select("core/editor").getEditedPostAttribute("format")},getPostCoreTerms:function(){var t={},e;return(wp.data.select("core").getTaxonomies()||[]).map(function(e){var i=wp.data.select("core/editor").getEditedPostAttribute(e.rest_base);i&&(t[e.slug]=i)}),t}});acf.screen.refreshAvailableMetaBoxesPerLocation=function(){var t=wp.data.select("core/edit-post"),e=wp.data.dispatch("core/edit-post"),i={};t.getActiveMetaBoxLocations().map(function(e){i[e]=t.getMetaBoxesPerLocation(e)});var n=[];for(var a in i)n=n.concat(i[a].map(function(t){return t.id}));acf.getPostboxes().map(function(t){if(-1===n.indexOf(t.get("id"))){var e=t.$el.closest("form").attr("class").replace("metabox-location-","");i[e]=i[e]||[],i[e].push({id:t.get("id"),title:t.get("title")})}}),e.setAvailableMetaBoxesPerLocation(i)}}(jQuery),function(t,e){function i(){return acf.isset(window,"jQuery","fn","select2","amd")?4:!!acf.isset(window,"Select2")&&3}acf.newSelect2=function(t,e){if(e=acf.parseArgs(e,{allowNull:!1,placeholder:"",multiple:!1,field:!1,ajax:!1,ajaxAction:"",ajaxData:function(t){return t},ajaxResults:function(t){return t}}),4==i())var n=new a(t,e);else var n=new r(t,e);return acf.doAction("new_select2",n),n};var n=acf.Model.extend({setup:function(e,i){t.extend(this.data,i),this.$el=e},initialize:function(){},selectOption:function(t){var e=this.getOption(t);e.prop("selected")||e.prop("selected",!0).trigger("change")},unselectOption:function(t){var e=this.getOption(t);e.prop("selected")&&e.prop("selected",!1).trigger("change")},getOption:function(t){return this.$('option[value="'+t+'"]')},addOption:function(e){e=acf.parseArgs(e,{id:"",text:"",selected:!1});var i=this.getOption(e.id);return i.length||((i=t("<option></option>")).html(e.text),i.attr("value",e.id),i.prop("selected",e.selected),this.$el.append(i)),i},getValue:function(){var e=[],i=this.$el.find("option:selected");return i.exists()?((i=i.sort(function(t,e){return+t.getAttribute("data-i")-+e.getAttribute("data-i")})).each(function(){var i=t(this);e.push({$el:i,id:i.attr("value"),text:i.text()})}),e):e},mergeOptions:function(){},getChoices:function(){var e=function(i){var n=[];return i.children().each(function(){var i=t(this);i.is("optgroup")?n.push({text:i.attr("label"),children:e(i)}):n.push({id:i.attr("value"),text:i.text()})}),n};return e(this.$el)},decodeChoices:function(t){var e=function(t){return t.map(function(t){return t.text=acf.decode(t.text),t.children&&(t.children=e(t.children)),t}),t};return e(t)},getAjaxData:function(t){var e={action:this.get("ajaxAction"),s:t.term||"",paged:t.page||1},i=this.get("field");i&&(e.field_key=i.get("key"));var n=this.get("ajaxData");return n&&(e=n.apply(this,[e,t])),e=acf.applyFilters("select2_ajax_data",e,this.data,this.$el,i||!1,this),acf.prepareForAjax(e)},getAjaxResults:function(t,e){(t=acf.parseArgs(t,{results:!1,more:!1})).results&&(t.results=this.decodeChoices(t.results));var i=this.get("ajaxResults");return i&&(t=i.apply(this,[t,e])),t=acf.applyFilters("select2_ajax_results",t,e,this)},processAjaxResults:function(e,i){var e;return(e=this.getAjaxResults(e,i)).more&&(e.pagination={more:!0}),setTimeout(t.proxy(this.mergeOptions,this),1),e},destroy:function(){this.$el.data("select2")&&this.$el.select2("destroy"),this.$el.siblings(".select2-container").remove()}}),a=n.extend({initialize:function(){var e=this.$el,i={width:"100%",allowClear:this.get("allowNull"),placeholder:this.get("placeholder"),multiple:this.get("multiple"),data:[],escapeMarkup:function(t){return t}};i.multiple&&this.getValue().map(function(t){t.$el.detach().appendTo(e)}),e.removeData("ajax"),e.removeAttr("data-ajax"),this.get("ajax")&&(i.ajax={url:acf.get("ajaxurl"),delay:250,dataType:"json",type:"post",cache:!1,data:t.proxy(this.getAjaxData,this),processResults:t.proxy(this.processAjaxResults,this)});var n=this.get("field");i=acf.applyFilters("select2_args",i,e,this.data,n||!1,this),e.select2(i);var a=e.next(".select2-container");if(i.multiple){var r=a.find("ul");r.sortable({stop:function(i){r.find(".select2-selection__choice").each(function(){var i;t(t(this).data("data").element).detach().appendTo(e)}),e.trigger("change")}}),e.on("select2:select",this.proxy(function(t){this.getOption(t.params.data.id).detach().appendTo(this.$el)}))}a.addClass("-acf"),acf.doAction("select2_init",e,i,this.data,n||!1,this)},mergeOptions:function(){var e=!1,i=!1;t('.select2-results__option[role="group"]').each(function(){var n=t(this).children("ul"),a=t(this).children("strong");if(i&&i.text()===a.text())return e.append(n.children()),void t(this).remove();e=n,i=a})}}),r=n.extend({initialize:function(){var e=this.$el,i=this.getValue(),n=this.get("multiple"),a={width:"100%",allowClear:this.get("allowNull"),placeholder:this.get("placeholder"),separator:"||",multiple:this.get("multiple"),data:this.getChoices(),escapeMarkup:function(t){return t},dropdownCss:{"z-index":"999999999"},initSelection:function(t,e){e(n?i:i.shift())}
|
4 |
+
},r=e.siblings("input");r.length||(r=t('<input type="hidden" />'),e.before(r)),inputValue=i.map(function(t){return t.id}).join("||"),r.val(inputValue),a.multiple&&i.map(function(t){t.$el.detach().appendTo(e)}),a.allowClear&&(a.data=a.data.filter(function(t){return""!==t.id})),e.removeData("ajax"),e.removeAttr("data-ajax"),this.get("ajax")&&(a.ajax={url:acf.get("ajaxurl"),quietMillis:250,dataType:"json",type:"post",cache:!1,data:t.proxy(this.getAjaxData,this),results:t.proxy(this.processAjaxResults,this)});var o=this.get("field");a=acf.applyFilters("select2_args",a,e,this.data,o||!1,this),r.select2(a);var s=r.select2("container"),c=t.proxy(this.getOption,this);if(a.multiple){var l=s.find("ul");l.sortable({stop:function(){l.find(".select2-search-choice").each(function(){var i=t(this).data("select2Data"),n;c(i.id).detach().appendTo(e)}),e.trigger("change")}})}r.on("select2-selecting",function(i){var n=i.choice,a=c(n.id);a.length||(a=t('<option value="'+n.id+'">'+n.text+"</option>")),a.detach().appendTo(e)}),s.addClass("-acf"),acf.doAction("select2_init",e,a,this.data,o||!1,this),r.on("change",function(){var t=r.val();t.indexOf("||")&&(t=t.split("||")),e.val(t).trigger("change")}),e.hide()},mergeOptions:function(){var e=!1,i=!1;t("#select2-drop .select2-result-with-children").each(function(){var n=t(this).children("ul"),a=t(this).children(".select2-result-label");if(i&&i.text()===a.text())return i.append(n.children()),void t(this).remove();e=n,i=a})},getAjaxData:function(t,e){var i={term:t,page:e};return n.prototype.getAjaxData.apply(this,[i])}}),o=new acf.Model({priority:5,wait:"prepare",initialize:function(){var t=acf.get("locale"),e=acf.get("rtl"),n=acf.get("select2L10n"),a=i();return!!n&&(0!==t.indexOf("en")&&void(4==a?this.addTranslations4():3==a&&this.addTranslations3()))},addTranslations4:function(){var t=acf.get("select2L10n"),e=acf.get("locale");e=e.replace("_","-");var i={errorLoading:function(){return t.load_fail},inputTooLong:function(e){var i=e.input.length-e.maximum;return i>1?t.input_too_long_n.replace("%d",i):t.input_too_long_1},inputTooShort:function(e){var i=e.minimum-e.input.length;return i>1?t.input_too_short_n.replace("%d",i):t.input_too_short_1},loadingMore:function(){return t.load_more},maximumSelected:function(e){var i=e.maximum;return i>1?t.selection_too_long_n.replace("%d",i):t.selection_too_long_1},noResults:function(){return t.matches_0},searching:function(){return t.searching}};jQuery.fn.select2.amd.define("select2/i18n/"+e,[],function(){return i})},addTranslations3:function(){var e=acf.get("select2L10n"),i=acf.get("locale");i=i.replace("_","-");var n={formatMatches:function(t){return t>1?e.matches_n.replace("%d",t):e.matches_1},formatNoMatches:function(){return e.matches_0},formatAjaxError:function(){return e.load_fail},formatInputTooShort:function(t,i){var n=i-t.length;return n>1?e.input_too_short_n.replace("%d",n):e.input_too_short_1},formatInputTooLong:function(t,i){var n=t.length-i;return n>1?e.input_too_long_n.replace("%d",n):e.input_too_long_1},formatSelectionTooBig:function(t){return t>1?e.selection_too_long_n.replace("%d",t):e.selection_too_long_1},formatLoadMore:function(){return e.load_more},formatSearching:function(){return e.searching}};t.fn.select2.locales=t.fn.select2.locales||{},t.fn.select2.locales[i]=n,t.extend(t.fn.select2.defaults,n)}})}(jQuery),function(t,e){acf.tinymce={defaults:function(){return"undefined"!=typeof tinyMCEPreInit&&{tinymce:tinyMCEPreInit.mceInit.acf_content,quicktags:tinyMCEPreInit.qtInit.acf_content};var t},initialize:function(t,e){(e=acf.parseArgs(e,{tinymce:!0,quicktags:!0,toolbar:"full",mode:"visual",field:!1})).tinymce&&this.initializeTinymce(t,e),e.quicktags&&this.initializeQuicktags(t,e)},initializeTinymce:function(e,i){var n=t("#"+e),a=this.defaults(),r=acf.get("toolbars"),o=i.field||!1,s=o.$el||!1;if("undefined"==typeof tinymce)return!1;if(!a)return!1;if(tinymce.get(e))return this.enable(e);var c=t.extend({},a.tinymce,i.tinymce);c.id=e,c.selector="#"+e;var l=i.toolbar;if(l&&r&&r[l])for(var u=1;u<=4;u++)c["toolbar"+u]=r[l][u]||"";if(c.setup=function(t){t.on("change",function(e){t.save(),n.trigger("change")}),t.on("mouseup",function(t){var e=new MouseEvent("mouseup");window.dispatchEvent(e)})},c.wp_autoresize_on=!1,c.tadv_noautop||(c.wpautop=!0),c=acf.applyFilters("wysiwyg_tinymce_settings",c,e,o),tinyMCEPreInit.mceInit[e]=c,"visual"==i.mode){var d=tinymce.init(c),f=tinymce.get(e);if(!f)return!1;f.acf=i.field,acf.doAction("wysiwyg_tinymce_init",f,f.id,c,o)}},initializeQuicktags:function(e,i){var n=this.defaults();if("undefined"==typeof quicktags)return!1;if(!n)return!1;var a=t.extend({},n.quicktags,i.quicktags);a.id=e;var r=i.field||!1,o=r.$el||!1;a=acf.applyFilters("wysiwyg_quicktags_settings",a,a.id,r),tinyMCEPreInit.qtInit[e]=a;var s=quicktags(a);if(!s)return!1;this.buildQuicktags(s),acf.doAction("wysiwyg_quicktags_init",s,s.id,a,r)},buildQuicktags:function(t){var e,i,n,a,r,t,o,s,c,l,u=",strong,em,link,block,del,ins,img,ul,ol,li,code,more,close,";for(s in e=t.canvas,i=t.name,n=t.settings,r="",a={},c="",l=t.id,n.buttons&&(c=","+n.buttons+","),edButtons)edButtons[s]&&(o=edButtons[s].id,c&&-1!==u.indexOf(","+o+",")&&-1===c.indexOf(","+o+",")||edButtons[s].instance&&edButtons[s].instance!==l||(a[o]=edButtons[s],edButtons[s].html&&(r+=edButtons[s].html(i+"_"))));c&&-1!==c.indexOf(",dfw,")&&(a.dfw=new QTags.DFWButton,r+=a.dfw.html(i+"_")),"rtl"===document.getElementsByTagName("html")[0].dir&&(a.textdirection=new QTags.TextDirectionButton,r+=a.textdirection.html(i+"_")),t.toolbar.innerHTML=r,t.theButtons=a,"undefined"!=typeof jQuery&&jQuery(document).triggerHandler("quicktags-init",[t])},disable:function(t){this.destroyTinymce(t)},remove:function(t){this.destroyTinymce(t)},destroy:function(t){this.destroyTinymce(t)},destroyTinymce:function(t){if("undefined"==typeof tinymce)return!1;var e=tinymce.get(t);return!!e&&(e.save(),e.destroy(),!0)},enable:function(t){this.enableTinymce(t)},enableTinymce:function(t){return"undefined"!=typeof switchEditors&&(void 0!==tinyMCEPreInit.mceInit[t]&&(switchEditors.go(t,"tmce"),!0))}};var i=new acf.Model({priority:5,actions:{prepare:"onPrepare",ready:"onReady"},onPrepare:function(){var e=t("#acf-hidden-wp-editor");e.exists()&&e.appendTo("body")},onReady:function(){acf.isset(window,"wp","oldEditor")&&(wp.editor.autop=wp.oldEditor.autop,wp.editor.removep=wp.oldEditor.removep),acf.isset(window,"tinymce","on")&&tinymce.on("AddEditor",function(t){var e=t.editor;"acf"===e.id.substr(0,3)&&(e=tinymce.editors.content||e,tinymce.activeEditor=e,wpActiveEditor=e.id)})}})}(jQuery),function(t,e){var i=acf.Model.extend({id:"Validator",data:{errors:[],notice:null,status:""},events:{"changed:status":"onChangeStatus"},addErrors:function(t){t.map(this.addError,this)},addError:function(t){this.data.errors.push(t)},hasErrors:function(){return this.data.errors.length},clearErrors:function(){return this.data.errors=[]},getErrors:function(){return this.data.errors},getFieldErrors:function(){var t=[],e=[];return this.getErrors().map(function(i){if(i.input){var n=e.indexOf(i.input);n>-1?t[n]=i:(t.push(i),e.push(i.input))}}),t},getGlobalErrors:function(){return this.getErrors().filter(function(t){return!t.input})},showErrors:function(){if(this.hasErrors()){var e=this.getFieldErrors(),i=this.getGlobalErrors(),n=0,a=!1;e.map(function(t){var e=this.$('[name="'+t.input+'"]').first();if(e.length||(e=this.$('[name^="'+t.input+'"]').first()),e.length){n++;var i=acf.getClosestField(e);i.showError(t.message),a||(a=i.$el)}},this);var r=acf.__("Validation failed");if(i.map(function(t){r+=". "+t.message}),1==n?r+=". "+acf.__("1 field requires attention"):n>1&&(r+=". "+acf.__("%d fields require attention").replace("%d",n)),this.has("notice"))this.get("notice").update({type:"error",text:r});else{var o=acf.newNotice({type:"error",text:r,target:this.$el});this.set("notice",o)}a||(a=this.get("notice").$el),setTimeout(function(){t("html, body").animate({scrollTop:a.offset().top-t(window).height()/2},500)},10)}},onChangeStatus:function(t,e,i,n){this.$el.removeClass("is-"+n).addClass("is-"+i)},validate:function(e){if(e=acf.parseArgs(e,{event:!1,reset:!1,loading:function(){},complete:function(){},failure:function(){},success:function(t){t.submit()}}),"valid"==this.get("status"))return!0;if("validating"==this.get("status"))return!1;if(!this.$(".acf-field").length)return!0;if(e.event){var i=t.Event(null,e.event);e.success=function(){acf.enableSubmit(t(i.target)).trigger(i)}}acf.doAction("validation_begin",this.$el),acf.lockForm(this.$el),e.loading(this.$el,this),this.set("status","validating");var n=function(t){if(acf.isAjaxSuccess(t)){var e=acf.applyFilters("validation_complete",t.data,this.$el,this);e.valid||this.addErrors(e.errors)}},a=function(){acf.unlockForm(this.$el),this.hasErrors()?(this.set("status","invalid"),acf.doAction("validation_failure",this.$el,this),this.showErrors(),e.failure(this.$el,this)):(this.set("status","valid"),this.has("notice")&&this.get("notice").update({type:"success",text:acf.__("Validation successful"),timeout:1e3}),acf.doAction("validation_success",this.$el,this),acf.doAction("submit",this.$el),e.success(this.$el,this),acf.lockForm(this.$el),e.reset&&this.reset()),e.complete(this.$el,this),this.clearErrors()},r=acf.serialize(this.$el);return r.action="acf/validate_save_post",t.ajax({url:acf.get("ajaxurl"),data:acf.prepareForAjax(r),type:"post",dataType:"json",context:this,success:n,complete:a}),!1},setup:function(t){this.$el=t},reset:function(){this.set("errors",[]),this.set("notice",null),this.set("status",""),acf.unlockForm(this.$el)}}),n=function(t){var e=t.data("acf");return e||(e=new i(t)),e};acf.validateForm=function(t){return n(t.form).validate(t)},acf.enableSubmit=function(t){return t.removeClass("disabled")},acf.disableSubmit=function(t){return t.addClass("disabled")},acf.showSpinner=function(t){return t.addClass("is-active"),t.css("display","inline-block"),t},acf.hideSpinner=function(t){return t.removeClass("is-active"),t.css("display","none"),t},acf.lockForm=function(t){var e=a(t),i=e.find('.button, [type="submit"]'),n=e.find(".spinner, .acf-spinner");return acf.hideSpinner(n),acf.disableSubmit(i),acf.showSpinner(n.last()),t},acf.unlockForm=function(t){var e=a(t),i=e.find('.button, [type="submit"]'),n=e.find(".spinner, .acf-spinner");return acf.enableSubmit(i),acf.hideSpinner(n),t};var a=function(t){var e,e,e,e;return(e=t.find("#submitdiv")).length?e:(e=t.find("#submitpost")).length?e:(e=t.find("p.submit").last()).length?e:(e=t.find(".acf-form-submit")).length?e:t};acf.validation=new acf.Model({id:"validation",active:!0,wait:"prepare",actions:{ready:"addInputEvents",append:"addInputEvents"},events:{'click input[type="submit"]':"onClickSubmit",'click button[type="submit"]':"onClickSubmit","click #save-post":"onClickSave","submit form#post":"onSubmitPost","submit form":"onSubmit"},initialize:function(){acf.get("validation")||(this.active=!1,this.actions={},this.events={})},enable:function(){this.active=!0},disable:function(){this.active=!1},reset:function(t){n(t).reset()},addInputEvents:function(e){var i=t(".acf-field [name]",e);i.length&&this.on(i,"invalid","onInvalid")},onInvalid:function(t,e){t.preventDefault();var i=e.closest("form");i.length&&(n(i).addError({input:e.attr("name"),message:t.target.validationMessage}),i.submit())},onClickSubmit:function(t,e){this.set("originalEvent",t)},onClickSave:function(t,e){this.set("ignore",!0)},onClickSubmitGutenberg:function(e,i){var n;acf.validateForm({form:t("#editor"),event:e,reset:!0,failure:function(t,e){var i=e.get("notice").$el;i.appendTo(".components-notice-list"),i.find(".acf-notice-dismiss").removeClass("small")}})||(e.preventDefault(),e.stopImmediatePropagation())},onSubmitPost:function(e,i){"dopreview"===t("input#wp-preview").val()&&(this.set("ignore",!0),acf.unlockForm(i))},onSubmit:function(t,e){if(!this.active||this.get("ignore")||t.isDefaultPrevented())return this.allowSubmit();var i;acf.validateForm({form:e,event:this.get("originalEvent")})||t.preventDefault()},allowSubmit:function(){return this.set("ignore",!1),this.set("originalEvent",!1),!0}})}(jQuery),function(t,e){var i=new acf.Model({priority:90,timeout:0,actions:{new_field:"refresh",show_field:"refresh",hide_field:"refresh",remove_field:"refresh"},refresh:function(){clearTimeout(this.timeout),this.timeout=setTimeout(function(){acf.doAction("refresh")},0)}}),n=new acf.Model({priority:1,actions:{sortstart:"onSortstart",sortstop:"onSortstop"},onSortstart:function(t){acf.doAction("unmount",t)},onSortstop:function(t){acf.doAction("remount",t)}}),a=new acf.Model({actions:{sortstart:"onSortstart"},onSortstart:function(e,i){e.is("tr")&&(i.html('<td style="padding:0;" colspan="'+i.children().length+'"></td>'),e.addClass("acf-sortable-tr-helper"),e.children().each(function(){t(this).width(t(this).width())}),i.height(e.height()+"px"),e.removeClass("acf-sortable-tr-helper"))}}),r=new acf.Model({actions:{after_duplicate:"onAfterDuplicate"},onAfterDuplicate:function(e,i){var n=[];e.find("select").each(function(e){n.push(t(this).val())}),i.find("select").each(function(e){t(this).val(n[e])})}}),o=new acf.Model({id:"tableHelper",priority:20,actions:{refresh:"renderTables"},renderTables:function(e){var i=this;t(".acf-table:visible").each(function(){i.renderTable(t(this))})},renderTable:function(e){var i=e.find("> thead > tr:visible > th[data-key]"),n=e.find("> tbody > tr:visible > td[data-key]");if(!i.length||!n.length)return!1;i.each(function(e){var i=t(this),a=i.data("key"),r=n.filter('[data-key="'+a+'"]'),o=r.filter(".acf-hidden");r.removeClass("acf-empty"),r.length===o.length?acf.hide(i):(acf.show(i),o.addClass("acf-empty"))}),i.css("width","auto"),i=i.not(".acf-hidden");var a=100,r=i.length,o;i.filter("[data-width]").each(function(){var e=t(this).data("width");t(this).css("width",e+"%"),a-=e});var s=i.not("[data-width]");if(s.length){var c=a/s.length;s.css("width",c+"%"),a=0}a>0&&i.last().css("width","auto"),n.filter(".-collapsed-target").each(function(){var e=t(this);e.parent().hasClass("-collapsed")?e.attr("colspan",i.length):e.removeAttr("colspan")})}}),s=new acf.Model({id:"fieldsHelper",priority:30,actions:{refresh:"renderGroups"},renderGroups:function(){var e=this;t(".acf-fields:visible").each(function(){e.renderGroup(t(this))})},renderGroup:function(e){var i=0,n=0,a=t(),r=e.children(".acf-field[data-width]:visible");return!!r.length&&(e.hasClass("-left")?(r.removeAttr("data-width"),r.css("width","auto"),!1):(r.removeClass("-r0 -c0").css({"min-height":0}),r.each(function(e){var r=t(this),o=r.position(),s=Math.ceil(o.top),c=Math.ceil(o.left);a.length&&s>i&&(a.css({"min-height":n+"px"}),o=r.position(),s=Math.ceil(o.top),c=Math.ceil(o.left),i=0,n=0,a=t()),acf.get("rtl")&&(c=Math.ceil(r.parent().width()-(o.left+r.outerWidth()))),0==s?r.addClass("-r0"):0==c&&r.addClass("-c0");var l=Math.ceil(r.outerHeight())+1;n=Math.max(n,l),i=Math.max(i,s),a=a.add(r)}),void(a.length&&a.css({"min-height":n+"px"}))))}})}(jQuery),function(t,e){acf.newCompatibility=function(t,e){return(e=e||{}).__proto__=t.__proto__,t.__proto__=e,t.compatibility=e,e},acf.getCompatibility=function(t){return t.compatibility||null};var i=acf.newCompatibility(acf,{l10n:{},o:{},fields:{},update:acf.set,add_action:acf.addAction,remove_action:acf.removeAction,do_action:acf.doAction,add_filter:acf.addFilter,remove_filter:acf.removeFilter,apply_filters:acf.applyFilters,parse_args:acf.parseArgs,disable_el:acf.disable,disable_form:acf.disable,enable_el:acf.enable,enable_form:acf.enable,update_user_setting:acf.updateUserSetting,prepare_for_ajax:acf.prepareForAjax,is_ajax_success:acf.isAjaxSuccess,remove_el:acf.remove,remove_tr:acf.remove,str_replace:acf.strReplace,render_select:acf.renderSelect,get_uniqid:acf.uniqid,serialize_form:acf.serialize,esc_html:acf.strEscape,str_sanitize:acf.strSanitize});i._e=function(t,e){t=t||"";var i=(e=e||"")?t+"."+e:t,n={"image.select":"Select Image","image.edit":"Edit Image","image.update":"Update Image"};if(n[i])return acf.__(n[i]);var a=this.l10n[t]||"";return e&&(a=a[e]||""),a},i.get_selector=function(e){var i=".acf-field";if(!e)return i;if(t.isPlainObject(e)){if(t.isEmptyObject(e))return i;for(var n in e){e=e[n];break}}return i+="-"+e,i=acf.strReplace("_","-",i),i=acf.strReplace("field-field-","field-",i)},i.get_fields=function(t,e,i){var n={is:t||"",parent:e||!1,suppressFilters:i||!1};return n.is&&(n.is=this.get_selector(n.is)),acf.findFields(n)},i.get_field=function(t,e){var i=this.get_fields.apply(this,arguments);return!!i.length&&i.first()},i.get_closest_field=function(t,e){return t.closest(this.get_selector(e))},i.get_field_wrap=function(t){return t.closest(this.get_selector())},i.get_field_key=function(t){return t.data("key")},i.get_field_type=function(t){return t.data("type")},i.get_data=function(t,e){return acf.parseArgs(t.data(),e)},i.maybe_get=function(t,e,i){void 0===i&&(i=null),keys=String(e).split(".");for(var n=0;n<keys.length;n++){if(!t.hasOwnProperty(keys[n]))return i;t=t[keys[n]]}return t};var n=function(t){return t instanceof acf.Field?t.$el:t},a=function(t){return acf.arrayArgs(t).map(n)},r=function(e){return function(){if(arguments.length)var i=a(arguments);else var i=[t(document)];return e.apply(this,i)}};i.add_action=function(t,e,n,a){var o=t.split(" "),s=o.length;if(s>1){for(var c=0;c<s;c++)t=o[c],i.add_action.apply(this,arguments);return this}var e=r(e);return acf.addAction.apply(this,arguments)},i.add_filter=function(t,e,i,n){var e=r(e);return acf.addFilter.apply(this,arguments)},i.model={actions:{},filters:{},events:{},extend:function(e){var i=t.extend({},this,e);return t.each(i.actions,function(t,e){i._add_action(t,e)}),t.each(i.filters,function(t,e){i._add_filter(t,e)}),t.each(i.events,function(t,e){i._add_event(t,e)}),i},_add_action:function(t,e){var i=this,n=t.split(" "),t=n[0]||"",a=n[1]||10;acf.add_action(t,this[e],a,this)},_add_filter:function(t,e){var i=this,n=t.split(" "),t=n[0]||"",a=n[1]||10;acf.add_filter(t,this[e],a,this)},_add_event:function(e,i){var n=this,a=e.indexOf(" "),r=a>0?e.substr(0,a):e,o=a>0?e.substr(a+1):"",s=function(e){e.$el=t(this),acf.field_group&&(e.$field=e.$el.closest(".acf-field-object")),"function"==typeof n.event&&(e=n.event(e)),n[i].apply(n,arguments)};o?t(document).on(r,o,s):t(document).on(r,s)},get:function(t,e){return e=e||null,void 0!==this[t]&&(e=this[t]),e},set:function(t,e){return this[t]=e,"function"==typeof this["_set_"+t]&&this["_set_"+t].apply(this),this}},i.field=acf.model.extend({type:"",o:{},$field:null,_add_action:function(t,e){var i=this;t=t+"_field/type="+i.type,acf.add_action(t,function(t){i.set("$field",t),i[e].apply(i,arguments)})},_add_filter:function(t,e){var i=this;t=t+"_field/type="+i.type,acf.add_filter(t,function(t){i.set("$field",t),i[e].apply(i,arguments)})},_add_event:function(e,i){var n=this,a=e.substr(0,e.indexOf(" ")),r=e.substr(e.indexOf(" ")+1),o=acf.get_selector(n.type);t(document).on(a,o+" "+r,function(e){var a=t(this),r=acf.get_closest_field(a,n.type);r.length&&(r.is(n.$field)||n.set("$field",r),e.$el=a,e.$field=r,n[i].apply(n,[e]))})},_set_$field:function(){"function"==typeof this.focus&&this.focus()},doFocus:function(t){return this.set("$field",t)}});var o=acf.newCompatibility(acf.validation,{remove_error:function(t){acf.getField(t).removeError()},add_warning:function(t,e){acf.getField(t).showNotice({text:e,type:"warning",timeout:1e3})},fetch:acf.validateForm,enableSubmit:acf.enableSubmit,disableSubmit:acf.disableSubmit,showSpinner:acf.showSpinner,hideSpinner:acf.hideSpinner,unlockForm:acf.unlockForm,lockForm:acf.lockForm});i.tooltip={tooltip:function(t,e){var i;return acf.newTooltip({text:t,target:e}).$el},temp:function(t,e){var i=acf.newTooltip({text:t,target:e,timeout:250})},confirm:function(t,e,i,n,a){var r=acf.newTooltip({confirm:!0,text:i,target:t,confirm:function(){e(!0)},cancel:function(){e(!1)}})},confirm_remove:function(t,e){var i=acf.newTooltip({confirmRemove:!0,target:t,confirm:function(){e(!0)},cancel:function(){e(!1)}})}},i.media=new acf.Model({activeFrame:!1,actions:{new_media_popup:"onNewMediaPopup"},frame:function(){return this.activeFrame},onNewMediaPopup:function(t){this.activeFrame=t.frame},popup:function(t){var e;return t.mime_types&&(t.allowedTypes=t.mime_types),t.id&&(t.attachment=t.id),acf.newMediaPopup(t).frame}}),i.select2={init:function(t,e,i){return e.allow_null&&(e.allowNull=e.allow_null),e.ajax_action&&(e.ajaxAction=e.ajax_action),i&&(e.field=acf.getField(i)),acf.newSelect2(t,e)},destroy:function(t){return acf.getInstance(t).destroy()}},i.postbox={render:function(t){return t.edit_url&&(t.editLink=t.edit_url),t.edit_title&&(t.editTitle=t.edit_title),acf.newPostbox(t)}},acf.newCompatibility(acf.screen,{update:function(){return this.set.apply(this,arguments)},fetch:acf.screen.check}),i.ajax=acf.screen}(jQuery);
|
includes/acf-field-group-functions.php
CHANGED
@@ -1038,7 +1038,7 @@ function acf_import_field_group( $field_group ) {
|
|
1038 |
|
1039 |
// Only add menu order if doesn't already exist.
|
1040 |
// Allows Flexible Content field to set custom order.
|
1041 |
-
if(
|
1042 |
$field['menu_order'] = ($count[ $field['parent'] ] - 1);
|
1043 |
}
|
1044 |
|
1038 |
|
1039 |
// Only add menu order if doesn't already exist.
|
1040 |
// Allows Flexible Content field to set custom order.
|
1041 |
+
if( !isset($field['menu_order']) ) {
|
1042 |
$field['menu_order'] = ($count[ $field['parent'] ] - 1);
|
1043 |
}
|
1044 |
|
includes/acf-user-functions.php
CHANGED
@@ -33,6 +33,61 @@ function acf_get_users( $args = array() ) {
|
|
33 |
return $users;
|
34 |
}
|
35 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
/**
|
37 |
* acf_allow_unfiltered_html
|
38 |
*
|
33 |
return $users;
|
34 |
}
|
35 |
|
36 |
+
/**
|
37 |
+
* acf_get_user_result
|
38 |
+
*
|
39 |
+
* Returns a result containing "id" and "text" for the given user.
|
40 |
+
*
|
41 |
+
* @date 21/5/19
|
42 |
+
* @since 5.8.1
|
43 |
+
*
|
44 |
+
* @param WP_User $user The user object.
|
45 |
+
* @return array
|
46 |
+
*/
|
47 |
+
function acf_get_user_result( $user ) {
|
48 |
+
|
49 |
+
// Vars.
|
50 |
+
$id = $user->ID;
|
51 |
+
$text = $user->user_login;
|
52 |
+
|
53 |
+
// Add name.
|
54 |
+
if( $user->first_name && $user->last_name ) {
|
55 |
+
$text .= " ({$user->first_name} {$user->last_name})";
|
56 |
+
} elseif( $user->last_name ) {
|
57 |
+
$text .= " ({$user->first_name})";
|
58 |
+
}
|
59 |
+
return compact('id', 'text');
|
60 |
+
}
|
61 |
+
|
62 |
+
|
63 |
+
/**
|
64 |
+
* acf_get_user_role_labels
|
65 |
+
*
|
66 |
+
* Returns an array of user roles in the format "name => label".
|
67 |
+
*
|
68 |
+
* @date 20/5/19
|
69 |
+
* @since 5.8.1
|
70 |
+
*
|
71 |
+
* @param array $roles A specific array of roles.
|
72 |
+
* @return array
|
73 |
+
*/
|
74 |
+
function acf_get_user_role_labels( $roles = array() ) {
|
75 |
+
|
76 |
+
// Load all roles if none provided.
|
77 |
+
if( !$roles ) {
|
78 |
+
$roles = get_editable_roles();
|
79 |
+
}
|
80 |
+
|
81 |
+
// Loop over roles and populare labels.
|
82 |
+
$lables = array();
|
83 |
+
foreach( $roles as $role ) {
|
84 |
+
$lables[ $role ] = translate_user_role( $role );
|
85 |
+
}
|
86 |
+
|
87 |
+
// Return labels.
|
88 |
+
return $lables;
|
89 |
+
}
|
90 |
+
|
91 |
/**
|
92 |
* acf_allow_unfiltered_html
|
93 |
*
|
includes/ajax/class-acf-ajax-check-screen.php
CHANGED
@@ -6,31 +6,30 @@ if( ! class_exists('ACF_Ajax_Check_Screen') ) :
|
|
6 |
|
7 |
class ACF_Ajax_Check_Screen extends ACF_Ajax {
|
8 |
|
9 |
-
/** @var string The AJAX action name */
|
10 |
var $action = 'acf/ajax/check_screen';
|
11 |
|
12 |
-
/** @var bool Prevents access for non-logged in users */
|
13 |
var $public = false;
|
14 |
|
15 |
/**
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
function response() {
|
28 |
|
29 |
// vars
|
30 |
-
$args =
|
31 |
'screen' => '',
|
32 |
'post_id' => 0,
|
33 |
-
'ajax' =>
|
34 |
'exists' => array()
|
35 |
));
|
36 |
|
6 |
|
7 |
class ACF_Ajax_Check_Screen extends ACF_Ajax {
|
8 |
|
9 |
+
/** @var string The AJAX action name. */
|
10 |
var $action = 'acf/ajax/check_screen';
|
11 |
|
12 |
+
/** @var bool Prevents access for non-logged in users. */
|
13 |
var $public = false;
|
14 |
|
15 |
/**
|
16 |
+
* get_response
|
17 |
+
*
|
18 |
+
* Returns the response data to sent back.
|
19 |
+
*
|
20 |
+
* @date 31/7/18
|
21 |
+
* @since 5.7.2
|
22 |
+
*
|
23 |
+
* @param array $request The request args.
|
24 |
+
* @return mixed The response data or WP_Error.
|
25 |
+
*/
|
26 |
+
function get_response( $request ) {
|
|
|
27 |
|
28 |
// vars
|
29 |
+
$args = wp_parse_args($this->request, array(
|
30 |
'screen' => '',
|
31 |
'post_id' => 0,
|
32 |
+
'ajax' => true,
|
33 |
'exists' => array()
|
34 |
));
|
35 |
|
includes/ajax/class-acf-ajax-query-terms.php
DELETED
@@ -1,141 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
if( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
4 |
-
|
5 |
-
if( ! class_exists('ACF_Ajax_Query_Terms') ) :
|
6 |
-
|
7 |
-
class ACF_Ajax_Query_Terms extends ACF_Ajax_Query {
|
8 |
-
|
9 |
-
/** @var string The AJAX action name */
|
10 |
-
var $action = 'acf/ajax/query_terms';
|
11 |
-
|
12 |
-
/**
|
13 |
-
* get_args
|
14 |
-
*
|
15 |
-
* description
|
16 |
-
*
|
17 |
-
* @date 31/7/18
|
18 |
-
* @since 5.7.2
|
19 |
-
*
|
20 |
-
* @param type $var Description. Default.
|
21 |
-
* @return type Description.
|
22 |
-
*/
|
23 |
-
|
24 |
-
function get_args() {
|
25 |
-
|
26 |
-
// defaults
|
27 |
-
$args = wp_parse_args($this->get('query'), array(
|
28 |
-
'taxonomy' => 'category',
|
29 |
-
'search' => $this->search,
|
30 |
-
'number' => $this->per_page,
|
31 |
-
));
|
32 |
-
|
33 |
-
// pagination
|
34 |
-
if( $this->page > 0 ) {
|
35 |
-
$args['offset'] = $this->per_page * ($this->page - 1);
|
36 |
-
}
|
37 |
-
|
38 |
-
// return
|
39 |
-
return $args;
|
40 |
-
}
|
41 |
-
|
42 |
-
/**
|
43 |
-
* get_results
|
44 |
-
*
|
45 |
-
* description
|
46 |
-
*
|
47 |
-
* @date 31/7/18
|
48 |
-
* @since 5.7.2
|
49 |
-
*
|
50 |
-
* @param type $var Description. Default.
|
51 |
-
* @return type Description.
|
52 |
-
*/
|
53 |
-
|
54 |
-
function get_results( $args ) {
|
55 |
-
|
56 |
-
// vars
|
57 |
-
$results = array();
|
58 |
-
|
59 |
-
// get terms
|
60 |
-
$groups = acf_get_grouped_terms( $args );
|
61 |
-
|
62 |
-
// loop
|
63 |
-
if( $groups ) {
|
64 |
-
foreach( $groups as $label => $terms ) {
|
65 |
-
|
66 |
-
// data
|
67 |
-
$data = array(
|
68 |
-
'text' => $label,
|
69 |
-
'children' => array()
|
70 |
-
);
|
71 |
-
|
72 |
-
// convert object to string
|
73 |
-
foreach( $terms as $id => $term ) {
|
74 |
-
$terms[ $id ] = $this->get_result( $term );
|
75 |
-
}
|
76 |
-
|
77 |
-
|
78 |
-
// order posts by search
|
79 |
-
if( $this->search && !isset($args['orderby']) ) {
|
80 |
-
$terms = acf_order_by_search( $terms, $this->search );
|
81 |
-
}
|
82 |
-
|
83 |
-
|
84 |
-
// append to $data
|
85 |
-
foreach( $terms as $id => $text ) {
|
86 |
-
$this->count++;
|
87 |
-
$data['children'][] = array(
|
88 |
-
'id' => $id,
|
89 |
-
'text' => $text
|
90 |
-
);
|
91 |
-
}
|
92 |
-
|
93 |
-
// append to $results
|
94 |
-
$results[] = $data;
|
95 |
-
}}
|
96 |
-
|
97 |
-
|
98 |
-
// extract group children for a single taxonomy
|
99 |
-
$taxonomies = acf_get_array($args['taxonomy']);
|
100 |
-
if( count($taxonomies) == 1 ) {
|
101 |
-
$results = $results[0]['children'];
|
102 |
-
}
|
103 |
-
|
104 |
-
// return
|
105 |
-
return $results;
|
106 |
-
}
|
107 |
-
|
108 |
-
/**
|
109 |
-
* get_result
|
110 |
-
*
|
111 |
-
* description
|
112 |
-
*
|
113 |
-
* @date 31/7/18
|
114 |
-
* @since 5.7.2
|
115 |
-
*
|
116 |
-
* @param type $var Description. Default.
|
117 |
-
* @return type Description.
|
118 |
-
*/
|
119 |
-
|
120 |
-
function get_result( $term ) {
|
121 |
-
|
122 |
-
// vars
|
123 |
-
$title = $term->name;
|
124 |
-
|
125 |
-
// ancestors
|
126 |
-
$ancestors = get_ancestors( $term->term_id, $term->taxonomy );
|
127 |
-
if( $ancestors ) {
|
128 |
-
$prepend = str_repeat('- ', count($ancestors));
|
129 |
-
return $prepend . $title;
|
130 |
-
}
|
131 |
-
|
132 |
-
// return
|
133 |
-
return $title;
|
134 |
-
}
|
135 |
-
}
|
136 |
-
|
137 |
-
acf_new_instance('ACF_AJAX_Query_Terms');
|
138 |
-
|
139 |
-
endif; // class_exists check
|
140 |
-
|
141 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/ajax/class-acf-ajax-query.php
DELETED
@@ -1,133 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
if( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
4 |
-
|
5 |
-
if( ! class_exists('ACF_Ajax_Query') ) :
|
6 |
-
|
7 |
-
class ACF_Ajax_Query extends ACF_Ajax {
|
8 |
-
|
9 |
-
/** @var array The ACF field used for querying */
|
10 |
-
var $field = false;
|
11 |
-
|
12 |
-
/** @var int The page of results to return */
|
13 |
-
var $page = 1;
|
14 |
-
|
15 |
-
/** @var int The number of results per page */
|
16 |
-
var $per_page = 20;
|
17 |
-
|
18 |
-
/** @var string The searched term */
|
19 |
-
var $search = '';
|
20 |
-
|
21 |
-
/** @var int The number of results found */
|
22 |
-
var $count = 0;
|
23 |
-
|
24 |
-
/**
|
25 |
-
* response
|
26 |
-
*
|
27 |
-
* The actual logic for this AJAX request.
|
28 |
-
*
|
29 |
-
* @date 31/7/18
|
30 |
-
* @since 5.7.2
|
31 |
-
*
|
32 |
-
* @param void
|
33 |
-
* @return void
|
34 |
-
*/
|
35 |
-
|
36 |
-
function response() {
|
37 |
-
|
38 |
-
// field
|
39 |
-
if( $this->has('field_key') ) {
|
40 |
-
$this->field = acf_get_field( $this->get('field_key') );
|
41 |
-
}
|
42 |
-
|
43 |
-
// pagination
|
44 |
-
if( $this->has('paged') ) {
|
45 |
-
$this->page = (int) $this->get('paged');
|
46 |
-
}
|
47 |
-
|
48 |
-
// search
|
49 |
-
if( $this->has('s') ) {
|
50 |
-
$this->search = $this->get('s');
|
51 |
-
}
|
52 |
-
|
53 |
-
// get response
|
54 |
-
$args = $this->get_args();
|
55 |
-
$results = $this->get_results($args);
|
56 |
-
$response = $this->get_response($results, $args);
|
57 |
-
|
58 |
-
// return
|
59 |
-
return $response;
|
60 |
-
}
|
61 |
-
|
62 |
-
|
63 |
-
/**
|
64 |
-
* get_args
|
65 |
-
*
|
66 |
-
* description
|
67 |
-
*
|
68 |
-
* @date 31/7/18
|
69 |
-
* @since 5.7.2
|
70 |
-
*
|
71 |
-
* @param type $var Description. Default.
|
72 |
-
* @return type Description.
|
73 |
-
*/
|
74 |
-
|
75 |
-
function get_args() {
|
76 |
-
return array();
|
77 |
-
}
|
78 |
-
|
79 |
-
/**
|
80 |
-
* get_results
|
81 |
-
*
|
82 |
-
* description
|
83 |
-
*
|
84 |
-
* @date 31/7/18
|
85 |
-
* @since 5.7.2
|
86 |
-
*
|
87 |
-
* @param type $var Description. Default.
|
88 |
-
* @return type Description.
|
89 |
-
*/
|
90 |
-
|
91 |
-
function get_results( $args ) {
|
92 |
-
return array();
|
93 |
-
}
|
94 |
-
|
95 |
-
/**
|
96 |
-
* get_result
|
97 |
-
*
|
98 |
-
* description
|
99 |
-
*
|
100 |
-
* @date 31/7/18
|
101 |
-
* @since 5.7.2
|
102 |
-
*
|
103 |
-
* @param type $var Description. Default.
|
104 |
-
* @return type Description.
|
105 |
-
*/
|
106 |
-
|
107 |
-
function get_result( $item ) {
|
108 |
-
return '';
|
109 |
-
}
|
110 |
-
|
111 |
-
/**
|
112 |
-
* get_response
|
113 |
-
*
|
114 |
-
* description
|
115 |
-
*
|
116 |
-
* @date 31/7/18
|
117 |
-
* @since 5.6.9
|
118 |
-
*
|
119 |
-
* @param type $var Description. Default.
|
120 |
-
* @return type Description.
|
121 |
-
*/
|
122 |
-
|
123 |
-
function get_response( $results, $args ) {
|
124 |
-
return array(
|
125 |
-
'results' => $results,
|
126 |
-
'more' => ($this->count >= $this->per_page)
|
127 |
-
);
|
128 |
-
}
|
129 |
-
}
|
130 |
-
|
131 |
-
endif; // class_exists check
|
132 |
-
|
133 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/ajax/class-acf-ajax-upgrade.php
CHANGED
@@ -10,44 +10,41 @@ class ACF_Ajax_Upgrade extends ACF_Ajax {
|
|
10 |
var $action = 'acf/ajax/upgrade';
|
11 |
|
12 |
/**
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
function response() {
|
25 |
|
26 |
-
//
|
27 |
-
if( $
|
28 |
-
switch_to_blog( $
|
29 |
}
|
30 |
|
31 |
-
//
|
32 |
if( !acf_has_upgrade() ) {
|
33 |
return new WP_Error( 'upgrade_error', __('No updates available.', 'acf') );
|
34 |
}
|
35 |
|
36 |
-
//
|
37 |
ob_start();
|
38 |
|
39 |
-
//
|
40 |
acf_upgrade_all();
|
41 |
|
42 |
-
//
|
43 |
$error = ob_get_clean();
|
44 |
|
45 |
-
//
|
46 |
if( $error ) {
|
47 |
return new WP_Error( 'upgrade_error', $error );
|
48 |
}
|
49 |
-
|
50 |
-
// return
|
51 |
return true;
|
52 |
}
|
53 |
}
|
@@ -55,5 +52,3 @@ class ACF_Ajax_Upgrade extends ACF_Ajax {
|
|
55 |
acf_new_instance('ACF_Ajax_Upgrade');
|
56 |
|
57 |
endif; // class_exists check
|
58 |
-
|
59 |
-
?>
|
10 |
var $action = 'acf/ajax/upgrade';
|
11 |
|
12 |
/**
|
13 |
+
* get_response
|
14 |
+
*
|
15 |
+
* Returns the response data to sent back.
|
16 |
+
*
|
17 |
+
* @date 31/7/18
|
18 |
+
* @since 5.7.2
|
19 |
+
*
|
20 |
+
* @param array $request The request args.
|
21 |
+
* @return mixed The response data or WP_Error.
|
22 |
+
*/
|
23 |
+
function get_response( $request ) {
|
|
|
24 |
|
25 |
+
// Switch blog.
|
26 |
+
if( isset($request['blog_id']) ) {
|
27 |
+
switch_to_blog( $request['blog_id'] );
|
28 |
}
|
29 |
|
30 |
+
// Bail early if no upgrade avaiable.
|
31 |
if( !acf_has_upgrade() ) {
|
32 |
return new WP_Error( 'upgrade_error', __('No updates available.', 'acf') );
|
33 |
}
|
34 |
|
35 |
+
// Listen for output.
|
36 |
ob_start();
|
37 |
|
38 |
+
// Run upgrades.
|
39 |
acf_upgrade_all();
|
40 |
|
41 |
+
// Store output.
|
42 |
$error = ob_get_clean();
|
43 |
|
44 |
+
// Return error or success.
|
45 |
if( $error ) {
|
46 |
return new WP_Error( 'upgrade_error', $error );
|
47 |
}
|
|
|
|
|
48 |
return true;
|
49 |
}
|
50 |
}
|
52 |
acf_new_instance('ACF_Ajax_Upgrade');
|
53 |
|
54 |
endif; // class_exists check
|
|
|
|
includes/ajax/class-acf-ajax-user-setting.php
CHANGED
@@ -6,25 +6,24 @@ if( ! class_exists('ACF_Ajax_User_Setting') ) :
|
|
6 |
|
7 |
class ACF_Ajax_User_Setting extends ACF_Ajax {
|
8 |
|
9 |
-
/** @var string The AJAX action name */
|
10 |
var $action = 'acf/ajax/user_setting';
|
11 |
|
12 |
-
/** @var bool Prevents access for non-logged in users */
|
13 |
var $public = true;
|
14 |
|
15 |
/**
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
function response() {
|
28 |
|
29 |
// update
|
30 |
if( $this->has('value') ) {
|
@@ -40,5 +39,3 @@ class ACF_Ajax_User_Setting extends ACF_Ajax {
|
|
40 |
acf_new_instance('ACF_Ajax_User_Setting');
|
41 |
|
42 |
endif; // class_exists check
|
43 |
-
|
44 |
-
?>
|
6 |
|
7 |
class ACF_Ajax_User_Setting extends ACF_Ajax {
|
8 |
|
9 |
+
/** @var string The AJAX action name. */
|
10 |
var $action = 'acf/ajax/user_setting';
|
11 |
|
12 |
+
/** @var bool Prevents access for non-logged in users. */
|
13 |
var $public = true;
|
14 |
|
15 |
/**
|
16 |
+
* get_response
|
17 |
+
*
|
18 |
+
* Returns the response data to sent back.
|
19 |
+
*
|
20 |
+
* @date 31/7/18
|
21 |
+
* @since 5.7.2
|
22 |
+
*
|
23 |
+
* @param array $request The request args.
|
24 |
+
* @return mixed The response data or WP_Error.
|
25 |
+
*/
|
26 |
+
function get_response( $request ) {
|
|
|
27 |
|
28 |
// update
|
29 |
if( $this->has('value') ) {
|
39 |
acf_new_instance('ACF_Ajax_User_Setting');
|
40 |
|
41 |
endif; // class_exists check
|
|
|
|
includes/ajax/class-acf-ajax.php
CHANGED
@@ -6,112 +6,104 @@ if( ! class_exists('ACF_Ajax') ) :
|
|
6 |
|
7 |
class ACF_Ajax {
|
8 |
|
9 |
-
/** @var string The AJAX action name */
|
10 |
var $action = '';
|
11 |
|
12 |
-
/** @var array The $_REQUEST data */
|
13 |
var $request;
|
14 |
|
15 |
-
/** @var bool Prevents access for non-logged in users */
|
16 |
var $public = false;
|
17 |
|
18 |
/**
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
function __construct() {
|
31 |
-
|
32 |
-
// initialize
|
33 |
$this->initialize();
|
34 |
-
|
35 |
-
// add actions
|
36 |
$this->add_actions();
|
37 |
}
|
38 |
|
39 |
/**
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
function initialize() {
|
52 |
-
/* do nothing */
|
53 |
-
}
|
54 |
-
|
55 |
-
/**
|
56 |
-
* has
|
57 |
-
*
|
58 |
-
* Returns true if the request has data for the given key
|
59 |
-
*
|
60 |
-
* @date 31/7/18
|
61 |
-
* @since 5.7.2
|
62 |
-
*
|
63 |
-
* @param string $key The data key
|
64 |
-
* @return boolean
|
65 |
-
*/
|
66 |
-
|
67 |
function has( $key = '' ) {
|
68 |
return isset($this->request[$key]);
|
69 |
}
|
70 |
|
71 |
/**
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
function get( $key = '' ) {
|
84 |
return isset($this->request[$key]) ? $this->request[$key] : null;
|
85 |
}
|
86 |
|
87 |
/**
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
function set( $key = '', $value ) {
|
100 |
$this->request[$key] = $value;
|
|
|
101 |
}
|
102 |
|
103 |
/**
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
|
|
|
|
|
|
114 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
115 |
function add_actions() {
|
116 |
|
117 |
// add action for logged-in users
|
@@ -124,66 +116,63 @@ class ACF_Ajax {
|
|
124 |
}
|
125 |
|
126 |
/**
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
function request() {
|
139 |
|
140 |
-
//
|
141 |
if( !acf_verify_ajax() ) {
|
142 |
wp_send_json_error();
|
143 |
}
|
144 |
|
145 |
-
//
|
146 |
$this->request = wp_unslash($_REQUEST);
|
147 |
|
148 |
-
//
|
149 |
-
$this->send( $this->
|
150 |
}
|
151 |
|
152 |
/**
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
function response() {
|
165 |
return true;
|
166 |
}
|
167 |
|
168 |
/**
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
function send( $response ) {
|
181 |
|
182 |
-
//
|
183 |
if( is_wp_error($response) ) {
|
184 |
wp_send_json_error(array( 'error' => $response->get_error_message() ));
|
185 |
|
186 |
-
//
|
187 |
} else {
|
188 |
wp_send_json_success($response);
|
189 |
}
|
6 |
|
7 |
class ACF_Ajax {
|
8 |
|
9 |
+
/** @var string The AJAX action name. */
|
10 |
var $action = '';
|
11 |
|
12 |
+
/** @var array The $_REQUEST data. */
|
13 |
var $request;
|
14 |
|
15 |
+
/** @var bool Prevents access for non-logged in users. */
|
16 |
var $public = false;
|
17 |
|
18 |
/**
|
19 |
+
* __construct
|
20 |
+
*
|
21 |
+
* Sets up the class functionality.
|
22 |
+
*
|
23 |
+
* @date 31/7/18
|
24 |
+
* @since 5.7.2
|
25 |
+
*
|
26 |
+
* @param void
|
27 |
+
* @return void
|
28 |
+
*/
|
|
|
29 |
function __construct() {
|
|
|
|
|
30 |
$this->initialize();
|
|
|
|
|
31 |
$this->add_actions();
|
32 |
}
|
33 |
|
34 |
/**
|
35 |
+
* has
|
36 |
+
*
|
37 |
+
* Returns true if the request has data for the given key.
|
38 |
+
*
|
39 |
+
* @date 31/7/18
|
40 |
+
* @since 5.7.2
|
41 |
+
*
|
42 |
+
* @param string $key The data key.
|
43 |
+
* @return boolean
|
44 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
function has( $key = '' ) {
|
46 |
return isset($this->request[$key]);
|
47 |
}
|
48 |
|
49 |
/**
|
50 |
+
* get
|
51 |
+
*
|
52 |
+
* Returns request data for the given key.
|
53 |
+
*
|
54 |
+
* @date 31/7/18
|
55 |
+
* @since 5.7.2
|
56 |
+
*
|
57 |
+
* @param string $key The data key.
|
58 |
+
* @return mixed
|
59 |
+
*/
|
|
|
60 |
function get( $key = '' ) {
|
61 |
return isset($this->request[$key]) ? $this->request[$key] : null;
|
62 |
}
|
63 |
|
64 |
/**
|
65 |
+
* set
|
66 |
+
*
|
67 |
+
* Sets request data for the given key.
|
68 |
+
*
|
69 |
+
* @date 31/7/18
|
70 |
+
* @since 5.7.2
|
71 |
+
*
|
72 |
+
* @param string $key The data key.
|
73 |
+
* @param mixed $value The data value.
|
74 |
+
* @return ACF_Ajax
|
75 |
+
*/
|
76 |
function set( $key = '', $value ) {
|
77 |
$this->request[$key] = $value;
|
78 |
+
return $this;
|
79 |
}
|
80 |
|
81 |
/**
|
82 |
+
* initialize
|
83 |
+
*
|
84 |
+
* Allows easy access to modifying properties without changing constructor.
|
85 |
+
*
|
86 |
+
* @date 31/7/18
|
87 |
+
* @since 5.7.2
|
88 |
+
*
|
89 |
+
* @param void
|
90 |
+
* @return void
|
91 |
+
*/
|
92 |
+
function initialize() {
|
93 |
+
/* do nothing */
|
94 |
+
}
|
95 |
|
96 |
+
/**
|
97 |
+
* add_actions
|
98 |
+
*
|
99 |
+
* Adds the ajax actions for this response.
|
100 |
+
*
|
101 |
+
* @date 31/7/18
|
102 |
+
* @since 5.7.2
|
103 |
+
*
|
104 |
+
* @param void
|
105 |
+
* @return void
|
106 |
+
*/
|
107 |
function add_actions() {
|
108 |
|
109 |
// add action for logged-in users
|
116 |
}
|
117 |
|
118 |
/**
|
119 |
+
* request
|
120 |
+
*
|
121 |
+
* Callback for ajax action. Sets up properties and calls the get_response() function.
|
122 |
+
*
|
123 |
+
* @date 1/8/18
|
124 |
+
* @since 5.7.2
|
125 |
+
*
|
126 |
+
* @param void
|
127 |
+
* @return void
|
128 |
+
*/
|
|
|
129 |
function request() {
|
130 |
|
131 |
+
// Verify ajax request
|
132 |
if( !acf_verify_ajax() ) {
|
133 |
wp_send_json_error();
|
134 |
}
|
135 |
|
136 |
+
// Store data for has() and get() functions.
|
137 |
$this->request = wp_unslash($_REQUEST);
|
138 |
|
139 |
+
// Send response.
|
140 |
+
$this->send( $this->get_response( $this->request ) );
|
141 |
}
|
142 |
|
143 |
/**
|
144 |
+
* get_response
|
145 |
+
*
|
146 |
+
* Returns the response data to sent back.
|
147 |
+
*
|
148 |
+
* @date 31/7/18
|
149 |
+
* @since 5.7.2
|
150 |
+
*
|
151 |
+
* @param array $request The request args.
|
152 |
+
* @return mixed The response data or WP_Error.
|
153 |
+
*/
|
154 |
+
function get_response( $request ) {
|
|
|
155 |
return true;
|
156 |
}
|
157 |
|
158 |
/**
|
159 |
+
* send
|
160 |
+
*
|
161 |
+
* Sends back JSON based on the $response as either success or failure.
|
162 |
+
*
|
163 |
+
* @date 31/7/18
|
164 |
+
* @since 5.7.2
|
165 |
+
*
|
166 |
+
* @param mixed $response The response to send back.
|
167 |
+
* @return void
|
168 |
+
*/
|
|
|
169 |
function send( $response ) {
|
170 |
|
171 |
+
// Return error.
|
172 |
if( is_wp_error($response) ) {
|
173 |
wp_send_json_error(array( 'error' => $response->get_error_message() ));
|
174 |
|
175 |
+
// Return success.
|
176 |
} else {
|
177 |
wp_send_json_success($response);
|
178 |
}
|
includes/api/api-helpers.php
CHANGED
@@ -4210,48 +4210,41 @@ function acf_get_post_thumbnail( $post = null, $size = 'thumbnail' ) {
|
|
4210 |
|
4211 |
}
|
4212 |
|
4213 |
-
|
4214 |
-
|
4215 |
-
*
|
4216 |
-
*
|
4217 |
-
*
|
4218 |
-
*
|
4219 |
-
*
|
4220 |
-
*
|
4221 |
-
*
|
4222 |
-
*
|
4223 |
-
|
4224 |
-
* @return (string)
|
4225 |
-
*/
|
4226 |
-
|
4227 |
function acf_get_browser() {
|
4228 |
|
4229 |
-
//
|
4230 |
-
|
4231 |
-
|
4232 |
-
|
4233 |
-
|
4234 |
-
|
4235 |
-
|
4236 |
-
|
4237 |
-
|
4238 |
-
|
4239 |
-
|
4240 |
-
|
4241 |
-
|
4242 |
-
|
4243 |
-
|
4244 |
-
|
4245 |
-
|
4246 |
-
|
4247 |
-
if( strpos($agent, $k) !== false ) return $v;
|
4248 |
-
|
4249 |
}
|
4250 |
|
4251 |
-
|
4252 |
-
// return
|
4253 |
return '';
|
4254 |
-
|
4255 |
}
|
4256 |
|
4257 |
|
@@ -4918,31 +4911,13 @@ function acf_parse_markdown( $text = '' ) {
|
|
4918 |
* @return array
|
4919 |
*/
|
4920 |
function acf_get_sites() {
|
4921 |
-
|
4922 |
-
// vars
|
4923 |
$results = array();
|
4924 |
-
|
4925 |
-
|
4926 |
-
|
4927 |
-
|
4928 |
-
|
4929 |
-
'number' => 0
|
4930 |
-
));
|
4931 |
-
|
4932 |
-
if( $_sites ) {
|
4933 |
-
foreach( $_sites as $_site ) {
|
4934 |
-
$_site = get_site( $_site );
|
4935 |
-
$results[] = $_site->to_array();
|
4936 |
-
}}
|
4937 |
-
|
4938 |
-
// function wp_get_sites() returns in the desired output
|
4939 |
-
} else {
|
4940 |
-
$results = wp_get_sites(array(
|
4941 |
-
'limit' => 0
|
4942 |
-
));
|
4943 |
}
|
4944 |
-
|
4945 |
-
// return
|
4946 |
return $results;
|
4947 |
}
|
4948 |
|
@@ -5063,17 +5038,24 @@ function acf_array_camel_case( $array = array() ) {
|
|
5063 |
}
|
5064 |
|
5065 |
/**
|
5066 |
-
*
|
5067 |
-
*
|
5068 |
-
*
|
5069 |
-
*
|
5070 |
-
*
|
5071 |
-
*
|
5072 |
-
*
|
5073 |
-
*
|
5074 |
-
|
|
|
5075 |
function acf_is_block_editor() {
|
5076 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
5077 |
}
|
5078 |
|
5079 |
?>
|
4210 |
|
4211 |
}
|
4212 |
|
4213 |
+
/**
|
4214 |
+
* acf_get_browser
|
4215 |
+
*
|
4216 |
+
* Returns the name of the current browser.
|
4217 |
+
*
|
4218 |
+
* @date 17/01/2014
|
4219 |
+
* @since 5.0.0
|
4220 |
+
*
|
4221 |
+
* @param void
|
4222 |
+
* @return string
|
4223 |
+
*/
|
|
|
|
|
|
|
4224 |
function acf_get_browser() {
|
4225 |
|
4226 |
+
// Check server var.
|
4227 |
+
if( isset($_SERVER['HTTP_USER_AGENT']) ) {
|
4228 |
+
$agent = $_SERVER['HTTP_USER_AGENT'];
|
4229 |
+
|
4230 |
+
// Loop over search terms.
|
4231 |
+
$browsers = array(
|
4232 |
+
'Firefox' => 'firefox',
|
4233 |
+
'Trident' => 'msie',
|
4234 |
+
'MSIE' => 'msie',
|
4235 |
+
'Edge' => 'edge',
|
4236 |
+
'Chrome' => 'chrome',
|
4237 |
+
'Safari' => 'safari',
|
4238 |
+
);
|
4239 |
+
foreach( $browsers as $k => $v ) {
|
4240 |
+
if( strpos($agent, $k) !== false ) {
|
4241 |
+
return $v;
|
4242 |
+
}
|
4243 |
+
}
|
|
|
|
|
4244 |
}
|
4245 |
|
4246 |
+
// Return default.
|
|
|
4247 |
return '';
|
|
|
4248 |
}
|
4249 |
|
4250 |
|
4911 |
* @return array
|
4912 |
*/
|
4913 |
function acf_get_sites() {
|
|
|
|
|
4914 |
$results = array();
|
4915 |
+
$sites = get_sites( array( 'number' => 0 ) );
|
4916 |
+
if( $sites ) {
|
4917 |
+
foreach( $sites as $site ) {
|
4918 |
+
$results[] = get_site( $site )->to_array();
|
4919 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4920 |
}
|
|
|
|
|
4921 |
return $results;
|
4922 |
}
|
4923 |
|
5038 |
}
|
5039 |
|
5040 |
/**
|
5041 |
+
* acf_is_block_editor
|
5042 |
+
*
|
5043 |
+
* Returns true if the current screen uses the block editor.
|
5044 |
+
*
|
5045 |
+
* @date 13/12/18
|
5046 |
+
* @since 5.8.0
|
5047 |
+
*
|
5048 |
+
* @param void
|
5049 |
+
* @return bool
|
5050 |
+
*/
|
5051 |
function acf_is_block_editor() {
|
5052 |
+
if( function_exists('get_current_screen') ) {
|
5053 |
+
$screen = get_current_screen();
|
5054 |
+
if( method_exists($screen, 'is_block_editor') ) {
|
5055 |
+
return $screen->is_block_editor();
|
5056 |
+
}
|
5057 |
+
}
|
5058 |
+
return false;
|
5059 |
}
|
5060 |
|
5061 |
?>
|
includes/assets.php
CHANGED
@@ -314,7 +314,8 @@ class ACF_Assets {
|
|
314 |
'acf_version' => acf_get_setting('version'),
|
315 |
'browser' => acf_get_browser(),
|
316 |
'locale' => acf_get_locale(),
|
317 |
-
'rtl' => is_rtl()
|
|
|
318 |
));
|
319 |
|
320 |
// get l10n (old)
|
314 |
'acf_version' => acf_get_setting('version'),
|
315 |
'browser' => acf_get_browser(),
|
316 |
'locale' => acf_get_locale(),
|
317 |
+
'rtl' => is_rtl(),
|
318 |
+
'editor' => acf_is_block_editor() ? 'block' : 'classic'
|
319 |
));
|
320 |
|
321 |
// get l10n (old)
|
includes/fields/class-acf-field-image.php
CHANGED
@@ -26,7 +26,7 @@ class acf_field_image extends acf_field {
|
|
26 |
$this->category = 'content';
|
27 |
$this->defaults = array(
|
28 |
'return_format' => 'array',
|
29 |
-
'preview_size' => '
|
30 |
'library' => 'all',
|
31 |
'min_width' => 0,
|
32 |
'min_height' => 0,
|
@@ -202,8 +202,8 @@ class acf_field_image extends acf_field {
|
|
202 |
|
203 |
// return_format
|
204 |
acf_render_field_setting( $field, array(
|
205 |
-
'label' => __('Return
|
206 |
-
'instructions' =>
|
207 |
'type' => 'radio',
|
208 |
'name' => 'return_format',
|
209 |
'layout' => 'horizontal',
|
@@ -218,7 +218,7 @@ class acf_field_image extends acf_field {
|
|
218 |
// preview_size
|
219 |
acf_render_field_setting( $field, array(
|
220 |
'label' => __('Preview Size','acf'),
|
221 |
-
'instructions' =>
|
222 |
'type' => 'select',
|
223 |
'name' => 'preview_size',
|
224 |
'choices' => acf_get_image_sizes()
|
26 |
$this->category = 'content';
|
27 |
$this->defaults = array(
|
28 |
'return_format' => 'array',
|
29 |
+
'preview_size' => 'medium',
|
30 |
'library' => 'all',
|
31 |
'min_width' => 0,
|
32 |
'min_height' => 0,
|
202 |
|
203 |
// return_format
|
204 |
acf_render_field_setting( $field, array(
|
205 |
+
'label' => __('Return Format','acf'),
|
206 |
+
'instructions' => '',
|
207 |
'type' => 'radio',
|
208 |
'name' => 'return_format',
|
209 |
'layout' => 'horizontal',
|
218 |
// preview_size
|
219 |
acf_render_field_setting( $field, array(
|
220 |
'label' => __('Preview Size','acf'),
|
221 |
+
'instructions' => '',
|
222 |
'type' => 'select',
|
223 |
'name' => 'preview_size',
|
224 |
'choices' => acf_get_image_sizes()
|
includes/forms/form-post.php
CHANGED
@@ -77,6 +77,9 @@ class ACF_Form_Post {
|
|
77 |
*/
|
78 |
function add_meta_boxes( $post_type, $post ) {
|
79 |
|
|
|
|
|
|
|
80 |
// Get field groups for this screen.
|
81 |
$field_groups = acf_get_field_groups(array(
|
82 |
'post_id' => $post->ID,
|
@@ -99,22 +102,37 @@ class ACF_Form_Post {
|
|
99 |
}
|
100 |
|
101 |
/**
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
$priority = apply_filters('acf/input/meta_box_priority', $priority, $field_group);
|
111 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
112 |
// Add the meta box.
|
113 |
add_meta_box( $id, $title, array($this, 'render_meta_box'), $post_type, $context, $priority, array('field_group' => $field_group) );
|
|
|
114 |
}
|
115 |
|
116 |
-
//
|
117 |
$this->style = acf_get_field_group_style( $field_groups[0] );
|
|
|
|
|
|
|
|
|
|
|
118 |
}
|
119 |
|
120 |
// remove postcustom metabox (removes expensive SQL query)
|
@@ -188,23 +206,6 @@ class ACF_Form_Post {
|
|
188 |
// Render fields.
|
189 |
$fields = acf_get_fields( $field_group );
|
190 |
acf_render_fields( $fields, $post->ID, 'div', $field_group['instruction_placement'] );
|
191 |
-
|
192 |
-
// Create metabox localized data.
|
193 |
-
$data = array(
|
194 |
-
'id' => $id,
|
195 |
-
'key' => $field_group['key'],
|
196 |
-
'style' => $field_group['style'],
|
197 |
-
'label' => $field_group['label_placement'],
|
198 |
-
'edit' => acf_get_field_group_edit_link( $field_group['ID'] )
|
199 |
-
);
|
200 |
-
|
201 |
-
?>
|
202 |
-
<script type="text/javascript">
|
203 |
-
if( typeof acf !== 'undefined' ) {
|
204 |
-
acf.newPostbox(<?php echo wp_json_encode($data); ?>);
|
205 |
-
}
|
206 |
-
</script>
|
207 |
-
<?php
|
208 |
}
|
209 |
|
210 |
/**
|
77 |
*/
|
78 |
function add_meta_boxes( $post_type, $post ) {
|
79 |
|
80 |
+
// Storage for localized postboxes.
|
81 |
+
$postboxes = array();
|
82 |
+
|
83 |
// Get field groups for this screen.
|
84 |
$field_groups = acf_get_field_groups(array(
|
85 |
'post_id' => $post->ID,
|
102 |
}
|
103 |
|
104 |
/**
|
105 |
+
* Filters the metabox priority.
|
106 |
+
*
|
107 |
+
* @date 23/06/12
|
108 |
+
* @since 3.1.8
|
109 |
+
*
|
110 |
+
* @param string $priority The metabox priority (high, core, default, low).
|
111 |
+
* @param array $field_group The field group array.
|
112 |
+
*/
|
113 |
$priority = apply_filters('acf/input/meta_box_priority', $priority, $field_group);
|
114 |
|
115 |
+
// Localize data
|
116 |
+
$postboxes[] = array(
|
117 |
+
'id' => $id,
|
118 |
+
'key' => $field_group['key'],
|
119 |
+
'style' => $field_group['style'],
|
120 |
+
'label' => $field_group['label_placement'],
|
121 |
+
'edit' => acf_get_field_group_edit_link( $field_group['ID'] )
|
122 |
+
);
|
123 |
+
|
124 |
// Add the meta box.
|
125 |
add_meta_box( $id, $title, array($this, 'render_meta_box'), $post_type, $context, $priority, array('field_group' => $field_group) );
|
126 |
+
|
127 |
}
|
128 |
|
129 |
+
// Set style from first field group.
|
130 |
$this->style = acf_get_field_group_style( $field_groups[0] );
|
131 |
+
|
132 |
+
// Localize postboxes.
|
133 |
+
acf_localize_data(array(
|
134 |
+
'postboxes' => $postboxes
|
135 |
+
));
|
136 |
}
|
137 |
|
138 |
// remove postcustom metabox (removes expensive SQL query)
|
206 |
// Render fields.
|
207 |
$fields = acf_get_fields( $field_group );
|
208 |
acf_render_fields( $fields, $post->ID, 'div', $field_group['instruction_placement'] );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
209 |
}
|
210 |
|
211 |
/**
|
lang/acf-de_DE.mo
CHANGED
Binary file
|
lang/acf-de_DE.po
CHANGED
@@ -2,8 +2,8 @@ msgid ""
|
|
2 |
msgstr ""
|
3 |
"Project-Id-Version: Advanced Custom Fields Pro v5.8\n"
|
4 |
"Report-Msgid-Bugs-To: http://support.advancedcustomfields.com\n"
|
5 |
-
"POT-Creation-Date: 2019-05-
|
6 |
-
"PO-Revision-Date: 2019-05-
|
7 |
"Last-Translator: Ralf Koller <r.koller@gmail.com>\n"
|
8 |
"Language-Team: Ralf Koller <r.koller@gmail.com>\n"
|
9 |
"Language: de_DE\n"
|
@@ -1011,7 +1011,8 @@ msgid ""
|
|
1011 |
"Are you sure you wish to run the updater now?"
|
1012 |
msgstr ""
|
1013 |
"Es wird dringend empfohlen, dass du deine Datenbank sicherst, bevor Du "
|
1014 |
-
"fortfährst. Bist du sicher, dass du jetzt
|
|
|
1015 |
|
1016 |
# @ acf
|
1017 |
#: includes/admin/views/html-admin-page-upgrade-network.php:144
|
@@ -1239,7 +1240,7 @@ msgid ""
|
|
1239 |
msgstr ""
|
1240 |
"ACF PRO enthält leistungsstarke Funktionen wie wiederholbare Daten, Flexible "
|
1241 |
"Inhalte-Layouts, ein wunderschönes Galerie-Feld sowie die Möglichkeit "
|
1242 |
-
"zusätzliche Options-Seiten im Admin-Bereich
|
1243 |
|
1244 |
# @ acf
|
1245 |
#: includes/admin/views/settings-info.php:49
|
@@ -1297,8 +1298,8 @@ msgstr "Gruppen-Feld"
|
|
1297 |
#: includes/admin/views/settings-info.php:75
|
1298 |
msgid "The Group field provides a simple way to create a group of fields."
|
1299 |
msgstr ""
|
1300 |
-
"Das Gruppen-Feld
|
1301 |
-
"
|
1302 |
|
1303 |
# @ acf
|
1304 |
#: includes/admin/views/settings-info.php:79
|
@@ -1461,7 +1462,7 @@ msgstr "Wir glauben Du wirst die Änderungen in %s lieben."
|
|
1461 |
# @ acf
|
1462 |
#: includes/api/api-helpers.php:1003
|
1463 |
msgid "Thumbnail"
|
1464 |
-
msgstr "
|
1465 |
|
1466 |
# @ acf
|
1467 |
#: includes/api/api-helpers.php:1004
|
@@ -3236,7 +3237,7 @@ msgstr "Aktuelle Benutzerrolle"
|
|
3236 |
# @ acf
|
3237 |
#: includes/locations/class-acf-location-current-user-role.php:110
|
3238 |
msgid "Super Admin"
|
3239 |
-
msgstr "Super-
|
3240 |
|
3241 |
# @ acf
|
3242 |
#: includes/locations/class-acf-location-current-user.php:27
|
@@ -3324,17 +3325,17 @@ msgstr "Unterseite (mit übergeordneter Seite)"
|
|
3324 |
# @ acf
|
3325 |
#: includes/locations/class-acf-location-post-category.php:27
|
3326 |
msgid "Post Category"
|
3327 |
-
msgstr "
|
3328 |
|
3329 |
# @ acf
|
3330 |
#: includes/locations/class-acf-location-post-format.php:27
|
3331 |
msgid "Post Format"
|
3332 |
-
msgstr "
|
3333 |
|
3334 |
# @ acf
|
3335 |
#: includes/locations/class-acf-location-post-status.php:27
|
3336 |
msgid "Post Status"
|
3337 |
-
msgstr "
|
3338 |
|
3339 |
# @ acf
|
3340 |
#: includes/locations/class-acf-location-post-taxonomy.php:27
|
@@ -3349,7 +3350,7 @@ msgstr "Beitrags-Template"
|
|
3349 |
# @ acf
|
3350 |
#: includes/locations/class-acf-location-user-form.php:27
|
3351 |
msgid "User Form"
|
3352 |
-
msgstr "
|
3353 |
|
3354 |
# @ acf
|
3355 |
#: includes/locations/class-acf-location-user-form.php:88
|
@@ -3375,7 +3376,7 @@ msgstr "Widget"
|
|
3375 |
#: includes/validation.php:364
|
3376 |
#, php-format
|
3377 |
msgid "%s value is required"
|
3378 |
-
msgstr "%s Wert ist
|
3379 |
|
3380 |
# @ acf
|
3381 |
#. Plugin Name of the plugin/theme
|
@@ -3402,8 +3403,8 @@ msgstr ""
|
|
3402 |
#: pro/admin/admin-updates.php:49
|
3403 |
msgid "<b>Error</b>. Could not connect to update server"
|
3404 |
msgstr ""
|
3405 |
-
"<b>Fehler</b>. Es konnte keine Verbindung zum
|
3406 |
-
"werden"
|
3407 |
|
3408 |
# @ acf
|
3409 |
#: pro/admin/admin-updates.php:118 pro/admin/views/html-settings-updates.php:13
|
@@ -3415,8 +3416,9 @@ msgid ""
|
|
3415 |
"<b>Error</b>. Could not authenticate update package. Please check again or "
|
3416 |
"deactivate and reactivate your ACF PRO license."
|
3417 |
msgstr ""
|
3418 |
-
"<b>Fehler</b>. Das
|
3419 |
-
"probiere es nochmal oder deaktiviere und reaktiviere deine ACF PRO-
|
|
|
3420 |
|
3421 |
# @ acf
|
3422 |
#: pro/admin/views/html-settings-updates.php:7
|
@@ -3439,10 +3441,10 @@ msgid ""
|
|
3439 |
"licence key, please see <a href=\"%s\" target=\"_blank\">details & pricing</"
|
3440 |
"a>."
|
3441 |
msgstr ""
|
3442 |
-
"Um die
|
3443 |
-
"ein. Falls Du keinen besitzen solltest informiere Dich bitte
|
3444 |
-
"hinsichtlich <a href=\"%s\" target=\"_blank\">Preisen und aller
|
3445 |
-
"Details</a>."
|
3446 |
|
3447 |
# @ acf
|
3448 |
#: pro/admin/views/html-settings-updates.php:29
|
@@ -3478,7 +3480,7 @@ msgstr "Plugin aktualisieren"
|
|
3478 |
#: pro/admin/views/html-settings-updates.php:94
|
3479 |
msgid "Please enter your license key above to unlock updates"
|
3480 |
msgstr ""
|
3481 |
-
"Bitte gib oben Deinen Lizenzschlüssel ein um die
|
3482 |
"freizuschalten"
|
3483 |
|
3484 |
# @ acf
|
@@ -3489,7 +3491,7 @@ msgstr "Erneut suchen"
|
|
3489 |
# @ acf
|
3490 |
#: pro/admin/views/html-settings-updates.php:117
|
3491 |
msgid "Upgrade Notice"
|
3492 |
-
msgstr "
|
3493 |
|
3494 |
#: pro/blocks.php:371
|
3495 |
msgid "Switch to Edit"
|
@@ -3824,10 +3826,10 @@ msgid ""
|
|
3824 |
"\">Updates</a> page. If you don't have a licence key, please see <a href=\"%s"
|
3825 |
"\">details & pricing</a>."
|
3826 |
msgstr ""
|
3827 |
-
"Um die
|
3828 |
-
"der <a href=\"%s\">Aktualisierungen</a> Seite ein. Falls
|
3829 |
-
"informiere Dich bitte hier hinsichtlich der <a href=\"%s\"
|
3830 |
-
"\">Preise und Einzelheiten</a>."
|
3831 |
|
3832 |
#: tests/basic/test-blocks.php:13
|
3833 |
msgid "Testimonial"
|
@@ -3837,6 +3839,15 @@ msgstr "Testimonial"
|
|
3837 |
msgid "A custom testimonial block."
|
3838 |
msgstr "Ein individueller Testimonial-Block."
|
3839 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3840 |
#. Plugin URI of the plugin/theme
|
3841 |
msgid "https://www.advancedcustomfields.com/"
|
3842 |
msgstr "https://www.advancedcustomfields.com/"
|
2 |
msgstr ""
|
3 |
"Project-Id-Version: Advanced Custom Fields Pro v5.8\n"
|
4 |
"Report-Msgid-Bugs-To: http://support.advancedcustomfields.com\n"
|
5 |
+
"POT-Creation-Date: 2019-05-09 15:51+0200\n"
|
6 |
+
"PO-Revision-Date: 2019-05-09 17:23+0200\n"
|
7 |
"Last-Translator: Ralf Koller <r.koller@gmail.com>\n"
|
8 |
"Language-Team: Ralf Koller <r.koller@gmail.com>\n"
|
9 |
"Language: de_DE\n"
|
1011 |
"Are you sure you wish to run the updater now?"
|
1012 |
msgstr ""
|
1013 |
"Es wird dringend empfohlen, dass du deine Datenbank sicherst, bevor Du "
|
1014 |
+
"fortfährst. Bist du sicher, dass du jetzt die Aktualisierung durchführen "
|
1015 |
+
"willst?"
|
1016 |
|
1017 |
# @ acf
|
1018 |
#: includes/admin/views/html-admin-page-upgrade-network.php:144
|
1240 |
msgstr ""
|
1241 |
"ACF PRO enthält leistungsstarke Funktionen wie wiederholbare Daten, Flexible "
|
1242 |
"Inhalte-Layouts, ein wunderschönes Galerie-Feld sowie die Möglichkeit "
|
1243 |
+
"zusätzliche Options-Seiten im Admin-Bereich zu erstellen!"
|
1244 |
|
1245 |
# @ acf
|
1246 |
#: includes/admin/views/settings-info.php:49
|
1298 |
#: includes/admin/views/settings-info.php:75
|
1299 |
msgid "The Group field provides a simple way to create a group of fields."
|
1300 |
msgstr ""
|
1301 |
+
"Das Gruppen-Feld bietet einen einfachen Weg eine Gruppe von Feldern zu "
|
1302 |
+
"erstellen."
|
1303 |
|
1304 |
# @ acf
|
1305 |
#: includes/admin/views/settings-info.php:79
|
1462 |
# @ acf
|
1463 |
#: includes/api/api-helpers.php:1003
|
1464 |
msgid "Thumbnail"
|
1465 |
+
msgstr "Vorschaubild"
|
1466 |
|
1467 |
# @ acf
|
1468 |
#: includes/api/api-helpers.php:1004
|
3237 |
# @ acf
|
3238 |
#: includes/locations/class-acf-location-current-user-role.php:110
|
3239 |
msgid "Super Admin"
|
3240 |
+
msgstr "Super-Administrator"
|
3241 |
|
3242 |
# @ acf
|
3243 |
#: includes/locations/class-acf-location-current-user.php:27
|
3325 |
# @ acf
|
3326 |
#: includes/locations/class-acf-location-post-category.php:27
|
3327 |
msgid "Post Category"
|
3328 |
+
msgstr "Beitragskategorie"
|
3329 |
|
3330 |
# @ acf
|
3331 |
#: includes/locations/class-acf-location-post-format.php:27
|
3332 |
msgid "Post Format"
|
3333 |
+
msgstr "Beitragsformat"
|
3334 |
|
3335 |
# @ acf
|
3336 |
#: includes/locations/class-acf-location-post-status.php:27
|
3337 |
msgid "Post Status"
|
3338 |
+
msgstr "Beitragsstatus"
|
3339 |
|
3340 |
# @ acf
|
3341 |
#: includes/locations/class-acf-location-post-taxonomy.php:27
|
3350 |
# @ acf
|
3351 |
#: includes/locations/class-acf-location-user-form.php:27
|
3352 |
msgid "User Form"
|
3353 |
+
msgstr "Benutzerformular"
|
3354 |
|
3355 |
# @ acf
|
3356 |
#: includes/locations/class-acf-location-user-form.php:88
|
3376 |
#: includes/validation.php:364
|
3377 |
#, php-format
|
3378 |
msgid "%s value is required"
|
3379 |
+
msgstr "%s Wert ist erforderlich"
|
3380 |
|
3381 |
# @ acf
|
3382 |
#. Plugin Name of the plugin/theme
|
3403 |
#: pro/admin/admin-updates.php:49
|
3404 |
msgid "<b>Error</b>. Could not connect to update server"
|
3405 |
msgstr ""
|
3406 |
+
"<b>Fehler</b>. Es konnte keine Verbindung zum Aktualisierungsserver "
|
3407 |
+
"hergestellt werden"
|
3408 |
|
3409 |
# @ acf
|
3410 |
#: pro/admin/admin-updates.php:118 pro/admin/views/html-settings-updates.php:13
|
3416 |
"<b>Error</b>. Could not authenticate update package. Please check again or "
|
3417 |
"deactivate and reactivate your ACF PRO license."
|
3418 |
msgstr ""
|
3419 |
+
"<b>Fehler</b>. Das Aktualisierungspaket konnte nicht authentifiziert werden. "
|
3420 |
+
"Bitte probiere es nochmal oder deaktiviere und reaktiviere deine ACF PRO-"
|
3421 |
+
"Lizenz."
|
3422 |
|
3423 |
# @ acf
|
3424 |
#: pro/admin/views/html-settings-updates.php:7
|
3441 |
"licence key, please see <a href=\"%s\" target=\"_blank\">details & pricing</"
|
3442 |
"a>."
|
3443 |
msgstr ""
|
3444 |
+
"Um die Aktualisierungsfähigkeit freizuschalten gib bitte unten Deinen "
|
3445 |
+
"Lizenzschlüssel ein. Falls Du keinen besitzen solltest informiere Dich bitte "
|
3446 |
+
"hier hinsichtlich <a href=\"%s\" target=\"_blank\">Preisen und aller "
|
3447 |
+
"weiteren Details</a>."
|
3448 |
|
3449 |
# @ acf
|
3450 |
#: pro/admin/views/html-settings-updates.php:29
|
3480 |
#: pro/admin/views/html-settings-updates.php:94
|
3481 |
msgid "Please enter your license key above to unlock updates"
|
3482 |
msgstr ""
|
3483 |
+
"Bitte gib oben Deinen Lizenzschlüssel ein um die Aktualisierungsfähigkeit "
|
3484 |
"freizuschalten"
|
3485 |
|
3486 |
# @ acf
|
3491 |
# @ acf
|
3492 |
#: pro/admin/views/html-settings-updates.php:117
|
3493 |
msgid "Upgrade Notice"
|
3494 |
+
msgstr "Hinweis zum Upgrade"
|
3495 |
|
3496 |
#: pro/blocks.php:371
|
3497 |
msgid "Switch to Edit"
|
3826 |
"\">Updates</a> page. If you don't have a licence key, please see <a href=\"%s"
|
3827 |
"\">details & pricing</a>."
|
3828 |
msgstr ""
|
3829 |
+
"Um die Aktualisierungsfähigkeit freizuschalten gib bitte Deinen "
|
3830 |
+
"Lizenzschlüssel auf der <a href=\"%s\">Aktualisierungen</a> Seite ein. Falls "
|
3831 |
+
"Du keinen besitzt informiere Dich bitte hier hinsichtlich der <a href=\"%s\" "
|
3832 |
+
"target=\"_blank\">Preise und Einzelheiten</a>."
|
3833 |
|
3834 |
#: tests/basic/test-blocks.php:13
|
3835 |
msgid "Testimonial"
|
3839 |
msgid "A custom testimonial block."
|
3840 |
msgstr "Ein individueller Testimonial-Block."
|
3841 |
|
3842 |
+
#: tests/basic/test-blocks.php:40
|
3843 |
+
msgid "Slider"
|
3844 |
+
msgstr "Slider"
|
3845 |
+
|
3846 |
+
# @ acf
|
3847 |
+
#: tests/basic/test-blocks.php:41
|
3848 |
+
msgid "A custom gallery slider."
|
3849 |
+
msgstr "Ein individueller Galerie-Slider."
|
3850 |
+
|
3851 |
#. Plugin URI of the plugin/theme
|
3852 |
msgid "https://www.advancedcustomfields.com/"
|
3853 |
msgstr "https://www.advancedcustomfields.com/"
|
lang/acf-de_DE_formal.mo
CHANGED
Binary file
|
lang/acf-de_DE_formal.po
CHANGED
@@ -2,8 +2,8 @@ msgid ""
|
|
2 |
msgstr ""
|
3 |
"Project-Id-Version: Advanced Custom Fields Pro v5.8 Formal\n"
|
4 |
"Report-Msgid-Bugs-To: http://support.advancedcustomfields.com\n"
|
5 |
-
"POT-Creation-Date: 2019-05-
|
6 |
-
"PO-Revision-Date: 2019-05-
|
7 |
"Last-Translator: Ralf Koller <r.koller@gmail.com>\n"
|
8 |
"Language-Team: Ralf Koller <r.koller@gmail.com>\n"
|
9 |
"Language: de_DE\n"
|
@@ -1011,7 +1011,8 @@ msgid ""
|
|
1011 |
"Are you sure you wish to run the updater now?"
|
1012 |
msgstr ""
|
1013 |
"Es wird dringend empfohlen, dass Sie ihre Datenbank sichern, bevor Sie "
|
1014 |
-
"fortfahren. Sind sie sicher, dass Sie jetzt
|
|
|
1015 |
|
1016 |
# @ acf
|
1017 |
#: includes/admin/views/html-admin-page-upgrade-network.php:144
|
@@ -1239,7 +1240,7 @@ msgid ""
|
|
1239 |
msgstr ""
|
1240 |
"ACF PRO enthält leistungsstarke Funktionen wie wiederholbare Daten, Flexible "
|
1241 |
"Inhalte-Layouts, ein wunderschönes Galerie-Feld sowie die Möglichkeit "
|
1242 |
-
"zusätzliche Options-Seiten im Admin-Bereich
|
1243 |
|
1244 |
# @ acf
|
1245 |
#: includes/admin/views/settings-info.php:49
|
@@ -1297,8 +1298,8 @@ msgstr "Gruppen-Feld"
|
|
1297 |
#: includes/admin/views/settings-info.php:75
|
1298 |
msgid "The Group field provides a simple way to create a group of fields."
|
1299 |
msgstr ""
|
1300 |
-
"Das Gruppen-Feld
|
1301 |
-
"
|
1302 |
|
1303 |
# @ acf
|
1304 |
#: includes/admin/views/settings-info.php:79
|
@@ -1461,7 +1462,7 @@ msgstr "Wir glauben Sie werden die Änderungen in %s lieben."
|
|
1461 |
# @ acf
|
1462 |
#: includes/api/api-helpers.php:1003
|
1463 |
msgid "Thumbnail"
|
1464 |
-
msgstr "
|
1465 |
|
1466 |
# @ acf
|
1467 |
#: includes/api/api-helpers.php:1004
|
@@ -3237,7 +3238,7 @@ msgstr "Aktuelle Benutzerrolle"
|
|
3237 |
# @ acf
|
3238 |
#: includes/locations/class-acf-location-current-user-role.php:110
|
3239 |
msgid "Super Admin"
|
3240 |
-
msgstr "Super-
|
3241 |
|
3242 |
# @ acf
|
3243 |
#: includes/locations/class-acf-location-current-user.php:27
|
@@ -3325,17 +3326,17 @@ msgstr "Unterseite (mit übergeordneter Seite)"
|
|
3325 |
# @ acf
|
3326 |
#: includes/locations/class-acf-location-post-category.php:27
|
3327 |
msgid "Post Category"
|
3328 |
-
msgstr "
|
3329 |
|
3330 |
# @ acf
|
3331 |
#: includes/locations/class-acf-location-post-format.php:27
|
3332 |
msgid "Post Format"
|
3333 |
-
msgstr "
|
3334 |
|
3335 |
# @ acf
|
3336 |
#: includes/locations/class-acf-location-post-status.php:27
|
3337 |
msgid "Post Status"
|
3338 |
-
msgstr "
|
3339 |
|
3340 |
# @ acf
|
3341 |
#: includes/locations/class-acf-location-post-taxonomy.php:27
|
@@ -3350,7 +3351,7 @@ msgstr "Beitrags-Template"
|
|
3350 |
# @ acf
|
3351 |
#: includes/locations/class-acf-location-user-form.php:27
|
3352 |
msgid "User Form"
|
3353 |
-
msgstr "
|
3354 |
|
3355 |
# @ acf
|
3356 |
#: includes/locations/class-acf-location-user-form.php:88
|
@@ -3376,7 +3377,7 @@ msgstr "Widget"
|
|
3376 |
#: includes/validation.php:364
|
3377 |
#, php-format
|
3378 |
msgid "%s value is required"
|
3379 |
-
msgstr "%s Wert ist
|
3380 |
|
3381 |
# @ acf
|
3382 |
#. Plugin Name of the plugin/theme
|
@@ -3403,8 +3404,8 @@ msgstr ""
|
|
3403 |
#: pro/admin/admin-updates.php:49
|
3404 |
msgid "<b>Error</b>. Could not connect to update server"
|
3405 |
msgstr ""
|
3406 |
-
"<b>Fehler</b>. Es konnte keine Verbindung zum
|
3407 |
-
"werden"
|
3408 |
|
3409 |
# @ acf
|
3410 |
#: pro/admin/admin-updates.php:118 pro/admin/views/html-settings-updates.php:13
|
@@ -3416,9 +3417,9 @@ msgid ""
|
|
3416 |
"<b>Error</b>. Could not authenticate update package. Please check again or "
|
3417 |
"deactivate and reactivate your ACF PRO license."
|
3418 |
msgstr ""
|
3419 |
-
"<b>Fehler</b>. Das
|
3420 |
-
"probieren Sie es nochmal oder deaktivieren und reaktivieren Sie ihre
|
3421 |
-
"Lizenz."
|
3422 |
|
3423 |
# @ acf
|
3424 |
#: pro/admin/views/html-settings-updates.php:7
|
@@ -3441,7 +3442,7 @@ msgid ""
|
|
3441 |
"licence key, please see <a href=\"%s\" target=\"_blank\">details & pricing</"
|
3442 |
"a>."
|
3443 |
msgstr ""
|
3444 |
-
"Um die
|
3445 |
"Lizenzschlüssel ein. Falls Sie keinen besitzen sollten informieren Sie sich "
|
3446 |
"bitte hier hinsichtlich <a href=\"%s\" target=\"_blank\">Preisen und aller "
|
3447 |
"weiteren Details</a>."
|
@@ -3480,8 +3481,8 @@ msgstr "Plugin aktualisieren"
|
|
3480 |
#: pro/admin/views/html-settings-updates.php:94
|
3481 |
msgid "Please enter your license key above to unlock updates"
|
3482 |
msgstr ""
|
3483 |
-
"Bitte geben Sie oben Ihren Lizenzschlüssel ein um die
|
3484 |
-
"freizuschalten"
|
3485 |
|
3486 |
# @ acf
|
3487 |
#: pro/admin/views/html-settings-updates.php:100
|
@@ -3491,7 +3492,7 @@ msgstr "Erneut suchen"
|
|
3491 |
# @ acf
|
3492 |
#: pro/admin/views/html-settings-updates.php:117
|
3493 |
msgid "Upgrade Notice"
|
3494 |
-
msgstr "
|
3495 |
|
3496 |
#: pro/blocks.php:371
|
3497 |
msgid "Switch to Edit"
|
@@ -3826,10 +3827,10 @@ msgid ""
|
|
3826 |
"\">Updates</a> page. If you don't have a licence key, please see <a href=\"%s"
|
3827 |
"\">details & pricing</a>."
|
3828 |
msgstr ""
|
3829 |
-
"Um die
|
3830 |
-
"auf der <a href=\"%s\">Aktualisierungen</a> Seite ein. Falls
|
3831 |
-
"besitzen informieren Sie sich bitte hier hinsichtlich der <a href
|
3832 |
-
"target=\"_blank\">Preise und Einzelheiten</a>."
|
3833 |
|
3834 |
#: tests/basic/test-blocks.php:13
|
3835 |
msgid "Testimonial"
|
@@ -3839,6 +3840,15 @@ msgstr "Testimonial"
|
|
3839 |
msgid "A custom testimonial block."
|
3840 |
msgstr "Ein individueller Testimonial-Block."
|
3841 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3842 |
#. Plugin URI of the plugin/theme
|
3843 |
msgid "https://www.advancedcustomfields.com/"
|
3844 |
msgstr "https://www.advancedcustomfields.com/"
|
2 |
msgstr ""
|
3 |
"Project-Id-Version: Advanced Custom Fields Pro v5.8 Formal\n"
|
4 |
"Report-Msgid-Bugs-To: http://support.advancedcustomfields.com\n"
|
5 |
+
"POT-Creation-Date: 2019-05-09 15:54+0200\n"
|
6 |
+
"PO-Revision-Date: 2019-05-09 17:23+0200\n"
|
7 |
"Last-Translator: Ralf Koller <r.koller@gmail.com>\n"
|
8 |
"Language-Team: Ralf Koller <r.koller@gmail.com>\n"
|
9 |
"Language: de_DE\n"
|
1011 |
"Are you sure you wish to run the updater now?"
|
1012 |
msgstr ""
|
1013 |
"Es wird dringend empfohlen, dass Sie ihre Datenbank sichern, bevor Sie "
|
1014 |
+
"fortfahren. Sind sie sicher, dass Sie jetzt die Aktualisierung durchführen "
|
1015 |
+
"wollen?"
|
1016 |
|
1017 |
# @ acf
|
1018 |
#: includes/admin/views/html-admin-page-upgrade-network.php:144
|
1240 |
msgstr ""
|
1241 |
"ACF PRO enthält leistungsstarke Funktionen wie wiederholbare Daten, Flexible "
|
1242 |
"Inhalte-Layouts, ein wunderschönes Galerie-Feld sowie die Möglichkeit "
|
1243 |
+
"zusätzliche Options-Seiten im Admin-Bereich zu erstellen!"
|
1244 |
|
1245 |
# @ acf
|
1246 |
#: includes/admin/views/settings-info.php:49
|
1298 |
#: includes/admin/views/settings-info.php:75
|
1299 |
msgid "The Group field provides a simple way to create a group of fields."
|
1300 |
msgstr ""
|
1301 |
+
"Das Gruppen-Feld bietet einen einfachen Weg eine Gruppe von Feldern zu "
|
1302 |
+
"erstellen."
|
1303 |
|
1304 |
# @ acf
|
1305 |
#: includes/admin/views/settings-info.php:79
|
1462 |
# @ acf
|
1463 |
#: includes/api/api-helpers.php:1003
|
1464 |
msgid "Thumbnail"
|
1465 |
+
msgstr "Vorschaubild"
|
1466 |
|
1467 |
# @ acf
|
1468 |
#: includes/api/api-helpers.php:1004
|
3238 |
# @ acf
|
3239 |
#: includes/locations/class-acf-location-current-user-role.php:110
|
3240 |
msgid "Super Admin"
|
3241 |
+
msgstr "Super-Administrator"
|
3242 |
|
3243 |
# @ acf
|
3244 |
#: includes/locations/class-acf-location-current-user.php:27
|
3326 |
# @ acf
|
3327 |
#: includes/locations/class-acf-location-post-category.php:27
|
3328 |
msgid "Post Category"
|
3329 |
+
msgstr "Beitragskategorie"
|
3330 |
|
3331 |
# @ acf
|
3332 |
#: includes/locations/class-acf-location-post-format.php:27
|
3333 |
msgid "Post Format"
|
3334 |
+
msgstr "Beitragsformat"
|
3335 |
|
3336 |
# @ acf
|
3337 |
#: includes/locations/class-acf-location-post-status.php:27
|
3338 |
msgid "Post Status"
|
3339 |
+
msgstr "Beitragsstatus"
|
3340 |
|
3341 |
# @ acf
|
3342 |
#: includes/locations/class-acf-location-post-taxonomy.php:27
|
3351 |
# @ acf
|
3352 |
#: includes/locations/class-acf-location-user-form.php:27
|
3353 |
msgid "User Form"
|
3354 |
+
msgstr "Benutzerformular"
|
3355 |
|
3356 |
# @ acf
|
3357 |
#: includes/locations/class-acf-location-user-form.php:88
|
3377 |
#: includes/validation.php:364
|
3378 |
#, php-format
|
3379 |
msgid "%s value is required"
|
3380 |
+
msgstr "%s Wert ist erforderlich"
|
3381 |
|
3382 |
# @ acf
|
3383 |
#. Plugin Name of the plugin/theme
|
3404 |
#: pro/admin/admin-updates.php:49
|
3405 |
msgid "<b>Error</b>. Could not connect to update server"
|
3406 |
msgstr ""
|
3407 |
+
"<b>Fehler</b>. Es konnte keine Verbindung zum Aktualisierungsserver "
|
3408 |
+
"hergestellt werden"
|
3409 |
|
3410 |
# @ acf
|
3411 |
#: pro/admin/admin-updates.php:118 pro/admin/views/html-settings-updates.php:13
|
3417 |
"<b>Error</b>. Could not authenticate update package. Please check again or "
|
3418 |
"deactivate and reactivate your ACF PRO license."
|
3419 |
msgstr ""
|
3420 |
+
"<b>Fehler</b>. Das Aktualisierungspaket konnte nicht authentifiziert werden. "
|
3421 |
+
"Bitte probieren Sie es nochmal oder deaktivieren und reaktivieren Sie ihre "
|
3422 |
+
"ACF PRO-Lizenz."
|
3423 |
|
3424 |
# @ acf
|
3425 |
#: pro/admin/views/html-settings-updates.php:7
|
3442 |
"licence key, please see <a href=\"%s\" target=\"_blank\">details & pricing</"
|
3443 |
"a>."
|
3444 |
msgstr ""
|
3445 |
+
"Um die Aktualisierungsfähigkeit freizuschalten geben Sie bitte unten Ihren "
|
3446 |
"Lizenzschlüssel ein. Falls Sie keinen besitzen sollten informieren Sie sich "
|
3447 |
"bitte hier hinsichtlich <a href=\"%s\" target=\"_blank\">Preisen und aller "
|
3448 |
"weiteren Details</a>."
|
3481 |
#: pro/admin/views/html-settings-updates.php:94
|
3482 |
msgid "Please enter your license key above to unlock updates"
|
3483 |
msgstr ""
|
3484 |
+
"Bitte geben Sie oben Ihren Lizenzschlüssel ein um die "
|
3485 |
+
"Aktualisierungsfähigkeit freizuschalten"
|
3486 |
|
3487 |
# @ acf
|
3488 |
#: pro/admin/views/html-settings-updates.php:100
|
3492 |
# @ acf
|
3493 |
#: pro/admin/views/html-settings-updates.php:117
|
3494 |
msgid "Upgrade Notice"
|
3495 |
+
msgstr "Hinweis zum Upgrade"
|
3496 |
|
3497 |
#: pro/blocks.php:371
|
3498 |
msgid "Switch to Edit"
|
3827 |
"\">Updates</a> page. If you don't have a licence key, please see <a href=\"%s"
|
3828 |
"\">details & pricing</a>."
|
3829 |
msgstr ""
|
3830 |
+
"Um die Aktualisierungsfähigkeit freizuschalten geben Sie bitte Ihren "
|
3831 |
+
"Lizenzschlüssel auf der <a href=\"%s\">Aktualisierungen</a> Seite ein. Falls "
|
3832 |
+
"Sie keinen besitzen informieren Sie sich bitte hier hinsichtlich der <a href="
|
3833 |
+
"\"%s\" target=\"_blank\">Preise und Einzelheiten</a>."
|
3834 |
|
3835 |
#: tests/basic/test-blocks.php:13
|
3836 |
msgid "Testimonial"
|
3840 |
msgid "A custom testimonial block."
|
3841 |
msgstr "Ein individueller Testimonial-Block."
|
3842 |
|
3843 |
+
#: tests/basic/test-blocks.php:40
|
3844 |
+
msgid "Slider"
|
3845 |
+
msgstr "Slider"
|
3846 |
+
|
3847 |
+
# @ acf
|
3848 |
+
#: tests/basic/test-blocks.php:41
|
3849 |
+
msgid "A custom gallery slider."
|
3850 |
+
msgstr "Ein individueller Galerie-Slider."
|
3851 |
+
|
3852 |
#. Plugin URI of the plugin/theme
|
3853 |
msgid "https://www.advancedcustomfields.com/"
|
3854 |
msgstr "https://www.advancedcustomfields.com/"
|
lang/acf-fa_IR.mo
CHANGED
Binary file
|
lang/acf-fa_IR.po
CHANGED
@@ -2,8 +2,8 @@ msgid ""
|
|
2 |
msgstr ""
|
3 |
"Project-Id-Version: Advanced Custom Fields Pro v5.7.11\n"
|
4 |
"Report-Msgid-Bugs-To: http://support.advancedcustomfields.com\n"
|
5 |
-
"POT-Creation-Date: 2019-
|
6 |
-
"PO-Revision-Date: 2019-
|
7 |
"Last-Translator: Elliot Condon <e@elliotcondon.com>\n"
|
8 |
"Language-Team: Majix <mimapien@gmail.com>\n"
|
9 |
"Language: fa\n"
|
@@ -26,102 +26,102 @@ msgstr ""
|
|
26 |
msgid "Advanced Custom Fields"
|
27 |
msgstr "زمینههای سفارشی پیشرفته"
|
28 |
|
29 |
-
#: acf.php:
|
30 |
msgid "Field Groups"
|
31 |
msgstr "گروههای زمینه"
|
32 |
|
33 |
-
#: acf.php:
|
34 |
msgid "Field Group"
|
35 |
msgstr "گروه زمینه"
|
36 |
|
37 |
-
#: acf.php:
|
38 |
-
#: pro/fields/class-acf-field-flexible-content.php:
|
39 |
msgid "Add New"
|
40 |
msgstr "افزودن"
|
41 |
|
42 |
-
#: acf.php:
|
43 |
msgid "Add New Field Group"
|
44 |
msgstr "افزودن گروه زمینه جدید"
|
45 |
|
46 |
-
#: acf.php:
|
47 |
msgid "Edit Field Group"
|
48 |
msgstr "ویرایش گروه زمینه"
|
49 |
|
50 |
-
#: acf.php:
|
51 |
msgid "New Field Group"
|
52 |
msgstr "گروه زمینه جدید"
|
53 |
|
54 |
-
#: acf.php:
|
55 |
msgid "View Field Group"
|
56 |
msgstr "مشاهده گروه زمینه"
|
57 |
|
58 |
-
#: acf.php:
|
59 |
msgid "Search Field Groups"
|
60 |
msgstr "جستجوی گروه های زمینه"
|
61 |
|
62 |
-
#: acf.php:
|
63 |
msgid "No Field Groups found"
|
64 |
msgstr "گروه زمینه ای یافت نشد"
|
65 |
|
66 |
-
#: acf.php:
|
67 |
msgid "No Field Groups found in Trash"
|
68 |
msgstr "گروه زمینه ای در زباله دان یافت نشد"
|
69 |
|
70 |
-
#: acf.php:
|
71 |
#: includes/admin/admin-field-groups.php:530
|
72 |
#: pro/fields/class-acf-field-clone.php:811
|
73 |
msgid "Fields"
|
74 |
msgstr "زمینه ها"
|
75 |
|
76 |
-
#: acf.php:
|
77 |
msgid "Field"
|
78 |
msgstr "زمینه"
|
79 |
|
80 |
-
#: acf.php:
|
81 |
msgid "Add New Field"
|
82 |
msgstr "زمینه جدید"
|
83 |
|
84 |
-
#: acf.php:
|
85 |
msgid "Edit Field"
|
86 |
msgstr "ویرایش زمینه"
|
87 |
|
88 |
-
#: acf.php:
|
89 |
msgid "New Field"
|
90 |
msgstr "زمینه جدید"
|
91 |
|
92 |
-
#: acf.php:
|
93 |
msgid "View Field"
|
94 |
msgstr "نمایش زمینه"
|
95 |
|
96 |
-
#: acf.php:
|
97 |
msgid "Search Fields"
|
98 |
msgstr "جستجوی گروه های زمینه"
|
99 |
|
100 |
-
#: acf.php:
|
101 |
msgid "No Fields found"
|
102 |
msgstr "گروه زمینه ای یافت نشد"
|
103 |
|
104 |
-
#: acf.php:
|
105 |
msgid "No Fields found in Trash"
|
106 |
msgstr "گروه زمینه ای در زباله دان یافت نشد"
|
107 |
|
108 |
-
#: acf.php:
|
109 |
#: includes/admin/admin-field-groups.php:587
|
110 |
msgid "Inactive"
|
111 |
msgstr "غیرفعال"
|
112 |
|
113 |
-
#: acf.php:
|
114 |
#, php-format
|
115 |
msgid "Inactive <span class=\"count\">(%s)</span>"
|
116 |
msgid_plural "Inactive <span class=\"count\">(%s)</span>"
|
117 |
msgstr[0] "غیرفعال <span class=\"count\">(%s)</span>"
|
118 |
msgstr[1] "غیرفعال <span class=\"count\">(%s)</span>"
|
119 |
|
120 |
-
#: includes/acf-field-functions.php:
|
121 |
msgid "(no label)"
|
122 |
msgstr "(بدون برچسب)"
|
123 |
|
124 |
-
#: includes/acf-field-group-functions.php:
|
125 |
#: includes/admin/admin-field-group.php:180
|
126 |
msgid "copy"
|
127 |
msgstr "کپی"
|
@@ -192,7 +192,7 @@ msgstr "(این گزینه)"
|
|
192 |
#: includes/admin/views/field-group-field-conditional-logic.php:151
|
193 |
#: includes/admin/views/field-group-locations.php:29
|
194 |
#: includes/admin/views/html-location-group.php:3
|
195 |
-
#: includes/api/api-helpers.php:
|
196 |
msgid "or"
|
197 |
msgstr "یا"
|
198 |
|
@@ -330,7 +330,7 @@ msgstr "تکثیر این زمینه"
|
|
330 |
#: includes/admin/admin-field-groups.php:686
|
331 |
#: includes/admin/admin-field-groups.php:702
|
332 |
#: includes/admin/views/field-group-field.php:46
|
333 |
-
#: pro/fields/class-acf-field-flexible-content.php:
|
334 |
msgid "Duplicate"
|
335 |
msgstr "تکثیر"
|
336 |
|
@@ -518,8 +518,8 @@ msgid "Add rule group"
|
|
518 |
msgstr "افزودن گروه قانون"
|
519 |
|
520 |
#: includes/admin/views/field-group-field.php:38
|
521 |
-
#: pro/fields/class-acf-field-flexible-content.php:
|
522 |
-
#: pro/fields/class-acf-field-repeater.php:
|
523 |
msgid "Drag to reorder"
|
524 |
msgstr "گرفتن و کشیدن برای مرتب سازی"
|
525 |
|
@@ -553,7 +553,7 @@ msgid "Delete field"
|
|
553 |
msgstr "حذف زمینه"
|
554 |
|
555 |
#: includes/admin/views/field-group-field.php:48
|
556 |
-
#: pro/fields/class-acf-field-flexible-content.php:
|
557 |
msgid "Delete"
|
558 |
msgstr "حذف"
|
559 |
|
@@ -618,13 +618,13 @@ msgstr "ترتیب"
|
|
618 |
#: includes/fields/class-acf-field-checkbox.php:420
|
619 |
#: includes/fields/class-acf-field-radio.php:311
|
620 |
#: includes/fields/class-acf-field-select.php:433
|
621 |
-
#: pro/fields/class-acf-field-flexible-content.php:
|
622 |
msgid "Label"
|
623 |
msgstr "برچسب زمینه"
|
624 |
|
625 |
#: includes/admin/views/field-group-fields.php:6
|
626 |
#: includes/fields/class-acf-field-taxonomy.php:939
|
627 |
-
#: pro/fields/class-acf-field-flexible-content.php:
|
628 |
msgid "Name"
|
629 |
msgstr "نام"
|
630 |
|
@@ -1227,42 +1227,42 @@ msgstr "بزرگ"
|
|
1227 |
msgid "Full Size"
|
1228 |
msgstr "اندازه کامل"
|
1229 |
|
1230 |
-
#: includes/api/api-helpers.php:
|
1231 |
#: pro/fields/class-acf-field-clone.php:996
|
1232 |
msgid "(no title)"
|
1233 |
msgstr "(بدون عنوان)"
|
1234 |
|
1235 |
-
#: includes/api/api-helpers.php:
|
1236 |
#, php-format
|
1237 |
msgid "Image width must be at least %dpx."
|
1238 |
msgstr "عرض تصویر باید حداقل %d پیکسل باشد."
|
1239 |
|
1240 |
-
#: includes/api/api-helpers.php:
|
1241 |
#, php-format
|
1242 |
msgid "Image width must not exceed %dpx."
|
1243 |
msgstr "عرض تصویر نباید از %d پیکسل بیشتر باشد."
|
1244 |
|
1245 |
-
#: includes/api/api-helpers.php:
|
1246 |
#, php-format
|
1247 |
msgid "Image height must be at least %dpx."
|
1248 |
msgstr "ارتفاع فایل باید حداقل %d پیکسل باشد."
|
1249 |
|
1250 |
-
#: includes/api/api-helpers.php:
|
1251 |
#, php-format
|
1252 |
msgid "Image height must not exceed %dpx."
|
1253 |
msgstr "ارتفاع تصویر نباید از %d پیکسل بیشتر باشد."
|
1254 |
|
1255 |
-
#: includes/api/api-helpers.php:
|
1256 |
#, php-format
|
1257 |
msgid "File size must be at least %s."
|
1258 |
msgstr "حجم فایل باید حداقل %s باشد."
|
1259 |
|
1260 |
-
#: includes/api/api-helpers.php:
|
1261 |
#, php-format
|
1262 |
msgid "File size must must not exceed %s."
|
1263 |
msgstr "حجم فایل ها نباید از %s بیشتر باشد."
|
1264 |
|
1265 |
-
#: includes/api/api-helpers.php:
|
1266 |
#, php-format
|
1267 |
msgid "File type must be %s."
|
1268 |
msgstr "نوع فایل باید %s باشد."
|
@@ -1429,9 +1429,9 @@ msgstr "جی کوئری"
|
|
1429 |
#: includes/fields/class-acf-field-group.php:474
|
1430 |
#: includes/fields/class-acf-field-radio.php:290
|
1431 |
#: pro/fields/class-acf-field-clone.php:843
|
1432 |
-
#: pro/fields/class-acf-field-flexible-content.php:
|
1433 |
-
#: pro/fields/class-acf-field-flexible-content.php:
|
1434 |
-
#: pro/fields/class-acf-field-repeater.php:
|
1435 |
msgid "Layout"
|
1436 |
msgstr "چیدمان"
|
1437 |
|
@@ -1920,6 +1920,7 @@ msgstr "محدود کردن انتخاب کتابخانه چندرسانه ای"
|
|
1920 |
#: includes/locations/class-acf-location-user-role.php:111
|
1921 |
#: includes/locations/class-acf-location-widget.php:83
|
1922 |
#: pro/fields/class-acf-field-gallery.php:679
|
|
|
1923 |
msgid "All"
|
1924 |
msgstr "همه"
|
1925 |
|
@@ -2014,7 +2015,7 @@ msgid "Group"
|
|
2014 |
msgstr "گروه"
|
2015 |
|
2016 |
#: includes/fields/class-acf-field-group.php:459
|
2017 |
-
#: pro/fields/class-acf-field-repeater.php:
|
2018 |
msgid "Sub Fields"
|
2019 |
msgstr "زمینههای زیرمجموعه"
|
2020 |
|
@@ -2025,22 +2026,23 @@ msgstr "استایل جهت نمایش فیلد انتخابی"
|
|
2025 |
|
2026 |
#: includes/fields/class-acf-field-group.php:480
|
2027 |
#: pro/fields/class-acf-field-clone.php:849
|
2028 |
-
#: pro/fields/class-acf-field-flexible-content.php:
|
2029 |
-
#: pro/fields/class-acf-field-repeater.php:
|
|
|
2030 |
msgid "Block"
|
2031 |
msgstr "بلوک"
|
2032 |
|
2033 |
#: includes/fields/class-acf-field-group.php:481
|
2034 |
#: pro/fields/class-acf-field-clone.php:850
|
2035 |
-
#: pro/fields/class-acf-field-flexible-content.php:
|
2036 |
-
#: pro/fields/class-acf-field-repeater.php:
|
2037 |
msgid "Table"
|
2038 |
msgstr "جدول"
|
2039 |
|
2040 |
#: includes/fields/class-acf-field-group.php:482
|
2041 |
#: pro/fields/class-acf-field-clone.php:851
|
2042 |
-
#: pro/fields/class-acf-field-flexible-content.php:
|
2043 |
-
#: pro/fields/class-acf-field-repeater.php:
|
2044 |
msgid "Row"
|
2045 |
msgstr "سطر"
|
2046 |
|
@@ -2956,6 +2958,14 @@ msgstr "بررسی دوباره"
|
|
2956 |
msgid "Upgrade Notice"
|
2957 |
msgstr "نکات به روزرسانی"
|
2958 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2959 |
#: pro/fields/class-acf-field-clone.php:25
|
2960 |
msgctxt "noun"
|
2961 |
msgid "Clone"
|
@@ -3014,13 +3024,13 @@ msgstr "تمام فیلدها از %s گروه فیلد"
|
|
3014 |
|
3015 |
#: pro/fields/class-acf-field-flexible-content.php:31
|
3016 |
#: pro/fields/class-acf-field-repeater.php:193
|
3017 |
-
#: pro/fields/class-acf-field-repeater.php:
|
3018 |
msgid "Add Row"
|
3019 |
msgstr "سطر جدید"
|
3020 |
|
3021 |
#: pro/fields/class-acf-field-flexible-content.php:73
|
3022 |
-
#: pro/fields/class-acf-field-flexible-content.php:
|
3023 |
-
#: pro/fields/class-acf-field-flexible-content.php:
|
3024 |
msgid "layout"
|
3025 |
msgid_plural "layouts"
|
3026 |
msgstr[0] "طرحها"
|
@@ -3031,8 +3041,8 @@ msgid "layouts"
|
|
3031 |
msgstr "طرح ها"
|
3032 |
|
3033 |
#: pro/fields/class-acf-field-flexible-content.php:77
|
3034 |
-
#: pro/fields/class-acf-field-flexible-content.php:
|
3035 |
-
#: pro/fields/class-acf-field-flexible-content.php:
|
3036 |
msgid "This field requires at least {min} {label} {identifier}"
|
3037 |
msgstr "این زمینه لازم دارد {min} {label} {identifier}"
|
3038 |
|
@@ -3057,57 +3067,57 @@ msgstr "زمینه محتوای انعطاف پذیر حداقل به یک طر
|
|
3057 |
msgid "Click the \"%s\" button below to start creating your layout"
|
3058 |
msgstr "روی دکمه \"%s\" دز زیر کلیک کنید تا چیدمان خود را بسازید"
|
3059 |
|
3060 |
-
#: pro/fields/class-acf-field-flexible-content.php:
|
3061 |
msgid "Add layout"
|
3062 |
msgstr "طرح جدید"
|
3063 |
|
3064 |
-
#: pro/fields/class-acf-field-flexible-content.php:
|
3065 |
msgid "Remove layout"
|
3066 |
msgstr "حذف طرح"
|
3067 |
|
3068 |
-
#: pro/fields/class-acf-field-flexible-content.php:
|
3069 |
-
#: pro/fields/class-acf-field-repeater.php:
|
3070 |
msgid "Click to toggle"
|
3071 |
msgstr "کلیک برای انتخاب"
|
3072 |
|
3073 |
-
#: pro/fields/class-acf-field-flexible-content.php:
|
3074 |
msgid "Reorder Layout"
|
3075 |
msgstr "ترتیب بندی طرح ها"
|
3076 |
|
3077 |
-
#: pro/fields/class-acf-field-flexible-content.php:
|
3078 |
msgid "Reorder"
|
3079 |
msgstr "مرتب سازی"
|
3080 |
|
3081 |
-
#: pro/fields/class-acf-field-flexible-content.php:
|
3082 |
msgid "Delete Layout"
|
3083 |
msgstr "حذف طرح"
|
3084 |
|
3085 |
-
#: pro/fields/class-acf-field-flexible-content.php:
|
3086 |
msgid "Duplicate Layout"
|
3087 |
msgstr "تکثیر طرح"
|
3088 |
|
3089 |
-
#: pro/fields/class-acf-field-flexible-content.php:
|
3090 |
msgid "Add New Layout"
|
3091 |
msgstr "افزودن طرح جدید"
|
3092 |
|
3093 |
-
#: pro/fields/class-acf-field-flexible-content.php:
|
3094 |
msgid "Min"
|
3095 |
msgstr "حداقل"
|
3096 |
|
3097 |
-
#: pro/fields/class-acf-field-flexible-content.php:
|
3098 |
msgid "Max"
|
3099 |
msgstr "حداکثر"
|
3100 |
|
3101 |
-
#: pro/fields/class-acf-field-flexible-content.php:
|
3102 |
-
#: pro/fields/class-acf-field-repeater.php:
|
3103 |
msgid "Button Label"
|
3104 |
msgstr "متن دکمه"
|
3105 |
|
3106 |
-
#: pro/fields/class-acf-field-flexible-content.php:
|
3107 |
msgid "Minimum Layouts"
|
3108 |
msgstr "حداقل تعداد طرح ها"
|
3109 |
|
3110 |
-
#: pro/fields/class-acf-field-flexible-content.php:
|
3111 |
msgid "Maximum Layouts"
|
3112 |
msgstr "حداکثر تعداد طرح ها"
|
3113 |
|
@@ -3184,7 +3194,7 @@ msgid "Prepend to the beginning"
|
|
3184 |
msgstr "افزودن قبل از"
|
3185 |
|
3186 |
#: pro/fields/class-acf-field-repeater.php:65
|
3187 |
-
#: pro/fields/class-acf-field-repeater.php:
|
3188 |
msgid "Minimum rows reached ({min} rows)"
|
3189 |
msgstr "مقادیر به حداکثر رسیده اند ( {min} سطر )"
|
3190 |
|
@@ -3192,27 +3202,27 @@ msgstr "مقادیر به حداکثر رسیده اند ( {min} سطر )"
|
|
3192 |
msgid "Maximum rows reached ({max} rows)"
|
3193 |
msgstr "مقادیر به حداکثر رسیده اند ( {max} سطر )"
|
3194 |
|
3195 |
-
#: pro/fields/class-acf-field-repeater.php:
|
3196 |
msgid "Add row"
|
3197 |
msgstr "افزودن سطر"
|
3198 |
|
3199 |
-
#: pro/fields/class-acf-field-repeater.php:
|
3200 |
msgid "Remove row"
|
3201 |
msgstr "حذف سطر"
|
3202 |
|
3203 |
-
#: pro/fields/class-acf-field-repeater.php:
|
3204 |
msgid "Collapsed"
|
3205 |
msgstr "جمع شده"
|
3206 |
|
3207 |
-
#: pro/fields/class-acf-field-repeater.php:
|
3208 |
msgid "Select a sub field to show when row is collapsed"
|
3209 |
msgstr "یک زمینه زیرمجموعه را انتخاب کنید تا زمان بسته شدن طر نمایش داده شود"
|
3210 |
|
3211 |
-
#: pro/fields/class-acf-field-repeater.php:
|
3212 |
msgid "Minimum Rows"
|
3213 |
msgstr "حداقل تعداد سطرها"
|
3214 |
|
3215 |
-
#: pro/fields/class-acf-field-repeater.php:
|
3216 |
msgid "Maximum Rows"
|
3217 |
msgstr "حداکثر تعداد سطرها"
|
3218 |
|
@@ -3238,6 +3248,22 @@ msgstr ""
|
|
3238 |
"برای به روزرسانی لطفا کد لایسنس را وارد کنید. <a href=\"%s\">بروزرسانی</a>. <a "
|
3239 |
"href=\"%s\">قیمت ها</a>."
|
3240 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3241 |
#. Plugin URI of the plugin/theme
|
3242 |
msgid "https://www.advancedcustomfields.com/"
|
3243 |
msgstr "https://www.advancedcustomfields.com/"
|
2 |
msgstr ""
|
3 |
"Project-Id-Version: Advanced Custom Fields Pro v5.7.11\n"
|
4 |
"Report-Msgid-Bugs-To: http://support.advancedcustomfields.com\n"
|
5 |
+
"POT-Creation-Date: 2019-05-08 14:09+0430\n"
|
6 |
+
"PO-Revision-Date: 2019-05-08 14:13+0430\n"
|
7 |
"Last-Translator: Elliot Condon <e@elliotcondon.com>\n"
|
8 |
"Language-Team: Majix <mimapien@gmail.com>\n"
|
9 |
"Language: fa\n"
|
26 |
msgid "Advanced Custom Fields"
|
27 |
msgstr "زمینههای سفارشی پیشرفته"
|
28 |
|
29 |
+
#: acf.php:363 includes/admin/admin.php:58
|
30 |
msgid "Field Groups"
|
31 |
msgstr "گروههای زمینه"
|
32 |
|
33 |
+
#: acf.php:364
|
34 |
msgid "Field Group"
|
35 |
msgstr "گروه زمینه"
|
36 |
|
37 |
+
#: acf.php:365 acf.php:397 includes/admin/admin.php:59
|
38 |
+
#: pro/fields/class-acf-field-flexible-content.php:558
|
39 |
msgid "Add New"
|
40 |
msgstr "افزودن"
|
41 |
|
42 |
+
#: acf.php:366
|
43 |
msgid "Add New Field Group"
|
44 |
msgstr "افزودن گروه زمینه جدید"
|
45 |
|
46 |
+
#: acf.php:367
|
47 |
msgid "Edit Field Group"
|
48 |
msgstr "ویرایش گروه زمینه"
|
49 |
|
50 |
+
#: acf.php:368
|
51 |
msgid "New Field Group"
|
52 |
msgstr "گروه زمینه جدید"
|
53 |
|
54 |
+
#: acf.php:369
|
55 |
msgid "View Field Group"
|
56 |
msgstr "مشاهده گروه زمینه"
|
57 |
|
58 |
+
#: acf.php:370
|
59 |
msgid "Search Field Groups"
|
60 |
msgstr "جستجوی گروه های زمینه"
|
61 |
|
62 |
+
#: acf.php:371
|
63 |
msgid "No Field Groups found"
|
64 |
msgstr "گروه زمینه ای یافت نشد"
|
65 |
|
66 |
+
#: acf.php:372
|
67 |
msgid "No Field Groups found in Trash"
|
68 |
msgstr "گروه زمینه ای در زباله دان یافت نشد"
|
69 |
|
70 |
+
#: acf.php:395 includes/admin/admin-field-group.php:220
|
71 |
#: includes/admin/admin-field-groups.php:530
|
72 |
#: pro/fields/class-acf-field-clone.php:811
|
73 |
msgid "Fields"
|
74 |
msgstr "زمینه ها"
|
75 |
|
76 |
+
#: acf.php:396
|
77 |
msgid "Field"
|
78 |
msgstr "زمینه"
|
79 |
|
80 |
+
#: acf.php:398
|
81 |
msgid "Add New Field"
|
82 |
msgstr "زمینه جدید"
|
83 |
|
84 |
+
#: acf.php:399
|
85 |
msgid "Edit Field"
|
86 |
msgstr "ویرایش زمینه"
|
87 |
|
88 |
+
#: acf.php:400 includes/admin/views/field-group-fields.php:41
|
89 |
msgid "New Field"
|
90 |
msgstr "زمینه جدید"
|
91 |
|
92 |
+
#: acf.php:401
|
93 |
msgid "View Field"
|
94 |
msgstr "نمایش زمینه"
|
95 |
|
96 |
+
#: acf.php:402
|
97 |
msgid "Search Fields"
|
98 |
msgstr "جستجوی گروه های زمینه"
|
99 |
|
100 |
+
#: acf.php:403
|
101 |
msgid "No Fields found"
|
102 |
msgstr "گروه زمینه ای یافت نشد"
|
103 |
|
104 |
+
#: acf.php:404
|
105 |
msgid "No Fields found in Trash"
|
106 |
msgstr "گروه زمینه ای در زباله دان یافت نشد"
|
107 |
|
108 |
+
#: acf.php:443 includes/admin/admin-field-group.php:402
|
109 |
#: includes/admin/admin-field-groups.php:587
|
110 |
msgid "Inactive"
|
111 |
msgstr "غیرفعال"
|
112 |
|
113 |
+
#: acf.php:448
|
114 |
#, php-format
|
115 |
msgid "Inactive <span class=\"count\">(%s)</span>"
|
116 |
msgid_plural "Inactive <span class=\"count\">(%s)</span>"
|
117 |
msgstr[0] "غیرفعال <span class=\"count\">(%s)</span>"
|
118 |
msgstr[1] "غیرفعال <span class=\"count\">(%s)</span>"
|
119 |
|
120 |
+
#: includes/acf-field-functions.php:828 includes/admin/admin-field-group.php:178
|
121 |
msgid "(no label)"
|
122 |
msgstr "(بدون برچسب)"
|
123 |
|
124 |
+
#: includes/acf-field-group-functions.php:816
|
125 |
#: includes/admin/admin-field-group.php:180
|
126 |
msgid "copy"
|
127 |
msgstr "کپی"
|
192 |
#: includes/admin/views/field-group-field-conditional-logic.php:151
|
193 |
#: includes/admin/views/field-group-locations.php:29
|
194 |
#: includes/admin/views/html-location-group.php:3
|
195 |
+
#: includes/api/api-helpers.php:3862
|
196 |
msgid "or"
|
197 |
msgstr "یا"
|
198 |
|
330 |
#: includes/admin/admin-field-groups.php:686
|
331 |
#: includes/admin/admin-field-groups.php:702
|
332 |
#: includes/admin/views/field-group-field.php:46
|
333 |
+
#: pro/fields/class-acf-field-flexible-content.php:557
|
334 |
msgid "Duplicate"
|
335 |
msgstr "تکثیر"
|
336 |
|
518 |
msgstr "افزودن گروه قانون"
|
519 |
|
520 |
#: includes/admin/views/field-group-field.php:38
|
521 |
+
#: pro/fields/class-acf-field-flexible-content.php:410
|
522 |
+
#: pro/fields/class-acf-field-repeater.php:299
|
523 |
msgid "Drag to reorder"
|
524 |
msgstr "گرفتن و کشیدن برای مرتب سازی"
|
525 |
|
553 |
msgstr "حذف زمینه"
|
554 |
|
555 |
#: includes/admin/views/field-group-field.php:48
|
556 |
+
#: pro/fields/class-acf-field-flexible-content.php:556
|
557 |
msgid "Delete"
|
558 |
msgstr "حذف"
|
559 |
|
618 |
#: includes/fields/class-acf-field-checkbox.php:420
|
619 |
#: includes/fields/class-acf-field-radio.php:311
|
620 |
#: includes/fields/class-acf-field-select.php:433
|
621 |
+
#: pro/fields/class-acf-field-flexible-content.php:582
|
622 |
msgid "Label"
|
623 |
msgstr "برچسب زمینه"
|
624 |
|
625 |
#: includes/admin/views/field-group-fields.php:6
|
626 |
#: includes/fields/class-acf-field-taxonomy.php:939
|
627 |
+
#: pro/fields/class-acf-field-flexible-content.php:596
|
628 |
msgid "Name"
|
629 |
msgstr "نام"
|
630 |
|
1227 |
msgid "Full Size"
|
1228 |
msgstr "اندازه کامل"
|
1229 |
|
1230 |
+
#: includes/api/api-helpers.php:1775 includes/api/api-term.php:147
|
1231 |
#: pro/fields/class-acf-field-clone.php:996
|
1232 |
msgid "(no title)"
|
1233 |
msgstr "(بدون عنوان)"
|
1234 |
|
1235 |
+
#: includes/api/api-helpers.php:3783
|
1236 |
#, php-format
|
1237 |
msgid "Image width must be at least %dpx."
|
1238 |
msgstr "عرض تصویر باید حداقل %d پیکسل باشد."
|
1239 |
|
1240 |
+
#: includes/api/api-helpers.php:3788
|
1241 |
#, php-format
|
1242 |
msgid "Image width must not exceed %dpx."
|
1243 |
msgstr "عرض تصویر نباید از %d پیکسل بیشتر باشد."
|
1244 |
|
1245 |
+
#: includes/api/api-helpers.php:3804
|
1246 |
#, php-format
|
1247 |
msgid "Image height must be at least %dpx."
|
1248 |
msgstr "ارتفاع فایل باید حداقل %d پیکسل باشد."
|
1249 |
|
1250 |
+
#: includes/api/api-helpers.php:3809
|
1251 |
#, php-format
|
1252 |
msgid "Image height must not exceed %dpx."
|
1253 |
msgstr "ارتفاع تصویر نباید از %d پیکسل بیشتر باشد."
|
1254 |
|
1255 |
+
#: includes/api/api-helpers.php:3827
|
1256 |
#, php-format
|
1257 |
msgid "File size must be at least %s."
|
1258 |
msgstr "حجم فایل باید حداقل %s باشد."
|
1259 |
|
1260 |
+
#: includes/api/api-helpers.php:3832
|
1261 |
#, php-format
|
1262 |
msgid "File size must must not exceed %s."
|
1263 |
msgstr "حجم فایل ها نباید از %s بیشتر باشد."
|
1264 |
|
1265 |
+
#: includes/api/api-helpers.php:3866
|
1266 |
#, php-format
|
1267 |
msgid "File type must be %s."
|
1268 |
msgstr "نوع فایل باید %s باشد."
|
1429 |
#: includes/fields/class-acf-field-group.php:474
|
1430 |
#: includes/fields/class-acf-field-radio.php:290
|
1431 |
#: pro/fields/class-acf-field-clone.php:843
|
1432 |
+
#: pro/fields/class-acf-field-flexible-content.php:553
|
1433 |
+
#: pro/fields/class-acf-field-flexible-content.php:602
|
1434 |
+
#: pro/fields/class-acf-field-repeater.php:448
|
1435 |
msgid "Layout"
|
1436 |
msgstr "چیدمان"
|
1437 |
|
1920 |
#: includes/locations/class-acf-location-user-role.php:111
|
1921 |
#: includes/locations/class-acf-location-widget.php:83
|
1922 |
#: pro/fields/class-acf-field-gallery.php:679
|
1923 |
+
#: pro/locations/class-acf-location-block.php:79
|
1924 |
msgid "All"
|
1925 |
msgstr "همه"
|
1926 |
|
2015 |
msgstr "گروه"
|
2016 |
|
2017 |
#: includes/fields/class-acf-field-group.php:459
|
2018 |
+
#: pro/fields/class-acf-field-repeater.php:384
|
2019 |
msgid "Sub Fields"
|
2020 |
msgstr "زمینههای زیرمجموعه"
|
2021 |
|
2026 |
|
2027 |
#: includes/fields/class-acf-field-group.php:480
|
2028 |
#: pro/fields/class-acf-field-clone.php:849
|
2029 |
+
#: pro/fields/class-acf-field-flexible-content.php:613
|
2030 |
+
#: pro/fields/class-acf-field-repeater.php:456
|
2031 |
+
#: pro/locations/class-acf-location-block.php:27
|
2032 |
msgid "Block"
|
2033 |
msgstr "بلوک"
|
2034 |
|
2035 |
#: includes/fields/class-acf-field-group.php:481
|
2036 |
#: pro/fields/class-acf-field-clone.php:850
|
2037 |
+
#: pro/fields/class-acf-field-flexible-content.php:612
|
2038 |
+
#: pro/fields/class-acf-field-repeater.php:455
|
2039 |
msgid "Table"
|
2040 |
msgstr "جدول"
|
2041 |
|
2042 |
#: includes/fields/class-acf-field-group.php:482
|
2043 |
#: pro/fields/class-acf-field-clone.php:851
|
2044 |
+
#: pro/fields/class-acf-field-flexible-content.php:614
|
2045 |
+
#: pro/fields/class-acf-field-repeater.php:457
|
2046 |
msgid "Row"
|
2047 |
msgstr "سطر"
|
2048 |
|
2958 |
msgid "Upgrade Notice"
|
2959 |
msgstr "نکات به روزرسانی"
|
2960 |
|
2961 |
+
#: pro/blocks.php:371
|
2962 |
+
msgid "Switch to Edit"
|
2963 |
+
msgstr "حالت ویرایش"
|
2964 |
+
|
2965 |
+
#: pro/blocks.php:372
|
2966 |
+
msgid "Switch to Preview"
|
2967 |
+
msgstr "حالت پیشنمایش"
|
2968 |
+
|
2969 |
#: pro/fields/class-acf-field-clone.php:25
|
2970 |
msgctxt "noun"
|
2971 |
msgid "Clone"
|
3024 |
|
3025 |
#: pro/fields/class-acf-field-flexible-content.php:31
|
3026 |
#: pro/fields/class-acf-field-repeater.php:193
|
3027 |
+
#: pro/fields/class-acf-field-repeater.php:468
|
3028 |
msgid "Add Row"
|
3029 |
msgstr "سطر جدید"
|
3030 |
|
3031 |
#: pro/fields/class-acf-field-flexible-content.php:73
|
3032 |
+
#: pro/fields/class-acf-field-flexible-content.php:924
|
3033 |
+
#: pro/fields/class-acf-field-flexible-content.php:1006
|
3034 |
msgid "layout"
|
3035 |
msgid_plural "layouts"
|
3036 |
msgstr[0] "طرحها"
|
3041 |
msgstr "طرح ها"
|
3042 |
|
3043 |
#: pro/fields/class-acf-field-flexible-content.php:77
|
3044 |
+
#: pro/fields/class-acf-field-flexible-content.php:923
|
3045 |
+
#: pro/fields/class-acf-field-flexible-content.php:1005
|
3046 |
msgid "This field requires at least {min} {label} {identifier}"
|
3047 |
msgstr "این زمینه لازم دارد {min} {label} {identifier}"
|
3048 |
|
3067 |
msgid "Click the \"%s\" button below to start creating your layout"
|
3068 |
msgstr "روی دکمه \"%s\" دز زیر کلیک کنید تا چیدمان خود را بسازید"
|
3069 |
|
3070 |
+
#: pro/fields/class-acf-field-flexible-content.php:413
|
3071 |
msgid "Add layout"
|
3072 |
msgstr "طرح جدید"
|
3073 |
|
3074 |
+
#: pro/fields/class-acf-field-flexible-content.php:414
|
3075 |
msgid "Remove layout"
|
3076 |
msgstr "حذف طرح"
|
3077 |
|
3078 |
+
#: pro/fields/class-acf-field-flexible-content.php:415
|
3079 |
+
#: pro/fields/class-acf-field-repeater.php:301
|
3080 |
msgid "Click to toggle"
|
3081 |
msgstr "کلیک برای انتخاب"
|
3082 |
|
3083 |
+
#: pro/fields/class-acf-field-flexible-content.php:555
|
3084 |
msgid "Reorder Layout"
|
3085 |
msgstr "ترتیب بندی طرح ها"
|
3086 |
|
3087 |
+
#: pro/fields/class-acf-field-flexible-content.php:555
|
3088 |
msgid "Reorder"
|
3089 |
msgstr "مرتب سازی"
|
3090 |
|
3091 |
+
#: pro/fields/class-acf-field-flexible-content.php:556
|
3092 |
msgid "Delete Layout"
|
3093 |
msgstr "حذف طرح"
|
3094 |
|
3095 |
+
#: pro/fields/class-acf-field-flexible-content.php:557
|
3096 |
msgid "Duplicate Layout"
|
3097 |
msgstr "تکثیر طرح"
|
3098 |
|
3099 |
+
#: pro/fields/class-acf-field-flexible-content.php:558
|
3100 |
msgid "Add New Layout"
|
3101 |
msgstr "افزودن طرح جدید"
|
3102 |
|
3103 |
+
#: pro/fields/class-acf-field-flexible-content.php:629
|
3104 |
msgid "Min"
|
3105 |
msgstr "حداقل"
|
3106 |
|
3107 |
+
#: pro/fields/class-acf-field-flexible-content.php:642
|
3108 |
msgid "Max"
|
3109 |
msgstr "حداکثر"
|
3110 |
|
3111 |
+
#: pro/fields/class-acf-field-flexible-content.php:669
|
3112 |
+
#: pro/fields/class-acf-field-repeater.php:464
|
3113 |
msgid "Button Label"
|
3114 |
msgstr "متن دکمه"
|
3115 |
|
3116 |
+
#: pro/fields/class-acf-field-flexible-content.php:678
|
3117 |
msgid "Minimum Layouts"
|
3118 |
msgstr "حداقل تعداد طرح ها"
|
3119 |
|
3120 |
+
#: pro/fields/class-acf-field-flexible-content.php:687
|
3121 |
msgid "Maximum Layouts"
|
3122 |
msgstr "حداکثر تعداد طرح ها"
|
3123 |
|
3194 |
msgstr "افزودن قبل از"
|
3195 |
|
3196 |
#: pro/fields/class-acf-field-repeater.php:65
|
3197 |
+
#: pro/fields/class-acf-field-repeater.php:661
|
3198 |
msgid "Minimum rows reached ({min} rows)"
|
3199 |
msgstr "مقادیر به حداکثر رسیده اند ( {min} سطر )"
|
3200 |
|
3202 |
msgid "Maximum rows reached ({max} rows)"
|
3203 |
msgstr "مقادیر به حداکثر رسیده اند ( {max} سطر )"
|
3204 |
|
3205 |
+
#: pro/fields/class-acf-field-repeater.php:338
|
3206 |
msgid "Add row"
|
3207 |
msgstr "افزودن سطر"
|
3208 |
|
3209 |
+
#: pro/fields/class-acf-field-repeater.php:339
|
3210 |
msgid "Remove row"
|
3211 |
msgstr "حذف سطر"
|
3212 |
|
3213 |
+
#: pro/fields/class-acf-field-repeater.php:417
|
3214 |
msgid "Collapsed"
|
3215 |
msgstr "جمع شده"
|
3216 |
|
3217 |
+
#: pro/fields/class-acf-field-repeater.php:418
|
3218 |
msgid "Select a sub field to show when row is collapsed"
|
3219 |
msgstr "یک زمینه زیرمجموعه را انتخاب کنید تا زمان بسته شدن طر نمایش داده شود"
|
3220 |
|
3221 |
+
#: pro/fields/class-acf-field-repeater.php:428
|
3222 |
msgid "Minimum Rows"
|
3223 |
msgstr "حداقل تعداد سطرها"
|
3224 |
|
3225 |
+
#: pro/fields/class-acf-field-repeater.php:438
|
3226 |
msgid "Maximum Rows"
|
3227 |
msgstr "حداکثر تعداد سطرها"
|
3228 |
|
3248 |
"برای به روزرسانی لطفا کد لایسنس را وارد کنید. <a href=\"%s\">بروزرسانی</a>. <a "
|
3249 |
"href=\"%s\">قیمت ها</a>."
|
3250 |
|
3251 |
+
#: tests/basic/test-blocks.php:13
|
3252 |
+
msgid "Testimonial"
|
3253 |
+
msgstr "توصیهنامه"
|
3254 |
+
|
3255 |
+
#: tests/basic/test-blocks.php:14
|
3256 |
+
msgid "A custom testimonial block."
|
3257 |
+
msgstr "بلوک سفارشی توصیهنامه (Testimonial)"
|
3258 |
+
|
3259 |
+
#: tests/basic/test-blocks.php:40
|
3260 |
+
msgid "Slider"
|
3261 |
+
msgstr "اسلایدر"
|
3262 |
+
|
3263 |
+
#: tests/basic/test-blocks.php:41
|
3264 |
+
msgid "A custom gallery slider."
|
3265 |
+
msgstr "اسلایدر گالری سفارشی"
|
3266 |
+
|
3267 |
#. Plugin URI of the plugin/theme
|
3268 |
msgid "https://www.advancedcustomfields.com/"
|
3269 |
msgstr "https://www.advancedcustomfields.com/"
|
lang/acf-sv_SE.mo
CHANGED
Binary file
|
lang/acf-sv_SE.po
CHANGED
@@ -3,7 +3,7 @@ msgstr ""
|
|
3 |
"Project-Id-Version: Advanced Custom Fields Pro v5.2.9\n"
|
4 |
"Report-Msgid-Bugs-To: http://support.advancedcustomfields.com\n"
|
5 |
"POT-Creation-Date: 2017-06-27 15:28+1000\n"
|
6 |
-
"PO-Revision-Date:
|
7 |
"Last-Translator: Elliot Condon <e@elliotcondon.com>\n"
|
8 |
"Language-Team: Swedish\n"
|
9 |
"Language: sv_SE\n"
|
@@ -1869,7 +1869,7 @@ msgstr "Specificera stilen för att rendera valda fält"
|
|
1869 |
#: pro/fields/class-acf-field-flexible-content.php:629
|
1870 |
#: pro/fields/class-acf-field-repeater.php:522
|
1871 |
msgid "Block"
|
1872 |
-
msgstr "
|
1873 |
|
1874 |
#: includes/fields/class-acf-field-group.php:492
|
1875 |
#: pro/fields/class-acf-field-clone.php:896
|
3 |
"Project-Id-Version: Advanced Custom Fields Pro v5.2.9\n"
|
4 |
"Report-Msgid-Bugs-To: http://support.advancedcustomfields.com\n"
|
5 |
"POT-Creation-Date: 2017-06-27 15:28+1000\n"
|
6 |
+
"PO-Revision-Date: 2019-05-15 09:55+1000\n"
|
7 |
"Last-Translator: Elliot Condon <e@elliotcondon.com>\n"
|
8 |
"Language-Team: Swedish\n"
|
9 |
"Language: sv_SE\n"
|
1869 |
#: pro/fields/class-acf-field-flexible-content.php:629
|
1870 |
#: pro/fields/class-acf-field-repeater.php:522
|
1871 |
msgid "Block"
|
1872 |
+
msgstr "Block"
|
1873 |
|
1874 |
#: includes/fields/class-acf-field-group.php:492
|
1875 |
#: pro/fields/class-acf-field-clone.php:896
|
readme.txt
CHANGED
@@ -67,6 +67,19 @@ From your WordPress dashboard
|
|
67 |
|
68 |
== Changelog ==
|
69 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
= 5.8.0 =
|
71 |
*Release Date - 8 May 2019*
|
72 |
|
@@ -183,369 +196,6 @@ From your WordPress dashboard
|
|
183 |
* Dev - Reordered various actions and filters for more usefulness.
|
184 |
* i18n - Updated Polish language thanks to Dariusz Zielonka
|
185 |
|
186 |
-
|
187 |
-
*Release Date - 6 September 2018*
|
188 |
-
|
189 |
-
* Fix - Fixed bug causing multisite login redirect issues.
|
190 |
-
* Fix - Fixed bug causing validation issues in older versions of Firefox.
|
191 |
-
* Fix - Fixed bug causing duplicate Select2 instances when adding a widget via drag/drop.
|
192 |
-
* Dev - Improved WPML compatibility by using `$sitepress->get_current_language()` instead of `ICL_LANGUAGE_CODE`.
|
193 |
-
* Dev - Improved validation JS with new Validator model and logic.
|
194 |
-
|
195 |
-
= 5.7.4 =
|
196 |
-
*Release Date - 30 August 2018*
|
197 |
-
|
198 |
-
* Fix - Fixed bug causing field groups to disappear when selecting a taxonomy term with WPML active.
|
199 |
-
* Tweak - Added more Dark Mode styles.
|
200 |
-
* Tweak - Improved DB upgrade prompt, functions and AJAX logic.
|
201 |
-
* Tweak - Improved the "What's New" admin page seen after DB Upgrade.
|
202 |
-
* Dev - Added new location rules filters.
|
203 |
-
|
204 |
-
= 5.7.3 =
|
205 |
-
*Release Date - 20 August 2018*
|
206 |
-
|
207 |
-
* New - Added Dark Mode styles for the [Dark Mode Plugin](https://en-au.wordpress.org/plugins/dark-mode/).
|
208 |
-
* New - Added "Value Contains" condition to the Select field type.
|
209 |
-
* New - Added support for the WooCommerce product type dropdown to trigger "update metaboxes".
|
210 |
-
* Tweak - Improved acf.screen model responsible for "updating metaboxes" when changing post data.
|
211 |
-
* Tweak - Removed user fields from the multisite "Add New User" page.
|
212 |
-
* Fix - Fixed bug preventing some tinymce customizations from working.
|
213 |
-
* Fix - Fixed JS bug throwing "preference" error in console.
|
214 |
-
* Dev - Added action 'acf/enqueue_uploader' triggered after the hidden "ACF Content" editor is rendered.
|
215 |
-
|
216 |
-
= 5.7.2 =
|
217 |
-
*Release Date - 6 August 2018*
|
218 |
-
|
219 |
-
* Fix - Fixed bug preventing the Google Maps Field address from being customized.
|
220 |
-
* Fix - Improved logic to request and cache plugin update information.
|
221 |
-
* Fix - Fixed bug preventing JS initialization when editing widgets in accessibility mode.
|
222 |
-
* Fix - Added missing $parent argument to term_exists() function when adding a new term via taxonomy field popup.
|
223 |
-
* Fix - Fixed bug where nested Group Fields did not delete their values.
|
224 |
-
* Fix - Fixed JS error thrown by localStorage if cookies are not enabled.
|
225 |
-
* Dev - Bumped minimum WP version requirement to 4.4.
|
226 |
-
* Dev - Added action 'wp_nav_menu_item_custom_fields' for compatibility with other plugins modifying the menu walker class.
|
227 |
-
* Dev - Added 'multiple' to the allowed attributes for an email field.
|
228 |
-
* Dev - Added new ACF_Ajax class for upcoming features.
|
229 |
-
|
230 |
-
= 5.7.1 =
|
231 |
-
* Core: Minor fixes and improvements
|
232 |
-
|
233 |
-
= 5.7.0 =
|
234 |
-
* Core: Major JavaScript updates
|
235 |
-
* Core: Improved conditional logic with new types and more supported fields
|
236 |
-
* Core: Improved localization and internationalization
|
237 |
-
* Repeater field: Improved logic that remembers collapsed row states
|
238 |
-
* Repeater field: Added support to collapse multiple rows (hold shift)
|
239 |
-
* API: Improved lookup to find fields without a reference value
|
240 |
-
* Language: Added Croatian translation - Thanks to Vlado Bosnjak
|
241 |
-
* Language: Updated Italian translation - thanks to Davide Pantè
|
242 |
-
* Language: Updated Romanian translation - thanks to Ionut Staicu
|
243 |
-
* Language: Updated German translation - thanks to Ralf Koller
|
244 |
-
* Language: Updated Arabic translation - thanks to Karim Ramadan
|
245 |
-
* Language: Updated Portuguese translation - thanks to Pedro Mendonça
|
246 |
-
|
247 |
-
= 5.6.10 =
|
248 |
-
* Core: Minor fixes and improvements
|
249 |
-
|
250 |
-
= 5.6.9 =
|
251 |
-
* User field: Added new 'Return Format' setting (Array, Object, ID)
|
252 |
-
* Core: Added basic compatibility with Gutenberg - values now save
|
253 |
-
* Core: Fixed bug affecting the loading of fields on new Menu Items
|
254 |
-
* Core: Removed private ('show_ui' => false) post types from the 'Post Type' location rule choices
|
255 |
-
* Core: Minor fixes and improvements
|
256 |
-
* Language: Updated French translation - thanks to Maxime Bernard-Jacquet
|
257 |
-
|
258 |
-
= 5.6.8 =
|
259 |
-
* API: Fixed bug causing have_rows() to fail with PHP 7.2
|
260 |
-
* Core: Fixed bug causing "Add new term" form to hide after submit
|
261 |
-
* Core: Minor fixes and improvements
|
262 |
-
* Language: Updated German translation - thanks to Ralf Koller
|
263 |
-
* Language: Updated Portuguese translation - thanks to Pedro Mendonça
|
264 |
-
* Language: Updated Arabic translation - thanks to Karim Ramadan
|
265 |
-
* Language: Updated Spanish translation - thanks to Luis Rull Muñoz
|
266 |
-
* Language: Updated Persian translation - thanks to Majix
|
267 |
-
|
268 |
-
= 5.6.7 =
|
269 |
-
* Fixed an assortment of bugs found in 5.6.6
|
270 |
-
|
271 |
-
= 5.6.6 =
|
272 |
-
* Accordion field: Added new field type
|
273 |
-
* Tab field: Added logic to remember active tabs
|
274 |
-
* WYSIWYG field: Fixed JS error in quicktags initialization
|
275 |
-
* Core: Fixed issue preventing conditional logic for menu item fields
|
276 |
-
* Core: Fixed issue preventing JS initialization for newly added menu items.
|
277 |
-
* Core: Allow whitespace in input value (previously trimmed)
|
278 |
-
* Core: Minor fixes and improvements
|
279 |
-
* Language: Updated Italian translation - thanks to Davide Pantè
|
280 |
-
* Language: Updated Brazilian Portuguese translation - thanks to Rafael Ribeiro
|
281 |
-
* Language: Updated Dutch translation - thanks to Derk Oosterveld
|
282 |
-
* Language: Updated Portuguese translation - thanks to Pedro Mendonça
|
283 |
-
* Language: Updated Persian translation - thanks to Kamel Kimiaei
|
284 |
-
* Language: Updated Swiss German translation - thanks to Raphael Hüni
|
285 |
-
* Language: Updated Arabic translation - thanks to Karim Ramadan
|
286 |
-
|
287 |
-
= 5.6.5 =
|
288 |
-
* API: Added new 'kses' setting to the `acf_form()` function
|
289 |
-
* Core: Added new 'Admin Tools' framework (includes design refresh)
|
290 |
-
* Core: Minor fixes and improvements
|
291 |
-
* Language: Update Ukrainian translation - thanks to Jurko Chervony
|
292 |
-
* Language: Update Russian translation - thanks to Andriy Toniyevych
|
293 |
-
* Language: Update Hebrew translation - thanks to Itamar Megged
|
294 |
-
|
295 |
-
= 5.6.4 =
|
296 |
-
* Google Map field: Fixed bug causing invalid url to JavaScript library
|
297 |
-
* WYSIWYG field: Fixed minor z-index and drag/drop bugs
|
298 |
-
* Group field: Fixed bug causing incorrect export settings
|
299 |
-
* Core: Fixed bug in 'Post Taxonomy' location rule ignoring selected terms during AJAX callback
|
300 |
-
* Core: Fixed bug preventing a draft to validate with required fields
|
301 |
-
* Language: Updated Italian translation - thanks to Davide Pantè
|
302 |
-
* Language: Update Turkish translation - thanks to Emre Erkan
|
303 |
-
* Language: Updated Chinese translation - thanks to Wang Hao
|
304 |
-
* Language: Update Hebrew translation - thanks to Itamar Megged
|
305 |
-
|
306 |
-
= 5.6.3 =
|
307 |
-
* Button Group field: Added new field type
|
308 |
-
* Range field: Added missing 'step' attribute to number input
|
309 |
-
* Range field: Added width to number input based on max setting
|
310 |
-
* Basic fields: Added missing 'required' attribute to inputs
|
311 |
-
* Basic fields: Removed empty attributes from inputs
|
312 |
-
* API: Fixed `get_fields()` bug ignoring fields starting with an underscore
|
313 |
-
* Core: Minor fixes and improvements
|
314 |
-
* Language: Updated Portuguese translation - thanks to Pedro Mendonça
|
315 |
-
* Language: Updated French translation - thanks to Maxime Bernard-Jacquet
|
316 |
-
* Language: Updated Finnish translation - thanks to Sauli Rajala
|
317 |
-
* Language: Updated German translation - thanks to Ralf Koller
|
318 |
-
|
319 |
-
= 5.6.2 =
|
320 |
-
* Range field: Added new field type
|
321 |
-
* Clone field: Fixed bug causing value update issues for 'seamless' + widgets / nave menu items
|
322 |
-
* Location: Added parent theme's post templates to 'post template' location rule
|
323 |
-
* Location: Fixed bug causing 'nav menu' location rule to fail during AJAX (add new item)
|
324 |
-
* Core: Fixed PHP errors in customizer when editing non ACF panels
|
325 |
-
* Core: Fixed bug casing backslash character to break fields / field groups
|
326 |
-
* Core: Many minor bug fixes
|
327 |
-
* Language: Updated Romanian translation - thanks to Ionut Staicu
|
328 |
-
* Language: Updated Italian translation - thanks to Davide Pantè
|
329 |
-
* Language: Update Turkish translation - thanks to Emre Erkan
|
330 |
-
* Language: Updated Russian translation - Thanks to Алекс Яровиков
|
331 |
-
* Language: Updated French translation - Thanks to Julie Arrigoni
|
332 |
-
|
333 |
-
= 5.6.1 =
|
334 |
-
* Fixed an assortment of bugs found in 5.6.0
|
335 |
-
|
336 |
-
= 5.6.0 =
|
337 |
-
* Link field: Added new field type
|
338 |
-
* Group field: Added new field type
|
339 |
-
* API: Improved `have_rows()` function to work with clone and group field values
|
340 |
-
* Core: Added new location for Menus
|
341 |
-
* Core: Added new location for Menu Items
|
342 |
-
* Core: Added types to Attachment location rule - thanks to Jan Thomas
|
343 |
-
* Core: Added "Confirm Remove" tooltips
|
344 |
-
* Core: Updated Select2 JS library to v4
|
345 |
-
* Core: Minor fixes and improvements
|
346 |
-
|
347 |
-
= 5.5.14 =
|
348 |
-
* Core: Minor bug fixes
|
349 |
-
|
350 |
-
= 5.5.13 =
|
351 |
-
* Clone field: Improved 'Fields' setting to show all fields within a matching field group search
|
352 |
-
* Flexible Content field: Fixed bug causing 'layout_title' filter to fail when field is cloned
|
353 |
-
* Flexible Content field: Added missing 'translate_field' function
|
354 |
-
* WYSIWYG field: Fixed JS error when using CKEditor plugin
|
355 |
-
* Date Picker field: Improved 'Display Format' and 'Return Format' settings UI
|
356 |
-
* Time Picker field: Same as above
|
357 |
-
* Datetime Picker field: Same as above
|
358 |
-
* Core: Added new 'remove_wp_meta_box' setting
|
359 |
-
* Core: Added constants ACF, ACF_PRO, ACF_VERSION and ACF_PATH
|
360 |
-
* Core: Improved compatibility with Select2 v4 including sortable functionality
|
361 |
-
* Language: Updated Portuguese translation - thanks to Pedro Mendonça
|
362 |
-
|
363 |
-
= 5.5.12 =
|
364 |
-
* Tab field: Allowed HTML within field label to show in tab
|
365 |
-
* Core: Improved plugin update class
|
366 |
-
* Language: Updated Portuguese translation - thanks to Pedro Mendonça
|
367 |
-
* Language: Updated Brazilian Portuguese translation - thanks to Rafael Ribeiro
|
368 |
-
|
369 |
-
= 5.5.11 =
|
370 |
-
* Google Map field: Added new 'google_map_init' JS action
|
371 |
-
* Core: Minor fixes and improvements
|
372 |
-
* Language: Updated Swiss German translation - thanks to Raphael Hüni
|
373 |
-
* Language: Updated French translation - thanks to Maxime Bernard-Jacquet
|
374 |
-
|
375 |
-
= 5.5.10 =
|
376 |
-
* API: Added new functionality to the `acf_form()` function:
|
377 |
-
* - added new 'html_updated_message' setting
|
378 |
-
* - added new 'html_submit_button' setting
|
379 |
-
* - added new 'html_submit_spinner' setting
|
380 |
-
* - added new 'acf/pre_submit_form' filter run when form is successfully submit (before saving $_POST)
|
381 |
-
* - added new 'acf/submit_form' action run when form is successfully submit (after saving $_POST)
|
382 |
-
* - added new '%post_id%' replace string to the 'return' setting
|
383 |
-
* - added new encryption logic to prevent $_POST exploits
|
384 |
-
* - added new `acf_register_form()` function
|
385 |
-
* Core: Fixed bug preventing values being loaded on a new post/page preview
|
386 |
-
* Core: Fixed missing 'Bulk Actions' dropdown on sync screen when no field groups exist
|
387 |
-
* Core: Fixed bug ignoring PHP field groups if exists in JSON
|
388 |
-
* Core: Minor fixes and improvements
|
389 |
-
|
390 |
-
= 5.5.9 =
|
391 |
-
* Core: Fixed bug causing ACF4 PHP field groups to be ignored if missing ‘key’ setting
|
392 |
-
|
393 |
-
= 5.5.8 =
|
394 |
-
* Flexible Content: Added logic to better 'clean up' data when re-ordering layouts
|
395 |
-
* oEmbed field: Fixed bug causing incorrect width and height settings in embed HTML
|
396 |
-
* Core: Fixed bug causing incorrect Select2 CSS version loading for WooCommerce 2.7
|
397 |
-
* Core: Fixed bug preventing 'min-height' style being applied to floating width fields
|
398 |
-
* Core: Added new JS 'init' actions for wysiwyg, date, datetime, time and select2 fields
|
399 |
-
* Core: Minor fixes and improvements
|
400 |
-
|
401 |
-
= 5.5.7 =
|
402 |
-
* Core: Fixed bug causing `get_field()` to return incorrect data for sub fields registered via PHP code.
|
403 |
-
|
404 |
-
= 5.5.6 =
|
405 |
-
* Core: Fixed bug causing license key to be ignored after changing url from http to https
|
406 |
-
* Core: Fixed Select2 (v4) bug where 'allow null' setting would not correctly save empty value
|
407 |
-
* Core: Added new 'acf/validate_field' filter
|
408 |
-
* Core: Added new 'acf/validate_field_group' filter
|
409 |
-
* Core: Added new 'acf/validate_post_id' filter
|
410 |
-
* Core: Added new 'row_index_offset' setting
|
411 |
-
* Core: Fixed bug causing value loading issues for a taxonomy term in WP < 4.4
|
412 |
-
* Core: Minor fixes and improvements
|
413 |
-
|
414 |
-
= 5.5.5 =
|
415 |
-
* File field: Fixed bug creating draft post when saving an empty value
|
416 |
-
* Image field: Fixed bug mentioned above
|
417 |
-
|
418 |
-
= 5.5.4 =
|
419 |
-
* File field: Added logic to 'connect' selected attachment to post (only if attachment is not 'connected')
|
420 |
-
* File field: Removed `filesize()` call causing performance issues with externally hosted attachments
|
421 |
-
* File field: Added AJAX validation to 'basic' uploader
|
422 |
-
* Image field: Added 'connect' logic mentioned above
|
423 |
-
* Image field: Added AJAX validation mentioned above
|
424 |
-
* True false field: Improved usability by allowing 'tab' key to focus element (use space or arrow keys to toggle)
|
425 |
-
* Gallery field: Fixed bug causing unsaved changes in sidebar to be lost when selecting another attachment
|
426 |
-
* API: Fixed `add_row()` and `add_sub_row()` return values (from true to new row index)
|
427 |
-
* Core: Improved `get_posts()` query speeds by setting 'update_cache' settings to false
|
428 |
-
* Core: Allowed 'instruction_placement' setting on 'widget' forms (previously set always to 'below fields')
|
429 |
-
* Core: Removed 'ACF PRO invalid license nag' and will include fix for 'protocol change' in next release
|
430 |
-
* Language: Updated French translation - thanks to Martial Parfait
|
431 |
-
|
432 |
-
= 5.5.3 =
|
433 |
-
* Options page: Fixed bug when using WPML in multiple tabs causing incorrect 'lang' to be used during save.
|
434 |
-
* Core: Added support with new `get_user_locale()` setting in WP 4.7
|
435 |
-
* Core: Improved efficiency of termmeta DB upgrade logic
|
436 |
-
* Core: Minor fixes and improvements
|
437 |
-
|
438 |
-
= 5.5.2 =
|
439 |
-
* Tab field: Fixed bug causing value loading issues for field's with the same name
|
440 |
-
* Repeater field: Fixed bug in 'collapsed' setting where field key was shown instead of field label
|
441 |
-
|
442 |
-
= 5.5.1 =
|
443 |
-
* Select field: Fixed bug preventing some field settings from being selected
|
444 |
-
* Date picker field: Improved compatibility with customized values
|
445 |
-
* Core: Added new 'enqueue_datepicker' setting which can be used to prevent the library from being enqueued
|
446 |
-
* Core: Added new 'enqueue_datetimepicker' setting which can be used to prevent the library from being enqueued
|
447 |
-
* Core: Minor fixes and improvements
|
448 |
-
|
449 |
-
= 5.5.0 =
|
450 |
-
* True False field: Added new 'ui' setting which renders as a toggle switch
|
451 |
-
* WYSIWYG field: Added new 'delay' setting which delays tinymce initialization until the field is clicked
|
452 |
-
* WYSIWYG field: Added compatibility for WP 4.7 toolbar buttons order
|
453 |
-
* Checkbox field: Added new 'allow_custom' and 'save_custom' settings allowing you to add custom choices
|
454 |
-
* Select field: Fixed bug where Select2 fields did not correctly use the ‘allow null’ setting
|
455 |
-
* Clone field: Fixed bug causing save/load issues found when 2 sub fields clone in the same field/group.
|
456 |
-
* Flexible Content field: Improved popup style and validation messages
|
457 |
-
* Google Map field: Prevent scroll zoom
|
458 |
-
* Date picker field: Added better compatibility logic for custom 'date_format' setting found in version < 5.0.0
|
459 |
-
* API: acf_form() 'id' setting is now used as 'id' attribute in <form> element
|
460 |
-
* Options page: Fixed incorrect redirect URL from a sub options page
|
461 |
-
* Field group: Added new 'post_template' location rule (requires WP 4.7)
|
462 |
-
* Core: Added support for the wp_termmeta table (includes DB upgrade)
|
463 |
-
* Core: Added new 'select_2_version' setting which can be changed between 3 and 4
|
464 |
-
* Core: Added new 'enqueue_select2' setting which can be used to prevent the library from being enqueued
|
465 |
-
* Core: Added new 'enqueue_google_maps' setting which can be used to prevent the library from being enqueued
|
466 |
-
* Core: Minor fixes and improvements
|
467 |
-
* Language: Updated Portuguese translation - thanks to Pedro Mendonça
|
468 |
-
* Language: Updated Norwegian translation - thanks to Havard Grimelid
|
469 |
-
* Language: Updated Swedish translation - thanks to Jonathan de Jong
|
470 |
-
* Language: Updated German translation - thanks to Ralf Koller
|
471 |
-
* Language: Updated Italian translation - thanks to Davide Pantè
|
472 |
-
* Language: Updated Swiss German translation - thanks to Raphael Hüni
|
473 |
-
|
474 |
-
= 5.4.8 =
|
475 |
-
* Flexible Content field: Fixed bug in 'layout_title' filter preventing values being loaded correctly
|
476 |
-
|
477 |
-
= 5.4.7 =
|
478 |
-
* Time Picker field: Fixed bug preventing default time from being selected
|
479 |
-
* Date Picker field: Improved compatibility with unix timestamp values
|
480 |
-
* File field: Fixed validation bugs when used as a sub field (multiple selection)
|
481 |
-
* Select field: Fixed bug incorrectly allowing a disabled field (hidden by conditional logic) to save values
|
482 |
-
* API: Added new `add_sub_row()` function
|
483 |
-
* API: Added new `update_sub_row()` function
|
484 |
-
* API: Added new `delete_sub_row()` function
|
485 |
-
* Core: Fixed bug causing 'sync' issues with sub clone fields
|
486 |
-
* Core: Minor fixes and improvements
|
487 |
-
|
488 |
-
= 5.4.6 =
|
489 |
-
* Gallery field: Fixed bug where open sidebar fields were saved to post
|
490 |
-
* Flexible Content field: Fixed bug causing Google map render issue within collapsed layout
|
491 |
-
* Flexible Content field: Fixed bug during 'duplicate layout' where radio input values were lost
|
492 |
-
* API: Fixed bug causing `get_row(true)` to return incorrect values
|
493 |
-
* Core: Fixed bug where preview values did not load for a draft post
|
494 |
-
* Core: Added notice when PRO license fails to validate URL
|
495 |
-
* Core: Fixed bug where conditional logic would incorrectly enable select elements
|
496 |
-
* Core: Minor fixes and improvements
|
497 |
-
|
498 |
-
= 5.4.5 =
|
499 |
-
* API: Fixed bug in `acf_form()` where AJAX validation ignored 'post_title'
|
500 |
-
* API: Improved `update_field()` when saving a new value (when reference value does not yet exist)
|
501 |
-
* Core: Added search input & toggle to admin field groups list
|
502 |
-
* Core: Fixed bug where preview values did not load for a draft post
|
503 |
-
|
504 |
-
= 5.4.4 =
|
505 |
-
* WYSIWYG field: Fixed JS error when 'Disable the visual editor when writing' is checked
|
506 |
-
|
507 |
-
= 5.4.3 =
|
508 |
-
* WYSIWYG field: Fixed JS bug (since WP 4.6) causing conflicts with editor plugins
|
509 |
-
* Google Maps field: Fixed JS error conflict with Divi theme
|
510 |
-
* Radio field: Fixed bug (Chrome only) ignoring default values in cloned sub fields
|
511 |
-
* Core: Fixed `wp_get_sites()` deprecated error (since WP 4.6) shown in network admin
|
512 |
-
|
513 |
-
= 5.4.2 =
|
514 |
-
* API: Fixed bug preventing post_title and post_content values saving in `acf_form()`
|
515 |
-
|
516 |
-
= 5.4.1 =
|
517 |
-
* API: Fixed bug causing `get_fields('options')` to return false
|
518 |
-
* Core: Fixed bug causing `get_current_screen()` to throw PHP error
|
519 |
-
* Core: Fixed bug causing 'Preview Post' to load empty field values
|
520 |
-
|
521 |
-
= 5.4.0 =
|
522 |
-
* Clone field: Added new field type (https://www.advancedcustomfields.com/resources/clone/)
|
523 |
-
* Gallery field: Removed 'Preview Size' setting and improved UI
|
524 |
-
* Taxonomy field: Added compatibility to save/load terms to user object
|
525 |
-
* Select field: Added new 'Return Format' setting
|
526 |
-
* Radio field: Added new 'Return Format' setting
|
527 |
-
* Checkbox field: Added new 'Return Format' setting
|
528 |
-
* Page link field: Added new 'Allow Archives URLs' setting
|
529 |
-
* Core: Fixed plugin update bug delaying updates
|
530 |
-
* Core: Fixed bug when editing field settings in Chrome causing required setting to self toggle
|
531 |
-
* Core: Improved speed and fixed bugs when creating and restoring revisions
|
532 |
-
* Core: Minor fixes and improvements
|
533 |
-
* Language: Updated Portuguese translation - thanks to Pedro Mendonça
|
534 |
-
* Language: Updated Brazilian Portuguese translation - thanks to Augusto Simão
|
535 |
-
* Language: Updated Dutch translation - thanks to Derk Oosterveld
|
536 |
-
* Language: Updated Persian translation - thanks to Kamel
|
537 |
-
* Language: Updated German translation - thanks to Ralf Koller
|
538 |
-
* Language: Updated Swiss German translation - thanks to Raphael Hüni
|
539 |
-
|
540 |
-
View full changelog: https://www.advancedcustomfields.com/changelog/
|
541 |
|
542 |
== Upgrade Notice ==
|
543 |
-
|
544 |
-
= 5.2.7 =
|
545 |
-
* Field class names have changed slightly in v5.2.7 from `field_type-{$type}` to `acf-field-{$type}`. This change was introduced to better optimize JS performance. The previous class names can be added back in with the following filter: https://www.advancedcustomfields.com/resources/acfcompatibility/
|
546 |
-
|
547 |
-
= 3.0.0 =
|
548 |
-
* Editor is broken in WordPress 3.3
|
549 |
-
|
550 |
-
= 2.1.4 =
|
551 |
-
* Adds post_id column back into acf_values
|
67 |
|
68 |
== Changelog ==
|
69 |
|
70 |
+
= 5.8.1 =
|
71 |
+
*Release Date - 3 June 2019*
|
72 |
+
|
73 |
+
* New - Added "Preview Size" and "Return Format" settings to the Gallery field.
|
74 |
+
* Tweak - Improved metabox styling for Gutenberg.
|
75 |
+
* Tweak - Changed default "Preview Size" to medium for the Image field.
|
76 |
+
* Fix - Fixed bug in media modal causing the primary button text to disappear after editing an image.
|
77 |
+
* Fix - Fixed bug preventing the TinyMCE Advanced plugin from adding `< p >` tags.
|
78 |
+
* Fix - Fixed bug where HTML choices were not visible in conditional logic dropdown.
|
79 |
+
* Fix - Fixed bug causing incorrect order of imported/synced flexible content sub fields.
|
80 |
+
* i18n - Updated German translation thanks to Ralf Koller.
|
81 |
+
* i18n - Updated Persian translation thanks to Majix.
|
82 |
+
|
83 |
= 5.8.0 =
|
84 |
*Release Date - 8 May 2019*
|
85 |
|
196 |
* Dev - Reordered various actions and filters for more usefulness.
|
197 |
* i18n - Updated Polish language thanks to Dariusz Zielonka
|
198 |
|
199 |
+
[View the full changelog](https://www.advancedcustomfields.com/changelog/)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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