Version Description
: October 5th, 2018 = * This version includes major improvements. Many new modules and pre-designed sections are now available to create your pages. * New modules : heading, icon, button, Google map, Html content, quote, spacer, divider, contact form. * The user interface has been enhanced with a non intrusive top bar, including do/undo buttons, and global settings for the Nimble builder.
Download this release
Release Info
Developer | nikeo |
Plugin | Nimble Page Builder |
Version | 1.1.0 |
Comparing to | |
See all releases |
Code changes from version 1.0.4 to 1.1.0
- assets/czr/sek/css/sek-control.css +627 -20
- assets/czr/sek/css/sek-control.min.css +1 -1
- assets/czr/sek/css/sek-preview.css +426 -78
- assets/czr/sek/css/sek-preview.min.css +1 -1
- assets/czr/sek/icons/modules/Nimble_2-columns_icon.svg +1 -0
- assets/czr/sek/icons/modules/Nimble_3-columns_icon.svg +1 -0
- assets/czr/sek/icons/modules/Nimble_4-columns_icon.svg +1 -0
- assets/czr/sek/icons/modules/Nimble__divider_icon.svg +1 -0
- assets/czr/sek/icons/modules/Nimble__featured_icon.svg +1 -0
- assets/czr/sek/icons/modules/Nimble__heading_icon.svg +1 -0
- assets/czr/sek/icons/modules/Nimble__icon_icon.svg +1 -0
- assets/czr/sek/icons/modules/Nimble__image_icon.svg +1 -0
- assets/czr/sek/icons/modules/Nimble__spacer_icon.svg +1 -0
- assets/czr/sek/icons/modules/Nimble__text_icon.svg +1 -0
- assets/czr/sek/icons/modules/Nimble_audio_icon.svg +1 -0
- assets/czr/sek/icons/modules/Nimble_button_icon.svg +1 -0
- assets/czr/sek/icons/modules/Nimble_contact-form_icon.svg +29 -0
- assets/czr/sek/icons/modules/Nimble_gallery_icon.svg +1 -0
- assets/czr/sek/icons/modules/Nimble_html_icon.svg +1 -0
- assets/czr/sek/icons/modules/Nimble_map_icon.svg +1 -0
- assets/czr/sek/icons/modules/Nimble_quote_icon.svg +1 -0
- assets/czr/sek/icons/modules/Nimble_rich-text-editor_icon.svg +1 -0
- assets/czr/sek/icons/modules/Nimble_slideshow_icon.svg +1 -0
- assets/czr/sek/icons/modules/Nimble_social_icon.svg +1 -0
- assets/czr/sek/icons/modules/Nimble_testimonial_icon.svg +1 -0
- assets/czr/sek/icons/modules/Nimble_video_icon.svg +1 -0
- assets/czr/sek/js/ccat-sek-control.js +5521 -3020
- assets/czr/sek/js/ccat-sek-control.min.js +1 -1
- assets/czr/sek/js/ccat-sek-preview.js +120 -150
assets/czr/sek/css/sek-control.css
CHANGED
@@ -48,8 +48,20 @@ ul[id*="sub-accordion-section-__nimble__"] {
|
|
48 |
-o-transition: unset;
|
49 |
transition: unset;
|
50 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
|
52 |
-
|
|
|
|
|
53 |
|
54 |
|
55 |
|
@@ -57,7 +69,7 @@ ul[id*="sub-accordion-section-__nimble__"] {
|
|
57 |
[data-sek-content-type] {
|
58 |
float: left;
|
59 |
padding: 0%;
|
60 |
-
margin:
|
61 |
text-align: center;
|
62 |
cursor: move;
|
63 |
/*cursor: -webkit-grab;*/
|
@@ -72,50 +84,93 @@ ul[id*="sub-accordion-section-__nimble__"] {
|
|
72 |
border-radius: 4px;
|
73 |
}
|
74 |
[data-sek-content-type="module"] {
|
75 |
-
width:
|
|
|
76 |
}
|
77 |
-
|
78 |
-
|
|
|
79 |
}
|
80 |
|
81 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
[data-sek-content-type]:hover {
|
83 |
-webkit-box-shadow: 0 12px 20px rgba(0,0,0,.2);
|
84 |
box-shadow: 0 12px 20px rgba(0,0,0,.2);
|
85 |
}
|
86 |
|
87 |
.sek-dragging [data-sek-content-type] {
|
88 |
-
-webkit-box-shadow: 0 2px
|
89 |
-
box-shadow: 0 2px
|
|
|
|
|
|
|
|
|
90 |
}
|
91 |
-
|
92 |
|
93 |
[data-sek-content-type] .sek-module-icon {
|
94 |
display: block;
|
95 |
-
padding:
|
96 |
}
|
97 |
-
[data-sek-content-type] .sek-module-icon .
|
98 |
font-size: 3rem;
|
|
|
99 |
color: #878787;
|
|
|
100 |
}
|
101 |
[data-sek-content-type] .sek-module-title {
|
102 |
-
display:
|
103 |
-
|
104 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
105 |
}
|
106 |
/*.sek-grabbing {
|
107 |
cursor: -webkit-grabbing;
|
108 |
}
|
109 |
*/
|
110 |
-
|
111 |
-
|
|
|
|
|
|
|
|
|
112 |
/* PADDING MARGIN SPACING INPUT */
|
113 |
.sek-pad-marg-inner {
|
114 |
font-size: 12px;
|
115 |
display: -webkit-box;
|
116 |
display: -ms-flexbox;
|
117 |
display: flex;
|
118 |
-
margin: 10px auto
|
119 |
-webkit-box-orient: vertical;
|
120 |
-webkit-box-direction: normal;
|
121 |
-ms-flex-direction: column;
|
@@ -279,7 +334,7 @@ ul[id*="sub-accordion-section-__nimble__"] {
|
|
279 |
flex: 0;
|
280 |
}
|
281 |
.reset-spacing-wrap {
|
282 |
-
padding: 10px;
|
283 |
font-size: 0.8em;
|
284 |
text-decoration: underline;
|
285 |
cursor: pointer;
|
@@ -353,7 +408,7 @@ ul[id*="sub-accordion-section-__nimble__"] {
|
|
353 |
}
|
354 |
|
355 |
|
356 |
-
.sek-bg-pos-wrapper .
|
357 |
fill: #fff;
|
358 |
}
|
359 |
|
@@ -376,7 +431,19 @@ div[data-sek-align] {
|
|
376 |
border-radius: 4px;
|
377 |
cursor: pointer;
|
378 |
}
|
379 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
380 |
.sek-h-align-wrapper .sek-align-icons {
|
381 |
float: right
|
382 |
}
|
@@ -401,4 +468,544 @@ div[data-sek-align].selected {
|
|
401 |
}
|
402 |
.sek-side-nimble-logo-wrapper .sek-nimble-logo {
|
403 |
height: 45px;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
404 |
}
|
48 |
-o-transition: unset;
|
49 |
transition: unset;
|
50 |
}
|
51 |
+
/* CONTROLS */
|
52 |
+
li[id*="__nimble__"].customize-control {
|
53 |
+
margin: 8px 0;
|
54 |
+
padding: 2px;
|
55 |
+
width: calc( 100% - 4px );
|
56 |
+
border: 1px solid rgba(221, 221, 221, 0.43);
|
57 |
+
box-shadow: 1px 1px 2px 0 rgba(75, 75, 85, 0.2);
|
58 |
+
-webkit-box-shadow: 1px 1px 2px 0 rgba(75, 75, 85, 0.2);
|
59 |
+
background-color: #fff;
|
60 |
+
}
|
61 |
|
62 |
+
li[id*="__nimble__"].customize-control span.customize-control-title:first-child {
|
63 |
+
margin-left: 21px;
|
64 |
+
}
|
65 |
|
66 |
|
67 |
|
69 |
[data-sek-content-type] {
|
70 |
float: left;
|
71 |
padding: 0%;
|
72 |
+
margin: 1.8%;
|
73 |
text-align: center;
|
74 |
cursor: move;
|
75 |
/*cursor: -webkit-grab;*/
|
84 |
border-radius: 4px;
|
85 |
}
|
86 |
[data-sek-content-type="module"] {
|
87 |
+
width: 29%;
|
88 |
+
height: 130px;
|
89 |
}
|
90 |
+
/* When sections are displayed in the module picker. Typically the columns sections */
|
91 |
+
li[id*="sek_draggable_modules"] [data-sek-content-type="preset_section"] {
|
92 |
+
width: 29%;
|
93 |
}
|
94 |
|
95 |
+
[data-sek-content-type="preset_section"] {
|
96 |
+
width: 95%;
|
97 |
+
height: 165px;
|
98 |
+
position: relative
|
99 |
+
}
|
100 |
+
[data-sek-content-type="preset_section"] .sek-overlay {
|
101 |
+
display: block;
|
102 |
+
position: absolute;
|
103 |
+
top: 0;
|
104 |
+
left: 0;
|
105 |
+
right: 0;
|
106 |
+
bottom: 0;
|
107 |
+
background-color: #000000;
|
108 |
+
opacity: 0;
|
109 |
+
-webkit-transition: opacity .35s ease;
|
110 |
+
transition: opacity .35s ease;
|
111 |
+
-o-transition: opacity .35s ease;
|
112 |
+
}
|
113 |
+
[data-sek-content-type="preset_section"]:hover .sek-overlay {
|
114 |
+
opacity: 0.15;
|
115 |
+
}
|
116 |
[data-sek-content-type]:hover {
|
117 |
-webkit-box-shadow: 0 12px 20px rgba(0,0,0,.2);
|
118 |
box-shadow: 0 12px 20px rgba(0,0,0,.2);
|
119 |
}
|
120 |
|
121 |
.sek-dragging [data-sek-content-type] {
|
122 |
+
-webkit-box-shadow: 0 2px 5px rgba(0,0,0,.25)!important;
|
123 |
+
box-shadow: 0 2px 5px rgba(0,0,0,.25)!important;
|
124 |
+
}
|
125 |
+
.sek-dragged {
|
126 |
+
background: #33b3db3d;
|
127 |
+
background: rgba(51, 179, 219, 0.24);
|
128 |
}
|
|
|
129 |
|
130 |
[data-sek-content-type] .sek-module-icon {
|
131 |
display: block;
|
132 |
+
padding: 0;
|
133 |
}
|
134 |
+
[data-sek-content-type] .sek-module-icon .nimble-module-icons {
|
135 |
font-size: 3rem;
|
136 |
+
max-width: 100%;/*60%!important;*/
|
137 |
color: #878787;
|
138 |
+
max-height: 86px;
|
139 |
}
|
140 |
[data-sek-content-type] .sek-module-title {
|
141 |
+
display: -webkit-box;
|
142 |
+
display: -ms-flexbox;
|
143 |
+
display: flex;
|
144 |
+
-webkit-box-pack: center;
|
145 |
+
-ms-flex-pack: center;
|
146 |
+
justify-content: center;
|
147 |
+
-webkit-box-align: center;
|
148 |
+
-ms-flex-align: center;
|
149 |
+
align-items: center;
|
150 |
+
padding: 0 6px 0px;
|
151 |
+
font-size: 0.75rem;
|
152 |
+
height: 45px;
|
153 |
+
justify-content: center;
|
154 |
+
position: relative;
|
155 |
+
top: -18px;
|
156 |
}
|
157 |
/*.sek-grabbing {
|
158 |
cursor: -webkit-grabbing;
|
159 |
}
|
160 |
*/
|
161 |
+
.sek-centered-module-title {
|
162 |
+
overflow: hidden;
|
163 |
+
display: -webkit-box;
|
164 |
+
-webkit-line-clamp: 2;
|
165 |
+
-webkit-box-orient: vertical;
|
166 |
+
}
|
167 |
/* PADDING MARGIN SPACING INPUT */
|
168 |
.sek-pad-marg-inner {
|
169 |
font-size: 12px;
|
170 |
display: -webkit-box;
|
171 |
display: -ms-flexbox;
|
172 |
display: flex;
|
173 |
+
margin: 10px auto 10px auto;
|
174 |
-webkit-box-orient: vertical;
|
175 |
-webkit-box-direction: normal;
|
176 |
-ms-flex-direction: column;
|
334 |
flex: 0;
|
335 |
}
|
336 |
.reset-spacing-wrap {
|
337 |
+
padding: 10px 0 0;
|
338 |
font-size: 0.8em;
|
339 |
text-decoration: underline;
|
340 |
cursor: pointer;
|
408 |
}
|
409 |
|
410 |
|
411 |
+
.sek-bg-pos-wrapper .sek-svg-bg-pos {
|
412 |
fill: #fff;
|
413 |
}
|
414 |
|
431 |
border-radius: 4px;
|
432 |
cursor: pointer;
|
433 |
}
|
434 |
+
horizAlignmentWithDeviceSwitcher
|
435 |
+
div[data-input-type="horizTextAlignmentWithDeviceSwitcher"] .czr-input {
|
436 |
+
text-align: center;
|
437 |
+
}
|
438 |
+
div[data-input-type="horizTextAlignmentWithDeviceSwitcher"] .sek-h-align-wrapper {
|
439 |
+
display: inline-block;
|
440 |
+
}
|
441 |
+
div[data-input-type="horizAlignmentWithDeviceSwitcher"] .czr-input {
|
442 |
+
text-align: center;
|
443 |
+
}
|
444 |
+
div[data-input-type="horizAlignmentWithDeviceSwitcher"] .sek-h-align-wrapper {
|
445 |
+
display: inline-block;
|
446 |
+
}
|
447 |
.sek-h-align-wrapper .sek-align-icons {
|
448 |
float: right
|
449 |
}
|
468 |
}
|
469 |
.sek-side-nimble-logo-wrapper .sek-nimble-logo {
|
470 |
height: 45px;
|
471 |
+
}
|
472 |
+
|
473 |
+
[data-input-type="code_editor"] .czr-input {
|
474 |
+
width: 100%;
|
475 |
+
float: left;
|
476 |
+
}
|
477 |
+
|
478 |
+
|
479 |
+
|
480 |
+
/* DEFAULT UI BUTTONS STYLE, for unit picker, etc*/
|
481 |
+
.sek-unit-wrapper {
|
482 |
+
text-align: center;
|
483 |
+
}
|
484 |
+
.sek-ui-button-group {
|
485 |
+
display: inline-block;
|
486 |
+
}
|
487 |
+
.sek-ui-button-group .sek-ui-button:first-child {
|
488 |
+
border-radius: 3px 0 0 3px;
|
489 |
+
}
|
490 |
+
.sek-ui-button-group .sek-ui-button+.sek-ui-button {
|
491 |
+
margin-left: -1px;
|
492 |
+
}
|
493 |
+
.sek-ui-button-group .sek-ui-button:last-child {
|
494 |
+
border-radius: 0 3px 3px 0;
|
495 |
+
}
|
496 |
+
.sek-ui-button {
|
497 |
+
height: 28px;
|
498 |
+
line-height: 25px;
|
499 |
+
padding: 0 10px 2px;
|
500 |
+
border-radius: 3px;
|
501 |
+
white-space: nowrap;
|
502 |
+
border-width: 1px;
|
503 |
+
border-style: solid;
|
504 |
+
display: inline-flex;
|
505 |
+
text-decoration: none;
|
506 |
+
font-size: 12px;
|
507 |
+
margin: 0;
|
508 |
+
cursor: pointer;
|
509 |
+
-webkit-appearance: none;
|
510 |
+
background: none;
|
511 |
+
color: #555;
|
512 |
+
border-color: #ccc;
|
513 |
+
background: #f7f7f7;
|
514 |
+
box-shadow: inset 0 -1px 0 #ccc;
|
515 |
+
vertical-align: top;
|
516 |
+
}
|
517 |
+
|
518 |
+
|
519 |
+
.sek-ui-button:hover {
|
520 |
+
background: #fafafa;
|
521 |
+
border-color: #999;
|
522 |
+
box-shadow: inset 0 -1px 0 #999;
|
523 |
+
color: #23282d;
|
524 |
+
}
|
525 |
+
.sek-ui-button:active:not(:disabled) {
|
526 |
+
background: #eee;
|
527 |
+
border-color: #999;
|
528 |
+
box-shadow: inset 0 1px 0 #999;
|
529 |
+
}
|
530 |
+
.sek-ui-button:focus:not(:disabled) {
|
531 |
+
background: #fafafa;
|
532 |
+
color: #23282d;
|
533 |
+
border-color: #999;
|
534 |
+
box-shadow: inset 0 -1px 0 #999, 0 0 0 2px #fbfbfb;
|
535 |
+
outline: none;
|
536 |
+
}
|
537 |
+
|
538 |
+
.sek-ui-button.is-selected {
|
539 |
+
background: #555d66;
|
540 |
+
border-color: #555d66;
|
541 |
+
box-shadow: inset 0 -1px 0 #555d66;
|
542 |
+
color: #fff;
|
543 |
+
text-decoration: none;
|
544 |
+
}
|
545 |
+
.sek-ui-button.is-selected:focus:not(:disabled), .sek-ui-button.is-selected:hover {
|
546 |
+
background: #555d66;
|
547 |
+
border-color: #4f4f4f;
|
548 |
+
color: #fff;
|
549 |
+
}
|
550 |
+
.sek-ui-button.is-selected:focus:not(:disabled) {
|
551 |
+
box-shadow: inset 0 -1px 0 #4f4f4f;
|
552 |
+
}
|
553 |
+
.sek-ui-button.is-selected:focus:not(:disabled) {
|
554 |
+
/*box-shadow: inset 0 -1px 0 #00435d, 0 0 0 2px #bfe7f3;*/
|
555 |
+
outline: none;
|
556 |
+
}
|
557 |
+
|
558 |
+
/* Button style for the content type switcher */
|
559 |
+
.sek-content-type-wrapper {
|
560 |
+
margin-bottom: 8px;
|
561 |
+
width: 100%;
|
562 |
+
float: left;
|
563 |
+
}
|
564 |
+
.sek-content-type-wrapper .sek-ui-button-group {
|
565 |
+
display: block;
|
566 |
+
}
|
567 |
+
.sek-content-type-wrapper .sek-ui-button {
|
568 |
+
width: 49%;
|
569 |
+
text-align: center;
|
570 |
+
display: inline-block;
|
571 |
+
padding: 3px 0;
|
572 |
+
height: auto;
|
573 |
+
text-transform: uppercase;
|
574 |
+
}
|
575 |
+
|
576 |
+
|
577 |
+
|
578 |
+
|
579 |
+
|
580 |
+
/* DEVICE SWITCHER */
|
581 |
+
.sek-input-device-switcher .sek-switcher:before {
|
582 |
+
display: inline-block;
|
583 |
+
-webkit-font-smoothing: antialiased;
|
584 |
+
font: normal 20px/30px "dashicons";
|
585 |
+
vertical-align: top;
|
586 |
+
/* margin: 3px 0;
|
587 |
+
padding: 4px 8px;*/
|
588 |
+
color: #656a6f;
|
589 |
+
position: relative;
|
590 |
+
top: -5px
|
591 |
+
}
|
592 |
+
.sek-input-device-switcher .sek-switcher {
|
593 |
+
cursor: pointer;
|
594 |
+
background: transparent;
|
595 |
+
border: none;
|
596 |
+
padding: 0 1px;
|
597 |
+
margin: 0 0 0 -2px;
|
598 |
+
box-shadow: none;
|
599 |
+
border-top: 1px solid transparent;
|
600 |
+
border-bottom: 4px solid transparent;
|
601 |
+
transition: .15s color ease-in-out,
|
602 |
+
.15s background-color ease-in-out,
|
603 |
+
.15s border-color ease-in-out;
|
604 |
+
}
|
605 |
+
|
606 |
+
/*.sek-input-device-switcher .sek-switcher.active {
|
607 |
+
color: #0073aa;
|
608 |
+
}*/
|
609 |
+
|
610 |
+
.sek-input-device-switcher .sek-switcher:hover,
|
611 |
+
.sek-input-device-switcher .sek-switcher:focus {
|
612 |
+
background-color: #fff;
|
613 |
+
}
|
614 |
+
|
615 |
+
/*.sek-input-device-switcher .sek-switcher:focus,
|
616 |
+
.sek-input-device-switcher .sek-switcher.active:hover {
|
617 |
+
border-bottom-color: #0073aa;
|
618 |
+
}*/
|
619 |
+
|
620 |
+
.sek-input-device-switcher .sek-switcher.active:before {
|
621 |
+
color: #191e23;
|
622 |
+
}
|
623 |
+
|
624 |
+
.sek-input-device-switcher .sek-switcher:hover:before,
|
625 |
+
.sek-input-device-switcher .sek-switcher:focus:before {
|
626 |
+
color: #0073aa;
|
627 |
+
}
|
628 |
+
|
629 |
+
.sek-input-device-switcher .preview-desktop:before {
|
630 |
+
content: "\f472";
|
631 |
+
}
|
632 |
+
|
633 |
+
.sek-input-device-switcher .preview-tablet:before {
|
634 |
+
content: "\f471";
|
635 |
+
}
|
636 |
+
|
637 |
+
.sek-input-device-switcher .preview-mobile:before {
|
638 |
+
content: "\f470";
|
639 |
+
}
|
640 |
+
|
641 |
+
|
642 |
+
/* RANGE WITH UNIT PICKER */
|
643 |
+
.sek-range-with-unit-picker-wrapper{
|
644 |
+
width: 100%;
|
645 |
+
float: left;
|
646 |
+
margin-bottom: 8px;
|
647 |
+
}
|
648 |
+
.sek-range-with-unit-picker-wrapper .sek-unit-wrapper{ float: right; }
|
649 |
+
.sek-range-with-unit-picker-wrapper > div { float: left; }
|
650 |
+
|
651 |
+
|
652 |
+
/* BORDERS AND BORDER RADIUS*/
|
653 |
+
.sek-borders {
|
654 |
+
width: 100%;
|
655 |
+
float: left;
|
656 |
+
margin-bottom: 8px;
|
657 |
+
}
|
658 |
+
.sek-borders > div {float: left;width: 100%}
|
659 |
+
.sek-borders .sek-range-unit-wrapper > div {float: left;}
|
660 |
+
.sek-borders .sek-border-type-wrapper {margin-bottom: 5px;}
|
661 |
+
.sek-borders .sek-range-unit-wrapper {margin-bottom: 5px;}
|
662 |
+
.sek-borders .sek-range-unit-wrapper .sek-unit-wrapper { float: right;}
|
663 |
+
.sek-borders .sek-color-wrapper { width:100%;}
|
664 |
+
.sek-borders .sek-color-wrapper .sek-color-picker{ width: 50%;float: left;}
|
665 |
+
.sek-borders .sek-color-wrapper .sek-reset-button { width: 50%;float: right;}
|
666 |
+
|
667 |
+
[data-sek-radius-type="top_right"] > i.material-icons {
|
668 |
+
-webkit-transform: rotate(90deg);
|
669 |
+
-ms-transform: rotate(90deg);
|
670 |
+
transform: rotate(90deg);
|
671 |
+
}
|
672 |
+
[data-sek-radius-type="bottom_right"] > i.material-icons {
|
673 |
+
-webkit-transform: rotate(180deg);
|
674 |
+
-ms-transform: rotate(180deg);
|
675 |
+
transform: rotate(180deg);
|
676 |
+
}
|
677 |
+
[data-sek-radius-type="bottom_left"] > i.material-icons {
|
678 |
+
-webkit-transform: rotate(270deg);
|
679 |
+
-ms-transform: rotate(270deg);
|
680 |
+
transform: rotate(270deg);
|
681 |
+
}
|
682 |
+
|
683 |
+
/* RANGE INPUT */
|
684 |
+
/* This range slider is inspired from the one used in the Gutenberg plugin ( https://github.com/WordPress/gutenberg ), released under GNU General Public License
|
685 |
+
credits : Gutenberg team @wordpress */
|
686 |
+
.sek-range-wrapper {
|
687 |
+
width: 44%;
|
688 |
+
margin-right: 4px;
|
689 |
+
}
|
690 |
+
.sek-no-unit-picker .sek-range-wrapper {
|
691 |
+
width: 70%;
|
692 |
+
}
|
693 |
+
.sek-number-wrapper {
|
694 |
+
width: 50px;
|
695 |
+
margin-right: 5px;
|
696 |
+
}
|
697 |
+
|
698 |
+
|
699 |
+
.sek-range-input{
|
700 |
+
flex:1;
|
701 |
+
width:100%;
|
702 |
+
padding:0;
|
703 |
+
-webkit-appearance:none;
|
704 |
+
background:transparent
|
705 |
+
}
|
706 |
+
.sek-range-input::-webkit-slider-thumb{
|
707 |
+
-webkit-appearance:none;
|
708 |
+
height:20px;
|
709 |
+
width:20px;
|
710 |
+
border-radius:50%;
|
711 |
+
cursor:pointer;
|
712 |
+
background:#555d66;
|
713 |
+
border:4px solid transparent;
|
714 |
+
background-clip:padding-box;
|
715 |
+
box-sizing:border-box;
|
716 |
+
margin-top:-8px
|
717 |
+
}
|
718 |
+
.sek-range-input::-moz-range-thumb{
|
719 |
+
height:20px;
|
720 |
+
width:20px;
|
721 |
+
border-radius:50%;
|
722 |
+
cursor:pointer;
|
723 |
+
background:#555d66;
|
724 |
+
border:4px solid transparent;
|
725 |
+
background-clip:padding-box;
|
726 |
+
box-sizing:border-box;
|
727 |
+
margin-top:-7px
|
728 |
+
}
|
729 |
+
.sek-range-input::-ms-thumb{
|
730 |
+
height:20px;
|
731 |
+
width:20px;
|
732 |
+
border-radius:50%;
|
733 |
+
cursor:pointer;
|
734 |
+
background:#555d66;
|
735 |
+
border:4px solid transparent;
|
736 |
+
background-clip:padding-box;
|
737 |
+
box-sizing:border-box;
|
738 |
+
margin-top:-8px
|
739 |
+
}
|
740 |
+
/* margin-top:0;
|
741 |
+
height:14px;
|
742 |
+
width:14px;
|
743 |
+
border:2px solid transparent*/
|
744 |
+
/*}*/
|
745 |
+
.sek-range-input:focus{
|
746 |
+
outline:none
|
747 |
+
}
|
748 |
+
/*.sek-range-input:focus::-webkit-slider-thumb{
|
749 |
+
background-color:#fff;
|
750 |
+
color:#191e23;
|
751 |
+
box-shadow:inset 0 0 0 1px #6c7781,inset 0 0 0 2px #fff;
|
752 |
+
outline:2px solid transparent;
|
753 |
+
outline-offset:-2px
|
754 |
+
}
|
755 |
+
.sek-range-input:focus::-moz-range-thumb{
|
756 |
+
background-color:#fff;
|
757 |
+
color:#191e23;
|
758 |
+
box-shadow:inset 0 0 0 1px #6c7781,inset 0 0 0 2px #fff;
|
759 |
+
outline:2px solid transparent;
|
760 |
+
outline-offset:-2px
|
761 |
+
}
|
762 |
+
.sek-range-input:focus::-ms-thumb{
|
763 |
+
background-color:#fff;
|
764 |
+
color:#191e23;
|
765 |
+
box-shadow:inset 0 0 0 1px #6c7781,inset 0 0 0 2px #fff;
|
766 |
+
outline:2px solid transparent;
|
767 |
+
outline-offset:-2px
|
768 |
+
}*/
|
769 |
+
.sek-range-input::-webkit-slider-runnable-track{
|
770 |
+
height:3px;
|
771 |
+
cursor:pointer;
|
772 |
+
background:#e2e4e7;
|
773 |
+
border-radius:1.5px;
|
774 |
+
margin-top:-4px
|
775 |
+
}
|
776 |
+
.sek-range-input::-moz-range-track{
|
777 |
+
height:3px;
|
778 |
+
cursor:pointer;
|
779 |
+
background:#e2e4e7;
|
780 |
+
border-radius:1.5px
|
781 |
+
}
|
782 |
+
.sek-range-input::-ms-track{
|
783 |
+
margin-top:-4px;
|
784 |
+
background:transparent;
|
785 |
+
border-color:transparent;
|
786 |
+
color:transparent;
|
787 |
+
height:3px;
|
788 |
+
cursor:pointer;
|
789 |
+
background:#e2e4e7;
|
790 |
+
border-radius:1.5px
|
791 |
+
}
|
792 |
+
|
793 |
+
|
794 |
+
|
795 |
+
|
796 |
+
|
797 |
+
|
798 |
+
|
799 |
+
|
800 |
+
|
801 |
+
|
802 |
+
|
803 |
+
|
804 |
+
|
805 |
+
|
806 |
+
|
807 |
+
|
808 |
+
|
809 |
+
|
810 |
+
/* LEVEL UI CHEVRON ICON NEXT TO TITLE */
|
811 |
+
.sek-animated-arrow {
|
812 |
+
position: absolute;
|
813 |
+
left: -20px;
|
814 |
+
margin-left: 6px;
|
815 |
+
top: 3px;
|
816 |
+
font-size: 10px;
|
817 |
+
color: #617379;
|
818 |
+
-webkit-transform: rotate(0deg);
|
819 |
+
-ms-transform: rotate(0deg);
|
820 |
+
transform: rotate(0deg);
|
821 |
+
-webkit-transition: -webkit-transform 0.2s ease-in-out;
|
822 |
+
transition: -webkit-transform 0.2s ease-in-out;
|
823 |
+
-o-transition: transform 0.2s ease-in-out;
|
824 |
+
transition: transform 0.2s ease-in-out;
|
825 |
+
transition: transform 0.2s ease-in-out, -webkit-transform 0.2s ease-in-out;
|
826 |
+
display: -webkit-box;
|
827 |
+
display: -ms-flexbox;
|
828 |
+
display: flex;
|
829 |
+
-webkit-box-pack: center;
|
830 |
+
-ms-flex-pack: center;
|
831 |
+
justify-content: center;
|
832 |
+
height: 100%;
|
833 |
+
-webkit-box-align: center;
|
834 |
+
-ms-flex-align: center;
|
835 |
+
align-items: center;
|
836 |
+
}
|
837 |
+
[data-sek-expanded="true"] label > .customize-control-title .sek-animated-arrow {
|
838 |
+
-webkit-transform: rotate(180deg);
|
839 |
+
-ms-transform: rotate(180deg);
|
840 |
+
transform: rotate(180deg);
|
841 |
+
}
|
842 |
+
|
843 |
+
/* STYLE FOR THE LEVEL ICON NEXT TO THE CONTROL TITLE */
|
844 |
+
.sek-level-option-icon {
|
845 |
+
padding-right: 5px;
|
846 |
+
min-width: 22px;
|
847 |
+
text-align: center;
|
848 |
+
}
|
849 |
+
|
850 |
+
|
851 |
+
|
852 |
+
|
853 |
+
|
854 |
+
/* TOP BAR */
|
855 |
+
|
856 |
+
/* space for the Nimble topbar */
|
857 |
+
#customize-preview iframe {top: 36px;}
|
858 |
+
|
859 |
+
#nimble-top-bar {
|
860 |
+
max-height: 36px;
|
861 |
+
position: absolute;
|
862 |
+
text-align: center;
|
863 |
+
right: 0;
|
864 |
+
left: 0;
|
865 |
+
z-index: 20;
|
866 |
+
color: #fff;
|
867 |
+
display: block;
|
868 |
+
-webkit-transition: all 0.3s ease-in-out;
|
869 |
+
-moz-transition: all, 0.3s ease-in-out;
|
870 |
+
-ms-transition: all, 0.3s ease-in-out;
|
871 |
+
-o-transition: all, 0.3s ease-in-out;
|
872 |
+
transition: all 0.3s ease-in-out;
|
873 |
+
/*visibility: hidden;*/
|
874 |
+
opacity: 0.3;
|
875 |
+
top : 0%;
|
876 |
+
background: rgba(0, 0, 0, 0.5);
|
877 |
+
padding: 2px;
|
878 |
+
z-index: 99999;
|
879 |
+
display: -webkit-box;
|
880 |
+
display: -ms-flexbox;
|
881 |
+
display: flex;
|
882 |
+
-webkit-box-align: center;
|
883 |
+
-ms-flex-align: center;
|
884 |
+
align-items: center;
|
885 |
+
/* flex-direction: column; */
|
886 |
+
flex: 0 0 100%;
|
887 |
+
max-width: 100%;
|
888 |
+
}
|
889 |
+
|
890 |
+
body.nimble-top-bar-visible #nimble-top-bar {
|
891 |
+
/*visibility: inherit;*/
|
892 |
+
opacity: 1;
|
893 |
+
}
|
894 |
+
|
895 |
+
#nimble-top-bar:hover {
|
896 |
+
background: rgba(0, 0, 0, 0.7);
|
897 |
+
}
|
898 |
+
|
899 |
+
#nimble-top-bar .nimble-top-bar-content {
|
900 |
+
display: inline-block;
|
901 |
+
line-height: 20px;
|
902 |
+
width: 80%;
|
903 |
+
}
|
904 |
+
|
905 |
+
#nimble-top-bar .sek-do-undo .icon:before {
|
906 |
+
display: inline-block;
|
907 |
+
-webkit-font-smoothing: antialiased;
|
908 |
+
font: normal 20px/30px "dashicons";
|
909 |
+
vertical-align: top;
|
910 |
+
/* margin: 3px 0;
|
911 |
+
padding: 4px 8px;*/
|
912 |
+
color: #fff;
|
913 |
+
}
|
914 |
+
#nimble-top-bar .sek-settings {
|
915 |
+
font-size: 18px;
|
916 |
+
padding: 0 10px;
|
917 |
+
}
|
918 |
+
|
919 |
+
#nimble-top-bar button {
|
920 |
+
background: none;
|
921 |
+
border: none;
|
922 |
+
color: white;
|
923 |
+
cursor: pointer;
|
924 |
+
/* opacity: 0.8;*/
|
925 |
+
}
|
926 |
+
#nimble-top-bar button[data-nimble-state="disabled"] {
|
927 |
+
cursor: inherit;
|
928 |
+
opacity: 0.4!important;
|
929 |
+
cursor: not-allowed;
|
930 |
+
}
|
931 |
+
#nimble-top-bar .sek-do-undo button:hover {
|
932 |
+
opacity: 1;
|
933 |
+
}
|
934 |
+
#nimble-top-bar .sek-do-undo button:focus {
|
935 |
+
outline: none;
|
936 |
+
}
|
937 |
+
#nimble-top-bar .sek-do-undo .icon.undo:before {
|
938 |
+
content:"\f171";
|
939 |
+
-webkit-transform: rotate(-45deg);
|
940 |
+
-ms-transform: rotate(-45deg);
|
941 |
+
transform: rotate(-45deg);
|
942 |
+
}
|
943 |
+
#nimble-top-bar .sek-do-undo .icon.do:before {
|
944 |
+
content:"\f172";
|
945 |
+
-webkit-transform: rotate(45deg);
|
946 |
+
-ms-transform: rotate(45deg);
|
947 |
+
transform: rotate(45deg);
|
948 |
+
}
|
949 |
+
#nimble-top-bar .sek-add-content button {
|
950 |
+
padding-top: 3px;
|
951 |
+
}
|
952 |
+
#nimble-top-bar .sek-nimble-doc {
|
953 |
+
position: absolute;
|
954 |
+
right: 10px;
|
955 |
+
cursor: pointer;
|
956 |
+
}
|
957 |
+
|
958 |
+
|
959 |
+
/*.czr-preview-notification a, .czr-preview-notification h2 {color: #fff; margin: 1em 0;}
|
960 |
+
|
961 |
+
.czr-preview-notification .czr-preview-note-close {
|
962 |
+
position: absolute;
|
963 |
+
top: 10px;
|
964 |
+
right: 25px;
|
965 |
+
font-size: 31px;
|
966 |
+
cursor: pointer;
|
967 |
+
}
|
968 |
+
|
969 |
+
.czr-preview-notification .fa-arrow-left {
|
970 |
+
position: absolute;
|
971 |
+
bottom: 10px;
|
972 |
+
left: 25px;
|
973 |
+
font-size: 40px;
|
974 |
+
}
|
975 |
+
|
976 |
+
.czr-preview-notification .czr-note-message {
|
977 |
+
font-size: 16px;
|
978 |
+
line-height: 1.5em;
|
979 |
+
margin: 0.5em 0;
|
980 |
+
}*/
|
981 |
+
|
982 |
+
|
983 |
+
|
984 |
+
|
985 |
+
|
986 |
+
|
987 |
+
/* VARIOUS HELPER CLASSES */
|
988 |
+
.sek-float-right {float: right;}
|
989 |
+
.sek-float-left { float: left;}
|
990 |
+
.sek-flex-vertical-center {
|
991 |
+
display: -webkit-box;
|
992 |
+
display: -ms-flexbox;
|
993 |
+
display: flex;
|
994 |
+
-webkit-box-align: center;
|
995 |
+
-ms-flex-align: center;
|
996 |
+
align-items: center;
|
997 |
+
}
|
998 |
+
|
999 |
+
|
1000 |
+
|
1001 |
+
|
1002 |
+
|
1003 |
+
|
1004 |
+
|
1005 |
+
/* FRONT MODULE UI */
|
1006 |
+
li[id^="accordion-section-__nimble__"] {
|
1007 |
+
margin-top: 16px;
|
1008 |
+
}
|
1009 |
+
li[id^="accordion-section-__nimble__"] > h3 {
|
1010 |
+
border-top:1px solid #ddd;
|
1011 |
}
|
assets/czr/sek/css/sek-control.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
@font-face{font-family:'Material Icons';font-style:normal;font-weight:400;src:url(../fonts/material-icons/MaterialIcons-Regular.eot);src:local('Material Icons'),local('MaterialIcons-Regular'),url(../fonts/material-icons/MaterialIcons-Regular.woff2) format('woff2'),url(../fonts/material-icons/MaterialIcons-Regular.woff) format('woff'),url(../fonts/material-icons/MaterialIcons-Regular.ttf) format('truetype')}.material-icons{font-family:'Material Icons';font-weight:400;font-style:normal;font-size:24px;display:inline-block;line-height:1;text-transform:none;letter-spacing:normal;word-wrap:normal;white-space:nowrap;direction:ltr;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale;-webkit-font-feature-settings:'liga';font-feature-settings:'liga'}ul[id*=sub-accordion-section-__nimble__]{background:#f2f2f2!important}#customize-theme-controls .customize-pane-child[id*="__nimble__"]{-webkit-transition:unset;-o-transition:unset;transition:unset}[data-sek-content-type]{float:left;padding:0;margin:3%;text-align:center;cursor:move;-webkit-transition:-webkit-box-shadow .2s ease;transition:-webkit-box-shadow .2s ease;-o-transition:box-shadow .2s ease;transition:box-shadow .2s ease;transition:box-shadow .2s ease,-webkit-box-shadow .2s ease;-webkit-box-shadow:0 2px 5px rgba(0,0,0,.25);box-shadow:0 2px 5px rgba(0,0,0,.25);border-radius:4px}[data-sek-content-type=module]{width:40%}[data-sek-content-type=preset_section]{width:90%}[data-sek-content-type]:hover{-webkit-box-shadow:0 12px 20px rgba(0,0,0,.2);box-shadow:0 12px 20px rgba(0,0,0,.2)}.sek-dragging [data-sek-content-type]{-webkit-box-shadow:0 2px 6px rgba(0,0,0,.35)!important;box-shadow:0 2px 6px rgba(0,0,0,.35)!important}[data-sek-content-type] .sek-module-icon{display:block;padding:10px 0 0}[data-sek-content-type] .sek-module-icon .material-icons{font-size:3rem;color:#878787}[data-sek-content-type] .sek-module-title{display:block;padding:10px;font-size:.9em}.sek-pad-marg-inner{font-size:12px;display:-webkit-box;display:-ms-flexbox;display:flex;margin:10px auto 0 auto;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;padding:0;background-color:#e6e6e6;border:1px solid #c5c5c5;height:192px;width:232px;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-transition:background-color .2s ease;-o-transition:background-color .2s ease;transition:background-color .2s ease}.sek-pm-top-bottom-wrap{height:46px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.sek-flex-center-stretch{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch}.sek-pm-input{width:35px;height:15px;padding:0;text-align:center;font-family:Source Sans Pro;padding:5px;border-radius:3px;text-align:left;font-size:13px;outline:0;-webkit-box-shadow:inset 1px 1px 3px rgba(0,0,0,.15);box-shadow:inset 1px 1px 3px rgba(0,0,0,.15);border:1px solid #ced6d9}.sek-pm-input-parent .sek-pm-input{-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto;display:block;margin:auto 3px;-webkit-box-sizing:border-box;box-sizing:border-box;padding:1px 3px;font-size:12px;font-weight:300;min-width:34px;min-height:20px;color:#313131}.sek-pm-middle-wrap{display:-webkit-box;display:-ms-flexbox;display:flex;height:100px;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.sek-pm-margin-left,.sek-pm-margin-right{width:46px}.sek-pm-padding-wrapper{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;background-color:#fff;border:1px solid #ced6d9;height:100px;width:140px;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;padding:5px;-webkit-transition:background-color .2s ease;-o-transition:background-color .2s ease;transition:background-color .2s ease;-webkit-box-sizing:border-box;box-sizing:border-box;margin:auto}.sek-flex-justify-center{min-height:0;min-width:0;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.sek-flex-space-between{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.sek-pm-input-parent{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex}.sek-pm-input-parent .sek-pm-input{min-height:25px;min-width:40px;background-color:#fff}.sek-pm-input-parent .sek-pm-input{-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto;display:block;margin:auto 3px!important;-webkit-box-sizing:border-box;box-sizing:border-box;padding:1px 3px;font-size:12px;font-weight:300;min-width:34px;min-height:20px;color:#313131;width:40px!important;text-align:center}.sek-pm-padding-wrapper label{margin:0}.sek-pad-marg-inner label{-webkit-box-flex:0;-ms-flex:0;flex:0}.reset-spacing-wrap{padding:10px;font-size:.8em;text-decoration:underline;cursor:pointer;text-align:center}.reset-spacing-wrap:hover{color:#006799}.sek-bg-pos-wrapper{padding:10px;text-align:center;display:inline-block;width:90px;height:90px}.sek-bg-pos-wrapper{display:inline-block;width:90px;height:90px}.sek-bg-pos-wrapper .sek-bg-pos{cursor:pointer;width:24px;height:24px;margin:3px;float:left}.sek-bg-pos-wrapper input[type=radio]{display:none}.sek-bg-pos-wrapper .sek-bg-pos span{display:inline-block;width:100%;height:100%;border-radius:6px;background:#e6e6e6 no-repeat center;-webkit-transition:background-color .2s ease;-o-transition:background-color .2s ease;transition:background-color .2s ease}.sek-bg-pos-wrapper .sek-bg-pos span:hover{background-color:#33b3db}.sek-bg-pos-wrapper .sek-bg-pos span:hover svg{visibility:visible}.sek-bg-pos-wrapper .sek-bg-pos input[type=radio]:checked+span{background-color:#33b3db}.sek-bg-pos-wrapper .sek-bg-pos input[type=radio]:checked+span svg{visibility:visible}.sek-bg-pos-wrapper .sek-bg-pos span svg{visibility:hidden;shape-rendering:crispEdges}.sek-bg-pos-wrapper .cls-5{fill:#fff}div[data-sek-align]{margin:0 5px;padding:4px;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end;position:relative;text-align:center;width:23px;height:24px;top:-4px;border-radius:4px;cursor:pointer}.sek-h-align-wrapper .sek-align-icons{float:right}div[data-sek-align]:hover{-webkit-box-shadow:inset 0 0 0 1px #555d66,inset 0 0 0 2px #fff;box-shadow:inset 0 0 0 1px #555d66,inset 0 0 0 2px #fff}div[data-sek-align].selected{outline:0;color:#fff;-webkit-box-shadow:none;box-shadow:none;background:#555d66}.sek-side-nimble-logo-wrapper{padding:4px 25px 0 2px!important}.sek-side-nimble-logo-wrapper .sek-nimble-logo{height:45px}
|
1 |
+
@font-face{font-family:'Material Icons';font-style:normal;font-weight:400;src:url(../fonts/material-icons/MaterialIcons-Regular.eot);src:local('Material Icons'),local('MaterialIcons-Regular'),url(../fonts/material-icons/MaterialIcons-Regular.woff2) format('woff2'),url(../fonts/material-icons/MaterialIcons-Regular.woff) format('woff'),url(../fonts/material-icons/MaterialIcons-Regular.ttf) format('truetype')}.material-icons{font-family:'Material Icons';font-weight:400;font-style:normal;font-size:24px;display:inline-block;line-height:1;text-transform:none;letter-spacing:normal;word-wrap:normal;white-space:nowrap;direction:ltr;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale;-webkit-font-feature-settings:'liga';font-feature-settings:'liga'}ul[id*=sub-accordion-section-__nimble__]{background:#f2f2f2!important}#customize-theme-controls .customize-pane-child[id*="__nimble__"]{-webkit-transition:unset;-o-transition:unset;transition:unset}li[id*="__nimble__"].customize-control{margin:8px 0;padding:2px;width:calc(100% - 4px);border:1px solid rgba(221,221,221,.43);box-shadow:1px 1px 2px 0 rgba(75,75,85,.2);-webkit-box-shadow:1px 1px 2px 0 rgba(75,75,85,.2);background-color:#fff}li[id*="__nimble__"].customize-control span.customize-control-title:first-child{margin-left:21px}[data-sek-content-type]{float:left;padding:0;margin:1.8%;text-align:center;cursor:move;-webkit-transition:-webkit-box-shadow .2s ease;transition:-webkit-box-shadow .2s ease;-o-transition:box-shadow .2s ease;transition:box-shadow .2s ease;transition:box-shadow .2s ease,-webkit-box-shadow .2s ease;-webkit-box-shadow:0 2px 5px rgba(0,0,0,.25);box-shadow:0 2px 5px rgba(0,0,0,.25);border-radius:4px}[data-sek-content-type=module]{width:29%;height:130px}li[id*=sek_draggable_modules] [data-sek-content-type=preset_section]{width:29%}[data-sek-content-type=preset_section]{width:95%;height:165px;position:relative}[data-sek-content-type=preset_section] .sek-overlay{display:block;position:absolute;top:0;left:0;right:0;bottom:0;background-color:#000;opacity:0;-webkit-transition:opacity .35s ease;transition:opacity .35s ease;-o-transition:opacity .35s ease}[data-sek-content-type=preset_section]:hover .sek-overlay{opacity:.15}[data-sek-content-type]:hover{-webkit-box-shadow:0 12px 20px rgba(0,0,0,.2);box-shadow:0 12px 20px rgba(0,0,0,.2)}.sek-dragging [data-sek-content-type]{-webkit-box-shadow:0 2px 5px rgba(0,0,0,.25)!important;box-shadow:0 2px 5px rgba(0,0,0,.25)!important}.sek-dragged{background:#33b3db3d;background:rgba(51,179,219,.24)}[data-sek-content-type] .sek-module-icon{display:block;padding:0}[data-sek-content-type] .sek-module-icon .nimble-module-icons{font-size:3rem;max-width:100%;color:#878787;max-height:86px}[data-sek-content-type] .sek-module-title{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding:0 6px 0;font-size:.75rem;height:45px;justify-content:center;position:relative;top:-18px}.sek-centered-module-title{overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.sek-pad-marg-inner{font-size:12px;display:-webkit-box;display:-ms-flexbox;display:flex;margin:10px auto 10px auto;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;padding:0;background-color:#e6e6e6;border:1px solid #c5c5c5;height:192px;width:232px;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-transition:background-color .2s ease;-o-transition:background-color .2s ease;transition:background-color .2s ease}.sek-pm-top-bottom-wrap{height:46px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.sek-flex-center-stretch{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch}.sek-pm-input{width:35px;height:15px;padding:0;text-align:center;font-family:Source Sans Pro;padding:5px;border-radius:3px;text-align:left;font-size:13px;outline:0;-webkit-box-shadow:inset 1px 1px 3px rgba(0,0,0,.15);box-shadow:inset 1px 1px 3px rgba(0,0,0,.15);border:1px solid #ced6d9}.sek-pm-input-parent .sek-pm-input{-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto;display:block;margin:auto 3px;-webkit-box-sizing:border-box;box-sizing:border-box;padding:1px 3px;font-size:12px;font-weight:300;min-width:34px;min-height:20px;color:#313131}.sek-pm-middle-wrap{display:-webkit-box;display:-ms-flexbox;display:flex;height:100px;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.sek-pm-margin-left,.sek-pm-margin-right{width:46px}.sek-pm-padding-wrapper{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;background-color:#fff;border:1px solid #ced6d9;height:100px;width:140px;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;padding:5px;-webkit-transition:background-color .2s ease;-o-transition:background-color .2s ease;transition:background-color .2s ease;-webkit-box-sizing:border-box;box-sizing:border-box;margin:auto}.sek-flex-justify-center{min-height:0;min-width:0;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.sek-flex-space-between{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.sek-pm-input-parent{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex}.sek-pm-input-parent .sek-pm-input{min-height:25px;min-width:40px;background-color:#fff}.sek-pm-input-parent .sek-pm-input{-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto;display:block;margin:auto 3px!important;-webkit-box-sizing:border-box;box-sizing:border-box;padding:1px 3px;font-size:12px;font-weight:300;min-width:34px;min-height:20px;color:#313131;width:40px!important;text-align:center}.sek-pm-padding-wrapper label{margin:0}.sek-pad-marg-inner label{-webkit-box-flex:0;-ms-flex:0;flex:0}.reset-spacing-wrap{padding:10px 0 0;font-size:.8em;text-decoration:underline;cursor:pointer;text-align:center}.reset-spacing-wrap:hover{color:#006799}.sek-bg-pos-wrapper{padding:10px;text-align:center;display:inline-block;width:90px;height:90px}.sek-bg-pos-wrapper{display:inline-block;width:90px;height:90px}.sek-bg-pos-wrapper .sek-bg-pos{cursor:pointer;width:24px;height:24px;margin:3px;float:left}.sek-bg-pos-wrapper input[type=radio]{display:none}.sek-bg-pos-wrapper .sek-bg-pos span{display:inline-block;width:100%;height:100%;border-radius:6px;background:#e6e6e6 no-repeat center;-webkit-transition:background-color .2s ease;-o-transition:background-color .2s ease;transition:background-color .2s ease}.sek-bg-pos-wrapper .sek-bg-pos span:hover{background-color:#33b3db}.sek-bg-pos-wrapper .sek-bg-pos span:hover svg{visibility:visible}.sek-bg-pos-wrapper .sek-bg-pos input[type=radio]:checked+span{background-color:#33b3db}.sek-bg-pos-wrapper .sek-bg-pos input[type=radio]:checked+span svg{visibility:visible}.sek-bg-pos-wrapper .sek-bg-pos span svg{visibility:hidden;shape-rendering:crispEdges}.sek-bg-pos-wrapper .sek-svg-bg-pos{fill:#fff}div[data-sek-align]{margin:0 5px;padding:4px;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end;position:relative;text-align:center;width:23px;height:24px;top:-4px;border-radius:4px;cursor:pointer}horizAlignmentWithDeviceSwitcher div[data-input-type=horizTextAlignmentWithDeviceSwitcher] .czr-input{text-align:center}div[data-input-type=horizTextAlignmentWithDeviceSwitcher] .sek-h-align-wrapper{display:inline-block}div[data-input-type=horizAlignmentWithDeviceSwitcher] .czr-input{text-align:center}div[data-input-type=horizAlignmentWithDeviceSwitcher] .sek-h-align-wrapper{display:inline-block}.sek-h-align-wrapper .sek-align-icons{float:right}div[data-sek-align]:hover{-webkit-box-shadow:inset 0 0 0 1px #555d66,inset 0 0 0 2px #fff;box-shadow:inset 0 0 0 1px #555d66,inset 0 0 0 2px #fff}div[data-sek-align].selected{outline:0;color:#fff;-webkit-box-shadow:none;box-shadow:none;background:#555d66}.sek-side-nimble-logo-wrapper{padding:4px 25px 0 2px!important}.sek-side-nimble-logo-wrapper .sek-nimble-logo{height:45px}[data-input-type=code_editor] .czr-input{width:100%;float:left}.sek-unit-wrapper{text-align:center}.sek-ui-button-group{display:inline-block}.sek-ui-button-group .sek-ui-button:first-child{border-radius:3px 0 0 3px}.sek-ui-button-group .sek-ui-button+.sek-ui-button{margin-left:-1px}.sek-ui-button-group .sek-ui-button:last-child{border-radius:0 3px 3px 0}.sek-ui-button{height:28px;line-height:25px;padding:0 10px 2px;border-radius:3px;white-space:nowrap;border-width:1px;border-style:solid;display:inline-flex;text-decoration:none;font-size:12px;margin:0;cursor:pointer;-webkit-appearance:none;background:0 0;color:#555;border-color:#ccc;background:#f7f7f7;box-shadow:inset 0 -1px 0 #ccc;vertical-align:top}.sek-ui-button:hover{background:#fafafa;border-color:#999;box-shadow:inset 0 -1px 0 #999;color:#23282d}.sek-ui-button:active:not(:disabled){background:#eee;border-color:#999;box-shadow:inset 0 1px 0 #999}.sek-ui-button:focus:not(:disabled){background:#fafafa;color:#23282d;border-color:#999;box-shadow:inset 0 -1px 0 #999,0 0 0 2px #fbfbfb;outline:0}.sek-ui-button.is-selected{background:#555d66;border-color:#555d66;box-shadow:inset 0 -1px 0 #555d66;color:#fff;text-decoration:none}.sek-ui-button.is-selected:focus:not(:disabled),.sek-ui-button.is-selected:hover{background:#555d66;border-color:#4f4f4f;color:#fff}.sek-ui-button.is-selected:focus:not(:disabled){box-shadow:inset 0 -1px 0 #4f4f4f}.sek-ui-button.is-selected:focus:not(:disabled){outline:0}.sek-content-type-wrapper{margin-bottom:8px;width:100%;float:left}.sek-content-type-wrapper .sek-ui-button-group{display:block}.sek-content-type-wrapper .sek-ui-button{width:49%;text-align:center;display:inline-block;padding:3px 0;height:auto;text-transform:uppercase}.sek-input-device-switcher .sek-switcher:before{display:inline-block;-webkit-font-smoothing:antialiased;font:normal 20px/30px dashicons;vertical-align:top;color:#656a6f;position:relative;top:-5px}.sek-input-device-switcher .sek-switcher{cursor:pointer;background:0 0;border:none;padding:0 1px;margin:0 0 0 -2px;box-shadow:none;border-top:1px solid transparent;border-bottom:4px solid transparent;transition:.15s color ease-in-out,.15s background-color ease-in-out,.15s border-color ease-in-out}.sek-input-device-switcher .sek-switcher:focus,.sek-input-device-switcher .sek-switcher:hover{background-color:#fff}.sek-input-device-switcher .sek-switcher.active:before{color:#191e23}.sek-input-device-switcher .sek-switcher:focus:before,.sek-input-device-switcher .sek-switcher:hover:before{color:#0073aa}.sek-input-device-switcher .preview-desktop:before{content:"\f472"}.sek-input-device-switcher .preview-tablet:before{content:"\f471"}.sek-input-device-switcher .preview-mobile:before{content:"\f470"}.sek-range-with-unit-picker-wrapper{width:100%;float:left;margin-bottom:8px}.sek-range-with-unit-picker-wrapper .sek-unit-wrapper{float:right}.sek-range-with-unit-picker-wrapper>div{float:left}.sek-borders{width:100%;float:left;margin-bottom:8px}.sek-borders>div{float:left;width:100%}.sek-borders .sek-range-unit-wrapper>div{float:left}.sek-borders .sek-border-type-wrapper{margin-bottom:5px}.sek-borders .sek-range-unit-wrapper{margin-bottom:5px}.sek-borders .sek-range-unit-wrapper .sek-unit-wrapper{float:right}.sek-borders .sek-color-wrapper{width:100%}.sek-borders .sek-color-wrapper .sek-color-picker{width:50%;float:left}.sek-borders .sek-color-wrapper .sek-reset-button{width:50%;float:right}[data-sek-radius-type=top_right]>i.material-icons{-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}[data-sek-radius-type=bottom_right]>i.material-icons{-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}[data-sek-radius-type=bottom_left]>i.material-icons{-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.sek-range-wrapper{width:44%;margin-right:4px}.sek-no-unit-picker .sek-range-wrapper{width:70%}.sek-number-wrapper{width:50px;margin-right:5px}.sek-range-input{flex:1;width:100%;padding:0;-webkit-appearance:none;background:0 0}.sek-range-input::-webkit-slider-thumb{-webkit-appearance:none;height:20px;width:20px;border-radius:50%;cursor:pointer;background:#555d66;border:4px solid transparent;background-clip:padding-box;box-sizing:border-box;margin-top:-8px}.sek-range-input::-moz-range-thumb{height:20px;width:20px;border-radius:50%;cursor:pointer;background:#555d66;border:4px solid transparent;background-clip:padding-box;box-sizing:border-box;margin-top:-7px}.sek-range-input::-ms-thumb{height:20px;width:20px;border-radius:50%;cursor:pointer;background:#555d66;border:4px solid transparent;background-clip:padding-box;box-sizing:border-box;margin-top:-8px}.sek-range-input:focus{outline:0}.sek-range-input::-webkit-slider-runnable-track{height:3px;cursor:pointer;background:#e2e4e7;border-radius:1.5px;margin-top:-4px}.sek-range-input::-moz-range-track{height:3px;cursor:pointer;background:#e2e4e7;border-radius:1.5px}.sek-range-input::-ms-track{margin-top:-4px;background:0 0;border-color:transparent;color:transparent;height:3px;cursor:pointer;background:#e2e4e7;border-radius:1.5px}.sek-animated-arrow{position:absolute;left:-20px;margin-left:6px;top:3px;font-size:10px;color:#617379;-webkit-transform:rotate(0);-ms-transform:rotate(0);transform:rotate(0);-webkit-transition:-webkit-transform .2s ease-in-out;transition:-webkit-transform .2s ease-in-out;-o-transition:transform .2s ease-in-out;transition:transform .2s ease-in-out;transition:transform .2s ease-in-out,-webkit-transform .2s ease-in-out;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;height:100%;-webkit-box-align:center;-ms-flex-align:center;align-items:center}[data-sek-expanded=true] label>.customize-control-title .sek-animated-arrow{-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.sek-level-option-icon{padding-right:5px;min-width:22px;text-align:center}#customize-preview iframe{top:36px}#nimble-top-bar{max-height:36px;position:absolute;text-align:center;right:0;left:0;z-index:20;color:#fff;display:block;-webkit-transition:all .3s ease-in-out;-moz-transition:all,.3s ease-in-out;-ms-transition:all,.3s ease-in-out;-o-transition:all,.3s ease-in-out;transition:all .3s ease-in-out;opacity:.3;top:0;background:rgba(0,0,0,.5);padding:2px;z-index:99999;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;flex:0 0 100%;max-width:100%}body.nimble-top-bar-visible #nimble-top-bar{opacity:1}#nimble-top-bar:hover{background:rgba(0,0,0,.7)}#nimble-top-bar .nimble-top-bar-content{display:inline-block;line-height:20px;width:80%}#nimble-top-bar .sek-do-undo .icon:before{display:inline-block;-webkit-font-smoothing:antialiased;font:normal 20px/30px dashicons;vertical-align:top;color:#fff}#nimble-top-bar .sek-settings{font-size:18px;padding:0 10px}#nimble-top-bar button{background:0 0;border:none;color:#fff;cursor:pointer}#nimble-top-bar button[data-nimble-state=disabled]{cursor:inherit;opacity:.4!important;cursor:not-allowed}#nimble-top-bar .sek-do-undo button:hover{opacity:1}#nimble-top-bar .sek-do-undo button:focus{outline:0}#nimble-top-bar .sek-do-undo .icon.undo:before{content:"\f171";-webkit-transform:rotate(-45deg);-ms-transform:rotate(-45deg);transform:rotate(-45deg)}#nimble-top-bar .sek-do-undo .icon.do:before{content:"\f172";-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg)}#nimble-top-bar .sek-add-content button{padding-top:3px}#nimble-top-bar .sek-nimble-doc{position:absolute;right:10px;cursor:pointer}.sek-float-right{float:right}.sek-float-left{float:left}.sek-flex-vertical-center{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}li[id^=accordion-section-__nimble__]{margin-top:16px}li[id^=accordion-section-__nimble__]>h3{border-top:1px solid #ddd}
|
assets/czr/sek/css/sek-preview.css
CHANGED
@@ -1,30 +1,32 @@
|
|
1 |
/* BASIC STYLING */
|
2 |
.sektion-wrapper {
|
3 |
min-height: 50px;
|
|
|
4 |
}
|
5 |
.sek-section {
|
6 |
-
padding: 23px 0px 0
|
7 |
position: relative;/* <= Needed for the placement of the ui icons container revealed on hover */
|
8 |
}
|
9 |
|
10 |
/* only when previewing */
|
11 |
/* @fixed since https://github.com/presscustomizr/nimble-builder/issues/24 */
|
12 |
.sek-sektion-inner{
|
13 |
-
padding: 15px
|
14 |
}
|
15 |
|
16 |
.sek-column {
|
17 |
position: relative;
|
18 |
-
padding: 23px 10px 0
|
19 |
}
|
20 |
-
.sek-section h2 { color:black;}
|
21 |
-
|
22 |
-
.sek-column h3 { color:blue;}
|
23 |
|
24 |
.sek-column-inner.sek-empty-col {
|
25 |
-
min-height:
|
26 |
height: 100%;
|
27 |
}
|
|
|
|
|
|
|
|
|
28 |
|
29 |
.sek-module {
|
30 |
position: relative;
|
@@ -32,9 +34,88 @@
|
|
32 |
}/* <= Needed for the placement of the ui icons container revealed on hover */
|
33 |
.sek-module-inner {
|
34 |
position: relative;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
}
|
36 |
|
37 |
-
|
38 |
|
39 |
|
40 |
|
@@ -72,12 +153,16 @@
|
|
72 |
}
|
73 |
.sek-dyn-ui-inner {
|
74 |
position: absolute;
|
75 |
-
top: -18px
|
76 |
-
opacity: 0.8
|
77 |
-webkit-transition: opacity .25s ease;
|
78 |
-o-transition: opacity .25s ease;
|
79 |
transition: opacity .25s ease;
|
80 |
}
|
|
|
|
|
|
|
|
|
81 |
.sek-dyn-left-icons {
|
82 |
left: 0;
|
83 |
}
|
@@ -96,7 +181,7 @@
|
|
96 |
background: #00A0D2;
|
97 |
float: left;
|
98 |
min-height: 18px;
|
99 |
-
margin: -1px -1px 0
|
100 |
padding: 0 4px;
|
101 |
text-shadow: none;
|
102 |
font-size: 1em;
|
@@ -117,7 +202,7 @@
|
|
117 |
text-align: center;
|
118 |
width: 1em;
|
119 |
}
|
120 |
-
.sek-dyn-left-icons .sek-dyn-ui-icons i {
|
121 |
/*margin: 0px 5px;*/
|
122 |
margin: 0 0.30em;
|
123 |
}
|
@@ -130,7 +215,7 @@
|
|
130 |
.sek-dyn-ui-icons > i:last-child {
|
131 |
padding-right: 2px;
|
132 |
}*/
|
133 |
-
.sek-dyn-ui-icons .fa-
|
134 |
cursor: move;
|
135 |
}
|
136 |
|
@@ -142,7 +227,7 @@
|
|
142 |
width: 1.6em!important;
|
143 |
border-left: 1px dotted white;
|
144 |
}
|
145 |
-
.sek-dyn-ui-icons [data-sek-click-on="pick-
|
146 |
/*padding-left: 9px;*/
|
147 |
padding-left: 0.42em;
|
148 |
margin-left: 0px;
|
@@ -153,14 +238,27 @@
|
|
153 |
position: absolute;
|
154 |
z-index: 2;
|
155 |
bottom: 0;
|
156 |
-
padding: 0
|
157 |
font-size: 0.6em;
|
158 |
right: 0;
|
159 |
cursor: pointer;
|
|
|
160 |
}
|
161 |
-
|
162 |
-
|
163 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
164 |
|
165 |
|
166 |
/* ADAPT THE UI ICONS SIZES WHEN COLUMNS ARE BECOMING NARROWS */
|
@@ -184,6 +282,72 @@
|
|
184 |
.sek-col-25 .sek-module-dyn-ui {
|
185 |
font-size: 0.7rem;
|
186 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
187 |
|
188 |
|
189 |
|
@@ -191,9 +355,20 @@
|
|
191 |
/* prevent style propagation to nested levels with > */
|
192 |
.sek-section > .sek-dyn-ui-wrapper .sek-dyn-ui-icons, .sek-section > .sek-dyn-ui-wrapper .sek-dyn-ui-location-type {
|
193 |
background: #000;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
194 |
}
|
195 |
.sek-section > .sek-dyn-ui-wrapper .sek-dyn-ui-location-type {
|
196 |
z-index: 1000;
|
|
|
|
|
197 |
}
|
198 |
.sek-section[data-sek-is-nested="true"] > .sek-dyn-ui-wrapper .sek-dyn-ui-location-type {
|
199 |
z-index: 1002;
|
@@ -202,27 +377,52 @@
|
|
202 |
border: 2px dotted #000;
|
203 |
}
|
204 |
.sek-section > .sek-section-dyn-ui .sek-dyn-ui-inner {
|
205 |
-
top:
|
206 |
z-index: 1000;
|
207 |
}
|
|
|
|
|
|
|
|
|
208 |
.sek-section.sek-highlight-active-ui {
|
209 |
-webkit-box-shadow: 0 0 2px rgba(0, 0, 0, 0.8);
|
210 |
box-shadow: 0 0 2px rgba(0, 0, 0, 0.8);
|
211 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
212 |
|
213 |
|
214 |
|
215 |
/* COLUMN UI*/
|
216 |
/* prevent style propagation to nested levels with > */
|
217 |
.sek-column > .sek-column-dyn-ui .sek-dyn-ui-inner {
|
218 |
-
|
219 |
-
z-index:
|
|
|
220 |
}
|
221 |
.sek-column > .sek-dyn-ui-wrapper .sek-dyn-ui-icons, .sek-column > .sek-dyn-ui-wrapper .sek-dyn-ui-location-type {
|
222 |
background: #00b846;
|
223 |
}
|
224 |
.sek-column > .sek-dyn-ui-wrapper .sek-dyn-ui-location-type {
|
225 |
z-index: 1001;
|
|
|
226 |
}
|
227 |
.sek-column-dyn-ui {
|
228 |
border: 2px dotted #00b846;
|
@@ -242,31 +442,45 @@
|
|
242 |
-webkit-box-shadow: 0 0 2px rgba(0, 184, 70, 0.8);
|
243 |
box-shadow: 0 0 2px rgba(0, 184, 70, 0.8);
|
244 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
245 |
|
246 |
|
247 |
|
248 |
/* MODULE UI*/
|
249 |
/* prevent style propagation to nested levels with > */
|
250 |
-
|
251 |
min-height: 50px
|
252 |
-
}
|
253 |
.sek-module:hover{
|
254 |
cursor:pointer;
|
255 |
}
|
256 |
-
.sek-module > .sek-
|
257 |
-
|
258 |
-
z-index:
|
|
|
259 |
}
|
260 |
.sek-module > .sek-dyn-ui-wrapper .sek-dyn-ui-icons, .sek-module > .sek-dyn-ui-wrapper .sek-dyn-ui-location-type{
|
261 |
background: #0085ba;
|
262 |
}
|
263 |
.sek-module > .sek-dyn-ui-wrapper .sek-dyn-ui-location-type {
|
264 |
left: 0;
|
|
|
|
|
265 |
right: auto;
|
266 |
z-index: 1005;
|
267 |
}
|
268 |
.sek-module-dyn-ui {
|
269 |
-
border:
|
270 |
font-size: 1rem;
|
271 |
}
|
272 |
|
@@ -288,6 +502,72 @@
|
|
288 |
-webkit-box-shadow: 0 0 2px rgba(0, 133, 186, 0.8);
|
289 |
box-shadow: 0 0 2px rgba(0, 133, 186, 0.8);
|
290 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
291 |
|
292 |
|
293 |
|
@@ -386,7 +666,8 @@
|
|
386 |
text-align: center;
|
387 |
border: 1px dotted #ccc;
|
388 |
background: #eee;
|
389 |
-
background: rgba(238, 238, 238, 0.84)
|
|
|
390 |
height: 100%;
|
391 |
min-height: 40px;
|
392 |
-webkit-box-align: center;
|
@@ -399,13 +680,22 @@
|
|
399 |
display: -webkit-box;
|
400 |
display: flex;
|
401 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
402 |
|
403 |
-
.sek-module-drop-zone-for-first-module [data-sek-click-on="pick-
|
404 |
cursor: pointer;
|
405 |
width: 50px;
|
406 |
height: 50px;
|
407 |
-
color: #0085ba;
|
408 |
-
color: rgba(0, 133, 186, 0.6)
|
|
|
409 |
border-radius: 30px;
|
410 |
-webkit-transition: all .20s ease;
|
411 |
-o-transition: all .20s ease;
|
@@ -421,22 +711,23 @@
|
|
421 |
justify-content: center;
|
422 |
}
|
423 |
|
424 |
-
.sek-module-drop-zone-for-first-module [data-sek-click-on="pick-
|
425 |
-webkit-box-shadow: 0 2px 6px rgba(0,0,0,.2);
|
426 |
box-shadow: 0 2px 6px rgba(0,0,0,.2);
|
427 |
-
color: #0085ba
|
|
|
428 |
}
|
429 |
|
430 |
/* Adapt the size when columns are too narrow */
|
431 |
-
.sek-col-8 [data-sek-click-on="pick-
|
432 |
-
.sek-col-9 [data-sek-click-on="pick-
|
433 |
-
.sek-col-10 [data-sek-click-on="pick-
|
434 |
-
.sek-col-11 [data-sek-click-on="pick-
|
435 |
-
.sek-col-12 [data-sek-click-on="pick-
|
436 |
-
.sek-col-14 [data-sek-click-on="pick-
|
437 |
-
.sek-col-16 [data-sek-click-on="pick-
|
438 |
-
.sek-col-20 [data-sek-click-on="pick-
|
439 |
-
.sek-col-25 [data-sek-click-on="pick-
|
440 |
font-size: 0.9rem;
|
441 |
/* width: 35px;
|
442 |
height: 35px;
|
@@ -445,10 +736,10 @@
|
|
445 |
|
446 |
|
447 |
/* Hide the + during a drag phase */
|
448 |
-
.sek-dragging .sek-module-drop-zone-for-first-module [data-sek-click-on="pick-
|
449 |
display: none;
|
450 |
}
|
451 |
-
/*.sek-module-drop-zone-for-first-module [data-sek-click-on="pick-
|
452 |
font-size: 27px;
|
453 |
}*/
|
454 |
|
@@ -458,9 +749,9 @@
|
|
458 |
|
459 |
/* This is the selector for all eligible drop zones */
|
460 |
.sek-drop-zone {
|
461 |
-
-webkit-transition: opacity, height 0.4s ease;
|
462 |
-
-o-transition: opacity, height 0.4s ease;
|
463 |
-
transition: opacity, height 0.4s ease;
|
464 |
}
|
465 |
|
466 |
|
@@ -472,7 +763,7 @@
|
|
472 |
the class .sek-active-drop-zone is added when entering / overing the drop target
|
473 |
and removed when leaving the drop element
|
474 |
*/
|
475 |
-
.sek-active-drop-zone.sek-module-drop-zone-for-first-module [data-sek-click-on="pick-
|
476 |
display: none;
|
477 |
}
|
478 |
.sek-dynamic-drop-zone {
|
@@ -489,15 +780,20 @@
|
|
489 |
|
490 |
.sek-dragging .sek-dynamic-drop-zone {
|
491 |
height: 5px;
|
492 |
-
-webkit-transition: all
|
493 |
-
-o-transition: all
|
494 |
-
transition: all
|
495 |
/*background: #eee;*/
|
496 |
/*border:2px dotted #a2a2a2;*/
|
497 |
border:2px dotted #72777c;
|
498 |
background: #ddd;
|
499 |
border-radius: 5px;
|
500 |
}
|
|
|
|
|
|
|
|
|
|
|
501 |
.sek-dragging [data-sek-location="between-sections"], .sek-dragging [data-sek-location="in-empty-location"]{
|
502 |
background: #ddd;
|
503 |
border:2px dotted #72777c;
|
@@ -508,12 +804,27 @@
|
|
508 |
}
|
509 |
.sek-dragging .sek-drag-is-close.sek-dynamic-drop-zone {
|
510 |
height: 55px;
|
|
|
|
|
|
|
511 |
}
|
512 |
.sek-dragging .sek-drag-is-very-close.sek-dynamic-drop-zone {
|
513 |
height: 75px;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
514 |
}
|
515 |
-
|
516 |
-
|
517 |
.sek-dragging [data-sek-location="between-modules-and-nested-sections"], .sek-dragging .sek-module-drop-zone-for-first-module {
|
518 |
background: #dcefff;
|
519 |
background: rgba(220, 239, 255, 0.84);
|
@@ -630,6 +941,9 @@
|
|
630 |
-o-transition: all .20s ease;
|
631 |
transition: all .20s ease;
|
632 |
opacity: 0;
|
|
|
|
|
|
|
633 |
}
|
634 |
.sek-add-content-btn.sek-mouse-is-close {
|
635 |
z-index: 10000;
|
@@ -649,26 +963,26 @@
|
|
649 |
box-shadow: 0 2px 6px rgba(0,0,0,.2);
|
650 |
}
|
651 |
.sek-click-on-button-icon {
|
652 |
-
|
653 |
-
|
654 |
-
top: -4px;
|
655 |
-
position: relative;
|
656 |
}
|
657 |
.sek-add-content-btn:hover .sek-click-on-button-icon {
|
658 |
-
|
659 |
-
|
660 |
-
|
661 |
}
|
662 |
|
663 |
.action-button-text {
|
664 |
visibility: hidden;
|
|
|
665 |
white-space: nowrap;
|
666 |
-
padding-left:
|
667 |
padding-bottom: 2px;
|
668 |
}
|
669 |
|
670 |
.sek-add-content-btn:not(.disabled):hover .action-button-text {
|
671 |
visibility: visible;
|
|
|
672 |
}
|
673 |
|
674 |
|
@@ -778,8 +1092,6 @@
|
|
778 |
display: -webkit-box;
|
779 |
display: -ms-flexbox;
|
780 |
display: flex;
|
781 |
-
height: calc(100% - 26px);/*26px is the padding-top of the .sek-column when previewing to let enough place for the ui icons */
|
782 |
-
top: 26px;/*26px is the padding-top of the .sek-column when previewing to let enough place for the ui icons */
|
783 |
-webkit-box-align: center;
|
784 |
-ms-flex-align: center;
|
785 |
align-items: center;
|
@@ -797,21 +1109,15 @@
|
|
797 |
|
798 |
|
799 |
|
800 |
-
|
801 |
-
|
802 |
-
|
803 |
-
|
804 |
-
/* TINYMCE BLOCK OUTLINE */
|
805 |
-
.sek-module [data-sek-input-type="tiny_mce_editor"]:hover {
|
806 |
-
outline: 1px solid #1d85bb;
|
807 |
-
}
|
808 |
-
|
809 |
-
|
810 |
-
|
811 |
/* REFRESHING A LEVEL */
|
812 |
-
.sek-refreshing {
|
813 |
-
-webkit-filter: blur(
|
814 |
-
filter: blur(
|
|
|
|
|
|
|
|
|
|
|
815 |
/*position: absolute*/
|
816 |
}
|
817 |
.sek-level-clone {
|
@@ -831,6 +1137,39 @@
|
|
831 |
}
|
832 |
|
833 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
834 |
|
835 |
/* CSS LOADER */
|
836 |
@-webkit-keyframes sek-mr-loader {
|
@@ -915,6 +1254,10 @@
|
|
915 |
-webkit-animation: sek-mr-loader 1.25s 0s infinite cubic-bezier(0.21, 0.53, 0.56, 0.8);
|
916 |
animation: sek-mr-loader 1.25s 0s infinite cubic-bezier(0.21, 0.53, 0.56, 0.8);
|
917 |
}
|
|
|
|
|
|
|
|
|
918 |
/*
|
919 |
html.no-js [id*=sek-slider-loader-wrapper] {
|
920 |
display: none;
|
@@ -926,4 +1269,9 @@ html.no-js [id*=sek-slider-loader-wrapper] {
|
|
926 |
position: absolute;
|
927 |
z-index: 99;
|
928 |
background: #ffffff;
|
929 |
-
}*/
|
|
|
|
|
|
|
|
|
|
1 |
/* BASIC STYLING */
|
2 |
.sektion-wrapper {
|
3 |
min-height: 50px;
|
4 |
+
margin-top: 21px;/* <= Needed to see the ui button of the first section, if the container of the parent location is overflow:hidden; */
|
5 |
}
|
6 |
.sek-section {
|
7 |
+
/*padding: 23px 0px 0;*/
|
8 |
position: relative;/* <= Needed for the placement of the ui icons container revealed on hover */
|
9 |
}
|
10 |
|
11 |
/* only when previewing */
|
12 |
/* @fixed since https://github.com/presscustomizr/nimble-builder/issues/24 */
|
13 |
.sek-sektion-inner{
|
14 |
+
/*padding: 15px;*//* <= Needed for the placement of the ui icons container revealed on hover */
|
15 |
}
|
16 |
|
17 |
.sek-column {
|
18 |
position: relative;
|
19 |
+
/*padding: 23px 10px 0;*//* <= Needed for the placement of the ui icons container revealed on hover */
|
20 |
}
|
|
|
|
|
|
|
21 |
|
22 |
.sek-column-inner.sek-empty-col {
|
23 |
+
min-height: 130px;
|
24 |
height: 100%;
|
25 |
}
|
26 |
+
.sek-has-modules .sek-column-inner.sek-empty-col {
|
27 |
+
min-height: auto;
|
28 |
+
height: auto;
|
29 |
+
}
|
30 |
|
31 |
.sek-module {
|
32 |
position: relative;
|
34 |
}/* <= Needed for the placement of the ui icons container revealed on hover */
|
35 |
.sek-module-inner {
|
36 |
position: relative;
|
37 |
+
/* Smoothify the changes done when customizing this selector */
|
38 |
+
-webkit-transition: all 0.25s ease-in-out;
|
39 |
+
-moz-transition: all, 0.25s ease-in-out;
|
40 |
+
-ms-transition: all, 0.25s ease-in-out;
|
41 |
+
-o-transition: all, 0.25s ease-in-out;
|
42 |
+
transition: all 0.25s ease-in-out;
|
43 |
+
}
|
44 |
+
|
45 |
+
|
46 |
+
|
47 |
+
|
48 |
+
/* LEVELS WRAPPER ANIMATION WHEN CUSTOMIZING
|
49 |
+
For example when setting border radius
|
50 |
+
*/
|
51 |
+
[data-sek-level] {
|
52 |
+
-webkit-transition: all 0.2s ease-out;
|
53 |
+
-o-transition: all 0.2s ease-out;
|
54 |
+
transition: all 0.2s ease-out;
|
55 |
+
}
|
56 |
+
|
57 |
+
/* MODULES SPECIFICS WHEN CUSTOMIZING */
|
58 |
+
/* image module transitions when customizing */
|
59 |
+
[data-sek-module-type="czr_image_module"] figure img {
|
60 |
+
-webkit-transition: all 0.2s ease-out;
|
61 |
+
-o-transition: all 0.2s ease-out;
|
62 |
+
transition: all 0.2s ease-out;
|
63 |
+
}
|
64 |
+
|
65 |
+
/* TinyMce block outline */
|
66 |
+
.sek-module [data-sek-input-type="tiny_mce_editor"]:hover {
|
67 |
+
outline: 1px solid #1d85bb;
|
68 |
+
}
|
69 |
+
|
70 |
+
|
71 |
+
|
72 |
+
|
73 |
+
|
74 |
+
/* MAKE SURE WE CAN SEE THE LEVELS, EVEN IF SETUP TO BE HIDDEN WITH THE CURRENT PREVIEWED DEVICE */
|
75 |
+
@media (min-width:767px){
|
76 |
+
[data-sek-level="location"] .sek-hidden-on-desktops {
|
77 |
+
display: -ms-flexbox;
|
78 |
+
display: -webkit-box;
|
79 |
+
display: flex;
|
80 |
+
-webkit-filter: grayscale(30%);
|
81 |
+
filter: grayscale(30%);
|
82 |
+
-webkit-filter: gray;
|
83 |
+
filter: gray;
|
84 |
+
/*-webkit-filter:blur(1px);
|
85 |
+
filter: blur(1px);*/
|
86 |
+
opacity: 0.8;
|
87 |
+
}
|
88 |
+
}
|
89 |
+
@media (min-width:575px) and (max-width:768px){
|
90 |
+
[data-sek-level="location"] .sek-hidden-on-tablets {
|
91 |
+
display: -ms-flexbox;
|
92 |
+
display: -webkit-box;
|
93 |
+
display: flex;
|
94 |
+
-webkit-filter: grayscale(30%);
|
95 |
+
filter: grayscale(30%);
|
96 |
+
-webkit-filter: gray;
|
97 |
+
filter: gray;
|
98 |
+
/*-webkit-filter:blur(1px);
|
99 |
+
filter: blur(1px);*/
|
100 |
+
opacity: 0.8;
|
101 |
+
}
|
102 |
+
}
|
103 |
+
@media (max-width:575px){
|
104 |
+
[data-sek-level="location"] .sek-hidden-on-mobiles {
|
105 |
+
display: -ms-flexbox;
|
106 |
+
display: -webkit-box;
|
107 |
+
display: flex;
|
108 |
+
-webkit-filter: grayscale(30%);
|
109 |
+
filter: grayscale(30%);
|
110 |
+
-webkit-filter: gray;
|
111 |
+
filter: gray;
|
112 |
+
/* -webkit-filter:blur(1px);
|
113 |
+
filter: blur(1px);*/
|
114 |
+
opacity: 0.8;
|
115 |
+
}
|
116 |
}
|
117 |
|
118 |
+
|
119 |
|
120 |
|
121 |
|
153 |
}
|
154 |
.sek-dyn-ui-inner {
|
155 |
position: absolute;
|
156 |
+
/*top: -18px;*/
|
157 |
+
/*opacity: 0.8;*/
|
158 |
-webkit-transition: opacity .25s ease;
|
159 |
-o-transition: opacity .25s ease;
|
160 |
transition: opacity .25s ease;
|
161 |
}
|
162 |
+
.sek-dyn-ui-inner.sek-is-expanded {
|
163 |
+
display: block!important;
|
164 |
+
z-index: 2000!important;
|
165 |
+
}
|
166 |
.sek-dyn-left-icons {
|
167 |
left: 0;
|
168 |
}
|
181 |
background: #00A0D2;
|
182 |
float: left;
|
183 |
min-height: 18px;
|
184 |
+
/*margin: -1px -1px 0;*/
|
185 |
padding: 0 4px;
|
186 |
text-shadow: none;
|
187 |
font-size: 1em;
|
202 |
text-align: center;
|
203 |
width: 1em;
|
204 |
}
|
205 |
+
.sek-dyn-left-icons .sek-dyn-ui-icons i, .sek-dyn-right-icons .sek-dyn-ui-icons i {
|
206 |
/*margin: 0px 5px;*/
|
207 |
margin: 0 0.30em;
|
208 |
}
|
215 |
.sek-dyn-ui-icons > i:last-child {
|
216 |
padding-right: 2px;
|
217 |
}*/
|
218 |
+
.sek-dyn-ui-icons .fa-arrows-alt {
|
219 |
cursor: move;
|
220 |
}
|
221 |
|
227 |
width: 1.6em!important;
|
228 |
border-left: 1px dotted white;
|
229 |
}
|
230 |
+
.sek-dyn-ui-icons [data-sek-click-on="pick-content"] {
|
231 |
/*padding-left: 9px;*/
|
232 |
padding-left: 0.42em;
|
233 |
margin-left: 0px;
|
238 |
position: absolute;
|
239 |
z-index: 2;
|
240 |
bottom: 0;
|
241 |
+
padding: 0 0.5em;
|
242 |
font-size: 0.6em;
|
243 |
right: 0;
|
244 |
cursor: pointer;
|
245 |
+
opacity: 0.75;
|
246 |
}
|
247 |
+
.sek-dyn-ui-location-type:hover {
|
248 |
+
opacity: 1;
|
249 |
+
}
|
250 |
+
.sek-dyn-ui-location-inner {
|
251 |
+
padding: 3px 0;
|
252 |
+
}
|
253 |
+
.sek-minimize-ui {
|
254 |
+
float: left;
|
255 |
+
text-align: center;
|
256 |
+
width: 16px;
|
257 |
+
padding: 3px;
|
258 |
+
}
|
259 |
+
/*.sek-dyn-ui-level-type {
|
260 |
+
cursor: -webkit-grab;
|
261 |
+
}*/
|
262 |
|
263 |
|
264 |
/* ADAPT THE UI ICONS SIZES WHEN COLUMNS ARE BECOMING NARROWS */
|
282 |
.sek-col-25 .sek-module-dyn-ui {
|
283 |
font-size: 0.7rem;
|
284 |
}
|
285 |
+
/* ADAPT THE UI HAMB MENU WHEN COLUMNS ARE BECOMING NARROWS */
|
286 |
+
.sek-col-8 > .sek-column-dyn-ui .sek-ham__toggler-span-wrapper,
|
287 |
+
.sek-col-9 > .sek-column-dyn-ui .sek-ham__toggler-span-wrapper,
|
288 |
+
.sek-col-10 > .sek-column-dyn-ui .sek-ham__toggler-span-wrapper,
|
289 |
+
.sek-col-11 > .sek-column-dyn-ui .sek-ham__toggler-span-wrapper,
|
290 |
+
.sek-col-12 > .sek-column-dyn-ui .sek-ham__toggler-span-wrapper,
|
291 |
+
.sek-col-14 > .sek-column-dyn-ui .sek-ham__toggler-span-wrapper,
|
292 |
+
.sek-col-16 > .sek-column-dyn-ui .sek-ham__toggler-span-wrapper,
|
293 |
+
.sek-col-20 > .sek-column-dyn-ui .sek-ham__toggler-span-wrapper,
|
294 |
+
.sek-col-25 > .sek-column-dyn-ui .sek-ham__toggler-span-wrapper,
|
295 |
+
.sek-col-8 .sek-module-dyn-ui .sek-ham__toggler-span-wrapper,
|
296 |
+
.sek-col-9 .sek-module-dyn-ui .sek-ham__toggler-span-wrapper,
|
297 |
+
.sek-col-10 .sek-module-dyn-ui .sek-ham__toggler-span-wrapper,
|
298 |
+
.sek-col-11 .sek-module-dyn-ui .sek-ham__toggler-span-wrapper,
|
299 |
+
.sek-col-12 .sek-module-dyn-ui .sek-ham__toggler-span-wrapper,
|
300 |
+
.sek-col-14 .sek-module-dyn-ui .sek-ham__toggler-span-wrapper,
|
301 |
+
.sek-col-16 .sek-module-dyn-ui .sek-ham__toggler-span-wrapper,
|
302 |
+
.sek-col-20 .sek-module-dyn-ui .sek-ham__toggler-span-wrapper,
|
303 |
+
.sek-col-25 .sek-module-dyn-ui .sek-ham__toggler-span-wrapper {
|
304 |
+
height: 8px;
|
305 |
+
width: 16px;
|
306 |
+
}
|
307 |
+
.sek-col-8 > .sek-column-dyn-ui .sek-ham__toggler-span-wrapper .line,
|
308 |
+
.sek-col-9 > .sek-column-dyn-ui .sek-ham__toggler-span-wrapper .line,
|
309 |
+
.sek-col-10 > .sek-column-dyn-ui .sek-ham__toggler-span-wrapper .line,
|
310 |
+
.sek-col-11 > .sek-column-dyn-ui .sek-ham__toggler-span-wrapper .line,
|
311 |
+
.sek-col-12 > .sek-column-dyn-ui .sek-ham__toggler-span-wrapper .line,
|
312 |
+
.sek-col-14 > .sek-column-dyn-ui .sek-ham__toggler-span-wrapper .line,
|
313 |
+
.sek-col-16 > .sek-column-dyn-ui .sek-ham__toggler-span-wrapper .line,
|
314 |
+
.sek-col-20 > .sek-column-dyn-ui .sek-ham__toggler-span-wrapper .line,
|
315 |
+
.sek-col-25 > .sek-column-dyn-ui .sek-ham__toggler-span-wrapper .line,
|
316 |
+
.sek-col-8 .sek-module-dyn-ui .sek-ham__toggler-span-wrapper .line,
|
317 |
+
.sek-col-9 .sek-module-dyn-ui .sek-ham__toggler-span-wrapper .line,
|
318 |
+
.sek-col-10 .sek-module-dyn-ui .sek-ham__toggler-span-wrapper .line,
|
319 |
+
.sek-col-11 .sek-module-dyn-ui .sek-ham__toggler-span-wrapper .line,
|
320 |
+
.sek-col-12 .sek-module-dyn-ui .sek-ham__toggler-span-wrapper .line,
|
321 |
+
.sek-col-14 .sek-module-dyn-ui .sek-ham__toggler-span-wrapper .line,
|
322 |
+
.sek-col-16 .sek-module-dyn-ui .sek-ham__toggler-span-wrapper .line,
|
323 |
+
.sek-col-20 .sek-module-dyn-ui .sek-ham__toggler-span-wrapper .line,
|
324 |
+
.sek-col-25 .sek-module-dyn-ui .sek-ham__toggler-span-wrapper .line {
|
325 |
+
width: 15px;
|
326 |
+
height: 1px;
|
327 |
+
}
|
328 |
+
.sek-col-8 > .sek-column-dyn-ui .sek-dyn-ui-location-type:hover .line,
|
329 |
+
.sek-col-9 > .sek-column-dyn-ui .sek-dyn-ui-location-type:hover .line,
|
330 |
+
.sek-col-10 > .sek-column-dyn-ui .sek-dyn-ui-location-type:hover .line,
|
331 |
+
.sek-col-11 > .sek-column-dyn-ui .sek-dyn-ui-location-type:hover .line,
|
332 |
+
.sek-col-12 > .sek-column-dyn-ui .sek-dyn-ui-location-type:hover .line,
|
333 |
+
.sek-col-14 > .sek-column-dyn-ui .sek-dyn-ui-location-type:hover .line,
|
334 |
+
.sek-col-16 > .sek-column-dyn-ui .sek-dyn-ui-location-type:hover .line,
|
335 |
+
.sek-col-20 > .sek-column-dyn-ui .sek-dyn-ui-location-type:hover .line,
|
336 |
+
.sek-col-25 > .sek-column-dyn-ui .sek-dyn-ui-location-type:hover .line,
|
337 |
+
.sek-col-8 .sek-module-dyn-ui .sek-dyn-ui-location-type:hover .line,
|
338 |
+
.sek-col-9 .sek-module-dyn-ui .sek-dyn-ui-location-type:hover .line,
|
339 |
+
.sek-col-10 .sek-module-dyn-ui .sek-dyn-ui-location-type:hover .line,
|
340 |
+
.sek-col-11 .sek-module-dyn-ui .sek-dyn-ui-location-type:hover .line,
|
341 |
+
.sek-col-12 .sek-module-dyn-ui .sek-dyn-ui-location-type:hover .line,
|
342 |
+
.sek-col-14 .sek-module-dyn-ui .sek-dyn-ui-location-type:hover .line,
|
343 |
+
.sek-col-16 .sek-module-dyn-ui .sek-dyn-ui-location-type:hover .line,
|
344 |
+
.sek-col-20 .sek-module-dyn-ui .sek-dyn-ui-location-type:hover .line,
|
345 |
+
.sek-col-25 .sek-module-dyn-ui .sek-dyn-ui-location-type:hover .line {
|
346 |
+
width: 16px;
|
347 |
+
-webkit-transform: translate(-1px, 0);
|
348 |
+
transform: translate(-1px, 0);
|
349 |
+
}
|
350 |
+
|
351 |
|
352 |
|
353 |
|
355 |
/* prevent style propagation to nested levels with > */
|
356 |
.sek-section > .sek-dyn-ui-wrapper .sek-dyn-ui-icons, .sek-section > .sek-dyn-ui-wrapper .sek-dyn-ui-location-type {
|
357 |
background: #000;
|
358 |
+
opacity: 0.75;
|
359 |
+
}
|
360 |
+
.sek-section > .sek-section-dyn-ui .sek-dyn-ui-inner {
|
361 |
+
/*bottom: 0%;*/
|
362 |
+
z-index: 1001;
|
363 |
+
display: none;
|
364 |
+
}
|
365 |
+
.sek-section > .sek-dyn-ui-wrapper .sek-dyn-ui-icons:hover {
|
366 |
+
opacity: 1;
|
367 |
}
|
368 |
.sek-section > .sek-dyn-ui-wrapper .sek-dyn-ui-location-type {
|
369 |
z-index: 1000;
|
370 |
+
position: relative;
|
371 |
+
float: left;
|
372 |
}
|
373 |
.sek-section[data-sek-is-nested="true"] > .sek-dyn-ui-wrapper .sek-dyn-ui-location-type {
|
374 |
z-index: 1002;
|
377 |
border: 2px dotted #000;
|
378 |
}
|
379 |
.sek-section > .sek-section-dyn-ui .sek-dyn-ui-inner {
|
380 |
+
top: -1px;
|
381 |
z-index: 1000;
|
382 |
}
|
383 |
+
/* When the section is nested, we need space on top to see the parent section ui */
|
384 |
+
.sek-section[data-sek-is-nested="true"] > .sek-section-dyn-ui .sek-dyn-ui-inner {
|
385 |
+
top: 18px;
|
386 |
+
}
|
387 |
.sek-section.sek-highlight-active-ui {
|
388 |
-webkit-box-shadow: 0 0 2px rgba(0, 0, 0, 0.8);
|
389 |
box-shadow: 0 0 2px rgba(0, 0, 0, 0.8);
|
390 |
}
|
391 |
+
/*.sek-column .sek-dyn-ui-hamb-menu-wrapper, .sek-column .sek-dyn-ui-level-type {
|
392 |
+
float: right;
|
393 |
+
}
|
394 |
+
.sek-column .sek-dyn-ui-level-type {
|
395 |
+
padding-right: 0.5em;
|
396 |
+
}
|
397 |
+
|
398 |
+
*/
|
399 |
+
.sek-section > .sek-dyn-ui-wrapper .sek-dyn-ui-location-inner {
|
400 |
+
float: left;
|
401 |
+
}
|
402 |
+
|
403 |
+
.sek-section > .sek-dyn-ui-wrapper .sek-dyn-ui-hamb-menu-wrapper, .sek-section > .sek-dyn-ui-wrapper .sek-dyn-ui-level-type {
|
404 |
+
float: left;
|
405 |
+
}
|
406 |
+
.sek-section > .sek-dyn-ui-wrapper .sek-dyn-ui-level-type {
|
407 |
+
padding-left: 0.5em;
|
408 |
+
}
|
409 |
+
|
410 |
|
411 |
|
412 |
|
413 |
/* COLUMN UI*/
|
414 |
/* prevent style propagation to nested levels with > */
|
415 |
.sek-column > .sek-column-dyn-ui .sek-dyn-ui-inner {
|
416 |
+
bottom: 0%;
|
417 |
+
z-index: 1002;
|
418 |
+
display: none;
|
419 |
}
|
420 |
.sek-column > .sek-dyn-ui-wrapper .sek-dyn-ui-icons, .sek-column > .sek-dyn-ui-wrapper .sek-dyn-ui-location-type {
|
421 |
background: #00b846;
|
422 |
}
|
423 |
.sek-column > .sek-dyn-ui-wrapper .sek-dyn-ui-location-type {
|
424 |
z-index: 1001;
|
425 |
+
bottom: 3px;
|
426 |
}
|
427 |
.sek-column-dyn-ui {
|
428 |
border: 2px dotted #00b846;
|
442 |
-webkit-box-shadow: 0 0 2px rgba(0, 184, 70, 0.8);
|
443 |
box-shadow: 0 0 2px rgba(0, 184, 70, 0.8);
|
444 |
}
|
445 |
+
.sek-column > .sek-dyn-ui-wrapper .sek-dyn-ui-hamb-menu-wrapper, .sek-column > .sek-dyn-ui-wrapper .sek-dyn-ui-level-type {
|
446 |
+
float: right;
|
447 |
+
}
|
448 |
+
.sek-column > .sek-dyn-ui-wrapper .sek-dyn-ui-level-type {
|
449 |
+
padding-right: 0.5em;
|
450 |
+
}
|
451 |
+
|
452 |
+
.sek-column > .sek-dyn-ui-wrapper .sek-dyn-ui-location-inner {
|
453 |
+
float: left;
|
454 |
+
}
|
455 |
+
|
456 |
|
457 |
|
458 |
|
459 |
/* MODULE UI*/
|
460 |
/* prevent style propagation to nested levels with > */
|
461 |
+
/*.sek-module {
|
462 |
min-height: 50px
|
463 |
+
}*/
|
464 |
.sek-module:hover{
|
465 |
cursor:pointer;
|
466 |
}
|
467 |
+
.sek-module > .sek-dyn-ui-wrapper .sek-dyn-ui-inner {
|
468 |
+
bottom: 0;
|
469 |
+
z-index: 1006;
|
470 |
+
display: none;
|
471 |
}
|
472 |
.sek-module > .sek-dyn-ui-wrapper .sek-dyn-ui-icons, .sek-module > .sek-dyn-ui-wrapper .sek-dyn-ui-location-type{
|
473 |
background: #0085ba;
|
474 |
}
|
475 |
.sek-module > .sek-dyn-ui-wrapper .sek-dyn-ui-location-type {
|
476 |
left: 0;
|
477 |
+
top: auto;
|
478 |
+
bottom: 0;
|
479 |
right: auto;
|
480 |
z-index: 1005;
|
481 |
}
|
482 |
.sek-module-dyn-ui {
|
483 |
+
border: 2px dotted #0085ba;
|
484 |
font-size: 1rem;
|
485 |
}
|
486 |
|
502 |
-webkit-box-shadow: 0 0 2px rgba(0, 133, 186, 0.8);
|
503 |
box-shadow: 0 0 2px rgba(0, 133, 186, 0.8);
|
504 |
}
|
505 |
+
.sek-module > .sek-dyn-ui-wrapper .sek-dyn-ui-hamb-menu-wrapper, .sek-module > .sek-dyn-ui-wrapper .sek-dyn-ui-level-type {
|
506 |
+
float: left;
|
507 |
+
}
|
508 |
+
.sek-module > .sek-dyn-ui-wrapper .sek-dyn-ui-level-type {
|
509 |
+
padding-left: 0.5em;
|
510 |
+
}
|
511 |
+
|
512 |
+
.sek-module > .sek-dyn-ui-wrapper .sek-dyn-ui-location-inner {
|
513 |
+
float: left;
|
514 |
+
}
|
515 |
+
|
516 |
+
|
517 |
+
|
518 |
+
|
519 |
+
/* HAMBURGER MENU */
|
520 |
+
.sek-ham__toggler-span-wrapper {
|
521 |
+
height: 10px;
|
522 |
+
position: relative;
|
523 |
+
width: 16px;
|
524 |
+
display: block;
|
525 |
+
}
|
526 |
+
.sek-ham__toggler-span-wrapper .line.line-1 {top: 10%;}
|
527 |
+
.sek-ham__toggler-span-wrapper .line.line-2 {top: 60%;}
|
528 |
+
.sek-ham__toggler-span-wrapper .line.line-3 {top: 110%;}
|
529 |
+
|
530 |
+
.sek-ham__toggler-span-wrapper .line {
|
531 |
+
background: #ffffff;
|
532 |
+
display: block;
|
533 |
+
width: 16px;
|
534 |
+
height: 2px;
|
535 |
+
position: absolute;
|
536 |
+
-webkit-border-radius: 5px;
|
537 |
+
-webkit-background-clip: padding-box;
|
538 |
+
-moz-border-radius: 5px;
|
539 |
+
-moz-background-clip: padding;
|
540 |
+
border-radius: 5px;
|
541 |
+
background-clip: padding-box;
|
542 |
+
transition: all ease 0.2s;
|
543 |
+
-webkit-backface-visibility: hidden;
|
544 |
+
backface-visibility: hidden;
|
545 |
+
}
|
546 |
+
.sek-dyn-ui-location-type:hover .line {
|
547 |
+
/*background-color: rgba(49, 49, 49, 0.7);*/
|
548 |
+
-webkit-transform: translate(-2px, 0);
|
549 |
+
transform: translate(-2px, 0);
|
550 |
+
width: 20px;
|
551 |
+
}
|
552 |
+
/*.sek-dyn-ui-hamb-menu-wrapper:not(.sek-collapsed) .line-1 {
|
553 |
+
-webkit-transform: translate(-3px, 6px) rotate(45deg);
|
554 |
+
transform: translate(-3px, 6px) rotate(45deg);
|
555 |
+
width: 28px;
|
556 |
+
}
|
557 |
+
.sek-dyn-ui-hamb-menu-wrapper:not(.sek-collapsed) .line-2 {
|
558 |
+
opacity: 0;
|
559 |
+
}
|
560 |
+
.sek-dyn-ui-hamb-menu-wrapper:not(.sek-collapsed) .line-3 {
|
561 |
+
-webkit-transform: translate(-3px, -6px) rotate(-45deg);
|
562 |
+
transform: translate(-3px, -6px) rotate(-45deg);
|
563 |
+
width: 28px;
|
564 |
+
}
|
565 |
+
*/
|
566 |
+
|
567 |
+
|
568 |
+
|
569 |
+
|
570 |
+
|
571 |
|
572 |
|
573 |
|
666 |
text-align: center;
|
667 |
border: 1px dotted #ccc;
|
668 |
background: #eee;
|
669 |
+
/*background: rgba(238, 238, 238, 0.84);*/
|
670 |
+
background: rgba(0, 0, 0, 0.10);
|
671 |
height: 100%;
|
672 |
min-height: 40px;
|
673 |
-webkit-box-align: center;
|
680 |
display: -webkit-box;
|
681 |
display: flex;
|
682 |
}
|
683 |
+
.sek-module-drop-zone-for-first-module:hover {
|
684 |
+
background: rgba(0, 0, 0, 0.50);
|
685 |
+
}
|
686 |
+
|
687 |
+
.sek-module-drop-zone-for-first-module:hover [data-sek-click-on="pick-content"]{
|
688 |
+
color: #fff;
|
689 |
+
}
|
690 |
+
|
691 |
|
692 |
+
.sek-module-drop-zone-for-first-module [data-sek-click-on="pick-content"] {
|
693 |
cursor: pointer;
|
694 |
width: 50px;
|
695 |
height: 50px;
|
696 |
+
/*color: #0085ba;
|
697 |
+
color: rgba(0, 133, 186, 0.6);*/
|
698 |
+
color: #535353;
|
699 |
border-radius: 30px;
|
700 |
-webkit-transition: all .20s ease;
|
701 |
-o-transition: all .20s ease;
|
711 |
justify-content: center;
|
712 |
}
|
713 |
|
714 |
+
.sek-module-drop-zone-for-first-module [data-sek-click-on="pick-content"]:hover {
|
715 |
-webkit-box-shadow: 0 2px 6px rgba(0,0,0,.2);
|
716 |
box-shadow: 0 2px 6px rgba(0,0,0,.2);
|
717 |
+
/*color: #0085ba;*/
|
718 |
+
color: #fff;
|
719 |
}
|
720 |
|
721 |
/* Adapt the size when columns are too narrow */
|
722 |
+
.sek-col-8 [data-sek-click-on="pick-content"],
|
723 |
+
.sek-col-9 [data-sek-click-on="pick-content"],
|
724 |
+
.sek-col-10 [data-sek-click-on="pick-content"],
|
725 |
+
.sek-col-11 [data-sek-click-on="pick-content"],
|
726 |
+
.sek-col-12 [data-sek-click-on="pick-content"],
|
727 |
+
.sek-col-14 [data-sek-click-on="pick-content"],
|
728 |
+
.sek-col-16 [data-sek-click-on="pick-content"],
|
729 |
+
.sek-col-20 [data-sek-click-on="pick-content"],
|
730 |
+
.sek-col-25 [data-sek-click-on="pick-content"] {
|
731 |
font-size: 0.9rem;
|
732 |
/* width: 35px;
|
733 |
height: 35px;
|
736 |
|
737 |
|
738 |
/* Hide the + during a drag phase */
|
739 |
+
.sek-dragging .sek-module-drop-zone-for-first-module [data-sek-click-on="pick-content"] {
|
740 |
display: none;
|
741 |
}
|
742 |
+
/*.sek-module-drop-zone-for-first-module [data-sek-click-on="pick-content"]:hover {
|
743 |
font-size: 27px;
|
744 |
}*/
|
745 |
|
749 |
|
750 |
/* This is the selector for all eligible drop zones */
|
751 |
.sek-drop-zone {
|
752 |
+
-webkit-transition: opacity, height, background 0.4s ease;
|
753 |
+
-o-transition: opacity, height, background 0.4s ease;
|
754 |
+
transition: opacity, height, background 0.4s ease;
|
755 |
}
|
756 |
|
757 |
|
763 |
the class .sek-active-drop-zone is added when entering / overing the drop target
|
764 |
and removed when leaving the drop element
|
765 |
*/
|
766 |
+
.sek-active-drop-zone.sek-module-drop-zone-for-first-module [data-sek-click-on="pick-content"] {
|
767 |
display: none;
|
768 |
}
|
769 |
.sek-dynamic-drop-zone {
|
780 |
|
781 |
.sek-dragging .sek-dynamic-drop-zone {
|
782 |
height: 5px;
|
783 |
+
-webkit-transition: all 3s ease;
|
784 |
+
-o-transition: all 3s ease;
|
785 |
+
transition: all 3s ease;
|
786 |
/*background: #eee;*/
|
787 |
/*border:2px dotted #a2a2a2;*/
|
788 |
border:2px dotted #72777c;
|
789 |
background: #ddd;
|
790 |
border-radius: 5px;
|
791 |
}
|
792 |
+
.sek-dragging .sek-drop-zone {
|
793 |
+
-webkit-transition: all 1s ease;
|
794 |
+
-o-transition: all 1s ease;
|
795 |
+
transition: all 1s ease;
|
796 |
+
}
|
797 |
.sek-dragging [data-sek-location="between-sections"], .sek-dragging [data-sek-location="in-empty-location"]{
|
798 |
background: #ddd;
|
799 |
border:2px dotted #72777c;
|
804 |
}
|
805 |
.sek-dragging .sek-drag-is-close.sek-dynamic-drop-zone {
|
806 |
height: 55px;
|
807 |
+
-webkit-transition: all 1.5s ease;
|
808 |
+
-o-transition: all 1.5s ease;
|
809 |
+
transition: all 1.5s ease;
|
810 |
}
|
811 |
.sek-dragging .sek-drag-is-very-close.sek-dynamic-drop-zone {
|
812 |
height: 75px;
|
813 |
+
-webkit-transition: all 0.65s ease;
|
814 |
+
-o-transition: all 0.65s ease;
|
815 |
+
transition: all 0.65s ease;
|
816 |
+
}
|
817 |
+
.sek-dragging .sek-drag-is-in.sek-dynamic-drop-zone {
|
818 |
+
height: 100px;
|
819 |
+
-webkit-transition: all 0.45s ease;
|
820 |
+
-o-transition: all 0.45s ease;
|
821 |
+
transition: all 0.45s ease;
|
822 |
+
}
|
823 |
+
.sek-dragging .sek-feed-me-seymore {
|
824 |
+
-moz-box-shadow: inset 0 0 30px #000000;
|
825 |
+
-webkit-box-shadow: inset 0 0 30px #000000;
|
826 |
+
box-shadow: inset 0 0 30px #000000;
|
827 |
}
|
|
|
|
|
828 |
.sek-dragging [data-sek-location="between-modules-and-nested-sections"], .sek-dragging .sek-module-drop-zone-for-first-module {
|
829 |
background: #dcefff;
|
830 |
background: rgba(220, 239, 255, 0.84);
|
941 |
-o-transition: all .20s ease;
|
942 |
transition: all .20s ease;
|
943 |
opacity: 0;
|
944 |
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
|
945 |
+
font-size: 13px;
|
946 |
+
line-height: 26px;
|
947 |
}
|
948 |
.sek-add-content-btn.sek-mouse-is-close {
|
949 |
z-index: 10000;
|
963 |
box-shadow: 0 2px 6px rgba(0,0,0,.2);
|
964 |
}
|
965 |
.sek-click-on-button-icon {
|
966 |
+
line-height: 18px;
|
967 |
+
width: 18px;
|
|
|
|
|
968 |
}
|
969 |
.sek-add-content-btn:hover .sek-click-on-button-icon {
|
970 |
+
padding-left: 6px;
|
971 |
+
font-size: 13px;
|
972 |
+
line-height: 26px;
|
973 |
}
|
974 |
|
975 |
.action-button-text {
|
976 |
visibility: hidden;
|
977 |
+
display: none;
|
978 |
white-space: nowrap;
|
979 |
+
padding-left: 5px;
|
980 |
padding-bottom: 2px;
|
981 |
}
|
982 |
|
983 |
.sek-add-content-btn:not(.disabled):hover .action-button-text {
|
984 |
visibility: visible;
|
985 |
+
display: inline-block;
|
986 |
}
|
987 |
|
988 |
|
1092 |
display: -webkit-box;
|
1093 |
display: -ms-flexbox;
|
1094 |
display: flex;
|
|
|
|
|
1095 |
-webkit-box-align: center;
|
1096 |
-ms-flex-align: center;
|
1097 |
align-items: center;
|
1109 |
|
1110 |
|
1111 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1112 |
/* REFRESHING A LEVEL */
|
1113 |
+
.sek-refreshing, .sek-blur {
|
1114 |
+
-webkit-filter: blur(3px);
|
1115 |
+
filter: blur(3px);
|
1116 |
+
-webkit-transition: all 0.3s ease-in-out;
|
1117 |
+
-moz-transition: all, 0.3s ease-in-out;
|
1118 |
+
-ms-transition: all, 0.3s ease-in-out;
|
1119 |
+
-o-transition: all, 0.3s ease-in-out;
|
1120 |
+
transition: all 0.3s ease-in-out;
|
1121 |
/*position: absolute*/
|
1122 |
}
|
1123 |
.sek-level-clone {
|
1137 |
}
|
1138 |
|
1139 |
|
1140 |
+
/* FULL PAGE LOADER WRAPPER */
|
1141 |
+
#nimble-full-page-loader-wrapper {
|
1142 |
+
height: 100vh;
|
1143 |
+
position: absolute;
|
1144 |
+
text-align: center;
|
1145 |
+
right: 0;
|
1146 |
+
left: 0;
|
1147 |
+
z-index: 20;
|
1148 |
+
color: #fff;
|
1149 |
+
display: block;
|
1150 |
+
-webkit-transition: all 0.3s ease-in-out;
|
1151 |
+
-moz-transition: all, 0.3s ease-in-out;
|
1152 |
+
-ms-transition: all, 0.3s ease-in-out;
|
1153 |
+
-o-transition: all, 0.3s ease-in-out;
|
1154 |
+
transition: all 0.3s ease-in-out;
|
1155 |
+
/* visibility: hidden; */
|
1156 |
+
opacity: 0.3;
|
1157 |
+
top: 0%;
|
1158 |
+
background: rgba(0, 0, 0, 0.80);
|
1159 |
+
padding: 2px;
|
1160 |
+
z-index: 99999;
|
1161 |
+
display: -webkit-box;
|
1162 |
+
display: -ms-flexbox;
|
1163 |
+
display: flex;
|
1164 |
+
-webkit-box-align: center;
|
1165 |
+
-ms-flex-align: center;
|
1166 |
+
align-items: center;
|
1167 |
+
/* flex-direction: column; */
|
1168 |
+
flex: 0 0 100%;
|
1169 |
+
max-width: 100%;
|
1170 |
+
display: none;
|
1171 |
+
}
|
1172 |
+
|
1173 |
|
1174 |
/* CSS LOADER */
|
1175 |
@-webkit-keyframes sek-mr-loader {
|
1254 |
-webkit-animation: sek-mr-loader 1.25s 0s infinite cubic-bezier(0.21, 0.53, 0.56, 0.8);
|
1255 |
animation: sek-mr-loader 1.25s 0s infinite cubic-bezier(0.21, 0.53, 0.56, 0.8);
|
1256 |
}
|
1257 |
+
|
1258 |
+
.white-loader > .sek-mr-loader > div {
|
1259 |
+
border: 2px solid #fff;
|
1260 |
+
}
|
1261 |
/*
|
1262 |
html.no-js [id*=sek-slider-loader-wrapper] {
|
1263 |
display: none;
|
1269 |
position: absolute;
|
1270 |
z-index: 99;
|
1271 |
background: #ffffff;
|
1272 |
+
}*/
|
1273 |
+
|
1274 |
+
|
1275 |
+
|
1276 |
+
/* PLACEHOLDER STYLE FOR TINYMCE MODULE */
|
1277 |
+
.sek-tiny-mce-module-placeholder-text { padding:10px;border: 1px dotted;background: rgba(0, 0, 0, 0.35); color: #fff;}
|
assets/czr/sek/css/sek-preview.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.sektion-wrapper{min-height:50px}.sek-section{padding:23px 0 0;position:relative}.sek-sektion-inner{padding:15px}.sek-column{position:relative;padding:23px 10px 0}.sek-section h2{color:#000}.sek-column h3{color:#00f}.sek-column-inner.sek-empty-col{min-height:100px;height:100%}.sek-module{position:relative}.sek-module-inner{position:relative}.sek-module h4{color:red}.sek-dyn-ui-wrapper{display:none;position:absolute;bottom:0;left:0;top:0;right:0;color:#fff;background:rgba(190,239,255,0);border-radius:4px;box-sizing:border-box!important;-moz-box-sizing:border-box!important;-webkit-box-sizing:border-box!important}.sek-dyn-ui-wrapper,.sek-dyn-ui-wrapper *{text-shadow:none;-webkit-touch-callout:none}.sek-dyn-ui-inner{position:absolute;top:-18px;opacity:.8;-webkit-transition:opacity .25s ease;-o-transition:opacity .25s ease;transition:opacity .25s ease}.sek-dyn-left-icons{left:0}.sek-dyn-right-icons{right:0}.sek-dyn-ui-inner:hover{opacity:1}.sek-dyn-ui-wrapper-active{position:relative}.sek-dyn-ui-icons{background:#00a0d2;float:left;min-height:18px;margin:-1px -1px 0;padding:0 4px;text-shadow:none;font-size:1em}.sek-dyn-ui-icons>span{display:block;float:left}.sek-dyn-ui-icons i{color:#fff!important;cursor:pointer;float:left;font-size:1em;height:1.4em;line-height:1.4em;opacity:.8;text-align:center;width:1em}.sek-dyn-left-icons .sek-dyn-ui-icons i{margin:0 .3em}.sek-dyn-ui-icons i:hover{opacity:1}.sek-dyn-ui-icons .fa-ellipsis-v{cursor:move}.sek-dyn-ui-icons [data-sek-click-on=remove]{padding-left:.42em;margin-left:0;width:1.6em!important;border-left:1px dotted #fff}.sek-dyn-ui-icons [data-sek-click-on=pick-module]{padding-left:.42em;margin-left:0;width:1.6em!important;border-left:1px dotted #fff}.sek-dyn-ui-location-type{position:absolute;z-index:2;bottom:0;padding:0 1em;font-size:.6em;right:0;cursor:pointer}.sek-col-10 .sek-module-dyn-ui,.sek-col-10>.sek-column-dyn-ui,.sek-col-11 .sek-module-dyn-ui,.sek-col-11>.sek-column-dyn-ui,.sek-col-12 .sek-module-dyn-ui,.sek-col-12>.sek-column-dyn-ui,.sek-col-14 .sek-module-dyn-ui,.sek-col-14>.sek-column-dyn-ui,.sek-col-16 .sek-module-dyn-ui,.sek-col-16>.sek-column-dyn-ui,.sek-col-20 .sek-module-dyn-ui,.sek-col-20>.sek-column-dyn-ui,.sek-col-25 .sek-module-dyn-ui,.sek-col-25>.sek-column-dyn-ui,.sek-col-8 .sek-module-dyn-ui,.sek-col-8>.sek-column-dyn-ui,.sek-col-9 .sek-module-dyn-ui,.sek-col-9>.sek-column-dyn-ui{font-size:.7rem}.sek-section>.sek-dyn-ui-wrapper .sek-dyn-ui-icons,.sek-section>.sek-dyn-ui-wrapper .sek-dyn-ui-location-type{background:#000}.sek-section>.sek-dyn-ui-wrapper .sek-dyn-ui-location-type{z-index:1000}.sek-section[data-sek-is-nested=true]>.sek-dyn-ui-wrapper .sek-dyn-ui-location-type{z-index:1002}.sek-section-dyn-ui{border:2px dotted #000}.sek-section>.sek-section-dyn-ui .sek-dyn-ui-inner{top:0;z-index:1000}.sek-section.sek-highlight-active-ui{-webkit-box-shadow:0 0 2px rgba(0,0,0,.8);box-shadow:0 0 2px rgba(0,0,0,.8)}.sek-column>.sek-column-dyn-ui .sek-dyn-ui-inner{top:0;z-index:1001}.sek-column>.sek-dyn-ui-wrapper .sek-dyn-ui-icons,.sek-column>.sek-dyn-ui-wrapper .sek-dyn-ui-location-type{background:#00b846}.sek-column>.sek-dyn-ui-wrapper .sek-dyn-ui-location-type{z-index:1001}.sek-column-dyn-ui{border:2px dotted #00b846;font-size:1rem}.sek-column-dyn-ui .dev-level-data{background:#0085ba}.sek-column.sek-highlight-active-ui{-webkit-box-shadow:0 0 2px rgba(0,184,70,.8);box-shadow:0 0 2px rgba(0,184,70,.8)}.sek-module{min-height:50px}.sek-module:hover{cursor:pointer}.sek-module>.sek-module-dyn-ui .sek-dyn-ui-inner{top:0;z-index:1005}.sek-module>.sek-dyn-ui-wrapper .sek-dyn-ui-icons,.sek-module>.sek-dyn-ui-wrapper .sek-dyn-ui-location-type{background:#0085ba}.sek-module>.sek-dyn-ui-wrapper .sek-dyn-ui-location-type{left:0;right:auto;z-index:1005}.sek-module-dyn-ui{border:1px dotted #0085ba;font-size:1rem}.dev-level-data{position:absolute;bottom:0;left:0;background:#000;padding:1px 12px;font-size:11px}.sek-module-dyn-ui .dev-level-data{background:#c68f00;right:0;left:unset}.sek-module.sek-highlight-active-ui{-webkit-box-shadow:0 0 2px rgba(0,133,186,.8);box-shadow:0 0 2px rgba(0,133,186,.8)}.sek-wp-content-wrapper{cursor:pointer;position:relative}.sek-wp-content-wrapper:after{content:'';display:block;clear:both}.sek-wp-content-wrapper:hover{outline:2px dashed #036697}.sek-wp-content-wrapper>.sek-dyn-ui-wrapper .sek-dyn-ui-location-type{left:auto;right:0;z-index:1005;background:#036697}.sek-wp-content-wrapper .sek-dyn-ui-icons{background-color:#036697}.sek-wp-content-wrapper .sek-dyn-ui-inner{top:0;z-index:1005}.sek-wp-content-dyn-ui{bottom:0;left:0;top:0;right:0;font-size:1rem}.sek-empty-location-placeholder{position:relative;min-height:50px;margin:20px 0;border-radius:5px}.sek-empty-location-placeholder:hover{border:2px dotted #000}.sek-add-button-wrapper{text-align:center;width:100%;margin:1rem 0;position:relative}.sek-no-modules-column{position:relative;height:100%;bottom:0;left:0;right:0;z-index:1}.sek-module-drop-zone-for-first-module{text-align:center;border:1px dotted #ccc;background:#eee;background:rgba(238,238,238,.84);height:100%;min-height:40px;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;display:-ms-flexbox;display:-webkit-box;display:flex}.sek-module-drop-zone-for-first-module [data-sek-click-on=pick-module]{cursor:pointer;width:50px;height:50px;color:#0085ba;color:rgba(0,133,186,.6);border-radius:30px;-webkit-transition:all .2s ease;-o-transition:all .2s ease;transition:all .2s ease;-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.sek-module-drop-zone-for-first-module [data-sek-click-on=pick-module]:hover{-webkit-box-shadow:0 2px 6px rgba(0,0,0,.2);box-shadow:0 2px 6px rgba(0,0,0,.2);color:#0085ba}.sek-col-10 [data-sek-click-on=pick-module],.sek-col-11 [data-sek-click-on=pick-module],.sek-col-12 [data-sek-click-on=pick-module],.sek-col-14 [data-sek-click-on=pick-module],.sek-col-16 [data-sek-click-on=pick-module],.sek-col-20 [data-sek-click-on=pick-module],.sek-col-25 [data-sek-click-on=pick-module],.sek-col-8 [data-sek-click-on=pick-module],.sek-col-9 [data-sek-click-on=pick-module]{font-size:.9rem}.sek-dragging .sek-module-drop-zone-for-first-module [data-sek-click-on=pick-module]{display:none}.sek-sortable-overing>.sek-no-modules-column{display:none}.sek-drop-zone{-webkit-transition:opacity,height .4s ease;-o-transition:opacity,height .4s ease;transition:opacity,height .4s ease}.sek-active-drop-zone.sek-module-drop-zone-for-first-module [data-sek-click-on=pick-module]{display:none}.sek-dynamic-drop-zone{opacity:0}.sek-active-drop-zone.sek-dynamic-drop-zone{height:auto!important;min-height:50px}.sek-dragging .sek-dynamic-drop-zone{height:5px;-webkit-transition:all .25s ease;-o-transition:all .25s ease;transition:all .25s ease;border:2px dotted #72777c;background:#ddd;border-radius:5px}.sek-dragging [data-sek-location=between-sections],.sek-dragging [data-sek-location=in-empty-location]{background:#ddd;border:2px dotted #72777c}.sek-dragging .sek-drag-is-approaching.sek-dynamic-drop-zone{height:20px}.sek-dragging .sek-drag-is-close.sek-dynamic-drop-zone{height:55px}.sek-dragging .sek-drag-is-very-close.sek-dynamic-drop-zone{height:75px}.sek-dragging .sek-module-drop-zone-for-first-module,.sek-dragging [data-sek-location=between-modules-and-nested-sections]{background:#dcefff;background:rgba(220,239,255,.84);border:2px dotted #1d85bb;border-radius:5px}.sek-dragging-element .sek-column-inner,.sek-dragging-element .sek-sektion-inner{min-height:50px}.sek-module-placeholder-content{text-align:center;text-transform:uppercase}.sek-module-placeholder-content>p{padding:35px 10px}.sek-add-content-button{position:absolute;top:0;width:100%;z-index:1001;display:none}.sek-empty-location-placeholder .sek-add-content-button{top:50%}.sek-add-content-button.is_last{bottom:0;top:unset}.sek-add-content-button-wrapper{position:relative;top:-5px;width:100%;border:1px dashed #ccc;height:10px;left:0;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-transition:.35s ease-in-out;-o-transition:.35s ease-in-out;transition:.35s ease-in-out}.is_last .sek-add-content-button-wrapper{top:10px}.sek-mouse-is-close .sek-add-content-button-wrapper{border:1px dashed #333}.sek-mouse-is-close .sek-add-content-button-wrapper .sek-add-content-btn{opacity:1}.sek-add-content-btn{margin:auto;padding:0;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;border-radius:1000px;width:18px;height:18px;background-color:#000;color:#fff;border:none;outline:0;font-size:13px;overflow:hidden;-webkit-transition:width .5s ease,background-color .5s ease;-o-transition:width .5s ease,background-color .5s ease;transition:width .5s ease,background-color .5s ease;font-weight:400;font-style:normal;cursor:pointer;position:absolute;left:calc(50% - 12px);-webkit-transition:all .2s ease;-o-transition:all .2s ease;transition:all .2s ease;opacity:0}.sek-add-content-btn.sek-mouse-is-close{z-index:10000}.sek-add-content-btn:hover{width:26px;height:26px;--sek-add-content-btn-width:65px;width:calc(var(--sek-add-content-btn-width) + 70px);background-color:#000;opacity:1;left:calc(50% - 83px);-webkit-box-shadow:0 2px 6px rgba(0,0,0,.2);box-shadow:0 2px 6px rgba(0,0,0,.2)}.sek-click-on-button-icon{font-size:19px;left:4px;top:-4px;position:relative}.sek-add-content-btn:hover .sek-click-on-button-icon{font-size:19px;left:8px;top:0}.action-button-text{visibility:hidden;white-space:nowrap;padding-left:14px;padding-bottom:2px}.sek-add-content-btn:not(.disabled):hover .action-button-text{visibility:visible}.sortable-placeholder{max-width:100%;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;background:#00a2d7;border-radius:4px;color:#fff!important;display:block;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-weight:400;font-size:12px;letter-spacing:1px;line-height:14px;margin:10px;padding:6px 8px 5px;position:relative;text-align:left;-o-text-overflow:ellipsis;text-overflow:ellipsis;text-shadow:none;text-transform:none;white-space:nowrap;overflow:hidden;z-index:10}.in-new-sektion.sortable-placeholder{background:#72777c}.sek-moving-section [data-sek-level=location]{background:#ddd;border:2px dotted #72777c;border-radius:5px}.sek-moving-section .sek-empty-location-placeholder{display:none}.sek-sortable-section-over .sortable-placeholder{background:#72777c}.ui-resizable-helper{border:2px dotted #00b846}[data-sek-level=column] .ui-resizable-e{cursor:e-resize;width:7px;right:-4px;font-size:.55em}[data-sek-level=column] .ui-resizable-e i{background:#00b846;border-radius:12px;color:#fff;padding:2px;display:none}[data-sek-level=section]:hover .ui-resizable-e{background:#d5d5d573;background:rgba(213,213,213,.42)}[data-sek-level=section]:hover .ui-resizable-e i{display:block}[data-sek-level=column] .ui-resizable-handle{display:-webkit-box;display:-ms-flexbox;display:flex;height:calc(100% - 26px);top:26px;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.sek-module [data-sek-input-type=tiny_mce_editor]:hover{outline:1px solid #1d85bb}.sek-refreshing{-webkit-filter:blur(1px);filter:blur(1px)}.sek-level-clone{position:absolute!important;z-index:10000}.sek-level-clone::before{content:"";display:block;position:absolute;top:0;left:0;right:0;bottom:0;background-color:#fff;opacity:.5}@-webkit-keyframes sek-mr-loader{0%{-webkit-transform:scale(.1);transform:scale(.1);opacity:1}70%{-webkit-transform:scale(1);transform:scale(1);opacity:.7}100%{opacity:0}}@keyframes sek-mr-loader{0%{-webkit-transform:scale(.1);transform:scale(.1);opacity:1}70%{-webkit-transform:scale(1);transform:scale(1);opacity:.7}100%{opacity:0}}.sek-css-loader{display:none;width:50px;height:50px;position:absolute;-webkit-transform:translate3d(-50%,-50%,0);transform:translate3d(-50%,-50%,0);top:50%;left:50%}.csstransforms3d .sek-css-loader{display:block}.sek-mr-loader>div:nth-child(0){-webkit-animation-delay:-.8s;animation-delay:-.8s}.sek-mr-loader>div:nth-child(1){-webkit-animation-delay:-.6s;animation-delay:-.6s}.sek-mr-loader>div:nth-child(2){-webkit-animation-delay:-.4s;animation-delay:-.4s}.sek-mr-loader>div:nth-child(3){-webkit-animation-delay:-.2s;animation-delay:-.2s}.sek-mr-loader>div{-webkit-animation-fill-mode:both;animation-fill-mode:both;position:absolute;top:0;left:0;width:100%;height:100%;border-radius:100%;border:2px solid #777;-webkit-animation:sek-mr-loader 1.25s 0s infinite cubic-bezier(.21,.53,.56,.8);animation:sek-mr-loader 1.25s 0s infinite cubic-bezier(.21,.53,.56,.8)}
|
1 |
+
.sektion-wrapper{min-height:50px;margin-top:21px}.sek-section{position:relative}.sek-column{position:relative}.sek-column-inner.sek-empty-col{min-height:130px;height:100%}.sek-has-modules .sek-column-inner.sek-empty-col{min-height:auto;height:auto}.sek-module{position:relative}.sek-module-inner{position:relative;-webkit-transition:all .25s ease-in-out;-moz-transition:all,.25s ease-in-out;-ms-transition:all,.25s ease-in-out;-o-transition:all,.25s ease-in-out;transition:all .25s ease-in-out}[data-sek-level]{-webkit-transition:all .2s ease-out;-o-transition:all .2s ease-out;transition:all .2s ease-out}[data-sek-module-type=czr_image_module] figure img{-webkit-transition:all .2s ease-out;-o-transition:all .2s ease-out;transition:all .2s ease-out}.sek-module [data-sek-input-type=tiny_mce_editor]:hover{outline:1px solid #1d85bb}@media (min-width:767px){[data-sek-level=location] .sek-hidden-on-desktops{display:-ms-flexbox;display:-webkit-box;display:flex;-webkit-filter:grayscale(30%);filter:grayscale(30%);-webkit-filter:gray;filter:gray;opacity:.8}}@media (min-width:575px) and (max-width:768px){[data-sek-level=location] .sek-hidden-on-tablets{display:-ms-flexbox;display:-webkit-box;display:flex;-webkit-filter:grayscale(30%);filter:grayscale(30%);-webkit-filter:gray;filter:gray;opacity:.8}}@media (max-width:575px){[data-sek-level=location] .sek-hidden-on-mobiles{display:-ms-flexbox;display:-webkit-box;display:flex;-webkit-filter:grayscale(30%);filter:grayscale(30%);-webkit-filter:gray;filter:gray;opacity:.8}}.sek-dyn-ui-wrapper{display:none;position:absolute;bottom:0;left:0;top:0;right:0;color:#fff;background:rgba(190,239,255,0);border-radius:4px;box-sizing:border-box!important;-moz-box-sizing:border-box!important;-webkit-box-sizing:border-box!important}.sek-dyn-ui-wrapper,.sek-dyn-ui-wrapper *{text-shadow:none;-webkit-touch-callout:none}.sek-dyn-ui-inner{position:absolute;-webkit-transition:opacity .25s ease;-o-transition:opacity .25s ease;transition:opacity .25s ease}.sek-dyn-ui-inner.sek-is-expanded{display:block!important;z-index:2000!important}.sek-dyn-left-icons{left:0}.sek-dyn-right-icons{right:0}.sek-dyn-ui-inner:hover{opacity:1}.sek-dyn-ui-wrapper-active{position:relative}.sek-dyn-ui-icons{background:#00a0d2;float:left;min-height:18px;padding:0 4px;text-shadow:none;font-size:1em}.sek-dyn-ui-icons>span{display:block;float:left}.sek-dyn-ui-icons i{color:#fff!important;cursor:pointer;float:left;font-size:1em;height:1.4em;line-height:1.4em;opacity:.8;text-align:center;width:1em}.sek-dyn-left-icons .sek-dyn-ui-icons i,.sek-dyn-right-icons .sek-dyn-ui-icons i{margin:0 .3em}.sek-dyn-ui-icons i:hover{opacity:1}.sek-dyn-ui-icons .fa-arrows-alt{cursor:move}.sek-dyn-ui-icons [data-sek-click-on=remove]{padding-left:.42em;margin-left:0;width:1.6em!important;border-left:1px dotted #fff}.sek-dyn-ui-icons [data-sek-click-on=pick-content]{padding-left:.42em;margin-left:0;width:1.6em!important;border-left:1px dotted #fff}.sek-dyn-ui-location-type{position:absolute;z-index:2;bottom:0;padding:0 .5em;font-size:.6em;right:0;cursor:pointer;opacity:.75}.sek-dyn-ui-location-type:hover{opacity:1}.sek-dyn-ui-location-inner{padding:3px 0}.sek-minimize-ui{float:left;text-align:center;width:16px;padding:3px}.sek-col-10 .sek-module-dyn-ui,.sek-col-10>.sek-column-dyn-ui,.sek-col-11 .sek-module-dyn-ui,.sek-col-11>.sek-column-dyn-ui,.sek-col-12 .sek-module-dyn-ui,.sek-col-12>.sek-column-dyn-ui,.sek-col-14 .sek-module-dyn-ui,.sek-col-14>.sek-column-dyn-ui,.sek-col-16 .sek-module-dyn-ui,.sek-col-16>.sek-column-dyn-ui,.sek-col-20 .sek-module-dyn-ui,.sek-col-20>.sek-column-dyn-ui,.sek-col-25 .sek-module-dyn-ui,.sek-col-25>.sek-column-dyn-ui,.sek-col-8 .sek-module-dyn-ui,.sek-col-8>.sek-column-dyn-ui,.sek-col-9 .sek-module-dyn-ui,.sek-col-9>.sek-column-dyn-ui{font-size:.7rem}.sek-col-10 .sek-module-dyn-ui .sek-ham__toggler-span-wrapper,.sek-col-10>.sek-column-dyn-ui .sek-ham__toggler-span-wrapper,.sek-col-11 .sek-module-dyn-ui .sek-ham__toggler-span-wrapper,.sek-col-11>.sek-column-dyn-ui .sek-ham__toggler-span-wrapper,.sek-col-12 .sek-module-dyn-ui .sek-ham__toggler-span-wrapper,.sek-col-12>.sek-column-dyn-ui .sek-ham__toggler-span-wrapper,.sek-col-14 .sek-module-dyn-ui .sek-ham__toggler-span-wrapper,.sek-col-14>.sek-column-dyn-ui .sek-ham__toggler-span-wrapper,.sek-col-16 .sek-module-dyn-ui .sek-ham__toggler-span-wrapper,.sek-col-16>.sek-column-dyn-ui .sek-ham__toggler-span-wrapper,.sek-col-20 .sek-module-dyn-ui .sek-ham__toggler-span-wrapper,.sek-col-20>.sek-column-dyn-ui .sek-ham__toggler-span-wrapper,.sek-col-25 .sek-module-dyn-ui .sek-ham__toggler-span-wrapper,.sek-col-25>.sek-column-dyn-ui .sek-ham__toggler-span-wrapper,.sek-col-8 .sek-module-dyn-ui .sek-ham__toggler-span-wrapper,.sek-col-8>.sek-column-dyn-ui .sek-ham__toggler-span-wrapper,.sek-col-9 .sek-module-dyn-ui .sek-ham__toggler-span-wrapper,.sek-col-9>.sek-column-dyn-ui .sek-ham__toggler-span-wrapper{height:8px;width:16px}.sek-col-10 .sek-module-dyn-ui .sek-ham__toggler-span-wrapper .line,.sek-col-10>.sek-column-dyn-ui .sek-ham__toggler-span-wrapper .line,.sek-col-11 .sek-module-dyn-ui .sek-ham__toggler-span-wrapper .line,.sek-col-11>.sek-column-dyn-ui .sek-ham__toggler-span-wrapper .line,.sek-col-12 .sek-module-dyn-ui .sek-ham__toggler-span-wrapper .line,.sek-col-12>.sek-column-dyn-ui .sek-ham__toggler-span-wrapper .line,.sek-col-14 .sek-module-dyn-ui .sek-ham__toggler-span-wrapper .line,.sek-col-14>.sek-column-dyn-ui .sek-ham__toggler-span-wrapper .line,.sek-col-16 .sek-module-dyn-ui .sek-ham__toggler-span-wrapper .line,.sek-col-16>.sek-column-dyn-ui .sek-ham__toggler-span-wrapper .line,.sek-col-20 .sek-module-dyn-ui .sek-ham__toggler-span-wrapper .line,.sek-col-20>.sek-column-dyn-ui .sek-ham__toggler-span-wrapper .line,.sek-col-25 .sek-module-dyn-ui .sek-ham__toggler-span-wrapper .line,.sek-col-25>.sek-column-dyn-ui .sek-ham__toggler-span-wrapper .line,.sek-col-8 .sek-module-dyn-ui .sek-ham__toggler-span-wrapper .line,.sek-col-8>.sek-column-dyn-ui .sek-ham__toggler-span-wrapper .line,.sek-col-9 .sek-module-dyn-ui .sek-ham__toggler-span-wrapper .line,.sek-col-9>.sek-column-dyn-ui .sek-ham__toggler-span-wrapper .line{width:15px;height:1px}.sek-col-10 .sek-module-dyn-ui .sek-dyn-ui-location-type:hover .line,.sek-col-10>.sek-column-dyn-ui .sek-dyn-ui-location-type:hover .line,.sek-col-11 .sek-module-dyn-ui .sek-dyn-ui-location-type:hover .line,.sek-col-11>.sek-column-dyn-ui .sek-dyn-ui-location-type:hover .line,.sek-col-12 .sek-module-dyn-ui .sek-dyn-ui-location-type:hover .line,.sek-col-12>.sek-column-dyn-ui .sek-dyn-ui-location-type:hover .line,.sek-col-14 .sek-module-dyn-ui .sek-dyn-ui-location-type:hover .line,.sek-col-14>.sek-column-dyn-ui .sek-dyn-ui-location-type:hover .line,.sek-col-16 .sek-module-dyn-ui .sek-dyn-ui-location-type:hover .line,.sek-col-16>.sek-column-dyn-ui .sek-dyn-ui-location-type:hover .line,.sek-col-20 .sek-module-dyn-ui .sek-dyn-ui-location-type:hover .line,.sek-col-20>.sek-column-dyn-ui .sek-dyn-ui-location-type:hover .line,.sek-col-25 .sek-module-dyn-ui .sek-dyn-ui-location-type:hover .line,.sek-col-25>.sek-column-dyn-ui .sek-dyn-ui-location-type:hover .line,.sek-col-8 .sek-module-dyn-ui .sek-dyn-ui-location-type:hover .line,.sek-col-8>.sek-column-dyn-ui .sek-dyn-ui-location-type:hover .line,.sek-col-9 .sek-module-dyn-ui .sek-dyn-ui-location-type:hover .line,.sek-col-9>.sek-column-dyn-ui .sek-dyn-ui-location-type:hover .line{width:16px;-webkit-transform:translate(-1px,0);transform:translate(-1px,0)}.sek-section>.sek-dyn-ui-wrapper .sek-dyn-ui-icons,.sek-section>.sek-dyn-ui-wrapper .sek-dyn-ui-location-type{background:#000;opacity:.75}.sek-section>.sek-section-dyn-ui .sek-dyn-ui-inner{z-index:1001;display:none}.sek-section>.sek-dyn-ui-wrapper .sek-dyn-ui-icons:hover{opacity:1}.sek-section>.sek-dyn-ui-wrapper .sek-dyn-ui-location-type{z-index:1000;position:relative;float:left}.sek-section[data-sek-is-nested=true]>.sek-dyn-ui-wrapper .sek-dyn-ui-location-type{z-index:1002}.sek-section-dyn-ui{border:2px dotted #000}.sek-section>.sek-section-dyn-ui .sek-dyn-ui-inner{top:-1px;z-index:1000}.sek-section[data-sek-is-nested=true]>.sek-section-dyn-ui .sek-dyn-ui-inner{top:18px}.sek-section.sek-highlight-active-ui{-webkit-box-shadow:0 0 2px rgba(0,0,0,.8);box-shadow:0 0 2px rgba(0,0,0,.8)}.sek-section>.sek-dyn-ui-wrapper .sek-dyn-ui-location-inner{float:left}.sek-section>.sek-dyn-ui-wrapper .sek-dyn-ui-hamb-menu-wrapper,.sek-section>.sek-dyn-ui-wrapper .sek-dyn-ui-level-type{float:left}.sek-section>.sek-dyn-ui-wrapper .sek-dyn-ui-level-type{padding-left:.5em}.sek-column>.sek-column-dyn-ui .sek-dyn-ui-inner{bottom:0;z-index:1002;display:none}.sek-column>.sek-dyn-ui-wrapper .sek-dyn-ui-icons,.sek-column>.sek-dyn-ui-wrapper .sek-dyn-ui-location-type{background:#00b846}.sek-column>.sek-dyn-ui-wrapper .sek-dyn-ui-location-type{z-index:1001;bottom:3px}.sek-column-dyn-ui{border:2px dotted #00b846;font-size:1rem}.sek-column-dyn-ui .dev-level-data{background:#0085ba}.sek-column.sek-highlight-active-ui{-webkit-box-shadow:0 0 2px rgba(0,184,70,.8);box-shadow:0 0 2px rgba(0,184,70,.8)}.sek-column>.sek-dyn-ui-wrapper .sek-dyn-ui-hamb-menu-wrapper,.sek-column>.sek-dyn-ui-wrapper .sek-dyn-ui-level-type{float:right}.sek-column>.sek-dyn-ui-wrapper .sek-dyn-ui-level-type{padding-right:.5em}.sek-column>.sek-dyn-ui-wrapper .sek-dyn-ui-location-inner{float:left}.sek-module:hover{cursor:pointer}.sek-module>.sek-dyn-ui-wrapper .sek-dyn-ui-inner{bottom:0;z-index:1006;display:none}.sek-module>.sek-dyn-ui-wrapper .sek-dyn-ui-icons,.sek-module>.sek-dyn-ui-wrapper .sek-dyn-ui-location-type{background:#0085ba}.sek-module>.sek-dyn-ui-wrapper .sek-dyn-ui-location-type{left:0;top:auto;bottom:0;right:auto;z-index:1005}.sek-module-dyn-ui{border:2px dotted #0085ba;font-size:1rem}.dev-level-data{position:absolute;bottom:0;left:0;background:#000;padding:1px 12px;font-size:11px}.sek-module-dyn-ui .dev-level-data{background:#c68f00;right:0;left:unset}.sek-module.sek-highlight-active-ui{-webkit-box-shadow:0 0 2px rgba(0,133,186,.8);box-shadow:0 0 2px rgba(0,133,186,.8)}.sek-module>.sek-dyn-ui-wrapper .sek-dyn-ui-hamb-menu-wrapper,.sek-module>.sek-dyn-ui-wrapper .sek-dyn-ui-level-type{float:left}.sek-module>.sek-dyn-ui-wrapper .sek-dyn-ui-level-type{padding-left:.5em}.sek-module>.sek-dyn-ui-wrapper .sek-dyn-ui-location-inner{float:left}.sek-ham__toggler-span-wrapper{height:10px;position:relative;width:16px;display:block}.sek-ham__toggler-span-wrapper .line.line-1{top:10%}.sek-ham__toggler-span-wrapper .line.line-2{top:60%}.sek-ham__toggler-span-wrapper .line.line-3{top:110%}.sek-ham__toggler-span-wrapper .line{background:#fff;display:block;width:16px;height:2px;position:absolute;-webkit-border-radius:5px;-webkit-background-clip:padding-box;-moz-border-radius:5px;-moz-background-clip:padding;border-radius:5px;background-clip:padding-box;transition:all ease .2s;-webkit-backface-visibility:hidden;backface-visibility:hidden}.sek-dyn-ui-location-type:hover .line{-webkit-transform:translate(-2px,0);transform:translate(-2px,0);width:20px}.sek-wp-content-wrapper{cursor:pointer;position:relative}.sek-wp-content-wrapper:after{content:'';display:block;clear:both}.sek-wp-content-wrapper:hover{outline:2px dashed #036697}.sek-wp-content-wrapper>.sek-dyn-ui-wrapper .sek-dyn-ui-location-type{left:auto;right:0;z-index:1005;background:#036697}.sek-wp-content-wrapper .sek-dyn-ui-icons{background-color:#036697}.sek-wp-content-wrapper .sek-dyn-ui-inner{top:0;z-index:1005}.sek-wp-content-dyn-ui{bottom:0;left:0;top:0;right:0;font-size:1rem}.sek-empty-location-placeholder{position:relative;min-height:50px;margin:20px 0;border-radius:5px}.sek-empty-location-placeholder:hover{border:2px dotted #000}.sek-add-button-wrapper{text-align:center;width:100%;margin:1rem 0;position:relative}.sek-no-modules-column{position:relative;height:100%;bottom:0;left:0;right:0;z-index:1}.sek-module-drop-zone-for-first-module{text-align:center;border:1px dotted #ccc;background:#eee;background:rgba(0,0,0,.1);height:100%;min-height:40px;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;display:-ms-flexbox;display:-webkit-box;display:flex}.sek-module-drop-zone-for-first-module:hover{background:rgba(0,0,0,.5)}.sek-module-drop-zone-for-first-module:hover [data-sek-click-on=pick-content]{color:#fff}.sek-module-drop-zone-for-first-module [data-sek-click-on=pick-content]{cursor:pointer;width:50px;height:50px;color:#535353;border-radius:30px;-webkit-transition:all .2s ease;-o-transition:all .2s ease;transition:all .2s ease;-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.sek-module-drop-zone-for-first-module [data-sek-click-on=pick-content]:hover{-webkit-box-shadow:0 2px 6px rgba(0,0,0,.2);box-shadow:0 2px 6px rgba(0,0,0,.2);color:#fff}.sek-col-10 [data-sek-click-on=pick-content],.sek-col-11 [data-sek-click-on=pick-content],.sek-col-12 [data-sek-click-on=pick-content],.sek-col-14 [data-sek-click-on=pick-content],.sek-col-16 [data-sek-click-on=pick-content],.sek-col-20 [data-sek-click-on=pick-content],.sek-col-25 [data-sek-click-on=pick-content],.sek-col-8 [data-sek-click-on=pick-content],.sek-col-9 [data-sek-click-on=pick-content]{font-size:.9rem}.sek-dragging .sek-module-drop-zone-for-first-module [data-sek-click-on=pick-content]{display:none}.sek-sortable-overing>.sek-no-modules-column{display:none}.sek-drop-zone{-webkit-transition:opacity,height,background .4s ease;-o-transition:opacity,height,background .4s ease;transition:opacity,height,background .4s ease}.sek-active-drop-zone.sek-module-drop-zone-for-first-module [data-sek-click-on=pick-content]{display:none}.sek-dynamic-drop-zone{opacity:0}.sek-active-drop-zone.sek-dynamic-drop-zone{height:auto!important;min-height:50px}.sek-dragging .sek-dynamic-drop-zone{height:5px;-webkit-transition:all 3s ease;-o-transition:all 3s ease;transition:all 3s ease;border:2px dotted #72777c;background:#ddd;border-radius:5px}.sek-dragging .sek-drop-zone{-webkit-transition:all 1s ease;-o-transition:all 1s ease;transition:all 1s ease}.sek-dragging [data-sek-location=between-sections],.sek-dragging [data-sek-location=in-empty-location]{background:#ddd;border:2px dotted #72777c}.sek-dragging .sek-drag-is-approaching.sek-dynamic-drop-zone{height:20px}.sek-dragging .sek-drag-is-close.sek-dynamic-drop-zone{height:55px;-webkit-transition:all 1.5s ease;-o-transition:all 1.5s ease;transition:all 1.5s ease}.sek-dragging .sek-drag-is-very-close.sek-dynamic-drop-zone{height:75px;-webkit-transition:all .65s ease;-o-transition:all .65s ease;transition:all .65s ease}.sek-dragging .sek-drag-is-in.sek-dynamic-drop-zone{height:100px;-webkit-transition:all .45s ease;-o-transition:all .45s ease;transition:all .45s ease}.sek-dragging .sek-feed-me-seymore{-moz-box-shadow:inset 0 0 30px #000;-webkit-box-shadow:inset 0 0 30px #000;box-shadow:inset 0 0 30px #000}.sek-dragging .sek-module-drop-zone-for-first-module,.sek-dragging [data-sek-location=between-modules-and-nested-sections]{background:#dcefff;background:rgba(220,239,255,.84);border:2px dotted #1d85bb;border-radius:5px}.sek-dragging-element .sek-column-inner,.sek-dragging-element .sek-sektion-inner{min-height:50px}.sek-module-placeholder-content{text-align:center;text-transform:uppercase}.sek-module-placeholder-content>p{padding:35px 10px}.sek-add-content-button{position:absolute;top:0;width:100%;z-index:1001;display:none}.sek-empty-location-placeholder .sek-add-content-button{top:50%}.sek-add-content-button.is_last{bottom:0;top:unset}.sek-add-content-button-wrapper{position:relative;top:-5px;width:100%;border:1px dashed #ccc;height:10px;left:0;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-transition:.35s ease-in-out;-o-transition:.35s ease-in-out;transition:.35s ease-in-out}.is_last .sek-add-content-button-wrapper{top:10px}.sek-mouse-is-close .sek-add-content-button-wrapper{border:1px dashed #333}.sek-mouse-is-close .sek-add-content-button-wrapper .sek-add-content-btn{opacity:1}.sek-add-content-btn{margin:auto;padding:0;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;border-radius:1000px;width:18px;height:18px;background-color:#000;color:#fff;border:none;outline:0;font-size:13px;overflow:hidden;-webkit-transition:width .5s ease,background-color .5s ease;-o-transition:width .5s ease,background-color .5s ease;transition:width .5s ease,background-color .5s ease;font-weight:400;font-style:normal;cursor:pointer;position:absolute;left:calc(50% - 12px);-webkit-transition:all .2s ease;-o-transition:all .2s ease;transition:all .2s ease;opacity:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-size:13px;line-height:26px}.sek-add-content-btn.sek-mouse-is-close{z-index:10000}.sek-add-content-btn:hover{width:26px;height:26px;--sek-add-content-btn-width:65px;width:calc(var(--sek-add-content-btn-width) + 70px);background-color:#000;opacity:1;left:calc(50% - 83px);-webkit-box-shadow:0 2px 6px rgba(0,0,0,.2);box-shadow:0 2px 6px rgba(0,0,0,.2)}.sek-click-on-button-icon{line-height:18px;width:18px}.sek-add-content-btn:hover .sek-click-on-button-icon{padding-left:6px;font-size:13px;line-height:26px}.action-button-text{visibility:hidden;display:none;white-space:nowrap;padding-left:5px;padding-bottom:2px}.sek-add-content-btn:not(.disabled):hover .action-button-text{visibility:visible;display:inline-block}.sortable-placeholder{max-width:100%;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;background:#00a2d7;border-radius:4px;color:#fff!important;display:block;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-weight:400;font-size:12px;letter-spacing:1px;line-height:14px;margin:10px;padding:6px 8px 5px;position:relative;text-align:left;-o-text-overflow:ellipsis;text-overflow:ellipsis;text-shadow:none;text-transform:none;white-space:nowrap;overflow:hidden;z-index:10}.in-new-sektion.sortable-placeholder{background:#72777c}.sek-moving-section [data-sek-level=location]{background:#ddd;border:2px dotted #72777c;border-radius:5px}.sek-moving-section .sek-empty-location-placeholder{display:none}.sek-sortable-section-over .sortable-placeholder{background:#72777c}.ui-resizable-helper{border:2px dotted #00b846}[data-sek-level=column] .ui-resizable-e{cursor:e-resize;width:7px;right:-4px;font-size:.55em}[data-sek-level=column] .ui-resizable-e i{background:#00b846;border-radius:12px;color:#fff;padding:2px;display:none}[data-sek-level=section]:hover .ui-resizable-e{background:#d5d5d573;background:rgba(213,213,213,.42)}[data-sek-level=section]:hover .ui-resizable-e i{display:block}[data-sek-level=column] .ui-resizable-handle{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.sek-blur,.sek-refreshing{-webkit-filter:blur(3px);filter:blur(3px);-webkit-transition:all .3s ease-in-out;-moz-transition:all,.3s ease-in-out;-ms-transition:all,.3s ease-in-out;-o-transition:all,.3s ease-in-out;transition:all .3s ease-in-out}.sek-level-clone{position:absolute!important;z-index:10000}.sek-level-clone::before{content:"";display:block;position:absolute;top:0;left:0;right:0;bottom:0;background-color:#fff;opacity:.5}#nimble-full-page-loader-wrapper{height:100vh;position:absolute;text-align:center;right:0;left:0;z-index:20;color:#fff;display:block;-webkit-transition:all .3s ease-in-out;-moz-transition:all,.3s ease-in-out;-ms-transition:all,.3s ease-in-out;-o-transition:all,.3s ease-in-out;transition:all .3s ease-in-out;opacity:.3;top:0;background:rgba(0,0,0,.8);padding:2px;z-index:99999;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;flex:0 0 100%;max-width:100%;display:none}@-webkit-keyframes sek-mr-loader{0%{-webkit-transform:scale(.1);transform:scale(.1);opacity:1}70%{-webkit-transform:scale(1);transform:scale(1);opacity:.7}100%{opacity:0}}@keyframes sek-mr-loader{0%{-webkit-transform:scale(.1);transform:scale(.1);opacity:1}70%{-webkit-transform:scale(1);transform:scale(1);opacity:.7}100%{opacity:0}}.sek-css-loader{display:none;width:50px;height:50px;position:absolute;-webkit-transform:translate3d(-50%,-50%,0);transform:translate3d(-50%,-50%,0);top:50%;left:50%}.csstransforms3d .sek-css-loader{display:block}.sek-mr-loader>div:nth-child(0){-webkit-animation-delay:-.8s;animation-delay:-.8s}.sek-mr-loader>div:nth-child(1){-webkit-animation-delay:-.6s;animation-delay:-.6s}.sek-mr-loader>div:nth-child(2){-webkit-animation-delay:-.4s;animation-delay:-.4s}.sek-mr-loader>div:nth-child(3){-webkit-animation-delay:-.2s;animation-delay:-.2s}.sek-mr-loader>div{-webkit-animation-fill-mode:both;animation-fill-mode:both;position:absolute;top:0;left:0;width:100%;height:100%;border-radius:100%;border:2px solid #777;-webkit-animation:sek-mr-loader 1.25s 0s infinite cubic-bezier(.21,.53,.56,.8);animation:sek-mr-loader 1.25s 0s infinite cubic-bezier(.21,.53,.56,.8)}.white-loader>.sek-mr-loader>div{border:2px solid #fff}.sek-tiny-mce-module-placeholder-text{padding:10px;border:1px dotted;background:rgba(0,0,0,.35);color:#fff}
|
assets/czr/sek/icons/modules/Nimble_2-columns_icon.svg
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 80"><defs><style>.cls-1{fill:#404a4c;}</style></defs><title>Nimble_Final_icons</title><g id="_2-columns_icon" data-name="2-columns_icon"><path class="cls-1" d="M37.49,55.16H19.06A1.56,1.56,0,0,1,17.5,53.6V26.4a1.56,1.56,0,0,1,1.56-1.56H37.49a1.56,1.56,0,0,1,1.56,1.56V53.6A1.56,1.56,0,0,1,37.49,55.16ZM19.06,25.82a.58.58,0,0,0-.58.58V53.6a.58.58,0,0,0,.58.58H37.49a.58.58,0,0,0,.58-.58V26.4a.58.58,0,0,0-.58-.58Z"/><path class="cls-1" d="M60.94,55.16H42.51a1.56,1.56,0,0,1-1.56-1.56V26.4a1.56,1.56,0,0,1,1.56-1.56H60.94A1.56,1.56,0,0,1,62.5,26.4V53.6A1.56,1.56,0,0,1,60.94,55.16ZM42.51,25.82a.58.58,0,0,0-.58.58V53.6a.58.58,0,0,0,.58.58H60.94a.58.58,0,0,0,.58-.58V26.4a.58.58,0,0,0-.58-.58Z"/></g></svg>
|
assets/czr/sek/icons/modules/Nimble_3-columns_icon.svg
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 80"><defs><style>.cls-1{fill:#404a4c;}</style></defs><title>Nimble_Final_icons</title><g id="_3-columns_icon" data-name="3-columns_icon"><path class="cls-1" d="M29.81,24.84H19.06A1.56,1.56,0,0,0,17.5,26.4V53.6a1.56,1.56,0,0,0,1.56,1.56H29.81a1.56,1.56,0,0,0,1.56-1.56V26.4A1.56,1.56,0,0,0,29.81,24.84ZM30.4,53.6a.58.58,0,0,1-.58.58H19.06a.58.58,0,0,1-.58-.58V26.4a.58.58,0,0,1,.58-.58H29.81a.58.58,0,0,1,.58.58Z"/><path class="cls-1" d="M45.38,24.84H34.62a1.56,1.56,0,0,0-1.56,1.56V53.6a1.56,1.56,0,0,0,1.56,1.56H45.38a1.56,1.56,0,0,0,1.56-1.56V26.4A1.56,1.56,0,0,0,45.38,24.84ZM46,53.6a.58.58,0,0,1-.58.58H34.62A.58.58,0,0,1,34,53.6V26.4a.58.58,0,0,1,.58-.58H45.38a.58.58,0,0,1,.58.58Z"/><path class="cls-1" d="M60.94,24.84H50.19a1.56,1.56,0,0,0-1.56,1.56V53.6a1.56,1.56,0,0,0,1.56,1.56H60.94A1.56,1.56,0,0,0,62.5,53.6V26.4A1.56,1.56,0,0,0,60.94,24.84Zm.58,28.77a.58.58,0,0,1-.58.58H50.19a.58.58,0,0,1-.58-.58V26.4a.58.58,0,0,1,.58-.58H60.94a.58.58,0,0,1,.58.58Z"/></g></svg>
|
assets/czr/sek/icons/modules/Nimble_4-columns_icon.svg
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 80"><defs><style>.cls-1{fill:#404a4c;}</style></defs><title>Nimble_Final_icons</title><g id="_4-columns_icon" data-name="4-columns_icon"><path class="cls-1" d="M25.91,55.16h-7a1.38,1.38,0,0,1-1.37-1.37V26.21a1.38,1.38,0,0,1,1.37-1.37h7a1.38,1.38,0,0,1,1.37,1.37V53.79A1.38,1.38,0,0,1,25.91,55.16Zm-7-29.35a.4.4,0,0,0-.4.4V53.79a.4.4,0,0,0,.4.4h7a.4.4,0,0,0,.4-.4V26.21a.4.4,0,0,0-.4-.4Z"/><path class="cls-1" d="M37.65,55.16h-7a1.38,1.38,0,0,1-1.37-1.37V26.21a1.38,1.38,0,0,1,1.37-1.37h7A1.38,1.38,0,0,1,39,26.21V53.79A1.38,1.38,0,0,1,37.65,55.16Zm-7-29.35a.4.4,0,0,0-.4.4V53.79a.4.4,0,0,0,.4.4h7a.4.4,0,0,0,.4-.4V26.21a.4.4,0,0,0-.4-.4Z"/><path class="cls-1" d="M49.39,55.16h-7A1.38,1.38,0,0,1,41,53.79V26.21a1.38,1.38,0,0,1,1.37-1.37h7a1.38,1.38,0,0,1,1.37,1.37V53.79A1.38,1.38,0,0,1,49.39,55.16Zm-7-29.35a.4.4,0,0,0-.4.4V53.79a.4.4,0,0,0,.4.4h7a.4.4,0,0,0,.4-.4V26.21a.4.4,0,0,0-.4-.4Z"/><path class="cls-1" d="M61.13,55.16h-7a1.38,1.38,0,0,1-1.37-1.37V26.21a1.38,1.38,0,0,1,1.37-1.37h7a1.38,1.38,0,0,1,1.37,1.37V53.79A1.38,1.38,0,0,1,61.13,55.16Zm-7-29.35a.4.4,0,0,0-.4.4V53.79a.4.4,0,0,0,.4.4h7a.4.4,0,0,0,.4-.4V26.21a.4.4,0,0,0-.4-.4Z"/></g></svg>
|
assets/czr/sek/icons/modules/Nimble__divider_icon.svg
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 80"><defs><style>.cls-1{fill:#404a4c;}</style></defs><title>Nimble_</title><g id="divider_icon"><path class="cls-1" d="M62,39.51H18a.49.49,0,1,0,0,1H62a.49.49,0,1,0,0-1Z"/><path class="cls-1" d="M34.5,24.26a.49.49,0,0,0,.35-.14l4.67-4.67v15a.49.49,0,1,0,1,0v-15l4.67,4.67a.49.49,0,0,0,.69-.69l-5.5-5.5a.49.49,0,0,0-.69,0l-5.5,5.5a.49.49,0,0,0,.35.83Z"/><path class="cls-1" d="M45.16,55.88l-4.67,4.67v-15a.49.49,0,1,0-1,0v15l-4.67-4.67a.49.49,0,0,0-.69.69l5.5,5.5a.49.49,0,0,0,.69,0l5.5-5.5a.49.49,0,0,0-.69-.69Z"/></g></svg>
|
assets/czr/sek/icons/modules/Nimble__featured_icon.svg
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 80"><defs><style>.cls-1{fill:#404a4c;}</style></defs><title>Nimble_</title><g id="featured_icon"><path class="cls-1" d="M29,42.34H18a.49.49,0,0,1,0-1H29a.49.49,0,0,1,0,1Z"/><path class="cls-1" d="M29,46.31H18a.49.49,0,0,1,0-1H29a.49.49,0,0,1,0,1Z"/><path class="cls-1" d="M23.65,50.28H18a.49.49,0,0,1,0-1h5.66a.49.49,0,0,1,0,1Z"/><path class="cls-1" d="M45.5,42.34h-11a.49.49,0,1,1,0-1h11a.49.49,0,1,1,0,1Z"/><path class="cls-1" d="M45.5,46.31h-11a.49.49,0,1,1,0-1h11a.49.49,0,1,1,0,1Z"/><path class="cls-1" d="M40.16,50.28H34.5a.49.49,0,1,1,0-1h5.66a.49.49,0,1,1,0,1Z"/><path class="cls-1" d="M62,42.34H51a.49.49,0,0,1,0-1H62a.49.49,0,0,1,0,1Z"/><path class="cls-1" d="M62,46.31H51a.49.49,0,0,1,0-1H62a.49.49,0,0,1,0,1Z"/><path class="cls-1" d="M56.66,50.28H51a.49.49,0,0,1,0-1h5.66a.49.49,0,0,1,0,1Z"/><path class="cls-1" d="M29,38.65H18a.49.49,0,0,1-.49-.49V30.21a.49.49,0,0,1,.49-.49H29a.49.49,0,0,1,.49.49v7.95A.49.49,0,0,1,29,38.65Zm-10.52-1h10v-7h-10Z"/><path class="cls-1" d="M45.5,38.65h-11a.49.49,0,0,1-.49-.49V30.21a.49.49,0,0,1,.49-.49h11a.49.49,0,0,1,.49.49v7.95A.49.49,0,0,1,45.5,38.65ZM35,37.67H45v-7H35Z"/><path class="cls-1" d="M62,38.65H51a.49.49,0,0,1-.49-.49V30.21a.49.49,0,0,1,.49-.49H62a.49.49,0,0,1,.49.49v7.95A.49.49,0,0,1,62,38.65Zm-10.52-1h10v-7h-10Z"/></g></svg>
|
assets/czr/sek/icons/modules/Nimble__heading_icon.svg
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 80"><defs><style>.cls-1{fill:#404a4c;}</style></defs><title>Nimble_</title><g id="heading_icon"><path class="cls-1" d="M17.5,25.52h1.74V39.11h19.6V25.52h1.74v29H38.84V40.81H19.24V54.48H17.5Z"/><path class="cls-1" d="M48.56,37h1.05v8.21H61.45V37H62.5v17.5H61.45V46.22H49.61v8.26H48.56Z"/></g></svg>
|
assets/czr/sek/icons/modules/Nimble__icon_icon.svg
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<svg id="icon_icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 80"><defs><style>.cls-1{fill:none;stroke:#404a4c;stroke-linecap:round;stroke-linejoin:round;}</style></defs><title>Nimble_</title><polygon class="cls-1" points="40 59.05 23.5 49.53 23.5 30.47 40 20.95 56.5 30.47 56.5 49.53 40 59.05"/></svg>
|
assets/czr/sek/icons/modules/Nimble__image_icon.svg
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 80"><defs><style>.cls-1{fill:#404a4c;}</style></defs><title>Nimble_</title><g id="image_icon"><path class="cls-1" d="M60.79,58.5H19.21a1.71,1.71,0,0,1-1.71-1.71V23.21a1.71,1.71,0,0,1,1.71-1.71H60.79a1.71,1.71,0,0,1,1.71,1.71V56.79A1.71,1.71,0,0,1,60.79,58.5Zm-41.59-36a.73.73,0,0,0-.73.73V56.79a.73.73,0,0,0,.73.73H60.79a.73.73,0,0,0,.73-.73V23.21a.73.73,0,0,0-.73-.73Z"/><path class="cls-1" d="M53.14,36.23a5.36,5.36,0,1,1,5.36-5.36A5.37,5.37,0,0,1,53.14,36.23Zm0-9.74a4.38,4.38,0,1,0,4.38,4.38A4.39,4.39,0,0,0,53.14,26.48Z"/><path class="cls-1" d="M56,58.5a.49.49,0,0,1-.37-.17L43.16,43.79l-5.85,6.1a.55.55,0,0,1-.37.15.49.49,0,0,1-.36-.18l-9.1-11.23-9.1,11.23a.49.49,0,1,1-.76-.62l9.48-11.7a.51.51,0,0,1,.76,0L37,48.81l5.84-6.08a.49.49,0,0,1,.72,0l12.8,14.94a.49.49,0,0,1-.37.81Z"/></g></svg>
|
assets/czr/sek/icons/modules/Nimble__spacer_icon.svg
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 80"><defs><style>.cls-1{fill:#404a4c;}</style></defs><title>Nimble_</title><g id="spacer_icon"><path class="cls-1" d="M18,24H62a.49.49,0,0,0,0-1H18a.49.49,0,0,0,0,1Z"/><path class="cls-1" d="M62,56H18a.49.49,0,0,0,0,1H62a.49.49,0,0,0,0-1Z"/><path class="cls-1" d="M45.16,34.84a.49.49,0,0,0,.69-.69l-5.5-5.5a.49.49,0,0,0-.69,0l-5.5,5.5a.49.49,0,1,0,.69.69l4.67-4.67V49.82l-4.67-4.67a.49.49,0,0,0-.69.69l5.5,5.5a.49.49,0,0,0,.69,0l5.5-5.5a.49.49,0,0,0-.69-.69l-4.67,4.67V30.18Z"/></g></svg>
|
assets/czr/sek/icons/modules/Nimble__text_icon.svg
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 80"><defs><style>.cls-1{fill:#404a4c;}</style></defs><title>Nimble_</title><g id="text_icon"><path class="cls-1" d="M62,33.82H35.91a.49.49,0,0,1,0-1H62a.49.49,0,1,1,0,1Z"/><path class="cls-1" d="M62,38.27H35.91a.49.49,0,0,1,0-1H62a.49.49,0,0,1,0,1Z"/><path class="cls-1" d="M62,42.72H35.91a.49.49,0,0,1,0-1H62a.49.49,0,0,1,0,1Z"/><path class="cls-1" d="M52.4,47.17H35.91a.49.49,0,0,1,0-1H52.4a.49.49,0,0,1,0,1Z"/><path class="cls-1" d="M29.8,48.41l0-3.33A6.39,6.39,0,0,1,27,47.62a9.08,9.08,0,0,1-4,.82,6.27,6.27,0,0,1-2.91-.65,4.85,4.85,0,0,1-2-1.76,4.7,4.7,0,0,1-.69-2.53,3.86,3.86,0,0,1,1.68-3.31A7.7,7.7,0,0,1,23.76,39h6V37.34A4.51,4.51,0,0,0,28.44,34a5.25,5.25,0,0,0-3.74-1.19,7.4,7.4,0,0,0-2.87.56A13,13,0,0,0,19,35l-.65-1a14.53,14.53,0,0,1,3.16-1.79,9,9,0,0,1,3.33-.6,6.33,6.33,0,0,1,4.54,1.52,5.57,5.57,0,0,1,1.63,4.16l.06,11.17Zm-2.45-2.26a6,6,0,0,0,2.42-3.23V40.18H23.89A7.06,7.06,0,0,0,20.1,41a2.74,2.74,0,0,0-1.31,2.45A3.39,3.39,0,0,0,20,46.18a4.83,4.83,0,0,0,3.24,1A7.5,7.5,0,0,0,27.35,46.15Z"/></g></svg>
|
assets/czr/sek/icons/modules/Nimble_audio_icon.svg
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 80"><defs><style>.cls-1{fill:#404a4c;}</style></defs><title>Nimble_Final_icons</title><g id="audio_icon"><path class="cls-1" d="M38.76,27.72a.49.49,0,0,0-.49,0l-10.44,6H21.45A1.45,1.45,0,0,0,20,35.19v9.62a1.45,1.45,0,0,0,1.45,1.45h6.39l10.44,6a.49.49,0,0,0,.73-.42V28.14A.49.49,0,0,0,38.76,27.72ZM38,51l-9.86-5.69a.5.5,0,0,0-.24-.05H21.45a.47.47,0,0,1-.47-.47V35.19a.47.47,0,0,1,.47-.47h6.33a.48.48,0,0,0,.39,0L38,29Z"/><path class="cls-1" d="M48.62,30a.49.49,0,1,0-.34.91c3,1.09,5,4.85,5,9.13s-2.07,8-5,9.13a.49.49,0,0,0,.17.95.48.48,0,0,0,.17,0c3.34-1.23,5.66-5.36,5.66-10S52,31.19,48.62,30Z"/><path class="cls-1" d="M44.68,33.25a.49.49,0,1,0-.34.91c1.88.69,3.19,3.09,3.19,5.83s-1.31,5.14-3.19,5.83a.49.49,0,0,0,.17.95.47.47,0,0,0,.17,0c2.25-.83,3.83-3.61,3.83-6.75S46.93,34.08,44.68,33.25Z"/><path class="cls-1" d="M52.64,26.92a.49.49,0,1,0-.34.91C56.26,29.3,59,34.3,59,40s-2.76,10.7-6.72,12.16a.49.49,0,0,0,.17.95.48.48,0,0,0,.17,0C57,51.48,60,46.1,60,40S57,28.52,52.64,26.92Z"/></g></svg>
|
assets/czr/sek/icons/modules/Nimble_button_icon.svg
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 80"><defs><style>.cls-1{fill:#404a4c;}</style></defs><title>Nimble_Final_icons</title><g id="button_icon"><path class="cls-1" d="M59.95,28.29H20.05a2.56,2.56,0,0,0-2.55,2.55v11a2.56,2.56,0,0,0,2.55,2.55h23l1.66,2.89c.89,1.55,2.17,4.1,2.19,4.13a.49.49,0,0,0,.44.27h8a.49.49,0,0,0,.2,0c.59-.26,1.06-3.21,1.15-3.8h0A11.18,11.18,0,0,0,57,46.12c0-.25,0-.94,0-1.7h2.94a2.56,2.56,0,0,0,2.55-2.55v-11A2.56,2.56,0,0,0,59.95,28.29ZM56,46.09a10.07,10.07,0,0,1-.25,1.58,29.83,29.83,0,0,1-.68,3.05H47.66c-.36-.7-1.35-2.64-2.08-3.91l-1.38-2.41h0l-.55-1a.66.66,0,0,1,.24-.91.7.7,0,0,1,1,.31L46,44.23h0l.15.19h0l.45.55a.45.45,0,0,0,.35.13.89.89,0,0,0,.44-.11.49.49,0,0,0,.23-.42v-.15h0v-8a.66.66,0,1,1,1.33,0v5.28h1s0-2.13,0-2.24a.66.66,0,0,1,1.32.07V43.1h1V40.55a.66.66,0,0,1,1.33,0v3.16h1s0-2.14,0-2.21a.66.66,0,0,1,1.33,0l0,2.87h0C56,45.17,56,45.85,56,46.09Zm5.47-4.23a1.54,1.54,0,0,1-1.53,1.53H57l0-1.84A1.68,1.68,0,0,0,54.63,40,1.69,1.69,0,0,0,53,38.88a1.65,1.65,0,0,0-.74.18A1.69,1.69,0,0,0,50,38V36.45a1.69,1.69,0,0,0-3.37,0v6.95l-.93-1.11a1.69,1.69,0,0,0-.2-.27l-.12-.11-.12-.12-.17-.11-.1-.06a1.7,1.7,0,0,0-.63-.17H44l-.22.05-.1,0a1.68,1.68,0,0,0-.58.33l-.08.08a1.65,1.65,0,0,0-.15.16,1.67,1.67,0,0,0-.1.15l-.08.12a1.7,1.7,0,0,0-.17.65s0,.08,0,.13a1.68,1.68,0,0,0,0,.21s0,0,0,0H20.05a1.54,1.54,0,0,1-1.53-1.53v-11a1.53,1.53,0,0,1,1.53-1.53H59.95a1.53,1.53,0,0,1,1.53,1.53Z"/></g></svg>
|
assets/czr/sek/icons/modules/Nimble_contact-form_icon.svg
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8"?>
|
2 |
+
<!-- Generator: Adobe Illustrator 21.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
3 |
+
<svg version="1.1" id="nimble_x5F_contact-form" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
|
4 |
+
x="0px" y="0px" viewBox="0 0 80 80" style="enable-background:new 0 0 80 80;" xml:space="preserve">
|
5 |
+
<style type="text/css">
|
6 |
+
.st0{fill:#404A4C;}
|
7 |
+
</style>
|
8 |
+
<g>
|
9 |
+
<g>
|
10 |
+
<g>
|
11 |
+
<path class="st0" d="M46,50.6H18.2c-0.7,0-1.2-0.6-1.2-1.2V30.6c0-0.7,0.6-1.2,1.2-1.2H46c0.7,0,1.2,0.6,1.2,1.2v18.8
|
12 |
+
C47.2,50.1,46.7,50.6,46,50.6z M18.2,30.4c-0.1,0-0.2,0.1-0.2,0.2v18.8c0,0.1,0.1,0.2,0.2,0.2H46c0.1,0,0.2-0.1,0.2-0.2V30.6
|
13 |
+
c0-0.1-0.1-0.2-0.2-0.2H18.2z"/>
|
14 |
+
</g>
|
15 |
+
</g>
|
16 |
+
<path class="st0" d="M17.6,50.3c-0.1,0-0.3-0.1-0.4-0.2c-0.2-0.2-0.2-0.5,0-0.7l8.5-7.8c0.2-0.2,0.5-0.2,0.7,0s0.2,0.5,0,0.7
|
17 |
+
L18,50.2C17.9,50.3,17.7,50.3,17.6,50.3z"/>
|
18 |
+
<g>
|
19 |
+
<path class="st0" d="M32.1,44.3c-0.7,0-1.4-0.3-1.9-0.8L17.8,31.1c-0.2-0.2-0.2-0.5,0-0.7s0.5-0.2,0.7,0l12.4,12.4
|
20 |
+
c0.7,0.7,1.7,0.7,2.4,0l12.4-12.4c0.2-0.2,0.5-0.2,0.7,0s0.2,0.5,0,0.7L34,43.5C33.5,44.1,32.8,44.3,32.1,44.3z"/>
|
21 |
+
</g>
|
22 |
+
<path class="st0" d="M46.6,50.3c-0.1,0-0.2,0-0.3-0.1l-8.5-7.8c-0.2-0.2-0.2-0.5,0-0.7s0.5-0.2,0.7,0l8.5,7.8
|
23 |
+
c0.2,0.2,0.2,0.5,0,0.7C46.9,50.2,46.7,50.3,46.6,50.3z"/>
|
24 |
+
<path class="st0" d="M62.5,45.1H50.6c-0.3,0-0.5-0.2-0.5-0.5s0.2-0.5,0.5-0.5h11.9c0.3,0,0.5,0.2,0.5,0.5S62.8,45.1,62.5,45.1z"/>
|
25 |
+
<path class="st0" d="M55,38.4h-4.3c-0.3,0-0.5-0.2-0.5-0.5s0.2-0.5,0.5-0.5H55c0.3,0,0.5,0.2,0.5,0.5S55.3,38.4,55,38.4z"/>
|
26 |
+
<path class="st0" d="M58.4,41.8h-7.8c-0.3,0-0.5-0.2-0.5-0.5s0.2-0.5,0.5-0.5h7.8c0.3,0,0.5,0.2,0.5,0.5
|
27 |
+
C58.9,41.5,58.7,41.8,58.4,41.8z"/>
|
28 |
+
</g>
|
29 |
+
</svg>
|
assets/czr/sek/icons/modules/Nimble_gallery_icon.svg
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 80"><defs><style>.cls-1{fill:#404a4c;}</style></defs><title>Nimble_Final_icons</title><g id="gallery_icon"><path class="cls-1" d="M56.23,31H54.5V29.32A1.28,1.28,0,0,0,53.23,28H51.5V26.32A1.28,1.28,0,0,0,50.23,25H23.77a1.28,1.28,0,0,0-1.28,1.28V47.68A1.28,1.28,0,0,0,23.77,49H25.5v1.73A1.28,1.28,0,0,0,26.77,52H28.5v1.73A1.28,1.28,0,0,0,29.77,55H56.23a1.28,1.28,0,0,0,1.27-1.27V32.32A1.28,1.28,0,0,0,56.23,31ZM23.77,26H50.23a.28.28,0,0,1,.27.28V47.68a.28.28,0,0,1-.27.27H47.4l-8-9.33a.5.5,0,0,0-.37-.17.53.53,0,0,0-.37.15L35.1,42.32l-5.67-7a.51.51,0,0,0-.4-.17h0a.54.54,0,0,0-.36.16l0,0h0l-5.11,6.3V26.32A.28.28,0,0,1,23.77,26ZM23.5,47.68V43.25L29,36.43l5.64,7a.5.5,0,0,0,.37.19.54.54,0,0,0,.38-.15L39,39.69,46.08,48H23.77A.28.28,0,0,1,23.5,47.68Zm3,3V49H50.23a1.28,1.28,0,0,0,1.27-1.27V29h1.73a.28.28,0,0,1,.27.28V50.68a.28.28,0,0,1-.27.27H26.77A.28.28,0,0,1,26.5,50.68Zm30,3a.28.28,0,0,1-.27.27H29.77a.28.28,0,0,1-.28-.27V52H53.23a1.28,1.28,0,0,0,1.27-1.27V32h1.73a.28.28,0,0,1,.27.28Z"/><path class="cls-1" d="M45.36,34.79a3.59,3.59,0,0,0,3.56-3.18s0,0,0,0v0a2.44,2.44,0,0,0,0-.33,3.6,3.6,0,0,0-7.2,0,3.24,3.24,0,0,0,0,.41A3.59,3.59,0,0,0,45.36,34.79Zm0-6.2a2.6,2.6,0,0,1,2.6,2.6,1.44,1.44,0,0,1,0,.2v.1a2.58,2.58,0,0,1-5.13,0v-.11a1.35,1.35,0,0,1,0-.19A2.6,2.6,0,0,1,45.36,28.59Z"/></g></svg>
|
assets/czr/sek/icons/modules/Nimble_html_icon.svg
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 80"><defs><style>.cls-1{fill:#404a4c;}</style></defs><title>Nimble_Final_icons</title><g id="html_icon"><path class="cls-1" d="M60.35,39.65l-9.41-9.41a.5.5,0,0,0-.71.71L59.29,40l-9.05,9.05a.5.5,0,1,0,.71.71l9.41-9.41A.5.5,0,0,0,60.35,39.65Z"/><path class="cls-1" d="M29.76,30.24a.5.5,0,0,0-.71,0l-9.41,9.41a.5.5,0,0,0,0,.71l9.41,9.41a.5.5,0,0,0,.71-.71L20.71,40l9.05-9.05A.5.5,0,0,0,29.76,30.24Z"/><path class="cls-1" d="M45.68,24.44a.5.5,0,0,0-.64.3L34,54.92a.5.5,0,1,0,.94.34L46,25.08A.5.5,0,0,0,45.68,24.44Z"/></g></svg>
|
assets/czr/sek/icons/modules/Nimble_map_icon.svg
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 80"><defs><style>.cls-1{fill:#404a4c;}</style></defs><title>Nimble_Final_icons</title><g id="map_icon"><path class="cls-1" d="M40,28a5.5,5.5,0,1,0,5.5,5.5A5.51,5.51,0,0,0,40,28Zm0,10a4.5,4.5,0,1,1,4.5-4.5A4.5,4.5,0,0,1,40,38Z"/><path class="cls-1" d="M52.48,32.68v-.19a12.48,12.48,0,0,0-24.94,0v.19c0,.14,0,.27,0,.41a12.46,12.46,0,0,0,.89,4.61l9.42,19.74c.08.2.86,2,2.19,2s2.1-1.78,2.18-2l9.43-19.76v0a12.43,12.43,0,0,0,.88-4.57C52.5,32.95,52.49,32.81,52.48,32.68Zm-1.78,4.6L41.26,57c-.19.45-.74,1.37-1.26,1.37s-1.08-.92-1.27-1.39L29.31,37.29a11.43,11.43,0,0,1-.81-4.21c0-.12,0-.23,0-.34v-.21a11.48,11.48,0,0,1,22.94,0v.21c0,.11,0,.23,0,.34A11.43,11.43,0,0,1,50.7,37.28Z"/></g></svg>
|
assets/czr/sek/icons/modules/Nimble_quote_icon.svg
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 80"><defs><style>.cls-1{fill:#404a4c;}</style></defs><title>Nimble_Final_icons</title><g id="quote_icon"><path class="cls-1" d="M24,26.85a13.49,13.49,0,0,0-4.87,4.57,12.12,12.12,0,0,0-1.68,6.44,7.28,7.28,0,0,0,1.07,4.27,3.68,3.68,0,0,0,3.16,1.57,3.61,3.61,0,0,0,2.6-1,3.67,3.67,0,0,0,1-2.76,3.18,3.18,0,0,0-1.17-2.64,4,4,0,0,0-2.5-.88,6.59,6.59,0,0,1,1-3.4A11.53,11.53,0,0,1,26,30l.4-.26-1.92-3.13Zm-2.12,5.62A7.86,7.86,0,0,0,20.71,37v.68l.64-.21a1.38,1.38,0,0,1,.38,0,2.93,2.93,0,0,1,1.87.67,2.22,2.22,0,0,1,.79,1.87A2.71,2.71,0,0,1,23.65,42a2.63,2.63,0,0,1-1.92.72,2.72,2.72,0,0,1-2.37-1.16,6.36,6.36,0,0,1-.89-3.7A11.16,11.16,0,0,1,20,31.92a12.28,12.28,0,0,1,4.12-4l.93,1.51A12,12,0,0,0,21.92,32.46Z"/><path class="cls-1" d="M34.51,26.85a13.48,13.48,0,0,0-4.87,4.57A12.12,12.12,0,0,0,28,37.85,7.27,7.27,0,0,0,29,42.12a3.68,3.68,0,0,0,3.16,1.57,3.6,3.6,0,0,0,2.6-1,3.67,3.67,0,0,0,1-2.76,3.18,3.18,0,0,0-1.17-2.64,3.92,3.92,0,0,0-2.5-.88,6.59,6.59,0,0,1,1-3.4,11.53,11.53,0,0,1,3.25-3l.4-.26-1.92-3.13Zm-2.12,5.62A7.86,7.86,0,0,0,31.17,37v.68l.64-.21a1.33,1.33,0,0,1,.38,0,2.92,2.92,0,0,1,1.87.67,2.22,2.22,0,0,1,.8,1.87A2.7,2.7,0,0,1,34.11,42a2.62,2.62,0,0,1-1.92.72,2.71,2.71,0,0,1-2.37-1.16,6.36,6.36,0,0,1-.89-3.7,11.16,11.16,0,0,1,1.53-5.93,12.28,12.28,0,0,1,4.11-4l.93,1.51A12,12,0,0,0,32.38,32.46Z"/><path class="cls-1" d="M61.4,37.91a3.68,3.68,0,0,0-3.13-1.6,3.55,3.55,0,0,0-2.6,1,3.78,3.78,0,0,0-1,2.78,3.14,3.14,0,0,0,1.13,2.58,3.87,3.87,0,0,0,2.48.88,6.81,6.81,0,0,1-1,3.46,11.12,11.12,0,0,1-3.22,3l-.39.26,1.86,3.07.42-.24a13.87,13.87,0,0,0,4.89-4.53,11.81,11.81,0,0,0,1.71-6.41A7.27,7.27,0,0,0,61.4,37.91ZM60,48.1a12.68,12.68,0,0,1-4.15,4l-.87-1.45a11.62,11.62,0,0,0,3.11-3A8.14,8.14,0,0,0,59.23,43v-.68l-.65.22a1,1,0,0,1-.32,0,2.88,2.88,0,0,1-1.89-.66,2.19,2.19,0,0,1-.77-1.82A2.8,2.8,0,0,1,56.35,38a2.57,2.57,0,0,1,1.91-.75,2.72,2.72,0,0,1,2.34,1.19,6.35,6.35,0,0,1,.92,3.72A10.84,10.84,0,0,1,60,48.1Z"/><path class="cls-1" d="M47.8,36.31a3.55,3.55,0,0,0-2.6,1,3.78,3.78,0,0,0-1,2.78,3.15,3.15,0,0,0,1.13,2.58,3.87,3.87,0,0,0,2.48.88,6.81,6.81,0,0,1-1,3.46,11.1,11.1,0,0,1-3.22,3l-.39.26L45,53.39l.42-.24a13.88,13.88,0,0,0,4.9-4.53A11.81,11.81,0,0,0,52,42.21a7.27,7.27,0,0,0-1.1-4.3A3.68,3.68,0,0,0,47.8,36.31ZM49.5,48.1a12.68,12.68,0,0,1-4.15,4l-.87-1.45a11.62,11.62,0,0,0,3.11-3A8.14,8.14,0,0,0,48.77,43v-.68l-.65.22a1,1,0,0,1-.32,0,2.88,2.88,0,0,1-1.89-.66,2.19,2.19,0,0,1-.77-1.82A2.8,2.8,0,0,1,45.89,38a2.57,2.57,0,0,1,1.91-.75,2.72,2.72,0,0,1,2.34,1.19,6.35,6.35,0,0,1,.92,3.72A10.85,10.85,0,0,1,49.5,48.1Z"/></g></svg>
|
assets/czr/sek/icons/modules/Nimble_rich-text-editor_icon.svg
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 80"><defs><style>.cls-1{fill:#404a4c;}</style></defs><title>Nimble_rich-text-editor_icons</title><g id="Calque_21" data-name="Calque 21"><path class="cls-1" d="M56.77,22H42.68a.49.49,0,1,1,0-1H56.77a.49.49,0,1,1,0,1Z"/><path class="cls-1" d="M56.77,26.49H42.68a.49.49,0,1,1,0-1H56.77a.49.49,0,1,1,0,1Z"/><path class="cls-1" d="M56.77,30.94H42.68a.49.49,0,1,1,0-1H56.77a.49.49,0,1,1,0,1Z"/><path class="cls-1" d="M56.77,35.39H40.29a.49.49,0,0,1,0-1H56.77a.49.49,0,1,1,0,1Z"/><path class="cls-1" d="M37.64,17.72l.21,4.45h-.53a5.41,5.41,0,0,0-.42-1.68,2.82,2.82,0,0,0-1.16-1.2,4,4,0,0,0-1.9-.39H31.17V33.42a3.88,3.88,0,0,0,.38,2.19,2.1,2.1,0,0,0,1.64.59h.66v.52H25.79V36.2h.67a1.93,1.93,0,0,0,1.71-.73,4.26,4.26,0,0,0,.31-2V18.91H26.2a6.37,6.37,0,0,0-1.89.2,2.59,2.59,0,0,0-1.25,1,4.13,4.13,0,0,0-.62,2h-.53l.22-4.45H37.64m0-1H22.13a1,1,0,0,0-1,.95l-.22,4.45a1,1,0,0,0,1,1.05h.53a1,1,0,0,0,1-.92,3.2,3.2,0,0,1,.44-1.55,1.61,1.61,0,0,1,.77-.65,5.42,5.42,0,0,1,1.55-.14h1.28V33.42a4.2,4.2,0,0,1-.15,1.5s-.19.27-.87.27h-.67a1,1,0,0,0-1,1v.52a1,1,0,0,0,1,1h8.05a1,1,0,0,0,1-1V36.2a1,1,0,0,0-1-1h-.66a1.37,1.37,0,0,1-.86-.22,4.71,4.71,0,0,1-.15-1.55V19.91h1.68a3.1,3.1,0,0,1,1.43.27A1.83,1.83,0,0,1,36,21a4.44,4.44,0,0,1,.31,1.34,1,1,0,0,0,1,.87h.53a1,1,0,0,0,1-1l-.21-4.45a1,1,0,0,0-1-1Z"/><path class="cls-1" d="M41.58,47.74a2.71,2.71,0,1,0,2.71,2.71A2.72,2.72,0,0,0,41.58,47.74Zm0,4.43a1.71,1.71,0,1,1,1.71-1.71A1.72,1.72,0,0,1,41.58,52.16Z"/><path class="cls-1" d="M27.4,48.77l-4.67-2.69a.5.5,0,0,0-.75.43v5.39a.5.5,0,0,0,.75.43l4.67-2.69a.5.5,0,0,0,0-.87ZM23,51V47.37l3.17,1.83Z"/><path class="cls-1" d="M62.14,43.22,50.28,41.45A2,2,0,0,0,48,43.14l-.41,2.78H31.44a8,8,0,1,0-2.33,9.55v6.76a1.05,1.05,0,0,0,1.05,1.05H49.06a1.05,1.05,0,0,0,1.05-1.05V57.6L59.79,59l.3,0a2,2,0,0,0,2-1.71l1.76-11.87A2,2,0,0,0,62.14,43.22Zm-38,13a7,7,0,1,1,7-7A7,7,0,0,1,24.15,56.2Zm6,6V59.1l3.8-4.69,3.92,4.84a.5.5,0,0,0,.37.19.53.53,0,0,0,.38-.15L41,56.73l4.74,5.53Zm19,0a.06.06,0,0,1-.05.05h-2l-5.66-6.61a.5.5,0,0,0-.37-.17.54.54,0,0,0-.37.15l-2.44,2.54-4-4.87a.5.5,0,0,0-.78,0l-3.4,4.2v-3a7.94,7.94,0,0,0,1.68-7.57l15.62,0-1.2,8a2,2,0,0,0,1.68,2.27l1.19.18Zm12-5a1,1,0,0,1-1.14.84L48.07,56.29a1,1,0,0,1-.84-1.14L49,43.29a1,1,0,0,1,1-.85h.15L62,44.21a1,1,0,0,1,.84,1.14Z"/><path class="cls-1" d="M58.84,47.93a.5.5,0,0,0-.83.56l1.82,2.66L57.18,53a.5.5,0,0,0,.56.83l3.07-2.1a.5.5,0,0,0,.13-.7Z"/><path class="cls-1" d="M50.23,49.35l2.66-1.82a.5.5,0,1,0-.56-.83l-3.07,2.1a.5.5,0,0,0-.13.7l2.1,3.07A.5.5,0,1,0,52,52Z"/><path class="cls-1" d="M57.58,46a.5.5,0,0,0-.68.17l-4.59,7.73a.5.5,0,1,0,.86.51l4.59-7.73A.5.5,0,0,0,57.58,46Z"/></g></svg>
|
assets/czr/sek/icons/modules/Nimble_slideshow_icon.svg
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 80"><defs><style>.cls-1{fill:#404a4c;}</style></defs><title>Nimble_Final_icons</title><g id="slideshow_icon"><path class="cls-1" d="M48,31.09a3.39,3.39,0,1,0,3.39,3.39A3.39,3.39,0,0,0,48,31.09ZM48,37a2.5,2.5,0,1,1,2.5-2.5A2.5,2.5,0,0,1,48,37Z"/><path class="cls-1" d="M62.37,39.69l-2.22-2.22a.44.44,0,1,0-.63.63l1.9,1.9-1.9,1.9a.44.44,0,0,0,.63.63l2.22-2.22A.44.44,0,0,0,62.37,39.69Z"/><path class="cls-1" d="M20.47,37.47a.44.44,0,0,0-.63,0l-2.22,2.22a.44.44,0,0,0,0,.63l2.22,2.22a.44.44,0,0,0,.63-.63L18.57,40l1.9-1.9A.44.44,0,0,0,20.47,37.47Z"/><path class="cls-1" d="M56.34,30.49H53.85v-.63a1.18,1.18,0,0,0-1.18-1.18H27.54a1.18,1.18,0,0,0-1.18,1.18v.63H23.87a1.06,1.06,0,0,0-1.06,1.06V48.45a1.06,1.06,0,0,0,1.06,1.06h2.49v.63a1.18,1.18,0,0,0,1.18,1.18H52.67a1.18,1.18,0,0,0,1.18-1.18v-.63h2.49a1.06,1.06,0,0,0,1.06-1.06V31.55A1.06,1.06,0,0,0,56.34,30.49ZM23.87,48.62a.17.17,0,0,1-.17-.17V31.55a.17.17,0,0,1,.17-.17h2.49V48.62Zm3.38,1.52V45.93l5.29-6.52L37.92,46a.44.44,0,0,0,.33.16.46.46,0,0,0,.34-.14L42,42.51l6.79,7.92H27.54A.3.3,0,0,1,27.25,50.14Zm25.71,0a.3.3,0,0,1-.29.29H50l-7.6-8.87a.44.44,0,0,0-.32-.16.51.51,0,0,0-.33.14L38.29,45.1l-5.42-6.68a.46.46,0,0,0-.69,0l-4.94,6.1V29.86a.3.3,0,0,1,.29-.29H52.67a.3.3,0,0,1,.29.29V50.14Zm3.55-1.69a.17.17,0,0,1-.17.17H53.85V31.38h2.49a.17.17,0,0,1,.17.17Z"/></g></svg>
|
assets/czr/sek/icons/modules/Nimble_social_icon.svg
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 80"><defs><style>.cls-1{fill:#404a4c;}</style></defs><title>Nimble_Final_icons</title><g id="social_icon"><path class="cls-1" d="M31.84,48.39,32,45.47l-2.23-.15a2.68,2.68,0,0,0-3,2.67l0,.78-1.11-.07-.19,3,1.11.07-.35,5.61,3.33.21L29.86,52l1.53.1.49-3L30,49l0-.71ZM30.71,50l-.16,1-1.62-.1-.35,5.61-1.34-.08.35-5.61-1.11-.07.06-1,1.11.07.11-1.78a1.71,1.71,0,0,1,2-1.74L31,46.4l-.06.93-.76,0a1,1,0,0,0-1.06,1L29,49.92Z"/><path class="cls-1" d="M22.11,27.46a.53.53,0,0,0-.21.47,2.88,2.88,0,0,0,1.09,2,.5.5,0,0,0,0,.43,2.87,2.87,0,0,0,1.56,1.55,4.29,4.29,0,0,1-1.64.48,4.06,4.06,0,0,1-.51,0,.52.52,0,0,0-.5.37.5.5,0,0,0,.25.57,7.22,7.22,0,0,0,3.37.83l.63,0a7,7,0,0,0,5.17-2.82,7.49,7.49,0,0,0,1.44-5v-.06a5.26,5.26,0,0,0,1-1.28.5.5,0,0,0-.43-.74,3,3,0,0,0,.08-.3.5.5,0,0,0-.78-.52,4.26,4.26,0,0,1-1.06.55,2.91,2.91,0,0,0-1.94-.54A2.88,2.88,0,0,0,27,26.51a6.27,6.27,0,0,1-4.12-1.89.5.5,0,0,0-.81.13,2.88,2.88,0,0,0,.12,2.68Zm5.49.05a.5.5,0,0,0,.46-.66,1.88,1.88,0,0,1,3-2,.5.5,0,0,0,.4.12.5.5,0,0,0,.35.69.5.5,0,0,0-.14.41c0,.09,0,.19,0,.28a6.48,6.48,0,0,1-1.25,4.35A6,6,0,0,1,26,33.16a6.27,6.27,0,0,1-1.67-.08A5.23,5.23,0,0,0,26.12,32a.5.5,0,0,0,.12-.56.48.48,0,0,0-.49-.3,1.87,1.87,0,0,1-1.42-.51l.34-.1a.5.5,0,0,0-.12-1,1.88,1.88,0,0,1-1.45-1,2.87,2.87,0,0,0,.42,0,.5.5,0,0,0,.21-.94,1.87,1.87,0,0,1-1-1.73A7.27,7.27,0,0,0,27.6,27.52Z"/><path class="cls-1" d="M20.56,38.94h.2L36.5,37.57A2.33,2.33,0,0,0,38.63,35L37.39,20.77a2.33,2.33,0,0,0-2.52-2.12L19.13,20A2.33,2.33,0,0,0,17,22.53l1.23,14.28A2.33,2.33,0,0,0,20.56,38.94ZM19.22,21,35,19.64h.11a1.34,1.34,0,0,1,1.33,1.22l1.23,14.28a1.33,1.33,0,0,1-1.21,1.44L20.68,37.93a1.35,1.35,0,0,1-1.44-1.21L18,22.44A1.33,1.33,0,0,1,19.22,21Z"/><path class="cls-1" d="M37,42.4l-15.77-1a2.34,2.34,0,0,0-2.47,2.18l-.9,14.3a2.34,2.34,0,0,0,2.18,2.47l15.77,1H36a2.33,2.33,0,0,0,2.33-2.18l.9-14.3A2.34,2.34,0,0,0,37,42.4Zm.28,16.71a1.32,1.32,0,0,1-1.41,1.24l-15.77-1A1.33,1.33,0,0,1,18.9,58l.9-14.3a1.32,1.32,0,0,1,.45-.91,1.27,1.27,0,0,1,1-.33L37,43.4a1.33,1.33,0,0,1,1.24,1.41Z"/><path class="cls-1" d="M62.47,30.54a2.32,2.32,0,0,0-1.57-.84L45.16,28.2a2.34,2.34,0,0,0-2.54,2.1L41.26,44.57a2.34,2.34,0,0,0,2.1,2.54l15.73,1.5h.22a2.34,2.34,0,0,0,2.32-2.11L63,32.25A2.32,2.32,0,0,0,62.47,30.54ZM60.63,46.42a1.32,1.32,0,0,1-.48.9,1.34,1.34,0,0,1-1,.3l-15.73-1.5a1.33,1.33,0,0,1-1.2-1.45L43.62,30.4a1.33,1.33,0,0,1,1.45-1.2L60.8,30.7A1.33,1.33,0,0,1,62,32.15Z"/><path class="cls-1" d="M54.83,32.86l-4.32-.41a3.61,3.61,0,0,0-3.94,3.25L46.16,40A3.61,3.61,0,0,0,49.41,44l4.32.41a3.61,3.61,0,0,0,3.94-3.25l.41-4.32A3.61,3.61,0,0,0,54.83,32.86ZM56.59,41a2.53,2.53,0,0,1-2.76,2.28l-4.32-.41a2.53,2.53,0,0,1-2.28-2.76l.41-4.32a2.53,2.53,0,0,1,2.76-2.28l4.32.41A2.53,2.53,0,0,1,57,36.7Z"/><path class="cls-1" d="M52.4,35.53A2.89,2.89,0,1,0,55,38.68,2.89,2.89,0,0,0,52.4,35.53ZM52,40.21a1.81,1.81,0,1,1,2-1.63A1.81,1.81,0,0,1,52,40.21Z"/><circle class="cls-1" cx="55.51" cy="35.61" r="0.39" transform="translate(14.78 87.48) rotate(-84.54)"/></g></svg>
|
assets/czr/sek/icons/modules/Nimble_testimonial_icon.svg
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 80"><defs><style>.cls-1{fill:#404a4c;}</style></defs><title>Nimble_Final_icons</title><g id="testimonial_icon"><path class="cls-1" d="M26.77,40.28c3.25,0,5.19-2.62,5.19-7,0-3.22-2.23-5.65-5.19-5.65s-5.19,2.43-5.19,5.65C21.59,37.73,23.48,40.28,26.77,40.28Zm0-11.68A4.36,4.36,0,0,1,31,33.28c0,3.83-1.53,6-4.21,6s-4.21-2.14-4.21-6A4.36,4.36,0,0,1,26.77,28.61Z"/><path class="cls-1" d="M33.2,42.39a37.09,37.09,0,0,1-3.54-1.86.49.49,0,0,0-.49.85,38.06,38.06,0,0,0,3.75,1.95s2.26.73,2.22,5.62c0,0-.71,2.29-7.84,2.67h-1C19.19,51.23,18.48,49,18.48,49c0-4.9,2.2-5.62,2.22-5.63a38,38,0,0,0,3.75-1.95.49.49,0,0,0-.49-.85,37,37,0,0,1-3.54,1.86c-.3.09-3,1-2.91,6.51A1.65,1.65,0,0,0,18,50c.86,1,3,2.31,8.34,2.6h1c5.31-.29,7.45-1.57,8.31-2.6a1.68,1.68,0,0,0,.48-1C36.16,43.43,33.5,42.48,33.2,42.39Z"/><path class="cls-1" d="M48.84,34.15H42.39a.29.29,0,0,0,0,.57h6.45a.29.29,0,0,0,0-.57Z"/><path class="cls-1" d="M48.84,36.48H42.39a.29.29,0,0,0,0,.57h6.45a.29.29,0,0,0,0-.57Z"/><path class="cls-1" d="M45.71,38.8H42.39a.29.29,0,0,0,0,.57h3.32a.29.29,0,0,0,0-.57Z"/><path class="cls-1" d="M48.84,31.81H42.39a.29.29,0,0,0,0,.57h6.45a.29.29,0,0,0,0-.57Z"/><path class="cls-1" d="M58.52,31.81H52.07a.29.29,0,0,0,0,.57h6.45a.29.29,0,1,0,0-.57Z"/><path class="cls-1" d="M58.52,34.15H52.07a.29.29,0,0,0,0,.57h6.45a.29.29,0,1,0,0-.57Z"/><path class="cls-1" d="M58.52,36.48H52.07a.29.29,0,0,0,0,.57h6.45a.29.29,0,1,0,0-.57Z"/><path class="cls-1" d="M55.39,38.8H52.07a.29.29,0,0,0,0,.57h3.32a.29.29,0,0,0,0-.57Z"/><path class="cls-1" d="M60.17,27.4H40.75a2.34,2.34,0,0,0-2.33,2.33V41.45a2.34,2.34,0,0,0,2.33,2.33H60.17a2.34,2.34,0,0,0,2.33-2.33V29.74A2.34,2.34,0,0,0,60.17,27.4Zm1.36,14a1.36,1.36,0,0,1-1.36,1.36H40.75a1.36,1.36,0,0,1-1.36-1.36V29.74a1.36,1.36,0,0,1,1.36-1.36H60.17a1.36,1.36,0,0,1,1.36,1.36Z"/></g></svg>
|
assets/czr/sek/icons/modules/Nimble_video_icon.svg
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 80"><defs><style>.cls-1{fill:#404a4c;}</style></defs><title>Nimble_Final_icons</title><g id="video_icon"><path class="cls-1" d="M47,39.57,36.47,33.46a.5.5,0,0,0-.75.43V46.11a.5.5,0,0,0,.75.43L47,40.43a.5.5,0,0,0,0-.87ZM36.72,45.24V34.76L45.8,40Z"/><path class="cls-1" d="M40,22.5A17.5,17.5,0,1,0,57.5,40,17.52,17.52,0,0,0,40,22.5Zm0,34A16.5,16.5,0,1,1,56.5,40,16.52,16.52,0,0,1,40,56.5Z"/></g></svg>
|
assets/czr/sek/js/ccat-sek-control.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
|
2 |
var CZRSeksPrototype = CZRSeksPrototype || {};
|
3 |
(function ( api, $ ) {
|
4 |
$.extend( CZRSeksPrototype, {
|
@@ -8,91 +8,40 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
8 |
if ( _.isUndefined( window.sektionsLocalizedData ) ) {
|
9 |
throw new Error( 'CZRSeksPrototype => missing localized server params sektionsLocalizedData' );
|
10 |
}
|
11 |
-
// this class is skope dependant
|
12 |
if ( ! _.isFunction( api.czr_activeSkopes ) ) {
|
13 |
throw new Error( 'CZRSeksPrototype => api.czr_activeSkopes' );
|
14 |
}
|
15 |
-
// Max possible number of columns in a section
|
16 |
self.MAX_NUMBER_OF_COLUMNS = 12;
|
17 |
-
|
18 |
-
// _.debounce param when updating the UI setting
|
19 |
-
// prevent hammering server
|
20 |
self.SETTING_UPDATE_BUFFER = 50;
|
21 |
-
|
22 |
-
// Define a default value for the sektion setting value, used when no server value has been sent
|
23 |
-
// @see php function
|
24 |
-
// function sek_get_default_sektions_value() {
|
25 |
-
// $defaut_sektions_value = [ 'collection' => [], 'options' => [] ];
|
26 |
-
// foreach( sek_get_locations() as $location ) {
|
27 |
-
// $defaut_sektions_value['collection'][] = [
|
28 |
-
// 'id' => $location,
|
29 |
-
// 'level' => 'location',
|
30 |
-
// 'collection' => [],
|
31 |
-
// 'options' => []
|
32 |
-
// ];
|
33 |
-
// }
|
34 |
-
// return $defaut_sektions_value;
|
35 |
-
// }
|
36 |
self.defaultSektionSettingValue = sektionsLocalizedData.defaultSektionSettingValue;
|
37 |
-
|
38 |
-
// Store the contextual setting prefix
|
39 |
self.sekCollectionSettingId = new api.Value( {} );
|
40 |
-
|
41 |
-
// Keep track of the registered ui elements dynamically registered
|
42 |
-
// this collection is populated in ::register(), if the track param is true
|
43 |
-
// this is used to know what ui elements are currently being displayed
|
44 |
self.registered = new api.Value([]);
|
45 |
|
46 |
api.bind( 'ready', function() {
|
47 |
-
// the main sektion panel
|
48 |
self.registerAndSetupDefaultPanelSectionOptions();
|
49 |
-
|
50 |
-
// Setup the collection setting => register the main setting and bind it
|
51 |
-
// schedule reaction to collection setting ids => the setup of the collection setting when the collection setting ids are set
|
52 |
-
//=> on skope change
|
53 |
-
//@see setContextualCollectionSettingIdWhenSkopeSet
|
54 |
self.sekCollectionSettingId.callbacks.add( function( collectionSettingIds, previousCollectionSettingIds ) {
|
55 |
-
// register the collection setting id
|
56 |
-
// and schedule the reaction to different collection changes : refreshModules, ...
|
57 |
try { self.setupSettingToBeSaved(); } catch( er ) {
|
58 |
api.errare( 'Error in self.sekCollectionSettingId.callbacks => self.setupSettingsToBeSaved()' , er );
|
59 |
}
|
60 |
});
|
61 |
-
|
62 |
-
|
|
|
|
|
|
|
63 |
if ( ! _.isEmpty( api.czr_activeSkopes().local ) ) {
|
64 |
-
|
65 |
}
|
66 |
-
|
67 |
-
// Set the contextual setting prefix
|
68 |
api.czr_activeSkopes.callbacks.add( function( newSkopes, previousSkopes ) {
|
69 |
-
|
70 |
});
|
71 |
-
|
72 |
-
// Communicate with the preview
|
73 |
self.reactToPreviewMsg();
|
74 |
-
|
75 |
-
// Setup Dnd
|
76 |
self.setupDnd();
|
77 |
-
|
78 |
-
|
79 |
-
// setup the tinyMce editor used for the tiny_mce_editor input
|
80 |
-
// => one object listened to by each tiny_mce_editor input
|
81 |
self.setupTinyMceEditor();
|
82 |
-
|
83 |
-
// print json
|
84 |
self.schedulePrintSectionJson();
|
85 |
-
|
86 |
-
// Always set the previewed device back to desktop on ui change
|
87 |
-
// event 'sek-ui-removed' id triggered when cleaning the registered ui controls
|
88 |
-
// @see ::cleanRegistered()
|
89 |
self.bind( 'sek-ui-removed', function() {
|
90 |
api.previewedDevice( 'desktop' );
|
91 |
});
|
92 |
-
|
93 |
-
// Synchronize api.previewedDevice with the currently rendered ui
|
94 |
-
// ensure that the selected device tab of the spacing module is the one being previewed
|
95 |
-
// =>@see spacing module, in item constructor CZRSpacingItemMths
|
96 |
api.previewedDevice.bind( function( device ) {
|
97 |
var currentControls = _.filter( self.registered(), function( uiData ) {
|
98 |
return 'control' == uiData.what;
|
@@ -105,18 +54,10 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
105 |
});
|
106 |
});
|
107 |
});
|
108 |
-
|
109 |
-
// Schedule a reset
|
110 |
$('#customize-notifications-area').on( 'click', '[data-sek-reset="true"]', function() {
|
111 |
self.resetCollectionSetting();
|
112 |
});
|
113 |
-
|
114 |
-
|
115 |
-
// CLEAN UI BEFORE REMOVAL
|
116 |
-
// 'sek-ui-pre-removal' is triggered in ::cleanRegistered
|
117 |
-
// @params { what : control, id : '' }
|
118 |
self.bind( 'sek-ui-pre-removal', function( params ) {
|
119 |
-
// CLEAN DRAG N DROP
|
120 |
if ( 'control' == params.what && -1 < params.id.indexOf( 'draggable') ) {
|
121 |
api.control( params.id, function( _ctrl_ ) {
|
122 |
_ctrl_.container.find( '[draggable]' ).each( function() {
|
@@ -124,9 +65,6 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
124 |
});
|
125 |
});
|
126 |
}
|
127 |
-
|
128 |
-
// CLEAN SELECT2
|
129 |
-
// => we need to destroy the select2 instance, otherwise it can stay open when switching to another ui.
|
130 |
if ( 'control' == params.what ) {
|
131 |
api.control( params.id, function( _ctrl_ ) {
|
132 |
_ctrl_.container.find( 'select' ).each( function() {
|
@@ -137,107 +75,129 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
137 |
});
|
138 |
}
|
139 |
});
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
151 |
});//api.bind( 'ready' )
|
152 |
-
},// initialize()
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
// MAYBE REGISTER THE ADD NEW PANEL
|
162 |
-
// Fired in initialize()
|
163 |
registerAndSetupDefaultPanelSectionOptions : function() {
|
164 |
var self = this;
|
165 |
-
|
166 |
-
// MAIN SEKTION PANEL
|
167 |
var SektionPanelConstructor = api.Panel.extend({
|
168 |
-
//attachEvents : function () {},
|
169 |
-
// Always make the panel active, event if we have no sections / control in it
|
170 |
isContextuallyActive : function () {
|
171 |
return this.active();
|
172 |
},
|
173 |
_toggleActive : function(){ return true; }
|
174 |
});
|
175 |
-
|
176 |
-
// Always display the module-picker when expanding the main panel
|
177 |
-
// the panel.expanded() Value is not the right candidate to be observed because it gets changed on too many events, when generating the various UI.
|
178 |
api.panel( sektionsLocalizedData.sektionsPanelId, function( _mainPanel_ ) {
|
179 |
_mainPanel_.deferred.embedded.done( function() {
|
180 |
var $sidePanelTitleEl = _mainPanel_.container.find('h3.accordion-section-title'),
|
181 |
$topPanelTitleEl = _mainPanel_.container.find('.panel-meta .accordion-section-title'),
|
182 |
logoHtml = [ '<img class="sek-nimble-logo" alt="'+ _mainPanel_.params.title +'" src="', sektionsLocalizedData.baseUrl, '/assets/img/nimble/nimble_horizontal.svg', '"/>' ].join('');
|
183 |
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
if ( 0 < $sidePanelTitleEl.length ) {
|
188 |
-
// Attach click event
|
189 |
-
$sidePanelTitleEl.on( 'click', function( evt ) {
|
190 |
-
api.previewer.trigger('sek-pick-module');
|
191 |
-
});
|
192 |
-
// The default title looks like this : Nimble Builder <span class="screen-reader-text">Press return or enter to open this section</span>
|
193 |
-
// we want to style "Nimble Builder" only.
|
194 |
var $sidePanelTitleElSpan = $sidePanelTitleEl.find('span');
|
195 |
$sidePanelTitleEl
|
196 |
.addClass('sek-side-nimble-logo-wrapper')
|
197 |
.html( logoHtml )
|
198 |
.append( $sidePanelTitleElSpan );
|
199 |
}
|
200 |
-
|
201 |
-
// default looks like
|
202 |
-
// <span class="preview-notice">You are customizing <strong class="panel-title">Nimble Builder</strong></span>
|
203 |
-
// if ( 0 < $topPanelTitleEl.length ) {
|
204 |
-
// var $topPanelTitleElInner = $topPanelTitleEl.find('.panel-title');
|
205 |
-
// $topPanelTitleElInner.html( logoHtml );
|
206 |
-
// }
|
207 |
});
|
208 |
});
|
209 |
-
|
210 |
-
|
211 |
-
this.register({
|
212 |
what : 'panel',
|
213 |
id : sektionsLocalizedData.sektionsPanelId,//'__sektions__'
|
214 |
title: sektionsLocalizedData.i18n['Nimble Builder'],
|
215 |
-
priority : 1000,
|
216 |
constructWith : SektionPanelConstructor,
|
217 |
-
track : false
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
218 |
});
|
219 |
-
|
220 |
},//mayBeRegisterAndSetupAddNewSektionSection()
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
//@return void()
|
226 |
-
// sektionsData is built server side :
|
227 |
-
//array(
|
228 |
-
// 'db_values' => sek_get_skoped_seks( $skope_id ),
|
229 |
-
// 'setting_id' => sek_get_seks_setting_id( $skope_id )//nimble___[skp__post_page_home]
|
230 |
-
// )
|
231 |
setContextualCollectionSettingIdWhenSkopeSet : function( newSkopes, previousSkopes ) {
|
232 |
var self = this;
|
233 |
-
|
234 |
-
// Clear all previous sektions if the main panel is expanded and we're coming from a previousSkopes
|
235 |
if ( ! _.isEmpty( previousSkopes.local ) && api.panel( sektionsLocalizedData.sektionsPanelId ).expanded() ) {
|
236 |
-
|
237 |
-
api.previewer.trigger('sek-pick-module');
|
238 |
}
|
239 |
-
|
240 |
-
// set the sekCollectionSettingId now, and update it on skope change
|
241 |
sektionsData = api.czr_skopeBase.getSkopeProperty( 'sektions', 'local');
|
242 |
if ( sektionsLocalizedData.isDevMode ) {
|
243 |
api.infoLog( '::setContextualCollectionSettingIdWhenSkopeSet => SEKTIONS DATA ? ', sektionsData );
|
@@ -252,85 +212,264 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
252 |
}
|
253 |
});//$.extend()
|
254 |
})( wp.customize, jQuery );
|
255 |
-
//global sektionsLocalizedData
|
256 |
var CZRSeksPrototype = CZRSeksPrototype || {};
|
257 |
(function ( api, $ ) {
|
258 |
$.extend( CZRSeksPrototype, {
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
264 |
setupSettingToBeSaved : function() {
|
265 |
var self = this,
|
266 |
serverCollection;
|
267 |
|
268 |
serverCollection = api.czr_skopeBase.getSkopeProperty( 'sektions', 'local').db_values;
|
269 |
-
// maybe register the sektion_collection setting
|
270 |
var collectionSettingId = self.sekCollectionSettingId();// [ 'nimble___' , '[', newSkopes.local, ']' ].join('');
|
271 |
if ( _.isEmpty( collectionSettingId ) ) {
|
272 |
throw new Error( 'setupSettingsToBeSaved => the collectionSettingId is invalid' );
|
273 |
}
|
274 |
-
|
275 |
-
// if the collection setting is not registered yet
|
276 |
-
// => register it and bind it
|
277 |
if ( ! api.has( collectionSettingId ) ) {
|
278 |
-
var __collectionSettingInstance__ =
|
279 |
what : 'setting',
|
280 |
id : collectionSettingId,
|
281 |
value : self.validateSettingValue( _.isObject( serverCollection ) ? serverCollection : self.defaultSektionSettingValue ),
|
282 |
transport : 'postMessage',//'refresh'
|
283 |
type : 'option',
|
284 |
-
track : false
|
|
|
285 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
286 |
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
// Global Options : section
|
308 |
-
// this.register({
|
309 |
-
// what : 'section',
|
310 |
-
// id : sektionsLocalizedData.optPrefixForSektionGlobalOptsSetting,//'__sektions__'
|
311 |
-
// title: 'Global Options',
|
312 |
-
// priority : 1000,
|
313 |
-
// constructWith : SektionPanelConstructor,
|
314 |
-
// track : false//don't register in the self.registered()
|
315 |
-
// });
|
316 |
-
|
317 |
-
// // => register a control
|
318 |
-
// // Template
|
319 |
-
// this.register({
|
320 |
-
// what : 'control',
|
321 |
-
// id : sektionsLocalizedData.sektionsPanelId,//'__sektions__'
|
322 |
-
// title: 'Main sektions panel',
|
323 |
-
// priority : 1000,
|
324 |
-
// constructWith : SektionPanelConstructor,
|
325 |
-
// track : false//don't register in the self.registered()
|
326 |
-
// });
|
327 |
},
|
328 |
-
|
329 |
-
|
330 |
-
// Fired :
|
331 |
-
// 1) when instantiating the setting
|
332 |
-
// 2) on each setting change, as an override of api.Value::validate( to ) @see customize-base.js
|
333 |
-
// @return {} or null if did not pass the checks
|
334 |
validateSettingValue : function( valCandidate ) {
|
335 |
if ( ! _.isObject( valCandidate ) ) {
|
336 |
api.errare('validation error => the setting should be an object', valCandidate );
|
@@ -339,7 +478,6 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
339 |
var parentLevel = {},
|
340 |
errorDetected = false,
|
341 |
levelIds = [];
|
342 |
-
// walk the collections tree and verify it passes the various consistency checks
|
343 |
var _errorDetected_ = function( msg ) {
|
344 |
api.errare( msg , valCandidate );
|
345 |
api.previewer.trigger('sek-notify', {
|
@@ -365,12 +503,8 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
365 |
return;
|
366 |
}
|
367 |
if ( _.isUndefined( level ) && _.isEmpty( parentLevel ) ) {
|
368 |
-
// we are at the root level
|
369 |
level = $.extend( true, {}, valCandidate );
|
370 |
if ( _.isUndefined( level.id ) || _.isUndefined( level.level ) ) {
|
371 |
-
// - there should be no 'level' property or 'id'
|
372 |
-
// - there should be a collection of registered locations
|
373 |
-
// - there should be no parent level defined
|
374 |
if ( _.isUndefined( level.collection ) ) {
|
375 |
_errorDetected_( 'validation error => the root level is missing the collection of locations' );
|
376 |
return;
|
@@ -379,20 +513,12 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
379 |
_errorDetected_( 'validation error => the root level should not have a "level" or an "id" property' );
|
380 |
return;
|
381 |
}
|
382 |
-
|
383 |
-
// Walk the section collection
|
384 |
_.each( valCandidate.collection, function( _l_ ) {
|
385 |
-
// Set the parent level now
|
386 |
parentLevel = level;
|
387 |
-
// walk
|
388 |
_checkWalker_( _l_ );
|
389 |
});
|
390 |
}
|
391 |
} else {
|
392 |
-
// we have a level.
|
393 |
-
// - make sure we have at least the following properties : id, level
|
394 |
-
|
395 |
-
// ID
|
396 |
if ( _.isEmpty( level.id ) || ! _.isString( level.id )) {
|
397 |
_errorDetected_('validation error => a ' + level.level + ' level must have a valid id' );
|
398 |
return;
|
@@ -402,14 +528,6 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
402 |
} else {
|
403 |
levelIds.push( level.id );
|
404 |
}
|
405 |
-
|
406 |
-
// OPTIONS
|
407 |
-
// if ( _.isEmpty( level.options ) || ! _.isObject( level.options )) {
|
408 |
-
// _errorDetected_('validation error => a ' + level.level + ' level must have a valid options property' );
|
409 |
-
// return;
|
410 |
-
// }
|
411 |
-
|
412 |
-
// LEVEL
|
413 |
if ( _.isEmpty( level.level ) || ! _.isString( level.level ) ) {
|
414 |
_errorDetected_('validation error => a ' + level.level + ' level must have a level property' );
|
415 |
return;
|
@@ -417,9 +535,6 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
417 |
_errorDetected_('validation error => the level "' + level.level + '" is not authorized' );
|
418 |
return;
|
419 |
}
|
420 |
-
|
421 |
-
// - Unless we are in a module, there should be a collection property
|
422 |
-
// - make sure a module doesn't have a collection property
|
423 |
if ( 'module' == level.level ) {
|
424 |
if ( ! _.isUndefined( level.collection ) ) {
|
425 |
_errorDetected_('validation error => a module can not have a collection property' );
|
@@ -431,10 +546,12 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
431 |
return;
|
432 |
}
|
433 |
}
|
434 |
-
|
|
|
|
|
|
|
435 |
switch ( level.level ) {
|
436 |
case 'location' :
|
437 |
-
//console.log('parentLevel ? ', level, parentLevel);
|
438 |
if ( ! _.isEmpty( parentLevel.level ) ) {
|
439 |
_errorDetected_('validation error => the parent of location ' + level.id +' should have no level set' );
|
440 |
return;
|
@@ -466,65 +583,31 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
466 |
}
|
467 |
break;
|
468 |
}
|
469 |
-
|
470 |
-
// If we are not in a module, keep walking the collections
|
471 |
if ( 'module' != level.level ) {
|
472 |
_.each( level.collection, function( _l_ ) {
|
473 |
-
// Set the parent level now
|
474 |
parentLevel = $.extend( true, {}, level );
|
475 |
-
// And walk sub levels
|
476 |
_checkWalker_( _l_ );
|
477 |
});
|
478 |
}
|
479 |
}
|
480 |
};
|
481 |
_checkWalker_();
|
482 |
-
|
483 |
-
//api.infoLog('in ::validateSettingValue', valCandidate );
|
484 |
-
// if null is returned, the setting value is not set @see customize-base.js
|
485 |
return errorDetected ? null : valCandidate;
|
486 |
},//validateSettingValue
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
// triggered when clicking on [data-sek-reset="true"]
|
491 |
-
// scheduled in ::initialize()
|
492 |
-
// Note :
|
493 |
-
// 1) this is not a real reset, the customizer setting is set to self.defaultSektionSettingValue
|
494 |
-
// @see php function which defines the defaults
|
495 |
-
// function sek_get_default_sektions_value() {
|
496 |
-
// $defaut_sektions_value = [ 'collection' => [], 'options' => [] ];
|
497 |
-
// foreach( sek_get_locations() as $location ) {
|
498 |
-
// $defaut_sektions_value['collection'][] = [
|
499 |
-
// 'id' => $location,
|
500 |
-
// 'level' => 'location',
|
501 |
-
// 'collection' => [],
|
502 |
-
// 'options' => []
|
503 |
-
// ];
|
504 |
-
// }
|
505 |
-
// return $defaut_sektions_value;
|
506 |
-
// }
|
507 |
-
// 2) a real reset should delete the sektion post ( nimble_post_type, with for example title nimble___skp__post_page_21 ) and its database option storing its id ( for example : nimble___skp__post_page_21 )
|
508 |
resetCollectionSetting : function() {
|
509 |
var self = this;
|
510 |
if ( _.isEmpty( self.sekCollectionSettingId() ) ) {
|
511 |
throw new Error( 'setupSettingsToBeSaved => the collectionSettingId is invalid' );
|
512 |
}
|
513 |
-
// reset the setting to default
|
514 |
api( self.sekCollectionSettingId() )( self.defaultSektionSettingValue );
|
515 |
-
// refresh the preview
|
516 |
api.previewer.refresh();
|
517 |
-
// remove any previous notification
|
518 |
api.notifications.remove( 'sek-notify' );
|
519 |
-
// display a success msg
|
520 |
api.panel( sektionsLocalizedData.sektionsPanelId, function( __main_panel__ ) {
|
521 |
api.notifications.add( new api.Notification( 'sek-reset-done', {
|
522 |
type: 'success',
|
523 |
message: sektionsLocalizedData.i18n['Reset complete'],
|
524 |
dismissible: true
|
525 |
} ) );
|
526 |
-
|
527 |
-
// Removed if not dismissed after 5 seconds
|
528 |
_.delay( function() {
|
529 |
api.notifications.remove( 'sek-reset-done' );
|
530 |
}, 5000 );
|
@@ -535,26 +618,12 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
535 |
var CZRSeksPrototype = CZRSeksPrototype || {};
|
536 |
(function ( api, $ ) {
|
537 |
$.extend( CZRSeksPrototype, {
|
538 |
-
// invoked on api('ready') from self::initialize()
|
539 |
-
// update the main setting OR generate a UI in the panel
|
540 |
-
// AND
|
541 |
-
// always send back a confirmation to the preview, so we can fire the ajax actions
|
542 |
-
// the message sent back is used in particular to
|
543 |
-
// - always pass the skope_id, which otherwise would be impossible to get in ajax
|
544 |
-
// - in a duplication case, to pass the the newly generated id of the cloned level
|
545 |
reactToPreviewMsg : function() {
|
546 |
var self = this,
|
547 |
apiParams = {},
|
548 |
uiParams = {},
|
549 |
sendToPreview = true, //<= the default behaviour is to send a message to the preview when the setting has been changed
|
550 |
msgCollection = {
|
551 |
-
// A section can be added in various scenarios :
|
552 |
-
// - when clicking on the ( + ) Insert content => @see preview::scheduleUiClickReactions() => addContentButton
|
553 |
-
// - when adding a nested section to a column
|
554 |
-
// - when dragging a module in a 'between-sections' or 'in-empty-location' drop zone
|
555 |
-
//
|
556 |
-
// Note : if the target location level already has section(s), then the section is appended in ajax, at the right place
|
557 |
-
// Note : if the target location is empty ( is_first_section is true ), nothing is send to the preview when updating the api setting, and we refresh the location level. => this makes sure that we removes the placeholder printed in the previously empty location
|
558 |
'sek-add-section' : {
|
559 |
callback : function( params ) {
|
560 |
sendToPreview = ! _.isUndefined( params.send_to_preview ) ? params.send_to_preview : true;//<= when the level is refreshed when complete, we don't need to send to preview.
|
@@ -573,15 +642,13 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
573 |
return self.updateAPISetting( apiParams );
|
574 |
},
|
575 |
complete : function( params ) {
|
576 |
-
// When a section is created ( not duplicated )
|
577 |
-
//console.log( "react to preview Msg, sek-add-section complete => ", params );
|
578 |
if ( params.apiParams.is_first_section ) {
|
579 |
api.previewer.trigger( 'sek-refresh-level', {
|
580 |
level : 'location',
|
581 |
id : params.apiParams.location
|
582 |
});
|
583 |
}
|
584 |
-
api.previewer.trigger( 'sek-pick-
|
585 |
api.previewer.send('sek-focus-on', { id : params.apiParams.id });
|
586 |
}
|
587 |
},
|
@@ -600,11 +667,8 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
600 |
return self.updateAPISetting( apiParams );
|
601 |
},
|
602 |
complete : function( params ) {
|
603 |
-
// When adding a section, a nested column is automatically added
|
604 |
-
// We want to focus on the module picker in this case, that's why the autofocus is set to false
|
605 |
-
// @see 'sek-add-section' action description
|
606 |
if ( false !== params.apiParams.autofocus ) {
|
607 |
-
api.previewer.trigger( 'sek-pick-
|
608 |
}
|
609 |
}
|
610 |
},
|
@@ -631,11 +695,7 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
631 |
in_sektion : params.apiParams.in_sektion,
|
632 |
in_column : params.apiParams.in_column
|
633 |
});
|
634 |
-
// always update the root fonts property after a module addition
|
635 |
-
// because there might be a google font specified in the starting value
|
636 |
self.updateAPISetting({ action : 'sek-update-fonts' } );
|
637 |
-
|
638 |
-
// Refresh the stylesheet to generate the css rules of the module
|
639 |
api.previewer.send( 'sek-refresh-stylesheet', {
|
640 |
skope_id : api.czr_skopeBase.getSkopeProperty( 'skope_id' ),//<= send skope id to the preview so we can use it when ajaxing
|
641 |
});
|
@@ -647,13 +707,18 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
647 |
uiParams = {};
|
648 |
switch( params.level ) {
|
649 |
case 'section' :
|
|
|
|
|
|
|
|
|
|
|
650 |
apiParams = {
|
651 |
action : 'sek-remove-section',
|
652 |
id : params.id,
|
653 |
location : params.location,
|
654 |
in_sektion : params.in_sektion,
|
655 |
in_column : params.in_column,
|
656 |
-
is_nested :
|
657 |
};
|
658 |
break;
|
659 |
case 'column' :
|
@@ -671,17 +736,15 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
671 |
in_column : params.in_column
|
672 |
};
|
673 |
break;
|
|
|
|
|
|
|
674 |
}
|
675 |
return self.updateAPISetting( apiParams );
|
676 |
},
|
677 |
complete : function( params ) {
|
678 |
-
|
679 |
-
api.previewer.trigger( 'sek-pick-module', {});
|
680 |
-
// always update the root fonts property after a removal
|
681 |
-
// because the removed level(s) might had registered fonts
|
682 |
self.updateAPISetting({ action : 'sek-update-fonts' } );
|
683 |
-
|
684 |
-
// When the last section of a location gets removed, make sure we refresh the location level, to print the sek-empty-location-placeholder
|
685 |
if ( 'sek-remove-section' === params.apiParams.action ) {
|
686 |
var locationLevel = self.getLevelModel( params.apiParams.location );
|
687 |
if ( _.isEmpty( locationLevel.collection ) ) {
|
@@ -740,7 +803,6 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
740 |
level : 'section',
|
741 |
in_sektion : params.apiParams.id
|
742 |
});
|
743 |
-
// refresh location levels if the source and target location are differents
|
744 |
if ( params.apiParams.from_location != params.apiParams.to_location ) {
|
745 |
api.previewer.trigger( 'sek-refresh-level', {
|
746 |
level : 'location',
|
@@ -771,12 +833,6 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
771 |
}
|
772 |
}
|
773 |
},//sek-move
|
774 |
-
|
775 |
-
|
776 |
-
|
777 |
-
|
778 |
-
// the level will be cloned and walked to replace all ids by new one
|
779 |
-
// then the level clone id will be send back to the preview for the ajax rendering ( this is done in updateAPISetting() promise() )
|
780 |
'sek-duplicate' : {
|
781 |
callback : function( params ) {
|
782 |
sendToPreview = true;
|
@@ -837,30 +893,18 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
837 |
});
|
838 |
break;
|
839 |
}
|
840 |
-
// Refresh the stylesheet to generate the css rules of the clone
|
841 |
api.previewer.send( 'sek-refresh-stylesheet', {
|
842 |
skope_id : api.czr_skopeBase.getSkopeProperty( 'skope_id' ),//<= send skope id to the preview so we can use it when ajaxing
|
843 |
});
|
844 |
-
// Focus on the cloned level
|
845 |
api.previewer.send('sek-focus-on', { id : params.apiParams.id });
|
846 |
}
|
847 |
},
|
848 |
'sek-resize-columns' : function( params ) {
|
849 |
sendToPreview = true;
|
850 |
uiParams = {};
|
851 |
-
//console.log( 'panel => reactToPreviewMsg => ', params );
|
852 |
apiParams = params;
|
853 |
return self.updateAPISetting( apiParams );
|
854 |
},
|
855 |
-
|
856 |
-
// @params {
|
857 |
-
// drop_target_element : $(this),
|
858 |
-
// position : _position,
|
859 |
-
// before_section : $(this).data('sek-before-section'),
|
860 |
-
// after_section : $(this).data('sek-after-section'),
|
861 |
-
// content_type : event.originalEvent.dataTransfer.getData( "sek-content-type" ),
|
862 |
-
// content_id : event.originalEvent.dataTransfer.getData( "sek-content-id" )
|
863 |
-
// }
|
864 |
'sek-add-content-in-new-sektion' : {
|
865 |
callback : function( params ) {
|
866 |
sendToPreview = ! _.isUndefined( params.send_to_preview ) ? params.send_to_preview : true;//<= when the level is refreshed when complete, we don't need to send to preview.
|
@@ -869,14 +913,12 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
869 |
apiParams.action = 'sek-add-content-in-new-sektion';
|
870 |
apiParams.id = sektionsLocalizedData.optPrefixForSektionsNotSaved + self.guid();//we set the id here because it will be needed when ajaxing
|
871 |
switch( params.content_type) {
|
872 |
-
// When a module is dropped in a section + column structure to be generated
|
873 |
case 'module' :
|
874 |
apiParams.droppedModuleId = sektionsLocalizedData.optPrefixForSektionsNotSaved + self.guid();//we set the id here because it will be needed when ajaxing
|
875 |
break;
|
876 |
-
|
877 |
-
// When a preset section is dropped
|
878 |
case 'preset_section' :
|
879 |
-
|
|
|
880 |
break;
|
881 |
}
|
882 |
return self.updateAPISetting( apiParams );
|
@@ -888,61 +930,67 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
888 |
level : 'module',
|
889 |
id : params.apiParams.droppedModuleId
|
890 |
});
|
891 |
-
|
892 |
-
|
893 |
-
|
894 |
-
|
895 |
-
// Refresh the stylesheet to generate the css rules of the module
|
896 |
-
api.previewer.send( 'sek-refresh-stylesheet', {
|
897 |
-
skope_id : api.czr_skopeBase.getSkopeProperty( 'skope_id' ),//<= send skope id to the preview so we can use it when ajaxing
|
898 |
-
});
|
899 |
break;
|
900 |
}
|
901 |
-
|
902 |
-
|
|
|
|
|
903 |
if ( params.apiParams.is_first_section ) {
|
904 |
api.previewer.trigger( 'sek-refresh-level', {
|
905 |
level : 'location',
|
906 |
id : params.apiParams.location
|
907 |
});
|
908 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
909 |
}
|
910 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
911 |
|
912 |
-
|
913 |
-
|
914 |
-
|
915 |
-
|
916 |
-
|
917 |
-
'sek-pick-module' : function( params ) {
|
918 |
-
//console.log('sek-pick-module react to preview', params);
|
919 |
-
sendToPreview = true;
|
920 |
-
apiParams = {};
|
921 |
-
uiParams = {
|
922 |
-
action : 'sek-generate-draggable-candidates-picker-ui',
|
923 |
-
content_type : 'module',
|
924 |
-
// <= the was_triggered param can be used to determine if we need to animate the picker control or not. @see ::generateUI() case 'sek-generate-draggable-candidates-picker-ui'
|
925 |
-
// true by default, because this is the most common scenario ( when adding a section, a column ... )
|
926 |
-
// but false when clicking on the + ui icon in the preview
|
927 |
-
was_triggered : _.has( params, 'was_triggered' ) ? params.was_triggered : true
|
928 |
-
};
|
929 |
-
return self.generateUI( uiParams );
|
930 |
},
|
931 |
-
'sek-pick-
|
|
|
932 |
sendToPreview = true;
|
933 |
apiParams = {};
|
934 |
uiParams = {
|
935 |
action : 'sek-generate-draggable-candidates-picker-ui',
|
936 |
-
content_type : 'section',
|
937 |
-
|
938 |
-
|
939 |
-
// but false when clicking on the + ui icon in the preview
|
940 |
-
was_triggered : _.has( params, 'was_triggered' ) ? params.was_triggered : true
|
941 |
};
|
942 |
return self.generateUI( uiParams );
|
943 |
},
|
|
|
944 |
'sek-edit-options' : function( params ) {
|
945 |
-
//console.log('IN EDIT OPTIONS ', params );
|
946 |
sendToPreview = true;
|
947 |
apiParams = {};
|
948 |
if ( _.isEmpty( params.id ) ) {
|
@@ -973,14 +1021,6 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
973 |
};
|
974 |
return self.generateUI( uiParams );
|
975 |
},
|
976 |
-
|
977 |
-
|
978 |
-
// OTHER MESSAGE TYPES
|
979 |
-
// @params {
|
980 |
-
// type : info, error, success
|
981 |
-
// message : ''
|
982 |
-
// duration : in ms
|
983 |
-
// }
|
984 |
'sek-notify' : function( params ) {
|
985 |
sendToPreview = false;
|
986 |
return $.Deferred(function() {
|
@@ -990,8 +1030,6 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
990 |
message: params.message,
|
991 |
dismissible: true
|
992 |
} ) );
|
993 |
-
|
994 |
-
// Removed if not dismissed after 5 seconds
|
995 |
_.delay( function() {
|
996 |
api.notifications.remove( 'sek-notify' );
|
997 |
}, params.duration || 5000 );
|
@@ -1013,9 +1051,6 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
1013 |
});
|
1014 |
}
|
1015 |
};//msgCollection
|
1016 |
-
|
1017 |
-
// Schedule the reactions
|
1018 |
-
// May be send a message to the preview
|
1019 |
_.each( msgCollection, function( callbackFn, msgId ) {
|
1020 |
api.previewer.bind( msgId, function( params ) {
|
1021 |
var _cb_;
|
@@ -1029,10 +1064,7 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
1029 |
}
|
1030 |
|
1031 |
try { _cb_( params )
|
1032 |
-
// the cloneId is passed when resolving the ::updateAPISetting() promise()
|
1033 |
-
// they are needed on level duplication to get the newly generated level id.
|
1034 |
.done( function( cloneId ) {
|
1035 |
-
// Send to the preview
|
1036 |
if ( sendToPreview ) {
|
1037 |
api.previewer.send(
|
1038 |
msgId,
|
@@ -1044,37 +1076,35 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
1044 |
}
|
1045 |
);
|
1046 |
} else {
|
1047 |
-
|
1048 |
-
api.previewer.trigger( [msgId, 'done'].join('_'), { apiParams : apiParams, uiParams : uiParams } );
|
1049 |
}
|
1050 |
-
// say it
|
1051 |
self.trigger( [ msgId, 'done' ].join('_'), params );
|
1052 |
})
|
1053 |
.fail( function( er ) {
|
1054 |
api.errare( 'reactToPreviewMsg => error when firing ' + msgId, er );
|
1055 |
-
api.
|
1056 |
-
|
1057 |
-
|
1058 |
-
|
1059 |
-
|
1060 |
-
|
1061 |
-
|
1062 |
-
|
1063 |
-
|
1064 |
-
|
1065 |
-
|
1066 |
-
|
|
|
|
|
1067 |
|
|
|
1068 |
}); } catch( _er_ ) {
|
1069 |
api.errare( 'reactToPreviewMsg => error when receiving ' + msgId, _er_ );
|
1070 |
}
|
1071 |
});
|
1072 |
});
|
1073 |
-
|
1074 |
-
|
1075 |
-
// Schedule actions when callback done msg is sent by the preview
|
1076 |
_.each( msgCollection, function( callbackFn, msgId ) {
|
1077 |
-
api.previewer.bind( [msgId, 'done'].join('_'), function( params ) {
|
1078 |
if ( _.isFunction( callbackFn.complete ) ) {
|
1079 |
try { callbackFn.complete( params ); } catch( _er_ ) {
|
1080 |
api.errare( 'reactToPreviewMsg done => error when receiving ' + [msgId, 'done'].join('_') , _er_ );
|
@@ -1083,14 +1113,11 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
1083 |
});
|
1084 |
});
|
1085 |
},//reactToPreview();
|
1086 |
-
|
1087 |
-
// Fired in initialized on api(ready)
|
1088 |
schedulePrintSectionJson : function() {
|
1089 |
var self = this;
|
1090 |
var popupCenter = function ( content ) {
|
1091 |
w = 400;
|
1092 |
h = 300;
|
1093 |
-
// Fixes dual-screen position Most browsers Firefox
|
1094 |
var dualScreenLeft = ! _.isUndefined( window.screenLeft ) ? window.screenLeft : window.screenX;
|
1095 |
var dualScreenTop = ! _.isUndefined( window.screenTop ) ? window.screenTop : window.screenY;
|
1096 |
|
@@ -1104,7 +1131,6 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
1104 |
doc.open("text/html");
|
1105 |
doc.write( content );
|
1106 |
doc.close();
|
1107 |
-
// Puts focus on the newWindow
|
1108 |
if (window.focus) {
|
1109 |
newWindow.focus();
|
1110 |
}
|
@@ -1122,23 +1148,14 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
1122 |
|
1123 |
api.previewer.bind( 'sek-to-json', function( params ) {
|
1124 |
var sectionModel = $.extend( true, {}, self.getLevelModel( params.id ) );
|
1125 |
-
|
1126 |
});
|
1127 |
-
}
|
1128 |
});//$.extend()
|
1129 |
})( wp.customize, jQuery );//global sektionsLocalizedData
|
1130 |
var CZRSeksPrototype = CZRSeksPrototype || {};
|
1131 |
(function ( api, $ ) {
|
1132 |
$.extend( CZRSeksPrototype, {
|
1133 |
-
// @params = {
|
1134 |
-
// action : 'sek-generate-module-ui' / 'sek-generate-level-options-ui'
|
1135 |
-
// level : params.level,
|
1136 |
-
// id : params.id,
|
1137 |
-
// in_sektion : params.in_sektion,
|
1138 |
-
// in_column : params.in_column,
|
1139 |
-
// options : params.options || []
|
1140 |
-
// }
|
1141 |
-
// @return promise()
|
1142 |
generateUI : function( params ) {
|
1143 |
var self = this,
|
1144 |
dfd = $.Deferred(),
|
@@ -1147,567 +1164,56 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
1147 |
if ( _.isEmpty( params.action ) ) {
|
1148 |
dfd.reject( 'generateUI => missing action' );
|
1149 |
}
|
1150 |
-
|
1151 |
-
// REGISTER SETTING AND CONTROL
|
1152 |
switch ( params.action ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
1153 |
|
1154 |
-
|
1155 |
-
|
1156 |
-
|
1157 |
-
|
1158 |
-
|
1159 |
-
|
1160 |
-
// 2) preset_section
|
1161 |
case 'sek-generate-draggable-candidates-picker-ui' :
|
1162 |
-
|
1163 |
-
|
1164 |
-
|
1165 |
-
|
1166 |
-
api.control( _id_ ).focus({
|
1167 |
-
completeCallback : function() {
|
1168 |
-
//console.log('params sek-generate-draggable-candidates-picker-ui' , params);
|
1169 |
-
var $container = api.control( _id_ ).container;
|
1170 |
-
// @use button-see-mee css class declared in core in /wp-admin/css/customize-controls.css
|
1171 |
-
if ( $container.hasClass( 'button-see-me') )
|
1172 |
-
return;
|
1173 |
-
$container.addClass('button-see-me');
|
1174 |
-
_.delay( function() {
|
1175 |
-
$container.removeClass('button-see-me');
|
1176 |
-
}, 800 );
|
1177 |
-
}
|
1178 |
-
});
|
1179 |
-
break;
|
1180 |
}
|
1181 |
-
|
|
|
1182 |
self.cleanRegistered();
|
1183 |
-
|
1184 |
-
|
1185 |
-
|
1186 |
-
|
1187 |
-
_setting_.bind( function( to, from ) {
|
1188 |
-
api.errare('MODULE / SECTION PICKER SETTING CHANGED');
|
1189 |
-
});
|
1190 |
-
});
|
1191 |
-
self.register( {
|
1192 |
-
level : params.level,
|
1193 |
-
what : 'setting',
|
1194 |
-
id : _id_,
|
1195 |
-
dirty : false,
|
1196 |
-
value : '',
|
1197 |
-
transport : 'postMessage',// 'refresh',
|
1198 |
-
type : '_nimble_ui_'//will be dynamically registered but not saved in db as option// columnData.settingType
|
1199 |
-
});
|
1200 |
-
}
|
1201 |
-
|
1202 |
-
self.register( {
|
1203 |
-
level : params.level,
|
1204 |
-
what : 'control',
|
1205 |
-
id : _id_,
|
1206 |
-
label : 'module' === params.content_type ? sektionsLocalizedData.i18n['Module Picker'] : sektionsLocalizedData.i18n['Section Picker'],
|
1207 |
-
type : 'czr_module',//sekData.controlType,
|
1208 |
-
module_type : 'module' === params.content_type ? 'sek_module_picker_module' : 'sek_section_picker_module',
|
1209 |
-
section : _id_,
|
1210 |
-
priority : 10,
|
1211 |
-
settings : { default : _id_ },
|
1212 |
-
track : false//don't register in the self.registered() => this will prevent this container to be removed when cleaning the registered
|
1213 |
-
}).done( function() {
|
1214 |
-
api.control( _id_ ).focus({
|
1215 |
-
completeCallback : function() {}
|
1216 |
-
});
|
1217 |
-
});
|
1218 |
-
};
|
1219 |
-
|
1220 |
-
// Defer the registration when the parent section gets added to the api
|
1221 |
-
api.section.when( _id_, function() {
|
1222 |
-
_do_register_();
|
1223 |
-
});
|
1224 |
-
|
1225 |
-
// MODULE / SECTION PICKER SECTION
|
1226 |
-
self.register({
|
1227 |
-
what : 'section',
|
1228 |
-
id : _id_,
|
1229 |
-
title: 'module' === params.content_type ? sektionsLocalizedData.i18n['Module Picker'] : sektionsLocalizedData.i18n['Section Picker'],
|
1230 |
-
panel : sektionsLocalizedData.sektionsPanelId,
|
1231 |
-
priority : 30,
|
1232 |
-
track : false,//don't register in the self.registered() => this will prevent this container to be removed when cleaning the registered
|
1233 |
-
constructWith : api.Section.extend({
|
1234 |
-
//attachEvents : function () {},
|
1235 |
-
// Always make the section active, event if we have no control in it
|
1236 |
-
isContextuallyActive : function () {
|
1237 |
-
return this.active();
|
1238 |
-
},
|
1239 |
-
_toggleActive : function(){ return true; }
|
1240 |
-
})
|
1241 |
-
});
|
1242 |
break;
|
1243 |
-
|
1244 |
-
|
1245 |
-
|
1246 |
-
|
1247 |
-
|
1248 |
-
|
1249 |
-
|
1250 |
-
|
1251 |
-
|
1252 |
-
|
1253 |
-
|
1254 |
-
|
1255 |
-
|
1256 |
-
|
1257 |
-
|
1258 |
-
|
1259 |
-
case 'sek-generate-module-ui' :
|
1260 |
-
if ( _.isEmpty( params.id ) ) {
|
1261 |
-
dfd.reject( 'generateUI => missing id' );
|
1262 |
-
}
|
1263 |
-
// Is the UI currently displayed the one that is being requested ?
|
1264 |
-
// If so, don't generate the ui again, simply focus on it
|
1265 |
-
if ( self.isUIControlAlreadyRegistered( params.id ) ) {
|
1266 |
-
api.control( params.id ).focus({
|
1267 |
-
completeCallback : function() {}
|
1268 |
-
});
|
1269 |
-
break;
|
1270 |
-
}
|
1271 |
-
|
1272 |
-
// Clean previously generated UI elements
|
1273 |
-
self.cleanRegistered();
|
1274 |
-
|
1275 |
-
// For modules, we need to generate a UI for the module value
|
1276 |
-
var moduleValue = self.getLevelProperty({
|
1277 |
-
property : 'value',
|
1278 |
-
id : params.id
|
1279 |
-
});
|
1280 |
-
var moduleType = self.getLevelProperty({
|
1281 |
-
property : 'module_type',
|
1282 |
-
id : params.id
|
1283 |
-
});
|
1284 |
-
|
1285 |
-
if ( _.isEmpty( moduleType ) ) {
|
1286 |
-
dfd.reject( 'generateUI => module => invalid module_type' );
|
1287 |
-
}
|
1288 |
-
|
1289 |
-
_do_register_ = function() {
|
1290 |
-
// Make sure this setting is bound only once !
|
1291 |
-
if ( ! api.has( params.id ) ) {
|
1292 |
-
// Schedule the binding to synchronize the module setting with the main collection setting
|
1293 |
-
// Note 1 : unlike control or sections, the setting are not getting cleaned up on each ui generation.
|
1294 |
-
// They need to be kept in order to keep track of the changes in the customizer.
|
1295 |
-
// => that's why we check if ! api.has( ... )
|
1296 |
-
api( params.id, function( _setting_ ) {
|
1297 |
-
_setting_.bind( _.debounce( function( to, from, args ) {
|
1298 |
-
try { self.updateAPISettingAndExecutePreviewActions({
|
1299 |
-
defaultPreviewAction : 'refresh_markup',
|
1300 |
-
uiParams : _.extend( params, { action : 'sek-set-module-value' } ),
|
1301 |
-
//options_type : 'spacing',
|
1302 |
-
settingParams : {
|
1303 |
-
to : to,
|
1304 |
-
from : from,
|
1305 |
-
args : args
|
1306 |
-
}
|
1307 |
-
}); } catch( er ) {
|
1308 |
-
api.errare( 'Error in updateAPISettingAndExecutePreviewActions', er );
|
1309 |
-
}
|
1310 |
-
}, self.SETTING_UPDATE_BUFFER ) );//_setting_.bind( _.debounce( function( to, from, args ) {}
|
1311 |
-
});
|
1312 |
-
|
1313 |
-
self.register({
|
1314 |
-
level : params.level,
|
1315 |
-
what : 'setting',
|
1316 |
-
id : params.id,
|
1317 |
-
dirty : false,
|
1318 |
-
value : moduleValue,
|
1319 |
-
transport : 'postMessage',// 'refresh',
|
1320 |
-
type : '_nimble_ui_'//will be dynamically registered but not saved in db as option// columnData.settingType
|
1321 |
-
});
|
1322 |
-
}
|
1323 |
-
|
1324 |
-
|
1325 |
-
|
1326 |
-
self.register( {
|
1327 |
-
level : params.level,
|
1328 |
-
what : 'control',
|
1329 |
-
id : params.id,
|
1330 |
-
label : sektionsLocalizedData.i18n['Customize the options for module :'] + ' ' + api.czrModuleMap[ moduleType ].name,
|
1331 |
-
type : 'czr_module',//sekData.controlType,
|
1332 |
-
module_type : moduleType,
|
1333 |
-
section : params.id,
|
1334 |
-
priority : 10,
|
1335 |
-
settings : { default : params.id }
|
1336 |
-
}).done( function() {
|
1337 |
-
api.control( params.id ).focus({
|
1338 |
-
completeCallback : function() {}
|
1339 |
-
});
|
1340 |
-
});
|
1341 |
-
};
|
1342 |
-
|
1343 |
-
// Defer the registration when the parent section gets added to the api
|
1344 |
-
api.section.when( params.id, function() {
|
1345 |
-
_do_register_();
|
1346 |
-
});
|
1347 |
-
|
1348 |
-
// MAIN CONTENT SECTION
|
1349 |
-
self.register({
|
1350 |
-
what : 'section',
|
1351 |
-
id : params.id,
|
1352 |
-
title: sektionsLocalizedData.i18n['Content for'] + ' ' + api.czrModuleMap[ moduleType ].name,
|
1353 |
-
panel : sektionsLocalizedData.sektionsPanelId,
|
1354 |
-
priority : 20,
|
1355 |
-
//track : false//don't register in the self.registered()
|
1356 |
-
//constructWith : MainSectionConstructor,
|
1357 |
-
});
|
1358 |
-
|
1359 |
-
break;
|
1360 |
-
|
1361 |
-
|
1362 |
-
|
1363 |
-
|
1364 |
-
|
1365 |
-
|
1366 |
-
|
1367 |
-
|
1368 |
-
|
1369 |
-
|
1370 |
-
|
1371 |
-
|
1372 |
-
|
1373 |
-
|
1374 |
-
case 'sek-generate-level-options-ui' :
|
1375 |
-
// Generate the UI for level options
|
1376 |
-
//console.log("PARAMS IN sek-generate-level-options-ui", params );
|
1377 |
-
var sectionLayoutOptionsSetId = params.id + '__sectionLayout_options',
|
1378 |
-
bgBorderOptionsSetId = params.id + '__bgBorder_options',
|
1379 |
-
heightOptionsSetId = params.id + '__height_options',
|
1380 |
-
spacingOptionsSetId = params.id + '__spacing_options';
|
1381 |
-
|
1382 |
-
// Is the UI currently displayed the one that is being requested ?
|
1383 |
-
// If so, don't generate the ui again, simply focus on the section
|
1384 |
-
if ( self.isUIControlAlreadyRegistered( bgBorderOptionsSetId ) || self.isUIControlAlreadyRegistered( heightOptionsSetId ) || self.isUIControlAlreadyRegistered( spacingOptionsSetId ) ) {
|
1385 |
-
api.section( api.control( bgBorderOptionsSetId ).section() ).expanded( true );
|
1386 |
-
break;
|
1387 |
-
}
|
1388 |
-
|
1389 |
-
// Clean previously generated UI elements
|
1390 |
-
self.cleanRegistered();
|
1391 |
-
|
1392 |
-
var controlLabel = '',
|
1393 |
-
optionDBValue = self.getLevelProperty({
|
1394 |
-
property : 'options',
|
1395 |
-
id : params.id
|
1396 |
-
});
|
1397 |
-
optionDBValue = _.isObject( optionDBValue ) ? optionDBValue : {};
|
1398 |
-
|
1399 |
-
_do_register_ = function() {
|
1400 |
-
if ( 'section' === params.level ) {
|
1401 |
-
// REGISTER SECTION LAYOUT
|
1402 |
-
// Make sure this setting is bound only once !
|
1403 |
-
if( ! api.has( heightOptionsSetId ) ) {
|
1404 |
-
// Schedule the binding to synchronize the options with the main collection setting
|
1405 |
-
// Note 1 : unlike control or sections, the setting are not getting cleaned up on each ui generation.
|
1406 |
-
// They need to be kept in order to keep track of the changes in the customizer.
|
1407 |
-
// => that's why we check if ! api.has( ... )
|
1408 |
-
api( sectionLayoutOptionsSetId, function( _setting_ ) {
|
1409 |
-
_setting_.bind( _.debounce( function( to, from, args ) {
|
1410 |
-
try { self.updateAPISettingAndExecutePreviewActions({
|
1411 |
-
defaultPreviewAction : 'refresh_stylesheet',
|
1412 |
-
uiParams : _.extend( params, { action : 'sek-set-level-options' } ),
|
1413 |
-
options_type : 'layout',// <= this is the options sub property where we will store this setting values. @see updateAPISetting case 'sek-set-level-options'
|
1414 |
-
settingParams : {
|
1415 |
-
to : to,
|
1416 |
-
from : from,
|
1417 |
-
args : args
|
1418 |
-
}
|
1419 |
-
}); } catch( er ) {
|
1420 |
-
api.errare( 'Error in updateAPISettingAndExecutePreviewActions', er );
|
1421 |
-
}
|
1422 |
-
}, self.SETTING_UPDATE_BUFFER ) );//_setting_.bind( _.debounce( function( to, from, args ) {}
|
1423 |
-
});//api( heightOptionsSetId, function( _setting_ ) {})
|
1424 |
-
|
1425 |
-
|
1426 |
-
self.register( {
|
1427 |
-
level : params.level,
|
1428 |
-
what : 'setting',
|
1429 |
-
id : sectionLayoutOptionsSetId,
|
1430 |
-
dirty : false,
|
1431 |
-
value : optionDBValue.layout || {},
|
1432 |
-
transport : 'postMessage',// 'refresh',
|
1433 |
-
type : '_nimble_ui_'//will be dynamically registered but not saved in db as option //sekData.settingType
|
1434 |
-
});
|
1435 |
-
}//if( ! api.has( sectionLayoutOptionsSetId ) ) {
|
1436 |
-
|
1437 |
-
|
1438 |
-
self.register( {
|
1439 |
-
level : params.level,
|
1440 |
-
level_id : params.id,
|
1441 |
-
what : 'control',
|
1442 |
-
id : sectionLayoutOptionsSetId,
|
1443 |
-
label : sektionsLocalizedData.i18n['Layout settings for the'] + ' ' + sektionsLocalizedData.i18n[params.level],
|
1444 |
-
type : 'czr_module',//sekData.controlType,
|
1445 |
-
module_type : 'sek_level_section_layout_module',
|
1446 |
-
section : params.id,
|
1447 |
-
priority : 0,
|
1448 |
-
settings : { default : sectionLayoutOptionsSetId }
|
1449 |
-
}).done( function() {
|
1450 |
-
api.control( sectionLayoutOptionsSetId ).focus({
|
1451 |
-
completeCallback : function() {}
|
1452 |
-
});
|
1453 |
-
});
|
1454 |
-
}// if 'section' === params.level
|
1455 |
-
|
1456 |
-
|
1457 |
-
|
1458 |
-
// REGISTER BACKGROUND BORDER OPTIONS
|
1459 |
-
// Make sure this setting is bound only once !
|
1460 |
-
if( ! api.has( bgBorderOptionsSetId ) ) {
|
1461 |
-
// Schedule the binding to synchronize the options with the main collection setting
|
1462 |
-
// Note 1 : unlike control or sections, the setting are not getting cleaned up on each ui generation.
|
1463 |
-
// They need to be kept in order to keep track of the changes in the customizer.
|
1464 |
-
// => that's why we check if ! api.has( ... )
|
1465 |
-
api( bgBorderOptionsSetId, function( _setting_ ) {
|
1466 |
-
_setting_.bind( _.debounce( function( to, from, args ) {
|
1467 |
-
try { self.updateAPISettingAndExecutePreviewActions({
|
1468 |
-
defaultPreviewAction : 'refresh_stylesheet',
|
1469 |
-
uiParams : _.extend( params, { action : 'sek-set-level-options' } ),
|
1470 |
-
options_type : 'bg_border',// <= this is the options sub property where we will store this setting values. @see updateAPISetting case 'sek-set-level-options'
|
1471 |
-
settingParams : {
|
1472 |
-
to : to,
|
1473 |
-
from : from,
|
1474 |
-
args : args
|
1475 |
-
}
|
1476 |
-
}); } catch( er ) {
|
1477 |
-
api.errare( 'Error in updateAPISettingAndExecutePreviewActions', er );
|
1478 |
-
}
|
1479 |
-
}, self.SETTING_UPDATE_BUFFER ) );//_setting_.bind( _.debounce( function( to, from, args ) {}
|
1480 |
-
});//api( bgBorderOptionsSetId, function( _setting_ ) {})
|
1481 |
-
|
1482 |
-
|
1483 |
-
self.register( {
|
1484 |
-
level : params.level,
|
1485 |
-
what : 'setting',
|
1486 |
-
id : bgBorderOptionsSetId,
|
1487 |
-
dirty : false,
|
1488 |
-
value : optionDBValue.bg_border || {},
|
1489 |
-
transport : 'postMessage',// 'refresh',
|
1490 |
-
type : '_nimble_ui_'//will be dynamically registered but not saved in db as option //sekData.settingType
|
1491 |
-
});
|
1492 |
-
}//if( ! api.has( bgBorderOptionsSetId ) ) {
|
1493 |
-
|
1494 |
-
self.register( {
|
1495 |
-
level : params.level,
|
1496 |
-
level_id : params.id,
|
1497 |
-
what : 'control',
|
1498 |
-
id : bgBorderOptionsSetId,
|
1499 |
-
label : sektionsLocalizedData.i18n['Background and border settings for the'] + ' ' + sektionsLocalizedData.i18n[params.level],
|
1500 |
-
type : 'czr_module',//sekData.controlType,
|
1501 |
-
module_type : 'sek_level_bg_border_module',
|
1502 |
-
section : params.id,
|
1503 |
-
priority : 10,
|
1504 |
-
settings : { default : bgBorderOptionsSetId }
|
1505 |
-
}).done( function() {
|
1506 |
-
api.control( bgBorderOptionsSetId ).focus({
|
1507 |
-
completeCallback : function() {}
|
1508 |
-
});
|
1509 |
-
});
|
1510 |
-
|
1511 |
-
|
1512 |
-
// REGISTER SPAGING OPTIONS
|
1513 |
-
// Make sure this setting is bound only once !
|
1514 |
-
if( ! api.has( spacingOptionsSetId ) ) {
|
1515 |
-
// Schedule the binding to synchronize the options with the main collection setting
|
1516 |
-
// Note 1 : unlike control or sections, the setting are not getting cleaned up on each ui generation.
|
1517 |
-
// They need to be kept in order to keep track of the changes in the customizer.
|
1518 |
-
// => that's why we check if ! api.has( ... )
|
1519 |
-
api( spacingOptionsSetId, function( _setting_ ) {
|
1520 |
-
_setting_.bind( _.debounce( function( to, from, args ) {
|
1521 |
-
try { self.updateAPISettingAndExecutePreviewActions({
|
1522 |
-
defaultPreviewAction : 'refresh_stylesheet',
|
1523 |
-
uiParams : _.extend( params, { action : 'sek-set-level-options' } ),
|
1524 |
-
options_type : 'spacing',// <= this is the options sub property where we will store this setting values. @see updateAPISetting case 'sek-set-level-options'
|
1525 |
-
settingParams : {
|
1526 |
-
to : to,
|
1527 |
-
from : from,
|
1528 |
-
args : args
|
1529 |
-
}
|
1530 |
-
}); } catch( er ) {
|
1531 |
-
api.errare( 'Error in updateAPISettingAndExecutePreviewActions', er );
|
1532 |
-
}
|
1533 |
-
}, self.SETTING_UPDATE_BUFFER ) );//_setting_.bind( _.debounce( function( to, from, args ) {}
|
1534 |
-
});//api( spacingOptionsSetId, function( _setting_ ) {})
|
1535 |
-
|
1536 |
-
|
1537 |
-
self.register( {
|
1538 |
-
level : params.level,
|
1539 |
-
what : 'setting',
|
1540 |
-
id : spacingOptionsSetId,
|
1541 |
-
dirty : false,
|
1542 |
-
value : optionDBValue.spacing || {},
|
1543 |
-
transport : 'postMessage',// 'refresh',
|
1544 |
-
type : '_nimble_ui_'//will be dynamically registered but not saved in db as option //sekData.settingType
|
1545 |
-
});
|
1546 |
-
}
|
1547 |
-
|
1548 |
-
|
1549 |
-
|
1550 |
-
self.register( {
|
1551 |
-
level : params.level,
|
1552 |
-
what : 'control',
|
1553 |
-
id : spacingOptionsSetId,
|
1554 |
-
label : sektionsLocalizedData.i18n['Padding and margin settings for the'] + ' ' + sektionsLocalizedData.i18n[params.level],
|
1555 |
-
type : 'czr_module',//sekData.controlType,
|
1556 |
-
module_type : 'sek_spacing_module',
|
1557 |
-
section : params.id,
|
1558 |
-
priority : 15,
|
1559 |
-
settings : { default : spacingOptionsSetId }
|
1560 |
-
}).done( function() {
|
1561 |
-
// synchronize the options with the main collection setting
|
1562 |
-
api.control( spacingOptionsSetId ).focus({
|
1563 |
-
completeCallback : function() {}
|
1564 |
-
});
|
1565 |
-
});
|
1566 |
-
|
1567 |
-
|
1568 |
-
|
1569 |
-
// REGISTER HEIGHT OPTIONS
|
1570 |
-
// Make sure this setting is bound only once !
|
1571 |
-
if( ! api.has( heightOptionsSetId ) ) {
|
1572 |
-
// Schedule the binding to synchronize the options with the main collection setting
|
1573 |
-
// Note 1 : unlike control or sections, the setting are not getting cleaned up on each ui generation.
|
1574 |
-
// They need to be kept in order to keep track of the changes in the customizer.
|
1575 |
-
// => that's why we check if ! api.has( ... )
|
1576 |
-
api( heightOptionsSetId, function( _setting_ ) {
|
1577 |
-
_setting_.bind( _.debounce( function( to, from, args ) {
|
1578 |
-
try { self.updateAPISettingAndExecutePreviewActions({
|
1579 |
-
defaultPreviewAction : 'refresh_stylesheet',
|
1580 |
-
uiParams : _.extend( params, { action : 'sek-set-level-options' } ),
|
1581 |
-
options_type : 'height',// <= this is the options sub property where we will store this setting values. @see updateAPISetting case 'sek-set-level-options'
|
1582 |
-
settingParams : {
|
1583 |
-
to : to,
|
1584 |
-
from : from,
|
1585 |
-
args : args
|
1586 |
-
}
|
1587 |
-
}); } catch( er ) {
|
1588 |
-
api.errare( 'Error in updateAPISettingAndExecutePreviewActions', er );
|
1589 |
-
}
|
1590 |
-
}, self.SETTING_UPDATE_BUFFER ) );//_setting_.bind( _.debounce( function( to, from, args ) {}
|
1591 |
-
});//api( heightOptionsSetId, function( _setting_ ) {})
|
1592 |
-
|
1593 |
-
|
1594 |
-
self.register( {
|
1595 |
-
level : params.level,
|
1596 |
-
what : 'setting',
|
1597 |
-
id : heightOptionsSetId,
|
1598 |
-
dirty : false,
|
1599 |
-
value : optionDBValue.height || {},
|
1600 |
-
transport : 'postMessage',// 'refresh',
|
1601 |
-
type : '_nimble_ui_'//will be dynamically registered but not saved in db as option //sekData.settingType
|
1602 |
-
});
|
1603 |
-
}//if( ! api.has( heightOptionsSetId ) ) {
|
1604 |
-
|
1605 |
-
self.register( {
|
1606 |
-
level : params.level,
|
1607 |
-
level_id : params.id,
|
1608 |
-
what : 'control',
|
1609 |
-
id : heightOptionsSetId,
|
1610 |
-
label : sektionsLocalizedData.i18n['Height settings for the'] + ' ' + sektionsLocalizedData.i18n[params.level],
|
1611 |
-
type : 'czr_module',//sekData.controlType,
|
1612 |
-
module_type : 'sek_level_height_module',
|
1613 |
-
section : params.id,
|
1614 |
-
priority : 20,
|
1615 |
-
settings : { default : heightOptionsSetId }
|
1616 |
-
}).done( function() {
|
1617 |
-
api.control( heightOptionsSetId ).focus({
|
1618 |
-
completeCallback : function() {}
|
1619 |
-
});
|
1620 |
-
});
|
1621 |
-
|
1622 |
-
};//_do_register_
|
1623 |
-
|
1624 |
-
|
1625 |
-
|
1626 |
-
|
1627 |
-
|
1628 |
-
// Defer the registration when the parent section gets added to the api
|
1629 |
-
api.section.when( params.id, function() {
|
1630 |
-
_do_register_();
|
1631 |
-
});
|
1632 |
-
|
1633 |
-
self.register({
|
1634 |
-
what : 'section',
|
1635 |
-
id : params.id,
|
1636 |
-
title: sektionsLocalizedData.i18n['Settings for the'] + ' ' + params.level,
|
1637 |
-
panel : sektionsLocalizedData.sektionsPanelId,
|
1638 |
-
priority : 10,
|
1639 |
-
track : false//don't register in the self.registered()
|
1640 |
-
//constructWith : MainSectionConstructor,
|
1641 |
-
});
|
1642 |
-
break;
|
1643 |
-
}//switch
|
1644 |
|
1645 |
return 'pending' == dfd.state() ? dfd.resolve().promise() : dfd.promise();//<= we might want to resolve on focus.completeCallback ?
|
1646 |
},//generateUI()
|
1647 |
-
|
1648 |
-
|
1649 |
-
|
1650 |
-
|
1651 |
-
|
1652 |
-
|
1653 |
-
|
1654 |
-
|
1655 |
-
|
1656 |
-
|
1657 |
-
|
1658 |
-
|
1659 |
-
|
1660 |
-
|
1661 |
-
// @params = {
|
1662 |
-
// uiParams : params,
|
1663 |
-
// options_type : 'spacing',
|
1664 |
-
// settingParams : {
|
1665 |
-
// to : to,
|
1666 |
-
// from : from,
|
1667 |
-
// args : args
|
1668 |
-
// }
|
1669 |
-
// }
|
1670 |
-
//
|
1671 |
-
// @param settingParams.args = {
|
1672 |
-
// inputRegistrationParams : {
|
1673 |
-
// id :,
|
1674 |
-
// type :
|
1675 |
-
// refresh_markup : bool
|
1676 |
-
// refresh_stylesheet : bool
|
1677 |
-
// refresh_fonts : bool
|
1678 |
-
// }
|
1679 |
-
// input_changed : input_id
|
1680 |
-
// input_transport : 'inherit'/'postMessage',
|
1681 |
-
// module : { items : [...]}
|
1682 |
-
// module_id :
|
1683 |
-
// not_preview_sent : bool
|
1684 |
-
//}
|
1685 |
-
//
|
1686 |
-
// Note 1 : this method must handle two types of modules :
|
1687 |
-
// 1) mono item modules, for which the settingParams.to is an object, a single item object
|
1688 |
-
// 2) multi-items modules, for which the settingParams.to is an array, a collection of item objects
|
1689 |
-
// How do we know that we are a in single / multi item module ?
|
1690 |
-
//
|
1691 |
-
// Note 2 : we must also handle several scenarios of module value update :
|
1692 |
-
// 1) mono-items and multi-items module => input change
|
1693 |
-
// 2) crud multi item => item added or removed => in this case some args are not passed, like params.settingParams.args.inputRegistrationParams
|
1694 |
updateAPISettingAndExecutePreviewActions : function( params ) {
|
1695 |
-
//console.log('PARAMS in updateAPISettingAndExecutePreviewActions', params );
|
1696 |
if ( _.isEmpty( params.settingParams ) || ! _.has( params.settingParams, 'to' ) ) {
|
1697 |
api.errare( 'updateAPISettingAndExecutePreviewActions => missing params.settingParams.to. The api main setting can not be updated', params );
|
1698 |
return;
|
1699 |
}
|
1700 |
var self = this;
|
1701 |
-
|
1702 |
-
// NORMALIZE THE VALUE WE WANT TO WRITE IN THE MAIN SETTING
|
1703 |
-
// 1) We don't want to store the default title and id module properties
|
1704 |
-
// 2) We don't want to write in db the properties that are set to their default values
|
1705 |
var rawModuleValue = params.settingParams.to,
|
1706 |
moduleValueCandidate,// {} or [] if mono item of multi-item module
|
1707 |
parentModuleType = null,
|
1708 |
isMultiItemModule = false;
|
1709 |
|
1710 |
-
//console.log('module control => ', params.settingParams.args.moduleRegistrationParams.control );
|
1711 |
if ( _.isEmpty( params.settingParams.args ) || ! _.has( params.settingParams.args, 'moduleRegistrationParams' ) ) {
|
1712 |
api.errare( 'updateAPISettingAndExecutePreviewActions => missing params.settingParams.args.moduleRegistrationParams The api main setting can not be updated', params );
|
1713 |
return;
|
@@ -1723,11 +1229,6 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
1723 |
} else {
|
1724 |
api.errare( 'updateAPISettingAndExecutePreviewActions => missing parentModuleInstance', params );
|
1725 |
}
|
1726 |
-
|
1727 |
-
//console.log('updateAPISettingAndExecutePreviewActions => ', params.settingParams, isMultiItemModule, rawModuleValue, _.isObject( rawModuleValue ) );
|
1728 |
-
|
1729 |
-
// The new module value can be an single item object if monoitem module, or an array of item objects if multi-item crud
|
1730 |
-
// Let's normalize it
|
1731 |
if ( ! isMultiItemModule && _.isObject( rawModuleValue ) ) {
|
1732 |
moduleValueCandidate = self.normalizeAndSanitizeSingleItemInputValues( rawModuleValue, parentModuleType );
|
1733 |
} else {
|
@@ -1736,107 +1237,99 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
1736 |
moduleValueCandidate.push( self.normalizeAndSanitizeSingleItemInputValues( item, parentModuleType ) );
|
1737 |
});
|
1738 |
}
|
1739 |
-
|
1740 |
-
// What to do in the preview ?
|
1741 |
-
// The action to trigger is determined by the changed input
|
1742 |
-
// For the options of a level, the default action is to refresh the stylesheet.
|
1743 |
-
// But we might need to refresh the markup in some cases. Like for example when a css class is added. @see the boxed-wide layout example
|
1744 |
if ( _.isEmpty( params.defaultPreviewAction ) ) {
|
1745 |
api.errare( 'updateAPISettingAndExecutePreviewActions => missing defaultPreviewAction in passed params. No action can be triggered to the api.previewer.', params );
|
1746 |
return;
|
1747 |
}
|
1748 |
-
// Set the default value
|
1749 |
var refresh_stylesheet = 'refresh_stylesheet' === params.defaultPreviewAction,//<= default action for level options
|
1750 |
refresh_markup = 'refresh_markup' === params.defaultPreviewAction,//<= default action for module options
|
1751 |
-
refresh_fonts = 'refresh_fonts' === params.defaultPreviewAction
|
1752 |
-
|
1753 |
-
|
1754 |
-
|
1755 |
-
|
1756 |
-
|
1757 |
-
if ( ! _.isUndefined(
|
1758 |
-
refresh_stylesheet = Boolean(
|
|
|
|
|
|
|
1759 |
}
|
1760 |
-
if ( ! _.isUndefined(
|
1761 |
-
|
1762 |
}
|
1763 |
-
if ( ! _.isUndefined(
|
1764 |
-
|
1765 |
}
|
1766 |
}
|
1767 |
|
1768 |
var _doUpdateWithRequestedAction = function() {
|
1769 |
-
|
1770 |
-
|
1771 |
-
|
1772 |
-
|
1773 |
-
in_column : params.uiParams.in_column,
|
1774 |
-
in_sektion : params.uiParams.in_sektion,
|
1775 |
-
|
1776 |
-
// specific for level options
|
1777 |
-
options_type : params.options_type,//'layout', 'spacing', 'bg_border', 'height'
|
1778 |
-
|
1779 |
-
settingParams : params.settingParams
|
1780 |
-
}).done( function( ) {
|
1781 |
-
// STYLESHEET => default action when modifying the level options
|
1782 |
-
if ( true === refresh_stylesheet ) {
|
1783 |
-
api.previewer.send( 'sek-refresh-stylesheet', {
|
1784 |
-
skope_id : api.czr_skopeBase.getSkopeProperty( 'skope_id' ),//<= send skope id to the preview so we can use it when ajaxing
|
1785 |
-
apiParams : {
|
1786 |
-
action : 'sek-refresh-stylesheet',
|
1787 |
-
id : params.uiParams.id,
|
1788 |
-
level : params.uiParams.level
|
1789 |
-
},
|
1790 |
-
});
|
1791 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1792 |
|
1793 |
-
|
1794 |
-
|
1795 |
-
|
1796 |
-
|
1797 |
-
|
1798 |
-
|
1799 |
-
|
1800 |
-
|
1801 |
-
|
1802 |
-
|
1803 |
-
|
1804 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1805 |
};//_doUpdateWithRequestedAction
|
1806 |
-
|
1807 |
-
// if the changed input is a google font modifier ( <=> font_family_css input)
|
1808 |
-
// => we want to first refresh the google font collection, and then proceed to the requested action
|
1809 |
-
// this way we make sure that the customized value used when ajaxing will take into account when writing the google font http request link
|
1810 |
if ( true === refresh_fonts ) {
|
1811 |
-
var
|
1812 |
-
if ( 'font_family_css' != params.settingParams.args.input_changed ) {
|
1813 |
-
api.errare( 'updateAPISettingAndExecutePreviewActions => Error when refreshing fonts => the input id is not font_family_css', params );
|
1814 |
-
return;
|
1815 |
-
} else {
|
1816 |
-
return params.settingParams.args.input_value;
|
1817 |
-
}
|
1818 |
-
};
|
1819 |
-
var newFontFamily = '';
|
1820 |
-
try { newFontFamily = _getChangedFontFamily(); } catch( er) {
|
1821 |
-
api.errare( 'updateAPISettingAndExecutePreviewActions => Error when refreshing fonts', er );
|
1822 |
-
return;
|
1823 |
-
}
|
1824 |
if ( ! _.isString( newFontFamily ) ) {
|
1825 |
-
api.errare( 'updateAPISettingAndExecutePreviewActions => font-family must be a string',
|
1826 |
return;
|
1827 |
}
|
1828 |
-
// add it only if gfont
|
1829 |
if ( newFontFamily.indexOf('gfont') > -1 ) {
|
1830 |
self.updateAPISetting({
|
1831 |
action : 'sek-update-fonts',
|
1832 |
font_family : newFontFamily
|
1833 |
-
})
|
|
|
1834 |
_doUpdateWithRequestedAction().then( function() {
|
1835 |
-
// always refresh again after
|
1836 |
-
// Why ?
|
1837 |
-
// Because the first refresh was done before actually setting the new font family, so based on a previous set of fonts
|
1838 |
-
// which leads to have potentially an additional google fonts that we don't need after the first refresh
|
1839 |
-
// that's why this second refresh is required. It wont trigger any preview ajax actions. Simply refresh the root fonts property of the main api setting.
|
1840 |
self.updateAPISetting({ action : 'sek-update-fonts' } );
|
1841 |
});
|
1842 |
});
|
@@ -1847,33 +1340,30 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
1847 |
_doUpdateWithRequestedAction();
|
1848 |
}
|
1849 |
},//updateAPISettingAndExecutePreviewActions
|
1850 |
-
|
1851 |
-
|
1852 |
-
|
1853 |
-
|
1854 |
-
|
1855 |
-
|
1856 |
-
|
1857 |
-
|
1858 |
-
|
1859 |
-
|
1860 |
-
|
1861 |
-
|
1862 |
-
// @return a normalized and sanitized item value
|
1863 |
normalizeAndSanitizeSingleItemInputValues : function( _item_, parentModuleType ) {
|
1864 |
var itemNormalized = {},
|
1865 |
itemNormalizedAndSanitized = {},
|
1866 |
inputDefaultValue = null,
|
1867 |
inputType = null,
|
1868 |
sanitizedVal,
|
1869 |
-
self = this
|
1870 |
-
|
1871 |
-
|
1872 |
-
|
1873 |
-
|
1874 |
-
|
1875 |
-
|
1876 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1877 |
_.each( _item_, function( _val, input_id ) {
|
1878 |
if ( _.contains( ['title', 'id' ], input_id ) )
|
1879 |
return;
|
@@ -1884,17 +1374,13 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
1884 |
api.infoLog( '::updateAPISettingAndExecutePreviewActions => missing default value for input ' + input_id + ' in module ' + parentModuleType );
|
1885 |
}
|
1886 |
}
|
1887 |
-
if ( _val
|
1888 |
return;
|
1889 |
} else {
|
1890 |
itemNormalized[ input_id ] = _val;
|
1891 |
}
|
1892 |
});
|
1893 |
-
|
1894 |
-
// SANITIZE
|
1895 |
_.each( itemNormalized, function( _val, input_id ) {
|
1896 |
-
// @see extend_api_base.js
|
1897 |
-
// @see sektions::_7_0_sektions_add_inputs_to_api.js
|
1898 |
switch( self.getInputType( input_id, parentModuleType ) ) {
|
1899 |
case 'text' :
|
1900 |
case 'textarea' :
|
@@ -1934,34 +1420,16 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
1934 |
});
|
1935 |
return itemNormalizedAndSanitized;
|
1936 |
},
|
1937 |
-
|
1938 |
-
|
1939 |
-
|
1940 |
-
|
1941 |
-
|
1942 |
-
|
1943 |
-
|
1944 |
-
|
1945 |
-
|
1946 |
-
|
1947 |
-
|
1948 |
-
// Is the UI currently displayed the one that is being requested ?
|
1949 |
-
// If so, don't generate the ui again
|
1950 |
-
// @return bool
|
1951 |
isUIControlAlreadyRegistered : function( uiElementId ) {
|
1952 |
var self = this,
|
1953 |
uiCandidate = _.filter( self.registered(), function( registered ) {
|
1954 |
return registered.id == uiElementId && 'control' === registered.what;
|
1955 |
}),
|
1956 |
controlIsAlreadyRegistered = false;
|
1957 |
-
|
1958 |
-
// If the control is not been tracked in our self.registered(), let's check if it is registered in the api
|
1959 |
-
// Typically, the module / section picker will match that case, because we don't keep track of it ( so it's not cleaned )
|
1960 |
if ( _.isEmpty( uiCandidate ) ) {
|
1961 |
controlIsAlreadyRegistered = api.control.has( uiElementId );
|
1962 |
} else {
|
1963 |
controlIsAlreadyRegistered = true;
|
1964 |
-
// we should have only one uiCandidate with this very id
|
1965 |
if ( uiCandidate.length > 1 ) {
|
1966 |
api.errare( 'generateUI => why is this control registered more than once ? => ' + uiElementId );
|
1967 |
}
|
@@ -1969,95 +1437,819 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
1969 |
return controlIsAlreadyRegistered;
|
1970 |
}
|
1971 |
});//$.extend()
|
1972 |
-
})( wp.customize, jQuery );//global sektionsLocalizedData
|
1973 |
var CZRSeksPrototype = CZRSeksPrototype || {};
|
1974 |
(function ( api, $ ) {
|
1975 |
$.extend( CZRSeksPrototype, {
|
1976 |
-
|
1977 |
-
|
1978 |
-
|
1979 |
-
|
1980 |
-
|
1981 |
-
|
1982 |
-
|
1983 |
-
|
1984 |
-
|
1985 |
-
|
1986 |
-
|
1987 |
-
|
1988 |
-
|
1989 |
-
|
1990 |
-
|
1991 |
-
|
1992 |
-
|
1993 |
-
|
1994 |
-
|
1995 |
-
|
1996 |
-
// }
|
1997 |
-
var currentSetValue = sektionSetInstance(),
|
1998 |
-
newSetValue = _.isObject( currentSetValue ) ? $.extend( true, {}, currentSetValue ) : self.defaultSektionSettingValue,
|
1999 |
-
locationCandidate,
|
2000 |
-
sektionCandidate,
|
2001 |
-
columnCandidate,
|
2002 |
-
moduleCandidate,
|
2003 |
-
// move variables
|
2004 |
-
originalCollection,
|
2005 |
-
reorderedCollection,
|
2006 |
-
//duplication variable
|
2007 |
-
cloneId, //will be passed in resolve()
|
2008 |
-
startingModuleValue;// will be populated by the optional starting value specificied on module registration
|
2009 |
-
|
2010 |
-
// make sure we have a collection array to populate
|
2011 |
-
newSetValue.collection = _.isArray( newSetValue.collection ) ? newSetValue.collection : self.defaultSektionSettingValue.collection;
|
2012 |
|
2013 |
-
|
2014 |
-
|
2015 |
-
|
2016 |
-
|
2017 |
-
|
2018 |
-
|
2019 |
-
|
2020 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022 |
|
2023 |
-
|
2024 |
-
|
2025 |
-
|
2026 |
-
|
2027 |
-
|
2028 |
-
|
2029 |
-
|
2030 |
-
|
2031 |
-
|
2032 |
-
|
2033 |
-
|
2034 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2035 |
}
|
2036 |
-
|
2037 |
-
|
2038 |
-
|
|
|
2039 |
}
|
2040 |
-
if ( '
|
2041 |
-
|
2042 |
-
|
2043 |
-
|
|
|
|
|
|
|
|
|
|
|
2044 |
}
|
2045 |
-
|
2046 |
-
|
2047 |
-
|
2048 |
-
|
2049 |
-
|
2050 |
-
|
2051 |
-
|
2052 |
-
|
2053 |
-
|
2054 |
-
|
2055 |
-
|
2056 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2057 |
locationCandidate = self.getLevelModel( params.location, newSetValue.collection );
|
2058 |
if ( 'no_match' == locationCandidate ) {
|
2059 |
api.errare( 'updateAPISetting => ' + params.action + ' => no location matched' );
|
2060 |
-
|
2061 |
break;
|
2062 |
}
|
2063 |
locationCandidate.collection = _.isArray( locationCandidate.collection ) ? locationCandidate.collection : [];
|
@@ -2069,26 +2261,23 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
2069 |
position = index + 1;
|
2070 |
}
|
2071 |
});
|
2072 |
-
|
2073 |
-
// @see reactToCollectionSettingIdChange
|
2074 |
locationCandidate.collection = _.isArray( locationCandidate.collection ) ? locationCandidate.collection : [];
|
2075 |
-
// insert the section in the collection at the right place
|
2076 |
locationCandidate.collection.splice( position, 0, {
|
2077 |
id : params.id,
|
2078 |
level : 'section',
|
2079 |
collection : [{
|
2080 |
id : sektionsLocalizedData.optPrefixForSektionsNotSaved + self.guid(),
|
2081 |
level : 'column',
|
2082 |
-
collection : []
|
2083 |
-
|
|
|
|
|
2084 |
});
|
2085 |
}
|
2086 |
break;
|
2087 |
|
2088 |
|
2089 |
case 'sek-duplicate-section' :
|
2090 |
-
//console.log('PARAMS IN sek-duplicate-section', params );
|
2091 |
-
// an id must be provided
|
2092 |
if ( _.isEmpty( params.id ) ) {
|
2093 |
throw new Error( 'updateAPISetting => ' + params.action + ' => missing id' );
|
2094 |
}
|
@@ -2103,13 +2292,11 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
2103 |
}
|
2104 |
|
2105 |
var _position_ = self.getLevelPositionInCollection( params.id, newSetValue.collection );
|
2106 |
-
//console.log('_position_ ', _position_ );
|
2107 |
-
// Is this a nested sektion ?
|
2108 |
if ( true === params.is_nested ) {
|
2109 |
columnCandidate = self.getLevelModel( params.in_column, newSetValue.collection );
|
2110 |
if ( 'no_match' == columnCandidate ) {
|
2111 |
api.errare( 'updateAPISetting => ' + params.action + ' => no parent column matched' );
|
2112 |
-
|
2113 |
break;
|
2114 |
}
|
2115 |
|
@@ -2121,21 +2308,16 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
2121 |
locationCandidate = self.getLevelModel( params.location, newSetValue.collection );
|
2122 |
if ( 'no_match' == locationCandidate ) {
|
2123 |
api.errare( 'updateAPISetting => ' + params.action + ' => no location matched' );
|
2124 |
-
|
2125 |
break;
|
2126 |
}
|
2127 |
locationCandidate.collection = _.isArray( locationCandidate.collection ) ? locationCandidate.collection : [];
|
2128 |
-
// @see reactToCollectionSettingIdChange
|
2129 |
locationCandidate.collection.splice( parseInt( _position_ + 1, 10 ), 0, deepClonedSektion );
|
2130 |
|
2131 |
}
|
2132 |
cloneId = deepClonedSektion.id;//will be passed in resolve()
|
2133 |
break;
|
2134 |
-
|
2135 |
-
// in the case of a nested sektion, we have to remove it from a column
|
2136 |
-
// otherwise from the root sektion collection
|
2137 |
case 'sek-remove-section' :
|
2138 |
-
//console.log('PARAMS IN sek-remove-sektion', params );
|
2139 |
if ( true === params.is_nested ) {
|
2140 |
columnCandidate = self.getLevelModel( params.in_column, newSetValue.collection );
|
2141 |
if ( 'no_match' != columnCandidate ) {
|
@@ -2150,7 +2332,7 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
2150 |
locationCandidate = self.getLevelModel( params.location, newSetValue.collection );
|
2151 |
if ( 'no_match' == locationCandidate ) {
|
2152 |
api.errare( 'updateAPISetting => ' + params.action + ' => no location matched' );
|
2153 |
-
|
2154 |
break;
|
2155 |
}
|
2156 |
locationCandidate.collection = _.filter( locationCandidate.collection, function( sek ) {
|
@@ -2160,7 +2342,6 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
2160 |
break;
|
2161 |
|
2162 |
case 'sek-move-section' :
|
2163 |
-
//console.log('PARAMS in sek-move-section', params );
|
2164 |
var toLocationCandidate = self.getLevelModel( params.to_location, newSetValue.collection ),
|
2165 |
movedSektionCandidate,
|
2166 |
copyOfMovedSektionCandidate;
|
@@ -2168,33 +2349,23 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
2168 |
if ( _.isEmpty( toLocationCandidate ) || 'no_match' == toLocationCandidate ) {
|
2169 |
throw new Error( 'updateAPISetting => ' + params.action + ' => missing target location' );
|
2170 |
}
|
2171 |
-
|
2172 |
-
// MOVED CROSS LOCATIONS
|
2173 |
-
// - make a copy of the moved sektion
|
2174 |
-
// - remove the moved sektion from the source location
|
2175 |
if ( params.from_location != params.to_location ) {
|
2176 |
-
// Remove the moved sektion from the source location
|
2177 |
var fromLocationCandidate = self.getLevelModel( params.from_location, newSetValue.collection );
|
2178 |
if ( _.isEmpty( fromLocationCandidate ) || 'no_match' == fromLocationCandidate ) {
|
2179 |
throw new Error( 'updateAPISetting => ' + params.action + ' => missing source location' );
|
2180 |
}
|
2181 |
|
2182 |
fromLocationCandidate.collection = _.isArray( fromLocationCandidate.collection ) ? fromLocationCandidate.collection : [];
|
2183 |
-
// Make a copy of the sektion candidate now, before removing it
|
2184 |
movedSektionCandidate = self.getLevelModel( params.id, fromLocationCandidate.collection );
|
2185 |
copyOfMovedSektionCandidate = $.extend( true, {}, movedSektionCandidate );
|
2186 |
-
// remove the sektion from its previous sektion
|
2187 |
fromLocationCandidate.collection = _.filter( fromLocationCandidate.collection, function( sektion ) {
|
2188 |
return sektion.id != params.id;
|
2189 |
});
|
2190 |
}
|
2191 |
-
|
2192 |
-
// UPDATE THE TARGET LOCATION
|
2193 |
toLocationCandidate.collection = _.isArray( toLocationCandidate.collection ) ? toLocationCandidate.collection : [];
|
2194 |
originalCollection = $.extend( true, [], toLocationCandidate.collection );
|
2195 |
reorderedCollection = [];
|
2196 |
_.each( params.newOrder, function( _id_ ) {
|
2197 |
-
// in the case of a cross location movement, we need to add the moved sektion to the target location
|
2198 |
if ( params.from_location != params.to_location && _id_ == copyOfMovedSektionCandidate.id ) {
|
2199 |
reorderedCollection.push( copyOfMovedSektionCandidate );
|
2200 |
} else {
|
@@ -2208,47 +2379,30 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
2208 |
toLocationCandidate.collection = reorderedCollection;
|
2209 |
|
2210 |
break;
|
2211 |
-
|
2212 |
-
|
2213 |
-
|
2214 |
-
|
2215 |
-
|
2216 |
-
|
2217 |
-
|
2218 |
-
|
2219 |
-
|
2220 |
-
|
2221 |
-
|
2222 |
-
//-------------------------------------------------------------------------------------------------
|
2223 |
-
//-- COLUMN
|
2224 |
-
//-------------------------------------------------------------------------------------------------
|
2225 |
case 'sek-add-column' :
|
2226 |
-
// an id must be provided
|
2227 |
if ( _.isEmpty( params.id ) ) {
|
2228 |
throw new Error( 'updateAPISetting => ' + params.action + ' => missing id' );
|
2229 |
}
|
2230 |
sektionCandidate = self.getLevelModel( params.in_sektion, newSetValue.collection );
|
2231 |
if ( 'no_match' == sektionCandidate ) {
|
2232 |
api.errare( 'updateAPISetting => ' + params.action + ' => no parent sektion matched' );
|
2233 |
-
|
2234 |
break;
|
2235 |
}
|
2236 |
|
2237 |
sektionCandidate.collection = _.isArray( sektionCandidate.collection ) ? sektionCandidate.collection : [];
|
2238 |
-
// can we add another column ?
|
2239 |
if ( ( self.MAX_NUMBER_OF_COLUMNS - 1 ) < _.size( sektionCandidate.collection ) ) {
|
2240 |
-
|
2241 |
break;
|
2242 |
}
|
2243 |
-
|
2244 |
-
// RESET ALL COLUMNS WIDTH
|
2245 |
_.each( sektionCandidate.collection, function( colModel ) {
|
2246 |
colModel.width = '';
|
2247 |
});
|
2248 |
sektionCandidate.collection.push({
|
2249 |
id : params.id,
|
2250 |
level : 'column',
|
2251 |
-
collection : []
|
|
|
2252 |
});
|
2253 |
break;
|
2254 |
|
@@ -2256,16 +2410,14 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
2256 |
case 'sek-remove-column' :
|
2257 |
sektionCandidate = self.getLevelModel( params.in_sektion, newSetValue.collection );
|
2258 |
if ( 'no_match' != sektionCandidate ) {
|
2259 |
-
// can we remove the column ?
|
2260 |
if ( 1 === _.size( sektionCandidate.collection ) ) {
|
2261 |
-
|
2262 |
break;
|
2263 |
}
|
2264 |
sektionCandidate.collection = _.isArray( sektionCandidate.collection ) ? sektionCandidate.collection : [];
|
2265 |
sektionCandidate.collection = _.filter( sektionCandidate.collection, function( column ) {
|
2266 |
return column.id != params.id;
|
2267 |
});
|
2268 |
-
// RESET ALL COLUMNS WIDTH
|
2269 |
_.each( sektionCandidate.collection, function( colModel ) {
|
2270 |
colModel.width = '';
|
2271 |
});
|
@@ -2276,7 +2428,6 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
2276 |
break;
|
2277 |
|
2278 |
case 'sek-duplicate-column' :
|
2279 |
-
// an id must be provided
|
2280 |
if ( _.isEmpty( params.id ) ) {
|
2281 |
throw new Error( 'updateAPISetting => ' + params.action + ' => missing id' );
|
2282 |
}
|
@@ -2284,14 +2435,13 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
2284 |
sektionCandidate = self.getLevelModel( params.in_sektion, newSetValue.collection );
|
2285 |
if ( 'no_match' == sektionCandidate ) {
|
2286 |
api.errare( 'updateAPISetting => ' + params.action + ' => no parent sektion matched' );
|
2287 |
-
|
2288 |
break;
|
2289 |
}
|
2290 |
|
2291 |
sektionCandidate.collection = _.isArray( sektionCandidate.collection ) ? sektionCandidate.collection : [];
|
2292 |
-
// can we add another column ?
|
2293 |
if ( ( self.MAX_NUMBER_OF_COLUMNS - 1 ) < _.size( sektionCandidate.collection ) ) {
|
2294 |
-
|
2295 |
break;
|
2296 |
}
|
2297 |
|
@@ -2303,34 +2453,23 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
2303 |
var _position = self.getLevelPositionInCollection( params.id, newSetValue.collection );
|
2304 |
cloneId = deepClonedColumn.id;//will be passed in resolve()
|
2305 |
sektionCandidate.collection.splice( parseInt( _position + 1, 10 ), 0, deepClonedColumn );
|
2306 |
-
// RESET ALL COLUMNS WIDTH
|
2307 |
_.each( sektionCandidate.collection, function( colModel ) {
|
2308 |
colModel.width = '';
|
2309 |
});
|
2310 |
break;
|
2311 |
-
|
2312 |
-
|
2313 |
-
|
2314 |
case 'sek-resize-columns' :
|
2315 |
if ( params.col_number < 2 )
|
2316 |
break;
|
2317 |
|
2318 |
var resizedColumn = self.getLevelModel( params.resized_column, newSetValue.collection ),
|
2319 |
sistercolumn = self.getLevelModel( params.sister_column, newSetValue.collection );
|
2320 |
-
|
2321 |
-
//console.log( 'updateAPISetting => ' + params.action + ' => ', params );
|
2322 |
-
|
2323 |
-
// SET RESIZED COLUMN WIDTH
|
2324 |
if ( 'no_match' == resizedColumn ) {
|
2325 |
api.errare( 'updateAPISetting => ' + params.action + ' => no resized column matched' );
|
2326 |
-
|
2327 |
break;
|
2328 |
}
|
2329 |
|
2330 |
resizedColumn.width = parseFloat( params.resizedColumnWidthInPercent );
|
2331 |
-
|
2332 |
-
|
2333 |
-
// SET OTHER COLUMNS WIDTH
|
2334 |
var parentSektion = self.getLevelModel( params.in_sektion, newSetValue.collection );
|
2335 |
var otherColumns = _.filter( parentSektion.collection, function( _col_ ) {
|
2336 |
return _col_.id != resizedColumn.id && _col_.id != sistercolumn.id;
|
@@ -2343,25 +2482,10 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
2343 |
if ( ! _.has( colModel, 'width') || ! _.isNumber( currentColWidth * 1 ) || _.isEmpty( currentColWidth + '' ) || 1 > currentColWidth ) {
|
2344 |
colModel.width = parseFloat( ( 100 / params.col_number ).toFixed(3) );
|
2345 |
}
|
2346 |
-
// sum up all other column's width, excluding the resized and sister one.
|
2347 |
otherColumnsWidth = parseFloat( ( otherColumnsWidth + colModel.width ).toFixed(3) );
|
2348 |
});
|
2349 |
}
|
2350 |
-
|
2351 |
-
|
2352 |
-
// SET SISTER COLUMN WIDTH
|
2353 |
-
|
2354 |
-
// sum up all other column's width, excluding the resized and sister one.
|
2355 |
-
// console.log( "resizedColumn.width", resizedColumn.width );
|
2356 |
-
// console.log( "otherColumns", otherColumns );
|
2357 |
-
|
2358 |
-
// then calculate the sistercolumn so we are sure that we feel the entire space of the sektion
|
2359 |
sistercolumn.width = parseFloat( ( 100 - otherColumnsWidth ).toFixed(3) );
|
2360 |
-
|
2361 |
-
// console.log('otherColumnsWidth', otherColumnsWidth );
|
2362 |
-
// console.log("sistercolumn.width", sistercolumn.width );
|
2363 |
-
// console.log( "sistercolumn.width + otherColumnsWidth" , Number( sistercolumn.width ) + Number( otherColumnsWidth ) );
|
2364 |
-
//console.log('COLLECTION AFTER UPDATE ', parentSektion.collection );
|
2365 |
break;
|
2366 |
|
2367 |
|
@@ -2377,32 +2501,25 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
2377 |
}
|
2378 |
|
2379 |
if ( params.from_sektion != params.to_sektion ) {
|
2380 |
-
// Remove the moved column from the source sektion
|
2381 |
var fromSektionCandidate = self.getLevelModel( params.from_sektion, newSetValue.collection );
|
2382 |
if ( _.isEmpty( fromSektionCandidate ) || 'no_match' == fromSektionCandidate ) {
|
2383 |
throw new Error( 'updateAPISetting => ' + params.action + ' => missing source column' );
|
2384 |
}
|
2385 |
|
2386 |
fromSektionCandidate.collection = _.isArray( fromSektionCandidate.collection ) ? fromSektionCandidate.collection : [];
|
2387 |
-
// Make a copy of the column candidate now, before removing it
|
2388 |
movedColumnCandidate = self.getLevelModel( params.id, fromSektionCandidate.collection );
|
2389 |
copyOfMovedColumnCandidate = $.extend( true, {}, movedColumnCandidate );
|
2390 |
-
// remove the column from its previous sektion
|
2391 |
fromSektionCandidate.collection = _.filter( fromSektionCandidate.collection, function( column ) {
|
2392 |
return column.id != params.id;
|
2393 |
});
|
2394 |
-
// Reset the column's width in the target sektion
|
2395 |
_.each( fromSektionCandidate.collection, function( colModel ) {
|
2396 |
colModel.width = '';
|
2397 |
});
|
2398 |
}
|
2399 |
-
|
2400 |
-
// update the target sektion
|
2401 |
toSektionCandidate.collection = _.isArray( toSektionCandidate.collection ) ? toSektionCandidate.collection : [];
|
2402 |
originalCollection = $.extend( true, [], toSektionCandidate.collection );
|
2403 |
reorderedCollection = [];
|
2404 |
_.each( params.newOrder, function( _id_ ) {
|
2405 |
-
// in the case of a cross sektion movement, we need to add the moved column to the target sektion
|
2406 |
if ( params.from_sektion != params.to_sektion && _id_ == copyOfMovedColumnCandidate.id ) {
|
2407 |
reorderedCollection.push( copyOfMovedColumnCandidate );
|
2408 |
} else {
|
@@ -2414,47 +2531,27 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
2414 |
}
|
2415 |
});
|
2416 |
toSektionCandidate.collection = reorderedCollection;
|
2417 |
-
|
2418 |
-
// Reset the column's width in the target sektion
|
2419 |
_.each( toSektionCandidate.collection, function( colModel ) {
|
2420 |
colModel.width = '';
|
2421 |
});
|
2422 |
|
2423 |
break;
|
2424 |
-
|
2425 |
-
|
2426 |
-
|
2427 |
-
|
2428 |
-
|
2429 |
-
|
2430 |
-
|
2431 |
-
|
2432 |
-
|
2433 |
-
|
2434 |
-
|
2435 |
-
|
2436 |
-
//-------------------------------------------------------------------------------------------------
|
2437 |
-
//-- MODULE
|
2438 |
-
//-------------------------------------------------------------------------------------------------
|
2439 |
case 'sek-add-module' :
|
2440 |
-
// an id must be provided
|
2441 |
if ( _.isEmpty( params.id ) ) {
|
2442 |
throw new Error( 'updateAPISetting => ' + params.action + ' => missing id' );
|
2443 |
}
|
2444 |
-
// a module_type must be provided
|
2445 |
if ( _.isEmpty( params.module_type ) ) {
|
2446 |
throw new Error( 'updateAPISetting => ' + params.action + ' => missing module_type' );
|
2447 |
}
|
2448 |
columnCandidate = self.getLevelModel( params.in_column, newSetValue.collection );
|
2449 |
if ( 'no_match' === columnCandidate ) {
|
2450 |
api.errare( 'updateAPISetting => ' + params.action + ' => no parent column matched' );
|
2451 |
-
|
2452 |
break;
|
2453 |
}
|
2454 |
|
2455 |
var position = 0;
|
2456 |
columnCandidate.collection = _.isArray( columnCandidate.collection ) ? columnCandidate.collection : [];
|
2457 |
-
// get the position of the before or after module
|
2458 |
_.each( columnCandidate.collection, function( moduleModel, index ) {
|
2459 |
if ( params.before_module === moduleModel.id ) {
|
2460 |
position = index;
|
@@ -2467,9 +2564,9 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
2467 |
var _moduleParams = {
|
2468 |
id : params.id,
|
2469 |
level : 'module',
|
2470 |
-
module_type : params.module_type
|
|
|
2471 |
};
|
2472 |
-
// Let's add the starting value if provided when registrating the module
|
2473 |
startingModuleValue = self.getModuleStartingValue( params.module_type );
|
2474 |
if ( 'no_starting_value' !== startingModuleValue ) {
|
2475 |
_moduleParams.value = startingModuleValue;
|
@@ -2479,14 +2576,13 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
2479 |
break;
|
2480 |
|
2481 |
case 'sek-duplicate-module' :
|
2482 |
-
// an id must be provided
|
2483 |
if ( _.isEmpty( params.id ) ) {
|
2484 |
throw new Error( 'updateAPISetting => ' + params.action + ' => missing id' );
|
2485 |
}
|
2486 |
columnCandidate = self.getLevelModel( params.in_column, newSetValue.collection );
|
2487 |
if ( 'no_match' == columnCandidate ) {
|
2488 |
api.errare( 'updateAPISetting => ' + params.action + ' => no parent column matched' );
|
2489 |
-
|
2490 |
break;
|
2491 |
}
|
2492 |
|
@@ -2495,7 +2591,7 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
2495 |
var deepClonedModule;
|
2496 |
try { deepClonedModule = self.cloneLevel( params.id ); } catch( er ) {
|
2497 |
api.errare( 'updateAPISetting => ' + params.action, er );
|
2498 |
-
|
2499 |
break;
|
2500 |
}
|
2501 |
var insertInposition = self.getLevelPositionInCollection( params.id, newSetValue.collection );
|
@@ -2505,7 +2601,6 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
2505 |
break;
|
2506 |
|
2507 |
case 'sek-remove-module' :
|
2508 |
-
// an id must be provided
|
2509 |
if ( _.isEmpty( params.id ) ) {
|
2510 |
throw new Error( 'updateAPISetting => ' + params.action + ' => missing id' );
|
2511 |
}
|
@@ -2525,23 +2620,11 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
2525 |
var toColumnCandidate,
|
2526 |
movedModuleCandidate,
|
2527 |
copyOfMovedModuleCandidate;
|
2528 |
-
|
2529 |
-
// loop on the sektions to find the toColumnCandidate
|
2530 |
-
// _.each( newSetValue.collection, function( _sektion_ ) {
|
2531 |
-
// _.each( _sektion_.collection, function( _column_ ) {
|
2532 |
-
// if ( _column_.id == params.to_column ) {
|
2533 |
-
// toColumnCandidate = _column_;
|
2534 |
-
// }
|
2535 |
-
// });
|
2536 |
-
// });
|
2537 |
toColumnCandidate = self.getLevelModel( params.to_column, newSetValue.collection );
|
2538 |
|
2539 |
if ( _.isEmpty( toColumnCandidate ) || 'no_match' == toColumnCandidate ) {
|
2540 |
throw new Error( 'updateAPISetting => ' + params.action + ' => missing target column' );
|
2541 |
}
|
2542 |
-
|
2543 |
-
// If the module has been moved to another column
|
2544 |
-
// => remove the moved module from the source column
|
2545 |
if ( params.from_column != params.to_column ) {
|
2546 |
var fromColumnCandidate;
|
2547 |
fromColumnCandidate = self.getLevelModel( params.from_column, newSetValue.collection );
|
@@ -2551,16 +2634,12 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
2551 |
}
|
2552 |
|
2553 |
fromColumnCandidate.collection = _.isArray( fromColumnCandidate.collection ) ? fromColumnCandidate.collection : [];
|
2554 |
-
// Make a copy of the module candidate now, before removing it
|
2555 |
movedModuleCandidate = self.getLevelModel( params.id, newSetValue.collection );
|
2556 |
copyOfMovedModuleCandidate = $.extend( true, {}, movedModuleCandidate );
|
2557 |
-
// remove the module from its previous column
|
2558 |
fromColumnCandidate.collection = _.filter( fromColumnCandidate.collection, function( module ) {
|
2559 |
return module.id != params.id;
|
2560 |
});
|
2561 |
}// if params.from_column != params.to_column
|
2562 |
-
|
2563 |
-
// update the target column
|
2564 |
toColumnCandidate.collection = _.isArray( toColumnCandidate.collection ) ? toColumnCandidate.collection : [];
|
2565 |
originalCollection = $.extend( true, [], toColumnCandidate.collection );
|
2566 |
reorderedCollection = [];
|
@@ -2575,7 +2654,6 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
2575 |
reorderedCollection.push( moduleCandidate );
|
2576 |
}
|
2577 |
});
|
2578 |
-
// Check if we have duplicates ?
|
2579 |
if ( reorderedCollection.length != _.uniq( reorderedCollection ).length ) {
|
2580 |
throw new Error( 'updateAPISetting => ' + params.action + ' => there are duplicated modules in column : ' + toColumnCandidate.id );
|
2581 |
} else {
|
@@ -2586,47 +2664,41 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
2586 |
|
2587 |
case 'sek-set-module-value' :
|
2588 |
moduleCandidate = self.getLevelModel( params.id, newSetValue.collection );
|
|
|
2589 |
var _value_ = {};
|
2590 |
-
// consider only the non empty settings for db
|
2591 |
-
// booleans should bypass this check
|
2592 |
_.each( params.value || {}, function( _val_, _key_ ) {
|
2593 |
-
// Note : _.isEmpty( 5 ) returns true when checking an integer,
|
2594 |
-
// that's why we need to cast the _val_ to a string when using _.isEmpty()
|
2595 |
if ( ! _.isBoolean( _val_ ) && _.isEmpty( _val_ + "" ) )
|
2596 |
return;
|
2597 |
_value_[ _key_ ] = _val_;
|
2598 |
});
|
2599 |
if ( 'no_match' == moduleCandidate ) {
|
2600 |
api.errare( 'updateAPISetting => ' + params.action + ' => no module matched', params );
|
2601 |
-
|
2602 |
break;
|
2603 |
}
|
2604 |
-
|
2605 |
-
|
2606 |
-
|
2607 |
-
|
2608 |
-
|
2609 |
-
|
2610 |
-
|
|
|
|
|
|
|
|
|
2611 |
|
2612 |
-
|
2613 |
-
|
2614 |
-
//-------------------------------------------------------------------------------------------------
|
2615 |
-
case 'sek-set-level-options' :
|
2616 |
var _candidate_ = self.getLevelModel( params.id, newSetValue.collection ),
|
2617 |
_valueCandidate = {};
|
2618 |
if ( 'no_match'=== _candidate_ ) {
|
2619 |
api.errare( 'updateAPISetting => ' + params.action + ' => no parent sektion matched' );
|
2620 |
-
|
2621 |
break;
|
2622 |
}
|
2623 |
_candidate_.options = _candidate_.options || {};
|
2624 |
-
|
2625 |
-
// consider only the non empty settings for db
|
2626 |
-
// booleans should bypass this check
|
2627 |
_.each( params.value || {}, function( _val_, _key_ ) {
|
2628 |
-
// Note : _.isEmpty( 5 ) returns true when checking an integer,
|
2629 |
-
// that's why we need to cast the _val_ to a string when using _.isEmpty()
|
2630 |
if ( ! _.isBoolean( _val_ ) && _.isEmpty( _val_ + "" ) )
|
2631 |
return;
|
2632 |
_valueCandidate[ _key_ ] = _val_;
|
@@ -2634,57 +2706,34 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
2634 |
if ( _.isEmpty( params.options_type ) ) {
|
2635 |
api.errare( 'updateAPISetting => ' + params.action + ' => missing options_type');
|
2636 |
}
|
2637 |
-
|
2638 |
-
case 'layout' :
|
2639 |
-
_candidate_.options.layout = _valueCandidate;
|
2640 |
-
break;
|
2641 |
-
case 'bg_border' :
|
2642 |
-
_candidate_.options.bg_border = _valueCandidate;
|
2643 |
-
break;
|
2644 |
-
case 'height' :
|
2645 |
-
_candidate_.options.height = _valueCandidate;
|
2646 |
-
break;
|
2647 |
-
case 'spacing' :
|
2648 |
-
_candidate_.options.spacing = _valueCandidate;
|
2649 |
-
break;
|
2650 |
-
}
|
2651 |
break;
|
|
|
|
|
2652 |
|
2653 |
-
|
2654 |
-
|
2655 |
-
|
2656 |
-
|
2657 |
-
|
2658 |
-
|
2659 |
-
|
2660 |
-
|
2661 |
-
|
2662 |
-
|
2663 |
-
|
2664 |
-
|
2665 |
-
|
2666 |
-
|
2667 |
-
//-------------------------------------------------------------------------------------------------
|
2668 |
-
// @params {
|
2669 |
-
// drop_target_element : $(this),
|
2670 |
-
// position : _position,// <= top or bottom
|
2671 |
-
// before_section : $(this).data('sek-before-section'),
|
2672 |
-
// after_section : $(this).data('sek-after-section'),
|
2673 |
-
// content_type : event.originalEvent.dataTransfer.getData( "sek-content-type" ), //<= module or preset_section
|
2674 |
-
// content_id : event.originalEvent.dataTransfer.getData( "sek-content-id" )
|
2675 |
-
// }
|
2676 |
case 'sek-add-content-in-new-sektion' :
|
2677 |
-
// console.log('update API Setting => sek-add-content-in-new-sektion => PARAMS', params );
|
2678 |
-
// an id must be provided
|
2679 |
if ( _.isEmpty( params.id ) ) {
|
2680 |
throw new Error( 'updateAPISetting => ' + params.action + ' => missing id' );
|
2681 |
}
|
2682 |
-
|
2683 |
-
var position = 0;
|
2684 |
locationCandidate = self.getLevelModel( params.location, newSetValue.collection );
|
2685 |
if ( 'no_match' == locationCandidate ) {
|
2686 |
api.errare( 'updateAPISetting => ' + params.action + ' => no location matched' );
|
2687 |
-
|
2688 |
break;
|
2689 |
}
|
2690 |
locationCandidate.collection = _.isArray( locationCandidate.collection ) ? locationCandidate.collection : [];
|
@@ -2698,13 +2747,8 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
2698 |
});
|
2699 |
|
2700 |
switch( params.content_type) {
|
2701 |
-
// When a module is dropped in a section + column structure to be generated
|
2702 |
case 'module' :
|
2703 |
-
// Let's add the starting value if provided when registrating the module
|
2704 |
-
// Note : params.content_id is the module_type
|
2705 |
startingModuleValue = self.getModuleStartingValue( params.content_id );
|
2706 |
-
|
2707 |
-
// insert the section in the collection at the right place
|
2708 |
locationCandidate.collection.splice( position, 0, {
|
2709 |
id : params.id,
|
2710 |
level : 'section',
|
@@ -2721,321 +2765,318 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
2721 |
}
|
2722 |
]
|
2723 |
}
|
2724 |
-
]
|
|
|
2725 |
});
|
2726 |
break;
|
2727 |
-
|
2728 |
-
// When a preset section is dropped
|
2729 |
case 'preset_section' :
|
2730 |
-
|
2731 |
-
|
2732 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2733 |
presetSectionType : params.content_id,
|
2734 |
section_id : params.id//<= we need to use the section id already generated, and passed for ajax action @see ::reactToPreviewMsg, case "sek-add-section"
|
2735 |
-
})
|
2736 |
-
|
2737 |
-
|
2738 |
-
|
2739 |
-
|
2740 |
-
|
2741 |
-
|
2742 |
-
|
2743 |
-
|
2744 |
-
|
2745 |
-
|
2746 |
-
|
2747 |
break;
|
2748 |
}//switch( params.content_type)
|
2749 |
break;
|
|
|
|
|
|
|
|
|
2750 |
|
2751 |
-
|
2752 |
-
|
2753 |
-
|
2754 |
-
|
2755 |
-
|
2756 |
-
|
2757 |
-
|
2758 |
-
|
2759 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2760 |
case 'sek-update-fonts' :
|
2761 |
-
//console.log('PARAMS in sek-add-fonts', params );
|
2762 |
-
// Get the gfonts from the level options and modules values
|
2763 |
var currentGfonts = self.sniffGFonts();
|
2764 |
if ( ! _.isEmpty( params.font_family ) && _.isString( params.font_family ) && ! _.contains( currentGfonts, params.font_family ) ) {
|
2765 |
if ( params.font_family.indexOf('gfont') < 0 ) {
|
2766 |
api.errare( 'updateAPISetting => ' + params.action + ' => error => must be a google font, prefixed gfont' );
|
2767 |
-
|
2768 |
break;
|
2769 |
}
|
2770 |
currentGfonts.push( params.font_family );
|
2771 |
}
|
2772 |
-
// update the global gfonts collection
|
2773 |
-
// this is then used server side in Sek_Dyn_CSS_Handler::sek_get_gfont_print_candidates to build the Google Fonts request
|
2774 |
newSetValue.fonts = currentGfonts;
|
2775 |
break;
|
2776 |
}// switch
|
2777 |
-
|
2778 |
-
|
2779 |
-
|
2780 |
-
|
2781 |
-
|
2782 |
-
|
2783 |
-
|
2784 |
-
// if we did not already rejected the request, let's check if the setting object has actually been modified
|
2785 |
-
// at this point it should have been.
|
2786 |
-
if ( 'pending' == dfd.state() ) {
|
2787 |
-
//console.log('ALORS ?', currentSetValue, newSetValue );
|
2788 |
-
if ( _.isEqual( currentSetValue, newSetValue ) ) {
|
2789 |
-
dfd.reject( 'updateAPISetting => the new setting value is unchanged when firing action : ' + params.action );
|
2790 |
-
} else {
|
2791 |
-
if ( null !== self.validateSettingValue( newSetValue ) ) {
|
2792 |
-
sektionSetInstance( newSetValue, params );
|
2793 |
-
dfd.resolve( cloneId );// the cloneId is only needed in the duplication scenarii
|
2794 |
} else {
|
2795 |
-
|
|
|
|
|
|
|
|
|
|
|
2796 |
}
|
|
|
2797 |
|
2798 |
-
|
2799 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2800 |
}
|
2801 |
}
|
2802 |
});//api( self.sekCollectionSettingId(), function( sektionSetInstance ) {}
|
2803 |
-
return
|
2804 |
},//updateAPISetting
|
2805 |
-
|
2806 |
-
|
2807 |
-
// @return a JSON parsed string,
|
2808 |
-
// + guid() ids for each levels
|
2809 |
-
// ready for insertion
|
2810 |
-
//
|
2811 |
-
// @sectionParams : {
|
2812 |
-
// presetSectionType : params.content_id,
|
2813 |
-
// section_id : params.id
|
2814 |
-
// }
|
2815 |
-
// Why is the section_id provided ?
|
2816 |
-
// Because this id has been generated ::reactToPreviewMsg, case "sek-add-section", and is the identifier that we'll need when ajaxing ( $_POST['id'])
|
2817 |
getPresetSectionCollection : function( sectionParams ) {
|
2818 |
var self = this,
|
2819 |
-
|
2820 |
-
|
2821 |
-
|
2822 |
-
|
2823 |
-
|
2824 |
-
|
2825 |
-
|
2826 |
-
|
2827 |
-
|
2828 |
-
|
2829 |
-
|
2830 |
-
|
2831 |
-
|
2832 |
-
|
2833 |
-
|
2834 |
-
|
2835 |
-
_.each( collection, function( levelData ) {
|
2836 |
-
levelData.id = sektionsLocalizedData.optPrefixForSektionsNotSaved + self.guid();
|
2837 |
-
if ( _.isArray( levelData.collection ) ) {
|
2838 |
-
setIds( levelData.collection );
|
2839 |
-
}
|
2840 |
-
});
|
2841 |
-
return collection;
|
2842 |
-
};
|
2843 |
-
|
2844 |
-
// set the section id provided.
|
2845 |
-
presetCandidate.id = sectionParams.section_id;
|
2846 |
-
|
2847 |
-
// the other level's id have to be generated
|
2848 |
-
presetCandidate.collection = setIds( presetCandidate.collection );
|
2849 |
-
return presetCandidate;
|
2850 |
-
}
|
2851 |
-
});//$.extend()
|
2852 |
-
})( wp.customize, jQuery );//global sektionsLocalizedData
|
2853 |
-
var CZRSeksPrototype = CZRSeksPrototype || {};
|
2854 |
-
(function ( api, $ ) {
|
2855 |
-
$.extend( CZRSeksPrototype, {
|
2856 |
-
register : function( params ) {
|
2857 |
-
if ( ! _.has( params, 'id' ) ){
|
2858 |
-
api.errare( 'register => missing id ', params );
|
2859 |
-
return;
|
2860 |
-
}
|
2861 |
-
// For the UI elements that we want to track, a level property is needed
|
2862 |
-
// if ( false !== params.track && ! _.has( params, 'level' ) ){
|
2863 |
-
// api.errare( 'register => missing trackable level ', params );
|
2864 |
-
// return;
|
2865 |
-
// }
|
2866 |
-
|
2867 |
-
var __element__ = {}, defaults;
|
2868 |
-
|
2869 |
-
switch ( params.what ) {
|
2870 |
-
// Register only if not registered already
|
2871 |
-
// For example, when saved as draft in a changeset, the setting is already dynamically registered server side
|
2872 |
-
// => in this case, we only need to register the associated control
|
2873 |
-
// @params args { id : , value : , transport : , type : }
|
2874 |
-
case 'setting' :
|
2875 |
-
if ( api.has( params.id ) ) {
|
2876 |
-
//api.consoleLog( 'registerSetting => setting Id already registered : ' + params.id );
|
2877 |
-
return params;
|
2878 |
-
}
|
2879 |
-
defaults = $.extend( true, {}, api.Setting.prototype.defaults );
|
2880 |
-
var settingArgs = _.extend(
|
2881 |
-
defaults ,
|
2882 |
-
{
|
2883 |
-
dirty : ! _.isUndefined( params.dirty ) ? params.dirty : false,
|
2884 |
-
value : params.value || [],
|
2885 |
-
transport : params.transport || 'refresh',
|
2886 |
-
type : params.type || 'option'
|
2887 |
-
}
|
2888 |
-
);
|
2889 |
-
// assign the value sent from the server
|
2890 |
-
|
2891 |
-
|
2892 |
-
// console.log('registerDynamicModuleSettingControl => SETTING DATA ?', params.id, settingArgs);
|
2893 |
-
var SettingConstructor = api.settingConstructor[ settingArgs.type ] || api.Setting;
|
2894 |
-
try { api.add( new SettingConstructor( params.id, settingArgs.value, settingArgs ) ); } catch ( er ) {
|
2895 |
-
api.errare( 'czr_sektions::register => problem when adding a setting to the api', er );
|
2896 |
-
}
|
2897 |
-
break;
|
2898 |
-
|
2899 |
-
|
2900 |
-
case 'panel' :
|
2901 |
-
// Check if we have a correct section
|
2902 |
-
if ( ! _.has( params, 'id' ) ){
|
2903 |
-
throw new Error( 'registerPanel => missing panel id ');
|
2904 |
-
}
|
2905 |
-
|
2906 |
-
if ( api.section.has( params.id ) ) {
|
2907 |
-
//api.errare( 'registerPanel => ' + params.id + ' is already registered');
|
2908 |
-
break;
|
2909 |
-
}
|
2910 |
-
|
2911 |
-
defaults = $.extend( true, {}, api.Panel.prototype.defaults );
|
2912 |
-
var panelParams = _.extend(
|
2913 |
-
defaults , {
|
2914 |
-
id: params.id,
|
2915 |
-
title: params.title || params.id,
|
2916 |
-
priority: _.has( params, 'priority' ) ? params.priority : 0
|
2917 |
-
}
|
2918 |
-
);
|
2919 |
-
|
2920 |
-
var PanelConstructor = _.isObject( params.constructWith ) ? params.constructWith : api.Panel;
|
2921 |
-
panelParams = _.extend( { params: panelParams }, panelParams ); // Inclusion of params alias is for back-compat for custom panels that expect to augment this property.
|
2922 |
-
|
2923 |
-
try { __element__ = api.panel.add( new PanelConstructor( params.id, panelParams ) ); } catch ( er ) {
|
2924 |
-
api.errare( 'czr_sektions::register => problem when adding a panel to the api', er );
|
2925 |
-
}
|
2926 |
-
break;
|
2927 |
-
|
2928 |
-
|
2929 |
-
case 'section' :
|
2930 |
-
// MAYBE REGISTER THE SECTION
|
2931 |
-
// Check if we have a correct section
|
2932 |
-
if ( ! _.has( params, 'id' ) ){
|
2933 |
-
throw new Error( 'registerSection => missing section id ');
|
2934 |
}
|
2935 |
|
2936 |
-
|
2937 |
-
|
2938 |
-
|
2939 |
-
}
|
|
|
|
|
2940 |
|
2941 |
-
|
2942 |
-
|
2943 |
-
|
2944 |
-
content : '',
|
2945 |
-
id: params.id,
|
2946 |
-
title: params.title,
|
2947 |
-
panel: params.panel,
|
2948 |
-
priority: params.priority,
|
2949 |
-
description_hidden : false,
|
2950 |
-
customizeAction: sektionsLocalizedData.i18n['Customizing']
|
2951 |
-
}
|
2952 |
-
);
|
2953 |
|
2954 |
-
var SectionConstructor = ! _.isUndefined( params.constructWith ) ? params.constructWith : api.Section;
|
2955 |
-
sectionParams = _.extend( { params: sectionParams }, sectionParams ); // Inclusion of params alias is for back-compat for custom panels that expect to augment this property.
|
2956 |
-
try { __element__ = api.section.add( new SectionConstructor( params.id, sectionParams ) ); } catch ( er ) {
|
2957 |
-
api.errare( 'czr_sektions::register => problem when adding a section to the api', er );
|
2958 |
-
}
|
2959 |
-
break;
|
2960 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2961 |
|
2962 |
-
|
2963 |
-
|
2964 |
-
//api.errorLog( 'registerControl => ' + params.id + ' is already registered');
|
2965 |
-
break;
|
2966 |
}
|
2967 |
-
|
2968 |
-
|
2969 |
-
|
2970 |
-
//@see api.settings.controls,
|
2971 |
-
defaults = $.extend( true, {}, api.Control.prototype.defaults );
|
2972 |
-
var controlArgs = _.extend(
|
2973 |
-
defaults,
|
2974 |
-
{
|
2975 |
-
content : '',
|
2976 |
-
label : params.label || params.id,
|
2977 |
-
priority : params.priority,
|
2978 |
-
section : params.section,
|
2979 |
-
settings: params.settings,
|
2980 |
-
type : params.type, //'czr_module',
|
2981 |
-
module_type : params.module_type,
|
2982 |
-
input_attrs : params.input_attrs,//<= can be used with the builtin "button" type control
|
2983 |
-
sek_registration_params : params// <= used when refreshing a level for example
|
2984 |
-
}
|
2985 |
-
),
|
2986 |
-
ControlConstructor = api.controlConstructor[ controlArgs.type ] || api.Control,
|
2987 |
-
options;
|
2988 |
-
|
2989 |
-
options = _.extend( { params: controlArgs }, controlArgs ); // Inclusion of params alias is for back-compat for custom controls that expect to augment this property.
|
2990 |
-
try { __element__ = api.control.add( new ControlConstructor( params.id, options ) ); } catch ( er ) {
|
2991 |
-
api.errare( 'czr_sektions::register => problem when adding a control to the api', er );
|
2992 |
}
|
2993 |
-
|
2994 |
-
default :
|
2995 |
-
api.errorLog('invalid "what" when invoking the register() method');
|
2996 |
-
break;
|
2997 |
|
2998 |
-
|
2999 |
-
|
3000 |
-
|
3001 |
-
|
3002 |
-
|
3003 |
-
|
3004 |
-
|
3005 |
-
|
3006 |
-
|
3007 |
-
if ( ! _.isEmpty( duplicateCandidate ) && _.isEqual( duplicateCandidate, params ) ) {
|
3008 |
-
throw new Error( 'register => duplicated element in self.registered() collection ' + params.id );
|
3009 |
-
}
|
3010 |
-
newRegistered.push( params );
|
3011 |
-
this.registered( newRegistered );
|
3012 |
-
|
3013 |
-
// say it
|
3014 |
-
//this.trigger( [params.what, params.id , 'registered' ].join('__'), params );
|
3015 |
-
}
|
3016 |
|
3017 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3018 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3019 |
|
3020 |
-
|
3021 |
-
|
3022 |
-
|
3023 |
-
|
3024 |
-
|
|
|
|
|
|
|
3025 |
var self = this,
|
3026 |
registered = $.extend( true, [], self.registered() || [] );
|
3027 |
|
3028 |
registered = _.filter( registered, function( _reg_ ) {
|
3029 |
if ( 'setting' !== _reg_.what ) {
|
3030 |
if ( api[ _reg_.what ].has( _reg_.id ) ) {
|
3031 |
-
|
|
|
3032 |
if ( _.isFunction( api[ _reg_.what ]( _reg_.id ).trigger ) ) {//<= Section and Panel constructor are not extended with the Event class, that's why we check if this method exists
|
3033 |
self.trigger( 'sek-ui-pre-removal', { what : _reg_.what, id : _reg_.id } );
|
3034 |
}
|
3035 |
$.when( api[ _reg_.what ]( _reg_.id ).container.remove() ).done( function() {
|
3036 |
-
// remove control, section, panel
|
3037 |
api[ _reg_.what ].remove( _reg_.id );
|
3038 |
-
// useful event, used to destroy the $ drop plugin instance for the section / module picker
|
3039 |
self.trigger( 'sek-ui-removed', { what : _reg_.what, id : _reg_.id } );
|
3040 |
});
|
3041 |
}
|
@@ -3043,6 +3084,20 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
3043 |
return _reg_.what === 'setting';
|
3044 |
});
|
3045 |
self.registered( registered );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3046 |
}
|
3047 |
|
3048 |
});//$.extend()
|
@@ -3050,9 +3105,7 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
3050 |
var CZRSeksPrototype = CZRSeksPrototype || {};
|
3051 |
(function ( api, $ ) {
|
3052 |
$.extend( CZRSeksPrototype, {
|
3053 |
-
// @eturn void()
|
3054 |
rootPanelFocus : function() {
|
3055 |
-
//close everything
|
3056 |
if ( api.section.has( api.czr_activeSectionId() ) ) {
|
3057 |
api.section( api.czr_activeSectionId() ).expanded( false );
|
3058 |
} else {
|
@@ -3064,31 +3117,22 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
3064 |
_p.expanded( false );
|
3065 |
});
|
3066 |
},
|
3067 |
-
|
3068 |
-
//@return a 24 digits global unique identifier
|
3069 |
guid : function() {
|
3070 |
function s4() {
|
3071 |
return Math.floor((1 + Math.random()) * 0x10000)
|
3072 |
.toString(16)
|
3073 |
.substring(1);
|
3074 |
}
|
3075 |
-
return s4() + s4() + s4() + s4() + s4() + s4();
|
3076 |
},
|
3077 |
-
|
3078 |
-
// @params = { id : '', level : '' }
|
3079 |
-
// Recursively walk the level tree until a match is found
|
3080 |
-
// @return the level model object
|
3081 |
getLevelModel : function( id, collection ) {
|
3082 |
var self = this, _data_ = 'no_match';
|
3083 |
-
// do we have a collection ?
|
3084 |
-
// if not, let's use the root one
|
3085 |
if ( _.isUndefined( collection ) ) {
|
3086 |
var currentSektionSettingValue = api( self.sekCollectionSettingId() )();
|
3087 |
var sektionSettingValue = _.isObject( currentSektionSettingValue ) ? $.extend( true, {}, currentSektionSettingValue ) : self.defaultSektionSettingValue;
|
3088 |
collection = _.isArray( sektionSettingValue.collection ) ? sektionSettingValue.collection : [];
|
3089 |
}
|
3090 |
_.each( collection, function( levelData ) {
|
3091 |
-
// did we have a match recursively ?
|
3092 |
if ( 'no_match' != _data_ )
|
3093 |
return;
|
3094 |
if ( id === levelData.id ) {
|
@@ -3104,15 +3148,12 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
3104 |
|
3105 |
getLevelPositionInCollection : function( id, collection ) {
|
3106 |
var self = this, _position_ = 'no_match';
|
3107 |
-
// do we have a collection ?
|
3108 |
-
// if not, let's use the root one
|
3109 |
if ( _.isUndefined( collection ) ) {
|
3110 |
var currentSektionSettingValue = api( self.sekCollectionSettingId() )();
|
3111 |
var sektionSettingValue = _.isObject( currentSektionSettingValue ) ? $.extend( true, {}, currentSektionSettingValue ) : self.defaultSektionSettingValue;
|
3112 |
collection = _.isArray( sektionSettingValue.collection ) ? sektionSettingValue.collection : [];
|
3113 |
}
|
3114 |
_.each( collection, function( levelData, _key_ ) {
|
3115 |
-
// did we have a match recursively ?
|
3116 |
if ( 'no_match' != _position_ )
|
3117 |
return;
|
3118 |
if ( id === levelData.id ) {
|
@@ -3125,9 +3166,6 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
3125 |
});
|
3126 |
return _position_;
|
3127 |
},
|
3128 |
-
|
3129 |
-
// @params = { property : 'options', id : }
|
3130 |
-
// @return mixed type
|
3131 |
getLevelProperty : function( params ) {
|
3132 |
params = _.extend( {
|
3133 |
id : '',
|
@@ -3150,8 +3188,6 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
3150 |
}
|
3151 |
return modelCandidate[ params.property ];
|
3152 |
},
|
3153 |
-
|
3154 |
-
// @return a detached clone of a given level model, with new unique ids
|
3155 |
cloneLevel : function( levelId ) {
|
3156 |
var self = this;
|
3157 |
var levelModelCandidate = self.getLevelModel( levelId );
|
@@ -3159,12 +3195,10 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
3159 |
throw new Error( 'cloneLevel => no match for level id : ' + levelId );
|
3160 |
}
|
3161 |
var deepClonedLevel = $.extend( true, {}, levelModelCandidate );
|
3162 |
-
// recursive
|
3163 |
var newIdWalker = function( level_model ) {
|
3164 |
if ( _.isEmpty( level_model.id ) ) {
|
3165 |
throw new Error( 'cloneLevel => missing level id');
|
3166 |
}
|
3167 |
-
// No collection, we've reach the end of a branch
|
3168 |
level_model.id = sektionsLocalizedData.optPrefixForSektionsNotSaved + self.guid();
|
3169 |
if ( ! _.isEmpty( level_model.collection ) ) {
|
3170 |
if ( ! _.isArray( level_model.collection ) ) {
|
@@ -3177,33 +3211,18 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
3177 |
}
|
3178 |
return level_model;
|
3179 |
};
|
3180 |
-
// recursively walk the provided level sub-tree until all collection ids are updated
|
3181 |
return newIdWalker( deepClonedLevel );
|
3182 |
},
|
3183 |
-
|
3184 |
-
// Extract the default model values from the server localized registered module
|
3185 |
-
// Invoked when registrating a module.
|
3186 |
-
// For example :
|
3187 |
-
// czr_image_module : {
|
3188 |
-
// mthds : ImageModuleConstructor,
|
3189 |
-
// crud : false,
|
3190 |
-
// name : 'Image',
|
3191 |
-
// has_mod_opt : false,
|
3192 |
-
// ready_on_section_expanded : true,
|
3193 |
-
// defaultItemModel : _.extend(
|
3194 |
-
// { id : '', title : '' },
|
3195 |
-
// api.czr_sektions.getDefaultItemModelFromRegisteredModuleData( 'czr_image_module' )
|
3196 |
-
// )
|
3197 |
-
// },
|
3198 |
-
// @return {}
|
3199 |
getDefaultItemModelFromRegisteredModuleData : function( moduleType ) {
|
3200 |
if ( ! this.isModuleRegistered( moduleType ) ) {
|
3201 |
return {};
|
3202 |
}
|
|
|
|
|
|
|
|
|
3203 |
var data = sektionsLocalizedData.registeredModules[ moduleType ]['tmpl']['item-inputs'],
|
3204 |
-
|
3205 |
-
// title and id are legacy entries that can be used in multi-items modules to identify and name the item
|
3206 |
-
defaultItemModem = {
|
3207 |
id : '',
|
3208 |
title : ''
|
3209 |
},
|
@@ -3214,38 +3233,26 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
3214 |
case 'tabs' :
|
3215 |
_.each( _d_ , function( _tabData_ ) {
|
3216 |
_.each( _tabData_['inputs'], function( _inputData_, _id_ ) {
|
3217 |
-
|
3218 |
});
|
3219 |
});
|
3220 |
break;
|
3221 |
default :
|
3222 |
-
|
3223 |
break;
|
3224 |
}
|
3225 |
});
|
3226 |
-
return
|
3227 |
},
|
3228 |
-
|
3229 |
-
//@return mixed
|
3230 |
getRegisteredModuleProperty : function( moduleType, property ) {
|
3231 |
if ( ! this.isModuleRegistered( moduleType ) ) {
|
3232 |
return 'not_set';
|
3233 |
}
|
3234 |
return sektionsLocalizedData.registeredModules[ moduleType ][ property ];
|
3235 |
},
|
3236 |
-
|
3237 |
-
// @return boolean
|
3238 |
isModuleRegistered : function( moduleType ) {
|
3239 |
return sektionsLocalizedData.registeredModules && ! _.isUndefined( sektionsLocalizedData.registeredModules[ moduleType ] );
|
3240 |
},
|
3241 |
-
|
3242 |
-
|
3243 |
-
// Walk the main sektion setting and populate an array of google fonts
|
3244 |
-
// This method is used when processing the 'sek-update-fonts' action to update the .fonts property
|
3245 |
-
// To be a candidate for sniffing, a google font should meet 2 criteria :
|
3246 |
-
// 1) be the value of a 'font_family_css' property
|
3247 |
-
// 2) start with [gfont]
|
3248 |
-
// @return array
|
3249 |
sniffGFonts : function( gfonts, level ) {
|
3250 |
var self = this;
|
3251 |
gfonts = gfonts || [];
|
@@ -3255,9 +3262,11 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
3255 |
level = _.isObject( currentSektionSettingValue ) ? $.extend( true, {}, currentSektionSettingValue ) : self.defaultSektionSettingValue;
|
3256 |
}
|
3257 |
_.each( level, function( levelData, _key_ ) {
|
3258 |
-
if ( '
|
3259 |
-
if (
|
3260 |
-
|
|
|
|
|
3261 |
}
|
3262 |
}
|
3263 |
|
@@ -3267,65 +3276,61 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
3267 |
});
|
3268 |
return gfonts;
|
3269 |
},
|
3270 |
-
|
3271 |
-
|
3272 |
-
// @return a mixed type default value
|
3273 |
-
// @param input_id string
|
3274 |
-
// @param module_type string
|
3275 |
-
// @param level array || object
|
3276 |
getInputDefaultValue : function( input_id, module_type, level ) {
|
3277 |
var self = this;
|
3278 |
-
|
3279 |
-
// Do we have a cached default value ?
|
3280 |
self.cachedDefaultInputValues = self.cachedDefaultInputValues || {};
|
3281 |
self.cachedDefaultInputValues[ module_type ] = self.cachedDefaultInputValues[ module_type ] || {};
|
3282 |
if ( _.has( self.cachedDefaultInputValues[ module_type ], input_id ) ) {
|
3283 |
return self.cachedDefaultInputValues[ module_type ][ input_id ];
|
3284 |
}
|
3285 |
-
//console.log('DEFAULT INPUT VALUE NO CACHED', input_id, module_type );
|
3286 |
if ( _.isUndefined( sektionsLocalizedData.registeredModules ) ) {
|
3287 |
api.errare( 'getInputDefaultValue => missing sektionsLocalizedData.registeredModules' );
|
3288 |
return;
|
3289 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3290 |
if ( _.isUndefined( level ) ) {
|
3291 |
level = sektionsLocalizedData.registeredModules[ module_type ][ 'tmpl' ];
|
3292 |
}
|
3293 |
var _defaultVal_ = 'no_default_value_specified';
|
3294 |
_.each( level, function( levelData, _key_ ) {
|
3295 |
-
// we found a match skip next levels
|
3296 |
if ( 'no_default_value_specified' !== _defaultVal_ )
|
3297 |
return;
|
3298 |
if ( input_id === _key_ && ! _.isUndefined( levelData.default ) ) {
|
3299 |
_defaultVal_ = levelData.default;
|
3300 |
}
|
3301 |
-
// if we have still no match, and the data are sniffable, let's go ahead recursively
|
3302 |
if ( 'no_default_value_specified' === _defaultVal_ && ( _.isArray( levelData ) || _.isObject( levelData ) ) ) {
|
3303 |
_defaultVal_ = self.getInputDefaultValue( input_id, module_type, levelData );
|
3304 |
}
|
3305 |
if ( 'no_default_value_specified' !== _defaultVal_ ) {
|
3306 |
-
// cache it
|
3307 |
self.cachedDefaultInputValues[ module_type ][ input_id ] = _defaultVal_;
|
3308 |
}
|
3309 |
});
|
3310 |
return _defaultVal_;
|
3311 |
},
|
3312 |
-
|
3313 |
-
// @return input_type string
|
3314 |
-
// @param input_id string
|
3315 |
-
// @param module_type string
|
3316 |
-
// @param level array || object
|
3317 |
getInputType : function( input_id, module_type, level ) {
|
3318 |
var self = this;
|
3319 |
-
|
3320 |
-
// Do we have a cached default value ?
|
3321 |
self.cachedInputTypes = self.cachedInputTypes || {};
|
3322 |
self.cachedInputTypes[ module_type ] = self.cachedInputTypes[ module_type ] || {};
|
3323 |
if ( _.has( self.cachedInputTypes[ module_type ], input_id ) ) {
|
3324 |
return self.cachedInputTypes[ module_type ][ input_id ];
|
3325 |
}
|
3326 |
-
//console.log('DEFAULT INPUT VALUE NO CACHED', input_id, module_type );
|
3327 |
if ( _.isUndefined( sektionsLocalizedData.registeredModules ) ) {
|
3328 |
-
api.errare( '
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3329 |
return;
|
3330 |
}
|
3331 |
if ( _.isUndefined( level ) ) {
|
@@ -3333,27 +3338,87 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
3333 |
}
|
3334 |
var _inputType_ = 'no_input_type_specified';
|
3335 |
_.each( level, function( levelData, _key_ ) {
|
3336 |
-
// we found a match skip next levels
|
3337 |
if ( 'no_input_type_specified' !== _inputType_ )
|
3338 |
return;
|
3339 |
if ( input_id === _key_ && ! _.isUndefined( levelData.input_type ) ) {
|
3340 |
_inputType_ = levelData.input_type;
|
3341 |
}
|
3342 |
-
// if we have still no match, and the data are sniffable, let's go ahead recursively
|
3343 |
if ( 'no_input_type_specified' === _inputType_ && ( _.isArray( levelData ) || _.isObject( levelData ) ) ) {
|
3344 |
_inputType_ = self.getInputType( input_id, module_type, levelData );
|
3345 |
}
|
3346 |
if ( 'no_input_type_specified' !== _inputType_ ) {
|
3347 |
-
// cache it
|
3348 |
self.cachedInputTypes[ module_type ][ input_id ] = _inputType_;
|
3349 |
}
|
3350 |
});
|
3351 |
return _inputType_;
|
3352 |
},
|
3353 |
-
|
3354 |
-
|
3355 |
-
|
3356 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3357 |
getModuleStartingValue : function( module_type ) {
|
3358 |
if ( ! sektionsLocalizedData.registeredModules ) {
|
3359 |
api.errare( 'getModuleStartingValue => missing sektionsLocalizedData.registeredModules' );
|
@@ -3365,48 +3430,239 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
3365 |
}
|
3366 |
var starting_value = sektionsLocalizedData.registeredModules[ module_type ][ 'starting_value' ];
|
3367 |
return _.isEmpty( starting_value ) ? 'no_starting_value' : starting_value;
|
3368 |
-
}
|
3369 |
-
|
3370 |
-
|
3371 |
-
|
3372 |
-
|
3373 |
-
|
3374 |
-
|
3375 |
-
|
3376 |
-
|
3377 |
-
|
3378 |
-
|
3379 |
-
|
3380 |
-
|
3381 |
-
|
3382 |
-
|
3383 |
-
|
3384 |
-
|
3385 |
-
|
3386 |
-
|
3387 |
-
|
3388 |
-
|
3389 |
-
|
3390 |
-
|
3391 |
-
|
3392 |
-
|
3393 |
-
|
3394 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3395 |
var CZRSeksPrototype = CZRSeksPrototype || {};
|
3396 |
(function ( api, $ ) {
|
3397 |
$.extend( CZRSeksPrototype, {
|
3398 |
-
//-------------------------------------------------------------------------------------------------
|
3399 |
-
//-- SETUP DnD
|
3400 |
-
//-------------------------------------------------------------------------------------------------
|
3401 |
-
//Fired in ::initialize()
|
3402 |
-
// INSTANTIATE Dnd ZONES IF SUPPORTED BY THE BROWSER
|
3403 |
-
// + SCHEDULE DROP ZONES RE-INSTANTIATION ON PREVIEW REFRESH
|
3404 |
-
// + SCHEDULE API REACTION TO *drop event
|
3405 |
-
// setup $.sekDrop for $( api.previewer.targetWindow().document ).find( '.sektion-wrapper')
|
3406 |
setupDnd : function() {
|
3407 |
var self = this;
|
3408 |
-
// emitted by the module_picker or the section_picker module
|
3409 |
-
// @params { type : 'section' || 'module', input_container : input.container }
|
3410 |
self.bind( 'sek-refresh-dragzones', function( params ) {
|
3411 |
if ( 'draggable' in document.createElement('span') ) {
|
3412 |
self.setupNimbleDragZones( params.input_container );//<= module or section picker
|
@@ -3417,55 +3673,30 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
3417 |
message: sektionsLocalizedData.i18n['This browser does not support drag and drop. You might need to update your browser or use another one.'],
|
3418 |
dismissible: true
|
3419 |
} ) );
|
3420 |
-
|
3421 |
-
// Removed if not dismissed after 5 seconds
|
3422 |
_.delay( function() {
|
3423 |
api.notifications.remove( 'drag-drop-support' );
|
3424 |
}, 10000 );
|
3425 |
});
|
3426 |
}
|
3427 |
});
|
3428 |
-
|
3429 |
-
// on previewer refresh
|
3430 |
api.previewer.bind( 'ready', function() {
|
3431 |
try { self.setupNimbleDropZones();//<= module or section picker
|
3432 |
} catch( er ) {
|
3433 |
api.errare( '::setupDnd => error on self.setupNimbleDropZones()', er );
|
3434 |
}
|
3435 |
-
|
3436 |
-
// => re-instantiate sekDrop on the new preview frame
|
3437 |
-
// the registered() ui levels look like :
|
3438 |
-
// [
|
3439 |
-
// { what: "control", id: "__nimble___sek_draggable_sections_ui", label: "Section Picker", type: "czr_module", module_type: "sek_section_picker_module", …}
|
3440 |
-
// { what: "setting", id: "__nimble___sek_draggable_sections_ui", dirty: false, value: "", transport: "postMessage", … }
|
3441 |
-
// { what: "section", id: "__nimble___sek_draggable_sections_ui", title: "Section Picker", panel: "__sektions__", priority: 30}
|
3442 |
-
// ]
|
3443 |
-
if ( ! _.isUndefined( _.findWhere( self.registered(), { module_type : 'sek_section_picker_module' } ) ) ) {
|
3444 |
self.rootPanelFocus();
|
3445 |
} else if ( ! _.isUndefined( _.findWhere( self.registered(), { module_type : 'sek_module_picker_module' } ) ) ) {
|
3446 |
self.rootPanelFocus();
|
3447 |
}
|
3448 |
});
|
3449 |
-
|
3450 |
-
// React to the *-droped event
|
3451 |
self.reactToDrop();
|
3452 |
},
|
3453 |
-
|
3454 |
-
//-------------------------------------------------------------------------------------------------
|
3455 |
-
//--DRAG ZONES SETUP
|
3456 |
-
//-------------------------------------------------------------------------------------------------
|
3457 |
-
// fired in ::initialize, on 'sek-refresh-nimbleDragDropZones
|
3458 |
-
// 'sek-refresh-nimbleDragDropZones' is emitted by the section and the module picker modules with param { type : 'section_picker' || 'module_picker'}
|
3459 |
setupNimbleDragZones : function( $draggableWrapper ) {
|
3460 |
var self = this;
|
3461 |
-
//console.log('instantiate', type );
|
3462 |
-
// $(this) is the dragged element
|
3463 |
var _onStart = function( evt ) {
|
3464 |
evt.originalEvent.dataTransfer.setData( "sek-content-type", $(this).data('sek-content-type') );
|
3465 |
evt.originalEvent.dataTransfer.setData( "sek-content-id", $(this).data('sek-content-id') );
|
3466 |
-
// evt.originalEvent.dataTransfer.effectAllowed = "move";
|
3467 |
-
// evt.originalEvent.dataTransfer.dropEffect = "move";
|
3468 |
-
// Notify if not supported : https://caniuse.com/#feat=dragndrop
|
3469 |
try {
|
3470 |
evt.originalEvent.dataTransfer.setData( 'browserSupport', 'browserSupport' );
|
3471 |
evt.originalEvent.dataTransfer.setData( 'browserSupport', 'browserSupport' );
|
@@ -3477,50 +3708,27 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
3477 |
message: sektionsLocalizedData.i18n['This browser does not support drag and drop. You might need to update your browser or use another one.'],
|
3478 |
dismissible: true
|
3479 |
} ) );
|
3480 |
-
|
3481 |
-
// Removed if not dismissed after 5 seconds
|
3482 |
_.delay( function() {
|
3483 |
api.notifications.remove( 'drag-drop-support' );
|
3484 |
}, 10000 );
|
3485 |
});
|
3486 |
}
|
3487 |
-
// Set the dragged type property now : module or preset_section
|
3488 |
self.dnd_draggedType = $(this).data('sek-content-type');
|
|
|
3489 |
$('body').addClass('sek-dragging');
|
3490 |
api.previewer.send( 'sek-drag-start', { type : self.dnd_draggedType } );//fires the rendering of the dropzones
|
3491 |
};
|
3492 |
|
3493 |
var _onEnd = function( evt ) {
|
3494 |
$('body').removeClass('sek-dragging');
|
|
|
3495 |
api.previewer.send( 'sek-drag-stop' );
|
3496 |
};
|
3497 |
-
|
3498 |
-
// Schedule
|
3499 |
$draggableWrapper.find( '[draggable]' ).each( function() {
|
3500 |
-
$(this).on( 'dragstart', function( evt ) {
|
3501 |
-
|
3502 |
-
})
|
3503 |
-
.on( 'dragend', function( evt ) {
|
3504 |
-
_onEnd.call( $(this), evt );
|
3505 |
-
});
|
3506 |
});
|
3507 |
},//setupNimbleZones()
|
3508 |
-
|
3509 |
-
|
3510 |
-
|
3511 |
-
|
3512 |
-
|
3513 |
-
|
3514 |
-
|
3515 |
-
|
3516 |
-
|
3517 |
-
|
3518 |
-
|
3519 |
-
|
3520 |
-
//-------------------------------------------------------------------------------------------------
|
3521 |
-
//--DRAG ZONES SETUP
|
3522 |
-
//-------------------------------------------------------------------------------------------------
|
3523 |
-
// Scheduled on previewer('ready') each time the previewer is refreshed
|
3524 |
setupNimbleDropZones : function() {
|
3525 |
var self = this;
|
3526 |
this.$dropZones = this.dnd_getDropZonesElements();
|
@@ -3534,21 +3742,15 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
3534 |
|
3535 |
this.$dropZones.each( function() {
|
3536 |
var $zone = $(this);
|
3537 |
-
// Make sure we don't delegate an event twice for a given element
|
3538 |
if ( true === $zone.data('zone-droppable-setup') )
|
3539 |
return;
|
3540 |
|
3541 |
self.enterOverTimer = null;
|
3542 |
-
// Delegated to allow reactions on future modules / sections
|
3543 |
$zone
|
3544 |
-
//.on( 'dragenter dragover', sektionsLocalizedData.dropSelectors, )
|
3545 |
.on( 'dragenter dragover', sektionsLocalizedData.dropSelectors, function( evt ) {
|
3546 |
-
//console.log( self.enterOverTimer, self.dnd_canDrop( $(this) ) );
|
3547 |
if ( _.isNull( self.enterOverTimer ) ) {
|
3548 |
self.enterOverTimer = true;
|
3549 |
_.delay(function() {
|
3550 |
-
// If the mouse did not move, reset the time and do nothing
|
3551 |
-
// this will prevent a drop zone to "dance", aka expand collapse, when stoping the mouse close to it
|
3552 |
if ( self.currentMousePosition && ( ( self.currentMousePosition + '' ) == ( evt.clientY + '' + evt.clientX + '') ) ) {
|
3553 |
self.enterOverTimer = null;
|
3554 |
return;
|
@@ -3572,7 +3774,6 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
3572 |
}
|
3573 |
break;
|
3574 |
case 'drop' :
|
3575 |
-
// Reset the this.$cachedDropZoneCandidates now
|
3576 |
this.$cachedDropZoneCandidates = null;//has been declared on enter over
|
3577 |
|
3578 |
if ( ! self.dnd_canDrop( $(this) ) )
|
@@ -3580,8 +3781,6 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
3580 |
evt.preventDefault();//@see https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API/Drag_operations#drop
|
3581 |
self.dnd_onDrop( $(this), evt );
|
3582 |
self.dnd_cleanOnLeaveDrop( $(this), evt );
|
3583 |
-
// this event will fire another cleaner
|
3584 |
-
// also sent on dragend
|
3585 |
api.previewer.send( 'sek-drag-stop' );
|
3586 |
break;
|
3587 |
}
|
@@ -3590,19 +3789,6 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
3590 |
|
3591 |
});//this.dropZones.each()
|
3592 |
},//setupNimbleDropZones()
|
3593 |
-
|
3594 |
-
|
3595 |
-
|
3596 |
-
|
3597 |
-
//-------------------------------------------------------------------------------------------------
|
3598 |
-
//-- DnD Helpers
|
3599 |
-
//-------------------------------------------------------------------------------------------------
|
3600 |
-
// Fired on 'dragenter dragover'
|
3601 |
-
// toggles the "approaching" and "close" css classes when conditions are met.
|
3602 |
-
//
|
3603 |
-
// Because this function can be potentially heavy if there are a lot of drop zones, this is fired with a timer
|
3604 |
-
//
|
3605 |
-
// Note : this is fired before checking if the target is eligible for drop. This way we can calculate an approach, as soon as we start hovering the 'body' ( which is part the drop selector list )
|
3606 |
dnd_toggleDragApproachClassesToDropZones : function( evt ) {
|
3607 |
var self = this;
|
3608 |
this.$dropZones = this.$dropZones || this.dnd_getDropZonesElements();
|
@@ -3611,59 +3797,55 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
3611 |
this.$dropZones.find('.sek-drop-zone').each( function() {
|
3612 |
var yPos = evt.clientY,
|
3613 |
xPos = evt.clientX,
|
3614 |
-
|
3615 |
-
|
3616 |
-
|
3617 |
|
3618 |
var dzoneRect = $(this)[0].getBoundingClientRect(),
|
3619 |
-
|
3620 |
mouseToTop = Math.abs( dzoneRect.top - yPos ),
|
|
|
3621 |
mouseToRight = xPos - dzoneRect.right,
|
3622 |
mouseToLeft = dzoneRect.left - xPos,
|
3623 |
-
isVeryCloseVertically =
|
3624 |
-
isVeryCloseHorizontally =
|
3625 |
-
isCloseVertically =
|
3626 |
-
isCloseHorizontally =
|
|
|
|
|
|
|
3627 |
isInHorizontally = xPos <= dzoneRect.right && dzoneRect.left <= xPos,
|
3628 |
-
isInVertically = yPos
|
3629 |
-
|
3630 |
-
|
3631 |
-
|
3632 |
-
|
3633 |
-
|
3634 |
-
|
3635 |
-
|
3636 |
-
|
3637 |
-
|
3638 |
-
// var html = '';
|
3639 |
-
// html += ' | mouseToBottom : ' + mouseToBottom + ' | mouseToTop : ' + mouseToTop;
|
3640 |
-
// html += "isApproachingVertically : " + isApproachingVertically + ' | isCloseVertically : ' + isCloseVertically + ' | isInVertically : ' + isInVertically;
|
3641 |
-
// $(this).html( '<span style="font-size:12px">' + html + '</span>');
|
3642 |
-
|
3643 |
-
if ( ( isVeryCloseVertically || isInVertically ) && ( isVeryCloseHorizontally || isInHorizontally ) ) {
|
3644 |
$(this).addClass( 'sek-drag-is-very-close');
|
3645 |
-
$(this).removeClass( 'sek-drag-is-
|
3646 |
-
$(this).removeClass( 'sek-drag-is-approaching' );
|
3647 |
} else if ( ( isCloseVertically || isInVertically ) && ( isCloseHorizontally || isInHorizontally ) ) {
|
3648 |
-
$(this).
|
|
|
3649 |
$(this).removeClass( 'sek-drag-is-very-close');
|
3650 |
-
$(this).removeClass( 'sek-drag-is-
|
3651 |
} else if ( ( isApproachingVertically || isInVertically ) && ( isApproachingHorizontally || isInHorizontally ) ) {
|
3652 |
$(this).addClass( 'sek-drag-is-approaching');
|
3653 |
-
$(this).removeClass( 'sek-drag-is-very-close');
|
3654 |
$(this).removeClass( 'sek-drag-is-close' );
|
3655 |
-
} else {
|
3656 |
$(this).removeClass( 'sek-drag-is-very-close');
|
|
|
|
|
|
|
3657 |
$(this).removeClass( 'sek-drag-is-close' );
|
3658 |
-
$(this).removeClass( 'sek-drag-is-
|
|
|
3659 |
}
|
3660 |
});//$('.sek-drop-zones').each()
|
3661 |
-
|
3662 |
-
// Reset the timer
|
3663 |
self.enterOverTimer = null;
|
3664 |
},
|
3665 |
-
|
3666 |
-
// @return string
|
3667 |
dnd_getPreDropElementContent : function( evt ) {
|
3668 |
var $target = $( evt.currentTarget ),
|
3669 |
html,
|
@@ -3691,29 +3873,19 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
3691 |
}
|
3692 |
return preDropContent;
|
3693 |
},
|
3694 |
-
|
3695 |
-
// Scheduled on previewer('ready') each time the previewer is refreshed
|
3696 |
dnd_getDropZonesElements : function() {
|
3697 |
return $( api.previewer.targetWindow().document );
|
3698 |
},
|
3699 |
-
|
3700 |
-
// @return boolean
|
3701 |
-
// Note : the class "sek-content-preset_section-drop-zone" is dynamically generated in preview::schedulePanelMsgReactions() sek-drag-start case
|
3702 |
dnd_canDrop : function( $dropTarget ) {
|
3703 |
-
|
3704 |
-
|
3705 |
-
return $dropTarget.hasClass('sek-drop-zone') && ( ( 'preset_section' === this.dnd_draggedType && isSectionDropZone ) || ( 'module' === this.dnd_draggedType && ! isSectionDropZone ) );
|
3706 |
},
|
3707 |
-
|
3708 |
-
// @return void()
|
3709 |
dnd_OnEnterOver : function( $dropTarget, evt ) {
|
3710 |
evt.preventDefault();//@see :https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API/Drag_operations#droptargets
|
3711 |
-
// Bail here if we are in the currently drag entered element
|
3712 |
if ( true !== $dropTarget.data( 'is-drag-entered' ) ) {
|
3713 |
-
// Flag now
|
3714 |
$dropTarget.data( 'is-drag-entered', true );
|
3715 |
$dropTarget.addClass( 'sek-active-drop-zone' );
|
3716 |
-
// Flag the dropEl parent element
|
3717 |
this.$dropZones.addClass( 'sek-is-dragging' );
|
3718 |
}
|
3719 |
|
@@ -3721,8 +3893,6 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
3721 |
api.errare('Error when trying to insert the preDrop content', er );
|
3722 |
}
|
3723 |
},
|
3724 |
-
|
3725 |
-
// @return void()
|
3726 |
dnd_cleanOnLeaveDrop : function( $dropTarget, evt ) {
|
3727 |
var self = this;
|
3728 |
this.$dropZones = this.$dropZones || this.dnd_getDropZonesElements();
|
@@ -3733,8 +3903,6 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
3733 |
self.dnd_cleanSingleDropTarget( $(this) );
|
3734 |
});
|
3735 |
},
|
3736 |
-
|
3737 |
-
// @return void()
|
3738 |
dnd_cleanSingleDropTarget : function( $dropTarget ) {
|
3739 |
if ( _.isEmpty( $dropTarget ) || $dropTarget.length < 1 )
|
3740 |
return;
|
@@ -3743,15 +3911,12 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
3743 |
$dropTarget.removeClass( 'sek-active-drop-zone' );
|
3744 |
$dropTarget.find('.sek-drop-zone').removeClass('sek-drag-is-close');
|
3745 |
$dropTarget.find('.sek-drop-zone').removeClass('sek-drag-is-approaching');
|
3746 |
-
},
|
3747 |
|
3748 |
-
|
3749 |
-
|
3750 |
dnd_getPosition : function( $dropTarget, evt ) {
|
3751 |
var targetRect = $dropTarget[0].getBoundingClientRect(),
|
3752 |
targetHeight = targetRect.height;
|
3753 |
-
|
3754 |
-
// if the preDrop is already printed, we have to take it into account when calc. the target height
|
3755 |
if ( 'before' === $dropTarget.data( 'preDrop-position' ) ) {
|
3756 |
targetHeight = targetHeight + this.preDropElement.outerHeight();
|
3757 |
} else if ( 'after' === $dropTarget.data( 'preDrop-position' ) ) {
|
@@ -3760,8 +3925,6 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
3760 |
|
3761 |
return evt.originalEvent.clientY - targetRect.top - ( targetHeight / 2 ) > 0 ? 'after' : 'before';
|
3762 |
},
|
3763 |
-
|
3764 |
-
// @return void()
|
3765 |
dnd_mayBePrintPreDropElement : function( $dropTarget, evt ) {
|
3766 |
var self = this,
|
3767 |
previousPosition = $dropTarget.data( 'preDrop-position' ),
|
@@ -3775,23 +3938,20 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
3775 |
}
|
3776 |
|
3777 |
self.isPrintingPreDrop = true;
|
3778 |
-
|
3779 |
-
// make sure we clean the previous wrapper of the pre drop element
|
3780 |
this.dnd_cleanSingleDropTarget( this.$currentPreDropTarget );
|
3781 |
var inNewSection = 'between-sections' === $dropTarget.data('sek-location') || 'in-empty-location' === $dropTarget.data('sek-location');
|
3782 |
$.when( self.preDropElement.remove() ).done( function(){
|
3783 |
$dropTarget[ 'before' === newPosition ? 'prepend' : 'append' ]( self.preDropElement )
|
3784 |
.find( '.' + sektionsLocalizedData.preDropElementClass ).html( self.dnd_getPreDropElementContent( evt ) );
|
3785 |
-
// Flag the preDrop element with class to apply a specific style if inserted in a new sektion of in a column
|
3786 |
$dropTarget.find( '.' + sektionsLocalizedData.preDropElementClass ).toggleClass('in-new-sektion', inNewSection );
|
3787 |
$dropTarget.data( 'preDrop-position', newPosition );
|
3788 |
|
|
|
|
|
3789 |
self.isPrintingPreDrop = false;
|
3790 |
self.$currentPreDropTarget = $dropTarget;
|
3791 |
});
|
3792 |
},
|
3793 |
-
|
3794 |
-
//@return void()
|
3795 |
dnd_isOveringDropTarget : function( $dropTarget, evt ) {
|
3796 |
var targetRect = $dropTarget[0].getBoundingClientRect(),
|
3797 |
mouseX = evt.clientX,
|
@@ -3804,21 +3964,14 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
3804 |
isYin = mouseY >= tTop && ( tBottom - tTop ) >= ( mouseY - tTop);
|
3805 |
return isXin && isYin;
|
3806 |
},
|
3807 |
-
|
3808 |
-
//@return void()
|
3809 |
dnd_onDrop: function( $dropTarget, evt ) {
|
3810 |
evt.stopPropagation();
|
3811 |
var _position = 'after' === this.dnd_getPosition( $dropTarget, evt ) ? $dropTarget.index() + 1 : $dropTarget.index();
|
3812 |
-
// console.log('onDropping params', position, evt );
|
3813 |
-
// console.log('onDropping element => ', $dropTarget.data('drop-zone-before-section'), $dropTarget );
|
3814 |
api.czr_sektions.trigger( 'sek-content-dropped', {
|
3815 |
drop_target_element : $dropTarget,
|
3816 |
location : $dropTarget.closest('[data-sek-level="location"]').data('sek-id'),
|
3817 |
-
// when inserted between modules
|
3818 |
before_module : $dropTarget.data('drop-zone-before-module-or-nested-section'),
|
3819 |
after_module : $dropTarget.data('drop-zone-after-module-or-nested-section'),
|
3820 |
-
|
3821 |
-
// When inserted between sections
|
3822 |
before_section : $dropTarget.data('drop-zone-before-section'),
|
3823 |
after_section : $dropTarget.data('drop-zone-after-section'),
|
3824 |
|
@@ -3826,31 +3979,8 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
3826 |
content_id : evt.originalEvent.dataTransfer.getData( "sek-content-id" )
|
3827 |
});
|
3828 |
},
|
3829 |
-
|
3830 |
-
|
3831 |
-
|
3832 |
-
|
3833 |
-
|
3834 |
-
|
3835 |
-
|
3836 |
-
|
3837 |
-
|
3838 |
-
|
3839 |
-
|
3840 |
-
|
3841 |
-
|
3842 |
-
|
3843 |
-
//-------------------------------------------------------------------------------------------------
|
3844 |
-
//-- SCHEDULE REACTIONS TO 'sek-content-dropped'
|
3845 |
-
//-------------------------------------------------------------------------------------------------
|
3846 |
-
// invoked on api('ready') from self::initialize()
|
3847 |
reactToDrop : function() {
|
3848 |
var self = this;
|
3849 |
-
// @param {
|
3850 |
-
// drop_target_element : $(el) in which the content has been dropped
|
3851 |
-
// position : 'bottom' or 'top' compared to the drop-zone
|
3852 |
-
// content_type : single module, empty layout, preset module template
|
3853 |
-
// }
|
3854 |
var _do_ = function( params ) {
|
3855 |
if ( ! _.isObject( params ) ) {
|
3856 |
throw new Error( 'Invalid params provided' );
|
@@ -3859,20 +3989,50 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
3859 |
throw new Error( 'Invalid drop_target_element' );
|
3860 |
}
|
3861 |
|
3862 |
-
var
|
3863 |
-
|
3864 |
-
|
3865 |
-
|
3866 |
-
|
3867 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3868 |
}
|
3869 |
-
if ( '
|
3870 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3871 |
}
|
|
|
3872 |
var focusOnAddedContentEditor;
|
3873 |
switch( dropCase ) {
|
3874 |
case 'content-in-column' :
|
3875 |
-
var $closestLevelWrapper =
|
3876 |
if ( 1 > $closestLevelWrapper.length ) {
|
3877 |
throw new Error( 'No valid level dom element found' );
|
3878 |
}
|
@@ -3883,12 +4043,11 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
3883 |
throw new Error( 'No valid level id found' );
|
3884 |
}
|
3885 |
|
3886 |
-
//console.log(' reactToDrop => drop module in column', params );
|
3887 |
api.previewer.trigger( 'sek-add-module', {
|
3888 |
level : _level,
|
3889 |
id : _id,
|
3890 |
-
in_column :
|
3891 |
-
in_sektion :
|
3892 |
|
3893 |
before_module : params.before_module,
|
3894 |
after_module : params.after_module,
|
@@ -3898,33 +4057,25 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
3898 |
});
|
3899 |
break;
|
3900 |
|
3901 |
-
case 'content-in-
|
3902 |
api.previewer.trigger( 'sek-add-content-in-new-sektion', params );
|
3903 |
break;
|
3904 |
-
|
|
|
|
|
|
|
|
|
|
|
3905 |
case 'content-in-empty-location' :
|
3906 |
-
params.is_first_section = true;
|
3907 |
-
params.send_to_preview = false;
|
3908 |
api.previewer.trigger( 'sek-add-content-in-new-sektion', params );
|
3909 |
break;
|
3910 |
|
3911 |
-
|
3912 |
-
|
3913 |
break;
|
3914 |
}
|
3915 |
};
|
3916 |
-
|
3917 |
-
// @see module picker or section picker modules
|
3918 |
-
// api.czr_sektions.trigger( 'sek-content-dropped', {
|
3919 |
-
// drop_target_element : $(this),
|
3920 |
-
// position : _position,
|
3921 |
-
// before_section : $(this).data('drop-zone-before-section'),
|
3922 |
-
// after_section : $(this).data('drop-zone-after-section'),
|
3923 |
-
// content_type : evt.originalEvent.dataTransfer.getData( "sek-content-type" ),
|
3924 |
-
// content_id : evt.originalEvent.dataTransfer.getData( "sek-content-id" )
|
3925 |
-
// });
|
3926 |
this.bind( 'sek-content-dropped', function( params ) {
|
3927 |
-
//console.log('sek-content-dropped', params );
|
3928 |
try { _do_( params ); } catch( er ) {
|
3929 |
api.errare( 'error when reactToDrop', er );
|
3930 |
}
|
@@ -3932,730 +4083,2691 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
3932 |
}//reactToDrop
|
3933 |
});//$.extend()
|
3934 |
})( wp.customize, jQuery );//global sektionsLocalizedData
|
3935 |
-
|
3936 |
-
|
3937 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3938 |
|
3939 |
-
|
3940 |
-
|
3941 |
-
|
3942 |
-
// the default input_event_map can also be overriden in this callback
|
3943 |
-
$.extend( api.czrInputMap, {
|
3944 |
-
spacing : function( input_options ) {
|
3945 |
-
var input = this,
|
3946 |
-
$wrapper = $('.sek-spacing-wrapper', input.container );
|
3947 |
-
// Listen to user actions on the inputs and set the input value
|
3948 |
-
$wrapper.on( 'keyup mouseup change', 'input[type="number"]', function(evt) {
|
3949 |
-
var _type_ = $(this).closest('[data-sek-spacing]').data('sek-spacing'),
|
3950 |
-
_newInputVal = $.extend( true, {}, _.isObject( input() ) ? input() : {} ),
|
3951 |
-
_rawVal = $(this).val();
|
3952 |
|
3953 |
-
|
3954 |
-
|
3955 |
-
|
3956 |
-
|
3957 |
-
} else {
|
3958 |
-
// this allow users to reset a given padding / margin instead of reseting them all at once with the "reset all spacing" option
|
3959 |
-
_newInputVal = _.omit( _type_, _newInputVal );
|
3960 |
}
|
|
|
|
|
|
|
|
|
3961 |
|
3962 |
-
|
3963 |
-
|
3964 |
-
|
3965 |
-
|
3966 |
-
|
3967 |
-
|
3968 |
-
|
3969 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3970 |
});
|
3971 |
-
// [] is the default value
|
3972 |
-
// we could have get it with api.czr_sektions.getDefaultItemModelFromRegisteredModuleData( 'sek_spacing_module' )
|
3973 |
-
// @see php spacing module registration
|
3974 |
-
input( [] );
|
3975 |
-
});
|
3976 |
|
3977 |
-
|
3978 |
-
|
3979 |
-
_.each( input(), function( _val_, _key_ ) {
|
3980 |
-
$( '[data-sek-spacing="' + _key_ +'"]', $wrapper ).find( 'input[type="number"]' ).val( _val_ );
|
3981 |
-
});
|
3982 |
-
}
|
3983 |
-
},
|
3984 |
-
bg_position : function( input_options ) {
|
3985 |
-
var input = this;
|
3986 |
-
// Listen to user actions on the inputs and set the input value
|
3987 |
-
$('.sek-bg-pos-wrapper', input.container ).on( 'change', 'input[type="radio"]', function(evt) {
|
3988 |
-
input( $(this).val() );
|
3989 |
});
|
3990 |
-
|
3991 |
-
|
3992 |
-
|
3993 |
-
|
3994 |
-
|
3995 |
-
|
3996 |
-
|
3997 |
-
|
3998 |
-
|
3999 |
-
|
4000 |
-
|
4001 |
-
|
4002 |
-
|
4003 |
-
|
4004 |
-
|
4005 |
-
$wrapper.find('.selected').removeClass('selected');
|
4006 |
-
$.when( $(this).addClass('selected') ).done( function() {
|
4007 |
-
input( $(this).data('sek-align') );
|
4008 |
-
});
|
4009 |
});
|
4010 |
-
|
4011 |
-
|
4012 |
-
|
4013 |
-
|
4014 |
-
|
4015 |
-
|
4016 |
-
$wrapper.find( 'input[type="number"]').on('change', function() {
|
4017 |
-
input( $(this).val() + unit );
|
4018 |
-
}).stepper();
|
4019 |
-
|
4020 |
-
},
|
4021 |
-
|
4022 |
-
line_height : function( obj ) {
|
4023 |
-
var input = this,
|
4024 |
-
$wrapper = $('.sek-line-height-wrapper', input.container ),
|
4025 |
-
unit = 'px';
|
4026 |
-
|
4027 |
-
$wrapper.find( 'input[type="number"]').on('change', function() {
|
4028 |
-
input( $(this).val() + unit );
|
4029 |
-
}).stepper();
|
4030 |
-
},
|
4031 |
-
|
4032 |
|
|
|
|
|
|
|
|
|
|
|
4033 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4034 |
|
|
|
|
|
|
|
4035 |
|
|
|
|
|
|
|
|
|
|
|
|
|
4036 |
|
|
|
4037 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4038 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4039 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4040 |
|
4041 |
|
4042 |
|
4043 |
|
4044 |
-
|
4045 |
-
|
4046 |
-
|
4047 |
-
|
|
|
|
|
|
|
|
|
|
|
4048 |
|
4049 |
-
|
4050 |
-
|
4051 |
-
|
4052 |
-
|
4053 |
-
|
4054 |
-
|
4055 |
-
|
4056 |
-
|
4057 |
-
|
4058 |
-
|
4059 |
-
|
4060 |
-
|
4061 |
-
|
4062 |
-
if ( typeof _serverTmpl_ !== 'string' || _serverTmpl_[0] !== '{' ) {
|
4063 |
-
throw new Error( 'font_picker => server list is not JSON.parse-able');
|
4064 |
-
}
|
4065 |
-
input.sek_fontCollections = JSON.parse( _serverTmpl_ );
|
4066 |
-
dfd.resolve( input.sek_fontCollections );
|
4067 |
-
}).fail( function( _r_ ) {
|
4068 |
-
dfd.reject( _r_ );
|
4069 |
-
});
|
4070 |
}
|
4071 |
-
|
4072 |
-
|
4073 |
-
|
4074 |
-
|
4075 |
-
|
4076 |
-
|
4077 |
-
|
4078 |
-
*/
|
4079 |
-
var selectFocusResults = $.Deferred();
|
4080 |
-
if ( 'undefined' !== typeof $.fn.select2 && 'undefined' !== typeof $.fn.select2.amd && 'function' === typeof $.fn.select2.amd.require ) {
|
4081 |
-
$.fn.select2.amd.require(['select2/results', 'select2/utils'], function (Result, Utils) {
|
4082 |
-
var ResultsAdapter = function($element, options, dataAdapter) {
|
4083 |
-
ResultsAdapter.__super__.constructor.call(this, $element, options, dataAdapter);
|
4084 |
-
};
|
4085 |
-
Utils.Extend(ResultsAdapter, Result);
|
4086 |
-
ResultsAdapter.prototype.bind = function (container, $container) {
|
4087 |
-
var _self = this;
|
4088 |
-
container.on('results:focus', function (params) {
|
4089 |
-
if ( params.element.attr('aria-selected') != 'true') {
|
4090 |
-
_self.trigger('select', {
|
4091 |
-
data: params.data
|
4092 |
-
});
|
4093 |
-
}
|
4094 |
-
});
|
4095 |
-
ResultsAdapter.__super__.bind.call(this, container, $container);
|
4096 |
-
};
|
4097 |
-
selectFocusResults.resolve( ResultsAdapter );
|
4098 |
});
|
|
|
|
|
4099 |
}
|
4100 |
-
|
4101 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4102 |
}
|
|
|
|
|
4103 |
|
4104 |
-
return selectFocusResults.promise();
|
4105 |
|
4106 |
-
};//_preprocessSelect2ForFontFamily
|
4107 |
|
4108 |
-
// @return void();
|
4109 |
-
// Instantiates a select2 select input
|
4110 |
-
// http://ivaynberg.github.io/select2/#documentation
|
4111 |
-
var _setupSelectForFontFamilySelector = function( customResultsAdapter, fontCollections ) {
|
4112 |
-
var _model = item(),
|
4113 |
-
_googleFontsFilteredBySubset = function() {
|
4114 |
-
var subset = item.czr_Input('subset')(),
|
4115 |
-
filtered = _.filter( fontCollections.gfonts, function( data ) {
|
4116 |
-
return data.subsets && _.contains( data.subsets, subset );
|
4117 |
-
});
|
4118 |
|
4119 |
-
if ( ! _.isUndefined( subset ) && ! _.isNull( subset ) && 'all-subsets' != subset ) {
|
4120 |
-
return filtered;
|
4121 |
-
} else {
|
4122 |
-
return fontCollections.gfonts;
|
4123 |
-
}
|
4124 |
|
4125 |
-
|
4126 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4127 |
|
4128 |
-
|
4129 |
-
|
4130 |
-
|
4131 |
-
var _html_ = '';
|
4132 |
-
_.each( fontList , function( font_data ) {
|
4133 |
-
var _value = font_data.name,
|
4134 |
-
optionTitle = _.isString( _value ) ? _value.replace(/[+|:]/g, ' ' ) : _value,
|
4135 |
-
_setFontTypePrefix = function( val, type ) {
|
4136 |
-
return _.isString( val ) ? [ '[', type, ']', val ].join('') : '';//<= Example : [gfont]Aclonica:regular
|
4137 |
-
};
|
4138 |
|
4139 |
-
|
|
|
|
|
4140 |
|
4141 |
-
|
4142 |
-
|
4143 |
-
} else {
|
4144 |
-
_html_ += '<option value="' + _value + '">' + optionTitle + '</option>';
|
4145 |
-
}
|
4146 |
-
});
|
4147 |
-
return _html_;
|
4148 |
-
};
|
4149 |
|
4150 |
-
|
4151 |
-
|
4152 |
-
|
4153 |
-
} else {
|
4154 |
-
$fontSelectElement.append( '<option value="none">' + sektionsLocalizedData.i18n['Select a font family'] + '</option>' );
|
4155 |
-
}
|
4156 |
|
|
|
|
|
|
|
4157 |
|
4158 |
-
|
4159 |
-
|
4160 |
-
|
4161 |
-
title : sektionsLocalizedData.i18n['Web Safe Fonts'],
|
4162 |
-
type : 'cfont',
|
4163 |
-
list : fontCollections.cfonts
|
4164 |
-
},
|
4165 |
-
{
|
4166 |
-
title : sektionsLocalizedData.i18n['Google Fonts'],
|
4167 |
-
type : 'gfont',
|
4168 |
-
list : fontCollections.gfonts//_googleFontsFilteredBySubset()
|
4169 |
-
}
|
4170 |
-
], function( fontData ) {
|
4171 |
-
var $optGroup = $('<optgroup>', { label : fontData.title , html : _generateFontOptions( fontData.list, fontData.type ) });
|
4172 |
-
$fontSelectElement.append( $optGroup );
|
4173 |
-
});
|
4174 |
|
4175 |
-
|
4176 |
-
|
4177 |
-
|
4178 |
-
|
4179 |
-
|
4180 |
-
|
4181 |
-
|
4182 |
-
|
4183 |
-
|
4184 |
-
|
4185 |
-
|
4186 |
-
|
4187 |
-
|
4188 |
-
|
4189 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4190 |
|
4191 |
-
|
4192 |
-
|
4193 |
-
|
4194 |
-
|
4195 |
|
4196 |
-
};//_setupSelectForFontFamilySelector
|
4197 |
|
4198 |
-
// @return {} used to set $.css()
|
4199 |
-
// @param font {string}.
|
4200 |
-
// Example : Aclonica:regular
|
4201 |
-
// Example : Helvetica Neue, Helvetica, Arial, sans-serif
|
4202 |
-
var getInlineFontStyle = function( _fontFamily_ ){
|
4203 |
-
// the font is set to 'none' when "Select a font family" option is picked
|
4204 |
-
if ( ! _.isString( _fontFamily_ ) || _.isEmpty( _fontFamily_ ) )
|
4205 |
-
return {};
|
4206 |
|
4207 |
-
|
4208 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4209 |
|
4210 |
-
|
4211 |
-
|
|
|
|
|
|
|
|
|
|
|
4212 |
|
4213 |
-
font_family = getFontFamilyName( _fontFamily_ );
|
4214 |
|
4215 |
-
font_weight = split[1] ? split[1].replace( /[^0-9.]+/g , '') : 400; //removes all characters
|
4216 |
-
font_weight = _.isNumber( font_weight ) ? font_weight : 400;
|
4217 |
-
font_style = ( split[1] && -1 != split[1].indexOf('italic') ) ? 'italic' : '';
|
4218 |
|
4219 |
|
4220 |
-
return {
|
4221 |
-
'font-family' : 'none' == font_family ? 'inherit' : font_family.replace(/[+|:]/g, ' '),//removes special characters
|
4222 |
-
'font-weight' : font_weight || 400,
|
4223 |
-
'font-style' : font_style || 'normal'
|
4224 |
-
};
|
4225 |
-
};
|
4226 |
|
4227 |
-
// @return the font family name only from a pre Google formated
|
4228 |
-
// Example : input is Inknut+Antiqua:regular
|
4229 |
-
// Should return Inknut Antiqua
|
4230 |
-
var getFontFamilyName = function( rawFontFamily ) {
|
4231 |
-
if ( ! _.isString( rawFontFamily ) || _.isEmpty( rawFontFamily ) )
|
4232 |
-
return rawFontFamily;
|
4233 |
|
4234 |
-
rawFontFamily = rawFontFamily.replace('[gfont]', '').replace('[cfont]', '');
|
4235 |
-
var split = rawFontFamily.split(':');
|
4236 |
-
return _.isString( split[0] ) ? split[0].replace(/[+|:]/g, ' ') : '';//replaces special characters ( + ) by space
|
4237 |
-
};
|
4238 |
|
4239 |
|
4240 |
|
4241 |
-
// defer the loading of the fonts when the font tab gets switched to
|
4242 |
-
// then fetch the google fonts from the server
|
4243 |
-
// and instantiate the select input when done
|
4244 |
-
// @see this.trigger( 'tab-switch', { id : tabIdSwitchedTo } ); in Item::initialize()
|
4245 |
-
item.bind( 'tab-switch', function( params ) {
|
4246 |
-
// try { var isGFontTab = 'sek-google-font-tab' = item.container.find('[data-tab-id="' + params.id + '"]').data('sek-device'); } catch( er ) {
|
4247 |
-
// api.errare( 'spacing input => error when binding the tab switch event', er );
|
4248 |
-
// }
|
4249 |
-
//console.log( 'ALORS ????', item.container.find('[data-tab-id="' + params.id + '"]').data('sek-google-font-tab'), input.module );
|
4250 |
-
// $.when( _getFontCollections() ).done( function( fontCollections ) {
|
4251 |
-
// console.log('FONT COLLECTION ?', fontCollections );
|
4252 |
-
// }).fail( function( _r_ ) {
|
4253 |
-
// api.errare( 'font_picker => fail response =>', _r_ );
|
4254 |
-
// });
|
4255 |
-
$.when( _getFontCollections() ).done( function( fontCollections ) {
|
4256 |
-
//console.log('FONT COLLECTION ?', fontCollections );
|
4257 |
-
_preprocessSelect2ForFontFamily().done( function( customResultsAdapter ) {
|
4258 |
-
_setupSelectForFontFamilySelector( customResultsAdapter, fontCollections );
|
4259 |
-
});
|
4260 |
-
}).fail( function( _r_ ) {
|
4261 |
-
api.errare( 'font_picker => fail response =>', _r_ );
|
4262 |
-
});
|
4263 |
|
4264 |
-
});
|
4265 |
-
}//font_picker()
|
4266 |
-
});//$.extend( api.czrInputMap, {})
|
4267 |
|
4268 |
|
4269 |
-
})( wp.customize, jQuery, _ );//global sektionsLocalizedData
|
4270 |
-
var CZRSeksPrototype = CZRSeksPrototype || {};
|
4271 |
-
(function ( api, $ ) {
|
4272 |
-
$.extend( CZRSeksPrototype, {
|
4273 |
-
// fired from ::initialize()
|
4274 |
-
setupTinyMceEditor: function() {
|
4275 |
-
var self = this;
|
4276 |
-
// OBSERVABLE VALUES
|
4277 |
-
api.sekEditorExpanded = new api.Value( false );
|
4278 |
-
api.sekEditorSynchronizedInput = new api.Value();
|
4279 |
|
4280 |
-
self.editorEventsListenerSetup = false;//this status will help us ensure that we bind the shared tinyMce instance only once
|
4281 |
|
4282 |
-
// Cache the instance and attach
|
4283 |
-
var mayBeAwakeTinyMceEditor = function() {
|
4284 |
-
api.sekTinyMceEditor = api.sekTinyMceEditor || tinyMCE.get( 'czr-customize-content_editor' );
|
4285 |
|
4286 |
-
|
4287 |
-
|
4288 |
-
|
4289 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4290 |
}
|
4291 |
};
|
4292 |
-
|
4293 |
-
|
4294 |
-
|
4295 |
-
|
4296 |
-
|
4297 |
-
|
4298 |
-
|
4299 |
-
|
4300 |
-
|
4301 |
-
|
4302 |
-
|
4303 |
-
|
4304 |
-
|
4305 |
-
|
4306 |
-
|
4307 |
-
|
4308 |
-
|
4309 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4310 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4311 |
|
4312 |
-
|
4313 |
-
api.sekTinyMceEditor.focus();
|
4314 |
});
|
4315 |
-
|
4316 |
-
|
4317 |
-
|
4318 |
-
|
4319 |
-
// set the clicked input id as the new one
|
4320 |
-
$('#customize-theme-controls').on('click', '[data-czr-action="open-tinymce-editor"]', function() {
|
4321 |
-
//console.log( '[data-czr-action="toggle-tinymce-editor"]', $(this) , api.sekEditorSynchronizedInput() );
|
4322 |
-
// Get the control and the input id from the clicked element
|
4323 |
-
// => then updated the synchronized input with them
|
4324 |
-
var control_id = $(this).data('czr-control-id'),
|
4325 |
-
input_id = $(this).data('czr-input-id');
|
4326 |
-
if ( _.isEmpty( control_id ) || _.isEmpty( input_id ) ) {
|
4327 |
-
api.errare('toggle-tinymce-editor => missing input or control id');
|
4328 |
-
return;
|
4329 |
}
|
4330 |
-
var currentEditorSyncData = $.extend( true, {}, api.sekEditorSynchronizedInput() ),
|
4331 |
-
newEditorSyncData = _.extend( currentEditorSyncData, {
|
4332 |
-
input_id : input_id,
|
4333 |
-
control_id : control_id
|
4334 |
-
});
|
4335 |
-
api.sekEditorSynchronizedInput( newEditorSyncData );
|
4336 |
-
api.sekEditorExpanded( true );
|
4337 |
-
api.sekTinyMceEditor.focus();
|
4338 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
4339 |
|
4340 |
-
|
4341 |
-
|
4342 |
-
|
4343 |
-
|
4344 |
-
|
4345 |
-
|
4346 |
-
|
4347 |
-
|
4348 |
-
|
4349 |
-
|
4350 |
-
|
4351 |
-
_currentInputContent_ = ( _.isObject( _currentModuleValue_ ) && ! _.isEmpty( _currentModuleValue_[ to.input_id ] ) ) ? _currentModuleValue_[ to.input_id ] : '';
|
4352 |
-
|
4353 |
-
try { api.sekTinyMceEditor.setContent( _currentInputContent_ ); } catch( er ) {
|
4354 |
-
api.errare( 'Error when setting the tiny mce editor content in setupTinyMceEditor', er );
|
4355 |
-
}
|
4356 |
-
api.sekTinyMceEditor.focus();
|
4357 |
-
});//api.sekEditorSynchronizedInput.bind( function( to, from )
|
4358 |
-
|
4359 |
|
4360 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4361 |
|
4362 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4363 |
|
|
|
|
|
|
|
|
|
|
|
4364 |
|
|
|
|
|
4365 |
|
4366 |
-
|
4367 |
-
|
4368 |
-
|
4369 |
-
|
4370 |
-
|
4371 |
-
api.sekTinyMceEditor.focus();
|
4372 |
}
|
4373 |
-
|
4374 |
-
|
4375 |
-
|
4376 |
-
|
4377 |
-
|
4378 |
-
|
4379 |
-
// //api.sekEditorExpanded.set( false );
|
4380 |
-
// api.sekTinyMceEditor.locker = null;
|
4381 |
-
// } if ( ! api.sekTinyMceEditor.locker || api.sekTinyMceEditor.locker === input ) {
|
4382 |
-
// $(document.body).toggleClass('czr-customize-content_editor-pane-open', expanded);
|
4383 |
-
// api.sekTinyMceEditor.locker = input;
|
4384 |
-
// }
|
4385 |
-
|
4386 |
-
$( window )[ expanded ? 'on' : 'off' ]('resize', function() {
|
4387 |
-
if ( ! api.sekEditorExpanded() )
|
4388 |
-
return;
|
4389 |
-
_.delay( function() {
|
4390 |
-
self.czrResizeEditor( window.innerHeight - self.$editorPane.height() );
|
4391 |
-
}, 50 );
|
4392 |
|
4393 |
-
});
|
4394 |
|
4395 |
-
|
4396 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4397 |
} else {
|
4398 |
-
|
4399 |
-
//self.container.closest( 'ul.accordion-section-content' ).css( 'padding-bottom', '' );
|
4400 |
-
self.$preview.css( 'bottom', '' );
|
4401 |
-
self.$collapseSidebar.css( 'bottom', '' );
|
4402 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4403 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4404 |
|
|
|
4405 |
|
4406 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4407 |
|
4408 |
-
// COLLAPSING THE EDITOR
|
4409 |
-
// or on click on the icon located on top of the editor
|
4410 |
-
$('#czr-customize-content_editor-pane' ).on('click', '[data-czr-action="close-tinymce-editor"]', function() {
|
4411 |
-
api.sekEditorExpanded( false );
|
4412 |
-
});
|
4413 |
-
|
4414 |
-
// on click anywhere but on the 'Edit' ( 'open-tinymce-editor' action ) button
|
4415 |
-
$('#customize-controls' ).on('click', function( evt ) {
|
4416 |
-
if ( 'open-tinymce-editor' == $( evt.target ).data( 'czr-action') )
|
4417 |
-
return;
|
4418 |
-
|
4419 |
-
api.sekEditorExpanded( false );
|
4420 |
-
});
|
4421 |
-
|
4422 |
-
// Pressing the escape key collapses the editor
|
4423 |
-
// both in the customizer panel and the editor frame
|
4424 |
-
$(document).on( 'keydown', _.throttle( function( evt ) {
|
4425 |
-
if ( 27 === evt.keyCode ) {
|
4426 |
-
api.sekEditorExpanded( false );
|
4427 |
-
}
|
4428 |
-
}, 50 ));
|
4429 |
|
4430 |
-
|
4431 |
-
|
4432 |
-
|
4433 |
-
|
4434 |
-
|
4435 |
-
|
4436 |
-
|
4437 |
-
});
|
4438 |
|
4439 |
-
|
4440 |
-
|
4441 |
-
|
4442 |
-
|
4443 |
-
'sek-add-module',
|
4444 |
-
'sek-remove',
|
4445 |
-
'sek-move',
|
4446 |
-
'sek-duplicate',
|
4447 |
-
'sek-resize-columns',
|
4448 |
-
'sek-add-content-in-new-sektion',
|
4449 |
-
'sek-pick-module',
|
4450 |
-
'sek-edit-options',
|
4451 |
-
'sek-edit-module',
|
4452 |
-
'sek-notify'
|
4453 |
-
], function( _evt_ ) {
|
4454 |
-
if ( 'sek-edit-module' != _evt_ ) {
|
4455 |
-
api.previewer.bind( _evt_, function() { api.sekEditorExpanded( false ); } );
|
4456 |
} else {
|
4457 |
-
|
4458 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4459 |
});
|
4460 |
-
}
|
4461 |
-
});
|
4462 |
-
},//setupTinyMceEditor
|
4463 |
-
|
4464 |
-
|
4465 |
-
|
4466 |
|
4467 |
-
|
4468 |
-
|
4469 |
-
|
4470 |
-
|
4471 |
-
|
4472 |
-
|
4473 |
-
|
4474 |
-
|
4475 |
-
|
4476 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4477 |
|
4478 |
-
|
4479 |
-
self.$collapseSidebar = $( '.collapse-sidebar' );
|
4480 |
|
4481 |
-
|
4482 |
-
|
4483 |
-
|
4484 |
-
|
4485 |
-
|
4486 |
-
|
4487 |
-
|
4488 |
-
|
4489 |
-
|
4490 |
-
|
4491 |
-
|
4492 |
-
|
4493 |
-
|
4494 |
-
|
4495 |
-
|
4496 |
-
|
4497 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4498 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4499 |
}
|
4500 |
});
|
4501 |
-
|
4502 |
-
|
4503 |
-
|
4504 |
-
|
4505 |
-
|
4506 |
-
|
4507 |
-
|
4508 |
-
|
4509 |
-
|
4510 |
-
|
4511 |
-
}
|
4512 |
-
|
4513 |
-
}
|
4514 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4515 |
|
4516 |
-
|
4517 |
-
|
4518 |
-
|
4519 |
-
|
4520 |
-
|
4521 |
-
|
4522 |
-
|
4523 |
-
|
4524 |
-
|
4525 |
-
|
4526 |
-
// $( document.body ).addClass( 'czr-customize-content_editor-pane-resize' );
|
4527 |
-
// self.$editorFrame.css( 'pointer-events', 'none' );
|
4528 |
-
// self.czrResizeEditor( event.pageY );
|
4529 |
-
// });
|
4530 |
-
// break;
|
4531 |
-
|
4532 |
-
// case 'mouseup' :
|
4533 |
-
// $( document ).off( 'mousemove.czr-customize-content_editor' );
|
4534 |
-
// $( document.body ).removeClass( 'czr-customize-content_editor-pane-resize' );
|
4535 |
-
// self.$editorFrame.css( 'pointer-events', '' );
|
4536 |
-
// break;
|
4537 |
-
// }
|
4538 |
-
// });
|
4539 |
},
|
|
|
|
|
4540 |
|
4541 |
|
4542 |
|
4543 |
|
4544 |
|
4545 |
-
czrResizeEditor : function( position ) {
|
4546 |
-
var self = this,
|
4547 |
-
//$sectionContent = input.container.closest( 'ul.accordion-section-content' ),
|
4548 |
-
windowHeight = window.innerHeight,
|
4549 |
-
windowWidth = window.innerWidth,
|
4550 |
-
minScroll = 40,
|
4551 |
-
maxScroll = 1,
|
4552 |
-
mobileWidth = 782,
|
4553 |
-
collapseMinSpacing = 56,
|
4554 |
-
collapseBottomOutsideEditor = 8,
|
4555 |
-
collapseBottomInsideEditor = 4,
|
4556 |
-
args = {},
|
4557 |
-
resizeHeight;
|
4558 |
-
|
4559 |
-
if ( ! api.sekEditorExpanded() ) {
|
4560 |
-
return;
|
4561 |
-
}
|
4562 |
-
|
4563 |
-
if ( ! _.isNaN( position ) ) {
|
4564 |
-
resizeHeight = windowHeight - position;
|
4565 |
-
}
|
4566 |
-
|
4567 |
-
args.height = resizeHeight;
|
4568 |
-
args.components = self.$mceTools.outerHeight() + self.$mceToolbar.outerHeight() + self.$mceStatusbar.outerHeight();
|
4569 |
-
|
4570 |
-
if ( resizeHeight < minScroll ) {
|
4571 |
-
args.height = minScroll;
|
4572 |
-
}
|
4573 |
-
|
4574 |
-
if ( resizeHeight > windowHeight - maxScroll ) {
|
4575 |
-
args.height = windowHeight - maxScroll;
|
4576 |
-
}
|
4577 |
-
|
4578 |
-
if ( windowHeight < self.$editorPane.outerHeight() ) {
|
4579 |
-
args.height = windowHeight;
|
4580 |
-
}
|
4581 |
|
4582 |
-
self.$preview.css( 'bottom', args.height );
|
4583 |
-
self.$editorPane.css( 'height', args.height );
|
4584 |
-
self.$editorFrame.css( 'height', args.height - args.components );
|
4585 |
-
self.$collapseSidebar.css(
|
4586 |
-
'bottom',
|
4587 |
-
collapseMinSpacing > windowHeight - args.height ? self.$mceStatusbar.outerHeight() + collapseBottomInsideEditor : args.height + collapseBottomOutsideEditor
|
4588 |
-
);
|
4589 |
|
4590 |
-
//$sectionContent.css( 'padding-bottom', windowWidth <= mobileWidth ? args.height : '' );
|
4591 |
-
}
|
4592 |
-
});//$.extend()
|
4593 |
-
})( wp.customize, jQuery );//global sektionsLocalizedData
|
4594 |
-
var CZRSeksPrototype = CZRSeksPrototype || {};
|
4595 |
-
(function ( api, $ ) {
|
4596 |
-
// Skope
|
4597 |
-
$.extend( CZRSeksPrototype, api.Events );
|
4598 |
-
var CZR_SeksConstructor = api.Class.extend( CZRSeksPrototype );
|
4599 |
|
4600 |
-
|
4601 |
-
|
4602 |
-
|
4603 |
-
// });
|
4604 |
-
try { api.czr_sektions = new CZR_SeksConstructor(); } catch( er ) {
|
4605 |
-
api.errare( 'api.czr_sektions => problem on instantiation', er );
|
4606 |
-
}
|
4607 |
-
})( wp.customize, jQuery );//global sektionsLocalizedData, serverControlParams
|
4608 |
-
//extends api.CZRDynModule
|
4609 |
( function ( api, $, _ ) {
|
4610 |
var Constructor = {
|
4611 |
initialize: function( id, options ) {
|
4612 |
-
//console.log('INITIALIZING SEKTION OPTIONS', id, options );
|
4613 |
var module = this;
|
4614 |
-
|
4615 |
-
|
4616 |
-
|
4617 |
-
|
|
|
4618 |
module.itemConstructor = api.CZRItem.extend( module.CZRItemConstructor || {} );
|
4619 |
-
|
4620 |
-
//run the parent initialize
|
4621 |
api.CZRDynModule.prototype.initialize.call( module, id, options );
|
4622 |
},//initialize
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4623 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4624 |
|
4625 |
-
|
4626 |
-
|
4627 |
-
var input
|
4628 |
-
|
4629 |
-
|
4630 |
-
|
4631 |
-
if ( _.isEmpty( sektionsLocalizedData.selectOptions[input.id] ) ) {
|
4632 |
-
api.errare( 'Missing select options for input id => ' + input.id + ' in module ' + module.module_type );
|
4633 |
-
return;
|
4634 |
-
} else {
|
4635 |
-
//generates the options
|
4636 |
-
_.each( sektionsLocalizedData.selectOptions[input.id] , function( title, value ) {
|
4637 |
-
var _attributes = {
|
4638 |
-
value : value,
|
4639 |
-
html: title
|
4640 |
-
};
|
4641 |
-
if ( value == input() ) {
|
4642 |
-
$.extend( _attributes, { selected : "selected" } );
|
4643 |
-
} else if ( 'px' === value ) {
|
4644 |
-
$.extend( _attributes, { selected : "selected" } );
|
4645 |
-
}
|
4646 |
-
$( 'select[data-czrtype]', input.container ).append( $('<option>', _attributes) );
|
4647 |
});
|
4648 |
-
$( 'select[data-czrtype]', input.container ).selecter();
|
4649 |
}
|
4650 |
-
|
4651 |
-
|
4652 |
|
4653 |
-
|
4654 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4655 |
ready : function() {
|
4656 |
var item = this;
|
4657 |
-
//wait for the input collection to be populated,
|
4658 |
-
//and then set the input visibility dependencies
|
4659 |
item.inputCollection.bind( function( col ) {
|
4660 |
if( _.isEmpty( col ) )
|
4661 |
return;
|
@@ -4663,136 +6775,189 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
4663 |
api.errorLog( 'item.setInputVisibilityDeps() : ' + er );
|
4664 |
}
|
4665 |
});//item.inputCollection.bind()
|
4666 |
-
|
4667 |
-
//fire the parent
|
4668 |
api.CZRItem.prototype.ready.call( item );
|
4669 |
},
|
4670 |
-
|
4671 |
-
|
4672 |
-
//Fired when the input collection is populated
|
4673 |
-
//At this point, the inputs are all ready (input.isReady.state() === 'resolved') and we can use their visible Value ( set to true by default )
|
4674 |
setInputVisibilityDeps : function() {
|
4675 |
var item = this,
|
4676 |
module = item.module;
|
4677 |
-
// input controller instance == this
|
4678 |
var scheduleVisibilityOfInputId = function( controlledInputId, visibilityCallBack ) {
|
4679 |
-
//Fire on init
|
4680 |
item.czr_Input( controlledInputId ).visible( visibilityCallBack() );
|
4681 |
-
//React on change
|
4682 |
this.bind( function( to ) {
|
4683 |
item.czr_Input( controlledInputId ).visible( visibilityCallBack() );
|
4684 |
});
|
4685 |
};
|
4686 |
-
//Internal item dependencies
|
4687 |
item.czr_Input.each( function( input ) {
|
4688 |
switch( input.id ) {
|
4689 |
-
case '
|
4690 |
-
_.each( [ '
|
4691 |
try { scheduleVisibilityOfInputId.call( input, _inputId_, function() {
|
4692 |
var bool = false;
|
4693 |
switch( _inputId_ ) {
|
4694 |
-
case '
|
4695 |
-
|
4696 |
-
bool = ! _.isEmpty( input() + '' ) && api.CZR_Helpers.isChecked( item.czr_Input('bg-apply-overlay')() );
|
4697 |
break;
|
4698 |
default :
|
4699 |
-
bool =
|
4700 |
break;
|
4701 |
}
|
4702 |
return bool;
|
4703 |
}); } catch( er ) {
|
4704 |
-
api.errare(
|
4705 |
}
|
4706 |
});
|
4707 |
break;
|
4708 |
-
case '
|
4709 |
-
_.each( [ '
|
4710 |
try { scheduleVisibilityOfInputId.call( input, _inputId_, function() {
|
4711 |
-
return
|
4712 |
}); } catch( er ) {
|
4713 |
-
api.errare(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4714 |
}
|
4715 |
});
|
4716 |
break;
|
4717 |
}
|
4718 |
});
|
4719 |
}
|
4720 |
-
}
|
4721 |
-
}
|
4722 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4723 |
|
4724 |
-
|
4725 |
-
//=> will determine :
|
4726 |
-
//1) how to initialize the module model. If not crud, then the initial item(s) model shall be provided
|
4727 |
-
//2) which js template(s) to use : if crud, the module template shall include the add new and pre-item elements.
|
4728 |
-
// , if crud, the item shall be removable
|
4729 |
-
//3) how to render : if multi item, the item content is rendered when user click on edit button.
|
4730 |
-
// If not multi item, the single item content is rendered as soon as the item wrapper is rendered.
|
4731 |
-
//4) some DOM behaviour. For example, a multi item shall be sortable.
|
4732 |
api.czrModuleMap = api.czrModuleMap || {};
|
4733 |
$.extend( api.czrModuleMap, {
|
4734 |
-
|
4735 |
mthds : Constructor,
|
4736 |
crud : false,
|
4737 |
-
name : api.czr_sektions.getRegisteredModuleProperty( '
|
4738 |
has_mod_opt : false,
|
4739 |
ready_on_section_expanded : true,
|
4740 |
-
defaultItemModel :
|
4741 |
-
{ id : '', title : '' },
|
4742 |
-
api.czr_sektions.getDefaultItemModelFromRegisteredModuleData( 'sek_level_bg_border_module' )
|
4743 |
-
)
|
4744 |
},
|
4745 |
});
|
4746 |
-
})( wp.customize , jQuery, _ )
|
4747 |
-
//extends api.CZRDynModule
|
4748 |
( function ( api, $, _ ) {
|
4749 |
var Constructor = {
|
4750 |
-
|
4751 |
-
|
4752 |
-
|
4753 |
-
|
4754 |
-
|
4755 |
-
module.itemConstructor = api.CZRItem.extend( module.CZRItemConstructor || {} );
|
4756 |
-
//run the parent initialize
|
4757 |
-
api.CZRDynModule.prototype.initialize.call( module, id, options );
|
4758 |
-
|
4759 |
-
},//initialize
|
4760 |
-
|
4761 |
-
CZRInputMths : {
|
4762 |
-
setupSelect : function() {
|
4763 |
-
var input = this,
|
4764 |
-
item = input.input_parent,
|
4765 |
-
module = input.module,
|
4766 |
-
_options_ = {};
|
4767 |
-
|
4768 |
-
if ( _.isEmpty( sektionsLocalizedData.selectOptions[input.id] ) ) {
|
4769 |
-
api.errare( 'Missing select options for input id => ' + input.id + ' in module ' + module.module_type );
|
4770 |
-
return;
|
4771 |
-
} else {
|
4772 |
-
//generates the options
|
4773 |
-
_.each( sektionsLocalizedData.selectOptions[input.id] , function( title, value ) {
|
4774 |
-
var _attributes = {
|
4775 |
-
value : value,
|
4776 |
-
html: title
|
4777 |
-
};
|
4778 |
-
if ( value == input() ) {
|
4779 |
-
$.extend( _attributes, { selected : "selected" } );
|
4780 |
-
} else if ( 'px' === value ) {
|
4781 |
-
$.extend( _attributes, { selected : "selected" } );
|
4782 |
-
}
|
4783 |
-
$( 'select[data-czrtype]', input.container ).append( $('<option>', _attributes) );
|
4784 |
-
});
|
4785 |
-
$( 'select[data-czrtype]', input.container ).selecter();
|
4786 |
}
|
4787 |
-
|
4788 |
-
|
|
|
|
|
4789 |
|
4790 |
-
|
4791 |
-
//overrides the parent ready
|
4792 |
ready : function() {
|
4793 |
var item = this;
|
4794 |
-
//wait for the input collection to be populated,
|
4795 |
-
//and then set the input visibility dependencies
|
4796 |
item.inputCollection.bind( function( col ) {
|
4797 |
if( _.isEmpty( col ) )
|
4798 |
return;
|
@@ -4800,498 +6965,834 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
4800 |
api.errorLog( 'item.setInputVisibilityDeps() : ' + er );
|
4801 |
}
|
4802 |
});//item.inputCollection.bind()
|
4803 |
-
|
4804 |
-
//fire the parent
|
4805 |
api.CZRItem.prototype.ready.call( item );
|
4806 |
},
|
4807 |
-
|
4808 |
-
|
4809 |
-
//Fired when the input collection is populated
|
4810 |
-
//At this point, the inputs are all ready (input.isReady.state() === 'resolved') and we can use their visible Value ( set to true by default )
|
4811 |
setInputVisibilityDeps : function() {
|
4812 |
var item = this,
|
4813 |
module = item.module;
|
4814 |
-
// input controller instance == this
|
4815 |
var scheduleVisibilityOfInputId = function( controlledInputId, visibilityCallBack ) {
|
4816 |
-
//Fire on init
|
4817 |
item.czr_Input( controlledInputId ).visible( visibilityCallBack() );
|
4818 |
-
//React on change
|
4819 |
this.bind( function( to ) {
|
4820 |
item.czr_Input( controlledInputId ).visible( visibilityCallBack() );
|
4821 |
});
|
4822 |
};
|
4823 |
-
//Internal item dependencies
|
4824 |
item.czr_Input.each( function( input ) {
|
4825 |
switch( input.id ) {
|
4826 |
-
case '
|
4827 |
-
|
4828 |
-
|
|
|
|
|
|
|
|
|
4829 |
});
|
4830 |
break;
|
4831 |
}
|
4832 |
});
|
4833 |
}
|
4834 |
}//CZRItemConstructor
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4835 |
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4836 |
|
4837 |
|
4838 |
-
|
4839 |
-
|
4840 |
-
|
4841 |
-
|
4842 |
-
|
4843 |
-
|
4844 |
-
|
4845 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4846 |
api.czrModuleMap = api.czrModuleMap || {};
|
4847 |
$.extend( api.czrModuleMap, {
|
4848 |
-
|
4849 |
mthds : Constructor,
|
4850 |
crud : false,
|
4851 |
-
name : api.czr_sektions.getRegisteredModuleProperty( '
|
4852 |
has_mod_opt : false,
|
4853 |
ready_on_section_expanded : true,
|
4854 |
-
defaultItemModel :
|
4855 |
-
|
4856 |
-
api.czr_sektions.getDefaultItemModelFromRegisteredModuleData( 'sek_level_height_module' )
|
4857 |
-
)
|
4858 |
-
},
|
4859 |
});
|
4860 |
})( wp.customize , jQuery, _ );//global sektionsLocalizedData, serverControlParams
|
4861 |
-
//extends api.CZRDynModule
|
4862 |
( function ( api, $, _ ) {
|
4863 |
var Constructor = {
|
4864 |
-
|
4865 |
-
|
4866 |
-
|
4867 |
-
|
4868 |
-
|
4869 |
-
|
4870 |
-
|
4871 |
-
|
4872 |
-
|
4873 |
-
},//initialize
|
4874 |
-
|
4875 |
-
CZRInputMths : {
|
4876 |
-
setupSelect : function() {
|
4877 |
-
var input = this,
|
4878 |
-
item = input.input_parent,
|
4879 |
-
module = input.module,
|
4880 |
-
_options_ = {};
|
4881 |
|
4882 |
-
|
4883 |
-
|
|
|
|
|
|
|
|
|
4884 |
return;
|
4885 |
-
|
4886 |
-
|
4887 |
-
|
4888 |
-
|
4889 |
-
|
4890 |
-
html: title
|
4891 |
-
};
|
4892 |
-
if ( value == input() ) {
|
4893 |
-
$.extend( _attributes, { selected : "selected" } );
|
4894 |
-
} else if ( 'px' === value ) {
|
4895 |
-
$.extend( _attributes, { selected : "selected" } );
|
4896 |
-
}
|
4897 |
-
$( 'select[data-czrtype]', input.container ).append( $('<option>', _attributes) );
|
4898 |
-
});
|
4899 |
-
$( 'select[data-czrtype]', input.container ).selecter();
|
4900 |
-
}
|
4901 |
},
|
4902 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4903 |
};
|
4904 |
-
|
4905 |
-
|
4906 |
-
//provides a description of each module
|
4907 |
-
//=> will determine :
|
4908 |
-
//1) how to initialize the module model. If not crud, then the initial item(s) model shall be provided
|
4909 |
-
//2) which js template(s) to use : if crud, the module template shall include the add new and pre-item elements.
|
4910 |
-
// , if crud, the item shall be removable
|
4911 |
-
//3) how to render : if multi item, the item content is rendered when user click on edit button.
|
4912 |
-
// If not multi item, the single item content is rendered as soon as the item wrapper is rendered.
|
4913 |
-
//4) some DOM behaviour. For example, a multi item shall be sortable.
|
4914 |
api.czrModuleMap = api.czrModuleMap || {};
|
4915 |
$.extend( api.czrModuleMap, {
|
4916 |
-
|
4917 |
mthds : Constructor,
|
4918 |
crud : false,
|
4919 |
-
name : api.czr_sektions.getRegisteredModuleProperty( '
|
4920 |
has_mod_opt : false,
|
4921 |
ready_on_section_expanded : true,
|
4922 |
-
defaultItemModel :
|
4923 |
-
|
4924 |
-
api.czr_sektions.getDefaultItemModelFromRegisteredModuleData( 'sek_level_section_layout_module' )
|
4925 |
-
)
|
4926 |
-
},
|
4927 |
});
|
4928 |
})( wp.customize , jQuery, _ );//global sektionsLocalizedData, serverControlParams
|
4929 |
-
//extends api.CZRDynModule
|
4930 |
( function ( api, $, _ ) {
|
4931 |
-
var
|
4932 |
-
|
4933 |
-
|
4934 |
-
|
4935 |
-
|
4936 |
-
|
4937 |
-
|
4938 |
-
|
4939 |
-
|
4940 |
-
|
4941 |
-
|
4942 |
-
CZRSpacingInputMths : {
|
4943 |
-
// initialize : function( name, options ) {
|
4944 |
-
// var input = this;
|
4945 |
-
// api.CZRInput.prototype.initialize.call( input, name, options );
|
4946 |
-
// },
|
4947 |
-
|
4948 |
-
setupSelect : function() {
|
4949 |
-
var input = this,
|
4950 |
-
item = input.input_parent,
|
4951 |
-
module = input.module;
|
4952 |
-
//generates the options
|
4953 |
-
_.each( sektionsLocalizedData.selectOptions.spacingUnits , function( title, value ) {
|
4954 |
-
var _attributes = {
|
4955 |
-
value : value,
|
4956 |
-
html: title
|
4957 |
-
};
|
4958 |
-
if ( value == input() ) {
|
4959 |
-
$.extend( _attributes, { selected : "selected" } );
|
4960 |
-
} else if ( 'px' === value ) {
|
4961 |
-
$.extend( _attributes, { selected : "selected" } );
|
4962 |
-
}
|
4963 |
-
$( 'select[data-czrtype]', input.container ).append( $('<option>', _attributes) );
|
4964 |
-
});
|
4965 |
-
$( 'select[data-czrtype]', input.container ).selecter();
|
4966 |
-
},
|
4967 |
-
},//CZRSpacingInputMths
|
4968 |
|
4969 |
-
|
4970 |
-
|
4971 |
-
|
4972 |
var item = this;
|
4973 |
-
|
4974 |
-
|
4975 |
-
|
4976 |
-
|
4977 |
-
|
4978 |
-
api.errare( 'spacing input => error when binding the tab switch event', er );
|
4979 |
}
|
4980 |
-
|
4981 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4982 |
}
|
4983 |
});
|
4984 |
}
|
4985 |
-
|
4986 |
};
|
4987 |
-
|
4988 |
-
|
4989 |
-
//provides a description of each module
|
4990 |
-
//=> will determine :
|
4991 |
-
//1) how to initialize the module model. If not crud, then the initial item(s) model shall be provided
|
4992 |
-
//2) which js template(s) to use : if crud, the module template shall include the add new and pre-item elements.
|
4993 |
-
// , if crud, the item shall be removable
|
4994 |
-
//3) how to render : if multi item, the item content is rendered when user click on edit button.
|
4995 |
-
// If not multi item, the single item content is rendered as soon as the item wrapper is rendered.
|
4996 |
-
//4) some DOM behaviour. For example, a multi item shall be sortable.
|
4997 |
api.czrModuleMap = api.czrModuleMap || {};
|
4998 |
$.extend( api.czrModuleMap, {
|
4999 |
-
|
5000 |
-
mthds :
|
5001 |
crud : false,
|
5002 |
-
name : api.czr_sektions.getRegisteredModuleProperty( '
|
5003 |
has_mod_opt : false,
|
5004 |
ready_on_section_expanded : true,
|
5005 |
-
defaultItemModel :
|
5006 |
-
|
5007 |
-
api.czr_sektions.getDefaultItemModelFromRegisteredModuleData( 'sek_spacing_module' )
|
5008 |
-
)
|
5009 |
-
},
|
5010 |
});
|
5011 |
})( wp.customize , jQuery, _ );//global sektionsLocalizedData, serverControlParams
|
5012 |
-
//extends api.CZRDynModule
|
5013 |
( function ( api, $, _ ) {
|
5014 |
-
|
5015 |
-
|
5016 |
-
|
5017 |
-
|
5018 |
-
|
5019 |
-
|
5020 |
-
|
5021 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5022 |
api.czrModuleMap = api.czrModuleMap || {};
|
5023 |
$.extend( api.czrModuleMap, {
|
5024 |
-
|
5025 |
-
|
5026 |
crud : false,
|
5027 |
-
name : api.czr_sektions.getRegisteredModuleProperty( '
|
5028 |
has_mod_opt : false,
|
5029 |
ready_on_section_expanded : true,
|
5030 |
-
defaultItemModel :
|
5031 |
-
{ id : '', title : '' },
|
5032 |
-
api.czr_sektions.getDefaultItemModelFromRegisteredModuleData( 'sek_module_picker_module' )
|
5033 |
-
)
|
5034 |
-
},
|
5035 |
-
});
|
5036 |
-
|
5037 |
-
api.czrInputMap = api.czrInputMap || {};
|
5038 |
-
|
5039 |
-
//input_type => callback fn to fire in the Input constructor on initialize
|
5040 |
-
//the callback can receive specific params define in each module constructor
|
5041 |
-
//For example, a content picker can be given params to display only taxonomies
|
5042 |
-
$.extend( api.czrInputMap, {
|
5043 |
-
module_picker : function( input_options ) {
|
5044 |
-
var input = this;
|
5045 |
-
// Mouse effect with cursor: -webkit-grab; -webkit-grabbing;
|
5046 |
-
// input.container.find('[draggable]').each( function() {
|
5047 |
-
// $(this).on( 'mousedown mouseup', function( evt ) {
|
5048 |
-
// switch( evt.type ) {
|
5049 |
-
// case 'mousedown' :
|
5050 |
-
// //$(this).addClass('sek-grabbing');
|
5051 |
-
// break;
|
5052 |
-
// case 'mouseup' :
|
5053 |
-
// //$(this).removeClass('sek-grabbing');
|
5054 |
-
// break;
|
5055 |
-
// }
|
5056 |
-
// });
|
5057 |
-
// });
|
5058 |
-
api.czr_sektions.trigger( 'sek-refresh-dragzones', { type : 'module', input_container : input.container } );
|
5059 |
-
//console.log( this.id, input_options );
|
5060 |
}
|
5061 |
});
|
5062 |
})( wp.customize , jQuery, _ );//global sektionsLocalizedData, serverControlParams
|
5063 |
-
//extends api.CZRDynModule
|
5064 |
( function ( api, $, _ ) {
|
5065 |
-
var
|
5066 |
-
|
5067 |
-
|
5068 |
-
|
5069 |
-
|
5070 |
-
|
5071 |
-
|
5072 |
-
// EXTEND THE DEFAULT CONSTRUCTORS FOR INPUT
|
5073 |
-
module.inputConstructor = api.CZRInput.extend( module.CZRImageInputMths || {} );
|
5074 |
-
// EXTEND THE DEFAULT CONSTRUCTORS FOR MONOMODEL
|
5075 |
-
module.itemConstructor = api.CZRItem.extend( module.CZRItemConstructor || {} );
|
5076 |
-
|
5077 |
-
//SET THE CONTENT PICKER DEFAULT OPTIONS
|
5078 |
-
//@see ::setupContentPicker()
|
5079 |
-
module.bind( 'set_default_content_picker_options', function( params ) {
|
5080 |
-
params.defaultContentPickerOption.defaultOption = {
|
5081 |
-
'title' : '<span style="font-weight:bold">' + sektionsLocalizedData.i18n['Set a custom url'] + '</span>',
|
5082 |
-
'type' : '',
|
5083 |
-
'type_label' : '',
|
5084 |
-
'object' : '',
|
5085 |
-
'id' : '_custom_',
|
5086 |
-
'url' : ''
|
5087 |
-
};
|
5088 |
-
return params;
|
5089 |
-
});
|
5090 |
-
},//initialize
|
5091 |
-
|
5092 |
-
CZRImageInputMths : {
|
5093 |
-
// initialize : function( name, options ) {
|
5094 |
-
// var input = this;
|
5095 |
-
// api.CZRInput.prototype.initialize.call( input, name, options );
|
5096 |
-
// },
|
5097 |
-
|
5098 |
-
setupSelect : function() {
|
5099 |
-
var input = this,
|
5100 |
-
item = input.input_parent,
|
5101 |
-
module = input.module,
|
5102 |
-
_options_ = {};
|
5103 |
-
|
5104 |
-
if ( _.isEmpty( sektionsLocalizedData.selectOptions[input.id] ) ) {
|
5105 |
-
api.errare( 'Missing select options for input id => ' + input.id + ' in image module');
|
5106 |
-
return;
|
5107 |
-
} else {
|
5108 |
-
//generates the options
|
5109 |
-
_.each( sektionsLocalizedData.selectOptions[input.id] , function( title, value ) {
|
5110 |
-
var _attributes = {
|
5111 |
-
value : value,
|
5112 |
-
html: title
|
5113 |
-
};
|
5114 |
-
if ( value == input() ) {
|
5115 |
-
$.extend( _attributes, { selected : "selected" } );
|
5116 |
-
} else if ( 'px' === value ) {
|
5117 |
-
$.extend( _attributes, { selected : "selected" } );
|
5118 |
-
}
|
5119 |
-
$( 'select[data-czrtype]', input.container ).append( $('<option>', _attributes) );
|
5120 |
-
});
|
5121 |
-
$( 'select[data-czrtype]', input.container ).selecter();
|
5122 |
}
|
5123 |
-
|
5124 |
-
|
5125 |
-
|
5126 |
-
// _isChecked : function( v ) {
|
5127 |
-
// return 0 !== v && '0' !== v && false !== v && 'off' !== v;
|
5128 |
-
// },
|
5129 |
-
//////////////////////////////////////////////////////////
|
5130 |
-
/// ITEM CONSTRUCTOR
|
5131 |
-
//////////////////////////////////////////
|
5132 |
-
CZRItemConstructor : {
|
5133 |
-
//overrides the parent ready
|
5134 |
-
ready : function() {
|
5135 |
-
var item = this;
|
5136 |
-
//wait for the input collection to be populated,
|
5137 |
-
//and then set the input visibility dependencies
|
5138 |
-
item.inputCollection.bind( function( col ) {
|
5139 |
-
if( _.isEmpty( col ) )
|
5140 |
-
return;
|
5141 |
-
try { item.setInputVisibilityDeps(); } catch( er ) {
|
5142 |
-
api.errorLog( 'item.setInputVisibilityDeps() : ' + er );
|
5143 |
-
}
|
5144 |
-
});//item.inputCollection.bind()
|
5145 |
-
|
5146 |
-
//fire the parent
|
5147 |
-
api.CZRItem.prototype.ready.call( item );
|
5148 |
-
},
|
5149 |
-
|
5150 |
-
|
5151 |
-
//Fired when the input collection is populated
|
5152 |
-
//At this point, the inputs are all ready (input.isReady.state() === 'resolved') and we can use their visible Value ( set to true by default )
|
5153 |
-
setInputVisibilityDeps : function() {
|
5154 |
-
var item = this,
|
5155 |
-
module = item.module;
|
5156 |
-
// input controller instance == this
|
5157 |
-
var scheduleVisibilityOfInputId = function( controlledInputId, visibilityCallBack ) {
|
5158 |
-
//Fire on init
|
5159 |
-
item.czr_Input( controlledInputId ).visible( visibilityCallBack() );
|
5160 |
-
//React on change
|
5161 |
-
this.bind( function( to ) {
|
5162 |
-
item.czr_Input( controlledInputId ).visible( visibilityCallBack() );
|
5163 |
-
});
|
5164 |
-
};
|
5165 |
-
//Internal item dependencies
|
5166 |
-
item.czr_Input.each( function( input ) {
|
5167 |
-
switch( input.id ) {
|
5168 |
-
case 'link-to' :
|
5169 |
-
_.each( [ 'link-pick-url', 'link-custom-url', 'link-target' ] , function( _inputId_ ) {
|
5170 |
-
try { scheduleVisibilityOfInputId.call( input, _inputId_, function() {
|
5171 |
-
var bool = false;
|
5172 |
-
switch( _inputId_ ) {
|
5173 |
-
case 'link-custom-url' :
|
5174 |
-
bool = 'url' == input() && '_custom_' == item.czr_Input('link-pick-url')().id;
|
5175 |
-
break;
|
5176 |
-
default :
|
5177 |
-
bool = 'url' == input();
|
5178 |
-
break;
|
5179 |
-
}
|
5180 |
-
return bool;
|
5181 |
-
}); } catch( er ) {
|
5182 |
-
api.errare( 'Image module => error in setInputVisibilityDeps', er );
|
5183 |
-
}
|
5184 |
-
});
|
5185 |
-
break;
|
5186 |
-
case 'link-pick-url' :
|
5187 |
-
scheduleVisibilityOfInputId.call( input, 'link-custom-url', function() {
|
5188 |
-
return '_custom_' == input().id && 'url' == item.czr_Input('link-to')();
|
5189 |
-
});
|
5190 |
-
break;
|
5191 |
-
}
|
5192 |
-
});
|
5193 |
-
}
|
5194 |
-
},//CZRItemConstructor
|
5195 |
|
5196 |
-
|
5197 |
-
|
5198 |
-
//provides a description of each module
|
5199 |
-
//=> will determine :
|
5200 |
-
//1) how to initialize the module model. If not crud, then the initial item(s) model shall be provided
|
5201 |
-
//2) which js template(s) to use : if crud, the module template shall include the add new and pre-item elements.
|
5202 |
-
// , if crud, the item shall be removable
|
5203 |
-
//3) how to render : if multi item, the item content is rendered when user click on edit button.
|
5204 |
-
// If not multi item, the single item content is rendered as soon as the item wrapper is rendered.
|
5205 |
-
//4) some DOM behaviour. For example, a multi item shall be sortable.
|
5206 |
api.czrModuleMap = api.czrModuleMap || {};
|
5207 |
$.extend( api.czrModuleMap, {
|
5208 |
-
|
5209 |
-
mthds :
|
5210 |
crud : false,
|
5211 |
-
name : api.czr_sektions.getRegisteredModuleProperty( '
|
5212 |
has_mod_opt : false,
|
5213 |
ready_on_section_expanded : true,
|
5214 |
-
defaultItemModel : api.czr_sektions.getDefaultItemModelFromRegisteredModuleData( '
|
5215 |
-
}
|
5216 |
});
|
5217 |
})( wp.customize , jQuery, _ );//global sektionsLocalizedData, serverControlParams
|
5218 |
-
//extends api.CZRDynModule
|
5219 |
( function ( api, $, _ ) {
|
5220 |
-
|
5221 |
-
|
5222 |
-
|
5223 |
-
|
5224 |
-
|
5225 |
-
|
5226 |
-
|
5227 |
-
|
5228 |
-
|
5229 |
-
|
5230 |
-
|
5231 |
-
|
5232 |
-
|
5233 |
-
|
5234 |
-
|
5235 |
-
|
5236 |
-
|
5237 |
-
|
5238 |
-
|
5239 |
-
|
5240 |
-
|
5241 |
-
|
5242 |
-
});
|
5243 |
-
}
|
5244 |
-
},
|
5245 |
-
|
5246 |
-
setupSelect : function() {
|
5247 |
-
var input = this,
|
5248 |
-
item = input.input_parent,
|
5249 |
-
module = input.module,
|
5250 |
-
_options_ = {};
|
5251 |
|
5252 |
-
|
5253 |
-
|
|
|
|
|
|
|
|
|
5254 |
return;
|
5255 |
-
|
5256 |
-
|
5257 |
-
|
5258 |
-
|
5259 |
-
|
5260 |
-
|
5261 |
-
|
5262 |
-
|
5263 |
-
|
5264 |
-
|
5265 |
-
|
5266 |
-
|
5267 |
-
|
5268 |
-
|
5269 |
-
|
5270 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5271 |
}
|
5272 |
-
|
5273 |
-
|
5274 |
-
// CZRSocialsItem : { },//CZRSocialsItem
|
5275 |
-
};//TinyMceEditorModuleConstructor
|
5276 |
-
|
5277 |
-
|
5278 |
-
//provides a description of each module
|
5279 |
-
//=> will determine :
|
5280 |
-
//1) how to initialize the module model. If not crud, then the initial item(s) model shall be provided
|
5281 |
-
//2) which js template(s) to use : if crud, the module template shall include the add new and pre-item elements.
|
5282 |
-
// , if crud, the item shall be removable
|
5283 |
-
//3) how to render : if multi item, the item content is rendered when user click on edit button.
|
5284 |
-
// If not multi item, the single item content is rendered as soon as the item wrapper is rendered.
|
5285 |
-
//4) some DOM behaviour. For example, a multi item shall be sortable.
|
5286 |
api.czrModuleMap = api.czrModuleMap || {};
|
5287 |
$.extend( api.czrModuleMap, {
|
5288 |
-
|
5289 |
-
mthds :
|
5290 |
crud : false,
|
5291 |
-
name : api.czr_sektions.getRegisteredModuleProperty( '
|
5292 |
has_mod_opt : false,
|
5293 |
ready_on_section_expanded : true,
|
5294 |
-
defaultItemModel : api.czr_sektions.getDefaultItemModelFromRegisteredModuleData( '
|
5295 |
-
}
|
5296 |
});
|
5297 |
})( wp.customize , jQuery, _ );
|
1 |
+
|
2 |
var CZRSeksPrototype = CZRSeksPrototype || {};
|
3 |
(function ( api, $ ) {
|
4 |
$.extend( CZRSeksPrototype, {
|
8 |
if ( _.isUndefined( window.sektionsLocalizedData ) ) {
|
9 |
throw new Error( 'CZRSeksPrototype => missing localized server params sektionsLocalizedData' );
|
10 |
}
|
|
|
11 |
if ( ! _.isFunction( api.czr_activeSkopes ) ) {
|
12 |
throw new Error( 'CZRSeksPrototype => api.czr_activeSkopes' );
|
13 |
}
|
|
|
14 |
self.MAX_NUMBER_OF_COLUMNS = 12;
|
|
|
|
|
|
|
15 |
self.SETTING_UPDATE_BUFFER = 50;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
self.defaultSektionSettingValue = sektionsLocalizedData.defaultSektionSettingValue;
|
|
|
|
|
17 |
self.sekCollectionSettingId = new api.Value( {} );
|
|
|
|
|
|
|
|
|
18 |
self.registered = new api.Value([]);
|
19 |
|
20 |
api.bind( 'ready', function() {
|
|
|
21 |
self.registerAndSetupDefaultPanelSectionOptions();
|
|
|
|
|
|
|
|
|
|
|
22 |
self.sekCollectionSettingId.callbacks.add( function( collectionSettingIds, previousCollectionSettingIds ) {
|
|
|
|
|
23 |
try { self.setupSettingToBeSaved(); } catch( er ) {
|
24 |
api.errare( 'Error in self.sekCollectionSettingId.callbacks => self.setupSettingsToBeSaved()' , er );
|
25 |
}
|
26 |
});
|
27 |
+
var doSkopeDependantActions = function( newSkopes, previousSkopes ) {
|
28 |
+
self.setContextualCollectionSettingIdWhenSkopeSet( newSkopes, previousSkopes );
|
29 |
+
self.generateUI({ action : 'sek-generate-local-skope-options-ui'});
|
30 |
+
self.generateUI({ action : 'sek-generate-global-options-ui'});
|
31 |
+
};
|
32 |
if ( ! _.isEmpty( api.czr_activeSkopes().local ) ) {
|
33 |
+
doSkopeDependantActions();
|
34 |
}
|
|
|
|
|
35 |
api.czr_activeSkopes.callbacks.add( function( newSkopes, previousSkopes ) {
|
36 |
+
doSkopeDependantActions( newSkopes, previousSkopes );
|
37 |
});
|
|
|
|
|
38 |
self.reactToPreviewMsg();
|
|
|
|
|
39 |
self.setupDnd();
|
|
|
|
|
|
|
|
|
40 |
self.setupTinyMceEditor();
|
|
|
|
|
41 |
self.schedulePrintSectionJson();
|
|
|
|
|
|
|
|
|
42 |
self.bind( 'sek-ui-removed', function() {
|
43 |
api.previewedDevice( 'desktop' );
|
44 |
});
|
|
|
|
|
|
|
|
|
45 |
api.previewedDevice.bind( function( device ) {
|
46 |
var currentControls = _.filter( self.registered(), function( uiData ) {
|
47 |
return 'control' == uiData.what;
|
54 |
});
|
55 |
});
|
56 |
});
|
|
|
|
|
57 |
$('#customize-notifications-area').on( 'click', '[data-sek-reset="true"]', function() {
|
58 |
self.resetCollectionSetting();
|
59 |
});
|
|
|
|
|
|
|
|
|
|
|
60 |
self.bind( 'sek-ui-pre-removal', function( params ) {
|
|
|
61 |
if ( 'control' == params.what && -1 < params.id.indexOf( 'draggable') ) {
|
62 |
api.control( params.id, function( _ctrl_ ) {
|
63 |
_ctrl_.container.find( '[draggable]' ).each( function() {
|
65 |
});
|
66 |
});
|
67 |
}
|
|
|
|
|
|
|
68 |
if ( 'control' == params.what ) {
|
69 |
api.control( params.id, function( _ctrl_ ) {
|
70 |
_ctrl_.container.find( 'select' ).each( function() {
|
75 |
});
|
76 |
}
|
77 |
});
|
78 |
+
api.bind( 'czr-new-registered', function( params ) {
|
79 |
+
if ( _.isUndefined( params.origin ) ) {
|
80 |
+
throw new Error( 'czr-new-registered event => missing params.origin' );
|
81 |
+
}
|
82 |
+
if ( 'nimble' !== params.origin )
|
83 |
+
return;
|
84 |
+
if ( false !== params.track ) {
|
85 |
+
var currentlyRegistered = self.registered();
|
86 |
+
var newRegistered = $.extend( true, [], currentlyRegistered );
|
87 |
+
var duplicateCandidate = _.findWhere( newRegistered, { id : params.id } );
|
88 |
+
if ( ! _.isEmpty( duplicateCandidate ) && _.isEqual( duplicateCandidate, params ) ) {
|
89 |
+
throw new Error( 'register => duplicated element in self.registered() collection ' + params.id );
|
90 |
+
}
|
91 |
+
newRegistered.push( params );
|
92 |
+
self.registered( newRegistered );
|
93 |
+
}
|
94 |
+
});
|
95 |
+
self.setupTopBar();//@see specific dev file
|
96 |
});//api.bind( 'ready' )
|
|
|
|
|
|
|
|
|
97 |
|
98 |
+
},// initialize()
|
|
|
|
|
|
|
|
|
|
|
99 |
registerAndSetupDefaultPanelSectionOptions : function() {
|
100 |
var self = this;
|
|
|
|
|
101 |
var SektionPanelConstructor = api.Panel.extend({
|
|
|
|
|
102 |
isContextuallyActive : function () {
|
103 |
return this.active();
|
104 |
},
|
105 |
_toggleActive : function(){ return true; }
|
106 |
});
|
|
|
|
|
|
|
107 |
api.panel( sektionsLocalizedData.sektionsPanelId, function( _mainPanel_ ) {
|
108 |
_mainPanel_.deferred.embedded.done( function() {
|
109 |
var $sidePanelTitleEl = _mainPanel_.container.find('h3.accordion-section-title'),
|
110 |
$topPanelTitleEl = _mainPanel_.container.find('.panel-meta .accordion-section-title'),
|
111 |
logoHtml = [ '<img class="sek-nimble-logo" alt="'+ _mainPanel_.params.title +'" src="', sektionsLocalizedData.baseUrl, '/assets/img/nimble/nimble_horizontal.svg', '"/>' ].join('');
|
112 |
|
|
|
|
|
|
|
113 |
if ( 0 < $sidePanelTitleEl.length ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
114 |
var $sidePanelTitleElSpan = $sidePanelTitleEl.find('span');
|
115 |
$sidePanelTitleEl
|
116 |
.addClass('sek-side-nimble-logo-wrapper')
|
117 |
.html( logoHtml )
|
118 |
.append( $sidePanelTitleElSpan );
|
119 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
120 |
});
|
121 |
});
|
122 |
+
api.CZR_Helpers.register({
|
123 |
+
origin : 'nimble',
|
|
|
124 |
what : 'panel',
|
125 |
id : sektionsLocalizedData.sektionsPanelId,//'__sektions__'
|
126 |
title: sektionsLocalizedData.i18n['Nimble Builder'],
|
127 |
+
priority : -1000,
|
128 |
constructWith : SektionPanelConstructor,
|
129 |
+
track : false,//don't register in the self.registered() => this will prevent this container to be removed when cleaning the registered
|
130 |
+
});
|
131 |
+
api.CZR_Helpers.register({
|
132 |
+
origin : 'nimble',
|
133 |
+
what : 'section',
|
134 |
+
id : '__globalAndLocalOptionsSection',
|
135 |
+
title: sektionsLocalizedData.i18n['Site wide options'],
|
136 |
+
panel : sektionsLocalizedData.sektionsPanelId,
|
137 |
+
priority : 20,
|
138 |
+
track : false,//don't register in the self.registered() => this will prevent this container to be removed when cleaning the registered
|
139 |
+
constructWith : api.Section.extend({
|
140 |
+
isContextuallyActive : function () {
|
141 |
+
return this.active();
|
142 |
+
},
|
143 |
+
_toggleActive : function(){ return true; }
|
144 |
+
})
|
145 |
+
}).done( function() {
|
146 |
+
api.section( '__globalAndLocalOptionsSection', function( _section_ ) {
|
147 |
+
var $sectionTitleEl = _section_.container.find('.accordion-section-title'),
|
148 |
+
$panelTitleEl = _section_.container.find('.customize-section-title h3');
|
149 |
+
if ( 0 < $sectionTitleEl.length ) {
|
150 |
+
$sectionTitleEl.prepend( '<i class="fas fa-globe sek-level-option-icon"></i>' );
|
151 |
+
}
|
152 |
+
if ( 0 < $panelTitleEl.length ) {
|
153 |
+
$panelTitleEl.find('.customize-action').after( '<i class="fas fa-globe sek-level-option-icon"></i>' );
|
154 |
+
}
|
155 |
+
self.scheduleModuleAccordion.call( _section_ );
|
156 |
+
});
|
157 |
+
});
|
158 |
+
api.CZR_Helpers.register({
|
159 |
+
origin : 'nimble',
|
160 |
+
what : 'section',
|
161 |
+
id : '__localOptionsSection',//<= the section id doesn't need to be skope dependant. Only the control id is skope dependant.
|
162 |
+
title: sektionsLocalizedData.i18n['Current page options'],
|
163 |
+
panel : sektionsLocalizedData.sektionsPanelId,
|
164 |
+
priority : 10,
|
165 |
+
track : false,//don't register in the self.registered() => this will prevent this container to be removed when cleaning the registered
|
166 |
+
constructWith : api.Section.extend({
|
167 |
+
isContextuallyActive : function () {
|
168 |
+
return this.active();
|
169 |
+
},
|
170 |
+
_toggleActive : function(){ return true; }
|
171 |
+
})
|
172 |
+
}).done( function() {
|
173 |
+
api.section( '__localOptionsSection', function( _section_ ) {
|
174 |
+
var $sectionTitleEl = _section_.container.find('.accordion-section-title'),
|
175 |
+
$panelTitleEl = _section_.container.find('.customize-section-title h3');
|
176 |
+
if ( 0 < $sectionTitleEl.length ) {
|
177 |
+
$sectionTitleEl.prepend( '<i class="fas fa-map-marker-alt sek-level-option-icon"></i>' );
|
178 |
+
}
|
179 |
+
if ( 0 < $panelTitleEl.length ) {
|
180 |
+
$panelTitleEl.find('.customize-action').after( '<i class="fas fa-map-marker-alt sek-level-option-icon"></i>' );
|
181 |
+
}
|
182 |
+
self.scheduleModuleAccordion.call( _section_ );
|
183 |
+
});
|
184 |
+
});
|
185 |
+
api.CZR_Helpers.register( {
|
186 |
+
origin : 'nimble',
|
187 |
+
what : 'setting',
|
188 |
+
id : sektionsLocalizedData.optNameForGlobalOptions,
|
189 |
+
dirty : false,
|
190 |
+
value : sektionsLocalizedData.globalOptionDBValues,
|
191 |
+
transport : 'refresh',//'refresh',//// ,
|
192 |
+
type : 'option'
|
193 |
});
|
|
|
194 |
},//mayBeRegisterAndSetupAddNewSektionSection()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
195 |
setContextualCollectionSettingIdWhenSkopeSet : function( newSkopes, previousSkopes ) {
|
196 |
var self = this;
|
197 |
+
previousSkopes = previousSkopes || {};
|
|
|
198 |
if ( ! _.isEmpty( previousSkopes.local ) && api.panel( sektionsLocalizedData.sektionsPanelId ).expanded() ) {
|
199 |
+
api.previewer.trigger('sek-pick-content');
|
|
|
200 |
}
|
|
|
|
|
201 |
sektionsData = api.czr_skopeBase.getSkopeProperty( 'sektions', 'local');
|
202 |
if ( sektionsLocalizedData.isDevMode ) {
|
203 |
api.infoLog( '::setContextualCollectionSettingIdWhenSkopeSet => SEKTIONS DATA ? ', sektionsData );
|
212 |
}
|
213 |
});//$.extend()
|
214 |
})( wp.customize, jQuery );
|
|
|
215 |
var CZRSeksPrototype = CZRSeksPrototype || {};
|
216 |
(function ( api, $ ) {
|
217 |
$.extend( CZRSeksPrototype, {
|
218 |
+
setupTopBar : function() {
|
219 |
+
var self = this;
|
220 |
+
self.topBarVisible = new api.Value( false );
|
221 |
+
self.topBarVisible.bind( function( visible ){
|
222 |
+
self.toggleTopBar( visible );
|
223 |
+
});
|
224 |
+
|
225 |
+
self.mouseMovedRecently = new api.Value( {} );
|
226 |
+
self.mouseMovedRecently.bind( function( position ) {
|
227 |
+
self.topBarVisible( ! _.isEmpty( position ) );
|
228 |
+
});
|
229 |
+
|
230 |
+
var trackMouseMovements = function( evt ) {
|
231 |
+
self.mouseMovedRecently( { x : evt.clientX, y : evt.clientY } );
|
232 |
+
clearTimeout( $(window).data('_scroll_move_timer_') );
|
233 |
+
$(window).data('_scroll_move_timer_', setTimeout(function() {
|
234 |
+
self.mouseMovedRecently.set( {} );
|
235 |
+
}, 4000 ) );
|
236 |
+
};
|
237 |
+
$(window).on( 'mousemove scroll,', _.throttle( trackMouseMovements , 50 ) );
|
238 |
+
api.previewer.bind('ready', function() {
|
239 |
+
$(api.previewer.targetWindow().document ).on( 'mousemove scroll,', _.throttle( trackMouseMovements , 50 ) );
|
240 |
+
});
|
241 |
+
self.historyLog = new api.Value([]);
|
242 |
+
self.historyLog.bind( function( newLog ) {
|
243 |
+
if ( _.isEmpty( newLog ) )
|
244 |
+
return;
|
245 |
+
|
246 |
+
var newCurrentKey = _.findKey( newLog, { status : 'current'} );
|
247 |
+
newCurrentKey = Number( newCurrentKey );
|
248 |
+
$( '#nimble-top-bar' ).find('[data-nimble-history]').each( function() {
|
249 |
+
if ( 'undo' === $(this).data('nimble-history') ) {
|
250 |
+
$(this).attr('data-nimble-state', 0 >= newCurrentKey ? 'disabled' : 'enabled');
|
251 |
+
} else {
|
252 |
+
$(this).attr('data-nimble-state', newLog.length <= ( newCurrentKey + 1 ) ? 'disabled' : 'enabled');
|
253 |
+
}
|
254 |
+
});
|
255 |
+
});
|
256 |
+
},
|
257 |
+
toggleTopBar : function( visible ) {
|
258 |
+
visible = _.isUndefined( visible ) ? true : visible;
|
259 |
+
var self = this,
|
260 |
+
_renderAndSetup = function() {
|
261 |
+
$.when( self.renderAndSetupTopBarTmpl({}) ).done( function( $_el ) {
|
262 |
+
self.topBarContainer = $_el;
|
263 |
+
_.delay( function() {
|
264 |
+
$('body').addClass('nimble-top-bar-visible');
|
265 |
+
}, 200 );
|
266 |
+
});
|
267 |
+
},
|
268 |
+
_hide = function() {
|
269 |
+
var dfd = $.Deferred();
|
270 |
+
$('body').removeClass('nimble-top-bar-visible');
|
271 |
+
if ( self.topBarContainer && self.topBarContainer.length ) {
|
272 |
+
_.delay( function() {
|
273 |
+
dfd.resolve();
|
274 |
+
}, 300 );
|
275 |
+
} else {
|
276 |
+
dfd.resolve();
|
277 |
+
}
|
278 |
+
return dfd.promise();
|
279 |
+
};
|
280 |
+
|
281 |
+
if ( visible ) {
|
282 |
+
_renderAndSetup();
|
283 |
+
} else {
|
284 |
+
_hide().done( function() {
|
285 |
+
self.topBarVisible( false );//should be already false
|
286 |
+
});
|
287 |
+
}
|
288 |
+
},
|
289 |
+
renderAndSetupTopBarTmpl : function( params ) {
|
290 |
+
if ( $( '#nimble-top-bar' ).length > 0 )
|
291 |
+
return $( '#nimble-top-bar' );
|
292 |
+
|
293 |
+
var self = this;
|
294 |
+
|
295 |
+
try {
|
296 |
+
_tmpl = wp.template( 'nimble-top-bar' )( {} );
|
297 |
+
} catch( er ) {
|
298 |
+
api.errare( 'Error when parsing the the top note template', er );
|
299 |
+
return false;
|
300 |
+
}
|
301 |
+
$('#customize-preview').after( $( _tmpl ) );
|
302 |
+
$('[data-nimble-history]', '#nimble-top-bar').on( 'click', function(evt) {
|
303 |
+
try { self.navigateHistory( $(this).data( 'nimble-history') ); } catch( er ) {
|
304 |
+
api.errare( 'Error when firing self.navigateHistory', er );
|
305 |
+
}
|
306 |
+
});
|
307 |
+
$('.sek-settings', '#nimble-top-bar').on( 'click', function(evt) {
|
308 |
+
api.panel( sektionsLocalizedData.sektionsPanelId, function( _panel_ ) {
|
309 |
+
self.rootPanelFocus();
|
310 |
+
_panel_.focus();
|
311 |
+
});
|
312 |
+
});
|
313 |
+
$('.sek-add-content', '#nimble-top-bar').on( 'click', function(evt) {
|
314 |
+
evt.preventDefault();
|
315 |
+
api.previewer.trigger( 'sek-pick-content', {});
|
316 |
+
});
|
317 |
+
$('.sek-nimble-doc', '#nimble-top-bar').on( 'click', function(evt) {
|
318 |
+
evt.preventDefault();
|
319 |
+
window.open($(this).data('doc-href'), '_blank');
|
320 |
+
});
|
321 |
+
return $( '#nimble-top-bar' );
|
322 |
+
},
|
323 |
+
|
324 |
+
|
325 |
+
/* HISTORY */
|
326 |
+
navigateHistory : function( direction ) {
|
327 |
+
var self = this,
|
328 |
+
historyLog = $.extend( true, [], self.historyLog() );
|
329 |
+
var previous,
|
330 |
+
current,
|
331 |
+
future,
|
332 |
+
newHistoryLog = [],
|
333 |
+
newSettingValue,
|
334 |
+
previousSektionToRefresh,
|
335 |
+
currentSektionToRefresh;
|
336 |
+
|
337 |
+
_.each( historyLog, function( log ) {
|
338 |
+
if ( ! _.isEmpty( newSettingValue ) ) {
|
339 |
+
return;
|
340 |
+
}
|
341 |
+
switch( log.status ) {
|
342 |
+
case 'previous' :
|
343 |
+
previous = log;
|
344 |
+
break;
|
345 |
+
case 'current' :
|
346 |
+
current = log;
|
347 |
+
break;
|
348 |
+
case 'future' :
|
349 |
+
future = log;
|
350 |
+
break;
|
351 |
+
}
|
352 |
+
switch( direction ) {
|
353 |
+
case 'undo' :
|
354 |
+
if ( ! _.isEmpty( current ) && ! _.isEmpty( previous ) ) {
|
355 |
+
newSettingValue = previous.value;
|
356 |
+
previousSektionToRefresh = current.sektionToRefresh;
|
357 |
+
currentSektionToRefresh = previous.sektionToRefresh;
|
358 |
+
}
|
359 |
+
break;
|
360 |
+
case 'redo' :
|
361 |
+
if ( ! _.isEmpty( future ) ) {
|
362 |
+
newSettingValue = future.value;
|
363 |
+
previousSektionToRefresh = current.sektionToRefresh;
|
364 |
+
currentSektionToRefresh = future.sektionToRefresh;
|
365 |
+
}
|
366 |
+
break;
|
367 |
+
}
|
368 |
+
});
|
369 |
+
if( ! _.isUndefined( newSettingValue ) ) {
|
370 |
+
api( self.sekCollectionSettingId() )( self.validateSettingValue( newSettingValue ), { navigatingHistoryLogs : true } );
|
371 |
+
var previewHasBeenRefreshed = false;
|
372 |
+
api.previewer.refresh();
|
373 |
+
api.previewer.trigger( 'sek-pick-content', {});
|
374 |
+
self.cleanRegistered();//<= normal cleaning
|
375 |
+
self.cleanRegisteredLevelSettingsAfterHistoryNavigation();// setting cleaning
|
376 |
+
}
|
377 |
+
var currentKey = _.findKey( historyLog, { status : 'current'} );
|
378 |
+
currentKey = Number( currentKey );
|
379 |
+
if ( ! _.isNumber( currentKey ) ) {
|
380 |
+
api.errare( 'Error when navigating the history log, the current key should be a number');
|
381 |
+
return;
|
382 |
+
}
|
383 |
+
|
384 |
+
_.each( historyLog, function( log, key ) {
|
385 |
+
newLog = $.extend( true, {}, log );
|
386 |
+
key = Number( key );
|
387 |
+
switch( direction ) {
|
388 |
+
case 'undo' :
|
389 |
+
if ( 0 < currentKey ) {
|
390 |
+
if ( key === ( currentKey - 1 ) ) {
|
391 |
+
newLog.status = 'current';
|
392 |
+
} else if ( key === currentKey ) {
|
393 |
+
newLog.status = 'future';
|
394 |
+
}
|
395 |
+
}
|
396 |
+
break;
|
397 |
+
case 'redo' :
|
398 |
+
if ( historyLog.length > ( currentKey + 1 ) ) {
|
399 |
+
if ( key === currentKey ) {
|
400 |
+
newLog.status = 'previous';
|
401 |
+
} else if ( key === ( currentKey + 1 ) ) {
|
402 |
+
newLog.status = 'current';
|
403 |
+
}
|
404 |
+
}
|
405 |
+
break;
|
406 |
+
}
|
407 |
+
newHistoryLog.push( newLog );
|
408 |
+
});
|
409 |
+
self.historyLog( newHistoryLog );
|
410 |
+
}
|
411 |
+
});//$.extend()
|
412 |
+
})( wp.customize, jQuery );
|
413 |
+
var CZRSeksPrototype = CZRSeksPrototype || {};
|
414 |
+
(function ( api, $ ) {
|
415 |
+
$.extend( CZRSeksPrototype, {
|
416 |
setupSettingToBeSaved : function() {
|
417 |
var self = this,
|
418 |
serverCollection;
|
419 |
|
420 |
serverCollection = api.czr_skopeBase.getSkopeProperty( 'sektions', 'local').db_values;
|
|
|
421 |
var collectionSettingId = self.sekCollectionSettingId();// [ 'nimble___' , '[', newSkopes.local, ']' ].join('');
|
422 |
if ( _.isEmpty( collectionSettingId ) ) {
|
423 |
throw new Error( 'setupSettingsToBeSaved => the collectionSettingId is invalid' );
|
424 |
}
|
|
|
|
|
|
|
425 |
if ( ! api.has( collectionSettingId ) ) {
|
426 |
+
var __collectionSettingInstance__ = api.CZR_Helpers.register({
|
427 |
what : 'setting',
|
428 |
id : collectionSettingId,
|
429 |
value : self.validateSettingValue( _.isObject( serverCollection ) ? serverCollection : self.defaultSektionSettingValue ),
|
430 |
transport : 'postMessage',//'refresh'
|
431 |
type : 'option',
|
432 |
+
track : false,//don't register in the self.registered()
|
433 |
+
origin : 'nimble'
|
434 |
});
|
435 |
+
api( collectionSettingId, function( sektionSetInstance ) {
|
436 |
+
self.historyLog([{
|
437 |
+
status : 'current',
|
438 |
+
value : sektionSetInstance(),
|
439 |
+
action : 'initial'
|
440 |
+
}]);
|
441 |
+
sektionSetInstance.bind( _.debounce( function( newSektionSettingValue, previousValue, params ) {
|
442 |
+
if ( params && true !== params.navigatingHistoryLogs ) {
|
443 |
+
var newHistoryLog = [],
|
444 |
+
historyLog = $.extend( true, [], self.historyLog() ),
|
445 |
+
sektionToRefresh;
|
446 |
+
|
447 |
+
if ( ! _.isEmpty( params.in_sektion ) ) {//<= module changed, column resized, removed...
|
448 |
+
sektionToRefresh = params.in_sektion;
|
449 |
+
} else if ( ! _.isEmpty( params.to_sektion ) ) {// column moved /
|
450 |
+
sektionToRefresh = params.to_sektion;
|
451 |
+
}
|
452 |
|
453 |
+
_.each( historyLog, function( log ) {
|
454 |
+
var newStatus = 'previous';
|
455 |
+
if ( 'future' == log.status )
|
456 |
+
return;
|
457 |
+
$.extend( log, { status : 'previous' } );
|
458 |
+
newHistoryLog.push( log );
|
459 |
+
});
|
460 |
+
newHistoryLog.push({
|
461 |
+
status : 'current',
|
462 |
+
value : newSektionSettingValue,
|
463 |
+
action : _.isObject( params ) ? ( params.action || '' ) : '',
|
464 |
+
sektionToRefresh : sektionToRefresh
|
465 |
+
});
|
466 |
+
self.historyLog( newHistoryLog );
|
467 |
+
}
|
|
|
468 |
|
469 |
+
}, 1000 ) );
|
470 |
+
});//api( collectionSettingId, function( sektionSetInstance ){}
|
471 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
472 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
473 |
validateSettingValue : function( valCandidate ) {
|
474 |
if ( ! _.isObject( valCandidate ) ) {
|
475 |
api.errare('validation error => the setting should be an object', valCandidate );
|
478 |
var parentLevel = {},
|
479 |
errorDetected = false,
|
480 |
levelIds = [];
|
|
|
481 |
var _errorDetected_ = function( msg ) {
|
482 |
api.errare( msg , valCandidate );
|
483 |
api.previewer.trigger('sek-notify', {
|
503 |
return;
|
504 |
}
|
505 |
if ( _.isUndefined( level ) && _.isEmpty( parentLevel ) ) {
|
|
|
506 |
level = $.extend( true, {}, valCandidate );
|
507 |
if ( _.isUndefined( level.id ) || _.isUndefined( level.level ) ) {
|
|
|
|
|
|
|
508 |
if ( _.isUndefined( level.collection ) ) {
|
509 |
_errorDetected_( 'validation error => the root level is missing the collection of locations' );
|
510 |
return;
|
513 |
_errorDetected_( 'validation error => the root level should not have a "level" or an "id" property' );
|
514 |
return;
|
515 |
}
|
|
|
|
|
516 |
_.each( valCandidate.collection, function( _l_ ) {
|
|
|
517 |
parentLevel = level;
|
|
|
518 |
_checkWalker_( _l_ );
|
519 |
});
|
520 |
}
|
521 |
} else {
|
|
|
|
|
|
|
|
|
522 |
if ( _.isEmpty( level.id ) || ! _.isString( level.id )) {
|
523 |
_errorDetected_('validation error => a ' + level.level + ' level must have a valid id' );
|
524 |
return;
|
528 |
} else {
|
529 |
levelIds.push( level.id );
|
530 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
531 |
if ( _.isEmpty( level.level ) || ! _.isString( level.level ) ) {
|
532 |
_errorDetected_('validation error => a ' + level.level + ' level must have a level property' );
|
533 |
return;
|
535 |
_errorDetected_('validation error => the level "' + level.level + '" is not authorized' );
|
536 |
return;
|
537 |
}
|
|
|
|
|
|
|
538 |
if ( 'module' == level.level ) {
|
539 |
if ( ! _.isUndefined( level.collection ) ) {
|
540 |
_errorDetected_('validation error => a module can not have a collection property' );
|
546 |
return;
|
547 |
}
|
548 |
}
|
549 |
+
if ( _.isUndefined( level.ver_ini ) ) {
|
550 |
+
_errorDetected_('validation error => a ' + level.level + ' should have a version property : "ver_ini"' );
|
551 |
+
return;
|
552 |
+
}
|
553 |
switch ( level.level ) {
|
554 |
case 'location' :
|
|
|
555 |
if ( ! _.isEmpty( parentLevel.level ) ) {
|
556 |
_errorDetected_('validation error => the parent of location ' + level.id +' should have no level set' );
|
557 |
return;
|
583 |
}
|
584 |
break;
|
585 |
}
|
|
|
|
|
586 |
if ( 'module' != level.level ) {
|
587 |
_.each( level.collection, function( _l_ ) {
|
|
|
588 |
parentLevel = $.extend( true, {}, level );
|
|
|
589 |
_checkWalker_( _l_ );
|
590 |
});
|
591 |
}
|
592 |
}
|
593 |
};
|
594 |
_checkWalker_();
|
|
|
|
|
|
|
595 |
return errorDetected ? null : valCandidate;
|
596 |
},//validateSettingValue
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
597 |
resetCollectionSetting : function() {
|
598 |
var self = this;
|
599 |
if ( _.isEmpty( self.sekCollectionSettingId() ) ) {
|
600 |
throw new Error( 'setupSettingsToBeSaved => the collectionSettingId is invalid' );
|
601 |
}
|
|
|
602 |
api( self.sekCollectionSettingId() )( self.defaultSektionSettingValue );
|
|
|
603 |
api.previewer.refresh();
|
|
|
604 |
api.notifications.remove( 'sek-notify' );
|
|
|
605 |
api.panel( sektionsLocalizedData.sektionsPanelId, function( __main_panel__ ) {
|
606 |
api.notifications.add( new api.Notification( 'sek-reset-done', {
|
607 |
type: 'success',
|
608 |
message: sektionsLocalizedData.i18n['Reset complete'],
|
609 |
dismissible: true
|
610 |
} ) );
|
|
|
|
|
611 |
_.delay( function() {
|
612 |
api.notifications.remove( 'sek-reset-done' );
|
613 |
}, 5000 );
|
618 |
var CZRSeksPrototype = CZRSeksPrototype || {};
|
619 |
(function ( api, $ ) {
|
620 |
$.extend( CZRSeksPrototype, {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
621 |
reactToPreviewMsg : function() {
|
622 |
var self = this,
|
623 |
apiParams = {},
|
624 |
uiParams = {},
|
625 |
sendToPreview = true, //<= the default behaviour is to send a message to the preview when the setting has been changed
|
626 |
msgCollection = {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
627 |
'sek-add-section' : {
|
628 |
callback : function( params ) {
|
629 |
sendToPreview = ! _.isUndefined( params.send_to_preview ) ? params.send_to_preview : true;//<= when the level is refreshed when complete, we don't need to send to preview.
|
642 |
return self.updateAPISetting( apiParams );
|
643 |
},
|
644 |
complete : function( params ) {
|
|
|
|
|
645 |
if ( params.apiParams.is_first_section ) {
|
646 |
api.previewer.trigger( 'sek-refresh-level', {
|
647 |
level : 'location',
|
648 |
id : params.apiParams.location
|
649 |
});
|
650 |
}
|
651 |
+
api.previewer.trigger( 'sek-pick-content', {});
|
652 |
api.previewer.send('sek-focus-on', { id : params.apiParams.id });
|
653 |
}
|
654 |
},
|
667 |
return self.updateAPISetting( apiParams );
|
668 |
},
|
669 |
complete : function( params ) {
|
|
|
|
|
|
|
670 |
if ( false !== params.apiParams.autofocus ) {
|
671 |
+
api.previewer.trigger( 'sek-pick-content', {});
|
672 |
}
|
673 |
}
|
674 |
},
|
695 |
in_sektion : params.apiParams.in_sektion,
|
696 |
in_column : params.apiParams.in_column
|
697 |
});
|
|
|
|
|
698 |
self.updateAPISetting({ action : 'sek-update-fonts' } );
|
|
|
|
|
699 |
api.previewer.send( 'sek-refresh-stylesheet', {
|
700 |
skope_id : api.czr_skopeBase.getSkopeProperty( 'skope_id' ),//<= send skope id to the preview so we can use it when ajaxing
|
701 |
});
|
707 |
uiParams = {};
|
708 |
switch( params.level ) {
|
709 |
case 'section' :
|
710 |
+
var sektionToRemove = self.getLevelModel( params.id );
|
711 |
+
if ( 'no_match' === sektionToRemove ) {
|
712 |
+
api.errare( 'reactToPreviewMsg => sek-remove-section => no sektionToRemove matched' );
|
713 |
+
break;
|
714 |
+
}
|
715 |
apiParams = {
|
716 |
action : 'sek-remove-section',
|
717 |
id : params.id,
|
718 |
location : params.location,
|
719 |
in_sektion : params.in_sektion,
|
720 |
in_column : params.in_column,
|
721 |
+
is_nested : sektionToRemove.is_nested
|
722 |
};
|
723 |
break;
|
724 |
case 'column' :
|
736 |
in_column : params.in_column
|
737 |
};
|
738 |
break;
|
739 |
+
default :
|
740 |
+
api.errare( '::reactToPreviewMsg => sek-remove => missing level ', params );
|
741 |
+
break;
|
742 |
}
|
743 |
return self.updateAPISetting( apiParams );
|
744 |
},
|
745 |
complete : function( params ) {
|
746 |
+
api.previewer.trigger( 'sek-pick-content', {});
|
|
|
|
|
|
|
747 |
self.updateAPISetting({ action : 'sek-update-fonts' } );
|
|
|
|
|
748 |
if ( 'sek-remove-section' === params.apiParams.action ) {
|
749 |
var locationLevel = self.getLevelModel( params.apiParams.location );
|
750 |
if ( _.isEmpty( locationLevel.collection ) ) {
|
803 |
level : 'section',
|
804 |
in_sektion : params.apiParams.id
|
805 |
});
|
|
|
806 |
if ( params.apiParams.from_location != params.apiParams.to_location ) {
|
807 |
api.previewer.trigger( 'sek-refresh-level', {
|
808 |
level : 'location',
|
833 |
}
|
834 |
}
|
835 |
},//sek-move
|
|
|
|
|
|
|
|
|
|
|
|
|
836 |
'sek-duplicate' : {
|
837 |
callback : function( params ) {
|
838 |
sendToPreview = true;
|
893 |
});
|
894 |
break;
|
895 |
}
|
|
|
896 |
api.previewer.send( 'sek-refresh-stylesheet', {
|
897 |
skope_id : api.czr_skopeBase.getSkopeProperty( 'skope_id' ),//<= send skope id to the preview so we can use it when ajaxing
|
898 |
});
|
|
|
899 |
api.previewer.send('sek-focus-on', { id : params.apiParams.id });
|
900 |
}
|
901 |
},
|
902 |
'sek-resize-columns' : function( params ) {
|
903 |
sendToPreview = true;
|
904 |
uiParams = {};
|
|
|
905 |
apiParams = params;
|
906 |
return self.updateAPISetting( apiParams );
|
907 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
908 |
'sek-add-content-in-new-sektion' : {
|
909 |
callback : function( params ) {
|
910 |
sendToPreview = ! _.isUndefined( params.send_to_preview ) ? params.send_to_preview : true;//<= when the level is refreshed when complete, we don't need to send to preview.
|
913 |
apiParams.action = 'sek-add-content-in-new-sektion';
|
914 |
apiParams.id = sektionsLocalizedData.optPrefixForSektionsNotSaved + self.guid();//we set the id here because it will be needed when ajaxing
|
915 |
switch( params.content_type) {
|
|
|
916 |
case 'module' :
|
917 |
apiParams.droppedModuleId = sektionsLocalizedData.optPrefixForSektionsNotSaved + self.guid();//we set the id here because it will be needed when ajaxing
|
918 |
break;
|
|
|
|
|
919 |
case 'preset_section' :
|
920 |
+
api.previewer.send( 'sek-maybe-print-loader', { loader_located_in_level_id : params.location });
|
921 |
+
api.previewer.send( 'sek-maybe-print-loader', { fullPageLoader : true });
|
922 |
break;
|
923 |
}
|
924 |
return self.updateAPISetting( apiParams );
|
930 |
level : 'module',
|
931 |
id : params.apiParams.droppedModuleId
|
932 |
});
|
933 |
+
break;
|
934 |
+
case 'preset_section' :
|
935 |
+
api.previewer.send( 'sek-clean-loader', { cleanFullPageLoader : true });
|
|
|
|
|
|
|
|
|
|
|
936 |
break;
|
937 |
}
|
938 |
+
self.updateAPISetting({ action : 'sek-update-fonts' } );
|
939 |
+
api.previewer.send( 'sek-refresh-stylesheet', {
|
940 |
+
skope_id : api.czr_skopeBase.getSkopeProperty( 'skope_id' ),//<= send skope id to the preview so we can use it when ajaxing
|
941 |
+
});
|
942 |
if ( params.apiParams.is_first_section ) {
|
943 |
api.previewer.trigger( 'sek-refresh-level', {
|
944 |
level : 'location',
|
945 |
id : params.apiParams.location
|
946 |
});
|
947 |
}
|
948 |
+
if ( params.apiParams.sektion_to_replace ) {
|
949 |
+
api.previewer.trigger( 'sek-remove', {
|
950 |
+
id : params.apiParams.sektion_to_replace,
|
951 |
+
location : params.apiParams.location,
|
952 |
+
in_column : params.apiParams.in_column,//needed when removing a nested column
|
953 |
+
level : 'section'
|
954 |
+
});
|
955 |
+
}
|
956 |
}
|
957 |
},
|
958 |
+
'sek-add-preset-section-in-new-nested-sektion' : {
|
959 |
+
callback : function( params ) {
|
960 |
+
sendToPreview = false;//<= when the level is refreshed when complete, we don't need to send to preview.
|
961 |
+
uiParams = {};
|
962 |
+
apiParams = params;
|
963 |
+
apiParams.action = 'sek-add-preset-section-in-new-nested-sektion';
|
964 |
+
apiParams.id = sektionsLocalizedData.optPrefixForSektionsNotSaved + self.guid();//we set the id here because it will be needed when ajaxing
|
965 |
+
api.previewer.send( 'sek-maybe-print-loader', { loader_located_in_level_id : params.location });
|
966 |
+
return self.updateAPISetting( apiParams );
|
967 |
+
},
|
968 |
+
complete : function( params ) {
|
969 |
+
api.previewer.send( 'sek-refresh-stylesheet', {
|
970 |
+
skope_id : api.czr_skopeBase.getSkopeProperty( 'skope_id' ),//<= send skope id to the preview so we can use it when ajaxing
|
971 |
+
});
|
972 |
+
self.updateAPISetting({ action : 'sek-update-fonts' } );
|
973 |
|
974 |
+
api.previewer.trigger( 'sek-refresh-level', {
|
975 |
+
level : 'section',
|
976 |
+
id : params.apiParams.in_sektion
|
977 |
+
});
|
978 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
979 |
},
|
980 |
+
'sek-pick-content' : function( params ) {
|
981 |
+
params = params || {};
|
982 |
sendToPreview = true;
|
983 |
apiParams = {};
|
984 |
uiParams = {
|
985 |
action : 'sek-generate-draggable-candidates-picker-ui',
|
986 |
+
content_type : params.content_type || 'section',
|
987 |
+
was_triggered : _.has( params, 'was_triggered' ) ? params.was_triggered : true,
|
988 |
+
focus : _.has( params, 'focus' ) ? params.focus : true
|
|
|
|
|
989 |
};
|
990 |
return self.generateUI( uiParams );
|
991 |
},
|
992 |
+
|
993 |
'sek-edit-options' : function( params ) {
|
|
|
994 |
sendToPreview = true;
|
995 |
apiParams = {};
|
996 |
if ( _.isEmpty( params.id ) ) {
|
1021 |
};
|
1022 |
return self.generateUI( uiParams );
|
1023 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1024 |
'sek-notify' : function( params ) {
|
1025 |
sendToPreview = false;
|
1026 |
return $.Deferred(function() {
|
1030 |
message: params.message,
|
1031 |
dismissible: true
|
1032 |
} ) );
|
|
|
|
|
1033 |
_.delay( function() {
|
1034 |
api.notifications.remove( 'sek-notify' );
|
1035 |
}, params.duration || 5000 );
|
1051 |
});
|
1052 |
}
|
1053 |
};//msgCollection
|
|
|
|
|
|
|
1054 |
_.each( msgCollection, function( callbackFn, msgId ) {
|
1055 |
api.previewer.bind( msgId, function( params ) {
|
1056 |
var _cb_;
|
1064 |
}
|
1065 |
|
1066 |
try { _cb_( params )
|
|
|
|
|
1067 |
.done( function( cloneId ) {
|
|
|
1068 |
if ( sendToPreview ) {
|
1069 |
api.previewer.send(
|
1070 |
msgId,
|
1076 |
}
|
1077 |
);
|
1078 |
} else {
|
1079 |
+
api.previewer.trigger( [ msgId, 'done' ].join('_'), { apiParams : apiParams, uiParams : uiParams } );
|
|
|
1080 |
}
|
|
|
1081 |
self.trigger( [ msgId, 'done' ].join('_'), params );
|
1082 |
})
|
1083 |
.fail( function( er ) {
|
1084 |
api.errare( 'reactToPreviewMsg => error when firing ' + msgId, er );
|
1085 |
+
api.previewer.trigger('sek-notify', {
|
1086 |
+
type : 'error',
|
1087 |
+
duration : 30000,
|
1088 |
+
message : [
|
1089 |
+
'<span style="font-size:0.95em">',
|
1090 |
+
'<strong>' + er + '</strong>',
|
1091 |
+
'<br>',
|
1092 |
+
sektionsLocalizedData.i18n['If this problem locks the Nimble builder, you might try to reset the sections for this page.'],
|
1093 |
+
'<br>',
|
1094 |
+
'<span style="text-align:center;display:block">',
|
1095 |
+
'<button type="button" class="button" aria-label="' + sektionsLocalizedData.i18n['Reset'] + '" data-sek-reset="true">' + sektionsLocalizedData.i18n['Reset'] + '</button>',
|
1096 |
+
'</span>',
|
1097 |
+
'</span>'
|
1098 |
+
].join('')
|
1099 |
|
1100 |
+
});
|
1101 |
}); } catch( _er_ ) {
|
1102 |
api.errare( 'reactToPreviewMsg => error when receiving ' + msgId, _er_ );
|
1103 |
}
|
1104 |
});
|
1105 |
});
|
|
|
|
|
|
|
1106 |
_.each( msgCollection, function( callbackFn, msgId ) {
|
1107 |
+
api.previewer.bind( [ msgId, 'done' ].join('_'), function( params ) {
|
1108 |
if ( _.isFunction( callbackFn.complete ) ) {
|
1109 |
try { callbackFn.complete( params ); } catch( _er_ ) {
|
1110 |
api.errare( 'reactToPreviewMsg done => error when receiving ' + [msgId, 'done'].join('_') , _er_ );
|
1113 |
});
|
1114 |
});
|
1115 |
},//reactToPreview();
|
|
|
|
|
1116 |
schedulePrintSectionJson : function() {
|
1117 |
var self = this;
|
1118 |
var popupCenter = function ( content ) {
|
1119 |
w = 400;
|
1120 |
h = 300;
|
|
|
1121 |
var dualScreenLeft = ! _.isUndefined( window.screenLeft ) ? window.screenLeft : window.screenX;
|
1122 |
var dualScreenTop = ! _.isUndefined( window.screenTop ) ? window.screenTop : window.screenY;
|
1123 |
|
1131 |
doc.open("text/html");
|
1132 |
doc.write( content );
|
1133 |
doc.close();
|
|
|
1134 |
if (window.focus) {
|
1135 |
newWindow.focus();
|
1136 |
}
|
1148 |
|
1149 |
api.previewer.bind( 'sek-to-json', function( params ) {
|
1150 |
var sectionModel = $.extend( true, {}, self.getLevelModel( params.id ) );
|
1151 |
+
console.log( JSON.stringify( cleanIds( sectionModel ) ) );
|
1152 |
});
|
1153 |
+
}//schedulePrintSectionJson
|
1154 |
});//$.extend()
|
1155 |
})( wp.customize, jQuery );//global sektionsLocalizedData
|
1156 |
var CZRSeksPrototype = CZRSeksPrototype || {};
|
1157 |
(function ( api, $ ) {
|
1158 |
$.extend( CZRSeksPrototype, {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1159 |
generateUI : function( params ) {
|
1160 |
var self = this,
|
1161 |
dfd = $.Deferred(),
|
1164 |
if ( _.isEmpty( params.action ) ) {
|
1165 |
dfd.reject( 'generateUI => missing action' );
|
1166 |
}
|
|
|
|
|
1167 |
switch ( params.action ) {
|
1168 |
+
case 'sek-generate-module-ui' :
|
1169 |
+
try{ dfd = self.generateUIforFrontModules( params, dfd ); } catch( er ) {
|
1170 |
+
api.errare( '::generateUI() => error', er );
|
1171 |
+
dfd = $.Deferred();
|
1172 |
+
}
|
1173 |
+
break;
|
1174 |
|
1175 |
+
case 'sek-generate-level-options-ui' :
|
1176 |
+
try{ dfd = self.generateUIforLevelOptions( params, dfd ); } catch( er ) {
|
1177 |
+
api.errare( '::generateUI() => error', er );
|
1178 |
+
dfd = $.Deferred();
|
1179 |
+
}
|
1180 |
+
break;
|
|
|
1181 |
case 'sek-generate-draggable-candidates-picker-ui' :
|
1182 |
+
self.cleanRegistered();
|
1183 |
+
try{ dfd = self.generateUIforDraggableContent( params, dfd ); } catch( er ) {
|
1184 |
+
api.errare( '::generateUI() => error', er );
|
1185 |
+
dfd = $.Deferred();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1186 |
}
|
1187 |
+
break;
|
1188 |
+
case 'sek-generate-local-skope-options-ui' :
|
1189 |
self.cleanRegistered();
|
1190 |
+
try{ dfd = self.generateUIforLocalSkopeOptions( params, dfd ); } catch( er ) {
|
1191 |
+
api.errare( '::generateUI() => error', er );
|
1192 |
+
dfd = $.Deferred();
|
1193 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1194 |
break;
|
1195 |
+
case 'sek-generate-global-options-ui' :
|
1196 |
+
self.cleanRegistered();
|
1197 |
+
try{ dfd = self.generateUIforGlobalOptions( params, dfd ); } catch( er ) {
|
1198 |
+
api.errare( '::generateUI() => error', er );
|
1199 |
+
dfd = $.Deferred();
|
1200 |
+
}
|
1201 |
+
break;
|
1202 |
+
}//switch
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1203 |
|
1204 |
return 'pending' == dfd.state() ? dfd.resolve().promise() : dfd.promise();//<= we might want to resolve on focus.completeCallback ?
|
1205 |
},//generateUI()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1206 |
updateAPISettingAndExecutePreviewActions : function( params ) {
|
|
|
1207 |
if ( _.isEmpty( params.settingParams ) || ! _.has( params.settingParams, 'to' ) ) {
|
1208 |
api.errare( 'updateAPISettingAndExecutePreviewActions => missing params.settingParams.to. The api main setting can not be updated', params );
|
1209 |
return;
|
1210 |
}
|
1211 |
var self = this;
|
|
|
|
|
|
|
|
|
1212 |
var rawModuleValue = params.settingParams.to,
|
1213 |
moduleValueCandidate,// {} or [] if mono item of multi-item module
|
1214 |
parentModuleType = null,
|
1215 |
isMultiItemModule = false;
|
1216 |
|
|
|
1217 |
if ( _.isEmpty( params.settingParams.args ) || ! _.has( params.settingParams.args, 'moduleRegistrationParams' ) ) {
|
1218 |
api.errare( 'updateAPISettingAndExecutePreviewActions => missing params.settingParams.args.moduleRegistrationParams The api main setting can not be updated', params );
|
1219 |
return;
|
1229 |
} else {
|
1230 |
api.errare( 'updateAPISettingAndExecutePreviewActions => missing parentModuleInstance', params );
|
1231 |
}
|
|
|
|
|
|
|
|
|
|
|
1232 |
if ( ! isMultiItemModule && _.isObject( rawModuleValue ) ) {
|
1233 |
moduleValueCandidate = self.normalizeAndSanitizeSingleItemInputValues( rawModuleValue, parentModuleType );
|
1234 |
} else {
|
1237 |
moduleValueCandidate.push( self.normalizeAndSanitizeSingleItemInputValues( item, parentModuleType ) );
|
1238 |
});
|
1239 |
}
|
|
|
|
|
|
|
|
|
|
|
1240 |
if ( _.isEmpty( params.defaultPreviewAction ) ) {
|
1241 |
api.errare( 'updateAPISettingAndExecutePreviewActions => missing defaultPreviewAction in passed params. No action can be triggered to the api.previewer.', params );
|
1242 |
return;
|
1243 |
}
|
|
|
1244 |
var refresh_stylesheet = 'refresh_stylesheet' === params.defaultPreviewAction,//<= default action for level options
|
1245 |
refresh_markup = 'refresh_markup' === params.defaultPreviewAction,//<= default action for module options
|
1246 |
+
refresh_fonts = 'refresh_fonts' === params.defaultPreviewAction,
|
1247 |
+
refresh_preview = 'refresh_preview' === params.defaultPreviewAction;
|
1248 |
+
var input_id = params.settingParams.args.input_changed;
|
1249 |
+
var inputRegistrationParams;
|
1250 |
+
if ( ! _.isUndefined( input_id ) ) {
|
1251 |
+
inputRegistrationParams = self.getInputRegistrationParams( input_id, parentModuleType );
|
1252 |
+
if ( ! _.isUndefined( inputRegistrationParams.refresh_stylesheet ) ) {
|
1253 |
+
refresh_stylesheet = Boolean( inputRegistrationParams.refresh_stylesheet );
|
1254 |
+
}
|
1255 |
+
if ( ! _.isUndefined( inputRegistrationParams.refresh_markup ) ) {
|
1256 |
+
refresh_markup = Boolean( inputRegistrationParams.refresh_markup );
|
1257 |
}
|
1258 |
+
if ( ! _.isUndefined( inputRegistrationParams.refresh_fonts ) ) {
|
1259 |
+
refresh_fonts = Boolean( inputRegistrationParams.refresh_fonts );
|
1260 |
}
|
1261 |
+
if ( ! _.isUndefined( inputRegistrationParams.refresh_preview ) ) {
|
1262 |
+
refresh_preview = Boolean( inputRegistrationParams.refresh_preview );
|
1263 |
}
|
1264 |
}
|
1265 |
|
1266 |
var _doUpdateWithRequestedAction = function() {
|
1267 |
+
if ( true === params.isGlobalOptions ) {
|
1268 |
+
if ( _.isEmpty( params.options_type ) ) {
|
1269 |
+
api.errare( 'updateAPISettingAndExecutePreviewActions => error when updating the global options => missing options_type');
|
1270 |
+
return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1271 |
}
|
1272 |
+
var rawGlobalOptions = api( sektionsLocalizedData.optNameForGlobalOptions )(),
|
1273 |
+
clonedGlobalOptions = $.extend( true, {}, _.isObject( rawGlobalOptions ) ? rawGlobalOptions : {} ),
|
1274 |
+
_valueCandidate = {};
|
1275 |
+
_.each( moduleValueCandidate || {}, function( _val_, _key_ ) {
|
1276 |
+
if ( ! _.isBoolean( _val_ ) && _.isEmpty( _val_ + "" ) )
|
1277 |
+
return;
|
1278 |
+
_valueCandidate[ _key_ ] = _val_;
|
1279 |
+
});
|
1280 |
|
1281 |
+
clonedGlobalOptions[ params.options_type ] = _valueCandidate;
|
1282 |
+
api( sektionsLocalizedData.optNameForGlobalOptions )( clonedGlobalOptions );
|
1283 |
+
} else {
|
1284 |
+
return self.updateAPISetting({
|
1285 |
+
action : params.uiParams.action,// mandatory : 'sek-generate-level-options-ui', 'sek-generate-local-skope-options-ui',...
|
1286 |
+
id : params.uiParams.id,
|
1287 |
+
value : moduleValueCandidate,
|
1288 |
+
in_column : params.uiParams.in_column,//not mandatory
|
1289 |
+
in_sektion : params.uiParams.in_sektion,//not mandatory
|
1290 |
+
options_type : params.options_type,// mandatory : 'layout', 'spacing', 'bg_border', 'height', ...
|
1291 |
+
|
1292 |
+
settingParams : params.settingParams
|
1293 |
+
}).done( function( ) {
|
1294 |
+
if ( true === refresh_stylesheet ) {
|
1295 |
+
api.previewer.send( 'sek-refresh-stylesheet', {
|
1296 |
+
skope_id : api.czr_skopeBase.getSkopeProperty( 'skope_id' ),//<= send skope id to the preview so we can use it when ajaxing
|
1297 |
+
apiParams : {
|
1298 |
+
action : 'sek-refresh-stylesheet',
|
1299 |
+
id : params.uiParams.id,
|
1300 |
+
level : params.uiParams.level
|
1301 |
+
},
|
1302 |
+
});
|
1303 |
+
}
|
1304 |
+
if ( true === refresh_markup ) {
|
1305 |
+
api.previewer.send( 'sek-refresh-level', {
|
1306 |
+
apiParams : {
|
1307 |
+
action : 'sek-refresh-level',
|
1308 |
+
id : params.uiParams.id,
|
1309 |
+
level : params.uiParams.level
|
1310 |
+
},
|
1311 |
+
skope_id : api.czr_skopeBase.getSkopeProperty( 'skope_id' ),//<= send skope id to the preview so we can use it when ajaxing
|
1312 |
+
});
|
1313 |
+
}
|
1314 |
+
if ( true === refresh_preview ) {
|
1315 |
+
api.previewer.refresh();
|
1316 |
+
}
|
1317 |
+
});//self.updateAPISetting()
|
1318 |
+
}
|
1319 |
};//_doUpdateWithRequestedAction
|
|
|
|
|
|
|
|
|
1320 |
if ( true === refresh_fonts ) {
|
1321 |
+
var newFontFamily = params.settingParams.args.input_value;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1322 |
if ( ! _.isString( newFontFamily ) ) {
|
1323 |
+
api.errare( 'updateAPISettingAndExecutePreviewActions => font-family must be a string', newFontFamily );
|
1324 |
return;
|
1325 |
}
|
|
|
1326 |
if ( newFontFamily.indexOf('gfont') > -1 ) {
|
1327 |
self.updateAPISetting({
|
1328 |
action : 'sek-update-fonts',
|
1329 |
font_family : newFontFamily
|
1330 |
+
})
|
1331 |
+
.always( function() {
|
1332 |
_doUpdateWithRequestedAction().then( function() {
|
|
|
|
|
|
|
|
|
|
|
1333 |
self.updateAPISetting({ action : 'sek-update-fonts' } );
|
1334 |
});
|
1335 |
});
|
1340 |
_doUpdateWithRequestedAction();
|
1341 |
}
|
1342 |
},//updateAPISettingAndExecutePreviewActions
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1343 |
normalizeAndSanitizeSingleItemInputValues : function( _item_, parentModuleType ) {
|
1344 |
var itemNormalized = {},
|
1345 |
itemNormalizedAndSanitized = {},
|
1346 |
inputDefaultValue = null,
|
1347 |
inputType = null,
|
1348 |
sanitizedVal,
|
1349 |
+
self = this,
|
1350 |
+
isEqualToDefault = function( _val, _default ) {
|
1351 |
+
var equal = false;
|
1352 |
+
if ( _.isBoolean( _val ) || _.isBoolean( _default ) ) {
|
1353 |
+
equal = Boolean(_val) === Boolean(_default);
|
1354 |
+
} else if ( _.isNumber( _val ) || _.isNumber( _default ) ) {
|
1355 |
+
equal = Number( _val ) === Number( _default );
|
1356 |
+
} else if ( _.isString( _val ) || _.isString( _default ) ) {
|
1357 |
+
equal = _val+'' === _default+'';
|
1358 |
+
} else if ( _.isObject( _val ) && _.isObject( _default ) ) {
|
1359 |
+
equal = _.isEqual( _val,_default );
|
1360 |
+
} else if ( _.isArray( _val ) && _.isArray( _default ) ) {
|
1361 |
+
equal = JSON.stringify(_val.sort()) === JSON.stringify(_default.sort());
|
1362 |
+
} else {
|
1363 |
+
equal = _val === _default;
|
1364 |
+
}
|
1365 |
+
return equal;
|
1366 |
+
};
|
1367 |
_.each( _item_, function( _val, input_id ) {
|
1368 |
if ( _.contains( ['title', 'id' ], input_id ) )
|
1369 |
return;
|
1374 |
api.infoLog( '::updateAPISettingAndExecutePreviewActions => missing default value for input ' + input_id + ' in module ' + parentModuleType );
|
1375 |
}
|
1376 |
}
|
1377 |
+
if ( isEqualToDefault( _val, inputDefaultValue ) ) {
|
1378 |
return;
|
1379 |
} else {
|
1380 |
itemNormalized[ input_id ] = _val;
|
1381 |
}
|
1382 |
});
|
|
|
|
|
1383 |
_.each( itemNormalized, function( _val, input_id ) {
|
|
|
|
|
1384 |
switch( self.getInputType( input_id, parentModuleType ) ) {
|
1385 |
case 'text' :
|
1386 |
case 'textarea' :
|
1420 |
});
|
1421 |
return itemNormalizedAndSanitized;
|
1422 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1423 |
isUIControlAlreadyRegistered : function( uiElementId ) {
|
1424 |
var self = this,
|
1425 |
uiCandidate = _.filter( self.registered(), function( registered ) {
|
1426 |
return registered.id == uiElementId && 'control' === registered.what;
|
1427 |
}),
|
1428 |
controlIsAlreadyRegistered = false;
|
|
|
|
|
|
|
1429 |
if ( _.isEmpty( uiCandidate ) ) {
|
1430 |
controlIsAlreadyRegistered = api.control.has( uiElementId );
|
1431 |
} else {
|
1432 |
controlIsAlreadyRegistered = true;
|
|
|
1433 |
if ( uiCandidate.length > 1 ) {
|
1434 |
api.errare( 'generateUI => why is this control registered more than once ? => ' + uiElementId );
|
1435 |
}
|
1437 |
return controlIsAlreadyRegistered;
|
1438 |
}
|
1439 |
});//$.extend()
|
1440 |
+
})( wp.customize, jQuery );//global sektionsLocalizedData
|
1441 |
var CZRSeksPrototype = CZRSeksPrototype || {};
|
1442 |
(function ( api, $ ) {
|
1443 |
$.extend( CZRSeksPrototype, {
|
1444 |
+
generateUIforDraggableContent : function( params, dfd ) {
|
1445 |
+
var self = this;
|
1446 |
+
var modulesRegistrationParams = {};
|
1447 |
+
|
1448 |
+
$.extend( modulesRegistrationParams, {
|
1449 |
+
content_type_switcher : {
|
1450 |
+
settingControlId : sektionsLocalizedData.optPrefixForSektionsNotSaved + '_sek_content_type_switcher_ui',
|
1451 |
+
module_type : 'sek_content_type_switcher_module',
|
1452 |
+
controlLabel : sektionsLocalizedData.i18n['Select a content type'],
|
1453 |
+
priority : 0,
|
1454 |
+
settingValue : { content_type : params.content_type }
|
1455 |
+
},
|
1456 |
+
module_picker : {
|
1457 |
+
settingControlId : sektionsLocalizedData.optPrefixForSektionsNotSaved + '_sek_draggable_modules_ui',
|
1458 |
+
module_type : 'sek_module_picker_module',
|
1459 |
+
controlLabel : sektionsLocalizedData.i18n['Pick a module'],
|
1460 |
+
content_type : 'module',
|
1461 |
+
priority : 20,
|
1462 |
+
icon : '<i class="fas fa-grip-vertical sek-level-option-icon"></i>'
|
1463 |
+
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1464 |
|
1465 |
+
sek_intro_sec_picker_module : {
|
1466 |
+
settingControlId : sektionsLocalizedData.optPrefixForSektionsNotSaved + self.guid() + '_sek_draggable_sections_ui',
|
1467 |
+
module_type : 'sek_intro_sec_picker_module',
|
1468 |
+
controlLabel : sektionsLocalizedData.i18n['Sections for an introduction'],
|
1469 |
+
content_type : 'section',
|
1470 |
+
expandAndFocusOnInit : true,
|
1471 |
+
priority : 10,
|
1472 |
+
icon : '<i class="fas fa-grip-vertical sek-level-option-icon"></i>'
|
1473 |
+
},
|
1474 |
+
sek_features_sec_picker_module : {
|
1475 |
+
settingControlId : sektionsLocalizedData.optPrefixForSektionsNotSaved + self.guid() + '_sek_draggable_sections_ui',
|
1476 |
+
module_type : 'sek_features_sec_picker_module',
|
1477 |
+
controlLabel : sektionsLocalizedData.i18n['Sections for services and features'],
|
1478 |
+
content_type : 'section',
|
1479 |
+
expandAndFocusOnInit : false,
|
1480 |
+
priority : 10,
|
1481 |
+
icon : '<i class="fas fa-grip-vertical sek-level-option-icon"></i>'
|
1482 |
+
},
|
1483 |
+
sek_column_layouts_sec_picker_module : {
|
1484 |
+
settingControlId : sektionsLocalizedData.optPrefixForSektionsNotSaved + self.guid() + '_sek_draggable_sections_ui',
|
1485 |
+
module_type : 'sek_column_layouts_sec_picker_module',
|
1486 |
+
controlLabel : sektionsLocalizedData.i18n['Empty sections with columns layout'],
|
1487 |
+
content_type : 'section',
|
1488 |
+
expandAndFocusOnInit : false,
|
1489 |
+
priority : 10,
|
1490 |
+
icon : '<i class="fas fa-grip-vertical sek-level-option-icon"></i>'
|
1491 |
+
},
|
1492 |
+
});
|
1493 |
+
var firstKey = _.keys( modulesRegistrationParams )[0],
|
1494 |
+
firstControlId = modulesRegistrationParams[firstKey].settingControlId;
|
1495 |
+
|
1496 |
+
if ( self.isUIControlAlreadyRegistered( firstControlId ) ) {
|
1497 |
+
api.control( firstControlId, function( _control_ ) {
|
1498 |
+
_control_.focus({
|
1499 |
+
completeCallback : function() {
|
1500 |
+
var $container = _control_.container;
|
1501 |
+
if ( $container.hasClass( 'button-see-me') )
|
1502 |
+
return;
|
1503 |
+
$container.addClass('button-see-me');
|
1504 |
+
_.delay( function() {
|
1505 |
+
$container.removeClass('button-see-me');
|
1506 |
+
}, 800 );
|
1507 |
}
|
1508 |
+
});
|
1509 |
+
api.section( _control_.section() ).container.first().trigger('sek-content-type-refreshed', { content_type : params.content_type } );
|
1510 |
+
});
|
1511 |
+
return dfd;
|
1512 |
+
}//if
|
1513 |
+
_do_register_ = function() {
|
1514 |
+
_.each( modulesRegistrationParams, function( optionData, optionType ){
|
1515 |
+
if ( ! api.has( optionData.settingControlId ) ) {
|
1516 |
+
api( optionData.settingControlId, function( _setting_ ) {
|
1517 |
+
_setting_.bind( function( to, from ) {
|
1518 |
+
api.errare('generateUIforDraggableContent => the setting() should not changed');
|
1519 |
+
});
|
1520 |
+
});
|
1521 |
+
api.CZR_Helpers.register( {
|
1522 |
+
origin : 'nimble',
|
1523 |
+
level : params.level,
|
1524 |
+
what : 'setting',
|
1525 |
+
id : optionData.settingControlId,
|
1526 |
+
dirty : false,
|
1527 |
+
value : optionData.settingValue || {},
|
1528 |
+
transport : 'postMessage',// 'refresh',
|
1529 |
+
type : '_nimble_ui_'//will be dynamically registered but not saved in db as option// columnData.settingType
|
1530 |
+
});
|
1531 |
+
}
|
1532 |
|
1533 |
+
api.CZR_Helpers.register( {
|
1534 |
+
origin : 'nimble',
|
1535 |
+
level : params.level,
|
1536 |
+
what : 'control',
|
1537 |
+
id : optionData.settingControlId,
|
1538 |
+
label : optionData.controlLabel,
|
1539 |
+
type : 'czr_module',//sekData.controlType,
|
1540 |
+
module_type : optionData.module_type,
|
1541 |
+
section : '__content_picker__',
|
1542 |
+
priority : optionData.priority || 10,
|
1543 |
+
settings : { default : optionData.settingControlId },
|
1544 |
+
track : false//don't register in the self.registered() => this will prevent this container to be removed when cleaning the registered
|
1545 |
+
}).done( function() {
|
1546 |
+
api.control( optionData.settingControlId, function( _control_ ) {
|
1547 |
+
_control_.content_type = optionData.content_type;//<= used to handle visibility when switching content type with the "content_type_switcher" control
|
1548 |
+
if ( true === params.focus ) {
|
1549 |
+
_control_.focus({
|
1550 |
+
completeCallback : function() {}
|
1551 |
+
});
|
1552 |
}
|
1553 |
+
|
1554 |
+
var $title = _control_.container.find('label > .customize-control-title');
|
1555 |
+
if ( ! _.isUndefined( optionData.icon ) ) {
|
1556 |
+
$title.addClass('sek-flex-vertical-center').prepend( optionData.icon );
|
1557 |
}
|
1558 |
+
if ( 'section' === _control_.content_type ) {
|
1559 |
+
_control_.container.find('.czr-items-wrapper').hide();
|
1560 |
+
$title.prepend('<span class="sek-animated-arrow" data-name="icon-chevron-down"><span class="fa fa-chevron-down"></span></span>');
|
1561 |
+
_control_.container.attr('data-sek-expanded', "false" );
|
1562 |
+
if ( true === optionData.expandAndFocusOnInit && "false" == _control_.container.attr('data-sek-expanded' ) ) {
|
1563 |
+
$title.trigger('click');
|
1564 |
+
}
|
1565 |
+
} else {
|
1566 |
+
_control_.container.attr('data-sek-accordion', 'no');
|
1567 |
}
|
1568 |
+
|
1569 |
+
});
|
1570 |
+
});
|
1571 |
+
});//_.each
|
1572 |
+
};//_do_register_
|
1573 |
+
api.CZR_Helpers.register({
|
1574 |
+
origin : 'nimble',
|
1575 |
+
what : 'section',
|
1576 |
+
id : '__content_picker__',
|
1577 |
+
title: sektionsLocalizedData.i18n['Content Picker'],
|
1578 |
+
panel : sektionsLocalizedData.sektionsPanelId,
|
1579 |
+
priority : 30,
|
1580 |
+
track : false,//don't register in the self.registered() => this will prevent this container to be removed when cleaning the registered
|
1581 |
+
constructWith : api.Section.extend({
|
1582 |
+
isContextuallyActive : function () {
|
1583 |
+
return this.active();
|
1584 |
+
},
|
1585 |
+
_toggleActive : function(){ return true; }
|
1586 |
+
})
|
1587 |
+
}).done( function() {
|
1588 |
+
api.section( '__content_picker__', function( _section_ ) {
|
1589 |
+
_do_register_();
|
1590 |
+
var $sectionTitleEl = _section_.container.find('.accordion-section-title'),
|
1591 |
+
$panelTitleEl = _section_.container.find('.customize-section-title h3');
|
1592 |
+
if ( 0 < $sectionTitleEl.length && $sectionTitleEl.find('.sek-level-option-icon').length < 1 ) {
|
1593 |
+
$sectionTitleEl.prepend( '<i class="fas fa-grip-vertical sek-level-option-icon"></i>' );
|
1594 |
+
}
|
1595 |
+
if ( 0 < $panelTitleEl.length && $panelTitleEl.find('.sek-level-option-icon').length < 1 ) {
|
1596 |
+
$panelTitleEl.find('.customize-action').after( '<i class="fas fa-grip-vertical sek-level-option-icon"></i>' );
|
1597 |
+
}
|
1598 |
+
self.scheduleModuleAccordion.call( _section_, { expand_first_module : true } );
|
1599 |
+
});
|
1600 |
+
});
|
1601 |
+
return dfd;
|
1602 |
+
}
|
1603 |
+
});//$.extend()
|
1604 |
+
})( wp.customize, jQuery );//global sektionsLocalizedData
|
1605 |
+
var CZRSeksPrototype = CZRSeksPrototype || {};
|
1606 |
+
(function ( api, $ ) {
|
1607 |
+
$.extend( CZRSeksPrototype, {
|
1608 |
+
generateUIforFrontModules : function( params, dfd ) {
|
1609 |
+
var self = this;
|
1610 |
+
if ( _.isEmpty( params.id ) ) {
|
1611 |
+
dfd.reject( 'generateUI => missing id' );
|
1612 |
+
}
|
1613 |
+
var moduleValue = self.getLevelProperty({
|
1614 |
+
property : 'value',
|
1615 |
+
id : params.id
|
1616 |
+
});
|
1617 |
+
|
1618 |
+
var moduleType = self.getLevelProperty({
|
1619 |
+
property : 'module_type',
|
1620 |
+
id : params.id
|
1621 |
+
});
|
1622 |
+
|
1623 |
+
var moduleName = self.getRegisteredModuleProperty( moduleType, 'name' );
|
1624 |
+
|
1625 |
+
if ( _.isEmpty( moduleType ) ) {
|
1626 |
+
dfd.reject( 'generateUI => module => invalid module_type' );
|
1627 |
+
}
|
1628 |
+
var modulesRegistrationParams = {};
|
1629 |
+
|
1630 |
+
if ( true === self.getRegisteredModuleProperty( moduleType, 'is_father' ) ) {
|
1631 |
+
var _childModules_ = self.getRegisteredModuleProperty( moduleType, 'children' );
|
1632 |
+
if ( _.isEmpty( _childModules_ ) ) {
|
1633 |
+
throw new Error('::generateUIforFrontModules => a father module ' + moduleType + ' is missing children modules ');
|
1634 |
+
} else {
|
1635 |
+
_.each( _childModules_, function( mod_type, optionType ){
|
1636 |
+
modulesRegistrationParams[ optionType ] = {
|
1637 |
+
settingControlId : params.id + '__' + optionType,
|
1638 |
+
module_type : mod_type,
|
1639 |
+
controlLabel : self.getRegisteredModuleProperty( mod_type, 'name' )
|
1640 |
+
};
|
1641 |
+
});
|
1642 |
+
}
|
1643 |
+
} else {
|
1644 |
+
modulesRegistrationParams[ '__no_option_group_to_be_updated_by_children_modules__' ] = {
|
1645 |
+
settingControlId : params.id,
|
1646 |
+
module_type : moduleType,
|
1647 |
+
controlLabel : moduleName
|
1648 |
+
};
|
1649 |
+
}
|
1650 |
+
var firstKey = _.keys( modulesRegistrationParams )[0],
|
1651 |
+
firstControlId = modulesRegistrationParams[firstKey].settingControlId;
|
1652 |
+
|
1653 |
+
if ( self.isUIControlAlreadyRegistered( firstControlId ) ) {
|
1654 |
+
api.control( firstControlId ).focus({
|
1655 |
+
completeCallback : function() {
|
1656 |
+
var $container = api.control( firstControlId ).container;
|
1657 |
+
if ( $container.hasClass( 'button-see-me') )
|
1658 |
+
return;
|
1659 |
+
$container.addClass('button-see-me');
|
1660 |
+
_.delay( function() {
|
1661 |
+
$container.removeClass('button-see-me');
|
1662 |
+
}, 800 );
|
1663 |
+
}
|
1664 |
+
});
|
1665 |
+
return dfd;
|
1666 |
+
}//if
|
1667 |
+
self.cleanRegistered();
|
1668 |
+
|
1669 |
+
_do_register_ = function() {
|
1670 |
+
_.each( modulesRegistrationParams, function( optionData, optionType ){
|
1671 |
+
if ( ! api.has( optionData.settingControlId ) ) {
|
1672 |
+
api( optionData.settingControlId, function( _setting_ ) {
|
1673 |
+
_setting_.bind( _.debounce( function( to, from, args ) {
|
1674 |
+
try { self.updateAPISettingAndExecutePreviewActions({
|
1675 |
+
defaultPreviewAction : 'refresh_markup',
|
1676 |
+
uiParams : _.extend( params, { action : 'sek-set-module-value' } ),
|
1677 |
+
options_type : optionType,
|
1678 |
+
settingParams : {
|
1679 |
+
to : to,
|
1680 |
+
from : from,
|
1681 |
+
args : args
|
1682 |
+
}
|
1683 |
+
}); } catch( er ) {
|
1684 |
+
api.errare( 'Error in updateAPISettingAndExecutePreviewActions', er );
|
1685 |
+
}
|
1686 |
+
}, self.SETTING_UPDATE_BUFFER ) );//_setting_.bind( _.debounce( function( to, from, args ) {}
|
1687 |
+
});
|
1688 |
+
|
1689 |
+
var settingValueOnRegistration = $.extend( true, {}, moduleValue );
|
1690 |
+
if ( '__no_option_group_to_be_updated_by_children_modules__' !== optionType ) {
|
1691 |
+
settingValueOnRegistration = ( !_.isEmpty( settingValueOnRegistration ) && _.isObject( settingValueOnRegistration ) && _.isObject( settingValueOnRegistration[optionType] ) ) ? settingValueOnRegistration[optionType] : {};
|
1692 |
+
}
|
1693 |
+
api.CZR_Helpers.register({
|
1694 |
+
origin : 'nimble',
|
1695 |
+
level : params.level,
|
1696 |
+
what : 'setting',
|
1697 |
+
id : optionData.settingControlId,
|
1698 |
+
dirty : false,
|
1699 |
+
value : settingValueOnRegistration,
|
1700 |
+
transport : 'postMessage',// 'refresh',
|
1701 |
+
type : '_nimble_ui_'//will be dynamically registered but not saved in db as option// columnData.settingType
|
1702 |
+
});
|
1703 |
+
}//if ( ! api.has( optionData.settingControlId ) )
|
1704 |
+
|
1705 |
+
|
1706 |
+
api.CZR_Helpers.register( {
|
1707 |
+
origin : 'nimble',
|
1708 |
+
level : params.level,
|
1709 |
+
what : 'control',
|
1710 |
+
id : optionData.settingControlId,
|
1711 |
+
label : optionData.controlLabel,
|
1712 |
+
type : 'czr_module',//sekData.controlType,
|
1713 |
+
module_type : optionData.module_type,
|
1714 |
+
section : params.id,
|
1715 |
+
priority : 10,
|
1716 |
+
settings : { default : optionData.settingControlId }
|
1717 |
+
}).done( function() {
|
1718 |
+
api.control( optionData.settingControlId ).focus({
|
1719 |
+
completeCallback : function() {}
|
1720 |
+
});
|
1721 |
+
api.control( optionData.settingControlId, function( _control_ ) {
|
1722 |
+
_control_.container.find('.czr-items-wrapper').hide();
|
1723 |
+
var $title = _control_.container.find('label > .customize-control-title');
|
1724 |
+
if ( ! _.isUndefined( optionData.icon ) ) {
|
1725 |
+
$title.addClass('sek-flex-vertical-center').prepend( optionData.icon );
|
1726 |
+
}
|
1727 |
+
$title.prepend('<span class="sek-animated-arrow" data-name="icon-chevron-down"><span class="fa fa-chevron-down"></span></span>');
|
1728 |
+
_control_.container.attr('data-sek-expanded', "false" );
|
1729 |
+
});
|
1730 |
+
});
|
1731 |
+
});//each()
|
1732 |
+
};//_do_register()
|
1733 |
+
api.section.when( params.id, function() {
|
1734 |
+
api.section(params.id).focus();
|
1735 |
+
_do_register_();
|
1736 |
+
});
|
1737 |
+
api.CZR_Helpers.register({
|
1738 |
+
origin : 'nimble',
|
1739 |
+
what : 'section',
|
1740 |
+
id : params.id,
|
1741 |
+
title: sektionsLocalizedData.i18n['Content for'] + ' ' + moduleName,
|
1742 |
+
panel : sektionsLocalizedData.sektionsPanelId,
|
1743 |
+
priority : 1000,
|
1744 |
+
}).done( function() {
|
1745 |
+
api.section( params.id, function( _section_ ) {
|
1746 |
+
_section_.container.find('.accordion-section-title').first().hide();
|
1747 |
+
var $panelTitleEl = _section_.container.find('.customize-section-title h3');
|
1748 |
+
if ( 0 < $panelTitleEl.length ) {
|
1749 |
+
$panelTitleEl.find('.customize-action').after( '<i class="fas fa-pencil-alt sek-level-option-icon"></i>' );
|
1750 |
+
}
|
1751 |
+
self.scheduleModuleAccordion.call( _section_ );
|
1752 |
+
});
|
1753 |
+
});
|
1754 |
+
return dfd;
|
1755 |
+
}
|
1756 |
+
});//$.extend()
|
1757 |
+
})( wp.customize, jQuery );//global sektionsLocalizedData
|
1758 |
+
var CZRSeksPrototype = CZRSeksPrototype || {};
|
1759 |
+
(function ( api, $ ) {
|
1760 |
+
$.extend( CZRSeksPrototype, {
|
1761 |
+
generateUIforLevelOptions : function( params, dfd ) {
|
1762 |
+
var self = this;
|
1763 |
+
var levelOptionValues = self.getLevelProperty({
|
1764 |
+
property : 'options',
|
1765 |
+
id : params.id
|
1766 |
+
});
|
1767 |
+
levelOptionValues = _.isObject( levelOptionValues ) ? levelOptionValues : {};
|
1768 |
+
var modulesRegistrationParams = {};
|
1769 |
+
|
1770 |
+
$.extend( modulesRegistrationParams, {
|
1771 |
+
bg : {
|
1772 |
+
settingControlId : params.id + '__bg_options',
|
1773 |
+
module_type : 'sek_level_bg_module',
|
1774 |
+
controlLabel : sektionsLocalizedData.i18n['Background settings for the'] + ' ' + sektionsLocalizedData.i18n[params.level],
|
1775 |
+
expandAndFocusOnInit : true,
|
1776 |
+
icon : '<i class="material-icons sek-level-option-icon">gradient</i>'//'<i class="material-icons sek-level-option-icon">brush</i>'
|
1777 |
+
},
|
1778 |
+
border : {
|
1779 |
+
settingControlId : params.id + '__border_options',
|
1780 |
+
module_type : 'sek_level_border_module',
|
1781 |
+
controlLabel : sektionsLocalizedData.i18n['Borders settings for the'] + ' ' + sektionsLocalizedData.i18n[params.level],
|
1782 |
+
icon : '<i class="material-icons sek-level-option-icon">rounded_corner</i>'//'<i class="material-icons sek-level-option-icon">brush</i>'
|
1783 |
+
},
|
1784 |
+
spacing : {
|
1785 |
+
settingControlId : params.id + '__spacing_options',
|
1786 |
+
module_type : 'sek_level_spacing_module',
|
1787 |
+
controlLabel : sektionsLocalizedData.i18n['Padding and margin settings for the'] + ' ' + sektionsLocalizedData.i18n[params.level],
|
1788 |
+
icon : '<i class="material-icons sek-level-option-icon">center_focus_weak</i>'
|
1789 |
+
},
|
1790 |
+
anchor : {
|
1791 |
+
settingControlId : params.id + '__anchor_options',
|
1792 |
+
module_type : 'sek_level_anchor_module',
|
1793 |
+
controlLabel : sektionsLocalizedData.i18n['Set a custom anchor for the'] + ' ' + sektionsLocalizedData.i18n[params.level],
|
1794 |
+
icon : '<i class="fas fa-anchor sek-level-option-icon"></i>'
|
1795 |
+
},
|
1796 |
+
visibility : {
|
1797 |
+
settingControlId : params.id + '__visibility_options',
|
1798 |
+
module_type : 'sek_level_visibility_module',
|
1799 |
+
controlLabel : sektionsLocalizedData.i18n['Device visibility settings for the'] + ' ' + sektionsLocalizedData.i18n[params.level],
|
1800 |
+
icon : '<i class="far fa-eye sek-level-option-icon"></i>'
|
1801 |
+
},
|
1802 |
+
height : {
|
1803 |
+
settingControlId : params.id + '__height_options',
|
1804 |
+
module_type : 'sek_level_height_module',
|
1805 |
+
controlLabel : sektionsLocalizedData.i18n['Height settings for the'] + ' ' + sektionsLocalizedData.i18n[params.level],
|
1806 |
+
icon : '<i class="fas fa-ruler-vertical sek-level-option-icon"></i>'
|
1807 |
+
},
|
1808 |
+
});
|
1809 |
+
|
1810 |
+
if ( 'section' === params.level ) {
|
1811 |
+
$.extend( modulesRegistrationParams, {
|
1812 |
+
width : {
|
1813 |
+
settingControlId : params.id + '__width_options',
|
1814 |
+
module_type : 'sek_level_width_section',
|
1815 |
+
controlLabel : sektionsLocalizedData.i18n['Width settings for the'] + ' ' + sektionsLocalizedData.i18n[params.level],
|
1816 |
+
icon : '<i class="fas fa-ruler-horizontal sek-level-option-icon"></i>'
|
1817 |
+
}
|
1818 |
+
});
|
1819 |
+
$.extend( modulesRegistrationParams, {
|
1820 |
+
breakpoint : {
|
1821 |
+
settingControlId : params.id + '__breakpoint_options',
|
1822 |
+
module_type : 'sek_level_breakpoint_module',
|
1823 |
+
controlLabel : sektionsLocalizedData.i18n['Responsive settings : breakpoint, column direction'],
|
1824 |
+
icon : '<i class="material-icons sek-level-option-icon">devices</i>'
|
1825 |
+
}
|
1826 |
+
});
|
1827 |
+
}
|
1828 |
+
if ( 'module' === params.level ) {
|
1829 |
+
$.extend( modulesRegistrationParams, {
|
1830 |
+
width : {
|
1831 |
+
settingControlId : params.id + '__width_options',
|
1832 |
+
module_type : 'sek_level_width_module',
|
1833 |
+
controlLabel : sektionsLocalizedData.i18n['Width settings for the'] + ' ' + sektionsLocalizedData.i18n[params.level],
|
1834 |
+
icon : '<i class="fas fa-ruler-horizontal sek-level-option-icon"></i>'
|
1835 |
+
}
|
1836 |
+
});
|
1837 |
+
}
|
1838 |
+
var firstKey = _.keys( modulesRegistrationParams )[0],
|
1839 |
+
firstControlId = modulesRegistrationParams[firstKey].settingControlId;
|
1840 |
+
|
1841 |
+
if ( self.isUIControlAlreadyRegistered( firstControlId ) ) {
|
1842 |
+
api.control( firstControlId ).focus({
|
1843 |
+
completeCallback : function() {
|
1844 |
+
var $container = api.control( firstControlId ).container;
|
1845 |
+
if ( $container.hasClass( 'button-see-me') )
|
1846 |
+
return;
|
1847 |
+
$container.addClass('button-see-me');
|
1848 |
+
_.delay( function() {
|
1849 |
+
$container.removeClass('button-see-me');
|
1850 |
+
}, 800 );
|
1851 |
+
}
|
1852 |
+
});
|
1853 |
+
return dfd;
|
1854 |
+
}//if
|
1855 |
+
self.cleanRegistered();
|
1856 |
+
_do_register_ = function() {
|
1857 |
+
_.each( modulesRegistrationParams, function( optionData, optionType ){
|
1858 |
+
if ( self.isUIControlAlreadyRegistered( optionData.settingControlId ) ) {
|
1859 |
+
api.section( api.control( optionData.settingControlId ).section() ).expanded( true );
|
1860 |
+
return;
|
1861 |
+
}
|
1862 |
+
if( ! api.has( optionData.settingControlId ) ) {
|
1863 |
+
api( optionData.settingControlId, function( _setting_ ) {
|
1864 |
+
_setting_.bind( _.debounce( function( to, from, args ) {
|
1865 |
+
try { self.updateAPISettingAndExecutePreviewActions({
|
1866 |
+
defaultPreviewAction : 'refresh_stylesheet',
|
1867 |
+
uiParams : params,
|
1868 |
+
options_type : optionType,// <= this is the options sub property where we will store this setting values. @see updateAPISetting case 'sek-generate-level-options-ui'
|
1869 |
+
settingParams : {
|
1870 |
+
to : to,
|
1871 |
+
from : from,
|
1872 |
+
args : args
|
1873 |
+
}
|
1874 |
+
}); } catch( er ) {
|
1875 |
+
api.errare( 'Error in updateAPISettingAndExecutePreviewActions', er );
|
1876 |
+
}
|
1877 |
+
}, self.SETTING_UPDATE_BUFFER ) );//_setting_.bind( _.debounce( function( to, from, args ) {}
|
1878 |
+
});//api( Id, function( _setting_ ) {})
|
1879 |
+
var initialModuleValues = levelOptionValues[ optionType ] || {};
|
1880 |
+
var startingModuleValue = self.getModuleStartingValue( optionData.module_type );
|
1881 |
+
if ( 'no_starting_value' !== startingModuleValue && _.isObject( startingModuleValue ) ) {
|
1882 |
+
var clonedStartingModuleValue = $.extend( true, {}, startingModuleValue );
|
1883 |
+
initialModuleValues = $.extend( clonedStartingModuleValue, initialModuleValues );
|
1884 |
+
}
|
1885 |
+
|
1886 |
+
api.CZR_Helpers.register( {
|
1887 |
+
origin : 'nimble',
|
1888 |
+
level : params.level,
|
1889 |
+
what : 'setting',
|
1890 |
+
id : optionData.settingControlId,
|
1891 |
+
dirty : false,
|
1892 |
+
value : initialModuleValues,
|
1893 |
+
transport : 'postMessage',// 'refresh',
|
1894 |
+
type : '_nimble_ui_'//will be dynamically registered but not saved in db as option //sekData.settingType
|
1895 |
+
});
|
1896 |
+
}//if( ! api.has( optionData.settingControlId ) ) {
|
1897 |
+
|
1898 |
+
api.CZR_Helpers.register( {
|
1899 |
+
origin : 'nimble',
|
1900 |
+
level : params.level,
|
1901 |
+
level_id : params.id,
|
1902 |
+
what : 'control',
|
1903 |
+
id : optionData.settingControlId,
|
1904 |
+
label : optionData.controlLabel,
|
1905 |
+
type : 'czr_module',//sekData.controlType,
|
1906 |
+
module_type : optionData.module_type,
|
1907 |
+
section : params.id,
|
1908 |
+
priority : 0,
|
1909 |
+
settings : { default : optionData.settingControlId }
|
1910 |
+
}).done( function() {
|
1911 |
+
if ( true === optionData.expandAndFocusOnInit ) {
|
1912 |
+
api.control( optionData.settingControlId ).focus({
|
1913 |
+
completeCallback : function() {}
|
1914 |
+
});
|
1915 |
+
}
|
1916 |
+
api.control( optionData.settingControlId, function( _control_ ) {
|
1917 |
+
_control_.container.find('.czr-items-wrapper').hide();
|
1918 |
+
var $title = _control_.container.find('label > .customize-control-title');
|
1919 |
+
if ( ! _.isUndefined( optionData.icon ) ) {
|
1920 |
+
$title.addClass('sek-flex-vertical-center').prepend( optionData.icon );
|
1921 |
+
}
|
1922 |
+
$title.prepend('<span class="sek-animated-arrow" data-name="icon-chevron-down"><span class="fa fa-chevron-down"></span></span>');
|
1923 |
+
_control_.container.attr('data-sek-expanded', "false" );
|
1924 |
+
if ( true === optionData.expandAndFocusOnInit && "false" == _control_.container.attr('data-sek-expanded' ) ) {
|
1925 |
+
$title.trigger('click');
|
1926 |
+
}
|
1927 |
+
});
|
1928 |
+
});
|
1929 |
+
});//_.each()
|
1930 |
+
};//_do_register_()
|
1931 |
+
if ( ! api.section.has( params.id ) ) {
|
1932 |
+
api.section( params.id, function( _section_ ) {
|
1933 |
+
self.scheduleModuleAccordion.call( _section_, { expand_first_module : true } );
|
1934 |
+
});
|
1935 |
+
}
|
1936 |
+
|
1937 |
+
api.CZR_Helpers.register({
|
1938 |
+
origin : 'nimble',
|
1939 |
+
what : 'section',
|
1940 |
+
id : params.id,
|
1941 |
+
title: sektionsLocalizedData.i18n['Settings for the'] + ' ' + params.level,
|
1942 |
+
panel : sektionsLocalizedData.sektionsPanelId,
|
1943 |
+
priority : 10,
|
1944 |
+
}).done( function() {
|
1945 |
+
api.section( params.id, function( _section_ ) {
|
1946 |
+
_do_register_();
|
1947 |
+
_section_.container.find('.accordion-section-title').first().hide();
|
1948 |
+
var $panelTitleEl = _section_.container.find('.customize-section-title h3');
|
1949 |
+
if ( 0 < $panelTitleEl.length && $panelTitleEl.find('.sek-level-option-icon').length < 1 ) {
|
1950 |
+
$panelTitleEl.find('.customize-action').after( '<i class="fas fa-sliders-h sek-level-option-icon"></i>' );
|
1951 |
+
}
|
1952 |
+
});
|
1953 |
+
});
|
1954 |
+
|
1955 |
+
return dfd;
|
1956 |
+
}
|
1957 |
+
});//$.extend()
|
1958 |
+
})( wp.customize, jQuery );//global sektionsLocalizedData
|
1959 |
+
var CZRSeksPrototype = CZRSeksPrototype || {};
|
1960 |
+
(function ( api, $ ) {
|
1961 |
+
$.extend( CZRSeksPrototype, {
|
1962 |
+
getLocalSkopeOptionId : function() {
|
1963 |
+
var skope_id = api.czr_skopeBase.getSkopeProperty( 'skope_id' );
|
1964 |
+
if ( _.isEmpty( skope_id ) ) {
|
1965 |
+
api.errare( 'czr_sektions::getLocalSkopeOptionId => empty skope_id ');
|
1966 |
+
return '';
|
1967 |
+
}
|
1968 |
+
return sektionsLocalizedData.optPrefixForSektionsNotSaved + skope_id + '__localSkopeOptions';
|
1969 |
+
},
|
1970 |
+
generateUIforLocalSkopeOptions : function( params, dfd ) {
|
1971 |
+
var self = this,
|
1972 |
+
_id_ = self.getLocalSkopeOptionId();
|
1973 |
+
if ( self.isUIControlAlreadyRegistered( _id_ ) ) {
|
1974 |
+
return dfd;
|
1975 |
+
}
|
1976 |
+
var registrationParams = {};
|
1977 |
+
$.extend( registrationParams, {
|
1978 |
+
template : {
|
1979 |
+
settingControlId : _id_ + '__template',
|
1980 |
+
module_type : 'sek_local_template',
|
1981 |
+
controlLabel : sektionsLocalizedData.i18n['Page template'],
|
1982 |
+
expandAndFocusOnInit : true,
|
1983 |
+
icon : '<i class="material-icons sek-level-option-icon">check_box_outline_blank</i>'
|
1984 |
+
},
|
1985 |
+
widths : {
|
1986 |
+
settingControlId : _id_ + '__widths',
|
1987 |
+
module_type : 'sek_local_widths',
|
1988 |
+
controlLabel : sektionsLocalizedData.i18n['Inner and outer widths'],
|
1989 |
+
icon : '<i class="fas fa-ruler-horizontal sek-level-option-icon"></i>'
|
1990 |
+
},
|
1991 |
+
custom_css : {
|
1992 |
+
settingControlId : _id_ + '__custom_css',
|
1993 |
+
module_type : 'sek_local_custom_css',
|
1994 |
+
controlLabel : sektionsLocalizedData.i18n['Custom CSS'],
|
1995 |
+
icon : '<i class="material-icons sek-level-option-icon">code</i>'
|
1996 |
+
},
|
1997 |
+
local_reset : {
|
1998 |
+
settingControlId : _id_ + '__local_reset',
|
1999 |
+
module_type : 'sek_local_reset',
|
2000 |
+
controlLabel : sektionsLocalizedData.i18n['Remove the sections in this page'],
|
2001 |
+
icon : '<i class="material-icons sek-level-option-icon">cached</i>'
|
2002 |
+
}
|
2003 |
+
});
|
2004 |
+
|
2005 |
+
_do_register_ = function() {
|
2006 |
+
_.each( registrationParams, function( optionData, optionType ){
|
2007 |
+
if ( ! api.has( optionData.settingControlId ) ) {
|
2008 |
+
api( optionData.settingControlId, function( _setting_ ) {
|
2009 |
+
_setting_.bind( _.debounce( function( to, from, args ) {
|
2010 |
+
try { self.updateAPISettingAndExecutePreviewActions({
|
2011 |
+
defaultPreviewAction : 'refresh',
|
2012 |
+
uiParams : params,
|
2013 |
+
options_type : optionType,
|
2014 |
+
settingParams : {
|
2015 |
+
to : to,
|
2016 |
+
from : from,
|
2017 |
+
args : args
|
2018 |
+
}
|
2019 |
+
}); } catch( er ) {
|
2020 |
+
api.errare( 'Error in updateAPISettingAndExecutePreviewActions', er );
|
2021 |
+
}
|
2022 |
+
}, self.SETTING_UPDATE_BUFFER ) );//_setting_.bind( _.debounce( function( to, from, args ) {}
|
2023 |
+
});//api( Id, function( _setting_ ) {})
|
2024 |
+
var startingModuleValue = self.getModuleStartingValue( optionData.module_type ),
|
2025 |
+
currentSetValue = api( self.sekCollectionSettingId() )(),
|
2026 |
+
allSkopeOptions = $.extend( true, {}, _.isObject( currentSetValue.local_options ) ? currentSetValue.local_options : {} ),
|
2027 |
+
optionTypeValue = _.isObject( allSkopeOptions[ optionType ] ) ? allSkopeOptions[ optionType ]: {},
|
2028 |
+
initialModuleValues = optionTypeValue;
|
2029 |
+
|
2030 |
+
if ( 'no_starting_value' !== startingModuleValue && _.isObject( startingModuleValue ) ) {
|
2031 |
+
var clonedStartingModuleValue = $.extend( true, {}, startingModuleValue );
|
2032 |
+
initialModuleValues = $.extend( clonedStartingModuleValue, initialModuleValues );
|
2033 |
+
}
|
2034 |
+
api.CZR_Helpers.register( {
|
2035 |
+
origin : 'nimble',
|
2036 |
+
level : params.level,
|
2037 |
+
what : 'setting',
|
2038 |
+
id : optionData.settingControlId,
|
2039 |
+
dirty : false,
|
2040 |
+
value : initialModuleValues,
|
2041 |
+
transport : 'postMessage',//'refresh',//// ,
|
2042 |
+
type : '_nimble_ui_'//will be dynamically registered but not saved in db as option// columnData.settingType
|
2043 |
+
});
|
2044 |
+
}
|
2045 |
+
|
2046 |
+
api.CZR_Helpers.register( {
|
2047 |
+
origin : 'nimble',
|
2048 |
+
level : params.level,
|
2049 |
+
what : 'control',
|
2050 |
+
id : optionData.settingControlId,
|
2051 |
+
label : optionData.controlLabel,
|
2052 |
+
type : 'czr_module',//sekData.controlType,
|
2053 |
+
module_type : optionData.module_type,
|
2054 |
+
section : '__localOptionsSection',
|
2055 |
+
priority : 10,
|
2056 |
+
settings : { default : optionData.settingControlId },
|
2057 |
+
}).done( function() {
|
2058 |
+
api.control( optionData.settingControlId, function( _control_ ) {
|
2059 |
+
_control_.container.find('.czr-items-wrapper').hide();
|
2060 |
+
var $title = _control_.container.find('label > .customize-control-title');
|
2061 |
+
if ( ! _.isUndefined( optionData.icon ) ) {
|
2062 |
+
$title.addClass('sek-flex-vertical-center').prepend( optionData.icon );
|
2063 |
+
}
|
2064 |
+
$title.prepend('<span class="sek-animated-arrow" data-name="icon-chevron-down"><span class="fa fa-chevron-down"></span></span>');
|
2065 |
+
_control_.container.attr('data-sek-expanded', "false" );
|
2066 |
+
if ( true === optionData.expandAndFocusOnInit && "false" == _control_.container.attr('data-sek-expanded' ) ) {
|
2067 |
+
$title.trigger('click');
|
2068 |
+
}
|
2069 |
+
});
|
2070 |
+
});
|
2071 |
+
});//_.each()
|
2072 |
+
};//_do_register()
|
2073 |
+
api.section( '__localOptionsSection', function( _section_ ) {
|
2074 |
+
api( self.sekCollectionSettingId(), function() {
|
2075 |
+
_do_register_();
|
2076 |
+
_section_.container.on('click', '.accordion-section-title',function() {
|
2077 |
+
self.generateUI({ action : 'sek-generate-local-skope-options-ui'});
|
2078 |
+
});
|
2079 |
+
});
|
2080 |
+
});
|
2081 |
+
return dfd;
|
2082 |
+
}
|
2083 |
+
});//$.extend()
|
2084 |
+
})( wp.customize, jQuery );//global sektionsLocalizedData
|
2085 |
+
var CZRSeksPrototype = CZRSeksPrototype || {};
|
2086 |
+
(function ( api, $ ) {
|
2087 |
+
$.extend( CZRSeksPrototype, {
|
2088 |
+
generateUIforGlobalOptions : function( params, dfd ) {
|
2089 |
+
var self = this,
|
2090 |
+
_id_ = sektionsLocalizedData.optPrefixForSektionsNotSaved + sektionsLocalizedData.optNameForGlobalOptions;
|
2091 |
+
if ( self.isUIControlAlreadyRegistered( _id_ ) ) {
|
2092 |
+
return dfd;
|
2093 |
+
}
|
2094 |
+
var registrationParams = {};
|
2095 |
+
|
2096 |
+
$.extend( registrationParams, {
|
2097 |
+
breakpoint : {
|
2098 |
+
settingControlId : _id_ + '__breakpoint',
|
2099 |
+
module_type : 'sek_global_breakpoint',
|
2100 |
+
controlLabel : sektionsLocalizedData.i18n['Site wide breakpoint for Nimble sections'],
|
2101 |
+
expandAndFocusOnInit : true,
|
2102 |
+
icon : '<i class="material-icons sek-level-option-icon">devices</i>'
|
2103 |
+
},
|
2104 |
+
widths : {
|
2105 |
+
settingControlId : _id_ + '__widths',
|
2106 |
+
module_type : 'sek_global_widths',
|
2107 |
+
controlLabel : sektionsLocalizedData.i18n['Site wide inner and outer sections widths'],
|
2108 |
+
icon : '<i class="fas fa-ruler-horizontal sek-level-option-icon"></i>'
|
2109 |
+
}
|
2110 |
+
});
|
2111 |
+
|
2112 |
+
_do_register_ = function() {
|
2113 |
+
_.each( registrationParams, function( optionData, optionType ){
|
2114 |
+
if ( ! api.has( optionData.settingControlId ) ) {
|
2115 |
+
api( optionData.settingControlId, function( _setting_ ) {
|
2116 |
+
_setting_.bind( _.debounce( function( to, from, args ) {
|
2117 |
+
try { self.updateAPISettingAndExecutePreviewActions({
|
2118 |
+
isGlobalOptions : true,//<= indicates that we won't update the local skope setting id
|
2119 |
+
defaultPreviewAction : 'refresh',
|
2120 |
+
uiParams : params,
|
2121 |
+
options_type : optionType,
|
2122 |
+
settingParams : {
|
2123 |
+
to : to,
|
2124 |
+
from : from,
|
2125 |
+
args : args
|
2126 |
+
}
|
2127 |
+
}); } catch( er ) {
|
2128 |
+
api.errare( 'Error in updateAPISettingAndExecutePreviewActions', er );
|
2129 |
+
}
|
2130 |
+
}, self.SETTING_UPDATE_BUFFER ) );//_setting_.bind( _.debounce( function( to, from, args ) {}
|
2131 |
+
});//api( Id, function( _setting_ ) {})
|
2132 |
+
var dbValues = sektionsLocalizedData.globalOptionDBValues,
|
2133 |
+
startingModuleValue = self.getModuleStartingValue( optionData.module_type ),
|
2134 |
+
initialModuleValues = ( _.isObject( dbValues ) && ! _.isEmpty( dbValues[ optionType ] ) ) ? dbValues[ optionType ] : {};
|
2135 |
+
|
2136 |
+
if ( 'no_starting_value' !== startingModuleValue && _.isObject( startingModuleValue ) ) {
|
2137 |
+
var clonedStartingModuleValue = $.extend( true, {}, startingModuleValue );
|
2138 |
+
initialModuleValues = $.extend( clonedStartingModuleValue, initialModuleValues );
|
2139 |
+
}
|
2140 |
+
|
2141 |
+
api.CZR_Helpers.register( {
|
2142 |
+
origin : 'nimble',
|
2143 |
+
level : params.level,
|
2144 |
+
what : 'setting',
|
2145 |
+
id : optionData.settingControlId,
|
2146 |
+
dirty : false,
|
2147 |
+
value : initialModuleValues,
|
2148 |
+
transport : 'postMessage',//'refresh',//// ,
|
2149 |
+
type : '_nimble_ui_'//will be dynamically registered but not saved in db as option// columnData.settingType
|
2150 |
+
});
|
2151 |
+
}
|
2152 |
+
|
2153 |
+
api.CZR_Helpers.register( {
|
2154 |
+
origin : 'nimble',
|
2155 |
+
level : params.level,
|
2156 |
+
what : 'control',
|
2157 |
+
id : optionData.settingControlId,
|
2158 |
+
label : optionData.controlLabel,
|
2159 |
+
type : 'czr_module',//sekData.controlType,
|
2160 |
+
module_type : optionData.module_type,
|
2161 |
+
section : '__globalAndLocalOptionsSection',//registered in ::initialize()
|
2162 |
+
priority : 20,
|
2163 |
+
settings : { default : optionData.settingControlId },
|
2164 |
+
track : false//don't register in the self.registered() => this will prevent this container to be removed when cleaning the registered
|
2165 |
+
}).done( function() {
|
2166 |
+
api.control( optionData.settingControlId, function( _control_ ) {
|
2167 |
+
_control_.container.find('.czr-items-wrapper').hide();
|
2168 |
+
var $title = _control_.container.find('label > .customize-control-title');
|
2169 |
+
if ( ! _.isUndefined( optionData.icon ) ) {
|
2170 |
+
$title.addClass('sek-flex-vertical-center').prepend( optionData.icon );
|
2171 |
+
}
|
2172 |
+
$title.prepend('<span class="sek-animated-arrow" data-name="icon-chevron-down"><span class="fa fa-chevron-down"></span></span>');
|
2173 |
+
_control_.container.attr('data-sek-expanded', "false" );
|
2174 |
+
if ( true === optionData.expandAndFocusOnInit && "false" == _control_.container.attr('data-sek-expanded' ) ) {
|
2175 |
+
$title.trigger('click');
|
2176 |
+
}
|
2177 |
+
});
|
2178 |
+
});
|
2179 |
+
});//_.each();
|
2180 |
+
};//do register
|
2181 |
+
api.section( '__globalAndLocalOptionsSection', function( _section_ ) {
|
2182 |
+
api( self.sekCollectionSettingId(), function() {
|
2183 |
+
_do_register_();
|
2184 |
+
});
|
2185 |
+
});
|
2186 |
+
return dfd;
|
2187 |
+
}
|
2188 |
+
});//$.extend()
|
2189 |
+
})( wp.customize, jQuery );//global sektionsLocalizedData, serverControlParams
|
2190 |
+
var CZRSeksPrototype = CZRSeksPrototype || {};
|
2191 |
+
(function ( api, $ ) {
|
2192 |
+
$.extend( CZRSeksPrototype, {
|
2193 |
+
updateAPISetting : function( params ) {
|
2194 |
+
var self = this,
|
2195 |
+
__updateAPISettingDeferred__ = $.Deferred();
|
2196 |
+
api( self.sekCollectionSettingId(), function( sektionSetInstance ) {
|
2197 |
+
var currentSetValue = sektionSetInstance(),
|
2198 |
+
newSetValue = _.isObject( currentSetValue ) ? $.extend( true, {}, currentSetValue ) : self.defaultSektionSettingValue,
|
2199 |
+
locationCandidate,
|
2200 |
+
sektionCandidate,
|
2201 |
+
columnCandidate,
|
2202 |
+
moduleCandidate,
|
2203 |
+
originalCollection,
|
2204 |
+
reorderedCollection,
|
2205 |
+
cloneId, //will be passed in resolve()
|
2206 |
+
startingModuleValue,// will be populated by the optional starting value specificied on module registration
|
2207 |
+
__presetSectionInjected__ = false;
|
2208 |
+
newSetValue.collection = _.isArray( newSetValue.collection ) ? newSetValue.collection : self.defaultSektionSettingValue.collection;
|
2209 |
+
|
2210 |
+
switch( params.action ) {
|
2211 |
+
case 'sek-add-section' :
|
2212 |
+
if ( _.isEmpty( params.id ) ) {
|
2213 |
+
throw new Error( 'updateAPISetting => ' + params.action + ' => missing id' );
|
2214 |
+
}
|
2215 |
+
|
2216 |
+
if ( _.isEmpty( params.location ) ) {
|
2217 |
+
throw new Error( 'updateAPISetting => ' + params.action + ' => missing location' );
|
2218 |
+
}
|
2219 |
+
if ( true === params.is_nested ) {
|
2220 |
+
columnCandidate = self.getLevelModel( params.in_column, newSetValue.collection );
|
2221 |
+
var parentSektionCandidate = self.getLevelModel( params.in_sektion, newSetValue.collection );
|
2222 |
+
if ( 'no_match' == parentSektionCandidate ) {
|
2223 |
+
__updateAPISettingDeferred__.reject( 'updateAPISetting => ' + params.action + ' => no grand parent sektion found');
|
2224 |
+
break;
|
2225 |
+
}
|
2226 |
+
if ( true === parentSektionCandidate.is_nested ) {
|
2227 |
+
__updateAPISettingDeferred__.reject( sektionsLocalizedData.i18n[ "You've reached the maximum number of allowed nested sections." ]);
|
2228 |
+
break;
|
2229 |
+
}
|
2230 |
+
if ( 'no_match' == columnCandidate ) {
|
2231 |
+
api.errare( 'updateAPISetting => ' + params.action + ' => no parent column matched' );
|
2232 |
+
__updateAPISettingDeferred__.reject( 'updateAPISetting => ' + params.action + ' => no parent column matched');
|
2233 |
+
break;
|
2234 |
+
}
|
2235 |
+
columnCandidate.collection = _.isArray( columnCandidate.collection ) ? columnCandidate.collection : [];
|
2236 |
+
columnCandidate.collection.push({
|
2237 |
+
id : params.id,
|
2238 |
+
level : 'section',
|
2239 |
+
collection : [{
|
2240 |
+
id : sektionsLocalizedData.optPrefixForSektionsNotSaved + self.guid(),
|
2241 |
+
level : 'column',
|
2242 |
+
collection : [],
|
2243 |
+
ver_ini : sektionsLocalizedData.nimbleVersion
|
2244 |
+
}],
|
2245 |
+
is_nested : true,
|
2246 |
+
ver_ini : sektionsLocalizedData.nimbleVersion
|
2247 |
+
});
|
2248 |
+
} else {
|
2249 |
locationCandidate = self.getLevelModel( params.location, newSetValue.collection );
|
2250 |
if ( 'no_match' == locationCandidate ) {
|
2251 |
api.errare( 'updateAPISetting => ' + params.action + ' => no location matched' );
|
2252 |
+
__updateAPISettingDeferred__.reject( 'updateAPISetting => ' + params.action + ' => no location matched');
|
2253 |
break;
|
2254 |
}
|
2255 |
locationCandidate.collection = _.isArray( locationCandidate.collection ) ? locationCandidate.collection : [];
|
2261 |
position = index + 1;
|
2262 |
}
|
2263 |
});
|
|
|
|
|
2264 |
locationCandidate.collection = _.isArray( locationCandidate.collection ) ? locationCandidate.collection : [];
|
|
|
2265 |
locationCandidate.collection.splice( position, 0, {
|
2266 |
id : params.id,
|
2267 |
level : 'section',
|
2268 |
collection : [{
|
2269 |
id : sektionsLocalizedData.optPrefixForSektionsNotSaved + self.guid(),
|
2270 |
level : 'column',
|
2271 |
+
collection : [],
|
2272 |
+
ver_ini : sektionsLocalizedData.nimbleVersion
|
2273 |
+
}],
|
2274 |
+
ver_ini : sektionsLocalizedData.nimbleVersion
|
2275 |
});
|
2276 |
}
|
2277 |
break;
|
2278 |
|
2279 |
|
2280 |
case 'sek-duplicate-section' :
|
|
|
|
|
2281 |
if ( _.isEmpty( params.id ) ) {
|
2282 |
throw new Error( 'updateAPISetting => ' + params.action + ' => missing id' );
|
2283 |
}
|
2292 |
}
|
2293 |
|
2294 |
var _position_ = self.getLevelPositionInCollection( params.id, newSetValue.collection );
|
|
|
|
|
2295 |
if ( true === params.is_nested ) {
|
2296 |
columnCandidate = self.getLevelModel( params.in_column, newSetValue.collection );
|
2297 |
if ( 'no_match' == columnCandidate ) {
|
2298 |
api.errare( 'updateAPISetting => ' + params.action + ' => no parent column matched' );
|
2299 |
+
__updateAPISettingDeferred__.reject( 'updateAPISetting => ' + params.action + ' => no parent column matched');
|
2300 |
break;
|
2301 |
}
|
2302 |
|
2308 |
locationCandidate = self.getLevelModel( params.location, newSetValue.collection );
|
2309 |
if ( 'no_match' == locationCandidate ) {
|
2310 |
api.errare( 'updateAPISetting => ' + params.action + ' => no location matched' );
|
2311 |
+
__updateAPISettingDeferred__.reject( 'updateAPISetting => ' + params.action + ' => no location matched');
|
2312 |
break;
|
2313 |
}
|
2314 |
locationCandidate.collection = _.isArray( locationCandidate.collection ) ? locationCandidate.collection : [];
|
|
|
2315 |
locationCandidate.collection.splice( parseInt( _position_ + 1, 10 ), 0, deepClonedSektion );
|
2316 |
|
2317 |
}
|
2318 |
cloneId = deepClonedSektion.id;//will be passed in resolve()
|
2319 |
break;
|
|
|
|
|
|
|
2320 |
case 'sek-remove-section' :
|
|
|
2321 |
if ( true === params.is_nested ) {
|
2322 |
columnCandidate = self.getLevelModel( params.in_column, newSetValue.collection );
|
2323 |
if ( 'no_match' != columnCandidate ) {
|
2332 |
locationCandidate = self.getLevelModel( params.location, newSetValue.collection );
|
2333 |
if ( 'no_match' == locationCandidate ) {
|
2334 |
api.errare( 'updateAPISetting => ' + params.action + ' => no location matched' );
|
2335 |
+
__updateAPISettingDeferred__.reject( 'updateAPISetting => ' + params.action + ' => no location matched');
|
2336 |
break;
|
2337 |
}
|
2338 |
locationCandidate.collection = _.filter( locationCandidate.collection, function( sek ) {
|
2342 |
break;
|
2343 |
|
2344 |
case 'sek-move-section' :
|
|
|
2345 |
var toLocationCandidate = self.getLevelModel( params.to_location, newSetValue.collection ),
|
2346 |
movedSektionCandidate,
|
2347 |
copyOfMovedSektionCandidate;
|
2349 |
if ( _.isEmpty( toLocationCandidate ) || 'no_match' == toLocationCandidate ) {
|
2350 |
throw new Error( 'updateAPISetting => ' + params.action + ' => missing target location' );
|
2351 |
}
|
|
|
|
|
|
|
|
|
2352 |
if ( params.from_location != params.to_location ) {
|
|
|
2353 |
var fromLocationCandidate = self.getLevelModel( params.from_location, newSetValue.collection );
|
2354 |
if ( _.isEmpty( fromLocationCandidate ) || 'no_match' == fromLocationCandidate ) {
|
2355 |
throw new Error( 'updateAPISetting => ' + params.action + ' => missing source location' );
|
2356 |
}
|
2357 |
|
2358 |
fromLocationCandidate.collection = _.isArray( fromLocationCandidate.collection ) ? fromLocationCandidate.collection : [];
|
|
|
2359 |
movedSektionCandidate = self.getLevelModel( params.id, fromLocationCandidate.collection );
|
2360 |
copyOfMovedSektionCandidate = $.extend( true, {}, movedSektionCandidate );
|
|
|
2361 |
fromLocationCandidate.collection = _.filter( fromLocationCandidate.collection, function( sektion ) {
|
2362 |
return sektion.id != params.id;
|
2363 |
});
|
2364 |
}
|
|
|
|
|
2365 |
toLocationCandidate.collection = _.isArray( toLocationCandidate.collection ) ? toLocationCandidate.collection : [];
|
2366 |
originalCollection = $.extend( true, [], toLocationCandidate.collection );
|
2367 |
reorderedCollection = [];
|
2368 |
_.each( params.newOrder, function( _id_ ) {
|
|
|
2369 |
if ( params.from_location != params.to_location && _id_ == copyOfMovedSektionCandidate.id ) {
|
2370 |
reorderedCollection.push( copyOfMovedSektionCandidate );
|
2371 |
} else {
|
2379 |
toLocationCandidate.collection = reorderedCollection;
|
2380 |
|
2381 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2382 |
case 'sek-add-column' :
|
|
|
2383 |
if ( _.isEmpty( params.id ) ) {
|
2384 |
throw new Error( 'updateAPISetting => ' + params.action + ' => missing id' );
|
2385 |
}
|
2386 |
sektionCandidate = self.getLevelModel( params.in_sektion, newSetValue.collection );
|
2387 |
if ( 'no_match' == sektionCandidate ) {
|
2388 |
api.errare( 'updateAPISetting => ' + params.action + ' => no parent sektion matched' );
|
2389 |
+
__updateAPISettingDeferred__.reject( 'updateAPISetting => ' + params.action + ' => no parent sektion matched');
|
2390 |
break;
|
2391 |
}
|
2392 |
|
2393 |
sektionCandidate.collection = _.isArray( sektionCandidate.collection ) ? sektionCandidate.collection : [];
|
|
|
2394 |
if ( ( self.MAX_NUMBER_OF_COLUMNS - 1 ) < _.size( sektionCandidate.collection ) ) {
|
2395 |
+
__updateAPISettingDeferred__.reject( sektionsLocalizedData.i18n["You've reached the maximum number of columns allowed in this section."]);
|
2396 |
break;
|
2397 |
}
|
|
|
|
|
2398 |
_.each( sektionCandidate.collection, function( colModel ) {
|
2399 |
colModel.width = '';
|
2400 |
});
|
2401 |
sektionCandidate.collection.push({
|
2402 |
id : params.id,
|
2403 |
level : 'column',
|
2404 |
+
collection : [],
|
2405 |
+
ver_ini : sektionsLocalizedData.nimbleVersion
|
2406 |
});
|
2407 |
break;
|
2408 |
|
2410 |
case 'sek-remove-column' :
|
2411 |
sektionCandidate = self.getLevelModel( params.in_sektion, newSetValue.collection );
|
2412 |
if ( 'no_match' != sektionCandidate ) {
|
|
|
2413 |
if ( 1 === _.size( sektionCandidate.collection ) ) {
|
2414 |
+
__updateAPISettingDeferred__.reject( sektionsLocalizedData.i18n["A section must have at least one column."]);
|
2415 |
break;
|
2416 |
}
|
2417 |
sektionCandidate.collection = _.isArray( sektionCandidate.collection ) ? sektionCandidate.collection : [];
|
2418 |
sektionCandidate.collection = _.filter( sektionCandidate.collection, function( column ) {
|
2419 |
return column.id != params.id;
|
2420 |
});
|
|
|
2421 |
_.each( sektionCandidate.collection, function( colModel ) {
|
2422 |
colModel.width = '';
|
2423 |
});
|
2428 |
break;
|
2429 |
|
2430 |
case 'sek-duplicate-column' :
|
|
|
2431 |
if ( _.isEmpty( params.id ) ) {
|
2432 |
throw new Error( 'updateAPISetting => ' + params.action + ' => missing id' );
|
2433 |
}
|
2435 |
sektionCandidate = self.getLevelModel( params.in_sektion, newSetValue.collection );
|
2436 |
if ( 'no_match' == sektionCandidate ) {
|
2437 |
api.errare( 'updateAPISetting => ' + params.action + ' => no parent sektion matched' );
|
2438 |
+
__updateAPISettingDeferred__.reject( 'updateAPISetting => ' + params.action + ' => no parent sektion matched');
|
2439 |
break;
|
2440 |
}
|
2441 |
|
2442 |
sektionCandidate.collection = _.isArray( sektionCandidate.collection ) ? sektionCandidate.collection : [];
|
|
|
2443 |
if ( ( self.MAX_NUMBER_OF_COLUMNS - 1 ) < _.size( sektionCandidate.collection ) ) {
|
2444 |
+
__updateAPISettingDeferred__.reject( sektionsLocalizedData.i18n["You've reached the maximum number of columns allowed in this section."]);
|
2445 |
break;
|
2446 |
}
|
2447 |
|
2453 |
var _position = self.getLevelPositionInCollection( params.id, newSetValue.collection );
|
2454 |
cloneId = deepClonedColumn.id;//will be passed in resolve()
|
2455 |
sektionCandidate.collection.splice( parseInt( _position + 1, 10 ), 0, deepClonedColumn );
|
|
|
2456 |
_.each( sektionCandidate.collection, function( colModel ) {
|
2457 |
colModel.width = '';
|
2458 |
});
|
2459 |
break;
|
|
|
|
|
|
|
2460 |
case 'sek-resize-columns' :
|
2461 |
if ( params.col_number < 2 )
|
2462 |
break;
|
2463 |
|
2464 |
var resizedColumn = self.getLevelModel( params.resized_column, newSetValue.collection ),
|
2465 |
sistercolumn = self.getLevelModel( params.sister_column, newSetValue.collection );
|
|
|
|
|
|
|
|
|
2466 |
if ( 'no_match' == resizedColumn ) {
|
2467 |
api.errare( 'updateAPISetting => ' + params.action + ' => no resized column matched' );
|
2468 |
+
__updateAPISettingDeferred__.reject( 'updateAPISetting => ' + params.action + ' => no resized column matched');
|
2469 |
break;
|
2470 |
}
|
2471 |
|
2472 |
resizedColumn.width = parseFloat( params.resizedColumnWidthInPercent );
|
|
|
|
|
|
|
2473 |
var parentSektion = self.getLevelModel( params.in_sektion, newSetValue.collection );
|
2474 |
var otherColumns = _.filter( parentSektion.collection, function( _col_ ) {
|
2475 |
return _col_.id != resizedColumn.id && _col_.id != sistercolumn.id;
|
2482 |
if ( ! _.has( colModel, 'width') || ! _.isNumber( currentColWidth * 1 ) || _.isEmpty( currentColWidth + '' ) || 1 > currentColWidth ) {
|
2483 |
colModel.width = parseFloat( ( 100 / params.col_number ).toFixed(3) );
|
2484 |
}
|
|
|
2485 |
otherColumnsWidth = parseFloat( ( otherColumnsWidth + colModel.width ).toFixed(3) );
|
2486 |
});
|
2487 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2488 |
sistercolumn.width = parseFloat( ( 100 - otherColumnsWidth ).toFixed(3) );
|
|
|
|
|
|
|
|
|
|
|
2489 |
break;
|
2490 |
|
2491 |
|
2501 |
}
|
2502 |
|
2503 |
if ( params.from_sektion != params.to_sektion ) {
|
|
|
2504 |
var fromSektionCandidate = self.getLevelModel( params.from_sektion, newSetValue.collection );
|
2505 |
if ( _.isEmpty( fromSektionCandidate ) || 'no_match' == fromSektionCandidate ) {
|
2506 |
throw new Error( 'updateAPISetting => ' + params.action + ' => missing source column' );
|
2507 |
}
|
2508 |
|
2509 |
fromSektionCandidate.collection = _.isArray( fromSektionCandidate.collection ) ? fromSektionCandidate.collection : [];
|
|
|
2510 |
movedColumnCandidate = self.getLevelModel( params.id, fromSektionCandidate.collection );
|
2511 |
copyOfMovedColumnCandidate = $.extend( true, {}, movedColumnCandidate );
|
|
|
2512 |
fromSektionCandidate.collection = _.filter( fromSektionCandidate.collection, function( column ) {
|
2513 |
return column.id != params.id;
|
2514 |
});
|
|
|
2515 |
_.each( fromSektionCandidate.collection, function( colModel ) {
|
2516 |
colModel.width = '';
|
2517 |
});
|
2518 |
}
|
|
|
|
|
2519 |
toSektionCandidate.collection = _.isArray( toSektionCandidate.collection ) ? toSektionCandidate.collection : [];
|
2520 |
originalCollection = $.extend( true, [], toSektionCandidate.collection );
|
2521 |
reorderedCollection = [];
|
2522 |
_.each( params.newOrder, function( _id_ ) {
|
|
|
2523 |
if ( params.from_sektion != params.to_sektion && _id_ == copyOfMovedColumnCandidate.id ) {
|
2524 |
reorderedCollection.push( copyOfMovedColumnCandidate );
|
2525 |
} else {
|
2531 |
}
|
2532 |
});
|
2533 |
toSektionCandidate.collection = reorderedCollection;
|
|
|
|
|
2534 |
_.each( toSektionCandidate.collection, function( colModel ) {
|
2535 |
colModel.width = '';
|
2536 |
});
|
2537 |
|
2538 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2539 |
case 'sek-add-module' :
|
|
|
2540 |
if ( _.isEmpty( params.id ) ) {
|
2541 |
throw new Error( 'updateAPISetting => ' + params.action + ' => missing id' );
|
2542 |
}
|
|
|
2543 |
if ( _.isEmpty( params.module_type ) ) {
|
2544 |
throw new Error( 'updateAPISetting => ' + params.action + ' => missing module_type' );
|
2545 |
}
|
2546 |
columnCandidate = self.getLevelModel( params.in_column, newSetValue.collection );
|
2547 |
if ( 'no_match' === columnCandidate ) {
|
2548 |
api.errare( 'updateAPISetting => ' + params.action + ' => no parent column matched' );
|
2549 |
+
__updateAPISettingDeferred__.reject( 'updateAPISetting => ' + params.action + ' => no parent column matched');
|
2550 |
break;
|
2551 |
}
|
2552 |
|
2553 |
var position = 0;
|
2554 |
columnCandidate.collection = _.isArray( columnCandidate.collection ) ? columnCandidate.collection : [];
|
|
|
2555 |
_.each( columnCandidate.collection, function( moduleModel, index ) {
|
2556 |
if ( params.before_module === moduleModel.id ) {
|
2557 |
position = index;
|
2564 |
var _moduleParams = {
|
2565 |
id : params.id,
|
2566 |
level : 'module',
|
2567 |
+
module_type : params.module_type,
|
2568 |
+
ver_ini : sektionsLocalizedData.nimbleVersion
|
2569 |
};
|
|
|
2570 |
startingModuleValue = self.getModuleStartingValue( params.module_type );
|
2571 |
if ( 'no_starting_value' !== startingModuleValue ) {
|
2572 |
_moduleParams.value = startingModuleValue;
|
2576 |
break;
|
2577 |
|
2578 |
case 'sek-duplicate-module' :
|
|
|
2579 |
if ( _.isEmpty( params.id ) ) {
|
2580 |
throw new Error( 'updateAPISetting => ' + params.action + ' => missing id' );
|
2581 |
}
|
2582 |
columnCandidate = self.getLevelModel( params.in_column, newSetValue.collection );
|
2583 |
if ( 'no_match' == columnCandidate ) {
|
2584 |
api.errare( 'updateAPISetting => ' + params.action + ' => no parent column matched' );
|
2585 |
+
__updateAPISettingDeferred__.reject( 'updateAPISetting => ' + params.action + ' => no parent column matched');
|
2586 |
break;
|
2587 |
}
|
2588 |
|
2591 |
var deepClonedModule;
|
2592 |
try { deepClonedModule = self.cloneLevel( params.id ); } catch( er ) {
|
2593 |
api.errare( 'updateAPISetting => ' + params.action, er );
|
2594 |
+
__updateAPISettingDeferred__.reject( 'updateAPISetting => ' + params.action + ' => error when cloning the level');
|
2595 |
break;
|
2596 |
}
|
2597 |
var insertInposition = self.getLevelPositionInCollection( params.id, newSetValue.collection );
|
2601 |
break;
|
2602 |
|
2603 |
case 'sek-remove-module' :
|
|
|
2604 |
if ( _.isEmpty( params.id ) ) {
|
2605 |
throw new Error( 'updateAPISetting => ' + params.action + ' => missing id' );
|
2606 |
}
|
2620 |
var toColumnCandidate,
|
2621 |
movedModuleCandidate,
|
2622 |
copyOfMovedModuleCandidate;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2623 |
toColumnCandidate = self.getLevelModel( params.to_column, newSetValue.collection );
|
2624 |
|
2625 |
if ( _.isEmpty( toColumnCandidate ) || 'no_match' == toColumnCandidate ) {
|
2626 |
throw new Error( 'updateAPISetting => ' + params.action + ' => missing target column' );
|
2627 |
}
|
|
|
|
|
|
|
2628 |
if ( params.from_column != params.to_column ) {
|
2629 |
var fromColumnCandidate;
|
2630 |
fromColumnCandidate = self.getLevelModel( params.from_column, newSetValue.collection );
|
2634 |
}
|
2635 |
|
2636 |
fromColumnCandidate.collection = _.isArray( fromColumnCandidate.collection ) ? fromColumnCandidate.collection : [];
|
|
|
2637 |
movedModuleCandidate = self.getLevelModel( params.id, newSetValue.collection );
|
2638 |
copyOfMovedModuleCandidate = $.extend( true, {}, movedModuleCandidate );
|
|
|
2639 |
fromColumnCandidate.collection = _.filter( fromColumnCandidate.collection, function( module ) {
|
2640 |
return module.id != params.id;
|
2641 |
});
|
2642 |
}// if params.from_column != params.to_column
|
|
|
|
|
2643 |
toColumnCandidate.collection = _.isArray( toColumnCandidate.collection ) ? toColumnCandidate.collection : [];
|
2644 |
originalCollection = $.extend( true, [], toColumnCandidate.collection );
|
2645 |
reorderedCollection = [];
|
2654 |
reorderedCollection.push( moduleCandidate );
|
2655 |
}
|
2656 |
});
|
|
|
2657 |
if ( reorderedCollection.length != _.uniq( reorderedCollection ).length ) {
|
2658 |
throw new Error( 'updateAPISetting => ' + params.action + ' => there are duplicated modules in column : ' + toColumnCandidate.id );
|
2659 |
} else {
|
2664 |
|
2665 |
case 'sek-set-module-value' :
|
2666 |
moduleCandidate = self.getLevelModel( params.id, newSetValue.collection );
|
2667 |
+
|
2668 |
var _value_ = {};
|
|
|
|
|
2669 |
_.each( params.value || {}, function( _val_, _key_ ) {
|
|
|
|
|
2670 |
if ( ! _.isBoolean( _val_ ) && _.isEmpty( _val_ + "" ) )
|
2671 |
return;
|
2672 |
_value_[ _key_ ] = _val_;
|
2673 |
});
|
2674 |
if ( 'no_match' == moduleCandidate ) {
|
2675 |
api.errare( 'updateAPISetting => ' + params.action + ' => no module matched', params );
|
2676 |
+
__updateAPISettingDeferred__.reject( 'updateAPISetting => ' + params.action + ' => error no module matched');
|
2677 |
break;
|
2678 |
}
|
2679 |
+
if ( _.isEmpty( params.options_type ) ) {
|
2680 |
+
api.errare( 'updateAPISetting => ' + params.action + ' => missing options_type');
|
2681 |
+
__updateAPISettingDeferred__.reject( 'updateAPISetting => ' + params.action + ' => missing options_type');
|
2682 |
+
break;
|
2683 |
+
}
|
2684 |
+
if ( '__no_option_group_to_be_updated_by_children_modules__' === params.options_type ) {
|
2685 |
+
moduleCandidate.value = _value_;
|
2686 |
+
} else {
|
2687 |
+
moduleCandidate.value = _.isEmpty( moduleCandidate.value ) ? {} : moduleCandidate.value;
|
2688 |
+
moduleCandidate.value[ params.options_type ] = _value_;
|
2689 |
+
}
|
2690 |
|
2691 |
+
break;
|
2692 |
+
case 'sek-generate-level-options-ui' :
|
|
|
|
|
2693 |
var _candidate_ = self.getLevelModel( params.id, newSetValue.collection ),
|
2694 |
_valueCandidate = {};
|
2695 |
if ( 'no_match'=== _candidate_ ) {
|
2696 |
api.errare( 'updateAPISetting => ' + params.action + ' => no parent sektion matched' );
|
2697 |
+
__updateAPISettingDeferred__.reject( 'updateAPISetting => ' + params.action + ' => no parent sektion matched');
|
2698 |
break;
|
2699 |
}
|
2700 |
_candidate_.options = _candidate_.options || {};
|
|
|
|
|
|
|
2701 |
_.each( params.value || {}, function( _val_, _key_ ) {
|
|
|
|
|
2702 |
if ( ! _.isBoolean( _val_ ) && _.isEmpty( _val_ + "" ) )
|
2703 |
return;
|
2704 |
_valueCandidate[ _key_ ] = _val_;
|
2706 |
if ( _.isEmpty( params.options_type ) ) {
|
2707 |
api.errare( 'updateAPISetting => ' + params.action + ' => missing options_type');
|
2708 |
}
|
2709 |
+
_candidate_.options[ params.options_type ] = _valueCandidate;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2710 |
break;
|
2711 |
+
case 'sek-generate-local-skope-options-ui' :
|
2712 |
+
_valueCandidate = {};
|
2713 |
|
2714 |
+
var _currentOptions = $.extend( true, {}, _.isObject( newSetValue.local_options ) ? newSetValue.local_options : {} );
|
2715 |
+
_.each( params.value || {}, function( _val_, _key_ ) {
|
2716 |
+
if ( ! _.isBoolean( _val_ ) && _.isEmpty( _val_ + "" ) )
|
2717 |
+
return;
|
2718 |
+
_valueCandidate[ _key_ ] = _val_;
|
2719 |
+
});
|
2720 |
+
if ( _.isEmpty( params.options_type ) || ! _.isString( params.options_type ) ) {
|
2721 |
+
api.errare( 'updateAPISetting => ' + params.action + ' => missing options_type');
|
2722 |
+
} else {
|
2723 |
+
var newOptionsValues = {};
|
2724 |
+
newOptionsValues[ params.options_type ] = _valueCandidate;
|
2725 |
+
newSetValue.local_options = $.extend( _currentOptions, newOptionsValues );
|
2726 |
+
}
|
2727 |
+
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2728 |
case 'sek-add-content-in-new-sektion' :
|
|
|
|
|
2729 |
if ( _.isEmpty( params.id ) ) {
|
2730 |
throw new Error( 'updateAPISetting => ' + params.action + ' => missing id' );
|
2731 |
}
|
2732 |
+
position = 0;
|
|
|
2733 |
locationCandidate = self.getLevelModel( params.location, newSetValue.collection );
|
2734 |
if ( 'no_match' == locationCandidate ) {
|
2735 |
api.errare( 'updateAPISetting => ' + params.action + ' => no location matched' );
|
2736 |
+
__updateAPISettingDeferred__.reject( 'updateAPISetting => ' + params.action + ' => no location matched');
|
2737 |
break;
|
2738 |
}
|
2739 |
locationCandidate.collection = _.isArray( locationCandidate.collection ) ? locationCandidate.collection : [];
|
2747 |
});
|
2748 |
|
2749 |
switch( params.content_type) {
|
|
|
2750 |
case 'module' :
|
|
|
|
|
2751 |
startingModuleValue = self.getModuleStartingValue( params.content_id );
|
|
|
|
|
2752 |
locationCandidate.collection.splice( position, 0, {
|
2753 |
id : params.id,
|
2754 |
level : 'section',
|
2765 |
}
|
2766 |
]
|
2767 |
}
|
2768 |
+
],
|
2769 |
+
ver_ini : sektionsLocalizedData.nimbleVersion
|
2770 |
});
|
2771 |
break;
|
|
|
|
|
2772 |
case 'preset_section' :
|
2773 |
+
__presetSectionInjected__ = $.Deferred();//defined at the beginning of the method
|
2774 |
+
|
2775 |
+
var _doWhenPresetSectionCollectionFetched = function( presetColumnCollection ) {
|
2776 |
+
self.preparePresetSectionForInjection( presetColumnCollection )
|
2777 |
+
.fail( function( _er_ ){
|
2778 |
+
__updateAPISettingDeferred__.reject( 'updateAPISetting => error when preparePresetSectionForInjection => ' + params.action + ' => ' + _er_ );
|
2779 |
+
__presetSectionInjected__.reject( _er_ );
|
2780 |
+
})
|
2781 |
+
.done( function( sectionReadyToInject ) {
|
2782 |
+
var insertedInANestedSektion = false;
|
2783 |
+
if ( ! _.isEmpty( params.sektion_to_replace ) ) {
|
2784 |
+
var sektionToReplace = self.getLevelModel( params.sektion_to_replace, newSetValue.collection );
|
2785 |
+
if ( 'no_match' === sektionToReplace ) {
|
2786 |
+
api.errare( 'updateAPISetting => ' + params.action + ' => no sektionToReplace matched' );
|
2787 |
+
__updateAPISettingDeferred__.reject( 'updateAPISetting => ' + params.action + ' => no sektionToReplace matched');
|
2788 |
+
}
|
2789 |
+
insertedInANestedSektion = true === sektionToReplace.is_nested;
|
2790 |
+
}
|
2791 |
+
|
2792 |
+
if ( ! insertedInANestedSektion ) {
|
2793 |
+
locationCandidate.collection.splice( position, 0, {
|
2794 |
+
id : params.id,
|
2795 |
+
level : 'section',
|
2796 |
+
collection : sectionReadyToInject.collection,
|
2797 |
+
options : sectionReadyToInject.options || {},
|
2798 |
+
ver_ini : sektionsLocalizedData.nimbleVersion
|
2799 |
+
});
|
2800 |
+
} else {
|
2801 |
+
columnCandidate = self.getLevelModel( params.in_column, newSetValue.collection );
|
2802 |
+
if ( 'no_match' === columnCandidate ) {
|
2803 |
+
api.errare( 'updateAPISetting => ' + params.action + ' => no parent column matched' );
|
2804 |
+
__updateAPISettingDeferred__.reject( 'updateAPISetting => ' + params.action + ' => no parent column matched');
|
2805 |
+
}
|
2806 |
+
|
2807 |
+
columnCandidate.collection = _.isArray( columnCandidate.collection ) ? columnCandidate.collection : [];
|
2808 |
+
_.each( columnCandidate.collection, function( moduleOrSectionModel, index ) {
|
2809 |
+
if ( params.before_section === moduleOrSectionModel.id ) {
|
2810 |
+
position = index;
|
2811 |
+
}
|
2812 |
+
if ( params.after_section === moduleOrSectionModel.id ) {
|
2813 |
+
position = index + 1;
|
2814 |
+
}
|
2815 |
+
});
|
2816 |
+
columnCandidate.collection.splice( position, 0, {
|
2817 |
+
id : params.id,
|
2818 |
+
is_nested : true,
|
2819 |
+
level : 'section',
|
2820 |
+
collection : sectionReadyToInject.collection,
|
2821 |
+
options : sectionReadyToInject.options || {},
|
2822 |
+
ver_ini : sektionsLocalizedData.nimbleVersion
|
2823 |
+
});
|
2824 |
+
}
|
2825 |
+
__presetSectionInjected__.resolve();
|
2826 |
+
});// self.preparePresetSectionForInjection.done()
|
2827 |
+
};//_doWhenPresetSectionCollectionFetched()
|
2828 |
+
self.getPresetSectionCollection({
|
2829 |
presetSectionType : params.content_id,
|
2830 |
section_id : params.id//<= we need to use the section id already generated, and passed for ajax action @see ::reactToPreviewMsg, case "sek-add-section"
|
2831 |
+
})
|
2832 |
+
.fail( function() {
|
2833 |
+
api.errare( 'updateAPISetting => ' + params.action + ' => Error with self.getPresetSectionCollection()', _er_ );
|
2834 |
+
__updateAPISettingDeferred__.reject( 'updateAPISetting => ' + params.action + ' => Error with self.getPresetSectionCollection()');
|
2835 |
+
})
|
2836 |
+
.done( function( presetColumnCollection ) {
|
2837 |
+
if ( ! _.isObject( presetColumnCollection ) || _.isEmpty( presetColumnCollection ) ) {
|
2838 |
+
api.errare( 'updateAPISetting => ' + params.action + ' => preset section type not found or empty : ' + params.content_id, presetColumnCollection );
|
2839 |
+
__updateAPISettingDeferred__.reject( 'updateAPISetting => ' + params.action + ' => preset section type not found or empty');
|
2840 |
+
}
|
2841 |
+
_doWhenPresetSectionCollectionFetched( presetColumnCollection );
|
2842 |
+
});//self.getPresetSectionCollection().done()
|
2843 |
break;
|
2844 |
}//switch( params.content_type)
|
2845 |
break;
|
2846 |
+
case 'sek-add-preset-section-in-new-nested-sektion' :
|
2847 |
+
if ( _.isEmpty( params.id ) ) {
|
2848 |
+
throw new Error( 'updateAPISetting => ' + params.action + ' => missing id' );
|
2849 |
+
}
|
2850 |
|
2851 |
+
columnCandidate = self.getLevelModel( params.in_column, newSetValue.collection );
|
2852 |
+
var parentSektionCandidate = self.getLevelModel( params.in_sektion, newSetValue.collection );
|
2853 |
+
if ( 'no_match' == parentSektionCandidate ) {
|
2854 |
+
__updateAPISettingDeferred__.reject( 'updateAPISetting => ' + params.action + ' => no grand parent sektion found');
|
2855 |
+
break;
|
2856 |
+
}
|
2857 |
+
if ( true === parentSektionCandidate.is_nested ) {
|
2858 |
+
__updateAPISettingDeferred__.reject( sektionsLocalizedData.i18n[ "You've reached the maximum number of allowed nested sections." ]);
|
2859 |
+
break;
|
2860 |
+
}
|
2861 |
+
if ( 'no_match' == columnCandidate ) {
|
2862 |
+
api.errare( 'updateAPISetting => ' + params.action + ' => no parent column matched' );
|
2863 |
+
__updateAPISettingDeferred__.reject( 'updateAPISetting => ' + params.action + ' => no parent column matched');
|
2864 |
+
break;
|
2865 |
+
}
|
2866 |
+
columnCandidate.collection = _.isArray( columnCandidate.collection ) ? columnCandidate.collection : [];
|
2867 |
+
var presetColumnCollection;
|
2868 |
+
__presetSectionInjected__ = $.Deferred();//defined at the beginning of the method
|
2869 |
+
|
2870 |
+
_doWhenPresetSectionCollectionFetched = function( presetColumnCollection ) {
|
2871 |
+
self.preparePresetSectionForInjection( presetColumnCollection )
|
2872 |
+
.fail( function( _er_ ){
|
2873 |
+
__updateAPISettingDeferred__.reject( 'updateAPISetting => error when preparePresetSectionForInjection => ' + params.action + ' => ' + _er_ );
|
2874 |
+
__presetSectionInjected__.reject( _er_ );
|
2875 |
+
})
|
2876 |
+
.done( function( sectionReadyToInject ) {
|
2877 |
+
columnCandidate.collection.push({
|
2878 |
+
id : params.id,
|
2879 |
+
level : 'section',
|
2880 |
+
collection : sectionReadyToInject.collection,
|
2881 |
+
options : sectionReadyToInject.options || {},
|
2882 |
+
is_nested : true,
|
2883 |
+
ver_ini : sektionsLocalizedData.nimbleVersion
|
2884 |
+
});
|
2885 |
+
__presetSectionInjected__.resolve();
|
2886 |
+
});//self.preparePresetSectionForInjection.done()
|
2887 |
+
};//_doWhenPresetSectionCollectionFetched
|
2888 |
+
self.getPresetSectionCollection({
|
2889 |
+
presetSectionType : params.content_id,
|
2890 |
+
section_id : params.id//<= we need to use the section id already generated, and passed for ajax action @see ::reactToPreviewMsg, case "sek-add-section"
|
2891 |
+
})
|
2892 |
+
.fail( function() {
|
2893 |
+
api.errare( 'updateAPISetting => ' + params.action + ' => Error with self.getPresetSectionCollection()', _er_ );
|
2894 |
+
__updateAPISettingDeferred__.reject( 'updateAPISetting => ' + params.action + ' => Error with self.getPresetSectionCollection()');
|
2895 |
+
})
|
2896 |
+
.done( function( presetColumnCollection ) {
|
2897 |
+
if ( ! _.isObject( presetColumnCollection ) || _.isEmpty( presetColumnCollection ) ) {
|
2898 |
+
api.errare( 'updateAPISetting => ' + params.action + ' => preset section type not found or empty : ' + params.content_id, presetColumnCollection );
|
2899 |
+
__updateAPISettingDeferred__.reject( 'updateAPISetting => ' + params.action + ' => preset section type not found or empty');
|
2900 |
+
}
|
2901 |
+
_doWhenPresetSectionCollectionFetched( presetColumnCollection );
|
2902 |
+
});//self.getPresetSectionCollection().done()
|
2903 |
+
break;
|
2904 |
case 'sek-update-fonts' :
|
|
|
|
|
2905 |
var currentGfonts = self.sniffGFonts();
|
2906 |
if ( ! _.isEmpty( params.font_family ) && _.isString( params.font_family ) && ! _.contains( currentGfonts, params.font_family ) ) {
|
2907 |
if ( params.font_family.indexOf('gfont') < 0 ) {
|
2908 |
api.errare( 'updateAPISetting => ' + params.action + ' => error => must be a google font, prefixed gfont' );
|
2909 |
+
__updateAPISettingDeferred__.reject( 'updateAPISetting => ' + params.action + ' => error => must be a google font, prefixed gfont');
|
2910 |
break;
|
2911 |
}
|
2912 |
currentGfonts.push( params.font_family );
|
2913 |
}
|
|
|
|
|
2914 |
newSetValue.fonts = currentGfonts;
|
2915 |
break;
|
2916 |
}// switch
|
2917 |
+
if ( 'pending' == __updateAPISettingDeferred__.state() ) {
|
2918 |
+
var mayBeUpdateSektionsSetting = function() {
|
2919 |
+
if ( _.isEqual( currentSetValue, newSetValue ) ) {
|
2920 |
+
__updateAPISettingDeferred__.reject( 'updateAPISetting => the new setting value is unchanged when firing action : ' + params.action );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2921 |
} else {
|
2922 |
+
if ( null !== self.validateSettingValue( newSetValue ) ) {
|
2923 |
+
sektionSetInstance( newSetValue, params );
|
2924 |
+
__updateAPISettingDeferred__.resolve( cloneId );// the cloneId is only needed in the duplication scenarii
|
2925 |
+
} else {
|
2926 |
+
__updateAPISettingDeferred__.reject( 'updateAPISetting => the new setting value did not pass the validation checks for action ' + params.action );
|
2927 |
+
}
|
2928 |
}
|
2929 |
+
};//mayBeUpdateSektionsSetting()
|
2930 |
|
2931 |
+
if ( false === __presetSectionInjected__ ) {
|
2932 |
+
mayBeUpdateSektionsSetting();
|
2933 |
+
} else {
|
2934 |
+
__presetSectionInjected__
|
2935 |
+
.done( function() {
|
2936 |
+
mayBeUpdateSektionsSetting();
|
2937 |
+
})
|
2938 |
+
.fail( function( _er_ ) {
|
2939 |
+
api.errare( 'updateAPISetting => __presetSectionInjected__ failed', _er_ );
|
2940 |
+
});
|
2941 |
}
|
2942 |
}
|
2943 |
});//api( self.sekCollectionSettingId(), function( sektionSetInstance ) {}
|
2944 |
+
return __updateAPISettingDeferred__.promise();
|
2945 |
},//updateAPISetting
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2946 |
getPresetSectionCollection : function( sectionParams ) {
|
2947 |
var self = this,
|
2948 |
+
__dfd__ = $.Deferred(),
|
2949 |
+
_getPresetSections = function() {
|
2950 |
+
var dfd = $.Deferred();
|
2951 |
+
if ( ! _.isEmpty( api.sek_presetSections ) ) {
|
2952 |
+
dfd.resolve( api.sek_presetSections );
|
2953 |
+
} else {
|
2954 |
+
var _ajaxRequest_;
|
2955 |
+
if ( ! _.isUndefined( api.sek_fetchingPresetSections ) && 'pending' == api.sek_fetchingPresetSections.state() ) {
|
2956 |
+
_ajaxRequest_ = api.sek_fetchingPresetSections;
|
2957 |
+
} else {
|
2958 |
+
_ajaxRequest_ = api.CZR_Helpers.getModuleTmpl( {
|
2959 |
+
tmpl : 'font_list',
|
2960 |
+
module_type: 'preset_sections_server_collection',
|
2961 |
+
module_id : 'no_module_id'
|
2962 |
+
} );
|
2963 |
+
api.sek_fetchingPresetSections = _ajaxRequest_;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2964 |
}
|
2965 |
|
2966 |
+
_ajaxRequest_.done( function( _collection_ ) {
|
2967 |
+
api.sek_presetSections = _collection_;
|
2968 |
+
dfd.resolve( api.sek_presetSections );
|
2969 |
+
}).fail( function( _r_ ) {
|
2970 |
+
dfd.reject( _r_ );
|
2971 |
+
});
|
2972 |
|
2973 |
+
}
|
2974 |
+
return dfd.promise();
|
2975 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2976 |
|
|
|
|
|
|
|
|
|
|
|
|
|
2977 |
|
2978 |
+
_getPresetSections()
|
2979 |
+
.fail( function( er ) {
|
2980 |
+
__dfd__.reject( er );
|
2981 |
+
})
|
2982 |
+
.done( function( _collection_ ) {
|
2983 |
+
var presetSection,
|
2984 |
+
allPresets = $.extend( true, {}, _.isObject( _collection_ ) ? _collection_ : {} );
|
2985 |
|
2986 |
+
if ( _.isEmpty( allPresets ) ) {
|
2987 |
+
throw new Error( 'getPresetSectionCollection => Invalid collection');
|
|
|
|
|
2988 |
}
|
2989 |
+
if ( _.isEmpty( allPresets[ sectionParams.presetSectionType ] ) ) {
|
2990 |
+
throw new Error( 'getPresetSectionCollection => the preset section : "' + sectionParams.presetSectionType + '" has not been found in the collection');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2991 |
}
|
2992 |
+
var presetCandidate = allPresets[ sectionParams.presetSectionType ];
|
|
|
|
|
|
|
2993 |
|
2994 |
+
var setIds = function( collection ) {
|
2995 |
+
_.each( collection, function( levelData ) {
|
2996 |
+
levelData.id = sektionsLocalizedData.optPrefixForSektionsNotSaved + self.guid();
|
2997 |
+
if ( _.isArray( levelData.collection ) ) {
|
2998 |
+
setIds( levelData.collection );
|
2999 |
+
}
|
3000 |
+
});
|
3001 |
+
return collection;
|
3002 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3003 |
|
3004 |
+
var setVersion = function( collection ) {
|
3005 |
+
_.each( collection, function( levelData ) {
|
3006 |
+
levelData.ver_ini = sektionsLocalizedData.nimbleVersion;
|
3007 |
+
if ( _.isArray( levelData.collection ) ) {
|
3008 |
+
setVersion( levelData.collection );
|
3009 |
+
}
|
3010 |
+
});
|
3011 |
+
return collection;
|
3012 |
+
};
|
3013 |
+
presetCandidate.id = sectionParams.section_id;
|
3014 |
+
presetCandidate.collection = setIds( presetCandidate.collection );
|
3015 |
+
presetCandidate.ver_ini = sektionsLocalizedData.nimbleVersion;
|
3016 |
+
presetCandidate.collection = setVersion( presetCandidate.collection );
|
3017 |
+
__dfd__.resolve( presetCandidate );
|
3018 |
+
});//_getPresetSections.done()
|
3019 |
+
|
3020 |
+
return __dfd__.promise();
|
3021 |
},
|
3022 |
+
preparePresetSectionForInjection : function( columnCollection ) {
|
3023 |
+
var self = this,
|
3024 |
+
deferreds = {},
|
3025 |
+
preparedSection = {},
|
3026 |
+
_dfd_ = $.Deferred();
|
3027 |
+
var _sniffImg = function( data ) {
|
3028 |
+
_.each( data, function( val, key ) {
|
3029 |
+
if ( _.isObject( val ) || _.isArray( val ) ) {
|
3030 |
+
_sniffImg( val );
|
3031 |
+
} else if ( _.isString( val ) && -1 != val.indexOf( '::img-path::' ) ) {
|
3032 |
+
if ( ! _.has( deferreds, val ) ) {
|
3033 |
+
deferreds[ val ] = self.importAttachment( val.replace( '::img-path::', '' ) );
|
3034 |
+
}
|
3035 |
+
}
|
3036 |
+
});
|
3037 |
+
return deferreds;
|
3038 |
+
};
|
3039 |
+
var _replaceImgPlaceholderById = function( data, imgList) {
|
3040 |
+
_.each( data, function( val, key ) {
|
3041 |
+
if ( _.isObject( val ) || _.isArray( val ) ) {
|
3042 |
+
_replaceImgPlaceholderById( val, imgList );
|
3043 |
+
} else if ( _.isString( val ) && -1 != val.indexOf( '::img-path::' ) && _.has( imgList, val ) ) {
|
3044 |
+
data[ key ] = imgList[ val ][ 'id'];
|
3045 |
+
}
|
3046 |
+
});
|
3047 |
+
return columnCollection;
|
3048 |
+
};
|
3049 |
+
|
3050 |
+
self.whenAllPromisesInParallel( _sniffImg( columnCollection ) )
|
3051 |
+
.done( function( imgList ) {
|
3052 |
+
var imgReadySection = _replaceImgPlaceholderById( columnCollection, imgList );
|
3053 |
+
_dfd_.resolve( imgReadySection );
|
3054 |
+
})
|
3055 |
+
.fail( function( _er_ ){
|
3056 |
+
_dfd_.reject( _er_ );
|
3057 |
+
});
|
3058 |
|
3059 |
+
return _dfd_.promise();
|
3060 |
+
}
|
3061 |
+
});//$.extend()
|
3062 |
+
})( wp.customize, jQuery );//global sektionsLocalizedData
|
3063 |
+
var CZRSeksPrototype = CZRSeksPrototype || {};
|
3064 |
+
(function ( api, $ ) {
|
3065 |
+
$.extend( CZRSeksPrototype, {
|
3066 |
+
cleanRegistered : function( _id_ ) {
|
3067 |
var self = this,
|
3068 |
registered = $.extend( true, [], self.registered() || [] );
|
3069 |
|
3070 |
registered = _.filter( registered, function( _reg_ ) {
|
3071 |
if ( 'setting' !== _reg_.what ) {
|
3072 |
if ( api[ _reg_.what ].has( _reg_.id ) ) {
|
3073 |
+
if ( ! _.isEmpty( _id_ ) && _reg_.id !== _id_ )
|
3074 |
+
return;
|
3075 |
if ( _.isFunction( api[ _reg_.what ]( _reg_.id ).trigger ) ) {//<= Section and Panel constructor are not extended with the Event class, that's why we check if this method exists
|
3076 |
self.trigger( 'sek-ui-pre-removal', { what : _reg_.what, id : _reg_.id } );
|
3077 |
}
|
3078 |
$.when( api[ _reg_.what ]( _reg_.id ).container.remove() ).done( function() {
|
|
|
3079 |
api[ _reg_.what ].remove( _reg_.id );
|
|
|
3080 |
self.trigger( 'sek-ui-removed', { what : _reg_.what, id : _reg_.id } );
|
3081 |
});
|
3082 |
}
|
3084 |
return _reg_.what === 'setting';
|
3085 |
});
|
3086 |
self.registered( registered );
|
3087 |
+
},
|
3088 |
+
cleanRegisteredLevelSettingsAfterHistoryNavigation : function() {
|
3089 |
+
var self = this,
|
3090 |
+
registered = $.extend( true, [], self.registered() || [] );
|
3091 |
+
|
3092 |
+
registered = _.filter( registered, function( _reg_ ) {
|
3093 |
+
if ( ! _.isEmpty( _reg_.level ) && 'setting' === _reg_.what ) {
|
3094 |
+
if ( api.has( _reg_.id ) ) {
|
3095 |
+
api.remove( _reg_.id );
|
3096 |
+
}
|
3097 |
+
}
|
3098 |
+
return _.isEmpty( _reg_.level ) && 'setting' !== _reg_.what ;
|
3099 |
+
});
|
3100 |
+
self.registered( registered );
|
3101 |
}
|
3102 |
|
3103 |
});//$.extend()
|
3105 |
var CZRSeksPrototype = CZRSeksPrototype || {};
|
3106 |
(function ( api, $ ) {
|
3107 |
$.extend( CZRSeksPrototype, {
|
|
|
3108 |
rootPanelFocus : function() {
|
|
|
3109 |
if ( api.section.has( api.czr_activeSectionId() ) ) {
|
3110 |
api.section( api.czr_activeSectionId() ).expanded( false );
|
3111 |
} else {
|
3117 |
_p.expanded( false );
|
3118 |
});
|
3119 |
},
|
|
|
|
|
3120 |
guid : function() {
|
3121 |
function s4() {
|
3122 |
return Math.floor((1 + Math.random()) * 0x10000)
|
3123 |
.toString(16)
|
3124 |
.substring(1);
|
3125 |
}
|
3126 |
+
return s4() + s4() + s4();//s4() + s4() + s4() + s4() + s4() + s4();
|
3127 |
},
|
|
|
|
|
|
|
|
|
3128 |
getLevelModel : function( id, collection ) {
|
3129 |
var self = this, _data_ = 'no_match';
|
|
|
|
|
3130 |
if ( _.isUndefined( collection ) ) {
|
3131 |
var currentSektionSettingValue = api( self.sekCollectionSettingId() )();
|
3132 |
var sektionSettingValue = _.isObject( currentSektionSettingValue ) ? $.extend( true, {}, currentSektionSettingValue ) : self.defaultSektionSettingValue;
|
3133 |
collection = _.isArray( sektionSettingValue.collection ) ? sektionSettingValue.collection : [];
|
3134 |
}
|
3135 |
_.each( collection, function( levelData ) {
|
|
|
3136 |
if ( 'no_match' != _data_ )
|
3137 |
return;
|
3138 |
if ( id === levelData.id ) {
|
3148 |
|
3149 |
getLevelPositionInCollection : function( id, collection ) {
|
3150 |
var self = this, _position_ = 'no_match';
|
|
|
|
|
3151 |
if ( _.isUndefined( collection ) ) {
|
3152 |
var currentSektionSettingValue = api( self.sekCollectionSettingId() )();
|
3153 |
var sektionSettingValue = _.isObject( currentSektionSettingValue ) ? $.extend( true, {}, currentSektionSettingValue ) : self.defaultSektionSettingValue;
|
3154 |
collection = _.isArray( sektionSettingValue.collection ) ? sektionSettingValue.collection : [];
|
3155 |
}
|
3156 |
_.each( collection, function( levelData, _key_ ) {
|
|
|
3157 |
if ( 'no_match' != _position_ )
|
3158 |
return;
|
3159 |
if ( id === levelData.id ) {
|
3166 |
});
|
3167 |
return _position_;
|
3168 |
},
|
|
|
|
|
|
|
3169 |
getLevelProperty : function( params ) {
|
3170 |
params = _.extend( {
|
3171 |
id : '',
|
3188 |
}
|
3189 |
return modelCandidate[ params.property ];
|
3190 |
},
|
|
|
|
|
3191 |
cloneLevel : function( levelId ) {
|
3192 |
var self = this;
|
3193 |
var levelModelCandidate = self.getLevelModel( levelId );
|
3195 |
throw new Error( 'cloneLevel => no match for level id : ' + levelId );
|
3196 |
}
|
3197 |
var deepClonedLevel = $.extend( true, {}, levelModelCandidate );
|
|
|
3198 |
var newIdWalker = function( level_model ) {
|
3199 |
if ( _.isEmpty( level_model.id ) ) {
|
3200 |
throw new Error( 'cloneLevel => missing level id');
|
3201 |
}
|
|
|
3202 |
level_model.id = sektionsLocalizedData.optPrefixForSektionsNotSaved + self.guid();
|
3203 |
if ( ! _.isEmpty( level_model.collection ) ) {
|
3204 |
if ( ! _.isArray( level_model.collection ) ) {
|
3211 |
}
|
3212 |
return level_model;
|
3213 |
};
|
|
|
3214 |
return newIdWalker( deepClonedLevel );
|
3215 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3216 |
getDefaultItemModelFromRegisteredModuleData : function( moduleType ) {
|
3217 |
if ( ! this.isModuleRegistered( moduleType ) ) {
|
3218 |
return {};
|
3219 |
}
|
3220 |
+
if ( sektionsLocalizedData.registeredModules[moduleType]['is_father'] ) {
|
3221 |
+
api.errare( 'getDefaultItemModelFromRegisteredModuleData => Father modules should be treated specifically' );
|
3222 |
+
return;
|
3223 |
+
}
|
3224 |
var data = sektionsLocalizedData.registeredModules[ moduleType ]['tmpl']['item-inputs'],
|
3225 |
+
defaultItemModel = {
|
|
|
|
|
3226 |
id : '',
|
3227 |
title : ''
|
3228 |
},
|
3233 |
case 'tabs' :
|
3234 |
_.each( _d_ , function( _tabData_ ) {
|
3235 |
_.each( _tabData_['inputs'], function( _inputData_, _id_ ) {
|
3236 |
+
defaultItemModel[ _id_ ] = _inputData_['default'] || '';
|
3237 |
});
|
3238 |
});
|
3239 |
break;
|
3240 |
default :
|
3241 |
+
defaultItemModel[ _key_ ] = _d_['default'] || '';
|
3242 |
break;
|
3243 |
}
|
3244 |
});
|
3245 |
+
return defaultItemModel;
|
3246 |
},
|
|
|
|
|
3247 |
getRegisteredModuleProperty : function( moduleType, property ) {
|
3248 |
if ( ! this.isModuleRegistered( moduleType ) ) {
|
3249 |
return 'not_set';
|
3250 |
}
|
3251 |
return sektionsLocalizedData.registeredModules[ moduleType ][ property ];
|
3252 |
},
|
|
|
|
|
3253 |
isModuleRegistered : function( moduleType ) {
|
3254 |
return sektionsLocalizedData.registeredModules && ! _.isUndefined( sektionsLocalizedData.registeredModules[ moduleType ] );
|
3255 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3256 |
sniffGFonts : function( gfonts, level ) {
|
3257 |
var self = this;
|
3258 |
gfonts = gfonts || [];
|
3262 |
level = _.isObject( currentSektionSettingValue ) ? $.extend( true, {}, currentSektionSettingValue ) : self.defaultSektionSettingValue;
|
3263 |
}
|
3264 |
_.each( level, function( levelData, _key_ ) {
|
3265 |
+
if ( _.isString( _key_ ) && '_css' === _key_.substr( _key_.length - 4 ) ) {
|
3266 |
+
if ( true === self.inputIsAFontFamilyModifier( _key_ ) ) {
|
3267 |
+
if ( levelData.indexOf('gfont') > -1 && ! _.contains( gfonts, levelData ) ) {
|
3268 |
+
gfonts.push( levelData );
|
3269 |
+
}
|
3270 |
}
|
3271 |
}
|
3272 |
|
3276 |
});
|
3277 |
return gfonts;
|
3278 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
3279 |
getInputDefaultValue : function( input_id, module_type, level ) {
|
3280 |
var self = this;
|
|
|
|
|
3281 |
self.cachedDefaultInputValues = self.cachedDefaultInputValues || {};
|
3282 |
self.cachedDefaultInputValues[ module_type ] = self.cachedDefaultInputValues[ module_type ] || {};
|
3283 |
if ( _.has( self.cachedDefaultInputValues[ module_type ], input_id ) ) {
|
3284 |
return self.cachedDefaultInputValues[ module_type ][ input_id ];
|
3285 |
}
|
|
|
3286 |
if ( _.isUndefined( sektionsLocalizedData.registeredModules ) ) {
|
3287 |
api.errare( 'getInputDefaultValue => missing sektionsLocalizedData.registeredModules' );
|
3288 |
return;
|
3289 |
}
|
3290 |
+
if ( _.isUndefined( sektionsLocalizedData.registeredModules[module_type] ) ) {
|
3291 |
+
api.errare( 'getInputDefaultValue => missing ' + module_type + ' in sektionsLocalizedData.registeredModules' );
|
3292 |
+
return;
|
3293 |
+
}
|
3294 |
+
if ( sektionsLocalizedData.registeredModules[module_type]['is_father'] ) {
|
3295 |
+
api.errare( 'getInputDefaultValue => Father modules should be treated specifically' );
|
3296 |
+
return;
|
3297 |
+
}
|
3298 |
if ( _.isUndefined( level ) ) {
|
3299 |
level = sektionsLocalizedData.registeredModules[ module_type ][ 'tmpl' ];
|
3300 |
}
|
3301 |
var _defaultVal_ = 'no_default_value_specified';
|
3302 |
_.each( level, function( levelData, _key_ ) {
|
|
|
3303 |
if ( 'no_default_value_specified' !== _defaultVal_ )
|
3304 |
return;
|
3305 |
if ( input_id === _key_ && ! _.isUndefined( levelData.default ) ) {
|
3306 |
_defaultVal_ = levelData.default;
|
3307 |
}
|
|
|
3308 |
if ( 'no_default_value_specified' === _defaultVal_ && ( _.isArray( levelData ) || _.isObject( levelData ) ) ) {
|
3309 |
_defaultVal_ = self.getInputDefaultValue( input_id, module_type, levelData );
|
3310 |
}
|
3311 |
if ( 'no_default_value_specified' !== _defaultVal_ ) {
|
|
|
3312 |
self.cachedDefaultInputValues[ module_type ][ input_id ] = _defaultVal_;
|
3313 |
}
|
3314 |
});
|
3315 |
return _defaultVal_;
|
3316 |
},
|
|
|
|
|
|
|
|
|
|
|
3317 |
getInputType : function( input_id, module_type, level ) {
|
3318 |
var self = this;
|
|
|
|
|
3319 |
self.cachedInputTypes = self.cachedInputTypes || {};
|
3320 |
self.cachedInputTypes[ module_type ] = self.cachedInputTypes[ module_type ] || {};
|
3321 |
if ( _.has( self.cachedInputTypes[ module_type ], input_id ) ) {
|
3322 |
return self.cachedInputTypes[ module_type ][ input_id ];
|
3323 |
}
|
|
|
3324 |
if ( _.isUndefined( sektionsLocalizedData.registeredModules ) ) {
|
3325 |
+
api.errare( 'getInputType => missing sektionsLocalizedData.registeredModules' );
|
3326 |
+
return;
|
3327 |
+
}
|
3328 |
+
if ( _.isUndefined( sektionsLocalizedData.registeredModules[module_type] ) ) {
|
3329 |
+
api.errare( 'getInputType => missing ' + module_type + ' in sektionsLocalizedData.registeredModules' );
|
3330 |
+
return;
|
3331 |
+
}
|
3332 |
+
if ( sektionsLocalizedData.registeredModules[module_type]['is_father'] ) {
|
3333 |
+
api.errare( 'getInputType => Father modules should be treated specifically' );
|
3334 |
return;
|
3335 |
}
|
3336 |
if ( _.isUndefined( level ) ) {
|
3338 |
}
|
3339 |
var _inputType_ = 'no_input_type_specified';
|
3340 |
_.each( level, function( levelData, _key_ ) {
|
|
|
3341 |
if ( 'no_input_type_specified' !== _inputType_ )
|
3342 |
return;
|
3343 |
if ( input_id === _key_ && ! _.isUndefined( levelData.input_type ) ) {
|
3344 |
_inputType_ = levelData.input_type;
|
3345 |
}
|
|
|
3346 |
if ( 'no_input_type_specified' === _inputType_ && ( _.isArray( levelData ) || _.isObject( levelData ) ) ) {
|
3347 |
_inputType_ = self.getInputType( input_id, module_type, levelData );
|
3348 |
}
|
3349 |
if ( 'no_input_type_specified' !== _inputType_ ) {
|
|
|
3350 |
self.cachedInputTypes[ module_type ][ input_id ] = _inputType_;
|
3351 |
}
|
3352 |
});
|
3353 |
return _inputType_;
|
3354 |
},
|
3355 |
+
getInputRegistrationParams : function( input_id, module_type, level ) {
|
3356 |
+
var self = this;
|
3357 |
+
self.cachedInputRegistrationParams = self.cachedInputRegistrationParams || {};
|
3358 |
+
self.cachedInputRegistrationParams[ module_type ] = self.cachedInputRegistrationParams[ module_type ] || {};
|
3359 |
+
if ( _.has( self.cachedInputRegistrationParams[ module_type ], input_id ) ) {
|
3360 |
+
return self.cachedInputRegistrationParams[ module_type ][ input_id ];
|
3361 |
+
}
|
3362 |
+
if ( _.isUndefined( sektionsLocalizedData.registeredModules ) ) {
|
3363 |
+
api.errare( 'getInputRegistrationParams => missing sektionsLocalizedData.registeredModules' );
|
3364 |
+
return;
|
3365 |
+
}
|
3366 |
+
if ( _.isUndefined( sektionsLocalizedData.registeredModules[module_type] ) ) {
|
3367 |
+
api.errare( 'getInputRegistrationParams => missing ' + module_type + ' in sektionsLocalizedData.registeredModules' );
|
3368 |
+
return;
|
3369 |
+
}
|
3370 |
+
if ( sektionsLocalizedData.registeredModules[module_type]['is_father'] ) {
|
3371 |
+
api.errare( 'getInputRegistrationParams => Father modules should be treated specifically' );
|
3372 |
+
return;
|
3373 |
+
}
|
3374 |
+
if ( _.isUndefined( level ) ) {
|
3375 |
+
level = sektionsLocalizedData.registeredModules[ module_type ][ 'tmpl' ];
|
3376 |
+
}
|
3377 |
+
var _params_ = {};
|
3378 |
+
_.each( level, function( levelData, _key_ ) {
|
3379 |
+
if ( ! _.isEmpty( _params_ ) )
|
3380 |
+
return;
|
3381 |
+
if ( input_id === _key_ && ! _.isUndefined( levelData.input_type ) ) {
|
3382 |
+
_params_ = levelData;
|
3383 |
+
}
|
3384 |
+
if ( _.isEmpty( _params_ ) && ( _.isArray( levelData ) || _.isObject( levelData ) ) ) {
|
3385 |
+
_params_ = self.getInputRegistrationParams( input_id, module_type, levelData );
|
3386 |
+
}
|
3387 |
+
if ( ! _.isEmpty( _params_ ) ) {
|
3388 |
+
self.cachedInputRegistrationParams[ module_type ][ input_id ] = _params_;
|
3389 |
+
}
|
3390 |
+
});
|
3391 |
+
return _params_;
|
3392 |
+
},
|
3393 |
+
inputIsAFontFamilyModifier : function( input_id, level ) {
|
3394 |
+
var self = this;
|
3395 |
+
self.cachedFontFamilyModifier = self.cachedFontFamilyModifier || {};
|
3396 |
+
if ( _.has( self.cachedFontFamilyModifier, input_id ) ) {
|
3397 |
+
return self.cachedFontFamilyModifier[ input_id ];
|
3398 |
+
}
|
3399 |
+
if ( _.isUndefined( sektionsLocalizedData.registeredModules ) ) {
|
3400 |
+
api.errare( 'inputIsAFontFamilyModifier => missing sektionsLocalizedData.registeredModules' );
|
3401 |
+
return;
|
3402 |
+
}
|
3403 |
+
if ( _.isUndefined( level ) ) {
|
3404 |
+
level = sektionsLocalizedData.registeredModules;
|
3405 |
+
}
|
3406 |
+
var _bool_ = 'not_set';
|
3407 |
+
_.each( level, function( levelData, _key_ ) {
|
3408 |
+
if ( 'not_set' !== _bool_ )
|
3409 |
+
return;
|
3410 |
+
if ( input_id === _key_ && ! _.isUndefined( levelData.input_type ) ) {
|
3411 |
+
_bool_ = _.isUndefined( levelData.refresh_fonts ) ? false : levelData.refresh_fonts;
|
3412 |
+
}
|
3413 |
+
if ( 'not_set' === _bool_ && ( _.isArray( levelData ) || _.isObject( levelData ) ) ) {
|
3414 |
+
_bool_ = self.inputIsAFontFamilyModifier( input_id, levelData );
|
3415 |
+
}
|
3416 |
+
if ( 'not_set' !== _bool_ ) {
|
3417 |
+
self.cachedFontFamilyModifier[ input_id ] = _bool_;
|
3418 |
+
}
|
3419 |
+
});
|
3420 |
+
return _bool_;
|
3421 |
+
},
|
3422 |
getModuleStartingValue : function( module_type ) {
|
3423 |
if ( ! sektionsLocalizedData.registeredModules ) {
|
3424 |
api.errare( 'getModuleStartingValue => missing sektionsLocalizedData.registeredModules' );
|
3430 |
}
|
3431 |
var starting_value = sektionsLocalizedData.registeredModules[ module_type ][ 'starting_value' ];
|
3432 |
return _.isEmpty( starting_value ) ? 'no_starting_value' : starting_value;
|
3433 |
+
},
|
3434 |
+
|
3435 |
+
|
3436 |
+
|
3437 |
+
/*
|
3438 |
+
* Following two functions taken from jQuery.tabbable 1.0
|
3439 |
+
* see https://github.com/marklagendijk/jquery.tabbable/blob/master/jquery.tabbable.js
|
3440 |
+
*
|
3441 |
+
* Copyright 2013, Mark Lagendijk
|
3442 |
+
* Released under the MIT license
|
3443 |
+
*/
|
3444 |
+
selectNextTabbableOrFocusable : function( selector ) {
|
3445 |
+
var selectables = $( selector );
|
3446 |
+
var current = $( ':focus' );
|
3447 |
+
var nextIndex = 0;
|
3448 |
+
if( current.length === 1 ) {
|
3449 |
+
var currentIndex = selectables.index( current );
|
3450 |
+
if( currentIndex + 1 < selectables.length ) {
|
3451 |
+
nextIndex = currentIndex + 1;
|
3452 |
+
}
|
3453 |
+
}
|
3454 |
+
|
3455 |
+
selectables.eq( nextIndex ).focus();
|
3456 |
+
},
|
3457 |
+
|
3458 |
+
selectPrevTabbableOrFocusable : function( selector ) {
|
3459 |
+
var selectables = $( selector );
|
3460 |
+
var current = $( ':focus' );
|
3461 |
+
var prevIndex = selectables.length - 1;
|
3462 |
+
if( current.length === 1 ) {
|
3463 |
+
var currentIndex = selectables.index( current );
|
3464 |
+
if( currentIndex > 0 ) {
|
3465 |
+
prevIndex = currentIndex - 1;
|
3466 |
+
}
|
3467 |
+
}
|
3468 |
+
|
3469 |
+
selectables.eq( prevIndex ).focus();
|
3470 |
+
},
|
3471 |
+
setupSelectInput : function() {
|
3472 |
+
var input = this,
|
3473 |
+
item = input.input_parent,
|
3474 |
+
module = input.module,
|
3475 |
+
inputRegistrationParams = api.czr_sektions.getInputRegistrationParams( input.id, input.module.module_type ),
|
3476 |
+
selectOptions = inputRegistrationParams.choices;
|
3477 |
+
|
3478 |
+
if ( _.isEmpty( selectOptions ) ) {
|
3479 |
+
api.errare( 'api.czr_sektions.setupSelectInput => missing select options for input id => ' + input.id + ' in image module');
|
3480 |
+
return;
|
3481 |
+
} else {
|
3482 |
+
_.each( selectOptions , function( title, value ) {
|
3483 |
+
var _attributes = {
|
3484 |
+
value : value,
|
3485 |
+
html: title
|
3486 |
+
};
|
3487 |
+
if ( value == input() ) {
|
3488 |
+
$.extend( _attributes, { selected : "selected" } );
|
3489 |
+
} else if ( 'px' === value ) {
|
3490 |
+
$.extend( _attributes, { selected : "selected" } );
|
3491 |
+
}
|
3492 |
+
$( 'select[data-czrtype]', input.container ).append( $('<option>', _attributes) );
|
3493 |
+
});
|
3494 |
+
$( 'select[data-czrtype]', input.container ).selecter();
|
3495 |
+
}
|
3496 |
+
},
|
3497 |
+
setupFontSizeAndLineHeightInputs : function( obj ) {
|
3498 |
+
var input = this,
|
3499 |
+
$wrapper = $('.sek-font-size-line-height-wrapper', input.container ),
|
3500 |
+
initial_unit = $wrapper.find('input[data-czrtype]').data('sek-unit'),
|
3501 |
+
validateUnit = function( unit ) {
|
3502 |
+
if ( ! _.contains( ['px', 'em', '%'], unit ) ) {
|
3503 |
+
api.errare( 'error : invalid unit for input ' + input.id, unit );
|
3504 |
+
unit = 'px';
|
3505 |
+
}
|
3506 |
+
return unit;
|
3507 |
+
};
|
3508 |
+
input.css_unit = new api.Value( _.isEmpty( initial_unit ) ? 'px' : validateUnit( initial_unit ) );
|
3509 |
+
input.css_unit.bind( function( to ) {
|
3510 |
+
to = _.isEmpty( to ) ? 'px' : to;
|
3511 |
+
$wrapper.find( 'input[type="number"]').trigger('change');
|
3512 |
+
});
|
3513 |
+
$wrapper.find( 'input[type="number"]').on('input change', function( evt ) {
|
3514 |
+
input( $(this).val() + validateUnit( input.css_unit() ) );
|
3515 |
+
}).stepper();
|
3516 |
+
$wrapper.on( 'click', '[data-sek-unit]', function(evt) {
|
3517 |
+
evt.preventDefault();
|
3518 |
+
$wrapper.find('[data-sek-unit]').removeClass('is-selected').attr( 'aria-pressed', false );
|
3519 |
+
$(this).addClass('is-selected').attr( 'aria-pressed', true );
|
3520 |
+
$wrapper.find('input[data-czrtype]').data('sek-unit', $(this).data('sek-unit') );
|
3521 |
+
input.css_unit( $(this).data('sek-unit') );
|
3522 |
+
});
|
3523 |
+
$wrapper.find( '.sek-ui-button[data-sek-unit="'+ initial_unit +'"]').addClass('is-selected').attr( 'aria-pressed', true );
|
3524 |
+
},
|
3525 |
+
maybeSetupDeviceSwitcherForInput : function() {
|
3526 |
+
var input = this;
|
3527 |
+
var deviceSwitcherHtml = [
|
3528 |
+
'<span class="sek-input-device-switcher">',
|
3529 |
+
'<i data-sek-device="desktop" class="sek-switcher preview-desktop active" title="'+ sektionsLocalizedData.i18n['Settings on desktops'] +'"></i>',
|
3530 |
+
'<i data-sek-device="tablet" class="sek-switcher preview-tablet" title="'+ sektionsLocalizedData.i18n['Settings on tablets'] +'"></i>',
|
3531 |
+
'<i data-sek-device="mobile" class="sek-switcher preview-mobile" title="'+ sektionsLocalizedData.i18n['Settings on mobiles'] +'"></i>',
|
3532 |
+
'</span>'
|
3533 |
+
].join(' ');
|
3534 |
+
|
3535 |
+
input.container.find('.customize-control-title').prepend( deviceSwitcherHtml );
|
3536 |
+
input.previewedDevice = new api.Value( api.previewedDevice() );
|
3537 |
+
|
3538 |
+
|
3539 |
+
syncWithPreviewedDevice = function( evt ) {
|
3540 |
+
evt.stopPropagation();
|
3541 |
+
input.container.find( '[data-sek-device]' ).removeClass('active');
|
3542 |
+
$(this).addClass('active');
|
3543 |
+
var device = 'desktop';
|
3544 |
+
try { device = $(this).data('sek-device'); } catch( er ) {
|
3545 |
+
api.errare( 'maybeSetupDeviceSwitcherForInput => error when binding sek-switcher', er );
|
3546 |
+
}
|
3547 |
+
try { api.previewedDevice( device ); } catch( er ) {
|
3548 |
+
api.errare( 'maybeSetupDeviceSwitcherForInput => error when setting the previewed device', er );
|
3549 |
+
}
|
3550 |
+
input.previewedDevice( device );
|
3551 |
+
};
|
3552 |
+
input.container.on( 'click', '[data-sek-device]', syncWithPreviewedDevice );
|
3553 |
+
var $currentDeviceIcon = input.container.find('[data-sek-device="' + api.previewedDevice() + '"]');
|
3554 |
+
if ( $currentDeviceIcon.length > 0 ) {
|
3555 |
+
$currentDeviceIcon.trigger('click');
|
3556 |
+
}
|
3557 |
+
},
|
3558 |
+
scheduleModuleAccordion : function( params ) {
|
3559 |
+
params = params || { expand_first_module : true };
|
3560 |
+
var _section_ = this;
|
3561 |
+
$( _section_.container ).on( 'click', '.customize-control label > .customize-control-title', function( evt ) {
|
3562 |
+
evt.stopPropagation();
|
3563 |
+
var $control = $(this).closest( '.customize-control');
|
3564 |
+
|
3565 |
+
if ( "no" === $control.attr( 'data-sek-accordion' ))
|
3566 |
+
return;
|
3567 |
+
|
3568 |
+
_section_.container.find('.customize-control').not( $control ).each( function() {
|
3569 |
+
if ( $(this).attr( 'data-sek-accordion' ) )
|
3570 |
+
return;
|
3571 |
+
$(this).attr('data-sek-expanded', "false" );
|
3572 |
+
$(this).find('.czr-items-wrapper').stop( true, true ).slideUp( 'fast' );
|
3573 |
+
});
|
3574 |
+
$control.find('.czr-items-wrapper').stop( true, true ).slideToggle({
|
3575 |
+
duration : 'fast',
|
3576 |
+
start : function() {
|
3577 |
+
$control.attr('data-sek-expanded', "false" == $control.attr('data-sek-expanded') ? "true" : "false" );
|
3578 |
+
if ( "true" == $control.attr('data-sek-expanded') ) {
|
3579 |
+
$control.trigger( 'sek-accordion-expanded' );
|
3580 |
+
} else {
|
3581 |
+
$control.trigger( 'sek-accordion-collapsed' );
|
3582 |
+
}
|
3583 |
+
}
|
3584 |
+
});
|
3585 |
+
});
|
3586 |
+
if ( params.expand_first_module ) {
|
3587 |
+
_section_.container.find('.customize-control').first().find('label > .customize-control-title').trigger('click');
|
3588 |
+
}
|
3589 |
+
},
|
3590 |
+
isPromise : function (fn) {
|
3591 |
+
return fn && typeof fn.then === 'function' && String( $.Deferred().then ) === String( fn.then );
|
3592 |
+
},
|
3593 |
+
whenAllPromisesInParallel : function ( deferreds ) {
|
3594 |
+
var self = this,
|
3595 |
+
mainDfd = $.Deferred(),
|
3596 |
+
args = [],
|
3597 |
+
_keys_ = _.keys( deferreds );
|
3598 |
+
|
3599 |
+
_.each( deferreds, function( mayBeDfd, _k_ ) {
|
3600 |
+
args.push( $.Deferred( function( _dfd_ ) {
|
3601 |
+
var dfdCandidate = self.isPromise( mayBeDfd ) ? mayBeDfd : $.Deferred();
|
3602 |
+
dfdCandidate
|
3603 |
+
.done( _dfd_.resolve )
|
3604 |
+
.fail( function (err) { _dfd_.reject( err ); } );
|
3605 |
+
}) );
|
3606 |
+
});
|
3607 |
+
$.when.apply( this, args )
|
3608 |
+
.done( function () {
|
3609 |
+
var resObj = {},
|
3610 |
+
resArgs = Array.prototype.slice.call( arguments );
|
3611 |
+
|
3612 |
+
_.each( resArgs, function( v, i ) {
|
3613 |
+
resObj[ _keys_[i] ] = v;
|
3614 |
+
});
|
3615 |
+
mainDfd.resolve( resObj );
|
3616 |
+
})
|
3617 |
+
.fail( mainDfd.reject );
|
3618 |
+
|
3619 |
+
return mainDfd;
|
3620 |
+
},
|
3621 |
+
whenAllPromisesInSerie : function ( deferreds, ind, promiseMessages, mainDfd ) {
|
3622 |
+
ind = ind || 0;
|
3623 |
+
promiseMessages = promiseMessages || {};
|
3624 |
+
mainDfd = mainDfd || $.Deferred();
|
3625 |
+
var self = this;
|
3626 |
+
if ( _.isArray( deferreds ) ) {
|
3627 |
+
var mayBeDfd = deferreds[ind],
|
3628 |
+
dfdCandidate = self.isPromise( mayBeDfd ) ? mayBeDfd : $.Deferred( function( _d_ ) { _d_.resolve(); } );
|
3629 |
+
|
3630 |
+
dfdCandidate.always( function( msg ) {
|
3631 |
+
promiseMessages[ ind ] = msg;
|
3632 |
+
if ( ( ind + 1 ) == deferreds.length ) {
|
3633 |
+
mainDfd.resolve( promiseMessages );
|
3634 |
+
} else {
|
3635 |
+
if ( ind + 1 < deferreds.length ) {
|
3636 |
+
self.whenAllPromisesInSerie( deferreds, ind + 1, promiseMessages, mainDfd );
|
3637 |
+
}
|
3638 |
+
}
|
3639 |
+
});
|
3640 |
+
}//if
|
3641 |
+
return mainDfd;
|
3642 |
+
},
|
3643 |
+
importAttachment : function( relpath ) {
|
3644 |
+
return wp.ajax.post( 'sek_import_attachment', {
|
3645 |
+
rel_path : relpath,
|
3646 |
+
nonce: api.settings.nonce.save//<= do we need to set a specific nonce to fetch the attachment
|
3647 |
+
})
|
3648 |
+
.fail( function( _er_ ) {
|
3649 |
+
api.errare( 'sek_import_attachment ajax action failed for image ' + relpath, _er_ );
|
3650 |
+
});
|
3651 |
+
}
|
3652 |
+
|
3653 |
+
});//$.extend()
|
3654 |
+
})( wp.customize, jQuery );//global sektionsLocalizedData
|
3655 |
+
/**
|
3656 |
+
* @https://github.com/StackHive/DragDropInterface
|
3657 |
+
* @https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API
|
3658 |
+
* @https://html.spec.whatwg.org/multipage/dnd.html#dnd
|
3659 |
+
* @https://caniuse.com/#feat=dragndrop
|
3660 |
+
*/
|
3661 |
var CZRSeksPrototype = CZRSeksPrototype || {};
|
3662 |
(function ( api, $ ) {
|
3663 |
$.extend( CZRSeksPrototype, {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3664 |
setupDnd : function() {
|
3665 |
var self = this;
|
|
|
|
|
3666 |
self.bind( 'sek-refresh-dragzones', function( params ) {
|
3667 |
if ( 'draggable' in document.createElement('span') ) {
|
3668 |
self.setupNimbleDragZones( params.input_container );//<= module or section picker
|
3673 |
message: sektionsLocalizedData.i18n['This browser does not support drag and drop. You might need to update your browser or use another one.'],
|
3674 |
dismissible: true
|
3675 |
} ) );
|
|
|
|
|
3676 |
_.delay( function() {
|
3677 |
api.notifications.remove( 'drag-drop-support' );
|
3678 |
}, 10000 );
|
3679 |
});
|
3680 |
}
|
3681 |
});
|
|
|
|
|
3682 |
api.previewer.bind( 'ready', function() {
|
3683 |
try { self.setupNimbleDropZones();//<= module or section picker
|
3684 |
} catch( er ) {
|
3685 |
api.errare( '::setupDnd => error on self.setupNimbleDropZones()', er );
|
3686 |
}
|
3687 |
+
if ( ! _.isUndefined( _.findWhere( self.registered(), { module_type : 'sek_intro_sec_picker_module' } ) ) ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3688 |
self.rootPanelFocus();
|
3689 |
} else if ( ! _.isUndefined( _.findWhere( self.registered(), { module_type : 'sek_module_picker_module' } ) ) ) {
|
3690 |
self.rootPanelFocus();
|
3691 |
}
|
3692 |
});
|
|
|
|
|
3693 |
self.reactToDrop();
|
3694 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
3695 |
setupNimbleDragZones : function( $draggableWrapper ) {
|
3696 |
var self = this;
|
|
|
|
|
3697 |
var _onStart = function( evt ) {
|
3698 |
evt.originalEvent.dataTransfer.setData( "sek-content-type", $(this).data('sek-content-type') );
|
3699 |
evt.originalEvent.dataTransfer.setData( "sek-content-id", $(this).data('sek-content-id') );
|
|
|
|
|
|
|
3700 |
try {
|
3701 |
evt.originalEvent.dataTransfer.setData( 'browserSupport', 'browserSupport' );
|
3702 |
evt.originalEvent.dataTransfer.setData( 'browserSupport', 'browserSupport' );
|
3708 |
message: sektionsLocalizedData.i18n['This browser does not support drag and drop. You might need to update your browser or use another one.'],
|
3709 |
dismissible: true
|
3710 |
} ) );
|
|
|
|
|
3711 |
_.delay( function() {
|
3712 |
api.notifications.remove( 'drag-drop-support' );
|
3713 |
}, 10000 );
|
3714 |
});
|
3715 |
}
|
|
|
3716 |
self.dnd_draggedType = $(this).data('sek-content-type');
|
3717 |
+
$(this).addClass('sek-dragged');
|
3718 |
$('body').addClass('sek-dragging');
|
3719 |
api.previewer.send( 'sek-drag-start', { type : self.dnd_draggedType } );//fires the rendering of the dropzones
|
3720 |
};
|
3721 |
|
3722 |
var _onEnd = function( evt ) {
|
3723 |
$('body').removeClass('sek-dragging');
|
3724 |
+
$(this).removeClass('sek-dragged');
|
3725 |
api.previewer.send( 'sek-drag-stop' );
|
3726 |
};
|
|
|
|
|
3727 |
$draggableWrapper.find( '[draggable]' ).each( function() {
|
3728 |
+
$(this).on( 'dragstart', function( evt ) { _onStart.call( $(this), evt ); })
|
3729 |
+
.on( 'dragend', function( evt ) { _onEnd.call( $(this), evt ); });
|
|
|
|
|
|
|
|
|
3730 |
});
|
3731 |
},//setupNimbleZones()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3732 |
setupNimbleDropZones : function() {
|
3733 |
var self = this;
|
3734 |
this.$dropZones = this.dnd_getDropZonesElements();
|
3742 |
|
3743 |
this.$dropZones.each( function() {
|
3744 |
var $zone = $(this);
|
|
|
3745 |
if ( true === $zone.data('zone-droppable-setup') )
|
3746 |
return;
|
3747 |
|
3748 |
self.enterOverTimer = null;
|
|
|
3749 |
$zone
|
|
|
3750 |
.on( 'dragenter dragover', sektionsLocalizedData.dropSelectors, function( evt ) {
|
|
|
3751 |
if ( _.isNull( self.enterOverTimer ) ) {
|
3752 |
self.enterOverTimer = true;
|
3753 |
_.delay(function() {
|
|
|
|
|
3754 |
if ( self.currentMousePosition && ( ( self.currentMousePosition + '' ) == ( evt.clientY + '' + evt.clientX + '') ) ) {
|
3755 |
self.enterOverTimer = null;
|
3756 |
return;
|
3774 |
}
|
3775 |
break;
|
3776 |
case 'drop' :
|
|
|
3777 |
this.$cachedDropZoneCandidates = null;//has been declared on enter over
|
3778 |
|
3779 |
if ( ! self.dnd_canDrop( $(this) ) )
|
3781 |
evt.preventDefault();//@see https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API/Drag_operations#drop
|
3782 |
self.dnd_onDrop( $(this), evt );
|
3783 |
self.dnd_cleanOnLeaveDrop( $(this), evt );
|
|
|
|
|
3784 |
api.previewer.send( 'sek-drag-stop' );
|
3785 |
break;
|
3786 |
}
|
3789 |
|
3790 |
});//this.dropZones.each()
|
3791 |
},//setupNimbleDropZones()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3792 |
dnd_toggleDragApproachClassesToDropZones : function( evt ) {
|
3793 |
var self = this;
|
3794 |
this.$dropZones = this.$dropZones || this.dnd_getDropZonesElements();
|
3797 |
this.$dropZones.find('.sek-drop-zone').each( function() {
|
3798 |
var yPos = evt.clientY,
|
3799 |
xPos = evt.clientX,
|
3800 |
+
APPROACHING_DIST = 120,
|
3801 |
+
CLOSE_DIST = 80,
|
3802 |
+
VERY_CLOSE_DIST = 60;
|
3803 |
|
3804 |
var dzoneRect = $(this)[0].getBoundingClientRect(),
|
3805 |
+
mouseToYCenter = Math.abs( yPos - ( dzoneRect.bottom - ( dzoneRect.bottom - dzoneRect.top )/2 ) ),
|
3806 |
mouseToTop = Math.abs( dzoneRect.top - yPos ),
|
3807 |
+
mouseToXCenter = Math.abs( xPos - ( dzoneRect.right - ( dzoneRect.right - dzoneRect.left )/2 ) ),
|
3808 |
mouseToRight = xPos - dzoneRect.right,
|
3809 |
mouseToLeft = dzoneRect.left - xPos,
|
3810 |
+
isVeryCloseVertically = mouseToYCenter < VERY_CLOSE_DIST,
|
3811 |
+
isVeryCloseHorizontally = mouseToXCenter < VERY_CLOSE_DIST,
|
3812 |
+
isCloseVertically = mouseToYCenter < CLOSE_DIST,
|
3813 |
+
isCloseHorizontally = mouseToXCenter < CLOSE_DIST,
|
3814 |
+
isApproachingVertically = mouseToYCenter < APPROACHING_DIST,
|
3815 |
+
isApproachingHorizontally = mouseToXCenter < APPROACHING_DIST,
|
3816 |
+
|
3817 |
isInHorizontally = xPos <= dzoneRect.right && dzoneRect.left <= xPos,
|
3818 |
+
isInVertically = yPos >= dzoneRect.top && dzoneRect.bottom >= yPos;
|
3819 |
+
|
3820 |
+
if ( isInVertically && isInHorizontally ) {
|
3821 |
+
$(this).removeClass( 'sek-drag-is-approaching');
|
3822 |
+
$(this).removeClass( 'sek-drag-is-close' );
|
3823 |
+
$(this).removeClass( 'sek-drag-is-very-close');
|
3824 |
+
$(this).addClass( 'sek-drag-is-in');
|
3825 |
+
} else if ( ( isVeryCloseVertically || isInVertically ) && ( isVeryCloseHorizontally || isInHorizontally ) ) {
|
3826 |
+
$(this).removeClass( 'sek-drag-is-approaching');
|
3827 |
+
$(this).removeClass( 'sek-drag-is-close' );
|
|
|
|
|
|
|
|
|
|
|
|
|
3828 |
$(this).addClass( 'sek-drag-is-very-close');
|
3829 |
+
$(this).removeClass( 'sek-drag-is-in');
|
|
|
3830 |
} else if ( ( isCloseVertically || isInVertically ) && ( isCloseHorizontally || isInHorizontally ) ) {
|
3831 |
+
$(this).removeClass( 'sek-drag-is-approaching');
|
3832 |
+
$(this).addClass( 'sek-drag-is-close' );
|
3833 |
$(this).removeClass( 'sek-drag-is-very-close');
|
3834 |
+
$(this).removeClass( 'sek-drag-is-in');
|
3835 |
} else if ( ( isApproachingVertically || isInVertically ) && ( isApproachingHorizontally || isInHorizontally ) ) {
|
3836 |
$(this).addClass( 'sek-drag-is-approaching');
|
|
|
3837 |
$(this).removeClass( 'sek-drag-is-close' );
|
|
|
3838 |
$(this).removeClass( 'sek-drag-is-very-close');
|
3839 |
+
$(this).removeClass( 'sek-drag-is-in');
|
3840 |
+
} else {
|
3841 |
+
$(this).removeClass( 'sek-drag-is-approaching');
|
3842 |
$(this).removeClass( 'sek-drag-is-close' );
|
3843 |
+
$(this).removeClass( 'sek-drag-is-very-close');
|
3844 |
+
$(this).removeClass( 'sek-drag-is-in');
|
3845 |
}
|
3846 |
});//$('.sek-drop-zones').each()
|
|
|
|
|
3847 |
self.enterOverTimer = null;
|
3848 |
},
|
|
|
|
|
3849 |
dnd_getPreDropElementContent : function( evt ) {
|
3850 |
var $target = $( evt.currentTarget ),
|
3851 |
html,
|
3873 |
}
|
3874 |
return preDropContent;
|
3875 |
},
|
|
|
|
|
3876 |
dnd_getDropZonesElements : function() {
|
3877 |
return $( api.previewer.targetWindow().document );
|
3878 |
},
|
|
|
|
|
|
|
3879 |
dnd_canDrop : function( $dropTarget ) {
|
3880 |
+
var isSectionDropZone = $dropTarget && $dropTarget.length > 0 && $dropTarget.hasClass( 'sek-content-preset_section-drop-zone' ),
|
3881 |
+
sectionHasNoModule = $dropTarget && $dropTarget.length > 0 && $dropTarget.hasClass( 'sek-module-drop-zone-for-first-module' );
|
3882 |
+
return $dropTarget.hasClass('sek-drop-zone') && ( ( 'preset_section' === this.dnd_draggedType && isSectionDropZone ) || ( 'module' === this.dnd_draggedType && ! isSectionDropZone ) || ( 'preset_section' === this.dnd_draggedType && sectionHasNoModule ) );
|
3883 |
},
|
|
|
|
|
3884 |
dnd_OnEnterOver : function( $dropTarget, evt ) {
|
3885 |
evt.preventDefault();//@see :https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API/Drag_operations#droptargets
|
|
|
3886 |
if ( true !== $dropTarget.data( 'is-drag-entered' ) ) {
|
|
|
3887 |
$dropTarget.data( 'is-drag-entered', true );
|
3888 |
$dropTarget.addClass( 'sek-active-drop-zone' );
|
|
|
3889 |
this.$dropZones.addClass( 'sek-is-dragging' );
|
3890 |
}
|
3891 |
|
3893 |
api.errare('Error when trying to insert the preDrop content', er );
|
3894 |
}
|
3895 |
},
|
|
|
|
|
3896 |
dnd_cleanOnLeaveDrop : function( $dropTarget, evt ) {
|
3897 |
var self = this;
|
3898 |
this.$dropZones = this.$dropZones || this.dnd_getDropZonesElements();
|
3903 |
self.dnd_cleanSingleDropTarget( $(this) );
|
3904 |
});
|
3905 |
},
|
|
|
|
|
3906 |
dnd_cleanSingleDropTarget : function( $dropTarget ) {
|
3907 |
if ( _.isEmpty( $dropTarget ) || $dropTarget.length < 1 )
|
3908 |
return;
|
3911 |
$dropTarget.removeClass( 'sek-active-drop-zone' );
|
3912 |
$dropTarget.find('.sek-drop-zone').removeClass('sek-drag-is-close');
|
3913 |
$dropTarget.find('.sek-drop-zone').removeClass('sek-drag-is-approaching');
|
|
|
3914 |
|
3915 |
+
$dropTarget.removeClass('sek-feed-me-seymore');
|
3916 |
+
},
|
3917 |
dnd_getPosition : function( $dropTarget, evt ) {
|
3918 |
var targetRect = $dropTarget[0].getBoundingClientRect(),
|
3919 |
targetHeight = targetRect.height;
|
|
|
|
|
3920 |
if ( 'before' === $dropTarget.data( 'preDrop-position' ) ) {
|
3921 |
targetHeight = targetHeight + this.preDropElement.outerHeight();
|
3922 |
} else if ( 'after' === $dropTarget.data( 'preDrop-position' ) ) {
|
3925 |
|
3926 |
return evt.originalEvent.clientY - targetRect.top - ( targetHeight / 2 ) > 0 ? 'after' : 'before';
|
3927 |
},
|
|
|
|
|
3928 |
dnd_mayBePrintPreDropElement : function( $dropTarget, evt ) {
|
3929 |
var self = this,
|
3930 |
previousPosition = $dropTarget.data( 'preDrop-position' ),
|
3938 |
}
|
3939 |
|
3940 |
self.isPrintingPreDrop = true;
|
|
|
|
|
3941 |
this.dnd_cleanSingleDropTarget( this.$currentPreDropTarget );
|
3942 |
var inNewSection = 'between-sections' === $dropTarget.data('sek-location') || 'in-empty-location' === $dropTarget.data('sek-location');
|
3943 |
$.when( self.preDropElement.remove() ).done( function(){
|
3944 |
$dropTarget[ 'before' === newPosition ? 'prepend' : 'append' ]( self.preDropElement )
|
3945 |
.find( '.' + sektionsLocalizedData.preDropElementClass ).html( self.dnd_getPreDropElementContent( evt ) );
|
|
|
3946 |
$dropTarget.find( '.' + sektionsLocalizedData.preDropElementClass ).toggleClass('in-new-sektion', inNewSection );
|
3947 |
$dropTarget.data( 'preDrop-position', newPosition );
|
3948 |
|
3949 |
+
$dropTarget.addClass('sek-feed-me-seymore');
|
3950 |
+
|
3951 |
self.isPrintingPreDrop = false;
|
3952 |
self.$currentPreDropTarget = $dropTarget;
|
3953 |
});
|
3954 |
},
|
|
|
|
|
3955 |
dnd_isOveringDropTarget : function( $dropTarget, evt ) {
|
3956 |
var targetRect = $dropTarget[0].getBoundingClientRect(),
|
3957 |
mouseX = evt.clientX,
|
3964 |
isYin = mouseY >= tTop && ( tBottom - tTop ) >= ( mouseY - tTop);
|
3965 |
return isXin && isYin;
|
3966 |
},
|
|
|
|
|
3967 |
dnd_onDrop: function( $dropTarget, evt ) {
|
3968 |
evt.stopPropagation();
|
3969 |
var _position = 'after' === this.dnd_getPosition( $dropTarget, evt ) ? $dropTarget.index() + 1 : $dropTarget.index();
|
|
|
|
|
3970 |
api.czr_sektions.trigger( 'sek-content-dropped', {
|
3971 |
drop_target_element : $dropTarget,
|
3972 |
location : $dropTarget.closest('[data-sek-level="location"]').data('sek-id'),
|
|
|
3973 |
before_module : $dropTarget.data('drop-zone-before-module-or-nested-section'),
|
3974 |
after_module : $dropTarget.data('drop-zone-after-module-or-nested-section'),
|
|
|
|
|
3975 |
before_section : $dropTarget.data('drop-zone-before-section'),
|
3976 |
after_section : $dropTarget.data('drop-zone-after-section'),
|
3977 |
|
3979 |
content_id : evt.originalEvent.dataTransfer.getData( "sek-content-id" )
|
3980 |
});
|
3981 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3982 |
reactToDrop : function() {
|
3983 |
var self = this;
|
|
|
|
|
|
|
|
|
|
|
3984 |
var _do_ = function( params ) {
|
3985 |
if ( ! _.isObject( params ) ) {
|
3986 |
throw new Error( 'Invalid params provided' );
|
3989 |
throw new Error( 'Invalid drop_target_element' );
|
3990 |
}
|
3991 |
|
3992 |
+
var $dropTarget = params.drop_target_element,
|
3993 |
+
dropCase = 'content-in-column';
|
3994 |
+
switch( $dropTarget.data('sek-location') ) {
|
3995 |
+
case 'between-sections' :
|
3996 |
+
dropCase = 'content-in-a-section-to-create';
|
3997 |
+
break;
|
3998 |
+
case 'in-empty-location' :
|
3999 |
+
params.is_first_section = true;
|
4000 |
+
params.send_to_preview = false;
|
4001 |
+
dropCase = 'content-in-empty-location';
|
4002 |
+
break;
|
4003 |
+
case 'between-columns' :
|
4004 |
+
dropCase = 'content-in-new-column';
|
4005 |
+
break;
|
4006 |
}
|
4007 |
+
if ( 'preset_section' === params.content_type ) {
|
4008 |
+
if ( $dropTarget.hasClass( 'sek-module-drop-zone-for-first-module' ) ) {
|
4009 |
+
var $parentSektion = $dropTarget.closest('div[data-sek-level="section"]');
|
4010 |
+
var colNumber = $parentSektion.find('.sek-sektion-inner').first().children( '[data-sek-level="column"]' ).length;
|
4011 |
+
if ( colNumber > 1 ) {
|
4012 |
+
dropCase = 'preset-section-in-a-nested-section-to-create';
|
4013 |
+
params.is_nested = true;
|
4014 |
+
params.in_column = $dropTarget.closest('[data-sek-level="column"]').data('sek-id');
|
4015 |
+
params.in_sektion = $parentSektion.data('sek-id');
|
4016 |
+
} else {
|
4017 |
+
params.sektion_to_replace = $parentSektion.data('sek-id');
|
4018 |
+
params.after_section = params.sektion_to_replace;
|
4019 |
+
params.in_column = $parentSektion.closest('[data-sek-level="column"]').data('sek-id');
|
4020 |
+
dropCase = 'content-in-a-section-to-replace';
|
4021 |
+
}
|
4022 |
+
} else {
|
4023 |
+
if ( 'between-sections' === $dropTarget.data('sek-location') ) {
|
4024 |
+
dropCase = 'content-in-a-section-to-create';
|
4025 |
+
}
|
4026 |
+
}
|
4027 |
+
|
4028 |
+
|
4029 |
+
|
4030 |
}
|
4031 |
+
|
4032 |
var focusOnAddedContentEditor;
|
4033 |
switch( dropCase ) {
|
4034 |
case 'content-in-column' :
|
4035 |
+
var $closestLevelWrapper = $dropTarget.closest('div[data-sek-level]');
|
4036 |
if ( 1 > $closestLevelWrapper.length ) {
|
4037 |
throw new Error( 'No valid level dom element found' );
|
4038 |
}
|
4043 |
throw new Error( 'No valid level id found' );
|
4044 |
}
|
4045 |
|
|
|
4046 |
api.previewer.trigger( 'sek-add-module', {
|
4047 |
level : _level,
|
4048 |
id : _id,
|
4049 |
+
in_column : $dropTarget.closest('div[data-sek-level="column"]').data( 'sek-id'),
|
4050 |
+
in_sektion : $dropTarget.closest('div[data-sek-level="section"]').data( 'sek-id'),
|
4051 |
|
4052 |
before_module : params.before_module,
|
4053 |
after_module : params.after_module,
|
4057 |
});
|
4058 |
break;
|
4059 |
|
4060 |
+
case 'content-in-a-section-to-create' :
|
4061 |
api.previewer.trigger( 'sek-add-content-in-new-sektion', params );
|
4062 |
break;
|
4063 |
+
case 'content-in-a-section-to-replace' :
|
4064 |
+
api.previewer.trigger( 'sek-add-content-in-new-sektion', params );
|
4065 |
+
break;
|
4066 |
+
case 'preset-section-in-a-nested-section-to-create' :
|
4067 |
+
api.previewer.trigger( 'sek-add-preset-section-in-new-nested-sektion', params );
|
4068 |
+
break;
|
4069 |
case 'content-in-empty-location' :
|
|
|
|
|
4070 |
api.previewer.trigger( 'sek-add-content-in-new-sektion', params );
|
4071 |
break;
|
4072 |
|
4073 |
+
default :
|
4074 |
+
api.errare( 'sek control panel => ::reactToDrop => invalid drop case : ' + dropCase );
|
4075 |
break;
|
4076 |
}
|
4077 |
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4078 |
this.bind( 'sek-content-dropped', function( params ) {
|
|
|
4079 |
try { _do_( params ); } catch( er ) {
|
4080 |
api.errare( 'error when reactToDrop', er );
|
4081 |
}
|
4083 |
}//reactToDrop
|
4084 |
});//$.extend()
|
4085 |
})( wp.customize, jQuery );//global sektionsLocalizedData
|
4086 |
+
var CZRSeksPrototype = CZRSeksPrototype || {};
|
4087 |
+
(function ( api, $ ) {
|
4088 |
+
$.extend( CZRSeksPrototype, {
|
4089 |
+
/* This code is inpired from the plugin customize-posts, GPLv2 or later licensed
|
4090 |
+
Credits : xwp, westonruter, valendesigns, sayedwp, utkarshpatel.
|
4091 |
+
Date of original code modification : July 2018
|
4092 |
+
*/
|
4093 |
+
setupTinyMceEditor: function() {
|
4094 |
+
var self = this;
|
4095 |
+
api.sekEditorExpanded = new api.Value( false );
|
4096 |
+
api.sekEditorSynchronizedInput = new api.Value();
|
4097 |
|
4098 |
+
self.editorEventsListenerSetup = false;//this status will help us ensure that we bind the shared tinyMce instance only once
|
4099 |
+
var mayBeAwakeTinyMceEditor = function() {
|
4100 |
+
api.sekTinyMceEditor = api.sekTinyMceEditor || tinyMCE.get( 'czr-customize-content_editor' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4101 |
|
4102 |
+
if ( false === self.editorEventsListenerSetup ) {
|
4103 |
+
self.attachEventsToEditor();
|
4104 |
+
self.editorEventsListenerSetup = true;
|
4105 |
+
self.trigger('sek-tiny-mce-editor-bound-and-instantiated');
|
|
|
|
|
|
|
4106 |
}
|
4107 |
+
};
|
4108 |
+
self.bind( 'sek-edit-module_done', function( params ) {
|
4109 |
+
if ( 'tiny_mce_editor' != params.clicked_input_type )
|
4110 |
+
return;
|
4111 |
|
4112 |
+
var controlId = params.id;
|
4113 |
+
if ( true === self.getRegisteredModuleProperty( params.module_type, 'is_father' ) ) {
|
4114 |
+
var _childModules_ = self.getRegisteredModuleProperty( params.module_type, 'children' );
|
4115 |
+
if ( _.isEmpty( _childModules_ ) ) {
|
4116 |
+
throw new Error('::generateUIforFrontModules => a father module ' + params.module_type + ' is missing children modules ');
|
4117 |
+
} else {
|
4118 |
+
_.each( _childModules_, function( mod_type, optionType ){
|
4119 |
+
if ( 'czr_tinymce_child' === mod_type ) {
|
4120 |
+
controlId = controlId + '__' + optionType;//<= as defined when generating the ui in ::generateUIforFrontModules
|
4121 |
+
}
|
4122 |
+
});
|
4123 |
+
}
|
4124 |
+
}
|
4125 |
+
api.sekEditorSynchronizedInput({
|
4126 |
+
control_id : controlId,
|
4127 |
+
input_id : params.clicked_input_id
|
4128 |
});
|
|
|
|
|
|
|
|
|
|
|
4129 |
|
4130 |
+
api.sekEditorExpanded( true );
|
4131 |
+
api.sekTinyMceEditor.focus();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4132 |
});
|
4133 |
+
$('#customize-theme-controls').on('click', '[data-czr-action="open-tinymce-editor"]', function() {
|
4134 |
+
var control_id = $(this).data('czr-control-id'),
|
4135 |
+
input_id = $(this).data('czr-input-id');
|
4136 |
+
if ( _.isEmpty( control_id ) || _.isEmpty( input_id ) ) {
|
4137 |
+
api.errare('toggle-tinymce-editor => missing input or control id');
|
4138 |
+
return;
|
4139 |
+
}
|
4140 |
+
var currentEditorSyncData = $.extend( true, {}, api.sekEditorSynchronizedInput() ),
|
4141 |
+
newEditorSyncData = _.extend( currentEditorSyncData, {
|
4142 |
+
input_id : input_id,
|
4143 |
+
control_id : control_id
|
4144 |
+
});
|
4145 |
+
api.sekEditorSynchronizedInput( newEditorSyncData );
|
4146 |
+
api.sekEditorExpanded( true );
|
4147 |
+
api.sekTinyMceEditor.focus();
|
|
|
|
|
|
|
|
|
4148 |
});
|
4149 |
+
api.sekEditorSynchronizedInput.bind( function( to, from ) {
|
4150 |
+
mayBeAwakeTinyMceEditor();
|
4151 |
+
api( to.control_id, function( _setting_ ) {
|
4152 |
+
var _currentModuleValue_ = _setting_(),
|
4153 |
+
_currentInputContent_ = ( _.isObject( _currentModuleValue_ ) && ! _.isEmpty( _currentModuleValue_[ to.input_id ] ) ) ? _currentModuleValue_[ to.input_id ] : '';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4154 |
|
4155 |
+
try { api.sekTinyMceEditor.setContent( _currentInputContent_ ); } catch( er ) {
|
4156 |
+
api.errare( 'Error when setting the tiny mce editor content in setupTinyMceEditor', er );
|
4157 |
+
}
|
4158 |
+
api.sekTinyMceEditor.focus();
|
4159 |
+
});
|
4160 |
|
4161 |
+
});//api.sekEditorSynchronizedInput.bind( function( to, from )
|
4162 |
+
api.sekEditorExpanded.bind( function ( expanded, from, params ) {
|
4163 |
+
mayBeAwakeTinyMceEditor();
|
4164 |
+
if ( expanded ) {
|
4165 |
+
api.sekTinyMceEditor.focus();
|
4166 |
+
}
|
4167 |
+
$(document.body).toggleClass( 'czr-customize-content_editor-pane-open', expanded);
|
4168 |
|
4169 |
+
/*
|
4170 |
+
* Ensure only the latest input is bound
|
4171 |
+
*/
|
4172 |
|
4173 |
+
$( window )[ expanded ? 'on' : 'off' ]('resize', function() {
|
4174 |
+
if ( ! api.sekEditorExpanded() )
|
4175 |
+
return;
|
4176 |
+
_.delay( function() {
|
4177 |
+
self.czrResizeEditor( window.innerHeight - self.$editorPane.height() );
|
4178 |
+
}, 50 );
|
4179 |
|
4180 |
+
});
|
4181 |
|
4182 |
+
if ( expanded ) {
|
4183 |
+
self.czrResizeEditor( window.innerHeight - self.$editorPane.height() );
|
4184 |
+
} else {
|
4185 |
+
self.$preview.css( 'bottom', '' );
|
4186 |
+
self.$collapseSidebar.css( 'bottom', '' );
|
4187 |
+
}
|
4188 |
+
});
|
4189 |
+
$('#czr-customize-content_editor-pane' ).on('click', '[data-czr-action="close-tinymce-editor"]', function() {
|
4190 |
+
api.sekEditorExpanded( false );
|
4191 |
+
});
|
4192 |
+
$('#customize-controls' ).on('click', function( evt ) {
|
4193 |
+
if ( 'open-tinymce-editor' == $( evt.target ).data( 'czr-action') )
|
4194 |
+
return;
|
4195 |
+
api.sekEditorExpanded( false, { context : "clicked anywhere"} );
|
4196 |
+
});
|
4197 |
+
$(document).on( 'keydown', _.throttle( function( evt ) {
|
4198 |
+
if ( 27 === evt.keyCode ) {
|
4199 |
+
api.sekEditorExpanded( false );
|
4200 |
+
}
|
4201 |
+
}, 50 ));
|
4202 |
|
4203 |
+
self.bind('sek-tiny-mce-editor-bound-and-instantiated', function() {
|
4204 |
+
var iframeDoc = $( api.sekTinyMceEditor.iframeElement ).contents().get(0);
|
4205 |
+
$( iframeDoc ).on('keydown', _.throttle( function( evt ) {
|
4206 |
+
if ( 27 === evt.keyCode ) {
|
4207 |
+
api.sekEditorExpanded( false );
|
4208 |
+
}
|
4209 |
+
}, 50 ));
|
4210 |
+
});
|
4211 |
|
4212 |
+
_.each( [
|
4213 |
+
'sek-click-on-inactive-zone',
|
4214 |
+
'sek-add-section',
|
4215 |
+
'sek-add-column',
|
4216 |
+
'sek-add-module',
|
4217 |
+
'sek-remove',
|
4218 |
+
'sek-move',
|
4219 |
+
'sek-duplicate',
|
4220 |
+
'sek-resize-columns',
|
4221 |
+
'sek-add-content-in-new-sektion',
|
4222 |
+
'sek-pick-content',
|
4223 |
+
'sek-edit-options',
|
4224 |
+
'sek-edit-module',
|
4225 |
+
'sek-notify'
|
4226 |
+
], function( _evt_ ) {
|
4227 |
+
if ( 'sek-edit-module' != _evt_ ) {
|
4228 |
+
api.previewer.bind( _evt_, function() { api.sekEditorExpanded( false ); } );
|
4229 |
+
} else {
|
4230 |
+
api.previewer.bind( _evt_, function( params ) {
|
4231 |
+
api.sekEditorExpanded( params.module_type === 'czr_tiny_mce_editor_module' );
|
4232 |
+
});
|
4233 |
+
}
|
4234 |
+
});
|
4235 |
+
},//setupTinyMceEditor
|
4236 |
|
4237 |
|
4238 |
|
4239 |
|
4240 |
+
attachEventsToEditor : function() {
|
4241 |
+
var self = this;
|
4242 |
+
self.$editorTextArea = $( '#czr-customize-content_editor' );
|
4243 |
+
self.$editorPane = $( '#czr-customize-content_editor-pane' );
|
4244 |
+
self.$editorDragbar = $( '#czr-customize-content_editor-dragbar' );
|
4245 |
+
self.$editorFrame = $( '#czr-customize-content_editor_ifr' );
|
4246 |
+
self.$mceTools = $( '#wp-czr-customize-content_editor-tools' );
|
4247 |
+
self.$mceToolbar = self.$editorPane.find( '.mce-toolbar-grp' );
|
4248 |
+
self.$mceStatusbar = self.$editorPane.find( '.mce-statusbar' );
|
4249 |
|
4250 |
+
self.$preview = $( '#customize-preview' );
|
4251 |
+
self.$collapseSidebar = $( '.collapse-sidebar' );
|
4252 |
+
api.sekTinyMceEditor.on( 'input change keyup', function( evt ) {
|
4253 |
+
if ( api.control.has( api.sekEditorSynchronizedInput().control_id ) ) {
|
4254 |
+
try { api.control( api.sekEditorSynchronizedInput().control_id )
|
4255 |
+
.trigger( 'tinyMceEditorUpdated', {
|
4256 |
+
input_id : api.sekEditorSynchronizedInput().input_id,
|
4257 |
+
html_content : api.sekTinyMceEditor.getContent(),
|
4258 |
+
modified_editor_element : api.sekTinyMceEditor
|
4259 |
+
});
|
4260 |
+
} catch( er ) {
|
4261 |
+
api.errare( 'Error when triggering tinyMceEditorUpdated', er );
|
4262 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4263 |
}
|
4264 |
+
});
|
4265 |
+
self.$editorTextArea.on( 'input', function( evt ) {
|
4266 |
+
try { api.control( api.sekEditorSynchronizedInput().control_id )
|
4267 |
+
.trigger( 'tinyMceEditorUpdated', {
|
4268 |
+
input_id : api.sekEditorSynchronizedInput().input_id,
|
4269 |
+
html_content : self.$editorTextArea.val(),
|
4270 |
+
modified_editor_element : self.$editorTextArea
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4271 |
});
|
4272 |
+
} catch( er ) {
|
4273 |
+
api.errare( 'Error when triggering tinyMceEditorUpdated', er );
|
4274 |
}
|
4275 |
+
});
|
4276 |
+
$('#czr-customize-content_editor-pane').on( 'mousedown mouseup', function( evt ) {
|
4277 |
+
if ( 'mousedown' === evt.type && 'czr-customize-content_editor-dragbar' !== $(evt.target).attr('id') && ! $(evt.target).hasClass('czr-resize-handle') )
|
4278 |
+
return;
|
4279 |
+
if ( ! api.sekEditorExpanded() )
|
4280 |
+
return;
|
4281 |
+
switch( evt.type ) {
|
4282 |
+
case 'mousedown' :
|
4283 |
+
$( document ).on( 'mousemove.czr-customize-content_editor', function( event ) {
|
4284 |
+
event.preventDefault();
|
4285 |
+
$( document.body ).addClass( 'czr-customize-content_editor-pane-resize' );
|
4286 |
+
self.$editorFrame.css( 'pointer-events', 'none' );
|
4287 |
+
self.czrResizeEditor( event.pageY );
|
4288 |
+
});
|
4289 |
+
break;
|
4290 |
+
|
4291 |
+
case 'mouseup' :
|
4292 |
+
$( document ).off( 'mousemove.czr-customize-content_editor' );
|
4293 |
+
$( document.body ).removeClass( 'czr-customize-content_editor-pane-resize' );
|
4294 |
+
self.$editorFrame.css( 'pointer-events', '' );
|
4295 |
+
break;
|
4296 |
}
|
4297 |
+
});
|
4298 |
+
},
|
4299 |
|
|
|
4300 |
|
|
|
4301 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4302 |
|
|
|
|
|
|
|
|
|
|
|
4303 |
|
4304 |
+
czrResizeEditor : function( position ) {
|
4305 |
+
var self = this,
|
4306 |
+
windowHeight = window.innerHeight,
|
4307 |
+
windowWidth = window.innerWidth,
|
4308 |
+
minScroll = 40,
|
4309 |
+
maxScroll = 1,
|
4310 |
+
mobileWidth = 782,
|
4311 |
+
collapseMinSpacing = 56,
|
4312 |
+
collapseBottomOutsideEditor = 8,
|
4313 |
+
collapseBottomInsideEditor = 4,
|
4314 |
+
args = {},
|
4315 |
+
resizeHeight;
|
4316 |
|
4317 |
+
if ( ! api.sekEditorExpanded() ) {
|
4318 |
+
return;
|
4319 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4320 |
|
4321 |
+
if ( ! _.isNaN( position ) ) {
|
4322 |
+
resizeHeight = windowHeight - position;
|
4323 |
+
}
|
4324 |
|
4325 |
+
args.height = resizeHeight;
|
4326 |
+
args.components = self.$mceTools.outerHeight() + self.$mceToolbar.outerHeight() + self.$mceStatusbar.outerHeight();
|
|
|
|
|
|
|
|
|
|
|
|
|
4327 |
|
4328 |
+
if ( resizeHeight < minScroll ) {
|
4329 |
+
args.height = minScroll;
|
4330 |
+
}
|
|
|
|
|
|
|
4331 |
|
4332 |
+
if ( resizeHeight > windowHeight - maxScroll ) {
|
4333 |
+
args.height = windowHeight - maxScroll;
|
4334 |
+
}
|
4335 |
|
4336 |
+
if ( windowHeight < self.$editorPane.outerHeight() ) {
|
4337 |
+
args.height = windowHeight;
|
4338 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4339 |
|
4340 |
+
self.$preview.css( 'bottom', args.height );
|
4341 |
+
self.$editorPane.css( 'height', args.height );
|
4342 |
+
self.$editorFrame.css( 'height', args.height - args.components );
|
4343 |
+
self.$collapseSidebar.css(
|
4344 |
+
'bottom',
|
4345 |
+
collapseMinSpacing > windowHeight - args.height ? self.$mceStatusbar.outerHeight() + collapseBottomInsideEditor : args.height + collapseBottomOutsideEditor
|
4346 |
+
);
|
4347 |
+
}
|
4348 |
+
});//$.extend()
|
4349 |
+
})( wp.customize, jQuery );//global sektionsLocalizedData
|
4350 |
+
var CZRSeksPrototype = CZRSeksPrototype || {};
|
4351 |
+
(function ( api, $ ) {
|
4352 |
+
$.extend( CZRSeksPrototype, api.Events );
|
4353 |
+
var CZR_SeksConstructor = api.Class.extend( CZRSeksPrototype );
|
4354 |
+
try { api.czr_sektions = new CZR_SeksConstructor(); } catch( er ) {
|
4355 |
+
api.errare( 'api.czr_sektions => problem on instantiation', er );
|
4356 |
+
}
|
4357 |
+
})( wp.customize, jQuery );//global sektionsLocalizedData
|
4358 |
+
( function ( api, $, _ ) {
|
4359 |
+
api.czrInputMap = api.czrInputMap || {};
|
4360 |
+
var validateUnit = function( unit ) {
|
4361 |
+
if ( ! _.contains( ['px', 'em', '%'], unit ) ) {
|
4362 |
+
api.errare( 'error : invalid unit for input ' + this.id, unit );
|
4363 |
+
unit = 'px';
|
4364 |
+
}
|
4365 |
+
return unit;
|
4366 |
+
},
|
4367 |
+
stripUnit = function( value ) {
|
4368 |
+
return _.isString( value ) ? value.replace(/px|em|%/g,'') : '';
|
4369 |
+
},
|
4370 |
+
unitButtonsSetup = function( $wrapper ) {
|
4371 |
+
var input = this;
|
4372 |
+
$wrapper.on( 'click', '.sek-ui-button', function( evt, params ) {
|
4373 |
+
evt.preventDefault();
|
4374 |
+
$wrapper.find('.sek-ui-button').removeClass('is-selected').attr( 'aria-pressed', false );
|
4375 |
+
$(this).addClass('is-selected').attr( 'aria-pressed', true );
|
4376 |
+
input.css_unit( $(this).data('sek-unit'), params );
|
4377 |
+
});
|
4378 |
+
$wrapper.find( '.sek-ui-button[data-sek-unit="'+ ( input.initial_unit || 'px' ) +'"]').addClass('is-selected').attr( 'aria-pressed', true );
|
4379 |
+
},
|
4380 |
+
setupResetAction = function( $wrapper, defaultVal ) {
|
4381 |
+
var input = this;
|
4382 |
+
$wrapper.on( 'click', '.reset-spacing-wrap', function(evt) {
|
4383 |
+
evt.preventDefault();
|
4384 |
+
$wrapper.find('input[type="number"]').each( function() {
|
4385 |
+
$(this).val('');
|
4386 |
+
});
|
4387 |
|
4388 |
+
input( defaultVal );
|
4389 |
+
$('.sek-unit-wrapper', $wrapper ).find('[data-sek-unit="px"]').trigger('click');
|
4390 |
+
});
|
4391 |
+
};
|
4392 |
|
|
|
4393 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4394 |
|
4395 |
+
/* ------------------------------------------------------------------------- *
|
4396 |
+
* SPACING CLASSIC
|
4397 |
+
/* ------------------------------------------------------------------------- */
|
4398 |
+
$.extend( api.czrInputMap, {
|
4399 |
+
spacing : function( input_options ) {
|
4400 |
+
var input = this,
|
4401 |
+
$wrapper = $('.sek-spacing-wrapper', input.container ),
|
4402 |
+
inputRegistrationParams = api.czr_sektions.getInputRegistrationParams( input.id, input.module.module_type ),
|
4403 |
+
defaultVal = ( ! _.isEmpty( inputRegistrationParams ) && ! _.isEmpty( inputRegistrationParams.default ) ) ? inputRegistrationParams.default : [];
|
4404 |
+
$wrapper.on( 'input', 'input[type="number"]', function(evt) {
|
4405 |
+
var _type_ = $(this).closest('[data-sek-spacing]').data('sek-spacing'),
|
4406 |
+
_newInputVal = $.extend( true, {}, _.isObject( input() ) ? input() : {} ),
|
4407 |
+
_rawVal = $(this).val();
|
4408 |
+
if ( ( _.isString( _rawVal ) && ! _.isEmpty( _rawVal ) ) || _.isNumber( _rawVal ) ) {
|
4409 |
+
_newInputVal[ _type_ ] = _rawVal;
|
4410 |
+
} else {
|
4411 |
+
_newInputVal = _.omit( _newInputVal, _type_ );
|
4412 |
+
}
|
4413 |
+
input( _newInputVal );
|
4414 |
+
});
|
4415 |
+
setupResetAction.call( input, $wrapper, defaultVal );
|
4416 |
+
if ( _.isObject( input() ) ) {
|
4417 |
+
_.each( input(), function( _val_, _key_ ) {
|
4418 |
+
$( '[data-sek-spacing="' + _key_ +'"]', $wrapper ).find( 'input[type="number"]' ).val( _val_ );
|
4419 |
+
});
|
4420 |
+
var unitToActivate = 'px';
|
4421 |
+
$('.sek-unit-wrapper .sek-ui-button', input.container ).each( function() {
|
4422 |
+
var unit = $(this).data('sek-unit');
|
4423 |
+
if ( ! _.isEmpty( input() ) ) {
|
4424 |
+
if ( ! _.isEmpty( input()[ 'unit' ] ) ) {
|
4425 |
+
if ( unit === input()[ 'unit' ] ) {
|
4426 |
+
unitToActivate = unit;
|
4427 |
+
}
|
4428 |
+
}
|
4429 |
+
}
|
4430 |
+
});
|
4431 |
+
$('.sek-unit-wrapper', input.container ).find('[data-sek-unit="' + validateUnit.call( input, unitToActivate ) + '"]').trigger('click');
|
4432 |
+
}
|
4433 |
+
var initial_value = input();
|
4434 |
+
input.initial_unit = 'px';
|
4435 |
+
if ( ! _.isEmpty( initial_value ) ) {
|
4436 |
+
input.initial_unit = _.isEmpty( initial_value['unit'] ) ? 'px' : initial_value['unit'];
|
4437 |
+
}
|
4438 |
+
input.css_unit = new api.Value( validateUnit.call( input, input.initial_unit ) );
|
4439 |
+
input.css_unit.bind( function( to ) {
|
4440 |
+
to = _.isEmpty( to ) ? 'px' : to;
|
4441 |
+
var _newInputVal;
|
4442 |
|
4443 |
+
_newInputVal = $.extend( true, {}, _.isObject( input() ) ? input() : {} );
|
4444 |
+
_newInputVal[ 'unit' ] = to;
|
4445 |
+
input( _newInputVal );
|
4446 |
+
});
|
4447 |
+
unitButtonsSetup.call( input, $wrapper );
|
4448 |
+
}
|
4449 |
+
});//$.extend( api.czrInputMap, {})
|
4450 |
|
|
|
4451 |
|
|
|
|
|
|
|
4452 |
|
4453 |
|
|
|
|
|
|
|
|
|
|
|
|
|
4454 |
|
|
|
|
|
|
|
|
|
|
|
|
|
4455 |
|
|
|
|
|
|
|
|
|
4456 |
|
4457 |
|
4458 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4459 |
|
|
|
|
|
|
|
4460 |
|
4461 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4462 |
|
|
|
4463 |
|
|
|
|
|
|
|
4464 |
|
4465 |
+
/* ------------------------------------------------------------------------- *
|
4466 |
+
* SPACING WITH DEVICE SWITCHER
|
4467 |
+
/* ------------------------------------------------------------------------- */
|
4468 |
+
$.extend( api.czrInputMap, {
|
4469 |
+
spacingWithDeviceSwitcher : function( input_options ) {
|
4470 |
+
var input = this,
|
4471 |
+
$wrapper = $('.sek-spacing-wrapper', input.container ),
|
4472 |
+
inputRegistrationParams = api.czr_sektions.getInputRegistrationParams( input.id, input.module.module_type ),
|
4473 |
+
defaultVal = ( ! _.isEmpty( inputRegistrationParams ) && ! _.isEmpty( inputRegistrationParams.default ) ) ? inputRegistrationParams.default : {};
|
4474 |
+
var getCurrentDeviceActualOrInheritedValue = function( inputValues, currentDevice ) {
|
4475 |
+
var deviceHierarchy = [ 'mobile' , 'tablet', 'desktop' ];
|
4476 |
+
if ( _.has( inputValues, currentDevice ) ) {
|
4477 |
+
return inputValues[ currentDevice ];
|
4478 |
+
} else {
|
4479 |
+
var deviceIndex = _.findIndex( deviceHierarchy, function( _d_ ) { return currentDevice === _d_; });
|
4480 |
+
if ( ! _.isEmpty( currentDevice ) && deviceIndex < deviceHierarchy.length ) {
|
4481 |
+
return getCurrentDeviceActualOrInheritedValue( inputValues, deviceHierarchy[ deviceIndex + 1 ] );
|
4482 |
+
} else {
|
4483 |
+
return {};
|
4484 |
+
}
|
4485 |
}
|
4486 |
};
|
4487 |
+
var syncWithPreviewedDevice = function( currentDevice ) {
|
4488 |
+
var inputValues = $.extend( true, {}, _.isObject( input() ) ? input() : {} ),
|
4489 |
+
clonedDefault = $.extend( true, {}, defaultVal );
|
4490 |
+
inputValues = _.isObject( inputValues ) ? $.extend( clonedDefault, inputValues ) : clonedDefault;
|
4491 |
+
var _currentDeviceValues = getCurrentDeviceActualOrInheritedValue( inputValues, currentDevice );
|
4492 |
+
$( '[data-sek-spacing]', $wrapper ).each( function() {
|
4493 |
+
var spacingType = $(this).data('sek-spacing'),
|
4494 |
+
_val_ = '';
|
4495 |
+
if ( ! _.isEmpty( _currentDeviceValues ) ) {
|
4496 |
+
if ( ! _.isEmpty( _currentDeviceValues[ spacingType ] ) ) {
|
4497 |
+
_val_ = _currentDeviceValues[ spacingType ];
|
4498 |
+
}
|
4499 |
+
}
|
4500 |
+
$(this).find( 'input[type="number"]' ).val( _val_ );
|
4501 |
+
});
|
4502 |
+
var unitToActivate = 'px';
|
4503 |
+
$( '.sek-unit-wrapper .sek-ui-button', input.container).each( function() {
|
4504 |
+
var unit = $(this).data('sek-unit');
|
4505 |
+
if ( ! _.isEmpty( _currentDeviceValues ) ) {
|
4506 |
+
if ( ! _.isEmpty( _currentDeviceValues[ 'unit' ] ) ) {
|
4507 |
+
if ( unit === _currentDeviceValues[ 'unit' ] ) {
|
4508 |
+
unitToActivate = unit;
|
4509 |
+
}
|
4510 |
+
}
|
4511 |
+
}
|
4512 |
});
|
4513 |
+
$('.sek-unit-wrapper', input.container ).find('[data-sek-unit="' + validateUnit.call( input, unitToActivate ) + '"]').trigger('click', { previewed_device_switched : true });// We don't want to update the input();
|
4514 |
+
};
|
4515 |
+
api.czr_sektions.maybeSetupDeviceSwitcherForInput.call( input );
|
4516 |
+
var initial_value = input();
|
4517 |
+
input.initial_unit = 'px';
|
4518 |
+
if ( ! _.isEmpty( initial_value ) && ! _.isEmpty( initial_value[ input.previewedDevice() ] ) ) {
|
4519 |
+
input.initial_unit = _.isEmpty( initial_value[ input.previewedDevice() ]['unit'] ) ? 'px' : initial_value[ input.previewedDevice() ]['unit'];
|
4520 |
+
}
|
4521 |
+
input.css_unit = new api.Value( validateUnit.call( input, input.initial_unit ) );
|
4522 |
+
$wrapper.on( 'input', 'input[type="number"]', function(evt) {
|
4523 |
+
var changedSpacingType = $(this).closest('[data-sek-spacing]').data('sek-spacing'),
|
4524 |
+
changedNumberInputVal = $(this).val(),
|
4525 |
+
_newInputVal,
|
4526 |
+
previewedDevice = api.previewedDevice() || 'desktop';
|
4527 |
+
|
4528 |
+
_newInputVal = $.extend( true, {}, _.isObject( input() ) ? input() : {} );
|
4529 |
+
_newInputVal[ previewedDevice ] = $.extend( true, {}, _newInputVal[ previewedDevice ] || {} );
|
4530 |
+
if ( ( _.isString( changedNumberInputVal ) && ! _.isEmpty( changedNumberInputVal ) ) || _.isNumber( changedNumberInputVal ) ) {
|
4531 |
+
_newInputVal[ previewedDevice ][ changedSpacingType ] = changedNumberInputVal;
|
4532 |
+
} else {
|
4533 |
+
_newInputVal[ previewedDevice ] = _.omit( _newInputVal[ previewedDevice ], changedSpacingType );
|
4534 |
+
}
|
4535 |
|
4536 |
+
input( _newInputVal );
|
|
|
4537 |
});
|
4538 |
+
setupResetAction.call( input, $wrapper, defaultVal );
|
4539 |
+
input.previewedDevice.bind( function( currentDevice ) {
|
4540 |
+
try { syncWithPreviewedDevice( currentDevice ); } catch( er ) {
|
4541 |
+
api.errare('Error when firing syncWithPreviewedDevice for input type spacingWithDeviceSwitcher for input id ' + input.id , er );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4542 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4543 |
});
|
4544 |
+
input.css_unit.bind( function( to, from, params ) {
|
4545 |
+
if ( _.isObject( params ) && true === params.previewed_device_switched )
|
4546 |
+
return;
|
4547 |
+
to = _.isEmpty( to ) ? 'px' : to;
|
4548 |
+
var _newInputVal,
|
4549 |
+
previewedDevice = input.previewedDevice() || 'desktop';
|
4550 |
|
4551 |
+
_newInputVal = $.extend( true, {}, _.isObject( input() ) ? input() : {} );
|
4552 |
+
_newInputVal[ previewedDevice ] = $.extend( true, {}, _newInputVal[ previewedDevice ] || {} );
|
4553 |
+
_newInputVal[ previewedDevice ][ 'unit' ] = to;
|
4554 |
+
input( _newInputVal );
|
4555 |
+
});
|
4556 |
+
unitButtonsSetup.call( input, $wrapper );
|
4557 |
+
try { syncWithPreviewedDevice( api.previewedDevice() ); } catch( er ) {
|
4558 |
+
api.errare('Error when firing syncWithPreviewedDevice for input type spacingWithDeviceSwitcher for input id ' + input.id , er );
|
4559 |
+
}
|
4560 |
+
}
|
4561 |
+
});//$.extend( api.czrInputMap, {})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4562 |
|
4563 |
|
4564 |
+
})( wp.customize, jQuery, _ );//global sektionsLocalizedData
|
4565 |
+
( function ( api, $, _ ) {
|
4566 |
+
api.czrInputMap = api.czrInputMap || {};
|
4567 |
+
$.extend( api.czrInputMap, {
|
4568 |
+
/* ------------------------------------------------------------------------- *
|
4569 |
+
* BG POSITION SIMPLE
|
4570 |
+
/* ------------------------------------------------------------------------- */
|
4571 |
+
bg_position : function( input_options ) {
|
4572 |
+
var input = this;
|
4573 |
+
$('.sek-bg-pos-wrapper', input.container ).on( 'change', 'input[type="radio"]', function(evt) {
|
4574 |
+
input( $(this).val() );
|
4575 |
+
});
|
4576 |
+
if ( ! _.isEmpty( input() ) ) {
|
4577 |
+
input.container.find('input[value="'+ input() +'"]').attr('checked', true).trigger('click');
|
4578 |
+
}
|
4579 |
+
},
|
4580 |
|
4581 |
|
4582 |
+
/* ------------------------------------------------------------------------- *
|
4583 |
+
* BG POSITION WITH DEVICE SWITCHER
|
4584 |
+
/* ------------------------------------------------------------------------- */
|
4585 |
+
bgPositionWithDeviceSwitcher : function( input_options ) {
|
4586 |
+
var input = this,
|
4587 |
+
inputRegistrationParams = api.czr_sektions.getInputRegistrationParams( input.id, input.module.module_type ),
|
4588 |
+
defaultVal = ( ! _.isEmpty( inputRegistrationParams ) && ! _.isEmpty( inputRegistrationParams.default ) ) ? inputRegistrationParams.default : {};
|
4589 |
+
api.czr_sektions.maybeSetupDeviceSwitcherForInput.call( input );
|
4590 |
+
|
4591 |
+
var getCurrentDeviceActualOrInheritedValue = function( inputValues, currentDevice ) {
|
4592 |
+
var deviceHierarchy = [ 'mobile' , 'tablet', 'desktop' ];
|
4593 |
+
if ( _.has( inputValues, currentDevice ) ) {
|
4594 |
+
return inputValues[ currentDevice ];
|
4595 |
+
} else {
|
4596 |
+
var deviceIndex = _.findIndex( deviceHierarchy, function( _d_ ) { return currentDevice === _d_; });
|
4597 |
+
if ( ! _.isEmpty( currentDevice ) && deviceIndex < deviceHierarchy.length ) {
|
4598 |
+
return getCurrentDeviceActualOrInheritedValue( inputValues, deviceHierarchy[ deviceIndex + 1 ] );
|
4599 |
+
} else {
|
4600 |
+
return {};
|
4601 |
+
}
|
4602 |
+
}
|
4603 |
+
};
|
4604 |
+
var syncWithPreviewedDevice = function( currentDevice ) {
|
4605 |
+
var inputValues = $.extend( true, {}, _.isObject( input() ) ? input() : {} ),
|
4606 |
+
clonedDefault = $.extend( true, {}, defaultVal );
|
4607 |
+
inputValues = _.isObject( inputValues ) ? $.extend( clonedDefault, inputValues ) : clonedDefault;
|
4608 |
+
var _currentDeviceValue = getCurrentDeviceActualOrInheritedValue( inputValues, currentDevice );
|
4609 |
|
4610 |
+
input.container.find('input[value="'+ _currentDeviceValue +'"]').attr('checked', true).trigger('click', { previewed_device_switched : true } );
|
4611 |
+
};
|
4612 |
+
$('.sek-bg-pos-wrapper', input.container ).on( 'change', 'input[type="radio"]', function( evt ) {
|
4613 |
+
var changedRadioVal = $(this).val(),
|
4614 |
+
_newInputVal;
|
4615 |
|
4616 |
+
_newInputVal = $.extend( true, {}, _.isObject( input() ) ? input() : {} );
|
4617 |
+
_newInputVal[ api.previewedDevice() || 'desktop' ] = changedRadioVal;
|
4618 |
|
4619 |
+
input( _newInputVal );
|
4620 |
+
});
|
4621 |
+
input.previewedDevice.bind( function( currentDevice ) {
|
4622 |
+
try { syncWithPreviewedDevice( currentDevice ); } catch( er ) {
|
4623 |
+
api.errare('Error when firing syncWithPreviewedDevice for input type spacingWithDeviceSwitcher for input id ' + input.id , er );
|
|
|
4624 |
}
|
4625 |
+
});
|
4626 |
+
try { syncWithPreviewedDevice( api.previewedDevice() ); } catch( er ) {
|
4627 |
+
api.errare('Error when firing syncWithPreviewedDevice for input type bgPositionWithDeviceSwitcher for input id ' + input.id , er );
|
4628 |
+
}
|
4629 |
+
}
|
4630 |
+
});//$.extend( api.czrInputMap, {})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4631 |
|
|
|
4632 |
|
4633 |
+
})( wp.customize, jQuery, _ );//global sektionsLocalizedData
|
4634 |
+
( function ( api, $, _ ) {
|
4635 |
+
api.czrInputMap = api.czrInputMap || {};
|
4636 |
+
var x_or_y_AlignWithDeviceSwitcher = function( params ) {
|
4637 |
+
var input = this,
|
4638 |
+
inputRegistrationParams = api.czr_sektions.getInputRegistrationParams( input.id, input.module.module_type ),
|
4639 |
+
defaultVal = ( ! _.isEmpty( inputRegistrationParams ) && ! _.isEmpty( inputRegistrationParams.default ) ) ? inputRegistrationParams.default : {},
|
4640 |
+
tmplSelector = 'verticalAlignWithDeviceSwitcher' === input.type ? '.sek-v-align-wrapper' : '.sek-h-align-wrapper',// <= because used by 2 different input tmpl
|
4641 |
+
$wrapper = $( tmplSelector, input.container );
|
4642 |
+
api.czr_sektions.maybeSetupDeviceSwitcherForInput.call( input );
|
4643 |
+
|
4644 |
+
var getCurrentDeviceActualOrInheritedValue = function( inputValues, currentDevice ) {
|
4645 |
+
var deviceHierarchy = [ 'mobile' , 'tablet', 'desktop' ];
|
4646 |
+
if ( _.has( inputValues, currentDevice ) ) {
|
4647 |
+
return inputValues[ currentDevice ];
|
4648 |
+
} else {
|
4649 |
+
var deviceIndex = _.findIndex( deviceHierarchy, function( _d_ ) { return currentDevice === _d_; });
|
4650 |
+
if ( ! _.isEmpty( currentDevice ) && deviceIndex < deviceHierarchy.length ) {
|
4651 |
+
return getCurrentDeviceActualOrInheritedValue( inputValues, deviceHierarchy[ deviceIndex + 1 ] );
|
4652 |
} else {
|
4653 |
+
return {};
|
|
|
|
|
|
|
4654 |
}
|
4655 |
+
}
|
4656 |
+
};
|
4657 |
+
var syncWithPreviewedDevice = function( currentDevice ) {
|
4658 |
+
var inputValues = $.extend( true, {}, _.isObject( input() ) ? input() : {} ),
|
4659 |
+
clonedDefault = $.extend( true, {}, defaultVal );
|
4660 |
+
inputValues = _.isObject( inputValues ) ? $.extend( clonedDefault, inputValues ) : clonedDefault;
|
4661 |
+
var _currentDeviceValue = getCurrentDeviceActualOrInheritedValue( inputValues, currentDevice );
|
4662 |
+
$wrapper.find('.selected').removeClass('selected');
|
4663 |
+
$wrapper.find( 'div[data-sek-align="' + _currentDeviceValue +'"]' ).addClass('selected');
|
4664 |
+
};
|
4665 |
+
$wrapper.on( 'click', '[data-sek-align]', function(evt) {
|
4666 |
+
evt.preventDefault();
|
4667 |
+
var _newInputVal;
|
4668 |
+
|
4669 |
+
_newInputVal = $.extend( true, {}, _.isObject( input() ) ? input() : {} );
|
4670 |
+
_newInputVal[ api.previewedDevice() || 'desktop' ] = $(this).data('sek-align');
|
4671 |
+
|
4672 |
+
$wrapper.find('.selected').removeClass('selected');
|
4673 |
+
$.when( $(this).addClass('selected') ).done( function() {
|
4674 |
+
input( _newInputVal );
|
4675 |
});
|
4676 |
+
});
|
4677 |
+
input.previewedDevice.bind( function( currentDevice ) {
|
4678 |
+
try { syncWithPreviewedDevice( currentDevice ); } catch( er ) {
|
4679 |
+
api.errare('Error when firing syncWithPreviewedDevice for input type : ' + input.type + ' for input id ' + input.id , er );
|
4680 |
+
}
|
4681 |
+
});
|
4682 |
+
try { syncWithPreviewedDevice( api.previewedDevice() ); } catch( er ) {
|
4683 |
+
api.errare('Error when firing syncWithPreviewedDevice for input type : ' + input.type + ' for input id ' + input.id , er );
|
4684 |
+
}
|
4685 |
+
};
|
4686 |
+
$.extend( api.czrInputMap, {
|
4687 |
+
horizTextAlignmentWithDeviceSwitcher : x_or_y_AlignWithDeviceSwitcher,
|
4688 |
+
horizAlignmentWithDeviceSwitcher : x_or_y_AlignWithDeviceSwitcher,
|
4689 |
+
verticalAlignWithDeviceSwitcher : x_or_y_AlignWithDeviceSwitcher
|
4690 |
+
});//$.extend( api.czrInputMap, {})
|
4691 |
+
})( wp.customize, jQuery, _ );//global sektionsLocalizedData
|
4692 |
+
( function ( api, $, _ ) {
|
4693 |
+
api.czrInputMap = api.czrInputMap || {};
|
4694 |
+
$.extend( api.czrInputMap, {
|
4695 |
+
font_size : function( params ) {
|
4696 |
+
api.czr_sektions.setupFontSizeAndLineHeightInputs.call(this);
|
4697 |
+
},
|
4698 |
|
4699 |
+
});//$.extend( api.czrInputMap, {})
|
4700 |
|
4701 |
|
4702 |
+
})( wp.customize, jQuery, _ );//global sektionsLocalizedData
|
4703 |
+
( function ( api, $, _ ) {
|
4704 |
+
api.czrInputMap = api.czrInputMap || {};
|
4705 |
+
$.extend( api.czrInputMap, {
|
4706 |
+
line_height : function( params ) {
|
4707 |
+
api.czr_sektions.setupFontSizeAndLineHeightInputs.call(this);
|
4708 |
+
}
|
4709 |
+
});//$.extend( api.czrInputMap, {})
|
4710 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4711 |
|
4712 |
+
})( wp.customize, jQuery, _ );//global sektionsLocalizedData
|
4713 |
+
( function ( api, $, _ ) {
|
4714 |
+
api.czrInputMap = api.czrInputMap || {};
|
4715 |
+
$.extend( api.czrInputMap, {
|
4716 |
+
font_picker : function( input_options ) {
|
4717 |
+
var input = this,
|
4718 |
+
item = input.input_parent;
|
|
|
4719 |
|
4720 |
+
var _getFontCollections = function() {
|
4721 |
+
var dfd = $.Deferred();
|
4722 |
+
if ( ! _.isEmpty( api.sek_fontCollections ) ) {
|
4723 |
+
dfd.resolve( api.sek_fontCollections );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4724 |
} else {
|
4725 |
+
var _ajaxRequest_;
|
4726 |
+
if ( ! _.isUndefined( api.sek_fetchingFontCollection ) && 'pending' == api.sek_fetchingFontCollection.state() ) {
|
4727 |
+
_ajaxRequest_ = api.sek_fetchingFontCollection;
|
4728 |
+
} else {
|
4729 |
+
_ajaxRequest_ = api.CZR_Helpers.getModuleTmpl( {
|
4730 |
+
tmpl : 'font_list',
|
4731 |
+
module_type: 'font_picker_input',
|
4732 |
+
module_id : input.module.id
|
4733 |
+
} );
|
4734 |
+
api.sek_fetchingFontCollection = _ajaxRequest_;
|
4735 |
+
}
|
4736 |
+
_ajaxRequest_.done( function( _serverTmpl_ ) {
|
4737 |
+
if ( typeof _serverTmpl_ !== 'string' || _serverTmpl_[0] !== '{' ) {
|
4738 |
+
throw new Error( 'font_picker => server list is not JSON.parse-able');
|
4739 |
+
}
|
4740 |
+
api.sek_fontCollections = JSON.parse( _serverTmpl_ );
|
4741 |
+
dfd.resolve( api.sek_fontCollections );
|
4742 |
+
}).fail( function( _r_ ) {
|
4743 |
+
dfd.reject( _r_ );
|
4744 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
4745 |
|
4746 |
+
}
|
4747 |
+
return dfd.promise();
|
4748 |
+
};
|
4749 |
+
var _preprocessSelect2ForFontFamily = function() {
|
4750 |
+
/*
|
4751 |
+
* Override select2 Results Adapter in order to select on highlight
|
4752 |
+
* deferred needed cause the selects needs to be instantiated when this override is complete
|
4753 |
+
* selec2.amd.require is asynchronous
|
4754 |
+
*/
|
4755 |
+
var selectFocusResults = $.Deferred();
|
4756 |
+
if ( 'undefined' !== typeof $.fn.select2 && 'undefined' !== typeof $.fn.select2.amd && 'function' === typeof $.fn.select2.amd.require ) {
|
4757 |
+
$.fn.select2.amd.require(['select2/results', 'select2/utils'], function (Result, Utils) {
|
4758 |
+
var ResultsAdapter = function($element, options, dataAdapter) {
|
4759 |
+
ResultsAdapter.__super__.constructor.call(this, $element, options, dataAdapter);
|
4760 |
+
};
|
4761 |
+
Utils.Extend(ResultsAdapter, Result);
|
4762 |
+
ResultsAdapter.prototype.bind = function (container, $container) {
|
4763 |
+
var _self = this;
|
4764 |
+
container.on('results:focus', function (params) {
|
4765 |
+
if ( params.element.attr('aria-selected') != 'true') {
|
4766 |
+
_self.trigger('select', {
|
4767 |
+
data: params.data
|
4768 |
+
});
|
4769 |
+
}
|
4770 |
+
});
|
4771 |
+
ResultsAdapter.__super__.bind.call(this, container, $container);
|
4772 |
+
};
|
4773 |
+
selectFocusResults.resolve( ResultsAdapter );
|
4774 |
+
});
|
4775 |
+
}
|
4776 |
+
else {
|
4777 |
+
selectFocusResults.resolve( false );
|
4778 |
+
}
|
4779 |
+
|
4780 |
+
return selectFocusResults.promise();
|
4781 |
+
|
4782 |
+
};//_preprocessSelect2ForFontFamily
|
4783 |
+
var _setupSelectForFontFamilySelector = function( customResultsAdapter, fontCollections ) {
|
4784 |
+
var _model = item(),
|
4785 |
+
_googleFontsFilteredBySubset = function() {
|
4786 |
+
var subset = item.czr_Input('subset')(),
|
4787 |
+
filtered = _.filter( fontCollections.gfonts, function( data ) {
|
4788 |
+
return data.subsets && _.contains( data.subsets, subset );
|
4789 |
+
});
|
4790 |
+
|
4791 |
+
if ( ! _.isUndefined( subset ) && ! _.isNull( subset ) && 'all-subsets' != subset ) {
|
4792 |
+
return filtered;
|
4793 |
+
} else {
|
4794 |
+
return fontCollections.gfonts;
|
4795 |
+
}
|
4796 |
+
|
4797 |
+
},
|
4798 |
+
$fontSelectElement = $( 'select[data-czrtype="' + input.id + '"]', input.container );
|
4799 |
+
var _generateFontOptions = function( fontList, type ) {
|
4800 |
+
var _html_ = '';
|
4801 |
+
_.each( fontList , function( font_data ) {
|
4802 |
+
var _value = font_data.name,
|
4803 |
+
optionTitle = _.isString( _value ) ? _value.replace(/[+|:]/g, ' ' ) : _value,
|
4804 |
+
_setFontTypePrefix = function( val, type ) {
|
4805 |
+
return _.isString( val ) ? [ '[', type, ']', val ].join('') : '';//<= Example : [gfont]Aclonica:regular
|
4806 |
+
};
|
4807 |
+
|
4808 |
+
_value = _setFontTypePrefix( _value, type );
|
4809 |
+
|
4810 |
+
if ( _value == input() ) {
|
4811 |
+
_html_ += '<option selected="selected" value="' + _value + '">' + optionTitle + '</option>';
|
4812 |
+
} else {
|
4813 |
+
_html_ += '<option value="' + _value + '">' + optionTitle + '</option>';
|
4814 |
+
}
|
4815 |
+
});
|
4816 |
+
return _html_;
|
4817 |
+
};
|
4818 |
+
if ( _.isNull( input() ) || _.isEmpty( input() ) ) {
|
4819 |
+
$fontSelectElement.append( '<option value="none" selected="selected">' + sektionsLocalizedData.i18n['Select a font family'] + '</option>' );
|
4820 |
+
} else {
|
4821 |
+
$fontSelectElement.append( '<option value="none">' + sektionsLocalizedData.i18n['Select a font family'] + '</option>' );
|
4822 |
+
}
|
4823 |
+
_.each( [
|
4824 |
+
{
|
4825 |
+
title : sektionsLocalizedData.i18n['Web Safe Fonts'],
|
4826 |
+
type : 'cfont',
|
4827 |
+
list : fontCollections.cfonts
|
4828 |
+
},
|
4829 |
+
{
|
4830 |
+
title : sektionsLocalizedData.i18n['Google Fonts'],
|
4831 |
+
type : 'gfont',
|
4832 |
+
list : fontCollections.gfonts//_googleFontsFilteredBySubset()
|
4833 |
+
}
|
4834 |
+
], function( fontData ) {
|
4835 |
+
var $optGroup = $('<optgroup>', { label : fontData.title , html : _generateFontOptions( fontData.list, fontData.type ) });
|
4836 |
+
$fontSelectElement.append( $optGroup );
|
4837 |
+
});
|
4838 |
+
|
4839 |
+
var _fonts_select2_params = {
|
4840 |
+
escapeMarkup: function(m) { return m; },
|
4841 |
+
};
|
4842 |
+
/*
|
4843 |
+
* Maybe use custom adapter
|
4844 |
+
*/
|
4845 |
+
if ( customResultsAdapter ) {
|
4846 |
+
$.extend( _fonts_select2_params, {
|
4847 |
+
resultsAdapter: customResultsAdapter,
|
4848 |
+
closeOnSelect: false,
|
4849 |
+
} );
|
4850 |
+
}
|
4851 |
+
$fontSelectElement.select2( _fonts_select2_params );
|
4852 |
+
$( '.select2-selection__rendered', input.container ).css( getInlineFontStyle( input() ) );
|
4853 |
+
|
4854 |
+
};//_setupSelectForFontFamilySelector
|
4855 |
+
var getInlineFontStyle = function( _fontFamily_ ){
|
4856 |
+
if ( ! _.isString( _fontFamily_ ) || _.isEmpty( _fontFamily_ ) )
|
4857 |
+
return {};
|
4858 |
+
_fontFamily_ = _fontFamily_.replace('[gfont]', '').replace('[cfont]', '');
|
4859 |
+
|
4860 |
+
var module = this,
|
4861 |
+
split = _fontFamily_.split(':'), font_family, font_weight, font_style;
|
4862 |
+
|
4863 |
+
font_family = getFontFamilyName( _fontFamily_ );
|
4864 |
+
|
4865 |
+
font_weight = split[1] ? split[1].replace( /[^0-9.]+/g , '') : 400; //removes all characters
|
4866 |
+
font_weight = _.isNumber( font_weight ) ? font_weight : 400;
|
4867 |
+
font_style = ( split[1] && -1 != split[1].indexOf('italic') ) ? 'italic' : '';
|
4868 |
+
|
4869 |
+
|
4870 |
+
return {
|
4871 |
+
'font-family' : 'none' == font_family ? 'inherit' : font_family.replace(/[+|:]/g, ' '),//removes special characters
|
4872 |
+
'font-weight' : font_weight || 400,
|
4873 |
+
'font-style' : font_style || 'normal'
|
4874 |
+
};
|
4875 |
+
};
|
4876 |
+
var getFontFamilyName = function( rawFontFamily ) {
|
4877 |
+
if ( ! _.isString( rawFontFamily ) || _.isEmpty( rawFontFamily ) )
|
4878 |
+
return rawFontFamily;
|
4879 |
+
|
4880 |
+
rawFontFamily = rawFontFamily.replace('[gfont]', '').replace('[cfont]', '');
|
4881 |
+
var split = rawFontFamily.split(':');
|
4882 |
+
return _.isString( split[0] ) ? split[0].replace(/[+|:]/g, ' ') : '';//replaces special characters ( + ) by space
|
4883 |
+
};
|
4884 |
+
|
4885 |
+
$.when( _getFontCollections() ).done( function( fontCollections ) {
|
4886 |
+
_preprocessSelect2ForFontFamily().done( function( customResultsAdapter ) {
|
4887 |
+
_setupSelectForFontFamilySelector( customResultsAdapter, fontCollections );
|
4888 |
+
});
|
4889 |
+
}).fail( function( _r_ ) {
|
4890 |
+
api.errare( 'font_picker => fail response =>', _r_ );
|
4891 |
+
});
|
4892 |
+
}//font_picker()
|
4893 |
+
});//$.extend( api.czrInputMap, {})
|
4894 |
+
|
4895 |
+
|
4896 |
+
})( wp.customize, jQuery, _ );//global sektionsLocalizedData
|
4897 |
+
( function ( api, $, _ ) {
|
4898 |
+
api.czrInputMap = api.czrInputMap || {};
|
4899 |
+
$.extend( api.czrInputMap, {
|
4900 |
+
fa_icon_picker : function() {
|
4901 |
+
var input = this,
|
4902 |
+
item = input.input_parent,
|
4903 |
+
_selected_found = false;
|
4904 |
+
var _generateOptions = function( iconCollection ) {
|
4905 |
+
_.each( iconCollection , function( iconClass ) {
|
4906 |
+
var _attributes = {
|
4907 |
+
value: iconClass,
|
4908 |
+
html: api.CZR_Helpers.capitalize( iconClass.substring( 7 ) )
|
4909 |
+
};
|
4910 |
+
|
4911 |
+
if ( _attributes.value == item().icon ) {
|
4912 |
+
$.extend( _attributes, { selected : "selected" } );
|
4913 |
+
_selected_found = true;
|
4914 |
+
}
|
4915 |
+
$( 'select[data-czrtype]', input.container ).append( $('<option>', _attributes) );
|
4916 |
+
});
|
4917 |
+
|
4918 |
+
|
4919 |
+
var addIcon = function ( state ) {
|
4920 |
+
if (! state.id) { return state.text; }
|
4921 |
+
var $state = $(
|
4922 |
+
'<span class="' + state.element.value + '"></span><span class="social-name"> ' + state.text + '</span>'
|
4923 |
+
);
|
4924 |
+
return $state;
|
4925 |
+
};
|
4926 |
+
var $_placeholder;
|
4927 |
+
if ( _selected_found ) {
|
4928 |
+
$_placeholder = $('<option>');
|
4929 |
+
} else {
|
4930 |
+
$_placeholder = $('<option>', { selected: 'selected' } );
|
4931 |
+
}
|
4932 |
+
$( 'select[data-czrtype]', input.container )
|
4933 |
+
.prepend( $_placeholder )
|
4934 |
+
.select2({
|
4935 |
+
templateResult: addIcon,
|
4936 |
+
templateSelection: addIcon,
|
4937 |
+
placeholder: sektionsLocalizedData.i18n['Select an icon'],
|
4938 |
+
allowClear: true
|
4939 |
+
});
|
4940 |
+
};//_generateOptions
|
4941 |
+
|
4942 |
+
var _getIconsCollections = function() {
|
4943 |
+
var dfd = $.Deferred();
|
4944 |
+
if ( ! _.isEmpty( input.sek_faIconCollection ) ) {
|
4945 |
+
dfd.resolve( input.sek_faIconCollection );
|
4946 |
+
} else {
|
4947 |
+
api.CZR_Helpers.getModuleTmpl( {
|
4948 |
+
tmpl : 'icon_list',
|
4949 |
+
module_type: 'fa_icon_picker_input',
|
4950 |
+
module_id : input.module.id
|
4951 |
+
} ).done( function( _serverTmpl_ ) {
|
4952 |
+
if ( typeof _serverTmpl_ !== 'string' || _serverTmpl_[0] !== '[' ) {
|
4953 |
+
throw new Error( 'fa_icon_picker => server list is not JSON.parse-able');
|
4954 |
+
}
|
4955 |
+
input.sek_faIconCollection = JSON.parse( _serverTmpl_ );
|
4956 |
+
dfd.resolve( input.sek_faIconCollection );
|
4957 |
+
}).fail( function( _r_ ) {
|
4958 |
+
dfd.reject( _r_ );
|
4959 |
+
});
|
4960 |
+
}
|
4961 |
+
return dfd.promise();
|
4962 |
+
};//_getIconsCollections
|
4963 |
+
$.when( _getIconsCollections() ).done( function( iconCollection ) {
|
4964 |
+
_generateOptions( iconCollection );
|
4965 |
+
}).fail( function( _r_ ) {
|
4966 |
+
api.errare( 'fa_icon_picker => fail response =>', _r_ );
|
4967 |
+
});
|
4968 |
+
|
4969 |
+
}
|
4970 |
+
});//$.extend( api.czrInputMap, {})
|
4971 |
+
|
4972 |
+
})( wp.customize, jQuery, _ );//global sektionsLocalizedData
|
4973 |
+
( function ( api, $, _ ) {
|
4974 |
+
api.czrInputMap = api.czrInputMap || {};
|
4975 |
+
$.extend( api.czrInputMap, {
|
4976 |
+
code_editor : function( input_options ) {
|
4977 |
+
var input = this,
|
4978 |
+
control = this.module.control,
|
4979 |
+
item = input.input_parent(),
|
4980 |
+
editorSettings = false,
|
4981 |
+
$textarea = input.container.find( 'textarea' ),
|
4982 |
+
$input_title = input.container.find( '.customize-control-title' ),
|
4983 |
+
editor_params = $textarea.data( 'editor-params' );
|
4984 |
+
if ( wp.codeEditor && ( _.isUndefined( editor_params ) || false !== editor_params ) ) {
|
4985 |
+
editorSettings = editor_params;
|
4986 |
+
}
|
4987 |
+
|
4988 |
+
input.isReady.done( function() {
|
4989 |
+
var _doInstantiate = function( evt ) {
|
4990 |
+
var input = this;
|
4991 |
+
if ( ! _.isEmpty( input.editor ) )
|
4992 |
+
return;
|
4993 |
+
if ( _.isEmpty( input.module.control.container.attr('data-sek-expanded') ) || "false" == input.module.control.container.attr('data-sek-expanded') )
|
4994 |
+
return;
|
4995 |
+
|
4996 |
+
setTimeout( function() {
|
4997 |
+
if ( editorSettings ) {
|
4998 |
+
try { initSyntaxHighlightingEditor( editorSettings ); } catch( er ) {
|
4999 |
+
api.errare( 'error in sek_control => code_editor() input', er );
|
5000 |
+
initPlainTextareaEditor();
|
5001 |
+
}
|
5002 |
+
} else {
|
5003 |
+
initPlainTextareaEditor();
|
5004 |
+
}
|
5005 |
+
$input_title.click();
|
5006 |
+
}, 10 );
|
5007 |
+
};
|
5008 |
+
_doInstantiate.call(input);
|
5009 |
+
input.module.control.container.on('sek-accordion-expanded', function() {
|
5010 |
+
_doInstantiate.call( input );
|
5011 |
+
});
|
5012 |
+
});
|
5013 |
+
|
5014 |
+
|
5015 |
+
/**
|
5016 |
+
* Initialize syntax-highlighting editor.
|
5017 |
+
*/
|
5018 |
+
var initSyntaxHighlightingEditor = function( codeEditorSettings ) {
|
5019 |
+
var suspendEditorUpdate = false,
|
5020 |
+
settings;
|
5021 |
+
|
5022 |
+
settings = _.extend( {}, codeEditorSettings, {
|
5023 |
+
onTabNext: CZRSeksPrototype.selectNextTabbableOrFocusable( ':tabbable' ),
|
5024 |
+
onTabPrevious: CZRSeksPrototype.selectPrevTabbableOrFocusable( ':tabbable' ),
|
5025 |
+
onUpdateErrorNotice: onUpdateErrorNotice
|
5026 |
+
});
|
5027 |
+
|
5028 |
+
input.editor = wp.codeEditor.initialize( $textarea, settings );
|
5029 |
+
$( input.editor.codemirror.display.lineDiv )
|
5030 |
+
.attr({
|
5031 |
+
role: 'textbox',
|
5032 |
+
'aria-multiline': 'true',
|
5033 |
+
'aria-label': $input_title.html(),
|
5034 |
+
'aria-describedby': 'editor-keyboard-trap-help-1 editor-keyboard-trap-help-2 editor-keyboard-trap-help-3 editor-keyboard-trap-help-4'
|
5035 |
+
});
|
5036 |
+
$input_title.on( 'click', function( evt ) {
|
5037 |
+
evt.stopPropagation();
|
5038 |
+
input.editor.codemirror.focus();
|
5039 |
+
});
|
5040 |
+
|
5041 |
+
|
5042 |
+
/*
|
5043 |
+
* When the CodeMirror instance changes, mirror to the textarea,
|
5044 |
+
* where we have our "true" change event handler bound.
|
5045 |
+
*/
|
5046 |
+
input.editor.codemirror.on( 'change', function( codemirror ) {
|
5047 |
+
suspendEditorUpdate = true;
|
5048 |
+
$textarea.val( codemirror.getValue() ).trigger( 'change' );
|
5049 |
+
suspendEditorUpdate = false;
|
5050 |
+
});
|
5051 |
+
|
5052 |
+
input.editor.codemirror.setValue( input() );
|
5053 |
+
/* TODO: check this */
|
5054 |
+
input.bind( input.id + ':changed', function( value ) {
|
5055 |
+
if ( ! suspendEditorUpdate ) {
|
5056 |
+
input.editor.codemirror.setValue( value );
|
5057 |
+
}
|
5058 |
+
});
|
5059 |
+
input.editor.codemirror.on( 'keydown', function onKeydown( codemirror, event ) {
|
5060 |
+
var escKeyCode = 27;
|
5061 |
+
if ( escKeyCode === event.keyCode ) {
|
5062 |
+
event.stopPropagation();
|
5063 |
+
}
|
5064 |
+
});
|
5065 |
+
};
|
5066 |
+
|
5067 |
+
|
5068 |
+
|
5069 |
+
/**
|
5070 |
+
* Initialize plain-textarea editor when syntax highlighting is disabled.
|
5071 |
+
*/
|
5072 |
+
var initPlainTextareaEditor = function() {
|
5073 |
+
var textarea = $textarea[0];
|
5074 |
+
input.editor = textarea;//assign the editor property
|
5075 |
+
$textarea.on( 'blur', function onBlur() {
|
5076 |
+
$textarea.data( 'next-tab-blurs', false );
|
5077 |
+
} );
|
5078 |
+
|
5079 |
+
$textarea.on( 'keydown', function onKeydown( event ) {
|
5080 |
+
var selectionStart, selectionEnd, value, tabKeyCode = 9, escKeyCode = 27;
|
5081 |
+
|
5082 |
+
if ( escKeyCode === event.keyCode ) {
|
5083 |
+
if ( ! $textarea.data( 'next-tab-blurs' ) ) {
|
5084 |
+
$textarea.data( 'next-tab-blurs', true );
|
5085 |
+
event.stopPropagation(); // Prevent collapsing the section.
|
5086 |
+
}
|
5087 |
+
return;
|
5088 |
+
}
|
5089 |
+
if ( tabKeyCode !== event.keyCode || event.ctrlKey || event.altKey || event.shiftKey ) {
|
5090 |
+
return;
|
5091 |
+
}
|
5092 |
+
if ( $textarea.data( 'next-tab-blurs' ) ) {
|
5093 |
+
return;
|
5094 |
+
}
|
5095 |
+
|
5096 |
+
selectionStart = textarea.selectionStart;
|
5097 |
+
selectionEnd = textarea.selectionEnd;
|
5098 |
+
value = textarea.value;
|
5099 |
+
|
5100 |
+
if ( selectionStart >= 0 ) {
|
5101 |
+
textarea.value = value.substring( 0, selectionStart ).concat( '\t', value.substring( selectionEnd ) );
|
5102 |
+
$textarea.selectionStart = textarea.selectionEnd = selectionStart + 1;
|
5103 |
+
}
|
5104 |
+
|
5105 |
+
event.stopPropagation();
|
5106 |
+
event.preventDefault();
|
5107 |
+
});
|
5108 |
+
},
|
5109 |
+
|
5110 |
+
|
5111 |
+
|
5112 |
+
/**
|
5113 |
+
* Update error notice.
|
5114 |
+
*/
|
5115 |
+
onUpdateErrorNotice = function( errorAnnotations ) {
|
5116 |
+
var message;
|
5117 |
+
|
5118 |
+
control.setting.notifications.remove( input.id );
|
5119 |
+
if ( 0 !== errorAnnotations.length ) {
|
5120 |
+
if ( 1 === errorAnnotations.length ) {
|
5121 |
+
message = sektionsLocalizedData.i18n.codeEditorSingular.replace( '%d', '1' ).replace( '%s', $input_title.html() );
|
5122 |
+
} else {
|
5123 |
+
message = sektionsLocalizedData.i18n.codeEditorPlural.replace( '%d', String( errorAnnotations.length ) ).replace( '%s', $input_title.html() );
|
5124 |
+
}
|
5125 |
+
control.setting.notifications.add( input.id, new api.Notification( input.id, {
|
5126 |
+
message: message,
|
5127 |
+
type: 'warning'
|
5128 |
+
} ) );
|
5129 |
+
}
|
5130 |
+
}
|
5131 |
+
}
|
5132 |
+
});//$.extend( api.czrInputMap, {})
|
5133 |
+
})( wp.customize, jQuery, _ );//global sektionsLocalizedData
|
5134 |
+
( function ( api, $, _ ) {
|
5135 |
+
api.czrInputMap = api.czrInputMap || {};
|
5136 |
+
$.extend( api.czrInputMap, {
|
5137 |
+
range_simple : function( params ) {
|
5138 |
+
var input = this,
|
5139 |
+
$wrapper = $('.sek-range-with-unit-picker-wrapper', input.container ),
|
5140 |
+
$numberInput = $wrapper.find( 'input[type="number"]'),
|
5141 |
+
$rangeInput = $wrapper.find( 'input[type="range"]');
|
5142 |
+
$rangeInput.on('input', function( evt ) {
|
5143 |
+
$numberInput.val( $(this).val() ).trigger('input');
|
5144 |
+
});
|
5145 |
+
$numberInput.on('input', function( evt ) {
|
5146 |
+
input( $(this).val() );
|
5147 |
+
$rangeInput.val( $(this).val() );
|
5148 |
+
});
|
5149 |
+
$rangeInput.val( $numberInput.val() || 0 );
|
5150 |
+
},
|
5151 |
+
|
5152 |
+
});//$.extend( api.czrInputMap, {})
|
5153 |
+
|
5154 |
+
|
5155 |
+
})( wp.customize, jQuery, _ );//global sektionsLocalizedData
|
5156 |
+
( function ( api, $, _ ) {
|
5157 |
+
api.czrInputMap = api.czrInputMap || {};
|
5158 |
+
$.extend( api.czrInputMap, {
|
5159 |
+
range_with_unit_picker : function( params ) {
|
5160 |
+
var input = this,
|
5161 |
+
$wrapper = $('.sek-range-with-unit-picker-wrapper', input.container ),
|
5162 |
+
$numberInput = $wrapper.find( 'input[type="number"]'),
|
5163 |
+
$rangeInput = $wrapper.find( 'input[type="range"]'),
|
5164 |
+
initial_unit = $wrapper.find('input[data-czrtype]').data('sek-unit'),
|
5165 |
+
validateUnit = function( unit ) {
|
5166 |
+
if ( ! _.contains( ['px', 'em', '%'], unit ) ) {
|
5167 |
+
api.errare( 'error : invalid unit for input ' + input.id, unit );
|
5168 |
+
unit = 'px';
|
5169 |
+
}
|
5170 |
+
return unit;
|
5171 |
+
};
|
5172 |
+
input.css_unit = new api.Value( _.isEmpty( initial_unit ) ? 'px' : validateUnit( initial_unit ) );
|
5173 |
+
input.css_unit.bind( function( to ) {
|
5174 |
+
to = _.isEmpty( to ) ? 'px' : to;
|
5175 |
+
$wrapper.find( 'input[type="number"]').trigger('input');
|
5176 |
+
});
|
5177 |
+
$rangeInput.on('input', function( evt ) {
|
5178 |
+
$numberInput.val( $(this).val() ).trigger('input');
|
5179 |
+
});
|
5180 |
+
$numberInput.on('input', function( evt ) {
|
5181 |
+
input( $(this).val() + validateUnit( input.css_unit() ) );
|
5182 |
+
$rangeInput.val( $(this).val() );
|
5183 |
+
});
|
5184 |
+
$rangeInput.val( $numberInput.val() || 0 );
|
5185 |
+
$wrapper.on( 'click', '.sek-ui-button', function(evt) {
|
5186 |
+
evt.preventDefault();
|
5187 |
+
$wrapper.find('.sek-ui-button').removeClass('is-selected').attr( 'aria-pressed', false );
|
5188 |
+
$(this).addClass('is-selected').attr( 'aria-pressed', true );
|
5189 |
+
$wrapper.find('input[data-czrtype]').data('sek-unit', $(this).data('sek-unit') );
|
5190 |
+
input.css_unit( $(this).data('sek-unit') );
|
5191 |
+
});
|
5192 |
+
$wrapper.find( '.sek-ui-button[data-sek-unit="'+ initial_unit +'"]').addClass('is-selected').attr( 'aria-pressed', true );
|
5193 |
+
},
|
5194 |
+
|
5195 |
+
});//$.extend( api.czrInputMap, {})
|
5196 |
+
|
5197 |
+
|
5198 |
+
})( wp.customize, jQuery, _ );//global sektionsLocalizedData
|
5199 |
+
( function ( api, $, _ ) {
|
5200 |
+
api.czrInputMap = api.czrInputMap || {};
|
5201 |
+
$.extend( api.czrInputMap, {
|
5202 |
+
range_with_unit_picker_device_switcher : function( params ) {
|
5203 |
+
var input = this,
|
5204 |
+
$wrapper = $('.sek-range-with-unit-picker-wrapper', input.container ),
|
5205 |
+
$numberInput = $wrapper.find( 'input[type="number"]'),
|
5206 |
+
$rangeInput = $wrapper.find( 'input[type="range"]'),
|
5207 |
+
validateUnit = function( unit ) {
|
5208 |
+
if ( ! _.contains( ['px', 'em', '%'], unit ) ) {
|
5209 |
+
api.errare( 'range_with_unit_picker_device_switcher => error : invalid unit for input ' + input.id, unit );
|
5210 |
+
unit = 'px';
|
5211 |
+
}
|
5212 |
+
return unit;
|
5213 |
+
},
|
5214 |
+
_extractNumericVal = function( _rawVal ) {
|
5215 |
+
return ( _.isEmpty( _rawVal ) || ! _.isString( _rawVal ) ) ? '16' : _rawVal.replace(/px|em|%/g,'');
|
5216 |
+
},
|
5217 |
+
_extractUnit = function( _rawVal ) {
|
5218 |
+
return ( _.isEmpty( _rawVal ) || ! _.isString( _rawVal ) ) ? 'px' : _rawVal.replace(/[0-9]|\.|,/g, '');
|
5219 |
+
},
|
5220 |
+
inputRegistrationParams = api.czr_sektions.getInputRegistrationParams( input.id, input.module.module_type ),
|
5221 |
+
defaultVal = ( ! _.isEmpty( inputRegistrationParams ) && ! _.isEmpty( inputRegistrationParams.default ) ) ? inputRegistrationParams.default : {};
|
5222 |
+
|
5223 |
+
var getInitialUnit = function() {
|
5224 |
+
return $wrapper.find('input[data-czrtype]').data('sek-unit') || 'px';
|
5225 |
+
};
|
5226 |
+
var getCurrentDeviceActualOrInheritedValue = function( inputValues, currentDevice ) {
|
5227 |
+
var deviceHierarchy = [ 'mobile' , 'tablet', 'desktop' ];
|
5228 |
+
if ( _.has( inputValues, currentDevice ) ) {
|
5229 |
+
return inputValues[ currentDevice ];
|
5230 |
+
} else {
|
5231 |
+
var deviceIndex = _.findIndex( deviceHierarchy, function( _d_ ) { return currentDevice === _d_; });
|
5232 |
+
if ( ! _.isEmpty( currentDevice ) && deviceIndex < deviceHierarchy.length ) {
|
5233 |
+
return getCurrentDeviceActualOrInheritedValue( inputValues, deviceHierarchy[ deviceIndex + 1 ] );
|
5234 |
+
} else {
|
5235 |
+
var clonedDefault = $.extend( true, { desktop : '' }, defaultVal );
|
5236 |
+
return clonedDefault[ 'desktop' ];
|
5237 |
+
}
|
5238 |
+
}
|
5239 |
+
};
|
5240 |
+
var syncWithPreviewedDevice = function( currentDevice ) {
|
5241 |
+
var inputVal = input(), inputValues = {}, clonedDefault = $.extend( true, {}, defaultVal );
|
5242 |
+
inputValues = clonedDefault;
|
5243 |
+
if ( _.isObject( inputVal ) ) {
|
5244 |
+
inputValues = $.extend( true, {}, inputVal );
|
5245 |
+
} else if ( _.isString( inputVal ) && ! _.isEmpty( inputVal ) ) {
|
5246 |
+
inputValues = { desktop : inputVal };
|
5247 |
+
}
|
5248 |
+
var _rawVal = getCurrentDeviceActualOrInheritedValue( inputValues, currentDevice ),
|
5249 |
+
_unit = _extractUnit( _rawVal ),
|
5250 |
+
_numberVal = _extractNumericVal( _rawVal );
|
5251 |
+
$('.sek-unit-wrapper', $wrapper).find('[data-sek-unit="' + _unit +'"]').trigger('click', { previewed_device_switched : true });// We don't want to update the input()
|
5252 |
+
$wrapper.find( '.sek-ui-button[data-sek-unit="'+ _unit +'"]').addClass('is-selected').attr( 'aria-pressed', true );
|
5253 |
+
$numberInput.val( _numberVal ).trigger('input', { previewed_device_switched : true });// We don't want to update the input()
|
5254 |
+
};
|
5255 |
+
api.czr_sektions.maybeSetupDeviceSwitcherForInput.call( input );
|
5256 |
+
input.css_unit = new api.Value( _.isEmpty( getInitialUnit() ) ? 'px' : validateUnit( getInitialUnit() ) );
|
5257 |
+
var resetButton = '<button type="button" class="button sek-reset-button sek-float-right">' + sektionsLocalizedData.i18n['Reset'] + '</button>';
|
5258 |
+
input.container.find('.customize-control-title').append( resetButton );
|
5259 |
+
input.css_unit.bind( function( to, from, params ) {
|
5260 |
+
if ( _.isObject( params ) && true === params.previewed_device_switched )
|
5261 |
+
return;
|
5262 |
+
$numberInput.trigger('input');
|
5263 |
+
});
|
5264 |
+
$rangeInput.on('input', function( evt ) {
|
5265 |
+
$numberInput.val( $(this).val() ).trigger('input');
|
5266 |
+
});
|
5267 |
+
$numberInput.on('input', function( evt, params ) {
|
5268 |
+
var previewedDevice = api.previewedDevice() || 'desktop',
|
5269 |
+
changedNumberInputVal = $(this).val() + validateUnit( input.css_unit() ),
|
5270 |
+
_newInputVal;
|
5271 |
+
|
5272 |
+
_newInputVal = $.extend( true, {}, _.isObject( input() ) ? input() : {} );
|
5273 |
+
_newInputVal[ previewedDevice ] = $.extend( true, {}, _newInputVal[ previewedDevice ] || {} );
|
5274 |
+
if ( ( _.isString( changedNumberInputVal ) && ! _.isEmpty( changedNumberInputVal ) ) ) {
|
5275 |
+
_newInputVal[ previewedDevice ]= changedNumberInputVal;
|
5276 |
+
}
|
5277 |
+
if ( _.isEmpty( params ) || ( _.isObject( params ) && true !== params.previewed_device_switched ) ) {
|
5278 |
+
input( _newInputVal );
|
5279 |
+
}
|
5280 |
+
$rangeInput.val( $(this).val() );
|
5281 |
+
});
|
5282 |
+
$wrapper.on( 'click', '.sek-ui-button', function( evt, params ) {
|
5283 |
+
evt.stopPropagation();
|
5284 |
+
$wrapper.find('.sek-ui-button').removeClass('is-selected').attr( 'aria-pressed', false );
|
5285 |
+
$(this).addClass('is-selected').attr( 'aria-pressed', true );
|
5286 |
+
$wrapper.find('input[data-czrtype]').data('sek-unit', $(this).data('sek-unit') );
|
5287 |
+
input.css_unit( $(this).data('sek-unit'), params );
|
5288 |
+
});
|
5289 |
+
input.previewedDevice.bind( function( currentDevice ) {
|
5290 |
+
try { syncWithPreviewedDevice( currentDevice ); } catch( er ) {
|
5291 |
+
api.errare('Error when firing syncWithPreviewedDevice for input type range_with_unit_picker_device_switcher for input id ' + input.id , er );
|
5292 |
+
}
|
5293 |
+
});
|
5294 |
+
input.container.on( 'click', '.sek-reset-button', function( evt ) {
|
5295 |
+
var _currentDevice = api.previewedDevice(),
|
5296 |
+
_newVal = $.extend( true, {}, _.isObject( input() ) ? input() : {} );
|
5297 |
+
if ( !_.isEmpty( _newVal[ _currentDevice ] ) ) {
|
5298 |
+
_newVal = _.omit( _newVal, _currentDevice );
|
5299 |
+
input( _newVal );
|
5300 |
+
syncWithPreviewedDevice( api.previewedDevice() );
|
5301 |
+
}
|
5302 |
+
});
|
5303 |
+
$rangeInput.val( $numberInput.val() || 0 );
|
5304 |
+
try { syncWithPreviewedDevice( api.previewedDevice() ); } catch( er ) {
|
5305 |
+
api.errare('Error when firing syncWithPreviewedDevice for input type range_with_unit_picker_device_switcher for input id ' + input.id , er );
|
5306 |
+
}
|
5307 |
+
},
|
5308 |
+
|
5309 |
+
});//$.extend( api.czrInputMap, {})
|
5310 |
+
|
5311 |
+
|
5312 |
+
})( wp.customize, jQuery, _ );//global sektionsLocalizedData
|
5313 |
+
( function ( api, $, _ ) {
|
5314 |
+
api.czrInputMap = api.czrInputMap || {};
|
5315 |
+
$.extend( api.czrInputMap, {
|
5316 |
+
borders : function( params ) {
|
5317 |
+
var input = this,
|
5318 |
+
$wrapper = $('.sek-borders', input.container ),
|
5319 |
+
$numberInput = $wrapper.find( 'input[type="number"]'),
|
5320 |
+
$rangeInput = $wrapper.find( 'input[type="range"]'),
|
5321 |
+
$colorInput = $wrapper.find('.sek-alpha-color-input'),
|
5322 |
+
validateUnit = function( unit ) {
|
5323 |
+
if ( ! _.contains( ['px', 'em', '%'], unit ) ) {
|
5324 |
+
api.errare( 'borders => error : invalid unit for input ' + input.id, unit );
|
5325 |
+
unit = 'px';
|
5326 |
+
}
|
5327 |
+
return unit;
|
5328 |
+
},
|
5329 |
+
_extractNumericVal = function( _rawVal ) {
|
5330 |
+
return ( _.isEmpty( _rawVal ) || ! _.isString( _rawVal ) ) ? '16' : _rawVal.replace(/px|em|%/g,'');
|
5331 |
+
},
|
5332 |
+
_extractUnit = function( _rawVal ) {
|
5333 |
+
return ( _.isEmpty( _rawVal ) || ! _.isString( _rawVal ) ) ? 'px' : _rawVal.replace(/[0-9]|\.|,/g, '');
|
5334 |
+
},
|
5335 |
+
inputRegistrationParams = api.czr_sektions.getInputRegistrationParams( input.id, input.module.module_type ),
|
5336 |
+
defaultVal = ( ! _.isEmpty( inputRegistrationParams ) && ! _.isEmpty( inputRegistrationParams.default ) ) ? inputRegistrationParams.default : {};
|
5337 |
+
|
5338 |
+
input.cssBorderTypes = [ 'top', 'left', 'right', 'bottom' ];
|
5339 |
+
var getInitialUnit = function() {
|
5340 |
+
var inputVal = input(), initial_unit = 'px';
|
5341 |
+
if ( _.isObject( inputVal ) && _.has( inputVal, '_all_' ) && _.isObject( inputVal['_all_'] ) && ! _.isEmpty( inputVal['_all_'][ 'wght'] ) ) {
|
5342 |
+
initial_unit = validateUnit( _extractUnit( inputVal['_all_'][ 'wght'] ) );
|
5343 |
+
}
|
5344 |
+
return initial_unit;
|
5345 |
+
};
|
5346 |
+
var getInitialWeight = function() {
|
5347 |
+
var inputVal = input(), initial_weight = 1;
|
5348 |
+
if ( _.isObject( inputVal ) && _.has( inputVal, '_all_' ) && _.isObject( inputVal['_all_'] ) && ! _.isEmpty( inputVal['_all_'][ 'wght'] ) ) {
|
5349 |
+
initial_weight = _extractNumericVal( inputVal['_all_'][ 'wght'] );
|
5350 |
+
}
|
5351 |
+
initial_weight = parseInt(initial_weight, 10);
|
5352 |
+
if ( ! _.isNumber( initial_weight ) || initial_weight < 0 ) {
|
5353 |
+
api.errare( 'Error in borders input type for module : ' + input.module.module_type + ' the initial border width is invalid : ' + initial_weight );
|
5354 |
+
initial_weight = 1;
|
5355 |
+
}
|
5356 |
+
return initial_weight;
|
5357 |
+
};
|
5358 |
+
var getInitialColor = function() {
|
5359 |
+
var inputVal = input(), initial_color = '#000000';
|
5360 |
+
if ( _.isObject( inputVal ) && _.has( inputVal, '_all_' ) && _.isObject( inputVal['_all_'] ) && ! _.isEmpty( inputVal['_all_'][ 'col'] ) ) {
|
5361 |
+
initial_color = inputVal['_all_'][ 'col'];
|
5362 |
+
}
|
5363 |
+
return initial_color;
|
5364 |
+
};
|
5365 |
+
var getCurrentBorderTypeOrAllValue = function( inputValues, borderType ) {
|
5366 |
+
var clonedDefaults = $.extend( true, {}, defaultVal ), _all_Value;
|
5367 |
+
if ( ! _.has( clonedDefaults, '_all_' ) ) {
|
5368 |
+
throw new Error( "Error when firing getCurrentBorderTypeOrAllValue : the default value of the borders input must be php registered as an array formed : array( 'wght' => '1px', 'col' => '#000000' )");
|
5369 |
+
}
|
5370 |
+
|
5371 |
+
_all_Value = ( _.isObject( inputValues ) && _.has( inputValues, '_all_' ) ) ? _.extend( clonedDefaults['_all_'], inputValues[ '_all_' ] ) : clonedDefaults['_all_'];
|
5372 |
+
if ( _.has( inputValues, borderType ) && _.isObject( inputValues[ borderType ] ) ) {
|
5373 |
+
return _.extend( _all_Value, inputValues[ borderType ] );
|
5374 |
+
} else {
|
5375 |
+
return clonedDefaults['_all_'];
|
5376 |
+
}
|
5377 |
+
};
|
5378 |
+
var syncWithBorderType = function( borderType ) {
|
5379 |
+
if ( ! _.contains( _.union( input.cssBorderTypes, [ '_all_' ] ) , borderType ) ) {
|
5380 |
+
throw new Error( "Error in syncWithBorderType : the border type must be one of those values '_all_', 'top', 'left', 'right', 'bottom'" );
|
5381 |
+
}
|
5382 |
+
var inputVal = input(), inputValues = {}, clonedDefault = $.extend( true, {}, defaultVal );
|
5383 |
+
if ( _.isObject( inputVal ) ) {
|
5384 |
+
inputValues = $.extend( true, {}, inputVal );
|
5385 |
+
} else if ( _.isString( inputVal ) ) {
|
5386 |
+
inputValues = { _all_ : { wght : inputVal } };
|
5387 |
+
}
|
5388 |
+
inputValues = $.extend( clonedDefault, inputValues );
|
5389 |
+
var _rawVal = getCurrentBorderTypeOrAllValue( inputValues, borderType ), _unit, _numberVal;
|
5390 |
+
if ( _.isEmpty( _rawVal ) || ! _.isObject( _rawVal ) || _.isEmpty( _rawVal.wght ) || _.isEmpty( _rawVal.col ) ) {
|
5391 |
+
throw new Error( "Error in syncWithBorderType : getCurrentBorderTypeOrAllValue must return an object formed : array( 'wght' => '1px', 'col' => '#000000' )");
|
5392 |
+
}
|
5393 |
+
|
5394 |
+
_unit = _extractUnit( _rawVal.wght );
|
5395 |
+
_numberVal = _extractNumericVal( _rawVal.wght );
|
5396 |
+
$('.sek-unit-wrapper', $wrapper).find('[data-sek-unit="' + _unit +'"]').trigger('click', { border_type_switched : true });// We don't want to update the input()
|
5397 |
+
$wrapper.find( '.sek-ui-button[data-sek-unit="'+ _unit +'"]').addClass('is-selected').attr( 'aria-pressed', true );
|
5398 |
+
$numberInput.val( _numberVal ).trigger('input', { border_type_switched : true });// We don't want to update the input()
|
5399 |
+
$colorInput.data('border_type_switched', true );
|
5400 |
+
$colorInput.val( _rawVal.col ).trigger( 'change' );
|
5401 |
+
$colorInput.data('border_type_switched', false );
|
5402 |
+
};
|
5403 |
+
input.borderColor = new api.Value( _.isEmpty( getInitialColor() ) ? '#000000' : getInitialColor() );
|
5404 |
+
input.css_unit = new api.Value( _.isEmpty( getInitialUnit() ) ? 'px' : validateUnit( getInitialUnit() ) );
|
5405 |
+
input.borderType = new api.Value( '_all_');
|
5406 |
+
$numberInput.val( getInitialWeight() );
|
5407 |
+
$colorInput.val( input.borderColor() );
|
5408 |
+
$colorInput.wpColorPicker({
|
5409 |
+
palettes: true,
|
5410 |
+
width: window.innerWidth >= 1440 ? 271 : 251,
|
5411 |
+
change : function( evt, o ) {
|
5412 |
+
$(this).val( o.color.toString() ).trigger('colorpickerchange');
|
5413 |
+
input.borderColor( o.color.toString(), { border_type_switched : true === $(this).data('border_type_switched') } );
|
5414 |
+
},
|
5415 |
+
clear : function( e, o ) {
|
5416 |
+
$(this).val('').trigger('colorpickerchange');
|
5417 |
+
input.borderColor('');
|
5418 |
+
}
|
5419 |
+
});
|
5420 |
+
input.css_unit.bind( function( to, from, params ) {
|
5421 |
+
if ( _.isObject( params ) && ( true === params.border_type_switched || true === params.initializing_the_unit ) )
|
5422 |
+
return;
|
5423 |
+
$numberInput.trigger('input', params);
|
5424 |
+
});
|
5425 |
+
input.borderColor.bind( function( to, from, params ) {
|
5426 |
+
if ( _.isObject( params ) && ( true === params.border_type_switched || true === params.initializing_the_color ) )
|
5427 |
+
return;
|
5428 |
+
$numberInput.trigger('input', params);
|
5429 |
+
});
|
5430 |
+
input.borderType.bind( function( borderType ) {
|
5431 |
+
try { syncWithBorderType( borderType ); } catch( er ) {
|
5432 |
+
api.errare('Error when firing syncWithBorderType for input type borders for module type ' + input.module.module_type , er );
|
5433 |
+
}
|
5434 |
+
});
|
5435 |
+
$rangeInput.on('input', function( evt ) {
|
5436 |
+
$numberInput.val( $(this).val() ).trigger('input');
|
5437 |
+
});
|
5438 |
+
$numberInput.on('input', function( evt, params ) {
|
5439 |
+
var currentBorderType = input.borderType() || '_all_',
|
5440 |
+
currentColor = input.borderColor(),
|
5441 |
+
changedNumberInputVal = $(this).val() + validateUnit( input.css_unit() ),
|
5442 |
+
clonedDefaults = $.extend( true, {}, defaultVal ),
|
5443 |
+
_newInputVal;
|
5444 |
+
|
5445 |
+
_newInputVal = $.extend( true, {}, _.isObject( input() ) ? input() : clonedDefaults );
|
5446 |
+
_newInputVal[ currentBorderType ] = $.extend( true, {}, _newInputVal[ currentBorderType ] || clonedDefaults[ currentBorderType ] );
|
5447 |
+
if ( ( _.isString( changedNumberInputVal ) && ! _.isEmpty( changedNumberInputVal ) ) ) {
|
5448 |
+
_newInputVal[ currentBorderType ][ 'wght' ] = changedNumberInputVal;
|
5449 |
+
}
|
5450 |
+
_newInputVal[ currentBorderType ][ 'col' ] = currentColor;
|
5451 |
+
if ( _.isEmpty( params ) || ( _.isObject( params ) && true !== params.border_type_switched ) ) {
|
5452 |
+
if ( '_all_' === currentBorderType ) {
|
5453 |
+
_.each( input.cssBorderTypes, function( _type ) {
|
5454 |
+
_newInputVal = _.omit( _newInputVal, _type );
|
5455 |
+
});
|
5456 |
+
}
|
5457 |
+
input( _newInputVal );
|
5458 |
+
}
|
5459 |
+
$rangeInput.val( $(this).val() );
|
5460 |
+
});
|
5461 |
+
$wrapper.on( 'click', '[data-sek-unit]', function( evt, params ) {
|
5462 |
+
evt.preventDefault();
|
5463 |
+
$wrapper.find('[data-sek-unit]').removeClass('is-selected').attr( 'aria-pressed', false );
|
5464 |
+
$(this).addClass('is-selected').attr( 'aria-pressed', true );
|
5465 |
+
$wrapper.find('input[data-czrtype]').data('sek-unit', $(this).data('sek-unit') );
|
5466 |
+
input.css_unit( $(this).data('sek-unit'), params );
|
5467 |
+
});
|
5468 |
+
$wrapper.on( 'click', '[data-sek-border-type]', function( evt, params ) {
|
5469 |
+
evt.preventDefault();
|
5470 |
+
$wrapper.find('[data-sek-border-type]').removeClass('is-selected').attr( 'aria-pressed', false );
|
5471 |
+
$(this).addClass('is-selected').attr( 'aria-pressed', true );
|
5472 |
+
var border = '_all_';
|
5473 |
+
try { border = $(this).data('sek-border-type'); } catch( er ) {
|
5474 |
+
api.errare( 'borders input type => error when attaching click event', er );
|
5475 |
+
}
|
5476 |
+
input.borderType( border, params );
|
5477 |
+
});
|
5478 |
+
input.container.on( 'click', '.sek-reset-button', function( evt ) {
|
5479 |
+
var currentBorderType = input.borderType() || '_all_',
|
5480 |
+
_newVal = $.extend( true, {}, _.isObject( input() ) ? input() : {} );
|
5481 |
+
if ( !_.isEmpty( _newVal[ currentBorderType ] ) ) {
|
5482 |
+
_newVal = _.omit( _newVal, currentBorderType );
|
5483 |
+
input( _newVal );
|
5484 |
+
syncWithBorderType( currentBorderType );
|
5485 |
+
}
|
5486 |
+
});
|
5487 |
+
$rangeInput.val( $numberInput.val() || 0 );
|
5488 |
+
try { syncWithBorderType( input.borderType() ); } catch( er ) {
|
5489 |
+
api.errare('Error when firing syncWithBorderType for input type borders for module type ' + input.module.module_type , er );
|
5490 |
+
}
|
5491 |
+
$( '[data-sek-unit="' + input.css_unit() + '"]', $wrapper ).trigger('click', { initializing_the_unit : true } );
|
5492 |
+
},
|
5493 |
+
|
5494 |
+
});//$.extend( api.czrInputMap, {})
|
5495 |
+
|
5496 |
+
|
5497 |
+
})( wp.customize, jQuery, _ );//global sektionsLocalizedData
|
5498 |
+
( function ( api, $, _ ) {
|
5499 |
+
api.czrInputMap = api.czrInputMap || {};
|
5500 |
+
$.extend( api.czrInputMap, {
|
5501 |
+
border_radius : function( params ) {
|
5502 |
+
var input = this,
|
5503 |
+
$wrapper = $('.sek-borders', input.container ),
|
5504 |
+
$numberInput = $wrapper.find( 'input[type="number"]'),
|
5505 |
+
$rangeInput = $wrapper.find( 'input[type="range"]'),
|
5506 |
+
validateUnit = function( unit ) {
|
5507 |
+
if ( ! _.contains( ['px', 'em', '%'], unit ) ) {
|
5508 |
+
api.errare( 'border_radius => error : invalid unit for input ' + input.id, unit );
|
5509 |
+
unit = 'px';
|
5510 |
+
}
|
5511 |
+
return unit;
|
5512 |
+
},
|
5513 |
+
_extractNumericVal = function( _rawVal ) {
|
5514 |
+
return ( _.isEmpty( _rawVal ) || ! _.isString( _rawVal ) ) ? '16' : _rawVal.replace(/px|em|%/g,'');
|
5515 |
+
},
|
5516 |
+
_extractUnit = function( _rawVal ) {
|
5517 |
+
return ( _.isEmpty( _rawVal ) || ! _.isString( _rawVal ) ) ? 'px' : _rawVal.replace(/[0-9]|\.|,/g, '');
|
5518 |
+
},
|
5519 |
+
inputRegistrationParams = api.czr_sektions.getInputRegistrationParams( input.id, input.module.module_type ),
|
5520 |
+
defaultVal = ( ! _.isEmpty( inputRegistrationParams ) && ! _.isEmpty( inputRegistrationParams.default ) ) ? inputRegistrationParams.default : {};
|
5521 |
+
|
5522 |
+
input.cssRadiusTypes = [ 'top_left','top_right','bottom_right','bottom_left' ];
|
5523 |
+
var getInitialUnit = function() {
|
5524 |
+
var inputVal = input(), initial_unit = 'px';
|
5525 |
+
if ( _.isObject( inputVal ) && _.has( inputVal, '_all_' ) ) {
|
5526 |
+
initial_unit = validateUnit( _extractUnit( inputVal['_all_'] ) );
|
5527 |
+
}
|
5528 |
+
return initial_unit;
|
5529 |
+
};
|
5530 |
+
var getInitialRadius = function() {
|
5531 |
+
var inputVal = input(), initial_rad = 0;
|
5532 |
+
if ( _.isObject( inputVal ) && _.has( inputVal, '_all_' ) ) {
|
5533 |
+
initial_rad = _extractNumericVal( inputVal['_all_'] );
|
5534 |
+
}
|
5535 |
+
initial_rad = parseInt(initial_rad, 10);
|
5536 |
+
if ( ! _.isNumber( initial_rad ) || initial_rad < 0 ) {
|
5537 |
+
api.errare( 'Error in border_radius input type for module : ' + input.module.module_type + ' the initial radius is invalid : ' + initial_rad );
|
5538 |
+
initial_rad = 0;
|
5539 |
+
}
|
5540 |
+
return initial_rad;
|
5541 |
+
};
|
5542 |
+
var getCurrentRadiusTypeOrAllValue = function( inputValues, radiusType ) {
|
5543 |
+
var clonedDefaults = $.extend( true, {}, defaultVal ), _all_Value;
|
5544 |
+
if ( ! _.has( clonedDefaults, '_all_' ) ) {
|
5545 |
+
throw new Error( "Error when firing getCurrentRadiusTypeOrAllValue : the default value of the border_radius input must be php registered as an array");
|
5546 |
+
}
|
5547 |
+
|
5548 |
+
_all_Value = ( _.isObject( inputValues ) && _.has( inputValues, '_all_' ) ) ? inputValues[ '_all_' ] : clonedDefaults['_all_'];
|
5549 |
+
if ( _.has( inputValues, radiusType ) ) {
|
5550 |
+
return inputValues[ radiusType ];
|
5551 |
+
} else {
|
5552 |
+
return _all_Value;
|
5553 |
+
}
|
5554 |
+
};
|
5555 |
+
var syncWithRadiusType = function( radiusType ) {
|
5556 |
+
if ( ! _.contains( [ '_all_', 'top_left', 'top_right', 'bottom_right', 'bottom_left' ], radiusType ) ) {
|
5557 |
+
throw new Error( "Error in syncWithRadiusType : the radius type must be one of those values '_all_', 'top_left', 'top_right', 'bottom_right', 'bottom_left', => radius type => " + radiusType );
|
5558 |
+
}
|
5559 |
+
var inputVal = input(), inputValues = {}, clonedDefault = $.extend( true, {}, defaultVal );
|
5560 |
+
if ( _.isObject( inputVal ) ) {
|
5561 |
+
inputValues = $.extend( true, {}, inputVal );
|
5562 |
+
} else if ( _.isString( inputVal ) ) {
|
5563 |
+
inputValues = { _all_ : '0px' };
|
5564 |
+
}
|
5565 |
+
inputValues = $.extend( clonedDefault, inputValues );
|
5566 |
+
var _rawVal = getCurrentRadiusTypeOrAllValue( inputValues, radiusType ), _unit, _numberVal;
|
5567 |
+
if ( _.isEmpty( _rawVal ) || ! _.isString( _rawVal ) ) {
|
5568 |
+
throw new Error( "Error in syncWithRadiusType : getCurrentRadiusTypeOrAllValue must return a string like 3em");
|
5569 |
+
}
|
5570 |
+
|
5571 |
+
_unit = _extractUnit( _rawVal );
|
5572 |
+
_numberVal = _extractNumericVal( _rawVal );
|
5573 |
+
$('.sek-unit-wrapper', $wrapper).find('[data-sek-unit="' + _unit +'"]').trigger('click', { radius_type_switched : true });// We don't want to update the input()
|
5574 |
+
$wrapper.find( '.sek-ui-button[data-sek-unit="'+ _unit +'"]').addClass('is-selected').attr( 'aria-pressed', true );
|
5575 |
+
$numberInput.val( _numberVal ).trigger('input', { radius_type_switched : true });// We don't want to update the input()
|
5576 |
+
};
|
5577 |
+
input.css_unit = new api.Value( _.isEmpty( getInitialUnit() ) ? 'px' : validateUnit( getInitialUnit() ) );
|
5578 |
+
input.radiusType = new api.Value('_all_');
|
5579 |
+
$numberInput.val( getInitialRadius() );
|
5580 |
+
input.css_unit.bind( function( to, from, params ) {
|
5581 |
+
if ( _.isObject( params ) && ( true === params.radius_type_switched || true === params.initializing_the_unit ) )
|
5582 |
+
return;
|
5583 |
+
$numberInput.trigger('input', params);
|
5584 |
+
});
|
5585 |
+
input.radiusType.bind( function( radiusType ) {
|
5586 |
+
try { syncWithRadiusType( radiusType ); } catch( er ) {
|
5587 |
+
api.errare('Error when firing syncWithRadiusType for input type border_radius for module type ' + input.module.module_type , er );
|
5588 |
+
}
|
5589 |
+
});
|
5590 |
+
$rangeInput.on('input', function( evt ) {
|
5591 |
+
$numberInput.val( $(this).val() ).trigger('input');
|
5592 |
+
});
|
5593 |
+
$numberInput.on('input', function( evt, params ) {
|
5594 |
+
var currentRadiusType = input.radiusType() || '_all_',
|
5595 |
+
changedNumberInputVal = $(this).val() + validateUnit( input.css_unit() ),
|
5596 |
+
clonedDefaults = $.extend( true, {}, defaultVal ),
|
5597 |
+
_newInputVal;
|
5598 |
+
|
5599 |
+
_newInputVal = $.extend( true, {}, _.isObject( input() ) ? input() : clonedDefaults );
|
5600 |
+
_newInputVal[ currentRadiusType ] = $.extend( true, {}, _newInputVal[ currentRadiusType ] || clonedDefaults[ currentRadiusType ] );
|
5601 |
+
if ( ( _.isString( changedNumberInputVal ) && ! _.isEmpty( changedNumberInputVal ) ) ) {
|
5602 |
+
_newInputVal[ currentRadiusType ] = changedNumberInputVal;
|
5603 |
+
}
|
5604 |
+
if ( _.isEmpty( params ) || ( _.isObject( params ) && true !== params.radius_type_switched ) ) {
|
5605 |
+
if ( '_all_' === currentRadiusType ) {
|
5606 |
+
_.each( input.cssRadiusTypes, function( _type ) {
|
5607 |
+
_newInputVal = _.omit( _newInputVal, _type );
|
5608 |
+
});
|
5609 |
+
}
|
5610 |
+
input( _newInputVal );
|
5611 |
+
}
|
5612 |
+
$rangeInput.val( $(this).val() );
|
5613 |
+
});
|
5614 |
+
$wrapper.on( 'click', '[data-sek-unit]', function( evt, params ) {
|
5615 |
+
evt.preventDefault();
|
5616 |
+
$wrapper.find('[data-sek-unit]').removeClass('is-selected').attr( 'aria-pressed', false );
|
5617 |
+
$(this).addClass('is-selected').attr( 'aria-pressed', true );
|
5618 |
+
$wrapper.find('input[data-czrtype]').data('sek-unit', $(this).data('sek-unit') );
|
5619 |
+
input.css_unit( $(this).data('sek-unit'), params );
|
5620 |
+
});
|
5621 |
+
$wrapper.on( 'click', '[data-sek-radius-type]', function( evt, params ) {
|
5622 |
+
evt.preventDefault();
|
5623 |
+
$wrapper.find('[data-sek-radius-type]').removeClass('is-selected').attr( 'aria-pressed', false );
|
5624 |
+
$(this).addClass('is-selected').attr( 'aria-pressed', true );
|
5625 |
+
var border = '_all_';
|
5626 |
+
try { border = $(this).data('sek-radius-type'); } catch( er ) {
|
5627 |
+
api.errare( 'border_radius input type => error when attaching click event', er );
|
5628 |
+
}
|
5629 |
+
input.radiusType( border, params );
|
5630 |
+
});
|
5631 |
+
input.container.on( 'click', '.sek-reset-button', function( evt ) {
|
5632 |
+
var currentRadiusType = input.radiusType() || '_all_',
|
5633 |
+
_newVal = $.extend( true, {}, _.isObject( input() ) ? input() : {} );
|
5634 |
+
if ( !_.isEmpty( _newVal[ currentRadiusType ] ) ) {
|
5635 |
+
_newVal = _.omit( _newVal, currentRadiusType );
|
5636 |
+
input( _newVal );
|
5637 |
+
syncWithRadiusType( currentRadiusType );
|
5638 |
+
}
|
5639 |
+
});
|
5640 |
+
$rangeInput.val( $numberInput.val() || 0 );
|
5641 |
+
try { syncWithRadiusType( input.radiusType() ); } catch( er ) {
|
5642 |
+
api.errare('Error when firing syncWithRadiusType for input type border_radius for module type ' + input.module.module_type , er );
|
5643 |
+
}
|
5644 |
+
$( '[data-sek-unit="' + input.css_unit() + '"]', $wrapper ).trigger('click', { initializing_the_unit : true } );
|
5645 |
+
},
|
5646 |
+
|
5647 |
+
});//$.extend( api.czrInputMap, {})
|
5648 |
+
|
5649 |
+
|
5650 |
+
})( wp.customize, jQuery, _ );//global sektionsLocalizedData
|
5651 |
+
( function ( api, $, _ ) {
|
5652 |
+
api.czrInputMap = api.czrInputMap || {};
|
5653 |
+
$.extend( api.czrInputMap, {
|
5654 |
+
buttons_choice : function( params ) {
|
5655 |
+
var input = this,
|
5656 |
+
$wrapper = $('.sek-button-choice-wrapper', input.container ),
|
5657 |
+
$mainInput = $wrapper.find( 'input[type="number"]'),
|
5658 |
+
inputRegistrationParams = api.czr_sektions.getInputRegistrationParams( input.id, input.module.module_type ),
|
5659 |
+
defaultVal = ( ! _.isEmpty( inputRegistrationParams ) && ! _.isEmpty( inputRegistrationParams.default ) ) ? inputRegistrationParams.default : {};
|
5660 |
+
$mainInput.val( input() );
|
5661 |
+
$wrapper.on( 'click', '[data-sek-choice]', function( evt, params ) {
|
5662 |
+
evt.stopPropagation();
|
5663 |
+
$wrapper.find('[data-sek-choice]').removeClass('is-selected').attr( 'aria-pressed', false );
|
5664 |
+
$(this).addClass('is-selected').attr( 'aria-pressed', true );
|
5665 |
+
var newChoice;
|
5666 |
+
try { newChoice = $(this).data('sek-choice'); } catch( er ) {
|
5667 |
+
api.errare( 'buttons_choice input type => error when attaching click event', er );
|
5668 |
+
}
|
5669 |
+
input( newChoice );
|
5670 |
+
});
|
5671 |
+
$( '[data-sek-choice="' + input() + '"]', $wrapper ).trigger('click', { initializing_the_unit : true } );
|
5672 |
+
}
|
5673 |
+
});//$.extend( api.czrInputMap, {})
|
5674 |
+
})( wp.customize, jQuery, _ );//global sektionsLocalizedData
|
5675 |
+
( function ( api, $, _ ) {
|
5676 |
+
api.czrInputMap = api.czrInputMap || {};
|
5677 |
+
$.extend( api.czrInputMap, {
|
5678 |
+
reset_button : function( params ) {
|
5679 |
+
var input = this;
|
5680 |
+
input.container.on( 'click', '[data-sek-reset-scope]', function( evt, params ) {
|
5681 |
+
evt.stopPropagation();
|
5682 |
+
var scope = $(this).data( 'sek-reset-scope' );
|
5683 |
+
if ( 'local' === scope ) {
|
5684 |
+
try { api.czr_sektions.resetCollectionSetting(); } catch( er ) {
|
5685 |
+
api.errare( 'reset_button => error when firing resetCollectionSetting() on click event', er );
|
5686 |
+
}
|
5687 |
+
}
|
5688 |
+
});
|
5689 |
+
}
|
5690 |
+
});//$.extend( api.czrInputMap, {})
|
5691 |
+
})( wp.customize, jQuery, _ );//global sektionsLocalizedData, serverControlParams
|
5692 |
+
/* ------------------------------------------------------------------------- *
|
5693 |
+
* CONTENT TYPE SWITCHER
|
5694 |
+
/* ------------------------------------------------------------------------- */
|
5695 |
+
( function ( api, $, _ ) {
|
5696 |
+
api.czrModuleMap = api.czrModuleMap || {};
|
5697 |
+
$.extend( api.czrModuleMap, {
|
5698 |
+
sek_content_type_switcher_module : {
|
5699 |
+
crud : false,
|
5700 |
+
name : api.czr_sektions.getRegisteredModuleProperty( 'sek_content_type_switcher_module', 'name' ),
|
5701 |
+
has_mod_opt : false,
|
5702 |
+
ready_on_section_expanded : true,
|
5703 |
+
defaultItemModel : _.extend(
|
5704 |
+
{ id : '', title : '' },
|
5705 |
+
api.czr_sektions.getDefaultItemModelFromRegisteredModuleData( 'sek_content_type_switcher_module' )
|
5706 |
+
)
|
5707 |
+
},
|
5708 |
+
});
|
5709 |
+
|
5710 |
+
api.czrInputMap = api.czrInputMap || {};
|
5711 |
+
$.extend( api.czrInputMap, {
|
5712 |
+
content_type_switcher : function( input_options ) {
|
5713 |
+
var input = this,
|
5714 |
+
_section_;
|
5715 |
+
if ( ! api.section.has( input.module.control.section() ) ) {
|
5716 |
+
throw new Error( 'api.czrInputMap.content_type_switcher => section not registered' );
|
5717 |
+
}
|
5718 |
+
_section_ = api.section( input.module.control.section() );
|
5719 |
+
input.container.on('click', '[data-sek-content-type]', function( evt ) {
|
5720 |
+
evt.preventDefault();
|
5721 |
+
input.container.find('[data-sek-content-type]').removeClass('is-selected').attr( 'aria-pressed', false );
|
5722 |
+
$(this).addClass('is-selected').attr( 'aria-pressed', true );
|
5723 |
+
input.contentType( $(this).data( 'sek-content-type') );
|
5724 |
+
});
|
5725 |
+
|
5726 |
+
input.contentType = new api.Value();
|
5727 |
+
input.contentType.bind( function( contentType ) {
|
5728 |
+
input.container.find( '[data-sek-content-type="' + input.contentType() + '"]').trigger('click');
|
5729 |
+
_.each( _section_.controls(), function( _control_ ) {
|
5730 |
+
if ( ! _.isUndefined( _control_.content_type ) ) {
|
5731 |
+
_control_.active( contentType === _control_.content_type );
|
5732 |
+
}
|
5733 |
+
});
|
5734 |
+
});
|
5735 |
+
input.contentType( input() );
|
5736 |
+
_section_.container.first().bind( 'sek-content-type-refreshed', function( evt, param ){
|
5737 |
+
input.contentType( param.content_type || 'section' );
|
5738 |
+
});
|
5739 |
+
|
5740 |
+
}
|
5741 |
+
});
|
5742 |
+
})( wp.customize , jQuery, _ );
|
5743 |
+
|
5744 |
+
|
5745 |
+
|
5746 |
+
|
5747 |
+
|
5748 |
+
/* ------------------------------------------------------------------------- *
|
5749 |
+
* MODULE PICKER MODULE
|
5750 |
+
/* ------------------------------------------------------------------------- */
|
5751 |
+
( function ( api, $, _ ) {
|
5752 |
+
api.czrModuleMap = api.czrModuleMap || {};
|
5753 |
+
$.extend( api.czrModuleMap, {
|
5754 |
+
sek_module_picker_module : {
|
5755 |
+
crud : false,
|
5756 |
+
name : api.czr_sektions.getRegisteredModuleProperty( 'sek_module_picker_module', 'name' ),
|
5757 |
+
has_mod_opt : false,
|
5758 |
+
ready_on_section_expanded : true,
|
5759 |
+
defaultItemModel : _.extend(
|
5760 |
+
{ id : '', title : '' },
|
5761 |
+
api.czr_sektions.getDefaultItemModelFromRegisteredModuleData( 'sek_module_picker_module' )
|
5762 |
+
)
|
5763 |
+
},
|
5764 |
+
});
|
5765 |
+
|
5766 |
+
api.czrInputMap = api.czrInputMap || {};
|
5767 |
+
$.extend( api.czrInputMap, {
|
5768 |
+
module_picker : function( input_options ) {
|
5769 |
+
var input = this;
|
5770 |
+
api.czr_sektions.trigger( 'sek-refresh-dragzones', { type : 'module', input_container : input.container } );
|
5771 |
+
}
|
5772 |
+
});
|
5773 |
+
})( wp.customize , jQuery, _ );
|
5774 |
+
|
5775 |
+
|
5776 |
+
|
5777 |
+
/* ------------------------------------------------------------------------- *
|
5778 |
+
* SECTION PICKER MODULES
|
5779 |
+
/* ------------------------------------------------------------------------- */
|
5780 |
+
( function ( api, $, _ ) {
|
5781 |
+
api.czrModuleMap = api.czrModuleMap || {};
|
5782 |
+
_.each([
|
5783 |
+
'sek_intro_sec_picker_module',
|
5784 |
+
'sek_features_sec_picker_module',
|
5785 |
+
'sek_column_layouts_sec_picker_module'
|
5786 |
+
], function( module_type ) {
|
5787 |
+
api.czrModuleMap[ module_type ] = {
|
5788 |
+
crud : false,
|
5789 |
+
name : api.czr_sektions.getRegisteredModuleProperty( module_type, 'name' ),
|
5790 |
+
has_mod_opt : false,
|
5791 |
+
ready_on_section_expanded : true,
|
5792 |
+
defaultItemModel : _.extend(
|
5793 |
+
{ id : '', title : '' },
|
5794 |
+
api.czr_sektions.getDefaultItemModelFromRegisteredModuleData( module_type )
|
5795 |
+
)
|
5796 |
+
};
|
5797 |
+
});
|
5798 |
+
|
5799 |
+
|
5800 |
+
api.czrInputMap = api.czrInputMap || {};
|
5801 |
+
$.extend( api.czrInputMap, {
|
5802 |
+
section_picker : function( input_options ) {
|
5803 |
+
var input = this;
|
5804 |
+
api.czr_sektions.trigger( 'sek-refresh-dragzones', { type : 'preset_section', input_container : input.container } );
|
5805 |
+
}
|
5806 |
+
});
|
5807 |
+
})( wp.customize , jQuery, _ );//global sektionsLocalizedData, serverControlParams
|
5808 |
+
( function ( api, $, _ ) {
|
5809 |
+
api.czrModuleMap = api.czrModuleMap || {};
|
5810 |
+
$.extend( api.czrModuleMap, {
|
5811 |
+
sek_level_anchor_module : {
|
5812 |
+
crud : false,
|
5813 |
+
name : api.czr_sektions.getRegisteredModuleProperty( 'sek_level_anchor_module', 'name' ),
|
5814 |
+
has_mod_opt : false,
|
5815 |
+
ready_on_section_expanded : true,
|
5816 |
+
defaultItemModel : _.extend(
|
5817 |
+
{ id : '', title : '' },
|
5818 |
+
api.czr_sektions.getDefaultItemModelFromRegisteredModuleData( 'sek_level_anchor_module' )
|
5819 |
+
)
|
5820 |
+
},
|
5821 |
+
});
|
5822 |
+
})( wp.customize , jQuery, _ );//global sektionsLocalizedData, serverControlParams
|
5823 |
+
( function ( api, $, _ ) {
|
5824 |
+
var Constructor = {
|
5825 |
+
initialize: function( id, options ) {
|
5826 |
+
var module = this;
|
5827 |
+
module.inputConstructor = api.CZRInput.extend( module.CZRInputMths || {} );
|
5828 |
+
module.itemConstructor = api.CZRItem.extend( module.CZRItemConstructor || {} );
|
5829 |
+
api.CZRDynModule.prototype.initialize.call( module, id, options );
|
5830 |
+
},//initialize
|
5831 |
+
|
5832 |
+
|
5833 |
+
CZRInputMths : {
|
5834 |
+
setupSelect : function() {
|
5835 |
+
api.czr_sektions.setupSelectInput.call( this );
|
5836 |
+
}
|
5837 |
+
},//CZRInputMths
|
5838 |
+
|
5839 |
+
CZRItemConstructor : {
|
5840 |
+
ready : function() {
|
5841 |
+
var item = this;
|
5842 |
+
item.inputCollection.bind( function( col ) {
|
5843 |
+
if( _.isEmpty( col ) )
|
5844 |
+
return;
|
5845 |
+
try { item.setInputVisibilityDeps(); } catch( er ) {
|
5846 |
+
api.errorLog( 'item.setInputVisibilityDeps() : ' + er );
|
5847 |
+
}
|
5848 |
+
});//item.inputCollection.bind()
|
5849 |
+
api.CZRItem.prototype.ready.call( item );
|
5850 |
+
},
|
5851 |
+
setInputVisibilityDeps : function() {
|
5852 |
+
var item = this,
|
5853 |
+
module = item.module;
|
5854 |
+
var scheduleVisibilityOfInputId = function( controlledInputId, visibilityCallBack ) {
|
5855 |
+
item.czr_Input( controlledInputId ).visible( visibilityCallBack() );
|
5856 |
+
this.bind( function( to ) {
|
5857 |
+
item.czr_Input( controlledInputId ).visible( visibilityCallBack() );
|
5858 |
+
});
|
5859 |
+
};
|
5860 |
+
item.czr_Input.each( function( input ) {
|
5861 |
+
switch( input.id ) {
|
5862 |
+
case 'bg-image' :
|
5863 |
+
_.each( [ 'bg-position', 'bg-attachment', 'bg-scale', 'bg-apply-overlay', 'bg-color-overlay', 'bg-opacity-overlay' ] , function( _inputId_ ) {
|
5864 |
+
try { scheduleVisibilityOfInputId.call( input, _inputId_, function() {
|
5865 |
+
var bool = false;
|
5866 |
+
switch( _inputId_ ) {
|
5867 |
+
case 'bg-color-overlay' :
|
5868 |
+
case 'bg-opacity-overlay' :
|
5869 |
+
bool = ! _.isEmpty( input() + '' ) && api.CZR_Helpers.isChecked( item.czr_Input('bg-apply-overlay')() );
|
5870 |
+
break;
|
5871 |
+
default :
|
5872 |
+
bool = ! _.isEmpty( input() + '' );
|
5873 |
+
break;
|
5874 |
+
}
|
5875 |
+
return bool;
|
5876 |
+
}); } catch( er ) {
|
5877 |
+
api.errare( module.id + ' => error in setInputVisibilityDeps', er );
|
5878 |
+
}
|
5879 |
+
});
|
5880 |
+
break;
|
5881 |
+
case 'bg-apply-overlay' :
|
5882 |
+
_.each( [ 'bg-color-overlay', 'bg-opacity-overlay' ] , function(_inputId_ ) {
|
5883 |
+
try { scheduleVisibilityOfInputId.call( input, _inputId_, function() {
|
5884 |
+
return ! _.isEmpty( item.czr_Input('bg-image')() + '' ) && api.CZR_Helpers.isChecked( input() );
|
5885 |
+
}); } catch( er ) {
|
5886 |
+
api.errare( module.id + ' => error in setInputVisibilityDeps', er );
|
5887 |
+
}
|
5888 |
+
});
|
5889 |
+
break;
|
5890 |
+
}
|
5891 |
+
});
|
5892 |
+
}
|
5893 |
+
}//CZRItemConstructor
|
5894 |
+
};
|
5895 |
+
api.czrModuleMap = api.czrModuleMap || {};
|
5896 |
+
$.extend( api.czrModuleMap, {
|
5897 |
+
sek_level_bg_module : {
|
5898 |
+
mthds : Constructor,
|
5899 |
+
crud : false,
|
5900 |
+
name : api.czr_sektions.getRegisteredModuleProperty( 'sek_level_bg_module', 'name' ),
|
5901 |
+
has_mod_opt : false,
|
5902 |
+
ready_on_section_expanded : true,
|
5903 |
+
defaultItemModel : _.extend(
|
5904 |
+
{ id : '', title : '' },
|
5905 |
+
api.czr_sektions.getDefaultItemModelFromRegisteredModuleData( 'sek_level_bg_module' )
|
5906 |
+
)
|
5907 |
+
},
|
5908 |
+
});
|
5909 |
+
})( wp.customize , jQuery, _ );//global sektionsLocalizedData, serverControlParams
|
5910 |
+
( function ( api, $, _ ) {
|
5911 |
+
var Constructor = {
|
5912 |
+
initialize: function( id, options ) {
|
5913 |
+
var module = this;
|
5914 |
+
module.inputConstructor = api.CZRInput.extend( module.CZRInputMths || {} );
|
5915 |
+
module.itemConstructor = api.CZRItem.extend( module.CZRItemConstructor || {} );
|
5916 |
+
api.CZRDynModule.prototype.initialize.call( module, id, options );
|
5917 |
+
},//initialize
|
5918 |
+
|
5919 |
+
|
5920 |
+
CZRInputMths : {
|
5921 |
+
setupSelect : function() {
|
5922 |
+
api.czr_sektions.setupSelectInput.call( this );
|
5923 |
+
}
|
5924 |
+
},//CZRInputMths
|
5925 |
+
|
5926 |
+
CZRItemConstructor : {
|
5927 |
+
ready : function() {
|
5928 |
+
var item = this;
|
5929 |
+
item.inputCollection.bind( function( col ) {
|
5930 |
+
if( _.isEmpty( col ) )
|
5931 |
+
return;
|
5932 |
+
try { item.setInputVisibilityDeps(); } catch( er ) {
|
5933 |
+
api.errorLog( 'item.setInputVisibilityDeps() : ' + er );
|
5934 |
+
}
|
5935 |
+
});//item.inputCollection.bind()
|
5936 |
+
api.CZRItem.prototype.ready.call( item );
|
5937 |
+
},
|
5938 |
+
setInputVisibilityDeps : function() {
|
5939 |
+
var item = this,
|
5940 |
+
module = item.module;
|
5941 |
+
var scheduleVisibilityOfInputId = function( controlledInputId, visibilityCallBack ) {
|
5942 |
+
item.czr_Input( controlledInputId ).visible( visibilityCallBack() );
|
5943 |
+
this.bind( function( to ) {
|
5944 |
+
item.czr_Input( controlledInputId ).visible( visibilityCallBack() );
|
5945 |
+
});
|
5946 |
+
};
|
5947 |
+
item.czr_Input.each( function( input ) {
|
5948 |
+
switch( input.id ) {
|
5949 |
+
case 'border-type' :
|
5950 |
+
_.each( [ 'borders' ] , function(_inputId_ ) {
|
5951 |
+
try { scheduleVisibilityOfInputId.call( input, _inputId_, function() {
|
5952 |
+
return 'none' !== input();
|
5953 |
+
}); } catch( er ) {
|
5954 |
+
api.errare( module.id + ' => error in setInputVisibilityDeps', er );
|
5955 |
+
}
|
5956 |
+
});
|
5957 |
+
break;
|
5958 |
+
}
|
5959 |
+
});
|
5960 |
+
}
|
5961 |
+
}//CZRItemConstructor
|
5962 |
+
};
|
5963 |
+
api.czrModuleMap = api.czrModuleMap || {};
|
5964 |
+
$.extend( api.czrModuleMap, {
|
5965 |
+
sek_level_border_module : {
|
5966 |
+
mthds : Constructor,
|
5967 |
+
crud : false,
|
5968 |
+
name : api.czr_sektions.getRegisteredModuleProperty( 'sek_level_border_module', 'name' ),
|
5969 |
+
has_mod_opt : false,
|
5970 |
+
ready_on_section_expanded : true,
|
5971 |
+
defaultItemModel : _.extend(
|
5972 |
+
{ id : '', title : '' },
|
5973 |
+
api.czr_sektions.getDefaultItemModelFromRegisteredModuleData( 'sek_level_border_module' )
|
5974 |
+
)
|
5975 |
+
},
|
5976 |
+
});
|
5977 |
+
})( wp.customize , jQuery, _ );//global sektionsLocalizedData, serverControlParams
|
5978 |
+
( function ( api, $, _ ) {
|
5979 |
+
var Constructor = {
|
5980 |
+
initialize: function( id, options ) {
|
5981 |
+
var module = this;
|
5982 |
+
module.itemConstructor = api.CZRItem.extend( module.CZRItemConstructor || {} );
|
5983 |
+
api.CZRDynModule.prototype.initialize.call( module, id, options );
|
5984 |
+
|
5985 |
+
},//initialize
|
5986 |
+
|
5987 |
+
CZRItemConstructor : {
|
5988 |
+
ready : function() {
|
5989 |
+
var item = this;
|
5990 |
+
item.inputCollection.bind( function( col ) {
|
5991 |
+
if( _.isEmpty( col ) )
|
5992 |
+
return;
|
5993 |
+
try { item.setInputVisibilityDeps(); } catch( er ) {
|
5994 |
+
api.errorLog( 'item.setInputVisibilityDeps() : ' + er );
|
5995 |
+
}
|
5996 |
+
});//item.inputCollection.bind()
|
5997 |
+
api.CZRItem.prototype.ready.call( item );
|
5998 |
+
},
|
5999 |
+
setInputVisibilityDeps : function() {
|
6000 |
+
var item = this,
|
6001 |
+
module = item.module;
|
6002 |
+
var scheduleVisibilityOfInputId = function( controlledInputId, visibilityCallBack ) {
|
6003 |
+
item.czr_Input( controlledInputId ).visible( visibilityCallBack() );
|
6004 |
+
this.bind( function( to ) {
|
6005 |
+
item.czr_Input( controlledInputId ).visible( visibilityCallBack() );
|
6006 |
+
});
|
6007 |
+
};
|
6008 |
+
item.czr_Input.each( function( input ) {
|
6009 |
+
switch( input.id ) {
|
6010 |
+
case 'use-custom-breakpoint' :
|
6011 |
+
scheduleVisibilityOfInputId.call( input, 'custom-breakpoint', function() {
|
6012 |
+
return input();
|
6013 |
+
});
|
6014 |
+
break;
|
6015 |
+
}
|
6016 |
+
});
|
6017 |
+
}
|
6018 |
+
}//CZRItemConstructor
|
6019 |
+
};
|
6020 |
+
api.czrModuleMap = api.czrModuleMap || {};
|
6021 |
+
$.extend( api.czrModuleMap, {
|
6022 |
+
sek_level_breakpoint_module : {
|
6023 |
+
mthds : Constructor,
|
6024 |
+
crud : false,
|
6025 |
+
name : api.czr_sektions.getRegisteredModuleProperty( 'sek_level_breakpoint_module', 'name' ),
|
6026 |
+
has_mod_opt : false,
|
6027 |
+
ready_on_section_expanded : true,
|
6028 |
+
defaultItemModel : _.extend(
|
6029 |
+
{ id : '', title : '' },
|
6030 |
+
api.czr_sektions.getDefaultItemModelFromRegisteredModuleData( 'sek_level_breakpoint_module' )
|
6031 |
+
)
|
6032 |
+
},
|
6033 |
+
});
|
6034 |
+
})( wp.customize , jQuery, _ );//global sektionsLocalizedData, serverControlParams
|
6035 |
+
( function ( api, $, _ ) {
|
6036 |
+
var Constructor = {
|
6037 |
+
initialize: function( id, options ) {
|
6038 |
+
var module = this;
|
6039 |
+
module.inputConstructor = api.CZRInput.extend( module.CZRInputMths || {} );
|
6040 |
+
module.itemConstructor = api.CZRItem.extend( module.CZRItemConstructor || {} );
|
6041 |
+
api.CZRDynModule.prototype.initialize.call( module, id, options );
|
6042 |
+
|
6043 |
+
},//initialize
|
6044 |
+
|
6045 |
+
CZRInputMths : {
|
6046 |
+
setupSelect : function() {
|
6047 |
+
api.czr_sektions.setupSelectInput.call( this );
|
6048 |
+
}
|
6049 |
+
},//CZRInputMths
|
6050 |
+
|
6051 |
+
CZRItemConstructor : {
|
6052 |
+
ready : function() {
|
6053 |
+
var item = this;
|
6054 |
+
item.inputCollection.bind( function( col ) {
|
6055 |
+
if( _.isEmpty( col ) )
|
6056 |
+
return;
|
6057 |
+
try { item.setInputVisibilityDeps(); } catch( er ) {
|
6058 |
+
api.errorLog( 'item.setInputVisibilityDeps() : ' + er );
|
6059 |
+
}
|
6060 |
+
});//item.inputCollection.bind()
|
6061 |
+
api.CZRItem.prototype.ready.call( item );
|
6062 |
+
},
|
6063 |
+
setInputVisibilityDeps : function() {
|
6064 |
+
var item = this,
|
6065 |
+
module = item.module;
|
6066 |
+
var scheduleVisibilityOfInputId = function( controlledInputId, visibilityCallBack ) {
|
6067 |
+
item.czr_Input( controlledInputId ).visible( visibilityCallBack() );
|
6068 |
+
this.bind( function( to ) {
|
6069 |
+
item.czr_Input( controlledInputId ).visible( visibilityCallBack() );
|
6070 |
+
});
|
6071 |
+
};
|
6072 |
+
item.czr_Input.each( function( input ) {
|
6073 |
+
switch( input.id ) {
|
6074 |
+
case 'height-type' :
|
6075 |
+
scheduleVisibilityOfInputId.call( input, 'custom-height', function() {
|
6076 |
+
return 'custom' === input();
|
6077 |
+
});
|
6078 |
+
break;
|
6079 |
+
}
|
6080 |
+
});
|
6081 |
+
}
|
6082 |
+
}//CZRItemConstructor
|
6083 |
+
};
|
6084 |
+
api.czrModuleMap = api.czrModuleMap || {};
|
6085 |
+
$.extend( api.czrModuleMap, {
|
6086 |
+
sek_level_height_module : {
|
6087 |
+
mthds : Constructor,
|
6088 |
+
crud : false,
|
6089 |
+
name : api.czr_sektions.getRegisteredModuleProperty( 'sek_level_height_module', 'name' ),
|
6090 |
+
has_mod_opt : false,
|
6091 |
+
ready_on_section_expanded : true,
|
6092 |
+
defaultItemModel : _.extend(
|
6093 |
+
{ id : '', title : '' },
|
6094 |
+
api.czr_sektions.getDefaultItemModelFromRegisteredModuleData( 'sek_level_height_module' )
|
6095 |
+
)
|
6096 |
+
},
|
6097 |
+
});
|
6098 |
+
})( wp.customize , jQuery, _ );//global sektionsLocalizedData, serverControlParams
|
6099 |
+
( function ( api, $, _ ) {
|
6100 |
+
api.czrModuleMap = api.czrModuleMap || {};
|
6101 |
+
$.extend( api.czrModuleMap, {
|
6102 |
+
sek_level_visibility_module : {
|
6103 |
+
crud : false,
|
6104 |
+
name : api.czr_sektions.getRegisteredModuleProperty( 'sek_level_visibility_module', 'name' ),
|
6105 |
+
has_mod_opt : false,
|
6106 |
+
ready_on_section_expanded : true,
|
6107 |
+
defaultItemModel : _.extend(
|
6108 |
+
{ id : '', title : '' },
|
6109 |
+
api.czr_sektions.getDefaultItemModelFromRegisteredModuleData( 'sek_level_visibility_module' )
|
6110 |
+
)
|
6111 |
+
},
|
6112 |
+
});
|
6113 |
+
})( wp.customize , jQuery, _ );//global sektionsLocalizedData, serverControlParams
|
6114 |
+
( function ( api, $, _ ) {
|
6115 |
+
var Constructor = {
|
6116 |
+
initialize: function( id, options ) {
|
6117 |
+
var module = this;
|
6118 |
+
module.inputConstructor = api.CZRInput.extend( module.CZRInputMths || {} );
|
6119 |
+
module.itemConstructor = api.CZRItem.extend( module.CZRItemConstructor || {} );
|
6120 |
+
api.CZRDynModule.prototype.initialize.call( module, id, options );
|
6121 |
+
|
6122 |
+
},//initialize
|
6123 |
+
|
6124 |
+
CZRInputMths : {
|
6125 |
+
setupSelect : function() {
|
6126 |
+
api.czr_sektions.setupSelectInput.call( this );
|
6127 |
+
}
|
6128 |
+
},//CZRInputMths
|
6129 |
+
|
6130 |
+
CZRItemConstructor : {
|
6131 |
+
ready : function() {
|
6132 |
+
var item = this;
|
6133 |
+
item.inputCollection.bind( function( col ) {
|
6134 |
+
if( _.isEmpty( col ) )
|
6135 |
+
return;
|
6136 |
+
try { item.setInputVisibilityDeps(); } catch( er ) {
|
6137 |
+
api.errorLog( 'item.setInputVisibilityDeps() : ' + er );
|
6138 |
+
}
|
6139 |
+
});//item.inputCollection.bind()
|
6140 |
+
api.CZRItem.prototype.ready.call( item );
|
6141 |
+
},
|
6142 |
+
setInputVisibilityDeps : function() {
|
6143 |
+
var item = this,
|
6144 |
+
module = item.module;
|
6145 |
+
var scheduleVisibilityOfInputId = function( controlledInputId, visibilityCallBack ) {
|
6146 |
+
item.czr_Input( controlledInputId ).visible( visibilityCallBack() );
|
6147 |
+
this.bind( function( to ) {
|
6148 |
+
item.czr_Input( controlledInputId ).visible( visibilityCallBack() );
|
6149 |
+
});
|
6150 |
+
};
|
6151 |
+
item.czr_Input.each( function( input ) {
|
6152 |
+
switch( input.id ) {
|
6153 |
+
case 'width-type' :
|
6154 |
+
scheduleVisibilityOfInputId.call( input, 'custom-width', function() {
|
6155 |
+
return 'custom' === input();
|
6156 |
+
});
|
6157 |
+
scheduleVisibilityOfInputId.call( input, 'h_alignment', function() {
|
6158 |
+
return 'custom' === input();
|
6159 |
+
});
|
6160 |
+
break;
|
6161 |
+
}
|
6162 |
+
});
|
6163 |
+
}
|
6164 |
+
}//CZRItemConstructor
|
6165 |
+
};
|
6166 |
+
api.czrModuleMap = api.czrModuleMap || {};
|
6167 |
+
$.extend( api.czrModuleMap, {
|
6168 |
+
sek_level_width_module : {
|
6169 |
+
mthds : Constructor,
|
6170 |
+
crud : false,
|
6171 |
+
name : api.czr_sektions.getRegisteredModuleProperty( 'sek_level_width_module', 'name' ),
|
6172 |
+
has_mod_opt : false,
|
6173 |
+
ready_on_section_expanded : true,
|
6174 |
+
defaultItemModel : _.extend(
|
6175 |
+
{ id : '', title : '' },
|
6176 |
+
api.czr_sektions.getDefaultItemModelFromRegisteredModuleData( 'sek_level_width_module' )
|
6177 |
+
)
|
6178 |
+
},
|
6179 |
+
});
|
6180 |
+
})( wp.customize , jQuery, _ );//global sektionsLocalizedData, serverControlParams
|
6181 |
+
( function ( api, $, _ ) {
|
6182 |
+
var Constructor = {
|
6183 |
+
initialize: function( id, options ) {
|
6184 |
+
var module = this;
|
6185 |
+
module.inputConstructor = api.CZRInput.extend( module.CZRInputMths || {} );
|
6186 |
+
module.itemConstructor = api.CZRItem.extend( module.CZRItemConstructor || {} );
|
6187 |
+
api.CZRDynModule.prototype.initialize.call( module, id, options );
|
6188 |
|
6189 |
+
},//initialize
|
|
|
6190 |
|
6191 |
+
CZRInputMths : {
|
6192 |
+
setupSelect : function() {
|
6193 |
+
api.czr_sektions.setupSelectInput.call( this );
|
6194 |
+
}
|
6195 |
+
},//CZRInputMths
|
6196 |
+
|
6197 |
+
CZRItemConstructor : {
|
6198 |
+
ready : function() {
|
6199 |
+
var item = this;
|
6200 |
+
item.inputCollection.bind( function( col ) {
|
6201 |
+
if( _.isEmpty( col ) )
|
6202 |
+
return;
|
6203 |
+
try { item.setInputVisibilityDeps(); } catch( er ) {
|
6204 |
+
api.errorLog( 'item.setInputVisibilityDeps() : ' + er );
|
6205 |
+
}
|
6206 |
+
});//item.inputCollection.bind()
|
6207 |
+
api.CZRItem.prototype.ready.call( item );
|
6208 |
+
},
|
6209 |
+
setInputVisibilityDeps : function() {
|
6210 |
+
var item = this,
|
6211 |
+
module = item.module;
|
6212 |
+
var scheduleVisibilityOfInputId = function( controlledInputId, visibilityCallBack ) {
|
6213 |
+
item.czr_Input( controlledInputId ).visible( visibilityCallBack() );
|
6214 |
+
this.bind( function( to ) {
|
6215 |
+
item.czr_Input( controlledInputId ).visible( visibilityCallBack() );
|
6216 |
+
});
|
6217 |
+
};
|
6218 |
+
item.czr_Input.each( function( input ) {
|
6219 |
+
switch( input.id ) {
|
6220 |
+
case 'use-custom-outer-width' :
|
6221 |
+
scheduleVisibilityOfInputId.call( input, 'outer-section-width', function() {
|
6222 |
+
return input();
|
6223 |
+
});
|
6224 |
+
break;
|
6225 |
+
case 'use-custom-inner-width' :
|
6226 |
+
scheduleVisibilityOfInputId.call( input, 'inner-section-width', function() {
|
6227 |
+
return input();
|
6228 |
+
});
|
6229 |
+
break;
|
6230 |
+
}
|
6231 |
+
});
|
6232 |
+
}
|
6233 |
+
}//CZRItemConstructor
|
6234 |
+
};
|
6235 |
+
api.czrModuleMap = api.czrModuleMap || {};
|
6236 |
+
$.extend( api.czrModuleMap, {
|
6237 |
+
sek_level_width_section : {
|
6238 |
+
mthds : Constructor,
|
6239 |
+
crud : false,
|
6240 |
+
name : api.czr_sektions.getRegisteredModuleProperty( 'sek_level_width_section', 'name' ),
|
6241 |
+
has_mod_opt : false,
|
6242 |
+
ready_on_section_expanded : true,
|
6243 |
+
defaultItemModel : _.extend(
|
6244 |
+
{ id : '', title : '' },
|
6245 |
+
api.czr_sektions.getDefaultItemModelFromRegisteredModuleData( 'sek_level_width_section' )
|
6246 |
+
)
|
6247 |
+
},
|
6248 |
+
});
|
6249 |
+
})( wp.customize , jQuery, _ );//global sektionsLocalizedData, serverControlParams
|
6250 |
+
( function ( api, $, _ ) {
|
6251 |
+
api.czrModuleMap = api.czrModuleMap || {};
|
6252 |
+
$.extend( api.czrModuleMap, {
|
6253 |
+
sek_level_spacing_module : {
|
6254 |
+
mthds : '',
|
6255 |
+
crud : false,
|
6256 |
+
name : api.czr_sektions.getRegisteredModuleProperty( 'sek_level_spacing_module', 'name' ),
|
6257 |
+
has_mod_opt : false,
|
6258 |
+
ready_on_section_expanded : true,
|
6259 |
+
defaultItemModel : _.extend(
|
6260 |
+
{ id : '', title : '' },
|
6261 |
+
api.czr_sektions.getDefaultItemModelFromRegisteredModuleData( 'sek_level_spacing_module' )
|
6262 |
+
)
|
6263 |
+
},
|
6264 |
+
});
|
6265 |
+
})( wp.customize , jQuery, _ );
|
6266 |
+
( function ( api, $, _ ) {
|
6267 |
+
var Constructor = {
|
6268 |
+
initialize: function( id, options ) {
|
6269 |
+
var module = this;
|
6270 |
+
module.inputConstructor = api.CZRInput.extend({
|
6271 |
+
setupSelect : function() {
|
6272 |
+
api.czr_sektions.setupSelectInput.call( this );
|
6273 |
+
}
|
6274 |
+
});
|
6275 |
+
api.CZRDynModule.prototype.initialize.call( module, id, options );
|
6276 |
+
|
6277 |
+
}//initialize
|
6278 |
+
};
|
6279 |
+
api.czrModuleMap = api.czrModuleMap || {};
|
6280 |
+
$.extend( api.czrModuleMap, {
|
6281 |
+
sek_local_template : {
|
6282 |
+
mthds : Constructor,
|
6283 |
+
crud : false,
|
6284 |
+
name : api.czr_sektions.getRegisteredModuleProperty( 'sek_local_template', 'name' ),
|
6285 |
+
has_mod_opt : false,
|
6286 |
+
ready_on_section_expanded : true,
|
6287 |
+
defaultItemModel : _.extend(
|
6288 |
+
{ id : '', title : '' },
|
6289 |
+
api.czr_sektions.getDefaultItemModelFromRegisteredModuleData( 'sek_local_template' )
|
6290 |
+
)
|
6291 |
+
},
|
6292 |
+
});
|
6293 |
+
})( wp.customize , jQuery, _ );//global sektionsLocalizedData, serverControlParams
|
6294 |
+
( function ( api, $, _ ) {
|
6295 |
+
var Constructor = {
|
6296 |
+
initialize: function( id, options ) {
|
6297 |
+
var module = this;
|
6298 |
+
module.inputConstructor = api.CZRInput.extend({
|
6299 |
+
setupSelect : function() {
|
6300 |
+
api.czr_sektions.setupSelectInput.call( this );
|
6301 |
+
}
|
6302 |
+
});
|
6303 |
+
module.itemConstructor = api.CZRItem.extend( module.CZRItemConstructor || {} );
|
6304 |
+
api.CZRDynModule.prototype.initialize.call( module, id, options );
|
6305 |
+
|
6306 |
+
},//initialize
|
6307 |
+
|
6308 |
+
CZRItemConstructor : {
|
6309 |
+
ready : function() {
|
6310 |
+
var item = this;
|
6311 |
+
item.inputCollection.bind( function( col ) {
|
6312 |
+
if( _.isEmpty( col ) )
|
6313 |
+
return;
|
6314 |
+
try { item.setInputVisibilityDeps(); } catch( er ) {
|
6315 |
+
api.errorLog( 'item.setInputVisibilityDeps() : ' + er );
|
6316 |
+
}
|
6317 |
+
});//item.inputCollection.bind()
|
6318 |
+
api.CZRItem.prototype.ready.call( item );
|
6319 |
+
},
|
6320 |
+
setInputVisibilityDeps : function() {
|
6321 |
+
var item = this,
|
6322 |
+
module = item.module;
|
6323 |
+
var scheduleVisibilityOfInputId = function( controlledInputId, visibilityCallBack ) {
|
6324 |
+
item.czr_Input( controlledInputId ).visible( visibilityCallBack() );
|
6325 |
+
this.bind( function( to ) {
|
6326 |
+
item.czr_Input( controlledInputId ).visible( visibilityCallBack() );
|
6327 |
+
});
|
6328 |
+
};
|
6329 |
+
item.czr_Input.each( function( input ) {
|
6330 |
+
switch( input.id ) {
|
6331 |
+
case 'use-custom-outer-width' :
|
6332 |
+
scheduleVisibilityOfInputId.call( input, 'outer-section-width', function() {
|
6333 |
+
return input();
|
6334 |
+
});
|
6335 |
+
break;
|
6336 |
+
case 'use-custom-inner-width' :
|
6337 |
+
scheduleVisibilityOfInputId.call( input, 'inner-section-width', function() {
|
6338 |
+
return input();
|
6339 |
+
});
|
6340 |
+
break;
|
6341 |
+
}
|
6342 |
+
});
|
6343 |
+
}
|
6344 |
+
}//CZRItemConstructor
|
6345 |
+
};
|
6346 |
+
api.czrModuleMap = api.czrModuleMap || {};
|
6347 |
+
$.extend( api.czrModuleMap, {
|
6348 |
+
sek_local_widths : {
|
6349 |
+
mthds : Constructor,
|
6350 |
+
crud : false,
|
6351 |
+
name : api.czr_sektions.getRegisteredModuleProperty( 'sek_local_widths', 'name' ),
|
6352 |
+
has_mod_opt : false,
|
6353 |
+
ready_on_section_expanded : true,
|
6354 |
+
defaultItemModel : _.extend(
|
6355 |
+
{ id : '', title : '' },
|
6356 |
+
api.czr_sektions.getDefaultItemModelFromRegisteredModuleData( 'sek_local_widths' )
|
6357 |
+
)
|
6358 |
+
},
|
6359 |
+
});
|
6360 |
+
})( wp.customize , jQuery, _ );//global sektionsLocalizedData, serverControlParams
|
6361 |
+
( function ( api, $, _ ) {
|
6362 |
+
api.czrModuleMap = api.czrModuleMap || {};
|
6363 |
+
$.extend( api.czrModuleMap, {
|
6364 |
+
sek_local_custom_css : {
|
6365 |
+
crud : false,
|
6366 |
+
name : api.czr_sektions.getRegisteredModuleProperty( 'sek_local_custom_css', 'name' ),
|
6367 |
+
has_mod_opt : false,
|
6368 |
+
ready_on_section_expanded : true,
|
6369 |
+
defaultItemModel : _.extend(
|
6370 |
+
{ id : '', title : '' },
|
6371 |
+
api.czr_sektions.getDefaultItemModelFromRegisteredModuleData( 'sek_local_custom_css' )
|
6372 |
+
)
|
6373 |
+
},
|
6374 |
+
});
|
6375 |
+
})( wp.customize , jQuery, _ );//global sektionsLocalizedData, serverControlParams
|
6376 |
+
( function ( api, $, _ ) {
|
6377 |
+
api.czrModuleMap = api.czrModuleMap || {};
|
6378 |
+
$.extend( api.czrModuleMap, {
|
6379 |
+
sek_local_reset : {
|
6380 |
+
crud : false,
|
6381 |
+
name : api.czr_sektions.getRegisteredModuleProperty( 'sek_local_reset', 'name' ),
|
6382 |
+
has_mod_opt : false,
|
6383 |
+
ready_on_section_expanded : true,
|
6384 |
+
defaultItemModel : _.extend(
|
6385 |
+
{ id : '', title : '' },
|
6386 |
+
api.czr_sektions.getDefaultItemModelFromRegisteredModuleData( 'sek_local_reset' )
|
6387 |
+
)
|
6388 |
+
},
|
6389 |
+
});
|
6390 |
+
})( wp.customize , jQuery, _ );//global sektionsLocalizedData, serverControlParams
|
6391 |
+
( function ( api, $, _ ) {
|
6392 |
+
var Constructor = {
|
6393 |
+
initialize: function( id, options ) {
|
6394 |
+
var module = this;
|
6395 |
+
module.inputConstructor = api.CZRInput.extend({
|
6396 |
+
setupSelect : function() {
|
6397 |
+
api.czr_sektions.setupSelectInput.call( this );
|
6398 |
+
}
|
6399 |
+
});
|
6400 |
+
module.itemConstructor = api.CZRItem.extend( module.CZRItemConstructor || {} );
|
6401 |
+
api.CZRDynModule.prototype.initialize.call( module, id, options );
|
6402 |
+
|
6403 |
+
},//initialize
|
6404 |
+
|
6405 |
+
CZRItemConstructor : {
|
6406 |
+
ready : function() {
|
6407 |
+
var item = this;
|
6408 |
+
item.inputCollection.bind( function( col ) {
|
6409 |
+
if( _.isEmpty( col ) )
|
6410 |
+
return;
|
6411 |
+
try { item.setInputVisibilityDeps(); } catch( er ) {
|
6412 |
+
api.errorLog( 'item.setInputVisibilityDeps() : ' + er );
|
6413 |
+
}
|
6414 |
+
});//item.inputCollection.bind()
|
6415 |
+
api.CZRItem.prototype.ready.call( item );
|
6416 |
+
},
|
6417 |
+
setInputVisibilityDeps : function() {
|
6418 |
+
var item = this,
|
6419 |
+
module = item.module;
|
6420 |
+
var scheduleVisibilityOfInputId = function( controlledInputId, visibilityCallBack ) {
|
6421 |
+
item.czr_Input( controlledInputId ).visible( visibilityCallBack() );
|
6422 |
+
this.bind( function( to ) {
|
6423 |
+
item.czr_Input( controlledInputId ).visible( visibilityCallBack() );
|
6424 |
+
});
|
6425 |
+
};
|
6426 |
+
item.czr_Input.each( function( input ) {
|
6427 |
+
switch( input.id ) {
|
6428 |
+
case 'use-custom-breakpoint' :
|
6429 |
+
scheduleVisibilityOfInputId.call( input, 'global-custom-breakpoint', function() {
|
6430 |
+
return input();
|
6431 |
+
});
|
6432 |
+
break;
|
6433 |
+
}
|
6434 |
+
});
|
6435 |
+
}
|
6436 |
+
}//CZRItemConstructor
|
6437 |
+
};
|
6438 |
+
api.czrModuleMap = api.czrModuleMap || {};
|
6439 |
+
$.extend( api.czrModuleMap, {
|
6440 |
+
sek_global_breakpoint : {
|
6441 |
+
mthds : Constructor,
|
6442 |
+
crud : false,
|
6443 |
+
name : api.czr_sektions.getRegisteredModuleProperty( 'sek_global_breakpoint', 'name' ),
|
6444 |
+
has_mod_opt : false,
|
6445 |
+
ready_on_section_expanded : true,
|
6446 |
+
defaultItemModel : _.extend(
|
6447 |
+
{ id : '', title : '' },
|
6448 |
+
api.czr_sektions.getDefaultItemModelFromRegisteredModuleData( 'sek_global_breakpoint' )
|
6449 |
+
)
|
6450 |
+
},
|
6451 |
+
});
|
6452 |
+
})( wp.customize , jQuery, _ );//global sektionsLocalizedData, serverControlParams
|
6453 |
+
( function ( api, $, _ ) {
|
6454 |
+
var Constructor = {
|
6455 |
+
initialize: function( id, options ) {
|
6456 |
+
var module = this;
|
6457 |
+
module.inputConstructor = api.CZRInput.extend({
|
6458 |
+
setupSelect : function() {
|
6459 |
+
api.czr_sektions.setupSelectInput.call( this );
|
6460 |
+
}
|
6461 |
+
});
|
6462 |
+
module.itemConstructor = api.CZRItem.extend( module.CZRItemConstructor || {} );
|
6463 |
+
api.CZRDynModule.prototype.initialize.call( module, id, options );
|
6464 |
+
|
6465 |
+
},//initialize
|
6466 |
+
|
6467 |
+
CZRItemConstructor : {
|
6468 |
+
ready : function() {
|
6469 |
+
var item = this;
|
6470 |
+
item.inputCollection.bind( function( col ) {
|
6471 |
+
if( _.isEmpty( col ) )
|
6472 |
+
return;
|
6473 |
+
try { item.setInputVisibilityDeps(); } catch( er ) {
|
6474 |
+
api.errorLog( 'item.setInputVisibilityDeps() : ' + er );
|
6475 |
+
}
|
6476 |
+
});//item.inputCollection.bind()
|
6477 |
+
api.CZRItem.prototype.ready.call( item );
|
6478 |
+
},
|
6479 |
+
setInputVisibilityDeps : function() {
|
6480 |
+
var item = this,
|
6481 |
+
module = item.module;
|
6482 |
+
var scheduleVisibilityOfInputId = function( controlledInputId, visibilityCallBack ) {
|
6483 |
+
item.czr_Input( controlledInputId ).visible( visibilityCallBack() );
|
6484 |
+
this.bind( function( to ) {
|
6485 |
+
item.czr_Input( controlledInputId ).visible( visibilityCallBack() );
|
6486 |
+
});
|
6487 |
+
};
|
6488 |
+
item.czr_Input.each( function( input ) {
|
6489 |
+
switch( input.id ) {
|
6490 |
+
case 'use-custom-outer-width' :
|
6491 |
+
scheduleVisibilityOfInputId.call( input, 'outer-section-width', function() {
|
6492 |
+
return input();
|
6493 |
+
});
|
6494 |
+
break;
|
6495 |
+
case 'use-custom-inner-width' :
|
6496 |
+
scheduleVisibilityOfInputId.call( input, 'inner-section-width', function() {
|
6497 |
+
return input();
|
6498 |
+
});
|
6499 |
+
break;
|
6500 |
}
|
6501 |
+
});
|
6502 |
+
}
|
6503 |
+
}//CZRItemConstructor
|
6504 |
+
};
|
6505 |
+
api.czrModuleMap = api.czrModuleMap || {};
|
6506 |
+
$.extend( api.czrModuleMap, {
|
6507 |
+
sek_global_widths : {
|
6508 |
+
mthds : Constructor,
|
6509 |
+
crud : false,
|
6510 |
+
name : api.czr_sektions.getRegisteredModuleProperty( 'sek_global_widths', 'name' ),
|
6511 |
+
has_mod_opt : false,
|
6512 |
+
ready_on_section_expanded : true,
|
6513 |
+
defaultItemModel : _.extend(
|
6514 |
+
{ id : '', title : '' },
|
6515 |
+
api.czr_sektions.getDefaultItemModelFromRegisteredModuleData( 'sek_global_widths' )
|
6516 |
+
)
|
6517 |
+
},
|
6518 |
+
});
|
6519 |
+
})( wp.customize , jQuery, _ );/* ------------------------------------------------------------------------- *
|
6520 |
+
* IMAGE MAIN SETTINGS
|
6521 |
+
/* ------------------------------------------------------------------------- */
|
6522 |
+
( function ( api, $, _ ) {
|
6523 |
+
var Constructor = {
|
6524 |
+
initialize: function( id, options ) {
|
6525 |
+
var module = this;
|
6526 |
+
module.inputConstructor = api.CZRInput.extend({
|
6527 |
+
setupSelect : function() {
|
6528 |
+
api.czr_sektions.setupSelectInput.call( this );
|
6529 |
}
|
6530 |
});
|
6531 |
+
module.itemConstructor = api.CZRItem.extend( module.CZRItemConstructor || {} );
|
6532 |
+
api.CZRDynModule.prototype.initialize.call( module, id, options );
|
6533 |
+
module.bind( 'set_default_content_picker_options', function( params ) {
|
6534 |
+
params.defaultContentPickerOption.defaultOption = {
|
6535 |
+
'title' : '<span style="font-weight:bold">' + sektionsLocalizedData.i18n['Set a custom url'] + '</span>',
|
6536 |
+
'type' : '',
|
6537 |
+
'type_label' : '',
|
6538 |
+
'object' : '',
|
6539 |
+
'id' : '_custom_',
|
6540 |
+
'url' : ''
|
6541 |
+
};
|
6542 |
+
return params;
|
|
|
6543 |
});
|
6544 |
+
},//initialize
|
6545 |
+
CZRItemConstructor : {
|
6546 |
+
ready : function() {
|
6547 |
+
var item = this;
|
6548 |
+
item.inputCollection.bind( function( col ) {
|
6549 |
+
if( _.isEmpty( col ) )
|
6550 |
+
return;
|
6551 |
+
try { item.setInputVisibilityDeps(); } catch( er ) {
|
6552 |
+
api.errorLog( 'item.setInputVisibilityDeps() : ' + er );
|
6553 |
+
}
|
6554 |
+
});//item.inputCollection.bind()
|
6555 |
+
api.CZRItem.prototype.ready.call( item );
|
6556 |
+
},
|
6557 |
+
setInputVisibilityDeps : function() {
|
6558 |
+
var item = this,
|
6559 |
+
module = item.module;
|
6560 |
+
var scheduleVisibilityOfInputId = function( controlledInputId, visibilityCallBack ) {
|
6561 |
+
item.czr_Input( controlledInputId ).visible( visibilityCallBack() );
|
6562 |
+
this.bind( function( to ) {
|
6563 |
+
item.czr_Input( controlledInputId ).visible( visibilityCallBack() );
|
6564 |
+
});
|
6565 |
+
};
|
6566 |
+
item.czr_Input.each( function( input ) {
|
6567 |
+
switch( input.id ) {
|
6568 |
+
case 'img' :
|
6569 |
+
scheduleVisibilityOfInputId.call( input, 'img-size', function() {
|
6570 |
+
return ! _.isEmpty( input()+'' ) && _.isNumber( input() );
|
6571 |
+
});
|
6572 |
+
break;
|
6573 |
+
case 'link-to' :
|
6574 |
+
_.each( [ 'link-pick-url', 'link-custom-url', 'link-target' ] , function( _inputId_ ) {
|
6575 |
+
try { scheduleVisibilityOfInputId.call( input, _inputId_, function() {
|
6576 |
+
var bool = false;
|
6577 |
+
switch( _inputId_ ) {
|
6578 |
+
case 'link-custom-url' :
|
6579 |
+
bool = 'url' === input() && '_custom_' == item.czr_Input('link-pick-url')().id;
|
6580 |
+
break;
|
6581 |
+
case 'link-pick-url' :
|
6582 |
+
bool = 'url' === input();
|
6583 |
+
break;
|
6584 |
+
case 'link-target' :
|
6585 |
+
bool = 'no-link' !== input();
|
6586 |
+
break;
|
6587 |
+
}
|
6588 |
+
return bool;
|
6589 |
+
}); } catch( er ) {
|
6590 |
+
api.errare( 'Image module => error in setInputVisibilityDeps', er );
|
6591 |
+
}
|
6592 |
+
});
|
6593 |
+
break;
|
6594 |
+
case 'link-pick-url' :
|
6595 |
+
scheduleVisibilityOfInputId.call( input, 'link-custom-url', function() {
|
6596 |
+
return '_custom_' == input().id && 'url' == item.czr_Input('link-to')();
|
6597 |
+
});
|
6598 |
+
break;
|
6599 |
+
case 'border-type' :
|
6600 |
+
_.each( [ 'borders' ] , function(_inputId_ ) {
|
6601 |
+
try { scheduleVisibilityOfInputId.call( input, _inputId_, function() {
|
6602 |
+
return 'none' !== input();
|
6603 |
+
}); } catch( er ) {
|
6604 |
+
api.errare( module.id + ' => error in setInputVisibilityDeps', er );
|
6605 |
+
}
|
6606 |
+
});
|
6607 |
+
break;
|
6608 |
+
case 'use_custom_width' :
|
6609 |
+
_.each( [ 'custom_width' ] , function( _inputId_ ) {
|
6610 |
+
try { scheduleVisibilityOfInputId.call( input, _inputId_, function() {
|
6611 |
+
return input();
|
6612 |
+
}); } catch( er ) {
|
6613 |
+
api.errare( 'Button module => error in setInputVisibilityDeps', er );
|
6614 |
+
}
|
6615 |
+
});
|
6616 |
+
break;
|
6617 |
+
}
|
6618 |
+
});
|
6619 |
+
}
|
6620 |
+
},//CZRItemConstructor
|
6621 |
|
6622 |
+
};//Constructor
|
6623 |
+
api.czrModuleMap = api.czrModuleMap || {};
|
6624 |
+
$.extend( api.czrModuleMap, {
|
6625 |
+
czr_image_main_settings_child : {
|
6626 |
+
mthds : Constructor,
|
6627 |
+
crud : false,
|
6628 |
+
name : api.czr_sektions.getRegisteredModuleProperty( 'czr_image_main_settings_child', 'name' ),
|
6629 |
+
has_mod_opt : false,
|
6630 |
+
ready_on_section_expanded : true,
|
6631 |
+
defaultItemModel : api.czr_sektions.getDefaultItemModelFromRegisteredModuleData( 'czr_image_main_settings_child' )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6632 |
},
|
6633 |
+
});
|
6634 |
+
})( wp.customize , jQuery, _ );
|
6635 |
|
6636 |
|
6637 |
|
6638 |
|
6639 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6640 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6641 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6642 |
|
6643 |
+
/* ------------------------------------------------------------------------- *
|
6644 |
+
* IMAGE BORDERS AND BORDER RADIUS
|
6645 |
+
/* ------------------------------------------------------------------------- */
|
|
|
|
|
|
|
|
|
|
|
|
|
6646 |
( function ( api, $, _ ) {
|
6647 |
var Constructor = {
|
6648 |
initialize: function( id, options ) {
|
|
|
6649 |
var module = this;
|
6650 |
+
module.inputConstructor = api.CZRInput.extend({
|
6651 |
+
setupSelect : function() {
|
6652 |
+
api.czr_sektions.setupSelectInput.call( this );
|
6653 |
+
}
|
6654 |
+
});
|
6655 |
module.itemConstructor = api.CZRItem.extend( module.CZRItemConstructor || {} );
|
|
|
|
|
6656 |
api.CZRDynModule.prototype.initialize.call( module, id, options );
|
6657 |
},//initialize
|
6658 |
+
CZRItemConstructor : {
|
6659 |
+
ready : function() {
|
6660 |
+
var item = this;
|
6661 |
+
item.inputCollection.bind( function( col ) {
|
6662 |
+
if( _.isEmpty( col ) )
|
6663 |
+
return;
|
6664 |
+
try { item.setInputVisibilityDeps(); } catch( er ) {
|
6665 |
+
api.errorLog( 'item.setInputVisibilityDeps() : ' + er );
|
6666 |
+
}
|
6667 |
+
});//item.inputCollection.bind()
|
6668 |
+
api.CZRItem.prototype.ready.call( item );
|
6669 |
+
},
|
6670 |
+
setInputVisibilityDeps : function() {
|
6671 |
+
var item = this,
|
6672 |
+
module = item.module;
|
6673 |
+
var scheduleVisibilityOfInputId = function( controlledInputId, visibilityCallBack ) {
|
6674 |
+
item.czr_Input( controlledInputId ).visible( visibilityCallBack() );
|
6675 |
+
this.bind( function( to ) {
|
6676 |
+
item.czr_Input( controlledInputId ).visible( visibilityCallBack() );
|
6677 |
+
});
|
6678 |
+
};
|
6679 |
+
item.czr_Input.each( function( input ) {
|
6680 |
+
switch( input.id ) {
|
6681 |
+
case 'border-type' :
|
6682 |
+
_.each( [ 'borders' ] , function(_inputId_ ) {
|
6683 |
+
try { scheduleVisibilityOfInputId.call( input, _inputId_, function() {
|
6684 |
+
return 'none' !== input();
|
6685 |
+
}); } catch( er ) {
|
6686 |
+
api.errare( module.id + ' => error in setInputVisibilityDeps', er );
|
6687 |
+
}
|
6688 |
+
});
|
6689 |
+
break;
|
6690 |
+
}
|
6691 |
+
});
|
6692 |
+
}
|
6693 |
+
},//CZRItemConstructor
|
6694 |
|
6695 |
+
};//Constructor
|
6696 |
+
api.czrModuleMap = api.czrModuleMap || {};
|
6697 |
+
$.extend( api.czrModuleMap, {
|
6698 |
+
czr_image_borders_corners_child : {
|
6699 |
+
mthds : Constructor,
|
6700 |
+
crud : false,
|
6701 |
+
name : api.czr_sektions.getRegisteredModuleProperty( 'czr_image_borders_corners_child', 'name' ),
|
6702 |
+
has_mod_opt : false,
|
6703 |
+
ready_on_section_expanded : true,
|
6704 |
+
defaultItemModel : api.czr_sektions.getDefaultItemModelFromRegisteredModuleData( 'czr_image_borders_corners_child' )
|
6705 |
+
},
|
6706 |
+
});
|
6707 |
+
})( wp.customize , jQuery, _ );//global sektionsLocalizedData, serverControlParams
|
6708 |
+
( function ( api, $, _ ) {
|
6709 |
+
var Constructor = {
|
6710 |
+
initialize: function( id, options ) {
|
6711 |
+
var module = this;
|
6712 |
+
module.inputConstructor = api.CZRInput.extend( module.CZRTextEditorInputMths || {} );
|
6713 |
+
api.CZRDynModule.prototype.initialize.call( module, id, options );
|
6714 |
+
},//initialize
|
6715 |
|
6716 |
+
CZRTextEditorInputMths : {
|
6717 |
+
initialize : function( name, options ) {
|
6718 |
+
var input = this;
|
6719 |
+
if ( 'tiny_mce_editor' == input.type ) {
|
6720 |
+
input.isReady.then( function() {
|
6721 |
+
input.container.find('[data-czr-action="open-tinymce-editor"]').trigger('click');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6722 |
});
|
|
|
6723 |
}
|
6724 |
+
api.CZRInput.prototype.initialize.call( input, name, options );
|
6725 |
+
},
|
6726 |
|
6727 |
+
setupSelect : function() {
|
6728 |
+
api.czr_sektions.setupSelectInput.call( this );
|
6729 |
+
}
|
6730 |
+
},//CZRTextEditorInputMths
|
6731 |
+
};//Constructor
|
6732 |
+
api.czrModuleMap = api.czrModuleMap || {};
|
6733 |
+
$.extend( api.czrModuleMap, {
|
6734 |
+
czr_tinymce_child : {
|
6735 |
+
mthds : Constructor,
|
6736 |
+
crud : false,
|
6737 |
+
name : api.czr_sektions.getRegisteredModuleProperty( 'czr_tinymce_child', 'name' ),
|
6738 |
+
has_mod_opt : false,
|
6739 |
+
ready_on_section_expanded : true,
|
6740 |
+
defaultItemModel : api.czr_sektions.getDefaultItemModelFromRegisteredModuleData( 'czr_tinymce_child' )
|
6741 |
+
},
|
6742 |
+
});
|
6743 |
+
})( wp.customize , jQuery, _ );//global sektionsLocalizedData, serverControlParams
|
6744 |
+
( function ( api, $, _ ) {
|
6745 |
+
api.czrModuleMap = api.czrModuleMap || {};
|
6746 |
+
$.extend( api.czrModuleMap, {
|
6747 |
+
czr_simple_html_module : {
|
6748 |
+
crud : false,
|
6749 |
+
name : api.czr_sektions.getRegisteredModuleProperty( 'czr_simple_html_module', 'name' ),
|
6750 |
+
has_mod_opt : false,
|
6751 |
+
ready_on_section_expanded : true,
|
6752 |
+
defaultItemModel : api.czr_sektions.getDefaultItemModelFromRegisteredModuleData( 'czr_simple_html_module' )
|
6753 |
+
},
|
6754 |
+
});
|
6755 |
+
})( wp.customize , jQuery, _ );//global sektionsLocalizedData, serverControlParams
|
6756 |
+
( function ( api, $, _ ) {
|
6757 |
+
var FeaturedPagesConstruct = {
|
6758 |
+
initialize: function( id, options ) {
|
6759 |
+
var module = this;
|
6760 |
+
module.inputConstructor = api.CZRInput.extend({
|
6761 |
+
setupSelect : function() {
|
6762 |
+
api.czr_sektions.setupSelectInput.call( this );
|
6763 |
+
}
|
6764 |
+
});
|
6765 |
+
module.itemConstructor = api.CZRItem.extend( module.CZRFPItemConstructor || {} );
|
6766 |
+
api.CZRDynModule.prototype.initialize.call( module, id, options );
|
6767 |
+
},//initialize
|
6768 |
+
CZRFPItemConstructor : {
|
6769 |
ready : function() {
|
6770 |
var item = this;
|
|
|
|
|
6771 |
item.inputCollection.bind( function( col ) {
|
6772 |
if( _.isEmpty( col ) )
|
6773 |
return;
|
6775 |
api.errorLog( 'item.setInputVisibilityDeps() : ' + er );
|
6776 |
}
|
6777 |
});//item.inputCollection.bind()
|
|
|
|
|
6778 |
api.CZRItem.prototype.ready.call( item );
|
6779 |
},
|
|
|
|
|
|
|
|
|
6780 |
setInputVisibilityDeps : function() {
|
6781 |
var item = this,
|
6782 |
module = item.module;
|
|
|
6783 |
var scheduleVisibilityOfInputId = function( controlledInputId, visibilityCallBack ) {
|
|
|
6784 |
item.czr_Input( controlledInputId ).visible( visibilityCallBack() );
|
|
|
6785 |
this.bind( function( to ) {
|
6786 |
item.czr_Input( controlledInputId ).visible( visibilityCallBack() );
|
6787 |
});
|
6788 |
};
|
|
|
6789 |
item.czr_Input.each( function( input ) {
|
6790 |
switch( input.id ) {
|
6791 |
+
case 'img-type' :
|
6792 |
+
_.each( [ 'img-id', 'img-size' ] , function( _inputId_ ) {
|
6793 |
try { scheduleVisibilityOfInputId.call( input, _inputId_, function() {
|
6794 |
var bool = false;
|
6795 |
switch( _inputId_ ) {
|
6796 |
+
case 'img-id' :
|
6797 |
+
bool = 'custom' === input();
|
|
|
6798 |
break;
|
6799 |
default :
|
6800 |
+
bool = 'none' !== input();
|
6801 |
break;
|
6802 |
}
|
6803 |
return bool;
|
6804 |
}); } catch( er ) {
|
6805 |
+
api.errare( 'Featured pages module => error in setInputVisibilityDeps', er );
|
6806 |
}
|
6807 |
});
|
6808 |
break;
|
6809 |
+
case 'content-type' :
|
6810 |
+
_.each( [ 'content-custom-text' ] , function( _inputId_ ) {
|
6811 |
try { scheduleVisibilityOfInputId.call( input, _inputId_, function() {
|
6812 |
+
return 'custom' === input();
|
6813 |
}); } catch( er ) {
|
6814 |
+
api.errare( 'Featured pages module => error in setInputVisibilityDeps', er );
|
6815 |
+
}
|
6816 |
+
});
|
6817 |
+
break;
|
6818 |
+
case 'btn-display' :
|
6819 |
+
_.each( [ 'btn-custom-text' ] , function( _inputId_ ) {
|
6820 |
+
try { scheduleVisibilityOfInputId.call( input, _inputId_, function() {
|
6821 |
+
return input();
|
6822 |
+
}); } catch( er ) {
|
6823 |
+
api.errare( 'Featured pages module => error in setInputVisibilityDeps', er );
|
6824 |
}
|
6825 |
});
|
6826 |
break;
|
6827 |
}
|
6828 |
});
|
6829 |
}
|
6830 |
+
},//CZRFPItemConstructor
|
6831 |
+
};//FeaturedPagesConstruct
|
6832 |
+
api.czrModuleMap = api.czrModuleMap || {};
|
6833 |
+
$.extend( api.czrModuleMap, {
|
6834 |
+
czr_featured_pages_module : {
|
6835 |
+
mthds : FeaturedPagesConstruct,
|
6836 |
+
crud : api.czr_sektions.getRegisteredModuleProperty( 'czr_featured_pages_module', 'is_crud' ),
|
6837 |
+
hasPreItem : false,//a crud module has a pre item by default
|
6838 |
+
refresh_on_add_item : false,// the preview is refreshed on item add
|
6839 |
+
name : api.czr_sektions.getRegisteredModuleProperty( 'czr_featured_pages_module', 'name' ),
|
6840 |
+
has_mod_opt : false,
|
6841 |
+
ready_on_section_expanded : true,
|
6842 |
+
defaultItemModel : api.czr_sektions.getDefaultItemModelFromRegisteredModuleData( 'czr_featured_pages_module' )
|
6843 |
+
},
|
6844 |
+
});
|
6845 |
+
})( wp.customize , jQuery, _ );//global sektionsLocalizedData, serverControlParams
|
6846 |
+
( function ( api, $, _ ) {
|
6847 |
+
var Constructor = {
|
6848 |
+
initialize: function( id, options ) {
|
6849 |
+
var module = this;
|
6850 |
+
module.inputConstructor = api.CZRInput.extend({
|
6851 |
+
setupSelect : function() {
|
6852 |
+
api.czr_sektions.setupSelectInput.call( this );
|
6853 |
+
}
|
6854 |
+
});
|
6855 |
+
module.itemConstructor = api.CZRItem.extend( module.CZRIconItemConstructor || {} );
|
6856 |
+
module.bind( 'set_default_content_picker_options', function( params ) {
|
6857 |
+
params.defaultContentPickerOption.defaultOption = {
|
6858 |
+
'title' : '<span style="font-weight:bold">' + sektionsLocalizedData.i18n['Set a custom url'] + '</span>',
|
6859 |
+
'type' : '',
|
6860 |
+
'type_label' : '',
|
6861 |
+
'object' : '',
|
6862 |
+
'id' : '_custom_',
|
6863 |
+
'url' : ''
|
6864 |
+
};
|
6865 |
+
return params;
|
6866 |
+
});
|
6867 |
+
api.CZRDynModule.prototype.initialize.call( module, id, options );
|
6868 |
+
|
6869 |
+
},//initialize
|
6870 |
+
|
6871 |
+
/* Helpers */
|
6872 |
+
CZRIconItemConstructor : {
|
6873 |
+
ready : function() {
|
6874 |
+
var item = this;
|
6875 |
+
item.inputCollection.bind( function( col ) {
|
6876 |
+
if( _.isEmpty( col ) )
|
6877 |
+
return;
|
6878 |
+
try { item.setInputVisibilityDeps(); } catch( er ) {
|
6879 |
+
api.errorLog( 'item.setInputVisibilityDeps() : ' + er );
|
6880 |
+
}
|
6881 |
+
});//item.inputCollection.bind()
|
6882 |
+
api.CZRItem.prototype.ready.call( item );
|
6883 |
+
},
|
6884 |
+
setInputVisibilityDeps : function() {
|
6885 |
+
var item = this,
|
6886 |
+
module = item.module;
|
6887 |
+
var scheduleVisibilityOfInputId = function( controlledInputId, visibilityCallBack ) {
|
6888 |
+
item.czr_Input( controlledInputId ).visible( visibilityCallBack() );
|
6889 |
+
this.bind( function( to ) {
|
6890 |
+
item.czr_Input( controlledInputId ).visible( visibilityCallBack() );
|
6891 |
+
});
|
6892 |
+
};
|
6893 |
+
item.czr_Input.each( function( input ) {
|
6894 |
+
switch( input.id ) {
|
6895 |
+
case 'link-to' :
|
6896 |
+
_.each( [ 'link-pick-url', 'link-custom-url', 'link-target' ] , function( _inputId_ ) {
|
6897 |
+
try { scheduleVisibilityOfInputId.call( input, _inputId_, function() {
|
6898 |
+
var bool = false;
|
6899 |
+
switch( _inputId_ ) {
|
6900 |
+
case 'link-custom-url' :
|
6901 |
+
bool = 'url' == input() && '_custom_' == item.czr_Input('link-pick-url')().id;
|
6902 |
+
break;
|
6903 |
+
default :
|
6904 |
+
bool = 'url' == input();
|
6905 |
+
break;
|
6906 |
+
}
|
6907 |
+
return bool;
|
6908 |
+
}); } catch( er ) {
|
6909 |
+
api.errare( module.module_type + ' => error in setInputVisibilityDeps', er );
|
6910 |
+
}
|
6911 |
+
});
|
6912 |
+
break;
|
6913 |
+
case 'link-pick-url' :
|
6914 |
+
scheduleVisibilityOfInputId.call( input, 'link-custom-url', function() {
|
6915 |
+
return '_custom_' == input().id && 'url' == item.czr_Input('link-to')();
|
6916 |
+
});
|
6917 |
+
break;
|
6918 |
+
case 'use_custom_color_on_hover' :
|
6919 |
+
_.each( [ 'color_hover' ] , function( _inputId_ ) {
|
6920 |
+
try { scheduleVisibilityOfInputId.call( input, _inputId_, function() {
|
6921 |
+
return input();
|
6922 |
+
}); } catch( er ) {
|
6923 |
+
api.errare( module.module_type + ' => error in setInputVisibilityDeps', er );
|
6924 |
+
}
|
6925 |
+
});
|
6926 |
+
break;
|
6927 |
+
}
|
6928 |
+
});
|
6929 |
+
}
|
6930 |
+
},//CZRIconItemConstructor
|
6931 |
|
6932 |
+
};//Constructor
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6933 |
api.czrModuleMap = api.czrModuleMap || {};
|
6934 |
$.extend( api.czrModuleMap, {
|
6935 |
+
czr_icon_settings_child : {
|
6936 |
mthds : Constructor,
|
6937 |
crud : false,
|
6938 |
+
name : api.czr_sektions.getRegisteredModuleProperty( 'czr_icon_settings_child', 'name' ),
|
6939 |
has_mod_opt : false,
|
6940 |
ready_on_section_expanded : true,
|
6941 |
+
defaultItemModel : api.czr_sektions.getDefaultItemModelFromRegisteredModuleData( 'czr_icon_settings_child' )
|
|
|
|
|
|
|
6942 |
},
|
6943 |
});
|
6944 |
+
})( wp.customize , jQuery, _ );
|
|
|
6945 |
( function ( api, $, _ ) {
|
6946 |
var Constructor = {
|
6947 |
+
initialize: function( id, options ) {
|
6948 |
+
var module = this;
|
6949 |
+
module.inputConstructor = api.CZRInput.extend({
|
6950 |
+
setupSelect : function() {
|
6951 |
+
api.czr_sektions.setupSelectInput.call( this );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6952 |
}
|
6953 |
+
});
|
6954 |
+
module.itemConstructor = api.CZRItem.extend( module.CZRItemConstructor || {} );
|
6955 |
+
api.CZRDynModule.prototype.initialize.call( module, id, options );
|
6956 |
+
},//initialize
|
6957 |
|
6958 |
+
CZRItemConstructor : {
|
|
|
6959 |
ready : function() {
|
6960 |
var item = this;
|
|
|
|
|
6961 |
item.inputCollection.bind( function( col ) {
|
6962 |
if( _.isEmpty( col ) )
|
6963 |
return;
|
6965 |
api.errorLog( 'item.setInputVisibilityDeps() : ' + er );
|
6966 |
}
|
6967 |
});//item.inputCollection.bind()
|
|
|
|
|
6968 |
api.CZRItem.prototype.ready.call( item );
|
6969 |
},
|
|
|
|
|
|
|
|
|
6970 |
setInputVisibilityDeps : function() {
|
6971 |
var item = this,
|
6972 |
module = item.module;
|
|
|
6973 |
var scheduleVisibilityOfInputId = function( controlledInputId, visibilityCallBack ) {
|
|
|
6974 |
item.czr_Input( controlledInputId ).visible( visibilityCallBack() );
|
|
|
6975 |
this.bind( function( to ) {
|
6976 |
item.czr_Input( controlledInputId ).visible( visibilityCallBack() );
|
6977 |
});
|
6978 |
};
|
|
|
6979 |
item.czr_Input.each( function( input ) {
|
6980 |
switch( input.id ) {
|
6981 |
+
case 'border-type' :
|
6982 |
+
_.each( [ 'borders' ] , function(_inputId_ ) {
|
6983 |
+
try { scheduleVisibilityOfInputId.call( input, _inputId_, function() {
|
6984 |
+
return 'none' !== input();
|
6985 |
+
}); } catch( er ) {
|
6986 |
+
api.errare( module.id + ' => error in setInputVisibilityDeps', er );
|
6987 |
+
}
|
6988 |
});
|
6989 |
break;
|
6990 |
}
|
6991 |
});
|
6992 |
}
|
6993 |
}//CZRItemConstructor
|
6994 |
+
};// Constructor
|
6995 |
+
api.czrModuleMap = api.czrModuleMap || {};
|
6996 |
+
$.extend( api.czrModuleMap, {
|
6997 |
+
czr_icon_spacing_border_child: {
|
6998 |
+
mthds : Constructor,
|
6999 |
+
crud : false,
|
7000 |
+
name : api.czr_sektions.getRegisteredModuleProperty( 'czr_icon_spacing_border_child', 'name' ),
|
7001 |
+
has_mod_opt : false,
|
7002 |
+
ready_on_section_expanded : true,
|
7003 |
+
defaultItemModel : api.czr_sektions.getDefaultItemModelFromRegisteredModuleData( 'czr_icon_spacing_border_child' )
|
7004 |
+
}
|
7005 |
+
});
|
7006 |
+
})( wp.customize , jQuery, _ );/* ------------------------------------------------------------------------- *
|
7007 |
+
* HEADING MAIN CHILD
|
7008 |
+
/* ------------------------------------------------------------------------- */
|
7009 |
+
( function ( api, $, _ ) {
|
7010 |
+
var HeadingModuleConstructor = {
|
7011 |
+
initialize: function( id, options ) {
|
7012 |
+
var module = this;
|
7013 |
+
module.inputConstructor = api.CZRInput.extend( module.CZRHeadingInputMths || {} );
|
7014 |
+
api.CZRDynModule.prototype.initialize.call( module, id, options );
|
7015 |
+
},//initialize
|
7016 |
+
|
7017 |
+
CZRHeadingInputMths: {
|
7018 |
+
setupSelect : function() {
|
7019 |
+
api.czr_sektions.setupSelectInput.call( this );
|
7020 |
+
}
|
7021 |
+
},//CZRHeadingsInputMths
|
7022 |
+
};//HeadingModuleConstructor
|
7023 |
+
api.czrModuleMap = api.czrModuleMap || {};
|
7024 |
+
$.extend( api.czrModuleMap, {
|
7025 |
+
czr_heading_child : {
|
7026 |
+
mthds : HeadingModuleConstructor,
|
7027 |
+
crud : false,
|
7028 |
+
name : api.czr_sektions.getRegisteredModuleProperty( 'czr_heading_child', 'name' ),
|
7029 |
+
has_mod_opt : false,
|
7030 |
+
ready_on_section_expanded : true,
|
7031 |
+
defaultItemModel : api.czr_sektions.getDefaultItemModelFromRegisteredModuleData( 'czr_heading_child' )
|
7032 |
+
}
|
7033 |
+
});
|
7034 |
+
})( wp.customize , jQuery, _ );
|
7035 |
+
|
7036 |
+
/* ------------------------------------------------------------------------- *
|
7037 |
+
* HEADING SPACING
|
7038 |
+
/* ------------------------------------------------------------------------- */
|
7039 |
+
( function ( api, $, _ ) {
|
7040 |
+
var HeadingModuleConstructor = {
|
7041 |
+
initialize: function( id, options ) {
|
7042 |
+
var module = this;
|
7043 |
+
module.inputConstructor = api.CZRInput.extend( module.CZRHeadingInputMths || {} );
|
7044 |
+
api.CZRDynModule.prototype.initialize.call( module, id, options );
|
7045 |
+
},//initialize
|
7046 |
+
|
7047 |
+
CZRHeadingInputMths: {
|
7048 |
+
setupSelect : function() {
|
7049 |
+
api.czr_sektions.setupSelectInput.call( this );
|
7050 |
+
}
|
7051 |
+
},//CZRHeadingsInputMths
|
7052 |
+
};//HeadingModuleConstructor
|
7053 |
+
api.czrModuleMap = api.czrModuleMap || {};
|
7054 |
+
$.extend( api.czrModuleMap, {
|
7055 |
+
czr_heading_spacing_child : {
|
7056 |
+
mthds : HeadingModuleConstructor,
|
7057 |
+
crud : false,
|
7058 |
+
name : api.czr_sektions.getRegisteredModuleProperty( 'czr_heading_spacing_child', 'name' ),
|
7059 |
+
has_mod_opt : false,
|
7060 |
+
ready_on_section_expanded : true,
|
7061 |
+
defaultItemModel : api.czr_sektions.getDefaultItemModelFromRegisteredModuleData( 'czr_heading_spacing_child' )
|
7062 |
+
}
|
7063 |
+
});
|
7064 |
+
})( wp.customize , jQuery, _ );//global sektionsLocalizedData, serverControlParams
|
7065 |
+
( function ( api, $, _ ) {
|
7066 |
+
var DividerModuleConstructor = {
|
7067 |
+
initialize: function( id, options ) {
|
7068 |
+
var module = this;
|
7069 |
+
module.inputConstructor = api.CZRInput.extend( module.CZRDividerInputMths || {} );
|
7070 |
+
api.CZRDynModule.prototype.initialize.call( module, id, options );
|
7071 |
+
},//initialize
|
7072 |
+
|
7073 |
+
|
7074 |
+
CZRDividerInputMths: {
|
7075 |
+
setupSelect : function() {
|
7076 |
+
api.czr_sektions.setupSelectInput.call( this );
|
7077 |
+
}
|
7078 |
+
},//CZRDividerInputMths
|
7079 |
+
};//DividerModuleConstructor
|
7080 |
+
api.czrModuleMap = api.czrModuleMap || {};
|
7081 |
+
$.extend( api.czrModuleMap, {
|
7082 |
+
czr_divider_module : {
|
7083 |
+
mthds : DividerModuleConstructor,
|
7084 |
+
crud : false,
|
7085 |
+
name : api.czr_sektions.getRegisteredModuleProperty( 'czr_divider_module', 'name' ),
|
7086 |
+
has_mod_opt : false,
|
7087 |
+
ready_on_section_expanded : true,
|
7088 |
+
defaultItemModel : api.czr_sektions.getDefaultItemModelFromRegisteredModuleData( 'czr_divider_module' )
|
7089 |
+
}
|
7090 |
+
});
|
7091 |
+
})( wp.customize , jQuery, _ );//global sektionsLocalizedData, serverControlParams
|
7092 |
+
( function ( api, $, _ ) {
|
7093 |
+
api.czrModuleMap = api.czrModuleMap || {};
|
7094 |
+
$.extend( api.czrModuleMap, {
|
7095 |
+
czr_spacer_module : {
|
7096 |
+
crud : false,
|
7097 |
+
name : api.czr_sektions.getRegisteredModuleProperty( 'czr_spacer_module', 'name' ),
|
7098 |
+
has_mod_opt : false,
|
7099 |
+
ready_on_section_expanded : true,
|
7100 |
+
defaultItemModel : api.czr_sektions.getDefaultItemModelFromRegisteredModuleData( 'czr_spacer_module' )
|
7101 |
+
}
|
7102 |
+
});
|
7103 |
+
})( wp.customize , jQuery, _ );//global sektionsLocalizedData, serverControlParams
|
7104 |
+
( function ( api, $, _ ) {
|
7105 |
+
api.czrModuleMap = api.czrModuleMap || {};
|
7106 |
+
$.extend( api.czrModuleMap, {
|
7107 |
+
czr_map_module : {
|
7108 |
+
crud : false,
|
7109 |
+
name : api.czr_sektions.getRegisteredModuleProperty( 'czr_map_module', 'name' ),
|
7110 |
+
has_mod_opt : false,
|
7111 |
+
ready_on_section_expanded : true,
|
7112 |
+
defaultItemModel : api.czr_sektions.getDefaultItemModelFromRegisteredModuleData( 'czr_map_module' )
|
7113 |
+
}
|
7114 |
+
});
|
7115 |
+
})( wp.customize , jQuery, _ );//global sektionsLocalizedData, serverControlParams
|
7116 |
+
/* ------------------------------------------------------------------------- *
|
7117 |
+
* QUOTE DESIGN
|
7118 |
+
/* ------------------------------------------------------------------------- */
|
7119 |
+
( function ( api, $, _ ) {
|
7120 |
+
var Constructor = {
|
7121 |
+
initialize: function( id, options ) {
|
7122 |
+
var module = this;
|
7123 |
+
module.inputConstructor = api.CZRInput.extend({
|
7124 |
+
setupSelect : function() {
|
7125 |
+
api.czr_sektions.setupSelectInput.call( this );
|
7126 |
+
}
|
7127 |
+
});
|
7128 |
+
module.itemConstructor = api.CZRItem.extend( module.CZRButtonItemConstructor || {} );
|
7129 |
+
api.CZRDynModule.prototype.initialize.call( module, id, options );
|
7130 |
+
|
7131 |
+
},//initialize
|
7132 |
+
CZRButtonItemConstructor : {
|
7133 |
+
ready : function() {
|
7134 |
+
var item = this;
|
7135 |
+
item.inputCollection.bind( function( col ) {
|
7136 |
+
if( _.isEmpty( col ) )
|
7137 |
+
return;
|
7138 |
+
try { item.setInputVisibilityDeps(); } catch( er ) {
|
7139 |
+
api.errorLog( 'item.setInputVisibilityDeps() : ' + er );
|
7140 |
+
}
|
7141 |
+
});//item.inputCollection.bind()
|
7142 |
+
api.CZRItem.prototype.ready.call( item );
|
7143 |
+
},
|
7144 |
+
setInputVisibilityDeps : function() {
|
7145 |
+
var item = this,
|
7146 |
+
module = item.module;
|
7147 |
+
var scheduleVisibilityOfInputId = function( controlledInputId, visibilityCallBack ) {
|
7148 |
+
item.czr_Input( controlledInputId ).visible( visibilityCallBack() );
|
7149 |
+
this.bind( function( to ) {
|
7150 |
+
item.czr_Input( controlledInputId ).visible( visibilityCallBack() );
|
7151 |
+
});
|
7152 |
+
};
|
7153 |
+
item.czr_Input.each( function( input ) {
|
7154 |
+
switch( input.id ) {
|
7155 |
+
case 'quote_design' :
|
7156 |
+
_.each( [ 'border_width_css', 'border_color_css' ] , function( _inputId_ ) {
|
7157 |
+
try { scheduleVisibilityOfInputId.call( input, _inputId_, function() {
|
7158 |
+
return 'border-before' == input();
|
7159 |
+
}); } catch( er ) {
|
7160 |
+
api.errare( 'Quote module => error in setInputVisibilityDeps', er );
|
7161 |
+
}
|
7162 |
+
});
|
7163 |
+
_.each( [ 'icon_color_css', 'icon_size_css' ] , function( _inputId_ ) {
|
7164 |
+
try { scheduleVisibilityOfInputId.call( input, _inputId_, function() {
|
7165 |
+
return 'quote-icon-before' == input();
|
7166 |
+
}); } catch( er ) {
|
7167 |
+
api.errare( 'Quote module => error in setInputVisibilityDeps', er );
|
7168 |
+
}
|
7169 |
+
});
|
7170 |
+
break;
|
7171 |
+
}
|
7172 |
+
});
|
7173 |
+
}
|
7174 |
+
}
|
7175 |
+
};
|
7176 |
+
api.czrModuleMap = api.czrModuleMap || {};
|
7177 |
+
$.extend( api.czrModuleMap, {
|
7178 |
+
czr_quote_design_child : {
|
7179 |
+
mthds : Constructor,
|
7180 |
+
crud : false,
|
7181 |
+
name : api.czr_sektions.getRegisteredModuleProperty( 'czr_quote_design_child', 'name' ),
|
7182 |
+
has_mod_opt : false,
|
7183 |
+
ready_on_section_expanded : true,
|
7184 |
+
defaultItemModel : api.czr_sektions.getDefaultItemModelFromRegisteredModuleData( 'czr_quote_design_child' )
|
7185 |
+
}
|
7186 |
+
});
|
7187 |
+
})( wp.customize , jQuery, _ );
|
7188 |
+
|
7189 |
+
|
7190 |
+
|
7191 |
+
|
7192 |
+
|
7193 |
+
|
7194 |
+
|
7195 |
+
|
7196 |
+
|
7197 |
+
|
7198 |
+
/* ------------------------------------------------------------------------- *
|
7199 |
+
* QUOTE CONTENT
|
7200 |
+
/* ------------------------------------------------------------------------- */
|
7201 |
+
( function ( api, $, _ ) {
|
7202 |
+
var Constructor = {
|
7203 |
+
initialize: function( id, options ) {
|
7204 |
+
var module = this;
|
7205 |
+
module.inputConstructor = api.CZRInput.extend({
|
7206 |
+
setupSelect : function() {
|
7207 |
+
api.czr_sektions.setupSelectInput.call( this );
|
7208 |
+
}
|
7209 |
+
});
|
7210 |
+
api.CZRDynModule.prototype.initialize.call( module, id, options );
|
7211 |
+
|
7212 |
+
},//initialize
|
7213 |
+
};
|
7214 |
+
api.czrModuleMap = api.czrModuleMap || {};
|
7215 |
+
$.extend( api.czrModuleMap, {
|
7216 |
+
czr_quote_quote_child : {
|
7217 |
+
mthds : Constructor,
|
7218 |
+
crud : false,
|
7219 |
+
name : api.czr_sektions.getRegisteredModuleProperty( 'czr_quote_quote_child', 'name' ),
|
7220 |
+
has_mod_opt : false,
|
7221 |
+
ready_on_section_expanded : true,
|
7222 |
+
defaultItemModel : api.czr_sektions.getDefaultItemModelFromRegisteredModuleData( 'czr_quote_quote_child' )
|
7223 |
+
}
|
7224 |
+
});
|
7225 |
+
})( wp.customize , jQuery, _ );
|
7226 |
+
|
7227 |
+
|
7228 |
+
|
7229 |
+
|
7230 |
+
|
7231 |
+
|
7232 |
+
/* ------------------------------------------------------------------------- *
|
7233 |
+
* CITE CONTENT
|
7234 |
+
/* ------------------------------------------------------------------------- */
|
7235 |
+
( function ( api, $, _ ) {
|
7236 |
+
var Constructor = {
|
7237 |
+
initialize: function( id, options ) {
|
7238 |
+
var module = this;
|
7239 |
+
module.inputConstructor = api.CZRInput.extend({
|
7240 |
+
setupSelect : function() {
|
7241 |
+
api.czr_sektions.setupSelectInput.call( this );
|
7242 |
+
}
|
7243 |
+
});
|
7244 |
+
api.CZRDynModule.prototype.initialize.call( module, id, options );
|
7245 |
+
|
7246 |
+
},//initialize
|
7247 |
+
};
|
7248 |
+
api.czrModuleMap = api.czrModuleMap || {};
|
7249 |
+
$.extend( api.czrModuleMap, {
|
7250 |
+
czr_quote_cite_child : {
|
7251 |
+
mthds : Constructor,
|
7252 |
+
crud : false,
|
7253 |
+
name : api.czr_sektions.getRegisteredModuleProperty( 'czr_quote_cite_child', 'name' ),
|
7254 |
+
has_mod_opt : false,
|
7255 |
+
ready_on_section_expanded : true,
|
7256 |
+
defaultItemModel : api.czr_sektions.getDefaultItemModelFromRegisteredModuleData( 'czr_quote_cite_child' )
|
7257 |
+
}
|
7258 |
+
});
|
7259 |
+
})( wp.customize , jQuery, _ );
|
7260 |
+
/* ------------------------------------------------------------------------- *
|
7261 |
+
* BUTTON CONTENT
|
7262 |
+
/* ------------------------------------------------------------------------- */
|
7263 |
+
( function ( api, $, _ ) {
|
7264 |
+
var Constructor = {
|
7265 |
+
initialize: function( id, options ) {
|
7266 |
+
var module = this;
|
7267 |
+
module.inputConstructor = api.CZRInput.extend({
|
7268 |
+
setupSelect : function() {
|
7269 |
+
api.czr_sektions.setupSelectInput.call( this );
|
7270 |
+
}
|
7271 |
+
});
|
7272 |
+
module.itemConstructor = api.CZRItem.extend( module.CZRButtonItemConstructor || {} );
|
7273 |
+
module.bind( 'set_default_content_picker_options', function( params ) {
|
7274 |
+
params.defaultContentPickerOption.defaultOption = {
|
7275 |
+
'title' : '<span style="font-weight:bold">' + sektionsLocalizedData.i18n['Set a custom url'] + '</span>',
|
7276 |
+
'type' : '',
|
7277 |
+
'type_label' : '',
|
7278 |
+
'object' : '',
|
7279 |
+
'id' : '_custom_',
|
7280 |
+
'url' : ''
|
7281 |
+
};
|
7282 |
+
return params;
|
7283 |
+
});
|
7284 |
+
api.CZRDynModule.prototype.initialize.call( module, id, options );
|
7285 |
+
|
7286 |
+
},//initialize
|
7287 |
+
CZRButtonItemConstructor : {
|
7288 |
+
ready : function() {
|
7289 |
+
var item = this;
|
7290 |
+
item.inputCollection.bind( function( col ) {
|
7291 |
+
if( _.isEmpty( col ) )
|
7292 |
+
return;
|
7293 |
+
try { item.setInputVisibilityDeps(); } catch( er ) {
|
7294 |
+
api.errorLog( 'item.setInputVisibilityDeps() : ' + er );
|
7295 |
+
}
|
7296 |
+
});//item.inputCollection.bind()
|
7297 |
+
api.CZRItem.prototype.ready.call( item );
|
7298 |
+
},
|
7299 |
+
setInputVisibilityDeps : function() {
|
7300 |
+
var item = this,
|
7301 |
+
module = item.module;
|
7302 |
+
var scheduleVisibilityOfInputId = function( controlledInputId, visibilityCallBack ) {
|
7303 |
+
item.czr_Input( controlledInputId ).visible( visibilityCallBack() );
|
7304 |
+
this.bind( function( to ) {
|
7305 |
+
item.czr_Input( controlledInputId ).visible( visibilityCallBack() );
|
7306 |
+
});
|
7307 |
+
};
|
7308 |
+
item.czr_Input.each( function( input ) {
|
7309 |
+
switch( input.id ) {
|
7310 |
+
case 'link-to' :
|
7311 |
+
_.each( [ 'link-pick-url', 'link-custom-url', 'link-target' ] , function( _inputId_ ) {
|
7312 |
+
try { scheduleVisibilityOfInputId.call( input, _inputId_, function() {
|
7313 |
+
var bool = false;
|
7314 |
+
switch( _inputId_ ) {
|
7315 |
+
case 'link-custom-url' :
|
7316 |
+
bool = 'url' == input() && '_custom_' == item.czr_Input('link-pick-url')().id;
|
7317 |
+
break;
|
7318 |
+
default :
|
7319 |
+
bool = 'url' == input();
|
7320 |
+
break;
|
7321 |
+
}
|
7322 |
+
return bool;
|
7323 |
+
}); } catch( er ) {
|
7324 |
+
api.errare( 'Button module => error in setInputVisibilityDeps', er );
|
7325 |
+
}
|
7326 |
+
});
|
7327 |
+
break;
|
7328 |
+
case 'link-pick-url' :
|
7329 |
+
scheduleVisibilityOfInputId.call( input, 'link-custom-url', function() {
|
7330 |
+
return '_custom_' == input().id && 'url' == item.czr_Input('link-to')();
|
7331 |
+
});
|
7332 |
+
break;
|
7333 |
+
case 'icon' :
|
7334 |
+
scheduleVisibilityOfInputId.call( input, 'icon-side', function() {
|
7335 |
+
return !_.isEmpty( input() );
|
7336 |
+
});
|
7337 |
+
break;
|
7338 |
+
}
|
7339 |
+
});
|
7340 |
+
}
|
7341 |
+
}
|
7342 |
};
|
7343 |
+
api.czrModuleMap = api.czrModuleMap || {};
|
7344 |
+
$.extend( api.czrModuleMap, {
|
7345 |
+
czr_btn_content_child : {
|
7346 |
+
mthds : Constructor,
|
7347 |
+
crud : false,
|
7348 |
+
name : api.czr_sektions.getRegisteredModuleProperty( 'czr_btn_content_child', 'name' ),
|
7349 |
+
has_mod_opt : false,
|
7350 |
+
ready_on_section_expanded : true,
|
7351 |
+
defaultItemModel : api.czr_sektions.getDefaultItemModelFromRegisteredModuleData( 'czr_btn_content_child' )
|
7352 |
+
}
|
7353 |
+
});
|
7354 |
+
})( wp.customize , jQuery, _ );
|
7355 |
+
|
7356 |
+
|
7357 |
+
|
7358 |
+
|
7359 |
+
|
7360 |
+
|
7361 |
+
|
7362 |
+
|
7363 |
|
7364 |
|
7365 |
+
/* ------------------------------------------------------------------------- *
|
7366 |
+
* BUTTON DESIGN
|
7367 |
+
/* ------------------------------------------------------------------------- */
|
7368 |
+
( function ( api, $, _ ) {
|
7369 |
+
var Constructor = {
|
7370 |
+
initialize: function( id, options ) {
|
7371 |
+
var module = this;
|
7372 |
+
module.inputConstructor = api.CZRInput.extend({
|
7373 |
+
setupSelect : function() {
|
7374 |
+
api.czr_sektions.setupSelectInput.call( this );
|
7375 |
+
}
|
7376 |
+
});
|
7377 |
+
module.itemConstructor = api.CZRItem.extend( module.CZRButtonItemConstructor || {} );
|
7378 |
+
api.CZRDynModule.prototype.initialize.call( module, id, options );
|
7379 |
+
|
7380 |
+
},//initialize
|
7381 |
+
CZRButtonItemConstructor : {
|
7382 |
+
ready : function() {
|
7383 |
+
var item = this;
|
7384 |
+
item.inputCollection.bind( function( col ) {
|
7385 |
+
if( _.isEmpty( col ) )
|
7386 |
+
return;
|
7387 |
+
try { item.setInputVisibilityDeps(); } catch( er ) {
|
7388 |
+
api.errorLog( 'item.setInputVisibilityDeps() : ' + er );
|
7389 |
+
}
|
7390 |
+
});//item.inputCollection.bind()
|
7391 |
+
api.CZRItem.prototype.ready.call( item );
|
7392 |
+
},
|
7393 |
+
setInputVisibilityDeps : function() {
|
7394 |
+
var item = this,
|
7395 |
+
module = item.module;
|
7396 |
+
var scheduleVisibilityOfInputId = function( controlledInputId, visibilityCallBack ) {
|
7397 |
+
item.czr_Input( controlledInputId ).visible( visibilityCallBack() );
|
7398 |
+
this.bind( function( to ) {
|
7399 |
+
item.czr_Input( controlledInputId ).visible( visibilityCallBack() );
|
7400 |
+
});
|
7401 |
+
};
|
7402 |
+
item.czr_Input.each( function( input ) {
|
7403 |
+
switch( input.id ) {
|
7404 |
+
case 'use_custom_bg_color_on_hover' :
|
7405 |
+
_.each( [ 'bg_color_hover' ] , function( _inputId_ ) {
|
7406 |
+
try { scheduleVisibilityOfInputId.call( input, _inputId_, function() {
|
7407 |
+
return input();
|
7408 |
+
}); } catch( er ) {
|
7409 |
+
api.errare( 'Button module => error in setInputVisibilityDeps', er );
|
7410 |
+
}
|
7411 |
+
});
|
7412 |
+
break;
|
7413 |
+
case 'border-type' :
|
7414 |
+
_.each( [ 'borders' ] , function(_inputId_ ) {
|
7415 |
+
try { scheduleVisibilityOfInputId.call( input, _inputId_, function() {
|
7416 |
+
return 'none' !== input();
|
7417 |
+
}); } catch( er ) {
|
7418 |
+
api.errare( module.id + ' => error in setInputVisibilityDeps', er );
|
7419 |
+
}
|
7420 |
+
});
|
7421 |
+
break;
|
7422 |
+
case 'use_box_shadow' :
|
7423 |
+
_.each( [ 'push_effect' ] , function( _inputId_ ) {
|
7424 |
+
try { scheduleVisibilityOfInputId.call( input, _inputId_, function() {
|
7425 |
+
return input();
|
7426 |
+
}); } catch( er ) {
|
7427 |
+
api.errare( 'Button module => error in setInputVisibilityDeps', er );
|
7428 |
+
}
|
7429 |
+
});
|
7430 |
+
break;
|
7431 |
+
}
|
7432 |
+
});
|
7433 |
+
}
|
7434 |
+
}
|
7435 |
+
};
|
7436 |
api.czrModuleMap = api.czrModuleMap || {};
|
7437 |
$.extend( api.czrModuleMap, {
|
7438 |
+
czr_btn_design_child : {
|
7439 |
mthds : Constructor,
|
7440 |
crud : false,
|
7441 |
+
name : api.czr_sektions.getRegisteredModuleProperty( 'czr_btn_design_child', 'name' ),
|
7442 |
has_mod_opt : false,
|
7443 |
ready_on_section_expanded : true,
|
7444 |
+
defaultItemModel : api.czr_sektions.getDefaultItemModelFromRegisteredModuleData( 'czr_btn_design_child' )
|
7445 |
+
}
|
|
|
|
|
|
|
7446 |
});
|
7447 |
})( wp.customize , jQuery, _ );//global sektionsLocalizedData, serverControlParams
|
|
|
7448 |
( function ( api, $, _ ) {
|
7449 |
var Constructor = {
|
7450 |
+
initialize: function( id, options ) {
|
7451 |
+
var module = this;
|
7452 |
+
module.inputConstructor = api.CZRInput.extend({
|
7453 |
+
setupSelect : function() {
|
7454 |
+
api.czr_sektions.setupSelectInput.call( this );
|
7455 |
+
}
|
7456 |
+
});
|
7457 |
+
module.itemConstructor = api.CZRItem.extend( module.CZRItemConstructor || {} );
|
7458 |
+
api.CZRDynModule.prototype.initialize.call( module, id, options );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7459 |
|
7460 |
+
},//initialize
|
7461 |
+
CZRItemConstructor : {
|
7462 |
+
ready : function() {
|
7463 |
+
var item = this;
|
7464 |
+
item.inputCollection.bind( function( col ) {
|
7465 |
+
if( _.isEmpty( col ) )
|
7466 |
return;
|
7467 |
+
try { item.setInputVisibilityDeps(); } catch( er ) {
|
7468 |
+
api.errorLog( 'item.setInputVisibilityDeps() : ' + er );
|
7469 |
+
}
|
7470 |
+
});//item.inputCollection.bind()
|
7471 |
+
api.CZRItem.prototype.ready.call( item );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7472 |
},
|
7473 |
+
setInputVisibilityDeps : function() {
|
7474 |
+
var item = this,
|
7475 |
+
module = item.module;
|
7476 |
+
var scheduleVisibilityOfInputId = function( controlledInputId, visibilityCallBack ) {
|
7477 |
+
item.czr_Input( controlledInputId ).visible( visibilityCallBack() );
|
7478 |
+
this.bind( function( to ) {
|
7479 |
+
item.czr_Input( controlledInputId ).visible( visibilityCallBack() );
|
7480 |
+
});
|
7481 |
+
};
|
7482 |
+
item.czr_Input.each( function( input ) {
|
7483 |
+
switch( input.id ) {
|
7484 |
+
case 'show_name_field' :
|
7485 |
+
_.each( [ 'name_field_label', 'name_field_required' ] , function( _inputId_ ) {
|
7486 |
+
try { scheduleVisibilityOfInputId.call( input, _inputId_, function() {
|
7487 |
+
return input();
|
7488 |
+
}); } catch( er ) {
|
7489 |
+
api.errare( input.module.module_type + ' => error in setInputVisibilityDeps', er );
|
7490 |
+
}
|
7491 |
+
});
|
7492 |
+
break;
|
7493 |
+
case 'show_subject_field' :
|
7494 |
+
_.each( [ 'subject_field_label', 'subject_field_required' ] , function( _inputId_ ) {
|
7495 |
+
try { scheduleVisibilityOfInputId.call( input, _inputId_, function() {
|
7496 |
+
return input();
|
7497 |
+
}); } catch( er ) {
|
7498 |
+
api.errare( input.module.module_type + ' => error in setInputVisibilityDeps', er );
|
7499 |
+
}
|
7500 |
+
});
|
7501 |
+
break;
|
7502 |
+
case 'show_message_field' :
|
7503 |
+
_.each( [ 'message_field_label', 'message_field_required' ] , function( _inputId_ ) {
|
7504 |
+
try { scheduleVisibilityOfInputId.call( input, _inputId_, function() {
|
7505 |
+
return input();
|
7506 |
+
}); } catch( er ) {
|
7507 |
+
api.errare( input.module.module_type + ' => error in setInputVisibilityDeps', er );
|
7508 |
+
}
|
7509 |
+
});
|
7510 |
+
break;
|
7511 |
+
case 'link-pick-url' :
|
7512 |
+
try { scheduleVisibilityOfInputId.call( input, 'link-custom-url', function() {
|
7513 |
+
return input();
|
7514 |
+
}); } catch( er ) {
|
7515 |
+
api.errare( input.module.module_type + ' => error in setInputVisibilityDeps', er );
|
7516 |
+
}
|
7517 |
+
break;
|
7518 |
+
}
|
7519 |
+
});
|
7520 |
+
}
|
7521 |
+
}
|
7522 |
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7523 |
api.czrModuleMap = api.czrModuleMap || {};
|
7524 |
$.extend( api.czrModuleMap, {
|
7525 |
+
czr_simple_form_fields_child: {
|
7526 |
mthds : Constructor,
|
7527 |
crud : false,
|
7528 |
+
name : api.czr_sektions.getRegisteredModuleProperty( 'czr_simple_form_fields_child', 'name' ),
|
7529 |
has_mod_opt : false,
|
7530 |
ready_on_section_expanded : true,
|
7531 |
+
defaultItemModel : api.czr_sektions.getDefaultItemModelFromRegisteredModuleData( 'czr_simple_form_fields_child' )
|
7532 |
+
}
|
|
|
|
|
|
|
7533 |
});
|
7534 |
})( wp.customize , jQuery, _ );//global sektionsLocalizedData, serverControlParams
|
|
|
7535 |
( function ( api, $, _ ) {
|
7536 |
+
var Constructor = {
|
7537 |
+
initialize: function( id, options ) {
|
7538 |
+
var module = this;
|
7539 |
+
module.inputConstructor = api.CZRInput.extend({
|
7540 |
+
setupSelect : function() {
|
7541 |
+
api.czr_sektions.setupSelectInput.call( this );
|
7542 |
+
}
|
7543 |
+
});
|
7544 |
+
module.itemConstructor = api.CZRItem.extend( module.CZRItemConstructor || {} );
|
7545 |
+
api.CZRDynModule.prototype.initialize.call( module, id, options );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7546 |
|
7547 |
+
},//initialize
|
7548 |
+
CZRItemConstructor : {
|
7549 |
+
ready : function() {
|
7550 |
var item = this;
|
7551 |
+
item.inputCollection.bind( function( col ) {
|
7552 |
+
if( _.isEmpty( col ) )
|
7553 |
+
return;
|
7554 |
+
try { item.setInputVisibilityDeps(); } catch( er ) {
|
7555 |
+
api.errorLog( 'item.setInputVisibilityDeps() : ' + er );
|
|
|
7556 |
}
|
7557 |
+
});//item.inputCollection.bind()
|
7558 |
+
api.CZRItem.prototype.ready.call( item );
|
7559 |
+
},
|
7560 |
+
setInputVisibilityDeps : function() {
|
7561 |
+
var item = this,
|
7562 |
+
module = item.module;
|
7563 |
+
var scheduleVisibilityOfInputId = function( controlledInputId, visibilityCallBack ) {
|
7564 |
+
item.czr_Input( controlledInputId ).visible( visibilityCallBack() );
|
7565 |
+
this.bind( function( to ) {
|
7566 |
+
item.czr_Input( controlledInputId ).visible( visibilityCallBack() );
|
7567 |
+
});
|
7568 |
+
};
|
7569 |
+
item.czr_Input.each( function( input ) {
|
7570 |
+
switch( input.id ) {
|
7571 |
+
case 'border-type' :
|
7572 |
+
_.each( [ 'borders' ] , function(_inputId_ ) {
|
7573 |
+
try { scheduleVisibilityOfInputId.call( input, _inputId_, function() {
|
7574 |
+
return 'none' !== input();
|
7575 |
+
}); } catch( er ) {
|
7576 |
+
api.errare( module.id + ' => error in setInputVisibilityDeps', er );
|
7577 |
+
}
|
7578 |
+
});
|
7579 |
+
break;
|
7580 |
}
|
7581 |
});
|
7582 |
}
|
7583 |
+
}
|
7584 |
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7585 |
api.czrModuleMap = api.czrModuleMap || {};
|
7586 |
$.extend( api.czrModuleMap, {
|
7587 |
+
czr_simple_form_design_child: {
|
7588 |
+
mthds : Constructor,
|
7589 |
crud : false,
|
7590 |
+
name : api.czr_sektions.getRegisteredModuleProperty( 'czr_simple_form_design_child', 'name' ),
|
7591 |
has_mod_opt : false,
|
7592 |
ready_on_section_expanded : true,
|
7593 |
+
defaultItemModel : api.czr_sektions.getDefaultItemModelFromRegisteredModuleData( 'czr_simple_form_design_child' )
|
7594 |
+
}
|
|
|
|
|
|
|
7595 |
});
|
7596 |
})( wp.customize , jQuery, _ );//global sektionsLocalizedData, serverControlParams
|
|
|
7597 |
( function ( api, $, _ ) {
|
7598 |
+
var Constructor = {
|
7599 |
+
initialize: function( id, options ) {
|
7600 |
+
var module = this;
|
7601 |
+
module.inputConstructor = api.CZRInput.extend({
|
7602 |
+
setupSelect : function() {
|
7603 |
+
api.czr_sektions.setupSelectInput.call( this );
|
7604 |
+
}
|
7605 |
+
});
|
7606 |
+
module.itemConstructor = api.CZRItem.extend( module.CZRItemConstructor || {} );
|
7607 |
+
api.CZRDynModule.prototype.initialize.call( module, id, options );
|
7608 |
+
|
7609 |
+
},//initialize
|
7610 |
+
CZRItemConstructor : {
|
7611 |
+
ready : function() {
|
7612 |
+
var item = this;
|
7613 |
+
item.inputCollection.bind( function( col ) {
|
7614 |
+
if( _.isEmpty( col ) )
|
7615 |
+
return;
|
7616 |
+
try { item.setInputVisibilityDeps(); } catch( er ) {
|
7617 |
+
api.errorLog( 'item.setInputVisibilityDeps() : ' + er );
|
7618 |
+
}
|
7619 |
+
});//item.inputCollection.bind()
|
7620 |
+
api.CZRItem.prototype.ready.call( item );
|
7621 |
+
},
|
7622 |
+
setInputVisibilityDeps : function() {
|
7623 |
+
var item = this,
|
7624 |
+
module = item.module;
|
7625 |
+
var scheduleVisibilityOfInputId = function( controlledInputId, visibilityCallBack ) {
|
7626 |
+
item.czr_Input( controlledInputId ).visible( visibilityCallBack() );
|
7627 |
+
this.bind( function( to ) {
|
7628 |
+
item.czr_Input( controlledInputId ).visible( visibilityCallBack() );
|
7629 |
+
});
|
7630 |
+
};
|
7631 |
+
item.czr_Input.each( function( input ) {
|
7632 |
+
switch( input.id ) {
|
7633 |
+
case 'use_custom_bg_color_on_hover' :
|
7634 |
+
_.each( [ 'bg_color_hover' ] , function( _inputId_ ) {
|
7635 |
+
try { scheduleVisibilityOfInputId.call( input, _inputId_, function() {
|
7636 |
+
return input();
|
7637 |
+
}); } catch( er ) {
|
7638 |
+
api.errare( input.module.module_type + ' => error in setInputVisibilityDeps', er );
|
7639 |
+
}
|
7640 |
+
});
|
7641 |
+
break;
|
7642 |
+
case 'use_box_shadow' :
|
7643 |
+
_.each( [ 'push_effect' ] , function( _inputId_ ) {
|
7644 |
+
try { scheduleVisibilityOfInputId.call( input, _inputId_, function() {
|
7645 |
+
return input();
|
7646 |
+
}); } catch( er ) {
|
7647 |
+
api.errare( input.module.module_type + ' => error in setInputVisibilityDeps', er );
|
7648 |
+
}
|
7649 |
+
});
|
7650 |
+
break;
|
7651 |
+
}
|
7652 |
+
});
|
7653 |
+
}
|
7654 |
+
}
|
7655 |
+
};
|
7656 |
api.czrModuleMap = api.czrModuleMap || {};
|
7657 |
$.extend( api.czrModuleMap, {
|
7658 |
+
czr_simple_form_button_child: {
|
7659 |
+
mthds : Constructor,
|
7660 |
crud : false,
|
7661 |
+
name : api.czr_sektions.getRegisteredModuleProperty( 'czr_simple_form_button_child', 'name' ),
|
7662 |
has_mod_opt : false,
|
7663 |
ready_on_section_expanded : true,
|
7664 |
+
defaultItemModel : api.czr_sektions.getDefaultItemModelFromRegisteredModuleData( 'czr_simple_form_button_child' )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7665 |
}
|
7666 |
});
|
7667 |
})( wp.customize , jQuery, _ );//global sektionsLocalizedData, serverControlParams
|
|
|
7668 |
( function ( api, $, _ ) {
|
7669 |
+
var Constructor = {
|
7670 |
+
initialize: function( id, options ) {
|
7671 |
+
var module = this;
|
7672 |
+
module.inputConstructor = api.CZRInput.extend({
|
7673 |
+
setupSelect : function() {
|
7674 |
+
api.czr_sektions.setupSelectInput.call( this );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7675 |
}
|
7676 |
+
});
|
7677 |
+
api.CZRDynModule.prototype.initialize.call( module, id, options );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7678 |
|
7679 |
+
},//initialize
|
7680 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7681 |
api.czrModuleMap = api.czrModuleMap || {};
|
7682 |
$.extend( api.czrModuleMap, {
|
7683 |
+
czr_simple_form_fonts_child: {
|
7684 |
+
mthds : Constructor,
|
7685 |
crud : false,
|
7686 |
+
name : api.czr_sektions.getRegisteredModuleProperty( 'czr_simple_form_fonts_child', 'name' ),
|
7687 |
has_mod_opt : false,
|
7688 |
ready_on_section_expanded : true,
|
7689 |
+
defaultItemModel : api.czr_sektions.getDefaultItemModelFromRegisteredModuleData( 'czr_simple_form_fonts_child' )
|
7690 |
+
}
|
7691 |
});
|
7692 |
})( wp.customize , jQuery, _ );//global sektionsLocalizedData, serverControlParams
|
|
|
7693 |
( function ( api, $, _ ) {
|
7694 |
+
api.czrModuleMap = api.czrModuleMap || {};
|
7695 |
+
$.extend( api.czrModuleMap, {
|
7696 |
+
czr_simple_form_submission_child: {
|
7697 |
+
crud : false,
|
7698 |
+
name : api.czr_sektions.getRegisteredModuleProperty( 'czr_simple_form_submission_child', 'name' ),
|
7699 |
+
has_mod_opt : false,
|
7700 |
+
ready_on_section_expanded : true,
|
7701 |
+
defaultItemModel : api.czr_sektions.getDefaultItemModelFromRegisteredModuleData( 'czr_simple_form_submission_child' )
|
7702 |
+
}
|
7703 |
+
});
|
7704 |
+
})( wp.customize , jQuery, _ );//global sektionsLocalizedData, serverControlParams
|
7705 |
+
( function ( api, $, _ ) {
|
7706 |
+
var Constructor = {
|
7707 |
+
initialize: function( id, options ) {
|
7708 |
+
var module = this;
|
7709 |
+
module.inputConstructor = api.CZRInput.extend({
|
7710 |
+
setupSelect : function() {
|
7711 |
+
api.czr_sektions.setupSelectInput.call( this );
|
7712 |
+
}
|
7713 |
+
});
|
7714 |
+
module.itemConstructor = api.CZRItem.extend( module.CZRButtonItemConstructor || {} );
|
7715 |
+
api.CZRDynModule.prototype.initialize.call( module, id, options );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7716 |
|
7717 |
+
},//initialize
|
7718 |
+
CZRButtonItemConstructor : {
|
7719 |
+
ready : function() {
|
7720 |
+
var item = this;
|
7721 |
+
item.inputCollection.bind( function( col ) {
|
7722 |
+
if( _.isEmpty( col ) )
|
7723 |
return;
|
7724 |
+
try { item.setInputVisibilityDeps(); } catch( er ) {
|
7725 |
+
api.errorLog( 'item.setInputVisibilityDeps() : ' + er );
|
7726 |
+
}
|
7727 |
+
});//item.inputCollection.bind()
|
7728 |
+
api.CZRItem.prototype.ready.call( item );
|
7729 |
+
},
|
7730 |
+
setInputVisibilityDeps : function() {
|
7731 |
+
var item = this,
|
7732 |
+
module = item.module;
|
7733 |
+
var scheduleVisibilityOfInputId = function( controlledInputId, visibilityCallBack ) {
|
7734 |
+
item.czr_Input( controlledInputId ).visible( visibilityCallBack() );
|
7735 |
+
this.bind( function( to ) {
|
7736 |
+
item.czr_Input( controlledInputId ).visible( visibilityCallBack() );
|
7737 |
+
});
|
7738 |
+
};
|
7739 |
+
item.czr_Input.each( function( input ) {
|
7740 |
+
switch( input.id ) {
|
7741 |
+
case 'use_custom_bg_color_on_hover' :
|
7742 |
+
_.each( [ 'bg_color_hover' ] , function( _inputId_ ) {
|
7743 |
+
try { scheduleVisibilityOfInputId.call( input, _inputId_, function() {
|
7744 |
+
return input();
|
7745 |
+
}); } catch( er ) {
|
7746 |
+
api.errare( 'Button module => error in setInputVisibilityDeps', er );
|
7747 |
+
}
|
7748 |
+
});
|
7749 |
+
break;
|
7750 |
+
case 'use_box_shadow' :
|
7751 |
+
_.each( [ 'push_effect' ] , function( _inputId_ ) {
|
7752 |
+
try { scheduleVisibilityOfInputId.call( input, _inputId_, function() {
|
7753 |
+
return input();
|
7754 |
+
}); } catch( er ) {
|
7755 |
+
api.errare( 'Button module => error in setInputVisibilityDeps', er );
|
7756 |
+
}
|
7757 |
+
});
|
7758 |
+
break;
|
7759 |
+
case 'link-to' :
|
7760 |
+
_.each( [ 'link-pick-url', 'link-custom-url', 'link-target' ] , function( _inputId_ ) {
|
7761 |
+
try { scheduleVisibilityOfInputId.call( input, _inputId_, function() {
|
7762 |
+
var bool = false;
|
7763 |
+
switch( _inputId_ ) {
|
7764 |
+
case 'link-custom-url' :
|
7765 |
+
bool = 'url' == input() && '_custom_' == item.czr_Input('link-pick-url')().id;
|
7766 |
+
break;
|
7767 |
+
default :
|
7768 |
+
bool = 'url' == input();
|
7769 |
+
break;
|
7770 |
+
}
|
7771 |
+
return bool;
|
7772 |
+
}); } catch( er ) {
|
7773 |
+
api.errare( 'Button module => error in setInputVisibilityDeps', er );
|
7774 |
+
}
|
7775 |
+
});
|
7776 |
+
break;
|
7777 |
+
case 'link-pick-url' :
|
7778 |
+
scheduleVisibilityOfInputId.call( input, 'link-custom-url', function() {
|
7779 |
+
return '_custom_' == input().id && 'url' == item.czr_Input('link-to')();
|
7780 |
+
});
|
7781 |
+
break;
|
7782 |
+
}
|
7783 |
+
});
|
7784 |
}
|
7785 |
+
}
|
7786 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7787 |
api.czrModuleMap = api.czrModuleMap || {};
|
7788 |
$.extend( api.czrModuleMap, {
|
7789 |
+
czr_font_child : {
|
7790 |
+
mthds : Constructor,
|
7791 |
crud : false,
|
7792 |
+
name : api.czr_sektions.getRegisteredModuleProperty( 'czr_font_child', 'name' ),
|
7793 |
has_mod_opt : false,
|
7794 |
ready_on_section_expanded : true,
|
7795 |
+
defaultItemModel : api.czr_sektions.getDefaultItemModelFromRegisteredModuleData( 'czr_font_child' )
|
7796 |
+
}
|
7797 |
});
|
7798 |
})( wp.customize , jQuery, _ );
|
assets/czr/sek/js/ccat-sek-control.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var CZRSeksPrototype=CZRSeksPrototype||{};!function(o,n){n.extend(CZRSeksPrototype,{initialize:function(){var i=this;if(_.isUndefined(window.sektionsLocalizedData))throw new Error("CZRSeksPrototype => missing localized server params sektionsLocalizedData");if(!_.isFunction(o.czr_activeSkopes))throw new Error("CZRSeksPrototype => api.czr_activeSkopes");i.MAX_NUMBER_OF_COLUMNS=12,i.SETTING_UPDATE_BUFFER=50,i.defaultSektionSettingValue=sektionsLocalizedData.defaultSektionSettingValue,i.sekCollectionSettingId=new o.Value({}),i.registered=new o.Value([]),o.bind("ready",function(){i.registerAndSetupDefaultPanelSectionOptions(),i.sekCollectionSettingId.callbacks.add(function(e,t){try{i.setupSettingToBeSaved()}catch(e){o.errare("Error in self.sekCollectionSettingId.callbacks => self.setupSettingsToBeSaved()",e)}}),_.isEmpty(o.czr_activeSkopes().local)||i.setContextualCollectionSettingIdWhenSkopeSet(),o.czr_activeSkopes.callbacks.add(function(e,t){i.setContextualCollectionSettingIdWhenSkopeSet(e,t)}),i.reactToPreviewMsg(),i.setupDnd(),i.setupTinyMceEditor(),i.schedulePrintSectionJson(),i.bind("sek-ui-removed",function(){o.previewedDevice("desktop")}),o.previewedDevice.bind(function(t){var e=_.filter(i.registered(),function(e){return"control"==e.what});_.each(e||[],function(e){o.control(e.id,function(e){e.container.find('[data-sek-device="'+t+'"]').each(function(){n(this).trigger("click")})})})}),n("#customize-notifications-area").on("click",'[data-sek-reset="true"]',function(){i.resetCollectionSetting()}),i.bind("sek-ui-pre-removal",function(e){"control"==e.what&&-1<e.id.indexOf("draggable")&&o.control(e.id,function(e){e.container.find("[draggable]").each(function(){n(this).off("dragstart dragend")})}),"control"==e.what&&o.control(e.id,function(e){e.container.find("select").each(function(){_.isUndefined(n(this).data("select2"))||n(this).select2("destroy")})})})})},registerAndSetupDefaultPanelSectionOptions:function(){var e=o.Panel.extend({isContextuallyActive:function(){return this.active()},_toggleActive:function(){return!0}});o.panel(sektionsLocalizedData.sektionsPanelId,function(n){n.deferred.embedded.done(function(){var e=n.container.find("h3.accordion-section-title"),t=(n.container.find(".panel-meta .accordion-section-title"),['<img class="sek-nimble-logo" alt="'+n.params.title+'" src="',sektionsLocalizedData.baseUrl,"/assets/img/nimble/nimble_horizontal.svg",'"/>'].join(""));if(0<e.length){e.on("click",function(e){o.previewer.trigger("sek-pick-module")});var i=e.find("span");e.addClass("sek-side-nimble-logo-wrapper").html(t).append(i)}})}),this.register({what:"panel",id:sektionsLocalizedData.sektionsPanelId,title:sektionsLocalizedData.i18n["Nimble Builder"],priority:1e3,constructWith:e,track:!1})},setContextualCollectionSettingIdWhenSkopeSet:function(e,t){!_.isEmpty(t.local)&&o.panel(sektionsLocalizedData.sektionsPanelId).expanded()&&o.previewer.trigger("sek-pick-module"),sektionsData=o.czr_skopeBase.getSkopeProperty("sektions","local"),sektionsLocalizedData.isDevMode&&o.infoLog("::setContextualCollectionSettingIdWhenSkopeSet => SEKTIONS DATA ? ",sektionsData),_.isEmpty(sektionsData)&&o.errare("::setContextualCollectionSettingIdWhenSkopeSet() => no sektionsData"),_.isEmpty(sektionsData.setting_id)&&o.errare("::setContextualCollectionSettingIdWhenSkopeSet() => missing setting_id"),this.sekCollectionSettingId(sektionsData.setting_id)}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(s,c){c.extend(CZRSeksPrototype,{setupSettingToBeSaved:function(){var e,t=this;e=s.czr_skopeBase.getSkopeProperty("sektions","local").db_values;var i=t.sekCollectionSettingId();if(_.isEmpty(i))throw new Error("setupSettingsToBeSaved => the collectionSettingId is invalid");if(!s.has(i)){t.register({what:"setting",id:i,value:t.validateSettingValue(_.isObject(e)?e:t.defaultSektionSettingValue),transport:"postMessage",type:"option",track:!1});sektionsLocalizedData.isDevMode&&s(i,function(e){e.bind(function(e,t,i){s.infoLog("sektionSettingValue is updated",{newValue:e,previousValue:t,params:i})})})}},validateSettingValue:function(i){if(!_.isObject(i))return s.errare("validation error => the setting should be an object",i),null;var n={},o=!1,e=[],r=function(e){s.errare(e,i),s.previewer.trigger("sek-notify",{type:"error",duration:3e4,message:['<span style="font-size:0.95em">',"<strong>"+e+"</strong>","<br>",sektionsLocalizedData.i18n["If this problem locks the Nimble builder, you might try to reset the sections for this page."],"<br>",'<span style="text-align:center;display:block">','<button type="button" class="button" aria-label="'+sektionsLocalizedData.i18n.Reset+'" data-sek-reset="true">'+sektionsLocalizedData.i18n.Reset+"</button>","</span>","</span>"].join("")}),o=!0},a=function(t){if(!o)if(_.isUndefined(t)&&_.isEmpty(n)){if(t=c.extend(!0,{},i),_.isUndefined(t.id)||_.isUndefined(t.level)){if(_.isUndefined(t.collection))return void r("validation error => the root level is missing the collection of locations");if(!_.isEmpty(t.level)||!_.isEmpty(t.id))return void r('validation error => the root level should not have a "level" or an "id" property');_.each(i.collection,function(e){n=t,a(e)})}}else{if(_.isEmpty(t.id)||!_.isString(t.id))return void r("validation error => a "+t.level+" level must have a valid id");if(_.contains(e,t.id))return void r("validation error => duplicated level id : "+t.id);if(e.push(t.id),_.isEmpty(t.level)||!_.isString(t.level))return void r("validation error => a "+t.level+" level must have a level property");if(!_.contains(["location","section","column","module"],t.level))return void r('validation error => the level "'+t.level+'" is not authorized');if("module"==t.level){if(!_.isUndefined(t.collection))return void r("validation error => a module can not have a collection property")}else if(_.isUndefined(t.collection))return void r("validation error => missing collection property for level => "+t.level+" "+t.id);switch(t.level){case"location":if(!_.isEmpty(n.level))return void r("validation error => the parent of location "+t.id+" should have no level set");break;case"section":if(t.is_nested&&"column"!=n.level)return void r("validation error => the nested section "+t.id+" must be child of a column");if(!t.is_nested&&"location"!=n.level)return void r("validation error => the section "+t.id+" must be child of a location");break;case"column":if("section"!=n.level)return void r("validation error => the column "+t.id+" must be child of a section");break;case"module":if("column"!=n.level)return void r("validation error => the module "+t.id+" must be child of a column")}"module"!=t.level&&_.each(t.collection,function(e){n=c.extend(!0,{},t),a(e)})}};return a(),o?null:i},resetCollectionSetting:function(){var e=this;if(_.isEmpty(e.sekCollectionSettingId()))throw new Error("setupSettingsToBeSaved => the collectionSettingId is invalid");s(e.sekCollectionSettingId())(e.defaultSektionSettingValue),s.previewer.refresh(),s.notifications.remove("sek-notify"),s.panel(sektionsLocalizedData.sektionsPanelId,function(e){s.notifications.add(new s.Notification("sek-reset-done",{type:"success",message:sektionsLocalizedData.i18n["Reset complete"],dismissible:!0})),_.delay(function(){s.notifications.remove("sek-reset-done")},5e3)})}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(c,l){l.extend(CZRSeksPrototype,{reactToPreviewMsg:function(){var o=this,r={},a={},s=!0,e={"sek-add-section":{callback:function(e){return s=!!_.isUndefined(e.send_to_preview)||e.send_to_preview,a={},r={action:"sek-add-section",id:sektionsLocalizedData.optPrefixForSektionsNotSaved+o.guid(),location:e.location,in_sektion:e.in_sektion,in_column:e.in_column,is_nested:!_.isEmpty(e.in_sektion)&&!_.isEmpty(e.in_column),before_section:e.before_section,after_section:e.after_section,is_first_section:e.is_first_section},o.updateAPISetting(r)},complete:function(e){e.apiParams.is_first_section&&c.previewer.trigger("sek-refresh-level",{level:"location",id:e.apiParams.location}),c.previewer.trigger("sek-pick-module",{}),c.previewer.send("sek-focus-on",{id:e.apiParams.id})}},"sek-add-column":{callback:function(e){return s=!0,a={},r={id:sektionsLocalizedData.optPrefixForSektionsNotSaved+o.guid(),action:"sek-add-column",in_sektion:e.in_sektion,autofocus:e.autofocus},o.updateAPISetting(r)},complete:function(e){!1!==e.apiParams.autofocus&&c.previewer.trigger("sek-pick-module",{})}},"sek-add-module":{callback:function(e){return s=!0,a={},r={id:sektionsLocalizedData.optPrefixForSektionsNotSaved+o.guid(),action:"sek-add-module",in_sektion:e.in_sektion,in_column:e.in_column,module_type:e.content_id,before_module:e.before_module,after_module:e.after_module},o.updateAPISetting(r)},complete:function(e){c.previewer.trigger("sek-edit-module",{id:e.apiParams.id,level:"module",in_sektion:e.apiParams.in_sektion,in_column:e.apiParams.in_column}),o.updateAPISetting({action:"sek-update-fonts"}),c.previewer.send("sek-refresh-stylesheet",{skope_id:c.czr_skopeBase.getSkopeProperty("skope_id")})}},"sek-remove":{callback:function(e){switch(s=!0,a={},e.level){case"section":r={action:"sek-remove-section",id:e.id,location:e.location,in_sektion:e.in_sektion,in_column:e.in_column,is_nested:!_.isEmpty(e.in_sektion)&&!_.isEmpty(e.in_column)};break;case"column":r={action:"sek-remove-column",id:e.id,in_sektion:e.in_sektion};break;case"module":r={action:"sek-remove-module",id:e.id,in_sektion:e.in_sektion,in_column:e.in_column}}return o.updateAPISetting(r)},complete:function(e){if(c.previewer.trigger("sek-pick-module",{}),o.updateAPISetting({action:"sek-update-fonts"}),"sek-remove-section"===e.apiParams.action){var t=o.getLevelModel(e.apiParams.location);_.isEmpty(t.collection)&&c.previewer.trigger("sek-refresh-level",{level:"location",id:e.apiParams.location})}}},"sek-move":{callback:function(e){switch(s=!0,a={},e.level){case"section":r={action:"sek-move-section",id:e.id,is_nested:!_.isEmpty(e.in_sektion)&&!_.isEmpty(e.in_column),newOrder:e.newOrder,from_location:e.from_location,to_location:e.to_location};break;case"column":r={action:"sek-move-column",id:e.id,newOrder:e.newOrder,from_sektion:e.from_sektion,to_sektion:e.to_sektion};break;case"module":r={action:"sek-move-module",id:e.id,newOrder:e.newOrder,from_column:e.from_column,to_column:e.to_column,from_sektion:e.from_sektion,to_sektion:e.to_sektion}}return o.updateAPISetting(r)},complete:function(e){switch(e.apiParams.action){case"sek-move-section":c.previewer.trigger("sek-edit-options",{id:e.apiParams.id,level:"section",in_sektion:e.apiParams.id}),e.apiParams.from_location!=e.apiParams.to_location&&(c.previewer.trigger("sek-refresh-level",{level:"location",id:e.apiParams.to_location}),c.previewer.trigger("sek-refresh-level",{level:"location",id:e.apiParams.from_location}));break;case"sek-move-column":c.previewer.trigger("sek-edit-options",{id:e.apiParams.id,level:"column",in_sektion:e.apiParams.in_sektion,in_column:e.apiParams.in_column});break;case"sek-refresh-modules-in-column":c.previewer.trigger("sek-edit-module",{id:e.apiParams.id,level:"module",in_sektion:e.apiParams.in_sektion,in_column:e.apiParams.in_column})}}},"sek-duplicate":{callback:function(e){switch(s=!0,a={},e.level){case"section":r={action:"sek-duplicate-section",id:e.id,location:e.location,in_sektion:e.in_sektion,in_column:e.in_column,is_nested:!_.isEmpty(e.in_sektion)&&!_.isEmpty(e.in_column)};break;case"column":r={action:"sek-duplicate-column",id:e.id,in_sektion:e.in_sektion,in_column:e.in_column};break;case"module":r={action:"sek-duplicate-module",id:e.id,in_sektion:e.in_sektion,in_column:e.in_column}}return o.updateAPISetting(r)},complete:function(e){switch(e.apiParams.action){case"sek-duplicate-section":c.previewer.trigger("sek-edit-options",{id:e.apiParams.id,level:"section",in_sektion:e.apiParams.id});break;case"sek-duplicate-column":c.previewer.trigger("sek-edit-options",{id:e.apiParams.id,level:"column",in_sektion:e.apiParams.in_sektion,in_column:e.apiParams.in_column});break;case"sek-duplicate-module":c.previewer.trigger("sek-edit-module",{id:e.apiParams.id,level:"module",in_sektion:e.apiParams.in_sektion,in_column:e.apiParams.in_column})}c.previewer.send("sek-refresh-stylesheet",{skope_id:c.czr_skopeBase.getSkopeProperty("skope_id")}),c.previewer.send("sek-focus-on",{id:e.apiParams.id})}},"sek-resize-columns":function(e){return s=!0,a={},r=e,o.updateAPISetting(r)},"sek-add-content-in-new-sektion":{callback:function(e){switch(s=!!_.isUndefined(e.send_to_preview)||e.send_to_preview,a={},(r=e).action="sek-add-content-in-new-sektion",r.id=sektionsLocalizedData.optPrefixForSektionsNotSaved+o.guid(),e.content_type){case"module":r.droppedModuleId=sektionsLocalizedData.optPrefixForSektionsNotSaved+o.guid()}return o.updateAPISetting(r)},complete:function(e){switch(e.apiParams.content_type){case"module":c.previewer.trigger("sek-edit-module",{level:"module",id:e.apiParams.droppedModuleId}),o.updateAPISetting({action:"sek-update-fonts"}),c.previewer.send("sek-refresh-stylesheet",{skope_id:c.czr_skopeBase.getSkopeProperty("skope_id")})}e.apiParams.is_first_section&&c.previewer.trigger("sek-refresh-level",{level:"location",id:e.apiParams.location})}},"sek-pick-module":function(e){return s=!0,r={},a={action:"sek-generate-draggable-candidates-picker-ui",content_type:"module",was_triggered:!_.has(e,"was_triggered")||e.was_triggered},o.generateUI(a)},"sek-pick-section":function(e){return s=!0,r={},a={action:"sek-generate-draggable-candidates-picker-ui",content_type:"section",was_triggered:!_.has(e,"was_triggered")||e.was_triggered},o.generateUI(a)},"sek-edit-options":function(e){return s=!0,r={},_.isEmpty(e.id)?l.Deferred(function(){this.reject("missing id")}):(a={action:"sek-generate-level-options-ui",level:e.level,id:e.id,in_sektion:e.in_sektion,in_column:e.in_column,options:e.options||[]},o.generateUI(a))},"sek-edit-module":function(e){return s=!0,r={},a={action:"sek-generate-module-ui",level:e.level,id:e.id,in_sektion:e.in_sektion,in_column:e.in_column,options:e.options||[]},o.generateUI(a)},"sek-notify":function(t){return s=!1,l.Deferred(function(){c.panel(sektionsLocalizedData.sektionsPanelId,function(e){c.notifications.add(new c.Notification("sek-notify",{type:t.type||"info",message:t.message,dismissible:!0})),_.delay(function(){c.notifications.remove("sek-notify")},t.duration||5e3)}),this.resolve()})},"sek-refresh-level":function(e){return s=!0,l.Deferred(function(){r={action:"sek-refresh-level",level:e.level,id:e.id},a={},this.resolve()})}};_.each(e,function(i,n){c.previewer.bind(n,function(t){var e;if(_.isFunction(i))e=i;else{if(!_.isFunction(i.callback))return void c.errare("::reactToPreviewMsg => invalid callback for action "+n);e=i.callback}try{e(t).done(function(e){s?c.previewer.send(n,{skope_id:c.czr_skopeBase.getSkopeProperty("skope_id"),apiParams:r,uiParams:a,cloneId:!_.isEmpty(e)&&e}):c.previewer.trigger([n,"done"].join("_"),{apiParams:r,uiParams:a}),o.trigger([n,"done"].join("_"),t)}).fail(function(t){c.errare("reactToPreviewMsg => error when firing "+n,t),c.panel(sektionsLocalizedData.sektionsPanelId,function(e){c.notifications.add(new c.Notification("sek-react-to-preview",{type:"info",message:t,dismissible:!0})),_.delay(function(){c.notifications.remove("sek-react-to-preview")},5e3)})})}catch(e){c.errare("reactToPreviewMsg => error when receiving "+n,e)}})}),_.each(e,function(t,i){c.previewer.bind([i,"done"].join("_"),function(e){if(_.isFunction(t.complete))try{t.complete(e)}catch(e){c.errare("reactToPreviewMsg done => error when receiving "+[i,"done"].join("_"),e)}})})},schedulePrintSectionJson:function(){var i=this,n=function(e){return e.id="",_.each(e.collection,function(e){e.id="",_.isArray(e.collection)&&n(e)}),e};c.previewer.bind("sek-to-json",function(e){var t=l.extend(!0,{},i.getLevelModel(e.id));!function(e){w=400,h=300;var t=_.isUndefined(window.screenLeft)?window.screenX:window.screenLeft,i=_.isUndefined(window.screenTop)?window.screenY:window.screenTop,n=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:screen.width,o=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:screen.height,r=n/2-w/2+t,a=o/2-h/2+i,s=window.open("about:blank",null,"scrollbars=yes, width="+w+", height="+h+", top="+a+", left="+r),c=s.document;c.open("text/html"),c.write(e),c.close(),window.focus&&s.focus()}(JSON.stringify(n(t)))})}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(g,p){p.extend(CZRSeksPrototype,{generateUI:function(n){var e,o=this,t=p.Deferred();switch(_.isEmpty(n.action)&&t.reject("generateUI => missing action"),n.action){case"sek-generate-draggable-candidates-picker-ui":var i=sektionsLocalizedData.optPrefixForSektionsNotSaved+("module"===n.content_type?"_sek_draggable_modules_ui":"_sek_draggable_sections_ui");if(o.isUIControlAlreadyRegistered(i)){g.control(i).focus({completeCallback:function(){var e=g.control(i).container;e.hasClass("button-see-me")||(e.addClass("button-see-me"),_.delay(function(){e.removeClass("button-see-me")},800))}});break}o.cleanRegistered(),e=function(){g.has(i)||(g(i,function(e){e.bind(function(e,t){g.errare("MODULE / SECTION PICKER SETTING CHANGED")})}),o.register({level:n.level,what:"setting",id:i,dirty:!1,value:"",transport:"postMessage",type:"_nimble_ui_"})),o.register({level:n.level,what:"control",id:i,label:"module"===n.content_type?sektionsLocalizedData.i18n["Module Picker"]:sektionsLocalizedData.i18n["Section Picker"],type:"czr_module",module_type:"module"===n.content_type?"sek_module_picker_module":"sek_section_picker_module",section:i,priority:10,settings:{default:i},track:!1}).done(function(){g.control(i).focus({completeCallback:function(){}})})},g.section.when(i,function(){e()}),o.register({what:"section",id:i,title:"module"===n.content_type?sektionsLocalizedData.i18n["Module Picker"]:sektionsLocalizedData.i18n["Section Picker"],panel:sektionsLocalizedData.sektionsPanelId,priority:30,track:!1,constructWith:g.Section.extend({isContextuallyActive:function(){return this.active()},_toggleActive:function(){return!0}})});break;case"sek-generate-module-ui":if(_.isEmpty(n.id)&&t.reject("generateUI => missing id"),o.isUIControlAlreadyRegistered(n.id)){g.control(n.id).focus({completeCallback:function(){}});break}o.cleanRegistered();var r=o.getLevelProperty({property:"value",id:n.id}),a=o.getLevelProperty({property:"module_type",id:n.id});_.isEmpty(a)&&t.reject("generateUI => module => invalid module_type"),e=function(){g.has(n.id)||(g(n.id,function(e){e.bind(_.debounce(function(e,t,i){try{o.updateAPISettingAndExecutePreviewActions({defaultPreviewAction:"refresh_markup",uiParams:_.extend(n,{action:"sek-set-module-value"}),settingParams:{to:e,from:t,args:i}})}catch(e){g.errare("Error in updateAPISettingAndExecutePreviewActions",e)}},o.SETTING_UPDATE_BUFFER))}),o.register({level:n.level,what:"setting",id:n.id,dirty:!1,value:r,transport:"postMessage",type:"_nimble_ui_"})),o.register({level:n.level,what:"control",id:n.id,label:sektionsLocalizedData.i18n["Customize the options for module :"]+" "+g.czrModuleMap[a].name,type:"czr_module",module_type:a,section:n.id,priority:10,settings:{default:n.id}}).done(function(){g.control(n.id).focus({completeCallback:function(){}})})},g.section.when(n.id,function(){e()}),o.register({what:"section",id:n.id,title:sektionsLocalizedData.i18n["Content for"]+" "+g.czrModuleMap[a].name,panel:sektionsLocalizedData.sektionsPanelId,priority:20});break;case"sek-generate-level-options-ui":var s=n.id+"__sectionLayout_options",c=n.id+"__bgBorder_options",l=n.id+"__height_options",d=n.id+"__spacing_options";if(o.isUIControlAlreadyRegistered(c)||o.isUIControlAlreadyRegistered(l)||o.isUIControlAlreadyRegistered(d)){g.section(g.control(c).section()).expanded(!0);break}o.cleanRegistered();var u=o.getLevelProperty({property:"options",id:n.id});u=_.isObject(u)?u:{},e=function(){"section"===n.level&&(g.has(l)||(g(s,function(e){e.bind(_.debounce(function(e,t,i){try{o.updateAPISettingAndExecutePreviewActions({defaultPreviewAction:"refresh_stylesheet",uiParams:_.extend(n,{action:"sek-set-level-options"}),options_type:"layout",settingParams:{to:e,from:t,args:i}})}catch(e){g.errare("Error in updateAPISettingAndExecutePreviewActions",e)}},o.SETTING_UPDATE_BUFFER))}),o.register({level:n.level,what:"setting",id:s,dirty:!1,value:u.layout||{},transport:"postMessage",type:"_nimble_ui_"})),o.register({level:n.level,level_id:n.id,what:"control",id:s,label:sektionsLocalizedData.i18n["Layout settings for the"]+" "+sektionsLocalizedData.i18n[n.level],type:"czr_module",module_type:"sek_level_section_layout_module",section:n.id,priority:0,settings:{default:s}}).done(function(){g.control(s).focus({completeCallback:function(){}})})),g.has(c)||(g(c,function(e){e.bind(_.debounce(function(e,t,i){try{o.updateAPISettingAndExecutePreviewActions({defaultPreviewAction:"refresh_stylesheet",uiParams:_.extend(n,{action:"sek-set-level-options"}),options_type:"bg_border",settingParams:{to:e,from:t,args:i}})}catch(e){g.errare("Error in updateAPISettingAndExecutePreviewActions",e)}},o.SETTING_UPDATE_BUFFER))}),o.register({level:n.level,what:"setting",id:c,dirty:!1,value:u.bg_border||{},transport:"postMessage",type:"_nimble_ui_"})),o.register({level:n.level,level_id:n.id,what:"control",id:c,label:sektionsLocalizedData.i18n["Background and border settings for the"]+" "+sektionsLocalizedData.i18n[n.level],type:"czr_module",module_type:"sek_level_bg_border_module",section:n.id,priority:10,settings:{default:c}}).done(function(){g.control(c).focus({completeCallback:function(){}})}),g.has(d)||(g(d,function(e){e.bind(_.debounce(function(e,t,i){try{o.updateAPISettingAndExecutePreviewActions({defaultPreviewAction:"refresh_stylesheet",uiParams:_.extend(n,{action:"sek-set-level-options"}),options_type:"spacing",settingParams:{to:e,from:t,args:i}})}catch(e){g.errare("Error in updateAPISettingAndExecutePreviewActions",e)}},o.SETTING_UPDATE_BUFFER))}),o.register({level:n.level,what:"setting",id:d,dirty:!1,value:u.spacing||{},transport:"postMessage",type:"_nimble_ui_"})),o.register({level:n.level,what:"control",id:d,label:sektionsLocalizedData.i18n["Padding and margin settings for the"]+" "+sektionsLocalizedData.i18n[n.level],type:"czr_module",module_type:"sek_spacing_module",section:n.id,priority:15,settings:{default:d}}).done(function(){g.control(d).focus({completeCallback:function(){}})}),g.has(l)||(g(l,function(e){e.bind(_.debounce(function(e,t,i){try{o.updateAPISettingAndExecutePreviewActions({defaultPreviewAction:"refresh_stylesheet",uiParams:_.extend(n,{action:"sek-set-level-options"}),options_type:"height",settingParams:{to:e,from:t,args:i}})}catch(e){g.errare("Error in updateAPISettingAndExecutePreviewActions",e)}},o.SETTING_UPDATE_BUFFER))}),o.register({level:n.level,what:"setting",id:l,dirty:!1,value:u.height||{},transport:"postMessage",type:"_nimble_ui_"})),o.register({level:n.level,level_id:n.id,what:"control",id:l,label:sektionsLocalizedData.i18n["Height settings for the"]+" "+sektionsLocalizedData.i18n[n.level],type:"czr_module",module_type:"sek_level_height_module",section:n.id,priority:20,settings:{default:l}}).done(function(){g.control(l).focus({completeCallback:function(){}})})},g.section.when(n.id,function(){e()}),o.register({what:"section",id:n.id,title:sektionsLocalizedData.i18n["Settings for the"]+" "+n.level,panel:sektionsLocalizedData.sektionsPanelId,priority:10,track:!1})}return"pending"==t.state()?t.resolve().promise():t.promise()},updateAPISettingAndExecutePreviewActions:function(e){if(!_.isEmpty(e.settingParams)&&_.has(e.settingParams,"to")){var t,i=this,n=e.settingParams.to,o=null,r=!1;if(!_.isEmpty(e.settingParams.args)&&_.has(e.settingParams.args,"moduleRegistrationParams")){var a=e.settingParams.args.moduleRegistrationParams.control,s=e.settingParams.args.moduleRegistrationParams.id,c=a.czr_Module(s);if(_.isEmpty(c)?g.errare("updateAPISettingAndExecutePreviewActions => missing parentModuleInstance",e):(o=c.module_type,r=c.isMultiItem()),!r&&_.isObject(n)?t=i.normalizeAndSanitizeSingleItemInputValues(n,o):(t=[],_.each(n,function(e){t.push(i.normalizeAndSanitizeSingleItemInputValues(e,o))})),_.isEmpty(e.defaultPreviewAction))g.errare("updateAPISettingAndExecutePreviewActions => missing defaultPreviewAction in passed params. No action can be triggered to the api.previewer.",e);else{var l="refresh_stylesheet"===e.defaultPreviewAction,d="refresh_markup"===e.defaultPreviewAction,u="refresh_fonts"===e.defaultPreviewAction;_.isEmpty(e.settingParams.args.inputRegistrationParams)||(_.isUndefined(e.settingParams.args.inputRegistrationParams.refresh_stylesheet)||(l=Boolean(e.settingParams.args.inputRegistrationParams.refresh_stylesheet)),_.isUndefined(e.settingParams.args.inputRegistrationParams.refresh_markup)||(d=Boolean(e.settingParams.args.inputRegistrationParams.refresh_markup)),_.isUndefined(e.settingParams.args.inputRegistrationParams.refresh_fonts)||(u=Boolean(e.settingParams.args.inputRegistrationParams.refresh_fonts)));var p=function(){return i.updateAPISetting({action:e.uiParams.action,id:e.uiParams.id,value:t,in_column:e.uiParams.in_column,in_sektion:e.uiParams.in_sektion,options_type:e.options_type,settingParams:e.settingParams}).done(function(){!0===l&&g.previewer.send("sek-refresh-stylesheet",{skope_id:g.czr_skopeBase.getSkopeProperty("skope_id"),apiParams:{action:"sek-refresh-stylesheet",id:e.uiParams.id,level:e.uiParams.level}}),!0===d&&g.previewer.send("sek-refresh-level",{apiParams:{action:"sek-refresh-level",id:e.uiParams.id,level:e.uiParams.level},skope_id:g.czr_skopeBase.getSkopeProperty("skope_id")})})};if(!0===u){var m="";try{m="font_family_css"!=e.settingParams.args.input_changed?void g.errare("updateAPISettingAndExecutePreviewActions => Error when refreshing fonts => the input id is not font_family_css",e):e.settingParams.args.input_value}catch(e){return void g.errare("updateAPISettingAndExecutePreviewActions => Error when refreshing fonts",e)}if(!_.isString(m))return void g.errare("updateAPISettingAndExecutePreviewActions => font-family must be a string",er);-1<m.indexOf("gfont")?i.updateAPISetting({action:"sek-update-fonts",font_family:m}).done(function(){p().then(function(){i.updateAPISetting({action:"sek-update-fonts"})})}):p()}else p()}}else g.errare("updateAPISettingAndExecutePreviewActions => missing params.settingParams.args.moduleRegistrationParams The api main setting can not be updated",e)}else g.errare("updateAPISettingAndExecutePreviewActions => missing params.settingParams.to. The api main setting can not be updated",e)},normalizeAndSanitizeSingleItemInputValues:function(e,i){var n,o={},r={},a=null,s=this;return _.each(e,function(e,t){_.contains(["title","id"],t)||(null!==i&&"no_default_value_specified"===(a=s.getInputDefaultValue(t,i))&&g.infoLog("::updateAPISettingAndExecutePreviewActions => missing default value for input "+t+" in module "+i),e!==a&&(o[t]=e))}),_.each(o,function(e,t){switch(s.getInputType(t,i)){case"text":case"textarea":case"check":case"gutencheck":case"select":case"radio":case"number":case"upload":case"upload_url":case"color":case"wp_color_alpha":case"wp_color":case"content_picker":case"tiny_mce_editor":case"password":case"range":case"range_slider":case"hidden":case"h_alignment":case"h_text_alignment":case"spacing":case"bg_position":case"v_alignment":case"font_size":case"line_height":case"font_picker":default:n=e}r[t]=n}),r},isUIControlAlreadyRegistered:function(t){var e=_.filter(this.registered(),function(e){return e.id==t&&"control"===e.what}),i=!1;return _.isEmpty(e)?i=g.control.has(t):(i=!0,1<e.length&&g.errare("generateUI => why is this control registered more than once ? => "+t)),i}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(H,Q){Q.extend(CZRSeksPrototype,{updateAPISetting:function($){var B=this,W=Q.Deferred();return H(B.sekCollectionSettingId(),function(e){var t,i,n,o,r,a,s,c,l=e(),d=_.isObject(l)?Q.extend(!0,{},l):B.defaultSektionSettingValue;switch(d.collection=_.isArray(d.collection)?d.collection:B.defaultSektionSettingValue.collection,$.action){case"sek-add-section":if(_.isEmpty($.id))throw new Error("updateAPISetting => "+$.action+" => missing id");if(_.isEmpty($.location))throw new Error("updateAPISetting => "+$.action+" => missing location");if(!0===$.is_nested){n=B.getLevelModel($.in_column,d.collection);var u=B.getLevelModel($.in_sektion,d.collection);if("no_match"==u){W.reject("updateAPISetting => "+$.action+" => no grand parent sektion found");break}if(!0===u.is_nested){W.reject(sektionsLocalizedData.i18n["You've reached the maximum number of allowed nested sections."]);break}if("no_match"==n){H.errare("updateAPISetting => "+$.action+" => no parent column matched"),W.reject("updateAPISetting => "+$.action+" => no parent column matched");break}n.collection=_.isArray(n.collection)?n.collection:[],n.collection.push({id:$.id,level:"section",collection:[{id:sektionsLocalizedData.optPrefixForSektionsNotSaved+B.guid(),level:"column",collection:[]}],is_nested:!0})}else{if("no_match"==(t=B.getLevelModel($.location,d.collection))){H.errare("updateAPISetting => "+$.action+" => no location matched"),W.reject("updateAPISetting => "+$.action+" => no location matched");break}t.collection=_.isArray(t.collection)?t.collection:[],_.each(t.collection,function(e,t){$.before_section===e.id&&(M=t),$.after_section===e.id&&(M=t+1)}),t.collection=_.isArray(t.collection)?t.collection:[],t.collection.splice(M,0,{id:$.id,level:"section",collection:[{id:sektionsLocalizedData.optPrefixForSektionsNotSaved+B.guid(),level:"column",collection:[]}]})}break;case"sek-duplicate-section":if(_.isEmpty($.id))throw new Error("updateAPISetting => "+$.action+" => missing id");if(_.isEmpty($.location))throw new Error("updateAPISetting => "+$.action+" => missing location");var p;try{p=B.cloneLevel($.id)}catch(e){H.errare("updateAPISetting => "+$.action,e);break}var m=B.getLevelPositionInCollection($.id,d.collection);if(!0===$.is_nested){if("no_match"==(n=B.getLevelModel($.in_column,d.collection))){H.errare("updateAPISetting => "+$.action+" => no parent column matched"),W.reject("updateAPISetting => "+$.action+" => no parent column matched");break}n.collection=_.isArray(n.collection)?n.collection:[],n.collection.splice(parseInt(m+1,10),0,p)}else{if("no_match"==(t=B.getLevelModel($.location,d.collection))){H.errare("updateAPISetting => "+$.action+" => no location matched"),W.reject("updateAPISetting => "+$.action+" => no location matched");break}t.collection=_.isArray(t.collection)?t.collection:[],t.collection.splice(parseInt(m+1,10),0,p)}s=p.id;break;case"sek-remove-section":if(!0===$.is_nested)"no_match"!=(n=B.getLevelModel($.in_column,d.collection))?(n.collection=_.isArray(n.collection)?n.collection:[],n.collection=_.filter(n.collection,function(e){return e.id!=$.id})):H.errare("updateAPISetting => "+$.action+" => no parent column matched");else{if("no_match"==(t=B.getLevelModel($.location,d.collection))){H.errare("updateAPISetting => "+$.action+" => no location matched"),W.reject("updateAPISetting => "+$.action+" => no location matched");break}t.collection=_.filter(t.collection,function(e){return e.id!=$.id})}break;case"sek-move-section":var g,f,h=B.getLevelModel($.to_location,d.collection);if(_.isEmpty(h)||"no_match"==h)throw new Error("updateAPISetting => "+$.action+" => missing target location");if($.from_location!=$.to_location){var k=B.getLevelModel($.from_location,d.collection);if(_.isEmpty(k)||"no_match"==k)throw new Error("updateAPISetting => "+$.action+" => missing source location");k.collection=_.isArray(k.collection)?k.collection:[],g=B.getLevelModel($.id,k.collection),f=Q.extend(!0,{},g),k.collection=_.filter(k.collection,function(e){return e.id!=$.id})}h.collection=_.isArray(h.collection)?h.collection:[],r=Q.extend(!0,[],h.collection),a=[],_.each($.newOrder,function(e){if($.from_location!=$.to_location&&e==f.id)a.push(f);else{if(i=B.getLevelModel(e,r),_.isEmpty(i)||"no_match"==i)throw new Error("updateAPISetting => move section => missing section candidate");a.push(i)}}),h.collection=a;break;case"sek-add-column":if(_.isEmpty($.id))throw new Error("updateAPISetting => "+$.action+" => missing id");if("no_match"==(i=B.getLevelModel($.in_sektion,d.collection))){H.errare("updateAPISetting => "+$.action+" => no parent sektion matched"),W.reject("updateAPISetting => "+$.action+" => no parent sektion matched");break}if(i.collection=_.isArray(i.collection)?i.collection:[],B.MAX_NUMBER_OF_COLUMNS-1<_.size(i.collection)){W.reject(sektionsLocalizedData.i18n["You've reached the maximum number of columns allowed in this section."]);break}_.each(i.collection,function(e){e.width=""}),i.collection.push({id:$.id,level:"column",collection:[]});break;case"sek-remove-column":if("no_match"!=(i=B.getLevelModel($.in_sektion,d.collection))){if(1===_.size(i.collection)){W.reject(sektionsLocalizedData.i18n["A section must have at least one column."]);break}i.collection=_.isArray(i.collection)?i.collection:[],i.collection=_.filter(i.collection,function(e){return e.id!=$.id}),_.each(i.collection,function(e){e.width=""})}else H.errare("updateAPISetting => "+$.action+" => no parent sektion matched");break;case"sek-duplicate-column":if(_.isEmpty($.id))throw new Error("updateAPISetting => "+$.action+" => missing id");if("no_match"==(i=B.getLevelModel($.in_sektion,d.collection))){H.errare("updateAPISetting => "+$.action+" => no parent sektion matched"),W.reject("updateAPISetting => "+$.action+" => no parent sektion matched");break}if(i.collection=_.isArray(i.collection)?i.collection:[],B.MAX_NUMBER_OF_COLUMNS-1<_.size(i.collection)){W.reject(sektionsLocalizedData.i18n["You've reached the maximum number of columns allowed in this section."]);break}var v;try{v=B.cloneLevel($.id)}catch(e){H.errare("updateAPISetting => "+$.action,e);break}var y=B.getLevelPositionInCollection($.id,d.collection);s=v.id,i.collection.splice(parseInt(y+1,10),0,v),_.each(i.collection,function(e){e.width=""});break;case"sek-resize-columns":if($.col_number<2)break;var w=B.getLevelModel($.resized_column,d.collection),b=B.getLevelModel($.sister_column,d.collection);if("no_match"==w){H.errare("updateAPISetting => "+$.action+" => no resized column matched"),W.reject("updateAPISetting => "+$.action+" => no resized column matched");break}w.width=parseFloat($.resizedColumnWidthInPercent);var P=B.getLevelModel($.in_sektion,d.collection),S=_.filter(P.collection,function(e){return e.id!=w.id&&e.id!=b.id}),z=parseFloat(w.width.toFixed(3));_.isEmpty(S)||_.each(S,function(e){currentColWidth=parseFloat(1*e.width),(!_.has(e,"width")||!_.isNumber(1*currentColWidth)||_.isEmpty(currentColWidth+"")||currentColWidth<1)&&(e.width=parseFloat((100/$.col_number).toFixed(3))),z=parseFloat((z+e.width).toFixed(3))}),b.width=parseFloat((100-z).toFixed(3));break;case"sek-move-column":var I,E,D=B.getLevelModel($.to_sektion,d.collection);if(_.isEmpty(D)||"no_match"==D)throw new Error("updateAPISetting => "+$.action+" => missing target sektion");if($.from_sektion!=$.to_sektion){var C=B.getLevelModel($.from_sektion,d.collection);if(_.isEmpty(C)||"no_match"==C)throw new Error("updateAPISetting => "+$.action+" => missing source column");C.collection=_.isArray(C.collection)?C.collection:[],I=B.getLevelModel($.id,C.collection),E=Q.extend(!0,{},I),C.collection=_.filter(C.collection,function(e){return e.id!=$.id}),_.each(C.collection,function(e){e.width=""})}D.collection=_.isArray(D.collection)?D.collection:[],r=Q.extend(!0,[],D.collection),a=[],_.each($.newOrder,function(e){if($.from_sektion!=$.to_sektion&&e==E.id)a.push(E);else{if(n=B.getLevelModel(e,r),_.isEmpty(n)||"no_match"==n)throw new Error("updateAPISetting => moveColumn => missing columnCandidate");a.push(n)}}),D.collection=a,_.each(D.collection,function(e){e.width=""});break;case"sek-add-module":if(_.isEmpty($.id))throw new Error("updateAPISetting => "+$.action+" => missing id");if(_.isEmpty($.module_type))throw new Error("updateAPISetting => "+$.action+" => missing module_type");if("no_match"===(n=B.getLevelModel($.in_column,d.collection))){H.errare("updateAPISetting => "+$.action+" => no parent column matched"),W.reject("updateAPISetting => "+$.action+" => no parent column matched");break}var M=0;n.collection=_.isArray(n.collection)?n.collection:[],_.each(n.collection,function(e,t){$.before_module===e.id&&(M=t),$.after_module===e.id&&(M=t+1)});var A={id:$.id,level:"module",module_type:$.module_type};"no_starting_value"!==(c=B.getModuleStartingValue($.module_type))&&(A.value=c),n.collection.splice(M,0,A);break;case"sek-duplicate-module":if(_.isEmpty($.id))throw new Error("updateAPISetting => "+$.action+" => missing id");if("no_match"==(n=B.getLevelModel($.in_column,d.collection))){H.errare("updateAPISetting => "+$.action+" => no parent column matched"),W.reject("updateAPISetting => "+$.action+" => no parent column matched");break}var x;n.collection=_.isArray(n.collection)?n.collection:[];try{x=B.cloneLevel($.id)}catch(e){H.errare("updateAPISetting => "+$.action,e),W.reject("updateAPISetting => "+$.action+" => error when cloning the level");break}var L=B.getLevelPositionInCollection($.id,d.collection);s=x.id,n.collection.splice(parseInt(L+1,10),0,x);break;case"sek-remove-module":if(_.isEmpty($.id))throw new Error("updateAPISetting => "+$.action+" => missing id");"no_match"!=(n=B.getLevelModel($.in_column,d.collection))?(n.collection=_.isArray(n.collection)?n.collection:[],n.collection=_.filter(n.collection,function(e){return e.id!=$.id})):H.errare("updateAPISetting => "+$.action+" => no parent column matched");break;case"sek-move-module":var R,T,Z;if(R=B.getLevelModel($.to_column,d.collection),_.isEmpty(R)||"no_match"==R)throw new Error("updateAPISetting => "+$.action+" => missing target column");if($.from_column!=$.to_column){var O;if(O=B.getLevelModel($.from_column,d.collection),_.isEmpty(O)||"no_match"==O)throw new Error("updateAPISetting => "+$.action+" => missing source column");O.collection=_.isArray(O.collection)?O.collection:[],T=B.getLevelModel($.id,d.collection),Z=Q.extend(!0,{},T),O.collection=_.filter(O.collection,function(e){return e.id!=$.id})}if(R.collection=_.isArray(R.collection)?R.collection:[],r=Q.extend(!0,[],R.collection),a=[],_.each($.newOrder,function(e){if($.from_column!=$.to_column&&e==Z.id)a.push(Z);else{if(o=B.getLevelModel(e,d.collection),_.isEmpty(o)||"no_match"==o)throw new Error("updateAPISetting => "+$.action+" => missing moduleCandidate");a.push(o)}}),a.length!=_.uniq(a).length)throw new Error("updateAPISetting => "+$.action+" => there are duplicated modules in column : "+R.id);R.collection=a;break;case"sek-set-module-value":o=B.getLevelModel($.id,d.collection);var j={};if(_.each($.value||{},function(e,t){!_.isBoolean(e)&&_.isEmpty(e+"")||(j[t]=e)}),"no_match"==o){H.errare("updateAPISetting => "+$.action+" => no module matched",$),W.reject("updateAPISetting => "+$.action+" => error no module matched");break}o.value=j;break;case"sek-set-level-options":var U=B.getLevelModel($.id,d.collection),F={};if("no_match"===U){H.errare("updateAPISetting => "+$.action+" => no parent sektion matched"),W.reject("updateAPISetting => "+$.action+" => no parent sektion matched");break}switch(U.options=U.options||{},_.each($.value||{},function(e,t){!_.isBoolean(e)&&_.isEmpty(e+"")||(F[t]=e)}),_.isEmpty($.options_type)&&H.errare("updateAPISetting => "+$.action+" => missing options_type"),$.options_type){case"layout":U.options.layout=F;break;case"bg_border":U.options.bg_border=F;break;case"height":U.options.height=F;break;case"spacing":U.options.spacing=F}break;case"sek-add-content-in-new-sektion":if(_.isEmpty($.id))throw new Error("updateAPISetting => "+$.action+" => missing id");M=0;if("no_match"==(t=B.getLevelModel($.location,d.collection))){H.errare("updateAPISetting => "+$.action+" => no location matched"),W.reject("updateAPISetting => "+$.action+" => no location matched");break}switch(t.collection=_.isArray(t.collection)?t.collection:[],_.each(t.collection,function(e,t){$.before_section===e.id&&(M=t),$.after_section===e.id&&(M=t+1)}),$.content_type){case"module":c=B.getModuleStartingValue($.content_id),t.collection.splice(M,0,{id:$.id,level:"section",collection:[{id:sektionsLocalizedData.optPrefixForSektionsNotSaved+B.guid(),level:"column",collection:[{id:$.droppedModuleId,level:"module",module_type:$.content_id,value:"no_starting_value"!==c?c:null}]}]});break;case"preset_section":var N;try{N=B.getPresetSectionCollection({presetSectionType:$.content_id,section_id:$.id})}catch(e){H.errare("updateAPISetting => "+$.action+" => Error with self.getPresetSectionCollection()",e),W.reject("updateAPISetting => "+$.action+" => Error with self.getPresetSectionCollection()");break}if(!_.isObject(N)||_.isEmpty(N)){H.errare("updateAPISetting => "+$.action+" => preset section type not found or empty : "+$.content_id,N),W.reject("updateAPISetting => "+$.action+" => preset section type not found or empty");break}t.collection.splice(M,0,N)}break;case"sek-update-fonts":var V=B.sniffGFonts();if(!_.isEmpty($.font_family)&&_.isString($.font_family)&&!_.contains(V,$.font_family)){if($.font_family.indexOf("gfont")<0){H.errare("updateAPISetting => "+$.action+" => error => must be a google font, prefixed gfont"),W.reject("updateAPISetting => "+$.action+" => error => must be a google font, prefixed gfont");break}V.push($.font_family)}d.fonts=V}"pending"==W.state()&&(_.isEqual(l,d)?W.reject("updateAPISetting => the new setting value is unchanged when firing action : "+$.action):null!==B.validateSettingValue(d)?(e(d,$),W.resolve(s)):W.reject("updateAPISetting => the new setting value did not pass the validation checks for action "+$.action))}),W.promise()},getPresetSectionCollection:function(e){var t=this,i=Q.extend(!0,{},sektionsLocalizedData.presetSections);if(!_.isObject(i)||_.isEmpty(i))throw new Error("getPresetSectionCollection => Invalid sektionsLocalizedData.presetSections");if(_.isEmpty(i[e.presetSectionType]))throw new Error("getPresetSectionCollection => "+e.presetSectionType+" has not been found in sektionsLocalizedData.presetSections");var n=i[e.presetSectionType];if("string"!=typeof n||"{"!==n[0])throw new Error("getPresetSectionCollection => "+e.presetSectionType+" is not JSON.parse-able");n=JSON.parse(n);var o=function(e){return _.each(e,function(e){e.id=sektionsLocalizedData.optPrefixForSektionsNotSaved+t.guid(),_.isArray(e.collection)&&o(e.collection)}),e};return n.id=e.section_id,n.collection=o(n.collection),n}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(f,h){h.extend(CZRSeksPrototype,{register:function(e){if(_.has(e,"id")){var t,i={};switch(e.what){case"setting":if(f.has(e.id))return e;t=h.extend(!0,{},f.Setting.prototype.defaults);var n=_.extend(t,{dirty:!_.isUndefined(e.dirty)&&e.dirty,value:e.value||[],transport:e.transport||"refresh",type:e.type||"option"}),o=f.settingConstructor[n.type]||f.Setting;try{f.add(new o(e.id,n.value,n))}catch(e){f.errare("czr_sektions::register => problem when adding a setting to the api",e)}break;case"panel":if(!_.has(e,"id"))throw new Error("registerPanel => missing panel id ");if(f.section.has(e.id))break;t=h.extend(!0,{},f.Panel.prototype.defaults);var r=_.extend(t,{id:e.id,title:e.title||e.id,priority:_.has(e,"priority")?e.priority:0}),a=_.isObject(e.constructWith)?e.constructWith:f.Panel;r=_.extend({params:r},r);try{i=f.panel.add(new a(e.id,r))}catch(e){f.errare("czr_sektions::register => problem when adding a panel to the api",e)}break;case"section":if(!_.has(e,"id"))throw new Error("registerSection => missing section id ");if(f.section.has(e.id))break;t=h.extend(!0,{},f.Section.prototype.defaults);var s=_.extend(t,{content:"",id:e.id,title:e.title,panel:e.panel,priority:e.priority,description_hidden:!1,customizeAction:sektionsLocalizedData.i18n.Customizing}),c=_.isUndefined(e.constructWith)?f.Section:e.constructWith;s=_.extend({params:s},s);try{i=f.section.add(new c(e.id,s))}catch(e){f.errare("czr_sektions::register => problem when adding a section to the api",e)}break;case"control":if(f.control.has(e.id))break;t=h.extend(!0,{},f.Control.prototype.defaults);var l,d=_.extend(t,{content:"",label:e.label||e.id,priority:e.priority,section:e.section,settings:e.settings,type:e.type,module_type:e.module_type,input_attrs:e.input_attrs,sek_registration_params:e}),u=f.controlConstructor[d.type]||f.Control;l=_.extend({params:d},d);try{i=f.control.add(new u(e.id,l))}catch(e){f.errare("czr_sektions::register => problem when adding a control to the api",e)}break;default:f.errorLog('invalid "what" when invoking the register() method')}if(i=_.isEmpty(i)?{deferred:{embedded:h.Deferred(function(){this.resolve()})}}:i,!1!==e.track){var p=this.registered(),m=h.extend(!0,[],p),g=_.findWhere(m,{id:e.id});if(!_.isEmpty(g)&&_.isEqual(g,e))throw new Error("register => duplicated element in self.registered() collection "+e.id);m.push(e),this.registered(m)}return"setting"==e.what?e:i.deferred.embedded}f.errare("register => missing id ",e)},cleanRegistered:function(){var t=this,e=h.extend(!0,[],t.registered()||[]);e=_.filter(e,function(e){return"setting"!==e.what&&f[e.what].has(e.id)&&(_.isFunction(f[e.what](e.id).trigger)&&t.trigger("sek-ui-pre-removal",{what:e.what,id:e.id}),h.when(f[e.what](e.id).container.remove()).done(function(){f[e.what].remove(e.id),t.trigger("sek-ui-removed",{what:e.what,id:e.id})})),"setting"===e.what}),t.registered(e)}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(a,s){s.extend(CZRSeksPrototype,{rootPanelFocus:function(){a.section.has(a.czr_activeSectionId())?a.section(a.czr_activeSectionId()).expanded(!1):a.section.each(function(e){e.expanded(!1)}),a.panel.each(function(e){e.expanded(!1)})},guid:function(){function e(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return e()+e()+e()+e()+e()+e()},getLevelModel:function(t,e){var i=this,n="no_match";if(_.isUndefined(e)){var o=a(i.sekCollectionSettingId())(),r=_.isObject(o)?s.extend(!0,{},o):i.defaultSektionSettingValue;e=_.isArray(r.collection)?r.collection:[]}return _.each(e,function(e){"no_match"==n&&(t===e.id?n=e:_.isArray(e.collection)&&(n=i.getLevelModel(t,e.collection)))}),n},getLevelPositionInCollection:function(i,e){var n=this,o="no_match";if(_.isUndefined(e)){var t=a(n.sekCollectionSettingId())(),r=_.isObject(t)?s.extend(!0,{},t):n.defaultSektionSettingValue;e=_.isArray(r.collection)?r.collection:[]}return _.each(e,function(e,t){"no_match"==o&&(i===e.id?o=t:_.isArray(e.collection)&&(o=n.getLevelPositionInCollection(i,e.collection)))}),o},getLevelProperty:function(e){if(e=_.extend({id:"",property:""},e),_.isEmpty(e.id))a.errare("getLevelProperty => invalid id provided");else{var t=this.getLevelModel(e.id);if("no_match"!=t){if(_.isObject(t))return t[e.property];a.errare("getLevelProperty => invalid model for id : "+e.id,t)}else a.errare("getLevelProperty => no level model found for id : "+e.id)}},cloneLevel:function(e){var t=this,i=t.getLevelModel(e);if("no_match"==i)throw new Error("cloneLevel => no match for level id : "+e);var n=s.extend(!0,{},i),o=function(e){if(_.isEmpty(e.id))throw new Error("cloneLevel => missing level id");if(e.id=sektionsLocalizedData.optPrefixForSektionsNotSaved+t.guid(),!_.isEmpty(e.collection)){if(!_.isArray(e.collection))throw new Error("cloneLevel => the collection must be an array for level id : "+e.id);_.each(e.collection,function(e){e.id=sektionsLocalizedData.optPrefixForSektionsNotSaved+t.guid(),o(e)})}return e};return o(n)},getDefaultItemModelFromRegisteredModuleData:function(e){if(!this.isModuleRegistered(e))return{};var t=sektionsLocalizedData.registeredModules[e].tmpl["item-inputs"],i={id:"",title:""};return _.each(t,function(e,t){switch(t){case"tabs":_.each(e,function(e){_.each(e.inputs,function(e,t){i[t]=e.default||""})});break;default:i[t]=e.default||""}}),i},getRegisteredModuleProperty:function(e,t){return this.isModuleRegistered(e)?sektionsLocalizedData.registeredModules[e][t]:"not_set"},isModuleRegistered:function(e){return sektionsLocalizedData.registeredModules&&!_.isUndefined(sektionsLocalizedData.registeredModules[e])},sniffGFonts:function(i,e){var n=this;if(i=i||[],_.isUndefined(e)){var t=a(n.sekCollectionSettingId())();e=_.isObject(t)?s.extend(!0,{},t):n.defaultSektionSettingValue}return _.each(e,function(e,t){"font_family_css"==t&&-1<e.indexOf("gfont")&&!_.contains(i,e)&&i.push(e),(_.isArray(e)||_.isObject(e))&&n.sniffGFonts(i,e)}),i},getInputDefaultValue:function(i,n,e){var o=this;if(o.cachedDefaultInputValues=o.cachedDefaultInputValues||{},o.cachedDefaultInputValues[n]=o.cachedDefaultInputValues[n]||{},_.has(o.cachedDefaultInputValues[n],i))return o.cachedDefaultInputValues[n][i];if(!_.isUndefined(sektionsLocalizedData.registeredModules)){_.isUndefined(e)&&(e=sektionsLocalizedData.registeredModules[n].tmpl);var r="no_default_value_specified";return _.each(e,function(e,t){"no_default_value_specified"===r&&(i!==t||_.isUndefined(e.default)||(r=e.default),"no_default_value_specified"===r&&(_.isArray(e)||_.isObject(e))&&(r=o.getInputDefaultValue(i,n,e)),"no_default_value_specified"!==r&&(o.cachedDefaultInputValues[n][i]=r))}),r}a.errare("getInputDefaultValue => missing sektionsLocalizedData.registeredModules")},getInputType:function(i,n,e){var o=this;if(o.cachedInputTypes=o.cachedInputTypes||{},o.cachedInputTypes[n]=o.cachedInputTypes[n]||{},_.has(o.cachedInputTypes[n],i))return o.cachedInputTypes[n][i];if(!_.isUndefined(sektionsLocalizedData.registeredModules)){_.isUndefined(e)&&(e=sektionsLocalizedData.registeredModules[n].tmpl);var r="no_input_type_specified";return _.each(e,function(e,t){"no_input_type_specified"===r&&(i!==t||_.isUndefined(e.input_type)||(r=e.input_type),"no_input_type_specified"===r&&(_.isArray(e)||_.isObject(e))&&(r=o.getInputType(i,n,e)),"no_input_type_specified"!==r&&(o.cachedInputTypes[n][i]=r))}),r}a.errare("getInputDefaultValue => missing sektionsLocalizedData.registeredModules")},getModuleStartingValue:function(e){if(!sektionsLocalizedData.registeredModules)return a.errare("getModuleStartingValue => missing sektionsLocalizedData.registeredModules"),"no_starting_value";if(_.isUndefined(sektionsLocalizedData.registeredModules[e]))return a.errare("getModuleStartingValue => the module type "+e+" is not registered"),"no_starting_value";var t=sektionsLocalizedData.registeredModules[e].starting_value;return _.isEmpty(t)?"no_starting_value":t}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(r,f){f.extend(CZRSeksPrototype,{setupDnd:function(){var t=this;t.bind("sek-refresh-dragzones",function(e){"draggable"in document.createElement("span")?t.setupNimbleDragZones(e.input_container):r.panel(sektionsLocalizedData.sektionsPanelId,function(e){r.notifications.add(new r.Notification("drag-drop-support",{type:"error",message:sektionsLocalizedData.i18n["This browser does not support drag and drop. You might need to update your browser or use another one."],dismissible:!0})),_.delay(function(){r.notifications.remove("drag-drop-support")},1e4)})}),r.previewer.bind("ready",function(){try{t.setupNimbleDropZones()}catch(e){r.errare("::setupDnd => error on self.setupNimbleDropZones()",e)}_.isUndefined(_.findWhere(t.registered(),{module_type:"sek_section_picker_module"}))&&_.isUndefined(_.findWhere(t.registered(),{module_type:"sek_module_picker_module"}))||t.rootPanelFocus()}),t.reactToDrop()},setupNimbleDragZones:function(e){var t=this;e.find("[draggable]").each(function(){f(this).on("dragstart",function(e){(function(e){e.originalEvent.dataTransfer.setData("sek-content-type",f(this).data("sek-content-type")),e.originalEvent.dataTransfer.setData("sek-content-id",f(this).data("sek-content-id"));try{e.originalEvent.dataTransfer.setData("browserSupport","browserSupport"),e.originalEvent.dataTransfer.setData("browserSupport","browserSupport"),e.originalEvent.dataTransfer.clearData("browserSupport")}catch(e){r.panel(sektionsLocalizedData.sektionsPanelId,function(e){r.notifications.add(new r.Notification("drag-drop-support",{type:"error",message:sektionsLocalizedData.i18n["This browser does not support drag and drop. You might need to update your browser or use another one."],dismissible:!0})),_.delay(function(){r.notifications.remove("drag-drop-support")},1e4)})}t.dnd_draggedType=f(this).data("sek-content-type"),f("body").addClass("sek-dragging"),r.previewer.send("sek-drag-start",{type:t.dnd_draggedType})}).call(f(this),e)}).on("dragend",function(e){(function(e){f("body").removeClass("sek-dragging"),r.previewer.send("sek-drag-stop")}).call(f(this),e)})})},setupNimbleDropZones:function(){var t=this;if(this.$dropZones=this.dnd_getDropZonesElements(),this.preDropElement=f("<div>",{class:sektionsLocalizedData.preDropElementClass,html:""}),this.$dropZones.length<1)throw new Error("::setupNimbleDropZones => invalid Dom element");this.$dropZones.each(function(){var e=f(this);!0!==e.data("zone-droppable-setup")&&(t.enterOverTimer=null,e.on("dragenter dragover",sektionsLocalizedData.dropSelectors,function(e){_.isNull(t.enterOverTimer)&&(t.enterOverTimer=!0,_.delay(function(){t.currentMousePosition&&t.currentMousePosition+""==e.clientY+""+e.clientX?t.enterOverTimer=null:(t.currentMousePosition=e.clientY+""+e.clientX,t.dnd_toggleDragApproachClassesToDropZones(e))},100)),t.dnd_canDrop(f(this))&&(e.stopPropagation(),t.dnd_OnEnterOver(f(this),e))}).on("dragleave drop",sektionsLocalizedData.dropSelectors,function(e){switch(e.type){case"dragleave":t.dnd_isOveringDropTarget(f(this),e)||t.dnd_cleanOnLeaveDrop(f(this),e);break;case"drop":if(this.$cachedDropZoneCandidates=null,!t.dnd_canDrop(f(this)))return;e.preventDefault(),t.dnd_onDrop(f(this),e),t.dnd_cleanOnLeaveDrop(f(this),e),r.previewer.send("sek-drag-stop")}}).data("zone-droppable-setup",!0))})},dnd_toggleDragApproachClassesToDropZones:function(g){this.$dropZones=this.$dropZones||this.dnd_getDropZonesElements(),this.$cachedDropZoneCandidates=_.isEmpty(this.$cachedDropZoneCandidates)?this.$dropZones.find(".sek-drop-zone"):this.$cachedDropZoneCandidates,this.$dropZones.find(".sek-drop-zone").each(function(){var e=g.clientY,t=g.clientX,i=f(this)[0].getBoundingClientRect(),n=Math.abs(e-i.bottom),o=Math.abs(i.top-e),r=t-i.right,a=i.left-t,s=n<40||o<40,c=0<r&&r<40||0<a&&a<40,l=n<60||o<60,d=0<r&&r<60||0<a&&a<60,u=t<=i.right&&i.left<=t,p=e<=i.top&&i.bottom<=e,m=n<120||o<120,_=0<r&&r<120||0<a&&a<120;(s||p)&&(c||u)?(f(this).addClass("sek-drag-is-very-close"),f(this).removeClass("sek-drag-is-close"),f(this).removeClass("sek-drag-is-approaching")):(l||p)&&(d||u)?(f(this).addClass("sek-drag-is-close"),f(this).removeClass("sek-drag-is-very-close"),f(this).removeClass("sek-drag-is-approaching")):(m||p)&&(_||u)?(f(this).addClass("sek-drag-is-approaching"),f(this).removeClass("sek-drag-is-very-close"),f(this).removeClass("sek-drag-is-close")):(f(this).removeClass("sek-drag-is-very-close"),f(this).removeClass("sek-drag-is-close"),f(this).removeClass("sek-drag-is-approaching"))}),this.enterOverTimer=null},dnd_getPreDropElementContent:function(e){var t,i,n=f(e.currentTarget);switch(this.dnd_draggedType){case"module":t=sektionsLocalizedData.i18n["Insert here"],0<n.length&&("between-sections"!==n.data("sek-location")&&"in-empty-location"!==n.data("sek-location")||(t=sektionsLocalizedData.i18n["Insert in a new section"])),i='<div class="sek-module-placeholder-content"><p>'+t+"</p></div>";break;case"preset_section":i='<div class="sek-module-placeholder-content"><p>'+(t=sektionsLocalizedData.i18n["Insert a new section here"])+"</p></div>";break;default:r.errare("::dnd_getPreDropElementContent => invalid content type provided")}return i},dnd_getDropZonesElements:function(){return f(r.previewer.targetWindow().document)},dnd_canDrop:function(e){var t=e&&0<e.length&&e.hasClass("sek-content-preset_section-drop-zone");return e.hasClass("sek-drop-zone")&&("preset_section"===this.dnd_draggedType&&t||"module"===this.dnd_draggedType&&!t)},dnd_OnEnterOver:function(e,t){t.preventDefault(),!0!==e.data("is-drag-entered")&&(e.data("is-drag-entered",!0),e.addClass("sek-active-drop-zone"),this.$dropZones.addClass("sek-is-dragging"));try{this.dnd_mayBePrintPreDropElement(e,t)}catch(e){r.errare("Error when trying to insert the preDrop content",e)}},dnd_cleanOnLeaveDrop:function(e,t){var i=this;this.$dropZones=this.$dropZones||this.dnd_getDropZonesElements(),this.preDropElement.remove(),this.$dropZones.removeClass("sek-is-dragging"),f(sektionsLocalizedData.dropSelectors,this.$dropZones).each(function(){i.dnd_cleanSingleDropTarget(f(this))})},dnd_cleanSingleDropTarget:function(e){_.isEmpty(e)||e.length<1||(e.data("is-drag-entered",!1),e.data("preDrop-position",!1),e.removeClass("sek-active-drop-zone"),e.find(".sek-drop-zone").removeClass("sek-drag-is-close"),e.find(".sek-drop-zone").removeClass("sek-drag-is-approaching"))},dnd_getPosition:function(e,t){var i=e[0].getBoundingClientRect(),n=i.height;return"before"===e.data("preDrop-position")?n+=this.preDropElement.outerHeight():"after"===e.data("preDrop-position")&&(n-=this.preDropElement.outerHeight()),0<t.originalEvent.clientY-i.top-n/2?"after":"before"},dnd_mayBePrintPreDropElement:function(e,t){var i=this,n=e.data("preDrop-position"),o=this.dnd_getPosition(e,t);if(n!==o&&!0!==i.isPrintingPreDrop){i.isPrintingPreDrop=!0,this.dnd_cleanSingleDropTarget(this.$currentPreDropTarget);var r="between-sections"===e.data("sek-location")||"in-empty-location"===e.data("sek-location");f.when(i.preDropElement.remove()).done(function(){e["before"===o?"prepend":"append"](i.preDropElement).find("."+sektionsLocalizedData.preDropElementClass).html(i.dnd_getPreDropElementContent(t)),e.find("."+sektionsLocalizedData.preDropElementClass).toggleClass("in-new-sektion",r),e.data("preDrop-position",o),i.isPrintingPreDrop=!1,i.$currentPreDropTarget=e})}},dnd_isOveringDropTarget:function(e,t){var i=e[0].getBoundingClientRect(),n=t.clientX,o=t.clientY,r=i.left,a=i.right,s=i.top,c=i.bottom;return r<=n&&n-r<=a-r&&(s<=o&&o-s<=c-s)},dnd_onDrop:function(e,t){t.stopPropagation();this.dnd_getPosition(e,t),e.index();r.czr_sektions.trigger("sek-content-dropped",{drop_target_element:e,location:e.closest('[data-sek-level="location"]').data("sek-id"),before_module:e.data("drop-zone-before-module-or-nested-section"),after_module:e.data("drop-zone-after-module-or-nested-section"),before_section:e.data("drop-zone-before-section"),after_section:e.data("drop-zone-after-section"),content_type:t.originalEvent.dataTransfer.getData("sek-content-type"),content_id:t.originalEvent.dataTransfer.getData("sek-content-id")})},reactToDrop:function(){this.bind("sek-content-dropped",function(e){try{!function(e){if(!_.isObject(e))throw new Error("Invalid params provided");if(e.drop_target_element.length<1)throw new Error("Invalid drop_target_element");var t="content-in-column";switch("between-sections"===e.drop_target_element.data("sek-location")&&(t="content-in-new-section"),"in-empty-location"===e.drop_target_element.data("sek-location")&&(t="content-in-empty-location"),"between-columns"===e.drop_target_element.data("sek-location")&&(t="content-in-new-column"),t){case"content-in-column":var i=e.drop_target_element.closest("div[data-sek-level]");if(i.length<1)throw new Error("No valid level dom element found");var n=i.data("sek-level"),o=i.data("sek-id");if(_.isEmpty(n)||_.isEmpty(o))throw new Error("No valid level id found");r.previewer.trigger("sek-add-module",{level:n,id:o,in_column:e.drop_target_element.closest('div[data-sek-level="column"]').data("sek-id"),in_sektion:e.drop_target_element.closest('div[data-sek-level="section"]').data("sek-id"),before_module:e.before_module,after_module:e.after_module,content_type:e.content_type,content_id:e.content_id});break;case"content-in-new-section":r.previewer.trigger("sek-add-content-in-new-sektion",e);break;case"content-in-empty-location":e.is_first_section=!0,e.send_to_preview=!1,r.previewer.trigger("sek-add-content-in-new-sektion",e)}}(e)}catch(e){r.errare("error when reactToDrop",e)}})}})}(wp.customize,jQuery),function(i,c,l){i.czrInputMap=i.czrInputMap||{},c.extend(i.czrInputMap,{spacing:function(e){var o=this,i=c(".sek-spacing-wrapper",o.container);i.on("keyup mouseup change",'input[type="number"]',function(e){var t=c(this).closest("[data-sek-spacing]").data("sek-spacing"),i=c.extend(!0,{},l.isObject(o())?o():{}),n=c(this).val();l.isString(n)&&!l.isEmpty(n)||l.isNumber(n)?i[t]=n:i=l.omit(t,i),o(i)}),i.on("click",".reset-spacing-wrap",function(e){e.preventDefault(),i.find('input[type="number"]').each(function(){c(this).val("")}),o([])}),l.isObject(o())&&l.each(o(),function(e,t){c('[data-sek-spacing="'+t+'"]',i).find('input[type="number"]').val(e)})},bg_position:function(e){var t=this;c(".sek-bg-pos-wrapper",t.container).on("change",'input[type="radio"]',function(e){t(c(this).val())}),l.isEmpty(t())||t.container.find('input[value="'+t()+'"]').attr("checked",!0).trigger("click")},v_alignment:function(e){var t=this,i=c(".sek-v-align-wrapper",t.container);i.find('div[data-sek-align="'+t()+'"]').addClass("selected"),i.on("click","[data-sek-align]",function(e){e.preventDefault(),i.find(".selected").removeClass("selected"),c.when(c(this).addClass("selected")).done(function(){t(c(this).data("sek-align"))})})},font_size:function(e){var t=this,i=c(".sek-font-size-wrapper",t.container);i.find('input[type="number"]').on("change",function(){t(c(this).val()+"px")}).stepper()},line_height:function(e){var t=this,i=c(".sek-line-height-wrapper",t.container);i.find('input[type="number"]').on("change",function(){t(c(this).val()+"px")}).stepper()},font_picker:function(e){var s=this,o=s.input_parent,n=function(e,t){o();var n=c('select[data-czrtype="'+s.id+'"]',s.container);l.isNull(s())||l.isEmpty(s())?n.append('<option value="none" selected="selected">'+sektionsLocalizedData.i18n["Select a font family"]+"</option>"):n.append('<option value="none">'+sektionsLocalizedData.i18n["Select a font family"]+"</option>"),l.each([{title:sektionsLocalizedData.i18n["Web Safe Fonts"],type:"cfont",list:t.cfonts},{title:sektionsLocalizedData.i18n["Google Fonts"],type:"gfont",list:t.gfonts}],function(e){var t,r,a,i=c("<optgroup>",{label:e.title,html:(t=e.list,r=e.type,a="",l.each(t,function(e){var t,i,n=e.name,o=l.isString(n)?n.replace(/[+|:]/g," "):n;t=n,i=r,(n=l.isString(t)?["[",i,"]",t].join(""):"")==s()?a+='<option selected="selected" value="'+n+'">'+o+"</option>":a+='<option value="'+n+'">'+o+"</option>"}),a)});n.append(i)});var i={escapeMarkup:function(e){return e}};e&&c.extend(i,{resultsAdapter:e,closeOnSelect:!1}),n.select2(i),c(".select2-selection__rendered",s.container).css(r(s()))},r=function(e){if(!l.isString(e)||l.isEmpty(e))return{};var t,i,n,o=(e=e.replace("[gfont]","").replace("[cfont]","")).split(":");return t=a(e),i=o[1]?o[1].replace(/[^0-9.]+/g,""):400,i=l.isNumber(i)?i:400,n=o[1]&&-1!=o[1].indexOf("italic")?"italic":"",{"font-family":"none"==t?"inherit":t.replace(/[+|:]/g," "),"font-weight":i||400,"font-style":n||"normal"}},a=function(e){if(!l.isString(e)||l.isEmpty(e))return e;var t=(e=e.replace("[gfont]","").replace("[cfont]","")).split(":");return l.isString(t[0])?t[0].replace(/[+|:]/g," "):""};o.bind("tab-switch",function(e){var t;c.when((t=c.Deferred(),l.isEmpty(s.sek_fontCollections)?i.CZR_Helpers.getModuleTmpl({tmpl:"font_list",module_type:"font_picker_input",module_id:s.module.id}).done(function(e){if("string"!=typeof e||"{"!==e[0])throw new Error("font_picker => server list is not JSON.parse-able");s.sek_fontCollections=JSON.parse(e),t.resolve(s.sek_fontCollections)}).fail(function(e){t.reject(e)}):t.resolve(s.sek_fontCollections),t.promise())).done(function(t){var i;(i=c.Deferred(),void 0!==c.fn.select2&&void 0!==c.fn.select2.amd&&"function"==typeof c.fn.select2.amd.require?c.fn.select2.amd.require(["select2/results","select2/utils"],function(e,t){var n=function(e,t,i){n.__super__.constructor.call(this,e,t,i)};t.Extend(n,e),n.prototype.bind=function(e,t){var i=this;e.on("results:focus",function(e){"true"!=e.element.attr("aria-selected")&&i.trigger("select",{data:e.data})}),n.__super__.bind.call(this,e,t)},i.resolve(n)}):i.resolve(!1),i.promise()).done(function(e){n(e,t)})}).fail(function(e){i.errare("font_picker => fail response =>",e)})})}})}(wp.customize,jQuery,_);CZRSeksPrototype=CZRSeksPrototype||{};!function(a,s){s.extend(CZRSeksPrototype,{setupTinyMceEditor:function(){var o=this;a.sekEditorExpanded=new a.Value(!1),a.sekEditorSynchronizedInput=new a.Value,o.editorEventsListenerSetup=!1;var r=function(){a.sekTinyMceEditor=a.sekTinyMceEditor||tinyMCE.get("czr-customize-content_editor"),!1===o.editorEventsListenerSetup&&(o.attachEventsToEditor(),o.editorEventsListenerSetup=!0,o.trigger("sek-tiny-mce-editor-bound-and-instantiated"))};o.bind("sek-edit-module_done",function(e){"tiny_mce_editor"==e.clicked_input_type&&(a.sekEditorSynchronizedInput({control_id:e.id,input_id:e.clicked_input_id}),a.sekEditorExpanded(!0),a.sekTinyMceEditor.focus())}),s("#customize-theme-controls").on("click",'[data-czr-action="open-tinymce-editor"]',function(){var e=s(this).data("czr-control-id"),t=s(this).data("czr-input-id");if(_.isEmpty(e)||_.isEmpty(t))a.errare("toggle-tinymce-editor => missing input or control id");else{var i=s.extend(!0,{},a.sekEditorSynchronizedInput()),n=_.extend(i,{input_id:t,control_id:e});a.sekEditorSynchronizedInput(n),a.sekEditorExpanded(!0),a.sekTinyMceEditor.focus()}}),a.sekEditorSynchronizedInput.bind(function(e,t){r();var i=o.getLevelProperty({property:"value",id:e.control_id}),n=_.isObject(i)&&!_.isEmpty(i[e.input_id])?i[e.input_id]:"";try{a.sekTinyMceEditor.setContent(n)}catch(e){a.errare("Error when setting the tiny mce editor content in setupTinyMceEditor",e)}a.sekTinyMceEditor.focus()}),a.sekEditorExpanded.bind(function(e){r(),e&&a.sekTinyMceEditor.focus(),s(document.body).toggleClass("czr-customize-content_editor-pane-open",e),s(window)[e?"on":"off"]("resize",function(){a.sekEditorExpanded()&&_.delay(function(){o.czrResizeEditor(window.innerHeight-o.$editorPane.height())},50)}),e?o.czrResizeEditor(window.innerHeight-o.$editorPane.height()):(o.$preview.css("bottom",""),o.$collapseSidebar.css("bottom",""))}),s("#czr-customize-content_editor-pane").on("click",'[data-czr-action="close-tinymce-editor"]',function(){a.sekEditorExpanded(!1)}),s("#customize-controls").on("click",function(e){"open-tinymce-editor"!=s(e.target).data("czr-action")&&a.sekEditorExpanded(!1)}),s(document).on("keydown",_.throttle(function(e){27===e.keyCode&&a.sekEditorExpanded(!1)},50)),o.bind("sek-tiny-mce-editor-bound-and-instantiated",function(){var e=s(a.sekTinyMceEditor.iframeElement).contents().get(0);s(e).on("keydown",_.throttle(function(e){27===e.keyCode&&a.sekEditorExpanded(!1)},50))}),_.each(["sek-click-on-inactive-zone","sek-add-section","sek-add-column","sek-add-module","sek-remove","sek-move","sek-duplicate","sek-resize-columns","sek-add-content-in-new-sektion","sek-pick-module","sek-edit-options","sek-edit-module","sek-notify"],function(e){"sek-edit-module"!=e?a.previewer.bind(e,function(){a.sekEditorExpanded(!1)}):a.previewer.bind(e,function(e){a.sekEditorExpanded("czr_tiny_mce_editor_module"===e.module_type)})})},attachEventsToEditor:function(){var t=this;t.$editorTextArea=s("#czr-customize-content_editor"),t.$editorPane=s("#czr-customize-content_editor-pane"),t.$editorDragbar=s("#czr-customize-content_editor-dragbar"),t.$editorFrame=s("#czr-customize-content_editor_ifr"),t.$mceTools=s("#wp-czr-customize-content_editor-tools"),t.$mceToolbar=t.$editorPane.find(".mce-toolbar-grp"),t.$mceStatusbar=t.$editorPane.find(".mce-statusbar"),t.$preview=s("#customize-preview"),t.$collapseSidebar=s(".collapse-sidebar"),a.sekTinyMceEditor.on("input change keyup",function(e){if(a.control.has(a.sekEditorSynchronizedInput().control_id))try{a.control(a.sekEditorSynchronizedInput().control_id).trigger("tinyMceEditorUpdated",{input_id:a.sekEditorSynchronizedInput().input_id,html_content:a.sekTinyMceEditor.getContent(),modified_editor_element:a.sekTinyMceEditor})}catch(e){a.errare("Error when triggering tinyMceEditorUpdated",e)}}),t.$editorTextArea.on("input",function(e){try{a.control(a.sekEditorSynchronizedInput().control_id).trigger("tinyMceEditorUpdated",{input_id:a.sekEditorSynchronizedInput().input_id,html_content:t.$editorTextArea.val(),modified_editor_element:t.$editorTextArea})}catch(e){a.errare("Error when triggering tinyMceEditorUpdated",e)}})},czrResizeEditor:function(e){var t,i=this,n=window.innerHeight,o=(window.innerWidth,{});a.sekEditorExpanded()&&(_.isNaN(e)||(t=n-e),o.height=t,o.components=i.$mceTools.outerHeight()+i.$mceToolbar.outerHeight()+i.$mceStatusbar.outerHeight(),t<40&&(o.height=40),n-1<t&&(o.height=n-1),n<i.$editorPane.outerHeight()&&(o.height=n),i.$preview.css("bottom",o.height),i.$editorPane.css("height",o.height),i.$editorFrame.css("height",o.height-o.components),i.$collapseSidebar.css("bottom",n-o.height<56?i.$mceStatusbar.outerHeight()+4:o.height+8))}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(t,e){jQuery.extend(CZRSeksPrototype,t.Events);var i=t.Class.extend(CZRSeksPrototype);try{t.czr_sektions=new i}catch(e){t.errare("api.czr_sektions => problem on instantiation",e)}}(wp.customize),function(a,o,s){var e={initialize:function(e,t){var i=this;i.inputConstructor=a.CZRInput.extend(i.CZRInputMths||{}),i.itemConstructor=a.CZRItem.extend(i.CZRItemConstructor||{}),a.CZRDynModule.prototype.initialize.call(i,e,t)},CZRInputMths:{setupSelect:function(){var n=this,e=(n.input_parent,n.module);s.isEmpty(sektionsLocalizedData.selectOptions[n.id])?a.errare("Missing select options for input id => "+n.id+" in module "+e.module_type):(s.each(sektionsLocalizedData.selectOptions[n.id],function(e,t){var i={value:t,html:e};t==n()?o.extend(i,{selected:"selected"}):"px"===t&&o.extend(i,{selected:"selected"}),o("select[data-czrtype]",n.container).append(o("<option>",i))}),o("select[data-czrtype]",n.container).selecter())}},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!s.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){a.errorLog("item.setInputVisibilityDeps() : "+e)}}),a.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var n=this,o=n.module,r=function(t,i){n.czr_Input(t).visible(i()),this.bind(function(e){n.czr_Input(t).visible(i())})};n.czr_Input.each(function(i){switch(i.id){case"bg-image":s.each(["bg-position","bg-attachment","bg-scale","bg-apply-overlay","bg-color-overlay","bg-opacity-overlay"],function(t){try{r.call(i,t,function(){var e=!1;switch(t){case"bg-color-overlay":case"bg-opacity-overlay":e=!s.isEmpty(i()+"")&&a.CZR_Helpers.isChecked(n.czr_Input("bg-apply-overlay")());break;default:e=!s.isEmpty(i()+"")}return e})}catch(e){a.errare(o.id+" => error in setInputVisibilityDeps",e)}});break;case"bg-apply-overlay":s.each(["bg-color-overlay","bg-opacity-overlay"],function(e){try{r.call(i,e,function(){return!s.isEmpty(n.czr_Input("bg-image")()+"")&&a.CZR_Helpers.isChecked(i())})}catch(e){a.errare(o.id+" => error in setInputVisibilityDeps",e)}})}})}}};a.czrModuleMap=a.czrModuleMap||{},o.extend(a.czrModuleMap,{sek_level_bg_border_module:{mthds:e,crud:!1,name:a.czr_sektions.getRegisteredModuleProperty("sek_level_bg_border_module","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:s.extend({id:"",title:""},a.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_level_bg_border_module"))}})}(wp.customize,jQuery,_),function(o,r,i){var e={initialize:function(e,t){var i=this;i.inputConstructor=o.CZRInput.extend(i.CZRInputMths||{}),i.itemConstructor=o.CZRItem.extend(i.CZRItemConstructor||{}),o.CZRDynModule.prototype.initialize.call(i,e,t)},CZRInputMths:{setupSelect:function(){var n=this,e=(n.input_parent,n.module);i.isEmpty(sektionsLocalizedData.selectOptions[n.id])?o.errare("Missing select options for input id => "+n.id+" in module "+e.module_type):(i.each(sektionsLocalizedData.selectOptions[n.id],function(e,t){var i={value:t,html:e};t==n()?r.extend(i,{selected:"selected"}):"px"===t&&r.extend(i,{selected:"selected"}),r("select[data-czrtype]",n.container).append(r("<option>",i))}),r("select[data-czrtype]",n.container).selecter())}},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!i.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){o.errorLog("item.setInputVisibilityDeps() : "+e)}}),o.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var n=this;n.module;n.czr_Input.each(function(e){switch(e.id){case"height-type":(function(t,i){n.czr_Input(t).visible(i()),this.bind(function(e){n.czr_Input(t).visible(i())})}).call(e,"custom-height",function(){return"custom"===e()})}})}}};o.czrModuleMap=o.czrModuleMap||{},r.extend(o.czrModuleMap,{sek_level_height_module:{mthds:e,crud:!1,name:o.czr_sektions.getRegisteredModuleProperty("sek_level_height_module","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},o.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_level_height_module"))}})}(wp.customize,jQuery,_),function(i,o,t){var e={initialize:function(e,t){this.inputConstructor=i.CZRInput.extend(this.CZRInputMths||{}),i.CZRDynModule.prototype.initialize.call(this,e,t)},CZRInputMths:{setupSelect:function(){var n=this,e=(n.input_parent,n.module);t.isEmpty(sektionsLocalizedData.selectOptions[n.id])?i.errare("Missing select options for input id => "+n.id+" in module "+e.module_type):(t.each(sektionsLocalizedData.selectOptions[n.id],function(e,t){var i={value:t,html:e};t==n()?o.extend(i,{selected:"selected"}):"px"===t&&o.extend(i,{selected:"selected"}),o("select[data-czrtype]",n.container).append(o("<option>",i))}),o("select[data-czrtype]",n.container).selecter())}}};i.czrModuleMap=i.czrModuleMap||{},o.extend(i.czrModuleMap,{sek_level_section_layout_module:{mthds:e,crud:!1,name:i.czr_sektions.getRegisteredModuleProperty("sek_level_section_layout_module","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:t.extend({id:"",title:""},i.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_level_section_layout_module"))}})}(wp.customize,jQuery,_),function(n,o,e){var t={initialize:function(e,t){var i=this;i.inputConstructor=n.CZRInput.extend(i.CZRSpacingInputMths||{}),i.itemConstructor=n.CZRItem.extend(i.CZRSpacingItemMths||{}),n.CZRDynModule.prototype.initialize.call(i,e,t)},CZRSpacingInputMths:{setupSelect:function(){var n=this;n.input_parent,n.module;e.each(sektionsLocalizedData.selectOptions.spacingUnits,function(e,t){var i={value:t,html:e};t==n()?o.extend(i,{selected:"selected"}):"px"===t&&o.extend(i,{selected:"selected"}),o("select[data-czrtype]",n.container).append(o("<option>",i))}),o("select[data-czrtype]",n.container).selecter()}},CZRSpacingItemMths:{initialize:function(e,t){n.CZRItem.prototype.initialize.call(this,e,t);var i=this;i.bind("tab-switch",function(e){device="desktop";try{device=i.container.find('[data-tab-id="'+e.id+'"]').data("sek-device")}catch(e){n.errare("spacing input => error when binding the tab switch event",e)}try{n.previewedDevice(device)}catch(e){n.errare("spacing input => error when setting the device on tab switch",e)}})}}};n.czrModuleMap=n.czrModuleMap||{},o.extend(n.czrModuleMap,{sek_spacing_module:{mthds:t,crud:!1,name:n.czr_sektions.getRegisteredModuleProperty("sek_spacing_module","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:e.extend({id:"",title:""},n.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_spacing_module"))}})}(wp.customize,jQuery,_),function(t,e,i){t.czrModuleMap=t.czrModuleMap||{},e.extend(t.czrModuleMap,{sek_module_picker_module:{crud:!1,name:t.czr_sektions.getRegisteredModuleProperty("sek_module_picker_module","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},t.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_module_picker_module"))}}),t.czrInputMap=t.czrInputMap||{},e.extend(t.czrInputMap,{module_picker:function(e){t.czr_sektions.trigger("sek-refresh-dragzones",{type:"module",input_container:this.container})}})}(wp.customize,jQuery,_),function(o,r,a){var e={initialize:function(e,t){var i=this;o.CZRDynModule.prototype.initialize.call(i,e,t),i.inputConstructor=o.CZRInput.extend(i.CZRImageInputMths||{}),i.itemConstructor=o.CZRItem.extend(i.CZRItemConstructor||{}),i.bind("set_default_content_picker_options",function(e){return e.defaultContentPickerOption.defaultOption={title:'<span style="font-weight:bold">'+sektionsLocalizedData.i18n["Set a custom url"]+"</span>",type:"",type_label:"",object:"",id:"_custom_",url:""},e})},CZRImageInputMths:{setupSelect:function(){var n=this;n.input_parent,n.module;a.isEmpty(sektionsLocalizedData.selectOptions[n.id])?o.errare("Missing select options for input id => "+n.id+" in image module"):(a.each(sektionsLocalizedData.selectOptions[n.id],function(e,t){var i={value:t,html:e};t==n()?r.extend(i,{selected:"selected"}):"px"===t&&r.extend(i,{selected:"selected"}),r("select[data-czrtype]",n.container).append(r("<option>",i))}),r("select[data-czrtype]",n.container).selecter())}},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!a.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){o.errorLog("item.setInputVisibilityDeps() : "+e)}}),o.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var n=this,e=(n.module,function(t,i){n.czr_Input(t).visible(i()),this.bind(function(e){n.czr_Input(t).visible(i())})});n.czr_Input.each(function(i){switch(i.id){case"link-to":a.each(["link-pick-url","link-custom-url","link-target"],function(t){try{e.call(i,t,function(){var e=!1;switch(t){case"link-custom-url":e="url"==i()&&"_custom_"==n.czr_Input("link-pick-url")().id;break;default:e="url"==i()}return e})}catch(e){o.errare("Image module => error in setInputVisibilityDeps",e)}});break;case"link-pick-url":e.call(i,"link-custom-url",function(){return"_custom_"==i().id&&"url"==n.czr_Input("link-to")()})}})}}};o.czrModuleMap=o.czrModuleMap||{},r.extend(o.czrModuleMap,{czr_image_module:{mthds:e,crud:!1,name:o.czr_sektions.getRegisteredModuleProperty("czr_image_module","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:o.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_image_module")}})}(wp.customize,jQuery,_),function(o,r,e){var t={initialize:function(e,t){o.CZRDynModule.prototype.initialize.call(this,e,t),this.inputConstructor=o.CZRInput.extend(this.CZRTextEditorInputMths||{})},CZRTextEditorInputMths:{initialize:function(e,t){var i=this;o.CZRInput.prototype.initialize.call(i,e,t),"tiny_mce_editor"==i.type&&i.isReady.then(function(){i.container.find('[data-czr-action="open-tinymce-editor"]').trigger("click")})},setupSelect:function(){var n=this;n.input_parent,n.module;e.isEmpty(sektionsLocalizedData.selectOptions[n.id])?o.errare("Missing select options for input id => "+n.id+" in image module"):(e.each(sektionsLocalizedData.selectOptions[n.id],function(e,t){var i={value:t,html:e};t==n()?r.extend(i,{selected:"selected"}):"px"===t&&r.extend(i,{selected:"selected"}),r("select[data-czrtype]",n.container).append(r("<option>",i))}),r("select[data-czrtype]",n.container).selecter())}}};o.czrModuleMap=o.czrModuleMap||{},r.extend(o.czrModuleMap,{czr_tiny_mce_editor_module:{mthds:t,crud:!1,name:o.czr_sektions.getRegisteredModuleProperty("czr_tiny_mce_editor_module","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:o.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_tiny_mce_editor_module")}})}(wp.customize,jQuery,_);
|
1 |
+
var CZRSeksPrototype=CZRSeksPrototype||{};!function(r,s){s.extend(CZRSeksPrototype,{initialize:function(){var o=this;if(_.isUndefined(window.sektionsLocalizedData))throw new Error("CZRSeksPrototype => missing localized server params sektionsLocalizedData");if(!_.isFunction(r.czr_activeSkopes))throw new Error("CZRSeksPrototype => api.czr_activeSkopes");o.MAX_NUMBER_OF_COLUMNS=12,o.SETTING_UPDATE_BUFFER=50,o.defaultSektionSettingValue=sektionsLocalizedData.defaultSektionSettingValue,o.sekCollectionSettingId=new r.Value({}),o.registered=new r.Value([]),r.bind("ready",function(){o.registerAndSetupDefaultPanelSectionOptions(),o.sekCollectionSettingId.callbacks.add(function(e,t){try{o.setupSettingToBeSaved()}catch(e){r.errare("Error in self.sekCollectionSettingId.callbacks => self.setupSettingsToBeSaved()",e)}});var i=function(e,t){o.setContextualCollectionSettingIdWhenSkopeSet(e,t),o.generateUI({action:"sek-generate-local-skope-options-ui"}),o.generateUI({action:"sek-generate-global-options-ui"})};_.isEmpty(r.czr_activeSkopes().local)||i(),r.czr_activeSkopes.callbacks.add(function(e,t){i(e,t)}),o.reactToPreviewMsg(),o.setupDnd(),o.setupTinyMceEditor(),o.schedulePrintSectionJson(),o.bind("sek-ui-removed",function(){r.previewedDevice("desktop")}),r.previewedDevice.bind(function(t){var e=_.filter(o.registered(),function(e){return"control"==e.what});_.each(e||[],function(e){r.control(e.id,function(e){e.container.find('[data-sek-device="'+t+'"]').each(function(){s(this).trigger("click")})})})}),s("#customize-notifications-area").on("click",'[data-sek-reset="true"]',function(){o.resetCollectionSetting()}),o.bind("sek-ui-pre-removal",function(e){"control"==e.what&&-1<e.id.indexOf("draggable")&&r.control(e.id,function(e){e.container.find("[draggable]").each(function(){s(this).off("dragstart dragend")})}),"control"==e.what&&r.control(e.id,function(e){e.container.find("select").each(function(){_.isUndefined(s(this).data("select2"))||s(this).select2("destroy")})})}),r.bind("czr-new-registered",function(e){if(_.isUndefined(e.origin))throw new Error("czr-new-registered event => missing params.origin");if("nimble"===e.origin&&!1!==e.track){var t=o.registered(),i=s.extend(!0,[],t),n=_.findWhere(i,{id:e.id});if(!_.isEmpty(n)&&_.isEqual(n,e))throw new Error("register => duplicated element in self.registered() collection "+e.id);i.push(e),o.registered(i)}}),o.setupTopBar()})},registerAndSetupDefaultPanelSectionOptions:function(){var n=this,e=r.Panel.extend({isContextuallyActive:function(){return this.active()},_toggleActive:function(){return!0}});r.panel(sektionsLocalizedData.sektionsPanelId,function(n){n.deferred.embedded.done(function(){var e=n.container.find("h3.accordion-section-title"),t=(n.container.find(".panel-meta .accordion-section-title"),['<img class="sek-nimble-logo" alt="'+n.params.title+'" src="',sektionsLocalizedData.baseUrl,"/assets/img/nimble/nimble_horizontal.svg",'"/>'].join(""));if(0<e.length){var i=e.find("span");e.addClass("sek-side-nimble-logo-wrapper").html(t).append(i)}})}),r.CZR_Helpers.register({origin:"nimble",what:"panel",id:sektionsLocalizedData.sektionsPanelId,title:sektionsLocalizedData.i18n["Nimble Builder"],priority:-1e3,constructWith:e,track:!1}),r.CZR_Helpers.register({origin:"nimble",what:"section",id:"__globalAndLocalOptionsSection",title:sektionsLocalizedData.i18n["Site wide options"],panel:sektionsLocalizedData.sektionsPanelId,priority:20,track:!1,constructWith:r.Section.extend({isContextuallyActive:function(){return this.active()},_toggleActive:function(){return!0}})}).done(function(){r.section("__globalAndLocalOptionsSection",function(e){var t=e.container.find(".accordion-section-title"),i=e.container.find(".customize-section-title h3");0<t.length&&t.prepend('<i class="fas fa-globe sek-level-option-icon"></i>'),0<i.length&&i.find(".customize-action").after('<i class="fas fa-globe sek-level-option-icon"></i>'),n.scheduleModuleAccordion.call(e)})}),r.CZR_Helpers.register({origin:"nimble",what:"section",id:"__localOptionsSection",title:sektionsLocalizedData.i18n["Current page options"],panel:sektionsLocalizedData.sektionsPanelId,priority:10,track:!1,constructWith:r.Section.extend({isContextuallyActive:function(){return this.active()},_toggleActive:function(){return!0}})}).done(function(){r.section("__localOptionsSection",function(e){var t=e.container.find(".accordion-section-title"),i=e.container.find(".customize-section-title h3");0<t.length&&t.prepend('<i class="fas fa-map-marker-alt sek-level-option-icon"></i>'),0<i.length&&i.find(".customize-action").after('<i class="fas fa-map-marker-alt sek-level-option-icon"></i>'),n.scheduleModuleAccordion.call(e)})}),r.CZR_Helpers.register({origin:"nimble",what:"setting",id:sektionsLocalizedData.optNameForGlobalOptions,dirty:!1,value:sektionsLocalizedData.globalOptionDBValues,transport:"refresh",type:"option"})},setContextualCollectionSettingIdWhenSkopeSet:function(e,t){t=t||{},!_.isEmpty(t.local)&&r.panel(sektionsLocalizedData.sektionsPanelId).expanded()&&r.previewer.trigger("sek-pick-content"),sektionsData=r.czr_skopeBase.getSkopeProperty("sektions","local"),sektionsLocalizedData.isDevMode&&r.infoLog("::setContextualCollectionSettingIdWhenSkopeSet => SEKTIONS DATA ? ",sektionsData),_.isEmpty(sektionsData)&&r.errare("::setContextualCollectionSettingIdWhenSkopeSet() => no sektionsData"),_.isEmpty(sektionsData.setting_id)&&r.errare("::setContextualCollectionSettingIdWhenSkopeSet() => missing setting_id"),this.sekCollectionSettingId(sektionsData.setting_id)}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(l,d){d.extend(CZRSeksPrototype,{setupTopBar:function(){var t=this;t.topBarVisible=new l.Value(!1),t.topBarVisible.bind(function(e){t.toggleTopBar(e)}),t.mouseMovedRecently=new l.Value({}),t.mouseMovedRecently.bind(function(e){t.topBarVisible(!_.isEmpty(e))});var e=function(e){t.mouseMovedRecently({x:e.clientX,y:e.clientY}),clearTimeout(d(window).data("_scroll_move_timer_")),d(window).data("_scroll_move_timer_",setTimeout(function(){t.mouseMovedRecently.set({})},4e3))};d(window).on("mousemove scroll,",_.throttle(e,50)),l.previewer.bind("ready",function(){d(l.previewer.targetWindow().document).on("mousemove scroll,",_.throttle(e,50))}),t.historyLog=new l.Value([]),t.historyLog.bind(function(e){if(!_.isEmpty(e)){var t=_.findKey(e,{status:"current"});t=Number(t),d("#nimble-top-bar").find("[data-nimble-history]").each(function(){"undo"===d(this).data("nimble-history")?d(this).attr("data-nimble-state",t<=0?"disabled":"enabled"):d(this).attr("data-nimble-state",e.length<=t+1?"disabled":"enabled")})}})},toggleTopBar:function(e){e=!!_.isUndefined(e)||e;var t,i=this;e?d.when(i.renderAndSetupTopBarTmpl({})).done(function(e){i.topBarContainer=e,_.delay(function(){d("body").addClass("nimble-top-bar-visible")},200)}):(t=d.Deferred(),d("body").removeClass("nimble-top-bar-visible"),i.topBarContainer&&i.topBarContainer.length?_.delay(function(){t.resolve()},300):t.resolve(),t.promise()).done(function(){i.topBarVisible(!1)})},renderAndSetupTopBarTmpl:function(e){if(0<d("#nimble-top-bar").length)return d("#nimble-top-bar");var t=this;try{_tmpl=wp.template("nimble-top-bar")({})}catch(e){return l.errare("Error when parsing the the top note template",e),!1}return d("#customize-preview").after(d(_tmpl)),d("[data-nimble-history]","#nimble-top-bar").on("click",function(e){try{t.navigateHistory(d(this).data("nimble-history"))}catch(e){l.errare("Error when firing self.navigateHistory",e)}}),d(".sek-settings","#nimble-top-bar").on("click",function(e){l.panel(sektionsLocalizedData.sektionsPanelId,function(e){t.rootPanelFocus(),e.focus()})}),d(".sek-add-content","#nimble-top-bar").on("click",function(e){e.preventDefault(),l.previewer.trigger("sek-pick-content",{})}),d(".sek-nimble-doc","#nimble-top-bar").on("click",function(e){e.preventDefault(),window.open(d(this).data("doc-href"),"_blank")}),d("#nimble-top-bar")},navigateHistory:function(i){var t,n,o,r,e=this,s=d.extend(!0,[],e.historyLog()),a=[];if(_.each(s,function(e){if(_.isEmpty(r)){switch(e.status){case"previous":t=e;break;case"current":n=e;break;case"future":o=e}switch(i){case"undo":_.isEmpty(n)||_.isEmpty(t)||(r=t.value,n.sektionToRefresh,t.sektionToRefresh);break;case"redo":_.isEmpty(o)||(r=o.value,n.sektionToRefresh,o.sektionToRefresh)}}}),!_.isUndefined(r)){l(e.sekCollectionSettingId())(e.validateSettingValue(r),{navigatingHistoryLogs:!0});l.previewer.refresh(),l.previewer.trigger("sek-pick-content",{}),e.cleanRegistered(),e.cleanRegisteredLevelSettingsAfterHistoryNavigation()}var c=_.findKey(s,{status:"current"});c=Number(c),_.isNumber(c)?(_.each(s,function(e,t){switch(newLog=d.extend(!0,{},e),t=Number(t),i){case"undo":0<c&&(t===c-1?newLog.status="current":t===c&&(newLog.status="future"));break;case"redo":s.length>c+1&&(t===c?newLog.status="previous":t===c+1&&(newLog.status="current"))}a.push(newLog)}),e.historyLog(a)):l.errare("Error when navigating the history log, the current key should be a number")}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(a,c){c.extend(CZRSeksPrototype,{setupSettingToBeSaved:function(){var e,s=this;e=a.czr_skopeBase.getSkopeProperty("sektions","local").db_values;var t=s.sekCollectionSettingId();if(_.isEmpty(t))throw new Error("setupSettingsToBeSaved => the collectionSettingId is invalid");if(!a.has(t)){a.CZR_Helpers.register({what:"setting",id:t,value:s.validateSettingValue(_.isObject(e)?e:s.defaultSektionSettingValue),transport:"postMessage",type:"option",track:!1,origin:"nimble"});a(t,function(e){s.historyLog([{status:"current",value:e(),action:"initial"}]),e.bind(_.debounce(function(e,t,i){if(i&&!0!==i.navigatingHistoryLogs){var n,o=[],r=c.extend(!0,[],s.historyLog());_.isEmpty(i.in_sektion)?_.isEmpty(i.to_sektion)||(n=i.to_sektion):n=i.in_sektion,_.each(r,function(e){"future"!=e.status&&(c.extend(e,{status:"previous"}),o.push(e))}),o.push({status:"current",value:e,action:_.isObject(i)&&i.action||"",sektionToRefresh:n}),s.historyLog(o)}},1e3))})}},validateSettingValue:function(i){if(!_.isObject(i))return a.errare("validation error => the setting should be an object",i),null;var n={},o=!1,e=[],r=function(e){a.errare(e,i),a.previewer.trigger("sek-notify",{type:"error",duration:3e4,message:['<span style="font-size:0.95em">',"<strong>"+e+"</strong>","<br>",sektionsLocalizedData.i18n["If this problem locks the Nimble builder, you might try to reset the sections for this page."],"<br>",'<span style="text-align:center;display:block">','<button type="button" class="button" aria-label="'+sektionsLocalizedData.i18n.Reset+'" data-sek-reset="true">'+sektionsLocalizedData.i18n.Reset+"</button>","</span>","</span>"].join("")}),o=!0},s=function(t){if(!o)if(_.isUndefined(t)&&_.isEmpty(n)){if(t=c.extend(!0,{},i),_.isUndefined(t.id)||_.isUndefined(t.level)){if(_.isUndefined(t.collection))return void r("validation error => the root level is missing the collection of locations");if(!_.isEmpty(t.level)||!_.isEmpty(t.id))return void r('validation error => the root level should not have a "level" or an "id" property');_.each(i.collection,function(e){n=t,s(e)})}}else{if(_.isEmpty(t.id)||!_.isString(t.id))return void r("validation error => a "+t.level+" level must have a valid id");if(_.contains(e,t.id))return void r("validation error => duplicated level id : "+t.id);if(e.push(t.id),_.isEmpty(t.level)||!_.isString(t.level))return void r("validation error => a "+t.level+" level must have a level property");if(!_.contains(["location","section","column","module"],t.level))return void r('validation error => the level "'+t.level+'" is not authorized');if("module"==t.level){if(!_.isUndefined(t.collection))return void r("validation error => a module can not have a collection property")}else if(_.isUndefined(t.collection))return void r("validation error => missing collection property for level => "+t.level+" "+t.id);if(_.isUndefined(t.ver_ini))return void r("validation error => a "+t.level+' should have a version property : "ver_ini"');switch(t.level){case"location":if(!_.isEmpty(n.level))return void r("validation error => the parent of location "+t.id+" should have no level set");break;case"section":if(t.is_nested&&"column"!=n.level)return void r("validation error => the nested section "+t.id+" must be child of a column");if(!t.is_nested&&"location"!=n.level)return void r("validation error => the section "+t.id+" must be child of a location");break;case"column":if("section"!=n.level)return void r("validation error => the column "+t.id+" must be child of a section");break;case"module":if("column"!=n.level)return void r("validation error => the module "+t.id+" must be child of a column")}"module"!=t.level&&_.each(t.collection,function(e){n=c.extend(!0,{},t),s(e)})}};return s(),o?null:i},resetCollectionSetting:function(){if(_.isEmpty(this.sekCollectionSettingId()))throw new Error("setupSettingsToBeSaved => the collectionSettingId is invalid");a(this.sekCollectionSettingId())(this.defaultSektionSettingValue),a.previewer.refresh(),a.notifications.remove("sek-notify"),a.panel(sektionsLocalizedData.sektionsPanelId,function(e){a.notifications.add(new a.Notification("sek-reset-done",{type:"success",message:sektionsLocalizedData.i18n["Reset complete"],dismissible:!0})),_.delay(function(){a.notifications.remove("sek-reset-done")},5e3)})}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(c,l){l.extend(CZRSeksPrototype,{reactToPreviewMsg:function(){var o=this,r={},s={},a=!0,e={"sek-add-section":{callback:function(e){return a=!!_.isUndefined(e.send_to_preview)||e.send_to_preview,s={},r={action:"sek-add-section",id:sektionsLocalizedData.optPrefixForSektionsNotSaved+o.guid(),location:e.location,in_sektion:e.in_sektion,in_column:e.in_column,is_nested:!_.isEmpty(e.in_sektion)&&!_.isEmpty(e.in_column),before_section:e.before_section,after_section:e.after_section,is_first_section:e.is_first_section},o.updateAPISetting(r)},complete:function(e){e.apiParams.is_first_section&&c.previewer.trigger("sek-refresh-level",{level:"location",id:e.apiParams.location}),c.previewer.trigger("sek-pick-content",{}),c.previewer.send("sek-focus-on",{id:e.apiParams.id})}},"sek-add-column":{callback:function(e){return a=!0,s={},r={id:sektionsLocalizedData.optPrefixForSektionsNotSaved+o.guid(),action:"sek-add-column",in_sektion:e.in_sektion,autofocus:e.autofocus},o.updateAPISetting(r)},complete:function(e){!1!==e.apiParams.autofocus&&c.previewer.trigger("sek-pick-content",{})}},"sek-add-module":{callback:function(e){return a=!0,s={},r={id:sektionsLocalizedData.optPrefixForSektionsNotSaved+o.guid(),action:"sek-add-module",in_sektion:e.in_sektion,in_column:e.in_column,module_type:e.content_id,before_module:e.before_module,after_module:e.after_module},o.updateAPISetting(r)},complete:function(e){c.previewer.trigger("sek-edit-module",{id:e.apiParams.id,level:"module",in_sektion:e.apiParams.in_sektion,in_column:e.apiParams.in_column}),o.updateAPISetting({action:"sek-update-fonts"}),c.previewer.send("sek-refresh-stylesheet",{skope_id:c.czr_skopeBase.getSkopeProperty("skope_id")})}},"sek-remove":{callback:function(e){switch(a=!0,s={},e.level){case"section":var t=o.getLevelModel(e.id);if("no_match"===t){c.errare("reactToPreviewMsg => sek-remove-section => no sektionToRemove matched");break}r={action:"sek-remove-section",id:e.id,location:e.location,in_sektion:e.in_sektion,in_column:e.in_column,is_nested:t.is_nested};break;case"column":r={action:"sek-remove-column",id:e.id,in_sektion:e.in_sektion};break;case"module":r={action:"sek-remove-module",id:e.id,in_sektion:e.in_sektion,in_column:e.in_column};break;default:c.errare("::reactToPreviewMsg => sek-remove => missing level ",e)}return o.updateAPISetting(r)},complete:function(e){if(c.previewer.trigger("sek-pick-content",{}),o.updateAPISetting({action:"sek-update-fonts"}),"sek-remove-section"===e.apiParams.action){var t=o.getLevelModel(e.apiParams.location);_.isEmpty(t.collection)&&c.previewer.trigger("sek-refresh-level",{level:"location",id:e.apiParams.location})}}},"sek-move":{callback:function(e){switch(a=!0,s={},e.level){case"section":r={action:"sek-move-section",id:e.id,is_nested:!_.isEmpty(e.in_sektion)&&!_.isEmpty(e.in_column),newOrder:e.newOrder,from_location:e.from_location,to_location:e.to_location};break;case"column":r={action:"sek-move-column",id:e.id,newOrder:e.newOrder,from_sektion:e.from_sektion,to_sektion:e.to_sektion};break;case"module":r={action:"sek-move-module",id:e.id,newOrder:e.newOrder,from_column:e.from_column,to_column:e.to_column,from_sektion:e.from_sektion,to_sektion:e.to_sektion}}return o.updateAPISetting(r)},complete:function(e){switch(e.apiParams.action){case"sek-move-section":c.previewer.trigger("sek-edit-options",{id:e.apiParams.id,level:"section",in_sektion:e.apiParams.id}),e.apiParams.from_location!=e.apiParams.to_location&&(c.previewer.trigger("sek-refresh-level",{level:"location",id:e.apiParams.to_location}),c.previewer.trigger("sek-refresh-level",{level:"location",id:e.apiParams.from_location}));break;case"sek-move-column":c.previewer.trigger("sek-edit-options",{id:e.apiParams.id,level:"column",in_sektion:e.apiParams.in_sektion,in_column:e.apiParams.in_column});break;case"sek-refresh-modules-in-column":c.previewer.trigger("sek-edit-module",{id:e.apiParams.id,level:"module",in_sektion:e.apiParams.in_sektion,in_column:e.apiParams.in_column})}}},"sek-duplicate":{callback:function(e){switch(a=!0,s={},e.level){case"section":r={action:"sek-duplicate-section",id:e.id,location:e.location,in_sektion:e.in_sektion,in_column:e.in_column,is_nested:!_.isEmpty(e.in_sektion)&&!_.isEmpty(e.in_column)};break;case"column":r={action:"sek-duplicate-column",id:e.id,in_sektion:e.in_sektion,in_column:e.in_column};break;case"module":r={action:"sek-duplicate-module",id:e.id,in_sektion:e.in_sektion,in_column:e.in_column}}return o.updateAPISetting(r)},complete:function(e){switch(e.apiParams.action){case"sek-duplicate-section":c.previewer.trigger("sek-edit-options",{id:e.apiParams.id,level:"section",in_sektion:e.apiParams.id});break;case"sek-duplicate-column":c.previewer.trigger("sek-edit-options",{id:e.apiParams.id,level:"column",in_sektion:e.apiParams.in_sektion,in_column:e.apiParams.in_column});break;case"sek-duplicate-module":c.previewer.trigger("sek-edit-module",{id:e.apiParams.id,level:"module",in_sektion:e.apiParams.in_sektion,in_column:e.apiParams.in_column})}c.previewer.send("sek-refresh-stylesheet",{skope_id:c.czr_skopeBase.getSkopeProperty("skope_id")}),c.previewer.send("sek-focus-on",{id:e.apiParams.id})}},"sek-resize-columns":function(e){return a=!0,s={},r=e,o.updateAPISetting(r)},"sek-add-content-in-new-sektion":{callback:function(e){switch(a=!!_.isUndefined(e.send_to_preview)||e.send_to_preview,s={},(r=e).action="sek-add-content-in-new-sektion",r.id=sektionsLocalizedData.optPrefixForSektionsNotSaved+o.guid(),e.content_type){case"module":r.droppedModuleId=sektionsLocalizedData.optPrefixForSektionsNotSaved+o.guid();break;case"preset_section":c.previewer.send("sek-maybe-print-loader",{loader_located_in_level_id:e.location}),c.previewer.send("sek-maybe-print-loader",{fullPageLoader:!0})}return o.updateAPISetting(r)},complete:function(e){switch(e.apiParams.content_type){case"module":c.previewer.trigger("sek-edit-module",{level:"module",id:e.apiParams.droppedModuleId});break;case"preset_section":c.previewer.send("sek-clean-loader",{cleanFullPageLoader:!0})}o.updateAPISetting({action:"sek-update-fonts"}),c.previewer.send("sek-refresh-stylesheet",{skope_id:c.czr_skopeBase.getSkopeProperty("skope_id")}),e.apiParams.is_first_section&&c.previewer.trigger("sek-refresh-level",{level:"location",id:e.apiParams.location}),e.apiParams.sektion_to_replace&&c.previewer.trigger("sek-remove",{id:e.apiParams.sektion_to_replace,location:e.apiParams.location,in_column:e.apiParams.in_column,level:"section"})}},"sek-add-preset-section-in-new-nested-sektion":{callback:function(e){return a=!1,s={},(r=e).action="sek-add-preset-section-in-new-nested-sektion",r.id=sektionsLocalizedData.optPrefixForSektionsNotSaved+o.guid(),c.previewer.send("sek-maybe-print-loader",{loader_located_in_level_id:e.location}),o.updateAPISetting(r)},complete:function(e){c.previewer.send("sek-refresh-stylesheet",{skope_id:c.czr_skopeBase.getSkopeProperty("skope_id")}),o.updateAPISetting({action:"sek-update-fonts"}),c.previewer.trigger("sek-refresh-level",{level:"section",id:e.apiParams.in_sektion})}},"sek-pick-content":function(e){return a=!0,r={},s={action:"sek-generate-draggable-candidates-picker-ui",content_type:(e=e||{}).content_type||"section",was_triggered:!_.has(e,"was_triggered")||e.was_triggered,focus:!_.has(e,"focus")||e.focus},o.generateUI(s)},"sek-edit-options":function(e){return a=!0,r={},_.isEmpty(e.id)?l.Deferred(function(){this.reject("missing id")}):(s={action:"sek-generate-level-options-ui",level:e.level,id:e.id,in_sektion:e.in_sektion,in_column:e.in_column,options:e.options||[]},o.generateUI(s))},"sek-edit-module":function(e){return a=!0,r={},s={action:"sek-generate-module-ui",level:e.level,id:e.id,in_sektion:e.in_sektion,in_column:e.in_column,options:e.options||[]},o.generateUI(s)},"sek-notify":function(t){return a=!1,l.Deferred(function(){c.panel(sektionsLocalizedData.sektionsPanelId,function(e){c.notifications.add(new c.Notification("sek-notify",{type:t.type||"info",message:t.message,dismissible:!0})),_.delay(function(){c.notifications.remove("sek-notify")},t.duration||5e3)}),this.resolve()})},"sek-refresh-level":function(e){return a=!0,l.Deferred(function(){r={action:"sek-refresh-level",level:e.level,id:e.id},s={},this.resolve()})}};_.each(e,function(i,n){c.previewer.bind(n,function(t){var e;if(_.isFunction(i))e=i;else{if(!_.isFunction(i.callback))return void c.errare("::reactToPreviewMsg => invalid callback for action "+n);e=i.callback}try{e(t).done(function(e){a?c.previewer.send(n,{skope_id:c.czr_skopeBase.getSkopeProperty("skope_id"),apiParams:r,uiParams:s,cloneId:!_.isEmpty(e)&&e}):c.previewer.trigger([n,"done"].join("_"),{apiParams:r,uiParams:s}),o.trigger([n,"done"].join("_"),t)}).fail(function(e){c.errare("reactToPreviewMsg => error when firing "+n,e),c.previewer.trigger("sek-notify",{type:"error",duration:3e4,message:['<span style="font-size:0.95em">',"<strong>"+e+"</strong>","<br>",sektionsLocalizedData.i18n["If this problem locks the Nimble builder, you might try to reset the sections for this page."],"<br>",'<span style="text-align:center;display:block">','<button type="button" class="button" aria-label="'+sektionsLocalizedData.i18n.Reset+'" data-sek-reset="true">'+sektionsLocalizedData.i18n.Reset+"</button>","</span>","</span>"].join("")})})}catch(e){c.errare("reactToPreviewMsg => error when receiving "+n,e)}})}),_.each(e,function(t,i){c.previewer.bind([i,"done"].join("_"),function(e){if(_.isFunction(t.complete))try{t.complete(e)}catch(e){c.errare("reactToPreviewMsg done => error when receiving "+[i,"done"].join("_"),e)}})})},schedulePrintSectionJson:function(){var i=this,n=function(e){return e.id="",_.each(e.collection,function(e){e.id="",_.isArray(e.collection)&&n(e)}),e};c.previewer.bind("sek-to-json",function(e){var t=l.extend(!0,{},i.getLevelModel(e.id));console.log(JSON.stringify(n(t)))})}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(k,y){y.extend(CZRSeksPrototype,{generateUI:function(e){var t=this,i=y.Deferred();switch(_.isEmpty(e.action)&&i.reject("generateUI => missing action"),e.action){case"sek-generate-module-ui":try{i=t.generateUIforFrontModules(e,i)}catch(e){k.errare("::generateUI() => error",e),i=y.Deferred()}break;case"sek-generate-level-options-ui":try{i=t.generateUIforLevelOptions(e,i)}catch(e){k.errare("::generateUI() => error",e),i=y.Deferred()}break;case"sek-generate-draggable-candidates-picker-ui":t.cleanRegistered();try{i=t.generateUIforDraggableContent(e,i)}catch(e){k.errare("::generateUI() => error",e),i=y.Deferred()}break;case"sek-generate-local-skope-options-ui":t.cleanRegistered();try{i=t.generateUIforLocalSkopeOptions(e,i)}catch(e){k.errare("::generateUI() => error",e),i=y.Deferred()}break;case"sek-generate-global-options-ui":t.cleanRegistered();try{i=t.generateUIforGlobalOptions(e,i)}catch(e){k.errare("::generateUI() => error",e),i=y.Deferred()}}return"pending"==i.state()?i.resolve().promise():i.promise()},updateAPISettingAndExecutePreviewActions:function(n){if(!_.isEmpty(n.settingParams)&&_.has(n.settingParams,"to")){var o,r=this,e=n.settingParams.to,t=null,i=!1;if(!_.isEmpty(n.settingParams.args)&&_.has(n.settingParams.args,"moduleRegistrationParams")){var s=n.settingParams.args.moduleRegistrationParams.control,a=n.settingParams.args.moduleRegistrationParams.id,c=s.czr_Module(a);if(_.isEmpty(c)?k.errare("updateAPISettingAndExecutePreviewActions => missing parentModuleInstance",n):(t=c.module_type,i=c.isMultiItem()),!i&&_.isObject(e)?o=r.normalizeAndSanitizeSingleItemInputValues(e,t):(o=[],_.each(e,function(e){o.push(r.normalizeAndSanitizeSingleItemInputValues(e,t))})),_.isEmpty(n.defaultPreviewAction))k.errare("updateAPISettingAndExecutePreviewActions => missing defaultPreviewAction in passed params. No action can be triggered to the api.previewer.",n);else{var l,d="refresh_stylesheet"===n.defaultPreviewAction,u="refresh_markup"===n.defaultPreviewAction,p="refresh_fonts"===n.defaultPreviewAction,m="refresh_preview"===n.defaultPreviewAction,f=n.settingParams.args.input_changed;_.isUndefined(f)||(l=r.getInputRegistrationParams(f,t),_.isUndefined(l.refresh_stylesheet)||(d=Boolean(l.refresh_stylesheet)),_.isUndefined(l.refresh_markup)||(u=Boolean(l.refresh_markup)),_.isUndefined(l.refresh_fonts)||(p=Boolean(l.refresh_fonts)),_.isUndefined(l.refresh_preview)||(m=Boolean(l.refresh_preview)));var h=function(){if(!0!==n.isGlobalOptions)return r.updateAPISetting({action:n.uiParams.action,id:n.uiParams.id,value:o,in_column:n.uiParams.in_column,in_sektion:n.uiParams.in_sektion,options_type:n.options_type,settingParams:n.settingParams}).done(function(){!0===d&&k.previewer.send("sek-refresh-stylesheet",{skope_id:k.czr_skopeBase.getSkopeProperty("skope_id"),apiParams:{action:"sek-refresh-stylesheet",id:n.uiParams.id,level:n.uiParams.level}}),!0===u&&k.previewer.send("sek-refresh-level",{apiParams:{action:"sek-refresh-level",id:n.uiParams.id,level:n.uiParams.level},skope_id:k.czr_skopeBase.getSkopeProperty("skope_id")}),!0===m&&k.previewer.refresh()});if(_.isEmpty(n.options_type))k.errare("updateAPISettingAndExecutePreviewActions => error when updating the global options => missing options_type");else{var e=k(sektionsLocalizedData.optNameForGlobalOptions)(),t=y.extend(!0,{},_.isObject(e)?e:{}),i={};_.each(o||{},function(e,t){!_.isBoolean(e)&&_.isEmpty(e+"")||(i[t]=e)}),t[n.options_type]=i,k(sektionsLocalizedData.optNameForGlobalOptions)(t)}};if(!0===p){var g=n.settingParams.args.input_value;if(!_.isString(g))return void k.errare("updateAPISettingAndExecutePreviewActions => font-family must be a string",g);-1<g.indexOf("gfont")?r.updateAPISetting({action:"sek-update-fonts",font_family:g}).always(function(){h().then(function(){r.updateAPISetting({action:"sek-update-fonts"})})}):h()}else h()}}else k.errare("updateAPISettingAndExecutePreviewActions => missing params.settingParams.args.moduleRegistrationParams The api main setting can not be updated",n)}else k.errare("updateAPISettingAndExecutePreviewActions => missing params.settingParams.to. The api main setting can not be updated",n)},normalizeAndSanitizeSingleItemInputValues:function(e,o){var i,r={},n={},s=null,a=this;return _.each(e,function(e,t){var i,n;_.contains(["title","id"],t)||(null!==o&&"no_default_value_specified"===(s=a.getInputDefaultValue(t,o))&&k.infoLog("::updateAPISettingAndExecutePreviewActions => missing default value for input "+t+" in module "+o),i=e,n=s,(_.isBoolean(i)||_.isBoolean(n)?Boolean(i)===Boolean(n):_.isNumber(i)||_.isNumber(n)?Number(i)===Number(n):_.isString(i)||_.isString(n)?i+""==n+"":_.isObject(i)&&_.isObject(n)?_.isEqual(i,n):_.isArray(i)&&_.isArray(n)?JSON.stringify(i.sort())===JSON.stringify(n.sort()):i===n)||(r[t]=e))}),_.each(r,function(e,t){switch(a.getInputType(t,o)){case"text":case"textarea":case"check":case"gutencheck":case"select":case"radio":case"number":case"upload":case"upload_url":case"color":case"wp_color_alpha":case"wp_color":case"content_picker":case"tiny_mce_editor":case"password":case"range":case"range_slider":case"hidden":case"h_alignment":case"h_text_alignment":case"spacing":case"bg_position":case"v_alignment":case"font_size":case"line_height":case"font_picker":default:i=e}n[t]=i}),n},isUIControlAlreadyRegistered:function(t){var e=_.filter(this.registered(),function(e){return e.id==t&&"control"===e.what}),i=!1;return _.isEmpty(e)?i=k.control.has(t):(i=!0,1<e.length&&k.errare("generateUI => why is this control registered more than once ? => "+t)),i}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(s,a){a.extend(CZRSeksPrototype,{generateUIforDraggableContent:function(n,e){var o=this,t={};a.extend(t,{content_type_switcher:{settingControlId:sektionsLocalizedData.optPrefixForSektionsNotSaved+"_sek_content_type_switcher_ui",module_type:"sek_content_type_switcher_module",controlLabel:sektionsLocalizedData.i18n["Select a content type"],priority:0,settingValue:{content_type:n.content_type}},module_picker:{settingControlId:sektionsLocalizedData.optPrefixForSektionsNotSaved+"_sek_draggable_modules_ui",module_type:"sek_module_picker_module",controlLabel:sektionsLocalizedData.i18n["Pick a module"],content_type:"module",priority:20,icon:'<i class="fas fa-grip-vertical sek-level-option-icon"></i>'},sek_intro_sec_picker_module:{settingControlId:sektionsLocalizedData.optPrefixForSektionsNotSaved+o.guid()+"_sek_draggable_sections_ui",module_type:"sek_intro_sec_picker_module",controlLabel:sektionsLocalizedData.i18n["Sections for an introduction"],content_type:"section",expandAndFocusOnInit:!0,priority:10,icon:'<i class="fas fa-grip-vertical sek-level-option-icon"></i>'},sek_features_sec_picker_module:{settingControlId:sektionsLocalizedData.optPrefixForSektionsNotSaved+o.guid()+"_sek_draggable_sections_ui",module_type:"sek_features_sec_picker_module",controlLabel:sektionsLocalizedData.i18n["Sections for services and features"],content_type:"section",expandAndFocusOnInit:!1,priority:10,icon:'<i class="fas fa-grip-vertical sek-level-option-icon"></i>'},sek_column_layouts_sec_picker_module:{settingControlId:sektionsLocalizedData.optPrefixForSektionsNotSaved+o.guid()+"_sek_draggable_sections_ui",module_type:"sek_column_layouts_sec_picker_module",controlLabel:sektionsLocalizedData.i18n["Empty sections with columns layout"],content_type:"section",expandAndFocusOnInit:!1,priority:10,icon:'<i class="fas fa-grip-vertical sek-level-option-icon"></i>'}});var i=_.keys(t)[0],r=t[i].settingControlId;return o.isUIControlAlreadyRegistered(r)?s.control(r,function(t){t.focus({completeCallback:function(){var e=t.container;e.hasClass("button-see-me")||(e.addClass("button-see-me"),_.delay(function(){e.removeClass("button-see-me")},800))}}),s.section(t.section()).container.first().trigger("sek-content-type-refreshed",{content_type:n.content_type})}):(_do_register_=function(){_.each(t,function(i,e){s.has(i.settingControlId)||(s(i.settingControlId,function(e){e.bind(function(e,t){s.errare("generateUIforDraggableContent => the setting() should not changed")})}),s.CZR_Helpers.register({origin:"nimble",level:n.level,what:"setting",id:i.settingControlId,dirty:!1,value:i.settingValue||{},transport:"postMessage",type:"_nimble_ui_"})),s.CZR_Helpers.register({origin:"nimble",level:n.level,what:"control",id:i.settingControlId,label:i.controlLabel,type:"czr_module",module_type:i.module_type,section:"__content_picker__",priority:i.priority||10,settings:{default:i.settingControlId},track:!1}).done(function(){s.control(i.settingControlId,function(e){e.content_type=i.content_type,!0===n.focus&&e.focus({completeCallback:function(){}});var t=e.container.find("label > .customize-control-title");_.isUndefined(i.icon)||t.addClass("sek-flex-vertical-center").prepend(i.icon),"section"===e.content_type?(e.container.find(".czr-items-wrapper").hide(),t.prepend('<span class="sek-animated-arrow" data-name="icon-chevron-down"><span class="fa fa-chevron-down"></span></span>'),e.container.attr("data-sek-expanded","false"),!0===i.expandAndFocusOnInit&&"false"==e.container.attr("data-sek-expanded")&&t.trigger("click")):e.container.attr("data-sek-accordion","no")})})})},s.CZR_Helpers.register({origin:"nimble",what:"section",id:"__content_picker__",title:sektionsLocalizedData.i18n["Content Picker"],panel:sektionsLocalizedData.sektionsPanelId,priority:30,track:!1,constructWith:s.Section.extend({isContextuallyActive:function(){return this.active()},_toggleActive:function(){return!0}})}).done(function(){s.section("__content_picker__",function(e){_do_register_();var t=e.container.find(".accordion-section-title"),i=e.container.find(".customize-section-title h3");0<t.length&&t.find(".sek-level-option-icon").length<1&&t.prepend('<i class="fas fa-grip-vertical sek-level-option-icon"></i>'),0<i.length&&i.find(".sek-level-option-icon").length<1&&i.find(".customize-action").after('<i class="fas fa-grip-vertical sek-level-option-icon"></i>'),o.scheduleModuleAccordion.call(e,{expand_first_module:!0})})})),e}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(d,u){u.extend(CZRSeksPrototype,{generateUIforFrontModules:function(o,e){var r=this;_.isEmpty(o.id)&&e.reject("generateUI => missing id");var t=r.getLevelProperty({property:"value",id:o.id}),i=r.getLevelProperty({property:"module_type",id:o.id}),n=r.getRegisteredModuleProperty(i,"name");_.isEmpty(i)&&e.reject("generateUI => module => invalid module_type");var s={};if(!0===r.getRegisteredModuleProperty(i,"is_father")){var a=r.getRegisteredModuleProperty(i,"children");if(_.isEmpty(a))throw new Error("::generateUIforFrontModules => a father module "+i+" is missing children modules ");_.each(a,function(e,t){s[t]={settingControlId:o.id+"__"+t,module_type:e,controlLabel:r.getRegisteredModuleProperty(e,"name")}})}else s.__no_option_group_to_be_updated_by_children_modules__={settingControlId:o.id,module_type:i,controlLabel:n};var c=_.keys(s)[0],l=s[c].settingControlId;return r.isUIControlAlreadyRegistered(l)?d.control(l).focus({completeCallback:function(){var e=d.control(l).container;e.hasClass("button-see-me")||(e.addClass("button-see-me"),_.delay(function(){e.removeClass("button-see-me")},800))}}):(r.cleanRegistered(),_do_register_=function(){_.each(s,function(i,n){if(!d.has(i.settingControlId)){d(i.settingControlId,function(e){e.bind(_.debounce(function(e,t,i){try{r.updateAPISettingAndExecutePreviewActions({defaultPreviewAction:"refresh_markup",uiParams:_.extend(o,{action:"sek-set-module-value"}),options_type:n,settingParams:{to:e,from:t,args:i}})}catch(e){d.errare("Error in updateAPISettingAndExecutePreviewActions",e)}},r.SETTING_UPDATE_BUFFER))});var e=u.extend(!0,{},t);"__no_option_group_to_be_updated_by_children_modules__"!==n&&(e=!_.isEmpty(e)&&_.isObject(e)&&_.isObject(e[n])?e[n]:{}),d.CZR_Helpers.register({origin:"nimble",level:o.level,what:"setting",id:i.settingControlId,dirty:!1,value:e,transport:"postMessage",type:"_nimble_ui_"})}d.CZR_Helpers.register({origin:"nimble",level:o.level,what:"control",id:i.settingControlId,label:i.controlLabel,type:"czr_module",module_type:i.module_type,section:o.id,priority:10,settings:{default:i.settingControlId}}).done(function(){d.control(i.settingControlId).focus({completeCallback:function(){}}),d.control(i.settingControlId,function(e){e.container.find(".czr-items-wrapper").hide();var t=e.container.find("label > .customize-control-title");_.isUndefined(i.icon)||t.addClass("sek-flex-vertical-center").prepend(i.icon),t.prepend('<span class="sek-animated-arrow" data-name="icon-chevron-down"><span class="fa fa-chevron-down"></span></span>'),e.container.attr("data-sek-expanded","false")})})})},d.section.when(o.id,function(){d.section(o.id).focus(),_do_register_()}),d.CZR_Helpers.register({origin:"nimble",what:"section",id:o.id,title:sektionsLocalizedData.i18n["Content for"]+" "+n,panel:sektionsLocalizedData.sektionsPanelId,priority:1e3}).done(function(){d.section(o.id,function(e){e.container.find(".accordion-section-title").first().hide();var t=e.container.find(".customize-section-title h3");0<t.length&&t.find(".customize-action").after('<i class="fas fa-pencil-alt sek-level-option-icon"></i>'),r.scheduleModuleAccordion.call(e)})})),e}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(c,l){l.extend(CZRSeksPrototype,{generateUIforLevelOptions:function(r,e){var s=this,a=s.getLevelProperty({property:"options",id:r.id});a=_.isObject(a)?a:{};var t={};l.extend(t,{bg:{settingControlId:r.id+"__bg_options",module_type:"sek_level_bg_module",controlLabel:sektionsLocalizedData.i18n["Background settings for the"]+" "+sektionsLocalizedData.i18n[r.level],expandAndFocusOnInit:!0,icon:'<i class="material-icons sek-level-option-icon">gradient</i>'},border:{settingControlId:r.id+"__border_options",module_type:"sek_level_border_module",controlLabel:sektionsLocalizedData.i18n["Borders settings for the"]+" "+sektionsLocalizedData.i18n[r.level],icon:'<i class="material-icons sek-level-option-icon">rounded_corner</i>'},spacing:{settingControlId:r.id+"__spacing_options",module_type:"sek_level_spacing_module",controlLabel:sektionsLocalizedData.i18n["Padding and margin settings for the"]+" "+sektionsLocalizedData.i18n[r.level],icon:'<i class="material-icons sek-level-option-icon">center_focus_weak</i>'},anchor:{settingControlId:r.id+"__anchor_options",module_type:"sek_level_anchor_module",controlLabel:sektionsLocalizedData.i18n["Set a custom anchor for the"]+" "+sektionsLocalizedData.i18n[r.level],icon:'<i class="fas fa-anchor sek-level-option-icon"></i>'},visibility:{settingControlId:r.id+"__visibility_options",module_type:"sek_level_visibility_module",controlLabel:sektionsLocalizedData.i18n["Device visibility settings for the"]+" "+sektionsLocalizedData.i18n[r.level],icon:'<i class="far fa-eye sek-level-option-icon"></i>'},height:{settingControlId:r.id+"__height_options",module_type:"sek_level_height_module",controlLabel:sektionsLocalizedData.i18n["Height settings for the"]+" "+sektionsLocalizedData.i18n[r.level],icon:'<i class="fas fa-ruler-vertical sek-level-option-icon"></i>'}}),"section"===r.level&&(l.extend(t,{width:{settingControlId:r.id+"__width_options",module_type:"sek_level_width_section",controlLabel:sektionsLocalizedData.i18n["Width settings for the"]+" "+sektionsLocalizedData.i18n[r.level],icon:'<i class="fas fa-ruler-horizontal sek-level-option-icon"></i>'}}),l.extend(t,{breakpoint:{settingControlId:r.id+"__breakpoint_options",module_type:"sek_level_breakpoint_module",controlLabel:sektionsLocalizedData.i18n["Responsive settings : breakpoint, column direction"],icon:'<i class="material-icons sek-level-option-icon">devices</i>'}})),"module"===r.level&&l.extend(t,{width:{settingControlId:r.id+"__width_options",module_type:"sek_level_width_module",controlLabel:sektionsLocalizedData.i18n["Width settings for the"]+" "+sektionsLocalizedData.i18n[r.level],icon:'<i class="fas fa-ruler-horizontal sek-level-option-icon"></i>'}});var i=_.keys(t)[0],n=t[i].settingControlId;return s.isUIControlAlreadyRegistered(n)?c.control(n).focus({completeCallback:function(){var e=c.control(n).container;e.hasClass("button-see-me")||(e.addClass("button-see-me"),_.delay(function(){e.removeClass("button-see-me")},800))}}):(s.cleanRegistered(),_do_register_=function(){_.each(t,function(i,n){if(s.isUIControlAlreadyRegistered(i.settingControlId))c.section(c.control(i.settingControlId).section()).expanded(!0);else{if(!c.has(i.settingControlId)){c(i.settingControlId,function(e){e.bind(_.debounce(function(e,t,i){try{s.updateAPISettingAndExecutePreviewActions({defaultPreviewAction:"refresh_stylesheet",uiParams:r,options_type:n,settingParams:{to:e,from:t,args:i}})}catch(e){c.errare("Error in updateAPISettingAndExecutePreviewActions",e)}},s.SETTING_UPDATE_BUFFER))});var e=a[n]||{},t=s.getModuleStartingValue(i.module_type);if("no_starting_value"!==t&&_.isObject(t)){var o=l.extend(!0,{},t);e=l.extend(o,e)}c.CZR_Helpers.register({origin:"nimble",level:r.level,what:"setting",id:i.settingControlId,dirty:!1,value:e,transport:"postMessage",type:"_nimble_ui_"})}c.CZR_Helpers.register({origin:"nimble",level:r.level,level_id:r.id,what:"control",id:i.settingControlId,label:i.controlLabel,type:"czr_module",module_type:i.module_type,section:r.id,priority:0,settings:{default:i.settingControlId}}).done(function(){!0===i.expandAndFocusOnInit&&c.control(i.settingControlId).focus({completeCallback:function(){}}),c.control(i.settingControlId,function(e){e.container.find(".czr-items-wrapper").hide();var t=e.container.find("label > .customize-control-title");_.isUndefined(i.icon)||t.addClass("sek-flex-vertical-center").prepend(i.icon),t.prepend('<span class="sek-animated-arrow" data-name="icon-chevron-down"><span class="fa fa-chevron-down"></span></span>'),e.container.attr("data-sek-expanded","false"),!0===i.expandAndFocusOnInit&&"false"==e.container.attr("data-sek-expanded")&&t.trigger("click")})})}})},c.section.has(r.id)||c.section(r.id,function(e){s.scheduleModuleAccordion.call(e,{expand_first_module:!0})}),c.CZR_Helpers.register({origin:"nimble",what:"section",id:r.id,title:sektionsLocalizedData.i18n["Settings for the"]+" "+r.level,panel:sektionsLocalizedData.sektionsPanelId,priority:10}).done(function(){c.section(r.id,function(e){_do_register_(),e.container.find(".accordion-section-title").first().hide();var t=e.container.find(".customize-section-title h3");0<t.length&&t.find(".sek-level-option-icon").length<1&&t.find(".customize-action").after('<i class="fas fa-sliders-h sek-level-option-icon"></i>')})})),e}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(l,d){d.extend(CZRSeksPrototype,{getLocalSkopeOptionId:function(){var e=l.czr_skopeBase.getSkopeProperty("skope_id");return _.isEmpty(e)?(l.errare("czr_sektions::getLocalSkopeOptionId => empty skope_id "),""):sektionsLocalizedData.optPrefixForSektionsNotSaved+e+"__localSkopeOptions"},generateUIforLocalSkopeOptions:function(a,e){var c=this,t=c.getLocalSkopeOptionId();if(c.isUIControlAlreadyRegistered(t))return e;var i={};return d.extend(i,{template:{settingControlId:t+"__template",module_type:"sek_local_template",controlLabel:sektionsLocalizedData.i18n["Page template"],expandAndFocusOnInit:!0,icon:'<i class="material-icons sek-level-option-icon">check_box_outline_blank</i>'},widths:{settingControlId:t+"__widths",module_type:"sek_local_widths",controlLabel:sektionsLocalizedData.i18n["Inner and outer widths"],icon:'<i class="fas fa-ruler-horizontal sek-level-option-icon"></i>'},custom_css:{settingControlId:t+"__custom_css",module_type:"sek_local_custom_css",controlLabel:sektionsLocalizedData.i18n["Custom CSS"],icon:'<i class="material-icons sek-level-option-icon">code</i>'},local_reset:{settingControlId:t+"__local_reset",module_type:"sek_local_reset",controlLabel:sektionsLocalizedData.i18n["Remove the sections in this page"],icon:'<i class="material-icons sek-level-option-icon">cached</i>'}}),_do_register_=function(){_.each(i,function(i,n){if(!l.has(i.settingControlId)){l(i.settingControlId,function(e){e.bind(_.debounce(function(e,t,i){try{c.updateAPISettingAndExecutePreviewActions({defaultPreviewAction:"refresh",uiParams:a,options_type:n,settingParams:{to:e,from:t,args:i}})}catch(e){l.errare("Error in updateAPISettingAndExecutePreviewActions",e)}},c.SETTING_UPDATE_BUFFER))});var e=c.getModuleStartingValue(i.module_type),t=l(c.sekCollectionSettingId())(),o=d.extend(!0,{},_.isObject(t.local_options)?t.local_options:{}),r=_.isObject(o[n])?o[n]:{};if("no_starting_value"!==e&&_.isObject(e)){var s=d.extend(!0,{},e);r=d.extend(s,r)}l.CZR_Helpers.register({origin:"nimble",level:a.level,what:"setting",id:i.settingControlId,dirty:!1,value:r,transport:"postMessage",type:"_nimble_ui_"})}l.CZR_Helpers.register({origin:"nimble",level:a.level,what:"control",id:i.settingControlId,label:i.controlLabel,type:"czr_module",module_type:i.module_type,section:"__localOptionsSection",priority:10,settings:{default:i.settingControlId}}).done(function(){l.control(i.settingControlId,function(e){e.container.find(".czr-items-wrapper").hide();var t=e.container.find("label > .customize-control-title");_.isUndefined(i.icon)||t.addClass("sek-flex-vertical-center").prepend(i.icon),t.prepend('<span class="sek-animated-arrow" data-name="icon-chevron-down"><span class="fa fa-chevron-down"></span></span>'),e.container.attr("data-sek-expanded","false"),!0===i.expandAndFocusOnInit&&"false"==e.container.attr("data-sek-expanded")&&t.trigger("click")})})})},l.section("__localOptionsSection",function(e){l(c.sekCollectionSettingId(),function(){_do_register_(),e.container.on("click",".accordion-section-title",function(){c.generateUI({action:"sek-generate-local-skope-options-ui"})})})}),e}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(c,l){l.extend(CZRSeksPrototype,{generateUIforGlobalOptions:function(s,e){var a=this,t=sektionsLocalizedData.optPrefixForSektionsNotSaved+sektionsLocalizedData.optNameForGlobalOptions;if(a.isUIControlAlreadyRegistered(t))return e;var i={};return l.extend(i,{breakpoint:{settingControlId:t+"__breakpoint",module_type:"sek_global_breakpoint",controlLabel:sektionsLocalizedData.i18n["Site wide breakpoint for Nimble sections"],expandAndFocusOnInit:!0,icon:'<i class="material-icons sek-level-option-icon">devices</i>'},widths:{settingControlId:t+"__widths",module_type:"sek_global_widths",controlLabel:sektionsLocalizedData.i18n["Site wide inner and outer sections widths"],icon:'<i class="fas fa-ruler-horizontal sek-level-option-icon"></i>'}}),_do_register_=function(){_.each(i,function(i,n){if(!c.has(i.settingControlId)){c(i.settingControlId,function(e){e.bind(_.debounce(function(e,t,i){try{a.updateAPISettingAndExecutePreviewActions({isGlobalOptions:!0,defaultPreviewAction:"refresh",uiParams:s,options_type:n,settingParams:{to:e,from:t,args:i}})}catch(e){c.errare("Error in updateAPISettingAndExecutePreviewActions",e)}},a.SETTING_UPDATE_BUFFER))});var e=sektionsLocalizedData.globalOptionDBValues,t=a.getModuleStartingValue(i.module_type),o=_.isObject(e)&&!_.isEmpty(e[n])?e[n]:{};if("no_starting_value"!==t&&_.isObject(t)){var r=l.extend(!0,{},t);o=l.extend(r,o)}c.CZR_Helpers.register({origin:"nimble",level:s.level,what:"setting",id:i.settingControlId,dirty:!1,value:o,transport:"postMessage",type:"_nimble_ui_"})}c.CZR_Helpers.register({origin:"nimble",level:s.level,what:"control",id:i.settingControlId,label:i.controlLabel,type:"czr_module",module_type:i.module_type,section:"__globalAndLocalOptionsSection",priority:20,settings:{default:i.settingControlId},track:!1}).done(function(){c.control(i.settingControlId,function(e){e.container.find(".czr-items-wrapper").hide();var t=e.container.find("label > .customize-control-title");_.isUndefined(i.icon)||t.addClass("sek-flex-vertical-center").prepend(i.icon),t.prepend('<span class="sek-animated-arrow" data-name="icon-chevron-down"><span class="fa fa-chevron-down"></span></span>'),e.container.attr("data-sek-expanded","false"),!0===i.expandAndFocusOnInit&&"false"==e.container.attr("data-sek-expanded")&&t.trigger("click")})})})},c.section("__globalAndLocalOptionsSection",function(e){c(a.sekCollectionSettingId(),function(){_do_register_()})}),e}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(Y,J){J.extend(CZRSeksPrototype,{updateAPISetting:function($){var q=this,G=J.Deferred();return Y(q.sekCollectionSettingId(),function(e){var n,t,o,i,r,s,a,c,l=e(),d=_.isObject(l)?J.extend(!0,{},l):q.defaultSektionSettingValue,u=!1;switch(d.collection=_.isArray(d.collection)?d.collection:q.defaultSektionSettingValue.collection,$.action){case"sek-add-section":if(_.isEmpty($.id))throw new Error("updateAPISetting => "+$.action+" => missing id");if(_.isEmpty($.location))throw new Error("updateAPISetting => "+$.action+" => missing location");if(!0===$.is_nested){if(o=q.getLevelModel($.in_column,d.collection),"no_match"==(Q=q.getLevelModel($.in_sektion,d.collection))){G.reject("updateAPISetting => "+$.action+" => no grand parent sektion found");break}if(!0===Q.is_nested){G.reject(sektionsLocalizedData.i18n["You've reached the maximum number of allowed nested sections."]);break}if("no_match"==o){Y.errare("updateAPISetting => "+$.action+" => no parent column matched"),G.reject("updateAPISetting => "+$.action+" => no parent column matched");break}o.collection=_.isArray(o.collection)?o.collection:[],o.collection.push({id:$.id,level:"section",collection:[{id:sektionsLocalizedData.optPrefixForSektionsNotSaved+q.guid(),level:"column",collection:[],ver_ini:sektionsLocalizedData.nimbleVersion}],is_nested:!0,ver_ini:sektionsLocalizedData.nimbleVersion})}else{if("no_match"==(n=q.getLevelModel($.location,d.collection))){Y.errare("updateAPISetting => "+$.action+" => no location matched"),G.reject("updateAPISetting => "+$.action+" => no location matched");break}n.collection=_.isArray(n.collection)?n.collection:[],_.each(n.collection,function(e,t){$.before_section===e.id&&(x=t),$.after_section===e.id&&(x=t+1)}),n.collection=_.isArray(n.collection)?n.collection:[],n.collection.splice(x,0,{id:$.id,level:"section",collection:[{id:sektionsLocalizedData.optPrefixForSektionsNotSaved+q.guid(),level:"column",collection:[],ver_ini:sektionsLocalizedData.nimbleVersion}],ver_ini:sektionsLocalizedData.nimbleVersion})}break;case"sek-duplicate-section":if(_.isEmpty($.id))throw new Error("updateAPISetting => "+$.action+" => missing id");if(_.isEmpty($.location))throw new Error("updateAPISetting => "+$.action+" => missing location");var p;try{p=q.cloneLevel($.id)}catch(e){Y.errare("updateAPISetting => "+$.action,e);break}var m=q.getLevelPositionInCollection($.id,d.collection);if(!0===$.is_nested){if("no_match"==(o=q.getLevelModel($.in_column,d.collection))){Y.errare("updateAPISetting => "+$.action+" => no parent column matched"),G.reject("updateAPISetting => "+$.action+" => no parent column matched");break}o.collection=_.isArray(o.collection)?o.collection:[],o.collection.splice(parseInt(m+1,10),0,p)}else{if("no_match"==(n=q.getLevelModel($.location,d.collection))){Y.errare("updateAPISetting => "+$.action+" => no location matched"),G.reject("updateAPISetting => "+$.action+" => no location matched");break}n.collection=_.isArray(n.collection)?n.collection:[],n.collection.splice(parseInt(m+1,10),0,p)}a=p.id;break;case"sek-remove-section":if(!0===$.is_nested)"no_match"!=(o=q.getLevelModel($.in_column,d.collection))?(o.collection=_.isArray(o.collection)?o.collection:[],o.collection=_.filter(o.collection,function(e){return e.id!=$.id})):Y.errare("updateAPISetting => "+$.action+" => no parent column matched");else{if("no_match"==(n=q.getLevelModel($.location,d.collection))){Y.errare("updateAPISetting => "+$.action+" => no location matched"),G.reject("updateAPISetting => "+$.action+" => no location matched");break}n.collection=_.filter(n.collection,function(e){return e.id!=$.id})}break;case"sek-move-section":var f,h,g=q.getLevelModel($.to_location,d.collection);if(_.isEmpty(g)||"no_match"==g)throw new Error("updateAPISetting => "+$.action+" => missing target location");if($.from_location!=$.to_location){var k=q.getLevelModel($.from_location,d.collection);if(_.isEmpty(k)||"no_match"==k)throw new Error("updateAPISetting => "+$.action+" => missing source location");k.collection=_.isArray(k.collection)?k.collection:[],f=q.getLevelModel($.id,k.collection),h=J.extend(!0,{},f),k.collection=_.filter(k.collection,function(e){return e.id!=$.id})}g.collection=_.isArray(g.collection)?g.collection:[],r=J.extend(!0,[],g.collection),s=[],_.each($.newOrder,function(e){if($.from_location!=$.to_location&&e==h.id)s.push(h);else{if(t=q.getLevelModel(e,r),_.isEmpty(t)||"no_match"==t)throw new Error("updateAPISetting => move section => missing section candidate");s.push(t)}}),g.collection=s;break;case"sek-add-column":if(_.isEmpty($.id))throw new Error("updateAPISetting => "+$.action+" => missing id");if("no_match"==(t=q.getLevelModel($.in_sektion,d.collection))){Y.errare("updateAPISetting => "+$.action+" => no parent sektion matched"),G.reject("updateAPISetting => "+$.action+" => no parent sektion matched");break}if(t.collection=_.isArray(t.collection)?t.collection:[],q.MAX_NUMBER_OF_COLUMNS-1<_.size(t.collection)){G.reject(sektionsLocalizedData.i18n["You've reached the maximum number of columns allowed in this section."]);break}_.each(t.collection,function(e){e.width=""}),t.collection.push({id:$.id,level:"column",collection:[],ver_ini:sektionsLocalizedData.nimbleVersion});break;case"sek-remove-column":if("no_match"!=(t=q.getLevelModel($.in_sektion,d.collection))){if(1===_.size(t.collection)){G.reject(sektionsLocalizedData.i18n["A section must have at least one column."]);break}t.collection=_.isArray(t.collection)?t.collection:[],t.collection=_.filter(t.collection,function(e){return e.id!=$.id}),_.each(t.collection,function(e){e.width=""})}else Y.errare("updateAPISetting => "+$.action+" => no parent sektion matched");break;case"sek-duplicate-column":if(_.isEmpty($.id))throw new Error("updateAPISetting => "+$.action+" => missing id");if("no_match"==(t=q.getLevelModel($.in_sektion,d.collection))){Y.errare("updateAPISetting => "+$.action+" => no parent sektion matched"),G.reject("updateAPISetting => "+$.action+" => no parent sektion matched");break}if(t.collection=_.isArray(t.collection)?t.collection:[],q.MAX_NUMBER_OF_COLUMNS-1<_.size(t.collection)){G.reject(sektionsLocalizedData.i18n["You've reached the maximum number of columns allowed in this section."]);break}var y;try{y=q.cloneLevel($.id)}catch(e){Y.errare("updateAPISetting => "+$.action,e);break}var v=q.getLevelPositionInCollection($.id,d.collection);a=y.id,t.collection.splice(parseInt(v+1,10),0,y),_.each(t.collection,function(e){e.width=""});break;case"sek-resize-columns":if($.col_number<2)break;var b=q.getLevelModel($.resized_column,d.collection),z=q.getLevelModel($.sister_column,d.collection);if("no_match"==b){Y.errare("updateAPISetting => "+$.action+" => no resized column matched"),G.reject("updateAPISetting => "+$.action+" => no resized column matched");break}b.width=parseFloat($.resizedColumnWidthInPercent);var I=q.getLevelModel($.in_sektion,d.collection),w=_.filter(I.collection,function(e){return e.id!=b.id&&e.id!=z.id}),M=parseFloat(b.width.toFixed(3));_.isEmpty(w)||_.each(w,function(e){currentColWidth=parseFloat(1*e.width),(!_.has(e,"width")||!_.isNumber(1*currentColWidth)||_.isEmpty(currentColWidth+"")||currentColWidth<1)&&(e.width=parseFloat((100/$.col_number).toFixed(3))),M=parseFloat((M+e.width).toFixed(3))}),z.width=parseFloat((100-M).toFixed(3));break;case"sek-move-column":var C,D,S=q.getLevelModel($.to_sektion,d.collection);if(_.isEmpty(S)||"no_match"==S)throw new Error("updateAPISetting => "+$.action+" => missing target sektion");if($.from_sektion!=$.to_sektion){var P=q.getLevelModel($.from_sektion,d.collection);if(_.isEmpty(P)||"no_match"==P)throw new Error("updateAPISetting => "+$.action+" => missing source column");P.collection=_.isArray(P.collection)?P.collection:[],C=q.getLevelModel($.id,P.collection),D=J.extend(!0,{},C),P.collection=_.filter(P.collection,function(e){return e.id!=$.id}),_.each(P.collection,function(e){e.width=""})}S.collection=_.isArray(S.collection)?S.collection:[],r=J.extend(!0,[],S.collection),s=[],_.each($.newOrder,function(e){if($.from_sektion!=$.to_sektion&&e==D.id)s.push(D);else{if(o=q.getLevelModel(e,r),_.isEmpty(o)||"no_match"==o)throw new Error("updateAPISetting => moveColumn => missing columnCandidate");s.push(o)}}),S.collection=s,_.each(S.collection,function(e){e.width=""});break;case"sek-add-module":if(_.isEmpty($.id))throw new Error("updateAPISetting => "+$.action+" => missing id");if(_.isEmpty($.module_type))throw new Error("updateAPISetting => "+$.action+" => missing module_type");if("no_match"===(o=q.getLevelModel($.in_column,d.collection))){Y.errare("updateAPISetting => "+$.action+" => no parent column matched"),G.reject("updateAPISetting => "+$.action+" => no parent column matched");break}var x=0;o.collection=_.isArray(o.collection)?o.collection:[],_.each(o.collection,function(e,t){$.before_module===e.id&&(x=t),$.after_module===e.id&&(x=t+1)});var E={id:$.id,level:"module",module_type:$.module_type,ver_ini:sektionsLocalizedData.nimbleVersion};"no_starting_value"!==(c=q.getModuleStartingValue($.module_type))&&(E.value=c),o.collection.splice(x,0,E);break;case"sek-duplicate-module":if(_.isEmpty($.id))throw new Error("updateAPISetting => "+$.action+" => missing id");if("no_match"==(o=q.getLevelModel($.in_column,d.collection))){Y.errare("updateAPISetting => "+$.action+" => no parent column matched"),G.reject("updateAPISetting => "+$.action+" => no parent column matched");break}var R;o.collection=_.isArray(o.collection)?o.collection:[];try{R=q.cloneLevel($.id)}catch(e){Y.errare("updateAPISetting => "+$.action,e),G.reject("updateAPISetting => "+$.action+" => error when cloning the level");break}var L=q.getLevelPositionInCollection($.id,d.collection);a=R.id,o.collection.splice(parseInt(L+1,10),0,R);break;case"sek-remove-module":if(_.isEmpty($.id))throw new Error("updateAPISetting => "+$.action+" => missing id");"no_match"!=(o=q.getLevelModel($.in_column,d.collection))?(o.collection=_.isArray(o.collection)?o.collection:[],o.collection=_.filter(o.collection,function(e){return e.id!=$.id})):Y.errare("updateAPISetting => "+$.action+" => no parent column matched");break;case"sek-move-module":var A,Z,j;if(A=q.getLevelModel($.to_column,d.collection),_.isEmpty(A)||"no_match"==A)throw new Error("updateAPISetting => "+$.action+" => missing target column");if($.from_column!=$.to_column){var T;if(T=q.getLevelModel($.from_column,d.collection),_.isEmpty(T)||"no_match"==T)throw new Error("updateAPISetting => "+$.action+" => missing source column");T.collection=_.isArray(T.collection)?T.collection:[],Z=q.getLevelModel($.id,d.collection),j=J.extend(!0,{},Z),T.collection=_.filter(T.collection,function(e){return e.id!=$.id})}if(A.collection=_.isArray(A.collection)?A.collection:[],r=J.extend(!0,[],A.collection),s=[],_.each($.newOrder,function(e){if($.from_column!=$.to_column&&e==j.id)s.push(j);else{if(i=q.getLevelModel(e,d.collection),_.isEmpty(i)||"no_match"==i)throw new Error("updateAPISetting => "+$.action+" => missing moduleCandidate");s.push(i)}}),s.length!=_.uniq(s).length)throw new Error("updateAPISetting => "+$.action+" => there are duplicated modules in column : "+A.id);A.collection=s;break;case"sek-set-module-value":i=q.getLevelModel($.id,d.collection);var V={};if(_.each($.value||{},function(e,t){!_.isBoolean(e)&&_.isEmpty(e+"")||(V[t]=e)}),"no_match"==i){Y.errare("updateAPISetting => "+$.action+" => no module matched",$),G.reject("updateAPISetting => "+$.action+" => error no module matched");break}if(_.isEmpty($.options_type)){Y.errare("updateAPISetting => "+$.action+" => missing options_type"),G.reject("updateAPISetting => "+$.action+" => missing options_type");break}"__no_option_group_to_be_updated_by_children_modules__"===$.options_type?i.value=V:(i.value=_.isEmpty(i.value)?{}:i.value,i.value[$.options_type]=V);break;case"sek-generate-level-options-ui":var O=q.getLevelModel($.id,d.collection),F={};if("no_match"===O){Y.errare("updateAPISetting => "+$.action+" => no parent sektion matched"),G.reject("updateAPISetting => "+$.action+" => no parent sektion matched");break}O.options=O.options||{},_.each($.value||{},function(e,t){!_.isBoolean(e)&&_.isEmpty(e+"")||(F[t]=e)}),_.isEmpty($.options_type)&&Y.errare("updateAPISetting => "+$.action+" => missing options_type"),O.options[$.options_type]=F;break;case"sek-generate-local-skope-options-ui":F={};var U=J.extend(!0,{},_.isObject(d.local_options)?d.local_options:{});if(_.each($.value||{},function(e,t){!_.isBoolean(e)&&_.isEmpty(e+"")||(F[t]=e)}),_.isEmpty($.options_type)||!_.isString($.options_type))Y.errare("updateAPISetting => "+$.action+" => missing options_type");else{var N={};N[$.options_type]=F,d.local_options=J.extend(U,N)}break;case"sek-add-content-in-new-sektion":if(_.isEmpty($.id))throw new Error("updateAPISetting => "+$.action+" => missing id");if(x=0,"no_match"==(n=q.getLevelModel($.location,d.collection))){Y.errare("updateAPISetting => "+$.action+" => no location matched"),G.reject("updateAPISetting => "+$.action+" => no location matched");break}switch(n.collection=_.isArray(n.collection)?n.collection:[],_.each(n.collection,function(e,t){$.before_section===e.id&&(x=t),$.after_section===e.id&&(x=t+1)}),$.content_type){case"module":c=q.getModuleStartingValue($.content_id),n.collection.splice(x,0,{id:$.id,level:"section",collection:[{id:sektionsLocalizedData.optPrefixForSektionsNotSaved+q.guid(),level:"column",collection:[{id:$.droppedModuleId,level:"module",module_type:$.content_id,value:"no_starting_value"!==c?c:null}]}],ver_ini:sektionsLocalizedData.nimbleVersion});break;case"preset_section":u=J.Deferred();var B=function(e){q.preparePresetSectionForInjection(e).fail(function(e){G.reject("updateAPISetting => error when preparePresetSectionForInjection => "+$.action+" => "+e),u.reject(e)}).done(function(e){var t=!1;if(!_.isEmpty($.sektion_to_replace)){var i=q.getLevelModel($.sektion_to_replace,d.collection);"no_match"===i&&(Y.errare("updateAPISetting => "+$.action+" => no sektionToReplace matched"),G.reject("updateAPISetting => "+$.action+" => no sektionToReplace matched")),t=!0===i.is_nested}t?("no_match"===(o=q.getLevelModel($.in_column,d.collection))&&(Y.errare("updateAPISetting => "+$.action+" => no parent column matched"),G.reject("updateAPISetting => "+$.action+" => no parent column matched")),o.collection=_.isArray(o.collection)?o.collection:[],_.each(o.collection,function(e,t){$.before_section===e.id&&(x=t),$.after_section===e.id&&(x=t+1)}),o.collection.splice(x,0,{id:$.id,is_nested:!0,level:"section",collection:e.collection,options:e.options||{},ver_ini:sektionsLocalizedData.nimbleVersion})):n.collection.splice(x,0,{id:$.id,level:"section",collection:e.collection,options:e.options||{},ver_ini:sektionsLocalizedData.nimbleVersion}),u.resolve()})};q.getPresetSectionCollection({presetSectionType:$.content_id,section_id:$.id}).fail(function(){Y.errare("updateAPISetting => "+$.action+" => Error with self.getPresetSectionCollection()",_er_),G.reject("updateAPISetting => "+$.action+" => Error with self.getPresetSectionCollection()")}).done(function(e){_.isObject(e)&&!_.isEmpty(e)||(Y.errare("updateAPISetting => "+$.action+" => preset section type not found or empty : "+$.content_id,e),G.reject("updateAPISetting => "+$.action+" => preset section type not found or empty")),B(e)})}break;case"sek-add-preset-section-in-new-nested-sektion":if(_.isEmpty($.id))throw new Error("updateAPISetting => "+$.action+" => missing id");var Q;if(o=q.getLevelModel($.in_column,d.collection),"no_match"==(Q=q.getLevelModel($.in_sektion,d.collection))){G.reject("updateAPISetting => "+$.action+" => no grand parent sektion found");break}if(!0===Q.is_nested){G.reject(sektionsLocalizedData.i18n["You've reached the maximum number of allowed nested sections."]);break}if("no_match"==o){Y.errare("updateAPISetting => "+$.action+" => no parent column matched"),G.reject("updateAPISetting => "+$.action+" => no parent column matched");break}o.collection=_.isArray(o.collection)?o.collection:[],u=J.Deferred(),B=function(e){q.preparePresetSectionForInjection(e).fail(function(e){G.reject("updateAPISetting => error when preparePresetSectionForInjection => "+$.action+" => "+e),u.reject(e)}).done(function(e){o.collection.push({id:$.id,level:"section",collection:e.collection,options:e.options||{},is_nested:!0,ver_ini:sektionsLocalizedData.nimbleVersion}),u.resolve()})},q.getPresetSectionCollection({presetSectionType:$.content_id,section_id:$.id}).fail(function(){Y.errare("updateAPISetting => "+$.action+" => Error with self.getPresetSectionCollection()",_er_),G.reject("updateAPISetting => "+$.action+" => Error with self.getPresetSectionCollection()")}).done(function(e){_.isObject(e)&&!_.isEmpty(e)||(Y.errare("updateAPISetting => "+$.action+" => preset section type not found or empty : "+$.content_id,e),G.reject("updateAPISetting => "+$.action+" => preset section type not found or empty")),B(e)});break;case"sek-update-fonts":var W=q.sniffGFonts();if(!_.isEmpty($.font_family)&&_.isString($.font_family)&&!_.contains(W,$.font_family)){if($.font_family.indexOf("gfont")<0){Y.errare("updateAPISetting => "+$.action+" => error => must be a google font, prefixed gfont"),G.reject("updateAPISetting => "+$.action+" => error => must be a google font, prefixed gfont");break}W.push($.font_family)}d.fonts=W}if("pending"==G.state()){var H=function(){_.isEqual(l,d)?G.reject("updateAPISetting => the new setting value is unchanged when firing action : "+$.action):null!==q.validateSettingValue(d)?(e(d,$),G.resolve(a)):G.reject("updateAPISetting => the new setting value did not pass the validation checks for action "+$.action)};!1===u?H():u.done(function(){H()}).fail(function(e){Y.errare("updateAPISetting => __presetSectionInjected__ failed",e)})}}),G.promise()},getPresetSectionCollection:function(r){var s=this,a=J.Deferred();return function(){var e,t=J.Deferred();_.isEmpty(Y.sek_presetSections)?(_.isUndefined(Y.sek_fetchingPresetSections)||"pending"!=Y.sek_fetchingPresetSections.state()?(e=Y.CZR_Helpers.getModuleTmpl({tmpl:"font_list",module_type:"preset_sections_server_collection",module_id:"no_module_id"}),Y.sek_fetchingPresetSections=e):e=Y.sek_fetchingPresetSections,e.done(function(e){Y.sek_presetSections=e,t.resolve(Y.sek_presetSections)}).fail(function(e){t.reject(e)})):t.resolve(Y.sek_presetSections);return t.promise()}().fail(function(e){a.reject(e)}).done(function(e){var t=J.extend(!0,{},_.isObject(e)?e:{});if(_.isEmpty(t))throw new Error("getPresetSectionCollection => Invalid collection");if(_.isEmpty(t[r.presetSectionType]))throw new Error('getPresetSectionCollection => the preset section : "'+r.presetSectionType+'" has not been found in the collection');var i=t[r.presetSectionType],n=function(e){return _.each(e,function(e){e.id=sektionsLocalizedData.optPrefixForSektionsNotSaved+s.guid(),_.isArray(e.collection)&&n(e.collection)}),e},o=function(e){return _.each(e,function(e){e.ver_ini=sektionsLocalizedData.nimbleVersion,_.isArray(e.collection)&&o(e.collection)}),e};i.id=r.section_id,i.collection=n(i.collection),i.ver_ini=sektionsLocalizedData.nimbleVersion,i.collection=o(i.collection),a.resolve(i)}),a.promise()},preparePresetSectionForInjection:function(o){var i=this,n={},r=J.Deferred(),s=function(e){return _.each(e,function(e,t){_.isObject(e)||_.isArray(e)?s(e):_.isString(e)&&-1!=e.indexOf("::img-path::")&&(_.has(n,e)||(n[e]=i.importAttachment(e.replace("::img-path::",""))))}),n},a=function(i,n){return _.each(i,function(e,t){_.isObject(e)||_.isArray(e)?a(e,n):_.isString(e)&&-1!=e.indexOf("::img-path::")&&_.has(n,e)&&(i[t]=n[e].id)}),o};return i.whenAllPromisesInParallel(s(o)).done(function(e){var t=a(o,e);r.resolve(t)}).fail(function(e){r.reject(e)}),r.promise()}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(n,o){o.extend(CZRSeksPrototype,{cleanRegistered:function(t){var i=this,e=o.extend(!0,[],i.registered()||[]);e=_.filter(e,function(e){if("setting"!==e.what&&n[e.what].has(e.id)){if(!_.isEmpty(t)&&e.id!==t)return;_.isFunction(n[e.what](e.id).trigger)&&i.trigger("sek-ui-pre-removal",{what:e.what,id:e.id}),o.when(n[e.what](e.id).container.remove()).done(function(){n[e.what].remove(e.id),i.trigger("sek-ui-removed",{what:e.what,id:e.id})})}return"setting"===e.what}),i.registered(e)},cleanRegisteredLevelSettingsAfterHistoryNavigation:function(){var e=o.extend(!0,[],this.registered()||[]);e=_.filter(e,function(e){return _.isEmpty(e.level)||"setting"!==e.what||n.has(e.id)&&n.remove(e.id),_.isEmpty(e.level)&&"setting"!==e.what}),this.registered(e)}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(s,a){a.extend(CZRSeksPrototype,{rootPanelFocus:function(){s.section.has(s.czr_activeSectionId())?s.section(s.czr_activeSectionId()).expanded(!1):s.section.each(function(e){e.expanded(!1)}),s.panel.each(function(e){e.expanded(!1)})},guid:function(){function e(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return e()+e()+e()},getLevelModel:function(t,e){var i=this,n="no_match";if(_.isUndefined(e)){var o=s(i.sekCollectionSettingId())(),r=_.isObject(o)?a.extend(!0,{},o):i.defaultSektionSettingValue;e=_.isArray(r.collection)?r.collection:[]}return _.each(e,function(e){"no_match"==n&&(t===e.id?n=e:_.isArray(e.collection)&&(n=i.getLevelModel(t,e.collection)))}),n},getLevelPositionInCollection:function(i,e){var n=this,o="no_match";if(_.isUndefined(e)){var t=s(n.sekCollectionSettingId())(),r=_.isObject(t)?a.extend(!0,{},t):n.defaultSektionSettingValue;e=_.isArray(r.collection)?r.collection:[]}return _.each(e,function(e,t){"no_match"==o&&(i===e.id?o=t:_.isArray(e.collection)&&(o=n.getLevelPositionInCollection(i,e.collection)))}),o},getLevelProperty:function(e){if(e=_.extend({id:"",property:""},e),_.isEmpty(e.id))s.errare("getLevelProperty => invalid id provided");else{var t=this.getLevelModel(e.id);if("no_match"!=t){if(_.isObject(t))return t[e.property];s.errare("getLevelProperty => invalid model for id : "+e.id,t)}else s.errare("getLevelProperty => no level model found for id : "+e.id)}},cloneLevel:function(e){var t=this,i=t.getLevelModel(e);if("no_match"==i)throw new Error("cloneLevel => no match for level id : "+e);var n=a.extend(!0,{},i),o=function(e){if(_.isEmpty(e.id))throw new Error("cloneLevel => missing level id");if(e.id=sektionsLocalizedData.optPrefixForSektionsNotSaved+t.guid(),!_.isEmpty(e.collection)){if(!_.isArray(e.collection))throw new Error("cloneLevel => the collection must be an array for level id : "+e.id);_.each(e.collection,function(e){e.id=sektionsLocalizedData.optPrefixForSektionsNotSaved+t.guid(),o(e)})}return e};return o(n)},getDefaultItemModelFromRegisteredModuleData:function(e){if(!this.isModuleRegistered(e))return{};if(!sektionsLocalizedData.registeredModules[e].is_father){var t=sektionsLocalizedData.registeredModules[e].tmpl["item-inputs"],i={id:"",title:""};return _.each(t,function(e,t){switch(t){case"tabs":_.each(e,function(e){_.each(e.inputs,function(e,t){i[t]=e.default||""})});break;default:i[t]=e.default||""}}),i}s.errare("getDefaultItemModelFromRegisteredModuleData => Father modules should be treated specifically")},getRegisteredModuleProperty:function(e,t){return this.isModuleRegistered(e)?sektionsLocalizedData.registeredModules[e][t]:"not_set"},isModuleRegistered:function(e){return sektionsLocalizedData.registeredModules&&!_.isUndefined(sektionsLocalizedData.registeredModules[e])},sniffGFonts:function(i,e){var n=this;if(i=i||[],_.isUndefined(e)){var t=s(n.sekCollectionSettingId())();e=_.isObject(t)?a.extend(!0,{},t):n.defaultSektionSettingValue}return _.each(e,function(e,t){_.isString(t)&&"_css"===t.substr(t.length-4)&&!0===n.inputIsAFontFamilyModifier(t)&&-1<e.indexOf("gfont")&&!_.contains(i,e)&&i.push(e),(_.isArray(e)||_.isObject(e))&&n.sniffGFonts(i,e)}),i},getInputDefaultValue:function(i,n,e){var o=this;if(o.cachedDefaultInputValues=o.cachedDefaultInputValues||{},o.cachedDefaultInputValues[n]=o.cachedDefaultInputValues[n]||{},_.has(o.cachedDefaultInputValues[n],i))return o.cachedDefaultInputValues[n][i];if(_.isUndefined(sektionsLocalizedData.registeredModules))s.errare("getInputDefaultValue => missing sektionsLocalizedData.registeredModules");else if(_.isUndefined(sektionsLocalizedData.registeredModules[n]))s.errare("getInputDefaultValue => missing "+n+" in sektionsLocalizedData.registeredModules");else{if(!sektionsLocalizedData.registeredModules[n].is_father){_.isUndefined(e)&&(e=sektionsLocalizedData.registeredModules[n].tmpl);var r="no_default_value_specified";return _.each(e,function(e,t){"no_default_value_specified"===r&&(i!==t||_.isUndefined(e.default)||(r=e.default),"no_default_value_specified"===r&&(_.isArray(e)||_.isObject(e))&&(r=o.getInputDefaultValue(i,n,e)),"no_default_value_specified"!==r&&(o.cachedDefaultInputValues[n][i]=r))}),r}s.errare("getInputDefaultValue => Father modules should be treated specifically")}},getInputType:function(i,n,e){var o=this;if(o.cachedInputTypes=o.cachedInputTypes||{},o.cachedInputTypes[n]=o.cachedInputTypes[n]||{},_.has(o.cachedInputTypes[n],i))return o.cachedInputTypes[n][i];if(_.isUndefined(sektionsLocalizedData.registeredModules))s.errare("getInputType => missing sektionsLocalizedData.registeredModules");else if(_.isUndefined(sektionsLocalizedData.registeredModules[n]))s.errare("getInputType => missing "+n+" in sektionsLocalizedData.registeredModules");else{if(!sektionsLocalizedData.registeredModules[n].is_father){_.isUndefined(e)&&(e=sektionsLocalizedData.registeredModules[n].tmpl);var r="no_input_type_specified";return _.each(e,function(e,t){"no_input_type_specified"===r&&(i!==t||_.isUndefined(e.input_type)||(r=e.input_type),"no_input_type_specified"===r&&(_.isArray(e)||_.isObject(e))&&(r=o.getInputType(i,n,e)),"no_input_type_specified"!==r&&(o.cachedInputTypes[n][i]=r))}),r}s.errare("getInputType => Father modules should be treated specifically")}},getInputRegistrationParams:function(i,n,e){var o=this;if(o.cachedInputRegistrationParams=o.cachedInputRegistrationParams||{},o.cachedInputRegistrationParams[n]=o.cachedInputRegistrationParams[n]||{},_.has(o.cachedInputRegistrationParams[n],i))return o.cachedInputRegistrationParams[n][i];if(_.isUndefined(sektionsLocalizedData.registeredModules))s.errare("getInputRegistrationParams => missing sektionsLocalizedData.registeredModules");else if(_.isUndefined(sektionsLocalizedData.registeredModules[n]))s.errare("getInputRegistrationParams => missing "+n+" in sektionsLocalizedData.registeredModules");else{if(!sektionsLocalizedData.registeredModules[n].is_father){_.isUndefined(e)&&(e=sektionsLocalizedData.registeredModules[n].tmpl);var r={};return _.each(e,function(e,t){_.isEmpty(r)&&(i!==t||_.isUndefined(e.input_type)||(r=e),_.isEmpty(r)&&(_.isArray(e)||_.isObject(e))&&(r=o.getInputRegistrationParams(i,n,e)),_.isEmpty(r)||(o.cachedInputRegistrationParams[n][i]=r))}),r}s.errare("getInputRegistrationParams => Father modules should be treated specifically")}},inputIsAFontFamilyModifier:function(i,e){var n=this;if(n.cachedFontFamilyModifier=n.cachedFontFamilyModifier||{},_.has(n.cachedFontFamilyModifier,i))return n.cachedFontFamilyModifier[i];if(!_.isUndefined(sektionsLocalizedData.registeredModules)){_.isUndefined(e)&&(e=sektionsLocalizedData.registeredModules);var o="not_set";return _.each(e,function(e,t){"not_set"===o&&(i!==t||_.isUndefined(e.input_type)||(o=!_.isUndefined(e.refresh_fonts)&&e.refresh_fonts),"not_set"===o&&(_.isArray(e)||_.isObject(e))&&(o=n.inputIsAFontFamilyModifier(i,e)),"not_set"!==o&&(n.cachedFontFamilyModifier[i]=o))}),o}s.errare("inputIsAFontFamilyModifier => missing sektionsLocalizedData.registeredModules")},getModuleStartingValue:function(e){if(!sektionsLocalizedData.registeredModules)return s.errare("getModuleStartingValue => missing sektionsLocalizedData.registeredModules"),"no_starting_value";if(_.isUndefined(sektionsLocalizedData.registeredModules[e]))return s.errare("getModuleStartingValue => the module type "+e+" is not registered"),"no_starting_value";var t=sektionsLocalizedData.registeredModules[e].starting_value;return _.isEmpty(t)?"no_starting_value":t},selectNextTabbableOrFocusable:function(e){var t=a(e),i=a(":focus"),n=0;if(1===i.length){var o=t.index(i);o+1<t.length&&(n=o+1)}t.eq(n).focus()},selectPrevTabbableOrFocusable:function(e){var t=a(e),i=a(":focus"),n=t.length-1;if(1===i.length){var o=t.index(i);0<o&&(n=o-1)}t.eq(n).focus()},setupSelectInput:function(){var n=this,e=(n.input_parent,n.module,s.czr_sektions.getInputRegistrationParams(n.id,n.module.module_type).choices);_.isEmpty(e)?s.errare("api.czr_sektions.setupSelectInput => missing select options for input id => "+n.id+" in image module"):(_.each(e,function(e,t){var i={value:t,html:e};t==n()?a.extend(i,{selected:"selected"}):"px"===t&&a.extend(i,{selected:"selected"}),a("select[data-czrtype]",n.container).append(a("<option>",i))}),a("select[data-czrtype]",n.container).selecter())},setupFontSizeAndLineHeightInputs:function(e){var t=this,i=a(".sek-font-size-line-height-wrapper",t.container),n=i.find("input[data-czrtype]").data("sek-unit"),o=function(e){return _.contains(["px","em","%"],e)||(s.errare("error : invalid unit for input "+t.id,e),e="px"),e};t.css_unit=new s.Value(_.isEmpty(n)?"px":o(n)),t.css_unit.bind(function(e){e=_.isEmpty(e)?"px":e,i.find('input[type="number"]').trigger("change")}),i.find('input[type="number"]').on("input change",function(e){t(a(this).val()+o(t.css_unit()))}).stepper(),i.on("click","[data-sek-unit]",function(e){e.preventDefault(),i.find("[data-sek-unit]").removeClass("is-selected").attr("aria-pressed",!1),a(this).addClass("is-selected").attr("aria-pressed",!0),i.find("input[data-czrtype]").data("sek-unit",a(this).data("sek-unit")),t.css_unit(a(this).data("sek-unit"))}),i.find('.sek-ui-button[data-sek-unit="'+n+'"]').addClass("is-selected").attr("aria-pressed",!0)},maybeSetupDeviceSwitcherForInput:function(){var i=this,e=['<span class="sek-input-device-switcher">','<i data-sek-device="desktop" class="sek-switcher preview-desktop active" title="'+sektionsLocalizedData.i18n["Settings on desktops"]+'"></i>','<i data-sek-device="tablet" class="sek-switcher preview-tablet" title="'+sektionsLocalizedData.i18n["Settings on tablets"]+'"></i>','<i data-sek-device="mobile" class="sek-switcher preview-mobile" title="'+sektionsLocalizedData.i18n["Settings on mobiles"]+'"></i>',"</span>"].join(" ");i.container.find(".customize-control-title").prepend(e),i.previewedDevice=new s.Value(s.previewedDevice()),syncWithPreviewedDevice=function(e){e.stopPropagation(),i.container.find("[data-sek-device]").removeClass("active"),a(this).addClass("active");var t="desktop";try{t=a(this).data("sek-device")}catch(e){s.errare("maybeSetupDeviceSwitcherForInput => error when binding sek-switcher",e)}try{s.previewedDevice(t)}catch(e){s.errare("maybeSetupDeviceSwitcherForInput => error when setting the previewed device",e)}i.previewedDevice(t)},i.container.on("click","[data-sek-device]",syncWithPreviewedDevice);var t=i.container.find('[data-sek-device="'+s.previewedDevice()+'"]');0<t.length&&t.trigger("click")},scheduleModuleAccordion:function(e){e=e||{expand_first_module:!0};var i=this;a(i.container).on("click",".customize-control label > .customize-control-title",function(e){e.stopPropagation();var t=a(this).closest(".customize-control");"no"!==t.attr("data-sek-accordion")&&(i.container.find(".customize-control").not(t).each(function(){a(this).attr("data-sek-accordion")||(a(this).attr("data-sek-expanded","false"),a(this).find(".czr-items-wrapper").stop(!0,!0).slideUp("fast"))}),t.find(".czr-items-wrapper").stop(!0,!0).slideToggle({duration:"fast",start:function(){t.attr("data-sek-expanded","false"==t.attr("data-sek-expanded")?"true":"false"),"true"==t.attr("data-sek-expanded")?t.trigger("sek-accordion-expanded"):t.trigger("sek-accordion-collapsed")}}))}),e.expand_first_module&&i.container.find(".customize-control").first().find("label > .customize-control-title").trigger("click")},isPromise:function(e){return e&&"function"==typeof e.then&&String(a.Deferred().then)===String(e.then)},whenAllPromisesInParallel:function(e){var i=this,t=a.Deferred(),n=[],o=_.keys(e);return _.each(e,function(e,t){n.push(a.Deferred(function(t){(i.isPromise(e)?e:a.Deferred()).done(t.resolve).fail(function(e){t.reject(e)})}))}),a.when.apply(this,n).done(function(){var i={},e=Array.prototype.slice.call(arguments);_.each(e,function(e,t){i[o[t]]=e}),t.resolve(i)}).fail(t.reject),t},whenAllPromisesInSerie:function(t,i,n,o){i=i||0,n=n||{},o=o||a.Deferred();var r=this;if(_.isArray(t)){var e=t[i];(r.isPromise(e)?e:a.Deferred(function(e){e.resolve()})).always(function(e){n[i]=e,i+1==t.length?o.resolve(n):i+1<t.length&&r.whenAllPromisesInSerie(t,i+1,n,o)})}return o},importAttachment:function(t){return wp.ajax.post("sek_import_attachment",{rel_path:t,nonce:s.settings.nonce.save}).fail(function(e){s.errare("sek_import_attachment ajax action failed for image "+t,e)})}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(a,f){f.extend(CZRSeksPrototype,{setupDnd:function(){var t=this;t.bind("sek-refresh-dragzones",function(e){"draggable"in document.createElement("span")?t.setupNimbleDragZones(e.input_container):a.panel(sektionsLocalizedData.sektionsPanelId,function(e){a.notifications.add(new a.Notification("drag-drop-support",{type:"error",message:sektionsLocalizedData.i18n["This browser does not support drag and drop. You might need to update your browser or use another one."],dismissible:!0})),_.delay(function(){a.notifications.remove("drag-drop-support")},1e4)})}),a.previewer.bind("ready",function(){try{t.setupNimbleDropZones()}catch(e){a.errare("::setupDnd => error on self.setupNimbleDropZones()",e)}_.isUndefined(_.findWhere(t.registered(),{module_type:"sek_intro_sec_picker_module"}))&&_.isUndefined(_.findWhere(t.registered(),{module_type:"sek_module_picker_module"}))||t.rootPanelFocus()}),t.reactToDrop()},setupNimbleDragZones:function(e){var t=this;e.find("[draggable]").each(function(){f(this).on("dragstart",function(e){(function(e){e.originalEvent.dataTransfer.setData("sek-content-type",f(this).data("sek-content-type")),e.originalEvent.dataTransfer.setData("sek-content-id",f(this).data("sek-content-id"));try{e.originalEvent.dataTransfer.setData("browserSupport","browserSupport"),e.originalEvent.dataTransfer.setData("browserSupport","browserSupport"),e.originalEvent.dataTransfer.clearData("browserSupport")}catch(e){a.panel(sektionsLocalizedData.sektionsPanelId,function(e){a.notifications.add(new a.Notification("drag-drop-support",{type:"error",message:sektionsLocalizedData.i18n["This browser does not support drag and drop. You might need to update your browser or use another one."],dismissible:!0})),_.delay(function(){a.notifications.remove("drag-drop-support")},1e4)})}t.dnd_draggedType=f(this).data("sek-content-type"),f(this).addClass("sek-dragged"),f("body").addClass("sek-dragging"),a.previewer.send("sek-drag-start",{type:t.dnd_draggedType})}).call(f(this),e)}).on("dragend",function(e){(function(e){f("body").removeClass("sek-dragging"),f(this).removeClass("sek-dragged"),a.previewer.send("sek-drag-stop")}).call(f(this),e)})})},setupNimbleDropZones:function(){var t=this;if(this.$dropZones=this.dnd_getDropZonesElements(),this.preDropElement=f("<div>",{class:sektionsLocalizedData.preDropElementClass,html:""}),this.$dropZones.length<1)throw new Error("::setupNimbleDropZones => invalid Dom element");this.$dropZones.each(function(){var e=f(this);!0!==e.data("zone-droppable-setup")&&(t.enterOverTimer=null,e.on("dragenter dragover",sektionsLocalizedData.dropSelectors,function(e){_.isNull(t.enterOverTimer)&&(t.enterOverTimer=!0,_.delay(function(){t.currentMousePosition&&t.currentMousePosition+""==e.clientY+""+e.clientX?t.enterOverTimer=null:(t.currentMousePosition=e.clientY+""+e.clientX,t.dnd_toggleDragApproachClassesToDropZones(e))},100)),t.dnd_canDrop(f(this))&&(e.stopPropagation(),t.dnd_OnEnterOver(f(this),e))}).on("dragleave drop",sektionsLocalizedData.dropSelectors,function(e){switch(e.type){case"dragleave":t.dnd_isOveringDropTarget(f(this),e)||t.dnd_cleanOnLeaveDrop(f(this),e);break;case"drop":if(this.$cachedDropZoneCandidates=null,!t.dnd_canDrop(f(this)))return;e.preventDefault(),t.dnd_onDrop(f(this),e),t.dnd_cleanOnLeaveDrop(f(this),e),a.previewer.send("sek-drag-stop")}}).data("zone-droppable-setup",!0))})},dnd_toggleDragApproachClassesToDropZones:function(m){this.$dropZones=this.$dropZones||this.dnd_getDropZonesElements(),this.$cachedDropZoneCandidates=_.isEmpty(this.$cachedDropZoneCandidates)?this.$dropZones.find(".sek-drop-zone"):this.$cachedDropZoneCandidates,this.$dropZones.find(".sek-drop-zone").each(function(){var e=m.clientY,t=m.clientX,i=f(this)[0].getBoundingClientRect(),n=Math.abs(e-(i.bottom-(i.bottom-i.top)/2)),o=(Math.abs(i.top-e),Math.abs(t-(i.right-(i.right-i.left)/2))),r=(i.right,i.left,n<60),s=o<60,a=n<80,c=o<80,l=n<120,d=o<120,u=t<=i.right&&i.left<=t,p=e>=i.top&&i.bottom>=e;p&&u?(f(this).removeClass("sek-drag-is-approaching"),f(this).removeClass("sek-drag-is-close"),f(this).removeClass("sek-drag-is-very-close"),f(this).addClass("sek-drag-is-in")):((r||p)&&(s||u)?(f(this).removeClass("sek-drag-is-approaching"),f(this).removeClass("sek-drag-is-close"),f(this).addClass("sek-drag-is-very-close")):((a||p)&&(c||u)?(f(this).removeClass("sek-drag-is-approaching"),f(this).addClass("sek-drag-is-close")):((l||p)&&(d||u)?f(this).addClass("sek-drag-is-approaching"):f(this).removeClass("sek-drag-is-approaching"),f(this).removeClass("sek-drag-is-close")),f(this).removeClass("sek-drag-is-very-close")),f(this).removeClass("sek-drag-is-in"))}),this.enterOverTimer=null},dnd_getPreDropElementContent:function(e){var t,i,n=f(e.currentTarget);switch(this.dnd_draggedType){case"module":t=sektionsLocalizedData.i18n["Insert here"],0<n.length&&("between-sections"!==n.data("sek-location")&&"in-empty-location"!==n.data("sek-location")||(t=sektionsLocalizedData.i18n["Insert in a new section"])),i='<div class="sek-module-placeholder-content"><p>'+t+"</p></div>";break;case"preset_section":i='<div class="sek-module-placeholder-content"><p>'+(t=sektionsLocalizedData.i18n["Insert a new section here"])+"</p></div>";break;default:a.errare("::dnd_getPreDropElementContent => invalid content type provided")}return i},dnd_getDropZonesElements:function(){return f(a.previewer.targetWindow().document)},dnd_canDrop:function(e){var t=e&&0<e.length&&e.hasClass("sek-content-preset_section-drop-zone"),i=e&&0<e.length&&e.hasClass("sek-module-drop-zone-for-first-module");return e.hasClass("sek-drop-zone")&&("preset_section"===this.dnd_draggedType&&t||"module"===this.dnd_draggedType&&!t||"preset_section"===this.dnd_draggedType&&i)},dnd_OnEnterOver:function(e,t){t.preventDefault(),!0!==e.data("is-drag-entered")&&(e.data("is-drag-entered",!0),e.addClass("sek-active-drop-zone"),this.$dropZones.addClass("sek-is-dragging"));try{this.dnd_mayBePrintPreDropElement(e,t)}catch(e){a.errare("Error when trying to insert the preDrop content",e)}},dnd_cleanOnLeaveDrop:function(e,t){var i=this;this.$dropZones=this.$dropZones||this.dnd_getDropZonesElements(),this.preDropElement.remove(),this.$dropZones.removeClass("sek-is-dragging"),f(sektionsLocalizedData.dropSelectors,this.$dropZones).each(function(){i.dnd_cleanSingleDropTarget(f(this))})},dnd_cleanSingleDropTarget:function(e){_.isEmpty(e)||e.length<1||(e.data("is-drag-entered",!1),e.data("preDrop-position",!1),e.removeClass("sek-active-drop-zone"),e.find(".sek-drop-zone").removeClass("sek-drag-is-close"),e.find(".sek-drop-zone").removeClass("sek-drag-is-approaching"),e.removeClass("sek-feed-me-seymore"))},dnd_getPosition:function(e,t){var i=e[0].getBoundingClientRect(),n=i.height;return"before"===e.data("preDrop-position")?n+=this.preDropElement.outerHeight():"after"===e.data("preDrop-position")&&(n-=this.preDropElement.outerHeight()),0<t.originalEvent.clientY-i.top-n/2?"after":"before"},dnd_mayBePrintPreDropElement:function(e,t){var i=this,n=e.data("preDrop-position"),o=this.dnd_getPosition(e,t);if(n!==o&&!0!==i.isPrintingPreDrop){i.isPrintingPreDrop=!0,this.dnd_cleanSingleDropTarget(this.$currentPreDropTarget);var r="between-sections"===e.data("sek-location")||"in-empty-location"===e.data("sek-location");f.when(i.preDropElement.remove()).done(function(){e["before"===o?"prepend":"append"](i.preDropElement).find("."+sektionsLocalizedData.preDropElementClass).html(i.dnd_getPreDropElementContent(t)),e.find("."+sektionsLocalizedData.preDropElementClass).toggleClass("in-new-sektion",r),e.data("preDrop-position",o),e.addClass("sek-feed-me-seymore"),i.isPrintingPreDrop=!1,i.$currentPreDropTarget=e})}},dnd_isOveringDropTarget:function(e,t){var i=e[0].getBoundingClientRect(),n=t.clientX,o=t.clientY,r=i.left,s=i.right,a=i.top,c=i.bottom;return r<=n&&n-r<=s-r&&(a<=o&&o-a<=c-a)},dnd_onDrop:function(e,t){t.stopPropagation();this.dnd_getPosition(e,t),e.index();a.czr_sektions.trigger("sek-content-dropped",{drop_target_element:e,location:e.closest('[data-sek-level="location"]').data("sek-id"),before_module:e.data("drop-zone-before-module-or-nested-section"),after_module:e.data("drop-zone-after-module-or-nested-section"),before_section:e.data("drop-zone-before-section"),after_section:e.data("drop-zone-after-section"),content_type:t.originalEvent.dataTransfer.getData("sek-content-type"),content_id:t.originalEvent.dataTransfer.getData("sek-content-id")})},reactToDrop:function(){this.bind("sek-content-dropped",function(e){try{!function(e){if(!_.isObject(e))throw new Error("Invalid params provided");if(e.drop_target_element.length<1)throw new Error("Invalid drop_target_element");var t=e.drop_target_element,i="content-in-column";switch(t.data("sek-location")){case"between-sections":i="content-in-a-section-to-create";break;case"in-empty-location":e.is_first_section=!0,e.send_to_preview=!1,i="content-in-empty-location";break;case"between-columns":i="content-in-new-column"}if("preset_section"===e.content_type)if(t.hasClass("sek-module-drop-zone-for-first-module")){var n=t.closest('div[data-sek-level="section"]');1<n.find(".sek-sektion-inner").first().children('[data-sek-level="column"]').length?(i="preset-section-in-a-nested-section-to-create",e.is_nested=!0,e.in_column=t.closest('[data-sek-level="column"]').data("sek-id"),e.in_sektion=n.data("sek-id")):(e.sektion_to_replace=n.data("sek-id"),e.after_section=e.sektion_to_replace,e.in_column=n.closest('[data-sek-level="column"]').data("sek-id"),i="content-in-a-section-to-replace")}else"between-sections"===t.data("sek-location")&&(i="content-in-a-section-to-create");switch(i){case"content-in-column":var o=t.closest("div[data-sek-level]");if(o.length<1)throw new Error("No valid level dom element found");var r=o.data("sek-level"),s=o.data("sek-id");if(_.isEmpty(r)||_.isEmpty(s))throw new Error("No valid level id found");a.previewer.trigger("sek-add-module",{level:r,id:s,in_column:t.closest('div[data-sek-level="column"]').data("sek-id"),in_sektion:t.closest('div[data-sek-level="section"]').data("sek-id"),before_module:e.before_module,after_module:e.after_module,content_type:e.content_type,content_id:e.content_id});break;case"content-in-a-section-to-create":case"content-in-a-section-to-replace":a.previewer.trigger("sek-add-content-in-new-sektion",e);break;case"preset-section-in-a-nested-section-to-create":a.previewer.trigger("sek-add-preset-section-in-new-nested-sektion",e);break;case"content-in-empty-location":a.previewer.trigger("sek-add-content-in-new-sektion",e);break;default:a.errare("sek control panel => ::reactToDrop => invalid drop case : "+i)}}(e)}catch(e){a.errare("error when reactToDrop",e)}})}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(r,s){s.extend(CZRSeksPrototype,{setupTinyMceEditor:function(){var n=this;r.sekEditorExpanded=new r.Value(!1),r.sekEditorSynchronizedInput=new r.Value,n.editorEventsListenerSetup=!1;var o=function(){r.sekTinyMceEditor=r.sekTinyMceEditor||tinyMCE.get("czr-customize-content_editor"),!1===n.editorEventsListenerSetup&&(n.attachEventsToEditor(),n.editorEventsListenerSetup=!0,n.trigger("sek-tiny-mce-editor-bound-and-instantiated"))};n.bind("sek-edit-module_done",function(e){if("tiny_mce_editor"==e.clicked_input_type){var i=e.id;if(!0===n.getRegisteredModuleProperty(e.module_type,"is_father")){var t=n.getRegisteredModuleProperty(e.module_type,"children");if(_.isEmpty(t))throw new Error("::generateUIforFrontModules => a father module "+e.module_type+" is missing children modules ");_.each(t,function(e,t){"czr_tinymce_child"===e&&(i=i+"__"+t)})}r.sekEditorSynchronizedInput({control_id:i,input_id:e.clicked_input_id}),r.sekEditorExpanded(!0),r.sekTinyMceEditor.focus()}}),s("#customize-theme-controls").on("click",'[data-czr-action="open-tinymce-editor"]',function(){var e=s(this).data("czr-control-id"),t=s(this).data("czr-input-id");if(_.isEmpty(e)||_.isEmpty(t))r.errare("toggle-tinymce-editor => missing input or control id");else{var i=s.extend(!0,{},r.sekEditorSynchronizedInput()),n=_.extend(i,{input_id:t,control_id:e});r.sekEditorSynchronizedInput(n),r.sekEditorExpanded(!0),r.sekTinyMceEditor.focus()}}),r.sekEditorSynchronizedInput.bind(function(n,e){o(),r(n.control_id,function(e){var t=e(),i=_.isObject(t)&&!_.isEmpty(t[n.input_id])?t[n.input_id]:"";try{r.sekTinyMceEditor.setContent(i)}catch(e){r.errare("Error when setting the tiny mce editor content in setupTinyMceEditor",e)}r.sekTinyMceEditor.focus()})}),r.sekEditorExpanded.bind(function(e,t,i){o(),e&&r.sekTinyMceEditor.focus(),s(document.body).toggleClass("czr-customize-content_editor-pane-open",e),s(window)[e?"on":"off"]("resize",function(){r.sekEditorExpanded()&&_.delay(function(){n.czrResizeEditor(window.innerHeight-n.$editorPane.height())},50)}),e?n.czrResizeEditor(window.innerHeight-n.$editorPane.height()):(n.$preview.css("bottom",""),n.$collapseSidebar.css("bottom",""))}),s("#czr-customize-content_editor-pane").on("click",'[data-czr-action="close-tinymce-editor"]',function(){r.sekEditorExpanded(!1)}),s("#customize-controls").on("click",function(e){"open-tinymce-editor"!=s(e.target).data("czr-action")&&r.sekEditorExpanded(!1,{context:"clicked anywhere"})}),s(document).on("keydown",_.throttle(function(e){27===e.keyCode&&r.sekEditorExpanded(!1)},50)),n.bind("sek-tiny-mce-editor-bound-and-instantiated",function(){var e=s(r.sekTinyMceEditor.iframeElement).contents().get(0);s(e).on("keydown",_.throttle(function(e){27===e.keyCode&&r.sekEditorExpanded(!1)},50))}),_.each(["sek-click-on-inactive-zone","sek-add-section","sek-add-column","sek-add-module","sek-remove","sek-move","sek-duplicate","sek-resize-columns","sek-add-content-in-new-sektion","sek-pick-content","sek-edit-options","sek-edit-module","sek-notify"],function(e){"sek-edit-module"!=e?r.previewer.bind(e,function(){r.sekEditorExpanded(!1)}):r.previewer.bind(e,function(e){r.sekEditorExpanded("czr_tiny_mce_editor_module"===e.module_type)})})},attachEventsToEditor:function(){var t=this;t.$editorTextArea=s("#czr-customize-content_editor"),t.$editorPane=s("#czr-customize-content_editor-pane"),t.$editorDragbar=s("#czr-customize-content_editor-dragbar"),t.$editorFrame=s("#czr-customize-content_editor_ifr"),t.$mceTools=s("#wp-czr-customize-content_editor-tools"),t.$mceToolbar=t.$editorPane.find(".mce-toolbar-grp"),t.$mceStatusbar=t.$editorPane.find(".mce-statusbar"),t.$preview=s("#customize-preview"),t.$collapseSidebar=s(".collapse-sidebar"),r.sekTinyMceEditor.on("input change keyup",function(e){if(r.control.has(r.sekEditorSynchronizedInput().control_id))try{r.control(r.sekEditorSynchronizedInput().control_id).trigger("tinyMceEditorUpdated",{input_id:r.sekEditorSynchronizedInput().input_id,html_content:r.sekTinyMceEditor.getContent(),modified_editor_element:r.sekTinyMceEditor})}catch(e){r.errare("Error when triggering tinyMceEditorUpdated",e)}}),t.$editorTextArea.on("input",function(e){try{r.control(r.sekEditorSynchronizedInput().control_id).trigger("tinyMceEditorUpdated",{input_id:r.sekEditorSynchronizedInput().input_id,html_content:t.$editorTextArea.val(),modified_editor_element:t.$editorTextArea})}catch(e){r.errare("Error when triggering tinyMceEditorUpdated",e)}}),s("#czr-customize-content_editor-pane").on("mousedown mouseup",function(e){if(("mousedown"!==e.type||"czr-customize-content_editor-dragbar"===s(e.target).attr("id")||s(e.target).hasClass("czr-resize-handle"))&&r.sekEditorExpanded())switch(e.type){case"mousedown":s(document).on("mousemove.czr-customize-content_editor",function(e){e.preventDefault(),s(document.body).addClass("czr-customize-content_editor-pane-resize"),t.$editorFrame.css("pointer-events","none"),t.czrResizeEditor(e.pageY)});break;case"mouseup":s(document).off("mousemove.czr-customize-content_editor"),s(document.body).removeClass("czr-customize-content_editor-pane-resize"),t.$editorFrame.css("pointer-events","")}})},czrResizeEditor:function(e){var t,i=this,n=window.innerHeight,o=(window.innerWidth,{});r.sekEditorExpanded()&&(_.isNaN(e)||(t=n-e),o.height=t,o.components=i.$mceTools.outerHeight()+i.$mceToolbar.outerHeight()+i.$mceStatusbar.outerHeight(),t<40&&(o.height=40),n-1<t&&(o.height=n-1),n<i.$editorPane.outerHeight()&&(o.height=n),i.$preview.css("bottom",o.height),i.$editorPane.css("height",o.height),i.$editorFrame.css("height",o.height-o.components),i.$collapseSidebar.css("bottom",n-o.height<56?i.$mceStatusbar.outerHeight()+4:o.height+8))}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(t,e){jQuery.extend(CZRSeksPrototype,t.Events);var i=t.Class.extend(CZRSeksPrototype);try{t.czr_sektions=new i}catch(e){t.errare("api.czr_sektions => problem on instantiation",e)}}(wp.customize),function(l,d,u){l.czrInputMap=l.czrInputMap||{};var p=function(e){return u.contains(["px","em","%"],e)||(l.errare("error : invalid unit for input "+this.id,e),e="px"),e},_=function(i){var n=this;i.on("click",".sek-ui-button",function(e,t){e.preventDefault(),i.find(".sek-ui-button").removeClass("is-selected").attr("aria-pressed",!1),d(this).addClass("is-selected").attr("aria-pressed",!0),n.css_unit(d(this).data("sek-unit"),t)}),i.find('.sek-ui-button[data-sek-unit="'+(n.initial_unit||"px")+'"]').addClass("is-selected").attr("aria-pressed",!0)},m=function(t,i){var n=this;t.on("click",".reset-spacing-wrap",function(e){e.preventDefault(),t.find('input[type="number"]').each(function(){d(this).val("")}),n(i),d(".sek-unit-wrapper",t).find('[data-sek-unit="px"]').trigger("click")})};d.extend(l.czrInputMap,{spacing:function(e){var o=this,i=d(".sek-spacing-wrapper",o.container),t=l.czr_sektions.getInputRegistrationParams(o.id,o.module.module_type),n=u.isEmpty(t)||u.isEmpty(t.default)?[]:t.default;if(i.on("input",'input[type="number"]',function(e){var t=d(this).closest("[data-sek-spacing]").data("sek-spacing"),i=d.extend(!0,{},u.isObject(o())?o():{}),n=d(this).val();u.isString(n)&&!u.isEmpty(n)||u.isNumber(n)?i[t]=n:i=u.omit(i,t),o(i)}),m.call(o,i,n),u.isObject(o())){u.each(o(),function(e,t){d('[data-sek-spacing="'+t+'"]',i).find('input[type="number"]').val(e)});var r="px";d(".sek-unit-wrapper .sek-ui-button",o.container).each(function(){var e=d(this).data("sek-unit");u.isEmpty(o())||u.isEmpty(o().unit)||e===o().unit&&(r=e)}),d(".sek-unit-wrapper",o.container).find('[data-sek-unit="'+p.call(o,r)+'"]').trigger("click")}var s=o();o.initial_unit="px",u.isEmpty(s)||(o.initial_unit=u.isEmpty(s.unit)?"px":s.unit),o.css_unit=new l.Value(p.call(o,o.initial_unit)),o.css_unit.bind(function(e){var t;e=u.isEmpty(e)?"px":e,(t=d.extend(!0,{},u.isObject(o())?o():{})).unit=e,o(t)}),_.call(o,i)}}),d.extend(l.czrInputMap,{spacingWithDeviceSwitcher:function(e){var r=this,s=d(".sek-spacing-wrapper",r.container),t=l.czr_sektions.getInputRegistrationParams(r.id,r.module.module_type),a=u.isEmpty(t)||u.isEmpty(t.default)?{}:t.default,c=function(e,t){var i=["mobile","tablet","desktop"];if(u.has(e,t))return e[t];var n=u.findIndex(i,function(e){return t===e});return!u.isEmpty(t)&&n<i.length?c(e,i[n+1]):{}},i=function(e){var t=d.extend(!0,{},u.isObject(r())?r():{}),i=d.extend(!0,{},a);t=u.isObject(t)?d.extend(i,t):i;var n=c(t,e);d("[data-sek-spacing]",s).each(function(){var e=d(this).data("sek-spacing"),t="";u.isEmpty(n)||u.isEmpty(n[e])||(t=n[e]),d(this).find('input[type="number"]').val(t)});var o="px";d(".sek-unit-wrapper .sek-ui-button",r.container).each(function(){var e=d(this).data("sek-unit");u.isEmpty(n)||u.isEmpty(n.unit)||e===n.unit&&(o=e)}),d(".sek-unit-wrapper",r.container).find('[data-sek-unit="'+p.call(r,o)+'"]').trigger("click",{previewed_device_switched:!0})};l.czr_sektions.maybeSetupDeviceSwitcherForInput.call(r);var n=r();r.initial_unit="px",u.isEmpty(n)||u.isEmpty(n[r.previewedDevice()])||(r.initial_unit=u.isEmpty(n[r.previewedDevice()].unit)?"px":n[r.previewedDevice()].unit),r.css_unit=new l.Value(p.call(r,r.initial_unit)),s.on("input",'input[type="number"]',function(e){var t,i=d(this).closest("[data-sek-spacing]").data("sek-spacing"),n=d(this).val(),o=l.previewedDevice()||"desktop";(t=d.extend(!0,{},u.isObject(r())?r():{}))[o]=d.extend(!0,{},t[o]||{}),u.isString(n)&&!u.isEmpty(n)||u.isNumber(n)?t[o][i]=n:t[o]=u.omit(t[o],i),r(t)}),m.call(r,s,a),r.previewedDevice.bind(function(e){try{i(e)}catch(e){l.errare("Error when firing syncWithPreviewedDevice for input type spacingWithDeviceSwitcher for input id "+r.id,e)}}),r.css_unit.bind(function(e,t,i){if(!u.isObject(i)||!0!==i.previewed_device_switched){e=u.isEmpty(e)?"px":e;var n,o=r.previewedDevice()||"desktop";(n=d.extend(!0,{},u.isObject(r())?r():{}))[o]=d.extend(!0,{},n[o]||{}),n[o].unit=e,r(n)}}),_.call(r,s);try{i(l.previewedDevice())}catch(e){l.errare("Error when firing syncWithPreviewedDevice for input type spacingWithDeviceSwitcher for input id "+r.id,e)}}})}(wp.customize,jQuery,_),function(n,a,c){n.czrInputMap=n.czrInputMap||{},a.extend(n.czrInputMap,{bg_position:function(e){var t=this;a(".sek-bg-pos-wrapper",t.container).on("change",'input[type="radio"]',function(e){t(a(this).val())}),c.isEmpty(t())||t.container.find('input[value="'+t()+'"]').attr("checked",!0).trigger("click")},bgPositionWithDeviceSwitcher:function(e){var o=this,t=n.czr_sektions.getInputRegistrationParams(o.id,o.module.module_type),r=c.isEmpty(t)||c.isEmpty(t.default)?{}:t.default;n.czr_sektions.maybeSetupDeviceSwitcherForInput.call(o);var s=function(e,t){var i=["mobile","tablet","desktop"];if(c.has(e,t))return e[t];var n=c.findIndex(i,function(e){return t===e});return!c.isEmpty(t)&&n<i.length?s(e,i[n+1]):{}},i=function(e){var t=a.extend(!0,{},c.isObject(o())?o():{}),i=a.extend(!0,{},r);t=c.isObject(t)?a.extend(i,t):i;var n=s(t,e);o.container.find('input[value="'+n+'"]').attr("checked",!0).trigger("click",{previewed_device_switched:!0})};a(".sek-bg-pos-wrapper",o.container).on("change",'input[type="radio"]',function(e){var t,i=a(this).val();(t=a.extend(!0,{},c.isObject(o())?o():{}))[n.previewedDevice()||"desktop"]=i,o(t)}),o.previewedDevice.bind(function(e){try{i(e)}catch(e){n.errare("Error when firing syncWithPreviewedDevice for input type spacingWithDeviceSwitcher for input id "+o.id,e)}});try{i(n.previewedDevice())}catch(e){n.errare("Error when firing syncWithPreviewedDevice for input type bgPositionWithDeviceSwitcher for input id "+o.id,e)}}})}(wp.customize,jQuery,_),function(c,l,d){c.czrInputMap=c.czrInputMap||{};var e=function(e){var o=this,t=c.czr_sektions.getInputRegistrationParams(o.id,o.module.module_type),r=d.isEmpty(t)||d.isEmpty(t.default)?{}:t.default,i="verticalAlignWithDeviceSwitcher"===o.type?".sek-v-align-wrapper":".sek-h-align-wrapper",s=l(i,o.container);c.czr_sektions.maybeSetupDeviceSwitcherForInput.call(o);var a=function(e,t){var i=["mobile","tablet","desktop"];if(d.has(e,t))return e[t];var n=d.findIndex(i,function(e){return t===e});return!d.isEmpty(t)&&n<i.length?a(e,i[n+1]):{}},n=function(e){var t=l.extend(!0,{},d.isObject(o())?o():{}),i=l.extend(!0,{},r);t=d.isObject(t)?l.extend(i,t):i;var n=a(t,e);s.find(".selected").removeClass("selected"),s.find('div[data-sek-align="'+n+'"]').addClass("selected")};s.on("click","[data-sek-align]",function(e){var t;e.preventDefault(),(t=l.extend(!0,{},d.isObject(o())?o():{}))[c.previewedDevice()||"desktop"]=l(this).data("sek-align"),s.find(".selected").removeClass("selected"),l.when(l(this).addClass("selected")).done(function(){o(t)})}),o.previewedDevice.bind(function(e){try{n(e)}catch(e){c.errare("Error when firing syncWithPreviewedDevice for input type : "+o.type+" for input id "+o.id,e)}});try{n(c.previewedDevice())}catch(e){c.errare("Error when firing syncWithPreviewedDevice for input type : "+o.type+" for input id "+o.id,e)}};l.extend(c.czrInputMap,{horizTextAlignmentWithDeviceSwitcher:e,horizAlignmentWithDeviceSwitcher:e,verticalAlignWithDeviceSwitcher:e})}(wp.customize,jQuery,_),function(t,e,i){t.czrInputMap=t.czrInputMap||{},e.extend(t.czrInputMap,{font_size:function(e){t.czr_sektions.setupFontSizeAndLineHeightInputs.call(this)}})}(wp.customize,jQuery,_),function(t,e,i){t.czrInputMap=t.czrInputMap||{},e.extend(t.czrInputMap,{line_height:function(e){t.czr_sektions.setupFontSizeAndLineHeightInputs.call(this)}})}(wp.customize,jQuery,_),function(i,c,l){i.czrInputMap=i.czrInputMap||{},c.extend(i.czrInputMap,{font_picker:function(e){var a=this,o=a.input_parent,n=function(e,t){o();var n=c('select[data-czrtype="'+a.id+'"]',a.container);l.isNull(a())||l.isEmpty(a())?n.append('<option value="none" selected="selected">'+sektionsLocalizedData.i18n["Select a font family"]+"</option>"):n.append('<option value="none">'+sektionsLocalizedData.i18n["Select a font family"]+"</option>"),l.each([{title:sektionsLocalizedData.i18n["Web Safe Fonts"],type:"cfont",list:t.cfonts},{title:sektionsLocalizedData.i18n["Google Fonts"],type:"gfont",list:t.gfonts}],function(e){var t,r,s,i=c("<optgroup>",{label:e.title,html:(t=e.list,r=e.type,s="",l.each(t,function(e){var t,i,n=e.name,o=l.isString(n)?n.replace(/[+|:]/g," "):n;t=n,i=r,(n=l.isString(t)?["[",i,"]",t].join(""):"")==a()?s+='<option selected="selected" value="'+n+'">'+o+"</option>":s+='<option value="'+n+'">'+o+"</option>"}),s)});n.append(i)});var i={escapeMarkup:function(e){return e}};e&&c.extend(i,{resultsAdapter:e,closeOnSelect:!1}),n.select2(i),c(".select2-selection__rendered",a.container).css(r(a()))},r=function(e){if(!l.isString(e)||l.isEmpty(e))return{};var t,i,n,o=(e=e.replace("[gfont]","").replace("[cfont]","")).split(":");return t=s(e),i=o[1]?o[1].replace(/[^0-9.]+/g,""):400,i=l.isNumber(i)?i:400,n=o[1]&&-1!=o[1].indexOf("italic")?"italic":"",{"font-family":"none"==t?"inherit":t.replace(/[+|:]/g," "),"font-weight":i||400,"font-style":n||"normal"}},s=function(e){if(!l.isString(e)||l.isEmpty(e))return e;var t=(e=e.replace("[gfont]","").replace("[cfont]","")).split(":");return l.isString(t[0])?t[0].replace(/[+|:]/g," "):""};c.when(function(){var e,t=c.Deferred();l.isEmpty(i.sek_fontCollections)?(l.isUndefined(i.sek_fetchingFontCollection)||"pending"!=i.sek_fetchingFontCollection.state()?(e=i.CZR_Helpers.getModuleTmpl({tmpl:"font_list",module_type:"font_picker_input",module_id:a.module.id}),i.sek_fetchingFontCollection=e):e=i.sek_fetchingFontCollection,e.done(function(e){if("string"!=typeof e||"{"!==e[0])throw new Error("font_picker => server list is not JSON.parse-able");i.sek_fontCollections=JSON.parse(e),t.resolve(i.sek_fontCollections)}).fail(function(e){t.reject(e)})):t.resolve(i.sek_fontCollections);return t.promise()}()).done(function(t){var i;(i=c.Deferred(),void 0!==c.fn.select2&&void 0!==c.fn.select2.amd&&"function"==typeof c.fn.select2.amd.require?c.fn.select2.amd.require(["select2/results","select2/utils"],function(e,t){var n=function(e,t,i){n.__super__.constructor.call(this,e,t,i)};t.Extend(n,e),n.prototype.bind=function(e,t){var i=this;e.on("results:focus",function(e){"true"!=e.element.attr("aria-selected")&&i.trigger("select",{data:e.data})}),n.__super__.bind.call(this,e,t)},i.resolve(n)}):i.resolve(!1),i.promise()).done(function(e){n(e,t)})}).fail(function(e){i.errare("font_picker => fail response =>",e)})}})}(wp.customize,jQuery,_),function(s,a,c){s.czrInputMap=s.czrInputMap||{},a.extend(s.czrInputMap,{fa_icon_picker:function(){var t,n=this,o=n.input_parent,r=!1;a.when((t=a.Deferred(),c.isEmpty(n.sek_faIconCollection)?s.CZR_Helpers.getModuleTmpl({tmpl:"icon_list",module_type:"fa_icon_picker_input",module_id:n.module.id}).done(function(e){if("string"!=typeof e||"["!==e[0])throw new Error("fa_icon_picker => server list is not JSON.parse-able");n.sek_faIconCollection=JSON.parse(e),t.resolve(n.sek_faIconCollection)}).fail(function(e){t.reject(e)}):t.resolve(n.sek_faIconCollection),t.promise())).done(function(e){!function(e){c.each(e,function(e){var t={value:e,html:s.CZR_Helpers.capitalize(e.substring(7))};t.value==o().icon&&(a.extend(t,{selected:"selected"}),r=!0),a("select[data-czrtype]",n.container).append(a("<option>",t))});var t,i=function(e){return e.id?a('<span class="'+e.element.value+'"></span><span class="social-name"> '+e.text+"</span>"):e.text};t=r?a("<option>"):a("<option>",{selected:"selected"}),a("select[data-czrtype]",n.container).prepend(t).select2({templateResult:i,templateSelection:i,placeholder:sektionsLocalizedData.i18n["Select an icon"],allowClear:!0})}(e)}).fail(function(e){s.errare("fa_icon_picker => fail response =>",e)})}})}(wp.customize,jQuery,_),function(d,u,p){d.czrInputMap=d.czrInputMap||{},u.extend(d.czrInputMap,{code_editor:function(e){var n=this,i=this.module.control,t=(n.input_parent(),!1),r=n.container.find("textarea"),o=n.container.find(".customize-control-title"),s=r.data("editor-params");wp.codeEditor&&(p.isUndefined(s)||!1!==s)&&(t=s),n.isReady.done(function(){var e=function(e){p.isEmpty(this.editor)&&(p.isEmpty(this.module.control.container.attr("data-sek-expanded"))||"false"==this.module.control.container.attr("data-sek-expanded")||setTimeout(function(){if(t)try{a(t)}catch(e){d.errare("error in sek_control => code_editor() input",e),c()}else c();o.click()},10))};e.call(n),n.module.control.container.on("sek-accordion-expanded",function(){e.call(n)})});var a=function(e){var t,i=!1;t=p.extend({},e,{onTabNext:CZRSeksPrototype.selectNextTabbableOrFocusable(":tabbable"),onTabPrevious:CZRSeksPrototype.selectPrevTabbableOrFocusable(":tabbable"),onUpdateErrorNotice:l}),n.editor=wp.codeEditor.initialize(r,t),u(n.editor.codemirror.display.lineDiv).attr({role:"textbox","aria-multiline":"true","aria-label":o.html(),"aria-describedby":"editor-keyboard-trap-help-1 editor-keyboard-trap-help-2 editor-keyboard-trap-help-3 editor-keyboard-trap-help-4"}),o.on("click",function(e){e.stopPropagation(),n.editor.codemirror.focus()}),n.editor.codemirror.on("change",function(e){i=!0,r.val(e.getValue()).trigger("change"),i=!1}),n.editor.codemirror.setValue(n()),n.bind(n.id+":changed",function(e){i||n.editor.codemirror.setValue(e)}),n.editor.codemirror.on("keydown",function(e,t){27===t.keyCode&&t.stopPropagation()})},c=function(){var o=r[0];n.editor=o,r.on("blur",function(){r.data("next-tab-blurs",!1)}),r.on("keydown",function(e){var t,i,n;27!==e.keyCode?9!==e.keyCode||e.ctrlKey||e.altKey||e.shiftKey||r.data("next-tab-blurs")||(t=o.selectionStart,i=o.selectionEnd,n=o.value,0<=t&&(o.value=n.substring(0,t).concat("\t",n.substring(i)),r.selectionStart=o.selectionEnd=t+1),e.stopPropagation(),e.preventDefault()):r.data("next-tab-blurs")||(r.data("next-tab-blurs",!0),e.stopPropagation())})},l=function(e){var t;i.setting.notifications.remove(n.id),0!==e.length&&(t=1===e.length?sektionsLocalizedData.i18n.codeEditorSingular.replace("%d","1").replace("%s",o.html()):sektionsLocalizedData.i18n.codeEditorPlural.replace("%d",String(e.length)).replace("%s",o.html()),i.setting.notifications.add(n.id,new d.Notification(n.id,{message:t,type:"warning"})))}}})}(wp.customize,jQuery,_),function(e,r,t){e.czrInputMap=e.czrInputMap||{},r.extend(e.czrInputMap,{range_simple:function(e){var t=this,i=r(".sek-range-with-unit-picker-wrapper",t.container),n=i.find('input[type="number"]'),o=i.find('input[type="range"]');o.on("input",function(e){n.val(r(this).val()).trigger("input")}),n.on("input",function(e){t(r(this).val()),o.val(r(this).val())}),o.val(n.val()||0)}})}(wp.customize,jQuery,_),function(a,c,l){a.czrInputMap=a.czrInputMap||{},c.extend(a.czrInputMap,{range_with_unit_picker:function(e){var t=this,i=c(".sek-range-with-unit-picker-wrapper",t.container),n=i.find('input[type="number"]'),o=i.find('input[type="range"]'),r=i.find("input[data-czrtype]").data("sek-unit"),s=function(e){return l.contains(["px","em","%"],e)||(a.errare("error : invalid unit for input "+t.id,e),e="px"),e};t.css_unit=new a.Value(l.isEmpty(r)?"px":s(r)),t.css_unit.bind(function(e){e=l.isEmpty(e)?"px":e,i.find('input[type="number"]').trigger("input")}),o.on("input",function(e){n.val(c(this).val()).trigger("input")}),n.on("input",function(e){t(c(this).val()+s(t.css_unit())),o.val(c(this).val())}),o.val(n.val()||0),i.on("click",".sek-ui-button",function(e){e.preventDefault(),i.find(".sek-ui-button").removeClass("is-selected").attr("aria-pressed",!1),c(this).addClass("is-selected").attr("aria-pressed",!0),i.find("input[data-czrtype]").data("sek-unit",c(this).data("sek-unit")),t.css_unit(c(this).data("sek-unit"))}),i.find('.sek-ui-button[data-sek-unit="'+r+'"]').addClass("is-selected").attr("aria-pressed",!0)}})}(wp.customize,jQuery,_),function(a,_,m){a.czrInputMap=a.czrInputMap||{},_.extend(a.czrInputMap,{range_with_unit_picker_device_switcher:function(e){var c=this,l=_(".sek-range-with-unit-picker-wrapper",c.container),d=l.find('input[type="number"]'),r=l.find('input[type="range"]'),s=function(e){return m.contains(["px","em","%"],e)||(a.errare("range_with_unit_picker_device_switcher => error : invalid unit for input "+c.id,e),e="px"),e},t=a.czr_sektions.getInputRegistrationParams(c.id,c.module.module_type),u=m.isEmpty(t)||m.isEmpty(t.default)?{}:t.default,i=function(){return l.find("input[data-czrtype]").data("sek-unit")||"px"},p=function(e,t){var i=["mobile","tablet","desktop"];if(m.has(e,t))return e[t];var n=m.findIndex(i,function(e){return t===e});return!m.isEmpty(t)&&n<i.length?p(e,i[n+1]):_.extend(!0,{desktop:""},u).desktop},n=function(e){var t=c(),i={};i=_.extend(!0,{},u),m.isObject(t)?i=_.extend(!0,{},t):m.isString(t)&&!m.isEmpty(t)&&(i={desktop:t});var n,o,r=p(i,e),s=(o=r,m.isEmpty(o)||!m.isString(o)?"px":o.replace(/[0-9]|\.|,/g,"")),a=(n=r,m.isEmpty(n)||!m.isString(n)?"16":n.replace(/px|em|%/g,""));_(".sek-unit-wrapper",l).find('[data-sek-unit="'+s+'"]').trigger("click",{previewed_device_switched:!0}),l.find('.sek-ui-button[data-sek-unit="'+s+'"]').addClass("is-selected").attr("aria-pressed",!0),d.val(a).trigger("input",{previewed_device_switched:!0})};a.czr_sektions.maybeSetupDeviceSwitcherForInput.call(c),c.css_unit=new a.Value(m.isEmpty(i())?"px":s(i()));var o='<button type="button" class="button sek-reset-button sek-float-right">'+sektionsLocalizedData.i18n.Reset+"</button>";c.container.find(".customize-control-title").append(o),c.css_unit.bind(function(e,t,i){m.isObject(i)&&!0===i.previewed_device_switched||d.trigger("input")}),r.on("input",function(e){d.val(_(this).val()).trigger("input")}),d.on("input",function(e,t){var i,n=a.previewedDevice()||"desktop",o=_(this).val()+s(c.css_unit());(i=_.extend(!0,{},m.isObject(c())?c():{}))[n]=_.extend(!0,{},i[n]||{}),m.isString(o)&&!m.isEmpty(o)&&(i[n]=o),(m.isEmpty(t)||m.isObject(t)&&!0!==t.previewed_device_switched)&&c(i),r.val(_(this).val())}),l.on("click",".sek-ui-button",function(e,t){e.stopPropagation(),l.find(".sek-ui-button").removeClass("is-selected").attr("aria-pressed",!1),_(this).addClass("is-selected").attr("aria-pressed",!0),l.find("input[data-czrtype]").data("sek-unit",_(this).data("sek-unit")),c.css_unit(_(this).data("sek-unit"),t)}),c.previewedDevice.bind(function(e){try{n(e)}catch(e){a.errare("Error when firing syncWithPreviewedDevice for input type range_with_unit_picker_device_switcher for input id "+c.id,e)}}),c.container.on("click",".sek-reset-button",function(e){var t=a.previewedDevice(),i=_.extend(!0,{},m.isObject(c())?c():{});m.isEmpty(i[t])||(i=m.omit(i,t),c(i),n(a.previewedDevice()))}),r.val(d.val()||0);try{n(a.previewedDevice())}catch(e){a.errare("Error when firing syncWithPreviewedDevice for input type range_with_unit_picker_device_switcher for input id "+c.id,e)}}})}(wp.customize,jQuery,_),function(h,g,k){h.czrInputMap=h.czrInputMap||{},g.extend(h.czrInputMap,{borders:function(e){var a=this,c=g(".sek-borders",a.container),l=c.find('input[type="number"]'),d=c.find('input[type="range"]'),u=c.find(".sek-alpha-color-input"),p=function(e){return k.contains(["px","em","%"],e)||(h.errare("borders => error : invalid unit for input "+a.id,e),e="px"),e},_=function(e){return k.isEmpty(e)||!k.isString(e)?"16":e.replace(/px|em|%/g,"")},m=function(e){return k.isEmpty(e)||!k.isString(e)?"px":e.replace(/[0-9]|\.|,/g,"")},t=h.czr_sektions.getInputRegistrationParams(a.id,a.module.module_type),f=k.isEmpty(t)||k.isEmpty(t.default)?{}:t.default;a.cssBorderTypes=["top","left","right","bottom"];var i,n,o=function(){var e=a(),t="px";return k.isObject(e)&&k.has(e,"_all_")&&k.isObject(e._all_)&&!k.isEmpty(e._all_.wght)&&(t=p(m(e._all_.wght))),t},r=function(){var e=a(),t="#000000";return k.isObject(e)&&k.has(e,"_all_")&&k.isObject(e._all_)&&!k.isEmpty(e._all_.col)&&(t=e._all_.col),t},s=function(e){if(!k.contains(k.union(a.cssBorderTypes,["_all_"]),e))throw new Error("Error in syncWithBorderType : the border type must be one of those values '_all_', 'top', 'left', 'right', 'bottom'");var t=a(),i={},n=g.extend(!0,{},f);k.isObject(t)?i=g.extend(!0,{},t):k.isString(t)&&(i={_all_:{wght:t}});var o,r,s=function(e,t){var i,n=g.extend(!0,{},f);if(!k.has(n,"_all_"))throw new Error("Error when firing getCurrentBorderTypeOrAllValue : the default value of the borders input must be php registered as an array formed : array( 'wght' => '1px', 'col' => '#000000' )");return i=k.isObject(e)&&k.has(e,"_all_")?k.extend(n._all_,e._all_):n._all_,k.has(e,t)&&k.isObject(e[t])?k.extend(i,e[t]):n._all_}(i=g.extend(n,i),e);if(k.isEmpty(s)||!k.isObject(s)||k.isEmpty(s.wght)||k.isEmpty(s.col))throw new Error("Error in syncWithBorderType : getCurrentBorderTypeOrAllValue must return an object formed : array( 'wght' => '1px', 'col' => '#000000' )");o=m(s.wght),r=_(s.wght),g(".sek-unit-wrapper",c).find('[data-sek-unit="'+o+'"]').trigger("click",{border_type_switched:!0}),c.find('.sek-ui-button[data-sek-unit="'+o+'"]').addClass("is-selected").attr("aria-pressed",!0),l.val(r).trigger("input",{border_type_switched:!0}),u.data("border_type_switched",!0),u.val(s.col).trigger("change"),u.data("border_type_switched",!1)};a.borderColor=new h.Value(k.isEmpty(r())?"#000000":r()),a.css_unit=new h.Value(k.isEmpty(o())?"px":p(o())),a.borderType=new h.Value("_all_"),l.val((i=a(),n=1,k.isObject(i)&&k.has(i,"_all_")&&k.isObject(i._all_)&&!k.isEmpty(i._all_.wght)&&(n=_(i._all_.wght)),n=parseInt(n,10),(!k.isNumber(n)||n<0)&&(h.errare("Error in borders input type for module : "+a.module.module_type+" the initial border width is invalid : "+n),n=1),n)),u.val(a.borderColor()),u.wpColorPicker({palettes:!0,width:1440<=window.innerWidth?271:251,change:function(e,t){g(this).val(t.color.toString()).trigger("colorpickerchange"),a.borderColor(t.color.toString(),{border_type_switched:!0===g(this).data("border_type_switched")})},clear:function(e,t){g(this).val("").trigger("colorpickerchange"),a.borderColor("")}}),a.css_unit.bind(function(e,t,i){(!k.isObject(i)||!0!==i.border_type_switched&&!0!==i.initializing_the_unit)&&l.trigger("input",i)}),a.borderColor.bind(function(e,t,i){(!k.isObject(i)||!0!==i.border_type_switched&&!0!==i.initializing_the_color)&&l.trigger("input",i)}),a.borderType.bind(function(e){try{s(e)}catch(e){h.errare("Error when firing syncWithBorderType for input type borders for module type "+a.module.module_type,e)}}),d.on("input",function(e){l.val(g(this).val()).trigger("input")}),l.on("input",function(e,t){var i,n=a.borderType()||"_all_",o=a.borderColor(),r=g(this).val()+p(a.css_unit()),s=g.extend(!0,{},f);(i=g.extend(!0,{},k.isObject(a())?a():s))[n]=g.extend(!0,{},i[n]||s[n]),k.isString(r)&&!k.isEmpty(r)&&(i[n].wght=r),i[n].col=o,(k.isEmpty(t)||k.isObject(t)&&!0!==t.border_type_switched)&&("_all_"===n&&k.each(a.cssBorderTypes,function(e){i=k.omit(i,e)}),a(i)),d.val(g(this).val())}),c.on("click","[data-sek-unit]",function(e,t){e.preventDefault(),c.find("[data-sek-unit]").removeClass("is-selected").attr("aria-pressed",!1),g(this).addClass("is-selected").attr("aria-pressed",!0),c.find("input[data-czrtype]").data("sek-unit",g(this).data("sek-unit")),a.css_unit(g(this).data("sek-unit"),t)}),c.on("click","[data-sek-border-type]",function(e,t){e.preventDefault(),c.find("[data-sek-border-type]").removeClass("is-selected").attr("aria-pressed",!1),g(this).addClass("is-selected").attr("aria-pressed",!0);var i="_all_";try{i=g(this).data("sek-border-type")}catch(e){h.errare("borders input type => error when attaching click event",e)}a.borderType(i,t)}),a.container.on("click",".sek-reset-button",function(e){var t=a.borderType()||"_all_",i=g.extend(!0,{},k.isObject(a())?a():{});k.isEmpty(i[t])||(i=k.omit(i,t),a(i),s(t))}),d.val(l.val()||0);try{s(a.borderType())}catch(e){h.errare("Error when firing syncWithBorderType for input type borders for module type "+a.module.module_type,e)}g('[data-sek-unit="'+a.css_unit()+'"]',c).trigger("click",{initializing_the_unit:!0})}})}(wp.customize,jQuery,_),function(m,f,h){m.czrInputMap=m.czrInputMap||{},f.extend(m.czrInputMap,{border_radius:function(e){var a=this,c=f(".sek-borders",a.container),l=c.find('input[type="number"]'),s=c.find('input[type="range"]'),d=function(e){return h.contains(["px","em","%"],e)||(m.errare("border_radius => error : invalid unit for input "+a.id,e),e="px"),e},u=function(e){return h.isEmpty(e)||!h.isString(e)?"16":e.replace(/px|em|%/g,"")},p=function(e){return h.isEmpty(e)||!h.isString(e)?"px":e.replace(/[0-9]|\.|,/g,"")},t=m.czr_sektions.getInputRegistrationParams(a.id,a.module.module_type),_=h.isEmpty(t)||h.isEmpty(t.default)?{}:t.default;a.cssRadiusTypes=["top_left","top_right","bottom_right","bottom_left"];var i,n,o=function(){var e=a(),t="px";return h.isObject(e)&&h.has(e,"_all_")&&(t=d(p(e._all_))),t},r=function(e){if(!h.contains(["_all_","top_left","top_right","bottom_right","bottom_left"],e))throw new Error("Error in syncWithRadiusType : the radius type must be one of those values '_all_', 'top_left', 'top_right', 'bottom_right', 'bottom_left', => radius type => "+e);var t=a(),i={},n=f.extend(!0,{},_);h.isObject(t)?i=f.extend(!0,{},t):h.isString(t)&&(i={_all_:"0px"});var o,r,s=function(e,t){var i,n=f.extend(!0,{},_);if(!h.has(n,"_all_"))throw new Error("Error when firing getCurrentRadiusTypeOrAllValue : the default value of the border_radius input must be php registered as an array");return i=h.isObject(e)&&h.has(e,"_all_")?e._all_:n._all_,h.has(e,t)?e[t]:i}(i=f.extend(n,i),e);if(h.isEmpty(s)||!h.isString(s))throw new Error("Error in syncWithRadiusType : getCurrentRadiusTypeOrAllValue must return a string like 3em");o=p(s),r=u(s),f(".sek-unit-wrapper",c).find('[data-sek-unit="'+o+'"]').trigger("click",{radius_type_switched:!0}),c.find('.sek-ui-button[data-sek-unit="'+o+'"]').addClass("is-selected").attr("aria-pressed",!0),l.val(r).trigger("input",{radius_type_switched:!0})};a.css_unit=new m.Value(h.isEmpty(o())?"px":d(o())),a.radiusType=new m.Value("_all_"),l.val((i=a(),n=0,h.isObject(i)&&h.has(i,"_all_")&&(n=u(i._all_)),n=parseInt(n,10),(!h.isNumber(n)||n<0)&&(m.errare("Error in border_radius input type for module : "+a.module.module_type+" the initial radius is invalid : "+n),n=0),n)),a.css_unit.bind(function(e,t,i){(!h.isObject(i)||!0!==i.radius_type_switched&&!0!==i.initializing_the_unit)&&l.trigger("input",i)}),a.radiusType.bind(function(e){try{r(e)}catch(e){m.errare("Error when firing syncWithRadiusType for input type border_radius for module type "+a.module.module_type,e)}}),s.on("input",function(e){l.val(f(this).val()).trigger("input")}),l.on("input",function(e,t){var i,n=a.radiusType()||"_all_",o=f(this).val()+d(a.css_unit()),r=f.extend(!0,{},_);(i=f.extend(!0,{},h.isObject(a())?a():r))[n]=f.extend(!0,{},i[n]||r[n]),h.isString(o)&&!h.isEmpty(o)&&(i[n]=o),(h.isEmpty(t)||h.isObject(t)&&!0!==t.radius_type_switched)&&("_all_"===n&&h.each(a.cssRadiusTypes,function(e){i=h.omit(i,e)}),a(i)),s.val(f(this).val())}),c.on("click","[data-sek-unit]",function(e,t){e.preventDefault(),c.find("[data-sek-unit]").removeClass("is-selected").attr("aria-pressed",!1),f(this).addClass("is-selected").attr("aria-pressed",!0),c.find("input[data-czrtype]").data("sek-unit",f(this).data("sek-unit")),a.css_unit(f(this).data("sek-unit"),t)}),c.on("click","[data-sek-radius-type]",function(e,t){e.preventDefault(),c.find("[data-sek-radius-type]").removeClass("is-selected").attr("aria-pressed",!1),f(this).addClass("is-selected").attr("aria-pressed",!0);var i="_all_";try{i=f(this).data("sek-radius-type")}catch(e){m.errare("border_radius input type => error when attaching click event",e)}a.radiusType(i,t)}),a.container.on("click",".sek-reset-button",function(e){var t=a.radiusType()||"_all_",i=f.extend(!0,{},h.isObject(a())?a():{});h.isEmpty(i[t])||(i=h.omit(i,t),a(i),r(t))}),s.val(l.val()||0);try{r(a.radiusType())}catch(e){m.errare("Error when firing syncWithRadiusType for input type border_radius for module type "+a.module.module_type,e)}f('[data-sek-unit="'+a.css_unit()+'"]',c).trigger("click",{initializing_the_unit:!0})}})}(wp.customize,jQuery,_),function(r,s,a){r.czrInputMap=r.czrInputMap||{},s.extend(r.czrInputMap,{buttons_choice:function(e){var n=this,o=s(".sek-button-choice-wrapper",n.container),t=o.find('input[type="number"]'),i=r.czr_sektions.getInputRegistrationParams(n.id,n.module.module_type);a.isEmpty(i)||a.isEmpty(i.default)||i.default;t.val(n()),o.on("click","[data-sek-choice]",function(e,t){var i;e.stopPropagation(),o.find("[data-sek-choice]").removeClass("is-selected").attr("aria-pressed",!1),s(this).addClass("is-selected").attr("aria-pressed",!0);try{i=s(this).data("sek-choice")}catch(e){r.errare("buttons_choice input type => error when attaching click event",e)}n(i)}),s('[data-sek-choice="'+n()+'"]',o).trigger("click",{initializing_the_unit:!0})}})}(wp.customize,jQuery,_),function(i,n,e){i.czrInputMap=i.czrInputMap||{},n.extend(i.czrInputMap,{reset_button:function(e){this.container.on("click","[data-sek-reset-scope]",function(e,t){if(e.stopPropagation(),"local"===n(this).data("sek-reset-scope"))try{i.czr_sektions.resetCollectionSetting()}catch(e){i.errare("reset_button => error when firing resetCollectionSetting() on click event",e)}})}})}(wp.customize,jQuery,_),function(t,o,r){t.czrModuleMap=t.czrModuleMap||{},o.extend(t.czrModuleMap,{sek_content_type_switcher_module:{crud:!1,name:t.czr_sektions.getRegisteredModuleProperty("sek_content_type_switcher_module","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:r.extend({id:"",title:""},t.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_content_type_switcher_module"))}}),t.czrInputMap=t.czrInputMap||{},o.extend(t.czrInputMap,{content_type_switcher:function(e){var i,n=this;if(!t.section.has(n.module.control.section()))throw new Error("api.czrInputMap.content_type_switcher => section not registered");i=t.section(n.module.control.section()),n.container.on("click","[data-sek-content-type]",function(e){e.preventDefault(),n.container.find("[data-sek-content-type]").removeClass("is-selected").attr("aria-pressed",!1),o(this).addClass("is-selected").attr("aria-pressed",!0),n.contentType(o(this).data("sek-content-type"))}),n.contentType=new t.Value,n.contentType.bind(function(t){n.container.find('[data-sek-content-type="'+n.contentType()+'"]').trigger("click"),r.each(i.controls(),function(e){r.isUndefined(e.content_type)||e.active(t===e.content_type)})}),n.contentType(n()),i.container.first().bind("sek-content-type-refreshed",function(e,t){n.contentType(t.content_type||"section")})}})}(wp.customize,jQuery,_),function(t,e,i){t.czrModuleMap=t.czrModuleMap||{},e.extend(t.czrModuleMap,{sek_module_picker_module:{crud:!1,name:t.czr_sektions.getRegisteredModuleProperty("sek_module_picker_module","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},t.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_module_picker_module"))}}),t.czrInputMap=t.czrInputMap||{},e.extend(t.czrInputMap,{module_picker:function(e){t.czr_sektions.trigger("sek-refresh-dragzones",{type:"module",input_container:this.container})}})}(wp.customize,jQuery,_),function(t,e,i){t.czrModuleMap=t.czrModuleMap||{},i.each(["sek_intro_sec_picker_module","sek_features_sec_picker_module","sek_column_layouts_sec_picker_module"],function(e){t.czrModuleMap[e]={crud:!1,name:t.czr_sektions.getRegisteredModuleProperty(e,"name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},t.czr_sektions.getDefaultItemModelFromRegisteredModuleData(e))}}),t.czrInputMap=t.czrInputMap||{},e.extend(t.czrInputMap,{section_picker:function(e){t.czr_sektions.trigger("sek-refresh-dragzones",{type:"preset_section",input_container:this.container})}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_level_anchor_module:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_level_anchor_module","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_level_anchor_module"))}})}(wp.customize,jQuery,_),function(s,e,a){var t={initialize:function(e,t){var i=this;i.inputConstructor=s.CZRInput.extend(i.CZRInputMths||{}),i.itemConstructor=s.CZRItem.extend(i.CZRItemConstructor||{}),s.CZRDynModule.prototype.initialize.call(i,e,t)},CZRInputMths:{setupSelect:function(){s.czr_sektions.setupSelectInput.call(this)}},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!a.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){s.errorLog("item.setInputVisibilityDeps() : "+e)}}),s.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var n=this,o=n.module,r=function(t,i){n.czr_Input(t).visible(i()),this.bind(function(e){n.czr_Input(t).visible(i())})};n.czr_Input.each(function(i){switch(i.id){case"bg-image":a.each(["bg-position","bg-attachment","bg-scale","bg-apply-overlay","bg-color-overlay","bg-opacity-overlay"],function(t){try{r.call(i,t,function(){var e=!1;switch(t){case"bg-color-overlay":case"bg-opacity-overlay":e=!a.isEmpty(i()+"")&&s.CZR_Helpers.isChecked(n.czr_Input("bg-apply-overlay")());break;default:e=!a.isEmpty(i()+"")}return e})}catch(e){s.errare(o.id+" => error in setInputVisibilityDeps",e)}});break;case"bg-apply-overlay":a.each(["bg-color-overlay","bg-opacity-overlay"],function(e){try{r.call(i,e,function(){return!a.isEmpty(n.czr_Input("bg-image")()+"")&&s.CZR_Helpers.isChecked(i())})}catch(e){s.errare(o.id+" => error in setInputVisibilityDeps",e)}})}})}}};s.czrModuleMap=s.czrModuleMap||{},e.extend(s.czrModuleMap,{sek_level_bg_module:{mthds:t,crud:!1,name:s.czr_sektions.getRegisteredModuleProperty("sek_level_bg_module","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:a.extend({id:"",title:""},s.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_level_bg_module"))}})}(wp.customize,jQuery,_),function(o,e,r){var t={initialize:function(e,t){var i=this;i.inputConstructor=o.CZRInput.extend(i.CZRInputMths||{}),i.itemConstructor=o.CZRItem.extend(i.CZRItemConstructor||{}),o.CZRDynModule.prototype.initialize.call(i,e,t)},CZRInputMths:{setupSelect:function(){o.czr_sektions.setupSelectInput.call(this)}},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!r.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){o.errorLog("item.setInputVisibilityDeps() : "+e)}}),o.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var n=this,i=n.module;n.czr_Input.each(function(t){switch(t.id){case"border-type":r.each(["borders"],function(e){try{(function(t,i){n.czr_Input(t).visible(i()),this.bind(function(e){n.czr_Input(t).visible(i())})}).call(t,e,function(){return"none"!==t()})}catch(e){o.errare(i.id+" => error in setInputVisibilityDeps",e)}})}})}}};o.czrModuleMap=o.czrModuleMap||{},e.extend(o.czrModuleMap,{sek_level_border_module:{mthds:t,crud:!1,name:o.czr_sektions.getRegisteredModuleProperty("sek_level_border_module","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:r.extend({id:"",title:""},o.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_level_border_module"))}})}(wp.customize,jQuery,_),function(i,e,n){var t={initialize:function(e,t){this.itemConstructor=i.CZRItem.extend(this.CZRItemConstructor||{}),i.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!n.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){i.errorLog("item.setInputVisibilityDeps() : "+e)}}),i.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var n=this;n.module;n.czr_Input.each(function(e){switch(e.id){case"use-custom-breakpoint":(function(t,i){n.czr_Input(t).visible(i()),this.bind(function(e){n.czr_Input(t).visible(i())})}).call(e,"custom-breakpoint",function(){return e()})}})}}};i.czrModuleMap=i.czrModuleMap||{},e.extend(i.czrModuleMap,{sek_level_breakpoint_module:{mthds:t,crud:!1,name:i.czr_sektions.getRegisteredModuleProperty("sek_level_breakpoint_module","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:n.extend({id:"",title:""},i.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_level_breakpoint_module"))}})}(wp.customize,jQuery,_),function(n,e,i){var t={initialize:function(e,t){var i=this;i.inputConstructor=n.CZRInput.extend(i.CZRInputMths||{}),i.itemConstructor=n.CZRItem.extend(i.CZRItemConstructor||{}),n.CZRDynModule.prototype.initialize.call(i,e,t)},CZRInputMths:{setupSelect:function(){n.czr_sektions.setupSelectInput.call(this)}},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!i.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){n.errorLog("item.setInputVisibilityDeps() : "+e)}}),n.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var n=this;n.module;n.czr_Input.each(function(e){switch(e.id){case"height-type":(function(t,i){n.czr_Input(t).visible(i()),this.bind(function(e){n.czr_Input(t).visible(i())})}).call(e,"custom-height",function(){return"custom"===e()})}})}}};n.czrModuleMap=n.czrModuleMap||{},e.extend(n.czrModuleMap,{sek_level_height_module:{mthds:t,crud:!1,name:n.czr_sektions.getRegisteredModuleProperty("sek_level_height_module","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},n.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_level_height_module"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_level_visibility_module:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_level_visibility_module","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_level_visibility_module"))}})}(wp.customize,jQuery,_),function(n,e,i){var t={initialize:function(e,t){var i=this;i.inputConstructor=n.CZRInput.extend(i.CZRInputMths||{}),i.itemConstructor=n.CZRItem.extend(i.CZRItemConstructor||{}),n.CZRDynModule.prototype.initialize.call(i,e,t)},CZRInputMths:{setupSelect:function(){n.czr_sektions.setupSelectInput.call(this)}},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!i.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){n.errorLog("item.setInputVisibilityDeps() : "+e)}}),n.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var n=this,t=(n.module,function(t,i){n.czr_Input(t).visible(i()),this.bind(function(e){n.czr_Input(t).visible(i())})});n.czr_Input.each(function(e){switch(e.id){case"width-type":t.call(e,"custom-width",function(){return"custom"===e()}),t.call(e,"h_alignment",function(){return"custom"===e()})}})}}};n.czrModuleMap=n.czrModuleMap||{},e.extend(n.czrModuleMap,{sek_level_width_module:{mthds:t,crud:!1,name:n.czr_sektions.getRegisteredModuleProperty("sek_level_width_module","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},n.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_level_width_module"))}})}(wp.customize,jQuery,_),function(n,e,i){var t={initialize:function(e,t){var i=this;i.inputConstructor=n.CZRInput.extend(i.CZRInputMths||{}),i.itemConstructor=n.CZRItem.extend(i.CZRItemConstructor||{}),n.CZRDynModule.prototype.initialize.call(i,e,t)},CZRInputMths:{setupSelect:function(){n.czr_sektions.setupSelectInput.call(this)}},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!i.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){n.errorLog("item.setInputVisibilityDeps() : "+e)}}),n.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var n=this,t=(n.module,function(t,i){n.czr_Input(t).visible(i()),this.bind(function(e){n.czr_Input(t).visible(i())})});n.czr_Input.each(function(e){switch(e.id){case"use-custom-outer-width":t.call(e,"outer-section-width",function(){return e()});break;case"use-custom-inner-width":t.call(e,"inner-section-width",function(){return e()})}})}}};n.czrModuleMap=n.czrModuleMap||{},e.extend(n.czrModuleMap,{sek_level_width_section:{mthds:t,crud:!1,name:n.czr_sektions.getRegisteredModuleProperty("sek_level_width_section","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},n.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_level_width_section"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_level_spacing_module:{mthds:"",crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_level_spacing_module","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_level_spacing_module"))}})}(wp.customize,jQuery,_),function(i,e,t){var n={initialize:function(e,t){this.inputConstructor=i.CZRInput.extend({setupSelect:function(){i.czr_sektions.setupSelectInput.call(this)}}),i.CZRDynModule.prototype.initialize.call(this,e,t)}};i.czrModuleMap=i.czrModuleMap||{},e.extend(i.czrModuleMap,{sek_local_template:{mthds:n,crud:!1,name:i.czr_sektions.getRegisteredModuleProperty("sek_local_template","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:t.extend({id:"",title:""},i.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_local_template"))}})}(wp.customize,jQuery,_),function(i,e,n){var t={initialize:function(e,t){this.inputConstructor=i.CZRInput.extend({setupSelect:function(){i.czr_sektions.setupSelectInput.call(this)}}),this.itemConstructor=i.CZRItem.extend(this.CZRItemConstructor||{}),i.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!n.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){i.errorLog("item.setInputVisibilityDeps() : "+e)}}),i.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var n=this,t=(n.module,function(t,i){n.czr_Input(t).visible(i()),this.bind(function(e){n.czr_Input(t).visible(i())})});n.czr_Input.each(function(e){switch(e.id){case"use-custom-outer-width":t.call(e,"outer-section-width",function(){return e()});break;case"use-custom-inner-width":t.call(e,"inner-section-width",function(){return e()})}})}}};i.czrModuleMap=i.czrModuleMap||{},e.extend(i.czrModuleMap,{sek_local_widths:{mthds:t,crud:!1,name:i.czr_sektions.getRegisteredModuleProperty("sek_local_widths","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:n.extend({id:"",title:""},i.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_local_widths"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_local_custom_css:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_local_custom_css","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_local_custom_css"))}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{sek_local_reset:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("sek_local_reset","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.extend({id:"",title:""},e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_local_reset"))}})}(wp.customize,jQuery,_),function(i,e,n){var t={initialize:function(e,t){this.inputConstructor=i.CZRInput.extend({setupSelect:function(){i.czr_sektions.setupSelectInput.call(this)}}),this.itemConstructor=i.CZRItem.extend(this.CZRItemConstructor||{}),i.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!n.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){i.errorLog("item.setInputVisibilityDeps() : "+e)}}),i.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var n=this;n.module;n.czr_Input.each(function(e){switch(e.id){case"use-custom-breakpoint":(function(t,i){n.czr_Input(t).visible(i()),this.bind(function(e){n.czr_Input(t).visible(i())})}).call(e,"global-custom-breakpoint",function(){return e()})}})}}};i.czrModuleMap=i.czrModuleMap||{},e.extend(i.czrModuleMap,{sek_global_breakpoint:{mthds:t,crud:!1,name:i.czr_sektions.getRegisteredModuleProperty("sek_global_breakpoint","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:n.extend({id:"",title:""},i.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_global_breakpoint"))}})}(wp.customize,jQuery,_),function(i,e,n){var t={initialize:function(e,t){this.inputConstructor=i.CZRInput.extend({setupSelect:function(){i.czr_sektions.setupSelectInput.call(this)}}),this.itemConstructor=i.CZRItem.extend(this.CZRItemConstructor||{}),i.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!n.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){i.errorLog("item.setInputVisibilityDeps() : "+e)}}),i.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var n=this,t=(n.module,function(t,i){n.czr_Input(t).visible(i()),this.bind(function(e){n.czr_Input(t).visible(i())})});n.czr_Input.each(function(e){switch(e.id){case"use-custom-outer-width":t.call(e,"outer-section-width",function(){return e()});break;case"use-custom-inner-width":t.call(e,"inner-section-width",function(){return e()})}})}}};i.czrModuleMap=i.czrModuleMap||{},e.extend(i.czrModuleMap,{sek_global_widths:{mthds:t,crud:!1,name:i.czr_sektions.getRegisteredModuleProperty("sek_global_widths","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:n.extend({id:"",title:""},i.czr_sektions.getDefaultItemModelFromRegisteredModuleData("sek_global_widths"))}})}(wp.customize,jQuery,_),function(r,e,s){var t={initialize:function(e,t){var i=this;i.inputConstructor=r.CZRInput.extend({setupSelect:function(){r.czr_sektions.setupSelectInput.call(this)}}),i.itemConstructor=r.CZRItem.extend(i.CZRItemConstructor||{}),r.CZRDynModule.prototype.initialize.call(i,e,t),i.bind("set_default_content_picker_options",function(e){return e.defaultContentPickerOption.defaultOption={title:'<span style="font-weight:bold">'+sektionsLocalizedData.i18n["Set a custom url"]+"</span>",type:"",type_label:"",object:"",id:"_custom_",url:""},e})},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!s.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){r.errorLog("item.setInputVisibilityDeps() : "+e)}}),r.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var n=this,t=n.module,o=function(t,i){n.czr_Input(t).visible(i()),this.bind(function(e){n.czr_Input(t).visible(i())})};n.czr_Input.each(function(i){switch(i.id){case"img":o.call(i,"img-size",function(){return!s.isEmpty(i()+"")&&s.isNumber(i())});break;case"link-to":s.each(["link-pick-url","link-custom-url","link-target"],function(t){try{o.call(i,t,function(){var e=!1;switch(t){case"link-custom-url":e="url"===i()&&"_custom_"==n.czr_Input("link-pick-url")().id;break;case"link-pick-url":e="url"===i();break;case"link-target":e="no-link"!==i()}return e})}catch(e){r.errare("Image module => error in setInputVisibilityDeps",e)}});break;case"link-pick-url":o.call(i,"link-custom-url",function(){return"_custom_"==i().id&&"url"==n.czr_Input("link-to")()});break;case"border-type":s.each(["borders"],function(e){try{o.call(i,e,function(){return"none"!==i()})}catch(e){r.errare(t.id+" => error in setInputVisibilityDeps",e)}});break;case"use_custom_width":s.each(["custom_width"],function(e){try{o.call(i,e,function(){return i()})}catch(e){r.errare("Button module => error in setInputVisibilityDeps",e)}})}})}}};r.czrModuleMap=r.czrModuleMap||{},e.extend(r.czrModuleMap,{czr_image_main_settings_child:{mthds:t,crud:!1,name:r.czr_sektions.getRegisteredModuleProperty("czr_image_main_settings_child","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:r.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_image_main_settings_child")}})}(wp.customize,jQuery,_),function(o,e,r){var t={initialize:function(e,t){this.inputConstructor=o.CZRInput.extend({setupSelect:function(){o.czr_sektions.setupSelectInput.call(this)}}),this.itemConstructor=o.CZRItem.extend(this.CZRItemConstructor||{}),o.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!r.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){o.errorLog("item.setInputVisibilityDeps() : "+e)}}),o.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var n=this,i=n.module;n.czr_Input.each(function(t){switch(t.id){case"border-type":r.each(["borders"],function(e){try{(function(t,i){n.czr_Input(t).visible(i()),this.bind(function(e){n.czr_Input(t).visible(i())})}).call(t,e,function(){return"none"!==t()})}catch(e){o.errare(i.id+" => error in setInputVisibilityDeps",e)}})}})}}};o.czrModuleMap=o.czrModuleMap||{},e.extend(o.czrModuleMap,{czr_image_borders_corners_child:{mthds:t,crud:!1,name:o.czr_sektions.getRegisteredModuleProperty("czr_image_borders_corners_child","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:o.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_image_borders_corners_child")}})}(wp.customize,jQuery,_),function(n,e,t){var i={initialize:function(e,t){this.inputConstructor=n.CZRInput.extend(this.CZRTextEditorInputMths||{}),n.CZRDynModule.prototype.initialize.call(this,e,t)},CZRTextEditorInputMths:{initialize:function(e,t){var i=this;"tiny_mce_editor"==i.type&&i.isReady.then(function(){i.container.find('[data-czr-action="open-tinymce-editor"]').trigger("click")}),n.CZRInput.prototype.initialize.call(i,e,t)},setupSelect:function(){n.czr_sektions.setupSelectInput.call(this)}}};n.czrModuleMap=n.czrModuleMap||{},e.extend(n.czrModuleMap,{czr_tinymce_child:{mthds:i,crud:!1,name:n.czr_sektions.getRegisteredModuleProperty("czr_tinymce_child","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:n.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_tinymce_child")}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{czr_simple_html_module:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("czr_simple_html_module","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_simple_html_module")}})}(wp.customize,jQuery,_),function(r,e,s){var t={initialize:function(e,t){this.inputConstructor=r.CZRInput.extend({setupSelect:function(){r.czr_sektions.setupSelectInput.call(this)}}),this.itemConstructor=r.CZRItem.extend(this.CZRFPItemConstructor||{}),r.CZRDynModule.prototype.initialize.call(this,e,t)},CZRFPItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!s.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){r.errorLog("item.setInputVisibilityDeps() : "+e)}}),r.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var n=this,o=(n.module,function(t,i){n.czr_Input(t).visible(i()),this.bind(function(e){n.czr_Input(t).visible(i())})});n.czr_Input.each(function(i){switch(i.id){case"img-type":s.each(["img-id","img-size"],function(t){try{o.call(i,t,function(){var e=!1;switch(t){case"img-id":e="custom"===i();break;default:e="none"!==i()}return e})}catch(e){r.errare("Featured pages module => error in setInputVisibilityDeps",e)}});break;case"content-type":s.each(["content-custom-text"],function(e){try{o.call(i,e,function(){return"custom"===i()})}catch(e){r.errare("Featured pages module => error in setInputVisibilityDeps",e)}});break;case"btn-display":s.each(["btn-custom-text"],function(e){try{o.call(i,e,function(){return i()})}catch(e){r.errare("Featured pages module => error in setInputVisibilityDeps",e)}})}})}}};r.czrModuleMap=r.czrModuleMap||{},e.extend(r.czrModuleMap,{czr_featured_pages_module:{mthds:t,crud:r.czr_sektions.getRegisteredModuleProperty("czr_featured_pages_module","is_crud"),hasPreItem:!1,refresh_on_add_item:!1,name:r.czr_sektions.getRegisteredModuleProperty("czr_featured_pages_module","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:r.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_featured_pages_module")}})}(wp.customize,jQuery,_),function(s,e,a){var t={initialize:function(e,t){var i=this;i.inputConstructor=s.CZRInput.extend({setupSelect:function(){s.czr_sektions.setupSelectInput.call(this)}}),i.itemConstructor=s.CZRItem.extend(i.CZRIconItemConstructor||{}),i.bind("set_default_content_picker_options",function(e){return e.defaultContentPickerOption.defaultOption={title:'<span style="font-weight:bold">'+sektionsLocalizedData.i18n["Set a custom url"]+"</span>",type:"",type_label:"",object:"",id:"_custom_",url:""},e}),s.CZRDynModule.prototype.initialize.call(i,e,t)},CZRIconItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!a.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){s.errorLog("item.setInputVisibilityDeps() : "+e)}}),s.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var n=this,o=n.module,r=function(t,i){n.czr_Input(t).visible(i()),this.bind(function(e){n.czr_Input(t).visible(i())})};n.czr_Input.each(function(i){switch(i.id){case"link-to":a.each(["link-pick-url","link-custom-url","link-target"],function(t){try{r.call(i,t,function(){var e=!1;switch(t){case"link-custom-url":e="url"==i()&&"_custom_"==n.czr_Input("link-pick-url")().id;break;default:e="url"==i()}return e})}catch(e){s.errare(o.module_type+" => error in setInputVisibilityDeps",e)}});break;case"link-pick-url":r.call(i,"link-custom-url",function(){return"_custom_"==i().id&&"url"==n.czr_Input("link-to")()});break;case"use_custom_color_on_hover":a.each(["color_hover"],function(e){try{r.call(i,e,function(){return i()})}catch(e){s.errare(o.module_type+" => error in setInputVisibilityDeps",e)}})}})}}};s.czrModuleMap=s.czrModuleMap||{},e.extend(s.czrModuleMap,{czr_icon_settings_child:{mthds:t,crud:!1,name:s.czr_sektions.getRegisteredModuleProperty("czr_icon_settings_child","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:s.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_icon_settings_child")}})}(wp.customize,jQuery,_),function(o,e,r){var t={initialize:function(e,t){this.inputConstructor=o.CZRInput.extend({setupSelect:function(){o.czr_sektions.setupSelectInput.call(this)}}),this.itemConstructor=o.CZRItem.extend(this.CZRItemConstructor||{}),o.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!r.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){o.errorLog("item.setInputVisibilityDeps() : "+e)}}),o.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var n=this,i=n.module;n.czr_Input.each(function(t){switch(t.id){case"border-type":r.each(["borders"],function(e){try{(function(t,i){n.czr_Input(t).visible(i()),this.bind(function(e){n.czr_Input(t).visible(i())})}).call(t,e,function(){return"none"!==t()})}catch(e){o.errare(i.id+" => error in setInputVisibilityDeps",e)}})}})}}};o.czrModuleMap=o.czrModuleMap||{},e.extend(o.czrModuleMap,{czr_icon_spacing_border_child:{mthds:t,crud:!1,name:o.czr_sektions.getRegisteredModuleProperty("czr_icon_spacing_border_child","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:o.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_icon_spacing_border_child")}})}(wp.customize,jQuery,_),function(i,e,t){var n={initialize:function(e,t){this.inputConstructor=i.CZRInput.extend(this.CZRHeadingInputMths||{}),i.CZRDynModule.prototype.initialize.call(this,e,t)},CZRHeadingInputMths:{setupSelect:function(){i.czr_sektions.setupSelectInput.call(this)}}};i.czrModuleMap=i.czrModuleMap||{},e.extend(i.czrModuleMap,{czr_heading_child:{mthds:n,crud:!1,name:i.czr_sektions.getRegisteredModuleProperty("czr_heading_child","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_heading_child")}})}(wp.customize,jQuery,_),function(i,e,t){var n={initialize:function(e,t){this.inputConstructor=i.CZRInput.extend(this.CZRHeadingInputMths||{}),i.CZRDynModule.prototype.initialize.call(this,e,t)},CZRHeadingInputMths:{setupSelect:function(){i.czr_sektions.setupSelectInput.call(this)}}};i.czrModuleMap=i.czrModuleMap||{},e.extend(i.czrModuleMap,{czr_heading_spacing_child:{mthds:n,crud:!1,name:i.czr_sektions.getRegisteredModuleProperty("czr_heading_spacing_child","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_heading_spacing_child")}})}(wp.customize,jQuery,_),function(i,e,t){var n={initialize:function(e,t){this.inputConstructor=i.CZRInput.extend(this.CZRDividerInputMths||{}),i.CZRDynModule.prototype.initialize.call(this,e,t)},CZRDividerInputMths:{setupSelect:function(){i.czr_sektions.setupSelectInput.call(this)}}};i.czrModuleMap=i.czrModuleMap||{},e.extend(i.czrModuleMap,{czr_divider_module:{mthds:n,crud:!1,name:i.czr_sektions.getRegisteredModuleProperty("czr_divider_module","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_divider_module")}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{czr_spacer_module:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("czr_spacer_module","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_spacer_module")}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{czr_map_module:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("czr_map_module","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_map_module")}})}(wp.customize,jQuery,_),function(o,e,r){var t={initialize:function(e,t){this.inputConstructor=o.CZRInput.extend({setupSelect:function(){o.czr_sektions.setupSelectInput.call(this)}}),this.itemConstructor=o.CZRItem.extend(this.CZRButtonItemConstructor||{}),o.CZRDynModule.prototype.initialize.call(this,e,t)},CZRButtonItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!r.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){o.errorLog("item.setInputVisibilityDeps() : "+e)}}),o.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var n=this,i=(n.module,function(t,i){n.czr_Input(t).visible(i()),this.bind(function(e){n.czr_Input(t).visible(i())})});n.czr_Input.each(function(t){switch(t.id){case"quote_design":r.each(["border_width_css","border_color_css"],function(e){try{i.call(t,e,function(){return"border-before"==t()})}catch(e){o.errare("Quote module => error in setInputVisibilityDeps",e)}}),r.each(["icon_color_css","icon_size_css"],function(e){try{i.call(t,e,function(){return"quote-icon-before"==t()})}catch(e){o.errare("Quote module => error in setInputVisibilityDeps",e)}})}})}}};o.czrModuleMap=o.czrModuleMap||{},e.extend(o.czrModuleMap,{czr_quote_design_child:{mthds:t,crud:!1,name:o.czr_sektions.getRegisteredModuleProperty("czr_quote_design_child","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:o.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_quote_design_child")}})}(wp.customize,jQuery,_),function(i,e,t){var n={initialize:function(e,t){this.inputConstructor=i.CZRInput.extend({setupSelect:function(){i.czr_sektions.setupSelectInput.call(this)}}),i.CZRDynModule.prototype.initialize.call(this,e,t)}};i.czrModuleMap=i.czrModuleMap||{},e.extend(i.czrModuleMap,{czr_quote_quote_child:{mthds:n,crud:!1,name:i.czr_sektions.getRegisteredModuleProperty("czr_quote_quote_child","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_quote_quote_child")}})}(wp.customize,jQuery,_),function(i,e,t){var n={initialize:function(e,t){this.inputConstructor=i.CZRInput.extend({setupSelect:function(){i.czr_sektions.setupSelectInput.call(this)}}),i.CZRDynModule.prototype.initialize.call(this,e,t)}};i.czrModuleMap=i.czrModuleMap||{},e.extend(i.czrModuleMap,{czr_quote_cite_child:{mthds:n,crud:!1,name:i.czr_sektions.getRegisteredModuleProperty("czr_quote_cite_child","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_quote_cite_child")}})}(wp.customize,jQuery,_),function(o,e,r){var t={initialize:function(e,t){var i=this;i.inputConstructor=o.CZRInput.extend({setupSelect:function(){o.czr_sektions.setupSelectInput.call(this)}}),i.itemConstructor=o.CZRItem.extend(i.CZRButtonItemConstructor||{}),i.bind("set_default_content_picker_options",function(e){return e.defaultContentPickerOption.defaultOption={title:'<span style="font-weight:bold">'+sektionsLocalizedData.i18n["Set a custom url"]+"</span>",type:"",type_label:"",object:"",id:"_custom_",url:""},e}),o.CZRDynModule.prototype.initialize.call(i,e,t)},CZRButtonItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!r.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){o.errorLog("item.setInputVisibilityDeps() : "+e)}}),o.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var n=this,e=(n.module,function(t,i){n.czr_Input(t).visible(i()),this.bind(function(e){n.czr_Input(t).visible(i())})});n.czr_Input.each(function(i){switch(i.id){case"link-to":r.each(["link-pick-url","link-custom-url","link-target"],function(t){try{e.call(i,t,function(){var e=!1;switch(t){case"link-custom-url":e="url"==i()&&"_custom_"==n.czr_Input("link-pick-url")().id;break;default:e="url"==i()}return e})}catch(e){o.errare("Button module => error in setInputVisibilityDeps",e)}});break;case"link-pick-url":e.call(i,"link-custom-url",function(){return"_custom_"==i().id&&"url"==n.czr_Input("link-to")()});break;case"icon":e.call(i,"icon-side",function(){return!r.isEmpty(i())})}})}}};o.czrModuleMap=o.czrModuleMap||{},e.extend(o.czrModuleMap,{czr_btn_content_child:{mthds:t,crud:!1,name:o.czr_sektions.getRegisteredModuleProperty("czr_btn_content_child","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:o.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_btn_content_child")}})}(wp.customize,jQuery,_),function(r,e,s){var t={initialize:function(e,t){this.inputConstructor=r.CZRInput.extend({setupSelect:function(){r.czr_sektions.setupSelectInput.call(this)}}),this.itemConstructor=r.CZRItem.extend(this.CZRButtonItemConstructor||{}),r.CZRDynModule.prototype.initialize.call(this,e,t)},CZRButtonItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!s.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){r.errorLog("item.setInputVisibilityDeps() : "+e)}}),r.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var n=this,i=n.module,o=function(t,i){n.czr_Input(t).visible(i()),this.bind(function(e){n.czr_Input(t).visible(i())})};n.czr_Input.each(function(t){switch(t.id){case"use_custom_bg_color_on_hover":s.each(["bg_color_hover"],function(e){try{o.call(t,e,function(){return t()})}catch(e){r.errare("Button module => error in setInputVisibilityDeps",e)}});break;case"border-type":s.each(["borders"],function(e){try{o.call(t,e,function(){return"none"!==t()})}catch(e){r.errare(i.id+" => error in setInputVisibilityDeps",e)}});break;case"use_box_shadow":s.each(["push_effect"],function(e){try{o.call(t,e,function(){return t()})}catch(e){r.errare("Button module => error in setInputVisibilityDeps",e)}})}})}}};r.czrModuleMap=r.czrModuleMap||{},e.extend(r.czrModuleMap,{czr_btn_design_child:{mthds:t,crud:!1,name:r.czr_sektions.getRegisteredModuleProperty("czr_btn_design_child","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:r.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_btn_design_child")}})}(wp.customize,jQuery,_),function(o,e,r){var t={initialize:function(e,t){this.inputConstructor=o.CZRInput.extend({setupSelect:function(){o.czr_sektions.setupSelectInput.call(this)}}),this.itemConstructor=o.CZRItem.extend(this.CZRItemConstructor||{}),o.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!r.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){o.errorLog("item.setInputVisibilityDeps() : "+e)}}),o.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var n=this,i=(n.module,function(t,i){n.czr_Input(t).visible(i()),this.bind(function(e){n.czr_Input(t).visible(i())})});n.czr_Input.each(function(t){switch(t.id){case"show_name_field":r.each(["name_field_label","name_field_required"],function(e){try{i.call(t,e,function(){return t()})}catch(e){o.errare(t.module.module_type+" => error in setInputVisibilityDeps",e)}});break;case"show_subject_field":r.each(["subject_field_label","subject_field_required"],function(e){try{i.call(t,e,function(){return t()})}catch(e){o.errare(t.module.module_type+" => error in setInputVisibilityDeps",e)}});break;case"show_message_field":r.each(["message_field_label","message_field_required"],function(e){try{i.call(t,e,function(){return t()})}catch(e){o.errare(t.module.module_type+" => error in setInputVisibilityDeps",e)}});break;case"link-pick-url":try{i.call(t,"link-custom-url",function(){return t()})}catch(e){o.errare(t.module.module_type+" => error in setInputVisibilityDeps",e)}}})}}};o.czrModuleMap=o.czrModuleMap||{},e.extend(o.czrModuleMap,{czr_simple_form_fields_child:{mthds:t,crud:!1,name:o.czr_sektions.getRegisteredModuleProperty("czr_simple_form_fields_child","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:o.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_simple_form_fields_child")}})}(wp.customize,jQuery,_),function(o,e,r){var t={initialize:function(e,t){this.inputConstructor=o.CZRInput.extend({setupSelect:function(){o.czr_sektions.setupSelectInput.call(this)}}),this.itemConstructor=o.CZRItem.extend(this.CZRItemConstructor||{}),o.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!r.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){o.errorLog("item.setInputVisibilityDeps() : "+e)}}),o.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var n=this,i=n.module;n.czr_Input.each(function(t){switch(t.id){case"border-type":r.each(["borders"],function(e){try{(function(t,i){n.czr_Input(t).visible(i()),this.bind(function(e){n.czr_Input(t).visible(i())})}).call(t,e,function(){return"none"!==t()})}catch(e){o.errare(i.id+" => error in setInputVisibilityDeps",e)}})}})}}};o.czrModuleMap=o.czrModuleMap||{},e.extend(o.czrModuleMap,{czr_simple_form_design_child:{mthds:t,crud:!1,name:o.czr_sektions.getRegisteredModuleProperty("czr_simple_form_design_child","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:o.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_simple_form_design_child")}})}(wp.customize,jQuery,_),function(o,e,r){var t={initialize:function(e,t){this.inputConstructor=o.CZRInput.extend({setupSelect:function(){o.czr_sektions.setupSelectInput.call(this)}}),this.itemConstructor=o.CZRItem.extend(this.CZRItemConstructor||{}),o.CZRDynModule.prototype.initialize.call(this,e,t)},CZRItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!r.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){o.errorLog("item.setInputVisibilityDeps() : "+e)}}),o.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var n=this,i=(n.module,function(t,i){n.czr_Input(t).visible(i()),this.bind(function(e){n.czr_Input(t).visible(i())})});n.czr_Input.each(function(t){switch(t.id){case"use_custom_bg_color_on_hover":r.each(["bg_color_hover"],function(e){try{i.call(t,e,function(){return t()})}catch(e){o.errare(t.module.module_type+" => error in setInputVisibilityDeps",e)}});break;case"use_box_shadow":r.each(["push_effect"],function(e){try{i.call(t,e,function(){return t()})}catch(e){o.errare(t.module.module_type+" => error in setInputVisibilityDeps",e)}})}})}}};o.czrModuleMap=o.czrModuleMap||{},e.extend(o.czrModuleMap,{czr_simple_form_button_child:{mthds:t,crud:!1,name:o.czr_sektions.getRegisteredModuleProperty("czr_simple_form_button_child","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:o.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_simple_form_button_child")}})}(wp.customize,jQuery,_),function(i,e,t){var n={initialize:function(e,t){this.inputConstructor=i.CZRInput.extend({setupSelect:function(){i.czr_sektions.setupSelectInput.call(this)}}),i.CZRDynModule.prototype.initialize.call(this,e,t)}};i.czrModuleMap=i.czrModuleMap||{},e.extend(i.czrModuleMap,{czr_simple_form_fonts_child:{mthds:n,crud:!1,name:i.czr_sektions.getRegisteredModuleProperty("czr_simple_form_fonts_child","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:i.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_simple_form_fonts_child")}})}(wp.customize,jQuery,_),function(e,t,i){e.czrModuleMap=e.czrModuleMap||{},t.extend(e.czrModuleMap,{czr_simple_form_submission_child:{crud:!1,name:e.czr_sektions.getRegisteredModuleProperty("czr_simple_form_submission_child","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:e.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_simple_form_submission_child")}})}(wp.customize,jQuery,_),function(r,e,s){var t={initialize:function(e,t){this.inputConstructor=r.CZRInput.extend({setupSelect:function(){r.czr_sektions.setupSelectInput.call(this)}}),this.itemConstructor=r.CZRItem.extend(this.CZRButtonItemConstructor||{}),r.CZRDynModule.prototype.initialize.call(this,e,t)},CZRButtonItemConstructor:{ready:function(){var t=this;t.inputCollection.bind(function(e){if(!s.isEmpty(e))try{t.setInputVisibilityDeps()}catch(e){r.errorLog("item.setInputVisibilityDeps() : "+e)}}),r.CZRItem.prototype.ready.call(t)},setInputVisibilityDeps:function(){var n=this,o=(n.module,function(t,i){n.czr_Input(t).visible(i()),this.bind(function(e){n.czr_Input(t).visible(i())})});n.czr_Input.each(function(i){switch(i.id){case"use_custom_bg_color_on_hover":s.each(["bg_color_hover"],function(e){try{o.call(i,e,function(){return i()})}catch(e){r.errare("Button module => error in setInputVisibilityDeps",e)}});break;case"use_box_shadow":s.each(["push_effect"],function(e){try{o.call(i,e,function(){return i()})}catch(e){r.errare("Button module => error in setInputVisibilityDeps",e)}});break;case"link-to":s.each(["link-pick-url","link-custom-url","link-target"],function(t){try{o.call(i,t,function(){var e=!1;switch(t){case"link-custom-url":e="url"==i()&&"_custom_"==n.czr_Input("link-pick-url")().id;break;default:e="url"==i()}return e})}catch(e){r.errare("Button module => error in setInputVisibilityDeps",e)}});break;case"link-pick-url":o.call(i,"link-custom-url",function(){return"_custom_"==i().id&&"url"==n.czr_Input("link-to")()})}})}}};r.czrModuleMap=r.czrModuleMap||{},e.extend(r.czrModuleMap,{czr_font_child:{mthds:t,crud:!1,name:r.czr_sektions.getRegisteredModuleProperty("czr_font_child","name"),has_mod_opt:!1,ready_on_section_expanded:!0,defaultItemModel:r.czr_sektions.getDefaultItemModelFromRegisteredModuleData("czr_font_child")}})}(wp.customize,jQuery,_);
|
assets/czr/sek/js/ccat-sek-preview.js
CHANGED
@@ -1,23 +1,15 @@
|
|
1 |
-
|
2 |
var SekPreviewPrototype = SekPreviewPrototype || {};
|
3 |
( function( api, $, _ ) {
|
4 |
$.extend( SekPreviewPrototype, {
|
5 |
initialize: function() {
|
6 |
var self = this;
|
7 |
-
|
8 |
-
// Set the skope_id
|
9 |
try { this.skope_id = _.findWhere( _wpCustomizeSettings.czr_new_skopes, { skope : 'local' }).skope_id; } catch( _er_ ) {
|
10 |
this.errare('Preview => error when storing the skope_id', _er_ );
|
11 |
return;
|
12 |
}
|
13 |
-
|
14 |
-
// Active UI
|
15 |
this.scheduleHighlightActiveLevel();
|
16 |
-
|
17 |
-
// The loading icon when a level is refreshed
|
18 |
self.setupLoader();
|
19 |
-
|
20 |
-
// DOM READY
|
21 |
$( function() {
|
22 |
self.setupSortable();
|
23 |
self.setupResizable();
|
@@ -26,15 +18,15 @@ var SekPreviewPrototype = SekPreviewPrototype || {};
|
|
26 |
|
27 |
self.schedulePanelMsgReactions();
|
28 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
},
|
30 |
-
|
31 |
-
// Hightlight the currently level in the preview, corresponding to the active ui in the panel
|
32 |
-
//
|
33 |
-
// When a new ui is generated, the activeLevelUI is set @see ::schedulePanelMsgReactions()
|
34 |
-
// When the level options are modidied ( 'sek-refresh-stylesheet', 'sek-refresh-level' ),
|
35 |
scheduleHighlightActiveLevel : function() {
|
36 |
var self = this;
|
37 |
-
// Stores the currently edited level
|
38 |
this.activeLevelUI = new api.Value('');
|
39 |
this.activeUIChangedRecently = new api.Value( false );
|
40 |
|
@@ -49,25 +41,13 @@ var SekPreviewPrototype = SekPreviewPrototype || {};
|
|
49 |
}
|
50 |
self.activeUIChangedRecently( Date.now() );
|
51 |
});
|
52 |
-
|
53 |
-
// apiParams : {
|
54 |
-
// action : 'sek-refresh-level',
|
55 |
-
// id : params.uiParams.id,
|
56 |
-
// level : params.uiParams.level
|
57 |
-
// },
|
58 |
-
// skope_id : api.czr_skopeBase.getSkopeProperty( 'skope_id' ),
|
59 |
_.each( [ 'sek-refresh-stylesheet', 'sek-refresh-level' ], function( msgId ) {
|
60 |
api.preview.bind( msgId, function( params ) {
|
61 |
self.activeUIChangedRecently( Date.now() );
|
62 |
});
|
63 |
});
|
64 |
-
|
65 |
-
|
66 |
-
// This api.Value() is updated with Date.now() when something just happened and false after 3000 ms of inactivity
|
67 |
-
// so we can always react to changes, and refresh the timeOut
|
68 |
this.activeUIChangedRecently.bind( function( hasChangedRecently ) {
|
69 |
var $newActiveLevel = $('[data-sek-id="' + self.activeLevelUI() +'"]');
|
70 |
-
// remove the highlight class if it was previously set to another level
|
71 |
if ( $('.sek-highlight-active-ui').length ) {
|
72 |
$('.sek-highlight-active-ui').removeClass('sek-highlight-active-ui');
|
73 |
}
|
@@ -86,47 +66,38 @@ var SekPreviewPrototype = SekPreviewPrototype || {};
|
|
86 |
var SekPreviewPrototype = SekPreviewPrototype || {};
|
87 |
( function( api, $, _ ) {
|
88 |
$.extend( SekPreviewPrototype, {
|
89 |
-
// Fired on Dom Ready, in ::initialize()
|
90 |
setupSortable: function() {
|
91 |
var self = this;
|
92 |
this.sortableDefaultParams = {
|
93 |
-
//forcePlaceholderSize: true,
|
94 |
-
//handle: '.fa-arrows-alt',<= set by level
|
95 |
placeholder: "sortable-placeholder",
|
96 |
over: function( event, ui ) {},
|
|
|
|
|
97 |
};
|
98 |
-
|
99 |
-
// SEKTIONS
|
100 |
-
// On dom ready
|
101 |
$('[data-sek-level="location"]').each( function() {
|
102 |
self.makeSektionsSortableInLocation( $(this).data('sek-id') );
|
103 |
});
|
104 |
-
|
105 |
-
// Schedule with delegation
|
106 |
$( 'body').on( 'sek-section-added sek-level-refreshed', '[data-sek-level="location"]', function( evt, params ) {
|
107 |
self.makeSektionsSortableInLocation( $(this).data('sek-id') );
|
108 |
});
|
109 |
-
|
110 |
-
// COLUMNS
|
111 |
-
// On dom ready
|
112 |
$('[data-sek-level="location"]').each( function() {
|
113 |
$(this).find( '[data-sek-level="section"]' ).each( function() {
|
114 |
self.makeColumnsSortableInSektion( $(this).data('sek-id') );
|
115 |
});
|
116 |
});
|
117 |
-
// Schedule with delegation
|
118 |
$('body').on( 'sek-columns-refreshed sek-section-added', '[data-sek-level="section"]', function( evt ) {
|
119 |
self.makeColumnsSortableInSektion( $(this).data('sek-id') );
|
120 |
});
|
121 |
-
|
122 |
-
|
123 |
-
|
|
|
|
|
124 |
$('[data-sek-level="location"]').each( function() {
|
125 |
$(this).find( '[data-sek-level="column"]' ).each( function() {
|
126 |
self.makeModulesSortableInColumn( $(this).data('sek-id') );
|
127 |
});
|
128 |
});
|
129 |
-
// Schedule with delegation
|
130 |
$('body').on( 'sek-modules-refreshed', '[data-sek-level="column"]', function() {
|
131 |
self.makeModulesSortableInColumn( $(this).data('sek-id') );
|
132 |
});
|
@@ -135,44 +106,11 @@ var SekPreviewPrototype = SekPreviewPrototype || {};
|
|
135 |
self.makeModulesSortableInColumn( $(this).data('sek-id') );
|
136 |
});
|
137 |
});
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
// $(this).sortable( _.extend( defaults, {
|
144 |
-
// handle : '.sek-move-nested-section',
|
145 |
-
// connectWith: ".sek-column-inner, [data-sek-level="location"]",
|
146 |
-
// start: function( event, ui ) {
|
147 |
-
// // store the startOrder
|
148 |
-
// $('[data-sek-level="location"]').children( '[data-sek-level="section"]' ).each( function() {
|
149 |
-
// startOrder.push( $(this).data('sek-id') );
|
150 |
-
// });
|
151 |
-
// //console.log('column moved from', from_sektion, ui );
|
152 |
-
// },
|
153 |
-
// stop : function( event, ui ) {
|
154 |
-
// newOrder = [];
|
155 |
-
// // Restrict to the direct children
|
156 |
-
// $('[data-sek-level="location"]').children( '[data-sek-level="section"]' ).each( function() {
|
157 |
-
// newOrder.push( $(this).data('sek-id') );
|
158 |
-
// });
|
159 |
-
|
160 |
-
// // api.preview.send( 'sek-move', {
|
161 |
-
// // id : ui.item.data('sek-id'),
|
162 |
-
// // level : 'section',
|
163 |
-
// // newOrder : newOrder
|
164 |
-
// // });
|
165 |
-
// }
|
166 |
-
// }));
|
167 |
-
// });
|
168 |
-
|
169 |
-
|
170 |
-
// <SORTABLE>
|
171 |
-
// $('.sek-sektion-inner').each( function() {
|
172 |
-
// $(this).sortable({
|
173 |
-
// connectWith: ".sek-sektion-inner"
|
174 |
-
// }).disableSelection();
|
175 |
-
// });
|
176 |
|
177 |
return this;
|
178 |
},//setupSortable()
|
@@ -198,8 +136,6 @@ var SekPreviewPrototype = SekPreviewPrototype || {};
|
|
198 |
$('body').addClass('sek-moving-section');
|
199 |
$sourceLocation = ui.item.closest('[data-sek-level="location"]');
|
200 |
from_location = $sourceLocation.data('sek-id');
|
201 |
-
|
202 |
-
// store the startOrder
|
203 |
$sourceLocation.children( '[data-sek-level="section"]' ).each( function() {
|
204 |
startOrder.push( $(this).data('sek-id') );
|
205 |
});
|
@@ -210,8 +146,6 @@ var SekPreviewPrototype = SekPreviewPrototype || {};
|
|
210 |
newOrder = [];
|
211 |
$targetLocation = ui.item.closest('[data-sek-level="location"]');
|
212 |
to_location = $targetLocation.data('sek-id');
|
213 |
-
|
214 |
-
// Restrict to the direct children
|
215 |
$targetLocation.children( '[data-sek-level="section"]' ).each( function() {
|
216 |
newOrder.push( $(this).data('sek-id') );
|
217 |
});
|
@@ -233,21 +167,83 @@ var SekPreviewPrototype = SekPreviewPrototype || {};
|
|
233 |
}));
|
234 |
});
|
235 |
},
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
// Instantiate sortable for a given column Id
|
240 |
makeColumnsSortableInSektion : function( sektionId ) {
|
241 |
var self = this,
|
242 |
defaults = $.extend( true, {}, self.sortableDefaultParams ),
|
243 |
-
$sortableCandidate = $( '[data-sek-id="' + sektionId + '"]').find('.sek-sektion-inner').first()
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
248 |
$sortableCandidate.sortable( _.extend( defaults, {
|
249 |
handle : '.sek-move-column',
|
250 |
connectWith: ".sek-sektion-inner",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
251 |
remove : function( event, ui ) {
|
252 |
$targetSektionCandidate = ui.item.closest('[data-sek-level="section"]');
|
253 |
if ( $targetSektionCandidate.length > 0 && $targetSektionCandidate.find('.sek-sektion-inner').first().children('[data-sek-level="column"]').length > 12 ) {
|
@@ -260,40 +256,51 @@ var SekPreviewPrototype = SekPreviewPrototype || {};
|
|
260 |
}
|
261 |
},
|
262 |
start: function( event, ui ) {
|
263 |
-
// Always reset startOrder and newOrder
|
264 |
startOrder = [];
|
265 |
newOrder = [];
|
266 |
-
|
267 |
-
//$('.sek-column-inner').css( {'min-height' : '20px'});
|
268 |
-
// Set source
|
269 |
from_sektion = ui.item.closest('[data-sek-level="section"]').data( 'sek-id');
|
270 |
-
// store the startOrder
|
271 |
ui.item.closest('[data-sek-level="section"]').find('.sek-sektion-inner').first().children( '[data-sek-level="column"]' ).each( function() {
|
272 |
startOrder.push( $(this).data('sek-id') );
|
273 |
});
|
|
|
|
|
274 |
if ( _.isEmpty( startOrder ) ) {
|
275 |
self.errare( 'column sortable => startOrder should not be empty' );
|
276 |
return;
|
277 |
}
|
278 |
-
//console.log('column moved from', from_sektion, ui );
|
279 |
},
|
280 |
|
281 |
stop : function( event, ui ) {
|
282 |
-
// set destination
|
283 |
$targetSektion = ui.item.closest('[data-sek-level="section"]');
|
284 |
to_sektion = $targetSektion.data( 'sek-id');
|
285 |
-
//console.log('module moved to', to_column, from_column );
|
286 |
$targetSektion.find('.sek-sektion-inner').first().children( '[data-sek-level="column"]' ).each( function() {
|
287 |
newOrder.push( $(this).data('sek-id') );
|
288 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
289 |
if ( _.isEmpty( newOrder ) ) {
|
290 |
self.errare( 'column sortable => newOrder should not be empty' );
|
291 |
return;
|
292 |
}
|
293 |
-
// console.log('ALORS SEKTIONS ?: ', to_sektion, from_sektion );
|
294 |
-
// console.log('ALORS ORDER ?: ', newOrder, startOrder);
|
295 |
-
|
296 |
-
// don't send anything if the source and target columns are the same, and the order is unchanged
|
297 |
if ( _.isEqual( newOrder, startOrder ) && to_sektion === from_sektion ) {
|
298 |
if ( sekPreviewLocalized.isDevMode ) {
|
299 |
self.errare( 'preview => makeModulesSortableInColumn => start and stop positions are identical' );
|
@@ -310,37 +317,25 @@ var SekPreviewPrototype = SekPreviewPrototype || {};
|
|
310 |
}
|
311 |
}));
|
312 |
},//self.makeColumnsSortableInSektion
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
// Instantiate sortable for a given column Id
|
318 |
makeModulesSortableInColumn : function( columnId ) {
|
319 |
var from_sektion, to_sektion, from_column, to_column, startOrder = [], newOrder = [], $targetSektion, $targetColumn, defaults;
|
320 |
var self = this;
|
321 |
defaults = $.extend( true, {}, self.sortableDefaultParams );
|
322 |
-
// Restrict to the .sek-column-inner for this very column id with first()
|
323 |
$( '[data-sek-id="' + columnId + '"]').find('.sek-column-inner').first().sortable( _.extend( defaults, {
|
324 |
handle : '.sek-move-module',
|
325 |
connectWith: ".sek-column-inner",
|
326 |
over : function( event, ui ) {
|
327 |
-
// Hide the module placeholder while overing, when the column is empty
|
328 |
-
// @see css rule .sek-sortable-overing > .sek-no-modules-column { display: none; }
|
329 |
$('[data-sek-level="location"]').find('.sek-sortable-overing').each( function() {
|
330 |
$(this).removeClass('sek-sortable-overing');
|
331 |
});
|
332 |
$( event.target ).addClass('sek-sortable-overing');
|
333 |
},
|
334 |
start: function( event, ui ) {
|
335 |
-
// Always reset startOrder and newOrder
|
336 |
startOrder = [];
|
337 |
newOrder = [];
|
338 |
$('body').addClass( 'sek-dragging-element' );
|
339 |
-
//$('.sek-column-inner').css( {'min-height' : '20px'});
|
340 |
-
// Set source
|
341 |
from_column = ui.item.closest('[data-sek-level="column"]').data( 'sek-id');
|
342 |
from_sektion = ui.item.closest('[data-sek-level="section"]').data( 'sek-id');
|
343 |
-
// store the startOrder
|
344 |
ui.item.closest('[data-sek-level="column"]').find('.sek-column-inner').first().children( '[data-sek-level="module"]' ).each( function() {
|
345 |
startOrder.push( $(this).data('sek-id') );
|
346 |
});
|
@@ -348,14 +343,12 @@ var SekPreviewPrototype = SekPreviewPrototype || {};
|
|
348 |
self.errare( 'makeModulesSortableInColumn => startOrder should not be empty' );
|
349 |
return;
|
350 |
}
|
351 |
-
//console.log('column moved from', from_sektion, ui );
|
352 |
},
|
353 |
|
354 |
stop : function( event, ui ) {
|
355 |
-
// set destination
|
356 |
$targetColumn = ui.item.closest('[data-sek-level="column"]');
|
357 |
to_column = $targetColumn.data( 'sek-id');
|
358 |
-
|
359 |
$targetColumn.find('.sek-column-inner').first().children( '[data-sek-id]' ).each( function() {
|
360 |
newOrder.push( $(this).data('sek-id') );
|
361 |
});
|
@@ -363,10 +356,6 @@ var SekPreviewPrototype = SekPreviewPrototype || {};
|
|
363 |
self.errare( 'makeModulesSortableInColumn => newOrder should not be empty' );
|
364 |
return;
|
365 |
}
|
366 |
-
// console.log('ALORS COLUMNS ?: ', to_column, from_column );
|
367 |
-
// console.log('ALORS ORDER ?: ', newOrder, startOrder);
|
368 |
-
|
369 |
-
// don't send anything if the source and target columns are the same, and the order is unchanged
|
370 |
if ( _.isEqual( newOrder, startOrder ) && to_column === from_column ) {
|
371 |
self.errare( 'preview => makeModulesSortableInColumn => start and stop positions are identical' );
|
372 |
return;
|
@@ -380,8 +369,6 @@ var SekPreviewPrototype = SekPreviewPrototype || {};
|
|
380 |
from_sektion : from_sektion,
|
381 |
to_sektion : ui.item.closest('[data-sek-level="section"]').data( 'sek-id')
|
382 |
});
|
383 |
-
|
384 |
-
// Clean some css classes
|
385 |
$('body').removeClass( 'sek-dragging-element' );
|
386 |
}
|
387 |
}));
|
@@ -391,24 +378,22 @@ var SekPreviewPrototype = SekPreviewPrototype || {};
|
|
391 |
var SekPreviewPrototype = SekPreviewPrototype || {};
|
392 |
( function( api, $, _ ) {
|
393 |
$.extend( SekPreviewPrototype, {
|
394 |
-
// Fired on Dom Ready, in ::initialize()
|
395 |
setupResizable : function() {
|
396 |
var self = this;
|
397 |
$('.sektion-wrapper').find( 'div[data-sek-level="section"]' ).each( function() {
|
398 |
self.maybeMakeColumnResizableInSektion.call( this );
|
399 |
});
|
400 |
-
// Delegate instantiation when a module is added ( => column re-rendered )
|
401 |
$('body').on(
|
402 |
-
'sek-modules-refreshed sek-columns-refreshed',
|
403 |
-
'
|
404 |
-
function(
|
405 |
-
|
|
|
|
|
406 |
}
|
407 |
);
|
408 |
return this;
|
409 |
},//setupResizable()
|
410 |
-
|
411 |
-
// this is the parent section jQuery object
|
412 |
maybeMakeColumnResizableInSektion : function() {
|
413 |
var self = this,
|
414 |
$parentSektion,
|
@@ -416,21 +401,16 @@ var SekPreviewPrototype = SekPreviewPrototype || {};
|
|
416 |
parentSektionWidth,
|
417 |
$resizedColumn,
|
418 |
resizedColumnWidthInPercent,
|
419 |
-
|
420 |
-
//calculate the number of column in this section, excluding the columns inside nested sections if any
|
421 |
colNumber,
|
422 |
$sisterColumn,
|
423 |
|
424 |
isLastColumn;
|
425 |
-
|
426 |
-
// We won't fire resizable for single column sektions
|
427 |
var $directColumnChildren = $(this).find('.sek-sektion-inner').first().children( 'div[data-sek-level="column"]' );
|
428 |
if ( 2 > $directColumnChildren.length )
|
429 |
return;
|
430 |
|
431 |
$directColumnChildren.each( function() {
|
432 |
$(this).resizable({
|
433 |
-
// handles: { 'e': '.ui-resizable-e', 'w': '.ui-resizable-w' },
|
434 |
resize : function( event, ui ) {
|
435 |
$('.sektion-wrapper').data('sek-resizing-columns', true );
|
436 |
},
|
@@ -438,10 +418,7 @@ var SekPreviewPrototype = SekPreviewPrototype || {};
|
|
438 |
$parentSektion = ui.element.closest('div[data-sek-level="section"]');
|
439 |
parentSektionId = $parentSektion.data('sek-id');
|
440 |
parentSektionWidth = $parentSektion.find('.sek-sektion-inner')[0].getBoundingClientRect().width;
|
441 |
-
//calculate the number of column in this section, excluding the columns inside nested sections if any
|
442 |
colNumber = $parentSektion.find('.sek-sektion-inner').first().children( 'div[data-sek-level="column"]' ).length;
|
443 |
-
|
444 |
-
// Resizable should not have been instantiated anyway
|
445 |
if ( 2 > colNumber )
|
446 |
return;
|
447 |
|
@@ -451,32 +428,19 @@ var SekPreviewPrototype = SekPreviewPrototype || {};
|
|
451 |
}
|
452 |
|
453 |
isLastColumn = $resizedColumn.index() + 1 == colNumber;
|
454 |
-
|
455 |
-
// Assomption : RTL user. LTR should be implemented also.
|
456 |
-
// If parent section has at least 2 columns, the sister column is the one on the right if not in last position. On the left if last.
|
457 |
$sisterColumn = isLastColumn ? $resizedColumn.prev() : $resizedColumn.next();
|
458 |
-
|
459 |
-
// Implement a global state value()
|
460 |
$('.sektion-wrapper').data('sek-resizing-columns', true );
|
461 |
-
|
462 |
-
// auto set to false after a moment.
|
463 |
_.delay( function() {
|
464 |
|
1 |
+
|
2 |
var SekPreviewPrototype = SekPreviewPrototype || {};
|
3 |
( function( api, $, _ ) {
|
4 |
$.extend( SekPreviewPrototype, {
|
5 |
initialize: function() {
|
6 |
var self = this;
|
|
|
|
|
7 |
try { this.skope_id = _.findWhere( _wpCustomizeSettings.czr_new_skopes, { skope : 'local' }).skope_id; } catch( _er_ ) {
|
8 |
this.errare('Preview => error when storing the skope_id', _er_ );
|
9 |
return;
|
10 |
}
|
|
|
|
|
11 |
this.scheduleHighlightActiveLevel();
|
|
|
|
|
12 |
self.setupLoader();
|
|
|
|
|
13 |
$( function() {
|
14 |
self.setupSortable();
|
15 |
self.setupResizable();
|
18 |
|
19 |
self.schedulePanelMsgReactions();
|
20 |
});
|
21 |
+
$('body').on('sek-columns-refreshed sek-modules-refreshed', function( evt, params ) {
|
22 |
+
if ( !_.isUndefined( params ) && !_.isUndefined( params.in_sektion ) && $('[data-sek-id="' + params.in_sektion +'"]').length > 0 ) {
|
23 |
+
var $updatedSektion = $('[data-sek-id="' + params.in_sektion +'"]');
|
24 |
+
$updatedSektion.toggleClass( 'sek-has-modules', $updatedSektion.find('[data-sek-level="module"]').length > 0 );
|
25 |
+
}
|
26 |
+
});
|
27 |
},
|
|
|
|
|
|
|
|
|
|
|
28 |
scheduleHighlightActiveLevel : function() {
|
29 |
var self = this;
|
|
|
30 |
this.activeLevelUI = new api.Value('');
|
31 |
this.activeUIChangedRecently = new api.Value( false );
|
32 |
|
41 |
}
|
42 |
self.activeUIChangedRecently( Date.now() );
|
43 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
_.each( [ 'sek-refresh-stylesheet', 'sek-refresh-level' ], function( msgId ) {
|
45 |
api.preview.bind( msgId, function( params ) {
|
46 |
self.activeUIChangedRecently( Date.now() );
|
47 |
});
|
48 |
});
|
|
|
|
|
|
|
|
|
49 |
this.activeUIChangedRecently.bind( function( hasChangedRecently ) {
|
50 |
var $newActiveLevel = $('[data-sek-id="' + self.activeLevelUI() +'"]');
|
|
|
51 |
if ( $('.sek-highlight-active-ui').length ) {
|
52 |
$('.sek-highlight-active-ui').removeClass('sek-highlight-active-ui');
|
53 |
}
|
66 |
var SekPreviewPrototype = SekPreviewPrototype || {};
|
67 |
( function( api, $, _ ) {
|
68 |
$.extend( SekPreviewPrototype, {
|
|
|
69 |
setupSortable: function() {
|
70 |
var self = this;
|
71 |
this.sortableDefaultParams = {
|
|
|
|
|
72 |
placeholder: "sortable-placeholder",
|
73 |
over: function( event, ui ) {},
|
74 |
+
cursorAt: { top:0, left: 0 },//@fixes https://github.com/presscustomizr/nimble-builder/issues/114
|
75 |
+
tolerance: "pointer",//@fixes https://github.com/presscustomizr/nimble-builder/issues/114
|
76 |
};
|
|
|
|
|
|
|
77 |
$('[data-sek-level="location"]').each( function() {
|
78 |
self.makeSektionsSortableInLocation( $(this).data('sek-id') );
|
79 |
});
|
|
|
|
|
80 |
$( 'body').on( 'sek-section-added sek-level-refreshed', '[data-sek-level="location"]', function( evt, params ) {
|
81 |
self.makeSektionsSortableInLocation( $(this).data('sek-id') );
|
82 |
});
|
|
|
|
|
|
|
83 |
$('[data-sek-level="location"]').each( function() {
|
84 |
$(this).find( '[data-sek-level="section"]' ).each( function() {
|
85 |
self.makeColumnsSortableInSektion( $(this).data('sek-id') );
|
86 |
});
|
87 |
});
|
|
|
88 |
$('body').on( 'sek-columns-refreshed sek-section-added', '[data-sek-level="section"]', function( evt ) {
|
89 |
self.makeColumnsSortableInSektion( $(this).data('sek-id') );
|
90 |
});
|
91 |
+
$( 'body').on( 'sek-level-refreshed', '[data-sek-level="location"]', function( evt, params ) {
|
92 |
+
$(this).find( '[data-sek-level="section"]' ).each( function() {
|
93 |
+
self.makeColumnsSortableInSektion( $(this).data('sek-id') );
|
94 |
+
});
|
95 |
+
});
|
96 |
$('[data-sek-level="location"]').each( function() {
|
97 |
$(this).find( '[data-sek-level="column"]' ).each( function() {
|
98 |
self.makeModulesSortableInColumn( $(this).data('sek-id') );
|
99 |
});
|
100 |
});
|
|
|
101 |
$('body').on( 'sek-modules-refreshed', '[data-sek-level="column"]', function() {
|
102 |
self.makeModulesSortableInColumn( $(this).data('sek-id') );
|
103 |
});
|
106 |
self.makeModulesSortableInColumn( $(this).data('sek-id') );
|
107 |
});
|
108 |
});
|
109 |
+
$( 'body').on( 'sek-level-refreshed', '[data-sek-level="location"]', function( evt, params ) {
|
110 |
+
$(this).find( '[data-sek-level="column"]' ).each( function() {
|
111 |
+
self.makeModulesSortableInColumn( $(this).data('sek-id') );
|
112 |
+
});
|
113 |
+
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
114 |
|
115 |
return this;
|
116 |
},//setupSortable()
|
136 |
$('body').addClass('sek-moving-section');
|
137 |
$sourceLocation = ui.item.closest('[data-sek-level="location"]');
|
138 |
from_location = $sourceLocation.data('sek-id');
|
|
|
|
|
139 |
$sourceLocation.children( '[data-sek-level="section"]' ).each( function() {
|
140 |
startOrder.push( $(this).data('sek-id') );
|
141 |
});
|
146 |
newOrder = [];
|
147 |
$targetLocation = ui.item.closest('[data-sek-level="location"]');
|
148 |
to_location = $targetLocation.data('sek-id');
|
|
|
|
|
149 |
$targetLocation.children( '[data-sek-level="section"]' ).each( function() {
|
150 |
newOrder.push( $(this).data('sek-id') );
|
151 |
});
|
167 |
}));
|
168 |
});
|
169 |
},
|
|
|
|
|
|
|
|
|
170 |
makeColumnsSortableInSektion : function( sektionId ) {
|
171 |
var self = this,
|
172 |
defaults = $.extend( true, {}, self.sortableDefaultParams ),
|
173 |
+
$sortableCandidate = $( '[data-sek-id="' + sektionId + '"]').find('.sek-sektion-inner').first(),
|
174 |
+
getCurrentAndNextColNumberClasses = function( args ) {
|
175 |
+
args = $.extend( { forTarget : true }, args || {} );
|
176 |
+
if ( ! _.isEmpty( $(this).data('_sortable_columns_css_classes_' ) ) )
|
177 |
+
return $(this).data('_sortable_columns_css_classes_' );
|
178 |
+
|
179 |
+
var $targetSektion = $(this).closest('[data-sek-level="section"]'),
|
180 |
+
$columnsInTargetSektion = $targetSektion.find('.sek-sektion-inner').first().children( '[data-sek-level="column"]' ),
|
181 |
+
currentColnumber = $columnsInTargetSektion.length,
|
182 |
+
currentColCSSSuffix = Math.floor( 100/currentColnumber );
|
183 |
+
var nextColNumber;
|
184 |
+
if ( true === args.forTarget ) {
|
185 |
+
nextColNumber = 12 < ( currentColnumber + 1 ) ? 12 : currentColnumber + 1;
|
186 |
+
} else {
|
187 |
+
nextColNumber = 1 > ( currentColnumber - 1 ) ? 1 : currentColnumber -1;
|
188 |
+
}
|
189 |
+
var nextColCSSSuffix = Math.floor( 100/nextColNumber ),
|
190 |
+
current_columns_css_class = 'sek-col-' + currentColCSSSuffix,
|
191 |
+
next_columns_css_class = 'sek-col-' + nextColCSSSuffix,
|
192 |
+
_classes_ = { current : current_columns_css_class , next : next_columns_css_class };
|
193 |
+
|
194 |
+
$(this).data('_sortable_columns_css_classes_', _classes_ );
|
195 |
+
return _classes_;
|
196 |
+
},
|
197 |
+
cleanOnStop = function() {
|
198 |
+
$( '[data-sek-level="section"]').find('.sek-sektion-inner').each( function() {
|
199 |
+
$(this).data( 'sek-is-sender', null ).data('_sortable_columns_css_classes_', null );
|
200 |
+
});
|
201 |
+
};
|
202 |
+
|
203 |
$sortableCandidate.sortable( _.extend( defaults, {
|
204 |
handle : '.sek-move-column',
|
205 |
connectWith: ".sek-sektion-inner",
|
206 |
+
over : function( event, ui ) {
|
207 |
+
var $targetSektion = $(this).closest('[data-sek-level="section"]'),
|
208 |
+
$columnsInTargetSektion = $targetSektion.find('.sek-sektion-inner').first().children( '[data-sek-level="column"]' ),
|
209 |
+
_classes_;
|
210 |
+
|
211 |
+
if ( true !== $(this).data('sek-is-sender' ) ) {
|
212 |
+
_classes_ = getCurrentAndNextColNumberClasses.call( $(this) );
|
213 |
+
if ( ! _.isEmpty( _classes_ ) ) {
|
214 |
+
$columnsInTargetSektion.each( function() {
|
215 |
+
$(this).removeClass( _classes_.current ).addClass( _classes_.next );
|
216 |
+
});
|
217 |
+
}
|
218 |
+
} else {
|
219 |
+
_classes_ = getCurrentAndNextColNumberClasses.call( $(this), { forTarget : false } );
|
220 |
+
if ( ! _.isEmpty( _classes_ ) ) {
|
221 |
+
$columnsInTargetSektion.each( function() {
|
222 |
+
$(this).addClass( _classes_.current ).removeClass( _classes_.next );
|
223 |
+
});
|
224 |
+
}
|
225 |
+
}
|
226 |
+
},
|
227 |
+
out : function( event, ui ) {
|
228 |
+
var $outedSektion = $(this).closest('[data-sek-level="section"]'),
|
229 |
+
$columnsInOutedSektion = $outedSektion.find('.sek-sektion-inner').first().children( '[data-sek-level="column"]' ),
|
230 |
+
_classes_;
|
231 |
+
if ( true !== $(this).data('sek-is-sender' ) ) {
|
232 |
+
_classes_ = getCurrentAndNextColNumberClasses.call( $(this) );
|
233 |
+
if ( ! _.isEmpty( _classes_ ) ) {
|
234 |
+
$columnsInOutedSektion.each( function() {
|
235 |
+
$(this).addClass( _classes_.current ).removeClass( _classes_.next );
|
236 |
+
});
|
237 |
+
}
|
238 |
+
} else {
|
239 |
+
_classes_ = getCurrentAndNextColNumberClasses.call( $(this), { forTarget : false } );
|
240 |
+
if ( ! _.isEmpty( _classes_ ) ) {
|
241 |
+
$columnsInOutedSektion.each( function() {
|
242 |
+
$(this).removeClass( _classes_.current ).addClass( _classes_.next );
|
243 |
+
});
|
244 |
+
}
|
245 |
+
}
|
246 |
+
},
|
247 |
remove : function( event, ui ) {
|
248 |
$targetSektionCandidate = ui.item.closest('[data-sek-level="section"]');
|
249 |
if ( $targetSektionCandidate.length > 0 && $targetSektionCandidate.find('.sek-sektion-inner').first().children('[data-sek-level="column"]').length > 12 ) {
|
256 |
}
|
257 |
},
|
258 |
start: function( event, ui ) {
|
|
|
259 |
startOrder = [];
|
260 |
newOrder = [];
|
|
|
|
|
|
|
261 |
from_sektion = ui.item.closest('[data-sek-level="section"]').data( 'sek-id');
|
|
|
262 |
ui.item.closest('[data-sek-level="section"]').find('.sek-sektion-inner').first().children( '[data-sek-level="column"]' ).each( function() {
|
263 |
startOrder.push( $(this).data('sek-id') );
|
264 |
});
|
265 |
+
|
266 |
+
$(this).data('sek-is-sender', true );
|
267 |
if ( _.isEmpty( startOrder ) ) {
|
268 |
self.errare( 'column sortable => startOrder should not be empty' );
|
269 |
return;
|
270 |
}
|
|
|
271 |
},
|
272 |
|
273 |
stop : function( event, ui ) {
|
|
|
274 |
$targetSektion = ui.item.closest('[data-sek-level="section"]');
|
275 |
to_sektion = $targetSektion.data( 'sek-id');
|
|
|
276 |
$targetSektion.find('.sek-sektion-inner').first().children( '[data-sek-level="column"]' ).each( function() {
|
277 |
newOrder.push( $(this).data('sek-id') );
|
278 |
});
|
279 |
+
|
280 |
+
var $stopSektion = $(this).closest('[data-sek-level="section"]'),
|
281 |
+
$columnsInstopSektion = $stopSektion.find('.sek-sektion-inner').first().children( '[data-sek-level="column"]' ),
|
282 |
+
_classes_;
|
283 |
+
if ( true !== $(this).data('sek-is-sender' ) ) {
|
284 |
+
_classes_ = getCurrentAndNextColNumberClasses.call( $(this) );
|
285 |
+
if ( ! _.isEmpty( _classes_ ) ) {
|
286 |
+
$columnsInstopSektion.each( function() {
|
287 |
+
$(this).removeClass( _classes_.current ).addClass( _classes_.next );
|
288 |
+
});
|
289 |
+
}
|
290 |
+
} else {
|
291 |
+
_classes_ = getCurrentAndNextColNumberClasses.call( $(this), { forTarget : false } );
|
292 |
+
if ( ! _.isEmpty( _classes_ ) ) {
|
293 |
+
$columnsInstopSektion.each( function() {
|
294 |
+
$(this).addClass( _classes_.current ).removeClass( _classes_.next );
|
295 |
+
});
|
296 |
+
}
|
297 |
+
}
|
298 |
+
cleanOnStop();
|
299 |
+
|
300 |
if ( _.isEmpty( newOrder ) ) {
|
301 |
self.errare( 'column sortable => newOrder should not be empty' );
|
302 |
return;
|
303 |
}
|
|
|
|
|
|
|
|
|
304 |
if ( _.isEqual( newOrder, startOrder ) && to_sektion === from_sektion ) {
|
305 |
if ( sekPreviewLocalized.isDevMode ) {
|
306 |
self.errare( 'preview => makeModulesSortableInColumn => start and stop positions are identical' );
|
317 |
}
|
318 |
}));
|
319 |
},//self.makeColumnsSortableInSektion
|
|
|
|
|
|
|
|
|
|
|
320 |
makeModulesSortableInColumn : function( columnId ) {
|
321 |
var from_sektion, to_sektion, from_column, to_column, startOrder = [], newOrder = [], $targetSektion, $targetColumn, defaults;
|
322 |
var self = this;
|
323 |
defaults = $.extend( true, {}, self.sortableDefaultParams );
|
|
|
324 |
$( '[data-sek-id="' + columnId + '"]').find('.sek-column-inner').first().sortable( _.extend( defaults, {
|
325 |
handle : '.sek-move-module',
|
326 |
connectWith: ".sek-column-inner",
|
327 |
over : function( event, ui ) {
|
|
|
|
|
328 |
$('[data-sek-level="location"]').find('.sek-sortable-overing').each( function() {
|
329 |
$(this).removeClass('sek-sortable-overing');
|
330 |
});
|
331 |
$( event.target ).addClass('sek-sortable-overing');
|
332 |
},
|
333 |
start: function( event, ui ) {
|
|
|
334 |
startOrder = [];
|
335 |
newOrder = [];
|
336 |
$('body').addClass( 'sek-dragging-element' );
|
|
|
|
|
337 |
from_column = ui.item.closest('[data-sek-level="column"]').data( 'sek-id');
|
338 |
from_sektion = ui.item.closest('[data-sek-level="section"]').data( 'sek-id');
|
|
|
339 |
ui.item.closest('[data-sek-level="column"]').find('.sek-column-inner').first().children( '[data-sek-level="module"]' ).each( function() {
|
340 |
startOrder.push( $(this).data('sek-id') );
|
341 |
});
|
343 |
self.errare( 'makeModulesSortableInColumn => startOrder should not be empty' );
|
344 |
return;
|
345 |
}
|
|
|
346 |
},
|
347 |
|
348 |
stop : function( event, ui ) {
|
|
|
349 |
$targetColumn = ui.item.closest('[data-sek-level="column"]');
|
350 |
to_column = $targetColumn.data( 'sek-id');
|
351 |
+
|
352 |
$targetColumn.find('.sek-column-inner').first().children( '[data-sek-id]' ).each( function() {
|
353 |
newOrder.push( $(this).data('sek-id') );
|
354 |
});
|
356 |
self.errare( 'makeModulesSortableInColumn => newOrder should not be empty' );
|
357 |
return;
|
358 |
}
|
|
|
|
|
|
|
|
|
359 |
if ( _.isEqual( newOrder, startOrder ) && to_column === from_column ) {
|
360 |
self.errare( 'preview => makeModulesSortableInColumn => start and stop positions are identical' );
|
361 |
return;
|
369 |
from_sektion : from_sektion,
|
370 |
to_sektion : ui.item.closest('[data-sek-level="section"]').data( 'sek-id')
|
371 |
});
|
|
|
|
|
372 |
$('body').removeClass( 'sek-dragging-element' );
|
373 |
}
|
374 |
}));
|
378 |
var SekPreviewPrototype = SekPreviewPrototype || {};
|
379 |
( function( api, $, _ ) {
|
380 |
$.extend( SekPreviewPrototype, {
|
|
|
381 |
setupResizable : function() {
|
382 |
var self = this;
|
383 |
$('.sektion-wrapper').find( 'div[data-sek-level="section"]' ).each( function() {
|
384 |
self.maybeMakeColumnResizableInSektion.call( this );
|
385 |
});
|
|
|
386 |
$('body').on(
|
387 |
+
'sek-level-refreshed sek-modules-refreshed sek-columns-refreshed',
|
388 |
+
'[data-sek-level="location"]',
|
389 |
+
function() {
|
390 |
+
$(this).find('[data-sek-level="section"]').each( function() {
|
391 |
+
self.maybeMakeColumnResizableInSektion.call( this );
|
392 |
+
});
|
393 |
}
|
394 |
);
|
395 |
return this;
|
396 |
},//setupResizable()
|
|
|
|
|
397 |
maybeMakeColumnResizableInSektion : function() {
|
398 |
var self = this,
|
399 |
$parentSektion,
|
401 |
parentSektionWidth,
|
402 |
$resizedColumn,
|
403 |
resizedColumnWidthInPercent,
|
|
|
|
|
404 |
colNumber,
|
405 |
$sisterColumn,
|
406 |
|
407 |
isLastColumn;
|
|
|
|
|
408 |
var $directColumnChildren = $(this).find('.sek-sektion-inner').first().children( 'div[data-sek-level="column"]' );
|
409 |
if ( 2 > $directColumnChildren.length )
|
410 |
return;
|
411 |
|
412 |
$directColumnChildren.each( function() {
|
413 |
$(this).resizable({
|
|
|
414 |
resize : function( event, ui ) {
|
415 |
$('.sektion-wrapper').data('sek-resizing-columns', true );
|
416 |
},
|
418 |
$parentSektion = ui.element.closest('div[data-sek-level="section"]');
|
419 |
parentSektionId = $parentSektion.data('sek-id');
|
420 |
parentSektionWidth = $parentSektion.find('.sek-sektion-inner')[0].getBoundingClientRect().width;
|
|
|
421 |
colNumber = $parentSektion.find('.sek-sektion-inner').first().children( 'div[data-sek-level="column"]' ).length;
|
|
|
|
|
422 |
if ( 2 > colNumber )
|
423 |
return;
|
424 |
|
428 |
}
|
429 |
|
430 |
isLastColumn = $resizedColumn.index() + 1 == colNumber;
|
|
|
|
|
|
|
431 |
$sisterColumn = isLastColumn ? $resizedColumn.prev() : $resizedColumn.next();
|
|
|
|
|
432 |
$('.sektion-wrapper').data('sek-resizing-columns', true );
|
|
|
|
|
433 |
_.delay( function() {
|
434 |
|