Version Description
- fixed : missing dropzones around nested sections
- fixed : reseting the spacing of a level was not changing the main setting.
- fixed : the tinyMceEditor not collapsing on 'sek-notify'
- improved : tinyMce text editor => attach callbacks on 'input' instead of 'change keyup'
- improved : module dynamic ui => print the module name instead of 'module' at the bottom
- improved : when clicking more than one time one the + ui icon, visually remind the user that a module should be dragged, with a light animation on the module picker container
- added : encapsulate the singular post / page content inside a dom element so we can generate a dynamic ui around it when customizing + add an edit link to the post or page
- added : introduced a loader overlay printed when the markup of any level being refreshed.
- added : a "+" icon to add module from the sections dynamic UI
=
Download this release
Release Info
Developer | nikeo |
Plugin | Nimble Page Builder |
Version | 1.0.3 |
Comparing to | |
See all releases |
Code changes from version 1.0.2 to 1.0.3
- assets/czr/sek/css/sek-preview.css +152 -113
- assets/czr/sek/css/sek-preview.min.css +1 -1
- assets/czr/sek/js/ccat-sek-control.js +53 -28
- assets/czr/sek/js/ccat-sek-control.min.js +1 -1
- assets/czr/sek/js/ccat-sek-preview.js +297 -58
- assets/czr/sek/js/ccat-sek-preview.min.js +1 -1
- inc/sektions/ccat-sektions.php +131 -63
- nimble-builder.php +2 -2
- readme.txt +22 -4
assets/czr/sek/css/sek-preview.css
CHANGED
@@ -49,7 +49,10 @@
|
|
49 |
.sek-dyn-ui-wrapper {
|
50 |
display: none;
|
51 |
position: absolute;
|
|
|
52 |
left: 0;
|
|
|
|
|
53 |
color: #fff;
|
54 |
background: rgba(190, 239, 255, 0);
|
55 |
border-radius: 4px;
|
@@ -192,10 +195,6 @@
|
|
192 |
}
|
193 |
.sek-section-dyn-ui {
|
194 |
border: 2px dotted #000;
|
195 |
-
bottom: 0;
|
196 |
-
left: 0;
|
197 |
-
top: 0px;
|
198 |
-
right: 0;
|
199 |
}
|
200 |
.sek-section > .sek-section-dyn-ui .sek-dyn-ui-inner {
|
201 |
top:0px;
|
@@ -222,10 +221,6 @@
|
|
222 |
}
|
223 |
.sek-column-dyn-ui {
|
224 |
border: 2px dotted #00b846;
|
225 |
-
bottom: 0px;
|
226 |
-
left: 0px;
|
227 |
-
top: 0px;
|
228 |
-
right: 0px;
|
229 |
font-size: 1rem;
|
230 |
}
|
231 |
.sek-column-dyn-ui .dev-level-data {
|
@@ -267,10 +262,6 @@
|
|
267 |
}
|
268 |
.sek-module-dyn-ui {
|
269 |
border: 1px dotted #0085ba;
|
270 |
-
bottom: 0px;
|
271 |
-
left: 0px;
|
272 |
-
top: 0px;
|
273 |
-
right: 0px;
|
274 |
font-size: 1rem;
|
275 |
}
|
276 |
|
@@ -296,6 +287,36 @@
|
|
296 |
|
297 |
|
298 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
299 |
|
300 |
|
301 |
|
@@ -370,14 +391,23 @@
|
|
370 |
cursor: pointer;
|
371 |
width: 50px;
|
372 |
height: 50px;
|
373 |
-
padding-top: 13px;
|
374 |
color: #0085ba;
|
375 |
color: rgba(0, 133, 186, 0.6);
|
376 |
border-radius: 30px;
|
377 |
-webkit-transition: all .20s ease;
|
378 |
-o-transition: all .20s ease;
|
379 |
transition: all .20s ease;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
380 |
}
|
|
|
381 |
.sek-module-drop-zone-for-first-module [data-sek-click-on="pick-module"]:hover {
|
382 |
-webkit-box-shadow: 0 2px 6px rgba(0,0,0,.2);
|
383 |
box-shadow: 0 2px 6px rgba(0,0,0,.2);
|
@@ -471,7 +501,7 @@
|
|
471 |
}
|
472 |
|
473 |
|
474 |
-
.sek-dragging [data-sek-location="between-modules"], .sek-dragging .sek-module-drop-zone-for-first-module {
|
475 |
background: #dcefff;
|
476 |
background: rgba(220, 239, 255, 0.84);
|
477 |
border:2px dotted #1d85bb;
|
@@ -758,120 +788,129 @@
|
|
758 |
|
759 |
|
760 |
|
|
|
|
|
|
|
|
|
761 |
|
762 |
|
763 |
|
764 |
-
/*
|
765 |
-
|
766 |
-
|
767 |
-
|
768 |
-
|
769 |
}
|
770 |
-
.
|
771 |
-
|
772 |
-
|
773 |
-
display: none;
|
774 |
-
}
|
775 |
-
.editor-block-settings-menu.is-visible {
|
776 |
-
-webkit-animation: fade-in .3s ease-out;
|
777 |
-
animation: fade-in .3s ease-out;
|
778 |
-
-webkit-animation-fill-mode: forwards;
|
779 |
-
animation-fill-mode: forwards;
|
780 |
}
|
781 |
-
.
|
782 |
-
|
783 |
-
|
784 |
-
|
785 |
-
|
786 |
-
|
787 |
-
|
788 |
-
|
|
|
|
|
789 |
}
|
790 |
|
791 |
|
792 |
-
.editor-block-settings-menu {
|
793 |
-
right: -30px;
|
794 |
-
padding-left: 2px;
|
795 |
-
display: none;
|
796 |
-
}
|
797 |
-
.editor-block-settings-menu {
|
798 |
-
display: -webkit-box;
|
799 |
-
display: -ms-flexbox;
|
800 |
-
display: flex;
|
801 |
-
-webkit-box-orient: vertical;
|
802 |
-
-webkit-box-direction: normal;
|
803 |
-
-ms-flex-direction: column;
|
804 |
-
flex-direction: column;
|
805 |
-
}
|
806 |
|
807 |
-
|
808 |
-
|
809 |
-
|
810 |
-
|
811 |
-
|
812 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
813 |
}
|
814 |
-
|
815 |
-
|
816 |
-
|
817 |
-
height: 36px;
|
818 |
-
top: 10px;
|
819 |
}
|
820 |
-
|
821 |
-
|
822 |
-
|
823 |
-
|
824 |
-
padding: 0;
|
825 |
-
width: 28px;
|
826 |
-
height: 28px;
|
827 |
-
border-radius: 4px;
|
828 |
}
|
829 |
-
|
830 |
-
|
831 |
-
|
832 |
-
|
833 |
-
text-decoration: none;
|
834 |
-
margin: 0;
|
835 |
-
border-radius: 0;
|
836 |
}
|
837 |
-
|
838 |
-
|
839 |
-
|
840 |
-
|
841 |
-
-webkit-box-align: center;
|
842 |
-
-ms-flex-align: center;
|
843 |
-
align-items: center;
|
844 |
-
padding: 8px;
|
845 |
-
margin: 0;
|
846 |
-
border: none;
|
847 |
-
background: none;
|
848 |
-
color: #555d66;
|
849 |
-
position: relative;
|
850 |
-
overflow: hidden;
|
851 |
-
text-indent: 4px;
|
852 |
}
|
853 |
-
|
854 |
-
|
855 |
-
|
856 |
-
|
857 |
}
|
858 |
-
|
859 |
-
|
860 |
-
|
861 |
-
|
862 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
863 |
}
|
864 |
-
|
865 |
-
|
866 |
-
|
867 |
}
|
868 |
|
869 |
-
|
870 |
-
|
871 |
-
|
872 |
-
|
873 |
-
|
874 |
-
|
875 |
-
|
876 |
-
outline: 1px solid #1d85bb;
|
877 |
-
}
|
49 |
.sek-dyn-ui-wrapper {
|
50 |
display: none;
|
51 |
position: absolute;
|
52 |
+
bottom: 0;
|
53 |
left: 0;
|
54 |
+
top: 0;
|
55 |
+
right: 0;
|
56 |
color: #fff;
|
57 |
background: rgba(190, 239, 255, 0);
|
58 |
border-radius: 4px;
|
195 |
}
|
196 |
.sek-section-dyn-ui {
|
197 |
border: 2px dotted #000;
|
|
|
|
|
|
|
|
|
198 |
}
|
199 |
.sek-section > .sek-section-dyn-ui .sek-dyn-ui-inner {
|
200 |
top:0px;
|
221 |
}
|
222 |
.sek-column-dyn-ui {
|
223 |
border: 2px dotted #00b846;
|
|
|
|
|
|
|
|
|
224 |
font-size: 1rem;
|
225 |
}
|
226 |
.sek-column-dyn-ui .dev-level-data {
|
262 |
}
|
263 |
.sek-module-dyn-ui {
|
264 |
border: 1px dotted #0085ba;
|
|
|
|
|
|
|
|
|
265 |
font-size: 1rem;
|
266 |
}
|
267 |
|
287 |
|
288 |
|
289 |
|
290 |
+
/* WP-CONTENT BLOCK UI */
|
291 |
+
.sek-wp-content-wrapper {
|
292 |
+
cursor: pointer;
|
293 |
+
position: relative;
|
294 |
+
}
|
295 |
+
.sek-wp-content-wrapper:hover {
|
296 |
+
outline: 2px dashed #036697;
|
297 |
+
}
|
298 |
+
|
299 |
+
.sek-wp-content-wrapper > .sek-dyn-ui-wrapper .sek-dyn-ui-location-type {
|
300 |
+
left: auto;
|
301 |
+
right: 0;
|
302 |
+
z-index: 1005;
|
303 |
+
background: #036697;
|
304 |
+
}
|
305 |
+
.sek-wp-content-wrapper .sek-dyn-ui-icons {
|
306 |
+
background-color: #036697;
|
307 |
+
}
|
308 |
+
.sek-wp-content-wrapper .sek-dyn-ui-inner {
|
309 |
+
top:0px;
|
310 |
+
z-index: 1005;
|
311 |
+
}
|
312 |
+
.sek-wp-content-dyn-ui {
|
313 |
+
/*border: 1px dotted #0085ba;*/
|
314 |
+
bottom: 0px;
|
315 |
+
left: 0px;
|
316 |
+
top: 0px;
|
317 |
+
right: 0px;
|
318 |
+
font-size: 1rem;
|
319 |
+
}
|
320 |
|
321 |
|
322 |
|
391 |
cursor: pointer;
|
392 |
width: 50px;
|
393 |
height: 50px;
|
|
|
394 |
color: #0085ba;
|
395 |
color: rgba(0, 133, 186, 0.6);
|
396 |
border-radius: 30px;
|
397 |
-webkit-transition: all .20s ease;
|
398 |
-o-transition: all .20s ease;
|
399 |
transition: all .20s ease;
|
400 |
+
-webkit-box-align: center;
|
401 |
+
-ms-flex-align: center;
|
402 |
+
align-items: center;
|
403 |
+
display: -webkit-box;
|
404 |
+
display: -ms-flexbox;
|
405 |
+
display: flex;
|
406 |
+
-webkit-box-pack: center;
|
407 |
+
-ms-flex-pack: center;
|
408 |
+
justify-content: center;
|
409 |
}
|
410 |
+
|
411 |
.sek-module-drop-zone-for-first-module [data-sek-click-on="pick-module"]:hover {
|
412 |
-webkit-box-shadow: 0 2px 6px rgba(0,0,0,.2);
|
413 |
box-shadow: 0 2px 6px rgba(0,0,0,.2);
|
501 |
}
|
502 |
|
503 |
|
504 |
+
.sek-dragging [data-sek-location="between-modules-and-nested-sections"], .sek-dragging .sek-module-drop-zone-for-first-module {
|
505 |
background: #dcefff;
|
506 |
background: rgba(220, 239, 255, 0.84);
|
507 |
border:2px dotted #1d85bb;
|
788 |
|
789 |
|
790 |
|
791 |
+
/* TINYMCE BLOCK OUTLINE */
|
792 |
+
.sek-module [data-sek-input-type="tiny_mce_editor"]:hover {
|
793 |
+
outline: 1px solid #1d85bb;
|
794 |
+
}
|
795 |
|
796 |
|
797 |
|
798 |
+
/* REFRESHING A LEVEL */
|
799 |
+
.sek-refreshing {
|
800 |
+
-webkit-filter: blur(1px);
|
801 |
+
filter: blur(1px);
|
802 |
+
/*position: absolute*/
|
803 |
}
|
804 |
+
.sek-level-clone {
|
805 |
+
position: absolute!important;
|
806 |
+
z-index: 10000;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
807 |
}
|
808 |
+
.sek-level-clone::before {
|
809 |
+
content: "";
|
810 |
+
display: block;
|
811 |
+
position: absolute;
|
812 |
+
top: 0;
|
813 |
+
left: 0;
|
814 |
+
right: 0;
|
815 |
+
bottom: 0;
|
816 |
+
background-color: #fff;
|
817 |
+
opacity: 0.5;
|
818 |
}
|
819 |
|
820 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
821 |
|
822 |
+
/* CSS LOADER */
|
823 |
+
@-webkit-keyframes sek-mr-loader {
|
824 |
+
0% {
|
825 |
+
-webkit-transform: scale(0.1);
|
826 |
+
transform: scale(0.1);
|
827 |
+
opacity: 1;
|
828 |
+
}
|
829 |
+
70% {
|
830 |
+
-webkit-transform: scale(1);
|
831 |
+
transform: scale(1);
|
832 |
+
opacity: 0.7;
|
833 |
+
}
|
834 |
+
100% {
|
835 |
+
opacity: 0.0;
|
836 |
+
}
|
837 |
+
}
|
838 |
+
|
839 |
+
@keyframes sek-mr-loader {
|
840 |
+
0% {
|
841 |
+
-webkit-transform: scale(0.1);
|
842 |
+
transform: scale(0.1);
|
843 |
+
opacity: 1;
|
844 |
+
}
|
845 |
+
70% {
|
846 |
+
-webkit-transform: scale(1);
|
847 |
+
transform: scale(1);
|
848 |
+
opacity: 0.7;
|
849 |
+
}
|
850 |
+
100% {
|
851 |
+
opacity: 0.0;
|
852 |
+
}
|
853 |
+
}
|
854 |
+
.sek-css-loader {
|
855 |
+
display: none;
|
856 |
+
width: 50px;
|
857 |
+
height: 50px;
|
858 |
+
/* background-color: #333;*/
|
859 |
+
position: absolute;
|
860 |
+
-webkit-transform: translate3d(-50%, -50%, 0);
|
861 |
+
transform: translate3d(-50%, -50%, 0);
|
862 |
+
top: 50%;
|
863 |
+
left: 50%;
|
864 |
}
|
865 |
+
|
866 |
+
.csstransforms3d .sek-css-loader {
|
867 |
+
display: block;
|
|
|
|
|
868 |
}
|
869 |
+
|
870 |
+
.sek-mr-loader > div:nth-child(0) {
|
871 |
+
-webkit-animation-delay: -0.8s;
|
872 |
+
animation-delay: -0.8s;
|
|
|
|
|
|
|
|
|
873 |
}
|
874 |
+
|
875 |
+
.sek-mr-loader > div:nth-child(1) {
|
876 |
+
-webkit-animation-delay: -0.6s;
|
877 |
+
animation-delay: -0.6s;
|
|
|
|
|
|
|
878 |
}
|
879 |
+
|
880 |
+
.sek-mr-loader > div:nth-child(2) {
|
881 |
+
-webkit-animation-delay: -0.4s;
|
882 |
+
animation-delay: -0.4s;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
883 |
}
|
884 |
+
|
885 |
+
.sek-mr-loader > div:nth-child(3) {
|
886 |
+
-webkit-animation-delay: -0.2s;
|
887 |
+
animation-delay: -0.2s;
|
888 |
}
|
889 |
+
|
890 |
+
.sek-mr-loader > div {
|
891 |
+
-webkit-animation-fill-mode: both;
|
892 |
+
animation-fill-mode: both;
|
893 |
+
position: absolute;
|
894 |
+
/*top: -4%;
|
895 |
+
left: -4%;*/
|
896 |
+
top: -0%;
|
897 |
+
left: -0%;
|
898 |
+
width: 100%;
|
899 |
+
height: 100%;
|
900 |
+
border-radius: 100%;
|
901 |
+
border: 2px solid #777;
|
902 |
+
-webkit-animation: sek-mr-loader 1.25s 0s infinite cubic-bezier(0.21, 0.53, 0.56, 0.8);
|
903 |
+
animation: sek-mr-loader 1.25s 0s infinite cubic-bezier(0.21, 0.53, 0.56, 0.8);
|
904 |
}
|
905 |
+
/*
|
906 |
+
html.no-js [id*=sek-slider-loader-wrapper] {
|
907 |
+
display: none;
|
908 |
}
|
909 |
|
910 |
+
.sek-slider-loader-wrapper {
|
911 |
+
height: 100%;
|
912 |
+
width: 100%;
|
913 |
+
position: absolute;
|
914 |
+
z-index: 99;
|
915 |
+
background: #ffffff;
|
916 |
+
}*/
|
|
|
|
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-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;left: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;bottom:0;left:0;top:0;right:0}.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;bottom:0;left:0;top:0;right:0;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;bottom:0;left:0;top:0;right:0;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-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;padding-top:13px;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}.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]{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}.editor-block-settings-menu{opacity:0;pointer-events:none}.editor-block-settings-menu{right:-30px;padding-left:2px;display:none}.editor-block-settings-menu.is-visible{-webkit-animation:fade-in .3s ease-out;animation:fade-in .3s ease-out;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}.editor-block-settings-menu{position:absolute;top:0;bottom:0;width:30px;cursor:move;cursor:-webkit-grab;cursor:grab}.editor-block-settings-menu{right:-30px;padding-left:2px;display:none}.editor-block-settings-menu{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.editor-block-settings-menu{z-index:80}.editor-block-settings-menu:before{border-left:1px solid #e2e4e7;left:0}.editor-block-settings-menu:before{content:"";position:absolute;height:36px;top:10px}.editor-block-settings-menu__toggle{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;padding:0;width:28px;height:28px;border-radius:4px}.components-button{background:0 0;border:none;outline:0;text-decoration:none;margin:0;border-radius:0}.components-icon-button{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding:8px;margin:0;border:none;background:0 0;color:#555d66;position:relative;overflow:hidden;text-indent:4px}.editor-block-settings-menu__toggle .dashicon{-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.components-icon-button:not(:disabled):active{outline:0;color:#191e23;-webkit-box-shadow:inset 0 0 0 1px #ccd0d4,inset 0 0 0 2px #fff;box-shadow:inset 0 0 0 1px #ccd0d4,inset 0 0 0 2px #fff}svg.dashicon{fill:currentColor;outline:0}.sek-module [data-sek-input-type=tiny_mce_editor]:hover{outline:1px solid #1d85bb}
|
1 |
+
.sektion-wrapper{min-height:50px}.sek-section{padding:23px 0 0;position:relative}.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: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)}
|
assets/czr/sek/js/ccat-sek-control.js
CHANGED
@@ -915,11 +915,16 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
915 |
|
916 |
// GENERATE UI ELEMENTS
|
917 |
'sek-pick-module' : function( params ) {
|
|
|
918 |
sendToPreview = true;
|
919 |
apiParams = {};
|
920 |
uiParams = {
|
921 |
action : 'sek-generate-draggable-candidates-picker-ui',
|
922 |
-
content_type : 'module'
|
|
|
|
|
|
|
|
|
923 |
};
|
924 |
return self.generateUI( uiParams );
|
925 |
},
|
@@ -928,7 +933,11 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
928 |
apiParams = {};
|
929 |
uiParams = {
|
930 |
action : 'sek-generate-draggable-candidates-picker-ui',
|
931 |
-
content_type : 'section'
|
|
|
|
|
|
|
|
|
932 |
};
|
933 |
return self.generateUI( uiParams );
|
934 |
},
|
@@ -1146,19 +1155,26 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
1146 |
|
1147 |
|
1148 |
|
1149 |
-
|
1150 |
-
|
1151 |
-
|
1152 |
// Possible content types :
|
1153 |
// 1) module
|
1154 |
// 2) preset_section
|
1155 |
case 'sek-generate-draggable-candidates-picker-ui' :
|
1156 |
var _id_ = sektionsLocalizedData.optPrefixForSektionsNotSaved + ( 'module' === params.content_type ? '_sek_draggable_modules_ui' : '_sek_draggable_sections_ui' );
|
1157 |
// Is the UI currently displayed the one that is being requested ?
|
1158 |
-
// If so,
|
1159 |
-
if ( self.
|
1160 |
api.control( _id_ ).focus({
|
1161 |
-
completeCallback : function() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1162 |
});
|
1163 |
break;
|
1164 |
}
|
@@ -1246,7 +1262,7 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
1246 |
}
|
1247 |
// Is the UI currently displayed the one that is being requested ?
|
1248 |
// If so, don't generate the ui again, simply focus on it
|
1249 |
-
if ( self.
|
1250 |
api.control( params.id ).focus({
|
1251 |
completeCallback : function() {}
|
1252 |
});
|
@@ -1365,7 +1381,7 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
1365 |
|
1366 |
// Is the UI currently displayed the one that is being requested ?
|
1367 |
// If so, don't generate the ui again, simply focus on the section
|
1368 |
-
if ( self.
|
1369 |
api.section( api.control( bgBorderOptionsSetId ).section() ).expanded( true );
|
1370 |
break;
|
1371 |
}
|
@@ -1539,7 +1555,7 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
1539 |
type : 'czr_module',//sekData.controlType,
|
1540 |
module_type : 'sek_spacing_module',
|
1541 |
section : params.id,
|
1542 |
-
priority :
|
1543 |
settings : { default : spacingOptionsSetId }
|
1544 |
}).done( function() {
|
1545 |
// synchronize the options with the main collection setting
|
@@ -1595,7 +1611,7 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
1595 |
type : 'czr_module',//sekData.controlType,
|
1596 |
module_type : 'sek_level_height_module',
|
1597 |
section : params.id,
|
1598 |
-
priority :
|
1599 |
settings : { default : heightOptionsSetId }
|
1600 |
}).done( function() {
|
1601 |
api.control( heightOptionsSetId ).focus({
|
@@ -1932,22 +1948,25 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
1932 |
// Is the UI currently displayed the one that is being requested ?
|
1933 |
// If so, don't generate the ui again
|
1934 |
// @return bool
|
1935 |
-
|
1936 |
var self = this,
|
1937 |
uiCandidate = _.filter( self.registered(), function( registered ) {
|
1938 |
-
return registered.id == uiElementId && 'control'
|
1939 |
-
})
|
|
|
|
|
|
|
|
|
1940 |
if ( _.isEmpty( uiCandidate ) ) {
|
1941 |
-
|
1942 |
} else {
|
1943 |
-
|
1944 |
// we should have only one uiCandidate with this very id
|
1945 |
if ( uiCandidate.length > 1 ) {
|
1946 |
-
|
1947 |
-
} else {
|
1948 |
-
return true;
|
1949 |
}
|
1950 |
}
|
|
|
1951 |
}
|
1952 |
});//$.extend()
|
1953 |
})( wp.customize, jQuery );//global sektionsLocalizedData, serverControlParams
|
@@ -3796,8 +3815,8 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
3796 |
drop_target_element : $dropTarget,
|
3797 |
location : $dropTarget.closest('[data-sek-level="location"]').data('sek-id'),
|
3798 |
// when inserted between modules
|
3799 |
-
before_module : $dropTarget.data('drop-zone-before-module'),
|
3800 |
-
after_module : $dropTarget.data('drop-zone-after-module'),
|
3801 |
|
3802 |
// When inserted between sections
|
3803 |
before_section : $dropTarget.data('drop-zone-before-section'),
|
@@ -3925,19 +3944,24 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
3925 |
spacing : function( input_options ) {
|
3926 |
var input = this,
|
3927 |
$wrapper = $('.sek-spacing-wrapper', input.container );
|
3928 |
-
|
3929 |
// Listen to user actions on the inputs and set the input value
|
3930 |
-
$wrapper.on( 'keyup mouseup', 'input[type="number"]', function(evt) {
|
3931 |
var _type_ = $(this).closest('[data-sek-spacing]').data('sek-spacing'),
|
3932 |
_newInputVal = $.extend( true, {}, _.isObject( input() ) ? input() : {} );
|
3933 |
_newInputVal[ _type_ ] = $(this).val();
|
3934 |
input( _newInputVal );
|
3935 |
});
|
|
|
|
|
3936 |
$wrapper.on( 'click', '.reset-spacing-wrap', function(evt) {
|
3937 |
evt.preventDefault();
|
3938 |
$wrapper.find('input[type="number"]').each( function() {
|
3939 |
-
$(this).val('')
|
3940 |
});
|
|
|
|
|
|
|
|
|
3941 |
});
|
3942 |
|
3943 |
// Synchronize on init
|
@@ -4414,7 +4438,8 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
4414 |
'sek-add-content-in-new-sektion',
|
4415 |
'sek-pick-module',
|
4416 |
'sek-edit-options',
|
4417 |
-
'sek-edit-module'
|
|
|
4418 |
], function( _evt_ ) {
|
4419 |
if ( 'sek-edit-module' != _evt_ ) {
|
4420 |
api.previewer.bind( _evt_, function() { api.sekEditorExpanded( false ); } );
|
@@ -4465,8 +4490,8 @@ var CZRSeksPrototype = CZRSeksPrototype || {};
|
|
4465 |
});
|
4466 |
|
4467 |
// TEXT EDITOR
|
4468 |
-
self.$editorTextArea.on( '
|
4469 |
-
//console.log('self.$editorTextArea
|
4470 |
try { api.control( api.sekEditorSynchronizedInput().control_id )
|
4471 |
.trigger( 'tinyMceEditorUpdated', {
|
4472 |
input_id : api.sekEditorSynchronizedInput().input_id,
|
915 |
|
916 |
// GENERATE UI ELEMENTS
|
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 |
},
|
933 |
apiParams = {};
|
934 |
uiParams = {
|
935 |
action : 'sek-generate-draggable-candidates-picker-ui',
|
936 |
+
content_type : 'section',
|
937 |
+
// <= 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'
|
938 |
+
// true by default, because this is the most common scenario ( when adding a section, a column ... )
|
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 |
},
|
1155 |
|
1156 |
|
1157 |
|
|
|
|
|
|
|
1158 |
// Possible content types :
|
1159 |
// 1) module
|
1160 |
// 2) preset_section
|
1161 |
case 'sek-generate-draggable-candidates-picker-ui' :
|
1162 |
var _id_ = sektionsLocalizedData.optPrefixForSektionsNotSaved + ( 'module' === params.content_type ? '_sek_draggable_modules_ui' : '_sek_draggable_sections_ui' );
|
1163 |
// Is the UI currently displayed the one that is being requested ?
|
1164 |
+
// If so, visually remind the user that a module should be dragged
|
1165 |
+
if ( self.isUIControlAlreadyRegistered( _id_ ) ) {
|
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 |
}
|
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 |
});
|
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 |
}
|
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
|
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({
|
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 |
}
|
1968 |
}
|
1969 |
+
return controlIsAlreadyRegistered;
|
1970 |
}
|
1971 |
});//$.extend()
|
1972 |
})( wp.customize, jQuery );//global sektionsLocalizedData, serverControlParams
|
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'),
|
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 |
_newInputVal[ _type_ ] = $(this).val();
|
3952 |
input( _newInputVal );
|
3953 |
});
|
3954 |
+
// Schedule a reset action
|
3955 |
+
// Note : this has to be done by device
|
3956 |
$wrapper.on( 'click', '.reset-spacing-wrap', function(evt) {
|
3957 |
evt.preventDefault();
|
3958 |
$wrapper.find('input[type="number"]').each( function() {
|
3959 |
+
$(this).val('');
|
3960 |
});
|
3961 |
+
// [] is the default value
|
3962 |
+
// we could have get it with api.czr_sektions.getDefaultItemModelFromRegisteredModuleData( 'sek_spacing_module' )
|
3963 |
+
// @see php spacing module registration
|
3964 |
+
input( [] );
|
3965 |
});
|
3966 |
|
3967 |
// Synchronize on init
|
4438 |
'sek-add-content-in-new-sektion',
|
4439 |
'sek-pick-module',
|
4440 |
'sek-edit-options',
|
4441 |
+
'sek-edit-module',
|
4442 |
+
'sek-notify'
|
4443 |
], function( _evt_ ) {
|
4444 |
if ( 'sek-edit-module' != _evt_ ) {
|
4445 |
api.previewer.bind( _evt_, function() { api.sekEditorExpanded( false ); } );
|
4490 |
});
|
4491 |
|
4492 |
// TEXT EDITOR
|
4493 |
+
self.$editorTextArea.on( 'input', function( evt ) {
|
4494 |
+
//console.log('self.$editorTextArea EVENT ', evt.type, self.$editorTextArea.val() );
|
4495 |
try { api.control( api.sekEditorSynchronizedInput().control_id )
|
4496 |
.trigger( 'tinyMceEditorUpdated', {
|
4497 |
input_id : api.sekEditorSynchronizedInput().input_id,
|
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"},o.generateUI(a)},"sek-pick-section":function(e){return s=!0,r={},a={action:"sek-generate-draggable-candidates-picker-ui",content_type:"section"},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.isUIElementCurrentlyGenerated(i)){g.control(i).focus({completeCallback:function(){}});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.isUIElementCurrentlyGenerated(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.isUIElementCurrentlyGenerated(c)||o.isUIElementCurrentlyGenerated(l)||o.isUIElementCurrentlyGenerated(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:1,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:10,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},isUIElementCurrentlyGenerated:function(t){var e=_.filter(this.registered(),function(e){return e.id==t&&"control"==e.what});if(_.isEmpty(e))return!1;if(1<e.length)throw new Error("generateUI => why is this control registered more than once ? => "+t);return!0}})}(wp.customize,jQuery);CZRSeksPrototype=CZRSeksPrototype||{};!function(H,G){G.extend(CZRSeksPrototype,{updateAPISetting:function($){var B=this,W=G.Deferred();return H(B.sekCollectionSettingId(),function(e){var t,i,n,o,r,a,s,c,l=e(),d=_.isObject(l)?G.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&&(C=t),$.after_section===e.id&&(C=t+1)}),t.collection=_.isArray(t.collection)?t.collection:[],t.collection.splice(C,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=G.extend(!0,{},g),k.collection=_.filter(k.collection,function(e){return e.id!=$.id})}h.collection=_.isArray(h.collection)?h.collection:[],r=G.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 E,I,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 M=B.getLevelModel($.from_sektion,d.collection);if(_.isEmpty(M)||"no_match"==M)throw new Error("updateAPISetting => "+$.action+" => missing source column");M.collection=_.isArray(M.collection)?M.collection:[],E=B.getLevelModel($.id,M.collection),I=G.extend(!0,{},E),M.collection=_.filter(M.collection,function(e){return e.id!=$.id}),_.each(M.collection,function(e){e.width=""})}D.collection=_.isArray(D.collection)?D.collection:[],r=G.extend(!0,[],D.collection),a=[],_.each($.newOrder,function(e){if($.from_sektion!=$.to_sektion&&e==I.id)a.push(I);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 C=0;n.collection=_.isArray(n.collection)?n.collection:[],_.each(n.collection,function(e,t){$.before_module===e.id&&(C=t),$.after_module===e.id&&(C=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(C,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=G.extend(!0,{},T),O.collection=_.filter(O.collection,function(e){return e.id!=$.id})}if(R.collection=_.isArray(R.collection)?R.collection:[],r=G.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");C=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&&(C=t),$.after_section===e.id&&(C=t+1)}),$.content_type){case"module":c=B.getModuleStartingValue($.content_id),t.collection.splice(C,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(C,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=G.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"),after_module:e.data("drop-zone-after-module"),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 n=this,i=c(".sek-spacing-wrapper",n.container);i.on("keyup mouseup",'input[type="number"]',function(e){var t=c(this).closest("[data-sek-spacing]").data("sek-spacing"),i=c.extend(!0,{},l.isObject(n())?n():{});i[t]=c(this).val(),n(i)}),i.on("click",".reset-spacing-wrap",function(e){e.preventDefault(),i.find('input[type="number"]').each(function(){c(this).val("").trigger("change")})}),l.isObject(n())&&l.each(n(),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"],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("change keyup",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(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,_=n<120||o<120,m=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")):(_||p)&&(m||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 n=this,i=c(".sek-spacing-wrapper",n.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(n())?n():{});i[t]=c(this).val(),n(i)}),i.on("click",".reset-spacing-wrap",function(e){e.preventDefault(),i.find('input[type="number"]').each(function(){c(this).val("")}),n([])}),l.isObject(n())&&l.each(n(),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,_);
|
assets/czr/sek/js/ccat-sek-preview.js
CHANGED
@@ -14,6 +14,9 @@ var SekPreviewPrototype = SekPreviewPrototype || {};
|
|
14 |
// Active UI
|
15 |
this.scheduleHighlightActiveLevel();
|
16 |
|
|
|
|
|
|
|
17 |
// DOM READY
|
18 |
$( function() {
|
19 |
self.setupSortable();
|
@@ -77,8 +80,6 @@ var SekPreviewPrototype = SekPreviewPrototype || {};
|
|
77 |
self.activeUIChangedRecently( false );
|
78 |
}, 3000 ) );
|
79 |
});
|
80 |
-
|
81 |
-
|
82 |
}
|
83 |
});//$.extend()
|
84 |
})( wp.customize, jQuery, _ );//global sekPreviewLocalized
|
@@ -102,7 +103,7 @@ var SekPreviewPrototype = SekPreviewPrototype || {};
|
|
102 |
});
|
103 |
|
104 |
// Schedule with delegation
|
105 |
-
$( 'body').on( 'sek-section-added sek-
|
106 |
self.makeSektionsSortableInLocation( $(this).data('sek-id') );
|
107 |
});
|
108 |
|
@@ -528,8 +529,7 @@ var SekPreviewPrototype = SekPreviewPrototype || {};
|
|
528 |
var tmpl,
|
529 |
level,
|
530 |
params,
|
531 |
-
$levelEl
|
532 |
-
isFadingOut = false;//stores ths status of 200 ms fading out. => will let us know if we can print again when moving the mouse fast back and forth between two levels.
|
533 |
|
534 |
// Level's UI icons with delegation
|
535 |
$('body').on( 'mouseenter', '[data-sek-level]', function( evt ) {
|
@@ -543,7 +543,7 @@ var SekPreviewPrototype = SekPreviewPrototype || {};
|
|
543 |
$levelEl = $(this);
|
544 |
|
545 |
// stop here if the .sek-dyn-ui-wrapper is already printed for this level AND is not being faded out.
|
546 |
-
if ( $levelEl.children('.sek-dyn-ui-wrapper').length > 0 &&
|
547 |
return;
|
548 |
|
549 |
params = {
|
@@ -567,7 +567,10 @@ var SekPreviewPrototype = SekPreviewPrototype || {};
|
|
567 |
});
|
568 |
break;
|
569 |
case 'module' :
|
570 |
-
|
|
|
|
|
|
|
571 |
break;
|
572 |
}
|
573 |
// don't display the column and module ui when resizing columns
|
@@ -578,24 +581,56 @@ var SekPreviewPrototype = SekPreviewPrototype || {};
|
|
578 |
tmpl = self.parseTemplate( '#sek-dyn-ui-tmpl-' + level );
|
579 |
$.when( $(this).prepend( tmpl( params ) ) ).done( function() {
|
580 |
$levelEl.find('.sek-dyn-ui-wrapper').stop( true, true ).fadeIn( {
|
581 |
-
|
582 |
-
|
583 |
} );
|
584 |
});
|
585 |
|
586 |
}).on( 'mouseleave', '[data-sek-level]', function( evt ) {
|
587 |
-
|
588 |
-
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
|
|
|
|
|
|
|
596 |
});
|
597 |
|
598 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
599 |
|
600 |
// Add content button between sections
|
601 |
// <script type="text/html" id="sek-tmpl-add-content-button">
|
@@ -758,11 +793,16 @@ var SekPreviewPrototype = SekPreviewPrototype || {};
|
|
758 |
clickedOn = 'addSektion';
|
759 |
} else if ( $el.hasClass('sek-to-json') ) {
|
760 |
clickedOn = 'sekToJson';
|
|
|
|
|
|
|
|
|
761 |
} else {
|
762 |
clickedOn = 'inactiveZone';
|
763 |
}
|
764 |
|
765 |
-
|
|
|
766 |
|
767 |
switch( clickedOn ) {
|
768 |
case 'addContentButton' :
|
@@ -793,10 +833,11 @@ var SekPreviewPrototype = SekPreviewPrototype || {};
|
|
793 |
throw new Error( 'ERROR => sek-front-preview => No valid level id found' );
|
794 |
}
|
795 |
self._send_( $el, {
|
796 |
-
|
797 |
-
|
798 |
-
|
799 |
-
|
|
|
800 |
});
|
801 |
break;
|
802 |
case 'moduleWrapper' :
|
@@ -830,16 +871,33 @@ var SekPreviewPrototype = SekPreviewPrototype || {};
|
|
830 |
case 'sekToJson' :
|
831 |
api.preview.send( 'sek-to-json', { id : _id } );
|
832 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
833 |
case 'inactiveZone' :
|
834 |
api.preview.send( 'sek-click-on-inactive-zone');//<= for example, collapses the tinyMce editor if expanded
|
835 |
//self._send_( $el, { action : 'pick-module' } );
|
836 |
break;
|
837 |
}
|
838 |
-
})
|
|
|
839 |
},//scheduleUserReactions()
|
840 |
|
841 |
|
842 |
_send_ : function( $el, params ) {
|
|
|
843 |
api.preview.send( 'sek-' + params.action, {
|
844 |
location : params.location,
|
845 |
level : params.level,
|
@@ -848,13 +906,94 @@ var SekPreviewPrototype = SekPreviewPrototype || {};
|
|
848 |
in_column : $el.closest('div[data-sek-level="column"]').length > 0 ? $el.closest('div[data-sek-level="column"]').data( 'sek-id') : '',
|
849 |
in_sektion : $el.closest('div[data-sek-level="section"]').length > 0 ? $el.closest('div[data-sek-level="section"]').data( 'sek-id') : '',
|
850 |
clicked_input_type : $el.closest('div[data-sek-input-type]').length > 0 ? $el.closest('div[data-sek-input-type]').data('sek-input-type') : '',
|
851 |
-
clicked_input_id : $el.closest('div[data-sek-input-id]').length > 0 ? $el.closest('div[data-sek-input-id]').data('sek-input-id') : ''
|
|
|
852 |
});
|
853 |
}
|
854 |
});//$.extend()
|
855 |
})( wp.customize, jQuery, _ );
|
856 |
//global sekPreviewLocalized
|
857 |
var SekPreviewPrototype = SekPreviewPrototype || {};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
858 |
( function( api, $, _ ) {
|
859 |
$.extend( SekPreviewPrototype, {
|
860 |
// Fired in ::initialize()
|
@@ -868,36 +1007,46 @@ var SekPreviewPrototype = SekPreviewPrototype || {};
|
|
868 |
'sek-add-content-in-new-sektion' : 'ajaxAddSektion',
|
869 |
'sek-add-column' : 'ajaxRefreshColumns',
|
870 |
'sek-add-module' : 'ajaxRefreshModulesAndNestedSections',
|
|
|
|
|
|
|
|
|
871 |
'sek-remove' : function( params ) {
|
872 |
var removeCandidateId = params.apiParams.id,
|
873 |
-
$candidateEl = $('div[data-sek-id="' + removeCandidateId + '"]' )
|
|
|
874 |
switch ( params.apiParams.action ) {
|
875 |
case 'sek-remove-section' :
|
876 |
-
//
|
|
|
|
|
|
|
|
|
877 |
if ( true === params.apiParams.is_nested ) {
|
878 |
-
self.ajaxRefreshModulesAndNestedSections( params );
|
879 |
} else {
|
880 |
if ( _.isEmpty( removeCandidateId ) || 1 > $candidateEl.length ) {
|
881 |
self.errare( 'reactToPanelMsg => sek-remove => invalid candidate id => ', removeCandidateId );
|
882 |
}
|
883 |
-
$(
|
|
|
|
|
|
|
884 |
}
|
885 |
//console.log( params.apiParams.action, params );
|
886 |
//self.ajaxRefreshModulesAndNestedSections( params );
|
887 |
break;
|
888 |
case 'sek-remove-column' :
|
889 |
-
|
890 |
-
self.ajaxRefreshColumns( params );
|
891 |
break;
|
892 |
case 'sek-remove-module' :
|
893 |
-
|
894 |
-
self.ajaxRefreshModulesAndNestedSections( params );
|
895 |
break;
|
896 |
default :
|
897 |
-
|
898 |
break;
|
899 |
}
|
900 |
-
|
|
|
901 |
},
|
902 |
|
903 |
'sek-duplicate' : function( params ) {
|
@@ -930,7 +1079,11 @@ var SekPreviewPrototype = SekPreviewPrototype || {};
|
|
930 |
// id : params.id
|
931 |
// }
|
932 |
'sek-refresh-level' : function( params ) {
|
933 |
-
|
|
|
|
|
|
|
|
|
934 |
skope_id : params.skope_id,
|
935 |
action : 'sek_get_content',
|
936 |
id : params.apiParams.id,
|
@@ -938,6 +1091,7 @@ var SekPreviewPrototype = SekPreviewPrototype || {};
|
|
938 |
sek_action : params.apiParams.action
|
939 |
}).fail( function( _r_ ) {
|
940 |
self.errare( 'ERROR reactToPanelMsg => sek-refresh-level => ' , _r_ );
|
|
|
941 |
}).done( function( _r_ ) {
|
942 |
var placeholderHtml = '<span class="sek-placeholder" data-sek-placeholder-for="' + params.apiParams.id + '"></span>',
|
943 |
$currentLevelEl = $( 'div[data-sek-id="' + params.apiParams.id + '"]' );
|
@@ -951,13 +1105,12 @@ var SekPreviewPrototype = SekPreviewPrototype || {};
|
|
951 |
$placeHolder.after( _r_.data );
|
952 |
$placeHolder.remove();
|
953 |
|
954 |
-
|
955 |
-
|
|
|
956 |
});
|
957 |
},
|
958 |
|
959 |
-
//'sek-set-level-options' : 'ajaxRefreshStylesheet',
|
960 |
-
'sek-refresh-stylesheet' : 'ajaxRefreshStylesheet',
|
961 |
|
962 |
|
963 |
|
@@ -1058,7 +1211,6 @@ var SekPreviewPrototype = SekPreviewPrototype || {};
|
|
1058 |
}
|
1059 |
},
|
1060 |
|
1061 |
-
'sek-resize-columns' : 'ajaxResizeColumns',
|
1062 |
|
1063 |
|
1064 |
|
@@ -1078,6 +1230,14 @@ var SekPreviewPrototype = SekPreviewPrototype || {};
|
|
1078 |
self.activeLevelUI( params.uiParams.id );
|
1079 |
},
|
1080 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1081 |
// @params = {
|
1082 |
// skope_id : api.czr_skopeBase.getSkopeProperty( 'skope_id' ),//<= send skope id to the preview so we can use it when ajaxing
|
1083 |
// apiParams : apiParams,
|
@@ -1093,7 +1253,7 @@ var SekPreviewPrototype = SekPreviewPrototype || {};
|
|
1093 |
// };
|
1094 |
//
|
1095 |
// when the module ui has been generated in the panel, we receive back this msg
|
1096 |
-
'sek-generate-module-ui' : function( params ) {},
|
1097 |
|
1098 |
//@params { type : module || preset_section }
|
1099 |
'sek-drag-start' : function( params ) {
|
@@ -1124,24 +1284,27 @@ var SekPreviewPrototype = SekPreviewPrototype || {};
|
|
1124 |
));
|
1125 |
});
|
1126 |
|
1127 |
-
// Append a drop zone between modules in columns
|
1128 |
if ( 'module' == params.type ) {
|
1129 |
$('[data-sek-level="column"]').each( function() {
|
1130 |
-
|
1131 |
-
//
|
1132 |
-
|
|
|
|
|
|
|
1133 |
var j = 1;
|
1134 |
-
$
|
1135 |
// Always before
|
1136 |
-
if ( $('[data-drop-zone-before-module="' + $(this).data('sek-id') +'"]').length < 1 ) {
|
1137 |
$(this).before(
|
1138 |
-
'<div class="sek-content-module-drop-zone sek-dynamic-drop-zone sek-drop-zone" data-sek-location="between-modules" data-drop-zone-before-module="' + $(this).data('sek-id') +'"></div>'
|
1139 |
);
|
1140 |
}
|
1141 |
// After the last one
|
1142 |
-
if ( j == $
|
1143 |
$(this).after(
|
1144 |
-
'<div class="sek-content-module-drop-zone sek-dynamic-drop-zone sek-drop-zone" data-sek-location="between-modules" data-drop-zone-after-module="' + $(this).data('sek-id') +'"></div>'
|
1145 |
);
|
1146 |
}
|
1147 |
j++;
|
@@ -1170,6 +1333,19 @@ var SekPreviewPrototype = SekPreviewPrototype || {};
|
|
1170 |
},
|
1171 |
|
1172 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1173 |
// FOCUS
|
1174 |
'sek-focus-on' : function( params ) {
|
1175 |
var $elToFocusOn = $('div[data-sek-id="' + params.id + '"]' );
|
@@ -1196,6 +1372,8 @@ var SekPreviewPrototype = SekPreviewPrototype || {};
|
|
1196 |
api.preview.send( [ msgId, 'done'].join('_'), params );
|
1197 |
}).fail( function() {
|
1198 |
api.preview.send( 'sek-notify', { type : 'error', duration : 10000, message : sekPreviewLocalized.i18n['Something went wrong, please refresh this page.'] });
|
|
|
|
|
1199 |
});
|
1200 |
} catch( _er_ ) {
|
1201 |
self.errare( 'reactToPanelMsg => Error when firing the callback of ' + msgId , _er_ );
|
@@ -1206,6 +1384,8 @@ var SekPreviewPrototype = SekPreviewPrototype || {};
|
|
1206 |
api.preview.send( [ msgId, 'done'].join('_'), params );
|
1207 |
}).fail( function() {
|
1208 |
api.preview.send( 'sek-notify', { type : 'error', duration : 10000, message : sekPreviewLocalized.i18n['Something went wrong, please refresh this page.'] });
|
|
|
|
|
1209 |
});
|
1210 |
} catch( _er_ ) {
|
1211 |
self.errare( 'reactToPanelMsg => Error when firing the callback of ' + msgId , _er_ );
|
@@ -1226,6 +1406,11 @@ var SekPreviewPrototype = SekPreviewPrototype || {};
|
|
1226 |
// @return a promise()
|
1227 |
ajaxAddSektion : function( params ) {
|
1228 |
var self = this;
|
|
|
|
|
|
|
|
|
|
|
1229 |
return self.doAjax( {
|
1230 |
action : 'sek_get_content',
|
1231 |
id : params.apiParams.id,
|
@@ -1291,13 +1476,15 @@ var SekPreviewPrototype = SekPreviewPrototype || {};
|
|
1291 |
}
|
1292 |
|
1293 |
// say it to the parent sektion
|
1294 |
-
//=> will be listened to
|
1295 |
if ( params.cloneId ) {
|
1296 |
$( 'div[data-sek-id="' + params.cloneId + '"]' ).trigger('sek-section-added', params );
|
1297 |
}
|
1298 |
$( 'div[data-sek-id="' + params.apiParams.id + '"]' ).trigger('sek-section-added', params );
|
1299 |
}).fail( function( _r_ ) {
|
1300 |
self.errare( 'ERROR in sek_get_html_for_injection ? ' , _r_ );
|
|
|
|
|
1301 |
});
|
1302 |
}//ajaxAddSektion()
|
1303 |
|
@@ -1313,6 +1500,10 @@ var SekPreviewPrototype = SekPreviewPrototype || {};
|
|
1313 |
ajaxRefreshColumns : function( params ) {
|
1314 |
//console.log('PARAMS in ajaxRefreshColumns', params );
|
1315 |
var self = this;
|
|
|
|
|
|
|
|
|
1316 |
return self.doAjax( {
|
1317 |
action : 'sek_get_content',
|
1318 |
id : params.apiParams.id,
|
@@ -1346,9 +1537,12 @@ var SekPreviewPrototype = SekPreviewPrototype || {};
|
|
1346 |
|
1347 |
// say it to the parent sektion
|
1348 |
//=> will be listened to by the column to re-instantiate sortable, resizable
|
|
|
1349 |
$('div[data-sek-id="' + params.apiParams.in_sektion + '"]' ).trigger('sek-columns-refreshed');
|
1350 |
}).fail( function( _r_ ) {
|
1351 |
self.errare( 'ERROR reactToPanelMsg => sek-add-column => ' , _r_ );
|
|
|
|
|
1352 |
});
|
1353 |
},//ajaxRefreshColumns()
|
1354 |
|
@@ -1356,6 +1550,10 @@ var SekPreviewPrototype = SekPreviewPrototype || {};
|
|
1356 |
ajaxResizeColumns : function( params ) {
|
1357 |
//console.log('PREVIEW => REACT TO PANEL MSG => sek-resize-columns => ', params );
|
1358 |
var self = this;
|
|
|
|
|
|
|
|
|
1359 |
return self.doAjax( {
|
1360 |
action : 'sek_get_content',
|
1361 |
resized_column : params.apiParams.resized_column,
|
@@ -1365,15 +1563,21 @@ var SekPreviewPrototype = SekPreviewPrototype || {};
|
|
1365 |
}).done( function( _r_ ) {
|
1366 |
//self.errare('sek-preview => resize-column ajax response => ', _r_.data );
|
1367 |
// Reset the automatic default resizable inline styling
|
1368 |
-
$( '
|
1369 |
width : '',
|
1370 |
height: ''
|
1371 |
});
|
1372 |
|
1373 |
//Append
|
1374 |
self.appendDynStyleSheet( params.skope_id, _r_.data );
|
|
|
|
|
|
|
|
|
1375 |
}).fail( function( _r_ ) {
|
1376 |
self.errare( 'ERROR reactToPanelMsg => sek-resize-columns => ' , _r_ );
|
|
|
|
|
1377 |
});
|
1378 |
}
|
1379 |
});//$.extend()
|
@@ -1387,6 +1591,10 @@ var SekPreviewPrototype = SekPreviewPrototype || {};
|
|
1387 |
// 2) re-render the module collection in a column, typically after a sortable move, or a module removal
|
1388 |
ajaxRefreshModulesAndNestedSections : function( params ) {
|
1389 |
var self = this;
|
|
|
|
|
|
|
|
|
1390 |
return self.doAjax( {
|
1391 |
action : 'sek_get_content',
|
1392 |
id : params.apiParams.id,
|
@@ -1396,7 +1604,7 @@ var SekPreviewPrototype = SekPreviewPrototype || {};
|
|
1396 |
sek_action : params.apiParams.action, // can be sek-add-module / refresh-modules-in-column
|
1397 |
is_nested : params.apiParams.is_nested
|
1398 |
}).done( function( _r_ ) {
|
1399 |
-
var $parentColumn = $(
|
1400 |
if ( 1 > $parentColumn.length ) {
|
1401 |
self.errare( 'reactToPanelMsg => ajaxRefreshModulesAndNestedSections => no DOM node for parent column => ', params.apiParams.in_column );
|
1402 |
}
|
@@ -1404,15 +1612,17 @@ var SekPreviewPrototype = SekPreviewPrototype || {};
|
|
1404 |
$parentColumn.before( placeholderHtml );
|
1405 |
// remove and re-render the entire column
|
1406 |
$parentColumn.remove();
|
1407 |
-
$( '
|
1408 |
-
$( '
|
1409 |
|
1410 |
// say it to the column
|
1411 |
//=> will be listened to by the column to re-instantiate sortable, resizable and fittext
|
1412 |
-
$( '
|
1413 |
|
1414 |
}).fail( function( _r_ ) {
|
1415 |
self.errare( 'ERROR reactToPanelMsg => sek-add-module => ' , _r_ );
|
|
|
|
|
1416 |
});
|
1417 |
}//ajaxRefreshModulesAndNestedSections()
|
1418 |
});//$.extend()
|
@@ -1424,6 +1634,10 @@ var SekPreviewPrototype = SekPreviewPrototype || {};
|
|
1424 |
ajaxRefreshStylesheet : function( params ) {
|
1425 |
var self = this;
|
1426 |
//console.log('preview => panel react => ajax refresh dyn style', params );
|
|
|
|
|
|
|
|
|
1427 |
return self.doAjax( {
|
1428 |
action : 'sek_get_content',
|
1429 |
skope_id : params.skope_id,
|
@@ -1431,8 +1645,13 @@ var SekPreviewPrototype = SekPreviewPrototype || {};
|
|
1431 |
}).done( function( _r_ ) {
|
1432 |
//console.log('sek-refresh-stylesheet done !', _r_.data);
|
1433 |
self.appendDynStyleSheet( params.skope_id, _r_.data );
|
|
|
|
|
|
|
1434 |
}).fail( function( _r_ ) {
|
1435 |
self.errare('sek-refresh-stylesheet fail !');
|
|
|
|
|
1436 |
});
|
1437 |
},
|
1438 |
|
@@ -1588,6 +1807,7 @@ var SekPreviewPrototype = SekPreviewPrototype || {};
|
|
1588 |
dfd.reject( _r );
|
1589 |
}
|
1590 |
dfd.resolve( _r );
|
|
|
1591 |
})
|
1592 |
.fail( function( _r ) {
|
1593 |
self.errare( 'self.doAjax : failed ajax error for : ' + _query_.action, _r );
|
@@ -1595,7 +1815,26 @@ var SekPreviewPrototype = SekPreviewPrototype || {};
|
|
1595 |
});
|
1596 |
//.always( function( _r ) { dfd.resolve( _r ); });
|
1597 |
return dfd.promise();
|
1598 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1599 |
});//$.extend()
|
1600 |
})( wp.customize, jQuery, _ );//global sekPreviewLocalized
|
1601 |
var SekPreviewPrototype = SekPreviewPrototype || {};
|
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();
|
80 |
self.activeUIChangedRecently( false );
|
81 |
}, 3000 ) );
|
82 |
});
|
|
|
|
|
83 |
}
|
84 |
});//$.extend()
|
85 |
})( wp.customize, jQuery, _ );//global sekPreviewLocalized
|
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 |
|
529 |
var tmpl,
|
530 |
level,
|
531 |
params,
|
532 |
+
$levelEl;
|
|
|
533 |
|
534 |
// Level's UI icons with delegation
|
535 |
$('body').on( 'mouseenter', '[data-sek-level]', function( evt ) {
|
543 |
$levelEl = $(this);
|
544 |
|
545 |
// stop here if the .sek-dyn-ui-wrapper is already printed for this level AND is not being faded out.
|
546 |
+
if ( $levelEl.children('.sek-dyn-ui-wrapper').length > 0 && true !== $levelEl.data( 'UIisFadingOut' ) )
|
547 |
return;
|
548 |
|
549 |
params = {
|
567 |
});
|
568 |
break;
|
569 |
case 'module' :
|
570 |
+
var module_name = self.getRegisteredModuleProperty( $levelEl.data('sek-module-type'), 'name' );
|
571 |
+
params = _.extend( params, {
|
572 |
+
module_name : 'not_set' != module_name ? module_name : ''
|
573 |
+
});
|
574 |
break;
|
575 |
}
|
576 |
// don't display the column and module ui when resizing columns
|
581 |
tmpl = self.parseTemplate( '#sek-dyn-ui-tmpl-' + level );
|
582 |
$.when( $(this).prepend( tmpl( params ) ) ).done( function() {
|
583 |
$levelEl.find('.sek-dyn-ui-wrapper').stop( true, true ).fadeIn( {
|
584 |
+
duration : 150,
|
585 |
+
complete : function() {}
|
586 |
} );
|
587 |
});
|
588 |
|
589 |
}).on( 'mouseleave', '[data-sek-level]', function( evt ) {
|
590 |
+
$levelEl = $(this);
|
591 |
+
//stores ths status of 200 ms fading out. => will let us know if we can print again when moving the mouse fast back and forth between two levels.
|
592 |
+
$levelEl.data( 'UIisFadingOut', true );//<= we need to store a fadingOut status to not miss a re-print in case of a fast moving mouse
|
593 |
+
|
594 |
+
|
595 |
+
$levelEl.children('.sek-dyn-ui-wrapper').stop( true, true ).fadeOut( {
|
596 |
+
duration : 150,
|
597 |
+
complete : function() {
|
598 |
+
$(this).remove();
|
599 |
+
$levelEl.data( 'UIisFadingOut', false );
|
600 |
+
}
|
601 |
+
});
|
602 |
});
|
603 |
|
604 |
|
605 |
+
// Ui for the WP content.
|
606 |
+
// Generated when is_singular() only
|
607 |
+
// @see SEK_Front::render()
|
608 |
+
var $wpContentEl;
|
609 |
+
$('body').on( 'mouseenter', '.sek-wp-content-wrapper', function( evt ) {
|
610 |
+
$wpContentEl = $(this);
|
611 |
+
// stop here if the .sek-dyn-ui-wrapper is already printed for this level AND is not being faded out.
|
612 |
+
if ( $wpContentEl.children('.sek-dyn-ui-wrapper').length > 0 && true !== $wpContentEl.data( 'UIisFadingOut' ) )
|
613 |
+
return;
|
614 |
+
|
615 |
+
tmpl = self.parseTemplate( '#sek-dyn-ui-tmpl-wp-content');
|
616 |
+
$.when( $wpContentEl.prepend( tmpl( {} ) ) ).done( function() {
|
617 |
+
$wpContentEl.find('.sek-dyn-ui-wrapper').stop( true, true ).fadeIn( {
|
618 |
+
duration : 150,
|
619 |
+
complete : function() {}
|
620 |
+
} );
|
621 |
+
});
|
622 |
+
}).on( 'mouseleave', '.sek-wp-content-wrapper', function( evt ) {
|
623 |
+
$(this).data( 'UIisFadingOut', true );//<= we need to store a fadingOut status to not miss a re-print in case of a fast moving mouse
|
624 |
+
$wpContentEl = $(this);
|
625 |
+
$(this).children('.sek-dyn-ui-wrapper').stop( true, true ).fadeOut( {
|
626 |
+
duration : 150,
|
627 |
+
complete : function() {
|
628 |
+
$(this).remove();
|
629 |
+
$wpContentEl.data( 'UIisFadingOut', false );
|
630 |
+
}
|
631 |
+
});
|
632 |
+
});
|
633 |
+
|
634 |
|
635 |
// Add content button between sections
|
636 |
// <script type="text/html" id="sek-tmpl-add-content-button">
|
793 |
clickedOn = 'addSektion';
|
794 |
} else if ( $el.hasClass('sek-to-json') ) {
|
795 |
clickedOn = 'sekToJson';
|
796 |
+
} else if ( $el.hasClass('sek-wp-content-wrapper') || $el.hasClass( 'sek-wp-content-dyn-ui') ) {
|
797 |
+
clickedOn = 'wpContent';
|
798 |
+
} else if ( $el.hasClass('sek-edit-wp-content') ) {
|
799 |
+
clickedOn = 'editWpContent';
|
800 |
} else {
|
801 |
clickedOn = 'inactiveZone';
|
802 |
}
|
803 |
|
804 |
+
|
805 |
+
//console.log('CLICKED', clickedOn, _action );
|
806 |
|
807 |
switch( clickedOn ) {
|
808 |
case 'addContentButton' :
|
833 |
throw new Error( 'ERROR => sek-front-preview => No valid level id found' );
|
834 |
}
|
835 |
self._send_( $el, {
|
836 |
+
action : _action,
|
837 |
+
location : _location,
|
838 |
+
level : _level,
|
839 |
+
id : _id,
|
840 |
+
was_triggered : false //<= indicates that the user clicked.
|
841 |
});
|
842 |
break;
|
843 |
case 'moduleWrapper' :
|
871 |
case 'sekToJson' :
|
872 |
api.preview.send( 'sek-to-json', { id : _id } );
|
873 |
break;
|
874 |
+
case 'wpContent' :
|
875 |
+
api.preview.send( 'sek-notify', {
|
876 |
+
type : 'info',
|
877 |
+
duration : 8000,
|
878 |
+
message : sekPreviewLocalized.i18n['This content has been created with the WordPress editor.']
|
879 |
+
});
|
880 |
+
break;
|
881 |
+
case 'editWpContent' :
|
882 |
+
// note : the edit url is printed as a data attribute to prevent being automatically parsed by wp when customizing and turned into a changeset url
|
883 |
+
var edit_url = $el.closest('[data-sek-wp-edit-link]').data('sek-wp-edit-link');
|
884 |
+
if ( ! _.isEmpty( edit_url ) ) {
|
885 |
+
window.open( edit_url,'_blank' );
|
886 |
+
}
|
887 |
+
|
888 |
+
break;
|
889 |
case 'inactiveZone' :
|
890 |
api.preview.send( 'sek-click-on-inactive-zone');//<= for example, collapses the tinyMce editor if expanded
|
891 |
//self._send_( $el, { action : 'pick-module' } );
|
892 |
break;
|
893 |
}
|
894 |
+
});//$('body').on('click', function( evt ) {}
|
895 |
+
|
896 |
},//scheduleUserReactions()
|
897 |
|
898 |
|
899 |
_send_ : function( $el, params ) {
|
900 |
+
//console.log('IN _send_', $el, params );
|
901 |
api.preview.send( 'sek-' + params.action, {
|
902 |
location : params.location,
|
903 |
level : params.level,
|
906 |
in_column : $el.closest('div[data-sek-level="column"]').length > 0 ? $el.closest('div[data-sek-level="column"]').data( 'sek-id') : '',
|
907 |
in_sektion : $el.closest('div[data-sek-level="section"]').length > 0 ? $el.closest('div[data-sek-level="section"]').data( 'sek-id') : '',
|
908 |
clicked_input_type : $el.closest('div[data-sek-input-type]').length > 0 ? $el.closest('div[data-sek-input-type]').data('sek-input-type') : '',
|
909 |
+
clicked_input_id : $el.closest('div[data-sek-input-id]').length > 0 ? $el.closest('div[data-sek-input-id]').data('sek-input-id') : '',
|
910 |
+
was_triggered : params.was_triggered
|
911 |
});
|
912 |
}
|
913 |
});//$.extend()
|
914 |
})( wp.customize, jQuery, _ );
|
915 |
//global sekPreviewLocalized
|
916 |
var SekPreviewPrototype = SekPreviewPrototype || {};
|
917 |
+
( function( api, $, _ ) {
|
918 |
+
$.extend( SekPreviewPrototype, {
|
919 |
+
//Fired in ::initialize()
|
920 |
+
setupLoader : function() {
|
921 |
+
var self = this;
|
922 |
+
// Cache our loader
|
923 |
+
this._css_loader_html = '<div class="sek-css-loader sek-mr-loader" style="display:none"><div></div><div></div><div></div></div>';
|
924 |
+
|
925 |
+
// Loader Cleaning <= the element printed when refreshing a level
|
926 |
+
// @see ::mayBePrintLoader
|
927 |
+
$( 'body').on([
|
928 |
+
'sek-modules-refreshed',
|
929 |
+
'sek-columns-refreshed',
|
930 |
+
'sek-section-added',
|
931 |
+
'sek-level-refreshed',
|
932 |
+
'sek-stylesheet-refreshed',
|
933 |
+
'sek-ajax-error'
|
934 |
+
].join(' '), function( evt ) {
|
935 |
+
self.cleanLoader();
|
936 |
+
});
|
937 |
+
},
|
938 |
+
|
939 |
+
// @return void()
|
940 |
+
// Insert a clone ( same dimensions ) div element of a level currently being refreshed, including a centered loading animation
|
941 |
+
// + adds a .sek-refreshing css class to the element being refreshed
|
942 |
+
//
|
943 |
+
// Invoked when
|
944 |
+
// - user click on an icon action in the preview that trigger a partial reflush of the DOM. For example, adding a column, duplicating a module, etc.
|
945 |
+
// - a module / section is dropped in the preview
|
946 |
+
// - a module is being edited
|
947 |
+
// - a column is resized
|
948 |
+
// @params {
|
949 |
+
// element : $(),
|
950 |
+
// action : '',
|
951 |
+
// level,
|
952 |
+
// loader_located_in_level_id
|
953 |
+
// }
|
954 |
+
mayBePrintLoader : function( params ) {
|
955 |
+
var self = this,
|
956 |
+
levelIdForTheLoader = params.loader_located_in_level_id;
|
957 |
+
|
958 |
+
if ( ! _.isEmpty( levelIdForTheLoader ) ) {
|
959 |
+
var $levelElementForTheLoader = $('[data-sek-id="' + levelIdForTheLoader +'"]');
|
960 |
+
if ( $levelElementForTheLoader.length > 0 && 1 > $('.sek-level-clone ').length ) {
|
961 |
+
$levelClone = $('<div>', { class : 'sek-level-clone' });
|
962 |
+
// blur all children levels
|
963 |
+
$levelElementForTheLoader.find('[data-sek-level]').each( function() {
|
964 |
+
$(this).addClass('sek-refreshing');
|
965 |
+
});
|
966 |
+
|
967 |
+
// print the absolute positionned clone on top
|
968 |
+
$levelElementForTheLoader.prepend( $levelClone );
|
969 |
+
$levelClone.css({
|
970 |
+
width : $levelElementForTheLoader.outerWidth() +'px',
|
971 |
+
height : $levelElementForTheLoader.outerHeight() + 'px'
|
972 |
+
}).append( self._css_loader_html ).find('.sek-css-loader').fadeIn( 'fast' );
|
973 |
+
|
974 |
+
// Start the countdown for auto-cleaning
|
975 |
+
clearTimeout( $.data( this, '_nimble_loader_active_timer_') );
|
976 |
+
$.data( this, '_nimble_loader_active_timer_', setTimeout(function() {
|
977 |
+
self.cleanLoader();
|
978 |
+
}, 4000 ) );
|
979 |
+
}
|
980 |
+
}
|
981 |
+
},
|
982 |
+
|
983 |
+
// scheduled in ::initialize(), on 'sek-modules-refreshed sek-columns-refreshed sek-section-added sek-refresh-level'
|
984 |
+
// invoked in ::mayBePrintLoader() in an auto-clean scenario
|
985 |
+
cleanLoader : function() {
|
986 |
+
var self = this;
|
987 |
+
$('.sek-level-clone').remove();
|
988 |
+
$('[data-sek-level]').each( function() {
|
989 |
+
$(this).removeClass('sek-refreshing');
|
990 |
+
});
|
991 |
+
}
|
992 |
+
|
993 |
+
});//$.extend()
|
994 |
+
})( wp.customize, jQuery, _ );
|
995 |
+
//global sekPreviewLocalized
|
996 |
+
var SekPreviewPrototype = SekPreviewPrototype || {};
|
997 |
( function( api, $, _ ) {
|
998 |
$.extend( SekPreviewPrototype, {
|
999 |
// Fired in ::initialize()
|
1007 |
'sek-add-content-in-new-sektion' : 'ajaxAddSektion',
|
1008 |
'sek-add-column' : 'ajaxRefreshColumns',
|
1009 |
'sek-add-module' : 'ajaxRefreshModulesAndNestedSections',
|
1010 |
+
'sek-refresh-stylesheet' : 'ajaxRefreshStylesheet',
|
1011 |
+
|
1012 |
+
'sek-resize-columns' : 'ajaxResizeColumns',
|
1013 |
+
|
1014 |
'sek-remove' : function( params ) {
|
1015 |
var removeCandidateId = params.apiParams.id,
|
1016 |
+
$candidateEl = $('div[data-sek-id="' + removeCandidateId + '"]' ),
|
1017 |
+
dfd;
|
1018 |
switch ( params.apiParams.action ) {
|
1019 |
case 'sek-remove-section' :
|
1020 |
+
// will be cleaned on ajax.done()
|
1021 |
+
// @see ::scheduleTheLoaderCleaning
|
1022 |
+
self.mayBePrintLoader({
|
1023 |
+
loader_located_in_level_id : params.apiParams.location
|
1024 |
+
});
|
1025 |
if ( true === params.apiParams.is_nested ) {
|
1026 |
+
dfd = self.ajaxRefreshModulesAndNestedSections( params );
|
1027 |
} else {
|
1028 |
if ( _.isEmpty( removeCandidateId ) || 1 > $candidateEl.length ) {
|
1029 |
self.errare( 'reactToPanelMsg => sek-remove => invalid candidate id => ', removeCandidateId );
|
1030 |
}
|
1031 |
+
$('body').find( $candidateEl ).remove();
|
1032 |
+
// say it
|
1033 |
+
// listened to clean the loader just in time
|
1034 |
+
$('[data-sek-id="' + params.apiParams.location + '"]').trigger( 'sek-level-refreshed');
|
1035 |
}
|
1036 |
//console.log( params.apiParams.action, params );
|
1037 |
//self.ajaxRefreshModulesAndNestedSections( params );
|
1038 |
break;
|
1039 |
case 'sek-remove-column' :
|
1040 |
+
dfd = self.ajaxRefreshColumns( params );
|
|
|
1041 |
break;
|
1042 |
case 'sek-remove-module' :
|
1043 |
+
dfd = self.ajaxRefreshModulesAndNestedSections( params );
|
|
|
1044 |
break;
|
1045 |
default :
|
|
|
1046 |
break;
|
1047 |
}
|
1048 |
+
// We should always return a promise
|
1049 |
+
return _.isEmpty( dfd ) ? $.Deferred( function() { this.resolve(); } ) : dfd;
|
1050 |
},
|
1051 |
|
1052 |
'sek-duplicate' : function( params ) {
|
1079 |
// id : params.id
|
1080 |
// }
|
1081 |
'sek-refresh-level' : function( params ) {
|
1082 |
+
// will be cleaned on 'sek-module-refreshed'
|
1083 |
+
self.mayBePrintLoader({
|
1084 |
+
loader_located_in_level_id : params.apiParams.id
|
1085 |
+
});
|
1086 |
+
return self.doAjax( {
|
1087 |
skope_id : params.skope_id,
|
1088 |
action : 'sek_get_content',
|
1089 |
id : params.apiParams.id,
|
1091 |
sek_action : params.apiParams.action
|
1092 |
}).fail( function( _r_ ) {
|
1093 |
self.errare( 'ERROR reactToPanelMsg => sek-refresh-level => ' , _r_ );
|
1094 |
+
$( '[data-sek-id="' + params.apiParams.id + '"]' ).trigger( 'sek-ajax-error' );
|
1095 |
}).done( function( _r_ ) {
|
1096 |
var placeholderHtml = '<span class="sek-placeholder" data-sek-placeholder-for="' + params.apiParams.id + '"></span>',
|
1097 |
$currentLevelEl = $( 'div[data-sek-id="' + params.apiParams.id + '"]' );
|
1105 |
$placeHolder.after( _r_.data );
|
1106 |
$placeHolder.remove();
|
1107 |
|
1108 |
+
//=> 'sek-level-refreshed' is listened to clean the loader overalay in time
|
1109 |
+
$( '[data-sek-id="' + params.apiParams.id + '"]' )
|
1110 |
+
.trigger( 'sek-level-refreshed', { level : params.apiParams.level, id : params.apiParams.id } );
|
1111 |
});
|
1112 |
},
|
1113 |
|
|
|
|
|
1114 |
|
1115 |
|
1116 |
|
1211 |
}
|
1212 |
},
|
1213 |
|
|
|
1214 |
|
1215 |
|
1216 |
|
1230 |
self.activeLevelUI( params.uiParams.id );
|
1231 |
},
|
1232 |
|
1233 |
+
|
1234 |
+
|
1235 |
+
|
1236 |
+
|
1237 |
+
|
1238 |
+
|
1239 |
+
|
1240 |
+
|
1241 |
// @params = {
|
1242 |
// skope_id : api.czr_skopeBase.getSkopeProperty( 'skope_id' ),//<= send skope id to the preview so we can use it when ajaxing
|
1243 |
// apiParams : apiParams,
|
1253 |
// };
|
1254 |
//
|
1255 |
// when the module ui has been generated in the panel, we receive back this msg
|
1256 |
+
//'sek-generate-module-ui' : function( params ) {},
|
1257 |
|
1258 |
//@params { type : module || preset_section }
|
1259 |
'sek-drag-start' : function( params ) {
|
1284 |
));
|
1285 |
});
|
1286 |
|
1287 |
+
// Append a drop zone between modules and nested sections in columns
|
1288 |
if ( 'module' == params.type ) {
|
1289 |
$('[data-sek-level="column"]').each( function() {
|
1290 |
+
// Our candidates are the modules and nested section which are direct children of this column
|
1291 |
+
// We don't want to include the modules inserted in the columns of a nested section.
|
1292 |
+
var $modules_and_nested_sections = $(this).children('.sek-column-inner').children( '[data-sek-level="module"]' );
|
1293 |
+
var $nested_sections = $(this).children('.sek-column-inner').children( '[data-sek-is-nested="true"]' );
|
1294 |
+
$modules_and_nested_sections = $modules_and_nested_sections.add( $nested_sections );
|
1295 |
+
|
1296 |
var j = 1;
|
1297 |
+
$modules_and_nested_sections.each( function() {
|
1298 |
// Always before
|
1299 |
+
if ( $('[data-drop-zone-before-module-or-nested-section="' + $(this).data('sek-id') +'"]').length < 1 ) {
|
1300 |
$(this).before(
|
1301 |
+
'<div class="sek-content-module-drop-zone sek-dynamic-drop-zone sek-drop-zone" data-sek-location="between-modules-and-nested-sections" data-drop-zone-before-module-or-nested-section="' + $(this).data('sek-id') +'"></div>'
|
1302 |
);
|
1303 |
}
|
1304 |
// After the last one
|
1305 |
+
if ( j == $modules_and_nested_sections.length && $('[data-drop-zone-after-module-or-nested-section="' + $(this).data('sek-id') +'"]').length < 1 ) {
|
1306 |
$(this).after(
|
1307 |
+
'<div class="sek-content-module-drop-zone sek-dynamic-drop-zone sek-drop-zone" data-sek-location="between-modules-and-nested-sections" data-drop-zone-after-module-or-nested-section="' + $(this).data('sek-id') +'"></div>'
|
1308 |
);
|
1309 |
}
|
1310 |
j++;
|
1333 |
},
|
1334 |
|
1335 |
|
1336 |
+
|
1337 |
+
|
1338 |
+
|
1339 |
+
|
1340 |
+
|
1341 |
+
|
1342 |
+
|
1343 |
+
|
1344 |
+
|
1345 |
+
|
1346 |
+
|
1347 |
+
|
1348 |
+
|
1349 |
// FOCUS
|
1350 |
'sek-focus-on' : function( params ) {
|
1351 |
var $elToFocusOn = $('div[data-sek-id="' + params.id + '"]' );
|
1372 |
api.preview.send( [ msgId, 'done'].join('_'), params );
|
1373 |
}).fail( function() {
|
1374 |
api.preview.send( 'sek-notify', { type : 'error', duration : 10000, message : sekPreviewLocalized.i18n['Something went wrong, please refresh this page.'] });
|
1375 |
+
}).then( function() {
|
1376 |
+
api.preview.trigger( 'control-panel-requested-action-done', { action : msgId, args : params } );
|
1377 |
});
|
1378 |
} catch( _er_ ) {
|
1379 |
self.errare( 'reactToPanelMsg => Error when firing the callback of ' + msgId , _er_ );
|
1384 |
api.preview.send( [ msgId, 'done'].join('_'), params );
|
1385 |
}).fail( function() {
|
1386 |
api.preview.send( 'sek-notify', { type : 'error', duration : 10000, message : sekPreviewLocalized.i18n['Something went wrong, please refresh this page.'] });
|
1387 |
+
}).then( function() {
|
1388 |
+
api.preview.trigger( 'control-panel-requested-action-done', { action : msgId, args : params } );
|
1389 |
});
|
1390 |
} catch( _er_ ) {
|
1391 |
self.errare( 'reactToPanelMsg => Error when firing the callback of ' + msgId , _er_ );
|
1406 |
// @return a promise()
|
1407 |
ajaxAddSektion : function( params ) {
|
1408 |
var self = this;
|
1409 |
+
// will be cleaned on ajax.done()
|
1410 |
+
// @see ::scheduleTheLoaderCleaning
|
1411 |
+
self.mayBePrintLoader({
|
1412 |
+
loader_located_in_level_id : params.apiParams.location
|
1413 |
+
});
|
1414 |
return self.doAjax( {
|
1415 |
action : 'sek_get_content',
|
1416 |
id : params.apiParams.id,
|
1476 |
}
|
1477 |
|
1478 |
// say it to the parent sektion
|
1479 |
+
//=> will be listened to clean the loader overlay just in time
|
1480 |
if ( params.cloneId ) {
|
1481 |
$( 'div[data-sek-id="' + params.cloneId + '"]' ).trigger('sek-section-added', params );
|
1482 |
}
|
1483 |
$( 'div[data-sek-id="' + params.apiParams.id + '"]' ).trigger('sek-section-added', params );
|
1484 |
}).fail( function( _r_ ) {
|
1485 |
self.errare( 'ERROR in sek_get_html_for_injection ? ' , _r_ );
|
1486 |
+
$( '[data-sek-id="' + params.apiParams.id + '"]' )
|
1487 |
+
.trigger( 'sek-ajax-error' );
|
1488 |
});
|
1489 |
}//ajaxAddSektion()
|
1490 |
|
1500 |
ajaxRefreshColumns : function( params ) {
|
1501 |
//console.log('PARAMS in ajaxRefreshColumns', params );
|
1502 |
var self = this;
|
1503 |
+
// will be cleaned on 'sek-columns-refreshed'
|
1504 |
+
self.mayBePrintLoader({
|
1505 |
+
loader_located_in_level_id : params.apiParams.in_sektion
|
1506 |
+
});
|
1507 |
return self.doAjax( {
|
1508 |
action : 'sek_get_content',
|
1509 |
id : params.apiParams.id,
|
1537 |
|
1538 |
// say it to the parent sektion
|
1539 |
//=> will be listened to by the column to re-instantiate sortable, resizable
|
1540 |
+
//=> also listened to clean the loader overalay in time
|
1541 |
$('div[data-sek-id="' + params.apiParams.in_sektion + '"]' ).trigger('sek-columns-refreshed');
|
1542 |
}).fail( function( _r_ ) {
|
1543 |
self.errare( 'ERROR reactToPanelMsg => sek-add-column => ' , _r_ );
|
1544 |
+
$( '[data-sek-id="' + params.apiParams.id + '"]' )
|
1545 |
+
.trigger( 'sek-ajax-error' );
|
1546 |
});
|
1547 |
},//ajaxRefreshColumns()
|
1548 |
|
1550 |
ajaxResizeColumns : function( params ) {
|
1551 |
//console.log('PREVIEW => REACT TO PANEL MSG => sek-resize-columns => ', params );
|
1552 |
var self = this;
|
1553 |
+
// will be cleaned on 'sek-module-refreshed'
|
1554 |
+
self.mayBePrintLoader({
|
1555 |
+
loader_located_in_level_id : params.apiParams.in_sektion
|
1556 |
+
});
|
1557 |
return self.doAjax( {
|
1558 |
action : 'sek_get_content',
|
1559 |
resized_column : params.apiParams.resized_column,
|
1563 |
}).done( function( _r_ ) {
|
1564 |
//self.errare('sek-preview => resize-column ajax response => ', _r_.data );
|
1565 |
// Reset the automatic default resizable inline styling
|
1566 |
+
$( '[data-sek-id="' + params.apiParams.resized_column + '"]' ).css({
|
1567 |
width : '',
|
1568 |
height: ''
|
1569 |
});
|
1570 |
|
1571 |
//Append
|
1572 |
self.appendDynStyleSheet( params.skope_id, _r_.data );
|
1573 |
+
|
1574 |
+
// say it
|
1575 |
+
// listened to clean the loader just in time
|
1576 |
+
$('div[data-sek-id="' + params.apiParams.in_sektion + '"]' ).trigger('sek-columns-refreshed');
|
1577 |
}).fail( function( _r_ ) {
|
1578 |
self.errare( 'ERROR reactToPanelMsg => sek-resize-columns => ' , _r_ );
|
1579 |
+
$( '[data-sek-id="' + params.apiParams.in_sektion + '"]' )
|
1580 |
+
.trigger( 'sek-ajax-error' );
|
1581 |
});
|
1582 |
}
|
1583 |
});//$.extend()
|
1591 |
// 2) re-render the module collection in a column, typically after a sortable move, or a module removal
|
1592 |
ajaxRefreshModulesAndNestedSections : function( params ) {
|
1593 |
var self = this;
|
1594 |
+
// will be cleaned on 'sek-module-refreshed'
|
1595 |
+
self.mayBePrintLoader({
|
1596 |
+
loader_located_in_level_id : params.apiParams.in_column
|
1597 |
+
});
|
1598 |
return self.doAjax( {
|
1599 |
action : 'sek_get_content',
|
1600 |
id : params.apiParams.id,
|
1604 |
sek_action : params.apiParams.action, // can be sek-add-module / refresh-modules-in-column
|
1605 |
is_nested : params.apiParams.is_nested
|
1606 |
}).done( function( _r_ ) {
|
1607 |
+
var $parentColumn = $('[data-sek-id="' + params.apiParams.in_column + '"]' );
|
1608 |
if ( 1 > $parentColumn.length ) {
|
1609 |
self.errare( 'reactToPanelMsg => ajaxRefreshModulesAndNestedSections => no DOM node for parent column => ', params.apiParams.in_column );
|
1610 |
}
|
1612 |
$parentColumn.before( placeholderHtml );
|
1613 |
// remove and re-render the entire column
|
1614 |
$parentColumn.remove();
|
1615 |
+
$( '[data-sek-placeholder-for="' + params.apiParams.in_column + '"]' ).after( _r_.data );
|
1616 |
+
$( '[data-sek-placeholder-for="' + params.apiParams.in_column + '"]' ).remove();
|
1617 |
|
1618 |
// say it to the column
|
1619 |
//=> will be listened to by the column to re-instantiate sortable, resizable and fittext
|
1620 |
+
$( '[data-sek-id="' + params.apiParams.in_column + '"]' ).trigger('sek-modules-refreshed');
|
1621 |
|
1622 |
}).fail( function( _r_ ) {
|
1623 |
self.errare( 'ERROR reactToPanelMsg => sek-add-module => ' , _r_ );
|
1624 |
+
$( '[data-sek-id="' + params.apiParams.id + '"]' )
|
1625 |
+
.trigger( 'sek-ajax-error' );
|
1626 |
});
|
1627 |
}//ajaxRefreshModulesAndNestedSections()
|
1628 |
});//$.extend()
|
1634 |
ajaxRefreshStylesheet : function( params ) {
|
1635 |
var self = this;
|
1636 |
//console.log('preview => panel react => ajax refresh dyn style', params );
|
1637 |
+
// will be cleaned on 'sek-module-refreshed'
|
1638 |
+
self.mayBePrintLoader({
|
1639 |
+
loader_located_in_level_id : params.apiParams.id
|
1640 |
+
});
|
1641 |
return self.doAjax( {
|
1642 |
action : 'sek_get_content',
|
1643 |
skope_id : params.skope_id,
|
1645 |
}).done( function( _r_ ) {
|
1646 |
//console.log('sek-refresh-stylesheet done !', _r_.data);
|
1647 |
self.appendDynStyleSheet( params.skope_id, _r_.data );
|
1648 |
+
//=> 'sek-level-refreshed' is listened to clean the loader overalay in time
|
1649 |
+
$( '[data-sek-id="' + params.apiParams.id + '"]' )
|
1650 |
+
.trigger( 'sek-stylesheet-refreshed', { level : params.apiParams.level, id : params.apiParams.id } );
|
1651 |
}).fail( function( _r_ ) {
|
1652 |
self.errare('sek-refresh-stylesheet fail !');
|
1653 |
+
$( '[data-sek-id="' + params.apiParams.id + '"]' )
|
1654 |
+
.trigger( 'sek-ajax-error' );
|
1655 |
});
|
1656 |
},
|
1657 |
|
1807 |
dfd.reject( _r );
|
1808 |
}
|
1809 |
dfd.resolve( _r );
|
1810 |
+
|
1811 |
})
|
1812 |
.fail( function( _r ) {
|
1813 |
self.errare( 'self.doAjax : failed ajax error for : ' + _query_.action, _r );
|
1815 |
});
|
1816 |
//.always( function( _r ) { dfd.resolve( _r ); });
|
1817 |
return dfd.promise();
|
1818 |
+
},//doAjax
|
1819 |
+
|
1820 |
+
|
1821 |
+
|
1822 |
+
|
1823 |
+
|
1824 |
+
|
1825 |
+
// @return boolean
|
1826 |
+
isModuleRegistered : function( moduleType ) {
|
1827 |
+
return sekPreviewLocalized.registeredModules && ! _.isUndefined( sekPreviewLocalized.registeredModules[ moduleType ] );
|
1828 |
+
},
|
1829 |
+
|
1830 |
+
|
1831 |
+
//@return mixed
|
1832 |
+
getRegisteredModuleProperty : function( moduleType, property ) {
|
1833 |
+
if ( ! this.isModuleRegistered( moduleType ) ) {
|
1834 |
+
return 'not_set';
|
1835 |
+
}
|
1836 |
+
return sekPreviewLocalized.registeredModules[ moduleType ][ property ];
|
1837 |
+
}
|
1838 |
});//$.extend()
|
1839 |
})( wp.customize, jQuery, _ );//global sekPreviewLocalized
|
1840 |
var SekPreviewPrototype = SekPreviewPrototype || {};
|
assets/czr/sek/js/ccat-sek-preview.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var SekPreviewPrototype=SekPreviewPrototype||{};!function(t,o,a){o.extend(SekPreviewPrototype,{initialize:function(){var e=this;try{this.skope_id=a.findWhere(_wpCustomizeSettings.czr_new_skopes,{skope:"local"}).skope_id}catch(e){return void this.errare("Preview => error when storing the skope_id",e)}this.scheduleHighlightActiveLevel(),o(function(){e.setupSortable(),e.setupResizable(),e.setupUiHoverVisibility(),e.scheduleUiClickReactions(),e.schedulePanelMsgReactions()})},scheduleHighlightActiveLevel:function(){var i=this;this.activeLevelUI=new t.Value(""),this.activeUIChangedRecently=new t.Value(!1),this.activeLevelUI.bind(function(e,t){var a=o('[data-sek-id="'+e+'"]'),n=o('[data-sek-id="'+t+'"]');0<a.length&&a.addClass("sek-active-ui sek-highlight-active-ui"),0<n.length&&n.removeClass("sek-active-ui sek-highlight-active-ui"),i.activeUIChangedRecently(Date.now())}),a.each(["sek-refresh-stylesheet","sek-refresh-level"],function(e){t.preview.bind(e,function(e){i.activeUIChangedRecently(Date.now())})}),this.activeUIChangedRecently.bind(function(e){var t=o('[data-sek-id="'+i.activeLevelUI()+'"]');o(".sek-highlight-active-ui").length&&o(".sek-highlight-active-ui").removeClass("sek-highlight-active-ui"),0<t.length&&t.toggleClass("sek-highlight-active-ui",!1!==e),clearTimeout(o.data(this,"_ui_change_timer_")),o.data(this,"_ui_change_timer_",setTimeout(function(){i.activeUIChangedRecently(!1)},3e3))})}})}(wp.customize,jQuery,_);SekPreviewPrototype=SekPreviewPrototype||{};!function(l,c,k){c.extend(SekPreviewPrototype,{setupSortable:function(){var a=this;return this.sortableDefaultParams={placeholder:"sortable-placeholder",over:function(e,t){}},c('[data-sek-level="location"]').each(function(){a.makeSektionsSortableInLocation(c(this).data("sek-id"))}),c("body").on("sek-section-added sek-refresh-level",'[data-sek-level="location"]',function(e,t){a.makeSektionsSortableInLocation(c(this).data("sek-id"))}),c('[data-sek-level="location"]').each(function(){c(this).find('[data-sek-level="section"]').each(function(){a.makeColumnsSortableInSektion(c(this).data("sek-id"))})}),c("body").on("sek-columns-refreshed sek-section-added",'[data-sek-level="section"]',function(e){a.makeColumnsSortableInSektion(c(this).data("sek-id"))}),c('[data-sek-level="location"]').each(function(){c(this).find('[data-sek-level="column"]').each(function(){a.makeModulesSortableInColumn(c(this).data("sek-id"))})}),c("body").on("sek-modules-refreshed",'[data-sek-level="column"]',function(){a.makeModulesSortableInColumn(c(this).data("sek-id"))}),c("body").on("sek-columns-refreshed",'[data-sek-level="section"]',function(){c(this).find(".sek-sektion-inner").first().children('[data-sek-level="column"]').each(function(){a.makeModulesSortableInColumn(c(this).data("sek-id"))})}),this},makeSektionsSortableInLocation:function(e){var a,n,t,i=this,o=[],s=[];c('[data-sek-id="'+e+'"]').each(function(){t=c.extend(!0,{},i.sortableDefaultParams),c(this).sortable(k.extend(t,{handle:".sek-move-section",connectWith:'[data-sek-level="location"]',placeholder:{element:function(e){return c('<div class="sortable-placeholder"><div class="sek-module-placeholder-content"><p>'+sekPreviewLocalized.i18n["Insert here"]+"</p></div></div>")[0]},update:function(e,t){}},start:function(e,t){c("body").addClass("sek-moving-section"),$sourceLocation=t.item.closest('[data-sek-level="location"]'),a=$sourceLocation.data("sek-id"),$sourceLocation.children('[data-sek-level="section"]').each(function(){o.push(c(this).data("sek-id"))})},stop:function(e,t){c("body").removeClass("sek-moving-section"),s=[],$targetLocation=t.item.closest('[data-sek-level="location"]'),n=$targetLocation.data("sek-id"),$targetLocation.children('[data-sek-level="section"]').each(function(){s.push(c(this).data("sek-id"))}),l.preview.send("sek-move",{id:t.item.data("sek-id"),level:"section",newOrder:s,from_location:a,to_location:n})},over:function(e,t){t.placeholder.addClass("sek-sortable-section-over")},out:function(e,t){t.placeholder.removeClass("sek-sortable-section-over")}}))})},makeColumnsSortableInSektion:function(e){var a=this,t=c.extend(!0,{},a.sortableDefaultParams);c('[data-sek-id="'+e+'"]').find(".sek-sektion-inner").first().sortable(k.extend(t,{handle:".sek-move-column",connectWith:".sek-sektion-inner",remove:function(e,t){return $targetSektionCandidate=t.item.closest('[data-sek-level="section"]'),!(0<$targetSektionCandidate.length&&12<$targetSektionCandidate.find(".sek-sektion-inner").first().children('[data-sek-level="column"]').length)||(l.preview.send("sek-notify",{message:sekPreviewLocalized.i18n["You've reached the maximum number of columns allowed in this section."]}),!1)},start:function(e,t){startOrder=[],newOrder=[],from_sektion=t.item.closest('[data-sek-level="section"]').data("sek-id"),t.item.closest('[data-sek-level="section"]').find(".sek-sektion-inner").first().children('[data-sek-level="column"]').each(function(){startOrder.push(c(this).data("sek-id"))}),k.isEmpty(startOrder)&&a.errare("column sortable => startOrder should not be empty")},stop:function(e,t){$targetSektion=t.item.closest('[data-sek-level="section"]'),to_sektion=$targetSektion.data("sek-id"),$targetSektion.find(".sek-sektion-inner").first().children('[data-sek-level="column"]').each(function(){newOrder.push(c(this).data("sek-id"))}),k.isEmpty(newOrder)?a.errare("column sortable => newOrder should not be empty"):k.isEqual(newOrder,startOrder)&&to_sektion===from_sektion?sekPreviewLocalized.isDevMode&&a.errare("preview => makeModulesSortableInColumn => start and stop positions are identical"):l.preview.send("sek-move",{id:t.item.data("sek-id"),level:"column",newOrder:newOrder,from_sektion:from_sektion,to_sektion:to_sektion})}}))},makeModulesSortableInColumn:function(e){var a,n,i,o,t,s=[],r=[],d=this;t=c.extend(!0,{},d.sortableDefaultParams),c('[data-sek-id="'+e+'"]').find(".sek-column-inner").first().sortable(k.extend(t,{handle:".sek-move-module",connectWith:".sek-column-inner",over:function(e,t){c('[data-sek-level="location"]').find(".sek-sortable-overing").each(function(){c(this).removeClass("sek-sortable-overing")}),c(e.target).addClass("sek-sortable-overing")},start:function(e,t){s=[],r=[],c("body").addClass("sek-dragging-element"),n=t.item.closest('[data-sek-level="column"]').data("sek-id"),a=t.item.closest('[data-sek-level="section"]').data("sek-id"),t.item.closest('[data-sek-level="column"]').find(".sek-column-inner").first().children('[data-sek-level="module"]').each(function(){s.push(c(this).data("sek-id"))}),k.isEmpty(s)&&d.errare("makeModulesSortableInColumn => startOrder should not be empty")},stop:function(e,t){o=t.item.closest('[data-sek-level="column"]'),i=o.data("sek-id"),o.find(".sek-column-inner").first().children("[data-sek-id]").each(function(){r.push(c(this).data("sek-id"))}),k.isEmpty(r)?d.errare("makeModulesSortableInColumn => newOrder should not be empty"):k.isEqual(r,s)&&i===n?d.errare("preview => makeModulesSortableInColumn => start and stop positions are identical"):(l.preview.send("sek-move",{id:t.item.data("sek-id"),level:"module",newOrder:r,from_column:n,to_column:i,from_sektion:a,to_sektion:t.item.closest('[data-sek-level="section"]').data("sek-id")}),c("body").removeClass("sek-dragging-element"))}}))}})}(wp.customize,jQuery,_);SekPreviewPrototype=SekPreviewPrototype||{};!function(l,c,k){c.extend(SekPreviewPrototype,{setupResizable:function(){var t=this;return c(".sektion-wrapper").find('div[data-sek-level="section"]').each(function(){t.maybeMakeColumnResizableInSektion.call(this)}),c("body").on("sek-modules-refreshed sek-columns-refreshed",'div[data-sek-level="section"]',function(e){t.maybeMakeColumnResizableInSektion.call(this)}),this},maybeMakeColumnResizableInSektion:function(){var a,n,i,o,s,r,d,e=c(this).find(".sek-sektion-inner").first().children('div[data-sek-level="column"]');e.length<2||e.each(function(){c(this).resizable({resize:function(e,t){c(".sektion-wrapper").data("sek-resizing-columns",!0)},start:function(e,t){if(a=t.element.closest('div[data-sek-level="section"]'),a.data("sek-id"),n=a.find(".sek-sektion-inner")[0].getBoundingClientRect().width,!((s=a.find(".sek-sektion-inner").first().children('div[data-sek-level="column"]').length)<2)){if((i=t.element.closest('div[data-sek-level="column"]')).length<1)throw new Error("ERROR => resizable => No valid level dom element found");d=i.index()+1==s,r=d?i.prev():i.next(),c(".sektion-wrapper").data("sek-resizing-columns",!0),k.delay(function(){c(".sektion-wrapper").data("sek-resizing-columns",!1)},3e3)}},stop:function(e,t){if(!(s<2)){if(i.length<1)throw new Error("ERROR => resizable => No valid level dom element found");i.css({width:"",height:""}),o=(parseFloat(t.size.width)/parseFloat(n)*100).toFixed(3),l.preview.send("sek-resize-columns",{action:"sek-resize-columns",level:i.data("sek-level"),in_sektion:a.data("sek-id"),id:i.data("sek-id"),resized_column:i.data("sek-id"),sister_column:r.data("sek-id"),resizedColumnWidthInPercent:o,col_number:s}),c(".sektion-wrapper").data("sek-resizing-columns",!1)}},helper:"ui-resizable-helper",handles:"e"});var e=c(this);k.delay(function(){e.find(".ui-resizable-handle").find(".fa-arrows-alt-h").length<1&&e.find(".ui-resizable-handle").append('<i class="fas fa-arrows-alt-h"></i>')},500)})}})}(wp.customize,jQuery,_);SekPreviewPrototype=SekPreviewPrototype||{};!function(e,u,d){u.extend(SekPreviewPrototype,{setupUiHoverVisibility:function(){var a,n,i,o,s=this,r=!1;u("body").on("mouseenter","[data-sek-level]",function(e){if("location"!=(n=u(this).data("sek-level"))&&!(0<(o=u(this)).children(".sek-dyn-ui-wrapper").length&&!1===r)){switch(i={id:o.data("sek-id"),level:o.data("sek-level")},n){case"section":i=d.extend(i,{is_last_possible_section:!0===u(this).data("sek-is-nested"),can_have_more_columns:u(this).find(".sek-sektion-inner").first().children('div[data-sek-level="column"]').length<12});break;case"column":var t=u(this).closest('div[data-sek-level="section"]');i=d.extend(i,{parent_can_have_more_columns:t.find(".sek-sektion-inner").first().children('div[data-sek-level="column"]').length<12,parent_is_single_column:t.find(".sek-sektion-inner").first().children('div[data-sek-level="column"]').length<2,parent_is_last_allowed_nested:!0===t.data("sek-is-nested")});break;case"module":i=d.extend(i,{})}!0===u(".sektion-wrapper").data("sek-resizing-columns")&&d.contains(["column","module"],n)||(a=s.parseTemplate("#sek-dyn-ui-tmpl-"+n),u.when(u(this).prepend(a(i))).done(function(){o.find(".sek-dyn-ui-wrapper").stop(!0,!0).fadeIn({duration:150,complete:function(){}})}))}}).on("mouseleave","[data-sek-level]",function(e){r=!0,(o=u(this)).children(".sek-dyn-ui-wrapper").stop(!0,!0).fadeOut({duration:150,complete:function(){u(this).remove(),r=!1}})});return s.mouseMovedRecently=new e.Value({}),s.mouseMovedRecently.bind(function(e){var k;d.isEmpty(e)?u("body").stop(!0,!0).find(".sek-add-content-button").each(function(){u(this).fadeOut({duration:200,complete:function(){u(this).remove()}})}):(u("body").find('div[data-sek-level="location"]').each(function(){$sectionCollection=u(this).children('div[data-sek-level="section"]'),a=s.parseTemplate("#sek-tmpl-add-content-button");var e,t=u(this).data("sek-id");$sectionCollection.each(function(){0<u(this).find(".sek-add-content-button").length||(u.when(u(this).prepend(a({location:t}))).done(function(){e=u(this).find(".sek-add-content-button"),u(this).data("sek-id")&&e.attr("data-sek-before-section",u(this).data("sek-id")),e.fadeIn(300)}),$sectionCollection.length==u(this).index()+1&&u.when(u(this).append(a({is_last:!0,location:t}))).done(function(){e=u(this).find(".sek-add-content-button").last(),u(this).data("sek-id")&&e.attr("data-sek-after-section",u(this).data("sek-id")),e.fadeIn(300)}))})}),u(".sek-empty-location-placeholder").each(function(){0<u(this).find(".sek-add-content-button").length||u.when(u(this).append(a({location:u(this).closest('div[data-sek-level="location"]').data("sek-id")}))).done(function(){$btn_el=u(this).find(".sek-add-content-button"),$btn_el.attr("data-sek-is-first-section",!0),$btn_el.fadeIn(300)})}),k=e,u("body").find(".sek-add-content-button").each(function(){var e=u(this)[0].getBoundingClientRect(),t=k.y,a=k.x,n=Math.abs(t-e.bottom),i=Math.abs(e.top-t),o=a-e.right,s=e.left-a,r=n<40||i<40,d=0<o&&o<40||0<s&&s<40,l=a<=e.right&&e.left<=a,c=t<=e.top&&e.bottom<=t;u(this).toggleClass("sek-mouse-is-close",(r||c)&&(d||l))}))}),u(window).on("mousemove scroll",d.throttle(function(e){s.mouseMovedRecently({x:e.clientX,y:e.clientY}),clearTimeout(u.data(this,"_scroll_move_timer_")),u.data(this,"_scroll_move_timer_",setTimeout(function(){s.mouseMovedRecently.set({})},4e3))},50)),e.preview.bind("sek-drag-start",function(){s.mouseMovedRecently.set({})}),this}})}(wp.customize,jQuery,_);SekPreviewPrototype=SekPreviewPrototype||{};!function(k,u,p){u.extend(SekPreviewPrototype,{scheduleUiClickReactions:function(){var c=this;u("body").on("click",function(e){var t,a=u(e.target),n=a.closest('[data-sek-level="location"]'),i=a.closest("[data-sek-level]"),o=a.closest("[data-sek-click-on]"),s=n.data("sek-id"),r=i.data("sek-level"),d=i.data("sek-id");switch("add-content"==a.data("sek-click-on")||0<a.closest("[data-sek-click-on]").length&&"add-content"==a.closest("[data-sek-click-on]").data("sek-click-on")?"addContentButton":!p.isEmpty(a.data("sek-click-on"))||0<o.length?"UIIcon":"module"==i.data("sek-level")?"moduleWrapper":"column"==i.data("sek-level")&&!0===i.data("sek-no-modules")?"noModulesColumn":"column"==i.data("sek-level")?"columnOutsideModules":"section"==i.data("sek-level")?"sectionOutsideColumns":p.isEmpty(a.data("sek-add"))?a.hasClass("sek-to-json")?"sekToJson":"inactiveZone":"addSektion"){case"addContentButton":var l=!0===a.closest("[data-sek-is-first-section]").data("sek-is-first-section");k.preview.send("sek-add-section",{location:s,level:"section",before_section:a.closest("[data-sek-before-section]").data("sek-before-section"),after_section:a.closest("[data-sek-after-section]").data("sek-after-section"),is_first_section:l,send_to_preview:!l});break;case"UIIcon":if(i.length<1)throw new Error("ERROR => sek-front-preview => No valid level dom element found");if(t=a.closest("[data-sek-click-on]").data("sek-click-on"),p.isEmpty(t))throw new Error("Invalid action");if(p.isEmpty(r)||p.isEmpty(d))throw new Error("ERROR => sek-front-preview => No valid level id found");c._send_(a,{action:t,location:s,level:r,id:d});break;case"moduleWrapper":if(0<a.parent(".sek-dyn-ui-icons").length)return;c._send_(a,{action:"edit-module",level:r,id:d});break;case"noModulesColumn":if(0<a.parent(".sek-dyn-ui-icons").length)return;c._send_(a,{action:"pick-module",level:r,id:d});break;case"columnOutsideModules":case"sectionOutsideColumns":c._send_(a,{action:"edit-options",location:s,level:r,id:d});break;case"addSektion":k.preview.send("sek-add-section",{location:s,level:a.data("sek-add")});break;case"sekToJson":k.preview.send("sek-to-json",{id:d});break;case"inactiveZone":k.preview.send("sek-click-on-inactive-zone")}})},_send_:function(e,t){k.preview.send("sek-"+t.action,{location:t.location,level:t.level,module_type:"module"==t.level?e.closest('div[data-sek-level="module"]').data("sek-module-type"):"",id:t.id,in_column:0<e.closest('div[data-sek-level="column"]').length?e.closest('div[data-sek-level="column"]').data("sek-id"):"",in_sektion:0<e.closest('div[data-sek-level="section"]').length?e.closest('div[data-sek-level="section"]').data("sek-id"):"",clicked_input_type:0<e.closest("div[data-sek-input-type]").length?e.closest("div[data-sek-input-type]").data("sek-input-type"):"",clicked_input_id:0<e.closest("div[data-sek-input-id]").length?e.closest("div[data-sek-input-id]").data("sek-input-id"):""})}})}(wp.customize,jQuery,_);SekPreviewPrototype=SekPreviewPrototype||{};!function(s,r,d){r.extend(SekPreviewPrototype,{schedulePanelMsgReactions:function(){var o=this,e={"sek-add-section":"ajaxAddSektion","sek-add-content-in-new-sektion":"ajaxAddSektion","sek-add-column":"ajaxRefreshColumns","sek-add-module":"ajaxRefreshModulesAndNestedSections","sek-remove":function(e){var t=e.apiParams.id,a=r('div[data-sek-id="'+t+'"]');switch(e.apiParams.action){case"sek-remove-section":!0===e.apiParams.is_nested?o.ajaxRefreshModulesAndNestedSections(e):((d.isEmpty(t)||a.length<1)&&o.errare("reactToPanelMsg => sek-remove => invalid candidate id => ",t),r(".sektion-wrapper").find(a).remove());break;case"sek-remove-column":o.ajaxRefreshColumns(e);break;case"sek-remove-module":o.ajaxRefreshModulesAndNestedSections(e)}},"sek-duplicate":function(e){var t;switch(e.apiParams.action){case"sek-duplicate-section":e.apiParams.id=e.cloneId,t=o.ajaxAddSektion(e);break;case"sek-duplicate-column":e.apiParams.id=e.cloneId,t=o.ajaxRefreshColumns(e);break;case"sek-duplicate-module":e.apiParams.id=e.cloneId,t=o.ajaxRefreshModulesAndNestedSections(e)}return t},"sek-refresh-level":function(i){o.doAjax({skope_id:i.skope_id,action:"sek_get_content",id:i.apiParams.id,level:i.apiParams.level,sek_action:i.apiParams.action}).fail(function(e){o.errare("ERROR reactToPanelMsg => sek-refresh-level => ",e)}).done(function(e){var t='<span class="sek-placeholder" data-sek-placeholder-for="'+i.apiParams.id+'"></span>',a=r('div[data-sek-id="'+i.apiParams.id+'"]');if(a.length<1)o.errare("reactToPanelMsg => sek-refresh-level ajax done => the level to refresh is not rendered in the page",e);else{a.before(t);var n=r('[data-sek-placeholder-for="'+i.apiParams.id+'"]');a.remove(),n.after(e.data),n.remove(),r('div[data-sek-id="'+i.apiParams.id+'"]').trigger("sek-refresh-level",{level:i.apiParams.level,id:i.apiParams.id})}})},"sek-refresh-stylesheet":"ajaxRefreshStylesheet","sek-move":function(e){switch(e.apiParams.action){case"sek-move-column":if(e.apiParams.from_sektion!=e.apiParams.to_sektion){var t=r.extend(!0,{},e),a=r.extend(!0,{},e);r('[data-sek-id="'+e.apiParams.from_sektion+'"]',".sektion-wrapper").find('div[data-sek-level="column"]').length<1?s.preview.send("sek-add-column",{in_sektion:e.apiParams.from_sektion,autofocus:!1}):(t.apiParams=d.extend(t.apiParams,{in_sektion:e.apiParams.from_sektion,action:"sek-refresh-columns-in-sektion"}),o.ajaxRefreshColumns(t)),a.apiParams=d.extend(a.apiParams,{in_sektion:e.apiParams.to_sektion,action:"sek-refresh-columns-in-sektion"}),o.ajaxRefreshColumns(a)}break;case"sek-move-module":var n=r.extend(!0,{},e),i=r.extend(!0,{},e);n.apiParams.from_column!=n.apiParams.to_column&&(n.apiParams=d.extend(n.apiParams,{in_column:n.apiParams.from_column,in_sektion:n.apiParams.from_sektion,action:"sek-refresh-modules-in-column"}),o.ajaxRefreshModulesAndNestedSections(n)),e.apiParams=d.extend(i.apiParams,{in_column:i.apiParams.to_column,in_sektion:i.apiParams.to_sektion,action:"sek-refresh-modules-in-column"}),o.ajaxRefreshModulesAndNestedSections(i),r('[data-sek-id="'+e.apiParams.to_column+'"]',".sektion-wrapper").find(".sek-column-inner").sortable("refresh")}},"sek-resize-columns":"ajaxResizeColumns","sek-edit-options":function(e){o.activeLevelUI(e.uiParams.id)},"sek-edit-module":function(e){o.activeLevelUI(e.uiParams.id)},"sek-generate-module-ui":function(e){},"sek-drag-start":function(e){var t=1;r(".sektion-wrapper").children('[data-sek-level="section"]').each(function(){r('[data-drop-zone-before-section="'+r(this).data("sek-id")+'"]').length<1&&r(this).before('<div class="sek-content-'+e.type+'-drop-zone sek-dynamic-drop-zone sek-drop-zone" data-sek-location="between-sections" data-drop-zone-before-section="'+r(this).data("sek-id")+'"></div>'),t==r(".sektion-wrapper").children('[data-sek-level="section"]').length&&r(this).after('<div class="sek-content-'+e.type+'-drop-zone sek-dynamic-drop-zone sek-drop-zone" data-sek-location="between-sections" data-drop-zone-after-section="'+r(this).data("sek-id")+'"></div>'),t++}),r(".sek-empty-location-placeholder").each(function(){r.when(r(this).append('<div class="sek-content-'+e.type+'-drop-zone sek-dynamic-drop-zone sek-drop-zone" data-sek-location="in-empty-location"></div>'))}),"module"==e.type&&r('[data-sek-level="column"]').each(function(){var e=r(this).find('[data-sek-level="module"]'),t=1;e.each(function(){r('[data-drop-zone-before-module="'+r(this).data("sek-id")+'"]').length<1&&r(this).before('<div class="sek-content-module-drop-zone sek-dynamic-drop-zone sek-drop-zone" data-sek-location="between-modules" data-drop-zone-before-module="'+r(this).data("sek-id")+'"></div>'),t==e.length&&r('[data-drop-zone-after-module="'+r(this).data("sek-id")+'"]').length<1&&r(this).after('<div class="sek-content-module-drop-zone sek-dynamic-drop-zone sek-drop-zone" data-sek-location="between-modules" data-drop-zone-after-module="'+r(this).data("sek-id")+'"></div>'),t++})}),r("body").addClass("sek-dragging"),d.delay(function(){r(".sek-dynamic-drop-zone").css({opacity:1})},100)},"sek-drag-stop":function(e){r("body").removeClass("sek-dragging"),r(".sortable-placeholder").remove(),r(".sek-dynamic-drop-zone").remove()},"sek-focus-on":function(e){0<r('div[data-sek-id="'+e.id+'"]').length&&r("html, body").animate({scrollTop:r('div[data-sek-id="'+e.id+'"]').offset().top-100},"slow")}};d.each(e,function(t,a){s.preview.bind(a,function(e){if(e=d.extend({skope_id:"",apiParams:{},uiParams:{}},e||{}),d.isFunction(t))try{r.when(t(e)).done(function(){s.preview.send([a,"done"].join("_"),e)}).fail(function(){s.preview.send("sek-notify",{type:"error",duration:1e4,message:sekPreviewLocalized.i18n["Something went wrong, please refresh this page."]})})}catch(e){o.errare("reactToPanelMsg => Error when firing the callback of "+a,e)}else try{r.when(o[t].call(o,e)).done(function(){s.preview.send([a,"done"].join("_"),e)}).fail(function(){s.preview.send("sek-notify",{type:"error",duration:1e4,message:sekPreviewLocalized.i18n["Something went wrong, please refresh this page."]})})}catch(e){o.errare("reactToPanelMsg => Error when firing the callback of "+a,e)}})})}})}(wp.customize,jQuery,_);SekPreviewPrototype=SekPreviewPrototype||{};!function(e,o,s){o.extend(SekPreviewPrototype,{ajaxAddSektion:function(n){var i=this;return i.doAjax({action:"sek_get_content",id:n.apiParams.id,in_sektion:n.apiParams.in_sektion,in_column:n.apiParams.in_column,skope_id:n.skope_id,sek_action:n.apiParams.action,is_nested:n.apiParams.is_nested}).done(function(e){var t;if(n.apiParams.is_nested){(t=o(".sektion-wrapper").find('div[data-sek-id="'+n.apiParams.in_column+'"]')).length<1&&i.errare("preview => reactToPanelMsg => sek-add-column => no DOM node for parent column => ",n.apiParams.in_column);var a='<span class="sek-placeholder" data-sek-placeholder-for="'+n.apiParams.in_column+'"></span>';t.before(a),t.remove(),o(".sektion-wrapper").find(".sek-placeholder").after(e.data),o(".sektion-wrapper").find(".sek-placeholder").remove()}else"sek-duplicate-section"!=n.apiParams.action||s.isEmpty(n.cloneId)?($beforeCandidate=o('.sektion-wrapper[data-sek-id="'+n.apiParams.location+'"]').find('div[data-sek-id="'+n.apiParams.before_section+'"]'),$afterCandidate=o('.sektion-wrapper[data-sek-id="'+n.apiParams.location+'"]').find('div[data-sek-id="'+n.apiParams.after_section+'"]'),!s.isEmpty(n.apiParams.before_section)&&0<$beforeCandidate.length?$beforeCandidate.before(e.data):!s.isEmpty(n.apiParams.after_section)&&0<$afterCandidate.length?$afterCandidate.after(e.data):o('[data-sek-id="'+n.apiParams.location+'"]').append(e.data)):o(".sektion-wrapper").find('div[data-sek-id="'+n.apiParams.in_sektion+'"]').after(e.data);"sek-duplicate-section"==n.apiParams.action&&o('div[data-sek-id="'+n.cloneId+'"]',".sektion-wrapper").each(function(){o(this).trigger("sek-columns-refreshed")}),n.apiParams.is_nested&&(i.makeModulesSortableInColumn(n.apiParams.in_column),o(".sektion-wrapper").find('div[data-sek-id="'+n.apiParams.in_sektion+'"]').each(function(){i.maybeMakeColumnResizableInSektion.call(this)})),n.cloneId&&o('div[data-sek-id="'+n.cloneId+'"]').trigger("sek-section-added",n),o('div[data-sek-id="'+n.apiParams.id+'"]').trigger("sek-section-added",n)}).fail(function(e){i.errare("ERROR in sek_get_html_for_injection ? ",e)})}})}(wp.customize,jQuery,_);SekPreviewPrototype=SekPreviewPrototype||{};!function(e,o,t){o.extend(SekPreviewPrototype,{ajaxRefreshColumns:function(n){var i=this;return i.doAjax({action:"sek_get_content",id:n.apiParams.id,in_sektion:n.apiParams.in_sektion,skope_id:n.skope_id,sek_action:n.apiParams.action}).done(function(e){var t=o('div[data-sek-id="'+n.apiParams.in_sektion+'"]');t.length<1&&i.errare("reactToPanelMsg => "+n.apiParams.action+" => no DOM node for parent sektion => ",n.apiParams.in_sektion);var a='<span class="sek-placeholder" data-sek-placeholder-for="'+n.apiParams.in_sektion+'"></span>';t.before(a),t.remove(),o(".sektion-wrapper").find(".sek-placeholder").after(e.data),o(".sektion-wrapper").find(".sek-placeholder").remove(),i.doAjax({action:"sek_get_content",skope_id:n.skope_id,sek_action:"sek-refresh-stylesheet"}).done(function(e){i.appendDynStyleSheet(n.skope_id,e.data)}).fail(function(e){console.log("sek-refresh-stylesheet fail !")}),o('div[data-sek-id="'+n.apiParams.in_sektion+'"]').trigger("sek-columns-refreshed")}).fail(function(e){i.errare("ERROR reactToPanelMsg => sek-add-column => ",e)})},ajaxResizeColumns:function(t){var a=this;return a.doAjax({action:"sek_get_content",resized_column:t.apiParams.resized_column,sister_column:t.apiParams.sister_column,skope_id:t.skope_id,sek_action:"sek-resize-columns"}).done(function(e){o(".sektion-wrapper").find('div[data-sek-id="'+t.apiParams.resized_column+'"]').css({width:"",height:""}),a.appendDynStyleSheet(t.skope_id,e.data)}).fail(function(e){a.errare("ERROR reactToPanelMsg => sek-resize-columns => ",e)})}})}(wp.customize,jQuery,_);SekPreviewPrototype=SekPreviewPrototype||{};!function(e,o,t){o.extend(SekPreviewPrototype,{ajaxRefreshModulesAndNestedSections:function(n){var i=this;return i.doAjax({action:"sek_get_content",id:n.apiParams.id,in_sektion:n.apiParams.in_sektion,in_column:n.apiParams.in_column,skope_id:n.skope_id,sek_action:n.apiParams.action,is_nested:n.apiParams.is_nested}).done(function(e){var t=o(".sektion-wrapper").find('div[data-sek-id="'+n.apiParams.in_column+'"]');t.length<1&&i.errare("reactToPanelMsg => ajaxRefreshModulesAndNestedSections => no DOM node for parent column => ",n.apiParams.in_column);var a='<span class="sek-placeholder" data-sek-placeholder-for="'+n.apiParams.in_column+'"></span>';t.before(a),t.remove(),o(".sektion-wrapper").find('[data-sek-placeholder-for="'+n.apiParams.in_column+'"]').after(e.data),o(".sektion-wrapper").find('[data-sek-placeholder-for="'+n.apiParams.in_column+'"]').remove(),o(".sektion-wrapper").find('div[data-sek-id="'+n.apiParams.in_column+'"]').trigger("sek-modules-refreshed")}).fail(function(e){i.errare("ERROR reactToPanelMsg => sek-add-module => ",e)})}})}(wp.customize,jQuery,_);SekPreviewPrototype=SekPreviewPrototype||{};!function(e,i,o){i.extend(SekPreviewPrototype,{ajaxRefreshStylesheet:function(t){var a=this;return a.doAjax({action:"sek_get_content",skope_id:t.skope_id,sek_action:"sek-refresh-stylesheet"}).done(function(e){a.appendDynStyleSheet(t.skope_id,e.data)}).fail(function(e){a.errare("sek-refresh-stylesheet fail !")})},appendDynStyleSheet:function(e,t){var a="#sek-"+e,n="#sek-gfonts-"+e;0<i("head").find(a).length&&i("head").find(a).remove(),0<i("head").find(n).length&&i("head").find(n).remove(),i("head").append(t),!o.isEmpty(t)&&i("head").find(a).length<1?this.errare("sek-preview => problem when printing the dynamic inline style for : "+a):i("head").find(a).attr("sek-data-origin","customizer")}})}(wp.customize,jQuery,_);SekPreviewPrototype=SekPreviewPrototype||{};!function(e,s,r){s.extend(SekPreviewPrototype,{parseTemplate:r.memoize(function(t){var a,n=this,i={evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g,variable:"data"};return function(e){if(s(t).length<1)return n.errare("preview => parseTemplate => the requested tmpl does not exist =>"+t),"";try{a=a||r.template(s(t).html(),i)}catch(e){n.errare("preview => parseTemplate => problem when parsing tmpl =>"+t,e)}return a(e)}}),_prettyPrintLog:function(e){e=r.extend({bgCol:"#5ed1f5",textCol:"#000",consoleArguments:[]},e);var t,a=Array.from(e.consoleArguments);return a=r.isEmpty(r.filter(a,function(e){return!r.isString(e)}))?a.join(" "):JSON.stringify(a.join(" ")),["%c "+(t=a,r.isString(t)?300<t.length?t.substr(0,299)+"...":t:""),["background:"+e.bgCol,"color:"+e.textCol,"display: block;"].join(";")]},_wrapLogInsideTags:function(e,t,a){r.isUndefined(console)&&"function"!=typeof window.console.log||(sekPreviewLocalized.isDevMode?r.isUndefined(t)?console.log.apply(console,this._prettyPrintLog({bgCol:a,textCol:"#000",consoleArguments:["<"+e+">"]})):(console.log.apply(console,this._prettyPrintLog({bgCol:a,textCol:"#000",consoleArguments:["<"+e+">"]})),console.log(t),console.log.apply(console,this._prettyPrintLog({bgCol:a,textCol:"#000",consoleArguments:["</"+e+">"]}))):console.log.apply(console,this._prettyPrintLog({bgCol:a,textCol:"#000",consoleArguments:[e]})))},errare:function(e,t){this._wrapLogInsideTags(e,t,"#ffd5a0")},infoLog:function(e,t){this._wrapLogInsideTags(e,t,"#5ed1f5")},doAjax:function(e){var t=this,a=(e=e||(r.isObject(e)?e:{})).ajaxUrl||sekPreviewLocalized.ajaxUrl,n=sekPreviewLocalized.frontNonce,i=s.Deferred(),o=r.extend({action:"",withNonce:!1},e);return"https:"==document.location.protocol&&(a=a.replace("http://","https://")),r.isEmpty(o.action)||!r.isString(o.action)?(t.errare("self.doAjax : unproper action provided"),i.resolve().promise()):(o[n.id]=n.handle,!r.isObject(n)||r.isUndefined(n.id)||r.isUndefined(n.handle)?(t.errare("self.doAjax : unproper nonce"),i.resolve().promise()):(s.post(a,o).done(function(e){"0"!==e&&"-1"!==e&&!1!==e.success||(t.errare("self.doAjax : done ajax error for action : "+o.action,e),i.reject(e)),i.resolve(e)}).fail(function(e){t.errare("self.doAjax : failed ajax error for : "+o.action,e),i.reject(e)}),i.promise()))}})}(wp.customize,jQuery,_);SekPreviewPrototype=SekPreviewPrototype||{};!function(e,t,a){t.extend(SekPreviewPrototype,e.Events);var n=e.Class.extend(SekPreviewPrototype);e.bind("preview-ready",function(){e.preview.bind("active",function(){try{e.sekPreview=new n}catch(e){SekPreviewPrototype.errare("SekPreviewConstructor => problem on instantiation",e)}})})}(wp.customize,jQuery,_);
|
1 |
+
var SekPreviewPrototype=SekPreviewPrototype||{};!function(t,s,a){s.extend(SekPreviewPrototype,{initialize:function(){var e=this;try{this.skope_id=a.findWhere(_wpCustomizeSettings.czr_new_skopes,{skope:"local"}).skope_id}catch(e){return void this.errare("Preview => error when storing the skope_id",e)}this.scheduleHighlightActiveLevel(),e.setupLoader(),s(function(){e.setupSortable(),e.setupResizable(),e.setupUiHoverVisibility(),e.scheduleUiClickReactions(),e.schedulePanelMsgReactions()})},scheduleHighlightActiveLevel:function(){var n=this;this.activeLevelUI=new t.Value(""),this.activeUIChangedRecently=new t.Value(!1),this.activeLevelUI.bind(function(e,t){var a=s('[data-sek-id="'+e+'"]'),i=s('[data-sek-id="'+t+'"]');0<a.length&&a.addClass("sek-active-ui sek-highlight-active-ui"),0<i.length&&i.removeClass("sek-active-ui sek-highlight-active-ui"),n.activeUIChangedRecently(Date.now())}),a.each(["sek-refresh-stylesheet","sek-refresh-level"],function(e){t.preview.bind(e,function(e){n.activeUIChangedRecently(Date.now())})}),this.activeUIChangedRecently.bind(function(e){var t=s('[data-sek-id="'+n.activeLevelUI()+'"]');s(".sek-highlight-active-ui").length&&s(".sek-highlight-active-ui").removeClass("sek-highlight-active-ui"),0<t.length&&t.toggleClass("sek-highlight-active-ui",!1!==e),clearTimeout(s.data(this,"_ui_change_timer_")),s.data(this,"_ui_change_timer_",setTimeout(function(){n.activeUIChangedRecently(!1)},3e3))})}})}(wp.customize,jQuery,_);SekPreviewPrototype=SekPreviewPrototype||{};!function(l,c,k){c.extend(SekPreviewPrototype,{setupSortable:function(){var a=this;return this.sortableDefaultParams={placeholder:"sortable-placeholder",over:function(e,t){}},c('[data-sek-level="location"]').each(function(){a.makeSektionsSortableInLocation(c(this).data("sek-id"))}),c("body").on("sek-section-added sek-level-refreshed",'[data-sek-level="location"]',function(e,t){a.makeSektionsSortableInLocation(c(this).data("sek-id"))}),c('[data-sek-level="location"]').each(function(){c(this).find('[data-sek-level="section"]').each(function(){a.makeColumnsSortableInSektion(c(this).data("sek-id"))})}),c("body").on("sek-columns-refreshed sek-section-added",'[data-sek-level="section"]',function(e){a.makeColumnsSortableInSektion(c(this).data("sek-id"))}),c('[data-sek-level="location"]').each(function(){c(this).find('[data-sek-level="column"]').each(function(){a.makeModulesSortableInColumn(c(this).data("sek-id"))})}),c("body").on("sek-modules-refreshed",'[data-sek-level="column"]',function(){a.makeModulesSortableInColumn(c(this).data("sek-id"))}),c("body").on("sek-columns-refreshed",'[data-sek-level="section"]',function(){c(this).find(".sek-sektion-inner").first().children('[data-sek-level="column"]').each(function(){a.makeModulesSortableInColumn(c(this).data("sek-id"))})}),this},makeSektionsSortableInLocation:function(e){var a,i,t,n=this,s=[],o=[];c('[data-sek-id="'+e+'"]').each(function(){t=c.extend(!0,{},n.sortableDefaultParams),c(this).sortable(k.extend(t,{handle:".sek-move-section",connectWith:'[data-sek-level="location"]',placeholder:{element:function(e){return c('<div class="sortable-placeholder"><div class="sek-module-placeholder-content"><p>'+sekPreviewLocalized.i18n["Insert here"]+"</p></div></div>")[0]},update:function(e,t){}},start:function(e,t){c("body").addClass("sek-moving-section"),$sourceLocation=t.item.closest('[data-sek-level="location"]'),a=$sourceLocation.data("sek-id"),$sourceLocation.children('[data-sek-level="section"]').each(function(){s.push(c(this).data("sek-id"))})},stop:function(e,t){c("body").removeClass("sek-moving-section"),o=[],$targetLocation=t.item.closest('[data-sek-level="location"]'),i=$targetLocation.data("sek-id"),$targetLocation.children('[data-sek-level="section"]').each(function(){o.push(c(this).data("sek-id"))}),l.preview.send("sek-move",{id:t.item.data("sek-id"),level:"section",newOrder:o,from_location:a,to_location:i})},over:function(e,t){t.placeholder.addClass("sek-sortable-section-over")},out:function(e,t){t.placeholder.removeClass("sek-sortable-section-over")}}))})},makeColumnsSortableInSektion:function(e){var a=this,t=c.extend(!0,{},a.sortableDefaultParams);c('[data-sek-id="'+e+'"]').find(".sek-sektion-inner").first().sortable(k.extend(t,{handle:".sek-move-column",connectWith:".sek-sektion-inner",remove:function(e,t){return $targetSektionCandidate=t.item.closest('[data-sek-level="section"]'),!(0<$targetSektionCandidate.length&&12<$targetSektionCandidate.find(".sek-sektion-inner").first().children('[data-sek-level="column"]').length)||(l.preview.send("sek-notify",{message:sekPreviewLocalized.i18n["You've reached the maximum number of columns allowed in this section."]}),!1)},start:function(e,t){startOrder=[],newOrder=[],from_sektion=t.item.closest('[data-sek-level="section"]').data("sek-id"),t.item.closest('[data-sek-level="section"]').find(".sek-sektion-inner").first().children('[data-sek-level="column"]').each(function(){startOrder.push(c(this).data("sek-id"))}),k.isEmpty(startOrder)&&a.errare("column sortable => startOrder should not be empty")},stop:function(e,t){$targetSektion=t.item.closest('[data-sek-level="section"]'),to_sektion=$targetSektion.data("sek-id"),$targetSektion.find(".sek-sektion-inner").first().children('[data-sek-level="column"]').each(function(){newOrder.push(c(this).data("sek-id"))}),k.isEmpty(newOrder)?a.errare("column sortable => newOrder should not be empty"):k.isEqual(newOrder,startOrder)&&to_sektion===from_sektion?sekPreviewLocalized.isDevMode&&a.errare("preview => makeModulesSortableInColumn => start and stop positions are identical"):l.preview.send("sek-move",{id:t.item.data("sek-id"),level:"column",newOrder:newOrder,from_sektion:from_sektion,to_sektion:to_sektion})}}))},makeModulesSortableInColumn:function(e){var a,i,n,s,t,o=[],r=[],d=this;t=c.extend(!0,{},d.sortableDefaultParams),c('[data-sek-id="'+e+'"]').find(".sek-column-inner").first().sortable(k.extend(t,{handle:".sek-move-module",connectWith:".sek-column-inner",over:function(e,t){c('[data-sek-level="location"]').find(".sek-sortable-overing").each(function(){c(this).removeClass("sek-sortable-overing")}),c(e.target).addClass("sek-sortable-overing")},start:function(e,t){o=[],r=[],c("body").addClass("sek-dragging-element"),i=t.item.closest('[data-sek-level="column"]').data("sek-id"),a=t.item.closest('[data-sek-level="section"]').data("sek-id"),t.item.closest('[data-sek-level="column"]').find(".sek-column-inner").first().children('[data-sek-level="module"]').each(function(){o.push(c(this).data("sek-id"))}),k.isEmpty(o)&&d.errare("makeModulesSortableInColumn => startOrder should not be empty")},stop:function(e,t){s=t.item.closest('[data-sek-level="column"]'),n=s.data("sek-id"),s.find(".sek-column-inner").first().children("[data-sek-id]").each(function(){r.push(c(this).data("sek-id"))}),k.isEmpty(r)?d.errare("makeModulesSortableInColumn => newOrder should not be empty"):k.isEqual(r,o)&&n===i?d.errare("preview => makeModulesSortableInColumn => start and stop positions are identical"):(l.preview.send("sek-move",{id:t.item.data("sek-id"),level:"module",newOrder:r,from_column:i,to_column:n,from_sektion:a,to_sektion:t.item.closest('[data-sek-level="section"]').data("sek-id")}),c("body").removeClass("sek-dragging-element"))}}))}})}(wp.customize,jQuery,_);SekPreviewPrototype=SekPreviewPrototype||{};!function(l,c,k){c.extend(SekPreviewPrototype,{setupResizable:function(){var t=this;return c(".sektion-wrapper").find('div[data-sek-level="section"]').each(function(){t.maybeMakeColumnResizableInSektion.call(this)}),c("body").on("sek-modules-refreshed sek-columns-refreshed",'div[data-sek-level="section"]',function(e){t.maybeMakeColumnResizableInSektion.call(this)}),this},maybeMakeColumnResizableInSektion:function(){var a,i,n,s,o,r,d,e=c(this).find(".sek-sektion-inner").first().children('div[data-sek-level="column"]');e.length<2||e.each(function(){c(this).resizable({resize:function(e,t){c(".sektion-wrapper").data("sek-resizing-columns",!0)},start:function(e,t){if(a=t.element.closest('div[data-sek-level="section"]'),a.data("sek-id"),i=a.find(".sek-sektion-inner")[0].getBoundingClientRect().width,!((o=a.find(".sek-sektion-inner").first().children('div[data-sek-level="column"]').length)<2)){if((n=t.element.closest('div[data-sek-level="column"]')).length<1)throw new Error("ERROR => resizable => No valid level dom element found");d=n.index()+1==o,r=d?n.prev():n.next(),c(".sektion-wrapper").data("sek-resizing-columns",!0),k.delay(function(){c(".sektion-wrapper").data("sek-resizing-columns",!1)},3e3)}},stop:function(e,t){if(!(o<2)){if(n.length<1)throw new Error("ERROR => resizable => No valid level dom element found");n.css({width:"",height:""}),s=(parseFloat(t.size.width)/parseFloat(i)*100).toFixed(3),l.preview.send("sek-resize-columns",{action:"sek-resize-columns",level:n.data("sek-level"),in_sektion:a.data("sek-id"),id:n.data("sek-id"),resized_column:n.data("sek-id"),sister_column:r.data("sek-id"),resizedColumnWidthInPercent:s,col_number:o}),c(".sektion-wrapper").data("sek-resizing-columns",!1)}},helper:"ui-resizable-helper",handles:"e"});var e=c(this);k.delay(function(){e.find(".ui-resizable-handle").find(".fa-arrows-alt-h").length<1&&e.find(".ui-resizable-handle").append('<i class="fas fa-arrows-alt-h"></i>')},500)})}})}(wp.customize,jQuery,_);SekPreviewPrototype=SekPreviewPrototype||{};!function(e,u,d){u.extend(SekPreviewPrototype,{setupUiHoverVisibility:function(){var i,n,s,o,t,r=this;u("body").on("mouseenter","[data-sek-level]",function(e){if("location"!=(n=u(this).data("sek-level"))&&!(0<(o=u(this)).children(".sek-dyn-ui-wrapper").length&&!0!==o.data("UIisFadingOut"))){switch(s={id:o.data("sek-id"),level:o.data("sek-level")},n){case"section":s=d.extend(s,{is_last_possible_section:!0===u(this).data("sek-is-nested"),can_have_more_columns:u(this).find(".sek-sektion-inner").first().children('div[data-sek-level="column"]').length<12});break;case"column":var t=u(this).closest('div[data-sek-level="section"]');s=d.extend(s,{parent_can_have_more_columns:t.find(".sek-sektion-inner").first().children('div[data-sek-level="column"]').length<12,parent_is_single_column:t.find(".sek-sektion-inner").first().children('div[data-sek-level="column"]').length<2,parent_is_last_allowed_nested:!0===t.data("sek-is-nested")});break;case"module":var a=r.getRegisteredModuleProperty(o.data("sek-module-type"),"name");s=d.extend(s,{module_name:"not_set"!=a?a:""})}!0===u(".sektion-wrapper").data("sek-resizing-columns")&&d.contains(["column","module"],n)||(i=r.parseTemplate("#sek-dyn-ui-tmpl-"+n),u.when(u(this).prepend(i(s))).done(function(){o.find(".sek-dyn-ui-wrapper").stop(!0,!0).fadeIn({duration:150,complete:function(){}})}))}}).on("mouseleave","[data-sek-level]",function(e){(o=u(this)).data("UIisFadingOut",!0),o.children(".sek-dyn-ui-wrapper").stop(!0,!0).fadeOut({duration:150,complete:function(){u(this).remove(),o.data("UIisFadingOut",!1)}})}),u("body").on("mouseenter",".sek-wp-content-wrapper",function(e){0<(t=u(this)).children(".sek-dyn-ui-wrapper").length&&!0!==t.data("UIisFadingOut")||(i=r.parseTemplate("#sek-dyn-ui-tmpl-wp-content"),u.when(t.prepend(i({}))).done(function(){t.find(".sek-dyn-ui-wrapper").stop(!0,!0).fadeIn({duration:150,complete:function(){}})}))}).on("mouseleave",".sek-wp-content-wrapper",function(e){u(this).data("UIisFadingOut",!0),t=u(this),u(this).children(".sek-dyn-ui-wrapper").stop(!0,!0).fadeOut({duration:150,complete:function(){u(this).remove(),t.data("UIisFadingOut",!1)}})});return r.mouseMovedRecently=new e.Value({}),r.mouseMovedRecently.bind(function(e){var k;d.isEmpty(e)?u("body").stop(!0,!0).find(".sek-add-content-button").each(function(){u(this).fadeOut({duration:200,complete:function(){u(this).remove()}})}):(u("body").find('div[data-sek-level="location"]').each(function(){$sectionCollection=u(this).children('div[data-sek-level="section"]'),i=r.parseTemplate("#sek-tmpl-add-content-button");var e,t=u(this).data("sek-id");$sectionCollection.each(function(){0<u(this).find(".sek-add-content-button").length||(u.when(u(this).prepend(i({location:t}))).done(function(){e=u(this).find(".sek-add-content-button"),u(this).data("sek-id")&&e.attr("data-sek-before-section",u(this).data("sek-id")),e.fadeIn(300)}),$sectionCollection.length==u(this).index()+1&&u.when(u(this).append(i({is_last:!0,location:t}))).done(function(){e=u(this).find(".sek-add-content-button").last(),u(this).data("sek-id")&&e.attr("data-sek-after-section",u(this).data("sek-id")),e.fadeIn(300)}))})}),u(".sek-empty-location-placeholder").each(function(){0<u(this).find(".sek-add-content-button").length||u.when(u(this).append(i({location:u(this).closest('div[data-sek-level="location"]').data("sek-id")}))).done(function(){$btn_el=u(this).find(".sek-add-content-button"),$btn_el.attr("data-sek-is-first-section",!0),$btn_el.fadeIn(300)})}),k=e,u("body").find(".sek-add-content-button").each(function(){var e=u(this)[0].getBoundingClientRect(),t=k.y,a=k.x,i=Math.abs(t-e.bottom),n=Math.abs(e.top-t),s=a-e.right,o=e.left-a,r=i<40||n<40,d=0<s&&s<40||0<o&&o<40,l=a<=e.right&&e.left<=a,c=t<=e.top&&e.bottom<=t;u(this).toggleClass("sek-mouse-is-close",(r||c)&&(d||l))}))}),u(window).on("mousemove scroll",d.throttle(function(e){r.mouseMovedRecently({x:e.clientX,y:e.clientY}),clearTimeout(u.data(this,"_scroll_move_timer_")),u.data(this,"_scroll_move_timer_",setTimeout(function(){r.mouseMovedRecently.set({})},4e3))},50)),e.preview.bind("sek-drag-start",function(){r.mouseMovedRecently.set({})}),this}})}(wp.customize,jQuery,_);SekPreviewPrototype=SekPreviewPrototype||{};!function(u,p,m){p.extend(SekPreviewPrototype,{scheduleUiClickReactions:function(){var k=this;p("body").on("click",function(e){var t,a=p(e.target),i=a.closest('[data-sek-level="location"]'),n=a.closest("[data-sek-level]"),s=a.closest("[data-sek-click-on]"),o=i.data("sek-id"),r=n.data("sek-level"),d=n.data("sek-id");switch("add-content"==a.data("sek-click-on")||0<a.closest("[data-sek-click-on]").length&&"add-content"==a.closest("[data-sek-click-on]").data("sek-click-on")?"addContentButton":!m.isEmpty(a.data("sek-click-on"))||0<s.length?"UIIcon":"module"==n.data("sek-level")?"moduleWrapper":"column"==n.data("sek-level")&&!0===n.data("sek-no-modules")?"noModulesColumn":"column"==n.data("sek-level")?"columnOutsideModules":"section"==n.data("sek-level")?"sectionOutsideColumns":m.isEmpty(a.data("sek-add"))?a.hasClass("sek-to-json")?"sekToJson":a.hasClass("sek-wp-content-wrapper")||a.hasClass("sek-wp-content-dyn-ui")?"wpContent":a.hasClass("sek-edit-wp-content")?"editWpContent":"inactiveZone":"addSektion"){case"addContentButton":var l=!0===a.closest("[data-sek-is-first-section]").data("sek-is-first-section");u.preview.send("sek-add-section",{location:o,level:"section",before_section:a.closest("[data-sek-before-section]").data("sek-before-section"),after_section:a.closest("[data-sek-after-section]").data("sek-after-section"),is_first_section:l,send_to_preview:!l});break;case"UIIcon":if(n.length<1)throw new Error("ERROR => sek-front-preview => No valid level dom element found");if(t=a.closest("[data-sek-click-on]").data("sek-click-on"),m.isEmpty(t))throw new Error("Invalid action");if(m.isEmpty(r)||m.isEmpty(d))throw new Error("ERROR => sek-front-preview => No valid level id found");k._send_(a,{action:t,location:o,level:r,id:d,was_triggered:!1});break;case"moduleWrapper":if(0<a.parent(".sek-dyn-ui-icons").length)return;k._send_(a,{action:"edit-module",level:r,id:d});break;case"noModulesColumn":if(0<a.parent(".sek-dyn-ui-icons").length)return;k._send_(a,{action:"pick-module",level:r,id:d});break;case"columnOutsideModules":case"sectionOutsideColumns":k._send_(a,{action:"edit-options",location:o,level:r,id:d});break;case"addSektion":u.preview.send("sek-add-section",{location:o,level:a.data("sek-add")});break;case"sekToJson":u.preview.send("sek-to-json",{id:d});break;case"wpContent":u.preview.send("sek-notify",{type:"info",duration:8e3,message:sekPreviewLocalized.i18n["This content has been created with the WordPress editor."]});break;case"editWpContent":var c=a.closest("[data-sek-wp-edit-link]").data("sek-wp-edit-link");m.isEmpty(c)||window.open(c,"_blank");break;case"inactiveZone":u.preview.send("sek-click-on-inactive-zone")}})},_send_:function(e,t){u.preview.send("sek-"+t.action,{location:t.location,level:t.level,module_type:"module"==t.level?e.closest('div[data-sek-level="module"]').data("sek-module-type"):"",id:t.id,in_column:0<e.closest('div[data-sek-level="column"]').length?e.closest('div[data-sek-level="column"]').data("sek-id"):"",in_sektion:0<e.closest('div[data-sek-level="section"]').length?e.closest('div[data-sek-level="section"]').data("sek-id"):"",clicked_input_type:0<e.closest("div[data-sek-input-type]").length?e.closest("div[data-sek-input-type]").data("sek-input-type"):"",clicked_input_id:0<e.closest("div[data-sek-input-id]").length?e.closest("div[data-sek-input-id]").data("sek-input-id"):"",was_triggered:t.was_triggered})}})}(wp.customize,jQuery,_);SekPreviewPrototype=SekPreviewPrototype||{};!function(e,n,s){n.extend(SekPreviewPrototype,{setupLoader:function(){var t=this;this._css_loader_html='<div class="sek-css-loader sek-mr-loader" style="display:none"><div></div><div></div><div></div></div>',n("body").on(["sek-modules-refreshed","sek-columns-refreshed","sek-section-added","sek-level-refreshed","sek-stylesheet-refreshed","sek-ajax-error"].join(" "),function(e){t.cleanLoader()})},mayBePrintLoader:function(e){var t=this,a=e.loader_located_in_level_id;if(!s.isEmpty(a)){var i=n('[data-sek-id="'+a+'"]');0<i.length&&n(".sek-level-clone ").length<1&&($levelClone=n("<div>",{class:"sek-level-clone"}),i.find("[data-sek-level]").each(function(){n(this).addClass("sek-refreshing")}),i.prepend($levelClone),$levelClone.css({width:i.outerWidth()+"px",height:i.outerHeight()+"px"}).append(t._css_loader_html).find(".sek-css-loader").fadeIn("fast"),clearTimeout(n.data(this,"_nimble_loader_active_timer_")),n.data(this,"_nimble_loader_active_timer_",setTimeout(function(){t.cleanLoader()},4e3)))}},cleanLoader:function(){n(".sek-level-clone").remove(),n("[data-sek-level]").each(function(){n(this).removeClass("sek-refreshing")})}})}(wp.customize,jQuery,_);SekPreviewPrototype=SekPreviewPrototype||{};!function(o,r,d){r.extend(SekPreviewPrototype,{schedulePanelMsgReactions:function(){var s=this,e={"sek-add-section":"ajaxAddSektion","sek-add-content-in-new-sektion":"ajaxAddSektion","sek-add-column":"ajaxRefreshColumns","sek-add-module":"ajaxRefreshModulesAndNestedSections","sek-refresh-stylesheet":"ajaxRefreshStylesheet","sek-resize-columns":"ajaxResizeColumns","sek-remove":function(e){var t,a=e.apiParams.id,i=r('div[data-sek-id="'+a+'"]');switch(e.apiParams.action){case"sek-remove-section":s.mayBePrintLoader({loader_located_in_level_id:e.apiParams.location}),!0===e.apiParams.is_nested?t=s.ajaxRefreshModulesAndNestedSections(e):((d.isEmpty(a)||i.length<1)&&s.errare("reactToPanelMsg => sek-remove => invalid candidate id => ",a),r("body").find(i).remove(),r('[data-sek-id="'+e.apiParams.location+'"]').trigger("sek-level-refreshed"));break;case"sek-remove-column":t=s.ajaxRefreshColumns(e);break;case"sek-remove-module":t=s.ajaxRefreshModulesAndNestedSections(e)}return d.isEmpty(t)?r.Deferred(function(){this.resolve()}):t},"sek-duplicate":function(e){var t;switch(e.apiParams.action){case"sek-duplicate-section":e.apiParams.id=e.cloneId,t=s.ajaxAddSektion(e);break;case"sek-duplicate-column":e.apiParams.id=e.cloneId,t=s.ajaxRefreshColumns(e);break;case"sek-duplicate-module":e.apiParams.id=e.cloneId,t=s.ajaxRefreshModulesAndNestedSections(e)}return t},"sek-refresh-level":function(n){return s.mayBePrintLoader({loader_located_in_level_id:n.apiParams.id}),s.doAjax({skope_id:n.skope_id,action:"sek_get_content",id:n.apiParams.id,level:n.apiParams.level,sek_action:n.apiParams.action}).fail(function(e){s.errare("ERROR reactToPanelMsg => sek-refresh-level => ",e),r('[data-sek-id="'+n.apiParams.id+'"]').trigger("sek-ajax-error")}).done(function(e){var t='<span class="sek-placeholder" data-sek-placeholder-for="'+n.apiParams.id+'"></span>',a=r('div[data-sek-id="'+n.apiParams.id+'"]');if(a.length<1)s.errare("reactToPanelMsg => sek-refresh-level ajax done => the level to refresh is not rendered in the page",e);else{a.before(t);var i=r('[data-sek-placeholder-for="'+n.apiParams.id+'"]');a.remove(),i.after(e.data),i.remove(),r('[data-sek-id="'+n.apiParams.id+'"]').trigger("sek-level-refreshed",{level:n.apiParams.level,id:n.apiParams.id})}})},"sek-move":function(e){switch(e.apiParams.action){case"sek-move-column":if(e.apiParams.from_sektion!=e.apiParams.to_sektion){var t=r.extend(!0,{},e),a=r.extend(!0,{},e);r('[data-sek-id="'+e.apiParams.from_sektion+'"]',".sektion-wrapper").find('div[data-sek-level="column"]').length<1?o.preview.send("sek-add-column",{in_sektion:e.apiParams.from_sektion,autofocus:!1}):(t.apiParams=d.extend(t.apiParams,{in_sektion:e.apiParams.from_sektion,action:"sek-refresh-columns-in-sektion"}),s.ajaxRefreshColumns(t)),a.apiParams=d.extend(a.apiParams,{in_sektion:e.apiParams.to_sektion,action:"sek-refresh-columns-in-sektion"}),s.ajaxRefreshColumns(a)}break;case"sek-move-module":var i=r.extend(!0,{},e),n=r.extend(!0,{},e);i.apiParams.from_column!=i.apiParams.to_column&&(i.apiParams=d.extend(i.apiParams,{in_column:i.apiParams.from_column,in_sektion:i.apiParams.from_sektion,action:"sek-refresh-modules-in-column"}),s.ajaxRefreshModulesAndNestedSections(i)),e.apiParams=d.extend(n.apiParams,{in_column:n.apiParams.to_column,in_sektion:n.apiParams.to_sektion,action:"sek-refresh-modules-in-column"}),s.ajaxRefreshModulesAndNestedSections(n),r('[data-sek-id="'+e.apiParams.to_column+'"]',".sektion-wrapper").find(".sek-column-inner").sortable("refresh")}},"sek-edit-options":function(e){s.activeLevelUI(e.uiParams.id)},"sek-edit-module":function(e){s.activeLevelUI(e.uiParams.id)},"sek-drag-start":function(e){var t=1;r(".sektion-wrapper").children('[data-sek-level="section"]').each(function(){r('[data-drop-zone-before-section="'+r(this).data("sek-id")+'"]').length<1&&r(this).before('<div class="sek-content-'+e.type+'-drop-zone sek-dynamic-drop-zone sek-drop-zone" data-sek-location="between-sections" data-drop-zone-before-section="'+r(this).data("sek-id")+'"></div>'),t==r(".sektion-wrapper").children('[data-sek-level="section"]').length&&r(this).after('<div class="sek-content-'+e.type+'-drop-zone sek-dynamic-drop-zone sek-drop-zone" data-sek-location="between-sections" data-drop-zone-after-section="'+r(this).data("sek-id")+'"></div>'),t++}),r(".sek-empty-location-placeholder").each(function(){r.when(r(this).append('<div class="sek-content-'+e.type+'-drop-zone sek-dynamic-drop-zone sek-drop-zone" data-sek-location="in-empty-location"></div>'))}),"module"==e.type&&r('[data-sek-level="column"]').each(function(){var e=r(this).children(".sek-column-inner").children('[data-sek-level="module"]'),t=r(this).children(".sek-column-inner").children('[data-sek-is-nested="true"]');e=e.add(t);var a=1;e.each(function(){r('[data-drop-zone-before-module-or-nested-section="'+r(this).data("sek-id")+'"]').length<1&&r(this).before('<div class="sek-content-module-drop-zone sek-dynamic-drop-zone sek-drop-zone" data-sek-location="between-modules-and-nested-sections" data-drop-zone-before-module-or-nested-section="'+r(this).data("sek-id")+'"></div>'),a==e.length&&r('[data-drop-zone-after-module-or-nested-section="'+r(this).data("sek-id")+'"]').length<1&&r(this).after('<div class="sek-content-module-drop-zone sek-dynamic-drop-zone sek-drop-zone" data-sek-location="between-modules-and-nested-sections" data-drop-zone-after-module-or-nested-section="'+r(this).data("sek-id")+'"></div>'),a++})}),r("body").addClass("sek-dragging"),d.delay(function(){r(".sek-dynamic-drop-zone").css({opacity:1})},100)},"sek-drag-stop":function(e){r("body").removeClass("sek-dragging"),r(".sortable-placeholder").remove(),r(".sek-dynamic-drop-zone").remove()},"sek-focus-on":function(e){0<r('div[data-sek-id="'+e.id+'"]').length&&r("html, body").animate({scrollTop:r('div[data-sek-id="'+e.id+'"]').offset().top-100},"slow")}};d.each(e,function(t,a){o.preview.bind(a,function(e){if(e=d.extend({skope_id:"",apiParams:{},uiParams:{}},e||{}),d.isFunction(t))try{r.when(t(e)).done(function(){o.preview.send([a,"done"].join("_"),e)}).fail(function(){o.preview.send("sek-notify",{type:"error",duration:1e4,message:sekPreviewLocalized.i18n["Something went wrong, please refresh this page."]})}).then(function(){o.preview.trigger("control-panel-requested-action-done",{action:a,args:e})})}catch(e){s.errare("reactToPanelMsg => Error when firing the callback of "+a,e)}else try{r.when(s[t].call(s,e)).done(function(){o.preview.send([a,"done"].join("_"),e)}).fail(function(){o.preview.send("sek-notify",{type:"error",duration:1e4,message:sekPreviewLocalized.i18n["Something went wrong, please refresh this page."]})}).then(function(){o.preview.trigger("control-panel-requested-action-done",{action:a,args:e})})}catch(e){s.errare("reactToPanelMsg => Error when firing the callback of "+a,e)}})})}})}(wp.customize,jQuery,_);SekPreviewPrototype=SekPreviewPrototype||{};!function(e,s,o){s.extend(SekPreviewPrototype,{ajaxAddSektion:function(i){var n=this;return n.mayBePrintLoader({loader_located_in_level_id:i.apiParams.location}),n.doAjax({action:"sek_get_content",id:i.apiParams.id,in_sektion:i.apiParams.in_sektion,in_column:i.apiParams.in_column,skope_id:i.skope_id,sek_action:i.apiParams.action,is_nested:i.apiParams.is_nested}).done(function(e){var t;if(i.apiParams.is_nested){(t=s(".sektion-wrapper").find('div[data-sek-id="'+i.apiParams.in_column+'"]')).length<1&&n.errare("preview => reactToPanelMsg => sek-add-column => no DOM node for parent column => ",i.apiParams.in_column);var a='<span class="sek-placeholder" data-sek-placeholder-for="'+i.apiParams.in_column+'"></span>';t.before(a),t.remove(),s(".sektion-wrapper").find(".sek-placeholder").after(e.data),s(".sektion-wrapper").find(".sek-placeholder").remove()}else"sek-duplicate-section"!=i.apiParams.action||o.isEmpty(i.cloneId)?($beforeCandidate=s('.sektion-wrapper[data-sek-id="'+i.apiParams.location+'"]').find('div[data-sek-id="'+i.apiParams.before_section+'"]'),$afterCandidate=s('.sektion-wrapper[data-sek-id="'+i.apiParams.location+'"]').find('div[data-sek-id="'+i.apiParams.after_section+'"]'),!o.isEmpty(i.apiParams.before_section)&&0<$beforeCandidate.length?$beforeCandidate.before(e.data):!o.isEmpty(i.apiParams.after_section)&&0<$afterCandidate.length?$afterCandidate.after(e.data):s('[data-sek-id="'+i.apiParams.location+'"]').append(e.data)):s(".sektion-wrapper").find('div[data-sek-id="'+i.apiParams.in_sektion+'"]').after(e.data);"sek-duplicate-section"==i.apiParams.action&&s('div[data-sek-id="'+i.cloneId+'"]',".sektion-wrapper").each(function(){s(this).trigger("sek-columns-refreshed")}),i.apiParams.is_nested&&(n.makeModulesSortableInColumn(i.apiParams.in_column),s(".sektion-wrapper").find('div[data-sek-id="'+i.apiParams.in_sektion+'"]').each(function(){n.maybeMakeColumnResizableInSektion.call(this)})),i.cloneId&&s('div[data-sek-id="'+i.cloneId+'"]').trigger("sek-section-added",i),s('div[data-sek-id="'+i.apiParams.id+'"]').trigger("sek-section-added",i)}).fail(function(e){n.errare("ERROR in sek_get_html_for_injection ? ",e),s('[data-sek-id="'+i.apiParams.id+'"]').trigger("sek-ajax-error")})}})}(wp.customize,jQuery,_);SekPreviewPrototype=SekPreviewPrototype||{};!function(e,s,t){s.extend(SekPreviewPrototype,{ajaxRefreshColumns:function(i){var n=this;return n.mayBePrintLoader({loader_located_in_level_id:i.apiParams.in_sektion}),n.doAjax({action:"sek_get_content",id:i.apiParams.id,in_sektion:i.apiParams.in_sektion,skope_id:i.skope_id,sek_action:i.apiParams.action}).done(function(e){var t=s('div[data-sek-id="'+i.apiParams.in_sektion+'"]');t.length<1&&n.errare("reactToPanelMsg => "+i.apiParams.action+" => no DOM node for parent sektion => ",i.apiParams.in_sektion);var a='<span class="sek-placeholder" data-sek-placeholder-for="'+i.apiParams.in_sektion+'"></span>';t.before(a),t.remove(),s(".sektion-wrapper").find(".sek-placeholder").after(e.data),s(".sektion-wrapper").find(".sek-placeholder").remove(),n.doAjax({action:"sek_get_content",skope_id:i.skope_id,sek_action:"sek-refresh-stylesheet"}).done(function(e){n.appendDynStyleSheet(i.skope_id,e.data)}).fail(function(e){console.log("sek-refresh-stylesheet fail !")}),s('div[data-sek-id="'+i.apiParams.in_sektion+'"]').trigger("sek-columns-refreshed")}).fail(function(e){n.errare("ERROR reactToPanelMsg => sek-add-column => ",e),s('[data-sek-id="'+i.apiParams.id+'"]').trigger("sek-ajax-error")})},ajaxResizeColumns:function(t){var a=this;return a.mayBePrintLoader({loader_located_in_level_id:t.apiParams.in_sektion}),a.doAjax({action:"sek_get_content",resized_column:t.apiParams.resized_column,sister_column:t.apiParams.sister_column,skope_id:t.skope_id,sek_action:"sek-resize-columns"}).done(function(e){s('[data-sek-id="'+t.apiParams.resized_column+'"]').css({width:"",height:""}),a.appendDynStyleSheet(t.skope_id,e.data),s('div[data-sek-id="'+t.apiParams.in_sektion+'"]').trigger("sek-columns-refreshed")}).fail(function(e){a.errare("ERROR reactToPanelMsg => sek-resize-columns => ",e),s('[data-sek-id="'+t.apiParams.in_sektion+'"]').trigger("sek-ajax-error")})}})}(wp.customize,jQuery,_);SekPreviewPrototype=SekPreviewPrototype||{};!function(e,s,t){s.extend(SekPreviewPrototype,{ajaxRefreshModulesAndNestedSections:function(i){var n=this;return n.mayBePrintLoader({loader_located_in_level_id:i.apiParams.in_column}),n.doAjax({action:"sek_get_content",id:i.apiParams.id,in_sektion:i.apiParams.in_sektion,in_column:i.apiParams.in_column,skope_id:i.skope_id,sek_action:i.apiParams.action,is_nested:i.apiParams.is_nested}).done(function(e){var t=s('[data-sek-id="'+i.apiParams.in_column+'"]');t.length<1&&n.errare("reactToPanelMsg => ajaxRefreshModulesAndNestedSections => no DOM node for parent column => ",i.apiParams.in_column);var a='<span class="sek-placeholder" data-sek-placeholder-for="'+i.apiParams.in_column+'"></span>';t.before(a),t.remove(),s('[data-sek-placeholder-for="'+i.apiParams.in_column+'"]').after(e.data),s('[data-sek-placeholder-for="'+i.apiParams.in_column+'"]').remove(),s('[data-sek-id="'+i.apiParams.in_column+'"]').trigger("sek-modules-refreshed")}).fail(function(e){n.errare("ERROR reactToPanelMsg => sek-add-module => ",e),s('[data-sek-id="'+i.apiParams.id+'"]').trigger("sek-ajax-error")})}})}(wp.customize,jQuery,_);SekPreviewPrototype=SekPreviewPrototype||{};!function(e,n,s){n.extend(SekPreviewPrototype,{ajaxRefreshStylesheet:function(t){var a=this;return a.mayBePrintLoader({loader_located_in_level_id:t.apiParams.id}),a.doAjax({action:"sek_get_content",skope_id:t.skope_id,sek_action:"sek-refresh-stylesheet"}).done(function(e){a.appendDynStyleSheet(t.skope_id,e.data),n('[data-sek-id="'+t.apiParams.id+'"]').trigger("sek-stylesheet-refreshed",{level:t.apiParams.level,id:t.apiParams.id})}).fail(function(e){a.errare("sek-refresh-stylesheet fail !"),n('[data-sek-id="'+t.apiParams.id+'"]').trigger("sek-ajax-error")})},appendDynStyleSheet:function(e,t){var a="#sek-"+e,i="#sek-gfonts-"+e;0<n("head").find(a).length&&n("head").find(a).remove(),0<n("head").find(i).length&&n("head").find(i).remove(),n("head").append(t),!s.isEmpty(t)&&n("head").find(a).length<1?this.errare("sek-preview => problem when printing the dynamic inline style for : "+a):n("head").find(a).attr("sek-data-origin","customizer")}})}(wp.customize,jQuery,_);SekPreviewPrototype=SekPreviewPrototype||{};!function(e,o,r){o.extend(SekPreviewPrototype,{parseTemplate:r.memoize(function(t){var a,i=this,n={evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g,variable:"data"};return function(e){if(o(t).length<1)return i.errare("preview => parseTemplate => the requested tmpl does not exist =>"+t),"";try{a=a||r.template(o(t).html(),n)}catch(e){i.errare("preview => parseTemplate => problem when parsing tmpl =>"+t,e)}return a(e)}}),_prettyPrintLog:function(e){e=r.extend({bgCol:"#5ed1f5",textCol:"#000",consoleArguments:[]},e);var t,a=Array.from(e.consoleArguments);return a=r.isEmpty(r.filter(a,function(e){return!r.isString(e)}))?a.join(" "):JSON.stringify(a.join(" ")),["%c "+(t=a,r.isString(t)?300<t.length?t.substr(0,299)+"...":t:""),["background:"+e.bgCol,"color:"+e.textCol,"display: block;"].join(";")]},_wrapLogInsideTags:function(e,t,a){r.isUndefined(console)&&"function"!=typeof window.console.log||(sekPreviewLocalized.isDevMode?r.isUndefined(t)?console.log.apply(console,this._prettyPrintLog({bgCol:a,textCol:"#000",consoleArguments:["<"+e+">"]})):(console.log.apply(console,this._prettyPrintLog({bgCol:a,textCol:"#000",consoleArguments:["<"+e+">"]})),console.log(t),console.log.apply(console,this._prettyPrintLog({bgCol:a,textCol:"#000",consoleArguments:["</"+e+">"]}))):console.log.apply(console,this._prettyPrintLog({bgCol:a,textCol:"#000",consoleArguments:[e]})))},errare:function(e,t){this._wrapLogInsideTags(e,t,"#ffd5a0")},infoLog:function(e,t){this._wrapLogInsideTags(e,t,"#5ed1f5")},doAjax:function(e){var t=this,a=(e=e||(r.isObject(e)?e:{})).ajaxUrl||sekPreviewLocalized.ajaxUrl,i=sekPreviewLocalized.frontNonce,n=o.Deferred(),s=r.extend({action:"",withNonce:!1},e);return"https:"==document.location.protocol&&(a=a.replace("http://","https://")),r.isEmpty(s.action)||!r.isString(s.action)?(t.errare("self.doAjax : unproper action provided"),n.resolve().promise()):(s[i.id]=i.handle,!r.isObject(i)||r.isUndefined(i.id)||r.isUndefined(i.handle)?(t.errare("self.doAjax : unproper nonce"),n.resolve().promise()):(o.post(a,s).done(function(e){"0"!==e&&"-1"!==e&&!1!==e.success||(t.errare("self.doAjax : done ajax error for action : "+s.action,e),n.reject(e)),n.resolve(e)}).fail(function(e){t.errare("self.doAjax : failed ajax error for : "+s.action,e),n.reject(e)}),n.promise()))},isModuleRegistered:function(e){return sekPreviewLocalized.registeredModules&&!r.isUndefined(sekPreviewLocalized.registeredModules[e])},getRegisteredModuleProperty:function(e,t){return this.isModuleRegistered(e)?sekPreviewLocalized.registeredModules[e][t]:"not_set"}})}(wp.customize,jQuery,_);SekPreviewPrototype=SekPreviewPrototype||{};!function(e,t,a){t.extend(SekPreviewPrototype,e.Events);var i=e.Class.extend(SekPreviewPrototype);e.bind("preview-ready",function(){e.preview.bind("active",function(){try{e.sekPreview=new i}catch(e){SekPreviewPrototype.errare("SekPreviewConstructor => problem on instantiation",e)}})})}(wp.customize,jQuery,_);
|
inc/sektions/ccat-sektions.php
CHANGED
@@ -534,8 +534,6 @@ function sek_enqueue_controls_js_css() {
|
|
534 |
'all'
|
535 |
);
|
536 |
|
537 |
-
// registered modules
|
538 |
-
$registered_modules = CZR_Fmk_Base() -> registered_modules;
|
539 |
|
540 |
wp_enqueue_script(
|
541 |
'czr-sektions',
|
@@ -581,7 +579,7 @@ function sek_enqueue_controls_js_css() {
|
|
581 |
|
582 |
'presetSections' => sek_get_preset_sektions(),
|
583 |
|
584 |
-
'registeredModules' =>
|
585 |
|
586 |
// Dnd
|
587 |
'preDropElementClass' => 'sortable-placeholder',
|
@@ -1082,14 +1080,14 @@ function sek_set_input_tmpl___spacing( $input_id, $input_data ) {
|
|
1082 |
<div class="sek-pm-top-bottom-wrap sek-flex-justify-center">
|
1083 |
<div class="sek-flex-center-stretch" data-sek-spacing="margin-top">
|
1084 |
<div class="sek-pm-input-parent">
|
1085 |
-
<input class="sek-pm-input" value="
|
1086 |
</div>
|
1087 |
</div>
|
1088 |
</div>
|
1089 |
<div class="sek-pm-middle-wrap sek-flex-justify-center">
|
1090 |
<div class="sek-flex-center-stretch sek-pm-margin-left" data-sek-spacing="margin-left">
|
1091 |
<div class="sek-pm-input-parent">
|
1092 |
-
<input class="sek-pm-input" value="
|
1093 |
</div>
|
1094 |
</div>
|
1095 |
|
@@ -1097,26 +1095,26 @@ function sek_set_input_tmpl___spacing( $input_id, $input_data ) {
|
|
1097 |
<div class="sek-flex-justify-center">
|
1098 |
<div class="sek-flex-center-stretch" data-sek-spacing="padding-top">
|
1099 |
<div class="sek-pm-input-parent">
|
1100 |
-
<input class="sek-pm-input" value="
|
1101 |
</div>
|
1102 |
</div>
|
1103 |
</div>
|
1104 |
<div class="sek-flex-justify-center sek-flex-space-between">
|
1105 |
<div class="sek-flex-center-stretch" data-sek-spacing="padding-left">
|
1106 |
<div class="sek-pm-input-parent">
|
1107 |
-
<input class="sek-pm-input" value="
|
1108 |
</div>
|
1109 |
</div>
|
1110 |
<div class="sek-flex-center-stretch" data-sek-spacing="padding-right">
|
1111 |
<div class="sek-pm-input-parent">
|
1112 |
-
<input class="sek-pm-input" value="
|
1113 |
</div>
|
1114 |
</div>
|
1115 |
</div>
|
1116 |
<div class="sek-flex-justify-center">
|
1117 |
<div class="sek-flex-center-stretch" data-sek-spacing="padding-bottom">
|
1118 |
<div class="sek-pm-input-parent">
|
1119 |
-
<input class="sek-pm-input" value="
|
1120 |
</div>
|
1121 |
</div>
|
1122 |
</div>
|
@@ -1124,7 +1122,7 @@ function sek_set_input_tmpl___spacing( $input_id, $input_data ) {
|
|
1124 |
|
1125 |
<div class="sek-flex-center-stretch sek-pm-margin-right" data-sek-spacing="margin-right">
|
1126 |
<div class="sek-pm-input-parent">
|
1127 |
-
<input class="sek-pm-input" value="
|
1128 |
</div>
|
1129 |
</div>
|
1130 |
</div>
|
@@ -1132,7 +1130,7 @@ function sek_set_input_tmpl___spacing( $input_id, $input_data ) {
|
|
1132 |
<div class="sek-pm-top-bottom-wrap sek-flex-justify-center">
|
1133 |
<div class="sek-flex-center-stretch" data-sek-spacing="margin-bottom">
|
1134 |
<div class="sek-pm-input-parent">
|
1135 |
-
<input class="sek-pm-input" value="
|
1136 |
</div>
|
1137 |
</div>
|
1138 |
</div>
|
@@ -3987,11 +3985,14 @@ if ( ! class_exists( 'SEK_Front_Assets' ) ) :
|
|
3987 |
'i18n' => array(
|
3988 |
"You've reached the maximum number of columns allowed in this section." => __( "You've reached the maximum number of columns allowed in this section.", 'nimble-builder'),
|
3989 |
'Something went wrong, please refresh this page.' => __('Something went wrong, please refresh this page.', 'nimble-builder'),
|
3990 |
-
'Insert here' => __('Insert here', 'nimble-builder')
|
|
|
3991 |
),
|
3992 |
'isDevMode' => ( defined('WP_DEBUG') && true === WP_DEBUG ) || ( defined('NIMBLE_DEV') && true === NIMBLE_DEV ),
|
3993 |
'ajaxUrl' => admin_url( 'admin-ajax.php' ),
|
3994 |
-
'frontNonce' => array( 'id' => 'SEKFrontNonce', 'handle' => wp_create_nonce( 'sek-front-nonce' ) )
|
|
|
|
|
3995 |
)
|
3996 |
);
|
3997 |
|
@@ -4045,19 +4046,20 @@ if ( ! class_exists( 'SEK_Front_Assets' ) ) :
|
|
4045 |
<# if ( ! data.is_last_possible_section ) { #>
|
4046 |
<i class="fas fa-ellipsis-v sek-move-section" title="<?php _e( 'Move section', 'nimble-builder' ); ?>"></i>
|
4047 |
<# } #>
|
4048 |
-
<i data-sek-click-on="edit-options" class="material-icons sek-click-on" title="<?php _e( '
|
4049 |
<# if ( data.can_have_more_columns ) { #>
|
4050 |
<i data-sek-click-on="add-column" class="material-icons sek-click-on" title="<?php _e( 'Add a column', 'nimble-builder' ); ?>">view_column</i>
|
4051 |
<# } #>
|
4052 |
<i data-sek-click-on="duplicate" class="material-icons sek-click-on" title="<?php _e( 'Duplicate section', 'nimble-builder' ); ?>">filter_none</i>
|
|
|
4053 |
<i data-sek-click-on="remove" class="material-icons sek-click-on" title="<?php _e( 'Remove section', 'nimble-builder' ); ?>">delete_forever</i>
|
4054 |
</div>
|
4055 |
-
</div
|
4056 |
-
<span class="sek-dyn-ui-location-type" data-sek-click-on="edit-options" title="<?php _e( '
|
4057 |
<?php if ( defined( 'NIMBLE_DEV' ) && NIMBLE_DEV ) : ?>
|
4058 |
<!-- <div class="dev-level-data">{{ data.level}} : {{ data.id }}</div> -->
|
4059 |
<?php endif; ?>
|
4060 |
-
</div
|
4061 |
</script>
|
4062 |
|
4063 |
<script type="text/html" id="sek-dyn-ui-tmpl-column">
|
@@ -4066,7 +4068,7 @@ if ( ! class_exists( 'SEK_Front_Assets' ) ) :
|
|
4066 |
<div class="sek-dyn-ui-inner <?php echo $icon_left_side_class; ?>">
|
4067 |
<div class="sek-dyn-ui-icons">
|
4068 |
<i class="fas fa-ellipsis-v sek-move-column" title="<?php _e( 'Move column', 'nimble-builder' ); ?>"></i>
|
4069 |
-
<i data-sek-click-on="edit-options" class="material-icons sek-click-on" title="<?php _e( '
|
4070 |
<# if ( ! data.parent_is_last_allowed_nested ) { #>
|
4071 |
<i data-sek-click-on="add-section" class="material-icons sek-click-on" title="<?php _e( 'Add a nested section', 'nimble-builder' ); ?>">account_balance_wallet</i>
|
4072 |
<# } #>
|
@@ -4079,42 +4081,47 @@ if ( ! class_exists( 'SEK_Front_Assets' ) ) :
|
|
4079 |
<i data-sek-click-on="remove" class="material-icons sek-click-on" title="<?php _e( 'Remove column', 'nimble-builder' ); ?>">delete_forever</i>
|
4080 |
<# } #>
|
4081 |
</div>
|
4082 |
-
</div
|
4083 |
-
<span class="sek-dyn-ui-location-type" data-sek-click-on="edit-options" title="<?php _e( '
|
4084 |
<?php if ( defined( 'NIMBLE_DEV' ) && NIMBLE_DEV ) : ?>
|
4085 |
<!-- <div class="dev-level-data">{{ data.level}} : {{ data.id }}</div> -->
|
4086 |
<?php endif; ?>
|
4087 |
-
</div
|
4088 |
</script>
|
4089 |
|
4090 |
<script type="text/html" id="sek-dyn-ui-tmpl-module">
|
4091 |
<div class="sek-dyn-ui-wrapper sek-module-dyn-ui">
|
4092 |
-
<div class="editor-block-settings-menu"><?php // add class is-visible on hover ?>
|
4093 |
-
<div>
|
4094 |
-
<div>
|
4095 |
-
<button type="button" aria-expanded="false" aria-label="More Options" class="components-button components-icon-button editor-block-settings-menu__toggle">
|
4096 |
-
<svg aria-hidden="true" role="img" focusable="false" class="dashicon dashicons-ellipsis" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">
|
4097 |
-
<path d="M5 10c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2zm12-2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-7 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z">
|
4098 |
-
</path>
|
4099 |
-
</svg>
|
4100 |
-
</button>
|
4101 |
-
</div>
|
4102 |
-
</div>
|
4103 |
-
</div><?php // .editor-block-settings-menu ?>
|
4104 |
<div class="sek-dyn-ui-inner <?php echo $icon_left_side_class; ?>">
|
4105 |
<div class="sek-dyn-ui-icons">
|
4106 |
<i class="fas fa-ellipsis-v sek-move-module" title="<?php _e( 'Move module', 'nimble-builder' ); ?>"></i>
|
4107 |
-
<i data-sek-click-on="edit-module" class="fas fa-pencil-alt sek-tip sek-click-on" title="<?php _e( 'Edit
|
4108 |
-
<i data-sek-click-on="edit-options" class="material-icons sek-click-on" title="<?php _e( '
|
4109 |
<i data-sek-click-on="duplicate" class="material-icons sek-click-on" title="<?php _e( 'Duplicate module', 'nimble-builder' ); ?>">filter_none</i>
|
4110 |
<i data-sek-click-on="remove" class="material-icons sek-click-on" title="<?php _e( 'Remove module', 'nimble-builder' ); ?>">delete_forever</i>
|
4111 |
</div>
|
4112 |
-
</div
|
4113 |
-
|
|
|
|
|
|
|
4114 |
<?php if ( defined( 'NIMBLE_DEV' ) && NIMBLE_DEV ) : ?>
|
4115 |
<!-- <div class="dev-level-data">{{ data.level}} : {{ data.id }}</div> -->
|
4116 |
<?php endif; ?>
|
4117 |
-
</div><?php // .sek-dyn-ui-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4118 |
</script>
|
4119 |
<?php
|
4120 |
}
|
@@ -4125,6 +4132,10 @@ if ( ! class_exists( 'SEK_Front_Render' ) ) :
|
|
4125 |
class SEK_Front_Render extends SEK_Front_Assets {
|
4126 |
// Fired in __construct()
|
4127 |
function _schedule_front_rendering() {
|
|
|
|
|
|
|
|
|
4128 |
foreach( sek_get_locations() as $hook ) {
|
4129 |
switch ( $hook ) {
|
4130 |
case 'loop_start' :
|
@@ -4132,14 +4143,16 @@ if ( ! class_exists( 'SEK_Front_Render' ) ) :
|
|
4132 |
add_action( $hook, array( $this, 'sek_schedule_sektions_rendering' ) );
|
4133 |
break;
|
4134 |
case 'before_content' :
|
4135 |
-
add_filter('the_content', array( $this, 'sek_schedule_sektion_rendering_before_content' ),
|
4136 |
break;
|
4137 |
case 'after_content' :
|
4138 |
-
add_filter('the_content', array( $this, 'sek_schedule_sektion_rendering_after_content' ),
|
4139 |
break;
|
4140 |
}
|
4141 |
}
|
4142 |
|
|
|
|
|
4143 |
// add_filter( 'template_include', function( $template ) {
|
4144 |
// // error_log( 'TEMPLATE ? => ' . $template );
|
4145 |
// // error_log( 'DID_ACTION WP => ' . did_action('wp') );
|
@@ -4147,6 +4160,26 @@ if ( ! class_exists( 'SEK_Front_Render' ) ) :
|
|
4147 |
// });
|
4148 |
}
|
4149 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4150 |
// hook : loop_start, loop_end
|
4151 |
function sek_schedule_sektions_rendering() {
|
4152 |
// A location can be rendered only once
|
@@ -4160,24 +4193,35 @@ if ( ! class_exists( 'SEK_Front_Render' ) ) :
|
|
4160 |
do_action( 'sek_after_location_' . current_filter() );
|
4161 |
}
|
4162 |
|
4163 |
-
// hook :
|
4164 |
function sek_schedule_sektion_rendering_before_content( $html ) {
|
4165 |
if ( did_action( 'sek_before_location_before_content' ) )
|
4166 |
return $html;
|
|
|
4167 |
do_action( 'sek_before_location_before_content' );
|
4168 |
return $this -> _filter_the_content( $html, 'before_content' );
|
4169 |
-
do_action( 'sek_after_location_before_content' );
|
4170 |
}
|
4171 |
|
4172 |
-
// hook :
|
4173 |
function sek_schedule_sektion_rendering_after_content( $html ) {
|
4174 |
if ( did_action( 'sek_before_location_after_content' ) )
|
4175 |
return $html;
|
|
|
4176 |
do_action( 'sek_before_location_after_content' );
|
4177 |
return $this -> _filter_the_content( $html, 'after_content' );
|
4178 |
-
do_action( 'sek_after_location_after_content' );
|
4179 |
}
|
4180 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4181 |
private function _render_seks_for_location( $location = '' ) {
|
4182 |
if ( ! in_array( $location, sek_get_locations() ) ) {
|
4183 |
error_log( __CLASS__ . '::' . __FUNCTION__ . ' Error => the location ' . $location . ' is not registered in sek_get_locations()');
|
@@ -4185,34 +4229,25 @@ if ( ! class_exists( 'SEK_Front_Render' ) ) :
|
|
4185 |
}
|
4186 |
$locationSettingValue = sek_get_skoped_seks( skp_build_skope_id(), $location );
|
4187 |
if ( is_array( $locationSettingValue ) ) {
|
4188 |
-
|
4189 |
-
|
4190 |
-
//
|
4191 |
-
remove_filter('the_content', array( $this, 'sek_schedule_sektion_rendering_before_content' ),
|
4192 |
-
remove_filter('the_content', array( $this, 'sek_schedule_sektion_rendering_after_content' ),
|
4193 |
|
4194 |
$this->render( $locationSettingValue, $location );
|
4195 |
|
4196 |
-
add_filter('the_content', array( $this, 'sek_schedule_sektion_rendering_before_content' ),
|
4197 |
-
add_filter('the_content', array( $this, 'sek_schedule_sektion_rendering_after_content' ),
|
|
|
|
|
|
|
4198 |
} else {
|
4199 |
error_log( __CLASS__ . ' :: ' . __FUNCTION__ .' => sek_get_skoped_seks() should always return an array().');
|
4200 |
}
|
4201 |
}
|
4202 |
|
4203 |
-
private function _filter_the_content( $html, $where ) {
|
4204 |
-
if ( is_singular() && in_the_loop() && is_main_query() ) {
|
4205 |
-
ob_start();
|
4206 |
-
$this->_render_seks_for_location( $where );
|
4207 |
-
return 'before_content' == $where ? ob_get_clean() . $html : $html . ob_get_clean();
|
4208 |
-
}
|
4209 |
-
return $html;
|
4210 |
-
}
|
4211 |
-
|
4212 |
-
|
4213 |
-
|
4214 |
// Walk a model tree recursively and render each level with a specific template
|
4215 |
-
// Each level is described with at least 2 properties : collection and options
|
4216 |
function render( $model = array(), $location = 'loop_start' ) {
|
4217 |
//sek_error_log('LEVEL MODEL IN ::RENDER()', $model );
|
4218 |
// Is it the root level ?
|
@@ -4404,6 +4439,39 @@ if ( ! class_exists( 'SEK_Front_Render' ) ) :
|
|
4404 |
return $ph;
|
4405 |
}
|
4406 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4407 |
}//class
|
4408 |
endif;
|
4409 |
?><?php
|
534 |
'all'
|
535 |
);
|
536 |
|
|
|
|
|
537 |
|
538 |
wp_enqueue_script(
|
539 |
'czr-sektions',
|
579 |
|
580 |
'presetSections' => sek_get_preset_sektions(),
|
581 |
|
582 |
+
'registeredModules' => CZR_Fmk_Base() -> registered_modules,
|
583 |
|
584 |
// Dnd
|
585 |
'preDropElementClass' => 'sortable-placeholder',
|
1080 |
<div class="sek-pm-top-bottom-wrap sek-flex-justify-center">
|
1081 |
<div class="sek-flex-center-stretch" data-sek-spacing="margin-top">
|
1082 |
<div class="sek-pm-input-parent">
|
1083 |
+
<input class="sek-pm-input" value="" type="number" >
|
1084 |
</div>
|
1085 |
</div>
|
1086 |
</div>
|
1087 |
<div class="sek-pm-middle-wrap sek-flex-justify-center">
|
1088 |
<div class="sek-flex-center-stretch sek-pm-margin-left" data-sek-spacing="margin-left">
|
1089 |
<div class="sek-pm-input-parent">
|
1090 |
+
<input class="sek-pm-input" value="" type="number" >
|
1091 |
</div>
|
1092 |
</div>
|
1093 |
|
1095 |
<div class="sek-flex-justify-center">
|
1096 |
<div class="sek-flex-center-stretch" data-sek-spacing="padding-top">
|
1097 |
<div class="sek-pm-input-parent">
|
1098 |
+
<input class="sek-pm-input" value="" type="number" >
|
1099 |
</div>
|
1100 |
</div>
|
1101 |
</div>
|
1102 |
<div class="sek-flex-justify-center sek-flex-space-between">
|
1103 |
<div class="sek-flex-center-stretch" data-sek-spacing="padding-left">
|
1104 |
<div class="sek-pm-input-parent">
|
1105 |
+
<input class="sek-pm-input" value="" type="number" >
|
1106 |
</div>
|
1107 |
</div>
|
1108 |
<div class="sek-flex-center-stretch" data-sek-spacing="padding-right">
|
1109 |
<div class="sek-pm-input-parent">
|
1110 |
+
<input class="sek-pm-input" value="" type="number" >
|
1111 |
</div>
|
1112 |
</div>
|
1113 |
</div>
|
1114 |
<div class="sek-flex-justify-center">
|
1115 |
<div class="sek-flex-center-stretch" data-sek-spacing="padding-bottom">
|
1116 |
<div class="sek-pm-input-parent">
|
1117 |
+
<input class="sek-pm-input" value="" type="number" >
|
1118 |
</div>
|
1119 |
</div>
|
1120 |
</div>
|
1122 |
|
1123 |
<div class="sek-flex-center-stretch sek-pm-margin-right" data-sek-spacing="margin-right">
|
1124 |
<div class="sek-pm-input-parent">
|
1125 |
+
<input class="sek-pm-input" value="" type="number" >
|
1126 |
</div>
|
1127 |
</div>
|
1128 |
</div>
|
1130 |
<div class="sek-pm-top-bottom-wrap sek-flex-justify-center">
|
1131 |
<div class="sek-flex-center-stretch" data-sek-spacing="margin-bottom">
|
1132 |
<div class="sek-pm-input-parent">
|
1133 |
+
<input class="sek-pm-input" value="" type="number" >
|
1134 |
</div>
|
1135 |
</div>
|
1136 |
</div>
|
3985 |
'i18n' => array(
|
3986 |
"You've reached the maximum number of columns allowed in this section." => __( "You've reached the maximum number of columns allowed in this section.", 'nimble-builder'),
|
3987 |
'Something went wrong, please refresh this page.' => __('Something went wrong, please refresh this page.', 'nimble-builder'),
|
3988 |
+
'Insert here' => __('Insert here', 'nimble-builder'),
|
3989 |
+
'This content has been created with the WordPress editor.' => __('This content has been created with the WordPress editor.', 'nimble-builder' )
|
3990 |
),
|
3991 |
'isDevMode' => ( defined('WP_DEBUG') && true === WP_DEBUG ) || ( defined('NIMBLE_DEV') && true === NIMBLE_DEV ),
|
3992 |
'ajaxUrl' => admin_url( 'admin-ajax.php' ),
|
3993 |
+
'frontNonce' => array( 'id' => 'SEKFrontNonce', 'handle' => wp_create_nonce( 'sek-front-nonce' ) ),
|
3994 |
+
|
3995 |
+
'registeredModules' => CZR_Fmk_Base() -> registered_modules,
|
3996 |
)
|
3997 |
);
|
3998 |
|
4046 |
<# if ( ! data.is_last_possible_section ) { #>
|
4047 |
<i class="fas fa-ellipsis-v sek-move-section" title="<?php _e( 'Move section', 'nimble-builder' ); ?>"></i>
|
4048 |
<# } #>
|
4049 |
+
<i data-sek-click-on="edit-options" class="material-icons sek-click-on" title="<?php _e( 'Edit section settings', 'nimble-builder' ); ?>">settings</i>
|
4050 |
<# if ( data.can_have_more_columns ) { #>
|
4051 |
<i data-sek-click-on="add-column" class="material-icons sek-click-on" title="<?php _e( 'Add a column', 'nimble-builder' ); ?>">view_column</i>
|
4052 |
<# } #>
|
4053 |
<i data-sek-click-on="duplicate" class="material-icons sek-click-on" title="<?php _e( 'Duplicate section', 'nimble-builder' ); ?>">filter_none</i>
|
4054 |
+
<i data-sek-click-on="pick-module" class="material-icons sek-click-on" title="<?php _e( 'Add a module', 'nimble-builder' ); ?>">add_circle_outline</i>
|
4055 |
<i data-sek-click-on="remove" class="material-icons sek-click-on" title="<?php _e( 'Remove section', 'nimble-builder' ); ?>">delete_forever</i>
|
4056 |
</div>
|
4057 |
+
</div><?php // .sek-dyn-ui-inner ?>
|
4058 |
+
<span class="sek-dyn-ui-location-type" data-sek-click-on="edit-options" title="<?php _e( 'Edit section settings', 'nimble-builder' ); ?>"><?php _e( 'section', 'nimble-builder' ); ?></span>
|
4059 |
<?php if ( defined( 'NIMBLE_DEV' ) && NIMBLE_DEV ) : ?>
|
4060 |
<!-- <div class="dev-level-data">{{ data.level}} : {{ data.id }}</div> -->
|
4061 |
<?php endif; ?>
|
4062 |
+
</div><?php // .sek-dyn-ui-wrapper ?>
|
4063 |
</script>
|
4064 |
|
4065 |
<script type="text/html" id="sek-dyn-ui-tmpl-column">
|
4068 |
<div class="sek-dyn-ui-inner <?php echo $icon_left_side_class; ?>">
|
4069 |
<div class="sek-dyn-ui-icons">
|
4070 |
<i class="fas fa-ellipsis-v sek-move-column" title="<?php _e( 'Move column', 'nimble-builder' ); ?>"></i>
|
4071 |
+
<i data-sek-click-on="edit-options" class="material-icons sek-click-on" title="<?php _e( 'Edit column settings', 'nimble-builder' ); ?>">settings</i>
|
4072 |
<# if ( ! data.parent_is_last_allowed_nested ) { #>
|
4073 |
<i data-sek-click-on="add-section" class="material-icons sek-click-on" title="<?php _e( 'Add a nested section', 'nimble-builder' ); ?>">account_balance_wallet</i>
|
4074 |
<# } #>
|
4081 |
<i data-sek-click-on="remove" class="material-icons sek-click-on" title="<?php _e( 'Remove column', 'nimble-builder' ); ?>">delete_forever</i>
|
4082 |
<# } #>
|
4083 |
</div>
|
4084 |
+
</div><?php // .sek-dyn-ui-inner ?>
|
4085 |
+
<span class="sek-dyn-ui-location-type" data-sek-click-on="edit-options" title="<?php _e( 'Edit column settings', 'nimble-builder' ); ?>"><?php _e( 'column', 'nimble-builder' ); ?></span>
|
4086 |
<?php if ( defined( 'NIMBLE_DEV' ) && NIMBLE_DEV ) : ?>
|
4087 |
<!-- <div class="dev-level-data">{{ data.level}} : {{ data.id }}</div> -->
|
4088 |
<?php endif; ?>
|
4089 |
+
</div><?php // .sek-dyn-ui-wrapper ?>
|
4090 |
</script>
|
4091 |
|
4092 |
<script type="text/html" id="sek-dyn-ui-tmpl-module">
|
4093 |
<div class="sek-dyn-ui-wrapper sek-module-dyn-ui">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4094 |
<div class="sek-dyn-ui-inner <?php echo $icon_left_side_class; ?>">
|
4095 |
<div class="sek-dyn-ui-icons">
|
4096 |
<i class="fas fa-ellipsis-v sek-move-module" title="<?php _e( 'Move module', 'nimble-builder' ); ?>"></i>
|
4097 |
+
<i data-sek-click-on="edit-module" class="fas fa-pencil-alt sek-tip sek-click-on" title="<?php _e( 'Edit module content', 'nimble-builder' ); ?>"></i>
|
4098 |
+
<i data-sek-click-on="edit-options" class="material-icons sek-click-on" title="<?php _e( 'Edit module settings', 'nimble-builder' ); ?>">settings</i>
|
4099 |
<i data-sek-click-on="duplicate" class="material-icons sek-click-on" title="<?php _e( 'Duplicate module', 'nimble-builder' ); ?>">filter_none</i>
|
4100 |
<i data-sek-click-on="remove" class="material-icons sek-click-on" title="<?php _e( 'Remove module', 'nimble-builder' ); ?>">delete_forever</i>
|
4101 |
</div>
|
4102 |
+
</div><?php // .sek-dyn-ui-inner ?>
|
4103 |
+
<#
|
4104 |
+
var module_name = ! _.isEmpty( data.module_name ) ? data.module_name + ' ' + '<?php _e("module", "nimble-builder"); ?>' : '<?php _e("module", "nimble-builder"); ?>';
|
4105 |
+
#>
|
4106 |
+
<span class="sek-dyn-ui-location-type" data-sek-click-on="edit-module" title="<?php _e( 'Edit module settings', 'nimble-builder' ); ?>">{{module_name}}</span>
|
4107 |
<?php if ( defined( 'NIMBLE_DEV' ) && NIMBLE_DEV ) : ?>
|
4108 |
<!-- <div class="dev-level-data">{{ data.level}} : {{ data.id }}</div> -->
|
4109 |
<?php endif; ?>
|
4110 |
+
</div><?php // .sek-dyn-ui-wrapper ?>
|
4111 |
+
</script>
|
4112 |
+
|
4113 |
+
<script type="text/html" id="sek-dyn-ui-tmpl-wp-content">
|
4114 |
+
<div class="sek-dyn-ui-wrapper sek-wp-content-dyn-ui">
|
4115 |
+
<div class="sek-dyn-ui-inner">
|
4116 |
+
<div class="sek-dyn-ui-icons">
|
4117 |
+
<i class="fas fa-pencil-alt sek-edit-wp-content" title="<?php _e( 'Edit this WordPress content', 'nimble-builder' ); ?>"></i>
|
4118 |
+
</div>
|
4119 |
+
</div><?php // .sek-dyn-ui-inner ?>
|
4120 |
+
|
4121 |
+
<span class="sek-dyn-ui-location-type" title="<?php _e( 'Edit module settings', 'nimble-builder' ); ?>">
|
4122 |
+
<i class="fab fa-wordpress sek-edit-wp-content" title="<?php _e( 'Edit this WordPress content', 'nimble-builder' ); ?>"> <?php _e( 'WordPress content', 'nimble-builder'); ?></i>
|
4123 |
+
</span>
|
4124 |
+
</div><?php // .sek-dyn-ui-wrapper ?>
|
4125 |
</script>
|
4126 |
<?php
|
4127 |
}
|
4132 |
class SEK_Front_Render extends SEK_Front_Assets {
|
4133 |
// Fired in __construct()
|
4134 |
function _schedule_front_rendering() {
|
4135 |
+
if ( !defined( "NIMBLE_BEFORE_CONTENT_FILTER_PRIORITY" ) ) { define( "NIMBLE_BEFORE_CONTENT_FILTER_PRIORITY", 1 - PHP_INT_MAX ); }
|
4136 |
+
if ( !defined( "NIMBLE_AFTER_CONTENT_FILTER_PRIORITY" ) ) { define( "NIMBLE_AFTER_CONTENT_FILTER_PRIORITY", PHP_INT_MAX ); }
|
4137 |
+
if ( !defined( "NIMBLE_WP_CONTENT_WRAP_FILTER_PRIORITY" ) ) { define( "NIMBLE_WP_CONTENT_WRAP_FILTER_PRIORITY", - PHP_INT_MAX ); }
|
4138 |
+
|
4139 |
foreach( sek_get_locations() as $hook ) {
|
4140 |
switch ( $hook ) {
|
4141 |
case 'loop_start' :
|
4143 |
add_action( $hook, array( $this, 'sek_schedule_sektions_rendering' ) );
|
4144 |
break;
|
4145 |
case 'before_content' :
|
4146 |
+
add_filter('the_content', array( $this, 'sek_schedule_sektion_rendering_before_content' ), NIMBLE_BEFORE_CONTENT_FILTER_PRIORITY );
|
4147 |
break;
|
4148 |
case 'after_content' :
|
4149 |
+
add_filter('the_content', array( $this, 'sek_schedule_sektion_rendering_after_content' ), NIMBLE_AFTER_CONTENT_FILTER_PRIORITY );
|
4150 |
break;
|
4151 |
}
|
4152 |
}
|
4153 |
|
4154 |
+
add_filter( 'the_content', array( $this, 'sek_wrap_wp_content' ), NIMBLE_WP_CONTENT_WRAP_FILTER_PRIORITY );
|
4155 |
+
|
4156 |
// add_filter( 'template_include', function( $template ) {
|
4157 |
// // error_log( 'TEMPLATE ? => ' . $template );
|
4158 |
// // error_log( 'DID_ACTION WP => ' . did_action('wp') );
|
4160 |
// });
|
4161 |
}
|
4162 |
|
4163 |
+
// Encapsulate the singular post / page content so we can generate a dynamic ui around it when customizing
|
4164 |
+
// @filter the_content::NIMBLE_WP_CONTENT_WRAP_FILTER_PRIORITY
|
4165 |
+
function sek_wrap_wp_content( $html ) {
|
4166 |
+
if ( ! skp_is_customizing() || ( defined('DOING_AJAX') && DOING_AJAX ) )
|
4167 |
+
return $html;
|
4168 |
+
if ( is_singular() && in_the_loop() && is_main_query() ) {
|
4169 |
+
global $post;
|
4170 |
+
// note : the edit url is printed as a data attribute to prevent being automatically parsed by wp when customizing and turned into a changeset url
|
4171 |
+
$html = sprintf( '<div class="sek-wp-content-wrapper" data-sek-wp-post-id="%1$s" data-sek-wp-edit-link="%2$s" title="%3$s">%4$s</div>',
|
4172 |
+
$post->ID,
|
4173 |
+
// we can't rely on the get_edit_post_link() function when customizing because emptied by wp core
|
4174 |
+
$this->get_unfiltered_edit_post_link( $post->ID ),
|
4175 |
+
__( 'WordPress content', 'nimble-builder'),
|
4176 |
+
wpautop( $html )
|
4177 |
+
);
|
4178 |
+
}
|
4179 |
+
return $html;
|
4180 |
+
}
|
4181 |
+
|
4182 |
+
|
4183 |
// hook : loop_start, loop_end
|
4184 |
function sek_schedule_sektions_rendering() {
|
4185 |
// A location can be rendered only once
|
4193 |
do_action( 'sek_after_location_' . current_filter() );
|
4194 |
}
|
4195 |
|
4196 |
+
// hook : 'the_content'::-9999
|
4197 |
function sek_schedule_sektion_rendering_before_content( $html ) {
|
4198 |
if ( did_action( 'sek_before_location_before_content' ) )
|
4199 |
return $html;
|
4200 |
+
|
4201 |
do_action( 'sek_before_location_before_content' );
|
4202 |
return $this -> _filter_the_content( $html, 'before_content' );
|
|
|
4203 |
}
|
4204 |
|
4205 |
+
// hook : 'the_content'::9999
|
4206 |
function sek_schedule_sektion_rendering_after_content( $html ) {
|
4207 |
if ( did_action( 'sek_before_location_after_content' ) )
|
4208 |
return $html;
|
4209 |
+
|
4210 |
do_action( 'sek_before_location_after_content' );
|
4211 |
return $this -> _filter_the_content( $html, 'after_content' );
|
|
|
4212 |
}
|
4213 |
|
4214 |
+
private function _filter_the_content( $html, $where ) {
|
4215 |
+
if ( is_singular() && in_the_loop() && is_main_query() ) {
|
4216 |
+
ob_start();
|
4217 |
+
$this->_render_seks_for_location( $where );
|
4218 |
+
$html = 'before_content' == $where ? ob_get_clean() . $html : $html . ob_get_clean();
|
4219 |
+
}
|
4220 |
+
|
4221 |
+
return $html;
|
4222 |
+
}
|
4223 |
+
|
4224 |
+
|
4225 |
private function _render_seks_for_location( $location = '' ) {
|
4226 |
if ( ! in_array( $location, sek_get_locations() ) ) {
|
4227 |
error_log( __CLASS__ . '::' . __FUNCTION__ . ' Error => the location ' . $location . ' is not registered in sek_get_locations()');
|
4229 |
}
|
4230 |
$locationSettingValue = sek_get_skoped_seks( skp_build_skope_id(), $location );
|
4231 |
if ( is_array( $locationSettingValue ) ) {
|
4232 |
+
|
4233 |
+
remove_filter('the_content', array( $this, 'sek_wrap_wp_content' ), NIMBLE_WP_CONTENT_WRAP_FILTER_PRIORITY );
|
4234 |
+
// sek_error_log( 'LEVEL MODEL IN ::sek_schedule_sektions_rendering()', $locationSettingValue);
|
4235 |
+
remove_filter('the_content', array( $this, 'sek_schedule_sektion_rendering_before_content' ), NIMBLE_BEFORE_CONTENT_FILTER_PRIORITY );
|
4236 |
+
remove_filter('the_content', array( $this, 'sek_schedule_sektion_rendering_after_content' ), NIMBLE_AFTER_CONTENT_FILTER_PRIORITY );
|
4237 |
|
4238 |
$this->render( $locationSettingValue, $location );
|
4239 |
|
4240 |
+
add_filter('the_content', array( $this, 'sek_schedule_sektion_rendering_before_content' ),NIMBLE_BEFORE_CONTENT_FILTER_PRIORITY );
|
4241 |
+
add_filter('the_content', array( $this, 'sek_schedule_sektion_rendering_after_content' ), NIMBLE_AFTER_CONTENT_FILTER_PRIORITY );
|
4242 |
+
|
4243 |
+
add_filter('the_content', array( $this, 'sek_wrap_wp_content' ), NIMBLE_WP_CONTENT_WRAP_FILTER_PRIORITY );
|
4244 |
+
|
4245 |
} else {
|
4246 |
error_log( __CLASS__ . ' :: ' . __FUNCTION__ .' => sek_get_skoped_seks() should always return an array().');
|
4247 |
}
|
4248 |
}
|
4249 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4250 |
// Walk a model tree recursively and render each level with a specific template
|
|
|
4251 |
function render( $model = array(), $location = 'loop_start' ) {
|
4252 |
//sek_error_log('LEVEL MODEL IN ::RENDER()', $model );
|
4253 |
// Is it the root level ?
|
4439 |
return $ph;
|
4440 |
}
|
4441 |
}
|
4442 |
+
|
4443 |
+
|
4444 |
+
|
4445 |
+
/**
|
4446 |
+
* unfiltered version of get_edit_post_link() located in wp-includes/link-template.php
|
4447 |
+
* ( filtered by wp core when invoked in customize-preview )
|
4448 |
+
*/
|
4449 |
+
function get_unfiltered_edit_post_link( $id = 0, $context = 'display' ) {
|
4450 |
+
if ( ! $post = get_post( $id ) )
|
4451 |
+
return;
|
4452 |
+
|
4453 |
+
if ( 'revision' === $post->post_type )
|
4454 |
+
$action = '';
|
4455 |
+
elseif ( 'display' == $context )
|
4456 |
+
$action = '&action=edit';
|
4457 |
+
else
|
4458 |
+
$action = '&action=edit';
|
4459 |
+
|
4460 |
+
$post_type_object = get_post_type_object( $post->post_type );
|
4461 |
+
if ( !$post_type_object )
|
4462 |
+
return;
|
4463 |
+
|
4464 |
+
if ( !current_user_can( 'edit_post', $post->ID ) )
|
4465 |
+
return;
|
4466 |
+
|
4467 |
+
if ( $post_type_object->_edit_link ) {
|
4468 |
+
$link = admin_url( sprintf( $post_type_object->_edit_link . $action, $post->ID ) );
|
4469 |
+
} else {
|
4470 |
+
$link = '';
|
4471 |
+
}
|
4472 |
+
return $link;
|
4473 |
+
}
|
4474 |
+
|
4475 |
}//class
|
4476 |
endif;
|
4477 |
?><?php
|
nimble-builder.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/**
|
3 |
* Plugin Name: Nimble Builder
|
4 |
* Description: Drag and drop page builder for the WordPress live customizer.
|
5 |
-
* Version: 1.0.
|
6 |
* Text Domain: nimble-builder
|
7 |
* Author: Press Customizr
|
8 |
* Author URI: https://presscustomizr.com
|
@@ -11,7 +11,7 @@
|
|
11 |
/* ------------------------------------------------------------------------- *
|
12 |
* CONSTANTS
|
13 |
/* ------------------------------------------------------------------------- */
|
14 |
-
$current_version = "1.0.
|
15 |
if ( !defined( "NIMBLE_VERSION" ) ) { define( "NIMBLE_VERSION", $current_version ); }
|
16 |
if ( !defined( 'NIMBLE_ASSETS_VERSION' ) ) {
|
17 |
define( 'NIMBLE_ASSETS_VERSION', ( ( defined( 'NIMBLE_DEV' ) && NIMBLE_DEV ) || ( defined( 'WP_DEBUG' ) && WP_DEBUG ) ) ? time() : NIMBLE_VERSION );
|
2 |
/**
|
3 |
* Plugin Name: Nimble Builder
|
4 |
* Description: Drag and drop page builder for the WordPress live customizer.
|
5 |
+
* Version: 1.0.3
|
6 |
* Text Domain: nimble-builder
|
7 |
* Author: Press Customizr
|
8 |
* Author URI: https://presscustomizr.com
|
11 |
/* ------------------------------------------------------------------------- *
|
12 |
* CONSTANTS
|
13 |
/* ------------------------------------------------------------------------- */
|
14 |
+
$current_version = "1.0.3";
|
15 |
if ( !defined( "NIMBLE_VERSION" ) ) { define( "NIMBLE_VERSION", $current_version ); }
|
16 |
if ( !defined( 'NIMBLE_ASSETS_VERSION' ) ) {
|
17 |
define( 'NIMBLE_ASSETS_VERSION', ( ( defined( 'NIMBLE_DEV' ) && NIMBLE_DEV ) || ( defined( 'WP_DEBUG' ) && WP_DEBUG ) ) ? time() : NIMBLE_VERSION );
|
readme.txt
CHANGED
@@ -6,7 +6,7 @@ Tags: customizer, editor, page builder, drag and drop
|
|
6 |
Requires at least: 4.7
|
7 |
Requires PHP: 5.4
|
8 |
Tested up to: 4.9.6
|
9 |
-
Stable tag: 1.0.
|
10 |
License: GPLv3
|
11 |
License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
12 |
|
@@ -41,11 +41,29 @@ The Nimble Builder is a lightweight drag and drop page builder designed to work
|
|
41 |
Yes, the Nimble Builder works with any WordPress theme. If you experience any problem with a particular theme, please report it in the [plugin support forum](https://wordpress.org/support/plugin/nimble-builder).
|
42 |
|
43 |
== Upgrade Notice ==
|
44 |
-
= 1.0.
|
45 |
-
|
46 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
|
48 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
= 1.0.2 : June 7th, 2018 =
|
50 |
* info : Nimble has been approved to be hosted on the wordpress.org plugin repository!
|
51 |
* fixed : the background overlay should not be applied to a level when there's no background image
|
6 |
Requires at least: 4.7
|
7 |
Requires PHP: 5.4
|
8 |
Tested up to: 4.9.6
|
9 |
+
Stable tag: 1.0.3
|
10 |
License: GPLv3
|
11 |
License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
12 |
|
41 |
Yes, the Nimble Builder works with any WordPress theme. If you experience any problem with a particular theme, please report it in the [plugin support forum](https://wordpress.org/support/plugin/nimble-builder).
|
42 |
|
43 |
== Upgrade Notice ==
|
44 |
+
= 1.0.3 =
|
45 |
+
* fixed : missing dropzones around nested sections
|
46 |
+
* fixed : reseting the spacing of a level was not changing the main setting.
|
47 |
+
* fixed : the tinyMceEditor not collapsing on 'sek-notify'
|
48 |
+
* improved : tinyMce text editor => attach callbacks on 'input' instead of 'change keyup'
|
49 |
+
* improved : module dynamic ui => print the module name instead of 'module' at the bottom
|
50 |
+
* improved : when clicking more than one time one the + ui icon, visually remind the user that a module should be dragged, with a light animation on the module picker container
|
51 |
+
* added : encapsulate the singular post / page content inside a dom element so we can generate a dynamic ui around it when customizing + add an edit link to the post or page
|
52 |
+
* added : introduced a loader overlay printed when the markup of any level being refreshed.
|
53 |
+
* added : a "+" icon to add module from the sections dynamic UI
|
54 |
|
55 |
== Changelog ==
|
56 |
+
= 1.0.3 : June 9th, 2018 =
|
57 |
+
* fixed : missing dropzones around nested sections
|
58 |
+
* fixed : reseting the spacing of a level was not changing the main setting.
|
59 |
+
* fixed : the tinyMceEditor not collapsing on 'sek-notify'
|
60 |
+
* improved : tinyMce text editor => attach callbacks on 'input' instead of 'change keyup'
|
61 |
+
* improved : module dynamic ui => print the module name instead of 'module' at the bottom
|
62 |
+
* improved : when clicking more than one time one the + ui icon, visually remind the user that a module should be dragged, with a light animation on the module picker container
|
63 |
+
* added : encapsulate the singular post / page content inside a dom element so we can generate a dynamic ui around it when customizing + add an edit link to the post or page
|
64 |
+
* added : introduced a loader overlay printed when the markup of any level being refreshed.
|
65 |
+
* added : a "+" icon to add module from the sections dynamic UI
|
66 |
+
|
67 |
= 1.0.2 : June 7th, 2018 =
|
68 |
* info : Nimble has been approved to be hosted on the wordpress.org plugin repository!
|
69 |
* fixed : the background overlay should not be applied to a level when there's no background image
|